From 6af6663fd2335231df18a38f4bad066443cfb6f1 Mon Sep 17 00:00:00 2001 From: support Date: Thu, 14 Apr 2022 09:25:51 +0000 Subject: [PATCH] Built motion from commit 4d5ba482.|2.6.8 --- 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/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- 1195 files changed, 1195 insertions(+), 1195 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 393b075..178edd7 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-14T09:01:20.910Z", + "time": "2022-04-14T09:18:03.340Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 9040007..4027e83 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-14T09:01:20.910Z", + "time": "2022-04-14T09:18:03.340Z", "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 c988cab..178a8a6 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 _0x1be5=['TEXT','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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[headers],\x20browser[wsindowHeight]'];(function(_0x3e9080,_0x13c6df){var _0x5005dc=function(_0x163ca2){while(--_0x163ca2){_0x3e9080['push'](_0x3e9080['shift']());}};_0x5005dc(++_0x13c6df);}(_0x1be5,0x91));var _0x51be=function(_0x45156b,_0x8adace){_0x45156b=_0x45156b-0x0;var _0x36980c=_0x1be5[_0x45156b];return _0x36980c;};'use strict';var Sequelize=require('sequelize');module[_0x51be('0x0')]={'name':{'type':Sequelize[_0x51be('0x1')],'get':function(_0x3ccccb){return this[_0x51be('0x2')](_0x51be('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x51be('0x4'),_0x51be('0x5'),_0x51be('0x6'),'jscripty',_0x51be('0x7'),'browser',_0x51be('0x8'),_0x51be('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x51be('0xa')},'data1':{'type':Sequelize[_0x51be('0xb')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x51be('0xb')](0x1000),'comment':_0x51be('0xc')},'data4':{'type':Sequelize[_0x51be('0xb')](0x1000),'comments':_0x51be('0xd')},'data5':{'type':Sequelize[_0x51be('0xb')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x51be('0xb')],'comments':_0x51be('0xe')},'data7':{'type':Sequelize[_0x51be('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x1a42=['STRING','contactManager','motionbar','urlForward','browser','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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','exports','VIRTUAL','getDataValue','action'];(function(_0x563107,_0x4283d3){var _0x578d98=function(_0x446017){while(--_0x446017){_0x563107['push'](_0x563107['shift']());}};_0x578d98(++_0x4283d3);}(_0x1a42,0x12c));var _0x21a4=function(_0x58eca9,_0x219608){_0x58eca9=_0x58eca9-0x0;var _0x25a12e=_0x1a42[_0x58eca9];return _0x25a12e;};'use strict';var Sequelize=require('sequelize');module[_0x21a4('0x0')]={'name':{'type':Sequelize[_0x21a4('0x1')],'get':function(_0x3c94dd){return this[_0x21a4('0x2')](_0x21a4('0x3'));}},'action':{'type':Sequelize[_0x21a4('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x21a4('0x5'),'integration',_0x21a4('0x6'),'jscripty',_0x21a4('0x7'),_0x21a4('0x8'),_0x21a4('0x9'),_0x21a4('0xa')]],'msg':_0x21a4('0xb')}},'comment':_0x21a4('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x21a4('0xc')},'data2':{'type':Sequelize[_0x21a4('0x4')](0x1000),'comment':_0x21a4('0xd')},'data3':{'type':Sequelize[_0x21a4('0x4')](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[_0x21a4('0x4')](0x1000),'comments':_0x21a4('0xe')},'data5':{'type':Sequelize[_0x21a4('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x21a4('0x4')],'comments':_0x21a4('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index ebc0e3d..706c2cd 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 _0x555b=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','update','body','Action','find','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x12c766,_0x4dbf56){var _0x3d7ae6=function(_0x83963f){while(--_0x83963f){_0x12c766['push'](_0x12c766['shift']());}};_0x3d7ae6(++_0x4dbf56);}(_0x555b,0x1de));var _0xb555=function(_0xbc759d,_0x591154){_0xbc759d=_0xbc759d-0x0;var _0x1feac5=_0x555b[_0xbc759d];return _0x1feac5;};'use strict';var emlformat=require(_0xb555('0x0'));var rimraf=require(_0xb555('0x1'));var zipdir=require(_0xb555('0x2'));var jsonpatch=require(_0xb555('0x3'));var rp=require(_0xb555('0x4'));var moment=require('moment');var BPromise=require(_0xb555('0x5'));var Mustache=require('mustache');var util=require(_0xb555('0x6'));var path=require(_0xb555('0x7'));var sox=require(_0xb555('0x8'));var csv=require(_0xb555('0x9'));var ejs=require(_0xb555('0xa'));var fs=require('fs');var fs_extra=require(_0xb555('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb555('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb555('0xd'));var toCsv=require(_0xb555('0x9'));var querystring=require(_0xb555('0xe'));var Papa=require(_0xb555('0xf'));var Redis=require(_0xb555('0x10'));var authService=require(_0xb555('0x11'));var qs=require(_0xb555('0x12'));var as=require(_0xb555('0x13'));var hardwareService=require(_0xb555('0x14'));var logger=require('../../config/logger')(_0xb555('0x15'));var utils=require(_0xb555('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb555('0x17'));var db=require(_0xb555('0x18'))['db'];function respondWithStatusCode(_0x5cda56,_0x3100e5){_0x3100e5=_0x3100e5||0xcc;return function(_0x54ddbf){if(_0x54ddbf){return _0x5cda56[_0xb555('0x19')](_0x3100e5);}return _0x5cda56[_0xb555('0x1a')](_0x3100e5)[_0xb555('0x1b')]();};}function respondWithResult(_0x1ef61d,_0x28cc10){_0x28cc10=_0x28cc10||0xc8;return function(_0x9526f0){if(_0x9526f0){return _0x1ef61d[_0xb555('0x1a')](_0x28cc10)[_0xb555('0x1c')](_0x9526f0);}};}function respondWithFilteredResult(_0x52e6c8,_0xa365d4){return function(_0x339bb9){if(_0x339bb9){var _0x456336=typeof _0xa365d4[_0xb555('0x1d')]===_0xb555('0x1e')&&typeof _0xa365d4[_0xb555('0x1f')]===_0xb555('0x1e');var _0x251ff1=_0x339bb9[_0xb555('0x20')];var _0x181beb=_0x456336?0x0:_0xa365d4[_0xb555('0x1d')];var _0x289673=_0x456336?_0x339bb9[_0xb555('0x20')]:_0xa365d4[_0xb555('0x1d')]+_0xa365d4['limit'];var _0x2f1862;if(_0x289673>=_0x251ff1){_0x289673=_0x251ff1;_0x2f1862=0xc8;}else{_0x2f1862=0xce;}_0x52e6c8[_0xb555('0x1a')](_0x2f1862);return _0x52e6c8[_0xb555('0x21')](_0xb555('0x22'),_0x181beb+'-'+_0x289673+'/'+_0x251ff1)[_0xb555('0x1c')](_0x339bb9);}return null;};}function patchUpdates(_0x1f82af){return function(_0x9d63d6){try{jsonpatch[_0xb555('0x23')](_0x9d63d6,_0x1f82af,!![]);}catch(_0x101303){return BPromise[_0xb555('0x24')](_0x101303);}return _0x9d63d6[_0xb555('0x25')]();};}function saveUpdates(_0x9e0137,_0x46203f){return function(_0x457539){if(_0x457539){return _0x457539['update'](_0x9e0137)[_0xb555('0x26')](function(_0x2b0967){return _0x2b0967;});}return null;};}function removeEntity(_0x945fd9,_0x42b228){return function(_0x146954){if(_0x146954){return _0x146954['destroy']()[_0xb555('0x26')](function(){_0x945fd9['status'](0xcc)[_0xb555('0x1b')]();});}};}function handleEntityNotFound(_0x3da395,_0x3caedd){return function(_0x28ac63){if(!_0x28ac63){_0x3da395[_0xb555('0x19')](0x194);}return _0x28ac63;};}function handleError(_0x2d67ca,_0x554694){_0x554694=_0x554694||0x1f4;return function(_0x44e6b9){logger[_0xb555('0x27')](_0x44e6b9[_0xb555('0x28')]);if(_0x44e6b9[_0xb555('0x29')]){delete _0x44e6b9[_0xb555('0x29')];}_0x2d67ca['status'](_0x554694)[_0xb555('0x2a')](_0x44e6b9);};}exports[_0xb555('0x2b')]=function(_0x1ea36e,_0x11e23a){if(_0x1ea36e['body']['id']){delete _0x1ea36e[_0xb555('0x2c')]['id'];}return db[_0xb555('0x2d')][_0xb555('0x2e')]({'where':{'id':_0x1ea36e[_0xb555('0x2f')]['id']}})[_0xb555('0x26')](handleEntityNotFound(_0x11e23a,null))[_0xb555('0x26')](saveUpdates(_0x1ea36e[_0xb555('0x2c')],null))['then'](respondWithResult(_0x11e23a,null))[_0xb555('0x30')](handleError(_0x11e23a,null));};exports[_0xb555('0x31')]=function(_0xd64e89,_0x2537d8){return db['Action'][_0xb555('0x2e')]({'where':{'id':_0xd64e89[_0xb555('0x2f')]['id']}})['then'](handleEntityNotFound(_0x2537d8,null))[_0xb555('0x26')](removeEntity(_0x2537d8,null))[_0xb555('0x30')](handleError(_0x2537d8,null));}; \ No newline at end of file +var _0x5ddc=['undefined','count','set','Content-Range','save','update','then','sendStatus','error','name','send','body','Action','params','catch','destroy','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','limit'];(function(_0x3e40b8,_0x27358a){var _0x456430=function(_0x3310f3){while(--_0x3310f3){_0x3e40b8['push'](_0x3e40b8['shift']());}};_0x456430(++_0x27358a);}(_0x5ddc,0x153));var _0xc5dd=function(_0x12e0e1,_0x29192d){_0x12e0e1=_0x12e0e1-0x0;var _0x241fa5=_0x5ddc[_0x12e0e1];return _0x241fa5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5dd('0x0'));var zipdir=require(_0xc5dd('0x1'));var jsonpatch=require(_0xc5dd('0x2'));var rp=require(_0xc5dd('0x3'));var moment=require(_0xc5dd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc5dd('0x5'));var util=require(_0xc5dd('0x6'));var path=require(_0xc5dd('0x7'));var sox=require(_0xc5dd('0x8'));var csv=require(_0xc5dd('0x9'));var ejs=require(_0xc5dd('0xa'));var fs=require('fs');var fs_extra=require(_0xc5dd('0xb'));var _=require('lodash');var squel=require(_0xc5dd('0xc'));var crypto=require(_0xc5dd('0xd'));var jsforce=require(_0xc5dd('0xe'));var deskjs=require(_0xc5dd('0xf'));var toCsv=require(_0xc5dd('0x9'));var querystring=require(_0xc5dd('0x10'));var Papa=require(_0xc5dd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc5dd('0x12'));var hardwareService=require(_0xc5dd('0x13'));var logger=require(_0xc5dd('0x14'))(_0xc5dd('0x15'));var utils=require(_0xc5dd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc5dd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44bb38,_0x2e7d6c){_0x2e7d6c=_0x2e7d6c||0xcc;return function(_0x4b7b99){if(_0x4b7b99){return _0x44bb38['sendStatus'](_0x2e7d6c);}return _0x44bb38[_0xc5dd('0x18')](_0x2e7d6c)[_0xc5dd('0x19')]();};}function respondWithResult(_0x331f89,_0x474d8a){_0x474d8a=_0x474d8a||0xc8;return function(_0x2c9a1d){if(_0x2c9a1d){return _0x331f89[_0xc5dd('0x18')](_0x474d8a)[_0xc5dd('0x1a')](_0x2c9a1d);}};}function respondWithFilteredResult(_0x548d70,_0x3d3781){return function(_0xfd7b81){if(_0xfd7b81){var _0x2f56f3=typeof _0x3d3781[_0xc5dd('0x1b')]==='undefined'&&typeof _0x3d3781[_0xc5dd('0x1c')]===_0xc5dd('0x1d');var _0x2b58b5=_0xfd7b81['count'];var _0x14fbf1=_0x2f56f3?0x0:_0x3d3781[_0xc5dd('0x1b')];var _0x2dde31=_0x2f56f3?_0xfd7b81[_0xc5dd('0x1e')]:_0x3d3781[_0xc5dd('0x1b')]+_0x3d3781[_0xc5dd('0x1c')];var _0x298dbc;if(_0x2dde31>=_0x2b58b5){_0x2dde31=_0x2b58b5;_0x298dbc=0xc8;}else{_0x298dbc=0xce;}_0x548d70[_0xc5dd('0x18')](_0x298dbc);return _0x548d70[_0xc5dd('0x1f')](_0xc5dd('0x20'),_0x14fbf1+'-'+_0x2dde31+'/'+_0x2b58b5)[_0xc5dd('0x1a')](_0xfd7b81);}return null;};}function patchUpdates(_0x1e13db){return function(_0x25a80d){try{jsonpatch['apply'](_0x25a80d,_0x1e13db,!![]);}catch(_0x514a85){return BPromise['reject'](_0x514a85);}return _0x25a80d[_0xc5dd('0x21')]();};}function saveUpdates(_0x5eeb4b,_0x58c90d){return function(_0x15e6c8){if(_0x15e6c8){return _0x15e6c8[_0xc5dd('0x22')](_0x5eeb4b)['then'](function(_0x7b2b1d){return _0x7b2b1d;});}return null;};}function removeEntity(_0x4553ea,_0x509a3d){return function(_0x5a7786){if(_0x5a7786){return _0x5a7786['destroy']()[_0xc5dd('0x23')](function(){_0x4553ea['status'](0xcc)[_0xc5dd('0x19')]();});}};}function handleEntityNotFound(_0x12944c,_0x5a700d){return function(_0x12fd4f){if(!_0x12fd4f){_0x12944c[_0xc5dd('0x24')](0x194);}return _0x12fd4f;};}function handleError(_0x162453,_0x280a6a){_0x280a6a=_0x280a6a||0x1f4;return function(_0x33b32a){logger[_0xc5dd('0x25')](_0x33b32a['stack']);if(_0x33b32a[_0xc5dd('0x26')]){delete _0x33b32a[_0xc5dd('0x26')];}_0x162453['status'](_0x280a6a)[_0xc5dd('0x27')](_0x33b32a);};}exports['update']=function(_0x1c5752,_0x13216c){if(_0x1c5752[_0xc5dd('0x28')]['id']){delete _0x1c5752[_0xc5dd('0x28')]['id'];}return db[_0xc5dd('0x29')]['find']({'where':{'id':_0x1c5752[_0xc5dd('0x2a')]['id']}})[_0xc5dd('0x23')](handleEntityNotFound(_0x13216c,null))[_0xc5dd('0x23')](saveUpdates(_0x1c5752['body'],null))[_0xc5dd('0x23')](respondWithResult(_0x13216c,null))[_0xc5dd('0x2b')](handleError(_0x13216c,null));};exports[_0xc5dd('0x2c')]=function(_0x3f05a3,_0x1f348f){return db[_0xc5dd('0x29')][_0xc5dd('0x2d')]({'where':{'id':_0x3f05a3['params']['id']}})[_0xc5dd('0x23')](handleEntityNotFound(_0x1f348f,null))[_0xc5dd('0x23')](removeEntity(_0x1f348f,null))[_0xc5dd('0x2b')](handleError(_0x1f348f,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index b9b94b3..4160641 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 _0xa6e6=['../../config/logger','api','moment','request-promise','path','../../config/environment','./action.attributes','define','tools_actions','lodash'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xa6e6,0x167));var _0x6a6e=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0xa6e6[_0xfbdff6];return _0x4cb9be;};'use strict';var _=require(_0x6a6e('0x0'));var util=require('util');var logger=require(_0x6a6e('0x1'))(_0x6a6e('0x2'));var moment=require(_0x6a6e('0x3'));var BPromise=require('bluebird');var rp=require(_0x6a6e('0x4'));var fs=require('fs');var path=require(_0x6a6e('0x5'));var rimraf=require('rimraf');var config=require(_0x6a6e('0x6'));var attributes=require(_0x6a6e('0x7'));module['exports']=function(_0x531aab,_0x45365c){return _0x531aab[_0x6a6e('0x8')]('Action',attributes,{'tableName':_0x6a6e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a68=['Action','tools_actions','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x0a68,0x11a));var _0x80a6=function(_0x3b5414,_0x80f3bd){_0x3b5414=_0x3b5414-0x0;var _0x331233=_0x0a68[_0x3b5414];return _0x331233;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x80a6('0x0'))('api');var moment=require(_0x80a6('0x1'));var BPromise=require(_0x80a6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80a6('0x3'));var rimraf=require(_0x80a6('0x4'));var config=require(_0x80a6('0x5'));var attributes=require(_0x80a6('0x6'));module[_0x80a6('0x7')]=function(_0x5f58f8,_0x567ca3){return _0x5f58f8['define'](_0x80a6('0x8'),attributes,{'tableName':_0x80a6('0x9'),'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 f0ee8b0..7d67e38 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x7217,0x19e));var _0x7721=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x7217[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x9a1d84,_0x211b00){var _0x584812=function(_0x50c0d9){while(--_0x50c0d9){_0x9a1d84['push'](_0x9a1d84['shift']());}};_0x584812(++_0x211b00);}(_0x5fc3,0xa8));var _0x35fc=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0x5fc3[_0x903228];return _0xcec81d;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 5067bb7..3677ebc 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 _0x9849=['put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./action.controller'];(function(_0x148bbb,_0x26d402){var _0x38619c=function(_0x5f0027){while(--_0x5f0027){_0x148bbb['push'](_0x148bbb['shift']());}};_0x38619c(++_0x26d402);}(_0x9849,0x91));var _0x9984=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9849[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x9984('0x0'));var util=require(_0x9984('0x1'));var path=require(_0x9984('0x2'));var timeout=require(_0x9984('0x3'));var express=require(_0x9984('0x4'));var router=express['Router']();var fs_extra=require(_0x9984('0x5'));var auth=require(_0x9984('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9984('0x7'));var controller=require(_0x9984('0x8'));router[_0x9984('0x9')](_0x9984('0xa'),auth[_0x9984('0xb')](),controller[_0x9984('0xc')]);router['delete'](_0x9984('0xa'),auth[_0x9984('0xb')](),controller['destroy']);module[_0x9984('0xd')]=router; \ No newline at end of file +var _0x5c1d=['update','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x5c1d,0x1f3));var _0xd5c1=function(_0x4343cc,_0x48f4f2){_0x4343cc=_0x4343cc-0x0;var _0x170ffc=_0x5c1d[_0x4343cc];return _0x170ffc;};'use strict';var multer=require('multer');var util=require(_0xd5c1('0x0'));var path=require(_0xd5c1('0x1'));var timeout=require(_0xd5c1('0x2'));var express=require(_0xd5c1('0x3'));var router=express[_0xd5c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd5c1('0x5'));var interaction=require(_0xd5c1('0x6'));var config=require(_0xd5c1('0x7'));var controller=require(_0xd5c1('0x8'));router[_0xd5c1('0x9')]('/:id',auth[_0xd5c1('0xa')](),controller[_0xd5c1('0xb')]);router['delete'](_0xd5c1('0xc'),auth[_0xd5c1('0xa')](),controller[_0xd5c1('0xd')]);module[_0xd5c1('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 1cbb75d..a392ff9 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 _0xa630=['STRING','TEXT','sequelize','exports'];(function(_0x4d1945,_0x19aa2d){var _0x43290c=function(_0x169d12){while(--_0x169d12){_0x4d1945['push'](_0x4d1945['shift']());}};_0x43290c(++_0x19aa2d);}(_0xa630,0xbe));var _0x0a63=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0xa630[_0x4b6778];return _0x22dbb9;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0a63('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x0a63('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4819=['TEXT','exports','STRING'];(function(_0x41d02a,_0x355e19){var _0x4c3983=function(_0x4802a7){while(--_0x4802a7){_0x41d02a['push'](_0x41d02a['shift']());}};_0x4c3983(++_0x355e19);}(_0x4819,0xcd));var _0x9481=function(_0x8e3507,_0x7c734c){_0x8e3507=_0x8e3507-0x0;var _0x48c52b=_0x4819[_0x8e3507];return _0x48c52b;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 50691a8..562a655 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 _0x53d0=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','output','select','countTable','COUNT(*)','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','CustomReports','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','merge','options','AnalyticCustomReport','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','UserProfileResource','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','MetricId','metric','replace','function','format','groupBy','orderBy','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','operator','from','DESC','web','randomstring','csv','custom'];(function(_0xa0f797,_0x9b2fa7){var _0x14acd7=function(_0x3f814a){while(--_0x3f814a){_0xa0f797['push'](_0xa0f797['shift']());}};_0x14acd7(++_0x9b2fa7);}(_0x53d0,0xbb));var _0x053d=function(_0xdc61c3,_0x58ca1c){_0xdc61c3=_0xdc61c3-0x0;var _0x1fd157=_0x53d0[_0xdc61c3];return _0x1fd157;};'use strict';var emlformat=require(_0x053d('0x0'));var rimraf=require(_0x053d('0x1'));var zipdir=require(_0x053d('0x2'));var jsonpatch=require(_0x053d('0x3'));var rp=require(_0x053d('0x4'));var moment=require(_0x053d('0x5'));var BPromise=require(_0x053d('0x6'));var Mustache=require(_0x053d('0x7'));var util=require(_0x053d('0x8'));var path=require(_0x053d('0x9'));var sox=require(_0x053d('0xa'));var csv=require(_0x053d('0xb'));var ejs=require(_0x053d('0xc'));var fs=require('fs');var fs_extra=require(_0x053d('0xd'));var _=require(_0x053d('0xe'));var squel=require(_0x053d('0xf'));var crypto=require('crypto');var jsforce=require(_0x053d('0x10'));var deskjs=require(_0x053d('0x11'));var toCsv=require(_0x053d('0xb'));var querystring=require('querystring');var Papa=require(_0x053d('0x12'));var Redis=require(_0x053d('0x13'));var authService=require(_0x053d('0x14'));var qs=require(_0x053d('0x15'));var as=require(_0x053d('0x16'));var hardwareService=require(_0x053d('0x17'));var logger=require(_0x053d('0x18'))(_0x053d('0x19'));var utils=require(_0x053d('0x1a'));var config=require(_0x053d('0x1b'));var licenseUtil=require(_0x053d('0x1c'));var db=require(_0x053d('0x1d'))['db'];var dbH=require(_0x053d('0x1d'))[_0x053d('0x1e')];function respondWithStatusCode(_0x51c784,_0x20494d){_0x20494d=_0x20494d||0xcc;return function(_0x2aae48){if(_0x2aae48){return _0x51c784[_0x053d('0x1f')](_0x20494d);}return _0x51c784['status'](_0x20494d)[_0x053d('0x20')]();};}function respondWithResult(_0x336b3a,_0xc55ad4){_0xc55ad4=_0xc55ad4||0xc8;return function(_0x41ea3d){if(_0x41ea3d){return _0x336b3a[_0x053d('0x21')](_0xc55ad4)[_0x053d('0x22')](_0x41ea3d);}};}function respondWithFilteredResult(_0x13d537,_0x18d693){return function(_0xfd7e49){if(_0xfd7e49){var _0x11a4f4=typeof _0x18d693[_0x053d('0x23')]===_0x053d('0x24')&&typeof _0x18d693[_0x053d('0x25')]===_0x053d('0x24');var _0x555e03=_0xfd7e49[_0x053d('0x26')];var _0x183e15=_0x11a4f4?0x0:_0x18d693[_0x053d('0x23')];var _0xf9bc01=_0x11a4f4?_0xfd7e49[_0x053d('0x26')]:_0x18d693[_0x053d('0x23')]+_0x18d693[_0x053d('0x25')];var _0x2eacd0;if(_0xf9bc01>=_0x555e03){_0xf9bc01=_0x555e03;_0x2eacd0=0xc8;}else{_0x2eacd0=0xce;}_0x13d537[_0x053d('0x21')](_0x2eacd0);return _0x13d537[_0x053d('0x27')](_0x053d('0x28'),_0x183e15+'-'+_0xf9bc01+'/'+_0x555e03)[_0x053d('0x22')](_0xfd7e49);}return null;};}function patchUpdates(_0x59ffa6){return function(_0x3f194c){try{jsonpatch['apply'](_0x3f194c,_0x59ffa6,!![]);}catch(_0x4e8dda){return BPromise[_0x053d('0x29')](_0x4e8dda);}return _0x3f194c[_0x053d('0x2a')]();};}function saveUpdates(_0x3635a2,_0xc7802c){return function(_0x51fbef){if(_0x51fbef){return _0x51fbef[_0x053d('0x2b')](_0x3635a2)[_0x053d('0x2c')](function(_0x5a68e6){return _0x5a68e6;});}return null;};}function removeEntity(_0x3ba5d9,_0x20b546){return function(_0x3c0b11){if(_0x3c0b11){return _0x3c0b11['destroy']()[_0x053d('0x2c')](function(){var _0x4cf3c6=_0x3c0b11['get']({'plain':!![]});var _0x4b2a29=_0x053d('0x2d');return db['UserProfileResource'][_0x053d('0x2e')]({'where':{'type':_0x4b2a29,'resourceId':_0x4cf3c6['id']}})[_0x053d('0x2c')](function(){return _0x3c0b11;});})[_0x053d('0x2c')](function(){_0x3ba5d9[_0x053d('0x21')](0xcc)[_0x053d('0x20')]();});}};}function handleEntityNotFound(_0x589a67,_0x1473c1){return function(_0x4a6318){if(!_0x4a6318){_0x589a67['sendStatus'](0x194);}return _0x4a6318;};}function handleError(_0xc0e034,_0x289146){_0x289146=_0x289146||0x1f4;return function(_0x4367b4){logger[_0x053d('0x2f')](_0x4367b4[_0x053d('0x30')]);if(_0x4367b4[_0x053d('0x31')]){delete _0x4367b4['name'];}_0xc0e034[_0x053d('0x21')](_0x289146)[_0x053d('0x32')](_0x4367b4);};}exports[_0x053d('0x33')]=function(_0x3004f5,_0x4b7745){var _0x5274e4={},_0x5bb8d5={},_0x799350={'count':0x0,'rows':[]};var _0x10149f=_[_0x053d('0x34')](db['AnalyticCustomReport']['rawAttributes'],function(_0x1bac6c){return{'name':_0x1bac6c[_0x053d('0x35')],'type':_0x1bac6c[_0x053d('0x36')][_0x053d('0x37')]};});_0x5bb8d5[_0x053d('0x38')]=_[_0x053d('0x34')](_0x10149f,_0x053d('0x31'));_0x5bb8d5[_0x053d('0x39')]=_[_0x053d('0x3a')](_0x3004f5[_0x053d('0x39')]);_0x5bb8d5[_0x053d('0x3b')]=_['intersection'](_0x5bb8d5[_0x053d('0x38')],_0x5bb8d5[_0x053d('0x39')]);_0x5274e4['attributes']=_[_0x053d('0x3c')](_0x5bb8d5[_0x053d('0x38')],qs[_0x053d('0x3d')](_0x3004f5[_0x053d('0x39')]['fields']));_0x5274e4[_0x053d('0x3e')]=_0x5274e4[_0x053d('0x3e')][_0x053d('0x3f')]?_0x5274e4[_0x053d('0x3e')]:_0x5bb8d5[_0x053d('0x38')];if(!_0x3004f5[_0x053d('0x39')][_0x053d('0x40')](_0x053d('0x41'))){_0x5274e4[_0x053d('0x25')]=qs['limit'](_0x3004f5['query'][_0x053d('0x25')]);_0x5274e4[_0x053d('0x23')]=qs[_0x053d('0x23')](_0x3004f5[_0x053d('0x39')]['offset']);}_0x5274e4[_0x053d('0x42')]=qs[_0x053d('0x43')](_0x3004f5[_0x053d('0x39')][_0x053d('0x43')]);_0x5274e4[_0x053d('0x44')]=qs[_0x053d('0x3b')](_[_0x053d('0x45')](_0x3004f5[_0x053d('0x39')],_0x5bb8d5[_0x053d('0x3b')]),_0x10149f);if(_0x3004f5[_0x053d('0x39')][_0x053d('0x46')]){_0x5274e4[_0x053d('0x44')]=_['merge'](_0x5274e4[_0x053d('0x44')],{'$or':_[_0x053d('0x34')](_0x10149f,function(_0x3b7344){if(_0x3b7344[_0x053d('0x36')]!==_0x053d('0x47')){var _0xb610bf={};_0xb610bf[_0x3b7344[_0x053d('0x31')]]={'$like':'%'+_0x3004f5[_0x053d('0x39')]['filter']+'%'};return _0xb610bf;}})});}_0x5274e4=_['merge']({},_0x5274e4,_0x3004f5['options']);var _0x28e14e={'where':_0x5274e4['where']};return db['AnalyticCustomReport'][_0x053d('0x26')](_0x28e14e)[_0x053d('0x2c')](function(_0x589b0a){_0x799350[_0x053d('0x26')]=_0x589b0a;if(_0x3004f5[_0x053d('0x39')][_0x053d('0x48')]){_0x5274e4[_0x053d('0x49')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x053d('0x4a')](_0x5274e4);})[_0x053d('0x2c')](function(_0x2f397c){_0x799350['rows']=_0x2f397c;return _0x799350;})['then'](respondWithFilteredResult(_0x4b7745,_0x5274e4))[_0x053d('0x4b')](handleError(_0x4b7745,null));};exports[_0x053d('0x4c')]=function(_0x1a91c3,_0x4cd4b8){var _0x3d63b6={'raw':![],'where':{'id':_0x1a91c3[_0x053d('0x4d')]['id']}},_0x3c6f38={};_0x3c6f38[_0x053d('0x38')]=_[_0x053d('0x3a')](db['AnalyticCustomReport'][_0x053d('0x4e')]);_0x3c6f38[_0x053d('0x39')]=_[_0x053d('0x3a')](_0x1a91c3[_0x053d('0x39')]);_0x3c6f38[_0x053d('0x3b')]=_['intersection'](_0x3c6f38['model'],_0x3c6f38['query']);_0x3d63b6[_0x053d('0x3e')]=_[_0x053d('0x3c')](_0x3c6f38[_0x053d('0x38')],qs[_0x053d('0x3d')](_0x1a91c3[_0x053d('0x39')][_0x053d('0x3d')]));_0x3d63b6[_0x053d('0x3e')]=_0x3d63b6[_0x053d('0x3e')][_0x053d('0x3f')]?_0x3d63b6['attributes']:_0x3c6f38[_0x053d('0x38')];if(_0x1a91c3[_0x053d('0x39')]['includeAll']){_0x3d63b6['include']=[{'all':!![]}];}_0x3d63b6=_[_0x053d('0x4f')]({},_0x3d63b6,_0x1a91c3[_0x053d('0x50')]);return db[_0x053d('0x51')][_0x053d('0x52')](_0x3d63b6)[_0x053d('0x2c')](handleEntityNotFound(_0x4cd4b8,null))['then'](respondWithResult(_0x4cd4b8,null))[_0x053d('0x4b')](handleError(_0x4cd4b8,null));};exports[_0x053d('0x53')]=function(_0x2c8d94,_0xa1d2eb){return db['AnalyticCustomReport'][_0x053d('0x53')](_0x2c8d94['body'],{})['then'](function(_0x43a44d){var _0x2fc661=_0x2c8d94['user'][_0x053d('0x54')]({'plain':!![]});if(!_0x2fc661)throw new Error(_0x053d('0x55'));if(_0x2fc661[_0x053d('0x56')]===_0x053d('0x57')){var _0x286175=_0x43a44d['get']({'plain':!![]});var _0x4d8453=_0x053d('0x58');return db['UserProfileSection'][_0x053d('0x52')]({'where':{'name':_0x4d8453,'userProfileId':_0x2fc661[_0x053d('0x59')]},'raw':!![]})['then'](function(_0x2c5d43){if(_0x2c5d43&&_0x2c5d43['autoAssociation']===0x0){return db[_0x053d('0x5a')][_0x053d('0x53')]({'name':_0x286175[_0x053d('0x31')],'resourceId':_0x286175['id'],'type':'CustomReports','sectionId':_0x2c5d43['id']},{})[_0x053d('0x2c')](function(){return _0x43a44d;});}else{return _0x43a44d;}})[_0x053d('0x4b')](function(_0x2bf0b1){logger[_0x053d('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bf0b1);throw _0x2bf0b1;});}return _0x43a44d;})[_0x053d('0x2c')](respondWithResult(_0xa1d2eb,0xc9))[_0x053d('0x4b')](handleError(_0xa1d2eb,null));};exports['update']=function(_0x347a4b,_0x355b5e){if(_0x347a4b[_0x053d('0x5b')]['id']){delete _0x347a4b[_0x053d('0x5b')]['id'];}return db[_0x053d('0x51')]['find']({'where':{'id':_0x347a4b['params']['id']}})[_0x053d('0x2c')](handleEntityNotFound(_0x355b5e,null))['then'](saveUpdates(_0x347a4b[_0x053d('0x5b')],null))[_0x053d('0x2c')](respondWithResult(_0x355b5e,null))[_0x053d('0x4b')](handleError(_0x355b5e,null));};exports[_0x053d('0x2e')]=function(_0x529daa,_0x54ebc4){return db[_0x053d('0x51')]['find']({'where':{'id':_0x529daa[_0x053d('0x4d')]['id']}})[_0x053d('0x2c')](handleEntityNotFound(_0x54ebc4,null))[_0x053d('0x2c')](removeEntity(_0x54ebc4,null))[_0x053d('0x4b')](handleError(_0x54ebc4,null));};exports[_0x053d('0x5c')]=function(_0x5f1c97,_0x162755){var _0x4b4285=0xa;var _0x1ddb08=[_0x053d('0x5d'),_0x053d('0x5e'),_0x053d('0x5f'),_0x053d('0x60')];var _0x17b345={'SUM':_0x053d('0x61'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x053d('0x62'),'MAX':'MAX(%s)','MIN':_0x053d('0x63'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x053d('0x64'),'GROUP_CONCAT ASC':_0x053d('0x65'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1923bb={'SEC_TO_TIME':_0x053d('0x66'),'DATE':_0x053d('0x67'),'HOUR':_0x053d('0x68'),'ROUND':_0x053d('0x69'),'UNIX_TIMESTAMP':_0x053d('0x6a')};var _0x11cf89=function(_0x16d950){return!_['includes']([_0x053d('0x6b'),_0x053d('0x6c'),_0x053d('0x6d'),_0x053d('0x6e')],_0x16d950);};var _0x1b5ffc=function(_0x5a16db){if(!_0x5a16db||!_0x5a16db['rules'][_0x053d('0x3f')]){return'';}for(var _0x28c3b9='(',_0x20ba68=0x0;_0x20ba68<_0x5a16db[_0x053d('0x6f')][_0x053d('0x3f')];_0x20ba68+=0x1){_0x20ba68>0x0&&(_0x28c3b9+='\x20'+_0x5a16db['operator']+'\x20');_0x28c3b9+=_0x5a16db['rules'][_0x20ba68]['group']?_0x1b5ffc(_0x5a16db['rules'][_0x20ba68][_0x053d('0x70')]):_0x5a16db['rules'][_0x20ba68][_0x053d('0x71')]+'\x20'+_0x5a16db['rules'][_0x20ba68][_0x053d('0x72')]+(_0x11cf89(_0x5a16db[_0x053d('0x6f')][_0x20ba68][_0x053d('0x72')])?'\x20'+_0x5a16db['rules'][_0x20ba68][_0x053d('0x73')]:'');}return _0x28c3b9+')';};var _0x42c649={'where':{'id':_0x5f1c97[_0x053d('0x4d')]['id']}},_0x180c57,_0x3d6222,_0x2a03bf,_0x4d896d,_0x162cbc;_0x42c649=_['merge']({},_0x42c649,_0x5f1c97['options']);return db['AnalyticCustomReport'][_0x053d('0x52')](_0x42c649)[_0x053d('0x2c')](function(_0x3e58ca){if(_0x3e58ca){_0x180c57=_0x3e58ca;return _0x3e58ca[_0x053d('0x74')]();}return null;})['then'](function(_0x54ca28){if(_0x54ca28){if(!_0x54ca28['length']){throw new db[(_0x053d('0x75'))][(_0x053d('0x76'))](_0x053d('0x77'),0x193);}_0x3d6222=_0x54ca28;return db[_0x053d('0x78')]['findAll']({'raw':!![]});}return null;})[_0x053d('0x2c')](function(_0x4bdd9e){if(_0x4bdd9e){_0x2a03bf=_[_0x053d('0x79')](_0x4bdd9e,'id');var _0x1348fe;var _0x34295d=squel['select']();_0x34295d['from'](_0x180c57['table']);for(var _0x348910=0x0;_0x348910<_0x3d6222[_0x053d('0x3f')];_0x348910+=0x1){_0x1348fe=_0x3d6222[_0x348910][_0x053d('0x7a')]?_0x2a03bf[_0x3d6222[_0x348910]['MetricId']][_0x053d('0x7b')]:_0x3d6222[_0x348910][_0x053d('0x71')];_0x1348fe=_0x3d6222[_0x348910]['function']?_[_0x053d('0x7c')](_0x17b345[_0x3d6222[_0x348910][_0x053d('0x7d')]],'%s',_0x1348fe):_0x1348fe;_0x1348fe=_0x3d6222[_0x348910][_0x053d('0x7e')]?_['replace'](_0x1923bb[_0x3d6222[_0x348910]['format']],'%s',_0x1348fe):_0x1348fe;if(_0x3d6222[_0x348910][_0x053d('0x7f')]){_0x34295d[_0x053d('0x70')](_0x1348fe);}_0x3d6222[_0x348910][_0x053d('0x80')]&&_0x34295d[_0x053d('0x42')](_0x1348fe,_0x3d6222[_0x348910]['orderBy']==='DESC'?![]:!![]);_0x34295d[_0x053d('0x71')](_0x1348fe,_0x3d6222[_0x348910][_0x053d('0x81')]||_0x1348fe);}if(_0x180c57[_0x053d('0x82')]){_0x180c57[_0x053d('0x82')]=JSON[_0x053d('0x83')](_0x180c57['joins']);for(var _0x1deb0c=0x0;_0x1deb0c<_0x180c57['joins'][_0x053d('0x3f')];_0x1deb0c+=0x1){if(_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x36')]&&_[_0x053d('0x84')](_0x1ddb08,_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x36')])&&_0x180c57['joins'][_0x1deb0c][_0x053d('0x85')]&&_0x180c57['joins'][_0x1deb0c][_0x053d('0x86')]&&_0x180c57[_0x053d('0x82')][_0x1deb0c]['foreignKey']){_0x34295d[_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x36')]](_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x86')],null,util['format'](_0x053d('0x87'),_0x180c57[_0x053d('0x88')],_0x180c57['joins'][_0x1deb0c][_0x053d('0x85')],_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x86')],_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x89')]));}}}if(_0x180c57[_0x053d('0x8a')]){_0x180c57[_0x053d('0x8a')]=JSON['parse'](_0x180c57[_0x053d('0x8a')]);_0x34295d[_0x053d('0x44')](_0x1b5ffc(_0x180c57['conditions'][_0x053d('0x70')]));}_0x162cbc=_0x34295d[_0x053d('0x8b')]();_0x34295d[_0x053d('0x25')](_0x4b4285);_0x34295d[_0x053d('0x23')](0x0);logger['debug'](_0x053d('0x8c'),_0x34295d['toString']());return dbH['sequelize'][_0x053d('0x39')](_0x34295d[_0x053d('0x8d')](),{'type':dbH[_0x053d('0x8e')][_0x053d('0x8f')]['SELECT']});}})[_0x053d('0x2c')](respondWithResult(_0x162755,null))[_0x053d('0x4b')](handleError(_0x162755,null));};function runReport(_0x1f05ba,_0x588850,_0x5b82e0){var _0x39355b=_0x588850['name'];var _0x4b30db=0xa;var _0x2783bb=['join','left_join','right_join',_0x053d('0x60')];var _0x4680b1={'SUM':_0x053d('0x61'),'COUNT':_0x053d('0x90'),'COUNT DISTINCT':_0x053d('0x62'),'MAX':_0x053d('0x91'),'MIN':'MIN(%s)','AVG':_0x053d('0x92'),'GROUP_CONCAT':_0x053d('0x64'),'GROUP_CONCAT ASC':_0x053d('0x65'),'GROUP_CONCAT DESC':_0x053d('0x93')};var _0x4a1841={'SEC_TO_TIME':_0x053d('0x66'),'DATE':_0x053d('0x67'),'HOUR':_0x053d('0x68'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x053d('0x6a')};var _0x19f3cd=function(_0x338877){return!_[_0x053d('0x84')](['IS\x20NULL',_0x053d('0x6c'),_0x053d('0x6d'),_0x053d('0x6e')],_0x338877);};var _0x504ddb=function(_0x25cdbf){if(!_0x25cdbf||!_0x25cdbf[_0x053d('0x6f')][_0x053d('0x3f')]){return'';}for(var _0x1a4764='(',_0x2fad06=0x0;_0x2fad06<_0x25cdbf[_0x053d('0x6f')]['length'];_0x2fad06+=0x1){_0x2fad06>0x0&&(_0x1a4764+='\x20'+_0x25cdbf[_0x053d('0x94')]+'\x20');_0x1a4764+=_0x25cdbf[_0x053d('0x6f')][_0x2fad06][_0x053d('0x70')]?_0x504ddb(_0x25cdbf[_0x053d('0x6f')][_0x2fad06]['group']):_0x25cdbf[_0x053d('0x6f')][_0x2fad06][_0x053d('0x71')]+'\x20'+_0x25cdbf[_0x053d('0x6f')][_0x2fad06][_0x053d('0x72')]+(_0x19f3cd(_0x25cdbf[_0x053d('0x6f')][_0x2fad06]['condition'])?'\x20'+_0x25cdbf[_0x053d('0x6f')][_0x2fad06][_0x053d('0x73')]:'');}return _0x1a4764+')';};var _0x31328e={'where':{'id':_0x1f05ba['id']}},_0x25e15d,_0x4f8d71,_0x375bbc,_0x3c04b8,_0x3888b9;_0x31328e=_[_0x053d('0x4f')]({},_0x31328e,_0x5b82e0);return db[_0x053d('0x51')][_0x053d('0x52')](_0x31328e)[_0x053d('0x2c')](function(_0x5d1823){if(_0x5d1823){_0x25e15d=_0x5d1823;return _0x5d1823[_0x053d('0x74')]();}return null;})[_0x053d('0x2c')](function(_0x1022aa){if(_0x1022aa){if(!_0x1022aa[_0x053d('0x3f')]){throw new db[(_0x053d('0x75'))][(_0x053d('0x76'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4f8d71=_0x1022aa;return db[_0x053d('0x78')][_0x053d('0x4a')]({'raw':!![]});}return null;})[_0x053d('0x2c')](function(_0x272922){if(_0x272922){_0x375bbc=_[_0x053d('0x79')](_0x272922,'id');var _0x48320d;var _0xfa9957=squel['select']();_0xfa9957[_0x053d('0x95')](_0x25e15d[_0x053d('0x88')]);for(var _0x2f4b92=0x0;_0x2f4b92<_0x4f8d71[_0x053d('0x3f')];_0x2f4b92+=0x1){_0x48320d=_0x4f8d71[_0x2f4b92][_0x053d('0x7a')]?_0x375bbc[_0x4f8d71[_0x2f4b92][_0x053d('0x7a')]][_0x053d('0x7b')]:_0x4f8d71[_0x2f4b92]['field'];_0x48320d=_0x4f8d71[_0x2f4b92][_0x053d('0x7d')]?_['replace'](_0x4680b1[_0x4f8d71[_0x2f4b92][_0x053d('0x7d')]],'%s',_0x48320d):_0x48320d;_0x48320d=_0x4f8d71[_0x2f4b92][_0x053d('0x7e')]?_[_0x053d('0x7c')](_0x4a1841[_0x4f8d71[_0x2f4b92]['format']],'%s',_0x48320d):_0x48320d;if(_0x4f8d71[_0x2f4b92][_0x053d('0x7f')]){_0xfa9957['group'](_0x48320d);}_0x4f8d71[_0x2f4b92]['orderBy']&&_0xfa9957['order'](_0x48320d,_0x4f8d71[_0x2f4b92]['orderBy']===_0x053d('0x96')?![]:!![]);_0xfa9957['field'](_0x48320d,_0x4f8d71[_0x2f4b92][_0x053d('0x81')]||_0x48320d);}if(_0x25e15d[_0x053d('0x82')]){_0x25e15d['joins']=JSON[_0x053d('0x83')](_0x25e15d[_0x053d('0x82')]);for(var _0x185485=0x0;_0x185485<_0x25e15d[_0x053d('0x82')][_0x053d('0x3f')];_0x185485+=0x1){if(_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x36')]&&_[_0x053d('0x84')](_0x2783bb,_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x36')])&&_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x85')]&&_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x86')]&&_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x89')]){_0xfa9957[_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x36')]](_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x86')],null,util[_0x053d('0x7e')](_0x053d('0x87'),_0x25e15d['table'],_0x25e15d[_0x053d('0x82')][_0x185485]['parentKey'],_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x86')],_0x25e15d[_0x053d('0x82')][_0x185485]['foreignKey']));}}}if(_0x25e15d['conditions']){_0x25e15d[_0x053d('0x8a')]=JSON['parse'](_0x25e15d[_0x053d('0x8a')]);_0xfa9957[_0x053d('0x44')](_0x504ddb(_0x25e15d[_0x053d('0x8a')]['group']));}_0x3888b9=_0xfa9957[_0x053d('0x8b')]();_0xfa9957[_0x053d('0x25')](_0x4b30db);_0xfa9957['offset'](0x0);return;}})[_0x053d('0x2c')](function(){if(_0x588850['output']===_0x053d('0x97')){return null;}var _0x4913a1=_[_0x053d('0x4f')](_0x588850,{'name':_0x588850['fullPath']||_0x588850['name']||_0x25e15d[_0x053d('0x31')],'basename':_0x39355b,'savename':util[_0x053d('0x7e')]('%s-%s.%s',_0x588850[_0x053d('0x31')]||_0x25e15d['name'],require(_0x053d('0x98'))['generate'](0x4),_0x588850['output']||_0x053d('0x99')),'reportId':_0x25e15d['id'],'reportType':_0x053d('0x9a')});return db[_0x053d('0x9b')][_0x053d('0x53')](_0x4913a1,{'raw':!![]});})['then'](function(_0x3492b6){if(_0x25e15d[_0x053d('0x88')]==='cdr'){_0x3888b9[_0x053d('0x44')](_0x25e15d['table']+_0x053d('0x9c'),_0x588850[_0x053d('0x9d')],_0x588850[_0x053d('0x9e')]);}else{_0x3888b9[_0x053d('0x44')](_0x25e15d[_0x053d('0x88')]+_0x053d('0x9f'),_0x588850['startDate'],_0x588850[_0x053d('0x9e')]);}if(_0x3492b6){logger[_0x053d('0xa0')](_0x053d('0xa1'),_0x3888b9[_0x053d('0x8d')]());require(_0x053d('0xa2'))['fork'](path[_0x053d('0x5d')](__dirname,_0x053d('0xa3'),_0x3492b6[_0x053d('0xa4')]),[_0x3492b6['id'],_0x3888b9[_0x053d('0x8d')](),path[_0x053d('0x5d')](__dirname,'../../files/reports',_0x3492b6['savename']),_0x39355b]);return _0x3492b6;}else{var _0x3a9154=squel[_0x053d('0xa5')]();_0x3a9154[_0x053d('0x95')]('('+_0x3888b9[_0x053d('0x8d')]()+')',_0x053d('0xa6'));_0x3a9154[_0x053d('0x71')](_0x053d('0xa7'),'count');_0x3888b9[_0x053d('0x25')](_0x588850[_0x053d('0x25')]||_0x4b30db);_0x3888b9['offset'](_0x588850[_0x053d('0x23')]||0x0);return dbH[_0x053d('0x8e')][_0x053d('0x39')](_0x3a9154[_0x053d('0x8d')](),{'type':dbH[_0x053d('0x8e')][_0x053d('0x8f')][_0x053d('0xa8')]})[_0x053d('0x2c')](function(_0xb9185a){if(!_0xb9185a[_0x053d('0x3f')]){_0x3c04b8=0x0;}else{_0x3c04b8=_0xb9185a[0x0][_0x053d('0x26')]||0x0;}return dbH[_0x053d('0x8e')][_0x053d('0x39')](_0x3888b9[_0x053d('0x8d')](),{'type':dbH[_0x053d('0x8e')][_0x053d('0x8f')][_0x053d('0xa8')]});})[_0x053d('0x2c')](function(_0x31304c){return{'rows':_0x31304c||[],'count':_0x3c04b8};});}});}exports[_0x053d('0xa9')]=function(_0x1418a8,_0x359cde){return runReport(_0x1418a8['params'],_0x1418a8[_0x053d('0x39')],_0x1418a8[_0x053d('0x50')])[_0x053d('0x2c')](respondWithResult(_0x359cde,null))[_0x053d('0x4b')](handleError(_0x359cde,null));};exports[_0x053d('0xaa')]=runReport;exports[_0x053d('0x39')]=function(_0x4e168c,_0x4c31f9){var _0x389b42=0xa;var _0x86c6df=[_0x053d('0x5d'),_0x053d('0x5e'),_0x053d('0x5f'),_0x053d('0x60')];var _0x2e8c1a={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x053d('0x63'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x053d('0x64'),'GROUP_CONCAT ASC':_0x053d('0x65'),'GROUP_CONCAT DESC':_0x053d('0x93')};var _0x358dc9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x053d('0x67'),'HOUR':_0x053d('0x68'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x178ff=function(_0xfd85b0){return!_[_0x053d('0x84')](['IS\x20NULL',_0x053d('0x6c'),_0x053d('0x6d'),_0x053d('0x6e')],_0xfd85b0);};var _0x24d8c8=function(_0x32762c){if(!_0x32762c||!_0x32762c[_0x053d('0x6f')]['length']){return'';}for(var _0x1c553f='(',_0x58af8d=0x0;_0x58af8d<_0x32762c['rules'][_0x053d('0x3f')];_0x58af8d+=0x1){_0x58af8d>0x0&&(_0x1c553f+='\x20'+_0x32762c[_0x053d('0x94')]+'\x20');_0x1c553f+=_0x32762c[_0x053d('0x6f')][_0x58af8d][_0x053d('0x70')]?_0x24d8c8(_0x32762c[_0x053d('0x6f')][_0x58af8d][_0x053d('0x70')]):_0x32762c[_0x053d('0x6f')][_0x58af8d]['field']+'\x20'+_0x32762c[_0x053d('0x6f')][_0x58af8d]['condition']+(_0x178ff(_0x32762c[_0x053d('0x6f')][_0x58af8d][_0x053d('0x72')])?'\x20'+_0x32762c['rules'][_0x58af8d][_0x053d('0x73')]:'');}return _0x1c553f+')';};var _0x144362={'where':{'id':_0x4e168c[_0x053d('0x4d')]['id']}},_0x4aae03,_0x2658c5,_0x2ebc3f,_0x2d6a0b,_0x3e4e20;_0x144362=_[_0x053d('0x4f')]({},_0x144362,_0x4e168c[_0x053d('0x50')]);return db['AnalyticCustomReport'][_0x053d('0x52')](_0x144362)[_0x053d('0x2c')](function(_0x50022c){if(_0x50022c){_0x4aae03=_0x50022c;return _0x50022c[_0x053d('0x74')]();}return null;})[_0x053d('0x2c')](function(_0x2cfdd6){if(_0x2cfdd6){if(!_0x2cfdd6[_0x053d('0x3f')]){throw new db[(_0x053d('0x75'))][(_0x053d('0x76'))](_0x053d('0x77'),0x193);}_0x2658c5=_0x2cfdd6;return db['AnalyticMetric'][_0x053d('0x4a')]({'raw':!![]});}return null;})[_0x053d('0x2c')](function(_0x6061f3){if(_0x6061f3){_0x2ebc3f=_[_0x053d('0x79')](_0x6061f3,'id');var _0x9a1de0;var _0x796cea=squel['select']();_0x796cea[_0x053d('0x95')](_0x4aae03[_0x053d('0x88')]);for(var _0x214f81=0x0;_0x214f81<_0x2658c5[_0x053d('0x3f')];_0x214f81+=0x1){_0x9a1de0=_0x2658c5[_0x214f81][_0x053d('0x7a')]?_0x2ebc3f[_0x2658c5[_0x214f81]['MetricId']]['metric']:_0x2658c5[_0x214f81]['field'];_0x9a1de0=_0x2658c5[_0x214f81][_0x053d('0x7d')]?_[_0x053d('0x7c')](_0x2e8c1a[_0x2658c5[_0x214f81][_0x053d('0x7d')]],'%s',_0x9a1de0):_0x9a1de0;_0x9a1de0=_0x2658c5[_0x214f81][_0x053d('0x7e')]?_[_0x053d('0x7c')](_0x358dc9[_0x2658c5[_0x214f81][_0x053d('0x7e')]],'%s',_0x9a1de0):_0x9a1de0;if(_0x2658c5[_0x214f81][_0x053d('0x7f')]){_0x796cea[_0x053d('0x70')](_0x9a1de0);}_0x2658c5[_0x214f81][_0x053d('0x80')]&&_0x796cea[_0x053d('0x42')](_0x9a1de0,_0x2658c5[_0x214f81][_0x053d('0x80')]==='DESC'?![]:!![]);_0x796cea[_0x053d('0x71')](_0x9a1de0,_0x2658c5[_0x214f81][_0x053d('0x81')]||_0x9a1de0);}if(_0x4aae03[_0x053d('0x82')]){_0x4aae03['joins']=JSON[_0x053d('0x83')](_0x4aae03[_0x053d('0x82')]);for(var _0x27d58e=0x0;_0x27d58e<_0x4aae03[_0x053d('0x82')][_0x053d('0x3f')];_0x27d58e+=0x1){if(_0x4aae03[_0x053d('0x82')][_0x27d58e][_0x053d('0x36')]&&_[_0x053d('0x84')](_0x86c6df,_0x4aae03[_0x053d('0x82')][_0x27d58e][_0x053d('0x36')])&&_0x4aae03[_0x053d('0x82')][_0x27d58e][_0x053d('0x85')]&&_0x4aae03['joins'][_0x27d58e][_0x053d('0x86')]&&_0x4aae03[_0x053d('0x82')][_0x27d58e]['foreignKey']){_0x796cea[_0x4aae03['joins'][_0x27d58e][_0x053d('0x36')]](_0x4aae03[_0x053d('0x82')][_0x27d58e][_0x053d('0x86')],null,util[_0x053d('0x7e')]('%s.%s\x20=\x20%s.%s',_0x4aae03[_0x053d('0x88')],_0x4aae03[_0x053d('0x82')][_0x27d58e]['parentKey'],_0x4aae03['joins'][_0x27d58e][_0x053d('0x86')],_0x4aae03['joins'][_0x27d58e][_0x053d('0x89')]));}}}if(_0x4aae03['conditions']){_0x4aae03[_0x053d('0x8a')]=JSON[_0x053d('0x83')](_0x4aae03[_0x053d('0x8a')]);_0x796cea[_0x053d('0x44')](_0x24d8c8(_0x4aae03[_0x053d('0x8a')]['group']));}_0x3e4e20=_0x796cea[_0x053d('0x8b')]();_0x796cea[_0x053d('0x25')](_0x389b42);_0x796cea[_0x053d('0x23')](0x0);logger['debug'](_0x053d('0x8c'),_0x796cea[_0x053d('0x8d')]());return dbH['sequelize'][_0x053d('0x39')](_0x796cea['toString'](),{'type':dbH[_0x053d('0x8e')][_0x053d('0x8f')][_0x053d('0xa8')]});}})[_0x053d('0x2c')](function(){return{'sql':_0x3e4e20['toString']()};})['then'](respondWithResult(_0x4c31f9,null))['catch'](handleError(_0x4c31f9,null));}; \ No newline at end of file +var _0xc2d3=['Reports','userProfileId','autoAssociation','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','function','replace','format','orderBy','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','IS\x20NULL','AnalyticMetric','select','from','groupBy','order','DESC','alias','output','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','GROUP_CONCAT(%s)','metric','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','AnalyticCustomReport','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xc2d3,0xfe));var _0x3c2d=function(_0x34ac82,_0x5dbaeb){_0x34ac82=_0x34ac82-0x0;var _0x119517=_0xc2d3[_0x34ac82];return _0x119517;};'use strict';var emlformat=require(_0x3c2d('0x0'));var rimraf=require(_0x3c2d('0x1'));var zipdir=require(_0x3c2d('0x2'));var jsonpatch=require(_0x3c2d('0x3'));var rp=require(_0x3c2d('0x4'));var moment=require('moment');var BPromise=require(_0x3c2d('0x5'));var Mustache=require(_0x3c2d('0x6'));var util=require('util');var path=require(_0x3c2d('0x7'));var sox=require(_0x3c2d('0x8'));var csv=require(_0x3c2d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c2d('0xa'));var _=require(_0x3c2d('0xb'));var squel=require(_0x3c2d('0xc'));var crypto=require(_0x3c2d('0xd'));var jsforce=require(_0x3c2d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3c2d('0x9'));var querystring=require(_0x3c2d('0xf'));var Papa=require(_0x3c2d('0x10'));var Redis=require(_0x3c2d('0x11'));var authService=require(_0x3c2d('0x12'));var qs=require(_0x3c2d('0x13'));var as=require(_0x3c2d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c2d('0x15'))(_0x3c2d('0x16'));var utils=require('../../config/utils');var config=require(_0x3c2d('0x17'));var licenseUtil=require(_0x3c2d('0x18'));var db=require(_0x3c2d('0x19'))['db'];var dbH=require('../../mysqldb')[_0x3c2d('0x1a')];function respondWithStatusCode(_0x1df940,_0x437bd4){_0x437bd4=_0x437bd4||0xcc;return function(_0x3dc4fd){if(_0x3dc4fd){return _0x1df940[_0x3c2d('0x1b')](_0x437bd4);}return _0x1df940[_0x3c2d('0x1c')](_0x437bd4)[_0x3c2d('0x1d')]();};}function respondWithResult(_0x4ab002,_0x247d7d){_0x247d7d=_0x247d7d||0xc8;return function(_0x132417){if(_0x132417){return _0x4ab002[_0x3c2d('0x1c')](_0x247d7d)[_0x3c2d('0x1e')](_0x132417);}};}function respondWithFilteredResult(_0x4e6104,_0x5e8e71){return function(_0x5f087e){if(_0x5f087e){var _0x1fe6e1=typeof _0x5e8e71[_0x3c2d('0x1f')]===_0x3c2d('0x20')&&typeof _0x5e8e71[_0x3c2d('0x21')]===_0x3c2d('0x20');var _0x11325d=_0x5f087e[_0x3c2d('0x22')];var _0x22db0e=_0x1fe6e1?0x0:_0x5e8e71['offset'];var _0x27abf1=_0x1fe6e1?_0x5f087e[_0x3c2d('0x22')]:_0x5e8e71[_0x3c2d('0x1f')]+_0x5e8e71[_0x3c2d('0x21')];var _0x581f75;if(_0x27abf1>=_0x11325d){_0x27abf1=_0x11325d;_0x581f75=0xc8;}else{_0x581f75=0xce;}_0x4e6104[_0x3c2d('0x1c')](_0x581f75);return _0x4e6104[_0x3c2d('0x23')]('Content-Range',_0x22db0e+'-'+_0x27abf1+'/'+_0x11325d)['json'](_0x5f087e);}return null;};}function patchUpdates(_0x2c3933){return function(_0x2f2780){try{jsonpatch[_0x3c2d('0x24')](_0x2f2780,_0x2c3933,!![]);}catch(_0x1b3317){return BPromise[_0x3c2d('0x25')](_0x1b3317);}return _0x2f2780[_0x3c2d('0x26')]();};}function saveUpdates(_0x54c454,_0xf14fb9){return function(_0x78e4b2){if(_0x78e4b2){return _0x78e4b2[_0x3c2d('0x27')](_0x54c454)[_0x3c2d('0x28')](function(_0x436d50){return _0x436d50;});}return null;};}function removeEntity(_0x554777,_0x3a2694){return function(_0x399eaa){if(_0x399eaa){return _0x399eaa[_0x3c2d('0x29')]()[_0x3c2d('0x28')](function(){var _0x5ccad3=_0x399eaa['get']({'plain':!![]});var _0x66f790=_0x3c2d('0x2a');return db[_0x3c2d('0x2b')][_0x3c2d('0x29')]({'where':{'type':_0x66f790,'resourceId':_0x5ccad3['id']}})[_0x3c2d('0x28')](function(){return _0x399eaa;});})[_0x3c2d('0x28')](function(){_0x554777[_0x3c2d('0x1c')](0xcc)[_0x3c2d('0x1d')]();});}};}function handleEntityNotFound(_0x46ea0b,_0x1c9068){return function(_0x5306f4){if(!_0x5306f4){_0x46ea0b[_0x3c2d('0x1b')](0x194);}return _0x5306f4;};}function handleError(_0x50e4f7,_0x15a630){_0x15a630=_0x15a630||0x1f4;return function(_0x35fe3f){logger[_0x3c2d('0x2c')](_0x35fe3f[_0x3c2d('0x2d')]);if(_0x35fe3f[_0x3c2d('0x2e')]){delete _0x35fe3f['name'];}_0x50e4f7['status'](_0x15a630)[_0x3c2d('0x2f')](_0x35fe3f);};}exports[_0x3c2d('0x30')]=function(_0x387263,_0x3e794a){var _0x6905dc={},_0x432fe9={},_0x5752c6={'count':0x0,'rows':[]};var _0x12fa8d=_['map'](db['AnalyticCustomReport'][_0x3c2d('0x31')],function(_0xea7a1e){return{'name':_0xea7a1e[_0x3c2d('0x32')],'type':_0xea7a1e[_0x3c2d('0x33')][_0x3c2d('0x34')]};});_0x432fe9['model']=_['map'](_0x12fa8d,_0x3c2d('0x2e'));_0x432fe9[_0x3c2d('0x35')]=_['keys'](_0x387263[_0x3c2d('0x35')]);_0x432fe9[_0x3c2d('0x36')]=_['intersection'](_0x432fe9[_0x3c2d('0x37')],_0x432fe9[_0x3c2d('0x35')]);_0x6905dc[_0x3c2d('0x38')]=_[_0x3c2d('0x39')](_0x432fe9[_0x3c2d('0x37')],qs[_0x3c2d('0x3a')](_0x387263[_0x3c2d('0x35')][_0x3c2d('0x3a')]));_0x6905dc[_0x3c2d('0x38')]=_0x6905dc['attributes'][_0x3c2d('0x3b')]?_0x6905dc['attributes']:_0x432fe9[_0x3c2d('0x37')];if(!_0x387263[_0x3c2d('0x35')][_0x3c2d('0x3c')](_0x3c2d('0x3d'))){_0x6905dc[_0x3c2d('0x21')]=qs[_0x3c2d('0x21')](_0x387263[_0x3c2d('0x35')]['limit']);_0x6905dc[_0x3c2d('0x1f')]=qs[_0x3c2d('0x1f')](_0x387263[_0x3c2d('0x35')][_0x3c2d('0x1f')]);}_0x6905dc['order']=qs[_0x3c2d('0x3e')](_0x387263[_0x3c2d('0x35')]['sort']);_0x6905dc[_0x3c2d('0x3f')]=qs['filters'](_[_0x3c2d('0x40')](_0x387263[_0x3c2d('0x35')],_0x432fe9[_0x3c2d('0x36')]),_0x12fa8d);if(_0x387263[_0x3c2d('0x35')][_0x3c2d('0x41')]){_0x6905dc[_0x3c2d('0x3f')]=_['merge'](_0x6905dc[_0x3c2d('0x3f')],{'$or':_['map'](_0x12fa8d,function(_0x4916df){if(_0x4916df['type']!=='VIRTUAL'){var _0x218a67={};_0x218a67[_0x4916df[_0x3c2d('0x2e')]]={'$like':'%'+_0x387263['query']['filter']+'%'};return _0x218a67;}})});}_0x6905dc=_[_0x3c2d('0x42')]({},_0x6905dc,_0x387263[_0x3c2d('0x43')]);var _0x4be102={'where':_0x6905dc[_0x3c2d('0x3f')]};return db[_0x3c2d('0x44')][_0x3c2d('0x22')](_0x4be102)[_0x3c2d('0x28')](function(_0x1fcec3){_0x5752c6[_0x3c2d('0x22')]=_0x1fcec3;if(_0x387263[_0x3c2d('0x35')][_0x3c2d('0x45')]){_0x6905dc['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x3c2d('0x46')](_0x6905dc);})[_0x3c2d('0x28')](function(_0x3a5540){_0x5752c6[_0x3c2d('0x47')]=_0x3a5540;return _0x5752c6;})[_0x3c2d('0x28')](respondWithFilteredResult(_0x3e794a,_0x6905dc))[_0x3c2d('0x48')](handleError(_0x3e794a,null));};exports[_0x3c2d('0x49')]=function(_0x20aa03,_0x3acc38){var _0x42271d={'raw':![],'where':{'id':_0x20aa03[_0x3c2d('0x4a')]['id']}},_0x4e9201={};_0x4e9201[_0x3c2d('0x37')]=_[_0x3c2d('0x4b')](db[_0x3c2d('0x44')][_0x3c2d('0x31')]);_0x4e9201[_0x3c2d('0x35')]=_[_0x3c2d('0x4b')](_0x20aa03[_0x3c2d('0x35')]);_0x4e9201[_0x3c2d('0x36')]=_[_0x3c2d('0x39')](_0x4e9201['model'],_0x4e9201[_0x3c2d('0x35')]);_0x42271d[_0x3c2d('0x38')]=_['intersection'](_0x4e9201[_0x3c2d('0x37')],qs[_0x3c2d('0x3a')](_0x20aa03[_0x3c2d('0x35')]['fields']));_0x42271d[_0x3c2d('0x38')]=_0x42271d[_0x3c2d('0x38')][_0x3c2d('0x3b')]?_0x42271d[_0x3c2d('0x38')]:_0x4e9201[_0x3c2d('0x37')];if(_0x20aa03['query'][_0x3c2d('0x45')]){_0x42271d[_0x3c2d('0x4c')]=[{'all':!![]}];}_0x42271d=_['merge']({},_0x42271d,_0x20aa03[_0x3c2d('0x43')]);return db['AnalyticCustomReport'][_0x3c2d('0x4d')](_0x42271d)['then'](handleEntityNotFound(_0x3acc38,null))[_0x3c2d('0x28')](respondWithResult(_0x3acc38,null))[_0x3c2d('0x48')](handleError(_0x3acc38,null));};exports[_0x3c2d('0x4e')]=function(_0x24058f,_0x37b78d){return db['AnalyticCustomReport']['create'](_0x24058f[_0x3c2d('0x4f')],{})[_0x3c2d('0x28')](function(_0x10efb7){var _0x4a109a=_0x24058f[_0x3c2d('0x50')][_0x3c2d('0x51')]({'plain':!![]});if(!_0x4a109a)throw new Error(_0x3c2d('0x52'));if(_0x4a109a[_0x3c2d('0x53')]==='user'){var _0x445c8c=_0x10efb7[_0x3c2d('0x51')]({'plain':!![]});var _0x28ff76=_0x3c2d('0x54');return db['UserProfileSection'][_0x3c2d('0x4d')]({'where':{'name':_0x28ff76,'userProfileId':_0x4a109a[_0x3c2d('0x55')]},'raw':!![]})[_0x3c2d('0x28')](function(_0xc1da55){if(_0xc1da55&&_0xc1da55[_0x3c2d('0x56')]===0x0){return db[_0x3c2d('0x2b')][_0x3c2d('0x4e')]({'name':_0x445c8c[_0x3c2d('0x2e')],'resourceId':_0x445c8c['id'],'type':'CustomReports','sectionId':_0xc1da55['id']},{})['then'](function(){return _0x10efb7;});}else{return _0x10efb7;}})['catch'](function(_0xd796d){logger[_0x3c2d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd796d);throw _0xd796d;});}return _0x10efb7;})['then'](respondWithResult(_0x37b78d,0xc9))['catch'](handleError(_0x37b78d,null));};exports[_0x3c2d('0x27')]=function(_0x4a0f23,_0x38b5b2){if(_0x4a0f23['body']['id']){delete _0x4a0f23[_0x3c2d('0x4f')]['id'];}return db[_0x3c2d('0x44')][_0x3c2d('0x4d')]({'where':{'id':_0x4a0f23[_0x3c2d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x38b5b2,null))[_0x3c2d('0x28')](saveUpdates(_0x4a0f23[_0x3c2d('0x4f')],null))[_0x3c2d('0x28')](respondWithResult(_0x38b5b2,null))[_0x3c2d('0x48')](handleError(_0x38b5b2,null));};exports[_0x3c2d('0x29')]=function(_0xbbba3a,_0x12a849){return db[_0x3c2d('0x44')][_0x3c2d('0x4d')]({'where':{'id':_0xbbba3a[_0x3c2d('0x4a')]['id']}})[_0x3c2d('0x28')](handleEntityNotFound(_0x12a849,null))[_0x3c2d('0x28')](removeEntity(_0x12a849,null))[_0x3c2d('0x48')](handleError(_0x12a849,null));};exports[_0x3c2d('0x57')]=function(_0xe1bb4e,_0x485bd7){var _0x50345d=0xa;var _0x16495e=[_0x3c2d('0x58'),_0x3c2d('0x59'),_0x3c2d('0x5a'),_0x3c2d('0x5b')];var _0x48b8c4={'SUM':_0x3c2d('0x5c'),'COUNT':_0x3c2d('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3c2d('0x5e'),'MIN':_0x3c2d('0x5f'),'AVG':_0x3c2d('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3c2d('0x61'),'GROUP_CONCAT DESC':_0x3c2d('0x62')};var _0x4ef52c={'SEC_TO_TIME':_0x3c2d('0x63'),'DATE':_0x3c2d('0x64'),'HOUR':_0x3c2d('0x65'),'ROUND':_0x3c2d('0x66'),'UNIX_TIMESTAMP':_0x3c2d('0x67')};var _0x5129a3=function(_0xcc4bac){return!_[_0x3c2d('0x68')](['IS\x20NULL',_0x3c2d('0x69'),_0x3c2d('0x6a'),_0x3c2d('0x6b')],_0xcc4bac);};var _0x1ae297=function(_0x371875){if(!_0x371875||!_0x371875[_0x3c2d('0x6c')][_0x3c2d('0x3b')]){return'';}for(var _0x432cae='(',_0x1f5d09=0x0;_0x1f5d09<_0x371875[_0x3c2d('0x6c')]['length'];_0x1f5d09+=0x1){_0x1f5d09>0x0&&(_0x432cae+='\x20'+_0x371875[_0x3c2d('0x6d')]+'\x20');_0x432cae+=_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x6e')]?_0x1ae297(_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x6e')]):_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x6f')]+'\x20'+_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x70')]+(_0x5129a3(_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x70')])?'\x20'+_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x71')]:'');}return _0x432cae+')';};var _0x287c7d={'where':{'id':_0xe1bb4e[_0x3c2d('0x4a')]['id']}},_0x1a2ab7,_0x4f022e,_0x33d2ce,_0x401547,_0x264430;_0x287c7d=_[_0x3c2d('0x42')]({},_0x287c7d,_0xe1bb4e['options']);return db[_0x3c2d('0x44')][_0x3c2d('0x4d')](_0x287c7d)[_0x3c2d('0x28')](function(_0x838bcf){if(_0x838bcf){_0x1a2ab7=_0x838bcf;return _0x838bcf[_0x3c2d('0x72')]();}return null;})[_0x3c2d('0x28')](function(_0x53de22){if(_0x53de22){if(!_0x53de22[_0x3c2d('0x3b')]){throw new db[(_0x3c2d('0x73'))][(_0x3c2d('0x74'))](_0x3c2d('0x75'),0x193);}_0x4f022e=_0x53de22;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x3c2d('0x28')](function(_0x11e619){if(_0x11e619){_0x33d2ce=_[_0x3c2d('0x76')](_0x11e619,'id');var _0x4eb72e;var _0x29e6ea=squel['select']();_0x29e6ea['from'](_0x1a2ab7[_0x3c2d('0x77')]);for(var _0x52e75f=0x0;_0x52e75f<_0x4f022e[_0x3c2d('0x3b')];_0x52e75f+=0x1){_0x4eb72e=_0x4f022e[_0x52e75f][_0x3c2d('0x78')]?_0x33d2ce[_0x4f022e[_0x52e75f][_0x3c2d('0x78')]]['metric']:_0x4f022e[_0x52e75f][_0x3c2d('0x6f')];_0x4eb72e=_0x4f022e[_0x52e75f][_0x3c2d('0x79')]?_[_0x3c2d('0x7a')](_0x48b8c4[_0x4f022e[_0x52e75f]['function']],'%s',_0x4eb72e):_0x4eb72e;_0x4eb72e=_0x4f022e[_0x52e75f][_0x3c2d('0x7b')]?_[_0x3c2d('0x7a')](_0x4ef52c[_0x4f022e[_0x52e75f][_0x3c2d('0x7b')]],'%s',_0x4eb72e):_0x4eb72e;if(_0x4f022e[_0x52e75f]['groupBy']){_0x29e6ea['group'](_0x4eb72e);}_0x4f022e[_0x52e75f][_0x3c2d('0x7c')]&&_0x29e6ea['order'](_0x4eb72e,_0x4f022e[_0x52e75f][_0x3c2d('0x7c')]==='DESC'?![]:!![]);_0x29e6ea[_0x3c2d('0x6f')](_0x4eb72e,_0x4f022e[_0x52e75f]['alias']||_0x4eb72e);}if(_0x1a2ab7[_0x3c2d('0x7d')]){_0x1a2ab7[_0x3c2d('0x7d')]=JSON[_0x3c2d('0x7e')](_0x1a2ab7[_0x3c2d('0x7d')]);for(var _0x2607f8=0x0;_0x2607f8<_0x1a2ab7[_0x3c2d('0x7d')]['length'];_0x2607f8+=0x1){if(_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x33')]&&_[_0x3c2d('0x68')](_0x16495e,_0x1a2ab7['joins'][_0x2607f8][_0x3c2d('0x33')])&&_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x7f')]&&_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x80')]&&_0x1a2ab7['joins'][_0x2607f8][_0x3c2d('0x81')]){_0x29e6ea[_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x33')]](_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8]['foreignTable'],null,util[_0x3c2d('0x7b')](_0x3c2d('0x82'),_0x1a2ab7['table'],_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x7f')],_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x80')],_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x81')]));}}}if(_0x1a2ab7[_0x3c2d('0x83')]){_0x1a2ab7[_0x3c2d('0x83')]=JSON[_0x3c2d('0x7e')](_0x1a2ab7['conditions']);_0x29e6ea[_0x3c2d('0x3f')](_0x1ae297(_0x1a2ab7[_0x3c2d('0x83')][_0x3c2d('0x6e')]));}_0x264430=_0x29e6ea[_0x3c2d('0x84')]();_0x29e6ea[_0x3c2d('0x21')](_0x50345d);_0x29e6ea[_0x3c2d('0x1f')](0x0);logger['debug'](_0x3c2d('0x85'),_0x29e6ea[_0x3c2d('0x86')]());return dbH[_0x3c2d('0x87')][_0x3c2d('0x35')](_0x29e6ea[_0x3c2d('0x86')](),{'type':dbH[_0x3c2d('0x87')][_0x3c2d('0x88')]['SELECT']});}})['then'](respondWithResult(_0x485bd7,null))[_0x3c2d('0x48')](handleError(_0x485bd7,null));};function runReport(_0xbffd12,_0x3458ed,_0x341565){var _0x3d8161=_0x3458ed['name'];var _0x3d0b54=0xa;var _0x27cdd0=[_0x3c2d('0x58'),_0x3c2d('0x59'),_0x3c2d('0x5a'),_0x3c2d('0x5b')];var _0x389541={'SUM':_0x3c2d('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3c2d('0x5e'),'MIN':_0x3c2d('0x5f'),'AVG':_0x3c2d('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3c2d('0x61'),'GROUP_CONCAT DESC':_0x3c2d('0x62')};var _0x5da9cd={'SEC_TO_TIME':_0x3c2d('0x63'),'DATE':_0x3c2d('0x64'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3c2d('0x67')};var _0x28b479=function(_0x3f08e4){return!_[_0x3c2d('0x68')]([_0x3c2d('0x89'),_0x3c2d('0x69'),'IS\x20EMPTY',_0x3c2d('0x6b')],_0x3f08e4);};var _0x39d234=function(_0x214bb4){if(!_0x214bb4||!_0x214bb4['rules'][_0x3c2d('0x3b')]){return'';}for(var _0x141454='(',_0x48a7c6=0x0;_0x48a7c6<_0x214bb4[_0x3c2d('0x6c')][_0x3c2d('0x3b')];_0x48a7c6+=0x1){_0x48a7c6>0x0&&(_0x141454+='\x20'+_0x214bb4[_0x3c2d('0x6d')]+'\x20');_0x141454+=_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6]['group']?_0x39d234(_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6][_0x3c2d('0x6e')]):_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6][_0x3c2d('0x6f')]+'\x20'+_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6][_0x3c2d('0x70')]+(_0x28b479(_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6]['condition'])?'\x20'+_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6]['value']:'');}return _0x141454+')';};var _0x1105a0={'where':{'id':_0xbffd12['id']}},_0x4b617b,_0x413b7e,_0x18c37c,_0x5ab646,_0x31e629;_0x1105a0=_[_0x3c2d('0x42')]({},_0x1105a0,_0x341565);return db['AnalyticCustomReport']['find'](_0x1105a0)[_0x3c2d('0x28')](function(_0x39d2dd){if(_0x39d2dd){_0x4b617b=_0x39d2dd;return _0x39d2dd[_0x3c2d('0x72')]();}return null;})[_0x3c2d('0x28')](function(_0x31e5ef){if(_0x31e5ef){if(!_0x31e5ef[_0x3c2d('0x3b')]){throw new db['Sequelize']['ValidationErrorItem'](_0x3c2d('0x75'),0x193);}_0x413b7e=_0x31e5ef;return db[_0x3c2d('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x18ce5d){if(_0x18ce5d){_0x18c37c=_['keyBy'](_0x18ce5d,'id');var _0x16a7ee;var _0xac227a=squel[_0x3c2d('0x8b')]();_0xac227a[_0x3c2d('0x8c')](_0x4b617b[_0x3c2d('0x77')]);for(var _0x3038b8=0x0;_0x3038b8<_0x413b7e[_0x3c2d('0x3b')];_0x3038b8+=0x1){_0x16a7ee=_0x413b7e[_0x3038b8][_0x3c2d('0x78')]?_0x18c37c[_0x413b7e[_0x3038b8][_0x3c2d('0x78')]]['metric']:_0x413b7e[_0x3038b8][_0x3c2d('0x6f')];_0x16a7ee=_0x413b7e[_0x3038b8][_0x3c2d('0x79')]?_['replace'](_0x389541[_0x413b7e[_0x3038b8][_0x3c2d('0x79')]],'%s',_0x16a7ee):_0x16a7ee;_0x16a7ee=_0x413b7e[_0x3038b8][_0x3c2d('0x7b')]?_[_0x3c2d('0x7a')](_0x5da9cd[_0x413b7e[_0x3038b8][_0x3c2d('0x7b')]],'%s',_0x16a7ee):_0x16a7ee;if(_0x413b7e[_0x3038b8][_0x3c2d('0x8d')]){_0xac227a[_0x3c2d('0x6e')](_0x16a7ee);}_0x413b7e[_0x3038b8]['orderBy']&&_0xac227a[_0x3c2d('0x8e')](_0x16a7ee,_0x413b7e[_0x3038b8][_0x3c2d('0x7c')]===_0x3c2d('0x8f')?![]:!![]);_0xac227a['field'](_0x16a7ee,_0x413b7e[_0x3038b8][_0x3c2d('0x90')]||_0x16a7ee);}if(_0x4b617b['joins']){_0x4b617b[_0x3c2d('0x7d')]=JSON[_0x3c2d('0x7e')](_0x4b617b['joins']);for(var _0x1e6f7d=0x0;_0x1e6f7d<_0x4b617b[_0x3c2d('0x7d')]['length'];_0x1e6f7d+=0x1){if(_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x33')]&&_['includes'](_0x27cdd0,_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x33')])&&_0x4b617b['joins'][_0x1e6f7d][_0x3c2d('0x7f')]&&_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x80')]&&_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x81')]){_0xac227a[_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x33')]](_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x80')],null,util[_0x3c2d('0x7b')](_0x3c2d('0x82'),_0x4b617b[_0x3c2d('0x77')],_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x7f')],_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x80')],_0x4b617b['joins'][_0x1e6f7d]['foreignKey']));}}}if(_0x4b617b[_0x3c2d('0x83')]){_0x4b617b['conditions']=JSON[_0x3c2d('0x7e')](_0x4b617b[_0x3c2d('0x83')]);_0xac227a[_0x3c2d('0x3f')](_0x39d234(_0x4b617b[_0x3c2d('0x83')]['group']));}_0x31e629=_0xac227a[_0x3c2d('0x84')]();_0xac227a['limit'](_0x3d0b54);_0xac227a[_0x3c2d('0x1f')](0x0);return;}})[_0x3c2d('0x28')](function(){if(_0x3458ed[_0x3c2d('0x91')]==='web'){return null;}var _0x402eda=_[_0x3c2d('0x42')](_0x3458ed,{'name':_0x3458ed['fullPath']||_0x3458ed[_0x3c2d('0x2e')]||_0x4b617b[_0x3c2d('0x2e')],'basename':_0x3d8161,'savename':util[_0x3c2d('0x7b')](_0x3c2d('0x92'),_0x3458ed[_0x3c2d('0x2e')]||_0x4b617b[_0x3c2d('0x2e')],require(_0x3c2d('0x93'))[_0x3c2d('0x94')](0x4),_0x3458ed[_0x3c2d('0x91')]||_0x3c2d('0x95')),'reportId':_0x4b617b['id'],'reportType':_0x3c2d('0x96')});return db[_0x3c2d('0x97')]['create'](_0x402eda,{'raw':!![]});})[_0x3c2d('0x28')](function(_0x28e89f){if(_0x4b617b[_0x3c2d('0x77')]==='cdr'){_0x31e629[_0x3c2d('0x3f')](_0x4b617b[_0x3c2d('0x77')]+_0x3c2d('0x98'),_0x3458ed[_0x3c2d('0x99')],_0x3458ed[_0x3c2d('0x9a')]);}else{_0x31e629['where'](_0x4b617b[_0x3c2d('0x77')]+_0x3c2d('0x9b'),_0x3458ed[_0x3c2d('0x99')],_0x3458ed[_0x3c2d('0x9a')]);}if(_0x28e89f){logger['info'](_0x3c2d('0x9c'),_0x31e629[_0x3c2d('0x86')]());require(_0x3c2d('0x9d'))['fork'](path[_0x3c2d('0x58')](__dirname,_0x3c2d('0x9e'),_0x28e89f[_0x3c2d('0x91')]),[_0x28e89f['id'],_0x31e629['toString'](),path[_0x3c2d('0x58')](__dirname,_0x3c2d('0x9f'),_0x28e89f[_0x3c2d('0xa0')]),_0x3d8161]);return _0x28e89f;}else{var _0x27f122=squel[_0x3c2d('0x8b')]();_0x27f122[_0x3c2d('0x8c')]('('+_0x31e629[_0x3c2d('0x86')]()+')',_0x3c2d('0xa1'));_0x27f122['field'](_0x3c2d('0xa2'),'count');_0x31e629['limit'](_0x3458ed[_0x3c2d('0x21')]||_0x3d0b54);_0x31e629[_0x3c2d('0x1f')](_0x3458ed[_0x3c2d('0x1f')]||0x0);return dbH[_0x3c2d('0x87')][_0x3c2d('0x35')](_0x27f122[_0x3c2d('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x3c2d('0xa3')]})[_0x3c2d('0x28')](function(_0x56733a){if(!_0x56733a[_0x3c2d('0x3b')]){_0x5ab646=0x0;}else{_0x5ab646=_0x56733a[0x0][_0x3c2d('0x22')]||0x0;}return dbH[_0x3c2d('0x87')][_0x3c2d('0x35')](_0x31e629['toString'](),{'type':dbH[_0x3c2d('0x87')][_0x3c2d('0x88')][_0x3c2d('0xa3')]});})[_0x3c2d('0x28')](function(_0x29924b){return{'rows':_0x29924b||[],'count':_0x5ab646};});}});}exports[_0x3c2d('0xa4')]=function(_0x3e11e0,_0x5ce247){return runReport(_0x3e11e0['params'],_0x3e11e0[_0x3c2d('0x35')],_0x3e11e0['options'])[_0x3c2d('0x28')](respondWithResult(_0x5ce247,null))[_0x3c2d('0x48')](handleError(_0x5ce247,null));};exports[_0x3c2d('0xa5')]=runReport;exports[_0x3c2d('0x35')]=function(_0x2ef164,_0x11e551){var _0x28809d=0xa;var _0x190aa0=[_0x3c2d('0x58'),'left_join',_0x3c2d('0x5a'),_0x3c2d('0x5b')];var _0x36ef6f={'SUM':'SUM(%s)','COUNT':_0x3c2d('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3c2d('0x5e'),'MIN':_0x3c2d('0x5f'),'AVG':_0x3c2d('0x60'),'GROUP_CONCAT':_0x3c2d('0xa6'),'GROUP_CONCAT ASC':_0x3c2d('0x61'),'GROUP_CONCAT DESC':_0x3c2d('0x62')};var _0x340eef={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3c2d('0x64'),'HOUR':_0x3c2d('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3c2d('0x67')};var _0x302d27=function(_0x20966d){return!_[_0x3c2d('0x68')]([_0x3c2d('0x89'),'IS\x20NOT\x20NULL',_0x3c2d('0x6a'),_0x3c2d('0x6b')],_0x20966d);};var _0xa5b703=function(_0x2f93d3){if(!_0x2f93d3||!_0x2f93d3[_0x3c2d('0x6c')][_0x3c2d('0x3b')]){return'';}for(var _0x43835f='(',_0x432de9=0x0;_0x432de9<_0x2f93d3['rules'][_0x3c2d('0x3b')];_0x432de9+=0x1){_0x432de9>0x0&&(_0x43835f+='\x20'+_0x2f93d3[_0x3c2d('0x6d')]+'\x20');_0x43835f+=_0x2f93d3[_0x3c2d('0x6c')][_0x432de9][_0x3c2d('0x6e')]?_0xa5b703(_0x2f93d3[_0x3c2d('0x6c')][_0x432de9][_0x3c2d('0x6e')]):_0x2f93d3['rules'][_0x432de9]['field']+'\x20'+_0x2f93d3[_0x3c2d('0x6c')][_0x432de9][_0x3c2d('0x70')]+(_0x302d27(_0x2f93d3[_0x3c2d('0x6c')][_0x432de9][_0x3c2d('0x70')])?'\x20'+_0x2f93d3[_0x3c2d('0x6c')][_0x432de9]['value']:'');}return _0x43835f+')';};var _0x341610={'where':{'id':_0x2ef164['params']['id']}},_0x221499,_0x1d000f,_0x5eddb5,_0x2d69cc,_0x476478;_0x341610=_['merge']({},_0x341610,_0x2ef164[_0x3c2d('0x43')]);return db[_0x3c2d('0x44')][_0x3c2d('0x4d')](_0x341610)['then'](function(_0x4d6fbd){if(_0x4d6fbd){_0x221499=_0x4d6fbd;return _0x4d6fbd[_0x3c2d('0x72')]();}return null;})[_0x3c2d('0x28')](function(_0x26ac84){if(_0x26ac84){if(!_0x26ac84['length']){throw new db['Sequelize'][(_0x3c2d('0x74'))](_0x3c2d('0x75'),0x193);}_0x1d000f=_0x26ac84;return db[_0x3c2d('0x8a')][_0x3c2d('0x46')]({'raw':!![]});}return null;})['then'](function(_0x1672a3){if(_0x1672a3){_0x5eddb5=_[_0x3c2d('0x76')](_0x1672a3,'id');var _0x1cecb3;var _0x8e3104=squel[_0x3c2d('0x8b')]();_0x8e3104[_0x3c2d('0x8c')](_0x221499['table']);for(var _0x4101f4=0x0;_0x4101f4<_0x1d000f[_0x3c2d('0x3b')];_0x4101f4+=0x1){_0x1cecb3=_0x1d000f[_0x4101f4][_0x3c2d('0x78')]?_0x5eddb5[_0x1d000f[_0x4101f4][_0x3c2d('0x78')]][_0x3c2d('0xa7')]:_0x1d000f[_0x4101f4][_0x3c2d('0x6f')];_0x1cecb3=_0x1d000f[_0x4101f4][_0x3c2d('0x79')]?_[_0x3c2d('0x7a')](_0x36ef6f[_0x1d000f[_0x4101f4][_0x3c2d('0x79')]],'%s',_0x1cecb3):_0x1cecb3;_0x1cecb3=_0x1d000f[_0x4101f4][_0x3c2d('0x7b')]?_[_0x3c2d('0x7a')](_0x340eef[_0x1d000f[_0x4101f4][_0x3c2d('0x7b')]],'%s',_0x1cecb3):_0x1cecb3;if(_0x1d000f[_0x4101f4][_0x3c2d('0x8d')]){_0x8e3104['group'](_0x1cecb3);}_0x1d000f[_0x4101f4][_0x3c2d('0x7c')]&&_0x8e3104[_0x3c2d('0x8e')](_0x1cecb3,_0x1d000f[_0x4101f4]['orderBy']===_0x3c2d('0x8f')?![]:!![]);_0x8e3104['field'](_0x1cecb3,_0x1d000f[_0x4101f4][_0x3c2d('0x90')]||_0x1cecb3);}if(_0x221499['joins']){_0x221499[_0x3c2d('0x7d')]=JSON[_0x3c2d('0x7e')](_0x221499[_0x3c2d('0x7d')]);for(var _0x52ebd8=0x0;_0x52ebd8<_0x221499[_0x3c2d('0x7d')][_0x3c2d('0x3b')];_0x52ebd8+=0x1){if(_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x33')]&&_[_0x3c2d('0x68')](_0x190aa0,_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x33')])&&_0x221499['joins'][_0x52ebd8]['parentKey']&&_0x221499['joins'][_0x52ebd8][_0x3c2d('0x80')]&&_0x221499[_0x3c2d('0x7d')][_0x52ebd8]['foreignKey']){_0x8e3104[_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x33')]](_0x221499[_0x3c2d('0x7d')][_0x52ebd8]['foreignTable'],null,util[_0x3c2d('0x7b')](_0x3c2d('0x82'),_0x221499[_0x3c2d('0x77')],_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x7f')],_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x80')],_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x81')]));}}}if(_0x221499[_0x3c2d('0x83')]){_0x221499['conditions']=JSON[_0x3c2d('0x7e')](_0x221499[_0x3c2d('0x83')]);_0x8e3104['where'](_0xa5b703(_0x221499[_0x3c2d('0x83')][_0x3c2d('0x6e')]));}_0x476478=_0x8e3104[_0x3c2d('0x84')]();_0x8e3104[_0x3c2d('0x21')](_0x28809d);_0x8e3104[_0x3c2d('0x1f')](0x0);logger[_0x3c2d('0xa8')](_0x3c2d('0x85'),_0x8e3104[_0x3c2d('0x86')]());return dbH['sequelize'][_0x3c2d('0x35')](_0x8e3104[_0x3c2d('0x86')](),{'type':dbH[_0x3c2d('0x87')][_0x3c2d('0x88')]['SELECT']});}})['then'](function(){return{'sql':_0x476478['toString']()};})[_0x3c2d('0x28')](respondWithResult(_0x11e551,null))[_0x3c2d('0x48')](handleError(_0x11e551,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 2d8d076..d93254f 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 _0x1077=['rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1077,0x1ad));var _0x7107=function(_0x44bb15,_0x3fc1e9){_0x44bb15=_0x44bb15-0x0;var _0x4fdd05=_0x1077[_0x44bb15];return _0x4fdd05;};'use strict';var _=require(_0x7107('0x0'));var util=require(_0x7107('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7107('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7107('0x3'));var config=require(_0x7107('0x4'));var attributes=require(_0x7107('0x5'));module['exports']=function(_0x2bde15,_0x5d0c6e){return _0x2bde15[_0x7107('0x6')](_0x7107('0x7'),attributes,{'tableName':_0x7107('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c0f=['../../config/environment','./analyticCustomReport.attributes','analytics_custom_reports','util','../../config/logger','bluebird','request-promise','path'];(function(_0x53c88b,_0x295d4c){var _0x2d4c27=function(_0x5ae123){while(--_0x5ae123){_0x53c88b['push'](_0x53c88b['shift']());}};_0x2d4c27(++_0x295d4c);}(_0x1c0f,0x11b));var _0xf1c0=function(_0x37d366,_0x858264){_0x37d366=_0x37d366-0x0;var _0x13e576=_0x1c0f[_0x37d366];return _0x13e576;};'use strict';var _=require('lodash');var util=require(_0xf1c0('0x0'));var logger=require(_0xf1c0('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf1c0('0x2'));var rp=require(_0xf1c0('0x3'));var fs=require('fs');var path=require(_0xf1c0('0x4'));var rimraf=require('rimraf');var config=require(_0xf1c0('0x5'));var attributes=require(_0xf1c0('0x6'));module['exports']=function(_0x5c8461,_0x56d535){return _0x5c8461['define']('AnalyticCustomReport',attributes,{'tableName':_0xf1c0('0x7'),'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 3411222..43e6788 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 _0x0d07=['error','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0d07,0x12a));var _0x70d0=function(_0x164d5c,_0xf9f2ea){_0x164d5c=_0x164d5c-0x0;var _0x58be62=_0x0d07[_0x164d5c];return _0x58be62;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x70d0('0x0'));var BPromise=require(_0x70d0('0x1'));var rs=require(_0x70d0('0x2'));var fs=require('fs');var Redis=require(_0x70d0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x70d0('0x4'));var logger=require(_0x70d0('0x5'))(_0x70d0('0x6'));var config=require(_0x70d0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x70d0('0x8')][_0x70d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x505528,_0x34ac3e,_0x13017b){return new BPromise(function(_0x8c4d46,_0x38c41d){return client[_0x70d0('0xa')](_0x505528,_0x13017b)[_0x70d0('0xb')](function(_0x1d8b87){logger[_0x70d0('0xc')](_0x70d0('0xd'),_0x34ac3e,_0x70d0('0xe'));logger[_0x70d0('0xf')](_0x70d0('0x10'),_0x34ac3e,_0x70d0('0xe'),JSON['stringify'](_0x1d8b87));if(_0x1d8b87[_0x70d0('0x11')]){if(_0x1d8b87[_0x70d0('0x11')]['code']===0x1f4){logger[_0x70d0('0x11')](_0x70d0('0xd'),_0x34ac3e,_0x1d8b87['error'][_0x70d0('0x12')]);return _0x38c41d(_0x1d8b87['error']['message']);}logger['error'](_0x70d0('0xd'),_0x34ac3e,_0x1d8b87[_0x70d0('0x11')][_0x70d0('0x12')]);return _0x8c4d46(_0x1d8b87[_0x70d0('0x11')]['message']);}else{logger[_0x70d0('0xc')](_0x70d0('0xd'),_0x34ac3e,'request\x20sent');_0x8c4d46(_0x1d8b87[_0x70d0('0x13')][_0x70d0('0x12')]);}})[_0x70d0('0x14')](function(_0x3b1eef){logger[_0x70d0('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x34ac3e,_0x3b1eef);_0x38c41d(_0x3b1eef);});});} \ No newline at end of file +var _0x7e2e=['jayson/promise','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x298dc2,_0x498b39){var _0x1a6877=function(_0x393b02){while(--_0x393b02){_0x298dc2['push'](_0x298dc2['shift']());}};_0x1a6877(++_0x498b39);}(_0x7e2e,0x1b0));var _0xe7e2=function(_0x344ac8,_0x381df7){_0x344ac8=_0x344ac8-0x0;var _0x4984f4=_0x7e2e[_0x344ac8];return _0x4984f4;};'use strict';var _=require(_0xe7e2('0x0'));var util=require(_0xe7e2('0x1'));var moment=require(_0xe7e2('0x2'));var BPromise=require(_0xe7e2('0x3'));var rs=require(_0xe7e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe7e2('0x5'));var logger=require(_0xe7e2('0x6'))(_0xe7e2('0x7'));var config=require(_0xe7e2('0x8'));var jayson=require(_0xe7e2('0x9'));var client=jayson['client'][_0xe7e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2aee3b,_0x44448e,_0x209dfb){return new BPromise(function(_0xf9d6db,_0x3805f2){return client[_0xe7e2('0xb')](_0x2aee3b,_0x209dfb)['then'](function(_0x387143){logger[_0xe7e2('0xc')](_0xe7e2('0xd'),_0x44448e,_0xe7e2('0xe'));logger[_0xe7e2('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x44448e,_0xe7e2('0xe'),JSON[_0xe7e2('0x10')](_0x387143));if(_0x387143['error']){if(_0x387143[_0xe7e2('0x11')][_0xe7e2('0x12')]===0x1f4){logger[_0xe7e2('0x11')](_0xe7e2('0xd'),_0x44448e,_0x387143[_0xe7e2('0x11')][_0xe7e2('0x13')]);return _0x3805f2(_0x387143[_0xe7e2('0x11')][_0xe7e2('0x13')]);}logger[_0xe7e2('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x44448e,_0x387143[_0xe7e2('0x11')][_0xe7e2('0x13')]);return _0xf9d6db(_0x387143[_0xe7e2('0x11')][_0xe7e2('0x13')]);}else{logger['info'](_0xe7e2('0xd'),_0x44448e,_0xe7e2('0xe'));_0xf9d6db(_0x387143[_0xe7e2('0x14')][_0xe7e2('0x13')]);}})['catch'](function(_0x891636){logger['error'](_0xe7e2('0xd'),_0x44448e,_0x891636);_0x3805f2(_0x891636);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 401801d..689ab88 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 _0xfb98=['put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post'];(function(_0x4ef56b,_0x1f8891){var _0x58b4de=function(_0x38c402){while(--_0x38c402){_0x4ef56b['push'](_0x4ef56b['shift']());}};_0x58b4de(++_0x1f8891);}(_0xfb98,0xd5));var _0x8fb9=function(_0x175711,_0x152abc){_0x175711=_0x175711-0x0;var _0x226cbd=_0xfb98[_0x175711];return _0x226cbd;};'use strict';var multer=require('multer');var util=require(_0x8fb9('0x0'));var path=require(_0x8fb9('0x1'));var timeout=require(_0x8fb9('0x2'));var express=require(_0x8fb9('0x3'));var router=express[_0x8fb9('0x4')]();var fs_extra=require(_0x8fb9('0x5'));var auth=require(_0x8fb9('0x6'));var interaction=require(_0x8fb9('0x7'));var config=require(_0x8fb9('0x8'));var controller=require(_0x8fb9('0x9'));router[_0x8fb9('0xa')]('/',auth[_0x8fb9('0xb')](),controller[_0x8fb9('0xc')]);router[_0x8fb9('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x8fb9('0xd')]);router[_0x8fb9('0xa')](_0x8fb9('0xe'),auth[_0x8fb9('0xb')](),controller[_0x8fb9('0xf')]);router[_0x8fb9('0xa')](_0x8fb9('0x10'),auth['isAuthenticated'](),controller[_0x8fb9('0x11')]);router['get'](_0x8fb9('0x12'),auth['isAuthenticated'](),controller[_0x8fb9('0x13')]);router[_0x8fb9('0x14')]('/',auth[_0x8fb9('0xb')](),controller['create']);router[_0x8fb9('0x15')](_0x8fb9('0x16'),auth[_0x8fb9('0xb')](),controller[_0x8fb9('0x17')]);router[_0x8fb9('0x18')](_0x8fb9('0x16'),auth[_0x8fb9('0xb')](),controller[_0x8fb9('0x19')]);module['exports']=router; \ No newline at end of file +var _0x4ac1=['/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x55cde5,_0x1dc61e){var _0x285641=function(_0x5baca0){while(--_0x5baca0){_0x55cde5['push'](_0x55cde5['shift']());}};_0x285641(++_0x1dc61e);}(_0x4ac1,0x11e));var _0x14ac=function(_0x207fa2,_0x486e91){_0x207fa2=_0x207fa2-0x0;var _0x3bcbd1=_0x4ac1[_0x207fa2];return _0x3bcbd1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x14ac('0x0'));var timeout=require(_0x14ac('0x1'));var express=require(_0x14ac('0x2'));var router=express[_0x14ac('0x3')]();var fs_extra=require(_0x14ac('0x4'));var auth=require(_0x14ac('0x5'));var interaction=require(_0x14ac('0x6'));var config=require(_0x14ac('0x7'));var controller=require(_0x14ac('0x8'));router[_0x14ac('0x9')]('/',auth[_0x14ac('0xa')](),controller[_0x14ac('0xb')]);router[_0x14ac('0x9')](_0x14ac('0xc'),auth['isAuthenticated'](),controller[_0x14ac('0xd')]);router[_0x14ac('0x9')](_0x14ac('0xe'),auth['isAuthenticated'](),controller[_0x14ac('0xf')]);router['get'](_0x14ac('0x10'),auth[_0x14ac('0xa')](),controller[_0x14ac('0x11')]);router[_0x14ac('0x9')](_0x14ac('0x12'),auth[_0x14ac('0xa')](),controller[_0x14ac('0x13')]);router[_0x14ac('0x14')]('/',auth['isAuthenticated'](),controller[_0x14ac('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x14ac('0x16')]);router['delete']('/:id',auth[_0x14ac('0xa')](),controller[_0x14ac('0x17')]);module[_0x14ac('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 26a6880..76c5cc8 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 _0x33c5=['STRING','TEXT','exports'];(function(_0x198563,_0x9b45af){var _0x399bb6=function(_0x1cf46c){while(--_0x1cf46c){_0x198563['push'](_0x198563['shift']());}};_0x399bb6(++_0x9b45af);}(_0x33c5,0xe6));var _0x533c=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0x33c5[_0x2e249d];return _0x1faa37;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}}; \ No newline at end of file +var _0x4819=['TEXT','exports','STRING'];(function(_0x22431e,_0x5af0a3){var _0xd978e9=function(_0x2bbdd7){while(--_0x2bbdd7){_0x22431e['push'](_0x22431e['shift']());}};_0xd978e9(++_0x5af0a3);}(_0x4819,0xcd));var _0x9481=function(_0x32d553,_0x12f5e8){_0x32d553=_0x32d553-0x0;var _0x1707a4=_0x4819[_0x32d553];return _0x1707a4;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index fa89e8d..0e5b73c 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 _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','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','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x5ed411,_0xf717b9){var _0x1a03c9=function(_0x827cd7){while(--_0x827cd7){_0x5ed411['push'](_0x5ed411['shift']());}};_0x1a03c9(++_0xf717b9);}(_0x524e,0x15e));var _0xe524=function(_0x1b662c,_0x12878d){_0x1b662c=_0x1b662c-0x0;var _0x336638=_0x524e[_0x1b662c];return _0x336638;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));}; \ No newline at end of file +var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x1406db,_0x487af2){var _0x48ed7e=function(_0x18b78f){while(--_0x18b78f){_0x1406db['push'](_0x1406db['shift']());}};_0x48ed7e(++_0x487af2);}(_0x1967,0x173));var _0x7196=function(_0x494fde,_0xfc7043){_0x494fde=_0x494fde-0x0;var _0x2b271d=_0x1967[_0x494fde];return _0x2b271d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 65b7aa4..16eac59 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 _0xce78=['rimraf','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x253088,_0x1834e4){var _0x5d5f6e=function(_0x2124df){while(--_0x2124df){_0x253088['push'](_0x253088['shift']());}};_0x5d5f6e(++_0x1834e4);}(_0xce78,0x1d3));var _0x8ce7=function(_0x44fb02,_0x16bdbc){_0x44fb02=_0x44fb02-0x0;var _0x4d3aaa=_0xce78[_0x44fb02];return _0x4d3aaa;};'use strict';var _=require(_0x8ce7('0x0'));var util=require(_0x8ce7('0x1'));var logger=require(_0x8ce7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8ce7('0x3'));var rp=require(_0x8ce7('0x4'));var fs=require('fs');var path=require(_0x8ce7('0x5'));var rimraf=require(_0x8ce7('0x6'));var config=require('../../config/environment');var attributes=require(_0x8ce7('0x7'));module[_0x8ce7('0x8')]=function(_0xc44713,_0x496586){return _0xc44713['define'](_0x8ce7('0x9'),attributes,{'tableName':_0x8ce7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf23=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x4a0c06,_0x50e132){var _0x2bafd0=function(_0x1dc7f9){while(--_0x1dc7f9){_0x4a0c06['push'](_0x4a0c06['shift']());}};_0x2bafd0(++_0x50e132);}(_0xaf23,0x1f2));var _0x3af2=function(_0x6b65a,_0xc8eda1){_0x6b65a=_0x6b65a-0x0;var _0x27deeb=_0xaf23[_0x6b65a];return _0x27deeb;};'use strict';var _=require(_0x3af2('0x0'));var util=require(_0x3af2('0x1'));var logger=require(_0x3af2('0x2'))('api');var moment=require(_0x3af2('0x3'));var BPromise=require('bluebird');var rp=require(_0x3af2('0x4'));var fs=require('fs');var path=require(_0x3af2('0x5'));var rimraf=require(_0x3af2('0x6'));var config=require(_0x3af2('0x7'));var attributes=require(_0x3af2('0x8'));module[_0x3af2('0x9')]=function(_0x11a461,_0x8fa0c2){return _0x11a461[_0x3af2('0xa')](_0x3af2('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index a41e7cb..b2f6a4b 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 _0xe34c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x206247,_0x149b6c){var _0x523c16=function(_0x2ee1b2){while(--_0x2ee1b2){_0x206247['push'](_0x206247['shift']());}};_0x523c16(++_0x149b6c);}(_0xe34c,0x65));var _0xce34=function(_0x1ae9f4,_0x1e7ec3){_0x1ae9f4=_0x1ae9f4-0x0;var _0x7cfef=_0xe34c[_0x1ae9f4];return _0x7cfef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xce34('0x0'));var BPromise=require(_0xce34('0x1'));var rs=require(_0xce34('0x2'));var fs=require('fs');var Redis=require(_0xce34('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce34('0x4'));var logger=require(_0xce34('0x5'))(_0xce34('0x6'));var config=require(_0xce34('0x7'));var jayson=require(_0xce34('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23f9fb,_0xad3c40,_0x105ec6){return new BPromise(function(_0x25eb6f,_0x3c2e0b){return client[_0xce34('0x9')](_0x23f9fb,_0x105ec6)[_0xce34('0xa')](function(_0x4ce4c9){logger[_0xce34('0xb')](_0xce34('0xc'),_0xad3c40,_0xce34('0xd'));logger['debug'](_0xce34('0xe'),_0xad3c40,_0xce34('0xd'),JSON[_0xce34('0xf')](_0x4ce4c9));if(_0x4ce4c9[_0xce34('0x10')]){if(_0x4ce4c9['error'][_0xce34('0x11')]===0x1f4){logger[_0xce34('0x10')](_0xce34('0xc'),_0xad3c40,_0x4ce4c9[_0xce34('0x10')]['message']);return _0x3c2e0b(_0x4ce4c9[_0xce34('0x10')][_0xce34('0x12')]);}logger[_0xce34('0x10')](_0xce34('0xc'),_0xad3c40,_0x4ce4c9['error'][_0xce34('0x12')]);return _0x25eb6f(_0x4ce4c9[_0xce34('0x10')][_0xce34('0x12')]);}else{logger[_0xce34('0xb')](_0xce34('0xc'),_0xad3c40,_0xce34('0xd'));_0x25eb6f(_0x4ce4c9[_0xce34('0x13')][_0xce34('0x12')]);}})[_0xce34('0x14')](function(_0x584e4c){logger[_0xce34('0x10')](_0xce34('0xc'),_0xad3c40,_0x584e4c);_0x3c2e0b(_0x584e4c);});});} \ No newline at end of file +var _0xdb76=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x560615,_0x57b639){var _0x3b624f=function(_0x44af3a){while(--_0x44af3a){_0x560615['push'](_0x560615['shift']());}};_0x3b624f(++_0x57b639);}(_0xdb76,0x1c0));var _0x6db7=function(_0x1919c2,_0x4d04af){_0x1919c2=_0x1919c2-0x0;var _0x5e1451=_0xdb76[_0x1919c2];return _0x5e1451;};'use strict';var _=require(_0x6db7('0x0'));var util=require('util');var moment=require(_0x6db7('0x1'));var BPromise=require('bluebird');var rs=require(_0x6db7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6db7('0x3'))['db'];var utils=require(_0x6db7('0x4'));var logger=require(_0x6db7('0x5'))(_0x6db7('0x6'));var config=require(_0x6db7('0x7'));var jayson=require(_0x6db7('0x8'));var client=jayson[_0x6db7('0x9')][_0x6db7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ce150,_0x166b3c,_0xe19bc8){return new BPromise(function(_0x1abd6c,_0x59ef2a){return client['request'](_0x3ce150,_0xe19bc8)[_0x6db7('0xb')](function(_0x32c5c8){logger['info'](_0x6db7('0xc'),_0x166b3c,_0x6db7('0xd'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x166b3c,_0x6db7('0xd'),JSON[_0x6db7('0xe')](_0x32c5c8));if(_0x32c5c8['error']){if(_0x32c5c8['error'][_0x6db7('0xf')]===0x1f4){logger[_0x6db7('0x10')](_0x6db7('0xc'),_0x166b3c,_0x32c5c8['error']['message']);return _0x59ef2a(_0x32c5c8['error']['message']);}logger[_0x6db7('0x10')](_0x6db7('0xc'),_0x166b3c,_0x32c5c8['error'][_0x6db7('0x11')]);return _0x1abd6c(_0x32c5c8[_0x6db7('0x10')]['message']);}else{logger[_0x6db7('0x12')](_0x6db7('0xc'),_0x166b3c,'request\x20sent');_0x1abd6c(_0x32c5c8['result']['message']);}})[_0x6db7('0x13')](function(_0x40f209){logger[_0x6db7('0x10')](_0x6db7('0xc'),_0x166b3c,_0x40f209);_0x59ef2a(_0x40f209);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index b7850b9..412e902 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 _0x347a=['./analyticDefaultReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x347a,0x148));var _0xa347=function(_0x5efb4a,_0x39b1ec){_0x5efb4a=_0x5efb4a-0x0;var _0x5f31a2=_0x347a[_0x5efb4a];return _0x5f31a2;};'use strict';var multer=require(_0xa347('0x0'));var util=require('util');var path=require(_0xa347('0x1'));var timeout=require(_0xa347('0x2'));var express=require('express');var router=express[_0xa347('0x3')]();var fs_extra=require(_0xa347('0x4'));var auth=require(_0xa347('0x5'));var interaction=require(_0xa347('0x6'));var config=require(_0xa347('0x7'));var controller=require(_0xa347('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa347('0x9')]);router[_0xa347('0xa')](_0xa347('0xb'),auth[_0xa347('0xc')](),controller[_0xa347('0xd')]);router[_0xa347('0xa')](_0xa347('0xe'),auth[_0xa347('0xc')](),controller[_0xa347('0xf')]);router['get'](_0xa347('0x10'),auth[_0xa347('0xc')](),controller['run']);router[_0xa347('0xa')](_0xa347('0x11'),auth[_0xa347('0xc')](),controller[_0xa347('0x12')]);router[_0xa347('0x13')]('/',auth[_0xa347('0xc')](),controller[_0xa347('0x14')]);router[_0xa347('0x15')](_0xa347('0xb'),auth[_0xa347('0xc')](),controller[_0xa347('0x16')]);router[_0xa347('0x17')](_0xa347('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbf43=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','put','update'];(function(_0x487b69,_0x5dcac2){var _0x3cd138=function(_0x705626){while(--_0x705626){_0x487b69['push'](_0x487b69['shift']());}};_0x3cd138(++_0x5dcac2);}(_0xbf43,0x13b));var _0x3bf4=function(_0x26ee7f,_0x25c2ac){_0x26ee7f=_0x26ee7f-0x0;var _0x1ed8b4=_0xbf43[_0x26ee7f];return _0x1ed8b4;};'use strict';var multer=require(_0x3bf4('0x0'));var util=require(_0x3bf4('0x1'));var path=require(_0x3bf4('0x2'));var timeout=require(_0x3bf4('0x3'));var express=require(_0x3bf4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3bf4('0x5'));var interaction=require(_0x3bf4('0x6'));var config=require(_0x3bf4('0x7'));var controller=require(_0x3bf4('0x8'));router[_0x3bf4('0x9')]('/',auth[_0x3bf4('0xa')](),controller['index']);router[_0x3bf4('0x9')](_0x3bf4('0xb'),auth[_0x3bf4('0xa')](),controller[_0x3bf4('0xc')]);router[_0x3bf4('0x9')](_0x3bf4('0xd'),auth['isAuthenticated'](),controller[_0x3bf4('0xe')]);router[_0x3bf4('0x9')](_0x3bf4('0xf'),auth[_0x3bf4('0xa')](),controller[_0x3bf4('0x10')]);router[_0x3bf4('0x9')](_0x3bf4('0x11'),auth[_0x3bf4('0xa')](),controller[_0x3bf4('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3bf4('0x13')](_0x3bf4('0xb'),auth['isAuthenticated'](),controller[_0x3bf4('0x14')]);router[_0x3bf4('0x15')](_0x3bf4('0xb'),auth[_0x3bf4('0xa')](),controller[_0x3bf4('0x16')]);module[_0x3bf4('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 79a949e..79ad553 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 _0x6051=['INTEGER','UNSIGNED','sequelize','moment','exports','ENUM','pdf','xlsx','csv','STRING','DATE','manual','scheduled'];(function(_0x2883cd,_0x2c2d03){var _0x3ea560=function(_0x3cbee5){while(--_0x3cbee5){_0x2883cd['push'](_0x2883cd['shift']());}};_0x3ea560(++_0x2c2d03);}(_0x6051,0x91));var _0x1605=function(_0x5266e7,_0x97b16b){_0x5266e7=_0x5266e7-0x0;var _0x5470f1=_0x6051[_0x5266e7];return _0x5470f1;};'use strict';var Sequelize=require(_0x1605('0x0'));var moment=require(_0x1605('0x1'));module[_0x1605('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x1605('0x3')]('csv',_0x1605('0x4'),_0x1605('0x5')),'allowNull':![],'defaultValue':_0x1605('0x6')},'savename':{'type':Sequelize[_0x1605('0x7')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1605('0x8')]},'endDate':{'type':Sequelize[_0x1605('0x8')]},'status':{'type':Sequelize[_0x1605('0x7')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x1605('0x9'),_0x1605('0xa')),'allowNull':![],'defaultValue':_0x1605('0x9')},'reportId':{'type':Sequelize[_0x1605('0xb')](0xb)[_0x1605('0xc')]},'reportType':{'type':Sequelize[_0x1605('0x7')]}}; \ No newline at end of file +var _0xfe2f=['csv','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','xlsx'];(function(_0x17c32c,_0x35683f){var _0x2847b6=function(_0x4cf68b){while(--_0x4cf68b){_0x17c32c['push'](_0x17c32c['shift']());}};_0x2847b6(++_0x35683f);}(_0xfe2f,0x1db));var _0xffe2=function(_0x130f1b,_0x49b396){_0x130f1b=_0x130f1b-0x0;var _0x3bf16e=_0xfe2f[_0x130f1b];return _0x3bf16e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xffe2('0x0'));module[_0xffe2('0x1')]={'name':{'type':Sequelize[_0xffe2('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xffe2('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xffe2('0x3')]('csv','pdf',_0xffe2('0x4')),'allowNull':![],'defaultValue':_0xffe2('0x5')},'savename':{'type':Sequelize[_0xffe2('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xffe2('0x6')]},'endDate':{'type':Sequelize[_0xffe2('0x6')]},'status':{'type':Sequelize[_0xffe2('0x2')],'defaultValue':_0xffe2('0x7')},'type':{'type':Sequelize[_0xffe2('0x3')](_0xffe2('0x8'),_0xffe2('0x9')),'allowNull':![],'defaultValue':_0xffe2('0x8')},'reportId':{'type':Sequelize[_0xffe2('0xa')](0xb)[_0xffe2('0xb')]},'reportType':{'type':Sequelize[_0xffe2('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index a203762..ce886fa 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 _0xe5cd=['UserProfileSection','userProfileId','autoAssociation','params','download','basename','savename','output','existsSync','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','findAll','rows','catch','show','length','include','find','create','body','user','role'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0xe5cd,0x12b));var _0xde5c=function(_0xa57fa4,_0x314a8e){_0xa57fa4=_0xa57fa4-0x0;var _0x160e9b=_0xe5cd[_0xa57fa4];return _0x160e9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde5c('0x0'));var zipdir=require(_0xde5c('0x1'));var jsonpatch=require(_0xde5c('0x2'));var rp=require('request-promise');var moment=require(_0xde5c('0x3'));var BPromise=require(_0xde5c('0x4'));var Mustache=require(_0xde5c('0x5'));var util=require(_0xde5c('0x6'));var path=require(_0xde5c('0x7'));var sox=require('sox');var csv=require(_0xde5c('0x8'));var ejs=require(_0xde5c('0x9'));var fs=require('fs');var fs_extra=require(_0xde5c('0xa'));var _=require('lodash');var squel=require(_0xde5c('0xb'));var crypto=require(_0xde5c('0xc'));var jsforce=require(_0xde5c('0xd'));var deskjs=require(_0xde5c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xde5c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde5c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde5c('0x11'));var utils=require(_0xde5c('0x12'));var config=require(_0xde5c('0x13'));var licenseUtil=require(_0xde5c('0x14'));var db=require(_0xde5c('0x15'))['db'];function respondWithStatusCode(_0x151917,_0x252404){_0x252404=_0x252404||0xcc;return function(_0x2d814e){if(_0x2d814e){return _0x151917[_0xde5c('0x16')](_0x252404);}return _0x151917[_0xde5c('0x17')](_0x252404)['end']();};}function respondWithResult(_0x28b99f,_0x1998c4){_0x1998c4=_0x1998c4||0xc8;return function(_0x3974e0){if(_0x3974e0){return _0x28b99f[_0xde5c('0x17')](_0x1998c4)[_0xde5c('0x18')](_0x3974e0);}};}function respondWithFilteredResult(_0x3cb0f1,_0x1bb2b2){return function(_0x807c2a){if(_0x807c2a){var _0x17fa6f=typeof _0x1bb2b2[_0xde5c('0x19')]===_0xde5c('0x1a')&&typeof _0x1bb2b2[_0xde5c('0x1b')]===_0xde5c('0x1a');var _0x445429=_0x807c2a[_0xde5c('0x1c')];var _0x3599e9=_0x17fa6f?0x0:_0x1bb2b2[_0xde5c('0x19')];var _0x5b3ab4=_0x17fa6f?_0x807c2a['count']:_0x1bb2b2['offset']+_0x1bb2b2['limit'];var _0x228902;if(_0x5b3ab4>=_0x445429){_0x5b3ab4=_0x445429;_0x228902=0xc8;}else{_0x228902=0xce;}_0x3cb0f1[_0xde5c('0x17')](_0x228902);return _0x3cb0f1[_0xde5c('0x1d')]('Content-Range',_0x3599e9+'-'+_0x5b3ab4+'/'+_0x445429)[_0xde5c('0x18')](_0x807c2a);}return null;};}function patchUpdates(_0x1a0b9a){return function(_0x22f13b){try{jsonpatch[_0xde5c('0x1e')](_0x22f13b,_0x1a0b9a,!![]);}catch(_0x20c579){return BPromise['reject'](_0x20c579);}return _0x22f13b[_0xde5c('0x1f')]();};}function saveUpdates(_0x20b168,_0x335034){return function(_0x1ae139){if(_0x1ae139){return _0x1ae139[_0xde5c('0x20')](_0x20b168)[_0xde5c('0x21')](function(_0x27995d){return _0x27995d;});}return null;};}function removeEntity(_0x3477d4,_0xc4fc10){return function(_0x6bc68b){if(_0x6bc68b){return _0x6bc68b[_0xde5c('0x22')]()[_0xde5c('0x21')](function(){var _0xd5eca8=_0x6bc68b[_0xde5c('0x23')]({'plain':!![]});var _0x37ad39=_0xde5c('0x24');return db[_0xde5c('0x25')]['destroy']({'where':{'type':_0x37ad39,'resourceId':_0xd5eca8['id']}})[_0xde5c('0x21')](function(){return _0x6bc68b;});})[_0xde5c('0x21')](function(){_0x3477d4[_0xde5c('0x17')](0xcc)[_0xde5c('0x26')]();});}};}function handleEntityNotFound(_0x1fe3ce,_0x4e1ab7){return function(_0x3dbc7e){if(!_0x3dbc7e){_0x1fe3ce[_0xde5c('0x16')](0x194);}return _0x3dbc7e;};}function handleError(_0x2a34dc,_0x2a6317){_0x2a6317=_0x2a6317||0x1f4;return function(_0x56171d){logger[_0xde5c('0x27')](_0x56171d[_0xde5c('0x28')]);if(_0x56171d[_0xde5c('0x29')]){delete _0x56171d['name'];}_0x2a34dc[_0xde5c('0x17')](_0x2a6317)[_0xde5c('0x2a')](_0x56171d);};}exports[_0xde5c('0x2b')]=function(_0x727396,_0x363a71){var _0x39455c={},_0x3f1713={},_0x2a3570={'count':0x0,'rows':[]};var _0x24d91e=_[_0xde5c('0x2c')](db[_0xde5c('0x2d')][_0xde5c('0x2e')],function(_0x10bcee){return{'name':_0x10bcee['fieldName'],'type':_0x10bcee[_0xde5c('0x2f')][_0xde5c('0x30')]};});_0x3f1713[_0xde5c('0x31')]=_['map'](_0x24d91e,'name');_0x3f1713[_0xde5c('0x32')]=_[_0xde5c('0x33')](_0x727396['query']);_0x3f1713[_0xde5c('0x34')]=_[_0xde5c('0x35')](_0x3f1713['model'],_0x3f1713[_0xde5c('0x32')]);_0x39455c['attributes']=_[_0xde5c('0x35')](_0x3f1713[_0xde5c('0x31')],qs[_0xde5c('0x36')](_0x727396[_0xde5c('0x32')][_0xde5c('0x36')]));_0x39455c[_0xde5c('0x37')]=_0x39455c[_0xde5c('0x37')]['length']?_0x39455c['attributes']:_0x3f1713[_0xde5c('0x31')];if(!_0x727396[_0xde5c('0x32')][_0xde5c('0x38')]('nolimit')){_0x39455c['limit']=qs[_0xde5c('0x1b')](_0x727396['query'][_0xde5c('0x1b')]);_0x39455c[_0xde5c('0x19')]=qs[_0xde5c('0x19')](_0x727396[_0xde5c('0x32')][_0xde5c('0x19')]);}_0x39455c[_0xde5c('0x39')]=qs['sort'](_0x727396[_0xde5c('0x32')][_0xde5c('0x3a')]);_0x39455c['where']=qs[_0xde5c('0x34')](_[_0xde5c('0x3b')](_0x727396[_0xde5c('0x32')],_0x3f1713[_0xde5c('0x34')]),_0x24d91e);if(_0x727396[_0xde5c('0x32')][_0xde5c('0x3c')]){_0x39455c['where']=_[_0xde5c('0x3d')](_0x39455c['where'],{'$or':_[_0xde5c('0x2c')](_0x24d91e,function(_0x506b8f){if(_0x506b8f['type']!==_0xde5c('0x3e')){var _0x27b0d8={};_0x27b0d8[_0x506b8f['name']]={'$like':'%'+_0x727396[_0xde5c('0x32')][_0xde5c('0x3c')]+'%'};return _0x27b0d8;}})});}_0x39455c=_[_0xde5c('0x3d')]({},_0x39455c,_0x727396[_0xde5c('0x3f')]);var _0x2601b3={'where':_0x39455c[_0xde5c('0x40')]};return db[_0xde5c('0x2d')][_0xde5c('0x1c')](_0x2601b3)[_0xde5c('0x21')](function(_0x4d2589){_0x2a3570[_0xde5c('0x1c')]=_0x4d2589;if(_0x727396['query'][_0xde5c('0x41')]){_0x39455c['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xde5c('0x42')](_0x39455c);})[_0xde5c('0x21')](function(_0x3f0530){_0x2a3570[_0xde5c('0x43')]=_0x3f0530;return _0x2a3570;})[_0xde5c('0x21')](respondWithFilteredResult(_0x363a71,_0x39455c))[_0xde5c('0x44')](handleError(_0x363a71,null));};exports[_0xde5c('0x45')]=function(_0x5cd68e,_0x4ec11a){var _0x21e1f1={'raw':!![],'where':{'id':_0x5cd68e['params']['id']}},_0xd60245={};_0xd60245['model']=_[_0xde5c('0x33')](db[_0xde5c('0x2d')][_0xde5c('0x2e')]);_0xd60245[_0xde5c('0x32')]=_[_0xde5c('0x33')](_0x5cd68e[_0xde5c('0x32')]);_0xd60245[_0xde5c('0x34')]=_['intersection'](_0xd60245[_0xde5c('0x31')],_0xd60245[_0xde5c('0x32')]);_0x21e1f1[_0xde5c('0x37')]=_[_0xde5c('0x35')](_0xd60245[_0xde5c('0x31')],qs[_0xde5c('0x36')](_0x5cd68e[_0xde5c('0x32')][_0xde5c('0x36')]));_0x21e1f1['attributes']=_0x21e1f1[_0xde5c('0x37')][_0xde5c('0x46')]?_0x21e1f1[_0xde5c('0x37')]:_0xd60245[_0xde5c('0x31')];if(_0x5cd68e['query'][_0xde5c('0x41')]){_0x21e1f1[_0xde5c('0x47')]=[{'all':!![]}];}_0x21e1f1=_['merge']({},_0x21e1f1,_0x5cd68e[_0xde5c('0x3f')]);return db[_0xde5c('0x2d')][_0xde5c('0x48')](_0x21e1f1)[_0xde5c('0x21')](handleEntityNotFound(_0x4ec11a,null))[_0xde5c('0x21')](respondWithResult(_0x4ec11a,null))['catch'](handleError(_0x4ec11a,null));};exports[_0xde5c('0x49')]=function(_0x3c9ed3,_0x7613f){return db[_0xde5c('0x2d')][_0xde5c('0x49')](_0x3c9ed3[_0xde5c('0x4a')],{})[_0xde5c('0x21')](function(_0x284fd9){var _0x3950e0=_0x3c9ed3[_0xde5c('0x4b')][_0xde5c('0x23')]({'plain':!![]});if(!_0x3950e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3950e0[_0xde5c('0x4c')]===_0xde5c('0x4b')){var _0x562ff2=_0x284fd9[_0xde5c('0x23')]({'plain':!![]});var _0x40d16c=_0xde5c('0x24');return db[_0xde5c('0x4d')][_0xde5c('0x48')]({'where':{'name':_0x40d16c,'userProfileId':_0x3950e0[_0xde5c('0x4e')]},'raw':!![]})[_0xde5c('0x21')](function(_0x6d250f){if(_0x6d250f&&_0x6d250f[_0xde5c('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x562ff2[_0xde5c('0x29')],'resourceId':_0x562ff2['id'],'type':_0x6d250f[_0xde5c('0x29')],'sectionId':_0x6d250f['id']},{})[_0xde5c('0x21')](function(){return _0x284fd9;});}else{return _0x284fd9;}})[_0xde5c('0x44')](function(_0xc51373){logger[_0xde5c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc51373);throw _0xc51373;});}return _0x284fd9;})[_0xde5c('0x21')](respondWithResult(_0x7613f,0xc9))[_0xde5c('0x44')](handleError(_0x7613f,null));};exports[_0xde5c('0x20')]=function(_0x4b5709,_0x333fed){if(_0x4b5709[_0xde5c('0x4a')]['id']){delete _0x4b5709[_0xde5c('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0xde5c('0x48')]({'where':{'id':_0x4b5709[_0xde5c('0x50')]['id']}})[_0xde5c('0x21')](handleEntityNotFound(_0x333fed,null))[_0xde5c('0x21')](saveUpdates(_0x4b5709[_0xde5c('0x4a')],null))[_0xde5c('0x21')](respondWithResult(_0x333fed,null))[_0xde5c('0x44')](handleError(_0x333fed,null));};exports[_0xde5c('0x22')]=function(_0x2fb254,_0x59e451){return db[_0xde5c('0x2d')][_0xde5c('0x48')]({'where':{'id':_0x2fb254[_0xde5c('0x50')]['id']}})[_0xde5c('0x21')](handleEntityNotFound(_0x59e451,null))[_0xde5c('0x21')](removeEntity(_0x59e451,null))['catch'](handleError(_0x59e451,null));};exports[_0xde5c('0x51')]=function(_0x39434d,_0x55b3d4,_0x51bed1){return db['AnalyticExtractedReport'][_0xde5c('0x48')]({'where':{'id':_0x39434d['params']['id']},'attributes':['name',_0xde5c('0x52'),_0xde5c('0x53'),_0xde5c('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x55b3d4,null))[_0xde5c('0x21')](function(_0x423e0e){if(_0x423e0e){if(!fs[_0xde5c('0x55')](path[_0xde5c('0x56')](config['root'],'server/files/reports',_0x423e0e[_0xde5c('0x53')]))){throw new db[(_0xde5c('0x57'))][(_0xde5c('0x58'))](_0xde5c('0x59'));}if(_0x39434d['query'][_0xde5c('0x5a')]){return _0x55b3d4[_0xde5c('0x16')](0xc8);}return _0x55b3d4['download'](path['join'](config['root'],'server/files/reports',_0x423e0e[_0xde5c('0x53')]),util[_0xde5c('0x5b')](_0xde5c('0x5c'),_0x423e0e[_0xde5c('0x52')]||_0x423e0e[_0xde5c('0x29')],_0x423e0e[_0xde5c('0x54')][_0xde5c('0x5d')]()));}})[_0xde5c('0x44')](handleError(_0x55b3d4,null));}; \ No newline at end of file +var _0x058a=['json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','UserProfileSection','userProfileId','download','basename','existsSync','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','join','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x391554,_0x3ffa5a){var _0x314412=function(_0x3c326c){while(--_0x3c326c){_0x391554['push'](_0x391554['shift']());}};_0x314412(++_0x3ffa5a);}(_0x058a,0x1bf));var _0xa058=function(_0xe96de5,_0x5b2946){_0xe96de5=_0xe96de5-0x0;var _0x280055=_0x058a[_0xe96de5];return _0x280055;};'use strict';var emlformat=require(_0xa058('0x0'));var rimraf=require(_0xa058('0x1'));var zipdir=require(_0xa058('0x2'));var jsonpatch=require(_0xa058('0x3'));var rp=require(_0xa058('0x4'));var moment=require('moment');var BPromise=require(_0xa058('0x5'));var Mustache=require(_0xa058('0x6'));var util=require(_0xa058('0x7'));var path=require(_0xa058('0x8'));var sox=require(_0xa058('0x9'));var csv=require(_0xa058('0xa'));var ejs=require(_0xa058('0xb'));var fs=require('fs');var fs_extra=require(_0xa058('0xc'));var _=require(_0xa058('0xd'));var squel=require(_0xa058('0xe'));var crypto=require(_0xa058('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa058('0xa'));var querystring=require(_0xa058('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa058('0x11'));var qs=require(_0xa058('0x12'));var as=require(_0xa058('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa058('0x14'))(_0xa058('0x15'));var utils=require('../../config/utils');var config=require(_0xa058('0x16'));var licenseUtil=require(_0xa058('0x17'));var db=require(_0xa058('0x18'))['db'];function respondWithStatusCode(_0x2031bc,_0x736c75){_0x736c75=_0x736c75||0xcc;return function(_0x4c91c4){if(_0x4c91c4){return _0x2031bc[_0xa058('0x19')](_0x736c75);}return _0x2031bc[_0xa058('0x1a')](_0x736c75)[_0xa058('0x1b')]();};}function respondWithResult(_0x16338a,_0x1cd9f8){_0x1cd9f8=_0x1cd9f8||0xc8;return function(_0x2f8d9a){if(_0x2f8d9a){return _0x16338a[_0xa058('0x1a')](_0x1cd9f8)[_0xa058('0x1c')](_0x2f8d9a);}};}function respondWithFilteredResult(_0x154647,_0x377b63){return function(_0x59c576){if(_0x59c576){var _0x2abee6=typeof _0x377b63[_0xa058('0x1d')]===_0xa058('0x1e')&&typeof _0x377b63['limit']===_0xa058('0x1e');var _0x4e08e5=_0x59c576[_0xa058('0x1f')];var _0x21339b=_0x2abee6?0x0:_0x377b63[_0xa058('0x1d')];var _0x19d7e8=_0x2abee6?_0x59c576['count']:_0x377b63['offset']+_0x377b63[_0xa058('0x20')];var _0x59dc65;if(_0x19d7e8>=_0x4e08e5){_0x19d7e8=_0x4e08e5;_0x59dc65=0xc8;}else{_0x59dc65=0xce;}_0x154647[_0xa058('0x1a')](_0x59dc65);return _0x154647['set'](_0xa058('0x21'),_0x21339b+'-'+_0x19d7e8+'/'+_0x4e08e5)[_0xa058('0x1c')](_0x59c576);}return null;};}function patchUpdates(_0x5ef4ac){return function(_0x13711e){try{jsonpatch[_0xa058('0x22')](_0x13711e,_0x5ef4ac,!![]);}catch(_0x40b8ed){return BPromise[_0xa058('0x23')](_0x40b8ed);}return _0x13711e[_0xa058('0x24')]();};}function saveUpdates(_0x22c49a,_0x178e26){return function(_0x2f14c3){if(_0x2f14c3){return _0x2f14c3[_0xa058('0x25')](_0x22c49a)[_0xa058('0x26')](function(_0xa5279e){return _0xa5279e;});}return null;};}function removeEntity(_0x302a03,_0x38f39d){return function(_0x1a19fd){if(_0x1a19fd){return _0x1a19fd[_0xa058('0x27')]()['then'](function(){var _0x26d4d9=_0x1a19fd[_0xa058('0x28')]({'plain':!![]});var _0x4fcec1='ExtractedReports';return db[_0xa058('0x29')][_0xa058('0x27')]({'where':{'type':_0x4fcec1,'resourceId':_0x26d4d9['id']}})[_0xa058('0x26')](function(){return _0x1a19fd;});})['then'](function(){_0x302a03[_0xa058('0x1a')](0xcc)[_0xa058('0x1b')]();});}};}function handleEntityNotFound(_0x175640,_0x2288d8){return function(_0xc131d2){if(!_0xc131d2){_0x175640['sendStatus'](0x194);}return _0xc131d2;};}function handleError(_0x41b308,_0x377b36){_0x377b36=_0x377b36||0x1f4;return function(_0x2e4572){logger[_0xa058('0x2a')](_0x2e4572[_0xa058('0x2b')]);if(_0x2e4572[_0xa058('0x2c')]){delete _0x2e4572['name'];}_0x41b308[_0xa058('0x1a')](_0x377b36)[_0xa058('0x2d')](_0x2e4572);};}exports['index']=function(_0x4bf5af,_0x384d25){var _0x34d837={},_0x5ce8cc={},_0x28d4cf={'count':0x0,'rows':[]};var _0x5ab8c2=_[_0xa058('0x2e')](db['AnalyticExtractedReport'][_0xa058('0x2f')],function(_0x1660e8){return{'name':_0x1660e8[_0xa058('0x30')],'type':_0x1660e8[_0xa058('0x31')][_0xa058('0x32')]};});_0x5ce8cc[_0xa058('0x33')]=_['map'](_0x5ab8c2,'name');_0x5ce8cc[_0xa058('0x34')]=_[_0xa058('0x35')](_0x4bf5af[_0xa058('0x34')]);_0x5ce8cc[_0xa058('0x36')]=_[_0xa058('0x37')](_0x5ce8cc[_0xa058('0x33')],_0x5ce8cc[_0xa058('0x34')]);_0x34d837['attributes']=_[_0xa058('0x37')](_0x5ce8cc['model'],qs['fields'](_0x4bf5af['query'][_0xa058('0x38')]));_0x34d837[_0xa058('0x39')]=_0x34d837[_0xa058('0x39')][_0xa058('0x3a')]?_0x34d837[_0xa058('0x39')]:_0x5ce8cc[_0xa058('0x33')];if(!_0x4bf5af[_0xa058('0x34')]['hasOwnProperty'](_0xa058('0x3b'))){_0x34d837[_0xa058('0x20')]=qs['limit'](_0x4bf5af[_0xa058('0x34')][_0xa058('0x20')]);_0x34d837['offset']=qs[_0xa058('0x1d')](_0x4bf5af[_0xa058('0x34')][_0xa058('0x1d')]);}_0x34d837[_0xa058('0x3c')]=qs[_0xa058('0x3d')](_0x4bf5af[_0xa058('0x34')][_0xa058('0x3d')]);_0x34d837[_0xa058('0x3e')]=qs[_0xa058('0x36')](_[_0xa058('0x3f')](_0x4bf5af[_0xa058('0x34')],_0x5ce8cc['filters']),_0x5ab8c2);if(_0x4bf5af[_0xa058('0x34')]['filter']){_0x34d837[_0xa058('0x3e')]=_[_0xa058('0x40')](_0x34d837[_0xa058('0x3e')],{'$or':_[_0xa058('0x2e')](_0x5ab8c2,function(_0x2ab0d2){if(_0x2ab0d2['type']!==_0xa058('0x41')){var _0x2b9b79={};_0x2b9b79[_0x2ab0d2[_0xa058('0x2c')]]={'$like':'%'+_0x4bf5af['query'][_0xa058('0x42')]+'%'};return _0x2b9b79;}})});}_0x34d837=_['merge']({},_0x34d837,_0x4bf5af['options']);var _0x31ff62={'where':_0x34d837[_0xa058('0x3e')]};return db[_0xa058('0x43')]['count'](_0x31ff62)['then'](function(_0x392b96){_0x28d4cf[_0xa058('0x1f')]=_0x392b96;if(_0x4bf5af[_0xa058('0x34')][_0xa058('0x44')]){_0x34d837[_0xa058('0x45')]=[{'all':!![]}];}return db[_0xa058('0x43')][_0xa058('0x46')](_0x34d837);})[_0xa058('0x26')](function(_0x1e0a98){_0x28d4cf[_0xa058('0x47')]=_0x1e0a98;return _0x28d4cf;})[_0xa058('0x26')](respondWithFilteredResult(_0x384d25,_0x34d837))[_0xa058('0x48')](handleError(_0x384d25,null));};exports[_0xa058('0x49')]=function(_0x17f26e,_0x369845){var _0xf881e0={'raw':!![],'where':{'id':_0x17f26e[_0xa058('0x4a')]['id']}},_0x2ea8c4={};_0x2ea8c4[_0xa058('0x33')]=_[_0xa058('0x35')](db['AnalyticExtractedReport'][_0xa058('0x2f')]);_0x2ea8c4[_0xa058('0x34')]=_[_0xa058('0x35')](_0x17f26e[_0xa058('0x34')]);_0x2ea8c4[_0xa058('0x36')]=_[_0xa058('0x37')](_0x2ea8c4['model'],_0x2ea8c4[_0xa058('0x34')]);_0xf881e0[_0xa058('0x39')]=_[_0xa058('0x37')](_0x2ea8c4[_0xa058('0x33')],qs[_0xa058('0x38')](_0x17f26e['query']['fields']));_0xf881e0[_0xa058('0x39')]=_0xf881e0[_0xa058('0x39')][_0xa058('0x3a')]?_0xf881e0[_0xa058('0x39')]:_0x2ea8c4[_0xa058('0x33')];if(_0x17f26e['query'][_0xa058('0x44')]){_0xf881e0['include']=[{'all':!![]}];}_0xf881e0=_[_0xa058('0x40')]({},_0xf881e0,_0x17f26e[_0xa058('0x4b')]);return db['AnalyticExtractedReport'][_0xa058('0x4c')](_0xf881e0)[_0xa058('0x26')](handleEntityNotFound(_0x369845,null))['then'](respondWithResult(_0x369845,null))['catch'](handleError(_0x369845,null));};exports[_0xa058('0x4d')]=function(_0x1ca16b,_0x3f0cce){return db[_0xa058('0x43')][_0xa058('0x4d')](_0x1ca16b[_0xa058('0x4e')],{})[_0xa058('0x26')](function(_0x416e45){var _0x2b930e=_0x1ca16b[_0xa058('0x4f')]['get']({'plain':!![]});if(!_0x2b930e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b930e['role']===_0xa058('0x4f')){var _0x4d463b=_0x416e45[_0xa058('0x28')]({'plain':!![]});var _0x4b3975='ExtractedReports';return db[_0xa058('0x50')][_0xa058('0x4c')]({'where':{'name':_0x4b3975,'userProfileId':_0x2b930e[_0xa058('0x51')]},'raw':!![]})[_0xa058('0x26')](function(_0x4e5155){if(_0x4e5155&&_0x4e5155['autoAssociation']===0x0){return db[_0xa058('0x29')][_0xa058('0x4d')]({'name':_0x4d463b[_0xa058('0x2c')],'resourceId':_0x4d463b['id'],'type':_0x4e5155[_0xa058('0x2c')],'sectionId':_0x4e5155['id']},{})[_0xa058('0x26')](function(){return _0x416e45;});}else{return _0x416e45;}})[_0xa058('0x48')](function(_0x19b04c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19b04c);throw _0x19b04c;});}return _0x416e45;})['then'](respondWithResult(_0x3f0cce,0xc9))[_0xa058('0x48')](handleError(_0x3f0cce,null));};exports[_0xa058('0x25')]=function(_0x18dd60,_0x4cf98f){if(_0x18dd60[_0xa058('0x4e')]['id']){delete _0x18dd60[_0xa058('0x4e')]['id'];}return db[_0xa058('0x43')][_0xa058('0x4c')]({'where':{'id':_0x18dd60[_0xa058('0x4a')]['id']}})[_0xa058('0x26')](handleEntityNotFound(_0x4cf98f,null))['then'](saveUpdates(_0x18dd60[_0xa058('0x4e')],null))[_0xa058('0x26')](respondWithResult(_0x4cf98f,null))['catch'](handleError(_0x4cf98f,null));};exports[_0xa058('0x27')]=function(_0x27e1bc,_0x37f6d1){return db[_0xa058('0x43')][_0xa058('0x4c')]({'where':{'id':_0x27e1bc[_0xa058('0x4a')]['id']}})[_0xa058('0x26')](handleEntityNotFound(_0x37f6d1,null))[_0xa058('0x26')](removeEntity(_0x37f6d1,null))['catch'](handleError(_0x37f6d1,null));};exports[_0xa058('0x52')]=function(_0x24703b,_0x37c761,_0x105353){return db[_0xa058('0x43')][_0xa058('0x4c')]({'where':{'id':_0x24703b[_0xa058('0x4a')]['id']},'attributes':[_0xa058('0x2c'),_0xa058('0x53'),'savename','output'],'raw':!![]})[_0xa058('0x26')](handleEntityNotFound(_0x37c761,null))['then'](function(_0x547eeb){if(_0x547eeb){if(!fs[_0xa058('0x54')](path['join'](config[_0xa058('0x55')],_0xa058('0x56'),_0x547eeb[_0xa058('0x57')]))){throw new db[(_0xa058('0x58'))][(_0xa058('0x59'))](_0xa058('0x5a'));}if(_0x24703b[_0xa058('0x34')]['exists']){return _0x37c761[_0xa058('0x19')](0xc8);}return _0x37c761[_0xa058('0x52')](path[_0xa058('0x5b')](config[_0xa058('0x55')],_0xa058('0x56'),_0x547eeb[_0xa058('0x57')]),util['format'](_0xa058('0x5c'),_0x547eeb[_0xa058('0x53')]||_0x547eeb[_0xa058('0x2c')],_0x547eeb[_0xa058('0x5d')][_0xa058('0x5e')]()));}})[_0xa058('0x48')](handleError(_0x37c761,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 610c0a4..98748dd 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 _0x6592=['path','rimraf','exports','define','AnalyticExtractedReport','lodash','util','api','moment','bluebird'];(function(_0x4eac23,_0x5d41f8){var _0x38d8f6=function(_0x5e9e5f){while(--_0x5e9e5f){_0x4eac23['push'](_0x4eac23['shift']());}};_0x38d8f6(++_0x5d41f8);}(_0x6592,0x145));var _0x2659=function(_0x396a05,_0xc13516){_0x396a05=_0x396a05-0x0;var _0x5407a4=_0x6592[_0x396a05];return _0x5407a4;};'use strict';var _=require(_0x2659('0x0'));var util=require(_0x2659('0x1'));var logger=require('../../config/logger')(_0x2659('0x2'));var moment=require(_0x2659('0x3'));var BPromise=require(_0x2659('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2659('0x5'));var rimraf=require(_0x2659('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x2659('0x7')]=function(_0x407b31,_0x5d7b28){return _0x407b31[_0x2659('0x8')](_0x2659('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc12e=['util','../../config/logger','api','moment','bluebird','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x5459c1,_0x36f6f0){var _0x3f99b5=function(_0x512bea){while(--_0x512bea){_0x5459c1['push'](_0x5459c1['shift']());}};_0x3f99b5(++_0x36f6f0);}(_0xc12e,0x19e));var _0xec12=function(_0x47dde4,_0xc8fe9e){_0x47dde4=_0x47dde4-0x0;var _0x46bd3e=_0xc12e[_0x47dde4];return _0x46bd3e;};'use strict';var _=require('lodash');var util=require(_0xec12('0x0'));var logger=require(_0xec12('0x1'))(_0xec12('0x2'));var moment=require(_0xec12('0x3'));var BPromise=require(_0xec12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xec12('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0xec12('0x6')]=function(_0x4cb618,_0x2891c0){return _0x4cb618['define'](_0xec12('0x7'),attributes,{'tableName':_0xec12('0x8'),'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 a45ad45..ba3e95e 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 _0x6472=['../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','util','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x3638fa,_0x4bae8f){var _0xc818a7=function(_0x49fd1c){while(--_0x49fd1c){_0x3638fa['push'](_0x3638fa['shift']());}};_0xc818a7(++_0x4bae8f);}(_0x6472,0xcc));var _0x2647=function(_0xc9e185,_0x1ed7f5){_0xc9e185=_0xc9e185-0x0;var _0x4f1b0c=_0x6472[_0xc9e185];return _0x4f1b0c;};'use strict';var _=require('lodash');var util=require(_0x2647('0x0'));var moment=require(_0x2647('0x1'));var BPromise=require(_0x2647('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2647('0x3'));var logger=require(_0x2647('0x4'))('rpc');var config=require(_0x2647('0x5'));var jayson=require(_0x2647('0x6'));var client=jayson[_0x2647('0x7')][_0x2647('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x99b11e,_0xe41345,_0x1f7039){return new BPromise(function(_0x3d63e2,_0x4bda33){return client['request'](_0x99b11e,_0x1f7039)[_0x2647('0x9')](function(_0x4d416b){logger['info'](_0x2647('0xa'),_0xe41345,_0x2647('0xb'));logger[_0x2647('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xe41345,'request\x20sent',JSON[_0x2647('0xd')](_0x4d416b));if(_0x4d416b['error']){if(_0x4d416b[_0x2647('0xe')][_0x2647('0xf')]===0x1f4){logger['error'](_0x2647('0xa'),_0xe41345,_0x4d416b['error'][_0x2647('0x10')]);return _0x4bda33(_0x4d416b[_0x2647('0xe')]['message']);}logger[_0x2647('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xe41345,_0x4d416b['error']['message']);return _0x3d63e2(_0x4d416b['error'][_0x2647('0x10')]);}else{logger[_0x2647('0x11')](_0x2647('0xa'),_0xe41345,_0x2647('0xb'));_0x3d63e2(_0x4d416b[_0x2647('0x12')][_0x2647('0x10')]);}})['catch'](function(_0xb01465){logger[_0x2647('0xe')](_0x2647('0xa'),_0xe41345,_0xb01465);_0x4bda33(_0xb01465);});});} \ No newline at end of file +var _0x7d06=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7d06,0x158));var _0x67d0=function(_0x5edf1c,_0xc7c803){_0x5edf1c=_0x5edf1c-0x0;var _0x53e9a9=_0x7d06[_0x5edf1c];return _0x53e9a9;};'use strict';var _=require(_0x67d0('0x0'));var util=require(_0x67d0('0x1'));var moment=require(_0x67d0('0x2'));var BPromise=require(_0x67d0('0x3'));var rs=require(_0x67d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67d0('0x5'))['db'];var utils=require(_0x67d0('0x6'));var logger=require(_0x67d0('0x7'))('rpc');var config=require(_0x67d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67d0('0x9')][_0x67d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x367f1d,_0xe4789b,_0x3c9976){return new BPromise(function(_0x481a08,_0x358986){return client['request'](_0x367f1d,_0x3c9976)[_0x67d0('0xb')](function(_0x5916d0){logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));logger[_0x67d0('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xe4789b,_0x67d0('0xe'),JSON['stringify'](_0x5916d0));if(_0x5916d0['error']){if(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x11')]===0x1f4){logger['error'](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')]['message']);return _0x358986(_0x5916d0[_0x67d0('0x10')]['message']);}logger[_0x67d0('0x10')](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);return _0x481a08(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);}else{logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));_0x481a08(_0x5916d0[_0x67d0('0x13')]['message']);}})[_0x67d0('0x14')](function(_0xa1b889){logger['error'](_0x67d0('0xd'),_0xe4789b,_0xa1b889);_0x358986(_0xa1b889);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index d3c8a5d..ceda643 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 _0x2e7f=['put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','show','/:id/download','download','post','create'];(function(_0x2495c2,_0x204a77){var _0x500c73=function(_0x32813e){while(--_0x32813e){_0x2495c2['push'](_0x2495c2['shift']());}};_0x500c73(++_0x204a77);}(_0x2e7f,0xb8));var _0xf2e7=function(_0x715c02,_0x4584db){_0x715c02=_0x715c02-0x0;var _0x48d06e=_0x2e7f[_0x715c02];return _0x48d06e;};'use strict';var multer=require(_0xf2e7('0x0'));var util=require(_0xf2e7('0x1'));var path=require('path');var timeout=require(_0xf2e7('0x2'));var express=require(_0xf2e7('0x3'));var router=express[_0xf2e7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf2e7('0x5'));var config=require(_0xf2e7('0x6'));var controller=require(_0xf2e7('0x7'));router[_0xf2e7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf2e7('0x8')](_0xf2e7('0x9'),auth[_0xf2e7('0xa')](),controller[_0xf2e7('0xb')]);router[_0xf2e7('0x8')](_0xf2e7('0xc'),auth[_0xf2e7('0xa')](),controller[_0xf2e7('0xd')]);router[_0xf2e7('0xe')]('/',auth[_0xf2e7('0xa')](),controller[_0xf2e7('0xf')]);router[_0xf2e7('0x10')](_0xf2e7('0x9'),auth['isAuthenticated'](),controller[_0xf2e7('0x11')]);router[_0xf2e7('0x12')](_0xf2e7('0x9'),auth[_0xf2e7('0xa')](),controller['destroy']);module[_0xf2e7('0x13')]=router; \ No newline at end of file +var _0xd968=['/:id','show','download','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x12d013,_0x27a541){var _0x627ee=function(_0x548d51){while(--_0x548d51){_0x12d013['push'](_0x12d013['shift']());}};_0x627ee(++_0x27a541);}(_0xd968,0xd3));var _0x8d96=function(_0x4fa6c3,_0x331ef8){_0x4fa6c3=_0x4fa6c3-0x0;var _0x5bdac0=_0xd968[_0x4fa6c3];return _0x5bdac0;};'use strict';var multer=require(_0x8d96('0x0'));var util=require(_0x8d96('0x1'));var path=require(_0x8d96('0x2'));var timeout=require('connect-timeout');var express=require(_0x8d96('0x3'));var router=express[_0x8d96('0x4')]();var fs_extra=require(_0x8d96('0x5'));var auth=require(_0x8d96('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8d96('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x8d96('0x8')]('/',auth[_0x8d96('0x9')](),controller['index']);router[_0x8d96('0x8')](_0x8d96('0xa'),auth[_0x8d96('0x9')](),controller[_0x8d96('0xb')]);router[_0x8d96('0x8')]('/:id/download',auth[_0x8d96('0x9')](),controller[_0x8d96('0xc')]);router['post']('/',auth[_0x8d96('0x9')](),controller['create']);router[_0x8d96('0xd')](_0x8d96('0xa'),auth['isAuthenticated'](),controller[_0x8d96('0xe')]);router[_0x8d96('0xf')](_0x8d96('0xa'),auth[_0x8d96('0x9')](),controller['destroy']);module[_0x8d96('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 6cabbaa..80c62d4 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 _0xdf63=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x4e1f20,_0x144d8d){var _0x45b9ec=function(_0xf5a9a1){while(--_0xf5a9a1){_0x4e1f20['push'](_0x4e1f20['shift']());}};_0x45b9ec(++_0x144d8d);}(_0xdf63,0x111));var _0x3df6=function(_0x44745f,_0x432d7e){_0x44745f=_0x44745f-0x0;var _0xac7f24=_0xdf63[_0x44745f];return _0xac7f24;};'use strict';var Sequelize=require(_0x3df6('0x0'));module[_0x3df6('0x1')]={'field':{'type':Sequelize[_0x3df6('0x2')]},'alias':{'type':Sequelize[_0x3df6('0x3')]},'function':{'type':Sequelize[_0x3df6('0x3')]},'format':{'type':Sequelize[_0x3df6('0x3')]},'groupBy':{'type':Sequelize[_0x3df6('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x3df6('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x17c9=['STRING','BOOLEAN','exports','TEXT'];(function(_0x3b2c6f,_0xa9f35c){var _0x22e219=function(_0x3ee04c){while(--_0x3ee04c){_0x3b2c6f['push'](_0x3b2c6f['shift']());}};_0x22e219(++_0xa9f35c);}(_0x17c9,0x11a));var _0x917c=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x17c9[_0x2dadb9];return _0x2f0097;};'use strict';var Sequelize=require('sequelize');module[_0x917c('0x0')]={'field':{'type':Sequelize[_0x917c('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x917c('0x2')]},'format':{'type':Sequelize[_0x917c('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x917c('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 38aff9d..18fce4b 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 _0x7b54=['pick','merge','VIRTUAL','filter','options','includeAll','include','catch','params','AnalyticFieldReport','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x30af1c,_0x2b4ceb){var _0x198d78=function(_0x236ba3){while(--_0x236ba3){_0x30af1c['push'](_0x30af1c['shift']());}};_0x198d78(++_0x2b4ceb);}(_0x7b54,0xb7));var _0x47b5=function(_0x4d6554,_0x24a2bf){_0x4d6554=_0x4d6554-0x0;var _0xd9f05b=_0x7b54[_0x4d6554];return _0xd9f05b;};'use strict';var emlformat=require(_0x47b5('0x0'));var rimraf=require(_0x47b5('0x1'));var zipdir=require(_0x47b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47b5('0x3'));var moment=require('moment');var BPromise=require(_0x47b5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x47b5('0x5'));var sox=require(_0x47b5('0x6'));var csv=require(_0x47b5('0x7'));var ejs=require(_0x47b5('0x8'));var fs=require('fs');var fs_extra=require(_0x47b5('0x9'));var _=require(_0x47b5('0xa'));var squel=require(_0x47b5('0xb'));var crypto=require(_0x47b5('0xc'));var jsforce=require(_0x47b5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x47b5('0x7'));var querystring=require(_0x47b5('0xe'));var Papa=require(_0x47b5('0xf'));var Redis=require('ioredis');var authService=require(_0x47b5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47b5('0x11'));var logger=require(_0x47b5('0x12'))(_0x47b5('0x13'));var utils=require('../../config/utils');var config=require(_0x47b5('0x14'));var licenseUtil=require(_0x47b5('0x15'));var db=require(_0x47b5('0x16'))['db'];function respondWithStatusCode(_0x3b9a91,_0x597350){_0x597350=_0x597350||0xcc;return function(_0xa2c841){if(_0xa2c841){return _0x3b9a91['sendStatus'](_0x597350);}return _0x3b9a91['status'](_0x597350)['end']();};}function respondWithResult(_0x1db247,_0x21282b){_0x21282b=_0x21282b||0xc8;return function(_0x56a310){if(_0x56a310){return _0x1db247[_0x47b5('0x17')](_0x21282b)[_0x47b5('0x18')](_0x56a310);}};}function respondWithFilteredResult(_0x1d36e7,_0x458809){return function(_0x200929){if(_0x200929){var _0x4cc878=typeof _0x458809[_0x47b5('0x19')]===_0x47b5('0x1a')&&typeof _0x458809[_0x47b5('0x1b')]===_0x47b5('0x1a');var _0x413708=_0x200929[_0x47b5('0x1c')];var _0x352ac8=_0x4cc878?0x0:_0x458809['offset'];var _0x5ef7a8=_0x4cc878?_0x200929[_0x47b5('0x1c')]:_0x458809[_0x47b5('0x19')]+_0x458809[_0x47b5('0x1b')];var _0x4f8b7f;if(_0x5ef7a8>=_0x413708){_0x5ef7a8=_0x413708;_0x4f8b7f=0xc8;}else{_0x4f8b7f=0xce;}_0x1d36e7[_0x47b5('0x17')](_0x4f8b7f);return _0x1d36e7[_0x47b5('0x1d')](_0x47b5('0x1e'),_0x352ac8+'-'+_0x5ef7a8+'/'+_0x413708)[_0x47b5('0x18')](_0x200929);}return null;};}function patchUpdates(_0x5b6dcc){return function(_0x46e864){try{jsonpatch[_0x47b5('0x1f')](_0x46e864,_0x5b6dcc,!![]);}catch(_0x6644ec){return BPromise[_0x47b5('0x20')](_0x6644ec);}return _0x46e864['save']();};}function saveUpdates(_0x37234d,_0x43a548){return function(_0xb477e9){if(_0xb477e9){return _0xb477e9[_0x47b5('0x21')](_0x37234d)['then'](function(_0x2c0a5b){return _0x2c0a5b;});}return null;};}function removeEntity(_0x25f015,_0x40c399){return function(_0x41a120){if(_0x41a120){return _0x41a120[_0x47b5('0x22')]()[_0x47b5('0x23')](function(){_0x25f015[_0x47b5('0x17')](0xcc)[_0x47b5('0x24')]();});}};}function handleEntityNotFound(_0x219e72,_0xee6dc5){return function(_0x4accd9){if(!_0x4accd9){_0x219e72['sendStatus'](0x194);}return _0x4accd9;};}function handleError(_0x1a86d5,_0x29cdfb){_0x29cdfb=_0x29cdfb||0x1f4;return function(_0x29be32){logger[_0x47b5('0x25')](_0x29be32[_0x47b5('0x26')]);if(_0x29be32['name']){delete _0x29be32[_0x47b5('0x27')];}_0x1a86d5['status'](_0x29cdfb)['send'](_0x29be32);};}exports[_0x47b5('0x28')]=function(_0x194b2d,_0x4481f0){var _0x19ecdd={},_0x55ea81={},_0x50815e={'count':0x0,'rows':[]};var _0x4fa5a2=_[_0x47b5('0x29')](db['AnalyticFieldReport'][_0x47b5('0x2a')],function(_0x50e225){return{'name':_0x50e225[_0x47b5('0x2b')],'type':_0x50e225[_0x47b5('0x2c')]['key']};});_0x55ea81[_0x47b5('0x2d')]=_[_0x47b5('0x29')](_0x4fa5a2,_0x47b5('0x27'));_0x55ea81[_0x47b5('0x2e')]=_[_0x47b5('0x2f')](_0x194b2d[_0x47b5('0x2e')]);_0x55ea81[_0x47b5('0x30')]=_[_0x47b5('0x31')](_0x55ea81[_0x47b5('0x2d')],_0x55ea81[_0x47b5('0x2e')]);_0x19ecdd['attributes']=_[_0x47b5('0x31')](_0x55ea81[_0x47b5('0x2d')],qs[_0x47b5('0x32')](_0x194b2d[_0x47b5('0x2e')][_0x47b5('0x32')]));_0x19ecdd[_0x47b5('0x33')]=_0x19ecdd['attributes'][_0x47b5('0x34')]?_0x19ecdd[_0x47b5('0x33')]:_0x55ea81[_0x47b5('0x2d')];if(!_0x194b2d['query'][_0x47b5('0x35')]('nolimit')){_0x19ecdd[_0x47b5('0x1b')]=qs[_0x47b5('0x1b')](_0x194b2d[_0x47b5('0x2e')]['limit']);_0x19ecdd[_0x47b5('0x19')]=qs['offset'](_0x194b2d['query'][_0x47b5('0x19')]);}_0x19ecdd[_0x47b5('0x36')]=qs[_0x47b5('0x37')](_0x194b2d[_0x47b5('0x2e')][_0x47b5('0x37')]);_0x19ecdd[_0x47b5('0x38')]=qs['filters'](_[_0x47b5('0x39')](_0x194b2d[_0x47b5('0x2e')],_0x55ea81[_0x47b5('0x30')]),_0x4fa5a2);if(_0x194b2d[_0x47b5('0x2e')]['filter']){_0x19ecdd['where']=_[_0x47b5('0x3a')](_0x19ecdd[_0x47b5('0x38')],{'$or':_[_0x47b5('0x29')](_0x4fa5a2,function(_0x32af95){if(_0x32af95[_0x47b5('0x2c')]!==_0x47b5('0x3b')){var _0xa8a661={};_0xa8a661[_0x32af95[_0x47b5('0x27')]]={'$like':'%'+_0x194b2d[_0x47b5('0x2e')][_0x47b5('0x3c')]+'%'};return _0xa8a661;}})});}_0x19ecdd=_[_0x47b5('0x3a')]({},_0x19ecdd,_0x194b2d[_0x47b5('0x3d')]);var _0xf8fbcc={'where':_0x19ecdd['where']};return db['AnalyticFieldReport'][_0x47b5('0x1c')](_0xf8fbcc)['then'](function(_0x21b10b){_0x50815e[_0x47b5('0x1c')]=_0x21b10b;if(_0x194b2d['query'][_0x47b5('0x3e')]){_0x19ecdd[_0x47b5('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x19ecdd);})[_0x47b5('0x23')](function(_0x2e50f1){_0x50815e['rows']=_0x2e50f1;return _0x50815e;})[_0x47b5('0x23')](respondWithFilteredResult(_0x4481f0,_0x19ecdd))[_0x47b5('0x40')](handleError(_0x4481f0,null));};exports['show']=function(_0x501ec1,_0x38ba26){var _0x43096d={'raw':![],'where':{'id':_0x501ec1[_0x47b5('0x41')]['id']}},_0x7ad62e={};_0x7ad62e[_0x47b5('0x2d')]=_[_0x47b5('0x2f')](db[_0x47b5('0x42')]['rawAttributes']);_0x7ad62e[_0x47b5('0x2e')]=_[_0x47b5('0x2f')](_0x501ec1[_0x47b5('0x2e')]);_0x7ad62e['filters']=_['intersection'](_0x7ad62e[_0x47b5('0x2d')],_0x7ad62e['query']);_0x43096d[_0x47b5('0x33')]=_[_0x47b5('0x31')](_0x7ad62e[_0x47b5('0x2d')],qs['fields'](_0x501ec1['query'][_0x47b5('0x32')]));_0x43096d[_0x47b5('0x33')]=_0x43096d['attributes']['length']?_0x43096d['attributes']:_0x7ad62e[_0x47b5('0x2d')];if(_0x501ec1[_0x47b5('0x2e')][_0x47b5('0x3e')]){_0x43096d[_0x47b5('0x3f')]=[{'all':!![]}];}_0x43096d=_[_0x47b5('0x3a')]({},_0x43096d,_0x501ec1['options']);return db[_0x47b5('0x42')][_0x47b5('0x43')](_0x43096d)[_0x47b5('0x23')](handleEntityNotFound(_0x38ba26,null))[_0x47b5('0x23')](respondWithResult(_0x38ba26,null))[_0x47b5('0x40')](handleError(_0x38ba26,null));};exports[_0x47b5('0x44')]=function(_0x245a7f,_0x180278){return db['AnalyticFieldReport'][_0x47b5('0x44')](_0x245a7f[_0x47b5('0x45')],{})['then'](respondWithResult(_0x180278,0xc9))[_0x47b5('0x40')](handleError(_0x180278,null));};exports[_0x47b5('0x46')]=function(_0x11626a,_0x21437a){return db[_0x47b5('0x42')][_0x47b5('0x46')](_0x11626a[_0x47b5('0x45')],{'raw':![],'individualHooks':!![]})[_0x47b5('0x23')](respondWithResult(_0x21437a,0xc9))['catch'](handleError(_0x21437a,null));};exports[_0x47b5('0x21')]=function(_0x1782bb,_0x37a7ec){if(_0x1782bb[_0x47b5('0x45')]['id']){delete _0x1782bb[_0x47b5('0x45')]['id'];}return db[_0x47b5('0x42')][_0x47b5('0x43')]({'where':{'id':_0x1782bb[_0x47b5('0x41')]['id']}})[_0x47b5('0x23')](handleEntityNotFound(_0x37a7ec,null))[_0x47b5('0x23')](saveUpdates(_0x1782bb[_0x47b5('0x45')],null))[_0x47b5('0x23')](respondWithResult(_0x37a7ec,null))[_0x47b5('0x40')](handleError(_0x37a7ec,null));};exports[_0x47b5('0x22')]=function(_0x591f85,_0x279190){return db[_0x47b5('0x42')][_0x47b5('0x43')]({'where':{'id':_0x591f85[_0x47b5('0x41')]['id']}})[_0x47b5('0x23')](handleEntityNotFound(_0x279190,null))['then'](removeEntity(_0x279190,null))['catch'](handleError(_0x279190,null));};exports[_0x47b5('0x47')]=function(_0x535473,_0xca5451){return db[_0x47b5('0x42')][_0x47b5('0x22')]({'where':{'id':_0x535473[_0x47b5('0x2e')][_0x47b5('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x47b5('0x23')](respondWithResult(_0xca5451,0xcc))[_0x47b5('0x40')](handleError(_0xca5451,null));};exports[_0x47b5('0x49')]=function(_0xf0555f,_0x3af59f,_0x1102fc){return db[_0x47b5('0x4a')][_0x47b5('0x4b')]({'where':{'id':_0xf0555f[_0x47b5('0x41')]['id']}})['then'](handleEntityNotFound(_0x3af59f,null))['then'](function(_0x9b7f80){if(_0x9b7f80){return db[_0x47b5('0x4c')][_0x47b5('0x4d')](function(_0x5cae10){return db[_0x47b5('0x42')][_0x47b5('0x22')]({'where':{'CustomReportId':_0xf0555f[_0x47b5('0x41')]['id']},'transaction':_0x5cae10})[_0x47b5('0x23')](function(_0x5a76d0){var _0x4ba5e3=_['map'](_0xf0555f[_0x47b5('0x45')],function(_0x2cf57d){delete _0x2cf57d['id'];_0x2cf57d[_0x47b5('0x4e')]=_0xf0555f[_0x47b5('0x41')]['id'];return _0x2cf57d;});return db['AnalyticFieldReport']['bulkCreate'](_0x4ba5e3,{'transaction':_0x5cae10});});})[_0x47b5('0x23')](function(){return db['AnalyticFieldReport'][_0x47b5('0x4f')]({'where':{'CustomReportId':_0xf0555f[_0x47b5('0x41')]['id']}});});}})[_0x47b5('0x23')](respondWithResult(_0x3af59f,null))['catch'](handleError(_0x3af59f,null));}; \ No newline at end of file +var _0x7a7c=['name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','AnalyticFieldReport','findAll','rows','catch','show','find','create','body','bulkCreate','params','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x5342b3,_0x472de0){var _0x153f4e=function(_0x1df249){while(--_0x1df249){_0x5342b3['push'](_0x5342b3['shift']());}};_0x153f4e(++_0x472de0);}(_0x7a7c,0xc9));var _0xc7a7=function(_0x52934a,_0x52e134){_0x52934a=_0x52934a-0x0;var _0x24feb8=_0x7a7c[_0x52934a];return _0x24feb8;};'use strict';var emlformat=require(_0xc7a7('0x0'));var rimraf=require(_0xc7a7('0x1'));var zipdir=require(_0xc7a7('0x2'));var jsonpatch=require(_0xc7a7('0x3'));var rp=require(_0xc7a7('0x4'));var moment=require(_0xc7a7('0x5'));var BPromise=require(_0xc7a7('0x6'));var Mustache=require(_0xc7a7('0x7'));var util=require('util');var path=require(_0xc7a7('0x8'));var sox=require(_0xc7a7('0x9'));var csv=require(_0xc7a7('0xa'));var ejs=require(_0xc7a7('0xb'));var fs=require('fs');var fs_extra=require(_0xc7a7('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc7a7('0xd'));var jsforce=require(_0xc7a7('0xe'));var deskjs=require(_0xc7a7('0xf'));var toCsv=require(_0xc7a7('0xa'));var querystring=require(_0xc7a7('0x10'));var Papa=require('papaparse');var Redis=require(_0xc7a7('0x11'));var authService=require(_0xc7a7('0x12'));var qs=require(_0xc7a7('0x13'));var as=require(_0xc7a7('0x14'));var hardwareService=require(_0xc7a7('0x15'));var logger=require('../../config/logger')(_0xc7a7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc7a7('0x17'));var db=require(_0xc7a7('0x18'))['db'];function respondWithStatusCode(_0x122d10,_0x59347a){_0x59347a=_0x59347a||0xcc;return function(_0x5d7093){if(_0x5d7093){return _0x122d10['sendStatus'](_0x59347a);}return _0x122d10[_0xc7a7('0x19')](_0x59347a)[_0xc7a7('0x1a')]();};}function respondWithResult(_0x138531,_0x5ce12a){_0x5ce12a=_0x5ce12a||0xc8;return function(_0x2cfc49){if(_0x2cfc49){return _0x138531[_0xc7a7('0x19')](_0x5ce12a)['json'](_0x2cfc49);}};}function respondWithFilteredResult(_0x3ba7eb,_0x15c5ba){return function(_0x3cfdfb){if(_0x3cfdfb){var _0x177ce2=typeof _0x15c5ba['offset']===_0xc7a7('0x1b')&&typeof _0x15c5ba[_0xc7a7('0x1c')]==='undefined';var _0x5f47e1=_0x3cfdfb[_0xc7a7('0x1d')];var _0x1316f5=_0x177ce2?0x0:_0x15c5ba['offset'];var _0x258302=_0x177ce2?_0x3cfdfb[_0xc7a7('0x1d')]:_0x15c5ba[_0xc7a7('0x1e')]+_0x15c5ba[_0xc7a7('0x1c')];var _0x419b52;if(_0x258302>=_0x5f47e1){_0x258302=_0x5f47e1;_0x419b52=0xc8;}else{_0x419b52=0xce;}_0x3ba7eb['status'](_0x419b52);return _0x3ba7eb[_0xc7a7('0x1f')]('Content-Range',_0x1316f5+'-'+_0x258302+'/'+_0x5f47e1)[_0xc7a7('0x20')](_0x3cfdfb);}return null;};}function patchUpdates(_0x14f794){return function(_0x30864a){try{jsonpatch[_0xc7a7('0x21')](_0x30864a,_0x14f794,!![]);}catch(_0x4c03b7){return BPromise[_0xc7a7('0x22')](_0x4c03b7);}return _0x30864a[_0xc7a7('0x23')]();};}function saveUpdates(_0x2590eb,_0x11e5f8){return function(_0x2d4ada){if(_0x2d4ada){return _0x2d4ada[_0xc7a7('0x24')](_0x2590eb)[_0xc7a7('0x25')](function(_0x4955f7){return _0x4955f7;});}return null;};}function removeEntity(_0x1efbc5,_0x3041ef){return function(_0x878010){if(_0x878010){return _0x878010[_0xc7a7('0x26')]()[_0xc7a7('0x25')](function(){_0x1efbc5[_0xc7a7('0x19')](0xcc)[_0xc7a7('0x1a')]();});}};}function handleEntityNotFound(_0x16710c,_0xc5bc45){return function(_0x575583){if(!_0x575583){_0x16710c[_0xc7a7('0x27')](0x194);}return _0x575583;};}function handleError(_0x4609a1,_0x41127c){_0x41127c=_0x41127c||0x1f4;return function(_0x3234ab){logger[_0xc7a7('0x28')](_0x3234ab[_0xc7a7('0x29')]);if(_0x3234ab[_0xc7a7('0x2a')]){delete _0x3234ab[_0xc7a7('0x2a')];}_0x4609a1[_0xc7a7('0x19')](_0x41127c)['send'](_0x3234ab);};}exports[_0xc7a7('0x2b')]=function(_0x7dc99f,_0x3be3e0){var _0x26e230={},_0x1cf8d7={},_0x3a7751={'count':0x0,'rows':[]};var _0x4d716a=_[_0xc7a7('0x2c')](db['AnalyticFieldReport'][_0xc7a7('0x2d')],function(_0x25c745){return{'name':_0x25c745['fieldName'],'type':_0x25c745[_0xc7a7('0x2e')][_0xc7a7('0x2f')]};});_0x1cf8d7[_0xc7a7('0x30')]=_[_0xc7a7('0x2c')](_0x4d716a,_0xc7a7('0x2a'));_0x1cf8d7[_0xc7a7('0x31')]=_[_0xc7a7('0x32')](_0x7dc99f[_0xc7a7('0x31')]);_0x1cf8d7[_0xc7a7('0x33')]=_['intersection'](_0x1cf8d7[_0xc7a7('0x30')],_0x1cf8d7['query']);_0x26e230['attributes']=_[_0xc7a7('0x34')](_0x1cf8d7[_0xc7a7('0x30')],qs[_0xc7a7('0x35')](_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x35')]));_0x26e230[_0xc7a7('0x36')]=_0x26e230['attributes'][_0xc7a7('0x37')]?_0x26e230[_0xc7a7('0x36')]:_0x1cf8d7[_0xc7a7('0x30')];if(!_0x7dc99f[_0xc7a7('0x31')]['hasOwnProperty'](_0xc7a7('0x38'))){_0x26e230['limit']=qs[_0xc7a7('0x1c')](_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x1c')]);_0x26e230[_0xc7a7('0x1e')]=qs['offset'](_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x1e')]);}_0x26e230[_0xc7a7('0x39')]=qs[_0xc7a7('0x3a')](_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x3a')]);_0x26e230['where']=qs[_0xc7a7('0x33')](_['pick'](_0x7dc99f[_0xc7a7('0x31')],_0x1cf8d7[_0xc7a7('0x33')]),_0x4d716a);if(_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x3b')]){_0x26e230[_0xc7a7('0x3c')]=_[_0xc7a7('0x3d')](_0x26e230[_0xc7a7('0x3c')],{'$or':_[_0xc7a7('0x2c')](_0x4d716a,function(_0x26bb61){if(_0x26bb61['type']!==_0xc7a7('0x3e')){var _0x21b396={};_0x21b396[_0x26bb61[_0xc7a7('0x2a')]]={'$like':'%'+_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x3b')]+'%'};return _0x21b396;}})});}_0x26e230=_[_0xc7a7('0x3d')]({},_0x26e230,_0x7dc99f[_0xc7a7('0x3f')]);var _0x2f7ed7={'where':_0x26e230[_0xc7a7('0x3c')]};return db['AnalyticFieldReport']['count'](_0x2f7ed7)[_0xc7a7('0x25')](function(_0x2a90a9){_0x3a7751[_0xc7a7('0x1d')]=_0x2a90a9;if(_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x40')]){_0x26e230[_0xc7a7('0x41')]=[{'all':!![]}];}return db[_0xc7a7('0x42')][_0xc7a7('0x43')](_0x26e230);})[_0xc7a7('0x25')](function(_0x42f576){_0x3a7751[_0xc7a7('0x44')]=_0x42f576;return _0x3a7751;})['then'](respondWithFilteredResult(_0x3be3e0,_0x26e230))[_0xc7a7('0x45')](handleError(_0x3be3e0,null));};exports[_0xc7a7('0x46')]=function(_0x16d6f6,_0x75e01d){var _0xac3e26={'raw':![],'where':{'id':_0x16d6f6['params']['id']}},_0x3dd955={};_0x3dd955['model']=_[_0xc7a7('0x32')](db[_0xc7a7('0x42')][_0xc7a7('0x2d')]);_0x3dd955[_0xc7a7('0x31')]=_[_0xc7a7('0x32')](_0x16d6f6[_0xc7a7('0x31')]);_0x3dd955[_0xc7a7('0x33')]=_[_0xc7a7('0x34')](_0x3dd955['model'],_0x3dd955[_0xc7a7('0x31')]);_0xac3e26['attributes']=_['intersection'](_0x3dd955[_0xc7a7('0x30')],qs[_0xc7a7('0x35')](_0x16d6f6['query']['fields']));_0xac3e26[_0xc7a7('0x36')]=_0xac3e26['attributes'][_0xc7a7('0x37')]?_0xac3e26[_0xc7a7('0x36')]:_0x3dd955[_0xc7a7('0x30')];if(_0x16d6f6[_0xc7a7('0x31')]['includeAll']){_0xac3e26[_0xc7a7('0x41')]=[{'all':!![]}];}_0xac3e26=_[_0xc7a7('0x3d')]({},_0xac3e26,_0x16d6f6[_0xc7a7('0x3f')]);return db[_0xc7a7('0x42')][_0xc7a7('0x47')](_0xac3e26)[_0xc7a7('0x25')](handleEntityNotFound(_0x75e01d,null))['then'](respondWithResult(_0x75e01d,null))[_0xc7a7('0x45')](handleError(_0x75e01d,null));};exports[_0xc7a7('0x48')]=function(_0x392e7a,_0x41d1fa){return db[_0xc7a7('0x42')][_0xc7a7('0x48')](_0x392e7a[_0xc7a7('0x49')],{})[_0xc7a7('0x25')](respondWithResult(_0x41d1fa,0xc9))['catch'](handleError(_0x41d1fa,null));};exports[_0xc7a7('0x4a')]=function(_0x23f6c3,_0x1b53e9){return db[_0xc7a7('0x42')][_0xc7a7('0x4a')](_0x23f6c3[_0xc7a7('0x49')],{'raw':![],'individualHooks':!![]})[_0xc7a7('0x25')](respondWithResult(_0x1b53e9,0xc9))[_0xc7a7('0x45')](handleError(_0x1b53e9,null));};exports['update']=function(_0xc6c678,_0xc02ed5){if(_0xc6c678['body']['id']){delete _0xc6c678['body']['id'];}return db['AnalyticFieldReport'][_0xc7a7('0x47')]({'where':{'id':_0xc6c678[_0xc7a7('0x4b')]['id']}})[_0xc7a7('0x25')](handleEntityNotFound(_0xc02ed5,null))[_0xc7a7('0x25')](saveUpdates(_0xc6c678[_0xc7a7('0x49')],null))[_0xc7a7('0x25')](respondWithResult(_0xc02ed5,null))[_0xc7a7('0x45')](handleError(_0xc02ed5,null));};exports[_0xc7a7('0x26')]=function(_0x5322b0,_0x4800b7){return db[_0xc7a7('0x42')]['find']({'where':{'id':_0x5322b0[_0xc7a7('0x4b')]['id']}})[_0xc7a7('0x25')](handleEntityNotFound(_0x4800b7,null))[_0xc7a7('0x25')](removeEntity(_0x4800b7,null))[_0xc7a7('0x45')](handleError(_0x4800b7,null));};exports[_0xc7a7('0x4c')]=function(_0xa63ca,_0xb655cd){return db[_0xc7a7('0x42')][_0xc7a7('0x26')]({'where':{'id':_0xa63ca[_0xc7a7('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xc7a7('0x25')](respondWithResult(_0xb655cd,0xcc))[_0xc7a7('0x45')](handleError(_0xb655cd,null));};exports[_0xc7a7('0x4d')]=function(_0xce113a,_0x2190d1,_0x379a92){return db[_0xc7a7('0x4e')]['findOne']({'where':{'id':_0xce113a[_0xc7a7('0x4b')]['id']}})[_0xc7a7('0x25')](handleEntityNotFound(_0x2190d1,null))['then'](function(_0x578093){if(_0x578093){return db[_0xc7a7('0x4f')][_0xc7a7('0x50')](function(_0x5c8111){return db[_0xc7a7('0x42')][_0xc7a7('0x26')]({'where':{'CustomReportId':_0xce113a[_0xc7a7('0x4b')]['id']},'transaction':_0x5c8111})['then'](function(_0x14e4fb){var _0x3e3ef8=_['map'](_0xce113a[_0xc7a7('0x49')],function(_0x172f6e){delete _0x172f6e['id'];_0x172f6e['CustomReportId']=_0xce113a[_0xc7a7('0x4b')]['id'];return _0x172f6e;});return db[_0xc7a7('0x42')][_0xc7a7('0x4a')](_0x3e3ef8,{'transaction':_0x5c8111});});})[_0xc7a7('0x25')](function(){return db['AnalyticFieldReport'][_0xc7a7('0x43')]({'where':{'CustomReportId':_0xce113a['params']['id']}});});}})[_0xc7a7('0x25')](respondWithResult(_0x2190d1,null))[_0xc7a7('0x45')](handleError(_0x2190d1,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index d4f01fc..3fbd456 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 _0x1eb6=['AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0x1eb6,0x1d6));var _0x61eb=function(_0x166faf,_0x544897){_0x166faf=_0x166faf-0x0;var _0xaf11fe=_0x1eb6[_0x166faf];return _0xaf11fe;};'use strict';var _=require('lodash');var util=require(_0x61eb('0x0'));var logger=require(_0x61eb('0x1'))(_0x61eb('0x2'));var moment=require(_0x61eb('0x3'));var BPromise=require(_0x61eb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61eb('0x5'));var rimraf=require(_0x61eb('0x6'));var config=require(_0x61eb('0x7'));var attributes=require(_0x61eb('0x8'));module[_0x61eb('0x9')]=function(_0x82e418,_0x3fb52d){return _0x82e418[_0x61eb('0xa')](_0x61eb('0xb'),attributes,{'tableName':_0x61eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfae0=['exports','define','AnalyticFieldReport','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xfae0,0xb7));var _0x0fae=function(_0x5b142f,_0x10815a){_0x5b142f=_0x5b142f-0x0;var _0x327bbd=_0xfae0[_0x5b142f];return _0x327bbd;};'use strict';var _=require(_0x0fae('0x0'));var util=require(_0x0fae('0x1'));var logger=require(_0x0fae('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0fae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fae('0x4'));var rimraf=require(_0x0fae('0x5'));var config=require(_0x0fae('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x0fae('0x7')]=function(_0x489cc8,_0x3a3b6f){return _0x489cc8[_0x0fae('0x8')](_0x0fae('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 9777c96..62c751d 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 _0x0ddf=['util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0ddf,0x187));var _0xf0dd=function(_0x1aae91,_0x595db2){_0x1aae91=_0x1aae91-0x0;var _0x42cd4f=_0x0ddf[_0x1aae91];return _0x42cd4f;};'use strict';var _=require('lodash');var util=require(_0xf0dd('0x0'));var moment=require(_0xf0dd('0x1'));var BPromise=require(_0xf0dd('0x2'));var rs=require(_0xf0dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf0dd('0x4'))(_0xf0dd('0x5'));var config=require(_0xf0dd('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34bace,_0x16d5a9,_0x528b65){return new BPromise(function(_0x219185,_0x2f0c71){return client[_0xf0dd('0x7')](_0x34bace,_0x528b65)[_0xf0dd('0x8')](function(_0x5221e7){logger[_0xf0dd('0x9')](_0xf0dd('0xa'),_0x16d5a9,_0xf0dd('0xb'));logger['debug'](_0xf0dd('0xc'),_0x16d5a9,'request\x20sent',JSON[_0xf0dd('0xd')](_0x5221e7));if(_0x5221e7[_0xf0dd('0xe')]){if(_0x5221e7[_0xf0dd('0xe')]['code']===0x1f4){logger[_0xf0dd('0xe')](_0xf0dd('0xa'),_0x16d5a9,_0x5221e7[_0xf0dd('0xe')][_0xf0dd('0xf')]);return _0x2f0c71(_0x5221e7['error'][_0xf0dd('0xf')]);}logger[_0xf0dd('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x16d5a9,_0x5221e7[_0xf0dd('0xe')][_0xf0dd('0xf')]);return _0x219185(_0x5221e7[_0xf0dd('0xe')][_0xf0dd('0xf')]);}else{logger[_0xf0dd('0x9')](_0xf0dd('0xa'),_0x16d5a9,_0xf0dd('0xb'));_0x219185(_0x5221e7[_0xf0dd('0x10')][_0xf0dd('0xf')]);}})['catch'](function(_0x53f140){logger[_0xf0dd('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x16d5a9,_0x53f140);_0x2f0c71(_0x53f140);});});} \ No newline at end of file +var _0xe7d1=['code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','error'];(function(_0x1fb996,_0x4e0b5f){var _0x3f2a72=function(_0x9449b1){while(--_0x9449b1){_0x1fb996['push'](_0x1fb996['shift']());}};_0x3f2a72(++_0x4e0b5f);}(_0xe7d1,0x1d3));var _0x1e7d=function(_0x5c0732,_0x2caed7){_0x5c0732=_0x5c0732-0x0;var _0x18af65=_0xe7d1[_0x5c0732];return _0x18af65;};'use strict';var _=require(_0x1e7d('0x0'));var util=require(_0x1e7d('0x1'));var moment=require(_0x1e7d('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e7d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1e7d('0x4'));var logger=require(_0x1e7d('0x5'))(_0x1e7d('0x6'));var config=require('../../config/environment');var jayson=require(_0x1e7d('0x7'));var client=jayson[_0x1e7d('0x8')][_0x1e7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14a209,_0x5b9a62,_0x3dbb65){return new BPromise(function(_0x4ac0da,_0x4be0ab){return client[_0x1e7d('0xa')](_0x14a209,_0x3dbb65)[_0x1e7d('0xb')](function(_0x405c49){logger[_0x1e7d('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5b9a62,_0x1e7d('0xd'));logger[_0x1e7d('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5b9a62,_0x1e7d('0xd'),JSON['stringify'](_0x405c49));if(_0x405c49[_0x1e7d('0xf')]){if(_0x405c49[_0x1e7d('0xf')][_0x1e7d('0x10')]===0x1f4){logger[_0x1e7d('0xf')](_0x1e7d('0x11'),_0x5b9a62,_0x405c49[_0x1e7d('0xf')]['message']);return _0x4be0ab(_0x405c49[_0x1e7d('0xf')]['message']);}logger[_0x1e7d('0xf')](_0x1e7d('0x11'),_0x5b9a62,_0x405c49[_0x1e7d('0xf')][_0x1e7d('0x12')]);return _0x4ac0da(_0x405c49[_0x1e7d('0xf')]['message']);}else{logger['info'](_0x1e7d('0x11'),_0x5b9a62,_0x1e7d('0xd'));_0x4ac0da(_0x405c49[_0x1e7d('0x13')][_0x1e7d('0x12')]);}})[_0x1e7d('0x14')](function(_0x46343e){logger[_0x1e7d('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5b9a62,_0x46343e);_0x4be0ab(_0x46343e);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 19d908a..491b6e2 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(_0x3beb86,_0x10537c){var _0x385cb9=function(_0x556817){while(--_0x556817){_0x3beb86['push'](_0x3beb86['shift']());}};_0x385cb9(++_0x10537c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x12f3c3,_0x281abf){var _0x2e48d6=function(_0x4bfe00){while(--_0x4bfe00){_0x12f3c3['push'](_0x12f3c3['shift']());}};_0x2e48d6(++_0x281abf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 052a4cf..5773eb1 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 _0xb9be=['name','TEXT','sequelize','exports','STRING'];(function(_0x2d8004,_0x20aac8){var _0x2f661c=function(_0x49fe78){while(--_0x49fe78){_0x2d8004['push'](_0x2d8004['shift']());}};_0x2f661c(++_0x20aac8);}(_0xb9be,0xc5));var _0xeb9b=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xb9be[_0x111e94];return _0x3de107;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'name':{'type':Sequelize[_0xeb9b('0x2')],'allowNull':![],'unique':_0xeb9b('0x3')},'table':{'type':Sequelize[_0xeb9b('0x2')]},'metric':{'type':Sequelize[_0xeb9b('0x4')]},'description':{'type':Sequelize[_0xeb9b('0x2')]}}; \ No newline at end of file +var _0x4ffe=['STRING','TEXT','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4ffe,0x172));var _0xe4ff=function(_0x5b4615,_0x3fad71){_0x5b4615=_0x5b4615-0x0;var _0x44eb78=_0x4ffe[_0x5b4615];return _0x44eb78;};'use strict';var Sequelize=require(_0xe4ff('0x0'));module[_0xe4ff('0x1')]={'name':{'type':Sequelize[_0xe4ff('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xe4ff('0x2')]},'metric':{'type':Sequelize[_0xe4ff('0x3')]},'description':{'type':Sequelize[_0xe4ff('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 8bcb63b..5bad51e 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(_0x45cbd6,_0x3509bb){var _0x4e6dde=function(_0x599dab){while(--_0x599dab){_0x45cbd6['push'](_0x45cbd6['shift']());}};_0x4e6dde(++_0x3509bb);}(_0x008c,0x188));var _0xc008=function(_0x5a905e,_0x31aa4a){_0x5a905e=_0x5a905e-0x0;var _0x4124d6=_0x008c[_0x5a905e];return _0x4124d6;};'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 _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x5cd1a0,_0x1b6d75){var _0x3a2a15=function(_0x461870){while(--_0x461870){_0x5cd1a0['push'](_0x5cd1a0['shift']());}};_0x3a2a15(++_0x1b6d75);}(_0x9a19,0x114));var _0x99a1=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0x9a19[_0x193e28];return _0x20ef59;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 1f3b444..997a99e 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 _0x647c=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x48583f,_0x3557f7){var _0x1af0f5=function(_0x19a839){while(--_0x19a839){_0x48583f['push'](_0x48583f['shift']());}};_0x1af0f5(++_0x3557f7);}(_0x647c,0x1d3));var _0xc647=function(_0x3030a9,_0x3e7be2){_0x3030a9=_0x3030a9-0x0;var _0x5e6b29=_0x647c[_0x3030a9];return _0x5e6b29;};'use strict';var _=require(_0xc647('0x0'));var util=require('util');var logger=require(_0xc647('0x1'))(_0xc647('0x2'));var moment=require('moment');var BPromise=require(_0xc647('0x3'));var rp=require(_0xc647('0x4'));var fs=require('fs');var path=require(_0xc647('0x5'));var rimraf=require(_0xc647('0x6'));var config=require(_0xc647('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xc647('0x8')]=function(_0x202fea,_0x19bfae){return _0x202fea[_0xc647('0x9')](_0xc647('0xa'),attributes,{'tableName':_0xc647('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf78f=['moment','bluebird','request-promise','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api'];(function(_0x1d7196,_0x26d92f){var _0x2efcf6=function(_0x2f774b){while(--_0x2f774b){_0x1d7196['push'](_0x1d7196['shift']());}};_0x2efcf6(++_0x26d92f);}(_0xf78f,0x72));var _0xff78=function(_0x347379,_0x37de29){_0x347379=_0x347379-0x0;var _0x1e6dbf=_0xf78f[_0x347379];return _0x1e6dbf;};'use strict';var _=require('lodash');var util=require(_0xff78('0x0'));var logger=require(_0xff78('0x1'))(_0xff78('0x2'));var moment=require(_0xff78('0x3'));var BPromise=require(_0xff78('0x4'));var rp=require(_0xff78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x35f208,_0x487ec1){return _0x35f208[_0xff78('0x6')](_0xff78('0x7'),attributes,{'tableName':_0xff78('0x8'),'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 cded21b..3943e93 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 _0x7c6c=['info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then'];(function(_0x11caf7,_0x2ffd69){var _0x1460a2=function(_0xf91fce){while(--_0xf91fce){_0x11caf7['push'](_0x11caf7['shift']());}};_0x1460a2(++_0x2ffd69);}(_0x7c6c,0x1a9));var _0xc7c6=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x7c6c[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xc7c6('0x0'));var util=require(_0xc7c6('0x1'));var moment=require(_0xc7c6('0x2'));var BPromise=require(_0xc7c6('0x3'));var rs=require(_0xc7c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7c6('0x5'))['db'];var utils=require(_0xc7c6('0x6'));var logger=require('../../config/logger')(_0xc7c6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc7c6('0x8')][_0xc7c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ef496,_0x331259,_0x17846c){return new BPromise(function(_0xc0d511,_0x73f0a8){return client[_0xc7c6('0xa')](_0x5ef496,_0x17846c)[_0xc7c6('0xb')](function(_0x4322ed){logger[_0xc7c6('0xc')](_0xc7c6('0xd'),_0x331259,'request\x20sent');logger['debug'](_0xc7c6('0xe'),_0x331259,'request\x20sent',JSON['stringify'](_0x4322ed));if(_0x4322ed['error']){if(_0x4322ed[_0xc7c6('0xf')]['code']===0x1f4){logger[_0xc7c6('0xf')](_0xc7c6('0xd'),_0x331259,_0x4322ed[_0xc7c6('0xf')][_0xc7c6('0x10')]);return _0x73f0a8(_0x4322ed['error'][_0xc7c6('0x10')]);}logger[_0xc7c6('0xf')](_0xc7c6('0xd'),_0x331259,_0x4322ed[_0xc7c6('0xf')]['message']);return _0xc0d511(_0x4322ed[_0xc7c6('0xf')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x331259,_0xc7c6('0x11'));_0xc0d511(_0x4322ed[_0xc7c6('0x12')]['message']);}})['catch'](function(_0x54de7d){logger[_0xc7c6('0xf')](_0xc7c6('0xd'),_0x331259,_0x54de7d);_0x73f0a8(_0x54de7d);});});} \ No newline at end of file +var _0x86b1=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2e40f8,_0x116cfc){var _0x291cc6=function(_0x1b3c8f){while(--_0x1b3c8f){_0x2e40f8['push'](_0x2e40f8['shift']());}};_0x291cc6(++_0x116cfc);}(_0x86b1,0x106));var _0x186b=function(_0x3452d6,_0x242484){_0x3452d6=_0x3452d6-0x0;var _0x1e8c56=_0x86b1[_0x3452d6];return _0x1e8c56;};'use strict';var _=require(_0x186b('0x0'));var util=require(_0x186b('0x1'));var moment=require(_0x186b('0x2'));var BPromise=require(_0x186b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x186b('0x4'));var db=require(_0x186b('0x5'))['db'];var utils=require(_0x186b('0x6'));var logger=require(_0x186b('0x7'))(_0x186b('0x8'));var config=require(_0x186b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x186b('0xa')][_0x186b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fc806,_0x543616,_0xe5ef3e){return new BPromise(function(_0x528f85,_0x483c66){return client[_0x186b('0xc')](_0x2fc806,_0xe5ef3e)[_0x186b('0xd')](function(_0x551610){logger[_0x186b('0xe')](_0x186b('0xf'),_0x543616,_0x186b('0x10'));logger[_0x186b('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x543616,'request\x20sent',JSON[_0x186b('0x12')](_0x551610));if(_0x551610[_0x186b('0x13')]){if(_0x551610['error'][_0x186b('0x14')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x543616,_0x551610['error'][_0x186b('0x15')]);return _0x483c66(_0x551610[_0x186b('0x13')]['message']);}logger['error'](_0x186b('0xf'),_0x543616,_0x551610[_0x186b('0x13')][_0x186b('0x15')]);return _0x528f85(_0x551610[_0x186b('0x13')][_0x186b('0x15')]);}else{logger['info'](_0x186b('0xf'),_0x543616,_0x186b('0x10'));_0x528f85(_0x551610[_0x186b('0x16')][_0x186b('0x15')]);}})[_0x186b('0x17')](function(_0x9804c1){logger[_0x186b('0x13')](_0x186b('0xf'),_0x543616,_0x9804c1);_0x483c66(_0x9804c1);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 0303b84..6e74b16 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 _0x0619=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x58a13f,_0x2d3de7){var _0x18c3c4=function(_0x524aff){while(--_0x524aff){_0x58a13f['push'](_0x58a13f['shift']());}};_0x18c3c4(++_0x2d3de7);}(_0x0619,0x90));var _0x9061=function(_0x22590a,_0x1bf69a){_0x22590a=_0x22590a-0x0;var _0x5d5f70=_0x0619[_0x22590a];return _0x5d5f70;};'use strict';var multer=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var path=require(_0x9061('0x2'));var timeout=require(_0x9061('0x3'));var express=require('express');var router=express[_0x9061('0x4')]();var fs_extra=require(_0x9061('0x5'));var auth=require(_0x9061('0x6'));var interaction=require(_0x9061('0x7'));var config=require(_0x9061('0x8'));var controller=require(_0x9061('0x9'));router[_0x9061('0xa')]('/',auth[_0x9061('0xb')](),controller[_0x9061('0xc')]);router[_0x9061('0xa')](_0x9061('0xd'),auth['isAuthenticated'](),controller[_0x9061('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9061('0xf')]);router[_0x9061('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9061('0x11')]);router[_0x9061('0x12')](_0x9061('0xd'),auth[_0x9061('0xb')](),controller[_0x9061('0x13')]);module[_0x9061('0x14')]=router; \ No newline at end of file +var _0x8784=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated'];(function(_0x4c0585,_0x24041a){var _0x3de0aa=function(_0xcbc4df){while(--_0xcbc4df){_0x4c0585['push'](_0x4c0585['shift']());}};_0x3de0aa(++_0x24041a);}(_0x8784,0x172));var _0x4878=function(_0x33d4a2,_0x2baaf4){_0x33d4a2=_0x33d4a2-0x0;var _0x2c793f=_0x8784[_0x33d4a2];return _0x2c793f;};'use strict';var multer=require(_0x4878('0x0'));var util=require(_0x4878('0x1'));var path=require('path');var timeout=require(_0x4878('0x2'));var express=require(_0x4878('0x3'));var router=express[_0x4878('0x4')]();var fs_extra=require(_0x4878('0x5'));var auth=require(_0x4878('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4878('0x7'));router[_0x4878('0x8')]('/',auth[_0x4878('0x9')](),controller[_0x4878('0xa')]);router[_0x4878('0x8')](_0x4878('0xb'),auth[_0x4878('0x9')](),controller[_0x4878('0xc')]);router[_0x4878('0xd')]('/',auth['isAuthenticated'](),controller[_0x4878('0xe')]);router[_0x4878('0xf')](_0x4878('0xb'),auth[_0x4878('0x9')](),controller[_0x4878('0x10')]);router[_0x4878('0x11')](_0x4878('0xb'),auth[_0x4878('0x9')](),controller[_0x4878('0x12')]);module[_0x4878('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index f0c132a..41137fe 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 _0xd9bf=['exports','TEXT','sequelize'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0xd9bf,0xda));var _0xfd9b=function(_0x1fb625,_0x310725){_0x1fb625=_0x1fb625-0x0;var _0x1d3e76=_0xd9bf[_0x1fb625];return _0x1d3e76;};'use strict';var Sequelize=require(_0xfd9b('0x0'));module[_0xfd9b('0x1')]={'tree':{'type':Sequelize[_0xfd9b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x98c0=['exports','TEXT','sequelize'];(function(_0x27cc42,_0x468979){var _0x571fc4=function(_0x1b10b0){while(--_0x1b10b0){_0x27cc42['push'](_0x27cc42['shift']());}};_0x571fc4(++_0x468979);}(_0x98c0,0xc2));var _0x098c=function(_0x1085fb,_0x1e1d99){_0x1085fb=_0x1085fb-0x0;var _0x3dd44d=_0x98c0[_0x1085fb];return _0x3dd44d;};'use strict';var Sequelize=require(_0x098c('0x0'));module[_0x098c('0x1')]={'tree':{'type':Sequelize[_0x098c('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 cd2acd3..e267192 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 _0x0859=['filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','map','AnalyticTreeReport','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x0859,0x1cb));var _0x9085=function(_0x93ad58,_0x179403){_0x93ad58=_0x93ad58-0x0;var _0x10589b=_0x0859[_0x93ad58];return _0x10589b;};'use strict';var emlformat=require(_0x9085('0x0'));var rimraf=require(_0x9085('0x1'));var zipdir=require(_0x9085('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9085('0x3'));var BPromise=require(_0x9085('0x4'));var Mustache=require(_0x9085('0x5'));var util=require(_0x9085('0x6'));var path=require(_0x9085('0x7'));var sox=require(_0x9085('0x8'));var csv=require('to-csv');var ejs=require(_0x9085('0x9'));var fs=require('fs');var fs_extra=require(_0x9085('0xa'));var _=require('lodash');var squel=require(_0x9085('0xb'));var crypto=require(_0x9085('0xc'));var jsforce=require(_0x9085('0xd'));var deskjs=require(_0x9085('0xe'));var toCsv=require(_0x9085('0xf'));var querystring=require(_0x9085('0x10'));var Papa=require(_0x9085('0x11'));var Redis=require(_0x9085('0x12'));var authService=require(_0x9085('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9085('0x14'));var hardwareService=require(_0x9085('0x15'));var logger=require('../../config/logger')(_0x9085('0x16'));var utils=require(_0x9085('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9085('0x18'));var db=require(_0x9085('0x19'))['db'];function respondWithStatusCode(_0x27ac73,_0x5ed26a){_0x5ed26a=_0x5ed26a||0xcc;return function(_0x4fdea5){if(_0x4fdea5){return _0x27ac73[_0x9085('0x1a')](_0x5ed26a);}return _0x27ac73[_0x9085('0x1b')](_0x5ed26a)['end']();};}function respondWithResult(_0x4d5a3e,_0x352c2d){_0x352c2d=_0x352c2d||0xc8;return function(_0x21973e){if(_0x21973e){return _0x4d5a3e['status'](_0x352c2d)['json'](_0x21973e);}};}function respondWithFilteredResult(_0x5950f7,_0x547661){return function(_0x3607d9){if(_0x3607d9){var _0x12aa7f=typeof _0x547661['offset']===_0x9085('0x1c')&&typeof _0x547661[_0x9085('0x1d')]===_0x9085('0x1c');var _0x4c0d72=_0x3607d9['count'];var _0x2a4036=_0x12aa7f?0x0:_0x547661[_0x9085('0x1e')];var _0x5eed84=_0x12aa7f?_0x3607d9[_0x9085('0x1f')]:_0x547661[_0x9085('0x1e')]+_0x547661[_0x9085('0x1d')];var _0x1ac0c0;if(_0x5eed84>=_0x4c0d72){_0x5eed84=_0x4c0d72;_0x1ac0c0=0xc8;}else{_0x1ac0c0=0xce;}_0x5950f7[_0x9085('0x1b')](_0x1ac0c0);return _0x5950f7[_0x9085('0x20')](_0x9085('0x21'),_0x2a4036+'-'+_0x5eed84+'/'+_0x4c0d72)[_0x9085('0x22')](_0x3607d9);}return null;};}function patchUpdates(_0xc225b2){return function(_0x2847f4){try{jsonpatch[_0x9085('0x23')](_0x2847f4,_0xc225b2,!![]);}catch(_0x3c038b){return BPromise[_0x9085('0x24')](_0x3c038b);}return _0x2847f4[_0x9085('0x25')]();};}function saveUpdates(_0x38696f,_0x45a10c){return function(_0x1e6aaa){if(_0x1e6aaa){return _0x1e6aaa[_0x9085('0x26')](_0x38696f)[_0x9085('0x27')](function(_0x2277d7){return _0x2277d7;});}return null;};}function removeEntity(_0x8740b1,_0x1ff9c6){return function(_0x267a2d){if(_0x267a2d){return _0x267a2d[_0x9085('0x28')]()[_0x9085('0x27')](function(){_0x8740b1['status'](0xcc)[_0x9085('0x29')]();});}};}function handleEntityNotFound(_0x594b93,_0x519fbc){return function(_0x415b35){if(!_0x415b35){_0x594b93['sendStatus'](0x194);}return _0x415b35;};}function handleError(_0x131a7f,_0x3c8d1d){_0x3c8d1d=_0x3c8d1d||0x1f4;return function(_0x148807){logger[_0x9085('0x2a')](_0x148807['stack']);if(_0x148807['name']){delete _0x148807['name'];}_0x131a7f[_0x9085('0x1b')](_0x3c8d1d)['send'](_0x148807);};}exports['index']=function(_0x4d4d46,_0x23946d){var _0x405c8={},_0x172b3e={},_0x4e64dc={'count':0x0,'rows':[]};var _0x4fb072=_[_0x9085('0x2b')](db[_0x9085('0x2c')]['rawAttributes'],function(_0x6a2ec8){return{'name':_0x6a2ec8['fieldName'],'type':_0x6a2ec8[_0x9085('0x2d')]['key']};});_0x172b3e[_0x9085('0x2e')]=_[_0x9085('0x2b')](_0x4fb072,'name');_0x172b3e['query']=_[_0x9085('0x2f')](_0x4d4d46[_0x9085('0x30')]);_0x172b3e[_0x9085('0x31')]=_[_0x9085('0x32')](_0x172b3e[_0x9085('0x2e')],_0x172b3e['query']);_0x405c8[_0x9085('0x33')]=_[_0x9085('0x32')](_0x172b3e[_0x9085('0x2e')],qs[_0x9085('0x34')](_0x4d4d46['query'][_0x9085('0x34')]));_0x405c8[_0x9085('0x33')]=_0x405c8['attributes'][_0x9085('0x35')]?_0x405c8[_0x9085('0x33')]:_0x172b3e[_0x9085('0x2e')];if(!_0x4d4d46[_0x9085('0x30')][_0x9085('0x36')](_0x9085('0x37'))){_0x405c8[_0x9085('0x1d')]=qs[_0x9085('0x1d')](_0x4d4d46[_0x9085('0x30')]['limit']);_0x405c8[_0x9085('0x1e')]=qs[_0x9085('0x1e')](_0x4d4d46['query']['offset']);}_0x405c8['order']=qs[_0x9085('0x38')](_0x4d4d46['query'][_0x9085('0x38')]);_0x405c8[_0x9085('0x39')]=qs['filters'](_[_0x9085('0x3a')](_0x4d4d46[_0x9085('0x30')],_0x172b3e[_0x9085('0x31')]),_0x4fb072);if(_0x4d4d46[_0x9085('0x30')][_0x9085('0x3b')]){_0x405c8[_0x9085('0x39')]=_[_0x9085('0x3c')](_0x405c8[_0x9085('0x39')],{'$or':_[_0x9085('0x2b')](_0x4fb072,function(_0x28fb5e){if(_0x28fb5e[_0x9085('0x2d')]!==_0x9085('0x3d')){var _0x1c0274={};_0x1c0274[_0x28fb5e['name']]={'$like':'%'+_0x4d4d46[_0x9085('0x30')][_0x9085('0x3b')]+'%'};return _0x1c0274;}})});}_0x405c8=_[_0x9085('0x3c')]({},_0x405c8,_0x4d4d46['options']);var _0x33c539={'where':_0x405c8['where']};return db[_0x9085('0x2c')]['count'](_0x33c539)[_0x9085('0x27')](function(_0x42c1ff){_0x4e64dc[_0x9085('0x1f')]=_0x42c1ff;if(_0x4d4d46[_0x9085('0x30')][_0x9085('0x3e')]){_0x405c8[_0x9085('0x3f')]=[{'all':!![]}];}return db[_0x9085('0x2c')][_0x9085('0x40')](_0x405c8);})['then'](function(_0x718a6e){_0x4e64dc[_0x9085('0x41')]=_0x718a6e;return _0x4e64dc;})[_0x9085('0x27')](respondWithFilteredResult(_0x23946d,_0x405c8))['catch'](handleError(_0x23946d,null));};exports[_0x9085('0x42')]=function(_0x13f481,_0x4f6619){var _0x2e8ad9={'raw':!![],'where':{'id':_0x13f481['params']['id']}},_0x38aa7e={};_0x38aa7e[_0x9085('0x2e')]=_[_0x9085('0x2f')](db[_0x9085('0x2c')][_0x9085('0x43')]);_0x38aa7e[_0x9085('0x30')]=_[_0x9085('0x2f')](_0x13f481['query']);_0x38aa7e[_0x9085('0x31')]=_[_0x9085('0x32')](_0x38aa7e[_0x9085('0x2e')],_0x38aa7e['query']);_0x2e8ad9[_0x9085('0x33')]=_[_0x9085('0x32')](_0x38aa7e['model'],qs['fields'](_0x13f481[_0x9085('0x30')][_0x9085('0x34')]));_0x2e8ad9[_0x9085('0x33')]=_0x2e8ad9['attributes']['length']?_0x2e8ad9['attributes']:_0x38aa7e[_0x9085('0x2e')];if(_0x13f481[_0x9085('0x30')][_0x9085('0x3e')]){_0x2e8ad9[_0x9085('0x3f')]=[{'all':!![]}];}_0x2e8ad9=_['merge']({},_0x2e8ad9,_0x13f481[_0x9085('0x44')]);return db[_0x9085('0x2c')][_0x9085('0x45')](_0x2e8ad9)[_0x9085('0x27')](handleEntityNotFound(_0x4f6619,null))[_0x9085('0x27')](respondWithResult(_0x4f6619,null))[_0x9085('0x46')](handleError(_0x4f6619,null));};exports[_0x9085('0x47')]=function(_0x542a07,_0x30db84){return db[_0x9085('0x2c')][_0x9085('0x47')](_0x542a07[_0x9085('0x48')],{})[_0x9085('0x27')](respondWithResult(_0x30db84,0xc9))[_0x9085('0x46')](handleError(_0x30db84,null));};exports['update']=function(_0x51d8e2,_0x304273){if(_0x51d8e2['body']['id']){delete _0x51d8e2[_0x9085('0x48')]['id'];}return db[_0x9085('0x2c')][_0x9085('0x45')]({'where':{'id':_0x51d8e2[_0x9085('0x49')]['id']}})['then'](handleEntityNotFound(_0x304273,null))[_0x9085('0x27')](saveUpdates(_0x51d8e2['body'],null))[_0x9085('0x27')](respondWithResult(_0x304273,null))[_0x9085('0x46')](handleError(_0x304273,null));};exports[_0x9085('0x28')]=function(_0x15c37b,_0x551db0){return db['AnalyticTreeReport'][_0x9085('0x45')]({'where':{'id':_0x15c37b[_0x9085('0x49')]['id']}})[_0x9085('0x27')](handleEntityNotFound(_0x551db0,null))[_0x9085('0x27')](removeEntity(_0x551db0,null))[_0x9085('0x46')](handleError(_0x551db0,null));}; \ No newline at end of file +var _0x3700=['catch','params','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','rows'];(function(_0x53b90d,_0x4583bb){var _0xae5f0a=function(_0x21b03f){while(--_0x21b03f){_0x53b90d['push'](_0x53b90d['shift']());}};_0xae5f0a(++_0x4583bb);}(_0x3700,0x127));var _0x0370=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0x3700[_0x46428c];return _0x16a677;};'use strict';var emlformat=require(_0x0370('0x0'));var rimraf=require(_0x0370('0x1'));var zipdir=require(_0x0370('0x2'));var jsonpatch=require(_0x0370('0x3'));var rp=require(_0x0370('0x4'));var moment=require(_0x0370('0x5'));var BPromise=require(_0x0370('0x6'));var Mustache=require(_0x0370('0x7'));var util=require(_0x0370('0x8'));var path=require('path');var sox=require(_0x0370('0x9'));var csv=require(_0x0370('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0370('0xb'));var _=require('lodash');var squel=require(_0x0370('0xc'));var crypto=require(_0x0370('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0370('0xe'));var toCsv=require(_0x0370('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0370('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0370('0x10'));var logger=require(_0x0370('0x11'))(_0x0370('0x12'));var utils=require('../../config/utils');var config=require(_0x0370('0x13'));var licenseUtil=require(_0x0370('0x14'));var db=require(_0x0370('0x15'))['db'];function respondWithStatusCode(_0x2422ea,_0x5d112c){_0x5d112c=_0x5d112c||0xcc;return function(_0x35d0a8){if(_0x35d0a8){return _0x2422ea[_0x0370('0x16')](_0x5d112c);}return _0x2422ea[_0x0370('0x17')](_0x5d112c)[_0x0370('0x18')]();};}function respondWithResult(_0x3b80c7,_0x592f00){_0x592f00=_0x592f00||0xc8;return function(_0x17f738){if(_0x17f738){return _0x3b80c7['status'](_0x592f00)['json'](_0x17f738);}};}function respondWithFilteredResult(_0xdf4517,_0x132663){return function(_0xcee483){if(_0xcee483){var _0x44e456=typeof _0x132663[_0x0370('0x19')]===_0x0370('0x1a')&&typeof _0x132663[_0x0370('0x1b')]===_0x0370('0x1a');var _0x52f5b8=_0xcee483[_0x0370('0x1c')];var _0x6483d7=_0x44e456?0x0:_0x132663[_0x0370('0x19')];var _0x3574ca=_0x44e456?_0xcee483[_0x0370('0x1c')]:_0x132663['offset']+_0x132663['limit'];var _0x50a768;if(_0x3574ca>=_0x52f5b8){_0x3574ca=_0x52f5b8;_0x50a768=0xc8;}else{_0x50a768=0xce;}_0xdf4517[_0x0370('0x17')](_0x50a768);return _0xdf4517[_0x0370('0x1d')](_0x0370('0x1e'),_0x6483d7+'-'+_0x3574ca+'/'+_0x52f5b8)['json'](_0xcee483);}return null;};}function patchUpdates(_0x21054a){return function(_0x1652bc){try{jsonpatch[_0x0370('0x1f')](_0x1652bc,_0x21054a,!![]);}catch(_0x301523){return BPromise[_0x0370('0x20')](_0x301523);}return _0x1652bc[_0x0370('0x21')]();};}function saveUpdates(_0x572229,_0x31c07d){return function(_0x28e89b){if(_0x28e89b){return _0x28e89b[_0x0370('0x22')](_0x572229)[_0x0370('0x23')](function(_0x4e6c6f){return _0x4e6c6f;});}return null;};}function removeEntity(_0x4625b2,_0x1ecec4){return function(_0x518df0){if(_0x518df0){return _0x518df0[_0x0370('0x24')]()[_0x0370('0x23')](function(){_0x4625b2['status'](0xcc)[_0x0370('0x18')]();});}};}function handleEntityNotFound(_0xa56c80,_0x36a469){return function(_0x2d3401){if(!_0x2d3401){_0xa56c80[_0x0370('0x16')](0x194);}return _0x2d3401;};}function handleError(_0x5a56b0,_0x105d4d){_0x105d4d=_0x105d4d||0x1f4;return function(_0x608222){logger['error'](_0x608222[_0x0370('0x25')]);if(_0x608222[_0x0370('0x26')]){delete _0x608222['name'];}_0x5a56b0['status'](_0x105d4d)[_0x0370('0x27')](_0x608222);};}exports[_0x0370('0x28')]=function(_0x1a0f85,_0x9e4fda){var _0x4c73b7={},_0xf07dda={},_0x5bf174={'count':0x0,'rows':[]};var _0x322252=_['map'](db[_0x0370('0x29')][_0x0370('0x2a')],function(_0x560907){return{'name':_0x560907[_0x0370('0x2b')],'type':_0x560907['type'][_0x0370('0x2c')]};});_0xf07dda[_0x0370('0x2d')]=_[_0x0370('0x2e')](_0x322252,_0x0370('0x26'));_0xf07dda['query']=_[_0x0370('0x2f')](_0x1a0f85[_0x0370('0x30')]);_0xf07dda[_0x0370('0x31')]=_[_0x0370('0x32')](_0xf07dda['model'],_0xf07dda[_0x0370('0x30')]);_0x4c73b7[_0x0370('0x33')]=_[_0x0370('0x32')](_0xf07dda[_0x0370('0x2d')],qs[_0x0370('0x34')](_0x1a0f85[_0x0370('0x30')][_0x0370('0x34')]));_0x4c73b7[_0x0370('0x33')]=_0x4c73b7[_0x0370('0x33')][_0x0370('0x35')]?_0x4c73b7['attributes']:_0xf07dda['model'];if(!_0x1a0f85['query'][_0x0370('0x36')](_0x0370('0x37'))){_0x4c73b7[_0x0370('0x1b')]=qs['limit'](_0x1a0f85[_0x0370('0x30')][_0x0370('0x1b')]);_0x4c73b7[_0x0370('0x19')]=qs[_0x0370('0x19')](_0x1a0f85[_0x0370('0x30')][_0x0370('0x19')]);}_0x4c73b7[_0x0370('0x38')]=qs['sort'](_0x1a0f85[_0x0370('0x30')]['sort']);_0x4c73b7[_0x0370('0x39')]=qs[_0x0370('0x31')](_[_0x0370('0x3a')](_0x1a0f85[_0x0370('0x30')],_0xf07dda['filters']),_0x322252);if(_0x1a0f85['query'][_0x0370('0x3b')]){_0x4c73b7['where']=_[_0x0370('0x3c')](_0x4c73b7[_0x0370('0x39')],{'$or':_[_0x0370('0x2e')](_0x322252,function(_0x4cb4d5){if(_0x4cb4d5[_0x0370('0x3d')]!==_0x0370('0x3e')){var _0x19cd3f={};_0x19cd3f[_0x4cb4d5[_0x0370('0x26')]]={'$like':'%'+_0x1a0f85['query'][_0x0370('0x3b')]+'%'};return _0x19cd3f;}})});}_0x4c73b7=_[_0x0370('0x3c')]({},_0x4c73b7,_0x1a0f85[_0x0370('0x3f')]);var _0x4dcd5c={'where':_0x4c73b7[_0x0370('0x39')]};return db[_0x0370('0x29')][_0x0370('0x1c')](_0x4dcd5c)[_0x0370('0x23')](function(_0x23d48a){_0x5bf174['count']=_0x23d48a;if(_0x1a0f85[_0x0370('0x30')]['includeAll']){_0x4c73b7['include']=[{'all':!![]}];}return db[_0x0370('0x29')]['findAll'](_0x4c73b7);})[_0x0370('0x23')](function(_0x5f29f7){_0x5bf174[_0x0370('0x40')]=_0x5f29f7;return _0x5bf174;})['then'](respondWithFilteredResult(_0x9e4fda,_0x4c73b7))[_0x0370('0x41')](handleError(_0x9e4fda,null));};exports['show']=function(_0x56b38e,_0x27607c){var _0x262180={'raw':!![],'where':{'id':_0x56b38e[_0x0370('0x42')]['id']}},_0xd450a3={};_0xd450a3[_0x0370('0x2d')]=_[_0x0370('0x2f')](db[_0x0370('0x29')]['rawAttributes']);_0xd450a3['query']=_[_0x0370('0x2f')](_0x56b38e[_0x0370('0x30')]);_0xd450a3[_0x0370('0x31')]=_[_0x0370('0x32')](_0xd450a3[_0x0370('0x2d')],_0xd450a3[_0x0370('0x30')]);_0x262180[_0x0370('0x33')]=_[_0x0370('0x32')](_0xd450a3['model'],qs[_0x0370('0x34')](_0x56b38e[_0x0370('0x30')][_0x0370('0x34')]));_0x262180[_0x0370('0x33')]=_0x262180[_0x0370('0x33')][_0x0370('0x35')]?_0x262180[_0x0370('0x33')]:_0xd450a3[_0x0370('0x2d')];if(_0x56b38e[_0x0370('0x30')][_0x0370('0x43')]){_0x262180[_0x0370('0x44')]=[{'all':!![]}];}_0x262180=_['merge']({},_0x262180,_0x56b38e[_0x0370('0x3f')]);return db[_0x0370('0x29')][_0x0370('0x45')](_0x262180)['then'](handleEntityNotFound(_0x27607c,null))[_0x0370('0x23')](respondWithResult(_0x27607c,null))['catch'](handleError(_0x27607c,null));};exports[_0x0370('0x46')]=function(_0x8a4177,_0x44616a){return db[_0x0370('0x29')][_0x0370('0x46')](_0x8a4177[_0x0370('0x47')],{})[_0x0370('0x23')](respondWithResult(_0x44616a,0xc9))[_0x0370('0x41')](handleError(_0x44616a,null));};exports[_0x0370('0x22')]=function(_0x3bfa3e,_0x106707){if(_0x3bfa3e[_0x0370('0x47')]['id']){delete _0x3bfa3e[_0x0370('0x47')]['id'];}return db[_0x0370('0x29')][_0x0370('0x45')]({'where':{'id':_0x3bfa3e[_0x0370('0x42')]['id']}})[_0x0370('0x23')](handleEntityNotFound(_0x106707,null))[_0x0370('0x23')](saveUpdates(_0x3bfa3e[_0x0370('0x47')],null))['then'](respondWithResult(_0x106707,null))[_0x0370('0x41')](handleError(_0x106707,null));};exports['destroy']=function(_0x1fd82e,_0x4c852c){return db[_0x0370('0x29')][_0x0370('0x45')]({'where':{'id':_0x1fd82e[_0x0370('0x42')]['id']}})[_0x0370('0x23')](handleEntityNotFound(_0x4c852c,null))[_0x0370('0x23')](removeEntity(_0x4c852c,null))[_0x0370('0x41')](handleError(_0x4c852c,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index c9ee091..7b9fca0 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 _0xbffc=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0xbffc,0xd0));var _0xcbff=function(_0x216226,_0x145eab){_0x216226=_0x216226-0x0;var _0x462499=_0xbffc[_0x216226];return _0x462499;};'use strict';var _=require('lodash');var util=require(_0xcbff('0x0'));var logger=require(_0xcbff('0x1'))(_0xcbff('0x2'));var moment=require(_0xcbff('0x3'));var BPromise=require(_0xcbff('0x4'));var rp=require(_0xcbff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbff('0x6'));var config=require(_0xcbff('0x7'));var attributes=require(_0xcbff('0x8'));module[_0xcbff('0x9')]=function(_0x4f4760,_0x119acb){return _0x4f4760[_0xcbff('0xa')](_0xcbff('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac94=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x2af692,_0x30438e){var _0x26a3a8=function(_0x28aa74){while(--_0x28aa74){_0x2af692['push'](_0x2af692['shift']());}};_0x26a3a8(++_0x30438e);}(_0xac94,0x197));var _0x4ac9=function(_0x10f88c,_0x560cc3){_0x10f88c=_0x10f88c-0x0;var _0xd77c0d=_0xac94[_0x10f88c];return _0xd77c0d;};'use strict';var _=require(_0x4ac9('0x0'));var util=require(_0x4ac9('0x1'));var logger=require(_0x4ac9('0x2'))(_0x4ac9('0x3'));var moment=require(_0x4ac9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ac9('0x5'));var rimraf=require('rimraf');var config=require(_0x4ac9('0x6'));var attributes=require(_0x4ac9('0x7'));module[_0x4ac9('0x8')]=function(_0x2555db,_0x1edb9b){return _0x2555db[_0x4ac9('0x9')](_0x4ac9('0xa'),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 68b52b6..2c7a8de 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 _0x7a54=['info','AnalyticTreeReport,\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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x124791,_0x2b9ed2){_0x124791=_0x124791-0x0;var _0x4c535a=_0x7a54[_0x124791];return _0x4c535a;};'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')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x33f79f,_0xe46bc5){var _0x3a5cd1=function(_0x1bf38b){while(--_0x1bf38b){_0x33f79f['push'](_0x33f79f['shift']());}};_0x3a5cd1(++_0xe46bc5);}(_0xdb28,0x106));var _0x8db2=function(_0x5797c9,_0x4ebd89){_0x5797c9=_0x5797c9-0x0;var _0x35ee65=_0xdb28[_0x5797c9];return _0x35ee65;};'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 5f8524e..100ca91 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 _0x3264=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','show','post','create','put','/:id','destroy','multer','path','connect-timeout'];(function(_0x17c056,_0x11f4ff){var _0x5c238a=function(_0x32e152){while(--_0x32e152){_0x17c056['push'](_0x17c056['shift']());}};_0x5c238a(++_0x11f4ff);}(_0x3264,0x1e3));var _0x4326=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x3264[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0x4326('0x0'));var util=require('util');var path=require(_0x4326('0x1'));var timeout=require(_0x4326('0x2'));var express=require(_0x4326('0x3'));var router=express[_0x4326('0x4')]();var fs_extra=require(_0x4326('0x5'));var auth=require(_0x4326('0x6'));var interaction=require(_0x4326('0x7'));var config=require(_0x4326('0x8'));var controller=require(_0x4326('0x9'));router['get']('/',auth[_0x4326('0xa')](),controller[_0x4326('0xb')]);router['get']('/:id',auth[_0x4326('0xa')](),controller[_0x4326('0xc')]);router[_0x4326('0xd')]('/',auth[_0x4326('0xa')](),controller[_0x4326('0xe')]);router[_0x4326('0xf')](_0x4326('0x10'),auth[_0x4326('0xa')](),controller['update']);router['delete'](_0x4326('0x10'),auth[_0x4326('0xa')](),controller[_0x4326('0x11')]);module['exports']=router; \ No newline at end of file +var _0x29e9=['post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0x29e9,0x95));var _0x929e=function(_0x2299d4,_0x47c68f){_0x2299d4=_0x2299d4-0x0;var _0x149413=_0x29e9[_0x2299d4];return _0x149413;};'use strict';var multer=require('multer');var util=require(_0x929e('0x0'));var path=require(_0x929e('0x1'));var timeout=require(_0x929e('0x2'));var express=require(_0x929e('0x3'));var router=express[_0x929e('0x4')]();var fs_extra=require(_0x929e('0x5'));var auth=require(_0x929e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x929e('0x7'));var controller=require(_0x929e('0x8'));router['get']('/',auth[_0x929e('0x9')](),controller[_0x929e('0xa')]);router[_0x929e('0xb')](_0x929e('0xc'),auth[_0x929e('0x9')](),controller['show']);router[_0x929e('0xd')]('/',auth[_0x929e('0x9')](),controller[_0x929e('0xe')]);router[_0x929e('0xf')](_0x929e('0xc'),auth[_0x929e('0x9')](),controller['update']);router[_0x929e('0x10')]('/:id',auth[_0x929e('0x9')](),controller[_0x929e('0x11')]);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 bbf3cf6..08507c5 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 _0x8ebf=['sequelize','exports','STRING'];(function(_0x176bf2,_0x190eaa){var _0x59ec2d=function(_0x5c05f9){while(--_0x5c05f9){_0x176bf2['push'](_0x176bf2['shift']());}};_0x59ec2d(++_0x190eaa);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x8ebf[_0x37a79c];return _0x561d89;};'use strict';var Sequelize=require(_0xf8eb('0x0'));module[_0xf8eb('0x1')]={'name':{'type':Sequelize[_0xf8eb('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf8eb('0x2')]}}; \ No newline at end of file +var _0x089f=['STRING','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x089f,0x1c7));var _0xf089=function(_0x58cca5,_0xa02c6){_0x58cca5=_0x58cca5-0x0;var _0x55b0a6=_0x089f[_0x58cca5];return _0x55b0a6;};'use strict';var Sequelize=require('sequelize');module[_0xf089('0x0')]={'name':{'type':Sequelize[_0xf089('0x1')]},'basename':{'type':Sequelize[_0xf089('0x1')]},'type':{'type':Sequelize[_0xf089('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 8fd90f1..5339251 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 _0x5eee=['bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Attachment','findAll','catch','show','params','includeAll','find','clone','length','include','get','omit','createdAt','updatedAt','body','create','update','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x1ccc2a,_0x1a1e08){var _0x323a21=function(_0x3e1516){while(--_0x3e1516){_0x1ccc2a['push'](_0x1ccc2a['shift']());}};_0x323a21(++_0x1a1e08);}(_0x5eee,0xb2));var _0xe5ee=function(_0x4b4642,_0x31c522){_0x4b4642=_0x4b4642-0x0;var _0xa1767d=_0x5eee[_0x4b4642];return _0xa1767d;};'use strict';var emlformat=require(_0xe5ee('0x0'));var rimraf=require(_0xe5ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe5ee('0x2'));var rp=require(_0xe5ee('0x3'));var moment=require('moment');var BPromise=require(_0xe5ee('0x4'));var Mustache=require(_0xe5ee('0x5'));var util=require(_0xe5ee('0x6'));var path=require('path');var sox=require(_0xe5ee('0x7'));var csv=require('to-csv');var ejs=require(_0xe5ee('0x8'));var fs=require('fs');var fs_extra=require(_0xe5ee('0x9'));var _=require(_0xe5ee('0xa'));var squel=require(_0xe5ee('0xb'));var crypto=require(_0xe5ee('0xc'));var jsforce=require(_0xe5ee('0xd'));var deskjs=require(_0xe5ee('0xe'));var toCsv=require(_0xe5ee('0xf'));var querystring=require('querystring');var Papa=require(_0xe5ee('0x10'));var Redis=require(_0xe5ee('0x11'));var authService=require(_0xe5ee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe5ee('0x13'));var hardwareService=require(_0xe5ee('0x14'));var logger=require(_0xe5ee('0x15'))(_0xe5ee('0x16'));var utils=require(_0xe5ee('0x17'));var config=require(_0xe5ee('0x18'));var licenseUtil=require(_0xe5ee('0x19'));var db=require(_0xe5ee('0x1a'))['db'];function respondWithStatusCode(_0x14e7ef,_0x1c580f){_0x1c580f=_0x1c580f||0xcc;return function(_0x17c10c){if(_0x17c10c){return _0x14e7ef[_0xe5ee('0x1b')](_0x1c580f);}return _0x14e7ef[_0xe5ee('0x1c')](_0x1c580f)[_0xe5ee('0x1d')]();};}function respondWithResult(_0x760052,_0x343472){_0x343472=_0x343472||0xc8;return function(_0x4395a7){if(_0x4395a7){return _0x760052[_0xe5ee('0x1c')](_0x343472)[_0xe5ee('0x1e')](_0x4395a7);}};}function respondWithFilteredResult(_0x5d4dbc,_0x11735f){return function(_0x78f7f3){if(_0x78f7f3){var _0x407f0a=typeof _0x11735f[_0xe5ee('0x1f')]===_0xe5ee('0x20')&&typeof _0x11735f[_0xe5ee('0x21')]===_0xe5ee('0x20');var _0x3e53fd=_0x78f7f3[_0xe5ee('0x22')];var _0x267ded=_0x407f0a?0x0:_0x11735f['offset'];var _0x3e0608=_0x407f0a?_0x78f7f3[_0xe5ee('0x22')]:_0x11735f[_0xe5ee('0x1f')]+_0x11735f[_0xe5ee('0x21')];var _0x449742;if(_0x3e0608>=_0x3e53fd){_0x3e0608=_0x3e53fd;_0x449742=0xc8;}else{_0x449742=0xce;}_0x5d4dbc[_0xe5ee('0x1c')](_0x449742);return _0x5d4dbc[_0xe5ee('0x23')]('Content-Range',_0x267ded+'-'+_0x3e0608+'/'+_0x3e53fd)['json'](_0x78f7f3);}return null;};}function patchUpdates(_0x119f19){return function(_0x233dec){try{jsonpatch[_0xe5ee('0x24')](_0x233dec,_0x119f19,!![]);}catch(_0x269675){return BPromise[_0xe5ee('0x25')](_0x269675);}return _0x233dec['save']();};}function saveUpdates(_0x3f9d1d,_0x54ad1e){return function(_0x3b9422){if(_0x3b9422){return _0x3b9422['update'](_0x3f9d1d)['then'](function(_0x41d7ee){return _0x41d7ee;});}return null;};}function removeEntity(_0x5e5139,_0x2609c9){return function(_0x526a4b){if(_0x526a4b){return _0x526a4b[_0xe5ee('0x26')]()[_0xe5ee('0x27')](function(){_0x5e5139[_0xe5ee('0x1c')](0xcc)[_0xe5ee('0x1d')]();});}};}function handleEntityNotFound(_0x490524,_0x165123){return function(_0x5eb773){if(!_0x5eb773){_0x490524[_0xe5ee('0x1b')](0x194);}return _0x5eb773;};}function handleError(_0x403977,_0x422495){_0x422495=_0x422495||0x1f4;return function(_0x25174d){logger['error'](_0x25174d[_0xe5ee('0x28')]);if(_0x25174d[_0xe5ee('0x29')]){delete _0x25174d[_0xe5ee('0x29')];}_0x403977[_0xe5ee('0x1c')](_0x422495)[_0xe5ee('0x2a')](_0x25174d);};}exports[_0xe5ee('0x2b')]=function(_0x51058d,_0x1410fc){var _0x20e64f={},_0x2285f6={},_0x35d9bb={'count':0x0,'rows':[]};var _0x469e89=_[_0xe5ee('0x2c')](db['Attachment'][_0xe5ee('0x2d')],function(_0x41f4b2){return{'name':_0x41f4b2[_0xe5ee('0x2e')],'type':_0x41f4b2[_0xe5ee('0x2f')][_0xe5ee('0x30')]};});_0x2285f6[_0xe5ee('0x31')]=_[_0xe5ee('0x2c')](_0x469e89,_0xe5ee('0x29'));_0x2285f6[_0xe5ee('0x32')]=_[_0xe5ee('0x33')](_0x51058d['query']);_0x2285f6['filters']=_[_0xe5ee('0x34')](_0x2285f6[_0xe5ee('0x31')],_0x2285f6[_0xe5ee('0x32')]);_0x20e64f[_0xe5ee('0x35')]=_[_0xe5ee('0x34')](_0x2285f6['model'],qs['fields'](_0x51058d[_0xe5ee('0x32')][_0xe5ee('0x36')]));_0x20e64f[_0xe5ee('0x35')]=_0x20e64f[_0xe5ee('0x35')]['length']?_0x20e64f[_0xe5ee('0x35')]:_0x2285f6[_0xe5ee('0x31')];if(!_0x51058d[_0xe5ee('0x32')]['hasOwnProperty'](_0xe5ee('0x37'))){_0x20e64f[_0xe5ee('0x21')]=qs['limit'](_0x51058d[_0xe5ee('0x32')][_0xe5ee('0x21')]);_0x20e64f[_0xe5ee('0x1f')]=qs['offset'](_0x51058d[_0xe5ee('0x32')][_0xe5ee('0x1f')]);}_0x20e64f[_0xe5ee('0x38')]=qs[_0xe5ee('0x39')](_0x51058d['query']['sort']);_0x20e64f[_0xe5ee('0x3a')]=qs[_0xe5ee('0x3b')](_['pick'](_0x51058d[_0xe5ee('0x32')],_0x2285f6[_0xe5ee('0x3b')]),_0x469e89);if(_0x51058d[_0xe5ee('0x32')][_0xe5ee('0x3c')]){_0x20e64f[_0xe5ee('0x3a')]=_[_0xe5ee('0x3d')](_0x20e64f['where'],{'$or':_[_0xe5ee('0x2c')](_0x469e89,function(_0x1bb75c){if(_0x1bb75c[_0xe5ee('0x2f')]!==_0xe5ee('0x3e')){var _0x2d5234={};_0x2d5234[_0x1bb75c['name']]={'$like':'%'+_0x51058d[_0xe5ee('0x32')][_0xe5ee('0x3c')]+'%'};return _0x2d5234;}})});}_0x20e64f=_[_0xe5ee('0x3d')]({},_0x20e64f,_0x51058d[_0xe5ee('0x3f')]);var _0x42a55d={'where':_0x20e64f[_0xe5ee('0x3a')]};return db[_0xe5ee('0x40')][_0xe5ee('0x22')](_0x42a55d)[_0xe5ee('0x27')](function(_0x429dce){_0x35d9bb[_0xe5ee('0x22')]=_0x429dce;if(_0x51058d['query']['includeAll']){_0x20e64f['include']=[{'all':!![]}];}return db[_0xe5ee('0x40')][_0xe5ee('0x41')](_0x20e64f);})['then'](function(_0x228c38){_0x35d9bb['rows']=_0x228c38;return _0x35d9bb;})[_0xe5ee('0x27')](respondWithFilteredResult(_0x1410fc,_0x20e64f))[_0xe5ee('0x42')](handleError(_0x1410fc,null));};exports[_0xe5ee('0x43')]=function(_0x1c78b4,_0x8e03f9){var _0x20a2ed={'raw':!![],'where':{'id':_0x1c78b4[_0xe5ee('0x44')]['id']}},_0x24ea0a={};_0x24ea0a['model']=_[_0xe5ee('0x33')](db[_0xe5ee('0x40')][_0xe5ee('0x2d')]);_0x24ea0a[_0xe5ee('0x32')]=_[_0xe5ee('0x33')](_0x1c78b4[_0xe5ee('0x32')]);_0x24ea0a[_0xe5ee('0x3b')]=_[_0xe5ee('0x34')](_0x24ea0a['model'],_0x24ea0a[_0xe5ee('0x32')]);_0x20a2ed['attributes']=_[_0xe5ee('0x34')](_0x24ea0a[_0xe5ee('0x31')],qs[_0xe5ee('0x36')](_0x1c78b4[_0xe5ee('0x32')][_0xe5ee('0x36')]));_0x20a2ed[_0xe5ee('0x35')]=_0x20a2ed[_0xe5ee('0x35')]['length']?_0x20a2ed[_0xe5ee('0x35')]:_0x24ea0a[_0xe5ee('0x31')];if(_0x1c78b4['query'][_0xe5ee('0x45')]){_0x20a2ed['include']=[{'all':!![]}];}_0x20a2ed=_[_0xe5ee('0x3d')]({},_0x20a2ed,_0x1c78b4[_0xe5ee('0x3f')]);return db[_0xe5ee('0x40')][_0xe5ee('0x46')](_0x20a2ed)['then'](handleEntityNotFound(_0x8e03f9,null))[_0xe5ee('0x27')](respondWithResult(_0x8e03f9,null))['catch'](handleError(_0x8e03f9,null));};exports[_0xe5ee('0x47')]=function(_0x3fd761,_0x295f5d){var _0x36ce1e={'where':{'id':_0x3fd761[_0xe5ee('0x44')]['id']}},_0x546666={};_0x546666[_0xe5ee('0x31')]=_[_0xe5ee('0x33')](db[_0xe5ee('0x40')][_0xe5ee('0x2d')]);_0x36ce1e[_0xe5ee('0x35')]=_[_0xe5ee('0x34')](_0x546666[_0xe5ee('0x31')],qs[_0xe5ee('0x36')](_0x3fd761[_0xe5ee('0x32')]['fields']));_0x36ce1e[_0xe5ee('0x35')]=_0x36ce1e[_0xe5ee('0x35')][_0xe5ee('0x48')]?_0x36ce1e[_0xe5ee('0x35')]:_0x546666[_0xe5ee('0x31')];if(_0x3fd761[_0xe5ee('0x32')]['includeAll']){_0x36ce1e[_0xe5ee('0x49')]=[{'all':!![]}];}_0x36ce1e=_[_0xe5ee('0x3d')]({},_0x36ce1e,_0x3fd761['options']);return db[_0xe5ee('0x40')][_0xe5ee('0x46')](_0x36ce1e)[_0xe5ee('0x27')](handleEntityNotFound(_0x295f5d,null))[_0xe5ee('0x27')](function(_0x3d0633){if(_0x3d0633){var _0x642cf5=_0x3d0633[_0xe5ee('0x4a')]({'plain':!![]});_0x642cf5=qs[_0xe5ee('0x4b')](_0x642cf5,['id',_0xe5ee('0x4c'),_0xe5ee('0x4d')]);_0x3fd761[_0xe5ee('0x4e')]=_[_0xe5ee('0x4b')](_0x3fd761[_0xe5ee('0x4e')],['id',_0xe5ee('0x4c'),_0xe5ee('0x4d')]);return db[_0xe5ee('0x40')][_0xe5ee('0x4f')](_['merge'](_0x642cf5,_0x3fd761[_0xe5ee('0x4e')]),{'include':_0x3fd761[_0xe5ee('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xe5ee('0x27')](respondWithResult(_0x295f5d,0xc9))[_0xe5ee('0x42')](handleError(_0x295f5d,null));};exports[_0xe5ee('0x50')]=function(_0xa954df,_0x4cc33f){if(_0xa954df[_0xe5ee('0x4e')]['id']){delete _0xa954df[_0xe5ee('0x4e')]['id'];}return db['Attachment'][_0xe5ee('0x46')]({'where':{'id':_0xa954df[_0xe5ee('0x44')]['id']}})[_0xe5ee('0x27')](handleEntityNotFound(_0x4cc33f,null))[_0xe5ee('0x27')](saveUpdates(_0xa954df[_0xe5ee('0x4e')],null))['then'](respondWithResult(_0x4cc33f,null))[_0xe5ee('0x42')](handleError(_0x4cc33f,null));};exports[_0xe5ee('0x26')]=function(_0x13c71d,_0x16eb0f){return db['Attachment']['find']({'where':{'id':_0x13c71d['params']['id']}})[_0xe5ee('0x27')](handleEntityNotFound(_0x16eb0f,null))[_0xe5ee('0x27')](removeEntity(_0x16eb0f,null))[_0xe5ee('0x42')](handleError(_0x16eb0f,null));};exports[_0xe5ee('0x4f')]=function(_0x530990,_0x2de9a4,_0x5acc28){_0x530990[_0xe5ee('0x4e')]['name']=_0x530990[_0xe5ee('0x51')][_0xe5ee('0x52')];_0x530990['body'][_0xe5ee('0x53')]=_0x530990[_0xe5ee('0x51')][_0xe5ee('0x54')];_0x530990[_0xe5ee('0x4e')][_0xe5ee('0x2f')]=_0x530990[_0xe5ee('0x51')]['mimetype'];return db[_0xe5ee('0x40')][_0xe5ee('0x4f')](_0x530990[_0xe5ee('0x4e')])['then'](respondWithResult(_0x2de9a4,0xc9))[_0xe5ee('0x42')](handleError(_0x2de9a4,null));};exports[_0xe5ee('0x55')]=function(_0x5b5b4c,_0xfe10c1,_0x33cde9){return db[_0xe5ee('0x40')][_0xe5ee('0x56')]({'where':{'id':_0x5b5b4c[_0xe5ee('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xfe10c1,null))['then'](function(_0xacfedc){if(_0xacfedc){var _0xec5a21=_0xacfedc[_0xe5ee('0x57')]!==null;var _0x622758=path[_0xe5ee('0x58')](config[_0xe5ee('0x59')],'server/files/attachments/');if(_0xec5a21){_0x622758=path['join'](_0x622758,_0xe5ee('0x5a'));}var _0x934da8=path['join'](_0x622758,_0xacfedc[_0xe5ee('0x53')]);return _0xfe10c1['download'](_0x934da8);}})[_0xe5ee('0x42')](handleError(_0xfe10c1,null));}; \ No newline at end of file +var _0x3b3e=['error','name','map','Attachment','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','findAll','catch','params','rawAttributes','length','include','merge','clone','find','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','root','join','offline-chat/','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x3b3e,0x1de));var _0xe3b3=function(_0x473088,_0x2cddfc){_0x473088=_0x473088-0x0;var _0x25a3a8=_0x3b3e[_0x473088];return _0x25a3a8;};'use strict';var emlformat=require(_0xe3b3('0x0'));var rimraf=require(_0xe3b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe3b3('0x2'));var moment=require(_0xe3b3('0x3'));var BPromise=require(_0xe3b3('0x4'));var Mustache=require('mustache');var util=require(_0xe3b3('0x5'));var path=require('path');var sox=require(_0xe3b3('0x6'));var csv=require(_0xe3b3('0x7'));var ejs=require(_0xe3b3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe3b3('0x9'));var squel=require(_0xe3b3('0xa'));var crypto=require(_0xe3b3('0xb'));var jsforce=require(_0xe3b3('0xc'));var deskjs=require(_0xe3b3('0xd'));var toCsv=require(_0xe3b3('0x7'));var querystring=require(_0xe3b3('0xe'));var Papa=require(_0xe3b3('0xf'));var Redis=require(_0xe3b3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe3b3('0x11'));var as=require(_0xe3b3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe3b3('0x13'))(_0xe3b3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe3b3('0x15'))['db'];function respondWithStatusCode(_0x305a12,_0x34afad){_0x34afad=_0x34afad||0xcc;return function(_0x429ef6){if(_0x429ef6){return _0x305a12[_0xe3b3('0x16')](_0x34afad);}return _0x305a12[_0xe3b3('0x17')](_0x34afad)[_0xe3b3('0x18')]();};}function respondWithResult(_0x395f07,_0x23e8c5){_0x23e8c5=_0x23e8c5||0xc8;return function(_0x5d6d69){if(_0x5d6d69){return _0x395f07[_0xe3b3('0x17')](_0x23e8c5)['json'](_0x5d6d69);}};}function respondWithFilteredResult(_0x2bd5f0,_0x4920e9){return function(_0x4d859b){if(_0x4d859b){var _0x1f7eca=typeof _0x4920e9['offset']===_0xe3b3('0x19')&&typeof _0x4920e9[_0xe3b3('0x1a')]===_0xe3b3('0x19');var _0x130ee9=_0x4d859b[_0xe3b3('0x1b')];var _0x198598=_0x1f7eca?0x0:_0x4920e9[_0xe3b3('0x1c')];var _0x33e124=_0x1f7eca?_0x4d859b[_0xe3b3('0x1b')]:_0x4920e9['offset']+_0x4920e9[_0xe3b3('0x1a')];var _0x36c43f;if(_0x33e124>=_0x130ee9){_0x33e124=_0x130ee9;_0x36c43f=0xc8;}else{_0x36c43f=0xce;}_0x2bd5f0['status'](_0x36c43f);return _0x2bd5f0[_0xe3b3('0x1d')](_0xe3b3('0x1e'),_0x198598+'-'+_0x33e124+'/'+_0x130ee9)[_0xe3b3('0x1f')](_0x4d859b);}return null;};}function patchUpdates(_0x13446a){return function(_0x1611e0){try{jsonpatch[_0xe3b3('0x20')](_0x1611e0,_0x13446a,!![]);}catch(_0x51c909){return BPromise[_0xe3b3('0x21')](_0x51c909);}return _0x1611e0[_0xe3b3('0x22')]();};}function saveUpdates(_0x3ea897,_0x1f126a){return function(_0x49f950){if(_0x49f950){return _0x49f950[_0xe3b3('0x23')](_0x3ea897)[_0xe3b3('0x24')](function(_0x38a226){return _0x38a226;});}return null;};}function removeEntity(_0x2fea06,_0x4c9942){return function(_0x15ef13){if(_0x15ef13){return _0x15ef13[_0xe3b3('0x25')]()['then'](function(){_0x2fea06[_0xe3b3('0x17')](0xcc)[_0xe3b3('0x18')]();});}};}function handleEntityNotFound(_0x482d4c,_0x3fe89c){return function(_0x411dd3){if(!_0x411dd3){_0x482d4c['sendStatus'](0x194);}return _0x411dd3;};}function handleError(_0x43f4cb,_0x36e6d7){_0x36e6d7=_0x36e6d7||0x1f4;return function(_0x1f681b){logger[_0xe3b3('0x26')](_0x1f681b['stack']);if(_0x1f681b['name']){delete _0x1f681b[_0xe3b3('0x27')];}_0x43f4cb[_0xe3b3('0x17')](_0x36e6d7)['send'](_0x1f681b);};}exports['index']=function(_0x6f7fb5,_0x11e3d9){var _0x3e0162={},_0x510818={},_0x37711f={'count':0x0,'rows':[]};var _0x90f464=_[_0xe3b3('0x28')](db[_0xe3b3('0x29')]['rawAttributes'],function(_0x64bf89){return{'name':_0x64bf89[_0xe3b3('0x2a')],'type':_0x64bf89[_0xe3b3('0x2b')][_0xe3b3('0x2c')]};});_0x510818[_0xe3b3('0x2d')]=_['map'](_0x90f464,_0xe3b3('0x27'));_0x510818[_0xe3b3('0x2e')]=_[_0xe3b3('0x2f')](_0x6f7fb5[_0xe3b3('0x2e')]);_0x510818[_0xe3b3('0x30')]=_[_0xe3b3('0x31')](_0x510818[_0xe3b3('0x2d')],_0x510818[_0xe3b3('0x2e')]);_0x3e0162[_0xe3b3('0x32')]=_[_0xe3b3('0x31')](_0x510818['model'],qs[_0xe3b3('0x33')](_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x33')]));_0x3e0162[_0xe3b3('0x32')]=_0x3e0162[_0xe3b3('0x32')]['length']?_0x3e0162[_0xe3b3('0x32')]:_0x510818[_0xe3b3('0x2d')];if(!_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x34')]('nolimit')){_0x3e0162[_0xe3b3('0x1a')]=qs['limit'](_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x1a')]);_0x3e0162[_0xe3b3('0x1c')]=qs[_0xe3b3('0x1c')](_0x6f7fb5['query']['offset']);}_0x3e0162[_0xe3b3('0x35')]=qs[_0xe3b3('0x36')](_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x36')]);_0x3e0162['where']=qs[_0xe3b3('0x30')](_[_0xe3b3('0x37')](_0x6f7fb5[_0xe3b3('0x2e')],_0x510818['filters']),_0x90f464);if(_0x6f7fb5['query'][_0xe3b3('0x38')]){_0x3e0162[_0xe3b3('0x39')]=_['merge'](_0x3e0162[_0xe3b3('0x39')],{'$or':_[_0xe3b3('0x28')](_0x90f464,function(_0x53e162){if(_0x53e162[_0xe3b3('0x2b')]!==_0xe3b3('0x3a')){var _0x1be161={};_0x1be161[_0x53e162[_0xe3b3('0x27')]]={'$like':'%'+_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x38')]+'%'};return _0x1be161;}})});}_0x3e0162=_['merge']({},_0x3e0162,_0x6f7fb5[_0xe3b3('0x3b')]);var _0x2fe74d={'where':_0x3e0162[_0xe3b3('0x39')]};return db[_0xe3b3('0x29')][_0xe3b3('0x1b')](_0x2fe74d)[_0xe3b3('0x24')](function(_0x424462){_0x37711f['count']=_0x424462;if(_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x3c')]){_0x3e0162['include']=[{'all':!![]}];}return db['Attachment'][_0xe3b3('0x3d')](_0x3e0162);})[_0xe3b3('0x24')](function(_0x2ad565){_0x37711f['rows']=_0x2ad565;return _0x37711f;})[_0xe3b3('0x24')](respondWithFilteredResult(_0x11e3d9,_0x3e0162))[_0xe3b3('0x3e')](handleError(_0x11e3d9,null));};exports['show']=function(_0x4d1429,_0x1cee83){var _0x1045b2={'raw':!![],'where':{'id':_0x4d1429[_0xe3b3('0x3f')]['id']}},_0x3d1c02={};_0x3d1c02[_0xe3b3('0x2d')]=_['keys'](db[_0xe3b3('0x29')][_0xe3b3('0x40')]);_0x3d1c02['query']=_['keys'](_0x4d1429[_0xe3b3('0x2e')]);_0x3d1c02[_0xe3b3('0x30')]=_[_0xe3b3('0x31')](_0x3d1c02[_0xe3b3('0x2d')],_0x3d1c02[_0xe3b3('0x2e')]);_0x1045b2['attributes']=_[_0xe3b3('0x31')](_0x3d1c02[_0xe3b3('0x2d')],qs['fields'](_0x4d1429[_0xe3b3('0x2e')][_0xe3b3('0x33')]));_0x1045b2[_0xe3b3('0x32')]=_0x1045b2[_0xe3b3('0x32')][_0xe3b3('0x41')]?_0x1045b2['attributes']:_0x3d1c02['model'];if(_0x4d1429[_0xe3b3('0x2e')]['includeAll']){_0x1045b2[_0xe3b3('0x42')]=[{'all':!![]}];}_0x1045b2=_[_0xe3b3('0x43')]({},_0x1045b2,_0x4d1429[_0xe3b3('0x3b')]);return db[_0xe3b3('0x29')]['find'](_0x1045b2)[_0xe3b3('0x24')](handleEntityNotFound(_0x1cee83,null))['then'](respondWithResult(_0x1cee83,null))[_0xe3b3('0x3e')](handleError(_0x1cee83,null));};exports[_0xe3b3('0x44')]=function(_0xcb69e5,_0x454eb6){var _0x213a6c={'where':{'id':_0xcb69e5[_0xe3b3('0x3f')]['id']}},_0x239c7f={};_0x239c7f[_0xe3b3('0x2d')]=_[_0xe3b3('0x2f')](db[_0xe3b3('0x29')][_0xe3b3('0x40')]);_0x213a6c[_0xe3b3('0x32')]=_[_0xe3b3('0x31')](_0x239c7f['model'],qs[_0xe3b3('0x33')](_0xcb69e5[_0xe3b3('0x2e')]['fields']));_0x213a6c['attributes']=_0x213a6c[_0xe3b3('0x32')][_0xe3b3('0x41')]?_0x213a6c[_0xe3b3('0x32')]:_0x239c7f[_0xe3b3('0x2d')];if(_0xcb69e5[_0xe3b3('0x2e')][_0xe3b3('0x3c')]){_0x213a6c[_0xe3b3('0x42')]=[{'all':!![]}];}_0x213a6c=_[_0xe3b3('0x43')]({},_0x213a6c,_0xcb69e5['options']);return db[_0xe3b3('0x29')][_0xe3b3('0x45')](_0x213a6c)[_0xe3b3('0x24')](handleEntityNotFound(_0x454eb6,null))[_0xe3b3('0x24')](function(_0x1e9b0c){if(_0x1e9b0c){var _0xcb4748=_0x1e9b0c[_0xe3b3('0x46')]({'plain':!![]});_0xcb4748=qs[_0xe3b3('0x47')](_0xcb4748,['id',_0xe3b3('0x48'),_0xe3b3('0x49')]);_0xcb69e5[_0xe3b3('0x4a')]=_[_0xe3b3('0x47')](_0xcb69e5[_0xe3b3('0x4a')],['id',_0xe3b3('0x48'),'updatedAt']);return db['Attachment'][_0xe3b3('0x4b')](_[_0xe3b3('0x43')](_0xcb4748,_0xcb69e5[_0xe3b3('0x4a')]),{'include':_0xcb69e5[_0xe3b3('0x2e')][_0xe3b3('0x3c')]?[{'all':!![]}]:undefined});}})[_0xe3b3('0x24')](respondWithResult(_0x454eb6,0xc9))[_0xe3b3('0x3e')](handleError(_0x454eb6,null));};exports[_0xe3b3('0x23')]=function(_0x420eaf,_0x4a7baf){if(_0x420eaf[_0xe3b3('0x4a')]['id']){delete _0x420eaf[_0xe3b3('0x4a')]['id'];}return db['Attachment'][_0xe3b3('0x45')]({'where':{'id':_0x420eaf['params']['id']}})[_0xe3b3('0x24')](handleEntityNotFound(_0x4a7baf,null))[_0xe3b3('0x24')](saveUpdates(_0x420eaf[_0xe3b3('0x4a')],null))[_0xe3b3('0x24')](respondWithResult(_0x4a7baf,null))['catch'](handleError(_0x4a7baf,null));};exports[_0xe3b3('0x25')]=function(_0x593440,_0x2d8191){return db[_0xe3b3('0x29')][_0xe3b3('0x45')]({'where':{'id':_0x593440[_0xe3b3('0x3f')]['id']}})[_0xe3b3('0x24')](handleEntityNotFound(_0x2d8191,null))[_0xe3b3('0x24')](removeEntity(_0x2d8191,null))[_0xe3b3('0x3e')](handleError(_0x2d8191,null));};exports['create']=function(_0x5810c3,_0x57e413,_0xde5991){_0x5810c3['body'][_0xe3b3('0x27')]=_0x5810c3['file'][_0xe3b3('0x4c')];_0x5810c3[_0xe3b3('0x4a')][_0xe3b3('0x4d')]=_0x5810c3[_0xe3b3('0x4e')][_0xe3b3('0x4f')];_0x5810c3[_0xe3b3('0x4a')][_0xe3b3('0x2b')]=_0x5810c3[_0xe3b3('0x4e')][_0xe3b3('0x50')];return db[_0xe3b3('0x29')][_0xe3b3('0x4b')](_0x5810c3[_0xe3b3('0x4a')])['then'](respondWithResult(_0x57e413,0xc9))['catch'](handleError(_0x57e413,null));};exports[_0xe3b3('0x51')]=function(_0x21f055,_0x2f2ee1,_0x3df6cf){return db[_0xe3b3('0x29')][_0xe3b3('0x52')]({'where':{'id':_0x21f055[_0xe3b3('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2f2ee1,null))[_0xe3b3('0x24')](function(_0x4e042d){if(_0x4e042d){var _0x55e8ce=_0x4e042d['ChatOfflineMessageId']!==null;var _0x6c699e=path['join'](config[_0xe3b3('0x53')],'server/files/attachments/');if(_0x55e8ce){_0x6c699e=path[_0xe3b3('0x54')](_0x6c699e,_0xe3b3('0x55'));}var _0x151de0=path[_0xe3b3('0x54')](_0x6c699e,_0x4e042d[_0xe3b3('0x4d')]);return _0x2f2ee1[_0xe3b3('0x51')](_0x151de0);}})[_0xe3b3('0x3e')](handleError(_0x2f2ee1,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 0061d93..0935173 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 _0xf90a=['bluebird','path','rimraf','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x689e24,_0x2c024e){var _0x30ae81=function(_0x4859d0){while(--_0x4859d0){_0x689e24['push'](_0x689e24['shift']());}};_0x30ae81(++_0x2c024e);}(_0xf90a,0xd3));var _0xaf90=function(_0x2b331e,_0x5f35e3){_0x2b331e=_0x2b331e-0x0;var _0x448c90=_0xf90a[_0x2b331e];return _0x448c90;};'use strict';var _=require(_0xaf90('0x0'));var util=require(_0xaf90('0x1'));var logger=require(_0xaf90('0x2'))(_0xaf90('0x3'));var moment=require(_0xaf90('0x4'));var BPromise=require(_0xaf90('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf90('0x6'));var rimraf=require(_0xaf90('0x7'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0xaf90('0x8')]=function(_0x11eb1f,_0x22f77b){return _0x11eb1f[_0xaf90('0x9')](_0xaf90('0xa'),attributes,{'tableName':_0xaf90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb596=['rimraf','./attachment.attributes','exports','define','Attachment','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1ff7e3,_0x53f934){var _0xd3604a=function(_0x18b2ca){while(--_0x18b2ca){_0x1ff7e3['push'](_0x1ff7e3['shift']());}};_0xd3604a(++_0x53f934);}(_0xb596,0x94));var _0x6b59=function(_0x29292d,_0x2680b3){_0x29292d=_0x29292d-0x0;var _0x281f2f=_0xb596[_0x29292d];return _0x281f2f;};'use strict';var _=require(_0x6b59('0x0'));var util=require(_0x6b59('0x1'));var logger=require(_0x6b59('0x2'))(_0x6b59('0x3'));var moment=require(_0x6b59('0x4'));var BPromise=require(_0x6b59('0x5'));var rp=require(_0x6b59('0x6'));var fs=require('fs');var path=require(_0x6b59('0x7'));var rimraf=require(_0x6b59('0x8'));var config=require('../../config/environment');var attributes=require(_0x6b59('0x9'));module[_0x6b59('0xa')]=function(_0x17cd07,_0x1add4b){return _0x17cd07[_0x6b59('0xb')](_0x6b59('0xc'),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 0883a3f..2c55dc7 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 _0x202c=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','Attachment','options','raw','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x202c,0x178));var _0xc202=function(_0x2513ce,_0xf33af6){_0x2513ce=_0x2513ce-0x0;var _0x19e1e7=_0x202c[_0x2513ce];return _0x19e1e7;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('Attachment,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});}exports[_0xc202('0x16')]=function(_0x9620a0){var _0x591ecc=this;return new Promise(function(_0x16ec7c,_0x2c5557){return db[_0xc202('0x17')]['create'](_0x9620a0['body'],{'raw':_0x9620a0[_0xc202('0x18')]?_0x9620a0[_0xc202('0x18')][_0xc202('0x19')]===undefined?!![]:![]:!![]})[_0xc202('0xb')](function(_0x2ae3c1){logger['info']('CreateAttachment',_0x9620a0);logger[_0xc202('0xf')]('CreateAttachment',_0x9620a0,JSON[_0xc202('0x11')](_0x2ae3c1));_0x16ec7c(_0x2ae3c1);})[_0xc202('0x15')](function(_0x56e979){logger['error'](_0xc202('0x16'),_0x56e979['message'],_0x9620a0);_0x2c5557(_0x591ecc[_0xc202('0x12')](0x1f4,_0x56e979[_0xc202('0x14')]));});});}; \ No newline at end of file +var _0x6c50=['error','Attachment,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x117fef,_0x56c508){var _0x1406d9=function(_0x46f36a){while(--_0x46f36a){_0x117fef['push'](_0x117fef['shift']());}};_0x1406d9(++_0x56c508);}(_0x6c50,0xa4));var _0x06c5=function(_0x2d957d,_0x376e55){_0x2d957d=_0x2d957d-0x0;var _0x309f77=_0x6c50[_0x2d957d];return _0x309f77;};'use strict';var _=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var moment=require(_0x06c5('0x2'));var BPromise=require(_0x06c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06c5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06c5('0x5'));var logger=require(_0x06c5('0x6'))(_0x06c5('0x7'));var config=require(_0x06c5('0x8'));var jayson=require(_0x06c5('0x9'));var client=jayson[_0x06c5('0xa')][_0x06c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x427dd6,_0x181c7f,_0x17c636){return new BPromise(function(_0x154b0a,_0x546ae5){return client[_0x06c5('0xc')](_0x427dd6,_0x17c636)[_0x06c5('0xd')](function(_0x3010af){logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,'request\x20sent');logger['debug'](_0x06c5('0xf'),_0x181c7f,'request\x20sent',JSON['stringify'](_0x3010af));if(_0x3010af['error']){if(_0x3010af[_0x06c5('0x10')]['code']===0x1f4){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af[_0x06c5('0x10')]['message']);return _0x546ae5(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af['error']['message']);return _0x154b0a(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}else{logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,_0x06c5('0x13'));_0x154b0a(_0x3010af[_0x06c5('0x14')]['message']);}})[_0x06c5('0x15')](function(_0x9045e6){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x9045e6);_0x546ae5(_0x9045e6);});});}exports[_0x06c5('0x16')]=function(_0x36b9e9){var _0x44d14e=this;return new Promise(function(_0x18a070,_0x1393f5){return db[_0x06c5('0x17')][_0x06c5('0x18')](_0x36b9e9[_0x06c5('0x19')],{'raw':_0x36b9e9[_0x06c5('0x1a')]?_0x36b9e9[_0x06c5('0x1a')][_0x06c5('0x1b')]===undefined?!![]:![]:!![]})[_0x06c5('0xd')](function(_0x26a653){logger['info'](_0x06c5('0x16'),_0x36b9e9);logger[_0x06c5('0x1c')](_0x06c5('0x16'),_0x36b9e9,JSON[_0x06c5('0x1d')](_0x26a653));_0x18a070(_0x26a653);})[_0x06c5('0x15')](function(_0x3c9e49){logger[_0x06c5('0x10')]('CreateAttachment',_0x3c9e49[_0x06c5('0x12')],_0x36b9e9);_0x1393f5(_0x44d14e[_0x06c5('0x10')](0x1f4,_0x3c9e49[_0x06c5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 890bed1..5fce082 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x0b0e,0x187));var _0xe0b0=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0x0b0e[_0xe15270];return _0x1e813b;};'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['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1f9503,_0x8e450b){_0x1f9503=_0x1f9503-0x0;var _0xaab94f=_0x0b0e[_0x1f9503];return _0xaab94f;};'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['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 8da65e0..e130128 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 _0xf01c=['salt','role','disabled','blocked','blockedAt','online','admin','user','agent','add','minutes','clearBlockUser','getLicense','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','name','password'];(function(_0x1f495a,_0x33f28f){var _0x4989f1=function(_0x1e59f4){while(--_0x1e59f4){_0x1f495a['push'](_0x1f495a['shift']());}};_0x4989f1(++_0x33f28f);}(_0xf01c,0x165));var _0xcf01=function(_0x14eeef,_0x2e55bc){_0x14eeef=_0x14eeef-0x0;var _0x53aa66=_0xf01c[_0x14eeef];return _0x53aa66;};'use strict';var passport=require(_0xcf01('0x0'));var LocalStrategy=require(_0xcf01('0x1'))[_0xcf01('0x2')];var moment=require(_0xcf01('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xcf01('0x4'));var util=require(_0xcf01('0x5'));var db=require(_0xcf01('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xcf01('0x7'));var config=require(_0xcf01('0x8'));var logger=require(_0xcf01('0x9'))('api');function isActiveDirectoryConfigured(_0x4db8cb){var _0x309f6b=![];if(typeof _0x4db8cb[_0xcf01('0xa')]!==_0xcf01('0xb')){_0x309f6b=_0x4db8cb['activedirectory'][_0xcf01('0xc')]&&_0x4db8cb['activedirectory']['url']&&_0x4db8cb[_0xcf01('0xa')][_0xcf01('0xd')];}return _0x309f6b;}function adAuthenticate(_0x4059e4,_0x488f37,_0x11a20c){return new BPromise(function(_0x1d29f6,_0x32447f){try{var _0x2cd274=new ActiveDirectory(_0x4059e4);_0x2cd274[_0xcf01('0xe')](_0x488f37,_0x11a20c,function(_0x17ee14,_0x971fc8){if(_0x17ee14){logger[_0xcf01('0xf')](_0xcf01('0x10'),_0x488f37,util['inspect'](_0x17ee14,{'showHidden':![],'depth':null}));_0x32447f(_0xcf01('0x11'));}else if(!_0x971fc8){logger[_0xcf01('0xf')](_0xcf01('0x12'),_0x488f37);_0x32447f(_0xcf01('0x11'));}else{_0x1d29f6(_0x971fc8);}});}catch(_0x26d291){_0x32447f(_0x26d291);}});}function ActiveDirectoryAuthenticate(_0x1716a5,_0x211ccb,_0x3a802b,_0xb8ff1f){var _0x46645d,_0x299858;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xcf01('0x13'),_0x211ccb);return _0xb8ff1f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xcf01('0x14')][_0xcf01('0x15')]({'where':{'id':0x1},'attributes':[_0xcf01('0x16'),_0xcf01('0x17')],'raw':!![]})[_0xcf01('0x18')](function(_0x126df5){_0x46645d=_0x126df5;if(!_0x46645d[_0xcf01('0x16')]){logger[_0xcf01('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x211ccb);throw new Error(_0xcf01('0x11'));}return _0x1716a5['findOne']({'attributes':['id',_0xcf01('0x19'),_0xcf01('0x1a'),_0xcf01('0x1b'),_0xcf01('0x1c'),_0xcf01('0x1d'),_0xcf01('0x1e'),_0xcf01('0x1f'),_0xcf01('0x20')],'where':{'name':_0x211ccb,'role':{'$or':[_0xcf01('0x21'),_0xcf01('0x22'),_0xcf01('0x23')]},'adSsoEnabled':!![]}});})[_0xcf01('0x18')](function(_0x3bfa95){if(!_0x3bfa95||_0x3bfa95&&_0x3bfa95[_0xcf01('0x19')]!==_0x211ccb){throw new Error(_0xcf01('0x11'));}_0x299858=_0x3bfa95;var _0x102cb3=_0x299858['name']+'@'+config['activedirectory'][_0xcf01('0xd')];return adAuthenticate(config[_0xcf01('0xa')],_0x102cb3,_0x3a802b);})[_0xcf01('0x18')](function(_0x26f6a6){if(_0x299858[_0xcf01('0x1d')]){throw new Error(_0xcf01('0x11'));}if(_0x46645d['blockDuration']>0x0){if(_0x299858[_0xcf01('0x1e')]){if(moment(_0x299858[_0xcf01('0x1f')])[_0xcf01('0x24')](_0x46645d['blockDuration'],_0xcf01('0x25'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xcf01('0x26')](_0x299858,0x0,![],null)[_0xcf01('0x18')](function(){return utils[_0xcf01('0x27')](_0x299858);})[_0xcf01('0x18')](function(){return _0xb8ff1f(null,_0x299858);});}else{return utils['getLicense'](_0x299858)[_0xcf01('0x18')](function(){return _0xb8ff1f(null,_0x299858);});}}else{return utils[_0xcf01('0x27')](_0x299858)['then'](function(){return _0xb8ff1f(null,_0x299858);});}})['catch'](function(_0x445829){return _0xb8ff1f(null,![],_0x445829);});}function handleError(_0x4f469d,_0x1c4674,_0x478a5e){return _0x4f469d['status'](_0x1c4674||0x1f4)[_0xcf01('0x28')]({'message':_0x478a5e?_0x478a5e[_0xcf01('0x29')]||_0x478a5e:''});}exports['login']=function(_0x52f325,_0x54fe17,_0x3c3ac7){passport[_0xcf01('0xe')](_0xcf01('0x2a'),function(_0x5dfc55,_0x5b038c,_0x4e89a0){var _0x18de51=_0x5dfc55||_0x4e89a0;if(_0x18de51){return handleError(_0x54fe17,0x191,_0x18de51);}if(!_0x5b038c){return handleError(_0x54fe17,0x194,{'message':_0xcf01('0x2b')});}else{var _0x5be626={'payload':{'id':_0x5b038c['id'],'role':_0x5b038c['role']},'options':{'expiresIn':0x15180}};return authService[_0xcf01('0x2c')](_0x5be626)[_0xcf01('0x18')](function(_0x548d0b){_0x54fe17[_0xcf01('0x2d')]({'id':_0x5b038c['id'],'token':_0x548d0b,'statusCall':'','isAlreadyLogged':_0x5b038c['online']});});}})(_0x52f325,_0x54fe17,_0x3c3ac7);};passport[_0xcf01('0x2e')](_0xcf01('0x2a'),new LocalStrategy({'usernameField':_0xcf01('0x19'),'passwordField':'password'},function(_0x3ae696,_0x12586c,_0x29b916){return ActiveDirectoryAuthenticate(db[_0xcf01('0x2f')],_0x3ae696,_0x12586c,_0x29b916);})); \ No newline at end of file +var _0x38d4=['blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','online','admin','user','agent','disabled','add','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','baseDN','url','domain','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x38d4,0x178));var _0x438d=function(_0x8e8855,_0x41a083){_0x8e8855=_0x8e8855-0x0;var _0x251c78=_0x38d4[_0x8e8855];return _0x251c78;};'use strict';var passport=require(_0x438d('0x0'));var LocalStrategy=require(_0x438d('0x1'))[_0x438d('0x2')];var moment=require(_0x438d('0x3'));var ActiveDirectory=require(_0x438d('0x4'));var BPromise=require(_0x438d('0x5'));var util=require(_0x438d('0x6'));var db=require(_0x438d('0x7'))['db'];var authService=require(_0x438d('0x8'));var utils=require(_0x438d('0x9'));var config=require(_0x438d('0xa'));var logger=require('../../config/logger')(_0x438d('0xb'));function isActiveDirectoryConfigured(_0x2eedc7){var _0x385bda=![];if(typeof _0x2eedc7[_0x438d('0xc')]!=='undefined'){_0x385bda=_0x2eedc7[_0x438d('0xc')][_0x438d('0xd')]&&_0x2eedc7[_0x438d('0xc')][_0x438d('0xe')]&&_0x2eedc7['activedirectory'][_0x438d('0xf')];}return _0x385bda;}function adAuthenticate(_0x5defe8,_0x646a23,_0x310eb1){return new BPromise(function(_0x270ec7,_0x29b082){try{var _0x3f2170=new ActiveDirectory(_0x5defe8);_0x3f2170[_0x438d('0x10')](_0x646a23,_0x310eb1,function(_0x1ae88d,_0x1466e6){if(_0x1ae88d){logger[_0x438d('0x11')]('Error\x20authenticate\x20%s:\x20%s',_0x646a23,util[_0x438d('0x12')](_0x1ae88d,{'showHidden':![],'depth':null}));_0x29b082('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x1466e6){logger[_0x438d('0x11')](_0x438d('0x13'),_0x646a23);_0x29b082(_0x438d('0x14'));}else{_0x270ec7(_0x1466e6);}});}catch(_0x46fbad){_0x29b082(_0x46fbad);}});}function ActiveDirectoryAuthenticate(_0x32b4af,_0x33c7e5,_0xd8e448,_0x41c321){var _0x225da0,_0x4719a0;if(!isActiveDirectoryConfigured(config)){logger[_0x438d('0x11')](_0x438d('0x15'),_0x33c7e5);return _0x41c321(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x438d('0x16')][_0x438d('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x438d('0x18')],'raw':!![]})[_0x438d('0x19')](function(_0x2b80bb){_0x225da0=_0x2b80bb;if(!_0x225da0['adSsoEnabled']){logger[_0x438d('0x11')](_0x438d('0x1a'),_0x33c7e5);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x32b4af[_0x438d('0x17')]({'attributes':['id',_0x438d('0x1b'),_0x438d('0x1c'),_0x438d('0x1d'),_0x438d('0x1e'),'disabled',_0x438d('0x1f'),_0x438d('0x20'),_0x438d('0x21')],'where':{'name':_0x33c7e5,'role':{'$or':[_0x438d('0x22'),_0x438d('0x23'),_0x438d('0x24')]},'adSsoEnabled':!![]}});})[_0x438d('0x19')](function(_0x56aaee){if(!_0x56aaee||_0x56aaee&&_0x56aaee[_0x438d('0x1b')]!==_0x33c7e5){throw new Error(_0x438d('0x14'));}_0x4719a0=_0x56aaee;var _0x5a1b31=_0x4719a0[_0x438d('0x1b')]+'@'+config[_0x438d('0xc')]['domain'];return adAuthenticate(config[_0x438d('0xc')],_0x5a1b31,_0xd8e448);})[_0x438d('0x19')](function(_0x26dbc5){if(_0x4719a0[_0x438d('0x25')]){throw new Error(_0x438d('0x14'));}if(_0x225da0['blockDuration']>0x0){if(_0x4719a0[_0x438d('0x1f')]){if(moment(_0x4719a0[_0x438d('0x20')])[_0x438d('0x26')](_0x225da0[_0x438d('0x18')],'minutes')>moment()){throw new Error(_0x438d('0x14'));}return utils[_0x438d('0x27')](_0x4719a0,0x0,![],null)[_0x438d('0x19')](function(){return utils['getLicense'](_0x4719a0);})[_0x438d('0x19')](function(){return _0x41c321(null,_0x4719a0);});}else{return utils[_0x438d('0x28')](_0x4719a0)['then'](function(){return _0x41c321(null,_0x4719a0);});}}else{return utils[_0x438d('0x28')](_0x4719a0)['then'](function(){return _0x41c321(null,_0x4719a0);});}})[_0x438d('0x29')](function(_0x31d132){return _0x41c321(null,![],_0x31d132);});}function handleError(_0x9e5353,_0x5c7c5b,_0x2a8ffd){return _0x9e5353[_0x438d('0x2a')](_0x5c7c5b||0x1f4)[_0x438d('0x2b')]({'message':_0x2a8ffd?_0x2a8ffd[_0x438d('0x2c')]||_0x2a8ffd:''});}exports[_0x438d('0x2d')]=function(_0x123dd1,_0x337db2,_0x2e0a39){passport[_0x438d('0x10')](_0x438d('0x2e'),function(_0x437e14,_0x2acfc5,_0x4fff4a){var _0x42352c=_0x437e14||_0x4fff4a;if(_0x42352c){return handleError(_0x337db2,0x191,_0x42352c);}if(!_0x2acfc5){return handleError(_0x337db2,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5977ce={'payload':{'id':_0x2acfc5['id'],'role':_0x2acfc5[_0x438d('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0x438d('0x2f')](_0x5977ce)[_0x438d('0x19')](function(_0x1ad634){_0x337db2['json']({'id':_0x2acfc5['id'],'token':_0x1ad634,'statusCall':'','isAlreadyLogged':_0x2acfc5[_0x438d('0x21')]});});}})(_0x123dd1,_0x337db2,_0x2e0a39);};passport[_0x438d('0x30')](_0x438d('0x2e'),new LocalStrategy({'usernameField':_0x438d('0x1b'),'passwordField':_0x438d('0x1c')},function(_0x32d89a,_0xb202ce,_0x3747bd){return ActiveDirectoryAuthenticate(db[_0x438d('0x31')],_0x32d89a,_0xb202ce,_0x3747bd);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 35dfa1c..f6ebfea 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 _0x09c1=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x19c978,_0x451c13){var _0x1eab29=function(_0x382ac1){while(--_0x382ac1){_0x19c978['push'](_0x19c978['shift']());}};_0x1eab29(++_0x451c13);}(_0x09c1,0xa2));var _0x109c=function(_0x13ea36,_0x2805ad){_0x13ea36=_0x13ea36-0x0;var _0x312066=_0x09c1[_0x13ea36];return _0x312066;};'use strict';var express=require(_0x109c('0x0'));var router=express[_0x109c('0x1')]();var controller=require(_0x109c('0x2'));router[_0x109c('0x3')]('/',controller[_0x109c('0x4')]);module[_0x109c('0x5')]=router; \ No newline at end of file +var _0x0a29=['login','exports','./authActiveDirectory.controller'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x0a29,0x12b));var _0x90a2=function(_0x510e77,_0x3bcec5){_0x510e77=_0x510e77-0x0;var _0x46702f=_0x0a29[_0x510e77];return _0x46702f;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x90a2('0x0'));router['post']('/',controller[_0x90a2('0x1')]);module[_0x90a2('0x2')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 7697ae0..307fa13 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x7a54,0x106));var _0x47a5=function(_0x303787,_0x487d30){_0x303787=_0x303787-0x0;var _0x3d5c66=_0x7a54[_0x303787];return _0x3d5c66;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x7a54,0x106));var _0x47a5=function(_0x32857c,_0x1d520d){_0x32857c=_0x32857c-0x0;var _0x2b47fc=_0x7a54[_0x32857c];return _0x2b47fc;};'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 1a1f137..e1eacbc 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 _0x846c=['exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware','setTokenCookie'];(function(_0x5e1765,_0xf1b6fa){var _0x1a284d=function(_0x2518bf){while(--_0x2518bf){_0x5e1765['push'](_0x5e1765['shift']());}};_0x1a284d(++_0xf1b6fa);}(_0x846c,0xf1));var _0xc846=function(_0x156af3,_0x49d4d4){_0x156af3=_0x156af3-0x0;var _0x5e818a=_0x846c[_0x156af3];return _0x5e818a;};'use strict';var express=require(_0xc846('0x0'));var passport=require(_0xc846('0x1'));var router=express[_0xc846('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xc846('0x3'));var authService=require(_0xc846('0x4'));router['get']('/',controller['login']);router[_0xc846('0x5')]('/callback',controller[_0xc846('0x6')],authService[_0xc846('0x7')],userController['login'],authService[_0xc846('0x8')]);module[_0xc846('0x9')]=router; \ No newline at end of file +var _0x45a8=['/callback','callback','isMiddleware','setTokenCookie','exports','express','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x34c542,_0x220b05){var _0x5b9ec2=function(_0x51dc4f){while(--_0x51dc4f){_0x34c542['push'](_0x34c542['shift']());}};_0x5b9ec2(++_0x220b05);}(_0x45a8,0x9f));var _0x845a=function(_0x16bbf5,_0x407600){_0x16bbf5=_0x16bbf5-0x0;var _0x4c60e1=_0x45a8[_0x16bbf5];return _0x4c60e1;};'use strict';var express=require(_0x845a('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x845a('0x1'));var userController=require(_0x845a('0x2'));var authService=require(_0x845a('0x3'));router[_0x845a('0x4')]('/',controller[_0x845a('0x5')]);router[_0x845a('0x4')](_0x845a('0x6'),controller[_0x845a('0x7')],authService[_0x845a('0x8')],userController['login'],authService[_0x845a('0x9')]);module[_0x845a('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index be78568..0584a54 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 _0x9208=['SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','loginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x9208,0x82));var _0x8920=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9208[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var passport=require(_0x8920('0x0'));var LocalStrategy=require(_0x8920('0x1'))[_0x8920('0x2')];var jayson=require(_0x8920('0x3'));var _=require(_0x8920('0x4'));var rs=require(_0x8920('0x5'));var moment=require(_0x8920('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x8920('0x7'));var utils=require(_0x8920('0x8'));var client=jayson['client'][_0x8920('0x9')]({'port':0x232b});function localAuthenticate(_0x145076,_0x46425d,_0x5da5e3,_0x9070e5){var _0x2f2bf9,_0x4283ac;return db[_0x8920('0xa')][_0x8920('0xb')]({'where':{'id':0x1},'attributes':[_0x8920('0xc'),_0x8920('0xd')],'raw':!![]})['then'](function(_0x179ab4){_0x2f2bf9=_0x179ab4;return _0x145076[_0x8920('0xb')]({'attributes':['id',_0x8920('0xe'),_0x8920('0xf'),_0x8920('0x10'),_0x8920('0x11'),_0x8920('0x12'),_0x8920('0x13'),_0x8920('0x14'),'loginAttempts'],'where':{'name':_0x46425d,'role':{'$or':[_0x8920('0x15'),_0x8920('0x16'),_0x8920('0x17')]}}});})['then'](function(_0x4a180f){if(!_0x4a180f||_0x4a180f&&_0x4a180f['name']!==_0x46425d){throw new Error(_0x8920('0x18'));}else{_0x4283ac=_0x4a180f;return _0x4283ac;}})[_0x8920('0x19')](function(){_0x4283ac['authenticate'](_0x5da5e3,function(_0xc864ba,_0x54fe31){var _0x533b02=_0x4283ac[_0x8920('0x1a')]+0x1;if(_0xc864ba){return _0x9070e5(_0xc864ba);}else if(!_0x54fe31){if(_0x4283ac[_0x8920('0x12')]){return _0x9070e5(null,![],{'message':_0x8920('0x18')});}else if(_0x2f2bf9[_0x8920('0xc')]>0x0){if(_0x4283ac[_0x8920('0x13')]){if(_0x2f2bf9[_0x8920('0xd')]>0x0){if(moment(_0x4283ac[_0x8920('0x14')])[_0x8920('0x1b')](_0x2f2bf9[_0x8920('0xd')],_0x8920('0x1c'))>moment()){return _0x9070e5(null,![],{'message':_0x8920('0x18')});}else{return utils[_0x8920('0x1d')](_0x4283ac,_0x533b02,![],null)[_0x8920('0x19')](function(){return _0x9070e5(null,![],{'message':_0x8920('0x18')});});}}else{return _0x9070e5(null,![],{'message':_0x8920('0x18')});}}else{if(_0x533b02>=_0x2f2bf9['allowedLoginAttempts']){return utils[_0x8920('0x1d')](_0x4283ac,0x0,!![],moment())[_0x8920('0x19')](function(){return _0x9070e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x8920('0x1d')](_0x4283ac,_0x533b02,![],null)['then'](function(){return _0x9070e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x9070e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4283ac[_0x8920('0x12')]){return _0x9070e5(null,![],{'message':_0x8920('0x18')});}else if(_0x2f2bf9['allowedLoginAttempts']>0x0){if(_0x4283ac[_0x8920('0x13')]){if(_0x2f2bf9[_0x8920('0xd')]>0x0){if(moment(_0x4283ac['blockedAt'])[_0x8920('0x1b')](_0x2f2bf9[_0x8920('0xd')],_0x8920('0x1c'))>moment()){return _0x9070e5(null,![],{'message':_0x8920('0x18')});}else{return utils[_0x8920('0x1d')](_0x4283ac,0x0,![],null)['then'](function(){return utils[_0x8920('0x1e')](_0x4283ac);})[_0x8920('0x19')](function(){return _0x9070e5(null,_0x4283ac);});}}else{return _0x9070e5(null,![],{'message':_0x8920('0x18')});}}else{return utils[_0x8920('0x1d')](_0x4283ac,0x0,![],null)[_0x8920('0x19')](function(){return utils[_0x8920('0x1e')](_0x4283ac);})[_0x8920('0x19')](function(){return _0x9070e5(null,_0x4283ac);})[_0x8920('0x1f')](function(_0x543c78){return _0x9070e5(null,![],_0x543c78);});}}else{if(_0x4283ac[_0x8920('0x13')]){return _0x9070e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8920('0x1e')](_0x4283ac)['then'](function(){return _0x9070e5(null,_0x4283ac);});}}}});})[_0x8920('0x1f')](function(_0x5aec18){return _0x9070e5(null,![],_0x5aec18);});}function sendServiceMail(_0x2ffeb6){return db[_0x8920('0x20')][_0x8920('0x21')]({'where':{'service':!![]},'attributes':['id',_0x8920('0xe'),_0x8920('0x22')],'include':[{'model':db[_0x8920('0x23')],'as':_0x8920('0x24'),'include':[{'model':db['CloudProvider'],'as':_0x8920('0x25')}]}]})[_0x8920('0x19')](function(_0x1eafa4){if(!_0x1eafa4){throw new Error(_0x8920('0x26'));}var _0x141e1f=_0x1eafa4[_0x8920('0x27')]();var _0x47a258={'account':_0x141e1f,'message':_[_0x8920('0x28')]({'from':util[_0x8920('0x29')](_0x8920('0x2a'),_0x1eafa4[_0x8920('0xe')],_0x1eafa4['email']||_0x1eafa4['Smtp'][_0x8920('0x16')])},_0x2ffeb6)};return client[_0x8920('0x2b')](_0x8920('0x2c'),_0x47a258);})[_0x8920('0x19')](function(_0x46a64a){if(_0x46a64a[_0x8920('0x2d')]){throw new Error(util[_0x8920('0x29')](_0x8920('0x2e'),_0x46a64a[_0x8920('0x2d')][_0x8920('0x2f')]||JSON[_0x8920('0x30')](_0x46a64a[_0x8920('0x2d')])));}return!![];});}function handleError(_0x27de34,_0x44a82c,_0x416e66){return _0x27de34[_0x8920('0x31')](_0x44a82c||0x1f4)[_0x8920('0x32')]({'message':_0x416e66?_0x416e66[_0x8920('0x2f')]||_0x416e66:''});}exports[_0x8920('0x33')]=function(_0x4bbff5,_0xe68154,_0x4477e1){passport[_0x8920('0x34')](_0x8920('0x35'),function(_0x47e72d,_0x318e9a,_0x44fb70){var _0x1cfbf1=_0x47e72d||_0x44fb70;if(_0x1cfbf1){return handleError(_0xe68154,0x191,_0x1cfbf1);}if(!_0x318e9a){return handleError(_0xe68154,0x194,{'message':_0x8920('0x36')});}else{var _0x47a377={'payload':{'id':_0x318e9a['id'],'role':_0x318e9a[_0x8920('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x8920('0x37')](_0x47a377)[_0x8920('0x19')](function(_0x1254bc){_0xe68154['json']({'id':_0x318e9a['id'],'token':_0x1254bc,'statusCall':'','isAlreadyLogged':_0x318e9a['online']});});}})(_0x4bbff5,_0xe68154,_0x4477e1);};exports[_0x8920('0x38')]=function(_0x41e421,_0x246d7f){if(!_0x41e421[_0x8920('0x39')][_0x8920('0x22')]){return handleError(_0x246d7f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x133ce7=rs[_0x8920('0x3a')]();_0x41e421[_0x8920('0x39')][_0x8920('0x22')]=_0x41e421[_0x8920('0x39')][_0x8920('0x22')][_0x8920('0x3b')]()[_0x8920('0x3c')]();var _0x1fcb1b;return db[_0x8920('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x8920('0xc'),_0x8920('0xd')],'raw':!![]})[_0x8920('0x19')](function(_0x249467){_0x1fcb1b=_0x249467;return db[_0x8920('0x3d')][_0x8920('0x21')]({'where':{'email':_0x41e421[_0x8920('0x39')]['email']}});})[_0x8920('0x19')](function(_0x2eee1a){if(!_0x2eee1a){throw new Error(_0x8920('0x3e'));}if(_0x2eee1a[_0x8920('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2eee1a[_0x8920('0x13')]){if(moment(_0x2eee1a[_0x8920('0x14')])[_0x8920('0x1b')](_0x1fcb1b[_0x8920('0xd')],'minutes')>moment()){throw new Error(_0x8920('0x3f'));}else{_0x2eee1a['blocked']=![];_0x2eee1a[_0x8920('0x14')]=null;}}_0x2eee1a['resetPasswordToken']=_0x133ce7;_0x2eee1a[_0x8920('0x40')]=Date[_0x8920('0x41')]()+0x36ee80;return _0x2eee1a[_0x8920('0x42')]();})[_0x8920('0x19')](function(){return sendServiceMail({'to':_0x41e421[_0x8920('0x39')]['email'],'subject':_0x8920('0x43'),'text':_0x8920('0x44')+_0x8920('0x45')+_0x8920('0x46')+_0x41e421[_0x8920('0x47')][_0x8920('0x48')]+_0x8920('0x49')+_0x133ce7+'\x0a\x0a'+_0x8920('0x4a')});})[_0x8920('0x19')](function(){_0x246d7f[_0x8920('0x31')](0xc8)['send']({'message':_0x8920('0x4b')});})['catch'](function(_0x3f85f7){return handleError(_0x246d7f,0x1f4,_0x3f85f7);});};exports[_0x8920('0x4c')]=function(_0x1d4929,_0x503e33){return db[_0x8920('0x3d')]['find']({'where':{'resetPasswordToken':_0x1d4929[_0x8920('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date[_0x8920('0x41')]()}}})[_0x8920('0x19')](function(_0x24de9e){if(!_0x24de9e){throw new Error(_0x8920('0x4e'));}return db[_0x8920('0xa')][_0x8920('0xb')]({'attributes':['id',_0x8920('0x4f'),_0x8920('0x50'),_0x8920('0x51')]})[_0x8920('0x19')](function(_0x21da02){if(_0x21da02['securePassword'])authService[_0x8920('0x52')](_0x1d4929[_0x8920('0x39')][_0x8920('0xf')]);if(!_0x21da02[_0x8920('0x50')]||!_0x24de9e[_0x8920('0x53')])return _0x24de9e;authService[_0x8920('0x54')](_0x1d4929[_0x8920('0x39')][_0x8920('0xf')],_0x24de9e['previousPasswords'],_0x21da02[_0x8920('0x51')]);return _0x24de9e;})[_0x8920('0x19')](function(){_0x24de9e[_0x8920('0xf')]=_0x1d4929[_0x8920('0x39')][_0x8920('0xf')];_0x24de9e[_0x8920('0x55')]=null;_0x24de9e[_0x8920('0x40')]=null;return _0x24de9e[_0x8920('0x42')]();});})[_0x8920('0x19')](function(){_0x503e33[_0x8920('0x31')](0xc8)[_0x8920('0x32')]({'message':_0x8920('0x56')});})[_0x8920('0x1f')](function(_0x2a1f1f){return handleError(_0x503e33,0x1f4,_0x2a1f1f);});};passport[_0x8920('0x57')](_0x8920('0x35'),new LocalStrategy({'usernameField':_0x8920('0xe'),'passwordField':_0x8920('0xf')},function(_0x382b7e,_0x40dac7,_0x4dcfff){return localAuthenticate(db[_0x8920('0x3d')],_0x382b7e,_0x40dac7,_0x4dcfff);})); \ No newline at end of file +var _0xeb33=['Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','passwordHistoryLimit','securePassword','validatePasswordPattern','password','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','local-login','util','passport','passport-local','jayson/promise','lodash','moment','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','message','stringify','error','status','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'];(function(_0xf22003,_0x4daaad){var _0x1af727=function(_0x99db67){while(--_0x99db67){_0xf22003['push'](_0xf22003['shift']());}};_0x1af727(++_0x4daaad);}(_0xeb33,0xb4));var _0x3eb3=function(_0x1585a3,_0x315848){_0x1585a3=_0x1585a3-0x0;var _0x2fc3aa=_0xeb33[_0x1585a3];return _0x2fc3aa;};'use strict';var util=require(_0x3eb3('0x0'));var passport=require(_0x3eb3('0x1'));var LocalStrategy=require(_0x3eb3('0x2'))['Strategy'];var jayson=require(_0x3eb3('0x3'));var _=require(_0x3eb3('0x4'));var rs=require('randomstring');var moment=require(_0x3eb3('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0x3eb3('0x6')][_0x3eb3('0x7')]({'port':0x232b});function localAuthenticate(_0x1e359b,_0x2864c9,_0x4386ad,_0x556cfa){var _0xf46557,_0x2702e5;return db[_0x3eb3('0x8')][_0x3eb3('0x9')]({'where':{'id':0x1},'attributes':[_0x3eb3('0xa'),_0x3eb3('0xb')],'raw':!![]})['then'](function(_0x2c1aaa){_0xf46557=_0x2c1aaa;return _0x1e359b['findOne']({'attributes':['id',_0x3eb3('0xc'),'password',_0x3eb3('0xd'),_0x3eb3('0xe'),_0x3eb3('0xf'),_0x3eb3('0x10'),_0x3eb3('0x11'),_0x3eb3('0x12')],'where':{'name':_0x2864c9,'role':{'$or':[_0x3eb3('0x13'),'user',_0x3eb3('0x14')]}}});})[_0x3eb3('0x15')](function(_0x516154){if(!_0x516154||_0x516154&&_0x516154[_0x3eb3('0xc')]!==_0x2864c9){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2702e5=_0x516154;return _0x2702e5;}})[_0x3eb3('0x15')](function(){_0x2702e5[_0x3eb3('0x16')](_0x4386ad,function(_0x5dac93,_0xbdbf78){var _0x2b280b=_0x2702e5['loginAttempts']+0x1;if(_0x5dac93){return _0x556cfa(_0x5dac93);}else if(!_0xbdbf78){if(_0x2702e5[_0x3eb3('0xf')]){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}else if(_0xf46557[_0x3eb3('0xa')]>0x0){if(_0x2702e5[_0x3eb3('0x10')]){if(_0xf46557[_0x3eb3('0xb')]>0x0){if(moment(_0x2702e5[_0x3eb3('0x11')])[_0x3eb3('0x18')](_0xf46557[_0x3eb3('0xb')],_0x3eb3('0x19'))>moment()){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}else{return utils[_0x3eb3('0x1a')](_0x2702e5,_0x2b280b,![],null)[_0x3eb3('0x15')](function(){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});});}}else{return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}}else{if(_0x2b280b>=_0xf46557[_0x3eb3('0xa')]){return utils[_0x3eb3('0x1a')](_0x2702e5,0x0,!![],moment())[_0x3eb3('0x15')](function(){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});});}else{return utils['clearBlockUser'](_0x2702e5,_0x2b280b,![],null)[_0x3eb3('0x15')](function(){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});});}}}else{return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}}else{if(_0x2702e5[_0x3eb3('0xf')]){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}else if(_0xf46557[_0x3eb3('0xa')]>0x0){if(_0x2702e5[_0x3eb3('0x10')]){if(_0xf46557[_0x3eb3('0xb')]>0x0){if(moment(_0x2702e5['blockedAt'])[_0x3eb3('0x18')](_0xf46557[_0x3eb3('0xb')],_0x3eb3('0x19'))>moment()){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}else{return utils[_0x3eb3('0x1a')](_0x2702e5,0x0,![],null)[_0x3eb3('0x15')](function(){return utils[_0x3eb3('0x1b')](_0x2702e5);})[_0x3eb3('0x15')](function(){return _0x556cfa(null,_0x2702e5);});}}else{return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}}else{return utils[_0x3eb3('0x1a')](_0x2702e5,0x0,![],null)[_0x3eb3('0x15')](function(){return utils[_0x3eb3('0x1b')](_0x2702e5);})[_0x3eb3('0x15')](function(){return _0x556cfa(null,_0x2702e5);})[_0x3eb3('0x1c')](function(_0x5ddbbe){return _0x556cfa(null,![],_0x5ddbbe);});}}else{if(_0x2702e5[_0x3eb3('0x10')]){return _0x556cfa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3eb3('0x1b')](_0x2702e5)[_0x3eb3('0x15')](function(){return _0x556cfa(null,_0x2702e5);});}}}});})[_0x3eb3('0x1c')](function(_0x107265){return _0x556cfa(null,![],_0x107265);});}function sendServiceMail(_0x17ab7b){return db[_0x3eb3('0x1d')][_0x3eb3('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x3eb3('0xc'),_0x3eb3('0x1f')],'include':[{'model':db[_0x3eb3('0x20')],'as':_0x3eb3('0x21'),'include':[{'model':db[_0x3eb3('0x22')],'as':'CloudProvider'}]}]})['then'](function(_0x324c8a){if(!_0x324c8a){throw new Error(_0x3eb3('0x23'));}var _0x555fce=_0x324c8a['getSmtpOptions']();var _0x799a17={'account':_0x555fce,'message':_[_0x3eb3('0x24')]({'from':util[_0x3eb3('0x25')](_0x3eb3('0x26'),_0x324c8a[_0x3eb3('0xc')],_0x324c8a['email']||_0x324c8a[_0x3eb3('0x21')]['user'])},_0x17ab7b)};return client[_0x3eb3('0x27')]('SendMail',_0x799a17);})[_0x3eb3('0x15')](function(_0x5b455c){if(_0x5b455c['error']){throw new Error(util[_0x3eb3('0x25')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5b455c['error'][_0x3eb3('0x28')]||JSON[_0x3eb3('0x29')](_0x5b455c[_0x3eb3('0x2a')])));}return!![];});}function handleError(_0x2cb51b,_0xd81f5a,_0x2534d0){return _0x2cb51b[_0x3eb3('0x2b')](_0xd81f5a||0x1f4)['send']({'message':_0x2534d0?_0x2534d0['message']||_0x2534d0:''});}exports[_0x3eb3('0x2c')]=function(_0x27c652,_0x761dde,_0x51550c){passport[_0x3eb3('0x16')]('local-login',function(_0x109e90,_0x2c3520,_0x14ad59){var _0x31f000=_0x109e90||_0x14ad59;if(_0x31f000){return handleError(_0x761dde,0x191,_0x31f000);}if(!_0x2c3520){return handleError(_0x761dde,0x194,{'message':_0x3eb3('0x2d')});}else{var _0x214453={'payload':{'id':_0x2c3520['id'],'role':_0x2c3520[_0x3eb3('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x214453)[_0x3eb3('0x15')](function(_0x108907){_0x761dde[_0x3eb3('0x2e')]({'id':_0x2c3520['id'],'token':_0x108907,'statusCall':'','isAlreadyLogged':_0x2c3520['online']});});}})(_0x27c652,_0x761dde,_0x51550c);};exports[_0x3eb3('0x2f')]=function(_0x4e872a,_0x1b4abb){if(!_0x4e872a['body'][_0x3eb3('0x1f')]){return handleError(_0x1b4abb,0x1f4,{'message':_0x3eb3('0x30')});}var _0x239f62=rs[_0x3eb3('0x31')]();_0x4e872a[_0x3eb3('0x32')][_0x3eb3('0x1f')]=_0x4e872a['body']['email']['trim']()[_0x3eb3('0x33')]();var _0x42b68c;return db[_0x3eb3('0x8')][_0x3eb3('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x3eb3('0xb')],'raw':!![]})[_0x3eb3('0x15')](function(_0x401357){_0x42b68c=_0x401357;return db[_0x3eb3('0x34')]['find']({'where':{'email':_0x4e872a[_0x3eb3('0x32')][_0x3eb3('0x1f')]}});})[_0x3eb3('0x15')](function(_0x49a2f4){if(!_0x49a2f4){throw new Error(_0x3eb3('0x35'));}if(_0x49a2f4['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x49a2f4[_0x3eb3('0x10')]){if(moment(_0x49a2f4[_0x3eb3('0x11')])['add'](_0x42b68c[_0x3eb3('0xb')],_0x3eb3('0x19'))>moment()){throw new Error(_0x3eb3('0x36'));}else{_0x49a2f4[_0x3eb3('0x10')]=![];_0x49a2f4[_0x3eb3('0x11')]=null;}}_0x49a2f4[_0x3eb3('0x37')]=_0x239f62;_0x49a2f4[_0x3eb3('0x38')]=Date['now']()+0x36ee80;return _0x49a2f4[_0x3eb3('0x39')]();})[_0x3eb3('0x15')](function(){return sendServiceMail({'to':_0x4e872a[_0x3eb3('0x32')][_0x3eb3('0x1f')],'subject':_0x3eb3('0x3a'),'text':_0x3eb3('0x3b')+_0x3eb3('0x3c')+_0x3eb3('0x3d')+_0x4e872a[_0x3eb3('0x3e')][_0x3eb3('0x3f')]+_0x3eb3('0x40')+_0x239f62+'\x0a\x0a'+_0x3eb3('0x41')});})[_0x3eb3('0x15')](function(){_0x1b4abb[_0x3eb3('0x2b')](0xc8)[_0x3eb3('0x42')]({'message':_0x3eb3('0x43')});})['catch'](function(_0x2478a8){return handleError(_0x1b4abb,0x1f4,_0x2478a8);});};exports[_0x3eb3('0x44')]=function(_0x49e0f8,_0x459707){return db[_0x3eb3('0x34')][_0x3eb3('0x1e')]({'where':{'resetPasswordToken':_0x49e0f8[_0x3eb3('0x45')][_0x3eb3('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x2075f4){if(!_0x2075f4){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0x3eb3('0x47')]})[_0x3eb3('0x15')](function(_0x216903){if(_0x216903[_0x3eb3('0x48')])authService[_0x3eb3('0x49')](_0x49e0f8[_0x3eb3('0x32')][_0x3eb3('0x4a')]);if(!_0x216903[_0x3eb3('0x4b')]||!_0x2075f4[_0x3eb3('0x4c')])return _0x2075f4;authService[_0x3eb3('0x4d')](_0x49e0f8[_0x3eb3('0x32')]['password'],_0x2075f4[_0x3eb3('0x4c')],_0x216903[_0x3eb3('0x47')]);return _0x2075f4;})[_0x3eb3('0x15')](function(){_0x2075f4[_0x3eb3('0x4a')]=_0x49e0f8[_0x3eb3('0x32')][_0x3eb3('0x4a')];_0x2075f4['resetPasswordToken']=null;_0x2075f4[_0x3eb3('0x38')]=null;return _0x2075f4[_0x3eb3('0x39')]();});})['then'](function(){_0x459707[_0x3eb3('0x2b')](0xc8)[_0x3eb3('0x42')]({'message':_0x3eb3('0x4e')});})['catch'](function(_0x38a022){return handleError(_0x459707,0x1f4,_0x38a022);});};passport['use'](_0x3eb3('0x4f'),new LocalStrategy({'usernameField':'name','passwordField':_0x3eb3('0x4a')},function(_0x357c74,_0x14f9e7,_0x1f4a9d){return localAuthenticate(db[_0x3eb3('0x34')],_0x357c74,_0x14f9e7,_0x1f4a9d);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 92df2b2..e5626ac 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 _0xf9b2=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0xdb2e3c,_0x2f4644){var _0x55e38d=function(_0x46ed7b){while(--_0x46ed7b){_0xdb2e3c['push'](_0xdb2e3c['shift']());}};_0x55e38d(++_0x2f4644);}(_0xf9b2,0x198));var _0x2f9b=function(_0x27c754,_0x488254){_0x27c754=_0x27c754-0x0;var _0x245d47=_0xf9b2[_0x27c754];return _0x245d47;};'use strict';var express=require(_0x2f9b('0x0'));var router=express[_0x2f9b('0x1')]();var controller=require(_0x2f9b('0x2'));router[_0x2f9b('0x3')]('/',controller[_0x2f9b('0x4')]);router[_0x2f9b('0x3')](_0x2f9b('0x5'),controller[_0x2f9b('0x6')]);router['post'](_0x2f9b('0x7'),controller[_0x2f9b('0x8')]);module[_0x2f9b('0x9')]=router; \ No newline at end of file +var _0x4f9d=['post','login','forgot','reset','exports','Router'];(function(_0x641900,_0x346ff0){var _0x1e2277=function(_0x27a3f6){while(--_0x27a3f6){_0x641900['push'](_0x641900['shift']());}};_0x1e2277(++_0x346ff0);}(_0x4f9d,0xef));var _0xd4f9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4f9d[_0x14add3];return _0x4a174f;};'use strict';var express=require('express');var router=express[_0xd4f9('0x0')]();var controller=require('./authLocal.controller');router[_0xd4f9('0x1')]('/',controller[_0xd4f9('0x2')]);router[_0xd4f9('0x1')]('/forgot',controller[_0xd4f9('0x3')]);router['post']('/reset/:token',controller[_0xd4f9('0x4')]);module[_0xd4f9('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 33cb5e3..80d1a4d 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 _0x8cbd=['BOOLEAN','sequelize'];(function(_0x4f1896,_0xb74faa){var _0x188cc3=function(_0x3e6b2b){while(--_0x3e6b2b){_0x4f1896['push'](_0x4f1896['shift']());}};_0x188cc3(++_0xb74faa);}(_0x8cbd,0x1bb));var _0xd8cb=function(_0x22490e,_0x4935bd){_0x22490e=_0x22490e-0x0;var _0x5b6459=_0x8cbd[_0x22490e];return _0x5b6459;};'use strict';var Sequelize=require(_0xd8cb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xd8cb('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x1fde=['BOOLEAN','sequelize','exports','STRING'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x1fde,0x1a1));var _0xe1fd=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x1fde[_0xa45395];return _0x3c83d2;};'use strict';var Sequelize=require(_0xe1fd('0x0'));module[_0xe1fd('0x1')]={'name':{'type':Sequelize[_0xe1fd('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xe1fd('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xe1fd('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 7eda47f..536477a 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 _0x7a69=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','map','rawAttributes','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','Automation','include','catch','show','params','includeAll','find','create','body','addConditions','Condition','ids','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x2f0178,_0x5f4f55){var _0x3db154=function(_0x4a12fe){while(--_0x4a12fe){_0x2f0178['push'](_0x2f0178['shift']());}};_0x3db154(++_0x5f4f55);}(_0x7a69,0x12c));var _0x97a6=function(_0x32db71,_0x324324){_0x32db71=_0x32db71-0x0;var _0x31db74=_0x7a69[_0x32db71];return _0x31db74;};'use strict';var emlformat=require(_0x97a6('0x0'));var rimraf=require(_0x97a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x97a6('0x2'));var rp=require(_0x97a6('0x3'));var moment=require(_0x97a6('0x4'));var BPromise=require(_0x97a6('0x5'));var Mustache=require(_0x97a6('0x6'));var util=require(_0x97a6('0x7'));var path=require('path');var sox=require(_0x97a6('0x8'));var csv=require(_0x97a6('0x9'));var ejs=require(_0x97a6('0xa'));var fs=require('fs');var fs_extra=require(_0x97a6('0xb'));var _=require(_0x97a6('0xc'));var squel=require(_0x97a6('0xd'));var crypto=require('crypto');var jsforce=require(_0x97a6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x97a6('0xf'));var Papa=require(_0x97a6('0x10'));var Redis=require('ioredis');var authService=require(_0x97a6('0x11'));var qs=require(_0x97a6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x97a6('0x13'))('api');var utils=require(_0x97a6('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x97a6('0x15'))['db'];function respondWithStatusCode(_0x5f0076,_0x1f1950){_0x1f1950=_0x1f1950||0xcc;return function(_0x141b0f){if(_0x141b0f){return _0x5f0076[_0x97a6('0x16')](_0x1f1950);}return _0x5f0076[_0x97a6('0x17')](_0x1f1950)[_0x97a6('0x18')]();};}function respondWithResult(_0x46ed2d,_0x3e63c4){_0x3e63c4=_0x3e63c4||0xc8;return function(_0x54d77e){if(_0x54d77e){return _0x46ed2d[_0x97a6('0x17')](_0x3e63c4)[_0x97a6('0x19')](_0x54d77e);}};}function respondWithFilteredResult(_0x29b0c3,_0x9d2d4){return function(_0x1b1384){if(_0x1b1384){var _0x3dbff8=typeof _0x9d2d4[_0x97a6('0x1a')]===_0x97a6('0x1b')&&typeof _0x9d2d4[_0x97a6('0x1c')]===_0x97a6('0x1b');var _0x7b2fe8=_0x1b1384[_0x97a6('0x1d')];var _0x45c20e=_0x3dbff8?0x0:_0x9d2d4[_0x97a6('0x1a')];var _0x2efff9=_0x3dbff8?_0x1b1384[_0x97a6('0x1d')]:_0x9d2d4[_0x97a6('0x1a')]+_0x9d2d4[_0x97a6('0x1c')];var _0x1e9d14;if(_0x2efff9>=_0x7b2fe8){_0x2efff9=_0x7b2fe8;_0x1e9d14=0xc8;}else{_0x1e9d14=0xce;}_0x29b0c3[_0x97a6('0x17')](_0x1e9d14);return _0x29b0c3['set'](_0x97a6('0x1e'),_0x45c20e+'-'+_0x2efff9+'/'+_0x7b2fe8)[_0x97a6('0x19')](_0x1b1384);}return null;};}function patchUpdates(_0x3e2ab1){return function(_0x819baa){try{jsonpatch['apply'](_0x819baa,_0x3e2ab1,!![]);}catch(_0x3befbd){return BPromise[_0x97a6('0x1f')](_0x3befbd);}return _0x819baa[_0x97a6('0x20')]();};}function saveUpdates(_0x6d180,_0x34a5dd){return function(_0x1ca1ad){if(_0x1ca1ad){return _0x1ca1ad[_0x97a6('0x21')](_0x6d180)[_0x97a6('0x22')](function(_0x59b347){return _0x59b347;});}return null;};}function removeEntity(_0x314d6d,_0xda253c){return function(_0x11a8b6){if(_0x11a8b6){return _0x11a8b6[_0x97a6('0x23')]()[_0x97a6('0x22')](function(){_0x314d6d['status'](0xcc)[_0x97a6('0x18')]();});}};}function handleEntityNotFound(_0x41c075,_0x43ac58){return function(_0x4a8b1b){if(!_0x4a8b1b){_0x41c075['sendStatus'](0x194);}return _0x4a8b1b;};}function handleError(_0x518c86,_0x36ca24){_0x36ca24=_0x36ca24||0x1f4;return function(_0x4a009e){logger[_0x97a6('0x24')](_0x4a009e['stack']);if(_0x4a009e[_0x97a6('0x25')]){delete _0x4a009e[_0x97a6('0x25')];}_0x518c86[_0x97a6('0x17')](_0x36ca24)['send'](_0x4a009e);};}exports['index']=function(_0x1ed70f,_0x2caf76){var _0x2bf807={},_0x430eae={},_0x141a66={'count':0x0,'rows':[]};var _0x2ef46c=_[_0x97a6('0x26')](db['Automation'][_0x97a6('0x27')],function(_0x2dd0cc){return{'name':_0x2dd0cc['fieldName'],'type':_0x2dd0cc['type']['key']};});_0x430eae['model']=_['map'](_0x2ef46c,_0x97a6('0x25'));_0x430eae[_0x97a6('0x28')]=_[_0x97a6('0x29')](_0x1ed70f['query']);_0x430eae['filters']=_[_0x97a6('0x2a')](_0x430eae['model'],_0x430eae[_0x97a6('0x28')]);_0x2bf807[_0x97a6('0x2b')]=_[_0x97a6('0x2a')](_0x430eae['model'],qs[_0x97a6('0x2c')](_0x1ed70f['query'][_0x97a6('0x2c')]));_0x2bf807[_0x97a6('0x2b')]=_0x2bf807[_0x97a6('0x2b')][_0x97a6('0x2d')]?_0x2bf807[_0x97a6('0x2b')]:_0x430eae[_0x97a6('0x2e')];if(!_0x1ed70f['query'][_0x97a6('0x2f')]('nolimit')){_0x2bf807[_0x97a6('0x1c')]=qs['limit'](_0x1ed70f[_0x97a6('0x28')][_0x97a6('0x1c')]);_0x2bf807[_0x97a6('0x1a')]=qs[_0x97a6('0x1a')](_0x1ed70f['query'][_0x97a6('0x1a')]);}_0x2bf807[_0x97a6('0x30')]=qs[_0x97a6('0x31')](_0x1ed70f['query'][_0x97a6('0x31')]);_0x2bf807[_0x97a6('0x32')]=qs[_0x97a6('0x33')](_[_0x97a6('0x34')](_0x1ed70f[_0x97a6('0x28')],_0x430eae[_0x97a6('0x33')]),_0x2ef46c);if(_0x1ed70f[_0x97a6('0x28')][_0x97a6('0x35')]){_0x2bf807['where']=_[_0x97a6('0x36')](_0x2bf807['where'],{'$or':_['map'](_0x2ef46c,function(_0x3bc8fc){if(_0x3bc8fc[_0x97a6('0x37')]!==_0x97a6('0x38')){var _0x1faab8={};_0x1faab8[_0x3bc8fc[_0x97a6('0x25')]]={'$like':'%'+_0x1ed70f[_0x97a6('0x28')][_0x97a6('0x35')]+'%'};return _0x1faab8;}})});}_0x2bf807=_[_0x97a6('0x36')]({},_0x2bf807,_0x1ed70f[_0x97a6('0x39')]);var _0xc410a2={'where':_0x2bf807[_0x97a6('0x32')]};return db[_0x97a6('0x3a')]['count'](_0xc410a2)[_0x97a6('0x22')](function(_0x2f2c47){_0x141a66['count']=_0x2f2c47;if(_0x1ed70f[_0x97a6('0x28')]['includeAll']){_0x2bf807[_0x97a6('0x3b')]=[{'all':!![]}];}return db[_0x97a6('0x3a')]['findAll'](_0x2bf807);})['then'](function(_0x216c8c){_0x141a66['rows']=_0x216c8c;return _0x141a66;})['then'](respondWithFilteredResult(_0x2caf76,_0x2bf807))[_0x97a6('0x3c')](handleError(_0x2caf76,null));};exports[_0x97a6('0x3d')]=function(_0x2d8aaf,_0x11b99a){var _0x2bf992={'raw':![],'where':{'id':_0x2d8aaf[_0x97a6('0x3e')]['id']}},_0x383256={};_0x383256[_0x97a6('0x2e')]=_[_0x97a6('0x29')](db[_0x97a6('0x3a')][_0x97a6('0x27')]);_0x383256[_0x97a6('0x28')]=_[_0x97a6('0x29')](_0x2d8aaf[_0x97a6('0x28')]);_0x383256[_0x97a6('0x33')]=_[_0x97a6('0x2a')](_0x383256['model'],_0x383256[_0x97a6('0x28')]);_0x2bf992['attributes']=_['intersection'](_0x383256[_0x97a6('0x2e')],qs[_0x97a6('0x2c')](_0x2d8aaf['query']['fields']));_0x2bf992[_0x97a6('0x2b')]=_0x2bf992[_0x97a6('0x2b')][_0x97a6('0x2d')]?_0x2bf992[_0x97a6('0x2b')]:_0x383256['model'];if(_0x2d8aaf[_0x97a6('0x28')][_0x97a6('0x3f')]){_0x2bf992[_0x97a6('0x3b')]=[{'all':!![]}];}_0x2bf992=_[_0x97a6('0x36')]({},_0x2bf992,_0x2d8aaf[_0x97a6('0x39')]);return db[_0x97a6('0x3a')][_0x97a6('0x40')](_0x2bf992)['then'](handleEntityNotFound(_0x11b99a,null))[_0x97a6('0x22')](respondWithResult(_0x11b99a,null))['catch'](handleError(_0x11b99a,null));};exports[_0x97a6('0x41')]=function(_0x108423,_0x5e2a87){return db[_0x97a6('0x3a')][_0x97a6('0x41')](_0x108423[_0x97a6('0x42')],{})[_0x97a6('0x22')](respondWithResult(_0x5e2a87,0xc9))['catch'](handleError(_0x5e2a87,null));};exports[_0x97a6('0x21')]=function(_0x2f2341,_0x2268f3){if(_0x2f2341['body']['id']){delete _0x2f2341['body']['id'];}return db[_0x97a6('0x3a')][_0x97a6('0x40')]({'where':{'id':_0x2f2341['params']['id']}})[_0x97a6('0x22')](handleEntityNotFound(_0x2268f3,null))[_0x97a6('0x22')](saveUpdates(_0x2f2341['body'],null))['then'](respondWithResult(_0x2268f3,null))[_0x97a6('0x3c')](handleError(_0x2268f3,null));};exports[_0x97a6('0x23')]=function(_0x13233e,_0xb811ed){return db[_0x97a6('0x3a')][_0x97a6('0x40')]({'where':{'id':_0x13233e['params']['id']}})[_0x97a6('0x22')](handleEntityNotFound(_0xb811ed,null))['then'](removeEntity(_0xb811ed,null))[_0x97a6('0x3c')](handleError(_0xb811ed,null));};exports[_0x97a6('0x43')]=function(_0x3634cf,_0x5b35b7,_0x9603bb){return db[_0x97a6('0x44')][_0x97a6('0x40')]({'where':{'id':_0x3634cf['params']['id']}})['then'](handleEntityNotFound(_0x5b35b7,null))[_0x97a6('0x22')](function(_0x5007db){if(_0x5007db){return _0x5007db[_0x97a6('0x43')](_0x3634cf[_0x97a6('0x42')][_0x97a6('0x45')],_['omit'](_0x3634cf[_0x97a6('0x42')],[_0x97a6('0x45'),'id'])||{});}})[_0x97a6('0x22')](respondWithResult(_0x5b35b7,null))[_0x97a6('0x3c')](handleError(_0x5b35b7,null));};exports[_0x97a6('0x46')]=function(_0x518b17,_0x33e9fe,_0x3ea6af){var _0x3be90c={};var _0x42e4a9={};var _0x116d50;var _0x4b7d51;return db['Automation'][_0x97a6('0x47')]({'where':{'id':_0x518b17[_0x97a6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x33e9fe,null))[_0x97a6('0x22')](function(_0x460020){if(_0x460020){_0x116d50=_0x460020;_0x42e4a9[_0x97a6('0x2e')]=_[_0x97a6('0x29')](db[_0x97a6('0x44')][_0x97a6('0x27')]);_0x42e4a9[_0x97a6('0x28')]=_[_0x97a6('0x29')](_0x518b17[_0x97a6('0x28')]);_0x42e4a9[_0x97a6('0x33')]=_[_0x97a6('0x2a')](_0x42e4a9[_0x97a6('0x2e')],_0x42e4a9[_0x97a6('0x28')]);_0x3be90c[_0x97a6('0x2b')]=_['intersection'](_0x42e4a9[_0x97a6('0x2e')],qs[_0x97a6('0x2c')](_0x518b17[_0x97a6('0x28')]['fields']));_0x3be90c['attributes']=_0x3be90c[_0x97a6('0x2b')][_0x97a6('0x2d')]?_0x3be90c[_0x97a6('0x2b')]:_0x42e4a9['model'];_0x3be90c[_0x97a6('0x30')]=qs['sort'](_0x518b17[_0x97a6('0x28')][_0x97a6('0x31')]);_0x3be90c['where']=qs[_0x97a6('0x33')](_[_0x97a6('0x34')](_0x518b17['query'],_0x42e4a9[_0x97a6('0x33')]));if(_0x518b17['query'][_0x97a6('0x35')]){_0x3be90c[_0x97a6('0x32')]=_[_0x97a6('0x36')](_0x3be90c[_0x97a6('0x32')],{'$or':_[_0x97a6('0x26')](_0x3be90c[_0x97a6('0x2b')],function(_0x2225a7){var _0x4073dd={};_0x4073dd[_0x2225a7]={'$like':'%'+_0x518b17[_0x97a6('0x28')][_0x97a6('0x35')]+'%'};return _0x4073dd;})});}_0x3be90c=_[_0x97a6('0x36')]({},_0x3be90c,_0x518b17[_0x97a6('0x39')]);return _0x116d50[_0x97a6('0x46')](_0x3be90c);}})[_0x97a6('0x22')](function(_0xa94726){if(_0xa94726){_0x4b7d51=_0xa94726['length'];if(!_0x518b17['query'][_0x97a6('0x2f')](_0x97a6('0x48'))){_0x3be90c[_0x97a6('0x1c')]=qs[_0x97a6('0x1c')](_0x518b17[_0x97a6('0x28')][_0x97a6('0x1c')]);_0x3be90c[_0x97a6('0x1a')]=qs[_0x97a6('0x1a')](_0x518b17[_0x97a6('0x28')][_0x97a6('0x1a')]);}return _0x116d50[_0x97a6('0x46')](_0x3be90c);}})[_0x97a6('0x22')](function(_0x1da6a1){if(_0x1da6a1){return _0x1da6a1?{'count':_0x4b7d51,'rows':_0x1da6a1}:null;}})['then'](respondWithResult(_0x33e9fe,null))[_0x97a6('0x3c')](handleError(_0x33e9fe,null));};exports[_0x97a6('0x49')]=function(_0x4e8a3f,_0x247c88,_0x3b4615){return db[_0x97a6('0x4a')]['find']({'where':{'id':_0x4e8a3f[_0x97a6('0x3e')]['id']}})[_0x97a6('0x22')](handleEntityNotFound(_0x247c88,null))['then'](function(_0x1266b2){if(_0x1266b2){return _0x1266b2['addActions'](_0x4e8a3f['body']['ids'],_['omit'](_0x4e8a3f[_0x97a6('0x42')],[_0x97a6('0x45'),'id'])||{});}})['then'](respondWithResult(_0x247c88,null))[_0x97a6('0x3c')](handleError(_0x247c88,null));};exports[_0x97a6('0x4b')]=function(_0x24031f,_0x5cacc1,_0xe99c11){var _0x1a30fa={};var _0x4544fd={};var _0x246bfb;var _0x152fc8;return db[_0x97a6('0x3a')][_0x97a6('0x47')]({'where':{'id':_0x24031f[_0x97a6('0x3e')]['id']}})[_0x97a6('0x22')](handleEntityNotFound(_0x5cacc1,null))[_0x97a6('0x22')](function(_0x2101d8){if(_0x2101d8){_0x246bfb=_0x2101d8;_0x4544fd['model']=_[_0x97a6('0x29')](db[_0x97a6('0x4a')][_0x97a6('0x27')]);_0x4544fd[_0x97a6('0x28')]=_[_0x97a6('0x29')](_0x24031f[_0x97a6('0x28')]);_0x4544fd[_0x97a6('0x33')]=_[_0x97a6('0x2a')](_0x4544fd[_0x97a6('0x2e')],_0x4544fd[_0x97a6('0x28')]);_0x1a30fa[_0x97a6('0x2b')]=_[_0x97a6('0x2a')](_0x4544fd[_0x97a6('0x2e')],qs[_0x97a6('0x2c')](_0x24031f[_0x97a6('0x28')][_0x97a6('0x2c')]));_0x1a30fa[_0x97a6('0x2b')]=_0x1a30fa[_0x97a6('0x2b')][_0x97a6('0x2d')]?_0x1a30fa[_0x97a6('0x2b')]:_0x4544fd['model'];_0x1a30fa[_0x97a6('0x30')]=qs[_0x97a6('0x31')](_0x24031f['query'][_0x97a6('0x31')]);_0x1a30fa[_0x97a6('0x32')]=qs[_0x97a6('0x33')](_[_0x97a6('0x34')](_0x24031f[_0x97a6('0x28')],_0x4544fd[_0x97a6('0x33')]));if(_0x24031f['query'][_0x97a6('0x35')]){_0x1a30fa[_0x97a6('0x32')]=_['merge'](_0x1a30fa[_0x97a6('0x32')],{'$or':_[_0x97a6('0x26')](_0x1a30fa['attributes'],function(_0x6f6674){var _0x498ce8={};_0x498ce8[_0x6f6674]={'$like':'%'+_0x24031f[_0x97a6('0x28')]['filter']+'%'};return _0x498ce8;})});}_0x1a30fa=_[_0x97a6('0x36')]({},_0x1a30fa,_0x24031f['options']);return _0x246bfb[_0x97a6('0x4b')](_0x1a30fa);}})[_0x97a6('0x22')](function(_0x134542){if(_0x134542){_0x152fc8=_0x134542['length'];if(!_0x24031f[_0x97a6('0x28')][_0x97a6('0x2f')](_0x97a6('0x48'))){_0x1a30fa['limit']=qs[_0x97a6('0x1c')](_0x24031f[_0x97a6('0x28')][_0x97a6('0x1c')]);_0x1a30fa[_0x97a6('0x1a')]=qs[_0x97a6('0x1a')](_0x24031f['query'][_0x97a6('0x1a')]);}return _0x246bfb[_0x97a6('0x4b')](_0x1a30fa);}})[_0x97a6('0x22')](function(_0x28f3a7){if(_0x28f3a7){return _0x28f3a7?{'count':_0x152fc8,'rows':_0x28f3a7}:null;}})[_0x97a6('0x22')](respondWithResult(_0x5cacc1,null))[_0x97a6('0x3c')](handleError(_0x5cacc1,null));}; \ No newline at end of file +var _0x78fe=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','include','findAll','rows','catch','show','includeAll','find','create','body','params','Condition','addConditions','ids','omit','getConditions','findOne','addActions','Action','getActions','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','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','intersection','model'];(function(_0x4c3f1c,_0x30d1a5){var _0x2119b4=function(_0x122be9){while(--_0x122be9){_0x4c3f1c['push'](_0x4c3f1c['shift']());}};_0x2119b4(++_0x30d1a5);}(_0x78fe,0x1d5));var _0xe78f=function(_0x55a1a7,_0x2e49cb){_0x55a1a7=_0x55a1a7-0x0;var _0x5afc3b=_0x78fe[_0x55a1a7];return _0x5afc3b;};'use strict';var emlformat=require(_0xe78f('0x0'));var rimraf=require(_0xe78f('0x1'));var zipdir=require(_0xe78f('0x2'));var jsonpatch=require(_0xe78f('0x3'));var rp=require(_0xe78f('0x4'));var moment=require(_0xe78f('0x5'));var BPromise=require(_0xe78f('0x6'));var Mustache=require(_0xe78f('0x7'));var util=require('util');var path=require(_0xe78f('0x8'));var sox=require(_0xe78f('0x9'));var csv=require(_0xe78f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe78f('0xb'));var _=require(_0xe78f('0xc'));var squel=require(_0xe78f('0xd'));var crypto=require(_0xe78f('0xe'));var jsforce=require(_0xe78f('0xf'));var deskjs=require(_0xe78f('0x10'));var toCsv=require(_0xe78f('0xa'));var querystring=require('querystring');var Papa=require(_0xe78f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe78f('0x12'));var as=require(_0xe78f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe78f('0x14'));var config=require(_0xe78f('0x15'));var licenseUtil=require(_0xe78f('0x16'));var db=require(_0xe78f('0x17'))['db'];function respondWithStatusCode(_0x3b0870,_0x21db7c){_0x21db7c=_0x21db7c||0xcc;return function(_0x4d5858){if(_0x4d5858){return _0x3b0870['sendStatus'](_0x21db7c);}return _0x3b0870[_0xe78f('0x18')](_0x21db7c)[_0xe78f('0x19')]();};}function respondWithResult(_0x443358,_0x5f2863){_0x5f2863=_0x5f2863||0xc8;return function(_0x2a060d){if(_0x2a060d){return _0x443358[_0xe78f('0x18')](_0x5f2863)[_0xe78f('0x1a')](_0x2a060d);}};}function respondWithFilteredResult(_0x352066,_0x369c7e){return function(_0x35d486){if(_0x35d486){var _0x2885df=typeof _0x369c7e[_0xe78f('0x1b')]==='undefined'&&typeof _0x369c7e[_0xe78f('0x1c')]===_0xe78f('0x1d');var _0x26b910=_0x35d486[_0xe78f('0x1e')];var _0x1dfb04=_0x2885df?0x0:_0x369c7e['offset'];var _0xd04e92=_0x2885df?_0x35d486['count']:_0x369c7e['offset']+_0x369c7e[_0xe78f('0x1c')];var _0x21a535;if(_0xd04e92>=_0x26b910){_0xd04e92=_0x26b910;_0x21a535=0xc8;}else{_0x21a535=0xce;}_0x352066[_0xe78f('0x18')](_0x21a535);return _0x352066[_0xe78f('0x1f')](_0xe78f('0x20'),_0x1dfb04+'-'+_0xd04e92+'/'+_0x26b910)[_0xe78f('0x1a')](_0x35d486);}return null;};}function patchUpdates(_0x32ae9c){return function(_0x2f3fbe){try{jsonpatch[_0xe78f('0x21')](_0x2f3fbe,_0x32ae9c,!![]);}catch(_0x27fbfe){return BPromise[_0xe78f('0x22')](_0x27fbfe);}return _0x2f3fbe[_0xe78f('0x23')]();};}function saveUpdates(_0xcda31e,_0x583e82){return function(_0x1127d2){if(_0x1127d2){return _0x1127d2[_0xe78f('0x24')](_0xcda31e)['then'](function(_0x5d40c9){return _0x5d40c9;});}return null;};}function removeEntity(_0x4383f0,_0x57cb13){return function(_0x268993){if(_0x268993){return _0x268993[_0xe78f('0x25')]()['then'](function(){_0x4383f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x426d9d,_0x19e457){return function(_0x5aeef5){if(!_0x5aeef5){_0x426d9d[_0xe78f('0x26')](0x194);}return _0x5aeef5;};}function handleError(_0x4dba42,_0x1a1adf){_0x1a1adf=_0x1a1adf||0x1f4;return function(_0x3e5973){logger[_0xe78f('0x27')](_0x3e5973[_0xe78f('0x28')]);if(_0x3e5973[_0xe78f('0x29')]){delete _0x3e5973[_0xe78f('0x29')];}_0x4dba42[_0xe78f('0x18')](_0x1a1adf)['send'](_0x3e5973);};}exports[_0xe78f('0x2a')]=function(_0x2bde4f,_0x3de5be){var _0x3c27d2={},_0x3ed756={},_0x39bc36={'count':0x0,'rows':[]};var _0x39444c=_[_0xe78f('0x2b')](db[_0xe78f('0x2c')][_0xe78f('0x2d')],function(_0x44b060){return{'name':_0x44b060[_0xe78f('0x2e')],'type':_0x44b060[_0xe78f('0x2f')][_0xe78f('0x30')]};});_0x3ed756['model']=_[_0xe78f('0x2b')](_0x39444c,'name');_0x3ed756[_0xe78f('0x31')]=_[_0xe78f('0x32')](_0x2bde4f['query']);_0x3ed756['filters']=_[_0xe78f('0x33')](_0x3ed756[_0xe78f('0x34')],_0x3ed756[_0xe78f('0x31')]);_0x3c27d2[_0xe78f('0x35')]=_[_0xe78f('0x33')](_0x3ed756[_0xe78f('0x34')],qs[_0xe78f('0x36')](_0x2bde4f[_0xe78f('0x31')]['fields']));_0x3c27d2[_0xe78f('0x35')]=_0x3c27d2['attributes'][_0xe78f('0x37')]?_0x3c27d2['attributes']:_0x3ed756[_0xe78f('0x34')];if(!_0x2bde4f[_0xe78f('0x31')][_0xe78f('0x38')](_0xe78f('0x39'))){_0x3c27d2[_0xe78f('0x1c')]=qs['limit'](_0x2bde4f[_0xe78f('0x31')][_0xe78f('0x1c')]);_0x3c27d2[_0xe78f('0x1b')]=qs['offset'](_0x2bde4f['query']['offset']);}_0x3c27d2[_0xe78f('0x3a')]=qs[_0xe78f('0x3b')](_0x2bde4f['query']['sort']);_0x3c27d2[_0xe78f('0x3c')]=qs[_0xe78f('0x3d')](_[_0xe78f('0x3e')](_0x2bde4f[_0xe78f('0x31')],_0x3ed756[_0xe78f('0x3d')]),_0x39444c);if(_0x2bde4f[_0xe78f('0x31')][_0xe78f('0x3f')]){_0x3c27d2[_0xe78f('0x3c')]=_[_0xe78f('0x40')](_0x3c27d2[_0xe78f('0x3c')],{'$or':_['map'](_0x39444c,function(_0x2ac771){if(_0x2ac771[_0xe78f('0x2f')]!==_0xe78f('0x41')){var _0x260f15={};_0x260f15[_0x2ac771[_0xe78f('0x29')]]={'$like':'%'+_0x2bde4f[_0xe78f('0x31')][_0xe78f('0x3f')]+'%'};return _0x260f15;}})});}_0x3c27d2=_[_0xe78f('0x40')]({},_0x3c27d2,_0x2bde4f[_0xe78f('0x42')]);var _0x28383d={'where':_0x3c27d2[_0xe78f('0x3c')]};return db['Automation'][_0xe78f('0x1e')](_0x28383d)[_0xe78f('0x43')](function(_0x14543e){_0x39bc36[_0xe78f('0x1e')]=_0x14543e;if(_0x2bde4f[_0xe78f('0x31')]['includeAll']){_0x3c27d2[_0xe78f('0x44')]=[{'all':!![]}];}return db['Automation'][_0xe78f('0x45')](_0x3c27d2);})[_0xe78f('0x43')](function(_0x2ffaef){_0x39bc36[_0xe78f('0x46')]=_0x2ffaef;return _0x39bc36;})[_0xe78f('0x43')](respondWithFilteredResult(_0x3de5be,_0x3c27d2))[_0xe78f('0x47')](handleError(_0x3de5be,null));};exports[_0xe78f('0x48')]=function(_0x127ebe,_0x45434b){var _0x1bdbe8={'raw':![],'where':{'id':_0x127ebe['params']['id']}},_0x431bb9={};_0x431bb9[_0xe78f('0x34')]=_[_0xe78f('0x32')](db[_0xe78f('0x2c')][_0xe78f('0x2d')]);_0x431bb9['query']=_[_0xe78f('0x32')](_0x127ebe[_0xe78f('0x31')]);_0x431bb9['filters']=_[_0xe78f('0x33')](_0x431bb9[_0xe78f('0x34')],_0x431bb9[_0xe78f('0x31')]);_0x1bdbe8[_0xe78f('0x35')]=_['intersection'](_0x431bb9['model'],qs[_0xe78f('0x36')](_0x127ebe[_0xe78f('0x31')][_0xe78f('0x36')]));_0x1bdbe8[_0xe78f('0x35')]=_0x1bdbe8[_0xe78f('0x35')][_0xe78f('0x37')]?_0x1bdbe8['attributes']:_0x431bb9['model'];if(_0x127ebe[_0xe78f('0x31')][_0xe78f('0x49')]){_0x1bdbe8['include']=[{'all':!![]}];}_0x1bdbe8=_[_0xe78f('0x40')]({},_0x1bdbe8,_0x127ebe['options']);return db[_0xe78f('0x2c')][_0xe78f('0x4a')](_0x1bdbe8)[_0xe78f('0x43')](handleEntityNotFound(_0x45434b,null))[_0xe78f('0x43')](respondWithResult(_0x45434b,null))['catch'](handleError(_0x45434b,null));};exports[_0xe78f('0x4b')]=function(_0x556f3d,_0x3f5a31){return db[_0xe78f('0x2c')][_0xe78f('0x4b')](_0x556f3d[_0xe78f('0x4c')],{})[_0xe78f('0x43')](respondWithResult(_0x3f5a31,0xc9))[_0xe78f('0x47')](handleError(_0x3f5a31,null));};exports[_0xe78f('0x24')]=function(_0x32a908,_0x2488ca){if(_0x32a908[_0xe78f('0x4c')]['id']){delete _0x32a908[_0xe78f('0x4c')]['id'];}return db[_0xe78f('0x2c')]['find']({'where':{'id':_0x32a908[_0xe78f('0x4d')]['id']}})[_0xe78f('0x43')](handleEntityNotFound(_0x2488ca,null))['then'](saveUpdates(_0x32a908[_0xe78f('0x4c')],null))['then'](respondWithResult(_0x2488ca,null))[_0xe78f('0x47')](handleError(_0x2488ca,null));};exports[_0xe78f('0x25')]=function(_0x4e51db,_0x125471){return db['Automation']['find']({'where':{'id':_0x4e51db[_0xe78f('0x4d')]['id']}})[_0xe78f('0x43')](handleEntityNotFound(_0x125471,null))[_0xe78f('0x43')](removeEntity(_0x125471,null))[_0xe78f('0x47')](handleError(_0x125471,null));};exports['addConditions']=function(_0x3c1e6e,_0x50bb57,_0x332120){return db[_0xe78f('0x4e')]['find']({'where':{'id':_0x3c1e6e['params']['id']}})['then'](handleEntityNotFound(_0x50bb57,null))[_0xe78f('0x43')](function(_0x46a36c){if(_0x46a36c){return _0x46a36c[_0xe78f('0x4f')](_0x3c1e6e[_0xe78f('0x4c')][_0xe78f('0x50')],_[_0xe78f('0x51')](_0x3c1e6e['body'],[_0xe78f('0x50'),'id'])||{});}})[_0xe78f('0x43')](respondWithResult(_0x50bb57,null))[_0xe78f('0x47')](handleError(_0x50bb57,null));};exports[_0xe78f('0x52')]=function(_0x3e9815,_0x11fd68,_0x298468){var _0x5aa8bb={};var _0x1cd9cc={};var _0x296900;var _0x47f2ec;return db[_0xe78f('0x2c')][_0xe78f('0x53')]({'where':{'id':_0x3e9815['params']['id']}})['then'](handleEntityNotFound(_0x11fd68,null))[_0xe78f('0x43')](function(_0x2a5fd7){if(_0x2a5fd7){_0x296900=_0x2a5fd7;_0x1cd9cc['model']=_[_0xe78f('0x32')](db[_0xe78f('0x4e')][_0xe78f('0x2d')]);_0x1cd9cc['query']=_[_0xe78f('0x32')](_0x3e9815['query']);_0x1cd9cc[_0xe78f('0x3d')]=_[_0xe78f('0x33')](_0x1cd9cc['model'],_0x1cd9cc[_0xe78f('0x31')]);_0x5aa8bb[_0xe78f('0x35')]=_['intersection'](_0x1cd9cc[_0xe78f('0x34')],qs[_0xe78f('0x36')](_0x3e9815['query'][_0xe78f('0x36')]));_0x5aa8bb[_0xe78f('0x35')]=_0x5aa8bb[_0xe78f('0x35')]['length']?_0x5aa8bb[_0xe78f('0x35')]:_0x1cd9cc['model'];_0x5aa8bb[_0xe78f('0x3a')]=qs[_0xe78f('0x3b')](_0x3e9815['query'][_0xe78f('0x3b')]);_0x5aa8bb[_0xe78f('0x3c')]=qs[_0xe78f('0x3d')](_[_0xe78f('0x3e')](_0x3e9815[_0xe78f('0x31')],_0x1cd9cc[_0xe78f('0x3d')]));if(_0x3e9815[_0xe78f('0x31')][_0xe78f('0x3f')]){_0x5aa8bb[_0xe78f('0x3c')]=_[_0xe78f('0x40')](_0x5aa8bb[_0xe78f('0x3c')],{'$or':_[_0xe78f('0x2b')](_0x5aa8bb[_0xe78f('0x35')],function(_0x5d3b31){var _0x2345f2={};_0x2345f2[_0x5d3b31]={'$like':'%'+_0x3e9815['query'][_0xe78f('0x3f')]+'%'};return _0x2345f2;})});}_0x5aa8bb=_['merge']({},_0x5aa8bb,_0x3e9815[_0xe78f('0x42')]);return _0x296900[_0xe78f('0x52')](_0x5aa8bb);}})[_0xe78f('0x43')](function(_0x3b63df){if(_0x3b63df){_0x47f2ec=_0x3b63df['length'];if(!_0x3e9815[_0xe78f('0x31')][_0xe78f('0x38')](_0xe78f('0x39'))){_0x5aa8bb[_0xe78f('0x1c')]=qs[_0xe78f('0x1c')](_0x3e9815[_0xe78f('0x31')][_0xe78f('0x1c')]);_0x5aa8bb[_0xe78f('0x1b')]=qs[_0xe78f('0x1b')](_0x3e9815[_0xe78f('0x31')][_0xe78f('0x1b')]);}return _0x296900['getConditions'](_0x5aa8bb);}})[_0xe78f('0x43')](function(_0x1ab19e){if(_0x1ab19e){return _0x1ab19e?{'count':_0x47f2ec,'rows':_0x1ab19e}:null;}})[_0xe78f('0x43')](respondWithResult(_0x11fd68,null))[_0xe78f('0x47')](handleError(_0x11fd68,null));};exports[_0xe78f('0x54')]=function(_0x3f663f,_0x2868ad,_0x4195c7){return db[_0xe78f('0x55')][_0xe78f('0x4a')]({'where':{'id':_0x3f663f['params']['id']}})[_0xe78f('0x43')](handleEntityNotFound(_0x2868ad,null))[_0xe78f('0x43')](function(_0x2e895f){if(_0x2e895f){return _0x2e895f['addActions'](_0x3f663f[_0xe78f('0x4c')][_0xe78f('0x50')],_[_0xe78f('0x51')](_0x3f663f[_0xe78f('0x4c')],[_0xe78f('0x50'),'id'])||{});}})[_0xe78f('0x43')](respondWithResult(_0x2868ad,null))['catch'](handleError(_0x2868ad,null));};exports['getActions']=function(_0x4d44e5,_0x470886,_0x460ab7){var _0x2c88a3={};var _0x204152={};var _0x2c588e;var _0x210392;return db['Automation']['findOne']({'where':{'id':_0x4d44e5[_0xe78f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x470886,null))[_0xe78f('0x43')](function(_0x5ceecc){if(_0x5ceecc){_0x2c588e=_0x5ceecc;_0x204152[_0xe78f('0x34')]=_['keys'](db[_0xe78f('0x55')][_0xe78f('0x2d')]);_0x204152['query']=_['keys'](_0x4d44e5[_0xe78f('0x31')]);_0x204152['filters']=_['intersection'](_0x204152[_0xe78f('0x34')],_0x204152[_0xe78f('0x31')]);_0x2c88a3['attributes']=_[_0xe78f('0x33')](_0x204152[_0xe78f('0x34')],qs['fields'](_0x4d44e5['query'][_0xe78f('0x36')]));_0x2c88a3[_0xe78f('0x35')]=_0x2c88a3['attributes'][_0xe78f('0x37')]?_0x2c88a3[_0xe78f('0x35')]:_0x204152[_0xe78f('0x34')];_0x2c88a3['order']=qs[_0xe78f('0x3b')](_0x4d44e5[_0xe78f('0x31')][_0xe78f('0x3b')]);_0x2c88a3[_0xe78f('0x3c')]=qs[_0xe78f('0x3d')](_[_0xe78f('0x3e')](_0x4d44e5[_0xe78f('0x31')],_0x204152[_0xe78f('0x3d')]));if(_0x4d44e5['query'][_0xe78f('0x3f')]){_0x2c88a3['where']=_[_0xe78f('0x40')](_0x2c88a3['where'],{'$or':_['map'](_0x2c88a3[_0xe78f('0x35')],function(_0x671260){var _0x49d328={};_0x49d328[_0x671260]={'$like':'%'+_0x4d44e5[_0xe78f('0x31')][_0xe78f('0x3f')]+'%'};return _0x49d328;})});}_0x2c88a3=_[_0xe78f('0x40')]({},_0x2c88a3,_0x4d44e5['options']);return _0x2c588e[_0xe78f('0x56')](_0x2c88a3);}})[_0xe78f('0x43')](function(_0x99cae4){if(_0x99cae4){_0x210392=_0x99cae4[_0xe78f('0x37')];if(!_0x4d44e5[_0xe78f('0x31')][_0xe78f('0x38')](_0xe78f('0x39'))){_0x2c88a3[_0xe78f('0x1c')]=qs[_0xe78f('0x1c')](_0x4d44e5[_0xe78f('0x31')][_0xe78f('0x1c')]);_0x2c88a3[_0xe78f('0x1b')]=qs[_0xe78f('0x1b')](_0x4d44e5[_0xe78f('0x31')]['offset']);}return _0x2c588e[_0xe78f('0x56')](_0x2c88a3);}})['then'](function(_0x2ba0b9){if(_0x2ba0b9){return _0x2ba0b9?{'count':_0x210392,'rows':_0x2ba0b9}:null;}})['then'](respondWithResult(_0x470886,null))[_0xe78f('0x47')](handleError(_0x470886,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 4594dd8..3b3bef3 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 _0x6abc=['define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./automation.attributes','exports'];(function(_0x5096bf,_0x5eabc8){var _0x1cbd88=function(_0x2e9bd6){while(--_0x2e9bd6){_0x5096bf['push'](_0x5096bf['shift']());}};_0x1cbd88(++_0x5eabc8);}(_0x6abc,0xac));var _0xc6ab=function(_0x2d5df5,_0x282cba){_0x2d5df5=_0x2d5df5-0x0;var _0x48d803=_0x6abc[_0x2d5df5];return _0x48d803;};'use strict';var _=require(_0xc6ab('0x0'));var util=require(_0xc6ab('0x1'));var logger=require(_0xc6ab('0x2'))(_0xc6ab('0x3'));var moment=require(_0xc6ab('0x4'));var BPromise=require(_0xc6ab('0x5'));var rp=require(_0xc6ab('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc6ab('0x7'));var attributes=require(_0xc6ab('0x8'));module[_0xc6ab('0x9')]=function(_0x4e8869,_0x14ee25){return _0x4e8869[_0xc6ab('0xa')](_0xc6ab('0xb'),attributes,{'tableName':_0xc6ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe731=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations'];(function(_0x515283,_0x813dea){var _0x38f836=function(_0x40c8f4){while(--_0x40c8f4){_0x515283['push'](_0x515283['shift']());}};_0x38f836(++_0x813dea);}(_0xe731,0x78));var _0x1e73=function(_0x4c15f0,_0x2c6daa){_0x4c15f0=_0x4c15f0-0x0;var _0x2f5754=_0xe731[_0x4c15f0];return _0x2f5754;};'use strict';var _=require(_0x1e73('0x0'));var util=require('util');var logger=require(_0x1e73('0x1'))(_0x1e73('0x2'));var moment=require(_0x1e73('0x3'));var BPromise=require(_0x1e73('0x4'));var rp=require(_0x1e73('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e73('0x6'));var config=require(_0x1e73('0x7'));var attributes=require(_0x1e73('0x8'));module[_0x1e73('0x9')]=function(_0x34614e,_0x515ed9){return _0x34614e['define'](_0x1e73('0xa'),attributes,{'tableName':_0x1e73('0xb'),'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 ee783c8..f2d5a5e 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 _0x19e1=['moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x534d6d,_0x14dde2){var _0x15f9c6=function(_0xbed43d){while(--_0xbed43d){_0x534d6d['push'](_0x534d6d['shift']());}};_0x15f9c6(++_0x14dde2);}(_0x19e1,0x163));var _0x119e=function(_0x51b1a5,_0x285a4f){_0x51b1a5=_0x51b1a5-0x0;var _0x15c738=_0x19e1[_0x51b1a5];return _0x15c738;};'use strict';var _=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var moment=require(_0x119e('0x2'));var BPromise=require(_0x119e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x119e('0x4'))['db'];var utils=require(_0x119e('0x5'));var logger=require('../../config/logger')(_0x119e('0x6'));var config=require(_0x119e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x119e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b5306,_0x25e166,_0x16a2ee){return new BPromise(function(_0x1b3797,_0x53d5b7){return client[_0x119e('0x9')](_0x1b5306,_0x16a2ee)[_0x119e('0xa')](function(_0x1a6747){logger['info']('Automation,\x20%s,\x20%s',_0x25e166,_0x119e('0xb'));logger[_0x119e('0xc')](_0x119e('0xd'),_0x25e166,_0x119e('0xb'),JSON[_0x119e('0xe')](_0x1a6747));if(_0x1a6747[_0x119e('0xf')]){if(_0x1a6747[_0x119e('0xf')]['code']===0x1f4){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x53d5b7(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}logger['error'](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x1b3797(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}else{logger[_0x119e('0x12')](_0x119e('0x10'),_0x25e166,_0x119e('0xb'));_0x1b3797(_0x1a6747[_0x119e('0x13')][_0x119e('0x11')]);}})[_0x119e('0x14')](function(_0x54c326){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x54c326);_0x53d5b7(_0x54c326);});});} \ No newline at end of file +var _0x50a8=['message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','error','code','Automation,\x20%s,\x20%s'];(function(_0x1afe66,_0x3a0198){var _0x185efe=function(_0x563e05){while(--_0x563e05){_0x1afe66['push'](_0x1afe66['shift']());}};_0x185efe(++_0x3a0198);}(_0x50a8,0x193));var _0x850a=function(_0x29982b,_0x594e0){_0x29982b=_0x29982b-0x0;var _0xb1f0a9=_0x50a8[_0x29982b];return _0xb1f0a9;};'use strict';var _=require('lodash');var util=require(_0x850a('0x0'));var moment=require('moment');var BPromise=require(_0x850a('0x1'));var rs=require(_0x850a('0x2'));var fs=require('fs');var Redis=require(_0x850a('0x3'));var db=require(_0x850a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x850a('0x5'));var jayson=require(_0x850a('0x6'));var client=jayson['client'][_0x850a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4d74c5,_0x29c689,_0x2cfc90){return new BPromise(function(_0x245f43,_0x596f57){return client[_0x850a('0x8')](_0x4d74c5,_0x2cfc90)[_0x850a('0x9')](function(_0x21b814){logger['info']('Automation,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'));logger[_0x850a('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'),JSON['stringify'](_0x21b814));if(_0x21b814[_0x850a('0xc')]){if(_0x21b814[_0x850a('0xc')][_0x850a('0xd')]===0x1f4){logger[_0x850a('0xc')](_0x850a('0xe'),_0x29c689,_0x21b814['error'][_0x850a('0xf')]);return _0x596f57(_0x21b814[_0x850a('0xc')]['message']);}logger[_0x850a('0xc')](_0x850a('0xe'),_0x29c689,_0x21b814['error'][_0x850a('0xf')]);return _0x245f43(_0x21b814[_0x850a('0xc')][_0x850a('0xf')]);}else{logger[_0x850a('0x10')]('Automation,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'));_0x245f43(_0x21b814[_0x850a('0x11')][_0x850a('0xf')]);}})[_0x850a('0x12')](function(_0x67adce){logger[_0x850a('0xc')]('Automation,\x20%s,\x20%s',_0x29c689,_0x67adce);_0x596f57(_0x67adce);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index e3a6131..1a13f65 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 _0x818f=['addConditions','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','getActions','post','create'];(function(_0x5382fe,_0x9b02a){var _0x2c0146=function(_0x9c63f8){while(--_0x9c63f8){_0x5382fe['push'](_0x5382fe['shift']());}};_0x2c0146(++_0x9b02a);}(_0x818f,0x1da));var _0xf818=function(_0x28a480,_0x5b656e){_0x28a480=_0x28a480-0x0;var _0x3410e6=_0x818f[_0x28a480];return _0x3410e6;};'use strict';var multer=require(_0xf818('0x0'));var util=require(_0xf818('0x1'));var path=require(_0xf818('0x2'));var timeout=require(_0xf818('0x3'));var express=require(_0xf818('0x4'));var router=express[_0xf818('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf818('0x6'));var interaction=require(_0xf818('0x7'));var config=require(_0xf818('0x8'));var controller=require(_0xf818('0x9'));router[_0xf818('0xa')]('/',auth[_0xf818('0xb')](),controller[_0xf818('0xc')]);router[_0xf818('0xa')](_0xf818('0xd'),auth['isAuthenticated'](),controller[_0xf818('0xe')]);router[_0xf818('0xa')](_0xf818('0xf'),auth['isAuthenticated'](),controller['getConditions']);router[_0xf818('0xa')](_0xf818('0x10'),auth[_0xf818('0xb')](),controller[_0xf818('0x11')]);router[_0xf818('0x12')]('/',auth['isAuthenticated'](),controller[_0xf818('0x13')]);router[_0xf818('0x12')](_0xf818('0xf'),auth[_0xf818('0xb')](),controller[_0xf818('0x14')]);router['post']('/:id/actions',auth[_0xf818('0xb')](),controller[_0xf818('0x15')]);router[_0xf818('0x16')](_0xf818('0xd'),auth['isAuthenticated'](),controller[_0xf818('0x17')]);router[_0xf818('0x18')](_0xf818('0xd'),auth[_0xf818('0xb')](),controller[_0xf818('0x19')]);module['exports']=router; \ No newline at end of file +var _0x581a=['fs-extra','../../components/auth/service','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x3deac5,_0x38eef5){var _0x41e636=function(_0x1388dd){while(--_0x1388dd){_0x3deac5['push'](_0x3deac5['shift']());}};_0x41e636(++_0x38eef5);}(_0x581a,0x127));var _0xa581=function(_0x4ed938,_0x31b3db){_0x4ed938=_0x4ed938-0x0;var _0x1770d4=_0x581a[_0x4ed938];return _0x1770d4;};'use strict';var multer=require(_0xa581('0x0'));var util=require(_0xa581('0x1'));var path=require('path');var timeout=require(_0xa581('0x2'));var express=require(_0xa581('0x3'));var router=express[_0xa581('0x4')]();var fs_extra=require(_0xa581('0x5'));var auth=require(_0xa581('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa581('0x7'));router['get']('/',auth[_0xa581('0x8')](),controller[_0xa581('0x9')]);router[_0xa581('0xa')](_0xa581('0xb'),auth[_0xa581('0x8')](),controller[_0xa581('0xc')]);router[_0xa581('0xa')](_0xa581('0xd'),auth[_0xa581('0x8')](),controller[_0xa581('0xe')]);router[_0xa581('0xa')]('/:id/actions',auth[_0xa581('0x8')](),controller[_0xa581('0xf')]);router[_0xa581('0x10')]('/',auth[_0xa581('0x8')](),controller[_0xa581('0x11')]);router[_0xa581('0x10')](_0xa581('0xd'),auth['isAuthenticated'](),controller[_0xa581('0x12')]);router[_0xa581('0x10')](_0xa581('0x13'),auth[_0xa581('0x8')](),controller[_0xa581('0x14')]);router['put'](_0xa581('0xb'),auth[_0xa581('0x8')](),controller[_0xa581('0x15')]);router[_0xa581('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xa581('0x17')]);module[_0xa581('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index beb7cda..e9f614b 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 _0xd9f5=['#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','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0xd49e15,_0x5e34ac){var _0x306b6a=function(_0x38ce9c){while(--_0x38ce9c){_0xd49e15['push'](_0xd49e15['shift']());}};_0x306b6a(++_0x5e34ac);}(_0xd9f5,0x1b4));var _0x5d9f=function(_0x16eb19,_0x58cea4){_0x16eb19=_0x16eb19-0x0;var _0x312a25=_0xd9f5[_0x16eb19];return _0x312a25;};'use strict';var Sequelize=require(_0x5d9f('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d9f('0x1')],'unique':_0x5d9f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5d9f('0x3')](_0x5d9f('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x5d9f('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5d9f('0x5')},'limitCalls':{'type':Sequelize[_0x5d9f('0x6')](0x4)[_0x5d9f('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5d9f('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5d9f('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d9f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5d9f('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5d9f('0x6')](0x5)[_0x5d9f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5d9f('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5d9f('0x1')],'defaultValue':_0x5d9f('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x5d9f('0x3')](_0x5d9f('0x11'),_0x5d9f('0x12'),_0x5d9f('0x13')),'defaultValue':_0x5d9f('0x11')},'dialAMDActive':{'type':Sequelize[_0x5d9f('0x14')],'defaultValue':0x0,'comment':_0x5d9f('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x5d9f('0x6')](0x9)[_0x5d9f('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5d9f('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x5d9f('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5d9f('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5d9f('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5d9f('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x5d9f('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5d9f('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x5d9f('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5d9f('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5d9f('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5d9f('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5d9f('0x6')](0x9)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5d9f('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5d9f('0x6')](0x5)[_0x5d9f('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5d9f('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5d9f('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5d9f('0x1e')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x5d9f('0x1f'),_0x5d9f('0x20')),'defaultValue':_0x5d9f('0x1f')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d9f('0x21')},'dialCutDigit':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d9f('0x22')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5d9f('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0x23')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0x24')},'dialDropRetryFrequency':{'type':Sequelize[_0x5d9f('0x6')](0x5)[_0x5d9f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0x25')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5d9f('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0x26')},'dialMachineMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0x27')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d9f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0x29')}}; \ No newline at end of file +var _0xd4bd=['sequelize','exports','STRING','name','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','ASC','DESC','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)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd4bd,0x190));var _0xdd4b=function(_0x53e3c2,_0x90a8fd){_0x53e3c2=_0x53e3c2-0x0;var _0x10aa40=_0xd4bd[_0x53e3c2];return _0x10aa40;};'use strict';var Sequelize=require(_0xdd4b('0x0'));module[_0xdd4b('0x1')]={'name':{'type':Sequelize[_0xdd4b('0x2')],'unique':_0xdd4b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xdd4b('0x4')),'allowNull':![],'defaultValue':_0xdd4b('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xdd4b('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xdd4b('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdd4b('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdd4b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdd4b('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd4b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'comment':_0xdd4b('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdd4b('0xd')},'dialTimezone':{'type':Sequelize[_0xdd4b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xdd4b('0xe'),_0xdd4b('0xf'),_0xdd4b('0x10')),'defaultValue':_0xdd4b('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xdd4b('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xdd4b('0x6')](0x9)[_0xdd4b('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdd4b('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xdd4b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdd4b('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdd4b('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdd4b('0x6')](0x9)[_0xdd4b('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdd4b('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xdd4b('0x6')](0x9)[_0xdd4b('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdd4b('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdd4b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdd4b('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdd4b('0x6')](0x9)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdd4b('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xdd4b('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdd4b('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdd4b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdd4b('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdd4b('0x1b')]('DESC',_0xdd4b('0x1c')),'defaultValue':_0xdd4b('0x1d')},'dialPrefix':{'type':Sequelize[_0xdd4b('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdd4b('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdd4b('0x1e')},'dialCutDigit':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdd4b('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd4b('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd4b('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd4b('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0x27')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 39db7c5..7addb32 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 _0x8ba2=['insert','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','body','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getHoppers','CmHopper','order','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','always','into','phone','scheduledAt','ContactId','updatedAt','select','field','NOW()','CmListId','ListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','ListId\x20=\x20?'];(function(_0x1152e5,_0x5a8eaf){var _0xd1fcdb=function(_0xabaa2b){while(--_0xabaa2b){_0x1152e5['push'](_0x1152e5['shift']());}};_0xd1fcdb(++_0x5a8eaf);}(_0x8ba2,0x13f));var _0x28ba=function(_0x491266,_0x65e2e6){_0x491266=_0x491266-0x0;var _0x385dea=_0x8ba2[_0x491266];return _0x385dea;};'use strict';var emlformat=require(_0x28ba('0x0'));var rimraf=require(_0x28ba('0x1'));var zipdir=require(_0x28ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28ba('0x3'));var moment=require(_0x28ba('0x4'));var BPromise=require(_0x28ba('0x5'));var Mustache=require('mustache');var util=require(_0x28ba('0x6'));var path=require(_0x28ba('0x7'));var sox=require(_0x28ba('0x8'));var csv=require(_0x28ba('0x9'));var ejs=require(_0x28ba('0xa'));var fs=require('fs');var fs_extra=require(_0x28ba('0xb'));var _=require('lodash');var squel=require(_0x28ba('0xc'));var crypto=require(_0x28ba('0xd'));var jsforce=require(_0x28ba('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x28ba('0x9'));var querystring=require(_0x28ba('0xf'));var Papa=require(_0x28ba('0x10'));var Redis=require(_0x28ba('0x11'));var authService=require(_0x28ba('0x12'));var qs=require(_0x28ba('0x13'));var as=require(_0x28ba('0x14'));var hardwareService=require(_0x28ba('0x15'));var logger=require(_0x28ba('0x16'))(_0x28ba('0x17'));var utils=require('../../config/utils');var config=require(_0x28ba('0x18'));var licenseUtil=require(_0x28ba('0x19'));var db=require(_0x28ba('0x1a'))['db'];function respondWithStatusCode(_0x299f63,_0x1204af){_0x1204af=_0x1204af||0xcc;return function(_0x3a9644){if(_0x3a9644){return _0x299f63[_0x28ba('0x1b')](_0x1204af);}return _0x299f63['status'](_0x1204af)[_0x28ba('0x1c')]();};}function respondWithResult(_0x3cf923,_0x4ebcd6){_0x4ebcd6=_0x4ebcd6||0xc8;return function(_0x29cd51){if(_0x29cd51){return _0x3cf923[_0x28ba('0x1d')](_0x4ebcd6)[_0x28ba('0x1e')](_0x29cd51);}};}function respondWithFilteredResult(_0x1c5998,_0x563797){return function(_0x24b3f3){if(_0x24b3f3){var _0x38df4f=typeof _0x563797[_0x28ba('0x1f')]===_0x28ba('0x20')&&typeof _0x563797[_0x28ba('0x21')]==='undefined';var _0x571c92=_0x24b3f3[_0x28ba('0x22')];var _0x182824=_0x38df4f?0x0:_0x563797[_0x28ba('0x1f')];var _0x2cf1cf=_0x38df4f?_0x24b3f3[_0x28ba('0x22')]:_0x563797[_0x28ba('0x1f')]+_0x563797[_0x28ba('0x21')];var _0x31a45b;if(_0x2cf1cf>=_0x571c92){_0x2cf1cf=_0x571c92;_0x31a45b=0xc8;}else{_0x31a45b=0xce;}_0x1c5998[_0x28ba('0x1d')](_0x31a45b);return _0x1c5998['set']('Content-Range',_0x182824+'-'+_0x2cf1cf+'/'+_0x571c92)[_0x28ba('0x1e')](_0x24b3f3);}return null;};}function patchUpdates(_0x4352a4){return function(_0x5d3d33){try{jsonpatch['apply'](_0x5d3d33,_0x4352a4,!![]);}catch(_0xf9e0f4){return BPromise[_0x28ba('0x23')](_0xf9e0f4);}return _0x5d3d33[_0x28ba('0x24')]();};}function saveUpdates(_0x17b1f4,_0x425732){return function(_0x4ff05c){if(_0x4ff05c){return _0x4ff05c[_0x28ba('0x25')](_0x17b1f4)[_0x28ba('0x26')](function(_0x1684af){return _0x1684af;});}return null;};}function removeEntity(_0x3eec5d,_0x27a579){return function(_0x256892){if(_0x256892){return _0x256892['destroy']()[_0x28ba('0x26')](function(){var _0x46969a=_0x256892[_0x28ba('0x27')]({'plain':!![]});var _0x1d3fd1=_0x28ba('0x28');return db[_0x28ba('0x29')]['destroy']({'where':{'type':_0x1d3fd1,'resourceId':_0x46969a['id']}})[_0x28ba('0x26')](function(){return _0x256892;});})[_0x28ba('0x26')](function(){_0x3eec5d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36dc29,_0x3e1ce7){return function(_0x5b9237){if(!_0x5b9237){_0x36dc29['sendStatus'](0x194);}return _0x5b9237;};}function handleError(_0x4267b4,_0x3638c5){_0x3638c5=_0x3638c5||0x1f4;return function(_0x39cd83){logger[_0x28ba('0x2a')](_0x39cd83[_0x28ba('0x2b')]);if(_0x39cd83[_0x28ba('0x2c')]){delete _0x39cd83[_0x28ba('0x2c')];}_0x4267b4[_0x28ba('0x1d')](_0x3638c5)[_0x28ba('0x2d')](_0x39cd83);};}exports[_0x28ba('0x2e')]=function(_0x296b66,_0x32ab4b){var _0x27737d={},_0x2c712e={},_0x5f0202={'count':0x0,'rows':[]};var _0x13dfd4=_[_0x28ba('0x2f')](db[_0x28ba('0x30')]['rawAttributes'],function(_0x2c32f3){return{'name':_0x2c32f3[_0x28ba('0x31')],'type':_0x2c32f3[_0x28ba('0x32')]['key']};});_0x2c712e[_0x28ba('0x33')]=_[_0x28ba('0x2f')](_0x13dfd4,_0x28ba('0x2c'));_0x2c712e[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x296b66[_0x28ba('0x34')]);_0x2c712e[_0x28ba('0x36')]=_[_0x28ba('0x37')](_0x2c712e[_0x28ba('0x33')],_0x2c712e[_0x28ba('0x34')]);_0x27737d['attributes']=_[_0x28ba('0x37')](_0x2c712e[_0x28ba('0x33')],qs[_0x28ba('0x38')](_0x296b66['query'][_0x28ba('0x38')]));_0x27737d[_0x28ba('0x39')]=_0x27737d[_0x28ba('0x39')][_0x28ba('0x3a')]?_0x27737d[_0x28ba('0x39')]:_0x2c712e[_0x28ba('0x33')];if(!_0x296b66[_0x28ba('0x34')][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x27737d[_0x28ba('0x21')]=qs[_0x28ba('0x21')](_0x296b66[_0x28ba('0x34')]['limit']);_0x27737d['offset']=qs['offset'](_0x296b66[_0x28ba('0x34')][_0x28ba('0x1f')]);}_0x27737d['order']=qs[_0x28ba('0x3d')](_0x296b66[_0x28ba('0x34')]['sort']);_0x27737d['where']=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x296b66['query'],_0x2c712e['filters']),_0x13dfd4);if(_0x296b66[_0x28ba('0x34')][_0x28ba('0x3f')]){_0x27737d[_0x28ba('0x40')]=_[_0x28ba('0x41')](_0x27737d[_0x28ba('0x40')],{'$or':_[_0x28ba('0x2f')](_0x13dfd4,function(_0x241a4a){if(_0x241a4a[_0x28ba('0x32')]!==_0x28ba('0x42')){var _0x5b0174={};_0x5b0174[_0x241a4a['name']]={'$like':'%'+_0x296b66['query'][_0x28ba('0x3f')]+'%'};return _0x5b0174;}})});}_0x27737d=_[_0x28ba('0x41')]({},_0x27737d,_0x296b66[_0x28ba('0x43')]);var _0x2f5ce4={'where':_0x27737d[_0x28ba('0x40')]};return db['Campaign']['count'](_0x2f5ce4)['then'](function(_0x424f73){_0x5f0202[_0x28ba('0x22')]=_0x424f73;if(_0x296b66[_0x28ba('0x34')][_0x28ba('0x44')]){_0x27737d[_0x28ba('0x45')]=[{'all':!![]}];}return db['Campaign'][_0x28ba('0x46')](_0x27737d);})[_0x28ba('0x26')](function(_0x364b7a){_0x5f0202[_0x28ba('0x47')]=_0x364b7a;return _0x5f0202;})[_0x28ba('0x26')](respondWithFilteredResult(_0x32ab4b,_0x27737d))[_0x28ba('0x48')](handleError(_0x32ab4b,null));};exports[_0x28ba('0x49')]=function(_0x1c12f4,_0x213497){var _0x4c550c={'raw':![],'where':{'id':_0x1c12f4[_0x28ba('0x4a')]['id']}},_0x53f882={};_0x53f882[_0x28ba('0x33')]=_[_0x28ba('0x35')](db[_0x28ba('0x30')][_0x28ba('0x4b')]);_0x53f882['query']=_['keys'](_0x1c12f4['query']);_0x53f882['filters']=_[_0x28ba('0x37')](_0x53f882[_0x28ba('0x33')],_0x53f882[_0x28ba('0x34')]);_0x4c550c[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x53f882[_0x28ba('0x33')],qs['fields'](_0x1c12f4[_0x28ba('0x34')][_0x28ba('0x38')]));_0x4c550c['attributes']=_0x4c550c['attributes'][_0x28ba('0x3a')]?_0x4c550c['attributes']:_0x53f882[_0x28ba('0x33')];if(_0x1c12f4[_0x28ba('0x34')]['includeAll']){_0x4c550c[_0x28ba('0x45')]=[{'all':!![]}];}_0x4c550c=_['merge']({},_0x4c550c,_0x1c12f4[_0x28ba('0x43')]);return db['Campaign'][_0x28ba('0x4c')](_0x4c550c)[_0x28ba('0x26')](handleEntityNotFound(_0x213497,null))[_0x28ba('0x26')](respondWithResult(_0x213497,null))[_0x28ba('0x48')](handleError(_0x213497,null));};exports[_0x28ba('0x4d')]=function(_0x4047c1,_0x5ccfab){return db[_0x28ba('0x30')]['create'](_0x4047c1['body'],{})[_0x28ba('0x26')](function(_0xd327ac){var _0x21931b=_0x4047c1[_0x28ba('0x4e')]['get']({'plain':!![]});if(!_0x21931b)throw new Error(_0x28ba('0x4f'));if(_0x21931b['role']==='user'){var _0x38bf5b=_0xd327ac[_0x28ba('0x27')]({'plain':!![]});var _0xf0938f=_0x28ba('0x28');return db[_0x28ba('0x50')][_0x28ba('0x4c')]({'where':{'name':_0xf0938f,'userProfileId':_0x21931b[_0x28ba('0x51')]},'raw':!![]})[_0x28ba('0x26')](function(_0x5aac05){if(_0x5aac05&&_0x5aac05[_0x28ba('0x52')]===0x0){return db[_0x28ba('0x29')][_0x28ba('0x4d')]({'name':_0x38bf5b[_0x28ba('0x2c')],'resourceId':_0x38bf5b['id'],'type':_0x5aac05[_0x28ba('0x2c')],'sectionId':_0x5aac05['id']},{})['then'](function(){return _0xd327ac;});}else{return _0xd327ac;}})[_0x28ba('0x48')](function(_0x2ec307){logger[_0x28ba('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ec307);throw _0x2ec307;});}return _0xd327ac;})[_0x28ba('0x26')](respondWithResult(_0x5ccfab,0xc9))[_0x28ba('0x48')](handleError(_0x5ccfab,null));};exports[_0x28ba('0x53')]=function(_0x4f5a05,_0x23e1fc){var _0x5c596d={'where':{'id':_0x4f5a05[_0x28ba('0x4a')]['id']}},_0x42a48f={};_0x42a48f['model']=_[_0x28ba('0x35')](db[_0x28ba('0x30')][_0x28ba('0x4b')]);_0x5c596d[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x42a48f[_0x28ba('0x33')],qs[_0x28ba('0x38')](_0x4f5a05[_0x28ba('0x34')][_0x28ba('0x38')]));_0x5c596d[_0x28ba('0x39')]=_0x5c596d[_0x28ba('0x39')]['length']?_0x5c596d[_0x28ba('0x39')]:_0x42a48f[_0x28ba('0x33')];if(_0x4f5a05[_0x28ba('0x34')][_0x28ba('0x44')]){_0x5c596d[_0x28ba('0x45')]=[{'all':!![]}];}_0x5c596d=_['merge']({},_0x5c596d,_0x4f5a05[_0x28ba('0x43')]);return db[_0x28ba('0x30')][_0x28ba('0x4c')](_0x5c596d)[_0x28ba('0x26')](handleEntityNotFound(_0x23e1fc,null))[_0x28ba('0x26')](function(_0x346b95){if(_0x346b95){var _0xb70fd6=_0x346b95['get']({'plain':!![]});_0xb70fd6=qs[_0x28ba('0x54')](_0xb70fd6,['id',_0x28ba('0x55'),'updatedAt']);_0x4f5a05[_0x28ba('0x56')]=_[_0x28ba('0x54')](_0x4f5a05['body'],['id','createdAt','updatedAt']);return db['Campaign'][_0x28ba('0x4d')](_[_0x28ba('0x41')](_0xb70fd6,_0x4f5a05['body']),{'include':_0x4f5a05['query'][_0x28ba('0x44')]?[{'all':!![]}]:undefined})[_0x28ba('0x26')](function(_0x197a02){var _0x5619db=_0x4f5a05[_0x28ba('0x4e')][_0x28ba('0x27')]({'plain':!![]});if(!_0x5619db)throw new Error(_0x28ba('0x4f'));if(_0x5619db[_0x28ba('0x57')]===_0x28ba('0x4e')){var _0x26e97b=_0x197a02[_0x28ba('0x27')]({'plain':!![]});var _0x1b6f23=_0x28ba('0x28');return db['UserProfileSection'][_0x28ba('0x4c')]({'where':{'name':_0x1b6f23,'userProfileId':_0x5619db['userProfileId']},'raw':!![]})[_0x28ba('0x26')](function(_0x55011e){if(_0x55011e&&_0x55011e[_0x28ba('0x52')]===0x0){return db['UserProfileResource'][_0x28ba('0x4d')]({'name':_0x26e97b[_0x28ba('0x2c')],'resourceId':_0x26e97b['id'],'type':_0x55011e['name'],'sectionId':_0x55011e['id']},{})['then'](function(){return _0x197a02;});}else{return _0x197a02;}})[_0x28ba('0x48')](function(_0xd9b819){logger[_0x28ba('0x2a')](_0x28ba('0x58'),_0xd9b819);throw _0xd9b819;});}return _0x197a02;});}})[_0x28ba('0x26')](respondWithResult(_0x23e1fc,0xc9))['catch'](handleError(_0x23e1fc,null));};exports['update']=function(_0x307db6,_0x3a309a){if(_0x307db6[_0x28ba('0x56')]['id']){delete _0x307db6['body']['id'];}return db['Campaign'][_0x28ba('0x4c')]({'where':{'id':_0x307db6['params']['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x3a309a,null))[_0x28ba('0x26')](saveUpdates(_0x307db6[_0x28ba('0x56')],null))[_0x28ba('0x26')](respondWithResult(_0x3a309a,null))['catch'](handleError(_0x3a309a,null));};exports[_0x28ba('0x59')]=function(_0x2406c2,_0x4f3da0){return db['Campaign'][_0x28ba('0x4c')]({'where':{'id':_0x2406c2[_0x28ba('0x4a')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x4f3da0,null))[_0x28ba('0x26')](removeEntity(_0x4f3da0,null))['catch'](handleError(_0x4f3da0,null));};exports[_0x28ba('0x5a')]=function(_0x1c7a28,_0x583c80,_0x20a8af){var _0x3010a1={'raw':!![],'where':{}};var _0x23caa8={};var _0x5f035d={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1c7a28['params']['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x583c80,null))[_0x28ba('0x26')](function(_0x21703f){if(_0x21703f){_0x23caa8[_0x28ba('0x33')]=_['keys'](db[_0x28ba('0x5b')][_0x28ba('0x4b')]);_0x23caa8[_0x28ba('0x34')]=_['keys'](_0x1c7a28[_0x28ba('0x34')]);_0x23caa8[_0x28ba('0x36')]=_['intersection'](_0x23caa8[_0x28ba('0x33')],_0x23caa8[_0x28ba('0x34')]);_0x3010a1[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x23caa8[_0x28ba('0x33')],qs['fields'](_0x1c7a28[_0x28ba('0x34')]['fields']));_0x3010a1[_0x28ba('0x39')]=_0x3010a1[_0x28ba('0x39')][_0x28ba('0x3a')]?_0x3010a1[_0x28ba('0x39')]:_0x23caa8[_0x28ba('0x33')];if(!_0x1c7a28[_0x28ba('0x34')][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x3010a1[_0x28ba('0x21')]=qs[_0x28ba('0x21')](_0x1c7a28[_0x28ba('0x34')]['limit']);_0x3010a1[_0x28ba('0x1f')]=qs['offset'](_0x1c7a28[_0x28ba('0x34')][_0x28ba('0x1f')]);}_0x3010a1[_0x28ba('0x5c')]=qs['sort'](_0x1c7a28[_0x28ba('0x34')][_0x28ba('0x3d')]);_0x3010a1[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x1c7a28['query'],_0x23caa8['filters']));_0x3010a1['where']['CampaignId']=_0x21703f['id'];if(_0x1c7a28[_0x28ba('0x34')][_0x28ba('0x3f')]){_0x3010a1['where']=_['merge'](_0x3010a1['where'],{'$or':_[_0x28ba('0x2f')](_0x3010a1[_0x28ba('0x39')],function(_0x594eda){var _0x92ea20={};_0x92ea20[_0x594eda]={'$like':'%'+_0x1c7a28[_0x28ba('0x34')][_0x28ba('0x3f')]+'%'};return _0x92ea20;})});}_0x3010a1=_[_0x28ba('0x41')]({},_0x3010a1,_0x1c7a28[_0x28ba('0x43')]);return db[_0x28ba('0x5b')][_0x28ba('0x22')]({'where':_0x3010a1[_0x28ba('0x40')]})['then'](function(_0x4d8eb7){_0x5f035d[_0x28ba('0x22')]=_0x4d8eb7;if(_0x1c7a28[_0x28ba('0x34')]['includeAll']){_0x3010a1['include']=[{'all':!![]}];}return db[_0x28ba('0x5b')]['findAll'](_0x3010a1);})[_0x28ba('0x26')](function(_0x5187a9){_0x5f035d[_0x28ba('0x47')]=_0x5187a9;return _0x5f035d;});}})[_0x28ba('0x26')](respondWithFilteredResult(_0x583c80,_0x3010a1))[_0x28ba('0x48')](handleError(_0x583c80,null));};exports[_0x28ba('0x5d')]=function(_0x446eb8,_0x49df4f,_0x30cfd5){var _0x5501dd={'raw':!![],'where':{}};var _0x1479c9={};var _0x14064b={'count':0x0,'rows':[]};return db[_0x28ba('0x30')][_0x28ba('0x5e')]({'where':{'id':_0x446eb8['params']['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x49df4f,null))[_0x28ba('0x26')](function(_0x3f1ff8){if(_0x3f1ff8){_0x1479c9[_0x28ba('0x33')]=_[_0x28ba('0x35')](db[_0x28ba('0x5f')][_0x28ba('0x4b')]);_0x1479c9[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x446eb8['query']);_0x1479c9[_0x28ba('0x36')]=_[_0x28ba('0x37')](_0x1479c9[_0x28ba('0x33')],_0x1479c9['query']);_0x5501dd[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x1479c9[_0x28ba('0x33')],qs[_0x28ba('0x38')](_0x446eb8['query'][_0x28ba('0x38')]));_0x5501dd[_0x28ba('0x39')]=_0x5501dd['attributes'][_0x28ba('0x3a')]?_0x5501dd[_0x28ba('0x39')]:_0x1479c9[_0x28ba('0x33')];if(!_0x446eb8[_0x28ba('0x34')][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x5501dd[_0x28ba('0x21')]=qs['limit'](_0x446eb8[_0x28ba('0x34')][_0x28ba('0x21')]);_0x5501dd[_0x28ba('0x1f')]=qs[_0x28ba('0x1f')](_0x446eb8['query'][_0x28ba('0x1f')]);}_0x5501dd[_0x28ba('0x5c')]=qs[_0x28ba('0x3d')](_0x446eb8[_0x28ba('0x34')][_0x28ba('0x3d')]);_0x5501dd[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x446eb8[_0x28ba('0x34')],_0x1479c9[_0x28ba('0x36')]));_0x5501dd[_0x28ba('0x40')][_0x28ba('0x60')]=_0x3f1ff8['id'];if(_0x446eb8[_0x28ba('0x34')][_0x28ba('0x3f')]){_0x5501dd[_0x28ba('0x40')]=_[_0x28ba('0x41')](_0x5501dd[_0x28ba('0x40')],{'$or':_[_0x28ba('0x2f')](_0x5501dd[_0x28ba('0x39')],function(_0x23989a){var _0x1bf246={};_0x1bf246[_0x23989a]={'$like':'%'+_0x446eb8[_0x28ba('0x34')][_0x28ba('0x3f')]+'%'};return _0x1bf246;})});}_0x5501dd=_[_0x28ba('0x41')]({},_0x5501dd,_0x446eb8[_0x28ba('0x43')]);return db['CmHopperHistory'][_0x28ba('0x22')]({'where':_0x5501dd[_0x28ba('0x40')]})[_0x28ba('0x26')](function(_0x10ae47){_0x14064b['count']=_0x10ae47;if(_0x446eb8[_0x28ba('0x34')][_0x28ba('0x44')]){_0x5501dd[_0x28ba('0x45')]=[{'all':!![]}];}return db[_0x28ba('0x5f')]['findAll'](_0x5501dd);})['then'](function(_0x76c22){_0x14064b[_0x28ba('0x47')]=_0x76c22;return _0x14064b;});}})[_0x28ba('0x26')](respondWithFilteredResult(_0x49df4f,_0x5501dd))[_0x28ba('0x48')](handleError(_0x49df4f,null));};exports[_0x28ba('0x61')]=function(_0x50ae1b,_0x1e73e8,_0x3d14dd){var _0x199678={'raw':!![],'where':{}};var _0x40c504={};var _0x2f2ce0={'count':0x0,'rows':[]};return db[_0x28ba('0x30')][_0x28ba('0x5e')]({'where':{'id':_0x50ae1b[_0x28ba('0x4a')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x1e73e8,null))[_0x28ba('0x26')](function(_0x54e472){if(_0x54e472){_0x40c504[_0x28ba('0x33')]=_[_0x28ba('0x35')](db[_0x28ba('0x62')][_0x28ba('0x4b')]);_0x40c504[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x50ae1b[_0x28ba('0x34')]);_0x40c504[_0x28ba('0x36')]=_[_0x28ba('0x37')](_0x40c504['model'],_0x40c504['query']);_0x199678['attributes']=_[_0x28ba('0x37')](_0x40c504['model'],qs[_0x28ba('0x38')](_0x50ae1b['query'][_0x28ba('0x38')]));_0x199678[_0x28ba('0x39')]=_0x199678[_0x28ba('0x39')][_0x28ba('0x3a')]?_0x199678[_0x28ba('0x39')]:_0x40c504['model'];if(!_0x50ae1b[_0x28ba('0x34')][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x199678['limit']=qs[_0x28ba('0x21')](_0x50ae1b[_0x28ba('0x34')]['limit']);_0x199678[_0x28ba('0x1f')]=qs[_0x28ba('0x1f')](_0x50ae1b['query'][_0x28ba('0x1f')]);}_0x199678['order']=qs['sort'](_0x50ae1b[_0x28ba('0x34')][_0x28ba('0x3d')]);_0x199678[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x50ae1b[_0x28ba('0x34')],_0x40c504[_0x28ba('0x36')]));_0x199678[_0x28ba('0x40')][_0x28ba('0x60')]=_0x54e472['id'];if(_0x50ae1b[_0x28ba('0x34')]['filter']){_0x199678[_0x28ba('0x40')]=_[_0x28ba('0x41')](_0x199678[_0x28ba('0x40')],{'$or':_[_0x28ba('0x2f')](_0x199678[_0x28ba('0x39')],function(_0x3aae9b){var _0x3f41d8={};_0x3f41d8[_0x3aae9b]={'$like':'%'+_0x50ae1b[_0x28ba('0x34')][_0x28ba('0x3f')]+'%'};return _0x3f41d8;})});}_0x199678=_[_0x28ba('0x41')]({},_0x199678,_0x50ae1b[_0x28ba('0x43')]);return db['CmHopperFinal'][_0x28ba('0x22')]({'where':_0x199678['where']})['then'](function(_0x24dff5){_0x2f2ce0['count']=_0x24dff5;if(_0x50ae1b[_0x28ba('0x34')][_0x28ba('0x44')]){_0x199678[_0x28ba('0x45')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x28ba('0x46')](_0x199678);})['then'](function(_0x4e4706){_0x2f2ce0[_0x28ba('0x47')]=_0x4e4706;return _0x2f2ce0;});}})['then'](respondWithFilteredResult(_0x1e73e8,_0x199678))['catch'](handleError(_0x1e73e8,null));};exports[_0x28ba('0x63')]=function(_0x9620df,_0x5adbef,_0x5c152f){var _0x51a749={'raw':!![],'where':{}};var _0x197c35={};var _0x1ffb9c={'count':0x0,'rows':[]};return db[_0x28ba('0x30')]['findOne']({'where':{'id':_0x9620df['params']['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x5adbef,null))['then'](function(_0x430f69){if(_0x430f69){_0x197c35[_0x28ba('0x33')]=_[_0x28ba('0x35')](db[_0x28ba('0x64')][_0x28ba('0x4b')]);_0x197c35['query']=_[_0x28ba('0x35')](_0x9620df[_0x28ba('0x34')]);_0x197c35[_0x28ba('0x36')]=_['intersection'](_0x197c35[_0x28ba('0x33')],_0x197c35[_0x28ba('0x34')]);_0x51a749[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x197c35[_0x28ba('0x33')],qs[_0x28ba('0x38')](_0x9620df[_0x28ba('0x34')][_0x28ba('0x38')]));_0x51a749[_0x28ba('0x39')]=_0x51a749[_0x28ba('0x39')][_0x28ba('0x3a')]?_0x51a749[_0x28ba('0x39')]:_0x197c35[_0x28ba('0x33')];if(!_0x9620df['query'][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x51a749[_0x28ba('0x21')]=qs['limit'](_0x9620df[_0x28ba('0x34')]['limit']);_0x51a749[_0x28ba('0x1f')]=qs['offset'](_0x9620df[_0x28ba('0x34')]['offset']);}_0x51a749['order']=qs[_0x28ba('0x3d')](_0x9620df[_0x28ba('0x34')]['sort']);_0x51a749[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x9620df[_0x28ba('0x34')],_0x197c35[_0x28ba('0x36')]));_0x51a749[_0x28ba('0x40')][_0x28ba('0x60')]=_0x430f69['id'];if(_0x9620df['query'][_0x28ba('0x3f')]){_0x51a749[_0x28ba('0x40')]=_[_0x28ba('0x41')](_0x51a749['where'],{'$or':_[_0x28ba('0x2f')](_0x51a749[_0x28ba('0x39')],function(_0x566c4c){var _0x3565bf={};_0x3565bf[_0x566c4c]={'$like':'%'+_0x9620df[_0x28ba('0x34')][_0x28ba('0x3f')]+'%'};return _0x3565bf;})});}_0x51a749=_['merge']({},_0x51a749,_0x9620df[_0x28ba('0x43')]);return db[_0x28ba('0x64')][_0x28ba('0x22')]({'where':_0x51a749['where']})[_0x28ba('0x26')](function(_0x1df894){_0x1ffb9c[_0x28ba('0x22')]=_0x1df894;if(_0x9620df[_0x28ba('0x34')]['includeAll']){_0x51a749[_0x28ba('0x45')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x51a749);})[_0x28ba('0x26')](function(_0x2b4781){_0x1ffb9c[_0x28ba('0x47')]=_0x2b4781;return _0x1ffb9c;});}})[_0x28ba('0x26')](respondWithFilteredResult(_0x5adbef,_0x51a749))[_0x28ba('0x48')](handleError(_0x5adbef,null));};exports['getLists']=function(_0x385379,_0x533ca2,_0x265ada){var _0x4c8581={};var _0x509ec7={};var _0x2598dc;var _0x528740;return db[_0x28ba('0x30')][_0x28ba('0x5e')]({'where':{'id':_0x385379[_0x28ba('0x4a')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x533ca2,null))[_0x28ba('0x26')](function(_0x1c6a1e){if(_0x1c6a1e){_0x2598dc=_0x1c6a1e;_0x509ec7[_0x28ba('0x33')]=_['keys'](db['CmList']['rawAttributes']);_0x509ec7[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x385379[_0x28ba('0x34')]);_0x509ec7['filters']=_[_0x28ba('0x37')](_0x509ec7[_0x28ba('0x33')],_0x509ec7[_0x28ba('0x34')]);_0x4c8581['attributes']=_['intersection'](_0x509ec7[_0x28ba('0x33')],qs[_0x28ba('0x38')](_0x385379[_0x28ba('0x34')]['fields']));_0x4c8581[_0x28ba('0x39')]=_0x4c8581['attributes'][_0x28ba('0x3a')]?_0x4c8581['attributes']:_0x509ec7[_0x28ba('0x33')];_0x4c8581[_0x28ba('0x5c')]=qs[_0x28ba('0x3d')](_0x385379[_0x28ba('0x34')][_0x28ba('0x3d')]);_0x4c8581[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x385379[_0x28ba('0x34')],_0x509ec7[_0x28ba('0x36')]));if(_0x385379[_0x28ba('0x34')][_0x28ba('0x3f')]){_0x4c8581[_0x28ba('0x40')]=_['merge'](_0x4c8581['where'],{'$or':_[_0x28ba('0x2f')](_0x4c8581['attributes'],function(_0x5c4156){var _0x276c64={};_0x276c64[_0x5c4156]={'$like':'%'+_0x385379['query'][_0x28ba('0x3f')]+'%'};return _0x276c64;})});}_0x4c8581=_[_0x28ba('0x41')]({},_0x4c8581,_0x385379[_0x28ba('0x43')]);return _0x2598dc[_0x28ba('0x65')](_0x4c8581);}})[_0x28ba('0x26')](function(_0x39a74b){if(_0x39a74b){_0x528740=_0x39a74b[_0x28ba('0x3a')];if(!_0x385379[_0x28ba('0x34')][_0x28ba('0x3b')]('nolimit')){_0x4c8581[_0x28ba('0x21')]=qs['limit'](_0x385379[_0x28ba('0x34')][_0x28ba('0x21')]);_0x4c8581[_0x28ba('0x1f')]=qs[_0x28ba('0x1f')](_0x385379[_0x28ba('0x34')][_0x28ba('0x1f')]);}return _0x2598dc[_0x28ba('0x65')](_0x4c8581);}})[_0x28ba('0x26')](function(_0x2a5513){if(_0x2a5513){return _0x2a5513?{'count':_0x528740,'rows':_0x2a5513}:null;}})['then'](respondWithResult(_0x533ca2,null))[_0x28ba('0x48')](handleError(_0x533ca2,null));};exports[_0x28ba('0x66')]=function(_0x2dea45,_0x3ec666,_0x5bdefb){var _0x5a3e6e,_0x1a84c6;var _0x4569ab=[];var _0x5de0f3=moment()[_0x28ba('0x67')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x28ba('0x30')]['find']({'where':{'id':_0x2dea45['params']['id']}})['then'](handleEntityNotFound(_0x3ec666,null))[_0x28ba('0x26')](function(_0x1f85a1){if(_0x1f85a1){_0x1a84c6=_0x1f85a1;return _0x1f85a1['addLists'](_0x2dea45[_0x28ba('0x56')]['ids'],_[_0x28ba('0x54')](_0x2dea45['body'],[_0x28ba('0x68'),'id'])||{});}return null;})[_0x28ba('0x69')](function(_0x48c6ef){var _0x1688ad;var _0x3376a8;_0x5a3e6e=_0x48c6ef||[];var _0x2e5bc2=[];if(_0x48c6ef){for(var _0x3d282f=0x0;_0x3d282f<_0x48c6ef[_0x28ba('0x3a')];_0x3d282f+=0x1){var _0x38b12a=_0x48c6ef[_0x3d282f][_0x28ba('0x27')]({'plain':!![]});_0x1a84c6[_0x28ba('0x6a')]=_0x2dea45[_0x28ba('0x56')][_0x28ba('0x6a')]?_0x2dea45[_0x28ba('0x56')]['dialCheckDuplicateType']:_0x1a84c6[_0x28ba('0x6a')];switch(_0x1a84c6['dialCheckDuplicateType']){case _0x28ba('0x6b'):_0x1688ad=squel['insert']()[_0x28ba('0x6c')]('cm_hopper')['fromQuery']([_0x28ba('0x6d'),_0x28ba('0x6e'),_0x28ba('0x6f'),'ListId',_0x28ba('0x60'),'createdAt',_0x28ba('0x70')],squel[_0x28ba('0x71')]()[_0x28ba('0x72')](_0x28ba('0x6d'),_0x28ba('0x6d'))[_0x28ba('0x72')](_0x28ba('0x73'),_0x28ba('0x6e'))[_0x28ba('0x72')]('id',_0x28ba('0x6f'))[_0x28ba('0x72')](_0x38b12a[_0x28ba('0x74')]['toString'](),_0x28ba('0x75'))['field'](_0x2dea45[_0x28ba('0x4a')]['id'][_0x28ba('0x76')](),_0x28ba('0x60'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x55'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27','updatedAt')[_0x28ba('0x77')](_0x28ba('0x78'))['where'](_0x28ba('0x79'))['where']('ListId\x20=\x20?',_0x38b12a['CmListId']['toString']())[_0x28ba('0x40')](_0x28ba('0x7a'))[_0x28ba('0x40')](_0x28ba('0x7b'),squel[_0x28ba('0x71')]()['field'](_0x28ba('0x7c'))['from']('cm_hopper_final')[_0x28ba('0x40')](_0x28ba('0x7d'),_0x2dea45[_0x28ba('0x4a')]['id']['toString']()))[_0x28ba('0x40')](_0x28ba('0x7b'),squel[_0x28ba('0x71')]()[_0x28ba('0x72')](_0x28ba('0x7e'))['from'](_0x28ba('0x7f'))[_0x28ba('0x40')](_0x28ba('0x7d'),_0x2dea45['params']['id']['toString']())))[_0x28ba('0x76')]();break;case _0x28ba('0x80'):_0x1688ad=squel['insert']()[_0x28ba('0x6c')](_0x28ba('0x7f'))[_0x28ba('0x81')]([_0x28ba('0x6d'),_0x28ba('0x6e'),_0x28ba('0x6f'),'ListId',_0x28ba('0x60'),'createdAt','updatedAt'],squel['select']()[_0x28ba('0x72')](_0x28ba('0x6d'),'phone')[_0x28ba('0x72')](_0x28ba('0x73'),_0x28ba('0x6e'))[_0x28ba('0x72')]('id',_0x28ba('0x6f'))['field'](_0x38b12a['CmListId']['toString'](),'ListId')[_0x28ba('0x72')](_0x2dea45[_0x28ba('0x4a')]['id']['toString'](),_0x28ba('0x60'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x55'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27','updatedAt')['from'](_0x28ba('0x78'))[_0x28ba('0x40')](_0x28ba('0x79'))[_0x28ba('0x40')](_0x28ba('0x82'),_0x38b12a[_0x28ba('0x74')]['toString']())[_0x28ba('0x40')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x28ba('0x7b'),squel[_0x28ba('0x71')]()['field'](_0x28ba('0x7e'))[_0x28ba('0x77')](_0x28ba('0x7f'))[_0x28ba('0x40')]('CampaignId\x20=\x20?',_0x2dea45[_0x28ba('0x4a')]['id'][_0x28ba('0x76')]())))['toString']();break;default:_0x1688ad=squel[_0x28ba('0x83')]()[_0x28ba('0x6c')](_0x28ba('0x7f'))['fromQuery']([_0x28ba('0x6d'),_0x28ba('0x6e'),_0x28ba('0x6f'),'ListId',_0x28ba('0x60'),_0x28ba('0x55'),'updatedAt'],squel[_0x28ba('0x71')]()['field'](_0x28ba('0x6d'),_0x28ba('0x6d'))[_0x28ba('0x72')](_0x28ba('0x73'),'scheduledAt')[_0x28ba('0x72')]('id',_0x28ba('0x6f'))[_0x28ba('0x72')](_0x38b12a['CmListId'][_0x28ba('0x76')](),_0x28ba('0x75'))['field'](_0x2dea45[_0x28ba('0x4a')]['id']['toString'](),_0x28ba('0x60'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x55'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x70'))[_0x28ba('0x77')](_0x28ba('0x78'))[_0x28ba('0x40')](_0x28ba('0x79'))[_0x28ba('0x40')](_0x28ba('0x82'),_0x38b12a[_0x28ba('0x74')][_0x28ba('0x76')]())[_0x28ba('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x28ba('0x76')]();}_0x3376a8=squel[_0x28ba('0x83')]()['into'](_0x28ba('0x84'))['fromQuery']([_0x28ba('0x85'),_0x28ba('0x6e'),_0x28ba('0x6d'),_0x28ba('0x86'),'createdAt',_0x28ba('0x70')],squel[_0x28ba('0x71')]()['field']('h.id','id')['field'](_0x28ba('0x73'),'scheduledAt')[_0x28ba('0x72')]('ci.item',_0x28ba('0x6d'))[_0x28ba('0x72')](_0x28ba('0x87'),_0x28ba('0x86'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x55'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x70'))[_0x28ba('0x77')](_0x28ba('0x88'),'ci')[_0x28ba('0x89')](_0x28ba('0x7f'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x28ba('0x40')](_0x28ba('0x8a'),_0x38b12a['CmListId'][_0x28ba('0x76')]())[_0x28ba('0x40')](_0x28ba('0x8b'),_0x2dea45['params']['id'][_0x28ba('0x76')]())[_0x28ba('0x40')](_0x28ba('0x8c'),_0x5de0f3))['toString']();_0x2e5bc2['push'](db['sequelize'][_0x28ba('0x34')](_0x1688ad));_0x4569ab[_0x28ba('0x8d')](db[_0x28ba('0x8e')][_0x28ba('0x34')](_0x3376a8));}return BPromise[_0x28ba('0x8f')](_0x2e5bc2);}})['then'](function(){return BPromise[_0x28ba('0x8f')](_0x4569ab);})[_0x28ba('0x26')](function(){return _0x5a3e6e;})[_0x28ba('0x26')](respondWithResult(_0x3ec666,null))['catch'](handleError(_0x3ec666,null));};exports[_0x28ba('0x90')]=function(_0x5bc61a,_0x1fc67c,_0x309ce9){return db[_0x28ba('0x30')][_0x28ba('0x4c')]({'where':{'id':_0x5bc61a['params']['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x1fc67c,null))['then'](function(_0x184de3){if(_0x184de3){return _0x184de3[_0x28ba('0x90')](_0x5bc61a[_0x28ba('0x34')][_0x28ba('0x68')]);}})[_0x28ba('0x26')](function(_0x499099){if(_0x499099){return db['CmHopper'][_0x28ba('0x59')]({'where':{'ListId':_0x5bc61a[_0x28ba('0x34')]['ids'],'CampaignId':_0x5bc61a[_0x28ba('0x4a')]['id']}})[_0x28ba('0x26')](function(){return _0x499099;});}})['then'](respondWithStatusCode(_0x1fc67c,null))[_0x28ba('0x48')](handleError(_0x1fc67c,null));};exports[_0x28ba('0x91')]=function(_0x4e7026,_0xa4a083,_0x5109b9){var _0x388565={};var _0x3429b2={};var _0x7b6da9;var _0x57f2b4;return db[_0x28ba('0x30')][_0x28ba('0x5e')]({'where':{'id':_0x4e7026[_0x28ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa4a083,null))[_0x28ba('0x26')](function(_0x2132ce){if(_0x2132ce){_0x7b6da9=_0x2132ce;_0x3429b2[_0x28ba('0x33')]=_['keys'](db[_0x28ba('0x92')][_0x28ba('0x4b')]);_0x3429b2[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x4e7026[_0x28ba('0x34')]);_0x3429b2[_0x28ba('0x36')]=_[_0x28ba('0x37')](_0x3429b2['model'],_0x3429b2[_0x28ba('0x34')]);_0x388565[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x3429b2['model'],qs[_0x28ba('0x38')](_0x4e7026['query'][_0x28ba('0x38')]));_0x388565[_0x28ba('0x39')]=_0x388565[_0x28ba('0x39')][_0x28ba('0x3a')]?_0x388565[_0x28ba('0x39')]:_0x3429b2[_0x28ba('0x33')];_0x388565[_0x28ba('0x5c')]=qs[_0x28ba('0x3d')](_0x4e7026[_0x28ba('0x34')]['sort']);_0x388565[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x4e7026[_0x28ba('0x34')],_0x3429b2[_0x28ba('0x36')]));if(_0x4e7026[_0x28ba('0x34')][_0x28ba('0x3f')]){_0x388565[_0x28ba('0x40')]=_['merge'](_0x388565['where'],{'$or':_[_0x28ba('0x2f')](_0x388565[_0x28ba('0x39')],function(_0x49188c){var _0x19251f={};_0x19251f[_0x49188c]={'$like':'%'+_0x4e7026[_0x28ba('0x34')][_0x28ba('0x3f')]+'%'};return _0x19251f;})});}_0x388565=_[_0x28ba('0x41')]({},_0x388565,_0x4e7026['options']);return _0x7b6da9['getBlackLists'](_0x388565);}})[_0x28ba('0x26')](function(_0x78debf){if(_0x78debf){_0x57f2b4=_0x78debf[_0x28ba('0x3a')];if(!_0x4e7026[_0x28ba('0x34')][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x388565['limit']=qs['limit'](_0x4e7026['query'][_0x28ba('0x21')]);_0x388565[_0x28ba('0x1f')]=qs[_0x28ba('0x1f')](_0x4e7026['query'][_0x28ba('0x1f')]);}return _0x7b6da9[_0x28ba('0x91')](_0x388565);}})[_0x28ba('0x26')](function(_0x22d960){if(_0x22d960){return _0x22d960?{'count':_0x57f2b4,'rows':_0x22d960}:null;}})[_0x28ba('0x26')](respondWithResult(_0xa4a083,null))['catch'](handleError(_0xa4a083,null));};exports[_0x28ba('0x93')]=function(_0x4be871,_0x203e7d,_0x2789c6){var _0x5e64b9,_0x4f35f9;var _0x30d40a=[];var _0x4f6692=moment()[_0x28ba('0x67')](_0x28ba('0x94'));return db[_0x28ba('0x30')][_0x28ba('0x4c')]({'where':{'id':_0x4be871[_0x28ba('0x4a')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x203e7d,null))[_0x28ba('0x26')](function(_0x52df78){if(_0x52df78){_0x4f35f9=_0x52df78;return _0x52df78[_0x28ba('0x93')](_0x4be871[_0x28ba('0x56')][_0x28ba('0x68')],_[_0x28ba('0x54')](_0x4be871['body'],['ids','id'])||{});}return null;})['spread'](function(_0x4f37c9){var _0x2cb6c9;var _0xa4586c;_0x5e64b9=_0x4f37c9||[];var _0x229486=[];if(_0x4f37c9){for(var _0x5921aa=0x0;_0x5921aa<_0x4f37c9[_0x28ba('0x3a')];_0x5921aa+=0x1){var _0x5b3cf0=_0x4f37c9[_0x5921aa]['get']({'plain':!![]});_0x2cb6c9=squel[_0x28ba('0x83')]()[_0x28ba('0x6c')]('cm_hopper_black')[_0x28ba('0x81')]([_0x28ba('0x6d'),_0x28ba('0x6f'),_0x28ba('0x75'),_0x28ba('0x60'),'createdAt',_0x28ba('0x70')],squel[_0x28ba('0x71')]()[_0x28ba('0x72')](_0x28ba('0x6d'),'phone')[_0x28ba('0x72')]('id','ContactId')['field'](_0x5b3cf0['CmListId'][_0x28ba('0x76')](),'ListId')[_0x28ba('0x72')](_0x4be871[_0x28ba('0x4a')]['id'][_0x28ba('0x76')](),_0x28ba('0x60'))['field'](_0x28ba('0x73'),_0x28ba('0x55'))[_0x28ba('0x72')](_0x28ba('0x73'),_0x28ba('0x70'))['from'](_0x28ba('0x78'))[_0x28ba('0x40')](_0x28ba('0x79'))[_0x28ba('0x40')](_0x28ba('0x82'),_0x5b3cf0[_0x28ba('0x74')][_0x28ba('0x76')]())[_0x28ba('0x40')](_0x28ba('0x7a')))[_0x28ba('0x76')]();_0x229486[_0x28ba('0x8d')](db['sequelize']['query'](_0x2cb6c9));}return BPromise[_0x28ba('0x8f')](_0x229486);}})['then'](function(){return _0x5e64b9;})[_0x28ba('0x26')](respondWithResult(_0x203e7d,null))[_0x28ba('0x48')](handleError(_0x203e7d,null));};exports['removeBlackLists']=function(_0xd44d53,_0x492c9b,_0x1dd82c){return db[_0x28ba('0x30')][_0x28ba('0x4c')]({'where':{'id':_0xd44d53['params']['id']}})['then'](handleEntityNotFound(_0x492c9b,null))['then'](function(_0x134662){if(_0x134662){return _0x134662[_0x28ba('0x95')](_0xd44d53[_0x28ba('0x34')]['ids']);}})[_0x28ba('0x26')](function(_0x177b81){if(_0x177b81){return db[_0x28ba('0x64')][_0x28ba('0x59')]({'where':{'ListId':_0xd44d53[_0x28ba('0x34')][_0x28ba('0x68')],'CampaignId':_0xd44d53['params']['id']}})['then'](function(){return _0x177b81;});}})[_0x28ba('0x26')](respondWithStatusCode(_0x492c9b,null))[_0x28ba('0x48')](handleError(_0x492c9b,null));}; \ No newline at end of file +var _0xa1aa=['fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','hasOwnProperty','getHopperBlacks','CmHopperBlack','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','into','fromQuery','phone','select','field','NOW()','scheduledAt','CmListId','toString','ListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','ContactId','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x36c840,_0x4678a1){_0x36c840=_0x36c840-0x0;var _0x3c4c79=_0xa1aa[_0x36c840];return _0x3c4c79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa1a('0x0'));var zipdir=require(_0xaa1a('0x1'));var jsonpatch=require(_0xaa1a('0x2'));var rp=require(_0xaa1a('0x3'));var moment=require(_0xaa1a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaa1a('0x5'));var path=require(_0xaa1a('0x6'));var sox=require('sox');var csv=require(_0xaa1a('0x7'));var ejs=require(_0xaa1a('0x8'));var fs=require('fs');var fs_extra=require(_0xaa1a('0x9'));var _=require('lodash');var squel=require(_0xaa1a('0xa'));var crypto=require('crypto');var jsforce=require(_0xaa1a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaa1a('0x7'));var querystring=require(_0xaa1a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaa1a('0xd'));var qs=require(_0xaa1a('0xe'));var as=require(_0xaa1a('0xf'));var hardwareService=require(_0xaa1a('0x10'));var logger=require('../../config/logger')(_0xaa1a('0x11'));var utils=require(_0xaa1a('0x12'));var config=require(_0xaa1a('0x13'));var licenseUtil=require(_0xaa1a('0x14'));var db=require(_0xaa1a('0x15'))['db'];function respondWithStatusCode(_0x278079,_0x25ae41){_0x25ae41=_0x25ae41||0xcc;return function(_0x2f018d){if(_0x2f018d){return _0x278079[_0xaa1a('0x16')](_0x25ae41);}return _0x278079[_0xaa1a('0x17')](_0x25ae41)['end']();};}function respondWithResult(_0x5b131c,_0x38715a){_0x38715a=_0x38715a||0xc8;return function(_0x3a577f){if(_0x3a577f){return _0x5b131c[_0xaa1a('0x17')](_0x38715a)[_0xaa1a('0x18')](_0x3a577f);}};}function respondWithFilteredResult(_0x43bd93,_0x5da087){return function(_0x90ef70){if(_0x90ef70){var _0x480a27=typeof _0x5da087[_0xaa1a('0x19')]===_0xaa1a('0x1a')&&typeof _0x5da087[_0xaa1a('0x1b')]===_0xaa1a('0x1a');var _0x5ba030=_0x90ef70['count'];var _0x1b3174=_0x480a27?0x0:_0x5da087[_0xaa1a('0x19')];var _0x56ff91=_0x480a27?_0x90ef70[_0xaa1a('0x1c')]:_0x5da087[_0xaa1a('0x19')]+_0x5da087[_0xaa1a('0x1b')];var _0x120080;if(_0x56ff91>=_0x5ba030){_0x56ff91=_0x5ba030;_0x120080=0xc8;}else{_0x120080=0xce;}_0x43bd93[_0xaa1a('0x17')](_0x120080);return _0x43bd93[_0xaa1a('0x1d')]('Content-Range',_0x1b3174+'-'+_0x56ff91+'/'+_0x5ba030)[_0xaa1a('0x18')](_0x90ef70);}return null;};}function patchUpdates(_0x400a06){return function(_0x8586aa){try{jsonpatch[_0xaa1a('0x1e')](_0x8586aa,_0x400a06,!![]);}catch(_0x2c0238){return BPromise[_0xaa1a('0x1f')](_0x2c0238);}return _0x8586aa[_0xaa1a('0x20')]();};}function saveUpdates(_0x5c01b2,_0xa32c54){return function(_0x282f07){if(_0x282f07){return _0x282f07[_0xaa1a('0x21')](_0x5c01b2)['then'](function(_0x262f83){return _0x262f83;});}return null;};}function removeEntity(_0x15b366,_0x583c90){return function(_0x4accdf){if(_0x4accdf){return _0x4accdf[_0xaa1a('0x22')]()[_0xaa1a('0x23')](function(){var _0xd3225b=_0x4accdf[_0xaa1a('0x24')]({'plain':!![]});var _0x582843=_0xaa1a('0x25');return db[_0xaa1a('0x26')]['destroy']({'where':{'type':_0x582843,'resourceId':_0xd3225b['id']}})[_0xaa1a('0x23')](function(){return _0x4accdf;});})[_0xaa1a('0x23')](function(){_0x15b366[_0xaa1a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43688f,_0x2d1c8f){return function(_0x1b1b67){if(!_0x1b1b67){_0x43688f[_0xaa1a('0x16')](0x194);}return _0x1b1b67;};}function handleError(_0x3f29a8,_0x380a5a){_0x380a5a=_0x380a5a||0x1f4;return function(_0x26fdea){logger['error'](_0x26fdea['stack']);if(_0x26fdea['name']){delete _0x26fdea[_0xaa1a('0x27')];}_0x3f29a8[_0xaa1a('0x17')](_0x380a5a)[_0xaa1a('0x28')](_0x26fdea);};}exports[_0xaa1a('0x29')]=function(_0x559050,_0x14a189){var _0x22ba1d={},_0x2767be={},_0x22b4e3={'count':0x0,'rows':[]};var _0x13afce=_[_0xaa1a('0x2a')](db[_0xaa1a('0x2b')][_0xaa1a('0x2c')],function(_0x2a0d68){return{'name':_0x2a0d68[_0xaa1a('0x2d')],'type':_0x2a0d68[_0xaa1a('0x2e')][_0xaa1a('0x2f')]};});_0x2767be[_0xaa1a('0x30')]=_[_0xaa1a('0x2a')](_0x13afce,_0xaa1a('0x27'));_0x2767be['query']=_['keys'](_0x559050[_0xaa1a('0x31')]);_0x2767be['filters']=_[_0xaa1a('0x32')](_0x2767be[_0xaa1a('0x30')],_0x2767be[_0xaa1a('0x31')]);_0x22ba1d[_0xaa1a('0x33')]=_[_0xaa1a('0x32')](_0x2767be[_0xaa1a('0x30')],qs['fields'](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x22ba1d[_0xaa1a('0x33')]=_0x22ba1d[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x22ba1d[_0xaa1a('0x33')]:_0x2767be[_0xaa1a('0x30')];if(!_0x559050[_0xaa1a('0x31')]['hasOwnProperty'](_0xaa1a('0x36'))){_0x22ba1d[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x1b')]);_0x22ba1d[_0xaa1a('0x19')]=qs[_0xaa1a('0x19')](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x19')]);}_0x22ba1d[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0x22ba1d[_0xaa1a('0x39')]=qs[_0xaa1a('0x3a')](_[_0xaa1a('0x3b')](_0x559050['query'],_0x2767be['filters']),_0x13afce);if(_0x559050[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0x22ba1d[_0xaa1a('0x39')]=_[_0xaa1a('0x3d')](_0x22ba1d[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x13afce,function(_0x48f1b3){if(_0x48f1b3[_0xaa1a('0x2e')]!=='VIRTUAL'){var _0x3da635={};_0x3da635[_0x48f1b3['name']]={'$like':'%'+_0x559050[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x3da635;}})});}_0x22ba1d=_[_0xaa1a('0x3d')]({},_0x22ba1d,_0x559050[_0xaa1a('0x3e')]);var _0x5f0170={'where':_0x22ba1d['where']};return db[_0xaa1a('0x2b')][_0xaa1a('0x1c')](_0x5f0170)['then'](function(_0x27971e){_0x22b4e3[_0xaa1a('0x1c')]=_0x27971e;if(_0x559050['query']['includeAll']){_0x22ba1d[_0xaa1a('0x3f')]=[{'all':!![]}];}return db['Campaign'][_0xaa1a('0x40')](_0x22ba1d);})[_0xaa1a('0x23')](function(_0x30011d){_0x22b4e3[_0xaa1a('0x41')]=_0x30011d;return _0x22b4e3;})[_0xaa1a('0x23')](respondWithFilteredResult(_0x14a189,_0x22ba1d))[_0xaa1a('0x42')](handleError(_0x14a189,null));};exports['show']=function(_0x54f7bd,_0x4a2a49){var _0x5ce7f1={'raw':![],'where':{'id':_0x54f7bd['params']['id']}},_0x27fcfd={};_0x27fcfd[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db[_0xaa1a('0x2b')][_0xaa1a('0x2c')]);_0x27fcfd[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0x54f7bd[_0xaa1a('0x31')]);_0x27fcfd[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x27fcfd[_0xaa1a('0x30')],_0x27fcfd[_0xaa1a('0x31')]);_0x5ce7f1['attributes']=_[_0xaa1a('0x32')](_0x27fcfd[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x54f7bd['query'][_0xaa1a('0x34')]));_0x5ce7f1['attributes']=_0x5ce7f1[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x5ce7f1[_0xaa1a('0x33')]:_0x27fcfd[_0xaa1a('0x30')];if(_0x54f7bd['query'][_0xaa1a('0x44')]){_0x5ce7f1[_0xaa1a('0x3f')]=[{'all':!![]}];}_0x5ce7f1=_[_0xaa1a('0x3d')]({},_0x5ce7f1,_0x54f7bd[_0xaa1a('0x3e')]);return db[_0xaa1a('0x2b')][_0xaa1a('0x45')](_0x5ce7f1)[_0xaa1a('0x23')](handleEntityNotFound(_0x4a2a49,null))[_0xaa1a('0x23')](respondWithResult(_0x4a2a49,null))[_0xaa1a('0x42')](handleError(_0x4a2a49,null));};exports['create']=function(_0x9a63c0,_0x4327b9){return db[_0xaa1a('0x2b')][_0xaa1a('0x46')](_0x9a63c0[_0xaa1a('0x47')],{})[_0xaa1a('0x23')](function(_0x1aad3a){var _0x3a19be=_0x9a63c0[_0xaa1a('0x48')][_0xaa1a('0x24')]({'plain':!![]});if(!_0x3a19be)throw new Error(_0xaa1a('0x49'));if(_0x3a19be[_0xaa1a('0x4a')]===_0xaa1a('0x48')){var _0x169e85=_0x1aad3a[_0xaa1a('0x24')]({'plain':!![]});var _0x42c5e5=_0xaa1a('0x25');return db[_0xaa1a('0x4b')]['find']({'where':{'name':_0x42c5e5,'userProfileId':_0x3a19be[_0xaa1a('0x4c')]},'raw':!![]})[_0xaa1a('0x23')](function(_0x1b0596){if(_0x1b0596&&_0x1b0596['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa1a('0x46')]({'name':_0x169e85['name'],'resourceId':_0x169e85['id'],'type':_0x1b0596[_0xaa1a('0x27')],'sectionId':_0x1b0596['id']},{})['then'](function(){return _0x1aad3a;});}else{return _0x1aad3a;}})[_0xaa1a('0x42')](function(_0x5bad29){logger[_0xaa1a('0x4d')](_0xaa1a('0x4e'),_0x5bad29);throw _0x5bad29;});}return _0x1aad3a;})[_0xaa1a('0x23')](respondWithResult(_0x4327b9,0xc9))[_0xaa1a('0x42')](handleError(_0x4327b9,null));};exports[_0xaa1a('0x4f')]=function(_0x4fc334,_0x57550d){var _0x4cd226={'where':{'id':_0x4fc334[_0xaa1a('0x50')]['id']}},_0x2ce080={};_0x2ce080[_0xaa1a('0x30')]=_['keys'](db[_0xaa1a('0x2b')][_0xaa1a('0x2c')]);_0x4cd226['attributes']=_['intersection'](_0x2ce080[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x4fc334[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x4cd226[_0xaa1a('0x33')]=_0x4cd226[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x4cd226[_0xaa1a('0x33')]:_0x2ce080[_0xaa1a('0x30')];if(_0x4fc334[_0xaa1a('0x31')][_0xaa1a('0x44')]){_0x4cd226[_0xaa1a('0x3f')]=[{'all':!![]}];}_0x4cd226=_['merge']({},_0x4cd226,_0x4fc334[_0xaa1a('0x3e')]);return db['Campaign'][_0xaa1a('0x45')](_0x4cd226)[_0xaa1a('0x23')](handleEntityNotFound(_0x57550d,null))['then'](function(_0x55ad1f){if(_0x55ad1f){var _0xc0cbb8=_0x55ad1f['get']({'plain':!![]});_0xc0cbb8=qs[_0xaa1a('0x51')](_0xc0cbb8,['id',_0xaa1a('0x52'),_0xaa1a('0x53')]);_0x4fc334[_0xaa1a('0x47')]=_[_0xaa1a('0x51')](_0x4fc334[_0xaa1a('0x47')],['id',_0xaa1a('0x52'),_0xaa1a('0x53')]);return db['Campaign'][_0xaa1a('0x46')](_[_0xaa1a('0x3d')](_0xc0cbb8,_0x4fc334['body']),{'include':_0x4fc334[_0xaa1a('0x31')][_0xaa1a('0x44')]?[{'all':!![]}]:undefined})[_0xaa1a('0x23')](function(_0x27aa45){var _0x1c5550=_0x4fc334[_0xaa1a('0x48')]['get']({'plain':!![]});if(!_0x1c5550)throw new Error(_0xaa1a('0x49'));if(_0x1c5550[_0xaa1a('0x4a')]===_0xaa1a('0x48')){var _0x48ce6f=_0x27aa45['get']({'plain':!![]});var _0x43ce51=_0xaa1a('0x25');return db[_0xaa1a('0x4b')]['find']({'where':{'name':_0x43ce51,'userProfileId':_0x1c5550['userProfileId']},'raw':!![]})[_0xaa1a('0x23')](function(_0x37f941){if(_0x37f941&&_0x37f941['autoAssociation']===0x0){return db[_0xaa1a('0x26')][_0xaa1a('0x46')]({'name':_0x48ce6f[_0xaa1a('0x27')],'resourceId':_0x48ce6f['id'],'type':_0x37f941[_0xaa1a('0x27')],'sectionId':_0x37f941['id']},{})[_0xaa1a('0x23')](function(){return _0x27aa45;});}else{return _0x27aa45;}})[_0xaa1a('0x42')](function(_0x50732e){logger[_0xaa1a('0x4d')](_0xaa1a('0x4e'),_0x50732e);throw _0x50732e;});}return _0x27aa45;});}})[_0xaa1a('0x23')](respondWithResult(_0x57550d,0xc9))[_0xaa1a('0x42')](handleError(_0x57550d,null));};exports[_0xaa1a('0x21')]=function(_0x40d6a9,_0x1b2c53){if(_0x40d6a9['body']['id']){delete _0x40d6a9[_0xaa1a('0x47')]['id'];}return db['Campaign'][_0xaa1a('0x45')]({'where':{'id':_0x40d6a9[_0xaa1a('0x50')]['id']}})['then'](handleEntityNotFound(_0x1b2c53,null))[_0xaa1a('0x23')](saveUpdates(_0x40d6a9[_0xaa1a('0x47')],null))[_0xaa1a('0x23')](respondWithResult(_0x1b2c53,null))[_0xaa1a('0x42')](handleError(_0x1b2c53,null));};exports[_0xaa1a('0x22')]=function(_0x2d0476,_0x16c704){return db[_0xaa1a('0x2b')][_0xaa1a('0x45')]({'where':{'id':_0x2d0476[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x16c704,null))[_0xaa1a('0x23')](removeEntity(_0x16c704,null))[_0xaa1a('0x42')](handleError(_0x16c704,null));};exports[_0xaa1a('0x54')]=function(_0x234c53,_0x57f8a1,_0x4b88b0){var _0xec75db={'raw':!![],'where':{}};var _0xba71f7={};var _0x2d038c={'count':0x0,'rows':[]};return db[_0xaa1a('0x2b')][_0xaa1a('0x55')]({'where':{'id':_0x234c53[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x57f8a1,null))[_0xaa1a('0x23')](function(_0x5942d4){if(_0x5942d4){_0xba71f7[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db['CmHopper']['rawAttributes']);_0xba71f7[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0x234c53[_0xaa1a('0x31')]);_0xba71f7[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0xba71f7[_0xaa1a('0x30')],_0xba71f7[_0xaa1a('0x31')]);_0xec75db[_0xaa1a('0x33')]=_[_0xaa1a('0x32')](_0xba71f7[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0xec75db[_0xaa1a('0x33')]=_0xec75db[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0xec75db[_0xaa1a('0x33')]:_0xba71f7[_0xaa1a('0x30')];if(!_0x234c53[_0xaa1a('0x31')]['hasOwnProperty'](_0xaa1a('0x36'))){_0xec75db[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x234c53[_0xaa1a('0x31')]['limit']);_0xec75db[_0xaa1a('0x19')]=qs[_0xaa1a('0x19')](_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x19')]);}_0xec75db[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0xec75db[_0xaa1a('0x39')]=qs['filters'](_[_0xaa1a('0x3b')](_0x234c53[_0xaa1a('0x31')],_0xba71f7['filters']));_0xec75db['where'][_0xaa1a('0x56')]=_0x5942d4['id'];if(_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0xec75db[_0xaa1a('0x39')]=_[_0xaa1a('0x3d')](_0xec75db[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0xec75db['attributes'],function(_0x14ed12){var _0x5ac42e={};_0x5ac42e[_0x14ed12]={'$like':'%'+_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x5ac42e;})});}_0xec75db=_['merge']({},_0xec75db,_0x234c53['options']);return db['CmHopper'][_0xaa1a('0x1c')]({'where':_0xec75db['where']})[_0xaa1a('0x23')](function(_0x573b33){_0x2d038c[_0xaa1a('0x1c')]=_0x573b33;if(_0x234c53['query'][_0xaa1a('0x44')]){_0xec75db[_0xaa1a('0x3f')]=[{'all':!![]}];}return db[_0xaa1a('0x57')]['findAll'](_0xec75db);})['then'](function(_0x1f3682){_0x2d038c[_0xaa1a('0x41')]=_0x1f3682;return _0x2d038c;});}})[_0xaa1a('0x23')](respondWithFilteredResult(_0x57f8a1,_0xec75db))[_0xaa1a('0x42')](handleError(_0x57f8a1,null));};exports[_0xaa1a('0x58')]=function(_0x21d6b3,_0x1223be,_0x26f73f){var _0x409aa2={'raw':!![],'where':{}};var _0x1dfbc1={};var _0xb4a868={'count':0x0,'rows':[]};return db['Campaign'][_0xaa1a('0x55')]({'where':{'id':_0x21d6b3[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x1223be,null))[_0xaa1a('0x23')](function(_0x35c539){if(_0x35c539){_0x1dfbc1['model']=_[_0xaa1a('0x43')](db[_0xaa1a('0x59')]['rawAttributes']);_0x1dfbc1['query']=_['keys'](_0x21d6b3[_0xaa1a('0x31')]);_0x1dfbc1[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x1dfbc1['model'],_0x1dfbc1[_0xaa1a('0x31')]);_0x409aa2['attributes']=_['intersection'](_0x1dfbc1[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x409aa2['attributes']=_0x409aa2[_0xaa1a('0x33')]['length']?_0x409aa2[_0xaa1a('0x33')]:_0x1dfbc1[_0xaa1a('0x30')];if(!_0x21d6b3[_0xaa1a('0x31')]['hasOwnProperty'](_0xaa1a('0x36'))){_0x409aa2[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x21d6b3['query']['limit']);_0x409aa2['offset']=qs[_0xaa1a('0x19')](_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x19')]);}_0x409aa2[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0x409aa2['where']=qs[_0xaa1a('0x3a')](_[_0xaa1a('0x3b')](_0x21d6b3[_0xaa1a('0x31')],_0x1dfbc1[_0xaa1a('0x3a')]));_0x409aa2[_0xaa1a('0x39')][_0xaa1a('0x56')]=_0x35c539['id'];if(_0x21d6b3['query']['filter']){_0x409aa2['where']=_[_0xaa1a('0x3d')](_0x409aa2[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x409aa2[_0xaa1a('0x33')],function(_0x23ee8c){var _0x9fcf4b={};_0x9fcf4b[_0x23ee8c]={'$like':'%'+_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x9fcf4b;})});}_0x409aa2=_['merge']({},_0x409aa2,_0x21d6b3[_0xaa1a('0x3e')]);return db[_0xaa1a('0x59')]['count']({'where':_0x409aa2[_0xaa1a('0x39')]})[_0xaa1a('0x23')](function(_0x984c47){_0xb4a868['count']=_0x984c47;if(_0x21d6b3[_0xaa1a('0x31')]['includeAll']){_0x409aa2['include']=[{'all':!![]}];}return db[_0xaa1a('0x59')][_0xaa1a('0x40')](_0x409aa2);})[_0xaa1a('0x23')](function(_0x82bd71){_0xb4a868[_0xaa1a('0x41')]=_0x82bd71;return _0xb4a868;});}})[_0xaa1a('0x23')](respondWithFilteredResult(_0x1223be,_0x409aa2))[_0xaa1a('0x42')](handleError(_0x1223be,null));};exports['getHopperFinals']=function(_0x56ed8b,_0x3fcead,_0x2ad17b){var _0x589d75={'raw':!![],'where':{}};var _0x80cdef={};var _0x3a3101={'count':0x0,'rows':[]};return db[_0xaa1a('0x2b')][_0xaa1a('0x55')]({'where':{'id':_0x56ed8b[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x3fcead,null))[_0xaa1a('0x23')](function(_0x200cde){if(_0x200cde){_0x80cdef[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db[_0xaa1a('0x5a')]['rawAttributes']);_0x80cdef[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0x56ed8b[_0xaa1a('0x31')]);_0x80cdef[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x80cdef[_0xaa1a('0x30')],_0x80cdef[_0xaa1a('0x31')]);_0x589d75[_0xaa1a('0x33')]=_['intersection'](_0x80cdef['model'],qs[_0xaa1a('0x34')](_0x56ed8b['query'][_0xaa1a('0x34')]));_0x589d75[_0xaa1a('0x33')]=_0x589d75['attributes'][_0xaa1a('0x35')]?_0x589d75[_0xaa1a('0x33')]:_0x80cdef[_0xaa1a('0x30')];if(!_0x56ed8b[_0xaa1a('0x31')][_0xaa1a('0x5b')](_0xaa1a('0x36'))){_0x589d75[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x56ed8b[_0xaa1a('0x31')][_0xaa1a('0x1b')]);_0x589d75['offset']=qs[_0xaa1a('0x19')](_0x56ed8b[_0xaa1a('0x31')]['offset']);}_0x589d75['order']=qs[_0xaa1a('0x38')](_0x56ed8b['query'][_0xaa1a('0x38')]);_0x589d75['where']=qs['filters'](_[_0xaa1a('0x3b')](_0x56ed8b['query'],_0x80cdef['filters']));_0x589d75[_0xaa1a('0x39')][_0xaa1a('0x56')]=_0x200cde['id'];if(_0x56ed8b[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0x589d75[_0xaa1a('0x39')]=_[_0xaa1a('0x3d')](_0x589d75[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x589d75[_0xaa1a('0x33')],function(_0x1d6984){var _0x1f2380={};_0x1f2380[_0x1d6984]={'$like':'%'+_0x56ed8b[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x1f2380;})});}_0x589d75=_[_0xaa1a('0x3d')]({},_0x589d75,_0x56ed8b[_0xaa1a('0x3e')]);return db['CmHopperFinal'][_0xaa1a('0x1c')]({'where':_0x589d75[_0xaa1a('0x39')]})[_0xaa1a('0x23')](function(_0x443ecb){_0x3a3101[_0xaa1a('0x1c')]=_0x443ecb;if(_0x56ed8b['query'][_0xaa1a('0x44')]){_0x589d75[_0xaa1a('0x3f')]=[{'all':!![]}];}return db[_0xaa1a('0x5a')]['findAll'](_0x589d75);})[_0xaa1a('0x23')](function(_0x2fe372){_0x3a3101[_0xaa1a('0x41')]=_0x2fe372;return _0x3a3101;});}})['then'](respondWithFilteredResult(_0x3fcead,_0x589d75))[_0xaa1a('0x42')](handleError(_0x3fcead,null));};exports[_0xaa1a('0x5c')]=function(_0xdd9f5e,_0x5bb405,_0x32b9f4){var _0x3138b1={'raw':!![],'where':{}};var _0x2f16c5={};var _0x1a48b1={'count':0x0,'rows':[]};return db['Campaign'][_0xaa1a('0x55')]({'where':{'id':_0xdd9f5e[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x5bb405,null))[_0xaa1a('0x23')](function(_0x2cd944){if(_0x2cd944){_0x2f16c5['model']=_[_0xaa1a('0x43')](db[_0xaa1a('0x5d')][_0xaa1a('0x2c')]);_0x2f16c5[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0xdd9f5e['query']);_0x2f16c5[_0xaa1a('0x3a')]=_['intersection'](_0x2f16c5[_0xaa1a('0x30')],_0x2f16c5['query']);_0x3138b1['attributes']=_[_0xaa1a('0x32')](_0x2f16c5['model'],qs['fields'](_0xdd9f5e[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x3138b1[_0xaa1a('0x33')]=_0x3138b1[_0xaa1a('0x33')]['length']?_0x3138b1[_0xaa1a('0x33')]:_0x2f16c5['model'];if(!_0xdd9f5e['query']['hasOwnProperty'](_0xaa1a('0x36'))){_0x3138b1['limit']=qs['limit'](_0xdd9f5e[_0xaa1a('0x31')]['limit']);_0x3138b1[_0xaa1a('0x19')]=qs[_0xaa1a('0x19')](_0xdd9f5e[_0xaa1a('0x31')][_0xaa1a('0x19')]);}_0x3138b1[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0xdd9f5e['query']['sort']);_0x3138b1['where']=qs['filters'](_[_0xaa1a('0x3b')](_0xdd9f5e[_0xaa1a('0x31')],_0x2f16c5['filters']));_0x3138b1[_0xaa1a('0x39')]['CampaignId']=_0x2cd944['id'];if(_0xdd9f5e[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0x3138b1[_0xaa1a('0x39')]=_[_0xaa1a('0x3d')](_0x3138b1[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x3138b1['attributes'],function(_0x5e1e1c){var _0xb371ed={};_0xb371ed[_0x5e1e1c]={'$like':'%'+_0xdd9f5e['query'][_0xaa1a('0x3c')]+'%'};return _0xb371ed;})});}_0x3138b1=_[_0xaa1a('0x3d')]({},_0x3138b1,_0xdd9f5e[_0xaa1a('0x3e')]);return db[_0xaa1a('0x5d')]['count']({'where':_0x3138b1[_0xaa1a('0x39')]})[_0xaa1a('0x23')](function(_0x1eaae4){_0x1a48b1['count']=_0x1eaae4;if(_0xdd9f5e[_0xaa1a('0x31')][_0xaa1a('0x44')]){_0x3138b1[_0xaa1a('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x3138b1);})['then'](function(_0x458c9b){_0x1a48b1[_0xaa1a('0x41')]=_0x458c9b;return _0x1a48b1;});}})[_0xaa1a('0x23')](respondWithFilteredResult(_0x5bb405,_0x3138b1))[_0xaa1a('0x42')](handleError(_0x5bb405,null));};exports[_0xaa1a('0x5e')]=function(_0x165c35,_0x291474,_0x4a3120){var _0xab9925={};var _0x54d601={};var _0x565cfa;var _0x13fe6d;return db[_0xaa1a('0x2b')][_0xaa1a('0x55')]({'where':{'id':_0x165c35['params']['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x291474,null))[_0xaa1a('0x23')](function(_0x1f84cb){if(_0x1f84cb){_0x565cfa=_0x1f84cb;_0x54d601[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db[_0xaa1a('0x5f')][_0xaa1a('0x2c')]);_0x54d601['query']=_[_0xaa1a('0x43')](_0x165c35[_0xaa1a('0x31')]);_0x54d601[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x54d601['model'],_0x54d601['query']);_0xab9925[_0xaa1a('0x33')]=_[_0xaa1a('0x32')](_0x54d601[_0xaa1a('0x30')],qs['fields'](_0x165c35[_0xaa1a('0x31')]['fields']));_0xab9925['attributes']=_0xab9925[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0xab9925[_0xaa1a('0x33')]:_0x54d601['model'];_0xab9925['order']=qs['sort'](_0x165c35[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0xab9925[_0xaa1a('0x39')]=qs[_0xaa1a('0x3a')](_['pick'](_0x165c35[_0xaa1a('0x31')],_0x54d601[_0xaa1a('0x3a')]));if(_0x165c35[_0xaa1a('0x31')]['filter']){_0xab9925[_0xaa1a('0x39')]=_['merge'](_0xab9925['where'],{'$or':_[_0xaa1a('0x2a')](_0xab9925[_0xaa1a('0x33')],function(_0x3efdb5){var _0x7e03f2={};_0x7e03f2[_0x3efdb5]={'$like':'%'+_0x165c35[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x7e03f2;})});}_0xab9925=_[_0xaa1a('0x3d')]({},_0xab9925,_0x165c35[_0xaa1a('0x3e')]);return _0x565cfa[_0xaa1a('0x5e')](_0xab9925);}})[_0xaa1a('0x23')](function(_0x4fb22d){if(_0x4fb22d){_0x13fe6d=_0x4fb22d['length'];if(!_0x165c35['query'][_0xaa1a('0x5b')](_0xaa1a('0x36'))){_0xab9925[_0xaa1a('0x1b')]=qs['limit'](_0x165c35[_0xaa1a('0x31')]['limit']);_0xab9925[_0xaa1a('0x19')]=qs[_0xaa1a('0x19')](_0x165c35[_0xaa1a('0x31')][_0xaa1a('0x19')]);}return _0x565cfa['getLists'](_0xab9925);}})[_0xaa1a('0x23')](function(_0x220952){if(_0x220952){return _0x220952?{'count':_0x13fe6d,'rows':_0x220952}:null;}})[_0xaa1a('0x23')](respondWithResult(_0x291474,null))['catch'](handleError(_0x291474,null));};exports['addLists']=function(_0xd7fdca,_0x4d1d38,_0x3652f6){var _0x144c11,_0x7a0ad2;var _0x4751d9=[];var _0x328947=moment()['format'](_0xaa1a('0x60'));return db[_0xaa1a('0x2b')][_0xaa1a('0x45')]({'where':{'id':_0xd7fdca[_0xaa1a('0x50')]['id']}})['then'](handleEntityNotFound(_0x4d1d38,null))['then'](function(_0xaad1e6){if(_0xaad1e6){_0x7a0ad2=_0xaad1e6;return _0xaad1e6[_0xaa1a('0x61')](_0xd7fdca[_0xaa1a('0x47')][_0xaa1a('0x62')],_[_0xaa1a('0x51')](_0xd7fdca[_0xaa1a('0x47')],[_0xaa1a('0x62'),'id'])||{});}return null;})[_0xaa1a('0x63')](function(_0x6e9277){var _0x46735e;var _0x22eb26;_0x144c11=_0x6e9277||[];var _0x23c409=[];if(_0x6e9277){for(var _0x12041e=0x0;_0x12041e<_0x6e9277[_0xaa1a('0x35')];_0x12041e+=0x1){var _0x49da0e=_0x6e9277[_0x12041e]['get']({'plain':!![]});_0x7a0ad2[_0xaa1a('0x64')]=_0xd7fdca[_0xaa1a('0x47')]['dialCheckDuplicateType']?_0xd7fdca[_0xaa1a('0x47')][_0xaa1a('0x64')]:_0x7a0ad2[_0xaa1a('0x64')];switch(_0x7a0ad2[_0xaa1a('0x64')]){case'always':_0x46735e=squel['insert']()[_0xaa1a('0x65')]('cm_hopper')[_0xaa1a('0x66')]([_0xaa1a('0x67'),'scheduledAt','ContactId','ListId',_0xaa1a('0x56'),'createdAt',_0xaa1a('0x53')],squel[_0xaa1a('0x68')]()['field']('phone',_0xaa1a('0x67'))[_0xaa1a('0x69')](_0xaa1a('0x6a'),_0xaa1a('0x6b'))['field']('id','ContactId')[_0xaa1a('0x69')](_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')](),_0xaa1a('0x6e'))['field'](_0xd7fdca[_0xaa1a('0x50')]['id']['toString'](),_0xaa1a('0x56'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x52'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x53'))[_0xaa1a('0x6f')](_0xaa1a('0x70'))[_0xaa1a('0x39')]('deletedAt\x20IS\x20NULL')[_0xaa1a('0x39')](_0xaa1a('0x71'),_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')]())['where'](_0xaa1a('0x72'))[_0xaa1a('0x39')](_0xaa1a('0x73'),squel[_0xaa1a('0x68')]()[_0xaa1a('0x69')]('COALESCE(calleridnum,\x27\x27)')[_0xaa1a('0x6f')](_0xaa1a('0x74'))['where'](_0xaa1a('0x75'),_0xd7fdca[_0xaa1a('0x50')]['id'][_0xaa1a('0x6d')]()))[_0xaa1a('0x39')](_0xaa1a('0x73'),squel['select']()[_0xaa1a('0x69')](_0xaa1a('0x76'))[_0xaa1a('0x6f')](_0xaa1a('0x77'))[_0xaa1a('0x39')](_0xaa1a('0x75'),_0xd7fdca['params']['id']['toString']())))[_0xaa1a('0x6d')]();break;case _0xaa1a('0x78'):_0x46735e=squel[_0xaa1a('0x79')]()[_0xaa1a('0x65')](_0xaa1a('0x77'))['fromQuery']([_0xaa1a('0x67'),_0xaa1a('0x6b'),_0xaa1a('0x7a'),_0xaa1a('0x6e'),_0xaa1a('0x56'),_0xaa1a('0x52'),'updatedAt'],squel[_0xaa1a('0x68')]()[_0xaa1a('0x69')](_0xaa1a('0x67'),'phone')['field'](_0xaa1a('0x6a'),_0xaa1a('0x6b'))[_0xaa1a('0x69')]('id',_0xaa1a('0x7a'))[_0xaa1a('0x69')](_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')](),_0xaa1a('0x6e'))['field'](_0xd7fdca[_0xaa1a('0x50')]['id']['toString'](),_0xaa1a('0x56'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x52'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x53'))['from'](_0xaa1a('0x70'))[_0xaa1a('0x39')](_0xaa1a('0x7b'))[_0xaa1a('0x39')](_0xaa1a('0x71'),_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')]())[_0xaa1a('0x39')](_0xaa1a('0x72'))[_0xaa1a('0x39')](_0xaa1a('0x73'),squel[_0xaa1a('0x68')]()['field'](_0xaa1a('0x76'))['from']('cm_hopper')[_0xaa1a('0x39')]('CampaignId\x20=\x20?',_0xd7fdca[_0xaa1a('0x50')]['id']['toString']())))[_0xaa1a('0x6d')]();break;default:_0x46735e=squel[_0xaa1a('0x79')]()['into'](_0xaa1a('0x77'))['fromQuery']([_0xaa1a('0x67'),_0xaa1a('0x6b'),_0xaa1a('0x7a'),_0xaa1a('0x6e'),'CampaignId',_0xaa1a('0x52'),_0xaa1a('0x53')],squel[_0xaa1a('0x68')]()['field'](_0xaa1a('0x67'),_0xaa1a('0x67'))[_0xaa1a('0x69')](_0xaa1a('0x6a'),_0xaa1a('0x6b'))[_0xaa1a('0x69')]('id','ContactId')[_0xaa1a('0x69')](_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')](),'ListId')[_0xaa1a('0x69')](_0xd7fdca['params']['id'][_0xaa1a('0x6d')](),_0xaa1a('0x56'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x52'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x53'))[_0xaa1a('0x6f')](_0xaa1a('0x70'))[_0xaa1a('0x39')](_0xaa1a('0x7b'))['where'](_0xaa1a('0x71'),_0x49da0e['CmListId'][_0xaa1a('0x6d')]())[_0xaa1a('0x39')](_0xaa1a('0x72')))[_0xaa1a('0x6d')]();}_0x22eb26=squel['insert']()[_0xaa1a('0x65')](_0xaa1a('0x7c'))[_0xaa1a('0x66')]([_0xaa1a('0x7d'),_0xaa1a('0x6b'),_0xaa1a('0x67'),_0xaa1a('0x7e'),_0xaa1a('0x52'),_0xaa1a('0x53')],squel[_0xaa1a('0x68')]()[_0xaa1a('0x69')]('h.id','id')['field']('NOW()','scheduledAt')['field']('ci.item',_0xaa1a('0x67'))[_0xaa1a('0x69')](_0xaa1a('0x7f'),_0xaa1a('0x7e'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27','createdAt')['field']('\x27'+_0x328947+'\x27',_0xaa1a('0x53'))[_0xaa1a('0x6f')](_0xaa1a('0x80'),'ci')[_0xaa1a('0x81')](_0xaa1a('0x77'),'h',_0xaa1a('0x82'))[_0xaa1a('0x39')](_0xaa1a('0x83'),_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')]())[_0xaa1a('0x39')]('h.CampaignId=?',_0xd7fdca[_0xaa1a('0x50')]['id'][_0xaa1a('0x6d')]())['where'](_0xaa1a('0x84'),_0x328947))['toString']();_0x23c409[_0xaa1a('0x85')](db['sequelize'][_0xaa1a('0x31')](_0x46735e));_0x4751d9['push'](db[_0xaa1a('0x86')][_0xaa1a('0x31')](_0x22eb26));}return BPromise[_0xaa1a('0x87')](_0x23c409);}})[_0xaa1a('0x23')](function(){return BPromise[_0xaa1a('0x87')](_0x4751d9);})[_0xaa1a('0x23')](function(){return _0x144c11;})['then'](respondWithResult(_0x4d1d38,null))['catch'](handleError(_0x4d1d38,null));};exports[_0xaa1a('0x88')]=function(_0x2ad3fc,_0x5e980b,_0x4a02f6){return db[_0xaa1a('0x2b')]['find']({'where':{'id':_0x2ad3fc['params']['id']}})['then'](handleEntityNotFound(_0x5e980b,null))[_0xaa1a('0x23')](function(_0x2f5f10){if(_0x2f5f10){return _0x2f5f10[_0xaa1a('0x88')](_0x2ad3fc[_0xaa1a('0x31')][_0xaa1a('0x62')]);}})[_0xaa1a('0x23')](function(_0x46d0f1){if(_0x46d0f1){return db[_0xaa1a('0x57')][_0xaa1a('0x22')]({'where':{'ListId':_0x2ad3fc[_0xaa1a('0x31')][_0xaa1a('0x62')],'CampaignId':_0x2ad3fc[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](function(){return _0x46d0f1;});}})[_0xaa1a('0x23')](respondWithStatusCode(_0x5e980b,null))[_0xaa1a('0x42')](handleError(_0x5e980b,null));};exports['getBlackLists']=function(_0x5ebd9e,_0x45b799,_0x43a69f){var _0x534e67={};var _0x427ae7={};var _0x305ed9;var _0x24e647;return db[_0xaa1a('0x2b')][_0xaa1a('0x55')]({'where':{'id':_0x5ebd9e[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x45b799,null))[_0xaa1a('0x23')](function(_0x4165fe){if(_0x4165fe){_0x305ed9=_0x4165fe;_0x427ae7[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db[_0xaa1a('0x5f')][_0xaa1a('0x2c')]);_0x427ae7[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0x5ebd9e[_0xaa1a('0x31')]);_0x427ae7[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x427ae7[_0xaa1a('0x30')],_0x427ae7[_0xaa1a('0x31')]);_0x534e67[_0xaa1a('0x33')]=_[_0xaa1a('0x32')](_0x427ae7['model'],qs['fields'](_0x5ebd9e[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x534e67[_0xaa1a('0x33')]=_0x534e67[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x534e67[_0xaa1a('0x33')]:_0x427ae7[_0xaa1a('0x30')];_0x534e67['order']=qs[_0xaa1a('0x38')](_0x5ebd9e[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0x534e67[_0xaa1a('0x39')]=qs[_0xaa1a('0x3a')](_['pick'](_0x5ebd9e['query'],_0x427ae7[_0xaa1a('0x3a')]));if(_0x5ebd9e[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0x534e67['where']=_[_0xaa1a('0x3d')](_0x534e67[_0xaa1a('0x39')],{'$or':_['map'](_0x534e67['attributes'],function(_0x2225a4){var _0x440893={};_0x440893[_0x2225a4]={'$like':'%'+_0x5ebd9e['query'][_0xaa1a('0x3c')]+'%'};return _0x440893;})});}_0x534e67=_['merge']({},_0x534e67,_0x5ebd9e[_0xaa1a('0x3e')]);return _0x305ed9['getBlackLists'](_0x534e67);}})[_0xaa1a('0x23')](function(_0x46bbb8){if(_0x46bbb8){_0x24e647=_0x46bbb8[_0xaa1a('0x35')];if(!_0x5ebd9e[_0xaa1a('0x31')]['hasOwnProperty'](_0xaa1a('0x36'))){_0x534e67[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x5ebd9e['query'][_0xaa1a('0x1b')]);_0x534e67[_0xaa1a('0x19')]=qs['offset'](_0x5ebd9e[_0xaa1a('0x31')]['offset']);}return _0x305ed9[_0xaa1a('0x89')](_0x534e67);}})[_0xaa1a('0x23')](function(_0xcb93c6){if(_0xcb93c6){return _0xcb93c6?{'count':_0x24e647,'rows':_0xcb93c6}:null;}})[_0xaa1a('0x23')](respondWithResult(_0x45b799,null))[_0xaa1a('0x42')](handleError(_0x45b799,null));};exports[_0xaa1a('0x8a')]=function(_0x4eb3db,_0x28c478,_0x441bfb){var _0x278f5c,_0x30c88d;var _0x4896a9=[];var _0x3a2be8=moment()[_0xaa1a('0x8b')](_0xaa1a('0x60'));return db['Campaign'][_0xaa1a('0x45')]({'where':{'id':_0x4eb3db[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x28c478,null))[_0xaa1a('0x23')](function(_0x295e24){if(_0x295e24){_0x30c88d=_0x295e24;return _0x295e24[_0xaa1a('0x8a')](_0x4eb3db[_0xaa1a('0x47')][_0xaa1a('0x62')],_[_0xaa1a('0x51')](_0x4eb3db[_0xaa1a('0x47')],[_0xaa1a('0x62'),'id'])||{});}return null;})[_0xaa1a('0x63')](function(_0x1367d1){var _0xd30d75;var _0x533401;_0x278f5c=_0x1367d1||[];var _0x3fe13f=[];if(_0x1367d1){for(var _0x26b661=0x0;_0x26b661<_0x1367d1[_0xaa1a('0x35')];_0x26b661+=0x1){var _0x150c34=_0x1367d1[_0x26b661]['get']({'plain':!![]});_0xd30d75=squel[_0xaa1a('0x79')]()[_0xaa1a('0x65')]('cm_hopper_black')[_0xaa1a('0x66')](['phone',_0xaa1a('0x7a'),_0xaa1a('0x6e'),_0xaa1a('0x56'),_0xaa1a('0x52'),_0xaa1a('0x53')],squel[_0xaa1a('0x68')]()[_0xaa1a('0x69')]('phone','phone')['field']('id',_0xaa1a('0x7a'))[_0xaa1a('0x69')](_0x150c34['CmListId'][_0xaa1a('0x6d')](),_0xaa1a('0x6e'))[_0xaa1a('0x69')](_0x4eb3db[_0xaa1a('0x50')]['id'][_0xaa1a('0x6d')](),_0xaa1a('0x56'))[_0xaa1a('0x69')]('NOW()','createdAt')[_0xaa1a('0x69')](_0xaa1a('0x6a'),'updatedAt')[_0xaa1a('0x6f')]('cm_contacts')[_0xaa1a('0x39')]('deletedAt\x20IS\x20NULL')[_0xaa1a('0x39')](_0xaa1a('0x71'),_0x150c34[_0xaa1a('0x6c')][_0xaa1a('0x6d')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xaa1a('0x6d')]();_0x3fe13f[_0xaa1a('0x85')](db['sequelize'][_0xaa1a('0x31')](_0xd30d75));}return BPromise[_0xaa1a('0x87')](_0x3fe13f);}})[_0xaa1a('0x23')](function(){return _0x278f5c;})[_0xaa1a('0x23')](respondWithResult(_0x28c478,null))[_0xaa1a('0x42')](handleError(_0x28c478,null));};exports['removeBlackLists']=function(_0x1eac25,_0x27ebfa,_0x472371){return db[_0xaa1a('0x2b')][_0xaa1a('0x45')]({'where':{'id':_0x1eac25['params']['id']}})['then'](handleEntityNotFound(_0x27ebfa,null))[_0xaa1a('0x23')](function(_0x45fd93){if(_0x45fd93){return _0x45fd93['removeBlackLists'](_0x1eac25['query']['ids']);}})[_0xaa1a('0x23')](function(_0x1518ad){if(_0x1518ad){return db[_0xaa1a('0x5d')][_0xaa1a('0x22')]({'where':{'ListId':_0x1eac25[_0xaa1a('0x31')][_0xaa1a('0x62')],'CampaignId':_0x1eac25[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](function(){return _0x1518ad;});}})[_0xaa1a('0x23')](respondWithStatusCode(_0x27ebfa,null))[_0xaa1a('0x42')](handleError(_0x27ebfa,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 85780ce..ef5c243 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(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1d0a89,_0x11eda8){var _0x29a843=function(_0x1a0fbe){while(--_0x1a0fbe){_0x1d0a89['push'](_0x1d0a89['shift']());}};_0x29a843(++_0x11eda8);}(_0x7a54,0x106));var _0x47a5=function(_0xee5f88,_0x355b6c){_0xee5f88=_0xee5f88-0x0;var _0x38476d=_0x7a54[_0xee5f88];return _0x38476d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index e1b324a..33a2588 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 _0x80fb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','util','moment'];(function(_0x3fa65a,_0x5eb65a){var _0x102bbb=function(_0xb3e8c7){while(--_0xb3e8c7){_0x3fa65a['push'](_0x3fa65a['shift']());}};_0x102bbb(++_0x5eb65a);}(_0x80fb,0x11e));var _0xb80f=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x80fb[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require('lodash');var util=require(_0xb80f('0x0'));var moment=require(_0xb80f('0x1'));var BPromise=require('bluebird');var rs=require(_0xb80f('0x2'));var fs=require('fs');var Redis=require(_0xb80f('0x3'));var db=require(_0xb80f('0x4'))['db'];var utils=require(_0xb80f('0x5'));var logger=require(_0xb80f('0x6'))(_0xb80f('0x7'));var config=require(_0xb80f('0x8'));var jayson=require(_0xb80f('0x9'));var client=jayson['client'][_0xb80f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x251de5,_0x44cc46,_0x2083ab){return new BPromise(function(_0x28027c,_0x1094bb){return client[_0xb80f('0xb')](_0x251de5,_0x2083ab)[_0xb80f('0xc')](function(_0x197faa){logger[_0xb80f('0xd')](_0xb80f('0xe'),_0x44cc46,_0xb80f('0xf'));logger[_0xb80f('0x10')](_0xb80f('0x11'),_0x44cc46,_0xb80f('0xf'),JSON[_0xb80f('0x12')](_0x197faa));if(_0x197faa['error']){if(_0x197faa[_0xb80f('0x13')]['code']===0x1f4){logger[_0xb80f('0x13')](_0xb80f('0xe'),_0x44cc46,_0x197faa[_0xb80f('0x13')][_0xb80f('0x14')]);return _0x1094bb(_0x197faa[_0xb80f('0x13')][_0xb80f('0x14')]);}logger[_0xb80f('0x13')](_0xb80f('0xe'),_0x44cc46,_0x197faa[_0xb80f('0x13')][_0xb80f('0x14')]);return _0x28027c(_0x197faa[_0xb80f('0x13')][_0xb80f('0x14')]);}else{logger[_0xb80f('0xd')](_0xb80f('0xe'),_0x44cc46,_0xb80f('0xf'));_0x28027c(_0x197faa['result'][_0xb80f('0x14')]);}})[_0xb80f('0x15')](function(_0x541c7b){logger['error'](_0xb80f('0xe'),_0x44cc46,_0x541c7b);_0x1094bb(_0x541c7b);});});}exports[_0xb80f('0x16')]=function(_0x6e017c){var _0x353d77=this;return new Promise(function(_0x267f79,_0x347b46){return db['Campaign'][_0xb80f('0x17')]({'raw':_0x6e017c[_0xb80f('0x18')]?_0x6e017c[_0xb80f('0x18')][_0xb80f('0x19')]===undefined?!![]:![]:!![],'where':_0x6e017c[_0xb80f('0x18')]?_0x6e017c[_0xb80f('0x18')][_0xb80f('0x1a')]||null:null,'attributes':_0x6e017c[_0xb80f('0x18')]?_0x6e017c[_0xb80f('0x18')][_0xb80f('0x1b')]||null:null,'limit':_0x6e017c[_0xb80f('0x18')]?_0x6e017c['options'][_0xb80f('0x1c')]||null:null,'include':_0x6e017c['options']?_0x6e017c[_0xb80f('0x18')][_0xb80f('0x1d')]?_['map'](_0x6e017c[_0xb80f('0x18')][_0xb80f('0x1d')],function(_0x4e46fa){return{'model':db[_0x4e46fa['model']],'as':_0x4e46fa['as'],'attributes':_0x4e46fa[_0xb80f('0x1b')],'include':_0x4e46fa[_0xb80f('0x1d')]?_[_0xb80f('0x1e')](_0x4e46fa['include'],function(_0x206209){return{'model':db[_0x206209['model']],'as':_0x206209['as'],'attributes':_0x206209['attributes'],'include':_0x206209[_0xb80f('0x1d')]?_[_0xb80f('0x1e')](_0x206209[_0xb80f('0x1d')],function(_0x12aa3e){return{'model':db[_0x12aa3e[_0xb80f('0x1f')]],'as':_0x12aa3e['as'],'attributes':_0x12aa3e[_0xb80f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb80f('0xc')](function(_0xbffa6e){logger['info']('GetCampaign',_0x6e017c);logger['debug']('GetCampaign',_0x6e017c,JSON[_0xb80f('0x12')](_0xbffa6e));_0x267f79(_0xbffa6e);})[_0xb80f('0x15')](function(_0xe2551e){logger[_0xb80f('0x13')](_0xb80f('0x16'),_0xe2551e[_0xb80f('0x14')],_0x6e017c);_0x347b46(_0x353d77['error'](0x1f4,_0xe2551e[_0xb80f('0x14')]));});});}; \ No newline at end of file +var _0x502a=['client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5e4e16,_0x324778){var _0x22a0f0=function(_0x283d15){while(--_0x283d15){_0x5e4e16['push'](_0x5e4e16['shift']());}};_0x22a0f0(++_0x324778);}(_0x502a,0xd8));var _0xa502=function(_0x5bb9e4,_0x12c8ce){_0x5bb9e4=_0x5bb9e4-0x0;var _0x317640=_0x502a[_0x5bb9e4];return _0x317640;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var moment=require('moment');var BPromise=require(_0xa502('0x2'));var rs=require(_0xa502('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa502('0x4'));var logger=require('../../config/logger')(_0xa502('0x5'));var config=require(_0xa502('0x6'));var jayson=require(_0xa502('0x7'));var client=jayson[_0xa502('0x8')][_0xa502('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x489407,_0x329022,_0x29fb03){return new BPromise(function(_0x4d30f2,_0x4e4e5d){return client[_0xa502('0xa')](_0x489407,_0x29fb03)[_0xa502('0xb')](function(_0x5251fa){logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));logger['debug'](_0xa502('0xf'),_0x329022,_0xa502('0xe'),JSON[_0xa502('0x10')](_0x5251fa));if(_0x5251fa['error']){if(_0x5251fa[_0xa502('0x11')][_0xa502('0x12')]===0x1f4){logger['error'](_0xa502('0xd'),_0x329022,_0x5251fa[_0xa502('0x11')]['message']);return _0x4e4e5d(_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);}logger[_0xa502('0x11')]('Campaign,\x20%s,\x20%s',_0x329022,_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);return _0x4d30f2(_0x5251fa[_0xa502('0x11')]['message']);}else{logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));_0x4d30f2(_0x5251fa[_0xa502('0x14')][_0xa502('0x13')]);}})[_0xa502('0x15')](function(_0x3107a0){logger[_0xa502('0x11')](_0xa502('0xd'),_0x329022,_0x3107a0);_0x4e4e5d(_0x3107a0);});});}exports[_0xa502('0x16')]=function(_0x1445ec){var _0x315455=this;return new Promise(function(_0x1d2f3d,_0x166453){return db[_0xa502('0x17')][_0xa502('0x18')]({'raw':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1445ec['options']?_0x1445ec[_0xa502('0x19')][_0xa502('0x1a')]||null:null,'attributes':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1b')]||null:null,'limit':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1c')]||null:null,'include':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1d')]?_[_0xa502('0x1e')](_0x1445ec['options'][_0xa502('0x1d')],function(_0x1e6c5a){return{'model':db[_0x1e6c5a[_0xa502('0x1f')]],'as':_0x1e6c5a['as'],'attributes':_0x1e6c5a[_0xa502('0x1b')],'include':_0x1e6c5a[_0xa502('0x1d')]?_[_0xa502('0x1e')](_0x1e6c5a[_0xa502('0x1d')],function(_0x55476d){return{'model':db[_0x55476d['model']],'as':_0x55476d['as'],'attributes':_0x55476d[_0xa502('0x1b')],'include':_0x55476d['include']?_[_0xa502('0x1e')](_0x55476d[_0xa502('0x1d')],function(_0x5d04ad){return{'model':db[_0x5d04ad[_0xa502('0x1f')]],'as':_0x5d04ad['as'],'attributes':_0x5d04ad[_0xa502('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb2c9a0){logger[_0xa502('0xc')](_0xa502('0x16'),_0x1445ec);logger['debug']('GetCampaign',_0x1445ec,JSON['stringify'](_0xb2c9a0));_0x1d2f3d(_0xb2c9a0);})[_0xa502('0x15')](function(_0x34f7fa){logger['error']('GetCampaign',_0x34f7fa[_0xa502('0x13')],_0x1445ec);_0x166453(_0x315455[_0xa502('0x11')](0x1f4,_0x34f7fa['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index c9ccbdb..9ed9b08 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 _0xa85e=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','create','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path'];(function(_0x1a15ad,_0x11ba25){var _0xae0190=function(_0x3e5f91){while(--_0x3e5f91){_0x1a15ad['push'](_0x1a15ad['shift']());}};_0xae0190(++_0x11ba25);}(_0xa85e,0x141));var _0xea85=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0xa85e[_0x343090];return _0x3ff3e8;};'use strict';var multer=require(_0xea85('0x0'));var util=require(_0xea85('0x1'));var path=require(_0xea85('0x2'));var timeout=require(_0xea85('0x3'));var express=require(_0xea85('0x4'));var router=express['Router']();var fs_extra=require(_0xea85('0x5'));var auth=require(_0xea85('0x6'));var interaction=require(_0xea85('0x7'));var config=require(_0xea85('0x8'));var controller=require(_0xea85('0x9'));router['get']('/',auth[_0xea85('0xa')](),controller[_0xea85('0xb')]);router[_0xea85('0xc')](_0xea85('0xd'),auth['isAuthenticated'](),controller[_0xea85('0xe')]);router[_0xea85('0xc')](_0xea85('0xf'),auth[_0xea85('0xa')](),controller[_0xea85('0x10')]);router[_0xea85('0xc')](_0xea85('0x11'),auth['isAuthenticated'](),controller[_0xea85('0x12')]);router[_0xea85('0xc')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xea85('0x13')]);router[_0xea85('0xc')]('/:id/hopper_black',auth[_0xea85('0xa')](),controller[_0xea85('0x14')]);router[_0xea85('0xc')]('/:id/lists',auth[_0xea85('0xa')](),controller[_0xea85('0x15')]);router[_0xea85('0xc')](_0xea85('0x16'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0xea85('0xa')](),controller[_0xea85('0x17')]);router[_0xea85('0x18')](_0xea85('0x19'),auth[_0xea85('0xa')](),controller[_0xea85('0x1a')]);router['post'](_0xea85('0x1b'),auth[_0xea85('0xa')](),controller[_0xea85('0x1c')]);router[_0xea85('0x18')](_0xea85('0x16'),auth[_0xea85('0xa')](),controller[_0xea85('0x1d')]);router[_0xea85('0x1e')](_0xea85('0xd'),auth['isAuthenticated'](),controller[_0xea85('0x1f')]);router['delete'](_0xea85('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xea85('0x20')](_0xea85('0x1b'),auth[_0xea85('0xa')](),controller[_0xea85('0x21')]);router[_0xea85('0x20')]('/:id/blacklists',auth[_0xea85('0xa')](),controller[_0xea85('0x22')]);module[_0xea85('0x23')]=router; \ No newline at end of file +var _0xccc7=['getHopperHistories','getHopperFinals','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','update','destroy','delete','/:id/lists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers'];(function(_0x1e54ff,_0x5d8b68){var _0x53eb79=function(_0x35e2cc){while(--_0x35e2cc){_0x1e54ff['push'](_0x1e54ff['shift']());}};_0x53eb79(++_0x5d8b68);}(_0xccc7,0x17e));var _0x7ccc=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xccc7[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0x7ccc('0x0'));var util=require(_0x7ccc('0x1'));var path=require(_0x7ccc('0x2'));var timeout=require(_0x7ccc('0x3'));var express=require('express');var router=express[_0x7ccc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7ccc('0x5'));var interaction=require(_0x7ccc('0x6'));var config=require(_0x7ccc('0x7'));var controller=require(_0x7ccc('0x8'));router[_0x7ccc('0x9')]('/',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0xb')]);router[_0x7ccc('0x9')]('/:id',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0xc')]);router['get'](_0x7ccc('0xd'),auth[_0x7ccc('0xa')](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0xe')]);router[_0x7ccc('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x7ccc('0xf')]);router[_0x7ccc('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x7ccc('0x9')]('/:id/lists',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x10')]);router[_0x7ccc('0x9')](_0x7ccc('0x11'),auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x12')]);router[_0x7ccc('0x13')]('/',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x14')]);router['post'](_0x7ccc('0x15'),auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x16')]);router[_0x7ccc('0x13')]('/:id/lists',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x17')]);router[_0x7ccc('0x13')]('/:id/blacklists',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x18')]);router[_0x7ccc('0x19')](_0x7ccc('0x1a'),auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x1b')]);router['delete']('/:id',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x1c')]);router[_0x7ccc('0x1d')](_0x7ccc('0x1e'),auth[_0x7ccc('0xa')](),controller['removeLists']);router[_0x7ccc('0x1d')]('/:id/blacklists',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x1f')]);module[_0x7ccc('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 946a87e..efcb6fe 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 _0xe3fd=['key','sequelize','exports','STRING','getDataValue'];(function(_0x528805,_0x574afc){var _0x1a1fe1=function(_0x30aa01){while(--_0x30aa01){_0x528805['push'](_0x528805['shift']());}};_0x1a1fe1(++_0x574afc);}(_0xe3fd,0x169));var _0xde3f=function(_0x20a29e,_0x3340b8){_0x20a29e=_0x20a29e-0x0;var _0x1a4fcf=_0xe3fd[_0x20a29e];return _0x1a4fcf;};'use strict';var Sequelize=require(_0xde3f('0x0'));module[_0xde3f('0x1')]={'key':{'type':Sequelize[_0xde3f('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xde3f('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xde3f('0x3')](_0xde3f('0x4'));}}}; \ No newline at end of file +var _0x77ec=['VIRTUAL','getDataValue','exports','STRING','TEXT'];(function(_0x2b18d8,_0x21778e){var _0x2bcce2=function(_0xc14e4b){while(--_0xc14e4b){_0x2b18d8['push'](_0x2b18d8['shift']());}};_0x2bcce2(++_0x21778e);}(_0x77ec,0x124));var _0xc77e=function(_0x40c792,_0x137005){_0x40c792=_0x40c792-0x0;var _0x57bb53=_0x77ec[_0x40c792];return _0x57bb53;};'use strict';var Sequelize=require('sequelize');module[_0xc77e('0x0')]={'key':{'type':Sequelize[_0xc77e('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xc77e('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xc77e('0x3')],'get':function(){return this[_0xc77e('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 8833acd..c6f56e5 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 _0xed8d=['map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','filter','options','rows','catch','show','params','includeAll','include','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','update','then','destroy','CannedAnswers','error','stack','name','send'];(function(_0x509f34,_0x5abe46){var _0x2a96db=function(_0x2cfe16){while(--_0x2cfe16){_0x509f34['push'](_0x509f34['shift']());}};_0x2a96db(++_0x5abe46);}(_0xed8d,0x128));var _0xded8=function(_0x3495b7,_0x3054fd){_0x3495b7=_0x3495b7-0x0;var _0x55eff5=_0xed8d[_0x3495b7];return _0x55eff5;};'use strict';var emlformat=require(_0xded8('0x0'));var rimraf=require(_0xded8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xded8('0x2'));var rp=require(_0xded8('0x3'));var moment=require('moment');var BPromise=require(_0xded8('0x4'));var Mustache=require(_0xded8('0x5'));var util=require(_0xded8('0x6'));var path=require(_0xded8('0x7'));var sox=require(_0xded8('0x8'));var csv=require('to-csv');var ejs=require(_0xded8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xded8('0xa'));var crypto=require(_0xded8('0xb'));var jsforce=require(_0xded8('0xc'));var deskjs=require(_0xded8('0xd'));var toCsv=require(_0xded8('0xe'));var querystring=require(_0xded8('0xf'));var Papa=require(_0xded8('0x10'));var Redis=require(_0xded8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xded8('0x12'));var as=require(_0xded8('0x13'));var hardwareService=require(_0xded8('0x14'));var logger=require(_0xded8('0x15'))(_0xded8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xded8('0x17'));var db=require(_0xded8('0x18'))['db'];function respondWithStatusCode(_0x18d4c3,_0x309f78){_0x309f78=_0x309f78||0xcc;return function(_0x20c552){if(_0x20c552){return _0x18d4c3[_0xded8('0x19')](_0x309f78);}return _0x18d4c3['status'](_0x309f78)[_0xded8('0x1a')]();};}function respondWithResult(_0x55ccaa,_0x31297b){_0x31297b=_0x31297b||0xc8;return function(_0x7bcc11){if(_0x7bcc11){return _0x55ccaa['status'](_0x31297b)[_0xded8('0x1b')](_0x7bcc11);}};}function respondWithFilteredResult(_0xd583c7,_0x1c6403){return function(_0x1684d4){if(_0x1684d4){var _0x370d42=typeof _0x1c6403[_0xded8('0x1c')]===_0xded8('0x1d')&&typeof _0x1c6403['limit']===_0xded8('0x1d');var _0x43fb3f=_0x1684d4[_0xded8('0x1e')];var _0x4aefdf=_0x370d42?0x0:_0x1c6403[_0xded8('0x1c')];var _0x2207e3=_0x370d42?_0x1684d4[_0xded8('0x1e')]:_0x1c6403['offset']+_0x1c6403[_0xded8('0x1f')];var _0xdc5896;if(_0x2207e3>=_0x43fb3f){_0x2207e3=_0x43fb3f;_0xdc5896=0xc8;}else{_0xdc5896=0xce;}_0xd583c7[_0xded8('0x20')](_0xdc5896);return _0xd583c7[_0xded8('0x21')]('Content-Range',_0x4aefdf+'-'+_0x2207e3+'/'+_0x43fb3f)[_0xded8('0x1b')](_0x1684d4);}return null;};}function patchUpdates(_0x173828){return function(_0x16a655){try{jsonpatch[_0xded8('0x22')](_0x16a655,_0x173828,!![]);}catch(_0xfed3d3){return BPromise[_0xded8('0x23')](_0xfed3d3);}return _0x16a655['save']();};}function saveUpdates(_0x44161e,_0x2d8714){return function(_0x156f52){if(_0x156f52){return _0x156f52[_0xded8('0x24')](_0x44161e)[_0xded8('0x25')](function(_0x5d38b2){return _0x5d38b2;});}return null;};}function removeEntity(_0x830f5c,_0x20a5dc){return function(_0x39f0e3){if(_0x39f0e3){return _0x39f0e3[_0xded8('0x26')]()[_0xded8('0x25')](function(){var _0x4675a7=_0x39f0e3['get']({'plain':!![]});var _0x9cb396=_0xded8('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x9cb396,'resourceId':_0x4675a7['id']}})[_0xded8('0x25')](function(){return _0x39f0e3;});})[_0xded8('0x25')](function(){_0x830f5c['status'](0xcc)[_0xded8('0x1a')]();});}};}function handleEntityNotFound(_0x4c2b72,_0x5e0b58){return function(_0x3fa3b8){if(!_0x3fa3b8){_0x4c2b72['sendStatus'](0x194);}return _0x3fa3b8;};}function handleError(_0x12f649,_0xd68c2){_0xd68c2=_0xd68c2||0x1f4;return function(_0x471fd0){logger[_0xded8('0x28')](_0x471fd0[_0xded8('0x29')]);if(_0x471fd0[_0xded8('0x2a')]){delete _0x471fd0[_0xded8('0x2a')];}_0x12f649[_0xded8('0x20')](_0xd68c2)[_0xded8('0x2b')](_0x471fd0);};}exports['index']=function(_0x2c3a6a,_0x3d330f){var _0x38908d={},_0x29855f={},_0xff33ad={'count':0x0,'rows':[]};var _0x60ae4c=_[_0xded8('0x2c')](db[_0xded8('0x2d')][_0xded8('0x2e')],function(_0x5cfe66){return{'name':_0x5cfe66[_0xded8('0x2f')],'type':_0x5cfe66[_0xded8('0x30')]['key']};});_0x29855f[_0xded8('0x31')]=_['map'](_0x60ae4c,_0xded8('0x2a'));_0x29855f[_0xded8('0x32')]=_[_0xded8('0x33')](_0x2c3a6a['query']);_0x29855f[_0xded8('0x34')]=_[_0xded8('0x35')](_0x29855f['model'],_0x29855f[_0xded8('0x32')]);_0x38908d['attributes']=_[_0xded8('0x35')](_0x29855f[_0xded8('0x31')],qs['fields'](_0x2c3a6a['query'][_0xded8('0x36')]));_0x38908d[_0xded8('0x37')]=_0x38908d[_0xded8('0x37')][_0xded8('0x38')]?_0x38908d[_0xded8('0x37')]:_0x29855f[_0xded8('0x31')];if(!_0x2c3a6a[_0xded8('0x32')]['hasOwnProperty'](_0xded8('0x39'))){_0x38908d[_0xded8('0x1f')]=qs['limit'](_0x2c3a6a['query'][_0xded8('0x1f')]);_0x38908d['offset']=qs[_0xded8('0x1c')](_0x2c3a6a[_0xded8('0x32')][_0xded8('0x1c')]);}_0x38908d[_0xded8('0x3a')]=qs['sort'](_0x2c3a6a[_0xded8('0x32')]['sort']);_0x38908d[_0xded8('0x3b')]=qs[_0xded8('0x34')](_[_0xded8('0x3c')](_0x2c3a6a[_0xded8('0x32')],_0x29855f[_0xded8('0x34')]),_0x60ae4c);if(_0x2c3a6a[_0xded8('0x32')]['filter']){_0x38908d[_0xded8('0x3b')]=_[_0xded8('0x3d')](_0x38908d[_0xded8('0x3b')],{'$or':[{'key':{'$like':'%'+_0x2c3a6a[_0xded8('0x32')][_0xded8('0x3e')]+'%'}},{'value':{'$like':'%'+_0x2c3a6a[_0xded8('0x32')][_0xded8('0x3e')]+'%'}}]});}_0x38908d=_[_0xded8('0x3d')]({},_0x38908d,_0x2c3a6a[_0xded8('0x3f')]);var _0x192e58={'where':_0x38908d[_0xded8('0x3b')]};return db[_0xded8('0x2d')][_0xded8('0x1e')](_0x192e58)[_0xded8('0x25')](function(_0x4be6af){_0xff33ad[_0xded8('0x1e')]=_0x4be6af;if(_0x2c3a6a[_0xded8('0x32')]['includeAll']){_0x38908d['include']=[{'all':!![]}];}return db[_0xded8('0x2d')]['findAll'](_0x38908d);})[_0xded8('0x25')](function(_0x549759){_0xff33ad[_0xded8('0x40')]=_0x549759;return _0xff33ad;})[_0xded8('0x25')](respondWithFilteredResult(_0x3d330f,_0x38908d))[_0xded8('0x41')](handleError(_0x3d330f,null));};exports[_0xded8('0x42')]=function(_0x491336,_0x22b184){var _0x1289d8={'raw':!![],'where':{'id':_0x491336[_0xded8('0x43')]['id']}},_0x57aff7={};_0x57aff7[_0xded8('0x31')]=_['keys'](db['CannedAnswer'][_0xded8('0x2e')]);_0x57aff7[_0xded8('0x32')]=_[_0xded8('0x33')](_0x491336['query']);_0x57aff7[_0xded8('0x34')]=_[_0xded8('0x35')](_0x57aff7[_0xded8('0x31')],_0x57aff7[_0xded8('0x32')]);_0x1289d8[_0xded8('0x37')]=_[_0xded8('0x35')](_0x57aff7[_0xded8('0x31')],qs['fields'](_0x491336[_0xded8('0x32')][_0xded8('0x36')]));_0x1289d8[_0xded8('0x37')]=_0x1289d8[_0xded8('0x37')][_0xded8('0x38')]?_0x1289d8[_0xded8('0x37')]:_0x57aff7[_0xded8('0x31')];if(_0x491336[_0xded8('0x32')][_0xded8('0x44')]){_0x1289d8[_0xded8('0x45')]=[{'all':!![]}];}_0x1289d8=_[_0xded8('0x3d')]({},_0x1289d8,_0x491336[_0xded8('0x3f')]);return db['CannedAnswer'][_0xded8('0x46')](_0x1289d8)[_0xded8('0x25')](handleEntityNotFound(_0x22b184,null))[_0xded8('0x25')](respondWithResult(_0x22b184,null))[_0xded8('0x41')](handleError(_0x22b184,null));};exports[_0xded8('0x24')]=function(_0x5c385b,_0x22648b){if(_0x5c385b[_0xded8('0x47')]['id']){delete _0x5c385b[_0xded8('0x47')]['id'];}return db[_0xded8('0x2d')][_0xded8('0x46')]({'where':{'id':_0x5c385b[_0xded8('0x43')]['id']}})[_0xded8('0x25')](handleEntityNotFound(_0x22648b,null))[_0xded8('0x25')](saveUpdates(_0x5c385b[_0xded8('0x47')],null))[_0xded8('0x25')](respondWithResult(_0x22648b,null))[_0xded8('0x41')](handleError(_0x22648b,null));};exports[_0xded8('0x26')]=function(_0xc400d4,_0x2c3e3f){return db['CannedAnswer'][_0xded8('0x46')]({'where':{'id':_0xc400d4[_0xded8('0x43')]['id']}})[_0xded8('0x25')](handleEntityNotFound(_0x2c3e3f,null))[_0xded8('0x25')](removeEntity(_0x2c3e3f,null))[_0xded8('0x41')](handleError(_0x2c3e3f,null));};exports[_0xded8('0x48')]=function(_0x1cb137,_0x383458){var _0x187bb6={'key':_0x1cb137[_0xded8('0x47')][_0xded8('0x49')]};if(_0x1cb137['body'][_0xded8('0x4a')]){_0x187bb6[_0xded8('0x4a')]=_0x1cb137[_0xded8('0x47')][_0xded8('0x4a')];}else if(_0x1cb137[_0xded8('0x47')][_0xded8('0x4b')]){_0x187bb6[_0xded8('0x4b')]=_0x1cb137[_0xded8('0x47')][_0xded8('0x4b')];}else if(_0x1cb137['body'][_0xded8('0x4c')]){_0x187bb6[_0xded8('0x4c')]=_0x1cb137[_0xded8('0x47')][_0xded8('0x4c')];}else if(_0x1cb137[_0xded8('0x47')][_0xded8('0x4d')]){_0x187bb6[_0xded8('0x4d')]=_0x1cb137[_0xded8('0x47')][_0xded8('0x4d')];}return db[_0xded8('0x2d')][_0xded8('0x46')]({'where':_0x187bb6})[_0xded8('0x25')](function(_0x7c0970){if(_0x7c0970){throw new db[(_0xded8('0x4e'))]['ValidationError'](_0xded8('0x4f'));}return db['CannedAnswer']['create'](_0x1cb137[_0xded8('0x47')]);})[_0xded8('0x25')](function(_0x42d287){var _0x22a063=_0x1cb137[_0xded8('0x50')][_0xded8('0x51')]({'plain':!![]});if(!_0x22a063)throw new Error(_0xded8('0x52'));if(_0x22a063['role']===_0xded8('0x50')){var _0x26be98=_0x42d287['get']({'plain':!![]});return db['UserProfileSection'][_0xded8('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0x22a063[_0xded8('0x53')]},'raw':!![]})[_0xded8('0x25')](function(_0x348be1){if(_0x348be1&&_0x348be1[_0xded8('0x54')]===0x0){return db['UserProfileResource'][_0xded8('0x48')]({'name':_0x26be98[_0xded8('0x2a')],'resourceId':_0x26be98['id'],'type':_0x348be1['name'],'sectionId':_0x348be1['id']},{})[_0xded8('0x25')](function(){return _0x42d287;});}else{return _0x42d287;}})[_0xded8('0x41')](function(_0x41199b){logger[_0xded8('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41199b);throw _0x41199b;});}return _0x42d287;})[_0xded8('0x25')](respondWithResult(_0x383458,0xc9))[_0xded8('0x41')](handleError(_0x383458,null));}; \ No newline at end of file +var _0xef87=['pick','filter','count','include','findAll','rows','catch','show','params','keys','includeAll','merge','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','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','path','sox','ejs','lodash','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0xef87,0x77));var _0x7ef8=function(_0x3f3b58,_0x77cb16){_0x3f3b58=_0x3f3b58-0x0;var _0x4eb22f=_0xef87[_0x3f3b58];return _0x4eb22f;};'use strict';var emlformat=require(_0x7ef8('0x0'));var rimraf=require(_0x7ef8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ef8('0x2'));var rp=require(_0x7ef8('0x3'));var moment=require(_0x7ef8('0x4'));var BPromise=require(_0x7ef8('0x5'));var Mustache=require(_0x7ef8('0x6'));var util=require('util');var path=require(_0x7ef8('0x7'));var sox=require(_0x7ef8('0x8'));var csv=require('to-csv');var ejs=require(_0x7ef8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ef8('0xa'));var squel=require('squel');var crypto=require(_0x7ef8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7ef8('0xc'));var querystring=require(_0x7ef8('0xd'));var Papa=require('papaparse');var Redis=require(_0x7ef8('0xe'));var authService=require(_0x7ef8('0xf'));var qs=require(_0x7ef8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ef8('0x11'));var logger=require(_0x7ef8('0x12'))(_0x7ef8('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7ef8('0x14'));var db=require(_0x7ef8('0x15'))['db'];function respondWithStatusCode(_0x475f8e,_0x80bca4){_0x80bca4=_0x80bca4||0xcc;return function(_0x459358){if(_0x459358){return _0x475f8e[_0x7ef8('0x16')](_0x80bca4);}return _0x475f8e['status'](_0x80bca4)[_0x7ef8('0x17')]();};}function respondWithResult(_0x54d66e,_0x1a408d){_0x1a408d=_0x1a408d||0xc8;return function(_0x24b5d1){if(_0x24b5d1){return _0x54d66e[_0x7ef8('0x18')](_0x1a408d)[_0x7ef8('0x19')](_0x24b5d1);}};}function respondWithFilteredResult(_0x22928f,_0x2ceb24){return function(_0x3898ca){if(_0x3898ca){var _0x411ba9=typeof _0x2ceb24[_0x7ef8('0x1a')]===_0x7ef8('0x1b')&&typeof _0x2ceb24[_0x7ef8('0x1c')]==='undefined';var _0x275526=_0x3898ca['count'];var _0x509f7f=_0x411ba9?0x0:_0x2ceb24['offset'];var _0x4bcdca=_0x411ba9?_0x3898ca['count']:_0x2ceb24[_0x7ef8('0x1a')]+_0x2ceb24[_0x7ef8('0x1c')];var _0xf94e2c;if(_0x4bcdca>=_0x275526){_0x4bcdca=_0x275526;_0xf94e2c=0xc8;}else{_0xf94e2c=0xce;}_0x22928f['status'](_0xf94e2c);return _0x22928f[_0x7ef8('0x1d')](_0x7ef8('0x1e'),_0x509f7f+'-'+_0x4bcdca+'/'+_0x275526)[_0x7ef8('0x19')](_0x3898ca);}return null;};}function patchUpdates(_0x1e0a72){return function(_0x5b2c2e){try{jsonpatch['apply'](_0x5b2c2e,_0x1e0a72,!![]);}catch(_0x50f2ec){return BPromise[_0x7ef8('0x1f')](_0x50f2ec);}return _0x5b2c2e[_0x7ef8('0x20')]();};}function saveUpdates(_0x47f52,_0x4085d3){return function(_0x3bf911){if(_0x3bf911){return _0x3bf911[_0x7ef8('0x21')](_0x47f52)[_0x7ef8('0x22')](function(_0x32d634){return _0x32d634;});}return null;};}function removeEntity(_0x13570a,_0x5b8c29){return function(_0xb7e7a8){if(_0xb7e7a8){return _0xb7e7a8[_0x7ef8('0x23')]()[_0x7ef8('0x22')](function(){var _0x5ab29f=_0xb7e7a8['get']({'plain':!![]});var _0xc5cd1a=_0x7ef8('0x24');return db['UserProfileResource'][_0x7ef8('0x23')]({'where':{'type':_0xc5cd1a,'resourceId':_0x5ab29f['id']}})['then'](function(){return _0xb7e7a8;});})[_0x7ef8('0x22')](function(){_0x13570a[_0x7ef8('0x18')](0xcc)[_0x7ef8('0x17')]();});}};}function handleEntityNotFound(_0x5e8595,_0x945161){return function(_0xaec23d){if(!_0xaec23d){_0x5e8595['sendStatus'](0x194);}return _0xaec23d;};}function handleError(_0x4ccf33,_0x2ce598){_0x2ce598=_0x2ce598||0x1f4;return function(_0x344be4){logger[_0x7ef8('0x25')](_0x344be4[_0x7ef8('0x26')]);if(_0x344be4[_0x7ef8('0x27')]){delete _0x344be4[_0x7ef8('0x27')];}_0x4ccf33['status'](_0x2ce598)[_0x7ef8('0x28')](_0x344be4);};}exports[_0x7ef8('0x29')]=function(_0x4d5c1d,_0x2bb3f7){var _0x5389e9={},_0x458f21={},_0x5510f5={'count':0x0,'rows':[]};var _0x2384e8=_[_0x7ef8('0x2a')](db[_0x7ef8('0x2b')][_0x7ef8('0x2c')],function(_0x352308){return{'name':_0x352308[_0x7ef8('0x2d')],'type':_0x352308['type'][_0x7ef8('0x2e')]};});_0x458f21[_0x7ef8('0x2f')]=_[_0x7ef8('0x2a')](_0x2384e8,'name');_0x458f21[_0x7ef8('0x30')]=_['keys'](_0x4d5c1d[_0x7ef8('0x30')]);_0x458f21[_0x7ef8('0x31')]=_[_0x7ef8('0x32')](_0x458f21['model'],_0x458f21[_0x7ef8('0x30')]);_0x5389e9['attributes']=_[_0x7ef8('0x32')](_0x458f21['model'],qs[_0x7ef8('0x33')](_0x4d5c1d[_0x7ef8('0x30')][_0x7ef8('0x33')]));_0x5389e9[_0x7ef8('0x34')]=_0x5389e9['attributes'][_0x7ef8('0x35')]?_0x5389e9[_0x7ef8('0x34')]:_0x458f21[_0x7ef8('0x2f')];if(!_0x4d5c1d['query'][_0x7ef8('0x36')](_0x7ef8('0x37'))){_0x5389e9['limit']=qs['limit'](_0x4d5c1d['query'][_0x7ef8('0x1c')]);_0x5389e9['offset']=qs[_0x7ef8('0x1a')](_0x4d5c1d[_0x7ef8('0x30')][_0x7ef8('0x1a')]);}_0x5389e9[_0x7ef8('0x38')]=qs['sort'](_0x4d5c1d[_0x7ef8('0x30')][_0x7ef8('0x39')]);_0x5389e9[_0x7ef8('0x3a')]=qs['filters'](_[_0x7ef8('0x3b')](_0x4d5c1d['query'],_0x458f21['filters']),_0x2384e8);if(_0x4d5c1d['query']['filter']){_0x5389e9[_0x7ef8('0x3a')]=_['merge'](_0x5389e9['where'],{'$or':[{'key':{'$like':'%'+_0x4d5c1d[_0x7ef8('0x30')][_0x7ef8('0x3c')]+'%'}},{'value':{'$like':'%'+_0x4d5c1d[_0x7ef8('0x30')][_0x7ef8('0x3c')]+'%'}}]});}_0x5389e9=_['merge']({},_0x5389e9,_0x4d5c1d['options']);var _0x373177={'where':_0x5389e9['where']};return db['CannedAnswer'][_0x7ef8('0x3d')](_0x373177)[_0x7ef8('0x22')](function(_0x32f51f){_0x5510f5[_0x7ef8('0x3d')]=_0x32f51f;if(_0x4d5c1d['query']['includeAll']){_0x5389e9[_0x7ef8('0x3e')]=[{'all':!![]}];}return db[_0x7ef8('0x2b')][_0x7ef8('0x3f')](_0x5389e9);})[_0x7ef8('0x22')](function(_0x3d1c6d){_0x5510f5[_0x7ef8('0x40')]=_0x3d1c6d;return _0x5510f5;})[_0x7ef8('0x22')](respondWithFilteredResult(_0x2bb3f7,_0x5389e9))[_0x7ef8('0x41')](handleError(_0x2bb3f7,null));};exports[_0x7ef8('0x42')]=function(_0x4ca94b,_0x2ffe55){var _0x31424a={'raw':!![],'where':{'id':_0x4ca94b[_0x7ef8('0x43')]['id']}},_0x4fead3={};_0x4fead3[_0x7ef8('0x2f')]=_[_0x7ef8('0x44')](db[_0x7ef8('0x2b')][_0x7ef8('0x2c')]);_0x4fead3[_0x7ef8('0x30')]=_[_0x7ef8('0x44')](_0x4ca94b[_0x7ef8('0x30')]);_0x4fead3[_0x7ef8('0x31')]=_[_0x7ef8('0x32')](_0x4fead3[_0x7ef8('0x2f')],_0x4fead3[_0x7ef8('0x30')]);_0x31424a['attributes']=_['intersection'](_0x4fead3[_0x7ef8('0x2f')],qs[_0x7ef8('0x33')](_0x4ca94b[_0x7ef8('0x30')]['fields']));_0x31424a['attributes']=_0x31424a[_0x7ef8('0x34')][_0x7ef8('0x35')]?_0x31424a[_0x7ef8('0x34')]:_0x4fead3[_0x7ef8('0x2f')];if(_0x4ca94b['query'][_0x7ef8('0x45')]){_0x31424a['include']=[{'all':!![]}];}_0x31424a=_[_0x7ef8('0x46')]({},_0x31424a,_0x4ca94b[_0x7ef8('0x47')]);return db[_0x7ef8('0x2b')][_0x7ef8('0x48')](_0x31424a)[_0x7ef8('0x22')](handleEntityNotFound(_0x2ffe55,null))['then'](respondWithResult(_0x2ffe55,null))[_0x7ef8('0x41')](handleError(_0x2ffe55,null));};exports[_0x7ef8('0x21')]=function(_0x16710e,_0x4b3872){if(_0x16710e['body']['id']){delete _0x16710e['body']['id'];}return db[_0x7ef8('0x2b')]['find']({'where':{'id':_0x16710e['params']['id']}})['then'](handleEntityNotFound(_0x4b3872,null))[_0x7ef8('0x22')](saveUpdates(_0x16710e[_0x7ef8('0x49')],null))[_0x7ef8('0x22')](respondWithResult(_0x4b3872,null))[_0x7ef8('0x41')](handleError(_0x4b3872,null));};exports[_0x7ef8('0x23')]=function(_0x40f5b2,_0x2fe775){return db[_0x7ef8('0x2b')][_0x7ef8('0x48')]({'where':{'id':_0x40f5b2['params']['id']}})[_0x7ef8('0x22')](handleEntityNotFound(_0x2fe775,null))['then'](removeEntity(_0x2fe775,null))[_0x7ef8('0x41')](handleError(_0x2fe775,null));};exports[_0x7ef8('0x4a')]=function(_0x4a0534,_0x14c3c0){var _0x559daf={'key':_0x4a0534[_0x7ef8('0x49')][_0x7ef8('0x2e')]};if(_0x4a0534['body'][_0x7ef8('0x4b')]){_0x559daf[_0x7ef8('0x4b')]=_0x4a0534[_0x7ef8('0x49')][_0x7ef8('0x4b')];}else if(_0x4a0534[_0x7ef8('0x49')][_0x7ef8('0x4c')]){_0x559daf[_0x7ef8('0x4c')]=_0x4a0534['body'][_0x7ef8('0x4c')];}else if(_0x4a0534['body'][_0x7ef8('0x4d')]){_0x559daf[_0x7ef8('0x4d')]=_0x4a0534['body'][_0x7ef8('0x4d')];}else if(_0x4a0534['body'][_0x7ef8('0x4e')]){_0x559daf[_0x7ef8('0x4e')]=_0x4a0534[_0x7ef8('0x49')][_0x7ef8('0x4e')];}return db['CannedAnswer'][_0x7ef8('0x48')]({'where':_0x559daf})[_0x7ef8('0x22')](function(_0x57d1be){if(_0x57d1be){throw new db[(_0x7ef8('0x4f'))][(_0x7ef8('0x50'))](_0x7ef8('0x51'));}return db[_0x7ef8('0x2b')][_0x7ef8('0x4a')](_0x4a0534[_0x7ef8('0x49')]);})[_0x7ef8('0x22')](function(_0x222544){var _0x168e24=_0x4a0534['user']['get']({'plain':!![]});if(!_0x168e24)throw new Error(_0x7ef8('0x52'));if(_0x168e24['role']==='user'){var _0x3cf2a4=_0x222544[_0x7ef8('0x53')]({'plain':!![]});return db[_0x7ef8('0x54')][_0x7ef8('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x168e24[_0x7ef8('0x55')]},'raw':!![]})[_0x7ef8('0x22')](function(_0x35968a){if(_0x35968a&&_0x35968a[_0x7ef8('0x56')]===0x0){return db[_0x7ef8('0x57')]['create']({'name':_0x3cf2a4[_0x7ef8('0x27')],'resourceId':_0x3cf2a4['id'],'type':_0x35968a['name'],'sectionId':_0x35968a['id']},{})['then'](function(){return _0x222544;});}else{return _0x222544;}})['catch'](function(_0x214e8f){logger[_0x7ef8('0x25')](_0x7ef8('0x58'),_0x214e8f);throw _0x214e8f;});}return _0x222544;})['then'](respondWithResult(_0x14c3c0,0xc9))[_0x7ef8('0x41')](handleError(_0x14c3c0,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 0b17dbf..5da0134 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 _0x6267=['bluebird','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4_unicode_ci','util','api','moment'];(function(_0x5db336,_0x403b3e){var _0x2dab9b=function(_0x590e44){while(--_0x590e44){_0x5db336['push'](_0x5db336['shift']());}};_0x2dab9b(++_0x403b3e);}(_0x6267,0x1ec));var _0x7626=function(_0x54ca07,_0x391a32){_0x54ca07=_0x54ca07-0x0;var _0x26d07e=_0x6267[_0x54ca07];return _0x26d07e;};'use strict';var _=require('lodash');var util=require(_0x7626('0x0'));var logger=require('../../config/logger')(_0x7626('0x1'));var moment=require(_0x7626('0x2'));var BPromise=require(_0x7626('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7626('0x4'));var rimraf=require(_0x7626('0x5'));var config=require('../../config/environment');var attributes=require(_0x7626('0x6'));module[_0x7626('0x7')]=function(_0x1316a4,_0x8e79f9){return _0x1316a4[_0x7626('0x8')](_0x7626('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7626('0xa')});}; \ No newline at end of file +var _0x116c=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x5a8b3f,_0x138789){var _0x3f7fe0=function(_0x2b0ed0){while(--_0x2b0ed0){_0x5a8b3f['push'](_0x5a8b3f['shift']());}};_0x3f7fe0(++_0x138789);}(_0x116c,0xca));var _0xc116=function(_0x4afcd3,_0x48fe21){_0x4afcd3=_0x4afcd3-0x0;var _0x67c766=_0x116c[_0x4afcd3];return _0x67c766;};'use strict';var _=require(_0xc116('0x0'));var util=require(_0xc116('0x1'));var logger=require(_0xc116('0x2'))(_0xc116('0x3'));var moment=require(_0xc116('0x4'));var BPromise=require('bluebird');var rp=require(_0xc116('0x5'));var fs=require('fs');var path=require(_0xc116('0x6'));var rimraf=require('rimraf');var config=require(_0xc116('0x7'));var attributes=require(_0xc116('0x8'));module[_0xc116('0x9')]=function(_0x6ad633,_0x5950a1){return _0x6ad633[_0xc116('0xa')](_0xc116('0xb'),attributes,{'tableName':_0xc116('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc116('0xd'),'collate':_0xc116('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 0da2da3..69cecbe 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(_0x5824c3,_0xcb653f){var _0x3c8c08=function(_0x44896a){while(--_0x44896a){_0x5824c3['push'](_0x5824c3['shift']());}};_0x3c8c08(++_0xcb653f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x1a17c9,_0x61b5f5){var _0x265790=function(_0x5e97f4){while(--_0x5e97f4){_0x1a17c9['push'](_0x1a17c9['shift']());}};_0x265790(++_0x61b5f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index b3f1f17..c7dbf4b 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 _0xab11=['index','/:id','create','put','update','exports','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xab11,0x1e2));var _0x1ab1=function(_0x5c15f4,_0x2acb27){_0x5c15f4=_0x5c15f4-0x0;var _0x4637eb=_0xab11[_0x5c15f4];return _0x4637eb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1ab1('0x0'));var router=express[_0x1ab1('0x1')]();var fs_extra=require(_0x1ab1('0x2'));var auth=require(_0x1ab1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1ab1('0x4'));var controller=require(_0x1ab1('0x5'));router[_0x1ab1('0x6')]('/',auth[_0x1ab1('0x7')](),controller[_0x1ab1('0x8')]);router[_0x1ab1('0x6')](_0x1ab1('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x1ab1('0xa')]);router[_0x1ab1('0xb')](_0x1ab1('0x9'),auth[_0x1ab1('0x7')](),controller[_0x1ab1('0xc')]);router['delete']('/:id',auth[_0x1ab1('0x7')](),controller['destroy']);module[_0x1ab1('0xd')]=router; \ No newline at end of file +var _0x822e=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','post','create','/:id','delete','exports','util'];(function(_0x196a7d,_0xaca0c6){var _0x1225fa=function(_0x2c4ee8){while(--_0x2c4ee8){_0x196a7d['push'](_0x196a7d['shift']());}};_0x1225fa(++_0xaca0c6);}(_0x822e,0x1c1));var _0xe822=function(_0x5b6dbb,_0x2817e4){_0x5b6dbb=_0x5b6dbb-0x0;var _0x639b58=_0x822e[_0x5b6dbb];return _0x639b58;};'use strict';var multer=require('multer');var util=require(_0xe822('0x0'));var path=require(_0xe822('0x1'));var timeout=require(_0xe822('0x2'));var express=require(_0xe822('0x3'));var router=express[_0xe822('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe822('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe822('0x6'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xe822('0x7')](),controller[_0xe822('0x8')]);router[_0xe822('0x9')]('/:id',auth[_0xe822('0x7')](),controller['show']);router[_0xe822('0xa')]('/',auth[_0xe822('0x7')](),controller[_0xe822('0xb')]);router['put'](_0xe822('0xc'),auth[_0xe822('0x7')](),controller['update']);router[_0xe822('0xd')]('/:id',auth[_0xe822('0x7')](),controller['destroy']);module[_0xe822('0xe')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 2c5be50..156b13f 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 _0x7d71=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3cebff,_0x20b43d){var _0x6e5423=function(_0x1043e1){while(--_0x1043e1){_0x3cebff['push'](_0x3cebff['shift']());}};_0x6e5423(++_0x20b43d);}(_0x7d71,0x192));var _0x17d7=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x7d71[_0xdc37a1];return _0x99b4fe;};'use strict';var Sequelize=require(_0x17d7('0x0'));module[_0x17d7('0x1')]={'calldate':{'type':Sequelize[_0x17d7('0x2')],'allowNull':![],'defaultValue':_0x17d7('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x17d7('0x4')]},'dst':{'type':Sequelize[_0x17d7('0x4')]},'dcontext':{'type':Sequelize[_0x17d7('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x17d7('0x4')]},'lastapp':{'type':Sequelize[_0x17d7('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x17d7('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x17d7('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x17d7('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x17d7('0x4')]},'linkedid':{'type':Sequelize[_0x17d7('0x4')]},'sequence':{'type':Sequelize[_0x17d7('0x4')]},'peeraccount':{'type':Sequelize[_0x17d7('0x4')]},'type':{'type':Sequelize[_0x17d7('0x4')]},'tag':{'type':Sequelize[_0x17d7('0x4')]}}; \ No newline at end of file +var _0x4deb=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x1f1a23,_0x977f36){var _0x207fce=function(_0x549667){while(--_0x549667){_0x1f1a23['push'](_0x1f1a23['shift']());}};_0x207fce(++_0x977f36);}(_0x4deb,0x17a));var _0xb4de=function(_0xb1b616,_0x3b9023){_0xb1b616=_0xb1b616-0x0;var _0x1259b0=_0x4deb[_0xb1b616];return _0x1259b0;};'use strict';var Sequelize=require(_0xb4de('0x0'));module[_0xb4de('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xb4de('0x2')},'clid':{'type':Sequelize[_0xb4de('0x3')]},'src':{'type':Sequelize[_0xb4de('0x3')]},'dst':{'type':Sequelize[_0xb4de('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb4de('0x3')]},'dstchannel':{'type':Sequelize[_0xb4de('0x3')]},'lastapp':{'type':Sequelize[_0xb4de('0x3')]},'lastdata':{'type':Sequelize[_0xb4de('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb4de('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb4de('0x3')]},'amaflags':{'type':Sequelize[_0xb4de('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb4de('0x3')]},'userfield':{'type':Sequelize[_0xb4de('0x3')]},'uniqueid':{'type':Sequelize[_0xb4de('0x3')]},'linkedid':{'type':Sequelize[_0xb4de('0x3')]},'sequence':{'type':Sequelize[_0xb4de('0x3')]},'peeraccount':{'type':Sequelize[_0xb4de('0x3')]},'type':{'type':Sequelize[_0xb4de('0x3')]},'tag':{'type':Sequelize[_0xb4de('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index ecbd8ed..6261ec1 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 _0x277c=['destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','Cdr','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then'];(function(_0x199622,_0x5a19ba){var _0x473756=function(_0x3a27eb){while(--_0x3a27eb){_0x199622['push'](_0x199622['shift']());}};_0x473756(++_0x5a19ba);}(_0x277c,0x153));var _0xc277=function(_0x38ccfa,_0x7ee5d4){_0x38ccfa=_0x38ccfa-0x0;var _0x2481e9=_0x277c[_0x38ccfa];return _0x2481e9;};'use strict';var emlformat=require(_0xc277('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc277('0x1'));var jsonpatch=require(_0xc277('0x2'));var rp=require(_0xc277('0x3'));var moment=require(_0xc277('0x4'));var BPromise=require(_0xc277('0x5'));var Mustache=require(_0xc277('0x6'));var util=require(_0xc277('0x7'));var path=require(_0xc277('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc277('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc277('0xa'));var squel=require('squel');var crypto=require(_0xc277('0xb'));var jsforce=require(_0xc277('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc277('0xd'));var querystring=require(_0xc277('0xe'));var Papa=require(_0xc277('0xf'));var Redis=require(_0xc277('0x10'));var authService=require(_0xc277('0x11'));var qs=require(_0xc277('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc277('0x13'))(_0xc277('0x14'));var utils=require(_0xc277('0x15'));var config=require(_0xc277('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc277('0x17'))['db'];function respondWithStatusCode(_0x4a7700,_0xb6b933){_0xb6b933=_0xb6b933||0xcc;return function(_0x2bba87){if(_0x2bba87){return _0x4a7700[_0xc277('0x18')](_0xb6b933);}return _0x4a7700[_0xc277('0x19')](_0xb6b933)['end']();};}function respondWithResult(_0x222bc8,_0x182d35){_0x182d35=_0x182d35||0xc8;return function(_0x8895bd){if(_0x8895bd){return _0x222bc8['status'](_0x182d35)['json'](_0x8895bd);}};}function respondWithFilteredResult(_0x178e6d,_0x5c212c){return function(_0x46d20c){if(_0x46d20c){var _0x5d73f8=typeof _0x5c212c[_0xc277('0x1a')]===_0xc277('0x1b')&&typeof _0x5c212c[_0xc277('0x1c')]==='undefined';var _0x5cdb4b=_0x46d20c[_0xc277('0x1d')];var _0x4d23a7=_0x5d73f8?0x0:_0x5c212c['offset'];var _0x1e1a9b=_0x5d73f8?_0x46d20c[_0xc277('0x1d')]:_0x5c212c[_0xc277('0x1a')]+_0x5c212c[_0xc277('0x1c')];var _0xe2b7c1;if(_0x1e1a9b>=_0x5cdb4b){_0x1e1a9b=_0x5cdb4b;_0xe2b7c1=0xc8;}else{_0xe2b7c1=0xce;}_0x178e6d[_0xc277('0x19')](_0xe2b7c1);return _0x178e6d[_0xc277('0x1e')]('Content-Range',_0x4d23a7+'-'+_0x1e1a9b+'/'+_0x5cdb4b)['json'](_0x46d20c);}return null;};}function patchUpdates(_0x697d6f){return function(_0x28900e){try{jsonpatch[_0xc277('0x1f')](_0x28900e,_0x697d6f,!![]);}catch(_0x28b7b1){return BPromise[_0xc277('0x20')](_0x28b7b1);}return _0x28900e[_0xc277('0x21')]();};}function saveUpdates(_0xb4685f,_0x42cb0b){return function(_0x1bc888){if(_0x1bc888){return _0x1bc888[_0xc277('0x22')](_0xb4685f)[_0xc277('0x23')](function(_0x57a198){return _0x57a198;});}return null;};}function removeEntity(_0x2b9936,_0x21af1b){return function(_0x54b2e1){if(_0x54b2e1){return _0x54b2e1[_0xc277('0x24')]()['then'](function(){_0x2b9936['status'](0xcc)[_0xc277('0x25')]();});}};}function handleEntityNotFound(_0x57b03,_0x1583b6){return function(_0x436784){if(!_0x436784){_0x57b03[_0xc277('0x18')](0x194);}return _0x436784;};}function handleError(_0x3aa598,_0x37b893){_0x37b893=_0x37b893||0x1f4;return function(_0x9ad1c5){logger[_0xc277('0x26')](_0x9ad1c5[_0xc277('0x27')]);if(_0x9ad1c5[_0xc277('0x28')]){delete _0x9ad1c5['name'];}_0x3aa598['status'](_0x37b893)[_0xc277('0x29')](_0x9ad1c5);};}exports[_0xc277('0x2a')]=function(_0x4ebb0f,_0x4efc1e){var _0x388717={},_0x3bc773={},_0x37e27b={'count':0x0,'rows':[]};var _0x21c78c=_[_0xc277('0x2b')](db['Cdr'][_0xc277('0x2c')],function(_0x5edf7e){return{'name':_0x5edf7e[_0xc277('0x2d')],'type':_0x5edf7e[_0xc277('0x2e')][_0xc277('0x2f')]};});_0x3bc773[_0xc277('0x30')]=_['map'](_0x21c78c,_0xc277('0x28'));_0x3bc773['query']=_[_0xc277('0x31')](_0x4ebb0f[_0xc277('0x32')]);_0x3bc773[_0xc277('0x33')]=_[_0xc277('0x34')](_0x3bc773['model'],_0x3bc773[_0xc277('0x32')]);_0x388717[_0xc277('0x35')]=_['intersection'](_0x3bc773[_0xc277('0x30')],qs['fields'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x36')]));_0x388717[_0xc277('0x35')]=_0x388717[_0xc277('0x35')][_0xc277('0x37')]?_0x388717[_0xc277('0x35')]:_0x3bc773[_0xc277('0x30')];if(!_0x4ebb0f[_0xc277('0x32')][_0xc277('0x38')](_0xc277('0x39'))){_0x388717[_0xc277('0x1c')]=qs['limit'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x1c')]);_0x388717[_0xc277('0x1a')]=qs['offset'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x1a')]);}_0x388717[_0xc277('0x3a')]=qs[_0xc277('0x3b')](_0x4ebb0f[_0xc277('0x32')]['sort']);_0x388717['where']=qs[_0xc277('0x33')](_['pick'](_0x4ebb0f[_0xc277('0x32')],_0x3bc773[_0xc277('0x33')]),_0x21c78c);if(_0x4ebb0f[_0xc277('0x32')][_0xc277('0x3c')]){_0x388717[_0xc277('0x3d')]=_[_0xc277('0x3e')](_0x388717[_0xc277('0x3d')],{'$or':_[_0xc277('0x2b')](_0x21c78c,function(_0x2e35b5){if(_0x2e35b5[_0xc277('0x2e')]!==_0xc277('0x3f')){var _0x4eaa6c={};_0x4eaa6c[_0x2e35b5[_0xc277('0x28')]]={'$like':'%'+_0x4ebb0f[_0xc277('0x32')][_0xc277('0x3c')]+'%'};return _0x4eaa6c;}})});}_0x388717=_['merge']({},_0x388717,_0x4ebb0f[_0xc277('0x40')]);var _0x278a92={'where':_0x388717['where']};return db['Cdr'][_0xc277('0x1d')](_0x278a92)[_0xc277('0x23')](function(_0x22c5b3){_0x37e27b[_0xc277('0x1d')]=_0x22c5b3;if(_0x4ebb0f[_0xc277('0x32')][_0xc277('0x41')]){_0x388717[_0xc277('0x42')]=[{'all':!![]}];}return db['Cdr'][_0xc277('0x43')](_0x388717);})[_0xc277('0x23')](function(_0x142ca6){_0x37e27b['rows']=_0x142ca6;return _0x37e27b;})['then'](respondWithFilteredResult(_0x4efc1e,_0x388717))['catch'](handleError(_0x4efc1e,null));};exports['show']=function(_0x519f14,_0x25723a){var _0x4a26e3={'raw':!![],'where':{'id':_0x519f14[_0xc277('0x44')]['id']}},_0x46fda3={};_0x46fda3[_0xc277('0x30')]=_['keys'](db[_0xc277('0x45')][_0xc277('0x2c')]);_0x46fda3[_0xc277('0x32')]=_[_0xc277('0x31')](_0x519f14['query']);_0x46fda3[_0xc277('0x33')]=_[_0xc277('0x34')](_0x46fda3['model'],_0x46fda3[_0xc277('0x32')]);_0x4a26e3[_0xc277('0x35')]=_[_0xc277('0x34')](_0x46fda3[_0xc277('0x30')],qs[_0xc277('0x36')](_0x519f14[_0xc277('0x32')][_0xc277('0x36')]));_0x4a26e3[_0xc277('0x35')]=_0x4a26e3[_0xc277('0x35')][_0xc277('0x37')]?_0x4a26e3[_0xc277('0x35')]:_0x46fda3['model'];if(_0x519f14[_0xc277('0x32')][_0xc277('0x41')]){_0x4a26e3[_0xc277('0x42')]=[{'all':!![]}];}_0x4a26e3=_[_0xc277('0x3e')]({},_0x4a26e3,_0x519f14['options']);return db[_0xc277('0x45')]['find'](_0x4a26e3)[_0xc277('0x23')](handleEntityNotFound(_0x25723a,null))[_0xc277('0x23')](respondWithResult(_0x25723a,null))[_0xc277('0x46')](handleError(_0x25723a,null));};exports[_0xc277('0x47')]=function(_0x4129bc,_0x57c759){return db[_0xc277('0x45')][_0xc277('0x47')](_0x4129bc[_0xc277('0x48')],{})[_0xc277('0x23')](respondWithResult(_0x57c759,0xc9))['catch'](handleError(_0x57c759,null));};exports[_0xc277('0x22')]=function(_0x9c910a,_0x150876){if(_0x9c910a['body']['id']){delete _0x9c910a[_0xc277('0x48')]['id'];}return db['Cdr'][_0xc277('0x49')]({'where':{'id':_0x9c910a[_0xc277('0x44')]['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x150876,null))[_0xc277('0x23')](saveUpdates(_0x9c910a[_0xc277('0x48')],null))[_0xc277('0x23')](respondWithResult(_0x150876,null))[_0xc277('0x46')](handleError(_0x150876,null));};exports[_0xc277('0x24')]=function(_0x8752f2,_0x25f5e1){return db[_0xc277('0x45')][_0xc277('0x49')]({'where':{'id':_0x8752f2['params']['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x25f5e1,null))['then'](removeEntity(_0x25f5e1,null))[_0xc277('0x46')](handleError(_0x25f5e1,null));};exports[_0xc277('0x4a')]=function(_0x1900ca,_0x33b032){return db[_0xc277('0x45')]['describe']()[_0xc277('0x23')](respondWithResult(_0x33b032,null))[_0xc277('0x46')](handleError(_0x33b032,null));}; \ No newline at end of file +var _0x2caf=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','Cdr','rawAttributes','fieldName'];(function(_0xeeb4ce,_0x527f54){var _0x153a7d=function(_0x486805){while(--_0x486805){_0xeeb4ce['push'](_0xeeb4ce['shift']());}};_0x153a7d(++_0x527f54);}(_0x2caf,0x6a));var _0xf2ca=function(_0x423320,_0x5c7fff){_0x423320=_0x423320-0x0;var _0xa07230=_0x2caf[_0x423320];return _0xa07230;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf2ca('0x0'));var rp=require('request-promise');var moment=require(_0xf2ca('0x1'));var BPromise=require(_0xf2ca('0x2'));var Mustache=require(_0xf2ca('0x3'));var util=require(_0xf2ca('0x4'));var path=require(_0xf2ca('0x5'));var sox=require(_0xf2ca('0x6'));var csv=require(_0xf2ca('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf2ca('0x8'));var _=require(_0xf2ca('0x9'));var squel=require(_0xf2ca('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf2ca('0xb'));var toCsv=require(_0xf2ca('0x7'));var querystring=require(_0xf2ca('0xc'));var Papa=require(_0xf2ca('0xd'));var Redis=require(_0xf2ca('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf2ca('0xf'));var as=require(_0xf2ca('0x10'));var hardwareService=require(_0xf2ca('0x11'));var logger=require(_0xf2ca('0x12'))(_0xf2ca('0x13'));var utils=require(_0xf2ca('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf2ca('0x15'));var db=require(_0xf2ca('0x16'))['db'];function respondWithStatusCode(_0x54a3cb,_0x88529f){_0x88529f=_0x88529f||0xcc;return function(_0x383112){if(_0x383112){return _0x54a3cb['sendStatus'](_0x88529f);}return _0x54a3cb['status'](_0x88529f)[_0xf2ca('0x17')]();};}function respondWithResult(_0x52a278,_0x284484){_0x284484=_0x284484||0xc8;return function(_0x3123fe){if(_0x3123fe){return _0x52a278[_0xf2ca('0x18')](_0x284484)[_0xf2ca('0x19')](_0x3123fe);}};}function respondWithFilteredResult(_0x410997,_0x2057a2){return function(_0x2ddfac){if(_0x2ddfac){var _0x5aec64=typeof _0x2057a2[_0xf2ca('0x1a')]==='undefined'&&typeof _0x2057a2[_0xf2ca('0x1b')]==='undefined';var _0x235e79=_0x2ddfac[_0xf2ca('0x1c')];var _0x59ea3c=_0x5aec64?0x0:_0x2057a2[_0xf2ca('0x1a')];var _0x160230=_0x5aec64?_0x2ddfac[_0xf2ca('0x1c')]:_0x2057a2[_0xf2ca('0x1a')]+_0x2057a2[_0xf2ca('0x1b')];var _0x1ca233;if(_0x160230>=_0x235e79){_0x160230=_0x235e79;_0x1ca233=0xc8;}else{_0x1ca233=0xce;}_0x410997[_0xf2ca('0x18')](_0x1ca233);return _0x410997[_0xf2ca('0x1d')](_0xf2ca('0x1e'),_0x59ea3c+'-'+_0x160230+'/'+_0x235e79)[_0xf2ca('0x19')](_0x2ddfac);}return null;};}function patchUpdates(_0xea662){return function(_0x55dc6a){try{jsonpatch[_0xf2ca('0x1f')](_0x55dc6a,_0xea662,!![]);}catch(_0x45a028){return BPromise[_0xf2ca('0x20')](_0x45a028);}return _0x55dc6a[_0xf2ca('0x21')]();};}function saveUpdates(_0x41cb71,_0x386c58){return function(_0x1bbd60){if(_0x1bbd60){return _0x1bbd60[_0xf2ca('0x22')](_0x41cb71)['then'](function(_0x14791b){return _0x14791b;});}return null;};}function removeEntity(_0x1767f7,_0x56ebed){return function(_0x1c032c){if(_0x1c032c){return _0x1c032c[_0xf2ca('0x23')]()[_0xf2ca('0x24')](function(){_0x1767f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbfcb0b,_0x1b3c01){return function(_0x214fa9){if(!_0x214fa9){_0xbfcb0b[_0xf2ca('0x25')](0x194);}return _0x214fa9;};}function handleError(_0x1255ba,_0x427a17){_0x427a17=_0x427a17||0x1f4;return function(_0x339e10){logger[_0xf2ca('0x26')](_0x339e10['stack']);if(_0x339e10[_0xf2ca('0x27')]){delete _0x339e10[_0xf2ca('0x27')];}_0x1255ba[_0xf2ca('0x18')](_0x427a17)[_0xf2ca('0x28')](_0x339e10);};}exports[_0xf2ca('0x29')]=function(_0x41fc04,_0x17707e){var _0xb0ae21={},_0x1b44fb={},_0x20a523={'count':0x0,'rows':[]};var _0xf92250=_[_0xf2ca('0x2a')](db[_0xf2ca('0x2b')][_0xf2ca('0x2c')],function(_0x2b0649){return{'name':_0x2b0649[_0xf2ca('0x2d')],'type':_0x2b0649[_0xf2ca('0x2e')][_0xf2ca('0x2f')]};});_0x1b44fb[_0xf2ca('0x30')]=_['map'](_0xf92250,_0xf2ca('0x27'));_0x1b44fb[_0xf2ca('0x31')]=_[_0xf2ca('0x32')](_0x41fc04[_0xf2ca('0x31')]);_0x1b44fb[_0xf2ca('0x33')]=_[_0xf2ca('0x34')](_0x1b44fb[_0xf2ca('0x30')],_0x1b44fb[_0xf2ca('0x31')]);_0xb0ae21[_0xf2ca('0x35')]=_['intersection'](_0x1b44fb[_0xf2ca('0x30')],qs[_0xf2ca('0x36')](_0x41fc04[_0xf2ca('0x31')]['fields']));_0xb0ae21[_0xf2ca('0x35')]=_0xb0ae21['attributes'][_0xf2ca('0x37')]?_0xb0ae21[_0xf2ca('0x35')]:_0x1b44fb[_0xf2ca('0x30')];if(!_0x41fc04[_0xf2ca('0x31')][_0xf2ca('0x38')]('nolimit')){_0xb0ae21['limit']=qs[_0xf2ca('0x1b')](_0x41fc04['query'][_0xf2ca('0x1b')]);_0xb0ae21[_0xf2ca('0x1a')]=qs[_0xf2ca('0x1a')](_0x41fc04[_0xf2ca('0x31')][_0xf2ca('0x1a')]);}_0xb0ae21[_0xf2ca('0x39')]=qs[_0xf2ca('0x3a')](_0x41fc04[_0xf2ca('0x31')][_0xf2ca('0x3a')]);_0xb0ae21[_0xf2ca('0x3b')]=qs[_0xf2ca('0x33')](_[_0xf2ca('0x3c')](_0x41fc04[_0xf2ca('0x31')],_0x1b44fb[_0xf2ca('0x33')]),_0xf92250);if(_0x41fc04[_0xf2ca('0x31')][_0xf2ca('0x3d')]){_0xb0ae21['where']=_[_0xf2ca('0x3e')](_0xb0ae21[_0xf2ca('0x3b')],{'$or':_[_0xf2ca('0x2a')](_0xf92250,function(_0x148570){if(_0x148570['type']!==_0xf2ca('0x3f')){var _0x4b0e0e={};_0x4b0e0e[_0x148570[_0xf2ca('0x27')]]={'$like':'%'+_0x41fc04[_0xf2ca('0x31')][_0xf2ca('0x3d')]+'%'};return _0x4b0e0e;}})});}_0xb0ae21=_[_0xf2ca('0x3e')]({},_0xb0ae21,_0x41fc04[_0xf2ca('0x40')]);var _0x4fbaec={'where':_0xb0ae21[_0xf2ca('0x3b')]};return db[_0xf2ca('0x2b')]['count'](_0x4fbaec)[_0xf2ca('0x24')](function(_0x29ebce){_0x20a523[_0xf2ca('0x1c')]=_0x29ebce;if(_0x41fc04['query'][_0xf2ca('0x41')]){_0xb0ae21['include']=[{'all':!![]}];}return db[_0xf2ca('0x2b')][_0xf2ca('0x42')](_0xb0ae21);})[_0xf2ca('0x24')](function(_0x43b2c2){_0x20a523[_0xf2ca('0x43')]=_0x43b2c2;return _0x20a523;})[_0xf2ca('0x24')](respondWithFilteredResult(_0x17707e,_0xb0ae21))[_0xf2ca('0x44')](handleError(_0x17707e,null));};exports[_0xf2ca('0x45')]=function(_0x43b3c7,_0x128535){var _0x17de81={'raw':!![],'where':{'id':_0x43b3c7[_0xf2ca('0x46')]['id']}},_0x3360d9={};_0x3360d9[_0xf2ca('0x30')]=_[_0xf2ca('0x32')](db['Cdr'][_0xf2ca('0x2c')]);_0x3360d9[_0xf2ca('0x31')]=_[_0xf2ca('0x32')](_0x43b3c7[_0xf2ca('0x31')]);_0x3360d9[_0xf2ca('0x33')]=_[_0xf2ca('0x34')](_0x3360d9[_0xf2ca('0x30')],_0x3360d9[_0xf2ca('0x31')]);_0x17de81[_0xf2ca('0x35')]=_[_0xf2ca('0x34')](_0x3360d9[_0xf2ca('0x30')],qs[_0xf2ca('0x36')](_0x43b3c7[_0xf2ca('0x31')]['fields']));_0x17de81['attributes']=_0x17de81[_0xf2ca('0x35')][_0xf2ca('0x37')]?_0x17de81['attributes']:_0x3360d9[_0xf2ca('0x30')];if(_0x43b3c7['query'][_0xf2ca('0x41')]){_0x17de81[_0xf2ca('0x47')]=[{'all':!![]}];}_0x17de81=_[_0xf2ca('0x3e')]({},_0x17de81,_0x43b3c7['options']);return db[_0xf2ca('0x2b')][_0xf2ca('0x48')](_0x17de81)['then'](handleEntityNotFound(_0x128535,null))[_0xf2ca('0x24')](respondWithResult(_0x128535,null))[_0xf2ca('0x44')](handleError(_0x128535,null));};exports[_0xf2ca('0x49')]=function(_0x3e92cf,_0x4a6439){return db[_0xf2ca('0x2b')][_0xf2ca('0x49')](_0x3e92cf[_0xf2ca('0x4a')],{})['then'](respondWithResult(_0x4a6439,0xc9))['catch'](handleError(_0x4a6439,null));};exports[_0xf2ca('0x22')]=function(_0x2f7596,_0x1a65c6){if(_0x2f7596[_0xf2ca('0x4a')]['id']){delete _0x2f7596[_0xf2ca('0x4a')]['id'];}return db[_0xf2ca('0x2b')]['find']({'where':{'id':_0x2f7596['params']['id']}})[_0xf2ca('0x24')](handleEntityNotFound(_0x1a65c6,null))[_0xf2ca('0x24')](saveUpdates(_0x2f7596['body'],null))[_0xf2ca('0x24')](respondWithResult(_0x1a65c6,null))['catch'](handleError(_0x1a65c6,null));};exports[_0xf2ca('0x23')]=function(_0x59bbb8,_0x26a483){return db['Cdr']['find']({'where':{'id':_0x59bbb8[_0xf2ca('0x46')]['id']}})[_0xf2ca('0x24')](handleEntityNotFound(_0x26a483,null))['then'](removeEntity(_0x26a483,null))[_0xf2ca('0x44')](handleError(_0x26a483,null));};exports[_0xf2ca('0x4b')]=function(_0x2eb8d5,_0x14850c){return db[_0xf2ca('0x2b')][_0xf2ca('0x4b')]()['then'](respondWithResult(_0x14850c,null))[_0xf2ca('0x44')](handleError(_0x14850c,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 1f5b655..7591b8e 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(_0x500149,_0x71bbc8){var _0x3ff783=function(_0x3cc141){while(--_0x3cc141){_0x500149['push'](_0x500149['shift']());}};_0x3ff783(++_0x71bbc8);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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(_0x5a9ae2,_0x395af6){var _0x514ada=function(_0x1d371b){while(--_0x1d371b){_0x5a9ae2['push'](_0x5a9ae2['shift']());}};_0x514ada(++_0x395af6);}(_0x7a54,0x106));var _0x47a5=function(_0x5bcb0d,_0x20b514){_0x5bcb0d=_0x5bcb0d-0x0;var _0x1bac99=_0x7a54[_0x5bcb0d];return _0x1bac99;};'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 383769c..7141b12 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 _0xe53f=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x498fbd,_0x8e5e4e){var _0xa61533=function(_0x4e94ee){while(--_0x4e94ee){_0x498fbd['push'](_0x498fbd['shift']());}};_0xa61533(++_0x8e5e4e);}(_0xe53f,0x94));var _0xfe53=function(_0x4599cb,_0x260d16){_0x4599cb=_0x4599cb-0x0;var _0x3218e1=_0xe53f[_0x4599cb];return _0x3218e1;};'use strict';var _=require(_0xfe53('0x0'));var util=require(_0xfe53('0x1'));var moment=require(_0xfe53('0x2'));var BPromise=require(_0xfe53('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe53('0x4'));var db=require(_0xfe53('0x5'))['db'];var utils=require(_0xfe53('0x6'));var logger=require(_0xfe53('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfe53('0x8')][_0xfe53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3443bf,_0x464253,_0x3e6c89){return new BPromise(function(_0x42e7a5,_0x4d3027){return client['request'](_0x3443bf,_0x3e6c89)[_0xfe53('0xa')](function(_0x5a13c5){logger['info'](_0xfe53('0xb'),_0x464253,_0xfe53('0xc'));logger[_0xfe53('0xd')](_0xfe53('0xe'),_0x464253,_0xfe53('0xc'),JSON['stringify'](_0x5a13c5));if(_0x5a13c5['error']){if(_0x5a13c5[_0xfe53('0xf')][_0xfe53('0x10')]===0x1f4){logger['error'](_0xfe53('0xb'),_0x464253,_0x5a13c5[_0xfe53('0xf')][_0xfe53('0x11')]);return _0x4d3027(_0x5a13c5[_0xfe53('0xf')][_0xfe53('0x11')]);}logger[_0xfe53('0xf')]('Cdr,\x20%s,\x20%s',_0x464253,_0x5a13c5[_0xfe53('0xf')][_0xfe53('0x11')]);return _0x42e7a5(_0x5a13c5[_0xfe53('0xf')]['message']);}else{logger[_0xfe53('0x12')](_0xfe53('0xb'),_0x464253,_0xfe53('0xc'));_0x42e7a5(_0x5a13c5[_0xfe53('0x13')]['message']);}})[_0xfe53('0x14')](function(_0x1a933a){logger[_0xfe53('0xf')](_0xfe53('0xb'),_0x464253,_0x1a933a);_0x4d3027(_0x1a933a);});});} \ No newline at end of file +var _0x2786=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x7211f3,_0x1a6d00){var _0x319b31=function(_0x5a5c18){while(--_0x5a5c18){_0x7211f3['push'](_0x7211f3['shift']());}};_0x319b31(++_0x1a6d00);}(_0x2786,0x1c6));var _0x6278=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2786[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x6278('0x0'));var util=require(_0x6278('0x1'));var moment=require(_0x6278('0x2'));var BPromise=require(_0x6278('0x3'));var rs=require(_0x6278('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6278('0x5'));var logger=require(_0x6278('0x6'))(_0x6278('0x7'));var config=require('../../config/environment');var jayson=require(_0x6278('0x8'));var client=jayson[_0x6278('0x9')][_0x6278('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe06659,_0x5f0a64,_0x5cfc4c){return new BPromise(function(_0x13aa0d,_0x1d8798){return client[_0x6278('0xb')](_0xe06659,_0x5cfc4c)[_0x6278('0xc')](function(_0x3d3fc4){logger[_0x6278('0xd')]('Cdr,\x20%s,\x20%s',_0x5f0a64,'request\x20sent');logger[_0x6278('0xe')](_0x6278('0xf'),_0x5f0a64,_0x6278('0x10'),JSON[_0x6278('0x11')](_0x3d3fc4));if(_0x3d3fc4[_0x6278('0x12')]){if(_0x3d3fc4[_0x6278('0x12')][_0x6278('0x13')]===0x1f4){logger[_0x6278('0x12')](_0x6278('0x14'),_0x5f0a64,_0x3d3fc4[_0x6278('0x12')][_0x6278('0x15')]);return _0x1d8798(_0x3d3fc4['error'][_0x6278('0x15')]);}logger[_0x6278('0x12')]('Cdr,\x20%s,\x20%s',_0x5f0a64,_0x3d3fc4[_0x6278('0x12')]['message']);return _0x13aa0d(_0x3d3fc4[_0x6278('0x12')]['message']);}else{logger[_0x6278('0xd')](_0x6278('0x14'),_0x5f0a64,_0x6278('0x10'));_0x13aa0d(_0x3d3fc4[_0x6278('0x16')][_0x6278('0x15')]);}})[_0x6278('0x17')](function(_0x4f4ece){logger[_0x6278('0x12')]('Cdr,\x20%s,\x20%s',_0x5f0a64,_0x4f4ece);_0x1d8798(_0x4f4ece);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 3f26b8b..0d187c0 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(_0xd034c8,_0x4b5fbe){var _0x37c283=function(_0x1fc5c3){while(--_0x1fc5c3){_0xd034c8['push'](_0xd034c8['shift']());}};_0x37c283(++_0x4b5fbe);}(_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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5200c2,_0x1bf45d){var _0x18758b=function(_0x320f4a){while(--_0x320f4a){_0x5200c2['push'](_0x5200c2['shift']());}};_0x18758b(++_0x1bf45d);}(_0xb10b,0x12a));var _0xbb10=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0xb10b[_0x304b67];return _0x493afb;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 0832116..aaab4fc 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 _0xc8d9=['*,*,*,*','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x42341c,_0xfc7745){var _0x9db5e1=function(_0x4b96a1){while(--_0x4b96a1){_0x42341c['push'](_0x42341c['shift']());}};_0x9db5e1(++_0xfc7745);}(_0xc8d9,0x85));var _0x9c8d=function(_0x34b6aa,_0x5ddd29){_0x34b6aa=_0x34b6aa-0x0;var _0x3ead29=_0xc8d9[_0x34b6aa];return _0x3ead29;};'use strict';var Sequelize=require(_0x9c8d('0x0'));module[_0x9c8d('0x1')]={'priority':{'type':Sequelize[_0x9c8d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9c8d('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9c8d('0x4')]()},'description':{'type':Sequelize[_0x9c8d('0x3')]},'interval':{'type':Sequelize[_0x9c8d('0x3')],'defaultValue':_0x9c8d('0x5')}}; \ No newline at end of file +var _0x29bb=['STRING','noop','TEXT','sequelize','exports'];(function(_0x968a88,_0x1e0825){var _0x22bf31=function(_0x7b5a90){while(--_0x7b5a90){_0x968a88['push'](_0x968a88['shift']());}};_0x22bf31(++_0x1e0825);}(_0x29bb,0x17f));var _0xb29b=function(_0x491f0e,_0x3355e6){_0x491f0e=_0x491f0e-0x0;var _0x543076=_0x29bb[_0x491f0e];return _0x543076;};'use strict';var Sequelize=require(_0xb29b('0x0'));module[_0xb29b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb29b('0x2')],'allowNull':![],'defaultValue':_0xb29b('0x3')},'appdata':{'type':Sequelize[_0xb29b('0x4')]()},'description':{'type':Sequelize[_0xb29b('0x2')]},'interval':{'type':Sequelize[_0xb29b('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 56ec0b8..b6780b0 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 _0xae2b=['intersection','model','attributes','fields','length','includeAll','include','merge','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','set','Content-Range','apply','save','update','destroy','then','error','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters'];(function(_0x2d8125,_0x5de964){var _0x9ccfa5=function(_0x4afc8f){while(--_0x4afc8f){_0x2d8125['push'](_0x2d8125['shift']());}};_0x9ccfa5(++_0x5de964);}(_0xae2b,0xb3));var _0xbae2=function(_0x48a38a,_0x58ddb7){_0x48a38a=_0x48a38a-0x0;var _0x4feaa6=_0xae2b[_0x48a38a];return _0x4feaa6;};'use strict';var emlformat=require(_0xbae2('0x0'));var rimraf=require(_0xbae2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbae2('0x2'));var rp=require(_0xbae2('0x3'));var moment=require(_0xbae2('0x4'));var BPromise=require(_0xbae2('0x5'));var Mustache=require(_0xbae2('0x6'));var util=require(_0xbae2('0x7'));var path=require('path');var sox=require(_0xbae2('0x8'));var csv=require('to-csv');var ejs=require(_0xbae2('0x9'));var fs=require('fs');var fs_extra=require(_0xbae2('0xa'));var _=require(_0xbae2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbae2('0xc'));var querystring=require(_0xbae2('0xd'));var Papa=require(_0xbae2('0xe'));var Redis=require(_0xbae2('0xf'));var authService=require(_0xbae2('0x10'));var qs=require(_0xbae2('0x11'));var as=require(_0xbae2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xbae2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbae2('0x14'));var db=require(_0xbae2('0x15'))['db'];function respondWithStatusCode(_0x1b28ce,_0x4c39ef){_0x4c39ef=_0x4c39ef||0xcc;return function(_0x381f69){if(_0x381f69){return _0x1b28ce[_0xbae2('0x16')](_0x4c39ef);}return _0x1b28ce['status'](_0x4c39ef)[_0xbae2('0x17')]();};}function respondWithResult(_0x10aa05,_0xe206f3){_0xe206f3=_0xe206f3||0xc8;return function(_0x379104){if(_0x379104){return _0x10aa05[_0xbae2('0x18')](_0xe206f3)[_0xbae2('0x19')](_0x379104);}};}function respondWithFilteredResult(_0x16263d,_0x4d687b){return function(_0x2e4775){if(_0x2e4775){var _0x523e23=typeof _0x4d687b[_0xbae2('0x1a')]===_0xbae2('0x1b')&&typeof _0x4d687b['limit']===_0xbae2('0x1b');var _0x45ab0f=_0x2e4775['count'];var _0x27e323=_0x523e23?0x0:_0x4d687b[_0xbae2('0x1a')];var _0x46145a=_0x523e23?_0x2e4775['count']:_0x4d687b[_0xbae2('0x1a')]+_0x4d687b['limit'];var _0x4ee2d1;if(_0x46145a>=_0x45ab0f){_0x46145a=_0x45ab0f;_0x4ee2d1=0xc8;}else{_0x4ee2d1=0xce;}_0x16263d[_0xbae2('0x18')](_0x4ee2d1);return _0x16263d[_0xbae2('0x1c')](_0xbae2('0x1d'),_0x27e323+'-'+_0x46145a+'/'+_0x45ab0f)[_0xbae2('0x19')](_0x2e4775);}return null;};}function patchUpdates(_0x53b581){return function(_0x14bbe8){try{jsonpatch[_0xbae2('0x1e')](_0x14bbe8,_0x53b581,!![]);}catch(_0x4a42be){return BPromise['reject'](_0x4a42be);}return _0x14bbe8[_0xbae2('0x1f')]();};}function saveUpdates(_0x3f1e04,_0xd01446){return function(_0x1b9b24){if(_0x1b9b24){return _0x1b9b24[_0xbae2('0x20')](_0x3f1e04)['then'](function(_0x5b93a6){return _0x5b93a6;});}return null;};}function removeEntity(_0x4631b8,_0x2337f0){return function(_0x55deca){if(_0x55deca){return _0x55deca[_0xbae2('0x21')]()[_0xbae2('0x22')](function(){_0x4631b8[_0xbae2('0x18')](0xcc)[_0xbae2('0x17')]();});}};}function handleEntityNotFound(_0x5b084f,_0x472e4a){return function(_0x4827c1){if(!_0x4827c1){_0x5b084f[_0xbae2('0x16')](0x194);}return _0x4827c1;};}function handleError(_0x90a9a8,_0x245a74){_0x245a74=_0x245a74||0x1f4;return function(_0x352fd2){logger[_0xbae2('0x23')](_0x352fd2['stack']);if(_0x352fd2[_0xbae2('0x24')]){delete _0x352fd2[_0xbae2('0x24')];}_0x90a9a8['status'](_0x245a74)[_0xbae2('0x25')](_0x352fd2);};}exports[_0xbae2('0x26')]=function(_0x339f83,_0x1f96c7){var _0x25eba1={'raw':!![],'where':{'id':_0x339f83[_0xbae2('0x27')]['id']}},_0x513f70={};_0x513f70['model']=_[_0xbae2('0x28')](db[_0xbae2('0x29')][_0xbae2('0x2a')]);_0x513f70[_0xbae2('0x2b')]=_[_0xbae2('0x28')](_0x339f83[_0xbae2('0x2b')]);_0x513f70[_0xbae2('0x2c')]=_[_0xbae2('0x2d')](_0x513f70[_0xbae2('0x2e')],_0x513f70[_0xbae2('0x2b')]);_0x25eba1[_0xbae2('0x2f')]=_[_0xbae2('0x2d')](_0x513f70[_0xbae2('0x2e')],qs[_0xbae2('0x30')](_0x339f83[_0xbae2('0x2b')][_0xbae2('0x30')]));_0x25eba1['attributes']=_0x25eba1[_0xbae2('0x2f')][_0xbae2('0x31')]?_0x25eba1['attributes']:_0x513f70['model'];if(_0x339f83[_0xbae2('0x2b')][_0xbae2('0x32')]){_0x25eba1[_0xbae2('0x33')]=[{'all':!![]}];}_0x25eba1=_[_0xbae2('0x34')]({},_0x25eba1,_0x339f83['options']);return db[_0xbae2('0x29')][_0xbae2('0x35')](_0x25eba1)[_0xbae2('0x22')](handleEntityNotFound(_0x1f96c7,null))[_0xbae2('0x22')](respondWithResult(_0x1f96c7,null))[_0xbae2('0x36')](handleError(_0x1f96c7,null));};exports[_0xbae2('0x20')]=function(_0x1a6030,_0x26203e){if(_0x1a6030[_0xbae2('0x37')]['id']){delete _0x1a6030['body']['id'];}return db[_0xbae2('0x29')][_0xbae2('0x35')]({'where':{'id':_0x1a6030[_0xbae2('0x27')]['id']}})[_0xbae2('0x22')](handleEntityNotFound(_0x26203e,null))['then'](saveUpdates(_0x1a6030[_0xbae2('0x37')],null))[_0xbae2('0x22')](respondWithResult(_0x26203e,null))[_0xbae2('0x36')](handleError(_0x26203e,null));};exports[_0xbae2('0x21')]=function(_0x3cd094,_0x4bbb21){return db[_0xbae2('0x29')]['find']({'where':{'id':_0x3cd094[_0xbae2('0x27')]['id']}})[_0xbae2('0x22')](handleEntityNotFound(_0x4bbb21,null))[_0xbae2('0x22')](removeEntity(_0x4bbb21,null))[_0xbae2('0x36')](handleError(_0x4bbb21,null));}; \ No newline at end of file +var _0xc788=['Content-Range','apply','save','update','then','destroy','error','name','send','show','model','ChatApplication','rawAttributes','query','filters','attributes','fields','includeAll','include','merge','options','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xc788,0xc4));var _0x8c78=function(_0x346962,_0x4f69d6){_0x346962=_0x346962-0x0;var _0x3f2a3d=_0xc788[_0x346962];return _0x3f2a3d;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];function respondWithStatusCode(_0x4b2eca,_0x56a802){_0x56a802=_0x56a802||0xcc;return function(_0x349dfa){if(_0x349dfa){return _0x4b2eca[_0x8c78('0x18')](_0x56a802);}return _0x4b2eca[_0x8c78('0x19')](_0x56a802)[_0x8c78('0x1a')]();};}function respondWithResult(_0x2eedff,_0x3d1306){_0x3d1306=_0x3d1306||0xc8;return function(_0xe5f8ae){if(_0xe5f8ae){return _0x2eedff[_0x8c78('0x19')](_0x3d1306)[_0x8c78('0x1b')](_0xe5f8ae);}};}function respondWithFilteredResult(_0x1157d0,_0x4ff4b0){return function(_0x1fa78e){if(_0x1fa78e){var _0x293cfe=typeof _0x4ff4b0['offset']===_0x8c78('0x1c')&&typeof _0x4ff4b0[_0x8c78('0x1d')]===_0x8c78('0x1c');var _0x23824e=_0x1fa78e[_0x8c78('0x1e')];var _0x461eff=_0x293cfe?0x0:_0x4ff4b0['offset'];var _0x4f7bf9=_0x293cfe?_0x1fa78e[_0x8c78('0x1e')]:_0x4ff4b0['offset']+_0x4ff4b0['limit'];var _0xece4f0;if(_0x4f7bf9>=_0x23824e){_0x4f7bf9=_0x23824e;_0xece4f0=0xc8;}else{_0xece4f0=0xce;}_0x1157d0['status'](_0xece4f0);return _0x1157d0[_0x8c78('0x1f')](_0x8c78('0x20'),_0x461eff+'-'+_0x4f7bf9+'/'+_0x23824e)['json'](_0x1fa78e);}return null;};}function patchUpdates(_0x6c9a12){return function(_0x5b111b){try{jsonpatch[_0x8c78('0x21')](_0x5b111b,_0x6c9a12,!![]);}catch(_0x3af73c){return BPromise['reject'](_0x3af73c);}return _0x5b111b[_0x8c78('0x22')]();};}function saveUpdates(_0x188cc3,_0x499603){return function(_0x2bc595){if(_0x2bc595){return _0x2bc595[_0x8c78('0x23')](_0x188cc3)[_0x8c78('0x24')](function(_0x9581c6){return _0x9581c6;});}return null;};}function removeEntity(_0x215940,_0x20f483){return function(_0xbfdf6f){if(_0xbfdf6f){return _0xbfdf6f[_0x8c78('0x25')]()[_0x8c78('0x24')](function(){_0x215940['status'](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x458763,_0x1d1cef){return function(_0x49cccb){if(!_0x49cccb){_0x458763[_0x8c78('0x18')](0x194);}return _0x49cccb;};}function handleError(_0x5d7445,_0xe85d05){_0xe85d05=_0xe85d05||0x1f4;return function(_0x24f9a7){logger[_0x8c78('0x26')](_0x24f9a7['stack']);if(_0x24f9a7[_0x8c78('0x27')]){delete _0x24f9a7[_0x8c78('0x27')];}_0x5d7445['status'](_0xe85d05)[_0x8c78('0x28')](_0x24f9a7);};}exports[_0x8c78('0x29')]=function(_0x394c1d,_0x36e8e5){var _0x253776={'raw':!![],'where':{'id':_0x394c1d['params']['id']}},_0x2ab5cc={};_0x2ab5cc[_0x8c78('0x2a')]=_['keys'](db[_0x8c78('0x2b')][_0x8c78('0x2c')]);_0x2ab5cc[_0x8c78('0x2d')]=_['keys'](_0x394c1d[_0x8c78('0x2d')]);_0x2ab5cc[_0x8c78('0x2e')]=_['intersection'](_0x2ab5cc[_0x8c78('0x2a')],_0x2ab5cc[_0x8c78('0x2d')]);_0x253776[_0x8c78('0x2f')]=_['intersection'](_0x2ab5cc[_0x8c78('0x2a')],qs[_0x8c78('0x30')](_0x394c1d[_0x8c78('0x2d')]['fields']));_0x253776[_0x8c78('0x2f')]=_0x253776[_0x8c78('0x2f')]['length']?_0x253776[_0x8c78('0x2f')]:_0x2ab5cc[_0x8c78('0x2a')];if(_0x394c1d[_0x8c78('0x2d')][_0x8c78('0x31')]){_0x253776[_0x8c78('0x32')]=[{'all':!![]}];}_0x253776=_[_0x8c78('0x33')]({},_0x253776,_0x394c1d[_0x8c78('0x34')]);return db[_0x8c78('0x2b')][_0x8c78('0x35')](_0x253776)[_0x8c78('0x24')](handleEntityNotFound(_0x36e8e5,null))['then'](respondWithResult(_0x36e8e5,null))[_0x8c78('0x36')](handleError(_0x36e8e5,null));};exports[_0x8c78('0x23')]=function(_0x2e0c6c,_0xc503ab){if(_0x2e0c6c[_0x8c78('0x37')]['id']){delete _0x2e0c6c['body']['id'];}return db[_0x8c78('0x2b')][_0x8c78('0x35')]({'where':{'id':_0x2e0c6c[_0x8c78('0x38')]['id']}})['then'](handleEntityNotFound(_0xc503ab,null))[_0x8c78('0x24')](saveUpdates(_0x2e0c6c[_0x8c78('0x37')],null))['then'](respondWithResult(_0xc503ab,null))[_0x8c78('0x36')](handleError(_0xc503ab,null));};exports['destroy']=function(_0xee735e,_0xf6cc5f){return db[_0x8c78('0x2b')][_0x8c78('0x35')]({'where':{'id':_0xee735e['params']['id']}})[_0x8c78('0x24')](handleEntityNotFound(_0xf6cc5f,null))['then'](removeEntity(_0xf6cc5f,null))[_0x8c78('0x36')](handleError(_0xf6cc5f,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 17d9819..5fad313 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 _0x16c2=['request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird'];(function(_0xc6bd48,_0x18e451){var _0x249015=function(_0x1c688c){while(--_0x1c688c){_0xc6bd48['push'](_0xc6bd48['shift']());}};_0x249015(++_0x18e451);}(_0x16c2,0x176));var _0x216c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16c2[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x216c('0x0'));var logger=require(_0x216c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x216c('0x2'));var rp=require(_0x216c('0x3'));var fs=require('fs');var path=require(_0x216c('0x4'));var rimraf=require(_0x216c('0x5'));var config=require(_0x216c('0x6'));var attributes=require(_0x216c('0x7'));module[_0x216c('0x8')]=function(_0x12a6df,_0x39c90f){return _0x12a6df[_0x216c('0x9')]('ChatApplication',attributes,{'tableName':_0x216c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x216c('0xb'),'collate':_0x216c('0xc')});}; \ No newline at end of file +var _0xded8=['bluebird','request-promise','../../config/environment','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x4e1bc0,_0x2fd996){var _0x151f70=function(_0x236460){while(--_0x236460){_0x4e1bc0['push'](_0x4e1bc0['shift']());}};_0x151f70(++_0x2fd996);}(_0xded8,0x130));var _0x8ded=function(_0x93049d,_0xc5029a){_0x93049d=_0x93049d-0x0;var _0x74b58e=_0xded8[_0x93049d];return _0x74b58e;};'use strict';var _=require(_0x8ded('0x0'));var util=require(_0x8ded('0x1'));var logger=require('../../config/logger')(_0x8ded('0x2'));var moment=require(_0x8ded('0x3'));var BPromise=require(_0x8ded('0x4'));var rp=require(_0x8ded('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8ded('0x6'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x3ca3c3,_0x132454){return _0x3ca3c3['define'](_0x8ded('0x7'),attributes,{'tableName':_0x8ded('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ded('0x9'),'collate':_0x8ded('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 912731d..7e121ee 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 _0xfee1=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0xfee1,0x1c3));var _0x1fee=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xfee1[_0x16d10f];return _0x50c823;};'use strict';var _=require('lodash');var util=require(_0x1fee('0x0'));var moment=require(_0x1fee('0x1'));var BPromise=require('bluebird');var rs=require(_0x1fee('0x2'));var fs=require('fs');var Redis=require(_0x1fee('0x3'));var db=require(_0x1fee('0x4'))['db'];var utils=require(_0x1fee('0x5'));var logger=require(_0x1fee('0x6'))(_0x1fee('0x7'));var config=require(_0x1fee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1fee('0x9')][_0x1fee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ee2dd,_0x66a3a2,_0x67bbb7){return new BPromise(function(_0x4cd843,_0x13c424){return client[_0x1fee('0xb')](_0x2ee2dd,_0x67bbb7)[_0x1fee('0xc')](function(_0x4465aa){logger[_0x1fee('0xd')]('ChatApplication,\x20%s,\x20%s',_0x66a3a2,'request\x20sent');logger[_0x1fee('0xe')](_0x1fee('0xf'),_0x66a3a2,_0x1fee('0x10'),JSON[_0x1fee('0x11')](_0x4465aa));if(_0x4465aa['error']){if(_0x4465aa[_0x1fee('0x12')][_0x1fee('0x13')]===0x1f4){logger[_0x1fee('0x12')](_0x1fee('0x14'),_0x66a3a2,_0x4465aa['error'][_0x1fee('0x15')]);return _0x13c424(_0x4465aa[_0x1fee('0x12')][_0x1fee('0x15')]);}logger[_0x1fee('0x12')](_0x1fee('0x14'),_0x66a3a2,_0x4465aa[_0x1fee('0x12')][_0x1fee('0x15')]);return _0x4cd843(_0x4465aa[_0x1fee('0x12')][_0x1fee('0x15')]);}else{logger['info'](_0x1fee('0x14'),_0x66a3a2,_0x1fee('0x10'));_0x4cd843(_0x4465aa[_0x1fee('0x16')]['message']);}})[_0x1fee('0x17')](function(_0x2fe087){logger[_0x1fee('0x12')](_0x1fee('0x14'),_0x66a3a2,_0x2fe087);_0x13c424(_0x2fe087);});});} \ No newline at end of file +var _0x2a02=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x3357e1,_0x270952){var _0x200fe5=function(_0xf9e639){while(--_0xf9e639){_0x3357e1['push'](_0x3357e1['shift']());}};_0x200fe5(++_0x270952);}(_0x2a02,0x1d0));var _0x22a0=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0x2a02[_0x37d3f3];return _0x185c9c;};'use strict';var _=require(_0x22a0('0x0'));var util=require('util');var moment=require(_0x22a0('0x1'));var BPromise=require(_0x22a0('0x2'));var rs=require(_0x22a0('0x3'));var fs=require('fs');var Redis=require(_0x22a0('0x4'));var db=require(_0x22a0('0x5'))['db'];var utils=require(_0x22a0('0x6'));var logger=require(_0x22a0('0x7'))('rpc');var config=require(_0x22a0('0x8'));var jayson=require(_0x22a0('0x9'));var client=jayson['client'][_0x22a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcbb92d,_0x39fa7a,_0x328a8f){return new BPromise(function(_0x1c4501,_0x38e282){return client[_0x22a0('0xb')](_0xcbb92d,_0x328a8f)[_0x22a0('0xc')](function(_0x58db2d){logger[_0x22a0('0xd')](_0x22a0('0xe'),_0x39fa7a,'request\x20sent');logger[_0x22a0('0xf')](_0x22a0('0x10'),_0x39fa7a,_0x22a0('0x11'),JSON['stringify'](_0x58db2d));if(_0x58db2d[_0x22a0('0x12')]){if(_0x58db2d[_0x22a0('0x12')]['code']===0x1f4){logger['error'](_0x22a0('0xe'),_0x39fa7a,_0x58db2d[_0x22a0('0x12')][_0x22a0('0x13')]);return _0x38e282(_0x58db2d[_0x22a0('0x12')]['message']);}logger[_0x22a0('0x12')](_0x22a0('0xe'),_0x39fa7a,_0x58db2d[_0x22a0('0x12')][_0x22a0('0x13')]);return _0x1c4501(_0x58db2d[_0x22a0('0x12')][_0x22a0('0x13')]);}else{logger[_0x22a0('0xd')](_0x22a0('0xe'),_0x39fa7a,_0x22a0('0x11'));_0x1c4501(_0x58db2d[_0x22a0('0x14')][_0x22a0('0x13')]);}})[_0x22a0('0x15')](function(_0x1995ac){logger[_0x22a0('0x12')](_0x22a0('0xe'),_0x39fa7a,_0x1995ac);_0x38e282(_0x1995ac);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 43330e1..85cb179 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 _0x9b12=['update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','/:id','isAuthenticated','show','put'];(function(_0x89ee68,_0x18ca4d){var _0x1dfd3b=function(_0x2f8d31){while(--_0x2f8d31){_0x89ee68['push'](_0x89ee68['shift']());}};_0x1dfd3b(++_0x18ca4d);}(_0x9b12,0x155));var _0x29b1=function(_0x10c24b,_0xc63503){_0x10c24b=_0x10c24b-0x0;var _0x491610=_0x9b12[_0x10c24b];return _0x491610;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x29b1('0x0'));var express=require(_0x29b1('0x1'));var router=express[_0x29b1('0x2')]();var fs_extra=require(_0x29b1('0x3'));var auth=require(_0x29b1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x29b1('0x5'));var controller=require('./chatApplication.controller');router['get'](_0x29b1('0x6'),auth[_0x29b1('0x7')](),controller[_0x29b1('0x8')]);router[_0x29b1('0x9')](_0x29b1('0x6'),auth[_0x29b1('0x7')](),controller[_0x29b1('0xa')]);router[_0x29b1('0xb')](_0x29b1('0x6'),auth['isAuthenticated'](),controller[_0x29b1('0xc')]);module['exports']=router; \ No newline at end of file +var _0xda60=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','exports','Router','fs-extra'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xda60,0xc2));var _0x0da6=function(_0x214450,_0x1f80ad){_0x214450=_0x214450-0x0;var _0xf0321f=_0xda60[_0x214450];return _0xf0321f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0da6('0x0')]();var fs_extra=require(_0x0da6('0x1'));var auth=require(_0x0da6('0x2'));var interaction=require(_0x0da6('0x3'));var config=require(_0x0da6('0x4'));var controller=require(_0x0da6('0x5'));router[_0x0da6('0x6')]('/:id',auth[_0x0da6('0x7')](),controller[_0x0da6('0x8')]);router[_0x0da6('0x9')](_0x0da6('0xa'),auth[_0x0da6('0x7')](),controller[_0x0da6('0xb')]);router[_0x0da6('0xc')](_0x0da6('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x0da6('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index ebd8138..ca36f82 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 _0xba55=['STRING','sequelize','exports'];(function(_0x23f7ed,_0x2d3f56){var _0x54e09b=function(_0x158ff9){while(--_0x158ff9){_0x23f7ed['push'](_0x23f7ed['shift']());}};_0x54e09b(++_0x2d3f56);}(_0xba55,0x1f3));var _0x5ba5=function(_0x5c1c58,_0x213cd4){_0x5c1c58=_0x5c1c58-0x0;var _0x25cf5e=_0xba55[_0x5c1c58];return _0x25cf5e;};'use strict';var Sequelize=require(_0x5ba5('0x0'));module[_0x5ba5('0x1')]={'name':{'type':Sequelize[_0x5ba5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5ba5('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x0755=['sequelize','exports','STRING','BOOLEAN'];(function(_0x444a22,_0xbd20cf){var _0x26dffa=function(_0x5ba8f2){while(--_0x5ba8f2){_0x444a22['push'](_0x444a22['shift']());}};_0x26dffa(++_0xbd20cf);}(_0x0755,0x7c));var _0x5075=function(_0x31d03c,_0x158cef){_0x31d03c=_0x31d03c-0x0;var _0x420e61=_0x0755[_0x31d03c];return _0x420e61;};'use strict';var Sequelize=require(_0x5075('0x0'));module[_0x5075('0x1')]={'name':{'type':Sequelize[_0x5075('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5075('0x2')]},'write':{'type':Sequelize[_0x5075('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 88bb181..749fc9f 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 _0xc24b=['filter','merge','VIRTUAL','include','ChatGroup','findAll','catch','show','params','keys','fields','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','order','sort','removeMembers','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','where','pick'];(function(_0x25fe5,_0x2b26dc){var _0x3b299f=function(_0x399b12){while(--_0x399b12){_0x25fe5['push'](_0x25fe5['shift']());}};_0x3b299f(++_0x2b26dc);}(_0xc24b,0xe0));var _0xbc24=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0xc24b[_0x2ef8f1];return _0x17498d;};'use strict';var emlformat=require(_0xbc24('0x0'));var rimraf=require(_0xbc24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc24('0x2'));var rp=require(_0xbc24('0x3'));var moment=require(_0xbc24('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbc24('0x5'));var util=require(_0xbc24('0x6'));var path=require(_0xbc24('0x7'));var sox=require(_0xbc24('0x8'));var csv=require(_0xbc24('0x9'));var ejs=require(_0xbc24('0xa'));var fs=require('fs');var fs_extra=require(_0xbc24('0xb'));var _=require(_0xbc24('0xc'));var squel=require(_0xbc24('0xd'));var crypto=require(_0xbc24('0xe'));var jsforce=require(_0xbc24('0xf'));var deskjs=require(_0xbc24('0x10'));var toCsv=require(_0xbc24('0x9'));var querystring=require(_0xbc24('0x11'));var Papa=require(_0xbc24('0x12'));var Redis=require(_0xbc24('0x13'));var authService=require(_0xbc24('0x14'));var qs=require(_0xbc24('0x15'));var as=require(_0xbc24('0x16'));var hardwareService=require(_0xbc24('0x17'));var logger=require('../../config/logger')(_0xbc24('0x18'));var utils=require(_0xbc24('0x19'));var config=require(_0xbc24('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc24('0x1b'))['db'];config['redis']=_[_0xbc24('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xbc24('0x1d')](socket);function respondWithStatusCode(_0x873777,_0x4e2201){_0x4e2201=_0x4e2201||0xcc;return function(_0x26d897){if(_0x26d897){return _0x873777['sendStatus'](_0x4e2201);}return _0x873777[_0xbc24('0x1e')](_0x4e2201)[_0xbc24('0x1f')]();};}function respondWithResult(_0x1beee6,_0x1b71e8){_0x1b71e8=_0x1b71e8||0xc8;return function(_0x2069fd){if(_0x2069fd){return _0x1beee6[_0xbc24('0x1e')](_0x1b71e8)[_0xbc24('0x20')](_0x2069fd);}};}function respondWithFilteredResult(_0x3b4365,_0x3ab1e9){return function(_0x4bca56){if(_0x4bca56){var _0x44bafd=typeof _0x3ab1e9[_0xbc24('0x21')]===_0xbc24('0x22')&&typeof _0x3ab1e9[_0xbc24('0x23')]==='undefined';var _0x20e735=_0x4bca56[_0xbc24('0x24')];var _0x473ba7=_0x44bafd?0x0:_0x3ab1e9['offset'];var _0x399542=_0x44bafd?_0x4bca56[_0xbc24('0x24')]:_0x3ab1e9[_0xbc24('0x21')]+_0x3ab1e9[_0xbc24('0x23')];var _0x5a042b;if(_0x399542>=_0x20e735){_0x399542=_0x20e735;_0x5a042b=0xc8;}else{_0x5a042b=0xce;}_0x3b4365[_0xbc24('0x1e')](_0x5a042b);return _0x3b4365[_0xbc24('0x25')](_0xbc24('0x26'),_0x473ba7+'-'+_0x399542+'/'+_0x20e735)['json'](_0x4bca56);}return null;};}function patchUpdates(_0x50bfce){return function(_0x330811){try{jsonpatch[_0xbc24('0x27')](_0x330811,_0x50bfce,!![]);}catch(_0x28382c){return BPromise[_0xbc24('0x28')](_0x28382c);}return _0x330811['save']();};}function saveUpdates(_0x4d78e8,_0x1d3977){return function(_0xb20938){if(_0xb20938){return _0xb20938[_0xbc24('0x29')](_0x4d78e8)[_0xbc24('0x2a')](function(_0x583aa2){return _0x583aa2;});}return null;};}function removeEntity(_0x20f4ac,_0x39ad2c){return function(_0x2a6428){if(_0x2a6428){return _0x2a6428[_0xbc24('0x2b')]()['then'](function(){_0x20f4ac[_0xbc24('0x1e')](0xcc)[_0xbc24('0x1f')]();});}};}function handleEntityNotFound(_0x1d1e12,_0x2ee972){return function(_0x50a499){if(!_0x50a499){_0x1d1e12[_0xbc24('0x2c')](0x194);}return _0x50a499;};}function handleError(_0x27941d,_0xde0c63){_0xde0c63=_0xde0c63||0x1f4;return function(_0x2da41c){logger['error'](_0x2da41c[_0xbc24('0x2d')]);if(_0x2da41c[_0xbc24('0x2e')]){delete _0x2da41c[_0xbc24('0x2e')];}_0x27941d[_0xbc24('0x1e')](_0xde0c63)[_0xbc24('0x2f')](_0x2da41c);};}exports['index']=function(_0x4de004,_0x5f5e5f){var _0x243838={},_0x4d3a4c={},_0x5bed34={'count':0x0,'rows':[]};var _0x562773=_[_0xbc24('0x30')](db['ChatGroup'][_0xbc24('0x31')],function(_0x2ff5cc){return{'name':_0x2ff5cc['fieldName'],'type':_0x2ff5cc[_0xbc24('0x32')]['key']};});_0x4d3a4c[_0xbc24('0x33')]=_[_0xbc24('0x30')](_0x562773,_0xbc24('0x2e'));_0x4d3a4c[_0xbc24('0x34')]=_['keys'](_0x4de004[_0xbc24('0x34')]);_0x4d3a4c[_0xbc24('0x35')]=_[_0xbc24('0x36')](_0x4d3a4c[_0xbc24('0x33')],_0x4d3a4c['query']);_0x243838[_0xbc24('0x37')]=_[_0xbc24('0x36')](_0x4d3a4c[_0xbc24('0x33')],qs['fields'](_0x4de004[_0xbc24('0x34')]['fields']));_0x243838['attributes']=_0x243838['attributes'][_0xbc24('0x38')]?_0x243838['attributes']:_0x4d3a4c[_0xbc24('0x33')];if(!_0x4de004[_0xbc24('0x34')][_0xbc24('0x39')](_0xbc24('0x3a'))){_0x243838[_0xbc24('0x23')]=qs[_0xbc24('0x23')](_0x4de004[_0xbc24('0x34')][_0xbc24('0x23')]);_0x243838[_0xbc24('0x21')]=qs[_0xbc24('0x21')](_0x4de004[_0xbc24('0x34')][_0xbc24('0x21')]);}_0x243838['order']=qs['sort'](_0x4de004[_0xbc24('0x34')]['sort']);_0x243838[_0xbc24('0x3b')]=qs['filters'](_[_0xbc24('0x3c')](_0x4de004[_0xbc24('0x34')],_0x4d3a4c[_0xbc24('0x35')]),_0x562773);if(_0x4de004['query'][_0xbc24('0x3d')]){_0x243838[_0xbc24('0x3b')]=_[_0xbc24('0x3e')](_0x243838[_0xbc24('0x3b')],{'$or':_[_0xbc24('0x30')](_0x562773,function(_0x775b25){if(_0x775b25[_0xbc24('0x32')]!==_0xbc24('0x3f')){var _0x3962f1={};_0x3962f1[_0x775b25[_0xbc24('0x2e')]]={'$like':'%'+_0x4de004[_0xbc24('0x34')][_0xbc24('0x3d')]+'%'};return _0x3962f1;}})});}_0x243838=_[_0xbc24('0x3e')]({},_0x243838,_0x4de004['options']);var _0x56f22e={'where':_0x243838[_0xbc24('0x3b')]};return db['ChatGroup']['count'](_0x56f22e)[_0xbc24('0x2a')](function(_0x3ac787){_0x5bed34[_0xbc24('0x24')]=_0x3ac787;if(_0x4de004[_0xbc24('0x34')]['includeAll']){_0x243838[_0xbc24('0x40')]=[{'all':!![]}];}return db[_0xbc24('0x41')][_0xbc24('0x42')](_0x243838);})[_0xbc24('0x2a')](function(_0x1acbef){_0x5bed34['rows']=_0x1acbef;return _0x5bed34;})[_0xbc24('0x2a')](respondWithFilteredResult(_0x5f5e5f,_0x243838))[_0xbc24('0x43')](handleError(_0x5f5e5f,null));};exports[_0xbc24('0x44')]=function(_0x3cf0b7,_0x1425c){var _0x4087c3={'raw':!![],'where':{'id':_0x3cf0b7[_0xbc24('0x45')]['id']}},_0x3184ae={};_0x3184ae[_0xbc24('0x33')]=_['keys'](db[_0xbc24('0x41')][_0xbc24('0x31')]);_0x3184ae[_0xbc24('0x34')]=_[_0xbc24('0x46')](_0x3cf0b7[_0xbc24('0x34')]);_0x3184ae[_0xbc24('0x35')]=_[_0xbc24('0x36')](_0x3184ae[_0xbc24('0x33')],_0x3184ae[_0xbc24('0x34')]);_0x4087c3[_0xbc24('0x37')]=_[_0xbc24('0x36')](_0x3184ae['model'],qs[_0xbc24('0x47')](_0x3cf0b7[_0xbc24('0x34')][_0xbc24('0x47')]));_0x4087c3[_0xbc24('0x37')]=_0x4087c3['attributes'][_0xbc24('0x38')]?_0x4087c3[_0xbc24('0x37')]:_0x3184ae[_0xbc24('0x33')];if(_0x3cf0b7[_0xbc24('0x34')]['includeAll']){_0x4087c3['include']=[{'all':!![]}];}_0x4087c3=_[_0xbc24('0x3e')]({},_0x4087c3,_0x3cf0b7[_0xbc24('0x48')]);return db[_0xbc24('0x41')][_0xbc24('0x49')](_0x4087c3)[_0xbc24('0x2a')](handleEntityNotFound(_0x1425c,null))[_0xbc24('0x2a')](respondWithResult(_0x1425c,null))['catch'](handleError(_0x1425c,null));};exports[_0xbc24('0x4a')]=function(_0x5a246a,_0x347988){return db[_0xbc24('0x41')][_0xbc24('0x4a')](_0x5a246a[_0xbc24('0x4b')],{})[_0xbc24('0x2a')](respondWithResult(_0x347988,0xc9))['catch'](handleError(_0x347988,null));};exports[_0xbc24('0x29')]=function(_0x464735,_0x3ef9a7){if(_0x464735[_0xbc24('0x4b')]['id']){delete _0x464735[_0xbc24('0x4b')]['id'];}return db[_0xbc24('0x41')][_0xbc24('0x49')]({'where':{'id':_0x464735['params']['id']}})['then'](handleEntityNotFound(_0x3ef9a7,null))['then'](saveUpdates(_0x464735[_0xbc24('0x4b')],null))[_0xbc24('0x2a')](respondWithResult(_0x3ef9a7,null))[_0xbc24('0x43')](handleError(_0x3ef9a7,null));};exports[_0xbc24('0x2b')]=function(_0x256fdd,_0x16074f){return db[_0xbc24('0x41')][_0xbc24('0x49')]({'where':{'id':_0x256fdd['params']['id']}})[_0xbc24('0x2a')](handleEntityNotFound(_0x16074f,null))[_0xbc24('0x2a')](removeEntity(_0x16074f,null))[_0xbc24('0x43')](handleError(_0x16074f,null));};exports['describe']=function(_0x278745,_0x3c485a){return db['ChatGroup'][_0xbc24('0x4c')]()[_0xbc24('0x2a')](respondWithResult(_0x3c485a,null))[_0xbc24('0x43')](handleError(_0x3c485a,null));};exports[_0xbc24('0x4d')]=function(_0x4b23cd,_0x39c86f,_0x1f1f77){return db[_0xbc24('0x4e')]['count']({'where':{'ChatGroupId':_0x4b23cd[_0xbc24('0x45')]['id'],'ToId':_0x4b23cd[_0xbc24('0x4f')]['id'],'read':![]}})[_0xbc24('0x2a')](function(_0x41a262){return{'id':_[_0xbc24('0x50')](_0x4b23cd[_0xbc24('0x45')]['id']),'count':_0x41a262};})[_0xbc24('0x2a')](respondWithResult(_0x39c86f,null))[_0xbc24('0x43')](handleError(_0x39c86f,null));};exports[_0xbc24('0x51')]=function(_0x5c08ef,_0x470893,_0x1dcef2){return db[_0xbc24('0x41')][_0xbc24('0x49')]({'where':{'id':_0x5c08ef['params']['id']}})['then'](handleEntityNotFound(_0x470893,null))[_0xbc24('0x2a')](function(_0x46a017){if(_0x46a017){return _0x46a017['addMembers'](_0x5c08ef['body'][_0xbc24('0x52')],_[_0xbc24('0x53')](_0x5c08ef[_0xbc24('0x4b')],[_0xbc24('0x52'),'id'])||{});}})[_0xbc24('0x2a')](respondWithResult(_0x470893,null))[_0xbc24('0x43')](handleError(_0x470893,null));};exports[_0xbc24('0x54')]=function(_0x1b7f3a,_0x2d8bb1,_0x2a6b9b){var _0x1f5cdb={};var _0x9c60ec={};var _0x3e8a8a;var _0x53f057;return db[_0xbc24('0x41')]['findOne']({'where':{'id':_0x1b7f3a[_0xbc24('0x45')]['id']}})[_0xbc24('0x2a')](handleEntityNotFound(_0x2d8bb1,null))[_0xbc24('0x2a')](function(_0xce75fc){if(_0xce75fc){_0x3e8a8a=_0xce75fc;_0x9c60ec[_0xbc24('0x33')]=_['keys'](db[_0xbc24('0x55')][_0xbc24('0x31')]);_0x9c60ec[_0xbc24('0x34')]=_[_0xbc24('0x46')](_0x1b7f3a[_0xbc24('0x34')]);_0x9c60ec['filters']=_['intersection'](_0x9c60ec[_0xbc24('0x33')],_0x9c60ec[_0xbc24('0x34')]);_0x1f5cdb[_0xbc24('0x37')]=_[_0xbc24('0x36')](_0x9c60ec[_0xbc24('0x33')],qs[_0xbc24('0x47')](_0x1b7f3a[_0xbc24('0x34')][_0xbc24('0x47')]));_0x1f5cdb[_0xbc24('0x37')]=_0x1f5cdb[_0xbc24('0x37')][_0xbc24('0x38')]?_0x1f5cdb['attributes']:_0x9c60ec[_0xbc24('0x33')];_0x1f5cdb[_0xbc24('0x56')]=qs[_0xbc24('0x57')](_0x1b7f3a[_0xbc24('0x34')][_0xbc24('0x57')]);_0x1f5cdb[_0xbc24('0x3b')]=qs[_0xbc24('0x35')](_[_0xbc24('0x3c')](_0x1b7f3a[_0xbc24('0x34')],_0x9c60ec[_0xbc24('0x35')]));if(_0x1b7f3a['query'][_0xbc24('0x3d')]){_0x1f5cdb[_0xbc24('0x3b')]=_['merge'](_0x1f5cdb[_0xbc24('0x3b')],{'$or':_[_0xbc24('0x30')](_0x1f5cdb['attributes'],function(_0x79fb81){var _0x28e567={};_0x28e567[_0x79fb81]={'$like':'%'+_0x1b7f3a['query']['filter']+'%'};return _0x28e567;})});}_0x1f5cdb=_[_0xbc24('0x3e')]({},_0x1f5cdb,_0x1b7f3a[_0xbc24('0x48')]);return _0x3e8a8a[_0xbc24('0x54')](_0x1f5cdb);}})[_0xbc24('0x2a')](function(_0x2fd68e){if(_0x2fd68e){_0x53f057=_0x2fd68e['length'];if(!_0x1b7f3a[_0xbc24('0x34')][_0xbc24('0x39')](_0xbc24('0x3a'))){_0x1f5cdb[_0xbc24('0x23')]=qs['limit'](_0x1b7f3a[_0xbc24('0x34')][_0xbc24('0x23')]);_0x1f5cdb['offset']=qs[_0xbc24('0x21')](_0x1b7f3a[_0xbc24('0x34')][_0xbc24('0x21')]);}return _0x3e8a8a['getMembers'](_0x1f5cdb);}})[_0xbc24('0x2a')](function(_0x1be9d6){if(_0x1be9d6){return _0x1be9d6?{'count':_0x53f057,'rows':_0x1be9d6}:null;}})['then'](respondWithResult(_0x2d8bb1,null))[_0xbc24('0x43')](handleError(_0x2d8bb1,null));};exports[_0xbc24('0x58')]=function(_0x5280c4,_0x5e60b0,_0x5504c9){return db[_0xbc24('0x41')][_0xbc24('0x49')]({'where':{'id':_0x5280c4[_0xbc24('0x45')]['id']}})[_0xbc24('0x2a')](handleEntityNotFound(_0x5e60b0,null))[_0xbc24('0x2a')](function(_0x342076){if(_0x342076){return _0x342076[_0xbc24('0x58')](_0x5280c4[_0xbc24('0x34')]['ids']);}})[_0xbc24('0x2a')](respondWithStatusCode(_0x5e60b0,null))['catch'](handleError(_0x5e60b0,null));};exports['addMessage']=function(_0xccadea,_0x539b49,_0x3893a6){if(_0xccadea[_0xbc24('0x4b')]['id']){delete _0xccadea[_0xbc24('0x4b')]['id'];}return db[_0xbc24('0x41')]['find']({'where':{'id':_0xccadea[_0xbc24('0x45')]['id']}})[_0xbc24('0x2a')](handleEntityNotFound(_0x539b49,null))[_0xbc24('0x2a')](function(_0x26038e){if(_0x26038e){_0xccadea[_0xbc24('0x4b')][_0xbc24('0x59')]=_0x26038e['id'];return db[_0xbc24('0x4e')][_0xbc24('0x4a')](_0xccadea['body']);}})['then'](respondWithResult(_0x539b49,null))[_0xbc24('0x43')](handleError(_0x539b49,null));};exports[_0xbc24('0x5a')]=function(_0x14b66f,_0x25c41b,_0x44a62c){var _0x3e61b3={};var _0x4abeed={};var _0x2c9b33;var _0x4498d5;return db['ChatGroup'][_0xbc24('0x5b')]({'where':{'id':_0x14b66f['params']['id']}})[_0xbc24('0x2a')](handleEntityNotFound(_0x25c41b,null))['then'](function(_0x52ff6b){if(_0x52ff6b){_0x2c9b33=_0x52ff6b;_0x4abeed['model']=_[_0xbc24('0x46')](db['ChatInternalMessage'][_0xbc24('0x31')]);_0x4abeed[_0xbc24('0x34')]=_[_0xbc24('0x46')](_0x14b66f[_0xbc24('0x34')]);_0x4abeed[_0xbc24('0x35')]=_[_0xbc24('0x36')](_0x4abeed['model'],_0x4abeed[_0xbc24('0x34')]);_0x3e61b3['attributes']=_[_0xbc24('0x36')](_0x4abeed[_0xbc24('0x33')],qs['fields'](_0x14b66f[_0xbc24('0x34')]['fields']));_0x3e61b3['attributes']=_0x3e61b3[_0xbc24('0x37')][_0xbc24('0x38')]?_0x3e61b3[_0xbc24('0x37')]:_0x4abeed[_0xbc24('0x33')];_0x3e61b3[_0xbc24('0x56')]=qs[_0xbc24('0x57')](_0x14b66f[_0xbc24('0x34')]['sort']);_0x3e61b3[_0xbc24('0x3b')]=qs[_0xbc24('0x35')](_[_0xbc24('0x3c')](_0x14b66f[_0xbc24('0x34')],_0x4abeed[_0xbc24('0x35')]));if(_0x14b66f[_0xbc24('0x34')][_0xbc24('0x3d')]){_0x3e61b3[_0xbc24('0x3b')]=_[_0xbc24('0x3e')](_0x3e61b3[_0xbc24('0x3b')],{'$or':_[_0xbc24('0x30')](_0x3e61b3['attributes'],function(_0x40829e){var _0x2a3170={};_0x2a3170[_0x40829e]={'$like':'%'+_0x14b66f['query'][_0xbc24('0x3d')]+'%'};return _0x2a3170;})});}if(_0x14b66f[_0xbc24('0x34')][_0xbc24('0x5c')]){var _0x4d4878=_0x14b66f[_0xbc24('0x34')][_0xbc24('0x5c')]['split'](',');var _0x5b241c={};_0x5b241c[_0x4d4878[0x0]]={'$gte':moment(_0x4d4878[0x1])[_0xbc24('0x5d')](_0xbc24('0x5e'))};_0x3e61b3[_0xbc24('0x3b')]=_[_0xbc24('0x3e')](_0x3e61b3['where'],_0x5b241c);}_0x3e61b3=_['merge']({},_0x3e61b3,_0x14b66f[_0xbc24('0x48')]);return _0x2c9b33[_0xbc24('0x5a')](_0x3e61b3);}})[_0xbc24('0x2a')](function(_0x2c98c2){if(_0x2c98c2){_0x4498d5=_0x2c98c2['length'];if(!_0x14b66f[_0xbc24('0x34')]['hasOwnProperty'](_0xbc24('0x3a'))){_0x3e61b3['limit']=qs[_0xbc24('0x23')](_0x14b66f[_0xbc24('0x34')][_0xbc24('0x23')]);_0x3e61b3[_0xbc24('0x21')]=qs[_0xbc24('0x21')](_0x14b66f[_0xbc24('0x34')]['offset']);}return _0x2c9b33[_0xbc24('0x5a')](_0x3e61b3);}})['then'](function(_0x376ac3){if(_0x376ac3){return _0x376ac3?{'count':_0x4498d5,'rows':_0x376ac3}:null;}})[_0xbc24('0x2a')](respondWithResult(_0x25c41b,null))['catch'](handleError(_0x25c41b,null));}; \ No newline at end of file +var _0x10d6=['rows','catch','show','params','options','find','create','body','update','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','findOne','User','getMembers','removeMembers','ids','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','limit','offset','set','Content-Range','reject','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','count','includeAll','include','findAll'];(function(_0x553c6f,_0xdaf6e5){var _0x15bb77=function(_0x2439d9){while(--_0x2439d9){_0x553c6f['push'](_0x553c6f['shift']());}};_0x15bb77(++_0xdaf6e5);}(_0x10d6,0x1ad));var _0x610d=function(_0x462017,_0x59d18b){_0x462017=_0x462017-0x0;var _0x195959=_0x10d6[_0x462017];return _0x195959;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x610d('0x0'));var zipdir=require(_0x610d('0x1'));var jsonpatch=require(_0x610d('0x2'));var rp=require(_0x610d('0x3'));var moment=require(_0x610d('0x4'));var BPromise=require(_0x610d('0x5'));var Mustache=require(_0x610d('0x6'));var util=require(_0x610d('0x7'));var path=require('path');var sox=require(_0x610d('0x8'));var csv=require(_0x610d('0x9'));var ejs=require(_0x610d('0xa'));var fs=require('fs');var fs_extra=require(_0x610d('0xb'));var _=require(_0x610d('0xc'));var squel=require(_0x610d('0xd'));var crypto=require(_0x610d('0xe'));var jsforce=require(_0x610d('0xf'));var deskjs=require(_0x610d('0x10'));var toCsv=require(_0x610d('0x9'));var querystring=require(_0x610d('0x11'));var Papa=require(_0x610d('0x12'));var Redis=require(_0x610d('0x13'));var authService=require(_0x610d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x610d('0x15'));var hardwareService=require(_0x610d('0x16'));var logger=require(_0x610d('0x17'))(_0x610d('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x610d('0x19'))['db'];config['redis']=_[_0x610d('0x1a')](config['redis'],{'host':_0x610d('0x1b'),'port':0x18eb});var socket=require(_0x610d('0x1c'))(new Redis(config['redis']));require(_0x610d('0x1d'))['register'](socket);function respondWithStatusCode(_0x2a912a,_0x41b3eb){_0x41b3eb=_0x41b3eb||0xcc;return function(_0x50f986){if(_0x50f986){return _0x2a912a[_0x610d('0x1e')](_0x41b3eb);}return _0x2a912a[_0x610d('0x1f')](_0x41b3eb)[_0x610d('0x20')]();};}function respondWithResult(_0x37b695,_0x8b6a7b){_0x8b6a7b=_0x8b6a7b||0xc8;return function(_0x4062b7){if(_0x4062b7){return _0x37b695[_0x610d('0x1f')](_0x8b6a7b)[_0x610d('0x21')](_0x4062b7);}};}function respondWithFilteredResult(_0x51d485,_0x56409b){return function(_0x110e24){if(_0x110e24){var _0x317f04=typeof _0x56409b['offset']==='undefined'&&typeof _0x56409b[_0x610d('0x22')]==='undefined';var _0xa2913b=_0x110e24['count'];var _0x4c5abb=_0x317f04?0x0:_0x56409b[_0x610d('0x23')];var _0x328cca=_0x317f04?_0x110e24['count']:_0x56409b[_0x610d('0x23')]+_0x56409b['limit'];var _0x126cdc;if(_0x328cca>=_0xa2913b){_0x328cca=_0xa2913b;_0x126cdc=0xc8;}else{_0x126cdc=0xce;}_0x51d485[_0x610d('0x1f')](_0x126cdc);return _0x51d485[_0x610d('0x24')](_0x610d('0x25'),_0x4c5abb+'-'+_0x328cca+'/'+_0xa2913b)[_0x610d('0x21')](_0x110e24);}return null;};}function patchUpdates(_0x40d7ed){return function(_0x3561f7){try{jsonpatch['apply'](_0x3561f7,_0x40d7ed,!![]);}catch(_0x3ad3db){return BPromise[_0x610d('0x26')](_0x3ad3db);}return _0x3561f7['save']();};}function saveUpdates(_0x36c7de,_0x4c8aa1){return function(_0x30a872){if(_0x30a872){return _0x30a872['update'](_0x36c7de)['then'](function(_0x30268d){return _0x30268d;});}return null;};}function removeEntity(_0x2762eb,_0x5768e4){return function(_0x38d75c){if(_0x38d75c){return _0x38d75c['destroy']()[_0x610d('0x27')](function(){_0x2762eb[_0x610d('0x1f')](0xcc)[_0x610d('0x20')]();});}};}function handleEntityNotFound(_0x42deea,_0x30e894){return function(_0x258b4f){if(!_0x258b4f){_0x42deea[_0x610d('0x1e')](0x194);}return _0x258b4f;};}function handleError(_0x25cd90,_0x2e6bc9){_0x2e6bc9=_0x2e6bc9||0x1f4;return function(_0x3858cd){logger[_0x610d('0x28')](_0x3858cd[_0x610d('0x29')]);if(_0x3858cd[_0x610d('0x2a')]){delete _0x3858cd[_0x610d('0x2a')];}_0x25cd90[_0x610d('0x1f')](_0x2e6bc9)[_0x610d('0x2b')](_0x3858cd);};}exports[_0x610d('0x2c')]=function(_0x9507a4,_0x546599){var _0x7d51e3={},_0xd15365={},_0x4f4c3c={'count':0x0,'rows':[]};var _0x49ff57=_[_0x610d('0x2d')](db[_0x610d('0x2e')][_0x610d('0x2f')],function(_0x5383ab){return{'name':_0x5383ab[_0x610d('0x30')],'type':_0x5383ab['type'][_0x610d('0x31')]};});_0xd15365[_0x610d('0x32')]=_[_0x610d('0x2d')](_0x49ff57,_0x610d('0x2a'));_0xd15365[_0x610d('0x33')]=_[_0x610d('0x34')](_0x9507a4['query']);_0xd15365['filters']=_['intersection'](_0xd15365['model'],_0xd15365['query']);_0x7d51e3[_0x610d('0x35')]=_[_0x610d('0x36')](_0xd15365['model'],qs[_0x610d('0x37')](_0x9507a4[_0x610d('0x33')][_0x610d('0x37')]));_0x7d51e3[_0x610d('0x35')]=_0x7d51e3[_0x610d('0x35')][_0x610d('0x38')]?_0x7d51e3['attributes']:_0xd15365['model'];if(!_0x9507a4[_0x610d('0x33')]['hasOwnProperty'](_0x610d('0x39'))){_0x7d51e3['limit']=qs[_0x610d('0x22')](_0x9507a4[_0x610d('0x33')][_0x610d('0x22')]);_0x7d51e3['offset']=qs[_0x610d('0x23')](_0x9507a4[_0x610d('0x33')][_0x610d('0x23')]);}_0x7d51e3[_0x610d('0x3a')]=qs[_0x610d('0x3b')](_0x9507a4[_0x610d('0x33')][_0x610d('0x3b')]);_0x7d51e3[_0x610d('0x3c')]=qs[_0x610d('0x3d')](_[_0x610d('0x3e')](_0x9507a4[_0x610d('0x33')],_0xd15365[_0x610d('0x3d')]),_0x49ff57);if(_0x9507a4[_0x610d('0x33')][_0x610d('0x3f')]){_0x7d51e3[_0x610d('0x3c')]=_['merge'](_0x7d51e3['where'],{'$or':_[_0x610d('0x2d')](_0x49ff57,function(_0x16dfd2){if(_0x16dfd2[_0x610d('0x40')]!==_0x610d('0x41')){var _0xcaafe2={};_0xcaafe2[_0x16dfd2['name']]={'$like':'%'+_0x9507a4['query']['filter']+'%'};return _0xcaafe2;}})});}_0x7d51e3=_[_0x610d('0x42')]({},_0x7d51e3,_0x9507a4['options']);var _0xd9b20={'where':_0x7d51e3[_0x610d('0x3c')]};return db[_0x610d('0x2e')][_0x610d('0x43')](_0xd9b20)[_0x610d('0x27')](function(_0x12694f){_0x4f4c3c[_0x610d('0x43')]=_0x12694f;if(_0x9507a4[_0x610d('0x33')][_0x610d('0x44')]){_0x7d51e3[_0x610d('0x45')]=[{'all':!![]}];}return db[_0x610d('0x2e')][_0x610d('0x46')](_0x7d51e3);})[_0x610d('0x27')](function(_0x335d09){_0x4f4c3c[_0x610d('0x47')]=_0x335d09;return _0x4f4c3c;})[_0x610d('0x27')](respondWithFilteredResult(_0x546599,_0x7d51e3))[_0x610d('0x48')](handleError(_0x546599,null));};exports[_0x610d('0x49')]=function(_0x5ad80b,_0x876aff){var _0x5edb25={'raw':!![],'where':{'id':_0x5ad80b[_0x610d('0x4a')]['id']}},_0x4eb540={};_0x4eb540[_0x610d('0x32')]=_[_0x610d('0x34')](db['ChatGroup'][_0x610d('0x2f')]);_0x4eb540[_0x610d('0x33')]=_['keys'](_0x5ad80b[_0x610d('0x33')]);_0x4eb540[_0x610d('0x3d')]=_[_0x610d('0x36')](_0x4eb540[_0x610d('0x32')],_0x4eb540['query']);_0x5edb25['attributes']=_['intersection'](_0x4eb540[_0x610d('0x32')],qs['fields'](_0x5ad80b[_0x610d('0x33')][_0x610d('0x37')]));_0x5edb25[_0x610d('0x35')]=_0x5edb25[_0x610d('0x35')][_0x610d('0x38')]?_0x5edb25[_0x610d('0x35')]:_0x4eb540[_0x610d('0x32')];if(_0x5ad80b[_0x610d('0x33')][_0x610d('0x44')]){_0x5edb25[_0x610d('0x45')]=[{'all':!![]}];}_0x5edb25=_[_0x610d('0x42')]({},_0x5edb25,_0x5ad80b[_0x610d('0x4b')]);return db['ChatGroup'][_0x610d('0x4c')](_0x5edb25)[_0x610d('0x27')](handleEntityNotFound(_0x876aff,null))[_0x610d('0x27')](respondWithResult(_0x876aff,null))[_0x610d('0x48')](handleError(_0x876aff,null));};exports[_0x610d('0x4d')]=function(_0x2d8da0,_0x32ceda){return db['ChatGroup']['create'](_0x2d8da0[_0x610d('0x4e')],{})['then'](respondWithResult(_0x32ceda,0xc9))[_0x610d('0x48')](handleError(_0x32ceda,null));};exports[_0x610d('0x4f')]=function(_0x38a794,_0x2fb8d9){if(_0x38a794['body']['id']){delete _0x38a794['body']['id'];}return db[_0x610d('0x2e')][_0x610d('0x4c')]({'where':{'id':_0x38a794[_0x610d('0x4a')]['id']}})[_0x610d('0x27')](handleEntityNotFound(_0x2fb8d9,null))[_0x610d('0x27')](saveUpdates(_0x38a794[_0x610d('0x4e')],null))[_0x610d('0x27')](respondWithResult(_0x2fb8d9,null))['catch'](handleError(_0x2fb8d9,null));};exports[_0x610d('0x50')]=function(_0x2f7983,_0x1a5546){return db[_0x610d('0x2e')][_0x610d('0x4c')]({'where':{'id':_0x2f7983[_0x610d('0x4a')]['id']}})[_0x610d('0x27')](handleEntityNotFound(_0x1a5546,null))['then'](removeEntity(_0x1a5546,null))[_0x610d('0x48')](handleError(_0x1a5546,null));};exports[_0x610d('0x51')]=function(_0x254c3d,_0x4d7bb0){return db['ChatGroup']['describe']()[_0x610d('0x27')](respondWithResult(_0x4d7bb0,null))[_0x610d('0x48')](handleError(_0x4d7bb0,null));};exports[_0x610d('0x52')]=function(_0xc8e86c,_0x160b79,_0x502485){return db[_0x610d('0x53')][_0x610d('0x43')]({'where':{'ChatGroupId':_0xc8e86c[_0x610d('0x4a')]['id'],'ToId':_0xc8e86c[_0x610d('0x54')]['id'],'read':![]}})['then'](function(_0x57e42f){return{'id':_[_0x610d('0x55')](_0xc8e86c[_0x610d('0x4a')]['id']),'count':_0x57e42f};})[_0x610d('0x27')](respondWithResult(_0x160b79,null))['catch'](handleError(_0x160b79,null));};exports[_0x610d('0x56')]=function(_0x18867c,_0x3c0b2d,_0x42bc06){return db[_0x610d('0x2e')][_0x610d('0x4c')]({'where':{'id':_0x18867c[_0x610d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c0b2d,null))[_0x610d('0x27')](function(_0x13608f){if(_0x13608f){return _0x13608f[_0x610d('0x56')](_0x18867c[_0x610d('0x4e')]['ids'],_[_0x610d('0x57')](_0x18867c[_0x610d('0x4e')],['ids','id'])||{});}})[_0x610d('0x27')](respondWithResult(_0x3c0b2d,null))[_0x610d('0x48')](handleError(_0x3c0b2d,null));};exports['getMembers']=function(_0x3bb7db,_0x23b705,_0x187835){var _0x3223eb={};var _0x59baf4={};var _0x2be9f9;var _0x3c0447;return db[_0x610d('0x2e')][_0x610d('0x58')]({'where':{'id':_0x3bb7db['params']['id']}})[_0x610d('0x27')](handleEntityNotFound(_0x23b705,null))[_0x610d('0x27')](function(_0x5bd15a){if(_0x5bd15a){_0x2be9f9=_0x5bd15a;_0x59baf4[_0x610d('0x32')]=_['keys'](db[_0x610d('0x59')][_0x610d('0x2f')]);_0x59baf4[_0x610d('0x33')]=_[_0x610d('0x34')](_0x3bb7db[_0x610d('0x33')]);_0x59baf4[_0x610d('0x3d')]=_[_0x610d('0x36')](_0x59baf4['model'],_0x59baf4['query']);_0x3223eb[_0x610d('0x35')]=_[_0x610d('0x36')](_0x59baf4[_0x610d('0x32')],qs[_0x610d('0x37')](_0x3bb7db[_0x610d('0x33')][_0x610d('0x37')]));_0x3223eb[_0x610d('0x35')]=_0x3223eb[_0x610d('0x35')][_0x610d('0x38')]?_0x3223eb['attributes']:_0x59baf4['model'];_0x3223eb[_0x610d('0x3a')]=qs[_0x610d('0x3b')](_0x3bb7db[_0x610d('0x33')][_0x610d('0x3b')]);_0x3223eb[_0x610d('0x3c')]=qs[_0x610d('0x3d')](_[_0x610d('0x3e')](_0x3bb7db[_0x610d('0x33')],_0x59baf4[_0x610d('0x3d')]));if(_0x3bb7db[_0x610d('0x33')]['filter']){_0x3223eb[_0x610d('0x3c')]=_[_0x610d('0x42')](_0x3223eb[_0x610d('0x3c')],{'$or':_[_0x610d('0x2d')](_0x3223eb[_0x610d('0x35')],function(_0x2d5f52){var _0x84be3f={};_0x84be3f[_0x2d5f52]={'$like':'%'+_0x3bb7db[_0x610d('0x33')][_0x610d('0x3f')]+'%'};return _0x84be3f;})});}_0x3223eb=_['merge']({},_0x3223eb,_0x3bb7db[_0x610d('0x4b')]);return _0x2be9f9[_0x610d('0x5a')](_0x3223eb);}})[_0x610d('0x27')](function(_0x223b32){if(_0x223b32){_0x3c0447=_0x223b32[_0x610d('0x38')];if(!_0x3bb7db['query']['hasOwnProperty']('nolimit')){_0x3223eb['limit']=qs[_0x610d('0x22')](_0x3bb7db['query'][_0x610d('0x22')]);_0x3223eb[_0x610d('0x23')]=qs[_0x610d('0x23')](_0x3bb7db[_0x610d('0x33')][_0x610d('0x23')]);}return _0x2be9f9[_0x610d('0x5a')](_0x3223eb);}})['then'](function(_0x5cfe81){if(_0x5cfe81){return _0x5cfe81?{'count':_0x3c0447,'rows':_0x5cfe81}:null;}})[_0x610d('0x27')](respondWithResult(_0x23b705,null))['catch'](handleError(_0x23b705,null));};exports[_0x610d('0x5b')]=function(_0x58ccf9,_0x1c8775,_0x1817ef){return db[_0x610d('0x2e')][_0x610d('0x4c')]({'where':{'id':_0x58ccf9['params']['id']}})['then'](handleEntityNotFound(_0x1c8775,null))[_0x610d('0x27')](function(_0x338642){if(_0x338642){return _0x338642['removeMembers'](_0x58ccf9['query'][_0x610d('0x5c')]);}})[_0x610d('0x27')](respondWithStatusCode(_0x1c8775,null))['catch'](handleError(_0x1c8775,null));};exports[_0x610d('0x5d')]=function(_0x51ebe2,_0x136d04,_0x3ca0c3){if(_0x51ebe2['body']['id']){delete _0x51ebe2[_0x610d('0x4e')]['id'];}return db[_0x610d('0x2e')][_0x610d('0x4c')]({'where':{'id':_0x51ebe2[_0x610d('0x4a')]['id']}})[_0x610d('0x27')](handleEntityNotFound(_0x136d04,null))['then'](function(_0x1f8215){if(_0x1f8215){_0x51ebe2[_0x610d('0x4e')]['ChatGroupId']=_0x1f8215['id'];return db[_0x610d('0x53')][_0x610d('0x4d')](_0x51ebe2[_0x610d('0x4e')]);}})['then'](respondWithResult(_0x136d04,null))[_0x610d('0x48')](handleError(_0x136d04,null));};exports[_0x610d('0x5e')]=function(_0x557e55,_0x4c440e,_0x406955){var _0x47c343={};var _0x4b966e={};var _0x2388f6;var _0x20342b;return db[_0x610d('0x2e')][_0x610d('0x58')]({'where':{'id':_0x557e55[_0x610d('0x4a')]['id']}})[_0x610d('0x27')](handleEntityNotFound(_0x4c440e,null))[_0x610d('0x27')](function(_0x58e705){if(_0x58e705){_0x2388f6=_0x58e705;_0x4b966e[_0x610d('0x32')]=_[_0x610d('0x34')](db[_0x610d('0x53')][_0x610d('0x2f')]);_0x4b966e[_0x610d('0x33')]=_[_0x610d('0x34')](_0x557e55[_0x610d('0x33')]);_0x4b966e['filters']=_[_0x610d('0x36')](_0x4b966e['model'],_0x4b966e[_0x610d('0x33')]);_0x47c343[_0x610d('0x35')]=_['intersection'](_0x4b966e[_0x610d('0x32')],qs[_0x610d('0x37')](_0x557e55[_0x610d('0x33')][_0x610d('0x37')]));_0x47c343['attributes']=_0x47c343[_0x610d('0x35')][_0x610d('0x38')]?_0x47c343[_0x610d('0x35')]:_0x4b966e[_0x610d('0x32')];_0x47c343[_0x610d('0x3a')]=qs[_0x610d('0x3b')](_0x557e55['query']['sort']);_0x47c343[_0x610d('0x3c')]=qs[_0x610d('0x3d')](_[_0x610d('0x3e')](_0x557e55[_0x610d('0x33')],_0x4b966e['filters']));if(_0x557e55[_0x610d('0x33')]['filter']){_0x47c343['where']=_[_0x610d('0x42')](_0x47c343[_0x610d('0x3c')],{'$or':_[_0x610d('0x2d')](_0x47c343[_0x610d('0x35')],function(_0x1899e9){var _0x380e91={};_0x380e91[_0x1899e9]={'$like':'%'+_0x557e55[_0x610d('0x33')]['filter']+'%'};return _0x380e91;})});}if(_0x557e55[_0x610d('0x33')][_0x610d('0x5f')]){var _0x596334=_0x557e55[_0x610d('0x33')]['$gte'][_0x610d('0x60')](',');var _0x5bf11f={};_0x5bf11f[_0x596334[0x0]]={'$gte':moment(_0x596334[0x1])[_0x610d('0x61')](_0x610d('0x62'))};_0x47c343[_0x610d('0x3c')]=_[_0x610d('0x42')](_0x47c343[_0x610d('0x3c')],_0x5bf11f);}_0x47c343=_[_0x610d('0x42')]({},_0x47c343,_0x557e55[_0x610d('0x4b')]);return _0x2388f6['getMessages'](_0x47c343);}})[_0x610d('0x27')](function(_0x2dd20b){if(_0x2dd20b){_0x20342b=_0x2dd20b['length'];if(!_0x557e55[_0x610d('0x33')][_0x610d('0x63')](_0x610d('0x39'))){_0x47c343['limit']=qs[_0x610d('0x22')](_0x557e55[_0x610d('0x33')][_0x610d('0x22')]);_0x47c343[_0x610d('0x23')]=qs[_0x610d('0x23')](_0x557e55[_0x610d('0x33')][_0x610d('0x23')]);}return _0x2388f6[_0x610d('0x5e')](_0x47c343);}})['then'](function(_0x2573b0){if(_0x2573b0){return _0x2573b0?{'count':_0x20342b,'rows':_0x2573b0}:null;}})[_0x610d('0x27')](respondWithResult(_0x4c440e,null))['catch'](handleError(_0x4c440e,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 830d6f4..d49ab45 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 _0xa412=['ChatGroup','setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x2d2263,_0xa41e95){var _0x740645=function(_0x351dd7){while(--_0x351dd7){_0x2d2263['push'](_0x2d2263['shift']());}};_0x740645(++_0xa41e95);}(_0xa412,0x127));var _0x2a41=function(_0x5d33e1,_0x16fbff){_0x5d33e1=_0x5d33e1-0x0;var _0xa5bd10=_0xa412[_0x5d33e1];return _0xa5bd10;};'use strict';var EventEmitter=require(_0x2a41('0x0'));var ChatGroup=require(_0x2a41('0x1'))['db'][_0x2a41('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2a41('0x3')](0x0);var events={'afterCreate':_0x2a41('0x4'),'afterUpdate':'update','afterDestroy':_0x2a41('0x5')};function emitEvent(_0x5d9c6a){return function(_0x1d8e03,_0x35e0ae,_0x4fc641){ChatGroupEvents[_0x2a41('0x6')](_0x5d9c6a+':'+_0x1d8e03['id'],_0x1d8e03);ChatGroupEvents[_0x2a41('0x6')](_0x5d9c6a,_0x1d8e03);_0x4fc641(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x2a41('0x7')](e,emitEvent(event));}}module[_0x2a41('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xa73a=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x38b3ed,_0x86e274){var _0x34a9ed=function(_0x5703b9){while(--_0x5703b9){_0x38b3ed['push'](_0x38b3ed['shift']());}};_0x34a9ed(++_0x86e274);}(_0xa73a,0xe5));var _0xaa73=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0xa73a[_0x593564];return _0x211a89;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xaa73('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xaa73('0x1')](0x0);var events={'afterCreate':_0xaa73('0x2'),'afterUpdate':_0xaa73('0x3'),'afterDestroy':'remove'};function emitEvent(_0x110286){return function(_0x2654a8,_0x3b5e5f,_0x51df2e){ChatGroupEvents['emit'](_0x110286+':'+_0x2654a8['id'],_0x2654a8);ChatGroupEvents[_0xaa73('0x4')](_0x110286,_0x2654a8);_0x51df2e(null);};}for(var e in events){if(events[_0xaa73('0x5')](e)){var event=events[e];ChatGroup[_0xaa73('0x6')](e,emitEvent(event));}}module[_0xaa73('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 82f8f08..71967b8 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 _0xb493=['request-promise','rimraf','../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','../../config/logger','api','moment'];(function(_0x1d7bbd,_0x327073){var _0x520685=function(_0x24e215){while(--_0x24e215){_0x1d7bbd['push'](_0x1d7bbd['shift']());}};_0x520685(++_0x327073);}(_0xb493,0x1f0));var _0x3b49=function(_0x59ac21,_0x442dd3){_0x59ac21=_0x59ac21-0x0;var _0x44846a=_0xb493[_0x59ac21];return _0x44846a;};'use strict';var _=require(_0x3b49('0x0'));var util=require('util');var logger=require(_0x3b49('0x1'))(_0x3b49('0x2'));var moment=require(_0x3b49('0x3'));var BPromise=require('bluebird');var rp=require(_0x3b49('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b49('0x5'));var config=require(_0x3b49('0x6'));var attributes=require(_0x3b49('0x7'));module['exports']=function(_0x1d0f3f,_0x1742a7){return _0x1d0f3f['define'](_0x3b49('0x8'),attributes,{'tableName':_0x3b49('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7dea=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatGroup'];(function(_0x35eb73,_0x2da2a1){var _0x1a14f4=function(_0x484e88){while(--_0x484e88){_0x35eb73['push'](_0x35eb73['shift']());}};_0x1a14f4(++_0x2da2a1);}(_0x7dea,0xbe));var _0xa7de=function(_0x5bf9c0,_0x206f4c){_0x5bf9c0=_0x5bf9c0-0x0;var _0x285285=_0x7dea[_0x5bf9c0];return _0x285285;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa7de('0x0'))(_0xa7de('0x1'));var moment=require(_0xa7de('0x2'));var BPromise=require(_0xa7de('0x3'));var rp=require(_0xa7de('0x4'));var fs=require('fs');var path=require(_0xa7de('0x5'));var rimraf=require(_0xa7de('0x6'));var config=require(_0xa7de('0x7'));var attributes=require('./chatGroup.attributes');module[_0xa7de('0x8')]=function(_0x4ad575,_0x2cc272){return _0x4ad575['define'](_0xa7de('0x9'),attributes,{'tableName':'chat_groups','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 fa1ff6d..fffd872 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 _0x851c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x26d806,_0x411f4b){var _0x2218d6=function(_0xa84a7a){while(--_0xa84a7a){_0x26d806['push'](_0x26d806['shift']());}};_0x2218d6(++_0x411f4b);}(_0x851c,0x19d));var _0xc851=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x851c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc851('0x0'));var util=require(_0xc851('0x1'));var moment=require(_0xc851('0x2'));var BPromise=require(_0xc851('0x3'));var rs=require(_0xc851('0x4'));var fs=require('fs');var Redis=require(_0xc851('0x5'));var db=require(_0xc851('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc851('0x7'))(_0xc851('0x8'));var config=require('../../config/environment');var jayson=require(_0xc851('0x9'));var client=jayson[_0xc851('0xa')]['http']({'port':0x232a});config[_0xc851('0xb')]=_['defaults'](config['redis'],{'host':_0xc851('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc851('0xd'))[_0xc851('0xe')](socket);function respondWithRpcPromise(_0x3b4e80,_0x177de0,_0x1f1524){return new BPromise(function(_0x1ee38d,_0x33772a){return client[_0xc851('0xf')](_0x3b4e80,_0x1f1524)['then'](function(_0x3a1ce8){logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));logger[_0xc851('0x13')](_0xc851('0x14'),_0x177de0,_0xc851('0x12'),JSON[_0xc851('0x15')](_0x3a1ce8));if(_0x3a1ce8[_0xc851('0x16')]){if(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x17')]===0x1f4){logger[_0xc851('0x16')](_0xc851('0x11'),_0x177de0,_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);return _0x33772a(_0x3a1ce8[_0xc851('0x16')]['message']);}logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x3a1ce8[_0xc851('0x16')]['message']);return _0x1ee38d(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);}else{logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));_0x1ee38d(_0x3a1ce8[_0xc851('0x19')][_0xc851('0x18')]);}})['catch'](function(_0x27c098){logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x27c098);_0x33772a(_0x27c098);});});} \ No newline at end of file +var _0x8d6f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','ChatGroup,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x8d6f,0x1bb));var _0xf8d6=function(_0x378c25,_0x224d7b){_0x378c25=_0x378c25-0x0;var _0x2179f1=_0x8d6f[_0x378c25];return _0x2179f1;};'use strict';var _=require(_0xf8d6('0x0'));var util=require(_0xf8d6('0x1'));var moment=require(_0xf8d6('0x2'));var BPromise=require(_0xf8d6('0x3'));var rs=require(_0xf8d6('0x4'));var fs=require('fs');var Redis=require(_0xf8d6('0x5'));var db=require(_0xf8d6('0x6'))['db'];var utils=require(_0xf8d6('0x7'));var logger=require(_0xf8d6('0x8'))(_0xf8d6('0x9'));var config=require(_0xf8d6('0xa'));var jayson=require(_0xf8d6('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0xf8d6('0xc')]=_['defaults'](config[_0xf8d6('0xc')],{'host':_0xf8d6('0xd'),'port':0x18eb});var socket=require(_0xf8d6('0xe'))(new Redis(config['redis']));require(_0xf8d6('0xf'))[_0xf8d6('0x10')](socket);function respondWithRpcPromise(_0x400250,_0x10efc3,_0xdcdd90){return new BPromise(function(_0x1f07fc,_0x56ba54){return client[_0xf8d6('0x11')](_0x400250,_0xdcdd90)['then'](function(_0x119896){logger['info']('ChatGroup,\x20%s,\x20%s',_0x10efc3,_0xf8d6('0x12'));logger[_0xf8d6('0x13')](_0xf8d6('0x14'),_0x10efc3,_0xf8d6('0x12'),JSON[_0xf8d6('0x15')](_0x119896));if(_0x119896['error']){if(_0x119896['error'][_0xf8d6('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x10efc3,_0x119896[_0xf8d6('0x17')]['message']);return _0x56ba54(_0x119896[_0xf8d6('0x17')][_0xf8d6('0x18')]);}logger[_0xf8d6('0x17')]('ChatGroup,\x20%s,\x20%s',_0x10efc3,_0x119896['error'][_0xf8d6('0x18')]);return _0x1f07fc(_0x119896[_0xf8d6('0x17')]['message']);}else{logger[_0xf8d6('0x19')](_0xf8d6('0x1a'),_0x10efc3,_0xf8d6('0x12'));_0x1f07fc(_0x119896[_0xf8d6('0x1b')][_0xf8d6('0x18')]);}})['catch'](function(_0x2bcc24){logger[_0xf8d6('0x17')]('ChatGroup,\x20%s,\x20%s',_0x10efc3,_0x2bcc24);_0x56ba54(_0x2bcc24);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 6101da1..7f63493 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 _0x4f14=['update','emit','removeListener','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4f14,0xb3));var _0x44f1=function(_0x3dc834,_0x448eff){_0x3dc834=_0x3dc834-0x0;var _0x313600=_0x4f14[_0x3dc834];return _0x313600;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x44f1('0x0'),'remove',_0x44f1('0x1')];function createListener(_0x2bac3f,_0x2ff9fb){return function(_0x4ee5c2){_0x2ff9fb[_0x44f1('0x2')](_0x2bac3f,_0x4ee5c2);};}function removeListener(_0x2490a0,_0x3a0e41){return function(){ChatGroupEvents[_0x44f1('0x3')](_0x2490a0,_0x3a0e41);};}exports['register']=function(_0x95aaa0){for(var _0x5aea8b=0x0,_0x1e47a7=events['length'];_0x5aea8b<_0x1e47a7;_0x5aea8b++){var _0x10a3b4=events[_0x5aea8b];var _0x332d7b=createListener('chatGroup:'+_0x10a3b4,_0x95aaa0);ChatGroupEvents['on'](_0x10a3b4,_0x332d7b);}}; \ No newline at end of file +var _0x2752=['removeListener','register','length','chatGroup:','save'];(function(_0x13da9d,_0x3bd432){var _0x20ce98=function(_0x1cfad5){while(--_0x1cfad5){_0x13da9d['push'](_0x13da9d['shift']());}};_0x20ce98(++_0x3bd432);}(_0x2752,0x15d));var _0x2275=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2752[_0x321bb2];return _0x9c12ed;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x2275('0x0'),'remove','update'];function createListener(_0x1d74c5,_0x181260){return function(_0x12ab1e){_0x181260['emit'](_0x1d74c5,_0x12ab1e);};}function removeListener(_0x199cbe,_0x67bf73){return function(){ChatGroupEvents[_0x2275('0x1')](_0x199cbe,_0x67bf73);};}exports[_0x2275('0x2')]=function(_0x633265){for(var _0x411170=0x0,_0x361673=events[_0x2275('0x3')];_0x411170<_0x361673;_0x411170++){var _0x56069b=events[_0x411170];var _0x2ab578=createListener(_0x2275('0x4')+_0x56069b,_0x633265);ChatGroupEvents['on'](_0x56069b,_0x2ab578);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 0041574..08f19db 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 _0xad99=['put','update','delete','removeMembers','exports','multer','util','path','express','fs-extra','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/:id','show','/:id/unread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage'];(function(_0x1213c3,_0x4167e0){var _0x6671c2=function(_0x49bf51){while(--_0x49bf51){_0x1213c3['push'](_0x1213c3['shift']());}};_0x6671c2(++_0x4167e0);}(_0xad99,0x17c));var _0x9ad9=function(_0x58a242,_0x803cc6){_0x58a242=_0x58a242-0x0;var _0x375e32=_0xad99[_0x58a242];return _0x375e32;};'use strict';var multer=require(_0x9ad9('0x0'));var util=require(_0x9ad9('0x1'));var path=require(_0x9ad9('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ad9('0x3'));var router=express['Router']();var fs_extra=require(_0x9ad9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9ad9('0x5'));var controller=require(_0x9ad9('0x6'));router[_0x9ad9('0x7')]('/',auth[_0x9ad9('0x8')](),controller[_0x9ad9('0x9')]);router[_0x9ad9('0x7')]('/describe',auth[_0x9ad9('0x8')](),controller['describe']);router['get'](_0x9ad9('0xa'),auth[_0x9ad9('0x8')](),controller[_0x9ad9('0xb')]);router[_0x9ad9('0x7')](_0x9ad9('0xc'),auth[_0x9ad9('0x8')](),controller['getUnread']);router[_0x9ad9('0x7')](_0x9ad9('0xd'),auth[_0x9ad9('0x8')](),controller['getMembers']);router[_0x9ad9('0x7')](_0x9ad9('0xe'),auth[_0x9ad9('0x8')](),controller[_0x9ad9('0xf')]);router[_0x9ad9('0x10')]('/',auth[_0x9ad9('0x8')](),controller[_0x9ad9('0x11')]);router[_0x9ad9('0x10')]('/:id/members',auth[_0x9ad9('0x8')](),controller[_0x9ad9('0x12')]);router['post']('/:id/messages',auth[_0x9ad9('0x8')](),controller[_0x9ad9('0x13')]);router[_0x9ad9('0x14')](_0x9ad9('0xa'),auth[_0x9ad9('0x8')](),controller[_0x9ad9('0x15')]);router[_0x9ad9('0x16')](_0x9ad9('0xa'),auth[_0x9ad9('0x8')](),controller['destroy']);router[_0x9ad9('0x16')](_0x9ad9('0xd'),auth['isAuthenticated'](),controller[_0x9ad9('0x17')]);module[_0x9ad9('0x18')]=router; \ No newline at end of file +var _0x9df4=['get','isAuthenticated','index','/describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','post','create','addMembers','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x9df4,0xc0));var _0x49df=function(_0x5d5ead,_0x4034ac){_0x5d5ead=_0x5d5ead-0x0;var _0x4eb7ba=_0x9df4[_0x5d5ead];return _0x4eb7ba;};'use strict';var multer=require(_0x49df('0x0'));var util=require(_0x49df('0x1'));var path=require(_0x49df('0x2'));var timeout=require(_0x49df('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x49df('0x4'));var auth=require(_0x49df('0x5'));var interaction=require(_0x49df('0x6'));var config=require(_0x49df('0x7'));var controller=require('./chatGroup.controller');router[_0x49df('0x8')]('/',auth[_0x49df('0x9')](),controller[_0x49df('0xa')]);router[_0x49df('0x8')](_0x49df('0xb'),auth[_0x49df('0x9')](),controller['describe']);router[_0x49df('0x8')](_0x49df('0xc'),auth[_0x49df('0x9')](),controller[_0x49df('0xd')]);router['get'](_0x49df('0xe'),auth[_0x49df('0x9')](),controller['getUnread']);router[_0x49df('0x8')](_0x49df('0xf'),auth[_0x49df('0x9')](),controller[_0x49df('0x10')]);router[_0x49df('0x8')](_0x49df('0x11'),auth[_0x49df('0x9')](),controller['getMessages']);router[_0x49df('0x12')]('/',auth[_0x49df('0x9')](),controller[_0x49df('0x13')]);router[_0x49df('0x12')](_0x49df('0xf'),auth[_0x49df('0x9')](),controller[_0x49df('0x14')]);router['post'](_0x49df('0x11'),auth[_0x49df('0x9')](),controller['addMessage']);router[_0x49df('0x15')](_0x49df('0xc'),auth[_0x49df('0x9')](),controller[_0x49df('0x16')]);router[_0x49df('0x17')](_0x49df('0xc'),auth[_0x49df('0x9')](),controller[_0x49df('0x18')]);router['delete'](_0x49df('0xf'),auth['isAuthenticated'](),controller['removeMembers']);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 103fb17..0607a13 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 _0x7269=['star','thumb','TEXT','STRING','DATE','long','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7269,0x76));var _0x9726=function(_0x67f4e2,_0x26593b){_0x67f4e2=_0x67f4e2-0x0;var _0x5561c3=_0x7269[_0x67f4e2];return _0x5561c3;};'use strict';var Sequelize=require(_0x9726('0x0'));module[_0x9726('0x1')]={'closed':{'type':Sequelize[_0x9726('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x9726('0x3'),_0x9726('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x9726('0x5')]},'pathTranscript':{'type':Sequelize[_0x9726('0x5')]},'mailTranscript':{'type':Sequelize[_0x9726('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9726('0x7')]},'disposition':{'type':Sequelize[_0x9726('0x6')]},'secondDisposition':{'type':Sequelize[_0x9726('0x6')]},'thirdDisposition':{'type':Sequelize[_0x9726('0x6')]},'note':{'type':Sequelize[_0x9726('0x6')]},'browserName':{'type':Sequelize[_0x9726('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x9726('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x9726('0x6')]},'deviceVendor':{'type':Sequelize[_0x9726('0x6')]},'deviceType':{'type':Sequelize[_0x9726('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x9726('0x6')]},'formData':{'type':Sequelize[_0x9726('0x5')](_0x9726('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9726('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x9726('0x9')]('in',_0x9726('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9726('0x6')]},'customerPort':{'type':Sequelize[_0x9726('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbdb7=['thumb','TEXT','STRING','long','DATE','sequelize','exports','BOOLEAN','INTEGER','ENUM','star'];(function(_0x56b51d,_0x5650af){var _0x5bbdec=function(_0x34c968){while(--_0x34c968){_0x56b51d['push'](_0x56b51d['shift']());}};_0x5bbdec(++_0x5650af);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2e16d8,_0x1110ff){_0x2e16d8=_0x2e16d8-0x0;var _0xbb0a07=_0xbdb7[_0x2e16d8];return _0xbb0a07;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'closed':{'type':Sequelize[_0x7bdb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7bdb('0x3')]},'ratingType':{'type':Sequelize[_0x7bdb('0x4')](_0x7bdb('0x5'),_0x7bdb('0x6')),'defaultValue':_0x7bdb('0x5')},'ratingMessage':{'type':Sequelize[_0x7bdb('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x7bdb('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7bdb('0x8')]},'thirdDisposition':{'type':Sequelize[_0x7bdb('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x7bdb('0x8')]},'osName':{'type':Sequelize[_0x7bdb('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x7bdb('0x8')]},'deviceType':{'type':Sequelize[_0x7bdb('0x8')]},'referer':{'type':Sequelize[_0x7bdb('0x7')]},'customerIp':{'type':Sequelize[_0x7bdb('0x8')]},'formData':{'type':Sequelize[_0x7bdb('0x7')](_0x7bdb('0x9'))},'read1stAt':{'type':Sequelize[_0x7bdb('0xa')]},'lastMsgAt':{'type':Sequelize[_0x7bdb('0xa')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7bdb('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x7bdb('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 73d667f..404840a 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 _0xf263=['ids','getMessages','hasOwnProperty','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','nolimit','order','pick','includeAgent','push','alias','setTags','omit','Tag','color','emit','chatInteractionTags:save','removeTags','toString','server','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','direction','read','ChatWebsite','Account','Owner','get','mkdirSync','Chat','closed','browserName','osName','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','name','render','merge','body','contact','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','chat','user','show','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','options','find','create','params','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','originalname','file','filename','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','offline-chat/','basename','download','mailTranscript','format','transcript-%s.txt','pathTranscript','User','ContactId','Messages','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage'];(function(_0x4c2f5d,_0x1986e3){var _0x44e650=function(_0x1d6a4f){while(--_0x1d6a4f){_0x4c2f5d['push'](_0x4c2f5d['shift']());}};_0x44e650(++_0x1986e3);}(_0xf263,0x106));var _0x3f26=function(_0x50fda9,_0x5ee44b){_0x50fda9=_0x50fda9-0x0;var _0x36b92b=_0xf263[_0x50fda9];return _0x36b92b;};'use strict';var rimraf=require(_0x3f26('0x0'));var zipdir=require(_0x3f26('0x1'));var rp=require(_0x3f26('0x2'));var moment=require(_0x3f26('0x3'));var BPromise=require(_0x3f26('0x4'));var Mustache=require(_0x3f26('0x5'));var util=require('util');var path=require(_0x3f26('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x3f26('0x7'));var interaction=require(_0x3f26('0x8'));var qs=require(_0x3f26('0x9'));var pdf=require(_0x3f26('0xa'));var logger=require(_0x3f26('0xb'))(_0x3f26('0xc'));var config=require(_0x3f26('0xd'));var db=require('../../mysqldb')['db'];config[_0x3f26('0xe')]=_['defaults'](config[_0x3f26('0xe')],{'host':_0x3f26('0xf'),'port':0x18eb});var socket=require(_0x3f26('0x10'))(new Redis(config['redis']));require(_0x3f26('0x11'))[_0x3f26('0x12')](socket);var jayson=require(_0x3f26('0x13'));var client=jayson[_0x3f26('0x14')][_0x3f26('0x15')]({'port':0x232b});var client9004=jayson['client'][_0x3f26('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x4628ef,_0x541c32,_0x4d2cbf,_0x6cdfcd){return new BPromise(function(_0x33c796,_0x4268cd){var _0x387412=_0x6cdfcd||client;return _0x387412[_0x3f26('0x16')](_0x4628ef,_0x4d2cbf)[_0x3f26('0x17')](function(_0x4829b6){logger[_0x3f26('0x18')](_0x3f26('0x19'),_0x541c32,_0x3f26('0x1a'));logger[_0x3f26('0x1b')](_0x3f26('0x1c'),_0x541c32,_0x3f26('0x1a'),JSON['stringify'](_0x4829b6));if(_0x4829b6[_0x3f26('0x1d')]){if(_0x4829b6[_0x3f26('0x1d')][_0x3f26('0x1e')]===0x1f4){logger[_0x3f26('0x1d')](_0x3f26('0x19'),_0x541c32,_0x4829b6['error'][_0x3f26('0x1f')]);return _0x4268cd(_0x4829b6['error'][_0x3f26('0x1f')]);}logger[_0x3f26('0x1d')](_0x3f26('0x19'),_0x541c32,_0x4829b6[_0x3f26('0x1d')][_0x3f26('0x1f')]);return _0x33c796(_0x4829b6[_0x3f26('0x1d')][_0x3f26('0x1f')]);}else{logger['info'](_0x3f26('0x19'),_0x541c32,_0x3f26('0x1a'));_0x33c796(_0x4829b6[_0x3f26('0x20')][_0x3f26('0x1f')]);}})[_0x3f26('0x21')](function(_0x3eb7e5){logger[_0x3f26('0x1d')](_0x3f26('0x19'),_0x541c32,_0x3eb7e5);_0x4268cd(_0x3eb7e5);});});}function respondWithStatusCode(_0x3596ce,_0x4877c8){_0x4877c8=_0x4877c8||0xcc;return function(_0x506ba6){if(_0x506ba6){return _0x3596ce[_0x3f26('0x22')](_0x4877c8);}return _0x3596ce[_0x3f26('0x23')](_0x4877c8)[_0x3f26('0x24')]();};}function respondWithResult(_0x1276c0,_0x27a9a6){_0x27a9a6=_0x27a9a6||0xc8;return function(_0x130f17){if(_0x130f17){return _0x1276c0['status'](_0x27a9a6)[_0x3f26('0x25')](_0x130f17);}};}function respondWithFilteredResult(_0x7e0a03,_0x69b8ef){return function(_0x3c8d7b){if(_0x3c8d7b){var _0x2a542a=typeof _0x69b8ef[_0x3f26('0x26')]===_0x3f26('0x27')&&typeof _0x69b8ef[_0x3f26('0x28')]==='undefined';var _0xd10831=_0x3c8d7b[_0x3f26('0x29')];var _0x3a5ba0=_0x2a542a?0x0:_0x69b8ef[_0x3f26('0x26')];var _0x33ce14=_0x2a542a?_0x3c8d7b[_0x3f26('0x29')]:_0x69b8ef[_0x3f26('0x26')]+_0x69b8ef['limit'];var _0x5b633a;if(_0x33ce14>=_0xd10831){_0x33ce14=_0xd10831;_0x5b633a=0xc8;}else{_0x5b633a=0xce;}_0x7e0a03[_0x3f26('0x23')](_0x5b633a);return _0x7e0a03[_0x3f26('0x2a')]('Content-Range',_0x3a5ba0+'-'+_0x33ce14+'/'+_0xd10831)['json'](_0x3c8d7b);}return null;};}function saveUpdates(_0x53b3f6){return function(_0x394e79){if(_0x394e79){return _0x394e79[_0x3f26('0x2b')](_0x53b3f6)[_0x3f26('0x17')](function(_0x162139){return _0x162139;});}return null;};}function removeEntity(_0x597d38){return function(_0x26a0da){if(_0x26a0da){return _0x26a0da[_0x3f26('0x2c')]()[_0x3f26('0x17')](function(){_0x597d38['status'](0xcc)[_0x3f26('0x24')]();});}};}function handleEntityNotFound(_0x45c0e3){return function(_0x5d4979){if(!_0x5d4979){_0x45c0e3['sendStatus'](0x194);}return _0x5d4979;};}function handleError(_0x2f015c,_0x10ed03){_0x10ed03=_0x10ed03||0x1f4;return function(_0x1ed0a0){logger[_0x3f26('0x1d')](_0x1ed0a0['stack']);if(_0x1ed0a0[_0x3f26('0x2d')]){delete _0x1ed0a0[_0x3f26('0x2d')];}_0x2f015c['status'](_0x10ed03)['send'](_0x1ed0a0);};}function getMustacheRender(_0x1f7204,_0x22d5be){return Mustache[_0x3f26('0x2e')](_0x1f7204,_[_0x3f26('0x2f')](_0x22d5be[_0x3f26('0x30')],{'contact':_0x22d5be[_0x3f26('0x31')],'message':_0x22d5be[_0x3f26('0x1f')],'agent':_0x22d5be['agent'],'interaction':_0x22d5be[_0x3f26('0x32')],'account':_0x22d5be[_0x3f26('0x33')]}))||'';}exports[_0x3f26('0x34')]=function(_0xd0f0b7,_0x40f89b){var _0x343931={};var _0x50e637=_[_0x3f26('0x35')](db[_0x3f26('0x36')][_0x3f26('0x37')],function(_0x1b395c){return{'name':_0x1b395c[_0x3f26('0x38')],'type':_0x1b395c[_0x3f26('0x39')][_0x3f26('0x3a')]};});_0x343931=qs['getOptions'](_0x50e637,_0xd0f0b7);return interaction[_0x3f26('0x3b')](_0x3f26('0x3c'),_0xd0f0b7['query'],_0xd0f0b7[_0x3f26('0x3d')],_0x343931,_0x50e637)[_0x3f26('0x17')](respondWithFilteredResult(_0x40f89b,_0x343931))[_0x3f26('0x21')](handleError(_0x40f89b,null));};exports[_0x3f26('0x3e')]=function(_0x5b4243,_0x1d97eb){var _0x6c455e={'raw':![],'where':{'id':_0x5b4243['params']['id']}},_0x3876b8={};_0x3876b8['model']=_['keys'](db[_0x3f26('0x36')]['rawAttributes']);_0x3876b8[_0x3f26('0x3f')]=_[_0x3f26('0x40')](_0x5b4243[_0x3f26('0x3f')]);_0x3876b8[_0x3f26('0x41')]=_[_0x3f26('0x42')](_0x3876b8[_0x3f26('0x43')],_0x3876b8['query']);_0x6c455e['attributes']=_['intersection'](_0x3876b8[_0x3f26('0x43')],qs['fields'](_0x5b4243[_0x3f26('0x3f')][_0x3f26('0x44')]));_0x6c455e[_0x3f26('0x45')]=_0x6c455e[_0x3f26('0x45')][_0x3f26('0x46')]?_0x6c455e[_0x3f26('0x45')]:_0x3876b8[_0x3f26('0x43')];if(_0x5b4243[_0x3f26('0x3f')][_0x3f26('0x47')]){_0x6c455e[_0x3f26('0x48')]=[{'all':!![]}];}_0x6c455e=_['merge']({},_0x6c455e,_0x5b4243[_0x3f26('0x49')]);return db[_0x3f26('0x36')][_0x3f26('0x4a')](_0x6c455e)[_0x3f26('0x17')](handleEntityNotFound(_0x1d97eb,null))[_0x3f26('0x17')](respondWithResult(_0x1d97eb,null))[_0x3f26('0x21')](handleError(_0x1d97eb,null));};exports[_0x3f26('0x4b')]=function(_0x47227a,_0x1a6e4e){return db[_0x3f26('0x36')][_0x3f26('0x4b')](_0x47227a['body'],{})[_0x3f26('0x17')](respondWithResult(_0x1a6e4e,0xc9))[_0x3f26('0x21')](handleError(_0x1a6e4e,null));};exports[_0x3f26('0x2b')]=function(_0x3505ce,_0x3f3ad1){if(_0x3505ce[_0x3f26('0x30')]['id']){delete _0x3505ce[_0x3f26('0x30')]['id'];}return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x3505ce['params']['id']}})[_0x3f26('0x17')](handleEntityNotFound(_0x3f3ad1,null))[_0x3f26('0x17')](saveUpdates(_0x3505ce[_0x3f26('0x30')],null))['then'](respondWithResult(_0x3f3ad1,null))[_0x3f26('0x21')](handleError(_0x3f3ad1,null));};exports['destroy']=function(_0x1b15ad,_0x599b53){return db['ChatInteraction'][_0x3f26('0x4a')]({'where':{'id':_0x1b15ad[_0x3f26('0x4c')]['id']}})[_0x3f26('0x17')](handleEntityNotFound(_0x599b53,null))['then'](removeEntity(_0x599b53,null))[_0x3f26('0x21')](handleError(_0x599b53,null));};exports['describe']=function(_0x2c060f,_0x1846fe){return db[_0x3f26('0x36')][_0x3f26('0x4d')]()['then'](respondWithResult(_0x1846fe,null))[_0x3f26('0x21')](handleError(_0x1846fe,null));};exports[_0x3f26('0x4e')]=function(_0x51f97c,_0xbc31de){var _0x353b16=_0x51f97c[_0x3f26('0x4c')]['id'];var _0x4dde4d;var _0x251e73;var _0x58a627;return db['ChatInteraction'][_0x3f26('0x4f')]({'where':{'id':_0x353b16}})[_0x3f26('0x17')](function(_0x316afb){_0x4dde4d=_0x316afb;return db['ChatWebsite'][_0x3f26('0x4f')]({'where':{'id':_0x316afb[_0x3f26('0x50')]},'attributes':['id',_0x3f26('0x51'),_0x3f26('0x52'),_0x3f26('0x53'),_0x3f26('0x54'),'vidaooMetadata'],'raw':!![]});})[_0x3f26('0x17')](function(_0x57806e){if(_0x57806e&&_0x57806e[_0x3f26('0x51')]&&_0x57806e[_0x3f26('0x52')]){_0x251e73=_0x57806e;var _0x58f849={'interaction':{'id':_0x353b16},'agent':{'id':_0x51f97c[_0x3f26('0x3d')]['id'],'name':_0x51f97c[_0x3f26('0x3d')][_0x3f26('0x2d')],'fullname':_0x51f97c[_0x3f26('0x3d')][_0x3f26('0x55')],'email':_0x51f97c['user'][_0x3f26('0x56')]},'contact':_0x51f97c[_0x3f26('0x30')][_0x3f26('0x31')],'account':_0x51f97c[_0x3f26('0x30')][_0x3f26('0x33')]};var _0x55e63b={'rejectUnauthorized':![],'method':_0x3f26('0x57'),'url':_0x3f26('0x58'),'headers':{'X-APIKEY':_0x57806e['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x51f97c[_0x3f26('0x3d')][_0x3f26('0x56')]],'buttons':null,'topic':_0x251e73[_0x3f26('0x53')],'note':_['isNull'](_0x251e73[_0x3f26('0x54')])?null:getMustacheRender(_0x251e73['vidaooNote'],_0x58f849),'metadata':null},'redirect':_0x3f26('0x59'),'json':!![]};try{if(!_[_0x3f26('0x5a')](_0x251e73['vidaooMetadata'])){var _0x4cd470=getMustacheRender(_0x251e73[_0x3f26('0x5b')],_0x58f849);var _0x16f1bc=JSON[_0x3f26('0x5c')](_0x4cd470);_0x55e63b[_0x3f26('0x30')][_0x3f26('0x5d')]=_0x16f1bc;}}catch(_0x468c63){throw new db[(_0x3f26('0x5e'))][(_0x3f26('0x5f'))](_0x3f26('0x60'));}return rp(_0x55e63b);}else{throw new db[(_0x3f26('0x5e'))][(_0x3f26('0x5f'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3f26('0x17')](function(_0x293299){_0x58a627=_0x293299;if(_0x58a627['id']){var _0x2552b4={'body':_0x58a627[_0x3f26('0x61')],'ChatWebsiteId':_0x251e73['id'],'ChatInteractionId':_0x4dde4d['id'],'direction':_0x3f26('0x62'),'UserId':_0x51f97c[_0x3f26('0x3d')]['id']};return db[_0x3f26('0x63')][_0x3f26('0x4b')](_0x2552b4,{});}else{throw new db[(_0x3f26('0x5e'))][(_0x3f26('0x5f'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x3f26('0x17')](function(){return _0x4dde4d[_0x3f26('0x64')]({'vidaooSessionId':_0x58a627['id']});})['then'](respondWithResult(_0xbc31de,null))['catch'](handleError(_0xbc31de,null));};exports[_0x3f26('0x65')]=function(_0x4a146c,_0x2a5d78){if(_0x4a146c[_0x3f26('0x30')]['id']){delete _0x4a146c[_0x3f26('0x30')]['id'];}return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x4a146c[_0x3f26('0x4c')]['id']},'include':[{'model':db[_0x3f26('0x66')],'as':'Contact'}]})[_0x3f26('0x17')](handleEntityNotFound(_0x2a5d78,null))[_0x3f26('0x17')](saveUpdates(_0x4a146c[_0x3f26('0x30')],null))[_0x3f26('0x17')](respondWithResult(_0x2a5d78,null))[_0x3f26('0x21')](handleError(_0x2a5d78,null));};exports[_0x3f26('0x67')]=function(_0x284dba,_0x54bc29){if(_0x284dba['body']['id']){delete _0x284dba[_0x3f26('0x30')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x284dba[_0x3f26('0x4c')]['id']}})['then'](function(_0x12d566){if(!_0x12d566){logger[_0x3f26('0x1d')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x3f26('0x67'),0x194,_0x3f26('0x68'));_0x54bc29['sendStatus'](0x194);}else{if(_0x12d566[_0x3f26('0x69')]){throw new db[(_0x3f26('0x5e'))][(_0x3f26('0x5f'))](_0x3f26('0x6a'));}}return _0x12d566;})[_0x3f26('0x17')](function(_0x1c11a1){if(_0x1c11a1){return _0x1c11a1[_0x3f26('0x2b')]({'closed':_0x284dba[_0x3f26('0x30')]['closed'],'disposition':_0x284dba[_0x3f26('0x30')][_0x3f26('0x6b')]})[_0x3f26('0x17')](function(_0x203edd){return _0x203edd;});}})['then'](function(){return respondWithRpcPromise(_0x3f26('0x6c'),'abandon',_0x284dba[_0x3f26('0x30')],client9004);})[_0x3f26('0x17')](respondWithResult(_0x54bc29,null))[_0x3f26('0x21')](handleError(_0x54bc29,null));};exports[_0x3f26('0x6d')]=function(_0x21afaa,_0x2a9989){_0x21afaa[_0x3f26('0x30')]['name']=_0x21afaa['file'][_0x3f26('0x6e')];_0x21afaa[_0x3f26('0x30')]['basename']=_0x21afaa[_0x3f26('0x6f')][_0x3f26('0x70')];_0x21afaa[_0x3f26('0x30')][_0x3f26('0x39')]=_0x21afaa[_0x3f26('0x6f')]['mimetype'];return db[_0x3f26('0x71')][_0x3f26('0x4b')](_0x21afaa[_0x3f26('0x30')])[_0x3f26('0x17')](respondWithResult(_0x2a9989,0xc9))[_0x3f26('0x21')](handleError(_0x2a9989,null));};exports[_0x3f26('0x72')]=function(_0x9909ae,_0x1da204){return db[_0x3f26('0x36')][_0x3f26('0x4f')]({'where':{'id':_0x9909ae[_0x3f26('0x4c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1da204,null))[_0x3f26('0x17')](function(_0xd222cf){if(_0xd222cf){if(_0xd222cf['closed']){return _0x1da204[_0x3f26('0x23')](0x193)['json']({'status':0x193,'message':_0x3f26('0x73')});}return db[_0x3f26('0x71')]['findOne']({'where':{'id':_0x9909ae[_0x3f26('0x3f')]['attachId']},'raw':!![]})[_0x3f26('0x17')](handleEntityNotFound(_0x1da204,null));}})['then'](function(_0x2e539f){if(_0x2e539f){var _0x5be864=_0x2e539f[_0x3f26('0x74')]!==null;var _0x123f67=path[_0x3f26('0x75')](config[_0x3f26('0x76')],'server/files/attachments/');if(_0x5be864){_0x123f67=path['join'](_0x123f67,_0x3f26('0x77'));}var _0x412bfd=path[_0x3f26('0x75')](_0x123f67,_0x2e539f[_0x3f26('0x78')]);return _0x1da204[_0x3f26('0x79')](_0x412bfd);}})[_0x3f26('0x21')](handleError(_0x1da204,null));};exports['close']=function(_0x57e86e,_0x39bfa7){var _0x1cb9a0=null;var _0x355c5f=null;var _0xbd9559=null;if(_0x57e86e[_0x3f26('0x30')]['id']){delete _0x57e86e[_0x3f26('0x30')]['id'];}if(_0x57e86e['body'][_0x3f26('0x7a')]){_0xbd9559=path[_0x3f26('0x75')](config['root'],'server/files/chat/upload/',util[_0x3f26('0x7b')](_0x3f26('0x7c'),Date['now']()));_0x57e86e['body'][_0x3f26('0x7d')]=_0xbd9559;}return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x57e86e['params']['id']},'include':[{'model':db[_0x3f26('0x63')],'as':'Messages','include':[{'model':db[_0x3f26('0x7e')],'as':_0x3f26('0x7e')}]}]})['then'](handleEntityNotFound(_0x39bfa7,null))[_0x3f26('0x17')](saveUpdates(_0x57e86e[_0x3f26('0x30')],null))[_0x3f26('0x17')](function(_0x247d0a){if(_0x247d0a){_0x1cb9a0=_0x247d0a;return db['ChatWebsite'][_0x3f26('0x4a')]({'where':{'id':_0x1cb9a0[_0x3f26('0x50')]}});}})[_0x3f26('0x17')](function(_0x320f94){if(_0x320f94){_0x355c5f=_0x320f94;return db[_0x3f26('0x66')][_0x3f26('0x4a')]({'where':{'id':_0x1cb9a0[_0x3f26('0x7f')]}});}})[_0x3f26('0x17')](function(_0x44473e){if(_0x44473e){if(_0xbd9559){var _0x232c32=null;for(var _0x4372ab=0x1;_0x4372ab<_0x1cb9a0[_0x3f26('0x80')][_0x3f26('0x46')];++_0x4372ab){_0x232c32=_0x1cb9a0['Messages'][_0x4372ab];var _0x383d9c=_0x232c32['UserId']?util[_0x3f26('0x7b')](_0x3f26('0x81'),_0x355c5f['agentAlias'],_0x232c32[_0x3f26('0x69')]):_0x3f26('0x82');var _0x314486=_0x57e86e[_0x3f26('0x30')][_0x3f26('0x83')]||util[_0x3f26('0x7b')]('%s%d',_0x3f26('0x84'),_0x232c32[_0x3f26('0x7f')]);switch(_0x355c5f[_0x3f26('0x85')]){case _0x3f26('0x86'):_0x383d9c=_0x232c32[_0x3f26('0x69')]?util[_0x3f26('0x7b')](_0x3f26('0x81'),_0x355c5f[_0x3f26('0x87')],_0x232c32['UserId']):_0x3f26('0x82');break;case _0x3f26('0x88'):_0x383d9c=_0x232c32[_0x3f26('0x69')]?_0x232c32[_0x3f26('0x7e')]['alias']||_0x232c32['User']['fullname']:'System';break;case'agent_fullname':_0x383d9c=_0x232c32[_0x3f26('0x69')]?_0x232c32[_0x3f26('0x7e')]['fullname']:_0x3f26('0x82');break;default:_0x383d9c=_0x232c32[_0x3f26('0x69')]?util['format']('%s%d',_0x355c5f[_0x3f26('0x87')],_0x232c32[_0x3f26('0x69')]):_0x3f26('0x82');}var _0x256c4a=util[_0x3f26('0x7b')](_0x3f26('0x89'),moment(_0x232c32[_0x3f26('0x8a')])[_0x3f26('0x7b')](_0x3f26('0x8b')),_0x232c32['direction']==='in'?_0x314486:_0x383d9c,_0x232c32[_0x3f26('0x30')]);if(!_0x232c32[_0x3f26('0x8c')]){fs['appendFileSync'](_0xbd9559,_0x256c4a);}}return db[_0x3f26('0x8d')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x3f26('0x8e'),'raw':!![],'include':[{'model':db[_0x3f26('0x8f')],'as':_0x3f26('0x8f'),'raw':!![]}]}]});}}})[_0x3f26('0x17')](function(_0x36da0d){if(!_0x36da0d||!_0x36da0d[_0x3f26('0x8e')]||!_0x57e86e['body'])return _0x1cb9a0;var _0x53e225=_0x36da0d[_0x3f26('0x90')]();return respondWithRpcPromise(_0x3f26('0x91'),_0x3f26('0x92'),{'account':_0x53e225,'message':{'from':util['format'](_0x3f26('0x93'),_0x36da0d['name'],_0x36da0d[_0x3f26('0x56')]||_0x36da0d['Smtp'][_0x3f26('0x3d')]),'to':_0x57e86e['body'][_0x3f26('0x7a')],'subject':_0x3f26('0x94'),'text':util[_0x3f26('0x7b')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x57e86e[_0x3f26('0x30')][_0x3f26('0x7a')]),'attachments':[{'path':_0xbd9559}]}})[_0x3f26('0x17')](function(){return _0x1cb9a0;})[_0x3f26('0x21')](function(_0x178ad8){logger['error'](_0x178ad8);});})[_0x3f26('0x17')](respondWithStatusCode(_0x39bfa7,0xc8))[_0x3f26('0x21')](handleError(_0x39bfa7,null));};exports[_0x3f26('0x95')]=function(_0x1c8918,_0x1ea6f5){return db[_0x3f26('0x63')][_0x3f26('0x4a')]({'where':{'id':_0x1c8918['params']['id']}})[_0x3f26('0x17')](handleEntityNotFound(_0x1ea6f5,null))['then'](function(_0x2f290a){if(_0x2f290a){return _0x2f290a[_0x3f26('0x95')](_0x1c8918[_0x3f26('0x30')]['ids'],_['omit'](_0x1c8918[_0x3f26('0x30')],[_0x3f26('0x96'),'id'])||{});}})['then'](respondWithResult(_0x1ea6f5,null))[_0x3f26('0x21')](handleError(_0x1ea6f5,null));};exports[_0x3f26('0x97')]=function(_0x2e9a41,_0x4e1ec6){var _0x425729={'raw':![],'where':{}};var _0x5a0eac={};var _0x28ae3b={'count':0x0,'rows':[]};return db[_0x3f26('0x36')][_0x3f26('0x4f')]({'where':{'id':_0x2e9a41[_0x3f26('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e1ec6,null))['then'](function(_0x1cb6de){if(_0x1cb6de){_0x5a0eac[_0x3f26('0x43')]=_[_0x3f26('0x40')](db[_0x3f26('0x63')][_0x3f26('0x37')]);_0x5a0eac[_0x3f26('0x3f')]=_['keys'](_0x2e9a41[_0x3f26('0x3f')]);_0x5a0eac[_0x3f26('0x41')]=_[_0x3f26('0x42')](_0x5a0eac[_0x3f26('0x43')],_0x5a0eac[_0x3f26('0x3f')]);_0x425729['attributes']=_['intersection'](_0x5a0eac[_0x3f26('0x43')],qs[_0x3f26('0x44')](_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x44')]));_0x425729[_0x3f26('0x45')]=_0x425729['attributes'][_0x3f26('0x46')]?_0x425729[_0x3f26('0x45')]:_0x5a0eac['model'];if(!_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x98')]('nolimit')){_0x425729[_0x3f26('0x28')]=qs[_0x3f26('0x28')](_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x28')]);_0x425729[_0x3f26('0x26')]=qs[_0x3f26('0x26')](_0x2e9a41[_0x3f26('0x3f')]['offset']);}_0x425729['order']=qs[_0x3f26('0x99')](_0x2e9a41[_0x3f26('0x3f')]['sort']);_0x425729[_0x3f26('0x9a')]=qs[_0x3f26('0x41')](_['pick'](_0x2e9a41[_0x3f26('0x3f')],_0x5a0eac[_0x3f26('0x41')]));_0x425729[_0x3f26('0x9a')]['ChatInteractionId']=_0x1cb6de['id'];if(_0x2e9a41['query'][_0x3f26('0x9b')]){_0x425729[_0x3f26('0x9a')]=_[_0x3f26('0x2f')](_0x425729[_0x3f26('0x9a')],{'$or':_['map'](_0x425729[_0x3f26('0x45')],function(_0x43eda3){var _0x3cb04f={};_0x3cb04f[_0x43eda3]={'$like':'%'+_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x9b')]+'%'};return _0x3cb04f;})});}if(_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x9c')]){var _0x20e3e5=_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x9c')][_0x3f26('0x9d')](',');var _0x2e06e6={};_0x2e06e6[_0x20e3e5[0x0]]={'$gte':moment(_0x20e3e5[0x1])['format'](_0x3f26('0x9e'))};_0x425729[_0x3f26('0x9a')]=_['merge'](_0x425729[_0x3f26('0x9a')],_0x2e06e6);}_0x425729=_[_0x3f26('0x2f')]({},_0x425729,_0x2e9a41[_0x3f26('0x49')]);return db[_0x3f26('0x63')][_0x3f26('0x29')]({'where':_0x425729[_0x3f26('0x9a')]})[_0x3f26('0x17')](function(_0x4f151d){_0x28ae3b['count']=_0x4f151d;if(_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x47')]){_0x425729[_0x3f26('0x48')]=[{'all':!![]}];}return db[_0x3f26('0x63')][_0x3f26('0x3b')](_0x425729);})[_0x3f26('0x17')](function(_0x303649){_0x28ae3b['rows']=_0x303649;return _0x28ae3b;});}})[_0x3f26('0x17')](respondWithFilteredResult(_0x4e1ec6,_0x425729))[_0x3f26('0x21')](handleError(_0x4e1ec6,null));};exports['getMyMessages']=function(_0x1627b,_0x5de1db){var _0x189ae2={'where':{}},_0x49eb49={},_0x2ee75a={'count':0x0,'rows':[]};return db[_0x3f26('0x36')][_0x3f26('0x4f')]({'where':{'id':_0x1627b[_0x3f26('0x4c')]['id']}})[_0x3f26('0x17')](handleEntityNotFound(_0x5de1db,null))[_0x3f26('0x17')](function(_0x4abe32){if(_0x4abe32){_0x49eb49[_0x3f26('0x43')]=_[_0x3f26('0x40')](db[_0x3f26('0x63')]['rawAttributes']);_0x49eb49[_0x3f26('0x3f')]=_[_0x3f26('0x40')](_0x1627b[_0x3f26('0x3f')]);_0x49eb49[_0x3f26('0x41')]=_[_0x3f26('0x42')](_0x49eb49[_0x3f26('0x43')],_0x49eb49[_0x3f26('0x3f')]);_0x189ae2[_0x3f26('0x45')]=_[_0x3f26('0x42')](_0x49eb49[_0x3f26('0x43')],qs[_0x3f26('0x44')](_0x1627b['query'][_0x3f26('0x44')]));_0x189ae2[_0x3f26('0x45')]=_0x189ae2['attributes'][_0x3f26('0x46')]?_0x189ae2[_0x3f26('0x45')]:_0x49eb49[_0x3f26('0x43')];if(!_0x1627b[_0x3f26('0x3f')][_0x3f26('0x98')](_0x3f26('0x9f'))){_0x189ae2[_0x3f26('0x28')]=qs['limit'](_0x1627b[_0x3f26('0x3f')][_0x3f26('0x28')]);_0x189ae2['offset']=qs['offset'](_0x1627b[_0x3f26('0x3f')][_0x3f26('0x26')]);}_0x189ae2[_0x3f26('0xa0')]=qs[_0x3f26('0x99')](_0x1627b['query'][_0x3f26('0x99')]);_0x189ae2[_0x3f26('0x9a')]=qs[_0x3f26('0x41')](_[_0x3f26('0xa1')](_0x1627b[_0x3f26('0x3f')],_0x49eb49[_0x3f26('0x41')]));_0x189ae2[_0x3f26('0x9a')]['ChatInteractionId']=_0x4abe32['id'];if(_0x1627b['query'][_0x3f26('0x9b')]){_0x189ae2[_0x3f26('0x9a')]=_[_0x3f26('0x2f')](_0x189ae2[_0x3f26('0x9a')],{'$or':_['map'](_0x189ae2['attributes'],function(_0x4d6132){var _0x1d1cdd={};_0x1d1cdd[_0x4d6132]={'$like':'%'+_0x1627b['query'][_0x3f26('0x9b')]+'%'};return _0x1d1cdd;})});}_0x189ae2[_0x3f26('0x9a')][_0x3f26('0x8c')]=![];if(_0x1627b['query']['id']){_0x189ae2[_0x3f26('0x9a')]['id']={'$gt':_0x1627b[_0x3f26('0x3f')]['id']};}_0x189ae2=_['merge']({},_0x189ae2,_0x1627b[_0x3f26('0x49')]);return db[_0x3f26('0x63')]['count']({'where':_0x189ae2['where']})[_0x3f26('0x17')](function(_0x4b6fb8){_0x2ee75a[_0x3f26('0x29')]=_0x4b6fb8;_0x189ae2[_0x3f26('0x48')]=[];if(_0x1627b[_0x3f26('0x3f')][_0x3f26('0xa2')]){_0x189ae2[_0x3f26('0x48')][_0x3f26('0xa3')]({'model':db[_0x3f26('0x7e')],'as':'User','attributes':['id',_0x3f26('0x55'),_0x3f26('0xa4')]});}if(_0x1627b[_0x3f26('0x3f')][_0x3f26('0x47')]){_0x189ae2['include']=[{'all':!![]}];}return db[_0x3f26('0x63')][_0x3f26('0x3b')](_0x189ae2);})[_0x3f26('0x17')](function(_0x17e4e6){_0x2ee75a['rows']=_0x17e4e6;return _0x2ee75a;});}})[_0x3f26('0x17')](respondWithFilteredResult(_0x5de1db,_0x189ae2))[_0x3f26('0x21')](handleError(_0x5de1db,null));};exports['addTags']=function(_0x593903,_0x57e7cb){return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x593903['params']['id']}})['then'](handleEntityNotFound(_0x57e7cb,null))['then'](function(_0x5519c1){if(_0x5519c1){return _0x5519c1[_0x3f26('0xa5')](_0x593903[_0x3f26('0x30')]['ids'],_[_0x3f26('0xa6')](_0x593903[_0x3f26('0x30')],[_0x3f26('0x96'),'id'])||{})['spread'](function(){return db[_0x3f26('0xa7')][_0x3f26('0x3b')]({'attributes':['id',_0x3f26('0x2d'),_0x3f26('0xa8')],'where':{'id':_0x593903[_0x3f26('0x30')][_0x3f26('0x96')]}});})['then'](function(_0x35bd9d){socket[_0x3f26('0xa9')](_0x3f26('0xaa'),{'id':Number(_0x593903[_0x3f26('0x4c')]['id']),'tags':_0x35bd9d||[]});return{'id':Number(_0x593903[_0x3f26('0x4c')]['id']),'tags':_0x35bd9d||[]};});}})['then'](respondWithResult(_0x57e7cb,null))['catch'](handleError(_0x57e7cb,null));};exports[_0x3f26('0xab')]=function(_0x4476a5,_0x59cf6e){return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x4476a5[_0x3f26('0x4c')]['id']}})['then'](handleEntityNotFound(_0x59cf6e,null))[_0x3f26('0x17')](function(_0x184563){if(_0x184563){return _0x184563['removeTags'](_0x4476a5['query'][_0x3f26('0x96')]);}})[_0x3f26('0x17')](respondWithStatusCode(_0x59cf6e,null))[_0x3f26('0x21')](handleError(_0x59cf6e,null));};exports[_0x3f26('0x79')]=function(_0x16991c,_0x36f4e6){var _0x2ed22b=moment()['unix']()[_0x3f26('0xac')]();var _0x55ddbb=path[_0x3f26('0x75')](config[_0x3f26('0x76')],_0x3f26('0xad'),_0x3f26('0xae'),'tmp');var _0x1e2591=path[_0x3f26('0x75')](config[_0x3f26('0x76')],_0x3f26('0xad'),'files',_0x3f26('0xaf'));var _0x39342b=path['join'](_0x55ddbb,_0x2ed22b);var _0x14fa39=util[_0x3f26('0x7b')](_0x3f26('0xb0'),_0x16991c[_0x3f26('0x4c')]['id'],_0x2ed22b);var _0x2d5006=path[_0x3f26('0x75')](_0x55ddbb,_0x14fa39);var _0x405752=[];_0x405752[_0x3f26('0xa3')]({'model':db[_0x3f26('0x7e')],'as':_0x3f26('0x7e'),'attributes':['id',_0x3f26('0x55')],'raw':!![]});_0x405752[_0x3f26('0xa3')]({'model':db[_0x3f26('0x66')],'as':_0x3f26('0xb1'),'attributes':['id',_0x3f26('0xb2'),_0x3f26('0xb3')],'raw':!![]});if(_0x16991c[_0x3f26('0x3f')][_0x3f26('0xaf')]){_0x405752[_0x3f26('0xa3')]({'model':db[_0x3f26('0x71')],'as':_0x3f26('0x71'),'raw':!![]});}var _0x2373dd=[{'model':db['ChatMessage'],'as':_0x3f26('0x80'),'attributes':['id','body','createdAt',_0x3f26('0xb4'),'secret',_0x3f26('0xb5')],'include':_0x405752}];_0x2373dd[_0x3f26('0xa3')]({'model':db[_0x3f26('0xb6')],'as':_0x3f26('0xb7'),'attributes':['id',_0x3f26('0x2d')]});_0x2373dd['push']({'model':db[_0x3f26('0x7e')],'as':_0x3f26('0xb8'),'attributes':['id',_0x3f26('0x55')]});return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x16991c[_0x3f26('0x4c')]['id']},'include':_0x2373dd})[_0x3f26('0x17')](handleEntityNotFound(_0x36f4e6,null))[_0x3f26('0x17')](function(_0x3ccc0c){if(_0x3ccc0c){var _0x48d3e5=_0x3ccc0c[_0x3f26('0xb9')]({'plain':!![]});fs[_0x3f26('0xba')](_0x39342b);var _0x43da79={'channel':_0x3f26('0xbb'),'account':_0x48d3e5[_0x3f26('0xb7')]['name'],'agent':_0x48d3e5[_0x3f26('0xb8')]?_0x48d3e5[_0x3f26('0xb8')][_0x3f26('0x55')]:'N.A.','createdAt':moment(_0x48d3e5[_0x3f26('0x8a')])[_0x3f26('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3f26('0xac')](),'closedAt':_0x48d3e5[_0x3f26('0xbc')]?moment(_0x48d3e5['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3f26('0xac')]():'','disposition':_0x48d3e5[_0x3f26('0x6b')],'chatInfo':{'browser':_0x48d3e5[_0x3f26('0xbd')],'os':_0x48d3e5[_0x3f26('0xbe')],'referer':_0x48d3e5[_0x3f26('0xbf')],'customerIp':_0x48d3e5[_0x3f26('0xc0')],'customerPort':_0x48d3e5[_0x3f26('0xc1')]?_0x48d3e5[_0x3f26('0xc1')]:_0x3f26('0xc2')},'messages':_(_0x48d3e5[_0x3f26('0x80')])['tail']()[_0x3f26('0x9b')]({'secret':![]})[_0x3f26('0x35')](function(_0x3c3524){if(_0x3c3524[_0x3f26('0x71')]){var _0x20e64f=path[_0x3f26('0x75')](_0x1e2591,_0x3c3524['Attachment'][_0x3f26('0x78')]);if(fs[_0x3f26('0xc3')](_0x20e64f)){fs[_0x3f26('0xc4')](_0x20e64f)[_0x3f26('0xc5')](fs[_0x3f26('0xc6')](path[_0x3f26('0x75')](_0x39342b,_0x3c3524[_0x3f26('0x71')][_0x3f26('0x78')])));}}return{'date':moment(_0x3c3524[_0x3f26('0x8a')])[_0x3f26('0x7b')](_0x3f26('0x9e'))[_0x3f26('0xac')](),'sender':_0x3c3524[_0x3f26('0xb4')]===_0x3f26('0x62')?_0x3c3524[_0x3f26('0x7e')]?_0x3c3524['User'][_0x3f26('0x55')]:_0x3f26('0x82'):_0x3c3524[_0x3f26('0xb1')][_0x3f26('0xb2')]+(_0x3c3524[_0x3f26('0xb1')][_0x3f26('0xb3')]?'\x20'+_0x3c3524[_0x3f26('0xb1')]['lastName']:''),'body':_0x3c3524[_0x3f26('0x71')]?_0x3c3524[_0x3f26('0x71')][_0x3f26('0x78')]:_0x3c3524[_0x3f26('0x30')],'direction':_0x3c3524[_0x3f26('0xb4')]==='out'?'A':'C','secret':_0x3c3524[_0x3f26('0x8c')],'read':_0x3c3524['read'],'attachment':_0x3c3524[_0x3f26('0x71')]};})[_0x3f26('0xc7')]()};return ejs[_0x3f26('0xc8')](path[_0x3f26('0x75')](config[_0x3f26('0x76')],_0x3f26('0xad'),_0x3f26('0xc9'),_0x3f26('0xca')),{'interaction':_0x43da79})['then'](function(_0x1db557){var _0x4d208f=path[_0x3f26('0x75')](_0x39342b,_0x3f26('0xcb')+_0x48d3e5['id']+'-'+_0x2ed22b+'.pdf');var _0x47efe4={'path':_0x4d208f,'channel':_0x3f26('0xbb'),'interactionId':_0x48d3e5['id']};return pdf[_0x3f26('0xcc')](_0x1db557,_0x47efe4);})['then'](function(){return new Promise(function(_0x55e444,_0x1619c0){zipdir(_0x39342b,{'saveTo':_0x2d5006},function(_0x49fce6,_0x488b19){if(_0x49fce6)return _0x1619c0(_0x49fce6);return _0x55e444(_0x488b19);});})[_0x3f26('0x17')](function(){return new BPromise(function(_0x229b67,_0x49b3d4){rimraf(_0x39342b,function(_0x313061){if(_0x313061)_0x49b3d4(_0x313061);return _0x229b67();});});})[_0x3f26('0x17')](function(){return _0x36f4e6[_0x3f26('0x79')](_0x2d5006,_0x14fa39,function(_0x13786d){if(_0x13786d){logger[_0x3f26('0x1d')]('err',_0x13786d);}else{fs[_0x3f26('0xcd')](_0x2d5006);}});});});}else{return _0x36f4e6[_0x3f26('0x22')](0xc8);}})[_0x3f26('0x21')](handleError(_0x36f4e6,null));}; \ No newline at end of file +var _0x1c00=['jayson/promise','http','client','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','count','set','Content-Range','stack','name','send','merge','body','contact','agent','interaction','index','ChatInteraction','rawAttributes','type','getOptions','findAll','query','user','catch','model','keys','filters','attributes','fields','length','includeAll','include','find','create','params','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','update','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','User','ContactId','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','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','getMessages','ChatMessage','intersection','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','filter','map','includeAgent','addTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','Contact','firstName','lastName','direction','read','Account','Owner','N.A.','browserName','referer','customerIp','customerPort','existsSync','createWriteStream','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x4458e3,_0x54273d){var _0x3bfec0=function(_0x59fa08){while(--_0x59fa08){_0x4458e3['push'](_0x4458e3['shift']());}};_0x3bfec0(++_0x54273d);}(_0x1c00,0x191));var _0x01c0=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x1c00[_0x1cb18a];return _0x22442e;};'use strict';var rimraf=require(_0x01c0('0x0'));var zipdir=require(_0x01c0('0x1'));var rp=require(_0x01c0('0x2'));var moment=require(_0x01c0('0x3'));var BPromise=require(_0x01c0('0x4'));var Mustache=require(_0x01c0('0x5'));var util=require(_0x01c0('0x6'));var path=require(_0x01c0('0x7'));var ejs=require(_0x01c0('0x8'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x01c0('0x9'));var interaction=require(_0x01c0('0xa'));var qs=require(_0x01c0('0xb'));var pdf=require(_0x01c0('0xc'));var logger=require(_0x01c0('0xd'))(_0x01c0('0xe'));var config=require(_0x01c0('0xf'));var db=require(_0x01c0('0x10'))['db'];config[_0x01c0('0x11')]=_['defaults'](config[_0x01c0('0x11')],{'host':_0x01c0('0x12'),'port':0x18eb});var socket=require(_0x01c0('0x13'))(new Redis(config[_0x01c0('0x11')]));require(_0x01c0('0x14'))['register'](socket);var jayson=require(_0x01c0('0x15'));var client=jayson['client'][_0x01c0('0x16')]({'port':0x232b});var client9004=jayson[_0x01c0('0x17')][_0x01c0('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x3667f4,_0x1c1ccd,_0x10689b,_0x117375){return new BPromise(function(_0x46d425,_0x1ad409){var _0x5f2ab0=_0x117375||client;return _0x5f2ab0[_0x01c0('0x18')](_0x3667f4,_0x10689b)[_0x01c0('0x19')](function(_0x58435c){logger['info'](_0x01c0('0x1a'),_0x1c1ccd,_0x01c0('0x1b'));logger[_0x01c0('0x1c')](_0x01c0('0x1d'),_0x1c1ccd,_0x01c0('0x1b'),JSON[_0x01c0('0x1e')](_0x58435c));if(_0x58435c['error']){if(_0x58435c[_0x01c0('0x1f')][_0x01c0('0x20')]===0x1f4){logger[_0x01c0('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x1c1ccd,_0x58435c[_0x01c0('0x1f')][_0x01c0('0x21')]);return _0x1ad409(_0x58435c['error'][_0x01c0('0x21')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1c1ccd,_0x58435c[_0x01c0('0x1f')][_0x01c0('0x21')]);return _0x46d425(_0x58435c[_0x01c0('0x1f')][_0x01c0('0x21')]);}else{logger[_0x01c0('0x22')](_0x01c0('0x1a'),_0x1c1ccd,'request\x20sent');_0x46d425(_0x58435c[_0x01c0('0x23')]['message']);}})['catch'](function(_0x287ac0){logger[_0x01c0('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x1c1ccd,_0x287ac0);_0x1ad409(_0x287ac0);});});}function respondWithStatusCode(_0x1ed54f,_0x4775c5){_0x4775c5=_0x4775c5||0xcc;return function(_0x31be16){if(_0x31be16){return _0x1ed54f[_0x01c0('0x24')](_0x4775c5);}return _0x1ed54f[_0x01c0('0x25')](_0x4775c5)[_0x01c0('0x26')]();};}function respondWithResult(_0x1420db,_0x5b5a43){_0x5b5a43=_0x5b5a43||0xc8;return function(_0x54759a){if(_0x54759a){return _0x1420db[_0x01c0('0x25')](_0x5b5a43)[_0x01c0('0x27')](_0x54759a);}};}function respondWithFilteredResult(_0x4e4633,_0x2453fe){return function(_0x4b1036){if(_0x4b1036){var _0x124ed7=typeof _0x2453fe[_0x01c0('0x28')]==='undefined'&&typeof _0x2453fe[_0x01c0('0x29')]==='undefined';var _0x54109f=_0x4b1036[_0x01c0('0x2a')];var _0x3c2b65=_0x124ed7?0x0:_0x2453fe['offset'];var _0x5cb249=_0x124ed7?_0x4b1036['count']:_0x2453fe[_0x01c0('0x28')]+_0x2453fe['limit'];var _0x325784;if(_0x5cb249>=_0x54109f){_0x5cb249=_0x54109f;_0x325784=0xc8;}else{_0x325784=0xce;}_0x4e4633[_0x01c0('0x25')](_0x325784);return _0x4e4633[_0x01c0('0x2b')](_0x01c0('0x2c'),_0x3c2b65+'-'+_0x5cb249+'/'+_0x54109f)[_0x01c0('0x27')](_0x4b1036);}return null;};}function saveUpdates(_0x58743b){return function(_0x267624){if(_0x267624){return _0x267624['update'](_0x58743b)[_0x01c0('0x19')](function(_0x4bee03){return _0x4bee03;});}return null;};}function removeEntity(_0x154a7b){return function(_0x1bf5aa){if(_0x1bf5aa){return _0x1bf5aa['destroy']()['then'](function(){_0x154a7b[_0x01c0('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3df3ad){return function(_0x2f9799){if(!_0x2f9799){_0x3df3ad[_0x01c0('0x24')](0x194);}return _0x2f9799;};}function handleError(_0x4d1b5e,_0x5557b1){_0x5557b1=_0x5557b1||0x1f4;return function(_0xb15874){logger[_0x01c0('0x1f')](_0xb15874[_0x01c0('0x2d')]);if(_0xb15874['name']){delete _0xb15874[_0x01c0('0x2e')];}_0x4d1b5e['status'](_0x5557b1)[_0x01c0('0x2f')](_0xb15874);};}function getMustacheRender(_0x3918db,_0x2fe498){return Mustache['render'](_0x3918db,_[_0x01c0('0x30')](_0x2fe498[_0x01c0('0x31')],{'contact':_0x2fe498[_0x01c0('0x32')],'message':_0x2fe498['message'],'agent':_0x2fe498[_0x01c0('0x33')],'interaction':_0x2fe498[_0x01c0('0x34')],'account':_0x2fe498['account']}))||'';}exports[_0x01c0('0x35')]=function(_0x5deefa,_0x585184){var _0x29c50d={};var _0x5001c8=_['map'](db[_0x01c0('0x36')][_0x01c0('0x37')],function(_0x59af35){return{'name':_0x59af35['fieldName'],'type':_0x59af35[_0x01c0('0x38')]['key']};});_0x29c50d=qs[_0x01c0('0x39')](_0x5001c8,_0x5deefa);return interaction[_0x01c0('0x3a')]('chat',_0x5deefa[_0x01c0('0x3b')],_0x5deefa[_0x01c0('0x3c')],_0x29c50d,_0x5001c8)['then'](respondWithFilteredResult(_0x585184,_0x29c50d))[_0x01c0('0x3d')](handleError(_0x585184,null));};exports['show']=function(_0xb01415,_0x1dc001){var _0x548ac8={'raw':![],'where':{'id':_0xb01415['params']['id']}},_0x3bd304={};_0x3bd304[_0x01c0('0x3e')]=_[_0x01c0('0x3f')](db[_0x01c0('0x36')][_0x01c0('0x37')]);_0x3bd304[_0x01c0('0x3b')]=_[_0x01c0('0x3f')](_0xb01415[_0x01c0('0x3b')]);_0x3bd304[_0x01c0('0x40')]=_['intersection'](_0x3bd304[_0x01c0('0x3e')],_0x3bd304[_0x01c0('0x3b')]);_0x548ac8[_0x01c0('0x41')]=_['intersection'](_0x3bd304[_0x01c0('0x3e')],qs[_0x01c0('0x42')](_0xb01415[_0x01c0('0x3b')][_0x01c0('0x42')]));_0x548ac8['attributes']=_0x548ac8[_0x01c0('0x41')][_0x01c0('0x43')]?_0x548ac8[_0x01c0('0x41')]:_0x3bd304[_0x01c0('0x3e')];if(_0xb01415[_0x01c0('0x3b')][_0x01c0('0x44')]){_0x548ac8[_0x01c0('0x45')]=[{'all':!![]}];}_0x548ac8=_['merge']({},_0x548ac8,_0xb01415['options']);return db[_0x01c0('0x36')][_0x01c0('0x46')](_0x548ac8)[_0x01c0('0x19')](handleEntityNotFound(_0x1dc001,null))[_0x01c0('0x19')](respondWithResult(_0x1dc001,null))[_0x01c0('0x3d')](handleError(_0x1dc001,null));};exports[_0x01c0('0x47')]=function(_0x384f9d,_0x51e141){return db[_0x01c0('0x36')][_0x01c0('0x47')](_0x384f9d['body'],{})[_0x01c0('0x19')](respondWithResult(_0x51e141,0xc9))[_0x01c0('0x3d')](handleError(_0x51e141,null));};exports['update']=function(_0x12395d,_0x2987dd){if(_0x12395d[_0x01c0('0x31')]['id']){delete _0x12395d[_0x01c0('0x31')]['id'];}return db[_0x01c0('0x36')][_0x01c0('0x46')]({'where':{'id':_0x12395d[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x2987dd,null))[_0x01c0('0x19')](saveUpdates(_0x12395d[_0x01c0('0x31')],null))['then'](respondWithResult(_0x2987dd,null))[_0x01c0('0x3d')](handleError(_0x2987dd,null));};exports[_0x01c0('0x49')]=function(_0x158bb8,_0x56f8e0){return db[_0x01c0('0x36')][_0x01c0('0x46')]({'where':{'id':_0x158bb8[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x56f8e0,null))['then'](removeEntity(_0x56f8e0,null))[_0x01c0('0x3d')](handleError(_0x56f8e0,null));};exports['describe']=function(_0x8ce419,_0x102d22){return db['ChatInteraction'][_0x01c0('0x4a')]()[_0x01c0('0x19')](respondWithResult(_0x102d22,null))['catch'](handleError(_0x102d22,null));};exports[_0x01c0('0x4b')]=function(_0x3ab92c,_0xc9e05c){var _0x4a1c1c=_0x3ab92c[_0x01c0('0x48')]['id'];var _0x37347f;var _0x527c6a;var _0x27b6cb;return db[_0x01c0('0x36')][_0x01c0('0x4c')]({'where':{'id':_0x4a1c1c}})['then'](function(_0x50e6d3){_0x37347f=_0x50e6d3;return db[_0x01c0('0x4d')][_0x01c0('0x4c')]({'where':{'id':_0x50e6d3[_0x01c0('0x4e')]},'attributes':['id','vidaooApiKey',_0x01c0('0x4f'),_0x01c0('0x50'),_0x01c0('0x51'),_0x01c0('0x52')],'raw':!![]});})[_0x01c0('0x19')](function(_0x50baeb){if(_0x50baeb&&_0x50baeb[_0x01c0('0x53')]&&_0x50baeb[_0x01c0('0x4f')]){_0x527c6a=_0x50baeb;var _0x5884c0={'interaction':{'id':_0x4a1c1c},'agent':{'id':_0x3ab92c[_0x01c0('0x3c')]['id'],'name':_0x3ab92c[_0x01c0('0x3c')][_0x01c0('0x2e')],'fullname':_0x3ab92c['user'][_0x01c0('0x54')],'email':_0x3ab92c['user'][_0x01c0('0x55')]},'contact':_0x3ab92c[_0x01c0('0x31')][_0x01c0('0x32')],'account':_0x3ab92c[_0x01c0('0x31')]['account']};var _0x579bd3={'rejectUnauthorized':![],'method':_0x01c0('0x56'),'url':_0x01c0('0x57'),'headers':{'X-APIKEY':_0x50baeb['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3ab92c['user'][_0x01c0('0x55')]],'buttons':null,'topic':_0x527c6a[_0x01c0('0x50')],'note':_[_0x01c0('0x58')](_0x527c6a[_0x01c0('0x51')])?null:getMustacheRender(_0x527c6a['vidaooNote'],_0x5884c0),'metadata':null},'redirect':_0x01c0('0x59'),'json':!![]};try{if(!_['isNull'](_0x527c6a[_0x01c0('0x52')])){var _0x32ae74=getMustacheRender(_0x527c6a[_0x01c0('0x52')],_0x5884c0);var _0x3d9c6e=JSON[_0x01c0('0x5a')](_0x32ae74);_0x579bd3[_0x01c0('0x31')][_0x01c0('0x5b')]=_0x3d9c6e;}}catch(_0x143c88){throw new db[(_0x01c0('0x5c'))][(_0x01c0('0x5d'))](_0x01c0('0x5e'));}return rp(_0x579bd3);}else{throw new db['Sequelize'][(_0x01c0('0x5d'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x01c0('0x19')](function(_0x136bf5){_0x27b6cb=_0x136bf5;if(_0x27b6cb['id']){var _0x1ef6a1={'body':_0x27b6cb[_0x01c0('0x5f')],'ChatWebsiteId':_0x527c6a['id'],'ChatInteractionId':_0x37347f['id'],'direction':'out','UserId':_0x3ab92c[_0x01c0('0x3c')]['id']};return db['ChatMessage'][_0x01c0('0x47')](_0x1ef6a1,{});}else{throw new db[(_0x01c0('0x5c'))]['ValidationError'](_0x01c0('0x60'));}})['then'](function(){return _0x37347f[_0x01c0('0x61')]({'vidaooSessionId':_0x27b6cb['id']});})[_0x01c0('0x19')](respondWithResult(_0xc9e05c,null))['catch'](handleError(_0xc9e05c,null));};exports['customUpdate']=function(_0x12b509,_0x3d4160){if(_0x12b509[_0x01c0('0x31')]['id']){delete _0x12b509[_0x01c0('0x31')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x12b509[_0x01c0('0x48')]['id']},'include':[{'model':db[_0x01c0('0x62')],'as':'Contact'}]})[_0x01c0('0x19')](handleEntityNotFound(_0x3d4160,null))[_0x01c0('0x19')](saveUpdates(_0x12b509['body'],null))[_0x01c0('0x19')](respondWithResult(_0x3d4160,null))[_0x01c0('0x3d')](handleError(_0x3d4160,null));};exports[_0x01c0('0x63')]=function(_0x56032d,_0x2ebc94){if(_0x56032d[_0x01c0('0x31')]['id']){delete _0x56032d['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x56032d[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](function(_0x1e20fb){if(!_0x1e20fb){logger[_0x01c0('0x1f')](_0x01c0('0x64'),_0x01c0('0x63'),0x194,_0x01c0('0x65'));_0x2ebc94[_0x01c0('0x24')](0x194);}else{if(_0x1e20fb[_0x01c0('0x66')]){throw new db[(_0x01c0('0x5c'))][(_0x01c0('0x5d'))](_0x01c0('0x67'));}}return _0x1e20fb;})[_0x01c0('0x19')](function(_0x19ccd8){if(_0x19ccd8){return _0x19ccd8[_0x01c0('0x68')]({'closed':_0x56032d[_0x01c0('0x31')][_0x01c0('0x69')],'disposition':_0x56032d['body'][_0x01c0('0x6a')]})[_0x01c0('0x19')](function(_0x158d08){return _0x158d08;});}})[_0x01c0('0x19')](function(){return respondWithRpcPromise(_0x01c0('0x6b'),_0x01c0('0x63'),_0x56032d[_0x01c0('0x31')],client9004);})['then'](respondWithResult(_0x2ebc94,null))[_0x01c0('0x3d')](handleError(_0x2ebc94,null));};exports[_0x01c0('0x6c')]=function(_0x36e176,_0x53ce4d){_0x36e176[_0x01c0('0x31')]['name']=_0x36e176[_0x01c0('0x6d')][_0x01c0('0x6e')];_0x36e176['body'][_0x01c0('0x6f')]=_0x36e176[_0x01c0('0x6d')][_0x01c0('0x70')];_0x36e176[_0x01c0('0x31')][_0x01c0('0x38')]=_0x36e176['file']['mimetype'];return db[_0x01c0('0x71')][_0x01c0('0x47')](_0x36e176[_0x01c0('0x31')])[_0x01c0('0x19')](respondWithResult(_0x53ce4d,0xc9))[_0x01c0('0x3d')](handleError(_0x53ce4d,null));};exports[_0x01c0('0x72')]=function(_0x1469f2,_0x3bc3f1){return db[_0x01c0('0x36')][_0x01c0('0x4c')]({'where':{'id':_0x1469f2[_0x01c0('0x48')]['id']},'raw':!![]})[_0x01c0('0x19')](handleEntityNotFound(_0x3bc3f1,null))[_0x01c0('0x19')](function(_0x4770f8){if(_0x4770f8){if(_0x4770f8[_0x01c0('0x69')]){return _0x3bc3f1[_0x01c0('0x25')](0x193)['json']({'status':0x193,'message':_0x01c0('0x73')});}return db[_0x01c0('0x71')]['findOne']({'where':{'id':_0x1469f2['query'][_0x01c0('0x74')]},'raw':!![]})[_0x01c0('0x19')](handleEntityNotFound(_0x3bc3f1,null));}})['then'](function(_0x272deb){if(_0x272deb){var _0x2958c6=_0x272deb[_0x01c0('0x75')]!==null;var _0x2edd2b=path[_0x01c0('0x76')](config[_0x01c0('0x77')],'server/files/attachments/');if(_0x2958c6){_0x2edd2b=path[_0x01c0('0x76')](_0x2edd2b,_0x01c0('0x78'));}var _0x4349f9=path[_0x01c0('0x76')](_0x2edd2b,_0x272deb[_0x01c0('0x6f')]);return _0x3bc3f1[_0x01c0('0x79')](_0x4349f9);}})[_0x01c0('0x3d')](handleError(_0x3bc3f1,null));};exports[_0x01c0('0x7a')]=function(_0x13c308,_0x5f1bb6){var _0x413039=null;var _0x2de3ff=null;var _0x47e76e=null;if(_0x13c308['body']['id']){delete _0x13c308['body']['id'];}if(_0x13c308[_0x01c0('0x31')][_0x01c0('0x7b')]){_0x47e76e=path[_0x01c0('0x76')](config[_0x01c0('0x77')],_0x01c0('0x7c'),util[_0x01c0('0x7d')]('transcript-%s.txt',Date[_0x01c0('0x7e')]()));_0x13c308['body'][_0x01c0('0x7f')]=_0x47e76e;}return db[_0x01c0('0x36')][_0x01c0('0x46')]({'where':{'id':_0x13c308[_0x01c0('0x48')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x01c0('0x80'),'include':[{'model':db[_0x01c0('0x81')],'as':'User'}]}]})[_0x01c0('0x19')](handleEntityNotFound(_0x5f1bb6,null))['then'](saveUpdates(_0x13c308[_0x01c0('0x31')],null))['then'](function(_0x214250){if(_0x214250){_0x413039=_0x214250;return db[_0x01c0('0x4d')][_0x01c0('0x46')]({'where':{'id':_0x413039[_0x01c0('0x4e')]}});}})[_0x01c0('0x19')](function(_0x1c8841){if(_0x1c8841){_0x2de3ff=_0x1c8841;return db[_0x01c0('0x62')][_0x01c0('0x46')]({'where':{'id':_0x413039[_0x01c0('0x82')]}});}})[_0x01c0('0x19')](function(_0x14a327){if(_0x14a327){if(_0x47e76e){var _0x580dff=null;for(var _0x2ec3ea=0x1;_0x2ec3ea<_0x413039['Messages'][_0x01c0('0x43')];++_0x2ec3ea){_0x580dff=_0x413039[_0x01c0('0x80')][_0x2ec3ea];var _0x121990=_0x580dff['UserId']?util[_0x01c0('0x7d')]('%s%d',_0x2de3ff['agentAlias'],_0x580dff[_0x01c0('0x66')]):_0x01c0('0x83');var _0x287af3=_0x13c308[_0x01c0('0x31')][_0x01c0('0x84')]||util[_0x01c0('0x7d')](_0x01c0('0x85'),_0x01c0('0x86'),_0x580dff[_0x01c0('0x82')]);switch(_0x2de3ff[_0x01c0('0x87')]){case _0x01c0('0x88'):_0x121990=_0x580dff[_0x01c0('0x66')]?util[_0x01c0('0x7d')](_0x01c0('0x85'),_0x2de3ff[_0x01c0('0x89')],_0x580dff[_0x01c0('0x66')]):'System';break;case'agent_alias':_0x121990=_0x580dff['UserId']?_0x580dff[_0x01c0('0x81')][_0x01c0('0x8a')]||_0x580dff[_0x01c0('0x81')][_0x01c0('0x54')]:_0x01c0('0x83');break;case _0x01c0('0x8b'):_0x121990=_0x580dff[_0x01c0('0x66')]?_0x580dff['User'][_0x01c0('0x54')]:_0x01c0('0x83');break;default:_0x121990=_0x580dff[_0x01c0('0x66')]?util['format']('%s%d',_0x2de3ff[_0x01c0('0x89')],_0x580dff[_0x01c0('0x66')]):'System';}var _0x44cc70=util['format'](_0x01c0('0x8c'),moment(_0x580dff[_0x01c0('0x8d')])[_0x01c0('0x7d')](_0x01c0('0x8e')),_0x580dff['direction']==='in'?_0x287af3:_0x121990,_0x580dff[_0x01c0('0x31')]);if(!_0x580dff[_0x01c0('0x8f')]){fs['appendFileSync'](_0x47e76e,_0x44cc70);}}return db[_0x01c0('0x90')][_0x01c0('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x01c0('0x91')],'as':_0x01c0('0x92'),'raw':!![],'include':[{'model':db[_0x01c0('0x93')],'as':_0x01c0('0x93'),'raw':!![]}]}]});}}})[_0x01c0('0x19')](function(_0x1b10b9){if(!_0x1b10b9||!_0x1b10b9[_0x01c0('0x92')]||!_0x13c308[_0x01c0('0x31')])return _0x413039;var _0x5dcfe2=_0x1b10b9[_0x01c0('0x94')]();return respondWithRpcPromise('SendMail',_0x01c0('0x95'),{'account':_0x5dcfe2,'message':{'from':util[_0x01c0('0x7d')](_0x01c0('0x96'),_0x1b10b9[_0x01c0('0x2e')],_0x1b10b9[_0x01c0('0x55')]||_0x1b10b9['Smtp']['user']),'to':_0x13c308[_0x01c0('0x31')][_0x01c0('0x7b')],'subject':_0x01c0('0x97'),'text':util[_0x01c0('0x7d')](_0x01c0('0x98'),_0x13c308[_0x01c0('0x31')][_0x01c0('0x7b')]),'attachments':[{'path':_0x47e76e}]}})[_0x01c0('0x19')](function(){return _0x413039;})[_0x01c0('0x3d')](function(_0x37195c){logger[_0x01c0('0x1f')](_0x37195c);});})[_0x01c0('0x19')](respondWithStatusCode(_0x5f1bb6,0xc8))[_0x01c0('0x3d')](handleError(_0x5f1bb6,null));};exports[_0x01c0('0x99')]=function(_0x55cff,_0x20afb6){return db['ChatMessage'][_0x01c0('0x46')]({'where':{'id':_0x55cff[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x20afb6,null))[_0x01c0('0x19')](function(_0xc5be7a){if(_0xc5be7a){return _0xc5be7a['addMessage'](_0x55cff[_0x01c0('0x31')][_0x01c0('0x9a')],_[_0x01c0('0x9b')](_0x55cff[_0x01c0('0x31')],['ids','id'])||{});}})[_0x01c0('0x19')](respondWithResult(_0x20afb6,null))['catch'](handleError(_0x20afb6,null));};exports[_0x01c0('0x9c')]=function(_0x411111,_0x3b6149){var _0x4762c9={'raw':![],'where':{}};var _0x1974cc={};var _0x3d2fc6={'count':0x0,'rows':[]};return db[_0x01c0('0x36')][_0x01c0('0x4c')]({'where':{'id':_0x411111['params']['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x3b6149,null))[_0x01c0('0x19')](function(_0x4333f8){if(_0x4333f8){_0x1974cc['model']=_[_0x01c0('0x3f')](db[_0x01c0('0x9d')]['rawAttributes']);_0x1974cc[_0x01c0('0x3b')]=_['keys'](_0x411111[_0x01c0('0x3b')]);_0x1974cc[_0x01c0('0x40')]=_[_0x01c0('0x9e')](_0x1974cc[_0x01c0('0x3e')],_0x1974cc['query']);_0x4762c9[_0x01c0('0x41')]=_[_0x01c0('0x9e')](_0x1974cc[_0x01c0('0x3e')],qs[_0x01c0('0x42')](_0x411111[_0x01c0('0x3b')]['fields']));_0x4762c9[_0x01c0('0x41')]=_0x4762c9['attributes'][_0x01c0('0x43')]?_0x4762c9[_0x01c0('0x41')]:_0x1974cc[_0x01c0('0x3e')];if(!_0x411111['query'][_0x01c0('0x9f')](_0x01c0('0xa0'))){_0x4762c9[_0x01c0('0x29')]=qs[_0x01c0('0x29')](_0x411111['query'][_0x01c0('0x29')]);_0x4762c9[_0x01c0('0x28')]=qs['offset'](_0x411111[_0x01c0('0x3b')][_0x01c0('0x28')]);}_0x4762c9[_0x01c0('0xa1')]=qs[_0x01c0('0xa2')](_0x411111['query'][_0x01c0('0xa2')]);_0x4762c9[_0x01c0('0xa3')]=qs[_0x01c0('0x40')](_[_0x01c0('0xa4')](_0x411111[_0x01c0('0x3b')],_0x1974cc[_0x01c0('0x40')]));_0x4762c9[_0x01c0('0xa3')][_0x01c0('0xa5')]=_0x4333f8['id'];if(_0x411111[_0x01c0('0x3b')]['filter']){_0x4762c9[_0x01c0('0xa3')]=_[_0x01c0('0x30')](_0x4762c9[_0x01c0('0xa3')],{'$or':_['map'](_0x4762c9['attributes'],function(_0x4832f7){var _0x322084={};_0x322084[_0x4832f7]={'$like':'%'+_0x411111[_0x01c0('0x3b')]['filter']+'%'};return _0x322084;})});}if(_0x411111[_0x01c0('0x3b')]['$gte']){var _0x41b7aa=_0x411111[_0x01c0('0x3b')][_0x01c0('0xa6')][_0x01c0('0xa7')](',');var _0x4a5a78={};_0x4a5a78[_0x41b7aa[0x0]]={'$gte':moment(_0x41b7aa[0x1])[_0x01c0('0x7d')](_0x01c0('0xa8'))};_0x4762c9[_0x01c0('0xa3')]=_[_0x01c0('0x30')](_0x4762c9[_0x01c0('0xa3')],_0x4a5a78);}_0x4762c9=_[_0x01c0('0x30')]({},_0x4762c9,_0x411111[_0x01c0('0xa9')]);return db[_0x01c0('0x9d')][_0x01c0('0x2a')]({'where':_0x4762c9[_0x01c0('0xa3')]})['then'](function(_0x20e1fc){_0x3d2fc6[_0x01c0('0x2a')]=_0x20e1fc;if(_0x411111[_0x01c0('0x3b')][_0x01c0('0x44')]){_0x4762c9[_0x01c0('0x45')]=[{'all':!![]}];}return db[_0x01c0('0x9d')][_0x01c0('0x3a')](_0x4762c9);})[_0x01c0('0x19')](function(_0x403bbe){_0x3d2fc6['rows']=_0x403bbe;return _0x3d2fc6;});}})[_0x01c0('0x19')](respondWithFilteredResult(_0x3b6149,_0x4762c9))['catch'](handleError(_0x3b6149,null));};exports[_0x01c0('0xaa')]=function(_0x276810,_0x40c3a7){var _0x403722={'where':{}},_0x40675c={},_0x339cdb={'count':0x0,'rows':[]};return db[_0x01c0('0x36')][_0x01c0('0x4c')]({'where':{'id':_0x276810[_0x01c0('0x48')]['id']}})['then'](handleEntityNotFound(_0x40c3a7,null))[_0x01c0('0x19')](function(_0x4d951d){if(_0x4d951d){_0x40675c[_0x01c0('0x3e')]=_[_0x01c0('0x3f')](db[_0x01c0('0x9d')][_0x01c0('0x37')]);_0x40675c['query']=_[_0x01c0('0x3f')](_0x276810[_0x01c0('0x3b')]);_0x40675c[_0x01c0('0x40')]=_['intersection'](_0x40675c[_0x01c0('0x3e')],_0x40675c[_0x01c0('0x3b')]);_0x403722[_0x01c0('0x41')]=_[_0x01c0('0x9e')](_0x40675c['model'],qs[_0x01c0('0x42')](_0x276810[_0x01c0('0x3b')][_0x01c0('0x42')]));_0x403722[_0x01c0('0x41')]=_0x403722[_0x01c0('0x41')][_0x01c0('0x43')]?_0x403722[_0x01c0('0x41')]:_0x40675c[_0x01c0('0x3e')];if(!_0x276810['query']['hasOwnProperty']('nolimit')){_0x403722['limit']=qs[_0x01c0('0x29')](_0x276810['query'][_0x01c0('0x29')]);_0x403722['offset']=qs['offset'](_0x276810[_0x01c0('0x3b')]['offset']);}_0x403722[_0x01c0('0xa1')]=qs[_0x01c0('0xa2')](_0x276810[_0x01c0('0x3b')][_0x01c0('0xa2')]);_0x403722[_0x01c0('0xa3')]=qs[_0x01c0('0x40')](_['pick'](_0x276810['query'],_0x40675c[_0x01c0('0x40')]));_0x403722[_0x01c0('0xa3')][_0x01c0('0xa5')]=_0x4d951d['id'];if(_0x276810[_0x01c0('0x3b')][_0x01c0('0xab')]){_0x403722[_0x01c0('0xa3')]=_[_0x01c0('0x30')](_0x403722[_0x01c0('0xa3')],{'$or':_[_0x01c0('0xac')](_0x403722[_0x01c0('0x41')],function(_0x1969ae){var _0x1e47d7={};_0x1e47d7[_0x1969ae]={'$like':'%'+_0x276810[_0x01c0('0x3b')][_0x01c0('0xab')]+'%'};return _0x1e47d7;})});}_0x403722[_0x01c0('0xa3')][_0x01c0('0x8f')]=![];if(_0x276810[_0x01c0('0x3b')]['id']){_0x403722[_0x01c0('0xa3')]['id']={'$gt':_0x276810[_0x01c0('0x3b')]['id']};}_0x403722=_['merge']({},_0x403722,_0x276810[_0x01c0('0xa9')]);return db[_0x01c0('0x9d')][_0x01c0('0x2a')]({'where':_0x403722[_0x01c0('0xa3')]})['then'](function(_0x22f8a4){_0x339cdb['count']=_0x22f8a4;_0x403722['include']=[];if(_0x276810['query'][_0x01c0('0xad')]){_0x403722[_0x01c0('0x45')]['push']({'model':db[_0x01c0('0x81')],'as':_0x01c0('0x81'),'attributes':['id',_0x01c0('0x54'),_0x01c0('0x8a')]});}if(_0x276810['query'][_0x01c0('0x44')]){_0x403722['include']=[{'all':!![]}];}return db[_0x01c0('0x9d')][_0x01c0('0x3a')](_0x403722);})['then'](function(_0x450c69){_0x339cdb['rows']=_0x450c69;return _0x339cdb;});}})['then'](respondWithFilteredResult(_0x40c3a7,_0x403722))['catch'](handleError(_0x40c3a7,null));};exports[_0x01c0('0xae')]=function(_0x58f286,_0x1063eb){return db[_0x01c0('0x36')]['find']({'where':{'id':_0x58f286[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x1063eb,null))[_0x01c0('0x19')](function(_0x57cbfe){if(_0x57cbfe){return _0x57cbfe['setTags'](_0x58f286[_0x01c0('0x31')]['ids'],_[_0x01c0('0x9b')](_0x58f286[_0x01c0('0x31')],[_0x01c0('0x9a'),'id'])||{})['spread'](function(){return db[_0x01c0('0xaf')]['findAll']({'attributes':['id',_0x01c0('0x2e'),_0x01c0('0xb0')],'where':{'id':_0x58f286[_0x01c0('0x31')]['ids']}});})[_0x01c0('0x19')](function(_0x5c857c){socket[_0x01c0('0xb1')](_0x01c0('0xb2'),{'id':Number(_0x58f286[_0x01c0('0x48')]['id']),'tags':_0x5c857c||[]});return{'id':Number(_0x58f286[_0x01c0('0x48')]['id']),'tags':_0x5c857c||[]};});}})['then'](respondWithResult(_0x1063eb,null))[_0x01c0('0x3d')](handleError(_0x1063eb,null));};exports[_0x01c0('0xb3')]=function(_0x348a41,_0x473f39){return db[_0x01c0('0x36')][_0x01c0('0x46')]({'where':{'id':_0x348a41[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x473f39,null))[_0x01c0('0x19')](function(_0x4326af){if(_0x4326af){return _0x4326af[_0x01c0('0xb3')](_0x348a41['query']['ids']);}})[_0x01c0('0x19')](respondWithStatusCode(_0x473f39,null))['catch'](handleError(_0x473f39,null));};exports[_0x01c0('0x79')]=function(_0x4b4709,_0x933634){var _0x237cf8=moment()[_0x01c0('0xb4')]()[_0x01c0('0xb5')]();var _0x3ef373=path[_0x01c0('0x76')](config[_0x01c0('0x77')],_0x01c0('0xb6'),_0x01c0('0xb7'),_0x01c0('0xb8'));var _0xab0a4f=path[_0x01c0('0x76')](config[_0x01c0('0x77')],_0x01c0('0xb6'),_0x01c0('0xb7'),_0x01c0('0xb9'));var _0x484d78=path[_0x01c0('0x76')](_0x3ef373,_0x237cf8);var _0x453b29=util[_0x01c0('0x7d')](_0x01c0('0xba'),_0x4b4709[_0x01c0('0x48')]['id'],_0x237cf8);var _0x2a9de8=path[_0x01c0('0x76')](_0x3ef373,_0x453b29);var _0xdfd3f6=[];_0xdfd3f6[_0x01c0('0xbb')]({'model':db[_0x01c0('0x81')],'as':_0x01c0('0x81'),'attributes':['id',_0x01c0('0x54')],'raw':!![]});_0xdfd3f6[_0x01c0('0xbb')]({'model':db['CmContact'],'as':_0x01c0('0xbc'),'attributes':['id',_0x01c0('0xbd'),_0x01c0('0xbe')],'raw':!![]});if(_0x4b4709[_0x01c0('0x3b')]['attachments']){_0xdfd3f6[_0x01c0('0xbb')]({'model':db[_0x01c0('0x71')],'as':_0x01c0('0x71'),'raw':!![]});}var _0x23bd47=[{'model':db[_0x01c0('0x9d')],'as':'Messages','attributes':['id',_0x01c0('0x31'),_0x01c0('0x8d'),_0x01c0('0xbf'),_0x01c0('0x8f'),_0x01c0('0xc0')],'include':_0xdfd3f6}];_0x23bd47[_0x01c0('0xbb')]({'model':db[_0x01c0('0x4d')],'as':_0x01c0('0xc1'),'attributes':['id',_0x01c0('0x2e')]});_0x23bd47[_0x01c0('0xbb')]({'model':db['User'],'as':_0x01c0('0xc2'),'attributes':['id',_0x01c0('0x54')]});return db[_0x01c0('0x36')][_0x01c0('0x46')]({'where':{'id':_0x4b4709[_0x01c0('0x48')]['id']},'include':_0x23bd47})[_0x01c0('0x19')](handleEntityNotFound(_0x933634,null))[_0x01c0('0x19')](function(_0x323abe){if(_0x323abe){var _0x55a703=_0x323abe['get']({'plain':!![]});fs['mkdirSync'](_0x484d78);var _0x17903e={'channel':'Chat','account':_0x55a703[_0x01c0('0xc1')][_0x01c0('0x2e')],'agent':_0x55a703[_0x01c0('0xc2')]?_0x55a703['Owner'][_0x01c0('0x54')]:_0x01c0('0xc3'),'createdAt':moment(_0x55a703[_0x01c0('0x8d')])[_0x01c0('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x01c0('0xb5')](),'closedAt':_0x55a703[_0x01c0('0x69')]?moment(_0x55a703['closedAt'])['format'](_0x01c0('0xa8'))[_0x01c0('0xb5')]():'','disposition':_0x55a703['disposition'],'chatInfo':{'browser':_0x55a703[_0x01c0('0xc4')],'os':_0x55a703['osName'],'referer':_0x55a703[_0x01c0('0xc5')],'customerIp':_0x55a703[_0x01c0('0xc6')],'customerPort':_0x55a703[_0x01c0('0xc7')]?_0x55a703[_0x01c0('0xc7')]:_0x01c0('0xc3')},'messages':_(_0x55a703[_0x01c0('0x80')])['tail']()['filter']({'secret':![]})[_0x01c0('0xac')](function(_0x34d14a){if(_0x34d14a['Attachment']){var _0x10d697=path[_0x01c0('0x76')](_0xab0a4f,_0x34d14a[_0x01c0('0x71')][_0x01c0('0x6f')]);if(fs[_0x01c0('0xc8')](_0x10d697)){fs['createReadStream'](_0x10d697)['pipe'](fs[_0x01c0('0xc9')](path[_0x01c0('0x76')](_0x484d78,_0x34d14a[_0x01c0('0x71')]['basename'])));}}return{'date':moment(_0x34d14a[_0x01c0('0x8d')])[_0x01c0('0x7d')](_0x01c0('0xa8'))[_0x01c0('0xb5')](),'sender':_0x34d14a[_0x01c0('0xbf')]===_0x01c0('0xca')?_0x34d14a[_0x01c0('0x81')]?_0x34d14a['User'][_0x01c0('0x54')]:_0x01c0('0x83'):_0x34d14a[_0x01c0('0xbc')][_0x01c0('0xbd')]+(_0x34d14a[_0x01c0('0xbc')][_0x01c0('0xbe')]?'\x20'+_0x34d14a[_0x01c0('0xbc')][_0x01c0('0xbe')]:''),'body':_0x34d14a['Attachment']?_0x34d14a[_0x01c0('0x71')][_0x01c0('0x6f')]:_0x34d14a[_0x01c0('0x31')],'direction':_0x34d14a[_0x01c0('0xbf')]===_0x01c0('0xca')?'A':'C','secret':_0x34d14a[_0x01c0('0x8f')],'read':_0x34d14a[_0x01c0('0xc0')],'attachment':_0x34d14a[_0x01c0('0x71')]};})[_0x01c0('0xcb')]()};return ejs[_0x01c0('0xcc')](path[_0x01c0('0x76')](config['root'],_0x01c0('0xb6'),_0x01c0('0xcd'),_0x01c0('0xce')),{'interaction':_0x17903e})[_0x01c0('0x19')](function(_0x188bdc){var _0x3a4b53=path['join'](_0x484d78,_0x01c0('0xcf')+_0x55a703['id']+'-'+_0x237cf8+_0x01c0('0xd0'));var _0x130a2b={'path':_0x3a4b53,'channel':_0x01c0('0xd1'),'interactionId':_0x55a703['id']};return pdf['createPdfFromHTML'](_0x188bdc,_0x130a2b);})[_0x01c0('0x19')](function(){return new Promise(function(_0x1257c2,_0x312114){zipdir(_0x484d78,{'saveTo':_0x2a9de8},function(_0x719e96,_0x24e9de){if(_0x719e96)return _0x312114(_0x719e96);return _0x1257c2(_0x24e9de);});})[_0x01c0('0x19')](function(){return new BPromise(function(_0xb11820,_0x4d105b){rimraf(_0x484d78,function(_0x33175e){if(_0x33175e)_0x4d105b(_0x33175e);return _0xb11820();});});})[_0x01c0('0x19')](function(){return _0x933634[_0x01c0('0x79')](_0x2a9de8,_0x453b29,function(_0x51e41c){if(_0x51e41c){logger[_0x01c0('0x1f')]('err',_0x51e41c);}else{fs[_0x01c0('0xd2')](_0x2a9de8);}});});});}else{return _0x933634[_0x01c0('0x24')](0xc8);}})['catch'](handleError(_0x933634,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 06cd63f..833c57e 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 _0xe68e=['exports','events','ChatInteraction','../../mysqldb','ChatMessage','save','update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','hasOwnProperty'];(function(_0x448313,_0x2b5e0f){var _0x3740be=function(_0x130a0d){while(--_0x130a0d){_0x448313['push'](_0x448313['shift']());}};_0x3740be(++_0x2b5e0f);}(_0xe68e,0x131));var _0xee68=function(_0x5ea2f9,_0x320917){_0x5ea2f9=_0x5ea2f9-0x0;var _0x36e586=_0xe68e[_0x5ea2f9];return _0x36e586;};'use strict';var EventEmitter=require(_0xee68('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xee68('0x1')];var ChatMessage=require(_0xee68('0x2'))['db'][_0xee68('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xee68('0x4'),'afterUpdate':_0xee68('0x5'),'afterDestroy':_0xee68('0x6')};function emitEvent(_0x39c505){return function(_0x168049,_0x2de35f,_0x46ff23){_0x168049[_0xee68('0x7')]({'attributes':['id'],'raw':!![]})[_0xee68('0x8')](function(_0x50f6ab){_0x168049[_0xee68('0x9')](_0xee68('0xa'),_0x50f6ab['map'](function(_0x265736){return{'id':_0x265736['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x168049['id'],'direction':'in','read':![]},'raw':!![]});})[_0xee68('0x8')](function(_0x5a5a7b){_0x168049['setDataValue'](_0xee68('0xb'),_0x5a5a7b[_0xee68('0xc')]);ChatInteractionEvents['emit'](_0x39c505+':'+_0x168049['id'],_0x168049);ChatInteractionEvents[_0xee68('0xd')](_0x39c505,_0x168049);_0x46ff23(null);})['catch'](_0x46ff23(null));};}for(var e in events){if(events[_0xee68('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xee68('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0x2a81=['update','remove','setDataValue','Users','map','findAll','then','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','save'];(function(_0x14b708,_0x312684){var _0x570268=function(_0x4953e0){while(--_0x4953e0){_0x14b708['push'](_0x14b708['shift']());}};_0x570268(++_0x312684);}(_0x2a81,0x1d8));var _0x12a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a81[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x12a8('0x0'))['db'][_0x12a8('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x12a8('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x12a8('0x3'),'afterUpdate':_0x12a8('0x4'),'afterDestroy':_0x12a8('0x5')};function emitEvent(_0x48af7b){return function(_0x11f4e9,_0x267bf3,_0x34c3a7){_0x11f4e9['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1e8729){_0x11f4e9[_0x12a8('0x6')](_0x12a8('0x7'),_0x1e8729[_0x12a8('0x8')](function(_0x2c9a08){return{'id':_0x2c9a08['id']};}));return ChatMessage[_0x12a8('0x9')]({'where':{'ChatInteractionId':_0x11f4e9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x12a8('0xa')](function(_0x147510){_0x11f4e9['setDataValue']('unreadMessages',_0x147510[_0x12a8('0xb')]);ChatInteractionEvents[_0x12a8('0xc')](_0x48af7b+':'+_0x11f4e9['id'],_0x11f4e9);ChatInteractionEvents['emit'](_0x48af7b,_0x11f4e9);_0x34c3a7(null);})[_0x12a8('0xd')](_0x34c3a7(null));};}for(var e in events){if(events[_0x12a8('0xe')](e)){var event=events[e];ChatInteraction[_0x12a8('0xf')](e,emitEvent(event));}}module[_0x12a8('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 005a215..bd6a63d 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 _0x9349=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash'];(function(_0x1e7aff,_0x1c843b){var _0x2a16bf=function(_0x2eceee){while(--_0x2eceee){_0x1e7aff['push'](_0x1e7aff['shift']());}};_0x2a16bf(++_0x1c843b);}(_0x9349,0x19d));var _0x9934=function(_0x40507a,_0x110395){_0x40507a=_0x40507a-0x0;var _0x4f72de=_0x9349[_0x40507a];return _0x4f72de;};'use strict';var _=require(_0x9934('0x0'));var util=require(_0x9934('0x1'));var logger=require(_0x9934('0x2'))(_0x9934('0x3'));var moment=require(_0x9934('0x4'));var BPromise=require('bluebird');var rp=require(_0x9934('0x5'));var fs=require('fs');var path=require(_0x9934('0x6'));var rimraf=require(_0x9934('0x7'));var config=require(_0x9934('0x8'));var attributes=require(_0x9934('0x9'));module[_0x9934('0xa')]=function(_0x4b8665,_0x3d12c9){return _0x4b8665[_0x9934('0xb')](_0x9934('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x735792,_0x16f889,_0x1d0931){if(_0x735792['changed'](_0x9934('0xd'))){_0x735792[_0x9934('0xe')]=moment()[_0x9934('0xf')](_0x9934('0x10'));}_0x1d0931(null,_0x735792);}},'charset':'utf8mb4','collate':_0x9934('0x11')});}; \ No newline at end of file +var _0x37cb=['ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','define'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x37cb,0x142));var _0xb37c=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x37cb[_0x525c7b];return _0x27b33e;};'use strict';var _=require('lodash');var util=require(_0xb37c('0x0'));var logger=require(_0xb37c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb37c('0x2'));var rp=require(_0xb37c('0x3'));var fs=require('fs');var path=require(_0xb37c('0x4'));var rimraf=require('rimraf');var config=require(_0xb37c('0x5'));var attributes=require(_0xb37c('0x6'));module['exports']=function(_0x19e56a,_0xb98122){return _0x19e56a[_0xb37c('0x7')](_0xb37c('0x8'),attributes,{'tableName':_0xb37c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x161403,_0x361570,_0x449417){if(_0x161403[_0xb37c('0xa')](_0xb37c('0xb'))){_0x161403[_0xb37c('0xc')]=moment()['format'](_0xb37c('0xd'));}_0x449417(null,_0x161403);}},'charset':'utf8mb4','collate':_0xb37c('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index ed75474..ab66630 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 _0xc7fe=['request\x20sent','stringify','error','code','message','result','catch','options','where','attributes','limit','UpdateChatInteraction','debug','ChatInteraction','find','addTags','body','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s'];(function(_0x2b522e,_0xf42ddc){var _0x3ade0e=function(_0x4f5028){while(--_0x4f5028){_0x2b522e['push'](_0x2b522e['shift']());}};_0x3ade0e(++_0xf42ddc);}(_0xc7fe,0xd2));var _0xec7f=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0xc7fe[_0x41c381];return _0x427981;};'use strict';var _=require(_0xec7f('0x0'));var util=require(_0xec7f('0x1'));var moment=require(_0xec7f('0x2'));var BPromise=require(_0xec7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec7f('0x4'))['db'];var utils=require(_0xec7f('0x5'));var logger=require('../../config/logger')(_0xec7f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xec7f('0x7')][_0xec7f('0x8')]({'port':0x232a});config[_0xec7f('0x9')]=_[_0xec7f('0xa')](config[_0xec7f('0x9')],{'host':_0xec7f('0xb'),'port':0x18eb});var socket=require(_0xec7f('0xc'))(new Redis(config[_0xec7f('0x9')]));require(_0xec7f('0xd'))['register'](socket);function respondWithRpcPromise(_0x2529f0,_0x2218f8,_0x109aa0){return new BPromise(function(_0x51db89,_0x52bc1a){return client[_0xec7f('0xe')](_0x2529f0,_0x109aa0)[_0xec7f('0xf')](function(_0x269779){logger[_0xec7f('0x10')](_0xec7f('0x11'),_0x2218f8,_0xec7f('0x12'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2218f8,'request\x20sent',JSON[_0xec7f('0x13')](_0x269779));if(_0x269779['error']){if(_0x269779[_0xec7f('0x14')][_0xec7f('0x15')]===0x1f4){logger['error'](_0xec7f('0x11'),_0x2218f8,_0x269779[_0xec7f('0x14')]['message']);return _0x52bc1a(_0x269779[_0xec7f('0x14')][_0xec7f('0x16')]);}logger[_0xec7f('0x14')](_0xec7f('0x11'),_0x2218f8,_0x269779[_0xec7f('0x14')][_0xec7f('0x16')]);return _0x51db89(_0x269779[_0xec7f('0x14')][_0xec7f('0x16')]);}else{logger[_0xec7f('0x10')](_0xec7f('0x11'),_0x2218f8,_0xec7f('0x12'));_0x51db89(_0x269779[_0xec7f('0x17')]['message']);}})[_0xec7f('0x18')](function(_0x26fce1){logger[_0xec7f('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2218f8,_0x26fce1);_0x52bc1a(_0x26fce1);});});}exports['UpdateChatInteraction']=function(_0x449268){var _0x538f51=this;return new Promise(function(_0x1f1e06,_0x5277b5){return db['ChatInteraction']['update'](_0x449268['body'],{'raw':_0x449268[_0xec7f('0x19')]?_0x449268[_0xec7f('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x449268[_0xec7f('0x19')]?_0x449268[_0xec7f('0x19')][_0xec7f('0x1a')]||null:null,'attributes':_0x449268[_0xec7f('0x19')]?_0x449268[_0xec7f('0x19')][_0xec7f('0x1b')]||null:null,'limit':_0x449268[_0xec7f('0x19')]?_0x449268[_0xec7f('0x19')][_0xec7f('0x1c')]||null:null})[_0xec7f('0xf')](function(_0x44a520){logger[_0xec7f('0x10')](_0xec7f('0x1d'),_0x449268);logger[_0xec7f('0x1e')](_0xec7f('0x1d'),_0x449268,JSON['stringify'](_0x44a520));_0x1f1e06(_0x44a520);})[_0xec7f('0x18')](function(_0x5f1241){logger[_0xec7f('0x14')]('UpdateChatInteraction',_0x5f1241[_0xec7f('0x16')],_0x449268);_0x5277b5(_0x538f51[_0xec7f('0x14')](0x1f4,_0x5f1241[_0xec7f('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x3dc91a){return new Promise(function(_0x22c687,_0x3f59c1){return db[_0xec7f('0x1f')][_0xec7f('0x20')]({'where':_0x3dc91a[_0xec7f('0x19')]?_0x3dc91a[_0xec7f('0x19')][_0xec7f('0x1a')]||null:null})[_0xec7f('0xf')](function(_0x5253ab){if(_0x5253ab){return _0x5253ab[_0xec7f('0x21')](_0x3dc91a[_0xec7f('0x22')]['ids'],_[_0xec7f('0x23')](_0x3dc91a[_0xec7f('0x22')],['ids','id'])||{});}})[_0xec7f('0x24')](function(_0x3096f4){logger['info'](_0xec7f('0x25'),_0x3dc91a);logger[_0xec7f('0x1e')](_0xec7f('0x25'),_0x3dc91a,JSON['stringify'](_0x3096f4));_0x22c687(_0x3096f4);})['catch'](function(_0x326acb){logger[_0xec7f('0x14')](_0xec7f('0x25'),_0x326acb[_0xec7f('0x16')],_0x3dc91a);_0x3f59c1(_this[_0xec7f('0x14')](0x1f4,_0x326acb['message']));});});}; \ No newline at end of file +var _0x56b9=['spread','AddTags','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','debug','catch','AddTagsToChatInteraction','find','addTags','ids'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56b9,0x121));var _0x956b=function(_0x1effc9,_0x4496d1){_0x1effc9=_0x1effc9-0x0;var _0x1cb7e5=_0x56b9[_0x1effc9];return _0x1cb7e5;};'use strict';var _=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var moment=require(_0x956b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x956b('0x3'))['db'];var utils=require(_0x956b('0x4'));var logger=require(_0x956b('0x5'))(_0x956b('0x6'));var config=require(_0x956b('0x7'));var jayson=require(_0x956b('0x8'));var client=jayson[_0x956b('0x9')][_0x956b('0xa')]({'port':0x232a});config['redis']=_[_0x956b('0xb')](config[_0x956b('0xc')],{'host':_0x956b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')[_0x956b('0xe')](socket);function respondWithRpcPromise(_0x400f64,_0x4f16eb,_0x30329e){return new BPromise(function(_0x15b924,_0x3424e6){return client[_0x956b('0xf')](_0x400f64,_0x30329e)[_0x956b('0x10')](function(_0x547af1){logger[_0x956b('0x11')](_0x956b('0x12'),_0x4f16eb,'request\x20sent');logger['debug'](_0x956b('0x13'),_0x4f16eb,_0x956b('0x14'),JSON[_0x956b('0x15')](_0x547af1));if(_0x547af1[_0x956b('0x16')]){if(_0x547af1[_0x956b('0x16')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4f16eb,_0x547af1[_0x956b('0x16')][_0x956b('0x17')]);return _0x3424e6(_0x547af1[_0x956b('0x16')][_0x956b('0x17')]);}logger['error'](_0x956b('0x12'),_0x4f16eb,_0x547af1[_0x956b('0x16')]['message']);return _0x15b924(_0x547af1['error'][_0x956b('0x17')]);}else{logger[_0x956b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x4f16eb,_0x956b('0x14'));_0x15b924(_0x547af1[_0x956b('0x18')][_0x956b('0x17')]);}})['catch'](function(_0x248d08){logger[_0x956b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x4f16eb,_0x248d08);_0x3424e6(_0x248d08);});});}exports[_0x956b('0x19')]=function(_0xb0587c){var _0x5dcf12=this;return new Promise(function(_0x1a0340,_0x1f49b6){return db[_0x956b('0x1a')]['update'](_0xb0587c[_0x956b('0x1b')],{'raw':_0xb0587c[_0x956b('0x1c')]?_0xb0587c[_0x956b('0x1c')][_0x956b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb0587c['options']?_0xb0587c[_0x956b('0x1c')][_0x956b('0x1e')]||null:null,'attributes':_0xb0587c['options']?_0xb0587c[_0x956b('0x1c')][_0x956b('0x1f')]||null:null,'limit':_0xb0587c['options']?_0xb0587c[_0x956b('0x1c')][_0x956b('0x20')]||null:null})[_0x956b('0x10')](function(_0x243834){logger[_0x956b('0x11')]('UpdateChatInteraction',_0xb0587c);logger[_0x956b('0x21')]('UpdateChatInteraction',_0xb0587c,JSON[_0x956b('0x15')](_0x243834));_0x1a0340(_0x243834);})[_0x956b('0x22')](function(_0x5b0dea){logger[_0x956b('0x16')](_0x956b('0x19'),_0x5b0dea[_0x956b('0x17')],_0xb0587c);_0x1f49b6(_0x5dcf12['error'](0x1f4,_0x5b0dea[_0x956b('0x17')]));});});};exports[_0x956b('0x23')]=function(_0x3a3b60){return new Promise(function(_0x4abc5f,_0x162776){return db['ChatInteraction'][_0x956b('0x24')]({'where':_0x3a3b60[_0x956b('0x1c')]?_0x3a3b60[_0x956b('0x1c')][_0x956b('0x1e')]||null:null})['then'](function(_0x18e86c){if(_0x18e86c){return _0x18e86c[_0x956b('0x25')](_0x3a3b60[_0x956b('0x1b')][_0x956b('0x26')],_['omit'](_0x3a3b60[_0x956b('0x1b')],['ids','id'])||{});}})[_0x956b('0x27')](function(_0x3fed1d){logger['info'](_0x956b('0x28'),_0x3a3b60);logger[_0x956b('0x21')]('AddTags',_0x3a3b60,JSON[_0x956b('0x15')](_0x3fed1d));_0x4abc5f(_0x3fed1d);})[_0x956b('0x22')](function(_0x4d0042){logger[_0x956b('0x16')](_0x956b('0x28'),_0x4d0042['message'],_0x3a3b60);_0x162776(_this[_0x956b('0x16')](0x1f4,_0x4d0042['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index f7384c5..858a24f 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 _0xaa3f=['register','length','chatInteraction:','./chatInteraction.events','remove','update','emit','removeListener'];(function(_0x1b4af6,_0xd59625){var _0x105d96=function(_0x31995e){while(--_0x31995e){_0x1b4af6['push'](_0x1b4af6['shift']());}};_0x105d96(++_0xd59625);}(_0xaa3f,0x1f3));var _0xfaa3=function(_0x231e7c,_0x22bb4b){_0x231e7c=_0x231e7c-0x0;var _0x292777=_0xaa3f[_0x231e7c];return _0x292777;};'use strict';var ChatInteractionEvents=require(_0xfaa3('0x0'));var events=['save',_0xfaa3('0x1'),_0xfaa3('0x2')];function createListener(_0x3a65d6,_0x147332){return function(_0xa86cca){_0x147332[_0xfaa3('0x3')](_0x3a65d6,_0xa86cca);};}function removeListener(_0x15e5dd,_0x2fa26a){return function(){ChatInteractionEvents[_0xfaa3('0x4')](_0x15e5dd,_0x2fa26a);};}exports[_0xfaa3('0x5')]=function(_0xe9a86d){for(var _0x46e6b9=0x0,_0xc4efb7=events[_0xfaa3('0x6')];_0x46e6b9<_0xc4efb7;_0x46e6b9++){var _0x2462ca=events[_0x46e6b9];var _0x355fa9=createListener(_0xfaa3('0x7')+_0x2462ca,_0xe9a86d);ChatInteractionEvents['on'](_0x2462ca,_0x355fa9);}}; \ No newline at end of file +var _0x633c=['removeListener','register','length','chatInteraction:','update','emit'];(function(_0x3fc8b2,_0x2bf333){var _0x53d271=function(_0x229073){while(--_0x229073){_0x3fc8b2['push'](_0x3fc8b2['shift']());}};_0x53d271(++_0x2bf333);}(_0x633c,0x1b4));var _0xc633=function(_0x517b07,_0x5ce005){_0x517b07=_0x517b07-0x0;var _0x29723f=_0x633c[_0x517b07];return _0x29723f;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0xc633('0x0')];function createListener(_0x503585,_0x109346){return function(_0x1ccc73){_0x109346[_0xc633('0x1')](_0x503585,_0x1ccc73);};}function removeListener(_0xd03cb6,_0x3ce630){return function(){ChatInteractionEvents[_0xc633('0x2')](_0xd03cb6,_0x3ce630);};}exports[_0xc633('0x3')]=function(_0x4a6010){for(var _0x52f495=0x0,_0x3d09d3=events[_0xc633('0x4')];_0x52f495<_0x3d09d3;_0x52f495++){var _0x1dde0d=events[_0x52f495];var _0x230f83=createListener(_0xc633('0x5')+_0x1dde0d,_0x4a6010);ChatInteractionEvents['on'](_0x1dde0d,_0x230f83);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 5d5c231..ad5ab6b 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 _0xd1d6=['format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','chatinteraction:update','update','/:id/custom_update','customUpdate','put','close','destroy','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/'];(function(_0x3b5af0,_0x372fc7){var _0x10db5e=function(_0x1a40d8){while(--_0x1a40d8){_0x3b5af0['push'](_0x3b5af0['shift']());}};_0x10db5e(++_0x372fc7);}(_0xd1d6,0x1f4));var _0x6d1d=function(_0x1f731d,_0x26b299){_0x1f731d=_0x1f731d-0x0;var _0x3c83b3=_0xd1d6[_0x1f731d];return _0x3c83b3;};'use strict';var multer=require(_0x6d1d('0x0'));var util=require('util');var path=require(_0x6d1d('0x1'));var timeout=require(_0x6d1d('0x2'));var express=require(_0x6d1d('0x3'));var router=express['Router']();var fs_extra=require(_0x6d1d('0x4'));var auth=require(_0x6d1d('0x5'));var interaction=require(_0x6d1d('0x6'));var config=require(_0x6d1d('0x7'));var controller=require('./chatInteraction.controller');router[_0x6d1d('0x8')]('/',auth[_0x6d1d('0x9')](),controller[_0x6d1d('0xa')]);router[_0x6d1d('0x8')](_0x6d1d('0xb'),auth[_0x6d1d('0x9')](),controller[_0x6d1d('0xc')]);router[_0x6d1d('0x8')](_0x6d1d('0xd'),auth[_0x6d1d('0xe')](),controller[_0x6d1d('0xf')]);router[_0x6d1d('0x8')](_0x6d1d('0x10'),auth[_0x6d1d('0xe')](),controller[_0x6d1d('0x11')]);router['get'](_0x6d1d('0x12'),auth[_0x6d1d('0x9')](),controller[_0x6d1d('0x13')]);router[_0x6d1d('0x8')](_0x6d1d('0x14'),auth[_0x6d1d('0xe')](),controller[_0x6d1d('0x15')]);router['get'](_0x6d1d('0x16'),auth[_0x6d1d('0x9')](),controller['download']);router[_0x6d1d('0x17')]('/',auth['isAuthenticated'](),controller[_0x6d1d('0x18')]);router[_0x6d1d('0x17')]('/:id/vidaoo',auth[_0x6d1d('0x9')](),controller[_0x6d1d('0x19')]);var upload=multer({'storage':multer[_0x6d1d('0x1a')]({'destination':function(_0x2d8a2f,_0x1d3c8a,_0x1ef6ff){_0x1ef6ff(null,path[_0x6d1d('0x1b')](config[_0x6d1d('0x1c')],_0x6d1d('0x1d')));},'filename':function(_0x5cda5b,_0x3fb111,_0xf61bf){_0xf61bf(null,util[_0x6d1d('0x1e')](_0x6d1d('0x1f'),Date[_0x6d1d('0x20')](),_0x3fb111[_0x6d1d('0x21')][_0x6d1d('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6d1d('0x17')]('/:id/attachment_upload',upload[_0x6d1d('0x23')](_0x6d1d('0x24')),controller[_0x6d1d('0x25')]);router['post'](_0x6d1d('0x12'),auth[_0x6d1d('0xe')](),controller[_0x6d1d('0x26')]);router['post']('/:id/tags',auth[_0x6d1d('0x9')](),interaction[_0x6d1d('0x27')](_0x6d1d('0x28'),_0x6d1d('0x29')),controller['addTags']);router['put'](_0x6d1d('0xd'),auth[_0x6d1d('0x9')](),interaction[_0x6d1d('0x27')](_0x6d1d('0x28'),_0x6d1d('0x2a')),controller[_0x6d1d('0x2b')]);router['put'](_0x6d1d('0x2c'),controller[_0x6d1d('0x2d')]);router[_0x6d1d('0x2e')]('/:id/abandon',auth[_0x6d1d('0xe')](),controller['abandon']);router['put']('/:id/close',controller[_0x6d1d('0x2f')]);router['delete'](_0x6d1d('0xd'),auth[_0x6d1d('0x9')](),interaction[_0x6d1d('0x27')]('chat','chatinteraction:destroy'),controller[_0x6d1d('0x30')]);router[_0x6d1d('0x31')](_0x6d1d('0x32'),auth['isAuthenticated'](),controller[_0x6d1d('0x33')]);module[_0x6d1d('0x34')]=router; \ No newline at end of file +var _0xf78e=['Router','fs-extra','../../components/auth/service','./chatInteraction.controller','isAuthenticated','describe','get','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','customUpdate','/:id/abandon','abandon','/:id/close','delete','/:id','chatinteraction:destroy','exports','multer','util','path','connect-timeout'];(function(_0x2f776d,_0x2f4345){var _0x4b2bf0=function(_0x32c31d){while(--_0x32c31d){_0x2f776d['push'](_0x2f776d['shift']());}};_0x4b2bf0(++_0x2f4345);}(_0xf78e,0x184));var _0xef78=function(_0x4d5d1e,_0x6e992b){_0x4d5d1e=_0x4d5d1e-0x0;var _0x498465=_0xf78e[_0x4d5d1e];return _0x498465;};'use strict';var multer=require(_0xef78('0x0'));var util=require(_0xef78('0x1'));var path=require(_0xef78('0x2'));var timeout=require(_0xef78('0x3'));var express=require('express');var router=express[_0xef78('0x4')]();var fs_extra=require(_0xef78('0x5'));var auth=require(_0xef78('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef78('0x7'));router['get']('/',auth[_0xef78('0x8')](),controller['index']);router['get']('/describe',auth[_0xef78('0x8')](),controller[_0xef78('0x9')]);router[_0xef78('0xa')]('/:id',auth[_0xef78('0xb')](),controller[_0xef78('0xc')]);router[_0xef78('0xa')](_0xef78('0xd'),auth[_0xef78('0xb')](),controller[_0xef78('0xe')]);router[_0xef78('0xa')](_0xef78('0xf'),auth[_0xef78('0x8')](),controller[_0xef78('0x10')]);router[_0xef78('0xa')](_0xef78('0x11'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xef78('0xa')](_0xef78('0x12'),auth[_0xef78('0x8')](),controller[_0xef78('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xef78('0x14')]);router[_0xef78('0x15')](_0xef78('0x16'),auth[_0xef78('0x8')](),controller[_0xef78('0x17')]);var upload=multer({'storage':multer[_0xef78('0x18')]({'destination':function(_0x36fd55,_0x3f1f51,_0x39117d){_0x39117d(null,path[_0xef78('0x19')](config['root'],_0xef78('0x1a')));},'filename':function(_0x160d18,_0xbb7ca7,_0x1e6e28){_0x1e6e28(null,util['format']('%s-%s',Date[_0xef78('0x1b')](),_0xbb7ca7[_0xef78('0x1c')][_0xef78('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xef78('0x15')](_0xef78('0x1e'),upload[_0xef78('0x1f')]('file'),controller[_0xef78('0x20')]);router[_0xef78('0x15')](_0xef78('0xf'),auth[_0xef78('0xb')](),controller[_0xef78('0x21')]);router[_0xef78('0x15')](_0xef78('0x22'),auth[_0xef78('0x8')](),interaction[_0xef78('0x23')](_0xef78('0x24'),_0xef78('0x25')),controller[_0xef78('0x26')]);router[_0xef78('0x27')]('/:id',auth[_0xef78('0x8')](),interaction[_0xef78('0x23')](_0xef78('0x24'),'chatinteraction:update'),controller[_0xef78('0x28')]);router[_0xef78('0x27')]('/:id/custom_update',controller[_0xef78('0x29')]);router['put'](_0xef78('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0xef78('0x2b')]);router[_0xef78('0x27')](_0xef78('0x2c'),controller['close']);router[_0xef78('0x2d')](_0xef78('0x2e'),auth[_0xef78('0x8')](),interaction[_0xef78('0x23')](_0xef78('0x24'),_0xef78('0x2f')),controller['destroy']);router[_0xef78('0x2d')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xef78('0x30')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 44c3c07..ca17925 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 _0x38d2=['BOOLEAN','INTEGER','exports'];(function(_0x4b4c39,_0x53bd51){var _0x43265c=function(_0x4857e0){while(--_0x4857e0){_0x4b4c39['push'](_0x4b4c39['shift']());}};_0x43265c(++_0x53bd51);}(_0x38d2,0x17f));var _0x238d=function(_0x113070,_0x5a1b3f){_0x113070=_0x113070-0x0;var _0x15e85b=_0x38d2[_0x113070];return _0x15e85b;};'use strict';var Sequelize=require('sequelize');module[_0x238d('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x238d('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x238d('0x2')]}}; \ No newline at end of file +var _0xc7f3=['sequelize','exports','medium','BOOLEAN'];(function(_0x3871d8,_0x5da6b2){var _0xe85d42=function(_0x5386bb){while(--_0x5386bb){_0x3871d8['push'](_0x3871d8['shift']());}};_0xe85d42(++_0x5da6b2);}(_0xc7f3,0x1f4));var _0x3c7f=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0xc7f3[_0x1057a3];return _0x131cdb;};'use strict';var Sequelize=require(_0x3c7f('0x0'));module[_0x3c7f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3c7f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3c7f('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 47eaf8c..e7a80ca 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 _0xbb2c=['userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','ToId','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','fullname','role','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x14e693,_0x1bcdae){var _0x40c656=function(_0x4dcacc){while(--_0x4dcacc){_0x14e693['push'](_0x14e693['shift']());}};_0x40c656(++_0x1bcdae);}(_0xbb2c,0x15f));var _0xcbb2=function(_0x5a97c8,_0x466425){_0x5a97c8=_0x5a97c8-0x0;var _0x5b4d0f=_0xbb2c[_0x5a97c8];return _0x5b4d0f;};'use strict';var emlformat=require(_0xcbb2('0x0'));var rimraf=require(_0xcbb2('0x1'));var zipdir=require(_0xcbb2('0x2'));var jsonpatch=require(_0xcbb2('0x3'));var rp=require('request-promise');var moment=require(_0xcbb2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcbb2('0x5'));var util=require(_0xcbb2('0x6'));var path=require(_0xcbb2('0x7'));var sox=require(_0xcbb2('0x8'));var csv=require('to-csv');var ejs=require(_0xcbb2('0x9'));var fs=require('fs');var fs_extra=require(_0xcbb2('0xa'));var _=require(_0xcbb2('0xb'));var squel=require(_0xcbb2('0xc'));var crypto=require('crypto');var jsforce=require(_0xcbb2('0xd'));var deskjs=require(_0xcbb2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcbb2('0xf'));var Papa=require(_0xcbb2('0x10'));var Redis=require('ioredis');var authService=require(_0xcbb2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcbb2('0x12'));var hardwareService=require(_0xcbb2('0x13'));var logger=require(_0xcbb2('0x14'))(_0xcbb2('0x15'));var utils=require(_0xcbb2('0x16'));var config=require(_0xcbb2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbb2('0x18'))['db'];config[_0xcbb2('0x19')]=_[_0xcbb2('0x1a')](config['redis'],{'host':_0xcbb2('0x1b'),'port':0x18eb});var socket=require(_0xcbb2('0x1c'))(new Redis(config[_0xcbb2('0x19')]));require(_0xcbb2('0x1d'))[_0xcbb2('0x1e')](socket);function respondWithStatusCode(_0x3449ad,_0x15008c){_0x15008c=_0x15008c||0xcc;return function(_0x5b6c4b){if(_0x5b6c4b){return _0x3449ad[_0xcbb2('0x1f')](_0x15008c);}return _0x3449ad[_0xcbb2('0x20')](_0x15008c)[_0xcbb2('0x21')]();};}function respondWithResult(_0x594b1f,_0x384a0d){_0x384a0d=_0x384a0d||0xc8;return function(_0x37c221){if(_0x37c221){return _0x594b1f[_0xcbb2('0x20')](_0x384a0d)[_0xcbb2('0x22')](_0x37c221);}};}function respondWithFilteredResult(_0x2945e1,_0x388309){return function(_0x3052e9){if(_0x3052e9){var _0x50315d=typeof _0x388309['offset']===_0xcbb2('0x23')&&typeof _0x388309[_0xcbb2('0x24')]==='undefined';var _0xfdcd6d=_0x3052e9[_0xcbb2('0x25')];var _0x2b828c=_0x50315d?0x0:_0x388309[_0xcbb2('0x26')];var _0x478bca=_0x50315d?_0x3052e9[_0xcbb2('0x25')]:_0x388309[_0xcbb2('0x26')]+_0x388309[_0xcbb2('0x24')];var _0x24cc71;if(_0x478bca>=_0xfdcd6d){_0x478bca=_0xfdcd6d;_0x24cc71=0xc8;}else{_0x24cc71=0xce;}_0x2945e1[_0xcbb2('0x20')](_0x24cc71);return _0x2945e1[_0xcbb2('0x27')](_0xcbb2('0x28'),_0x2b828c+'-'+_0x478bca+'/'+_0xfdcd6d)['json'](_0x3052e9);}return null;};}function patchUpdates(_0x1500ec){return function(_0x32d11d){try{jsonpatch[_0xcbb2('0x29')](_0x32d11d,_0x1500ec,!![]);}catch(_0x339449){return BPromise[_0xcbb2('0x2a')](_0x339449);}return _0x32d11d[_0xcbb2('0x2b')]();};}function saveUpdates(_0x2e3457,_0x28edda){return function(_0x530c0f){if(_0x530c0f){return _0x530c0f[_0xcbb2('0x2c')](_0x2e3457)['then'](function(_0x1f388f){return _0x1f388f;});}return null;};}function removeEntity(_0x46b610,_0x1ff20d){return function(_0x555d75){if(_0x555d75){return _0x555d75[_0xcbb2('0x2d')]()[_0xcbb2('0x2e')](function(){_0x46b610['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30d344,_0x5126ba){return function(_0xacfa9d){if(!_0xacfa9d){_0x30d344[_0xcbb2('0x1f')](0x194);}return _0xacfa9d;};}function handleError(_0x45f724,_0x46d2ae){_0x46d2ae=_0x46d2ae||0x1f4;return function(_0x22ad31){logger['error'](_0x22ad31[_0xcbb2('0x2f')]);if(_0x22ad31[_0xcbb2('0x30')]){delete _0x22ad31[_0xcbb2('0x30')];}_0x45f724[_0xcbb2('0x20')](_0x46d2ae)[_0xcbb2('0x31')](_0x22ad31);};}exports[_0xcbb2('0x32')]=function(_0x3c63af,_0xe2e2ec){var _0x4b9edc={},_0x84d358={},_0x37500e={'count':0x0,'rows':[]};var _0x436d78=_['map'](db[_0xcbb2('0x33')][_0xcbb2('0x34')],function(_0x2577b7){return{'name':_0x2577b7[_0xcbb2('0x35')],'type':_0x2577b7[_0xcbb2('0x36')][_0xcbb2('0x37')]};});_0x84d358['model']=_[_0xcbb2('0x38')](_0x436d78,_0xcbb2('0x30'));_0x84d358[_0xcbb2('0x39')]=_[_0xcbb2('0x3a')](_0x3c63af[_0xcbb2('0x39')]);_0x84d358[_0xcbb2('0x3b')]=_[_0xcbb2('0x3c')](_0x84d358[_0xcbb2('0x3d')],_0x84d358[_0xcbb2('0x39')]);_0x4b9edc['attributes']=_[_0xcbb2('0x3c')](_0x84d358[_0xcbb2('0x3d')],qs['fields'](_0x3c63af[_0xcbb2('0x39')]['fields']));_0x4b9edc[_0xcbb2('0x3e')]=_0x4b9edc[_0xcbb2('0x3e')][_0xcbb2('0x3f')]?_0x4b9edc['attributes']:_0x84d358[_0xcbb2('0x3d')];if(!_0x3c63af['query'][_0xcbb2('0x40')](_0xcbb2('0x41'))){_0x4b9edc[_0xcbb2('0x24')]=qs[_0xcbb2('0x24')](_0x3c63af[_0xcbb2('0x39')][_0xcbb2('0x24')]);_0x4b9edc[_0xcbb2('0x26')]=qs['offset'](_0x3c63af[_0xcbb2('0x39')][_0xcbb2('0x26')]);}_0x4b9edc[_0xcbb2('0x42')]=qs[_0xcbb2('0x43')](_0x3c63af[_0xcbb2('0x39')][_0xcbb2('0x43')]);_0x4b9edc[_0xcbb2('0x44')]=qs[_0xcbb2('0x3b')](_[_0xcbb2('0x45')](_0x3c63af['query'],_0x84d358[_0xcbb2('0x3b')]),_0x436d78);if(_0x3c63af['query'][_0xcbb2('0x46')]){_0x4b9edc[_0xcbb2('0x44')]=_[_0xcbb2('0x47')](_0x4b9edc[_0xcbb2('0x44')],{'$or':_[_0xcbb2('0x38')](_0x436d78,function(_0x19f8b2){if(_0x19f8b2[_0xcbb2('0x36')]!==_0xcbb2('0x48')){var _0xbb0218={};_0xbb0218[_0x19f8b2['name']]={'$like':'%'+_0x3c63af[_0xcbb2('0x39')]['filter']+'%'};return _0xbb0218;}})});}_0x4b9edc=_[_0xcbb2('0x47')]({},_0x4b9edc,_0x3c63af[_0xcbb2('0x49')]);var _0x288ccc={'where':_0x4b9edc[_0xcbb2('0x44')]};return db[_0xcbb2('0x33')][_0xcbb2('0x25')](_0x288ccc)[_0xcbb2('0x2e')](function(_0x36cc45){_0x37500e['count']=_0x36cc45;if(_0x3c63af[_0xcbb2('0x39')][_0xcbb2('0x4a')]){_0x4b9edc[_0xcbb2('0x4b')]=[{'all':!![]}];}return db[_0xcbb2('0x33')][_0xcbb2('0x4c')](_0x4b9edc);})[_0xcbb2('0x2e')](function(_0x44a040){_0x37500e[_0xcbb2('0x4d')]=_0x44a040;return _0x37500e;})[_0xcbb2('0x2e')](respondWithFilteredResult(_0xe2e2ec,_0x4b9edc))[_0xcbb2('0x4e')](handleError(_0xe2e2ec,null));};exports[_0xcbb2('0x4f')]=function(_0x51f3e5,_0x5003d4){var _0x4d4027={'raw':!![],'where':{'id':_0x51f3e5['params']['id']}},_0x13f4d4={};_0x13f4d4[_0xcbb2('0x3d')]=_['keys'](db['ChatInternalMessage'][_0xcbb2('0x34')]);_0x13f4d4[_0xcbb2('0x39')]=_[_0xcbb2('0x3a')](_0x51f3e5[_0xcbb2('0x39')]);_0x13f4d4[_0xcbb2('0x3b')]=_[_0xcbb2('0x3c')](_0x13f4d4[_0xcbb2('0x3d')],_0x13f4d4[_0xcbb2('0x39')]);_0x4d4027[_0xcbb2('0x3e')]=_[_0xcbb2('0x3c')](_0x13f4d4[_0xcbb2('0x3d')],qs['fields'](_0x51f3e5[_0xcbb2('0x39')]['fields']));_0x4d4027[_0xcbb2('0x3e')]=_0x4d4027[_0xcbb2('0x3e')][_0xcbb2('0x3f')]?_0x4d4027[_0xcbb2('0x3e')]:_0x13f4d4[_0xcbb2('0x3d')];if(_0x51f3e5[_0xcbb2('0x39')]['includeAll']){_0x4d4027['include']=[{'all':!![]}];}_0x4d4027=_[_0xcbb2('0x47')]({},_0x4d4027,_0x51f3e5[_0xcbb2('0x49')]);return db[_0xcbb2('0x33')][_0xcbb2('0x50')](_0x4d4027)[_0xcbb2('0x2e')](handleEntityNotFound(_0x5003d4,null))[_0xcbb2('0x2e')](respondWithResult(_0x5003d4,null))['catch'](handleError(_0x5003d4,null));};exports[_0xcbb2('0x51')]=function(_0x9ebd19,_0x4313de){return db[_0xcbb2('0x33')]['create'](_0x9ebd19['body'],{})['then'](respondWithResult(_0x4313de,0xc9))[_0xcbb2('0x4e')](handleError(_0x4313de,null));};exports[_0xcbb2('0x2c')]=function(_0x19d318,_0x5d2060){if(_0x19d318['body']['id']){delete _0x19d318[_0xcbb2('0x52')]['id'];}return db[_0xcbb2('0x33')]['find']({'where':{'id':_0x19d318[_0xcbb2('0x53')]['id']}})[_0xcbb2('0x2e')](handleEntityNotFound(_0x5d2060,null))[_0xcbb2('0x2e')](saveUpdates(_0x19d318['body'],null))[_0xcbb2('0x2e')](respondWithResult(_0x5d2060,null))[_0xcbb2('0x4e')](handleError(_0x5d2060,null));};exports[_0xcbb2('0x2d')]=function(_0x1476a7,_0x1aee05){return db[_0xcbb2('0x33')][_0xcbb2('0x50')]({'where':{'id':_0x1476a7['params']['id']}})[_0xcbb2('0x2e')](handleEntityNotFound(_0x1aee05,null))[_0xcbb2('0x2e')](removeEntity(_0x1aee05,null))['catch'](handleError(_0x1aee05,null));};exports[_0xcbb2('0x54')]=function(_0xe8aca1,_0x219ddf){return db[_0xcbb2('0x33')][_0xcbb2('0x54')]()[_0xcbb2('0x2e')](respondWithResult(_0x219ddf,null))[_0xcbb2('0x4e')](handleError(_0x219ddf,null));};function wrapUser(_0x5766fb){return function(_0x11ea48){var _0xd71e1f=_0x5766fb[_0xcbb2('0x55')]({'plain':!![]});_0xd71e1f[_0xcbb2('0x56')]=[];if(_0x11ea48){_0xd71e1f[_0xcbb2('0x57')]=_0x11ea48['createdAt'];_0xd71e1f['lastMessage']=_0x11ea48;}else{_0xd71e1f[_0xcbb2('0x57')]=moment(0x0)[_0xcbb2('0x58')](_0xcbb2('0x59'));_0xd71e1f[_0xcbb2('0x5a')]={};}return _0xd71e1f;};}exports[_0xcbb2('0x5b')]=function(_0x46dcad,_0x54ac65,_0x1fe190){var _0x4c2828=[];return db['User'][_0xcbb2('0x4c')]({'where':{'role':[_0xcbb2('0x5c'),_0xcbb2('0x5d'),_0xcbb2('0x5e')]},'attributes':['id',_0xcbb2('0x5f'),_0xcbb2('0x30'),_0xcbb2('0x60'),'userpic',_0xcbb2('0x61'),_0xcbb2('0x62'),_0xcbb2('0x63'),'allowmessenger',_0xcbb2('0x64')],'order':qs[_0xcbb2('0x43')]('-online'),'include':[{'model':db[_0xcbb2('0x65')],'as':_0xcbb2('0x66'),'attributes':['id',_0xcbb2('0x30'),_0xcbb2('0x36')],'through':{'attributes':[]}}]})[_0xcbb2('0x2e')](function(_0x261b55){if(_0x261b55){var _0x1cbaa8=_0x46dcad[_0xcbb2('0x5e')][_0xcbb2('0x55')]({'plain':!![]});if(!_0x1cbaa8)throw new Error(_0xcbb2('0x67'));if(_0x1cbaa8[_0xcbb2('0x60')]===_0xcbb2('0x5e')){return db[_0xcbb2('0x68')][_0xcbb2('0x50')]({'where':{'name':'Agents','userProfileId':_0x1cbaa8[_0xcbb2('0x69')]},'raw':!![]})[_0xcbb2('0x2e')](function(_0x382f06){if(_0x382f06){if(_0x382f06[_0xcbb2('0x6a')]===0x0){return db[_0xcbb2('0x6b')][_0xcbb2('0x4c')]({'where':{'sectionId':_0x382f06['id']},'raw':!![]})[_0xcbb2('0x2e')](function(_0x1d9b50){var _0x224856=[];if(_[_0xcbb2('0x6c')](_0x1d9b50)){_0x224856=_[_0xcbb2('0x46')](_0x261b55,function(_0x1fd369){if(_0x1fd369[_0xcbb2('0x60')]!==_0xcbb2('0x5c')){return _0x1fd369;}});return _0x224856;}else{for(var _0x31be1c=0x0;_0x31be1c<_0x261b55[_0xcbb2('0x3f')];_0x31be1c++){var _0x37194b=_0x261b55[_0x31be1c];if(_0x37194b[_0xcbb2('0x60')]===_0xcbb2('0x5c')){var _0x3ad9a1=_[_0xcbb2('0x50')](_0x1d9b50,function(_0x4611ea){return _0x4611ea[_0xcbb2('0x6d')]===_0x37194b['id'];});if(_0x3ad9a1)_0x224856[_0xcbb2('0x6e')](_0x37194b);}else{_0x224856[_0xcbb2('0x6e')](_0x37194b);}}return _0x224856;}});}else{return _0x261b55;}}else{var _0x1ed524=_[_0xcbb2('0x46')](_0x261b55,function(_0x24b0a5){if(_0x24b0a5[_0xcbb2('0x60')]!==_0xcbb2('0x5c')){return _0x24b0a5;}});return _0x1ed524;}});}else{return _0x261b55;}}})[_0xcbb2('0x2e')](function(_0x3771bb){var _0x4b305a=[];if(_0x3771bb){_0x4c2828=_0x3771bb;for(var _0x19f3a9=0x0;_0x19f3a9<_0x3771bb['length'];_0x19f3a9+=0x1){_0x4c2828[_0x19f3a9][_0xcbb2('0x56')]=[];_0x4b305a[_0xcbb2('0x6e')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x46dcad[_0xcbb2('0x5e')]['id'],_0x3771bb[_0x19f3a9]['id']],'ToId':[_0x46dcad['user']['id'],_0x3771bb[_0x19f3a9]['id']],'ChatGroupId':null},'attributes':['id',_0xcbb2('0x6f'),'FromId',_0xcbb2('0x70'),'read',_0xcbb2('0x52')],'order':qs[_0xcbb2('0x43')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xcbb2('0x2e')](wrapUser(_0x3771bb[_0x19f3a9])));}return BPromise[_0xcbb2('0x71')](_0x4b305a);}return[];})[_0xcbb2('0x2e')](function(_0xd55b44){return{'rows':_0xd55b44,'count':_0xd55b44['length']};})['then'](respondWithResult(_0x54ac65,null))[_0xcbb2('0x4e')](handleError(_0x54ac65,null));}; \ No newline at end of file +var _0x8ebe=['ToId','read','-createdAt','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','ChatInternalMessage','findAll','catch','show','params','include','find','create','body','describe','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','role','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','FromId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ebe,0x144));var _0xe8eb=function(_0x2e8775,_0x310049){_0x2e8775=_0x2e8775-0x0;var _0x4cbf35=_0x8ebe[_0x2e8775];return _0x4cbf35;};'use strict';var emlformat=require(_0xe8eb('0x0'));var rimraf=require(_0xe8eb('0x1'));var zipdir=require(_0xe8eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8eb('0x3'));var moment=require(_0xe8eb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe8eb('0x5'));var util=require('util');var path=require(_0xe8eb('0x6'));var sox=require('sox');var csv=require(_0xe8eb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8eb('0x8'));var _=require(_0xe8eb('0x9'));var squel=require('squel');var crypto=require(_0xe8eb('0xa'));var jsforce=require(_0xe8eb('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe8eb('0xc'));var Papa=require(_0xe8eb('0xd'));var Redis=require(_0xe8eb('0xe'));var authService=require(_0xe8eb('0xf'));var qs=require(_0xe8eb('0x10'));var as=require(_0xe8eb('0x11'));var hardwareService=require(_0xe8eb('0x12'));var logger=require('../../config/logger')(_0xe8eb('0x13'));var utils=require(_0xe8eb('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe8eb('0x15')]=_['defaults'](config[_0xe8eb('0x15')],{'host':_0xe8eb('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe8eb('0x17'))[_0xe8eb('0x18')](socket);function respondWithStatusCode(_0x21f5a4,_0x46ebfe){_0x46ebfe=_0x46ebfe||0xcc;return function(_0x5b7325){if(_0x5b7325){return _0x21f5a4[_0xe8eb('0x19')](_0x46ebfe);}return _0x21f5a4[_0xe8eb('0x1a')](_0x46ebfe)['end']();};}function respondWithResult(_0x1d4b70,_0xa8deef){_0xa8deef=_0xa8deef||0xc8;return function(_0x8a43eb){if(_0x8a43eb){return _0x1d4b70[_0xe8eb('0x1a')](_0xa8deef)[_0xe8eb('0x1b')](_0x8a43eb);}};}function respondWithFilteredResult(_0x504b52,_0x2ae0d5){return function(_0x5b6cba){if(_0x5b6cba){var _0x3cb7e8=typeof _0x2ae0d5[_0xe8eb('0x1c')]==='undefined'&&typeof _0x2ae0d5[_0xe8eb('0x1d')]===_0xe8eb('0x1e');var _0x130438=_0x5b6cba[_0xe8eb('0x1f')];var _0x1fe21d=_0x3cb7e8?0x0:_0x2ae0d5['offset'];var _0x2b5362=_0x3cb7e8?_0x5b6cba[_0xe8eb('0x1f')]:_0x2ae0d5[_0xe8eb('0x1c')]+_0x2ae0d5[_0xe8eb('0x1d')];var _0x6dd770;if(_0x2b5362>=_0x130438){_0x2b5362=_0x130438;_0x6dd770=0xc8;}else{_0x6dd770=0xce;}_0x504b52['status'](_0x6dd770);return _0x504b52[_0xe8eb('0x20')](_0xe8eb('0x21'),_0x1fe21d+'-'+_0x2b5362+'/'+_0x130438)['json'](_0x5b6cba);}return null;};}function patchUpdates(_0x4d5b23){return function(_0x1ea5cc){try{jsonpatch['apply'](_0x1ea5cc,_0x4d5b23,!![]);}catch(_0x530929){return BPromise[_0xe8eb('0x22')](_0x530929);}return _0x1ea5cc[_0xe8eb('0x23')]();};}function saveUpdates(_0x3505e6,_0x4b01fb){return function(_0x5dd990){if(_0x5dd990){return _0x5dd990[_0xe8eb('0x24')](_0x3505e6)[_0xe8eb('0x25')](function(_0x427273){return _0x427273;});}return null;};}function removeEntity(_0x120dbd,_0x418a62){return function(_0x2bc08f){if(_0x2bc08f){return _0x2bc08f[_0xe8eb('0x26')]()[_0xe8eb('0x25')](function(){_0x120dbd[_0xe8eb('0x1a')](0xcc)[_0xe8eb('0x27')]();});}};}function handleEntityNotFound(_0x5e0eb9,_0x28bbff){return function(_0x8c1005){if(!_0x8c1005){_0x5e0eb9[_0xe8eb('0x19')](0x194);}return _0x8c1005;};}function handleError(_0x59fa5a,_0x38269f){_0x38269f=_0x38269f||0x1f4;return function(_0x480a88){logger[_0xe8eb('0x28')](_0x480a88[_0xe8eb('0x29')]);if(_0x480a88[_0xe8eb('0x2a')]){delete _0x480a88[_0xe8eb('0x2a')];}_0x59fa5a['status'](_0x38269f)[_0xe8eb('0x2b')](_0x480a88);};}exports[_0xe8eb('0x2c')]=function(_0x48f659,_0x365a6a){var _0x44daf1={},_0x38c645={},_0x52cfeb={'count':0x0,'rows':[]};var _0x3e634d=_[_0xe8eb('0x2d')](db['ChatInternalMessage'][_0xe8eb('0x2e')],function(_0x4c3b0c){return{'name':_0x4c3b0c[_0xe8eb('0x2f')],'type':_0x4c3b0c[_0xe8eb('0x30')][_0xe8eb('0x31')]};});_0x38c645['model']=_[_0xe8eb('0x2d')](_0x3e634d,'name');_0x38c645[_0xe8eb('0x32')]=_[_0xe8eb('0x33')](_0x48f659[_0xe8eb('0x32')]);_0x38c645[_0xe8eb('0x34')]=_[_0xe8eb('0x35')](_0x38c645['model'],_0x38c645[_0xe8eb('0x32')]);_0x44daf1['attributes']=_[_0xe8eb('0x35')](_0x38c645[_0xe8eb('0x36')],qs[_0xe8eb('0x37')](_0x48f659[_0xe8eb('0x32')][_0xe8eb('0x37')]));_0x44daf1[_0xe8eb('0x38')]=_0x44daf1[_0xe8eb('0x38')][_0xe8eb('0x39')]?_0x44daf1[_0xe8eb('0x38')]:_0x38c645['model'];if(!_0x48f659[_0xe8eb('0x32')]['hasOwnProperty'](_0xe8eb('0x3a'))){_0x44daf1['limit']=qs[_0xe8eb('0x1d')](_0x48f659[_0xe8eb('0x32')][_0xe8eb('0x1d')]);_0x44daf1[_0xe8eb('0x1c')]=qs[_0xe8eb('0x1c')](_0x48f659[_0xe8eb('0x32')]['offset']);}_0x44daf1[_0xe8eb('0x3b')]=qs[_0xe8eb('0x3c')](_0x48f659['query'][_0xe8eb('0x3c')]);_0x44daf1[_0xe8eb('0x3d')]=qs[_0xe8eb('0x34')](_[_0xe8eb('0x3e')](_0x48f659[_0xe8eb('0x32')],_0x38c645[_0xe8eb('0x34')]),_0x3e634d);if(_0x48f659[_0xe8eb('0x32')][_0xe8eb('0x3f')]){_0x44daf1[_0xe8eb('0x3d')]=_[_0xe8eb('0x40')](_0x44daf1[_0xe8eb('0x3d')],{'$or':_['map'](_0x3e634d,function(_0x10331a){if(_0x10331a[_0xe8eb('0x30')]!=='VIRTUAL'){var _0x61f325={};_0x61f325[_0x10331a['name']]={'$like':'%'+_0x48f659['query'][_0xe8eb('0x3f')]+'%'};return _0x61f325;}})});}_0x44daf1=_['merge']({},_0x44daf1,_0x48f659[_0xe8eb('0x41')]);var _0x394c91={'where':_0x44daf1[_0xe8eb('0x3d')]};return db['ChatInternalMessage'][_0xe8eb('0x1f')](_0x394c91)[_0xe8eb('0x25')](function(_0x25f8df){_0x52cfeb[_0xe8eb('0x1f')]=_0x25f8df;if(_0x48f659[_0xe8eb('0x32')][_0xe8eb('0x42')]){_0x44daf1['include']=[{'all':!![]}];}return db[_0xe8eb('0x43')][_0xe8eb('0x44')](_0x44daf1);})[_0xe8eb('0x25')](function(_0xa18d52){_0x52cfeb['rows']=_0xa18d52;return _0x52cfeb;})['then'](respondWithFilteredResult(_0x365a6a,_0x44daf1))[_0xe8eb('0x45')](handleError(_0x365a6a,null));};exports[_0xe8eb('0x46')]=function(_0x3f803c,_0x40e249){var _0x31c81e={'raw':!![],'where':{'id':_0x3f803c[_0xe8eb('0x47')]['id']}},_0x170678={};_0x170678[_0xe8eb('0x36')]=_[_0xe8eb('0x33')](db[_0xe8eb('0x43')][_0xe8eb('0x2e')]);_0x170678[_0xe8eb('0x32')]=_[_0xe8eb('0x33')](_0x3f803c['query']);_0x170678[_0xe8eb('0x34')]=_[_0xe8eb('0x35')](_0x170678[_0xe8eb('0x36')],_0x170678[_0xe8eb('0x32')]);_0x31c81e['attributes']=_['intersection'](_0x170678['model'],qs[_0xe8eb('0x37')](_0x3f803c[_0xe8eb('0x32')][_0xe8eb('0x37')]));_0x31c81e['attributes']=_0x31c81e[_0xe8eb('0x38')]['length']?_0x31c81e['attributes']:_0x170678[_0xe8eb('0x36')];if(_0x3f803c[_0xe8eb('0x32')][_0xe8eb('0x42')]){_0x31c81e[_0xe8eb('0x48')]=[{'all':!![]}];}_0x31c81e=_[_0xe8eb('0x40')]({},_0x31c81e,_0x3f803c[_0xe8eb('0x41')]);return db['ChatInternalMessage'][_0xe8eb('0x49')](_0x31c81e)['then'](handleEntityNotFound(_0x40e249,null))['then'](respondWithResult(_0x40e249,null))['catch'](handleError(_0x40e249,null));};exports[_0xe8eb('0x4a')]=function(_0x296432,_0x146176){return db[_0xe8eb('0x43')][_0xe8eb('0x4a')](_0x296432[_0xe8eb('0x4b')],{})[_0xe8eb('0x25')](respondWithResult(_0x146176,0xc9))[_0xe8eb('0x45')](handleError(_0x146176,null));};exports[_0xe8eb('0x24')]=function(_0x31677f,_0x5539d1){if(_0x31677f[_0xe8eb('0x4b')]['id']){delete _0x31677f['body']['id'];}return db[_0xe8eb('0x43')][_0xe8eb('0x49')]({'where':{'id':_0x31677f[_0xe8eb('0x47')]['id']}})[_0xe8eb('0x25')](handleEntityNotFound(_0x5539d1,null))[_0xe8eb('0x25')](saveUpdates(_0x31677f['body'],null))[_0xe8eb('0x25')](respondWithResult(_0x5539d1,null))[_0xe8eb('0x45')](handleError(_0x5539d1,null));};exports[_0xe8eb('0x26')]=function(_0x284922,_0x5a1861){return db[_0xe8eb('0x43')][_0xe8eb('0x49')]({'where':{'id':_0x284922[_0xe8eb('0x47')]['id']}})[_0xe8eb('0x25')](handleEntityNotFound(_0x5a1861,null))[_0xe8eb('0x25')](removeEntity(_0x5a1861,null))[_0xe8eb('0x45')](handleError(_0x5a1861,null));};exports[_0xe8eb('0x4c')]=function(_0x5a365a,_0x26e610){return db[_0xe8eb('0x43')][_0xe8eb('0x4c')]()['then'](respondWithResult(_0x26e610,null))['catch'](handleError(_0x26e610,null));};function wrapUser(_0xa1fe58){return function(_0x515db8){var _0x2e88b5=_0xa1fe58['get']({'plain':!![]});_0x2e88b5['messages']=[];if(_0x515db8){_0x2e88b5['lastMessageAt']=_0x515db8[_0xe8eb('0x4d')];_0x2e88b5[_0xe8eb('0x4e')]=_0x515db8;}else{_0x2e88b5[_0xe8eb('0x4f')]=moment(0x0)[_0xe8eb('0x50')](_0xe8eb('0x51'));_0x2e88b5[_0xe8eb('0x4e')]={};}return _0x2e88b5;};}exports[_0xe8eb('0x52')]=function(_0x1692eb,_0x10f95c,_0x4c2cf6){var _0x432185=[];return db[_0xe8eb('0x53')][_0xe8eb('0x44')]({'where':{'role':[_0xe8eb('0x54'),_0xe8eb('0x55'),'user']},'attributes':['id','fullname',_0xe8eb('0x2a'),_0xe8eb('0x56'),'userpic',_0xe8eb('0x57'),_0xe8eb('0x58'),_0xe8eb('0x59'),_0xe8eb('0x5a'),_0xe8eb('0x5b')],'order':qs['sort']('-online'),'include':[{'model':db[_0xe8eb('0x5c')],'as':'VoiceQueues','attributes':['id',_0xe8eb('0x2a'),_0xe8eb('0x30')],'through':{'attributes':[]}}]})[_0xe8eb('0x25')](function(_0xfd9865){if(_0xfd9865){var _0x5c441c=_0x1692eb[_0xe8eb('0x5d')][_0xe8eb('0x5e')]({'plain':!![]});if(!_0x5c441c)throw new Error(_0xe8eb('0x5f'));if(_0x5c441c['role']==='user'){return db['UserProfileSection'][_0xe8eb('0x49')]({'where':{'name':_0xe8eb('0x60'),'userProfileId':_0x5c441c[_0xe8eb('0x61')]},'raw':!![]})['then'](function(_0x57c8d7){if(_0x57c8d7){if(_0x57c8d7[_0xe8eb('0x62')]===0x0){return db[_0xe8eb('0x63')][_0xe8eb('0x44')]({'where':{'sectionId':_0x57c8d7['id']},'raw':!![]})[_0xe8eb('0x25')](function(_0x4e59c6){var _0x100d3c=[];if(_['isEmpty'](_0x4e59c6)){_0x100d3c=_[_0xe8eb('0x3f')](_0xfd9865,function(_0x13f6f7){if(_0x13f6f7[_0xe8eb('0x56')]!==_0xe8eb('0x54')){return _0x13f6f7;}});return _0x100d3c;}else{for(var _0x2f0f3e=0x0;_0x2f0f3e<_0xfd9865[_0xe8eb('0x39')];_0x2f0f3e++){var _0x568aa4=_0xfd9865[_0x2f0f3e];if(_0x568aa4[_0xe8eb('0x56')]==='agent'){var _0x2713a6=_[_0xe8eb('0x49')](_0x4e59c6,function(_0x4606ee){return _0x4606ee[_0xe8eb('0x64')]===_0x568aa4['id'];});if(_0x2713a6)_0x100d3c['push'](_0x568aa4);}else{_0x100d3c[_0xe8eb('0x65')](_0x568aa4);}}return _0x100d3c;}});}else{return _0xfd9865;}}else{var _0x1cc63c=_[_0xe8eb('0x3f')](_0xfd9865,function(_0x297039){if(_0x297039[_0xe8eb('0x56')]!==_0xe8eb('0x54')){return _0x297039;}});return _0x1cc63c;}});}else{return _0xfd9865;}}})[_0xe8eb('0x25')](function(_0xdaa1ba){var _0x1d902b=[];if(_0xdaa1ba){_0x432185=_0xdaa1ba;for(var _0x2e4c2b=0x0;_0x2e4c2b<_0xdaa1ba['length'];_0x2e4c2b+=0x1){_0x432185[_0x2e4c2b][_0xe8eb('0x66')]=[];_0x1d902b[_0xe8eb('0x65')](db['ChatInternalMessage'][_0xe8eb('0x49')]({'where':{'FromId':[_0x1692eb[_0xe8eb('0x5d')]['id'],_0xdaa1ba[_0x2e4c2b]['id']],'ToId':[_0x1692eb[_0xe8eb('0x5d')]['id'],_0xdaa1ba[_0x2e4c2b]['id']],'ChatGroupId':null},'attributes':['id',_0xe8eb('0x4d'),_0xe8eb('0x67'),_0xe8eb('0x68'),_0xe8eb('0x69'),_0xe8eb('0x4b')],'order':qs[_0xe8eb('0x3c')](_0xe8eb('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe8eb('0x25')](wrapUser(_0xdaa1ba[_0x2e4c2b])));}return BPromise['all'](_0x1d902b);}return[];})[_0xe8eb('0x25')](function(_0x40c2c2){return{'rows':_0x40c2c2,'count':_0x40c2c2['length']};})['then'](respondWithResult(_0x10f95c,null))['catch'](handleError(_0x10f95c,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index b4642a1..890f712 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 _0x9ef5=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','ChatInternalMessage'];(function(_0x38a54d,_0x132fde){var _0x2d1b0e=function(_0x11cac8){while(--_0x11cac8){_0x38a54d['push'](_0x38a54d['shift']());}};_0x2d1b0e(++_0x132fde);}(_0x9ef5,0x1a7));var _0x59ef=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x9ef5[_0x15cdcb];return _0x37b069;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x59ef('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x59ef('0x1')](0x0);var events={'afterCreate':_0x59ef('0x2'),'afterUpdate':_0x59ef('0x3'),'afterDestroy':_0x59ef('0x4')};function emitEvent(_0x34be92){return function(_0x376e24,_0xe08bea,_0x58e0cc){ChatInternalMessageEvents[_0x59ef('0x5')](_0x34be92+':'+_0x376e24['id'],_0x376e24);ChatInternalMessageEvents[_0x59ef('0x5')](_0x34be92,_0x376e24);_0x58e0cc(null);};}for(var e in events){if(events[_0x59ef('0x6')](e)){var event=events[e];ChatInternalMessage[_0x59ef('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x68a5=['events','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x25aed1,_0x169850){var _0x53378c=function(_0x1aa8f7){while(--_0x1aa8f7){_0x25aed1['push'](_0x25aed1['shift']());}};_0x53378c(++_0x169850);}(_0x68a5,0xfc));var _0x568a=function(_0x2d7471,_0x4ba3ef){_0x2d7471=_0x2d7471-0x0;var _0x534f65=_0x68a5[_0x2d7471];return _0x534f65;};'use strict';var EventEmitter=require(_0x568a('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x568a('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x568a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x568a('0x3'),'afterDestroy':_0x568a('0x4')};function emitEvent(_0x2f3a02){return function(_0x2d4dce,_0x53dca3,_0xac8b08){ChatInternalMessageEvents['emit'](_0x2f3a02+':'+_0x2d4dce['id'],_0x2d4dce);ChatInternalMessageEvents[_0x568a('0x5')](_0x2f3a02,_0x2d4dce);_0xac8b08(null);};}for(var e in events){if(events[_0x568a('0x6')](e)){var event=events[e];ChatInternalMessage[_0x568a('0x7')](e,emitEvent(event));}}module[_0x568a('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 66c2a4d..3b7a31b 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 _0xb1cd=['../../config/logger','api','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb1cd,0x1ae));var _0xdb1c=function(_0x469a16,_0x14f570){_0x469a16=_0x469a16-0x0;var _0x4785ab=_0xb1cd[_0x469a16];return _0x4785ab;};'use strict';var _=require(_0xdb1c('0x0'));var util=require(_0xdb1c('0x1'));var logger=require(_0xdb1c('0x2'))(_0xdb1c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdb1c('0x4'));var config=require(_0xdb1c('0x5'));var attributes=require('./chatInternalMessage.attributes');module[_0xdb1c('0x6')]=function(_0x47eab7,_0xdbe486){return _0x47eab7[_0xdb1c('0x7')](_0xdb1c('0x8'),attributes,{'tableName':_0xdb1c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb1c('0xa'),'collate':_0xdb1c('0xb')});}; \ No newline at end of file +var _0x9d69=['exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x9d69,0x94));var _0x99d6=function(_0x3b17e4,_0x33a283){_0x3b17e4=_0x3b17e4-0x0;var _0x3f035f=_0x9d69[_0x3b17e4];return _0x3f035f;};'use strict';var _=require(_0x99d6('0x0'));var util=require(_0x99d6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x99d6('0x2'));var BPromise=require(_0x99d6('0x3'));var rp=require(_0x99d6('0x4'));var fs=require('fs');var path=require(_0x99d6('0x5'));var rimraf=require(_0x99d6('0x6'));var config=require('../../config/environment');var attributes=require(_0x99d6('0x7'));module[_0x99d6('0x8')]=function(_0x5c837f,_0x5bfd39){return _0x5c837f[_0x99d6('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x99d6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x99d6('0xb'),'collate':_0x99d6('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 2231aa4..06450d7 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 _0x145a=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','result','message','catch'];(function(_0x45aa4d,_0x2ac498){var _0x3dfbfd=function(_0x3b2d1e){while(--_0x3b2d1e){_0x45aa4d['push'](_0x45aa4d['shift']());}};_0x3dfbfd(++_0x2ac498);}(_0x145a,0x100));var _0xa145=function(_0x121f08,_0x230354){_0x121f08=_0x121f08-0x0;var _0x3a97d9=_0x145a[_0x121f08];return _0x3a97d9;};'use strict';var _=require(_0xa145('0x0'));var util=require(_0xa145('0x1'));var moment=require(_0xa145('0x2'));var BPromise=require(_0xa145('0x3'));var rs=require(_0xa145('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa145('0x5'))['db'];var utils=require(_0xa145('0x6'));var logger=require(_0xa145('0x7'))(_0xa145('0x8'));var config=require(_0xa145('0x9'));var jayson=require(_0xa145('0xa'));var client=jayson[_0xa145('0xb')][_0xa145('0xc')]({'port':0x232a});config['redis']=_[_0xa145('0xd')](config[_0xa145('0xe')],{'host':_0xa145('0xf'),'port':0x18eb});var socket=require(_0xa145('0x10'))(new Redis(config[_0xa145('0xe')]));require(_0xa145('0x11'))[_0xa145('0x12')](socket);function respondWithRpcPromise(_0xe6f304,_0x2fe332,_0x50a11f){return new BPromise(function(_0x59f71d,_0x4fccfa){return client[_0xa145('0x13')](_0xe6f304,_0x50a11f)[_0xa145('0x14')](function(_0x1e91ce){logger[_0xa145('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2fe332,'request\x20sent');logger[_0xa145('0x16')](_0xa145('0x17'),_0x2fe332,_0xa145('0x18'),JSON[_0xa145('0x19')](_0x1e91ce));if(_0x1e91ce['error']){if(_0x1e91ce[_0xa145('0x1a')][_0xa145('0x1b')]===0x1f4){logger[_0xa145('0x1a')](_0xa145('0x1c'),_0x2fe332,_0x1e91ce[_0xa145('0x1a')]['message']);return _0x4fccfa(_0x1e91ce[_0xa145('0x1a')]['message']);}logger[_0xa145('0x1a')](_0xa145('0x1c'),_0x2fe332,_0x1e91ce[_0xa145('0x1a')]['message']);return _0x59f71d(_0x1e91ce[_0xa145('0x1a')]['message']);}else{logger[_0xa145('0x15')](_0xa145('0x1c'),_0x2fe332,_0xa145('0x18'));_0x59f71d(_0x1e91ce[_0xa145('0x1d')][_0xa145('0x1e')]);}})[_0xa145('0x1f')](function(_0x207cc1){logger[_0xa145('0x1a')](_0xa145('0x1c'),_0x2fe332,_0x207cc1);_0x4fccfa(_0x207cc1);});});} \ No newline at end of file +var _0xcd9e=['socket.io-emitter','register','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcd9e,0x6e));var _0xecd9=function(_0x3205c7,_0x2709f4){_0x3205c7=_0x3205c7-0x0;var _0xdab1cd=_0xcd9e[_0x3205c7];return _0xdab1cd;};'use strict';var _=require(_0xecd9('0x0'));var util=require(_0xecd9('0x1'));var moment=require(_0xecd9('0x2'));var BPromise=require(_0xecd9('0x3'));var rs=require(_0xecd9('0x4'));var fs=require('fs');var Redis=require(_0xecd9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xecd9('0x6'));var logger=require(_0xecd9('0x7'))('rpc');var config=require(_0xecd9('0x8'));var jayson=require(_0xecd9('0x9'));var client=jayson[_0xecd9('0xa')][_0xecd9('0xb')]({'port':0x232a});config[_0xecd9('0xc')]=_[_0xecd9('0xd')](config[_0xecd9('0xc')],{'host':_0xecd9('0xe'),'port':0x18eb});var socket=require(_0xecd9('0xf'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xecd9('0x10')](socket);function respondWithRpcPromise(_0xc8c23b,_0x2460f9,_0x5cb959){return new BPromise(function(_0x51567c,_0x5b2924){return client['request'](_0xc8c23b,_0x5cb959)['then'](function(_0x4b831c){logger[_0xecd9('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x2460f9,'request\x20sent');logger[_0xecd9('0x12')](_0xecd9('0x13'),_0x2460f9,_0xecd9('0x14'),JSON['stringify'](_0x4b831c));if(_0x4b831c[_0xecd9('0x15')]){if(_0x4b831c['error']['code']===0x1f4){logger[_0xecd9('0x15')](_0xecd9('0x16'),_0x2460f9,_0x4b831c[_0xecd9('0x15')]['message']);return _0x5b2924(_0x4b831c['error']['message']);}logger[_0xecd9('0x15')](_0xecd9('0x16'),_0x2460f9,_0x4b831c[_0xecd9('0x15')]['message']);return _0x51567c(_0x4b831c[_0xecd9('0x15')][_0xecd9('0x17')]);}else{logger[_0xecd9('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x2460f9,_0xecd9('0x14'));_0x51567c(_0x4b831c[_0xecd9('0x18')][_0xecd9('0x17')]);}})['catch'](function(_0x28360a){logger[_0xecd9('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2460f9,_0x28360a);_0x5b2924(_0x28360a);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 5e475c2..31e5526 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 _0x4166=['update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x1e0e84,_0x41f33d){var _0x2d24a4=function(_0x2a2ac3){while(--_0x2a2ac3){_0x1e0e84['push'](_0x1e0e84['shift']());}};_0x2d24a4(++_0x41f33d);}(_0x4166,0x91));var _0x6416=function(_0x1bbdc0,_0x1d9d11){_0x1bbdc0=_0x1bbdc0-0x0;var _0x5da71c=_0x4166[_0x1bbdc0];return _0x5da71c;};'use strict';var ChatInternalMessageEvents=require(_0x6416('0x0'));var events=[_0x6416('0x1'),'remove',_0x6416('0x2')];function createListener(_0x9963c7,_0x25fc76){return function(_0xe5a878){_0x25fc76[_0x6416('0x3')](_0x9963c7,_0xe5a878);};}function removeListener(_0x53fb40,_0x18c246){return function(){ChatInternalMessageEvents['removeListener'](_0x53fb40,_0x18c246);};}exports[_0x6416('0x4')]=function(_0x4254b4){for(var _0x15d95a=0x0,_0x4b8bd3=events[_0x6416('0x5')];_0x15d95a<_0x4b8bd3;_0x15d95a++){var _0xf336fe=events[_0x15d95a];var _0x3af086=createListener(_0x6416('0x6')+_0xf336fe,_0x4254b4);ChatInternalMessageEvents['on'](_0xf336fe,_0x3af086);}}; \ No newline at end of file +var _0x5cb5=['save','update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x5cb5,0x68));var _0x55cb=function(_0x48a24a,_0x3cb63c){_0x48a24a=_0x48a24a-0x0;var _0x5e35d8=_0x5cb5[_0x48a24a];return _0x5e35d8;};'use strict';var ChatInternalMessageEvents=require(_0x55cb('0x0'));var events=[_0x55cb('0x1'),'remove',_0x55cb('0x2')];function createListener(_0x1eb9b3,_0x53d826){return function(_0x5d44a4){_0x53d826[_0x55cb('0x3')](_0x1eb9b3,_0x5d44a4);};}function removeListener(_0x39bcdb,_0x4783f5){return function(){ChatInternalMessageEvents['removeListener'](_0x39bcdb,_0x4783f5);};}exports[_0x55cb('0x4')]=function(_0x335be5){for(var _0x5ee9e4=0x0,_0x33e690=events[_0x55cb('0x5')];_0x5ee9e4<_0x33e690;_0x5ee9e4++){var _0x463b79=events[_0x5ee9e4];var _0x3243a9=createListener(_0x55cb('0x6')+_0x463b79,_0x335be5);ChatInternalMessageEvents['on'](_0x463b79,_0x3243a9);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index d62ed90..111a051 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 _0x355c=['isAuthenticated','/describe','/users','getUsers','show','post','create','put','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get'];(function(_0x25f350,_0x5a6a01){var _0x484427=function(_0x20a8cd){while(--_0x20a8cd){_0x25f350['push'](_0x25f350['shift']());}};_0x484427(++_0x5a6a01);}(_0x355c,0x89));var _0xc355=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x355c[_0x35da42];return _0x370035;};'use strict';var multer=require(_0xc355('0x0'));var util=require(_0xc355('0x1'));var path=require(_0xc355('0x2'));var timeout=require(_0xc355('0x3'));var express=require(_0xc355('0x4'));var router=express[_0xc355('0x5')]();var fs_extra=require(_0xc355('0x6'));var auth=require(_0xc355('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc355('0x8'));router[_0xc355('0x9')]('/',auth[_0xc355('0xa')](),controller['index']);router[_0xc355('0x9')](_0xc355('0xb'),auth[_0xc355('0xa')](),controller['describe']);router['get'](_0xc355('0xc'),auth[_0xc355('0xa')](),controller[_0xc355('0xd')]);router[_0xc355('0x9')]('/:id',auth[_0xc355('0xa')](),controller[_0xc355('0xe')]);router[_0xc355('0xf')]('/',auth[_0xc355('0xa')](),controller[_0xc355('0x10')]);router[_0xc355('0x11')]('/:id',controller['update']);router[_0xc355('0x12')](_0xc355('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xc355('0x14')]=router; \ No newline at end of file +var _0xdb77=['post','create','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','getUsers','/:id','show'];(function(_0x532852,_0xd1fa3f){var _0x4fe212=function(_0x2f4b33){while(--_0x2f4b33){_0x532852['push'](_0x532852['shift']());}};_0x4fe212(++_0xd1fa3f);}(_0xdb77,0xa0));var _0x7db7=function(_0x212a29,_0x534614){_0x212a29=_0x212a29-0x0;var _0x5b3239=_0xdb77[_0x212a29];return _0x5b3239;};'use strict';var multer=require(_0x7db7('0x0'));var util=require('util');var path=require(_0x7db7('0x1'));var timeout=require(_0x7db7('0x2'));var express=require(_0x7db7('0x3'));var router=express['Router']();var fs_extra=require(_0x7db7('0x4'));var auth=require(_0x7db7('0x5'));var interaction=require(_0x7db7('0x6'));var config=require(_0x7db7('0x7'));var controller=require(_0x7db7('0x8'));router[_0x7db7('0x9')]('/',auth[_0x7db7('0xa')](),controller['index']);router['get'](_0x7db7('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x7db7('0xc'),auth[_0x7db7('0xa')](),controller[_0x7db7('0xd')]);router[_0x7db7('0x9')](_0x7db7('0xe'),auth[_0x7db7('0xa')](),controller[_0x7db7('0xf')]);router[_0x7db7('0x10')]('/',auth[_0x7db7('0xa')](),controller[_0x7db7('0x11')]);router[_0x7db7('0x12')](_0x7db7('0xe'),controller[_0x7db7('0x13')]);router[_0x7db7('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x7db7('0x15')]);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 45e67c8..4005601 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 _0x1bd1=['BOOLEAN','DATE','STRING','sequelize','exports','TEXT'];(function(_0x23d2b1,_0x33aa9b){var _0xc2d344=function(_0x2cff18){while(--_0x2cff18){_0x23d2b1['push'](_0x23d2b1['shift']());}};_0xc2d344(++_0x33aa9b);}(_0x1bd1,0x123));var _0x11bd=function(_0x1ca3b2,_0x499086){_0x1ca3b2=_0x1ca3b2-0x0;var _0x320a2c=_0x1bd1[_0x1ca3b2];return _0x320a2c;};'use strict';var Sequelize=require(_0x11bd('0x0'));module[_0x11bd('0x1')]={'body':{'type':Sequelize[_0x11bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x11bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x11bd('0x4')]},'providerName':{'type':Sequelize[_0x11bd('0x5')]},'providerResponse':{'type':Sequelize[_0x11bd('0x2')]}}; \ No newline at end of file +var _0x6ae2=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x2bfe28,_0x428889){_0x2bfe28=_0x2bfe28-0x0;var _0x93b61e=_0x6ae2[_0x2bfe28];return _0x93b61e;};'use strict';var Sequelize=require(_0x26ae('0x0'));module[_0x26ae('0x1')]={'body':{'type':Sequelize[_0x26ae('0x2')](_0x26ae('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x26ae('0x5')]('in',_0x26ae('0x6')),'defaultValue':_0x26ae('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x26ae('0x7')]},'providerResponse':{'type':Sequelize[_0x26ae('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 411359e..2428efd 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 _0x4b4d=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','update','destroy','describe','chat-interactions','accept','chat','readAt','UserId','user','get','ChatInteraction','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','ChatInteractionId','RejectMessage','ContactId','rejectmessage','parse','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x38e853,_0x17632d){var _0x808e46=function(_0x58c848){while(--_0x58c848){_0x38e853['push'](_0x38e853['shift']());}};_0x808e46(++_0x17632d);}(_0x4b4d,0x71));var _0xd4b4=function(_0x2a24e6,_0x5a80ae){_0x2a24e6=_0x2a24e6-0x0;var _0x5bdcfc=_0x4b4d[_0x2a24e6];return _0x5bdcfc;};'use strict';var emlformat=require(_0xd4b4('0x0'));var rimraf=require(_0xd4b4('0x1'));var zipdir=require(_0xd4b4('0x2'));var jsonpatch=require(_0xd4b4('0x3'));var rp=require(_0xd4b4('0x4'));var moment=require(_0xd4b4('0x5'));var BPromise=require(_0xd4b4('0x6'));var Mustache=require(_0xd4b4('0x7'));var util=require(_0xd4b4('0x8'));var path=require(_0xd4b4('0x9'));var sox=require('sox');var csv=require(_0xd4b4('0xa'));var ejs=require(_0xd4b4('0xb'));var fs=require('fs');var fs_extra=require(_0xd4b4('0xc'));var _=require('lodash');var squel=require(_0xd4b4('0xd'));var crypto=require(_0xd4b4('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd4b4('0xf'));var Papa=require(_0xd4b4('0x10'));var Redis=require(_0xd4b4('0x11'));var authService=require(_0xd4b4('0x12'));var qs=require(_0xd4b4('0x13'));var as=require(_0xd4b4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4b4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd4b4('0x16'));var licenseUtil=require(_0xd4b4('0x17'));var db=require(_0xd4b4('0x18'))['db'];config[_0xd4b4('0x19')]=_['defaults'](config['redis'],{'host':_0xd4b4('0x1a'),'port':0x18eb});var socket=require(_0xd4b4('0x1b'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xd4b4('0x1c')](socket);var jayson=require(_0xd4b4('0x1d'));var client=jayson[_0xd4b4('0x1e')][_0xd4b4('0x1f')]({'port':0x232c});var client9002=jayson[_0xd4b4('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41b019,_0x555c0e,_0x1f76a0,_0x4454ce){return new BPromise(function(_0x4b74b1,_0x4182db){var _0x5a60e7=_0x4454ce||client;return _0x5a60e7[_0xd4b4('0x20')](_0x41b019,_0x1f76a0)['then'](function(_0x32da86){logger[_0xd4b4('0x21')]('ChatMessage,\x20%s,\x20%s',_0x555c0e,_0xd4b4('0x22'));logger[_0xd4b4('0x23')](_0xd4b4('0x24'),_0x555c0e,_0xd4b4('0x22'),JSON[_0xd4b4('0x25')](_0x32da86));if(_0x32da86[_0xd4b4('0x26')]){if(_0x32da86[_0xd4b4('0x26')][_0xd4b4('0x27')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x555c0e,_0x32da86[_0xd4b4('0x26')][_0xd4b4('0x28')]);return _0x4182db(_0x32da86[_0xd4b4('0x26')][_0xd4b4('0x28')]);}logger[_0xd4b4('0x26')](_0xd4b4('0x29'),_0x555c0e,_0x32da86['error'][_0xd4b4('0x28')]);return _0x4b74b1(_0x32da86[_0xd4b4('0x26')][_0xd4b4('0x28')]);}else{logger['info'](_0xd4b4('0x29'),_0x555c0e,'request\x20sent');_0x4b74b1(_0x32da86[_0xd4b4('0x2a')]['message']);}})[_0xd4b4('0x2b')](function(_0x25ffcf){logger[_0xd4b4('0x26')]('ChatMessage,\x20%s,\x20%s',_0x555c0e,_0x25ffcf);_0x4182db(_0x25ffcf);});});}function respondWithStatusCode(_0x2c82d3,_0x200ce6){_0x200ce6=_0x200ce6||0xcc;return function(_0x27fe47){if(_0x27fe47){return _0x2c82d3[_0xd4b4('0x2c')](_0x200ce6);}return _0x2c82d3[_0xd4b4('0x2d')](_0x200ce6)[_0xd4b4('0x2e')]();};}function respondWithResult(_0x1b9ea4,_0x10b6bf){_0x10b6bf=_0x10b6bf||0xc8;return function(_0x35c3a2){if(_0x35c3a2){return _0x1b9ea4[_0xd4b4('0x2d')](_0x10b6bf)[_0xd4b4('0x2f')](_0x35c3a2);}};}function respondWithFilteredResult(_0x1edb05,_0x59e99a){return function(_0x28f6da){if(_0x28f6da){var _0x5dcd76=typeof _0x59e99a[_0xd4b4('0x30')]===_0xd4b4('0x31')&&typeof _0x59e99a[_0xd4b4('0x32')]===_0xd4b4('0x31');var _0x17ac2d=_0x28f6da[_0xd4b4('0x33')];var _0x4f698b=_0x5dcd76?0x0:_0x59e99a[_0xd4b4('0x30')];var _0x4da644=_0x5dcd76?_0x28f6da['count']:_0x59e99a['offset']+_0x59e99a[_0xd4b4('0x32')];var _0x147bc6;if(_0x4da644>=_0x17ac2d){_0x4da644=_0x17ac2d;_0x147bc6=0xc8;}else{_0x147bc6=0xce;}_0x1edb05[_0xd4b4('0x2d')](_0x147bc6);return _0x1edb05[_0xd4b4('0x34')]('Content-Range',_0x4f698b+'-'+_0x4da644+'/'+_0x17ac2d)[_0xd4b4('0x2f')](_0x28f6da);}return null;};}function patchUpdates(_0x86e20c){return function(_0x320380){try{jsonpatch['apply'](_0x320380,_0x86e20c,!![]);}catch(_0x4feb31){return BPromise['reject'](_0x4feb31);}return _0x320380[_0xd4b4('0x35')]();};}function saveUpdates(_0x4e58d3,_0x148181){return function(_0x510a52){if(_0x510a52){return _0x510a52['update'](_0x4e58d3)['then'](function(_0x1b58b7){return _0x1b58b7;});}return null;};}function removeEntity(_0x1b5ef4,_0x5a89f7){return function(_0x1e132c){if(_0x1e132c){return _0x1e132c['destroy']()[_0xd4b4('0x36')](function(){_0x1b5ef4[_0xd4b4('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x586932,_0x113fb9){return function(_0x4566f3){if(!_0x4566f3){_0x586932['sendStatus'](0x194);}return _0x4566f3;};}function handleError(_0x80cb74,_0x4aa87c){_0x4aa87c=_0x4aa87c||0x1f4;return function(_0x3d55ff){logger['error'](_0x3d55ff[_0xd4b4('0x37')]);if(_0x3d55ff[_0xd4b4('0x38')]){delete _0x3d55ff[_0xd4b4('0x38')];}_0x80cb74['status'](_0x4aa87c)['send'](_0x3d55ff);};}exports[_0xd4b4('0x39')]=function(_0x111b7a,_0x35bc6d){var _0x1a2637={},_0x429481={},_0x4fbe2b={'count':0x0,'rows':[]};var _0x15e17b=_[_0xd4b4('0x3a')](db[_0xd4b4('0x3b')][_0xd4b4('0x3c')],function(_0x2e2c9a){return{'name':_0x2e2c9a[_0xd4b4('0x3d')],'type':_0x2e2c9a[_0xd4b4('0x3e')][_0xd4b4('0x3f')]};});_0x429481[_0xd4b4('0x40')]=_[_0xd4b4('0x3a')](_0x15e17b,_0xd4b4('0x38'));_0x429481[_0xd4b4('0x41')]=_[_0xd4b4('0x42')](_0x111b7a['query']);_0x429481['filters']=_[_0xd4b4('0x43')](_0x429481['model'],_0x429481[_0xd4b4('0x41')]);_0x1a2637[_0xd4b4('0x44')]=_[_0xd4b4('0x43')](_0x429481[_0xd4b4('0x40')],qs[_0xd4b4('0x45')](_0x111b7a[_0xd4b4('0x41')][_0xd4b4('0x45')]));_0x1a2637['attributes']=_0x1a2637[_0xd4b4('0x44')][_0xd4b4('0x46')]?_0x1a2637[_0xd4b4('0x44')]:_0x429481[_0xd4b4('0x40')];if(!_0x111b7a[_0xd4b4('0x41')][_0xd4b4('0x47')]('nolimit')){_0x1a2637[_0xd4b4('0x32')]=qs[_0xd4b4('0x32')](_0x111b7a[_0xd4b4('0x41')]['limit']);_0x1a2637['offset']=qs['offset'](_0x111b7a[_0xd4b4('0x41')][_0xd4b4('0x30')]);}_0x1a2637[_0xd4b4('0x48')]=qs[_0xd4b4('0x49')](_0x111b7a[_0xd4b4('0x41')][_0xd4b4('0x49')]);_0x1a2637[_0xd4b4('0x4a')]=qs[_0xd4b4('0x4b')](_[_0xd4b4('0x4c')](_0x111b7a[_0xd4b4('0x41')],_0x429481[_0xd4b4('0x4b')]),_0x15e17b);if(_0x111b7a['query']['filter']){_0x1a2637['where']=_[_0xd4b4('0x4d')](_0x1a2637[_0xd4b4('0x4a')],{'$or':_[_0xd4b4('0x3a')](_0x15e17b,function(_0x390838){if(_0x390838['type']!=='VIRTUAL'){var _0xa4fb9b={};_0xa4fb9b[_0x390838[_0xd4b4('0x38')]]={'$like':'%'+_0x111b7a[_0xd4b4('0x41')]['filter']+'%'};return _0xa4fb9b;}})});}_0x1a2637=_[_0xd4b4('0x4d')]({},_0x1a2637,_0x111b7a[_0xd4b4('0x4e')]);var _0xafa949={'where':_0x1a2637[_0xd4b4('0x4a')]};return db[_0xd4b4('0x3b')][_0xd4b4('0x33')](_0xafa949)[_0xd4b4('0x36')](function(_0x14967f){_0x4fbe2b[_0xd4b4('0x33')]=_0x14967f;if(_0x111b7a[_0xd4b4('0x41')][_0xd4b4('0x4f')]){_0x1a2637[_0xd4b4('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0xd4b4('0x51')](_0x1a2637);})[_0xd4b4('0x36')](function(_0x3dfa65){_0x4fbe2b[_0xd4b4('0x52')]=_0x3dfa65;return _0x4fbe2b;})[_0xd4b4('0x36')](respondWithFilteredResult(_0x35bc6d,_0x1a2637))[_0xd4b4('0x2b')](handleError(_0x35bc6d,null));};exports[_0xd4b4('0x53')]=function(_0x21dd8f,_0x4809ed){var _0x16bf39={'raw':!![],'where':{'id':_0x21dd8f[_0xd4b4('0x54')]['id']}},_0x3d48d2={};_0x3d48d2['model']=_['keys'](db[_0xd4b4('0x3b')][_0xd4b4('0x3c')]);_0x3d48d2['query']=_['keys'](_0x21dd8f[_0xd4b4('0x41')]);_0x3d48d2['filters']=_['intersection'](_0x3d48d2['model'],_0x3d48d2[_0xd4b4('0x41')]);_0x16bf39[_0xd4b4('0x44')]=_[_0xd4b4('0x43')](_0x3d48d2[_0xd4b4('0x40')],qs['fields'](_0x21dd8f[_0xd4b4('0x41')][_0xd4b4('0x45')]));_0x16bf39[_0xd4b4('0x44')]=_0x16bf39[_0xd4b4('0x44')][_0xd4b4('0x46')]?_0x16bf39[_0xd4b4('0x44')]:_0x3d48d2[_0xd4b4('0x40')];if(_0x21dd8f[_0xd4b4('0x41')]['includeAll']){_0x16bf39[_0xd4b4('0x50')]=[{'all':!![]}];}_0x16bf39=_[_0xd4b4('0x4d')]({},_0x16bf39,_0x21dd8f['options']);return db[_0xd4b4('0x3b')][_0xd4b4('0x55')](_0x16bf39)[_0xd4b4('0x36')](handleEntityNotFound(_0x4809ed,null))['then'](respondWithResult(_0x4809ed,null))[_0xd4b4('0x2b')](handleError(_0x4809ed,null));};exports['create']=function(_0x46e18b,_0x1caf91){return db[_0xd4b4('0x3b')][_0xd4b4('0x56')](_0x46e18b[_0xd4b4('0x57')],{})[_0xd4b4('0x36')](respondWithResult(_0x1caf91,0xc9))[_0xd4b4('0x2b')](handleError(_0x1caf91,null));};exports[_0xd4b4('0x58')]=function(_0x4cb09e,_0x3c02a6){if(_0x4cb09e[_0xd4b4('0x57')]['id']){delete _0x4cb09e[_0xd4b4('0x57')]['id'];}return db[_0xd4b4('0x3b')][_0xd4b4('0x55')]({'where':{'id':_0x4cb09e['params']['id']}})[_0xd4b4('0x36')](handleEntityNotFound(_0x3c02a6,null))[_0xd4b4('0x36')](saveUpdates(_0x4cb09e[_0xd4b4('0x57')],null))[_0xd4b4('0x36')](respondWithResult(_0x3c02a6,null))[_0xd4b4('0x2b')](handleError(_0x3c02a6,null));};exports[_0xd4b4('0x59')]=function(_0x78ab41,_0x12cab9){return db[_0xd4b4('0x3b')]['find']({'where':{'id':_0x78ab41[_0xd4b4('0x54')]['id']}})[_0xd4b4('0x36')](handleEntityNotFound(_0x12cab9,null))['then'](removeEntity(_0x12cab9,null))[_0xd4b4('0x2b')](handleError(_0x12cab9,null));};exports[_0xd4b4('0x5a')]=function(_0xb98f19,_0xd8e7){return db['ChatMessage']['describe']()['then'](respondWithResult(_0xd8e7,null))[_0xd4b4('0x2b')](handleError(_0xd8e7,null));};var interaction_log=require('../../config/logger')(_0xd4b4('0x5b'));exports[_0xd4b4('0x5c')]=function(_0x19548d,_0x3d561a,_0x558961){var _0x3dee7f={'agent':{},'channel':_0xd4b4('0x5d')};if(_0x19548d['body']['id']){delete _0x19548d[_0xd4b4('0x57')]['id'];}_0x19548d[_0xd4b4('0x57')]['read']=!![];_0x19548d['body'][_0xd4b4('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x19548d[_0xd4b4('0x57')]['UserId']=_0x19548d[_0xd4b4('0x57')][_0xd4b4('0x5f')]||_0x19548d[_0xd4b4('0x60')]['id'];_0x3dee7f['agent']['id']=_0x19548d[_0xd4b4('0x57')][_0xd4b4('0x5f')];return db[_0xd4b4('0x3b')][_0xd4b4('0x55')]({'where':{'id':_0x19548d['params']['id'],'UserId':null}})[_0xd4b4('0x36')](handleEntityNotFound(_0x3d561a,null))[_0xd4b4('0x36')](saveUpdates(_0x19548d[_0xd4b4('0x57')],null))[_0xd4b4('0x36')](function(_0x2e97c3){if(_0x2e97c3){_0x3dee7f['message']=_0x2e97c3[_0xd4b4('0x61')]({'plain':!![]});return db[_0xd4b4('0x62')][_0xd4b4('0x55')]({'where':{'id':_0x2e97c3['ChatInteractionId']}});}return null;})[_0xd4b4('0x36')](handleEntityNotFound(_0x3d561a,null))[_0xd4b4('0x36')](function(_0x210fa6){if(_0x210fa6){return _0x210fa6['update']({'UserId':_0x19548d[_0xd4b4('0x57')][_0xd4b4('0x5f')],'read1stAt':_[_0xd4b4('0x63')](_0x210fa6[_0xd4b4('0x64')])?moment()[_0xd4b4('0x65')](_0xd4b4('0x66')):undefined});}return null;})[_0xd4b4('0x36')](function(_0x465cf8){if(_0x465cf8){_0x3dee7f[_0xd4b4('0x67')]=_0x465cf8[_0xd4b4('0x61')]({'plain':!![]});interaction_log[_0xd4b4('0x21')](_0xd4b4('0x68'),_0x19548d[_0xd4b4('0x60')]['id'],_0x19548d[_0xd4b4('0x60')][_0xd4b4('0x38')],_0x19548d[_0xd4b4('0x60')][_0xd4b4('0x69')],_0x3dee7f[_0xd4b4('0x67')]['id'],_0x19548d[_0xd4b4('0x57')]?JSON[_0xd4b4('0x25')](_0x19548d[_0xd4b4('0x57')]):_0xd4b4('0x6a'));return respondWithRpcPromise(_0xd4b4('0x6b'),_0xd4b4('0x6c'),_0x3dee7f);}return null;})[_0xd4b4('0x36')](function(_0x438620){var _0x100d2c=_0xd4b4('0x6d')+_0x438620[_0xd4b4('0x28')]['ContactId'];return db[_0xd4b4('0x6e')][_0xd4b4('0x41')](_0x100d2c,{'type':db[_0xd4b4('0x6f')]['QueryTypes'][_0xd4b4('0x70')],'raw':!![]})[_0xd4b4('0x36')](function(_0x3e20ba){return _0x3e20ba;});})[_0xd4b4('0x36')](function(_0x27df0b){if(_0x27df0b){_0x3dee7f[_0xd4b4('0x28')][_0xd4b4('0x71')]=_0x27df0b[0x0];if(!_0x19548d[_0xd4b4('0x57')]['UserId'])return;return db[_0xd4b4('0x72')][_0xd4b4('0x55')]({'where':{'id':_0x19548d['body']['UserId'],'role':_0xd4b4('0x73')},'attributes':['id',_0xd4b4('0x38'),_0xd4b4('0x74'),_0xd4b4('0x75'),'internal'],'raw':!![]});}return null;})[_0xd4b4('0x36')](function(_0x5eebea){if(!_0x5eebea)return null;_0x3dee7f[_0xd4b4('0x28')][_0xd4b4('0x73')]=_0x5eebea;return _0x3dee7f;})[_0xd4b4('0x36')](function(_0x97905d){if(_0x97905d){if(_0x19548d[_0xd4b4('0x57')][_0xd4b4('0x76')]){_0x3dee7f[_0xd4b4('0x28')][_0xd4b4('0x77')]=util[_0xd4b4('0x65')](_0xd4b4('0x78'),_0x19548d[_0xd4b4('0x60')][_0xd4b4('0x38')]);_0x3dee7f[_0xd4b4('0x28')][_0xd4b4('0x79')]=_0x3dee7f[_0xd4b4('0x79')];_0x3dee7f['message'][_0xd4b4('0x7a')]=_0x3dee7f[_0xd4b4('0x79')];_0x3dee7f[_0xd4b4('0x28')][_0xd4b4('0x7b')]=_0xd4b4('0x5c');return respondWithRpcPromise(_0xd4b4('0x7c'),_0xd4b4('0x7c'),{'event':_0xd4b4('0x7d'),'message':_[_0xd4b4('0x4d')](_0x3dee7f[_0xd4b4('0x28')],JSON['parse'](_0x3dee7f['interaction']['formData']))},client9002)[_0xd4b4('0x36')](function(){return _0x3dee7f;});}return _0x3dee7f;}return null;})[_0xd4b4('0x36')](respondWithResult(_0x3d561a,null))[_0xd4b4('0x2b')](handleError(_0x3d561a,null));};var interaction_log=require(_0xd4b4('0x15'))(_0xd4b4('0x5b'));exports['reject']=function(_0x5ac4c5,_0x17a879,_0x3347ec){var _0x416bb3={'agent':{},'channel':_0xd4b4('0x5d')};if(_0x5ac4c5['body']['id']){delete _0x5ac4c5[_0xd4b4('0x57')]['id'];}_0x5ac4c5[_0xd4b4('0x57')][_0xd4b4('0x5f')]=_0x5ac4c5[_0xd4b4('0x57')][_0xd4b4('0x5f')]||_0x5ac4c5[_0xd4b4('0x60')]['id'];_0x416bb3[_0xd4b4('0x73')]['id']=_0x5ac4c5[_0xd4b4('0x57')][_0xd4b4('0x5f')];return db[_0xd4b4('0x3b')]['find']({'where':{'id':_0x5ac4c5[_0xd4b4('0x54')]['id'],'UserId':null}})[_0xd4b4('0x36')](handleEntityNotFound(_0x17a879,null))['then'](function(_0x598398){if(_0x598398){_0x416bb3[_0xd4b4('0x28')]=_0x598398[_0xd4b4('0x61')]({'plain':!![]});return db[_0xd4b4('0x62')][_0xd4b4('0x55')]({'where':{'id':_0x598398[_0xd4b4('0x7e')]}});}return null;})[_0xd4b4('0x36')](handleEntityNotFound(_0x17a879,null))[_0xd4b4('0x36')](function(_0x364f7a){if(_0x364f7a){_0x416bb3[_0xd4b4('0x67')]=_0x364f7a['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5ac4c5[_0xd4b4('0x60')]['id'],_0x5ac4c5[_0xd4b4('0x60')]['name'],_0x5ac4c5[_0xd4b4('0x60')]['role'],_0x416bb3[_0xd4b4('0x67')]['id'],_0x5ac4c5[_0xd4b4('0x57')]?JSON['stringify'](_0x5ac4c5['body']):'null');return respondWithRpcPromise(_0xd4b4('0x7f'),'rejectMessage',_0x416bb3);}return null;})[_0xd4b4('0x36')](function(_0x4f75d8){var _0x30916f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4f75d8[_0xd4b4('0x28')][_0xd4b4('0x80')];return db[_0xd4b4('0x6e')][_0xd4b4('0x41')](_0x30916f,{'type':db[_0xd4b4('0x6f')]['QueryTypes'][_0xd4b4('0x70')],'raw':!![]})[_0xd4b4('0x36')](function(_0x44f1ca){return _0x44f1ca;});})[_0xd4b4('0x36')](function(_0xa69a27){if(_0xa69a27){_0x416bb3[_0xd4b4('0x28')][_0xd4b4('0x71')]=_0xa69a27[0x0];if(!_0x5ac4c5[_0xd4b4('0x57')]['UserId'])return;return db[_0xd4b4('0x72')][_0xd4b4('0x55')]({'where':{'id':_0x5ac4c5[_0xd4b4('0x57')]['UserId'],'role':_0xd4b4('0x73')},'attributes':['id','name',_0xd4b4('0x74'),_0xd4b4('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x17fcd6){if(!_0x17fcd6)return null;_0x416bb3[_0xd4b4('0x28')][_0xd4b4('0x73')]=_0x17fcd6;return _0x416bb3;})[_0xd4b4('0x36')](function(_0xc6e628){if(_0xc6e628){_0xc6e628[_0xd4b4('0x28')][_0xd4b4('0x77')]=util[_0xd4b4('0x65')](_0xd4b4('0x78'),_0x5ac4c5[_0xd4b4('0x60')][_0xd4b4('0x38')]);_0xc6e628[_0xd4b4('0x28')]['channel']=_0x416bb3['channel'];_0xc6e628['message'][_0xd4b4('0x7a')]=_0x416bb3[_0xd4b4('0x79')];_0xc6e628[_0xd4b4('0x28')]['event']='reject';respondWithRpcPromise(_0xd4b4('0x7c'),'EventManager',{'event':_0xd4b4('0x81'),'message':_[_0xd4b4('0x4d')](_0x416bb3[_0xd4b4('0x28')],JSON[_0xd4b4('0x82')](_0x416bb3['interaction'][_0xd4b4('0x83')]))},client9002);return _0x416bb3;}return null;})['then'](respondWithResult(_0x17a879,null))['catch'](handleError(_0x17a879,null));}; \ No newline at end of file +var _0x6e46=['query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','then','includeAll','include','findAll','rows','show','params','create','body','find','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','SIP/%s','channel','motionChannel','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','interface','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model'];(function(_0x506181,_0x59cf27){var _0x758102=function(_0x114438){while(--_0x114438){_0x506181['push'](_0x506181['shift']());}};_0x758102(++_0x59cf27);}(_0x6e46,0xbe));var _0x66e4=function(_0x896344,_0x49b418){_0x896344=_0x896344-0x0;var _0x399677=_0x6e46[_0x896344];return _0x399677;};'use strict';var emlformat=require(_0x66e4('0x0'));var rimraf=require(_0x66e4('0x1'));var zipdir=require(_0x66e4('0x2'));var jsonpatch=require(_0x66e4('0x3'));var rp=require(_0x66e4('0x4'));var moment=require(_0x66e4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x66e4('0x6'));var csv=require('to-csv');var ejs=require(_0x66e4('0x7'));var fs=require('fs');var fs_extra=require(_0x66e4('0x8'));var _=require(_0x66e4('0x9'));var squel=require('squel');var crypto=require(_0x66e4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x66e4('0xb'));var toCsv=require(_0x66e4('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x66e4('0xd'));var authService=require(_0x66e4('0xe'));var qs=require(_0x66e4('0xf'));var as=require(_0x66e4('0x10'));var hardwareService=require(_0x66e4('0x11'));var logger=require(_0x66e4('0x12'))('api');var utils=require(_0x66e4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x66e4('0x14'));var db=require(_0x66e4('0x15'))['db'];config['redis']=_[_0x66e4('0x16')](config[_0x66e4('0x17')],{'host':_0x66e4('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66e4('0x17')]));require(_0x66e4('0x19'))[_0x66e4('0x1a')](socket);var jayson=require(_0x66e4('0x1b'));var client=jayson[_0x66e4('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x66e4('0x1c')][_0x66e4('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x47df71,_0x2d9041,_0x5a0131,_0x1f8266){return new BPromise(function(_0x31c09a,_0x275ae4){var _0x2dd1e1=_0x1f8266||client;return _0x2dd1e1[_0x66e4('0x1e')](_0x47df71,_0x5a0131)['then'](function(_0x412752){logger[_0x66e4('0x1f')](_0x66e4('0x20'),_0x2d9041,_0x66e4('0x21'));logger[_0x66e4('0x22')](_0x66e4('0x23'),_0x2d9041,_0x66e4('0x21'),JSON[_0x66e4('0x24')](_0x412752));if(_0x412752[_0x66e4('0x25')]){if(_0x412752[_0x66e4('0x25')][_0x66e4('0x26')]===0x1f4){logger[_0x66e4('0x25')](_0x66e4('0x20'),_0x2d9041,_0x412752[_0x66e4('0x25')][_0x66e4('0x27')]);return _0x275ae4(_0x412752[_0x66e4('0x25')][_0x66e4('0x27')]);}logger[_0x66e4('0x25')](_0x66e4('0x20'),_0x2d9041,_0x412752['error']['message']);return _0x31c09a(_0x412752['error']['message']);}else{logger[_0x66e4('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x2d9041,_0x66e4('0x21'));_0x31c09a(_0x412752[_0x66e4('0x28')][_0x66e4('0x27')]);}})[_0x66e4('0x29')](function(_0x27f6e5){logger['error']('ChatMessage,\x20%s,\x20%s',_0x2d9041,_0x27f6e5);_0x275ae4(_0x27f6e5);});});}function respondWithStatusCode(_0x4336dc,_0x271843){_0x271843=_0x271843||0xcc;return function(_0x1504cb){if(_0x1504cb){return _0x4336dc[_0x66e4('0x2a')](_0x271843);}return _0x4336dc[_0x66e4('0x2b')](_0x271843)[_0x66e4('0x2c')]();};}function respondWithResult(_0x136780,_0xb362bd){_0xb362bd=_0xb362bd||0xc8;return function(_0x368a7f){if(_0x368a7f){return _0x136780['status'](_0xb362bd)[_0x66e4('0x2d')](_0x368a7f);}};}function respondWithFilteredResult(_0x18bee2,_0x439357){return function(_0x127414){if(_0x127414){var _0x2c9b67=typeof _0x439357[_0x66e4('0x2e')]===_0x66e4('0x2f')&&typeof _0x439357[_0x66e4('0x30')]===_0x66e4('0x2f');var _0x4d468e=_0x127414[_0x66e4('0x31')];var _0x518817=_0x2c9b67?0x0:_0x439357[_0x66e4('0x2e')];var _0x54e9d7=_0x2c9b67?_0x127414[_0x66e4('0x31')]:_0x439357['offset']+_0x439357[_0x66e4('0x30')];var _0x593b70;if(_0x54e9d7>=_0x4d468e){_0x54e9d7=_0x4d468e;_0x593b70=0xc8;}else{_0x593b70=0xce;}_0x18bee2['status'](_0x593b70);return _0x18bee2[_0x66e4('0x32')](_0x66e4('0x33'),_0x518817+'-'+_0x54e9d7+'/'+_0x4d468e)[_0x66e4('0x2d')](_0x127414);}return null;};}function patchUpdates(_0x4981f3){return function(_0x3525c8){try{jsonpatch['apply'](_0x3525c8,_0x4981f3,!![]);}catch(_0x5927cd){return BPromise['reject'](_0x5927cd);}return _0x3525c8[_0x66e4('0x34')]();};}function saveUpdates(_0x1de740,_0xd2b89d){return function(_0x5c6f54){if(_0x5c6f54){return _0x5c6f54[_0x66e4('0x35')](_0x1de740)['then'](function(_0x29b07f){return _0x29b07f;});}return null;};}function removeEntity(_0x1de011,_0x11ea3c){return function(_0x2898a5){if(_0x2898a5){return _0x2898a5[_0x66e4('0x36')]()['then'](function(){_0x1de011['status'](0xcc)[_0x66e4('0x2c')]();});}};}function handleEntityNotFound(_0x2481ee,_0x45db5d){return function(_0xd3e2de){if(!_0xd3e2de){_0x2481ee[_0x66e4('0x2a')](0x194);}return _0xd3e2de;};}function handleError(_0x22652f,_0x1846e9){_0x1846e9=_0x1846e9||0x1f4;return function(_0x5ec3e1){logger[_0x66e4('0x25')](_0x5ec3e1[_0x66e4('0x37')]);if(_0x5ec3e1['name']){delete _0x5ec3e1[_0x66e4('0x38')];}_0x22652f['status'](_0x1846e9)[_0x66e4('0x39')](_0x5ec3e1);};}exports[_0x66e4('0x3a')]=function(_0x3fa070,_0x451bf0){var _0x585e5b={},_0x267368={},_0x48351c={'count':0x0,'rows':[]};var _0x1262ca=_[_0x66e4('0x3b')](db[_0x66e4('0x3c')][_0x66e4('0x3d')],function(_0x3d69a6){return{'name':_0x3d69a6[_0x66e4('0x3e')],'type':_0x3d69a6[_0x66e4('0x3f')][_0x66e4('0x40')]};});_0x267368[_0x66e4('0x41')]=_[_0x66e4('0x3b')](_0x1262ca,_0x66e4('0x38'));_0x267368[_0x66e4('0x42')]=_[_0x66e4('0x43')](_0x3fa070['query']);_0x267368[_0x66e4('0x44')]=_[_0x66e4('0x45')](_0x267368[_0x66e4('0x41')],_0x267368[_0x66e4('0x42')]);_0x585e5b['attributes']=_['intersection'](_0x267368[_0x66e4('0x41')],qs[_0x66e4('0x46')](_0x3fa070[_0x66e4('0x42')][_0x66e4('0x46')]));_0x585e5b[_0x66e4('0x47')]=_0x585e5b[_0x66e4('0x47')][_0x66e4('0x48')]?_0x585e5b[_0x66e4('0x47')]:_0x267368[_0x66e4('0x41')];if(!_0x3fa070[_0x66e4('0x42')]['hasOwnProperty'](_0x66e4('0x49'))){_0x585e5b[_0x66e4('0x30')]=qs[_0x66e4('0x30')](_0x3fa070[_0x66e4('0x42')][_0x66e4('0x30')]);_0x585e5b[_0x66e4('0x2e')]=qs[_0x66e4('0x2e')](_0x3fa070['query'][_0x66e4('0x2e')]);}_0x585e5b['order']=qs[_0x66e4('0x4a')](_0x3fa070[_0x66e4('0x42')]['sort']);_0x585e5b[_0x66e4('0x4b')]=qs[_0x66e4('0x44')](_[_0x66e4('0x4c')](_0x3fa070[_0x66e4('0x42')],_0x267368[_0x66e4('0x44')]),_0x1262ca);if(_0x3fa070[_0x66e4('0x42')]['filter']){_0x585e5b[_0x66e4('0x4b')]=_[_0x66e4('0x4d')](_0x585e5b[_0x66e4('0x4b')],{'$or':_[_0x66e4('0x3b')](_0x1262ca,function(_0x3275d5){if(_0x3275d5[_0x66e4('0x3f')]!=='VIRTUAL'){var _0x58f75c={};_0x58f75c[_0x3275d5['name']]={'$like':'%'+_0x3fa070[_0x66e4('0x42')]['filter']+'%'};return _0x58f75c;}})});}_0x585e5b=_[_0x66e4('0x4d')]({},_0x585e5b,_0x3fa070['options']);var _0x114b45={'where':_0x585e5b[_0x66e4('0x4b')]};return db[_0x66e4('0x3c')][_0x66e4('0x31')](_0x114b45)[_0x66e4('0x4e')](function(_0x261afc){_0x48351c[_0x66e4('0x31')]=_0x261afc;if(_0x3fa070[_0x66e4('0x42')][_0x66e4('0x4f')]){_0x585e5b[_0x66e4('0x50')]=[{'all':!![]}];}return db[_0x66e4('0x3c')][_0x66e4('0x51')](_0x585e5b);})[_0x66e4('0x4e')](function(_0x24276a){_0x48351c[_0x66e4('0x52')]=_0x24276a;return _0x48351c;})['then'](respondWithFilteredResult(_0x451bf0,_0x585e5b))[_0x66e4('0x29')](handleError(_0x451bf0,null));};exports[_0x66e4('0x53')]=function(_0x24e6ce,_0x5c0b3f){var _0x22b120={'raw':!![],'where':{'id':_0x24e6ce[_0x66e4('0x54')]['id']}},_0x5554d5={};_0x5554d5['model']=_[_0x66e4('0x43')](db[_0x66e4('0x3c')][_0x66e4('0x3d')]);_0x5554d5['query']=_['keys'](_0x24e6ce[_0x66e4('0x42')]);_0x5554d5['filters']=_[_0x66e4('0x45')](_0x5554d5[_0x66e4('0x41')],_0x5554d5[_0x66e4('0x42')]);_0x22b120[_0x66e4('0x47')]=_['intersection'](_0x5554d5['model'],qs[_0x66e4('0x46')](_0x24e6ce[_0x66e4('0x42')][_0x66e4('0x46')]));_0x22b120['attributes']=_0x22b120[_0x66e4('0x47')][_0x66e4('0x48')]?_0x22b120[_0x66e4('0x47')]:_0x5554d5[_0x66e4('0x41')];if(_0x24e6ce[_0x66e4('0x42')][_0x66e4('0x4f')]){_0x22b120['include']=[{'all':!![]}];}_0x22b120=_[_0x66e4('0x4d')]({},_0x22b120,_0x24e6ce['options']);return db[_0x66e4('0x3c')]['find'](_0x22b120)['then'](handleEntityNotFound(_0x5c0b3f,null))[_0x66e4('0x4e')](respondWithResult(_0x5c0b3f,null))['catch'](handleError(_0x5c0b3f,null));};exports[_0x66e4('0x55')]=function(_0x4b0cef,_0x290724){return db['ChatMessage'][_0x66e4('0x55')](_0x4b0cef['body'],{})[_0x66e4('0x4e')](respondWithResult(_0x290724,0xc9))['catch'](handleError(_0x290724,null));};exports[_0x66e4('0x35')]=function(_0x5259e4,_0x7df1f3){if(_0x5259e4[_0x66e4('0x56')]['id']){delete _0x5259e4['body']['id'];}return db[_0x66e4('0x3c')][_0x66e4('0x57')]({'where':{'id':_0x5259e4[_0x66e4('0x54')]['id']}})[_0x66e4('0x4e')](handleEntityNotFound(_0x7df1f3,null))[_0x66e4('0x4e')](saveUpdates(_0x5259e4[_0x66e4('0x56')],null))[_0x66e4('0x4e')](respondWithResult(_0x7df1f3,null))['catch'](handleError(_0x7df1f3,null));};exports[_0x66e4('0x36')]=function(_0x38ac03,_0x45180f){return db[_0x66e4('0x3c')][_0x66e4('0x57')]({'where':{'id':_0x38ac03['params']['id']}})[_0x66e4('0x4e')](handleEntityNotFound(_0x45180f,null))[_0x66e4('0x4e')](removeEntity(_0x45180f,null))[_0x66e4('0x29')](handleError(_0x45180f,null));};exports[_0x66e4('0x58')]=function(_0x350b88,_0xf6287b){return db[_0x66e4('0x3c')][_0x66e4('0x58')]()[_0x66e4('0x4e')](respondWithResult(_0xf6287b,null))[_0x66e4('0x29')](handleError(_0xf6287b,null));};var interaction_log=require(_0x66e4('0x12'))(_0x66e4('0x59'));exports[_0x66e4('0x5a')]=function(_0x417966,_0x12167c,_0x1fe6b5){var _0x4c73e5={'agent':{},'channel':_0x66e4('0x5b')};if(_0x417966['body']['id']){delete _0x417966[_0x66e4('0x56')]['id'];}_0x417966['body'][_0x66e4('0x5c')]=!![];_0x417966['body']['readAt']=moment()[_0x66e4('0x5d')](_0x66e4('0x5e'));_0x417966[_0x66e4('0x56')][_0x66e4('0x5f')]=_0x417966[_0x66e4('0x56')][_0x66e4('0x5f')]||_0x417966[_0x66e4('0x60')]['id'];_0x4c73e5[_0x66e4('0x61')]['id']=_0x417966[_0x66e4('0x56')][_0x66e4('0x5f')];return db['ChatMessage']['find']({'where':{'id':_0x417966[_0x66e4('0x54')]['id'],'UserId':null}})[_0x66e4('0x4e')](handleEntityNotFound(_0x12167c,null))['then'](saveUpdates(_0x417966[_0x66e4('0x56')],null))[_0x66e4('0x4e')](function(_0x4c2617){if(_0x4c2617){_0x4c73e5['message']=_0x4c2617[_0x66e4('0x62')]({'plain':!![]});return db[_0x66e4('0x63')][_0x66e4('0x57')]({'where':{'id':_0x4c2617[_0x66e4('0x64')]}});}return null;})[_0x66e4('0x4e')](handleEntityNotFound(_0x12167c,null))['then'](function(_0x220c38){if(_0x220c38){return _0x220c38['update']({'UserId':_0x417966[_0x66e4('0x56')][_0x66e4('0x5f')],'read1stAt':_['isNil'](_0x220c38[_0x66e4('0x65')])?moment()[_0x66e4('0x5d')](_0x66e4('0x5e')):undefined});}return null;})[_0x66e4('0x4e')](function(_0x501d03){if(_0x501d03){_0x4c73e5['interaction']=_0x501d03[_0x66e4('0x62')]({'plain':!![]});interaction_log[_0x66e4('0x1f')](_0x66e4('0x66'),_0x417966[_0x66e4('0x60')]['id'],_0x417966[_0x66e4('0x60')][_0x66e4('0x38')],_0x417966['user'][_0x66e4('0x67')],_0x4c73e5[_0x66e4('0x68')]['id'],_0x417966[_0x66e4('0x56')]?JSON['stringify'](_0x417966[_0x66e4('0x56')]):_0x66e4('0x69'));return respondWithRpcPromise(_0x66e4('0x6a'),_0x66e4('0x6b'),_0x4c73e5);}return null;})[_0x66e4('0x4e')](function(_0x23a077){var _0x1c096a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x23a077[_0x66e4('0x27')][_0x66e4('0x6c')];return db[_0x66e4('0x6d')][_0x66e4('0x42')](_0x1c096a,{'type':db[_0x66e4('0x6e')][_0x66e4('0x6f')][_0x66e4('0x70')],'raw':!![]})[_0x66e4('0x4e')](function(_0x339861){return _0x339861;});})[_0x66e4('0x4e')](function(_0xc44484){if(_0xc44484){_0x4c73e5[_0x66e4('0x27')]['contact']=_0xc44484[0x0];if(!_0x417966['body'][_0x66e4('0x5f')])return;return db['User'][_0x66e4('0x57')]({'where':{'id':_0x417966[_0x66e4('0x56')][_0x66e4('0x5f')],'role':_0x66e4('0x61')},'attributes':['id',_0x66e4('0x38'),_0x66e4('0x71'),_0x66e4('0x72'),_0x66e4('0x73')],'raw':!![]});}return null;})['then'](function(_0x568c0a){if(!_0x568c0a)return null;_0x4c73e5[_0x66e4('0x27')][_0x66e4('0x61')]=_0x568c0a;return _0x4c73e5;})[_0x66e4('0x4e')](function(_0x125b92){if(_0x125b92){if(_0x417966[_0x66e4('0x56')]['manual']){_0x4c73e5['message']['interface']=util['format'](_0x66e4('0x74'),_0x417966['user'][_0x66e4('0x38')]);_0x4c73e5[_0x66e4('0x27')][_0x66e4('0x75')]=_0x4c73e5['channel'];_0x4c73e5[_0x66e4('0x27')][_0x66e4('0x76')]=_0x4c73e5[_0x66e4('0x75')];_0x4c73e5[_0x66e4('0x27')]['event']=_0x66e4('0x5a');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x66e4('0x77'),'message':_[_0x66e4('0x4d')](_0x4c73e5[_0x66e4('0x27')],JSON['parse'](_0x4c73e5[_0x66e4('0x68')][_0x66e4('0x78')]))},client9002)[_0x66e4('0x4e')](function(){return _0x4c73e5;});}return _0x4c73e5;}return null;})[_0x66e4('0x4e')](respondWithResult(_0x12167c,null))[_0x66e4('0x29')](handleError(_0x12167c,null));};var interaction_log=require(_0x66e4('0x12'))(_0x66e4('0x59'));exports[_0x66e4('0x79')]=function(_0x201bd7,_0x2a8b32,_0x1098cb){var _0x401fc3={'agent':{},'channel':_0x66e4('0x5b')};if(_0x201bd7[_0x66e4('0x56')]['id']){delete _0x201bd7['body']['id'];}_0x201bd7[_0x66e4('0x56')][_0x66e4('0x5f')]=_0x201bd7[_0x66e4('0x56')][_0x66e4('0x5f')]||_0x201bd7['user']['id'];_0x401fc3['agent']['id']=_0x201bd7[_0x66e4('0x56')][_0x66e4('0x5f')];return db[_0x66e4('0x3c')][_0x66e4('0x57')]({'where':{'id':_0x201bd7['params']['id'],'UserId':null}})[_0x66e4('0x4e')](handleEntityNotFound(_0x2a8b32,null))[_0x66e4('0x4e')](function(_0x33c79e){if(_0x33c79e){_0x401fc3['message']=_0x33c79e['get']({'plain':!![]});return db[_0x66e4('0x63')]['find']({'where':{'id':_0x33c79e[_0x66e4('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x2a8b32,null))[_0x66e4('0x4e')](function(_0x511e8a){if(_0x511e8a){_0x401fc3[_0x66e4('0x68')]=_0x511e8a[_0x66e4('0x62')]({'plain':!![]});interaction_log[_0x66e4('0x1f')](_0x66e4('0x7a'),_0x201bd7[_0x66e4('0x60')]['id'],_0x201bd7['user']['name'],_0x201bd7[_0x66e4('0x60')]['role'],_0x401fc3[_0x66e4('0x68')]['id'],_0x201bd7[_0x66e4('0x56')]?JSON[_0x66e4('0x24')](_0x201bd7[_0x66e4('0x56')]):_0x66e4('0x69'));return respondWithRpcPromise(_0x66e4('0x7b'),_0x66e4('0x7c'),_0x401fc3);}return null;})[_0x66e4('0x4e')](function(_0x56e429){var _0x23a246=_0x66e4('0x7d')+_0x56e429[_0x66e4('0x27')]['ContactId'];return db[_0x66e4('0x6d')]['query'](_0x23a246,{'type':db[_0x66e4('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})[_0x66e4('0x4e')](function(_0x3a563e){return _0x3a563e;});})[_0x66e4('0x4e')](function(_0x34ec50){if(_0x34ec50){_0x401fc3[_0x66e4('0x27')]['contact']=_0x34ec50[0x0];if(!_0x201bd7['body'][_0x66e4('0x5f')])return;return db['User'][_0x66e4('0x57')]({'where':{'id':_0x201bd7[_0x66e4('0x56')][_0x66e4('0x5f')],'role':_0x66e4('0x61')},'attributes':['id',_0x66e4('0x38'),_0x66e4('0x71'),_0x66e4('0x72'),_0x66e4('0x73')],'raw':!![]});}return null;})[_0x66e4('0x4e')](function(_0x2a4f90){if(!_0x2a4f90)return null;_0x401fc3[_0x66e4('0x27')][_0x66e4('0x61')]=_0x2a4f90;return _0x401fc3;})[_0x66e4('0x4e')](function(_0x1b6ae2){if(_0x1b6ae2){_0x1b6ae2[_0x66e4('0x27')][_0x66e4('0x7e')]=util['format'](_0x66e4('0x74'),_0x201bd7[_0x66e4('0x60')]['name']);_0x1b6ae2['message'][_0x66e4('0x75')]=_0x401fc3[_0x66e4('0x75')];_0x1b6ae2[_0x66e4('0x27')][_0x66e4('0x76')]=_0x401fc3[_0x66e4('0x75')];_0x1b6ae2['message']['event']=_0x66e4('0x79');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0x66e4('0x4d')](_0x401fc3[_0x66e4('0x27')],JSON[_0x66e4('0x7f')](_0x401fc3[_0x66e4('0x68')]['formData']))},client9002);return _0x401fc3;}return null;})[_0x66e4('0x4e')](respondWithResult(_0x2a8b32,null))[_0x66e4('0x29')](handleError(_0x2a8b32,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index a314ac2..7a8d69c 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 _0x3f36=['ChatMessage','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x3f25ee,_0x9c86df){var _0x2523fd=function(_0x98679e){while(--_0x98679e){_0x3f25ee['push'](_0x3f25ee['shift']());}};_0x2523fd(++_0x9c86df);}(_0x3f36,0x176));var _0x63f3=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x3f36[_0x5a1cc9];return _0x471761;};'use strict';var EventEmitter=require(_0x63f3('0x0'));var ChatMessage=require(_0x63f3('0x1'))['db'][_0x63f3('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x63f3('0x3'),'afterUpdate':_0x63f3('0x4'),'afterDestroy':_0x63f3('0x5')};function emitEvent(_0x45ffd4){return function(_0x482d1f,_0x281c90,_0x4c503b){ChatMessageEvents[_0x63f3('0x6')](_0x45ffd4+':'+_0x482d1f['id'],_0x482d1f);ChatMessageEvents[_0x63f3('0x6')](_0x45ffd4,_0x482d1f);_0x4c503b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x63f3('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x03cc=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','ChatMessage'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x03cc,0x17e));var _0xc03c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x03cc[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0xc03c('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xc03c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc03c('0x2')](0x0);var events={'afterCreate':_0xc03c('0x3'),'afterUpdate':'update','afterDestroy':_0xc03c('0x4')};function emitEvent(_0x216cb5){return function(_0x104bbf,_0x3b2f9b,_0x448f68){ChatMessageEvents[_0xc03c('0x5')](_0x216cb5+':'+_0x104bbf['id'],_0x104bbf);ChatMessageEvents[_0xc03c('0x5')](_0x216cb5,_0x104bbf);_0x448f68(null);};}for(var e in events){if(events[_0xc03c('0x6')](e)){var event=events[e];ChatMessage[_0xc03c('0x7')](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 51494b4..0d10526 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 _0x507e=['ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','./chatMessage.attributes','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne'];(function(_0x40292e,_0xaa2a7b){var _0x1ed986=function(_0x10dbef){while(--_0x10dbef){_0x40292e['push'](_0x40292e['shift']());}};_0x1ed986(++_0xaa2a7b);}(_0x507e,0x98));var _0xe507=function(_0x2fcf18,_0x10009a){_0x2fcf18=_0x2fcf18-0x0;var _0x4c68cc=_0x507e[_0x2fcf18];return _0x4c68cc;};'use strict';var _=require(_0xe507('0x0'));var util=require(_0xe507('0x1'));var logger=require(_0xe507('0x2'))(_0xe507('0x3'));var moment=require(_0xe507('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe507('0x5'));var rimraf=require(_0xe507('0x6'));var config=require('../../config/environment');var attributes=require(_0xe507('0x7'));module['exports']=function(_0x2245d7,_0x1066e7){return _0x2245d7['define'](_0xe507('0x8'),attributes,{'tableName':_0xe507('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xe507('0xa')],'type':_0xe507('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xb4b049,_0x3e7dd5,_0xc9796e){var _0x21094f=_0x2245d7[_0xe507('0xc')];var _0x1663ec=_0xb4b049[_0xe507('0xd')]({'plain':!![]});if(_0x1663ec[_0xe507('0xe')][_0xe507('0xf')]()==='in'||_0x1663ec[_0xe507('0xe')]['toLowerCase']()===_0xe507('0x10')&&!_0x1663ec[_0xe507('0x11')]&&!_[_0xe507('0x12')](_0x1663ec[_0xe507('0x13')])){_0x21094f[_0xe507('0x14')][_0xe507('0x15')]({'where':{'id':_0x1663ec[_0xe507('0x16')]}})[_0xe507('0x17')](function(_0x2256ac){if(_0x2256ac){_0x2256ac[_0xe507('0x18')]({'lastMsgAt':_0x1663ec['createdAt'],'lastMsgDirection':_0x1663ec[_0xe507('0xe')][_0xe507('0xf')]()});}})[_0xe507('0x19')](function(_0x55250c){console[_0xe507('0x1a')](_0x55250c);});}_0xc9796e();}},'charset':_0xe507('0x1b'),'collate':_0xe507('0x1c')});}; \ No newline at end of file +var _0x3544=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','UserId','ChatInteraction','ChatInteractionId','then','update','catch','error'];(function(_0x9ce050,_0x591cd4){var _0x3f754e=function(_0x1e61fc){while(--_0x1e61fc){_0x9ce050['push'](_0x9ce050['shift']());}};_0x3f754e(++_0x591cd4);}(_0x3544,0x70));var _0x4354=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x3544[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x4354('0x0'));var util=require(_0x4354('0x1'));var logger=require(_0x4354('0x2'))('api');var moment=require(_0x4354('0x3'));var BPromise=require(_0x4354('0x4'));var rp=require(_0x4354('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4354('0x6'));var config=require(_0x4354('0x7'));var attributes=require(_0x4354('0x8'));module[_0x4354('0x9')]=function(_0x5ca913,_0x4a0e1e){return _0x5ca913[_0x4354('0xa')](_0x4354('0xb'),attributes,{'tableName':_0x4354('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x4354('0xd')],'type':_0x4354('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x537b64,_0x114701,_0xbc0c35){var _0x42bc38=_0x5ca913[_0x4354('0xf')];var _0x20cef4=_0x537b64[_0x4354('0x10')]({'plain':!![]});if(_0x20cef4['direction'][_0x4354('0x11')]()==='in'||_0x20cef4[_0x4354('0x12')][_0x4354('0x11')]()===_0x4354('0x13')&&!_0x20cef4[_0x4354('0x14')]&&!_['isNil'](_0x20cef4[_0x4354('0x15')])){_0x42bc38[_0x4354('0x16')]['findOne']({'where':{'id':_0x20cef4[_0x4354('0x17')]}})[_0x4354('0x18')](function(_0x523449){if(_0x523449){_0x523449[_0x4354('0x19')]({'lastMsgAt':_0x20cef4['createdAt'],'lastMsgDirection':_0x20cef4[_0x4354('0x12')]['toLowerCase']()});}})[_0x4354('0x1a')](function(_0x18bcfd){console[_0x4354('0x1b')](_0x18bcfd);});}_0xbc0c35();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 40ad3b4..b2ef45f 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 _0xadc2=['stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateChatMessage','ChatMessage','create','options','raw'];(function(_0x31e4c6,_0x27d39c){var _0x56c225=function(_0x54fb1a){while(--_0x54fb1a){_0x31e4c6['push'](_0x31e4c6['shift']());}};_0x56c225(++_0x27d39c);}(_0xadc2,0x187));var _0x2adc=function(_0x79a6e8,_0x1c2b24){_0x79a6e8=_0x79a6e8-0x0;var _0xeeb993=_0xadc2[_0x79a6e8];return _0xeeb993;};'use strict';var _=require(_0x2adc('0x0'));var util=require('util');var moment=require(_0x2adc('0x1'));var BPromise=require(_0x2adc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2adc('0x3'));var db=require(_0x2adc('0x4'))['db'];var utils=require(_0x2adc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2adc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2adc('0x7')]['http']({'port':0x232a});config[_0x2adc('0x8')]=_[_0x2adc('0x9')](config[_0x2adc('0x8')],{'host':_0x2adc('0xa'),'port':0x18eb});var socket=require(_0x2adc('0xb'))(new Redis(config[_0x2adc('0x8')]));require(_0x2adc('0xc'))['register'](socket);function respondWithRpcPromise(_0x5ecc9e,_0x47bd14,_0x2004d4){return new BPromise(function(_0x195413,_0x4f0a5f){return client[_0x2adc('0xd')](_0x5ecc9e,_0x2004d4)[_0x2adc('0xe')](function(_0x2fc249){logger[_0x2adc('0xf')](_0x2adc('0x10'),_0x47bd14,_0x2adc('0x11'));logger[_0x2adc('0x12')](_0x2adc('0x13'),_0x47bd14,_0x2adc('0x11'),JSON['stringify'](_0x2fc249));if(_0x2fc249[_0x2adc('0x14')]){if(_0x2fc249['error'][_0x2adc('0x15')]===0x1f4){logger[_0x2adc('0x14')](_0x2adc('0x10'),_0x47bd14,_0x2fc249[_0x2adc('0x14')][_0x2adc('0x16')]);return _0x4f0a5f(_0x2fc249[_0x2adc('0x14')][_0x2adc('0x16')]);}logger[_0x2adc('0x14')](_0x2adc('0x10'),_0x47bd14,_0x2fc249['error'][_0x2adc('0x16')]);return _0x195413(_0x2fc249[_0x2adc('0x14')][_0x2adc('0x16')]);}else{logger[_0x2adc('0xf')](_0x2adc('0x10'),_0x47bd14,_0x2adc('0x11'));_0x195413(_0x2fc249['result'][_0x2adc('0x16')]);}})[_0x2adc('0x17')](function(_0x532936){logger['error'](_0x2adc('0x10'),_0x47bd14,_0x532936);_0x4f0a5f(_0x532936);});});}exports[_0x2adc('0x18')]=function(_0x4ae909){var _0x58f93b=this;return new Promise(function(_0x7a68e1,_0xae0697){return db[_0x2adc('0x19')][_0x2adc('0x1a')](_0x4ae909['body'],{'raw':_0x4ae909[_0x2adc('0x1b')]?_0x4ae909[_0x2adc('0x1b')][_0x2adc('0x1c')]===undefined?!![]:![]:!![]})[_0x2adc('0xe')](function(_0x5382f2){logger[_0x2adc('0xf')](_0x2adc('0x18'),_0x4ae909);logger[_0x2adc('0x12')](_0x2adc('0x18'),_0x4ae909,JSON[_0x2adc('0x1d')](_0x5382f2));_0x7a68e1(_0x5382f2);})[_0x2adc('0x17')](function(_0xe53f4b){logger[_0x2adc('0x14')](_0x2adc('0x18'),_0xe53f4b['message'],_0x4ae909);_0xae0697(_0x58f93b[_0x2adc('0x14')](0x1f4,_0xe53f4b['message']));});});}; \ No newline at end of file +var _0x46f2=['localhost','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','create','body','raw','debug','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x542f28,_0x56b45d){var _0x4b728c=function(_0x41acd4){while(--_0x41acd4){_0x542f28['push'](_0x542f28['shift']());}};_0x4b728c(++_0x56b45d);}(_0x46f2,0x133));var _0x246f=function(_0x5d7bfa,_0x1c1789){_0x5d7bfa=_0x5d7bfa-0x0;var _0x341b8e=_0x46f2[_0x5d7bfa];return _0x341b8e;};'use strict';var _=require(_0x246f('0x0'));var util=require(_0x246f('0x1'));var moment=require(_0x246f('0x2'));var BPromise=require(_0x246f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x246f('0x4'));var db=require(_0x246f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x246f('0x6'))(_0x246f('0x7'));var config=require(_0x246f('0x8'));var jayson=require(_0x246f('0x9'));var client=jayson[_0x246f('0xa')][_0x246f('0xb')]({'port':0x232a});config[_0x246f('0xc')]=_['defaults'](config[_0x246f('0xc')],{'host':_0x246f('0xd'),'port':0x18eb});var socket=require(_0x246f('0xe'))(new Redis(config[_0x246f('0xc')]));require('./chatMessage.socket')[_0x246f('0xf')](socket);function respondWithRpcPromise(_0x132223,_0x4a0a64,_0x9c91a1){return new BPromise(function(_0x85a6e,_0x3fe60f){return client[_0x246f('0x10')](_0x132223,_0x9c91a1)[_0x246f('0x11')](function(_0x590e22){logger['info'](_0x246f('0x12'),_0x4a0a64,_0x246f('0x13'));logger['debug'](_0x246f('0x14'),_0x4a0a64,_0x246f('0x13'),JSON['stringify'](_0x590e22));if(_0x590e22[_0x246f('0x15')]){if(_0x590e22[_0x246f('0x15')][_0x246f('0x16')]===0x1f4){logger['error'](_0x246f('0x12'),_0x4a0a64,_0x590e22[_0x246f('0x15')][_0x246f('0x17')]);return _0x3fe60f(_0x590e22['error'][_0x246f('0x17')]);}logger[_0x246f('0x15')](_0x246f('0x12'),_0x4a0a64,_0x590e22[_0x246f('0x15')]['message']);return _0x85a6e(_0x590e22['error']['message']);}else{logger['info'](_0x246f('0x12'),_0x4a0a64,_0x246f('0x13'));_0x85a6e(_0x590e22[_0x246f('0x18')][_0x246f('0x17')]);}})[_0x246f('0x19')](function(_0x5718e3){logger[_0x246f('0x15')](_0x246f('0x12'),_0x4a0a64,_0x5718e3);_0x3fe60f(_0x5718e3);});});}exports[_0x246f('0x1a')]=function(_0x2d55ab){var _0x3d5f8d=this;return new Promise(function(_0x798d82,_0x32c39f){return db['ChatMessage'][_0x246f('0x1b')](_0x2d55ab[_0x246f('0x1c')],{'raw':_0x2d55ab['options']?_0x2d55ab['options'][_0x246f('0x1d')]===undefined?!![]:![]:!![]})[_0x246f('0x11')](function(_0x16e4ff){logger['info'](_0x246f('0x1a'),_0x2d55ab);logger[_0x246f('0x1e')](_0x246f('0x1a'),_0x2d55ab,JSON[_0x246f('0x1f')](_0x16e4ff));_0x798d82(_0x16e4ff);})[_0x246f('0x19')](function(_0x2aace3){logger[_0x246f('0x15')]('CreateChatMessage',_0x2aace3[_0x246f('0x17')],_0x2d55ab);_0x32c39f(_0x3d5f8d['error'](0x1f4,_0x2aace3[_0x246f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 2f93300..e35e768 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 _0x432b=['remove','update','removeListener','length','chatMessage:','./chatMessage.events'];(function(_0x456cbb,_0x547275){var _0x9c3a70=function(_0x1c8686){while(--_0x1c8686){_0x456cbb['push'](_0x456cbb['shift']());}};_0x9c3a70(++_0x547275);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0xb432('0x0'));var events=['save',_0xb432('0x1'),_0xb432('0x2')];function createListener(_0x7170b6,_0xee80f1){return function(_0x5173f6){_0xee80f1['emit'](_0x7170b6,_0x5173f6);};}function removeListener(_0x93e722,_0x4cefc4){return function(){ChatMessageEvents[_0xb432('0x3')](_0x93e722,_0x4cefc4);};}exports['register']=function(_0x143093){for(var _0x3f1a78=0x0,_0x274447=events[_0xb432('0x4')];_0x3f1a78<_0x274447;_0x3f1a78++){var _0x14fed4=events[_0x3f1a78];var _0x6833df=createListener(_0xb432('0x5')+_0x14fed4,_0x143093);ChatMessageEvents['on'](_0x14fed4,_0x6833df);}}; \ No newline at end of file +var _0x0faf=['update','emit','removeListener','length','chatMessage:','./chatMessage.events','remove'];(function(_0x4ac424,_0x554b5d){var _0xe1b890=function(_0x5e85c4){while(--_0x5e85c4){_0x4ac424['push'](_0x4ac424['shift']());}};_0xe1b890(++_0x554b5d);}(_0x0faf,0x132));var _0xf0fa=function(_0x172948,_0x4262cc){_0x172948=_0x172948-0x0;var _0x4aeaa9=_0x0faf[_0x172948];return _0x4aeaa9;};'use strict';var ChatMessageEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatMessageEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatMessageEvents['on'](_0x2db1d9,_0x587865);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index dd9f82a..d6e6f1c 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 _0x75a8=['./chatMessage.controller','isAuthenticated','index','/describe','describe','get','show','tracked','chat','chatmessage:create','create','/:id','update','put','/:id/accept','/:id/reject','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x17c852,_0xa5e905){var _0x2a6cfa=function(_0x4a064a){while(--_0x4a064a){_0x17c852['push'](_0x17c852['shift']());}};_0x2a6cfa(++_0xa5e905);}(_0x75a8,0xc1));var _0x875a=function(_0x2f9fba,_0x4214c6){_0x2f9fba=_0x2f9fba-0x0;var _0x51743d=_0x75a8[_0x2f9fba];return _0x51743d;};'use strict';var multer=require('multer');var util=require(_0x875a('0x0'));var path=require(_0x875a('0x1'));var timeout=require('connect-timeout');var express=require(_0x875a('0x2'));var router=express[_0x875a('0x3')]();var fs_extra=require(_0x875a('0x4'));var auth=require(_0x875a('0x5'));var interaction=require(_0x875a('0x6'));var config=require('../../config/environment');var controller=require(_0x875a('0x7'));router['get']('/',auth[_0x875a('0x8')](),controller[_0x875a('0x9')]);router['get'](_0x875a('0xa'),auth['isAuthenticated'](),controller[_0x875a('0xb')]);router[_0x875a('0xc')]('/:id',auth[_0x875a('0x8')](),controller[_0x875a('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x875a('0xe')](_0x875a('0xf'),_0x875a('0x10')),controller[_0x875a('0x11')]);router['put'](_0x875a('0x12'),controller[_0x875a('0x13')]);router[_0x875a('0x14')](_0x875a('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0x875a('0x14')](_0x875a('0x16'),auth[_0x875a('0x8')](),controller['reject']);router[_0x875a('0x17')](_0x875a('0x12'),auth[_0x875a('0x8')](),controller['destroy']);module[_0x875a('0x18')]=router; \ No newline at end of file +var _0xec31=['../../config/environment','./chatMessage.controller','index','get','isAuthenticated','describe','/:id','show','post','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3d35a2,_0x1240da){var _0x539ed2=function(_0xf2c2e9){while(--_0xf2c2e9){_0x3d35a2['push'](_0x3d35a2['shift']());}};_0x539ed2(++_0x1240da);}(_0xec31,0xd2));var _0x1ec3=function(_0x37b0ba,_0xe3601e){_0x37b0ba=_0x37b0ba-0x0;var _0x20586f=_0xec31[_0x37b0ba];return _0x20586f;};'use strict';var multer=require(_0x1ec3('0x0'));var util=require('util');var path=require(_0x1ec3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1ec3('0x2')]();var fs_extra=require(_0x1ec3('0x3'));var auth=require(_0x1ec3('0x4'));var interaction=require(_0x1ec3('0x5'));var config=require(_0x1ec3('0x6'));var controller=require(_0x1ec3('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ec3('0x8')]);router[_0x1ec3('0x9')]('/describe',auth[_0x1ec3('0xa')](),controller[_0x1ec3('0xb')]);router[_0x1ec3('0x9')](_0x1ec3('0xc'),auth['isAuthenticated'](),controller[_0x1ec3('0xd')]);router[_0x1ec3('0xe')]('/',auth[_0x1ec3('0xa')](),interaction['tracked']('chat','chatmessage:create'),controller[_0x1ec3('0xf')]);router[_0x1ec3('0x10')](_0x1ec3('0xc'),controller[_0x1ec3('0x11')]);router[_0x1ec3('0x10')](_0x1ec3('0x12'),auth['isAuthenticated'](),controller[_0x1ec3('0x13')]);router[_0x1ec3('0x10')](_0x1ec3('0x14'),auth['isAuthenticated'](),controller['reject']);router[_0x1ec3('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1ec3('0x16')]);module[_0x1ec3('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index f1b9769..4233607 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x0b0e[_0x2cef86];return _0x46dfd6;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xadb5=['medium','TEXT','exports'];(function(_0x3a155c,_0x513947){var _0x414949=function(_0x5c0860){while(--_0x5c0860){_0x3a155c['push'](_0x3a155c['shift']());}};_0x414949(++_0x513947);}(_0xadb5,0xad));var _0x5adb=function(_0x1cafb7,_0x32ac35){_0x1cafb7=_0x1cafb7-0x0;var _0xa94212=_0xadb5[_0x1cafb7];return _0xa94212;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('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 c15d8a7..8b00dff 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1ba832,_0x2e39a5){var _0x35e956=function(_0x1efa4f){while(--_0x1efa4f){_0x1ba832['push'](_0x1ba832['shift']());}};_0x35e956(++_0x2e39a5);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0x473df4,_0x1b864b){_0x473df4=_0x473df4-0x0;var _0x2c0380=_0x7a54[_0x473df4];return _0x2c0380;};'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 5afdfcf..261390e 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 _0x9983=['emit','exports','events','ChatOfflineMessage','setMaxListeners','save','remove'];(function(_0x5704b1,_0x4b142d){var _0x3bff7f=function(_0x28677d){while(--_0x28677d){_0x5704b1['push'](_0x5704b1['shift']());}};_0x3bff7f(++_0x4b142d);}(_0x9983,0x159));var _0x3998=function(_0x66c8e8,_0x304ead){_0x66c8e8=_0x66c8e8-0x0;var _0x77f6e6=_0x9983[_0x66c8e8];return _0x77f6e6;};'use strict';var EventEmitter=require(_0x3998('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3998('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x3998('0x2')](0x0);var events={'afterCreate':_0x3998('0x3'),'afterUpdate':'update','afterDestroy':_0x3998('0x4')};function emitEvent(_0x57fbfd){return function(_0x125bb5,_0x777c1,_0xd9014f){ChatOfflineMessageEvents[_0x3998('0x5')](_0x57fbfd+':'+_0x125bb5['id'],_0x125bb5);ChatOfflineMessageEvents['emit'](_0x57fbfd,_0x125bb5);_0xd9014f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x3998('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xfcac=['save','update','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x579726,_0x8c63ff){var _0x15c7d8=function(_0x80a3ce){while(--_0x80a3ce){_0x579726['push'](_0x579726['shift']());}};_0x15c7d8(++_0x8c63ff);}(_0xfcac,0x1a9));var _0xcfca=function(_0x154cda,_0x3aa6ae){_0x154cda=_0x154cda-0x0;var _0x1861cd=_0xfcac[_0x154cda];return _0x1861cd;};'use strict';var EventEmitter=require(_0xcfca('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xcfca('0x1')](0x0);var events={'afterCreate':_0xcfca('0x2'),'afterUpdate':_0xcfca('0x3'),'afterDestroy':'remove'};function emitEvent(_0x94dc1b){return function(_0x406b59,_0xb0ebe6,_0x2768b1){ChatOfflineMessageEvents['emit'](_0x94dc1b+':'+_0x406b59['id'],_0x406b59);ChatOfflineMessageEvents['emit'](_0x94dc1b,_0x406b59);_0x2768b1(null);};}for(var e in events){if(events[_0xcfca('0x4')](e)){var event=events[e];ChatOfflineMessage[_0xcfca('0x5')](e,emitEvent(event));}}module[_0xcfca('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 142b64f..c45e66e 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 _0x3f54=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3f54,0xe4));var _0x43f5=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x3f54[_0x3ab9ee];return _0x82ee88;};'use strict';var attributes=require(_0x43f5('0x0'));module[_0x43f5('0x1')]=function(_0x2c75f5){return _0x2c75f5[_0x43f5('0x2')](_0x43f5('0x3'),attributes,{'tableName':_0x43f5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x43f5('0x5'),'collate':_0x43f5('0x6')});}; \ No newline at end of file +var _0x48b6=['utf8mb4_unicode_ci','exports','define','chat_offline_messages','utf8mb4'];(function(_0x135fb4,_0x50e172){var _0x1b7f11=function(_0x3d10e0){while(--_0x3d10e0){_0x135fb4['push'](_0x135fb4['shift']());}};_0x1b7f11(++_0x50e172);}(_0x48b6,0x1b4));var _0x648b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48b6[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x648b('0x0')]=function(_0x15bac){return _0x15bac[_0x648b('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x648b('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x648b('0x3'),'collate':_0x648b('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 00e3e56..a8c9a81 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 _0x99fb=['moment','bluebird','randomstring','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','lodash'];(function(_0x23796f,_0x15e83c){var _0x2ec3ca=function(_0x1436f7){while(--_0x1436f7){_0x23796f['push'](_0x23796f['shift']());}};_0x2ec3ca(++_0x15e83c);}(_0x99fb,0x92));var _0xb99f=function(_0x27a1df,_0xc3e527){_0x27a1df=_0x27a1df-0x0;var _0x4173cf=_0x99fb[_0x27a1df];return _0x4173cf;};'use strict';var _=require(_0xb99f('0x0'));var util=require('util');var moment=require(_0xb99f('0x1'));var BPromise=require(_0xb99f('0x2'));var rs=require(_0xb99f('0x3'));var fs=require('fs');var Redis=require(_0xb99f('0x4'));var db=require(_0xb99f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb99f('0x6'))(_0xb99f('0x7'));var config=require('../../config/environment');var jayson=require(_0xb99f('0x8'));var client=jayson[_0xb99f('0x9')][_0xb99f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f264e,_0x182c0c,_0x479d65){return new BPromise(function(_0xe317ff,_0x57b816){return client[_0xb99f('0xb')](_0x5f264e,_0x479d65)[_0xb99f('0xc')](function(_0x5e944b){logger[_0xb99f('0xd')](_0xb99f('0xe'),_0x182c0c,_0xb99f('0xf'));logger[_0xb99f('0x10')](_0xb99f('0x11'),_0x182c0c,_0xb99f('0xf'),JSON[_0xb99f('0x12')](_0x5e944b));if(_0x5e944b['error']){if(_0x5e944b[_0xb99f('0x13')]['code']===0x1f4){logger['error'](_0xb99f('0xe'),_0x182c0c,_0x5e944b[_0xb99f('0x13')][_0xb99f('0x14')]);return _0x57b816(_0x5e944b[_0xb99f('0x13')][_0xb99f('0x14')]);}logger['error'](_0xb99f('0xe'),_0x182c0c,_0x5e944b['error'][_0xb99f('0x14')]);return _0xe317ff(_0x5e944b[_0xb99f('0x13')]['message']);}else{logger[_0xb99f('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x182c0c,_0xb99f('0xf'));_0xe317ff(_0x5e944b['result'][_0xb99f('0x14')]);}})['catch'](function(_0x37a14c){logger['error'](_0xb99f('0xe'),_0x182c0c,_0x37a14c);_0x57b816(_0x37a14c);});});} \ No newline at end of file +var _0x89fe=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x89fe,0x83));var _0xe89f=function(_0x2e75c4,_0x5f39c8){_0x2e75c4=_0x2e75c4-0x0;var _0xed86a7=_0x89fe[_0x2e75c4];return _0xed86a7;};'use strict';var _=require(_0xe89f('0x0'));var util=require(_0xe89f('0x1'));var moment=require(_0xe89f('0x2'));var BPromise=require(_0xe89f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe89f('0x4'));var db=require(_0xe89f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe89f('0x6'))(_0xe89f('0x7'));var config=require(_0xe89f('0x8'));var jayson=require(_0xe89f('0x9'));var client=jayson[_0xe89f('0xa')][_0xe89f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24358f,_0x5427d2,_0x4639f0){return new BPromise(function(_0x3e9998,_0x7043f3){return client[_0xe89f('0xc')](_0x24358f,_0x4639f0)[_0xe89f('0xd')](function(_0x4fa2fa){logger[_0xe89f('0xe')](_0xe89f('0xf'),_0x5427d2,_0xe89f('0x10'));logger[_0xe89f('0x11')](_0xe89f('0x12'),_0x5427d2,_0xe89f('0x10'),JSON[_0xe89f('0x13')](_0x4fa2fa));if(_0x4fa2fa[_0xe89f('0x14')]){if(_0x4fa2fa[_0xe89f('0x14')][_0xe89f('0x15')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5427d2,_0x4fa2fa['error']['message']);return _0x7043f3(_0x4fa2fa['error'][_0xe89f('0x16')]);}logger[_0xe89f('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5427d2,_0x4fa2fa['error'][_0xe89f('0x16')]);return _0x3e9998(_0x4fa2fa[_0xe89f('0x14')][_0xe89f('0x16')]);}else{logger[_0xe89f('0xe')](_0xe89f('0xf'),_0x5427d2,_0xe89f('0x10'));_0x3e9998(_0x4fa2fa[_0xe89f('0x17')][_0xe89f('0x16')]);}})[_0xe89f('0x18')](function(_0x16bfe0){logger['error'](_0xe89f('0xf'),_0x5427d2,_0x16bfe0);_0x7043f3(_0x16bfe0);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 83ff855..e378339 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 _0xea19=['/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index'];(function(_0x1b776e,_0x1d341e){var _0x3b8294=function(_0x352b9a){while(--_0x352b9a){_0x1b776e['push'](_0x1b776e['shift']());}};_0x3b8294(++_0x1d341e);}(_0xea19,0x9d));var _0x9ea1=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xea19[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x9ea1('0x0'));var util=require(_0x9ea1('0x1'));var path=require(_0x9ea1('0x2'));var timeout=require(_0x9ea1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9ea1('0x4'));var interaction=require(_0x9ea1('0x5'));var config=require(_0x9ea1('0x6'));var controller=require(_0x9ea1('0x7'));router[_0x9ea1('0x8')]('/',auth[_0x9ea1('0x9')](),controller[_0x9ea1('0xa')]);router[_0x9ea1('0x8')](_0x9ea1('0xb'),auth[_0x9ea1('0x9')](),controller[_0x9ea1('0xc')]);router[_0x9ea1('0x8')](_0x9ea1('0xd'),auth[_0x9ea1('0x9')](),controller[_0x9ea1('0xe')]);router[_0x9ea1('0xf')]('/',auth[_0x9ea1('0x9')](),controller[_0x9ea1('0x10')]);router[_0x9ea1('0x11')](_0x9ea1('0xd'),auth[_0x9ea1('0x9')](),controller[_0x9ea1('0x12')]);router['delete'](_0x9ea1('0xd'),auth[_0x9ea1('0x9')](),controller[_0x9ea1('0x13')]);module[_0x9ea1('0x14')]=router; \ No newline at end of file +var _0x1901=['delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update'];(function(_0x41eb03,_0x288379){var _0x224460=function(_0x432887){while(--_0x432887){_0x41eb03['push'](_0x41eb03['shift']());}};_0x224460(++_0x288379);}(_0x1901,0x19b));var _0x1190=function(_0x8f0df1,_0x2ba68f){_0x8f0df1=_0x8f0df1-0x0;var _0x2929a8=_0x1901[_0x8f0df1];return _0x2929a8;};'use strict';var multer=require(_0x1190('0x0'));var util=require('util');var path=require(_0x1190('0x1'));var timeout=require('connect-timeout');var express=require(_0x1190('0x2'));var router=express[_0x1190('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1190('0x4'));var config=require(_0x1190('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x1190('0x6')]('/',auth[_0x1190('0x7')](),controller['index']);router['get']('/describe',auth[_0x1190('0x7')](),controller[_0x1190('0x8')]);router['get'](_0x1190('0x9'),auth['isAuthenticated'](),controller[_0x1190('0xa')]);router[_0x1190('0xb')]('/',auth[_0x1190('0x7')](),controller[_0x1190('0xc')]);router['put']('/:id',auth[_0x1190('0x7')](),controller[_0x1190('0xd')]);router[_0x1190('0xe')](_0x1190('0x9'),auth[_0x1190('0x7')](),controller[_0x1190('0xf')]);module[_0x1190('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index f1fa748..5dc90cb 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 _0xd17b=['STRING','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xd17b,0x11e));var _0xbd17=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0xd17b[_0x291f8b];return _0x275171;};'use strict';var Sequelize=require(_0xbd17('0x0'));module[_0xbd17('0x1')]={'name':{'type':Sequelize[_0xbd17('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbd17('0x3'),_0xbd17('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xbd17('0x2')]},'timeout':{'type':Sequelize[_0xbd17('0x5')]}}; \ No newline at end of file +var _0x1a56=['timeout','STRING','ENUM','mouseOver'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x1a56,0x8d));var _0x61a5=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0x1a56[_0x25c988];return _0x45fcc2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x61a5('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x61a5('0x1')](_0x61a5('0x2'),_0x61a5('0x3')),'defaultValue':_0x61a5('0x2')},'selector':{'type':Sequelize[_0x61a5('0x0')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 68ac13d..af1a8a8 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 _0xf4d9=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','model','keys','ChatProactiveAction','query','attributes','intersection','fields','length','includeAll','merge','options','catch','create','body','find','params'];(function(_0x466286,_0x4ab711){var _0x2b740a=function(_0x10c51f){while(--_0x10c51f){_0x466286['push'](_0x466286['shift']());}};_0x2b740a(++_0x4ab711);}(_0xf4d9,0x7c));var _0x9f4d=function(_0xdba320,_0xebd2d1){_0xdba320=_0xdba320-0x0;var _0x250abb=_0xf4d9[_0xdba320];return _0x250abb;};'use strict';var emlformat=require(_0x9f4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f4d('0x1'));var jsonpatch=require(_0x9f4d('0x2'));var rp=require(_0x9f4d('0x3'));var moment=require(_0x9f4d('0x4'));var BPromise=require(_0x9f4d('0x5'));var Mustache=require('mustache');var util=require(_0x9f4d('0x6'));var path=require(_0x9f4d('0x7'));var sox=require(_0x9f4d('0x8'));var csv=require('to-csv');var ejs=require(_0x9f4d('0x9'));var fs=require('fs');var fs_extra=require(_0x9f4d('0xa'));var _=require(_0x9f4d('0xb'));var squel=require('squel');var crypto=require(_0x9f4d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9f4d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9f4d('0xe'));var Papa=require(_0x9f4d('0xf'));var Redis=require(_0x9f4d('0x10'));var authService=require(_0x9f4d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9f4d('0x12'));var hardwareService=require(_0x9f4d('0x13'));var logger=require(_0x9f4d('0x14'))(_0x9f4d('0x15'));var utils=require(_0x9f4d('0x16'));var config=require(_0x9f4d('0x17'));var licenseUtil=require(_0x9f4d('0x18'));var db=require(_0x9f4d('0x19'))['db'];function respondWithStatusCode(_0x13c6fc,_0x112a7d){_0x112a7d=_0x112a7d||0xcc;return function(_0xfb475c){if(_0xfb475c){return _0x13c6fc['sendStatus'](_0x112a7d);}return _0x13c6fc[_0x9f4d('0x1a')](_0x112a7d)[_0x9f4d('0x1b')]();};}function respondWithResult(_0x35e7d4,_0x581e17){_0x581e17=_0x581e17||0xc8;return function(_0x12d180){if(_0x12d180){return _0x35e7d4[_0x9f4d('0x1a')](_0x581e17)[_0x9f4d('0x1c')](_0x12d180);}};}function respondWithFilteredResult(_0x178d8e,_0x514c01){return function(_0x4c8197){if(_0x4c8197){var _0x50534f=typeof _0x514c01[_0x9f4d('0x1d')]===_0x9f4d('0x1e')&&typeof _0x514c01[_0x9f4d('0x1f')]===_0x9f4d('0x1e');var _0x214195=_0x4c8197[_0x9f4d('0x20')];var _0x4f8bb9=_0x50534f?0x0:_0x514c01[_0x9f4d('0x1d')];var _0x3e0b7d=_0x50534f?_0x4c8197[_0x9f4d('0x20')]:_0x514c01[_0x9f4d('0x1d')]+_0x514c01[_0x9f4d('0x1f')];var _0x566d56;if(_0x3e0b7d>=_0x214195){_0x3e0b7d=_0x214195;_0x566d56=0xc8;}else{_0x566d56=0xce;}_0x178d8e[_0x9f4d('0x1a')](_0x566d56);return _0x178d8e[_0x9f4d('0x21')](_0x9f4d('0x22'),_0x4f8bb9+'-'+_0x3e0b7d+'/'+_0x214195)[_0x9f4d('0x1c')](_0x4c8197);}return null;};}function patchUpdates(_0x30577b){return function(_0x14cd44){try{jsonpatch[_0x9f4d('0x23')](_0x14cd44,_0x30577b,!![]);}catch(_0x3917ec){return BPromise[_0x9f4d('0x24')](_0x3917ec);}return _0x14cd44[_0x9f4d('0x25')]();};}function saveUpdates(_0x4f8c11,_0x5bc6ea){return function(_0xc4fd4){if(_0xc4fd4){return _0xc4fd4[_0x9f4d('0x26')](_0x4f8c11)['then'](function(_0x123fd2){return _0x123fd2;});}return null;};}function removeEntity(_0xa900ce,_0x392f65){return function(_0x3e9818){if(_0x3e9818){return _0x3e9818[_0x9f4d('0x27')]()[_0x9f4d('0x28')](function(){_0xa900ce[_0x9f4d('0x1a')](0xcc)[_0x9f4d('0x1b')]();});}};}function handleEntityNotFound(_0x1c1c9f,_0x5a1d6b){return function(_0x3c4541){if(!_0x3c4541){_0x1c1c9f[_0x9f4d('0x29')](0x194);}return _0x3c4541;};}function handleError(_0x46daca,_0x5b126a){_0x5b126a=_0x5b126a||0x1f4;return function(_0x74fa29){logger[_0x9f4d('0x2a')](_0x74fa29[_0x9f4d('0x2b')]);if(_0x74fa29[_0x9f4d('0x2c')]){delete _0x74fa29[_0x9f4d('0x2c')];}_0x46daca[_0x9f4d('0x1a')](_0x5b126a)[_0x9f4d('0x2d')](_0x74fa29);};}exports['show']=function(_0x4eb918,_0x461ebf){var _0x56b90a={'raw':!![],'where':{'id':_0x4eb918['params']['id']}},_0x16db57={};_0x16db57[_0x9f4d('0x2e')]=_[_0x9f4d('0x2f')](db[_0x9f4d('0x30')]['rawAttributes']);_0x16db57[_0x9f4d('0x31')]=_['keys'](_0x4eb918[_0x9f4d('0x31')]);_0x16db57['filters']=_['intersection'](_0x16db57[_0x9f4d('0x2e')],_0x16db57[_0x9f4d('0x31')]);_0x56b90a[_0x9f4d('0x32')]=_[_0x9f4d('0x33')](_0x16db57[_0x9f4d('0x2e')],qs[_0x9f4d('0x34')](_0x4eb918[_0x9f4d('0x31')]['fields']));_0x56b90a[_0x9f4d('0x32')]=_0x56b90a[_0x9f4d('0x32')][_0x9f4d('0x35')]?_0x56b90a[_0x9f4d('0x32')]:_0x16db57[_0x9f4d('0x2e')];if(_0x4eb918[_0x9f4d('0x31')][_0x9f4d('0x36')]){_0x56b90a['include']=[{'all':!![]}];}_0x56b90a=_[_0x9f4d('0x37')]({},_0x56b90a,_0x4eb918[_0x9f4d('0x38')]);return db[_0x9f4d('0x30')]['find'](_0x56b90a)[_0x9f4d('0x28')](handleEntityNotFound(_0x461ebf,null))[_0x9f4d('0x28')](respondWithResult(_0x461ebf,null))[_0x9f4d('0x39')](handleError(_0x461ebf,null));};exports[_0x9f4d('0x3a')]=function(_0xb29b50,_0x1c0fde){return db[_0x9f4d('0x30')][_0x9f4d('0x3a')](_0xb29b50[_0x9f4d('0x3b')],{})[_0x9f4d('0x28')](respondWithResult(_0x1c0fde,0xc9))[_0x9f4d('0x39')](handleError(_0x1c0fde,null));};exports['update']=function(_0x2bc3b5,_0x32eefe){if(_0x2bc3b5[_0x9f4d('0x3b')]['id']){delete _0x2bc3b5[_0x9f4d('0x3b')]['id'];}return db[_0x9f4d('0x30')][_0x9f4d('0x3c')]({'where':{'id':_0x2bc3b5[_0x9f4d('0x3d')]['id']}})[_0x9f4d('0x28')](handleEntityNotFound(_0x32eefe,null))[_0x9f4d('0x28')](saveUpdates(_0x2bc3b5[_0x9f4d('0x3b')],null))[_0x9f4d('0x28')](respondWithResult(_0x32eefe,null))[_0x9f4d('0x39')](handleError(_0x32eefe,null));};exports['destroy']=function(_0x440d05,_0x3d5f26){return db[_0x9f4d('0x30')][_0x9f4d('0x3c')]({'where':{'id':_0x440d05[_0x9f4d('0x3d')]['id']}})[_0x9f4d('0x28')](handleEntityNotFound(_0x3d5f26,null))['then'](removeEntity(_0x3d5f26,null))[_0x9f4d('0x39')](handleError(_0x3d5f26,null));}; \ No newline at end of file +var _0x8917=['../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','destroy','then','sendStatus','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x4d0cf4,_0x479876){var _0x5cba11=function(_0x59e7cc){while(--_0x59e7cc){_0x4d0cf4['push'](_0x4d0cf4['shift']());}};_0x5cba11(++_0x479876);}(_0x8917,0x1d7));var _0x7891=function(_0x2061fa,_0x2b5b03){_0x2061fa=_0x2061fa-0x0;var _0x191585=_0x8917[_0x2061fa];return _0x191585;};'use strict';var emlformat=require(_0x7891('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7891('0x1'));var jsonpatch=require(_0x7891('0x2'));var rp=require(_0x7891('0x3'));var moment=require(_0x7891('0x4'));var BPromise=require(_0x7891('0x5'));var Mustache=require(_0x7891('0x6'));var util=require(_0x7891('0x7'));var path=require(_0x7891('0x8'));var sox=require(_0x7891('0x9'));var csv=require('to-csv');var ejs=require(_0x7891('0xa'));var fs=require('fs');var fs_extra=require(_0x7891('0xb'));var _=require(_0x7891('0xc'));var squel=require(_0x7891('0xd'));var crypto=require(_0x7891('0xe'));var jsforce=require(_0x7891('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7891('0x10'));var querystring=require('querystring');var Papa=require(_0x7891('0x11'));var Redis=require(_0x7891('0x12'));var authService=require(_0x7891('0x13'));var qs=require(_0x7891('0x14'));var as=require(_0x7891('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7891('0x16'))(_0x7891('0x17'));var utils=require(_0x7891('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7891('0x19'));var db=require(_0x7891('0x1a'))['db'];function respondWithStatusCode(_0x1a1dbc,_0x31692f){_0x31692f=_0x31692f||0xcc;return function(_0x1b481e){if(_0x1b481e){return _0x1a1dbc['sendStatus'](_0x31692f);}return _0x1a1dbc[_0x7891('0x1b')](_0x31692f)[_0x7891('0x1c')]();};}function respondWithResult(_0x2517f1,_0xc56bc0){_0xc56bc0=_0xc56bc0||0xc8;return function(_0x71e75c){if(_0x71e75c){return _0x2517f1[_0x7891('0x1b')](_0xc56bc0)['json'](_0x71e75c);}};}function respondWithFilteredResult(_0x1fa45b,_0x21a74f){return function(_0x5bfe12){if(_0x5bfe12){var _0x23286b=typeof _0x21a74f[_0x7891('0x1d')]==='undefined'&&typeof _0x21a74f[_0x7891('0x1e')]===_0x7891('0x1f');var _0x250f65=_0x5bfe12[_0x7891('0x20')];var _0x9ff8c2=_0x23286b?0x0:_0x21a74f[_0x7891('0x1d')];var _0x457f50=_0x23286b?_0x5bfe12[_0x7891('0x20')]:_0x21a74f[_0x7891('0x1d')]+_0x21a74f[_0x7891('0x1e')];var _0x20da1e;if(_0x457f50>=_0x250f65){_0x457f50=_0x250f65;_0x20da1e=0xc8;}else{_0x20da1e=0xce;}_0x1fa45b['status'](_0x20da1e);return _0x1fa45b['set'](_0x7891('0x21'),_0x9ff8c2+'-'+_0x457f50+'/'+_0x250f65)[_0x7891('0x22')](_0x5bfe12);}return null;};}function patchUpdates(_0x30b2ae){return function(_0x4c76fe){try{jsonpatch['apply'](_0x4c76fe,_0x30b2ae,!![]);}catch(_0x19a628){return BPromise[_0x7891('0x23')](_0x19a628);}return _0x4c76fe[_0x7891('0x24')]();};}function saveUpdates(_0x36f66a,_0x155a97){return function(_0xf09f20){if(_0xf09f20){return _0xf09f20[_0x7891('0x25')](_0x36f66a)['then'](function(_0x28a917){return _0x28a917;});}return null;};}function removeEntity(_0xab091c,_0x27f2e0){return function(_0x2de356){if(_0x2de356){return _0x2de356[_0x7891('0x26')]()[_0x7891('0x27')](function(){_0xab091c[_0x7891('0x1b')](0xcc)[_0x7891('0x1c')]();});}};}function handleEntityNotFound(_0x24372f,_0x2acda5){return function(_0x55108b){if(!_0x55108b){_0x24372f[_0x7891('0x28')](0x194);}return _0x55108b;};}function handleError(_0x369740,_0x397d03){_0x397d03=_0x397d03||0x1f4;return function(_0x12ed70){logger['error'](_0x12ed70[_0x7891('0x29')]);if(_0x12ed70['name']){delete _0x12ed70[_0x7891('0x2a')];}_0x369740[_0x7891('0x1b')](_0x397d03)[_0x7891('0x2b')](_0x12ed70);};}exports['show']=function(_0x4009f8,_0x1a6bef){var _0x44442f={'raw':!![],'where':{'id':_0x4009f8[_0x7891('0x2c')]['id']}},_0x263f13={};_0x263f13[_0x7891('0x2d')]=_[_0x7891('0x2e')](db['ChatProactiveAction'][_0x7891('0x2f')]);_0x263f13['query']=_[_0x7891('0x2e')](_0x4009f8[_0x7891('0x30')]);_0x263f13[_0x7891('0x31')]=_[_0x7891('0x32')](_0x263f13[_0x7891('0x2d')],_0x263f13[_0x7891('0x30')]);_0x44442f[_0x7891('0x33')]=_['intersection'](_0x263f13[_0x7891('0x2d')],qs[_0x7891('0x34')](_0x4009f8[_0x7891('0x30')][_0x7891('0x34')]));_0x44442f[_0x7891('0x33')]=_0x44442f[_0x7891('0x33')][_0x7891('0x35')]?_0x44442f['attributes']:_0x263f13['model'];if(_0x4009f8['query']['includeAll']){_0x44442f[_0x7891('0x36')]=[{'all':!![]}];}_0x44442f=_[_0x7891('0x37')]({},_0x44442f,_0x4009f8[_0x7891('0x38')]);return db[_0x7891('0x39')][_0x7891('0x3a')](_0x44442f)[_0x7891('0x27')](handleEntityNotFound(_0x1a6bef,null))['then'](respondWithResult(_0x1a6bef,null))[_0x7891('0x3b')](handleError(_0x1a6bef,null));};exports[_0x7891('0x3c')]=function(_0x19e258,_0x2c1c67){return db[_0x7891('0x39')][_0x7891('0x3c')](_0x19e258[_0x7891('0x3d')],{})['then'](respondWithResult(_0x2c1c67,0xc9))[_0x7891('0x3b')](handleError(_0x2c1c67,null));};exports['update']=function(_0x16ca6d,_0x5ba995){if(_0x16ca6d[_0x7891('0x3d')]['id']){delete _0x16ca6d[_0x7891('0x3d')]['id'];}return db[_0x7891('0x39')][_0x7891('0x3a')]({'where':{'id':_0x16ca6d[_0x7891('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5ba995,null))[_0x7891('0x27')](saveUpdates(_0x16ca6d[_0x7891('0x3d')],null))[_0x7891('0x27')](respondWithResult(_0x5ba995,null))[_0x7891('0x3b')](handleError(_0x5ba995,null));};exports[_0x7891('0x26')]=function(_0x516d5c,_0x4e63ee){return db['ChatProactiveAction'][_0x7891('0x3a')]({'where':{'id':_0x516d5c[_0x7891('0x2c')]['id']}})[_0x7891('0x27')](handleEntityNotFound(_0x4e63ee,null))[_0x7891('0x27')](removeEntity(_0x4e63ee,null))[_0x7891('0x3b')](handleError(_0x4e63ee,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 2456bd8..25b7b58 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 _0x1961=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x1a86c1,_0xb46e14){var _0x496463=function(_0x498a74){while(--_0x498a74){_0x1a86c1['push'](_0x1a86c1['shift']());}};_0x496463(++_0xb46e14);}(_0x1961,0xb7));var _0x1196=function(_0x467798,_0x12dee9){_0x467798=_0x467798-0x0;var _0x2e6413=_0x1961[_0x467798];return _0x2e6413;};'use strict';var _=require(_0x1196('0x0'));var util=require(_0x1196('0x1'));var logger=require('../../config/logger')(_0x1196('0x2'));var moment=require('moment');var BPromise=require(_0x1196('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1196('0x4'));var rimraf=require(_0x1196('0x5'));var config=require(_0x1196('0x6'));var attributes=require(_0x1196('0x7'));module[_0x1196('0x8')]=function(_0x52eaf0,_0x445965){return _0x52eaf0[_0x1196('0x9')](_0x1196('0xa'),attributes,{'tableName':_0x1196('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa396=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction'];(function(_0x3b0836,_0x4587b4){var _0x310494=function(_0x4e3e11){while(--_0x4e3e11){_0x3b0836['push'](_0x3b0836['shift']());}};_0x310494(++_0x4587b4);}(_0xa396,0x1a0));var _0x6a39=function(_0x49a802,_0x28f58d){_0x49a802=_0x49a802-0x0;var _0x552818=_0xa396[_0x49a802];return _0x552818;};'use strict';var _=require(_0x6a39('0x0'));var util=require(_0x6a39('0x1'));var logger=require(_0x6a39('0x2'))(_0x6a39('0x3'));var moment=require('moment');var BPromise=require(_0x6a39('0x4'));var rp=require(_0x6a39('0x5'));var fs=require('fs');var path=require(_0x6a39('0x6'));var rimraf=require(_0x6a39('0x7'));var config=require(_0x6a39('0x8'));var attributes=require(_0x6a39('0x9'));module[_0x6a39('0xa')]=function(_0x4e7fe0,_0x39756a){return _0x4e7fe0[_0x6a39('0xb')](_0x6a39('0xc'),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 064b60f..524415d 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 _0xaba4=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch'];(function(_0x28e41f,_0x4d037f){var _0x4ac8fa=function(_0x48b817){while(--_0x48b817){_0x28e41f['push'](_0x28e41f['shift']());}};_0x4ac8fa(++_0x4d037f);}(_0xaba4,0x11e));var _0x4aba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaba4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4aba('0x0'));var util=require(_0x4aba('0x1'));var moment=require(_0x4aba('0x2'));var BPromise=require(_0x4aba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4aba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4aba('0x5'));var logger=require(_0x4aba('0x6'))(_0x4aba('0x7'));var config=require(_0x4aba('0x8'));var jayson=require(_0x4aba('0x9'));var client=jayson[_0x4aba('0xa')][_0x4aba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x535937,_0x2f6925,_0x9e4be){return new BPromise(function(_0x3953e9,_0x135fc9){return client['request'](_0x535937,_0x9e4be)[_0x4aba('0xc')](function(_0x464c11){logger[_0x4aba('0xd')](_0x4aba('0xe'),_0x2f6925,'request\x20sent');logger[_0x4aba('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2f6925,_0x4aba('0x10'),JSON[_0x4aba('0x11')](_0x464c11));if(_0x464c11[_0x4aba('0x12')]){if(_0x464c11['error']['code']===0x1f4){logger[_0x4aba('0x12')](_0x4aba('0xe'),_0x2f6925,_0x464c11['error'][_0x4aba('0x13')]);return _0x135fc9(_0x464c11[_0x4aba('0x12')][_0x4aba('0x13')]);}logger['error'](_0x4aba('0xe'),_0x2f6925,_0x464c11[_0x4aba('0x12')][_0x4aba('0x13')]);return _0x3953e9(_0x464c11[_0x4aba('0x12')][_0x4aba('0x13')]);}else{logger[_0x4aba('0xd')](_0x4aba('0xe'),_0x2f6925,_0x4aba('0x10'));_0x3953e9(_0x464c11[_0x4aba('0x14')][_0x4aba('0x13')]);}})[_0x4aba('0x15')](function(_0x1515eb){logger[_0x4aba('0x12')](_0x4aba('0xe'),_0x2f6925,_0x1515eb);_0x135fc9(_0x1515eb);});});} \ No newline at end of file +var _0x1b7c=['code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x365b19,_0x445a8b){var _0xa1c9f=function(_0x4a620b){while(--_0x4a620b){_0x365b19['push'](_0x365b19['shift']());}};_0xa1c9f(++_0x445a8b);}(_0x1b7c,0x12f));var _0xc1b7=function(_0x1d014c,_0xf20d82){_0x1d014c=_0x1d014c-0x0;var _0xc51585=_0x1b7c[_0x1d014c];return _0xc51585;};'use strict';var _=require(_0xc1b7('0x0'));var util=require(_0xc1b7('0x1'));var moment=require('moment');var BPromise=require(_0xc1b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1b7('0x3'));var db=require(_0xc1b7('0x4'))['db'];var utils=require(_0xc1b7('0x5'));var logger=require('../../config/logger')(_0xc1b7('0x6'));var config=require(_0xc1b7('0x7'));var jayson=require(_0xc1b7('0x8'));var client=jayson[_0xc1b7('0x9')][_0xc1b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f0212,_0x2dd97d,_0x2db29b){return new BPromise(function(_0x39230c,_0x8d695d){return client[_0xc1b7('0xb')](_0x1f0212,_0x2db29b)[_0xc1b7('0xc')](function(_0x524f5a){logger[_0xc1b7('0xd')](_0xc1b7('0xe'),_0x2dd97d,_0xc1b7('0xf'));logger['debug'](_0xc1b7('0x10'),_0x2dd97d,'request\x20sent',JSON[_0xc1b7('0x11')](_0x524f5a));if(_0x524f5a[_0xc1b7('0x12')]){if(_0x524f5a[_0xc1b7('0x12')][_0xc1b7('0x13')]===0x1f4){logger['error'](_0xc1b7('0xe'),_0x2dd97d,_0x524f5a[_0xc1b7('0x12')][_0xc1b7('0x14')]);return _0x8d695d(_0x524f5a['error'][_0xc1b7('0x14')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x2dd97d,_0x524f5a['error'][_0xc1b7('0x14')]);return _0x39230c(_0x524f5a['error'][_0xc1b7('0x14')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x2dd97d,_0xc1b7('0xf'));_0x39230c(_0x524f5a[_0xc1b7('0x15')][_0xc1b7('0x14')]);}})[_0xc1b7('0x16')](function(_0x33dd67){logger[_0xc1b7('0x12')](_0xc1b7('0xe'),_0x2dd97d,_0x33dd67);_0x8d695d(_0x33dd67);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 98ff516..5f3adb9 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 _0x425d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x425d,0x1e0));var _0xd425=function(_0x4c11f7,_0x5a0447){_0x4c11f7=_0x4c11f7-0x0;var _0x587d6b=_0x425d[_0x4c11f7];return _0x587d6b;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0xc')]);router[_0xd425('0xd')]('/',auth['isAuthenticated'](),controller[_0xd425('0xe')]);router[_0xd425('0xf')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x10')]);router[_0xd425('0x11')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x12')]);module[_0xd425('0x13')]=router; \ No newline at end of file +var _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x260e4b,_0x54668d){var _0x18dfba=function(_0x37b530){while(--_0x37b530){_0x260e4b['push'](_0x260e4b['shift']());}};_0x18dfba(++_0x54668d);}(_0x7c09,0x102));var _0x97c0=function(_0x29ab38,_0x40c988){_0x29ab38=_0x29ab38-0x0;var _0xbfa2de=_0x7c09[_0x29ab38];return _0xbfa2de;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 240fc6b..35e606c 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 _0x15fa=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x297aff,_0xa68434){var _0x4a27d4=function(_0x644660){while(--_0x644660){_0x297aff['push'](_0x297aff['shift']());}};_0x4a27d4(++_0xa68434);}(_0x15fa,0x1d3));var _0xa15f=function(_0x22a42f,_0x3295a8){_0x22a42f=_0x22a42f-0x0;var _0x5ec443=_0x15fa[_0x22a42f];return _0x5ec443;};'use strict';var Sequelize=require(_0xa15f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa15f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa15f('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa15f('0x3'),_0xa15f('0x4'),_0xa15f('0x5'))}}; \ No newline at end of file +var _0x0191=['roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0191,0x13f));var _0x1019=function(_0x1fe8be,_0x5e7860){_0x1fe8be=_0x1fe8be-0x0;var _0x1449bb=_0x0191[_0x1fe8be];return _0x1449bb;};'use strict';var Sequelize=require(_0x1019('0x0'));module['exports']={'name':{'type':Sequelize[_0x1019('0x1')],'unique':_0x1019('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1019('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1019('0x4')]('rrmemory','beepall',_0x1019('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 5e31785..1d84e7a 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 _0xf82c=['updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','push','toString','QueryTypes','every','TeamId','includes','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','userChatQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','save','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','UserId','agent','chatPause'];(function(_0x21080b,_0x4e267e){var _0x59de05=function(_0x3983ac){while(--_0x3983ac){_0x21080b['push'](_0x21080b['shift']());}};_0x59de05(++_0x4e267e);}(_0xf82c,0x1dd));var _0xcf82=function(_0x5d6ea8,_0x43b332){_0x5d6ea8=_0x5d6ea8-0x0;var _0x1d973f=_0xf82c[_0x5d6ea8];return _0x1d973f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf82('0x0'));var zipdir=require(_0xcf82('0x1'));var jsonpatch=require(_0xcf82('0x2'));var rp=require('request-promise');var moment=require(_0xcf82('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcf82('0x4'));var util=require(_0xcf82('0x5'));var path=require(_0xcf82('0x6'));var sox=require(_0xcf82('0x7'));var csv=require(_0xcf82('0x8'));var ejs=require(_0xcf82('0x9'));var fs=require('fs');var fs_extra=require(_0xcf82('0xa'));var _=require(_0xcf82('0xb'));var squel=require(_0xcf82('0xc'));var crypto=require(_0xcf82('0xd'));var jsforce=require(_0xcf82('0xe'));var deskjs=require(_0xcf82('0xf'));var toCsv=require(_0xcf82('0x8'));var querystring=require(_0xcf82('0x10'));var Papa=require(_0xcf82('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf82('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf82('0x13'));var logger=require(_0xcf82('0x14'))(_0xcf82('0x15'));var utils=require('../../config/utils');var config=require(_0xcf82('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xcf82('0x17')](config[_0xcf82('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf82('0x19'))(new Redis(config['redis']));require(_0xcf82('0x1a'))[_0xcf82('0x1b')](socket);var jayson=require(_0xcf82('0x1c'));var client=jayson[_0xcf82('0x1d')][_0xcf82('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3c77f0,_0x4fbd5b,_0x547085,_0x5a85a2){return new BPromise(function(_0x3f0742,_0x507025){var _0x1ae40b=_0x5a85a2||client;return _0x1ae40b[_0xcf82('0x1f')](_0x3c77f0,_0x547085)[_0xcf82('0x20')](function(_0x53c0fb){logger[_0xcf82('0x21')]('ChatQueue,\x20%s,\x20%s',_0x4fbd5b,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4fbd5b,'request\x20sent',JSON[_0xcf82('0x22')](_0x53c0fb));if(_0x53c0fb['error']){if(_0x53c0fb[_0xcf82('0x23')][_0xcf82('0x24')]===0x1f4){logger['error'](_0xcf82('0x25'),_0x4fbd5b,_0x53c0fb[_0xcf82('0x23')]['message']);return _0x507025(_0x53c0fb[_0xcf82('0x23')]['message']);}logger['error'](_0xcf82('0x25'),_0x4fbd5b,_0x53c0fb['error'][_0xcf82('0x26')]);return _0x3f0742(_0x53c0fb[_0xcf82('0x23')][_0xcf82('0x26')]);}else{logger[_0xcf82('0x21')]('ChatQueue,\x20%s,\x20%s',_0x4fbd5b,_0xcf82('0x27'));_0x3f0742(_0x53c0fb[_0xcf82('0x28')][_0xcf82('0x26')]);}})[_0xcf82('0x29')](function(_0x911b2f){logger[_0xcf82('0x23')](_0xcf82('0x25'),_0x4fbd5b,_0x911b2f);_0x507025(_0x911b2f);});});}function respondWithStatusCode(_0x51ff36,_0x2a48e1){_0x2a48e1=_0x2a48e1||0xcc;return function(_0x2945b6){if(_0x2945b6){return _0x51ff36[_0xcf82('0x2a')](_0x2a48e1);}return _0x51ff36[_0xcf82('0x2b')](_0x2a48e1)[_0xcf82('0x2c')]();};}function respondWithResult(_0x777c2f,_0x392c2d){_0x392c2d=_0x392c2d||0xc8;return function(_0x2ec170){if(_0x2ec170){return _0x777c2f['status'](_0x392c2d)['json'](_0x2ec170);}};}function respondWithFilteredResult(_0x1e3ab3,_0x8744e6){return function(_0x1a143f){if(_0x1a143f){var _0x43caa9=typeof _0x8744e6[_0xcf82('0x2d')]==='undefined'&&typeof _0x8744e6[_0xcf82('0x2e')]==='undefined';var _0x5d5702=_0x1a143f['count'];var _0x12f9f6=_0x43caa9?0x0:_0x8744e6['offset'];var _0x15e0cb=_0x43caa9?_0x1a143f[_0xcf82('0x2f')]:_0x8744e6['offset']+_0x8744e6[_0xcf82('0x2e')];var _0x430cd5;if(_0x15e0cb>=_0x5d5702){_0x15e0cb=_0x5d5702;_0x430cd5=0xc8;}else{_0x430cd5=0xce;}_0x1e3ab3['status'](_0x430cd5);return _0x1e3ab3[_0xcf82('0x30')](_0xcf82('0x31'),_0x12f9f6+'-'+_0x15e0cb+'/'+_0x5d5702)[_0xcf82('0x32')](_0x1a143f);}return null;};}function patchUpdates(_0xaecd3){return function(_0x2bca62){try{jsonpatch['apply'](_0x2bca62,_0xaecd3,!![]);}catch(_0x98e0a){return BPromise[_0xcf82('0x33')](_0x98e0a);}return _0x2bca62[_0xcf82('0x34')]();};}function saveUpdates(_0x5da814,_0x441bdc){return function(_0x26544c){if(_0x26544c){return _0x26544c['update'](_0x5da814)[_0xcf82('0x20')](function(_0x49c15d){return _0x49c15d;});}return null;};}function removeEntity(_0x1b46e9,_0x5884c2){return function(_0x13c5f4){if(_0x13c5f4){return _0x13c5f4[_0xcf82('0x35')]()['then'](function(){var _0x375e18=_0x13c5f4[_0xcf82('0x36')]({'plain':!![]});var _0x7b4bed=_0xcf82('0x37');return db[_0xcf82('0x38')]['destroy']({'where':{'type':_0x7b4bed,'resourceId':_0x375e18['id']}})['then'](function(){return _0x13c5f4;});})[_0xcf82('0x20')](function(){_0x1b46e9[_0xcf82('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36e894,_0x13177d){return function(_0x570063){if(!_0x570063){_0x36e894[_0xcf82('0x2a')](0x194);}return _0x570063;};}function handleError(_0x424966,_0x55f15e){_0x55f15e=_0x55f15e||0x1f4;return function(_0x2c0a83){logger[_0xcf82('0x23')](_0x2c0a83[_0xcf82('0x39')]);if(_0x2c0a83[_0xcf82('0x3a')]){delete _0x2c0a83[_0xcf82('0x3a')];}_0x424966[_0xcf82('0x2b')](_0x55f15e)[_0xcf82('0x3b')](_0x2c0a83);};}exports['index']=function(_0x2b9410,_0x9000b6){var _0x13c23f={},_0x4c4a4c={},_0x38a028={'count':0x0,'rows':[]};var _0xb1e22a=_[_0xcf82('0x3c')](db[_0xcf82('0x3d')][_0xcf82('0x3e')],function(_0x2ff07b){return{'name':_0x2ff07b[_0xcf82('0x3f')],'type':_0x2ff07b[_0xcf82('0x40')]['key']};});_0x4c4a4c['model']=_[_0xcf82('0x3c')](_0xb1e22a,_0xcf82('0x3a'));_0x4c4a4c[_0xcf82('0x41')]=_[_0xcf82('0x42')](_0x2b9410[_0xcf82('0x41')]);_0x4c4a4c[_0xcf82('0x43')]=_[_0xcf82('0x44')](_0x4c4a4c['model'],_0x4c4a4c[_0xcf82('0x41')]);_0x13c23f[_0xcf82('0x45')]=_[_0xcf82('0x44')](_0x4c4a4c[_0xcf82('0x46')],qs[_0xcf82('0x47')](_0x2b9410[_0xcf82('0x41')][_0xcf82('0x47')]));_0x13c23f[_0xcf82('0x45')]=_0x13c23f[_0xcf82('0x45')][_0xcf82('0x48')]?_0x13c23f[_0xcf82('0x45')]:_0x4c4a4c[_0xcf82('0x46')];if(!_0x2b9410[_0xcf82('0x41')][_0xcf82('0x49')](_0xcf82('0x4a'))){_0x13c23f[_0xcf82('0x2e')]=qs[_0xcf82('0x2e')](_0x2b9410[_0xcf82('0x41')][_0xcf82('0x2e')]);_0x13c23f[_0xcf82('0x2d')]=qs[_0xcf82('0x2d')](_0x2b9410[_0xcf82('0x41')]['offset']);}_0x13c23f['order']=qs[_0xcf82('0x4b')](_0x2b9410[_0xcf82('0x41')][_0xcf82('0x4b')]);_0x13c23f[_0xcf82('0x4c')]=qs[_0xcf82('0x43')](_[_0xcf82('0x4d')](_0x2b9410['query'],_0x4c4a4c[_0xcf82('0x43')]),_0xb1e22a);if(_0x2b9410[_0xcf82('0x41')]['filter']){_0x13c23f[_0xcf82('0x4c')]=_[_0xcf82('0x4e')](_0x13c23f[_0xcf82('0x4c')],{'$or':_[_0xcf82('0x3c')](_0xb1e22a,function(_0x288b25){if(_0x288b25[_0xcf82('0x40')]!==_0xcf82('0x4f')){var _0x427f5c={};_0x427f5c[_0x288b25[_0xcf82('0x3a')]]={'$like':'%'+_0x2b9410['query'][_0xcf82('0x50')]+'%'};return _0x427f5c;}})});}_0x13c23f=_['merge']({},_0x13c23f,_0x2b9410[_0xcf82('0x51')]);var _0x2683e6={'where':_0x13c23f[_0xcf82('0x4c')]};return db[_0xcf82('0x3d')][_0xcf82('0x2f')](_0x2683e6)[_0xcf82('0x20')](function(_0x5483b3){_0x38a028['count']=_0x5483b3;if(_0x2b9410[_0xcf82('0x41')][_0xcf82('0x52')]){_0x13c23f[_0xcf82('0x53')]=[{'all':!![]}];}return db[_0xcf82('0x3d')][_0xcf82('0x54')](_0x13c23f);})[_0xcf82('0x20')](function(_0x1f978a){_0x38a028[_0xcf82('0x55')]=_0x1f978a;return _0x38a028;})[_0xcf82('0x20')](respondWithFilteredResult(_0x9000b6,_0x13c23f))[_0xcf82('0x29')](handleError(_0x9000b6,null));};exports[_0xcf82('0x56')]=function(_0x3010b5,_0x8d1295){var _0x54074f={'raw':!![],'where':{'id':_0x3010b5[_0xcf82('0x57')]['id']}},_0x268ffe={};_0x268ffe[_0xcf82('0x46')]=_['keys'](db[_0xcf82('0x3d')][_0xcf82('0x3e')]);_0x268ffe[_0xcf82('0x41')]=_[_0xcf82('0x42')](_0x3010b5['query']);_0x268ffe[_0xcf82('0x43')]=_[_0xcf82('0x44')](_0x268ffe[_0xcf82('0x46')],_0x268ffe[_0xcf82('0x41')]);_0x54074f['attributes']=_[_0xcf82('0x44')](_0x268ffe[_0xcf82('0x46')],qs['fields'](_0x3010b5[_0xcf82('0x41')][_0xcf82('0x47')]));_0x54074f['attributes']=_0x54074f[_0xcf82('0x45')][_0xcf82('0x48')]?_0x54074f['attributes']:_0x268ffe[_0xcf82('0x46')];if(_0x3010b5[_0xcf82('0x41')][_0xcf82('0x52')]){_0x54074f['include']=[{'all':!![]}];}_0x54074f=_['merge']({},_0x54074f,_0x3010b5[_0xcf82('0x51')]);return db[_0xcf82('0x3d')][_0xcf82('0x58')](_0x54074f)[_0xcf82('0x20')](handleEntityNotFound(_0x8d1295,null))[_0xcf82('0x20')](respondWithResult(_0x8d1295,null))[_0xcf82('0x29')](handleError(_0x8d1295,null));};exports['create']=function(_0xba42f8,_0x3fbb39){return db[_0xcf82('0x3d')]['create'](_0xba42f8[_0xcf82('0x59')],{})['then'](function(_0x1e5de5){var _0x1fa2ea=_0xba42f8[_0xcf82('0x5a')][_0xcf82('0x36')]({'plain':!![]});if(!_0x1fa2ea)throw new Error(_0xcf82('0x5b'));if(_0x1fa2ea['role']===_0xcf82('0x5a')){var _0x317462=_0x1e5de5[_0xcf82('0x36')]({'plain':!![]});var _0x39b9f0=_0xcf82('0x37');return db['UserProfileSection'][_0xcf82('0x58')]({'where':{'name':_0x39b9f0,'userProfileId':_0x1fa2ea[_0xcf82('0x5c')]},'raw':!![]})[_0xcf82('0x20')](function(_0x3ecfa8){if(_0x3ecfa8&&_0x3ecfa8['autoAssociation']===0x0){return db[_0xcf82('0x38')]['create']({'name':_0x317462[_0xcf82('0x3a')],'resourceId':_0x317462['id'],'type':_0x3ecfa8[_0xcf82('0x3a')],'sectionId':_0x3ecfa8['id']},{})['then'](function(){return _0x1e5de5;});}else{return _0x1e5de5;}})['catch'](function(_0x2ae891){logger[_0xcf82('0x23')](_0xcf82('0x5d'),_0x2ae891);throw _0x2ae891;});}return _0x1e5de5;})[_0xcf82('0x20')](respondWithResult(_0x3fbb39,0xc9))[_0xcf82('0x29')](handleError(_0x3fbb39,null));};exports['update']=function(_0xb6b6c7,_0x2c1655){if(_0xb6b6c7['body']['id']){delete _0xb6b6c7[_0xcf82('0x59')]['id'];}return db['ChatQueue'][_0xcf82('0x58')]({'where':{'id':_0xb6b6c7[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x2c1655,null))[_0xcf82('0x20')](saveUpdates(_0xb6b6c7[_0xcf82('0x59')],null))[_0xcf82('0x20')](respondWithResult(_0x2c1655,null))[_0xcf82('0x29')](handleError(_0x2c1655,null));};exports['destroy']=function(_0x42f49b,_0x10bc96){return db['ChatQueue'][_0xcf82('0x58')]({'where':{'id':_0x42f49b[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x10bc96,null))[_0xcf82('0x20')](removeEntity(_0x10bc96,null))[_0xcf82('0x29')](handleError(_0x10bc96,null));};exports[_0xcf82('0x5e')]=function(_0x54bc56,_0x1cf403){return db['ChatQueue']['describe']()[_0xcf82('0x20')](respondWithResult(_0x1cf403,null))[_0xcf82('0x29')](handleError(_0x1cf403,null));};exports[_0xcf82('0x5f')]=function(_0x200474,_0x534372,_0xead7d8){var _0x1c581c={'raw':!![],'where':{}},_0x7ae638={},_0x24e981;return db['ChatQueue'][_0xcf82('0x60')]({'where':{'id':_0x200474[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x534372,null))['then'](function(_0x19e62d){if(_0x19e62d){_0x24e981=_0x19e62d[_0xcf82('0x36')]({'plain':!![]});_0x7ae638[_0xcf82('0x46')]=_['keys'](db[_0xcf82('0x61')]['rawAttributes']);_0x7ae638['query']=_[_0xcf82('0x42')](_0x200474[_0xcf82('0x41')]);_0x7ae638[_0xcf82('0x43')]=_['intersection'](_0x7ae638[_0xcf82('0x46')],_0x7ae638[_0xcf82('0x41')]);_0x1c581c[_0xcf82('0x45')]=_[_0xcf82('0x44')](_0x7ae638[_0xcf82('0x46')],qs[_0xcf82('0x47')](_0x200474[_0xcf82('0x41')][_0xcf82('0x47')]));_0x1c581c['attributes']=_0x1c581c[_0xcf82('0x45')][_0xcf82('0x48')]?_0x1c581c['attributes']:_0x7ae638[_0xcf82('0x46')];if(!_0x200474[_0xcf82('0x41')][_0xcf82('0x49')]('nolimit')){_0x1c581c[_0xcf82('0x2e')]=qs[_0xcf82('0x2e')](_0x200474[_0xcf82('0x41')][_0xcf82('0x2e')]);_0x1c581c[_0xcf82('0x2d')]=qs[_0xcf82('0x2d')](_0x200474[_0xcf82('0x41')][_0xcf82('0x2d')]);}_0x1c581c[_0xcf82('0x62')]=qs['sort'](_0x200474['query'][_0xcf82('0x4b')]);_0x1c581c[_0xcf82('0x4c')]=qs[_0xcf82('0x43')](_[_0xcf82('0x4d')](_0x200474[_0xcf82('0x41')],_0x7ae638['filters']));_0x1c581c['where'][_0xcf82('0x63')]=_0x19e62d['id'];if(_0x200474[_0xcf82('0x41')][_0xcf82('0x50')]){_0x1c581c[_0xcf82('0x4c')]=_[_0xcf82('0x4e')](_0x1c581c[_0xcf82('0x4c')],{'$or':_[_0xcf82('0x3c')](_0x1c581c['attributes'],function(_0x49aef3){var _0x5ec274={};_0x5ec274[_0x49aef3]={'$like':'%'+_0x200474[_0xcf82('0x41')][_0xcf82('0x50')]+'%'};return _0x5ec274;})});}_0x1c581c=_[_0xcf82('0x4e')]({},_0x1c581c,_0x200474[_0xcf82('0x51')]);return db['UserChatQueue']['findAll'](_0x1c581c);}})[_0xcf82('0x20')](function(_0x752da6){if(_0x752da6){return db['User']['findAndCountAll']({'where':{'id':_[_0xcf82('0x3c')](_0x752da6,_0xcf82('0x64')),'role':_0xcf82('0x65')},'attributes':['id',_0xcf82('0x3a'),_0xcf82('0x66'),_0xcf82('0x67'),_0xcf82('0x68')]});}})[_0xcf82('0x20')](function(_0xd48830){if(_0xd48830){return{'count':_0xd48830['count'],'rows':_[_0xcf82('0x3c')](_0xd48830[_0xcf82('0x55')],function(_0x2d3569){return{'membername':_0x2d3569['name'],'UserId':_0x2d3569['id'],'queue_name':_0x24e981[_0xcf82('0x3a')],'ChatQueueId':_0x24e981['id'],'interface':util[_0xcf82('0x69')]('%s/%s',_0xcf82('0x6a'),_0x2d3569[_0xcf82('0x3a')]),'penalty':0x0,'paused':_0x2d3569[_0xcf82('0x66')],'createdAt':_0x2d3569[_0xcf82('0x68')],'updatedAt':_0x2d3569[_0xcf82('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x534372,_0x1c581c))[_0xcf82('0x29')](handleError(_0x534372,null));};exports[_0xcf82('0x6b')]=function(_0x51d535,_0x1dc690,_0x2b2748){var _0x19ad2a={};var _0x434f69={};var _0x3795dc;var _0x4e79e0;return db[_0xcf82('0x3d')][_0xcf82('0x60')]({'where':{'id':_0x51d535[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x1dc690,null))[_0xcf82('0x20')](function(_0x386b68){if(_0x386b68){_0x3795dc=_0x386b68;_0x434f69['model']=_['keys'](db['Team'][_0xcf82('0x3e')]);_0x434f69[_0xcf82('0x41')]=_[_0xcf82('0x42')](_0x51d535['query']);_0x434f69[_0xcf82('0x43')]=_['intersection'](_0x434f69[_0xcf82('0x46')],_0x434f69['query']);_0x19ad2a[_0xcf82('0x45')]=_[_0xcf82('0x44')](_0x434f69['model'],qs[_0xcf82('0x47')](_0x51d535[_0xcf82('0x41')][_0xcf82('0x47')]));_0x19ad2a['attributes']=_0x19ad2a[_0xcf82('0x45')][_0xcf82('0x48')]?_0x19ad2a[_0xcf82('0x45')]:_0x434f69[_0xcf82('0x46')];_0x19ad2a[_0xcf82('0x62')]=qs[_0xcf82('0x4b')](_0x51d535[_0xcf82('0x41')][_0xcf82('0x4b')]);_0x19ad2a[_0xcf82('0x4c')]=qs[_0xcf82('0x43')](_[_0xcf82('0x4d')](_0x51d535[_0xcf82('0x41')],_0x434f69['filters']));if(_0x51d535[_0xcf82('0x41')][_0xcf82('0x50')]){_0x19ad2a[_0xcf82('0x4c')]=_[_0xcf82('0x4e')](_0x19ad2a[_0xcf82('0x4c')],{'$or':_[_0xcf82('0x3c')](_0x19ad2a[_0xcf82('0x45')],function(_0x17cca0){var _0xeb7de={};_0xeb7de[_0x17cca0]={'$like':'%'+_0x51d535['query'][_0xcf82('0x50')]+'%'};return _0xeb7de;})});}_0x19ad2a=_['merge']({},_0x19ad2a,_0x51d535['options']);return _0x3795dc[_0xcf82('0x6b')](_0x19ad2a);}})[_0xcf82('0x20')](function(_0x11cd2b){if(_0x11cd2b){_0x4e79e0=_0x11cd2b[_0xcf82('0x48')];if(!_0x51d535[_0xcf82('0x41')][_0xcf82('0x49')](_0xcf82('0x4a'))){_0x19ad2a[_0xcf82('0x2e')]=qs[_0xcf82('0x2e')](_0x51d535[_0xcf82('0x41')][_0xcf82('0x2e')]);_0x19ad2a[_0xcf82('0x2d')]=qs[_0xcf82('0x2d')](_0x51d535[_0xcf82('0x41')]['offset']);}return _0x3795dc['getTeams'](_0x19ad2a);}})['then'](function(_0x35f0be){if(_0x35f0be){return _0x35f0be?{'count':_0x4e79e0,'rows':_0x35f0be}:null;}})['then'](respondWithResult(_0x1dc690,null))['catch'](handleError(_0x1dc690,null));};exports[_0xcf82('0x6c')]=function(_0x84ac17,_0x225d4a,_0x3047d1){var _0x322a63=_0x84ac17[_0xcf82('0x59')][_0xcf82('0x6d')];return db['Team'][_0xcf82('0x54')]({'where':{'id':_0x322a63},'attributes':['id'],'include':[{'model':db[_0xcf82('0x6e')],'as':'Agents','attributes':['id',_0xcf82('0x3a'),_0xcf82('0x6f'),_0xcf82('0x70'),_0xcf82('0x71')],'raw':!![]}]})['then'](function(_0x1308f1){if(_0x1308f1){var _0x13b9c1=_[_0xcf82('0x72')](_0x1308f1,function(_0x307558){var _0x2b0934=_0x307558[_0xcf82('0x36')]({'plain':!![]});return _0x2b0934[_0xcf82('0x73')];});return db[_0xcf82('0x3d')][_0xcf82('0x58')]({'where':{'id':_0x84ac17[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](function(_0x2191ca){return db[_0xcf82('0x74')][_0xcf82('0x75')](function(_0x2baf76){return _0x2191ca['addTeams'](_0x322a63,{'transaction':_0x2baf76})[_0xcf82('0x20')](function(){return BPromise[_0xcf82('0x76')](_0x13b9c1,function(_0x5b1745){return db[_0xcf82('0x61')][_0xcf82('0x77')]({'where':{'UserId':_0x5b1745['id'],'ChatQueueId':_0x84ac17['params']['id']},'transaction':_0x2baf76});});})[_0xcf82('0x20')](function(){_0x13b9c1[_0xcf82('0x78')](function(_0x889dad){socket[_0xcf82('0x79')]('userChatQueue:save',{'UserId':_0x889dad['id'],'ChatQueueId':_0x2191ca['id']});});});});});}})['then'](respondWithStatusCode(_0x225d4a,null))[_0xcf82('0x29')](handleError(_0x225d4a,null));};exports[_0xcf82('0x7a')]=function(_0x380e35,_0x102767,_0x18c831){return db['Team']['findAll']({'where':{'id':_0x380e35[_0xcf82('0x41')][_0xcf82('0x6d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcf82('0x73'),'attributes':['id'],'raw':!![]}]})[_0xcf82('0x20')](handleEntityNotFound(_0x102767,null))[_0xcf82('0x20')](function(_0x5bf3f8){var _0x20c2d5=_[_0xcf82('0x3c')](_0x5bf3f8,'id');var _0x3f4669=[];var _0x24ab87=[];var _0x13fd70=squel[_0xcf82('0x7b')]();_0x13fd70[_0xcf82('0x7c')](_0xcf82('0x7d'))[_0xcf82('0x7e')](_0xcf82('0x7f'),'tq')[_0xcf82('0x80')](_0xcf82('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x380e35[_0xcf82('0x57')]['id']);for(var _0x21916d=0x0;_0x21916d<_0x5bf3f8[_0xcf82('0x48')];_0x21916d+=0x1){let _0x5b425e=_0x5bf3f8[_0x21916d];for(var _0x8ed187=0x0;_0x8ed187<_0x5b425e['Agents'][_0xcf82('0x48')];_0x8ed187+=0x1){let _0x3f414f=_0x5b425e[_0xcf82('0x73')][_0x8ed187];var _0x280eb7=_0x13fd70['clone']();_0x280eb7[_0xcf82('0x4c')]('ut.UserId\x20=\x20?',_0x3f414f['id']);_0x24ab87[_0xcf82('0x82')](db[_0xcf82('0x74')][_0xcf82('0x41')](_0x280eb7[_0xcf82('0x83')](),{'type':db[_0xcf82('0x74')][_0xcf82('0x84')]['SELECT']})[_0xcf82('0x20')](function(_0x5f4b20){if(_0x5f4b20[_0xcf82('0x48')]===0x1){return _0x3f414f['id'];}else{var _0x5c0323=_[_0xcf82('0x85')](_[_0xcf82('0x3c')](_0x5f4b20,_0xcf82('0x86')),function(_0x1c0cc5){return _[_0xcf82('0x87')](_0x20c2d5,_0x1c0cc5);});if(_0x5c0323){return _0x3f414f['id'];}}}));}}return BPromise['all'](_0x24ab87)[_0xcf82('0x20')](function(_0x20ec86){_0x3f4669=_(_0x3f4669)[_0xcf82('0x88')](_0x20ec86)[_0xcf82('0x89')]()['value']();return db[_0xcf82('0x3d')][_0xcf82('0x58')]({'where':{'id':_0x380e35['params']['id']}})[_0xcf82('0x20')](function(_0x4b95ae){return db[_0xcf82('0x74')][_0xcf82('0x75')](function(_0x1843eb){return _0x4b95ae[_0xcf82('0x7a')](_0x380e35[_0xcf82('0x41')]['ids'],{'transaction':_0x1843eb})[_0xcf82('0x20')](function(){if(!_[_0xcf82('0x8a')](_0x3f4669)){return _0x4b95ae[_0xcf82('0x8b')](_0x3f4669,{'transaction':_0x1843eb});}})[_0xcf82('0x20')](function(){_0x3f4669['forEach'](function(_0x491abc){socket[_0xcf82('0x79')](_0xcf82('0x8c'),{'UserId':_0x491abc,'ChatQueueId':_0x4b95ae['id']});});});});});});})['then'](respondWithStatusCode(_0x102767,null))['catch'](handleError(_0x102767,null));};exports[_0xcf82('0x8d')]=function(_0xa91ef3,_0x38ac41,_0x2c4e69){return db[_0xcf82('0x3d')]['find']({'where':{'id':_0xa91ef3['params']['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x38ac41,null))[_0xcf82('0x20')](function(_0x13fff2){if(_0x13fff2){return _0x13fff2[_0xcf82('0x8d')](_0xa91ef3['body']['ids'],_['omit'](_0xa91ef3[_0xcf82('0x59')],[_0xcf82('0x6d'),'id'])||{})['spread'](function(_0x2de89f){for(var _0x13f9b1=0x0;_0x13f9b1<_0xa91ef3['body']['ids'][_0xcf82('0x48')];_0x13f9b1+=0x1){socket[_0xcf82('0x79')](_0xcf82('0x8e'),{'UserId':Number(_0xa91ef3[_0xcf82('0x59')][_0xcf82('0x6d')][_0x13f9b1]),'ChatQueueId':Number(_0xa91ef3[_0xcf82('0x57')]['id'])});}return _0x2de89f;});}})[_0xcf82('0x20')](respondWithResult(_0x38ac41,null))['catch'](handleError(_0x38ac41,null));};exports[_0xcf82('0x8b')]=function(_0x286222,_0x193e22,_0x7e4a38){return db[_0xcf82('0x3d')][_0xcf82('0x58')]({'where':{'id':_0x286222[_0xcf82('0x57')]['id']}})['then'](handleEntityNotFound(_0x193e22,null))['then'](function(_0x1ec2d3){if(_0x1ec2d3){return _0x1ec2d3[_0xcf82('0x8b')](_0x286222[_0xcf82('0x41')][_0xcf82('0x6d')])['then'](function(){if(_[_0xcf82('0x8f')](_0x286222[_0xcf82('0x41')][_0xcf82('0x6d')])){for(var _0x14ff11=0x0;_0x14ff11<_0x286222[_0xcf82('0x41')][_0xcf82('0x6d')][_0xcf82('0x48')];_0x14ff11+=0x1){socket[_0xcf82('0x79')](_0xcf82('0x8c'),{'UserId':Number(_0x286222[_0xcf82('0x41')][_0xcf82('0x6d')][_0x14ff11]),'ChatQueueId':Number(_0x286222['params']['id'])});}}else{socket['emit'](_0xcf82('0x8c'),{'UserId':Number(_0x286222[_0xcf82('0x41')][_0xcf82('0x6d')]),'ChatQueueId':Number(_0x286222[_0xcf82('0x57')]['id'])});}});}})[_0xcf82('0x20')](respondWithStatusCode(_0x193e22,null))['catch'](handleError(_0x193e22,null));};exports[_0xcf82('0x90')]=function(_0x1e2ab7,_0x469803,_0x5a038f){var _0xd20232={};var _0xe3ccd6={};var _0x319c88;var _0x579af4;return db['ChatQueue']['findOne']({'where':{'id':_0x1e2ab7[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x469803,null))[_0xcf82('0x20')](function(_0xcd58b8){if(_0xcd58b8){_0x319c88=_0xcd58b8;_0xe3ccd6[_0xcf82('0x46')]=_[_0xcf82('0x42')](db[_0xcf82('0x6e')][_0xcf82('0x3e')]);_0xe3ccd6[_0xcf82('0x41')]=_[_0xcf82('0x42')](_0x1e2ab7[_0xcf82('0x41')]);_0xe3ccd6[_0xcf82('0x43')]=_[_0xcf82('0x44')](_0xe3ccd6[_0xcf82('0x46')],_0xe3ccd6[_0xcf82('0x41')]);_0xd20232[_0xcf82('0x45')]=_[_0xcf82('0x44')](_0xe3ccd6[_0xcf82('0x46')],qs['fields'](_0x1e2ab7[_0xcf82('0x41')][_0xcf82('0x47')]));_0xd20232[_0xcf82('0x45')]=_0xd20232['attributes']['length']?_0xd20232[_0xcf82('0x45')]:_0xe3ccd6[_0xcf82('0x46')];_0xd20232[_0xcf82('0x62')]=qs['sort'](_0x1e2ab7[_0xcf82('0x41')]['sort']);_0xd20232[_0xcf82('0x4c')]=qs[_0xcf82('0x43')](_['pick'](_0x1e2ab7['query'],_0xe3ccd6[_0xcf82('0x43')]));if(_0x1e2ab7['query']['filter']){_0xd20232['where']=_[_0xcf82('0x4e')](_0xd20232[_0xcf82('0x4c')],{'$or':_[_0xcf82('0x3c')](_0xd20232[_0xcf82('0x45')],function(_0x6d8268){var _0x3f2fd7={};_0x3f2fd7[_0x6d8268]={'$like':'%'+_0x1e2ab7[_0xcf82('0x41')][_0xcf82('0x50')]+'%'};return _0x3f2fd7;})});}_0xd20232=_['merge']({},_0xd20232,_0x1e2ab7[_0xcf82('0x51')]);return _0x319c88['getAgents'](_0xd20232);}})[_0xcf82('0x20')](function(_0x58ebf8){if(_0x58ebf8){_0x579af4=_0x58ebf8[_0xcf82('0x48')];if(!_0x1e2ab7[_0xcf82('0x41')][_0xcf82('0x49')]('nolimit')){_0xd20232['limit']=qs[_0xcf82('0x2e')](_0x1e2ab7[_0xcf82('0x41')][_0xcf82('0x2e')]);_0xd20232[_0xcf82('0x2d')]=qs[_0xcf82('0x2d')](_0x1e2ab7[_0xcf82('0x41')][_0xcf82('0x2d')]);}return _0x319c88[_0xcf82('0x90')](_0xd20232);}})[_0xcf82('0x20')](function(_0x5aaf20){if(_0x5aaf20){return _0x5aaf20?{'count':_0x579af4,'rows':_0x5aaf20}:null;}})[_0xcf82('0x20')](respondWithResult(_0x469803,null))[_0xcf82('0x29')](handleError(_0x469803,null));}; \ No newline at end of file +var _0x5f64=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','UserChatQueue','hasOwnProperty','nolimit','findAll','User','findAndCountAll','UserId','chatPause','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','Agents','sequelize','transaction','each','forEach','emit','userChatQueue:save','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','SELECT','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','limit','count','apply','reject','save','get','UserProfileResource','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','ChatQueue','includeAll','catch','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0x5f64,0x155));var _0x45f6=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x5f64[_0x3b96cf];return _0x2e315a;};'use strict';var emlformat=require(_0x45f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45f6('0x1'));var jsonpatch=require(_0x45f6('0x2'));var rp=require(_0x45f6('0x3'));var moment=require('moment');var BPromise=require(_0x45f6('0x4'));var Mustache=require(_0x45f6('0x5'));var util=require(_0x45f6('0x6'));var path=require('path');var sox=require(_0x45f6('0x7'));var csv=require('to-csv');var ejs=require(_0x45f6('0x8'));var fs=require('fs');var fs_extra=require(_0x45f6('0x9'));var _=require(_0x45f6('0xa'));var squel=require(_0x45f6('0xb'));var crypto=require(_0x45f6('0xc'));var jsforce=require(_0x45f6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x45f6('0xe'));var querystring=require(_0x45f6('0xf'));var Papa=require(_0x45f6('0x10'));var Redis=require(_0x45f6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x45f6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45f6('0x13'));var logger=require(_0x45f6('0x14'))(_0x45f6('0x15'));var utils=require(_0x45f6('0x16'));var config=require(_0x45f6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x45f6('0x18'))['db'];config[_0x45f6('0x19')]=_[_0x45f6('0x1a')](config[_0x45f6('0x19')],{'host':_0x45f6('0x1b'),'port':0x18eb});var socket=require(_0x45f6('0x1c'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x45f6('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x45f6('0x1e')][_0x45f6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xb52dc0,_0x55b65e,_0x2b2025,_0x2ea016){return new BPromise(function(_0x5066d5,_0x50df74){var _0x2e6910=_0x2ea016||client;return _0x2e6910['request'](_0xb52dc0,_0x2b2025)[_0x45f6('0x20')](function(_0xaab990){logger[_0x45f6('0x21')](_0x45f6('0x22'),_0x55b65e,_0x45f6('0x23'));logger[_0x45f6('0x24')](_0x45f6('0x25'),_0x55b65e,_0x45f6('0x23'),JSON['stringify'](_0xaab990));if(_0xaab990[_0x45f6('0x26')]){if(_0xaab990[_0x45f6('0x26')][_0x45f6('0x27')]===0x1f4){logger['error'](_0x45f6('0x22'),_0x55b65e,_0xaab990[_0x45f6('0x26')]['message']);return _0x50df74(_0xaab990[_0x45f6('0x26')][_0x45f6('0x28')]);}logger[_0x45f6('0x26')]('ChatQueue,\x20%s,\x20%s',_0x55b65e,_0xaab990['error'][_0x45f6('0x28')]);return _0x5066d5(_0xaab990['error'][_0x45f6('0x28')]);}else{logger[_0x45f6('0x21')](_0x45f6('0x22'),_0x55b65e,_0x45f6('0x23'));_0x5066d5(_0xaab990[_0x45f6('0x29')][_0x45f6('0x28')]);}})['catch'](function(_0x1ec33a){logger['error']('ChatQueue,\x20%s,\x20%s',_0x55b65e,_0x1ec33a);_0x50df74(_0x1ec33a);});});}function respondWithStatusCode(_0x391434,_0x242c78){_0x242c78=_0x242c78||0xcc;return function(_0x9440ab){if(_0x9440ab){return _0x391434[_0x45f6('0x2a')](_0x242c78);}return _0x391434[_0x45f6('0x2b')](_0x242c78)[_0x45f6('0x2c')]();};}function respondWithResult(_0x1b2d42,_0x4e60e3){_0x4e60e3=_0x4e60e3||0xc8;return function(_0x55be01){if(_0x55be01){return _0x1b2d42[_0x45f6('0x2b')](_0x4e60e3)[_0x45f6('0x2d')](_0x55be01);}};}function respondWithFilteredResult(_0x1036e9,_0x4c258c){return function(_0x1ca403){if(_0x1ca403){var _0x29dc21=typeof _0x4c258c[_0x45f6('0x2e')]==='undefined'&&typeof _0x4c258c[_0x45f6('0x2f')]==='undefined';var _0x2c7b03=_0x1ca403[_0x45f6('0x30')];var _0x5b3cd2=_0x29dc21?0x0:_0x4c258c[_0x45f6('0x2e')];var _0xe9fff5=_0x29dc21?_0x1ca403[_0x45f6('0x30')]:_0x4c258c['offset']+_0x4c258c[_0x45f6('0x2f')];var _0x5572f5;if(_0xe9fff5>=_0x2c7b03){_0xe9fff5=_0x2c7b03;_0x5572f5=0xc8;}else{_0x5572f5=0xce;}_0x1036e9[_0x45f6('0x2b')](_0x5572f5);return _0x1036e9['set']('Content-Range',_0x5b3cd2+'-'+_0xe9fff5+'/'+_0x2c7b03)['json'](_0x1ca403);}return null;};}function patchUpdates(_0x28f639){return function(_0x56a382){try{jsonpatch[_0x45f6('0x31')](_0x56a382,_0x28f639,!![]);}catch(_0x548c49){return BPromise[_0x45f6('0x32')](_0x548c49);}return _0x56a382[_0x45f6('0x33')]();};}function saveUpdates(_0x22681f,_0x23a4db){return function(_0x5eb7b8){if(_0x5eb7b8){return _0x5eb7b8['update'](_0x22681f)['then'](function(_0x43afaf){return _0x43afaf;});}return null;};}function removeEntity(_0x4cc952,_0x32d90c){return function(_0x3f133d){if(_0x3f133d){return _0x3f133d['destroy']()['then'](function(){var _0x4f27f7=_0x3f133d[_0x45f6('0x34')]({'plain':!![]});var _0x2ba446='ChatQueues';return db[_0x45f6('0x35')][_0x45f6('0x36')]({'where':{'type':_0x2ba446,'resourceId':_0x4f27f7['id']}})[_0x45f6('0x20')](function(){return _0x3f133d;});})[_0x45f6('0x20')](function(){_0x4cc952[_0x45f6('0x2b')](0xcc)[_0x45f6('0x2c')]();});}};}function handleEntityNotFound(_0x57a16f,_0x121de2){return function(_0x19982e){if(!_0x19982e){_0x57a16f[_0x45f6('0x2a')](0x194);}return _0x19982e;};}function handleError(_0x2197a3,_0x2683c6){_0x2683c6=_0x2683c6||0x1f4;return function(_0x27d34f){logger[_0x45f6('0x26')](_0x27d34f[_0x45f6('0x37')]);if(_0x27d34f[_0x45f6('0x38')]){delete _0x27d34f[_0x45f6('0x38')];}_0x2197a3[_0x45f6('0x2b')](_0x2683c6)[_0x45f6('0x39')](_0x27d34f);};}exports[_0x45f6('0x3a')]=function(_0x3db4f8,_0xe75b58){var _0x5dd263={},_0x1565b0={},_0x381ac5={'count':0x0,'rows':[]};var _0xb26157=_[_0x45f6('0x3b')](db['ChatQueue']['rawAttributes'],function(_0x3ce19e){return{'name':_0x3ce19e[_0x45f6('0x3c')],'type':_0x3ce19e[_0x45f6('0x3d')][_0x45f6('0x3e')]};});_0x1565b0[_0x45f6('0x3f')]=_[_0x45f6('0x3b')](_0xb26157,_0x45f6('0x38'));_0x1565b0[_0x45f6('0x40')]=_[_0x45f6('0x41')](_0x3db4f8[_0x45f6('0x40')]);_0x1565b0[_0x45f6('0x42')]=_[_0x45f6('0x43')](_0x1565b0[_0x45f6('0x3f')],_0x1565b0[_0x45f6('0x40')]);_0x5dd263[_0x45f6('0x44')]=_['intersection'](_0x1565b0['model'],qs[_0x45f6('0x45')](_0x3db4f8['query'][_0x45f6('0x45')]));_0x5dd263[_0x45f6('0x44')]=_0x5dd263[_0x45f6('0x44')][_0x45f6('0x46')]?_0x5dd263[_0x45f6('0x44')]:_0x1565b0[_0x45f6('0x3f')];if(!_0x3db4f8[_0x45f6('0x40')]['hasOwnProperty']('nolimit')){_0x5dd263[_0x45f6('0x2f')]=qs[_0x45f6('0x2f')](_0x3db4f8[_0x45f6('0x40')][_0x45f6('0x2f')]);_0x5dd263[_0x45f6('0x2e')]=qs['offset'](_0x3db4f8['query'][_0x45f6('0x2e')]);}_0x5dd263[_0x45f6('0x47')]=qs[_0x45f6('0x48')](_0x3db4f8['query']['sort']);_0x5dd263[_0x45f6('0x49')]=qs[_0x45f6('0x42')](_[_0x45f6('0x4a')](_0x3db4f8[_0x45f6('0x40')],_0x1565b0[_0x45f6('0x42')]),_0xb26157);if(_0x3db4f8[_0x45f6('0x40')][_0x45f6('0x4b')]){_0x5dd263['where']=_[_0x45f6('0x4c')](_0x5dd263[_0x45f6('0x49')],{'$or':_['map'](_0xb26157,function(_0x378e46){if(_0x378e46[_0x45f6('0x3d')]!==_0x45f6('0x4d')){var _0x520762={};_0x520762[_0x378e46[_0x45f6('0x38')]]={'$like':'%'+_0x3db4f8[_0x45f6('0x40')][_0x45f6('0x4b')]+'%'};return _0x520762;}})});}_0x5dd263=_['merge']({},_0x5dd263,_0x3db4f8['options']);var _0x1a4c41={'where':_0x5dd263[_0x45f6('0x49')]};return db[_0x45f6('0x4e')]['count'](_0x1a4c41)[_0x45f6('0x20')](function(_0x4a96ec){_0x381ac5[_0x45f6('0x30')]=_0x4a96ec;if(_0x3db4f8[_0x45f6('0x40')][_0x45f6('0x4f')]){_0x5dd263['include']=[{'all':!![]}];}return db[_0x45f6('0x4e')]['findAll'](_0x5dd263);})[_0x45f6('0x20')](function(_0x56579a){_0x381ac5['rows']=_0x56579a;return _0x381ac5;})[_0x45f6('0x20')](respondWithFilteredResult(_0xe75b58,_0x5dd263))[_0x45f6('0x50')](handleError(_0xe75b58,null));};exports['show']=function(_0x215a8b,_0x5a7998){var _0x12f860={'raw':!![],'where':{'id':_0x215a8b['params']['id']}},_0x11a37e={};_0x11a37e['model']=_[_0x45f6('0x41')](db[_0x45f6('0x4e')][_0x45f6('0x51')]);_0x11a37e[_0x45f6('0x40')]=_[_0x45f6('0x41')](_0x215a8b['query']);_0x11a37e['filters']=_[_0x45f6('0x43')](_0x11a37e[_0x45f6('0x3f')],_0x11a37e['query']);_0x12f860[_0x45f6('0x44')]=_[_0x45f6('0x43')](_0x11a37e[_0x45f6('0x3f')],qs[_0x45f6('0x45')](_0x215a8b['query'][_0x45f6('0x45')]));_0x12f860[_0x45f6('0x44')]=_0x12f860[_0x45f6('0x44')][_0x45f6('0x46')]?_0x12f860[_0x45f6('0x44')]:_0x11a37e[_0x45f6('0x3f')];if(_0x215a8b['query'][_0x45f6('0x4f')]){_0x12f860['include']=[{'all':!![]}];}_0x12f860=_['merge']({},_0x12f860,_0x215a8b[_0x45f6('0x52')]);return db[_0x45f6('0x4e')][_0x45f6('0x53')](_0x12f860)[_0x45f6('0x20')](handleEntityNotFound(_0x5a7998,null))['then'](respondWithResult(_0x5a7998,null))['catch'](handleError(_0x5a7998,null));};exports[_0x45f6('0x54')]=function(_0x9c40eb,_0x451aa2){return db['ChatQueue'][_0x45f6('0x54')](_0x9c40eb[_0x45f6('0x55')],{})['then'](function(_0x9d3509){var _0x119e18=_0x9c40eb[_0x45f6('0x56')][_0x45f6('0x34')]({'plain':!![]});if(!_0x119e18)throw new Error(_0x45f6('0x57'));if(_0x119e18[_0x45f6('0x58')]===_0x45f6('0x56')){var _0xbff8e3=_0x9d3509[_0x45f6('0x34')]({'plain':!![]});var _0x125104=_0x45f6('0x59');return db[_0x45f6('0x5a')][_0x45f6('0x53')]({'where':{'name':_0x125104,'userProfileId':_0x119e18[_0x45f6('0x5b')]},'raw':!![]})[_0x45f6('0x20')](function(_0xcd2ae4){if(_0xcd2ae4&&_0xcd2ae4[_0x45f6('0x5c')]===0x0){return db[_0x45f6('0x35')][_0x45f6('0x54')]({'name':_0xbff8e3['name'],'resourceId':_0xbff8e3['id'],'type':_0xcd2ae4[_0x45f6('0x38')],'sectionId':_0xcd2ae4['id']},{})[_0x45f6('0x20')](function(){return _0x9d3509;});}else{return _0x9d3509;}})[_0x45f6('0x50')](function(_0x18e53c){logger[_0x45f6('0x26')](_0x45f6('0x5d'),_0x18e53c);throw _0x18e53c;});}return _0x9d3509;})[_0x45f6('0x20')](respondWithResult(_0x451aa2,0xc9))[_0x45f6('0x50')](handleError(_0x451aa2,null));};exports['update']=function(_0x36eee2,_0x3005a3){if(_0x36eee2['body']['id']){delete _0x36eee2[_0x45f6('0x55')]['id'];}return db['ChatQueue'][_0x45f6('0x53')]({'where':{'id':_0x36eee2[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](handleEntityNotFound(_0x3005a3,null))['then'](saveUpdates(_0x36eee2['body'],null))[_0x45f6('0x20')](respondWithResult(_0x3005a3,null))[_0x45f6('0x50')](handleError(_0x3005a3,null));};exports['destroy']=function(_0x190474,_0x4e3373){return db[_0x45f6('0x4e')][_0x45f6('0x53')]({'where':{'id':_0x190474[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](handleEntityNotFound(_0x4e3373,null))['then'](removeEntity(_0x4e3373,null))['catch'](handleError(_0x4e3373,null));};exports['describe']=function(_0x4e355a,_0x23136d){return db[_0x45f6('0x4e')]['describe']()[_0x45f6('0x20')](respondWithResult(_0x23136d,null))[_0x45f6('0x50')](handleError(_0x23136d,null));};exports['getMembers']=function(_0x3ed9be,_0x42fa4e,_0x36e467){var _0x409282={'raw':!![],'where':{}},_0x44af68={},_0x1b4d32;return db[_0x45f6('0x4e')]['findOne']({'where':{'id':_0x3ed9be[_0x45f6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x42fa4e,null))[_0x45f6('0x20')](function(_0x2c9de7){if(_0x2c9de7){_0x1b4d32=_0x2c9de7['get']({'plain':!![]});_0x44af68[_0x45f6('0x3f')]=_[_0x45f6('0x41')](db[_0x45f6('0x5f')][_0x45f6('0x51')]);_0x44af68[_0x45f6('0x40')]=_[_0x45f6('0x41')](_0x3ed9be['query']);_0x44af68['filters']=_['intersection'](_0x44af68[_0x45f6('0x3f')],_0x44af68[_0x45f6('0x40')]);_0x409282[_0x45f6('0x44')]=_[_0x45f6('0x43')](_0x44af68[_0x45f6('0x3f')],qs[_0x45f6('0x45')](_0x3ed9be[_0x45f6('0x40')][_0x45f6('0x45')]));_0x409282[_0x45f6('0x44')]=_0x409282[_0x45f6('0x44')][_0x45f6('0x46')]?_0x409282[_0x45f6('0x44')]:_0x44af68[_0x45f6('0x3f')];if(!_0x3ed9be[_0x45f6('0x40')][_0x45f6('0x60')](_0x45f6('0x61'))){_0x409282[_0x45f6('0x2f')]=qs['limit'](_0x3ed9be['query']['limit']);_0x409282[_0x45f6('0x2e')]=qs['offset'](_0x3ed9be[_0x45f6('0x40')][_0x45f6('0x2e')]);}_0x409282[_0x45f6('0x47')]=qs[_0x45f6('0x48')](_0x3ed9be[_0x45f6('0x40')]['sort']);_0x409282[_0x45f6('0x49')]=qs[_0x45f6('0x42')](_[_0x45f6('0x4a')](_0x3ed9be[_0x45f6('0x40')],_0x44af68[_0x45f6('0x42')]));_0x409282[_0x45f6('0x49')]['ChatQueueId']=_0x2c9de7['id'];if(_0x3ed9be[_0x45f6('0x40')][_0x45f6('0x4b')]){_0x409282[_0x45f6('0x49')]=_['merge'](_0x409282[_0x45f6('0x49')],{'$or':_[_0x45f6('0x3b')](_0x409282['attributes'],function(_0xb5c23e){var _0x2b7b0f={};_0x2b7b0f[_0xb5c23e]={'$like':'%'+_0x3ed9be[_0x45f6('0x40')][_0x45f6('0x4b')]+'%'};return _0x2b7b0f;})});}_0x409282=_[_0x45f6('0x4c')]({},_0x409282,_0x3ed9be[_0x45f6('0x52')]);return db['UserChatQueue'][_0x45f6('0x62')](_0x409282);}})[_0x45f6('0x20')](function(_0x4703d7){if(_0x4703d7){return db[_0x45f6('0x63')][_0x45f6('0x64')]({'where':{'id':_[_0x45f6('0x3b')](_0x4703d7,_0x45f6('0x65')),'role':'agent'},'attributes':['id',_0x45f6('0x38'),_0x45f6('0x66'),'updatedAt',_0x45f6('0x67')]});}})[_0x45f6('0x20')](function(_0x5bfdd2){if(_0x5bfdd2){return{'count':_0x5bfdd2['count'],'rows':_[_0x45f6('0x3b')](_0x5bfdd2[_0x45f6('0x68')],function(_0x1e0c90){return{'membername':_0x1e0c90[_0x45f6('0x38')],'UserId':_0x1e0c90['id'],'queue_name':_0x1b4d32[_0x45f6('0x38')],'ChatQueueId':_0x1b4d32['id'],'interface':util[_0x45f6('0x69')](_0x45f6('0x6a'),_0x45f6('0x6b'),_0x1e0c90['name']),'penalty':0x0,'paused':_0x1e0c90[_0x45f6('0x66')],'createdAt':_0x1e0c90['createdAt'],'updatedAt':_0x1e0c90['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x42fa4e,_0x409282))[_0x45f6('0x50')](handleError(_0x42fa4e,null));};exports[_0x45f6('0x6c')]=function(_0x343d6f,_0x460099,_0x5e5beb){var _0x6ab762={};var _0x132141={};var _0x5c479a;var _0x18de7f;return db['ChatQueue']['findOne']({'where':{'id':_0x343d6f[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](handleEntityNotFound(_0x460099,null))[_0x45f6('0x20')](function(_0x3649d5){if(_0x3649d5){_0x5c479a=_0x3649d5;_0x132141[_0x45f6('0x3f')]=_[_0x45f6('0x41')](db[_0x45f6('0x6d')][_0x45f6('0x51')]);_0x132141['query']=_[_0x45f6('0x41')](_0x343d6f[_0x45f6('0x40')]);_0x132141[_0x45f6('0x42')]=_[_0x45f6('0x43')](_0x132141[_0x45f6('0x3f')],_0x132141[_0x45f6('0x40')]);_0x6ab762[_0x45f6('0x44')]=_[_0x45f6('0x43')](_0x132141[_0x45f6('0x3f')],qs[_0x45f6('0x45')](_0x343d6f['query'][_0x45f6('0x45')]));_0x6ab762['attributes']=_0x6ab762[_0x45f6('0x44')][_0x45f6('0x46')]?_0x6ab762[_0x45f6('0x44')]:_0x132141[_0x45f6('0x3f')];_0x6ab762[_0x45f6('0x47')]=qs[_0x45f6('0x48')](_0x343d6f[_0x45f6('0x40')]['sort']);_0x6ab762[_0x45f6('0x49')]=qs[_0x45f6('0x42')](_[_0x45f6('0x4a')](_0x343d6f[_0x45f6('0x40')],_0x132141[_0x45f6('0x42')]));if(_0x343d6f[_0x45f6('0x40')][_0x45f6('0x4b')]){_0x6ab762[_0x45f6('0x49')]=_[_0x45f6('0x4c')](_0x6ab762[_0x45f6('0x49')],{'$or':_[_0x45f6('0x3b')](_0x6ab762['attributes'],function(_0x1c7442){var _0x3296b8={};_0x3296b8[_0x1c7442]={'$like':'%'+_0x343d6f['query'][_0x45f6('0x4b')]+'%'};return _0x3296b8;})});}_0x6ab762=_[_0x45f6('0x4c')]({},_0x6ab762,_0x343d6f[_0x45f6('0x52')]);return _0x5c479a[_0x45f6('0x6c')](_0x6ab762);}})['then'](function(_0x5e4c67){if(_0x5e4c67){_0x18de7f=_0x5e4c67[_0x45f6('0x46')];if(!_0x343d6f[_0x45f6('0x40')][_0x45f6('0x60')](_0x45f6('0x61'))){_0x6ab762['limit']=qs[_0x45f6('0x2f')](_0x343d6f[_0x45f6('0x40')]['limit']);_0x6ab762[_0x45f6('0x2e')]=qs['offset'](_0x343d6f['query'][_0x45f6('0x2e')]);}return _0x5c479a[_0x45f6('0x6c')](_0x6ab762);}})['then'](function(_0x61f436){if(_0x61f436){return _0x61f436?{'count':_0x18de7f,'rows':_0x61f436}:null;}})['then'](respondWithResult(_0x460099,null))[_0x45f6('0x50')](handleError(_0x460099,null));};exports[_0x45f6('0x6e')]=function(_0x53a976,_0x26b20e,_0x32b33a){var _0x524f94=_0x53a976['body'][_0x45f6('0x6f')];return db[_0x45f6('0x6d')][_0x45f6('0x62')]({'where':{'id':_0x524f94},'attributes':['id'],'include':[{'model':db[_0x45f6('0x63')],'as':'Agents','attributes':['id','name',_0x45f6('0x70'),_0x45f6('0x71'),_0x45f6('0x72')],'raw':!![]}]})[_0x45f6('0x20')](function(_0x1b1e9f){if(_0x1b1e9f){var _0x1f0fbe=_['flatMap'](_0x1b1e9f,function(_0x3e07cf){var _0x555f7d=_0x3e07cf[_0x45f6('0x34')]({'plain':!![]});return _0x555f7d[_0x45f6('0x73')];});return db[_0x45f6('0x4e')]['find']({'where':{'id':_0x53a976[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](function(_0x5af0ee){return db[_0x45f6('0x74')][_0x45f6('0x75')](function(_0xbadc23){return _0x5af0ee['addTeams'](_0x524f94,{'transaction':_0xbadc23})[_0x45f6('0x20')](function(){return BPromise[_0x45f6('0x76')](_0x1f0fbe,function(_0xad8b1b){return db[_0x45f6('0x5f')]['findOrCreate']({'where':{'UserId':_0xad8b1b['id'],'ChatQueueId':_0x53a976[_0x45f6('0x5e')]['id']},'transaction':_0xbadc23});});})[_0x45f6('0x20')](function(){_0x1f0fbe[_0x45f6('0x77')](function(_0x318822){socket[_0x45f6('0x78')](_0x45f6('0x79'),{'UserId':_0x318822['id'],'ChatQueueId':_0x5af0ee['id']});});});});});}})[_0x45f6('0x20')](respondWithStatusCode(_0x26b20e,null))['catch'](handleError(_0x26b20e,null));};exports['removeTeams']=function(_0x3f7bd3,_0x467a05,_0x2b6c06){return db[_0x45f6('0x6d')][_0x45f6('0x62')]({'where':{'id':_0x3f7bd3[_0x45f6('0x40')][_0x45f6('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x45f6('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x45f6('0x20')](handleEntityNotFound(_0x467a05,null))[_0x45f6('0x20')](function(_0x537346){var _0x241249=_['map'](_0x537346,'id');var _0x5ea906=[];var _0x479c92=[];var _0x47b5df=squel['select']();_0x47b5df[_0x45f6('0x7a')]('tq.TeamId')[_0x45f6('0x7b')](_0x45f6('0x7c'),'tq')[_0x45f6('0x7d')](_0x45f6('0x7e'),'ut',_0x45f6('0x7f'))['where'](_0x45f6('0x80'),_0x3f7bd3[_0x45f6('0x5e')]['id']);for(var _0x2de5a6=0x0;_0x2de5a6<_0x537346['length'];_0x2de5a6+=0x1){let _0x233380=_0x537346[_0x2de5a6];for(var _0x1c1889=0x0;_0x1c1889<_0x233380['Agents'][_0x45f6('0x46')];_0x1c1889+=0x1){let _0xcee8cc=_0x233380[_0x45f6('0x73')][_0x1c1889];var _0x52294a=_0x47b5df['clone']();_0x52294a['where']('ut.UserId\x20=\x20?',_0xcee8cc['id']);_0x479c92[_0x45f6('0x81')](db[_0x45f6('0x74')]['query'](_0x52294a['toString'](),{'type':db[_0x45f6('0x74')]['QueryTypes'][_0x45f6('0x82')]})[_0x45f6('0x20')](function(_0xfea7b6){if(_0xfea7b6['length']===0x1){return _0xcee8cc['id'];}else{var _0x1ab9fc=_['every'](_[_0x45f6('0x3b')](_0xfea7b6,_0x45f6('0x83')),function(_0x5a4eca){return _[_0x45f6('0x84')](_0x241249,_0x5a4eca);});if(_0x1ab9fc){return _0xcee8cc['id'];}}}));}}return BPromise[_0x45f6('0x85')](_0x479c92)[_0x45f6('0x20')](function(_0x4d0895){_0x5ea906=_(_0x5ea906)[_0x45f6('0x86')](_0x4d0895)['compact']()[_0x45f6('0x87')]();return db[_0x45f6('0x4e')]['find']({'where':{'id':_0x3f7bd3[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](function(_0x29a654){return db['sequelize'][_0x45f6('0x75')](function(_0xc78c3b){return _0x29a654[_0x45f6('0x88')](_0x3f7bd3[_0x45f6('0x40')][_0x45f6('0x6f')],{'transaction':_0xc78c3b})[_0x45f6('0x20')](function(){if(!_[_0x45f6('0x89')](_0x5ea906)){return _0x29a654[_0x45f6('0x8a')](_0x5ea906,{'transaction':_0xc78c3b});}})[_0x45f6('0x20')](function(){_0x5ea906[_0x45f6('0x77')](function(_0x584c20){socket[_0x45f6('0x78')](_0x45f6('0x8b'),{'UserId':_0x584c20,'ChatQueueId':_0x29a654['id']});});});});});});})[_0x45f6('0x20')](respondWithStatusCode(_0x467a05,null))[_0x45f6('0x50')](handleError(_0x467a05,null));};exports[_0x45f6('0x8c')]=function(_0x9dc465,_0x170581,_0x1e5f69){return db['ChatQueue']['find']({'where':{'id':_0x9dc465[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](handleEntityNotFound(_0x170581,null))[_0x45f6('0x20')](function(_0x1e5d8f){if(_0x1e5d8f){return _0x1e5d8f[_0x45f6('0x8c')](_0x9dc465[_0x45f6('0x55')]['ids'],_['omit'](_0x9dc465['body'],['ids','id'])||{})[_0x45f6('0x8d')](function(_0x5be0b1){for(var _0x3ed5ab=0x0;_0x3ed5ab<_0x9dc465[_0x45f6('0x55')][_0x45f6('0x6f')][_0x45f6('0x46')];_0x3ed5ab+=0x1){socket[_0x45f6('0x78')]('userChatQueue:save',{'UserId':Number(_0x9dc465[_0x45f6('0x55')][_0x45f6('0x6f')][_0x3ed5ab]),'ChatQueueId':Number(_0x9dc465[_0x45f6('0x5e')]['id'])});}return _0x5be0b1;});}})[_0x45f6('0x20')](respondWithResult(_0x170581,null))['catch'](handleError(_0x170581,null));};exports['removeAgents']=function(_0x1ec103,_0x25097b,_0x43198d){return db[_0x45f6('0x4e')][_0x45f6('0x53')]({'where':{'id':_0x1ec103[_0x45f6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x25097b,null))[_0x45f6('0x20')](function(_0x567eb6){if(_0x567eb6){return _0x567eb6['removeAgents'](_0x1ec103[_0x45f6('0x40')][_0x45f6('0x6f')])[_0x45f6('0x20')](function(){if(_[_0x45f6('0x8e')](_0x1ec103[_0x45f6('0x40')]['ids'])){for(var _0x4dbc04=0x0;_0x4dbc04<_0x1ec103[_0x45f6('0x40')][_0x45f6('0x6f')][_0x45f6('0x46')];_0x4dbc04+=0x1){socket[_0x45f6('0x78')](_0x45f6('0x8b'),{'UserId':Number(_0x1ec103['query'][_0x45f6('0x6f')][_0x4dbc04]),'ChatQueueId':Number(_0x1ec103[_0x45f6('0x5e')]['id'])});}}else{socket[_0x45f6('0x78')](_0x45f6('0x8b'),{'UserId':Number(_0x1ec103[_0x45f6('0x40')][_0x45f6('0x6f')]),'ChatQueueId':Number(_0x1ec103[_0x45f6('0x5e')]['id'])});}});}})[_0x45f6('0x20')](respondWithStatusCode(_0x25097b,null))[_0x45f6('0x50')](handleError(_0x25097b,null));};exports[_0x45f6('0x8f')]=function(_0x59c9b1,_0x4b2e31,_0x87a7a4){var _0x456c54={};var _0x40aeda={};var _0x111b5c;var _0x5f041d;return db[_0x45f6('0x4e')]['findOne']({'where':{'id':_0x59c9b1[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](handleEntityNotFound(_0x4b2e31,null))[_0x45f6('0x20')](function(_0x5c5292){if(_0x5c5292){_0x111b5c=_0x5c5292;_0x40aeda[_0x45f6('0x3f')]=_[_0x45f6('0x41')](db[_0x45f6('0x63')]['rawAttributes']);_0x40aeda[_0x45f6('0x40')]=_[_0x45f6('0x41')](_0x59c9b1[_0x45f6('0x40')]);_0x40aeda[_0x45f6('0x42')]=_['intersection'](_0x40aeda[_0x45f6('0x3f')],_0x40aeda[_0x45f6('0x40')]);_0x456c54[_0x45f6('0x44')]=_[_0x45f6('0x43')](_0x40aeda[_0x45f6('0x3f')],qs['fields'](_0x59c9b1[_0x45f6('0x40')][_0x45f6('0x45')]));_0x456c54['attributes']=_0x456c54[_0x45f6('0x44')][_0x45f6('0x46')]?_0x456c54[_0x45f6('0x44')]:_0x40aeda['model'];_0x456c54['order']=qs['sort'](_0x59c9b1[_0x45f6('0x40')][_0x45f6('0x48')]);_0x456c54[_0x45f6('0x49')]=qs[_0x45f6('0x42')](_[_0x45f6('0x4a')](_0x59c9b1[_0x45f6('0x40')],_0x40aeda[_0x45f6('0x42')]));if(_0x59c9b1['query'][_0x45f6('0x4b')]){_0x456c54[_0x45f6('0x49')]=_['merge'](_0x456c54[_0x45f6('0x49')],{'$or':_[_0x45f6('0x3b')](_0x456c54[_0x45f6('0x44')],function(_0x409fbe){var _0x452800={};_0x452800[_0x409fbe]={'$like':'%'+_0x59c9b1[_0x45f6('0x40')]['filter']+'%'};return _0x452800;})});}_0x456c54=_['merge']({},_0x456c54,_0x59c9b1['options']);return _0x111b5c[_0x45f6('0x8f')](_0x456c54);}})[_0x45f6('0x20')](function(_0xce4135){if(_0xce4135){_0x5f041d=_0xce4135[_0x45f6('0x46')];if(!_0x59c9b1[_0x45f6('0x40')][_0x45f6('0x60')](_0x45f6('0x61'))){_0x456c54['limit']=qs[_0x45f6('0x2f')](_0x59c9b1[_0x45f6('0x40')][_0x45f6('0x2f')]);_0x456c54[_0x45f6('0x2e')]=qs[_0x45f6('0x2e')](_0x59c9b1['query'][_0x45f6('0x2e')]);}return _0x111b5c[_0x45f6('0x8f')](_0x456c54);}})[_0x45f6('0x20')](function(_0x213bce){if(_0x213bce){return _0x213bce?{'count':_0x5f041d,'rows':_0x213bce}:null;}})[_0x45f6('0x20')](respondWithResult(_0x4b2e31,null))['catch'](handleError(_0x4b2e31,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 6b7fd14..37cf7f9 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 _0x117d=['update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatQueue','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x117d,0xac));var _0xd117=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x117d[_0x5eb22e];return _0x27fed5;};'use strict';var EventEmitter=require(_0xd117('0x0'));var ChatQueue=require(_0xd117('0x1'))['db'][_0xd117('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd117('0x3'),'afterUpdate':_0xd117('0x4'),'afterDestroy':_0xd117('0x5')};function emitEvent(_0x3c057f){return function(_0x379647,_0x5669d1,_0x3a628c){ChatQueueEvents[_0xd117('0x6')](_0x3c057f+':'+_0x379647['id'],_0x379647);ChatQueueEvents[_0xd117('0x6')](_0x3c057f,_0x379647);_0x3a628c(null);};}for(var e in events){if(events[_0xd117('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x54e5=['save','update','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x56b220,_0x3f63d6){var _0x32d387=function(_0x3aa72c){while(--_0x3aa72c){_0x56b220['push'](_0x56b220['shift']());}};_0x32d387(++_0x3f63d6);}(_0x54e5,0x145));var _0x554e=function(_0x59831f,_0x5154ca){_0x59831f=_0x59831f-0x0;var _0x11f70c=_0x54e5[_0x59831f];return _0x11f70c;};'use strict';var EventEmitter=require(_0x554e('0x0'));var ChatQueue=require(_0x554e('0x1'))['db'][_0x554e('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x554e('0x3'),'afterUpdate':_0x554e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x434b88){return function(_0x587a8e,_0x254240,_0x143630){ChatQueueEvents['emit'](_0x434b88+':'+_0x587a8e['id'],_0x587a8e);ChatQueueEvents['emit'](_0x434b88,_0x587a8e);_0x143630(null);};}for(var e in events){if(events[_0x554e('0x5')](e)){var event=events[e];ChatQueue[_0x554e('0x6')](e,emitEvent(event));}}module[_0x554e('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 786ac26..95433d5 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 _0x2f27=['bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3f6cf1,_0x142089){var _0x383c19=function(_0x4305b0){while(--_0x4305b0){_0x3f6cf1['push'](_0x3f6cf1['shift']());}};_0x383c19(++_0x142089);}(_0x2f27,0x192));var _0x72f2=function(_0xacf58b,_0x57ddc3){_0xacf58b=_0xacf58b-0x0;var _0x58d3dd=_0x2f27[_0xacf58b];return _0x58d3dd;};'use strict';var _=require(_0x72f2('0x0'));var util=require(_0x72f2('0x1'));var logger=require(_0x72f2('0x2'))(_0x72f2('0x3'));var moment=require(_0x72f2('0x4'));var BPromise=require(_0x72f2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x72f2('0x6'));var rimraf=require(_0x72f2('0x7'));var config=require(_0x72f2('0x8'));var attributes=require(_0x72f2('0x9'));module['exports']=function(_0x5e41e2,_0x3b434c){return _0x5e41e2['define']('ChatQueue',attributes,{'tableName':_0x72f2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab42=['ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','rimraf','./chatQueue.attributes','exports','define'];(function(_0x292423,_0x1759b7){var _0x2801cb=function(_0x23c821){while(--_0x23c821){_0x292423['push'](_0x292423['shift']());}};_0x2801cb(++_0x1759b7);}(_0xab42,0x183));var _0x2ab4=function(_0x5073c9,_0xe3c981){_0x5073c9=_0x5073c9-0x0;var _0x26e187=_0xab42[_0x5073c9];return _0x26e187;};'use strict';var _=require('lodash');var util=require(_0x2ab4('0x0'));var logger=require(_0x2ab4('0x1'))(_0x2ab4('0x2'));var moment=require(_0x2ab4('0x3'));var BPromise=require(_0x2ab4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2ab4('0x5'));var config=require('../../config/environment');var attributes=require(_0x2ab4('0x6'));module[_0x2ab4('0x7')]=function(_0x4b76ad,_0x236fe8){return _0x4b76ad[_0x2ab4('0x8')](_0x2ab4('0x9'),attributes,{'tableName':_0x2ab4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 6bbed6e..0f21f3f 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 _0xd193=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','attributes','limit','include','model','map','GetChatQueue','ShowChatQueue','where','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x4031e5,_0x5d9cd0){var _0x25b248=function(_0x3f0d9a){while(--_0x3f0d9a){_0x4031e5['push'](_0x4031e5['shift']());}};_0x25b248(++_0x5d9cd0);}(_0xd193,0x119));var _0x3d19=function(_0x10906d,_0x4f2405){_0x10906d=_0x10906d-0x0;var _0x27a475=_0xd193[_0x10906d];return _0x27a475;};'use strict';var _=require(_0x3d19('0x0'));var util=require(_0x3d19('0x1'));var moment=require(_0x3d19('0x2'));var BPromise=require(_0x3d19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d19('0x4'))['db'];var utils=require(_0x3d19('0x5'));var logger=require(_0x3d19('0x6'))(_0x3d19('0x7'));var config=require('../../config/environment');var jayson=require(_0x3d19('0x8'));var client=jayson[_0x3d19('0x9')][_0x3d19('0xa')]({'port':0x232a});config[_0x3d19('0xb')]=_[_0x3d19('0xc')](config[_0x3d19('0xb')],{'host':_0x3d19('0xd'),'port':0x18eb});var socket=require(_0x3d19('0xe'))(new Redis(config[_0x3d19('0xb')]));require(_0x3d19('0xf'))['register'](socket);function respondWithRpcPromise(_0x3da59c,_0x59a7e1,_0x41e93f){return new BPromise(function(_0x1a7313,_0x18ce15){return client[_0x3d19('0x10')](_0x3da59c,_0x41e93f)[_0x3d19('0x11')](function(_0x5543a0){logger[_0x3d19('0x12')](_0x3d19('0x13'),_0x59a7e1,'request\x20sent');logger[_0x3d19('0x14')](_0x3d19('0x15'),_0x59a7e1,_0x3d19('0x16'),JSON[_0x3d19('0x17')](_0x5543a0));if(_0x5543a0[_0x3d19('0x18')]){if(_0x5543a0[_0x3d19('0x18')][_0x3d19('0x19')]===0x1f4){logger[_0x3d19('0x18')](_0x3d19('0x13'),_0x59a7e1,_0x5543a0[_0x3d19('0x18')]['message']);return _0x18ce15(_0x5543a0[_0x3d19('0x18')][_0x3d19('0x1a')]);}logger[_0x3d19('0x18')](_0x3d19('0x13'),_0x59a7e1,_0x5543a0[_0x3d19('0x18')][_0x3d19('0x1a')]);return _0x1a7313(_0x5543a0[_0x3d19('0x18')]['message']);}else{logger[_0x3d19('0x12')](_0x3d19('0x13'),_0x59a7e1,'request\x20sent');_0x1a7313(_0x5543a0[_0x3d19('0x1b')][_0x3d19('0x1a')]);}})[_0x3d19('0x1c')](function(_0x15b379){logger['error'](_0x3d19('0x13'),_0x59a7e1,_0x15b379);_0x18ce15(_0x15b379);});});}exports['GetChatQueue']=function(_0x41812e){var _0x1c1ada=this;return new Promise(function(_0x2232ce,_0x32f2f7){return db[_0x3d19('0x1d')][_0x3d19('0x1e')]({'raw':_0x41812e[_0x3d19('0x1f')]?_0x41812e['options'][_0x3d19('0x20')]===undefined?!![]:![]:!![],'where':_0x41812e[_0x3d19('0x1f')]?_0x41812e[_0x3d19('0x1f')]['where']||null:null,'attributes':_0x41812e[_0x3d19('0x1f')]?_0x41812e[_0x3d19('0x1f')][_0x3d19('0x21')]||null:null,'limit':_0x41812e[_0x3d19('0x1f')]?_0x41812e[_0x3d19('0x1f')][_0x3d19('0x22')]||null:null,'include':_0x41812e['options']?_0x41812e[_0x3d19('0x1f')][_0x3d19('0x23')]?_['map'](_0x41812e[_0x3d19('0x1f')][_0x3d19('0x23')],function(_0xb2b9d7){return{'model':db[_0xb2b9d7[_0x3d19('0x24')]],'as':_0xb2b9d7['as'],'attributes':_0xb2b9d7[_0x3d19('0x21')],'include':_0xb2b9d7[_0x3d19('0x23')]?_[_0x3d19('0x25')](_0xb2b9d7[_0x3d19('0x23')],function(_0x2b8fbc){return{'model':db[_0x2b8fbc[_0x3d19('0x24')]],'as':_0x2b8fbc['as'],'attributes':_0x2b8fbc['attributes'],'include':_0x2b8fbc[_0x3d19('0x23')]?_[_0x3d19('0x25')](_0x2b8fbc['include'],function(_0x41736a){return{'model':db[_0x41736a[_0x3d19('0x24')]],'as':_0x41736a['as'],'attributes':_0x41736a[_0x3d19('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3d19('0x11')](function(_0x14791b){logger[_0x3d19('0x12')](_0x3d19('0x26'),_0x41812e);logger[_0x3d19('0x14')](_0x3d19('0x26'),_0x41812e,JSON[_0x3d19('0x17')](_0x14791b));_0x2232ce(_0x14791b);})[_0x3d19('0x1c')](function(_0x1abd12){logger[_0x3d19('0x18')](_0x3d19('0x26'),_0x1abd12[_0x3d19('0x1a')],_0x41812e);_0x32f2f7(_0x1c1ada[_0x3d19('0x18')](0x1f4,_0x1abd12[_0x3d19('0x1a')]));});});};exports[_0x3d19('0x27')]=function(_0x5a0baa){var _0x19b516=this;return new Promise(function(_0x35c027,_0x582c08){return db[_0x3d19('0x1d')]['find']({'raw':_0x5a0baa[_0x3d19('0x1f')]?_0x5a0baa['options'][_0x3d19('0x20')]===undefined?!![]:![]:!![],'where':_0x5a0baa[_0x3d19('0x1f')]?_0x5a0baa[_0x3d19('0x1f')][_0x3d19('0x28')]||null:null,'attributes':_0x5a0baa['options']?_0x5a0baa[_0x3d19('0x1f')][_0x3d19('0x21')]||null:null,'include':_0x5a0baa[_0x3d19('0x1f')]?_0x5a0baa[_0x3d19('0x1f')][_0x3d19('0x23')]?_[_0x3d19('0x25')](_0x5a0baa[_0x3d19('0x1f')][_0x3d19('0x23')],function(_0x9465ab){return{'model':db[_0x9465ab[_0x3d19('0x24')]],'as':_0x9465ab['as'],'attributes':_0x9465ab[_0x3d19('0x21')],'include':_0x9465ab[_0x3d19('0x23')]?_[_0x3d19('0x25')](_0x9465ab[_0x3d19('0x23')],function(_0x48c73a){return{'model':db[_0x48c73a['model']],'as':_0x48c73a['as'],'attributes':_0x48c73a[_0x3d19('0x21')],'include':_0x48c73a['include']?_[_0x3d19('0x25')](_0x48c73a['include'],function(_0x25958c){return{'model':db[_0x25958c[_0x3d19('0x24')]],'as':_0x25958c['as'],'attributes':_0x25958c[_0x3d19('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ccd5f){logger[_0x3d19('0x12')](_0x3d19('0x27'),_0x5a0baa);logger[_0x3d19('0x14')]('ShowChatQueue',_0x5a0baa,JSON[_0x3d19('0x17')](_0x3ccd5f));_0x35c027(_0x3ccd5f);})[_0x3d19('0x1c')](function(_0x2b0b42){logger[_0x3d19('0x18')](_0x3d19('0x27'),_0x2b0b42[_0x3d19('0x1a')],_0x5a0baa);_0x582c08(_0x19b516[_0x3d19('0x18')](0x1f4,_0x2b0b42['message']));});});}; \ No newline at end of file +var _0xa212=['attributes','limit','map','include','model','then','ShowChatQueue','find','lodash','util','moment','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw'];(function(_0x48794b,_0x263f18){var _0x26ffeb=function(_0x7d4660){while(--_0x7d4660){_0x48794b['push'](_0x48794b['shift']());}};_0x26ffeb(++_0x263f18);}(_0xa212,0xec));var _0x2a21=function(_0x56782b,_0x571079){_0x56782b=_0x56782b-0x0;var _0xcc177=_0xa212[_0x56782b];return _0xcc177;};'use strict';var _=require(_0x2a21('0x0'));var util=require(_0x2a21('0x1'));var moment=require(_0x2a21('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a21('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a21('0x4'));var config=require(_0x2a21('0x5'));var jayson=require(_0x2a21('0x6'));var client=jayson[_0x2a21('0x7')][_0x2a21('0x8')]({'port':0x232a});config['redis']=_[_0x2a21('0x9')](config[_0x2a21('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a21('0xa')]));require(_0x2a21('0xb'))[_0x2a21('0xc')](socket);function respondWithRpcPromise(_0x4ccd7f,_0x1cb5d3,_0x44d6ed){return new BPromise(function(_0x3b6858,_0x222ab1){return client[_0x2a21('0xd')](_0x4ccd7f,_0x44d6ed)['then'](function(_0x1ced22){logger[_0x2a21('0xe')](_0x2a21('0xf'),_0x1cb5d3,_0x2a21('0x10'));logger[_0x2a21('0x11')](_0x2a21('0x12'),_0x1cb5d3,_0x2a21('0x10'),JSON[_0x2a21('0x13')](_0x1ced22));if(_0x1ced22['error']){if(_0x1ced22[_0x2a21('0x14')][_0x2a21('0x15')]===0x1f4){logger[_0x2a21('0x14')](_0x2a21('0xf'),_0x1cb5d3,_0x1ced22[_0x2a21('0x14')][_0x2a21('0x16')]);return _0x222ab1(_0x1ced22[_0x2a21('0x14')][_0x2a21('0x16')]);}logger[_0x2a21('0x14')](_0x2a21('0xf'),_0x1cb5d3,_0x1ced22[_0x2a21('0x14')][_0x2a21('0x16')]);return _0x3b6858(_0x1ced22['error'][_0x2a21('0x16')]);}else{logger[_0x2a21('0xe')](_0x2a21('0xf'),_0x1cb5d3,_0x2a21('0x10'));_0x3b6858(_0x1ced22[_0x2a21('0x17')][_0x2a21('0x16')]);}})[_0x2a21('0x18')](function(_0x3af061){logger[_0x2a21('0x14')](_0x2a21('0xf'),_0x1cb5d3,_0x3af061);_0x222ab1(_0x3af061);});});}exports[_0x2a21('0x19')]=function(_0x403e2c){var _0x11f2ce=this;return new Promise(function(_0x2e6d08,_0x470093){return db[_0x2a21('0x1a')][_0x2a21('0x1b')]({'raw':_0x403e2c[_0x2a21('0x1c')]?_0x403e2c[_0x2a21('0x1c')][_0x2a21('0x1d')]===undefined?!![]:![]:!![],'where':_0x403e2c[_0x2a21('0x1c')]?_0x403e2c['options']['where']||null:null,'attributes':_0x403e2c['options']?_0x403e2c[_0x2a21('0x1c')][_0x2a21('0x1e')]||null:null,'limit':_0x403e2c[_0x2a21('0x1c')]?_0x403e2c[_0x2a21('0x1c')][_0x2a21('0x1f')]||null:null,'include':_0x403e2c[_0x2a21('0x1c')]?_0x403e2c[_0x2a21('0x1c')]['include']?_[_0x2a21('0x20')](_0x403e2c[_0x2a21('0x1c')][_0x2a21('0x21')],function(_0x336738){return{'model':db[_0x336738['model']],'as':_0x336738['as'],'attributes':_0x336738[_0x2a21('0x1e')],'include':_0x336738[_0x2a21('0x21')]?_[_0x2a21('0x20')](_0x336738['include'],function(_0x3d7238){return{'model':db[_0x3d7238[_0x2a21('0x22')]],'as':_0x3d7238['as'],'attributes':_0x3d7238[_0x2a21('0x1e')],'include':_0x3d7238[_0x2a21('0x21')]?_[_0x2a21('0x20')](_0x3d7238[_0x2a21('0x21')],function(_0x570f65){return{'model':db[_0x570f65[_0x2a21('0x22')]],'as':_0x570f65['as'],'attributes':_0x570f65[_0x2a21('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2a21('0x23')](function(_0xe61e76){logger[_0x2a21('0xe')](_0x2a21('0x19'),_0x403e2c);logger[_0x2a21('0x11')](_0x2a21('0x19'),_0x403e2c,JSON[_0x2a21('0x13')](_0xe61e76));_0x2e6d08(_0xe61e76);})['catch'](function(_0x5112e6){logger[_0x2a21('0x14')](_0x2a21('0x19'),_0x5112e6[_0x2a21('0x16')],_0x403e2c);_0x470093(_0x11f2ce[_0x2a21('0x14')](0x1f4,_0x5112e6[_0x2a21('0x16')]));});});};exports[_0x2a21('0x24')]=function(_0x33b412){var _0x38be0a=this;return new Promise(function(_0x5b72f3,_0x304479){return db[_0x2a21('0x1a')][_0x2a21('0x25')]({'raw':_0x33b412[_0x2a21('0x1c')]?_0x33b412[_0x2a21('0x1c')][_0x2a21('0x1d')]===undefined?!![]:![]:!![],'where':_0x33b412['options']?_0x33b412['options']['where']||null:null,'attributes':_0x33b412[_0x2a21('0x1c')]?_0x33b412['options'][_0x2a21('0x1e')]||null:null,'include':_0x33b412[_0x2a21('0x1c')]?_0x33b412['options']['include']?_[_0x2a21('0x20')](_0x33b412['options']['include'],function(_0x2b0e0f){return{'model':db[_0x2b0e0f[_0x2a21('0x22')]],'as':_0x2b0e0f['as'],'attributes':_0x2b0e0f['attributes'],'include':_0x2b0e0f['include']?_['map'](_0x2b0e0f[_0x2a21('0x21')],function(_0x40455e){return{'model':db[_0x40455e[_0x2a21('0x22')]],'as':_0x40455e['as'],'attributes':_0x40455e['attributes'],'include':_0x40455e[_0x2a21('0x21')]?_[_0x2a21('0x20')](_0x40455e[_0x2a21('0x21')],function(_0x5747be){return{'model':db[_0x5747be[_0x2a21('0x22')]],'as':_0x5747be['as'],'attributes':_0x5747be[_0x2a21('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2a21('0x23')](function(_0x5393a3){logger[_0x2a21('0xe')](_0x2a21('0x24'),_0x33b412);logger[_0x2a21('0x11')](_0x2a21('0x24'),_0x33b412,JSON[_0x2a21('0x13')](_0x5393a3));_0x5b72f3(_0x5393a3);})[_0x2a21('0x18')](function(_0x4f29e3){logger[_0x2a21('0x14')](_0x2a21('0x24'),_0x4f29e3['message'],_0x33b412);_0x304479(_0x38be0a['error'](0x1f4,_0x4f29e3[_0x2a21('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 617e7da..099bc31 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 _0x8d0e=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0xd7f8f7,_0x42785e){var _0x34b92c=function(_0x4833c9){while(--_0x4833c9){_0xd7f8f7['push'](_0xd7f8f7['shift']());}};_0x34b92c(++_0x42785e);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x57e4ca,_0x40e237){_0x57e4ca=_0x57e4ca-0x0;var _0x2084db=_0x8d0e[_0x57e4ca];return _0x2084db;};'use strict';var ChatQueueEvents=require(_0xe8d0('0x0'));var events=[_0xe8d0('0x1'),_0xe8d0('0x2'),_0xe8d0('0x3')];function createListener(_0x2eae0c,_0x3584ab){return function(_0x15521e){_0x3584ab[_0xe8d0('0x4')](_0x2eae0c,_0x15521e);};}function removeListener(_0x32cee9,_0x579cb9){return function(){ChatQueueEvents[_0xe8d0('0x5')](_0x32cee9,_0x579cb9);};}exports['register']=function(_0x560dab){for(var _0x2e2985=0x0,_0x92483d=events[_0xe8d0('0x6')];_0x2e2985<_0x92483d;_0x2e2985++){var _0xcc03d0=events[_0x2e2985];var _0x2b6dce=createListener(_0xe8d0('0x7')+_0xcc03d0,_0x560dab);ChatQueueEvents['on'](_0xcc03d0,_0x2b6dce);}}; \ No newline at end of file +var _0x0c02=['save','remove','emit','removeListener','register','chatQueue:'];(function(_0x169f86,_0xadf81f){var _0x30cced=function(_0x84611b){while(--_0x84611b){_0x169f86['push'](_0x169f86['shift']());}};_0x30cced(++_0xadf81f);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x20c0('0x0'),_0x20c0('0x1'),'update'];function createListener(_0x1338cf,_0x5c8750){return function(_0x454922){_0x5c8750[_0x20c0('0x2')](_0x1338cf,_0x454922);};}function removeListener(_0x38022e,_0x2e9d65){return function(){ChatQueueEvents[_0x20c0('0x3')](_0x38022e,_0x2e9d65);};}exports[_0x20c0('0x4')]=function(_0x13312d){for(var _0xd25ee8=0x0,_0x5d6408=events['length'];_0xd25ee8<_0x5d6408;_0xd25ee8++){var _0x5da127=events[_0xd25ee8];var _0x4db532=createListener(_0x20c0('0x5')+_0x5da127,_0x13312d);ChatQueueEvents['on'](_0x5da127,_0x4db532);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 741d34c..d9bf04c 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x50993d,_0xdb0f36){var _0x5f3d4a=function(_0x3e5025){while(--_0x3e5025){_0x50993d['push'](_0x50993d['shift']());}};_0x5f3d4a(++_0xdb0f36);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +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(_0xae11a3,_0x93a629){var _0x481f5f=function(_0x46a4b3){while(--_0x46a4b3){_0xae11a3['push'](_0xae11a3['shift']());}};_0x481f5f(++_0x93a629);}(_0xe14b,0x93));var _0xbe14=function(_0x4a9a9b,_0x21fa9f){_0x4a9a9b=_0x4a9a9b-0x0;var _0x33c8d4=_0xe14b[_0x4a9a9b];return _0x33c8d4;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 3b643c8..18f92e8 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 _0xabfb=['exports','STRING','DATE','moment'];(function(_0x1994d0,_0x542633){var _0x1832cd=function(_0x28bc35){while(--_0x28bc35){_0x1994d0['push'](_0x1994d0['shift']());}};_0x1832cd(++_0x542633);}(_0xabfb,0x177));var _0xbabf=function(_0x4a599b,_0x1d2125){_0x4a599b=_0x4a599b-0x0;var _0x2d53d3=_0xabfb[_0x4a599b];return _0x2d53d3;};'use strict';var moment=require(_0xbabf('0x0'));var Sequelize=require('sequelize');module[_0xbabf('0x1')]={'uniqueid':{'type':Sequelize[_0xbabf('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbabf('0x2')]},'joinAt':{'type':Sequelize[_0xbabf('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbabf('0x3')]},'exitAt':{'type':Sequelize[_0xbabf('0x3')]},'reason':{'type':Sequelize[_0xbabf('0x2')]}}; \ No newline at end of file +var _0xef6d=['sequelize','exports','STRING','DATE'];(function(_0x3a7aa8,_0xcf6f10){var _0x32a6ff=function(_0x2ce831){while(--_0x2ce831){_0x3a7aa8['push'](_0x3a7aa8['shift']());}};_0x32a6ff(++_0xcf6f10);}(_0xef6d,0x12c));var _0xdef6=function(_0x49bee0,_0x4f1aaf){_0x49bee0=_0x49bee0-0x0;var _0x411764=_0xef6d[_0x49bee0];return _0x411764;};'use strict';var moment=require('moment');var Sequelize=require(_0xdef6('0x0'));module[_0xdef6('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdef6('0x2')]},'joinAt':{'type':Sequelize[_0xdef6('0x3')]},'leaveAt':{'type':Sequelize[_0xdef6('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xdef6('0x3')]},'reason':{'type':Sequelize[_0xdef6('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index b0cdc7c..9dc806b 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 _0x7c09=['map','ChatQueueReport','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','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','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'];(function(_0x41c551,_0x544082){var _0x35d26b=function(_0x262254){while(--_0x262254){_0x41c551['push'](_0x41c551['shift']());}};_0x35d26b(++_0x544082);}(_0x7c09,0x102));var _0x97c0=function(_0x3b33a2,_0x552461){_0x3b33a2=_0x3b33a2-0x0;var _0x42952c=_0x7c09[_0x3b33a2];return _0x42952c;};'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['ChatQueueReport'][_0x97c0('0x48')](_0x276c98[_0x97c0('0x49')],{})[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,0xc9))['catch'](handleError(_0x4ff0a5,null));};exports[_0x97c0('0x23')]=function(_0xac56ac,_0x240f68){if(_0xac56ac[_0x97c0('0x49')]['id']){delete _0xac56ac[_0x97c0('0x49')]['id'];}return db['ChatQueueReport'][_0x97c0('0x47')]({'where':{'id':_0xac56ac[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x240f68,null))['then'](saveUpdates(_0xac56ac['body'],null))[_0x97c0('0x24')](respondWithResult(_0x240f68,null))['catch'](handleError(_0x240f68,null));};exports['destroy']=function(_0x473b63,_0x20e2a5){return db[_0x97c0('0x2b')]['find']({'where':{'id':_0x473b63['params']['id']}})['then'](handleEntityNotFound(_0x20e2a5,null))[_0x97c0('0x24')](removeEntity(_0x20e2a5,null))[_0x97c0('0x43')](handleError(_0x20e2a5,null));};exports[_0x97c0('0x4a')]=function(_0xdb2767,_0x397065){return db[_0x97c0('0x2b')][_0x97c0('0x4a')]()['then'](respondWithResult(_0x397065,null))[_0x97c0('0x43')](handleError(_0x397065,null));}; \ No newline at end of file +var _0xbd0a=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','describe','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset'];(function(_0x3200e9,_0x318b57){var _0x7d108d=function(_0x39de50){while(--_0x39de50){_0x3200e9['push'](_0x3200e9['shift']());}};_0x7d108d(++_0x318b57);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x5938fe,_0x2a2748){_0x5938fe=_0x5938fe-0x0;var _0x4de17f=_0xbd0a[_0x5938fe];return _0x4de17f;};'use strict';var emlformat=require(_0xabd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabd0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xabd0('0x2'));var Mustache=require(_0xabd0('0x3'));var util=require(_0xabd0('0x4'));var path=require(_0xabd0('0x5'));var sox=require(_0xabd0('0x6'));var csv=require(_0xabd0('0x7'));var ejs=require(_0xabd0('0x8'));var fs=require('fs');var fs_extra=require(_0xabd0('0x9'));var _=require(_0xabd0('0xa'));var squel=require('squel');var crypto=require(_0xabd0('0xb'));var jsforce=require(_0xabd0('0xc'));var deskjs=require(_0xabd0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xabd0('0xe'));var Papa=require('papaparse');var Redis=require(_0xabd0('0xf'));var authService=require(_0xabd0('0x10'));var qs=require(_0xabd0('0x11'));var as=require(_0xabd0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabd0('0x13'))('api');var utils=require(_0xabd0('0x14'));var config=require(_0xabd0('0x15'));var licenseUtil=require(_0xabd0('0x16'));var db=require(_0xabd0('0x17'))['db'];function respondWithStatusCode(_0x3bf33,_0xd66d68){_0xd66d68=_0xd66d68||0xcc;return function(_0x5b0f34){if(_0x5b0f34){return _0x3bf33[_0xabd0('0x18')](_0xd66d68);}return _0x3bf33['status'](_0xd66d68)[_0xabd0('0x19')]();};}function respondWithResult(_0x145f76,_0x5ceb94){_0x5ceb94=_0x5ceb94||0xc8;return function(_0x56ba31){if(_0x56ba31){return _0x145f76['status'](_0x5ceb94)['json'](_0x56ba31);}};}function respondWithFilteredResult(_0x679d0b,_0x26d8fd){return function(_0x97f4ec){if(_0x97f4ec){var _0xdb7a40=typeof _0x26d8fd[_0xabd0('0x1a')]===_0xabd0('0x1b')&&typeof _0x26d8fd[_0xabd0('0x1c')]===_0xabd0('0x1b');var _0x2d17b1=_0x97f4ec['count'];var _0x3a0ace=_0xdb7a40?0x0:_0x26d8fd['offset'];var _0x579dcd=_0xdb7a40?_0x97f4ec[_0xabd0('0x1d')]:_0x26d8fd[_0xabd0('0x1a')]+_0x26d8fd[_0xabd0('0x1c')];var _0x23f955;if(_0x579dcd>=_0x2d17b1){_0x579dcd=_0x2d17b1;_0x23f955=0xc8;}else{_0x23f955=0xce;}_0x679d0b['status'](_0x23f955);return _0x679d0b[_0xabd0('0x1e')](_0xabd0('0x1f'),_0x3a0ace+'-'+_0x579dcd+'/'+_0x2d17b1)['json'](_0x97f4ec);}return null;};}function patchUpdates(_0x56c2f5){return function(_0x1c955e){try{jsonpatch[_0xabd0('0x20')](_0x1c955e,_0x56c2f5,!![]);}catch(_0x4d9416){return BPromise[_0xabd0('0x21')](_0x4d9416);}return _0x1c955e[_0xabd0('0x22')]();};}function saveUpdates(_0xa1ebf,_0x1e077e){return function(_0x4c9f3a){if(_0x4c9f3a){return _0x4c9f3a[_0xabd0('0x23')](_0xa1ebf)[_0xabd0('0x24')](function(_0x3376bc){return _0x3376bc;});}return null;};}function removeEntity(_0x462420,_0x264167){return function(_0xf6dbad){if(_0xf6dbad){return _0xf6dbad[_0xabd0('0x25')]()[_0xabd0('0x24')](function(){_0x462420[_0xabd0('0x26')](0xcc)[_0xabd0('0x19')]();});}};}function handleEntityNotFound(_0x52c8be,_0x369dd0){return function(_0x2699c4){if(!_0x2699c4){_0x52c8be[_0xabd0('0x18')](0x194);}return _0x2699c4;};}function handleError(_0x3e0dd2,_0x31b869){_0x31b869=_0x31b869||0x1f4;return function(_0x399996){logger[_0xabd0('0x27')](_0x399996[_0xabd0('0x28')]);if(_0x399996[_0xabd0('0x29')]){delete _0x399996[_0xabd0('0x29')];}_0x3e0dd2[_0xabd0('0x26')](_0x31b869)[_0xabd0('0x2a')](_0x399996);};}exports[_0xabd0('0x2b')]=function(_0x3246de,_0x1fe955){var _0x15096f={},_0x5427a0={},_0x1c0d90={'count':0x0,'rows':[]};var _0x2d4c55=_[_0xabd0('0x2c')](db[_0xabd0('0x2d')]['rawAttributes'],function(_0x1ef94b){return{'name':_0x1ef94b[_0xabd0('0x2e')],'type':_0x1ef94b[_0xabd0('0x2f')]['key']};});_0x5427a0[_0xabd0('0x30')]=_[_0xabd0('0x2c')](_0x2d4c55,'name');_0x5427a0[_0xabd0('0x31')]=_['keys'](_0x3246de[_0xabd0('0x31')]);_0x5427a0[_0xabd0('0x32')]=_[_0xabd0('0x33')](_0x5427a0[_0xabd0('0x30')],_0x5427a0[_0xabd0('0x31')]);_0x15096f[_0xabd0('0x34')]=_['intersection'](_0x5427a0[_0xabd0('0x30')],qs[_0xabd0('0x35')](_0x3246de[_0xabd0('0x31')][_0xabd0('0x35')]));_0x15096f[_0xabd0('0x34')]=_0x15096f[_0xabd0('0x34')][_0xabd0('0x36')]?_0x15096f[_0xabd0('0x34')]:_0x5427a0[_0xabd0('0x30')];if(!_0x3246de[_0xabd0('0x31')][_0xabd0('0x37')](_0xabd0('0x38'))){_0x15096f[_0xabd0('0x1c')]=qs[_0xabd0('0x1c')](_0x3246de[_0xabd0('0x31')]['limit']);_0x15096f['offset']=qs['offset'](_0x3246de[_0xabd0('0x31')][_0xabd0('0x1a')]);}_0x15096f[_0xabd0('0x39')]=qs[_0xabd0('0x3a')](_0x3246de[_0xabd0('0x31')]['sort']);_0x15096f['where']=qs['filters'](_[_0xabd0('0x3b')](_0x3246de['query'],_0x5427a0[_0xabd0('0x32')]),_0x2d4c55);if(_0x3246de[_0xabd0('0x31')][_0xabd0('0x3c')]){_0x15096f[_0xabd0('0x3d')]=_[_0xabd0('0x3e')](_0x15096f[_0xabd0('0x3d')],{'$or':_[_0xabd0('0x2c')](_0x2d4c55,function(_0x42e86e){if(_0x42e86e['type']!==_0xabd0('0x3f')){var _0x592de0={};_0x592de0[_0x42e86e['name']]={'$like':'%'+_0x3246de[_0xabd0('0x31')][_0xabd0('0x3c')]+'%'};return _0x592de0;}})});}_0x15096f=_[_0xabd0('0x3e')]({},_0x15096f,_0x3246de[_0xabd0('0x40')]);var _0x1b8687={'where':_0x15096f['where']};return db[_0xabd0('0x2d')][_0xabd0('0x1d')](_0x1b8687)[_0xabd0('0x24')](function(_0x2e0bdf){_0x1c0d90['count']=_0x2e0bdf;if(_0x3246de[_0xabd0('0x31')][_0xabd0('0x41')]){_0x15096f[_0xabd0('0x42')]=[{'all':!![]}];}return db[_0xabd0('0x2d')][_0xabd0('0x43')](_0x15096f);})[_0xabd0('0x24')](function(_0x2aa5a9){_0x1c0d90[_0xabd0('0x44')]=_0x2aa5a9;return _0x1c0d90;})[_0xabd0('0x24')](respondWithFilteredResult(_0x1fe955,_0x15096f))[_0xabd0('0x45')](handleError(_0x1fe955,null));};exports[_0xabd0('0x46')]=function(_0x975bbe,_0x237a33){var _0x514ea3={'raw':!![],'where':{'id':_0x975bbe[_0xabd0('0x47')]['id']}},_0x2ba135={};_0x2ba135[_0xabd0('0x30')]=_['keys'](db['ChatQueueReport'][_0xabd0('0x48')]);_0x2ba135[_0xabd0('0x31')]=_[_0xabd0('0x49')](_0x975bbe[_0xabd0('0x31')]);_0x2ba135[_0xabd0('0x32')]=_['intersection'](_0x2ba135['model'],_0x2ba135[_0xabd0('0x31')]);_0x514ea3[_0xabd0('0x34')]=_[_0xabd0('0x33')](_0x2ba135[_0xabd0('0x30')],qs[_0xabd0('0x35')](_0x975bbe['query'][_0xabd0('0x35')]));_0x514ea3[_0xabd0('0x34')]=_0x514ea3[_0xabd0('0x34')]['length']?_0x514ea3[_0xabd0('0x34')]:_0x2ba135[_0xabd0('0x30')];if(_0x975bbe[_0xabd0('0x31')][_0xabd0('0x41')]){_0x514ea3['include']=[{'all':!![]}];}_0x514ea3=_[_0xabd0('0x3e')]({},_0x514ea3,_0x975bbe[_0xabd0('0x40')]);return db[_0xabd0('0x2d')][_0xabd0('0x4a')](_0x514ea3)['then'](handleEntityNotFound(_0x237a33,null))[_0xabd0('0x24')](respondWithResult(_0x237a33,null))[_0xabd0('0x45')](handleError(_0x237a33,null));};exports[_0xabd0('0x4b')]=function(_0xc80459,_0x2a1069){return db[_0xabd0('0x2d')]['create'](_0xc80459['body'],{})[_0xabd0('0x24')](respondWithResult(_0x2a1069,0xc9))['catch'](handleError(_0x2a1069,null));};exports['update']=function(_0x2293bd,_0x1610d9){if(_0x2293bd[_0xabd0('0x4c')]['id']){delete _0x2293bd[_0xabd0('0x4c')]['id'];}return db['ChatQueueReport'][_0xabd0('0x4a')]({'where':{'id':_0x2293bd[_0xabd0('0x47')]['id']}})[_0xabd0('0x24')](handleEntityNotFound(_0x1610d9,null))[_0xabd0('0x24')](saveUpdates(_0x2293bd['body'],null))['then'](respondWithResult(_0x1610d9,null))[_0xabd0('0x45')](handleError(_0x1610d9,null));};exports[_0xabd0('0x25')]=function(_0x16dd64,_0x32a5c9){return db[_0xabd0('0x2d')][_0xabd0('0x4a')]({'where':{'id':_0x16dd64[_0xabd0('0x47')]['id']}})[_0xabd0('0x24')](handleEntityNotFound(_0x32a5c9,null))[_0xabd0('0x24')](removeEntity(_0x32a5c9,null))['catch'](handleError(_0x32a5c9,null));};exports[_0xabd0('0x4d')]=function(_0x284ea4,_0x4e951f){return db[_0xabd0('0x2d')][_0xabd0('0x4d')]()[_0xabd0('0x24')](respondWithResult(_0x4e951f,null))[_0xabd0('0x45')](handleError(_0x4e951f,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index d2341ac..656e521 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x189036,_0x23ba9e){var _0x5a1428=function(_0x2dd4ac){while(--_0x2dd4ac){_0x189036['push'](_0x189036['shift']());}};_0x5a1428(++_0x23ba9e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'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 +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x59aaf4,_0x3d8cfb){var _0x3d0d14=function(_0x51dbb4){while(--_0x51dbb4){_0x59aaf4['push'](_0x59aaf4['shift']());}};_0x3d0d14(++_0x3d8cfb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var 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 aacb7eb..98942a0 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 _0x2539=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','info','where','limit','UpdateChatQueueReport','moment'];(function(_0x459a0a,_0x25c46f){var _0x4ab46c=function(_0x451a6a){while(--_0x451a6a){_0x459a0a['push'](_0x459a0a['shift']());}};_0x4ab46c(++_0x25c46f);}(_0x2539,0x9a));var _0x9253=function(_0x22c7b4,_0x5f4aaa){_0x22c7b4=_0x22c7b4-0x0;var _0x2aed72=_0x2539[_0x22c7b4];return _0x2aed72;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9253('0x0'));var BPromise=require(_0x9253('0x1'));var rs=require(_0x9253('0x2'));var fs=require('fs');var Redis=require(_0x9253('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9253('0x4'));var logger=require(_0x9253('0x5'))(_0x9253('0x6'));var config=require(_0x9253('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9253('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc1dd63,_0x24dd51,_0x320195){return new BPromise(function(_0x5cb36a,_0x3506a6){return client[_0x9253('0x9')](_0xc1dd63,_0x320195)[_0x9253('0xa')](function(_0x472c9a){logger['info'](_0x9253('0xb'),_0x24dd51,_0x9253('0xc'));logger[_0x9253('0xd')](_0x9253('0xe'),_0x24dd51,_0x9253('0xc'),JSON[_0x9253('0xf')](_0x472c9a));if(_0x472c9a['error']){if(_0x472c9a[_0x9253('0x10')][_0x9253('0x11')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x24dd51,_0x472c9a['error']['message']);return _0x3506a6(_0x472c9a[_0x9253('0x10')][_0x9253('0x12')]);}logger[_0x9253('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x24dd51,_0x472c9a['error'][_0x9253('0x12')]);return _0x5cb36a(_0x472c9a['error'][_0x9253('0x12')]);}else{logger['info'](_0x9253('0xb'),_0x24dd51,_0x9253('0xc'));_0x5cb36a(_0x472c9a[_0x9253('0x13')][_0x9253('0x12')]);}})[_0x9253('0x14')](function(_0x5b53dc){logger[_0x9253('0x10')](_0x9253('0xb'),_0x24dd51,_0x5b53dc);_0x3506a6(_0x5b53dc);});});}exports[_0x9253('0x15')]=function(_0x1e68c1){var _0x5cbede=this;return new Promise(function(_0x726604,_0x52c1e0){return db[_0x9253('0x16')][_0x9253('0x17')](_0x1e68c1[_0x9253('0x18')],{'raw':_0x1e68c1['options']?_0x1e68c1[_0x9253('0x19')][_0x9253('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x319ac9){logger[_0x9253('0x1b')](_0x9253('0x15'),_0x1e68c1);logger['debug']('CreateChatQueueReport',_0x1e68c1,JSON[_0x9253('0xf')](_0x319ac9));_0x726604(_0x319ac9);})[_0x9253('0x14')](function(_0x6578ff){logger[_0x9253('0x10')](_0x9253('0x15'),_0x6578ff[_0x9253('0x12')],_0x1e68c1);_0x52c1e0(_0x5cbede[_0x9253('0x10')](0x1f4,_0x6578ff['message']));});});};exports['UpdateChatQueueReport']=function(_0x420e92){var _0x5e422e=this;return new Promise(function(_0x56e336,_0x32a8f7){return db[_0x9253('0x16')]['update'](_0x420e92['body'],{'raw':_0x420e92[_0x9253('0x19')]?_0x420e92['options'][_0x9253('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x420e92[_0x9253('0x19')]?_0x420e92[_0x9253('0x19')][_0x9253('0x1c')]||null:null,'attributes':_0x420e92[_0x9253('0x19')]?_0x420e92[_0x9253('0x19')]['attributes']||null:null,'limit':_0x420e92['options']?_0x420e92[_0x9253('0x19')][_0x9253('0x1d')]||null:null})[_0x9253('0xa')](function(_0x45045e){logger['info'](_0x9253('0x1e'),_0x420e92);logger[_0x9253('0xd')](_0x9253('0x1e'),_0x420e92,JSON['stringify'](_0x45045e));_0x56e336(_0x45045e);})[_0x9253('0x14')](function(_0x4dab6c){logger[_0x9253('0x10')]('UpdateChatQueueReport',_0x4dab6c[_0x9253('0x12')],_0x420e92);_0x32a8f7(_0x5e422e[_0x9253('0x10')](0x1f4,_0x4dab6c[_0x9253('0x12')]));});});}; \ No newline at end of file +var _0x7fa6=['raw','catch','UpdateChatQueueReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','CreateChatQueueReport','create','body','options'];(function(_0x29405a,_0x38a2cf){var _0x46e4ed=function(_0x3d1f2b){while(--_0x3d1f2b){_0x29405a['push'](_0x29405a['shift']());}};_0x46e4ed(++_0x38a2cf);}(_0x7fa6,0xed));var _0x67fa=function(_0x31c2ea,_0x4727b7){_0x31c2ea=_0x31c2ea-0x0;var _0x46ee30=_0x7fa6[_0x31c2ea];return _0x46ee30;};'use strict';var _=require(_0x67fa('0x0'));var util=require(_0x67fa('0x1'));var moment=require(_0x67fa('0x2'));var BPromise=require(_0x67fa('0x3'));var rs=require(_0x67fa('0x4'));var fs=require('fs');var Redis=require(_0x67fa('0x5'));var db=require(_0x67fa('0x6'))['db'];var utils=require(_0x67fa('0x7'));var logger=require(_0x67fa('0x8'))('rpc');var config=require(_0x67fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x67fa('0xa')][_0x67fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11f43a,_0x32891a,_0x5ae3fd){return new BPromise(function(_0x1874e8,_0x2cefe6){return client['request'](_0x11f43a,_0x5ae3fd)[_0x67fa('0xc')](function(_0x6b1104){logger[_0x67fa('0xd')](_0x67fa('0xe'),_0x32891a,_0x67fa('0xf'));logger[_0x67fa('0x10')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x32891a,_0x67fa('0xf'),JSON[_0x67fa('0x11')](_0x6b1104));if(_0x6b1104[_0x67fa('0x12')]){if(_0x6b1104['error']['code']===0x1f4){logger[_0x67fa('0x12')](_0x67fa('0xe'),_0x32891a,_0x6b1104[_0x67fa('0x12')]['message']);return _0x2cefe6(_0x6b1104['error'][_0x67fa('0x13')]);}logger[_0x67fa('0x12')](_0x67fa('0xe'),_0x32891a,_0x6b1104[_0x67fa('0x12')][_0x67fa('0x13')]);return _0x1874e8(_0x6b1104[_0x67fa('0x12')][_0x67fa('0x13')]);}else{logger[_0x67fa('0xd')](_0x67fa('0xe'),_0x32891a,_0x67fa('0xf'));_0x1874e8(_0x6b1104['result'][_0x67fa('0x13')]);}})['catch'](function(_0x1696c8){logger[_0x67fa('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x32891a,_0x1696c8);_0x2cefe6(_0x1696c8);});});}exports[_0x67fa('0x14')]=function(_0x23c7b9){var _0xccb14c=this;return new Promise(function(_0x1e2033,_0x3788a2){return db['ChatQueueReport'][_0x67fa('0x15')](_0x23c7b9[_0x67fa('0x16')],{'raw':_0x23c7b9[_0x67fa('0x17')]?_0x23c7b9[_0x67fa('0x17')][_0x67fa('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2495d2){logger[_0x67fa('0xd')](_0x67fa('0x14'),_0x23c7b9);logger[_0x67fa('0x10')](_0x67fa('0x14'),_0x23c7b9,JSON[_0x67fa('0x11')](_0x2495d2));_0x1e2033(_0x2495d2);})[_0x67fa('0x19')](function(_0x270b0e){logger[_0x67fa('0x12')](_0x67fa('0x14'),_0x270b0e[_0x67fa('0x13')],_0x23c7b9);_0x3788a2(_0xccb14c[_0x67fa('0x12')](0x1f4,_0x270b0e[_0x67fa('0x13')]));});});};exports[_0x67fa('0x1a')]=function(_0x366bf7){var _0x4950e9=this;return new Promise(function(_0x3addc5,_0x48fbcb){return db['ChatQueueReport'][_0x67fa('0x1b')](_0x366bf7['body'],{'raw':_0x366bf7['options']?_0x366bf7[_0x67fa('0x17')][_0x67fa('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x366bf7[_0x67fa('0x17')]?_0x366bf7['options'][_0x67fa('0x1c')]||null:null,'attributes':_0x366bf7[_0x67fa('0x17')]?_0x366bf7[_0x67fa('0x17')]['attributes']||null:null,'limit':_0x366bf7[_0x67fa('0x17')]?_0x366bf7[_0x67fa('0x17')]['limit']||null:null})[_0x67fa('0xc')](function(_0x5f12c4){logger[_0x67fa('0xd')]('UpdateChatQueueReport',_0x366bf7);logger[_0x67fa('0x10')](_0x67fa('0x1a'),_0x366bf7,JSON[_0x67fa('0x11')](_0x5f12c4));_0x3addc5(_0x5f12c4);})[_0x67fa('0x19')](function(_0x478292){logger[_0x67fa('0x12')]('UpdateChatQueueReport',_0x478292[_0x67fa('0x13')],_0x366bf7);_0x48fbcb(_0x4950e9['error'](0x1f4,_0x478292[_0x67fa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index c82aab3..4ba1eca 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 _0xdcb4=['post','create','put','update','/:id','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0xdcb4,0xcd));var _0x4dcb=function(_0x219746,_0x553e06){_0x219746=_0x219746-0x0;var _0x1d7759=_0xdcb4[_0x219746];return _0x1d7759;};'use strict';var multer=require(_0x4dcb('0x0'));var util=require('util');var path=require(_0x4dcb('0x1'));var timeout=require('connect-timeout');var express=require(_0x4dcb('0x2'));var router=express[_0x4dcb('0x3')]();var fs_extra=require(_0x4dcb('0x4'));var auth=require(_0x4dcb('0x5'));var interaction=require(_0x4dcb('0x6'));var config=require(_0x4dcb('0x7'));var controller=require(_0x4dcb('0x8'));router[_0x4dcb('0x9')]('/',auth[_0x4dcb('0xa')](),controller[_0x4dcb('0xb')]);router[_0x4dcb('0x9')](_0x4dcb('0xc'),auth[_0x4dcb('0xa')](),controller[_0x4dcb('0xd')]);router[_0x4dcb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4dcb('0xe')]);router[_0x4dcb('0xf')]('/',auth[_0x4dcb('0xa')](),controller[_0x4dcb('0x10')]);router[_0x4dcb('0x11')]('/:id',auth[_0x4dcb('0xa')](),controller[_0x4dcb('0x12')]);router['delete'](_0x4dcb('0x13'),auth['isAuthenticated'](),controller[_0x4dcb('0x14')]);module[_0x4dcb('0x15')]=router; \ No newline at end of file +var _0x3561=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','/:id','create','update','delete','destroy'];(function(_0x2781ae,_0x250809){var _0x329fc1=function(_0x4fe266){while(--_0x4fe266){_0x2781ae['push'](_0x2781ae['shift']());}};_0x329fc1(++_0x250809);}(_0x3561,0x120));var _0x1356=function(_0x4012d8,_0x178854){_0x4012d8=_0x4012d8-0x0;var _0x3019a3=_0x3561[_0x4012d8];return _0x3019a3;};'use strict';var multer=require(_0x1356('0x0'));var util=require(_0x1356('0x1'));var path=require('path');var timeout=require(_0x1356('0x2'));var express=require(_0x1356('0x3'));var router=express[_0x1356('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1356('0x5'));var interaction=require(_0x1356('0x6'));var config=require(_0x1356('0x7'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x1356('0x8')](),controller[_0x1356('0x9')]);router['get']('/describe',auth[_0x1356('0x8')](),controller[_0x1356('0xa')]);router['get'](_0x1356('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x1356('0x8')](),controller[_0x1356('0xc')]);router['put']('/:id',auth[_0x1356('0x8')](),controller[_0x1356('0xd')]);router[_0x1356('0xe')]('/:id',auth[_0x1356('0x8')](),controller[_0x1356('0xf')]);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 48c94df..63a0b78 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x30063a,_0x4a55c8){var _0x2024d2=function(_0x54df95){while(--_0x54df95){_0x30063a['push'](_0x30063a['shift']());}};_0x2024d2(++_0x4a55c8);}(_0xaa88,0x137));var _0x8aa8=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0xaa88[_0x3cae69];return _0x3128eb;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x95014d,_0x16fdc7){var _0x2f9e3e=function(_0x13f0ab){while(--_0x13f0ab){_0x95014d['push'](_0x95014d['shift']());}};_0x2f9e3e(++_0x16fdc7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0xcb91[_0x3fe042];return _0x7d4a1f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index c6141c8..6404f79 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 _0xa54e=['findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','ChatTransferReport','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include'];(function(_0x1ace2a,_0xf9562d){var _0x454712=function(_0x46f12f){while(--_0x46f12f){_0x1ace2a['push'](_0x1ace2a['shift']());}};_0x454712(++_0xf9562d);}(_0xa54e,0x1d3));var _0xea54=function(_0x5ef7b8,_0x15cc07){_0x5ef7b8=_0x5ef7b8-0x0;var _0x2c7148=_0xa54e[_0x5ef7b8];return _0x2c7148;};'use strict';var emlformat=require(_0xea54('0x0'));var rimraf=require(_0xea54('0x1'));var zipdir=require(_0xea54('0x2'));var jsonpatch=require(_0xea54('0x3'));var rp=require('request-promise');var moment=require(_0xea54('0x4'));var BPromise=require(_0xea54('0x5'));var Mustache=require(_0xea54('0x6'));var util=require(_0xea54('0x7'));var path=require('path');var sox=require(_0xea54('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea54('0x9'));var _=require('lodash');var squel=require(_0xea54('0xa'));var crypto=require(_0xea54('0xb'));var jsforce=require(_0xea54('0xc'));var deskjs=require(_0xea54('0xd'));var toCsv=require(_0xea54('0xe'));var querystring=require(_0xea54('0xf'));var Papa=require(_0xea54('0x10'));var Redis=require('ioredis');var authService=require(_0xea54('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xea54('0x12'))(_0xea54('0x13'));var utils=require(_0xea54('0x14'));var config=require(_0xea54('0x15'));var licenseUtil=require(_0xea54('0x16'));var db=require(_0xea54('0x17'))['db'];function respondWithStatusCode(_0x3b8dd5,_0x4895b3){_0x4895b3=_0x4895b3||0xcc;return function(_0x241de7){if(_0x241de7){return _0x3b8dd5[_0xea54('0x18')](_0x4895b3);}return _0x3b8dd5[_0xea54('0x19')](_0x4895b3)[_0xea54('0x1a')]();};}function respondWithResult(_0x56b63b,_0x2de7d8){_0x2de7d8=_0x2de7d8||0xc8;return function(_0x2e783d){if(_0x2e783d){return _0x56b63b[_0xea54('0x19')](_0x2de7d8)['json'](_0x2e783d);}};}function respondWithFilteredResult(_0x347c49,_0x1e9e5a){return function(_0x34ad3e){if(_0x34ad3e){var _0x4588ce=typeof _0x1e9e5a[_0xea54('0x1b')]===_0xea54('0x1c')&&typeof _0x1e9e5a[_0xea54('0x1d')]===_0xea54('0x1c');var _0x287680=_0x34ad3e['count'];var _0x1925d5=_0x4588ce?0x0:_0x1e9e5a[_0xea54('0x1b')];var _0x40ccda=_0x4588ce?_0x34ad3e[_0xea54('0x1e')]:_0x1e9e5a[_0xea54('0x1b')]+_0x1e9e5a[_0xea54('0x1d')];var _0x4b19be;if(_0x40ccda>=_0x287680){_0x40ccda=_0x287680;_0x4b19be=0xc8;}else{_0x4b19be=0xce;}_0x347c49[_0xea54('0x19')](_0x4b19be);return _0x347c49[_0xea54('0x1f')](_0xea54('0x20'),_0x1925d5+'-'+_0x40ccda+'/'+_0x287680)[_0xea54('0x21')](_0x34ad3e);}return null;};}function patchUpdates(_0x57ee75){return function(_0xb229fd){try{jsonpatch[_0xea54('0x22')](_0xb229fd,_0x57ee75,!![]);}catch(_0x42f740){return BPromise[_0xea54('0x23')](_0x42f740);}return _0xb229fd[_0xea54('0x24')]();};}function saveUpdates(_0x19176d,_0x7e082d){return function(_0x52e541){if(_0x52e541){return _0x52e541[_0xea54('0x25')](_0x19176d)[_0xea54('0x26')](function(_0x40b833){return _0x40b833;});}return null;};}function removeEntity(_0x18bd55,_0x27420e){return function(_0xf1b378){if(_0xf1b378){return _0xf1b378[_0xea54('0x27')]()[_0xea54('0x26')](function(){_0x18bd55[_0xea54('0x19')](0xcc)[_0xea54('0x1a')]();});}};}function handleEntityNotFound(_0x260b87,_0x5664a3){return function(_0x1632e3){if(!_0x1632e3){_0x260b87[_0xea54('0x18')](0x194);}return _0x1632e3;};}function handleError(_0x315a1d,_0xe818ce){_0xe818ce=_0xe818ce||0x1f4;return function(_0x2c5d8d){logger[_0xea54('0x28')](_0x2c5d8d['stack']);if(_0x2c5d8d['name']){delete _0x2c5d8d[_0xea54('0x29')];}_0x315a1d[_0xea54('0x19')](_0xe818ce)['send'](_0x2c5d8d);};}exports[_0xea54('0x2a')]=function(_0x11defc,_0x1d669a){var _0x26cd74={},_0x602631={},_0x325440={'count':0x0,'rows':[]};var _0x369313=_[_0xea54('0x2b')](db[_0xea54('0x2c')]['rawAttributes'],function(_0x379953){return{'name':_0x379953['fieldName'],'type':_0x379953[_0xea54('0x2d')]['key']};});_0x602631['model']=_[_0xea54('0x2b')](_0x369313,_0xea54('0x29'));_0x602631[_0xea54('0x2e')]=_['keys'](_0x11defc[_0xea54('0x2e')]);_0x602631[_0xea54('0x2f')]=_[_0xea54('0x30')](_0x602631['model'],_0x602631['query']);_0x26cd74[_0xea54('0x31')]=_[_0xea54('0x30')](_0x602631[_0xea54('0x32')],qs[_0xea54('0x33')](_0x11defc[_0xea54('0x2e')][_0xea54('0x33')]));_0x26cd74['attributes']=_0x26cd74[_0xea54('0x31')][_0xea54('0x34')]?_0x26cd74['attributes']:_0x602631[_0xea54('0x32')];if(!_0x11defc['query'][_0xea54('0x35')](_0xea54('0x36'))){_0x26cd74[_0xea54('0x1d')]=qs['limit'](_0x11defc[_0xea54('0x2e')][_0xea54('0x1d')]);_0x26cd74[_0xea54('0x1b')]=qs[_0xea54('0x1b')](_0x11defc[_0xea54('0x2e')]['offset']);}_0x26cd74[_0xea54('0x37')]=qs[_0xea54('0x38')](_0x11defc[_0xea54('0x2e')]['sort']);_0x26cd74[_0xea54('0x39')]=qs[_0xea54('0x2f')](_[_0xea54('0x3a')](_0x11defc[_0xea54('0x2e')],_0x602631['filters']),_0x369313);if(_0x11defc[_0xea54('0x2e')]['filter']){_0x26cd74['where']=_[_0xea54('0x3b')](_0x26cd74[_0xea54('0x39')],{'$or':_[_0xea54('0x2b')](_0x369313,function(_0x5ab9f8){if(_0x5ab9f8['type']!==_0xea54('0x3c')){var _0x476d73={};_0x476d73[_0x5ab9f8['name']]={'$like':'%'+_0x11defc[_0xea54('0x2e')][_0xea54('0x3d')]+'%'};return _0x476d73;}})});}_0x26cd74=_[_0xea54('0x3b')]({},_0x26cd74,_0x11defc[_0xea54('0x3e')]);var _0x2dbf26={'where':_0x26cd74[_0xea54('0x39')]};return db['ChatTransferReport'][_0xea54('0x1e')](_0x2dbf26)[_0xea54('0x26')](function(_0x5cd9c8){_0x325440[_0xea54('0x1e')]=_0x5cd9c8;if(_0x11defc['query'][_0xea54('0x3f')]){_0x26cd74[_0xea54('0x40')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xea54('0x41')](_0x26cd74);})[_0xea54('0x26')](function(_0x724296){_0x325440[_0xea54('0x42')]=_0x724296;return _0x325440;})[_0xea54('0x26')](respondWithFilteredResult(_0x1d669a,_0x26cd74))[_0xea54('0x43')](handleError(_0x1d669a,null));};exports[_0xea54('0x44')]=function(_0x2e0a5e,_0x4c0c82){var _0x4c47e1={'raw':!![],'where':{'id':_0x2e0a5e[_0xea54('0x45')]['id']}},_0x370ac6={};_0x370ac6[_0xea54('0x32')]=_[_0xea54('0x46')](db[_0xea54('0x2c')][_0xea54('0x47')]);_0x370ac6[_0xea54('0x2e')]=_[_0xea54('0x46')](_0x2e0a5e[_0xea54('0x2e')]);_0x370ac6[_0xea54('0x2f')]=_[_0xea54('0x30')](_0x370ac6[_0xea54('0x32')],_0x370ac6[_0xea54('0x2e')]);_0x4c47e1[_0xea54('0x31')]=_[_0xea54('0x30')](_0x370ac6[_0xea54('0x32')],qs[_0xea54('0x33')](_0x2e0a5e[_0xea54('0x2e')][_0xea54('0x33')]));_0x4c47e1[_0xea54('0x31')]=_0x4c47e1[_0xea54('0x31')][_0xea54('0x34')]?_0x4c47e1[_0xea54('0x31')]:_0x370ac6[_0xea54('0x32')];if(_0x2e0a5e[_0xea54('0x2e')][_0xea54('0x3f')]){_0x4c47e1[_0xea54('0x40')]=[{'all':!![]}];}_0x4c47e1=_[_0xea54('0x3b')]({},_0x4c47e1,_0x2e0a5e[_0xea54('0x3e')]);return db[_0xea54('0x2c')][_0xea54('0x48')](_0x4c47e1)[_0xea54('0x26')](handleEntityNotFound(_0x4c0c82,null))[_0xea54('0x26')](respondWithResult(_0x4c0c82,null))[_0xea54('0x43')](handleError(_0x4c0c82,null));};exports['create']=function(_0x293fc0,_0x1f45a8){return db[_0xea54('0x2c')][_0xea54('0x49')](_0x293fc0[_0xea54('0x4a')],{})['then'](respondWithResult(_0x1f45a8,0xc9))[_0xea54('0x43')](handleError(_0x1f45a8,null));};exports['update']=function(_0x3f3624,_0x42e9a1){if(_0x3f3624[_0xea54('0x4a')]['id']){delete _0x3f3624[_0xea54('0x4a')]['id'];}return db[_0xea54('0x2c')]['find']({'where':{'id':_0x3f3624[_0xea54('0x45')]['id']}})[_0xea54('0x26')](handleEntityNotFound(_0x42e9a1,null))['then'](saveUpdates(_0x3f3624[_0xea54('0x4a')],null))['then'](respondWithResult(_0x42e9a1,null))[_0xea54('0x43')](handleError(_0x42e9a1,null));};exports[_0xea54('0x27')]=function(_0x2d0af7,_0x246e04){return db[_0xea54('0x2c')][_0xea54('0x48')]({'where':{'id':_0x2d0af7['params']['id']}})[_0xea54('0x26')](handleEntityNotFound(_0x246e04,null))[_0xea54('0x26')](removeEntity(_0x246e04,null))[_0xea54('0x43')](handleError(_0x246e04,null));};exports[_0xea54('0x4b')]=function(_0x49a50a,_0x23ffbc){return db[_0xea54('0x2c')][_0xea54('0x4b')]()[_0xea54('0x26')](respondWithResult(_0x23ffbc,null))[_0xea54('0x43')](handleError(_0x23ffbc,null));}; \ No newline at end of file +var _0x27d8=['includeAll','include','rows','catch','create','update','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','stack','send','index','ChatTransferReport','rawAttributes','fieldName','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','filter','options'];(function(_0x9f8e85,_0x18b847){var _0x11ce2f=function(_0x56c2e0){while(--_0x56c2e0){_0x9f8e85['push'](_0x9f8e85['shift']());}};_0x11ce2f(++_0x18b847);}(_0x27d8,0x1b4));var _0x827d=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0x27d8[_0x5216e0];return _0x5b3f40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x827d('0x0'));var zipdir=require(_0x827d('0x1'));var jsonpatch=require(_0x827d('0x2'));var rp=require(_0x827d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x827d('0x4'));var sox=require('sox');var csv=require(_0x827d('0x5'));var ejs=require(_0x827d('0x6'));var fs=require('fs');var fs_extra=require(_0x827d('0x7'));var _=require('lodash');var squel=require(_0x827d('0x8'));var crypto=require(_0x827d('0x9'));var jsforce=require(_0x827d('0xa'));var deskjs=require(_0x827d('0xb'));var toCsv=require(_0x827d('0x5'));var querystring=require(_0x827d('0xc'));var Papa=require(_0x827d('0xd'));var Redis=require(_0x827d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x827d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x827d('0x10'));var logger=require(_0x827d('0x11'))('api');var utils=require(_0x827d('0x12'));var config=require(_0x827d('0x13'));var licenseUtil=require(_0x827d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20ff9b,_0x28f7b9){_0x28f7b9=_0x28f7b9||0xcc;return function(_0x3e0be){if(_0x3e0be){return _0x20ff9b[_0x827d('0x15')](_0x28f7b9);}return _0x20ff9b[_0x827d('0x16')](_0x28f7b9)[_0x827d('0x17')]();};}function respondWithResult(_0x1d2e9a,_0x35ca72){_0x35ca72=_0x35ca72||0xc8;return function(_0x2a1c38){if(_0x2a1c38){return _0x1d2e9a['status'](_0x35ca72)[_0x827d('0x18')](_0x2a1c38);}};}function respondWithFilteredResult(_0x1b5dad,_0x3a7048){return function(_0xec90a){if(_0xec90a){var _0x455cd1=typeof _0x3a7048[_0x827d('0x19')]===_0x827d('0x1a')&&typeof _0x3a7048[_0x827d('0x1b')]==='undefined';var _0x52e8c0=_0xec90a[_0x827d('0x1c')];var _0x299075=_0x455cd1?0x0:_0x3a7048[_0x827d('0x19')];var _0x13a057=_0x455cd1?_0xec90a['count']:_0x3a7048[_0x827d('0x19')]+_0x3a7048[_0x827d('0x1b')];var _0x21b32f;if(_0x13a057>=_0x52e8c0){_0x13a057=_0x52e8c0;_0x21b32f=0xc8;}else{_0x21b32f=0xce;}_0x1b5dad[_0x827d('0x16')](_0x21b32f);return _0x1b5dad[_0x827d('0x1d')]('Content-Range',_0x299075+'-'+_0x13a057+'/'+_0x52e8c0)[_0x827d('0x18')](_0xec90a);}return null;};}function patchUpdates(_0x4e4c05){return function(_0x2e370f){try{jsonpatch[_0x827d('0x1e')](_0x2e370f,_0x4e4c05,!![]);}catch(_0x37f6e4){return BPromise[_0x827d('0x1f')](_0x37f6e4);}return _0x2e370f[_0x827d('0x20')]();};}function saveUpdates(_0x474bee,_0x11fded){return function(_0x50b7c6){if(_0x50b7c6){return _0x50b7c6['update'](_0x474bee)['then'](function(_0x48d8a0){return _0x48d8a0;});}return null;};}function removeEntity(_0x2c67fc,_0x38fc90){return function(_0x59d91e){if(_0x59d91e){return _0x59d91e[_0x827d('0x21')]()[_0x827d('0x22')](function(){_0x2c67fc[_0x827d('0x16')](0xcc)[_0x827d('0x17')]();});}};}function handleEntityNotFound(_0x47c25d,_0x3681b3){return function(_0x5644aa){if(!_0x5644aa){_0x47c25d[_0x827d('0x15')](0x194);}return _0x5644aa;};}function handleError(_0x30f298,_0x4face0){_0x4face0=_0x4face0||0x1f4;return function(_0x191dfb){logger['error'](_0x191dfb[_0x827d('0x23')]);if(_0x191dfb['name']){delete _0x191dfb['name'];}_0x30f298[_0x827d('0x16')](_0x4face0)[_0x827d('0x24')](_0x191dfb);};}exports[_0x827d('0x25')]=function(_0x182fde,_0x54bd42){var _0x2a14e9={},_0x2772ee={},_0x186af8={'count':0x0,'rows':[]};var _0x5224b6=_['map'](db[_0x827d('0x26')][_0x827d('0x27')],function(_0x4c519c){return{'name':_0x4c519c[_0x827d('0x28')],'type':_0x4c519c['type'][_0x827d('0x29')]};});_0x2772ee[_0x827d('0x2a')]=_[_0x827d('0x2b')](_0x5224b6,_0x827d('0x2c'));_0x2772ee[_0x827d('0x2d')]=_[_0x827d('0x2e')](_0x182fde['query']);_0x2772ee[_0x827d('0x2f')]=_[_0x827d('0x30')](_0x2772ee['model'],_0x2772ee[_0x827d('0x2d')]);_0x2a14e9[_0x827d('0x31')]=_[_0x827d('0x30')](_0x2772ee['model'],qs['fields'](_0x182fde[_0x827d('0x2d')][_0x827d('0x32')]));_0x2a14e9[_0x827d('0x31')]=_0x2a14e9[_0x827d('0x31')][_0x827d('0x33')]?_0x2a14e9[_0x827d('0x31')]:_0x2772ee['model'];if(!_0x182fde[_0x827d('0x2d')][_0x827d('0x34')]('nolimit')){_0x2a14e9['limit']=qs[_0x827d('0x1b')](_0x182fde['query'][_0x827d('0x1b')]);_0x2a14e9[_0x827d('0x19')]=qs[_0x827d('0x19')](_0x182fde[_0x827d('0x2d')][_0x827d('0x19')]);}_0x2a14e9[_0x827d('0x35')]=qs[_0x827d('0x36')](_0x182fde[_0x827d('0x2d')]['sort']);_0x2a14e9[_0x827d('0x37')]=qs[_0x827d('0x2f')](_[_0x827d('0x38')](_0x182fde['query'],_0x2772ee[_0x827d('0x2f')]),_0x5224b6);if(_0x182fde[_0x827d('0x2d')]['filter']){_0x2a14e9[_0x827d('0x37')]=_[_0x827d('0x39')](_0x2a14e9[_0x827d('0x37')],{'$or':_[_0x827d('0x2b')](_0x5224b6,function(_0x4ca53e){if(_0x4ca53e[_0x827d('0x3a')]!=='VIRTUAL'){var _0x113a3d={};_0x113a3d[_0x4ca53e['name']]={'$like':'%'+_0x182fde[_0x827d('0x2d')][_0x827d('0x3b')]+'%'};return _0x113a3d;}})});}_0x2a14e9=_[_0x827d('0x39')]({},_0x2a14e9,_0x182fde[_0x827d('0x3c')]);var _0x527b46={'where':_0x2a14e9[_0x827d('0x37')]};return db[_0x827d('0x26')][_0x827d('0x1c')](_0x527b46)[_0x827d('0x22')](function(_0x3bca9a){_0x186af8[_0x827d('0x1c')]=_0x3bca9a;if(_0x182fde[_0x827d('0x2d')][_0x827d('0x3d')]){_0x2a14e9[_0x827d('0x3e')]=[{'all':!![]}];}return db[_0x827d('0x26')]['findAll'](_0x2a14e9);})[_0x827d('0x22')](function(_0x5ed997){_0x186af8[_0x827d('0x3f')]=_0x5ed997;return _0x186af8;})[_0x827d('0x22')](respondWithFilteredResult(_0x54bd42,_0x2a14e9))[_0x827d('0x40')](handleError(_0x54bd42,null));};exports['show']=function(_0x3a86a4,_0x3440aa){var _0x1fcab7={'raw':!![],'where':{'id':_0x3a86a4['params']['id']}},_0x31fc87={};_0x31fc87[_0x827d('0x2a')]=_[_0x827d('0x2e')](db[_0x827d('0x26')][_0x827d('0x27')]);_0x31fc87['query']=_['keys'](_0x3a86a4['query']);_0x31fc87['filters']=_[_0x827d('0x30')](_0x31fc87[_0x827d('0x2a')],_0x31fc87[_0x827d('0x2d')]);_0x1fcab7[_0x827d('0x31')]=_[_0x827d('0x30')](_0x31fc87['model'],qs[_0x827d('0x32')](_0x3a86a4['query']['fields']));_0x1fcab7['attributes']=_0x1fcab7[_0x827d('0x31')][_0x827d('0x33')]?_0x1fcab7[_0x827d('0x31')]:_0x31fc87[_0x827d('0x2a')];if(_0x3a86a4[_0x827d('0x2d')][_0x827d('0x3d')]){_0x1fcab7[_0x827d('0x3e')]=[{'all':!![]}];}_0x1fcab7=_[_0x827d('0x39')]({},_0x1fcab7,_0x3a86a4[_0x827d('0x3c')]);return db[_0x827d('0x26')]['find'](_0x1fcab7)['then'](handleEntityNotFound(_0x3440aa,null))[_0x827d('0x22')](respondWithResult(_0x3440aa,null))[_0x827d('0x40')](handleError(_0x3440aa,null));};exports[_0x827d('0x41')]=function(_0x337720,_0x5e1ddb){return db[_0x827d('0x26')][_0x827d('0x41')](_0x337720['body'],{})[_0x827d('0x22')](respondWithResult(_0x5e1ddb,0xc9))[_0x827d('0x40')](handleError(_0x5e1ddb,null));};exports[_0x827d('0x42')]=function(_0x50e4f8,_0x52ca8c){if(_0x50e4f8[_0x827d('0x43')]['id']){delete _0x50e4f8['body']['id'];}return db[_0x827d('0x26')][_0x827d('0x44')]({'where':{'id':_0x50e4f8['params']['id']}})[_0x827d('0x22')](handleEntityNotFound(_0x52ca8c,null))['then'](saveUpdates(_0x50e4f8[_0x827d('0x43')],null))[_0x827d('0x22')](respondWithResult(_0x52ca8c,null))[_0x827d('0x40')](handleError(_0x52ca8c,null));};exports['destroy']=function(_0x182294,_0x429b1f){return db[_0x827d('0x26')][_0x827d('0x44')]({'where':{'id':_0x182294[_0x827d('0x45')]['id']}})[_0x827d('0x22')](handleEntityNotFound(_0x429b1f,null))['then'](removeEntity(_0x429b1f,null))['catch'](handleError(_0x429b1f,null));};exports[_0x827d('0x46')]=function(_0x2de967,_0x34ec7d){return db['ChatTransferReport'][_0x827d('0x46')]()[_0x827d('0x22')](respondWithResult(_0x34ec7d,null))['catch'](handleError(_0x34ec7d,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index ea31b0b..1bed93f 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 _0x67b6=['exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x375524,_0x51b2d8){var _0x4272b2=function(_0x549473){while(--_0x549473){_0x375524['push'](_0x375524['shift']());}};_0x4272b2(++_0x51b2d8);}(_0x67b6,0xe1));var _0x667b=function(_0x26f63d,_0x2bbf5e){_0x26f63d=_0x26f63d-0x0;var _0x404365=_0x67b6[_0x26f63d];return _0x404365;};'use strict';var _=require(_0x667b('0x0'));var util=require(_0x667b('0x1'));var logger=require(_0x667b('0x2'))('api');var moment=require(_0x667b('0x3'));var BPromise=require('bluebird');var rp=require(_0x667b('0x4'));var fs=require('fs');var path=require(_0x667b('0x5'));var rimraf=require(_0x667b('0x6'));var config=require(_0x667b('0x7'));var attributes=require(_0x667b('0x8'));module[_0x667b('0x9')]=function(_0xce5a75,_0x3ff8c1){return _0xce5a75[_0x667b('0xa')](_0x667b('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x667b('0xc'),'fields':[_0x667b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb6a=['bluebird','path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x476107,_0x5a96cf){var _0x26c057=function(_0x52419a){while(--_0x52419a){_0x476107['push'](_0x476107['shift']());}};_0x26c057(++_0x5a96cf);}(_0xfb6a,0xb1));var _0xafb6=function(_0x50d6d6,_0x189c68){_0x50d6d6=_0x50d6d6-0x0;var _0x5d9bb4=_0xfb6a[_0x50d6d6];return _0x5d9bb4;};'use strict';var _=require(_0xafb6('0x0'));var util=require(_0xafb6('0x1'));var logger=require(_0xafb6('0x2'))(_0xafb6('0x3'));var moment=require(_0xafb6('0x4'));var BPromise=require(_0xafb6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xafb6('0x6'));var rimraf=require('rimraf');var config=require(_0xafb6('0x7'));var attributes=require(_0xafb6('0x8'));module['exports']=function(_0x435e04,_0x298535){return _0x435e04[_0xafb6('0x9')](_0xafb6('0xa'),attributes,{'tableName':_0xafb6('0xb'),'paranoid':![],'indexes':[{'name':_0xafb6('0xc'),'fields':[_0xafb6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index a3c6fa7..5f91795 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 _0x4b17=['request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b17,0x18d));var _0x74b1=function(_0x39609a,_0x28a563){_0x39609a=_0x39609a-0x0;var _0xecd92=_0x4b17[_0x39609a];return _0xecd92;};'use strict';var _=require(_0x74b1('0x0'));var util=require(_0x74b1('0x1'));var moment=require('moment');var BPromise=require(_0x74b1('0x2'));var rs=require(_0x74b1('0x3'));var fs=require('fs');var Redis=require(_0x74b1('0x4'));var db=require(_0x74b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74b1('0x6'))('rpc');var config=require(_0x74b1('0x7'));var jayson=require(_0x74b1('0x8'));var client=jayson[_0x74b1('0x9')][_0x74b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17b97a,_0x3fb22c,_0x19f893){return new BPromise(function(_0x343c90,_0x3d1701){return client[_0x74b1('0xb')](_0x17b97a,_0x19f893)[_0x74b1('0xc')](function(_0x41b5bd){logger[_0x74b1('0xd')](_0x74b1('0xe'),_0x3fb22c,_0x74b1('0xf'));logger[_0x74b1('0x10')](_0x74b1('0x11'),_0x3fb22c,_0x74b1('0xf'),JSON[_0x74b1('0x12')](_0x41b5bd));if(_0x41b5bd[_0x74b1('0x13')]){if(_0x41b5bd[_0x74b1('0x13')][_0x74b1('0x14')]===0x1f4){logger[_0x74b1('0x13')](_0x74b1('0xe'),_0x3fb22c,_0x41b5bd['error'][_0x74b1('0x15')]);return _0x3d1701(_0x41b5bd['error'][_0x74b1('0x15')]);}logger[_0x74b1('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x3fb22c,_0x41b5bd[_0x74b1('0x13')][_0x74b1('0x15')]);return _0x343c90(_0x41b5bd[_0x74b1('0x13')]['message']);}else{logger[_0x74b1('0xd')](_0x74b1('0xe'),_0x3fb22c,_0x74b1('0xf'));_0x343c90(_0x41b5bd[_0x74b1('0x16')]['message']);}})[_0x74b1('0x17')](function(_0x567208){logger[_0x74b1('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x3fb22c,_0x567208);_0x3d1701(_0x567208);});});} \ No newline at end of file +var _0xaa4c=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xaa4c,0x1b6));var _0xcaa4=function(_0x239b69,_0x50346e){_0x239b69=_0x239b69-0x0;var _0x20e29d=_0xaa4c[_0x239b69];return _0x20e29d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcaa4('0x0'));var BPromise=require(_0xcaa4('0x1'));var rs=require(_0xcaa4('0x2'));var fs=require('fs');var Redis=require(_0xcaa4('0x3'));var db=require(_0xcaa4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcaa4('0x5'));var config=require(_0xcaa4('0x6'));var jayson=require(_0xcaa4('0x7'));var client=jayson[_0xcaa4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x427937,_0x5f3ea9,_0x26a489){return new BPromise(function(_0x55b28a,_0x30f775){return client[_0xcaa4('0x9')](_0x427937,_0x26a489)[_0xcaa4('0xa')](function(_0x51ea1c){logger[_0xcaa4('0xb')](_0xcaa4('0xc'),_0x5f3ea9,_0xcaa4('0xd'));logger[_0xcaa4('0xe')](_0xcaa4('0xf'),_0x5f3ea9,_0xcaa4('0xd'),JSON[_0xcaa4('0x10')](_0x51ea1c));if(_0x51ea1c[_0xcaa4('0x11')]){if(_0x51ea1c[_0xcaa4('0x11')][_0xcaa4('0x12')]===0x1f4){logger['error'](_0xcaa4('0xc'),_0x5f3ea9,_0x51ea1c[_0xcaa4('0x11')][_0xcaa4('0x13')]);return _0x30f775(_0x51ea1c[_0xcaa4('0x11')][_0xcaa4('0x13')]);}logger[_0xcaa4('0x11')](_0xcaa4('0xc'),_0x5f3ea9,_0x51ea1c['error'][_0xcaa4('0x13')]);return _0x55b28a(_0x51ea1c[_0xcaa4('0x11')][_0xcaa4('0x13')]);}else{logger[_0xcaa4('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x5f3ea9,'request\x20sent');_0x55b28a(_0x51ea1c[_0xcaa4('0x14')][_0xcaa4('0x13')]);}})[_0xcaa4('0x15')](function(_0x3c10b9){logger[_0xcaa4('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x5f3ea9,_0x3c10b9);_0x30f775(_0x3c10b9);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 9fdc971..b3f9d88 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 _0xfe85=['../../config/environment','get','index','isAuthenticated','/:id','post','create','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x50e308,_0x221dcb){var _0x2a23b1=function(_0x1743dd){while(--_0x1743dd){_0x50e308['push'](_0x50e308['shift']());}};_0x2a23b1(++_0x221dcb);}(_0xfe85,0x12a));var _0x5fe8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe85[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5fe8('0x0'));var util=require('util');var path=require(_0x5fe8('0x1'));var timeout=require(_0x5fe8('0x2'));var express=require(_0x5fe8('0x3'));var router=express['Router']();var fs_extra=require(_0x5fe8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5fe8('0x5'));var config=require(_0x5fe8('0x6'));var controller=require('./chatTransferReport.controller');router[_0x5fe8('0x7')]('/',auth['isAuthenticated'](),controller[_0x5fe8('0x8')]);router[_0x5fe8('0x7')]('/describe',auth[_0x5fe8('0x9')](),controller['describe']);router[_0x5fe8('0x7')](_0x5fe8('0xa'),auth[_0x5fe8('0x9')](),controller['show']);router[_0x5fe8('0xb')]('/',auth[_0x5fe8('0x9')](),controller[_0x5fe8('0xc')]);router['put']('/:id',auth[_0x5fe8('0x9')](),controller['update']);router[_0x5fe8('0xd')](_0x5fe8('0xa'),auth['isAuthenticated'](),controller[_0x5fe8('0xe')]);module[_0x5fe8('0xf')]=router; \ No newline at end of file +var _0xf574=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x40412f,_0x22c4ee){var _0x47e5f8=function(_0x266e8d){while(--_0x266e8d){_0x40412f['push'](_0x40412f['shift']());}};_0x47e5f8(++_0x22c4ee);}(_0xf574,0x111));var _0x4f57=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf574[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x4f57('0x0'));var path=require(_0x4f57('0x1'));var timeout=require(_0x4f57('0x2'));var express=require(_0x4f57('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f57('0x4'));var interaction=require(_0x4f57('0x5'));var config=require(_0x4f57('0x6'));var controller=require('./chatTransferReport.controller');router[_0x4f57('0x7')]('/',auth[_0x4f57('0x8')](),controller[_0x4f57('0x9')]);router['get'](_0x4f57('0xa'),auth[_0x4f57('0x8')](),controller[_0x4f57('0xb')]);router['get'](_0x4f57('0xc'),auth['isAuthenticated'](),controller[_0x4f57('0xd')]);router[_0x4f57('0xe')]('/',auth[_0x4f57('0x8')](),controller['create']);router[_0x4f57('0xf')](_0x4f57('0xc'),auth['isAuthenticated'](),controller[_0x4f57('0x10')]);router[_0x4f57('0x11')](_0x4f57('0xc'),auth[_0x4f57('0x8')](),controller[_0x4f57('0x12')]);module[_0x4f57('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 4a59ea4..6597095 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 _0xb43b=['setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','parse','offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','star','TEXT','input','name','getDataValue','onlineForm'];(function(_0x36a064,_0x2495a4){var _0x36eefe=function(_0x4c33d7){while(--_0x4c33d7){_0x36a064['push'](_0x36a064['shift']());}};_0x36eefe(++_0x2495a4);}(_0xb43b,0x1b2));var _0xbb43=function(_0x78b465,_0x43e204){_0x78b465=_0x78b465-0x0;var _0x2a2ad1=_0xb43b[_0x78b465];return _0x2a2ad1;};'use strict';var Sequelize=require(_0xbb43('0x0'));var rs=require(_0xbb43('0x1'));module['exports']={'name':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![],'unique':_0xbb43('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x4')},'mapKeyOffline':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbb43('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![],'defaultValue':_0xbb43('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![],'defaultValue':_0xbb43('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![],'defaultValue':_0xbb43('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbb43('0x2')]},'animation':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbb43('0x9')](_0xbb43('0xa'),_0xbb43('0xb')),'defaultValue':_0xbb43('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xbb43('0xc')},'start_chat_button':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbb43('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xbb43('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbb43('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x11')},'closingMessage':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x12')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x13')},'ratingType':{'type':Sequelize['ENUM'](_0xbb43('0x14'),'thumb'),'defaultValue':_0xbb43('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbb43('0x15')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xbb43('0x16'),'variable':null,'config':{'placeholder':_0xbb43('0x17'),'type':'text','required':!![]},'props':{'title':_0xbb43('0x17'),'helpText':''}},{'type':'input','props':{'title':_0xbb43('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb43('0x4'),'type':_0xbb43('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this[_0xbb43('0x18')](_0xbb43('0x19'))):{};},'set':function(_0x5d8310){return this[_0xbb43('0x1a')](_0xbb43('0x19'),JSON[_0xbb43('0x1b')](_0x5d8310));}},'offlineForm':{'type':Sequelize[_0xbb43('0x15')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xbb43('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb43('0x4'),'type':_0xbb43('0x4')},'variable':null},{'type':_0xbb43('0x1c'),'config':{'placeholder':_0xbb43('0x1d')},'props':{'title':_0xbb43('0x1d'),'helpText':_0xbb43('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xbb43('0x18')]('offlineForm')?JSON[_0xbb43('0x1f')](this['getDataValue'](_0xbb43('0x20'))):{};},'set':function(_0x436fd5){return this[_0xbb43('0x1a')](_0xbb43('0x20'),JSON['stringify'](_0x436fd5));}},'token':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbb43('0x2')]},'waitingTitle':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x22')},'offlineMessageBody':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x12')},'sendUnmanaged':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbb43('0x15')]},'showAgentAvatar':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbb43('0x2')]},'notificationTemplate':{'type':Sequelize[_0xbb43('0x15')],'defaultValue':function(){return _0xbb43('0x24');}},'notificationSound':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x25')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x26')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x27')},'messagesAlignment':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbb43('0x28')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbb43('0x28')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbb43('0x28')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xbb43('0x15')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbb43('0x28')],'comment':_0xbb43('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![],'comment':_0xbb43('0x2a'),'set':function(_0x531d96){if(!_0x531d96)this[_0xbb43('0x1a')]('mandatoryDispositionPauseId',null);this[_0xbb43('0x1a')](_0xbb43('0x2b'),_0x531d96);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbb43('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbb43('0x2c')},'vidaooNote':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':function(){return _0xbb43('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0xbb43('0x15')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbb43('0x15')]}}; \ No newline at end of file +var _0x4ea3=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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.','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0x4ea3,0x70));var _0x34ea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4ea3[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x34ea('0x0'));var rs=require(_0x34ea('0x1'));module[_0x34ea('0x2')]={'name':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x34ea('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x5')},'key':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x6')},'customerAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x34ea('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x34ea('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x34ea('0xa')](_0x34ea('0xb'),_0x34ea('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xd')},'start_chat_button':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xe')},'offline_chat_button':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xf')},'header_offline':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x10')},'download_transcript':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x34ea('0x12')]},'closingQuestion':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x14')},'noteTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x16')},'closingMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0xf')},'skipMessageButton':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x18')},'conditionAgreement':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x19')},'ratingType':{'type':Sequelize['ENUM']('star',_0x34ea('0x1a')),'defaultValue':_0x34ea('0x1b')},'ratingStarsNumber':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x34ea('0x1c'),'variable':null,'config':{'placeholder':_0x34ea('0x1d'),'type':_0x34ea('0x1e'),'required':!![]},'props':{'title':_0x34ea('0x1d'),'helpText':''}},{'type':_0x34ea('0x1c'),'props':{'title':_0x34ea('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x34ea('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x34ea('0x1f')](_0x34ea('0x20'))?JSON[_0x34ea('0x21')](this['getDataValue']('onlineForm')):{};},'set':function(_0x564d1b){return this[_0x34ea('0x22')](_0x34ea('0x20'),JSON[_0x34ea('0x23')](_0x564d1b));}},'offlineForm':{'type':Sequelize[_0x34ea('0x12')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x34ea('0x1c'),'props':{'title':_0x34ea('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x34ea('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x34ea('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x34ea('0x1f')](_0x34ea('0x25'))?JSON[_0x34ea('0x21')](this['getDataValue'](_0x34ea('0x25'))):{};},'set':function(_0x59b9f6){return this[_0x34ea('0x22')]('offlineForm',JSON[_0x34ea('0x23')](_0x59b9f6));}},'token':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':function(){return rs[_0x34ea('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x27')},'waitingMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x18')},'sendUnmanaged':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x34ea('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x34ea('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x34ea('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2c')},'verticalAlignment':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2d')},'defaultTitle':{'type':Sequelize[_0x34ea('0x3')]},'customerAvatar':{'type':Sequelize[_0x34ea('0x12')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x34ea('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2f')},'systemAvatar':{'type':Sequelize[_0x34ea('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x34ea('0x9')],'comment':_0x34ea('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![],'comment':_0x34ea('0x31'),'set':function(_0xa1ff39){if(!_0xa1ff39)this[_0x34ea('0x22')](_0x34ea('0x32'),null);this[_0x34ea('0x22')](_0x34ea('0x33'),_0xa1ff39);}},'vidaooEscalation':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x34ea('0x3')]},'vidaooTopic':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x34ea('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x34ea('0x12')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 59e23d7..dfb42b1 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 _0x294c=['server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','Applications','applications','list','orderBy','priority','asc','account','defaults','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','format','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','mapValues','subjectOffline','offlineMessageSubject','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','includeAll','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','readFileSync','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','ChatApplication','findAndCountAll','stack','finally','json','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','./chatWebsite.socket','register','html-to-text','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','undefined','limit','count','offset','set','get','ChatWebsites','destroy','sendStatus','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar'];(function(_0x3ad164,_0x512873){var _0x27f975=function(_0x368a72){while(--_0x368a72){_0x3ad164['push'](_0x3ad164['shift']());}};_0x27f975(++_0x512873);}(_0x294c,0x1dd));var _0xc294=function(_0x4b5f0e,_0x4a93e5){_0x4b5f0e=_0x4b5f0e-0x0;var _0xcfd20a=_0x294c[_0x4b5f0e];return _0xcfd20a;};'use strict';var BPromise=require(_0xc294('0x0'));var Mustache=require(_0xc294('0x1'));var util=require(_0xc294('0x2'));var path=require(_0xc294('0x3'));var ejs=require(_0xc294('0x4'));var fs=require('fs');var fs_extra=require(_0xc294('0x5'));var _=require(_0xc294('0x6'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0xc294('0x7'));var logger=require(_0xc294('0x8'))('api');var config=require(_0xc294('0x9'));var db=require('../../mysqldb')['db'];config[_0xc294('0xa')]=_['defaults'](config[_0xc294('0xa')],{'host':_0xc294('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc294('0xa')]));require(_0xc294('0xc'))[_0xc294('0xd')](socket);var htmlToText=require(_0xc294('0xe'));var jayson=require('jayson/promise');var client=jayson[_0xc294('0xf')]['http']({'port':0x232c});var client9002=jayson[_0xc294('0xf')]['http']({'port':0x232a});var client9003=jayson[_0xc294('0xf')][_0xc294('0x10')]({'port':0x232b});var client9001=jayson['client'][_0xc294('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x48801f,_0x24e967,_0x2ccce3,_0x427ee9){return new BPromise(function(_0x481f49,_0x271ab2){var _0x3a7775=_0x427ee9||client;return _0x3a7775['request'](_0x48801f,_0x2ccce3)[_0xc294('0x11')](function(_0x3878c1){logger[_0xc294('0x12')](_0xc294('0x13'),_0x24e967,_0xc294('0x14'));logger[_0xc294('0x15')](_0xc294('0x16'),_0x24e967,_0xc294('0x14'),JSON[_0xc294('0x17')](_0x3878c1));if(_0x3878c1[_0xc294('0x18')]){if(_0x3878c1[_0xc294('0x18')][_0xc294('0x19')]===0x1f4){logger[_0xc294('0x18')](_0xc294('0x13'),_0x24e967,_0x3878c1[_0xc294('0x18')][_0xc294('0x1a')]);return _0x271ab2(_0x3878c1['error']['message']);}logger[_0xc294('0x18')](_0xc294('0x13'),_0x24e967,_0x3878c1[_0xc294('0x18')][_0xc294('0x1a')]);return _0x481f49(_0x3878c1[_0xc294('0x18')][_0xc294('0x1a')]);}else{logger[_0xc294('0x12')](_0xc294('0x13'),_0x24e967,_0xc294('0x14'));_0x481f49(_0x3878c1[_0xc294('0x1b')][_0xc294('0x1a')]);}})[_0xc294('0x1c')](function(_0x238371){logger['error'](_0xc294('0x13'),_0x24e967,_0x238371);_0x271ab2(_0x238371);});});}function respondWithStatusCode(_0x40e476,_0x372d7e){_0x372d7e=_0x372d7e||0xcc;return function(_0x2f4e5e){if(_0x2f4e5e){return _0x40e476['sendStatus'](_0x372d7e);}return _0x40e476['status'](_0x372d7e)[_0xc294('0x1d')]();};}function respondWithResult(_0x1d746b,_0x546253){_0x546253=_0x546253||0xc8;return function(_0x4416a7){if(_0x4416a7){return _0x1d746b[_0xc294('0x1e')](_0x546253)['json'](_0x4416a7);}};}function respondWithFilteredResult(_0x2bb109,_0x1f6ca1){return function(_0x1ec5cd){if(_0x1ec5cd){var _0x1f1bb0=typeof _0x1f6ca1['offset']===_0xc294('0x1f')&&typeof _0x1f6ca1[_0xc294('0x20')]===_0xc294('0x1f');var _0x2637dc=_0x1ec5cd[_0xc294('0x21')];var _0x289e6d=_0x1f1bb0?0x0:_0x1f6ca1[_0xc294('0x22')];var _0x314284=_0x1f1bb0?_0x1ec5cd[_0xc294('0x21')]:_0x1f6ca1['offset']+_0x1f6ca1[_0xc294('0x20')];var _0x54cbd3;if(_0x314284>=_0x2637dc){_0x314284=_0x2637dc;_0x54cbd3=0xc8;}else{_0x54cbd3=0xce;}_0x2bb109[_0xc294('0x1e')](_0x54cbd3);return _0x2bb109[_0xc294('0x23')]('Content-Range',_0x289e6d+'-'+_0x314284+'/'+_0x2637dc)['json'](_0x1ec5cd);}return null;};}function saveUpdates(_0x3fc01b){return function(_0xe6888){if(_0xe6888){return _0xe6888['update'](_0x3fc01b)[_0xc294('0x11')](function(_0x382f6d){return _0x382f6d;});}return null;};}function removeEntity(_0x5829c9){return function(_0x1282b2){if(_0x1282b2){return _0x1282b2['destroy']()[_0xc294('0x11')](function(){var _0x2fea31=_0x1282b2[_0xc294('0x24')]({'plain':!![]});var _0x2b85ed=_0xc294('0x25');return db['UserProfileResource'][_0xc294('0x26')]({'where':{'type':_0x2b85ed,'resourceId':_0x2fea31['id']}})[_0xc294('0x11')](function(){return _0x1282b2;});})[_0xc294('0x11')](function(){_0x5829c9[_0xc294('0x1e')](0xcc)[_0xc294('0x1d')]();});}};}function handleEntityNotFound(_0x55a612){return function(_0x3f6ff1){if(!_0x3f6ff1){_0x55a612[_0xc294('0x27')](0x194);}return _0x3f6ff1;};}function handleError(_0x516ab0,_0x354fae){_0x354fae=_0x354fae||0x1f4;return function(_0x25e0cc){logger[_0xc294('0x18')](_0x25e0cc['stack']);if(_0x25e0cc[_0xc294('0x28')]){delete _0x25e0cc[_0xc294('0x28')];}_0x516ab0[_0xc294('0x1e')](_0x354fae)[_0xc294('0x29')](_0x25e0cc);};}exports['index']=function(_0x1f361f,_0x242522){var _0x5e8090={'include':[{'model':db[_0xc294('0x2a')],'as':_0xc294('0x2b')}]},_0x75b709={},_0x8aac25={'count':0x0,'rows':[]};var _0xa3b736=_[_0xc294('0x2c')](db[_0xc294('0x2d')][_0xc294('0x2e')],function(_0x483143){return{'name':_0x483143[_0xc294('0x2f')],'type':_0x483143['type'][_0xc294('0x30')]};});_0x75b709['model']=_['map'](_0xa3b736,_0xc294('0x28'));_0x75b709[_0xc294('0x31')]=_[_0xc294('0x32')](_0x1f361f[_0xc294('0x31')]);_0x75b709['filters']=_['intersection'](_0x75b709[_0xc294('0x33')],_0x75b709[_0xc294('0x31')]);_0x5e8090['attributes']=_[_0xc294('0x34')](_0x75b709[_0xc294('0x33')],qs[_0xc294('0x35')](_0x1f361f[_0xc294('0x31')][_0xc294('0x35')]));_0x5e8090['attributes']=_0x5e8090[_0xc294('0x36')][_0xc294('0x37')]?_0x5e8090['attributes']:_0x75b709['model'];if(!_0x1f361f[_0xc294('0x31')][_0xc294('0x38')](_0xc294('0x39'))){_0x5e8090[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x1f361f['query'][_0xc294('0x20')]);_0x5e8090[_0xc294('0x22')]=qs[_0xc294('0x22')](_0x1f361f[_0xc294('0x31')][_0xc294('0x22')]);}_0x5e8090[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x1f361f[_0xc294('0x31')][_0xc294('0x3b')]);_0x5e8090[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_[_0xc294('0x3e')](_0x1f361f[_0xc294('0x31')],_0x75b709['filters']),_0xa3b736);if(_0x1f361f[_0xc294('0x31')][_0xc294('0x3f')]){_0x5e8090['where']=_[_0xc294('0x40')](_0x5e8090[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0xa3b736,function(_0x251126){if(_0x251126['type']!=='VIRTUAL'){var _0x3a1402={};_0x3a1402[_0x251126[_0xc294('0x28')]]={'$like':'%'+_0x1f361f[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0x3a1402;}})});}_0x5e8090=_[_0xc294('0x40')]({},_0x5e8090,_0x1f361f[_0xc294('0x41')]);var _0x3050f6={'where':_0x5e8090[_0xc294('0x3c')]};return db[_0xc294('0x2d')][_0xc294('0x21')](_0x3050f6)[_0xc294('0x11')](function(_0x381278){_0x8aac25[_0xc294('0x21')]=_0x381278;if(_0x1f361f[_0xc294('0x31')]['includeAll']){_0x5e8090[_0xc294('0x42')]=[{'all':!![]}];}return db[_0xc294('0x2d')][_0xc294('0x43')](_0x5e8090);})['then'](function(_0x484e63){_0x8aac25[_0xc294('0x44')]=_0x484e63;return _0x8aac25;})[_0xc294('0x11')](respondWithFilteredResult(_0x242522,_0x5e8090))['catch'](handleError(_0x242522,null));};exports[_0xc294('0x45')]=function(_0x4beba6,_0x508a1d){var _0x395c15={'raw':![],'where':{'id':_0x4beba6[_0xc294('0x46')]['id']},'include':[{'model':db[_0xc294('0x2a')],'as':_0xc294('0x2b')}]},_0x4cdd3c={};_0x4cdd3c[_0xc294('0x33')]=_[_0xc294('0x32')](db[_0xc294('0x2d')][_0xc294('0x2e')]);_0x4cdd3c[_0xc294('0x31')]=_[_0xc294('0x32')](_0x4beba6[_0xc294('0x31')]);_0x4cdd3c[_0xc294('0x3d')]=_[_0xc294('0x34')](_0x4cdd3c['model'],_0x4cdd3c[_0xc294('0x31')]);_0x395c15[_0xc294('0x36')]=_[_0xc294('0x34')](_0x4cdd3c['model'],qs['fields'](_0x4beba6[_0xc294('0x31')][_0xc294('0x35')]));_0x395c15[_0xc294('0x36')]=_0x395c15[_0xc294('0x36')][_0xc294('0x37')]?_0x395c15[_0xc294('0x36')]:_0x4cdd3c[_0xc294('0x33')];if(_0x4beba6['query']['includeAll']){_0x395c15[_0xc294('0x42')]=[{'all':!![]}];}_0x395c15=_[_0xc294('0x40')]({},_0x395c15,_0x4beba6[_0xc294('0x41')]);return db[_0xc294('0x2d')][_0xc294('0x47')](_0x395c15)['then'](handleEntityNotFound(_0x508a1d,null))[_0xc294('0x11')](respondWithResult(_0x508a1d,null))[_0xc294('0x1c')](handleError(_0x508a1d,null));};exports['create']=function(_0x5db2ff,_0x27c34f){return db[_0xc294('0x2d')][_0xc294('0x48')](_0x5db2ff[_0xc294('0x49')],{})['then'](function(_0x433da0){var _0x34bea6=_0x5db2ff[_0xc294('0x4a')][_0xc294('0x24')]({'plain':!![]});if(!_0x34bea6)throw new Error(_0xc294('0x4b'));if(_0x34bea6['role']===_0xc294('0x4a')){var _0x3a65ac=_0x433da0[_0xc294('0x24')]({'plain':!![]});var _0x2b6140='ChatWebsites';return db[_0xc294('0x4c')][_0xc294('0x47')]({'where':{'name':_0x2b6140,'userProfileId':_0x34bea6['userProfileId']},'raw':!![]})['then'](function(_0x2795ae){if(_0x2795ae&&_0x2795ae[_0xc294('0x4d')]===0x0){return db[_0xc294('0x4e')][_0xc294('0x48')]({'name':_0x3a65ac['name'],'resourceId':_0x3a65ac['id'],'type':_0x2795ae[_0xc294('0x28')],'sectionId':_0x2795ae['id']},{})[_0xc294('0x11')](function(){return _0x433da0;});}else{return _0x433da0;}})[_0xc294('0x1c')](function(_0x373384){logger['error'](_0xc294('0x4f'),_0x373384);throw _0x373384;});}return _0x433da0;})[_0xc294('0x11')](respondWithResult(_0x27c34f,0xc9))['catch'](handleError(_0x27c34f,null));};exports[_0xc294('0x50')]=function(_0x25c9f0,_0x1dc773){if(_0x25c9f0['body']['id']){delete _0x25c9f0[_0xc294('0x49')]['id'];}return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x25c9f0['params']['id']},'include':[{'model':db['Pause'],'as':_0xc294('0x2b')}]})[_0xc294('0x11')](handleEntityNotFound(_0x1dc773,null))[_0xc294('0x11')](saveUpdates(_0x25c9f0[_0xc294('0x49')],null))['then'](respondWithResult(_0x1dc773,null))[_0xc294('0x1c')](handleError(_0x1dc773,null));};exports[_0xc294('0x26')]=function(_0x16b943,_0x254e49){return db[_0xc294('0x2d')]['find']({'where':{'id':_0x16b943[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x254e49,null))[_0xc294('0x11')](removeEntity(_0x254e49,null))[_0xc294('0x1c')](handleError(_0x254e49,null));};exports[_0xc294('0x51')]=function(_0x13f29f,_0x5cc05e){return db[_0xc294('0x2d')][_0xc294('0x51')]()[_0xc294('0x11')](respondWithResult(_0x5cc05e,null))['catch'](handleError(_0x5cc05e,null));};exports[_0xc294('0x52')]=function(_0x411662,_0x20b951){if(_0x411662[_0xc294('0x49')]['id']){delete _0x411662[_0xc294('0x49')]['id'];}return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x411662[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x20b951,null))[_0xc294('0x11')](function(_0x283d9c){if(_0x283d9c){_0x411662[_0xc294('0x49')][_0xc294('0x53')]=_0x283d9c['id'];return db[_0xc294('0x54')]['create'](_0x411662[_0xc294('0x49')]);}})['then'](respondWithResult(_0x20b951,null))[_0xc294('0x1c')](handleError(_0x20b951,null));};exports[_0xc294('0x55')]=function(_0x50173a,_0x1463ef){var _0x13a924={'raw':![],'where':{}};var _0x10c8c0={};var _0x5ad592={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc294('0x56')]({'where':{'id':_0x50173a[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x1463ef,null))['then'](function(_0x563e12){if(_0x563e12){_0x10c8c0['model']=_[_0xc294('0x32')](db[_0xc294('0x54')][_0xc294('0x2e')]);_0x10c8c0[_0xc294('0x31')]=_[_0xc294('0x32')](_0x50173a[_0xc294('0x31')]);_0x10c8c0['filters']=_[_0xc294('0x34')](_0x10c8c0['model'],_0x10c8c0['query']);_0x13a924['attributes']=_['intersection'](_0x10c8c0['model'],qs[_0xc294('0x35')](_0x50173a['query']['fields']));_0x13a924['attributes']=_0x13a924[_0xc294('0x36')]['length']?_0x13a924[_0xc294('0x36')]:_0x10c8c0[_0xc294('0x33')];if(!_0x50173a[_0xc294('0x31')][_0xc294('0x38')](_0xc294('0x39'))){_0x13a924[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x50173a['query'][_0xc294('0x20')]);_0x13a924[_0xc294('0x22')]=qs[_0xc294('0x22')](_0x50173a[_0xc294('0x31')][_0xc294('0x22')]);}_0x13a924[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x50173a[_0xc294('0x31')]['sort']);_0x13a924[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_[_0xc294('0x3e')](_0x50173a[_0xc294('0x31')],_0x10c8c0['filters']));_0x13a924[_0xc294('0x3c')]['ChatWebsiteId']=_0x563e12['id'];if(_0x50173a[_0xc294('0x31')][_0xc294('0x3f')]){_0x13a924['where']=_[_0xc294('0x40')](_0x13a924[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0x13a924[_0xc294('0x36')],function(_0x369a32){var _0x51dd7a={};_0x51dd7a[_0x369a32]={'$like':'%'+_0x50173a[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0x51dd7a;})});}_0x13a924=_['merge']({},_0x13a924,_0x50173a['options']);return db[_0xc294('0x54')][_0xc294('0x21')]({'where':_0x13a924[_0xc294('0x3c')]})['then'](function(_0x56a8aa){_0x5ad592[_0xc294('0x21')]=_0x56a8aa;if(_0x50173a[_0xc294('0x31')]['includeAll']){_0x13a924['include']=[{'all':!![]}];}return db[_0xc294('0x54')][_0xc294('0x43')](_0x13a924);})[_0xc294('0x11')](function(_0x2ee621){_0x5ad592['rows']=_0x2ee621;return _0x5ad592;});}})[_0xc294('0x11')](respondWithFilteredResult(_0x1463ef,_0x13a924))[_0xc294('0x1c')](handleError(_0x1463ef,null));};exports['removeDispositions']=function(_0x4acdd5,_0x18881f){return db[_0xc294('0x2d')]['find']({'where':{'id':_0x4acdd5[_0xc294('0x46')]['id']}})['then'](handleEntityNotFound(_0x18881f,null))[_0xc294('0x11')](function(_0x2eadfe){if(_0x2eadfe){return _0x2eadfe[_0xc294('0x57')](_0x4acdd5[_0xc294('0x31')][_0xc294('0x58')]);}})[_0xc294('0x11')](respondWithStatusCode(_0x18881f,null))[_0xc294('0x1c')](handleError(_0x18881f,null));};exports[_0xc294('0x59')]=function(_0x22106d,_0x5db72b){if(_0x22106d[_0xc294('0x49')]['id']){delete _0x22106d[_0xc294('0x49')]['id'];}return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x22106d[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x5db72b,null))['then'](function(_0x38e858){if(_0x38e858){_0x22106d['body'][_0xc294('0x53')]=_0x38e858['id'];return db[_0xc294('0x5a')]['create'](_0x22106d['body']);}})[_0xc294('0x11')](respondWithResult(_0x5db72b,null))[_0xc294('0x1c')](handleError(_0x5db72b,null));};exports['getAnswers']=function(_0x208b46,_0x4b94cb){var _0x2ae666={'raw':![],'where':{}};var _0x24de6d={};var _0x345e1e={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x208b46[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x4b94cb,null))['then'](function(_0x16ec0b){if(_0x16ec0b){_0x24de6d[_0xc294('0x33')]=_['keys'](db[_0xc294('0x5a')]['rawAttributes']);_0x24de6d[_0xc294('0x31')]=_[_0xc294('0x32')](_0x208b46['query']);_0x24de6d['filters']=_[_0xc294('0x34')](_0x24de6d[_0xc294('0x33')],_0x24de6d[_0xc294('0x31')]);_0x2ae666['attributes']=_[_0xc294('0x34')](_0x24de6d[_0xc294('0x33')],qs[_0xc294('0x35')](_0x208b46['query'][_0xc294('0x35')]));_0x2ae666[_0xc294('0x36')]=_0x2ae666[_0xc294('0x36')][_0xc294('0x37')]?_0x2ae666[_0xc294('0x36')]:_0x24de6d[_0xc294('0x33')];if(!_0x208b46[_0xc294('0x31')][_0xc294('0x38')]('nolimit')){_0x2ae666['limit']=qs[_0xc294('0x20')](_0x208b46['query']['limit']);_0x2ae666['offset']=qs['offset'](_0x208b46[_0xc294('0x31')]['offset']);}_0x2ae666[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x208b46[_0xc294('0x31')][_0xc294('0x3b')]);_0x2ae666[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_[_0xc294('0x3e')](_0x208b46['query'],_0x24de6d['filters']));_0x2ae666[_0xc294('0x3c')][_0xc294('0x53')]=_0x16ec0b['id'];if(_0x208b46['query']['filter']){_0x2ae666[_0xc294('0x3c')]=_['merge'](_0x2ae666['where'],{'$or':_[_0xc294('0x2c')](_0x2ae666['attributes'],function(_0x33c688){var _0x243bae={};_0x243bae[_0x33c688]={'$like':'%'+_0x208b46['query'][_0xc294('0x3f')]+'%'};return _0x243bae;})});}_0x2ae666=_[_0xc294('0x40')]({},_0x2ae666,_0x208b46['options']);return db[_0xc294('0x5a')]['count']({'where':_0x2ae666['where']})[_0xc294('0x11')](function(_0x593898){_0x345e1e[_0xc294('0x21')]=_0x593898;if(_0x208b46[_0xc294('0x31')]['includeAll']){_0x2ae666['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2ae666);})[_0xc294('0x11')](function(_0x5a16d0){_0x345e1e[_0xc294('0x44')]=_0x5a16d0;return _0x345e1e;});}})[_0xc294('0x11')](respondWithFilteredResult(_0x4b94cb,_0x2ae666))[_0xc294('0x1c')](handleError(_0x4b94cb,null));};exports[_0xc294('0x5b')]=function(_0x2fdf14,_0x2e9deb){return db[_0xc294('0x2d')]['find']({'where':{'id':_0x2fdf14['params']['id']}})['then'](handleEntityNotFound(_0x2e9deb,null))['then'](function(_0x5b2a16){if(_0x5b2a16){return _0x5b2a16[_0xc294('0x5b')](_0x2fdf14[_0xc294('0x31')][_0xc294('0x58')]);}})[_0xc294('0x11')](respondWithStatusCode(_0x2e9deb,null))[_0xc294('0x1c')](handleError(_0x2e9deb,null));};exports['addLogo']=function(_0x57e83c,_0x1a9bdb){_0x57e83c[_0xc294('0x49')][_0xc294('0x5c')]=_0x57e83c[_0xc294('0x5d')][_0xc294('0x5e')];return db[_0xc294('0x2d')]['find']({'where':{'id':_0x57e83c[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x1a9bdb,null))['then'](saveUpdates(_0x57e83c['body'],null))[_0xc294('0x11')](respondWithResult(_0x1a9bdb,null))[_0xc294('0x1c')](handleError(_0x1a9bdb,null));};exports[_0xc294('0x5f')]=function(_0x51e4d2,_0x626218){_0x51e4d2['body'][_0xc294('0x60')]=_0x51e4d2['file'][_0xc294('0x5e')];return db[_0xc294('0x2d')]['find']({'where':{'id':_0x51e4d2[_0xc294('0x46')]['id']}})['then'](handleEntityNotFound(_0x626218,null))[_0xc294('0x11')](saveUpdates(_0x51e4d2[_0xc294('0x49')],null))['then'](respondWithResult(_0x626218,null))['catch'](handleError(_0x626218,null));};exports[_0xc294('0x61')]=function(_0xd8fb7d,_0x5efd26){_0xd8fb7d[_0xc294('0x49')]['customerAvatar']=_0xd8fb7d[_0xc294('0x5d')][_0xc294('0x5e')];return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0xd8fb7d['params']['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x5efd26,null))[_0xc294('0x11')](saveUpdates(_0xd8fb7d[_0xc294('0x49')],null))[_0xc294('0x11')](respondWithResult(_0x5efd26,null))[_0xc294('0x1c')](handleError(_0x5efd26,null));};exports[_0xc294('0x62')]=function(_0x5f1234,_0x31bcb9){_0x5f1234[_0xc294('0x49')][_0xc294('0x63')]=_0x5f1234[_0xc294('0x5d')][_0xc294('0x5e')];return db['ChatWebsite'][_0xc294('0x47')]({'where':{'id':_0x5f1234[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x31bcb9,null))[_0xc294('0x11')](saveUpdates(_0x5f1234[_0xc294('0x49')],null))[_0xc294('0x11')](respondWithResult(_0x31bcb9,null))['catch'](handleError(_0x31bcb9,null));};exports[_0xc294('0x64')]=function(_0x5e8dd5,_0x536ee4){var _0x122904=path[_0xc294('0x65')](config[_0xc294('0x66')],_0xc294('0x67'));var _0x1269ea={'where':{'id':_0x5e8dd5[_0xc294('0x46')]['id']},'attributes':['id',_0xc294('0x5c')],'raw':!![]};var _0x28db51=![];return require(_0xc294('0x68'))[_0xc294('0x69')]()[_0xc294('0x11')](function(_0x1fbdce){if(_0x1fbdce){_0x28db51=_0x1fbdce[_0xc294('0x6a')];}})[_0xc294('0x11')](function(){return db[_0xc294('0x2d')]['find'](_0x1269ea);})[_0xc294('0x11')](handleEntityNotFound(_0x536ee4,null))[_0xc294('0x11')](function(_0x257961){if(_0x257961){if(!_[_0xc294('0x6b')](_0x257961[_0xc294('0x5c')])){if(fs[_0xc294('0x6c')](path[_0xc294('0x65')](config['root'],_0xc294('0x6d'),_0x257961['sitepic']))&&_0x28db51){_0x122904=path['join'](config['root'],_0xc294('0x6d'),_0x257961[_0xc294('0x5c')]);}}return _0x536ee4[_0xc294('0x6e')](_0x122904);}})[_0xc294('0x1c')](handleError(_0x536ee4,null));};exports['getAvatar']=function(_0x402d9e,_0x2e590b){var _0x197d31=path[_0xc294('0x65')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x45e2a0={'where':{'id':_0x402d9e['params']['id']},'attributes':['id',_0xc294('0x60')],'raw':!![]};return db[_0xc294('0x2d')][_0xc294('0x47')](_0x45e2a0)[_0xc294('0x11')](handleEntityNotFound(_0x2e590b,null))[_0xc294('0x11')](function(_0x157ef0){if(_0x157ef0){if(!_[_0xc294('0x6b')](_0x157ef0[_0xc294('0x60')])){if(fs[_0xc294('0x6c')](path['join'](config[_0xc294('0x66')],_0xc294('0x6f'),_0x157ef0[_0xc294('0x60')]))){_0x197d31=path[_0xc294('0x65')](config[_0xc294('0x66')],'server/files/images/avatars/',_0x157ef0[_0xc294('0x60')]);}}return _0x2e590b['download'](_0x197d31);}})[_0xc294('0x1c')](handleError(_0x2e590b,null));};exports[_0xc294('0x70')]=function(_0x3077b7,_0x56c08f){var _0x2416ba=path[_0xc294('0x65')](config[_0xc294('0x66')],_0xc294('0x71'));var _0x3711ea={'where':{'id':_0x3077b7[_0xc294('0x46')]['id']},'attributes':['id',_0xc294('0x72'),'showCustomerAvatar'],'raw':!![]};return db[_0xc294('0x2d')]['find'](_0x3711ea)[_0xc294('0x11')](handleEntityNotFound(_0x56c08f,null))[_0xc294('0x11')](function(_0x4e9428){if(_0x4e9428){if(!_[_0xc294('0x6b')](_0x4e9428[_0xc294('0x72')])){if(fs[_0xc294('0x6c')](path[_0xc294('0x65')](config[_0xc294('0x66')],'server/files/images/avatars/',_0x4e9428[_0xc294('0x72')]))&&_0x4e9428[_0xc294('0x73')]){_0x2416ba=path['join'](config[_0xc294('0x66')],_0xc294('0x6f'),_0x4e9428['customerAvatar']);}}return _0x56c08f[_0xc294('0x6e')](_0x2416ba);}})[_0xc294('0x1c')](handleError(_0x56c08f,null));};exports[_0xc294('0x74')]=function(_0x2e8eeb,_0x55181c){var _0x1af7fd=path[_0xc294('0x65')](config[_0xc294('0x66')],_0xc294('0x75'));var _0x30af10={'where':{'id':_0x2e8eeb[_0xc294('0x46')]['id']},'attributes':['id',_0xc294('0x63')],'raw':!![]};return db[_0xc294('0x2d')][_0xc294('0x47')](_0x30af10)['then'](handleEntityNotFound(_0x55181c,null))[_0xc294('0x11')](function(_0x199c0a){if(_0x199c0a){if(!_['isNil'](_0x199c0a[_0xc294('0x63')])){if(fs[_0xc294('0x6c')](path[_0xc294('0x65')](config['root'],_0xc294('0x6f'),_0x199c0a['systemAvatar']))){_0x1af7fd=path[_0xc294('0x65')](config['root'],_0xc294('0x6f'),_0x199c0a[_0xc294('0x63')]);}}return _0x55181c[_0xc294('0x6e')](_0x1af7fd);}})[_0xc294('0x1c')](handleError(_0x55181c,null));};exports[_0xc294('0x76')]=function(_0x105a37,_0x555ba9){var _0x3219ce=require(_0xc294('0x77'));var _0xd95412=new _0x3219ce();var _0x46c1f5=_0xd95412[_0xc294('0x78')](_0x105a37[_0xc294('0x79')]['user-agent'])[_0xc294('0x7a')]();var _0x55b468={'body':_0x105a37[_0xc294('0x49')],'channel':'chat'};var _0x5a7609=[];var _0x4f38ea=[];var _0x5ab24a={};var _0x4a4204=![];return db[_0xc294('0x7b')]['describe']()[_0xc294('0x11')](function(_0x346761){if(!_0x346761){throw new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0x7e'));}_0x5a7609=_[_0xc294('0x7f')](_[_0xc294('0x32')](_0x346761),[_0xc294('0x80'),_0xc294('0x81')]);_0x4f38ea=_[_0xc294('0x7f')](_[_0xc294('0x32')](_0x346761),[_0xc294('0x80'),_0xc294('0x81'),_0xc294('0x82'),'ListId']);if(_0x105a37[_0xc294('0x49')]['id']){delete _0x105a37[_0xc294('0x49')]['id'];}if(_[_0xc294('0x6b')](_0x105a37[_0xc294('0x49')][_0xc294('0x83')])){throw new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0x84'));}if(_[_0xc294('0x6b')](_0x105a37['body'][_0xc294('0x49')])||_0x105a37[_0xc294('0x49')][_0xc294('0x49')]===''){throw new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0x85'));}if(_[_0xc294('0x6b')](_0x105a37[_0xc294('0x49')][_0xc294('0x86')])){throw new db['Sequelize']['ValidationError'](_0xc294('0x87')+_0x4f38ea);}if(!_[_0xc294('0x88')](_0x4f38ea,_0x105a37[_0xc294('0x49')][_0xc294('0x86')])){throw new db['Sequelize'][(_0xc294('0x7d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f38ea);}_0x5ab24a[_0x105a37[_0xc294('0x49')][_0xc294('0x86')]]=_0x105a37['body'][_0xc294('0x83')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x105a37[_0xc294('0x46')]['id']},'include':[{'model':db[_0xc294('0x89')],'as':_0xc294('0x8a'),'include':[{'model':db['CmContact'],'as':_0xc294('0x8b'),'where':_0x5ab24a,'limit':0x1,'order':[[_0xc294('0x81'),_0xc294('0x8c')]]}]},{'model':db['ChatApplication'],'as':_0xc294('0x8d')}]});})[_0xc294('0x11')](handleEntityNotFound(_0x555ba9,null))['then'](function(_0x9eea3){if(_0x9eea3&&_0x9eea3[_0xc294('0x8a')]){_0x55b468['account']=_0x9eea3;_0x55b468[_0xc294('0x8e')]=_0x9eea3[_0xc294('0x8d')];_0x55b468[_0xc294('0x8f')]=_0x9eea3[_0xc294('0x8a')];_0x55b468[_0xc294('0x8e')]=_[_0xc294('0x90')](_0x55b468['applications'],[_0xc294('0x91')],[_0xc294('0x92')]);if(_0x55b468['account'][_0xc294('0x8d')]){delete _0x55b468['account'][_0xc294('0x8d')];}if(_0x55b468[_0xc294('0x93')]['List']&&_0x55b468[_0xc294('0x93')]['List']['Contacts'][_0xc294('0x37')]){return _0x55b468[_0xc294('0x93')][_0xc294('0x8a')]['Contacts'][0x0];}var _0x29eaf3=_[_0xc294('0x94')](_0x105a37[_0xc294('0x49')],{'firstName':_0x105a37[_0xc294('0x49')][_0xc294('0x83')],'ListId':_0x9eea3[_0xc294('0x95')]});_0x29eaf3[_0x105a37[_0xc294('0x49')][_0xc294('0x86')]]=_0x105a37[_0xc294('0x49')][_0xc294('0x83')];return db['CmContact'][_0xc294('0x48')](_0x29eaf3,{'fields':_0x5a7609,'raw':!![]});}})[_0xc294('0x11')](handleEntityNotFound(_0x555ba9,null))[_0xc294('0x11')](function(_0xfe6bfe){_0x55b468['contact']=_0xfe6bfe;var _0x1ce46=_0x105a37[_0xc294('0x49')][_0xc294('0x96')];if(_0x105a37['headers']['cf-connecting-ip']){_0x1ce46=_0x105a37['headers'][_0xc294('0x97')];}else if(_0x105a37['headers'][_0xc294('0x98')]){_0x1ce46=_[_0xc294('0x99')](_0x105a37[_0xc294('0x79')][_0xc294('0x98')][_0xc294('0x9a')](','));}if(_0xfe6bfe){var _0x244b7e={'ContactId':_0xfe6bfe['id'],'ChatWebsiteId':_0x105a37[_0xc294('0x46')]['id'],'from':(_0xfe6bfe[_0xc294('0x9b')]||'')+'\x20'+(_0xfe6bfe[_0xc294('0x9c')]||''),'customerIp':_0x1ce46,'customerPort':_0x105a37['headers'][_0xc294('0x9d')]?_0x105a37[_0xc294('0x79')][_0xc294('0x9d')]:null,'referer':_0x105a37[_0xc294('0x49')][_0xc294('0x9e')],'browserName':_0x46c1f5[_0xc294('0x9f')][_0xc294('0x28')]&&_0x46c1f5[_0xc294('0x9f')][_0xc294('0xa0')]?util['format']('%s\x20%s',_0x46c1f5['browser'][_0xc294('0x28')],_0x46c1f5[_0xc294('0x9f')][_0xc294('0xa0')]):'unknown','browserVersion':_0x46c1f5['browser'][_0xc294('0xa0')]||_0xc294('0xa1'),'osName':util[_0xc294('0xa2')]('%s\x20%s',_0x46c1f5['os'][_0xc294('0x28')],_0x46c1f5['os']['version']),'osVersion':_0x46c1f5['os']['version'],'deviceModel':_0x46c1f5[_0xc294('0xa3')][_0xc294('0x33')]&&_0x46c1f5[_0xc294('0xa3')][_0xc294('0xa4')]?util[_0xc294('0xa2')](_0xc294('0xa5'),_0x46c1f5[_0xc294('0xa3')][_0xc294('0x33')],_0x46c1f5[_0xc294('0xa3')][_0xc294('0xa4')],_0x46c1f5[_0xc294('0xa3')][_0xc294('0xa6')]):null,'deviceVendor':_0x46c1f5['device'][_0xc294('0xa4')],'deviceType':_0x46c1f5['device']['type'],'formData':JSON[_0xc294('0x17')](_0x105a37[_0xc294('0x49')])};var _0x12d0fc={'ChatWebsiteId':_0x105a37['params']['id'],'closed':![]};if(_0x105a37['body'][_0xc294('0xa7')]){_0x12d0fc[_0xc294('0xa7')]=_0x105a37[_0xc294('0x49')][_0xc294('0xa7')];return db[_0xc294('0xa8')][_0xc294('0x47')]({'where':_0x12d0fc})['then'](function(_0x529509){if(_0x529509){return[_0x529509,![]];}_0x244b7e[_0xc294('0xa7')]=_0x105a37[_0xc294('0x49')][_0xc294('0xa7')];_0x244b7e[_0xc294('0xa9')]=_0x105a37[_0xc294('0x49')][_0xc294('0xa9')];return db[_0xc294('0xa8')][_0xc294('0x48')](_0x244b7e)[_0xc294('0x11')](function(_0x74b876){return[_0x74b876,!![]];});});}_0x12d0fc['ContactId']=_0xfe6bfe['id'];if(_0x105a37['body'][_0xc294('0xaa')]&&_0x105a37['body'][_0xc294('0xaa')]['id']){_0x12d0fc['id']=_0x105a37[_0xc294('0x49')]['interaction']['id'];return db['ChatInteraction'][_0xc294('0x47')]({'where':_0x12d0fc})[_0xc294('0x11')](function(_0x1a0b88){if(_0x1a0b88){return[_0x1a0b88,![]];}return db['ChatInteraction'][_0xc294('0x48')](_0x244b7e)[_0xc294('0x11')](function(_0x34995b){return[_0x34995b,!![]];});});}return db[_0xc294('0xa8')][_0xc294('0x48')](_0x244b7e)[_0xc294('0x11')](function(_0x1e0148){return[_0x1e0148,!![]];});}})[_0xc294('0xab')](function(_0x5af200,_0x19e9f0){if(_0x5af200){_0x4a4204=_0x19e9f0;if(!_0x19e9f0){var _0x10a593={'from':(_0x55b468[_0xc294('0xac')][_0xc294('0x9b')]||'')+'\x20'+(_0x55b468[_0xc294('0xac')][_0xc294('0x9c')]||'')};if(_0x105a37[_0xc294('0x49')][_0xc294('0xa7')]&&_0x105a37[_0xc294('0x49')][_0xc294('0xad')]&&_0x105a37[_0xc294('0x49')][_0xc294('0xa7')]!=_0x105a37['body'][_0xc294('0xad')]){_0x10a593[_0xc294('0xa7')]=_0x105a37[_0xc294('0x49')][_0xc294('0xad')];}return _0x5af200[_0xc294('0x50')](_0x10a593);}else{return _0x5af200;}}})[_0xc294('0x11')](function(_0x1d3a29){_0x55b468[_0xc294('0xaa')]=_0x1d3a29['get']({'plain':!![]});_0x55b468[_0xc294('0xaa')]['created']=_0x4a4204;if(_0x55b468['interaction'][_0xc294('0xae')]){if(_0x55b468['account'][_0xc294('0xaf')]){_0x55b468[_0xc294('0x8e')][_0xc294('0xb0')]({'id':0x0,'priority':_0x55b468[_0xc294('0x8e')]['length']+0x1,'app':_0xc294('0xb1'),'appdata':_0xc294('0xb2'),'interval':_0xc294('0xb3')});}}return db[_0xc294('0xb4')][_0xc294('0x48')]({'body':_0x105a37[_0xc294('0x49')]['body'],'ChatWebsiteId':_0x105a37[_0xc294('0x46')]['id'],'ChatInteractionId':_0x1d3a29['id'],'direction':'in','ContactId':_0x55b468[_0xc294('0xac')]['id'],'AttachmentId':_0x105a37[_0xc294('0x49')][_0xc294('0xb5')]});})['then'](function(_0x9e4dd3){_0x55b468[_0xc294('0x1a')]=_0x9e4dd3;if(_0x55b468[_0xc294('0xaa')][_0xc294('0xb6')]){return db[_0xc294('0xb7')][_0xc294('0x47')]({'attributes':['id',_0xc294('0x28')],'where':{'id':_0x55b468['interaction'][_0xc294('0xb6')]}})[_0xc294('0x11')](function(_0x297739){if(_0x297739){_0x55b468[_0xc294('0x8e')][_0xc294('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x297739['name']+','+(_0x55b468[_0xc294('0x93')][_0xc294('0xb9')]||0xa),'interval':_0xc294('0xb3')});_0x55b468[_0xc294('0xba')]=!![];}return respondWithRpcPromise(_0xc294('0xbb'),_0xc294('0xbc'),_0x55b468);});}return respondWithRpcPromise(_0xc294('0xbb'),_0xc294('0xbc'),_0x55b468);})[_0xc294('0x11')](function(_0x73e46e){respondWithRpcPromise(_0xc294('0xbd'),'EventManager',{'event':_0xc294('0x76'),'message':_0x73e46e},client9002);return _0x73e46e;})[_0xc294('0x11')](respondWithResult(_0x555ba9,null))[_0xc294('0x1c')](handleError(_0x555ba9,null));};exports[_0xc294('0xbe')]=function(_0x5de590,_0x2d5564){var _0xd3cc05,_0x40639e,_0x5b38b3;var _0x59c9b1=[];var _0x139e1b={};var _0x1874a1=_0x5de590[_0xc294('0xbf')]||[];var _0xe53db5=[];var _0x533169;return db['CmContact'][_0xc294('0x51')]()[_0xc294('0x11')](function(_0x2dffa1){if(!_0x2dffa1){throw new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0x7e'));}_0x59c9b1=_[_0xc294('0x7f')](_['keys'](_0x2dffa1),[_0xc294('0x80'),_0xc294('0x81'),'CompanyId','ListId']);if(_0x5de590[_0xc294('0x49')]['id']){delete _0x5de590['body']['id'];}if(_['isNil'](_0x5de590[_0xc294('0x49')]['from'])){throw _0x2d5564[_0xc294('0x1e')](0x1f4)['send'](new db['Sequelize'][(_0xc294('0x7d'))](_0xc294('0x84')));}if(_['isNil'](_0x5de590[_0xc294('0x49')][_0xc294('0x49')])||_0x5de590[_0xc294('0x49')][_0xc294('0x49')]===''){throw _0x2d5564['status'](0x1f4)[_0xc294('0x29')](new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0x85')));}if(_[_0xc294('0x6b')](_0x5de590[_0xc294('0x49')][_0xc294('0xc0')])){throw _0x2d5564[_0xc294('0x1e')](0x1f4)['send'](new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0xc1')+_0x59c9b1));}if(!_[_0xc294('0x88')](_0x59c9b1,_0x5de590[_0xc294('0x49')][_0xc294('0xc0')])){throw _0x2d5564[_0xc294('0x1e')](0x1f4)[_0xc294('0x29')](new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0xc2')+_0x59c9b1));}_0x139e1b[_0x5de590[_0xc294('0x49')][_0xc294('0xc0')]]=_0x5de590[_0xc294('0x49')][_0xc294('0x83')];})[_0xc294('0x11')](function(){return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x5de590[_0xc294('0x46')]['id']},'include':[{'model':db[_0xc294('0x89')],'as':_0xc294('0x8a')},{'model':db[_0xc294('0xc3')],'as':'MailAccount'}]});})[_0xc294('0x11')](handleEntityNotFound(_0x2d5564,null))[_0xc294('0x11')](function(_0x5ad9d8){if(_0x5ad9d8&&_0x5ad9d8[_0xc294('0x8a')]){_0x40639e=_0x5ad9d8;var _0x4ea485=_['defaults'](_0x5de590[_0xc294('0x49')],{'firstName':_0x5de590[_0xc294('0x49')][_0xc294('0x83')],'phone':_0x5de590[_0xc294('0x49')]['from'],'ListId':_0x5ad9d8[_0xc294('0x95')]});_0x4ea485[_0x5de590[_0xc294('0x49')][_0xc294('0xc0')]]=_0x5de590[_0xc294('0x49')][_0xc294('0x83')];return db['CmContact']['findOrCreate']({'where':_0x139e1b,'defaults':_0x4ea485});}})[_0xc294('0xab')](function(_0x277270){if(_0x277270){_0x5b38b3=_0x277270;var _0x37ed20=fs['readFileSync'](path['join'](config[_0xc294('0x66')],_0xc294('0xc4')),_0xc294('0xc5'));var _0x25e216=ejs[_0xc294('0xc6')](_0x37ed20,{'body':_[_0xc294('0xc7')](_0x5de590[_0xc294('0x49')][_0xc294('0x49')]),'bodyTitle':_0x40639e[_0xc294('0xc8')]});return db[_0xc294('0xc9')]['create']({'body':_0x25e216,'plainBody':htmlToText['fromString'](_0x25e216),'ContactId':_0x277270['id'],'ChatWebsiteId':_0x40639e['id']});}})[_0xc294('0x11')](function(_0x36c076){_0x533169=_0x36c076;if(_0x1874a1[_0xc294('0x37')]){var _0x36120b=_0x1874a1['map'](function(_0x39f897){return{'name':_0x39f897['originalname'],'basename':_0x39f897[_0xc294('0x5e')],'type':_0x39f897[_0xc294('0xca')],'ChatOfflineMessageId':_0x36c076['id']};});_0xe53db5=_0x36120b[_0xc294('0x2c')](_0x2e2422=>{var _0x511212={'filename':_0x2e2422['name'],'path':path[_0xc294('0x65')](config['root'],_0xc294('0xcb'),'files',_0xc294('0xcc'),_0xc294('0xcd'),_0x2e2422[_0xc294('0xce')])};return _0x511212;});if(!_0x40639e[_0xc294('0xcf')]){return db[_0xc294('0xd0')][_0xc294('0xd1')](function(_0x1424fc){return db[_0xc294('0xd2')][_0xc294('0xd3')](_0x36120b,{'transaction':_0x1424fc});});}}})['then'](function(){if(_0x533169){_0xd3cc05=_0x533169;return db['MailAccount'][_0xc294('0x56')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc294('0xd4'),'raw':!![],'include':[{'model':db[_0xc294('0xd5')],'as':_0xc294('0xd5'),'raw':!![]}]}]});}})['then'](function(_0x2713f8){if(_0x2713f8&&_0x2713f8[_0xc294('0xd4')]&&_0x40639e[_0xc294('0xd6')]&&_0x40639e[_0xc294('0xd7')]){var _0xd5944b=_0x2713f8[_0xc294('0xd8')]();return respondWithRpcPromise(_0xc294('0xd9'),_0xc294('0xda'),{'account':_0xd5944b,'message':{'from':util[_0xc294('0xa2')](_0xc294('0xdb'),_0x2713f8[_0xc294('0x28')],_0x2713f8[_0xc294('0xdc')]||_0x2713f8[_0xc294('0xd4')][_0xc294('0x4a')]),'to':_0x40639e[_0xc294('0xd7')],'subject':_0x40639e['offlineMessageSubject'],'html':_0xd3cc05['body'],'attachments':_0xe53db5}},client9003)[_0xc294('0x11')](function(){return _0xd3cc05;})[_0xc294('0x1c')](function(_0x2be2b0){logger[_0xc294('0x18')](_0x2be2b0);});}})[_0xc294('0x11')](function(){if(_0x40639e&&_0x40639e[_0xc294('0xcf')]&&_0x40639e[_0xc294('0xdd')]){var _0x319c2d=[];if(_0x1874a1[_0xc294('0x37')]){_0x319c2d=_0x1874a1[_0xc294('0x2c')](function(_0x58dcb9){return{'name':_0x58dcb9[_0xc294('0xde')],'basename':_0x58dcb9[_0xc294('0x5e')],'type':_0x58dcb9[_0xc294('0xca')],'ChatOfflineMessageId':_0x533169['id']};});}var _0x3d14cb;if(!_[_0xc294('0x6b')](_0x40639e['subjectOffline'])){var _0x4bd03a=_[_0xc294('0x2c')](_0x5de590['body'],function(_0x3cf8a0){return _0x3cf8a0;});var _0x19d65b=_['toPairsIn'](_0x4bd03a)[0x0];var _0x4ef4f4=_[_0xc294('0xdf')](_0x19d65b,function(_0x44bdae){return _0x44bdae;});_0x3d14cb=_0x4ef4f4[0x1][_0x40639e[_0xc294('0xe0')]];}var _0x48e9b3={'from':_0x5b38b3[_0xc294('0xdc')],'firstName':_0x5b38b3[_0xc294('0x9b')],'lastName':_0x5b38b3[_0xc294('0x9c')],'mapKey':_0xc294('0xdc'),'message':{'from':_0x5b38b3[_0xc294('0xdc')],'to':_0x40639e[_0xc294('0xc3')][_0xc294('0xdc')],'cc':'','subject':_[_0xc294('0x6b')](_0x3d14cb)?_0x40639e[_0xc294('0xe1')]:_0x3d14cb,'messageId':'','sentAt':new Date(),'attach':_0x319c2d[_0xc294('0x37')],'attachments':_0x319c2d,'originChannel':'Chat','ChatWebsiteId':_0x40639e['id'],'ChatOfflineMessageId':_0xd3cc05['id'],'originTo':_0x40639e[_0xc294('0xc3')][_0xc294('0xdc')]},'body':_0xd3cc05[_0xc294('0x49')]};var _0x1e8f04={'account':{'id':_0x40639e[_0xc294('0xdd')]},'body':_0x48e9b3,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xc294('0xe2'),_0x1e8f04,client9001)['then'](function(){return _0xd3cc05;})[_0xc294('0x1c')](function(_0x2b0c65){logger[_0xc294('0x18')](_0x2b0c65);});}return;})[_0xc294('0x11')](function(){if(_0xd3cc05){return _0xd3cc05;}})[_0xc294('0x11')](respondWithResult(_0x2d5564,null))[_0xc294('0x1c')](function(_0xc6f6d8){logger['error'](_0xc294('0x1c'),_0xc6f6d8);for(var _0x59c65e of _0x1874a1){var _0x3c2a85=path['join'](config[_0xc294('0x66')],'server',_0xc294('0xbf'),_0xc294('0xcc'),'offline-chat',_0x59c65e[_0xc294('0x5e')]);fs_extra[_0xc294('0xe3')](_0x3c2a85)['catch'](function(_0x304c11){logger[_0xc294('0x18')](_0xc294('0xe4'),_0x3c2a85,_0x304c11);});}});};exports[_0xc294('0xe5')]=function(_0x1b3bf3,_0x3a1d00){return db['ChatInteraction'][_0xc294('0x47')]({'where':{'id':_0x1b3bf3[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x3a1d00,null))[_0xc294('0x11')](function(_0x2103a7){if(_0x2103a7){return _0x2103a7[_0xc294('0xe5')](_0x1b3bf3[_0xc294('0x49')][_0xc294('0x58')],_[_0xc294('0xe6')](_0x1b3bf3[_0xc294('0x49')],[_0xc294('0x58'),'id'])||{});}})['then'](respondWithResult(_0x3a1d00,null))['catch'](handleError(_0x3a1d00,null));};exports[_0xc294('0xe7')]=function(_0x47f2ef,_0x3cfe68){var _0x38a69d={'raw':![],'where':{}};var _0x4e41d3={};var _0x5776db={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x47f2ef[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x3cfe68,null))['then'](function(_0x28febe){if(_0x28febe){_0x4e41d3[_0xc294('0x33')]=_['keys'](db['ChatInteraction'][_0xc294('0x2e')]);_0x4e41d3[_0xc294('0x31')]=_[_0xc294('0x32')](_0x47f2ef[_0xc294('0x31')]);_0x4e41d3[_0xc294('0x3d')]=_[_0xc294('0x34')](_0x4e41d3['model'],_0x4e41d3[_0xc294('0x31')]);_0x38a69d[_0xc294('0x36')]=_[_0xc294('0x34')](_0x4e41d3[_0xc294('0x33')],qs[_0xc294('0x35')](_0x47f2ef[_0xc294('0x31')][_0xc294('0x35')]));_0x38a69d[_0xc294('0x36')]=_0x38a69d['attributes'][_0xc294('0x37')]?_0x38a69d[_0xc294('0x36')]:_0x4e41d3['model'];if(!_0x47f2ef['query']['hasOwnProperty']('nolimit')){_0x38a69d[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x47f2ef[_0xc294('0x31')][_0xc294('0x20')]);_0x38a69d[_0xc294('0x22')]=qs['offset'](_0x47f2ef[_0xc294('0x31')][_0xc294('0x22')]);}_0x38a69d['order']=qs[_0xc294('0x3b')](_0x47f2ef[_0xc294('0x31')][_0xc294('0x3b')]);_0x38a69d[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_[_0xc294('0x3e')](_0x47f2ef[_0xc294('0x31')],_0x4e41d3[_0xc294('0x3d')]));_0x38a69d[_0xc294('0x3c')][_0xc294('0x53')]=_0x28febe['id'];if(_0x47f2ef[_0xc294('0x31')][_0xc294('0x3f')]){_0x38a69d['where']=_[_0xc294('0x40')](_0x38a69d[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0x38a69d['attributes'],function(_0x26f782){var _0xaafad5={};_0xaafad5[_0x26f782]={'$like':'%'+_0x47f2ef[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0xaafad5;})});}_0x38a69d=_[_0xc294('0x40')]({},_0x38a69d,_0x47f2ef['options']);return db['ChatInteraction'][_0xc294('0x21')]({'where':_0x38a69d[_0xc294('0x3c')]})[_0xc294('0x11')](function(_0x1df591){_0x5776db[_0xc294('0x21')]=_0x1df591;if(_0x47f2ef[_0xc294('0x31')][_0xc294('0xe8')]){_0x38a69d[_0xc294('0x42')]=[{'model':db[_0xc294('0x7b')],'as':_0xc294('0xe9'),'required':![]},{'model':db[_0xc294('0xb7')],'as':_0xc294('0xea'),'attributes':[_0xc294('0x28'),_0xc294('0xeb'),_0xc294('0xec')],'required':![]},{'model':db[_0xc294('0xed')],'as':_0xc294('0xee'),'attributes':['id',_0xc294('0x28'),_0xc294('0xef')],'where':_0x47f2ef[_0xc294('0x31')][_0xc294('0xf0')]?{'id':_0x47f2ef[_0xc294('0x31')][_0xc294('0xf0')]}:undefined,'required':_0x47f2ef['query'][_0xc294('0xf0')]?!![]:![]}];}return db['ChatInteraction'][_0xc294('0x43')](_0x38a69d);})['then'](function(_0x1a2ab6){_0x5776db[_0xc294('0x44')]=_0x1a2ab6;return _0x5776db;});}})[_0xc294('0x11')](respondWithFilteredResult(_0x3cfe68,_0x38a69d))[_0xc294('0x1c')](handleError(_0x3cfe68,null));};function iftimePromise(_0x143bf6,_0x28b388){return respondWithRpcPromise('Command',_0xc294('0xf1'),{'command':_0x28b388[_0xc294('0xf2')]?util[_0xc294('0xa2')]('iftime\x20%s,%s',_0x143bf6[_0xc294('0xf3')],_0x28b388[_0xc294('0xf2')]):util['format'](_0xc294('0xf4'),_0x143bf6[_0xc294('0xf3')])},client9002)['then'](function(_0x4298a4){var _0x3a1f24=_0x4298a4&&_0x4298a4[_0xc294('0xf5')]('true')>=0x0?!![]:![];logger['info'](_0xc294('0xf6'),_0x28b388['id'],_0x143bf6['id'],_0x143bf6[_0xc294('0xf3')],_0x3a1f24?_0xc294('0xf7'):'OFFLINE',_0x28b388[_0xc294('0xf2')]?_0x28b388['timezone']:_0xc294('0xf8'));return _0x3a1f24;})['catch'](function(_0x5492c6){logger[_0xc294('0x18')](_0xc294('0xf6'),_0x28b388['id'],_0x143bf6['id'],_0x143bf6[_0xc294('0xf3')],util[_0xc294('0xf9')](_0x5492c6,{'showHidden':![],'depth':null}),_0x28b388['timezone']?_0x28b388[_0xc294('0xf2')]:_0xc294('0xf8'));return![];});}exports[_0xc294('0xf1')]=function(_0x4c1bdb,_0x1dbc94){var _0x53f39e=0x0;var _0x5b2b2a=0x0;var _0x5794ed=![];var _0x345ceb;var _0x16b007;return db[_0xc294('0x2d')]['find']({'where':{'id':_0x4c1bdb[_0xc294('0x46')]['id']},'include':[{'model':db[_0xc294('0xfa')],'as':_0xc294('0xfa'),'include':[{'model':db['Interval'],'as':_0xc294('0xfb'),'attributes':['id',_0xc294('0xf3')],'raw':!![]}]}]})[_0xc294('0x11')](handleEntityNotFound(_0x1dbc94,null))[_0xc294('0x11')](function(_0x2f3895){if(_0x2f3895){_0x345ceb=_0x2f3895;return _0x2f3895[_0xc294('0xfc')]({'raw':!![]});}})[_0xc294('0x11')](function(_0x38b28e){if(_0x345ceb){if(_0x38b28e){_0x16b007=_0x38b28e;}}return require(_0xc294('0x68'))['getLicense']();})['then'](function(_0x3ee545){if(_0x3ee545){_0x5b2b2a=_0x3ee545[_0xc294('0xfd')];_0x5794ed=_0x3ee545['custom'];}})[_0xc294('0x11')](function(){return db[_0xc294('0xa8')][_0xc294('0x21')]({'where':{'closed':![]}});})[_0xc294('0x11')](function(_0xd4a0e7){_0x53f39e=_0xd4a0e7;if(_0x5b2b2a&&_0xd4a0e7>_0x5b2b2a){return db[_0xc294('0xfe')]['findOne']({'where':{'id':0x1}})[_0xc294('0x11')](function(_0x148a4e){if(_0x148a4e){_0x148a4e['increment'](_0xc294('0xff'));}});}})['then'](function(){if(_0x345ceb['Interval']&&_0x345ceb[_0xc294('0xfa')][_0xc294('0xfb')]){var _0x542e4c=[];for(var _0x158361=0x0;_0x158361<_0x345ceb[_0xc294('0xfa')][_0xc294('0xfb')]['length'];_0x158361++){var _0x3fbfbc=_0x345ceb['Interval'][_0xc294('0xfb')][_0x158361][_0xc294('0x24')]({'plain':!![]});_0x542e4c['push'](iftimePromise(_0x3fbfbc,_0x345ceb));}return BPromise[_0xc294('0x100')](_0x542e4c)['then'](function(_0x1e243f){return _[_0xc294('0x101')](_0x1e243f);});}else{return!![];}})['then'](function(_0x4887ef){var _0x17bfb6=fs[_0xc294('0x102')](path[_0xc294('0x65')](config[_0xc294('0x66')],'server/files/chat/iframe.ejs'),_0xc294('0xc5'));var _0x2e6490={'remote':_0x345ceb[_0xc294('0x103')],'query':querystring[_0xc294('0x17')](_[_0xc294('0x40')](_0x345ceb[_0xc294('0x24')]({'plain':!![]}),{'customerIp':_0x4c1bdb[_0xc294('0x79')]['x-forwarded-for']||_0x4c1bdb[_0xc294('0x79')][_0xc294('0x104')]||_0x4c1bdb[_0xc294('0x105')][_0xc294('0x106')]||_0x4c1bdb['ip'],'referer':_0x4c1bdb[_0xc294('0x79')]['referer'],'openedInteractions':_0x53f39e,'maxInteractions':_0x5b2b2a,'virtual':_0x5794ed[_0xc294('0xfd')],'online':_0x4887ef,'custom':_0x5794ed}))[_0xc294('0x107')](/'/g,'\x5c\x27')};_0x1dbc94[_0xc294('0x29')](ejs[_0xc294('0xc6')](Mustache[_0xc294('0xc6')](_0x17bfb6,_0x2e6490),{'proactiveActions':_0x16b007,'alignment':_0x345ceb[_0xc294('0x108')],'verticalAlignment':_0x345ceb[_0xc294('0x109')],'div_color':_0x345ceb['color'],'labelText':_0x345ceb[_0xc294('0x10a')],'text_color':_0x345ceb['textColor'],'text_button_color':_0x345ceb[_0xc294('0x10b')],'button_color':_0x345ceb['color_button'],'background_color':_0x345ceb[_0xc294('0x10c')],'hideWhenOffline':_0x345ceb[_0xc294('0x10d')],'interval':_0x345ceb[_0xc294('0x10e')]}));})['catch'](handleError(_0x1dbc94,null));};exports[_0xc294('0x10f')]=function(_0x3ced78,_0xecfb28){var _0x2141cb=_0x3ced78[_0xc294('0x46')]['id'];var _0x54b563=_0x3ced78['body'];var _0x5ec1a0=0xc8;var _0x361e7a=null;return db[_0xc294('0xd0')]['transaction']({'isolationLevel':db[_0xc294('0xd0')][_0xc294('0x110')]['ISOLATION_LEVELS'][_0xc294('0x111')]},function(_0x1cacbd){return db['ChatWebsite'][_0xc294('0x56')]({'where':{'id':_0x2141cb},'transaction':_0x1cacbd})['then'](function(_0x242065){if(_0x242065){return db[_0xc294('0x112')][_0xc294('0x26')]({'where':{'ChatWebsiteId':_0x2141cb},'transaction':_0x1cacbd})[_0xc294('0x11')](function(){var _0x56a866=_[_0xc294('0x2c')](_0x54b563,function(_0x34f230){_0x34f230[_0xc294('0x53')]=_0x2141cb;return _0x34f230;});return db[_0xc294('0x112')][_0xc294('0xd3')](_0x56a866,{'transaction':_0x1cacbd});});}else{_0x5ec1a0=0x194;_0x361e7a=[];}});})[_0xc294('0x11')](function(){if(_0x5ec1a0!==0x194){return db[_0xc294('0x112')][_0xc294('0x113')]({'where':{'ChatWebsiteId':_0x2141cb},'order':_0xc294('0x91')})['then'](function(_0x34782d){_0x361e7a=_0x34782d;});}})[_0xc294('0x1c')](function(_0x5d46e3){_0x5ec1a0=0x1f4;logger['error'](_0x5d46e3[_0xc294('0x114')]);if(_0x5d46e3[_0xc294('0x28')]){delete _0x5d46e3['name'];}_0x361e7a=_0x5d46e3;})[_0xc294('0x115')](function(){if(_0x361e7a===null){_0xecfb28[_0xc294('0x27')](_0x5ec1a0);}else{if(_0x5ec1a0===0x1f4){_0xecfb28[_0xc294('0x1e')](_0x5ec1a0)[_0xc294('0x29')](_0x361e7a);}else{_0xecfb28['status'](_0x5ec1a0)[_0xc294('0x116')](_0x361e7a);}}});};exports[_0xc294('0x117')]=function(_0x4d269e,_0x1079bd){var _0x2b195d={};var _0x24b50e={};var _0x18efb6;var _0x1771bd;return db[_0xc294('0x2d')][_0xc294('0x56')]({'where':{'id':_0x4d269e[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x1079bd,null))['then'](function(_0x108f7e){if(_0x108f7e){_0x18efb6=_0x108f7e;_0x24b50e[_0xc294('0x33')]=_[_0xc294('0x32')](db[_0xc294('0x112')][_0xc294('0x2e')]);_0x24b50e[_0xc294('0x31')]=_[_0xc294('0x32')](_0x4d269e[_0xc294('0x31')]);_0x24b50e[_0xc294('0x3d')]=_[_0xc294('0x34')](_0x24b50e[_0xc294('0x33')],_0x24b50e['query']);_0x2b195d[_0xc294('0x36')]=_[_0xc294('0x34')](_0x24b50e['model'],qs[_0xc294('0x35')](_0x4d269e[_0xc294('0x31')][_0xc294('0x35')]));_0x2b195d[_0xc294('0x36')]=_0x2b195d[_0xc294('0x36')][_0xc294('0x37')]?_0x2b195d['attributes']:_0x24b50e['model'];_0x2b195d[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x4d269e['query'][_0xc294('0x3b')]);_0x2b195d[_0xc294('0x3c')]=qs['filters'](_['pick'](_0x4d269e[_0xc294('0x31')],_0x24b50e['filters']));if(_0x4d269e['query'][_0xc294('0x3f')]){_0x2b195d['where']=_[_0xc294('0x40')](_0x2b195d[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0x2b195d[_0xc294('0x36')],function(_0x228b58){var _0x4291da={};_0x4291da[_0x228b58]={'$like':'%'+_0x4d269e[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0x4291da;})});}_0x2b195d=_[_0xc294('0x40')]({},_0x2b195d,_0x4d269e['options']);return _0x18efb6[_0xc294('0x117')](_0x2b195d);}})[_0xc294('0x11')](function(_0x2be65b){if(_0x2be65b){_0x1771bd=_0x2be65b[_0xc294('0x37')];if(!_0x4d269e[_0xc294('0x31')][_0xc294('0x38')](_0xc294('0x39'))){_0x2b195d[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x4d269e[_0xc294('0x31')][_0xc294('0x20')]);_0x2b195d[_0xc294('0x22')]=qs[_0xc294('0x22')](_0x4d269e[_0xc294('0x31')]['offset']);}return _0x18efb6[_0xc294('0x117')](_0x2b195d);}})[_0xc294('0x11')](function(_0x216d2e){if(_0x216d2e){return _0x216d2e?{'count':_0x1771bd,'rows':_0x216d2e}:null;}})[_0xc294('0x11')](respondWithResult(_0x1079bd,null))['catch'](handleError(_0x1079bd,null));};exports[_0xc294('0x118')]=function(_0x553164,_0x4fd031){return db[_0xc294('0x119')][_0xc294('0x47')]({'where':{'id':_0x553164[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x4fd031,null))[_0xc294('0x11')](function(_0x324aa7){if(_0x324aa7){return _0x324aa7[_0xc294('0x118')](_0x553164[_0xc294('0x49')]['ids'],_['omit'](_0x553164[_0xc294('0x49')],['ids','id'])||{});}})[_0xc294('0x11')](respondWithResult(_0x4fd031,null))[_0xc294('0x1c')](handleError(_0x4fd031,null));};exports[_0xc294('0xfc')]=function(_0x53e6b7,_0x5390e2){var _0x3b5e23={};var _0xdc7fb9={};var _0x51a0ff;var _0x3ae088;return db[_0xc294('0x2d')][_0xc294('0x56')]({'where':{'id':_0x53e6b7[_0xc294('0x46')]['id']}})['then'](handleEntityNotFound(_0x5390e2,null))[_0xc294('0x11')](function(_0x1147c1){if(_0x1147c1){_0x51a0ff=_0x1147c1;_0xdc7fb9[_0xc294('0x33')]=_[_0xc294('0x32')](db[_0xc294('0x11a')][_0xc294('0x2e')]);_0xdc7fb9[_0xc294('0x31')]=_[_0xc294('0x32')](_0x53e6b7[_0xc294('0x31')]);_0xdc7fb9['filters']=_[_0xc294('0x34')](_0xdc7fb9[_0xc294('0x33')],_0xdc7fb9['query']);_0x3b5e23[_0xc294('0x36')]=_[_0xc294('0x34')](_0xdc7fb9['model'],qs[_0xc294('0x35')](_0x53e6b7['query'][_0xc294('0x35')]));_0x3b5e23[_0xc294('0x36')]=_0x3b5e23['attributes'][_0xc294('0x37')]?_0x3b5e23[_0xc294('0x36')]:_0xdc7fb9[_0xc294('0x33')];_0x3b5e23['order']=qs['sort'](_0x53e6b7['query'][_0xc294('0x3b')]);_0x3b5e23[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_['pick'](_0x53e6b7['query'],_0xdc7fb9['filters']));if(_0x53e6b7[_0xc294('0x31')]['filter']){_0x3b5e23[_0xc294('0x3c')]=_['merge'](_0x3b5e23[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0x3b5e23[_0xc294('0x36')],function(_0x327101){var _0x2d8d3b={};_0x2d8d3b[_0x327101]={'$like':'%'+_0x53e6b7[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0x2d8d3b;})});}_0x3b5e23=_[_0xc294('0x40')]({},_0x3b5e23,_0x53e6b7[_0xc294('0x41')]);return _0x51a0ff[_0xc294('0xfc')](_0x3b5e23);}})['then'](function(_0x4c0b95){if(_0x4c0b95){_0x3ae088=_0x4c0b95['length'];if(!_0x53e6b7['query'][_0xc294('0x38')](_0xc294('0x39'))){_0x3b5e23[_0xc294('0x20')]=qs['limit'](_0x53e6b7[_0xc294('0x31')][_0xc294('0x20')]);_0x3b5e23[_0xc294('0x22')]=qs['offset'](_0x53e6b7[_0xc294('0x31')][_0xc294('0x22')]);}return _0x51a0ff[_0xc294('0xfc')](_0x3b5e23);}})[_0xc294('0x11')](function(_0x79fcfa){if(_0x79fcfa){return _0x79fcfa?{'count':_0x3ae088,'rows':_0x79fcfa}:null;}})[_0xc294('0x11')](respondWithResult(_0x5390e2,null))[_0xc294('0x1c')](handleError(_0x5390e2,null));};exports['getFields']=function(_0x5158d3,_0x20c70c){var _0x369eab=_0x5158d3['query'][_0xc294('0x11b')]===_0xc294('0x11c')?_0xc294('0x11d'):_0xc294('0x11e');return db[_0xc294('0x2d')][_0xc294('0x47')]({'attributes':['id',_0x369eab],'where':{'id':_0x5158d3[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x20c70c,null))[_0xc294('0x11')](function(_0x3ee98c){if(_0x3ee98c){var _0x4d1ae6=_0x3ee98c[_0x369eab];var _0x26eed8=_0x4d1ae6&&_0x4d1ae6[_0xc294('0x11f')]?_0x4d1ae6[_0xc294('0x11f')]:[];_0x20c70c[_0xc294('0x29')]({'fromKey':_['isNil'](_0x4d1ae6[_0xc294('0x120')])?undefined:_0x4d1ae6[_0xc294('0x120')],'count':_0x26eed8['length'],'rows':_0x26eed8});}})['catch'](handleError(_0x20c70c,null));};exports[_0xc294('0x121')]=function(_0x33f499,_0x3691c7){var _0x140cdb={'raw':![],'where':{}};var _0x64286a={};var _0x91fd2a={'count':0x0,'rows':[]};return db[_0xc294('0x2d')][_0xc294('0x56')]({'where':{'id':_0x33f499[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x3691c7,null))[_0xc294('0x11')](function(_0x4c9796){if(_0x4c9796){_0x64286a[_0xc294('0x33')]=_[_0xc294('0x32')](db[_0xc294('0xc9')][_0xc294('0x2e')]);_0x64286a[_0xc294('0x31')]=_['keys'](_0x33f499[_0xc294('0x31')]);_0x64286a[_0xc294('0x3d')]=_[_0xc294('0x34')](_0x64286a[_0xc294('0x33')],_0x64286a[_0xc294('0x31')]);_0x140cdb[_0xc294('0x36')]=_[_0xc294('0x34')](_0x64286a['model'],qs[_0xc294('0x35')](_0x33f499[_0xc294('0x31')]['fields']));_0x140cdb[_0xc294('0x36')]=_0x140cdb['attributes']['length']?_0x140cdb[_0xc294('0x36')]:_0x64286a['model'];if(!_0x33f499[_0xc294('0x31')][_0xc294('0x38')](_0xc294('0x39'))){_0x140cdb[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x33f499[_0xc294('0x31')][_0xc294('0x20')]);_0x140cdb[_0xc294('0x22')]=qs[_0xc294('0x22')](_0x33f499[_0xc294('0x31')][_0xc294('0x22')]);}_0x140cdb[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x33f499[_0xc294('0x31')][_0xc294('0x3b')]);_0x140cdb[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_['pick'](_0x33f499[_0xc294('0x31')],_0x64286a[_0xc294('0x3d')]));_0x140cdb[_0xc294('0x3c')]['ChatWebsiteId']=_0x4c9796['id'];if(_0x33f499[_0xc294('0x31')][_0xc294('0x3f')]){_0x140cdb[_0xc294('0x3c')]=_['merge'](_0x140cdb[_0xc294('0x3c')],{'$or':_['map'](_0x140cdb['attributes'],function(_0x19fd75){var _0x30d503={};_0x30d503[_0x19fd75]={'$like':'%'+_0x33f499[_0xc294('0x31')]['filter']+'%'};return _0x30d503;})});}_0x140cdb=_['merge']({},_0x140cdb,_0x33f499[_0xc294('0x41')]);return db[_0xc294('0xc9')][_0xc294('0x21')]({'where':_0x140cdb['where']})['then'](function(_0x2be629){_0x91fd2a[_0xc294('0x21')]=_0x2be629;if(_0x33f499[_0xc294('0x31')][_0xc294('0xe8')]){_0x140cdb[_0xc294('0x42')]=[{'all':!![]}];}else{_0x140cdb[_0xc294('0x42')]=[{'model':db[_0xc294('0x7b')],'as':_0xc294('0xe9'),'required':![]},{'model':db['Attachment'],'as':_0xc294('0x122'),'required':![]}];}return db[_0xc294('0xc9')][_0xc294('0x43')](_0x140cdb);})[_0xc294('0x11')](function(_0x39b43f){_0x91fd2a['rows']=_0x39b43f;return _0x91fd2a;});}})['then'](respondWithFilteredResult(_0x3691c7,_0x140cdb))[_0xc294('0x1c')](handleError(_0x3691c7,null));};exports[_0xc294('0x123')]=function(_0x5f2a1f,_0x1e7821){return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x5f2a1f[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x1e7821,null))[_0xc294('0x11')](function(_0x388801){if(_0x388801){return _0x388801[_0xc294('0x123')](_0x5f2a1f[_0xc294('0x49')][_0xc294('0x58')],_['omit'](_0x5f2a1f['body'],[_0xc294('0x58'),'id'])||{})[_0xc294('0xab')](function(_0x28a190){for(var _0x534308=0x0;_0x534308<_0x5f2a1f[_0xc294('0x49')][_0xc294('0x58')][_0xc294('0x37')];_0x534308+=0x1){socket[_0xc294('0x124')](_0xc294('0x125'),{'UserId':Number(_0x5f2a1f[_0xc294('0x49')][_0xc294('0x58')][_0x534308]),'ChatWebsiteId':Number(_0x5f2a1f['params']['id'])});}return _0x28a190;});}})[_0xc294('0x11')](respondWithResult(_0x1e7821,null))['catch'](handleError(_0x1e7821,null));};exports[_0xc294('0x126')]=function(_0x4a739d,_0x446f36){return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x4a739d[_0xc294('0x46')]['id']}})['then'](handleEntityNotFound(_0x446f36,null))[_0xc294('0x11')](function(_0x348afc){if(_0x348afc){return _0x348afc['removeAgents'](_0x4a739d['query']['ids'])[_0xc294('0x11')](function(){if(_['isArray'](_0x4a739d[_0xc294('0x31')][_0xc294('0x58')])){for(var _0x515e56=0x0;_0x515e56<_0x4a739d[_0xc294('0x31')][_0xc294('0x58')][_0xc294('0x37')];_0x515e56+=0x1){socket['emit'](_0xc294('0x127'),{'UserId':Number(_0x4a739d[_0xc294('0x31')][_0xc294('0x58')][_0x515e56]),'ChatWebsiteId':Number(_0x4a739d[_0xc294('0x46')]['id'])});}}else{socket[_0xc294('0x124')]('userChatWebsite:remove',{'UserId':Number(_0x4a739d[_0xc294('0x31')][_0xc294('0x58')]),'ChatWebsiteId':Number(_0x4a739d[_0xc294('0x46')]['id'])});}});}})[_0xc294('0x11')](respondWithStatusCode(_0x446f36,null))[_0xc294('0x1c')](handleError(_0x446f36,null));};exports[_0xc294('0x128')]=function(_0x59d22a,_0x231c63){var _0xe6853c={};var _0xefaec5={};var _0xc936d4;var _0x36d735;return db[_0xc294('0x2d')][_0xc294('0x56')]({'where':{'id':_0x59d22a[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x231c63,null))[_0xc294('0x11')](function(_0x209aa7){if(_0x209aa7){_0xc936d4=_0x209aa7;_0xefaec5[_0xc294('0x33')]=_[_0xc294('0x32')](db[_0xc294('0xb7')]['rawAttributes']);_0xefaec5[_0xc294('0x31')]=_[_0xc294('0x32')](_0x59d22a[_0xc294('0x31')]);_0xefaec5[_0xc294('0x3d')]=_['intersection'](_0xefaec5[_0xc294('0x33')],_0xefaec5[_0xc294('0x31')]);_0xe6853c[_0xc294('0x36')]=_[_0xc294('0x34')](_0xefaec5[_0xc294('0x33')],qs[_0xc294('0x35')](_0x59d22a['query'][_0xc294('0x35')]));_0xe6853c[_0xc294('0x36')]=_0xe6853c[_0xc294('0x36')][_0xc294('0x37')]?_0xe6853c['attributes']:_0xefaec5['model'];_0xe6853c[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x59d22a[_0xc294('0x31')][_0xc294('0x3b')]);_0xe6853c['where']=qs[_0xc294('0x3d')](_[_0xc294('0x3e')](_0x59d22a[_0xc294('0x31')],_0xefaec5[_0xc294('0x3d')]));if(_0x59d22a[_0xc294('0x31')]['filter']){_0xe6853c[_0xc294('0x3c')]=_['merge'](_0xe6853c[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0xe6853c[_0xc294('0x36')],function(_0x57bff8){var _0x262bb4={};_0x262bb4[_0x57bff8]={'$like':'%'+_0x59d22a[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0x262bb4;})});}_0xe6853c=_['merge']({},_0xe6853c,_0x59d22a[_0xc294('0x41')]);return _0xc936d4[_0xc294('0x128')](_0xe6853c);}})[_0xc294('0x11')](function(_0x15782b){if(_0x15782b){_0x36d735=_0x15782b[_0xc294('0x37')];if(!_0x59d22a[_0xc294('0x31')][_0xc294('0x38')](_0xc294('0x39'))){_0xe6853c[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x59d22a[_0xc294('0x31')][_0xc294('0x20')]);_0xe6853c['offset']=qs[_0xc294('0x22')](_0x59d22a[_0xc294('0x31')][_0xc294('0x22')]);}return _0xc936d4[_0xc294('0x128')](_0xe6853c);}})[_0xc294('0x11')](function(_0x5e7fbe){if(_0x5e7fbe){return _0x5e7fbe?{'count':_0x36d735,'rows':_0x5e7fbe}:null;}})[_0xc294('0x11')](respondWithResult(_0x231c63,null))[_0xc294('0x1c')](handleError(_0x231c63,null));}; \ No newline at end of file +var _0x125e=['virtual','replace','render','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','offlineForm','onlineForm','items','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatWebsite,\x20%s,\x20%s','catch','sendStatus','status','json','undefined','limit','offset','count','set','update','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','Pause','mandatoryDispositionPause','rawAttributes','type','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatWebsite','findAll','rows','params','includeAll','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','pick','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','file','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','custom','root','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','isNil','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent','getResult','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','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','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','customerIp','headers','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','interaction','ChatInteraction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','firstName','email','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','hasOwnProperty','Contact','User','Owner','fullname','internal','Tag','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','getLicense','increment','chatLicenseExceeded','some','server/files/chat/iframe.ejs','stringify','x-real-ip','connection'];(function(_0x9b900e,_0x4ea9bf){var _0xef1de6=function(_0x86c222){while(--_0x86c222){_0x9b900e['push'](_0x9b900e['shift']());}};_0xef1de6(++_0x4ea9bf);}(_0x125e,0x148));var _0xe125=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x125e[_0x548627];return _0x844a84;};'use strict';var BPromise=require(_0xe125('0x0'));var Mustache=require(_0xe125('0x1'));var util=require(_0xe125('0x2'));var path=require(_0xe125('0x3'));var ejs=require(_0xe125('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0xe125('0x5'));var Redis=require(_0xe125('0x6'));var qs=require(_0xe125('0x7'));var logger=require(_0xe125('0x8'))(_0xe125('0x9'));var config=require(_0xe125('0xa'));var db=require(_0xe125('0xb'))['db'];config['redis']=_['defaults'](config[_0xe125('0xc')],{'host':_0xe125('0xd'),'port':0x18eb});var socket=require(_0xe125('0xe'))(new Redis(config['redis']));require(_0xe125('0xf'))[_0xe125('0x10')](socket);var htmlToText=require(_0xe125('0x11'));var jayson=require(_0xe125('0x12'));var client=jayson[_0xe125('0x13')]['http']({'port':0x232c});var client9002=jayson[_0xe125('0x13')]['http']({'port':0x232a});var client9003=jayson[_0xe125('0x13')]['http']({'port':0x232b});var client9001=jayson[_0xe125('0x13')][_0xe125('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x327edf,_0x1da5be,_0x56427a,_0x3d3571){return new BPromise(function(_0x3c592e,_0x16ff15){var _0x51d5df=_0x3d3571||client;return _0x51d5df[_0xe125('0x15')](_0x327edf,_0x56427a)[_0xe125('0x16')](function(_0x53c941){logger[_0xe125('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1da5be,'request\x20sent');logger['debug'](_0xe125('0x18'),_0x1da5be,_0xe125('0x19'),JSON['stringify'](_0x53c941));if(_0x53c941[_0xe125('0x1a')]){if(_0x53c941[_0xe125('0x1a')][_0xe125('0x1b')]===0x1f4){logger[_0xe125('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x1da5be,_0x53c941['error']['message']);return _0x16ff15(_0x53c941[_0xe125('0x1a')][_0xe125('0x1c')]);}logger[_0xe125('0x1a')](_0xe125('0x1d'),_0x1da5be,_0x53c941[_0xe125('0x1a')][_0xe125('0x1c')]);return _0x3c592e(_0x53c941[_0xe125('0x1a')][_0xe125('0x1c')]);}else{logger[_0xe125('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1da5be,_0xe125('0x19'));_0x3c592e(_0x53c941['result']['message']);}})[_0xe125('0x1e')](function(_0xe2f99b){logger[_0xe125('0x1a')](_0xe125('0x1d'),_0x1da5be,_0xe2f99b);_0x16ff15(_0xe2f99b);});});}function respondWithStatusCode(_0x2a32d6,_0x4fa05b){_0x4fa05b=_0x4fa05b||0xcc;return function(_0x4f3637){if(_0x4f3637){return _0x2a32d6[_0xe125('0x1f')](_0x4fa05b);}return _0x2a32d6[_0xe125('0x20')](_0x4fa05b)['end']();};}function respondWithResult(_0x4de5cb,_0xf240c1){_0xf240c1=_0xf240c1||0xc8;return function(_0x3d22d8){if(_0x3d22d8){return _0x4de5cb['status'](_0xf240c1)[_0xe125('0x21')](_0x3d22d8);}};}function respondWithFilteredResult(_0x4c15b1,_0x191abc){return function(_0x15bb3a){if(_0x15bb3a){var _0xcf4bfc=typeof _0x191abc['offset']===_0xe125('0x22')&&typeof _0x191abc[_0xe125('0x23')]===_0xe125('0x22');var _0x1ad579=_0x15bb3a['count'];var _0x40c492=_0xcf4bfc?0x0:_0x191abc[_0xe125('0x24')];var _0x5432cf=_0xcf4bfc?_0x15bb3a[_0xe125('0x25')]:_0x191abc[_0xe125('0x24')]+_0x191abc[_0xe125('0x23')];var _0x315e06;if(_0x5432cf>=_0x1ad579){_0x5432cf=_0x1ad579;_0x315e06=0xc8;}else{_0x315e06=0xce;}_0x4c15b1[_0xe125('0x20')](_0x315e06);return _0x4c15b1[_0xe125('0x26')]('Content-Range',_0x40c492+'-'+_0x5432cf+'/'+_0x1ad579)[_0xe125('0x21')](_0x15bb3a);}return null;};}function saveUpdates(_0x511a35){return function(_0x239338){if(_0x239338){return _0x239338[_0xe125('0x27')](_0x511a35)[_0xe125('0x16')](function(_0x17faac){return _0x17faac;});}return null;};}function removeEntity(_0x11fbbc){return function(_0x5a70b0){if(_0x5a70b0){return _0x5a70b0['destroy']()[_0xe125('0x16')](function(){var _0x27f7ed=_0x5a70b0[_0xe125('0x28')]({'plain':!![]});var _0x413ed2=_0xe125('0x29');return db[_0xe125('0x2a')][_0xe125('0x2b')]({'where':{'type':_0x413ed2,'resourceId':_0x27f7ed['id']}})[_0xe125('0x16')](function(){return _0x5a70b0;});})[_0xe125('0x16')](function(){_0x11fbbc[_0xe125('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x124880){return function(_0x2cc1a3){if(!_0x2cc1a3){_0x124880[_0xe125('0x1f')](0x194);}return _0x2cc1a3;};}function handleError(_0x597324,_0x1ced0f){_0x1ced0f=_0x1ced0f||0x1f4;return function(_0x59ecc8){logger[_0xe125('0x1a')](_0x59ecc8[_0xe125('0x2c')]);if(_0x59ecc8[_0xe125('0x2d')]){delete _0x59ecc8['name'];}_0x597324[_0xe125('0x20')](_0x1ced0f)[_0xe125('0x2e')](_0x59ecc8);};}exports['index']=function(_0x4d5d33,_0x338636){var _0x5eaa9b={'include':[{'model':db[_0xe125('0x2f')],'as':_0xe125('0x30')}]},_0x433cc7={},_0x474305={'count':0x0,'rows':[]};var _0x3d4fe0=_['map'](db['ChatWebsite'][_0xe125('0x31')],function(_0x164b95){return{'name':_0x164b95['fieldName'],'type':_0x164b95[_0xe125('0x32')]['key']};});_0x433cc7['model']=_[_0xe125('0x33')](_0x3d4fe0,_0xe125('0x2d'));_0x433cc7[_0xe125('0x34')]=_[_0xe125('0x35')](_0x4d5d33[_0xe125('0x34')]);_0x433cc7[_0xe125('0x36')]=_[_0xe125('0x37')](_0x433cc7[_0xe125('0x38')],_0x433cc7[_0xe125('0x34')]);_0x5eaa9b[_0xe125('0x39')]=_[_0xe125('0x37')](_0x433cc7[_0xe125('0x38')],qs['fields'](_0x4d5d33['query'][_0xe125('0x3a')]));_0x5eaa9b[_0xe125('0x39')]=_0x5eaa9b['attributes'][_0xe125('0x3b')]?_0x5eaa9b[_0xe125('0x39')]:_0x433cc7[_0xe125('0x38')];if(!_0x4d5d33[_0xe125('0x34')]['hasOwnProperty'](_0xe125('0x3c'))){_0x5eaa9b[_0xe125('0x23')]=qs['limit'](_0x4d5d33[_0xe125('0x34')]['limit']);_0x5eaa9b[_0xe125('0x24')]=qs['offset'](_0x4d5d33[_0xe125('0x34')][_0xe125('0x24')]);}_0x5eaa9b[_0xe125('0x3d')]=qs[_0xe125('0x3e')](_0x4d5d33['query'][_0xe125('0x3e')]);_0x5eaa9b[_0xe125('0x3f')]=qs[_0xe125('0x36')](_['pick'](_0x4d5d33[_0xe125('0x34')],_0x433cc7['filters']),_0x3d4fe0);if(_0x4d5d33[_0xe125('0x34')][_0xe125('0x40')]){_0x5eaa9b['where']=_[_0xe125('0x41')](_0x5eaa9b[_0xe125('0x3f')],{'$or':_[_0xe125('0x33')](_0x3d4fe0,function(_0x41105b){if(_0x41105b[_0xe125('0x32')]!==_0xe125('0x42')){var _0x5a2d40={};_0x5a2d40[_0x41105b[_0xe125('0x2d')]]={'$like':'%'+_0x4d5d33[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x5a2d40;}})});}_0x5eaa9b=_[_0xe125('0x41')]({},_0x5eaa9b,_0x4d5d33[_0xe125('0x43')]);var _0x5bc3ca={'where':_0x5eaa9b[_0xe125('0x3f')]};return db['ChatWebsite'][_0xe125('0x25')](_0x5bc3ca)[_0xe125('0x16')](function(_0x35a984){_0x474305[_0xe125('0x25')]=_0x35a984;if(_0x4d5d33[_0xe125('0x34')]['includeAll']){_0x5eaa9b['include']=[{'all':!![]}];}return db[_0xe125('0x44')][_0xe125('0x45')](_0x5eaa9b);})[_0xe125('0x16')](function(_0xd3ec8b){_0x474305[_0xe125('0x46')]=_0xd3ec8b;return _0x474305;})[_0xe125('0x16')](respondWithFilteredResult(_0x338636,_0x5eaa9b))[_0xe125('0x1e')](handleError(_0x338636,null));};exports['show']=function(_0x50c49b,_0x27f069){var _0x372af0={'raw':![],'where':{'id':_0x50c49b[_0xe125('0x47')]['id']},'include':[{'model':db['Pause'],'as':_0xe125('0x30')}]},_0x43f4e3={};_0x43f4e3[_0xe125('0x38')]=_[_0xe125('0x35')](db[_0xe125('0x44')][_0xe125('0x31')]);_0x43f4e3[_0xe125('0x34')]=_['keys'](_0x50c49b[_0xe125('0x34')]);_0x43f4e3['filters']=_[_0xe125('0x37')](_0x43f4e3['model'],_0x43f4e3[_0xe125('0x34')]);_0x372af0[_0xe125('0x39')]=_[_0xe125('0x37')](_0x43f4e3[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x50c49b['query'][_0xe125('0x3a')]));_0x372af0['attributes']=_0x372af0[_0xe125('0x39')][_0xe125('0x3b')]?_0x372af0[_0xe125('0x39')]:_0x43f4e3[_0xe125('0x38')];if(_0x50c49b[_0xe125('0x34')][_0xe125('0x48')]){_0x372af0[_0xe125('0x49')]=[{'all':!![]}];}_0x372af0=_[_0xe125('0x41')]({},_0x372af0,_0x50c49b[_0xe125('0x43')]);return db[_0xe125('0x44')]['find'](_0x372af0)[_0xe125('0x16')](handleEntityNotFound(_0x27f069,null))['then'](respondWithResult(_0x27f069,null))['catch'](handleError(_0x27f069,null));};exports[_0xe125('0x4a')]=function(_0x4ad8e8,_0x3fdc6f){return db[_0xe125('0x44')]['create'](_0x4ad8e8[_0xe125('0x4b')],{})[_0xe125('0x16')](function(_0x10774c){var _0x3c2c18=_0x4ad8e8['user'][_0xe125('0x28')]({'plain':!![]});if(!_0x3c2c18)throw new Error(_0xe125('0x4c'));if(_0x3c2c18[_0xe125('0x4d')]===_0xe125('0x4e')){var _0xcae224=_0x10774c[_0xe125('0x28')]({'plain':!![]});var _0x4c2037=_0xe125('0x29');return db['UserProfileSection'][_0xe125('0x4f')]({'where':{'name':_0x4c2037,'userProfileId':_0x3c2c18['userProfileId']},'raw':!![]})[_0xe125('0x16')](function(_0x2d996f){if(_0x2d996f&&_0x2d996f[_0xe125('0x50')]===0x0){return db[_0xe125('0x2a')][_0xe125('0x4a')]({'name':_0xcae224[_0xe125('0x2d')],'resourceId':_0xcae224['id'],'type':_0x2d996f[_0xe125('0x2d')],'sectionId':_0x2d996f['id']},{})[_0xe125('0x16')](function(){return _0x10774c;});}else{return _0x10774c;}})[_0xe125('0x1e')](function(_0x25d162){logger['error'](_0xe125('0x51'),_0x25d162);throw _0x25d162;});}return _0x10774c;})[_0xe125('0x16')](respondWithResult(_0x3fdc6f,0xc9))[_0xe125('0x1e')](handleError(_0x3fdc6f,null));};exports['update']=function(_0x4276ee,_0x5812c7){if(_0x4276ee[_0xe125('0x4b')]['id']){delete _0x4276ee[_0xe125('0x4b')]['id'];}return db[_0xe125('0x44')][_0xe125('0x4f')]({'where':{'id':_0x4276ee[_0xe125('0x47')]['id']},'include':[{'model':db[_0xe125('0x2f')],'as':_0xe125('0x30')}]})[_0xe125('0x16')](handleEntityNotFound(_0x5812c7,null))[_0xe125('0x16')](saveUpdates(_0x4276ee[_0xe125('0x4b')],null))[_0xe125('0x16')](respondWithResult(_0x5812c7,null))[_0xe125('0x1e')](handleError(_0x5812c7,null));};exports['destroy']=function(_0x597f28,_0x2da802){return db[_0xe125('0x44')][_0xe125('0x4f')]({'where':{'id':_0x597f28[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x2da802,null))['then'](removeEntity(_0x2da802,null))[_0xe125('0x1e')](handleError(_0x2da802,null));};exports['describe']=function(_0x5d5262,_0x25a449){return db['ChatWebsite'][_0xe125('0x52')]()[_0xe125('0x16')](respondWithResult(_0x25a449,null))[_0xe125('0x1e')](handleError(_0x25a449,null));};exports[_0xe125('0x53')]=function(_0x3ce0b1,_0x45b974){if(_0x3ce0b1['body']['id']){delete _0x3ce0b1[_0xe125('0x4b')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x3ce0b1[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x45b974,null))[_0xe125('0x16')](function(_0x377cf4){if(_0x377cf4){_0x3ce0b1['body']['ChatWebsiteId']=_0x377cf4['id'];return db[_0xe125('0x54')][_0xe125('0x4a')](_0x3ce0b1[_0xe125('0x4b')]);}})['then'](respondWithResult(_0x45b974,null))[_0xe125('0x1e')](handleError(_0x45b974,null));};exports[_0xe125('0x55')]=function(_0x2fc413,_0x31eac8){var _0x3f9985={'raw':![],'where':{}};var _0x4357a0={};var _0x33cb3e={'count':0x0,'rows':[]};return db[_0xe125('0x44')]['findOne']({'where':{'id':_0x2fc413[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x31eac8,null))[_0xe125('0x16')](function(_0x56ea1f){if(_0x56ea1f){_0x4357a0[_0xe125('0x38')]=_[_0xe125('0x35')](db[_0xe125('0x54')][_0xe125('0x31')]);_0x4357a0[_0xe125('0x34')]=_[_0xe125('0x35')](_0x2fc413['query']);_0x4357a0['filters']=_['intersection'](_0x4357a0[_0xe125('0x38')],_0x4357a0[_0xe125('0x34')]);_0x3f9985[_0xe125('0x39')]=_[_0xe125('0x37')](_0x4357a0[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x2fc413[_0xe125('0x34')]['fields']));_0x3f9985[_0xe125('0x39')]=_0x3f9985[_0xe125('0x39')][_0xe125('0x3b')]?_0x3f9985[_0xe125('0x39')]:_0x4357a0['model'];if(!_0x2fc413[_0xe125('0x34')]['hasOwnProperty'](_0xe125('0x3c'))){_0x3f9985[_0xe125('0x23')]=qs[_0xe125('0x23')](_0x2fc413[_0xe125('0x34')][_0xe125('0x23')]);_0x3f9985[_0xe125('0x24')]=qs[_0xe125('0x24')](_0x2fc413['query'][_0xe125('0x24')]);}_0x3f9985['order']=qs[_0xe125('0x3e')](_0x2fc413['query'][_0xe125('0x3e')]);_0x3f9985[_0xe125('0x3f')]=qs[_0xe125('0x36')](_[_0xe125('0x56')](_0x2fc413[_0xe125('0x34')],_0x4357a0['filters']));_0x3f9985[_0xe125('0x3f')][_0xe125('0x57')]=_0x56ea1f['id'];if(_0x2fc413['query'][_0xe125('0x40')]){_0x3f9985[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x3f9985[_0xe125('0x3f')],{'$or':_[_0xe125('0x33')](_0x3f9985[_0xe125('0x39')],function(_0x5073d3){var _0x5e2f88={};_0x5e2f88[_0x5073d3]={'$like':'%'+_0x2fc413[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x5e2f88;})});}_0x3f9985=_['merge']({},_0x3f9985,_0x2fc413['options']);return db['Disposition'][_0xe125('0x25')]({'where':_0x3f9985[_0xe125('0x3f')]})[_0xe125('0x16')](function(_0x38ecd5){_0x33cb3e['count']=_0x38ecd5;if(_0x2fc413[_0xe125('0x34')][_0xe125('0x48')]){_0x3f9985['include']=[{'all':!![]}];}return db[_0xe125('0x54')][_0xe125('0x45')](_0x3f9985);})[_0xe125('0x16')](function(_0x53184c){_0x33cb3e[_0xe125('0x46')]=_0x53184c;return _0x33cb3e;});}})[_0xe125('0x16')](respondWithFilteredResult(_0x31eac8,_0x3f9985))[_0xe125('0x1e')](handleError(_0x31eac8,null));};exports[_0xe125('0x58')]=function(_0x1ec578,_0x5b333e){return db[_0xe125('0x44')]['find']({'where':{'id':_0x1ec578[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x5b333e,null))['then'](function(_0x3eaf89){if(_0x3eaf89){return _0x3eaf89['removeDispositions'](_0x1ec578[_0xe125('0x34')][_0xe125('0x59')]);}})[_0xe125('0x16')](respondWithStatusCode(_0x5b333e,null))[_0xe125('0x1e')](handleError(_0x5b333e,null));};exports[_0xe125('0x5a')]=function(_0xdf7bdd,_0x1436b2){if(_0xdf7bdd['body']['id']){delete _0xdf7bdd[_0xe125('0x4b')]['id'];}return db[_0xe125('0x44')]['find']({'where':{'id':_0xdf7bdd['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1436b2,null))['then'](function(_0x46ea6e){if(_0x46ea6e){_0xdf7bdd[_0xe125('0x4b')][_0xe125('0x57')]=_0x46ea6e['id'];return db[_0xe125('0x5b')][_0xe125('0x4a')](_0xdf7bdd[_0xe125('0x4b')]);}})[_0xe125('0x16')](respondWithResult(_0x1436b2,null))[_0xe125('0x1e')](handleError(_0x1436b2,null));};exports[_0xe125('0x5c')]=function(_0x154492,_0x2e4247){var _0x47aa44={'raw':![],'where':{}};var _0x4cabbb={};var _0x44494d={'count':0x0,'rows':[]};return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0x154492[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x2e4247,null))['then'](function(_0x32b97e){if(_0x32b97e){_0x4cabbb[_0xe125('0x38')]=_['keys'](db[_0xe125('0x5b')][_0xe125('0x31')]);_0x4cabbb['query']=_['keys'](_0x154492[_0xe125('0x34')]);_0x4cabbb[_0xe125('0x36')]=_[_0xe125('0x37')](_0x4cabbb['model'],_0x4cabbb[_0xe125('0x34')]);_0x47aa44['attributes']=_[_0xe125('0x37')](_0x4cabbb[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x154492['query']['fields']));_0x47aa44[_0xe125('0x39')]=_0x47aa44[_0xe125('0x39')][_0xe125('0x3b')]?_0x47aa44['attributes']:_0x4cabbb[_0xe125('0x38')];if(!_0x154492[_0xe125('0x34')]['hasOwnProperty'](_0xe125('0x3c'))){_0x47aa44[_0xe125('0x23')]=qs[_0xe125('0x23')](_0x154492[_0xe125('0x34')][_0xe125('0x23')]);_0x47aa44['offset']=qs[_0xe125('0x24')](_0x154492[_0xe125('0x34')][_0xe125('0x24')]);}_0x47aa44[_0xe125('0x3d')]=qs[_0xe125('0x3e')](_0x154492[_0xe125('0x34')][_0xe125('0x3e')]);_0x47aa44[_0xe125('0x3f')]=qs[_0xe125('0x36')](_['pick'](_0x154492[_0xe125('0x34')],_0x4cabbb[_0xe125('0x36')]));_0x47aa44[_0xe125('0x3f')]['ChatWebsiteId']=_0x32b97e['id'];if(_0x154492[_0xe125('0x34')][_0xe125('0x40')]){_0x47aa44[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x47aa44[_0xe125('0x3f')],{'$or':_['map'](_0x47aa44[_0xe125('0x39')],function(_0x3ef9af){var _0x46e476={};_0x46e476[_0x3ef9af]={'$like':'%'+_0x154492[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x46e476;})});}_0x47aa44=_[_0xe125('0x41')]({},_0x47aa44,_0x154492[_0xe125('0x43')]);return db[_0xe125('0x5b')][_0xe125('0x25')]({'where':_0x47aa44[_0xe125('0x3f')]})['then'](function(_0x3c6d6a){_0x44494d[_0xe125('0x25')]=_0x3c6d6a;if(_0x154492['query']['includeAll']){_0x47aa44[_0xe125('0x49')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe125('0x45')](_0x47aa44);})['then'](function(_0x3775bc){_0x44494d[_0xe125('0x46')]=_0x3775bc;return _0x44494d;});}})[_0xe125('0x16')](respondWithFilteredResult(_0x2e4247,_0x47aa44))[_0xe125('0x1e')](handleError(_0x2e4247,null));};exports[_0xe125('0x5e')]=function(_0x5142b7,_0x2d39a0){return db[_0xe125('0x44')]['find']({'where':{'id':_0x5142b7[_0xe125('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d39a0,null))[_0xe125('0x16')](function(_0x3c83bd){if(_0x3c83bd){return _0x3c83bd['removeAnswers'](_0x5142b7[_0xe125('0x34')]['ids']);}})[_0xe125('0x16')](respondWithStatusCode(_0x2d39a0,null))[_0xe125('0x1e')](handleError(_0x2d39a0,null));};exports[_0xe125('0x5f')]=function(_0x1a3cca,_0x1dfce8){_0x1a3cca[_0xe125('0x4b')][_0xe125('0x60')]=_0x1a3cca['file'][_0xe125('0x61')];return db[_0xe125('0x44')]['find']({'where':{'id':_0x1a3cca['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1dfce8,null))[_0xe125('0x16')](saveUpdates(_0x1a3cca[_0xe125('0x4b')],null))[_0xe125('0x16')](respondWithResult(_0x1dfce8,null))[_0xe125('0x1e')](handleError(_0x1dfce8,null));};exports[_0xe125('0x62')]=function(_0x1ce70c,_0x48792c){_0x1ce70c[_0xe125('0x4b')][_0xe125('0x63')]=_0x1ce70c['file'][_0xe125('0x61')];return db[_0xe125('0x44')]['find']({'where':{'id':_0x1ce70c[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x48792c,null))['then'](saveUpdates(_0x1ce70c[_0xe125('0x4b')],null))['then'](respondWithResult(_0x48792c,null))['catch'](handleError(_0x48792c,null));};exports[_0xe125('0x64')]=function(_0x500af0,_0x1f2526){_0x500af0[_0xe125('0x4b')]['customerAvatar']=_0x500af0[_0xe125('0x65')][_0xe125('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x500af0[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1f2526,null))['then'](saveUpdates(_0x500af0[_0xe125('0x4b')],null))[_0xe125('0x16')](respondWithResult(_0x1f2526,null))[_0xe125('0x1e')](handleError(_0x1f2526,null));};exports[_0xe125('0x66')]=function(_0x4b110d,_0x4d8e36){_0x4b110d[_0xe125('0x4b')][_0xe125('0x67')]=_0x4b110d[_0xe125('0x65')][_0xe125('0x61')];return db['ChatWebsite'][_0xe125('0x4f')]({'where':{'id':_0x4b110d[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x4d8e36,null))[_0xe125('0x16')](saveUpdates(_0x4b110d['body'],null))['then'](respondWithResult(_0x4d8e36,null))[_0xe125('0x1e')](handleError(_0x4d8e36,null));};exports[_0xe125('0x68')]=function(_0x20400e,_0x4b405a){var _0x8ff345=path[_0xe125('0x69')](config['root'],_0xe125('0x6a'));var _0x3fc99e={'where':{'id':_0x20400e[_0xe125('0x47')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x53f48f=![];return require(_0xe125('0x6b'))['getLicense']()[_0xe125('0x16')](function(_0x12efbc){if(_0x12efbc){_0x53f48f=_0x12efbc[_0xe125('0x6c')];}})[_0xe125('0x16')](function(){return db[_0xe125('0x44')][_0xe125('0x4f')](_0x3fc99e);})[_0xe125('0x16')](handleEntityNotFound(_0x4b405a,null))[_0xe125('0x16')](function(_0x86df70){if(_0x86df70){if(!_['isNil'](_0x86df70[_0xe125('0x60')])){if(fs['existsSync'](path[_0xe125('0x69')](config['root'],'server/files/images/logos/',_0x86df70[_0xe125('0x60')]))&&_0x53f48f){_0x8ff345=path[_0xe125('0x69')](config[_0xe125('0x6d')],'server/files/images/logos/',_0x86df70[_0xe125('0x60')]);}}return _0x4b405a[_0xe125('0x6e')](_0x8ff345);}})[_0xe125('0x1e')](handleError(_0x4b405a,null));};exports[_0xe125('0x6f')]=function(_0xa883a6,_0x5aecc6){var _0x4127d7=path[_0xe125('0x69')](config[_0xe125('0x6d')],'server/files/images/avatars/default_avatar.png');var _0x421a93={'where':{'id':_0xa883a6['params']['id']},'attributes':['id',_0xe125('0x63')],'raw':!![]};return db[_0xe125('0x44')][_0xe125('0x4f')](_0x421a93)[_0xe125('0x16')](handleEntityNotFound(_0x5aecc6,null))[_0xe125('0x16')](function(_0x1c10e2){if(_0x1c10e2){if(!_['isNil'](_0x1c10e2[_0xe125('0x63')])){if(fs['existsSync'](path[_0xe125('0x69')](config[_0xe125('0x6d')],_0xe125('0x70'),_0x1c10e2[_0xe125('0x63')]))){_0x4127d7=path['join'](config[_0xe125('0x6d')],'server/files/images/avatars/',_0x1c10e2[_0xe125('0x63')]);}}return _0x5aecc6[_0xe125('0x6e')](_0x4127d7);}})[_0xe125('0x1e')](handleError(_0x5aecc6,null));};exports[_0xe125('0x71')]=function(_0x4168fe,_0x309d6c){var _0x2ca2f3=path[_0xe125('0x69')](config['root'],_0xe125('0x72'));var _0x153c90={'where':{'id':_0x4168fe[_0xe125('0x47')]['id']},'attributes':['id',_0xe125('0x73'),_0xe125('0x74')],'raw':!![]};return db[_0xe125('0x44')]['find'](_0x153c90)[_0xe125('0x16')](handleEntityNotFound(_0x309d6c,null))[_0xe125('0x16')](function(_0x3a184f){if(_0x3a184f){if(!_[_0xe125('0x75')](_0x3a184f[_0xe125('0x73')])){if(fs[_0xe125('0x76')](path[_0xe125('0x69')](config[_0xe125('0x6d')],_0xe125('0x70'),_0x3a184f['customerAvatar']))&&_0x3a184f[_0xe125('0x74')]){_0x2ca2f3=path[_0xe125('0x69')](config[_0xe125('0x6d')],_0xe125('0x70'),_0x3a184f[_0xe125('0x73')]);}}return _0x309d6c[_0xe125('0x6e')](_0x2ca2f3);}})[_0xe125('0x1e')](handleError(_0x309d6c,null));};exports[_0xe125('0x77')]=function(_0x14c52c,_0x56ed31){var _0x12c4a0=path[_0xe125('0x69')](config[_0xe125('0x6d')],_0xe125('0x78'));var _0x1a4a69={'where':{'id':_0x14c52c[_0xe125('0x47')]['id']},'attributes':['id',_0xe125('0x67')],'raw':!![]};return db['ChatWebsite'][_0xe125('0x4f')](_0x1a4a69)[_0xe125('0x16')](handleEntityNotFound(_0x56ed31,null))[_0xe125('0x16')](function(_0x3cbf43){if(_0x3cbf43){if(!_[_0xe125('0x75')](_0x3cbf43[_0xe125('0x67')])){if(fs[_0xe125('0x76')](path['join'](config[_0xe125('0x6d')],_0xe125('0x70'),_0x3cbf43[_0xe125('0x67')]))){_0x12c4a0=path[_0xe125('0x69')](config['root'],_0xe125('0x70'),_0x3cbf43[_0xe125('0x67')]);}}return _0x56ed31[_0xe125('0x6e')](_0x12c4a0);}})[_0xe125('0x1e')](handleError(_0x56ed31,null));};exports['notify']=function(_0x53853f,_0x3ed63e){var _0x640602=require('user-agent-parser');var _0x59a3f9=new _0x640602();var _0x5839aa=_0x59a3f9['setUA'](_0x53853f['headers'][_0xe125('0x79')])[_0xe125('0x7a')]();var _0x5514a9={'body':_0x53853f[_0xe125('0x4b')],'channel':'chat'};var _0x5bc352=[];var _0x771e09=[];var _0x437ae5={};var _0x2cc6fc=![];return db[_0xe125('0x7b')]['describe']()[_0xe125('0x16')](function(_0x2deb16){if(!_0x2deb16){throw new db[(_0xe125('0x7c'))]['ValidationError'](_0xe125('0x7d'));}_0x5bc352=_[_0xe125('0x7e')](_['keys'](_0x2deb16),[_0xe125('0x7f'),_0xe125('0x80')]);_0x771e09=_[_0xe125('0x7e')](_[_0xe125('0x35')](_0x2deb16),['createdAt',_0xe125('0x80'),_0xe125('0x81'),_0xe125('0x82')]);if(_0x53853f['body']['id']){delete _0x53853f[_0xe125('0x4b')]['id'];}if(_[_0xe125('0x75')](_0x53853f['body'][_0xe125('0x83')])){throw new db[(_0xe125('0x7c'))][(_0xe125('0x84'))]('from\x20is\x20mandatory');}if(_[_0xe125('0x75')](_0x53853f['body'][_0xe125('0x4b')])||_0x53853f[_0xe125('0x4b')][_0xe125('0x4b')]===''){throw new db[(_0xe125('0x7c'))][(_0xe125('0x84'))](_0xe125('0x85'));}if(_[_0xe125('0x75')](_0x53853f[_0xe125('0x4b')][_0xe125('0x86')])){throw new db['Sequelize'][(_0xe125('0x84'))](_0xe125('0x87')+_0x771e09);}if(!_[_0xe125('0x88')](_0x771e09,_0x53853f[_0xe125('0x4b')][_0xe125('0x86')])){throw new db[(_0xe125('0x7c'))][(_0xe125('0x84'))](_0xe125('0x89')+_0x771e09);}_0x437ae5[_0x53853f['body'][_0xe125('0x86')]]=_0x53853f[_0xe125('0x4b')][_0xe125('0x83')];})['then'](function(){return db['ChatWebsite'][_0xe125('0x4f')]({'where':{'id':_0x53853f['params']['id']},'include':[{'model':db[_0xe125('0x8a')],'as':_0xe125('0x8b'),'include':[{'model':db[_0xe125('0x7b')],'as':_0xe125('0x8c'),'where':_0x437ae5,'limit':0x1,'order':[[_0xe125('0x80'),_0xe125('0x8d')]]}]},{'model':db['ChatApplication'],'as':_0xe125('0x8e')}]});})['then'](handleEntityNotFound(_0x3ed63e,null))[_0xe125('0x16')](function(_0x24b8ed){if(_0x24b8ed&&_0x24b8ed[_0xe125('0x8b')]){_0x5514a9[_0xe125('0x8f')]=_0x24b8ed;_0x5514a9[_0xe125('0x90')]=_0x24b8ed[_0xe125('0x8e')];_0x5514a9[_0xe125('0x91')]=_0x24b8ed[_0xe125('0x8b')];_0x5514a9[_0xe125('0x90')]=_[_0xe125('0x92')](_0x5514a9[_0xe125('0x90')],[_0xe125('0x93')],['asc']);if(_0x5514a9['account'][_0xe125('0x8e')]){delete _0x5514a9['account']['Applications'];}if(_0x5514a9['account']['List']&&_0x5514a9[_0xe125('0x8f')][_0xe125('0x8b')][_0xe125('0x8c')][_0xe125('0x3b')]){return _0x5514a9[_0xe125('0x8f')][_0xe125('0x8b')][_0xe125('0x8c')][0x0];}var _0x32ba14=_['defaults'](_0x53853f[_0xe125('0x4b')],{'firstName':_0x53853f['body'][_0xe125('0x83')],'ListId':_0x24b8ed[_0xe125('0x82')]});_0x32ba14[_0x53853f[_0xe125('0x4b')]['mapKey']]=_0x53853f[_0xe125('0x4b')][_0xe125('0x83')];return db[_0xe125('0x7b')][_0xe125('0x4a')](_0x32ba14,{'fields':_0x5bc352,'raw':!![]});}})[_0xe125('0x16')](handleEntityNotFound(_0x3ed63e,null))[_0xe125('0x16')](function(_0x3013fb){_0x5514a9['contact']=_0x3013fb;var _0x34bb0d=_0x53853f[_0xe125('0x4b')][_0xe125('0x94')];if(_0x53853f[_0xe125('0x95')][_0xe125('0x96')]){_0x34bb0d=_0x53853f['headers'][_0xe125('0x96')];}else if(_0x53853f[_0xe125('0x95')]['x-forwarded-for']){_0x34bb0d=_[_0xe125('0x97')](_0x53853f[_0xe125('0x95')][_0xe125('0x98')][_0xe125('0x99')](','));}if(_0x3013fb){var _0xde5aa6={'ContactId':_0x3013fb['id'],'ChatWebsiteId':_0x53853f[_0xe125('0x47')]['id'],'from':(_0x3013fb['firstName']||'')+'\x20'+(_0x3013fb[_0xe125('0x9a')]||''),'customerIp':_0x34bb0d,'customerPort':_0x53853f[_0xe125('0x95')][_0xe125('0x9b')]?_0x53853f[_0xe125('0x95')][_0xe125('0x9b')]:null,'referer':_0x53853f[_0xe125('0x4b')][_0xe125('0x9c')],'browserName':_0x5839aa[_0xe125('0x9d')][_0xe125('0x2d')]&&_0x5839aa[_0xe125('0x9d')][_0xe125('0x9e')]?util[_0xe125('0x9f')](_0xe125('0xa0'),_0x5839aa[_0xe125('0x9d')][_0xe125('0x2d')],_0x5839aa[_0xe125('0x9d')][_0xe125('0x9e')]):'unknown','browserVersion':_0x5839aa[_0xe125('0x9d')][_0xe125('0x9e')]||_0xe125('0xa1'),'osName':util[_0xe125('0x9f')](_0xe125('0xa0'),_0x5839aa['os'][_0xe125('0x2d')],_0x5839aa['os']['version']),'osVersion':_0x5839aa['os']['version'],'deviceModel':_0x5839aa[_0xe125('0xa2')][_0xe125('0x38')]&&_0x5839aa[_0xe125('0xa2')][_0xe125('0xa3')]?util[_0xe125('0x9f')](_0xe125('0xa4'),_0x5839aa['device'][_0xe125('0x38')],_0x5839aa[_0xe125('0xa2')][_0xe125('0xa3')],_0x5839aa[_0xe125('0xa2')]['type']):null,'deviceVendor':_0x5839aa[_0xe125('0xa2')][_0xe125('0xa3')],'deviceType':_0x5839aa[_0xe125('0xa2')][_0xe125('0x32')],'formData':JSON['stringify'](_0x53853f[_0xe125('0x4b')])};var _0x57e220={'ChatWebsiteId':_0x53853f[_0xe125('0x47')]['id'],'closed':![]};if(_0x53853f[_0xe125('0x4b')][_0xe125('0xa5')]){_0x57e220[_0xe125('0xa5')]=_0x53853f[_0xe125('0x4b')][_0xe125('0xa5')];return db['ChatInteraction']['find']({'where':_0x57e220})[_0xe125('0x16')](function(_0x469721){if(_0x469721){return[_0x469721,![]];}_0xde5aa6[_0xe125('0xa5')]=_0x53853f['body'][_0xe125('0xa5')];_0xde5aa6[_0xe125('0xa6')]=_0x53853f['body'][_0xe125('0xa6')];return db['ChatInteraction'][_0xe125('0x4a')](_0xde5aa6)[_0xe125('0x16')](function(_0x54719c){return[_0x54719c,!![]];});});}_0x57e220['ContactId']=_0x3013fb['id'];if(_0x53853f[_0xe125('0x4b')][_0xe125('0xa7')]&&_0x53853f[_0xe125('0x4b')][_0xe125('0xa7')]['id']){_0x57e220['id']=_0x53853f['body'][_0xe125('0xa7')]['id'];return db[_0xe125('0xa8')][_0xe125('0x4f')]({'where':_0x57e220})[_0xe125('0x16')](function(_0x966d8b){if(_0x966d8b){return[_0x966d8b,![]];}return db[_0xe125('0xa8')]['create'](_0xde5aa6)[_0xe125('0x16')](function(_0xdd4609){return[_0xdd4609,!![]];});});}return db[_0xe125('0xa8')]['create'](_0xde5aa6)[_0xe125('0x16')](function(_0x348a6a){return[_0x348a6a,!![]];});}})[_0xe125('0xa9')](function(_0x45ea89,_0x2022b1){if(_0x45ea89){_0x2cc6fc=_0x2022b1;if(!_0x2022b1){var _0x13d15b={'from':(_0x5514a9[_0xe125('0xaa')]['firstName']||'')+'\x20'+(_0x5514a9[_0xe125('0xaa')][_0xe125('0x9a')]||'')};if(_0x53853f['body']['threadId']&&_0x53853f['body']['messageId']&&_0x53853f[_0xe125('0x4b')][_0xe125('0xa5')]!=_0x53853f[_0xe125('0x4b')][_0xe125('0xab')]){_0x13d15b[_0xe125('0xa5')]=_0x53853f['body'][_0xe125('0xab')];}return _0x45ea89[_0xe125('0x27')](_0x13d15b);}else{return _0x45ea89;}}})[_0xe125('0x16')](function(_0x4f9145){_0x5514a9[_0xe125('0xa7')]=_0x4f9145[_0xe125('0x28')]({'plain':!![]});_0x5514a9[_0xe125('0xa7')][_0xe125('0xac')]=_0x2cc6fc;if(_0x5514a9[_0xe125('0xa7')][_0xe125('0xac')]){if(_0x5514a9[_0xe125('0x8f')][_0xe125('0xad')]){_0x5514a9[_0xe125('0x90')][_0xe125('0xae')]({'id':0x0,'priority':_0x5514a9['applications'][_0xe125('0x3b')]+0x1,'app':_0xe125('0xaf'),'appdata':_0xe125('0xb0'),'interval':_0xe125('0xb1')});}}return db[_0xe125('0xb2')][_0xe125('0x4a')]({'body':_0x53853f[_0xe125('0x4b')][_0xe125('0x4b')],'ChatWebsiteId':_0x53853f[_0xe125('0x47')]['id'],'ChatInteractionId':_0x4f9145['id'],'direction':'in','ContactId':_0x5514a9[_0xe125('0xaa')]['id'],'AttachmentId':_0x53853f['body'][_0xe125('0xb3')]});})[_0xe125('0x16')](function(_0x570d43){_0x5514a9[_0xe125('0x1c')]=_0x570d43;if(_0x5514a9[_0xe125('0xa7')][_0xe125('0xb4')]){return db['User'][_0xe125('0x4f')]({'attributes':['id',_0xe125('0x2d')],'where':{'id':_0x5514a9[_0xe125('0xa7')][_0xe125('0xb4')]}})[_0xe125('0x16')](function(_0x3d62ce){if(_0x3d62ce){_0x5514a9[_0xe125('0x90')][_0xe125('0xb5')]({'id':0x0,'priority':0x0,'app':_0xe125('0xb6'),'appdata':_0x3d62ce[_0xe125('0x2d')]+','+(_0x5514a9['account'][_0xe125('0xb7')]||0xa),'interval':_0xe125('0xb1')});_0x5514a9[_0xe125('0xb8')]=!![];}return respondWithRpcPromise('Start',_0xe125('0xb9'),_0x5514a9);});}return respondWithRpcPromise('Start',_0xe125('0xb9'),_0x5514a9);})[_0xe125('0x16')](function(_0xa4f69a){respondWithRpcPromise(_0xe125('0xba'),'EventManager',{'event':'notify','message':_0xa4f69a},client9002);return _0xa4f69a;})[_0xe125('0x16')](respondWithResult(_0x3ed63e,null))['catch'](handleError(_0x3ed63e,null));};exports[_0xe125('0xbb')]=function(_0x5895da,_0xe41037){var _0x57ea18,_0xf77f9b,_0x17eeb1;var _0x3e27b5=[];var _0x413387={};var _0x60d3e7=_0x5895da[_0xe125('0xbc')]||[];var _0x4be6ca=[];var _0x5db52c;return db[_0xe125('0x7b')][_0xe125('0x52')]()[_0xe125('0x16')](function(_0x3d49b9){if(!_0x3d49b9){throw new db[(_0xe125('0x7c'))][(_0xe125('0x84'))](_0xe125('0x7d'));}_0x3e27b5=_[_0xe125('0x7e')](_[_0xe125('0x35')](_0x3d49b9),[_0xe125('0x7f'),'updatedAt',_0xe125('0x81'),'ListId']);if(_0x5895da[_0xe125('0x4b')]['id']){delete _0x5895da[_0xe125('0x4b')]['id'];}if(_[_0xe125('0x75')](_0x5895da[_0xe125('0x4b')][_0xe125('0x83')])){throw _0xe41037[_0xe125('0x20')](0x1f4)[_0xe125('0x2e')](new db[(_0xe125('0x7c'))][(_0xe125('0x84'))](_0xe125('0xbd')));}if(_[_0xe125('0x75')](_0x5895da[_0xe125('0x4b')][_0xe125('0x4b')])||_0x5895da[_0xe125('0x4b')][_0xe125('0x4b')]===''){throw _0xe41037[_0xe125('0x20')](0x1f4)['send'](new db[(_0xe125('0x7c'))]['ValidationError'](_0xe125('0x85')));}if(_[_0xe125('0x75')](_0x5895da[_0xe125('0x4b')][_0xe125('0xbe')])){throw _0xe41037['status'](0x1f4)[_0xe125('0x2e')](new db['Sequelize'][(_0xe125('0x84'))](_0xe125('0xbf')+_0x3e27b5));}if(!_['includes'](_0x3e27b5,_0x5895da['body'][_0xe125('0xbe')])){throw _0xe41037[_0xe125('0x20')](0x1f4)['send'](new db[(_0xe125('0x7c'))][(_0xe125('0x84'))](_0xe125('0xc0')+_0x3e27b5));}_0x413387[_0x5895da['body']['mapKeyOffline']]=_0x5895da[_0xe125('0x4b')][_0xe125('0x83')];})[_0xe125('0x16')](function(){return db[_0xe125('0x44')]['find']({'where':{'id':_0x5895da[_0xe125('0x47')]['id']},'include':[{'model':db[_0xe125('0x8a')],'as':_0xe125('0x8b')},{'model':db['MailAccount'],'as':_0xe125('0xc1')}]});})['then'](handleEntityNotFound(_0xe41037,null))[_0xe125('0x16')](function(_0x390f57){if(_0x390f57&&_0x390f57[_0xe125('0x8b')]){_0xf77f9b=_0x390f57;var _0x526651=_[_0xe125('0xc2')](_0x5895da[_0xe125('0x4b')],{'firstName':_0x5895da[_0xe125('0x4b')]['from'],'phone':_0x5895da['body'][_0xe125('0x83')],'ListId':_0x390f57[_0xe125('0x82')]});_0x526651[_0x5895da[_0xe125('0x4b')][_0xe125('0xbe')]]=_0x5895da[_0xe125('0x4b')][_0xe125('0x83')];return db[_0xe125('0x7b')][_0xe125('0xc3')]({'where':_0x413387,'defaults':_0x526651});}})[_0xe125('0xa9')](function(_0x3d5924){if(_0x3d5924){_0x17eeb1=_0x3d5924;var _0x28358d=fs[_0xe125('0xc4')](path[_0xe125('0x69')](config[_0xe125('0x6d')],_0xe125('0xc5')),_0xe125('0xc6'));var _0x4ddf4e=ejs['render'](_0x28358d,{'body':_[_0xe125('0xc7')](_0x5895da[_0xe125('0x4b')]['body']),'bodyTitle':_0xf77f9b[_0xe125('0xc8')]});return db[_0xe125('0xc9')]['create']({'body':_0x4ddf4e,'plainBody':htmlToText[_0xe125('0xca')](_0x4ddf4e),'ContactId':_0x3d5924['id'],'ChatWebsiteId':_0xf77f9b['id']});}})[_0xe125('0x16')](function(_0x8b0115){_0x5db52c=_0x8b0115;if(_0x60d3e7[_0xe125('0x3b')]){var _0x4c3f77=_0x60d3e7[_0xe125('0x33')](function(_0x436737){return{'name':_0x436737['originalname'],'basename':_0x436737['filename'],'type':_0x436737[_0xe125('0xcb')],'ChatOfflineMessageId':_0x8b0115['id']};});_0x4be6ca=_0x4c3f77[_0xe125('0x33')](_0x35c7b1=>{var _0x2376bd={'filename':_0x35c7b1[_0xe125('0x2d')],'path':path['join'](config[_0xe125('0x6d')],_0xe125('0xcc'),'files',_0xe125('0xcd'),'offline-chat',_0x35c7b1[_0xe125('0xce')])};return _0x2376bd;});if(!_0xf77f9b[_0xe125('0xcf')]){return db[_0xe125('0xd0')][_0xe125('0xd1')](function(_0x4772ec){return db[_0xe125('0xd2')]['bulkCreate'](_0x4c3f77,{'transaction':_0x4772ec});});}}})[_0xe125('0x16')](function(){if(_0x5db52c){_0x57ea18=_0x5db52c;return db[_0xe125('0xc1')][_0xe125('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0xe125('0xd3')],'as':_0xe125('0xd4'),'raw':!![],'include':[{'model':db[_0xe125('0xd5')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xe125('0x16')](function(_0xffcce9){if(_0xffcce9&&_0xffcce9[_0xe125('0xd4')]&&_0xf77f9b['forwardOffline']&&_0xf77f9b[_0xe125('0xd6')]){var _0x9550d5=_0xffcce9[_0xe125('0xd7')]();return respondWithRpcPromise(_0xe125('0xd8'),_0xe125('0xd9'),{'account':_0x9550d5,'message':{'from':util['format'](_0xe125('0xda'),_0xffcce9[_0xe125('0x2d')],_0xffcce9['email']||_0xffcce9[_0xe125('0xd4')]['user']),'to':_0xf77f9b[_0xe125('0xd6')],'subject':_0xf77f9b[_0xe125('0xdb')],'html':_0x57ea18[_0xe125('0x4b')],'attachments':_0x4be6ca}},client9003)['then'](function(){return _0x57ea18;})[_0xe125('0x1e')](function(_0x5292ac){logger[_0xe125('0x1a')](_0x5292ac);});}})[_0xe125('0x16')](function(){if(_0xf77f9b&&_0xf77f9b['openNewInteraction']&&_0xf77f9b[_0xe125('0xdc')]){var _0x5a5622=[];if(_0x60d3e7['length']){_0x5a5622=_0x60d3e7[_0xe125('0x33')](function(_0x22d1e8){return{'name':_0x22d1e8['originalname'],'basename':_0x22d1e8['filename'],'type':_0x22d1e8[_0xe125('0xcb')],'ChatOfflineMessageId':_0x5db52c['id']};});}var _0x1c9896;if(!_[_0xe125('0x75')](_0xf77f9b[_0xe125('0xdd')])){var _0x139c1e=_[_0xe125('0x33')](_0x5895da[_0xe125('0x4b')],function(_0x568d51){return _0x568d51;});var _0x297877=_[_0xe125('0xde')](_0x139c1e)[0x0];var _0x541a5c=_[_0xe125('0xdf')](_0x297877,function(_0x3a9ba0){return _0x3a9ba0;});_0x1c9896=_0x541a5c[0x1][_0xf77f9b[_0xe125('0xdd')]];}var _0x4e253c={'from':_0x17eeb1['email'],'firstName':_0x17eeb1[_0xe125('0xe0')],'lastName':_0x17eeb1[_0xe125('0x9a')],'mapKey':_0xe125('0xe1'),'message':{'from':_0x17eeb1['email'],'to':_0xf77f9b[_0xe125('0xc1')][_0xe125('0xe1')],'cc':'','subject':_[_0xe125('0x75')](_0x1c9896)?_0xf77f9b[_0xe125('0xdb')]:_0x1c9896,'messageId':'','sentAt':new Date(),'attach':_0x5a5622[_0xe125('0x3b')],'attachments':_0x5a5622,'originChannel':_0xe125('0xe2'),'ChatWebsiteId':_0xf77f9b['id'],'ChatOfflineMessageId':_0x57ea18['id'],'originTo':_0xf77f9b[_0xe125('0xc1')]['email']},'body':_0x57ea18[_0xe125('0x4b')]};var _0x190376={'account':{'id':_0xf77f9b['MailAccountId']},'body':_0x4e253c,'log':_0xe125('0xe3')};return respondWithRpcPromise(_0xe125('0xe3'),_0xe125('0xe4'),_0x190376,client9001)[_0xe125('0x16')](function(){return _0x57ea18;})['catch'](function(_0x23834e){logger[_0xe125('0x1a')](_0x23834e);});}return;})[_0xe125('0x16')](function(){if(_0x57ea18){return _0x57ea18;}})[_0xe125('0x16')](respondWithResult(_0xe41037,null))['catch'](function(_0x591337){logger[_0xe125('0x1a')]('catch',_0x591337);for(var _0x21f4a6 of _0x60d3e7){var _0x561ec7=path['join'](config[_0xe125('0x6d')],_0xe125('0xcc'),_0xe125('0xbc'),_0xe125('0xcd'),_0xe125('0xe5'),_0x21f4a6['filename']);fs_extra[_0xe125('0xe6')](_0x561ec7)[_0xe125('0x1e')](function(_0x9f9a7){logger[_0xe125('0x1a')](_0xe125('0xe7'),_0x561ec7,_0x9f9a7);});}});};exports[_0xe125('0xe8')]=function(_0x529cc9,_0x4431d7){return db[_0xe125('0xa8')][_0xe125('0x4f')]({'where':{'id':_0x529cc9[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x4431d7,null))['then'](function(_0x44f873){if(_0x44f873){return _0x44f873[_0xe125('0xe8')](_0x529cc9[_0xe125('0x4b')][_0xe125('0x59')],_[_0xe125('0xe9')](_0x529cc9['body'],[_0xe125('0x59'),'id'])||{});}})[_0xe125('0x16')](respondWithResult(_0x4431d7,null))[_0xe125('0x1e')](handleError(_0x4431d7,null));};exports[_0xe125('0xea')]=function(_0x316189,_0x1adf3b){var _0x240d22={'raw':![],'where':{}};var _0x330a7c={};var _0x12f65a={'count':0x0,'rows':[]};return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0x316189['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1adf3b,null))[_0xe125('0x16')](function(_0x12db44){if(_0x12db44){_0x330a7c[_0xe125('0x38')]=_[_0xe125('0x35')](db[_0xe125('0xa8')][_0xe125('0x31')]);_0x330a7c[_0xe125('0x34')]=_[_0xe125('0x35')](_0x316189['query']);_0x330a7c[_0xe125('0x36')]=_['intersection'](_0x330a7c['model'],_0x330a7c[_0xe125('0x34')]);_0x240d22[_0xe125('0x39')]=_[_0xe125('0x37')](_0x330a7c[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x316189[_0xe125('0x34')]['fields']));_0x240d22[_0xe125('0x39')]=_0x240d22[_0xe125('0x39')][_0xe125('0x3b')]?_0x240d22['attributes']:_0x330a7c[_0xe125('0x38')];if(!_0x316189[_0xe125('0x34')][_0xe125('0xeb')](_0xe125('0x3c'))){_0x240d22['limit']=qs['limit'](_0x316189[_0xe125('0x34')]['limit']);_0x240d22['offset']=qs[_0xe125('0x24')](_0x316189[_0xe125('0x34')]['offset']);}_0x240d22[_0xe125('0x3d')]=qs[_0xe125('0x3e')](_0x316189[_0xe125('0x34')]['sort']);_0x240d22['where']=qs['filters'](_['pick'](_0x316189[_0xe125('0x34')],_0x330a7c[_0xe125('0x36')]));_0x240d22[_0xe125('0x3f')][_0xe125('0x57')]=_0x12db44['id'];if(_0x316189['query']['filter']){_0x240d22[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x240d22['where'],{'$or':_[_0xe125('0x33')](_0x240d22['attributes'],function(_0x4bfa20){var _0x36fd6d={};_0x36fd6d[_0x4bfa20]={'$like':'%'+_0x316189[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x36fd6d;})});}_0x240d22=_[_0xe125('0x41')]({},_0x240d22,_0x316189[_0xe125('0x43')]);return db[_0xe125('0xa8')][_0xe125('0x25')]({'where':_0x240d22[_0xe125('0x3f')]})['then'](function(_0x555d53){_0x12f65a['count']=_0x555d53;if(_0x316189['query']['includeAll']){_0x240d22[_0xe125('0x49')]=[{'model':db[_0xe125('0x7b')],'as':_0xe125('0xec'),'required':![]},{'model':db[_0xe125('0xed')],'as':_0xe125('0xee'),'attributes':[_0xe125('0x2d'),_0xe125('0xef'),_0xe125('0xf0')],'required':![]},{'model':db[_0xe125('0xf1')],'as':'Tags','attributes':['id',_0xe125('0x2d'),'color'],'where':_0x316189[_0xe125('0x34')]['tag']?{'id':_0x316189[_0xe125('0x34')][_0xe125('0xf2')]}:undefined,'required':_0x316189[_0xe125('0x34')][_0xe125('0xf2')]?!![]:![]}];}return db['ChatInteraction'][_0xe125('0x45')](_0x240d22);})['then'](function(_0x3ff21c){_0x12f65a[_0xe125('0x46')]=_0x3ff21c;return _0x12f65a;});}})[_0xe125('0x16')](respondWithFilteredResult(_0x1adf3b,_0x240d22))[_0xe125('0x1e')](handleError(_0x1adf3b,null));};function iftimePromise(_0x26685e,_0x3d2217){return respondWithRpcPromise(_0xe125('0xf3'),_0xe125('0xf4'),{'command':_0x3d2217[_0xe125('0xf5')]?util[_0xe125('0x9f')](_0xe125('0xf6'),_0x26685e[_0xe125('0xf7')],_0x3d2217[_0xe125('0xf5')]):util[_0xe125('0x9f')](_0xe125('0xf8'),_0x26685e['interval'])},client9002)['then'](function(_0x1b3cbc){var _0x42928d=_0x1b3cbc&&_0x1b3cbc['indexOf']('true')>=0x0?!![]:![];logger['info'](_0xe125('0xf9'),_0x3d2217['id'],_0x26685e['id'],_0x26685e['interval'],_0x42928d?'ONLINE':_0xe125('0xfa'),_0x3d2217['timezone']?_0x3d2217['timezone']:'No\x20timezone');return _0x42928d;})[_0xe125('0x1e')](function(_0x1e5df5){logger['error'](_0xe125('0xf9'),_0x3d2217['id'],_0x26685e['id'],_0x26685e['interval'],util[_0xe125('0xfb')](_0x1e5df5,{'showHidden':![],'depth':null}),_0x3d2217['timezone']?_0x3d2217['timezone']:_0xe125('0xfc'));return![];});}exports[_0xe125('0xf4')]=function(_0x27eded,_0x5f1022){var _0x59c0ef=0x0;var _0x111468=0x0;var _0xc743b0=![];var _0x30bcfa;var _0x43cd3d;return db[_0xe125('0x44')][_0xe125('0x4f')]({'where':{'id':_0x27eded[_0xe125('0x47')]['id']},'include':[{'model':db[_0xe125('0xfd')],'as':'Interval','include':[{'model':db[_0xe125('0xfd')],'as':_0xe125('0xfe'),'attributes':['id',_0xe125('0xf7')],'raw':!![]}]}]})[_0xe125('0x16')](handleEntityNotFound(_0x5f1022,null))[_0xe125('0x16')](function(_0x4d380f){if(_0x4d380f){_0x30bcfa=_0x4d380f;return _0x4d380f[_0xe125('0xff')]({'raw':!![]});}})[_0xe125('0x16')](function(_0x168422){if(_0x30bcfa){if(_0x168422){_0x43cd3d=_0x168422;}}return require(_0xe125('0x6b'))[_0xe125('0x100')]();})[_0xe125('0x16')](function(_0xee893d){if(_0xee893d){_0x111468=_0xee893d['virtual'];_0xc743b0=_0xee893d[_0xe125('0x6c')];}})['then'](function(){return db[_0xe125('0xa8')][_0xe125('0x25')]({'where':{'closed':![]}});})[_0xe125('0x16')](function(_0x207d54){_0x59c0ef=_0x207d54;if(_0x111468&&_0x207d54>_0x111468){return db['License'][_0xe125('0x5d')]({'where':{'id':0x1}})[_0xe125('0x16')](function(_0x2eeb67){if(_0x2eeb67){_0x2eeb67[_0xe125('0x101')](_0xe125('0x102'));}});}})['then'](function(){if(_0x30bcfa['Interval']&&_0x30bcfa[_0xe125('0xfd')]['Intervals']){var _0x12738c=[];for(var _0xee37ac=0x0;_0xee37ac<_0x30bcfa['Interval'][_0xe125('0xfe')][_0xe125('0x3b')];_0xee37ac++){var _0x263cf5=_0x30bcfa[_0xe125('0xfd')]['Intervals'][_0xee37ac][_0xe125('0x28')]({'plain':!![]});_0x12738c[_0xe125('0xae')](iftimePromise(_0x263cf5,_0x30bcfa));}return BPromise['all'](_0x12738c)['then'](function(_0x43cdbe){return _[_0xe125('0x103')](_0x43cdbe);});}else{return!![];}})[_0xe125('0x16')](function(_0x368115){var _0x3a25c8=fs[_0xe125('0xc4')](path[_0xe125('0x69')](config['root'],_0xe125('0x104')),_0xe125('0xc6'));var _0x3197d3={'remote':_0x30bcfa['remote'],'query':querystring[_0xe125('0x105')](_[_0xe125('0x41')](_0x30bcfa[_0xe125('0x28')]({'plain':!![]}),{'customerIp':_0x27eded[_0xe125('0x95')][_0xe125('0x98')]||_0x27eded[_0xe125('0x95')][_0xe125('0x106')]||_0x27eded[_0xe125('0x107')]['remoteAddress']||_0x27eded['ip'],'referer':_0x27eded[_0xe125('0x95')][_0xe125('0x9c')],'openedInteractions':_0x59c0ef,'maxInteractions':_0x111468,'virtual':_0xc743b0[_0xe125('0x108')],'online':_0x368115,'custom':_0xc743b0}))[_0xe125('0x109')](/'/g,'\x5c\x27')};_0x5f1022[_0xe125('0x2e')](ejs[_0xe125('0x10a')](Mustache[_0xe125('0x10a')](_0x3a25c8,_0x3197d3),{'proactiveActions':_0x43cd3d,'alignment':_0x30bcfa['alignment'],'verticalAlignment':_0x30bcfa[_0xe125('0x10b')],'div_color':_0x30bcfa['color'],'labelText':_0x30bcfa[_0xe125('0x10c')],'text_color':_0x30bcfa[_0xe125('0x10d')],'text_button_color':_0x30bcfa[_0xe125('0x10e')],'button_color':_0x30bcfa[_0xe125('0x10f')],'background_color':_0x30bcfa[_0xe125('0x110')],'hideWhenOffline':_0x30bcfa['hideWhenOffline'],'interval':_0x30bcfa['IntervalId']}));})['catch'](handleError(_0x5f1022,null));};exports[_0xe125('0x111')]=function(_0x201dd3,_0x47703d){var _0x260b03=_0x201dd3[_0xe125('0x47')]['id'];var _0x1ef9a7=_0x201dd3['body'];var _0x2498fb=0xc8;var _0x3c1293=null;return db['sequelize'][_0xe125('0xd1')]({'isolationLevel':db['sequelize'][_0xe125('0x112')][_0xe125('0x113')][_0xe125('0x114')]},function(_0x52fbef){return db['ChatWebsite'][_0xe125('0x5d')]({'where':{'id':_0x260b03},'transaction':_0x52fbef})[_0xe125('0x16')](function(_0x320ad2){if(_0x320ad2){return db[_0xe125('0x115')][_0xe125('0x2b')]({'where':{'ChatWebsiteId':_0x260b03},'transaction':_0x52fbef})['then'](function(){var _0x3cc0ff=_['map'](_0x1ef9a7,function(_0x2648b2){_0x2648b2[_0xe125('0x57')]=_0x260b03;return _0x2648b2;});return db[_0xe125('0x115')][_0xe125('0x116')](_0x3cc0ff,{'transaction':_0x52fbef});});}else{_0x2498fb=0x194;_0x3c1293=[];}});})[_0xe125('0x16')](function(){if(_0x2498fb!==0x194){return db['ChatApplication'][_0xe125('0x117')]({'where':{'ChatWebsiteId':_0x260b03},'order':'priority'})[_0xe125('0x16')](function(_0x5d8f68){_0x3c1293=_0x5d8f68;});}})[_0xe125('0x1e')](function(_0x3bc7b9){_0x2498fb=0x1f4;logger['error'](_0x3bc7b9[_0xe125('0x2c')]);if(_0x3bc7b9['name']){delete _0x3bc7b9[_0xe125('0x2d')];}_0x3c1293=_0x3bc7b9;})['finally'](function(){if(_0x3c1293===null){_0x47703d[_0xe125('0x1f')](_0x2498fb);}else{if(_0x2498fb===0x1f4){_0x47703d[_0xe125('0x20')](_0x2498fb)['send'](_0x3c1293);}else{_0x47703d['status'](_0x2498fb)[_0xe125('0x21')](_0x3c1293);}}});};exports[_0xe125('0x118')]=function(_0x28fe53,_0x4f53c2){var _0x19d6db={};var _0x356b49={};var _0x3bedcb;var _0x206300;return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0x28fe53[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x4f53c2,null))[_0xe125('0x16')](function(_0x51f21b){if(_0x51f21b){_0x3bedcb=_0x51f21b;_0x356b49[_0xe125('0x38')]=_['keys'](db[_0xe125('0x115')][_0xe125('0x31')]);_0x356b49[_0xe125('0x34')]=_[_0xe125('0x35')](_0x28fe53[_0xe125('0x34')]);_0x356b49[_0xe125('0x36')]=_[_0xe125('0x37')](_0x356b49['model'],_0x356b49[_0xe125('0x34')]);_0x19d6db['attributes']=_[_0xe125('0x37')](_0x356b49[_0xe125('0x38')],qs['fields'](_0x28fe53['query']['fields']));_0x19d6db[_0xe125('0x39')]=_0x19d6db['attributes']['length']?_0x19d6db[_0xe125('0x39')]:_0x356b49[_0xe125('0x38')];_0x19d6db['order']=qs['sort'](_0x28fe53['query'][_0xe125('0x3e')]);_0x19d6db[_0xe125('0x3f')]=qs[_0xe125('0x36')](_[_0xe125('0x56')](_0x28fe53[_0xe125('0x34')],_0x356b49[_0xe125('0x36')]));if(_0x28fe53['query'][_0xe125('0x40')]){_0x19d6db['where']=_[_0xe125('0x41')](_0x19d6db['where'],{'$or':_['map'](_0x19d6db[_0xe125('0x39')],function(_0x20b6a4){var _0x468763={};_0x468763[_0x20b6a4]={'$like':'%'+_0x28fe53[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x468763;})});}_0x19d6db=_[_0xe125('0x41')]({},_0x19d6db,_0x28fe53[_0xe125('0x43')]);return _0x3bedcb[_0xe125('0x118')](_0x19d6db);}})[_0xe125('0x16')](function(_0x52f0cc){if(_0x52f0cc){_0x206300=_0x52f0cc[_0xe125('0x3b')];if(!_0x28fe53[_0xe125('0x34')][_0xe125('0xeb')](_0xe125('0x3c'))){_0x19d6db['limit']=qs[_0xe125('0x23')](_0x28fe53[_0xe125('0x34')][_0xe125('0x23')]);_0x19d6db[_0xe125('0x24')]=qs['offset'](_0x28fe53[_0xe125('0x34')][_0xe125('0x24')]);}return _0x3bedcb['getApplications'](_0x19d6db);}})[_0xe125('0x16')](function(_0x126530){if(_0x126530){return _0x126530?{'count':_0x206300,'rows':_0x126530}:null;}})[_0xe125('0x16')](respondWithResult(_0x4f53c2,null))[_0xe125('0x1e')](handleError(_0x4f53c2,null));};exports[_0xe125('0x119')]=function(_0x4fcdd4,_0x558eed){return db[_0xe125('0x11a')][_0xe125('0x4f')]({'where':{'id':_0x4fcdd4[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x558eed,null))[_0xe125('0x16')](function(_0x36df14){if(_0x36df14){return _0x36df14['addProactiveActions'](_0x4fcdd4[_0xe125('0x4b')][_0xe125('0x59')],_[_0xe125('0xe9')](_0x4fcdd4[_0xe125('0x4b')],[_0xe125('0x59'),'id'])||{});}})[_0xe125('0x16')](respondWithResult(_0x558eed,null))['catch'](handleError(_0x558eed,null));};exports[_0xe125('0xff')]=function(_0x361e73,_0xbb8495){var _0x487b1d={};var _0x1fad22={};var _0x5951f9;var _0x77b5d3;return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0x361e73['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0xbb8495,null))[_0xe125('0x16')](function(_0x26a0b5){if(_0x26a0b5){_0x5951f9=_0x26a0b5;_0x1fad22[_0xe125('0x38')]=_[_0xe125('0x35')](db[_0xe125('0x11b')]['rawAttributes']);_0x1fad22[_0xe125('0x34')]=_[_0xe125('0x35')](_0x361e73[_0xe125('0x34')]);_0x1fad22[_0xe125('0x36')]=_['intersection'](_0x1fad22[_0xe125('0x38')],_0x1fad22['query']);_0x487b1d['attributes']=_[_0xe125('0x37')](_0x1fad22[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x361e73[_0xe125('0x34')][_0xe125('0x3a')]));_0x487b1d[_0xe125('0x39')]=_0x487b1d[_0xe125('0x39')][_0xe125('0x3b')]?_0x487b1d[_0xe125('0x39')]:_0x1fad22[_0xe125('0x38')];_0x487b1d[_0xe125('0x3d')]=qs['sort'](_0x361e73[_0xe125('0x34')]['sort']);_0x487b1d[_0xe125('0x3f')]=qs[_0xe125('0x36')](_[_0xe125('0x56')](_0x361e73[_0xe125('0x34')],_0x1fad22['filters']));if(_0x361e73[_0xe125('0x34')][_0xe125('0x40')]){_0x487b1d[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x487b1d[_0xe125('0x3f')],{'$or':_[_0xe125('0x33')](_0x487b1d[_0xe125('0x39')],function(_0x12e06d){var _0x3d55c7={};_0x3d55c7[_0x12e06d]={'$like':'%'+_0x361e73[_0xe125('0x34')]['filter']+'%'};return _0x3d55c7;})});}_0x487b1d=_['merge']({},_0x487b1d,_0x361e73[_0xe125('0x43')]);return _0x5951f9['getProactiveActions'](_0x487b1d);}})[_0xe125('0x16')](function(_0x4fbb27){if(_0x4fbb27){_0x77b5d3=_0x4fbb27[_0xe125('0x3b')];if(!_0x361e73['query']['hasOwnProperty'](_0xe125('0x3c'))){_0x487b1d[_0xe125('0x23')]=qs[_0xe125('0x23')](_0x361e73[_0xe125('0x34')]['limit']);_0x487b1d[_0xe125('0x24')]=qs[_0xe125('0x24')](_0x361e73[_0xe125('0x34')][_0xe125('0x24')]);}return _0x5951f9['getProactiveActions'](_0x487b1d);}})[_0xe125('0x16')](function(_0x214113){if(_0x214113){return _0x214113?{'count':_0x77b5d3,'rows':_0x214113}:null;}})[_0xe125('0x16')](respondWithResult(_0xbb8495,null))[_0xe125('0x1e')](handleError(_0xbb8495,null));};exports['getFields']=function(_0x3aade1,_0x364883){var _0x5b6b82=_0x3aade1[_0xe125('0x34')]['online']==='false'?_0xe125('0x11c'):_0xe125('0x11d');return db[_0xe125('0x44')]['find']({'attributes':['id',_0x5b6b82],'where':{'id':_0x3aade1[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x364883,null))[_0xe125('0x16')](function(_0x530930){if(_0x530930){var _0x207215=_0x530930[_0x5b6b82];var _0x1cdede=_0x207215&&_0x207215[_0xe125('0x11e')]?_0x207215[_0xe125('0x11e')]:[];_0x364883['send']({'fromKey':_[_0xe125('0x75')](_0x207215['fromKey'])?undefined:_0x207215['fromKey'],'count':_0x1cdede[_0xe125('0x3b')],'rows':_0x1cdede});}})['catch'](handleError(_0x364883,null));};exports[_0xe125('0x11f')]=function(_0xa044c0,_0x4b7df2){var _0x40cc08={'raw':![],'where':{}};var _0x1ebfc5={};var _0x4f0ec8={'count':0x0,'rows':[]};return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0xa044c0['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x4b7df2,null))[_0xe125('0x16')](function(_0x2b90a3){if(_0x2b90a3){_0x1ebfc5[_0xe125('0x38')]=_[_0xe125('0x35')](db[_0xe125('0xc9')]['rawAttributes']);_0x1ebfc5[_0xe125('0x34')]=_[_0xe125('0x35')](_0xa044c0[_0xe125('0x34')]);_0x1ebfc5['filters']=_[_0xe125('0x37')](_0x1ebfc5[_0xe125('0x38')],_0x1ebfc5[_0xe125('0x34')]);_0x40cc08['attributes']=_[_0xe125('0x37')](_0x1ebfc5[_0xe125('0x38')],qs['fields'](_0xa044c0[_0xe125('0x34')][_0xe125('0x3a')]));_0x40cc08[_0xe125('0x39')]=_0x40cc08['attributes'][_0xe125('0x3b')]?_0x40cc08[_0xe125('0x39')]:_0x1ebfc5[_0xe125('0x38')];if(!_0xa044c0[_0xe125('0x34')]['hasOwnProperty'](_0xe125('0x3c'))){_0x40cc08['limit']=qs[_0xe125('0x23')](_0xa044c0[_0xe125('0x34')][_0xe125('0x23')]);_0x40cc08['offset']=qs['offset'](_0xa044c0['query']['offset']);}_0x40cc08[_0xe125('0x3d')]=qs[_0xe125('0x3e')](_0xa044c0[_0xe125('0x34')]['sort']);_0x40cc08[_0xe125('0x3f')]=qs[_0xe125('0x36')](_[_0xe125('0x56')](_0xa044c0[_0xe125('0x34')],_0x1ebfc5['filters']));_0x40cc08[_0xe125('0x3f')][_0xe125('0x57')]=_0x2b90a3['id'];if(_0xa044c0[_0xe125('0x34')][_0xe125('0x40')]){_0x40cc08[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x40cc08[_0xe125('0x3f')],{'$or':_[_0xe125('0x33')](_0x40cc08[_0xe125('0x39')],function(_0x5e89ec){var _0x1636da={};_0x1636da[_0x5e89ec]={'$like':'%'+_0xa044c0[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x1636da;})});}_0x40cc08=_[_0xe125('0x41')]({},_0x40cc08,_0xa044c0['options']);return db[_0xe125('0xc9')][_0xe125('0x25')]({'where':_0x40cc08[_0xe125('0x3f')]})[_0xe125('0x16')](function(_0x4a7524){_0x4f0ec8['count']=_0x4a7524;if(_0xa044c0[_0xe125('0x34')][_0xe125('0x48')]){_0x40cc08[_0xe125('0x49')]=[{'all':!![]}];}else{_0x40cc08['include']=[{'model':db[_0xe125('0x7b')],'as':_0xe125('0xec'),'required':![]},{'model':db['Attachment'],'as':_0xe125('0x120'),'required':![]}];}return db[_0xe125('0xc9')][_0xe125('0x45')](_0x40cc08);})[_0xe125('0x16')](function(_0x466ce8){_0x4f0ec8[_0xe125('0x46')]=_0x466ce8;return _0x4f0ec8;});}})['then'](respondWithFilteredResult(_0x4b7df2,_0x40cc08))['catch'](handleError(_0x4b7df2,null));};exports['addAgents']=function(_0x5804c0,_0x1d3960){return db['ChatWebsite'][_0xe125('0x4f')]({'where':{'id':_0x5804c0[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1d3960,null))['then'](function(_0x2758e1){if(_0x2758e1){return _0x2758e1[_0xe125('0x121')](_0x5804c0[_0xe125('0x4b')]['ids'],_[_0xe125('0xe9')](_0x5804c0['body'],[_0xe125('0x59'),'id'])||{})[_0xe125('0xa9')](function(_0x463555){for(var _0x57689b=0x0;_0x57689b<_0x5804c0[_0xe125('0x4b')]['ids']['length'];_0x57689b+=0x1){socket[_0xe125('0x122')](_0xe125('0x123'),{'UserId':Number(_0x5804c0[_0xe125('0x4b')][_0xe125('0x59')][_0x57689b]),'ChatWebsiteId':Number(_0x5804c0[_0xe125('0x47')]['id'])});}return _0x463555;});}})[_0xe125('0x16')](respondWithResult(_0x1d3960,null))[_0xe125('0x1e')](handleError(_0x1d3960,null));};exports[_0xe125('0x124')]=function(_0x57af13,_0x1166d0){return db[_0xe125('0x44')][_0xe125('0x4f')]({'where':{'id':_0x57af13['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1166d0,null))[_0xe125('0x16')](function(_0x1db424){if(_0x1db424){return _0x1db424['removeAgents'](_0x57af13[_0xe125('0x34')][_0xe125('0x59')])['then'](function(){if(_[_0xe125('0x125')](_0x57af13[_0xe125('0x34')]['ids'])){for(var _0x194a28=0x0;_0x194a28<_0x57af13[_0xe125('0x34')]['ids'][_0xe125('0x3b')];_0x194a28+=0x1){socket[_0xe125('0x122')](_0xe125('0x126'),{'UserId':Number(_0x57af13[_0xe125('0x34')][_0xe125('0x59')][_0x194a28]),'ChatWebsiteId':Number(_0x57af13[_0xe125('0x47')]['id'])});}}else{socket[_0xe125('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x57af13['query'][_0xe125('0x59')]),'ChatWebsiteId':Number(_0x57af13[_0xe125('0x47')]['id'])});}});}})[_0xe125('0x16')](respondWithStatusCode(_0x1166d0,null))[_0xe125('0x1e')](handleError(_0x1166d0,null));};exports[_0xe125('0x127')]=function(_0x1150db,_0x1a2808){var _0x21313e={};var _0x11f07f={};var _0x5d4d5c;var _0x2f1ff2;return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0x1150db[_0xe125('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a2808,null))[_0xe125('0x16')](function(_0x3d836c){if(_0x3d836c){_0x5d4d5c=_0x3d836c;_0x11f07f[_0xe125('0x38')]=_[_0xe125('0x35')](db['User'][_0xe125('0x31')]);_0x11f07f[_0xe125('0x34')]=_[_0xe125('0x35')](_0x1150db[_0xe125('0x34')]);_0x11f07f['filters']=_[_0xe125('0x37')](_0x11f07f[_0xe125('0x38')],_0x11f07f['query']);_0x21313e['attributes']=_[_0xe125('0x37')](_0x11f07f[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x1150db['query'][_0xe125('0x3a')]));_0x21313e['attributes']=_0x21313e['attributes'][_0xe125('0x3b')]?_0x21313e[_0xe125('0x39')]:_0x11f07f[_0xe125('0x38')];_0x21313e['order']=qs[_0xe125('0x3e')](_0x1150db['query']['sort']);_0x21313e[_0xe125('0x3f')]=qs[_0xe125('0x36')](_[_0xe125('0x56')](_0x1150db[_0xe125('0x34')],_0x11f07f[_0xe125('0x36')]));if(_0x1150db['query'][_0xe125('0x40')]){_0x21313e[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x21313e[_0xe125('0x3f')],{'$or':_[_0xe125('0x33')](_0x21313e[_0xe125('0x39')],function(_0x414910){var _0x397508={};_0x397508[_0x414910]={'$like':'%'+_0x1150db['query'][_0xe125('0x40')]+'%'};return _0x397508;})});}_0x21313e=_[_0xe125('0x41')]({},_0x21313e,_0x1150db[_0xe125('0x43')]);return _0x5d4d5c['getAgents'](_0x21313e);}})[_0xe125('0x16')](function(_0x104967){if(_0x104967){_0x2f1ff2=_0x104967[_0xe125('0x3b')];if(!_0x1150db['query'][_0xe125('0xeb')](_0xe125('0x3c'))){_0x21313e[_0xe125('0x23')]=qs[_0xe125('0x23')](_0x1150db[_0xe125('0x34')][_0xe125('0x23')]);_0x21313e[_0xe125('0x24')]=qs[_0xe125('0x24')](_0x1150db[_0xe125('0x34')][_0xe125('0x24')]);}return _0x5d4d5c['getAgents'](_0x21313e);}})[_0xe125('0x16')](function(_0x5652f2){if(_0x5652f2){return _0x5652f2?{'count':_0x2f1ff2,'rows':_0x5652f2}:null;}})[_0xe125('0x16')](respondWithResult(_0x1a2808,null))[_0xe125('0x1e')](handleError(_0x1a2808,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index b1102f9..eb521b1 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 _0xc01b=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0xdaa9d9,_0x169b70){var _0x1d2b7f=function(_0x28f55b){while(--_0x28f55b){_0xdaa9d9['push'](_0xdaa9d9['shift']());}};_0x1d2b7f(++_0x169b70);}(_0xc01b,0x74));var _0xbc01=function(_0x33006f,_0x3ade2c){_0x33006f=_0x33006f-0x0;var _0x435d96=_0xc01b[_0x33006f];return _0x435d96;};'use strict';var EventEmitter=require(_0xbc01('0x0'));var ChatWebsite=require(_0xbc01('0x1'))['db'][_0xbc01('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbc01('0x3')](0x0);var events={'afterCreate':_0xbc01('0x4'),'afterUpdate':_0xbc01('0x5'),'afterDestroy':_0xbc01('0x6')};function emitEvent(_0x5ede59){return function(_0x2c35d0,_0x133078,_0x222fa3){ChatWebsiteEvents[_0xbc01('0x7')](_0x5ede59+':'+_0x2c35d0['id'],_0x2c35d0);ChatWebsiteEvents[_0xbc01('0x7')](_0x5ede59,_0x2c35d0);_0x222fa3(null);};}for(var e in events){if(events[_0xbc01('0x8')](e)){var event=events[e];ChatWebsite[_0xbc01('0x9')](e,emitEvent(event));}}module[_0xbc01('0xa')]=ChatWebsiteEvents; \ No newline at end of file +var _0x4944=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3e1028,_0x1d49b6){var _0x277987=function(_0x1ec399){while(--_0x1ec399){_0x3e1028['push'](_0x3e1028['shift']());}};_0x277987(++_0x1d49b6);}(_0x4944,0x6d));var _0x4494=function(_0x5b43be,_0x31529e){_0x5b43be=_0x5b43be-0x0;var _0x3e5d5d=_0x4944[_0x5b43be];return _0x3e5d5d;};'use strict';var EventEmitter=require(_0x4494('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x4494('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4494('0x2')](0x0);var events={'afterCreate':_0x4494('0x3'),'afterUpdate':_0x4494('0x4'),'afterDestroy':_0x4494('0x5')};function emitEvent(_0x5074d9){return function(_0x187098,_0x5c7492,_0x370748){ChatWebsiteEvents[_0x4494('0x6')](_0x5074d9+':'+_0x187098['id'],_0x187098);ChatWebsiteEvents[_0x4494('0x6')](_0x5074d9,_0x187098);_0x370748(null);};}for(var e in events){if(events[_0x4494('0x7')](e)){var event=events[e];ChatWebsite[_0x4494('0x8')](e,emitEvent(event));}}module[_0x4494('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 96963bf..5b3a3b8 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 _0xc484=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x32db60,_0x180a5d){var _0x323891=function(_0x4b1fcd){while(--_0x4b1fcd){_0x32db60['push'](_0x32db60['shift']());}};_0x323891(++_0x180a5d);}(_0xc484,0xb5));var _0x4c48=function(_0x2b71e0,_0x313267){_0x2b71e0=_0x2b71e0-0x0;var _0x36ca99=_0xc484[_0x2b71e0];return _0x36ca99;};'use strict';var _=require(_0x4c48('0x0'));var util=require(_0x4c48('0x1'));var logger=require(_0x4c48('0x2'))(_0x4c48('0x3'));var moment=require('moment');var BPromise=require(_0x4c48('0x4'));var rp=require(_0x4c48('0x5'));var fs=require('fs');var path=require(_0x4c48('0x6'));var rimraf=require(_0x4c48('0x7'));var config=require(_0x4c48('0x8'));var attributes=require(_0x4c48('0x9'));module[_0x4c48('0xa')]=function(_0x56098e,_0x1286ad){return _0x56098e[_0x4c48('0xb')](_0x4c48('0xc'),attributes,{'tableName':_0x4c48('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf50f=['define','ChatWebsite','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xf50f,0xde));var _0xff50=function(_0x35bbd3,_0x5080c0){_0x35bbd3=_0x35bbd3-0x0;var _0x1fb3cc=_0xf50f[_0x35bbd3];return _0x1fb3cc;};'use strict';var _=require(_0xff50('0x0'));var util=require(_0xff50('0x1'));var logger=require('../../config/logger')(_0xff50('0x2'));var moment=require(_0xff50('0x3'));var BPromise=require(_0xff50('0x4'));var rp=require(_0xff50('0x5'));var fs=require('fs');var path=require(_0xff50('0x6'));var rimraf=require('rimraf');var config=require(_0xff50('0x7'));var attributes=require('./chatWebsite.attributes');module[_0xff50('0x8')]=function(_0x45ebaf,_0x4da013){return _0x45ebaf[_0xff50('0x9')](_0xff50('0xa'),attributes,{'tableName':'chat_websites','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 bcb4c74..148dca1 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 _0x5f2f=['http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x354a41,_0x30c98c){var _0x342e6e=function(_0x288c6b){while(--_0x288c6b){_0x354a41['push'](_0x354a41['shift']());}};_0x342e6e(++_0x30c98c);}(_0x5f2f,0x15f));var _0xf5f2=function(_0x534d8e,_0x5d9305){_0x534d8e=_0x534d8e-0x0;var _0x429379=_0x5f2f[_0x534d8e];return _0x429379;};'use strict';var _=require('lodash');var util=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var BPromise=require(_0xf5f2('0x2'));var rs=require(_0xf5f2('0x3'));var fs=require('fs');var Redis=require(_0xf5f2('0x4'));var db=require(_0xf5f2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var jayson=require(_0xf5f2('0x8'));var client=jayson['client'][_0xf5f2('0x9')]({'port':0x232a});config[_0xf5f2('0xa')]=_[_0xf5f2('0xb')](config[_0xf5f2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf5f2('0xc'))(new Redis(config[_0xf5f2('0xa')]));require(_0xf5f2('0xd'))[_0xf5f2('0xe')](socket);function respondWithRpcPromise(_0x2132bb,_0x358a14,_0x2fd284){return new BPromise(function(_0x44c12d,_0x1f092f){return client[_0xf5f2('0xf')](_0x2132bb,_0x2fd284)['then'](function(_0x4a0b15){logger['info'](_0xf5f2('0x10'),_0x358a14,'request\x20sent');logger[_0xf5f2('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x358a14,'request\x20sent',JSON[_0xf5f2('0x12')](_0x4a0b15));if(_0x4a0b15[_0xf5f2('0x13')]){if(_0x4a0b15[_0xf5f2('0x13')][_0xf5f2('0x14')]===0x1f4){logger['error'](_0xf5f2('0x10'),_0x358a14,_0x4a0b15[_0xf5f2('0x13')]['message']);return _0x1f092f(_0x4a0b15[_0xf5f2('0x13')][_0xf5f2('0x15')]);}logger[_0xf5f2('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x358a14,_0x4a0b15[_0xf5f2('0x13')][_0xf5f2('0x15')]);return _0x44c12d(_0x4a0b15[_0xf5f2('0x13')][_0xf5f2('0x15')]);}else{logger['info'](_0xf5f2('0x10'),_0x358a14,'request\x20sent');_0x44c12d(_0x4a0b15[_0xf5f2('0x16')][_0xf5f2('0x15')]);}})[_0xf5f2('0x17')](function(_0x59cc3d){logger[_0xf5f2('0x13')](_0xf5f2('0x10'),_0x358a14,_0x59cc3d);_0x1f092f(_0x59cc3d);});});} \ No newline at end of file +var _0xb641=['error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1382ad,_0xb139b8){var _0x26d191=function(_0x3d35a5){while(--_0x3d35a5){_0x1382ad['push'](_0x1382ad['shift']());}};_0x26d191(++_0xb139b8);}(_0xb641,0x90));var _0x1b64=function(_0x50490d,_0x1839ab){_0x50490d=_0x50490d-0x0;var _0x523645=_0xb641[_0x50490d];return _0x523645;};'use strict';var _=require(_0x1b64('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b64('0x1'));var fs=require('fs');var Redis=require(_0x1b64('0x2'));var db=require(_0x1b64('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1b64('0x4'));var jayson=require(_0x1b64('0x5'));var client=jayson['client'][_0x1b64('0x6')]({'port':0x232a});config[_0x1b64('0x7')]=_[_0x1b64('0x8')](config[_0x1b64('0x7')],{'host':_0x1b64('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1b64('0xa'))[_0x1b64('0xb')](socket);function respondWithRpcPromise(_0xb05960,_0x2fce2e,_0x5abdc2){return new BPromise(function(_0x137c4b,_0x59e06c){return client['request'](_0xb05960,_0x5abdc2)['then'](function(_0x31e748){logger[_0x1b64('0xc')]('ChatWebsite,\x20%s,\x20%s',_0x2fce2e,_0x1b64('0xd'));logger[_0x1b64('0xe')](_0x1b64('0xf'),_0x2fce2e,'request\x20sent',JSON[_0x1b64('0x10')](_0x31e748));if(_0x31e748[_0x1b64('0x11')]){if(_0x31e748[_0x1b64('0x11')][_0x1b64('0x12')]===0x1f4){logger[_0x1b64('0x11')](_0x1b64('0x13'),_0x2fce2e,_0x31e748[_0x1b64('0x11')][_0x1b64('0x14')]);return _0x59e06c(_0x31e748[_0x1b64('0x11')]['message']);}logger[_0x1b64('0x11')](_0x1b64('0x13'),_0x2fce2e,_0x31e748[_0x1b64('0x11')]['message']);return _0x137c4b(_0x31e748['error'][_0x1b64('0x14')]);}else{logger[_0x1b64('0xc')](_0x1b64('0x13'),_0x2fce2e,_0x1b64('0xd'));_0x137c4b(_0x31e748[_0x1b64('0x15')][_0x1b64('0x14')]);}})[_0x1b64('0x16')](function(_0x108bb9){logger[_0x1b64('0x11')](_0x1b64('0x13'),_0x2fce2e,_0x108bb9);_0x59e06c(_0x108bb9);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 43b5079..c7c793b 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 _0xeb19=['./chatWebsite.events','remove','emit','removeListener','register','length','chatWebsite:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb19,0xa8));var _0x9eb1=function(_0x4e9b1e,_0x192e42){_0x4e9b1e=_0x4e9b1e-0x0;var _0x18132d=_0xeb19[_0x4e9b1e];return _0x18132d;};'use strict';var ChatWebsiteEvents=require(_0x9eb1('0x0'));var events=['save',_0x9eb1('0x1'),'update'];function createListener(_0x365167,_0x3dd221){return function(_0x327787){_0x3dd221[_0x9eb1('0x2')](_0x365167,_0x327787);};}function removeListener(_0x5b5796,_0xe6d0e8){return function(){ChatWebsiteEvents[_0x9eb1('0x3')](_0x5b5796,_0xe6d0e8);};}exports[_0x9eb1('0x4')]=function(_0x268ced){for(var _0x531d1b=0x0,_0x2d1001=events[_0x9eb1('0x5')];_0x531d1b<_0x2d1001;_0x531d1b++){var _0xcff1e=events[_0x531d1b];var _0x127b6a=createListener(_0x9eb1('0x6')+_0xcff1e,_0x268ced);ChatWebsiteEvents['on'](_0xcff1e,_0x127b6a);}}; \ No newline at end of file +var _0x1aa8=['save','remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x14405c,_0x12b9b9){var _0x5d54ba=function(_0x5eaba7){while(--_0x5eaba7){_0x14405c['push'](_0x14405c['shift']());}};_0x5d54ba(++_0x12b9b9);}(_0x1aa8,0x6b));var _0x81aa=function(_0x3b5cdd,_0x33a124){_0x3b5cdd=_0x3b5cdd-0x0;var _0x4aa391=_0x1aa8[_0x3b5cdd];return _0x4aa391;};'use strict';var ChatWebsiteEvents=require(_0x81aa('0x0'));var events=[_0x81aa('0x1'),_0x81aa('0x2'),_0x81aa('0x3')];function createListener(_0x2f10fa,_0x3aeb4f){return function(_0x1bdfd7){_0x3aeb4f[_0x81aa('0x4')](_0x2f10fa,_0x1bdfd7);};}function removeListener(_0x20d91f,_0x442f9c){return function(){ChatWebsiteEvents[_0x81aa('0x5')](_0x20d91f,_0x442f9c);};}exports[_0x81aa('0x6')]=function(_0x5466a6){for(var _0x21e345=0x0,_0x2d8cd8=events[_0x81aa('0x7')];_0x21e345<_0x2d8cd8;_0x21e345++){var _0xa52302=events[_0x21e345];var _0x18a268=createListener(_0x81aa('0x8')+_0xa52302,_0x5466a6);ChatWebsiteEvents['on'](_0xa52302,_0x18a268);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index a5a960d..35ffe9b 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 _0x7c5c=['addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','get','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','join','server/files/images/avatars/','addCustomerAvatar','originalname','notify','server/files','attachments','offline-chat','ensureDir','replace','any','addInteraction','addApplications'];(function(_0x4c034e,_0x3617bc){var _0x2a775c=function(_0x2634c7){while(--_0x2634c7){_0x4c034e['push'](_0x4c034e['shift']());}};_0x2a775c(++_0x3617bc);}(_0x7c5c,0x1ba));var _0xc7c5=function(_0x7e114d,_0x23be84){_0x7e114d=_0x7e114d-0x0;var _0x4c520e=_0x7c5c[_0x7e114d];return _0x4c520e;};'use strict';var multer=require(_0xc7c5('0x0'));var util=require(_0xc7c5('0x1'));var path=require(_0xc7c5('0x2'));var timeout=require(_0xc7c5('0x3'));var express=require(_0xc7c5('0x4'));var router=express[_0xc7c5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc7c5('0x6'));var interaction=require(_0xc7c5('0x7'));var config=require('../../config/environment');var controller=require(_0xc7c5('0x8'));router['get']('/',auth[_0xc7c5('0x9')](),controller['index']);router[_0xc7c5('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc7c5('0xa')]('/:id',auth[_0xc7c5('0x9')](),controller[_0xc7c5('0xb')]);router[_0xc7c5('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc7c5('0xc')]);router['get'](_0xc7c5('0xd'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0xe')]);router['get'](_0xc7c5('0xf'),controller[_0xc7c5('0x10')]);router[_0xc7c5('0xa')](_0xc7c5('0x11'),controller[_0xc7c5('0x12')]);router[_0xc7c5('0xa')](_0xc7c5('0x13'),controller[_0xc7c5('0x14')]);router[_0xc7c5('0xa')](_0xc7c5('0x15'),controller['getSystemAvatar']);router[_0xc7c5('0xa')](_0xc7c5('0x16'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x17')]);router[_0xc7c5('0xa')](_0xc7c5('0x18'),controller[_0xc7c5('0x19')]);router[_0xc7c5('0xa')](_0xc7c5('0x1a'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x1b')]);router['get'](_0xc7c5('0x1c'),auth['isAuthenticated'](),controller[_0xc7c5('0x1d')]);router[_0xc7c5('0xa')](_0xc7c5('0x1e'),controller['getFields']);router[_0xc7c5('0xa')](_0xc7c5('0x1f'),auth['isAuthenticated'](),controller[_0xc7c5('0x20')]);router[_0xc7c5('0xa')](_0xc7c5('0x21'),auth['isAuthenticated'](),controller[_0xc7c5('0x22')]);router[_0xc7c5('0x23')]('/',auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x24')]);router[_0xc7c5('0x23')](_0xc7c5('0x25'),auth['isAuthenticated'](),controller[_0xc7c5('0x26')]);router[_0xc7c5('0x23')](_0xc7c5('0xd'),auth['isAuthenticated'](),controller[_0xc7c5('0x27')]);var upload=multer({'storage':multer[_0xc7c5('0x28')]({'destination':function(_0x3f27c6,_0x2a0067,_0xbad3f2){_0xbad3f2(null,path['join'](config[_0xc7c5('0x29')],_0xc7c5('0x2a')));},'filename':function(_0x2efc7d,_0x4f9626,_0x2d007a){_0x2d007a(null,util[_0xc7c5('0x2b')](_0xc7c5('0x2c'),Date[_0xc7c5('0x2d')](),_0x4f9626['originalname']));}})});router[_0xc7c5('0x23')](_0xc7c5('0xf'),upload[_0xc7c5('0x2e')](_0xc7c5('0x2f')),controller[_0xc7c5('0x30')]);var upload=multer({'storage':multer[_0xc7c5('0x28')]({'destination':function(_0x1ed323,_0x1d5edb,_0x154276){_0x154276(null,path[_0xc7c5('0x31')](config['root'],_0xc7c5('0x32')));},'filename':function(_0x3b875a,_0x517aaa,_0x44ca42){_0x44ca42(null,util[_0xc7c5('0x2b')](_0xc7c5('0x2c'),Date[_0xc7c5('0x2d')](),_0x517aaa['originalname']));}})});router[_0xc7c5('0x23')](_0xc7c5('0x11'),upload[_0xc7c5('0x2e')](_0xc7c5('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3efd27,_0xe7f3bf,_0x2d4ec5){_0x2d4ec5(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3193b3,_0x3ef416,_0x155bb8){_0x155bb8(null,util[_0xc7c5('0x2b')](_0xc7c5('0x2c'),Date[_0xc7c5('0x2d')](),_0x3ef416['originalname']));}})});router[_0xc7c5('0x23')](_0xc7c5('0x13'),upload[_0xc7c5('0x2e')](_0xc7c5('0x2f')),controller[_0xc7c5('0x33')]);var upload=multer({'storage':multer[_0xc7c5('0x28')]({'destination':function(_0x48e16f,_0x597cae,_0x295f30){_0x295f30(null,path['join'](config[_0xc7c5('0x29')],_0xc7c5('0x32')));},'filename':function(_0x1a41d7,_0x359319,_0x351ec2){_0x351ec2(null,util[_0xc7c5('0x2b')]('%s-%s',Date['now'](),_0x359319[_0xc7c5('0x34')]));}})});router['post'](_0xc7c5('0x15'),upload['single'](_0xc7c5('0x2f')),controller['addSystemAvatar']);router[_0xc7c5('0x23')]('/:id/notify',controller[_0xc7c5('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xc7c5('0x28')]({'destination':function(_0x455ccd,_0x1bd42e,_0x4a0197){const _0x5267c=path['join'](config['root'],_0xc7c5('0x36'),_0xc7c5('0x37'),_0xc7c5('0x38'));fs_extra[_0xc7c5('0x39')](_0x5267c,function(){_0x4a0197(null,_0x5267c);});},'filename':function(_0x4e4978,_0x570bc9,_0x298431){const _0xa4ba3f=_0x570bc9['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x168638=path['extname'](_0xa4ba3f);const _0x178ce5=Date[_0xc7c5('0x2d')]()+'-'+_0xa4ba3f[_0xc7c5('0x3a')](_0x168638,'')+_0x168638;_0x298431(null,_0x178ce5);}})});router[_0xc7c5('0x23')]('/:id/offline',offlineUploadMulter[_0xc7c5('0x3b')](),controller['offline']);router[_0xc7c5('0x23')](_0xc7c5('0x16'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x3c')]);router[_0xc7c5('0x23')](_0xc7c5('0x1a'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x3d')]);router['post']('/:id/proactive_actions',auth[_0xc7c5('0x9')](),controller['addProactiveActions']);router[_0xc7c5('0x23')](_0xc7c5('0x21'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x3e')]);router[_0xc7c5('0x3f')](_0xc7c5('0x40'),auth['isAuthenticated'](),controller[_0xc7c5('0x41')]);router[_0xc7c5('0x42')](_0xc7c5('0x40'),auth['isAuthenticated'](),controller[_0xc7c5('0x43')]);router[_0xc7c5('0x42')]('/:id/dispositions',auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x44')]);router[_0xc7c5('0x42')](_0xc7c5('0xd'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x45')]);router[_0xc7c5('0x42')](_0xc7c5('0x21'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x46')]);module[_0xc7c5('0x47')]=router; \ No newline at end of file +var _0x8de3=['getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','join','format','originalname','file','addLogo','diskStorage','root','server/files/images/avatars/','%s-%s','addAvatar','now','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getCustomerAvatar','/:id/system_avatar'];(function(_0x235826,_0x514a22){var _0x4660ab=function(_0x420315){while(--_0x420315){_0x235826['push'](_0x235826['shift']());}};_0x4660ab(++_0x514a22);}(_0x8de3,0x107));var _0x38de=function(_0x1f4ddf,_0x4ef2f8){_0x1f4ddf=_0x1f4ddf-0x0;var _0x169fea=_0x8de3[_0x1f4ddf];return _0x169fea;};'use strict';var multer=require('multer');var util=require(_0x38de('0x0'));var path=require(_0x38de('0x1'));var timeout=require(_0x38de('0x2'));var express=require(_0x38de('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x38de('0x4'));var interaction=require(_0x38de('0x5'));var config=require(_0x38de('0x6'));var controller=require('./chatWebsite.controller');router[_0x38de('0x7')]('/',auth[_0x38de('0x8')](),controller[_0x38de('0x9')]);router['get'](_0x38de('0xa'),auth['isAuthenticated'](),controller[_0x38de('0xb')]);router[_0x38de('0x7')](_0x38de('0xc'),auth[_0x38de('0x8')](),controller[_0x38de('0xd')]);router[_0x38de('0x7')]('/:id/dispositions',auth[_0x38de('0x8')](),controller[_0x38de('0xe')]);router[_0x38de('0x7')](_0x38de('0xf'),auth['isAuthenticated'](),controller[_0x38de('0x10')]);router[_0x38de('0x7')](_0x38de('0x11'),controller[_0x38de('0x12')]);router[_0x38de('0x7')]('/:id/avatar',controller['getAvatar']);router[_0x38de('0x7')]('/:id/customer_avatar',controller[_0x38de('0x13')]);router[_0x38de('0x7')](_0x38de('0x14'),controller[_0x38de('0x15')]);router[_0x38de('0x7')](_0x38de('0x16'),auth[_0x38de('0x8')](),controller[_0x38de('0x17')]);router[_0x38de('0x7')](_0x38de('0x18'),controller[_0x38de('0x19')]);router['get'](_0x38de('0x1a'),auth[_0x38de('0x8')](),controller[_0x38de('0x1b')]);router[_0x38de('0x7')]('/:id/proactive_actions',auth[_0x38de('0x8')](),controller[_0x38de('0x1c')]);router[_0x38de('0x7')](_0x38de('0x1d'),controller[_0x38de('0x1e')]);router[_0x38de('0x7')](_0x38de('0x1f'),auth[_0x38de('0x8')](),controller[_0x38de('0x20')]);router['get'](_0x38de('0x21'),auth[_0x38de('0x8')](),controller[_0x38de('0x22')]);router[_0x38de('0x23')]('/',auth[_0x38de('0x8')](),controller[_0x38de('0x24')]);router['post']('/:id/dispositions',auth[_0x38de('0x8')](),controller['addDisposition']);router[_0x38de('0x23')](_0x38de('0xf'),auth['isAuthenticated'](),controller[_0x38de('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x516172,_0x440db9,_0x252226){_0x252226(null,path[_0x38de('0x26')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5b1e9c,_0x54c151,_0x3ad54d){_0x3ad54d(null,util[_0x38de('0x27')]('%s-%s',Date['now'](),_0x54c151[_0x38de('0x28')]));}})});router[_0x38de('0x23')]('/:id/logo',upload['single'](_0x38de('0x29')),controller[_0x38de('0x2a')]);var upload=multer({'storage':multer[_0x38de('0x2b')]({'destination':function(_0xb0b969,_0x9d2f39,_0x978b81){_0x978b81(null,path[_0x38de('0x26')](config[_0x38de('0x2c')],_0x38de('0x2d')));},'filename':function(_0x4132ed,_0x2ca0ce,_0x1f9545){_0x1f9545(null,util[_0x38de('0x27')](_0x38de('0x2e'),Date['now'](),_0x2ca0ce[_0x38de('0x28')]));}})});router['post']('/:id/avatar',upload['single'](_0x38de('0x29')),controller[_0x38de('0x2f')]);var upload=multer({'storage':multer[_0x38de('0x2b')]({'destination':function(_0x3ff51c,_0x1ac19,_0x395d48){_0x395d48(null,path['join'](config[_0x38de('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x1827ee,_0x23cb98,_0x372b30){_0x372b30(null,util[_0x38de('0x27')](_0x38de('0x2e'),Date[_0x38de('0x30')](),_0x23cb98[_0x38de('0x28')]));}})});router['post']('/:id/customer_avatar',upload[_0x38de('0x31')](_0x38de('0x29')),controller[_0x38de('0x32')]);var upload=multer({'storage':multer[_0x38de('0x2b')]({'destination':function(_0x3325a7,_0x5f221d,_0x5f3e0b){_0x5f3e0b(null,path[_0x38de('0x26')](config[_0x38de('0x2c')],_0x38de('0x2d')));},'filename':function(_0x3aca33,_0x113b0b,_0x206610){_0x206610(null,util[_0x38de('0x27')](_0x38de('0x2e'),Date[_0x38de('0x30')](),_0x113b0b[_0x38de('0x28')]));}})});router[_0x38de('0x23')]('/:id/system_avatar',upload[_0x38de('0x31')](_0x38de('0x29')),controller[_0x38de('0x33')]);router['post'](_0x38de('0x34'),controller[_0x38de('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x38de('0x2b')]({'destination':function(_0x48c6b2,_0x78e342,_0x2a2563){const _0x1e0b06=path['join'](config['root'],_0x38de('0x36'),_0x38de('0x37'),'offline-chat');fs_extra[_0x38de('0x38')](_0x1e0b06,function(){_0x2a2563(null,_0x1e0b06);});},'filename':function(_0x257e0d,_0x35b007,_0x2ae320){const _0x240d89=_0x35b007[_0x38de('0x28')][_0x38de('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4962a3=path[_0x38de('0x3a')](_0x240d89);const _0x447f37=Date[_0x38de('0x30')]()+'-'+_0x240d89[_0x38de('0x39')](_0x4962a3,'')+_0x4962a3;_0x2ae320(null,_0x447f37);}})});router[_0x38de('0x23')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x38de('0x3b')]);router[_0x38de('0x23')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x38de('0x3c')]);router[_0x38de('0x23')](_0x38de('0x1a'),auth[_0x38de('0x8')](),controller[_0x38de('0x3d')]);router[_0x38de('0x23')](_0x38de('0x3e'),auth[_0x38de('0x8')](),controller[_0x38de('0x3f')]);router[_0x38de('0x23')](_0x38de('0x21'),auth[_0x38de('0x8')](),controller[_0x38de('0x40')]);router[_0x38de('0x41')](_0x38de('0xc'),auth[_0x38de('0x8')](),controller[_0x38de('0x42')]);router[_0x38de('0x43')](_0x38de('0xc'),auth[_0x38de('0x8')](),controller[_0x38de('0x44')]);router[_0x38de('0x43')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x38de('0x45')]);router['delete']('/:id/canned_answers',auth[_0x38de('0x8')](),controller[_0x38de('0x46')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 8d15be2..5f2e248 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 _0xd18e=['isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','env','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x1bdf81,_0x35a998){var _0xbb3ce4=function(_0x1b9526){while(--_0x1b9526){_0x1bdf81['push'](_0x1bdf81['shift']());}};_0xbb3ce4(++_0x35a998);}(_0xd18e,0x120));var _0xed18=function(_0x17822e,_0xd8ebd1){_0x17822e=_0x17822e-0x0;var _0x41864f=_0xd18e[_0x17822e];return _0x41864f;};var beaverLogger=require(_0xed18('0x0'));var express=require(_0xed18('0x1'));var auth=require(_0xed18('0x2'));var config=require('../config/environment');var router=express[_0xed18('0x3')]();var isProduction=config[_0xed18('0x4')]===_0xed18('0x5')||![];function clientSideLogs(_0x2d38c4,_0x43d27b,_0x2c3071){var _0x15a1d8=_0x2d38c4[_0xed18('0x6')]['get'](_0xed18('0x7'));if(!_0x15a1d8){throw new Error(_0xed18('0x8'));}return beaverLogger[_0xed18('0x9')]({'uri':_0xed18('0xa'),'logger':_0x15a1d8,'enableCors':!isProduction})(_0x2d38c4,_0x43d27b,_0x2c3071);}router['use'](auth[_0xed18('0xb')](),clientSideLogs);module[_0xed18('0xc')]=router; \ No newline at end of file +var _0x1226=['Router','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x3a27e8,_0x37ea40){var _0x3adfec=function(_0x36245e){while(--_0x36245e){_0x3a27e8['push'](_0x3a27e8['shift']());}};_0x3adfec(++_0x37ea40);}(_0x1226,0x173));var _0x6122=function(_0x41c166,_0x4251b0){_0x41c166=_0x41c166-0x0;var _0x132478=_0x1226[_0x41c166];return _0x132478;};var beaverLogger=require(_0x6122('0x0'));var express=require(_0x6122('0x1'));var auth=require(_0x6122('0x2'));var config=require('../config/environment');var router=express[_0x6122('0x3')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x3f229a,_0xf7f1cd,_0x4f3591){var _0x590c2d=_0x3f229a['app'][_0x6122('0x4')](_0x6122('0x5'));if(!_0x590c2d){throw new Error(_0x6122('0x6'));}return beaverLogger['expressEndpoint']({'uri':_0x6122('0x7'),'logger':_0x590c2d,'enableCors':!isProduction})(_0x3f229a,_0xf7f1cd,_0x4f3591);}router[_0x6122('0x8')](auth[_0x6122('0x9')](),clientSideLogs);module[_0x6122('0xa')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 7be014a..3e9715e 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 _0xd78a=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd78a,0x1b9));var _0xad78=function(_0x12a6c7,_0x253cd9){_0x12a6c7=_0x12a6c7-0x0;var _0x3fd321=_0xd78a[_0x12a6c7];return _0x3fd321;};'use strict';var Sequelize=require(_0xad78('0x0'));module[_0xad78('0x1')]={'name':{'type':Sequelize[_0xad78('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xad78('0x3')](_0xad78('0x4'),_0xad78('0x5'),_0xad78('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xad78('0x3')](_0xad78('0x7'),_0xad78('0x8'))},'data1':{'type':Sequelize['STRING'],'comment':_0xad78('0x9')},'data2':{'type':Sequelize['STRING'],'comment':_0xad78('0xa')},'data3':{'type':Sequelize[_0xad78('0x2')],'comment':_0xad78('0xb')},'data4':{'type':Sequelize[_0xad78('0x2')],'comment':_0xad78('0xc')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xad78('0xd')],'comment':_0xad78('0xe')},'data7':{'type':Sequelize[_0xad78('0xd')],'comment':_0xad78('0xf')}}; \ No newline at end of file +var _0xb665=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0xe41af8,_0x269f78){var _0x3cd469=function(_0x2f0996){while(--_0x2f0996){_0xe41af8['push'](_0xe41af8['shift']());}};_0x3cd469(++_0x269f78);}(_0xb665,0x66));var _0x5b66=function(_0x569b53,_0x3279f6){_0x569b53=_0x569b53-0x0;var _0x467e46=_0xb665[_0x569b53];return _0x467e46;};'use strict';var Sequelize=require('sequelize');module[_0x5b66('0x0')]={'name':{'type':Sequelize[_0x5b66('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5b66('0x2')](_0x5b66('0x3'),'Google',_0x5b66('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5b66('0x2')](_0x5b66('0x5'),_0x5b66('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x5b66('0x7')},'data2':{'type':Sequelize[_0x5b66('0x1')],'comment':_0x5b66('0x8')},'data3':{'type':Sequelize[_0x5b66('0x1')],'comment':_0x5b66('0x9')},'data4':{'type':Sequelize[_0x5b66('0x1')],'comment':_0x5b66('0xa')},'data5':{'type':Sequelize[_0x5b66('0xb')],'comment':_0x5b66('0xc')},'data6':{'type':Sequelize[_0x5b66('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x5b66('0xb')],'comment':_0x5b66('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 06d45d4..6f8b416 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 _0x3b06=['merge','VIRTUAL','filter','options','CloudProvider','include','service','decryptString','data3','catch','params','fields','length','includeAll','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','data6','refresh_token','update','emit','microsoftAuthorization:success','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','status','end','offset','undefined','limit','count','Content-Range','json','then','destroy','sendStatus','error','name','send','padEnd','slice','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','order','sort','where'];(function(_0x3f71a2,_0x5ac519){var _0x4433ec=function(_0x47d998){while(--_0x47d998){_0x3f71a2['push'](_0x3f71a2['shift']());}};_0x4433ec(++_0x5ac519);}(_0x3b06,0xe9));var _0x63b0=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x3b06[_0xbc2974];return _0x3a5b4f;};'use strict';var _=require(_0x63b0('0x0'));var Redis=require(_0x63b0('0x1'));var qs=require(_0x63b0('0x2'));var encryptor=require(_0x63b0('0x3'));var config=require(_0x63b0('0x4'));var logger=require(_0x63b0('0x5'))(_0x63b0('0x6'));var db=require(_0x63b0('0x7'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x63b0('0x8')]=_[_0x63b0('0x9')](config[_0x63b0('0x8')],{'host':_0x63b0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x63b0('0x8')]));var redis=new Redis(config[_0x63b0('0x8')]);function respondWithStatusCode(_0x2cdbad,_0x346efd){_0x346efd=_0x346efd||0xcc;return function(_0x513b10){if(_0x513b10){return _0x2cdbad['sendStatus'](_0x346efd);}return _0x2cdbad[_0x63b0('0xb')](_0x346efd)[_0x63b0('0xc')]();};}function respondWithResult(_0x24ab4b,_0x3c30c8){_0x3c30c8=_0x3c30c8||0xc8;return function(_0xcec65){if(_0xcec65){return _0x24ab4b[_0x63b0('0xb')](_0x3c30c8)['json'](_0xcec65);}};}function respondWithFilteredResult(_0x1ef038,_0x3d6015){return function(_0xc653ae){if(_0xc653ae){var _0x54732e=typeof _0x3d6015[_0x63b0('0xd')]===_0x63b0('0xe')&&typeof _0x3d6015[_0x63b0('0xf')]===_0x63b0('0xe');var _0x4c8c57=_0xc653ae[_0x63b0('0x10')];var _0x58890a=_0x54732e?0x0:_0x3d6015['offset'];var _0x5789ae=_0x54732e?_0xc653ae['count']:_0x3d6015[_0x63b0('0xd')]+_0x3d6015[_0x63b0('0xf')];var _0x4e36f5;if(_0x5789ae>=_0x4c8c57){_0x5789ae=_0x4c8c57;_0x4e36f5=0xc8;}else{_0x4e36f5=0xce;}_0x1ef038[_0x63b0('0xb')](_0x4e36f5);return _0x1ef038['set'](_0x63b0('0x11'),_0x58890a+'-'+_0x5789ae+'/'+_0x4c8c57)[_0x63b0('0x12')](_0xc653ae);}return null;};}function saveUpdates(_0x1662fa){return function(_0xd30e4b){if(_0xd30e4b){return _0xd30e4b['update'](_0x1662fa)[_0x63b0('0x13')](function(_0x1cea6b){return _0x1cea6b;});}return null;};}function removeEntity(_0x2bc1c7){return function(_0x326918){if(_0x326918){return _0x326918[_0x63b0('0x14')]()[_0x63b0('0x13')](function(){_0x2bc1c7['status'](0xcc)[_0x63b0('0xc')]();});}};}function handleEntityNotFound(_0x18f3fd){return function(_0x2ab72e){if(!_0x2ab72e){_0x18f3fd[_0x63b0('0x15')](0x194);}return _0x2ab72e;};}function handleError(_0x3f718d,_0x47f646){_0x47f646=_0x47f646||0x1f4;return function(_0x51ea84){logger[_0x63b0('0x16')](_0x51ea84['stack']);if(_0x51ea84[_0x63b0('0x17')]){delete _0x51ea84[_0x63b0('0x17')];}_0x3f718d[_0x63b0('0xb')](_0x47f646)[_0x63b0('0x18')](_0x51ea84);};}function maskClientSecret(_0x5938a6){return _[_0x63b0('0x19')](_0x5938a6[_0x63b0('0x1a')](0x0,0x3),0x14,'*');}exports[_0x63b0('0x1b')]=function(_0x5cbd7f,_0x271fea){var _0x8ae2fb={},_0x238654={},_0x279730={'count':0x0,'rows':[]};var _0x128b26=_[_0x63b0('0x1c')](db['CloudProvider'][_0x63b0('0x1d')],function(_0x312997){return{'name':_0x312997[_0x63b0('0x1e')],'type':_0x312997[_0x63b0('0x1f')][_0x63b0('0x20')]};});_0x238654[_0x63b0('0x21')]=_[_0x63b0('0x1c')](_0x128b26,_0x63b0('0x17'));_0x238654['query']=_[_0x63b0('0x22')](_0x5cbd7f[_0x63b0('0x23')]);_0x238654[_0x63b0('0x24')]=_[_0x63b0('0x25')](_0x238654['model'],_0x238654[_0x63b0('0x23')]);_0x8ae2fb['attributes']=_[_0x63b0('0x25')](_0x238654[_0x63b0('0x21')],qs['fields'](_0x5cbd7f[_0x63b0('0x23')]['fields']));_0x8ae2fb['attributes']=_0x8ae2fb[_0x63b0('0x26')]['length']?_0x8ae2fb[_0x63b0('0x26')]:_0x238654[_0x63b0('0x21')];if(!_0x5cbd7f['query'][_0x63b0('0x27')]('nolimit')){_0x8ae2fb[_0x63b0('0xf')]=qs[_0x63b0('0xf')](_0x5cbd7f['query'][_0x63b0('0xf')]);_0x8ae2fb[_0x63b0('0xd')]=qs[_0x63b0('0xd')](_0x5cbd7f[_0x63b0('0x23')][_0x63b0('0xd')]);}_0x8ae2fb[_0x63b0('0x28')]=qs['sort'](_0x5cbd7f[_0x63b0('0x23')][_0x63b0('0x29')]);_0x8ae2fb[_0x63b0('0x2a')]=qs[_0x63b0('0x24')](_['pick'](_0x5cbd7f[_0x63b0('0x23')],_0x238654['filters']),_0x128b26);if(_0x5cbd7f[_0x63b0('0x23')]['filter']){_0x8ae2fb[_0x63b0('0x2a')]=_[_0x63b0('0x2b')](_0x8ae2fb[_0x63b0('0x2a')],{'$or':_['map'](_0x128b26,function(_0x2006c1){if(_0x2006c1[_0x63b0('0x1f')]!==_0x63b0('0x2c')){var _0x98ba86={};_0x98ba86[_0x2006c1[_0x63b0('0x17')]]={'$like':'%'+_0x5cbd7f[_0x63b0('0x23')][_0x63b0('0x2d')]+'%'};return _0x98ba86;}})});}_0x8ae2fb=_[_0x63b0('0x2b')]({},_0x8ae2fb,_0x5cbd7f[_0x63b0('0x2e')]);var _0x4483d9={'where':_0x8ae2fb[_0x63b0('0x2a')]};return db[_0x63b0('0x2f')][_0x63b0('0x10')](_0x4483d9)[_0x63b0('0x13')](function(_0x45f3d8){_0x279730['count']=_0x45f3d8;if(_0x5cbd7f[_0x63b0('0x23')]['includeAll']){_0x8ae2fb[_0x63b0('0x30')]=[{'all':!![]}];}return db[_0x63b0('0x2f')]['findAll'](_0x8ae2fb);})[_0x63b0('0x13')](function(_0x173495){_0x279730['rows']=_['map'](_0x173495,function(_0x54b046){if(_0x54b046[_0x63b0('0x31')]==='MicrosoftAzure'){var _0x350036=encryptor[_0x63b0('0x32')](_0x54b046[_0x63b0('0x33')]);_0x54b046['data3']=maskClientSecret(_0x350036);}return _0x54b046;});return _0x279730;})[_0x63b0('0x13')](respondWithFilteredResult(_0x271fea,_0x8ae2fb))[_0x63b0('0x34')](handleError(_0x271fea,null));};exports['show']=function(_0x2dcf90,_0x11f208){var _0x35b3f7={'raw':!![],'where':{'id':_0x2dcf90[_0x63b0('0x35')]['id']}},_0x1186a8={};_0x1186a8[_0x63b0('0x21')]=_[_0x63b0('0x22')](db[_0x63b0('0x2f')][_0x63b0('0x1d')]);_0x1186a8[_0x63b0('0x23')]=_[_0x63b0('0x22')](_0x2dcf90[_0x63b0('0x23')]);_0x1186a8[_0x63b0('0x24')]=_[_0x63b0('0x25')](_0x1186a8[_0x63b0('0x21')],_0x1186a8[_0x63b0('0x23')]);_0x35b3f7['attributes']=_[_0x63b0('0x25')](_0x1186a8[_0x63b0('0x21')],qs[_0x63b0('0x36')](_0x2dcf90[_0x63b0('0x23')]['fields']));_0x35b3f7[_0x63b0('0x26')]=_0x35b3f7[_0x63b0('0x26')][_0x63b0('0x37')]?_0x35b3f7[_0x63b0('0x26')]:_0x1186a8[_0x63b0('0x21')];if(_0x2dcf90[_0x63b0('0x23')][_0x63b0('0x38')]){_0x35b3f7[_0x63b0('0x30')]=[{'all':!![]}];}_0x35b3f7=_['merge']({},_0x35b3f7,_0x2dcf90['options']);return db[_0x63b0('0x2f')][_0x63b0('0x39')](_0x35b3f7)['then'](handleEntityNotFound(_0x11f208,null))[_0x63b0('0x13')](function(_0x1a36fe){if(_0x1a36fe[_0x63b0('0x31')]===_0x63b0('0x3a')){var _0x1c0fe5=encryptor[_0x63b0('0x32')](_0x1a36fe['data3']);_0x1a36fe['data3']=maskClientSecret(_0x1c0fe5);}return _0x1a36fe;})[_0x63b0('0x13')](respondWithResult(_0x11f208,null))[_0x63b0('0x34')](handleError(_0x11f208,null));};exports[_0x63b0('0x3b')]=function(_0x1a9947,_0x1e5f90){if(!_0x1a9947[_0x63b0('0x3c')][_0x63b0('0x17')])throw new Error(_0x63b0('0x3d'));if(!_0x1a9947[_0x63b0('0x3c')][_0x63b0('0x31')])throw new Error(_0x63b0('0x3e'));var _0x399be3=db[_0x63b0('0x2f')][_0x63b0('0x1d')][_0x63b0('0x31')][_0x63b0('0x3f')];if(!_0x399be3[_0x63b0('0x40')](_0x1a9947[_0x63b0('0x3c')][_0x63b0('0x31')]))throw new Error(_0x63b0('0x41')+_0x399be3['join'](',\x20'));if(_0x1a9947[_0x63b0('0x3c')][_0x63b0('0x31')]===_0x63b0('0x3a')&&_0x1a9947['body'][_0x63b0('0x33')]){_0x1a9947[_0x63b0('0x3c')]['data3']=encryptor[_0x63b0('0x42')](_0x1a9947[_0x63b0('0x3c')][_0x63b0('0x33')]);}return db['CloudProvider'][_0x63b0('0x3b')](_0x1a9947[_0x63b0('0x3c')],{})[_0x63b0('0x13')](respondWithResult(_0x1e5f90,0xc9))[_0x63b0('0x34')](handleError(_0x1e5f90,null));};exports['update']=function(_0x89d336,_0x5db07e){if(_0x89d336[_0x63b0('0x3c')]['id']){delete _0x89d336[_0x63b0('0x3c')]['id'];}return db[_0x63b0('0x2f')][_0x63b0('0x39')]({'where':{'id':_0x89d336[_0x63b0('0x35')]['id']}})[_0x63b0('0x13')](handleEntityNotFound(_0x5db07e,null))[_0x63b0('0x13')](function(_0x18f802){if(_0x18f802['service']===_0x63b0('0x3a')&&_0x89d336[_0x63b0('0x3c')][_0x63b0('0x33')]){_0x89d336[_0x63b0('0x3c')][_0x63b0('0x33')]=encryptor[_0x63b0('0x42')](_0x89d336[_0x63b0('0x3c')][_0x63b0('0x33')]);}return _0x18f802;})[_0x63b0('0x13')](saveUpdates(_0x89d336[_0x63b0('0x3c')],null))['then'](respondWithResult(_0x5db07e,null))[_0x63b0('0x34')](handleError(_0x5db07e,null));};exports[_0x63b0('0x14')]=function(_0x564d77,_0x16928a){return db['CloudProvider'][_0x63b0('0x39')]({'where':{'id':_0x564d77[_0x63b0('0x35')]['id']}})[_0x63b0('0x13')](handleEntityNotFound(_0x16928a,null))['then'](removeEntity(_0x16928a,null))['catch'](handleError(_0x16928a,null));};exports[_0x63b0('0x43')]=function(_0x205dfc,_0xd4852f){return db['CloudProvider'][_0x63b0('0x44')]({'where':{'id':_0x205dfc['params']['id']},'raw':!![]})[_0x63b0('0x13')](function(_0x4ceeb3){if(!_0x4ceeb3)return _0xd4852f[_0x63b0('0x15')](0x194);return{'url':oauth[_0x63b0('0x45')](_0x4ceeb3,_0x205dfc['user']['id'])};})[_0x63b0('0x13')](respondWithResult(_0xd4852f,null))[_0x63b0('0x34')](handleError(_0xd4852f,null));};exports['oauth2MicrosoftCallback']=function(_0xc1e96,_0x2673c4){var _0x3aee4f=_0xc1e96[_0x63b0('0x3c')];var _0x2ea717;var _0x430795;if(_0x3aee4f['error'])throw _0x3aee4f;redis[_0x63b0('0x46')](_0x3aee4f[_0x63b0('0x47')])['then'](function(_0x27e9c5){if(!_0x27e9c5)throw new Error(_0x63b0('0x48'));_0x2ea717=JSON[_0x63b0('0x49')](_0x27e9c5);var _0x128fcf=Buffer['from'](_0x3aee4f[_0x63b0('0x47')],_0x63b0('0x4a'))[_0x63b0('0x4b')](_0x63b0('0x4c'));_0x430795=JSON['parse'](_0x128fcf);if(!oauth[_0x63b0('0x4d')](_0x3aee4f[_0x63b0('0x4e')],_0x2ea717[_0x63b0('0x4f')]))throw new Error(_0x63b0('0x50'));redis[_0x63b0('0x51')](_0x3aee4f[_0x63b0('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x3aee4f[_0x63b0('0x52')],_0x2ea717);})['then'](function(_0x58de71){_0x2ea717[_0x63b0('0x53')]=_0x58de71['access_token'];_0x2ea717[_0x63b0('0x54')]=_0x58de71[_0x63b0('0x55')];return db[_0x63b0('0x2f')][_0x63b0('0x56')]({'data5':_0x2ea717[_0x63b0('0x53')],'data6':_0x2ea717['data6']},{'where':{'id':_0x2ea717['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x2ea717);socket[_0x63b0('0x57')](_0x63b0('0x58'),{'id':_0x430795['id']});return;})[_0x63b0('0x13')](respondWithStatusCode(_0x2673c4,null))[_0x63b0('0x34')](function(_0x57e56a){if(_0x430795){socket[_0x63b0('0x57')]('microsoftAuthorization:error',{'id':_0x430795['id']});}if(!_0x2ea717){logger[_0x63b0('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x57e56a);return _0x2673c4[_0x63b0('0xb')](0x1f4)['send'](_0x57e56a[_0x63b0('0x59')]);}logger[_0x63b0('0x16')](_0x63b0('0x5a'),_0x2ea717['id'],JSON[_0x63b0('0x5b')](_0x57e56a));});}; \ No newline at end of file +var _0x091c=['Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','params','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','get','state','from','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','ioredis','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','service','data3','catch','show','include','find','MicrosoftAzure','decryptString','create','Name\x20parameter\x20not\x20specified','body'];(function(_0x469218,_0x440d05){var _0x187b4a=function(_0x72ec86){while(--_0x72ec86){_0x469218['push'](_0x469218['shift']());}};_0x187b4a(++_0x440d05);}(_0x091c,0xd8));var _0xc091=function(_0x5719f9,_0x19b313){_0x5719f9=_0x5719f9-0x0;var _0x2330d3=_0x091c[_0x5719f9];return _0x2330d3;};'use strict';var _=require('lodash');var Redis=require(_0xc091('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xc091('0x1'))(_0xc091('0x2'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0xc091('0x3')]=_[_0xc091('0x4')](config[_0xc091('0x3')],{'host':_0xc091('0x5'),'port':0x18eb});var socket=require(_0xc091('0x6'))(new Redis(config['redis']));var redis=new Redis(config[_0xc091('0x3')]);function respondWithStatusCode(_0x2ad463,_0x2ea1b1){_0x2ea1b1=_0x2ea1b1||0xcc;return function(_0x49f103){if(_0x49f103){return _0x2ad463[_0xc091('0x7')](_0x2ea1b1);}return _0x2ad463[_0xc091('0x8')](_0x2ea1b1)[_0xc091('0x9')]();};}function respondWithResult(_0x2c2722,_0x170fec){_0x170fec=_0x170fec||0xc8;return function(_0x34f537){if(_0x34f537){return _0x2c2722[_0xc091('0x8')](_0x170fec)[_0xc091('0xa')](_0x34f537);}};}function respondWithFilteredResult(_0x2f94c4,_0x425f03){return function(_0x4a5ba9){if(_0x4a5ba9){var _0x218905=typeof _0x425f03[_0xc091('0xb')]===_0xc091('0xc')&&typeof _0x425f03[_0xc091('0xd')]===_0xc091('0xc');var _0x7a783a=_0x4a5ba9[_0xc091('0xe')];var _0x211839=_0x218905?0x0:_0x425f03['offset'];var _0x39e4e6=_0x218905?_0x4a5ba9['count']:_0x425f03[_0xc091('0xb')]+_0x425f03['limit'];var _0x316918;if(_0x39e4e6>=_0x7a783a){_0x39e4e6=_0x7a783a;_0x316918=0xc8;}else{_0x316918=0xce;}_0x2f94c4[_0xc091('0x8')](_0x316918);return _0x2f94c4[_0xc091('0xf')](_0xc091('0x10'),_0x211839+'-'+_0x39e4e6+'/'+_0x7a783a)[_0xc091('0xa')](_0x4a5ba9);}return null;};}function saveUpdates(_0xb46b9d){return function(_0x5276a7){if(_0x5276a7){return _0x5276a7[_0xc091('0x11')](_0xb46b9d)[_0xc091('0x12')](function(_0x171fd3){return _0x171fd3;});}return null;};}function removeEntity(_0x11fadc){return function(_0x4989c3){if(_0x4989c3){return _0x4989c3[_0xc091('0x13')]()[_0xc091('0x12')](function(){_0x11fadc[_0xc091('0x8')](0xcc)[_0xc091('0x9')]();});}};}function handleEntityNotFound(_0x36b4f3){return function(_0x1afb6c){if(!_0x1afb6c){_0x36b4f3[_0xc091('0x7')](0x194);}return _0x1afb6c;};}function handleError(_0x35b392,_0x96a33f){_0x96a33f=_0x96a33f||0x1f4;return function(_0x572bb7){logger[_0xc091('0x14')](_0x572bb7['stack']);if(_0x572bb7[_0xc091('0x15')]){delete _0x572bb7[_0xc091('0x15')];}_0x35b392['status'](_0x96a33f)[_0xc091('0x16')](_0x572bb7);};}function maskClientSecret(_0x429590){return _[_0xc091('0x17')](_0x429590[_0xc091('0x18')](0x0,0x3),0x14,'*');}exports[_0xc091('0x19')]=function(_0x2a69a9,_0x198045){var _0x525341={},_0x4b0315={},_0x1d6f38={'count':0x0,'rows':[]};var _0x4f10e1=_[_0xc091('0x1a')](db[_0xc091('0x1b')][_0xc091('0x1c')],function(_0x3df9f3){return{'name':_0x3df9f3[_0xc091('0x1d')],'type':_0x3df9f3[_0xc091('0x1e')][_0xc091('0x1f')]};});_0x4b0315['model']=_[_0xc091('0x1a')](_0x4f10e1,_0xc091('0x15'));_0x4b0315[_0xc091('0x20')]=_[_0xc091('0x21')](_0x2a69a9[_0xc091('0x20')]);_0x4b0315[_0xc091('0x22')]=_[_0xc091('0x23')](_0x4b0315[_0xc091('0x24')],_0x4b0315[_0xc091('0x20')]);_0x525341[_0xc091('0x25')]=_[_0xc091('0x23')](_0x4b0315[_0xc091('0x24')],qs[_0xc091('0x26')](_0x2a69a9[_0xc091('0x20')][_0xc091('0x26')]));_0x525341[_0xc091('0x25')]=_0x525341[_0xc091('0x25')][_0xc091('0x27')]?_0x525341['attributes']:_0x4b0315[_0xc091('0x24')];if(!_0x2a69a9['query'][_0xc091('0x28')](_0xc091('0x29'))){_0x525341['limit']=qs[_0xc091('0xd')](_0x2a69a9[_0xc091('0x20')]['limit']);_0x525341[_0xc091('0xb')]=qs[_0xc091('0xb')](_0x2a69a9[_0xc091('0x20')]['offset']);}_0x525341[_0xc091('0x2a')]=qs[_0xc091('0x2b')](_0x2a69a9['query'][_0xc091('0x2b')]);_0x525341[_0xc091('0x2c')]=qs[_0xc091('0x22')](_[_0xc091('0x2d')](_0x2a69a9[_0xc091('0x20')],_0x4b0315[_0xc091('0x22')]),_0x4f10e1);if(_0x2a69a9[_0xc091('0x20')][_0xc091('0x2e')]){_0x525341[_0xc091('0x2c')]=_[_0xc091('0x2f')](_0x525341['where'],{'$or':_['map'](_0x4f10e1,function(_0x215fba){if(_0x215fba['type']!=='VIRTUAL'){var _0x19a6f4={};_0x19a6f4[_0x215fba[_0xc091('0x15')]]={'$like':'%'+_0x2a69a9['query'][_0xc091('0x2e')]+'%'};return _0x19a6f4;}})});}_0x525341=_[_0xc091('0x2f')]({},_0x525341,_0x2a69a9[_0xc091('0x30')]);var _0x5e1134={'where':_0x525341[_0xc091('0x2c')]};return db[_0xc091('0x1b')]['count'](_0x5e1134)[_0xc091('0x12')](function(_0x1f5829){_0x1d6f38[_0xc091('0xe')]=_0x1f5829;if(_0x2a69a9['query'][_0xc091('0x31')]){_0x525341['include']=[{'all':!![]}];}return db[_0xc091('0x1b')][_0xc091('0x32')](_0x525341);})[_0xc091('0x12')](function(_0x36fce6){_0x1d6f38[_0xc091('0x33')]=_[_0xc091('0x1a')](_0x36fce6,function(_0xc8398c){if(_0xc8398c[_0xc091('0x34')]==='MicrosoftAzure'){var _0xcc49a8=encryptor['decryptString'](_0xc8398c[_0xc091('0x35')]);_0xc8398c['data3']=maskClientSecret(_0xcc49a8);}return _0xc8398c;});return _0x1d6f38;})[_0xc091('0x12')](respondWithFilteredResult(_0x198045,_0x525341))[_0xc091('0x36')](handleError(_0x198045,null));};exports[_0xc091('0x37')]=function(_0x535f52,_0x538c93){var _0x4f7b5c={'raw':!![],'where':{'id':_0x535f52['params']['id']}},_0x471a70={};_0x471a70[_0xc091('0x24')]=_[_0xc091('0x21')](db[_0xc091('0x1b')][_0xc091('0x1c')]);_0x471a70[_0xc091('0x20')]=_['keys'](_0x535f52[_0xc091('0x20')]);_0x471a70[_0xc091('0x22')]=_[_0xc091('0x23')](_0x471a70[_0xc091('0x24')],_0x471a70['query']);_0x4f7b5c[_0xc091('0x25')]=_[_0xc091('0x23')](_0x471a70[_0xc091('0x24')],qs[_0xc091('0x26')](_0x535f52[_0xc091('0x20')]['fields']));_0x4f7b5c[_0xc091('0x25')]=_0x4f7b5c['attributes'][_0xc091('0x27')]?_0x4f7b5c[_0xc091('0x25')]:_0x471a70['model'];if(_0x535f52[_0xc091('0x20')][_0xc091('0x31')]){_0x4f7b5c[_0xc091('0x38')]=[{'all':!![]}];}_0x4f7b5c=_[_0xc091('0x2f')]({},_0x4f7b5c,_0x535f52[_0xc091('0x30')]);return db[_0xc091('0x1b')][_0xc091('0x39')](_0x4f7b5c)['then'](handleEntityNotFound(_0x538c93,null))['then'](function(_0x4dcc4a){if(_0x4dcc4a[_0xc091('0x34')]===_0xc091('0x3a')){var _0x4e25fd=encryptor[_0xc091('0x3b')](_0x4dcc4a[_0xc091('0x35')]);_0x4dcc4a[_0xc091('0x35')]=maskClientSecret(_0x4e25fd);}return _0x4dcc4a;})[_0xc091('0x12')](respondWithResult(_0x538c93,null))[_0xc091('0x36')](handleError(_0x538c93,null));};exports[_0xc091('0x3c')]=function(_0x1d3c46,_0xaeac55){if(!_0x1d3c46['body']['name'])throw new Error(_0xc091('0x3d'));if(!_0x1d3c46[_0xc091('0x3e')][_0xc091('0x34')])throw new Error(_0xc091('0x3f'));var _0x4ca0f8=db['CloudProvider'][_0xc091('0x1c')][_0xc091('0x34')]['values'];if(!_0x4ca0f8[_0xc091('0x40')](_0x1d3c46[_0xc091('0x3e')][_0xc091('0x34')]))throw new Error(_0xc091('0x41')+_0x4ca0f8['join'](',\x20'));if(_0x1d3c46[_0xc091('0x3e')][_0xc091('0x34')]===_0xc091('0x3a')&&_0x1d3c46[_0xc091('0x3e')][_0xc091('0x35')]){_0x1d3c46[_0xc091('0x3e')][_0xc091('0x35')]=encryptor[_0xc091('0x42')](_0x1d3c46[_0xc091('0x3e')][_0xc091('0x35')]);}return db[_0xc091('0x1b')][_0xc091('0x3c')](_0x1d3c46['body'],{})[_0xc091('0x12')](respondWithResult(_0xaeac55,0xc9))[_0xc091('0x36')](handleError(_0xaeac55,null));};exports['update']=function(_0x14fbcb,_0x515076){if(_0x14fbcb[_0xc091('0x3e')]['id']){delete _0x14fbcb[_0xc091('0x3e')]['id'];}return db['CloudProvider'][_0xc091('0x39')]({'where':{'id':_0x14fbcb[_0xc091('0x43')]['id']}})[_0xc091('0x12')](handleEntityNotFound(_0x515076,null))['then'](function(_0x3169b0){if(_0x3169b0[_0xc091('0x34')]===_0xc091('0x3a')&&_0x14fbcb[_0xc091('0x3e')]['data3']){_0x14fbcb[_0xc091('0x3e')][_0xc091('0x35')]=encryptor['encryptString'](_0x14fbcb[_0xc091('0x3e')][_0xc091('0x35')]);}return _0x3169b0;})[_0xc091('0x12')](saveUpdates(_0x14fbcb['body'],null))[_0xc091('0x12')](respondWithResult(_0x515076,null))[_0xc091('0x36')](handleError(_0x515076,null));};exports[_0xc091('0x13')]=function(_0x36d454,_0xac8e86){return db[_0xc091('0x1b')]['find']({'where':{'id':_0x36d454['params']['id']}})[_0xc091('0x12')](handleEntityNotFound(_0xac8e86,null))['then'](removeEntity(_0xac8e86,null))[_0xc091('0x36')](handleError(_0xac8e86,null));};exports[_0xc091('0x44')]=function(_0x482cc6,_0x2ee736){return db['CloudProvider']['findOne']({'where':{'id':_0x482cc6[_0xc091('0x43')]['id']},'raw':!![]})['then'](function(_0x4798d6){if(!_0x4798d6)return _0x2ee736[_0xc091('0x7')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x4798d6,_0x482cc6[_0xc091('0x45')]['id'])};})[_0xc091('0x12')](respondWithResult(_0x2ee736,null))['catch'](handleError(_0x2ee736,null));};exports[_0xc091('0x46')]=function(_0x57f610,_0x57176a){var _0x1d0f5e=_0x57f610['body'];var _0x25cbb0;var _0x35dd01;if(_0x1d0f5e[_0xc091('0x14')])throw _0x1d0f5e;redis[_0xc091('0x47')](_0x1d0f5e[_0xc091('0x48')])[_0xc091('0x12')](function(_0x47b94c){if(!_0x47b94c)throw new Error('Invalid\x20state\x20parameter');_0x25cbb0=JSON['parse'](_0x47b94c);var _0x27bdfc=Buffer[_0xc091('0x49')](_0x1d0f5e['state'],_0xc091('0x4a'))['toString'](_0xc091('0x4b'));_0x35dd01=JSON['parse'](_0x27bdfc);if(!oauth[_0xc091('0x4c')](_0x1d0f5e[_0xc091('0x4d')],_0x25cbb0[_0xc091('0x4e')]))throw new Error(_0xc091('0x4f'));redis[_0xc091('0x50')](_0x1d0f5e[_0xc091('0x48')]);return oauth[_0xc091('0x51')](_0x1d0f5e[_0xc091('0x52')],_0x25cbb0);})[_0xc091('0x12')](function(_0x1c50d8){_0x25cbb0[_0xc091('0x53')]=_0x1c50d8[_0xc091('0x54')];_0x25cbb0[_0xc091('0x55')]=_0x1c50d8[_0xc091('0x56')];return db[_0xc091('0x1b')][_0xc091('0x11')]({'data5':_0x25cbb0[_0xc091('0x53')],'data6':_0x25cbb0[_0xc091('0x55')]},{'where':{'id':_0x25cbb0['id']}});})['then'](function(){oauth[_0xc091('0x57')](_0x25cbb0);socket[_0xc091('0x58')](_0xc091('0x59'),{'id':_0x35dd01['id']});return;})[_0xc091('0x12')](respondWithStatusCode(_0x57176a,null))[_0xc091('0x36')](function(_0x35648b){if(_0x35dd01){socket[_0xc091('0x58')](_0xc091('0x5a'),{'id':_0x35dd01['id']});}if(!_0x25cbb0){logger[_0xc091('0x14')](_0xc091('0x5b'),_0x35648b);return _0x57176a[_0xc091('0x8')](0x1f4)[_0xc091('0x16')](_0x35648b[_0xc091('0x5c')]);}logger[_0xc091('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x25cbb0['id'],JSON['stringify'](_0x35648b));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 32928f6..264da9a 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 _0x8fe1=['api','moment','request-promise','rimraf','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x8fe1,0xbd));var _0x18fe=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x8fe1[_0xaa6a4];return _0xdc31a4;};'use strict';var _=require(_0x18fe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x18fe('0x1'));var moment=require(_0x18fe('0x2'));var BPromise=require('bluebird');var rp=require(_0x18fe('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18fe('0x4'));var config=require(_0x18fe('0x5'));var attributes=require('./cloudProvider.attributes');module[_0x18fe('0x6')]=function(_0x52190b,_0x52a23e){return _0x52190b[_0x18fe('0x7')](_0x18fe('0x8'),attributes,{'tableName':_0x18fe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4519=['moment','bluebird','request-promise','path','./cloudProvider.attributes','exports','define','cloud_providers','util','../../config/logger','api'];(function(_0x50e40b,_0x338d17){var _0x2608b7=function(_0x4ded5e){while(--_0x4ded5e){_0x50e40b['push'](_0x50e40b['shift']());}};_0x2608b7(++_0x338d17);}(_0x4519,0xad));var _0x9451=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4519[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x9451('0x0'));var logger=require(_0x9451('0x1'))(_0x9451('0x2'));var moment=require(_0x9451('0x3'));var BPromise=require(_0x9451('0x4'));var rp=require(_0x9451('0x5'));var fs=require('fs');var path=require(_0x9451('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9451('0x7'));module[_0x9451('0x8')]=function(_0x1bfadc,_0x3dfb83){return _0x1bfadc[_0x9451('0x9')]('CloudProvider',attributes,{'tableName':_0x9451('0xa'),'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 79c7bb3..2ab9eef 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 _0xd0af=['exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','decryptString','POST','data2','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','request-promise','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','code','id_token','stringify','toString','randomBytes','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims','oauth2/','set','decode','payload','issuer','aud','audience','isAfter','unix'];(function(_0x513b33,_0x3b061e){var _0x43d3fb=function(_0x61a7bc){while(--_0x61a7bc){_0x513b33['push'](_0x513b33['shift']());}};_0x43d3fb(++_0x3b061e);}(_0xd0af,0x1ef));var _0xfd0a=function(_0x1559a3,_0x1e4f51){_0x1559a3=_0x1559a3-0x0;var _0x3a4b87=_0xd0af[_0x1559a3];return _0x3a4b87;};'use strict';var _=require(_0xfd0a('0x0'));var crypto=require(_0xfd0a('0x1'));var jwt=require(_0xfd0a('0x2'));var moment=require(_0xfd0a('0x3'));var Redis=require('ioredis');var rp=require(_0xfd0a('0x4'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0xfd0a('0x5'));var logger=require('../../config/logger')(_0xfd0a('0x6'));var schedule=require(_0xfd0a('0x7'));var db=require(_0xfd0a('0x8'))['db'];config[_0xfd0a('0x9')]=_[_0xfd0a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xfd0a('0x9')]);var MICROSOFT_AUTH_URL=_0xfd0a('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xfd0a('0xc'),_0xfd0a('0xd'),_0xfd0a('0xe'),_0xfd0a('0xf'),_0xfd0a('0x10'),_0xfd0a('0x11')],'Dynamics365':[_0xfd0a('0x12'),_0xfd0a('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0xfd0a('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x520427){var _0x5822c7=_[_0xfd0a('0x14')](AZURE_AUTH_SCOPES[_0x520427[_0xfd0a('0x15')]]);if(_0x520427[_0xfd0a('0x15')]===_0xfd0a('0x16'))_0x5822c7[_0xfd0a('0x17')](_0x520427[_0xfd0a('0x18')]+_0xfd0a('0x19'));return _0x5822c7[_0xfd0a('0x1a')]('\x20');}function getAccessTokenScope(_0x30fd3f){if(_0x30fd3f['type']===_0xfd0a('0x1b'))return _0xfd0a('0xf');if(_0x30fd3f['type']===_0xfd0a('0x16'))return _0x30fd3f[_0xfd0a('0x18')]+_0xfd0a('0x19');}function generateMicrosoftAuthorizationUrl(_0x5c2b37,_0x29671c){var _0x3cc2bd=MICROSOFT_AUTH_URL[_0xfd0a('0x1c')](_0xfd0a('0x1d'),_0x5c2b37['data2']);var _0xf9e5de=[_0xfd0a('0x1e'),_0xfd0a('0x1f')];var _0x538dd2=Buffer['from'](JSON[_0xfd0a('0x20')]({'id':_0x29671c}))[_0xfd0a('0x21')]('base64');var _0x2b3df8=crypto[_0xfd0a('0x22')](0x10)[_0xfd0a('0x21')]('hex');var _0x3fe248=getAuthorizationScopes(_0x5c2b37);var _0x1e8be2=[{'key':_0xfd0a('0x23'),'value':_0x5c2b37[_0xfd0a('0x24')]},{'key':_0xfd0a('0x25'),'value':encodeURIComponent(_0xf9e5de[_0xfd0a('0x1a')]('\x20'))},{'key':_0xfd0a('0x26'),'value':_0x5c2b37[_0xfd0a('0x27')]},{'key':_0xfd0a('0x28'),'value':_0xfd0a('0x29')},{'key':_0xfd0a('0x2a'),'value':encodeURIComponent(_0x3fe248)},{'key':_0xfd0a('0x2b'),'value':_0x538dd2},{'key':_0xfd0a('0x2c'),'value':_0x2b3df8},{'key':_0xfd0a('0x2d'),'value':_0xfd0a('0x2e')}];var _0x32f934=_0x3cc2bd+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x1e8be2,function(_0x2eb573){return _0x2eb573['key']+'='+_0x2eb573[_0xfd0a('0x2f')];})[_0xfd0a('0x1a')]('&');_0x5c2b37[_0xfd0a('0x30')]={'issuer':_0x3cc2bd[_0xfd0a('0x1c')](_0xfd0a('0x31'),''),'audience':_0x5c2b37[_0xfd0a('0x24')],'state':_0x538dd2,'nonce':_0x2b3df8};redis[_0xfd0a('0x32')](_0x538dd2,JSON[_0xfd0a('0x20')](_0x5c2b37));return _0x32f934;}function isValidIdToken(_0x4791e4,_0x20366c){try{var _0x39a77f=jwt[_0xfd0a('0x33')](_0x4791e4,{'complete':!![]});var _0x3cffda=_0x39a77f[_0xfd0a('0x34')];if(_0x3cffda['iss']!==_0x20366c[_0xfd0a('0x35')])return![];if(_0x3cffda[_0xfd0a('0x36')]!==_0x20366c[_0xfd0a('0x37')])return![];if(_0x3cffda['nonce']!==_0x20366c[_0xfd0a('0x2c')])return![];if(moment()[_0xfd0a('0x38')](moment[_0xfd0a('0x39')](_0x3cffda[_0xfd0a('0x3a')])))return![];return!![];}catch(_0x5ceb78){throw _0x5ceb78;}}function refreshOauth2MicrosoftAccessToken(_0x595433){return Promise[_0xfd0a('0x3b')]()['then'](function(){if(_0x595433[_0xfd0a('0x3c')])return _0x595433;return db[_0xfd0a('0x3d')][_0xfd0a('0x3e')]({'where':{'id':_0x595433['id']},'raw':!![]});})[_0xfd0a('0x3f')](function(_0x4e6462){var _0x45b05d={'grant_type':_0xfd0a('0x40'),'refresh_token':_0x4e6462[_0xfd0a('0x41')],'scope':getAccessTokenScope(_0x4e6462),'redirect_uri':_0x4e6462['data4'],'client_id':_0x4e6462[_0xfd0a('0x24')],'client_secret':encryptor['decryptString'](_0x4e6462[_0xfd0a('0x3c')])};var _0x561825={'method':'POST','uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x4e6462['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x45b05d,'json':!![]};return rp(_0x561825);})[_0xfd0a('0x3f')](function(_0x5a0150){_0x595433[_0xfd0a('0x42')]=_0x5a0150[_0xfd0a('0x43')];_0x595433[_0xfd0a('0x41')]=_0x5a0150[_0xfd0a('0x40')];return db[_0xfd0a('0x3d')]['update']({'data5':_0x595433[_0xfd0a('0x42')],'data6':_0x595433[_0xfd0a('0x41')]},{'where':{'id':_0x595433['id']}});})[_0xfd0a('0x3f')](function(){return _0x595433;})[_0xfd0a('0x44')](function(_0x10a01b){logger[_0xfd0a('0x45')](_0xfd0a('0x46'),_0x595433['id'],_0x10a01b);});}function getOauth2MicrosoftAccessToken(_0x5fc438,_0x47ef98){var _0x2654ab={'grant_type':'authorization_code','code':_0x5fc438,'scope':getAccessTokenScope(_0x47ef98),'redirect_uri':_0x47ef98['data4'],'client_id':_0x47ef98[_0xfd0a('0x24')],'client_secret':encryptor[_0xfd0a('0x47')](_0x47ef98[_0xfd0a('0x3c')])};var _0x544ec3={'method':_0xfd0a('0x48'),'uri':MICROSOFT_AUTH_URL[_0xfd0a('0x1c')](_0xfd0a('0x1d'),_0x47ef98[_0xfd0a('0x49')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2654ab,'json':!![]};return rp(_0x544ec3);}function startRefreshInterval(_0x1305d3){var _0x3451bc=schedule['intervals'];if(_0x3451bc[_0x1305d3['id']])clearInterval(_0x3451bc[_0x1305d3['id']]);_0x3451bc[_0x1305d3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xfd0a('0x4a')](this,{'id':_0x1305d3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3451bc;}function startAllRefreshIntervals(){return db[_0xfd0a('0x3d')][_0xfd0a('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x3f27bc){var _0x598070=_0x3f27bc[_0xfd0a('0x14')](function(_0x5884d1){return refreshOauth2MicrosoftAccessToken(_0x5884d1)[_0xfd0a('0x3f')](function(_0x17caf4){startRefreshInterval(_0x17caf4);});});return Promise[_0xfd0a('0x4c')](_0x598070);})[_0xfd0a('0x44')](function(_0x39ae2e){var _0x2ce610=_0x39ae2e?util[_0xfd0a('0x4d')](_0x39ae2e,{'showHidden':![],'depth':null}):'';logger[_0xfd0a('0x45')](_0xfd0a('0x4e'),_0x2ce610);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xbfa8=['from','stringify','toString','randomBytes','hex','client_id','data1','redirect_uri','data4','response_mode','form_post','scope','state','nonce','login','key','value','oauth2Claims','oauth2/','set','payload','iss','issuer','aud','audience','isAfter','exp','resolve','then','findOne','refresh_token','data6','decryptString','POST','data5','access_token','CloudProvider','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data3','{TENANT_ID}','data2','intervals','bind','findAll','map','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../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','/authorize','/token','type','Dynamics365','data7','join','Outlook365','/.default','replace','code','id_token'];(function(_0x56d970,_0x42c6e6){var _0x9180e6=function(_0x38b9d9){while(--_0x38b9d9){_0x56d970['push'](_0x56d970['shift']());}};_0x9180e6(++_0x42c6e6);}(_0xbfa8,0x1dd));var _0x8bfa=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbfa8[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x8bfa('0x0'));var crypto=require(_0x8bfa('0x1'));var jwt=require(_0x8bfa('0x2'));var moment=require(_0x8bfa('0x3'));var Redis=require(_0x8bfa('0x4'));var rp=require(_0x8bfa('0x5'));var util=require(_0x8bfa('0x6'));var encryptor=require(_0x8bfa('0x7'));var config=require(_0x8bfa('0x8'));var logger=require(_0x8bfa('0x9'))(_0x8bfa('0xa'));var schedule=require(_0x8bfa('0xb'));var db=require(_0x8bfa('0xc'))['db'];config[_0x8bfa('0xd')]=_[_0x8bfa('0xe')](config[_0x8bfa('0xd')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x8bfa('0xd')]);var MICROSOFT_AUTH_URL=_0x8bfa('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x8bfa('0x10'),_0x8bfa('0x11'),_0x8bfa('0x12'),_0x8bfa('0x13'),_0x8bfa('0x14'),_0x8bfa('0x15'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x8bfa('0x10'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x8bfa('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0x8bfa('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x44f3bb){var _0x3011d8=_['map'](AZURE_AUTH_SCOPES[_0x44f3bb[_0x8bfa('0x18')]]);if(_0x44f3bb[_0x8bfa('0x18')]===_0x8bfa('0x19'))_0x3011d8['push'](_0x44f3bb[_0x8bfa('0x1a')]+'/.default');return _0x3011d8[_0x8bfa('0x1b')]('\x20');}function getAccessTokenScope(_0x31152b){if(_0x31152b[_0x8bfa('0x18')]===_0x8bfa('0x1c'))return _0x8bfa('0x14');if(_0x31152b[_0x8bfa('0x18')]===_0x8bfa('0x19'))return _0x31152b[_0x8bfa('0x1a')]+_0x8bfa('0x1d');}function generateMicrosoftAuthorizationUrl(_0x4b204d,_0x5c4e66){var _0x207b62=MICROSOFT_AUTH_URL[_0x8bfa('0x1e')]('{TENANT_ID}',_0x4b204d['data2']);var _0x793951=[_0x8bfa('0x1f'),_0x8bfa('0x20')];var _0x23eeed=Buffer[_0x8bfa('0x21')](JSON[_0x8bfa('0x22')]({'id':_0x5c4e66}))[_0x8bfa('0x23')]('base64');var _0x408301=crypto[_0x8bfa('0x24')](0x10)[_0x8bfa('0x23')](_0x8bfa('0x25'));var _0x43458c=getAuthorizationScopes(_0x4b204d);var _0x2a3a7d=[{'key':_0x8bfa('0x26'),'value':_0x4b204d[_0x8bfa('0x27')]},{'key':'response_type','value':encodeURIComponent(_0x793951[_0x8bfa('0x1b')]('\x20'))},{'key':_0x8bfa('0x28'),'value':_0x4b204d[_0x8bfa('0x29')]},{'key':_0x8bfa('0x2a'),'value':_0x8bfa('0x2b')},{'key':_0x8bfa('0x2c'),'value':encodeURIComponent(_0x43458c)},{'key':_0x8bfa('0x2d'),'value':_0x23eeed},{'key':_0x8bfa('0x2e'),'value':_0x408301},{'key':'prompt','value':_0x8bfa('0x2f')}];var _0xa1c5a5=_0x207b62+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2a3a7d,function(_0x593f58){return _0x593f58[_0x8bfa('0x30')]+'='+_0x593f58[_0x8bfa('0x31')];})[_0x8bfa('0x1b')]('&');_0x4b204d[_0x8bfa('0x32')]={'issuer':_0x207b62[_0x8bfa('0x1e')](_0x8bfa('0x33'),''),'audience':_0x4b204d['data1'],'state':_0x23eeed,'nonce':_0x408301};redis[_0x8bfa('0x34')](_0x23eeed,JSON[_0x8bfa('0x22')](_0x4b204d));return _0xa1c5a5;}function isValidIdToken(_0x4b3e6b,_0x167acd){try{var _0x47be07=jwt['decode'](_0x4b3e6b,{'complete':!![]});var _0x6c6ff1=_0x47be07[_0x8bfa('0x35')];if(_0x6c6ff1[_0x8bfa('0x36')]!==_0x167acd[_0x8bfa('0x37')])return![];if(_0x6c6ff1[_0x8bfa('0x38')]!==_0x167acd[_0x8bfa('0x39')])return![];if(_0x6c6ff1[_0x8bfa('0x2e')]!==_0x167acd[_0x8bfa('0x2e')])return![];if(moment()[_0x8bfa('0x3a')](moment['unix'](_0x6c6ff1[_0x8bfa('0x3b')])))return![];return!![];}catch(_0x275789){throw _0x275789;}}function refreshOauth2MicrosoftAccessToken(_0x47f8b3){return Promise[_0x8bfa('0x3c')]()[_0x8bfa('0x3d')](function(){if(_0x47f8b3['data3'])return _0x47f8b3;return db['CloudProvider'][_0x8bfa('0x3e')]({'where':{'id':_0x47f8b3['id']},'raw':!![]});})[_0x8bfa('0x3d')](function(_0x9e4381){var _0x18707a={'grant_type':_0x8bfa('0x3f'),'refresh_token':_0x9e4381[_0x8bfa('0x40')],'scope':getAccessTokenScope(_0x9e4381),'redirect_uri':_0x9e4381[_0x8bfa('0x29')],'client_id':_0x9e4381['data1'],'client_secret':encryptor[_0x8bfa('0x41')](_0x9e4381['data3'])};var _0x21f830={'method':_0x8bfa('0x42'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x9e4381['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x18707a,'json':!![]};return rp(_0x21f830);})[_0x8bfa('0x3d')](function(_0x341a86){_0x47f8b3[_0x8bfa('0x43')]=_0x341a86[_0x8bfa('0x44')];_0x47f8b3[_0x8bfa('0x40')]=_0x341a86[_0x8bfa('0x3f')];return db[_0x8bfa('0x45')][_0x8bfa('0x46')]({'data5':_0x47f8b3[_0x8bfa('0x43')],'data6':_0x47f8b3[_0x8bfa('0x40')]},{'where':{'id':_0x47f8b3['id']}});})[_0x8bfa('0x3d')](function(){return _0x47f8b3;})[_0x8bfa('0x47')](function(_0xc3db0d){logger['error'](_0x8bfa('0x48'),_0x47f8b3['id'],_0xc3db0d);});}function getOauth2MicrosoftAccessToken(_0x4e3e00,_0x3dad44){var _0x106849={'grant_type':'authorization_code','code':_0x4e3e00,'scope':getAccessTokenScope(_0x3dad44),'redirect_uri':_0x3dad44['data4'],'client_id':_0x3dad44[_0x8bfa('0x27')],'client_secret':encryptor[_0x8bfa('0x41')](_0x3dad44[_0x8bfa('0x49')])};var _0x470f8e={'method':_0x8bfa('0x42'),'uri':MICROSOFT_AUTH_URL[_0x8bfa('0x1e')](_0x8bfa('0x4a'),_0x3dad44[_0x8bfa('0x4b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x106849,'json':!![]};return rp(_0x470f8e);}function startRefreshInterval(_0x45c17c){var _0x123a0b=schedule[_0x8bfa('0x4c')];if(_0x123a0b[_0x45c17c['id']])clearInterval(_0x123a0b[_0x45c17c['id']]);_0x123a0b[_0x45c17c['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8bfa('0x4d')](this,{'id':_0x45c17c['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x123a0b;}function startAllRefreshIntervals(){return db[_0x8bfa('0x45')][_0x8bfa('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x55a52d){var _0x2b2266=_0x55a52d[_0x8bfa('0x4f')](function(_0x2de7ec){return refreshOauth2MicrosoftAccessToken(_0x2de7ec)[_0x8bfa('0x3d')](function(_0x5c4583){startRefreshInterval(_0x5c4583);});});return Promise[_0x8bfa('0x50')](_0x2b2266);})[_0x8bfa('0x47')](function(_0x31be30){var _0x5ea21d=_0x31be30?util[_0x8bfa('0x51')](_0x31be30,{'showHidden':![],'depth':null}):'';logger[_0x8bfa('0x52')](_0x8bfa('0x53'),_0x5ea21d);});}module[_0x8bfa('0x54')]={'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 3d0600b..7c3e380 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 _0x96f2=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x2efe3d,_0x1f5e3e){var _0x52117c=function(_0x7b6e52){while(--_0x7b6e52){_0x2efe3d['push'](_0x2efe3d['shift']());}};_0x52117c(++_0x1f5e3e);}(_0x96f2,0xb0));var _0x296f=function(_0x44a39f,_0x3c6f4a){_0x44a39f=_0x44a39f-0x0;var _0x10efdc=_0x96f2[_0x44a39f];return _0x10efdc;};'use strict';var _=require(_0x296f('0x0'));var util=require('util');var moment=require(_0x296f('0x1'));var BPromise=require(_0x296f('0x2'));var rs=require(_0x296f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x296f('0x4'))['db'];var utils=require(_0x296f('0x5'));var logger=require(_0x296f('0x6'))('rpc');var config=require(_0x296f('0x7'));var jayson=require(_0x296f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x164031,_0x1d019f,_0x2dc0ca){return new BPromise(function(_0x28f708,_0x30ed43){return client[_0x296f('0x9')](_0x164031,_0x2dc0ca)[_0x296f('0xa')](function(_0x3ea699){logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,'request\x20sent');logger[_0x296f('0xd')](_0x296f('0xe'),_0x1d019f,_0x296f('0xf'),JSON['stringify'](_0x3ea699));if(_0x3ea699[_0x296f('0x10')]){if(_0x3ea699[_0x296f('0x10')][_0x296f('0x11')]===0x1f4){logger[_0x296f('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1d019f,_0x3ea699['error']['message']);return _0x30ed43(_0x3ea699[_0x296f('0x10')][_0x296f('0x12')]);}logger[_0x296f('0x10')](_0x296f('0xc'),_0x1d019f,_0x3ea699['error'][_0x296f('0x12')]);return _0x28f708(_0x3ea699['error']['message']);}else{logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,_0x296f('0xf'));_0x28f708(_0x3ea699[_0x296f('0x13')]['message']);}})['catch'](function(_0x3e3860){logger['error'](_0x296f('0xc'),_0x1d019f,_0x3e3860);_0x30ed43(_0x3e3860);});});} \ No newline at end of file +var _0x0598=['../../config/utils','jayson/promise','client','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x389a65,_0x5ed8e8){var _0x360e61=function(_0x195028){while(--_0x195028){_0x389a65['push'](_0x389a65['shift']());}};_0x360e61(++_0x5ed8e8);}(_0x0598,0x92));var _0x8059=function(_0x473997,_0x35b0b4){_0x473997=_0x473997-0x0;var _0x3293c9=_0x0598[_0x473997];return _0x3293c9;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 540d27d..35b9018 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(_0x13be3a,_0x9e14ec){var _0x41d6e2=function(_0x3e25a4){while(--_0x3e25a4){_0x13be3a['push'](_0x13be3a['shift']());}};_0x41d6e2(++_0x9e14ec);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'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 _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(_0x1c7eff,_0x18a2fa){var _0x27bd7a=function(_0x53b6db){while(--_0x53b6db){_0x1c7eff['push'](_0x1c7eff['shift']());}};_0x27bd7a(++_0x18a2fa);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 564b52c..66ee5c8 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 _0x299d=['STRING','name'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x299d,0x168));var _0xd299=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x299d[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd299('0x0')],'unique':_0xd299('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd299('0x0')]},'companyId':{'type':Sequelize[_0xd299('0x0')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xd299('0x0')]},'postalCode':{'type':Sequelize[_0xd299('0x0')]},'city':{'type':Sequelize[_0xd299('0x0')]},'country':{'type':Sequelize[_0xd299('0x0')]},'email':{'type':Sequelize[_0xd299('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd299('0x0')]},'sStreet':{'type':Sequelize[_0xd299('0x0')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xd299('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd299('0x0')]}}; \ No newline at end of file +var _0x81c2=['exports','name','STRING','sequelize'];(function(_0x4d3851,_0xb854ef){var _0x1b659f=function(_0x4973b0){while(--_0x4973b0){_0x4d3851['push'](_0x4d3851['shift']());}};_0x1b659f(++_0xb854ef);}(_0x81c2,0xdf));var _0x281c=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x81c2[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0x281c('0x0'));module[_0x281c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x281c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x281c('0x3')]},'companyId':{'type':Sequelize[_0x281c('0x3')]},'website':{'type':Sequelize[_0x281c('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x281c('0x3')]},'type':{'type':Sequelize[_0x281c('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x281c('0x3')]},'city':{'type':Sequelize[_0x281c('0x3')]},'country':{'type':Sequelize[_0x281c('0x3')]},'email':{'type':Sequelize[_0x281c('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x281c('0x3')]},'sStreet':{'type':Sequelize[_0x281c('0x3')]},'sPostalCode':{'type':Sequelize[_0x281c('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x281c('0x3')]},'description':{'type':Sequelize[_0x281c('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 324d1bc..32fe028 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 _0x2f34=['role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','getContacts','findOne','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','get','then','end','sendStatus','error','stack','name','send','index','CmCompany','describe','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x30e279,_0x53c1b6){var _0x1f2b79=function(_0x1e0e1f){while(--_0x1e0e1f){_0x30e279['push'](_0x30e279['shift']());}};_0x1f2b79(++_0x53c1b6);}(_0x2f34,0x1ca));var _0x42f3=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x2f34[_0x24259d];return _0x5a701;};'use strict';var emlformat=require(_0x42f3('0x0'));var rimraf=require(_0x42f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42f3('0x2'));var rp=require(_0x42f3('0x3'));var moment=require(_0x42f3('0x4'));var BPromise=require(_0x42f3('0x5'));var Mustache=require(_0x42f3('0x6'));var util=require('util');var path=require(_0x42f3('0x7'));var sox=require('sox');var csv=require(_0x42f3('0x8'));var ejs=require(_0x42f3('0x9'));var fs=require('fs');var fs_extra=require(_0x42f3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x42f3('0xb'));var jsforce=require(_0x42f3('0xc'));var deskjs=require(_0x42f3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x42f3('0xe'));var Papa=require(_0x42f3('0xf'));var Redis=require(_0x42f3('0x10'));var authService=require(_0x42f3('0x11'));var qs=require(_0x42f3('0x12'));var as=require(_0x42f3('0x13'));var hardwareService=require(_0x42f3('0x14'));var logger=require(_0x42f3('0x15'))(_0x42f3('0x16'));var utils=require(_0x42f3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x42f3('0x18'));var db=require(_0x42f3('0x19'))['db'];function respondWithStatusCode(_0x2b1908,_0x269987){_0x269987=_0x269987||0xcc;return function(_0x24b44b){if(_0x24b44b){return _0x2b1908['sendStatus'](_0x269987);}return _0x2b1908[_0x42f3('0x1a')](_0x269987)['end']();};}function respondWithResult(_0x12cde3,_0x2cc004){_0x2cc004=_0x2cc004||0xc8;return function(_0xd48011){if(_0xd48011){return _0x12cde3[_0x42f3('0x1a')](_0x2cc004)[_0x42f3('0x1b')](_0xd48011);}};}function respondWithFilteredResult(_0x54a976,_0x4f84c2){return function(_0x103856){if(_0x103856){var _0x401596=typeof _0x4f84c2[_0x42f3('0x1c')]===_0x42f3('0x1d')&&typeof _0x4f84c2[_0x42f3('0x1e')]==='undefined';var _0x2f2a3b=_0x103856[_0x42f3('0x1f')];var _0x1de961=_0x401596?0x0:_0x4f84c2[_0x42f3('0x1c')];var _0x355a5e=_0x401596?_0x103856['count']:_0x4f84c2[_0x42f3('0x1c')]+_0x4f84c2[_0x42f3('0x1e')];var _0x18735b;if(_0x355a5e>=_0x2f2a3b){_0x355a5e=_0x2f2a3b;_0x18735b=0xc8;}else{_0x18735b=0xce;}_0x54a976[_0x42f3('0x1a')](_0x18735b);return _0x54a976[_0x42f3('0x20')](_0x42f3('0x21'),_0x1de961+'-'+_0x355a5e+'/'+_0x2f2a3b)[_0x42f3('0x1b')](_0x103856);}return null;};}function patchUpdates(_0x58f298){return function(_0x1997b9){try{jsonpatch[_0x42f3('0x22')](_0x1997b9,_0x58f298,!![]);}catch(_0xc935af){return BPromise['reject'](_0xc935af);}return _0x1997b9[_0x42f3('0x23')]();};}function saveUpdates(_0x1dc3c7,_0x37cd43){return function(_0x49e99f){if(_0x49e99f){return _0x49e99f['update'](_0x1dc3c7)['then'](function(_0x38af7e){return _0x38af7e;});}return null;};}function removeEntity(_0x3b1309,_0x12bf8b){return function(_0x4d4295){if(_0x4d4295){return _0x4d4295[_0x42f3('0x24')]()['then'](function(){var _0x195d86=_0x4d4295[_0x42f3('0x25')]({'plain':!![]});var _0xec08f4='Companies';return db['UserProfileResource']['destroy']({'where':{'type':_0xec08f4,'resourceId':_0x195d86['id']}})[_0x42f3('0x26')](function(){return _0x4d4295;});})[_0x42f3('0x26')](function(){_0x3b1309[_0x42f3('0x1a')](0xcc)[_0x42f3('0x27')]();});}};}function handleEntityNotFound(_0x1e0b53,_0x4b6f03){return function(_0x14a994){if(!_0x14a994){_0x1e0b53[_0x42f3('0x28')](0x194);}return _0x14a994;};}function handleError(_0x54b62d,_0x361456){_0x361456=_0x361456||0x1f4;return function(_0x57579e){logger[_0x42f3('0x29')](_0x57579e[_0x42f3('0x2a')]);if(_0x57579e[_0x42f3('0x2b')]){delete _0x57579e[_0x42f3('0x2b')];}_0x54b62d[_0x42f3('0x1a')](_0x361456)[_0x42f3('0x2c')](_0x57579e);};}exports[_0x42f3('0x2d')]=function(_0x5023da,_0x27fa07){var _0x3d7044={},_0x54e81f={},_0x51e3e1={'count':0x0,'rows':[]};return db[_0x42f3('0x2e')][_0x42f3('0x2f')]()[_0x42f3('0x26')](function(_0x2b9686){_0x54e81f['model']=_['keys'](_0x2b9686);_0x54e81f[_0x42f3('0x30')]=_[_0x42f3('0x31')](_0x5023da[_0x42f3('0x30')]);_0x54e81f[_0x42f3('0x32')]=_[_0x42f3('0x33')](_0x54e81f[_0x42f3('0x34')],_0x54e81f[_0x42f3('0x30')]);_0x3d7044['attributes']=_['intersection'](_0x54e81f[_0x42f3('0x34')],qs[_0x42f3('0x35')](_0x5023da[_0x42f3('0x30')][_0x42f3('0x35')]));_0x3d7044[_0x42f3('0x36')]=_0x3d7044['attributes']['length']?_0x3d7044[_0x42f3('0x36')]:_0x54e81f['model'];if(!_0x5023da[_0x42f3('0x30')][_0x42f3('0x37')](_0x42f3('0x38'))){_0x3d7044[_0x42f3('0x1e')]=qs[_0x42f3('0x1e')](_0x5023da[_0x42f3('0x30')][_0x42f3('0x1e')]);_0x3d7044[_0x42f3('0x1c')]=qs[_0x42f3('0x1c')](_0x5023da[_0x42f3('0x30')][_0x42f3('0x1c')]);}_0x3d7044[_0x42f3('0x39')]=qs[_0x42f3('0x3a')](_0x5023da['query'][_0x42f3('0x3a')]);_0x3d7044[_0x42f3('0x3b')]=qs[_0x42f3('0x32')](_[_0x42f3('0x3c')](_0x5023da['query'],_0x54e81f[_0x42f3('0x32')]),_0x2b9686);if(_0x5023da[_0x42f3('0x30')][_0x42f3('0x3d')]){_0x3d7044[_0x42f3('0x3b')]=_[_0x42f3('0x3e')](_0x3d7044[_0x42f3('0x3b')],{'$or':_['map'](_0x3d7044['attributes'],function(_0x137883){var _0x248f79={};_0x248f79[_0x137883]={'$like':'%'+_0x5023da[_0x42f3('0x30')]['filter']+'%'};return _0x248f79;})});}_0x3d7044=_[_0x42f3('0x3e')]({},_0x3d7044,_0x5023da[_0x42f3('0x3f')]);var _0x385f5f={'where':_0x3d7044[_0x42f3('0x3b')]};return db['CmCompany'][_0x42f3('0x1f')](_0x385f5f)['then'](function(_0x535ba1){_0x51e3e1[_0x42f3('0x1f')]=_0x535ba1;if(_0x5023da[_0x42f3('0x30')][_0x42f3('0x40')]){_0x3d7044[_0x42f3('0x41')]=[{'all':!![]}];}return db[_0x42f3('0x2e')]['findAll'](_0x3d7044);})[_0x42f3('0x26')](function(_0x199fb8){_0x51e3e1[_0x42f3('0x42')]=_0x199fb8;return _0x51e3e1;})[_0x42f3('0x26')](respondWithFilteredResult(_0x27fa07,_0x3d7044))[_0x42f3('0x43')](handleError(_0x27fa07,null));})[_0x42f3('0x43')](handleError(_0x27fa07,null));};exports[_0x42f3('0x44')]=function(_0x376cd6,_0x39f29e){var _0x28e994={'raw':![],'where':{'id':_0x376cd6[_0x42f3('0x45')]['id']}},_0x1dc84a={};_0x1dc84a[_0x42f3('0x34')]=_[_0x42f3('0x31')](db[_0x42f3('0x2e')][_0x42f3('0x46')]);_0x1dc84a['query']=_[_0x42f3('0x31')](_0x376cd6['query']);_0x1dc84a[_0x42f3('0x32')]=_[_0x42f3('0x33')](_0x1dc84a[_0x42f3('0x34')],_0x1dc84a[_0x42f3('0x30')]);_0x28e994[_0x42f3('0x36')]=_[_0x42f3('0x33')](_0x1dc84a['model'],qs[_0x42f3('0x35')](_0x376cd6['query'][_0x42f3('0x35')]));_0x28e994[_0x42f3('0x36')]=_0x28e994[_0x42f3('0x36')][_0x42f3('0x47')]?_0x28e994['attributes']:_0x1dc84a[_0x42f3('0x34')];if(_0x376cd6[_0x42f3('0x30')][_0x42f3('0x40')]){_0x28e994[_0x42f3('0x41')]=[{'all':!![]}];}_0x28e994=_['merge']({},_0x28e994,_0x376cd6[_0x42f3('0x3f')]);return db[_0x42f3('0x2e')][_0x42f3('0x48')](_0x28e994)[_0x42f3('0x26')](handleEntityNotFound(_0x39f29e,null))['then'](respondWithResult(_0x39f29e,null))[_0x42f3('0x43')](handleError(_0x39f29e,null));};exports[_0x42f3('0x49')]=function(_0x1c5c55,_0x4a99b7){return db['CmCompany'][_0x42f3('0x49')](_0x1c5c55[_0x42f3('0x4a')],{})[_0x42f3('0x26')](function(_0x4d36ef){var _0x4f0fe5=_0x1c5c55['user'][_0x42f3('0x25')]({'plain':!![]});if(!_0x4f0fe5)throw new Error(_0x42f3('0x4b'));if(_0x4f0fe5[_0x42f3('0x4c')]==='user'){var _0x2aa0cc=_0x4d36ef['get']({'plain':!![]});var _0x51e406='Companies';return db[_0x42f3('0x4d')][_0x42f3('0x48')]({'where':{'name':_0x51e406,'userProfileId':_0x4f0fe5[_0x42f3('0x4e')]},'raw':!![]})[_0x42f3('0x26')](function(_0x2222b4){if(_0x2222b4&&_0x2222b4[_0x42f3('0x4f')]===0x0){return db[_0x42f3('0x50')][_0x42f3('0x49')]({'name':_0x2aa0cc[_0x42f3('0x2b')],'resourceId':_0x2aa0cc['id'],'type':_0x2222b4['name'],'sectionId':_0x2222b4['id']},{})[_0x42f3('0x26')](function(){return _0x4d36ef;});}else{return _0x4d36ef;}})[_0x42f3('0x43')](function(_0x56a39f){logger[_0x42f3('0x29')](_0x42f3('0x51'),_0x56a39f);throw _0x56a39f;});}return _0x4d36ef;})[_0x42f3('0x26')](respondWithResult(_0x4a99b7,0xc9))[_0x42f3('0x43')](handleError(_0x4a99b7,null));};exports[_0x42f3('0x52')]=function(_0x1bb288,_0x168ce4){if(_0x1bb288['body']['id']){delete _0x1bb288['body']['id'];}return db['CmCompany'][_0x42f3('0x48')]({'where':{'id':_0x1bb288['params']['id']}})[_0x42f3('0x26')](handleEntityNotFound(_0x168ce4,null))[_0x42f3('0x26')](saveUpdates(_0x1bb288['body'],null))['then'](respondWithResult(_0x168ce4,null))[_0x42f3('0x43')](handleError(_0x168ce4,null));};exports[_0x42f3('0x24')]=function(_0x257b6b,_0x54c9d3){return db[_0x42f3('0x2e')][_0x42f3('0x48')]({'where':{'id':_0x257b6b[_0x42f3('0x45')]['id']}})['then'](handleEntityNotFound(_0x54c9d3,null))[_0x42f3('0x26')](removeEntity(_0x54c9d3,null))[_0x42f3('0x43')](handleError(_0x54c9d3,null));};exports[_0x42f3('0x2f')]=function(_0x5ae7ea,_0x35f7be){return db[_0x42f3('0x2e')][_0x42f3('0x2f')]()['then'](respondWithResult(_0x35f7be,null))[_0x42f3('0x43')](handleError(_0x35f7be,null));};exports['addContacts']=function(_0x1f8f79,_0x45c2db,_0x7c42a1){return db[_0x42f3('0x53')][_0x42f3('0x48')]({'where':{'id':_0x1f8f79['params']['id']}})[_0x42f3('0x26')](handleEntityNotFound(_0x45c2db,null))[_0x42f3('0x26')](function(_0x101929){if(_0x101929){return _0x101929[_0x42f3('0x54')](_0x1f8f79['body'][_0x42f3('0x55')],_['omit'](_0x1f8f79['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x45c2db,null))['catch'](handleError(_0x45c2db,null));};exports[_0x42f3('0x56')]=function(_0x51e0ea,_0x22bff3,_0x3412e3){var _0x5447d0={};var _0x15d6e6={};var _0x559270;var _0x49a34a;return db[_0x42f3('0x2e')][_0x42f3('0x57')]({'where':{'id':_0x51e0ea[_0x42f3('0x45')]['id']}})[_0x42f3('0x26')](handleEntityNotFound(_0x22bff3,null))[_0x42f3('0x26')](function(_0xdb8fd1){if(_0xdb8fd1){_0x559270=_0xdb8fd1;_0x15d6e6['model']=_[_0x42f3('0x31')](db['CmContact'][_0x42f3('0x46')]);_0x15d6e6[_0x42f3('0x30')]=_['keys'](_0x51e0ea[_0x42f3('0x30')]);_0x15d6e6[_0x42f3('0x32')]=_['intersection'](_0x15d6e6[_0x42f3('0x34')],_0x15d6e6[_0x42f3('0x30')]);_0x5447d0[_0x42f3('0x36')]=_[_0x42f3('0x33')](_0x15d6e6['model'],qs[_0x42f3('0x35')](_0x51e0ea['query'][_0x42f3('0x35')]));_0x5447d0[_0x42f3('0x36')]=_0x5447d0[_0x42f3('0x36')][_0x42f3('0x47')]?_0x5447d0[_0x42f3('0x36')]:_0x15d6e6[_0x42f3('0x34')];_0x5447d0[_0x42f3('0x39')]=qs[_0x42f3('0x3a')](_0x51e0ea[_0x42f3('0x30')][_0x42f3('0x3a')]);_0x5447d0['where']=qs[_0x42f3('0x32')](_[_0x42f3('0x3c')](_0x51e0ea['query'],_0x15d6e6[_0x42f3('0x32')]));if(_0x51e0ea[_0x42f3('0x30')][_0x42f3('0x3d')]){_0x5447d0[_0x42f3('0x3b')]=_['merge'](_0x5447d0[_0x42f3('0x3b')],{'$or':_[_0x42f3('0x58')](_0x5447d0[_0x42f3('0x36')],function(_0x3de1ad){var _0x5c7a42={};_0x5c7a42[_0x3de1ad]={'$like':'%'+_0x51e0ea[_0x42f3('0x30')][_0x42f3('0x3d')]+'%'};return _0x5c7a42;})});}_0x5447d0=_[_0x42f3('0x3e')]({},_0x5447d0,_0x51e0ea[_0x42f3('0x3f')]);return _0x559270[_0x42f3('0x56')](_0x5447d0);}})['then'](function(_0x33867e){if(_0x33867e){_0x49a34a=_0x33867e[_0x42f3('0x47')];if(!_0x51e0ea[_0x42f3('0x30')][_0x42f3('0x37')]('nolimit')){_0x5447d0[_0x42f3('0x1e')]=qs[_0x42f3('0x1e')](_0x51e0ea[_0x42f3('0x30')][_0x42f3('0x1e')]);_0x5447d0['offset']=qs['offset'](_0x51e0ea['query'][_0x42f3('0x1c')]);}return _0x559270[_0x42f3('0x56')](_0x5447d0);}})[_0x42f3('0x26')](function(_0x59ea8a){if(_0x59ea8a){return _0x59ea8a?{'count':_0x49a34a,'rows':_0x59ea8a}:null;}})[_0x42f3('0x26')](respondWithResult(_0x22bff3,null))[_0x42f3('0x43')](handleError(_0x22bff3,null));}; \ No newline at end of file +var _0xddcb=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','CmCompany','describe','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','sort','where','filter','merge','map','options','includeAll','include','findAll','rows','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','catch','params','addContacts','ids','omit','getContacts','findOne','CmContact','pick','nolimit','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','papaparse','../../components/parsers/qs'];(function(_0x173978,_0x39bffb){var _0x1d35e1=function(_0x552648){while(--_0x552648){_0x173978['push'](_0x173978['shift']());}};_0x1d35e1(++_0x39bffb);}(_0xddcb,0x138));var _0xbddc=function(_0x2fbcd4,_0x11334e){_0x2fbcd4=_0x2fbcd4-0x0;var _0x54ac81=_0xddcb[_0x2fbcd4];return _0x54ac81;};'use strict';var emlformat=require(_0xbddc('0x0'));var rimraf=require(_0xbddc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbddc('0x2'));var rp=require(_0xbddc('0x3'));var moment=require('moment');var BPromise=require(_0xbddc('0x4'));var Mustache=require(_0xbddc('0x5'));var util=require(_0xbddc('0x6'));var path=require(_0xbddc('0x7'));var sox=require(_0xbddc('0x8'));var csv=require('to-csv');var ejs=require(_0xbddc('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('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbddc('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbddc('0xb'));var as=require(_0xbddc('0xc'));var hardwareService=require(_0xbddc('0xd'));var logger=require(_0xbddc('0xe'))(_0xbddc('0xf'));var utils=require(_0xbddc('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xbddc('0x11'));var db=require(_0xbddc('0x12'))['db'];function respondWithStatusCode(_0x3a4255,_0x5d7f34){_0x5d7f34=_0x5d7f34||0xcc;return function(_0x47c9d7){if(_0x47c9d7){return _0x3a4255[_0xbddc('0x13')](_0x5d7f34);}return _0x3a4255[_0xbddc('0x14')](_0x5d7f34)[_0xbddc('0x15')]();};}function respondWithResult(_0x3338f1,_0x131826){_0x131826=_0x131826||0xc8;return function(_0x14507e){if(_0x14507e){return _0x3338f1[_0xbddc('0x14')](_0x131826)[_0xbddc('0x16')](_0x14507e);}};}function respondWithFilteredResult(_0x469b51,_0x5e4f5e){return function(_0x546630){if(_0x546630){var _0x8fcb08=typeof _0x5e4f5e[_0xbddc('0x17')]===_0xbddc('0x18')&&typeof _0x5e4f5e[_0xbddc('0x19')]==='undefined';var _0x2d9fec=_0x546630[_0xbddc('0x1a')];var _0x59ff22=_0x8fcb08?0x0:_0x5e4f5e[_0xbddc('0x17')];var _0x38a088=_0x8fcb08?_0x546630[_0xbddc('0x1a')]:_0x5e4f5e['offset']+_0x5e4f5e[_0xbddc('0x19')];var _0x1cc01c;if(_0x38a088>=_0x2d9fec){_0x38a088=_0x2d9fec;_0x1cc01c=0xc8;}else{_0x1cc01c=0xce;}_0x469b51[_0xbddc('0x14')](_0x1cc01c);return _0x469b51[_0xbddc('0x1b')](_0xbddc('0x1c'),_0x59ff22+'-'+_0x38a088+'/'+_0x2d9fec)['json'](_0x546630);}return null;};}function patchUpdates(_0x2e18bd){return function(_0xbcf531){try{jsonpatch[_0xbddc('0x1d')](_0xbcf531,_0x2e18bd,!![]);}catch(_0x5b2b08){return BPromise[_0xbddc('0x1e')](_0x5b2b08);}return _0xbcf531[_0xbddc('0x1f')]();};}function saveUpdates(_0x2702e0,_0x35c6e3){return function(_0x2ed843){if(_0x2ed843){return _0x2ed843[_0xbddc('0x20')](_0x2702e0)[_0xbddc('0x21')](function(_0x2b8293){return _0x2b8293;});}return null;};}function removeEntity(_0x1d1dd2,_0x3ea8c5){return function(_0x49f0de){if(_0x49f0de){return _0x49f0de[_0xbddc('0x22')]()[_0xbddc('0x21')](function(){var _0x593408=_0x49f0de[_0xbddc('0x23')]({'plain':!![]});var _0x51b898=_0xbddc('0x24');return db[_0xbddc('0x25')]['destroy']({'where':{'type':_0x51b898,'resourceId':_0x593408['id']}})[_0xbddc('0x21')](function(){return _0x49f0de;});})[_0xbddc('0x21')](function(){_0x1d1dd2[_0xbddc('0x14')](0xcc)[_0xbddc('0x15')]();});}};}function handleEntityNotFound(_0x5c996a,_0x40ec80){return function(_0x22365e){if(!_0x22365e){_0x5c996a[_0xbddc('0x13')](0x194);}return _0x22365e;};}function handleError(_0x5252af,_0x724aa6){_0x724aa6=_0x724aa6||0x1f4;return function(_0x197446){logger[_0xbddc('0x26')](_0x197446[_0xbddc('0x27')]);if(_0x197446['name']){delete _0x197446[_0xbddc('0x28')];}_0x5252af['status'](_0x724aa6)[_0xbddc('0x29')](_0x197446);};}exports['index']=function(_0x159da1,_0x548fc0){var _0x2d6dcc={},_0x4ef6aa={},_0x2da56b={'count':0x0,'rows':[]};return db[_0xbddc('0x2a')][_0xbddc('0x2b')]()['then'](function(_0x239e50){_0x4ef6aa[_0xbddc('0x2c')]=_['keys'](_0x239e50);_0x4ef6aa['query']=_[_0xbddc('0x2d')](_0x159da1['query']);_0x4ef6aa[_0xbddc('0x2e')]=_[_0xbddc('0x2f')](_0x4ef6aa[_0xbddc('0x2c')],_0x4ef6aa['query']);_0x2d6dcc['attributes']=_[_0xbddc('0x2f')](_0x4ef6aa[_0xbddc('0x2c')],qs[_0xbddc('0x30')](_0x159da1[_0xbddc('0x31')][_0xbddc('0x30')]));_0x2d6dcc[_0xbddc('0x32')]=_0x2d6dcc[_0xbddc('0x32')][_0xbddc('0x33')]?_0x2d6dcc[_0xbddc('0x32')]:_0x4ef6aa[_0xbddc('0x2c')];if(!_0x159da1[_0xbddc('0x31')][_0xbddc('0x34')]('nolimit')){_0x2d6dcc[_0xbddc('0x19')]=qs[_0xbddc('0x19')](_0x159da1['query'][_0xbddc('0x19')]);_0x2d6dcc['offset']=qs[_0xbddc('0x17')](_0x159da1[_0xbddc('0x31')]['offset']);}_0x2d6dcc['order']=qs[_0xbddc('0x35')](_0x159da1[_0xbddc('0x31')][_0xbddc('0x35')]);_0x2d6dcc[_0xbddc('0x36')]=qs[_0xbddc('0x2e')](_['pick'](_0x159da1[_0xbddc('0x31')],_0x4ef6aa[_0xbddc('0x2e')]),_0x239e50);if(_0x159da1[_0xbddc('0x31')][_0xbddc('0x37')]){_0x2d6dcc[_0xbddc('0x36')]=_[_0xbddc('0x38')](_0x2d6dcc[_0xbddc('0x36')],{'$or':_[_0xbddc('0x39')](_0x2d6dcc[_0xbddc('0x32')],function(_0x33dbca){var _0x24861c={};_0x24861c[_0x33dbca]={'$like':'%'+_0x159da1[_0xbddc('0x31')][_0xbddc('0x37')]+'%'};return _0x24861c;})});}_0x2d6dcc=_[_0xbddc('0x38')]({},_0x2d6dcc,_0x159da1[_0xbddc('0x3a')]);var _0x7683df={'where':_0x2d6dcc['where']};return db[_0xbddc('0x2a')][_0xbddc('0x1a')](_0x7683df)[_0xbddc('0x21')](function(_0x11d6ff){_0x2da56b[_0xbddc('0x1a')]=_0x11d6ff;if(_0x159da1['query'][_0xbddc('0x3b')]){_0x2d6dcc[_0xbddc('0x3c')]=[{'all':!![]}];}return db[_0xbddc('0x2a')][_0xbddc('0x3d')](_0x2d6dcc);})['then'](function(_0xe5388e){_0x2da56b[_0xbddc('0x3e')]=_0xe5388e;return _0x2da56b;})[_0xbddc('0x21')](respondWithFilteredResult(_0x548fc0,_0x2d6dcc))['catch'](handleError(_0x548fc0,null));})['catch'](handleError(_0x548fc0,null));};exports[_0xbddc('0x3f')]=function(_0x3b2354,_0x37daee){var _0x5be62d={'raw':![],'where':{'id':_0x3b2354['params']['id']}},_0x2f81f3={};_0x2f81f3[_0xbddc('0x2c')]=_['keys'](db[_0xbddc('0x2a')]['rawAttributes']);_0x2f81f3[_0xbddc('0x31')]=_['keys'](_0x3b2354[_0xbddc('0x31')]);_0x2f81f3['filters']=_[_0xbddc('0x2f')](_0x2f81f3['model'],_0x2f81f3[_0xbddc('0x31')]);_0x5be62d[_0xbddc('0x32')]=_['intersection'](_0x2f81f3[_0xbddc('0x2c')],qs[_0xbddc('0x30')](_0x3b2354[_0xbddc('0x31')][_0xbddc('0x30')]));_0x5be62d[_0xbddc('0x32')]=_0x5be62d[_0xbddc('0x32')]['length']?_0x5be62d[_0xbddc('0x32')]:_0x2f81f3[_0xbddc('0x2c')];if(_0x3b2354[_0xbddc('0x31')][_0xbddc('0x3b')]){_0x5be62d[_0xbddc('0x3c')]=[{'all':!![]}];}_0x5be62d=_['merge']({},_0x5be62d,_0x3b2354[_0xbddc('0x3a')]);return db[_0xbddc('0x2a')]['find'](_0x5be62d)[_0xbddc('0x21')](handleEntityNotFound(_0x37daee,null))[_0xbddc('0x21')](respondWithResult(_0x37daee,null))['catch'](handleError(_0x37daee,null));};exports[_0xbddc('0x40')]=function(_0x2d51cb,_0xa73ad){return db[_0xbddc('0x2a')][_0xbddc('0x40')](_0x2d51cb[_0xbddc('0x41')],{})['then'](function(_0x38fe7d){var _0x3d027d=_0x2d51cb[_0xbddc('0x42')][_0xbddc('0x23')]({'plain':!![]});if(!_0x3d027d)throw new Error(_0xbddc('0x43'));if(_0x3d027d['role']===_0xbddc('0x42')){var _0xe66ead=_0x38fe7d[_0xbddc('0x23')]({'plain':!![]});var _0x69b430=_0xbddc('0x24');return db['UserProfileSection'][_0xbddc('0x44')]({'where':{'name':_0x69b430,'userProfileId':_0x3d027d[_0xbddc('0x45')]},'raw':!![]})[_0xbddc('0x21')](function(_0x59ec0d){if(_0x59ec0d&&_0x59ec0d[_0xbddc('0x46')]===0x0){return db[_0xbddc('0x25')][_0xbddc('0x40')]({'name':_0xe66ead[_0xbddc('0x28')],'resourceId':_0xe66ead['id'],'type':_0x59ec0d['name'],'sectionId':_0x59ec0d['id']},{})[_0xbddc('0x21')](function(){return _0x38fe7d;});}else{return _0x38fe7d;}})[_0xbddc('0x47')](function(_0x3b5e66){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b5e66);throw _0x3b5e66;});}return _0x38fe7d;})[_0xbddc('0x21')](respondWithResult(_0xa73ad,0xc9))[_0xbddc('0x47')](handleError(_0xa73ad,null));};exports[_0xbddc('0x20')]=function(_0x51b1f5,_0xa40a9b){if(_0x51b1f5[_0xbddc('0x41')]['id']){delete _0x51b1f5['body']['id'];}return db[_0xbddc('0x2a')][_0xbddc('0x44')]({'where':{'id':_0x51b1f5[_0xbddc('0x48')]['id']}})[_0xbddc('0x21')](handleEntityNotFound(_0xa40a9b,null))['then'](saveUpdates(_0x51b1f5['body'],null))[_0xbddc('0x21')](respondWithResult(_0xa40a9b,null))[_0xbddc('0x47')](handleError(_0xa40a9b,null));};exports[_0xbddc('0x22')]=function(_0xb7ed3f,_0x4e5ad4){return db[_0xbddc('0x2a')][_0xbddc('0x44')]({'where':{'id':_0xb7ed3f['params']['id']}})[_0xbddc('0x21')](handleEntityNotFound(_0x4e5ad4,null))[_0xbddc('0x21')](removeEntity(_0x4e5ad4,null))[_0xbddc('0x47')](handleError(_0x4e5ad4,null));};exports[_0xbddc('0x2b')]=function(_0x24efbd,_0xd7e0b4){return db[_0xbddc('0x2a')][_0xbddc('0x2b')]()[_0xbddc('0x21')](respondWithResult(_0xd7e0b4,null))[_0xbddc('0x47')](handleError(_0xd7e0b4,null));};exports[_0xbddc('0x49')]=function(_0x5ae3d6,_0x492e69,_0x1da3e7){return db['CmContact']['find']({'where':{'id':_0x5ae3d6[_0xbddc('0x48')]['id']}})[_0xbddc('0x21')](handleEntityNotFound(_0x492e69,null))[_0xbddc('0x21')](function(_0x493ab0){if(_0x493ab0){return _0x493ab0[_0xbddc('0x49')](_0x5ae3d6[_0xbddc('0x41')][_0xbddc('0x4a')],_[_0xbddc('0x4b')](_0x5ae3d6[_0xbddc('0x41')],[_0xbddc('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x492e69,null))[_0xbddc('0x47')](handleError(_0x492e69,null));};exports[_0xbddc('0x4c')]=function(_0x29da64,_0x582e34,_0x540b6e){var _0x114879={};var _0x2942ad={};var _0x20f701;var _0x3aa33e;return db[_0xbddc('0x2a')][_0xbddc('0x4d')]({'where':{'id':_0x29da64['params']['id']}})[_0xbddc('0x21')](handleEntityNotFound(_0x582e34,null))[_0xbddc('0x21')](function(_0x2a71f0){if(_0x2a71f0){_0x20f701=_0x2a71f0;_0x2942ad[_0xbddc('0x2c')]=_[_0xbddc('0x2d')](db[_0xbddc('0x4e')]['rawAttributes']);_0x2942ad[_0xbddc('0x31')]=_['keys'](_0x29da64[_0xbddc('0x31')]);_0x2942ad[_0xbddc('0x2e')]=_['intersection'](_0x2942ad[_0xbddc('0x2c')],_0x2942ad['query']);_0x114879[_0xbddc('0x32')]=_[_0xbddc('0x2f')](_0x2942ad[_0xbddc('0x2c')],qs[_0xbddc('0x30')](_0x29da64[_0xbddc('0x31')][_0xbddc('0x30')]));_0x114879[_0xbddc('0x32')]=_0x114879[_0xbddc('0x32')]['length']?_0x114879[_0xbddc('0x32')]:_0x2942ad['model'];_0x114879['order']=qs['sort'](_0x29da64[_0xbddc('0x31')][_0xbddc('0x35')]);_0x114879[_0xbddc('0x36')]=qs[_0xbddc('0x2e')](_[_0xbddc('0x4f')](_0x29da64[_0xbddc('0x31')],_0x2942ad[_0xbddc('0x2e')]));if(_0x29da64['query'][_0xbddc('0x37')]){_0x114879['where']=_[_0xbddc('0x38')](_0x114879[_0xbddc('0x36')],{'$or':_[_0xbddc('0x39')](_0x114879[_0xbddc('0x32')],function(_0x539981){var _0x5d8920={};_0x5d8920[_0x539981]={'$like':'%'+_0x29da64[_0xbddc('0x31')]['filter']+'%'};return _0x5d8920;})});}_0x114879=_[_0xbddc('0x38')]({},_0x114879,_0x29da64['options']);return _0x20f701[_0xbddc('0x4c')](_0x114879);}})['then'](function(_0x51a1af){if(_0x51a1af){_0x3aa33e=_0x51a1af[_0xbddc('0x33')];if(!_0x29da64[_0xbddc('0x31')][_0xbddc('0x34')](_0xbddc('0x50'))){_0x114879['limit']=qs[_0xbddc('0x19')](_0x29da64[_0xbddc('0x31')][_0xbddc('0x19')]);_0x114879['offset']=qs['offset'](_0x29da64['query'][_0xbddc('0x17')]);}return _0x20f701[_0xbddc('0x4c')](_0x114879);}})[_0xbddc('0x21')](function(_0x126807){if(_0x126807){return _0x126807?{'count':_0x3aa33e,'rows':_0x126807}:null;}})[_0xbddc('0x21')](respondWithResult(_0x582e34,null))[_0xbddc('0x47')](handleError(_0x582e34,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 8115ca7..131b6ba 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 _0x1f6a=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','CmCompany','lodash'];(function(_0x387213,_0x2bc468){var _0x2b7616=function(_0x3b8880){while(--_0x3b8880){_0x387213['push'](_0x387213['shift']());}};_0x2b7616(++_0x2bc468);}(_0x1f6a,0x1ee));var _0xa1f6=function(_0x47c89e,_0x18692c){_0x47c89e=_0x47c89e-0x0;var _0x1de51e=_0x1f6a[_0x47c89e];return _0x1de51e;};'use strict';var _=require(_0xa1f6('0x0'));var util=require(_0xa1f6('0x1'));var logger=require(_0xa1f6('0x2'))(_0xa1f6('0x3'));var moment=require('moment');var BPromise=require(_0xa1f6('0x4'));var rp=require(_0xa1f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1f6('0x6'));var config=require(_0xa1f6('0x7'));var attributes=require('./cmCompany.attributes');module[_0xa1f6('0x8')]=function(_0x9ca98d,_0x3ea2bd){return _0x9ca98d[_0xa1f6('0x9')](_0xa1f6('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d77=['moment','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','util','../../config/logger','api'];(function(_0x483c43,_0x205dd2){var _0x22b502=function(_0x1fea8b){while(--_0x1fea8b){_0x483c43['push'](_0x483c43['shift']());}};_0x22b502(++_0x205dd2);}(_0x1d77,0x147));var _0x71d7=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0x1d77[_0x37ae26];return _0x1b1902;};'use strict';var _=require('lodash');var util=require(_0x71d7('0x0'));var logger=require(_0x71d7('0x1'))(_0x71d7('0x2'));var moment=require(_0x71d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x71d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71d7('0x5'));var config=require(_0x71d7('0x6'));var attributes=require(_0x71d7('0x7'));module[_0x71d7('0x8')]=function(_0xefc1d9,_0x1176b5){return _0xefc1d9['define'](_0x71d7('0x9'),attributes,{'tableName':_0x71d7('0xa'),'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 785c235..4a95cb2 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 _0x22d8=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result'];(function(_0x45ad56,_0x4472f0){var _0x5f2f45=function(_0x8dfdda){while(--_0x8dfdda){_0x45ad56['push'](_0x45ad56['shift']());}};_0x5f2f45(++_0x4472f0);}(_0x22d8,0x91));var _0x822d=function(_0x1e4d45,_0x1f9e37){_0x1e4d45=_0x1e4d45-0x0;var _0x130016=_0x22d8[_0x1e4d45];return _0x130016;};'use strict';var _=require(_0x822d('0x0'));var util=require(_0x822d('0x1'));var moment=require('moment');var BPromise=require(_0x822d('0x2'));var rs=require(_0x822d('0x3'));var fs=require('fs');var Redis=require(_0x822d('0x4'));var db=require(_0x822d('0x5'))['db'];var utils=require(_0x822d('0x6'));var logger=require(_0x822d('0x7'))(_0x822d('0x8'));var config=require(_0x822d('0x9'));var jayson=require(_0x822d('0xa'));var client=jayson[_0x822d('0xb')][_0x822d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40a82c,_0x5b0f3a,_0x5a1fae){return new BPromise(function(_0x26d196,_0xcb2b75){return client['request'](_0x40a82c,_0x5a1fae)[_0x822d('0xd')](function(_0xa2c4dc){logger[_0x822d('0xe')]('CmCompany,\x20%s,\x20%s',_0x5b0f3a,'request\x20sent');logger['debug'](_0x822d('0xf'),_0x5b0f3a,_0x822d('0x10'),JSON[_0x822d('0x11')](_0xa2c4dc));if(_0xa2c4dc['error']){if(_0xa2c4dc[_0x822d('0x12')][_0x822d('0x13')]===0x1f4){logger[_0x822d('0x12')](_0x822d('0x14'),_0x5b0f3a,_0xa2c4dc[_0x822d('0x12')][_0x822d('0x15')]);return _0xcb2b75(_0xa2c4dc[_0x822d('0x12')]['message']);}logger[_0x822d('0x12')](_0x822d('0x14'),_0x5b0f3a,_0xa2c4dc['error'][_0x822d('0x15')]);return _0x26d196(_0xa2c4dc[_0x822d('0x12')][_0x822d('0x15')]);}else{logger['info'](_0x822d('0x14'),_0x5b0f3a,_0x822d('0x10'));_0x26d196(_0xa2c4dc[_0x822d('0x16')][_0x822d('0x15')]);}})[_0x822d('0x17')](function(_0x244467){logger[_0x822d('0x12')]('CmCompany,\x20%s,\x20%s',_0x5b0f3a,_0x244467);_0xcb2b75(_0x244467);});});} \ No newline at end of file +var _0xa6ac=['debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmCompany,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info'];(function(_0x365045,_0x3de6c4){var _0x1028cb=function(_0x4428fa){while(--_0x4428fa){_0x365045['push'](_0x365045['shift']());}};_0x1028cb(++_0x3de6c4);}(_0xa6ac,0x1eb));var _0xca6a=function(_0x3232ea,_0x46753a){_0x3232ea=_0x3232ea-0x0;var _0x1851eb=_0xa6ac[_0x3232ea];return _0x1851eb;};'use strict';var _=require(_0xca6a('0x0'));var util=require(_0xca6a('0x1'));var moment=require(_0xca6a('0x2'));var BPromise=require('bluebird');var rs=require(_0xca6a('0x3'));var fs=require('fs');var Redis=require(_0xca6a('0x4'));var db=require(_0xca6a('0x5'))['db'];var utils=require(_0xca6a('0x6'));var logger=require(_0xca6a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xca6a('0x8'));var client=jayson['client'][_0xca6a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32383b,_0x161a2f,_0x18debc){return new BPromise(function(_0x3afd7d,_0x5af947){return client[_0xca6a('0xa')](_0x32383b,_0x18debc)[_0xca6a('0xb')](function(_0x14abd7){logger[_0xca6a('0xc')]('CmCompany,\x20%s,\x20%s',_0x161a2f,'request\x20sent');logger[_0xca6a('0xd')](_0xca6a('0xe'),_0x161a2f,_0xca6a('0xf'),JSON[_0xca6a('0x10')](_0x14abd7));if(_0x14abd7[_0xca6a('0x11')]){if(_0x14abd7[_0xca6a('0x11')]['code']===0x1f4){logger['error'](_0xca6a('0x12'),_0x161a2f,_0x14abd7[_0xca6a('0x11')][_0xca6a('0x13')]);return _0x5af947(_0x14abd7[_0xca6a('0x11')][_0xca6a('0x13')]);}logger[_0xca6a('0x11')](_0xca6a('0x12'),_0x161a2f,_0x14abd7[_0xca6a('0x11')][_0xca6a('0x13')]);return _0x3afd7d(_0x14abd7['error'][_0xca6a('0x13')]);}else{logger[_0xca6a('0xc')]('CmCompany,\x20%s,\x20%s',_0x161a2f,_0xca6a('0xf'));_0x3afd7d(_0x14abd7['result'][_0xca6a('0x13')]);}})[_0xca6a('0x14')](function(_0xdb5801){logger['error']('CmCompany,\x20%s,\x20%s',_0x161a2f,_0xdb5801);_0x5af947(_0xdb5801);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index f949ab0..fed2e3e 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 _0x19ba=['multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','create','update','destroy','exports'];(function(_0x4e4198,_0x14bf80){var _0x118dc4=function(_0x541604){while(--_0x541604){_0x4e4198['push'](_0x4e4198['shift']());}};_0x118dc4(++_0x14bf80);}(_0x19ba,0x150));var _0xa19b=function(_0x3b8ed6,_0x3b5bb6){_0x3b8ed6=_0x3b8ed6-0x0;var _0x2e6223=_0x19ba[_0x3b8ed6];return _0x2e6223;};'use strict';var multer=require(_0xa19b('0x0'));var util=require(_0xa19b('0x1'));var path=require(_0xa19b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa19b('0x3')]();var fs_extra=require(_0xa19b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa19b('0x5'));var config=require(_0xa19b('0x6'));var controller=require(_0xa19b('0x7'));router[_0xa19b('0x8')]('/',auth[_0xa19b('0x9')](),controller[_0xa19b('0xa')]);router[_0xa19b('0x8')](_0xa19b('0xb'),auth[_0xa19b('0x9')](),controller['describe']);router[_0xa19b('0x8')](_0xa19b('0xc'),auth[_0xa19b('0x9')](),controller[_0xa19b('0xd')]);router[_0xa19b('0x8')](_0xa19b('0xe'),auth['isAuthenticated'](),controller[_0xa19b('0xf')]);router[_0xa19b('0x10')]('/',auth[_0xa19b('0x9')](),controller[_0xa19b('0x11')]);router[_0xa19b('0x10')]('/:id/contacts',auth[_0xa19b('0x9')](),controller['addContacts']);router['put'](_0xa19b('0xc'),auth[_0xa19b('0x9')](),controller[_0xa19b('0x12')]);router['delete'](_0xa19b('0xc'),auth['isAuthenticated'](),controller[_0xa19b('0x13')]);module[_0xa19b('0x14')]=router; \ No newline at end of file +var _0xb547=['show','/:id/contacts','getContacts','post','create','/:id','delete','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x9eaec5,_0x2e8c12){var _0x4b3002=function(_0x19e92b){while(--_0x19e92b){_0x9eaec5['push'](_0x9eaec5['shift']());}};_0x4b3002(++_0x2e8c12);}(_0xb547,0x74));var _0x7b54=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0xb547[_0x4169d8];return _0x32084a;};'use strict';var multer=require('multer');var util=require(_0x7b54('0x0'));var path=require(_0x7b54('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b54('0x2'));var router=express[_0x7b54('0x3')]();var fs_extra=require(_0x7b54('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7b54('0x5'));var config=require(_0x7b54('0x6'));var controller=require('./cmCompany.controller');router[_0x7b54('0x7')]('/',auth[_0x7b54('0x8')](),controller[_0x7b54('0x9')]);router['get']('/describe',auth[_0x7b54('0x8')](),controller['describe']);router[_0x7b54('0x7')]('/:id',auth[_0x7b54('0x8')](),controller[_0x7b54('0xa')]);router['get'](_0x7b54('0xb'),auth[_0x7b54('0x8')](),controller[_0x7b54('0xc')]);router[_0x7b54('0xd')]('/',auth[_0x7b54('0x8')](),controller[_0x7b54('0xe')]);router[_0x7b54('0xd')]('/:id/contacts',auth[_0x7b54('0x8')](),controller['addContacts']);router['put'](_0x7b54('0xf'),auth[_0x7b54('0x8')](),controller['update']);router[_0x7b54('0x10')]('/:id',auth[_0x7b54('0x8')](),controller['destroy']);module[_0x7b54('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 6a7dcfb..afbc49c 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 _0x722d=['lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x346248,_0x37e2b7){var _0x131fc3=function(_0x3bd063){while(--_0x3bd063){_0x346248['push'](_0x346248['shift']());}};_0x131fc3(++_0x37e2b7);}(_0x722d,0xe8));var _0xd722=function(_0x283fe6,_0x12604c){_0x283fe6=_0x283fe6-0x0;var _0xd8998=_0x722d[_0x283fe6];return _0xd8998;};'use strict';var _=require(_0xd722('0x0'));var Sequelize=require('sequelize');module[_0xd722('0x1')]={'firstName':{'type':Sequelize[_0xd722('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xd722('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd722('0x2')]},'city':{'type':Sequelize[_0xd722('0x2')]},'country':{'type':Sequelize[_0xd722('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd722('0x3')]},'phone':{'type':Sequelize[_0xd722('0x2')]},'mobile':{'type':Sequelize[_0xd722('0x2')]},'fax':{'type':Sequelize[_0xd722('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xd722('0x2')]},'fb_data':{'type':Sequelize[_0xd722('0x2')]},'twitter':{'type':Sequelize[_0xd722('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xd722('0x2')]},'viber':{'type':Sequelize[_0xd722('0x2')]},'line':{'type':Sequelize[_0xd722('0x2')]},'wechat':{'type':Sequelize[_0xd722('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xd722('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xd722('0x2')]},'priority':{'type':Sequelize[_0xd722('0x4')](0x2)[_0xd722('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xd722('0x6')],'defaultValue':Sequelize[_0xd722('0x7')]},'dialTimezone':{'type':Sequelize[_0xd722('0x2')]},'utcOffset':{'type':Sequelize[_0xd722('0x4')]}}; \ No newline at end of file +var _0x1ea1=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x53d0db,_0x2accaf){var _0x128b2a=function(_0x238c16){while(--_0x238c16){_0x53d0db['push'](_0x53d0db['shift']());}};_0x128b2a(++_0x2accaf);}(_0x1ea1,0x12e));var _0x11ea=function(_0x1221e8,_0x2e7229){_0x1221e8=_0x1221e8-0x0;var _0x3f3041=_0x1ea1[_0x1221e8];return _0x3f3041;};'use strict';var _=require(_0x11ea('0x0'));var Sequelize=require(_0x11ea('0x1'));module[_0x11ea('0x2')]={'firstName':{'type':Sequelize[_0x11ea('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x11ea('0x3')]},'street':{'type':Sequelize[_0x11ea('0x3')]},'postalCode':{'type':Sequelize[_0x11ea('0x3')]},'city':{'type':Sequelize[_0x11ea('0x3')]},'country':{'type':Sequelize[_0x11ea('0x3')]},'dateOfBirth':{'type':Sequelize[_0x11ea('0x3')]},'description':{'type':Sequelize[_0x11ea('0x4')]},'phone':{'type':Sequelize[_0x11ea('0x3')]},'mobile':{'type':Sequelize[_0x11ea('0x3')]},'fax':{'type':Sequelize[_0x11ea('0x3')]},'email':{'type':Sequelize[_0x11ea('0x3')]},'url':{'type':Sequelize[_0x11ea('0x3')]},'facebook':{'type':Sequelize[_0x11ea('0x3')]},'fb_data':{'type':Sequelize[_0x11ea('0x3')]},'twitter':{'type':Sequelize[_0x11ea('0x3')]},'skype':{'type':Sequelize[_0x11ea('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x11ea('0x3')]},'wechat':{'type':Sequelize[_0x11ea('0x3')]},'telegram':{'type':Sequelize[_0x11ea('0x3')]},'UserId':{'type':Sequelize[_0x11ea('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x11ea('0x3')]},'priority':{'type':Sequelize[_0x11ea('0x5')](0x2)[_0x11ea('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x11ea('0x7')],'defaultValue':Sequelize[_0x11ea('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x11ea('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index e08c1aa..a4ace8d 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(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 e44f65d..615adff 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 _0xb340=['emit','hasOwnProperty','exports','events','CmContact','save','update'];(function(_0x50c6b2,_0xa9890e){var _0x47e4bc=function(_0x12bf46){while(--_0x12bf46){_0x50c6b2['push'](_0x50c6b2['shift']());}};_0x47e4bc(++_0xa9890e);}(_0xb340,0x9d));var _0x0b34=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xb340[_0x30ae5e];return _0x1f2e93;};'use strict';var EventEmitter=require(_0x0b34('0x0'));var CmContact=require('../../mysqldb')['db'][_0x0b34('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0b34('0x2'),'afterUpdate':_0x0b34('0x3'),'afterDestroy':'remove'};function emitEvent(_0x307cf6){return function(_0x28a9c7,_0x1e558e,_0x93ec44){CmContactEvents[_0x0b34('0x4')](_0x307cf6+':'+_0x28a9c7['id'],_0x28a9c7);CmContactEvents['emit'](_0x307cf6,_0x28a9c7);_0x93ec44(null);};}for(var e in events){if(events[_0x0b34('0x5')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x0b34('0x6')]=CmContactEvents; \ No newline at end of file +var _0xbbe0=['remove','emit','hook','events','../../mysqldb','CmContact','setMaxListeners','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbbe0,0x108));var _0x0bbe=function(_0x2cb81f,_0x512c26){_0x2cb81f=_0x2cb81f-0x0;var _0x2d00fd=_0xbbe0[_0x2cb81f];return _0x2d00fd;};'use strict';var EventEmitter=require(_0x0bbe('0x0'));var CmContact=require(_0x0bbe('0x1'))['db'][_0x0bbe('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x0bbe('0x3')](0x0);var events={'afterCreate':_0x0bbe('0x4'),'afterUpdate':_0x0bbe('0x5'),'afterDestroy':_0x0bbe('0x6')};function emitEvent(_0x37b10a){return function(_0x314dab,_0x1d4868,_0x55d2c6){CmContactEvents[_0x0bbe('0x7')](_0x37b10a+':'+_0x314dab['id'],_0x314dab);CmContactEvents[_0x0bbe('0x7')](_0x37b10a,_0x314dab);_0x55d2c6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x0bbe('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 396b2b2..ee991c3 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 _0x7775=['rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','fax','email','utf8mb4','utf8mb4_unicode_ci','get','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','utcOffset','minutes','ret','CmHopper','findOne','then','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','priority','callbackUniqueid','CmHopperFinal','ListId','catch','error','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','length','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','Lists','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','[CmContact][afterDestroy][Succesfull]','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1e79f0,_0x34de60){var _0x1cfb2d=function(_0xe9d1f0){while(--_0xe9d1f0){_0x1e79f0['push'](_0x1e79f0['shift']());}};_0x1cfb2d(++_0x34de60);}(_0x7775,0x116));var _0x5777=function(_0x39daf4,_0x56430b){_0x39daf4=_0x39daf4-0x0;var _0x147206=_0x7775[_0x39daf4];return _0x147206;};'use strict';var _=require('lodash');var util=require(_0x5777('0x0'));var logger=require(_0x5777('0x1'))('api');var moment=require(_0x5777('0x2'));var BPromise=require(_0x5777('0x3'));var rp=require(_0x5777('0x4'));var fs=require('fs');var path=require(_0x5777('0x5'));var rimraf=require(_0x5777('0x6'));var config=require(_0x5777('0x7'));var shared=require('../../config/environment/shared');var attributes=require(_0x5777('0x8'));module[_0x5777('0x9')]=function(_0xe9af3a,_0x16da85){return _0xe9af3a[_0x5777('0xa')](_0x5777('0xb'),attributes,{'tableName':_0x5777('0xc'),'paranoid':!![],'indexes':[{'name':_0x5777('0xd'),'fields':[_0x5777('0xd')]},{'name':'fti_cm_contacts','fields':[_0x5777('0xe'),_0x5777('0xf'),'phone','mobile',_0x5777('0x10'),_0x5777('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x5777('0x12'),'collate':_0x5777('0x13'),'hooks':{'afterCreate':function(_0x357909,_0x4059ba,_0x28a35e){var _0x334d24=_0xe9af3a['models'];var _0x1da249=_0x357909[_0x5777('0x14')]({'plain':!![]});function _0x27df40(){return function(_0x1c92c2){logger['error'](_0x5777('0x15'),_0x5777('0x16'),util[_0x5777('0x17')](_0x1c92c2,{'showHidden':![],'depth':null}));};}function _0x1c5b48(_0x1e0f16,_0x6ff73d){var _0x27badf=_0x6ff73d['scheduledat']?_0x6ff73d[_0x5777('0x18')]:moment()[_0x5777('0x19')](_0x5777('0x1a'));return new BPromise(function(_0x24e8de,_0x5d228e){if(_[_0x5777('0x1b')](_0x6ff73d[_0x5777('0x1c')])){_0x24e8de({'ret':_0x27badf});}else{_0x334d24[_0x5777('0x1d')]['findOne']({'where':{'id':_0x1e0f16['id']}})['then'](function(_0x52586b){if(!_[_0x5777('0x1b')](_0x52586b)){var _0x15bb04=_0x52586b[_0x5777('0x1c')];if(!_[_0x5777('0x1b')](_0x15bb04)){var _0x29d979=shared['timezones'];var _0x3acf55=_0x29d979[_0x15bb04];var _0x1298c7=_0x29d979[_0x6ff73d[_0x5777('0x1c')]];if(!_['isNil'](_0x3acf55)&&!_['isNil'](_0x1298c7)){var _0x472b1f=_0x3acf55[_0x5777('0x1e')]-_0x1298c7[_0x5777('0x1e')];_0x27badf=_0x6ff73d[_0x5777('0x18')]?_0x6ff73d[_0x5777('0x18')]:moment();var _0x1b4868=moment(_0x27badf)['add'](_0x472b1f,_0x5777('0x1f'));_0x24e8de({'ret':_0x1b4868[_0x5777('0x19')](_0x5777('0x1a'))});}else _0x24e8de({'ret':_0x27badf});}else _0x24e8de({'ret':_0x27badf});}else{_0x24e8de({'ret':_0x27badf});}});}});return 0xa;}var _0x28588e=function(_0x550bd3){return new BPromise(function(_0x477e68,_0x57760e){_0x1c5b48(_0x550bd3,_0x1da249)['then'](function(_0x411588){_0x1da249[_0x5777('0x18')]=_0x411588[_0x5777('0x20')];_0x334d24[_0x5777('0x21')][_0x5777('0x22')]({'where':{'phone':_0x1da249['phone'],'VoiceQueueId':_0x550bd3['id']}})[_0x5777('0x23')](function(_0x544222){if(!_[_0x5777('0x1b')](_0x544222)){throw new Error(_0x5777('0x24')+_0x1da249['phone']+_0x5777('0x25')+_0x550bd3['id']);}return _0x334d24[_0x5777('0x21')][_0x5777('0x26')]({'phone':_0x1da249[_0x5777('0xd')],'ContactId':_0x1da249['id'],'ListId':_0x1da249['ListId'],'priority':_0x1da249[_0x5777('0x27')]?_0x1da249[_0x5777('0x27')]:0x2,'scheduledat':_0x1da249[_0x5777('0x18')]?_0x1da249[_0x5777('0x18')]:moment()[_0x5777('0x19')](_0x5777('0x1a')),'callback':_0x1da249[_0x5777('0x28')]?!![]:![],'callbackuniqueid':_0x1da249[_0x5777('0x28')]?_0x1da249[_0x5777('0x28')]:undefined,'callbackat':_0x1da249['callbackUniqueid']?moment()[_0x5777('0x19')](_0x5777('0x1a')):undefined,'VoiceQueueId':_0x550bd3['id']});})['catch'](function(_0x3eaafb){_0x57760e(_0x3eaafb);});});});};var _0x5d3bba=function(_0x407cdd){return new BPromise(function(_0x335c5a,_0x295699){_0x1c5b48(_0x407cdd,_0x1da249)[_0x5777('0x23')](function(_0x42f898){_0x1da249[_0x5777('0x18')]=_0x42f898[_0x5777('0x20')];_0x334d24['CmHopper'][_0x5777('0x22')]({'where':{'phone':_0x1da249['phone'],'VoiceQueueId':_0x407cdd['id']}})['then'](function(_0x3c8043){if(!_[_0x5777('0x1b')](_0x3c8043)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1da249[_0x5777('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x407cdd['id']);}return _0x334d24[_0x5777('0x29')][_0x5777('0x22')]({'where':{'calleridnum':_0x1da249[_0x5777('0xd')],'VoiceQueueId':_0x407cdd['id']}});})[_0x5777('0x23')](function(_0x2655d4){if(!_[_0x5777('0x1b')](_0x2655d4)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1da249[_0x5777('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x407cdd['id']);}return _0x334d24[_0x5777('0x21')][_0x5777('0x26')]({'phone':_0x1da249[_0x5777('0xd')],'ContactId':_0x1da249['id'],'ListId':_0x1da249[_0x5777('0x2a')],'priority':_0x1da249[_0x5777('0x27')]?_0x1da249['priority']:0x2,'scheduledat':_0x1da249[_0x5777('0x18')]?_0x1da249[_0x5777('0x18')]:moment()['format'](_0x5777('0x1a')),'callback':_0x1da249[_0x5777('0x28')]?!![]:![],'callbackuniqueid':_0x1da249[_0x5777('0x28')]?_0x1da249[_0x5777('0x28')]:undefined,'callbackat':_0x1da249[_0x5777('0x28')]?moment()[_0x5777('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x407cdd['id']});})[_0x5777('0x2b')](function(_0x3dc488){_0x295699(_0x3dc488);});});});};function _0x173425(){return function(_0x1af5e3){logger[_0x5777('0x2c')](_0x5777('0x15'),'afterCreate',util[_0x5777('0x17')](_0x1af5e3,{'showHidden':![],'depth':null}));};}function _0x252bd4(_0x3e1563,_0xb340e2){var _0x13cf56=_0xb340e2[_0x5777('0x18')]?_0xb340e2['scheduledat']:moment()[_0x5777('0x19')](_0x5777('0x1a'));return new BPromise(function(_0x29e17d,_0x2c97f9){if(_[_0x5777('0x1b')](_0xb340e2['dialTimezone'])){_0x29e17d({'ret':_0x13cf56});}else{_0x334d24['Campaign'][_0x5777('0x22')]({'where':{'id':_0x3e1563['id']}})[_0x5777('0x23')](function(_0x18befd){if(!_[_0x5777('0x1b')](_0x18befd)){var _0xe3b88c=_0x18befd['dialTimezone'];if(!_[_0x5777('0x1b')](_0xe3b88c)){var _0x3594cf=shared['timezones'];var _0x5c9852=_0x3594cf[_0xe3b88c];var _0x23fb93=_0x3594cf[_0xb340e2[_0x5777('0x1c')]];if(!_[_0x5777('0x1b')](_0x5c9852)&&!_['isNil'](_0x23fb93)){var _0x2a8061=_0x5c9852[_0x5777('0x1e')]-_0x23fb93[_0x5777('0x1e')];_0x13cf56=_0xb340e2[_0x5777('0x18')]?_0xb340e2[_0x5777('0x18')]:moment();var _0x25ccc3=moment(_0x13cf56)[_0x5777('0x2d')](_0x2a8061,'minutes');_0x29e17d({'ret':_0x25ccc3[_0x5777('0x19')](_0x5777('0x1a'))});}else _0x29e17d({'ret':_0x13cf56});}else _0x29e17d({'ret':_0x13cf56});}else{_0x29e17d({'ret':_0x13cf56});}});}});return 0xa;}var _0x2ee499=function(_0x51d06d){return new BPromise(function(_0x4f0ab6,_0x4dac83){_0x252bd4(_0x51d06d,_0x1da249)['then'](function(_0x3861c9){_0x1da249[_0x5777('0x18')]=_0x3861c9[_0x5777('0x20')];_0x334d24['CmHopper'][_0x5777('0x22')]({'where':{'phone':_0x1da249[_0x5777('0xd')],'CampaignId':_0x51d06d['id']}})[_0x5777('0x23')](function(_0x1d7171){if(!_[_0x5777('0x1b')](_0x1d7171)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1da249[_0x5777('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x51d06d['id']);}return _0x334d24['CmHopper'][_0x5777('0x26')]({'phone':_0x1da249[_0x5777('0xd')],'ContactId':_0x1da249['id'],'ListId':_0x1da249[_0x5777('0x2a')],'priority':_0x1da249[_0x5777('0x27')]?_0x1da249['priority']:0x2,'scheduledat':_0x1da249['scheduledat']?_0x1da249['scheduledat']:moment()[_0x5777('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1da249[_0x5777('0x28')]?!![]:![],'callbackuniqueid':_0x1da249['callbackUniqueid']?_0x1da249[_0x5777('0x28')]:undefined,'callbackat':_0x1da249[_0x5777('0x28')]?moment()[_0x5777('0x19')](_0x5777('0x1a')):undefined,'CampaignId':_0x51d06d['id']});})['catch'](function(_0x2aff79){_0x4dac83(_0x2aff79);});});});};var _0x690be2=function(_0x2234fe){return new BPromise(function(_0x4a9768,_0x369d05){_0x252bd4(_0x2234fe,_0x1da249)[_0x5777('0x23')](function(_0x3a68ba){_0x1da249[_0x5777('0x18')]=_0x3a68ba[_0x5777('0x20')];_0x334d24[_0x5777('0x21')][_0x5777('0x22')]({'where':{'phone':_0x1da249[_0x5777('0xd')],'CampaignId':_0x2234fe['id']}})['then'](function(_0x53c08c){if(!_[_0x5777('0x1b')](_0x53c08c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1da249[_0x5777('0xd')]+_0x5777('0x2e')+_0x2234fe['id']);}return _0x334d24['CmHopperFinal'][_0x5777('0x22')]({'where':{'calleridnum':_0x1da249[_0x5777('0xd')],'CampaignId':_0x2234fe['id']}});})[_0x5777('0x23')](function(_0x4489c1){if(!_[_0x5777('0x1b')](_0x4489c1)){throw new Error(_0x5777('0x2f')+_0x1da249[_0x5777('0xd')]+_0x5777('0x30')+_0x2234fe['id']);}return _0x334d24[_0x5777('0x21')][_0x5777('0x26')]({'phone':_0x1da249[_0x5777('0xd')],'ContactId':_0x1da249['id'],'ListId':_0x1da249['ListId'],'priority':_0x1da249['priority']?_0x1da249[_0x5777('0x27')]:0x2,'scheduledat':_0x1da249[_0x5777('0x18')]?_0x1da249[_0x5777('0x18')]:moment()[_0x5777('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1da249['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1da249[_0x5777('0x28')]?_0x1da249[_0x5777('0x28')]:undefined,'callbackat':_0x1da249['callbackUniqueid']?moment()['format'](_0x5777('0x1a')):undefined,'CampaignId':_0x2234fe['id']});})[_0x5777('0x2b')](function(_0x3a8b66){_0x369d05(_0x3a8b66);});});});};if(_0x1da249[_0x5777('0x2a')]){_0x334d24['VoiceQueue'][_0x5777('0x31')]({'where':{'type':_0x5777('0x32')},'attributes':['id',_0x5777('0x33'),_0x5777('0x1c')],'include':[{'model':_0x334d24[_0x5777('0x34')],'as':'Lists','where':{'id':_0x1da249[_0x5777('0x2a')]}}]})['then'](function(_0x575dd0){if(_0x575dd0){var _0x47690d=[];for(var _0x4cfb4d=0x0,_0x4ec218;_0x4cfb4d<_0x575dd0[_0x5777('0x35')];_0x4cfb4d+=0x1){_0x4ec218=_0x575dd0[_0x4cfb4d][_0x5777('0x14')]({'plain':!![]});switch(_0x4ec218[_0x5777('0x33')]){case _0x5777('0x36'):_0x5d3bba(_0x4ec218)['catch'](_0x27df40());break;case _0x5777('0x37'):_0x28588e(_0x4ec218)[_0x5777('0x2b')](_0x27df40());break;default:_0x252bd4(_0x4ec218,_0x1da249)[_0x5777('0x23')](function(_0x416b04){_0x1da249[_0x5777('0x18')]=_0x416b04[_0x5777('0x20')];_0x334d24['CmHopper']['create']({'phone':_0x1da249[_0x5777('0xd')],'ContactId':_0x1da249['id'],'ListId':_0x1da249['ListId'],'scheduledat':_0x1da249[_0x5777('0x18')]?_0x1da249['scheduledat']:moment()[_0x5777('0x19')](_0x5777('0x1a')),'priority':_0x1da249[_0x5777('0x27')]?_0x1da249['priority']:0x2,'callback':_0x1da249[_0x5777('0x28')]?!![]:![],'callbackuniqueid':_0x1da249[_0x5777('0x28')]?_0x1da249[_0x5777('0x28')]:undefined,'callbackat':_0x1da249[_0x5777('0x28')]?moment()[_0x5777('0x19')](_0x5777('0x1a')):undefined,'VoiceQueueId':_0x4ec218['id']})[_0x5777('0x2b')](_0x27df40());});}}}})['then'](function(){return _0x334d24[_0x5777('0x1d')][_0x5777('0x31')]({'where':{'type':_0x5777('0x32')},'attributes':['id'],'include':[{'model':_0x334d24[_0x5777('0x34')],'as':_0x5777('0x38'),'where':{'id':_0x1da249[_0x5777('0x2a')]}}]})[_0x5777('0x23')](function(_0x34c4f4){if(_0x34c4f4){var _0x4c3ccd=[];for(var _0x3cf188=0x0,_0x46c127;_0x3cf188<_0x34c4f4[_0x5777('0x35')];_0x3cf188+=0x1){_0x46c127=_0x34c4f4[_0x3cf188][_0x5777('0x14')]({'plain':!![]});_0x334d24[_0x5777('0x39')][_0x5777('0x26')]({'phone':_0x1da249[_0x5777('0xd')],'ContactId':_0x1da249['id'],'ListId':_0x1da249[_0x5777('0x2a')],'VoiceQueueId':_0x46c127['id']})[_0x5777('0x2b')](function(_0x50b9f3){logger[_0x5777('0x2c')](_0x5777('0x3a'),_0x5777('0x16'),_0x50b9f3[_0x5777('0x3b')]);});}}});})['then'](function(){return _0x334d24[_0x5777('0x3c')]['findAll']({'attributes':['id',_0x5777('0x33'),_0x5777('0x1c')],'include':[{'model':_0x334d24[_0x5777('0x34')],'as':_0x5777('0x3d'),'where':{'id':_0x1da249[_0x5777('0x2a')]}}]})[_0x5777('0x23')](function(_0x5d74f0){if(_0x5d74f0){var _0x1f8d44=[];for(var _0x3e3a42=0x0,_0x59a5d9;_0x3e3a42<_0x5d74f0[_0x5777('0x35')];_0x3e3a42+=0x1){_0x59a5d9=_0x5d74f0[_0x3e3a42][_0x5777('0x14')]({'plain':!![]});switch(_0x59a5d9[_0x5777('0x33')]){case _0x5777('0x36'):_0x690be2(_0x59a5d9)[_0x5777('0x2b')](_0x173425());break;case _0x5777('0x37'):_0x2ee499(_0x59a5d9)[_0x5777('0x2b')](_0x173425());break;default:_0x334d24['CmHopper'][_0x5777('0x26')]({'phone':_0x1da249[_0x5777('0xd')],'ContactId':_0x1da249['id'],'ListId':_0x1da249[_0x5777('0x2a')],'scheduledat':_0x1da249[_0x5777('0x18')]?_0x1da249[_0x5777('0x18')]:moment()[_0x5777('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x1da249[_0x5777('0x27')]?_0x1da249['priority']:0x2,'callback':_0x1da249[_0x5777('0x28')]?!![]:![],'callbackuniqueid':_0x1da249['callbackUniqueid']?_0x1da249[_0x5777('0x28')]:undefined,'callbackat':_0x1da249[_0x5777('0x28')]?moment()[_0x5777('0x19')](_0x5777('0x1a')):undefined,'CampaignId':_0x59a5d9['id']})['catch'](_0x173425());}}}});})['then'](function(){return _0x334d24[_0x5777('0x3c')][_0x5777('0x31')]({'attributes':['id'],'include':[{'model':_0x334d24[_0x5777('0x34')],'as':_0x5777('0x38'),'where':{'id':_0x1da249[_0x5777('0x2a')]}}]})[_0x5777('0x23')](function(_0x7e2a68){if(_0x7e2a68){var _0x1acddc=[];for(var _0x71b0c4=0x0,_0x5228f7;_0x71b0c4<_0x7e2a68['length'];_0x71b0c4+=0x1){_0x5228f7=_0x7e2a68[_0x71b0c4]['get']({'plain':!![]});_0x334d24[_0x5777('0x39')][_0x5777('0x26')]({'phone':_0x1da249['phone'],'ContactId':_0x1da249['id'],'ListId':_0x1da249[_0x5777('0x2a')],'CampaignId':_0x5228f7['id']})[_0x5777('0x2b')](function(_0x15ca58){logger[_0x5777('0x2c')](_0x5777('0x3a'),_0x5777('0x16'),_0x15ca58[_0x5777('0x3b')]);});}}});})[_0x5777('0x23')](function(){_0x28a35e();})[_0x5777('0x2b')](function(_0x468a1f){logger[_0x5777('0x2c')](_0x5777('0x3a'),_0x5777('0x16'),_0x468a1f[_0x5777('0x3b')]);_0x28a35e(_0x468a1f);});}else{_0x28a35e(new Error(_0x5777('0x3e')));}},'afterDestroy':function(_0x5ad254,_0x51169e,_0x47c35a){var _0x5d670d=_0xe9af3a[_0x5777('0x3f')];var _0x2e4fee=_0x5ad254['get']({'plain':!![]});return _0x5d670d['CmHopper'][_0x5777('0x31')]({'raw':!![],'where':{'ListId':_0x2e4fee['ListId'],'ContactId':_0x2e4fee['id']}})[_0x5777('0x23')](function(_0x43e631){if(!_[_0x5777('0x40')](_0x43e631)){var _0x2bc5a8=[];for(var _0x559647=0x0;_0x559647<_0x43e631['length'];_0x559647+=0x1){var _0x18bec2=_0x5d670d['CmHopper'][_0x5777('0x41')]({'where':{'ListId':_0x43e631[_0x559647][_0x5777('0x2a')],'ContactId':_0x43e631[_0x559647][_0x5777('0x42')],'VoiceQueueId':_0x43e631[_0x559647][_0x5777('0x43')],'CampaignId':_0x43e631[_0x559647][_0x5777('0x44')]}});_0x2bc5a8[_0x5777('0x45')](_0x18bec2);}return BPromise['all'](_0x2bc5a8);}})['then'](function(_0x38f81a){logger['info'](_0x5777('0x46'),util[_0x5777('0x17')](_0x38f81a,{'showHidden':![],'depth':null}));_0x47c35a();})[_0x5777('0x2b')](function(_0x6a9b4){logger[_0x5777('0x2c')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x6a9b4,{'showHidden':![],'depth':null}));_0x47c35a(_0x6a9b4);});}}});}; \ No newline at end of file +var _0xb64b=['CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','VoiceQueue','dialTimezone','isNil','utcOffset','ret','CmHopper','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','afterCreate','inspect','Campaign','timezones','minutes','\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','cmContact,\x20afterCreate,\x20','findAll','outbound','dialCheckDuplicateType','Lists','always','onlyIfOpen','CmList','length','CmHopperBlack','cmContact,\x20%s,\x20%s','message','BlackLists','isEmpty','destroy','ContactId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','request-promise','../../config/environment','../../config/environment/shared','./cmContact.attributes','define'];(function(_0x2c9a2b,_0x569e58){var _0x482f27=function(_0xa8eef6){while(--_0xa8eef6){_0x2c9a2b['push'](_0x2c9a2b['shift']());}};_0x482f27(++_0x569e58);}(_0xb64b,0x1a7));var _0xbb64=function(_0x483ab9,_0x419148){_0x483ab9=_0x483ab9-0x0;var _0x35043b=_0xb64b[_0x483ab9];return _0x35043b;};'use strict';var _=require(_0xbb64('0x0'));var util=require(_0xbb64('0x1'));var logger=require(_0xbb64('0x2'))(_0xbb64('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbb64('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbb64('0x5'));var shared=require(_0xbb64('0x6'));var attributes=require(_0xbb64('0x7'));module['exports']=function(_0x2c7a01,_0x2b1418){return _0x2c7a01[_0xbb64('0x8')](_0xbb64('0x9'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xbb64('0xa'),'fields':['phone']},{'name':_0xbb64('0xb'),'fields':[_0xbb64('0xc'),_0xbb64('0xd'),'phone',_0xbb64('0xe'),'fax','email'],'type':_0xbb64('0xf')}],'timestamps':!![],'charset':_0xbb64('0x10'),'collate':_0xbb64('0x11'),'hooks':{'afterCreate':function(_0x1f9465,_0xb98774,_0x16bada){var _0x3061c9=_0x2c7a01[_0xbb64('0x12')];var _0x4e72e3=_0x1f9465[_0xbb64('0x13')]({'plain':!![]});function _0x4d3094(){return function(_0x4f3b4a){logger[_0xbb64('0x14')](_0xbb64('0x15'),'afterCreate',util['inspect'](_0x4f3b4a,{'showHidden':![],'depth':null}));};}function _0x18d365(_0x16c3c1,_0x868cd9){var _0x4f94c3=_0x868cd9['scheduledat']?_0x868cd9[_0xbb64('0x16')]:moment()[_0xbb64('0x17')](_0xbb64('0x18'));return new BPromise(function(_0x3b3505,_0x446f87){if(_['isNil'](_0x868cd9['dialTimezone'])){_0x3b3505({'ret':_0x4f94c3});}else{_0x3061c9[_0xbb64('0x19')]['findOne']({'where':{'id':_0x16c3c1['id']}})['then'](function(_0x132894){if(!_['isNil'](_0x132894)){var _0x5c65ea=_0x132894[_0xbb64('0x1a')];if(!_[_0xbb64('0x1b')](_0x5c65ea)){var _0x57a05a=shared['timezones'];var _0x32bd3b=_0x57a05a[_0x5c65ea];var _0x5f131b=_0x57a05a[_0x868cd9[_0xbb64('0x1a')]];if(!_[_0xbb64('0x1b')](_0x32bd3b)&&!_['isNil'](_0x5f131b)){var _0x1ac143=_0x32bd3b[_0xbb64('0x1c')]-_0x5f131b[_0xbb64('0x1c')];_0x4f94c3=_0x868cd9[_0xbb64('0x16')]?_0x868cd9[_0xbb64('0x16')]:moment();var _0x661f3e=moment(_0x4f94c3)['add'](_0x1ac143,'minutes');_0x3b3505({'ret':_0x661f3e['format'](_0xbb64('0x18'))});}else _0x3b3505({'ret':_0x4f94c3});}else _0x3b3505({'ret':_0x4f94c3});}else{_0x3b3505({'ret':_0x4f94c3});}});}});return 0xa;}var _0x3544cc=function(_0x3cd111){return new BPromise(function(_0x1661c1,_0x3b6e3b){_0x18d365(_0x3cd111,_0x4e72e3)['then'](function(_0x8647c8){_0x4e72e3[_0xbb64('0x16')]=_0x8647c8[_0xbb64('0x1d')];_0x3061c9[_0xbb64('0x1e')][_0xbb64('0x1f')]({'where':{'phone':_0x4e72e3[_0xbb64('0xa')],'VoiceQueueId':_0x3cd111['id']}})['then'](function(_0x45a197){if(!_[_0xbb64('0x1b')](_0x45a197)){throw new Error(_0xbb64('0x20')+_0x4e72e3['phone']+_0xbb64('0x21')+_0x3cd111['id']);}return _0x3061c9[_0xbb64('0x1e')][_0xbb64('0x22')]({'phone':_0x4e72e3[_0xbb64('0xa')],'ContactId':_0x4e72e3['id'],'ListId':_0x4e72e3[_0xbb64('0x23')],'priority':_0x4e72e3['priority']?_0x4e72e3[_0xbb64('0x24')]:0x2,'scheduledat':_0x4e72e3[_0xbb64('0x16')]?_0x4e72e3[_0xbb64('0x16')]:moment()[_0xbb64('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4e72e3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4e72e3['callbackUniqueid']?_0x4e72e3[_0xbb64('0x25')]:undefined,'callbackat':_0x4e72e3['callbackUniqueid']?moment()['format'](_0xbb64('0x18')):undefined,'VoiceQueueId':_0x3cd111['id']});})[_0xbb64('0x26')](function(_0x5cda68){_0x3b6e3b(_0x5cda68);});});});};var _0xda2e5b=function(_0x4ca225){return new BPromise(function(_0xc29413,_0x3e272e){_0x18d365(_0x4ca225,_0x4e72e3)['then'](function(_0x12f362){_0x4e72e3[_0xbb64('0x16')]=_0x12f362[_0xbb64('0x1d')];_0x3061c9[_0xbb64('0x1e')][_0xbb64('0x1f')]({'where':{'phone':_0x4e72e3['phone'],'VoiceQueueId':_0x4ca225['id']}})[_0xbb64('0x27')](function(_0x53d097){if(!_[_0xbb64('0x1b')](_0x53d097)){throw new Error(_0xbb64('0x20')+_0x4e72e3['phone']+_0xbb64('0x28')+_0x4ca225['id']);}return _0x3061c9[_0xbb64('0x29')][_0xbb64('0x1f')]({'where':{'calleridnum':_0x4e72e3[_0xbb64('0xa')],'VoiceQueueId':_0x4ca225['id']}});})[_0xbb64('0x27')](function(_0x20cb37){if(!_['isNil'](_0x20cb37)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x4e72e3[_0xbb64('0xa')]+_0xbb64('0x2a')+_0x4ca225['id']);}return _0x3061c9['CmHopper']['create']({'phone':_0x4e72e3['phone'],'ContactId':_0x4e72e3['id'],'ListId':_0x4e72e3['ListId'],'priority':_0x4e72e3[_0xbb64('0x24')]?_0x4e72e3[_0xbb64('0x24')]:0x2,'scheduledat':_0x4e72e3[_0xbb64('0x16')]?_0x4e72e3[_0xbb64('0x16')]:moment()[_0xbb64('0x17')](_0xbb64('0x18')),'callback':_0x4e72e3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4e72e3[_0xbb64('0x25')]?_0x4e72e3[_0xbb64('0x25')]:undefined,'callbackat':_0x4e72e3[_0xbb64('0x25')]?moment()[_0xbb64('0x17')](_0xbb64('0x18')):undefined,'VoiceQueueId':_0x4ca225['id']});})[_0xbb64('0x26')](function(_0x44c7b9){_0x3e272e(_0x44c7b9);});});});};function _0x5167f1(){return function(_0x18fe18){logger['error'](_0xbb64('0x15'),_0xbb64('0x2b'),util[_0xbb64('0x2c')](_0x18fe18,{'showHidden':![],'depth':null}));};}function _0x49e53e(_0x3ed2da,_0x47cb11){var _0x5a0d21=_0x47cb11[_0xbb64('0x16')]?_0x47cb11['scheduledat']:moment()['format'](_0xbb64('0x18'));return new BPromise(function(_0x148d7f,_0x1a1e1e){if(_[_0xbb64('0x1b')](_0x47cb11[_0xbb64('0x1a')])){_0x148d7f({'ret':_0x5a0d21});}else{_0x3061c9[_0xbb64('0x2d')][_0xbb64('0x1f')]({'where':{'id':_0x3ed2da['id']}})[_0xbb64('0x27')](function(_0x5954a0){if(!_[_0xbb64('0x1b')](_0x5954a0)){var _0x287eb8=_0x5954a0[_0xbb64('0x1a')];if(!_[_0xbb64('0x1b')](_0x287eb8)){var _0x36f2ff=shared[_0xbb64('0x2e')];var _0x4b0a02=_0x36f2ff[_0x287eb8];var _0x56a409=_0x36f2ff[_0x47cb11['dialTimezone']];if(!_['isNil'](_0x4b0a02)&&!_[_0xbb64('0x1b')](_0x56a409)){var _0x353073=_0x4b0a02['utcOffset']-_0x56a409[_0xbb64('0x1c')];_0x5a0d21=_0x47cb11[_0xbb64('0x16')]?_0x47cb11[_0xbb64('0x16')]:moment();var _0x5045b5=moment(_0x5a0d21)['add'](_0x353073,_0xbb64('0x2f'));_0x148d7f({'ret':_0x5045b5[_0xbb64('0x17')](_0xbb64('0x18'))});}else _0x148d7f({'ret':_0x5a0d21});}else _0x148d7f({'ret':_0x5a0d21});}else{_0x148d7f({'ret':_0x5a0d21});}});}});return 0xa;}var _0x1e4c4e=function(_0x3f7645){return new BPromise(function(_0x1801e7,_0x23b839){_0x49e53e(_0x3f7645,_0x4e72e3)[_0xbb64('0x27')](function(_0x5e6ce7){_0x4e72e3[_0xbb64('0x16')]=_0x5e6ce7[_0xbb64('0x1d')];_0x3061c9['CmHopper'][_0xbb64('0x1f')]({'where':{'phone':_0x4e72e3[_0xbb64('0xa')],'CampaignId':_0x3f7645['id']}})['then'](function(_0x4d5435){if(!_[_0xbb64('0x1b')](_0x4d5435)){throw new Error(_0xbb64('0x20')+_0x4e72e3[_0xbb64('0xa')]+_0xbb64('0x30')+_0x3f7645['id']);}return _0x3061c9['CmHopper']['create']({'phone':_0x4e72e3[_0xbb64('0xa')],'ContactId':_0x4e72e3['id'],'ListId':_0x4e72e3['ListId'],'priority':_0x4e72e3[_0xbb64('0x24')]?_0x4e72e3[_0xbb64('0x24')]:0x2,'scheduledat':_0x4e72e3[_0xbb64('0x16')]?_0x4e72e3[_0xbb64('0x16')]:moment()[_0xbb64('0x17')](_0xbb64('0x18')),'callback':_0x4e72e3[_0xbb64('0x25')]?!![]:![],'callbackuniqueid':_0x4e72e3[_0xbb64('0x25')]?_0x4e72e3['callbackUniqueid']:undefined,'callbackat':_0x4e72e3[_0xbb64('0x25')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3f7645['id']});})[_0xbb64('0x26')](function(_0x31cf47){_0x23b839(_0x31cf47);});});});};var _0x50c559=function(_0x394cde){return new BPromise(function(_0x43dc15,_0x1570af){_0x49e53e(_0x394cde,_0x4e72e3)[_0xbb64('0x27')](function(_0x5e9d2e){_0x4e72e3['scheduledat']=_0x5e9d2e[_0xbb64('0x1d')];_0x3061c9[_0xbb64('0x1e')]['findOne']({'where':{'phone':_0x4e72e3[_0xbb64('0xa')],'CampaignId':_0x394cde['id']}})[_0xbb64('0x27')](function(_0x9d42e4){if(!_[_0xbb64('0x1b')](_0x9d42e4)){throw new Error(_0xbb64('0x20')+_0x4e72e3[_0xbb64('0xa')]+_0xbb64('0x31')+_0x394cde['id']);}return _0x3061c9['CmHopperFinal'][_0xbb64('0x1f')]({'where':{'calleridnum':_0x4e72e3[_0xbb64('0xa')],'CampaignId':_0x394cde['id']}});})[_0xbb64('0x27')](function(_0x65c044){if(!_[_0xbb64('0x1b')](_0x65c044)){throw new Error(_0xbb64('0x32')+_0x4e72e3[_0xbb64('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x394cde['id']);}return _0x3061c9[_0xbb64('0x1e')][_0xbb64('0x22')]({'phone':_0x4e72e3[_0xbb64('0xa')],'ContactId':_0x4e72e3['id'],'ListId':_0x4e72e3['ListId'],'priority':_0x4e72e3['priority']?_0x4e72e3[_0xbb64('0x24')]:0x2,'scheduledat':_0x4e72e3[_0xbb64('0x16')]?_0x4e72e3['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4e72e3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4e72e3['callbackUniqueid']?_0x4e72e3[_0xbb64('0x25')]:undefined,'callbackat':_0x4e72e3['callbackUniqueid']?moment()[_0xbb64('0x17')](_0xbb64('0x18')):undefined,'CampaignId':_0x394cde['id']});})[_0xbb64('0x26')](function(_0x48d16f){_0x1570af(_0x48d16f);});});});};if(_0x4e72e3[_0xbb64('0x23')]){_0x3061c9[_0xbb64('0x19')][_0xbb64('0x33')]({'where':{'type':_0xbb64('0x34')},'attributes':['id',_0xbb64('0x35'),_0xbb64('0x1a')],'include':[{'model':_0x3061c9['CmList'],'as':_0xbb64('0x36'),'where':{'id':_0x4e72e3['ListId']}}]})[_0xbb64('0x27')](function(_0xf9c0ba){if(_0xf9c0ba){var _0x3288d3=[];for(var _0x17b01d=0x0,_0x20f3f2;_0x17b01d<_0xf9c0ba['length'];_0x17b01d+=0x1){_0x20f3f2=_0xf9c0ba[_0x17b01d][_0xbb64('0x13')]({'plain':!![]});switch(_0x20f3f2[_0xbb64('0x35')]){case _0xbb64('0x37'):_0xda2e5b(_0x20f3f2)[_0xbb64('0x26')](_0x4d3094());break;case _0xbb64('0x38'):_0x3544cc(_0x20f3f2)[_0xbb64('0x26')](_0x4d3094());break;default:_0x49e53e(_0x20f3f2,_0x4e72e3)[_0xbb64('0x27')](function(_0x35f790){_0x4e72e3[_0xbb64('0x16')]=_0x35f790['ret'];_0x3061c9['CmHopper'][_0xbb64('0x22')]({'phone':_0x4e72e3[_0xbb64('0xa')],'ContactId':_0x4e72e3['id'],'ListId':_0x4e72e3[_0xbb64('0x23')],'scheduledat':_0x4e72e3['scheduledat']?_0x4e72e3[_0xbb64('0x16')]:moment()[_0xbb64('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4e72e3[_0xbb64('0x24')]?_0x4e72e3[_0xbb64('0x24')]:0x2,'callback':_0x4e72e3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4e72e3['callbackUniqueid']?_0x4e72e3['callbackUniqueid']:undefined,'callbackat':_0x4e72e3['callbackUniqueid']?moment()['format'](_0xbb64('0x18')):undefined,'VoiceQueueId':_0x20f3f2['id']})['catch'](_0x4d3094());});}}}})['then'](function(){return _0x3061c9[_0xbb64('0x19')][_0xbb64('0x33')]({'where':{'type':_0xbb64('0x34')},'attributes':['id'],'include':[{'model':_0x3061c9[_0xbb64('0x39')],'as':'BlackLists','where':{'id':_0x4e72e3[_0xbb64('0x23')]}}]})[_0xbb64('0x27')](function(_0x447532){if(_0x447532){var _0x376831=[];for(var _0x120bbf=0x0,_0x44da9e;_0x120bbf<_0x447532[_0xbb64('0x3a')];_0x120bbf+=0x1){_0x44da9e=_0x447532[_0x120bbf][_0xbb64('0x13')]({'plain':!![]});_0x3061c9[_0xbb64('0x3b')][_0xbb64('0x22')]({'phone':_0x4e72e3[_0xbb64('0xa')],'ContactId':_0x4e72e3['id'],'ListId':_0x4e72e3[_0xbb64('0x23')],'VoiceQueueId':_0x44da9e['id']})['catch'](function(_0x12da4c){logger['error'](_0xbb64('0x3c'),_0xbb64('0x2b'),_0x12da4c[_0xbb64('0x3d')]);});}}});})[_0xbb64('0x27')](function(){return _0x3061c9[_0xbb64('0x2d')][_0xbb64('0x33')]({'attributes':['id',_0xbb64('0x35'),_0xbb64('0x1a')],'include':[{'model':_0x3061c9[_0xbb64('0x39')],'as':_0xbb64('0x36'),'where':{'id':_0x4e72e3[_0xbb64('0x23')]}}]})['then'](function(_0x4b57d2){if(_0x4b57d2){var _0x57b05a=[];for(var _0x50fd6c=0x0,_0x214bc1;_0x50fd6c<_0x4b57d2[_0xbb64('0x3a')];_0x50fd6c+=0x1){_0x214bc1=_0x4b57d2[_0x50fd6c]['get']({'plain':!![]});switch(_0x214bc1[_0xbb64('0x35')]){case'always':_0x50c559(_0x214bc1)[_0xbb64('0x26')](_0x5167f1());break;case'onlyIfOpen':_0x1e4c4e(_0x214bc1)[_0xbb64('0x26')](_0x5167f1());break;default:_0x3061c9[_0xbb64('0x1e')][_0xbb64('0x22')]({'phone':_0x4e72e3[_0xbb64('0xa')],'ContactId':_0x4e72e3['id'],'ListId':_0x4e72e3[_0xbb64('0x23')],'scheduledat':_0x4e72e3[_0xbb64('0x16')]?_0x4e72e3[_0xbb64('0x16')]:moment()['format'](_0xbb64('0x18')),'priority':_0x4e72e3[_0xbb64('0x24')]?_0x4e72e3[_0xbb64('0x24')]:0x2,'callback':_0x4e72e3[_0xbb64('0x25')]?!![]:![],'callbackuniqueid':_0x4e72e3[_0xbb64('0x25')]?_0x4e72e3['callbackUniqueid']:undefined,'callbackat':_0x4e72e3['callbackUniqueid']?moment()[_0xbb64('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x214bc1['id']})[_0xbb64('0x26')](_0x5167f1());}}}});})[_0xbb64('0x27')](function(){return _0x3061c9[_0xbb64('0x2d')]['findAll']({'attributes':['id'],'include':[{'model':_0x3061c9[_0xbb64('0x39')],'as':_0xbb64('0x3e'),'where':{'id':_0x4e72e3['ListId']}}]})[_0xbb64('0x27')](function(_0x3da398){if(_0x3da398){var _0x1818fb=[];for(var _0xa7c9fb=0x0,_0x5c8419;_0xa7c9fb<_0x3da398['length'];_0xa7c9fb+=0x1){_0x5c8419=_0x3da398[_0xa7c9fb][_0xbb64('0x13')]({'plain':!![]});_0x3061c9[_0xbb64('0x3b')][_0xbb64('0x22')]({'phone':_0x4e72e3['phone'],'ContactId':_0x4e72e3['id'],'ListId':_0x4e72e3['ListId'],'CampaignId':_0x5c8419['id']})[_0xbb64('0x26')](function(_0x467414){logger['error'](_0xbb64('0x3c'),_0xbb64('0x2b'),_0x467414[_0xbb64('0x3d')]);});}}});})[_0xbb64('0x27')](function(){_0x16bada();})['catch'](function(_0x1e76b7){logger[_0xbb64('0x14')](_0xbb64('0x3c'),_0xbb64('0x2b'),_0x1e76b7[_0xbb64('0x3d')]);_0x16bada(_0x1e76b7);});}else{_0x16bada(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x556df9,_0x4185c1,_0x298b2a){var _0x4db1cf=_0x2c7a01[_0xbb64('0x12')];var _0x55cc61=_0x556df9['get']({'plain':!![]});return _0x4db1cf[_0xbb64('0x1e')][_0xbb64('0x33')]({'raw':!![],'where':{'ListId':_0x55cc61[_0xbb64('0x23')],'ContactId':_0x55cc61['id']}})['then'](function(_0x4ad0b8){if(!_[_0xbb64('0x3f')](_0x4ad0b8)){var _0x6eb29=[];for(var _0xdcc8c4=0x0;_0xdcc8c4<_0x4ad0b8[_0xbb64('0x3a')];_0xdcc8c4+=0x1){var _0x35b7dd=_0x4db1cf['CmHopper'][_0xbb64('0x40')]({'where':{'ListId':_0x4ad0b8[_0xdcc8c4][_0xbb64('0x23')],'ContactId':_0x4ad0b8[_0xdcc8c4][_0xbb64('0x41')],'VoiceQueueId':_0x4ad0b8[_0xdcc8c4]['VoiceQueueId'],'CampaignId':_0x4ad0b8[_0xdcc8c4][_0xbb64('0x42')]}});_0x6eb29[_0xbb64('0x43')](_0x35b7dd);}return BPromise[_0xbb64('0x44')](_0x6eb29);}})[_0xbb64('0x27')](function(_0x1f8782){logger[_0xbb64('0x45')](_0xbb64('0x46'),util[_0xbb64('0x2c')](_0x1f8782,{'showHidden':![],'depth':null}));_0x298b2a();})['catch'](function(_0x1b4719){logger[_0xbb64('0x14')](_0xbb64('0x47'),util[_0xbb64('0x2c')](_0x1b4719,{'showHidden':![],'depth':null}));_0x298b2a(_0x1b4719);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index bde4ade..75562f1 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_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 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(_0x4c2614,_0x7a339e){var _0x1fbb03=function(_0x264151){while(--_0x264151){_0x4c2614['push'](_0x4c2614['shift']());}};_0x1fbb03(++_0x7a339e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 7a1cf39..4819c5a 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 _0x534d=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x32b8e2,_0x5a9b1c){var _0x51c352=function(_0x47a235){while(--_0x47a235){_0x32b8e2['push'](_0x32b8e2['shift']());}};_0x51c352(++_0x5a9b1c);}(_0x534d,0x79));var _0xd534=function(_0x485529,_0xb5553e){_0x485529=_0x485529-0x0;var _0x499873=_0x534d[_0x485529];return _0x499873;};'use strict';var Sequelize=require(_0xd534('0x0'));module[_0xd534('0x1')]={'CmContactId':{'type':Sequelize[_0xd534('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xd534('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xd534('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xd534('0x3')],'defaultValue':_0xd534('0x4')},'OrderBy':{'type':Sequelize[_0xd534('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xd534('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x949d=['exports','INTEGER','STRING','PHONE','sequelize'];(function(_0x291bc2,_0x580442){var _0xab139c=function(_0x5e2fa9){while(--_0x5e2fa9){_0x291bc2['push'](_0x291bc2['shift']());}};_0xab139c(++_0x580442);}(_0x949d,0x162));var _0xd949=function(_0x349762,_0x213e13){_0x349762=_0x349762-0x0;var _0x4451de=_0x949d[_0x349762];return _0x4451de;};'use strict';var Sequelize=require(_0xd949('0x0'));module[_0xd949('0x1')]={'CmContactId':{'type':Sequelize[_0xd949('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xd949('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xd949('0x4')},'OrderBy':{'type':Sequelize[_0xd949('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index b5ffd4f..7476c83 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 _0x5b73=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','CmContactHasItems','UserProfileResource','status','sendStatus','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x5b73,0x1a2));var _0x35b7=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0x5b73[_0x385c76];return _0x5c8367;};'use strict';var emlformat=require(_0x35b7('0x0'));var rimraf=require(_0x35b7('0x1'));var zipdir=require(_0x35b7('0x2'));var jsonpatch=require(_0x35b7('0x3'));var rp=require('request-promise');var moment=require(_0x35b7('0x4'));var BPromise=require(_0x35b7('0x5'));var Mustache=require('mustache');var util=require(_0x35b7('0x6'));var path=require(_0x35b7('0x7'));var sox=require(_0x35b7('0x8'));var csv=require(_0x35b7('0x9'));var ejs=require(_0x35b7('0xa'));var fs=require('fs');var fs_extra=require(_0x35b7('0xb'));var _=require('lodash');var squel=require(_0x35b7('0xc'));var crypto=require(_0x35b7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x35b7('0xe'));var toCsv=require(_0x35b7('0x9'));var querystring=require(_0x35b7('0xf'));var Papa=require(_0x35b7('0x10'));var Redis=require(_0x35b7('0x11'));var authService=require(_0x35b7('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35b7('0x13'));var logger=require(_0x35b7('0x14'))(_0x35b7('0x15'));var utils=require(_0x35b7('0x16'));var config=require(_0x35b7('0x17'));var licenseUtil=require(_0x35b7('0x18'));var db=require(_0x35b7('0x19'))['db'];function respondWithStatusCode(_0x54dace,_0x462f01){_0x462f01=_0x462f01||0xcc;return function(_0x1ae061){if(_0x1ae061){return _0x54dace['sendStatus'](_0x462f01);}return _0x54dace['status'](_0x462f01)[_0x35b7('0x1a')]();};}function respondWithResult(_0x3a6c89,_0x2f2df0){_0x2f2df0=_0x2f2df0||0xc8;return function(_0x593e95){if(_0x593e95){return _0x3a6c89['status'](_0x2f2df0)[_0x35b7('0x1b')](_0x593e95);}};}function respondWithFilteredResult(_0x20b390,_0x528a22){return function(_0x4e2fe1){if(_0x4e2fe1){var _0x41f5be=typeof _0x528a22[_0x35b7('0x1c')]===_0x35b7('0x1d')&&typeof _0x528a22[_0x35b7('0x1e')]===_0x35b7('0x1d');var _0x16c225=_0x4e2fe1[_0x35b7('0x1f')];var _0x5a3c51=_0x41f5be?0x0:_0x528a22['offset'];var _0x1f0fe1=_0x41f5be?_0x4e2fe1[_0x35b7('0x1f')]:_0x528a22[_0x35b7('0x1c')]+_0x528a22[_0x35b7('0x1e')];var _0x50bec2;if(_0x1f0fe1>=_0x16c225){_0x1f0fe1=_0x16c225;_0x50bec2=0xc8;}else{_0x50bec2=0xce;}_0x20b390['status'](_0x50bec2);return _0x20b390[_0x35b7('0x20')](_0x35b7('0x21'),_0x5a3c51+'-'+_0x1f0fe1+'/'+_0x16c225)['json'](_0x4e2fe1);}return null;};}function patchUpdates(_0x528b4a){return function(_0x3a4b3e){try{jsonpatch[_0x35b7('0x22')](_0x3a4b3e,_0x528b4a,!![]);}catch(_0x16fcc7){return BPromise[_0x35b7('0x23')](_0x16fcc7);}return _0x3a4b3e[_0x35b7('0x24')]();};}function saveUpdates(_0x371051,_0x1c7545){return function(_0x1f1cf7){if(_0x1f1cf7){return _0x1f1cf7['update'](_0x371051)[_0x35b7('0x25')](function(_0x583267){return _0x583267;});}return null;};}function removeEntity(_0x55e567,_0x13fed6){return function(_0x5089e1){if(_0x5089e1){return _0x5089e1[_0x35b7('0x26')]()['then'](function(){var _0x273970=_0x5089e1[_0x35b7('0x27')]({'plain':!![]});var _0x3bac8d=_0x35b7('0x28');return db[_0x35b7('0x29')][_0x35b7('0x26')]({'where':{'type':_0x3bac8d,'resourceId':_0x273970['id']}})[_0x35b7('0x25')](function(){return _0x5089e1;});})[_0x35b7('0x25')](function(){_0x55e567[_0x35b7('0x2a')](0xcc)[_0x35b7('0x1a')]();});}};}function handleEntityNotFound(_0x1bc24d,_0x5f4aec){return function(_0x2fa8ba){if(!_0x2fa8ba){_0x1bc24d[_0x35b7('0x2b')](0x194);}return _0x2fa8ba;};}function handleError(_0x319bd2,_0x5daca6){_0x5daca6=_0x5daca6||0x1f4;return function(_0x31296b){logger[_0x35b7('0x2c')](_0x31296b[_0x35b7('0x2d')]);if(_0x31296b[_0x35b7('0x2e')]){delete _0x31296b[_0x35b7('0x2e')];}_0x319bd2[_0x35b7('0x2a')](_0x5daca6)[_0x35b7('0x2f')](_0x31296b);};}exports[_0x35b7('0x30')]=function(_0x3e9dd6,_0x1613b7){var _0x517f20={},_0x491ece={},_0x5d59d6={'count':0x0,'rows':[]};var _0x5c83ad=_[_0x35b7('0x31')](db[_0x35b7('0x32')][_0x35b7('0x33')],function(_0x21b52d){return{'name':_0x21b52d['fieldName'],'type':_0x21b52d[_0x35b7('0x34')][_0x35b7('0x35')]};});_0x491ece[_0x35b7('0x36')]=_[_0x35b7('0x31')](_0x5c83ad,_0x35b7('0x2e'));_0x491ece[_0x35b7('0x37')]=_[_0x35b7('0x38')](_0x3e9dd6['query']);_0x491ece[_0x35b7('0x39')]=_[_0x35b7('0x3a')](_0x491ece[_0x35b7('0x36')],_0x491ece[_0x35b7('0x37')]);_0x517f20[_0x35b7('0x3b')]=_[_0x35b7('0x3a')](_0x491ece[_0x35b7('0x36')],qs[_0x35b7('0x3c')](_0x3e9dd6[_0x35b7('0x37')][_0x35b7('0x3c')]));_0x517f20[_0x35b7('0x3b')]=_0x517f20['attributes'][_0x35b7('0x3d')]?_0x517f20['attributes']:_0x491ece['model'];if(!_0x3e9dd6[_0x35b7('0x37')][_0x35b7('0x3e')](_0x35b7('0x3f'))){_0x517f20['limit']=qs[_0x35b7('0x1e')](_0x3e9dd6[_0x35b7('0x37')][_0x35b7('0x1e')]);_0x517f20[_0x35b7('0x1c')]=qs[_0x35b7('0x1c')](_0x3e9dd6[_0x35b7('0x37')][_0x35b7('0x1c')]);}_0x517f20['order']=qs['sort'](_0x3e9dd6['query'][_0x35b7('0x40')]);_0x517f20[_0x35b7('0x41')]=qs[_0x35b7('0x39')](_[_0x35b7('0x42')](_0x3e9dd6[_0x35b7('0x37')],_0x491ece[_0x35b7('0x39')]),_0x5c83ad);if(_0x3e9dd6[_0x35b7('0x37')][_0x35b7('0x43')]){_0x517f20['where']=_[_0x35b7('0x44')](_0x517f20[_0x35b7('0x41')],{'$or':_[_0x35b7('0x31')](_0x5c83ad,function(_0x2cd611){if(_0x2cd611[_0x35b7('0x34')]!==_0x35b7('0x45')){var _0x2e1b49={};_0x2e1b49[_0x2cd611[_0x35b7('0x2e')]]={'$like':'%'+_0x3e9dd6[_0x35b7('0x37')][_0x35b7('0x43')]+'%'};return _0x2e1b49;}})});}_0x517f20=_['merge']({},_0x517f20,_0x3e9dd6[_0x35b7('0x46')]);var _0x1d74db={'where':_0x517f20['where']};return db[_0x35b7('0x32')][_0x35b7('0x1f')](_0x1d74db)[_0x35b7('0x25')](function(_0x20aceb){_0x5d59d6['count']=_0x20aceb;if(_0x3e9dd6['query'][_0x35b7('0x47')]){_0x517f20['include']=[{'all':!![]}];}return db[_0x35b7('0x32')]['findAll'](_0x517f20);})[_0x35b7('0x25')](function(_0x225718){_0x5d59d6[_0x35b7('0x48')]=_0x225718;return _0x5d59d6;})['then'](respondWithFilteredResult(_0x1613b7,_0x517f20))[_0x35b7('0x49')](handleError(_0x1613b7,null));};exports[_0x35b7('0x4a')]=function(_0x2844f3,_0x7495ea){var _0x50b949={'raw':!![],'where':{'id':_0x2844f3[_0x35b7('0x4b')]['id']}},_0x5eca13={};_0x5eca13['model']=_[_0x35b7('0x38')](db[_0x35b7('0x32')][_0x35b7('0x33')]);_0x5eca13[_0x35b7('0x37')]=_[_0x35b7('0x38')](_0x2844f3[_0x35b7('0x37')]);_0x5eca13[_0x35b7('0x39')]=_[_0x35b7('0x3a')](_0x5eca13[_0x35b7('0x36')],_0x5eca13[_0x35b7('0x37')]);_0x50b949['attributes']=_['intersection'](_0x5eca13[_0x35b7('0x36')],qs['fields'](_0x2844f3[_0x35b7('0x37')][_0x35b7('0x3c')]));_0x50b949[_0x35b7('0x3b')]=_0x50b949[_0x35b7('0x3b')][_0x35b7('0x3d')]?_0x50b949[_0x35b7('0x3b')]:_0x5eca13['model'];if(_0x2844f3[_0x35b7('0x37')][_0x35b7('0x47')]){_0x50b949[_0x35b7('0x4c')]=[{'all':!![]}];}_0x50b949=_['merge']({},_0x50b949,_0x2844f3[_0x35b7('0x46')]);return db[_0x35b7('0x32')]['find'](_0x50b949)[_0x35b7('0x25')](handleEntityNotFound(_0x7495ea,null))[_0x35b7('0x25')](respondWithResult(_0x7495ea,null))['catch'](handleError(_0x7495ea,null));};exports[_0x35b7('0x4d')]=function(_0xcb68e2,_0x3d963f){return db['CmContactHasItem']['create'](_0xcb68e2[_0x35b7('0x4e')],{})[_0x35b7('0x25')](function(_0x37bf73){var _0x2771a8=_0xcb68e2[_0x35b7('0x4f')][_0x35b7('0x27')]({'plain':!![]});if(!_0x2771a8)throw new Error(_0x35b7('0x50'));if(_0x2771a8[_0x35b7('0x51')]===_0x35b7('0x4f')){var _0x4d2006=_0x37bf73['get']({'plain':!![]});var _0x1a0da4=_0x35b7('0x28');return db[_0x35b7('0x52')][_0x35b7('0x53')]({'where':{'name':_0x1a0da4,'userProfileId':_0x2771a8[_0x35b7('0x54')]},'raw':!![]})[_0x35b7('0x25')](function(_0x34da2d){if(_0x34da2d&&_0x34da2d['autoAssociation']===0x0){return db['UserProfileResource'][_0x35b7('0x4d')]({'name':_0x4d2006[_0x35b7('0x2e')],'resourceId':_0x4d2006['id'],'type':_0x34da2d[_0x35b7('0x2e')],'sectionId':_0x34da2d['id']},{})['then'](function(){return _0x37bf73;});}else{return _0x37bf73;}})[_0x35b7('0x49')](function(_0x2a4e61){logger[_0x35b7('0x2c')](_0x35b7('0x55'),_0x2a4e61);throw _0x2a4e61;});}return _0x37bf73;})['then'](respondWithResult(_0x3d963f,0xc9))[_0x35b7('0x49')](handleError(_0x3d963f,null));};exports[_0x35b7('0x56')]=function(_0x45a8b4,_0x4e48f4){if(_0x45a8b4['body']['id']){delete _0x45a8b4[_0x35b7('0x4e')]['id'];}return db[_0x35b7('0x32')][_0x35b7('0x53')]({'where':{'id':_0x45a8b4['params']['id']}})[_0x35b7('0x25')](handleEntityNotFound(_0x4e48f4,null))[_0x35b7('0x25')](saveUpdates(_0x45a8b4[_0x35b7('0x4e')],null))['then'](respondWithResult(_0x4e48f4,null))[_0x35b7('0x49')](handleError(_0x4e48f4,null));};exports[_0x35b7('0x26')]=function(_0x10a71a,_0x71be87){return db[_0x35b7('0x32')]['find']({'where':{'id':_0x10a71a[_0x35b7('0x4b')]['id']}})[_0x35b7('0x25')](handleEntityNotFound(_0x71be87,null))[_0x35b7('0x25')](removeEntity(_0x71be87,null))[_0x35b7('0x49')](handleError(_0x71be87,null));}; \ No newline at end of file +var _0xb9d4=['name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmContactHasItem','includeAll','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','get','error','stack'];(function(_0x2ffede,_0x59898c){var _0x447530=function(_0x30bda7){while(--_0x30bda7){_0x2ffede['push'](_0x2ffede['shift']());}};_0x447530(++_0x59898c);}(_0xb9d4,0x169));var _0x4b9d=function(_0x238a5b,_0x2e5457){_0x238a5b=_0x238a5b-0x0;var _0x491fca=_0xb9d4[_0x238a5b];return _0x491fca;};'use strict';var emlformat=require(_0x4b9d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b9d('0x1'));var jsonpatch=require(_0x4b9d('0x2'));var rp=require('request-promise');var moment=require(_0x4b9d('0x3'));var BPromise=require(_0x4b9d('0x4'));var Mustache=require('mustache');var util=require(_0x4b9d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4b9d('0x6'));var ejs=require(_0x4b9d('0x7'));var fs=require('fs');var fs_extra=require(_0x4b9d('0x8'));var _=require(_0x4b9d('0x9'));var squel=require(_0x4b9d('0xa'));var crypto=require(_0x4b9d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4b9d('0xc'));var toCsv=require(_0x4b9d('0x6'));var querystring=require(_0x4b9d('0xd'));var Papa=require(_0x4b9d('0xe'));var Redis=require(_0x4b9d('0xf'));var authService=require(_0x4b9d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4b9d('0x11'));var hardwareService=require(_0x4b9d('0x12'));var logger=require(_0x4b9d('0x13'))(_0x4b9d('0x14'));var utils=require(_0x4b9d('0x15'));var config=require(_0x4b9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4b9d('0x17'))['db'];function respondWithStatusCode(_0x5db1fb,_0xfcb8d9){_0xfcb8d9=_0xfcb8d9||0xcc;return function(_0x92a47b){if(_0x92a47b){return _0x5db1fb['sendStatus'](_0xfcb8d9);}return _0x5db1fb[_0x4b9d('0x18')](_0xfcb8d9)[_0x4b9d('0x19')]();};}function respondWithResult(_0x158fa1,_0x93a795){_0x93a795=_0x93a795||0xc8;return function(_0x228bfa){if(_0x228bfa){return _0x158fa1['status'](_0x93a795)['json'](_0x228bfa);}};}function respondWithFilteredResult(_0x1a86d3,_0x265ea9){return function(_0x4017b8){if(_0x4017b8){var _0x2470b1=typeof _0x265ea9[_0x4b9d('0x1a')]===_0x4b9d('0x1b')&&typeof _0x265ea9[_0x4b9d('0x1c')]===_0x4b9d('0x1b');var _0x11e3ad=_0x4017b8[_0x4b9d('0x1d')];var _0x3e5602=_0x2470b1?0x0:_0x265ea9['offset'];var _0x3c68a8=_0x2470b1?_0x4017b8[_0x4b9d('0x1d')]:_0x265ea9['offset']+_0x265ea9[_0x4b9d('0x1c')];var _0x30eacf;if(_0x3c68a8>=_0x11e3ad){_0x3c68a8=_0x11e3ad;_0x30eacf=0xc8;}else{_0x30eacf=0xce;}_0x1a86d3['status'](_0x30eacf);return _0x1a86d3[_0x4b9d('0x1e')](_0x4b9d('0x1f'),_0x3e5602+'-'+_0x3c68a8+'/'+_0x11e3ad)[_0x4b9d('0x20')](_0x4017b8);}return null;};}function patchUpdates(_0x5015ab){return function(_0x6b2cd4){try{jsonpatch['apply'](_0x6b2cd4,_0x5015ab,!![]);}catch(_0x481c9f){return BPromise['reject'](_0x481c9f);}return _0x6b2cd4['save']();};}function saveUpdates(_0x3941d2,_0x2b9f24){return function(_0xdd9b6b){if(_0xdd9b6b){return _0xdd9b6b[_0x4b9d('0x21')](_0x3941d2)[_0x4b9d('0x22')](function(_0xc4ebf9){return _0xc4ebf9;});}return null;};}function removeEntity(_0x3e9fbc,_0x45f5e2){return function(_0x215fdb){if(_0x215fdb){return _0x215fdb[_0x4b9d('0x23')]()['then'](function(){var _0x3ffda5=_0x215fdb[_0x4b9d('0x24')]({'plain':!![]});var _0x157a4e='CmContactHasItems';return db['UserProfileResource'][_0x4b9d('0x23')]({'where':{'type':_0x157a4e,'resourceId':_0x3ffda5['id']}})[_0x4b9d('0x22')](function(){return _0x215fdb;});})['then'](function(){_0x3e9fbc[_0x4b9d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x318003,_0x49cd4c){return function(_0x24e4b5){if(!_0x24e4b5){_0x318003['sendStatus'](0x194);}return _0x24e4b5;};}function handleError(_0x315ba1,_0xe8881a){_0xe8881a=_0xe8881a||0x1f4;return function(_0x24751e){logger[_0x4b9d('0x25')](_0x24751e[_0x4b9d('0x26')]);if(_0x24751e['name']){delete _0x24751e[_0x4b9d('0x27')];}_0x315ba1['status'](_0xe8881a)[_0x4b9d('0x28')](_0x24751e);};}exports['index']=function(_0x1589cb,_0x2b647d){var _0x251211={},_0x5dd7d1={},_0x360e06={'count':0x0,'rows':[]};var _0x5f2c6c=_[_0x4b9d('0x29')](db['CmContactHasItem'][_0x4b9d('0x2a')],function(_0x9cf5ef){return{'name':_0x9cf5ef[_0x4b9d('0x2b')],'type':_0x9cf5ef[_0x4b9d('0x2c')][_0x4b9d('0x2d')]};});_0x5dd7d1[_0x4b9d('0x2e')]=_[_0x4b9d('0x29')](_0x5f2c6c,'name');_0x5dd7d1[_0x4b9d('0x2f')]=_['keys'](_0x1589cb['query']);_0x5dd7d1[_0x4b9d('0x30')]=_[_0x4b9d('0x31')](_0x5dd7d1[_0x4b9d('0x2e')],_0x5dd7d1[_0x4b9d('0x2f')]);_0x251211[_0x4b9d('0x32')]=_[_0x4b9d('0x31')](_0x5dd7d1[_0x4b9d('0x2e')],qs[_0x4b9d('0x33')](_0x1589cb[_0x4b9d('0x2f')]['fields']));_0x251211[_0x4b9d('0x32')]=_0x251211['attributes'][_0x4b9d('0x34')]?_0x251211['attributes']:_0x5dd7d1[_0x4b9d('0x2e')];if(!_0x1589cb[_0x4b9d('0x2f')][_0x4b9d('0x35')](_0x4b9d('0x36'))){_0x251211[_0x4b9d('0x1c')]=qs[_0x4b9d('0x1c')](_0x1589cb[_0x4b9d('0x2f')][_0x4b9d('0x1c')]);_0x251211['offset']=qs[_0x4b9d('0x1a')](_0x1589cb['query'][_0x4b9d('0x1a')]);}_0x251211[_0x4b9d('0x37')]=qs[_0x4b9d('0x38')](_0x1589cb[_0x4b9d('0x2f')]['sort']);_0x251211[_0x4b9d('0x39')]=qs[_0x4b9d('0x30')](_[_0x4b9d('0x3a')](_0x1589cb['query'],_0x5dd7d1[_0x4b9d('0x30')]),_0x5f2c6c);if(_0x1589cb['query'][_0x4b9d('0x3b')]){_0x251211['where']=_[_0x4b9d('0x3c')](_0x251211['where'],{'$or':_[_0x4b9d('0x29')](_0x5f2c6c,function(_0x3a4ac2){if(_0x3a4ac2[_0x4b9d('0x2c')]!==_0x4b9d('0x3d')){var _0x125487={};_0x125487[_0x3a4ac2[_0x4b9d('0x27')]]={'$like':'%'+_0x1589cb[_0x4b9d('0x2f')][_0x4b9d('0x3b')]+'%'};return _0x125487;}})});}_0x251211=_['merge']({},_0x251211,_0x1589cb[_0x4b9d('0x3e')]);var _0x1327af={'where':_0x251211['where']};return db[_0x4b9d('0x3f')][_0x4b9d('0x1d')](_0x1327af)[_0x4b9d('0x22')](function(_0x369e3d){_0x360e06[_0x4b9d('0x1d')]=_0x369e3d;if(_0x1589cb[_0x4b9d('0x2f')][_0x4b9d('0x40')]){_0x251211['include']=[{'all':!![]}];}return db[_0x4b9d('0x3f')][_0x4b9d('0x41')](_0x251211);})[_0x4b9d('0x22')](function(_0x93b861){_0x360e06[_0x4b9d('0x42')]=_0x93b861;return _0x360e06;})['then'](respondWithFilteredResult(_0x2b647d,_0x251211))[_0x4b9d('0x43')](handleError(_0x2b647d,null));};exports[_0x4b9d('0x44')]=function(_0xa061ab,_0x55f3e3){var _0x42d9f6={'raw':!![],'where':{'id':_0xa061ab[_0x4b9d('0x45')]['id']}},_0x4baf92={};_0x4baf92['model']=_[_0x4b9d('0x46')](db[_0x4b9d('0x3f')]['rawAttributes']);_0x4baf92[_0x4b9d('0x2f')]=_[_0x4b9d('0x46')](_0xa061ab[_0x4b9d('0x2f')]);_0x4baf92[_0x4b9d('0x30')]=_[_0x4b9d('0x31')](_0x4baf92[_0x4b9d('0x2e')],_0x4baf92['query']);_0x42d9f6[_0x4b9d('0x32')]=_[_0x4b9d('0x31')](_0x4baf92[_0x4b9d('0x2e')],qs[_0x4b9d('0x33')](_0xa061ab[_0x4b9d('0x2f')][_0x4b9d('0x33')]));_0x42d9f6[_0x4b9d('0x32')]=_0x42d9f6['attributes'][_0x4b9d('0x34')]?_0x42d9f6[_0x4b9d('0x32')]:_0x4baf92[_0x4b9d('0x2e')];if(_0xa061ab[_0x4b9d('0x2f')][_0x4b9d('0x40')]){_0x42d9f6['include']=[{'all':!![]}];}_0x42d9f6=_[_0x4b9d('0x3c')]({},_0x42d9f6,_0xa061ab[_0x4b9d('0x3e')]);return db['CmContactHasItem'][_0x4b9d('0x47')](_0x42d9f6)[_0x4b9d('0x22')](handleEntityNotFound(_0x55f3e3,null))['then'](respondWithResult(_0x55f3e3,null))[_0x4b9d('0x43')](handleError(_0x55f3e3,null));};exports[_0x4b9d('0x48')]=function(_0x2ddf3c,_0x5be29a){return db[_0x4b9d('0x3f')][_0x4b9d('0x48')](_0x2ddf3c[_0x4b9d('0x49')],{})['then'](function(_0x3a7183){var _0x3148cc=_0x2ddf3c[_0x4b9d('0x4a')][_0x4b9d('0x24')]({'plain':!![]});if(!_0x3148cc)throw new Error(_0x4b9d('0x4b'));if(_0x3148cc[_0x4b9d('0x4c')]==='user'){var _0x424663=_0x3a7183[_0x4b9d('0x24')]({'plain':!![]});var _0xfcc013=_0x4b9d('0x4d');return db[_0x4b9d('0x4e')][_0x4b9d('0x47')]({'where':{'name':_0xfcc013,'userProfileId':_0x3148cc['userProfileId']},'raw':!![]})[_0x4b9d('0x22')](function(_0xfc5b4f){if(_0xfc5b4f&&_0xfc5b4f['autoAssociation']===0x0){return db['UserProfileResource'][_0x4b9d('0x48')]({'name':_0x424663[_0x4b9d('0x27')],'resourceId':_0x424663['id'],'type':_0xfc5b4f[_0x4b9d('0x27')],'sectionId':_0xfc5b4f['id']},{})[_0x4b9d('0x22')](function(){return _0x3a7183;});}else{return _0x3a7183;}})[_0x4b9d('0x43')](function(_0x2caa32){logger[_0x4b9d('0x25')](_0x4b9d('0x4f'),_0x2caa32);throw _0x2caa32;});}return _0x3a7183;})[_0x4b9d('0x22')](respondWithResult(_0x5be29a,0xc9))['catch'](handleError(_0x5be29a,null));};exports[_0x4b9d('0x21')]=function(_0x85dd08,_0x2cc189){if(_0x85dd08[_0x4b9d('0x49')]['id']){delete _0x85dd08[_0x4b9d('0x49')]['id'];}return db[_0x4b9d('0x3f')][_0x4b9d('0x47')]({'where':{'id':_0x85dd08[_0x4b9d('0x45')]['id']}})[_0x4b9d('0x22')](handleEntityNotFound(_0x2cc189,null))[_0x4b9d('0x22')](saveUpdates(_0x85dd08[_0x4b9d('0x49')],null))[_0x4b9d('0x22')](respondWithResult(_0x2cc189,null))[_0x4b9d('0x43')](handleError(_0x2cc189,null));};exports[_0x4b9d('0x23')]=function(_0x1f825b,_0x3e2a4c){return db[_0x4b9d('0x3f')][_0x4b9d('0x47')]({'where':{'id':_0x1f825b['params']['id']}})[_0x4b9d('0x22')](handleEntityNotFound(_0x3e2a4c,null))['then'](removeEntity(_0x3e2a4c,null))[_0x4b9d('0x43')](handleError(_0x3e2a4c,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index e6cbb2a..dd32dad 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 _0x980f=['./cmContactHasItem.attributes','exports','define','CmContactHasItem','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5c0e04,_0x152b64){var _0xbaa241=function(_0x5923ac){while(--_0x5923ac){_0x5c0e04['push'](_0x5c0e04['shift']());}};_0xbaa241(++_0x152b64);}(_0x980f,0x1cc));var _0xf980=function(_0x543583,_0x371d21){_0x543583=_0x543583-0x0;var _0x5d79c3=_0x980f[_0x543583];return _0x5d79c3;};'use strict';var _=require('lodash');var util=require(_0xf980('0x0'));var logger=require(_0xf980('0x1'))(_0xf980('0x2'));var moment=require(_0xf980('0x3'));var BPromise=require(_0xf980('0x4'));var rp=require(_0xf980('0x5'));var fs=require('fs');var path=require(_0xf980('0x6'));var rimraf=require(_0xf980('0x7'));var config=require('../../config/environment');var attributes=require(_0xf980('0x8'));module[_0xf980('0x9')]=function(_0x1b8e95,_0x49227c){return _0x1b8e95[_0xf980('0xa')](_0xf980('0xb'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd685=['define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x531b74,_0x3a473b){var _0x513d17=function(_0x2ea644){while(--_0x2ea644){_0x531b74['push'](_0x531b74['shift']());}};_0x513d17(++_0x3a473b);}(_0xd685,0xfa));var _0x5d68=function(_0x18cec9,_0x329fef){_0x18cec9=_0x18cec9-0x0;var _0x49cd57=_0xd685[_0x18cec9];return _0x49cd57;};'use strict';var _=require(_0x5d68('0x0'));var util=require(_0x5d68('0x1'));var logger=require(_0x5d68('0x2'))(_0x5d68('0x3'));var moment=require('moment');var BPromise=require(_0x5d68('0x4'));var rp=require(_0x5d68('0x5'));var fs=require('fs');var path=require(_0x5d68('0x6'));var rimraf=require(_0x5d68('0x7'));var config=require(_0x5d68('0x8'));var attributes=require('./cmContactHasItem.attributes');module[_0x5d68('0x9')]=function(_0xf06c7b,_0x1a2638){return _0xf06c7b[_0x5d68('0xa')](_0x5d68('0xb'),attributes,{'tableName':_0x5d68('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index cda7606..94e6cc0 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 _0xc1c4=['../../config/environment','jayson/promise','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','error','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1a06b1,_0x5e42a7){var _0x5f3460=function(_0x39fb61){while(--_0x39fb61){_0x1a06b1['push'](_0x1a06b1['shift']());}};_0x5f3460(++_0x5e42a7);}(_0xc1c4,0x1c0));var _0x4c1c=function(_0x3cf3e6,_0x5a1b8a){_0x3cf3e6=_0x3cf3e6-0x0;var _0x2dbafb=_0xc1c4[_0x3cf3e6];return _0x2dbafb;};'use strict';var _=require('lodash');var util=require(_0x4c1c('0x0'));var moment=require(_0x4c1c('0x1'));var BPromise=require(_0x4c1c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c1c('0x3'));var db=require(_0x4c1c('0x4'))['db'];var utils=require(_0x4c1c('0x5'));var logger=require(_0x4c1c('0x6'))(_0x4c1c('0x7'));var config=require(_0x4c1c('0x8'));var jayson=require(_0x4c1c('0x9'));var client=jayson[_0x4c1c('0xa')][_0x4c1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5aa3b4,_0x322b57,_0x1e1621){return new BPromise(function(_0x4fba55,_0x3e9395){return client[_0x4c1c('0xc')](_0x5aa3b4,_0x1e1621)['then'](function(_0x5c75c1){logger[_0x4c1c('0xd')](_0x4c1c('0xe'),_0x322b57,_0x4c1c('0xf'));logger['debug']('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x322b57,_0x4c1c('0xf'),JSON['stringify'](_0x5c75c1));if(_0x5c75c1['error']){if(_0x5c75c1[_0x4c1c('0x10')]['code']===0x1f4){logger['error'](_0x4c1c('0xe'),_0x322b57,_0x5c75c1['error'][_0x4c1c('0x11')]);return _0x3e9395(_0x5c75c1[_0x4c1c('0x10')][_0x4c1c('0x11')]);}logger[_0x4c1c('0x10')](_0x4c1c('0xe'),_0x322b57,_0x5c75c1[_0x4c1c('0x10')][_0x4c1c('0x11')]);return _0x4fba55(_0x5c75c1[_0x4c1c('0x10')]['message']);}else{logger[_0x4c1c('0xd')](_0x4c1c('0xe'),_0x322b57,_0x4c1c('0xf'));_0x4fba55(_0x5c75c1[_0x4c1c('0x12')]['message']);}})['catch'](function(_0x11dcbf){logger[_0x4c1c('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x322b57,_0x11dcbf);_0x3e9395(_0x11dcbf);});});} \ No newline at end of file +var _0x334c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','bluebird','randomstring'];(function(_0x1f15d4,_0x547ee1){var _0x407670=function(_0x5d622a){while(--_0x5d622a){_0x1f15d4['push'](_0x1f15d4['shift']());}};_0x407670(++_0x547ee1);}(_0x334c,0x1c8));var _0xc334=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0x334c[_0x402731];return _0x111736;};'use strict';var _=require(_0xc334('0x0'));var util=require(_0xc334('0x1'));var moment=require('moment');var BPromise=require(_0xc334('0x2'));var rs=require(_0xc334('0x3'));var fs=require('fs');var Redis=require(_0xc334('0x4'));var db=require(_0xc334('0x5'))['db'];var utils=require(_0xc334('0x6'));var logger=require(_0xc334('0x7'))(_0xc334('0x8'));var config=require(_0xc334('0x9'));var jayson=require(_0xc334('0xa'));var client=jayson[_0xc334('0xb')][_0xc334('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b8152,_0xfc8932,_0x4cb23a){return new BPromise(function(_0x150835,_0x4cb445){return client[_0xc334('0xd')](_0x2b8152,_0x4cb23a)[_0xc334('0xe')](function(_0x146d1a){logger['info'](_0xc334('0xf'),_0xfc8932,_0xc334('0x10'));logger['debug'](_0xc334('0x11'),_0xfc8932,_0xc334('0x10'),JSON[_0xc334('0x12')](_0x146d1a));if(_0x146d1a[_0xc334('0x13')]){if(_0x146d1a[_0xc334('0x13')]['code']===0x1f4){logger[_0xc334('0x13')](_0xc334('0xf'),_0xfc8932,_0x146d1a[_0xc334('0x13')]['message']);return _0x4cb445(_0x146d1a[_0xc334('0x13')][_0xc334('0x14')]);}logger[_0xc334('0x13')](_0xc334('0xf'),_0xfc8932,_0x146d1a[_0xc334('0x13')][_0xc334('0x14')]);return _0x150835(_0x146d1a[_0xc334('0x13')][_0xc334('0x14')]);}else{logger[_0xc334('0x15')]('CmContactHasItem,\x20%s,\x20%s',_0xfc8932,_0xc334('0x10'));_0x150835(_0x146d1a[_0xc334('0x16')][_0xc334('0x14')]);}})['catch'](function(_0x268bc5){logger['error'](_0xc334('0xf'),_0xfc8932,_0x268bc5);_0x4cb445(_0x268bc5);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index d559e8a..12f510e 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 _0x96bf=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','index','get','show','post','create','put','update','delete','/:id'];(function(_0x302a92,_0x340cf1){var _0x35da48=function(_0x489f32){while(--_0x489f32){_0x302a92['push'](_0x302a92['shift']());}};_0x35da48(++_0x340cf1);}(_0x96bf,0x13d));var _0xf96b=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0x96bf[_0x249d99];return _0x5bfb05;};'use strict';var multer=require('multer');var util=require(_0xf96b('0x0'));var path=require(_0xf96b('0x1'));var timeout=require(_0xf96b('0x2'));var express=require(_0xf96b('0x3'));var router=express['Router']();var fs_extra=require(_0xf96b('0x4'));var auth=require(_0xf96b('0x5'));var interaction=require(_0xf96b('0x6'));var config=require(_0xf96b('0x7'));var controller=require(_0xf96b('0x8'));router['get']('/',auth[_0xf96b('0x9')](),controller[_0xf96b('0xa')]);router[_0xf96b('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xf96b('0xc')]);router[_0xf96b('0xd')]('/',auth['isAuthenticated'](),controller[_0xf96b('0xe')]);router[_0xf96b('0xf')]('/:id',auth[_0xf96b('0x9')](),controller[_0xf96b('0x10')]);router[_0xf96b('0x11')](_0xf96b('0x12'),auth[_0xf96b('0x9')](),controller[_0xf96b('0x13')]);module[_0xf96b('0x14')]=router; \ No newline at end of file +var _0x6e70=['index','get','/:id','post','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated'];(function(_0x36d911,_0x1e7545){var _0x5b39f5=function(_0x5867d1){while(--_0x5867d1){_0x36d911['push'](_0x36d911['shift']());}};_0x5b39f5(++_0x1e7545);}(_0x6e70,0xc5));var _0x06e7=function(_0x16eb31,_0x46d27e){_0x16eb31=_0x16eb31-0x0;var _0x2f964d=_0x6e70[_0x16eb31];return _0x2f964d;};'use strict';var multer=require(_0x06e7('0x0'));var util=require(_0x06e7('0x1'));var path=require(_0x06e7('0x2'));var timeout=require(_0x06e7('0x3'));var express=require(_0x06e7('0x4'));var router=express[_0x06e7('0x5')]();var fs_extra=require(_0x06e7('0x6'));var auth=require(_0x06e7('0x7'));var interaction=require(_0x06e7('0x8'));var config=require(_0x06e7('0x9'));var controller=require(_0x06e7('0xa'));router['get']('/',auth[_0x06e7('0xb')](),controller[_0x06e7('0xc')]);router[_0x06e7('0xd')](_0x06e7('0xe'),auth[_0x06e7('0xb')](),controller['show']);router[_0x06e7('0xf')]('/',auth[_0x06e7('0xb')](),controller['create']);router[_0x06e7('0x10')](_0x06e7('0xe'),auth[_0x06e7('0xb')](),controller[_0x06e7('0x11')]);router['delete'](_0x06e7('0xe'),auth['isAuthenticated'](),controller[_0x06e7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index fe309d5..3cb85eb 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 _0x58a2=['getDataValue','alias','setDataValue','name','STRING','TEXT','type','parse','values','isArray','stringify','BOOLEAN','voice','sequelize'];(function(_0x59de2b,_0x30279a){var _0x2f7cb8=function(_0x48fd2d){while(--_0x48fd2d){_0x59de2b['push'](_0x59de2b['shift']());}};_0x2f7cb8(++_0x30279a);}(_0x58a2,0x109));var _0x258a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x58a2[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x258a('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x197b6d){return this[_0x258a('0x1')](_0x258a('0x2'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x35f62a){this[_0x258a('0x3')]('alias',_0x35f62a?_0x35f62a:this['getDataValue'](_0x258a('0x4')));}},'type':{'type':Sequelize[_0x258a('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x258a('0x6')]('long'),'get':function(){if(this[_0x258a('0x1')](_0x258a('0x7'))==='select'){return JSON[_0x258a('0x8')](this[_0x258a('0x1')]('values'));}else{return this[_0x258a('0x1')](_0x258a('0x9'));}},'set':function(_0x57af0d){if(Array[_0x258a('0xa')](_0x57af0d)){this[_0x258a('0x3')]('values',JSON[_0x258a('0xb')](_0x57af0d));}else{this[_0x258a('0x3')](_0x258a('0x9'),_0x57af0d);}}},'required':{'type':Sequelize[_0x258a('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x258a('0xd'))}}; \ No newline at end of file +var _0xf898=['lodash','exports','getDataValue','STRING','setDataValue','alias','name','TEXT','long','select','parse','values','isArray','stringify','ENUM','voice','sequelize'];(function(_0x1df3e5,_0x2d37f1){var _0x422d0c=function(_0x51d43f){while(--_0x51d43f){_0x1df3e5['push'](_0x1df3e5['shift']());}};_0x422d0c(++_0x2d37f1);}(_0xf898,0x120));var _0x8f89=function(_0x24caa7,_0x543f4e){_0x24caa7=_0x24caa7-0x0;var _0x6b9e1e=_0xf898[_0x24caa7];return _0x6b9e1e;};'use strict';var Sequelize=require(_0x8f89('0x0'));var _=require(_0x8f89('0x1'));module[_0x8f89('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x189cab){return this[_0x8f89('0x3')]('alias');}},'alias':{'type':Sequelize[_0x8f89('0x4')],'allowNull':![],'set':function(_0x477030){this[_0x8f89('0x5')](_0x8f89('0x6'),_0x477030?_0x477030:this[_0x8f89('0x3')](_0x8f89('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x8f89('0x8')](_0x8f89('0x9')),'get':function(){if(this['getDataValue']('type')===_0x8f89('0xa')){return JSON[_0x8f89('0xb')](this[_0x8f89('0x3')](_0x8f89('0xc')));}else{return this[_0x8f89('0x3')](_0x8f89('0xc'));}},'set':function(_0xf12681){if(Array[_0x8f89('0xd')](_0xf12681)){this[_0x8f89('0x5')](_0x8f89('0xc'),JSON[_0x8f89('0xe')](_0xf12681));}else{this[_0x8f89('0x5')](_0x8f89('0xc'),_0xf12681);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x8f89('0xf')](_0x8f89('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 5f12e0a..00eee7e 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 _0x1fbb=['pick','merge','VIRTUAL','filter','CmCustomField','rows','catch','params','includeAll','options','find','body','destroy','sequelize','Sequelize','TEXT','number','INTEGER','queryInterface','cm_contacts','format','cf_%d','eml-format','zip-dir','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x1fbb,0xb4));var _0xb1fb=function(_0x5ee4ec,_0x2e3a75){_0x5ee4ec=_0x5ee4ec-0x0;var _0x50596c=_0x1fbb[_0x5ee4ec];return _0x50596c;};'use strict';var emlformat=require(_0xb1fb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb1fb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1fb('0x2'));var moment=require(_0xb1fb('0x3'));var BPromise=require(_0xb1fb('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb1fb('0x5'));var ejs=require(_0xb1fb('0x6'));var fs=require('fs');var fs_extra=require(_0xb1fb('0x7'));var _=require(_0xb1fb('0x8'));var squel=require(_0xb1fb('0x9'));var crypto=require(_0xb1fb('0xa'));var jsforce=require(_0xb1fb('0xb'));var deskjs=require(_0xb1fb('0xc'));var toCsv=require(_0xb1fb('0x5'));var querystring=require(_0xb1fb('0xd'));var Papa=require(_0xb1fb('0xe'));var Redis=require('ioredis');var authService=require(_0xb1fb('0xf'));var qs=require(_0xb1fb('0x10'));var as=require(_0xb1fb('0x11'));var hardwareService=require(_0xb1fb('0x12'));var logger=require(_0xb1fb('0x13'))(_0xb1fb('0x14'));var utils=require(_0xb1fb('0x15'));var config=require(_0xb1fb('0x16'));var licenseUtil=require(_0xb1fb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ea612,_0x368779){_0x368779=_0x368779||0xcc;return function(_0x12c60f){if(_0x12c60f){return _0x3ea612['sendStatus'](_0x368779);}return _0x3ea612['status'](_0x368779)['end']();};}function respondWithResult(_0x13ba62,_0x532ab5){_0x532ab5=_0x532ab5||0xc8;return function(_0x3d91a4){if(_0x3d91a4){return _0x13ba62['status'](_0x532ab5)[_0xb1fb('0x18')](_0x3d91a4);}};}function respondWithFilteredResult(_0xefd4bc,_0x16bd87){return function(_0x3e58f4){if(_0x3e58f4){var _0xb291d9=typeof _0x16bd87['offset']===_0xb1fb('0x19')&&typeof _0x16bd87[_0xb1fb('0x1a')]===_0xb1fb('0x19');var _0x599d8b=_0x3e58f4[_0xb1fb('0x1b')];var _0x196ec3=_0xb291d9?0x0:_0x16bd87['offset'];var _0x323f6a=_0xb291d9?_0x3e58f4[_0xb1fb('0x1b')]:_0x16bd87[_0xb1fb('0x1c')]+_0x16bd87[_0xb1fb('0x1a')];var _0x7153ab;if(_0x323f6a>=_0x599d8b){_0x323f6a=_0x599d8b;_0x7153ab=0xc8;}else{_0x7153ab=0xce;}_0xefd4bc[_0xb1fb('0x1d')](_0x7153ab);return _0xefd4bc[_0xb1fb('0x1e')](_0xb1fb('0x1f'),_0x196ec3+'-'+_0x323f6a+'/'+_0x599d8b)[_0xb1fb('0x18')](_0x3e58f4);}return null;};}function patchUpdates(_0x541ae5){return function(_0x175e36){try{jsonpatch[_0xb1fb('0x20')](_0x175e36,_0x541ae5,!![]);}catch(_0x5e7237){return BPromise[_0xb1fb('0x21')](_0x5e7237);}return _0x175e36[_0xb1fb('0x22')]();};}function saveUpdates(_0x2b20dd,_0x1f84cf){return function(_0x52243b){if(_0x52243b){return _0x52243b[_0xb1fb('0x23')](_0x2b20dd)['then'](function(_0x4f98f5){return _0x4f98f5;});}return null;};}function removeEntity(_0x47191a,_0x31ceb6){return function(_0x1eee37){if(_0x1eee37){return _0x1eee37['destroy']()[_0xb1fb('0x24')](function(){_0x47191a[_0xb1fb('0x1d')](0xcc)[_0xb1fb('0x25')]();});}};}function handleEntityNotFound(_0x3663bd,_0x31fff9){return function(_0x19a638){if(!_0x19a638){_0x3663bd[_0xb1fb('0x26')](0x194);}return _0x19a638;};}function handleError(_0x478d51,_0x583451){_0x583451=_0x583451||0x1f4;return function(_0x33965f){logger[_0xb1fb('0x27')](_0x33965f[_0xb1fb('0x28')]);if(_0x33965f[_0xb1fb('0x29')]){delete _0x33965f[_0xb1fb('0x29')];}_0x478d51[_0xb1fb('0x1d')](_0x583451)['send'](_0x33965f);};}exports['index']=function(_0xfce393,_0x1b31e6){var _0x420837={},_0x4b7555={},_0x4a82bb={'count':0x0,'rows':[]};var _0x5f05d6=_['map'](db['CmCustomField'][_0xb1fb('0x2a')],function(_0x47cddf){return{'name':_0x47cddf[_0xb1fb('0x2b')],'type':_0x47cddf[_0xb1fb('0x2c')][_0xb1fb('0x2d')]};});_0x4b7555[_0xb1fb('0x2e')]=_['differenceBy'](_[_0xb1fb('0x2f')](_0x5f05d6,_0xb1fb('0x29')),[_0xb1fb('0x29')]);_0x4b7555[_0xb1fb('0x30')]=_[_0xb1fb('0x31')](_0xfce393[_0xb1fb('0x30')]);_0x4b7555[_0xb1fb('0x32')]=_[_0xb1fb('0x33')](_0x4b7555[_0xb1fb('0x2e')],_0x4b7555[_0xb1fb('0x30')]);_0x420837[_0xb1fb('0x34')]=_[_0xb1fb('0x33')](_0x4b7555['model'],qs[_0xb1fb('0x35')](_0xfce393[_0xb1fb('0x30')]['fields']));_0x420837['attributes']=_0x420837['attributes'][_0xb1fb('0x36')]?_0x420837['attributes']:_0x4b7555[_0xb1fb('0x2e')];if(!_0xfce393['query']['hasOwnProperty']('nolimit')){_0x420837['limit']=qs['limit'](_0xfce393['query'][_0xb1fb('0x1a')]);_0x420837[_0xb1fb('0x1c')]=qs[_0xb1fb('0x1c')](_0xfce393[_0xb1fb('0x30')][_0xb1fb('0x1c')]);}_0x420837['order']=qs[_0xb1fb('0x37')](_0xfce393[_0xb1fb('0x30')]['sort']);_0x420837[_0xb1fb('0x38')]=qs[_0xb1fb('0x32')](_[_0xb1fb('0x39')](_0xfce393[_0xb1fb('0x30')],_0x4b7555[_0xb1fb('0x32')]),_0x5f05d6);if(_0xfce393['query']['filter']){_0x420837[_0xb1fb('0x38')]=_[_0xb1fb('0x3a')](_0x420837[_0xb1fb('0x38')],{'$or':_[_0xb1fb('0x2f')](_0x5f05d6,function(_0x23590f){if(_0x23590f[_0xb1fb('0x2c')]!==_0xb1fb('0x3b')){var _0x3bbdcf={};_0x3bbdcf[_0x23590f[_0xb1fb('0x29')]]={'$like':'%'+_0xfce393[_0xb1fb('0x30')][_0xb1fb('0x3c')]+'%'};return _0x3bbdcf;}})});}_0x420837=_[_0xb1fb('0x3a')]({},_0x420837,_0xfce393['options']);var _0x272a7c={'where':_0x420837[_0xb1fb('0x38')]};return db[_0xb1fb('0x3d')][_0xb1fb('0x1b')](_0x272a7c)[_0xb1fb('0x24')](function(_0x476f92){_0x4a82bb[_0xb1fb('0x1b')]=_0x476f92;if(_0xfce393['query']['includeAll']){_0x420837['include']=[{'all':!![]}];}return db[_0xb1fb('0x3d')]['findAll'](_0x420837);})['then'](function(_0x4707e9){_0x4a82bb[_0xb1fb('0x3e')]=_0x4707e9;return _0x4a82bb;})[_0xb1fb('0x24')](respondWithFilteredResult(_0x1b31e6,_0x420837))[_0xb1fb('0x3f')](handleError(_0x1b31e6,null));};exports['show']=function(_0x4c6309,_0x558b6e){var _0x20ee01={'raw':!![],'where':{'id':_0x4c6309[_0xb1fb('0x40')]['id']}},_0x4bb5ec={};_0x4bb5ec[_0xb1fb('0x2e')]=_[_0xb1fb('0x31')](db[_0xb1fb('0x3d')][_0xb1fb('0x2a')]);_0x4bb5ec[_0xb1fb('0x30')]=_['keys'](_0x4c6309[_0xb1fb('0x30')]);_0x4bb5ec['filters']=_[_0xb1fb('0x33')](_0x4bb5ec[_0xb1fb('0x2e')],_0x4bb5ec[_0xb1fb('0x30')]);_0x20ee01[_0xb1fb('0x34')]=_[_0xb1fb('0x33')](_0x4bb5ec[_0xb1fb('0x2e')],qs[_0xb1fb('0x35')](_0x4c6309['query'][_0xb1fb('0x35')]));_0x20ee01[_0xb1fb('0x34')]=_0x20ee01[_0xb1fb('0x34')][_0xb1fb('0x36')]?_0x20ee01[_0xb1fb('0x34')]:_0x4bb5ec['model'];if(_0x4c6309[_0xb1fb('0x30')][_0xb1fb('0x41')]){_0x20ee01['include']=[{'all':!![]}];}_0x20ee01=_['merge']({},_0x20ee01,_0x4c6309[_0xb1fb('0x42')]);return db[_0xb1fb('0x3d')][_0xb1fb('0x43')](_0x20ee01)[_0xb1fb('0x24')](handleEntityNotFound(_0x558b6e,null))[_0xb1fb('0x24')](respondWithResult(_0x558b6e,null))[_0xb1fb('0x3f')](handleError(_0x558b6e,null));};exports[_0xb1fb('0x23')]=function(_0x3289e2,_0x56750c){if(_0x3289e2[_0xb1fb('0x44')]['id']){delete _0x3289e2[_0xb1fb('0x44')]['id'];}return db[_0xb1fb('0x3d')][_0xb1fb('0x43')]({'where':{'id':_0x3289e2[_0xb1fb('0x40')]['id']}})[_0xb1fb('0x24')](handleEntityNotFound(_0x56750c,null))[_0xb1fb('0x24')](saveUpdates(_0x3289e2[_0xb1fb('0x44')],null))[_0xb1fb('0x24')](respondWithResult(_0x56750c,null))['catch'](handleError(_0x56750c,null));};exports[_0xb1fb('0x45')]=function(_0x2b1b51,_0xac14cb){return db['CmCustomField']['find']({'where':{'id':_0x2b1b51[_0xb1fb('0x40')]['id']}})[_0xb1fb('0x24')](handleEntityNotFound(_0xac14cb,null))['then'](removeEntity(_0xac14cb,null))[_0xb1fb('0x3f')](handleError(_0xac14cb,null));};exports['create']=function(_0x3ec9a4,_0x1d8fc8){var _0x3b0a85;return db[_0xb1fb('0x46')]['transaction'](function(_0x7699b9){return db['CmCustomField']['create'](_0x3ec9a4[_0xb1fb('0x44')],{'transaction':_0x7699b9})[_0xb1fb('0x24')](function(_0x564c40){_0x3b0a85=_0x564c40;var _0x57f179={'type':db[_0xb1fb('0x47')][_0xb1fb('0x48')],'transaction':_0x7699b9};switch(_0x3ec9a4['body'][_0xb1fb('0x2c')]){case'text':_0x57f179['type']=db[_0xb1fb('0x47')]['TEXT'];break;case _0xb1fb('0x49'):_0x57f179[_0xb1fb('0x2c')]=db[_0xb1fb('0x47')][_0xb1fb('0x4a')];break;case'switch':_0x57f179[_0xb1fb('0x2c')]=db[_0xb1fb('0x47')]['BOOLEAN'];_0x57f179['defaultValue']=![];break;default:}return db[_0xb1fb('0x46')][_0xb1fb('0x4b')]['addColumn'](_0xb1fb('0x4c'),util[_0xb1fb('0x4d')](_0xb1fb('0x4e'),_0x3b0a85['id']),_0x57f179);})[_0xb1fb('0x24')](function(){return _0x3b0a85;});})[_0xb1fb('0x24')](respondWithResult(_0x1d8fc8,0xc9))[_0xb1fb('0x3f')](handleError(_0x1d8fc8,null));}; \ No newline at end of file +var _0x744a=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','CmCustomField','rawAttributes','model','differenceBy','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','merge','find','catch','body','params','create','sequelize','Sequelize','TEXT','type','text','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring'];(function(_0x3ff2ad,_0x1612be){var _0x298994=function(_0x95482a){while(--_0x95482a){_0x3ff2ad['push'](_0x3ff2ad['shift']());}};_0x298994(++_0x1612be);}(_0x744a,0x186));var _0xa744=function(_0x43a8b4,_0xf106c8){_0x43a8b4=_0x43a8b4-0x0;var _0xfc42ee=_0x744a[_0x43a8b4];return _0xfc42ee;};'use strict';var emlformat=require(_0xa744('0x0'));var rimraf=require(_0xa744('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa744('0x2'));var rp=require('request-promise');var moment=require(_0xa744('0x3'));var BPromise=require(_0xa744('0x4'));var Mustache=require(_0xa744('0x5'));var util=require(_0xa744('0x6'));var path=require('path');var sox=require(_0xa744('0x7'));var csv=require(_0xa744('0x8'));var ejs=require(_0xa744('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa744('0xa'));var squel=require(_0xa744('0xb'));var crypto=require(_0xa744('0xc'));var jsforce=require(_0xa744('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa744('0x8'));var querystring=require(_0xa744('0xe'));var Papa=require('papaparse');var Redis=require(_0xa744('0xf'));var authService=require(_0xa744('0x10'));var qs=require(_0xa744('0x11'));var as=require(_0xa744('0x12'));var hardwareService=require(_0xa744('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa744('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x574899,_0x331914){_0x331914=_0x331914||0xcc;return function(_0x3c4e60){if(_0x3c4e60){return _0x574899[_0xa744('0x15')](_0x331914);}return _0x574899['status'](_0x331914)['end']();};}function respondWithResult(_0x8e1c7a,_0x24749a){_0x24749a=_0x24749a||0xc8;return function(_0xe4140e){if(_0xe4140e){return _0x8e1c7a[_0xa744('0x16')](_0x24749a)[_0xa744('0x17')](_0xe4140e);}};}function respondWithFilteredResult(_0x437ac6,_0x5b712c){return function(_0x102c95){if(_0x102c95){var _0x2c14e9=typeof _0x5b712c[_0xa744('0x18')]===_0xa744('0x19')&&typeof _0x5b712c[_0xa744('0x1a')]===_0xa744('0x19');var _0x3cd136=_0x102c95['count'];var _0x4a4d7d=_0x2c14e9?0x0:_0x5b712c[_0xa744('0x18')];var _0x84cf57=_0x2c14e9?_0x102c95[_0xa744('0x1b')]:_0x5b712c[_0xa744('0x18')]+_0x5b712c[_0xa744('0x1a')];var _0x145999;if(_0x84cf57>=_0x3cd136){_0x84cf57=_0x3cd136;_0x145999=0xc8;}else{_0x145999=0xce;}_0x437ac6[_0xa744('0x16')](_0x145999);return _0x437ac6[_0xa744('0x1c')](_0xa744('0x1d'),_0x4a4d7d+'-'+_0x84cf57+'/'+_0x3cd136)['json'](_0x102c95);}return null;};}function patchUpdates(_0x3825fb){return function(_0x2892dc){try{jsonpatch[_0xa744('0x1e')](_0x2892dc,_0x3825fb,!![]);}catch(_0x17f0ed){return BPromise[_0xa744('0x1f')](_0x17f0ed);}return _0x2892dc['save']();};}function saveUpdates(_0x5488b0,_0x27c818){return function(_0x485b48){if(_0x485b48){return _0x485b48[_0xa744('0x20')](_0x5488b0)['then'](function(_0x2ca80e){return _0x2ca80e;});}return null;};}function removeEntity(_0x24905b,_0x58aed5){return function(_0x4638e6){if(_0x4638e6){return _0x4638e6[_0xa744('0x21')]()[_0xa744('0x22')](function(){_0x24905b[_0xa744('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c9147,_0x2c1c5e){return function(_0x18c552){if(!_0x18c552){_0x4c9147[_0xa744('0x15')](0x194);}return _0x18c552;};}function handleError(_0x47c48a,_0x5978b4){_0x5978b4=_0x5978b4||0x1f4;return function(_0x32633b){logger[_0xa744('0x23')](_0x32633b[_0xa744('0x24')]);if(_0x32633b['name']){delete _0x32633b[_0xa744('0x25')];}_0x47c48a['status'](_0x5978b4)[_0xa744('0x26')](_0x32633b);};}exports[_0xa744('0x27')]=function(_0x3bfb3b,_0xa6ab54){var _0x48c69c={},_0x136a26={},_0x75004={'count':0x0,'rows':[]};var _0x1898db=_['map'](db[_0xa744('0x28')][_0xa744('0x29')],function(_0x3bf9b3){return{'name':_0x3bf9b3['fieldName'],'type':_0x3bf9b3['type']['key']};});_0x136a26[_0xa744('0x2a')]=_[_0xa744('0x2b')](_[_0xa744('0x2c')](_0x1898db,_0xa744('0x25')),[_0xa744('0x25')]);_0x136a26[_0xa744('0x2d')]=_[_0xa744('0x2e')](_0x3bfb3b[_0xa744('0x2d')]);_0x136a26[_0xa744('0x2f')]=_[_0xa744('0x30')](_0x136a26[_0xa744('0x2a')],_0x136a26[_0xa744('0x2d')]);_0x48c69c['attributes']=_[_0xa744('0x30')](_0x136a26[_0xa744('0x2a')],qs[_0xa744('0x31')](_0x3bfb3b[_0xa744('0x2d')]['fields']));_0x48c69c[_0xa744('0x32')]=_0x48c69c[_0xa744('0x32')][_0xa744('0x33')]?_0x48c69c[_0xa744('0x32')]:_0x136a26[_0xa744('0x2a')];if(!_0x3bfb3b[_0xa744('0x2d')][_0xa744('0x34')]('nolimit')){_0x48c69c['limit']=qs['limit'](_0x3bfb3b['query']['limit']);_0x48c69c[_0xa744('0x18')]=qs[_0xa744('0x18')](_0x3bfb3b[_0xa744('0x2d')][_0xa744('0x18')]);}_0x48c69c[_0xa744('0x35')]=qs[_0xa744('0x36')](_0x3bfb3b[_0xa744('0x2d')][_0xa744('0x36')]);_0x48c69c[_0xa744('0x37')]=qs[_0xa744('0x2f')](_[_0xa744('0x38')](_0x3bfb3b[_0xa744('0x2d')],_0x136a26[_0xa744('0x2f')]),_0x1898db);if(_0x3bfb3b[_0xa744('0x2d')][_0xa744('0x39')]){_0x48c69c['where']=_['merge'](_0x48c69c[_0xa744('0x37')],{'$or':_[_0xa744('0x2c')](_0x1898db,function(_0x4b785e){if(_0x4b785e['type']!==_0xa744('0x3a')){var _0x566aed={};_0x566aed[_0x4b785e[_0xa744('0x25')]]={'$like':'%'+_0x3bfb3b['query'][_0xa744('0x39')]+'%'};return _0x566aed;}})});}_0x48c69c=_['merge']({},_0x48c69c,_0x3bfb3b[_0xa744('0x3b')]);var _0x580c38={'where':_0x48c69c['where']};return db[_0xa744('0x28')]['count'](_0x580c38)['then'](function(_0x5255e6){_0x75004['count']=_0x5255e6;if(_0x3bfb3b[_0xa744('0x2d')][_0xa744('0x3c')]){_0x48c69c[_0xa744('0x3d')]=[{'all':!![]}];}return db[_0xa744('0x28')]['findAll'](_0x48c69c);})[_0xa744('0x22')](function(_0x114120){_0x75004['rows']=_0x114120;return _0x75004;})[_0xa744('0x22')](respondWithFilteredResult(_0xa6ab54,_0x48c69c))['catch'](handleError(_0xa6ab54,null));};exports['show']=function(_0x527b89,_0xc9099e){var _0x3345b4={'raw':!![],'where':{'id':_0x527b89['params']['id']}},_0x30a968={};_0x30a968[_0xa744('0x2a')]=_['keys'](db[_0xa744('0x28')][_0xa744('0x29')]);_0x30a968[_0xa744('0x2d')]=_[_0xa744('0x2e')](_0x527b89['query']);_0x30a968[_0xa744('0x2f')]=_[_0xa744('0x30')](_0x30a968[_0xa744('0x2a')],_0x30a968[_0xa744('0x2d')]);_0x3345b4[_0xa744('0x32')]=_[_0xa744('0x30')](_0x30a968[_0xa744('0x2a')],qs[_0xa744('0x31')](_0x527b89['query'][_0xa744('0x31')]));_0x3345b4[_0xa744('0x32')]=_0x3345b4[_0xa744('0x32')][_0xa744('0x33')]?_0x3345b4[_0xa744('0x32')]:_0x30a968[_0xa744('0x2a')];if(_0x527b89[_0xa744('0x2d')]['includeAll']){_0x3345b4[_0xa744('0x3d')]=[{'all':!![]}];}_0x3345b4=_[_0xa744('0x3e')]({},_0x3345b4,_0x527b89['options']);return db[_0xa744('0x28')][_0xa744('0x3f')](_0x3345b4)['then'](handleEntityNotFound(_0xc9099e,null))[_0xa744('0x22')](respondWithResult(_0xc9099e,null))[_0xa744('0x40')](handleError(_0xc9099e,null));};exports[_0xa744('0x20')]=function(_0x488202,_0x484c00){if(_0x488202[_0xa744('0x41')]['id']){delete _0x488202['body']['id'];}return db[_0xa744('0x28')][_0xa744('0x3f')]({'where':{'id':_0x488202[_0xa744('0x42')]['id']}})[_0xa744('0x22')](handleEntityNotFound(_0x484c00,null))[_0xa744('0x22')](saveUpdates(_0x488202[_0xa744('0x41')],null))['then'](respondWithResult(_0x484c00,null))['catch'](handleError(_0x484c00,null));};exports[_0xa744('0x21')]=function(_0x4a24ef,_0x575840){return db[_0xa744('0x28')][_0xa744('0x3f')]({'where':{'id':_0x4a24ef['params']['id']}})[_0xa744('0x22')](handleEntityNotFound(_0x575840,null))[_0xa744('0x22')](removeEntity(_0x575840,null))[_0xa744('0x40')](handleError(_0x575840,null));};exports[_0xa744('0x43')]=function(_0x3e9078,_0x2a3bc7){var _0x1ed9b5;return db[_0xa744('0x44')]['transaction'](function(_0x2242ca){return db['CmCustomField'][_0xa744('0x43')](_0x3e9078[_0xa744('0x41')],{'transaction':_0x2242ca})[_0xa744('0x22')](function(_0x5a9453){_0x1ed9b5=_0x5a9453;var _0x3e87e1={'type':db[_0xa744('0x45')][_0xa744('0x46')],'transaction':_0x2242ca};switch(_0x3e9078[_0xa744('0x41')][_0xa744('0x47')]){case _0xa744('0x48'):_0x3e87e1[_0xa744('0x47')]=db[_0xa744('0x45')][_0xa744('0x46')];break;case _0xa744('0x49'):_0x3e87e1[_0xa744('0x47')]=db['Sequelize'][_0xa744('0x4a')];break;case _0xa744('0x4b'):_0x3e87e1[_0xa744('0x47')]=db[_0xa744('0x45')][_0xa744('0x4c')];_0x3e87e1['defaultValue']=![];break;default:}return db['sequelize'][_0xa744('0x4d')][_0xa744('0x4e')](_0xa744('0x4f'),util['format'](_0xa744('0x50'),_0x1ed9b5['id']),_0x3e87e1);})['then'](function(){return _0x1ed9b5;});})['then'](respondWithResult(_0x2a3bc7,0xc9))[_0xa744('0x40')](handleError(_0x2a3bc7,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 46f2aa2..32a6d40 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 _0xdc69=['cm_custom_fields','lodash','util','api','bluebird','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField'];(function(_0x21be45,_0x590a37){var _0x9d02eb=function(_0x479d71){while(--_0x479d71){_0x21be45['push'](_0x21be45['shift']());}};_0x9d02eb(++_0x590a37);}(_0xdc69,0x17d));var _0x9dc6=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0xdc69[_0x3fc97b];return _0x3a0c82;};'use strict';var _=require(_0x9dc6('0x0'));var util=require(_0x9dc6('0x1'));var logger=require('../../config/logger')(_0x9dc6('0x2'));var moment=require('moment');var BPromise=require(_0x9dc6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9dc6('0x4'));var config=require(_0x9dc6('0x5'));var attributes=require(_0x9dc6('0x6'));module[_0x9dc6('0x7')]=function(_0x2d09d6,_0x2c21c5){return _0x2d09d6['define'](_0x9dc6('0x8'),attributes,{'tableName':_0x9dc6('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaeff=['CmCustomField','cm_custom_fields','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xaeff,0x1f1));var _0xfaef=function(_0x4c5e20,_0x87e375){_0x4c5e20=_0x4c5e20-0x0;var _0x24e25a=_0xaeff[_0x4c5e20];return _0x24e25a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfaef('0x0'))(_0xfaef('0x1'));var moment=require('moment');var BPromise=require(_0xfaef('0x2'));var rp=require(_0xfaef('0x3'));var fs=require('fs');var path=require(_0xfaef('0x4'));var rimraf=require('rimraf');var config=require(_0xfaef('0x5'));var attributes=require(_0xfaef('0x6'));module[_0xfaef('0x7')]=function(_0x17d2bc,_0xacf570){return _0x17d2bc[_0xfaef('0x8')](_0xfaef('0x9'),attributes,{'tableName':_0xfaef('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 390c5d4..4892ebb 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 _0x2334=['lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify','code','error','CmCustomField,\x20%s,\x20%s','message','result','catch'];(function(_0x12833b,_0x26c1d2){var _0x3acad3=function(_0x2f9ec9){while(--_0x2f9ec9){_0x12833b['push'](_0x12833b['shift']());}};_0x3acad3(++_0x26c1d2);}(_0x2334,0x17a));var _0x4233=function(_0x3a0f77,_0x39f605){_0x3a0f77=_0x3a0f77-0x0;var _0x54fd0c=_0x2334[_0x3a0f77];return _0x54fd0c;};'use strict';var _=require(_0x4233('0x0'));var util=require(_0x4233('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4233('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4233('0x3'))['db'];var utils=require(_0x4233('0x4'));var logger=require(_0x4233('0x5'))(_0x4233('0x6'));var config=require(_0x4233('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4233('0x8')][_0x4233('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ddb39,_0x427f60,_0x4f43ae){return new BPromise(function(_0x38fa69,_0x3452e6){return client[_0x4233('0xa')](_0x5ddb39,_0x4f43ae)[_0x4233('0xb')](function(_0x4903eb){logger[_0x4233('0xc')]('CmCustomField,\x20%s,\x20%s',_0x427f60,'request\x20sent');logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x427f60,_0x4233('0xd'),JSON[_0x4233('0xe')](_0x4903eb));if(_0x4903eb['error']){if(_0x4903eb['error'][_0x4233('0xf')]===0x1f4){logger[_0x4233('0x10')](_0x4233('0x11'),_0x427f60,_0x4903eb[_0x4233('0x10')][_0x4233('0x12')]);return _0x3452e6(_0x4903eb[_0x4233('0x10')]['message']);}logger[_0x4233('0x10')](_0x4233('0x11'),_0x427f60,_0x4903eb['error'][_0x4233('0x12')]);return _0x38fa69(_0x4903eb['error'][_0x4233('0x12')]);}else{logger[_0x4233('0xc')](_0x4233('0x11'),_0x427f60,_0x4233('0xd'));_0x38fa69(_0x4903eb[_0x4233('0x13')]['message']);}})[_0x4233('0x14')](function(_0x5d8bd){logger[_0x4233('0x10')](_0x4233('0x11'),_0x427f60,_0x5d8bd);_0x3452e6(_0x5d8bd);});});} \ No newline at end of file +var _0x0005=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x4738eb,_0x3d38a5){var _0x250cc9=function(_0x262f9f){while(--_0x262f9f){_0x4738eb['push'](_0x4738eb['shift']());}};_0x250cc9(++_0x3d38a5);}(_0x0005,0x12b));var _0x5000=function(_0x407dd0,_0x335163){_0x407dd0=_0x407dd0-0x0;var _0x466ee4=_0x0005[_0x407dd0];return _0x466ee4;};'use strict';var _=require(_0x5000('0x0'));var util=require(_0x5000('0x1'));var moment=require(_0x5000('0x2'));var BPromise=require(_0x5000('0x3'));var rs=require(_0x5000('0x4'));var fs=require('fs');var Redis=require(_0x5000('0x5'));var db=require(_0x5000('0x6'))['db'];var utils=require(_0x5000('0x7'));var logger=require('../../config/logger')(_0x5000('0x8'));var config=require(_0x5000('0x9'));var jayson=require(_0x5000('0xa'));var client=jayson[_0x5000('0xb')][_0x5000('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x367714,_0x3cf993,_0x5cbb66){return new BPromise(function(_0x560ca1,_0x5c902b){return client[_0x5000('0xd')](_0x367714,_0x5cbb66)[_0x5000('0xe')](function(_0x38473a){logger[_0x5000('0xf')](_0x5000('0x10'),_0x3cf993,_0x5000('0x11'));logger[_0x5000('0x12')](_0x5000('0x13'),_0x3cf993,'request\x20sent',JSON['stringify'](_0x38473a));if(_0x38473a[_0x5000('0x14')]){if(_0x38473a[_0x5000('0x14')][_0x5000('0x15')]===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x3cf993,_0x38473a[_0x5000('0x14')]['message']);return _0x5c902b(_0x38473a['error'][_0x5000('0x16')]);}logger[_0x5000('0x14')]('CmCustomField,\x20%s,\x20%s',_0x3cf993,_0x38473a[_0x5000('0x14')]['message']);return _0x560ca1(_0x38473a[_0x5000('0x14')][_0x5000('0x16')]);}else{logger[_0x5000('0xf')]('CmCustomField,\x20%s,\x20%s',_0x3cf993,'request\x20sent');_0x560ca1(_0x38473a[_0x5000('0x17')]['message']);}})[_0x5000('0x18')](function(_0x38fb16){logger[_0x5000('0x14')](_0x5000('0x10'),_0x3cf993,_0x38fb16);_0x5c902b(_0x38fb16);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 5b67c90..d9ff04d 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 _0x848e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x136a83,_0x1b1ace){var _0x54528b=function(_0x104768){while(--_0x104768){_0x136a83['push'](_0x136a83['shift']());}};_0x54528b(++_0x1b1ace);}(_0x848e,0x1e2));var _0xe848=function(_0x89aedf,_0x3f9fe3){_0x89aedf=_0x89aedf-0x0;var _0x53e5cb=_0x848e[_0x89aedf];return _0x53e5cb;};'use strict';var multer=require(_0xe848('0x0'));var util=require('util');var path=require(_0xe848('0x1'));var timeout=require(_0xe848('0x2'));var express=require('express');var router=express[_0xe848('0x3')]();var fs_extra=require(_0xe848('0x4'));var auth=require(_0xe848('0x5'));var interaction=require(_0xe848('0x6'));var config=require(_0xe848('0x7'));var controller=require(_0xe848('0x8'));router[_0xe848('0x9')]('/',auth[_0xe848('0xa')](),controller['index']);router[_0xe848('0x9')](_0xe848('0xb'),auth[_0xe848('0xa')](),controller['show']);router['post']('/',auth[_0xe848('0xa')](),controller[_0xe848('0xc')]);router[_0xe848('0xd')](_0xe848('0xb'),auth['isAuthenticated'](),controller[_0xe848('0xe')]);router[_0xe848('0xf')]('/:id',auth[_0xe848('0xa')](),controller[_0xe848('0x10')]);module[_0xe848('0x11')]=router; \ No newline at end of file +var _0x6808=['index','/:id','create','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated'];(function(_0x214d8f,_0xcf9d27){var _0x32eb9c=function(_0x5a1ea7){while(--_0x5a1ea7){_0x214d8f['push'](_0x214d8f['shift']());}};_0x32eb9c(++_0xcf9d27);}(_0x6808,0xd1));var _0x8680=function(_0x2948d7,_0x1a9438){_0x2948d7=_0x2948d7-0x0;var _0x476117=_0x6808[_0x2948d7];return _0x476117;};'use strict';var multer=require(_0x8680('0x0'));var util=require(_0x8680('0x1'));var path=require(_0x8680('0x2'));var timeout=require(_0x8680('0x3'));var express=require(_0x8680('0x4'));var router=express[_0x8680('0x5')]();var fs_extra=require(_0x8680('0x6'));var auth=require(_0x8680('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8680('0x8'));var controller=require(_0x8680('0x9'));router[_0x8680('0xa')]('/',auth[_0x8680('0xb')](),controller[_0x8680('0xc')]);router['get'](_0x8680('0xd'),auth[_0x8680('0xb')](),controller['show']);router['post']('/',auth[_0x8680('0xb')](),controller[_0x8680('0xe')]);router['put'](_0x8680('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8680('0xd'),auth[_0x8680('0xb')](),controller[_0x8680('0xf')]);module[_0x8680('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 18e3210..717f393 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 _0xf7dd=['BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','STRING'];(function(_0x240021,_0x3f4eb8){var _0x395455=function(_0x84c402){while(--_0x84c402){_0x240021['push'](_0x240021['shift']());}};_0x395455(++_0x3f4eb8);}(_0xf7dd,0x10b));var _0xdf7d=function(_0x279c80,_0x3c9692){_0x279c80=_0x279c80-0x0;var _0x4e1f5c=_0xf7dd[_0x279c80];return _0x4e1f5c;};'use strict';var moment=require(_0xdf7d('0x0'));var Sequelize=require(_0xdf7d('0x1'));module['exports']={'phone':{'type':Sequelize[_0xdf7d('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xdf7d('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xdf7d('0x4')],'defaultValue':moment()['format'](_0xdf7d('0x5'))},'countbusyretry':{'type':Sequelize[_0xdf7d('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdf7d('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdf7d('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xdf7d('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdf7d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xdf7d('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xdf7d('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xdf7d('0x6')],'unique':_0xdf7d('0x8')},'ListId':{'type':Sequelize[_0xdf7d('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xdf7d('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xdf7d('0x6')],'unique':_0xdf7d('0x8')},'CampaignId':{'type':Sequelize[_0xdf7d('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xdf7d('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdf7d('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdf7d('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdf7d('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xdf7d('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xdf7d('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xdf7d('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xfcfa=['UNSIGNED','contactListQueue','STRING','moment','sequelize','BOOLEAN','DATE','INTEGER'];(function(_0x225c51,_0x2c3c07){var _0xcb0c6e=function(_0x4464fd){while(--_0x4464fd){_0x225c51['push'](_0x225c51['shift']());}};_0xcb0c6e(++_0x2c3c07);}(_0xfcfa,0x14b));var _0xafcf=function(_0x1b7833,_0x1f3690){_0x1b7833=_0x1b7833-0x0;var _0x38c145=_0xfcfa[_0x1b7833];return _0x38c145;};'use strict';var moment=require(_0xafcf('0x0'));var Sequelize=require(_0xafcf('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xafcf('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xafcf('0x3')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xafcf('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xafcf('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xafcf('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xafcf('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xafcf('0x3')]},'priority':{'type':Sequelize[_0xafcf('0x4')](0x2)[_0xafcf('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xafcf('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xafcf('0x6')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xafcf('0x6')},'UserId':{'type':Sequelize[_0xafcf('0x4')]},'VoiceQueueId':{'type':Sequelize[_0xafcf('0x4')],'unique':_0xafcf('0x6')},'CampaignId':{'type':Sequelize[_0xafcf('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xafcf('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xafcf('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xafcf('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xafcf('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xafcf('0x4')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xafcf('0x4')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xafcf('0x7')]},'recallmeNotifiedDate':{'type':Sequelize[_0xafcf('0x3')],'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 74aa818..fe9fe92 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 _0xab86=['calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','CmContact','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','sequelize','literal','priority','DESC','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','phone','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','update','getPreviewRecall','transaction','findOne','Company','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','timezones','push','utcOffset','moment','lodash','../../components/parsers/qs','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$like','$iLike','$notILike','$any','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','CmHopper','includeAll','findAll','rows','catch','show','keys','include','options','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil'];(function(_0x5a2c7b,_0x441265){var _0x3ad931=function(_0x3a3b19){while(--_0x3a3b19){_0x5a2c7b['push'](_0x5a2c7b['shift']());}};_0x3ad931(++_0x441265);}(_0xab86,0x13e));var _0x6ab8=function(_0x19b872,_0xb4de35){_0x19b872=_0x19b872-0x0;var _0xda669b=_0xab86[_0x19b872];return _0xda669b;};'use strict';var moment=require(_0x6ab8('0x0'));var _=require(_0x6ab8('0x1'));var qs=require(_0x6ab8('0x2'));var logger=require('../../config/logger')('api');var shared=require(_0x6ab8('0x3'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x1193a1,_0x48cb6a){_0x48cb6a=_0x48cb6a||0xc8;return function(_0xf27ba7){if(_0xf27ba7){return _0x1193a1[_0x6ab8('0x4')](_0x48cb6a)[_0x6ab8('0x5')](_0xf27ba7);}};}function respondWithFilteredResult(_0x154d17,_0x6f41f){return function(_0x265771){if(_0x265771){var _0x2b6295=typeof _0x6f41f[_0x6ab8('0x6')]===_0x6ab8('0x7')&&typeof _0x6f41f[_0x6ab8('0x8')]===_0x6ab8('0x7');var _0x20f27b=_0x265771[_0x6ab8('0x9')];var _0x5127eb=_0x2b6295?0x0:_0x6f41f['offset'];var _0x383594=_0x2b6295?_0x265771['count']:_0x6f41f[_0x6ab8('0x6')]+_0x6f41f[_0x6ab8('0x8')];var _0x139c0f;if(_0x383594>=_0x20f27b){_0x383594=_0x20f27b;_0x139c0f=0xc8;}else{_0x139c0f=0xce;}_0x154d17['status'](_0x139c0f);return _0x154d17[_0x6ab8('0xa')](_0x6ab8('0xb'),_0x5127eb+'-'+_0x383594+'/'+_0x20f27b)['json'](_0x265771);}return null;};}function saveUpdates(_0x44d1d9,_0x1b9b34){return function(_0x408ce1){if(_0x408ce1){return _0x408ce1['update'](_0x44d1d9)[_0x6ab8('0xc')](function(_0x42b74e){return _0x42b74e;});}return null;};}function handleEntityNotFound(_0x60b50,_0x968bac){return function(_0x1c83a1){if(!_0x1c83a1){_0x60b50[_0x6ab8('0xd')](0x194);}return _0x1c83a1;};}function handleError(_0x1c6402,_0x2043bb){_0x2043bb=_0x2043bb||0x1f4;return function(_0x293389){logger['error'](_0x293389[_0x6ab8('0xe')]);if(_0x293389[_0x6ab8('0xf')]){delete _0x293389[_0x6ab8('0xf')];}_0x1c6402['status'](_0x2043bb)[_0x6ab8('0x10')](_0x293389);};}exports[_0x6ab8('0x11')]=function(_0x50cd9f,_0x543726){var _0x35e92f={},_0x57cd18={},_0x41792d={'count':0x0,'rows':[]};var _0x292b36=_[_0x6ab8('0x12')](db['CmHopper'][_0x6ab8('0x13')],function(_0x3de5b3){return{'name':_0x3de5b3[_0x6ab8('0x14')],'type':_0x3de5b3[_0x6ab8('0x15')]['key']};});_0x57cd18[_0x6ab8('0x16')]=_[_0x6ab8('0x12')](_0x292b36,'name');_0x57cd18['query']=_['keys'](_0x50cd9f[_0x6ab8('0x17')]);_0x57cd18[_0x6ab8('0x18')]=_[_0x6ab8('0x19')](_0x57cd18['model'],_0x57cd18[_0x6ab8('0x17')]);_0x57cd18[_0x6ab8('0x18')]=_['concat'](_0x57cd18['filters'],[_0x6ab8('0x1a'),_0x6ab8('0x1b'),'$gt',_0x6ab8('0x1c'),_0x6ab8('0x1d'),_0x6ab8('0x1e'),_0x6ab8('0x1f'),_0x6ab8('0x20'),_0x6ab8('0x21'),_0x6ab8('0x22'),_0x6ab8('0x23'),'$in','$notIn',_0x6ab8('0x24'),'$notLike',_0x6ab8('0x25'),_0x6ab8('0x26'),_0x6ab8('0x24'),'$overlap','$contains','$contained',_0x6ab8('0x27')]);_0x35e92f[_0x6ab8('0x28')]=_[_0x6ab8('0x19')](_0x57cd18[_0x6ab8('0x16')],qs[_0x6ab8('0x29')](_0x50cd9f[_0x6ab8('0x17')][_0x6ab8('0x29')]));_0x35e92f[_0x6ab8('0x28')]=_0x35e92f[_0x6ab8('0x28')][_0x6ab8('0x2a')]?_0x35e92f[_0x6ab8('0x28')]:_0x57cd18[_0x6ab8('0x16')];if(!_0x50cd9f[_0x6ab8('0x17')]['hasOwnProperty']('nolimit')){_0x35e92f[_0x6ab8('0x8')]=qs['limit'](_0x50cd9f['query'][_0x6ab8('0x8')]);_0x35e92f[_0x6ab8('0x6')]=qs['offset'](_0x50cd9f[_0x6ab8('0x17')]['offset']);}_0x35e92f[_0x6ab8('0x2b')]=qs[_0x6ab8('0x2c')](_0x50cd9f['query']['sort']);_0x35e92f[_0x6ab8('0x2d')]=qs[_0x6ab8('0x18')](_[_0x6ab8('0x2e')](_0x50cd9f[_0x6ab8('0x17')],_0x57cd18[_0x6ab8('0x18')]),_0x292b36);if(_0x50cd9f[_0x6ab8('0x17')][_0x6ab8('0x2f')]){_0x35e92f[_0x6ab8('0x2d')]=_['merge'](_0x35e92f[_0x6ab8('0x2d')],{'$or':_[_0x6ab8('0x12')](_0x292b36,function(_0x3e6761){if(_0x3e6761[_0x6ab8('0x15')]!==_0x6ab8('0x30')){var _0x26f699={};_0x26f699[_0x3e6761['name']]={'$like':'%'+_0x50cd9f[_0x6ab8('0x17')][_0x6ab8('0x2f')]+'%'};return _0x26f699;}})});}_0x35e92f=_[_0x6ab8('0x31')]({},_0x35e92f,_0x50cd9f['options']);var _0x51111d={'where':_0x35e92f[_0x6ab8('0x2d')]};return db[_0x6ab8('0x32')][_0x6ab8('0x9')](_0x51111d)[_0x6ab8('0xc')](function(_0x14fdc5){_0x41792d['count']=_0x14fdc5;if(_0x50cd9f['query'][_0x6ab8('0x33')]){_0x35e92f['include']=[{'all':!![]}];}return db[_0x6ab8('0x32')][_0x6ab8('0x34')](_0x35e92f);})['then'](function(_0x47c9f9){_0x41792d[_0x6ab8('0x35')]=_0x47c9f9;return _0x41792d;})[_0x6ab8('0xc')](respondWithFilteredResult(_0x543726,_0x35e92f))[_0x6ab8('0x36')](handleError(_0x543726,null));};exports[_0x6ab8('0x37')]=function(_0x2e7fc9,_0x319ada){var _0xef0ce5={'raw':!![],'where':{'id':_0x2e7fc9['params']['id']}},_0x5aa6e5={};_0x5aa6e5[_0x6ab8('0x16')]=_[_0x6ab8('0x38')](db[_0x6ab8('0x32')][_0x6ab8('0x13')]);_0x5aa6e5['query']=_[_0x6ab8('0x38')](_0x2e7fc9['query']);_0x5aa6e5['filters']=_[_0x6ab8('0x19')](_0x5aa6e5[_0x6ab8('0x16')],_0x5aa6e5[_0x6ab8('0x17')]);_0xef0ce5[_0x6ab8('0x28')]=_[_0x6ab8('0x19')](_0x5aa6e5[_0x6ab8('0x16')],qs[_0x6ab8('0x29')](_0x2e7fc9[_0x6ab8('0x17')][_0x6ab8('0x29')]));_0xef0ce5[_0x6ab8('0x28')]=_0xef0ce5[_0x6ab8('0x28')][_0x6ab8('0x2a')]?_0xef0ce5['attributes']:_0x5aa6e5[_0x6ab8('0x16')];if(_0x2e7fc9[_0x6ab8('0x17')][_0x6ab8('0x33')]){_0xef0ce5[_0x6ab8('0x39')]=[{'all':!![]}];}_0xef0ce5=_['merge']({},_0xef0ce5,_0x2e7fc9[_0x6ab8('0x3a')]);return db['CmHopper'][_0x6ab8('0x3b')](_0xef0ce5)[_0x6ab8('0xc')](handleEntityNotFound(_0x319ada,null))['then'](respondWithResult(_0x319ada,null))[_0x6ab8('0x36')](handleError(_0x319ada,null));};exports[_0x6ab8('0x3c')]=function(_0x4b6593,_0x328a19){return db[_0x6ab8('0x32')][_0x6ab8('0x3c')](_0x4b6593[_0x6ab8('0x3d')],{})[_0x6ab8('0xc')](respondWithResult(_0x328a19,0xc9))['catch'](handleError(_0x328a19,null));};exports['update']=function(_0x51a764,_0x408886){if(_0x51a764[_0x6ab8('0x3d')]['id']){delete _0x51a764['body']['id'];}return db[_0x6ab8('0x32')][_0x6ab8('0x3b')]({'where':{'id':_0x51a764[_0x6ab8('0x3e')]['id']}})[_0x6ab8('0xc')](handleEntityNotFound(_0x408886,null))[_0x6ab8('0xc')](saveUpdates(_0x51a764[_0x6ab8('0x3d')],null))['then'](respondWithResult(_0x408886,null))[_0x6ab8('0x36')](handleError(_0x408886,null));};exports[_0x6ab8('0x3f')]=function(_0x4b00cc,_0x266026){return db[_0x6ab8('0x32')][_0x6ab8('0x3f')]()['then'](respondWithResult(_0x266026,null))['catch'](handleError(_0x266026,null));};exports[_0x6ab8('0x40')]=function(_0x4c27fa,_0x31965e){var _0x5270c3;var _0x214b8e=_0x4c27fa[_0x6ab8('0x3e')]['id'];return db[_0x6ab8('0x32')][_0x6ab8('0x3b')]({'where':{'id':_0x4c27fa[_0x6ab8('0x3e')]['id']}})[_0x6ab8('0xc')](handleEntityNotFound(_0x31965e,null))['then'](function(_0x5e63ec){if(_0x5e63ec){return _0x5e63ec['destroy']()[_0x6ab8('0xc')](function(_0x54708b){return _0x54708b;});}})[_0x6ab8('0xc')](function(_0x3cacb8){_0x5270c3=_0x3cacb8;if(_0x3cacb8){if(_0x3cacb8[_0x6ab8('0x41')]||_0x3cacb8[_0x6ab8('0x42')]){return db[_0x3cacb8[_0x6ab8('0x41')]?_0x6ab8('0x43'):_0x6ab8('0x44')][_0x6ab8('0x3b')]({'where':{'id':_0x3cacb8['VoiceQueueId']?_0x3cacb8[_0x6ab8('0x41')]:_0x3cacb8[_0x6ab8('0x42')]},'attributes':['id',_0x6ab8('0xf')],'raw':!![]});}}})[_0x6ab8('0xc')](function(_0x5af74c){var _0x619b55={};if(_0x5af74c){_[_0x6ab8('0x31')](_0x619b55,_[_0x6ab8('0x45')](_0x5270c3[_0x6ab8('0x46')],[_0x6ab8('0x47'),_0x6ab8('0x48'),'id']));_0x619b55[_0x6ab8('0x49')]=0x15;_0x619b55[_0x6ab8('0x4a')]='deleted';_0x619b55[_0x6ab8('0x4b')]=_0x5af74c[_0x6ab8('0xf')];_0x619b55['membername']=_0x4c27fa[_0x6ab8('0x4c')][_0x6ab8('0xf')];_0x619b55[_0x6ab8('0x4d')]=_0x4c27fa[_0x6ab8('0x4c')]['id'];_0x619b55[_0x6ab8('0x4e')]=!![];_0x619b55[_0x6ab8('0x4f')]=moment()[_0x6ab8('0x50')](_0x6ab8('0x51'));_0x619b55[_0x6ab8('0x52')]=_0x5270c3['phone'];_0x619b55[_0x6ab8('0x53')]=_0x5270c3[_0x6ab8('0x41')]?_0x6ab8('0x54'):_0x6ab8('0x55');return db['CmContact']['find']({'where':{'id':_0x619b55[_0x6ab8('0x56')]},'attributes':[_0x6ab8('0x57'),_0x6ab8('0x58')]})[_0x6ab8('0xc')](function(_0x17afee){if(!_[_0x6ab8('0x59')](_0x31965e)&&!_[_0x6ab8('0x59')](_0x17afee[_0x6ab8('0x57')])){_0x619b55[_0x6ab8('0x5a')]=_0x17afee[_0x6ab8('0x57')];if(!_['isNil'](_0x17afee['lastName'])){_0x619b55['calleridname']+='\x20'+_0x17afee[_0x6ab8('0x58')];}}})[_0x6ab8('0x5b')](function(){return db[_0x6ab8('0x5c')]['create'](_0x619b55);});}})[_0x6ab8('0xc')](function(_0x399537){return db[_0x6ab8('0x5d')][_0x6ab8('0x40')]({'where':{'CmHopperId':_0x214b8e}});})[_0x6ab8('0xc')](function(){return _0x31965e['status'](0xcc)[_0x6ab8('0x5e')]();})['catch'](handleError(_0x31965e,null));};exports[_0x6ab8('0x5f')]=function(_0x209d12,_0x2ea704){var _0x5ab635=[];return db[_0x6ab8('0x60')][_0x6ab8('0x3f')]()[_0x6ab8('0xc')](function(_0xd4519c){_0x5ab635=_['keys'](_0xd4519c);return _0x209d12[_0x6ab8('0x4c')][_0x6ab8('0x61')]({'where':{'type':_0x6ab8('0x62'),'dialActive':!![],'dialMethod':_0x6ab8('0x63')},'attributes':['id','dialOrderByScheduledAt',_0x6ab8('0x64')],'raw':!![]});})[_0x6ab8('0xc')](function(_0x4c5cee){if(_0x4c5cee&&_0x4c5cee[_0x6ab8('0x2a')]){return db['sequelize']['transaction'](function(_0x35da58){var _0x3d81d3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6ab8('0x50')](_0x6ab8('0x51'))},'VoiceQueueId':{'$in':_['map'](_0x4c5cee,'id')},'$or':[{'UserId':null},{'UserId':_0x209d12[_0x6ab8('0x4c')]['id']}]};var _0x47fbcb={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4c5cee)[_0x6ab8('0x2f')]([_0x6ab8('0x64'),0x0])[_0x6ab8('0x12')]('id')[_0x6ab8('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x209d12[_0x6ab8('0x4c')]['id']}]};var _0x2af78f={'$or':[_0x3d81d3,_0x47fbcb]};var _0x2cde24=[];if(_0x209d12['body'][_0x6ab8('0x66')]&&_0x209d12['body'][_0x6ab8('0x66')]===_0x6ab8('0x67')){if(!_[_0x6ab8('0x68')](_0x209d12[_0x6ab8('0x3d')][_0x6ab8('0x69')])){_0x2af78f['id']={'$in':_0x209d12['body'][_0x6ab8('0x69')]};}_0x2cde24=[['priority',_0x6ab8('0x6a')],[_0x6ab8('0x6b'),_0x4c5cee[0x0]['dialOrderByScheduledAt']==='ASC'?'DESC':'ASC'],db[_0x6ab8('0x6c')][_0x6ab8('0x6d')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x6ab8('0x68')](_0x209d12['body']['hopperIds'])){_0x2af78f['id']={'$notIn':_0x209d12[_0x6ab8('0x3d')][_0x6ab8('0x69')]};}_0x2cde24=[[_0x6ab8('0x6e'),_0x6ab8('0x6f')],[_0x6ab8('0x6b'),_0x4c5cee[0x0][_0x6ab8('0x70')]],db[_0x6ab8('0x6c')][_0x6ab8('0x6d')](_0x6ab8('0x71')),['id','ASC']];}return db[_0x6ab8('0x32')]['findOne']({'attributes':['id',_0x6ab8('0x72'),_0x6ab8('0x73'),_0x6ab8('0x74')],'where':_0x2af78f,'order':_0x2cde24,'transaction':_0x35da58,'lock':_0x35da58[_0x6ab8('0x75')][_0x6ab8('0x76')],'include':[{'model':db['CmContact'],'as':_0x6ab8('0x77'),'attributes':_0x5ab635,'include':[{'model':db[_0x6ab8('0x78')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x6ab8('0x79')],'as':_0x6ab8('0x7a'),'attributes':['id',_0x6ab8('0xf')]},{'model':db[_0x6ab8('0x43')],'as':_0x6ab8('0x7b'),'attributes':['id','name','dialActive']}]})['then'](function(_0x202a9b){if(_0x202a9b){return _0x202a9b[_0x6ab8('0x7c')]({'UserId':_0x209d12[_0x6ab8('0x4c')]['id']},{'transaction':_0x35da58});}});});}})['then'](handleEntityNotFound(_0x2ea704,null))[_0x6ab8('0xc')](respondWithResult(_0x2ea704,null))[_0x6ab8('0x36')](handleError(_0x2ea704,null));};exports[_0x6ab8('0x7d')]=function(_0x248205,_0x4f82d5,_0x47ad06){var _0x2c4aab=[];var _0x17fde9=_0x248205[_0x6ab8('0x3e')]['id'];var _0x4ddc94=_0x248205[_0x6ab8('0x4c')]['id'];return db['CmContact'][_0x6ab8('0x3f')]()['then'](function(_0x598ca5){_0x2c4aab=_['keys'](_0x598ca5);return db['sequelize'][_0x6ab8('0x7e')](function(_0x16a6e4){const _0x51abcd={'id':_0x17fde9};return db['CmHopper'][_0x6ab8('0x7f')]({'attributes':['id','scheduledat',_0x6ab8('0x74')],'where':_0x51abcd,'transaction':_0x16a6e4,'lock':_0x16a6e4[_0x6ab8('0x75')][_0x6ab8('0x76')],'include':[{'model':db['CmContact'],'as':_0x6ab8('0x77'),'attributes':_0x2c4aab,'include':[{'model':db[_0x6ab8('0x78')],'as':_0x6ab8('0x80'),'attributes':['id',_0x6ab8('0xf')]}]},{'model':db[_0x6ab8('0x79')],'as':_0x6ab8('0x7a'),'attributes':['id',_0x6ab8('0xf')]},{'model':db[_0x6ab8('0x43')],'as':_0x6ab8('0x7b'),'attributes':['id','name',_0x6ab8('0x81')]}]})[_0x6ab8('0xc')](function(_0x237fed){if(_0x237fed){return _0x237fed[_0x6ab8('0x7c')]({'UserId':_0x4ddc94},{'transaction':_0x16a6e4});}});});})[_0x6ab8('0xc')](handleEntityNotFound(_0x4f82d5,null))[_0x6ab8('0xc')](respondWithResult(_0x4f82d5,null))[_0x6ab8('0x36')](handleError(_0x4f82d5,null));};exports[_0x6ab8('0x82')]=function(_0x3b1c90,_0x48ceea){return _0x3b1c90[_0x6ab8('0x4c')][_0x6ab8('0x61')]({'where':{'type':_0x6ab8('0x62'),'dialActive':!![],'dialMethod':_0x6ab8('0x63')},'attributes':['id'],'raw':!![]})['then'](function(_0x4f53c2){if(_0x4f53c2&&_0x4f53c2['length']){return db[_0x6ab8('0x32')][_0x6ab8('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6ab8('0x50')](_0x6ab8('0x51'))},'VoiceQueueId':{'$in':_[_0x6ab8('0x12')](_0x4f53c2,'id')},'$or':[{'UserId':null},{'UserId':_0x3b1c90[_0x6ab8('0x4c')]['id']}]}});}return 0x0;})[_0x6ab8('0xc')](function(_0x3ce36c){if(!_[_0x6ab8('0x59')](_0x3ce36c)&&_[_0x6ab8('0x83')](_0x3ce36c)){return _0x48ceea[_0x6ab8('0x4')](0xc8)[_0x6ab8('0x5')]({'contacts':_0x3ce36c});}else{logger['error'](_0x6ab8('0x84'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x48ceea['sendStatus'](0x194);}})[_0x6ab8('0x36')](handleError(_0x48ceea,null));};exports['getTimezones']=function(_0x35045f,_0x40276f){var _0x5e30d0=shared[_0x6ab8('0x85')];var _0x17c6ea=[];_[_0x6ab8('0x12')](_0x5e30d0,function(_0x126714){_0x17c6ea[_0x6ab8('0x86')]({'id':_0x126714[_0x6ab8('0xf')],'name':_0x126714[_0x6ab8('0xf')],'utcOffset':_0x126714[_0x6ab8('0x87')]});});return _0x40276f[_0x6ab8('0x4')](0xc8)[_0x6ab8('0x5')]({'tz':_0x17c6ea});};exports['getTimezone']=function(_0x2f8c09,_0x58ba1b){var _0x2b07af=shared[_0x6ab8('0x85')];var _0x5984cd={};if(!_[_0x6ab8('0x59')](_0x2b07af[_0x2f8c09[_0x6ab8('0x3d')]['id']]))_0x5984cd=_0x2b07af[_0x2f8c09[_0x6ab8('0x3d')]['id']];return _0x58ba1b[_0x6ab8('0x4')](0xc8)[_0x6ab8('0x5')](_0x5984cd);}; \ No newline at end of file +var _0x5fd1=['createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','format','calleridnum','campaigntype','queue','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','transaction','YYYY-MM-DD\x20HH:mm:ss','dialPreviewAutoRecallMe','value','direction','isEmpty','hopperIds','priority','ASC','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','CmCompany','Company','CmList','List','getPreviewRecall','UPDATE','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','push','utcOffset','getTimezone','timezones','moment','../../components/parsers/qs','../../config/logger','api','json','undefined','limit','count','offset','status','set','Content-Range','update','sendStatus','error','stack','index','map','CmHopper','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','concat','$and','$or','$gt','$lt','$ne','$eq','$not','$notBetween','$in','$notIn','$notLike','$notILike','$like','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','then','include','rows','show','params','keys','length','find','catch','create','body','describe','destroy','VoiceQueue','Campaign','VoiceQueueId','CampaignId','omit'];(function(_0x2b44f6,_0x3632e2){var _0x446f1e=function(_0x5a43db){while(--_0x5a43db){_0x2b44f6['push'](_0x2b44f6['shift']());}};_0x446f1e(++_0x3632e2);}(_0x5fd1,0x155));var _0x15fd=function(_0x14b62f,_0x580872){_0x14b62f=_0x14b62f-0x0;var _0x247fdb=_0x5fd1[_0x14b62f];return _0x247fdb;};'use strict';var moment=require(_0x15fd('0x0'));var _=require('lodash');var qs=require(_0x15fd('0x1'));var logger=require(_0x15fd('0x2'))(_0x15fd('0x3'));var shared=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithResult(_0x370d34,_0x3138f3){_0x3138f3=_0x3138f3||0xc8;return function(_0x411b0e){if(_0x411b0e){return _0x370d34['status'](_0x3138f3)[_0x15fd('0x4')](_0x411b0e);}};}function respondWithFilteredResult(_0x386441,_0x18450c){return function(_0x2e88bf){if(_0x2e88bf){var _0x225728=typeof _0x18450c['offset']===_0x15fd('0x5')&&typeof _0x18450c[_0x15fd('0x6')]===_0x15fd('0x5');var _0x4c861f=_0x2e88bf[_0x15fd('0x7')];var _0x5c9c63=_0x225728?0x0:_0x18450c[_0x15fd('0x8')];var _0x250457=_0x225728?_0x2e88bf['count']:_0x18450c['offset']+_0x18450c['limit'];var _0x3dd2af;if(_0x250457>=_0x4c861f){_0x250457=_0x4c861f;_0x3dd2af=0xc8;}else{_0x3dd2af=0xce;}_0x386441[_0x15fd('0x9')](_0x3dd2af);return _0x386441[_0x15fd('0xa')](_0x15fd('0xb'),_0x5c9c63+'-'+_0x250457+'/'+_0x4c861f)[_0x15fd('0x4')](_0x2e88bf);}return null;};}function saveUpdates(_0x2e18ec,_0x346ab1){return function(_0x2660db){if(_0x2660db){return _0x2660db[_0x15fd('0xc')](_0x2e18ec)['then'](function(_0x5b7af0){return _0x5b7af0;});}return null;};}function handleEntityNotFound(_0x5784a3,_0x3fda60){return function(_0x135a15){if(!_0x135a15){_0x5784a3[_0x15fd('0xd')](0x194);}return _0x135a15;};}function handleError(_0x29caad,_0x44eae6){_0x44eae6=_0x44eae6||0x1f4;return function(_0x2ffa03){logger[_0x15fd('0xe')](_0x2ffa03[_0x15fd('0xf')]);if(_0x2ffa03['name']){delete _0x2ffa03['name'];}_0x29caad[_0x15fd('0x9')](_0x44eae6)['send'](_0x2ffa03);};}exports[_0x15fd('0x10')]=function(_0x579ee2,_0x917fe4){var _0x318f47={},_0x855bae={},_0x49ceac={'count':0x0,'rows':[]};var _0x367c36=_[_0x15fd('0x11')](db[_0x15fd('0x12')][_0x15fd('0x13')],function(_0x2fb919){return{'name':_0x2fb919[_0x15fd('0x14')],'type':_0x2fb919[_0x15fd('0x15')][_0x15fd('0x16')]};});_0x855bae[_0x15fd('0x17')]=_[_0x15fd('0x11')](_0x367c36,_0x15fd('0x18'));_0x855bae['query']=_['keys'](_0x579ee2[_0x15fd('0x19')]);_0x855bae[_0x15fd('0x1a')]=_[_0x15fd('0x1b')](_0x855bae[_0x15fd('0x17')],_0x855bae[_0x15fd('0x19')]);_0x855bae[_0x15fd('0x1a')]=_[_0x15fd('0x1c')](_0x855bae['filters'],[_0x15fd('0x1d'),_0x15fd('0x1e'),_0x15fd('0x1f'),'$gte',_0x15fd('0x20'),'$lte',_0x15fd('0x21'),_0x15fd('0x22'),_0x15fd('0x23'),'$between',_0x15fd('0x24'),_0x15fd('0x25'),_0x15fd('0x26'),'$like',_0x15fd('0x27'),'$iLike',_0x15fd('0x28'),_0x15fd('0x29'),_0x15fd('0x2a'),_0x15fd('0x2b'),_0x15fd('0x2c'),_0x15fd('0x2d')]);_0x318f47[_0x15fd('0x2e')]=_[_0x15fd('0x1b')](_0x855bae[_0x15fd('0x17')],qs[_0x15fd('0x2f')](_0x579ee2[_0x15fd('0x19')]['fields']));_0x318f47[_0x15fd('0x2e')]=_0x318f47[_0x15fd('0x2e')]['length']?_0x318f47[_0x15fd('0x2e')]:_0x855bae[_0x15fd('0x17')];if(!_0x579ee2['query'][_0x15fd('0x30')](_0x15fd('0x31'))){_0x318f47['limit']=qs[_0x15fd('0x6')](_0x579ee2[_0x15fd('0x19')][_0x15fd('0x6')]);_0x318f47[_0x15fd('0x8')]=qs[_0x15fd('0x8')](_0x579ee2[_0x15fd('0x19')]['offset']);}_0x318f47[_0x15fd('0x32')]=qs[_0x15fd('0x33')](_0x579ee2[_0x15fd('0x19')][_0x15fd('0x33')]);_0x318f47['where']=qs[_0x15fd('0x1a')](_[_0x15fd('0x34')](_0x579ee2[_0x15fd('0x19')],_0x855bae[_0x15fd('0x1a')]),_0x367c36);if(_0x579ee2[_0x15fd('0x19')][_0x15fd('0x35')]){_0x318f47['where']=_[_0x15fd('0x36')](_0x318f47[_0x15fd('0x37')],{'$or':_['map'](_0x367c36,function(_0x3f9aec){if(_0x3f9aec[_0x15fd('0x15')]!==_0x15fd('0x38')){var _0x5cb227={};_0x5cb227[_0x3f9aec[_0x15fd('0x18')]]={'$like':'%'+_0x579ee2[_0x15fd('0x19')][_0x15fd('0x35')]+'%'};return _0x5cb227;}})});}_0x318f47=_[_0x15fd('0x36')]({},_0x318f47,_0x579ee2[_0x15fd('0x39')]);var _0x6b2ac8={'where':_0x318f47['where']};return db['CmHopper']['count'](_0x6b2ac8)[_0x15fd('0x3a')](function(_0x289710){_0x49ceac[_0x15fd('0x7')]=_0x289710;if(_0x579ee2['query']['includeAll']){_0x318f47[_0x15fd('0x3b')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x318f47);})['then'](function(_0x2edb0d){_0x49ceac[_0x15fd('0x3c')]=_0x2edb0d;return _0x49ceac;})[_0x15fd('0x3a')](respondWithFilteredResult(_0x917fe4,_0x318f47))['catch'](handleError(_0x917fe4,null));};exports[_0x15fd('0x3d')]=function(_0x3a10e2,_0xd85d3e){var _0x5beb6e={'raw':!![],'where':{'id':_0x3a10e2[_0x15fd('0x3e')]['id']}},_0x1d693e={};_0x1d693e[_0x15fd('0x17')]=_[_0x15fd('0x3f')](db[_0x15fd('0x12')][_0x15fd('0x13')]);_0x1d693e[_0x15fd('0x19')]=_[_0x15fd('0x3f')](_0x3a10e2[_0x15fd('0x19')]);_0x1d693e['filters']=_[_0x15fd('0x1b')](_0x1d693e[_0x15fd('0x17')],_0x1d693e[_0x15fd('0x19')]);_0x5beb6e[_0x15fd('0x2e')]=_[_0x15fd('0x1b')](_0x1d693e[_0x15fd('0x17')],qs[_0x15fd('0x2f')](_0x3a10e2[_0x15fd('0x19')][_0x15fd('0x2f')]));_0x5beb6e[_0x15fd('0x2e')]=_0x5beb6e[_0x15fd('0x2e')][_0x15fd('0x40')]?_0x5beb6e[_0x15fd('0x2e')]:_0x1d693e[_0x15fd('0x17')];if(_0x3a10e2[_0x15fd('0x19')]['includeAll']){_0x5beb6e[_0x15fd('0x3b')]=[{'all':!![]}];}_0x5beb6e=_[_0x15fd('0x36')]({},_0x5beb6e,_0x3a10e2[_0x15fd('0x39')]);return db[_0x15fd('0x12')][_0x15fd('0x41')](_0x5beb6e)[_0x15fd('0x3a')](handleEntityNotFound(_0xd85d3e,null))[_0x15fd('0x3a')](respondWithResult(_0xd85d3e,null))[_0x15fd('0x42')](handleError(_0xd85d3e,null));};exports['create']=function(_0x4cd97b,_0x21f448){return db['CmHopper'][_0x15fd('0x43')](_0x4cd97b[_0x15fd('0x44')],{})['then'](respondWithResult(_0x21f448,0xc9))[_0x15fd('0x42')](handleError(_0x21f448,null));};exports[_0x15fd('0xc')]=function(_0x131eb4,_0x2611ba){if(_0x131eb4[_0x15fd('0x44')]['id']){delete _0x131eb4[_0x15fd('0x44')]['id'];}return db['CmHopper'][_0x15fd('0x41')]({'where':{'id':_0x131eb4[_0x15fd('0x3e')]['id']}})[_0x15fd('0x3a')](handleEntityNotFound(_0x2611ba,null))[_0x15fd('0x3a')](saveUpdates(_0x131eb4[_0x15fd('0x44')],null))[_0x15fd('0x3a')](respondWithResult(_0x2611ba,null))[_0x15fd('0x42')](handleError(_0x2611ba,null));};exports[_0x15fd('0x45')]=function(_0x24cb44,_0x1d3beb){return db[_0x15fd('0x12')][_0x15fd('0x45')]()['then'](respondWithResult(_0x1d3beb,null))[_0x15fd('0x42')](handleError(_0x1d3beb,null));};exports['destroy']=function(_0x284f51,_0x34c250){var _0xeb1e06;var _0x5a1f32=_0x284f51[_0x15fd('0x3e')]['id'];return db[_0x15fd('0x12')][_0x15fd('0x41')]({'where':{'id':_0x284f51[_0x15fd('0x3e')]['id']}})['then'](handleEntityNotFound(_0x34c250,null))[_0x15fd('0x3a')](function(_0x1a9605){if(_0x1a9605){return _0x1a9605[_0x15fd('0x46')]()[_0x15fd('0x3a')](function(_0x4b6827){return _0x4b6827;});}})[_0x15fd('0x3a')](function(_0x322623){_0xeb1e06=_0x322623;if(_0x322623){if(_0x322623['VoiceQueueId']||_0x322623['CampaignId']){return db[_0x322623['VoiceQueueId']?_0x15fd('0x47'):_0x15fd('0x48')][_0x15fd('0x41')]({'where':{'id':_0x322623[_0x15fd('0x49')]?_0x322623[_0x15fd('0x49')]:_0x322623[_0x15fd('0x4a')]},'attributes':['id','name'],'raw':!![]});}}})[_0x15fd('0x3a')](function(_0x22cc14){var _0xbb16ef={};if(_0x22cc14){_['merge'](_0xbb16ef,_[_0x15fd('0x4b')](_0xeb1e06['dataValues'],[_0x15fd('0x4c'),_0x15fd('0x4d'),'id']));_0xbb16ef[_0x15fd('0x4e')]=0x15;_0xbb16ef[_0x15fd('0x4f')]=_0x15fd('0x50');_0xbb16ef[_0x15fd('0x51')]=_0x22cc14[_0x15fd('0x18')];_0xbb16ef[_0x15fd('0x52')]=_0x284f51[_0x15fd('0x53')][_0x15fd('0x18')];_0xbb16ef[_0x15fd('0x54')]=_0x284f51[_0x15fd('0x53')]['id'];_0xbb16ef[_0x15fd('0x50')]=!![];_0xbb16ef['deletedat']=moment()[_0x15fd('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0xbb16ef[_0x15fd('0x56')]=_0xeb1e06['phone'];_0xbb16ef[_0x15fd('0x57')]=_0xeb1e06[_0x15fd('0x49')]?_0x15fd('0x58'):'ivr';return db['CmContact'][_0x15fd('0x41')]({'where':{'id':_0xbb16ef[_0x15fd('0x59')]},'attributes':[_0x15fd('0x5a'),_0x15fd('0x5b')]})['then'](function(_0x242c9d){if(!_[_0x15fd('0x5c')](_0x34c250)&&!_[_0x15fd('0x5c')](_0x242c9d[_0x15fd('0x5a')])){_0xbb16ef[_0x15fd('0x5d')]=_0x242c9d[_0x15fd('0x5a')];if(!_['isNil'](_0x242c9d[_0x15fd('0x5b')])){_0xbb16ef[_0x15fd('0x5d')]+='\x20'+_0x242c9d[_0x15fd('0x5b')];}}})[_0x15fd('0x5e')](function(){return db[_0x15fd('0x5f')][_0x15fd('0x43')](_0xbb16ef);});}})['then'](function(_0x4f2a17){return db[_0x15fd('0x60')][_0x15fd('0x46')]({'where':{'CmHopperId':_0x5a1f32}});})['then'](function(){return _0x34c250[_0x15fd('0x9')](0xcc)[_0x15fd('0x61')]();})['catch'](handleError(_0x34c250,null));};exports[_0x15fd('0x62')]=function(_0x4626ac,_0x24c3a0){var _0x53bfd7=[];return db[_0x15fd('0x63')][_0x15fd('0x45')]()[_0x15fd('0x3a')](function(_0x2db860){_0x53bfd7=_[_0x15fd('0x3f')](_0x2db860);return _0x4626ac[_0x15fd('0x53')][_0x15fd('0x64')]({'where':{'type':_0x15fd('0x65'),'dialActive':!![],'dialMethod':_0x15fd('0x66')},'attributes':['id',_0x15fd('0x67'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x15fd('0x3a')](function(_0x3a26c8){if(_0x3a26c8&&_0x3a26c8['length']){return db['sequelize'][_0x15fd('0x68')](function(_0x39e6ee){var _0x2bd6ef={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x15fd('0x55')](_0x15fd('0x69'))},'VoiceQueueId':{'$in':_[_0x15fd('0x11')](_0x3a26c8,'id')},'$or':[{'UserId':null},{'UserId':_0x4626ac['user']['id']}]};var _0x41d398={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3a26c8)[_0x15fd('0x35')]([_0x15fd('0x6a'),0x0])[_0x15fd('0x11')]('id')[_0x15fd('0x6b')]()},'$or':[{'UserId':null},{'UserId':_0x4626ac[_0x15fd('0x53')]['id']}]};var _0xf27ab4={'$or':[_0x2bd6ef,_0x41d398]};var _0x1fe6cb=[];if(_0x4626ac[_0x15fd('0x44')][_0x15fd('0x6c')]&&_0x4626ac[_0x15fd('0x44')]['direction']==='prev'){if(!_[_0x15fd('0x6d')](_0x4626ac[_0x15fd('0x44')][_0x15fd('0x6e')])){_0xf27ab4['id']={'$in':_0x4626ac[_0x15fd('0x44')][_0x15fd('0x6e')]};}_0x1fe6cb=[[_0x15fd('0x6f'),_0x15fd('0x70')],['scheduledAt',_0x3a26c8[0x0][_0x15fd('0x67')]==='ASC'?_0x15fd('0x71'):'ASC'],db[_0x15fd('0x72')]['literal'](_0x15fd('0x73')),['id',_0x15fd('0x71')]];}else{if(!_[_0x15fd('0x6d')](_0x4626ac[_0x15fd('0x44')][_0x15fd('0x6e')])){_0xf27ab4['id']={'$notIn':_0x4626ac[_0x15fd('0x44')][_0x15fd('0x6e')]};}_0x1fe6cb=[[_0x15fd('0x6f'),_0x15fd('0x71')],['scheduledAt',_0x3a26c8[0x0]['dialOrderByScheduledAt']],db[_0x15fd('0x72')][_0x15fd('0x74')](_0x15fd('0x75')),['id','ASC']];}return db[_0x15fd('0x12')][_0x15fd('0x76')]({'attributes':['id',_0x15fd('0x77'),'phone',_0x15fd('0x78')],'where':_0xf27ab4,'order':_0x1fe6cb,'transaction':_0x39e6ee,'lock':_0x39e6ee[_0x15fd('0x79')]['UPDATE'],'include':[{'model':db[_0x15fd('0x63')],'as':'Contact','attributes':_0x53bfd7,'include':[{'model':db[_0x15fd('0x7a')],'as':_0x15fd('0x7b'),'attributes':['id',_0x15fd('0x18')]}]},{'model':db[_0x15fd('0x7c')],'as':_0x15fd('0x7d'),'attributes':['id','name']},{'model':db[_0x15fd('0x47')],'as':'Queue','attributes':['id',_0x15fd('0x18'),'dialActive']}]})[_0x15fd('0x3a')](function(_0x26fa9a){if(_0x26fa9a){return _0x26fa9a['update']({'UserId':_0x4626ac[_0x15fd('0x53')]['id']},{'transaction':_0x39e6ee});}});});}})[_0x15fd('0x3a')](handleEntityNotFound(_0x24c3a0,null))['then'](respondWithResult(_0x24c3a0,null))['catch'](handleError(_0x24c3a0,null));};exports[_0x15fd('0x7e')]=function(_0x5a9db1,_0x279bc1,_0x2feba1){var _0x166016=[];var _0x2121cb=_0x5a9db1[_0x15fd('0x3e')]['id'];var _0x54ab7d=_0x5a9db1[_0x15fd('0x53')]['id'];return db[_0x15fd('0x63')]['describe']()[_0x15fd('0x3a')](function(_0x3a4646){_0x166016=_[_0x15fd('0x3f')](_0x3a4646);return db[_0x15fd('0x72')][_0x15fd('0x68')](function(_0x1d529d){const _0x438ee3={'id':_0x2121cb};return db[_0x15fd('0x12')][_0x15fd('0x76')]({'attributes':['id',_0x15fd('0x77'),_0x15fd('0x78')],'where':_0x438ee3,'transaction':_0x1d529d,'lock':_0x1d529d[_0x15fd('0x79')][_0x15fd('0x7f')],'include':[{'model':db[_0x15fd('0x63')],'as':'Contact','attributes':_0x166016,'include':[{'model':db[_0x15fd('0x7a')],'as':'Company','attributes':['id',_0x15fd('0x18')]}]},{'model':db[_0x15fd('0x7c')],'as':_0x15fd('0x7d'),'attributes':['id',_0x15fd('0x18')]},{'model':db['VoiceQueue'],'as':_0x15fd('0x80'),'attributes':['id',_0x15fd('0x18'),_0x15fd('0x81')]}]})[_0x15fd('0x3a')](function(_0x4accfd){if(_0x4accfd){return _0x4accfd[_0x15fd('0xc')]({'UserId':_0x54ab7d},{'transaction':_0x1d529d});}});});})[_0x15fd('0x3a')](handleEntityNotFound(_0x279bc1,null))['then'](respondWithResult(_0x279bc1,null))[_0x15fd('0x42')](handleError(_0x279bc1,null));};exports[_0x15fd('0x82')]=function(_0x128ee3,_0x57089a){return _0x128ee3[_0x15fd('0x53')][_0x15fd('0x64')]({'where':{'type':_0x15fd('0x65'),'dialActive':!![],'dialMethod':_0x15fd('0x66')},'attributes':['id'],'raw':!![]})[_0x15fd('0x3a')](function(_0x2d24a2){if(_0x2d24a2&&_0x2d24a2[_0x15fd('0x40')]){return db[_0x15fd('0x12')][_0x15fd('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x15fd('0x55')](_0x15fd('0x69'))},'VoiceQueueId':{'$in':_[_0x15fd('0x11')](_0x2d24a2,'id')},'$or':[{'UserId':null},{'UserId':_0x128ee3['user']['id']}]}});}return 0x0;})[_0x15fd('0x3a')](function(_0x399962){if(!_[_0x15fd('0x5c')](_0x399962)&&_[_0x15fd('0x83')](_0x399962)){return _0x57089a[_0x15fd('0x9')](0xc8)['json']({'contacts':_0x399962});}else{logger['error'](_0x15fd('0x84'),_0x15fd('0x82'),0x194,_0x15fd('0x85'));_0x57089a[_0x15fd('0xd')](0x194);}})[_0x15fd('0x42')](handleError(_0x57089a,null));};exports[_0x15fd('0x86')]=function(_0xd13be0,_0x27c8b4){var _0x132613=shared['timezones'];var _0x2bea72=[];_[_0x15fd('0x11')](_0x132613,function(_0x573a5a){_0x2bea72[_0x15fd('0x87')]({'id':_0x573a5a[_0x15fd('0x18')],'name':_0x573a5a[_0x15fd('0x18')],'utcOffset':_0x573a5a[_0x15fd('0x88')]});});return _0x27c8b4['status'](0xc8)[_0x15fd('0x4')]({'tz':_0x2bea72});};exports[_0x15fd('0x89')]=function(_0x4be4bb,_0x47529c){var _0x1b5407=shared[_0x15fd('0x8a')];var _0x5e3696={};if(!_[_0x15fd('0x5c')](_0x1b5407[_0x4be4bb[_0x15fd('0x44')]['id']]))_0x5e3696=_0x1b5407[_0x4be4bb[_0x15fd('0x44')]['id']];return _0x47529c[_0x15fd('0x9')](0xc8)[_0x15fd('0x4')](_0x5e3696);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 6a99ce4..be777ab 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','priority','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x326f,0xd1));var _0xf326=function(_0x255909,_0x21c5ff){_0x255909=_0x255909-0x0;var _0x3cc4b1=_0x326f[_0x255909];return _0x3cc4b1;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['scheduledat']},{'name':'phone','fields':['phone']},{'name':_0xf326('0xe'),'fields':[_0xf326('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7096=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api'];(function(_0x4d71a2,_0x37be15){var _0x3b110a=function(_0x4dec4a){while(--_0x4dec4a){_0x4d71a2['push'](_0x4d71a2['shift']());}};_0x3b110a(++_0x37be15);}(_0x7096,0x10c));var _0x6709=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x7096[_0x5447fd];return _0x15b28a;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var logger=require('../../config/logger')(_0x6709('0x1'));var moment=require('moment');var BPromise=require(_0x6709('0x2'));var rp=require(_0x6709('0x3'));var fs=require('fs');var path=require(_0x6709('0x4'));var rimraf=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var attributes=require(_0x6709('0x7'));module[_0x6709('0x8')]=function(_0x9d630f,_0xa35832){return _0x9d630f[_0x6709('0x9')](_0x6709('0xa'),attributes,{'tableName':_0x6709('0xb'),'paranoid':![],'indexes':[{'name':_0x6709('0xc'),'fields':['scheduledat']},{'name':'phone','fields':[_0x6709('0xd')]},{'name':_0x6709('0xe'),'fields':[_0x6709('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index ef43968..d9f85b6 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 _0x21a6=['List','CmHopperHandlePreviewRecallNotifications','lodash','moment','../../config/logger','jayson/promise','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopper','CmHopper','findAll','options','where','include','model','attributes','then','debug','find','raw','map','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','UPDATE','keys','Agent','length','UserId','includes','push','update','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','transaction','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','GetCmHopperPreview','Contact','phone','dialTimezone','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','name','voicePause','CmList'];(function(_0x2ab418,_0x1f2849){var _0x68f709=function(_0x139292){while(--_0x139292){_0x2ab418['push'](_0x2ab418['shift']());}};_0x68f709(++_0x1f2849);}(_0x21a6,0x104));var _0x621a=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x21a6[_0x3c51d4];return _0x53c45f;};'use strict';var _=require(_0x621a('0x0'));var util=require('util');var moment=require(_0x621a('0x1'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x621a('0x2'))('rpc');var jayson=require(_0x621a('0x3'));var client=jayson[_0x621a('0x4')][_0x621a('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4607bd,_0x50f692,_0x436e08){return new BPromise(function(_0x43797c,_0x3e2cbc){return client[_0x621a('0x6')](_0x4607bd,_0x436e08)['then'](function(_0x2fe088){logger[_0x621a('0x7')](_0x621a('0x8'),_0x50f692,_0x621a('0x9'));logger['debug'](_0x621a('0xa'),_0x50f692,_0x621a('0x9'),JSON[_0x621a('0xb')](_0x2fe088));if(_0x2fe088['error']){if(_0x2fe088[_0x621a('0xc')][_0x621a('0xd')]===0x1f4){logger[_0x621a('0xc')](_0x621a('0x8'),_0x50f692,_0x2fe088[_0x621a('0xc')][_0x621a('0xe')]);return _0x3e2cbc(_0x2fe088[_0x621a('0xc')][_0x621a('0xe')]);}logger[_0x621a('0xc')]('CmHopper,\x20%s,\x20%s',_0x50f692,_0x2fe088['error'][_0x621a('0xe')]);return _0x43797c(_0x2fe088[_0x621a('0xc')][_0x621a('0xe')]);}else{logger[_0x621a('0x7')](_0x621a('0x8'),_0x50f692,_0x621a('0x9'));_0x43797c(_0x2fe088['result'][_0x621a('0xe')]);}})[_0x621a('0xf')](function(_0x4205ed){logger[_0x621a('0xc')](_0x621a('0x8'),_0x50f692,_0x4205ed);_0x3e2cbc(_0x4205ed);});});}exports[_0x621a('0x10')]=function(_0x37344){var _0x522c6f=this;return new Promise(function(_0x59555c,_0x4afa18){return db[_0x621a('0x11')][_0x621a('0x12')]({'raw':_0x37344['options']?_0x37344[_0x621a('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x37344[_0x621a('0x13')]?_0x37344[_0x621a('0x13')][_0x621a('0x14')]||null:null,'attributes':_0x37344[_0x621a('0x13')]?_0x37344[_0x621a('0x13')]['attributes']||null:null,'limit':_0x37344['options']?_0x37344[_0x621a('0x13')]['limit']||null:null,'include':_0x37344['options']?_0x37344[_0x621a('0x13')][_0x621a('0x15')]?_['map'](_0x37344[_0x621a('0x13')]['include'],function(_0x2a07b5){return{'model':db[_0x2a07b5[_0x621a('0x16')]],'as':_0x2a07b5['as'],'attributes':_0x2a07b5[_0x621a('0x17')],'include':_0x2a07b5[_0x621a('0x15')]?_['map'](_0x2a07b5['include'],function(_0x2bad30){return{'model':db[_0x2bad30['model']],'as':_0x2bad30['as'],'attributes':_0x2bad30['attributes'],'include':_0x2bad30[_0x621a('0x15')]?_['map'](_0x2bad30[_0x621a('0x15')],function(_0x5ae7c5){return{'model':db[_0x5ae7c5['model']],'as':_0x5ae7c5['as'],'attributes':_0x5ae7c5[_0x621a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x621a('0x18')](function(_0x510638){logger['info'](_0x621a('0x10'),_0x37344);logger[_0x621a('0x19')](_0x621a('0x10'),_0x37344,JSON[_0x621a('0xb')](_0x510638));_0x59555c(_0x510638);})[_0x621a('0xf')](function(_0x5bd5f3){logger[_0x621a('0xc')](_0x621a('0x10'),_0x5bd5f3['message'],_0x37344);_0x4afa18(_0x522c6f[_0x621a('0xc')](0x1f4,_0x5bd5f3['message']));});});};exports['ShowCmHopper']=function(_0x4a0cd6){var _0x3817b1=this;return new Promise(function(_0x5c3fa4,_0x5a9fa0){return db[_0x621a('0x11')][_0x621a('0x1a')]({'raw':_0x4a0cd6[_0x621a('0x13')]?_0x4a0cd6[_0x621a('0x13')][_0x621a('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a0cd6['options']?_0x4a0cd6[_0x621a('0x13')][_0x621a('0x14')]||null:null,'attributes':_0x4a0cd6[_0x621a('0x13')]?_0x4a0cd6[_0x621a('0x13')][_0x621a('0x17')]||null:null,'include':_0x4a0cd6[_0x621a('0x13')]?_0x4a0cd6[_0x621a('0x13')][_0x621a('0x15')]?_['map'](_0x4a0cd6[_0x621a('0x13')]['include'],function(_0x2eed96){return{'model':db[_0x2eed96['model']],'as':_0x2eed96['as'],'attributes':_0x2eed96['attributes'],'include':_0x2eed96[_0x621a('0x15')]?_[_0x621a('0x1c')](_0x2eed96[_0x621a('0x15')],function(_0x599a84){return{'model':db[_0x599a84[_0x621a('0x16')]],'as':_0x599a84['as'],'attributes':_0x599a84[_0x621a('0x17')],'include':_0x599a84[_0x621a('0x15')]?_[_0x621a('0x1c')](_0x599a84[_0x621a('0x15')],function(_0xbf65a9){return{'model':db[_0xbf65a9[_0x621a('0x16')]],'as':_0xbf65a9['as'],'attributes':_0xbf65a9[_0x621a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x621a('0x18')](function(_0x4b7c01){logger[_0x621a('0x7')]('ShowCmHopper',_0x4a0cd6);logger[_0x621a('0x19')]('ShowCmHopper',_0x4a0cd6,JSON['stringify'](_0x4b7c01));_0x5c3fa4(_0x4b7c01);})[_0x621a('0xf')](function(_0x40e093){logger[_0x621a('0xc')](_0x621a('0x1d'),_0x40e093['message'],_0x4a0cd6);_0x5a9fa0(_0x3817b1[_0x621a('0xc')](0x1f4,_0x40e093[_0x621a('0xe')]));});});};exports[_0x621a('0x1e')]=function(_0x17fbca){var _0xcad97e=this;return new Promise(function(_0x41838f,_0x3a9372){return db[_0x621a('0x11')][_0x621a('0x1f')](_0x17fbca[_0x621a('0x20')],{'raw':_0x17fbca[_0x621a('0x13')]?_0x17fbca[_0x621a('0x13')][_0x621a('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x49b78e){logger[_0x621a('0x7')]('CreateCmHopper',_0x17fbca);logger[_0x621a('0x19')](_0x621a('0x1e'),_0x17fbca,JSON[_0x621a('0xb')](_0x49b78e));_0x41838f(_0x49b78e);})['catch'](function(_0x1e6d6b){logger[_0x621a('0xc')](_0x621a('0x1e'),_0x1e6d6b[_0x621a('0xe')],_0x17fbca);_0x3a9372(_0xcad97e[_0x621a('0xc')](0x1f4,_0x1e6d6b['message']));});});};exports[_0x621a('0x21')]=function(_0x3ae067){var _0x10b751=this;return new Promise(function(_0x18f637,_0x2c09c7){return db[_0x621a('0x11')]['update'](_0x3ae067['body'],{'raw':_0x3ae067[_0x621a('0x13')]?_0x3ae067['options'][_0x621a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ae067[_0x621a('0x13')]?_0x3ae067[_0x621a('0x13')]['where']||null:null,'attributes':_0x3ae067[_0x621a('0x13')]?_0x3ae067['options']['attributes']||null:null,'limit':_0x3ae067[_0x621a('0x13')]?_0x3ae067['options'][_0x621a('0x22')]||null:null})[_0x621a('0x18')](function(_0x5307b1){logger[_0x621a('0x7')](_0x621a('0x21'),_0x3ae067);logger[_0x621a('0x7')](_0x621a('0x23'),JSON['stringify'](_0x3ae067[_0x621a('0x13')]['where']),_0x3ae067['body']['active']);logger[_0x621a('0x19')](_0x621a('0x21'),_0x3ae067,JSON[_0x621a('0xb')](_0x5307b1));_0x18f637(_0x5307b1);})[_0x621a('0xf')](function(_0x378a2c){logger[_0x621a('0xc')](_0x621a('0x21'),_0x378a2c[_0x621a('0xe')],_0x3ae067);_0x2c09c7(_0x10b751[_0x621a('0xc')](0x1f4,_0x378a2c['message']));});});};exports[_0x621a('0x24')]=function(_0x43cdee){var _0x54547e=this;return new Promise(function(_0x15dcd5,_0xdb0605){return db[_0x621a('0x11')][_0x621a('0x25')]({'where':_0x43cdee[_0x621a('0x13')]?_0x43cdee[_0x621a('0x13')][_0x621a('0x14')]||null:null})[_0x621a('0x18')](function(_0x5caa8d){logger[_0x621a('0x7')](_0x621a('0x24'),_0x43cdee);logger['debug']('DestroyCmHopper',_0x43cdee,JSON['stringify'](_0x5caa8d));_0x15dcd5(_0x5caa8d);})[_0x621a('0xf')](function(_0x5d1d53){logger[_0x621a('0xc')](_0x621a('0x24'),_0x5d1d53[_0x621a('0xe')],_0x43cdee);_0xdb0605(_0x54547e[_0x621a('0xc')](0x1f4,_0x5d1d53[_0x621a('0xe')]));});});};exports[_0x621a('0x26')]=function(_0x20aede){var _0x435309=this;return new Promise(function(_0x1bd9be,_0x5bff66){return db[_0x621a('0x27')][_0x621a('0x28')]()['then'](function(_0x422b32){return db[_0x621a('0x29')]['transaction'](function(_0x40eb15){return db[_0x621a('0x11')][_0x621a('0x12')]({'where':_0x20aede[_0x621a('0x13')]?_0x20aede[_0x621a('0x13')][_0x621a('0x14')]||null:null,'attributes':_0x20aede[_0x621a('0x13')]?_0x20aede['options'][_0x621a('0x17')]||null:null,'limit':_0x20aede['options']?_0x20aede[_0x621a('0x13')][_0x621a('0x22')]||null:null,'order':_0x20aede['options']?_0x20aede[_0x621a('0x13')][_0x621a('0x2a')]||null:null,'transaction':_0x40eb15,'lock':_0x40eb15['LOCK'][_0x621a('0x2b')],'include':[{'model':db[_0x621a('0x27')],'as':'Contact','attributes':_[_0x621a('0x2c')](_0x422b32)},{'model':db['User'],'as':_0x621a('0x2d'),'attributes':['id','name','voicePause']}]})['then'](function(_0x5d2175){var _0x393a79=[];var _0xad4cad=[];for(var _0x1bc6c5=0x0;_0x1bc6c5<_0x5d2175[_0x621a('0x2e')];_0x1bc6c5+=0x1){var _0x3b705c=_0x5d2175[_0x1bc6c5][_0x621a('0x2f')];if(_0x3b705c===null){_0x393a79['push'](_0x5d2175[_0x1bc6c5]['update'](_0x20aede[_0x621a('0x20')],{'transaction':_0x40eb15}));}else if(!_0xad4cad[_0x621a('0x30')](_0x3b705c)){_0xad4cad['push'](_0x3b705c);_0x393a79[_0x621a('0x31')](_0x5d2175[_0x1bc6c5][_0x621a('0x32')](_0x20aede[_0x621a('0x20')],{'transaction':_0x40eb15}));}}return BPromise[_0x621a('0x33')](_0x393a79);});})[_0x621a('0x18')](function(_0x519fde){logger[_0x621a('0x7')](_0x621a('0x26'),_0x20aede);if(_0x519fde[_0x621a('0x2e')]>0x0){logger[_0x621a('0x7')](_0x621a('0x34'),_0x519fde[0x0][_0x621a('0x35')]['id'],_0x519fde[0x0][_0x621a('0x35')][_0x621a('0x36')],_0x519fde[0x0][_0x621a('0x35')][_0x621a('0x37')]);}logger[_0x621a('0x19')](_0x621a('0x26'),_0x20aede,JSON[_0x621a('0xb')](_0x519fde));_0x1bd9be(_0x519fde);})[_0x621a('0xf')](function(_0x490e96){logger[_0x621a('0xc')](_0x621a('0x26'),_0x490e96[_0x621a('0xe')],_0x20aede);_0x5bff66(_0x435309[_0x621a('0xc')](0x1f4,_0x490e96['message']));});});});};exports[_0x621a('0x38')]=function(_0x29a117){var _0x454da0=this;return new Promise(function(_0x36af7a,_0x4df46c){return db[_0x621a('0x29')][_0x621a('0x39')](function(_0x303fd4){return db['CmHopperFinal'][_0x621a('0x1f')](_0x29a117[_0x621a('0x20')],{'raw':_0x29a117['options']?_0x29a117['options'][_0x621a('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x303fd4})[_0x621a('0x18')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x29a117[_0x621a('0x13')][_0x621a('0x14')]),_0x29a117['options'][_0x621a('0x14')][_0x621a('0x37')]);return db[_0x621a('0x11')][_0x621a('0x25')]({'where':_0x29a117[_0x621a('0x13')]?_0x29a117[_0x621a('0x13')][_0x621a('0x14')]||null:null,'transaction':_0x303fd4});});})[_0x621a('0x18')](function(_0x4f1840){logger['info'](_0x621a('0x38'),_0x29a117);logger['debug']('MoveContactManagedDialer',_0x29a117,JSON[_0x621a('0xb')](_0x4f1840));_0x36af7a(_0x4f1840);})[_0x621a('0xf')](function(_0xe4238d){logger['error'](_0x621a('0x38'),_0xe4238d[_0x621a('0xe')],_0x29a117);_0x4df46c(_0x454da0[_0x621a('0xc')](0x1f4,_0xe4238d[_0x621a('0xe')]));});});};exports[_0x621a('0x3a')]=function(_0x1c14f7){var _0x9cf4d8=this;return new Promise(function(_0x2a7177,_0x18103e){return db['CmHopper'][_0x621a('0x12')]({'raw':_0x1c14f7[_0x621a('0x13')]?_0x1c14f7['options']['raw']===undefined?!![]:![]:!![],'where':_0x1c14f7[_0x621a('0x13')]?_0x1c14f7[_0x621a('0x13')][_0x621a('0x14')]||null:null,'attributes':[[db[_0x621a('0x29')]['fn'](_0x621a('0x3b'),db[_0x621a('0x29')]['fn']('IF',db[_0x621a('0x29')][_0x621a('0x3c')](_0x621a('0x3d')+util[_0x621a('0x3e')](_0x621a('0x3f'),moment()[_0x621a('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x621a('0x40')))),_0x621a('0x41')]]})[_0x621a('0x18')](function(_0x4f7a75){logger[_0x621a('0x7')](_0x621a('0x3a'),_0x1c14f7);logger[_0x621a('0x19')](_0x621a('0x3a'),_0x1c14f7,JSON[_0x621a('0xb')](_0x4f7a75));_0x2a7177(_0x4f7a75);})[_0x621a('0xf')](function(_0x36470e){logger[_0x621a('0xc')](_0x621a('0x3a'),_0x36470e[_0x621a('0xe')],_0x1c14f7);_0x18103e(_0x9cf4d8[_0x621a('0xc')](0x1f4,_0x36470e['message']));});});};exports[_0x621a('0x42')]=function(_0x325787){var _0x2fd75f=this;return new Promise(function(_0x1dc9a9,_0x45c6e8){return db['CmContact'][_0x621a('0x28')]()[_0x621a('0x18')](function(_0x2d6a38){return db[_0x621a('0x29')][_0x621a('0x39')](function(_0x3dd4a6){return db[_0x621a('0x11')]['findAll']({'where':_0x325787[_0x621a('0x13')]?_0x325787[_0x621a('0x13')][_0x621a('0x14')]||null:null,'attributes':_0x325787['options']?_0x325787['options']['attributes']||null:null,'limit':0x1,'order':_0x325787[_0x621a('0x13')]?_0x325787[_0x621a('0x13')][_0x621a('0x2a')]||null:null,'group':db['CmHopper'][_0x621a('0x2f')],'transaction':_0x3dd4a6,'lock':_0x3dd4a6[_0x621a('0x43')][_0x621a('0x2b')],'include':_0x325787[_0x621a('0x13')]?_0x325787[_0x621a('0x13')]['include']?_['map'](_0x325787['options'][_0x621a('0x15')],function(_0x2b4970){return{'model':db[_0x2b4970['model']],'as':_0x2b4970['as'],'attributes':_0x2b4970['attributes'],'include':_0x2b4970[_0x621a('0x15')]?_['map'](_0x2b4970[_0x621a('0x15')],function(_0x3bcba5){return{'model':db[_0x3bcba5[_0x621a('0x16')]],'as':_0x3bcba5['as'],'attributes':_0x3bcba5['attributes'],'include':_0x3bcba5[_0x621a('0x15')]?_['map'](_0x3bcba5[_0x621a('0x15')],function(_0x5ebce2){return{'model':db[_0x5ebce2[_0x621a('0x16')]],'as':_0x5ebce2['as'],'attributes':_0x5ebce2[_0x621a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x621a('0x18')](function(_0x23dfd5){var _0xbbf544=[];for(var _0x5f4fae=0x0;_0x5f4fae<_0x23dfd5[_0x621a('0x2e')];_0x5f4fae+=0x1){_0xbbf544[_0x621a('0x31')](_0x23dfd5[_0x5f4fae][_0x621a('0x32')](_0x325787[_0x621a('0x20')],{'transaction':_0x3dd4a6}));}return BPromise[_0x621a('0x33')](_0xbbf544);});})[_0x621a('0x18')](function(_0x5f3532){logger['info'](_0x621a('0x42'),_0x325787);logger[_0x621a('0x19')](_0x621a('0x42'),_0x325787,JSON[_0x621a('0xb')](_0x5f3532));_0x1dc9a9(_0x5f3532);})[_0x621a('0xf')](function(_0x2e4b6a){logger[_0x621a('0xc')]('GetContactRecallMe',_0x2e4b6a[_0x621a('0xe')],_0x325787);_0x45c6e8(_0x2fd75f[_0x621a('0xc')](0x1f4,_0x2e4b6a[_0x621a('0xe')]));});});});};exports[_0x621a('0x44')]=function(_0x13e1cd){var _0x543e20=this;return new Promise(function(_0x20f2a8,_0x52729c){db[_0x621a('0x27')][_0x621a('0x28')]()[_0x621a('0x18')](function(_0x1cde67){return db[_0x621a('0x11')][_0x621a('0x12')]({'raw':_0x13e1cd['options']?_0x13e1cd[_0x621a('0x13')][_0x621a('0x1b')]===undefined?!![]:![]:!![],'where':_0x13e1cd[_0x621a('0x13')]?_0x13e1cd[_0x621a('0x13')][_0x621a('0x14')]||null:null,'attributes':_0x13e1cd['options']?_0x13e1cd['options'][_0x621a('0x17')]||null:null,'limit':_0x13e1cd[_0x621a('0x13')]?_0x13e1cd['options']['limit']||null:null,'include':_0x13e1cd['options']?_0x13e1cd[_0x621a('0x13')][_0x621a('0x15')]?_['map'](_0x13e1cd[_0x621a('0x13')]['include'],function(_0x4057d3){return{'model':db[_0x4057d3['model']],'as':_0x4057d3['as'],'attributes':_0x4057d3['as']===_0x621a('0x45')?_[_0x621a('0x2c')](_0x1cde67):_0x4057d3[_0x621a('0x17')],'include':_0x4057d3['include']?_['map'](_0x4057d3[_0x621a('0x15')],function(_0x5551cb){return{'model':db[_0x5551cb[_0x621a('0x16')]],'as':_0x5551cb['as'],'attributes':_0x5551cb[_0x621a('0x17')],'include':_0x5551cb['include']?_[_0x621a('0x1c')](_0x5551cb[_0x621a('0x15')],function(_0x36ba86){return{'model':db[_0x36ba86['model']],'as':_0x36ba86['as'],'attributes':_0x36ba86[_0x621a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x621a('0x18')](function(_0x32bb9a){logger[_0x621a('0x7')](_0x621a('0x10'),_0x13e1cd);logger[_0x621a('0x19')](_0x621a('0x10'),_0x13e1cd,JSON[_0x621a('0xb')](_0x32bb9a));_0x20f2a8(_0x32bb9a);})[_0x621a('0xf')](function(_0x4d684d){logger[_0x621a('0xc')](_0x621a('0x10'),_0x4d684d[_0x621a('0xe')],_0x13e1cd);_0x52729c(_0x543e20[_0x621a('0xc')](0x1f4,_0x4d684d[_0x621a('0xe')]));});});});};exports['GetContactByPhone']=function(_0x1e0089){var _0x351e6d=this;return new Promise(function(_0x2337ba,_0xbd923f){return db[_0x621a('0x27')]['findOne']({'raw':!![],'where':{'phone':_0x1e0089[_0x621a('0x13')][_0x621a('0x14')][_0x621a('0x46')]},'attributes':['id',_0x621a('0x47')],'order':[['id','DESC']]})['then'](function(_0x86f823){logger['info'](_0x621a('0x48'),_0x1e0089);logger['debug'](_0x621a('0x48'),_0x1e0089,JSON['stringify'](_0x86f823));_0x2337ba(_0x86f823);})['catch'](function(_0x4eae56){logger[_0x621a('0xc')]('getContactByPhone',_0x4eae56[_0x621a('0xe')],_0x1e0089);_0xbd923f(_0x351e6d[_0x621a('0xc')](0x1f4,_0x4eae56['message']));});});};exports[_0x621a('0x49')]=function(_0x529228){var _0x1fa0c7=this;return new Promise(function(_0x47b4b7,_0x229191){return db[_0x621a('0x29')][_0x621a('0x39')](function(_0x36bcc2){return db[_0x621a('0x11')]['update'](_0x529228['body'],{'where':{},'transaction':_0x36bcc2})[_0x621a('0x18')](function(_0x5ec30d){logger['info'](_0x621a('0x49'),_0x529228);logger['debug'](_0x621a('0x49'),_0x529228,JSON['stringify'](_0x5ec30d));_0x47b4b7(_0x5ec30d);})[_0x621a('0xf')](function(_0x54b80f){logger[_0x621a('0xc')](_0x621a('0x49'),_0x54b80f['message'],_0x529228);_0x229191(_0x1fa0c7[_0x621a('0xc')](0x1f4,_0x54b80f['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x5f2082){var _0x506939=this;var _0x1cf2a9=_0x5f2082[_0x621a('0x20')]['where'][_0x621a('0x4a')];var _0x54834e=_0x5f2082[_0x621a('0x20')]['where'][_0x621a('0x4b')];var _0x24955f=_0x5f2082[_0x621a('0x20')]['where'][_0x621a('0x4c')];return new Promise(function(_0x1ac92d,_0x398455){return db[_0x621a('0x11')][_0x621a('0x12')]({'where':{'voiceQueueId':{'$in':_0x1cf2a9},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x621a('0x29')]['literal'](_0x621a('0x4d')+_0x54834e+_0x621a('0x4e')),'$gt':db[_0x621a('0x29')]['literal'](_0x621a('0x4f'))}},'UserId':{'$in':_0x24955f}},'include':[{'model':db['CmContact'],'as':_0x621a('0x45')},{'model':db[_0x621a('0x50')],'as':_0x621a('0x2d'),'attributes':['id',_0x621a('0x51'),_0x621a('0x52')]},{'model':db[_0x621a('0x53')],'as':_0x621a('0x54')}]})[_0x621a('0x18')](function(_0x598e17){if(_0x598e17[_0x621a('0x2e')]>0x0){return db[_0x621a('0x29')][_0x621a('0x39')](function(_0x513251){return db[_0x621a('0x11')][_0x621a('0x32')]({'recallmeNotifiedDate':db[_0x621a('0x29')][_0x621a('0x3c')](_0x621a('0x4f'))},{'where':{'id':{'$in':_[_0x621a('0x1c')](_0x598e17,'id')}},'transaction':_0x513251})[_0x621a('0x18')](function(){_0x1ac92d(_0x598e17);})[_0x621a('0xf')](function(_0x32036f){logger[_0x621a('0xc')](_0x621a('0x55'),_0x32036f['message'],_0x5f2082);_0x398455(_0x506939[_0x621a('0xc')](0x1f4,_0x32036f[_0x621a('0xe')]));});})['catch'](function(_0x11b3fb){logger[_0x621a('0xc')](_0x621a('0x55'),_0x11b3fb[_0x621a('0xe')],_0x5f2082);_0x398455(_0x506939[_0x621a('0xc')](0x1f4,_0x11b3fb[_0x621a('0xe')]));});}else{_0x1ac92d(_0x598e17);}});});}; \ No newline at end of file +var _0xd139=['name','CmList','List','util','moment','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http','request','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CmHopper','options','where','limit','include','model','attributes','map','then','GetCmHopper','find','raw','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','DestroyCmHopper','CmContact','describe','sequelize','transaction','findAll','order','UPDATE','keys','User','Agent','voicePause','length','UserId','push','all','GetContactDialer','dataValues','MoveContactManagedDialer','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','LOCK','GetContactRecallMe','GetCmHopperPreview','phone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','NOW()','Contact'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xd139,0xf9));var _0x9d13=function(_0x1b4b94,_0x4793ac){_0x1b4b94=_0x1b4b94-0x0;var _0x5951c0=_0xd139[_0x1b4b94];return _0x5951c0;};'use strict';var _=require('lodash');var util=require(_0x9d13('0x0'));var moment=require(_0x9d13('0x1'));var BPromise=require(_0x9d13('0x2'));var db=require(_0x9d13('0x3'))['db'];var logger=require(_0x9d13('0x4'))('rpc');var jayson=require(_0x9d13('0x5'));var client=jayson[_0x9d13('0x6')][_0x9d13('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d5446,_0x161c2c,_0x370e63){return new BPromise(function(_0x1dee67,_0x249662){return client[_0x9d13('0x8')](_0x5d5446,_0x370e63)['then'](function(_0x4a7458){logger['info'](_0x9d13('0x9'),_0x161c2c,_0x9d13('0xa'));logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x161c2c,_0x9d13('0xa'),JSON[_0x9d13('0xd')](_0x4a7458));if(_0x4a7458[_0x9d13('0xe')]){if(_0x4a7458[_0x9d13('0xe')]['code']===0x1f4){logger[_0x9d13('0xe')]('CmHopper,\x20%s,\x20%s',_0x161c2c,_0x4a7458['error'][_0x9d13('0xf')]);return _0x249662(_0x4a7458[_0x9d13('0xe')][_0x9d13('0xf')]);}logger[_0x9d13('0xe')](_0x9d13('0x9'),_0x161c2c,_0x4a7458['error'][_0x9d13('0xf')]);return _0x1dee67(_0x4a7458[_0x9d13('0xe')][_0x9d13('0xf')]);}else{logger[_0x9d13('0x10')](_0x9d13('0x9'),_0x161c2c,'request\x20sent');_0x1dee67(_0x4a7458['result'][_0x9d13('0xf')]);}})[_0x9d13('0x11')](function(_0x10a7d0){logger['error'](_0x9d13('0x9'),_0x161c2c,_0x10a7d0);_0x249662(_0x10a7d0);});});}exports['GetCmHopper']=function(_0x3d92cf){var _0x1abd14=this;return new Promise(function(_0x4fe294,_0x4f128c){return db[_0x9d13('0x12')]['findAll']({'raw':_0x3d92cf['options']?_0x3d92cf[_0x9d13('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3d92cf[_0x9d13('0x13')]?_0x3d92cf[_0x9d13('0x13')][_0x9d13('0x14')]||null:null,'attributes':_0x3d92cf[_0x9d13('0x13')]?_0x3d92cf[_0x9d13('0x13')]['attributes']||null:null,'limit':_0x3d92cf[_0x9d13('0x13')]?_0x3d92cf[_0x9d13('0x13')][_0x9d13('0x15')]||null:null,'include':_0x3d92cf['options']?_0x3d92cf[_0x9d13('0x13')][_0x9d13('0x16')]?_['map'](_0x3d92cf['options'][_0x9d13('0x16')],function(_0x2c8052){return{'model':db[_0x2c8052[_0x9d13('0x17')]],'as':_0x2c8052['as'],'attributes':_0x2c8052[_0x9d13('0x18')],'include':_0x2c8052['include']?_[_0x9d13('0x19')](_0x2c8052[_0x9d13('0x16')],function(_0x344377){return{'model':db[_0x344377[_0x9d13('0x17')]],'as':_0x344377['as'],'attributes':_0x344377[_0x9d13('0x18')],'include':_0x344377['include']?_[_0x9d13('0x19')](_0x344377[_0x9d13('0x16')],function(_0x5e932e){return{'model':db[_0x5e932e[_0x9d13('0x17')]],'as':_0x5e932e['as'],'attributes':_0x5e932e[_0x9d13('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9d13('0x1a')](function(_0x35c9e0){logger[_0x9d13('0x10')](_0x9d13('0x1b'),_0x3d92cf);logger[_0x9d13('0xb')](_0x9d13('0x1b'),_0x3d92cf,JSON[_0x9d13('0xd')](_0x35c9e0));_0x4fe294(_0x35c9e0);})['catch'](function(_0x5a9f6c){logger[_0x9d13('0xe')](_0x9d13('0x1b'),_0x5a9f6c['message'],_0x3d92cf);_0x4f128c(_0x1abd14['error'](0x1f4,_0x5a9f6c[_0x9d13('0xf')]));});});};exports['ShowCmHopper']=function(_0xb02e2a){var _0x68ed98=this;return new Promise(function(_0x19237e,_0x9cefdb){return db['CmHopper'][_0x9d13('0x1c')]({'raw':_0xb02e2a[_0x9d13('0x13')]?_0xb02e2a[_0x9d13('0x13')][_0x9d13('0x1d')]===undefined?!![]:![]:!![],'where':_0xb02e2a[_0x9d13('0x13')]?_0xb02e2a[_0x9d13('0x13')]['where']||null:null,'attributes':_0xb02e2a[_0x9d13('0x13')]?_0xb02e2a[_0x9d13('0x13')][_0x9d13('0x18')]||null:null,'include':_0xb02e2a['options']?_0xb02e2a['options'][_0x9d13('0x16')]?_[_0x9d13('0x19')](_0xb02e2a['options'][_0x9d13('0x16')],function(_0x53b384){return{'model':db[_0x53b384[_0x9d13('0x17')]],'as':_0x53b384['as'],'attributes':_0x53b384[_0x9d13('0x18')],'include':_0x53b384[_0x9d13('0x16')]?_[_0x9d13('0x19')](_0x53b384[_0x9d13('0x16')],function(_0x272352){return{'model':db[_0x272352[_0x9d13('0x17')]],'as':_0x272352['as'],'attributes':_0x272352[_0x9d13('0x18')],'include':_0x272352[_0x9d13('0x16')]?_['map'](_0x272352['include'],function(_0x58e653){return{'model':db[_0x58e653[_0x9d13('0x17')]],'as':_0x58e653['as'],'attributes':_0x58e653['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d13('0x1a')](function(_0x2a98d8){logger[_0x9d13('0x10')](_0x9d13('0x1e'),_0xb02e2a);logger['debug'](_0x9d13('0x1e'),_0xb02e2a,JSON[_0x9d13('0xd')](_0x2a98d8));_0x19237e(_0x2a98d8);})[_0x9d13('0x11')](function(_0x691a2a){logger[_0x9d13('0xe')](_0x9d13('0x1e'),_0x691a2a[_0x9d13('0xf')],_0xb02e2a);_0x9cefdb(_0x68ed98['error'](0x1f4,_0x691a2a['message']));});});};exports[_0x9d13('0x1f')]=function(_0x2d22a9){var _0x3b9199=this;return new Promise(function(_0x3df381,_0x4d146d){return db[_0x9d13('0x12')]['create'](_0x2d22a9[_0x9d13('0x20')],{'raw':_0x2d22a9[_0x9d13('0x13')]?_0x2d22a9[_0x9d13('0x13')][_0x9d13('0x1d')]===undefined?!![]:![]:!![]})[_0x9d13('0x1a')](function(_0x316581){logger[_0x9d13('0x10')](_0x9d13('0x1f'),_0x2d22a9);logger['debug']('CreateCmHopper',_0x2d22a9,JSON['stringify'](_0x316581));_0x3df381(_0x316581);})[_0x9d13('0x11')](function(_0x5c399f){logger['error'](_0x9d13('0x1f'),_0x5c399f['message'],_0x2d22a9);_0x4d146d(_0x3b9199['error'](0x1f4,_0x5c399f[_0x9d13('0xf')]));});});};exports[_0x9d13('0x21')]=function(_0x3971fa){var _0x56eb93=this;return new Promise(function(_0x1ca4bd,_0x1ca9c7){return db['CmHopper'][_0x9d13('0x22')](_0x3971fa[_0x9d13('0x20')],{'raw':_0x3971fa[_0x9d13('0x13')]?_0x3971fa['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3971fa[_0x9d13('0x13')]?_0x3971fa['options']['where']||null:null,'attributes':_0x3971fa[_0x9d13('0x13')]?_0x3971fa[_0x9d13('0x13')][_0x9d13('0x18')]||null:null,'limit':_0x3971fa['options']?_0x3971fa[_0x9d13('0x13')]['limit']||null:null})[_0x9d13('0x1a')](function(_0x35ee58){logger[_0x9d13('0x10')](_0x9d13('0x21'),_0x3971fa);logger['info'](_0x9d13('0x23'),JSON['stringify'](_0x3971fa[_0x9d13('0x13')]['where']),_0x3971fa[_0x9d13('0x20')][_0x9d13('0x24')]);logger['debug']('UpdateCmHopper',_0x3971fa,JSON[_0x9d13('0xd')](_0x35ee58));_0x1ca4bd(_0x35ee58);})['catch'](function(_0x50f702){logger[_0x9d13('0xe')]('UpdateCmHopper',_0x50f702[_0x9d13('0xf')],_0x3971fa);_0x1ca9c7(_0x56eb93[_0x9d13('0xe')](0x1f4,_0x50f702[_0x9d13('0xf')]));});});};exports['DestroyCmHopper']=function(_0x122a28){var _0x2a2f96=this;return new Promise(function(_0x183081,_0xb9eb6c){return db['CmHopper'][_0x9d13('0x25')]({'where':_0x122a28[_0x9d13('0x13')]?_0x122a28[_0x9d13('0x13')]['where']||null:null})[_0x9d13('0x1a')](function(_0x2cee79){logger[_0x9d13('0x10')](_0x9d13('0x26'),_0x122a28);logger[_0x9d13('0xb')](_0x9d13('0x26'),_0x122a28,JSON[_0x9d13('0xd')](_0x2cee79));_0x183081(_0x2cee79);})[_0x9d13('0x11')](function(_0x4c4dc4){logger[_0x9d13('0xe')](_0x9d13('0x26'),_0x4c4dc4[_0x9d13('0xf')],_0x122a28);_0xb9eb6c(_0x2a2f96[_0x9d13('0xe')](0x1f4,_0x4c4dc4['message']));});});};exports['GetContactDialer']=function(_0x58c55e){var _0x587b4c=this;return new Promise(function(_0x2746ab,_0x29408a){return db[_0x9d13('0x27')][_0x9d13('0x28')]()[_0x9d13('0x1a')](function(_0x7b48a8){return db[_0x9d13('0x29')][_0x9d13('0x2a')](function(_0x4af79c){return db['CmHopper'][_0x9d13('0x2b')]({'where':_0x58c55e[_0x9d13('0x13')]?_0x58c55e[_0x9d13('0x13')]['where']||null:null,'attributes':_0x58c55e[_0x9d13('0x13')]?_0x58c55e[_0x9d13('0x13')][_0x9d13('0x18')]||null:null,'limit':_0x58c55e['options']?_0x58c55e[_0x9d13('0x13')][_0x9d13('0x15')]||null:null,'order':_0x58c55e[_0x9d13('0x13')]?_0x58c55e[_0x9d13('0x13')][_0x9d13('0x2c')]||null:null,'transaction':_0x4af79c,'lock':_0x4af79c['LOCK'][_0x9d13('0x2d')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x9d13('0x2e')](_0x7b48a8)},{'model':db[_0x9d13('0x2f')],'as':_0x9d13('0x30'),'attributes':['id','name',_0x9d13('0x31')]}]})['then'](function(_0x3d5c1e){var _0x326971=[];var _0x5d10b8=[];for(var _0x4e000f=0x0;_0x4e000f<_0x3d5c1e[_0x9d13('0x32')];_0x4e000f+=0x1){var _0x59d3ad=_0x3d5c1e[_0x4e000f][_0x9d13('0x33')];if(_0x59d3ad===null){_0x326971[_0x9d13('0x34')](_0x3d5c1e[_0x4e000f]['update'](_0x58c55e['body'],{'transaction':_0x4af79c}));}else if(!_0x5d10b8['includes'](_0x59d3ad)){_0x5d10b8['push'](_0x59d3ad);_0x326971[_0x9d13('0x34')](_0x3d5c1e[_0x4e000f][_0x9d13('0x22')](_0x58c55e[_0x9d13('0x20')],{'transaction':_0x4af79c}));}}return BPromise[_0x9d13('0x35')](_0x326971);});})['then'](function(_0x89e6f7){logger[_0x9d13('0x10')](_0x9d13('0x36'),_0x58c55e);if(_0x89e6f7['length']>0x0){logger[_0x9d13('0x10')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x89e6f7[0x0][_0x9d13('0x37')]['id'],_0x89e6f7[0x0][_0x9d13('0x37')]['ContactId'],_0x89e6f7[0x0]['dataValues'][_0x9d13('0x24')]);}logger['debug'](_0x9d13('0x36'),_0x58c55e,JSON[_0x9d13('0xd')](_0x89e6f7));_0x2746ab(_0x89e6f7);})[_0x9d13('0x11')](function(_0xa58a96){logger[_0x9d13('0xe')](_0x9d13('0x36'),_0xa58a96[_0x9d13('0xf')],_0x58c55e);_0x29408a(_0x587b4c[_0x9d13('0xe')](0x1f4,_0xa58a96[_0x9d13('0xf')]));});});});};exports[_0x9d13('0x38')]=function(_0x1f1a98){var _0x317ffe=this;return new Promise(function(_0x3c8e83,_0x402cfe){return db[_0x9d13('0x29')]['transaction'](function(_0x1c4e89){return db[_0x9d13('0x39')][_0x9d13('0x3a')](_0x1f1a98[_0x9d13('0x20')],{'raw':_0x1f1a98['options']?_0x1f1a98[_0x9d13('0x13')][_0x9d13('0x1d')]===undefined?!![]:![]:!![],'transaction':_0x1c4e89})[_0x9d13('0x1a')](function(){logger[_0x9d13('0x10')](_0x9d13('0x3b'),JSON[_0x9d13('0xd')](_0x1f1a98[_0x9d13('0x13')][_0x9d13('0x14')]),_0x1f1a98[_0x9d13('0x13')][_0x9d13('0x14')][_0x9d13('0x24')]);return db[_0x9d13('0x12')][_0x9d13('0x25')]({'where':_0x1f1a98[_0x9d13('0x13')]?_0x1f1a98[_0x9d13('0x13')][_0x9d13('0x14')]||null:null,'transaction':_0x1c4e89});});})['then'](function(_0x469ae6){logger[_0x9d13('0x10')](_0x9d13('0x38'),_0x1f1a98);logger[_0x9d13('0xb')](_0x9d13('0x38'),_0x1f1a98,JSON[_0x9d13('0xd')](_0x469ae6));_0x3c8e83(_0x469ae6);})[_0x9d13('0x11')](function(_0x4e70a9){logger[_0x9d13('0xe')](_0x9d13('0x38'),_0x4e70a9['message'],_0x1f1a98);_0x402cfe(_0x317ffe[_0x9d13('0xe')](0x1f4,_0x4e70a9[_0x9d13('0xf')]));});});};exports[_0x9d13('0x3c')]=function(_0xe754d4){var _0x463d8e=this;return new Promise(function(_0xf74a53,_0x384aec){return db[_0x9d13('0x12')]['findAll']({'raw':_0xe754d4[_0x9d13('0x13')]?_0xe754d4[_0x9d13('0x13')][_0x9d13('0x1d')]===undefined?!![]:![]:!![],'where':_0xe754d4[_0x9d13('0x13')]?_0xe754d4[_0x9d13('0x13')][_0x9d13('0x14')]||null:null,'attributes':[[db[_0x9d13('0x29')]['fn'](_0x9d13('0x3d'),db[_0x9d13('0x29')]['fn']('IF',db[_0x9d13('0x29')][_0x9d13('0x3e')]('`scheduledat`\x20>=\x20'+util[_0x9d13('0x3f')](_0x9d13('0x40'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x9d13('0x41')))),_0x9d13('0x42')]]})['then'](function(_0x4a9c2d){logger[_0x9d13('0x10')](_0x9d13('0x3c'),_0xe754d4);logger[_0x9d13('0xb')](_0x9d13('0x3c'),_0xe754d4,JSON['stringify'](_0x4a9c2d));_0xf74a53(_0x4a9c2d);})[_0x9d13('0x11')](function(_0xacf70){logger[_0x9d13('0xe')](_0x9d13('0x3c'),_0xacf70[_0x9d13('0xf')],_0xe754d4);_0x384aec(_0x463d8e[_0x9d13('0xe')](0x1f4,_0xacf70['message']));});});};exports['GetContactRecallMe']=function(_0x1d7cff){var _0x4f337d=this;return new Promise(function(_0x2320a0,_0x47d1c0){return db['CmContact']['describe']()[_0x9d13('0x1a')](function(_0x31d8eb){return db[_0x9d13('0x29')][_0x9d13('0x2a')](function(_0x437875){return db[_0x9d13('0x12')][_0x9d13('0x2b')]({'where':_0x1d7cff['options']?_0x1d7cff[_0x9d13('0x13')][_0x9d13('0x14')]||null:null,'attributes':_0x1d7cff[_0x9d13('0x13')]?_0x1d7cff[_0x9d13('0x13')][_0x9d13('0x18')]||null:null,'limit':0x1,'order':_0x1d7cff[_0x9d13('0x13')]?_0x1d7cff['options'][_0x9d13('0x2c')]||null:null,'group':db[_0x9d13('0x12')][_0x9d13('0x33')],'transaction':_0x437875,'lock':_0x437875[_0x9d13('0x43')][_0x9d13('0x2d')],'include':_0x1d7cff[_0x9d13('0x13')]?_0x1d7cff[_0x9d13('0x13')][_0x9d13('0x16')]?_['map'](_0x1d7cff[_0x9d13('0x13')][_0x9d13('0x16')],function(_0xa2dc12){return{'model':db[_0xa2dc12[_0x9d13('0x17')]],'as':_0xa2dc12['as'],'attributes':_0xa2dc12[_0x9d13('0x18')],'include':_0xa2dc12[_0x9d13('0x16')]?_[_0x9d13('0x19')](_0xa2dc12[_0x9d13('0x16')],function(_0xaa4d5c){return{'model':db[_0xaa4d5c[_0x9d13('0x17')]],'as':_0xaa4d5c['as'],'attributes':_0xaa4d5c[_0x9d13('0x18')],'include':_0xaa4d5c[_0x9d13('0x16')]?_[_0x9d13('0x19')](_0xaa4d5c[_0x9d13('0x16')],function(_0x544a22){return{'model':db[_0x544a22['model']],'as':_0x544a22['as'],'attributes':_0x544a22[_0x9d13('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e55d3){var _0x3e3e14=[];for(var _0x4d65f2=0x0;_0x4d65f2<_0x2e55d3[_0x9d13('0x32')];_0x4d65f2+=0x1){_0x3e3e14[_0x9d13('0x34')](_0x2e55d3[_0x4d65f2]['update'](_0x1d7cff[_0x9d13('0x20')],{'transaction':_0x437875}));}return BPromise[_0x9d13('0x35')](_0x3e3e14);});})[_0x9d13('0x1a')](function(_0x48ca10){logger[_0x9d13('0x10')]('GetContactRecallMe',_0x1d7cff);logger['debug'](_0x9d13('0x44'),_0x1d7cff,JSON[_0x9d13('0xd')](_0x48ca10));_0x2320a0(_0x48ca10);})[_0x9d13('0x11')](function(_0x44a1b5){logger[_0x9d13('0xe')](_0x9d13('0x44'),_0x44a1b5['message'],_0x1d7cff);_0x47d1c0(_0x4f337d[_0x9d13('0xe')](0x1f4,_0x44a1b5[_0x9d13('0xf')]));});});});};exports[_0x9d13('0x45')]=function(_0x54a0e6){var _0x149470=this;return new Promise(function(_0xc7fce5,_0x51e941){db[_0x9d13('0x27')][_0x9d13('0x28')]()[_0x9d13('0x1a')](function(_0x318df9){return db[_0x9d13('0x12')][_0x9d13('0x2b')]({'raw':_0x54a0e6[_0x9d13('0x13')]?_0x54a0e6[_0x9d13('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x54a0e6['options']?_0x54a0e6['options']['where']||null:null,'attributes':_0x54a0e6['options']?_0x54a0e6[_0x9d13('0x13')][_0x9d13('0x18')]||null:null,'limit':_0x54a0e6[_0x9d13('0x13')]?_0x54a0e6[_0x9d13('0x13')][_0x9d13('0x15')]||null:null,'include':_0x54a0e6[_0x9d13('0x13')]?_0x54a0e6[_0x9d13('0x13')][_0x9d13('0x16')]?_[_0x9d13('0x19')](_0x54a0e6[_0x9d13('0x13')]['include'],function(_0x3f1cae){return{'model':db[_0x3f1cae[_0x9d13('0x17')]],'as':_0x3f1cae['as'],'attributes':_0x3f1cae['as']==='Contact'?_[_0x9d13('0x2e')](_0x318df9):_0x3f1cae['attributes'],'include':_0x3f1cae['include']?_['map'](_0x3f1cae[_0x9d13('0x16')],function(_0x1bfae2){return{'model':db[_0x1bfae2[_0x9d13('0x17')]],'as':_0x1bfae2['as'],'attributes':_0x1bfae2[_0x9d13('0x18')],'include':_0x1bfae2[_0x9d13('0x16')]?_[_0x9d13('0x19')](_0x1bfae2['include'],function(_0x5997e3){return{'model':db[_0x5997e3[_0x9d13('0x17')]],'as':_0x5997e3['as'],'attributes':_0x5997e3[_0x9d13('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9d13('0x1a')](function(_0x5637c1){logger[_0x9d13('0x10')](_0x9d13('0x1b'),_0x54a0e6);logger['debug'](_0x9d13('0x1b'),_0x54a0e6,JSON[_0x9d13('0xd')](_0x5637c1));_0xc7fce5(_0x5637c1);})[_0x9d13('0x11')](function(_0x3ef39d){logger[_0x9d13('0xe')]('GetCmHopper',_0x3ef39d[_0x9d13('0xf')],_0x54a0e6);_0x51e941(_0x149470[_0x9d13('0xe')](0x1f4,_0x3ef39d['message']));});});});};exports['GetContactByPhone']=function(_0x189d04){var _0x4eb664=this;return new Promise(function(_0x2a71a7,_0x5dac54){return db['CmContact']['findOne']({'raw':!![],'where':{'phone':_0x189d04['options'][_0x9d13('0x14')][_0x9d13('0x46')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x9d13('0x1a')](function(_0x25684a){logger[_0x9d13('0x10')](_0x9d13('0x47'),_0x189d04);logger['debug'](_0x9d13('0x47'),_0x189d04,JSON[_0x9d13('0xd')](_0x25684a));_0x2a71a7(_0x25684a);})[_0x9d13('0x11')](function(_0x32f8d6){logger['error']('getContactByPhone',_0x32f8d6[_0x9d13('0xf')],_0x189d04);_0x5dac54(_0x4eb664['error'](0x1f4,_0x32f8d6[_0x9d13('0xf')]));});});};exports[_0x9d13('0x48')]=function(_0x47f26e){var _0x1e6ac0=this;return new Promise(function(_0xf8f215,_0x25d1fa){return db[_0x9d13('0x29')]['transaction'](function(_0x48e027){return db['CmHopper']['update'](_0x47f26e[_0x9d13('0x20')],{'where':{},'transaction':_0x48e027})[_0x9d13('0x1a')](function(_0x242587){logger[_0x9d13('0x10')](_0x9d13('0x48'),_0x47f26e);logger[_0x9d13('0xb')](_0x9d13('0x48'),_0x47f26e,JSON['stringify'](_0x242587));_0xf8f215(_0x242587);})[_0x9d13('0x11')](function(_0x2ffa7b){logger[_0x9d13('0xe')](_0x9d13('0x48'),_0x2ffa7b[_0x9d13('0xf')],_0x47f26e);_0x25d1fa(_0x1e6ac0[_0x9d13('0xe')](0x1f4,_0x2ffa7b[_0x9d13('0xf')]));});});});};exports[_0x9d13('0x49')]=function(_0x5f03b5){var _0x4aac64=this;var _0x5e5e49=_0x5f03b5[_0x9d13('0x20')][_0x9d13('0x14')][_0x9d13('0x4a')];var _0x12c463=_0x5f03b5['body'][_0x9d13('0x14')][_0x9d13('0x4b')];var _0xed9585=_0x5f03b5[_0x9d13('0x20')][_0x9d13('0x14')]['availableAgentsIds'];return new Promise(function(_0x52ccb6,_0x3c14a3){return db[_0x9d13('0x12')][_0x9d13('0x2b')]({'where':{'voiceQueueId':{'$in':_0x5e5e49},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x9d13('0x29')][_0x9d13('0x3e')](_0x9d13('0x4c')+_0x12c463+'\x20MINUTE'),'$gt':db[_0x9d13('0x29')][_0x9d13('0x3e')](_0x9d13('0x4d'))}},'UserId':{'$in':_0xed9585}},'include':[{'model':db[_0x9d13('0x27')],'as':_0x9d13('0x4e')},{'model':db['User'],'as':'Agent','attributes':['id',_0x9d13('0x4f'),_0x9d13('0x31')]},{'model':db[_0x9d13('0x50')],'as':_0x9d13('0x51')}]})[_0x9d13('0x1a')](function(_0x4e072b){if(_0x4e072b[_0x9d13('0x32')]>0x0){return db[_0x9d13('0x29')][_0x9d13('0x2a')](function(_0x247390){return db[_0x9d13('0x12')][_0x9d13('0x22')]({'recallmeNotifiedDate':db[_0x9d13('0x29')][_0x9d13('0x3e')](_0x9d13('0x4d'))},{'where':{'id':{'$in':_[_0x9d13('0x19')](_0x4e072b,'id')}},'transaction':_0x247390})[_0x9d13('0x1a')](function(){_0x52ccb6(_0x4e072b);})[_0x9d13('0x11')](function(_0x4b29c0){logger[_0x9d13('0xe')]('CmHopperHandlePreviewRecallNotifications',_0x4b29c0['message'],_0x5f03b5);_0x3c14a3(_0x4aac64[_0x9d13('0xe')](0x1f4,_0x4b29c0[_0x9d13('0xf')]));});})[_0x9d13('0x11')](function(_0x31c71a){logger[_0x9d13('0xe')](_0x9d13('0x49'),_0x31c71a[_0x9d13('0xf')],_0x5f03b5);_0x3c14a3(_0x4aac64[_0x9d13('0xe')](0x1f4,_0x31c71a[_0x9d13('0xf')]));});}else{_0x52ccb6(_0x4e072b);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index cabac9f..4ae6ae2 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 _0xf084=['show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','/:id','update','delete','exports','express','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','getTimezones'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xf084,0x148));var _0x4f08=function(_0x3a623e,_0x306d26){_0x3a623e=_0x3a623e-0x0;var _0x2dab72=_0xf084[_0x3a623e];return _0x2dab72;};'use strict';var express=require(_0x4f08('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0x4f08('0x1')]('/',auth[_0x4f08('0x2')](),controller[_0x4f08('0x3')]);router[_0x4f08('0x1')]('/describe',auth[_0x4f08('0x2')](),controller[_0x4f08('0x4')]);router[_0x4f08('0x1')](_0x4f08('0x5'),auth[_0x4f08('0x2')](),controller[_0x4f08('0x6')]);router[_0x4f08('0x1')]('/timezones',auth[_0x4f08('0x2')](),controller[_0x4f08('0x7')]);router[_0x4f08('0x1')]('/:id',auth[_0x4f08('0x2')](),controller[_0x4f08('0x8')]);router['get'](_0x4f08('0x9'),auth[_0x4f08('0x2')](),controller[_0x4f08('0xa')]);router[_0x4f08('0xb')]('/',auth[_0x4f08('0x2')](),controller[_0x4f08('0xc')]);router[_0x4f08('0xb')](_0x4f08('0xd'),auth[_0x4f08('0x2')](),controller[_0x4f08('0xe')]);router[_0x4f08('0xb')](_0x4f08('0xf'),auth[_0x4f08('0x2')](),controller['getTimezone']);router[_0x4f08('0x10')](_0x4f08('0x11'),auth[_0x4f08('0x2')](),controller[_0x4f08('0x12')]);router[_0x4f08('0x13')](_0x4f08('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x4f08('0x14')]=router; \ No newline at end of file +var _0x4f6e=['/timezone','getTimezone','put','update','delete','destroy','exports','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','get','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','post','/preview'];(function(_0x53618a,_0x3ce1c8){var _0x588ddb=function(_0x2deeb9){while(--_0x2deeb9){_0x53618a['push'](_0x53618a['shift']());}};_0x588ddb(++_0x3ce1c8);}(_0x4f6e,0x104));var _0xe4f6=function(_0x1c1b4a,_0x5c48a1){_0x1c1b4a=_0x1c1b4a-0x0;var _0x119ee1=_0x4f6e[_0x1c1b4a];return _0x119ee1;};'use strict';var express=require('express');var router=express[_0xe4f6('0x0')]();var auth=require(_0xe4f6('0x1'));var controller=require(_0xe4f6('0x2'));router['get']('/',auth[_0xe4f6('0x3')](),controller['index']);router[_0xe4f6('0x4')](_0xe4f6('0x5'),auth[_0xe4f6('0x3')](),controller[_0xe4f6('0x6')]);router['get'](_0xe4f6('0x7'),auth['isAuthenticated'](),controller[_0xe4f6('0x8')]);router[_0xe4f6('0x4')](_0xe4f6('0x9'),auth['isAuthenticated'](),controller[_0xe4f6('0xa')]);router['get'](_0xe4f6('0xb'),auth['isAuthenticated'](),controller[_0xe4f6('0xc')]);router[_0xe4f6('0x4')](_0xe4f6('0xd'),auth[_0xe4f6('0x3')](),controller['getPreviewRecall']);router[_0xe4f6('0xe')]('/',auth[_0xe4f6('0x3')](),controller['create']);router[_0xe4f6('0xe')](_0xe4f6('0xf'),auth[_0xe4f6('0x3')](),controller['getPreview']);router[_0xe4f6('0xe')](_0xe4f6('0x10'),auth[_0xe4f6('0x3')](),controller[_0xe4f6('0x11')]);router[_0xe4f6('0x12')](_0xe4f6('0xb'),auth[_0xe4f6('0x3')](),controller[_0xe4f6('0x13')]);router[_0xe4f6('0x14')](_0xe4f6('0xb'),auth['isAuthenticated'](),controller[_0xe4f6('0x15')]);module[_0xe4f6('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index b065431..d56d294 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 _0xf28e=['format','moment','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x5ec344,_0xce7ef6){var _0x20cd49=function(_0x3f2bb0){while(--_0x3f2bb0){_0x5ec344['push'](_0x5ec344['shift']());}};_0x20cd49(++_0xce7ef6);}(_0xf28e,0x119));var _0xef28=function(_0x163f58,_0x1c8ae4){_0x163f58=_0x163f58-0x0;var _0x472ed9=_0xf28e[_0x163f58];return _0x472ed9;};'use strict';var moment=require(_0xef28('0x0'));var Sequelize=require(_0xef28('0x1'));module[_0xef28('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0xef28('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xef28('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xef28('0x5')],'defaultValue':moment()[_0xef28('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xef28('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xef28('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xef28('0x4')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xef28('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xef28('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xef28('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xef28('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe069=['exports','STRING','INTEGER','DATE','moment','sequelize'];(function(_0x507403,_0x3f954d){var _0x1327c=function(_0x2aea1b){while(--_0x2aea1b){_0x507403['push'](_0x507403['shift']());}};_0x1327c(++_0x3f954d);}(_0xe069,0x1e4));var _0x9e06=function(_0x4ef3b9,_0x4985fa){_0x4ef3b9=_0x4ef3b9-0x0;var _0x1fc7f9=_0xe069[_0x4ef3b9];return _0x1fc7f9;};'use strict';var moment=require(_0x9e06('0x0'));var Sequelize=require(_0x9e06('0x1'));module[_0x9e06('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x9e06('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9e06('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x9e06('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x9e06('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9e06('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9e06('0x4')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x9e06('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9e06('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9e06('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9e06('0x4')],'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 42446df..93aadd3 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 _0x377f=['intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','CmHopperAdditionalPhone','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters'];(function(_0x2a58ea,_0x710a7){var _0x5d5cd0=function(_0x4c3e6e){while(--_0x4c3e6e){_0x2a58ea['push'](_0x2a58ea['shift']());}};_0x5d5cd0(++_0x710a7);}(_0x377f,0xc3));var _0xf377=function(_0x2af46c,_0x182828){_0x2af46c=_0x2af46c-0x0;var _0x891575=_0x377f[_0x2af46c];return _0x891575;};'use strict';var emlformat=require(_0xf377('0x0'));var rimraf=require(_0xf377('0x1'));var zipdir=require(_0xf377('0x2'));var jsonpatch=require(_0xf377('0x3'));var rp=require('request-promise');var moment=require(_0xf377('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf377('0x5'));var util=require('util');var path=require(_0xf377('0x6'));var sox=require('sox');var csv=require(_0xf377('0x7'));var ejs=require(_0xf377('0x8'));var fs=require('fs');var fs_extra=require(_0xf377('0x9'));var _=require(_0xf377('0xa'));var squel=require(_0xf377('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf377('0xc'));var toCsv=require(_0xf377('0x7'));var querystring=require(_0xf377('0xd'));var Papa=require(_0xf377('0xe'));var Redis=require('ioredis');var authService=require(_0xf377('0xf'));var qs=require(_0xf377('0x10'));var as=require(_0xf377('0x11'));var hardwareService=require(_0xf377('0x12'));var logger=require(_0xf377('0x13'))(_0xf377('0x14'));var utils=require(_0xf377('0x15'));var config=require(_0xf377('0x16'));var licenseUtil=require(_0xf377('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2749b0,_0x5c1710){_0x5c1710=_0x5c1710||0xcc;return function(_0x494e09){if(_0x494e09){return _0x2749b0['sendStatus'](_0x5c1710);}return _0x2749b0[_0xf377('0x18')](_0x5c1710)[_0xf377('0x19')]();};}function respondWithResult(_0x2c4ea3,_0x46f592){_0x46f592=_0x46f592||0xc8;return function(_0x203dd7){if(_0x203dd7){return _0x2c4ea3[_0xf377('0x18')](_0x46f592)[_0xf377('0x1a')](_0x203dd7);}};}function respondWithFilteredResult(_0x40f7c4,_0x1bda37){return function(_0xc10269){if(_0xc10269){var _0x36eb31=typeof _0x1bda37['offset']==='undefined'&&typeof _0x1bda37['limit']==='undefined';var _0x455b59=_0xc10269['count'];var _0x1ce33c=_0x36eb31?0x0:_0x1bda37['offset'];var _0x233106=_0x36eb31?_0xc10269[_0xf377('0x1b')]:_0x1bda37['offset']+_0x1bda37[_0xf377('0x1c')];var _0x146d0e;if(_0x233106>=_0x455b59){_0x233106=_0x455b59;_0x146d0e=0xc8;}else{_0x146d0e=0xce;}_0x40f7c4['status'](_0x146d0e);return _0x40f7c4[_0xf377('0x1d')](_0xf377('0x1e'),_0x1ce33c+'-'+_0x233106+'/'+_0x455b59)[_0xf377('0x1a')](_0xc10269);}return null;};}function patchUpdates(_0x542d79){return function(_0x42e573){try{jsonpatch[_0xf377('0x1f')](_0x42e573,_0x542d79,!![]);}catch(_0x43af7a){return BPromise[_0xf377('0x20')](_0x43af7a);}return _0x42e573[_0xf377('0x21')]();};}function saveUpdates(_0xf607ab,_0x33f19b){return function(_0x83bb70){if(_0x83bb70){return _0x83bb70[_0xf377('0x22')](_0xf607ab)[_0xf377('0x23')](function(_0x3fd07d){return _0x3fd07d;});}return null;};}function removeEntity(_0x4d660e,_0x2b264a){return function(_0xb8fdc8){if(_0xb8fdc8){return _0xb8fdc8[_0xf377('0x24')]()['then'](function(){var _0x30eace=_0xb8fdc8[_0xf377('0x25')]({'plain':!![]});var _0x333d41='CmHopperAdditionalPhones';return db[_0xf377('0x26')][_0xf377('0x24')]({'where':{'type':_0x333d41,'resourceId':_0x30eace['id']}})[_0xf377('0x23')](function(){return _0xb8fdc8;});})[_0xf377('0x23')](function(){_0x4d660e[_0xf377('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54257d,_0x11da3d){return function(_0x5802e7){if(!_0x5802e7){_0x54257d[_0xf377('0x27')](0x194);}return _0x5802e7;};}function handleError(_0x23440e,_0x3b15aa){_0x3b15aa=_0x3b15aa||0x1f4;return function(_0x5ea6e5){logger['error'](_0x5ea6e5[_0xf377('0x28')]);if(_0x5ea6e5[_0xf377('0x29')]){delete _0x5ea6e5['name'];}_0x23440e[_0xf377('0x18')](_0x3b15aa)[_0xf377('0x2a')](_0x5ea6e5);};}exports[_0xf377('0x2b')]=function(_0x5bc65a,_0x4847f2){var _0x109941={},_0x48b413={},_0x509fb0={'count':0x0,'rows':[]};var _0xfe1b47=_[_0xf377('0x2c')](db['CmHopperAdditionalPhone'][_0xf377('0x2d')],function(_0x263caf){return{'name':_0x263caf[_0xf377('0x2e')],'type':_0x263caf[_0xf377('0x2f')]['key']};});_0x48b413[_0xf377('0x30')]=_[_0xf377('0x2c')](_0xfe1b47,_0xf377('0x29'));_0x48b413[_0xf377('0x31')]=_['keys'](_0x5bc65a[_0xf377('0x31')]);_0x48b413[_0xf377('0x32')]=_[_0xf377('0x33')](_0x48b413[_0xf377('0x30')],_0x48b413[_0xf377('0x31')]);_0x109941[_0xf377('0x34')]=_['intersection'](_0x48b413[_0xf377('0x30')],qs[_0xf377('0x35')](_0x5bc65a[_0xf377('0x31')]['fields']));_0x109941[_0xf377('0x34')]=_0x109941[_0xf377('0x34')][_0xf377('0x36')]?_0x109941['attributes']:_0x48b413[_0xf377('0x30')];if(!_0x5bc65a['query'][_0xf377('0x37')](_0xf377('0x38'))){_0x109941[_0xf377('0x1c')]=qs['limit'](_0x5bc65a['query']['limit']);_0x109941['offset']=qs[_0xf377('0x39')](_0x5bc65a[_0xf377('0x31')][_0xf377('0x39')]);}_0x109941[_0xf377('0x3a')]=qs[_0xf377('0x3b')](_0x5bc65a['query'][_0xf377('0x3b')]);_0x109941[_0xf377('0x3c')]=qs[_0xf377('0x32')](_['pick'](_0x5bc65a[_0xf377('0x31')],_0x48b413[_0xf377('0x32')]),_0xfe1b47);if(_0x5bc65a[_0xf377('0x31')][_0xf377('0x3d')]){_0x109941[_0xf377('0x3c')]=_[_0xf377('0x3e')](_0x109941['where'],{'$or':_[_0xf377('0x2c')](_0xfe1b47,function(_0x2a0281){if(_0x2a0281[_0xf377('0x2f')]!==_0xf377('0x3f')){var _0xeaf7f7={};_0xeaf7f7[_0x2a0281[_0xf377('0x29')]]={'$like':'%'+_0x5bc65a[_0xf377('0x31')][_0xf377('0x3d')]+'%'};return _0xeaf7f7;}})});}_0x109941=_[_0xf377('0x3e')]({},_0x109941,_0x5bc65a[_0xf377('0x40')]);var _0x45d93b={'where':_0x109941[_0xf377('0x3c')]};return db['CmHopperAdditionalPhone']['count'](_0x45d93b)['then'](function(_0x5cf6cb){_0x509fb0['count']=_0x5cf6cb;if(_0x5bc65a[_0xf377('0x31')][_0xf377('0x41')]){_0x109941[_0xf377('0x42')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone']['findAll'](_0x109941);})[_0xf377('0x23')](function(_0x3d8e9a){_0x509fb0[_0xf377('0x43')]=_0x3d8e9a;return _0x509fb0;})[_0xf377('0x23')](respondWithFilteredResult(_0x4847f2,_0x109941))[_0xf377('0x44')](handleError(_0x4847f2,null));};exports[_0xf377('0x45')]=function(_0x5e08bb,_0x1ea31c){var _0x636d7d={'raw':!![],'where':{'id':_0x5e08bb[_0xf377('0x46')]['id']}},_0x1bc837={};_0x1bc837[_0xf377('0x30')]=_[_0xf377('0x47')](db[_0xf377('0x48')][_0xf377('0x2d')]);_0x1bc837[_0xf377('0x31')]=_['keys'](_0x5e08bb[_0xf377('0x31')]);_0x1bc837[_0xf377('0x32')]=_[_0xf377('0x33')](_0x1bc837['model'],_0x1bc837[_0xf377('0x31')]);_0x636d7d[_0xf377('0x34')]=_[_0xf377('0x33')](_0x1bc837[_0xf377('0x30')],qs[_0xf377('0x35')](_0x5e08bb[_0xf377('0x31')][_0xf377('0x35')]));_0x636d7d[_0xf377('0x34')]=_0x636d7d[_0xf377('0x34')][_0xf377('0x36')]?_0x636d7d[_0xf377('0x34')]:_0x1bc837['model'];if(_0x5e08bb[_0xf377('0x31')][_0xf377('0x41')]){_0x636d7d[_0xf377('0x42')]=[{'all':!![]}];}_0x636d7d=_[_0xf377('0x3e')]({},_0x636d7d,_0x5e08bb['options']);return db[_0xf377('0x48')][_0xf377('0x49')](_0x636d7d)[_0xf377('0x23')](handleEntityNotFound(_0x1ea31c,null))[_0xf377('0x23')](respondWithResult(_0x1ea31c,null))['catch'](handleError(_0x1ea31c,null));};exports[_0xf377('0x4a')]=function(_0x18c9f0,_0x15301a){return db[_0xf377('0x48')][_0xf377('0x4a')](_0x18c9f0[_0xf377('0x4b')],{})[_0xf377('0x23')](function(_0x6dcab5){var _0x47eca7=_0x18c9f0[_0xf377('0x4c')][_0xf377('0x25')]({'plain':!![]});if(!_0x47eca7)throw new Error(_0xf377('0x4d'));if(_0x47eca7[_0xf377('0x4e')]===_0xf377('0x4c')){var _0x22df8f=_0x6dcab5[_0xf377('0x25')]({'plain':!![]});var _0xb2547d='CmHopperAdditionalPhones';return db[_0xf377('0x4f')]['find']({'where':{'name':_0xb2547d,'userProfileId':_0x47eca7['userProfileId']},'raw':!![]})[_0xf377('0x23')](function(_0x193030){if(_0x193030&&_0x193030[_0xf377('0x50')]===0x0){return db['UserProfileResource'][_0xf377('0x4a')]({'name':_0x22df8f['name'],'resourceId':_0x22df8f['id'],'type':_0x193030[_0xf377('0x29')],'sectionId':_0x193030['id']},{})['then'](function(){return _0x6dcab5;});}else{return _0x6dcab5;}})[_0xf377('0x44')](function(_0x275277){logger[_0xf377('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x275277);throw _0x275277;});}return _0x6dcab5;})['then'](respondWithResult(_0x15301a,0xc9))[_0xf377('0x44')](handleError(_0x15301a,null));};exports['update']=function(_0x3159dc,_0x4e55f5){if(_0x3159dc[_0xf377('0x4b')]['id']){delete _0x3159dc[_0xf377('0x4b')]['id'];}return db[_0xf377('0x48')]['find']({'where':{'id':_0x3159dc[_0xf377('0x46')]['id']}})['then'](handleEntityNotFound(_0x4e55f5,null))[_0xf377('0x23')](saveUpdates(_0x3159dc['body'],null))[_0xf377('0x23')](respondWithResult(_0x4e55f5,null))[_0xf377('0x44')](handleError(_0x4e55f5,null));};exports[_0xf377('0x24')]=function(_0x2100fd,_0x3346fe){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x2100fd['params']['id']}})['then'](handleEntityNotFound(_0x3346fe,null))['then'](removeEntity(_0x3346fe,null))[_0xf377('0x44')](handleError(_0x3346fe,null));}; \ No newline at end of file +var _0xa9e2=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','moment','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','sendStatus','error','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','CmHopperAdditionalPhone','includeAll','findAll','catch','show','params','include'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa9e2,0x1e2));var _0x2a9e=function(_0x38ff44,_0x421078){_0x38ff44=_0x38ff44-0x0;var _0x341c67=_0xa9e2[_0x38ff44];return _0x341c67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a9e('0x0'));var zipdir=require(_0x2a9e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2a9e('0x2'));var BPromise=require(_0x2a9e('0x3'));var Mustache=require('mustache');var util=require(_0x2a9e('0x4'));var path=require(_0x2a9e('0x5'));var sox=require('sox');var csv=require(_0x2a9e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2a9e('0x7'));var squel=require(_0x2a9e('0x8'));var crypto=require('crypto');var jsforce=require(_0x2a9e('0x9'));var deskjs=require(_0x2a9e('0xa'));var toCsv=require(_0x2a9e('0x6'));var querystring=require(_0x2a9e('0xb'));var Papa=require(_0x2a9e('0xc'));var Redis=require(_0x2a9e('0xd'));var authService=require(_0x2a9e('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a9e('0xf'));var logger=require(_0x2a9e('0x10'))('api');var utils=require(_0x2a9e('0x11'));var config=require(_0x2a9e('0x12'));var licenseUtil=require(_0x2a9e('0x13'));var db=require(_0x2a9e('0x14'))['db'];function respondWithStatusCode(_0x3e326b,_0x182c1b){_0x182c1b=_0x182c1b||0xcc;return function(_0x46585e){if(_0x46585e){return _0x3e326b['sendStatus'](_0x182c1b);}return _0x3e326b[_0x2a9e('0x15')](_0x182c1b)[_0x2a9e('0x16')]();};}function respondWithResult(_0x41b99d,_0x2ce9b4){_0x2ce9b4=_0x2ce9b4||0xc8;return function(_0x429bd9){if(_0x429bd9){return _0x41b99d[_0x2a9e('0x15')](_0x2ce9b4)['json'](_0x429bd9);}};}function respondWithFilteredResult(_0x457d39,_0xd9f025){return function(_0x4848b5){if(_0x4848b5){var _0x26be63=typeof _0xd9f025['offset']===_0x2a9e('0x17')&&typeof _0xd9f025['limit']===_0x2a9e('0x17');var _0x2bc219=_0x4848b5[_0x2a9e('0x18')];var _0x49e029=_0x26be63?0x0:_0xd9f025['offset'];var _0xa5187=_0x26be63?_0x4848b5[_0x2a9e('0x18')]:_0xd9f025[_0x2a9e('0x19')]+_0xd9f025[_0x2a9e('0x1a')];var _0x218d12;if(_0xa5187>=_0x2bc219){_0xa5187=_0x2bc219;_0x218d12=0xc8;}else{_0x218d12=0xce;}_0x457d39[_0x2a9e('0x15')](_0x218d12);return _0x457d39['set'](_0x2a9e('0x1b'),_0x49e029+'-'+_0xa5187+'/'+_0x2bc219)[_0x2a9e('0x1c')](_0x4848b5);}return null;};}function patchUpdates(_0x281d5c){return function(_0x3ec7e5){try{jsonpatch[_0x2a9e('0x1d')](_0x3ec7e5,_0x281d5c,!![]);}catch(_0x4a3e8b){return BPromise[_0x2a9e('0x1e')](_0x4a3e8b);}return _0x3ec7e5[_0x2a9e('0x1f')]();};}function saveUpdates(_0x255775,_0x42c17a){return function(_0x20e1a9){if(_0x20e1a9){return _0x20e1a9[_0x2a9e('0x20')](_0x255775)[_0x2a9e('0x21')](function(_0x33ebc8){return _0x33ebc8;});}return null;};}function removeEntity(_0x184f6f,_0x6e95a6){return function(_0x5135a1){if(_0x5135a1){return _0x5135a1[_0x2a9e('0x22')]()[_0x2a9e('0x21')](function(){var _0x21881b=_0x5135a1[_0x2a9e('0x23')]({'plain':!![]});var _0xa92494=_0x2a9e('0x24');return db[_0x2a9e('0x25')][_0x2a9e('0x22')]({'where':{'type':_0xa92494,'resourceId':_0x21881b['id']}})[_0x2a9e('0x21')](function(){return _0x5135a1;});})[_0x2a9e('0x21')](function(){_0x184f6f[_0x2a9e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ff728,_0x28bab1){return function(_0x6e3561){if(!_0x6e3561){_0x5ff728[_0x2a9e('0x26')](0x194);}return _0x6e3561;};}function handleError(_0x5718ef,_0xf6a69){_0xf6a69=_0xf6a69||0x1f4;return function(_0x4da295){logger[_0x2a9e('0x27')](_0x4da295['stack']);if(_0x4da295[_0x2a9e('0x28')]){delete _0x4da295[_0x2a9e('0x28')];}_0x5718ef[_0x2a9e('0x15')](_0xf6a69)[_0x2a9e('0x29')](_0x4da295);};}exports['index']=function(_0x5a30b4,_0x2262fc){var _0x572180={},_0x3c3356={},_0x117d44={'count':0x0,'rows':[]};var _0x1a99d6=_['map'](db['CmHopperAdditionalPhone'][_0x2a9e('0x2a')],function(_0x1cf115){return{'name':_0x1cf115[_0x2a9e('0x2b')],'type':_0x1cf115[_0x2a9e('0x2c')]['key']};});_0x3c3356[_0x2a9e('0x2d')]=_[_0x2a9e('0x2e')](_0x1a99d6,_0x2a9e('0x28'));_0x3c3356[_0x2a9e('0x2f')]=_[_0x2a9e('0x30')](_0x5a30b4['query']);_0x3c3356[_0x2a9e('0x31')]=_['intersection'](_0x3c3356[_0x2a9e('0x2d')],_0x3c3356[_0x2a9e('0x2f')]);_0x572180[_0x2a9e('0x32')]=_[_0x2a9e('0x33')](_0x3c3356[_0x2a9e('0x2d')],qs[_0x2a9e('0x34')](_0x5a30b4[_0x2a9e('0x2f')][_0x2a9e('0x34')]));_0x572180[_0x2a9e('0x32')]=_0x572180[_0x2a9e('0x32')][_0x2a9e('0x35')]?_0x572180['attributes']:_0x3c3356[_0x2a9e('0x2d')];if(!_0x5a30b4['query'][_0x2a9e('0x36')](_0x2a9e('0x37'))){_0x572180[_0x2a9e('0x1a')]=qs['limit'](_0x5a30b4[_0x2a9e('0x2f')][_0x2a9e('0x1a')]);_0x572180['offset']=qs[_0x2a9e('0x19')](_0x5a30b4[_0x2a9e('0x2f')][_0x2a9e('0x19')]);}_0x572180[_0x2a9e('0x38')]=qs[_0x2a9e('0x39')](_0x5a30b4[_0x2a9e('0x2f')][_0x2a9e('0x39')]);_0x572180['where']=qs[_0x2a9e('0x31')](_[_0x2a9e('0x3a')](_0x5a30b4[_0x2a9e('0x2f')],_0x3c3356[_0x2a9e('0x31')]),_0x1a99d6);if(_0x5a30b4[_0x2a9e('0x2f')][_0x2a9e('0x3b')]){_0x572180[_0x2a9e('0x3c')]=_[_0x2a9e('0x3d')](_0x572180[_0x2a9e('0x3c')],{'$or':_[_0x2a9e('0x2e')](_0x1a99d6,function(_0x1eac00){if(_0x1eac00[_0x2a9e('0x2c')]!==_0x2a9e('0x3e')){var _0x1dea11={};_0x1dea11[_0x1eac00[_0x2a9e('0x28')]]={'$like':'%'+_0x5a30b4['query']['filter']+'%'};return _0x1dea11;}})});}_0x572180=_[_0x2a9e('0x3d')]({},_0x572180,_0x5a30b4[_0x2a9e('0x3f')]);var _0x41f1c8={'where':_0x572180[_0x2a9e('0x3c')]};return db[_0x2a9e('0x40')][_0x2a9e('0x18')](_0x41f1c8)['then'](function(_0x2aa660){_0x117d44['count']=_0x2aa660;if(_0x5a30b4[_0x2a9e('0x2f')][_0x2a9e('0x41')]){_0x572180['include']=[{'all':!![]}];}return db[_0x2a9e('0x40')][_0x2a9e('0x42')](_0x572180);})[_0x2a9e('0x21')](function(_0x15d6ae){_0x117d44['rows']=_0x15d6ae;return _0x117d44;})[_0x2a9e('0x21')](respondWithFilteredResult(_0x2262fc,_0x572180))[_0x2a9e('0x43')](handleError(_0x2262fc,null));};exports[_0x2a9e('0x44')]=function(_0x3f8758,_0x3d35d6){var _0x34eea6={'raw':!![],'where':{'id':_0x3f8758[_0x2a9e('0x45')]['id']}},_0x54f682={};_0x54f682[_0x2a9e('0x2d')]=_[_0x2a9e('0x30')](db[_0x2a9e('0x40')]['rawAttributes']);_0x54f682['query']=_[_0x2a9e('0x30')](_0x3f8758[_0x2a9e('0x2f')]);_0x54f682[_0x2a9e('0x31')]=_[_0x2a9e('0x33')](_0x54f682[_0x2a9e('0x2d')],_0x54f682[_0x2a9e('0x2f')]);_0x34eea6[_0x2a9e('0x32')]=_[_0x2a9e('0x33')](_0x54f682[_0x2a9e('0x2d')],qs[_0x2a9e('0x34')](_0x3f8758['query'][_0x2a9e('0x34')]));_0x34eea6[_0x2a9e('0x32')]=_0x34eea6[_0x2a9e('0x32')][_0x2a9e('0x35')]?_0x34eea6[_0x2a9e('0x32')]:_0x54f682[_0x2a9e('0x2d')];if(_0x3f8758['query'][_0x2a9e('0x41')]){_0x34eea6[_0x2a9e('0x46')]=[{'all':!![]}];}_0x34eea6=_[_0x2a9e('0x3d')]({},_0x34eea6,_0x3f8758[_0x2a9e('0x3f')]);return db['CmHopperAdditionalPhone'][_0x2a9e('0x47')](_0x34eea6)[_0x2a9e('0x21')](handleEntityNotFound(_0x3d35d6,null))[_0x2a9e('0x21')](respondWithResult(_0x3d35d6,null))[_0x2a9e('0x43')](handleError(_0x3d35d6,null));};exports[_0x2a9e('0x48')]=function(_0x341b2b,_0x173ccd){return db['CmHopperAdditionalPhone']['create'](_0x341b2b[_0x2a9e('0x49')],{})[_0x2a9e('0x21')](function(_0x1c0b92){var _0x930c85=_0x341b2b[_0x2a9e('0x4a')][_0x2a9e('0x23')]({'plain':!![]});if(!_0x930c85)throw new Error(_0x2a9e('0x4b'));if(_0x930c85['role']===_0x2a9e('0x4a')){var _0x102eec=_0x1c0b92['get']({'plain':!![]});var _0x553930=_0x2a9e('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x553930,'userProfileId':_0x930c85[_0x2a9e('0x4c')]},'raw':!![]})[_0x2a9e('0x21')](function(_0x47c7f5){if(_0x47c7f5&&_0x47c7f5[_0x2a9e('0x4d')]===0x0){return db[_0x2a9e('0x25')][_0x2a9e('0x48')]({'name':_0x102eec[_0x2a9e('0x28')],'resourceId':_0x102eec['id'],'type':_0x47c7f5[_0x2a9e('0x28')],'sectionId':_0x47c7f5['id']},{})[_0x2a9e('0x21')](function(){return _0x1c0b92;});}else{return _0x1c0b92;}})[_0x2a9e('0x43')](function(_0x36189f){logger[_0x2a9e('0x27')](_0x2a9e('0x4e'),_0x36189f);throw _0x36189f;});}return _0x1c0b92;})[_0x2a9e('0x21')](respondWithResult(_0x173ccd,0xc9))[_0x2a9e('0x43')](handleError(_0x173ccd,null));};exports[_0x2a9e('0x20')]=function(_0x170545,_0x4e041e){if(_0x170545[_0x2a9e('0x49')]['id']){delete _0x170545[_0x2a9e('0x49')]['id'];}return db[_0x2a9e('0x40')][_0x2a9e('0x47')]({'where':{'id':_0x170545[_0x2a9e('0x45')]['id']}})[_0x2a9e('0x21')](handleEntityNotFound(_0x4e041e,null))[_0x2a9e('0x21')](saveUpdates(_0x170545[_0x2a9e('0x49')],null))[_0x2a9e('0x21')](respondWithResult(_0x4e041e,null))[_0x2a9e('0x43')](handleError(_0x4e041e,null));};exports[_0x2a9e('0x22')]=function(_0x3afe75,_0x17d8b7){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x3afe75[_0x2a9e('0x45')]['id']}})[_0x2a9e('0x21')](handleEntityNotFound(_0x17d8b7,null))[_0x2a9e('0x21')](removeEntity(_0x17d8b7,null))['catch'](handleError(_0x17d8b7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 5d2903a..2d7a904 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 _0x1c59=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4c083b,_0x90e77d){var _0x318bbe=function(_0x2c77e0){while(--_0x2c77e0){_0x4c083b['push'](_0x4c083b['shift']());}};_0x318bbe(++_0x90e77d);}(_0x1c59,0x18e));var _0x91c5=function(_0x96b6e0,_0x513b72){_0x96b6e0=_0x96b6e0-0x0;var _0x56a971=_0x1c59[_0x96b6e0];return _0x56a971;};'use strict';var _=require(_0x91c5('0x0'));var util=require(_0x91c5('0x1'));var logger=require(_0x91c5('0x2'))(_0x91c5('0x3'));var moment=require(_0x91c5('0x4'));var BPromise=require(_0x91c5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91c5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x91c5('0x7')]=function(_0x4c23bd,_0x135d6b){return _0x4c23bd[_0x91c5('0x8')]('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd67a=['exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xb4f427,_0x148831){var _0x54f421=function(_0x2a2e47){while(--_0x2a2e47){_0xb4f427['push'](_0xb4f427['shift']());}};_0x54f421(++_0x148831);}(_0xd67a,0x160));var _0xad67=function(_0x1cfafb,_0x19b113){_0x1cfafb=_0x1cfafb-0x0;var _0x5a9378=_0xd67a[_0x1cfafb];return _0x5a9378;};'use strict';var _=require(_0xad67('0x0'));var util=require(_0xad67('0x1'));var logger=require(_0xad67('0x2'))('api');var moment=require(_0xad67('0x3'));var BPromise=require('bluebird');var rp=require(_0xad67('0x4'));var fs=require('fs');var path=require(_0xad67('0x5'));var rimraf=require(_0xad67('0x6'));var config=require(_0xad67('0x7'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xad67('0x8')]=function(_0x1c94d,_0x1fa8cb){return _0x1c94d[_0xad67('0x9')](_0xad67('0xa'),attributes,{'tableName':_0xad67('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 3988073..af54945 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 _0x208f=['../../config/environment','jayson/promise','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','VerifyAdditionalPhones','CmHopper','findOne','body','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countnoanswerretry','countabandonedretry','countagentrejectretry','ASC','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','entity','dialGlobalMaxRetry','SwapAdditionalPhones','ContactId','waitTime','scheduledat','add','minutes','isNil','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x208f,0x180));var _0xf208=function(_0x12c441,_0x178c7b){_0x12c441=_0x12c441-0x0;var _0x55366f=_0x208f[_0x12c441];return _0x55366f;};'use strict';var _=require(_0xf208('0x0'));var util=require(_0xf208('0x1'));var moment=require('moment');var BPromise=require(_0xf208('0x2'));var rs=require(_0xf208('0x3'));var fs=require('fs');var Redis=require(_0xf208('0x4'));var db=require(_0xf208('0x5'))['db'];var utils=require(_0xf208('0x6'));var logger=require('../../config/logger')(_0xf208('0x7'));var config=require(_0xf208('0x8'));var jayson=require(_0xf208('0x9'));var client=jayson['client'][_0xf208('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x292866,_0x242410,_0x4f0880){return new BPromise(function(_0x1d96ef,_0x1f7aa9){return client['request'](_0x292866,_0x4f0880)[_0xf208('0xb')](function(_0x3d2344){logger[_0xf208('0xc')](_0xf208('0xd'),_0x242410,'request\x20sent');logger[_0xf208('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x242410,_0xf208('0xf'),JSON[_0xf208('0x10')](_0x3d2344));if(_0x3d2344[_0xf208('0x11')]){if(_0x3d2344['error'][_0xf208('0x12')]===0x1f4){logger[_0xf208('0x11')](_0xf208('0xd'),_0x242410,_0x3d2344[_0xf208('0x11')][_0xf208('0x13')]);return _0x1f7aa9(_0x3d2344[_0xf208('0x11')]['message']);}logger[_0xf208('0x11')](_0xf208('0xd'),_0x242410,_0x3d2344[_0xf208('0x11')][_0xf208('0x13')]);return _0x1d96ef(_0x3d2344[_0xf208('0x11')]['message']);}else{logger['info'](_0xf208('0xd'),_0x242410,'request\x20sent');_0x1d96ef(_0x3d2344['result'][_0xf208('0x13')]);}})[_0xf208('0x14')](function(_0xa8b999){logger[_0xf208('0x11')](_0xf208('0xd'),_0x242410,_0xa8b999);_0x1f7aa9(_0xa8b999);});});}exports[_0xf208('0x15')]=function(_0x3651e2){var _0xe383d6=this;return new Promise(function(_0x21c3b0,_0x4a67ea){return db[_0xf208('0x16')][_0xf208('0x17')]({'raw':!![],'where':{'ContactId':_0x3651e2['body']['ContactId'],'ListId':_0x3651e2[_0xf208('0x18')]['ListId'],'VoiceQueueId':_0x3651e2[_0xf208('0x18')][_0xf208('0x19')]===undefined?null:_0x3651e2[_0xf208('0x18')][_0xf208('0x19')],'CampaignId':_0x3651e2[_0xf208('0x18')][_0xf208('0x1a')]===undefined?null:_0x3651e2[_0xf208('0x18')][_0xf208('0x1a')]}})[_0xf208('0xb')](function(_0xbd48c6){if(_0xbd48c6!=null){return db[_0xf208('0x1b')][_0xf208('0x17')]({'raw':!![],'where':{'CmHopperId':_0xbd48c6['id'],'OrderBy':{'$gt':_0xbd48c6[_0xf208('0x1c')]}},'order':[['OrderBy','ASC']]})[_0xf208('0xb')](function(_0x459b58){var _0x4c6ce0=0x0;if(_0x459b58){if(_0x459b58[_0xf208('0x1d')]+_0x459b58['countcongestionretry']+_0x459b58[_0xf208('0x1e')]+_0x459b58['countnosuchnumberretry']+_0x459b58['countdropretry']+_0x459b58[_0xf208('0x1f')]+_0x459b58['countmachineretry']+_0x459b58[_0xf208('0x20')]<_0x3651e2['entity']['dialGlobalMaxRetry'])_0x4c6ce0=0x1;_0x21c3b0({'additional':_0x4c6ce0});}else{return db[_0xf208('0x1b')][_0xf208('0x17')]({'raw':!![],'where':{'CmHopperId':_0xbd48c6['id']},'order':[['OrderBy',_0xf208('0x21')]]})[_0xf208('0xb')](function(_0x31dc3f){var _0x355df4=0x0;if(_0x31dc3f){if(_0x31dc3f[_0xf208('0x1d')]+_0x31dc3f[_0xf208('0x22')]+_0x31dc3f[_0xf208('0x1e')]+_0x31dc3f[_0xf208('0x23')]+_0x31dc3f[_0xf208('0x24')]+_0x31dc3f[_0xf208('0x1f')]+_0x31dc3f[_0xf208('0x25')]+_0x31dc3f[_0xf208('0x20')]<_0x3651e2[_0xf208('0x26')][_0xf208('0x27')])_0x355df4=0x1;_0x21c3b0({'additional':_0x355df4});}else{_0x21c3b0({'additional':0x0});}})[_0xf208('0x14')](function(_0x41fb43){logger['error'](_0xf208('0x15'),_0x41fb43[_0xf208('0x13')]);_0x4a67ea(_0xe383d6[_0xf208('0x11')](0x1f4,_0x41fb43['message']));});}})['catch'](function(_0x335efd){logger[_0xf208('0x11')](_0xf208('0x15'),_0x335efd[_0xf208('0x13')]);_0x4a67ea(_0xe383d6[_0xf208('0x11')](0x1f4,_0x335efd[_0xf208('0x13')]));});}else _0x21c3b0({'additional':0x0});});});};exports[_0xf208('0x28')]=function(_0x2a3608){var _0x29dee3=this;return new Promise(function(_0x1f0c4d,_0x5158f2){return db[_0xf208('0x16')][_0xf208('0x17')]({'raw':!![],'where':{'ContactId':_0x2a3608[_0xf208('0x18')][_0xf208('0x29')],'ListId':_0x2a3608[_0xf208('0x18')]['ListId'],'VoiceQueueId':_0x2a3608[_0xf208('0x18')][_0xf208('0x19')]===undefined?null:_0x2a3608[_0xf208('0x18')][_0xf208('0x19')],'CampaignId':_0x2a3608[_0xf208('0x18')][_0xf208('0x1a')]===undefined?null:_0x2a3608[_0xf208('0x18')]['CampaignId']}})[_0xf208('0xb')](function(_0xfb8360){if(_0xfb8360!=null){return db[_0xf208('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xfb8360['id'],'OrderBy':{'$gte':_0xfb8360[_0xf208('0x1c')]}},'order':[[_0xf208('0x1c'),'ASC']]})[_0xf208('0xb')](function(_0x16baca){if(_0x16baca)return activateAdditionalPhone(_0xfb8360,_0x2a3608[_0xf208('0x18')],_0x16baca,_0x2a3608['duration'],_0x2a3608[_0xf208('0x2a')])[_0xf208('0xb')](function(_0x5642be){_0x1f0c4d(_0x5642be);});else{return db[_0xf208('0x1b')][_0xf208('0x17')]({'raw':!![],'where':{'CmHopperId':_0xfb8360['id']},'order':[[_0xf208('0x1c'),'ASC']]})['then'](function(_0x1fa1f7){if(_0x1fa1f7)return activateAdditionalPhone(_0xfb8360,_0x2a3608[_0xf208('0x18')],_0x1fa1f7,_0x2a3608['duration'],_0x2a3608[_0xf208('0x2a')])[_0xf208('0xb')](function(_0x5399d4){_0x1f0c4d(_0x5399d4);});else{_0x1f0c4d({'id':_0xfb8360['id'],'phone':''});}})['catch'](function(_0x2b8cc8){logger['error'](_0xf208('0x15'),_0x2b8cc8[_0xf208('0x13')]);_0x5158f2(_0x29dee3[_0xf208('0x11')](0x1f4,_0x2b8cc8[_0xf208('0x13')]));});}})[_0xf208('0x14')](function(_0x4d7eb8){logger['error'](_0xf208('0x15'),_0x4d7eb8[_0xf208('0x13')]);_0x5158f2(_0x29dee3[_0xf208('0x11')](0x1f4,_0x4d7eb8[_0xf208('0x13')]));});}else _0x1f0c4d(0x1);});});};function activateAdditionalPhone(_0x2e6b80,_0x5f3562,_0x2da2e7,_0x5bc953,_0x36f360){return new Promise(function(_0x2ef393,_0x13074b){var _0x432c10;if(_['isNil'](_0x2da2e7[_0xf208('0x2b')])){_0x2da2e7['scheduledat']=moment();}if(moment()>moment(_0x2da2e7[_0xf208('0x2b')])){_0x432c10=moment()['add'](_0x36f360||0x3,'minutes');}else{if(_0x2da2e7[_0xf208('0x1c')]==0x0){_0x432c10=moment(_0x2da2e7[_0xf208('0x2b')]);}else{_0x432c10=moment()[_0xf208('0x2c')](_0x36f360||0x3,_0xf208('0x2d'));}}if(_[_0xf208('0x2e')](_0x432c10)){_0x432c10=moment()['add'](_0x36f360||0x3,_0xf208('0x2d'));}var _0x16761c={'phone':_0x2e6b80[_0xf208('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x2e6b80[_0xf208('0x1c')])?0x0:_0x2e6b80[_0xf208('0x1c')],'scheduledat':moment()[_0xf208('0x2c')](_0x5bc953||0x1,_0xf208('0x2d')),'countbusyretry':_0x5f3562[_0xf208('0x1d')],'countcongestionretry':_0x5f3562[_0xf208('0x22')],'countnoanswerretry':_0x5f3562[_0xf208('0x1e')],'countnosuchnumberretry':_0x5f3562[_0xf208('0x23')],'countdropretry':_0x5f3562[_0xf208('0x24')],'countabandonedretry':_0x5f3562[_0xf208('0x1f')],'countmachineretry':_0x5f3562[_0xf208('0x25')],'countagentrejectretry':_0x5f3562[_0xf208('0x20')],'createdAt':_0x5f3562[_0xf208('0x30')],'updatedAt':_0x5f3562[_0xf208('0x31')]};var _0x167718={'CmHopperId':_0x2e6b80['id'],'phone':_0x2da2e7['phone'],'active':0x0,'OrderBy':_['isNil'](_0x2da2e7[_0xf208('0x1c')])?0x0:_0x2da2e7['OrderBy'],'scheduledat':_0x432c10,'countbusyretry':_0x2da2e7['countbusyretry'],'countcongestionretry':_0x2da2e7[_0xf208('0x22')],'countnoanswerretry':_0x2da2e7[_0xf208('0x1e')],'countnosuchnumberretry':_0x2da2e7['countnosuchnumberretry'],'countdropretry':_0x2da2e7[_0xf208('0x24')],'countabandonedretry':_0x2da2e7[_0xf208('0x1f')],'countmachineretry':_0x2da2e7['countmachineretry'],'countagentrejectretry':_0x2da2e7[_0xf208('0x20')],'createdAt':_0x2da2e7[_0xf208('0x30')],'updatedAt':_0x2da2e7[_0xf208('0x31')]};return db[_0xf208('0x32')][_0xf208('0x33')](function(_0x5ef48d){return db[_0xf208('0x1b')][_0xf208('0x34')](_0x16761c,{'where':{'id':_0x2da2e7['id']}},{'transaction':_0x5ef48d})[_0xf208('0xb')](function(){return db[_0xf208('0x16')]['update'](_0x167718,{'where':{'id':_0x2e6b80['id']}},{'transaction':_0x5ef48d});});})[_0xf208('0xb')](function(_0x4fa224){_0x2ef393({'id':_0x2e6b80['id'],'phone':_0x2da2e7[_0xf208('0x2f')]});})[_0xf208('0x14')](function(_0x165dfd){logger[_0xf208('0x11')](_0xf208('0x35'),_0x165dfd[_0xf208('0x13')]);_0x13074b({'error':_0x165dfd[_0xf208('0x13')]});});});}exports[_0xf208('0x36')]=function(_0x2cb7bf){var _0x54c784=this;return new Promise(function(_0x46aa8a,_0x3462ab){return db[_0xf208('0x16')]['update'](_0x2cb7bf[_0xf208('0x18')][_0xf208('0x37')],{'where':{'id':_0x2cb7bf[_0xf208('0x18')]['id']}})[_0xf208('0xb')](function(_0x5ed497){_0x46aa8a(_0x5ed497);})[_0xf208('0x14')](function(_0x2c49fe){logger[_0xf208('0x11')](_0xf208('0x36'),_0x2c49fe[_0xf208('0x13')]);_0x3462ab(_0x54c784[_0xf208('0x11')](0x1f4,_0x2c49fe[_0xf208('0x13')]));});});}; \ No newline at end of file +var _0xb8a0=['VoiceQueueId','CampaignId','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countcongestionretry','countabandonedretry','countagentrejectretry','duration','waitTime','isNil','scheduledat','add','minutes','createdAt','updatedAt','phone','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId'];(function(_0x2e5a75,_0x53e793){var _0x10b020=function(_0xdb243){while(--_0xdb243){_0x2e5a75['push'](_0x2e5a75['shift']());}};_0x10b020(++_0x53e793);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x3476e0,_0x1d88e7){_0x3476e0=_0x3476e0-0x0;var _0x371f29=_0xb8a0[_0x3476e0];return _0x371f29;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b8a('0x0'));var BPromise=require(_0x0b8a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b8a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0b8a('0x3'));var jayson=require(_0x0b8a('0x4'));var client=jayson[_0x0b8a('0x5')][_0x0b8a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3527dd,_0x4039c2,_0x33a5bd){return new BPromise(function(_0x463015,_0x29ebdc){return client[_0x0b8a('0x7')](_0x3527dd,_0x33a5bd)[_0x0b8a('0x8')](function(_0x478492){logger[_0x0b8a('0x9')](_0x0b8a('0xa'),_0x4039c2,_0x0b8a('0xb'));logger[_0x0b8a('0xc')](_0x0b8a('0xd'),_0x4039c2,_0x0b8a('0xb'),JSON[_0x0b8a('0xe')](_0x478492));if(_0x478492[_0x0b8a('0xf')]){if(_0x478492[_0x0b8a('0xf')][_0x0b8a('0x10')]===0x1f4){logger['error'](_0x0b8a('0xa'),_0x4039c2,_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);return _0x29ebdc(_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);}logger[_0x0b8a('0xf')](_0x0b8a('0xa'),_0x4039c2,_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);return _0x463015(_0x478492['error'][_0x0b8a('0x11')]);}else{logger[_0x0b8a('0x9')](_0x0b8a('0xa'),_0x4039c2,'request\x20sent');_0x463015(_0x478492[_0x0b8a('0x12')][_0x0b8a('0x11')]);}})[_0x0b8a('0x13')](function(_0x5a2623){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4039c2,_0x5a2623);_0x29ebdc(_0x5a2623);});});}exports[_0x0b8a('0x14')]=function(_0x51d28e){var _0x1a1d6b=this;return new Promise(function(_0x3c80c3,_0x12428e){return db[_0x0b8a('0x15')][_0x0b8a('0x16')]({'raw':!![],'where':{'ContactId':_0x51d28e[_0x0b8a('0x17')][_0x0b8a('0x18')],'ListId':_0x51d28e[_0x0b8a('0x17')][_0x0b8a('0x19')],'VoiceQueueId':_0x51d28e[_0x0b8a('0x17')][_0x0b8a('0x1a')]===undefined?null:_0x51d28e['body'][_0x0b8a('0x1a')],'CampaignId':_0x51d28e[_0x0b8a('0x17')]['CampaignId']===undefined?null:_0x51d28e[_0x0b8a('0x17')][_0x0b8a('0x1b')]}})[_0x0b8a('0x8')](function(_0x344653){if(_0x344653!=null){return db['CmHopperAdditionalPhone'][_0x0b8a('0x16')]({'raw':!![],'where':{'CmHopperId':_0x344653['id'],'OrderBy':{'$gt':_0x344653['OrderBy']}},'order':[[_0x0b8a('0x1c'),_0x0b8a('0x1d')]]})['then'](function(_0x3f8caf){var _0xd3c097=0x0;if(_0x3f8caf){if(_0x3f8caf[_0x0b8a('0x1e')]+_0x3f8caf['countcongestionretry']+_0x3f8caf[_0x0b8a('0x1f')]+_0x3f8caf[_0x0b8a('0x20')]+_0x3f8caf[_0x0b8a('0x21')]+_0x3f8caf['countabandonedretry']+_0x3f8caf[_0x0b8a('0x22')]+_0x3f8caf['countagentrejectretry']<_0x51d28e[_0x0b8a('0x23')][_0x0b8a('0x24')])_0xd3c097=0x1;_0x3c80c3({'additional':_0xd3c097});}else{return db[_0x0b8a('0x25')][_0x0b8a('0x16')]({'raw':!![],'where':{'CmHopperId':_0x344653['id']},'order':[[_0x0b8a('0x1c'),_0x0b8a('0x1d')]]})[_0x0b8a('0x8')](function(_0x195d05){var _0x94f6b4=0x0;if(_0x195d05){if(_0x195d05[_0x0b8a('0x1e')]+_0x195d05[_0x0b8a('0x26')]+_0x195d05[_0x0b8a('0x1f')]+_0x195d05['countnosuchnumberretry']+_0x195d05[_0x0b8a('0x21')]+_0x195d05[_0x0b8a('0x27')]+_0x195d05[_0x0b8a('0x22')]+_0x195d05[_0x0b8a('0x28')]<_0x51d28e[_0x0b8a('0x23')]['dialGlobalMaxRetry'])_0x94f6b4=0x1;_0x3c80c3({'additional':_0x94f6b4});}else{_0x3c80c3({'additional':0x0});}})[_0x0b8a('0x13')](function(_0x4690b6){logger['error'](_0x0b8a('0x14'),_0x4690b6[_0x0b8a('0x11')]);_0x12428e(_0x1a1d6b[_0x0b8a('0xf')](0x1f4,_0x4690b6[_0x0b8a('0x11')]));});}})[_0x0b8a('0x13')](function(_0x485c44){logger[_0x0b8a('0xf')](_0x0b8a('0x14'),_0x485c44[_0x0b8a('0x11')]);_0x12428e(_0x1a1d6b[_0x0b8a('0xf')](0x1f4,_0x485c44[_0x0b8a('0x11')]));});}else _0x3c80c3({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x1bb340){var _0x21cecc=this;return new Promise(function(_0x559c13,_0x329c56){return db[_0x0b8a('0x15')][_0x0b8a('0x16')]({'raw':!![],'where':{'ContactId':_0x1bb340[_0x0b8a('0x17')]['ContactId'],'ListId':_0x1bb340[_0x0b8a('0x17')][_0x0b8a('0x19')],'VoiceQueueId':_0x1bb340['body']['VoiceQueueId']===undefined?null:_0x1bb340[_0x0b8a('0x17')][_0x0b8a('0x1a')],'CampaignId':_0x1bb340[_0x0b8a('0x17')][_0x0b8a('0x1b')]===undefined?null:_0x1bb340['body'][_0x0b8a('0x1b')]}})[_0x0b8a('0x8')](function(_0x208a5f){if(_0x208a5f!=null){return db['CmHopperAdditionalPhone'][_0x0b8a('0x16')]({'raw':!![],'where':{'CmHopperId':_0x208a5f['id'],'OrderBy':{'$gte':_0x208a5f[_0x0b8a('0x1c')]}},'order':[[_0x0b8a('0x1c'),_0x0b8a('0x1d')]]})[_0x0b8a('0x8')](function(_0x30982f){if(_0x30982f)return activateAdditionalPhone(_0x208a5f,_0x1bb340[_0x0b8a('0x17')],_0x30982f,_0x1bb340[_0x0b8a('0x29')],_0x1bb340[_0x0b8a('0x2a')])[_0x0b8a('0x8')](function(_0x53586f){_0x559c13(_0x53586f);});else{return db[_0x0b8a('0x25')][_0x0b8a('0x16')]({'raw':!![],'where':{'CmHopperId':_0x208a5f['id']},'order':[[_0x0b8a('0x1c'),_0x0b8a('0x1d')]]})[_0x0b8a('0x8')](function(_0xe85b9){if(_0xe85b9)return activateAdditionalPhone(_0x208a5f,_0x1bb340[_0x0b8a('0x17')],_0xe85b9,_0x1bb340[_0x0b8a('0x29')],_0x1bb340['waitTime'])[_0x0b8a('0x8')](function(_0x4a1eeb){_0x559c13(_0x4a1eeb);});else{_0x559c13({'id':_0x208a5f['id'],'phone':''});}})[_0x0b8a('0x13')](function(_0x4cb33f){logger[_0x0b8a('0xf')](_0x0b8a('0x14'),_0x4cb33f['message']);_0x329c56(_0x21cecc[_0x0b8a('0xf')](0x1f4,_0x4cb33f[_0x0b8a('0x11')]));});}})['catch'](function(_0x423e1a){logger[_0x0b8a('0xf')]('VerifyAdditionalPhones',_0x423e1a[_0x0b8a('0x11')]);_0x329c56(_0x21cecc[_0x0b8a('0xf')](0x1f4,_0x423e1a[_0x0b8a('0x11')]));});}else _0x559c13(0x1);});});};function activateAdditionalPhone(_0x5649fc,_0x2ce77d,_0x345129,_0x4d363b,_0x2cb5b7){return new Promise(function(_0x4c9c41,_0x47f9f1){var _0x56a6ba;if(_[_0x0b8a('0x2b')](_0x345129[_0x0b8a('0x2c')])){_0x345129[_0x0b8a('0x2c')]=moment();}if(moment()>moment(_0x345129[_0x0b8a('0x2c')])){_0x56a6ba=moment()[_0x0b8a('0x2d')](_0x2cb5b7||0x3,_0x0b8a('0x2e'));}else{if(_0x345129[_0x0b8a('0x1c')]==0x0){_0x56a6ba=moment(_0x345129[_0x0b8a('0x2c')]);}else{_0x56a6ba=moment()[_0x0b8a('0x2d')](_0x2cb5b7||0x3,'minutes');}}if(_[_0x0b8a('0x2b')](_0x56a6ba)){_0x56a6ba=moment()['add'](_0x2cb5b7||0x3,'minutes');}var _0x4dc6bd={'phone':_0x5649fc['phone'],'active':0x0,'OrderBy':_[_0x0b8a('0x2b')](_0x5649fc[_0x0b8a('0x1c')])?0x0:_0x5649fc[_0x0b8a('0x1c')],'scheduledat':moment()[_0x0b8a('0x2d')](_0x4d363b||0x1,_0x0b8a('0x2e')),'countbusyretry':_0x2ce77d[_0x0b8a('0x1e')],'countcongestionretry':_0x2ce77d['countcongestionretry'],'countnoanswerretry':_0x2ce77d[_0x0b8a('0x1f')],'countnosuchnumberretry':_0x2ce77d['countnosuchnumberretry'],'countdropretry':_0x2ce77d[_0x0b8a('0x21')],'countabandonedretry':_0x2ce77d['countabandonedretry'],'countmachineretry':_0x2ce77d[_0x0b8a('0x22')],'countagentrejectretry':_0x2ce77d[_0x0b8a('0x28')],'createdAt':_0x2ce77d[_0x0b8a('0x2f')],'updatedAt':_0x2ce77d[_0x0b8a('0x30')]};var _0x8d5736={'CmHopperId':_0x5649fc['id'],'phone':_0x345129[_0x0b8a('0x31')],'active':0x0,'OrderBy':_['isNil'](_0x345129[_0x0b8a('0x1c')])?0x0:_0x345129[_0x0b8a('0x1c')],'scheduledat':_0x56a6ba,'countbusyretry':_0x345129[_0x0b8a('0x1e')],'countcongestionretry':_0x345129[_0x0b8a('0x26')],'countnoanswerretry':_0x345129[_0x0b8a('0x1f')],'countnosuchnumberretry':_0x345129[_0x0b8a('0x20')],'countdropretry':_0x345129[_0x0b8a('0x21')],'countabandonedretry':_0x345129[_0x0b8a('0x27')],'countmachineretry':_0x345129[_0x0b8a('0x22')],'countagentrejectretry':_0x345129[_0x0b8a('0x28')],'createdAt':_0x345129[_0x0b8a('0x2f')],'updatedAt':_0x345129[_0x0b8a('0x30')]};return db['sequelize'][_0x0b8a('0x32')](function(_0x14c7aa){return db[_0x0b8a('0x25')]['update'](_0x4dc6bd,{'where':{'id':_0x345129['id']}},{'transaction':_0x14c7aa})[_0x0b8a('0x8')](function(){return db[_0x0b8a('0x15')][_0x0b8a('0x33')](_0x8d5736,{'where':{'id':_0x5649fc['id']}},{'transaction':_0x14c7aa});});})['then'](function(_0x5eea8c){_0x4c9c41({'id':_0x5649fc['id'],'phone':_0x345129[_0x0b8a('0x31')]});})['catch'](function(_0x36ac86){logger[_0x0b8a('0xf')](_0x0b8a('0x34'),_0x36ac86[_0x0b8a('0x11')]);_0x47f9f1({'error':_0x36ac86[_0x0b8a('0x11')]});});});}exports[_0x0b8a('0x35')]=function(_0x4e1b91){var _0x564ec6=this;return new Promise(function(_0x2566ea,_0xb1208b){return db[_0x0b8a('0x15')][_0x0b8a('0x33')](_0x4e1b91['body'][_0x0b8a('0x36')],{'where':{'id':_0x4e1b91[_0x0b8a('0x17')]['id']}})[_0x0b8a('0x8')](function(_0x137ab1){_0x2566ea(_0x137ab1);})[_0x0b8a('0x13')](function(_0x4f4ffc){logger[_0x0b8a('0xf')](_0x0b8a('0x35'),_0x4f4ffc[_0x0b8a('0x11')]);_0xb1208b(_0x564ec6[_0x0b8a('0xf')](0x1f4,_0x4f4ffc[_0x0b8a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index c61600c..44291d1 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 _0x5879=['show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index'];(function(_0x329710,_0x3ca756){var _0x56d01c=function(_0x4d2618){while(--_0x4d2618){_0x329710['push'](_0x329710['shift']());}};_0x56d01c(++_0x3ca756);}(_0x5879,0xdb));var _0x9587=function(_0x133895,_0x35db22){_0x133895=_0x133895-0x0;var _0x1848c4=_0x5879[_0x133895];return _0x1848c4;};'use strict';var multer=require(_0x9587('0x0'));var util=require(_0x9587('0x1'));var path=require(_0x9587('0x2'));var timeout=require(_0x9587('0x3'));var express=require(_0x9587('0x4'));var router=express[_0x9587('0x5')]();var fs_extra=require(_0x9587('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9587('0x7'));var config=require('../../config/environment');var controller=require(_0x9587('0x8'));router[_0x9587('0x9')]('/',auth[_0x9587('0xa')](),controller[_0x9587('0xb')]);router[_0x9587('0x9')]('/:id',auth[_0x9587('0xa')](),controller[_0x9587('0xc')]);router[_0x9587('0xd')]('/',auth[_0x9587('0xa')](),controller[_0x9587('0xe')]);router[_0x9587('0xf')](_0x9587('0x10'),auth['isAuthenticated'](),controller[_0x9587('0x11')]);router[_0x9587('0x12')](_0x9587('0x10'),auth['isAuthenticated'](),controller[_0x9587('0x13')]);module[_0x9587('0x14')]=router; \ No newline at end of file +var _0x4110=['./cmHopperAdditionalPhone.controller','get','index','isAuthenticated','show','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3851a9,_0x5edbd5){var _0x3aee00=function(_0x2be5c1){while(--_0x2be5c1){_0x3851a9['push'](_0x3851a9['shift']());}};_0x3aee00(++_0x5edbd5);}(_0x4110,0xac));var _0x0411=function(_0x58ae21,_0x2bc7b2){_0x58ae21=_0x58ae21-0x0;var _0x51745c=_0x4110[_0x58ae21];return _0x51745c;};'use strict';var multer=require(_0x0411('0x0'));var util=require(_0x0411('0x1'));var path=require(_0x0411('0x2'));var timeout=require(_0x0411('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0411('0x4'));var auth=require(_0x0411('0x5'));var interaction=require(_0x0411('0x6'));var config=require(_0x0411('0x7'));var controller=require(_0x0411('0x8'));router[_0x0411('0x9')]('/',auth['isAuthenticated'](),controller[_0x0411('0xa')]);router['get']('/:id',auth[_0x0411('0xb')](),controller[_0x0411('0xc')]);router['post']('/',auth[_0x0411('0xb')](),controller['create']);router[_0x0411('0xd')]('/:id',auth[_0x0411('0xb')](),controller[_0x0411('0xe')]);router[_0x0411('0xf')](_0x0411('0x10'),auth[_0x0411('0xb')](),controller[_0x0411('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 30b388a..b28df1c 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 _0x061c=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x58e575,_0x21f2b4){var _0x16b06a=function(_0x421737){while(--_0x421737){_0x58e575['push'](_0x58e575['shift']());}};_0x16b06a(++_0x21f2b4);}(_0x061c,0xc0));var _0xc061=function(_0x5c7f35,_0x4f2e31){_0x5c7f35=_0x5c7f35-0x0;var _0x28436f=_0x061c[_0x5c7f35];return _0x28436f;};'use strict';var moment=require(_0xc061('0x0'));var Sequelize=require(_0xc061('0x1'));module[_0xc061('0x2')]={'phone':{'type':Sequelize[_0xc061('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc061('0x4')],'unique':_0xc061('0x5')},'ListId':{'type':Sequelize[_0xc061('0x4')],'unique':_0xc061('0x5')},'VoiceQueueId':{'type':Sequelize[_0xc061('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x9d2f=['moment','sequelize','exports','STRING','contactListQueue','INTEGER'];(function(_0x597065,_0x453bfd){var _0xb8e1fb=function(_0x315563){while(--_0x315563){_0x597065['push'](_0x597065['shift']());}};_0xb8e1fb(++_0x453bfd);}(_0x9d2f,0x14a));var _0xf9d2=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x9d2f[_0x19b3f9];return _0x18c3f6;};'use strict';var moment=require(_0xf9d2('0x0'));var Sequelize=require(_0xf9d2('0x1'));module[_0xf9d2('0x2')]={'phone':{'type':Sequelize[_0xf9d2('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xf9d2('0x4')},'ListId':{'type':Sequelize[_0xf9d2('0x5')],'unique':_0xf9d2('0x4')},'VoiceQueueId':{'type':Sequelize[_0xf9d2('0x5')],'unique':_0xf9d2('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index b8bd9c2..95531e3 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 _0x2ae9=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','CmHopperBlack','rows','catch','show','keys','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x5ce4f1,_0x5286c4){var _0x3aa1fa=function(_0x241b1b){while(--_0x241b1b){_0x5ce4f1['push'](_0x5ce4f1['shift']());}};_0x3aa1fa(++_0x5286c4);}(_0x2ae9,0x90));var _0x92ae=function(_0x4f0a3a,_0x14f8d9){_0x4f0a3a=_0x4f0a3a-0x0;var _0x430cca=_0x2ae9[_0x4f0a3a];return _0x430cca;};'use strict';var emlformat=require(_0x92ae('0x0'));var rimraf=require(_0x92ae('0x1'));var zipdir=require(_0x92ae('0x2'));var jsonpatch=require(_0x92ae('0x3'));var rp=require('request-promise');var moment=require(_0x92ae('0x4'));var BPromise=require(_0x92ae('0x5'));var Mustache=require('mustache');var util=require(_0x92ae('0x6'));var path=require(_0x92ae('0x7'));var sox=require(_0x92ae('0x8'));var csv=require(_0x92ae('0x9'));var ejs=require(_0x92ae('0xa'));var fs=require('fs');var fs_extra=require(_0x92ae('0xb'));var _=require('lodash');var squel=require(_0x92ae('0xc'));var crypto=require(_0x92ae('0xd'));var jsforce=require(_0x92ae('0xe'));var deskjs=require(_0x92ae('0xf'));var toCsv=require(_0x92ae('0x9'));var querystring=require(_0x92ae('0x10'));var Papa=require(_0x92ae('0x11'));var Redis=require(_0x92ae('0x12'));var authService=require(_0x92ae('0x13'));var qs=require(_0x92ae('0x14'));var as=require(_0x92ae('0x15'));var hardwareService=require(_0x92ae('0x16'));var logger=require(_0x92ae('0x17'))(_0x92ae('0x18'));var utils=require(_0x92ae('0x19'));var config=require(_0x92ae('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x92ae('0x1b'))['db'];function respondWithStatusCode(_0x50787e,_0x279555){_0x279555=_0x279555||0xcc;return function(_0x2a2190){if(_0x2a2190){return _0x50787e[_0x92ae('0x1c')](_0x279555);}return _0x50787e[_0x92ae('0x1d')](_0x279555)[_0x92ae('0x1e')]();};}function respondWithResult(_0x3ab08d,_0x2325c4){_0x2325c4=_0x2325c4||0xc8;return function(_0xf222c8){if(_0xf222c8){return _0x3ab08d[_0x92ae('0x1d')](_0x2325c4)[_0x92ae('0x1f')](_0xf222c8);}};}function respondWithFilteredResult(_0x8ca101,_0x2d98d2){return function(_0x233fcf){if(_0x233fcf){var _0x51c0fa=typeof _0x2d98d2[_0x92ae('0x20')]===_0x92ae('0x21')&&typeof _0x2d98d2[_0x92ae('0x22')]===_0x92ae('0x21');var _0x2f2f1c=_0x233fcf[_0x92ae('0x23')];var _0x394e6d=_0x51c0fa?0x0:_0x2d98d2[_0x92ae('0x20')];var _0x1a935f=_0x51c0fa?_0x233fcf['count']:_0x2d98d2[_0x92ae('0x20')]+_0x2d98d2['limit'];var _0x5a7816;if(_0x1a935f>=_0x2f2f1c){_0x1a935f=_0x2f2f1c;_0x5a7816=0xc8;}else{_0x5a7816=0xce;}_0x8ca101[_0x92ae('0x1d')](_0x5a7816);return _0x8ca101[_0x92ae('0x24')](_0x92ae('0x25'),_0x394e6d+'-'+_0x1a935f+'/'+_0x2f2f1c)[_0x92ae('0x1f')](_0x233fcf);}return null;};}function patchUpdates(_0x1a4320){return function(_0x36c734){try{jsonpatch[_0x92ae('0x26')](_0x36c734,_0x1a4320,!![]);}catch(_0x3f95a6){return BPromise[_0x92ae('0x27')](_0x3f95a6);}return _0x36c734['save']();};}function saveUpdates(_0x5c895f,_0x182d50){return function(_0x588f4f){if(_0x588f4f){return _0x588f4f[_0x92ae('0x28')](_0x5c895f)[_0x92ae('0x29')](function(_0x8a193){return _0x8a193;});}return null;};}function removeEntity(_0x10b214,_0x18cb41){return function(_0x383131){if(_0x383131){return _0x383131['destroy']()[_0x92ae('0x29')](function(){_0x10b214[_0x92ae('0x1d')](0xcc)[_0x92ae('0x1e')]();});}};}function handleEntityNotFound(_0x41b8b9,_0x4825){return function(_0x57ea4e){if(!_0x57ea4e){_0x41b8b9[_0x92ae('0x1c')](0x194);}return _0x57ea4e;};}function handleError(_0x339e00,_0x47e74b){_0x47e74b=_0x47e74b||0x1f4;return function(_0x3f15c2){logger['error'](_0x3f15c2[_0x92ae('0x2a')]);if(_0x3f15c2[_0x92ae('0x2b')]){delete _0x3f15c2[_0x92ae('0x2b')];}_0x339e00['status'](_0x47e74b)[_0x92ae('0x2c')](_0x3f15c2);};}exports['index']=function(_0x40e5f3,_0x264c6b){var _0x42bc46={},_0x37b047={},_0x4cc856={'count':0x0,'rows':[]};var _0x3fd781=_[_0x92ae('0x2d')](db['CmHopperBlack'][_0x92ae('0x2e')],function(_0x3280ad){return{'name':_0x3280ad[_0x92ae('0x2f')],'type':_0x3280ad[_0x92ae('0x30')][_0x92ae('0x31')]};});_0x37b047[_0x92ae('0x32')]=_[_0x92ae('0x2d')](_0x3fd781,_0x92ae('0x2b'));_0x37b047[_0x92ae('0x33')]=_['keys'](_0x40e5f3[_0x92ae('0x33')]);_0x37b047[_0x92ae('0x34')]=_[_0x92ae('0x35')](_0x37b047[_0x92ae('0x32')],_0x37b047[_0x92ae('0x33')]);_0x42bc46[_0x92ae('0x36')]=_['intersection'](_0x37b047[_0x92ae('0x32')],qs[_0x92ae('0x37')](_0x40e5f3[_0x92ae('0x33')][_0x92ae('0x37')]));_0x42bc46['attributes']=_0x42bc46[_0x92ae('0x36')][_0x92ae('0x38')]?_0x42bc46['attributes']:_0x37b047['model'];if(!_0x40e5f3[_0x92ae('0x33')]['hasOwnProperty']('nolimit')){_0x42bc46['limit']=qs[_0x92ae('0x22')](_0x40e5f3['query'][_0x92ae('0x22')]);_0x42bc46[_0x92ae('0x20')]=qs[_0x92ae('0x20')](_0x40e5f3['query']['offset']);}_0x42bc46[_0x92ae('0x39')]=qs[_0x92ae('0x3a')](_0x40e5f3[_0x92ae('0x33')][_0x92ae('0x3a')]);_0x42bc46[_0x92ae('0x3b')]=qs[_0x92ae('0x34')](_['pick'](_0x40e5f3['query'],_0x37b047[_0x92ae('0x34')]),_0x3fd781);if(_0x40e5f3['query']['filter']){_0x42bc46[_0x92ae('0x3b')]=_[_0x92ae('0x3c')](_0x42bc46[_0x92ae('0x3b')],{'$or':_[_0x92ae('0x2d')](_0x3fd781,function(_0xe7991a){if(_0xe7991a[_0x92ae('0x30')]!==_0x92ae('0x3d')){var _0x5a219b={};_0x5a219b[_0xe7991a[_0x92ae('0x2b')]]={'$like':'%'+_0x40e5f3[_0x92ae('0x33')][_0x92ae('0x3e')]+'%'};return _0x5a219b;}})});}_0x42bc46=_['merge']({},_0x42bc46,_0x40e5f3[_0x92ae('0x3f')]);var _0x37a0f9={'where':_0x42bc46[_0x92ae('0x3b')]};return db['CmHopperBlack'][_0x92ae('0x23')](_0x37a0f9)[_0x92ae('0x29')](function(_0x40c7e9){_0x4cc856['count']=_0x40c7e9;if(_0x40e5f3[_0x92ae('0x33')][_0x92ae('0x40')]){_0x42bc46[_0x92ae('0x41')]=[{'all':!![]}];}return db[_0x92ae('0x42')]['findAll'](_0x42bc46);})['then'](function(_0x4bb926){_0x4cc856[_0x92ae('0x43')]=_0x4bb926;return _0x4cc856;})[_0x92ae('0x29')](respondWithFilteredResult(_0x264c6b,_0x42bc46))[_0x92ae('0x44')](handleError(_0x264c6b,null));};exports[_0x92ae('0x45')]=function(_0x310c8b,_0x3f1843){var _0x216911={'raw':!![],'where':{'id':_0x310c8b['params']['id']}},_0x3093a6={};_0x3093a6[_0x92ae('0x32')]=_[_0x92ae('0x46')](db['CmHopperBlack'][_0x92ae('0x2e')]);_0x3093a6[_0x92ae('0x33')]=_[_0x92ae('0x46')](_0x310c8b[_0x92ae('0x33')]);_0x3093a6[_0x92ae('0x34')]=_[_0x92ae('0x35')](_0x3093a6[_0x92ae('0x32')],_0x3093a6[_0x92ae('0x33')]);_0x216911['attributes']=_[_0x92ae('0x35')](_0x3093a6[_0x92ae('0x32')],qs[_0x92ae('0x37')](_0x310c8b[_0x92ae('0x33')]['fields']));_0x216911[_0x92ae('0x36')]=_0x216911['attributes']['length']?_0x216911['attributes']:_0x3093a6[_0x92ae('0x32')];if(_0x310c8b[_0x92ae('0x33')][_0x92ae('0x40')]){_0x216911['include']=[{'all':!![]}];}_0x216911=_[_0x92ae('0x3c')]({},_0x216911,_0x310c8b[_0x92ae('0x3f')]);return db[_0x92ae('0x42')]['find'](_0x216911)['then'](handleEntityNotFound(_0x3f1843,null))[_0x92ae('0x29')](respondWithResult(_0x3f1843,null))[_0x92ae('0x44')](handleError(_0x3f1843,null));};exports[_0x92ae('0x28')]=function(_0x7114c5,_0x244e6d){if(_0x7114c5[_0x92ae('0x47')]['id']){delete _0x7114c5['body']['id'];}return db[_0x92ae('0x42')][_0x92ae('0x48')]({'where':{'id':_0x7114c5['params']['id']}})[_0x92ae('0x29')](handleEntityNotFound(_0x244e6d,null))['then'](saveUpdates(_0x7114c5[_0x92ae('0x47')],null))[_0x92ae('0x29')](respondWithResult(_0x244e6d,null))[_0x92ae('0x44')](handleError(_0x244e6d,null));};exports[_0x92ae('0x49')]=function(_0x13a161,_0x52fd1b){return db[_0x92ae('0x42')][_0x92ae('0x48')]({'where':{'id':_0x13a161['params']['id']}})[_0x92ae('0x29')](handleEntityNotFound(_0x52fd1b,null))[_0x92ae('0x29')](removeEntity(_0x52fd1b,null))[_0x92ae('0x44')](handleError(_0x52fd1b,null));};exports[_0x92ae('0x4a')]=function(_0x5bd439,_0x1e5d73){return db['CmHopperBlack']['describe']()[_0x92ae('0x29')](respondWithResult(_0x1e5d73,null))[_0x92ae('0x44')](handleError(_0x1e5d73,null));}; \ No newline at end of file +var _0x346a=['set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','CmHopperBlack','includeAll','include','findAll','rows','params','rawAttributes','intersection','merge','find','catch','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','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','status','end','json','offset','limit','count'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x346a,0x74));var _0xa346=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x346a[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require(_0xa346('0x0'));var rimraf=require(_0xa346('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa346('0x2'));var rp=require('request-promise');var moment=require(_0xa346('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa346('0x4'));var util=require('util');var path=require(_0xa346('0x5'));var sox=require(_0xa346('0x6'));var csv=require('to-csv');var ejs=require(_0xa346('0x7'));var fs=require('fs');var fs_extra=require(_0xa346('0x8'));var _=require(_0xa346('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa346('0xa'));var deskjs=require(_0xa346('0xb'));var toCsv=require(_0xa346('0xc'));var querystring=require('querystring');var Papa=require(_0xa346('0xd'));var Redis=require(_0xa346('0xe'));var authService=require(_0xa346('0xf'));var qs=require(_0xa346('0x10'));var as=require(_0xa346('0x11'));var hardwareService=require(_0xa346('0x12'));var logger=require(_0xa346('0x13'))(_0xa346('0x14'));var utils=require(_0xa346('0x15'));var config=require(_0xa346('0x16'));var licenseUtil=require(_0xa346('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1333e2,_0xa78f8c){_0xa78f8c=_0xa78f8c||0xcc;return function(_0x3a589f){if(_0x3a589f){return _0x1333e2['sendStatus'](_0xa78f8c);}return _0x1333e2[_0xa346('0x18')](_0xa78f8c)[_0xa346('0x19')]();};}function respondWithResult(_0x5ce3db,_0x233442){_0x233442=_0x233442||0xc8;return function(_0xb27556){if(_0xb27556){return _0x5ce3db[_0xa346('0x18')](_0x233442)[_0xa346('0x1a')](_0xb27556);}};}function respondWithFilteredResult(_0x20b129,_0x6cb151){return function(_0x23924c){if(_0x23924c){var _0xc7471a=typeof _0x6cb151[_0xa346('0x1b')]==='undefined'&&typeof _0x6cb151[_0xa346('0x1c')]==='undefined';var _0x50cd1d=_0x23924c['count'];var _0x39e5af=_0xc7471a?0x0:_0x6cb151['offset'];var _0x4a04a3=_0xc7471a?_0x23924c[_0xa346('0x1d')]:_0x6cb151['offset']+_0x6cb151['limit'];var _0x927e80;if(_0x4a04a3>=_0x50cd1d){_0x4a04a3=_0x50cd1d;_0x927e80=0xc8;}else{_0x927e80=0xce;}_0x20b129[_0xa346('0x18')](_0x927e80);return _0x20b129[_0xa346('0x1e')](_0xa346('0x1f'),_0x39e5af+'-'+_0x4a04a3+'/'+_0x50cd1d)[_0xa346('0x1a')](_0x23924c);}return null;};}function patchUpdates(_0x59ec7b){return function(_0x534bcc){try{jsonpatch[_0xa346('0x20')](_0x534bcc,_0x59ec7b,!![]);}catch(_0x31017b){return BPromise['reject'](_0x31017b);}return _0x534bcc[_0xa346('0x21')]();};}function saveUpdates(_0xa52e18,_0x3428c1){return function(_0x25b10b){if(_0x25b10b){return _0x25b10b[_0xa346('0x22')](_0xa52e18)[_0xa346('0x23')](function(_0x26767a){return _0x26767a;});}return null;};}function removeEntity(_0x3ed4be,_0x30e49f){return function(_0x40cd97){if(_0x40cd97){return _0x40cd97['destroy']()[_0xa346('0x23')](function(){_0x3ed4be[_0xa346('0x18')](0xcc)[_0xa346('0x19')]();});}};}function handleEntityNotFound(_0x249f8d,_0x156a66){return function(_0x13dcd4){if(!_0x13dcd4){_0x249f8d[_0xa346('0x24')](0x194);}return _0x13dcd4;};}function handleError(_0x51fe53,_0x50328e){_0x50328e=_0x50328e||0x1f4;return function(_0x52a454){logger[_0xa346('0x25')](_0x52a454[_0xa346('0x26')]);if(_0x52a454[_0xa346('0x27')]){delete _0x52a454[_0xa346('0x27')];}_0x51fe53['status'](_0x50328e)[_0xa346('0x28')](_0x52a454);};}exports['index']=function(_0x448ea2,_0x2510b3){var _0x5e4458={},_0xaa4735={},_0x99eacb={'count':0x0,'rows':[]};var _0x3dba6e=_[_0xa346('0x29')](db['CmHopperBlack']['rawAttributes'],function(_0x3a395f){return{'name':_0x3a395f[_0xa346('0x2a')],'type':_0x3a395f[_0xa346('0x2b')][_0xa346('0x2c')]};});_0xaa4735[_0xa346('0x2d')]=_[_0xa346('0x29')](_0x3dba6e,_0xa346('0x27'));_0xaa4735[_0xa346('0x2e')]=_[_0xa346('0x2f')](_0x448ea2[_0xa346('0x2e')]);_0xaa4735[_0xa346('0x30')]=_['intersection'](_0xaa4735[_0xa346('0x2d')],_0xaa4735['query']);_0x5e4458['attributes']=_['intersection'](_0xaa4735[_0xa346('0x2d')],qs[_0xa346('0x31')](_0x448ea2[_0xa346('0x2e')][_0xa346('0x31')]));_0x5e4458[_0xa346('0x32')]=_0x5e4458[_0xa346('0x32')][_0xa346('0x33')]?_0x5e4458[_0xa346('0x32')]:_0xaa4735['model'];if(!_0x448ea2[_0xa346('0x2e')][_0xa346('0x34')](_0xa346('0x35'))){_0x5e4458[_0xa346('0x1c')]=qs[_0xa346('0x1c')](_0x448ea2[_0xa346('0x2e')][_0xa346('0x1c')]);_0x5e4458[_0xa346('0x1b')]=qs[_0xa346('0x1b')](_0x448ea2[_0xa346('0x2e')][_0xa346('0x1b')]);}_0x5e4458['order']=qs[_0xa346('0x36')](_0x448ea2[_0xa346('0x2e')][_0xa346('0x36')]);_0x5e4458[_0xa346('0x37')]=qs[_0xa346('0x30')](_[_0xa346('0x38')](_0x448ea2[_0xa346('0x2e')],_0xaa4735['filters']),_0x3dba6e);if(_0x448ea2[_0xa346('0x2e')][_0xa346('0x39')]){_0x5e4458[_0xa346('0x37')]=_['merge'](_0x5e4458[_0xa346('0x37')],{'$or':_['map'](_0x3dba6e,function(_0x526783){if(_0x526783[_0xa346('0x2b')]!=='VIRTUAL'){var _0x36a297={};_0x36a297[_0x526783[_0xa346('0x27')]]={'$like':'%'+_0x448ea2['query'][_0xa346('0x39')]+'%'};return _0x36a297;}})});}_0x5e4458=_['merge']({},_0x5e4458,_0x448ea2[_0xa346('0x3a')]);var _0x4c3bbc={'where':_0x5e4458[_0xa346('0x37')]};return db[_0xa346('0x3b')][_0xa346('0x1d')](_0x4c3bbc)[_0xa346('0x23')](function(_0x26800b){_0x99eacb[_0xa346('0x1d')]=_0x26800b;if(_0x448ea2[_0xa346('0x2e')][_0xa346('0x3c')]){_0x5e4458[_0xa346('0x3d')]=[{'all':!![]}];}return db[_0xa346('0x3b')][_0xa346('0x3e')](_0x5e4458);})[_0xa346('0x23')](function(_0xcac537){_0x99eacb[_0xa346('0x3f')]=_0xcac537;return _0x99eacb;})['then'](respondWithFilteredResult(_0x2510b3,_0x5e4458))['catch'](handleError(_0x2510b3,null));};exports['show']=function(_0x54bbc5,_0x4e25c0){var _0x9cc5f0={'raw':!![],'where':{'id':_0x54bbc5[_0xa346('0x40')]['id']}},_0x32ee11={};_0x32ee11['model']=_[_0xa346('0x2f')](db[_0xa346('0x3b')][_0xa346('0x41')]);_0x32ee11[_0xa346('0x2e')]=_[_0xa346('0x2f')](_0x54bbc5[_0xa346('0x2e')]);_0x32ee11[_0xa346('0x30')]=_[_0xa346('0x42')](_0x32ee11[_0xa346('0x2d')],_0x32ee11[_0xa346('0x2e')]);_0x9cc5f0[_0xa346('0x32')]=_['intersection'](_0x32ee11[_0xa346('0x2d')],qs['fields'](_0x54bbc5[_0xa346('0x2e')]['fields']));_0x9cc5f0[_0xa346('0x32')]=_0x9cc5f0['attributes'][_0xa346('0x33')]?_0x9cc5f0[_0xa346('0x32')]:_0x32ee11[_0xa346('0x2d')];if(_0x54bbc5[_0xa346('0x2e')][_0xa346('0x3c')]){_0x9cc5f0[_0xa346('0x3d')]=[{'all':!![]}];}_0x9cc5f0=_[_0xa346('0x43')]({},_0x9cc5f0,_0x54bbc5[_0xa346('0x3a')]);return db[_0xa346('0x3b')][_0xa346('0x44')](_0x9cc5f0)[_0xa346('0x23')](handleEntityNotFound(_0x4e25c0,null))['then'](respondWithResult(_0x4e25c0,null))[_0xa346('0x45')](handleError(_0x4e25c0,null));};exports[_0xa346('0x22')]=function(_0x34fd4e,_0x2d9fce){if(_0x34fd4e[_0xa346('0x46')]['id']){delete _0x34fd4e['body']['id'];}return db[_0xa346('0x3b')][_0xa346('0x44')]({'where':{'id':_0x34fd4e['params']['id']}})[_0xa346('0x23')](handleEntityNotFound(_0x2d9fce,null))[_0xa346('0x23')](saveUpdates(_0x34fd4e[_0xa346('0x46')],null))['then'](respondWithResult(_0x2d9fce,null))[_0xa346('0x45')](handleError(_0x2d9fce,null));};exports[_0xa346('0x47')]=function(_0xb2042a,_0x2ba6c0){return db[_0xa346('0x3b')]['find']({'where':{'id':_0xb2042a[_0xa346('0x40')]['id']}})[_0xa346('0x23')](handleEntityNotFound(_0x2ba6c0,null))[_0xa346('0x23')](removeEntity(_0x2ba6c0,null))[_0xa346('0x45')](handleError(_0x2ba6c0,null));};exports['describe']=function(_0x33c48e,_0x3b432c){return db['CmHopperBlack'][_0xa346('0x48')]()[_0xa346('0x23')](respondWithResult(_0x3b432c,null))[_0xa346('0x45')](handleError(_0x3b432c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 1c1a654..ab5bbc5 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 _0xe914=['exports','define','cm_hopper_black','util','../../config/logger','api','bluebird','request-promise','path','./cmHopperBlack.attributes'];(function(_0xad1bb1,_0x525d87){var _0x42b09e=function(_0x5e50d6){while(--_0x5e50d6){_0xad1bb1['push'](_0xad1bb1['shift']());}};_0x42b09e(++_0x525d87);}(_0xe914,0x1b1));var _0x4e91=function(_0x3fe31b,_0x54779a){_0x3fe31b=_0x3fe31b-0x0;var _0x41ec8e=_0xe914[_0x3fe31b];return _0x41ec8e;};'use strict';var _=require('lodash');var util=require(_0x4e91('0x0'));var logger=require(_0x4e91('0x1'))(_0x4e91('0x2'));var moment=require('moment');var BPromise=require(_0x4e91('0x3'));var rp=require(_0x4e91('0x4'));var fs=require('fs');var path=require(_0x4e91('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4e91('0x6'));module[_0x4e91('0x7')]=function(_0x214984,_0x5cf8a9){return _0x214984[_0x4e91('0x8')]('CmHopperBlack',attributes,{'tableName':_0x4e91('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x989d=['request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','bluebird'];(function(_0x28ce79,_0x5cc2ac){var _0x575881=function(_0x14590a){while(--_0x14590a){_0x28ce79['push'](_0x28ce79['shift']());}};_0x575881(++_0x5cc2ac);}(_0x989d,0xf1));var _0xd989=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x989d[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xd989('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd989('0x1'));var rp=require(_0xd989('0x2'));var fs=require('fs');var path=require(_0xd989('0x3'));var rimraf=require('rimraf');var config=require(_0xd989('0x4'));var attributes=require(_0xd989('0x5'));module[_0xd989('0x6')]=function(_0x100429,_0x5a2df1){return _0x100429[_0xd989('0x7')]('CmHopperBlack',attributes,{'tableName':_0xd989('0x8'),'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 dcb0ea0..d989cca 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 _0xe52d=['debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','map','include','model','info','UpdateCmHopperBlack','update','body','limit','DestroyCmHopperBlack','destroy','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent'];(function(_0x2fcd90,_0x4780cc){var _0x55b596=function(_0xe475f6){while(--_0xe475f6){_0x2fcd90['push'](_0x2fcd90['shift']());}};_0x55b596(++_0x4780cc);}(_0xe52d,0x151));var _0xde52=function(_0x709bd,_0x580b0e){_0x709bd=_0x709bd-0x0;var _0x10cc9f=_0xe52d[_0x709bd];return _0x10cc9f;};'use strict';var _=require(_0xde52('0x0'));var util=require(_0xde52('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xde52('0x2'));var fs=require('fs');var Redis=require(_0xde52('0x3'));var db=require(_0xde52('0x4'))['db'];var utils=require(_0xde52('0x5'));var logger=require('../../config/logger')(_0xde52('0x6'));var config=require('../../config/environment');var jayson=require(_0xde52('0x7'));var client=jayson[_0xde52('0x8')][_0xde52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ba6e0,_0x1d44f3,_0x4576a7){return new BPromise(function(_0x3f41d9,_0x2f5617){return client[_0xde52('0xa')](_0x5ba6e0,_0x4576a7)[_0xde52('0xb')](function(_0x5bbab9){logger['info'](_0xde52('0xc'),_0x1d44f3,_0xde52('0xd'));logger[_0xde52('0xe')](_0xde52('0xf'),_0x1d44f3,_0xde52('0xd'),JSON[_0xde52('0x10')](_0x5bbab9));if(_0x5bbab9['error']){if(_0x5bbab9['error'][_0xde52('0x11')]===0x1f4){logger[_0xde52('0x12')](_0xde52('0xc'),_0x1d44f3,_0x5bbab9[_0xde52('0x12')][_0xde52('0x13')]);return _0x2f5617(_0x5bbab9[_0xde52('0x12')][_0xde52('0x13')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x1d44f3,_0x5bbab9['error']['message']);return _0x3f41d9(_0x5bbab9[_0xde52('0x12')][_0xde52('0x13')]);}else{logger['info'](_0xde52('0xc'),_0x1d44f3,_0xde52('0xd'));_0x3f41d9(_0x5bbab9[_0xde52('0x14')][_0xde52('0x13')]);}})[_0xde52('0x15')](function(_0x42c339){logger[_0xde52('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x1d44f3,_0x42c339);_0x2f5617(_0x42c339);});});}exports[_0xde52('0x16')]=function(_0x55ead7){var _0x3bbae4=this;return new Promise(function(_0x21d439,_0x34e107){return db[_0xde52('0x17')][_0xde52('0x18')]({'raw':_0x55ead7[_0xde52('0x19')]?_0x55ead7[_0xde52('0x19')][_0xde52('0x1a')]===undefined?!![]:![]:!![],'where':_0x55ead7['options']?_0x55ead7[_0xde52('0x19')][_0xde52('0x1b')]||null:null,'attributes':_0x55ead7[_0xde52('0x19')]?_0x55ead7[_0xde52('0x19')][_0xde52('0x1c')]||null:null,'limit':_0x55ead7[_0xde52('0x19')]?_0x55ead7[_0xde52('0x19')]['limit']||null:null,'include':_0x55ead7['options']?_0x55ead7[_0xde52('0x19')]['include']?_[_0xde52('0x1d')](_0x55ead7[_0xde52('0x19')][_0xde52('0x1e')],function(_0x2399d4){return{'model':db[_0x2399d4[_0xde52('0x1f')]],'as':_0x2399d4['as'],'attributes':_0x2399d4[_0xde52('0x1c')],'include':_0x2399d4['include']?_['map'](_0x2399d4[_0xde52('0x1e')],function(_0x1410de){return{'model':db[_0x1410de[_0xde52('0x1f')]],'as':_0x1410de['as'],'attributes':_0x1410de[_0xde52('0x1c')],'include':_0x1410de['include']?_['map'](_0x1410de[_0xde52('0x1e')],function(_0x5412e0){return{'model':db[_0x5412e0['model']],'as':_0x5412e0['as'],'attributes':_0x5412e0[_0xde52('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xde52('0xb')](function(_0x5cbe2b){logger[_0xde52('0x20')](_0xde52('0x16'),_0x55ead7);logger[_0xde52('0xe')]('GetCmHopperBlack',_0x55ead7,JSON['stringify'](_0x5cbe2b));_0x21d439(_0x5cbe2b);})[_0xde52('0x15')](function(_0x5f050b){logger[_0xde52('0x12')](_0xde52('0x16'),_0x5f050b[_0xde52('0x13')],_0x55ead7);_0x34e107(_0x3bbae4['error'](0x1f4,_0x5f050b[_0xde52('0x13')]));});});};exports[_0xde52('0x21')]=function(_0x1475b5){var _0xa1b42e=this;return new Promise(function(_0x4335bd,_0x4b7b3c){return db[_0xde52('0x17')][_0xde52('0x22')](_0x1475b5[_0xde52('0x23')],{'raw':_0x1475b5[_0xde52('0x19')]?_0x1475b5['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1475b5[_0xde52('0x19')]?_0x1475b5[_0xde52('0x19')][_0xde52('0x1b')]||null:null,'attributes':_0x1475b5[_0xde52('0x19')]?_0x1475b5[_0xde52('0x19')][_0xde52('0x1c')]||null:null,'limit':_0x1475b5['options']?_0x1475b5['options'][_0xde52('0x24')]||null:null})[_0xde52('0xb')](function(_0x45db24){logger[_0xde52('0x20')](_0xde52('0x21'),_0x1475b5);logger[_0xde52('0xe')]('UpdateCmHopperBlack',_0x1475b5,JSON[_0xde52('0x10')](_0x45db24));_0x4335bd(_0x45db24);})[_0xde52('0x15')](function(_0x571a17){logger[_0xde52('0x12')](_0xde52('0x21'),_0x571a17[_0xde52('0x13')],_0x1475b5);_0x4b7b3c(_0xa1b42e['error'](0x1f4,_0x571a17[_0xde52('0x13')]));});});};exports[_0xde52('0x25')]=function(_0x5ed0b4){var _0x19a815=this;return new Promise(function(_0x54ebe7,_0x589e57){return db['CmHopperBlack'][_0xde52('0x26')]({'where':_0x5ed0b4[_0xde52('0x19')]?_0x5ed0b4[_0xde52('0x19')][_0xde52('0x1b')]||null:null})[_0xde52('0xb')](function(_0x511161){logger[_0xde52('0x20')]('DestroyCmHopperBlack',_0x5ed0b4);logger[_0xde52('0xe')](_0xde52('0x25'),_0x5ed0b4,JSON[_0xde52('0x10')](_0x511161));_0x54ebe7(_0x511161);})[_0xde52('0x15')](function(_0x4163c5){logger[_0xde52('0x12')]('DestroyCmHopperBlack',_0x4163c5[_0xde52('0x13')],_0x5ed0b4);_0x589e57(_0x19a815[_0xde52('0x12')](0x1f4,_0x4163c5[_0xde52('0x13')]));});});}; \ No newline at end of file +var _0x9f34=['UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit','include','model'];(function(_0x293fa7,_0x1bdf5c){var _0x3f54dc=function(_0x465ae5){while(--_0x465ae5){_0x293fa7['push'](_0x293fa7['shift']());}};_0x3f54dc(++_0x1bdf5c);}(_0x9f34,0x18b));var _0x49f3=function(_0x563324,_0x6be59){_0x563324=_0x563324-0x0;var _0x492dfe=_0x9f34[_0x563324];return _0x492dfe;};'use strict';var _=require(_0x49f3('0x0'));var util=require(_0x49f3('0x1'));var moment=require(_0x49f3('0x2'));var BPromise=require(_0x49f3('0x3'));var rs=require(_0x49f3('0x4'));var fs=require('fs');var Redis=require(_0x49f3('0x5'));var db=require(_0x49f3('0x6'))['db'];var utils=require(_0x49f3('0x7'));var logger=require('../../config/logger')(_0x49f3('0x8'));var config=require(_0x49f3('0x9'));var jayson=require(_0x49f3('0xa'));var client=jayson[_0x49f3('0xb')][_0x49f3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56602f,_0x2b3c9e,_0x41158d){return new BPromise(function(_0x507505,_0x516df8){return client['request'](_0x56602f,_0x41158d)[_0x49f3('0xd')](function(_0x814519){logger[_0x49f3('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x2b3c9e,_0x49f3('0xf'));logger[_0x49f3('0x10')](_0x49f3('0x11'),_0x2b3c9e,'request\x20sent',JSON[_0x49f3('0x12')](_0x814519));if(_0x814519[_0x49f3('0x13')]){if(_0x814519[_0x49f3('0x13')][_0x49f3('0x14')]===0x1f4){logger[_0x49f3('0x13')](_0x49f3('0x15'),_0x2b3c9e,_0x814519[_0x49f3('0x13')][_0x49f3('0x16')]);return _0x516df8(_0x814519[_0x49f3('0x13')][_0x49f3('0x16')]);}logger[_0x49f3('0x13')](_0x49f3('0x15'),_0x2b3c9e,_0x814519[_0x49f3('0x13')][_0x49f3('0x16')]);return _0x507505(_0x814519['error'][_0x49f3('0x16')]);}else{logger[_0x49f3('0xe')](_0x49f3('0x15'),_0x2b3c9e,_0x49f3('0xf'));_0x507505(_0x814519[_0x49f3('0x17')][_0x49f3('0x16')]);}})[_0x49f3('0x18')](function(_0x5b58f5){logger[_0x49f3('0x13')](_0x49f3('0x15'),_0x2b3c9e,_0x5b58f5);_0x516df8(_0x5b58f5);});});}exports[_0x49f3('0x19')]=function(_0x3683b4){var _0xd73caf=this;return new Promise(function(_0x4056c3,_0x5322e9){return db[_0x49f3('0x1a')][_0x49f3('0x1b')]({'raw':_0x3683b4[_0x49f3('0x1c')]?_0x3683b4[_0x49f3('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3683b4[_0x49f3('0x1c')]?_0x3683b4[_0x49f3('0x1c')][_0x49f3('0x1d')]||null:null,'attributes':_0x3683b4[_0x49f3('0x1c')]?_0x3683b4[_0x49f3('0x1c')][_0x49f3('0x1e')]||null:null,'limit':_0x3683b4[_0x49f3('0x1c')]?_0x3683b4['options'][_0x49f3('0x1f')]||null:null,'include':_0x3683b4[_0x49f3('0x1c')]?_0x3683b4['options'][_0x49f3('0x20')]?_['map'](_0x3683b4[_0x49f3('0x1c')]['include'],function(_0x5b621f){return{'model':db[_0x5b621f[_0x49f3('0x21')]],'as':_0x5b621f['as'],'attributes':_0x5b621f[_0x49f3('0x1e')],'include':_0x5b621f['include']?_['map'](_0x5b621f['include'],function(_0x372829){return{'model':db[_0x372829['model']],'as':_0x372829['as'],'attributes':_0x372829[_0x49f3('0x1e')],'include':_0x372829['include']?_['map'](_0x372829['include'],function(_0x506dfc){return{'model':db[_0x506dfc[_0x49f3('0x21')]],'as':_0x506dfc['as'],'attributes':_0x506dfc[_0x49f3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x49f3('0xd')](function(_0x11d29f){logger['info'](_0x49f3('0x19'),_0x3683b4);logger[_0x49f3('0x10')](_0x49f3('0x19'),_0x3683b4,JSON[_0x49f3('0x12')](_0x11d29f));_0x4056c3(_0x11d29f);})['catch'](function(_0xef1795){logger['error'](_0x49f3('0x19'),_0xef1795[_0x49f3('0x16')],_0x3683b4);_0x5322e9(_0xd73caf[_0x49f3('0x13')](0x1f4,_0xef1795[_0x49f3('0x16')]));});});};exports[_0x49f3('0x22')]=function(_0x5e1949){var _0x549890=this;return new Promise(function(_0x2b95cb,_0x44eb91){return db[_0x49f3('0x1a')][_0x49f3('0x23')](_0x5e1949[_0x49f3('0x24')],{'raw':_0x5e1949[_0x49f3('0x1c')]?_0x5e1949[_0x49f3('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e1949['options']?_0x5e1949[_0x49f3('0x1c')][_0x49f3('0x1d')]||null:null,'attributes':_0x5e1949[_0x49f3('0x1c')]?_0x5e1949['options']['attributes']||null:null,'limit':_0x5e1949['options']?_0x5e1949[_0x49f3('0x1c')][_0x49f3('0x1f')]||null:null})[_0x49f3('0xd')](function(_0x296084){logger[_0x49f3('0xe')](_0x49f3('0x22'),_0x5e1949);logger[_0x49f3('0x10')](_0x49f3('0x22'),_0x5e1949,JSON[_0x49f3('0x12')](_0x296084));_0x2b95cb(_0x296084);})[_0x49f3('0x18')](function(_0x4d741c){logger['error']('UpdateCmHopperBlack',_0x4d741c[_0x49f3('0x16')],_0x5e1949);_0x44eb91(_0x549890[_0x49f3('0x13')](0x1f4,_0x4d741c[_0x49f3('0x16')]));});});};exports[_0x49f3('0x25')]=function(_0x237344){var _0x450645=this;return new Promise(function(_0x572fcb,_0x442ac6){return db[_0x49f3('0x1a')][_0x49f3('0x26')]({'where':_0x237344[_0x49f3('0x1c')]?_0x237344[_0x49f3('0x1c')][_0x49f3('0x1d')]||null:null})[_0x49f3('0xd')](function(_0x30b4a8){logger[_0x49f3('0xe')](_0x49f3('0x25'),_0x237344);logger[_0x49f3('0x10')]('DestroyCmHopperBlack',_0x237344,JSON[_0x49f3('0x12')](_0x30b4a8));_0x572fcb(_0x30b4a8);})['catch'](function(_0x4d2209){logger[_0x49f3('0x13')](_0x49f3('0x25'),_0x4d2209[_0x49f3('0x16')],_0x237344);_0x442ac6(_0x450645[_0x49f3('0x13')](0x1f4,_0x4d2209[_0x49f3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8b8bfdd..052a7a6 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','describe','/:id','show','put','delete','destroy','multer','util'];(function(_0x237b01,_0xdb78a6){var _0x40c58f=function(_0x307986){while(--_0x307986){_0x237b01['push'](_0x237b01['shift']());}};_0x40c58f(++_0xdb78a6);}(_0xf494,0x1c6));var _0x4f49=function(_0x45d6a9,_0x549ec9){_0x45d6a9=_0x45d6a9-0x0;var _0x3f42a2=_0xf494[_0x45d6a9];return _0x3f42a2;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x11')](_0x4f49('0xe'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);module['exports']=router; \ No newline at end of file +var _0x57ca=['../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x32099b,_0x4ee0a7){var _0x18233d=function(_0xb3f6c7){while(--_0xb3f6c7){_0x32099b['push'](_0x32099b['shift']());}};_0x18233d(++_0x4ee0a7);}(_0x57ca,0x108));var _0xa57c=function(_0x468bb5,_0x538ddb){_0x468bb5=_0x468bb5-0x0;var _0x3b99fb=_0x57ca[_0x468bb5];return _0x3b99fb;};'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')]('/:id',auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x10')](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('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 d9204a5..1b8eb74 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 _0x4d61=['endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue'];(function(_0xbeb918,_0x5ee23c){var _0x9fa1c9=function(_0x387da6){while(--_0x387da6){_0xbeb918['push'](_0xbeb918['shift']());}};_0x9fa1c9(++_0x5ee23c);}(_0x4d61,0xbc));var _0x14d6=function(_0x201043,_0x57e46b){_0x201043=_0x201043-0x0;var _0x29e5f2=_0x4d61[_0x201043];return _0x29e5f2;};'use strict';var Sequelize=require(_0x14d6('0x0'));var moment=require(_0x14d6('0x1'));module[_0x14d6('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x14d6('0x3')]},'scheduledat':{'type':Sequelize[_0x14d6('0x4')]},'countbusyretry':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x14d6('0x3')]},'originatecalleridname':{'type':Sequelize[_0x14d6('0x3')]},'calleridnum':{'type':Sequelize[_0x14d6('0x3')]},'calleridname':{'type':Sequelize[_0x14d6('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x14d6('0x4')]},'answertime':{'type':Sequelize[_0x14d6('0x4')]},'droptime':{'type':Sequelize[_0x14d6('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x14d6('0x3')]},'campaigntype':{'type':Sequelize[_0x14d6('0x3')]},'membername':{'type':Sequelize[_0x14d6('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x14d6('0x3')]},'secondDisposition':{'type':Sequelize[_0x14d6('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x14d6('0x4')],'set':function(_0x570353){var _0xdedf68=this[_0x14d6('0x6')](_0x14d6('0x7'));if(_0xdedf68&&_0x570353){this[_0x14d6('0x8')](_0x14d6('0x9'),moment(_0x570353)[_0x14d6('0xa')](moment(_0xdedf68),_0x14d6('0xb')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x14d6('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x14d6('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x14d6('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x14d6('0x4')]},'callback':{'type':Sequelize[_0x14d6('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x14d6('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x14d6('0x4')]},'deleted':{'type':Sequelize[_0x14d6('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x14d6('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x14d6('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x14d6('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0ac4=['INTEGER','STRING','DATE','getDataValue','endtime','followuptime','diff','seconds','BOOLEAN','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0ac4,0x81));var _0x40ac=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0x0ac4[_0x31bab3];return _0x4fd382;};'use strict';var Sequelize=require(_0x40ac('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x40ac('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x40ac('0x2')]},'scheduledat':{'type':Sequelize[_0x40ac('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x40ac('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x40ac('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x40ac('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x40ac('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x40ac('0x2')]},'originatecalleridname':{'type':Sequelize[_0x40ac('0x2')]},'calleridnum':{'type':Sequelize[_0x40ac('0x2')]},'calleridname':{'type':Sequelize[_0x40ac('0x2')]},'starttime':{'type':Sequelize[_0x40ac('0x3')]},'responsetime':{'type':Sequelize[_0x40ac('0x3')]},'answertime':{'type':Sequelize[_0x40ac('0x3')]},'droptime':{'type':Sequelize[_0x40ac('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x40ac('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x40ac('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x40ac('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x40ac('0x2')]},'campaign':{'type':Sequelize[_0x40ac('0x2')]},'campaigntype':{'type':Sequelize[_0x40ac('0x2')]},'membername':{'type':Sequelize[_0x40ac('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x40ac('0x2')]},'secondDisposition':{'type':Sequelize[_0x40ac('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x40ac('0x3')],'set':function(_0x1e1f34){var _0x5bc51d=this[_0x40ac('0x4')](_0x40ac('0x5'));if(_0x5bc51d&&_0x1e1f34){this['setDataValue'](_0x40ac('0x6'),moment(_0x1e1f34)[_0x40ac('0x7')](moment(_0x5bc51d),_0x40ac('0x8')));}}},'amd':{'type':Sequelize[_0x40ac('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x40ac('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x40ac('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x40ac('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x40ac('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x40ac('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x40ac('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x40ac('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x40ac('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x40ac('0x1')],'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 86bb662..f96a1e1 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 _0x6d38=['calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','filters','intersection','describe','catch','body','uniqueid','find','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','from','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','ANY_VALUE(ListId)','CampaignId\x20=\x20?','state'];(function(_0x1ee739,_0x2f433b){var _0x447834=function(_0x5a4ebd){while(--_0x5a4ebd){_0x1ee739['push'](_0x1ee739['shift']());}};_0x447834(++_0x2f433b);}(_0x6d38,0x1ef));var _0x86d3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6d38[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['CmHopperFinal'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':!![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')]()['then'](respondWithResult(_0xd20863,null))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x3226b5,_0x14fa58){if(_0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')]){delete _0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')];}return db[_0x86d3('0x26')][_0x86d3('0x43')]({'where':{'uniqueid':_0x3226b5[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x14fa58,null))['then'](saveUpdates(_0x3226b5[_0x86d3('0x41')],null))[_0x86d3('0x20')](respondWithResult(_0x14fa58,null))['catch'](handleError(_0x14fa58,null));};exports[_0x86d3('0x45')]=function(_0x23a6ee,_0x197047,_0x2e9af5){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'VoiceQueueId':_0x23a6ee['params']['id']},'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x48')))),_0x86d3('0x49')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x4b')))),_0x86d3('0x4c')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal'](_0x86d3('0x4d')))),'busyContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x208,\x201,\x20null'))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x86d3('0x4f')))),'dropContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x197047,null))[_0x86d3('0x20')](respondWithResult(_0x197047,null))['catch'](handleError(_0x197047,null));};exports[_0x86d3('0x53')]=function(_0x416428,_0x15cdd0,_0x29bdee){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'CampaignId':_0x416428[_0x86d3('0x44')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x86d3('0x49')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4b')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4d')))),_0x86d3('0x54')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x55')))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x86d3('0x56')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x57')))),_0x86d3('0x58')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x15cdd0,null))[_0x86d3('0x20')](respondWithResult(_0x15cdd0,null))[_0x86d3('0x40')](handleError(_0x15cdd0,null));};exports[_0x86d3('0x59')]=function(_0x308fed,_0x1c966a,_0x379799){return db['VoiceQueue'][_0x86d3('0x43')]({'where':{'id':_0x308fed[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x1c966a,null))[_0x86d3('0x20')](function(_0x46e356){var _0x47f72e;if(_0x46e356){_0x47f72e=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')]('cm_hopper')[_0x86d3('0x5c')]([_0x86d3('0x5d'),_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x61'),_0x86d3('0x62'),_0x86d3('0x63')],squel[_0x86d3('0x64')]()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),'scheduledAt')[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))[_0x86d3('0x65')]('ANY_VALUE(ListId)',_0x86d3('0x60'))[_0x86d3('0x65')](_0x86d3('0x69'),_0x86d3('0x61'))['field']('NOW()',_0x86d3('0x62'))['field'](_0x86d3('0x67'),'updatedAt')['from'](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())['where'](_0x86d3('0x6d'),_0x308fed[_0x86d3('0x41')]['state'][_0x86d3('0x6c')]())[_0x86d3('0x32')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x86d3('0x32')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x86d3('0x64')]()['field']('phone')[_0x86d3('0x6e')]('cm_hopper')[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()[_0x86d3('0x65')]('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')][_0x86d3('0x2b')](_0x47f72e);}return[];})['then'](respondWithResult(_0x1c966a,null))[_0x86d3('0x40')](handleError(_0x1c966a,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0xca2e0,_0x596b1d,_0x5a22ca){return db[_0x86d3('0x72')][_0x86d3('0x43')]({'where':{'id':_0xca2e0['params']['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x596b1d,null))[_0x86d3('0x20')](function(_0x879a8b){var _0x1c1384;if(_0x879a8b){_0x1c1384=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')](_0x86d3('0x73'))['fromQuery'](['phone',_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x74'),_0x86d3('0x62'),_0x86d3('0x63')],squel['select']()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x5e'))[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))['field'](_0x86d3('0x75'),_0x86d3('0x60'))['field']('ANY_VALUE(CampaignId)',_0x86d3('0x74'))[_0x86d3('0x65')](_0x86d3('0x67'),'createdAt')[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x63'))[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x6d'),_0xca2e0[_0x86d3('0x41')][_0x86d3('0x77')]['toString']())[_0x86d3('0x32')](_0x86d3('0x78'))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field'](_0x86d3('0x5d'))[_0x86d3('0x6e')](_0x86d3('0x73'))[_0x86d3('0x32')](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field']('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')]['query'](_0x1c1384);}return[];})['then'](respondWithResult(_0x596b1d,null))['catch'](handleError(_0x596b1d,null));};exports['checkContactHopper']=function(_0xad83bf,_0x2514c1,_0x28a509){return db[_0x86d3('0x79')][_0x86d3('0x7a')]({'where':{'VoiceQueueId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x61')],'CampaignId':_0xad83bf['body'][_0x86d3('0x74')],'ContactId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x5f')]}})[_0x86d3('0x20')](handleEntityNotFound(_0x2514c1,null))['then'](function(_0xe239b5){if(_0xe239b5){return _0xe239b5;}return null;})['then'](respondWithResult(_0x2514c1,null))[_0x86d3('0x40')](handleError(_0x2514c1,null));}; \ No newline at end of file +var _0xd117=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','CmHopperFinal','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','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','reCallContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format'];(function(_0x582423,_0x435ed2){var _0x412fbc=function(_0x3bce6b){while(--_0x3bce6b){_0x582423['push'](_0x582423['shift']());}};_0x412fbc(++_0x435ed2);}(_0xd117,0x182));var _0x7d11=function(_0x2aebb2,_0x21f452){_0x2aebb2=_0x2aebb2-0x0;var _0x17406c=_0xd117[_0x2aebb2];return _0x17406c;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':!![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['describe']()['then'](respondWithResult(_0x193631,null))['catch'](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x1e5bb5,_0x20297a){if(_0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')]){delete _0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'uniqueid':_0x1e5bb5[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x20297a,null))[_0x7d11('0x22')](saveUpdates(_0x1e5bb5['body'],null))[_0x7d11('0x22')](respondWithResult(_0x20297a,null))[_0x7d11('0x40')](handleError(_0x20297a,null));};exports[_0x7d11('0x4a')]=function(_0x553a03,_0x503ebc,_0x14db1c){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x553a03['params']['id']},'attributes':[[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x4e')))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),_0x7d11('0x50')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize']['literal'](_0x7d11('0x51')))),_0x7d11('0x52')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x57')))),_0x7d11('0x58')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x503ebc,null))[_0x7d11('0x22')](respondWithResult(_0x503ebc,null))['catch'](handleError(_0x503ebc,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x52d62d,_0x32c551,_0x12f05b){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'CampaignId':_0x52d62d[_0x7d11('0x42')]['id']},'attributes':[[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x59')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x5a')))),'busyContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x51')))),'congestionContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db['sequelize']['fn']('IF',db[_0x7d11('0x4c')]['literal'](_0x7d11('0x57')))),'reCallContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x7d11('0x5b')]]})[_0x7d11('0x22')](handleEntityNotFound(_0x32c551,null))[_0x7d11('0x22')](respondWithResult(_0x32c551,null))['catch'](handleError(_0x32c551,null));};exports[_0x7d11('0x5c')]=function(_0x3c656b,_0x31cb39,_0x1b89de){return db[_0x7d11('0x5d')][_0x7d11('0x45')]({'where':{'id':_0x3c656b['params']['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x31cb39,null))['then'](function(_0x1fd598){var _0x4c88c6;if(_0x1fd598){_0x4c88c6=squel['insert']()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')]([_0x7d11('0x61'),_0x7d11('0x62'),_0x7d11('0x63'),_0x7d11('0x64'),_0x7d11('0x65'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field'](_0x7d11('0x69'),'phone')[_0x7d11('0x6a')](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')]('ANY_VALUE(ListId)','ListId')[_0x7d11('0x6a')](_0x7d11('0x6d'),_0x7d11('0x65'))[_0x7d11('0x6a')](_0x7d11('0x6b'),'createdAt')[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())[_0x7d11('0x38')]('state\x20=\x20?',_0x3c656b['body'][_0x7d11('0x72')][_0x7d11('0x71')]())[_0x7d11('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel['select']()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))['where'](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))[_0x7d11('0x38')](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x74'))['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())['where'](_0x7d11('0x75')))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db[_0x7d11('0x4c')]['query'](_0x4c88c6);}return[];})['then'](respondWithResult(_0x31cb39,null))['catch'](handleError(_0x31cb39,null));};exports[_0x7d11('0x77')]=function(_0x4c15e9,_0x2a9e92,_0x5459d1){return db['Campaign'][_0x7d11('0x45')]({'where':{'id':_0x4c15e9[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x2a9e92,null))[_0x7d11('0x22')](function(_0x345fb3){var _0x32a17a;if(_0x345fb3){_0x32a17a=squel[_0x7d11('0x78')]()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')](['phone',_0x7d11('0x62'),_0x7d11('0x63'),'ListId',_0x7d11('0x79'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field']('ANY_VALUE(calleridnum)',_0x7d11('0x61'))['field'](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')](_0x7d11('0x7a'),'ListId')[_0x7d11('0x6a')](_0x7d11('0x7b'),_0x7d11('0x79'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x66'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))['where'](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())[_0x7d11('0x38')](_0x7d11('0x7d'),_0x4c15e9['body'][_0x7d11('0x72')]['toString']())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7d11('0x68')]()[_0x7d11('0x6a')]('calleridnum')['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())['where']('state\x20=\x204'))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db['sequelize'][_0x7d11('0x2d')](_0x32a17a);}return[];})[_0x7d11('0x22')](respondWithResult(_0x2a9e92,null))['catch'](handleError(_0x2a9e92,null));};exports[_0x7d11('0x7e')]=function(_0x1cb457,_0x59f0db,_0x5e5faf){return db[_0x7d11('0x7f')][_0x7d11('0x80')]({'where':{'VoiceQueueId':_0x1cb457['body']['VoiceQueueId'],'CampaignId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x79')],'ContactId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x63')]}})['then'](handleEntityNotFound(_0x59f0db,null))[_0x7d11('0x22')](function(_0x2cfa77){if(_0x2cfa77){return _0x2cfa77;}return null;})[_0x7d11('0x22')](respondWithResult(_0x59f0db,null))[_0x7d11('0x40')](handleError(_0x59f0db,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 8532e37..cfbb12d 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 _0xb3f1=['path','rimraf','../../config/environment','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','moment','request-promise'];(function(_0x834bb6,_0x1c5e35){var _0xa35d00=function(_0x14aeb3){while(--_0x14aeb3){_0x834bb6['push'](_0x834bb6['shift']());}};_0xa35d00(++_0x1c5e35);}(_0xb3f1,0x14c));var _0x1b3f=function(_0x1978fc,_0x398da2){_0x1978fc=_0x1978fc-0x0;var _0x1da73a=_0xb3f1[_0x1978fc];return _0x1da73a;};'use strict';var _=require(_0x1b3f('0x0'));var util=require(_0x1b3f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1b3f('0x2'));var BPromise=require('bluebird');var rp=require(_0x1b3f('0x3'));var fs=require('fs');var path=require(_0x1b3f('0x4'));var rimraf=require(_0x1b3f('0x5'));var config=require(_0x1b3f('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0x1b3f('0x7')]=function(_0x41d0b8,_0x92d431){return _0x41d0b8['define'](_0x1b3f('0x8'),attributes,{'tableName':_0x1b3f('0x9'),'paranoid':![],'indexes':[{'name':_0x1b3f('0xa'),'fields':['calleridnum']},{'name':_0x1b3f('0xb'),'fields':[_0x1b3f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd988=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x26ff8c,_0x515ecb){var _0x2596c7=function(_0x4f1d2d){while(--_0x4f1d2d){_0x26ff8c['push'](_0x26ff8c['shift']());}};_0x2596c7(++_0x515ecb);}(_0xd988,0x167));var _0x8d98=function(_0x40b225,_0x12335e){_0x40b225=_0x40b225-0x0;var _0x848603=_0xd988[_0x40b225];return _0x848603;};'use strict';var _=require(_0x8d98('0x0'));var util=require(_0x8d98('0x1'));var logger=require(_0x8d98('0x2'))(_0x8d98('0x3'));var moment=require(_0x8d98('0x4'));var BPromise=require(_0x8d98('0x5'));var rp=require(_0x8d98('0x6'));var fs=require('fs');var path=require(_0x8d98('0x7'));var rimraf=require(_0x8d98('0x8'));var config=require('../../config/environment');var attributes=require(_0x8d98('0x9'));module[_0x8d98('0xa')]=function(_0x156d78,_0x1097c9){return _0x156d78[_0x8d98('0xb')](_0x8d98('0xc'),attributes,{'tableName':_0x8d98('0xd'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x8d98('0xe')]},{'name':_0x8d98('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index b975392..13bff83 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3d8db0,_0x5a51a8){var _0x569074=function(_0x14a9ed){while(--_0x14a9ed){_0x3d8db0['push'](_0x3d8db0['shift']());}};_0x569074(++_0x5a51a8);}(_0x7a54,0x106));var _0x47a5=function(_0x6988fe,_0x5a2c0e){_0x6988fe=_0x6988fe-0x0;var _0x51bced=_0x7a54[_0x6988fe];return _0x51bced;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5c8c32,_0xc54307){var _0x4a0bb5=function(_0x303f62){while(--_0x303f62){_0x5c8c32['push'](_0x5c8c32['shift']());}};_0x4a0bb5(++_0xc54307);}(_0x7a54,0x106));var _0x47a5=function(_0xc01021,_0x929fb3){_0xc01021=_0xc01021-0x0;var _0x1de2ed=_0x7a54[_0xc01021];return _0x1de2ed;};'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 365e6df..b01a064 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 _0xf17e=['get','index','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0xf17e,0xb8));var _0xef17=function(_0x3b6a50,_0xc293eb){_0x3b6a50=_0x3b6a50-0x0;var _0x1fa506=_0xf17e[_0x3b6a50];return _0x1fa506;};'use strict';var multer=require(_0xef17('0x0'));var util=require(_0xef17('0x1'));var path=require('path');var timeout=require(_0xef17('0x2'));var express=require(_0xef17('0x3'));var router=express[_0xef17('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xef17('0x5'));var interaction=require(_0xef17('0x6'));var config=require(_0xef17('0x7'));var controller=require('./cmHopperFinal.controller');router[_0xef17('0x8')]('/',auth['isAuthenticated'](),controller[_0xef17('0x9')]);router[_0xef17('0x8')](_0xef17('0xa'),auth[_0xef17('0xb')](),controller[_0xef17('0xc')]);router[_0xef17('0x8')](_0xef17('0xd'),auth[_0xef17('0xb')](),controller[_0xef17('0xe')]);router[_0xef17('0x8')](_0xef17('0xf'),auth[_0xef17('0xb')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xef17('0x8')]('/campaign/countAttributes/:id',auth[_0xef17('0xb')](),controller[_0xef17('0x10')]);router[_0xef17('0x11')](_0xef17('0x12'),auth[_0xef17('0xb')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xef17('0x11')](_0xef17('0x13'),auth['isAuthenticated'](),controller[_0xef17('0x14')]);router[_0xef17('0x11')]('/checkContactHopper',auth[_0xef17('0xb')](),controller[_0xef17('0x15')]);router[_0xef17('0x16')](_0xef17('0xd'),auth[_0xef17('0xb')](),controller[_0xef17('0x17')]);module['exports']=router; \ No newline at end of file +var _0x87a1=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','multer'];(function(_0x5352d0,_0x41e8b4){var _0x352b00=function(_0x289f6c){while(--_0x289f6c){_0x5352d0['push'](_0x5352d0['shift']());}};_0x352b00(++_0x41e8b4);}(_0x87a1,0x16f));var _0x187a=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x87a1[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x187a('0x0'));var util=require(_0x187a('0x1'));var path=require(_0x187a('0x2'));var timeout=require(_0x187a('0x3'));var express=require(_0x187a('0x4'));var router=express['Router']();var fs_extra=require(_0x187a('0x5'));var auth=require(_0x187a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x187a('0x7'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x187a('0x8')]);router[_0x187a('0x9')](_0x187a('0xa'),auth[_0x187a('0xb')](),controller['describe']);router[_0x187a('0x9')](_0x187a('0xc'),auth[_0x187a('0xb')](),controller[_0x187a('0xd')]);router[_0x187a('0x9')]('/voice/queue/countAttributes/:id',auth[_0x187a('0xb')](),controller[_0x187a('0xe')]);router[_0x187a('0x9')](_0x187a('0xf'),auth['isAuthenticated'](),controller[_0x187a('0x10')]);router[_0x187a('0x11')](_0x187a('0x12'),auth[_0x187a('0xb')](),controller[_0x187a('0x13')]);router[_0x187a('0x11')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0x187a('0x14')]);router['post']('/checkContactHopper',auth['isAuthenticated'](),controller[_0x187a('0x15')]);router['put']('/:id',auth[_0x187a('0xb')](),controller[_0x187a('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index f323f7b..1c2bf91 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 _0x8777=['DATE','INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x5378fa,_0x2fbce5){var _0x221cc7=function(_0x190675){while(--_0x190675){_0x5378fa['push'](_0x5378fa['shift']());}};_0x221cc7(++_0x2fbce5);}(_0x8777,0xdb));var _0x7877=function(_0x2a9e36,_0x271122){_0x2a9e36=_0x2a9e36-0x0;var _0x24185b=_0x8777[_0x2a9e36];return _0x24185b;};'use strict';var Sequelize=require(_0x7877('0x0'));module[_0x7877('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x7877('0x2')]},'scheduledat':{'type':Sequelize[_0x7877('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7877('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7877('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7877('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7877('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x7877('0x2')]},'originatecalleridname':{'type':Sequelize[_0x7877('0x2')]},'calleridnum':{'type':Sequelize[_0x7877('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7877('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x7877('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x7877('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7877('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7877('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7877('0x2')]},'campaign':{'type':Sequelize[_0x7877('0x2')]},'campaigntype':{'type':Sequelize[_0x7877('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x7877('0x2')]},'amd':{'type':Sequelize[_0x7877('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x7877('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x7877('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7877('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x7877('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x7877('0x3')]},'edited':{'type':Sequelize[_0x7877('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x7877('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7877('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7877('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7877('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7877('0x2')]}}; \ No newline at end of file +var _0x489e=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x489e,0x184));var _0xe489=function(_0x2f2948,_0x41bf10){_0x2f2948=_0x2f2948-0x0;var _0x438933=_0x489e[_0x2f2948];return _0x438933;};'use strict';var Sequelize=require(_0xe489('0x0'));module[_0xe489('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xe489('0x2')]},'scheduledat':{'type':Sequelize[_0xe489('0x3')]},'countbusyretry':{'type':Sequelize[_0xe489('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe489('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xe489('0x2')]},'calleridnum':{'type':Sequelize[_0xe489('0x2')]},'calleridname':{'type':Sequelize[_0xe489('0x2')]},'starttime':{'type':Sequelize[_0xe489('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe489('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xe489('0x3')]},'ringtime':{'type':Sequelize[_0xe489('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe489('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe489('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe489('0x2')]},'campaign':{'type':Sequelize[_0xe489('0x2')]},'campaigntype':{'type':Sequelize[_0xe489('0x2')]},'membername':{'type':Sequelize[_0xe489('0x2')]},'reason':{'type':Sequelize[_0xe489('0x2')]},'amd':{'type':Sequelize[_0xe489('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe489('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe489('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe489('0x3')]},'recallme':{'type':Sequelize[_0xe489('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xe489('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe489('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe489('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe489('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 92ce972..7479f42 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 _0x1073=['pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','body','describe','update','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','offset','limit','undefined','count','status','Content-Range','json','reject','save','then','destroy','end','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2f5479,_0x2aee38){var _0x32bdae=function(_0x4d5aa9){while(--_0x4d5aa9){_0x2f5479['push'](_0x2f5479['shift']());}};_0x32bdae(++_0x2aee38);}(_0x1073,0x1d9));var _0x3107=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x1073[_0x310504];return _0x5b36d0;};'use strict';var emlformat=require(_0x3107('0x0'));var rimraf=require(_0x3107('0x1'));var zipdir=require(_0x3107('0x2'));var jsonpatch=require(_0x3107('0x3'));var rp=require('request-promise');var moment=require(_0x3107('0x4'));var BPromise=require(_0x3107('0x5'));var Mustache=require('mustache');var util=require(_0x3107('0x6'));var path=require('path');var sox=require(_0x3107('0x7'));var csv=require(_0x3107('0x8'));var ejs=require(_0x3107('0x9'));var fs=require('fs');var fs_extra=require(_0x3107('0xa'));var _=require(_0x3107('0xb'));var squel=require(_0x3107('0xc'));var crypto=require('crypto');var jsforce=require(_0x3107('0xd'));var deskjs=require(_0x3107('0xe'));var toCsv=require(_0x3107('0x8'));var querystring=require(_0x3107('0xf'));var Papa=require(_0x3107('0x10'));var Redis=require(_0x3107('0x11'));var authService=require(_0x3107('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3107('0x13'));var hardwareService=require(_0x3107('0x14'));var logger=require(_0x3107('0x15'))('api');var utils=require(_0x3107('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3107('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c9fcb,_0x420cf6){_0x420cf6=_0x420cf6||0xcc;return function(_0x522fd3){if(_0x522fd3){return _0x4c9fcb[_0x3107('0x18')](_0x420cf6);}return _0x4c9fcb['status'](_0x420cf6)['end']();};}function respondWithResult(_0x4299b2,_0x17ea70){_0x17ea70=_0x17ea70||0xc8;return function(_0x52dc75){if(_0x52dc75){return _0x4299b2['status'](_0x17ea70)['json'](_0x52dc75);}};}function respondWithFilteredResult(_0x2d45f9,_0x53c071){return function(_0xbc1304){if(_0xbc1304){var _0xbe49c8=typeof _0x53c071[_0x3107('0x19')]==='undefined'&&typeof _0x53c071[_0x3107('0x1a')]===_0x3107('0x1b');var _0x5da865=_0xbc1304[_0x3107('0x1c')];var _0x337b6d=_0xbe49c8?0x0:_0x53c071[_0x3107('0x19')];var _0x45279a=_0xbe49c8?_0xbc1304['count']:_0x53c071['offset']+_0x53c071['limit'];var _0x4792a0;if(_0x45279a>=_0x5da865){_0x45279a=_0x5da865;_0x4792a0=0xc8;}else{_0x4792a0=0xce;}_0x2d45f9[_0x3107('0x1d')](_0x4792a0);return _0x2d45f9['set'](_0x3107('0x1e'),_0x337b6d+'-'+_0x45279a+'/'+_0x5da865)[_0x3107('0x1f')](_0xbc1304);}return null;};}function patchUpdates(_0x21f25b){return function(_0x5c8d19){try{jsonpatch['apply'](_0x5c8d19,_0x21f25b,!![]);}catch(_0x58d82e){return BPromise[_0x3107('0x20')](_0x58d82e);}return _0x5c8d19[_0x3107('0x21')]();};}function saveUpdates(_0x3d3ca4,_0x527871){return function(_0x4a1836){if(_0x4a1836){return _0x4a1836['update'](_0x3d3ca4)[_0x3107('0x22')](function(_0x313fcc){return _0x313fcc;});}return null;};}function removeEntity(_0x5a6406,_0x40383d){return function(_0x22c3a2){if(_0x22c3a2){return _0x22c3a2[_0x3107('0x23')]()[_0x3107('0x22')](function(){_0x5a6406[_0x3107('0x1d')](0xcc)[_0x3107('0x24')]();});}};}function handleEntityNotFound(_0x433093,_0x1fa976){return function(_0x13220a){if(!_0x13220a){_0x433093[_0x3107('0x18')](0x194);}return _0x13220a;};}function handleError(_0x1f89a9,_0x46f93b){_0x46f93b=_0x46f93b||0x1f4;return function(_0x4cb794){logger[_0x3107('0x25')](_0x4cb794[_0x3107('0x26')]);if(_0x4cb794[_0x3107('0x27')]){delete _0x4cb794[_0x3107('0x27')];}_0x1f89a9[_0x3107('0x1d')](_0x46f93b)['send'](_0x4cb794);};}exports[_0x3107('0x28')]=function(_0xc494e2,_0x2220bb){var _0x17819c={},_0x301f6f={},_0x359689={'count':0x0,'rows':[]};var _0x19bb9c=_[_0x3107('0x29')](db[_0x3107('0x2a')][_0x3107('0x2b')],function(_0x504d7e){return{'name':_0x504d7e[_0x3107('0x2c')],'type':_0x504d7e['type'][_0x3107('0x2d')]};});_0x301f6f['model']=_['map'](_0x19bb9c,_0x3107('0x27'));_0x301f6f[_0x3107('0x2e')]=_[_0x3107('0x2f')](_0xc494e2[_0x3107('0x2e')]);_0x301f6f[_0x3107('0x30')]=_['intersection'](_0x301f6f[_0x3107('0x31')],_0x301f6f['query']);_0x17819c[_0x3107('0x32')]=_[_0x3107('0x33')](_0x301f6f[_0x3107('0x31')],qs[_0x3107('0x34')](_0xc494e2['query'][_0x3107('0x34')]));_0x17819c[_0x3107('0x32')]=_0x17819c['attributes'][_0x3107('0x35')]?_0x17819c[_0x3107('0x32')]:_0x301f6f[_0x3107('0x31')];if(!_0xc494e2[_0x3107('0x2e')][_0x3107('0x36')](_0x3107('0x37'))){_0x17819c[_0x3107('0x1a')]=qs[_0x3107('0x1a')](_0xc494e2[_0x3107('0x2e')][_0x3107('0x1a')]);_0x17819c['offset']=qs[_0x3107('0x19')](_0xc494e2['query'][_0x3107('0x19')]);}_0x17819c[_0x3107('0x38')]=qs[_0x3107('0x39')](_0xc494e2[_0x3107('0x2e')][_0x3107('0x39')]);_0x17819c[_0x3107('0x3a')]=qs[_0x3107('0x30')](_[_0x3107('0x3b')](_0xc494e2[_0x3107('0x2e')],_0x301f6f[_0x3107('0x30')]),_0x19bb9c);if(_0xc494e2[_0x3107('0x2e')]['filter']){_0x17819c['where']=_[_0x3107('0x3c')](_0x17819c[_0x3107('0x3a')],{'$or':_[_0x3107('0x29')](_0x19bb9c,function(_0x2fa0d4){if(_0x2fa0d4[_0x3107('0x3d')]!==_0x3107('0x3e')){var _0x1703cb={};_0x1703cb[_0x2fa0d4[_0x3107('0x27')]]={'$like':'%'+_0xc494e2[_0x3107('0x2e')][_0x3107('0x3f')]+'%'};return _0x1703cb;}})});}_0x17819c=_[_0x3107('0x3c')]({},_0x17819c,_0xc494e2[_0x3107('0x40')]);var _0x324768={'where':_0x17819c[_0x3107('0x3a')]};return db[_0x3107('0x2a')][_0x3107('0x1c')](_0x324768)['then'](function(_0x5e2318){_0x359689[_0x3107('0x1c')]=_0x5e2318;if(_0xc494e2[_0x3107('0x2e')][_0x3107('0x41')]){_0x17819c[_0x3107('0x42')]=[{'all':!![]}];}return db[_0x3107('0x2a')][_0x3107('0x43')](_0x17819c);})[_0x3107('0x22')](function(_0x2364d1){_0x359689[_0x3107('0x44')]=_0x2364d1;return _0x359689;})[_0x3107('0x22')](respondWithFilteredResult(_0x2220bb,_0x17819c))[_0x3107('0x45')](handleError(_0x2220bb,null));};exports[_0x3107('0x46')]=function(_0x283100,_0x15285b){var _0x272ba0={'raw':!![],'where':{'id':_0x283100['params']['id']}},_0x3e90f9={};_0x3e90f9['model']=_[_0x3107('0x2f')](db[_0x3107('0x2a')][_0x3107('0x2b')]);_0x3e90f9[_0x3107('0x2e')]=_[_0x3107('0x2f')](_0x283100[_0x3107('0x2e')]);_0x3e90f9[_0x3107('0x30')]=_['intersection'](_0x3e90f9['model'],_0x3e90f9[_0x3107('0x2e')]);_0x272ba0[_0x3107('0x32')]=_[_0x3107('0x33')](_0x3e90f9['model'],qs[_0x3107('0x34')](_0x283100[_0x3107('0x2e')]['fields']));_0x272ba0[_0x3107('0x32')]=_0x272ba0['attributes'][_0x3107('0x35')]?_0x272ba0[_0x3107('0x32')]:_0x3e90f9[_0x3107('0x31')];if(_0x283100[_0x3107('0x2e')][_0x3107('0x41')]){_0x272ba0[_0x3107('0x42')]=[{'all':!![]}];}_0x272ba0=_[_0x3107('0x3c')]({},_0x272ba0,_0x283100[_0x3107('0x40')]);return db['CmHopperHistory']['find'](_0x272ba0)[_0x3107('0x22')](handleEntityNotFound(_0x15285b,null))['then'](respondWithResult(_0x15285b,null))[_0x3107('0x45')](handleError(_0x15285b,null));};exports['create']=function(_0x5ad97c,_0x556582){return db[_0x3107('0x2a')]['create'](_0x5ad97c[_0x3107('0x47')],{})[_0x3107('0x22')](respondWithResult(_0x556582,0xc9))[_0x3107('0x45')](handleError(_0x556582,null));};exports[_0x3107('0x48')]=function(_0x2e20ad,_0x45e02d){return db[_0x3107('0x2a')][_0x3107('0x48')]()['then'](respondWithResult(_0x45e02d,null))[_0x3107('0x45')](handleError(_0x45e02d,null));};exports[_0x3107('0x49')]=function(_0x17cf70,_0x158d31){if(_0x17cf70['body'][_0x3107('0x4a')]){delete _0x17cf70[_0x3107('0x47')]['uniqueid'];}return db[_0x3107('0x2a')][_0x3107('0x4b')]({'where':{'uniqueid':_0x17cf70['params']['id']}})['then'](handleEntityNotFound(_0x158d31,null))[_0x3107('0x22')](saveUpdates(_0x17cf70[_0x3107('0x47')],null))[_0x3107('0x22')](respondWithResult(_0x158d31,null))['catch'](handleError(_0x158d31,null));}; \ No newline at end of file +var _0xef5d=['create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','reject','update','then','destroy','error','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','options','find'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xef5d,0xdc));var _0xdef5=function(_0x54a13e,_0x1b152b){_0x54a13e=_0x54a13e-0x0;var _0x50287d=_0xef5d[_0x54a13e];return _0x50287d;};'use strict';var emlformat=require(_0xdef5('0x0'));var rimraf=require(_0xdef5('0x1'));var zipdir=require(_0xdef5('0x2'));var jsonpatch=require(_0xdef5('0x3'));var rp=require(_0xdef5('0x4'));var moment=require(_0xdef5('0x5'));var BPromise=require(_0xdef5('0x6'));var Mustache=require('mustache');var util=require(_0xdef5('0x7'));var path=require('path');var sox=require(_0xdef5('0x8'));var csv=require(_0xdef5('0x9'));var ejs=require(_0xdef5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdef5('0xb'));var crypto=require(_0xdef5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdef5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdef5('0xe'));var Papa=require(_0xdef5('0xf'));var Redis=require('ioredis');var authService=require(_0xdef5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdef5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdef5('0x12'));var utils=require(_0xdef5('0x13'));var config=require(_0xdef5('0x14'));var licenseUtil=require(_0xdef5('0x15'));var db=require(_0xdef5('0x16'))['db'];function respondWithStatusCode(_0x170307,_0x594627){_0x594627=_0x594627||0xcc;return function(_0x1ca433){if(_0x1ca433){return _0x170307[_0xdef5('0x17')](_0x594627);}return _0x170307[_0xdef5('0x18')](_0x594627)[_0xdef5('0x19')]();};}function respondWithResult(_0x7cac2f,_0x503b04){_0x503b04=_0x503b04||0xc8;return function(_0x5831b6){if(_0x5831b6){return _0x7cac2f['status'](_0x503b04)['json'](_0x5831b6);}};}function respondWithFilteredResult(_0x2a4845,_0x41525c){return function(_0x2dfd37){if(_0x2dfd37){var _0x36f495=typeof _0x41525c[_0xdef5('0x1a')]===_0xdef5('0x1b')&&typeof _0x41525c[_0xdef5('0x1c')]===_0xdef5('0x1b');var _0x245c5e=_0x2dfd37[_0xdef5('0x1d')];var _0x32075c=_0x36f495?0x0:_0x41525c[_0xdef5('0x1a')];var _0x4b334b=_0x36f495?_0x2dfd37[_0xdef5('0x1d')]:_0x41525c[_0xdef5('0x1a')]+_0x41525c['limit'];var _0x586399;if(_0x4b334b>=_0x245c5e){_0x4b334b=_0x245c5e;_0x586399=0xc8;}else{_0x586399=0xce;}_0x2a4845[_0xdef5('0x18')](_0x586399);return _0x2a4845['set']('Content-Range',_0x32075c+'-'+_0x4b334b+'/'+_0x245c5e)[_0xdef5('0x1e')](_0x2dfd37);}return null;};}function patchUpdates(_0x52196f){return function(_0x4852b1){try{jsonpatch['apply'](_0x4852b1,_0x52196f,!![]);}catch(_0x254dfa){return BPromise[_0xdef5('0x1f')](_0x254dfa);}return _0x4852b1['save']();};}function saveUpdates(_0x141139,_0x46784c){return function(_0x5dc731){if(_0x5dc731){return _0x5dc731[_0xdef5('0x20')](_0x141139)[_0xdef5('0x21')](function(_0xb4089a){return _0xb4089a;});}return null;};}function removeEntity(_0xdd582d,_0x3f548d){return function(_0x4ed434){if(_0x4ed434){return _0x4ed434[_0xdef5('0x22')]()[_0xdef5('0x21')](function(){_0xdd582d[_0xdef5('0x18')](0xcc)[_0xdef5('0x19')]();});}};}function handleEntityNotFound(_0x59a375,_0x49ca61){return function(_0x2dbb68){if(!_0x2dbb68){_0x59a375[_0xdef5('0x17')](0x194);}return _0x2dbb68;};}function handleError(_0x273890,_0x679167){_0x679167=_0x679167||0x1f4;return function(_0x18fbd3){logger[_0xdef5('0x23')](_0x18fbd3['stack']);if(_0x18fbd3[_0xdef5('0x24')]){delete _0x18fbd3[_0xdef5('0x24')];}_0x273890[_0xdef5('0x18')](_0x679167)['send'](_0x18fbd3);};}exports[_0xdef5('0x25')]=function(_0x658757,_0x2e82c0){var _0x368600={},_0x41b63a={},_0x5bb619={'count':0x0,'rows':[]};var _0x34686d=_[_0xdef5('0x26')](db[_0xdef5('0x27')][_0xdef5('0x28')],function(_0xba4395){return{'name':_0xba4395[_0xdef5('0x29')],'type':_0xba4395[_0xdef5('0x2a')][_0xdef5('0x2b')]};});_0x41b63a['model']=_['map'](_0x34686d,'name');_0x41b63a[_0xdef5('0x2c')]=_[_0xdef5('0x2d')](_0x658757[_0xdef5('0x2c')]);_0x41b63a[_0xdef5('0x2e')]=_[_0xdef5('0x2f')](_0x41b63a['model'],_0x41b63a['query']);_0x368600[_0xdef5('0x30')]=_[_0xdef5('0x2f')](_0x41b63a[_0xdef5('0x31')],qs[_0xdef5('0x32')](_0x658757[_0xdef5('0x2c')][_0xdef5('0x32')]));_0x368600[_0xdef5('0x30')]=_0x368600[_0xdef5('0x30')]['length']?_0x368600[_0xdef5('0x30')]:_0x41b63a[_0xdef5('0x31')];if(!_0x658757[_0xdef5('0x2c')]['hasOwnProperty'](_0xdef5('0x33'))){_0x368600[_0xdef5('0x1c')]=qs[_0xdef5('0x1c')](_0x658757[_0xdef5('0x2c')]['limit']);_0x368600[_0xdef5('0x1a')]=qs[_0xdef5('0x1a')](_0x658757['query'][_0xdef5('0x1a')]);}_0x368600[_0xdef5('0x34')]=qs['sort'](_0x658757[_0xdef5('0x2c')][_0xdef5('0x35')]);_0x368600[_0xdef5('0x36')]=qs[_0xdef5('0x2e')](_[_0xdef5('0x37')](_0x658757[_0xdef5('0x2c')],_0x41b63a[_0xdef5('0x2e')]),_0x34686d);if(_0x658757[_0xdef5('0x2c')][_0xdef5('0x38')]){_0x368600['where']=_['merge'](_0x368600[_0xdef5('0x36')],{'$or':_[_0xdef5('0x26')](_0x34686d,function(_0x149ce2){if(_0x149ce2[_0xdef5('0x2a')]!==_0xdef5('0x39')){var _0x55958b={};_0x55958b[_0x149ce2['name']]={'$like':'%'+_0x658757['query']['filter']+'%'};return _0x55958b;}})});}_0x368600=_['merge']({},_0x368600,_0x658757['options']);var _0x59f530={'where':_0x368600[_0xdef5('0x36')]};return db[_0xdef5('0x27')][_0xdef5('0x1d')](_0x59f530)['then'](function(_0x522a10){_0x5bb619['count']=_0x522a10;if(_0x658757['query'][_0xdef5('0x3a')]){_0x368600['include']=[{'all':!![]}];}return db[_0xdef5('0x27')][_0xdef5('0x3b')](_0x368600);})[_0xdef5('0x21')](function(_0x469556){_0x5bb619[_0xdef5('0x3c')]=_0x469556;return _0x5bb619;})[_0xdef5('0x21')](respondWithFilteredResult(_0x2e82c0,_0x368600))[_0xdef5('0x3d')](handleError(_0x2e82c0,null));};exports[_0xdef5('0x3e')]=function(_0x5d7fe9,_0x468185){var _0x40a29a={'raw':!![],'where':{'id':_0x5d7fe9[_0xdef5('0x3f')]['id']}},_0x350769={};_0x350769[_0xdef5('0x31')]=_[_0xdef5('0x2d')](db[_0xdef5('0x27')][_0xdef5('0x28')]);_0x350769[_0xdef5('0x2c')]=_[_0xdef5('0x2d')](_0x5d7fe9['query']);_0x350769[_0xdef5('0x2e')]=_[_0xdef5('0x2f')](_0x350769[_0xdef5('0x31')],_0x350769[_0xdef5('0x2c')]);_0x40a29a[_0xdef5('0x30')]=_[_0xdef5('0x2f')](_0x350769['model'],qs[_0xdef5('0x32')](_0x5d7fe9[_0xdef5('0x2c')]['fields']));_0x40a29a['attributes']=_0x40a29a[_0xdef5('0x30')][_0xdef5('0x40')]?_0x40a29a[_0xdef5('0x30')]:_0x350769[_0xdef5('0x31')];if(_0x5d7fe9['query'][_0xdef5('0x3a')]){_0x40a29a[_0xdef5('0x41')]=[{'all':!![]}];}_0x40a29a=_['merge']({},_0x40a29a,_0x5d7fe9[_0xdef5('0x42')]);return db[_0xdef5('0x27')][_0xdef5('0x43')](_0x40a29a)[_0xdef5('0x21')](handleEntityNotFound(_0x468185,null))[_0xdef5('0x21')](respondWithResult(_0x468185,null))[_0xdef5('0x3d')](handleError(_0x468185,null));};exports[_0xdef5('0x44')]=function(_0x593882,_0x1e5961){return db[_0xdef5('0x27')][_0xdef5('0x44')](_0x593882[_0xdef5('0x45')],{})[_0xdef5('0x21')](respondWithResult(_0x1e5961,0xc9))[_0xdef5('0x3d')](handleError(_0x1e5961,null));};exports[_0xdef5('0x46')]=function(_0x55f0b5,_0x2bda44){return db[_0xdef5('0x27')][_0xdef5('0x46')]()[_0xdef5('0x21')](respondWithResult(_0x2bda44,null))[_0xdef5('0x3d')](handleError(_0x2bda44,null));};exports[_0xdef5('0x20')]=function(_0x4a6f7c,_0x13a1e2){if(_0x4a6f7c['body'][_0xdef5('0x47')]){delete _0x4a6f7c['body']['uniqueid'];}return db['CmHopperHistory'][_0xdef5('0x43')]({'where':{'uniqueid':_0x4a6f7c[_0xdef5('0x3f')]['id']}})[_0xdef5('0x21')](handleEntityNotFound(_0x13a1e2,null))[_0xdef5('0x21')](saveUpdates(_0x4a6f7c[_0xdef5('0x45')],null))['then'](respondWithResult(_0x13a1e2,null))[_0xdef5('0x3d')](handleError(_0x13a1e2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 154f4c8..4f4cb0d 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 _0x5eed=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','lodash','util','../../config/logger','api'];(function(_0x4934b4,_0x251a19){var _0x5bb786=function(_0x208446){while(--_0x208446){_0x4934b4['push'](_0x4934b4['shift']());}};_0x5bb786(++_0x251a19);}(_0x5eed,0x10a));var _0xd5ee=function(_0x3ab2d4,_0x228237){_0x3ab2d4=_0x3ab2d4-0x0;var _0x5136ad=_0x5eed[_0x3ab2d4];return _0x5136ad;};'use strict';var _=require(_0xd5ee('0x0'));var util=require(_0xd5ee('0x1'));var logger=require(_0xd5ee('0x2'))(_0xd5ee('0x3'));var moment=require(_0xd5ee('0x4'));var BPromise=require(_0xd5ee('0x5'));var rp=require(_0xd5ee('0x6'));var fs=require('fs');var path=require(_0xd5ee('0x7'));var rimraf=require(_0xd5ee('0x8'));var config=require(_0xd5ee('0x9'));var attributes=require('./cmHopperHistory.attributes');module[_0xd5ee('0xa')]=function(_0x347377,_0xc7de11){return _0x347377[_0xd5ee('0xb')](_0xd5ee('0xc'),attributes,{'tableName':_0xd5ee('0xd'),'paranoid':![],'indexes':[{'name':_0xd5ee('0xe'),'fields':[_0xd5ee('0xe')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc00b=['uniqueid','lodash','moment','request-promise','path','rimraf','../../config/environment','exports','CmHopperHistory','cm_hopper_history','endtime'];(function(_0x13b7fd,_0x4eaf7f){var _0x32a74a=function(_0x2c5d80){while(--_0x2c5d80){_0x13b7fd['push'](_0x13b7fd['shift']());}};_0x32a74a(++_0x4eaf7f);}(_0xc00b,0x1e5));var _0xbc00=function(_0x15f236,_0x59a12b){_0x15f236=_0x15f236-0x0;var _0x3645c0=_0xc00b[_0x15f236];return _0x3645c0;};'use strict';var _=require(_0xbc00('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbc00('0x1'));var BPromise=require('bluebird');var rp=require(_0xbc00('0x2'));var fs=require('fs');var path=require(_0xbc00('0x3'));var rimraf=require(_0xbc00('0x4'));var config=require(_0xbc00('0x5'));var attributes=require('./cmHopperHistory.attributes');module[_0xbc00('0x6')]=function(_0x5b47bf,_0x1cc85f){return _0x5b47bf['define'](_0xbc00('0x7'),attributes,{'tableName':_0xbc00('0x8'),'paranoid':![],'indexes':[{'name':_0xbc00('0x9'),'fields':[_0xbc00('0x9')]},{'name':_0xbc00('0xa'),'fields':[_0xbc00('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index cb68fad..2418c40 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 _0x12c9=['outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','then','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x12c9,0x10e));var _0x912c=function(_0x40683e,_0x29c84e){_0x40683e=_0x40683e-0x0;var _0x400eba=_0x12c9[_0x40683e];return _0x400eba;};'use strict';var _=require(_0x912c('0x0'));var util=require('util');var moment=require(_0x912c('0x1'));var BPromise=require(_0x912c('0x2'));var rs=require(_0x912c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x912c('0x4'));var logger=require(_0x912c('0x5'))('rpc');var config=require(_0x912c('0x6'));var jayson=require(_0x912c('0x7'));var client=jayson['client'][_0x912c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4600d8,_0x44662a,_0x4cccfc){return new BPromise(function(_0x5df972,_0x9ba2f1){return client[_0x912c('0x9')](_0x4600d8,_0x4cccfc)['then'](function(_0x42e836){logger[_0x912c('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x44662a,'request\x20sent');logger[_0x912c('0xb')](_0x912c('0xc'),_0x44662a,_0x912c('0xd'),JSON[_0x912c('0xe')](_0x42e836));if(_0x42e836['error']){if(_0x42e836[_0x912c('0xf')]['code']===0x1f4){logger['error'](_0x912c('0x10'),_0x44662a,_0x42e836[_0x912c('0xf')][_0x912c('0x11')]);return _0x9ba2f1(_0x42e836[_0x912c('0xf')][_0x912c('0x11')]);}logger['error'](_0x912c('0x10'),_0x44662a,_0x42e836[_0x912c('0xf')][_0x912c('0x11')]);return _0x5df972(_0x42e836[_0x912c('0xf')][_0x912c('0x11')]);}else{logger[_0x912c('0xa')](_0x912c('0x10'),_0x44662a,_0x912c('0xd'));_0x5df972(_0x42e836[_0x912c('0x12')][_0x912c('0x11')]);}})[_0x912c('0x13')](function(_0x17855b){logger[_0x912c('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x44662a,_0x17855b);_0x9ba2f1(_0x17855b);});});}exports[_0x912c('0x14')]=function(_0x284684){var _0x2c8ab5=this;return new Promise(function(_0x47f2e6,_0x1c2c0f){return db[_0x912c('0x15')]['create'](_0x284684[_0x912c('0x16')],{'raw':_0x284684[_0x912c('0x17')]?_0x284684[_0x912c('0x17')][_0x912c('0x18')]===undefined?!![]:![]:!![]})[_0x912c('0x19')](function(_0xec949e){logger[_0x912c('0xa')](_0x912c('0x14'),_0x284684);logger[_0x912c('0xb')]('CreateCmHopperHistory',_0x284684,JSON['stringify'](_0xec949e));_0x47f2e6(_0xec949e);})[_0x912c('0x13')](function(_0x5c7e4c){logger[_0x912c('0xf')](_0x912c('0x14'),_0x5c7e4c[_0x912c('0x11')],_0x284684);_0x1c2c0f(_0x2c8ab5['error'](0x1f4,_0x5c7e4c[_0x912c('0x11')]));});});};exports[_0x912c('0x1a')]=function(_0x12ab6b){var _0x35e1ca=this;return new Promise(function(_0x5a916e,_0x28d6d9){return db[_0x912c('0x15')][_0x912c('0x1b')]({'raw':_0x12ab6b[_0x912c('0x17')]?_0x12ab6b[_0x912c('0x17')][_0x912c('0x18')]===undefined?!![]:![]:!![],'where':_0x12ab6b[_0x912c('0x17')]?_0x12ab6b[_0x912c('0x17')][_0x912c('0x1c')]||null:null,'attributes':[[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db['sequelize'][_0x912c('0x1f')]('id')),_0x912c('0x20')],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')](_0x912c('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')]['literal'](_0x912c('0x23')))),_0x912c('0x24')],[db[_0x912c('0x1d')]['fn']('COUNT',db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')]('`state`\x20=\x2011,\x201,\x20null'))),_0x912c('0x25')],[db[_0x912c('0x1d')]['fn'](_0x912c('0x26'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x912c('0x27')))),_0x912c('0x28')],[db[_0x912c('0x1d')]['fn']('AVG',db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')](_0x912c('0x29')))),'predictiveIntervalAvgTalktime']]})[_0x912c('0x19')](function(_0xd9fbdf){logger['info'](_0x912c('0x1a'),_0x12ab6b);logger[_0x912c('0xb')](_0x912c('0x1a'),_0x12ab6b,JSON[_0x912c('0xe')](_0xd9fbdf));_0x5a916e(_0xd9fbdf);})['catch'](function(_0x2a0d11){logger['error'](_0x912c('0x1a'),_0x2a0d11[_0x912c('0x11')],_0x12ab6b);_0x28d6d9(_0x35e1ca[_0x912c('0xf')](0x1f4,_0x2a0d11[_0x912c('0x11')]));});});};exports[_0x912c('0x2a')]=function(_0x21eac9){var _0x1a6e72=this;return new Promise(function(_0x5dec06,_0x47fbb0){return db[_0x912c('0x15')][_0x912c('0x1b')]({'raw':_0x21eac9[_0x912c('0x17')]?_0x21eac9[_0x912c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x21eac9[_0x912c('0x17')]?_0x21eac9[_0x912c('0x17')]['where']||null:null,'attributes':[[_0x912c('0x2b'),'name'],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')]['literal'](_0x912c('0x2c')))),_0x912c('0x2d')],[db[_0x912c('0x1d')]['fn']('COUNT',db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')](_0x912c('0x2e')))),_0x912c('0x2f')],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')](_0x912c('0x22')))),'outboundAnswerCallsDay'],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db['sequelize']['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0x912c('0x30')],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')](_0x912c('0x31')))),'outboundCongestionCallsDay'],[db[_0x912c('0x1d')]['fn']('COUNT',db[_0x912c('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x912c('0x32')))),_0x912c('0x33')],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x912c('0x34')],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db['sequelize']['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')](_0x912c('0x35')))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),_0x912c('0x36')],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0x912c('0x37')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x912c('0x21')](_0x912c('0x38')))),_0x912c('0x39')],[db['sequelize']['fn']('COUNT',db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x912c('0x3a')],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')](_0x912c('0x3b')))),_0x912c('0x39')],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')](_0x912c('0x3c')))),_0x912c('0x3d')]],'group':[_0x912c('0x2b')]})[_0x912c('0x19')](function(_0x21e07b){logger[_0x912c('0xa')](_0x912c('0x2a'),_0x21eac9);logger[_0x912c('0xb')](_0x912c('0x2a'),_0x21eac9,JSON[_0x912c('0xe')](_0x21e07b));_0x5dec06(_0x21e07b);})[_0x912c('0x13')](function(_0x5e756c){logger['error'](_0x912c('0x2a'),_0x5e756c[_0x912c('0x11')],_0x21eac9);_0x47fbb0(_0x1a6e72[_0x912c('0xf')](0x1f4,_0x5e756c[_0x912c('0x11')]));});});};exports[_0x912c('0x3e')]=function(_0xabe92e){var _0x5986ee=this;return new Promise(function(_0x56f576,_0x2269e7){return db['CmHopperHistory']['findAll']({'raw':_0xabe92e[_0x912c('0x17')]?_0xabe92e[_0x912c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xabe92e['options']?_0xabe92e['options'][_0x912c('0x1c')]||null:null,'attributes':[[_0x912c('0x2b'),'name'],[db[_0x912c('0x1d')]['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')][_0x912c('0x1f')]('id')),_0x912c('0x3f')],[db['sequelize']['fn'](_0x912c('0x1e'),db[_0x912c('0x1d')]['fn']('IF',db[_0x912c('0x1d')][_0x912c('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x912c('0x40')]],'group':['campaign']})[_0x912c('0x19')](function(_0x480f56){logger[_0x912c('0xa')](_0x912c('0x3e'),_0xabe92e);logger[_0x912c('0xb')](_0x912c('0x3e'),_0xabe92e,JSON['stringify'](_0x480f56));_0x56f576(_0x480f56);})[_0x912c('0x13')](function(_0x36fbea){logger[_0x912c('0xf')](_0x912c('0x3e'),_0x36fbea[_0x912c('0x11')],_0xabe92e);_0x2269e7(_0x5986ee[_0x912c('0xf')](0x1f4,_0x36fbea[_0x912c('0x11')]));});});}; \ No newline at end of file +var _0xf0f4=['outboundReCallsDay','GetCampaignHopperHistory','findAll','col','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','raw','AvgHandleTime','options','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x167bf6,_0x18cd30){var _0x369e45=function(_0x118379){while(--_0x118379){_0x167bf6['push'](_0x167bf6['shift']());}};_0x369e45(++_0x18cd30);}(_0xf0f4,0x1d3));var _0x4f0f=function(_0x32e031,_0x234f9b){_0x32e031=_0x32e031-0x0;var _0x587b6f=_0xf0f4[_0x32e031];return _0x587b6f;};'use strict';var _=require(_0x4f0f('0x0'));var util=require(_0x4f0f('0x1'));var moment=require(_0x4f0f('0x2'));var BPromise=require(_0x4f0f('0x3'));var rs=require(_0x4f0f('0x4'));var fs=require('fs');var Redis=require(_0x4f0f('0x5'));var db=require(_0x4f0f('0x6'))['db'];var utils=require(_0x4f0f('0x7'));var logger=require('../../config/logger')(_0x4f0f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4f0f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58f98f,_0x38d544,_0x253d9d){return new BPromise(function(_0x410095,_0x1f03f0){return client[_0x4f0f('0xa')](_0x58f98f,_0x253d9d)[_0x4f0f('0xb')](function(_0x3baf6b){logger[_0x4f0f('0xc')](_0x4f0f('0xd'),_0x38d544,_0x4f0f('0xe'));logger[_0x4f0f('0xf')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x38d544,_0x4f0f('0xe'),JSON[_0x4f0f('0x10')](_0x3baf6b));if(_0x3baf6b[_0x4f0f('0x11')]){if(_0x3baf6b['error'][_0x4f0f('0x12')]===0x1f4){logger[_0x4f0f('0x11')](_0x4f0f('0xd'),_0x38d544,_0x3baf6b[_0x4f0f('0x11')][_0x4f0f('0x13')]);return _0x1f03f0(_0x3baf6b[_0x4f0f('0x11')]['message']);}logger[_0x4f0f('0x11')](_0x4f0f('0xd'),_0x38d544,_0x3baf6b['error']['message']);return _0x410095(_0x3baf6b[_0x4f0f('0x11')][_0x4f0f('0x13')]);}else{logger[_0x4f0f('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x38d544,_0x4f0f('0xe'));_0x410095(_0x3baf6b[_0x4f0f('0x14')][_0x4f0f('0x13')]);}})[_0x4f0f('0x15')](function(_0x1ed1a6){logger[_0x4f0f('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x38d544,_0x1ed1a6);_0x1f03f0(_0x1ed1a6);});});}exports[_0x4f0f('0x16')]=function(_0x4940cd){var _0x4880ef=this;return new Promise(function(_0x38f042,_0x5da144){return db[_0x4f0f('0x17')][_0x4f0f('0x18')](_0x4940cd[_0x4f0f('0x19')],{'raw':_0x4940cd['options']?_0x4940cd['options'][_0x4f0f('0x1a')]===undefined?!![]:![]:!![]})[_0x4f0f('0xb')](function(_0x5ebe60){logger['info']('CreateCmHopperHistory',_0x4940cd);logger[_0x4f0f('0xf')](_0x4f0f('0x16'),_0x4940cd,JSON[_0x4f0f('0x10')](_0x5ebe60));_0x38f042(_0x5ebe60);})[_0x4f0f('0x15')](function(_0x28329d){logger[_0x4f0f('0x11')](_0x4f0f('0x16'),_0x28329d[_0x4f0f('0x13')],_0x4940cd);_0x5da144(_0x4880ef['error'](0x1f4,_0x28329d[_0x4f0f('0x13')]));});});};exports[_0x4f0f('0x1b')]=function(_0x14ee55){var _0xf2cde5=this;return new Promise(function(_0x1cd5c5,_0x1badc0){return db[_0x4f0f('0x17')]['findAll']({'raw':_0x14ee55[_0x4f0f('0x1c')]?_0x14ee55[_0x4f0f('0x1c')][_0x4f0f('0x1a')]===undefined?!![]:![]:!![],'where':_0x14ee55[_0x4f0f('0x1c')]?_0x14ee55[_0x4f0f('0x1c')][_0x4f0f('0x1d')]||null:null,'attributes':[[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db['sequelize']['col']('id')),_0x4f0f('0x20')],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')]['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')](_0x4f0f('0x22')))),_0x4f0f('0x23')],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')]['fn']('IF',db['sequelize'][_0x4f0f('0x21')](_0x4f0f('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x4f0f('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')]('`state`\x20=\x2011,\x201,\x20null'))),_0x4f0f('0x25')],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x26'),db['sequelize']['fn']('IF',db['sequelize'][_0x4f0f('0x21')](_0x4f0f('0x27')))),_0x4f0f('0x28')],[db['sequelize']['fn']('AVG',db['sequelize']['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')](_0x4f0f('0x29')))),'predictiveIntervalAvgTalktime']]})[_0x4f0f('0xb')](function(_0x3a669a){logger['info']('AvgHandleTime',_0x14ee55);logger['debug'](_0x4f0f('0x1b'),_0x14ee55,JSON[_0x4f0f('0x10')](_0x3a669a));_0x1cd5c5(_0x3a669a);})[_0x4f0f('0x15')](function(_0x1d7f32){logger[_0x4f0f('0x11')](_0x4f0f('0x1b'),_0x1d7f32['message'],_0x14ee55);_0x1badc0(_0xf2cde5[_0x4f0f('0x11')](0x1f4,_0x1d7f32[_0x4f0f('0x13')]));});});};exports[_0x4f0f('0x2a')]=function(_0x15296b){var _0x43f0b4=this;return new Promise(function(_0x3dbd45,_0x465705){return db[_0x4f0f('0x17')]['findAll']({'raw':_0x15296b[_0x4f0f('0x1c')]?_0x15296b['options'][_0x4f0f('0x1a')]===undefined?!![]:![]:!![],'where':_0x15296b[_0x4f0f('0x1c')]?_0x15296b[_0x4f0f('0x1c')][_0x4f0f('0x1d')]||null:null,'attributes':[[_0x4f0f('0x2b'),_0x4f0f('0x2c')],[db[_0x4f0f('0x1e')]['fn']('COUNT',db[_0x4f0f('0x1e')]['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')](_0x4f0f('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db['sequelize']['fn']('IF',db[_0x4f0f('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x4f0f('0x2e')],[db['sequelize']['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')]['fn']('IF',db['sequelize'][_0x4f0f('0x21')](_0x4f0f('0x22')))),'outboundAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')](_0x4f0f('0x2f')))),_0x4f0f('0x30')],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')]['fn']('IF',db['sequelize'][_0x4f0f('0x21')]('`state`\x20=\x208,\x201,\x20null'))),_0x4f0f('0x31')],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')]['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')](_0x4f0f('0x32')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x4f0f('0x1f'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4f0f('0x33')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0x4f0f('0x1f'),db['sequelize']['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')](_0x4f0f('0x34')))),_0x4f0f('0x35')],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x4f0f('0x36')))),'outboundBlacklistCallsDay'],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')]['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')](_0x4f0f('0x37')))),'outboundOriginateFailureCallsDay'],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')]['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')](_0x4f0f('0x38')))),_0x4f0f('0x39')],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')]['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')](_0x4f0f('0x3a')))),_0x4f0f('0x3b')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4f0f('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x4f0f('0x39')],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')]['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')](_0x4f0f('0x3c')))),_0x4f0f('0x3d')]],'group':[_0x4f0f('0x2b')]})[_0x4f0f('0xb')](function(_0x2ab249){logger['info'](_0x4f0f('0x2a'),_0x15296b);logger[_0x4f0f('0xf')]('GetVoiceQueueHopperHistory',_0x15296b,JSON[_0x4f0f('0x10')](_0x2ab249));_0x3dbd45(_0x2ab249);})[_0x4f0f('0x15')](function(_0x5bdaaf){logger['error'](_0x4f0f('0x2a'),_0x5bdaaf[_0x4f0f('0x13')],_0x15296b);_0x465705(_0x43f0b4[_0x4f0f('0x11')](0x1f4,_0x5bdaaf[_0x4f0f('0x13')]));});});};exports[_0x4f0f('0x3e')]=function(_0x554d2b){var _0x50af27=this;return new Promise(function(_0x59a94d,_0x45f162){return db[_0x4f0f('0x17')][_0x4f0f('0x3f')]({'raw':_0x554d2b['options']?_0x554d2b[_0x4f0f('0x1c')][_0x4f0f('0x1a')]===undefined?!![]:![]:!![],'where':_0x554d2b[_0x4f0f('0x1c')]?_0x554d2b[_0x4f0f('0x1c')][_0x4f0f('0x1d')]||null:null,'attributes':[[_0x4f0f('0x2b'),_0x4f0f('0x2c')],[db[_0x4f0f('0x1e')]['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')][_0x4f0f('0x40')]('id')),_0x4f0f('0x41')],[db['sequelize']['fn'](_0x4f0f('0x1f'),db[_0x4f0f('0x1e')]['fn']('IF',db[_0x4f0f('0x1e')][_0x4f0f('0x21')](_0x4f0f('0x22')))),'ivrAnswerCallsDay']],'group':[_0x4f0f('0x2b')]})[_0x4f0f('0xb')](function(_0x3488c4){logger[_0x4f0f('0xc')](_0x4f0f('0x3e'),_0x554d2b);logger[_0x4f0f('0xf')](_0x4f0f('0x3e'),_0x554d2b,JSON['stringify'](_0x3488c4));_0x59a94d(_0x3488c4);})[_0x4f0f('0x15')](function(_0x523e0e){logger['error'](_0x4f0f('0x3e'),_0x523e0e[_0x4f0f('0x13')],_0x554d2b);_0x45f162(_0x50af27[_0x4f0f('0x11')](0x1f4,_0x523e0e[_0x4f0f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 8268141..9a37060 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 _0x3423=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','update','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3423,0x1b8));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require('express');var router=express[_0x3342('0x2')]();var fs_extra=require(_0x3342('0x3'));var auth=require(_0x3342('0x4'));var interaction=require(_0x3342('0x5'));var config=require(_0x3342('0x6'));var controller=require(_0x3342('0x7'));router[_0x3342('0x8')]('/',auth['isAuthenticated'](),controller[_0x3342('0x9')]);router['get'](_0x3342('0xa'),auth[_0x3342('0xb')](),controller[_0x3342('0xc')]);router['get'](_0x3342('0xd'),auth[_0x3342('0xb')](),controller[_0x3342('0xe')]);router[_0x3342('0xf')]('/',auth[_0x3342('0xb')](),controller['create']);router['put'](_0x3342('0xd'),auth[_0x3342('0xb')](),controller[_0x3342('0x10')]);module['exports']=router; \ No newline at end of file +var _0x811b=['index','/describe','describe','get','/:id','isAuthenticated','show','post','create','put','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x811b,0x1ad));var _0xb811=function(_0x41cf04,_0x41e49b){_0x41cf04=_0x41cf04-0x0;var _0x270ada=_0x811b[_0x41cf04];return _0x270ada;};'use strict';var multer=require(_0xb811('0x0'));var util=require(_0xb811('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb811('0x2'));var router=express[_0xb811('0x3')]();var fs_extra=require(_0xb811('0x4'));var auth=require(_0xb811('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb811('0x6'));var controller=require(_0xb811('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb811('0x8')]);router['get'](_0xb811('0x9'),auth['isAuthenticated'](),controller[_0xb811('0xa')]);router[_0xb811('0xb')](_0xb811('0xc'),auth[_0xb811('0xd')](),controller[_0xb811('0xe')]);router[_0xb811('0xf')]('/',auth[_0xb811('0xd')](),controller[_0xb811('0x10')]);router[_0xb811('0x11')](_0xb811('0xc'),auth['isAuthenticated'](),controller['update']);module[_0xb811('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index a2c745d..654939c 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 _0xf698=['name','STRING','sequelize','exports'];(function(_0x268fcd,_0x42bcd8){var _0x4ef2eb=function(_0x362044){while(--_0x362044){_0x268fcd['push'](_0x268fcd['shift']());}};_0x4ef2eb(++_0x42bcd8);}(_0xf698,0x1de));var _0x8f69=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0xf698[_0x27e811];return _0x1627fa;};'use strict';var Sequelize=require(_0x8f69('0x0'));module[_0x8f69('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8f69('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8f69('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x55d2=['name','STRING'];(function(_0x500dc4,_0x1be2bc){var _0x3080f8=function(_0x3d4979){while(--_0x3d4979){_0x500dc4['push'](_0x500dc4['shift']());}};_0x3080f8(++_0x1be2bc);}(_0x55d2,0x9f));var _0x255d=function(_0x20ea49,_0x1b6a5a){_0x20ea49=_0x20ea49-0x0;var _0x11b049=_0x55d2[_0x20ea49];return _0x11b049;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x255d('0x0')],'unique':_0x255d('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x255d('0x0')]},'dialPrefix':{'type':Sequelize[_0x255d('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 32191bf..12860a5 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 _0xea80=['Lists','UserProfileResource','destroy','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','options','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','describe','addDisposition','ListId','Disposition','findOne','length','includeAll','removeDispositions','ids','tags','isArray','join','push','each','CmContact','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','concat','CustomFields','format','raw','getContactsCsv','OrderBy','CmCustomField','findAll','alias','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','c.cf_','customField_','select','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','download','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','info','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','get'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0xea80,0x11c));var _0x0ea8=function(_0x49bb91,_0x48cc14){_0x49bb91=_0x49bb91-0x0;var _0x506f9a=_0xea80[_0x49bb91];return _0x506f9a;};'use strict';var emlformat=require(_0x0ea8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0ea8('0x1'));var rp=require(_0x0ea8('0x2'));var moment=require(_0x0ea8('0x3'));var BPromise=require(_0x0ea8('0x4'));var Mustache=require(_0x0ea8('0x5'));var util=require('util');var path=require(_0x0ea8('0x6'));var sox=require(_0x0ea8('0x7'));var csv=require(_0x0ea8('0x8'));var ejs=require(_0x0ea8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0ea8('0xa'));var crypto=require(_0x0ea8('0xb'));var jsforce=require(_0x0ea8('0xc'));var deskjs=require(_0x0ea8('0xd'));var toCsv=require(_0x0ea8('0x8'));var querystring=require(_0x0ea8('0xe'));var Papa=require(_0x0ea8('0xf'));var Redis=require(_0x0ea8('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ea8('0x11'));var hardwareService=require(_0x0ea8('0x12'));var logger=require(_0x0ea8('0x13'))('api');var utils=require(_0x0ea8('0x14'));var config=require(_0x0ea8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ea8('0x16'))['db'];var csv_results;config[_0x0ea8('0x17')]=_[_0x0ea8('0x18')](config[_0x0ea8('0x17')],{'host':_0x0ea8('0x19'),'port':0x18eb});var socket=require(_0x0ea8('0x1a'))(new Redis(config[_0x0ea8('0x17')]));require(_0x0ea8('0x1b'))['register'](socket);function respondWithStatusCode(_0xf713e6,_0x25fe0f){_0x25fe0f=_0x25fe0f||0xcc;return function(_0x2083dc){if(_0x2083dc){return _0xf713e6[_0x0ea8('0x1c')](_0x25fe0f);}return _0xf713e6[_0x0ea8('0x1d')](_0x25fe0f)[_0x0ea8('0x1e')]();};}function respondWithResult(_0x21f85e,_0x31ae8b){_0x31ae8b=_0x31ae8b||0xc8;return function(_0x4858c4){if(_0x4858c4){return _0x21f85e[_0x0ea8('0x1d')](_0x31ae8b)[_0x0ea8('0x1f')](_0x4858c4);}};}function respondWithFilteredResult(_0x49d202,_0x201a93){return function(_0x31aabd){if(_0x31aabd){var _0x30b02a=typeof _0x201a93['offset']===_0x0ea8('0x20')&&typeof _0x201a93['limit']==='undefined';var _0x47b4df=_0x31aabd[_0x0ea8('0x21')];var _0xb56cee=_0x30b02a?0x0:_0x201a93[_0x0ea8('0x22')];var _0x43e68e=_0x30b02a?_0x31aabd[_0x0ea8('0x21')]:_0x201a93[_0x0ea8('0x22')]+_0x201a93['limit'];var _0x35bcc2;if(_0x43e68e>=_0x47b4df){_0x43e68e=_0x47b4df;_0x35bcc2=0xc8;}else{_0x35bcc2=0xce;}_0x49d202[_0x0ea8('0x1d')](_0x35bcc2);return _0x49d202['set'](_0x0ea8('0x23'),_0xb56cee+'-'+_0x43e68e+'/'+_0x47b4df)[_0x0ea8('0x1f')](_0x31aabd);}return null;};}function patchUpdates(_0x137d8f){return function(_0x438cbf){try{jsonpatch[_0x0ea8('0x24')](_0x438cbf,_0x137d8f,!![]);}catch(_0x289744){return BPromise[_0x0ea8('0x25')](_0x289744);}return _0x438cbf[_0x0ea8('0x26')]();};}function saveUpdates(_0x20e9a4,_0x3f0b0e){return function(_0x542cf5){if(_0x542cf5){return _0x542cf5[_0x0ea8('0x27')](_0x20e9a4)[_0x0ea8('0x28')](function(_0x241706){return _0x241706;});}return null;};}function removeEntity(_0x58ed00,_0x393e81){return function(_0x5c52fd){if(_0x5c52fd){return _0x5c52fd['destroy']()[_0x0ea8('0x28')](function(){var _0xdf4cde=_0x5c52fd[_0x0ea8('0x29')]({'plain':!![]});var _0x208d37=_0x0ea8('0x2a');return db[_0x0ea8('0x2b')][_0x0ea8('0x2c')]({'where':{'type':_0x208d37,'resourceId':_0xdf4cde['id']}})[_0x0ea8('0x28')](function(){return _0x5c52fd;});})[_0x0ea8('0x28')](function(){_0x58ed00[_0x0ea8('0x1d')](0xcc)[_0x0ea8('0x1e')]();});}};}function handleEntityNotFound(_0x47ba27,_0x221269){return function(_0x28e550){if(!_0x28e550){_0x47ba27['sendStatus'](0x194);}return _0x28e550;};}function handleError(_0x4d4d09,_0x5ddf4e){_0x5ddf4e=_0x5ddf4e||0x1f4;return function(_0x4ee2e8){logger[_0x0ea8('0x2d')](_0x4ee2e8[_0x0ea8('0x2e')]);if(_0x4ee2e8[_0x0ea8('0x2f')]){delete _0x4ee2e8[_0x0ea8('0x2f')];}_0x4d4d09[_0x0ea8('0x1d')](_0x5ddf4e)[_0x0ea8('0x30')](_0x4ee2e8);};}exports[_0x0ea8('0x31')]=function(_0x11fdf0,_0x799bf1){var _0x499ebf={},_0x1a4c11={},_0x454e31={'count':0x0,'rows':[]};var _0x14f406=_[_0x0ea8('0x32')](db[_0x0ea8('0x33')][_0x0ea8('0x34')],function(_0x1c27f2){return{'name':_0x1c27f2[_0x0ea8('0x35')],'type':_0x1c27f2[_0x0ea8('0x36')][_0x0ea8('0x37')]};});_0x1a4c11[_0x0ea8('0x38')]=_[_0x0ea8('0x32')](_0x14f406,_0x0ea8('0x2f'));_0x1a4c11[_0x0ea8('0x39')]=_[_0x0ea8('0x3a')](_0x11fdf0[_0x0ea8('0x39')]);_0x1a4c11['filters']=_[_0x0ea8('0x3b')](_0x1a4c11[_0x0ea8('0x38')],_0x1a4c11[_0x0ea8('0x39')]);_0x499ebf[_0x0ea8('0x3c')]=_[_0x0ea8('0x3b')](_0x1a4c11['model'],qs['fields'](_0x11fdf0['query'][_0x0ea8('0x3d')]));_0x499ebf[_0x0ea8('0x3c')]=_0x499ebf[_0x0ea8('0x3c')]['length']?_0x499ebf[_0x0ea8('0x3c')]:_0x1a4c11['model'];if(!_0x11fdf0['query'][_0x0ea8('0x3e')](_0x0ea8('0x3f'))){_0x499ebf[_0x0ea8('0x40')]=qs[_0x0ea8('0x40')](_0x11fdf0[_0x0ea8('0x39')][_0x0ea8('0x40')]);_0x499ebf[_0x0ea8('0x22')]=qs[_0x0ea8('0x22')](_0x11fdf0['query'][_0x0ea8('0x22')]);}_0x499ebf[_0x0ea8('0x41')]=qs[_0x0ea8('0x42')](_0x11fdf0[_0x0ea8('0x39')][_0x0ea8('0x42')]);_0x499ebf[_0x0ea8('0x43')]=qs['filters'](_[_0x0ea8('0x44')](_0x11fdf0[_0x0ea8('0x39')],_0x1a4c11[_0x0ea8('0x45')]),_0x14f406);if(_0x11fdf0[_0x0ea8('0x39')][_0x0ea8('0x46')]){_0x499ebf[_0x0ea8('0x43')]=_[_0x0ea8('0x47')](_0x499ebf[_0x0ea8('0x43')],{'$or':_[_0x0ea8('0x32')](_0x14f406,function(_0x2f1238){if(_0x2f1238[_0x0ea8('0x36')]!=='VIRTUAL'){var _0x4a0e66={};_0x4a0e66[_0x2f1238[_0x0ea8('0x2f')]]={'$like':'%'+_0x11fdf0[_0x0ea8('0x39')][_0x0ea8('0x46')]+'%'};return _0x4a0e66;}})});}_0x499ebf=_[_0x0ea8('0x47')]({},_0x499ebf,_0x11fdf0[_0x0ea8('0x48')]);var _0x4cf376={'where':_0x499ebf['where']};return db[_0x0ea8('0x33')][_0x0ea8('0x21')](_0x4cf376)[_0x0ea8('0x28')](function(_0x5d7cca){_0x454e31[_0x0ea8('0x21')]=_0x5d7cca;if(_0x11fdf0[_0x0ea8('0x39')]['includeAll']){_0x499ebf['include']=[{'all':!![]}];}return db[_0x0ea8('0x33')]['findAll'](_0x499ebf);})[_0x0ea8('0x28')](function(_0x1c43bf){_0x454e31[_0x0ea8('0x49')]=_0x1c43bf;return _0x454e31;})['then'](respondWithFilteredResult(_0x799bf1,_0x499ebf))[_0x0ea8('0x4a')](handleError(_0x799bf1,null));};exports[_0x0ea8('0x4b')]=function(_0x435da1,_0x59a4b3){var _0x18ce35={'raw':![],'where':{'id':_0x435da1[_0x0ea8('0x4c')]['id']}},_0x415afe={};_0x415afe[_0x0ea8('0x38')]=_[_0x0ea8('0x3a')](db[_0x0ea8('0x33')][_0x0ea8('0x34')]);_0x415afe['query']=_[_0x0ea8('0x3a')](_0x435da1[_0x0ea8('0x39')]);_0x415afe['filters']=_['intersection'](_0x415afe[_0x0ea8('0x38')],_0x415afe['query']);_0x18ce35[_0x0ea8('0x3c')]=_[_0x0ea8('0x3b')](_0x415afe[_0x0ea8('0x38')],qs[_0x0ea8('0x3d')](_0x435da1[_0x0ea8('0x39')][_0x0ea8('0x3d')]));_0x18ce35['attributes']=_0x18ce35[_0x0ea8('0x3c')]['length']?_0x18ce35[_0x0ea8('0x3c')]:_0x415afe[_0x0ea8('0x38')];if(_0x435da1['query']['includeAll']){_0x18ce35['include']=[{'all':!![]}];}_0x18ce35=_['merge']({},_0x18ce35,_0x435da1[_0x0ea8('0x48')]);return db[_0x0ea8('0x33')][_0x0ea8('0x4d')](_0x18ce35)['then'](handleEntityNotFound(_0x59a4b3,null))['then'](respondWithResult(_0x59a4b3,null))[_0x0ea8('0x4a')](handleError(_0x59a4b3,null));};exports[_0x0ea8('0x4e')]=function(_0x5becc8,_0x510ab5){return db[_0x0ea8('0x33')][_0x0ea8('0x4e')](_0x5becc8[_0x0ea8('0x4f')],{})[_0x0ea8('0x28')](function(_0x278da8){var _0x2a6bbf=_0x5becc8[_0x0ea8('0x50')][_0x0ea8('0x29')]({'plain':!![]});if(!_0x2a6bbf)throw new Error(_0x0ea8('0x51'));if(_0x2a6bbf['role']===_0x0ea8('0x50')){var _0x4c1e9e=_0x278da8[_0x0ea8('0x29')]({'plain':!![]});var _0x33d785='Lists';return db['UserProfileSection']['find']({'where':{'name':_0x33d785,'userProfileId':_0x2a6bbf[_0x0ea8('0x52')]},'raw':!![]})['then'](function(_0x441f95){if(_0x441f95&&_0x441f95[_0x0ea8('0x53')]===0x0){return db[_0x0ea8('0x2b')][_0x0ea8('0x4e')]({'name':_0x4c1e9e[_0x0ea8('0x2f')],'resourceId':_0x4c1e9e['id'],'type':_0x441f95[_0x0ea8('0x2f')],'sectionId':_0x441f95['id']},{})[_0x0ea8('0x28')](function(){return _0x278da8;});}else{return _0x278da8;}})[_0x0ea8('0x4a')](function(_0x20cb82){logger[_0x0ea8('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20cb82);throw _0x20cb82;});}return _0x278da8;})[_0x0ea8('0x28')](respondWithResult(_0x510ab5,0xc9))['catch'](handleError(_0x510ab5,null));};exports['update']=function(_0xd62b32,_0xd0e71e){if(_0xd62b32[_0x0ea8('0x4f')]['id']){delete _0xd62b32['body']['id'];}return db[_0x0ea8('0x33')][_0x0ea8('0x4d')]({'where':{'id':_0xd62b32[_0x0ea8('0x4c')]['id']}})[_0x0ea8('0x28')](handleEntityNotFound(_0xd0e71e,null))[_0x0ea8('0x28')](saveUpdates(_0xd62b32[_0x0ea8('0x4f')],null))[_0x0ea8('0x28')](respondWithResult(_0xd0e71e,null))['catch'](handleError(_0xd0e71e,null));};exports[_0x0ea8('0x2c')]=function(_0x4739fa,_0xe62a1d){return db[_0x0ea8('0x33')][_0x0ea8('0x4d')]({'where':{'id':_0x4739fa['params']['id']}})[_0x0ea8('0x28')](handleEntityNotFound(_0xe62a1d,null))[_0x0ea8('0x28')](removeEntity(_0xe62a1d,null))[_0x0ea8('0x4a')](handleError(_0xe62a1d,null));};exports[_0x0ea8('0x54')]=function(_0x479ca4,_0x340af2){return db['CmList'][_0x0ea8('0x54')]()[_0x0ea8('0x28')](respondWithResult(_0x340af2,null))[_0x0ea8('0x4a')](handleError(_0x340af2,null));};exports[_0x0ea8('0x55')]=function(_0x464de7,_0x316840,_0x9ea1d2){if(_0x464de7[_0x0ea8('0x4f')]['id']){delete _0x464de7[_0x0ea8('0x4f')]['id'];}return db[_0x0ea8('0x33')][_0x0ea8('0x4d')]({'where':{'id':_0x464de7[_0x0ea8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x316840,null))[_0x0ea8('0x28')](function(_0x5ddb02){if(_0x5ddb02){_0x464de7[_0x0ea8('0x4f')][_0x0ea8('0x56')]=_0x5ddb02['id'];return db[_0x0ea8('0x57')][_0x0ea8('0x4e')](_0x464de7[_0x0ea8('0x4f')]);}})['then'](respondWithResult(_0x316840,null))[_0x0ea8('0x4a')](handleError(_0x316840,null));};exports['getDispositions']=function(_0x7efefa,_0x228430,_0xf68e93){var _0x2a76b9={'raw':![],'where':{}};var _0x40b4d8={};var _0x334f56={'count':0x0,'rows':[]};return db['CmList'][_0x0ea8('0x58')]({'where':{'id':_0x7efefa[_0x0ea8('0x4c')]['id']}})[_0x0ea8('0x28')](handleEntityNotFound(_0x228430,null))[_0x0ea8('0x28')](function(_0x3938d6){if(_0x3938d6){_0x40b4d8[_0x0ea8('0x38')]=_[_0x0ea8('0x3a')](db[_0x0ea8('0x57')][_0x0ea8('0x34')]);_0x40b4d8[_0x0ea8('0x39')]=_['keys'](_0x7efefa['query']);_0x40b4d8[_0x0ea8('0x45')]=_[_0x0ea8('0x3b')](_0x40b4d8[_0x0ea8('0x38')],_0x40b4d8['query']);_0x2a76b9[_0x0ea8('0x3c')]=_[_0x0ea8('0x3b')](_0x40b4d8[_0x0ea8('0x38')],qs['fields'](_0x7efefa[_0x0ea8('0x39')]['fields']));_0x2a76b9[_0x0ea8('0x3c')]=_0x2a76b9[_0x0ea8('0x3c')][_0x0ea8('0x59')]?_0x2a76b9[_0x0ea8('0x3c')]:_0x40b4d8[_0x0ea8('0x38')];if(!_0x7efefa['query'][_0x0ea8('0x3e')](_0x0ea8('0x3f'))){_0x2a76b9[_0x0ea8('0x40')]=qs[_0x0ea8('0x40')](_0x7efefa[_0x0ea8('0x39')][_0x0ea8('0x40')]);_0x2a76b9['offset']=qs[_0x0ea8('0x22')](_0x7efefa[_0x0ea8('0x39')][_0x0ea8('0x22')]);}_0x2a76b9[_0x0ea8('0x41')]=qs['sort'](_0x7efefa[_0x0ea8('0x39')]['sort']);_0x2a76b9[_0x0ea8('0x43')]=qs['filters'](_[_0x0ea8('0x44')](_0x7efefa[_0x0ea8('0x39')],_0x40b4d8[_0x0ea8('0x45')]));_0x2a76b9[_0x0ea8('0x43')][_0x0ea8('0x56')]=_0x3938d6['id'];if(_0x7efefa[_0x0ea8('0x39')][_0x0ea8('0x46')]){_0x2a76b9[_0x0ea8('0x43')]=_['merge'](_0x2a76b9[_0x0ea8('0x43')],{'$or':_[_0x0ea8('0x32')](_0x2a76b9[_0x0ea8('0x3c')],function(_0x3288af){var _0x4f6bb9={};_0x4f6bb9[_0x3288af]={'$like':'%'+_0x7efefa[_0x0ea8('0x39')][_0x0ea8('0x46')]+'%'};return _0x4f6bb9;})});}_0x2a76b9=_['merge']({},_0x2a76b9,_0x7efefa[_0x0ea8('0x48')]);return db['Disposition'][_0x0ea8('0x21')]({'where':_0x2a76b9[_0x0ea8('0x43')]})[_0x0ea8('0x28')](function(_0x23028c){_0x334f56['count']=_0x23028c;if(_0x7efefa[_0x0ea8('0x39')][_0x0ea8('0x5a')]){_0x2a76b9['include']=[{'all':!![]}];}return db[_0x0ea8('0x57')]['findAll'](_0x2a76b9);})[_0x0ea8('0x28')](function(_0x13db8b){_0x334f56['rows']=_0x13db8b;return _0x334f56;});}})[_0x0ea8('0x28')](respondWithFilteredResult(_0x228430,_0x2a76b9))['catch'](handleError(_0x228430,null));};exports['removeDispositions']=function(_0x15866b,_0x4e4ba0,_0x1831fd){return db['CmList'][_0x0ea8('0x4d')]({'where':{'id':_0x15866b[_0x0ea8('0x4c')]['id']}})[_0x0ea8('0x28')](handleEntityNotFound(_0x4e4ba0,null))[_0x0ea8('0x28')](function(_0x5b24e1){if(_0x5b24e1){return _0x5b24e1[_0x0ea8('0x5b')](_0x15866b['query'][_0x0ea8('0x5c')]);}})[_0x0ea8('0x28')](respondWithStatusCode(_0x4e4ba0,null))['catch'](handleError(_0x4e4ba0,null));};exports['addContacts']=function(_0x3483f9,_0x1a98bf,_0x547398){return db[_0x0ea8('0x33')][_0x0ea8('0x4d')]({'where':{'id':_0x3483f9[_0x0ea8('0x4c')]['id']}})[_0x0ea8('0x28')](handleEntityNotFound(_0x1a98bf,null))[_0x0ea8('0x28')](function(_0x656ee1){if(_0x656ee1){var _0x599c84=[];var _0xffdd33={'success':[],'errors':[]};return db['CmContact'][_0x0ea8('0x54')]()[_0x0ea8('0x28')](function(_0x4dc25c){if(_0x3483f9[_0x0ea8('0x4f')][_0x0ea8('0x5d')]&&_[_0x0ea8('0x5e')](_0x3483f9[_0x0ea8('0x4f')][_0x0ea8('0x5d')])){if(_0x3483f9[_0x0ea8('0x4f')]['tags'][_0x0ea8('0x59')]){_0x3483f9['body'][_0x0ea8('0x5d')]=_0x3483f9[_0x0ea8('0x4f')]['tags'][_0x0ea8('0x5f')](';')+';';}else{_0x3483f9[_0x0ea8('0x4f')][_0x0ea8('0x5d')]=null;}}else{_0x3483f9[_0x0ea8('0x4f')][_0x0ea8('0x5d')]=null;}if(_0x3483f9[_0x0ea8('0x4f')]&&_[_0x0ea8('0x5e')](_0x3483f9['body'])){for(var _0x49c6e1=0x0;_0x49c6e1<_0x3483f9[_0x0ea8('0x4f')][_0x0ea8('0x59')];_0x49c6e1+=0x1){_0x3483f9[_0x0ea8('0x4f')][_0x49c6e1][_0x0ea8('0x56')]=_0x3483f9[_0x0ea8('0x4c')]['id'];_0x599c84[_0x0ea8('0x60')](_0x3483f9[_0x0ea8('0x4f')][_0x49c6e1]);}return BPromise[_0x0ea8('0x61')](_0x599c84,function(_0x122df8){return db[_0x0ea8('0x62')]['create'](_[_0x0ea8('0x63')](_0x122df8,[_0x0ea8('0x5c'),'id'])||{},{'fields':_[_0x0ea8('0x3a')](_0x4dc25c),'raw':!![]})[_0x0ea8('0x28')](function(_0x3b0803){_0xffdd33[_0x0ea8('0x64')][_0x0ea8('0x60')](_0x3b0803[_0x0ea8('0x65')]);})['catch'](function(_0x521f77){_0xffdd33[_0x0ea8('0x66')][_0x0ea8('0x60')]({'data':_0x122df8,'error':_0x521f77[_0x0ea8('0x67')]});});})[_0x0ea8('0x28')](function(_0x34ae0c){return _0xffdd33;})[_0x0ea8('0x4a')](function(_0x42fd28){return _0x42fd28;});}else{_0x1a98bf[_0x0ea8('0x1d')](0x190)['json']({'message':_0x0ea8('0x68')});}});}})[_0x0ea8('0x28')](respondWithResult(_0x1a98bf,null))[_0x0ea8('0x4a')](handleError(_0x1a98bf,null));};exports[_0x0ea8('0x69')]=function(_0x536d35,_0x3328fd,_0x8c78b2){var _0x3970c2;return db['CmList'][_0x0ea8('0x4d')]({'where':{'id':_0x536d35[_0x0ea8('0x4c')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x3328fd,null))['then'](function(_0x51f513){if(_0x51f513){_0x3970c2=_0x51f513;return db[_0x0ea8('0x62')][_0x0ea8('0x34')];}})[_0x0ea8('0x28')](function(_0x1d767b){if(_0x1d767b){var _0x51541c={};var _0x5ccfbb={};_0x5ccfbb['model']=_[_0x0ea8('0x6a')](_[_0x0ea8('0x3a')](_0x1d767b),_[_0x0ea8('0x32')](_0x3970c2[_0x0ea8('0x6b')],function(_0x20b891){return util[_0x0ea8('0x6c')]('cf_%d',_0x20b891['id']);}));_0x5ccfbb[_0x0ea8('0x39')]=_[_0x0ea8('0x3a')](_0x536d35['query']);_0x5ccfbb[_0x0ea8('0x45')]=_['intersection'](_0x5ccfbb[_0x0ea8('0x38')],_0x5ccfbb[_0x0ea8('0x39')]);_0x51541c[_0x0ea8('0x3c')]=_[_0x0ea8('0x3b')](_0x5ccfbb[_0x0ea8('0x38')],qs[_0x0ea8('0x3d')](_0x536d35['query'][_0x0ea8('0x3d')]));_0x51541c['attributes']=_0x51541c['attributes'][_0x0ea8('0x59')]?_0x51541c[_0x0ea8('0x3c')]:_0x5ccfbb[_0x0ea8('0x38')];if(!_0x536d35['query'][_0x0ea8('0x3e')](_0x0ea8('0x3f'))){_0x51541c[_0x0ea8('0x40')]=qs[_0x0ea8('0x40')](_0x536d35[_0x0ea8('0x39')][_0x0ea8('0x40')]);_0x51541c[_0x0ea8('0x22')]=qs['offset'](_0x536d35[_0x0ea8('0x39')]['offset']);}_0x51541c[_0x0ea8('0x41')]=qs[_0x0ea8('0x42')](_0x536d35[_0x0ea8('0x39')][_0x0ea8('0x42')]);_0x51541c['where']=qs[_0x0ea8('0x45')](_[_0x0ea8('0x44')](_0x536d35[_0x0ea8('0x39')],_0x5ccfbb[_0x0ea8('0x45')]));_0x51541c[_0x0ea8('0x6d')]=!![];if(_0x536d35['query']['filter']){_0x51541c[_0x0ea8('0x43')]=_[_0x0ea8('0x47')](_0x51541c[_0x0ea8('0x43')],{'$or':_[_0x0ea8('0x32')](_0x51541c[_0x0ea8('0x3c')],function(_0x5dfb71){var _0x29a259={};_0x29a259[_0x5dfb71]={'$like':'%'+_0x536d35['query']['filter']+'%'};return _0x29a259;})});}_0x51541c=_['merge']({},_0x51541c,_0x536d35[_0x0ea8('0x48')]);return _0x3970c2[_0x0ea8('0x69')](_0x51541c);}})[_0x0ea8('0x28')](respondWithResult(_0x3328fd,null))['catch'](handleError(_0x3328fd,null));};exports[_0x0ea8('0x6e')]=function(_0x2b7c3f,_0x464891,_0x26c4e9){var _0x29da88;var _0x48f716;var _0x370858;var _0x43cbbf=_0x2b7c3f[_0x0ea8('0x4c')]['id'];csv_results=[];return db['ContactItemType']['findAll']({'attributes':['id',_0x0ea8('0x2f')],'raw':!![],'order':[_0x0ea8('0x6f')]})['then'](function(_0x31e1f5){_0x29da88=_0x31e1f5;var _0x2db8ca=_[_0x0ea8('0x3a')](db[_0x0ea8('0x62')]['rawAttributes']);return db[_0x0ea8('0x70')][_0x0ea8('0x71')]({'raw':!![],'attributes':['id',_0x0ea8('0x72')]})[_0x0ea8('0x28')](function(_0x1b5080){_0x48f716=_0x1b5080;var _0x2bf86a=squel['select']()['fields'](_0x2db8ca)[_0x0ea8('0x73')](_0x0ea8('0x74'),'c')[_0x0ea8('0x43')](_0x0ea8('0x75'),_0x43cbbf)[_0x0ea8('0x43')](_0x0ea8('0x76'))['distinct']();for(var _0xa48499=0x0;_0xa48499<_0x48f716[_0x0ea8('0x59')];_0xa48499++){_0x2bf86a[_0x0ea8('0x77')](_0x0ea8('0x78')+_0x48f716[_0xa48499]['id'],_0x0ea8('0x79')+_0x48f716[_0xa48499]['alias']);}for(var _0xa48499=0x0;_0xa48499<_0x29da88[_0x0ea8('0x59')];_0xa48499++){_0x2bf86a[_0x0ea8('0x77')](squel[_0x0ea8('0x7a')]()[_0x0ea8('0x77')](_0x0ea8('0x7b'))[_0x0ea8('0x73')](_0x0ea8('0x7c'))[_0x0ea8('0x43')](_0x0ea8('0x7d'),_0x29da88[_0xa48499]['id'])['where']('CmContactId\x20=\x20c.id'),_0x0ea8('0x7e')+_0x29da88[_0xa48499]['name']);_0x2bf86a[_0x0ea8('0x77')](squel[_0x0ea8('0x7a')]()[_0x0ea8('0x77')](_0x0ea8('0x7f'))['from']('cm_contact_has_items')[_0x0ea8('0x43')](_0x0ea8('0x7d'),_0x29da88[_0xa48499]['id'])['where'](_0x0ea8('0x80')),_0x0ea8('0x81')+_0x29da88[_0xa48499][_0x0ea8('0x2f')]);}var _0x943591=[];_0x943591[_0x0ea8('0x60')](_0x2bf86a[_0x0ea8('0x82')]());BPromise[_0x0ea8('0x61')](_0x943591,handleQuery)[_0x0ea8('0x28')](function(_0x216656){handleQuery(_0x2bf86a[_0x0ea8('0x82')]());var _0x34d994=csv_results[0x0];if(!_[_0x0ea8('0x83')](_0x34d994)){var _0x1fa5c5=toCsv(_0x34d994);var _0x397a96=Date[_0x0ea8('0x84')]();fs['writeFileSync'](util['format'](_0x0ea8('0x85'),_0x43cbbf,_0x397a96),_0x1fa5c5);_0x464891[_0x0ea8('0x86')](_0x0ea8('0x87'),_0x0ea8('0x88')+util[_0x0ea8('0x6c')](_0x0ea8('0x89'),_0x43cbbf,_0x397a96));_0x464891['setHeader']('Content-type','text/csv');return _0x464891[_0x0ea8('0x8a')](util['format']('/tmp/list_%d_%s.csv',_0x43cbbf,_0x397a96));}else{return _0x464891[_0x0ea8('0x1c')](0xcc);}});});});};exports['addCustomField']=function(_0x2f7b5a,_0x37e93b,_0x5d94d4){var _0x239836;delete _0x2f7b5a[_0x0ea8('0x4f')]['id'];return db[_0x0ea8('0x33')]['findOne']({'where':{'id':_0x2f7b5a['params']['id']}})[_0x0ea8('0x28')](handleEntityNotFound(_0x37e93b,null))[_0x0ea8('0x28')](function(_0x4c9859){if(_0x4c9859){return db[_0x0ea8('0x8b')][_0x0ea8('0x8c')](function(_0x169e77){return db['CmCustomField'][_0x0ea8('0x4e')](_0x2f7b5a[_0x0ea8('0x4f')],{'transaction':_0x169e77})[_0x0ea8('0x28')](function(_0x2b7164){_0x239836=_0x2b7164;return _0x4c9859[_0x0ea8('0x8d')](_0x2b7164,{'transaction':_0x169e77});})['then'](function(){var _0xbace6e={'type':db['Sequelize'][_0x0ea8('0x8e')],'transaction':_0x169e77};switch(_0x2f7b5a[_0x0ea8('0x4f')][_0x0ea8('0x36')]){case _0x0ea8('0x8f'):_0xbace6e[_0x0ea8('0x36')]=db[_0x0ea8('0x90')][_0x0ea8('0x8e')];break;case _0x0ea8('0x91'):_0xbace6e[_0x0ea8('0x36')]=db[_0x0ea8('0x90')][_0x0ea8('0x92')];break;case _0x0ea8('0x93'):_0xbace6e[_0x0ea8('0x36')]=db[_0x0ea8('0x90')][_0x0ea8('0x94')];_0xbace6e[_0x0ea8('0x95')]=![];break;default:}return db[_0x0ea8('0x8b')][_0x0ea8('0x96')][_0x0ea8('0x97')](_0x0ea8('0x74'),util[_0x0ea8('0x6c')](_0x0ea8('0x98'),_0x239836['id']),_0xbace6e);})[_0x0ea8('0x28')](function(){return _0x239836;});});}})[_0x0ea8('0x28')](respondWithResult(_0x37e93b,null))[_0x0ea8('0x4a')](handleError(_0x37e93b,null));};exports[_0x0ea8('0x99')]=function(_0x20fd5e,_0x4c51d7,_0x1cdfe2){var _0x3e0cbd={};var _0x224604={};var _0x3f90d9;var _0x312f3f;return db[_0x0ea8('0x33')][_0x0ea8('0x58')]({'where':{'id':_0x20fd5e[_0x0ea8('0x4c')]['id']}})[_0x0ea8('0x28')](handleEntityNotFound(_0x4c51d7,null))[_0x0ea8('0x28')](function(_0x52724c){if(_0x52724c){_0x3f90d9=_0x52724c;_0x224604['model']=_['keys'](db[_0x0ea8('0x70')]['rawAttributes']);_0x224604[_0x0ea8('0x39')]=_[_0x0ea8('0x3a')](_0x20fd5e[_0x0ea8('0x39')]);_0x224604['filters']=_[_0x0ea8('0x3b')](_0x224604[_0x0ea8('0x38')],_0x224604[_0x0ea8('0x39')]);_0x3e0cbd['attributes']=_[_0x0ea8('0x3b')](_0x224604['model'],qs['fields'](_0x20fd5e['query']['fields']));_0x3e0cbd[_0x0ea8('0x3c')]=_0x3e0cbd[_0x0ea8('0x3c')][_0x0ea8('0x59')]?_0x3e0cbd[_0x0ea8('0x3c')]:_0x224604[_0x0ea8('0x38')];_0x3e0cbd['order']=qs['sort'](_0x20fd5e[_0x0ea8('0x39')][_0x0ea8('0x42')]);_0x3e0cbd[_0x0ea8('0x43')]=qs['filters'](_[_0x0ea8('0x44')](_0x20fd5e[_0x0ea8('0x39')],_0x224604[_0x0ea8('0x45')]));_0x3e0cbd[_0x0ea8('0x43')]=_[_0x0ea8('0x47')](_0x3e0cbd[_0x0ea8('0x43')],{'$or':[{'ListId':_0x52724c['id']},{'ListId':null}]});if(_0x20fd5e[_0x0ea8('0x39')][_0x0ea8('0x46')]){_0x3e0cbd['where']=_[_0x0ea8('0x47')](_0x3e0cbd['where'],{'$or':_['map'](_0x3e0cbd[_0x0ea8('0x3c')],function(_0x7d1867){var _0xc9e48d={};_0xc9e48d[_0x7d1867]={'$like':'%'+_0x20fd5e[_0x0ea8('0x39')][_0x0ea8('0x46')]+'%'};return _0xc9e48d;})});}_0x3e0cbd=_[_0x0ea8('0x47')]({},_0x3e0cbd,_0x20fd5e[_0x0ea8('0x48')]);return db['CmCustomField'][_0x0ea8('0x9a')](_0x3e0cbd);}})[_0x0ea8('0x28')](respondWithResult(_0x4c51d7,null))[_0x0ea8('0x4a')](handleError(_0x4c51d7,null));};exports['getGlobalCustomFields']=function(_0x551237,_0x31be20){return db['CmCustomField'][_0x0ea8('0x9a')]({'where':{'ListId':null}})[_0x0ea8('0x28')](handleEntityNotFound(_0x31be20,null))[_0x0ea8('0x28')](function(_0x40ddf8){return _0x40ddf8;})['then'](respondWithResult(_0x31be20,null))[_0x0ea8('0x4a')](handleError(_0x31be20,null));};exports['addAgents']=function(_0x2674d1,_0x1485ce,_0x414acc){return db[_0x0ea8('0x33')]['find']({'where':{'id':_0x2674d1[_0x0ea8('0x4c')]['id']}})[_0x0ea8('0x28')](handleEntityNotFound(_0x1485ce,null))[_0x0ea8('0x28')](function(_0x59d392){if(_0x59d392){return _0x59d392[_0x0ea8('0x9b')](_0x2674d1[_0x0ea8('0x4f')][_0x0ea8('0x5c')],_[_0x0ea8('0x63')](_0x2674d1[_0x0ea8('0x4f')],[_0x0ea8('0x5c'),'id'])||{})[_0x0ea8('0x9c')](function(_0x46523e){for(var _0x2d56f1=0x0;_0x2d56f1<_0x2674d1[_0x0ea8('0x4f')][_0x0ea8('0x5c')][_0x0ea8('0x59')];_0x2d56f1+=0x1){socket[_0x0ea8('0x9d')]('userCmList:save',{'UserId':Number(_0x2674d1[_0x0ea8('0x4f')][_0x0ea8('0x5c')][_0x2d56f1]),'CmListId':Number(_0x2674d1[_0x0ea8('0x4c')]['id'])});}return _0x46523e;});}})['then'](respondWithResult(_0x1485ce,null))['catch'](handleError(_0x1485ce,null));};exports[_0x0ea8('0x9e')]=function(_0x464532,_0x5870af,_0x8e24b7){return db[_0x0ea8('0x33')]['find']({'where':{'id':_0x464532[_0x0ea8('0x4c')]['id']}})[_0x0ea8('0x28')](handleEntityNotFound(_0x5870af,null))['then'](function(_0x581a8c){if(_0x581a8c){return _0x581a8c['removeAgents'](_0x464532[_0x0ea8('0x39')][_0x0ea8('0x5c')])[_0x0ea8('0x28')](function(){if(_['isArray'](_0x464532[_0x0ea8('0x39')][_0x0ea8('0x5c')])){for(var _0x469170=0x0;_0x469170<_0x464532['query'][_0x0ea8('0x5c')][_0x0ea8('0x59')];_0x469170+=0x1){socket[_0x0ea8('0x9d')](_0x0ea8('0x9f'),{'UserId':Number(_0x464532['query'][_0x0ea8('0x5c')][_0x469170]),'CmListId':Number(_0x464532[_0x0ea8('0x4c')]['id'])});}}else{socket[_0x0ea8('0x9d')]('userCmList:remove',{'UserId':Number(_0x464532['query']['ids']),'CmListId':Number(_0x464532[_0x0ea8('0x4c')]['id'])});}});}})[_0x0ea8('0x28')](respondWithStatusCode(_0x5870af,null))[_0x0ea8('0x4a')](handleError(_0x5870af,null));};exports[_0x0ea8('0xa0')]=function(_0x450256,_0x2c3dd8,_0x411800){var _0x48b259={};var _0x42f0d5={};var _0x3ecc70;var _0x335465;return db['CmList'][_0x0ea8('0x58')]({'where':{'id':_0x450256[_0x0ea8('0x4c')]['id']}})[_0x0ea8('0x28')](handleEntityNotFound(_0x2c3dd8,null))[_0x0ea8('0x28')](function(_0x110c02){if(_0x110c02){_0x3ecc70=_0x110c02;_0x42f0d5[_0x0ea8('0x38')]=_['keys'](db[_0x0ea8('0xa1')][_0x0ea8('0x34')]);_0x42f0d5['query']=_[_0x0ea8('0x3a')](_0x450256[_0x0ea8('0x39')]);_0x42f0d5[_0x0ea8('0x45')]=_[_0x0ea8('0x3b')](_0x42f0d5[_0x0ea8('0x38')],_0x42f0d5[_0x0ea8('0x39')]);_0x48b259[_0x0ea8('0x3c')]=_[_0x0ea8('0x3b')](_0x42f0d5[_0x0ea8('0x38')],qs[_0x0ea8('0x3d')](_0x450256[_0x0ea8('0x39')][_0x0ea8('0x3d')]));_0x48b259['attributes']=_0x48b259[_0x0ea8('0x3c')][_0x0ea8('0x59')]?_0x48b259[_0x0ea8('0x3c')]:_0x42f0d5[_0x0ea8('0x38')];_0x48b259[_0x0ea8('0x41')]=qs['sort'](_0x450256[_0x0ea8('0x39')][_0x0ea8('0x42')]);_0x48b259[_0x0ea8('0x43')]=qs[_0x0ea8('0x45')](_[_0x0ea8('0x44')](_0x450256['query'],_0x42f0d5[_0x0ea8('0x45')]));if(_0x450256[_0x0ea8('0x39')][_0x0ea8('0x46')]){_0x48b259['where']=_[_0x0ea8('0x47')](_0x48b259[_0x0ea8('0x43')],{'$or':_['map'](_0x48b259[_0x0ea8('0x3c')],function(_0xdeb4a3){var _0x187391={};_0x187391[_0xdeb4a3]={'$like':'%'+_0x450256['query'][_0x0ea8('0x46')]+'%'};return _0x187391;})});}_0x48b259=_[_0x0ea8('0x47')]({},_0x48b259,_0x450256[_0x0ea8('0x48')]);return _0x3ecc70['getAgents'](_0x48b259);}})[_0x0ea8('0x28')](function(_0x290028){if(_0x290028){_0x335465=_0x290028['length'];if(!_0x450256[_0x0ea8('0x39')]['hasOwnProperty'](_0x0ea8('0x3f'))){_0x48b259[_0x0ea8('0x40')]=qs['limit'](_0x450256['query'][_0x0ea8('0x40')]);_0x48b259[_0x0ea8('0x22')]=qs[_0x0ea8('0x22')](_0x450256[_0x0ea8('0x39')][_0x0ea8('0x22')]);}return _0x3ecc70[_0x0ea8('0xa0')](_0x48b259);}})['then'](function(_0x1fc6b3){if(_0x1fc6b3){return _0x1fc6b3?{'count':_0x335465,'rows':_0x1fc6b3}:null;}})['then'](respondWithResult(_0x2c3dd8,null))['catch'](handleError(_0x2c3dd8,null));};function handleQuery(_0x3b5036){logger[_0x0ea8('0xa2')](_0x3b5036);return db[_0x0ea8('0x8b')][_0x0ea8('0x39')](_0x3b5036)['spread'](function(_0x29ade7){csv_results[_0x0ea8('0x60')](_0x29ade7);})['catch'](function(_0x127839){logger[_0x0ea8('0x2d')](_0x127839[_0x0ea8('0x67')]);});} \ No newline at end of file +var _0xaa72=['map','type','VIRTUAL','options','CmList','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','getDispositions','pick','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','CustomFields','concat','cf_%d','raw','getContacts','getContactsCsv','alias','select','cm_contacts','c.deletedAt\x20is\x20null','distinct','field','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description','description_additionalPhone_','toString','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','addCustomField','findOne','sequelize','addCustomFields','Sequelize','text','number','switch','defaultValue','queryInterface','cf_%s','getCustomFields','CmCustomField','findAndCountAll','getGlobalCustomFields','spread','emit','userCmList:remove','User','getAgents','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','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','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','get','Lists','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge'];(function(_0x487d0a,_0x1b7cb4){var _0x3d740c=function(_0xa714f2){while(--_0xa714f2){_0x487d0a['push'](_0x487d0a['shift']());}};_0x3d740c(++_0x1b7cb4);}(_0xaa72,0x101));var _0x2aa7=function(_0x21f881,_0x29c8d6){_0x21f881=_0x21f881-0x0;var _0xddb7a1=_0xaa72[_0x21f881];return _0xddb7a1;};'use strict';var emlformat=require(_0x2aa7('0x0'));var rimraf=require(_0x2aa7('0x1'));var zipdir=require(_0x2aa7('0x2'));var jsonpatch=require(_0x2aa7('0x3'));var rp=require(_0x2aa7('0x4'));var moment=require(_0x2aa7('0x5'));var BPromise=require(_0x2aa7('0x6'));var Mustache=require('mustache');var util=require(_0x2aa7('0x7'));var path=require(_0x2aa7('0x8'));var sox=require(_0x2aa7('0x9'));var csv=require(_0x2aa7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2aa7('0xb'));var _=require(_0x2aa7('0xc'));var squel=require(_0x2aa7('0xd'));var crypto=require(_0x2aa7('0xe'));var jsforce=require(_0x2aa7('0xf'));var deskjs=require(_0x2aa7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2aa7('0x11'));var Papa=require(_0x2aa7('0x12'));var Redis=require(_0x2aa7('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2aa7('0x14'));var as=require(_0x2aa7('0x15'));var hardwareService=require(_0x2aa7('0x16'));var logger=require('../../config/logger')(_0x2aa7('0x17'));var utils=require(_0x2aa7('0x18'));var config=require(_0x2aa7('0x19'));var licenseUtil=require(_0x2aa7('0x1a'));var db=require(_0x2aa7('0x1b'))['db'];var csv_results;config[_0x2aa7('0x1c')]=_[_0x2aa7('0x1d')](config[_0x2aa7('0x1c')],{'host':_0x2aa7('0x1e'),'port':0x18eb});var socket=require(_0x2aa7('0x1f'))(new Redis(config[_0x2aa7('0x1c')]));require(_0x2aa7('0x20'))[_0x2aa7('0x21')](socket);function respondWithStatusCode(_0x3254af,_0x3bd574){_0x3bd574=_0x3bd574||0xcc;return function(_0x543b7f){if(_0x543b7f){return _0x3254af[_0x2aa7('0x22')](_0x3bd574);}return _0x3254af[_0x2aa7('0x23')](_0x3bd574)[_0x2aa7('0x24')]();};}function respondWithResult(_0x5f0578,_0x19885a){_0x19885a=_0x19885a||0xc8;return function(_0x3d4e8a){if(_0x3d4e8a){return _0x5f0578[_0x2aa7('0x23')](_0x19885a)[_0x2aa7('0x25')](_0x3d4e8a);}};}function respondWithFilteredResult(_0x432bf5,_0x2658d9){return function(_0x2b5a50){if(_0x2b5a50){var _0x327145=typeof _0x2658d9[_0x2aa7('0x26')]===_0x2aa7('0x27')&&typeof _0x2658d9['limit']===_0x2aa7('0x27');var _0x179e01=_0x2b5a50[_0x2aa7('0x28')];var _0x543eed=_0x327145?0x0:_0x2658d9['offset'];var _0xf1b2e1=_0x327145?_0x2b5a50[_0x2aa7('0x28')]:_0x2658d9['offset']+_0x2658d9['limit'];var _0xd97074;if(_0xf1b2e1>=_0x179e01){_0xf1b2e1=_0x179e01;_0xd97074=0xc8;}else{_0xd97074=0xce;}_0x432bf5['status'](_0xd97074);return _0x432bf5['set'](_0x2aa7('0x29'),_0x543eed+'-'+_0xf1b2e1+'/'+_0x179e01)[_0x2aa7('0x25')](_0x2b5a50);}return null;};}function patchUpdates(_0x35cc3f){return function(_0x377ffe){try{jsonpatch[_0x2aa7('0x2a')](_0x377ffe,_0x35cc3f,!![]);}catch(_0xc678f9){return BPromise[_0x2aa7('0x2b')](_0xc678f9);}return _0x377ffe[_0x2aa7('0x2c')]();};}function saveUpdates(_0x2e87c4,_0x3004db){return function(_0x24e365){if(_0x24e365){return _0x24e365['update'](_0x2e87c4)[_0x2aa7('0x2d')](function(_0x40fb9d){return _0x40fb9d;});}return null;};}function removeEntity(_0x1f48f4,_0x33ff23){return function(_0x26016c){if(_0x26016c){return _0x26016c[_0x2aa7('0x2e')]()[_0x2aa7('0x2d')](function(){var _0x1e546c=_0x26016c[_0x2aa7('0x2f')]({'plain':!![]});var _0x9882d5=_0x2aa7('0x30');return db['UserProfileResource'][_0x2aa7('0x2e')]({'where':{'type':_0x9882d5,'resourceId':_0x1e546c['id']}})['then'](function(){return _0x26016c;});})['then'](function(){_0x1f48f4[_0x2aa7('0x23')](0xcc)[_0x2aa7('0x24')]();});}};}function handleEntityNotFound(_0x5098dd,_0x9d9b26){return function(_0x5c47a0){if(!_0x5c47a0){_0x5098dd[_0x2aa7('0x22')](0x194);}return _0x5c47a0;};}function handleError(_0x299950,_0x23e892){_0x23e892=_0x23e892||0x1f4;return function(_0x443330){logger[_0x2aa7('0x31')](_0x443330[_0x2aa7('0x32')]);if(_0x443330[_0x2aa7('0x33')]){delete _0x443330[_0x2aa7('0x33')];}_0x299950[_0x2aa7('0x23')](_0x23e892)[_0x2aa7('0x34')](_0x443330);};}exports[_0x2aa7('0x35')]=function(_0x689138,_0xe4df22){var _0x2f02c6={},_0xe0edc4={},_0x23a5b6={'count':0x0,'rows':[]};var _0x3a4fed=_['map'](db['CmList'][_0x2aa7('0x36')],function(_0x32546b){return{'name':_0x32546b['fieldName'],'type':_0x32546b['type']['key']};});_0xe0edc4[_0x2aa7('0x37')]=_['map'](_0x3a4fed,'name');_0xe0edc4[_0x2aa7('0x38')]=_[_0x2aa7('0x39')](_0x689138[_0x2aa7('0x38')]);_0xe0edc4[_0x2aa7('0x3a')]=_[_0x2aa7('0x3b')](_0xe0edc4[_0x2aa7('0x37')],_0xe0edc4[_0x2aa7('0x38')]);_0x2f02c6[_0x2aa7('0x3c')]=_[_0x2aa7('0x3b')](_0xe0edc4['model'],qs[_0x2aa7('0x3d')](_0x689138[_0x2aa7('0x38')]['fields']));_0x2f02c6['attributes']=_0x2f02c6['attributes'][_0x2aa7('0x3e')]?_0x2f02c6[_0x2aa7('0x3c')]:_0xe0edc4['model'];if(!_0x689138[_0x2aa7('0x38')][_0x2aa7('0x3f')](_0x2aa7('0x40'))){_0x2f02c6[_0x2aa7('0x41')]=qs[_0x2aa7('0x41')](_0x689138[_0x2aa7('0x38')]['limit']);_0x2f02c6[_0x2aa7('0x26')]=qs[_0x2aa7('0x26')](_0x689138[_0x2aa7('0x38')]['offset']);}_0x2f02c6[_0x2aa7('0x42')]=qs[_0x2aa7('0x43')](_0x689138[_0x2aa7('0x38')]['sort']);_0x2f02c6[_0x2aa7('0x44')]=qs[_0x2aa7('0x3a')](_['pick'](_0x689138[_0x2aa7('0x38')],_0xe0edc4[_0x2aa7('0x3a')]),_0x3a4fed);if(_0x689138[_0x2aa7('0x38')][_0x2aa7('0x45')]){_0x2f02c6[_0x2aa7('0x44')]=_[_0x2aa7('0x46')](_0x2f02c6[_0x2aa7('0x44')],{'$or':_[_0x2aa7('0x47')](_0x3a4fed,function(_0xbcb15e){if(_0xbcb15e[_0x2aa7('0x48')]!==_0x2aa7('0x49')){var _0x5df2bc={};_0x5df2bc[_0xbcb15e['name']]={'$like':'%'+_0x689138[_0x2aa7('0x38')][_0x2aa7('0x45')]+'%'};return _0x5df2bc;}})});}_0x2f02c6=_[_0x2aa7('0x46')]({},_0x2f02c6,_0x689138[_0x2aa7('0x4a')]);var _0x482ad7={'where':_0x2f02c6[_0x2aa7('0x44')]};return db[_0x2aa7('0x4b')][_0x2aa7('0x28')](_0x482ad7)[_0x2aa7('0x2d')](function(_0x1f5d91){_0x23a5b6['count']=_0x1f5d91;if(_0x689138['query'][_0x2aa7('0x4c')]){_0x2f02c6[_0x2aa7('0x4d')]=[{'all':!![]}];}return db[_0x2aa7('0x4b')][_0x2aa7('0x4e')](_0x2f02c6);})[_0x2aa7('0x2d')](function(_0x3c581b){_0x23a5b6[_0x2aa7('0x4f')]=_0x3c581b;return _0x23a5b6;})[_0x2aa7('0x2d')](respondWithFilteredResult(_0xe4df22,_0x2f02c6))[_0x2aa7('0x50')](handleError(_0xe4df22,null));};exports[_0x2aa7('0x51')]=function(_0x360488,_0x409703){var _0x1900c9={'raw':![],'where':{'id':_0x360488[_0x2aa7('0x52')]['id']}},_0x5bbd12={};_0x5bbd12['model']=_[_0x2aa7('0x39')](db[_0x2aa7('0x4b')][_0x2aa7('0x36')]);_0x5bbd12[_0x2aa7('0x38')]=_[_0x2aa7('0x39')](_0x360488[_0x2aa7('0x38')]);_0x5bbd12[_0x2aa7('0x3a')]=_['intersection'](_0x5bbd12[_0x2aa7('0x37')],_0x5bbd12['query']);_0x1900c9[_0x2aa7('0x3c')]=_[_0x2aa7('0x3b')](_0x5bbd12['model'],qs['fields'](_0x360488['query']['fields']));_0x1900c9[_0x2aa7('0x3c')]=_0x1900c9[_0x2aa7('0x3c')][_0x2aa7('0x3e')]?_0x1900c9[_0x2aa7('0x3c')]:_0x5bbd12[_0x2aa7('0x37')];if(_0x360488[_0x2aa7('0x38')][_0x2aa7('0x4c')]){_0x1900c9[_0x2aa7('0x4d')]=[{'all':!![]}];}_0x1900c9=_[_0x2aa7('0x46')]({},_0x1900c9,_0x360488[_0x2aa7('0x4a')]);return db[_0x2aa7('0x4b')]['find'](_0x1900c9)[_0x2aa7('0x2d')](handleEntityNotFound(_0x409703,null))[_0x2aa7('0x2d')](respondWithResult(_0x409703,null))[_0x2aa7('0x50')](handleError(_0x409703,null));};exports[_0x2aa7('0x53')]=function(_0xefa9a6,_0xc0d0e0){return db[_0x2aa7('0x4b')][_0x2aa7('0x53')](_0xefa9a6[_0x2aa7('0x54')],{})[_0x2aa7('0x2d')](function(_0x319213){var _0x2e59fa=_0xefa9a6[_0x2aa7('0x55')]['get']({'plain':!![]});if(!_0x2e59fa)throw new Error(_0x2aa7('0x56'));if(_0x2e59fa[_0x2aa7('0x57')]===_0x2aa7('0x55')){var _0x2221de=_0x319213[_0x2aa7('0x2f')]({'plain':!![]});var _0x4b55b1=_0x2aa7('0x30');return db[_0x2aa7('0x58')][_0x2aa7('0x59')]({'where':{'name':_0x4b55b1,'userProfileId':_0x2e59fa[_0x2aa7('0x5a')]},'raw':!![]})[_0x2aa7('0x2d')](function(_0x251bd7){if(_0x251bd7&&_0x251bd7[_0x2aa7('0x5b')]===0x0){return db[_0x2aa7('0x5c')][_0x2aa7('0x53')]({'name':_0x2221de['name'],'resourceId':_0x2221de['id'],'type':_0x251bd7['name'],'sectionId':_0x251bd7['id']},{})[_0x2aa7('0x2d')](function(){return _0x319213;});}else{return _0x319213;}})['catch'](function(_0x484e75){logger[_0x2aa7('0x31')](_0x2aa7('0x5d'),_0x484e75);throw _0x484e75;});}return _0x319213;})['then'](respondWithResult(_0xc0d0e0,0xc9))[_0x2aa7('0x50')](handleError(_0xc0d0e0,null));};exports[_0x2aa7('0x5e')]=function(_0x287743,_0x21874a){if(_0x287743[_0x2aa7('0x54')]['id']){delete _0x287743[_0x2aa7('0x54')]['id'];}return db[_0x2aa7('0x4b')][_0x2aa7('0x59')]({'where':{'id':_0x287743[_0x2aa7('0x52')]['id']}})[_0x2aa7('0x2d')](handleEntityNotFound(_0x21874a,null))[_0x2aa7('0x2d')](saveUpdates(_0x287743['body'],null))[_0x2aa7('0x2d')](respondWithResult(_0x21874a,null))['catch'](handleError(_0x21874a,null));};exports[_0x2aa7('0x2e')]=function(_0x26321d,_0x24aab3){return db['CmList']['find']({'where':{'id':_0x26321d[_0x2aa7('0x52')]['id']}})[_0x2aa7('0x2d')](handleEntityNotFound(_0x24aab3,null))[_0x2aa7('0x2d')](removeEntity(_0x24aab3,null))[_0x2aa7('0x50')](handleError(_0x24aab3,null));};exports[_0x2aa7('0x5f')]=function(_0xcd6765,_0x45a813){return db['CmList'][_0x2aa7('0x5f')]()[_0x2aa7('0x2d')](respondWithResult(_0x45a813,null))[_0x2aa7('0x50')](handleError(_0x45a813,null));};exports[_0x2aa7('0x60')]=function(_0x1c885a,_0x46c036,_0x9cd02c){if(_0x1c885a['body']['id']){delete _0x1c885a[_0x2aa7('0x54')]['id'];}return db[_0x2aa7('0x4b')]['find']({'where':{'id':_0x1c885a[_0x2aa7('0x52')]['id']}})[_0x2aa7('0x2d')](handleEntityNotFound(_0x46c036,null))[_0x2aa7('0x2d')](function(_0x3b5f32){if(_0x3b5f32){_0x1c885a[_0x2aa7('0x54')][_0x2aa7('0x61')]=_0x3b5f32['id'];return db[_0x2aa7('0x62')]['create'](_0x1c885a[_0x2aa7('0x54')]);}})[_0x2aa7('0x2d')](respondWithResult(_0x46c036,null))[_0x2aa7('0x50')](handleError(_0x46c036,null));};exports[_0x2aa7('0x63')]=function(_0x59cc7c,_0x1de175,_0x55fb59){var _0x927d0b={'raw':![],'where':{}};var _0x5cb681={};var _0x20d78e={'count':0x0,'rows':[]};return db[_0x2aa7('0x4b')]['findOne']({'where':{'id':_0x59cc7c[_0x2aa7('0x52')]['id']}})[_0x2aa7('0x2d')](handleEntityNotFound(_0x1de175,null))[_0x2aa7('0x2d')](function(_0x4cd648){if(_0x4cd648){_0x5cb681[_0x2aa7('0x37')]=_['keys'](db[_0x2aa7('0x62')]['rawAttributes']);_0x5cb681[_0x2aa7('0x38')]=_[_0x2aa7('0x39')](_0x59cc7c[_0x2aa7('0x38')]);_0x5cb681[_0x2aa7('0x3a')]=_[_0x2aa7('0x3b')](_0x5cb681[_0x2aa7('0x37')],_0x5cb681['query']);_0x927d0b['attributes']=_[_0x2aa7('0x3b')](_0x5cb681[_0x2aa7('0x37')],qs[_0x2aa7('0x3d')](_0x59cc7c[_0x2aa7('0x38')][_0x2aa7('0x3d')]));_0x927d0b[_0x2aa7('0x3c')]=_0x927d0b['attributes'][_0x2aa7('0x3e')]?_0x927d0b[_0x2aa7('0x3c')]:_0x5cb681[_0x2aa7('0x37')];if(!_0x59cc7c['query'][_0x2aa7('0x3f')](_0x2aa7('0x40'))){_0x927d0b[_0x2aa7('0x41')]=qs[_0x2aa7('0x41')](_0x59cc7c[_0x2aa7('0x38')][_0x2aa7('0x41')]);_0x927d0b[_0x2aa7('0x26')]=qs[_0x2aa7('0x26')](_0x59cc7c['query'][_0x2aa7('0x26')]);}_0x927d0b[_0x2aa7('0x42')]=qs[_0x2aa7('0x43')](_0x59cc7c[_0x2aa7('0x38')]['sort']);_0x927d0b[_0x2aa7('0x44')]=qs[_0x2aa7('0x3a')](_[_0x2aa7('0x64')](_0x59cc7c['query'],_0x5cb681[_0x2aa7('0x3a')]));_0x927d0b[_0x2aa7('0x44')][_0x2aa7('0x61')]=_0x4cd648['id'];if(_0x59cc7c[_0x2aa7('0x38')][_0x2aa7('0x45')]){_0x927d0b[_0x2aa7('0x44')]=_['merge'](_0x927d0b['where'],{'$or':_[_0x2aa7('0x47')](_0x927d0b[_0x2aa7('0x3c')],function(_0x82b44e){var _0x354874={};_0x354874[_0x82b44e]={'$like':'%'+_0x59cc7c[_0x2aa7('0x38')][_0x2aa7('0x45')]+'%'};return _0x354874;})});}_0x927d0b=_['merge']({},_0x927d0b,_0x59cc7c['options']);return db[_0x2aa7('0x62')]['count']({'where':_0x927d0b['where']})[_0x2aa7('0x2d')](function(_0x2a93f7){_0x20d78e[_0x2aa7('0x28')]=_0x2a93f7;if(_0x59cc7c[_0x2aa7('0x38')][_0x2aa7('0x4c')]){_0x927d0b[_0x2aa7('0x4d')]=[{'all':!![]}];}return db[_0x2aa7('0x62')]['findAll'](_0x927d0b);})[_0x2aa7('0x2d')](function(_0x1ded1f){_0x20d78e[_0x2aa7('0x4f')]=_0x1ded1f;return _0x20d78e;});}})[_0x2aa7('0x2d')](respondWithFilteredResult(_0x1de175,_0x927d0b))['catch'](handleError(_0x1de175,null));};exports[_0x2aa7('0x65')]=function(_0x44926,_0x2e9e79,_0x38008d){return db[_0x2aa7('0x4b')][_0x2aa7('0x59')]({'where':{'id':_0x44926[_0x2aa7('0x52')]['id']}})[_0x2aa7('0x2d')](handleEntityNotFound(_0x2e9e79,null))[_0x2aa7('0x2d')](function(_0x4ef355){if(_0x4ef355){return _0x4ef355[_0x2aa7('0x65')](_0x44926[_0x2aa7('0x38')][_0x2aa7('0x66')]);}})['then'](respondWithStatusCode(_0x2e9e79,null))[_0x2aa7('0x50')](handleError(_0x2e9e79,null));};exports[_0x2aa7('0x67')]=function(_0x3a7ea0,_0x5ce978,_0x1be6be){return db[_0x2aa7('0x4b')][_0x2aa7('0x59')]({'where':{'id':_0x3a7ea0['params']['id']}})[_0x2aa7('0x2d')](handleEntityNotFound(_0x5ce978,null))[_0x2aa7('0x2d')](function(_0x502da1){if(_0x502da1){var _0x55d201=[];var _0xd26f06={'success':[],'errors':[]};return db[_0x2aa7('0x68')][_0x2aa7('0x5f')]()['then'](function(_0x4fed8c){if(_0x3a7ea0[_0x2aa7('0x54')][_0x2aa7('0x69')]&&_[_0x2aa7('0x6a')](_0x3a7ea0[_0x2aa7('0x54')][_0x2aa7('0x69')])){if(_0x3a7ea0['body'][_0x2aa7('0x69')][_0x2aa7('0x3e')]){_0x3a7ea0[_0x2aa7('0x54')][_0x2aa7('0x69')]=_0x3a7ea0[_0x2aa7('0x54')][_0x2aa7('0x69')]['join'](';')+';';}else{_0x3a7ea0['body'][_0x2aa7('0x69')]=null;}}else{_0x3a7ea0[_0x2aa7('0x54')][_0x2aa7('0x69')]=null;}if(_0x3a7ea0[_0x2aa7('0x54')]&&_[_0x2aa7('0x6a')](_0x3a7ea0[_0x2aa7('0x54')])){for(var _0x1e2886=0x0;_0x1e2886<_0x3a7ea0[_0x2aa7('0x54')][_0x2aa7('0x3e')];_0x1e2886+=0x1){_0x3a7ea0['body'][_0x1e2886][_0x2aa7('0x61')]=_0x3a7ea0[_0x2aa7('0x52')]['id'];_0x55d201[_0x2aa7('0x6b')](_0x3a7ea0['body'][_0x1e2886]);}return BPromise[_0x2aa7('0x6c')](_0x55d201,function(_0x4215de){return db['CmContact'][_0x2aa7('0x53')](_[_0x2aa7('0x6d')](_0x4215de,['ids','id'])||{},{'fields':_[_0x2aa7('0x39')](_0x4fed8c),'raw':!![]})['then'](function(_0x2fd09a){_0xd26f06[_0x2aa7('0x6e')][_0x2aa7('0x6b')](_0x2fd09a[_0x2aa7('0x6f')]);})[_0x2aa7('0x50')](function(_0x26d05){_0xd26f06[_0x2aa7('0x70')][_0x2aa7('0x6b')]({'data':_0x4215de,'error':_0x26d05['message']});});})[_0x2aa7('0x2d')](function(_0x14cf0f){return _0xd26f06;})['catch'](function(_0x1ad4fb){return _0x1ad4fb;});}else{_0x5ce978[_0x2aa7('0x23')](0x190)['json']({'message':_0x2aa7('0x71')});}});}})[_0x2aa7('0x2d')](respondWithResult(_0x5ce978,null))['catch'](handleError(_0x5ce978,null));};exports['getContacts']=function(_0x4fef98,_0x1686cd,_0x3e5888){var _0x7ff54f;return db[_0x2aa7('0x4b')]['find']({'where':{'id':_0x4fef98['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x2aa7('0x72')}]})[_0x2aa7('0x2d')](handleEntityNotFound(_0x1686cd,null))[_0x2aa7('0x2d')](function(_0x4f20b2){if(_0x4f20b2){_0x7ff54f=_0x4f20b2;return db[_0x2aa7('0x68')]['rawAttributes'];}})[_0x2aa7('0x2d')](function(_0x292226){if(_0x292226){var _0x4ca096={};var _0x14d9ad={};_0x14d9ad[_0x2aa7('0x37')]=_[_0x2aa7('0x73')](_[_0x2aa7('0x39')](_0x292226),_['map'](_0x7ff54f[_0x2aa7('0x72')],function(_0x373746){return util['format'](_0x2aa7('0x74'),_0x373746['id']);}));_0x14d9ad[_0x2aa7('0x38')]=_[_0x2aa7('0x39')](_0x4fef98[_0x2aa7('0x38')]);_0x14d9ad[_0x2aa7('0x3a')]=_['intersection'](_0x14d9ad[_0x2aa7('0x37')],_0x14d9ad[_0x2aa7('0x38')]);_0x4ca096['attributes']=_[_0x2aa7('0x3b')](_0x14d9ad[_0x2aa7('0x37')],qs[_0x2aa7('0x3d')](_0x4fef98[_0x2aa7('0x38')][_0x2aa7('0x3d')]));_0x4ca096['attributes']=_0x4ca096['attributes'][_0x2aa7('0x3e')]?_0x4ca096[_0x2aa7('0x3c')]:_0x14d9ad[_0x2aa7('0x37')];if(!_0x4fef98[_0x2aa7('0x38')][_0x2aa7('0x3f')](_0x2aa7('0x40'))){_0x4ca096[_0x2aa7('0x41')]=qs[_0x2aa7('0x41')](_0x4fef98[_0x2aa7('0x38')][_0x2aa7('0x41')]);_0x4ca096[_0x2aa7('0x26')]=qs[_0x2aa7('0x26')](_0x4fef98[_0x2aa7('0x38')][_0x2aa7('0x26')]);}_0x4ca096[_0x2aa7('0x42')]=qs[_0x2aa7('0x43')](_0x4fef98[_0x2aa7('0x38')][_0x2aa7('0x43')]);_0x4ca096[_0x2aa7('0x44')]=qs[_0x2aa7('0x3a')](_[_0x2aa7('0x64')](_0x4fef98[_0x2aa7('0x38')],_0x14d9ad[_0x2aa7('0x3a')]));_0x4ca096[_0x2aa7('0x75')]=!![];if(_0x4fef98[_0x2aa7('0x38')]['filter']){_0x4ca096[_0x2aa7('0x44')]=_[_0x2aa7('0x46')](_0x4ca096[_0x2aa7('0x44')],{'$or':_[_0x2aa7('0x47')](_0x4ca096[_0x2aa7('0x3c')],function(_0x5d1a59){var _0x38534f={};_0x38534f[_0x5d1a59]={'$like':'%'+_0x4fef98[_0x2aa7('0x38')][_0x2aa7('0x45')]+'%'};return _0x38534f;})});}_0x4ca096=_[_0x2aa7('0x46')]({},_0x4ca096,_0x4fef98['options']);return _0x7ff54f[_0x2aa7('0x76')](_0x4ca096);}})[_0x2aa7('0x2d')](respondWithResult(_0x1686cd,null))[_0x2aa7('0x50')](handleError(_0x1686cd,null));};exports[_0x2aa7('0x77')]=function(_0xa75af0,_0x223d86,_0x1ef1b9){var _0x1efcda;var _0x5d8084;var _0xecc225;var _0x2ef643=_0xa75af0['params']['id'];csv_results=[];return db['ContactItemType'][_0x2aa7('0x4e')]({'attributes':['id','name'],'raw':!![],'order':['OrderBy']})[_0x2aa7('0x2d')](function(_0x2f6c15){_0x1efcda=_0x2f6c15;var _0x465bb3=_[_0x2aa7('0x39')](db[_0x2aa7('0x68')][_0x2aa7('0x36')]);return db['CmCustomField'][_0x2aa7('0x4e')]({'raw':!![],'attributes':['id',_0x2aa7('0x78')]})['then'](function(_0x4a12ec){_0x5d8084=_0x4a12ec;var _0x574047=squel[_0x2aa7('0x79')]()[_0x2aa7('0x3d')](_0x465bb3)['from'](_0x2aa7('0x7a'),'c')[_0x2aa7('0x44')]('c.ListId\x20=\x20?',_0x2ef643)[_0x2aa7('0x44')](_0x2aa7('0x7b'))[_0x2aa7('0x7c')]();for(var _0x5eba23=0x0;_0x5eba23<_0x5d8084['length'];_0x5eba23++){_0x574047[_0x2aa7('0x7d')]('c.cf_'+_0x5d8084[_0x5eba23]['id'],'customField_'+_0x5d8084[_0x5eba23][_0x2aa7('0x78')]);}for(var _0x5eba23=0x0;_0x5eba23<_0x1efcda[_0x2aa7('0x3e')];_0x5eba23++){_0x574047[_0x2aa7('0x7d')](squel[_0x2aa7('0x79')]()[_0x2aa7('0x7d')](_0x2aa7('0x7e'))[_0x2aa7('0x7f')](_0x2aa7('0x80'))[_0x2aa7('0x44')](_0x2aa7('0x81'),_0x1efcda[_0x5eba23]['id'])[_0x2aa7('0x44')](_0x2aa7('0x82')),'additionalPhone_'+_0x1efcda[_0x5eba23][_0x2aa7('0x33')]);_0x574047[_0x2aa7('0x7d')](squel[_0x2aa7('0x79')]()['field'](_0x2aa7('0x83'))['from'](_0x2aa7('0x80'))[_0x2aa7('0x44')](_0x2aa7('0x81'),_0x1efcda[_0x5eba23]['id'])[_0x2aa7('0x44')]('CmContactId\x20=\x20c.id'),_0x2aa7('0x84')+_0x1efcda[_0x5eba23][_0x2aa7('0x33')]);}var _0x28e85d=[];_0x28e85d['push'](_0x574047[_0x2aa7('0x85')]());BPromise[_0x2aa7('0x6c')](_0x28e85d,handleQuery)[_0x2aa7('0x2d')](function(_0x193d52){handleQuery(_0x574047[_0x2aa7('0x85')]());var _0x5a9dbb=csv_results[0x0];if(!_['isEmpty'](_0x5a9dbb)){var _0x507959=toCsv(_0x5a9dbb);var _0x2c7c8a=Date[_0x2aa7('0x86')]();fs[_0x2aa7('0x87')](util[_0x2aa7('0x88')](_0x2aa7('0x89'),_0x2ef643,_0x2c7c8a),_0x507959);_0x223d86[_0x2aa7('0x8a')](_0x2aa7('0x8b'),_0x2aa7('0x8c')+util[_0x2aa7('0x88')](_0x2aa7('0x8d'),_0x2ef643,_0x2c7c8a));_0x223d86['setHeader']('Content-type',_0x2aa7('0x8e'));return _0x223d86['download'](util[_0x2aa7('0x88')](_0x2aa7('0x89'),_0x2ef643,_0x2c7c8a));}else{return _0x223d86['sendStatus'](0xcc);}});});});};exports[_0x2aa7('0x8f')]=function(_0x8035cc,_0x496208,_0x1c96fe){var _0xbffe3;delete _0x8035cc[_0x2aa7('0x54')]['id'];return db[_0x2aa7('0x4b')][_0x2aa7('0x90')]({'where':{'id':_0x8035cc[_0x2aa7('0x52')]['id']}})['then'](handleEntityNotFound(_0x496208,null))[_0x2aa7('0x2d')](function(_0xf81438){if(_0xf81438){return db[_0x2aa7('0x91')]['transaction'](function(_0x432c39){return db['CmCustomField']['create'](_0x8035cc[_0x2aa7('0x54')],{'transaction':_0x432c39})[_0x2aa7('0x2d')](function(_0x402bfd){_0xbffe3=_0x402bfd;return _0xf81438[_0x2aa7('0x92')](_0x402bfd,{'transaction':_0x432c39});})[_0x2aa7('0x2d')](function(){var _0x46139a={'type':db[_0x2aa7('0x93')]['TEXT'],'transaction':_0x432c39};switch(_0x8035cc[_0x2aa7('0x54')][_0x2aa7('0x48')]){case _0x2aa7('0x94'):_0x46139a[_0x2aa7('0x48')]=db[_0x2aa7('0x93')]['TEXT'];break;case _0x2aa7('0x95'):_0x46139a[_0x2aa7('0x48')]=db[_0x2aa7('0x93')]['INTEGER'];break;case _0x2aa7('0x96'):_0x46139a[_0x2aa7('0x48')]=db[_0x2aa7('0x93')]['BOOLEAN'];_0x46139a[_0x2aa7('0x97')]=![];break;default:}return db['sequelize'][_0x2aa7('0x98')]['addColumn'](_0x2aa7('0x7a'),util[_0x2aa7('0x88')](_0x2aa7('0x99'),_0xbffe3['id']),_0x46139a);})[_0x2aa7('0x2d')](function(){return _0xbffe3;});});}})[_0x2aa7('0x2d')](respondWithResult(_0x496208,null))['catch'](handleError(_0x496208,null));};exports[_0x2aa7('0x9a')]=function(_0x386fa5,_0xe3d23f,_0x1e2e51){var _0x19ec0c={};var _0x463b05={};var _0xc189c9;var _0x33c241;return db[_0x2aa7('0x4b')]['findOne']({'where':{'id':_0x386fa5[_0x2aa7('0x52')]['id']}})[_0x2aa7('0x2d')](handleEntityNotFound(_0xe3d23f,null))[_0x2aa7('0x2d')](function(_0x3d9903){if(_0x3d9903){_0xc189c9=_0x3d9903;_0x463b05['model']=_[_0x2aa7('0x39')](db[_0x2aa7('0x9b')]['rawAttributes']);_0x463b05[_0x2aa7('0x38')]=_[_0x2aa7('0x39')](_0x386fa5[_0x2aa7('0x38')]);_0x463b05[_0x2aa7('0x3a')]=_['intersection'](_0x463b05['model'],_0x463b05[_0x2aa7('0x38')]);_0x19ec0c[_0x2aa7('0x3c')]=_[_0x2aa7('0x3b')](_0x463b05['model'],qs[_0x2aa7('0x3d')](_0x386fa5[_0x2aa7('0x38')][_0x2aa7('0x3d')]));_0x19ec0c['attributes']=_0x19ec0c['attributes'][_0x2aa7('0x3e')]?_0x19ec0c[_0x2aa7('0x3c')]:_0x463b05['model'];_0x19ec0c[_0x2aa7('0x42')]=qs[_0x2aa7('0x43')](_0x386fa5[_0x2aa7('0x38')][_0x2aa7('0x43')]);_0x19ec0c[_0x2aa7('0x44')]=qs[_0x2aa7('0x3a')](_[_0x2aa7('0x64')](_0x386fa5['query'],_0x463b05[_0x2aa7('0x3a')]));_0x19ec0c[_0x2aa7('0x44')]=_[_0x2aa7('0x46')](_0x19ec0c[_0x2aa7('0x44')],{'$or':[{'ListId':_0x3d9903['id']},{'ListId':null}]});if(_0x386fa5[_0x2aa7('0x38')][_0x2aa7('0x45')]){_0x19ec0c[_0x2aa7('0x44')]=_[_0x2aa7('0x46')](_0x19ec0c['where'],{'$or':_[_0x2aa7('0x47')](_0x19ec0c[_0x2aa7('0x3c')],function(_0x4df3da){var _0x52ea80={};_0x52ea80[_0x4df3da]={'$like':'%'+_0x386fa5[_0x2aa7('0x38')]['filter']+'%'};return _0x52ea80;})});}_0x19ec0c=_[_0x2aa7('0x46')]({},_0x19ec0c,_0x386fa5['options']);return db[_0x2aa7('0x9b')][_0x2aa7('0x9c')](_0x19ec0c);}})[_0x2aa7('0x2d')](respondWithResult(_0xe3d23f,null))[_0x2aa7('0x50')](handleError(_0xe3d23f,null));};exports[_0x2aa7('0x9d')]=function(_0x2f34b3,_0x223ff7){return db[_0x2aa7('0x9b')][_0x2aa7('0x9c')]({'where':{'ListId':null}})[_0x2aa7('0x2d')](handleEntityNotFound(_0x223ff7,null))[_0x2aa7('0x2d')](function(_0x523c42){return _0x523c42;})[_0x2aa7('0x2d')](respondWithResult(_0x223ff7,null))[_0x2aa7('0x50')](handleError(_0x223ff7,null));};exports['addAgents']=function(_0x54e43e,_0x50c56a,_0x53f9a2){return db[_0x2aa7('0x4b')][_0x2aa7('0x59')]({'where':{'id':_0x54e43e[_0x2aa7('0x52')]['id']}})['then'](handleEntityNotFound(_0x50c56a,null))[_0x2aa7('0x2d')](function(_0x568910){if(_0x568910){return _0x568910['addAgents'](_0x54e43e['body']['ids'],_[_0x2aa7('0x6d')](_0x54e43e[_0x2aa7('0x54')],[_0x2aa7('0x66'),'id'])||{})[_0x2aa7('0x9e')](function(_0x1c3c2b){for(var _0x49a22a=0x0;_0x49a22a<_0x54e43e[_0x2aa7('0x54')][_0x2aa7('0x66')]['length'];_0x49a22a+=0x1){socket[_0x2aa7('0x9f')]('userCmList:save',{'UserId':Number(_0x54e43e['body'][_0x2aa7('0x66')][_0x49a22a]),'CmListId':Number(_0x54e43e[_0x2aa7('0x52')]['id'])});}return _0x1c3c2b;});}})[_0x2aa7('0x2d')](respondWithResult(_0x50c56a,null))[_0x2aa7('0x50')](handleError(_0x50c56a,null));};exports['removeAgents']=function(_0x43d365,_0xf29741,_0x29b0e6){return db[_0x2aa7('0x4b')][_0x2aa7('0x59')]({'where':{'id':_0x43d365[_0x2aa7('0x52')]['id']}})['then'](handleEntityNotFound(_0xf29741,null))['then'](function(_0x19c2f8){if(_0x19c2f8){return _0x19c2f8['removeAgents'](_0x43d365[_0x2aa7('0x38')]['ids'])[_0x2aa7('0x2d')](function(){if(_[_0x2aa7('0x6a')](_0x43d365['query'][_0x2aa7('0x66')])){for(var _0x13250f=0x0;_0x13250f<_0x43d365['query'][_0x2aa7('0x66')][_0x2aa7('0x3e')];_0x13250f+=0x1){socket[_0x2aa7('0x9f')](_0x2aa7('0xa0'),{'UserId':Number(_0x43d365[_0x2aa7('0x38')][_0x2aa7('0x66')][_0x13250f]),'CmListId':Number(_0x43d365['params']['id'])});}}else{socket[_0x2aa7('0x9f')](_0x2aa7('0xa0'),{'UserId':Number(_0x43d365[_0x2aa7('0x38')][_0x2aa7('0x66')]),'CmListId':Number(_0x43d365[_0x2aa7('0x52')]['id'])});}});}})[_0x2aa7('0x2d')](respondWithStatusCode(_0xf29741,null))[_0x2aa7('0x50')](handleError(_0xf29741,null));};exports['getAgents']=function(_0x2219e6,_0xd847bb,_0x3d3c77){var _0x23ed75={};var _0x3da657={};var _0x36a12a;var _0x3699e4;return db[_0x2aa7('0x4b')][_0x2aa7('0x90')]({'where':{'id':_0x2219e6[_0x2aa7('0x52')]['id']}})['then'](handleEntityNotFound(_0xd847bb,null))[_0x2aa7('0x2d')](function(_0x2daa90){if(_0x2daa90){_0x36a12a=_0x2daa90;_0x3da657['model']=_[_0x2aa7('0x39')](db[_0x2aa7('0xa1')][_0x2aa7('0x36')]);_0x3da657[_0x2aa7('0x38')]=_['keys'](_0x2219e6['query']);_0x3da657[_0x2aa7('0x3a')]=_['intersection'](_0x3da657[_0x2aa7('0x37')],_0x3da657['query']);_0x23ed75[_0x2aa7('0x3c')]=_[_0x2aa7('0x3b')](_0x3da657[_0x2aa7('0x37')],qs[_0x2aa7('0x3d')](_0x2219e6[_0x2aa7('0x38')][_0x2aa7('0x3d')]));_0x23ed75[_0x2aa7('0x3c')]=_0x23ed75['attributes'][_0x2aa7('0x3e')]?_0x23ed75['attributes']:_0x3da657[_0x2aa7('0x37')];_0x23ed75['order']=qs[_0x2aa7('0x43')](_0x2219e6['query'][_0x2aa7('0x43')]);_0x23ed75[_0x2aa7('0x44')]=qs[_0x2aa7('0x3a')](_[_0x2aa7('0x64')](_0x2219e6[_0x2aa7('0x38')],_0x3da657[_0x2aa7('0x3a')]));if(_0x2219e6[_0x2aa7('0x38')][_0x2aa7('0x45')]){_0x23ed75[_0x2aa7('0x44')]=_[_0x2aa7('0x46')](_0x23ed75['where'],{'$or':_[_0x2aa7('0x47')](_0x23ed75['attributes'],function(_0x48461a){var _0x1711ce={};_0x1711ce[_0x48461a]={'$like':'%'+_0x2219e6['query'][_0x2aa7('0x45')]+'%'};return _0x1711ce;})});}_0x23ed75=_[_0x2aa7('0x46')]({},_0x23ed75,_0x2219e6['options']);return _0x36a12a[_0x2aa7('0xa2')](_0x23ed75);}})['then'](function(_0x37b550){if(_0x37b550){_0x3699e4=_0x37b550[_0x2aa7('0x3e')];if(!_0x2219e6[_0x2aa7('0x38')]['hasOwnProperty'](_0x2aa7('0x40'))){_0x23ed75[_0x2aa7('0x41')]=qs[_0x2aa7('0x41')](_0x2219e6[_0x2aa7('0x38')]['limit']);_0x23ed75[_0x2aa7('0x26')]=qs[_0x2aa7('0x26')](_0x2219e6['query'][_0x2aa7('0x26')]);}return _0x36a12a[_0x2aa7('0xa2')](_0x23ed75);}})[_0x2aa7('0x2d')](function(_0x35b022){if(_0x35b022){return _0x35b022?{'count':_0x3699e4,'rows':_0x35b022}:null;}})[_0x2aa7('0x2d')](respondWithResult(_0xd847bb,null))['catch'](handleError(_0xd847bb,null));};function handleQuery(_0x2dbea5){logger[_0x2aa7('0xa3')](_0x2dbea5);return db[_0x2aa7('0x91')]['query'](_0x2dbea5)[_0x2aa7('0x9e')](function(_0x1a25c4){csv_results[_0x2aa7('0x6b')](_0x1a25c4);})[_0x2aa7('0x50')](function(_0x2ffe41){logger[_0x2aa7('0x31')](_0x2ffe41['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index efa7d4b..1f998fd 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x553ee1,_0x462636){var _0x9ce4e9=function(_0x1d3a8c){while(--_0x1d3a8c){_0x553ee1['push'](_0x553ee1['shift']());}};_0x9ce4e9(++_0x462636);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 +var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x5bd114,_0x108063){_0x5bd114=_0x5bd114-0x0;var _0x4b3a32=_0x3e74[_0x5bd114];return _0x4b3a32;};'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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 3c52a5b..f6f9dd2 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 _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','define','CmList','lodash','util'];(function(_0x5393e8,_0x3e72f9){var _0x41c6fd=function(_0x25198a){while(--_0x25198a){_0x5393e8['push'](_0x5393e8['shift']());}};_0x41c6fd(++_0x3e72f9);}(_0x54ef,0x112));var _0xf54e=function(_0x541cea,_0x31c8e5){_0x541cea=_0x541cea-0x0;var _0x3d6fa2=_0x54ef[_0x541cea];return _0x3d6fa2;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./cmList.attributes','exports','define','cm_lists','../../config/logger','api','moment','bluebird','path'];(function(_0x3e3cec,_0x41ed1b){var _0x21f122=function(_0x5ba463){while(--_0x5ba463){_0x3e3cec['push'](_0x3e3cec['shift']());}};_0x21f122(++_0x41ed1b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0xcb91[_0x424357];return _0x29c68e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('CmList',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index fef637c..fb7a922 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 _0x6f9d=['redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','http'];(function(_0x107977,_0x25ef53){var _0xe35282=function(_0x40c72c){while(--_0x40c72c){_0x107977['push'](_0x107977['shift']());}};_0xe35282(++_0x25ef53);}(_0x6f9d,0x13e));var _0xd6f9=function(_0x3df21d,_0xa44265){_0x3df21d=_0x3df21d-0x0;var _0x37ab8a=_0x6f9d[_0x3df21d];return _0x37ab8a;};'use strict';var _=require(_0xd6f9('0x0'));var util=require('util');var moment=require(_0xd6f9('0x1'));var BPromise=require('bluebird');var rs=require(_0xd6f9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6f9('0x4'))(_0xd6f9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd6f9('0x6')]({'port':0x232a});config[_0xd6f9('0x7')]=_[_0xd6f9('0x8')](config['redis'],{'host':_0xd6f9('0x9'),'port':0x18eb});var socket=require(_0xd6f9('0xa'))(new Redis(config[_0xd6f9('0x7')]));require(_0xd6f9('0xb'))[_0xd6f9('0xc')](socket);function respondWithRpcPromise(_0x592662,_0x2c5e1f,_0x4d155b){return new BPromise(function(_0xf4b31d,_0xec6e9f){return client[_0xd6f9('0xd')](_0x592662,_0x4d155b)[_0xd6f9('0xe')](function(_0x4a104f){logger[_0xd6f9('0xf')](_0xd6f9('0x10'),_0x2c5e1f,_0xd6f9('0x11'));logger[_0xd6f9('0x12')](_0xd6f9('0x13'),_0x2c5e1f,_0xd6f9('0x11'),JSON[_0xd6f9('0x14')](_0x4a104f));if(_0x4a104f[_0xd6f9('0x15')]){if(_0x4a104f[_0xd6f9('0x15')][_0xd6f9('0x16')]===0x1f4){logger[_0xd6f9('0x15')](_0xd6f9('0x10'),_0x2c5e1f,_0x4a104f[_0xd6f9('0x15')][_0xd6f9('0x17')]);return _0xec6e9f(_0x4a104f[_0xd6f9('0x15')][_0xd6f9('0x17')]);}logger['error'](_0xd6f9('0x10'),_0x2c5e1f,_0x4a104f[_0xd6f9('0x15')]['message']);return _0xf4b31d(_0x4a104f[_0xd6f9('0x15')]['message']);}else{logger[_0xd6f9('0xf')](_0xd6f9('0x10'),_0x2c5e1f,_0xd6f9('0x11'));_0xf4b31d(_0x4a104f['result']['message']);}})[_0xd6f9('0x18')](function(_0x5c3cc7){logger[_0xd6f9('0x15')](_0xd6f9('0x10'),_0x2c5e1f,_0x5c3cc7);_0xec6e9f(_0x5c3cc7);});});} \ No newline at end of file +var _0x6120=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','request','then','info','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmList,\x20%s,\x20%s','message'];(function(_0x1ce0ec,_0x459dba){var _0x56d355=function(_0x2b8829){while(--_0x2b8829){_0x1ce0ec['push'](_0x1ce0ec['shift']());}};_0x56d355(++_0x459dba);}(_0x6120,0xaa));var _0x0612=function(_0x4407e2,_0x2b32fd){_0x4407e2=_0x4407e2-0x0;var _0x1035ab=_0x6120[_0x4407e2];return _0x1035ab;};'use strict';var _=require(_0x0612('0x0'));var util=require(_0x0612('0x1'));var moment=require('moment');var BPromise=require(_0x0612('0x2'));var rs=require(_0x0612('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0612('0x4'))['db'];var utils=require(_0x0612('0x5'));var logger=require(_0x0612('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0612('0x7'));var client=jayson[_0x0612('0x8')][_0x0612('0x9')]({'port':0x232a});config[_0x0612('0xa')]=_[_0x0612('0xb')](config[_0x0612('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0612('0xa')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x4e1a64,_0x1393c2,_0x4157d8){return new BPromise(function(_0x340646,_0x35974e){return client[_0x0612('0xc')](_0x4e1a64,_0x4157d8)[_0x0612('0xd')](function(_0x24d488){logger[_0x0612('0xe')]('CmList,\x20%s,\x20%s',_0x1393c2,'request\x20sent');logger[_0x0612('0xf')](_0x0612('0x10'),_0x1393c2,_0x0612('0x11'),JSON[_0x0612('0x12')](_0x24d488));if(_0x24d488[_0x0612('0x13')]){if(_0x24d488[_0x0612('0x13')]['code']===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x1393c2,_0x24d488[_0x0612('0x13')]['message']);return _0x35974e(_0x24d488[_0x0612('0x13')]['message']);}logger['error'](_0x0612('0x14'),_0x1393c2,_0x24d488['error'][_0x0612('0x15')]);return _0x340646(_0x24d488[_0x0612('0x13')][_0x0612('0x15')]);}else{logger['info'](_0x0612('0x14'),_0x1393c2,_0x0612('0x11'));_0x340646(_0x24d488[_0x0612('0x16')][_0x0612('0x15')]);}})[_0x0612('0x17')](function(_0x551e44){logger['error']('CmList,\x20%s,\x20%s',_0x1393c2,_0x551e44);_0x35974e(_0x551e44);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index a4f9e7c..3b01cbc 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 _0x4c8b=['removeListener','register','length','cmList:','./cmList.events','save','update','emit'];(function(_0x49e812,_0x3274b9){var _0x1564ea=function(_0x5ee4e1){while(--_0x5ee4e1){_0x49e812['push'](_0x49e812['shift']());}};_0x1564ea(++_0x3274b9);}(_0x4c8b,0x1ec));var _0xb4c8=function(_0x2f68ed,_0x1ce66a){_0x2f68ed=_0x2f68ed-0x0;var _0x1f6c18=_0x4c8b[_0x2f68ed];return _0x1f6c18;};'use strict';var CmListEvents=require(_0xb4c8('0x0'));var events=[_0xb4c8('0x1'),'remove',_0xb4c8('0x2')];function createListener(_0x2fb6f1,_0x43df39){return function(_0x49fc8b){_0x43df39[_0xb4c8('0x3')](_0x2fb6f1,_0x49fc8b);};}function removeListener(_0x23d677,_0x279484){return function(){CmListEvents[_0xb4c8('0x4')](_0x23d677,_0x279484);};}exports[_0xb4c8('0x5')]=function(_0x388844){for(var _0x36e200=0x0,_0x554d48=events[_0xb4c8('0x6')];_0x36e200<_0x554d48;_0x36e200++){var _0x5ea5b8=events[_0x36e200];var _0xe85d3e=createListener(_0xb4c8('0x7')+_0x5ea5b8,_0x388844);CmListEvents['on'](_0x5ea5b8,_0xe85d3e);}}; \ No newline at end of file +var _0x401f=['removeListener','register','length','./cmList.events','emit'];(function(_0x1df612,_0x3dc744){var _0x3c42a9=function(_0x492e20){while(--_0x492e20){_0x1df612['push'](_0x1df612['shift']());}};_0x3c42a9(++_0x3dc744);}(_0x401f,0x14d));var _0xf401=function(_0x19c6e5,_0x4afdec){_0x19c6e5=_0x19c6e5-0x0;var _0x4aab35=_0x401f[_0x19c6e5];return _0x4aab35;};'use strict';var CmListEvents=require(_0xf401('0x0'));var events=['save','remove','update'];function createListener(_0x42086e,_0x332c97){return function(_0xa14bf9){_0x332c97[_0xf401('0x1')](_0x42086e,_0xa14bf9);};}function removeListener(_0x2d2313,_0x1dc0c8){return function(){CmListEvents[_0xf401('0x2')](_0x2d2313,_0x1dc0c8);};}exports[_0xf401('0x3')]=function(_0x4afd52){for(var _0x5f4e04=0x0,_0x17c05f=events[_0xf401('0x4')];_0x5f4e04<_0x17c05f;_0x5f4e04++){var _0x45dae0=events[_0x5f4e04];var _0x1e0306=createListener('cmList:'+_0x45dae0,_0x4afd52);CmListEvents['on'](_0x45dae0,_0x1e0306);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 5c4f606..3c94d39 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 _0xd816=['../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','get','describe','/global_fields','getGlobalCustomFields','/:id/dispositions','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','post','create','addDisposition','/:id/contacts','addContacts','addAgents','put','/:id','destroy','delete','removeDispositions','removeAgents','exports','multer','util','connect-timeout','../../components/auth/service'];(function(_0x18a577,_0x25560c){var _0x1cb0c7=function(_0x195eeb){while(--_0x195eeb){_0x18a577['push'](_0x18a577['shift']());}};_0x1cb0c7(++_0x25560c);}(_0xd816,0xd5));var _0x6d81=function(_0x1f495e,_0x34d078){_0x1f495e=_0x1f495e-0x0;var _0x3fa76e=_0xd816[_0x1f495e];return _0x3fa76e;};'use strict';var multer=require(_0x6d81('0x0'));var util=require(_0x6d81('0x1'));var path=require('path');var timeout=require(_0x6d81('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6d81('0x3'));var interaction=require(_0x6d81('0x4'));var config=require(_0x6d81('0x5'));var controller=require(_0x6d81('0x6'));router['get']('/',auth[_0x6d81('0x7')](),controller['index']);router[_0x6d81('0x8')]('/describe',auth[_0x6d81('0x7')](),controller[_0x6d81('0x9')]);router['get'](_0x6d81('0xa'),auth[_0x6d81('0x7')](),controller[_0x6d81('0xb')]);router[_0x6d81('0x8')]('/:id',auth[_0x6d81('0x7')](),controller['show']);router[_0x6d81('0x8')](_0x6d81('0xc'),auth[_0x6d81('0x7')](),controller['getDispositions']);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x6d81('0xd')]);router[_0x6d81('0x8')](_0x6d81('0xe'),auth[_0x6d81('0x7')](),controller['getContactsCsv']);router[_0x6d81('0x8')](_0x6d81('0xf'),auth[_0x6d81('0x7')](),controller[_0x6d81('0x10')]);router['get'](_0x6d81('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0x6d81('0x12')]('/',auth[_0x6d81('0x7')](),controller[_0x6d81('0x13')]);router[_0x6d81('0x12')](_0x6d81('0xc'),auth[_0x6d81('0x7')](),controller[_0x6d81('0x14')]);router['post'](_0x6d81('0x15'),auth[_0x6d81('0x7')](),controller[_0x6d81('0x16')]);router[_0x6d81('0x12')]('/:id/fields',auth[_0x6d81('0x7')](),controller['addCustomField']);router[_0x6d81('0x12')](_0x6d81('0x11'),auth[_0x6d81('0x7')](),controller[_0x6d81('0x17')]);router[_0x6d81('0x18')](_0x6d81('0x19'),auth[_0x6d81('0x7')](),controller['update']);router['delete'](_0x6d81('0x19'),auth[_0x6d81('0x7')](),controller[_0x6d81('0x1a')]);router[_0x6d81('0x1b')](_0x6d81('0xc'),auth['isAuthenticated'](),controller[_0x6d81('0x1c')]);router[_0x6d81('0x1b')](_0x6d81('0x11'),auth[_0x6d81('0x7')](),controller[_0x6d81('0x1d')]);module[_0x6d81('0x1e')]=router; \ No newline at end of file +var _0xfc0b=['fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','/:id/fields','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','util','path','connect-timeout'];(function(_0x282eb0,_0x2da88e){var _0x103458=function(_0x49c62f){while(--_0x49c62f){_0x282eb0['push'](_0x282eb0['shift']());}};_0x103458(++_0x2da88e);}(_0xfc0b,0x189));var _0xbfc0=function(_0x4b8c82,_0x19177c){_0x4b8c82=_0x4b8c82-0x0;var _0x24352a=_0xfc0b[_0x4b8c82];return _0x24352a;};'use strict';var multer=require('multer');var util=require(_0xbfc0('0x0'));var path=require(_0xbfc0('0x1'));var timeout=require(_0xbfc0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbfc0('0x3'));var auth=require(_0xbfc0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbfc0('0x5'));var controller=require(_0xbfc0('0x6'));router[_0xbfc0('0x7')]('/',auth[_0xbfc0('0x8')](),controller[_0xbfc0('0x9')]);router[_0xbfc0('0x7')](_0xbfc0('0xa'),auth[_0xbfc0('0x8')](),controller[_0xbfc0('0xb')]);router[_0xbfc0('0x7')](_0xbfc0('0xc'),auth['isAuthenticated'](),controller[_0xbfc0('0xd')]);router[_0xbfc0('0x7')](_0xbfc0('0xe'),auth[_0xbfc0('0x8')](),controller[_0xbfc0('0xf')]);router[_0xbfc0('0x7')](_0xbfc0('0x10'),auth['isAuthenticated'](),controller[_0xbfc0('0x11')]);router['get'](_0xbfc0('0x12'),auth['isAuthenticated'](),controller[_0xbfc0('0x13')]);router['get'](_0xbfc0('0x14'),auth['isAuthenticated'](),controller[_0xbfc0('0x15')]);router[_0xbfc0('0x7')]('/:id/fields',auth[_0xbfc0('0x8')](),controller[_0xbfc0('0x16')]);router[_0xbfc0('0x7')](_0xbfc0('0x17'),auth[_0xbfc0('0x8')](),controller[_0xbfc0('0x18')]);router[_0xbfc0('0x19')]('/',auth[_0xbfc0('0x8')](),controller[_0xbfc0('0x1a')]);router[_0xbfc0('0x19')]('/:id/dispositions',auth[_0xbfc0('0x8')](),controller['addDisposition']);router[_0xbfc0('0x19')](_0xbfc0('0x12'),auth['isAuthenticated'](),controller['addContacts']);router[_0xbfc0('0x19')](_0xbfc0('0x1b'),auth['isAuthenticated'](),controller[_0xbfc0('0x1c')]);router[_0xbfc0('0x19')](_0xbfc0('0x17'),auth['isAuthenticated'](),controller[_0xbfc0('0x1d')]);router[_0xbfc0('0x1e')](_0xbfc0('0xe'),auth[_0xbfc0('0x8')](),controller[_0xbfc0('0x1f')]);router[_0xbfc0('0x20')](_0xbfc0('0xe'),auth[_0xbfc0('0x8')](),controller[_0xbfc0('0x21')]);router['delete'](_0xbfc0('0x10'),auth[_0xbfc0('0x8')](),controller[_0xbfc0('0x22')]);router[_0xbfc0('0x20')](_0xbfc0('0x17'),auth[_0xbfc0('0x8')](),controller[_0xbfc0('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index f4abb35..38f32c0 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 _0x4ba9=['STRING','sequelize','exports','getDataValue'];(function(_0x43b241,_0x5ba51b){var _0x32db7b=function(_0x2ffd05){while(--_0x2ffd05){_0x43b241['push'](_0x43b241['shift']());}};_0x32db7b(++_0x5ba51b);}(_0x4ba9,0x115));var _0x94ba=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x4ba9[_0x4f2c3a];return _0x17d91c;};'use strict';var Sequelize=require(_0x94ba('0x0'));module[_0x94ba('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2ca131){return this[_0x94ba('0x2')]('field');}},'field':{'type':Sequelize[_0x94ba('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x94ba('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x94ba('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x6f2d=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6f2d,0x10f));var _0xd6f2=function(_0x4adf42,_0x121910){_0x4adf42=_0x4adf42-0x0;var _0x14467f=_0x6f2d[_0x4adf42];return _0x14467f;};'use strict';var Sequelize=require(_0xd6f2('0x0'));module[_0xd6f2('0x1')]={'name':{'type':Sequelize[_0xd6f2('0x2')],'get':function(_0x556db8){return this[_0xd6f2('0x3')](_0xd6f2('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xd6f2('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xd6f2('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 772940a..b50e6d6 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x328fea,_0x2dd5c4){var _0x17201a=function(_0x41c03e){while(--_0x41c03e){_0x328fea['push'](_0x328fea['shift']());}};_0x17201a(++_0x2dd5c4);}(_0x7a54,0x106));var _0x47a5=function(_0x1a1ddd,_0x5ee1d7){_0x1a1ddd=_0x1a1ddd-0x0;var _0x592dce=_0x7a54[_0x1a1ddd];return _0x592dce;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x3554b9,_0x4e656e){var _0x37ba4d=function(_0xd3f64d){while(--_0xd3f64d){_0x3554b9['push'](_0x3554b9['shift']());}};_0x37ba4d(++_0x4e656e);}(_0x7a54,0x106));var _0x47a5=function(_0x3b9a46,_0x4d0911){_0x3b9a46=_0x3b9a46-0x0;var _0x55d3ae=_0x7a54[_0x3b9a46];return _0x55d3ae;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index a082b8c..6314dce 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 _0x7b85=['tools_conditions','util','../../config/logger','api','moment','bluebird','path','rimraf','./condition.attributes','define'];(function(_0x4e605b,_0x301d0b){var _0x53ad1c=function(_0x1fa071){while(--_0x1fa071){_0x4e605b['push'](_0x4e605b['shift']());}};_0x53ad1c(++_0x301d0b);}(_0x7b85,0x155));var _0x57b8=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0x7b85[_0x3b7a0c];return _0x3bb70f;};'use strict';var _=require('lodash');var util=require(_0x57b8('0x0'));var logger=require(_0x57b8('0x1'))(_0x57b8('0x2'));var moment=require(_0x57b8('0x3'));var BPromise=require(_0x57b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57b8('0x5'));var rimraf=require(_0x57b8('0x6'));var config=require('../../config/environment');var attributes=require(_0x57b8('0x7'));module['exports']=function(_0x1766ef,_0x429d86){return _0x1766ef[_0x57b8('0x8')]('Condition',attributes,{'tableName':_0x57b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb21=['moment','bluebird','request-promise','rimraf','./condition.attributes','define','Condition','tools_conditions','util','api'];(function(_0x5f4250,_0x25f060){var _0x1346be=function(_0x21eea5){while(--_0x21eea5){_0x5f4250['push'](_0x5f4250['shift']());}};_0x1346be(++_0x25f060);}(_0xdb21,0x198));var _0x1db2=function(_0x4bedce,_0x265ebf){_0x4bedce=_0x4bedce-0x0;var _0x4fd2fb=_0xdb21[_0x4bedce];return _0x4fd2fb;};'use strict';var _=require('lodash');var util=require(_0x1db2('0x0'));var logger=require('../../config/logger')(_0x1db2('0x1'));var moment=require(_0x1db2('0x2'));var BPromise=require(_0x1db2('0x3'));var rp=require(_0x1db2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1db2('0x5'));var config=require('../../config/environment');var attributes=require(_0x1db2('0x6'));module['exports']=function(_0x1c5ba2,_0x3367b0){return _0x1c5ba2[_0x1db2('0x7')](_0x1db2('0x8'),attributes,{'tableName':_0x1db2('0x9'),'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 2212431..d6e6deb 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 _0xbfd2=['util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0xbfd2,0x13b));var _0x2bfd=function(_0x3dd889,_0x3ae533){_0x3dd889=_0x3dd889-0x0;var _0x20c3b0=_0xbfd2[_0x3dd889];return _0x20c3b0;};'use strict';var _=require('lodash');var util=require(_0x2bfd('0x0'));var moment=require(_0x2bfd('0x1'));var BPromise=require('bluebird');var rs=require(_0x2bfd('0x2'));var fs=require('fs');var Redis=require(_0x2bfd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2bfd('0x4'))(_0x2bfd('0x5'));var config=require(_0x2bfd('0x6'));var jayson=require(_0x2bfd('0x7'));var client=jayson['client'][_0x2bfd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x176332,_0xf66e34,_0x2ea6e4){return new BPromise(function(_0x10c228,_0x305f96){return client[_0x2bfd('0x9')](_0x176332,_0x2ea6e4)[_0x2bfd('0xa')](function(_0x6e0c5c){logger[_0x2bfd('0xb')](_0x2bfd('0xc'),_0xf66e34,'request\x20sent');logger[_0x2bfd('0xd')](_0x2bfd('0xe'),_0xf66e34,_0x2bfd('0xf'),JSON[_0x2bfd('0x10')](_0x6e0c5c));if(_0x6e0c5c[_0x2bfd('0x11')]){if(_0x6e0c5c['error'][_0x2bfd('0x12')]===0x1f4){logger[_0x2bfd('0x11')](_0x2bfd('0xc'),_0xf66e34,_0x6e0c5c[_0x2bfd('0x11')][_0x2bfd('0x13')]);return _0x305f96(_0x6e0c5c[_0x2bfd('0x11')][_0x2bfd('0x13')]);}logger[_0x2bfd('0x11')](_0x2bfd('0xc'),_0xf66e34,_0x6e0c5c['error'][_0x2bfd('0x13')]);return _0x10c228(_0x6e0c5c[_0x2bfd('0x11')][_0x2bfd('0x13')]);}else{logger[_0x2bfd('0xb')](_0x2bfd('0xc'),_0xf66e34,'request\x20sent');_0x10c228(_0x6e0c5c['result']['message']);}})[_0x2bfd('0x14')](function(_0xc02b5){logger[_0x2bfd('0x11')](_0x2bfd('0xc'),_0xf66e34,_0xc02b5);_0x305f96(_0xc02b5);});});} \ No newline at end of file +var _0xc10f=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc10f,0x7f));var _0xfc10=function(_0x557741,_0x43d009){_0x557741=_0x557741-0x0;var _0x4cd544=_0xc10f[_0x557741];return _0x4cd544;};'use strict';var _=require(_0xfc10('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc10('0x1'));var db=require(_0xfc10('0x2'))['db'];var utils=require(_0xfc10('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xfc10('0x4'));var jayson=require(_0xfc10('0x5'));var client=jayson[_0xfc10('0x6')][_0xfc10('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x13fb78,_0x56a017,_0xc90d5a){return new BPromise(function(_0x6881fe,_0x37bd79){return client[_0xfc10('0x8')](_0x13fb78,_0xc90d5a)['then'](function(_0x1bcbae){logger[_0xfc10('0x9')](_0xfc10('0xa'),_0x56a017,_0xfc10('0xb'));logger[_0xfc10('0xc')](_0xfc10('0xd'),_0x56a017,_0xfc10('0xb'),JSON[_0xfc10('0xe')](_0x1bcbae));if(_0x1bcbae[_0xfc10('0xf')]){if(_0x1bcbae['error'][_0xfc10('0x10')]===0x1f4){logger[_0xfc10('0xf')](_0xfc10('0xa'),_0x56a017,_0x1bcbae['error'][_0xfc10('0x11')]);return _0x37bd79(_0x1bcbae[_0xfc10('0xf')][_0xfc10('0x11')]);}logger[_0xfc10('0xf')](_0xfc10('0xa'),_0x56a017,_0x1bcbae['error'][_0xfc10('0x11')]);return _0x6881fe(_0x1bcbae[_0xfc10('0xf')][_0xfc10('0x11')]);}else{logger[_0xfc10('0x9')](_0xfc10('0xa'),_0x56a017,_0xfc10('0xb'));_0x6881fe(_0x1bcbae[_0xfc10('0x12')][_0xfc10('0x11')]);}})[_0xfc10('0x13')](function(_0x4ae7f1){logger[_0xfc10('0xf')]('Condition,\x20%s,\x20%s',_0x56a017,_0x4ae7f1);_0x37bd79(_0x4ae7f1);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 5b30ec9..194e4dc 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 _0x913e=['delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update'];(function(_0x8e4b92,_0x410270){var _0x10fb67=function(_0xf368a2){while(--_0xf368a2){_0x8e4b92['push'](_0x8e4b92['shift']());}};_0x10fb67(++_0x410270);}(_0x913e,0x14d));var _0xe913=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x913e[_0x32f7d7];return _0x133d09;};'use strict';var multer=require(_0xe913('0x0'));var util=require(_0xe913('0x1'));var path=require(_0xe913('0x2'));var timeout=require(_0xe913('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe913('0x4'));var auth=require(_0xe913('0x5'));var interaction=require(_0xe913('0x6'));var config=require(_0xe913('0x7'));var controller=require(_0xe913('0x8'));router['put'](_0xe913('0x9'),auth[_0xe913('0xa')](),controller[_0xe913('0xb')]);router[_0xe913('0xc')]('/:id',auth[_0xe913('0xa')](),controller[_0xe913('0xd')]);module[_0xe913('0xe')]=router; \ No newline at end of file +var _0x8586=['../../config/environment','put','isAuthenticated','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x8586,0x106));var _0x6858=function(_0xda501a,_0x159d6a){_0xda501a=_0xda501a-0x0;var _0x44be3a=_0x8586[_0xda501a];return _0x44be3a;};'use strict';var multer=require(_0x6858('0x0'));var util=require(_0x6858('0x1'));var path=require(_0x6858('0x2'));var timeout=require(_0x6858('0x3'));var express=require(_0x6858('0x4'));var router=express[_0x6858('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6858('0x6'));var interaction=require(_0x6858('0x7'));var config=require(_0x6858('0x8'));var controller=require('./condition.controller');router[_0x6858('0x9')]('/:id',auth[_0x6858('0xa')](),controller[_0x6858('0xb')]);router[_0x6858('0xc')](_0x6858('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x6858('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 9d9d36f..c53e4e9 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 _0x7cda=['exports','STRING','name'];(function(_0x12f88d,_0x449e11){var _0x5da076=function(_0x4239a7){while(--_0x4239a7){_0x12f88d['push'](_0x12f88d['shift']());}};_0x5da076(++_0x449e11);}(_0x7cda,0xf6));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xa7cd('0x0')]={'name':{'type':Sequelize[_0xa7cd('0x1')],'allowNull':![],'unique':_0xa7cd('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xa7cd('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x720e=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x720e,0x1cb));var _0xe720=function(_0x1998bb,_0x1f1da1){_0x1998bb=_0x1998bb-0x0;var _0x4ae4c9=_0x720e[_0x1998bb];return _0x4ae4c9;};'use strict';var Sequelize=require(_0xe720('0x0'));module[_0xe720('0x1')]={'name':{'type':Sequelize[_0xe720('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xe720('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index dfc0c7c..c53e857 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 _0xfb11=['show','keys','rawAttributes','includeAll','include','find','body','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','ContactItemTypes','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','ContactItemType','findAll','rows','catch'];(function(_0xc2a9c6,_0x13c9a1){var _0x569f41=function(_0x33f1a5){while(--_0x33f1a5){_0xc2a9c6['push'](_0xc2a9c6['shift']());}};_0x569f41(++_0x13c9a1);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xfb11[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require(_0x1fb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fb1('0x1'));var jsonpatch=require(_0x1fb1('0x2'));var rp=require('request-promise');var moment=require(_0x1fb1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1fb1('0x4'));var util=require('util');var path=require(_0x1fb1('0x5'));var sox=require(_0x1fb1('0x6'));var csv=require('to-csv');var ejs=require(_0x1fb1('0x7'));var fs=require('fs');var fs_extra=require(_0x1fb1('0x8'));var _=require('lodash');var squel=require(_0x1fb1('0x9'));var crypto=require(_0x1fb1('0xa'));var jsforce=require(_0x1fb1('0xb'));var deskjs=require(_0x1fb1('0xc'));var toCsv=require(_0x1fb1('0xd'));var querystring=require(_0x1fb1('0xe'));var Papa=require(_0x1fb1('0xf'));var Redis=require(_0x1fb1('0x10'));var authService=require(_0x1fb1('0x11'));var qs=require(_0x1fb1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fb1('0x13'));var logger=require('../../config/logger')(_0x1fb1('0x14'));var utils=require('../../config/utils');var config=require(_0x1fb1('0x15'));var licenseUtil=require(_0x1fb1('0x16'));var db=require(_0x1fb1('0x17'))['db'];function respondWithStatusCode(_0x10bcac,_0x333229){_0x333229=_0x333229||0xcc;return function(_0x14f290){if(_0x14f290){return _0x10bcac['sendStatus'](_0x333229);}return _0x10bcac[_0x1fb1('0x18')](_0x333229)[_0x1fb1('0x19')]();};}function respondWithResult(_0x2c5be1,_0x44f24c){_0x44f24c=_0x44f24c||0xc8;return function(_0xd83038){if(_0xd83038){return _0x2c5be1[_0x1fb1('0x18')](_0x44f24c)[_0x1fb1('0x1a')](_0xd83038);}};}function respondWithFilteredResult(_0x316fe5,_0x358b58){return function(_0x4cbe42){if(_0x4cbe42){var _0x5c8d23=typeof _0x358b58[_0x1fb1('0x1b')]===_0x1fb1('0x1c')&&typeof _0x358b58[_0x1fb1('0x1d')]==='undefined';var _0x161ca3=_0x4cbe42[_0x1fb1('0x1e')];var _0x24d4df=_0x5c8d23?0x0:_0x358b58[_0x1fb1('0x1b')];var _0x33c6b6=_0x5c8d23?_0x4cbe42[_0x1fb1('0x1e')]:_0x358b58[_0x1fb1('0x1b')]+_0x358b58[_0x1fb1('0x1d')];var _0x4041ea;if(_0x33c6b6>=_0x161ca3){_0x33c6b6=_0x161ca3;_0x4041ea=0xc8;}else{_0x4041ea=0xce;}_0x316fe5['status'](_0x4041ea);return _0x316fe5[_0x1fb1('0x1f')]('Content-Range',_0x24d4df+'-'+_0x33c6b6+'/'+_0x161ca3)['json'](_0x4cbe42);}return null;};}function patchUpdates(_0xdf9c1b){return function(_0x313d9a){try{jsonpatch[_0x1fb1('0x20')](_0x313d9a,_0xdf9c1b,!![]);}catch(_0x54ad97){return BPromise[_0x1fb1('0x21')](_0x54ad97);}return _0x313d9a['save']();};}function saveUpdates(_0x5c76f5,_0x532c63){return function(_0x31178c){if(_0x31178c){return _0x31178c[_0x1fb1('0x22')](_0x5c76f5)[_0x1fb1('0x23')](function(_0x10924f){return _0x10924f;});}return null;};}function removeEntity(_0x303a06,_0x53b8af){return function(_0x4272c7){if(_0x4272c7){return _0x4272c7[_0x1fb1('0x24')]()[_0x1fb1('0x23')](function(){var _0x5fc9e6=_0x4272c7[_0x1fb1('0x25')]({'plain':!![]});var _0x1353a4=_0x1fb1('0x26');return db[_0x1fb1('0x27')]['destroy']({'where':{'type':_0x1353a4,'resourceId':_0x5fc9e6['id']}})[_0x1fb1('0x23')](function(){return _0x4272c7;});})[_0x1fb1('0x23')](function(){_0x303a06[_0x1fb1('0x18')](0xcc)[_0x1fb1('0x19')]();});}};}function handleEntityNotFound(_0x1898e7,_0x29e1bd){return function(_0x1a74c4){if(!_0x1a74c4){_0x1898e7[_0x1fb1('0x28')](0x194);}return _0x1a74c4;};}function handleError(_0xa7bba,_0x33a3b7){_0x33a3b7=_0x33a3b7||0x1f4;return function(_0x5e99e7){logger[_0x1fb1('0x29')](_0x5e99e7[_0x1fb1('0x2a')]);if(_0x5e99e7[_0x1fb1('0x2b')]){delete _0x5e99e7[_0x1fb1('0x2b')];}_0xa7bba['status'](_0x33a3b7)[_0x1fb1('0x2c')](_0x5e99e7);};}exports[_0x1fb1('0x2d')]=function(_0x90d8ef,_0x1b71cb){var _0x5402e9={},_0x245f84={},_0x30c8eb={'count':0x0,'rows':[]};var _0x5d45a5=_[_0x1fb1('0x2e')](db['ContactItemType']['rawAttributes'],function(_0x354e92){return{'name':_0x354e92[_0x1fb1('0x2f')],'type':_0x354e92['type'][_0x1fb1('0x30')]};});_0x245f84[_0x1fb1('0x31')]=_[_0x1fb1('0x2e')](_0x5d45a5,_0x1fb1('0x2b'));_0x245f84[_0x1fb1('0x32')]=_['keys'](_0x90d8ef[_0x1fb1('0x32')]);_0x245f84[_0x1fb1('0x33')]=_[_0x1fb1('0x34')](_0x245f84[_0x1fb1('0x31')],_0x245f84[_0x1fb1('0x32')]);_0x5402e9[_0x1fb1('0x35')]=_[_0x1fb1('0x34')](_0x245f84[_0x1fb1('0x31')],qs[_0x1fb1('0x36')](_0x90d8ef['query'][_0x1fb1('0x36')]));_0x5402e9['attributes']=_0x5402e9[_0x1fb1('0x35')]['length']?_0x5402e9[_0x1fb1('0x35')]:_0x245f84['model'];if(!_0x90d8ef['query'][_0x1fb1('0x37')](_0x1fb1('0x38'))){_0x5402e9[_0x1fb1('0x1d')]=qs[_0x1fb1('0x1d')](_0x90d8ef['query'][_0x1fb1('0x1d')]);_0x5402e9[_0x1fb1('0x1b')]=qs[_0x1fb1('0x1b')](_0x90d8ef['query'][_0x1fb1('0x1b')]);}_0x5402e9[_0x1fb1('0x39')]=qs[_0x1fb1('0x3a')](_0x90d8ef[_0x1fb1('0x32')][_0x1fb1('0x3a')]);_0x5402e9[_0x1fb1('0x3b')]=qs[_0x1fb1('0x33')](_['pick'](_0x90d8ef[_0x1fb1('0x32')],_0x245f84[_0x1fb1('0x33')]),_0x5d45a5);if(_0x90d8ef['query'][_0x1fb1('0x3c')]){_0x5402e9['where']=_[_0x1fb1('0x3d')](_0x5402e9[_0x1fb1('0x3b')],{'$or':_[_0x1fb1('0x2e')](_0x5d45a5,function(_0x439eec){if(_0x439eec[_0x1fb1('0x3e')]!==_0x1fb1('0x3f')){var _0x927301={};_0x927301[_0x439eec[_0x1fb1('0x2b')]]={'$like':'%'+_0x90d8ef[_0x1fb1('0x32')][_0x1fb1('0x3c')]+'%'};return _0x927301;}})});}_0x5402e9=_[_0x1fb1('0x3d')]({},_0x5402e9,_0x90d8ef[_0x1fb1('0x40')]);var _0xafc9a7={'where':_0x5402e9[_0x1fb1('0x3b')]};return db[_0x1fb1('0x41')]['count'](_0xafc9a7)[_0x1fb1('0x23')](function(_0xca1fd3){_0x30c8eb[_0x1fb1('0x1e')]=_0xca1fd3;if(_0x90d8ef[_0x1fb1('0x32')]['includeAll']){_0x5402e9['include']=[{'all':!![]}];}return db[_0x1fb1('0x41')][_0x1fb1('0x42')](_0x5402e9);})[_0x1fb1('0x23')](function(_0x3edc8a){_0x30c8eb[_0x1fb1('0x43')]=_0x3edc8a;return _0x30c8eb;})[_0x1fb1('0x23')](respondWithFilteredResult(_0x1b71cb,_0x5402e9))[_0x1fb1('0x44')](handleError(_0x1b71cb,null));};exports[_0x1fb1('0x45')]=function(_0x14aa27,_0x320bda){var _0x4a943c={'raw':!![],'where':{'id':_0x14aa27['params']['id']}},_0x44ccbe={};_0x44ccbe['model']=_[_0x1fb1('0x46')](db[_0x1fb1('0x41')][_0x1fb1('0x47')]);_0x44ccbe[_0x1fb1('0x32')]=_['keys'](_0x14aa27['query']);_0x44ccbe[_0x1fb1('0x33')]=_[_0x1fb1('0x34')](_0x44ccbe[_0x1fb1('0x31')],_0x44ccbe[_0x1fb1('0x32')]);_0x4a943c[_0x1fb1('0x35')]=_[_0x1fb1('0x34')](_0x44ccbe[_0x1fb1('0x31')],qs[_0x1fb1('0x36')](_0x14aa27[_0x1fb1('0x32')]['fields']));_0x4a943c['attributes']=_0x4a943c[_0x1fb1('0x35')]['length']?_0x4a943c[_0x1fb1('0x35')]:_0x44ccbe[_0x1fb1('0x31')];if(_0x14aa27[_0x1fb1('0x32')][_0x1fb1('0x48')]){_0x4a943c[_0x1fb1('0x49')]=[{'all':!![]}];}_0x4a943c=_[_0x1fb1('0x3d')]({},_0x4a943c,_0x14aa27['options']);return db[_0x1fb1('0x41')][_0x1fb1('0x4a')](_0x4a943c)[_0x1fb1('0x23')](handleEntityNotFound(_0x320bda,null))['then'](respondWithResult(_0x320bda,null))[_0x1fb1('0x44')](handleError(_0x320bda,null));};exports['create']=function(_0x6e105b,_0xba4fa7){return db[_0x1fb1('0x41')]['create'](_0x6e105b[_0x1fb1('0x4b')],{})[_0x1fb1('0x23')](function(_0x52271f){var _0xe492ab=_0x6e105b[_0x1fb1('0x4c')][_0x1fb1('0x25')]({'plain':!![]});if(!_0xe492ab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe492ab['role']==='user'){var _0x31a85a=_0x52271f[_0x1fb1('0x25')]({'plain':!![]});var _0x1e2754=_0x1fb1('0x26');return db[_0x1fb1('0x4d')][_0x1fb1('0x4a')]({'where':{'name':_0x1e2754,'userProfileId':_0xe492ab['userProfileId']},'raw':!![]})['then'](function(_0x267c36){if(_0x267c36&&_0x267c36[_0x1fb1('0x4e')]===0x0){return db[_0x1fb1('0x27')][_0x1fb1('0x4f')]({'name':_0x31a85a['name'],'resourceId':_0x31a85a['id'],'type':_0x267c36['name'],'sectionId':_0x267c36['id']},{})[_0x1fb1('0x23')](function(){return _0x52271f;});}else{return _0x52271f;}})['catch'](function(_0x41fefb){logger['error'](_0x1fb1('0x50'),_0x41fefb);throw _0x41fefb;});}return _0x52271f;})['then'](respondWithResult(_0xba4fa7,0xc9))[_0x1fb1('0x44')](handleError(_0xba4fa7,null));};exports[_0x1fb1('0x22')]=function(_0x1475ee,_0xca9395){if(_0x1475ee[_0x1fb1('0x4b')]['id']){delete _0x1475ee['body']['id'];}return db['ContactItemType'][_0x1fb1('0x4a')]({'where':{'id':_0x1475ee[_0x1fb1('0x51')]['id']}})['then'](handleEntityNotFound(_0xca9395,null))['then'](saveUpdates(_0x1475ee[_0x1fb1('0x4b')],null))[_0x1fb1('0x23')](respondWithResult(_0xca9395,null))[_0x1fb1('0x44')](handleError(_0xca9395,null));};exports[_0x1fb1('0x24')]=function(_0x439670,_0xc9e8d4){return db['ContactItemType'][_0x1fb1('0x4a')]({'where':{'id':_0x439670[_0x1fb1('0x51')]['id']}})[_0x1fb1('0x23')](handleEntityNotFound(_0xc9e8d4,null))[_0x1fb1('0x23')](db[_0x1fb1('0x52')][_0x1fb1('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x439670[_0x1fb1('0x51')]['id']}}))['then'](removeEntity(_0xc9e8d4,null))[_0x1fb1('0x44')](handleError(_0xc9e8d4,null));}; \ No newline at end of file +var _0x1a37=['includeAll','include','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','autoAssociation','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','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','ContactItemType','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x1a37,0xb4));var _0x71a3=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x1a37[_0x15c421];return _0x5e5ed5;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){var _0xb9c195=_0x5f33c5[_0x71a3('0x26')]({'plain':!![]});var _0xb0f3aa='ContactItemTypes';return db[_0x71a3('0x27')][_0x71a3('0x25')]({'where':{'type':_0xb0f3aa,'resourceId':_0xb9c195['id']}})['then'](function(){return _0x5f33c5;});})[_0x71a3('0x24')](function(){_0x452bc4['status'](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0x2fd3b6,_0x211ea8){return function(_0x35b5c7){if(!_0x35b5c7){_0x2fd3b6[_0x71a3('0x18')](0x194);}return _0x35b5c7;};}function handleError(_0x314439,_0x2317ec){_0x2317ec=_0x2317ec||0x1f4;return function(_0x242b85){logger[_0x71a3('0x28')](_0x242b85[_0x71a3('0x29')]);if(_0x242b85[_0x71a3('0x2a')]){delete _0x242b85[_0x71a3('0x2a')];}_0x314439['status'](_0x2317ec)[_0x71a3('0x2b')](_0x242b85);};}exports[_0x71a3('0x2c')]=function(_0x334db0,_0x23ae85){var _0x4a750c={},_0x18a8fe={},_0x216d84={'count':0x0,'rows':[]};var _0x45d13d=_[_0x71a3('0x2d')](db[_0x71a3('0x2e')][_0x71a3('0x2f')],function(_0x1d09bd){return{'name':_0x1d09bd['fieldName'],'type':_0x1d09bd[_0x71a3('0x30')][_0x71a3('0x31')]};});_0x18a8fe[_0x71a3('0x32')]=_[_0x71a3('0x2d')](_0x45d13d,_0x71a3('0x2a'));_0x18a8fe[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x334db0[_0x71a3('0x33')]);_0x18a8fe[_0x71a3('0x35')]=_[_0x71a3('0x36')](_0x18a8fe[_0x71a3('0x32')],_0x18a8fe[_0x71a3('0x33')]);_0x4a750c[_0x71a3('0x37')]=_['intersection'](_0x18a8fe['model'],qs[_0x71a3('0x38')](_0x334db0[_0x71a3('0x33')]['fields']));_0x4a750c[_0x71a3('0x37')]=_0x4a750c[_0x71a3('0x37')]['length']?_0x4a750c[_0x71a3('0x37')]:_0x18a8fe[_0x71a3('0x32')];if(!_0x334db0[_0x71a3('0x33')][_0x71a3('0x39')](_0x71a3('0x3a'))){_0x4a750c[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x334db0['query'][_0x71a3('0x1d')]);_0x4a750c[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x334db0['query'][_0x71a3('0x1b')]);}_0x4a750c[_0x71a3('0x3b')]=qs[_0x71a3('0x3c')](_0x334db0[_0x71a3('0x33')][_0x71a3('0x3c')]);_0x4a750c['where']=qs['filters'](_[_0x71a3('0x3d')](_0x334db0[_0x71a3('0x33')],_0x18a8fe[_0x71a3('0x35')]),_0x45d13d);if(_0x334db0[_0x71a3('0x33')][_0x71a3('0x3e')]){_0x4a750c['where']=_[_0x71a3('0x3f')](_0x4a750c[_0x71a3('0x40')],{'$or':_[_0x71a3('0x2d')](_0x45d13d,function(_0x58b833){if(_0x58b833[_0x71a3('0x30')]!=='VIRTUAL'){var _0x3edeff={};_0x3edeff[_0x58b833[_0x71a3('0x2a')]]={'$like':'%'+_0x334db0[_0x71a3('0x33')][_0x71a3('0x3e')]+'%'};return _0x3edeff;}})});}_0x4a750c=_[_0x71a3('0x3f')]({},_0x4a750c,_0x334db0[_0x71a3('0x41')]);var _0x468ca4={'where':_0x4a750c[_0x71a3('0x40')]};return db[_0x71a3('0x2e')][_0x71a3('0x1e')](_0x468ca4)['then'](function(_0xa49846){_0x216d84['count']=_0xa49846;if(_0x334db0[_0x71a3('0x33')][_0x71a3('0x42')]){_0x4a750c[_0x71a3('0x43')]=[{'all':!![]}];}return db[_0x71a3('0x2e')]['findAll'](_0x4a750c);})[_0x71a3('0x24')](function(_0x4b4fde){_0x216d84['rows']=_0x4b4fde;return _0x216d84;})[_0x71a3('0x24')](respondWithFilteredResult(_0x23ae85,_0x4a750c))[_0x71a3('0x44')](handleError(_0x23ae85,null));};exports[_0x71a3('0x45')]=function(_0x1dc34b,_0x519242){var _0x248a04={'raw':!![],'where':{'id':_0x1dc34b[_0x71a3('0x46')]['id']}},_0x615c6f={};_0x615c6f[_0x71a3('0x32')]=_[_0x71a3('0x34')](db[_0x71a3('0x2e')][_0x71a3('0x2f')]);_0x615c6f[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x1dc34b[_0x71a3('0x33')]);_0x615c6f[_0x71a3('0x35')]=_[_0x71a3('0x36')](_0x615c6f[_0x71a3('0x32')],_0x615c6f[_0x71a3('0x33')]);_0x248a04[_0x71a3('0x37')]=_[_0x71a3('0x36')](_0x615c6f['model'],qs[_0x71a3('0x38')](_0x1dc34b[_0x71a3('0x33')]['fields']));_0x248a04[_0x71a3('0x37')]=_0x248a04[_0x71a3('0x37')][_0x71a3('0x47')]?_0x248a04[_0x71a3('0x37')]:_0x615c6f[_0x71a3('0x32')];if(_0x1dc34b['query']['includeAll']){_0x248a04[_0x71a3('0x43')]=[{'all':!![]}];}_0x248a04=_[_0x71a3('0x3f')]({},_0x248a04,_0x1dc34b['options']);return db[_0x71a3('0x2e')][_0x71a3('0x48')](_0x248a04)[_0x71a3('0x24')](handleEntityNotFound(_0x519242,null))[_0x71a3('0x24')](respondWithResult(_0x519242,null))[_0x71a3('0x44')](handleError(_0x519242,null));};exports[_0x71a3('0x49')]=function(_0x501a62,_0x1c9ba6){return db['ContactItemType'][_0x71a3('0x49')](_0x501a62[_0x71a3('0x4a')],{})[_0x71a3('0x24')](function(_0x2f3f19){var _0x32e313=_0x501a62['user'][_0x71a3('0x26')]({'plain':!![]});if(!_0x32e313)throw new Error(_0x71a3('0x4b'));if(_0x32e313[_0x71a3('0x4c')]==='user'){var _0x6c34=_0x2f3f19['get']({'plain':!![]});var _0x278e11=_0x71a3('0x4d');return db['UserProfileSection'][_0x71a3('0x48')]({'where':{'name':_0x278e11,'userProfileId':_0x32e313[_0x71a3('0x4e')]},'raw':!![]})[_0x71a3('0x24')](function(_0x384f38){if(_0x384f38&&_0x384f38[_0x71a3('0x4f')]===0x0){return db[_0x71a3('0x27')][_0x71a3('0x49')]({'name':_0x6c34['name'],'resourceId':_0x6c34['id'],'type':_0x384f38[_0x71a3('0x2a')],'sectionId':_0x384f38['id']},{})['then'](function(){return _0x2f3f19;});}else{return _0x2f3f19;}})[_0x71a3('0x44')](function(_0x480e90){logger[_0x71a3('0x28')](_0x71a3('0x50'),_0x480e90);throw _0x480e90;});}return _0x2f3f19;})[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,0xc9))[_0x71a3('0x44')](handleError(_0x1c9ba6,null));};exports['update']=function(_0x54b80f,_0x1e13ae){if(_0x54b80f[_0x71a3('0x4a')]['id']){delete _0x54b80f[_0x71a3('0x4a')]['id'];}return db[_0x71a3('0x2e')]['find']({'where':{'id':_0x54b80f['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1e13ae,null))[_0x71a3('0x24')](saveUpdates(_0x54b80f[_0x71a3('0x4a')],null))[_0x71a3('0x24')](respondWithResult(_0x1e13ae,null))[_0x71a3('0x44')](handleError(_0x1e13ae,null));};exports['destroy']=function(_0x421b6a,_0x3379cb){return db[_0x71a3('0x2e')][_0x71a3('0x48')]({'where':{'id':_0x421b6a[_0x71a3('0x46')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x3379cb,null))[_0x71a3('0x24')](db[_0x71a3('0x51')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x421b6a[_0x71a3('0x46')]['id']}}))[_0x71a3('0x24')](removeEntity(_0x3379cb,null))[_0x71a3('0x44')](handleError(_0x3379cb,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index a0ce7db..f5c1b79 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 _0x3f15=['exports','define','ContactItemType','tools_contact_item_types','lodash','../../config/logger','api','bluebird','../../config/environment','./contactItemType.attributes'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x3f15,0x1ee));var _0x53f1=function(_0x1ed25f,_0x126919){_0x1ed25f=_0x1ed25f-0x0;var _0x420506=_0x3f15[_0x1ed25f];return _0x420506;};'use strict';var _=require(_0x53f1('0x0'));var util=require('util');var logger=require(_0x53f1('0x1'))(_0x53f1('0x2'));var moment=require('moment');var BPromise=require(_0x53f1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x53f1('0x4'));var attributes=require(_0x53f1('0x5'));module[_0x53f1('0x6')]=function(_0x17427e,_0x55383b){return _0x17427e[_0x53f1('0x7')](_0x53f1('0x8'),attributes,{'tableName':_0x53f1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea6f=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./contactItemType.attributes','exports','tools_contact_item_types','lodash'];(function(_0x3ed4c3,_0x2d9151){var _0x40b9ff=function(_0x38e9c2){while(--_0x38e9c2){_0x3ed4c3['push'](_0x3ed4c3['shift']());}};_0x40b9ff(++_0x2d9151);}(_0xea6f,0xfc));var _0xfea6=function(_0x1b8878,_0x51e48d){_0x1b8878=_0x1b8878-0x0;var _0x26915f=_0xea6f[_0x1b8878];return _0x26915f;};'use strict';var _=require(_0xfea6('0x0'));var util=require(_0xfea6('0x1'));var logger=require(_0xfea6('0x2'))(_0xfea6('0x3'));var moment=require('moment');var BPromise=require(_0xfea6('0x4'));var rp=require(_0xfea6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfea6('0x6'));var config=require(_0xfea6('0x7'));var attributes=require(_0xfea6('0x8'));module[_0xfea6('0x9')]=function(_0x21afa3,_0x4b715f){return _0x21afa3['define']('ContactItemType',attributes,{'tableName':_0xfea6('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 d7fbfe0..78f0cbc 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 _0x5a1c=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','randomstring','../../mysqldb'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0x9e8285,_0x9ac973){_0x9e8285=_0x9e8285-0x0;var _0xf8a837=_0x5a1c[_0x9e8285];return _0xf8a837;};'use strict';var _=require(_0xc5a1('0x0'));var util=require(_0xc5a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc5a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5a1('0x3'))['db'];var utils=require(_0xc5a1('0x4'));var logger=require(_0xc5a1('0x5'))(_0xc5a1('0x6'));var config=require('../../config/environment');var jayson=require(_0xc5a1('0x7'));var client=jayson[_0xc5a1('0x8')][_0xc5a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5782b9,_0x46fd25,_0x159ed5){return new BPromise(function(_0x1ce1df,_0x111921){return client[_0xc5a1('0xa')](_0x5782b9,_0x159ed5)[_0xc5a1('0xb')](function(_0x28234b){logger[_0xc5a1('0xc')](_0xc5a1('0xd'),_0x46fd25,_0xc5a1('0xe'));logger[_0xc5a1('0xf')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x46fd25,_0xc5a1('0xe'),JSON[_0xc5a1('0x10')](_0x28234b));if(_0x28234b['error']){if(_0x28234b['error'][_0xc5a1('0x11')]===0x1f4){logger['error'](_0xc5a1('0xd'),_0x46fd25,_0x28234b[_0xc5a1('0x12')][_0xc5a1('0x13')]);return _0x111921(_0x28234b[_0xc5a1('0x12')]['message']);}logger[_0xc5a1('0x12')]('ContactItemType,\x20%s,\x20%s',_0x46fd25,_0x28234b[_0xc5a1('0x12')]['message']);return _0x1ce1df(_0x28234b[_0xc5a1('0x12')][_0xc5a1('0x13')]);}else{logger[_0xc5a1('0xc')](_0xc5a1('0xd'),_0x46fd25,_0xc5a1('0xe'));_0x1ce1df(_0x28234b['result'][_0xc5a1('0x13')]);}})[_0xc5a1('0x14')](function(_0x1a8e41){logger[_0xc5a1('0x12')](_0xc5a1('0xd'),_0x46fd25,_0x1a8e41);_0x111921(_0x1a8e41);});});} \ No newline at end of file +var _0x223e=['../../config/logger','rpc','client','http','request','then','info','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','ContactItemType,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1a992e,_0x48b674){var _0x289563=function(_0x5d3182){while(--_0x5d3182){_0x1a992e['push'](_0x1a992e['shift']());}};_0x289563(++_0x48b674);}(_0x223e,0x1b1));var _0xe223=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x223e[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0xe223('0x0'));var util=require(_0xe223('0x1'));var moment=require(_0xe223('0x2'));var BPromise=require('bluebird');var rs=require(_0xe223('0x3'));var fs=require('fs');var Redis=require(_0xe223('0x4'));var db=require(_0xe223('0x5'))['db'];var utils=require(_0xe223('0x6'));var logger=require(_0xe223('0x7'))(_0xe223('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe223('0x9')][_0xe223('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a8891,_0x24fdd9,_0x366d9b){return new BPromise(function(_0x4cffbb,_0x4370e1){return client[_0xe223('0xb')](_0x4a8891,_0x366d9b)[_0xe223('0xc')](function(_0x42d99a){logger[_0xe223('0xd')]('ContactItemType,\x20%s,\x20%s',_0x24fdd9,_0xe223('0xe'));logger['debug'](_0xe223('0xf'),_0x24fdd9,_0xe223('0xe'),JSON[_0xe223('0x10')](_0x42d99a));if(_0x42d99a[_0xe223('0x11')]){if(_0x42d99a[_0xe223('0x11')]['code']===0x1f4){logger[_0xe223('0x11')](_0xe223('0x12'),_0x24fdd9,_0x42d99a[_0xe223('0x11')][_0xe223('0x13')]);return _0x4370e1(_0x42d99a[_0xe223('0x11')][_0xe223('0x13')]);}logger[_0xe223('0x11')]('ContactItemType,\x20%s,\x20%s',_0x24fdd9,_0x42d99a[_0xe223('0x11')][_0xe223('0x13')]);return _0x4cffbb(_0x42d99a[_0xe223('0x11')][_0xe223('0x13')]);}else{logger['info']('ContactItemType,\x20%s,\x20%s',_0x24fdd9,_0xe223('0xe'));_0x4cffbb(_0x42d99a['result'][_0xe223('0x13')]);}})['catch'](function(_0x746d36){logger['error']('ContactItemType,\x20%s,\x20%s',_0x24fdd9,_0x746d36);_0x4370e1(_0x746d36);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 7c27bef..907e8d9 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 _0x6930=['create','put','/:id','update','destroy','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','show','post'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x6930,0x148));var _0x0693=function(_0x4ac7ae,_0xb482ac){_0x4ac7ae=_0x4ac7ae-0x0;var _0x2f778c=_0x6930[_0x4ac7ae];return _0x2f778c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0693('0x0'));var timeout=require('connect-timeout');var express=require(_0x0693('0x1'));var router=express['Router']();var fs_extra=require(_0x0693('0x2'));var auth=require(_0x0693('0x3'));var interaction=require(_0x0693('0x4'));var config=require(_0x0693('0x5'));var controller=require(_0x0693('0x6'));router[_0x0693('0x7')]('/',auth[_0x0693('0x8')](),controller[_0x0693('0x9')]);router['get']('/:id',auth[_0x0693('0x8')](),controller[_0x0693('0xa')]);router[_0x0693('0xb')]('/',auth[_0x0693('0x8')](),controller[_0x0693('0xc')]);router[_0x0693('0xd')](_0x0693('0xe'),auth[_0x0693('0x8')](),controller[_0x0693('0xf')]);router['delete'](_0x0693('0xe'),auth[_0x0693('0x8')](),controller[_0x0693('0x10')]);module['exports']=router; \ No newline at end of file +var _0x8d94=['../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','show','post','create','/:id','update','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x3f51b3,_0x44776c){var _0x80e74e=function(_0x52c585){while(--_0x52c585){_0x3f51b3['push'](_0x3f51b3['shift']());}};_0x80e74e(++_0x44776c);}(_0x8d94,0x93));var _0x48d9=function(_0x1426e8,_0x135409){_0x1426e8=_0x1426e8-0x0;var _0x51c753=_0x8d94[_0x1426e8];return _0x51c753;};'use strict';var multer=require(_0x48d9('0x0'));var util=require(_0x48d9('0x1'));var path=require(_0x48d9('0x2'));var timeout=require(_0x48d9('0x3'));var express=require(_0x48d9('0x4'));var router=express['Router']();var fs_extra=require(_0x48d9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x48d9('0x6'));var config=require(_0x48d9('0x7'));var controller=require(_0x48d9('0x8'));router[_0x48d9('0x9')]('/',auth[_0x48d9('0xa')](),controller['index']);router[_0x48d9('0x9')]('/:id',auth[_0x48d9('0xa')](),controller[_0x48d9('0xb')]);router[_0x48d9('0xc')]('/',auth[_0x48d9('0xa')](),controller[_0x48d9('0xd')]);router['put'](_0x48d9('0xe'),auth[_0x48d9('0xa')](),controller[_0x48d9('0xf')]);router['delete']('/:id',auth[_0x48d9('0xa')](),controller['destroy']);module[_0x48d9('0x10')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 6ee10e9..581b542 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(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xb7e7[_0x3305de];return _0x3b5a84;};'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 _0xd8b0=['exports','sequelize'];(function(_0x20c817,_0xa3f533){var _0xdcb9f9=function(_0x9be020){while(--_0x9be020){_0x20c817['push'](_0x20c817['shift']());}};_0xdcb9f9(++_0xa3f533);}(_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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 71b3a53..68a223f 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 _0xbd20=['attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','voice','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','error','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','keys','options','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','body','createdAt','updatedAt','create','user','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter'];(function(_0x4052c0,_0x4271ab){var _0x296f04=function(_0x5373fc){while(--_0x5373fc){_0x4052c0['push'](_0x4052c0['shift']());}};_0x296f04(++_0x4271ab);}(_0xbd20,0x1ae));var _0x0bd2=function(_0x562ec2,_0x33932b){_0x562ec2=_0x562ec2-0x0;var _0xd3a205=_0xbd20[_0x562ec2];return _0xd3a205;};'use strict';var emlformat=require(_0x0bd2('0x0'));var rimraf=require(_0x0bd2('0x1'));var zipdir=require(_0x0bd2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd2('0x3'));var moment=require('moment');var BPromise=require(_0x0bd2('0x4'));var Mustache=require(_0x0bd2('0x5'));var util=require(_0x0bd2('0x6'));var path=require(_0x0bd2('0x7'));var sox=require(_0x0bd2('0x8'));var csv=require(_0x0bd2('0x9'));var ejs=require(_0x0bd2('0xa'));var fs=require('fs');var fs_extra=require(_0x0bd2('0xb'));var _=require('lodash');var squel=require(_0x0bd2('0xc'));var crypto=require(_0x0bd2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0bd2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0bd2('0xf'));var Papa=require(_0x0bd2('0x10'));var Redis=require(_0x0bd2('0x11'));var authService=require(_0x0bd2('0x12'));var qs=require(_0x0bd2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bd2('0x14'))(_0x0bd2('0x15'));var utils=require(_0x0bd2('0x16'));var config=require(_0x0bd2('0x17'));var licenseUtil=require(_0x0bd2('0x18'));var db=require('../../mysqldb')['db'];config[_0x0bd2('0x19')]=_[_0x0bd2('0x1a')](config['redis'],{'host':_0x0bd2('0x1b'),'port':0x18eb});var socket=require(_0x0bd2('0x1c'))(new Redis(config[_0x0bd2('0x19')]));require(_0x0bd2('0x1d'))[_0x0bd2('0x1e')](socket);function respondWithStatusCode(_0x4eee22,_0x1d30b5){_0x1d30b5=_0x1d30b5||0xcc;return function(_0x26f76a){if(_0x26f76a){return _0x4eee22[_0x0bd2('0x1f')](_0x1d30b5);}return _0x4eee22[_0x0bd2('0x20')](_0x1d30b5)['end']();};}function respondWithResult(_0x5b2609,_0x3d3e92){_0x3d3e92=_0x3d3e92||0xc8;return function(_0x206205){if(_0x206205){return _0x5b2609['status'](_0x3d3e92)[_0x0bd2('0x21')](_0x206205);}};}function respondWithFilteredResult(_0x203bf2,_0x1166d1){return function(_0xdefa60){if(_0xdefa60){var _0x29319f=typeof _0x1166d1[_0x0bd2('0x22')]===_0x0bd2('0x23')&&typeof _0x1166d1['limit']===_0x0bd2('0x23');var _0xf576bc=_0xdefa60[_0x0bd2('0x24')];var _0xa4dd22=_0x29319f?0x0:_0x1166d1[_0x0bd2('0x22')];var _0x3c264a=_0x29319f?_0xdefa60[_0x0bd2('0x24')]:_0x1166d1['offset']+_0x1166d1[_0x0bd2('0x25')];var _0xac933a;if(_0x3c264a>=_0xf576bc){_0x3c264a=_0xf576bc;_0xac933a=0xc8;}else{_0xac933a=0xce;}_0x203bf2[_0x0bd2('0x20')](_0xac933a);return _0x203bf2[_0x0bd2('0x26')]('Content-Range',_0xa4dd22+'-'+_0x3c264a+'/'+_0xf576bc)[_0x0bd2('0x21')](_0xdefa60);}return null;};}function patchUpdates(_0x5a6689){return function(_0x31176d){try{jsonpatch[_0x0bd2('0x27')](_0x31176d,_0x5a6689,!![]);}catch(_0x14e769){return BPromise[_0x0bd2('0x28')](_0x14e769);}return _0x31176d[_0x0bd2('0x29')]();};}function saveUpdates(_0x435645,_0x481753){return function(_0x2390d9){if(_0x2390d9){return _0x2390d9[_0x0bd2('0x2a')](_0x435645)[_0x0bd2('0x2b')](function(_0x577d77){return _0x577d77;});}return null;};}function removeEntity(_0x209713,_0x133dff){return function(_0x3b5199){if(_0x3b5199){return _0x3b5199[_0x0bd2('0x2c')]()[_0x0bd2('0x2b')](function(){var _0x2386aa=_0x3b5199[_0x0bd2('0x2d')]({'plain':!![]});var _0x307ed2=_0x0bd2('0x2e');return db[_0x0bd2('0x2f')][_0x0bd2('0x2c')]({'where':{'type':_0x307ed2,'resourceId':_0x2386aa['id']}})[_0x0bd2('0x2b')](function(){return _0x3b5199;});})[_0x0bd2('0x2b')](function(){_0x209713['status'](0xcc)[_0x0bd2('0x30')]();});}};}function handleEntityNotFound(_0x38ceb7,_0x4ddb55){return function(_0x2ae348){if(!_0x2ae348){_0x38ceb7[_0x0bd2('0x1f')](0x194);}return _0x2ae348;};}function handleError(_0x219381,_0x14359b){_0x14359b=_0x14359b||0x1f4;return function(_0x2db83e){logger[_0x0bd2('0x31')](_0x2db83e['stack']);if(_0x2db83e[_0x0bd2('0x32')]){delete _0x2db83e[_0x0bd2('0x32')];}_0x219381[_0x0bd2('0x20')](_0x14359b)[_0x0bd2('0x33')](_0x2db83e);};}exports[_0x0bd2('0x34')]=function(_0x9eca0c,_0x239293){var _0x5b5448={},_0x2c9cbe={},_0x499b2b={'count':0x0,'rows':[]};var _0x421d07=_[_0x0bd2('0x35')](db[_0x0bd2('0x36')][_0x0bd2('0x37')],function(_0x192bd1){return{'name':_0x192bd1[_0x0bd2('0x38')],'type':_0x192bd1['type'][_0x0bd2('0x39')]};});_0x2c9cbe[_0x0bd2('0x3a')]=_[_0x0bd2('0x35')](_0x421d07,_0x0bd2('0x32'));_0x2c9cbe['query']=_['keys'](_0x9eca0c['query']);_0x2c9cbe[_0x0bd2('0x3b')]=_[_0x0bd2('0x3c')](_0x2c9cbe[_0x0bd2('0x3a')],_0x2c9cbe[_0x0bd2('0x3d')]);_0x5b5448['attributes']=_[_0x0bd2('0x3c')](_0x2c9cbe['model'],qs[_0x0bd2('0x3e')](_0x9eca0c['query']['fields']));_0x5b5448[_0x0bd2('0x3f')]=_0x5b5448[_0x0bd2('0x3f')][_0x0bd2('0x40')]?_0x5b5448[_0x0bd2('0x3f')]:_0x2c9cbe[_0x0bd2('0x3a')];if(!_0x9eca0c['query'][_0x0bd2('0x41')](_0x0bd2('0x42'))){_0x5b5448[_0x0bd2('0x25')]=qs['limit'](_0x9eca0c['query'][_0x0bd2('0x25')]);_0x5b5448[_0x0bd2('0x22')]=qs[_0x0bd2('0x22')](_0x9eca0c[_0x0bd2('0x3d')]['offset']);}_0x5b5448[_0x0bd2('0x43')]=qs[_0x0bd2('0x44')](_0x9eca0c[_0x0bd2('0x3d')][_0x0bd2('0x44')]);_0x5b5448[_0x0bd2('0x45')]=qs['filters'](_[_0x0bd2('0x46')](_0x9eca0c[_0x0bd2('0x3d')],_0x2c9cbe[_0x0bd2('0x3b')]),_0x421d07);if(_0x9eca0c[_0x0bd2('0x3d')][_0x0bd2('0x47')]){_0x5b5448['where']=_[_0x0bd2('0x48')](_0x5b5448[_0x0bd2('0x45')],{'$or':_[_0x0bd2('0x35')](_0x421d07,function(_0x38b0f3){if(_0x38b0f3[_0x0bd2('0x49')]!==_0x0bd2('0x4a')){var _0x29ffef={};_0x29ffef[_0x38b0f3[_0x0bd2('0x32')]]={'$like':'%'+_0x9eca0c[_0x0bd2('0x3d')][_0x0bd2('0x47')]+'%'};return _0x29ffef;}})});}_0x5b5448=_['merge']({},_0x5b5448,_0x9eca0c['options']);var _0x359022={'where':_0x5b5448[_0x0bd2('0x45')]};return db[_0x0bd2('0x36')][_0x0bd2('0x24')](_0x359022)['then'](function(_0x751c12){_0x499b2b[_0x0bd2('0x24')]=_0x751c12;if(_0x9eca0c[_0x0bd2('0x3d')][_0x0bd2('0x4b')]){_0x5b5448[_0x0bd2('0x4c')]=[{'all':!![]}];}return db[_0x0bd2('0x36')]['findAll'](_0x5b5448);})[_0x0bd2('0x2b')](function(_0x39a353){_0x499b2b[_0x0bd2('0x4d')]=_0x39a353;return _0x499b2b;})[_0x0bd2('0x2b')](respondWithFilteredResult(_0x239293,_0x5b5448))[_0x0bd2('0x4e')](handleError(_0x239293,null));};exports[_0x0bd2('0x4f')]=function(_0x593964,_0xb888e){var _0x3046d4={'raw':![],'where':{'id':_0x593964['params']['id']}},_0x1e8c89={};_0x1e8c89[_0x0bd2('0x3a')]=_[_0x0bd2('0x50')](db['Dashboard'][_0x0bd2('0x37')]);_0x1e8c89[_0x0bd2('0x3d')]=_[_0x0bd2('0x50')](_0x593964[_0x0bd2('0x3d')]);_0x1e8c89[_0x0bd2('0x3b')]=_[_0x0bd2('0x3c')](_0x1e8c89[_0x0bd2('0x3a')],_0x1e8c89[_0x0bd2('0x3d')]);_0x3046d4[_0x0bd2('0x3f')]=_[_0x0bd2('0x3c')](_0x1e8c89[_0x0bd2('0x3a')],qs[_0x0bd2('0x3e')](_0x593964[_0x0bd2('0x3d')][_0x0bd2('0x3e')]));_0x3046d4['attributes']=_0x3046d4['attributes'][_0x0bd2('0x40')]?_0x3046d4['attributes']:_0x1e8c89[_0x0bd2('0x3a')];if(_0x593964[_0x0bd2('0x3d')]['includeAll']){_0x3046d4[_0x0bd2('0x4c')]=[{'all':!![]}];}_0x3046d4=_[_0x0bd2('0x48')]({},_0x3046d4,_0x593964[_0x0bd2('0x51')]);return db[_0x0bd2('0x36')][_0x0bd2('0x52')](_0x3046d4)[_0x0bd2('0x2b')](handleEntityNotFound(_0xb888e,null))[_0x0bd2('0x2b')](respondWithResult(_0xb888e,null))[_0x0bd2('0x4e')](handleError(_0xb888e,null));};exports['create']=function(_0x2e66d1,_0xf3765){return db['Dashboard']['create'](_0x2e66d1['body'],{})[_0x0bd2('0x2b')](function(_0x30fcfe){var _0x4f9dd8=_0x2e66d1['user'][_0x0bd2('0x2d')]({'plain':!![]});if(!_0x4f9dd8)throw new Error(_0x0bd2('0x53'));if(_0x4f9dd8[_0x0bd2('0x54')]==='user'){var _0x3c511f=_0x30fcfe[_0x0bd2('0x2d')]({'plain':!![]});var _0x1743c2=_0x0bd2('0x2e');return db[_0x0bd2('0x55')][_0x0bd2('0x52')]({'where':{'name':_0x1743c2,'userProfileId':_0x4f9dd8['userProfileId']},'raw':!![]})[_0x0bd2('0x2b')](function(_0x12cc1c){if(_0x12cc1c&&_0x12cc1c[_0x0bd2('0x56')]===0x0){return db[_0x0bd2('0x2f')]['create']({'name':_0x3c511f[_0x0bd2('0x32')],'resourceId':_0x3c511f['id'],'type':_0x12cc1c['name'],'sectionId':_0x12cc1c['id']},{})['then'](function(){return _0x30fcfe;});}else{return _0x30fcfe;}})[_0x0bd2('0x4e')](function(_0x56ce7d){logger['error'](_0x0bd2('0x57'),_0x56ce7d);throw _0x56ce7d;});}return _0x30fcfe;})[_0x0bd2('0x2b')](respondWithResult(_0xf3765,0xc9))[_0x0bd2('0x4e')](handleError(_0xf3765,null));};exports[_0x0bd2('0x58')]=function(_0x5d7bd3,_0x59f6e2){var _0x32dd62={'where':{'id':_0x5d7bd3[_0x0bd2('0x59')]['id']}},_0xd885f6={};_0xd885f6[_0x0bd2('0x3a')]=_[_0x0bd2('0x50')](db[_0x0bd2('0x36')][_0x0bd2('0x37')]);_0x32dd62[_0x0bd2('0x3f')]=_[_0x0bd2('0x3c')](_0xd885f6['model'],qs['fields'](_0x5d7bd3['query'][_0x0bd2('0x3e')]));_0x32dd62['attributes']=_0x32dd62['attributes'][_0x0bd2('0x40')]?_0x32dd62['attributes']:_0xd885f6[_0x0bd2('0x3a')];if(_0x5d7bd3[_0x0bd2('0x3d')][_0x0bd2('0x4b')]){_0x32dd62[_0x0bd2('0x4c')]=[{'all':!![]}];}_0x32dd62=_[_0x0bd2('0x48')]({},_0x32dd62,_0x5d7bd3[_0x0bd2('0x51')]);return db[_0x0bd2('0x36')]['find'](_0x32dd62)['then'](handleEntityNotFound(_0x59f6e2,null))['then'](function(_0x3b1323){if(_0x3b1323){var _0x399e25=_0x3b1323[_0x0bd2('0x2d')]({'plain':!![]});_0x399e25=qs[_0x0bd2('0x5a')](_0x399e25,['id','createdAt','updatedAt']);_0x5d7bd3[_0x0bd2('0x5b')]=_[_0x0bd2('0x5a')](_0x5d7bd3['body'],['id',_0x0bd2('0x5c'),_0x0bd2('0x5d')]);return db[_0x0bd2('0x36')][_0x0bd2('0x5e')](_[_0x0bd2('0x48')](_0x399e25,_0x5d7bd3['body']),{'include':_0x5d7bd3['query']['includeAll']?[{'all':!![]}]:undefined})[_0x0bd2('0x2b')](function(_0x6b9ce){var _0x2da628=_0x5d7bd3[_0x0bd2('0x5f')][_0x0bd2('0x2d')]({'plain':!![]});if(!_0x2da628)throw new Error(_0x0bd2('0x53'));if(_0x2da628[_0x0bd2('0x54')]===_0x0bd2('0x5f')){var _0x592594=_0x6b9ce[_0x0bd2('0x2d')]({'plain':!![]});var _0x26330b=_0x0bd2('0x2e');return db[_0x0bd2('0x55')][_0x0bd2('0x52')]({'where':{'name':_0x26330b,'userProfileId':_0x2da628[_0x0bd2('0x60')]},'raw':!![]})[_0x0bd2('0x2b')](function(_0xa99668){if(_0xa99668&&_0xa99668[_0x0bd2('0x56')]===0x0){return db[_0x0bd2('0x2f')][_0x0bd2('0x5e')]({'name':_0x592594['name'],'resourceId':_0x592594['id'],'type':_0xa99668['name'],'sectionId':_0xa99668['id']},{})[_0x0bd2('0x2b')](function(){return _0x6b9ce;});}else{return _0x6b9ce;}})['catch'](function(_0x2a8630){logger[_0x0bd2('0x31')](_0x0bd2('0x57'),_0x2a8630);throw _0x2a8630;});}return _0x6b9ce;});}})[_0x0bd2('0x2b')](respondWithResult(_0x59f6e2,0xc9))['catch'](handleError(_0x59f6e2,null));};exports[_0x0bd2('0x2a')]=function(_0x409278,_0x1af5a1){if(_0x409278['body']['id']){delete _0x409278['body']['id'];}return db['Dashboard'][_0x0bd2('0x52')]({'where':{'id':_0x409278[_0x0bd2('0x59')]['id']}})[_0x0bd2('0x2b')](handleEntityNotFound(_0x1af5a1,null))[_0x0bd2('0x2b')](saveUpdates(_0x409278[_0x0bd2('0x5b')],null))['then'](respondWithResult(_0x1af5a1,null))['catch'](handleError(_0x1af5a1,null));};exports[_0x0bd2('0x2c')]=function(_0x407984,_0x1c33e7){return db[_0x0bd2('0x36')][_0x0bd2('0x52')]({'where':{'id':_0x407984[_0x0bd2('0x59')]['id']}})[_0x0bd2('0x2b')](handleEntityNotFound(_0x1c33e7,null))['then'](removeEntity(_0x1c33e7,null))['catch'](handleError(_0x1c33e7,null));};function widgetAttributes(_0x4e3884){try{switch(_0x4e3884[_0x0bd2('0x49')]){case _0x0bd2('0x61'):return[{'name':_0x0bd2('0x62'),'value':_0x4e3884[_0x0bd2('0x62')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x0]?_0x4e3884[_0x0bd2('0x63')][0x0][_0x0bd2('0x64')]:undefined)||_0x0bd2('0x65')}];case _0x0bd2('0x66'):return[{'name':'attrPath','value':_0x4e3884[_0x0bd2('0x67')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x0]?_0x4e3884[_0x0bd2('0x63')][0x0][_0x0bd2('0x64')]:undefined)||''}];case _0x0bd2('0x68'):return[{'name':_0x0bd2('0x69'),'value':_0x4e3884['attrHourFormat']||(_0x4e3884['attrs']&&_0x4e3884[_0x0bd2('0x63')][0x0]?_0x4e3884[_0x0bd2('0x63')][0x0][_0x0bd2('0x64')]:undefined)||'HH:mm:ss'},{'name':_0x0bd2('0x6a'),'value':_0x4e3884['attrTimezone']||(_0x4e3884['attrs']&&_0x4e3884[_0x0bd2('0x63')][0x1]?_0x4e3884[_0x0bd2('0x63')][0x1][_0x0bd2('0x64')]:undefined)||_0x0bd2('0x6b')},{'name':_0x0bd2('0x6c'),'value':_0x4e3884['attrFontSize']||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884['attrs'][0x2]?_0x4e3884[_0x0bd2('0x63')][0x2][_0x0bd2('0x64')]:undefined)||0xc}];case _0x0bd2('0x6d'):return[{'name':_0x0bd2('0x6e'),'value':_0x4e3884[_0x0bd2('0x6e')]||(_0x4e3884['attrs']&&_0x4e3884[_0x0bd2('0x63')][0x0]?_0x4e3884[_0x0bd2('0x63')][0x0][_0x0bd2('0x64')]:undefined)||_0x0bd2('0x6f')},{'name':_0x0bd2('0x70'),'value':_0x4e3884['attrVoiceQueues']||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x1]?_0x4e3884[_0x0bd2('0x63')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x4e3884['attrFontSize']||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x2]?_0x4e3884[_0x0bd2('0x63')][0x2][_0x0bd2('0x64')]:undefined)||0x14},{'name':_0x0bd2('0x71'),'value':_0x4e3884[_0x0bd2('0x71')]||(_0x4e3884['attrs']&&_0x4e3884[_0x0bd2('0x63')][0x3]?_0x4e3884[_0x0bd2('0x63')][0x3][_0x0bd2('0x64')]:undefined)||'voice'},{'name':_0x0bd2('0x72'),'value':_0x4e3884[_0x0bd2('0x72')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x4]?_0x4e3884[_0x0bd2('0x63')][0x4][_0x0bd2('0x64')]:undefined)||''},{'name':_0x0bd2('0x73'),'value':_0x4e3884[_0x0bd2('0x73')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x5]?_0x4e3884[_0x0bd2('0x63')][0x5]['value']:undefined)||''},{'name':_0x0bd2('0x74'),'value':_0x4e3884[_0x0bd2('0x74')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884['attrs'][0x6]?_0x4e3884[_0x0bd2('0x63')][0x6][_0x0bd2('0x64')]:undefined)||''},{'name':_0x0bd2('0x75'),'value':_0x4e3884['attrOpenchannelAccounts']||(_0x4e3884['attrs']&&_0x4e3884[_0x0bd2('0x63')][0x7]?_0x4e3884[_0x0bd2('0x63')][0x7][_0x0bd2('0x64')]:undefined)||''},{'name':_0x0bd2('0x76'),'value':_0x4e3884['attrWhatsappAccounts']||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884['attrs'][0x8]?_0x4e3884[_0x0bd2('0x63')][0x8][_0x0bd2('0x64')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4e3884[_0x0bd2('0x77')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x9]?_0x4e3884[_0x0bd2('0x63')][0x9]['value']:undefined)||''}];case _0x0bd2('0x78'):case _0x0bd2('0x79'):return[{'name':_0x0bd2('0x7a'),'value':_0x4e3884[_0x0bd2('0x7a')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x0]?_0x4e3884[_0x0bd2('0x63')][0x0][_0x0bd2('0x64')]:undefined)||_0x0bd2('0x6f')},{'name':_0x0bd2('0x7b'),'value':_0x4e3884[_0x0bd2('0x7b')]||(_0x4e3884['attrs']&&_0x4e3884[_0x0bd2('0x63')][0x1]?_0x4e3884[_0x0bd2('0x63')][0x1][_0x0bd2('0x64')]:undefined)||null},{'name':'attrSerie3','value':_0x4e3884['attrSerie3']||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884['attrs'][0x2]?_0x4e3884['attrs'][0x2]['value']:undefined)||null},{'name':_0x0bd2('0x70'),'value':_0x4e3884[_0x0bd2('0x70')]||(_0x4e3884['attrs']&&_0x4e3884[_0x0bd2('0x63')][0x3]?_0x4e3884[_0x0bd2('0x63')][0x3][_0x0bd2('0x64')]:undefined)||[]},{'name':_0x0bd2('0x71'),'value':_0x4e3884['attrChannel']||(_0x4e3884['attrs']&&_0x4e3884[_0x0bd2('0x63')][0x4]?_0x4e3884[_0x0bd2('0x63')][0x4][_0x0bd2('0x64')]:undefined)||_0x0bd2('0x7c')},{'name':_0x0bd2('0x72'),'value':_0x4e3884[_0x0bd2('0x72')]||(_0x4e3884['attrs']&&_0x4e3884[_0x0bd2('0x63')][0x5]?_0x4e3884[_0x0bd2('0x63')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x4e3884[_0x0bd2('0x73')]||(_0x4e3884['attrs']&&_0x4e3884[_0x0bd2('0x63')][0x6]?_0x4e3884[_0x0bd2('0x63')][0x6][_0x0bd2('0x64')]:undefined)||''},{'name':_0x0bd2('0x74'),'value':_0x4e3884[_0x0bd2('0x74')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x7]?_0x4e3884[_0x0bd2('0x63')][0x7]['value']:undefined)||''},{'name':_0x0bd2('0x75'),'value':_0x4e3884[_0x0bd2('0x75')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x8]?_0x4e3884[_0x0bd2('0x63')][0x8][_0x0bd2('0x64')]:undefined)||''},{'name':_0x0bd2('0x76'),'value':_0x4e3884[_0x0bd2('0x76')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x9]?_0x4e3884[_0x0bd2('0x63')][0x9][_0x0bd2('0x64')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4e3884[_0x0bd2('0x77')]||(_0x4e3884['attrs']&&_0x4e3884[_0x0bd2('0x63')][0xa]?_0x4e3884[_0x0bd2('0x63')][0xa][_0x0bd2('0x64')]:undefined)||''}];case _0x0bd2('0x7d'):return[{'name':'attrReport','type':_0x4e3884[_0x0bd2('0x7e')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x0]?_0x4e3884[_0x0bd2('0x63')][0x0][_0x0bd2('0x49')]:undefined)||null,'value':_0x4e3884[_0x0bd2('0x7f')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x0]?_0x4e3884['attrs'][0x0][_0x0bd2('0x64')]:undefined)||null},{'name':_0x0bd2('0x80'),'value':_0x4e3884[_0x0bd2('0x80')]||(_0x4e3884[_0x0bd2('0x63')]&&_0x4e3884[_0x0bd2('0x63')][0x1]?_0x4e3884[_0x0bd2('0x63')][0x1][_0x0bd2('0x64')]:undefined)||0x0}];default:return[];}}catch(_0xde7ce8){logger[_0x0bd2('0x31')](_0x0bd2('0x81'),JSON['stringify'](_0xde7ce8));return[];}}exports[_0x0bd2('0x82')]=function(_0x1458c2,_0x35b3bb,_0x53517f){if(_0x1458c2[_0x0bd2('0x5b')]['id']){delete _0x1458c2[_0x0bd2('0x5b')]['id'];}return db[_0x0bd2('0x36')][_0x0bd2('0x52')]({'where':{'id':_0x1458c2[_0x0bd2('0x59')]['id']}})[_0x0bd2('0x2b')](handleEntityNotFound(_0x35b3bb,null))[_0x0bd2('0x2b')](function(_0x32fa1a){if(_0x32fa1a){_0x1458c2[_0x0bd2('0x5b')][_0x0bd2('0x83')]=_0x32fa1a['id'];_0x1458c2['body'][_0x0bd2('0x63')]=widgetAttributes(_0x1458c2['body']);return db[_0x0bd2('0x84')][_0x0bd2('0x5e')](_0x1458c2[_0x0bd2('0x5b')]);}})['then'](respondWithResult(_0x35b3bb,null))['catch'](handleError(_0x35b3bb,null));};exports[_0x0bd2('0x85')]=function(_0x211a9e,_0x332809,_0x27e559){var _0xa9507e={};var _0x3c088d={};var _0x56eb0a;var _0x14e4dd;return db[_0x0bd2('0x36')][_0x0bd2('0x86')]({'where':{'id':_0x211a9e[_0x0bd2('0x59')]['id']}})[_0x0bd2('0x2b')](handleEntityNotFound(_0x332809,null))[_0x0bd2('0x2b')](function(_0x2c7c15){if(_0x2c7c15){_0x56eb0a=_0x2c7c15;_0x3c088d[_0x0bd2('0x3a')]=_[_0x0bd2('0x50')](db[_0x0bd2('0x84')][_0x0bd2('0x37')]);_0x3c088d[_0x0bd2('0x3d')]=_[_0x0bd2('0x50')](_0x211a9e[_0x0bd2('0x3d')]);_0x3c088d[_0x0bd2('0x3b')]=_['intersection'](_0x3c088d['model'],_0x3c088d[_0x0bd2('0x3d')]);_0xa9507e[_0x0bd2('0x3f')]=_[_0x0bd2('0x3c')](_0x3c088d['model'],qs[_0x0bd2('0x3e')](_0x211a9e[_0x0bd2('0x3d')][_0x0bd2('0x3e')]));_0xa9507e[_0x0bd2('0x3f')]=_0xa9507e[_0x0bd2('0x3f')]['length']?_0xa9507e['attributes']:_0x3c088d[_0x0bd2('0x3a')];_0xa9507e[_0x0bd2('0x43')]=qs[_0x0bd2('0x44')](_0x211a9e[_0x0bd2('0x3d')][_0x0bd2('0x44')]);_0xa9507e[_0x0bd2('0x45')]=qs[_0x0bd2('0x3b')](_[_0x0bd2('0x46')](_0x211a9e['query'],_0x3c088d[_0x0bd2('0x3b')]));if(_0x211a9e[_0x0bd2('0x3d')][_0x0bd2('0x47')]){_0xa9507e[_0x0bd2('0x45')]=_[_0x0bd2('0x48')](_0xa9507e[_0x0bd2('0x45')],{'$or':_[_0x0bd2('0x35')](_0xa9507e[_0x0bd2('0x3f')],function(_0x4c4c41){var _0x934161={};_0x934161[_0x4c4c41]={'$like':'%'+_0x211a9e[_0x0bd2('0x3d')][_0x0bd2('0x47')]+'%'};return _0x934161;})});}_0xa9507e=_[_0x0bd2('0x48')]({},_0xa9507e,_0x211a9e[_0x0bd2('0x51')]);return _0x56eb0a['getItems'](_0xa9507e);}})[_0x0bd2('0x2b')](function(_0x5d94a2){if(_0x5d94a2){_0x14e4dd=_0x5d94a2['length'];if(!_0x211a9e[_0x0bd2('0x3d')][_0x0bd2('0x41')](_0x0bd2('0x42'))){_0xa9507e[_0x0bd2('0x25')]=qs[_0x0bd2('0x25')](_0x211a9e[_0x0bd2('0x3d')]['limit']);_0xa9507e[_0x0bd2('0x22')]=qs[_0x0bd2('0x22')](_0x211a9e[_0x0bd2('0x3d')][_0x0bd2('0x22')]);}return _0x56eb0a['getItems'](_0xa9507e);}})[_0x0bd2('0x2b')](function(_0x51e6eb){if(_0x51e6eb){return _0x51e6eb?{'count':_0x14e4dd,'rows':_0x51e6eb}:null;}})[_0x0bd2('0x2b')](respondWithResult(_0x332809,null))[_0x0bd2('0x4e')](handleError(_0x332809,null));}; \ No newline at end of file +var _0x196b=['zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','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','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','name','send','Dashboard','rawAttributes','type','key','map','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','create','UserProfileSection','iframe','attrUrl','attrs','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','pick','eml-format','rimraf'];(function(_0x34b06c,_0x4f5ba7){var _0x48dadc=function(_0x30544b){while(--_0x30544b){_0x34b06c['push'](_0x34b06c['shift']());}};_0x48dadc(++_0x4f5ba7);}(_0x196b,0x106));var _0xb196=function(_0x25650b,_0x15dc2b){_0x25650b=_0x25650b-0x0;var _0x515fc5=_0x196b[_0x25650b];return _0x515fc5;};'use strict';var emlformat=require(_0xb196('0x0'));var rimraf=require(_0xb196('0x1'));var zipdir=require(_0xb196('0x2'));var jsonpatch=require(_0xb196('0x3'));var rp=require(_0xb196('0x4'));var moment=require(_0xb196('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb196('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb196('0x7'));var csv=require('to-csv');var ejs=require(_0xb196('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb196('0x9'));var squel=require(_0xb196('0xa'));var crypto=require(_0xb196('0xb'));var jsforce=require(_0xb196('0xc'));var deskjs=require(_0xb196('0xd'));var toCsv=require(_0xb196('0xe'));var querystring=require(_0xb196('0xf'));var Papa=require(_0xb196('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb196('0x11'));var as=require(_0xb196('0x12'));var hardwareService=require(_0xb196('0x13'));var logger=require(_0xb196('0x14'))(_0xb196('0x15'));var utils=require(_0xb196('0x16'));var config=require(_0xb196('0x17'));var licenseUtil=require(_0xb196('0x18'));var db=require('../../mysqldb')['db'];config[_0xb196('0x19')]=_[_0xb196('0x1a')](config['redis'],{'host':_0xb196('0x1b'),'port':0x18eb});var socket=require(_0xb196('0x1c'))(new Redis(config[_0xb196('0x19')]));require(_0xb196('0x1d'))[_0xb196('0x1e')](socket);function respondWithStatusCode(_0x4061df,_0x4fdd83){_0x4fdd83=_0x4fdd83||0xcc;return function(_0x4b2c81){if(_0x4b2c81){return _0x4061df[_0xb196('0x1f')](_0x4fdd83);}return _0x4061df[_0xb196('0x20')](_0x4fdd83)[_0xb196('0x21')]();};}function respondWithResult(_0x5a66ae,_0x4fe16f){_0x4fe16f=_0x4fe16f||0xc8;return function(_0x5c0f5e){if(_0x5c0f5e){return _0x5a66ae[_0xb196('0x20')](_0x4fe16f)[_0xb196('0x22')](_0x5c0f5e);}};}function respondWithFilteredResult(_0x199921,_0x5d5744){return function(_0x4c35d5){if(_0x4c35d5){var _0x2f4054=typeof _0x5d5744[_0xb196('0x23')]===_0xb196('0x24')&&typeof _0x5d5744['limit']==='undefined';var _0x55f372=_0x4c35d5[_0xb196('0x25')];var _0x2bfedc=_0x2f4054?0x0:_0x5d5744[_0xb196('0x23')];var _0x1ca77c=_0x2f4054?_0x4c35d5[_0xb196('0x25')]:_0x5d5744[_0xb196('0x23')]+_0x5d5744[_0xb196('0x26')];var _0x4669b1;if(_0x1ca77c>=_0x55f372){_0x1ca77c=_0x55f372;_0x4669b1=0xc8;}else{_0x4669b1=0xce;}_0x199921[_0xb196('0x20')](_0x4669b1);return _0x199921[_0xb196('0x27')](_0xb196('0x28'),_0x2bfedc+'-'+_0x1ca77c+'/'+_0x55f372)['json'](_0x4c35d5);}return null;};}function patchUpdates(_0x58f3d9){return function(_0x309abc){try{jsonpatch[_0xb196('0x29')](_0x309abc,_0x58f3d9,!![]);}catch(_0x5b576a){return BPromise[_0xb196('0x2a')](_0x5b576a);}return _0x309abc[_0xb196('0x2b')]();};}function saveUpdates(_0x151344,_0x52fec8){return function(_0x428d58){if(_0x428d58){return _0x428d58[_0xb196('0x2c')](_0x151344)[_0xb196('0x2d')](function(_0x54916a){return _0x54916a;});}return null;};}function removeEntity(_0x564ed3,_0x1b3993){return function(_0xbbc592){if(_0xbbc592){return _0xbbc592['destroy']()[_0xb196('0x2d')](function(){var _0x7310c8=_0xbbc592[_0xb196('0x2e')]({'plain':!![]});var _0x18a3c3='CustomDashboards';return db[_0xb196('0x2f')][_0xb196('0x30')]({'where':{'type':_0x18a3c3,'resourceId':_0x7310c8['id']}})[_0xb196('0x2d')](function(){return _0xbbc592;});})[_0xb196('0x2d')](function(){_0x564ed3[_0xb196('0x20')](0xcc)[_0xb196('0x21')]();});}};}function handleEntityNotFound(_0x29ddce,_0x12ea5c){return function(_0x5cb58f){if(!_0x5cb58f){_0x29ddce[_0xb196('0x1f')](0x194);}return _0x5cb58f;};}function handleError(_0x4d1bd9,_0x3589ed){_0x3589ed=_0x3589ed||0x1f4;return function(_0x1ede28){logger['error'](_0x1ede28['stack']);if(_0x1ede28[_0xb196('0x31')]){delete _0x1ede28[_0xb196('0x31')];}_0x4d1bd9[_0xb196('0x20')](_0x3589ed)[_0xb196('0x32')](_0x1ede28);};}exports['index']=function(_0x3f0b00,_0x77d753){var _0x143e00={},_0x568c79={},_0x14cc0c={'count':0x0,'rows':[]};var _0x241a01=_['map'](db[_0xb196('0x33')][_0xb196('0x34')],function(_0x3a8688){return{'name':_0x3a8688['fieldName'],'type':_0x3a8688[_0xb196('0x35')][_0xb196('0x36')]};});_0x568c79['model']=_[_0xb196('0x37')](_0x241a01,_0xb196('0x31'));_0x568c79['query']=_[_0xb196('0x38')](_0x3f0b00[_0xb196('0x39')]);_0x568c79[_0xb196('0x3a')]=_['intersection'](_0x568c79[_0xb196('0x3b')],_0x568c79[_0xb196('0x39')]);_0x143e00[_0xb196('0x3c')]=_[_0xb196('0x3d')](_0x568c79[_0xb196('0x3b')],qs['fields'](_0x3f0b00[_0xb196('0x39')][_0xb196('0x3e')]));_0x143e00[_0xb196('0x3c')]=_0x143e00['attributes']['length']?_0x143e00[_0xb196('0x3c')]:_0x568c79[_0xb196('0x3b')];if(!_0x3f0b00['query'][_0xb196('0x3f')](_0xb196('0x40'))){_0x143e00[_0xb196('0x26')]=qs[_0xb196('0x26')](_0x3f0b00[_0xb196('0x39')][_0xb196('0x26')]);_0x143e00[_0xb196('0x23')]=qs[_0xb196('0x23')](_0x3f0b00[_0xb196('0x39')]['offset']);}_0x143e00[_0xb196('0x41')]=qs[_0xb196('0x42')](_0x3f0b00[_0xb196('0x39')][_0xb196('0x42')]);_0x143e00['where']=qs[_0xb196('0x3a')](_['pick'](_0x3f0b00['query'],_0x568c79[_0xb196('0x3a')]),_0x241a01);if(_0x3f0b00[_0xb196('0x39')]['filter']){_0x143e00[_0xb196('0x43')]=_[_0xb196('0x44')](_0x143e00['where'],{'$or':_[_0xb196('0x37')](_0x241a01,function(_0x5d8b46){if(_0x5d8b46[_0xb196('0x35')]!==_0xb196('0x45')){var _0x250866={};_0x250866[_0x5d8b46[_0xb196('0x31')]]={'$like':'%'+_0x3f0b00[_0xb196('0x39')][_0xb196('0x46')]+'%'};return _0x250866;}})});}_0x143e00=_[_0xb196('0x44')]({},_0x143e00,_0x3f0b00['options']);var _0x1b291c={'where':_0x143e00['where']};return db[_0xb196('0x33')][_0xb196('0x25')](_0x1b291c)['then'](function(_0x15ff5b){_0x14cc0c[_0xb196('0x25')]=_0x15ff5b;if(_0x3f0b00[_0xb196('0x39')][_0xb196('0x47')]){_0x143e00[_0xb196('0x48')]=[{'all':!![]}];}return db[_0xb196('0x33')][_0xb196('0x49')](_0x143e00);})['then'](function(_0x5a9da2){_0x14cc0c[_0xb196('0x4a')]=_0x5a9da2;return _0x14cc0c;})[_0xb196('0x2d')](respondWithFilteredResult(_0x77d753,_0x143e00))[_0xb196('0x4b')](handleError(_0x77d753,null));};exports['show']=function(_0x116883,_0xfb10e7){var _0x152d4e={'raw':![],'where':{'id':_0x116883[_0xb196('0x4c')]['id']}},_0x21e6d9={};_0x21e6d9[_0xb196('0x3b')]=_[_0xb196('0x38')](db['Dashboard'][_0xb196('0x34')]);_0x21e6d9[_0xb196('0x39')]=_[_0xb196('0x38')](_0x116883[_0xb196('0x39')]);_0x21e6d9['filters']=_['intersection'](_0x21e6d9[_0xb196('0x3b')],_0x21e6d9[_0xb196('0x39')]);_0x152d4e[_0xb196('0x3c')]=_['intersection'](_0x21e6d9[_0xb196('0x3b')],qs[_0xb196('0x3e')](_0x116883[_0xb196('0x39')]['fields']));_0x152d4e[_0xb196('0x3c')]=_0x152d4e['attributes']['length']?_0x152d4e['attributes']:_0x21e6d9[_0xb196('0x3b')];if(_0x116883['query'][_0xb196('0x47')]){_0x152d4e[_0xb196('0x48')]=[{'all':!![]}];}_0x152d4e=_[_0xb196('0x44')]({},_0x152d4e,_0x116883[_0xb196('0x4d')]);return db[_0xb196('0x33')][_0xb196('0x4e')](_0x152d4e)[_0xb196('0x2d')](handleEntityNotFound(_0xfb10e7,null))[_0xb196('0x2d')](respondWithResult(_0xfb10e7,null))[_0xb196('0x4b')](handleError(_0xfb10e7,null));};exports['create']=function(_0x36aecf,_0x1cb3b1){return db[_0xb196('0x33')]['create'](_0x36aecf[_0xb196('0x4f')],{})['then'](function(_0x1e4f72){var _0xbd758e=_0x36aecf[_0xb196('0x50')][_0xb196('0x2e')]({'plain':!![]});if(!_0xbd758e)throw new Error(_0xb196('0x51'));if(_0xbd758e[_0xb196('0x52')]===_0xb196('0x50')){var _0x594a11=_0x1e4f72['get']({'plain':!![]});var _0x2649b4=_0xb196('0x53');return db['UserProfileSection']['find']({'where':{'name':_0x2649b4,'userProfileId':_0xbd758e[_0xb196('0x54')]},'raw':!![]})[_0xb196('0x2d')](function(_0x441803){if(_0x441803&&_0x441803[_0xb196('0x55')]===0x0){return db[_0xb196('0x2f')]['create']({'name':_0x594a11[_0xb196('0x31')],'resourceId':_0x594a11['id'],'type':_0x441803[_0xb196('0x31')],'sectionId':_0x441803['id']},{})['then'](function(){return _0x1e4f72;});}else{return _0x1e4f72;}})[_0xb196('0x4b')](function(_0x4e04a9){logger[_0xb196('0x56')](_0xb196('0x57'),_0x4e04a9);throw _0x4e04a9;});}return _0x1e4f72;})[_0xb196('0x2d')](respondWithResult(_0x1cb3b1,0xc9))[_0xb196('0x4b')](handleError(_0x1cb3b1,null));};exports[_0xb196('0x58')]=function(_0xff27f5,_0x32403a){var _0x35706b={'where':{'id':_0xff27f5[_0xb196('0x4c')]['id']}},_0x27e76e={};_0x27e76e[_0xb196('0x3b')]=_[_0xb196('0x38')](db['Dashboard'][_0xb196('0x34')]);_0x35706b['attributes']=_[_0xb196('0x3d')](_0x27e76e[_0xb196('0x3b')],qs['fields'](_0xff27f5[_0xb196('0x39')][_0xb196('0x3e')]));_0x35706b['attributes']=_0x35706b[_0xb196('0x3c')][_0xb196('0x59')]?_0x35706b[_0xb196('0x3c')]:_0x27e76e['model'];if(_0xff27f5['query'][_0xb196('0x47')]){_0x35706b[_0xb196('0x48')]=[{'all':!![]}];}_0x35706b=_[_0xb196('0x44')]({},_0x35706b,_0xff27f5[_0xb196('0x4d')]);return db[_0xb196('0x33')][_0xb196('0x4e')](_0x35706b)[_0xb196('0x2d')](handleEntityNotFound(_0x32403a,null))[_0xb196('0x2d')](function(_0x3204c6){if(_0x3204c6){var _0x139e18=_0x3204c6[_0xb196('0x2e')]({'plain':!![]});_0x139e18=qs[_0xb196('0x5a')](_0x139e18,['id',_0xb196('0x5b'),_0xb196('0x5c')]);_0xff27f5['body']=_[_0xb196('0x5a')](_0xff27f5[_0xb196('0x4f')],['id',_0xb196('0x5b'),_0xb196('0x5c')]);return db['Dashboard'][_0xb196('0x5d')](_[_0xb196('0x44')](_0x139e18,_0xff27f5['body']),{'include':_0xff27f5[_0xb196('0x39')][_0xb196('0x47')]?[{'all':!![]}]:undefined})[_0xb196('0x2d')](function(_0x32914e){var _0x101c6e=_0xff27f5['user']['get']({'plain':!![]});if(!_0x101c6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x101c6e['role']===_0xb196('0x50')){var _0x3f97b0=_0x32914e[_0xb196('0x2e')]({'plain':!![]});var _0x124137=_0xb196('0x53');return db[_0xb196('0x5e')]['find']({'where':{'name':_0x124137,'userProfileId':_0x101c6e['userProfileId']},'raw':!![]})[_0xb196('0x2d')](function(_0x3e916c){if(_0x3e916c&&_0x3e916c[_0xb196('0x55')]===0x0){return db[_0xb196('0x2f')][_0xb196('0x5d')]({'name':_0x3f97b0['name'],'resourceId':_0x3f97b0['id'],'type':_0x3e916c[_0xb196('0x31')],'sectionId':_0x3e916c['id']},{})[_0xb196('0x2d')](function(){return _0x32914e;});}else{return _0x32914e;}})[_0xb196('0x4b')](function(_0x5e7c40){logger[_0xb196('0x56')](_0xb196('0x57'),_0x5e7c40);throw _0x5e7c40;});}return _0x32914e;});}})['then'](respondWithResult(_0x32403a,0xc9))[_0xb196('0x4b')](handleError(_0x32403a,null));};exports[_0xb196('0x2c')]=function(_0xbe931,_0x529d20){if(_0xbe931[_0xb196('0x4f')]['id']){delete _0xbe931[_0xb196('0x4f')]['id'];}return db[_0xb196('0x33')][_0xb196('0x4e')]({'where':{'id':_0xbe931[_0xb196('0x4c')]['id']}})[_0xb196('0x2d')](handleEntityNotFound(_0x529d20,null))['then'](saveUpdates(_0xbe931[_0xb196('0x4f')],null))[_0xb196('0x2d')](respondWithResult(_0x529d20,null))['catch'](handleError(_0x529d20,null));};exports[_0xb196('0x30')]=function(_0x3b9c2c,_0x4331eb){return db[_0xb196('0x33')][_0xb196('0x4e')]({'where':{'id':_0x3b9c2c[_0xb196('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4331eb,null))[_0xb196('0x2d')](removeEntity(_0x4331eb,null))['catch'](handleError(_0x4331eb,null));};function widgetAttributes(_0x4464ef){try{switch(_0x4464ef[_0xb196('0x35')]){case _0xb196('0x5f'):return[{'name':_0xb196('0x60'),'value':_0x4464ef[_0xb196('0x60')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0x0]?_0x4464ef[_0xb196('0x61')][0x0][_0xb196('0x62')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x4464ef['attrPath']||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef['attrs'][0x0]?_0x4464ef[_0xb196('0x61')][0x0]['value']:undefined)||''}];case _0xb196('0x63'):return[{'name':_0xb196('0x64'),'value':_0x4464ef[_0xb196('0x64')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0x0]?_0x4464ef[_0xb196('0x61')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x4464ef[_0xb196('0x65')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0x1]?_0x4464ef[_0xb196('0x61')][0x1][_0xb196('0x62')]:undefined)||_0xb196('0x66')},{'name':_0xb196('0x67'),'value':_0x4464ef[_0xb196('0x67')]||(_0x4464ef['attrs']&&_0x4464ef[_0xb196('0x61')][0x2]?_0x4464ef[_0xb196('0x61')][0x2]['value']:undefined)||0xc}];case _0xb196('0x68'):return[{'name':_0xb196('0x69'),'value':_0x4464ef['attrMetric']||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0x0]?_0x4464ef[_0xb196('0x61')][0x0][_0xb196('0x62')]:undefined)||_0xb196('0x6a')},{'name':_0xb196('0x6b'),'value':_0x4464ef[_0xb196('0x6b')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef['attrs'][0x1]?_0x4464ef[_0xb196('0x61')][0x1][_0xb196('0x62')]:undefined)||[]},{'name':_0xb196('0x67'),'value':_0x4464ef[_0xb196('0x67')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef['attrs'][0x2]?_0x4464ef[_0xb196('0x61')][0x2]['value']:undefined)||0x14},{'name':_0xb196('0x6c'),'value':_0x4464ef['attrChannel']||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef['attrs'][0x3]?_0x4464ef[_0xb196('0x61')][0x3][_0xb196('0x62')]:undefined)||_0xb196('0x6d')},{'name':_0xb196('0x6e'),'value':_0x4464ef[_0xb196('0x6e')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef['attrs'][0x4]?_0x4464ef[_0xb196('0x61')][0x4][_0xb196('0x62')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x4464ef[_0xb196('0x6f')]||(_0x4464ef['attrs']&&_0x4464ef[_0xb196('0x61')][0x5]?_0x4464ef['attrs'][0x5][_0xb196('0x62')]:undefined)||''},{'name':_0xb196('0x70'),'value':_0x4464ef['attrSmsAccounts']||(_0x4464ef['attrs']&&_0x4464ef[_0xb196('0x61')][0x6]?_0x4464ef[_0xb196('0x61')][0x6][_0xb196('0x62')]:undefined)||''},{'name':_0xb196('0x71'),'value':_0x4464ef[_0xb196('0x71')]||(_0x4464ef['attrs']&&_0x4464ef[_0xb196('0x61')][0x7]?_0x4464ef[_0xb196('0x61')][0x7][_0xb196('0x62')]:undefined)||''},{'name':_0xb196('0x72'),'value':_0x4464ef[_0xb196('0x72')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0x8]?_0x4464ef['attrs'][0x8][_0xb196('0x62')]:undefined)||''},{'name':_0xb196('0x73'),'value':_0x4464ef[_0xb196('0x73')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0x9]?_0x4464ef[_0xb196('0x61')][0x9][_0xb196('0x62')]:undefined)||''}];case _0xb196('0x74'):case _0xb196('0x75'):return[{'name':_0xb196('0x76'),'value':_0x4464ef['attrSerie1']||(_0x4464ef['attrs']&&_0x4464ef[_0xb196('0x61')][0x0]?_0x4464ef['attrs'][0x0][_0xb196('0x62')]:undefined)||_0xb196('0x6a')},{'name':_0xb196('0x77'),'value':_0x4464ef['attrSerie2']||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0x1]?_0x4464ef['attrs'][0x1][_0xb196('0x62')]:undefined)||null},{'name':'attrSerie3','value':_0x4464ef[_0xb196('0x78')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0x2]?_0x4464ef[_0xb196('0x61')][0x2]['value']:undefined)||null},{'name':_0xb196('0x6b'),'value':_0x4464ef[_0xb196('0x6b')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0x3]?_0x4464ef['attrs'][0x3][_0xb196('0x62')]:undefined)||[]},{'name':_0xb196('0x6c'),'value':_0x4464ef['attrChannel']||(_0x4464ef['attrs']&&_0x4464ef['attrs'][0x4]?_0x4464ef[_0xb196('0x61')][0x4][_0xb196('0x62')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x4464ef[_0xb196('0x6e')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef['attrs'][0x5]?_0x4464ef['attrs'][0x5][_0xb196('0x62')]:undefined)||''},{'name':_0xb196('0x6f'),'value':_0x4464ef[_0xb196('0x6f')]||(_0x4464ef['attrs']&&_0x4464ef[_0xb196('0x61')][0x6]?_0x4464ef[_0xb196('0x61')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x4464ef[_0xb196('0x70')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef['attrs'][0x7]?_0x4464ef[_0xb196('0x61')][0x7]['value']:undefined)||''},{'name':_0xb196('0x71'),'value':_0x4464ef[_0xb196('0x71')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0x8]?_0x4464ef['attrs'][0x8][_0xb196('0x62')]:undefined)||''},{'name':_0xb196('0x72'),'value':_0x4464ef[_0xb196('0x72')]||(_0x4464ef['attrs']&&_0x4464ef['attrs'][0x9]?_0x4464ef[_0xb196('0x61')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x4464ef['attrChatWebsites']||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0xa]?_0x4464ef[_0xb196('0x61')][0xa][_0xb196('0x62')]:undefined)||''}];case _0xb196('0x79'):return[{'name':'attrReport','type':_0x4464ef[_0xb196('0x7a')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef['attrs'][0x0]?_0x4464ef[_0xb196('0x61')][0x0][_0xb196('0x35')]:undefined)||null,'value':_0x4464ef[_0xb196('0x7b')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef[_0xb196('0x61')][0x0]?_0x4464ef[_0xb196('0x61')][0x0][_0xb196('0x62')]:undefined)||null},{'name':'attrRefresh','value':_0x4464ef[_0xb196('0x7c')]||(_0x4464ef[_0xb196('0x61')]&&_0x4464ef['attrs'][0x1]?_0x4464ef[_0xb196('0x61')][0x1][_0xb196('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x1a0b72){logger[_0xb196('0x56')](_0xb196('0x7d'),JSON[_0xb196('0x7e')](_0x1a0b72));return[];}}exports[_0xb196('0x7f')]=function(_0x5559b4,_0x49334e,_0x513ffe){if(_0x5559b4[_0xb196('0x4f')]['id']){delete _0x5559b4['body']['id'];}return db['Dashboard'][_0xb196('0x4e')]({'where':{'id':_0x5559b4['params']['id']}})[_0xb196('0x2d')](handleEntityNotFound(_0x49334e,null))['then'](function(_0x33dc69){if(_0x33dc69){_0x5559b4['body'][_0xb196('0x80')]=_0x33dc69['id'];_0x5559b4[_0xb196('0x4f')][_0xb196('0x61')]=widgetAttributes(_0x5559b4[_0xb196('0x4f')]);return db[_0xb196('0x81')]['create'](_0x5559b4[_0xb196('0x4f')]);}})[_0xb196('0x2d')](respondWithResult(_0x49334e,null))[_0xb196('0x4b')](handleError(_0x49334e,null));};exports[_0xb196('0x82')]=function(_0x4c1fb9,_0x595850,_0x10217d){var _0xd612d4={};var _0x36f7da={};var _0x1db4d2;var _0x1f7e6d;return db[_0xb196('0x33')]['findOne']({'where':{'id':_0x4c1fb9[_0xb196('0x4c')]['id']}})[_0xb196('0x2d')](handleEntityNotFound(_0x595850,null))[_0xb196('0x2d')](function(_0x2af87e){if(_0x2af87e){_0x1db4d2=_0x2af87e;_0x36f7da[_0xb196('0x3b')]=_[_0xb196('0x38')](db[_0xb196('0x81')]['rawAttributes']);_0x36f7da['query']=_[_0xb196('0x38')](_0x4c1fb9[_0xb196('0x39')]);_0x36f7da[_0xb196('0x3a')]=_[_0xb196('0x3d')](_0x36f7da[_0xb196('0x3b')],_0x36f7da[_0xb196('0x39')]);_0xd612d4[_0xb196('0x3c')]=_['intersection'](_0x36f7da[_0xb196('0x3b')],qs['fields'](_0x4c1fb9[_0xb196('0x39')][_0xb196('0x3e')]));_0xd612d4[_0xb196('0x3c')]=_0xd612d4[_0xb196('0x3c')][_0xb196('0x59')]?_0xd612d4[_0xb196('0x3c')]:_0x36f7da[_0xb196('0x3b')];_0xd612d4[_0xb196('0x41')]=qs[_0xb196('0x42')](_0x4c1fb9[_0xb196('0x39')]['sort']);_0xd612d4[_0xb196('0x43')]=qs['filters'](_[_0xb196('0x83')](_0x4c1fb9[_0xb196('0x39')],_0x36f7da['filters']));if(_0x4c1fb9[_0xb196('0x39')][_0xb196('0x46')]){_0xd612d4[_0xb196('0x43')]=_[_0xb196('0x44')](_0xd612d4[_0xb196('0x43')],{'$or':_[_0xb196('0x37')](_0xd612d4[_0xb196('0x3c')],function(_0x3ab209){var _0x379b34={};_0x379b34[_0x3ab209]={'$like':'%'+_0x4c1fb9[_0xb196('0x39')][_0xb196('0x46')]+'%'};return _0x379b34;})});}_0xd612d4=_[_0xb196('0x44')]({},_0xd612d4,_0x4c1fb9[_0xb196('0x4d')]);return _0x1db4d2[_0xb196('0x82')](_0xd612d4);}})[_0xb196('0x2d')](function(_0x117c96){if(_0x117c96){_0x1f7e6d=_0x117c96['length'];if(!_0x4c1fb9[_0xb196('0x39')][_0xb196('0x3f')](_0xb196('0x40'))){_0xd612d4[_0xb196('0x26')]=qs['limit'](_0x4c1fb9[_0xb196('0x39')][_0xb196('0x26')]);_0xd612d4['offset']=qs[_0xb196('0x23')](_0x4c1fb9['query'][_0xb196('0x23')]);}return _0x1db4d2[_0xb196('0x82')](_0xd612d4);}})[_0xb196('0x2d')](function(_0x3ad102){if(_0x3ad102){return _0x3ad102?{'count':_0x1f7e6d,'rows':_0x3ad102}:null;}})[_0xb196('0x2d')](respondWithResult(_0x595850,null))[_0xb196('0x4b')](handleError(_0x595850,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 5906040..fc03659 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 _0xec28=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x38c0fc,_0x7d0ca5){var _0x3e45ec=function(_0x29ee58){while(--_0x29ee58){_0x38c0fc['push'](_0x38c0fc['shift']());}};_0x3e45ec(++_0x7d0ca5);}(_0xec28,0x14a));var _0x8ec2=function(_0x47afba,_0x290a9d){_0x47afba=_0x47afba-0x0;var _0x55d7b4=_0xec28[_0x47afba];return _0x55d7b4;};'use strict';var EventEmitter=require(_0x8ec2('0x0'));var Dashboard=require(_0x8ec2('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8ec2('0x2')](0x0);var events={'afterCreate':_0x8ec2('0x3'),'afterUpdate':_0x8ec2('0x4'),'afterDestroy':_0x8ec2('0x5')};function emitEvent(_0x12de3c){return function(_0x129105,_0x1bc9e9,_0x107bf8){DashboardEvents[_0x8ec2('0x6')](_0x12de3c+':'+_0x129105['id'],_0x129105);DashboardEvents[_0x8ec2('0x6')](_0x12de3c,_0x129105);_0x107bf8(null);};}for(var e in events){if(events[_0x8ec2('0x7')](e)){var event=events[e];Dashboard[_0x8ec2('0x8')](e,emitEvent(event));}}module[_0x8ec2('0x9')]=DashboardEvents; \ No newline at end of file +var _0xb7d8=['exports','../../mysqldb','Dashboard','setMaxListeners','remove','emit','hook'];(function(_0x427759,_0x261b2d){var _0x3b2abc=function(_0x187311){while(--_0x187311){_0x427759['push'](_0x427759['shift']());}};_0x3b2abc(++_0x261b2d);}(_0xb7d8,0x197));var _0x8b7d=function(_0x2ef2cc,_0x321d97){_0x2ef2cc=_0x2ef2cc-0x0;var _0x107443=_0xb7d8[_0x2ef2cc];return _0x107443;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x8b7d('0x0'))['db'][_0x8b7d('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8b7d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8b7d('0x3')};function emitEvent(_0x3d8200){return function(_0x32e2e0,_0x493cb4,_0x2df603){DashboardEvents['emit'](_0x3d8200+':'+_0x32e2e0['id'],_0x32e2e0);DashboardEvents[_0x8b7d('0x4')](_0x3d8200,_0x32e2e0);_0x2df603(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x8b7d('0x5')](e,emitEvent(event));}}module[_0x8b7d('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 49f4969..b1266ed 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 _0xdaa7=['Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x337085,_0x5d1ab3){var _0x166cab=function(_0x4dd140){while(--_0x4dd140){_0x337085['push'](_0x337085['shift']());}};_0x166cab(++_0x5d1ab3);}(_0xdaa7,0x154));var _0x7daa=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0xdaa7[_0x492535];return _0x256620;};'use strict';var _=require(_0x7daa('0x0'));var util=require(_0x7daa('0x1'));var logger=require(_0x7daa('0x2'))(_0x7daa('0x3'));var moment=require(_0x7daa('0x4'));var BPromise=require(_0x7daa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7daa('0x6'));var rimraf=require(_0x7daa('0x7'));var config=require(_0x7daa('0x8'));var attributes=require(_0x7daa('0x9'));module[_0x7daa('0xa')]=function(_0x3dfafa,_0x59ff16){return _0x3dfafa['define'](_0x7daa('0xb'),attributes,{'tableName':_0x7daa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a2d=['define','dashboards','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x558d54,_0x2408de){var _0x4f92af=function(_0x4a3aa5){while(--_0x4a3aa5){_0x558d54['push'](_0x558d54['shift']());}};_0x4f92af(++_0x2408de);}(_0x6a2d,0x152));var _0xd6a2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6a2d[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xd6a2('0x0'));var util=require(_0xd6a2('0x1'));var logger=require(_0xd6a2('0x2'))(_0xd6a2('0x3'));var moment=require('moment');var BPromise=require(_0xd6a2('0x4'));var rp=require(_0xd6a2('0x5'));var fs=require('fs');var path=require(_0xd6a2('0x6'));var rimraf=require(_0xd6a2('0x7'));var config=require(_0xd6a2('0x8'));var attributes=require('./dashboard.attributes');module[_0xd6a2('0x9')]=function(_0x4f3cb9,_0x439866){return _0x4f3cb9[_0xd6a2('0xa')]('Dashboard',attributes,{'tableName':_0xd6a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 40a0b68..27bbf7a 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 _0x05c0=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x4bf3f9,_0x459195){var _0x7bd6fc=function(_0x46f408){while(--_0x46f408){_0x4bf3f9['push'](_0x4bf3f9['shift']());}};_0x7bd6fc(++_0x459195);}(_0x05c0,0x13b));var _0x005c=function(_0x36ceae,_0x3b5374){_0x36ceae=_0x36ceae-0x0;var _0x359f03=_0x05c0[_0x36ceae];return _0x359f03;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x005c('0x0'));var BPromise=require(_0x005c('0x1'));var rs=require(_0x005c('0x2'));var fs=require('fs');var Redis=require(_0x005c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x005c('0x4'))(_0x005c('0x5'));var config=require('../../config/environment');var jayson=require(_0x005c('0x6'));var client=jayson[_0x005c('0x7')][_0x005c('0x8')]({'port':0x232a});config[_0x005c('0x9')]=_[_0x005c('0xa')](config[_0x005c('0x9')],{'host':_0x005c('0xb'),'port':0x18eb});var socket=require(_0x005c('0xc'))(new Redis(config[_0x005c('0x9')]));require('./dashboard.socket')[_0x005c('0xd')](socket);function respondWithRpcPromise(_0x590f4e,_0x56bd00,_0x56c9f9){return new BPromise(function(_0x472f39,_0xd17f05){return client[_0x005c('0xe')](_0x590f4e,_0x56c9f9)['then'](function(_0x1513ff){logger[_0x005c('0xf')](_0x005c('0x10'),_0x56bd00,_0x005c('0x11'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x56bd00,_0x005c('0x11'),JSON['stringify'](_0x1513ff));if(_0x1513ff[_0x005c('0x12')]){if(_0x1513ff[_0x005c('0x12')]['code']===0x1f4){logger[_0x005c('0x12')](_0x005c('0x10'),_0x56bd00,_0x1513ff[_0x005c('0x12')][_0x005c('0x13')]);return _0xd17f05(_0x1513ff[_0x005c('0x12')][_0x005c('0x13')]);}logger[_0x005c('0x12')]('Dashboard,\x20%s,\x20%s',_0x56bd00,_0x1513ff[_0x005c('0x12')][_0x005c('0x13')]);return _0x472f39(_0x1513ff['error'][_0x005c('0x13')]);}else{logger['info'](_0x005c('0x10'),_0x56bd00,_0x005c('0x11'));_0x472f39(_0x1513ff[_0x005c('0x14')][_0x005c('0x13')]);}})['catch'](function(_0x4adb1a){logger[_0x005c('0x12')](_0x005c('0x10'),_0x56bd00,_0x4adb1a);_0xd17f05(_0x4adb1a);});});} \ No newline at end of file +var _0x02f1=['util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','./dashboard.socket','request','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','Dashboard,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash'];(function(_0x578131,_0x15425f){var _0x3f1b45=function(_0x53b32e){while(--_0x53b32e){_0x578131['push'](_0x578131['shift']());}};_0x3f1b45(++_0x15425f);}(_0x02f1,0x19d));var _0x102f=function(_0xb0d36f,_0x2feeba){_0xb0d36f=_0xb0d36f-0x0;var _0x5f1945=_0x02f1[_0xb0d36f];return _0x5f1945;};'use strict';var _=require(_0x102f('0x0'));var util=require(_0x102f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x102f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x102f('0x3'));var logger=require(_0x102f('0x4'))(_0x102f('0x5'));var config=require('../../config/environment');var jayson=require(_0x102f('0x6'));var client=jayson[_0x102f('0x7')][_0x102f('0x8')]({'port':0x232a});config['redis']=_[_0x102f('0x9')](config[_0x102f('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x102f('0xa')]));require(_0x102f('0xb'))['register'](socket);function respondWithRpcPromise(_0x438984,_0x2dfd28,_0x795bd1){return new BPromise(function(_0x3a1bfe,_0x32ab17){return client[_0x102f('0xc')](_0x438984,_0x795bd1)['then'](function(_0x2fd767){logger[_0x102f('0xd')]('Dashboard,\x20%s,\x20%s',_0x2dfd28,'request\x20sent');logger[_0x102f('0xe')](_0x102f('0xf'),_0x2dfd28,'request\x20sent',JSON[_0x102f('0x10')](_0x2fd767));if(_0x2fd767['error']){if(_0x2fd767[_0x102f('0x11')]['code']===0x1f4){logger[_0x102f('0x11')](_0x102f('0x12'),_0x2dfd28,_0x2fd767[_0x102f('0x11')][_0x102f('0x13')]);return _0x32ab17(_0x2fd767[_0x102f('0x11')][_0x102f('0x13')]);}logger[_0x102f('0x11')]('Dashboard,\x20%s,\x20%s',_0x2dfd28,_0x2fd767[_0x102f('0x11')][_0x102f('0x13')]);return _0x3a1bfe(_0x2fd767[_0x102f('0x11')][_0x102f('0x13')]);}else{logger[_0x102f('0xd')]('Dashboard,\x20%s,\x20%s',_0x2dfd28,_0x102f('0x14'));_0x3a1bfe(_0x2fd767[_0x102f('0x15')]['message']);}})[_0x102f('0x16')](function(_0x495297){logger[_0x102f('0x11')](_0x102f('0x12'),_0x2dfd28,_0x495297);_0x32ab17(_0x495297);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 213a2f4..a76f06e 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 _0x9321=['update','emit','removeListener','register','length','dashboard:','./dashboard.events','save','remove'];(function(_0x2a6a53,_0x1a26ad){var _0x572441=function(_0x4230d4){while(--_0x4230d4){_0x2a6a53['push'](_0x2a6a53['shift']());}};_0x572441(++_0x1a26ad);}(_0x9321,0x96));var _0x1932=function(_0x67a7ee,_0x2fb218){_0x67a7ee=_0x67a7ee-0x0;var _0x5624bc=_0x9321[_0x67a7ee];return _0x5624bc;};'use strict';var DashboardEvents=require(_0x1932('0x0'));var events=[_0x1932('0x1'),_0x1932('0x2'),_0x1932('0x3')];function createListener(_0x415be1,_0x582d3c){return function(_0x3d6865){_0x582d3c[_0x1932('0x4')](_0x415be1,_0x3d6865);};}function removeListener(_0x5dca88,_0x12ebc7){return function(){DashboardEvents[_0x1932('0x5')](_0x5dca88,_0x12ebc7);};}exports[_0x1932('0x6')]=function(_0x5b6c20){for(var _0xd3d1=0x0,_0x4f83b4=events[_0x1932('0x7')];_0xd3d1<_0x4f83b4;_0xd3d1++){var _0x192378=events[_0xd3d1];var _0x2b7f8e=createListener(_0x1932('0x8')+_0x192378,_0x5b6c20);DashboardEvents['on'](_0x192378,_0x2b7f8e);}}; \ No newline at end of file +var _0xb07d=['./dashboard.events','save','remove','update','emit','removeListener'];(function(_0x4713e8,_0x4c8fff){var _0x1e8e07=function(_0x2ca5c6){while(--_0x2ca5c6){_0x4713e8['push'](_0x4713e8['shift']());}};_0x1e8e07(++_0x4c8fff);}(_0xb07d,0x90));var _0xdb07=function(_0x5817ee,_0x19438f){_0x5817ee=_0x5817ee-0x0;var _0x4a18b8=_0xb07d[_0x5817ee];return _0x4a18b8;};'use strict';var DashboardEvents=require(_0xdb07('0x0'));var events=[_0xdb07('0x1'),_0xdb07('0x2'),_0xdb07('0x3')];function createListener(_0x2296b7,_0x254feb){return function(_0x21dba4){_0x254feb[_0xdb07('0x4')](_0x2296b7,_0x21dba4);};}function removeListener(_0x1364d8,_0x27bd5a){return function(){DashboardEvents[_0xdb07('0x5')](_0x1364d8,_0x27bd5a);};}exports['register']=function(_0x3869bf){for(var _0x136a4a=0x0,_0x433822=events['length'];_0x136a4a<_0x433822;_0x136a4a++){var _0x966110=events[_0x136a4a];var _0x115b18=createListener('dashboard:'+_0x966110,_0x3869bf);DashboardEvents['on'](_0x966110,_0x115b18);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 94707c6..102c4b4 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 _0x7f85=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','getItems','post','/:id/clone','/:id/items','addItem','put','update','delete','destroy','exports','multer'];(function(_0x3efe9b,_0x5b41a8){var _0x132073=function(_0x34459e){while(--_0x34459e){_0x3efe9b['push'](_0x3efe9b['shift']());}};_0x132073(++_0x5b41a8);}(_0x7f85,0xa7));var _0x57f8=function(_0x5cb6f3,_0x4085bc){_0x5cb6f3=_0x5cb6f3-0x0;var _0x225ffe=_0x7f85[_0x5cb6f3];return _0x225ffe;};'use strict';var multer=require(_0x57f8('0x0'));var util=require(_0x57f8('0x1'));var path=require('path');var timeout=require(_0x57f8('0x2'));var express=require(_0x57f8('0x3'));var router=express[_0x57f8('0x4')]();var fs_extra=require(_0x57f8('0x5'));var auth=require(_0x57f8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x57f8('0x7'));var controller=require(_0x57f8('0x8'));router[_0x57f8('0x9')]('/',auth[_0x57f8('0xa')](),controller[_0x57f8('0xb')]);router[_0x57f8('0x9')](_0x57f8('0xc'),auth[_0x57f8('0xa')](),controller[_0x57f8('0xd')]);router[_0x57f8('0x9')]('/:id/items',auth[_0x57f8('0xa')](),controller[_0x57f8('0xe')]);router[_0x57f8('0xf')]('/',auth[_0x57f8('0xa')](),controller['create']);router[_0x57f8('0xf')](_0x57f8('0x10'),auth[_0x57f8('0xa')](),controller['clone']);router[_0x57f8('0xf')](_0x57f8('0x11'),auth['isAuthenticated'](),controller[_0x57f8('0x12')]);router[_0x57f8('0x13')](_0x57f8('0xc'),auth[_0x57f8('0xa')](),controller[_0x57f8('0x14')]);router[_0x57f8('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x57f8('0x16')]);module[_0x57f8('0x17')]=router; \ No newline at end of file +var _0xf5eb=['update','delete','destroy','multer','util','path','express','fs-extra','../../config/environment','get','index','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','clone','/:id'];(function(_0x27f150,_0x5881cd){var _0x450766=function(_0x2059f8){while(--_0x2059f8){_0x27f150['push'](_0x27f150['shift']());}};_0x450766(++_0x5881cd);}(_0xf5eb,0x143));var _0xbf5e=function(_0x3e00a7,_0x15e0e2){_0x3e00a7=_0x3e00a7-0x0;var _0xe16b22=_0xf5eb[_0x3e00a7];return _0xe16b22;};'use strict';var multer=require(_0xbf5e('0x0'));var util=require(_0xbf5e('0x1'));var path=require(_0xbf5e('0x2'));var timeout=require('connect-timeout');var express=require(_0xbf5e('0x3'));var router=express['Router']();var fs_extra=require(_0xbf5e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbf5e('0x5'));var controller=require('./dashboard.controller');router[_0xbf5e('0x6')]('/',auth['isAuthenticated'](),controller[_0xbf5e('0x7')]);router[_0xbf5e('0x6')]('/:id',auth[_0xbf5e('0x8')](),controller[_0xbf5e('0x9')]);router[_0xbf5e('0x6')](_0xbf5e('0xa'),auth[_0xbf5e('0x8')](),controller[_0xbf5e('0xb')]);router[_0xbf5e('0xc')]('/',auth[_0xbf5e('0x8')](),controller[_0xbf5e('0xd')]);router[_0xbf5e('0xc')](_0xbf5e('0xe'),auth['isAuthenticated'](),controller[_0xbf5e('0xf')]);router['post'](_0xbf5e('0xa'),auth['isAuthenticated'](),controller['addItem']);router['put'](_0xbf5e('0x10'),auth[_0xbf5e('0x8')](),controller[_0xbf5e('0x11')]);router[_0xbf5e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xbf5e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index af6f8b6..84fd618 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 _0xf494=['squel','lodash','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','sequelize'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xf494,0x1c6));var _0x4f49=function(_0xc52584,_0x2e5541){_0xc52584=_0xc52584-0x0;var _0xf49ab8=_0xf494[_0xc52584];return _0xf49ab8;};'use strict';var Sequelize=require(_0x4f49('0x0'));var squel=require(_0x4f49('0x1'));var _=require(_0x4f49('0x2'));module['exports']={'title':{'type':Sequelize[_0x4f49('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4f49('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4f49('0x4')](_0x4f49('0x5')),'get':function(){try{return JSON[_0x4f49('0x6')](this[_0x4f49('0x7')](_0x4f49('0x8')));}catch(_0x790e8b){return[];}},'set':function(_0xc5e778){try{this[_0x4f49('0x9')](_0x4f49('0x8'),JSON['stringify'](_0xc5e778));}catch(_0x58e9a0){this[_0x4f49('0x9')](_0x4f49('0x8'),JSON[_0x4f49('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x4f49('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4f49('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4f49('0xb')]},'col':{'type':Sequelize[_0x4f49('0xb')]},'background':{'type':Sequelize[_0x4f49('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4f49('0x3')],'allowNull':![],'defaultValue':_0x4f49('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x4f49('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0xd117=['long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd117,0x182));var _0x7d11=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0xd117[_0x23c73d];return _0x36ba47;};'use strict';var Sequelize=require(_0x7d11('0x0'));var squel=require(_0x7d11('0x1'));var _=require(_0x7d11('0x2'));module[_0x7d11('0x3')]={'title':{'type':Sequelize[_0x7d11('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x7d11('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7d11('0x5')](_0x7d11('0x6')),'get':function(){try{return JSON[_0x7d11('0x7')](this[_0x7d11('0x8')](_0x7d11('0x9')));}catch(_0x2689c6){return[];}},'set':function(_0x27d7e8){try{this[_0x7d11('0xa')](_0x7d11('0x9'),JSON[_0x7d11('0xb')](_0x27d7e8));}catch(_0x47b5e6){this[_0x7d11('0xa')](_0x7d11('0x9'),JSON[_0x7d11('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7d11('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7d11('0xc')]},'col':{'type':Sequelize[_0x7d11('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7d11('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7d11('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 45e2857..a58e335 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 _0x7958=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','destroy','then','error','stack','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','catch','attrUrl','attrs','value','custom','attrPath','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrOpenchannelAccounts','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch'];(function(_0x2b55df,_0x4bd469){var _0x2cdb3b=function(_0x12faa0){while(--_0x12faa0){_0x2b55df['push'](_0x2b55df['shift']());}};_0x2cdb3b(++_0x4bd469);}(_0x7958,0x126));var _0x8795=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7958[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x8795('0x0'));var rimraf=require(_0x8795('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8795('0x2'));var rp=require(_0x8795('0x3'));var moment=require(_0x8795('0x4'));var BPromise=require(_0x8795('0x5'));var Mustache=require(_0x8795('0x6'));var util=require(_0x8795('0x7'));var path=require(_0x8795('0x8'));var sox=require(_0x8795('0x9'));var csv=require('to-csv');var ejs=require(_0x8795('0xa'));var fs=require('fs');var fs_extra=require(_0x8795('0xb'));var _=require(_0x8795('0xc'));var squel=require('squel');var crypto=require(_0x8795('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8795('0xe'));var toCsv=require(_0x8795('0xf'));var querystring=require(_0x8795('0x10'));var Papa=require(_0x8795('0x11'));var Redis=require(_0x8795('0x12'));var authService=require(_0x8795('0x13'));var qs=require(_0x8795('0x14'));var as=require(_0x8795('0x15'));var hardwareService=require(_0x8795('0x16'));var logger=require(_0x8795('0x17'))(_0x8795('0x18'));var utils=require(_0x8795('0x19'));var config=require(_0x8795('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x8795('0x1b'))['db'];config[_0x8795('0x1c')]=_[_0x8795('0x1d')](config[_0x8795('0x1c')],{'host':_0x8795('0x1e'),'port':0x18eb});var socket=require(_0x8795('0x1f'))(new Redis(config[_0x8795('0x1c')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x595064,_0x283437){_0x283437=_0x283437||0xcc;return function(_0xb3f0d7){if(_0xb3f0d7){return _0x595064[_0x8795('0x20')](_0x283437);}return _0x595064[_0x8795('0x21')](_0x283437)[_0x8795('0x22')]();};}function respondWithResult(_0x2027c1,_0x3f835f){_0x3f835f=_0x3f835f||0xc8;return function(_0x5017fc){if(_0x5017fc){return _0x2027c1[_0x8795('0x21')](_0x3f835f)['json'](_0x5017fc);}};}function respondWithFilteredResult(_0x42005e,_0x1eed23){return function(_0x498eea){if(_0x498eea){var _0x2e5452=typeof _0x1eed23[_0x8795('0x23')]===_0x8795('0x24')&&typeof _0x1eed23[_0x8795('0x25')]==='undefined';var _0x1aae20=_0x498eea[_0x8795('0x26')];var _0x4a65f0=_0x2e5452?0x0:_0x1eed23[_0x8795('0x23')];var _0x2a9501=_0x2e5452?_0x498eea[_0x8795('0x26')]:_0x1eed23[_0x8795('0x23')]+_0x1eed23['limit'];var _0x1930ca;if(_0x2a9501>=_0x1aae20){_0x2a9501=_0x1aae20;_0x1930ca=0xc8;}else{_0x1930ca=0xce;}_0x42005e['status'](_0x1930ca);return _0x42005e['set'](_0x8795('0x27'),_0x4a65f0+'-'+_0x2a9501+'/'+_0x1aae20)['json'](_0x498eea);}return null;};}function patchUpdates(_0x396f97){return function(_0x237091){try{jsonpatch['apply'](_0x237091,_0x396f97,!![]);}catch(_0x2d5097){return BPromise[_0x8795('0x28')](_0x2d5097);}return _0x237091[_0x8795('0x29')]();};}function saveUpdates(_0x1aa57a,_0x170e1b){return function(_0x3db752){if(_0x3db752){return _0x3db752['update'](_0x1aa57a)['then'](function(_0x163707){return _0x163707;});}return null;};}function removeEntity(_0x4ff62c,_0x3ed14c){return function(_0x389c38){if(_0x389c38){return _0x389c38[_0x8795('0x2a')]()[_0x8795('0x2b')](function(){_0x4ff62c[_0x8795('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8dc441,_0xdef175){return function(_0x5e06c5){if(!_0x5e06c5){_0x8dc441[_0x8795('0x20')](0x194);}return _0x5e06c5;};}function handleError(_0x1baa26,_0x3ce361){_0x3ce361=_0x3ce361||0x1f4;return function(_0x28770c){logger[_0x8795('0x2c')](_0x28770c[_0x8795('0x2d')]);if(_0x28770c[_0x8795('0x2e')]){delete _0x28770c[_0x8795('0x2e')];}_0x1baa26[_0x8795('0x21')](_0x3ce361)[_0x8795('0x2f')](_0x28770c);};}exports[_0x8795('0x30')]=function(_0x4d5707,_0x3fd6e3){var _0xa5c815={'raw':![],'where':{'id':_0x4d5707[_0x8795('0x31')]['id']}},_0x3aab08={};_0x3aab08['model']=_[_0x8795('0x32')](db[_0x8795('0x33')][_0x8795('0x34')]);_0x3aab08[_0x8795('0x35')]=_[_0x8795('0x32')](_0x4d5707[_0x8795('0x35')]);_0x3aab08[_0x8795('0x36')]=_[_0x8795('0x37')](_0x3aab08['model'],_0x3aab08['query']);_0xa5c815[_0x8795('0x38')]=_[_0x8795('0x37')](_0x3aab08[_0x8795('0x39')],qs[_0x8795('0x3a')](_0x4d5707['query'][_0x8795('0x3a')]));_0xa5c815[_0x8795('0x38')]=_0xa5c815[_0x8795('0x38')][_0x8795('0x3b')]?_0xa5c815[_0x8795('0x38')]:_0x3aab08[_0x8795('0x39')];if(_0x4d5707[_0x8795('0x35')][_0x8795('0x3c')]){_0xa5c815[_0x8795('0x3d')]=[{'all':!![]}];}_0xa5c815=_[_0x8795('0x3e')]({},_0xa5c815,_0x4d5707[_0x8795('0x3f')]);return db[_0x8795('0x33')][_0x8795('0x40')](_0xa5c815)[_0x8795('0x2b')](handleEntityNotFound(_0x3fd6e3,null))[_0x8795('0x2b')](respondWithResult(_0x3fd6e3,null))[_0x8795('0x41')](handleError(_0x3fd6e3,null));};exports[_0x8795('0x2a')]=function(_0x3886f2,_0x394e29){return db[_0x8795('0x33')][_0x8795('0x40')]({'where':{'id':_0x3886f2[_0x8795('0x31')]['id']}})[_0x8795('0x2b')](handleEntityNotFound(_0x394e29,null))[_0x8795('0x2b')](removeEntity(_0x394e29,null))[_0x8795('0x41')](handleError(_0x394e29,null));};function widgetAttributes(_0x16ea8f){try{switch(_0x16ea8f['type']){case'iframe':return[{'name':_0x8795('0x42'),'value':_0x16ea8f[_0x8795('0x42')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x0]?_0x16ea8f['attrs'][0x0][_0x8795('0x44')]:undefined)||'https://'}];case _0x8795('0x45'):return[{'name':_0x8795('0x46'),'value':_0x16ea8f['attrPath']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x0]?_0x16ea8f[_0x8795('0x43')][0x0][_0x8795('0x44')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x16ea8f['attrHourFormat']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x0]?_0x16ea8f['attrs'][0x0][_0x8795('0x44')]:undefined)||_0x8795('0x47')},{'name':_0x8795('0x48'),'value':_0x16ea8f[_0x8795('0x48')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x1]?_0x16ea8f[_0x8795('0x43')][0x1]['value']:undefined)||_0x8795('0x49')},{'name':'attrFontSize','value':_0x16ea8f['attrFontSize']||(_0x16ea8f['attrs']&&_0x16ea8f[_0x8795('0x43')][0x2]?_0x16ea8f[_0x8795('0x43')][0x2][_0x8795('0x44')]:undefined)||0xc}];case _0x8795('0x4a'):return[{'name':_0x8795('0x4b'),'value':_0x16ea8f[_0x8795('0x4b')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x0]?_0x16ea8f['attrs'][0x0][_0x8795('0x44')]:undefined)||'total'},{'name':_0x8795('0x4c'),'value':_0x16ea8f[_0x8795('0x4c')]||(_0x16ea8f['attrs']&&_0x16ea8f[_0x8795('0x43')][0x1]?_0x16ea8f[_0x8795('0x43')][0x1]['value']:undefined)||[]},{'name':_0x8795('0x4d'),'value':_0x16ea8f[_0x8795('0x4d')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x2]?_0x16ea8f['attrs'][0x2][_0x8795('0x44')]:undefined)||0x14},{'name':_0x8795('0x4e'),'value':_0x16ea8f['attrChannel']||(_0x16ea8f['attrs']&&_0x16ea8f[_0x8795('0x43')][0x3]?_0x16ea8f[_0x8795('0x43')][0x3][_0x8795('0x44')]:undefined)||_0x8795('0x4f')},{'name':'attrEmailAccounts','value':_0x16ea8f[_0x8795('0x50')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x4]?_0x16ea8f[_0x8795('0x43')][0x4][_0x8795('0x44')]:undefined)||''},{'name':_0x8795('0x51'),'value':_0x16ea8f[_0x8795('0x51')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x5]?_0x16ea8f['attrs'][0x5][_0x8795('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x16ea8f[_0x8795('0x52')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x6]?_0x16ea8f[_0x8795('0x43')][0x6][_0x8795('0x44')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x16ea8f['attrOpenchannelAccounts']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x7]?_0x16ea8f[_0x8795('0x43')][0x7][_0x8795('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x16ea8f[_0x8795('0x53')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x8]?_0x16ea8f[_0x8795('0x43')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x16ea8f[_0x8795('0x54')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x9]?_0x16ea8f['attrs'][0x9]['value']:undefined)||''}];case _0x8795('0x55'):case _0x8795('0x56'):return[{'name':_0x8795('0x57'),'value':_0x16ea8f['attrSerie1']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x0]?_0x16ea8f[_0x8795('0x43')][0x0][_0x8795('0x44')]:undefined)||_0x8795('0x58')},{'name':_0x8795('0x59'),'value':_0x16ea8f[_0x8795('0x59')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x1]?_0x16ea8f[_0x8795('0x43')][0x1]['value']:undefined)||null},{'name':_0x8795('0x5a'),'value':_0x16ea8f[_0x8795('0x5a')]||(_0x16ea8f['attrs']&&_0x16ea8f['attrs'][0x2]?_0x16ea8f[_0x8795('0x43')][0x2][_0x8795('0x44')]:undefined)||null},{'name':_0x8795('0x4c'),'value':_0x16ea8f['attrVoiceQueues']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x3]?_0x16ea8f[_0x8795('0x43')][0x3][_0x8795('0x44')]:undefined)||[]},{'name':_0x8795('0x4e'),'value':_0x16ea8f['attrChannel']||(_0x16ea8f['attrs']&&_0x16ea8f['attrs'][0x4]?_0x16ea8f[_0x8795('0x43')][0x4][_0x8795('0x44')]:undefined)||'voice'},{'name':_0x8795('0x50'),'value':_0x16ea8f[_0x8795('0x50')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x5]?_0x16ea8f[_0x8795('0x43')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x16ea8f['attrFaxAccounts']||(_0x16ea8f['attrs']&&_0x16ea8f[_0x8795('0x43')][0x6]?_0x16ea8f[_0x8795('0x43')][0x6][_0x8795('0x44')]:undefined)||''},{'name':_0x8795('0x52'),'value':_0x16ea8f['attrSmsAccounts']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x7]?_0x16ea8f[_0x8795('0x43')][0x7][_0x8795('0x44')]:undefined)||''},{'name':_0x8795('0x5b'),'value':_0x16ea8f[_0x8795('0x5b')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x8]?_0x16ea8f[_0x8795('0x43')][0x8][_0x8795('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x16ea8f[_0x8795('0x53')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x9]?_0x16ea8f[_0x8795('0x43')][0x9][_0x8795('0x44')]:undefined)||''},{'name':_0x8795('0x54'),'value':_0x16ea8f[_0x8795('0x54')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0xa]?_0x16ea8f[_0x8795('0x43')][0xa][_0x8795('0x44')]:undefined)||''}];case _0x8795('0x5c'):return[{'name':_0x8795('0x5d'),'type':_0x16ea8f['reportType']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x0]?_0x16ea8f['attrs'][0x0]['type']:undefined)||null,'value':_0x16ea8f[_0x8795('0x5d')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x0]?_0x16ea8f[_0x8795('0x43')][0x0][_0x8795('0x44')]:undefined)||null},{'name':_0x8795('0x5e'),'value':_0x16ea8f[_0x8795('0x5e')]||(_0x16ea8f['attrs']&&_0x16ea8f['attrs'][0x1]?_0x16ea8f[_0x8795('0x43')][0x1][_0x8795('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x1219f6){logger['error'](_0x8795('0x5f'),JSON[_0x8795('0x60')](_0x1219f6));return[];}}exports[_0x8795('0x61')]=function(_0x1be553,_0x296a54){if(_0x1be553['body']){_0x1be553[_0x8795('0x62')][_0x8795('0x43')]=widgetAttributes(_0x1be553[_0x8795('0x62')]);}return db[_0x8795('0x33')][_0x8795('0x61')](_0x1be553['body'],{})[_0x8795('0x2b')](respondWithResult(_0x296a54,0xc9))['catch'](handleError(_0x296a54,null));};exports['update']=function(_0xcfdb92,_0x233927){if(_0xcfdb92[_0x8795('0x62')]['id']){delete _0xcfdb92[_0x8795('0x62')]['id'];}_0xcfdb92[_0x8795('0x62')][_0x8795('0x43')]=widgetAttributes(_0xcfdb92[_0x8795('0x62')]);return db[_0x8795('0x33')][_0x8795('0x40')]({'where':{'id':_0xcfdb92[_0x8795('0x31')]['id']}})[_0x8795('0x2b')](handleEntityNotFound(_0x233927,null))['then'](saveUpdates(_0xcfdb92[_0x8795('0x62')],null))[_0x8795('0x2b')](respondWithResult(_0x233927,null))[_0x8795('0x41')](handleError(_0x233927,null));}; \ No newline at end of file +var _0x2cd0=['querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','show','params','model','DashboardItem','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel'];(function(_0x166577,_0x1dfdb2){var _0x3dd990=function(_0x8c246f){while(--_0x8c246f){_0x166577['push'](_0x166577['shift']());}};_0x3dd990(++_0x1dfdb2);}(_0x2cd0,0x10f));var _0x02cd=function(_0x1c7d5f,_0x269f74){_0x1c7d5f=_0x1c7d5f-0x0;var _0x2d1d28=_0x2cd0[_0x1c7d5f];return _0x2d1d28;};'use strict';var emlformat=require(_0x02cd('0x0'));var rimraf=require(_0x02cd('0x1'));var zipdir=require(_0x02cd('0x2'));var jsonpatch=require(_0x02cd('0x3'));var rp=require(_0x02cd('0x4'));var moment=require(_0x02cd('0x5'));var BPromise=require(_0x02cd('0x6'));var Mustache=require(_0x02cd('0x7'));var util=require('util');var path=require(_0x02cd('0x8'));var sox=require(_0x02cd('0x9'));var csv=require(_0x02cd('0xa'));var ejs=require(_0x02cd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02cd('0xc'));var squel=require(_0x02cd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x02cd('0xa'));var querystring=require(_0x02cd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x02cd('0xf'));var qs=require(_0x02cd('0x10'));var as=require(_0x02cd('0x11'));var hardwareService=require(_0x02cd('0x12'));var logger=require(_0x02cd('0x13'))(_0x02cd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x02cd('0x15'));var db=require(_0x02cd('0x16'))['db'];config[_0x02cd('0x17')]=_[_0x02cd('0x18')](config[_0x02cd('0x17')],{'host':_0x02cd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02cd('0x17')]));require('./dashboardItem.socket')[_0x02cd('0x1a')](socket);function respondWithStatusCode(_0x583620,_0x526499){_0x526499=_0x526499||0xcc;return function(_0x51f190){if(_0x51f190){return _0x583620[_0x02cd('0x1b')](_0x526499);}return _0x583620[_0x02cd('0x1c')](_0x526499)[_0x02cd('0x1d')]();};}function respondWithResult(_0x15b6fe,_0x14ba5c){_0x14ba5c=_0x14ba5c||0xc8;return function(_0x177720){if(_0x177720){return _0x15b6fe[_0x02cd('0x1c')](_0x14ba5c)[_0x02cd('0x1e')](_0x177720);}};}function respondWithFilteredResult(_0xb4115c,_0x2d554b){return function(_0x18c522){if(_0x18c522){var _0x24ca3e=typeof _0x2d554b[_0x02cd('0x1f')]===_0x02cd('0x20')&&typeof _0x2d554b[_0x02cd('0x21')]===_0x02cd('0x20');var _0x4f448b=_0x18c522[_0x02cd('0x22')];var _0x2ba059=_0x24ca3e?0x0:_0x2d554b[_0x02cd('0x1f')];var _0x17c764=_0x24ca3e?_0x18c522[_0x02cd('0x22')]:_0x2d554b[_0x02cd('0x1f')]+_0x2d554b[_0x02cd('0x21')];var _0xd6cc59;if(_0x17c764>=_0x4f448b){_0x17c764=_0x4f448b;_0xd6cc59=0xc8;}else{_0xd6cc59=0xce;}_0xb4115c[_0x02cd('0x1c')](_0xd6cc59);return _0xb4115c[_0x02cd('0x23')](_0x02cd('0x24'),_0x2ba059+'-'+_0x17c764+'/'+_0x4f448b)['json'](_0x18c522);}return null;};}function patchUpdates(_0x2b9809){return function(_0x155e5e){try{jsonpatch[_0x02cd('0x25')](_0x155e5e,_0x2b9809,!![]);}catch(_0x2fb5af){return BPromise['reject'](_0x2fb5af);}return _0x155e5e[_0x02cd('0x26')]();};}function saveUpdates(_0x4e127f,_0x1351fa){return function(_0x397aba){if(_0x397aba){return _0x397aba[_0x02cd('0x27')](_0x4e127f)[_0x02cd('0x28')](function(_0x40e7fa){return _0x40e7fa;});}return null;};}function removeEntity(_0x194c7e,_0x3fd0b0){return function(_0x5e92ed){if(_0x5e92ed){return _0x5e92ed[_0x02cd('0x29')]()[_0x02cd('0x28')](function(){_0x194c7e['status'](0xcc)[_0x02cd('0x1d')]();});}};}function handleEntityNotFound(_0x560027,_0x35f785){return function(_0x490389){if(!_0x490389){_0x560027[_0x02cd('0x1b')](0x194);}return _0x490389;};}function handleError(_0x3651d4,_0x478068){_0x478068=_0x478068||0x1f4;return function(_0x205ee7){logger[_0x02cd('0x2a')](_0x205ee7[_0x02cd('0x2b')]);if(_0x205ee7['name']){delete _0x205ee7['name'];}_0x3651d4[_0x02cd('0x1c')](_0x478068)[_0x02cd('0x2c')](_0x205ee7);};}exports[_0x02cd('0x2d')]=function(_0x296103,_0x5f5283){var _0x561eba={'raw':![],'where':{'id':_0x296103[_0x02cd('0x2e')]['id']}},_0x15a334={};_0x15a334[_0x02cd('0x2f')]=_['keys'](db[_0x02cd('0x30')]['rawAttributes']);_0x15a334[_0x02cd('0x31')]=_['keys'](_0x296103[_0x02cd('0x31')]);_0x15a334['filters']=_[_0x02cd('0x32')](_0x15a334[_0x02cd('0x2f')],_0x15a334[_0x02cd('0x31')]);_0x561eba[_0x02cd('0x33')]=_[_0x02cd('0x32')](_0x15a334['model'],qs[_0x02cd('0x34')](_0x296103['query']['fields']));_0x561eba[_0x02cd('0x33')]=_0x561eba[_0x02cd('0x33')][_0x02cd('0x35')]?_0x561eba[_0x02cd('0x33')]:_0x15a334['model'];if(_0x296103['query'][_0x02cd('0x36')]){_0x561eba[_0x02cd('0x37')]=[{'all':!![]}];}_0x561eba=_[_0x02cd('0x38')]({},_0x561eba,_0x296103[_0x02cd('0x39')]);return db[_0x02cd('0x30')][_0x02cd('0x3a')](_0x561eba)[_0x02cd('0x28')](handleEntityNotFound(_0x5f5283,null))['then'](respondWithResult(_0x5f5283,null))[_0x02cd('0x3b')](handleError(_0x5f5283,null));};exports[_0x02cd('0x29')]=function(_0x4169e4,_0x27b585){return db[_0x02cd('0x30')][_0x02cd('0x3a')]({'where':{'id':_0x4169e4[_0x02cd('0x2e')]['id']}})[_0x02cd('0x28')](handleEntityNotFound(_0x27b585,null))[_0x02cd('0x28')](removeEntity(_0x27b585,null))['catch'](handleError(_0x27b585,null));};function widgetAttributes(_0x349ca8){try{switch(_0x349ca8[_0x02cd('0x3c')]){case _0x02cd('0x3d'):return[{'name':_0x02cd('0x3e'),'value':_0x349ca8[_0x02cd('0x3e')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||_0x02cd('0x41')}];case _0x02cd('0x42'):return[{'name':_0x02cd('0x43'),'value':_0x349ca8['attrPath']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8['attrs'][0x0][_0x02cd('0x40')]:undefined)||''}];case'clock':return[{'name':_0x02cd('0x44'),'value':_0x349ca8[_0x02cd('0x44')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||_0x02cd('0x45')},{'name':'attrTimezone','value':_0x349ca8[_0x02cd('0x46')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||'0.00'},{'name':_0x02cd('0x47'),'value':_0x349ca8[_0x02cd('0x47')]||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x2]?_0x349ca8[_0x02cd('0x3f')][0x2][_0x02cd('0x40')]:undefined)||0xc}];case _0x02cd('0x48'):return[{'name':_0x02cd('0x49'),'value':_0x349ca8['attrMetric']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||_0x02cd('0x4a')},{'name':_0x02cd('0x4b'),'value':_0x349ca8['attrVoiceQueues']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||[]},{'name':_0x02cd('0x47'),'value':_0x349ca8[_0x02cd('0x47')]||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x2]?_0x349ca8[_0x02cd('0x3f')][0x2][_0x02cd('0x40')]:undefined)||0x14},{'name':'attrChannel','value':_0x349ca8[_0x02cd('0x4c')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x3]?_0x349ca8['attrs'][0x3][_0x02cd('0x40')]:undefined)||_0x02cd('0x4d')},{'name':_0x02cd('0x4e'),'value':_0x349ca8[_0x02cd('0x4e')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x4]?_0x349ca8[_0x02cd('0x3f')][0x4]['value']:undefined)||''},{'name':_0x02cd('0x4f'),'value':_0x349ca8[_0x02cd('0x4f')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x5]?_0x349ca8[_0x02cd('0x3f')][0x5][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x50'),'value':_0x349ca8[_0x02cd('0x50')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x6]?_0x349ca8[_0x02cd('0x3f')][0x6][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x51'),'value':_0x349ca8[_0x02cd('0x51')]||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x7]?_0x349ca8[_0x02cd('0x3f')][0x7][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x52'),'value':_0x349ca8[_0x02cd('0x52')]||(_0x349ca8['attrs']&&_0x349ca8['attrs'][0x8]?_0x349ca8[_0x02cd('0x3f')][0x8]['value']:undefined)||''},{'name':_0x02cd('0x53'),'value':_0x349ca8[_0x02cd('0x53')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x9]?_0x349ca8['attrs'][0x9][_0x02cd('0x40')]:undefined)||''}];case _0x02cd('0x54'):case _0x02cd('0x55'):return[{'name':_0x02cd('0x56'),'value':_0x349ca8['attrSerie1']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||'total'},{'name':_0x02cd('0x57'),'value':_0x349ca8[_0x02cd('0x57')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||null},{'name':_0x02cd('0x58'),'value':_0x349ca8[_0x02cd('0x58')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x2]?_0x349ca8['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x349ca8[_0x02cd('0x4b')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x3]?_0x349ca8[_0x02cd('0x3f')][0x3][_0x02cd('0x40')]:undefined)||[]},{'name':_0x02cd('0x4c'),'value':_0x349ca8['attrChannel']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x4]?_0x349ca8['attrs'][0x4][_0x02cd('0x40')]:undefined)||'voice'},{'name':_0x02cd('0x4e'),'value':_0x349ca8['attrEmailAccounts']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x5]?_0x349ca8[_0x02cd('0x3f')][0x5]['value']:undefined)||''},{'name':_0x02cd('0x4f'),'value':_0x349ca8[_0x02cd('0x4f')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x6]?_0x349ca8['attrs'][0x6][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x50'),'value':_0x349ca8['attrSmsAccounts']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x7]?_0x349ca8['attrs'][0x7][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x51'),'value':_0x349ca8[_0x02cd('0x51')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x8]?_0x349ca8['attrs'][0x8]['value']:undefined)||''},{'name':_0x02cd('0x52'),'value':_0x349ca8['attrWhatsappAccounts']||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x9]?_0x349ca8[_0x02cd('0x3f')][0x9][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x53'),'value':_0x349ca8[_0x02cd('0x53')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0xa]?_0x349ca8[_0x02cd('0x3f')][0xa][_0x02cd('0x40')]:undefined)||''}];case _0x02cd('0x59'):return[{'name':'attrReport','type':_0x349ca8[_0x02cd('0x5a')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8['attrs'][0x0][_0x02cd('0x3c')]:undefined)||null,'value':_0x349ca8['attrReport']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8['attrs'][0x0]['value']:undefined)||null},{'name':_0x02cd('0x5b'),'value':_0x349ca8['attrRefresh']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x20e23e){logger['error'](_0x02cd('0x5c'),JSON['stringify'](_0x20e23e));return[];}}exports[_0x02cd('0x5d')]=function(_0x470b48,_0x1f327d){if(_0x470b48[_0x02cd('0x5e')]){_0x470b48[_0x02cd('0x5e')][_0x02cd('0x3f')]=widgetAttributes(_0x470b48['body']);}return db[_0x02cd('0x30')]['create'](_0x470b48[_0x02cd('0x5e')],{})[_0x02cd('0x28')](respondWithResult(_0x1f327d,0xc9))[_0x02cd('0x3b')](handleError(_0x1f327d,null));};exports[_0x02cd('0x27')]=function(_0xe5bd3e,_0x3c4dda){if(_0xe5bd3e['body']['id']){delete _0xe5bd3e[_0x02cd('0x5e')]['id'];}_0xe5bd3e[_0x02cd('0x5e')][_0x02cd('0x3f')]=widgetAttributes(_0xe5bd3e[_0x02cd('0x5e')]);return db[_0x02cd('0x30')][_0x02cd('0x3a')]({'where':{'id':_0xe5bd3e['params']['id']}})[_0x02cd('0x28')](handleEntityNotFound(_0x3c4dda,null))[_0x02cd('0x28')](saveUpdates(_0xe5bd3e['body'],null))[_0x02cd('0x28')](respondWithResult(_0x3c4dda,null))[_0x02cd('0x3b')](handleError(_0x3c4dda,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 1111591..ff52a8b 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 _0x1537=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x1537,0x132));var _0x7153=function(_0x14680e,_0x2b04bd){_0x14680e=_0x14680e-0x0;var _0x15119e=_0x1537[_0x14680e];return _0x15119e;};'use strict';var EventEmitter=require(_0x7153('0x0'));var DashboardItem=require(_0x7153('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7153('0x2')](0x0);var events={'afterCreate':_0x7153('0x3'),'afterUpdate':_0x7153('0x4'),'afterDestroy':_0x7153('0x5')};function emitEvent(_0x34f38b){return function(_0x5048b8,_0x19112a,_0x5ec171){DashboardItemEvents[_0x7153('0x6')](_0x34f38b+':'+_0x5048b8['id'],_0x5048b8);DashboardItemEvents['emit'](_0x34f38b,_0x5048b8);_0x5ec171(null);};}for(var e in events){if(events[_0x7153('0x7')](e)){var event=events[e];DashboardItem[_0x7153('0x8')](e,emitEvent(event));}}module[_0x7153('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0xcf90=['update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x3db242,_0x2389a7){var _0x5260fb=function(_0x54f87b){while(--_0x54f87b){_0x3db242['push'](_0x3db242['shift']());}};_0x5260fb(++_0x2389a7);}(_0xcf90,0x175));var _0x0cf9=function(_0x1ffbda,_0x525539){_0x1ffbda=_0x1ffbda-0x0;var _0x2ec53b=_0xcf90[_0x1ffbda];return _0x2ec53b;};'use strict';var EventEmitter=require(_0x0cf9('0x0'));var DashboardItem=require(_0x0cf9('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x0cf9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0cf9('0x3'),'afterDestroy':_0x0cf9('0x4')};function emitEvent(_0x333c3e){return function(_0x45950b,_0x2b8ea7,_0x478a52){DashboardItemEvents[_0x0cf9('0x5')](_0x333c3e+':'+_0x45950b['id'],_0x45950b);DashboardItemEvents[_0x0cf9('0x5')](_0x333c3e,_0x45950b);_0x478a52(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x0cf9('0x6')](e,emitEvent(event));}}module[_0x0cf9('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 e98cf2c..b83d49b 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 _0xefbb=['request-promise','path','rimraf','lodash','util','../../config/logger','api','moment'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0xefbb,0x11b));var _0xbefb=function(_0x132645,_0x31d0b7){_0x132645=_0x132645-0x0;var _0x3ac3f0=_0xefbb[_0x132645];return _0x3ac3f0;};'use strict';var _=require(_0xbefb('0x0'));var util=require(_0xbefb('0x1'));var logger=require(_0xbefb('0x2'))(_0xbefb('0x3'));var moment=require(_0xbefb('0x4'));var BPromise=require('bluebird');var rp=require(_0xbefb('0x5'));var fs=require('fs');var path=require(_0xbefb('0x6'));var rimraf=require(_0xbefb('0x7'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x48e358,_0x292420){return _0x48e358['define']('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bfe=['../../config/environment','./dashboardItem.attributes','exports','DashboardItem','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x5a574a,_0x7b29d6){var _0x5ad780=function(_0x181567){while(--_0x181567){_0x5a574a['push'](_0x5a574a['shift']());}};_0x5ad780(++_0x7b29d6);}(_0x8bfe,0x1a6));var _0xe8bf=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x8bfe[_0x5d8018];return _0x151ac4;};'use strict';var _=require(_0xe8bf('0x0'));var util=require(_0xe8bf('0x1'));var logger=require(_0xe8bf('0x2'))('api');var moment=require(_0xe8bf('0x3'));var BPromise=require(_0xe8bf('0x4'));var rp=require(_0xe8bf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe8bf('0x6'));var config=require(_0xe8bf('0x7'));var attributes=require(_0xe8bf('0x8'));module[_0xe8bf('0x9')]=function(_0x4c7fff,_0x34a933){return _0x4c7fff['define'](_0xe8bf('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 7605ca8..96b474a 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 _0xf56c=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment'];(function(_0x229cfd,_0x3d7b4c){var _0x5621a3=function(_0x3d5e61){while(--_0x3d5e61){_0x229cfd['push'](_0x229cfd['shift']());}};_0x5621a3(++_0x3d7b4c);}(_0xf56c,0x175));var _0xcf56=function(_0x4eb7e6,_0x451464){_0x4eb7e6=_0x4eb7e6-0x0;var _0x3cf508=_0xf56c[_0x4eb7e6];return _0x3cf508;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcf56('0x0'));var BPromise=require(_0xcf56('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf56('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf56('0x3'));var logger=require(_0xcf56('0x4'))(_0xcf56('0x5'));var config=require('../../config/environment');var jayson=require(_0xcf56('0x6'));var client=jayson[_0xcf56('0x7')][_0xcf56('0x8')]({'port':0x232a});config[_0xcf56('0x9')]=_['defaults'](config[_0xcf56('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf56('0x9')]));require(_0xcf56('0xa'))['register'](socket);function respondWithRpcPromise(_0x1de518,_0x17f97e,_0x39cb27){return new BPromise(function(_0xc3a903,_0x54679d){return client[_0xcf56('0xb')](_0x1de518,_0x39cb27)['then'](function(_0x59807b){logger[_0xcf56('0xc')](_0xcf56('0xd'),_0x17f97e,_0xcf56('0xe'));logger[_0xcf56('0xf')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x17f97e,_0xcf56('0xe'),JSON[_0xcf56('0x10')](_0x59807b));if(_0x59807b[_0xcf56('0x11')]){if(_0x59807b[_0xcf56('0x11')][_0xcf56('0x12')]===0x1f4){logger[_0xcf56('0x11')](_0xcf56('0xd'),_0x17f97e,_0x59807b['error']['message']);return _0x54679d(_0x59807b['error']['message']);}logger['error'](_0xcf56('0xd'),_0x17f97e,_0x59807b[_0xcf56('0x11')][_0xcf56('0x13')]);return _0xc3a903(_0x59807b[_0xcf56('0x11')][_0xcf56('0x13')]);}else{logger[_0xcf56('0xc')](_0xcf56('0xd'),_0x17f97e,_0xcf56('0xe'));_0xc3a903(_0x59807b[_0xcf56('0x14')]['message']);}})[_0xcf56('0x15')](function(_0x4a7298){logger[_0xcf56('0x11')](_0xcf56('0xd'),_0x17f97e,_0x4a7298);_0x54679d(_0x4a7298);});});} \ No newline at end of file +var _0xb54b=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','request','then','info'];(function(_0x42e94f,_0x4d5677){var _0x206b51=function(_0x5b17b7){while(--_0x5b17b7){_0x42e94f['push'](_0x42e94f['shift']());}};_0x206b51(++_0x4d5677);}(_0xb54b,0x117));var _0xbb54=function(_0x122609,_0x38da8b){_0x122609=_0x122609-0x0;var _0xeca6c8=_0xb54b[_0x122609];return _0xeca6c8;};'use strict';var _=require(_0xbb54('0x0'));var util=require(_0xbb54('0x1'));var moment=require(_0xbb54('0x2'));var BPromise=require(_0xbb54('0x3'));var rs=require(_0xbb54('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb54('0x5'))['db'];var utils=require(_0xbb54('0x6'));var logger=require(_0xbb54('0x7'))(_0xbb54('0x8'));var config=require(_0xbb54('0x9'));var jayson=require(_0xbb54('0xa'));var client=jayson[_0xbb54('0xb')][_0xbb54('0xc')]({'port':0x232a});config[_0xbb54('0xd')]=_[_0xbb54('0xe')](config['redis'],{'host':_0xbb54('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb54('0xd')]));require(_0xbb54('0x10'))[_0xbb54('0x11')](socket);function respondWithRpcPromise(_0x1c05ae,_0x45445f,_0x223c4b){return new BPromise(function(_0xad7506,_0x365473){return client[_0xbb54('0x12')](_0x1c05ae,_0x223c4b)[_0xbb54('0x13')](function(_0x14180d){logger[_0xbb54('0x14')]('DashboardItem,\x20%s,\x20%s',_0x45445f,'request\x20sent');logger[_0xbb54('0x15')](_0xbb54('0x16'),_0x45445f,_0xbb54('0x17'),JSON[_0xbb54('0x18')](_0x14180d));if(_0x14180d[_0xbb54('0x19')]){if(_0x14180d[_0xbb54('0x19')][_0xbb54('0x1a')]===0x1f4){logger[_0xbb54('0x19')]('DashboardItem,\x20%s,\x20%s',_0x45445f,_0x14180d[_0xbb54('0x19')][_0xbb54('0x1b')]);return _0x365473(_0x14180d[_0xbb54('0x19')][_0xbb54('0x1b')]);}logger[_0xbb54('0x19')](_0xbb54('0x1c'),_0x45445f,_0x14180d[_0xbb54('0x19')][_0xbb54('0x1b')]);return _0xad7506(_0x14180d['error'][_0xbb54('0x1b')]);}else{logger[_0xbb54('0x14')](_0xbb54('0x1c'),_0x45445f,'request\x20sent');_0xad7506(_0x14180d[_0xbb54('0x1d')][_0xbb54('0x1b')]);}})['catch'](function(_0x3aa789){logger[_0xbb54('0x19')](_0xbb54('0x1c'),_0x45445f,_0x3aa789);_0x365473(_0x3aa789);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index a894011..631afb4 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 _0xfb9f=['register','length','dashboardItem:','./dashboardItem.events','save','update'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xfb9f,0x7b));var _0xffb9=function(_0x1d9f31,_0x3982ac){_0x1d9f31=_0x1d9f31-0x0;var _0x5ee6ad=_0xfb9f[_0x1d9f31];return _0x5ee6ad;};'use strict';var DashboardItemEvents=require(_0xffb9('0x0'));var events=[_0xffb9('0x1'),'remove',_0xffb9('0x2')];function createListener(_0x5517e2,_0x550431){return function(_0x7cb0ff){_0x550431['emit'](_0x5517e2,_0x7cb0ff);};}function removeListener(_0x5707a1,_0x433a04){return function(){DashboardItemEvents['removeListener'](_0x5707a1,_0x433a04);};}exports[_0xffb9('0x3')]=function(_0x595b43){for(var _0x33511f=0x0,_0x5e6533=events[_0xffb9('0x4')];_0x33511f<_0x5e6533;_0x33511f++){var _0x40910a=events[_0x33511f];var _0x1dc705=createListener(_0xffb9('0x5')+_0x40910a,_0x595b43);DashboardItemEvents['on'](_0x40910a,_0x1dc705);}}; \ No newline at end of file +var _0x672f=['emit','register','length','dashboardItem:','./dashboardItem.events','remove','update'];(function(_0x453eaf,_0x5440fc){var _0x5de7a1=function(_0x5ad60e){while(--_0x5ad60e){_0x453eaf['push'](_0x453eaf['shift']());}};_0x5de7a1(++_0x5440fc);}(_0x672f,0x177));var _0xf672=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0x672f[_0x34232c];return _0x4d4f4e;};'use strict';var DashboardItemEvents=require(_0xf672('0x0'));var events=['save',_0xf672('0x1'),_0xf672('0x2')];function createListener(_0x66bf76,_0x325e3e){return function(_0x1e768f){_0x325e3e[_0xf672('0x3')](_0x66bf76,_0x1e768f);};}function removeListener(_0x230109,_0x429f05){return function(){DashboardItemEvents['removeListener'](_0x230109,_0x429f05);};}exports[_0xf672('0x4')]=function(_0x1ef80b){for(var _0x39c723=0x0,_0x3385d4=events[_0xf672('0x5')];_0x39c723<_0x3385d4;_0x39c723++){var _0x369a3a=events[_0x39c723];var _0x2e0775=createListener(_0xf672('0x6')+_0x369a3a,_0x1ef80b);DashboardItemEvents['on'](_0x369a3a,_0x2e0775);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 177f9f1..53982d4 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 _0x9dcc=['delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','create','put','update'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x9dcc,0x1ce));var _0xc9dc=function(_0x16f9c6,_0x16e06f){_0x16f9c6=_0x16f9c6-0x0;var _0x1a352b=_0x9dcc[_0x16f9c6];return _0x1a352b;};'use strict';var multer=require('multer');var util=require(_0xc9dc('0x0'));var path=require(_0xc9dc('0x1'));var timeout=require('connect-timeout');var express=require(_0xc9dc('0x2'));var router=express[_0xc9dc('0x3')]();var fs_extra=require(_0xc9dc('0x4'));var auth=require(_0xc9dc('0x5'));var interaction=require(_0xc9dc('0x6'));var config=require(_0xc9dc('0x7'));var controller=require('./dashboardItem.controller');router['get'](_0xc9dc('0x8'),auth[_0xc9dc('0x9')](),controller[_0xc9dc('0xa')]);router['post']('/',auth[_0xc9dc('0x9')](),controller[_0xc9dc('0xb')]);router[_0xc9dc('0xc')](_0xc9dc('0x8'),auth[_0xc9dc('0x9')](),controller[_0xc9dc('0xd')]);router[_0xc9dc('0xe')](_0xc9dc('0x8'),auth[_0xc9dc('0x9')](),controller[_0xc9dc('0xf')]);module[_0xc9dc('0x10')]=router; \ No newline at end of file +var _0xc8d5=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','create','isAuthenticated','update','delete','exports','multer'];(function(_0x21b010,_0x22f887){var _0x4084f8=function(_0x1219b4){while(--_0x1219b4){_0x21b010['push'](_0x21b010['shift']());}};_0x4084f8(++_0x22f887);}(_0xc8d5,0xbd));var _0x5c8d=function(_0x1b6a7e,_0xdbcb28){_0x1b6a7e=_0x1b6a7e-0x0;var _0x629f5b=_0xc8d5[_0x1b6a7e];return _0x629f5b;};'use strict';var multer=require(_0x5c8d('0x0'));var util=require(_0x5c8d('0x1'));var path=require('path');var timeout=require(_0x5c8d('0x2'));var express=require(_0x5c8d('0x3'));var router=express[_0x5c8d('0x4')]();var fs_extra=require(_0x5c8d('0x5'));var auth=require(_0x5c8d('0x6'));var interaction=require(_0x5c8d('0x7'));var config=require(_0x5c8d('0x8'));var controller=require(_0x5c8d('0x9'));router[_0x5c8d('0xa')](_0x5c8d('0xb'),auth['isAuthenticated'](),controller[_0x5c8d('0xc')]);router[_0x5c8d('0xd')]('/',auth['isAuthenticated'](),controller[_0x5c8d('0xe')]);router['put']('/:id',auth[_0x5c8d('0xf')](),controller[_0x5c8d('0x10')]);router[_0x5c8d('0x11')](_0x5c8d('0xb'),auth[_0x5c8d('0xf')](),controller['destroy']);module[_0x5c8d('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index f559c4c..719fa29 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 _0x82db=['sequelize','exports','first','third','STRING'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x82db,0x1f4));var _0xb82d=function(_0x48dc35,_0x41d5af){_0x48dc35=_0x48dc35-0x0;var _0x2df65c=_0x82db[_0x48dc35];return _0x2df65c;};'use strict';var Sequelize=require(_0xb82d('0x0'));module[_0xb82d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xb82d('0x2'),'second',_0xb82d('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xb82d('0x4')]}}; \ No newline at end of file +var _0x88ca=['exports','STRING','ENUM','third','first'];(function(_0x33ab57,_0x449de8){var _0x3af8ce=function(_0x4e8220){while(--_0x4e8220){_0x33ab57['push'](_0x33ab57['shift']());}};_0x3af8ce(++_0x449de8);}(_0x88ca,0xff));var _0xa88c=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0x88ca[_0x1778e1];return _0x2bc4c6;};'use strict';var Sequelize=require('sequelize');module[_0xa88c('0x0')]={'name':{'type':Sequelize[_0xa88c('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xa88c('0x2')]('first','second',_0xa88c('0x3')),'allowNull':![],'defaultValue':_0xa88c('0x4')},'description':{'type':Sequelize[_0xa88c('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 7500ffc..61f329b 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 _0x9219=['sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','Dispositions','UserProfileResource','destroy','stack','name','send','index','map','Disposition','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','create','role','user','UserProfileSection','find','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','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x9219,0x1cd));var _0x9921=function(_0x30aef4,_0x1d3371){_0x30aef4=_0x30aef4-0x0;var _0x5a49a4=_0x9219[_0x30aef4];return _0x5a49a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9921('0x0'));var zipdir=require(_0x9921('0x1'));var jsonpatch=require(_0x9921('0x2'));var rp=require(_0x9921('0x3'));var moment=require(_0x9921('0x4'));var BPromise=require(_0x9921('0x5'));var Mustache=require(_0x9921('0x6'));var util=require(_0x9921('0x7'));var path=require(_0x9921('0x8'));var sox=require('sox');var csv=require(_0x9921('0x9'));var ejs=require(_0x9921('0xa'));var fs=require('fs');var fs_extra=require(_0x9921('0xb'));var _=require('lodash');var squel=require(_0x9921('0xc'));var crypto=require(_0x9921('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9921('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9921('0xf'));var Redis=require(_0x9921('0x10'));var authService=require(_0x9921('0x11'));var qs=require(_0x9921('0x12'));var as=require(_0x9921('0x13'));var hardwareService=require(_0x9921('0x14'));var logger=require('../../config/logger')(_0x9921('0x15'));var utils=require(_0x9921('0x16'));var config=require(_0x9921('0x17'));var licenseUtil=require(_0x9921('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ccf58,_0x3fee27){_0x3fee27=_0x3fee27||0xcc;return function(_0x36dd9c){if(_0x36dd9c){return _0x2ccf58[_0x9921('0x19')](_0x3fee27);}return _0x2ccf58['status'](_0x3fee27)[_0x9921('0x1a')]();};}function respondWithResult(_0x22f828,_0x430d86){_0x430d86=_0x430d86||0xc8;return function(_0x60c304){if(_0x60c304){return _0x22f828[_0x9921('0x1b')](_0x430d86)[_0x9921('0x1c')](_0x60c304);}};}function respondWithFilteredResult(_0x53531,_0x12315d){return function(_0x1d8e02){if(_0x1d8e02){var _0x2a703c=typeof _0x12315d[_0x9921('0x1d')]===_0x9921('0x1e')&&typeof _0x12315d[_0x9921('0x1f')]===_0x9921('0x1e');var _0x382b1b=_0x1d8e02['count'];var _0x2df4a9=_0x2a703c?0x0:_0x12315d[_0x9921('0x1d')];var _0x68a29b=_0x2a703c?_0x1d8e02[_0x9921('0x20')]:_0x12315d[_0x9921('0x1d')]+_0x12315d[_0x9921('0x1f')];var _0x5bb1a9;if(_0x68a29b>=_0x382b1b){_0x68a29b=_0x382b1b;_0x5bb1a9=0xc8;}else{_0x5bb1a9=0xce;}_0x53531[_0x9921('0x1b')](_0x5bb1a9);return _0x53531[_0x9921('0x21')](_0x9921('0x22'),_0x2df4a9+'-'+_0x68a29b+'/'+_0x382b1b)[_0x9921('0x1c')](_0x1d8e02);}return null;};}function patchUpdates(_0x3cc016){return function(_0x5f0903){try{jsonpatch[_0x9921('0x23')](_0x5f0903,_0x3cc016,!![]);}catch(_0x19f837){return BPromise[_0x9921('0x24')](_0x19f837);}return _0x5f0903['save']();};}function saveUpdates(_0x512e2c,_0x5f3328){return function(_0x5cb87e){if(_0x5cb87e){return _0x5cb87e[_0x9921('0x25')](_0x512e2c)[_0x9921('0x26')](function(_0x3afdbd){return _0x3afdbd;});}return null;};}function removeEntity(_0x684568,_0x15d8bf){return function(_0x2e14c7){if(_0x2e14c7){return _0x2e14c7['destroy']()['then'](function(){var _0x457521=_0x2e14c7['get']({'plain':!![]});var _0x3a8f46=_0x9921('0x27');return db[_0x9921('0x28')][_0x9921('0x29')]({'where':{'type':_0x3a8f46,'resourceId':_0x457521['id']}})[_0x9921('0x26')](function(){return _0x2e14c7;});})[_0x9921('0x26')](function(){_0x684568[_0x9921('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaf4a05,_0x548006){return function(_0x335144){if(!_0x335144){_0xaf4a05[_0x9921('0x19')](0x194);}return _0x335144;};}function handleError(_0x52be6b,_0x4ddc52){_0x4ddc52=_0x4ddc52||0x1f4;return function(_0x42c094){logger['error'](_0x42c094[_0x9921('0x2a')]);if(_0x42c094[_0x9921('0x2b')]){delete _0x42c094[_0x9921('0x2b')];}_0x52be6b['status'](_0x4ddc52)[_0x9921('0x2c')](_0x42c094);};}exports[_0x9921('0x2d')]=function(_0x9bd4db,_0x2ca22b){var _0x316385={},_0x1d4c2f={},_0x3b19f2={'count':0x0,'rows':[]};var _0x446a43=_[_0x9921('0x2e')](db[_0x9921('0x2f')][_0x9921('0x30')],function(_0x3ec975){return{'name':_0x3ec975['fieldName'],'type':_0x3ec975[_0x9921('0x31')][_0x9921('0x32')]};});_0x1d4c2f[_0x9921('0x33')]=_[_0x9921('0x2e')](_0x446a43,_0x9921('0x2b'));_0x1d4c2f['query']=_['keys'](_0x9bd4db[_0x9921('0x34')]);_0x1d4c2f[_0x9921('0x35')]=_[_0x9921('0x36')](_0x1d4c2f[_0x9921('0x33')],_0x1d4c2f['query']);_0x316385[_0x9921('0x37')]=_[_0x9921('0x36')](_0x1d4c2f[_0x9921('0x33')],qs[_0x9921('0x38')](_0x9bd4db['query'][_0x9921('0x38')]));_0x316385['attributes']=_0x316385[_0x9921('0x37')][_0x9921('0x39')]?_0x316385[_0x9921('0x37')]:_0x1d4c2f[_0x9921('0x33')];if(!_0x9bd4db[_0x9921('0x34')]['hasOwnProperty'](_0x9921('0x3a'))){_0x316385[_0x9921('0x1f')]=qs[_0x9921('0x1f')](_0x9bd4db[_0x9921('0x34')][_0x9921('0x1f')]);_0x316385[_0x9921('0x1d')]=qs['offset'](_0x9bd4db['query'][_0x9921('0x1d')]);}_0x316385['order']=qs[_0x9921('0x3b')](_0x9bd4db[_0x9921('0x34')][_0x9921('0x3b')]);_0x316385[_0x9921('0x3c')]=qs[_0x9921('0x35')](_[_0x9921('0x3d')](_0x9bd4db[_0x9921('0x34')],_0x1d4c2f['filters']),_0x446a43);if(_0x9bd4db['query'][_0x9921('0x3e')]){_0x316385['where']=_[_0x9921('0x3f')](_0x316385[_0x9921('0x3c')],{'$or':_[_0x9921('0x2e')](_0x446a43,function(_0x105b03){if(_0x105b03[_0x9921('0x31')]!==_0x9921('0x40')){var _0x377d28={};_0x377d28[_0x105b03[_0x9921('0x2b')]]={'$like':'%'+_0x9bd4db[_0x9921('0x34')][_0x9921('0x3e')]+'%'};return _0x377d28;}})});}_0x316385=_['merge']({},_0x316385,_0x9bd4db[_0x9921('0x41')]);var _0x3573cb={'where':_0x316385[_0x9921('0x3c')]};return db[_0x9921('0x2f')][_0x9921('0x20')](_0x3573cb)[_0x9921('0x26')](function(_0x45be88){_0x3b19f2[_0x9921('0x20')]=_0x45be88;if(_0x9bd4db[_0x9921('0x34')]['includeAll']){_0x316385[_0x9921('0x42')]=[{'all':!![]}];}return db[_0x9921('0x2f')][_0x9921('0x43')](_0x316385);})[_0x9921('0x26')](function(_0x3d4566){_0x3b19f2[_0x9921('0x44')]=_0x3d4566;return _0x3b19f2;})['then'](respondWithFilteredResult(_0x2ca22b,_0x316385))[_0x9921('0x45')](handleError(_0x2ca22b,null));};exports[_0x9921('0x46')]=function(_0x477066,_0x5ea9f9){var _0x375f1f={'raw':!![],'where':{'id':_0x477066[_0x9921('0x47')]['id']}},_0x31be8b={};_0x31be8b[_0x9921('0x33')]=_[_0x9921('0x48')](db['Disposition'][_0x9921('0x30')]);_0x31be8b[_0x9921('0x34')]=_[_0x9921('0x48')](_0x477066[_0x9921('0x34')]);_0x31be8b[_0x9921('0x35')]=_[_0x9921('0x36')](_0x31be8b[_0x9921('0x33')],_0x31be8b[_0x9921('0x34')]);_0x375f1f[_0x9921('0x37')]=_['intersection'](_0x31be8b[_0x9921('0x33')],qs[_0x9921('0x38')](_0x477066['query'][_0x9921('0x38')]));_0x375f1f[_0x9921('0x37')]=_0x375f1f[_0x9921('0x37')][_0x9921('0x39')]?_0x375f1f[_0x9921('0x37')]:_0x31be8b[_0x9921('0x33')];if(_0x477066[_0x9921('0x34')][_0x9921('0x49')]){_0x375f1f[_0x9921('0x42')]=[{'all':!![]}];}_0x375f1f=_[_0x9921('0x3f')]({},_0x375f1f,_0x477066['options']);return db[_0x9921('0x2f')]['find'](_0x375f1f)[_0x9921('0x26')](handleEntityNotFound(_0x5ea9f9,null))['then'](respondWithResult(_0x5ea9f9,null))[_0x9921('0x45')](handleError(_0x5ea9f9,null));};exports[_0x9921('0x4a')]=function(_0x2ca959,_0x2251af){return db['Disposition'][_0x9921('0x4a')](_0x2ca959['body'],{})[_0x9921('0x26')](function(_0x3ec7e9){var _0x4b4371=_0x2ca959['user']['get']({'plain':!![]});if(!_0x4b4371)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b4371[_0x9921('0x4b')]===_0x9921('0x4c')){var _0x34ac06=_0x3ec7e9['get']({'plain':!![]});var _0x17e105=_0x9921('0x27');return db[_0x9921('0x4d')][_0x9921('0x4e')]({'where':{'name':_0x17e105,'userProfileId':_0x4b4371['userProfileId']},'raw':!![]})[_0x9921('0x26')](function(_0x4a8bbf){if(_0x4a8bbf&&_0x4a8bbf['autoAssociation']===0x0){return db[_0x9921('0x28')][_0x9921('0x4a')]({'name':_0x34ac06[_0x9921('0x2b')],'resourceId':_0x34ac06['id'],'type':_0x4a8bbf[_0x9921('0x2b')],'sectionId':_0x4a8bbf['id']},{})[_0x9921('0x26')](function(){return _0x3ec7e9;});}else{return _0x3ec7e9;}})[_0x9921('0x45')](function(_0x355dc6){logger['error'](_0x9921('0x4f'),_0x355dc6);throw _0x355dc6;});}return _0x3ec7e9;})['then'](respondWithResult(_0x2251af,0xc9))['catch'](handleError(_0x2251af,null));};exports[_0x9921('0x25')]=function(_0x136f07,_0x146964){if(_0x136f07[_0x9921('0x50')]['id']){delete _0x136f07[_0x9921('0x50')]['id'];}return db[_0x9921('0x2f')][_0x9921('0x4e')]({'where':{'id':_0x136f07[_0x9921('0x47')]['id']}})[_0x9921('0x26')](handleEntityNotFound(_0x146964,null))['then'](saveUpdates(_0x136f07[_0x9921('0x50')],null))['then'](respondWithResult(_0x146964,null))['catch'](handleError(_0x146964,null));};exports[_0x9921('0x29')]=function(_0x1b3ab6,_0x20b912){return db['Disposition'][_0x9921('0x4e')]({'where':{'id':_0x1b3ab6[_0x9921('0x47')]['id']}})[_0x9921('0x26')](handleEntityNotFound(_0x20b912,null))[_0x9921('0x26')](removeEntity(_0x20b912,null))[_0x9921('0x45')](handleError(_0x20b912,null));}; \ No newline at end of file +var _0xed5f=['../../mysqldb','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','Disposition','include','findAll','show','params','keys','includeAll','catch','create','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x18c51c,_0x335b14){var _0x197727=function(_0x57511d){while(--_0x57511d){_0x18c51c['push'](_0x18c51c['shift']());}};_0x197727(++_0x335b14);}(_0xed5f,0x1de));var _0xfed5=function(_0x3f3d37,_0x576f8a){_0x3f3d37=_0x3f3d37-0x0;var _0xdf0b78=_0xed5f[_0x3f3d37];return _0xdf0b78;};'use strict';var emlformat=require(_0xfed5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfed5('0x1'));var jsonpatch=require(_0xfed5('0x2'));var rp=require(_0xfed5('0x3'));var moment=require(_0xfed5('0x4'));var BPromise=require(_0xfed5('0x5'));var Mustache=require('mustache');var util=require(_0xfed5('0x6'));var path=require(_0xfed5('0x7'));var sox=require(_0xfed5('0x8'));var csv=require(_0xfed5('0x9'));var ejs=require(_0xfed5('0xa'));var fs=require('fs');var fs_extra=require(_0xfed5('0xb'));var _=require(_0xfed5('0xc'));var squel=require(_0xfed5('0xd'));var crypto=require(_0xfed5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfed5('0xf'));var toCsv=require(_0xfed5('0x9'));var querystring=require(_0xfed5('0x10'));var Papa=require('papaparse');var Redis=require(_0xfed5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfed5('0x12'));var as=require(_0xfed5('0x13'));var hardwareService=require(_0xfed5('0x14'));var logger=require(_0xfed5('0x15'))(_0xfed5('0x16'));var utils=require(_0xfed5('0x17'));var config=require(_0xfed5('0x18'));var licenseUtil=require(_0xfed5('0x19'));var db=require(_0xfed5('0x1a'))['db'];function respondWithStatusCode(_0x472cb6,_0x18671f){_0x18671f=_0x18671f||0xcc;return function(_0x178cf1){if(_0x178cf1){return _0x472cb6['sendStatus'](_0x18671f);}return _0x472cb6[_0xfed5('0x1b')](_0x18671f)[_0xfed5('0x1c')]();};}function respondWithResult(_0x14e438,_0x598dc4){_0x598dc4=_0x598dc4||0xc8;return function(_0x2e1107){if(_0x2e1107){return _0x14e438['status'](_0x598dc4)[_0xfed5('0x1d')](_0x2e1107);}};}function respondWithFilteredResult(_0x582ef5,_0x54ea2f){return function(_0x572c20){if(_0x572c20){var _0x2f18d2=typeof _0x54ea2f[_0xfed5('0x1e')]==='undefined'&&typeof _0x54ea2f['limit']==='undefined';var _0x6366a=_0x572c20[_0xfed5('0x1f')];var _0x2301e8=_0x2f18d2?0x0:_0x54ea2f[_0xfed5('0x1e')];var _0x5c7911=_0x2f18d2?_0x572c20[_0xfed5('0x1f')]:_0x54ea2f[_0xfed5('0x1e')]+_0x54ea2f[_0xfed5('0x20')];var _0x2b1833;if(_0x5c7911>=_0x6366a){_0x5c7911=_0x6366a;_0x2b1833=0xc8;}else{_0x2b1833=0xce;}_0x582ef5[_0xfed5('0x1b')](_0x2b1833);return _0x582ef5[_0xfed5('0x21')](_0xfed5('0x22'),_0x2301e8+'-'+_0x5c7911+'/'+_0x6366a)[_0xfed5('0x1d')](_0x572c20);}return null;};}function patchUpdates(_0x332c9a){return function(_0x50248a){try{jsonpatch[_0xfed5('0x23')](_0x50248a,_0x332c9a,!![]);}catch(_0x33bccb){return BPromise[_0xfed5('0x24')](_0x33bccb);}return _0x50248a['save']();};}function saveUpdates(_0x4a3b18,_0x4e661c){return function(_0x481a97){if(_0x481a97){return _0x481a97[_0xfed5('0x25')](_0x4a3b18)[_0xfed5('0x26')](function(_0xba70e3){return _0xba70e3;});}return null;};}function removeEntity(_0x1dc5f2,_0x24f27c){return function(_0x4873fe){if(_0x4873fe){return _0x4873fe['destroy']()['then'](function(){var _0x30c9ed=_0x4873fe[_0xfed5('0x27')]({'plain':!![]});var _0x1ceaae=_0xfed5('0x28');return db[_0xfed5('0x29')][_0xfed5('0x2a')]({'where':{'type':_0x1ceaae,'resourceId':_0x30c9ed['id']}})[_0xfed5('0x26')](function(){return _0x4873fe;});})['then'](function(){_0x1dc5f2[_0xfed5('0x1b')](0xcc)[_0xfed5('0x1c')]();});}};}function handleEntityNotFound(_0x3a76fb,_0x2666db){return function(_0x9ac6d7){if(!_0x9ac6d7){_0x3a76fb['sendStatus'](0x194);}return _0x9ac6d7;};}function handleError(_0x23a226,_0x41e3bf){_0x41e3bf=_0x41e3bf||0x1f4;return function(_0x2c7613){logger[_0xfed5('0x2b')](_0x2c7613[_0xfed5('0x2c')]);if(_0x2c7613[_0xfed5('0x2d')]){delete _0x2c7613[_0xfed5('0x2d')];}_0x23a226[_0xfed5('0x1b')](_0x41e3bf)[_0xfed5('0x2e')](_0x2c7613);};}exports[_0xfed5('0x2f')]=function(_0x226aa6,_0xedd31a){var _0x4e8add={},_0x150f7b={},_0x2fb584={'count':0x0,'rows':[]};var _0x3eb370=_[_0xfed5('0x30')](db['Disposition'][_0xfed5('0x31')],function(_0x4bf4c0){return{'name':_0x4bf4c0['fieldName'],'type':_0x4bf4c0['type'][_0xfed5('0x32')]};});_0x150f7b[_0xfed5('0x33')]=_[_0xfed5('0x30')](_0x3eb370,'name');_0x150f7b[_0xfed5('0x34')]=_['keys'](_0x226aa6[_0xfed5('0x34')]);_0x150f7b['filters']=_[_0xfed5('0x35')](_0x150f7b['model'],_0x150f7b[_0xfed5('0x34')]);_0x4e8add[_0xfed5('0x36')]=_[_0xfed5('0x35')](_0x150f7b['model'],qs[_0xfed5('0x37')](_0x226aa6[_0xfed5('0x34')][_0xfed5('0x37')]));_0x4e8add[_0xfed5('0x36')]=_0x4e8add[_0xfed5('0x36')][_0xfed5('0x38')]?_0x4e8add[_0xfed5('0x36')]:_0x150f7b[_0xfed5('0x33')];if(!_0x226aa6['query'][_0xfed5('0x39')](_0xfed5('0x3a'))){_0x4e8add[_0xfed5('0x20')]=qs[_0xfed5('0x20')](_0x226aa6[_0xfed5('0x34')][_0xfed5('0x20')]);_0x4e8add[_0xfed5('0x1e')]=qs[_0xfed5('0x1e')](_0x226aa6['query']['offset']);}_0x4e8add[_0xfed5('0x3b')]=qs[_0xfed5('0x3c')](_0x226aa6['query'][_0xfed5('0x3c')]);_0x4e8add[_0xfed5('0x3d')]=qs[_0xfed5('0x3e')](_[_0xfed5('0x3f')](_0x226aa6[_0xfed5('0x34')],_0x150f7b[_0xfed5('0x3e')]),_0x3eb370);if(_0x226aa6['query'][_0xfed5('0x40')]){_0x4e8add[_0xfed5('0x3d')]=_[_0xfed5('0x41')](_0x4e8add[_0xfed5('0x3d')],{'$or':_[_0xfed5('0x30')](_0x3eb370,function(_0x6e4691){if(_0x6e4691[_0xfed5('0x42')]!==_0xfed5('0x43')){var _0x50a6be={};_0x50a6be[_0x6e4691[_0xfed5('0x2d')]]={'$like':'%'+_0x226aa6['query'][_0xfed5('0x40')]+'%'};return _0x50a6be;}})});}_0x4e8add=_[_0xfed5('0x41')]({},_0x4e8add,_0x226aa6[_0xfed5('0x44')]);var _0x9aaaea={'where':_0x4e8add[_0xfed5('0x3d')]};return db[_0xfed5('0x45')][_0xfed5('0x1f')](_0x9aaaea)[_0xfed5('0x26')](function(_0x15eef1){_0x2fb584[_0xfed5('0x1f')]=_0x15eef1;if(_0x226aa6[_0xfed5('0x34')]['includeAll']){_0x4e8add[_0xfed5('0x46')]=[{'all':!![]}];}return db[_0xfed5('0x45')][_0xfed5('0x47')](_0x4e8add);})['then'](function(_0xba01c){_0x2fb584['rows']=_0xba01c;return _0x2fb584;})[_0xfed5('0x26')](respondWithFilteredResult(_0xedd31a,_0x4e8add))['catch'](handleError(_0xedd31a,null));};exports[_0xfed5('0x48')]=function(_0x8abdb6,_0x24dd8c){var _0x2a5018={'raw':!![],'where':{'id':_0x8abdb6[_0xfed5('0x49')]['id']}},_0x26d68a={};_0x26d68a[_0xfed5('0x33')]=_[_0xfed5('0x4a')](db[_0xfed5('0x45')]['rawAttributes']);_0x26d68a[_0xfed5('0x34')]=_[_0xfed5('0x4a')](_0x8abdb6[_0xfed5('0x34')]);_0x26d68a[_0xfed5('0x3e')]=_['intersection'](_0x26d68a[_0xfed5('0x33')],_0x26d68a[_0xfed5('0x34')]);_0x2a5018[_0xfed5('0x36')]=_['intersection'](_0x26d68a['model'],qs[_0xfed5('0x37')](_0x8abdb6[_0xfed5('0x34')][_0xfed5('0x37')]));_0x2a5018[_0xfed5('0x36')]=_0x2a5018[_0xfed5('0x36')][_0xfed5('0x38')]?_0x2a5018['attributes']:_0x26d68a[_0xfed5('0x33')];if(_0x8abdb6[_0xfed5('0x34')][_0xfed5('0x4b')]){_0x2a5018[_0xfed5('0x46')]=[{'all':!![]}];}_0x2a5018=_[_0xfed5('0x41')]({},_0x2a5018,_0x8abdb6[_0xfed5('0x44')]);return db['Disposition']['find'](_0x2a5018)[_0xfed5('0x26')](handleEntityNotFound(_0x24dd8c,null))['then'](respondWithResult(_0x24dd8c,null))[_0xfed5('0x4c')](handleError(_0x24dd8c,null));};exports[_0xfed5('0x4d')]=function(_0xfd12e5,_0x3deae9){return db[_0xfed5('0x45')][_0xfed5('0x4d')](_0xfd12e5['body'],{})[_0xfed5('0x26')](function(_0x571fbb){var _0x581530=_0xfd12e5['user'][_0xfed5('0x27')]({'plain':!![]});if(!_0x581530)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x581530[_0xfed5('0x4e')]===_0xfed5('0x4f')){var _0x4c6ccf=_0x571fbb['get']({'plain':!![]});var _0x142178='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x142178,'userProfileId':_0x581530['userProfileId']},'raw':!![]})[_0xfed5('0x26')](function(_0x2c432e){if(_0x2c432e&&_0x2c432e[_0xfed5('0x50')]===0x0){return db[_0xfed5('0x29')]['create']({'name':_0x4c6ccf[_0xfed5('0x2d')],'resourceId':_0x4c6ccf['id'],'type':_0x2c432e[_0xfed5('0x2d')],'sectionId':_0x2c432e['id']},{})['then'](function(){return _0x571fbb;});}else{return _0x571fbb;}})[_0xfed5('0x4c')](function(_0xc8fd19){logger[_0xfed5('0x2b')](_0xfed5('0x51'),_0xc8fd19);throw _0xc8fd19;});}return _0x571fbb;})[_0xfed5('0x26')](respondWithResult(_0x3deae9,0xc9))[_0xfed5('0x4c')](handleError(_0x3deae9,null));};exports[_0xfed5('0x25')]=function(_0x1fd6a1,_0x580ba4){if(_0x1fd6a1[_0xfed5('0x52')]['id']){delete _0x1fd6a1['body']['id'];}return db[_0xfed5('0x45')][_0xfed5('0x53')]({'where':{'id':_0x1fd6a1[_0xfed5('0x49')]['id']}})['then'](handleEntityNotFound(_0x580ba4,null))[_0xfed5('0x26')](saveUpdates(_0x1fd6a1[_0xfed5('0x52')],null))[_0xfed5('0x26')](respondWithResult(_0x580ba4,null))[_0xfed5('0x4c')](handleError(_0x580ba4,null));};exports['destroy']=function(_0xa8ab0c,_0x3910e7){return db['Disposition'][_0xfed5('0x53')]({'where':{'id':_0xa8ab0c[_0xfed5('0x49')]['id']}})[_0xfed5('0x26')](handleEntityNotFound(_0x3910e7,null))[_0xfed5('0x26')](removeEntity(_0x3910e7,null))[_0xfed5('0x4c')](handleError(_0x3910e7,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 9310c1a..9c47e9b 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 _0x69d1=['define','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./disposition.attributes','exports'];(function(_0x50bb31,_0x146e61){var _0xc14660=function(_0x213605){while(--_0x213605){_0x50bb31['push'](_0x50bb31['shift']());}};_0xc14660(++_0x146e61);}(_0x69d1,0x98));var _0x169d=function(_0x4b65f1,_0x3dfc92){_0x4b65f1=_0x4b65f1-0x0;var _0x4efedd=_0x69d1[_0x4b65f1];return _0x4efedd;};'use strict';var _=require(_0x169d('0x0'));var util=require(_0x169d('0x1'));var logger=require(_0x169d('0x2'))('api');var moment=require(_0x169d('0x3'));var BPromise=require('bluebird');var rp=require(_0x169d('0x4'));var fs=require('fs');var path=require(_0x169d('0x5'));var rimraf=require('rimraf');var config=require(_0x169d('0x6'));var attributes=require(_0x169d('0x7'));module[_0x169d('0x8')]=function(_0x1de60a,_0x40d76e){return _0x1de60a[_0x169d('0x9')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x169d('0xa'),'fields':['name',_0x169d('0xb')]},{'unique':!![],'name':_0x169d('0xc'),'fields':[_0x169d('0xd'),_0x169d('0xe')]},{'unique':!![],'name':_0x169d('0xf'),'fields':[_0x169d('0xd'),_0x169d('0x10')]},{'unique':!![],'name':_0x169d('0x11'),'fields':[_0x169d('0xd'),_0x169d('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0x169d('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x169d('0x13'),'fields':['name',_0x169d('0x14')]},{'unique':!![],'name':_0x169d('0x15'),'fields':[_0x169d('0xd'),_0x169d('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2cc1=['name','ListId','name_chat','ChatWebsiteId','name_mail','SmsAccountId','FaxAccountId','name_openchannel','WhatsappAccountId','util','api','bluebird','path','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice'];(function(_0x512404,_0x107480){var _0xb9bfa7=function(_0x2b5cd1){while(--_0x2b5cd1){_0x512404['push'](_0x512404['shift']());}};_0xb9bfa7(++_0x107480);}(_0x2cc1,0x8e));var _0x12cc=function(_0x5bfee6,_0x3e9443){_0x5bfee6=_0x5bfee6-0x0;var _0x4aad05=_0x2cc1[_0x5bfee6];return _0x4aad05;};'use strict';var _=require('lodash');var util=require(_0x12cc('0x0'));var logger=require('../../config/logger')(_0x12cc('0x1'));var moment=require('moment');var BPromise=require(_0x12cc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12cc('0x3'));var rimraf=require('rimraf');var config=require(_0x12cc('0x4'));var attributes=require(_0x12cc('0x5'));module['exports']=function(_0x1d58e5,_0x5a9465){return _0x1d58e5[_0x12cc('0x6')](_0x12cc('0x7'),attributes,{'tableName':_0x12cc('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x12cc('0x9'),'fields':[_0x12cc('0xa'),_0x12cc('0xb')]},{'unique':!![],'name':_0x12cc('0xc'),'fields':[_0x12cc('0xa'),_0x12cc('0xd')]},{'unique':!![],'name':_0x12cc('0xe'),'fields':[_0x12cc('0xa'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x12cc('0xa'),_0x12cc('0xf')]},{'unique':!![],'name':'name_fax','fields':[_0x12cc('0xa'),_0x12cc('0x10')]},{'unique':!![],'name':_0x12cc('0x11'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x12cc('0xa'),_0x12cc('0x12')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 05e0f0c..272dd65 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(_0x1a78a4,_0x3f8fff){var _0x22a5df=function(_0x17eaf8){while(--_0x17eaf8){_0x1a78a4['push'](_0x1a78a4['shift']());}};_0x22a5df(++_0x3f8fff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x1fe02e,_0x3c8bec){var _0x4b9870=function(_0x2862e7){while(--_0x2862e7){_0x1fe02e['push'](_0x1fe02e['shift']());}};_0x4b9870(++_0x3c8bec);}(_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 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 0c67e46..313df05 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 _0xc0b9=['update','delete','destroy','multer','path','express','Router','fs-extra','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x337dde,_0x2bccff){var _0x487077=function(_0x1d9ec6){while(--_0x1d9ec6){_0x337dde['push'](_0x337dde['shift']());}};_0x487077(++_0x2bccff);}(_0xc0b9,0x19b));var _0x9c0b=function(_0x233862,_0xd4a795){_0x233862=_0x233862-0x0;var _0x1c174a=_0xc0b9[_0x233862];return _0x1c174a;};'use strict';var multer=require(_0x9c0b('0x0'));var util=require('util');var path=require(_0x9c0b('0x1'));var timeout=require('connect-timeout');var express=require(_0x9c0b('0x2'));var router=express[_0x9c0b('0x3')]();var fs_extra=require(_0x9c0b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9c0b('0x5'));var controller=require(_0x9c0b('0x6'));router[_0x9c0b('0x7')]('/',auth[_0x9c0b('0x8')](),controller['index']);router[_0x9c0b('0x7')](_0x9c0b('0x9'),auth[_0x9c0b('0x8')](),controller[_0x9c0b('0xa')]);router[_0x9c0b('0xb')]('/',auth[_0x9c0b('0x8')](),controller[_0x9c0b('0xc')]);router[_0x9c0b('0xd')](_0x9c0b('0x9'),auth[_0x9c0b('0x8')](),controller[_0x9c0b('0xe')]);router[_0x9c0b('0xf')](_0x9c0b('0x9'),auth['isAuthenticated'](),controller[_0x9c0b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc282=['get','isAuthenticated','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','index'];(function(_0x1fa362,_0x5f694d){var _0x46201b=function(_0x305fcf){while(--_0x305fcf){_0x1fa362['push'](_0x1fa362['shift']());}};_0x46201b(++_0x5f694d);}(_0xc282,0x139));var _0x2c28=function(_0x5d4d15,_0x537ed8){_0x5d4d15=_0x5d4d15-0x0;var _0x4233fa=_0xc282[_0x5d4d15];return _0x4233fa;};'use strict';var multer=require(_0x2c28('0x0'));var util=require(_0x2c28('0x1'));var path=require(_0x2c28('0x2'));var timeout=require(_0x2c28('0x3'));var express=require(_0x2c28('0x4'));var router=express[_0x2c28('0x5')]();var fs_extra=require(_0x2c28('0x6'));var auth=require(_0x2c28('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2c28('0x8'));var controller=require(_0x2c28('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x2c28('0xa')]);router[_0x2c28('0xb')]('/:id',auth[_0x2c28('0xc')](),controller['show']);router['post']('/',auth[_0x2c28('0xc')](),controller['create']);router[_0x2c28('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x2c28('0xe')]);router[_0x2c28('0xf')](_0x2c28('0x10'),auth[_0x2c28('0xc')](),controller['destroy']);module[_0x2c28('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 105fe92..b5056ca 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 _0x3d2c=['xCALLY\x20Motion\x20Fax','ENUM','2400','4800','7200','12000','14400','INTEGER','SIP','IAX','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','exports','STRING','yes'];(function(_0x91c702,_0x3277df){var _0x25abbb=function(_0x3b6ccd){while(--_0x3b6ccd){_0x91c702['push'](_0x91c702['shift']());}};_0x25abbb(++_0x3277df);}(_0x3d2c,0x1b2));var _0xc3d2=function(_0x3c1197,_0x3360bf){_0x3c1197=_0x3c1197-0x0;var _0x104f99=_0x3d2c[_0x3c1197];return _0x104f99;};'use strict';var Sequelize=require('sequelize');module[_0xc3d2('0x0')]={'name':{'type':Sequelize[_0xc3d2('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc3d2('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0xc3d2('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xc3d2('0x1')],'defaultValue':_0xc3d2('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xc3d2('0x4')](_0xc3d2('0x5'),_0xc3d2('0x6'),_0xc3d2('0x7'),'9600',_0xc3d2('0x8'),_0xc3d2('0x9')),'defaultValue':_0xc3d2('0x6')},'maxrate':{'type':Sequelize['ENUM'](_0xc3d2('0x5'),_0xc3d2('0x6'),'7200','9600','12000','14400'),'defaultValue':_0xc3d2('0x9')},'modem':{'type':Sequelize[_0xc3d2('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xc3d2('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc3d2('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc3d2('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc3d2('0x4')](_0xc3d2('0xb'),_0xc3d2('0xc'),'DADHI',_0xc3d2('0xd')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xc3d2('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc3d2('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc3d2('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc3d2('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc3d2('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc3d2('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc3d2('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc3d2('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xc3d2('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xc3d2('0xf')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x97dbd6){if(!_0x97dbd6)this[_0xc3d2('0x11')]('mandatoryDispositionPauseId',null);this[_0xc3d2('0x11')](_0xc3d2('0x12'),_0x97dbd6);}}}; \ No newline at end of file +var _0x8338=['IAX','KHOMP','SIP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','9600','12000','14400','2400','v17,v27,v29','INTEGER'];(function(_0x44d7af,_0x5bf07f){var _0x1dd015=function(_0xcce54b){while(--_0xcce54b){_0x44d7af['push'](_0x44d7af['shift']());}};_0x1dd015(++_0x5bf07f);}(_0x8338,0x195));var _0x8833=function(_0xb20c5f,_0x599088){_0xb20c5f=_0xb20c5f-0x0;var _0x459d8d=_0x8338[_0xb20c5f];return _0x459d8d;};'use strict';var Sequelize=require(_0x8833('0x0'));module['exports']={'name':{'type':Sequelize[_0x8833('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8833('0x1')]},'ecm':{'type':Sequelize[_0x8833('0x2')](_0x8833('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x8833('0x1')],'defaultValue':_0x8833('0x4')},'localstationid':{'type':Sequelize[_0x8833('0x1')],'unique':_0x8833('0x5')},'minrate':{'type':Sequelize[_0x8833('0x2')]('2400',_0x8833('0x6'),'7200',_0x8833('0x7'),_0x8833('0x8'),_0x8833('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x8833('0x2')](_0x8833('0xa'),'4800','7200','9600','12000',_0x8833('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x8833('0x1')],'defaultValue':_0x8833('0xb')},'gateway':{'type':Sequelize[_0x8833('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x8833('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8833('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x8833('0xd'),'DADHI',_0x8833('0xe')),'defaultValue':_0x8833('0xf')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8833('0x10');}},'notificationSound':{'type':Sequelize[_0x8833('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8833('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8833('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8833('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8833('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8833('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8833('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8833('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x8833('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x8833('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x223ad9){if(!_0x223ad9)this[_0x8833('0x13')](_0x8833('0x14'),null);this['setDataValue'](_0x8833('0x15'),_0x223ad9);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index a551e0e..98ae9f5 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 _0x1610=['isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','localhost','./faxAccount.socket','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','get','FaxAccounts','UserProfileResource','name','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','params','length','options','create','body','find','userProfileId','autoAssociation','destroy','describe','addDisposition','Disposition','getDispositions','findOne','keys','FaxAccountId','includeAll','removeDispositions','ids','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','stack','finally','send','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','Set','gateway','maxrate','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','addAccountApplications','VoiceExtension','updateAccountApplications','bulkCreate','tech','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','defaults','List\x20not\x20found','Send\x20Fax\x20failed','user','out','Messages','spread','filename','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents'];(function(_0x9f8671,_0x434bbc){var _0x4208fa=function(_0x3c31ef){while(--_0x3c31ef){_0x9f8671['push'](_0x9f8671['shift']());}};_0x4208fa(++_0x434bbc);}(_0x1610,0x18d));var _0x0161=function(_0x3b633e,_0x90c602){_0x3b633e=_0x3b633e-0x0;var _0x252992=_0x1610[_0x3b633e];return _0x252992;};'use strict';var emlformat=require(_0x0161('0x0'));var rimraf=require(_0x0161('0x1'));var zipdir=require(_0x0161('0x2'));var jsonpatch=require(_0x0161('0x3'));var rp=require(_0x0161('0x4'));var moment=require(_0x0161('0x5'));var BPromise=require(_0x0161('0x6'));var Mustache=require(_0x0161('0x7'));var util=require(_0x0161('0x8'));var path=require(_0x0161('0x9'));var sox=require(_0x0161('0xa'));var csv=require(_0x0161('0xb'));var ejs=require(_0x0161('0xc'));var fs=require('fs');var fs_extra=require(_0x0161('0xd'));var _=require(_0x0161('0xe'));var squel=require(_0x0161('0xf'));var crypto=require('crypto');var jsforce=require(_0x0161('0x10'));var deskjs=require(_0x0161('0x11'));var toCsv=require(_0x0161('0xb'));var querystring=require(_0x0161('0x12'));var Papa=require('papaparse');var Redis=require(_0x0161('0x13'));var authService=require(_0x0161('0x14'));var qs=require(_0x0161('0x15'));var as=require(_0x0161('0x16'));var hardwareService=require(_0x0161('0x17'));var logger=require(_0x0161('0x18'))('api');var utils=require(_0x0161('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0161('0x1a')]=_['defaults'](config['redis'],{'host':_0x0161('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0161('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0161('0x1d')][_0x0161('0x1e')]({'port':0x232c});var client9002=jayson[_0x0161('0x1d')][_0x0161('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3c8bf6,_0x5a683e,_0x4c8e76,_0x2de3d8){return new BPromise(function(_0xce6b84,_0x12ce53){var _0x1fb875=_0x2de3d8||client;return _0x1fb875[_0x0161('0x1f')](_0x3c8bf6,_0x4c8e76)[_0x0161('0x20')](function(_0x2f9ecf){logger[_0x0161('0x21')](_0x0161('0x22'),_0x5a683e,_0x0161('0x23'));logger[_0x0161('0x24')](_0x0161('0x25'),_0x5a683e,_0x0161('0x23'),JSON[_0x0161('0x26')](_0x2f9ecf));if(_0x2f9ecf[_0x0161('0x27')]){if(_0x2f9ecf[_0x0161('0x27')][_0x0161('0x28')]===0x1f4){logger[_0x0161('0x27')](_0x0161('0x22'),_0x5a683e,_0x2f9ecf[_0x0161('0x27')][_0x0161('0x29')]);return _0x12ce53(_0x2f9ecf[_0x0161('0x27')][_0x0161('0x29')]);}logger['error'](_0x0161('0x22'),_0x5a683e,_0x2f9ecf[_0x0161('0x27')][_0x0161('0x29')]);return _0xce6b84(_0x2f9ecf['error'][_0x0161('0x29')]);}else{logger[_0x0161('0x21')]('FaxAccount,\x20%s,\x20%s',_0x5a683e,_0x0161('0x23'));_0xce6b84(_0x2f9ecf[_0x0161('0x2a')]['message']);}})[_0x0161('0x2b')](function(_0x49fc56){logger[_0x0161('0x27')](_0x0161('0x22'),_0x5a683e,_0x49fc56);_0x12ce53(_0x49fc56);});});}function respondWithStatusCode(_0xb25e94,_0x1b691a){_0x1b691a=_0x1b691a||0xcc;return function(_0x334654){if(_0x334654){return _0xb25e94[_0x0161('0x2c')](_0x1b691a);}return _0xb25e94['status'](_0x1b691a)[_0x0161('0x2d')]();};}function respondWithResult(_0x1da8c2,_0x1f8663){_0x1f8663=_0x1f8663||0xc8;return function(_0x2ffe15){if(_0x2ffe15){return _0x1da8c2[_0x0161('0x2e')](_0x1f8663)[_0x0161('0x2f')](_0x2ffe15);}};}function respondWithFilteredResult(_0x2328fc,_0xb82feb){return function(_0x1ccf05){if(_0x1ccf05){var _0x1727da=typeof _0xb82feb[_0x0161('0x30')]===_0x0161('0x31')&&typeof _0xb82feb['limit']===_0x0161('0x31');var _0x171f89=_0x1ccf05[_0x0161('0x32')];var _0x552b77=_0x1727da?0x0:_0xb82feb[_0x0161('0x30')];var _0x2efbb3=_0x1727da?_0x1ccf05[_0x0161('0x32')]:_0xb82feb[_0x0161('0x30')]+_0xb82feb[_0x0161('0x33')];var _0x16c7d0;if(_0x2efbb3>=_0x171f89){_0x2efbb3=_0x171f89;_0x16c7d0=0xc8;}else{_0x16c7d0=0xce;}_0x2328fc[_0x0161('0x2e')](_0x16c7d0);return _0x2328fc[_0x0161('0x34')](_0x0161('0x35'),_0x552b77+'-'+_0x2efbb3+'/'+_0x171f89)['json'](_0x1ccf05);}return null;};}function patchUpdates(_0x2d8d35){return function(_0x169bda){try{jsonpatch[_0x0161('0x36')](_0x169bda,_0x2d8d35,!![]);}catch(_0x4aaff4){return BPromise[_0x0161('0x37')](_0x4aaff4);}return _0x169bda[_0x0161('0x38')]();};}function saveUpdates(_0x4efa48,_0x35700a){return function(_0x799474){if(_0x799474){return _0x799474[_0x0161('0x39')](_0x4efa48)[_0x0161('0x20')](function(_0x15468c){return _0x15468c;});}return null;};}function removeEntity(_0x4bd0b7,_0x1f9d78){return function(_0x5f0c91){if(_0x5f0c91){return _0x5f0c91['destroy']()['then'](function(){var _0x3be4e8=_0x5f0c91[_0x0161('0x3a')]({'plain':!![]});var _0x3b4f15=_0x0161('0x3b');return db[_0x0161('0x3c')]['destroy']({'where':{'type':_0x3b4f15,'resourceId':_0x3be4e8['id']}})[_0x0161('0x20')](function(){return _0x5f0c91;});})[_0x0161('0x20')](function(){_0x4bd0b7[_0x0161('0x2e')](0xcc)[_0x0161('0x2d')]();});}};}function handleEntityNotFound(_0x33fa68,_0x367f8d){return function(_0x18d26f){if(!_0x18d26f){_0x33fa68[_0x0161('0x2c')](0x194);}return _0x18d26f;};}function handleError(_0x295382,_0x2cb81a){_0x2cb81a=_0x2cb81a||0x1f4;return function(_0x3e56f2){logger[_0x0161('0x27')](_0x3e56f2['stack']);if(_0x3e56f2[_0x0161('0x3d')]){delete _0x3e56f2[_0x0161('0x3d')];}_0x295382['status'](_0x2cb81a)['send'](_0x3e56f2);};}exports['index']=function(_0x1287ad,_0x562ca8){var _0x1f58b2={'include':[{'model':db[_0x0161('0x3e')],'as':_0x0161('0x3f')}]},_0x4786cc={},_0x24db41={'count':0x0,'rows':[]};var _0x2bf7eb=_[_0x0161('0x40')](db[_0x0161('0x41')][_0x0161('0x42')],function(_0x2d4a99){return{'name':_0x2d4a99[_0x0161('0x43')],'type':_0x2d4a99[_0x0161('0x44')][_0x0161('0x45')]};});_0x4786cc[_0x0161('0x46')]=_['map'](_0x2bf7eb,_0x0161('0x3d'));_0x4786cc[_0x0161('0x47')]=_['keys'](_0x1287ad[_0x0161('0x47')]);_0x4786cc[_0x0161('0x48')]=_[_0x0161('0x49')](_0x4786cc[_0x0161('0x46')],_0x4786cc[_0x0161('0x47')]);_0x1f58b2['attributes']=_[_0x0161('0x49')](_0x4786cc['model'],qs[_0x0161('0x4a')](_0x1287ad['query'][_0x0161('0x4a')]));_0x1f58b2['attributes']=_0x1f58b2['attributes']['length']?_0x1f58b2[_0x0161('0x4b')]:_0x4786cc[_0x0161('0x46')];if(!_0x1287ad[_0x0161('0x47')][_0x0161('0x4c')](_0x0161('0x4d'))){_0x1f58b2[_0x0161('0x33')]=qs[_0x0161('0x33')](_0x1287ad['query'][_0x0161('0x33')]);_0x1f58b2[_0x0161('0x30')]=qs[_0x0161('0x30')](_0x1287ad['query'][_0x0161('0x30')]);}_0x1f58b2[_0x0161('0x4e')]=qs[_0x0161('0x4f')](_0x1287ad[_0x0161('0x47')][_0x0161('0x4f')]);_0x1f58b2['where']=qs[_0x0161('0x48')](_[_0x0161('0x50')](_0x1287ad[_0x0161('0x47')],_0x4786cc[_0x0161('0x48')]),_0x2bf7eb);if(_0x1287ad[_0x0161('0x47')][_0x0161('0x51')]){_0x1f58b2[_0x0161('0x52')]=_['merge'](_0x1f58b2[_0x0161('0x52')],{'$or':_[_0x0161('0x40')](_0x2bf7eb,function(_0x35a511){if(_0x35a511[_0x0161('0x44')]!==_0x0161('0x53')){var _0x3c32fc={};_0x3c32fc[_0x35a511[_0x0161('0x3d')]]={'$like':'%'+_0x1287ad[_0x0161('0x47')][_0x0161('0x51')]+'%'};return _0x3c32fc;}})});}_0x1f58b2=_[_0x0161('0x54')]({},_0x1f58b2,_0x1287ad['options']);var _0x5a44da={'where':_0x1f58b2['where']};return db[_0x0161('0x41')][_0x0161('0x32')](_0x5a44da)[_0x0161('0x20')](function(_0x469298){_0x24db41[_0x0161('0x32')]=_0x469298;if(_0x1287ad[_0x0161('0x47')]['includeAll']){_0x1f58b2[_0x0161('0x55')]=[{'all':!![]}];}return db[_0x0161('0x41')][_0x0161('0x56')](_0x1f58b2);})[_0x0161('0x20')](function(_0x1a77ca){_0x24db41[_0x0161('0x57')]=_0x1a77ca;return _0x24db41;})[_0x0161('0x20')](respondWithFilteredResult(_0x562ca8,_0x1f58b2))[_0x0161('0x2b')](handleError(_0x562ca8,null));};exports['show']=function(_0x507d67,_0x542e65){var _0x470924={'raw':![],'where':{'id':_0x507d67[_0x0161('0x58')]['id']},'include':[{'model':db[_0x0161('0x3e')],'as':'mandatoryDispositionPause'}]},_0x1bb878={};_0x1bb878[_0x0161('0x46')]=_['keys'](db[_0x0161('0x41')][_0x0161('0x42')]);_0x1bb878[_0x0161('0x47')]=_['keys'](_0x507d67[_0x0161('0x47')]);_0x1bb878[_0x0161('0x48')]=_[_0x0161('0x49')](_0x1bb878[_0x0161('0x46')],_0x1bb878[_0x0161('0x47')]);_0x470924['attributes']=_[_0x0161('0x49')](_0x1bb878[_0x0161('0x46')],qs[_0x0161('0x4a')](_0x507d67[_0x0161('0x47')][_0x0161('0x4a')]));_0x470924[_0x0161('0x4b')]=_0x470924[_0x0161('0x4b')][_0x0161('0x59')]?_0x470924['attributes']:_0x1bb878[_0x0161('0x46')];if(_0x507d67[_0x0161('0x47')]['includeAll']){_0x470924[_0x0161('0x55')]=[{'all':!![]}];}_0x470924=_['merge']({},_0x470924,_0x507d67[_0x0161('0x5a')]);return db['FaxAccount']['find'](_0x470924)['then'](handleEntityNotFound(_0x542e65,null))[_0x0161('0x20')](respondWithResult(_0x542e65,null))[_0x0161('0x2b')](handleError(_0x542e65,null));};exports[_0x0161('0x5b')]=function(_0x305e07,_0x13d02b){return db['FaxAccount'][_0x0161('0x5b')](_0x305e07[_0x0161('0x5c')],{})[_0x0161('0x20')](function(_0x474644){var _0x3385d3=_0x305e07['user'][_0x0161('0x3a')]({'plain':!![]});if(!_0x3385d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3385d3['role']==='user'){var _0x4057b5=_0x474644['get']({'plain':!![]});var _0x49dc4c=_0x0161('0x3b');return db['UserProfileSection'][_0x0161('0x5d')]({'where':{'name':_0x49dc4c,'userProfileId':_0x3385d3[_0x0161('0x5e')]},'raw':!![]})[_0x0161('0x20')](function(_0xa35668){if(_0xa35668&&_0xa35668[_0x0161('0x5f')]===0x0){return db[_0x0161('0x3c')]['create']({'name':_0x4057b5[_0x0161('0x3d')],'resourceId':_0x4057b5['id'],'type':_0xa35668[_0x0161('0x3d')],'sectionId':_0xa35668['id']},{})[_0x0161('0x20')](function(){return _0x474644;});}else{return _0x474644;}})[_0x0161('0x2b')](function(_0x1e5b2e){logger[_0x0161('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e5b2e);throw _0x1e5b2e;});}return _0x474644;})[_0x0161('0x20')](respondWithResult(_0x13d02b,0xc9))[_0x0161('0x2b')](handleError(_0x13d02b,null));};exports[_0x0161('0x39')]=function(_0x532cf5,_0x1106a4){if(_0x532cf5['body']['id']){delete _0x532cf5[_0x0161('0x5c')]['id'];}return db[_0x0161('0x41')][_0x0161('0x5d')]({'where':{'id':_0x532cf5[_0x0161('0x58')]['id']},'include':[{'model':db[_0x0161('0x3e')],'as':_0x0161('0x3f')}]})[_0x0161('0x20')](handleEntityNotFound(_0x1106a4,null))['then'](saveUpdates(_0x532cf5['body'],null))[_0x0161('0x20')](respondWithResult(_0x1106a4,null))[_0x0161('0x2b')](handleError(_0x1106a4,null));};exports[_0x0161('0x60')]=function(_0xadb9c6,_0x30a572){return db[_0x0161('0x41')][_0x0161('0x5d')]({'where':{'id':_0xadb9c6[_0x0161('0x58')]['id']}})[_0x0161('0x20')](handleEntityNotFound(_0x30a572,null))[_0x0161('0x20')](removeEntity(_0x30a572,null))['catch'](handleError(_0x30a572,null));};exports[_0x0161('0x61')]=function(_0x93c17,_0x3a645c){return db[_0x0161('0x41')][_0x0161('0x61')]()[_0x0161('0x20')](respondWithResult(_0x3a645c,null))[_0x0161('0x2b')](handleError(_0x3a645c,null));};exports[_0x0161('0x62')]=function(_0x53caa9,_0x251e9b,_0x551c54){if(_0x53caa9['body']['id']){delete _0x53caa9[_0x0161('0x5c')]['id'];}return db[_0x0161('0x41')]['find']({'where':{'id':_0x53caa9[_0x0161('0x58')]['id']}})['then'](handleEntityNotFound(_0x251e9b,null))['then'](function(_0x57748e){if(_0x57748e){_0x53caa9[_0x0161('0x5c')]['FaxAccountId']=_0x57748e['id'];return db[_0x0161('0x63')][_0x0161('0x5b')](_0x53caa9[_0x0161('0x5c')]);}})[_0x0161('0x20')](respondWithResult(_0x251e9b,null))['catch'](handleError(_0x251e9b,null));};exports[_0x0161('0x64')]=function(_0x9669b1,_0x5664f3,_0x37cf11){var _0x3b77ca={'raw':![],'where':{}};var _0x346394={};var _0x4ac8b2={'count':0x0,'rows':[]};return db[_0x0161('0x41')][_0x0161('0x65')]({'where':{'id':_0x9669b1['params']['id']}})['then'](handleEntityNotFound(_0x5664f3,null))[_0x0161('0x20')](function(_0x150e76){if(_0x150e76){_0x346394[_0x0161('0x46')]=_[_0x0161('0x66')](db[_0x0161('0x63')]['rawAttributes']);_0x346394[_0x0161('0x47')]=_[_0x0161('0x66')](_0x9669b1[_0x0161('0x47')]);_0x346394[_0x0161('0x48')]=_[_0x0161('0x49')](_0x346394[_0x0161('0x46')],_0x346394[_0x0161('0x47')]);_0x3b77ca[_0x0161('0x4b')]=_[_0x0161('0x49')](_0x346394[_0x0161('0x46')],qs['fields'](_0x9669b1[_0x0161('0x47')][_0x0161('0x4a')]));_0x3b77ca[_0x0161('0x4b')]=_0x3b77ca[_0x0161('0x4b')][_0x0161('0x59')]?_0x3b77ca[_0x0161('0x4b')]:_0x346394[_0x0161('0x46')];if(!_0x9669b1[_0x0161('0x47')][_0x0161('0x4c')](_0x0161('0x4d'))){_0x3b77ca[_0x0161('0x33')]=qs['limit'](_0x9669b1[_0x0161('0x47')][_0x0161('0x33')]);_0x3b77ca['offset']=qs[_0x0161('0x30')](_0x9669b1[_0x0161('0x47')][_0x0161('0x30')]);}_0x3b77ca[_0x0161('0x4e')]=qs[_0x0161('0x4f')](_0x9669b1['query'][_0x0161('0x4f')]);_0x3b77ca[_0x0161('0x52')]=qs['filters'](_[_0x0161('0x50')](_0x9669b1['query'],_0x346394[_0x0161('0x48')]));_0x3b77ca['where'][_0x0161('0x67')]=_0x150e76['id'];if(_0x9669b1[_0x0161('0x47')][_0x0161('0x51')]){_0x3b77ca[_0x0161('0x52')]=_[_0x0161('0x54')](_0x3b77ca[_0x0161('0x52')],{'$or':_[_0x0161('0x40')](_0x3b77ca[_0x0161('0x4b')],function(_0xa8abaf){var _0x317221={};_0x317221[_0xa8abaf]={'$like':'%'+_0x9669b1[_0x0161('0x47')][_0x0161('0x51')]+'%'};return _0x317221;})});}_0x3b77ca=_[_0x0161('0x54')]({},_0x3b77ca,_0x9669b1['options']);return db[_0x0161('0x63')][_0x0161('0x32')]({'where':_0x3b77ca[_0x0161('0x52')]})[_0x0161('0x20')](function(_0x2c0fa1){_0x4ac8b2[_0x0161('0x32')]=_0x2c0fa1;if(_0x9669b1['query'][_0x0161('0x68')]){_0x3b77ca[_0x0161('0x55')]=[{'all':!![]}];}return db[_0x0161('0x63')][_0x0161('0x56')](_0x3b77ca);})[_0x0161('0x20')](function(_0x22b91e){_0x4ac8b2['rows']=_0x22b91e;return _0x4ac8b2;});}})[_0x0161('0x20')](respondWithFilteredResult(_0x5664f3,_0x3b77ca))['catch'](handleError(_0x5664f3,null));};exports['removeDispositions']=function(_0x4986af,_0x4dd2a6,_0x5ec80e){return db[_0x0161('0x41')][_0x0161('0x5d')]({'where':{'id':_0x4986af['params']['id']}})['then'](handleEntityNotFound(_0x4dd2a6,null))['then'](function(_0x44a132){if(_0x44a132){return _0x44a132[_0x0161('0x69')](_0x4986af['query'][_0x0161('0x6a')]);}})['then'](respondWithStatusCode(_0x4dd2a6,null))[_0x0161('0x2b')](handleError(_0x4dd2a6,null));};exports['addAnswer']=function(_0x2f0b46,_0x52d2b6,_0x16cf18){if(_0x2f0b46[_0x0161('0x5c')]['id']){delete _0x2f0b46[_0x0161('0x5c')]['id'];}return db[_0x0161('0x41')][_0x0161('0x5d')]({'where':{'id':_0x2f0b46['params']['id']}})['then'](handleEntityNotFound(_0x52d2b6,null))[_0x0161('0x20')](function(_0x886d6b){if(_0x886d6b){_0x2f0b46[_0x0161('0x5c')][_0x0161('0x67')]=_0x886d6b['id'];return db[_0x0161('0x6b')][_0x0161('0x5b')](_0x2f0b46[_0x0161('0x5c')]);}})[_0x0161('0x20')](respondWithResult(_0x52d2b6,null))[_0x0161('0x2b')](handleError(_0x52d2b6,null));};exports['getAnswers']=function(_0x5bc9d4,_0x2461df,_0x15680d){var _0x11b011={'raw':![],'where':{}};var _0x4a71d8={};var _0x2a3ce6={'count':0x0,'rows':[]};return db['FaxAccount'][_0x0161('0x65')]({'where':{'id':_0x5bc9d4['params']['id']}})[_0x0161('0x20')](handleEntityNotFound(_0x2461df,null))[_0x0161('0x20')](function(_0x267626){if(_0x267626){_0x4a71d8[_0x0161('0x46')]=_[_0x0161('0x66')](db[_0x0161('0x6b')]['rawAttributes']);_0x4a71d8[_0x0161('0x47')]=_[_0x0161('0x66')](_0x5bc9d4['query']);_0x4a71d8[_0x0161('0x48')]=_[_0x0161('0x49')](_0x4a71d8[_0x0161('0x46')],_0x4a71d8[_0x0161('0x47')]);_0x11b011[_0x0161('0x4b')]=_[_0x0161('0x49')](_0x4a71d8[_0x0161('0x46')],qs[_0x0161('0x4a')](_0x5bc9d4[_0x0161('0x47')]['fields']));_0x11b011[_0x0161('0x4b')]=_0x11b011[_0x0161('0x4b')][_0x0161('0x59')]?_0x11b011[_0x0161('0x4b')]:_0x4a71d8[_0x0161('0x46')];if(!_0x5bc9d4['query'][_0x0161('0x4c')]('nolimit')){_0x11b011[_0x0161('0x33')]=qs['limit'](_0x5bc9d4[_0x0161('0x47')]['limit']);_0x11b011[_0x0161('0x30')]=qs[_0x0161('0x30')](_0x5bc9d4[_0x0161('0x47')][_0x0161('0x30')]);}_0x11b011[_0x0161('0x4e')]=qs['sort'](_0x5bc9d4['query'][_0x0161('0x4f')]);_0x11b011[_0x0161('0x52')]=qs['filters'](_['pick'](_0x5bc9d4[_0x0161('0x47')],_0x4a71d8['filters']));_0x11b011['where'][_0x0161('0x67')]=_0x267626['id'];if(_0x5bc9d4[_0x0161('0x47')][_0x0161('0x51')]){_0x11b011['where']=_[_0x0161('0x54')](_0x11b011[_0x0161('0x52')],{'$or':_[_0x0161('0x40')](_0x11b011[_0x0161('0x4b')],function(_0x218971){var _0x2695a6={};_0x2695a6[_0x218971]={'$like':'%'+_0x5bc9d4[_0x0161('0x47')]['filter']+'%'};return _0x2695a6;})});}_0x11b011=_[_0x0161('0x54')]({},_0x11b011,_0x5bc9d4[_0x0161('0x5a')]);return db[_0x0161('0x6b')]['count']({'where':_0x11b011['where']})['then'](function(_0x3d48f4){_0x2a3ce6[_0x0161('0x32')]=_0x3d48f4;if(_0x5bc9d4['query'][_0x0161('0x68')]){_0x11b011[_0x0161('0x55')]=[{'all':!![]}];}return db[_0x0161('0x6b')][_0x0161('0x56')](_0x11b011);})[_0x0161('0x20')](function(_0x500372){_0x2a3ce6['rows']=_0x500372;return _0x2a3ce6;});}})['then'](respondWithFilteredResult(_0x2461df,_0x11b011))[_0x0161('0x2b')](handleError(_0x2461df,null));};exports[_0x0161('0x6c')]=function(_0x5e6483,_0x2e6faf,_0x44ff39){return db['FaxAccount'][_0x0161('0x5d')]({'where':{'id':_0x5e6483[_0x0161('0x58')]['id']}})[_0x0161('0x20')](handleEntityNotFound(_0x2e6faf,null))['then'](function(_0x91fe57){if(_0x91fe57){return _0x91fe57[_0x0161('0x6c')](_0x5e6483[_0x0161('0x47')][_0x0161('0x6a')]);}})[_0x0161('0x20')](respondWithStatusCode(_0x2e6faf,null))['catch'](handleError(_0x2e6faf,null));};exports[_0x0161('0x6d')]=function(_0x1af3ab,_0x90c586,_0x1b41f7){return db[_0x0161('0x6e')][_0x0161('0x5d')]({'where':{'id':_0x1af3ab['params']['id']}})[_0x0161('0x20')](handleEntityNotFound(_0x90c586,null))[_0x0161('0x20')](function(_0x359e3d){if(_0x359e3d){return _0x359e3d['addInteraction'](_0x1af3ab[_0x0161('0x5c')][_0x0161('0x6a')],_[_0x0161('0x6f')](_0x1af3ab[_0x0161('0x5c')],['ids','id'])||{});}})[_0x0161('0x20')](respondWithResult(_0x90c586,null))[_0x0161('0x2b')](handleError(_0x90c586,null));};exports[_0x0161('0x70')]=function(_0x6574ee,_0x28d5bd,_0x1d426a){var _0x2d0d0d={'raw':![],'where':{}};var _0x599ee4={};var _0x436a1c={'count':0x0,'rows':[]};return db[_0x0161('0x41')][_0x0161('0x65')]({'where':{'id':_0x6574ee['params']['id']}})[_0x0161('0x20')](handleEntityNotFound(_0x28d5bd,null))[_0x0161('0x20')](function(_0x2c9d52){if(_0x2c9d52){_0x599ee4[_0x0161('0x46')]=_[_0x0161('0x66')](db['FaxInteraction'][_0x0161('0x42')]);_0x599ee4[_0x0161('0x47')]=_[_0x0161('0x66')](_0x6574ee[_0x0161('0x47')]);_0x599ee4[_0x0161('0x48')]=_[_0x0161('0x49')](_0x599ee4[_0x0161('0x46')],_0x599ee4[_0x0161('0x47')]);_0x2d0d0d[_0x0161('0x4b')]=_[_0x0161('0x49')](_0x599ee4[_0x0161('0x46')],qs[_0x0161('0x4a')](_0x6574ee['query'][_0x0161('0x4a')]));_0x2d0d0d[_0x0161('0x4b')]=_0x2d0d0d['attributes'][_0x0161('0x59')]?_0x2d0d0d[_0x0161('0x4b')]:_0x599ee4[_0x0161('0x46')];if(!_0x6574ee[_0x0161('0x47')]['hasOwnProperty']('nolimit')){_0x2d0d0d[_0x0161('0x33')]=qs[_0x0161('0x33')](_0x6574ee['query'][_0x0161('0x33')]);_0x2d0d0d['offset']=qs[_0x0161('0x30')](_0x6574ee[_0x0161('0x47')][_0x0161('0x30')]);}_0x2d0d0d['order']=qs[_0x0161('0x4f')](_0x6574ee[_0x0161('0x47')][_0x0161('0x4f')]);_0x2d0d0d[_0x0161('0x52')]=qs[_0x0161('0x48')](_[_0x0161('0x50')](_0x6574ee[_0x0161('0x47')],_0x599ee4[_0x0161('0x48')]));_0x2d0d0d[_0x0161('0x52')][_0x0161('0x67')]=_0x2c9d52['id'];if(_0x6574ee[_0x0161('0x47')][_0x0161('0x51')]){_0x2d0d0d[_0x0161('0x52')]=_[_0x0161('0x54')](_0x2d0d0d['where'],{'$or':_[_0x0161('0x40')](_0x2d0d0d[_0x0161('0x4b')],function(_0x3618fb){var _0x4068da={};_0x4068da[_0x3618fb]={'$like':'%'+_0x6574ee[_0x0161('0x47')][_0x0161('0x51')]+'%'};return _0x4068da;})});}_0x2d0d0d=_[_0x0161('0x54')]({},_0x2d0d0d,_0x6574ee['options']);return db[_0x0161('0x6e')][_0x0161('0x32')]({'where':_0x2d0d0d[_0x0161('0x52')]})[_0x0161('0x20')](function(_0x1ac948){_0x436a1c['count']=_0x1ac948;if(_0x6574ee['query']['includeAll']){_0x2d0d0d[_0x0161('0x55')]=[{'model':db[_0x0161('0x71')],'as':'Contact','required':![]},{'model':db[_0x0161('0x72')],'as':'Owner','attributes':[_0x0161('0x3d'),_0x0161('0x73'),_0x0161('0x74')],'required':![]},{'model':db[_0x0161('0x75')],'as':_0x0161('0x76'),'attributes':['id',_0x0161('0x3d'),_0x0161('0x77')],'where':_0x6574ee[_0x0161('0x47')]['tag']?{'id':_0x6574ee[_0x0161('0x47')][_0x0161('0x78')]}:undefined,'required':_0x6574ee[_0x0161('0x47')][_0x0161('0x78')]?!![]:![]}];}return db[_0x0161('0x6e')]['findAll'](_0x2d0d0d);})[_0x0161('0x20')](function(_0x3d3eb5){_0x436a1c[_0x0161('0x57')]=_0x3d3eb5;return _0x436a1c;});}})[_0x0161('0x20')](respondWithFilteredResult(_0x28d5bd,_0x2d0d0d))[_0x0161('0x2b')](handleError(_0x28d5bd,null));};exports[_0x0161('0x79')]=function(_0x523d87,_0x5504e8){var _0x1dc6ee=_0x523d87['params']['id'];var _0x475046=_0x523d87[_0x0161('0x5c')];var _0x1d4d8b=0xc8;var _0x560a93=null;return db[_0x0161('0x7a')][_0x0161('0x7b')]({'isolationLevel':db[_0x0161('0x7a')][_0x0161('0x7c')][_0x0161('0x7d')][_0x0161('0x7e')]},function(_0x5f3f01){return db[_0x0161('0x41')][_0x0161('0x65')]({'where':{'id':_0x1dc6ee},'transaction':_0x5f3f01})[_0x0161('0x20')](function(_0x3b18aa){if(_0x3b18aa){return db['FaxApplication'][_0x0161('0x60')]({'where':{'FaxAccountId':_0x1dc6ee},'transaction':_0x5f3f01})[_0x0161('0x20')](function(){var _0x444197=_[_0x0161('0x40')](_0x475046,function(_0x3eb054){_0x3eb054[_0x0161('0x67')]=_0x1dc6ee;return _0x3eb054;});return db[_0x0161('0x7f')]['bulkCreate'](_0x444197,{'transaction':_0x5f3f01});});}else{_0x1d4d8b=0x194;_0x560a93=[];}});})[_0x0161('0x20')](function(){if(_0x1d4d8b!==0x194){return db[_0x0161('0x7f')][_0x0161('0x80')]({'where':{'FaxAccountId':_0x1dc6ee},'order':_0x0161('0x81')})[_0x0161('0x20')](function(_0x3dc5a6){_0x560a93=_0x3dc5a6;});}})[_0x0161('0x2b')](function(_0x378cc7){_0x1d4d8b=0x1f4;logger[_0x0161('0x27')](_0x378cc7[_0x0161('0x82')]);if(_0x378cc7[_0x0161('0x3d')]){delete _0x378cc7[_0x0161('0x3d')];}_0x560a93=_0x378cc7;})[_0x0161('0x83')](function(){if(_0x560a93===null){_0x5504e8[_0x0161('0x2c')](_0x1d4d8b);}else{if(_0x1d4d8b===0x1f4){_0x5504e8[_0x0161('0x2e')](_0x1d4d8b)[_0x0161('0x84')](_0x560a93);}else{_0x5504e8[_0x0161('0x2e')](_0x1d4d8b)[_0x0161('0x2f')](_0x560a93);}}});};exports[_0x0161('0x85')]=function(_0x2dd632,_0x3c1742,_0x55e032){var _0xced3b0={};var _0x1f2e6c={};var _0xb10af;var _0x5e9e9d;return db[_0x0161('0x41')][_0x0161('0x65')]({'where':{'id':_0x2dd632[_0x0161('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c1742,null))['then'](function(_0x13e1cc){if(_0x13e1cc){_0xb10af=_0x13e1cc;_0x1f2e6c[_0x0161('0x46')]=_[_0x0161('0x66')](db['FaxApplication'][_0x0161('0x42')]);_0x1f2e6c[_0x0161('0x47')]=_[_0x0161('0x66')](_0x2dd632['query']);_0x1f2e6c[_0x0161('0x48')]=_[_0x0161('0x49')](_0x1f2e6c[_0x0161('0x46')],_0x1f2e6c[_0x0161('0x47')]);_0xced3b0[_0x0161('0x4b')]=_[_0x0161('0x49')](_0x1f2e6c[_0x0161('0x46')],qs[_0x0161('0x4a')](_0x2dd632[_0x0161('0x47')][_0x0161('0x4a')]));_0xced3b0[_0x0161('0x4b')]=_0xced3b0['attributes'][_0x0161('0x59')]?_0xced3b0[_0x0161('0x4b')]:_0x1f2e6c['model'];_0xced3b0[_0x0161('0x4e')]=qs['sort'](_0x2dd632[_0x0161('0x47')][_0x0161('0x4f')]);_0xced3b0[_0x0161('0x52')]=qs[_0x0161('0x48')](_[_0x0161('0x50')](_0x2dd632[_0x0161('0x47')],_0x1f2e6c[_0x0161('0x48')]));if(_0x2dd632['query']['filter']){_0xced3b0[_0x0161('0x52')]=_[_0x0161('0x54')](_0xced3b0[_0x0161('0x52')],{'$or':_[_0x0161('0x40')](_0xced3b0[_0x0161('0x4b')],function(_0x4dd186){var _0x3cac63={};_0x3cac63[_0x4dd186]={'$like':'%'+_0x2dd632[_0x0161('0x47')][_0x0161('0x51')]+'%'};return _0x3cac63;})});}_0xced3b0=_[_0x0161('0x54')]({},_0xced3b0,_0x2dd632['options']);return _0xb10af['getApplications'](_0xced3b0);}})[_0x0161('0x20')](function(_0x589609){if(_0x589609){_0x5e9e9d=_0x589609[_0x0161('0x59')];if(!_0x2dd632[_0x0161('0x47')]['hasOwnProperty'](_0x0161('0x4d'))){_0xced3b0[_0x0161('0x33')]=qs['limit'](_0x2dd632[_0x0161('0x47')][_0x0161('0x33')]);_0xced3b0[_0x0161('0x30')]=qs[_0x0161('0x30')](_0x2dd632[_0x0161('0x47')][_0x0161('0x30')]);}return _0xb10af[_0x0161('0x85')](_0xced3b0);}})[_0x0161('0x20')](function(_0x380e3a){if(_0x380e3a){return _0x380e3a?{'count':_0x5e9e9d,'rows':_0x380e3a}:null;}})[_0x0161('0x20')](respondWithResult(_0x3c1742,null))['catch'](handleError(_0x3c1742,null));};function Extension(_0xadc810,_0x48b1d5,_0x1cccd4,_0x45f9ec){this[_0x0161('0x86')]=_0x0161('0x87');this[_0x0161('0x88')]=_0xadc810[_0x0161('0x89')];this['app']=_0x45f9ec;this[_0x0161('0x44')]=_0x0161('0x8a');this[_0x0161('0x8b')]=_0x0161('0x8c');this[_0x0161('0x67')]=_0xadc810['id'];this[_0x0161('0x81')]=_0x48b1d5;this[_0x0161('0x8d')]=_0x1cccd4;}function createExtensionsReciveFax(_0x4a121a){var _0x292f87=0x1;var _0x26787f=[];_0x26787f[_0x0161('0x8e')](new Extension(_0x4a121a,_0x292f87,'',_0x0161('0x8f')));_0x292f87+=0x1;_0x26787f['push'](new Extension(_0x4a121a,_0x292f87,'CDR(type)=inbound-fax',_0x0161('0x90')));_0x292f87+=0x1;for(var _0x328702 in _0x4a121a){if(_0x4a121a[_0x0161('0x4c')](_0x328702)&&(_0x328702==='ecm'||_0x328702===_0x0161('0x89')||_0x328702===_0x0161('0x91')||_0x328702==='faxdetect'||_0x328702==='headerinfo'||_0x328702===_0x0161('0x92')||_0x328702==='minrate'||_0x328702===_0x0161('0x93')||_0x328702===_0x0161('0x94'))){_0x26787f['push'](new Extension(_0x4a121a,_0x292f87,_0x0161('0x95')+_0x328702+')='+_0x4a121a[_0x328702],'Set'));_0x292f87+=0x1;}}_0x26787f[_0x0161('0x8e')](new Extension(_0x4a121a,_0x292f87,'6',_0x0161('0x96')));_0x292f87+=0x1;_0x26787f[_0x0161('0x8e')](new Extension(_0x4a121a,_0x292f87,_0x0161('0x97'),'ReceiveFax'));_0x292f87=0x0;return _0x26787f;}exports[_0x0161('0x98')]=function(_0x2d8325,_0x16c54e,_0x2a3b44){var _0x3ba574;return db[_0x0161('0x7a')][_0x0161('0x7b')](function(_0x262613){return db[_0x0161('0x41')]['create'](_0x2d8325[_0x0161('0x5c')],{'transaction':_0x262613})['then'](function(_0x575817){_0x3ba574=_0x575817[_0x0161('0x3a')]({'plain':!![]});return db[_0x0161('0x99')]['bulkCreate'](createExtensionsReciveFax(_0x3ba574),{'transaction':_0x262613});});})[_0x0161('0x20')](function(){return _0x3ba574;})['then'](respondWithResult(_0x16c54e,null))['catch'](handleError(_0x16c54e,null));};exports[_0x0161('0x9a')]=function(_0x527923,_0x11b3f4,_0x20cd05){var _0x7256f8;return db['sequelize'][_0x0161('0x7b')](function(_0x4bc8dc){return db[_0x0161('0x41')][_0x0161('0x39')](_0x527923[_0x0161('0x5c')],{'where':{'id':_0x527923[_0x0161('0x5c')]['id']},'transaction':_0x4bc8dc})['then'](function(_0x1cce2f){return db[_0x0161('0x99')][_0x0161('0x60')]({'where':{'FaxAccountId':_0x527923[_0x0161('0x5c')]['id']},'transaction':_0x4bc8dc})[_0x0161('0x20')](function(_0x276ab4){return db[_0x0161('0x99')][_0x0161('0x9b')](createExtensionsReciveFax(_[_0x0161('0x6f')](_0x527923['body'],[_0x0161('0x9c'),_0x0161('0x45'),_0x0161('0x9d'),'updatedAt',_0x0161('0x9e'),_0x0161('0x9f')])),{'transaction':_0x4bc8dc});});});})['then'](function(){return db[_0x0161('0x41')][_0x0161('0xa0')](_0x527923['body']['id']);})[_0x0161('0x20')](respondWithResult(_0x11b3f4,null))[_0x0161('0x2b')](handleError(_0x11b3f4,null));};exports[_0x0161('0xa1')]=function(_0x8538c4,_0x404468,_0x880cea){var _0x48d65b={'raw':!![],'where':{}};var _0x16b3d5={};var _0x219420={'count':0x0,'rows':[]};return db[_0x0161('0x41')][_0x0161('0x65')]({'where':{'id':_0x8538c4[_0x0161('0x58')]['id']}})[_0x0161('0x20')](handleEntityNotFound(_0x404468,null))[_0x0161('0x20')](function(_0x9e92d0){if(_0x9e92d0){_0x16b3d5['model']=_['keys'](db[_0x0161('0xa2')][_0x0161('0x42')]);_0x16b3d5[_0x0161('0x47')]=_['keys'](_0x8538c4[_0x0161('0x47')]);_0x16b3d5['filters']=_[_0x0161('0x49')](_0x16b3d5[_0x0161('0x46')],_0x16b3d5[_0x0161('0x47')]);_0x48d65b[_0x0161('0x4b')]=_[_0x0161('0x49')](_0x16b3d5['model'],qs[_0x0161('0x4a')](_0x8538c4['query'][_0x0161('0x4a')]));_0x48d65b['attributes']=_0x48d65b[_0x0161('0x4b')][_0x0161('0x59')]?_0x48d65b[_0x0161('0x4b')]:_0x16b3d5['model'];if(!_0x8538c4[_0x0161('0x47')][_0x0161('0x4c')](_0x0161('0x4d'))){_0x48d65b[_0x0161('0x33')]=qs[_0x0161('0x33')](_0x8538c4[_0x0161('0x47')][_0x0161('0x33')]);_0x48d65b[_0x0161('0x30')]=qs['offset'](_0x8538c4[_0x0161('0x47')]['offset']);}_0x48d65b['order']=qs[_0x0161('0x4f')](_0x8538c4['query'][_0x0161('0x4f')]);_0x48d65b[_0x0161('0x52')]=qs[_0x0161('0x48')](_['pick'](_0x8538c4[_0x0161('0x47')],_0x16b3d5['filters']));_0x48d65b[_0x0161('0x52')][_0x0161('0x67')]=_0x9e92d0['id'];if(_0x8538c4[_0x0161('0x47')][_0x0161('0x51')]){_0x48d65b['where']=_[_0x0161('0x54')](_0x48d65b[_0x0161('0x52')],{'$or':_[_0x0161('0x40')](_0x48d65b[_0x0161('0x4b')],function(_0x4c986d){var _0x588d22={};_0x588d22[_0x4c986d]={'$like':'%'+_0x8538c4[_0x0161('0x47')]['filter']+'%'};return _0x588d22;})});}if(_0x8538c4[_0x0161('0x47')][_0x0161('0xa3')]){var _0x4b5fee=_0x8538c4[_0x0161('0x47')][_0x0161('0xa3')][_0x0161('0xa4')](',');var _0x4249af={};_0x4249af[_0x4b5fee[0x0]]={'$gte':moment(_0x4b5fee[0x1])[_0x0161('0xa5')](_0x0161('0xa6'))};_0x48d65b[_0x0161('0x52')]=_[_0x0161('0x54')](_0x48d65b[_0x0161('0x52')],_0x4249af);}_0x48d65b=_[_0x0161('0x54')]({},_0x48d65b,_0x8538c4[_0x0161('0x5a')]);return db[_0x0161('0xa2')]['count']({'where':_0x48d65b[_0x0161('0x52')]})['then'](function(_0x3480aa){_0x219420['count']=_0x3480aa;if(_0x8538c4['query'][_0x0161('0x68')]){_0x48d65b['include']=[{'all':!![]}];}return db[_0x0161('0xa2')][_0x0161('0x56')](_0x48d65b);})['then'](function(_0x5aa92a){_0x219420[_0x0161('0x57')]=_0x5aa92a;return _0x219420;});}})['then'](respondWithFilteredResult(_0x404468,_0x48d65b))[_0x0161('0x2b')](handleError(_0x404468,null));};exports[_0x0161('0x84')]=function(_0x31bcc1,_0x59c281,_0xebdcca){var _0x10eced,_0x175af7={},_0x2739eb;if(_0x31bcc1[_0x0161('0x5c')]['to']){_0x2739eb=_0x31bcc1[_0x0161('0x5c')]['to'][0x0];}return db['FaxAccount'][_0x0161('0x5d')]({'where':{'id':_0x31bcc1['params']['id']},'include':[{'model':db[_0x0161('0xa7')],'as':_0x0161('0xa8'),'include':[{'model':db['CmContact'],'as':_0x0161('0xa9'),'where':{'fax':_0x2739eb},'limit':0x1,'order':[[_0x0161('0xaa'),_0x0161('0xab')]]}]}]})[_0x0161('0x20')](handleEntityNotFound(_0x59c281,null))[_0x0161('0x20')](function(_0x1b3d72){_0x10eced=_0x1b3d72;if(_0x31bcc1[_0x0161('0x5c')][_0x0161('0xac')]&&_0x31bcc1['body']['attachments']['length']){for(var _0x516597=0x0;_0x516597<_0x31bcc1['body'][_0x0161('0xac')]['length'];_0x516597+=0x1){_0x31bcc1[_0x0161('0x5c')]['attachments'][_0x516597]={'filename':_0x31bcc1[_0x0161('0x5c')][_0x0161('0xac')][_0x516597]['name'],'id':_0x31bcc1[_0x0161('0x5c')][_0x0161('0xac')][_0x516597]['id'],'path':path[_0x0161('0xad')](config['root'],_0x0161('0xae'),_0x31bcc1[_0x0161('0x5c')][_0x0161('0xac')][_0x516597]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x0161('0xaf'),{'FaxAccountId':_[_0x0161('0xb0')](_0x31bcc1['params']['id'])?undefined:_0x31bcc1[_0x0161('0x58')]['id'],'path':_[_0x0161('0xb0')](_0x31bcc1[_0x0161('0x5c')]['attachments'][0x0][_0x0161('0x9')])?undefined:_0x31bcc1[_0x0161('0x5c')][_0x0161('0xac')][0x0][_0x0161('0x9')],'fax':_[_0x0161('0xb0')](_0x31bcc1[_0x0161('0x5c')]['to'][0x0])?undefined:_0x31bcc1[_0x0161('0x5c')]['to'][0x0]},client9002);})['then'](function(){if(_0x10eced){if(_[_0x0161('0xb0')](_0x31bcc1[_0x0161('0x5c')][_0x0161('0xb1')])){_0x31bcc1[_0x0161('0x5c')][_0x0161('0xb1')]=util['format'](_0x0161('0xb2'),_0x10eced[_0x0161('0x3d')],_0x10eced['fax']);}if(_0x10eced[_0x0161('0xa8')]){if(_0x10eced[_0x0161('0xa8')][_0x0161('0xa9')][_0x0161('0x59')]){return _0x10eced['List'][_0x0161('0xa9')][0x0];}else{return db[_0x0161('0x71')][_0x0161('0x5b')](_[_0x0161('0xb3')](_0x31bcc1[_0x0161('0x5c')],{'firstName':_0x31bcc1[_0x0161('0x5c')]['to'][0x0],'phone':_0x31bcc1['body']['to'][0x0],'fax':_0x31bcc1[_0x0161('0x5c')]['to'][0x0],'ListId':_0x10eced[_0x0161('0x9f')]}));}}else{throw new Error(_0x0161('0xb4'));}}else{throw new Error(_0x0161('0xb5'));}})[_0x0161('0x20')](function(_0x4b1499){if(_0x4b1499){return db['FaxInteraction'][_0x0161('0x5d')]({'where':{'ContactId':_0x4b1499['id'],'closed':![],'FaxAccountId':_0x10eced['id']}})[_0x0161('0x20')](function(_0x4cbb63){if(_0x4cbb63){return[_0x4cbb63,![]];}return db['FaxInteraction'][_0x0161('0x5b')]({'UserId':_0x31bcc1[_0x0161('0xb6')]['id'],'ContactId':_0x4b1499['id'],'FaxAccountId':_0x10eced['id'],'fax':_0x31bcc1[_0x0161('0x5c')]['to'][0x0],'firstMsgDirection':_0x0161('0xb7'),'Messages':[_[_0x0161('0x54')](_0x31bcc1[_0x0161('0x5c')],{'read':![],'body':_0x31bcc1[_0x0161('0x5c')][_0x0161('0xac')][0x0]['filename'],'FaxAccountId':_0x10eced['id'],'UserId':_0x31bcc1[_0x0161('0xb6')]['id'],'ContactId':_0x4b1499['id'],'AttachmentId':_0x31bcc1[_0x0161('0x5c')][_0x0161('0xac')][0x0]['id']})]},{'include':[{'model':db[_0x0161('0xa2')],'as':_0x0161('0xb8')}]})['then'](function(_0x46e2c8){return[_0x46e2c8,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0161('0xb9')](function(_0x23de77,_0x4b2381){if(_0x4b2381){return _0x23de77;}return db['FaxMessage']['create']({'direction':_0x0161('0xb7'),'read':![],'body':_0x31bcc1[_0x0161('0x5c')][_0x0161('0xac')][0x0][_0x0161('0xba')],'FaxAccountId':_0x10eced['id'],'FaxInteractionId':_0x23de77['id'],'UserId':_0x31bcc1['user']['id'],'ContactId':_0x23de77['ContactId'],'AttachmentId':_0x31bcc1[_0x0161('0x5c')]['attachments'][0x0]['id']})[_0x0161('0x20')](function(_0x1278fe){_0x23de77[_0x0161('0xbb')][_0x0161('0xb8')]=[];_0x23de77[_0x0161('0xbb')][_0x0161('0xb8')][_0x0161('0x8e')](_0x1278fe[_0x0161('0xbb')]);return _0x23de77;});})[_0x0161('0x20')](function(_0x2b06b2){respondWithRpcPromise(_0x0161('0xbc'),_0x0161('0xbc'),{'FaxAccountId':_[_0x0161('0xb0')](_0x31bcc1['params']['id'])?undefined:_0x31bcc1['params']['id'],'path':_[_0x0161('0xb0')](_0x31bcc1[_0x0161('0x5c')][_0x0161('0xac')][0x0][_0x0161('0x9')])?undefined:_0x31bcc1[_0x0161('0x5c')][_0x0161('0xac')][0x0][_0x0161('0x9')],'fax':_[_0x0161('0xb0')](_0x31bcc1[_0x0161('0x5c')]['to'][0x0])?undefined:_0x31bcc1[_0x0161('0x5c')]['to'][0x0],'AttachmentId':_0x31bcc1['body'][_0x0161('0xac')][0x0]['id']},client9002)[_0x0161('0x20')](function(_0x32a16c){logger['info'](_0x0161('0xbd'),_0x32a16c);})[_0x0161('0x2b')](function(_0x4e96a4){logger[_0x0161('0x21')](_0x0161('0xbd'),_0x4e96a4);});return _0x2b06b2;})[_0x0161('0x20')](respondWithResult(_0x59c281,null))['catch'](handleError(_0x59c281,null));};exports[_0x0161('0xbe')]=function(_0x250bbc,_0x21d477,_0x2faf78){return db[_0x0161('0x41')]['find']({'where':{'id':_0x250bbc['params']['id']}})[_0x0161('0x20')](handleEntityNotFound(_0x21d477,null))[_0x0161('0x20')](function(_0x514781){if(_0x514781){return _0x514781['addAgents'](_0x250bbc[_0x0161('0x5c')][_0x0161('0x6a')],_[_0x0161('0x6f')](_0x250bbc[_0x0161('0x5c')],[_0x0161('0x6a'),'id'])||{})['spread'](function(_0x38e7b2){for(var _0x15aa8c=0x0;_0x15aa8c<_0x250bbc[_0x0161('0x5c')][_0x0161('0x6a')]['length'];_0x15aa8c+=0x1){socket[_0x0161('0xbf')](_0x0161('0xc0'),{'UserId':Number(_0x250bbc[_0x0161('0x5c')]['ids'][_0x15aa8c]),'FaxAccountId':Number(_0x250bbc[_0x0161('0x58')]['id'])});}return _0x38e7b2;});}})[_0x0161('0x20')](respondWithResult(_0x21d477,null))[_0x0161('0x2b')](handleError(_0x21d477,null));};exports[_0x0161('0xc1')]=function(_0x401c88,_0x5c0eba,_0x4390b7){return db[_0x0161('0x41')][_0x0161('0x5d')]({'where':{'id':_0x401c88['params']['id']}})['then'](handleEntityNotFound(_0x5c0eba,null))['then'](function(_0x736531){if(_0x736531){return _0x736531[_0x0161('0xc1')](_0x401c88[_0x0161('0x47')]['ids'])[_0x0161('0x20')](function(){if(_[_0x0161('0xc2')](_0x401c88[_0x0161('0x47')][_0x0161('0x6a')])){for(var _0x44dafb=0x0;_0x44dafb<_0x401c88['query'][_0x0161('0x6a')][_0x0161('0x59')];_0x44dafb+=0x1){socket[_0x0161('0xbf')](_0x0161('0xc3'),{'UserId':Number(_0x401c88['query'][_0x0161('0x6a')][_0x44dafb]),'FaxAccountId':Number(_0x401c88[_0x0161('0x58')]['id'])});}}else{socket[_0x0161('0xbf')](_0x0161('0xc3'),{'UserId':Number(_0x401c88['query']['ids']),'FaxAccountId':Number(_0x401c88['params']['id'])});}});}})[_0x0161('0x20')](respondWithStatusCode(_0x5c0eba,null))[_0x0161('0x2b')](handleError(_0x5c0eba,null));};exports['getAgents']=function(_0x38cd3d,_0x11dfbc,_0x17ccc5){var _0x4c672f={};var _0xc56a85={};var _0x20464c;var _0x162bae;return db[_0x0161('0x41')][_0x0161('0x65')]({'where':{'id':_0x38cd3d[_0x0161('0x58')]['id']}})[_0x0161('0x20')](handleEntityNotFound(_0x11dfbc,null))[_0x0161('0x20')](function(_0x368132){if(_0x368132){_0x20464c=_0x368132;_0xc56a85[_0x0161('0x46')]=_[_0x0161('0x66')](db[_0x0161('0x72')][_0x0161('0x42')]);_0xc56a85[_0x0161('0x47')]=_[_0x0161('0x66')](_0x38cd3d[_0x0161('0x47')]);_0xc56a85[_0x0161('0x48')]=_[_0x0161('0x49')](_0xc56a85[_0x0161('0x46')],_0xc56a85['query']);_0x4c672f[_0x0161('0x4b')]=_[_0x0161('0x49')](_0xc56a85[_0x0161('0x46')],qs['fields'](_0x38cd3d[_0x0161('0x47')][_0x0161('0x4a')]));_0x4c672f['attributes']=_0x4c672f['attributes'][_0x0161('0x59')]?_0x4c672f[_0x0161('0x4b')]:_0xc56a85[_0x0161('0x46')];_0x4c672f['order']=qs[_0x0161('0x4f')](_0x38cd3d[_0x0161('0x47')][_0x0161('0x4f')]);_0x4c672f[_0x0161('0x52')]=qs[_0x0161('0x48')](_[_0x0161('0x50')](_0x38cd3d['query'],_0xc56a85['filters']));if(_0x38cd3d['query'][_0x0161('0x51')]){_0x4c672f[_0x0161('0x52')]=_[_0x0161('0x54')](_0x4c672f['where'],{'$or':_[_0x0161('0x40')](_0x4c672f[_0x0161('0x4b')],function(_0x5974f3){var _0x291b05={};_0x291b05[_0x5974f3]={'$like':'%'+_0x38cd3d['query'][_0x0161('0x51')]+'%'};return _0x291b05;})});}_0x4c672f=_[_0x0161('0x54')]({},_0x4c672f,_0x38cd3d[_0x0161('0x5a')]);return _0x20464c[_0x0161('0xc4')](_0x4c672f);}})[_0x0161('0x20')](function(_0x13a9bb){if(_0x13a9bb){_0x162bae=_0x13a9bb['length'];if(!_0x38cd3d[_0x0161('0x47')]['hasOwnProperty'](_0x0161('0x4d'))){_0x4c672f[_0x0161('0x33')]=qs[_0x0161('0x33')](_0x38cd3d[_0x0161('0x47')][_0x0161('0x33')]);_0x4c672f[_0x0161('0x30')]=qs['offset'](_0x38cd3d['query'][_0x0161('0x30')]);}return _0x20464c['getAgents'](_0x4c672f);}})[_0x0161('0x20')](function(_0x468ffc){if(_0x468ffc){return _0x468ffc?{'count':_0x162bae,'rows':_0x468ffc}:null;}})[_0x0161('0x20')](respondWithResult(_0x11dfbc,null))[_0x0161('0x2b')](handleError(_0x11dfbc,null));}; \ No newline at end of file +var _0xdd18=['removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./faxAccount.socket','register','jayson/promise','http','client','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','destroy','get','FaxAccounts','UserProfileResource','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','filters','attributes','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','describe','Disposition','getDispositions','findOne','length','removeDispositions','addAnswer','FaxAccountId','getAnswers','CannedAnswer','removeAnswers','ids','FaxInteraction','omit','getInteractions','CmContact','Contact','User','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','send','getApplications','FaxApplication','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','minrate','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','from','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','emit'];(function(_0x249ede,_0x13d74a){var _0xa4c823=function(_0x3cf937){while(--_0x3cf937){_0x249ede['push'](_0x249ede['shift']());}};_0xa4c823(++_0x13d74a);}(_0xdd18,0x19c));var _0x8dd1=function(_0xb9f7f6,_0xd6efae){_0xb9f7f6=_0xb9f7f6-0x0;var _0xb4edcd=_0xdd18[_0xb9f7f6];return _0xb4edcd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8dd1('0x0'));var zipdir=require(_0x8dd1('0x1'));var jsonpatch=require(_0x8dd1('0x2'));var rp=require('request-promise');var moment=require(_0x8dd1('0x3'));var BPromise=require(_0x8dd1('0x4'));var Mustache=require(_0x8dd1('0x5'));var util=require('util');var path=require(_0x8dd1('0x6'));var sox=require(_0x8dd1('0x7'));var csv=require(_0x8dd1('0x8'));var ejs=require(_0x8dd1('0x9'));var fs=require('fs');var fs_extra=require(_0x8dd1('0xa'));var _=require('lodash');var squel=require(_0x8dd1('0xb'));var crypto=require(_0x8dd1('0xc'));var jsforce=require(_0x8dd1('0xd'));var deskjs=require(_0x8dd1('0xe'));var toCsv=require(_0x8dd1('0x8'));var querystring=require(_0x8dd1('0xf'));var Papa=require(_0x8dd1('0x10'));var Redis=require(_0x8dd1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8dd1('0x12'));var as=require(_0x8dd1('0x13'));var hardwareService=require(_0x8dd1('0x14'));var logger=require(_0x8dd1('0x15'))(_0x8dd1('0x16'));var utils=require(_0x8dd1('0x17'));var config=require(_0x8dd1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8dd1('0x19'))['db'];config['redis']=_[_0x8dd1('0x1a')](config[_0x8dd1('0x1b')],{'host':_0x8dd1('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8dd1('0x1b')]));require(_0x8dd1('0x1d'))[_0x8dd1('0x1e')](socket);var jayson=require(_0x8dd1('0x1f'));var client=jayson['client'][_0x8dd1('0x20')]({'port':0x232c});var client9002=jayson[_0x8dd1('0x21')][_0x8dd1('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x228fe8,_0x1073b6,_0x1aa997,_0x48b05e){return new BPromise(function(_0x561e1d,_0x581335){var _0x36ee70=_0x48b05e||client;return _0x36ee70[_0x8dd1('0x22')](_0x228fe8,_0x1aa997)[_0x8dd1('0x23')](function(_0x1c4b60){logger[_0x8dd1('0x24')]('FaxAccount,\x20%s,\x20%s',_0x1073b6,'request\x20sent');logger[_0x8dd1('0x25')](_0x8dd1('0x26'),_0x1073b6,'request\x20sent',JSON[_0x8dd1('0x27')](_0x1c4b60));if(_0x1c4b60[_0x8dd1('0x28')]){if(_0x1c4b60[_0x8dd1('0x28')][_0x8dd1('0x29')]===0x1f4){logger[_0x8dd1('0x28')](_0x8dd1('0x2a'),_0x1073b6,_0x1c4b60['error'][_0x8dd1('0x2b')]);return _0x581335(_0x1c4b60[_0x8dd1('0x28')][_0x8dd1('0x2b')]);}logger[_0x8dd1('0x28')]('FaxAccount,\x20%s,\x20%s',_0x1073b6,_0x1c4b60[_0x8dd1('0x28')][_0x8dd1('0x2b')]);return _0x561e1d(_0x1c4b60[_0x8dd1('0x28')][_0x8dd1('0x2b')]);}else{logger[_0x8dd1('0x24')](_0x8dd1('0x2a'),_0x1073b6,_0x8dd1('0x2c'));_0x561e1d(_0x1c4b60[_0x8dd1('0x2d')][_0x8dd1('0x2b')]);}})[_0x8dd1('0x2e')](function(_0x801d94){logger['error'](_0x8dd1('0x2a'),_0x1073b6,_0x801d94);_0x581335(_0x801d94);});});}function respondWithStatusCode(_0x4cacce,_0x3f39cc){_0x3f39cc=_0x3f39cc||0xcc;return function(_0x44f72d){if(_0x44f72d){return _0x4cacce[_0x8dd1('0x2f')](_0x3f39cc);}return _0x4cacce['status'](_0x3f39cc)[_0x8dd1('0x30')]();};}function respondWithResult(_0x5dde45,_0x16eed4){_0x16eed4=_0x16eed4||0xc8;return function(_0x3bfa73){if(_0x3bfa73){return _0x5dde45['status'](_0x16eed4)[_0x8dd1('0x31')](_0x3bfa73);}};}function respondWithFilteredResult(_0x1d4f9c,_0x1edede){return function(_0x39900c){if(_0x39900c){var _0x2e0290=typeof _0x1edede[_0x8dd1('0x32')]===_0x8dd1('0x33')&&typeof _0x1edede[_0x8dd1('0x34')]===_0x8dd1('0x33');var _0x1b67bb=_0x39900c['count'];var _0x2a685b=_0x2e0290?0x0:_0x1edede['offset'];var _0x3a0c8b=_0x2e0290?_0x39900c[_0x8dd1('0x35')]:_0x1edede['offset']+_0x1edede[_0x8dd1('0x34')];var _0x149e96;if(_0x3a0c8b>=_0x1b67bb){_0x3a0c8b=_0x1b67bb;_0x149e96=0xc8;}else{_0x149e96=0xce;}_0x1d4f9c[_0x8dd1('0x36')](_0x149e96);return _0x1d4f9c[_0x8dd1('0x37')](_0x8dd1('0x38'),_0x2a685b+'-'+_0x3a0c8b+'/'+_0x1b67bb)['json'](_0x39900c);}return null;};}function patchUpdates(_0x514ebf){return function(_0x398b1a){try{jsonpatch[_0x8dd1('0x39')](_0x398b1a,_0x514ebf,!![]);}catch(_0x19b34c){return BPromise['reject'](_0x19b34c);}return _0x398b1a[_0x8dd1('0x3a')]();};}function saveUpdates(_0x4f8454,_0x373dc0){return function(_0x8a7721){if(_0x8a7721){return _0x8a7721['update'](_0x4f8454)['then'](function(_0x54c68a){return _0x54c68a;});}return null;};}function removeEntity(_0x3254e5,_0x127f70){return function(_0x1c3a6c){if(_0x1c3a6c){return _0x1c3a6c[_0x8dd1('0x3b')]()[_0x8dd1('0x23')](function(){var _0x48197c=_0x1c3a6c[_0x8dd1('0x3c')]({'plain':!![]});var _0x593aac=_0x8dd1('0x3d');return db[_0x8dd1('0x3e')][_0x8dd1('0x3b')]({'where':{'type':_0x593aac,'resourceId':_0x48197c['id']}})[_0x8dd1('0x23')](function(){return _0x1c3a6c;});})['then'](function(){_0x3254e5[_0x8dd1('0x36')](0xcc)[_0x8dd1('0x30')]();});}};}function handleEntityNotFound(_0x54e0f1,_0x469b41){return function(_0x3c02ec){if(!_0x3c02ec){_0x54e0f1[_0x8dd1('0x2f')](0x194);}return _0x3c02ec;};}function handleError(_0x30916e,_0x2fe821){_0x2fe821=_0x2fe821||0x1f4;return function(_0x58ed9c){logger[_0x8dd1('0x28')](_0x58ed9c['stack']);if(_0x58ed9c[_0x8dd1('0x3f')]){delete _0x58ed9c[_0x8dd1('0x3f')];}_0x30916e[_0x8dd1('0x36')](_0x2fe821)['send'](_0x58ed9c);};}exports[_0x8dd1('0x40')]=function(_0xb3a27,_0x5e4d9a){var _0x39e040={'include':[{'model':db[_0x8dd1('0x41')],'as':_0x8dd1('0x42')}]},_0x3de944={},_0x5a3cef={'count':0x0,'rows':[]};var _0x379a6b=_[_0x8dd1('0x43')](db[_0x8dd1('0x44')][_0x8dd1('0x45')],function(_0x28a181){return{'name':_0x28a181[_0x8dd1('0x46')],'type':_0x28a181[_0x8dd1('0x47')][_0x8dd1('0x48')]};});_0x3de944['model']=_[_0x8dd1('0x43')](_0x379a6b,_0x8dd1('0x3f'));_0x3de944[_0x8dd1('0x49')]=_['keys'](_0xb3a27[_0x8dd1('0x49')]);_0x3de944['filters']=_[_0x8dd1('0x4a')](_0x3de944[_0x8dd1('0x4b')],_0x3de944[_0x8dd1('0x49')]);_0x39e040['attributes']=_[_0x8dd1('0x4a')](_0x3de944['model'],qs[_0x8dd1('0x4c')](_0xb3a27['query'][_0x8dd1('0x4c')]));_0x39e040['attributes']=_0x39e040['attributes']['length']?_0x39e040['attributes']:_0x3de944[_0x8dd1('0x4b')];if(!_0xb3a27[_0x8dd1('0x49')][_0x8dd1('0x4d')](_0x8dd1('0x4e'))){_0x39e040[_0x8dd1('0x34')]=qs[_0x8dd1('0x34')](_0xb3a27[_0x8dd1('0x49')][_0x8dd1('0x34')]);_0x39e040['offset']=qs[_0x8dd1('0x32')](_0xb3a27['query'][_0x8dd1('0x32')]);}_0x39e040[_0x8dd1('0x4f')]=qs[_0x8dd1('0x50')](_0xb3a27[_0x8dd1('0x49')][_0x8dd1('0x50')]);_0x39e040[_0x8dd1('0x51')]=qs['filters'](_[_0x8dd1('0x52')](_0xb3a27[_0x8dd1('0x49')],_0x3de944['filters']),_0x379a6b);if(_0xb3a27['query'][_0x8dd1('0x53')]){_0x39e040['where']=_[_0x8dd1('0x54')](_0x39e040[_0x8dd1('0x51')],{'$or':_[_0x8dd1('0x43')](_0x379a6b,function(_0x2e5a54){if(_0x2e5a54[_0x8dd1('0x47')]!==_0x8dd1('0x55')){var _0x300b6e={};_0x300b6e[_0x2e5a54[_0x8dd1('0x3f')]]={'$like':'%'+_0xb3a27['query'][_0x8dd1('0x53')]+'%'};return _0x300b6e;}})});}_0x39e040=_[_0x8dd1('0x54')]({},_0x39e040,_0xb3a27[_0x8dd1('0x56')]);var _0x2613d7={'where':_0x39e040[_0x8dd1('0x51')]};return db['FaxAccount'][_0x8dd1('0x35')](_0x2613d7)['then'](function(_0x307246){_0x5a3cef[_0x8dd1('0x35')]=_0x307246;if(_0xb3a27[_0x8dd1('0x49')][_0x8dd1('0x57')]){_0x39e040[_0x8dd1('0x58')]=[{'all':!![]}];}return db['FaxAccount'][_0x8dd1('0x59')](_0x39e040);})[_0x8dd1('0x23')](function(_0x1e5649){_0x5a3cef[_0x8dd1('0x5a')]=_0x1e5649;return _0x5a3cef;})['then'](respondWithFilteredResult(_0x5e4d9a,_0x39e040))['catch'](handleError(_0x5e4d9a,null));};exports[_0x8dd1('0x5b')]=function(_0xff1f0f,_0x3dd813){var _0x56a5fe={'raw':![],'where':{'id':_0xff1f0f[_0x8dd1('0x5c')]['id']},'include':[{'model':db[_0x8dd1('0x41')],'as':_0x8dd1('0x42')}]},_0x5ae1b4={};_0x5ae1b4[_0x8dd1('0x4b')]=_[_0x8dd1('0x5d')](db[_0x8dd1('0x44')][_0x8dd1('0x45')]);_0x5ae1b4[_0x8dd1('0x49')]=_[_0x8dd1('0x5d')](_0xff1f0f[_0x8dd1('0x49')]);_0x5ae1b4[_0x8dd1('0x5e')]=_['intersection'](_0x5ae1b4[_0x8dd1('0x4b')],_0x5ae1b4[_0x8dd1('0x49')]);_0x56a5fe[_0x8dd1('0x5f')]=_[_0x8dd1('0x4a')](_0x5ae1b4[_0x8dd1('0x4b')],qs[_0x8dd1('0x4c')](_0xff1f0f[_0x8dd1('0x49')][_0x8dd1('0x4c')]));_0x56a5fe[_0x8dd1('0x5f')]=_0x56a5fe['attributes']['length']?_0x56a5fe[_0x8dd1('0x5f')]:_0x5ae1b4[_0x8dd1('0x4b')];if(_0xff1f0f[_0x8dd1('0x49')]['includeAll']){_0x56a5fe[_0x8dd1('0x58')]=[{'all':!![]}];}_0x56a5fe=_[_0x8dd1('0x54')]({},_0x56a5fe,_0xff1f0f[_0x8dd1('0x56')]);return db[_0x8dd1('0x44')][_0x8dd1('0x60')](_0x56a5fe)[_0x8dd1('0x23')](handleEntityNotFound(_0x3dd813,null))['then'](respondWithResult(_0x3dd813,null))[_0x8dd1('0x2e')](handleError(_0x3dd813,null));};exports['create']=function(_0x1fe341,_0xc3d70d){return db[_0x8dd1('0x44')][_0x8dd1('0x61')](_0x1fe341[_0x8dd1('0x62')],{})['then'](function(_0x26c794){var _0x2d9d5e=_0x1fe341['user'][_0x8dd1('0x3c')]({'plain':!![]});if(!_0x2d9d5e)throw new Error(_0x8dd1('0x63'));if(_0x2d9d5e[_0x8dd1('0x64')]===_0x8dd1('0x65')){var _0x28806c=_0x26c794[_0x8dd1('0x3c')]({'plain':!![]});var _0x18f45f='FaxAccounts';return db[_0x8dd1('0x66')]['find']({'where':{'name':_0x18f45f,'userProfileId':_0x2d9d5e[_0x8dd1('0x67')]},'raw':!![]})[_0x8dd1('0x23')](function(_0x55623a){if(_0x55623a&&_0x55623a[_0x8dd1('0x68')]===0x0){return db['UserProfileResource'][_0x8dd1('0x61')]({'name':_0x28806c[_0x8dd1('0x3f')],'resourceId':_0x28806c['id'],'type':_0x55623a[_0x8dd1('0x3f')],'sectionId':_0x55623a['id']},{})[_0x8dd1('0x23')](function(){return _0x26c794;});}else{return _0x26c794;}})['catch'](function(_0x2f0aa7){logger[_0x8dd1('0x28')](_0x8dd1('0x69'),_0x2f0aa7);throw _0x2f0aa7;});}return _0x26c794;})[_0x8dd1('0x23')](respondWithResult(_0xc3d70d,0xc9))[_0x8dd1('0x2e')](handleError(_0xc3d70d,null));};exports[_0x8dd1('0x6a')]=function(_0x17bca2,_0x1cfe07){if(_0x17bca2[_0x8dd1('0x62')]['id']){delete _0x17bca2[_0x8dd1('0x62')]['id'];}return db[_0x8dd1('0x44')]['find']({'where':{'id':_0x17bca2[_0x8dd1('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x8dd1('0x42')}]})[_0x8dd1('0x23')](handleEntityNotFound(_0x1cfe07,null))[_0x8dd1('0x23')](saveUpdates(_0x17bca2[_0x8dd1('0x62')],null))[_0x8dd1('0x23')](respondWithResult(_0x1cfe07,null))[_0x8dd1('0x2e')](handleError(_0x1cfe07,null));};exports[_0x8dd1('0x3b')]=function(_0x2b5b69,_0x45204d){return db[_0x8dd1('0x44')]['find']({'where':{'id':_0x2b5b69[_0x8dd1('0x5c')]['id']}})[_0x8dd1('0x23')](handleEntityNotFound(_0x45204d,null))[_0x8dd1('0x23')](removeEntity(_0x45204d,null))[_0x8dd1('0x2e')](handleError(_0x45204d,null));};exports[_0x8dd1('0x6b')]=function(_0x5619f5,_0x3efea8){return db['FaxAccount']['describe']()[_0x8dd1('0x23')](respondWithResult(_0x3efea8,null))[_0x8dd1('0x2e')](handleError(_0x3efea8,null));};exports['addDisposition']=function(_0xd5e8a9,_0x28d280,_0x5b73d4){if(_0xd5e8a9['body']['id']){delete _0xd5e8a9[_0x8dd1('0x62')]['id'];}return db[_0x8dd1('0x44')][_0x8dd1('0x60')]({'where':{'id':_0xd5e8a9[_0x8dd1('0x5c')]['id']}})[_0x8dd1('0x23')](handleEntityNotFound(_0x28d280,null))[_0x8dd1('0x23')](function(_0x312c2a){if(_0x312c2a){_0xd5e8a9[_0x8dd1('0x62')]['FaxAccountId']=_0x312c2a['id'];return db[_0x8dd1('0x6c')][_0x8dd1('0x61')](_0xd5e8a9[_0x8dd1('0x62')]);}})[_0x8dd1('0x23')](respondWithResult(_0x28d280,null))[_0x8dd1('0x2e')](handleError(_0x28d280,null));};exports[_0x8dd1('0x6d')]=function(_0x32b73b,_0x1df39f,_0x548fc2){var _0x282065={'raw':![],'where':{}};var _0x440ab6={};var _0x2af4b8={'count':0x0,'rows':[]};return db[_0x8dd1('0x44')][_0x8dd1('0x6e')]({'where':{'id':_0x32b73b[_0x8dd1('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1df39f,null))[_0x8dd1('0x23')](function(_0x4ab08c){if(_0x4ab08c){_0x440ab6['model']=_[_0x8dd1('0x5d')](db['Disposition'][_0x8dd1('0x45')]);_0x440ab6['query']=_[_0x8dd1('0x5d')](_0x32b73b[_0x8dd1('0x49')]);_0x440ab6[_0x8dd1('0x5e')]=_[_0x8dd1('0x4a')](_0x440ab6[_0x8dd1('0x4b')],_0x440ab6['query']);_0x282065[_0x8dd1('0x5f')]=_[_0x8dd1('0x4a')](_0x440ab6[_0x8dd1('0x4b')],qs[_0x8dd1('0x4c')](_0x32b73b[_0x8dd1('0x49')][_0x8dd1('0x4c')]));_0x282065[_0x8dd1('0x5f')]=_0x282065['attributes'][_0x8dd1('0x6f')]?_0x282065[_0x8dd1('0x5f')]:_0x440ab6['model'];if(!_0x32b73b[_0x8dd1('0x49')][_0x8dd1('0x4d')](_0x8dd1('0x4e'))){_0x282065[_0x8dd1('0x34')]=qs[_0x8dd1('0x34')](_0x32b73b[_0x8dd1('0x49')]['limit']);_0x282065[_0x8dd1('0x32')]=qs[_0x8dd1('0x32')](_0x32b73b[_0x8dd1('0x49')][_0x8dd1('0x32')]);}_0x282065[_0x8dd1('0x4f')]=qs[_0x8dd1('0x50')](_0x32b73b[_0x8dd1('0x49')]['sort']);_0x282065['where']=qs[_0x8dd1('0x5e')](_[_0x8dd1('0x52')](_0x32b73b[_0x8dd1('0x49')],_0x440ab6[_0x8dd1('0x5e')]));_0x282065[_0x8dd1('0x51')]['FaxAccountId']=_0x4ab08c['id'];if(_0x32b73b[_0x8dd1('0x49')][_0x8dd1('0x53')]){_0x282065[_0x8dd1('0x51')]=_[_0x8dd1('0x54')](_0x282065[_0x8dd1('0x51')],{'$or':_[_0x8dd1('0x43')](_0x282065[_0x8dd1('0x5f')],function(_0x9f4e7e){var _0x5381b0={};_0x5381b0[_0x9f4e7e]={'$like':'%'+_0x32b73b[_0x8dd1('0x49')]['filter']+'%'};return _0x5381b0;})});}_0x282065=_['merge']({},_0x282065,_0x32b73b[_0x8dd1('0x56')]);return db['Disposition'][_0x8dd1('0x35')]({'where':_0x282065[_0x8dd1('0x51')]})[_0x8dd1('0x23')](function(_0x556581){_0x2af4b8[_0x8dd1('0x35')]=_0x556581;if(_0x32b73b[_0x8dd1('0x49')][_0x8dd1('0x57')]){_0x282065['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x282065);})['then'](function(_0x1bcb68){_0x2af4b8[_0x8dd1('0x5a')]=_0x1bcb68;return _0x2af4b8;});}})[_0x8dd1('0x23')](respondWithFilteredResult(_0x1df39f,_0x282065))[_0x8dd1('0x2e')](handleError(_0x1df39f,null));};exports[_0x8dd1('0x70')]=function(_0x813c25,_0xd7cc38,_0x144856){return db[_0x8dd1('0x44')][_0x8dd1('0x60')]({'where':{'id':_0x813c25['params']['id']}})[_0x8dd1('0x23')](handleEntityNotFound(_0xd7cc38,null))[_0x8dd1('0x23')](function(_0x23beba){if(_0x23beba){return _0x23beba[_0x8dd1('0x70')](_0x813c25[_0x8dd1('0x49')]['ids']);}})[_0x8dd1('0x23')](respondWithStatusCode(_0xd7cc38,null))[_0x8dd1('0x2e')](handleError(_0xd7cc38,null));};exports[_0x8dd1('0x71')]=function(_0x49368f,_0x320b22,_0x435287){if(_0x49368f[_0x8dd1('0x62')]['id']){delete _0x49368f[_0x8dd1('0x62')]['id'];}return db[_0x8dd1('0x44')][_0x8dd1('0x60')]({'where':{'id':_0x49368f[_0x8dd1('0x5c')]['id']}})[_0x8dd1('0x23')](handleEntityNotFound(_0x320b22,null))[_0x8dd1('0x23')](function(_0x3a40b0){if(_0x3a40b0){_0x49368f[_0x8dd1('0x62')][_0x8dd1('0x72')]=_0x3a40b0['id'];return db['CannedAnswer'][_0x8dd1('0x61')](_0x49368f[_0x8dd1('0x62')]);}})['then'](respondWithResult(_0x320b22,null))['catch'](handleError(_0x320b22,null));};exports[_0x8dd1('0x73')]=function(_0xf78b77,_0x1bca24,_0x9a2eb2){var _0x46534d={'raw':![],'where':{}};var _0x25842f={};var _0xf80bb={'count':0x0,'rows':[]};return db[_0x8dd1('0x44')]['findOne']({'where':{'id':_0xf78b77[_0x8dd1('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1bca24,null))['then'](function(_0x25d84e){if(_0x25d84e){_0x25842f[_0x8dd1('0x4b')]=_['keys'](db['CannedAnswer'][_0x8dd1('0x45')]);_0x25842f[_0x8dd1('0x49')]=_[_0x8dd1('0x5d')](_0xf78b77[_0x8dd1('0x49')]);_0x25842f['filters']=_['intersection'](_0x25842f[_0x8dd1('0x4b')],_0x25842f[_0x8dd1('0x49')]);_0x46534d[_0x8dd1('0x5f')]=_['intersection'](_0x25842f['model'],qs['fields'](_0xf78b77[_0x8dd1('0x49')][_0x8dd1('0x4c')]));_0x46534d[_0x8dd1('0x5f')]=_0x46534d[_0x8dd1('0x5f')][_0x8dd1('0x6f')]?_0x46534d[_0x8dd1('0x5f')]:_0x25842f[_0x8dd1('0x4b')];if(!_0xf78b77[_0x8dd1('0x49')]['hasOwnProperty'](_0x8dd1('0x4e'))){_0x46534d[_0x8dd1('0x34')]=qs[_0x8dd1('0x34')](_0xf78b77[_0x8dd1('0x49')][_0x8dd1('0x34')]);_0x46534d[_0x8dd1('0x32')]=qs[_0x8dd1('0x32')](_0xf78b77[_0x8dd1('0x49')][_0x8dd1('0x32')]);}_0x46534d[_0x8dd1('0x4f')]=qs[_0x8dd1('0x50')](_0xf78b77[_0x8dd1('0x49')][_0x8dd1('0x50')]);_0x46534d['where']=qs['filters'](_[_0x8dd1('0x52')](_0xf78b77[_0x8dd1('0x49')],_0x25842f['filters']));_0x46534d[_0x8dd1('0x51')][_0x8dd1('0x72')]=_0x25d84e['id'];if(_0xf78b77[_0x8dd1('0x49')][_0x8dd1('0x53')]){_0x46534d[_0x8dd1('0x51')]=_[_0x8dd1('0x54')](_0x46534d['where'],{'$or':_[_0x8dd1('0x43')](_0x46534d[_0x8dd1('0x5f')],function(_0x5c1654){var _0x5398af={};_0x5398af[_0x5c1654]={'$like':'%'+_0xf78b77[_0x8dd1('0x49')]['filter']+'%'};return _0x5398af;})});}_0x46534d=_[_0x8dd1('0x54')]({},_0x46534d,_0xf78b77['options']);return db[_0x8dd1('0x74')]['count']({'where':_0x46534d[_0x8dd1('0x51')]})[_0x8dd1('0x23')](function(_0x1550fa){_0xf80bb['count']=_0x1550fa;if(_0xf78b77[_0x8dd1('0x49')][_0x8dd1('0x57')]){_0x46534d[_0x8dd1('0x58')]=[{'all':!![]}];}return db[_0x8dd1('0x74')]['findAll'](_0x46534d);})[_0x8dd1('0x23')](function(_0x28306b){_0xf80bb[_0x8dd1('0x5a')]=_0x28306b;return _0xf80bb;});}})[_0x8dd1('0x23')](respondWithFilteredResult(_0x1bca24,_0x46534d))[_0x8dd1('0x2e')](handleError(_0x1bca24,null));};exports[_0x8dd1('0x75')]=function(_0x1fd7b6,_0x16e64d,_0x210615){return db[_0x8dd1('0x44')][_0x8dd1('0x60')]({'where':{'id':_0x1fd7b6[_0x8dd1('0x5c')]['id']}})[_0x8dd1('0x23')](handleEntityNotFound(_0x16e64d,null))[_0x8dd1('0x23')](function(_0x48a1af){if(_0x48a1af){return _0x48a1af[_0x8dd1('0x75')](_0x1fd7b6[_0x8dd1('0x49')][_0x8dd1('0x76')]);}})[_0x8dd1('0x23')](respondWithStatusCode(_0x16e64d,null))['catch'](handleError(_0x16e64d,null));};exports['addInteraction']=function(_0x181401,_0x1a8c9f,_0x45e149){return db[_0x8dd1('0x77')][_0x8dd1('0x60')]({'where':{'id':_0x181401[_0x8dd1('0x5c')]['id']}})[_0x8dd1('0x23')](handleEntityNotFound(_0x1a8c9f,null))[_0x8dd1('0x23')](function(_0x368266){if(_0x368266){return _0x368266['addInteraction'](_0x181401[_0x8dd1('0x62')]['ids'],_[_0x8dd1('0x78')](_0x181401[_0x8dd1('0x62')],[_0x8dd1('0x76'),'id'])||{});}})[_0x8dd1('0x23')](respondWithResult(_0x1a8c9f,null))['catch'](handleError(_0x1a8c9f,null));};exports[_0x8dd1('0x79')]=function(_0x3243cd,_0x3a9fe1,_0x10a417){var _0x59fefa={'raw':![],'where':{}};var _0x44c10e={};var _0x3beebe={'count':0x0,'rows':[]};return db[_0x8dd1('0x44')][_0x8dd1('0x6e')]({'where':{'id':_0x3243cd[_0x8dd1('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3a9fe1,null))[_0x8dd1('0x23')](function(_0x40a3d6){if(_0x40a3d6){_0x44c10e[_0x8dd1('0x4b')]=_[_0x8dd1('0x5d')](db[_0x8dd1('0x77')]['rawAttributes']);_0x44c10e[_0x8dd1('0x49')]=_[_0x8dd1('0x5d')](_0x3243cd['query']);_0x44c10e[_0x8dd1('0x5e')]=_['intersection'](_0x44c10e[_0x8dd1('0x4b')],_0x44c10e['query']);_0x59fefa[_0x8dd1('0x5f')]=_[_0x8dd1('0x4a')](_0x44c10e[_0x8dd1('0x4b')],qs[_0x8dd1('0x4c')](_0x3243cd[_0x8dd1('0x49')][_0x8dd1('0x4c')]));_0x59fefa[_0x8dd1('0x5f')]=_0x59fefa[_0x8dd1('0x5f')][_0x8dd1('0x6f')]?_0x59fefa[_0x8dd1('0x5f')]:_0x44c10e[_0x8dd1('0x4b')];if(!_0x3243cd[_0x8dd1('0x49')][_0x8dd1('0x4d')](_0x8dd1('0x4e'))){_0x59fefa[_0x8dd1('0x34')]=qs[_0x8dd1('0x34')](_0x3243cd['query'][_0x8dd1('0x34')]);_0x59fefa[_0x8dd1('0x32')]=qs[_0x8dd1('0x32')](_0x3243cd[_0x8dd1('0x49')][_0x8dd1('0x32')]);}_0x59fefa[_0x8dd1('0x4f')]=qs[_0x8dd1('0x50')](_0x3243cd[_0x8dd1('0x49')]['sort']);_0x59fefa[_0x8dd1('0x51')]=qs[_0x8dd1('0x5e')](_['pick'](_0x3243cd[_0x8dd1('0x49')],_0x44c10e['filters']));_0x59fefa[_0x8dd1('0x51')]['FaxAccountId']=_0x40a3d6['id'];if(_0x3243cd['query']['filter']){_0x59fefa['where']=_[_0x8dd1('0x54')](_0x59fefa[_0x8dd1('0x51')],{'$or':_[_0x8dd1('0x43')](_0x59fefa[_0x8dd1('0x5f')],function(_0x24b160){var _0x59d522={};_0x59d522[_0x24b160]={'$like':'%'+_0x3243cd[_0x8dd1('0x49')][_0x8dd1('0x53')]+'%'};return _0x59d522;})});}_0x59fefa=_[_0x8dd1('0x54')]({},_0x59fefa,_0x3243cd[_0x8dd1('0x56')]);return db[_0x8dd1('0x77')][_0x8dd1('0x35')]({'where':_0x59fefa[_0x8dd1('0x51')]})[_0x8dd1('0x23')](function(_0x4770d7){_0x3beebe[_0x8dd1('0x35')]=_0x4770d7;if(_0x3243cd[_0x8dd1('0x49')][_0x8dd1('0x57')]){_0x59fefa[_0x8dd1('0x58')]=[{'model':db[_0x8dd1('0x7a')],'as':_0x8dd1('0x7b'),'required':![]},{'model':db[_0x8dd1('0x7c')],'as':'Owner','attributes':[_0x8dd1('0x3f'),_0x8dd1('0x7d'),'internal'],'required':![]},{'model':db[_0x8dd1('0x7e')],'as':_0x8dd1('0x7f'),'attributes':['id','name',_0x8dd1('0x80')],'where':_0x3243cd[_0x8dd1('0x49')][_0x8dd1('0x81')]?{'id':_0x3243cd[_0x8dd1('0x49')][_0x8dd1('0x81')]}:undefined,'required':_0x3243cd['query']['tag']?!![]:![]}];}return db[_0x8dd1('0x77')][_0x8dd1('0x59')](_0x59fefa);})[_0x8dd1('0x23')](function(_0x5bedf8){_0x3beebe['rows']=_0x5bedf8;return _0x3beebe;});}})[_0x8dd1('0x23')](respondWithFilteredResult(_0x3a9fe1,_0x59fefa))[_0x8dd1('0x2e')](handleError(_0x3a9fe1,null));};exports[_0x8dd1('0x82')]=function(_0x2435fb,_0xd1cfb5){var _0x4a1a62=_0x2435fb[_0x8dd1('0x5c')]['id'];var _0x111806=_0x2435fb[_0x8dd1('0x62')];var _0x1f401b=0xc8;var _0x216882=null;return db[_0x8dd1('0x83')][_0x8dd1('0x84')]({'isolationLevel':db[_0x8dd1('0x83')]['Transaction'][_0x8dd1('0x85')][_0x8dd1('0x86')]},function(_0x432990){return db['FaxAccount'][_0x8dd1('0x6e')]({'where':{'id':_0x4a1a62},'transaction':_0x432990})[_0x8dd1('0x23')](function(_0x2ed559){if(_0x2ed559){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x4a1a62},'transaction':_0x432990})[_0x8dd1('0x23')](function(){var _0x2153dd=_[_0x8dd1('0x43')](_0x111806,function(_0x5e4049){_0x5e4049[_0x8dd1('0x72')]=_0x4a1a62;return _0x5e4049;});return db['FaxApplication'][_0x8dd1('0x87')](_0x2153dd,{'transaction':_0x432990});});}else{_0x1f401b=0x194;_0x216882=[];}});})[_0x8dd1('0x23')](function(){if(_0x1f401b!==0x194){return db['FaxApplication'][_0x8dd1('0x88')]({'where':{'FaxAccountId':_0x4a1a62},'order':_0x8dd1('0x89')})[_0x8dd1('0x23')](function(_0x2ef6be){_0x216882=_0x2ef6be;});}})[_0x8dd1('0x2e')](function(_0x96a72e){_0x1f401b=0x1f4;logger[_0x8dd1('0x28')](_0x96a72e['stack']);if(_0x96a72e[_0x8dd1('0x3f')]){delete _0x96a72e[_0x8dd1('0x3f')];}_0x216882=_0x96a72e;})[_0x8dd1('0x8a')](function(){if(_0x216882===null){_0xd1cfb5['sendStatus'](_0x1f401b);}else{if(_0x1f401b===0x1f4){_0xd1cfb5['status'](_0x1f401b)[_0x8dd1('0x8b')](_0x216882);}else{_0xd1cfb5[_0x8dd1('0x36')](_0x1f401b)[_0x8dd1('0x31')](_0x216882);}}});};exports[_0x8dd1('0x8c')]=function(_0x12d655,_0x151b1e,_0x1d0405){var _0x10b86a={};var _0x2ec89f={};var _0x356210;var _0x63f46;return db['FaxAccount'][_0x8dd1('0x6e')]({'where':{'id':_0x12d655[_0x8dd1('0x5c')]['id']}})['then'](handleEntityNotFound(_0x151b1e,null))[_0x8dd1('0x23')](function(_0x45d8ea){if(_0x45d8ea){_0x356210=_0x45d8ea;_0x2ec89f['model']=_['keys'](db[_0x8dd1('0x8d')][_0x8dd1('0x45')]);_0x2ec89f[_0x8dd1('0x49')]=_[_0x8dd1('0x5d')](_0x12d655[_0x8dd1('0x49')]);_0x2ec89f[_0x8dd1('0x5e')]=_[_0x8dd1('0x4a')](_0x2ec89f[_0x8dd1('0x4b')],_0x2ec89f[_0x8dd1('0x49')]);_0x10b86a['attributes']=_[_0x8dd1('0x4a')](_0x2ec89f[_0x8dd1('0x4b')],qs[_0x8dd1('0x4c')](_0x12d655[_0x8dd1('0x49')][_0x8dd1('0x4c')]));_0x10b86a[_0x8dd1('0x5f')]=_0x10b86a[_0x8dd1('0x5f')][_0x8dd1('0x6f')]?_0x10b86a[_0x8dd1('0x5f')]:_0x2ec89f[_0x8dd1('0x4b')];_0x10b86a[_0x8dd1('0x4f')]=qs[_0x8dd1('0x50')](_0x12d655[_0x8dd1('0x49')][_0x8dd1('0x50')]);_0x10b86a['where']=qs[_0x8dd1('0x5e')](_[_0x8dd1('0x52')](_0x12d655[_0x8dd1('0x49')],_0x2ec89f[_0x8dd1('0x5e')]));if(_0x12d655[_0x8dd1('0x49')][_0x8dd1('0x53')]){_0x10b86a[_0x8dd1('0x51')]=_[_0x8dd1('0x54')](_0x10b86a[_0x8dd1('0x51')],{'$or':_[_0x8dd1('0x43')](_0x10b86a[_0x8dd1('0x5f')],function(_0x21e7c4){var _0x464781={};_0x464781[_0x21e7c4]={'$like':'%'+_0x12d655[_0x8dd1('0x49')][_0x8dd1('0x53')]+'%'};return _0x464781;})});}_0x10b86a=_['merge']({},_0x10b86a,_0x12d655['options']);return _0x356210['getApplications'](_0x10b86a);}})[_0x8dd1('0x23')](function(_0x52d1d3){if(_0x52d1d3){_0x63f46=_0x52d1d3[_0x8dd1('0x6f')];if(!_0x12d655[_0x8dd1('0x49')][_0x8dd1('0x4d')]('nolimit')){_0x10b86a['limit']=qs[_0x8dd1('0x34')](_0x12d655['query'][_0x8dd1('0x34')]);_0x10b86a[_0x8dd1('0x32')]=qs[_0x8dd1('0x32')](_0x12d655[_0x8dd1('0x49')][_0x8dd1('0x32')]);}return _0x356210[_0x8dd1('0x8c')](_0x10b86a);}})[_0x8dd1('0x23')](function(_0x1153e6){if(_0x1153e6){return _0x1153e6?{'count':_0x63f46,'rows':_0x1153e6}:null;}})[_0x8dd1('0x23')](respondWithResult(_0x151b1e,null))[_0x8dd1('0x2e')](handleError(_0x151b1e,null));};function Extension(_0x5ba8e8,_0x1fe96f,_0x187ff2,_0x2e1602){this[_0x8dd1('0x8e')]=_0x8dd1('0x8f');this[_0x8dd1('0x90')]=_0x5ba8e8[_0x8dd1('0x91')];this[_0x8dd1('0x92')]=_0x2e1602;this[_0x8dd1('0x47')]=_0x8dd1('0x93');this[_0x8dd1('0x94')]=_0x8dd1('0x95');this[_0x8dd1('0x72')]=_0x5ba8e8['id'];this['priority']=_0x1fe96f;this[_0x8dd1('0x96')]=_0x187ff2;}function createExtensionsReciveFax(_0x2785f1){var _0x4eeebc=0x1;var _0x5b25ad=[];_0x5b25ad[_0x8dd1('0x97')](new Extension(_0x2785f1,_0x4eeebc,'',_0x8dd1('0x98')));_0x4eeebc+=0x1;_0x5b25ad[_0x8dd1('0x97')](new Extension(_0x2785f1,_0x4eeebc,_0x8dd1('0x99'),_0x8dd1('0x9a')));_0x4eeebc+=0x1;for(var _0x540a63 in _0x2785f1){if(_0x2785f1[_0x8dd1('0x4d')](_0x540a63)&&(_0x540a63===_0x8dd1('0x9b')||_0x540a63===_0x8dd1('0x91')||_0x540a63===_0x8dd1('0x9c')||_0x540a63===_0x8dd1('0x9d')||_0x540a63==='headerinfo'||_0x540a63===_0x8dd1('0x9e')||_0x540a63===_0x8dd1('0x9f')||_0x540a63==='modem'||_0x540a63===_0x8dd1('0xa0'))){_0x5b25ad[_0x8dd1('0x97')](new Extension(_0x2785f1,_0x4eeebc,'FAXOPT('+_0x540a63+')='+_0x2785f1[_0x540a63],_0x8dd1('0x9a')));_0x4eeebc+=0x1;}}_0x5b25ad['push'](new Extension(_0x2785f1,_0x4eeebc,'6',_0x8dd1('0xa1')));_0x4eeebc+=0x1;_0x5b25ad[_0x8dd1('0x97')](new Extension(_0x2785f1,_0x4eeebc,_0x8dd1('0xa2'),'ReceiveFax'));_0x4eeebc=0x0;return _0x5b25ad;}exports[_0x8dd1('0xa3')]=function(_0x113a13,_0xb8e450,_0x8c5e04){var _0x5c896a;return db[_0x8dd1('0x83')][_0x8dd1('0x84')](function(_0x5883cb){return db[_0x8dd1('0x44')][_0x8dd1('0x61')](_0x113a13[_0x8dd1('0x62')],{'transaction':_0x5883cb})[_0x8dd1('0x23')](function(_0x14aab1){_0x5c896a=_0x14aab1['get']({'plain':!![]});return db[_0x8dd1('0xa4')][_0x8dd1('0x87')](createExtensionsReciveFax(_0x5c896a),{'transaction':_0x5883cb});});})['then'](function(){return _0x5c896a;})[_0x8dd1('0x23')](respondWithResult(_0xb8e450,null))[_0x8dd1('0x2e')](handleError(_0xb8e450,null));};exports[_0x8dd1('0xa5')]=function(_0x334524,_0x1128b7,_0x42d7a4){var _0x2f4e75;return db[_0x8dd1('0x83')][_0x8dd1('0x84')](function(_0x3b88d3){return db[_0x8dd1('0x44')][_0x8dd1('0x6a')](_0x334524[_0x8dd1('0x62')],{'where':{'id':_0x334524[_0x8dd1('0x62')]['id']},'transaction':_0x3b88d3})[_0x8dd1('0x23')](function(_0x1ee6d4){return db[_0x8dd1('0xa4')][_0x8dd1('0x3b')]({'where':{'FaxAccountId':_0x334524[_0x8dd1('0x62')]['id']},'transaction':_0x3b88d3})['then'](function(_0x1e0340){return db[_0x8dd1('0xa4')][_0x8dd1('0x87')](createExtensionsReciveFax(_[_0x8dd1('0x78')](_0x334524['body'],[_0x8dd1('0xa6'),_0x8dd1('0x48'),_0x8dd1('0xa7'),_0x8dd1('0xa8'),_0x8dd1('0xa9'),'ListId'])),{'transaction':_0x3b88d3});});});})['then'](function(){return db[_0x8dd1('0x44')][_0x8dd1('0xaa')](_0x334524[_0x8dd1('0x62')]['id']);})[_0x8dd1('0x23')](respondWithResult(_0x1128b7,null))['catch'](handleError(_0x1128b7,null));};exports[_0x8dd1('0xab')]=function(_0x560e5b,_0x1ee8c8,_0x25a7af){var _0x5ac8c1={'raw':!![],'where':{}};var _0x5d0ddd={};var _0x46cc01={'count':0x0,'rows':[]};return db[_0x8dd1('0x44')][_0x8dd1('0x6e')]({'where':{'id':_0x560e5b['params']['id']}})[_0x8dd1('0x23')](handleEntityNotFound(_0x1ee8c8,null))[_0x8dd1('0x23')](function(_0x1e376f){if(_0x1e376f){_0x5d0ddd[_0x8dd1('0x4b')]=_['keys'](db['FaxMessage'][_0x8dd1('0x45')]);_0x5d0ddd[_0x8dd1('0x49')]=_[_0x8dd1('0x5d')](_0x560e5b[_0x8dd1('0x49')]);_0x5d0ddd[_0x8dd1('0x5e')]=_['intersection'](_0x5d0ddd[_0x8dd1('0x4b')],_0x5d0ddd['query']);_0x5ac8c1[_0x8dd1('0x5f')]=_[_0x8dd1('0x4a')](_0x5d0ddd[_0x8dd1('0x4b')],qs[_0x8dd1('0x4c')](_0x560e5b[_0x8dd1('0x49')][_0x8dd1('0x4c')]));_0x5ac8c1['attributes']=_0x5ac8c1[_0x8dd1('0x5f')][_0x8dd1('0x6f')]?_0x5ac8c1[_0x8dd1('0x5f')]:_0x5d0ddd[_0x8dd1('0x4b')];if(!_0x560e5b[_0x8dd1('0x49')][_0x8dd1('0x4d')](_0x8dd1('0x4e'))){_0x5ac8c1[_0x8dd1('0x34')]=qs[_0x8dd1('0x34')](_0x560e5b[_0x8dd1('0x49')][_0x8dd1('0x34')]);_0x5ac8c1[_0x8dd1('0x32')]=qs['offset'](_0x560e5b[_0x8dd1('0x49')][_0x8dd1('0x32')]);}_0x5ac8c1[_0x8dd1('0x4f')]=qs[_0x8dd1('0x50')](_0x560e5b[_0x8dd1('0x49')]['sort']);_0x5ac8c1[_0x8dd1('0x51')]=qs['filters'](_[_0x8dd1('0x52')](_0x560e5b[_0x8dd1('0x49')],_0x5d0ddd[_0x8dd1('0x5e')]));_0x5ac8c1[_0x8dd1('0x51')][_0x8dd1('0x72')]=_0x1e376f['id'];if(_0x560e5b[_0x8dd1('0x49')][_0x8dd1('0x53')]){_0x5ac8c1[_0x8dd1('0x51')]=_[_0x8dd1('0x54')](_0x5ac8c1[_0x8dd1('0x51')],{'$or':_[_0x8dd1('0x43')](_0x5ac8c1[_0x8dd1('0x5f')],function(_0x394a9f){var _0xa2494a={};_0xa2494a[_0x394a9f]={'$like':'%'+_0x560e5b[_0x8dd1('0x49')]['filter']+'%'};return _0xa2494a;})});}if(_0x560e5b['query'][_0x8dd1('0xac')]){var _0x32ed5=_0x560e5b[_0x8dd1('0x49')][_0x8dd1('0xac')][_0x8dd1('0xad')](',');var _0x8bdacf={};_0x8bdacf[_0x32ed5[0x0]]={'$gte':moment(_0x32ed5[0x1])[_0x8dd1('0xae')](_0x8dd1('0xaf'))};_0x5ac8c1['where']=_[_0x8dd1('0x54')](_0x5ac8c1[_0x8dd1('0x51')],_0x8bdacf);}_0x5ac8c1=_[_0x8dd1('0x54')]({},_0x5ac8c1,_0x560e5b[_0x8dd1('0x56')]);return db['FaxMessage'][_0x8dd1('0x35')]({'where':_0x5ac8c1[_0x8dd1('0x51')]})[_0x8dd1('0x23')](function(_0x85b27d){_0x46cc01[_0x8dd1('0x35')]=_0x85b27d;if(_0x560e5b[_0x8dd1('0x49')][_0x8dd1('0x57')]){_0x5ac8c1['include']=[{'all':!![]}];}return db[_0x8dd1('0xb0')][_0x8dd1('0x59')](_0x5ac8c1);})['then'](function(_0x5d1d6f){_0x46cc01['rows']=_0x5d1d6f;return _0x46cc01;});}})[_0x8dd1('0x23')](respondWithFilteredResult(_0x1ee8c8,_0x5ac8c1))['catch'](handleError(_0x1ee8c8,null));};exports[_0x8dd1('0x8b')]=function(_0x402040,_0x3887a1,_0x307c3a){var _0x54d8be,_0x40e134={},_0x4e0f3f;if(_0x402040[_0x8dd1('0x62')]['to']){_0x4e0f3f=_0x402040[_0x8dd1('0x62')]['to'][0x0];}return db[_0x8dd1('0x44')][_0x8dd1('0x60')]({'where':{'id':_0x402040[_0x8dd1('0x5c')]['id']},'include':[{'model':db[_0x8dd1('0xb1')],'as':_0x8dd1('0xb2'),'include':[{'model':db['CmContact'],'as':_0x8dd1('0xb3'),'where':{'fax':_0x4e0f3f},'limit':0x1,'order':[[_0x8dd1('0xa8'),_0x8dd1('0xb4')]]}]}]})[_0x8dd1('0x23')](handleEntityNotFound(_0x3887a1,null))['then'](function(_0x2248e0){_0x54d8be=_0x2248e0;if(_0x402040['body'][_0x8dd1('0xb5')]&&_0x402040[_0x8dd1('0x62')]['attachments'][_0x8dd1('0x6f')]){for(var _0x66393f=0x0;_0x66393f<_0x402040[_0x8dd1('0x62')][_0x8dd1('0xb5')][_0x8dd1('0x6f')];_0x66393f+=0x1){_0x402040[_0x8dd1('0x62')][_0x8dd1('0xb5')][_0x66393f]={'filename':_0x402040[_0x8dd1('0x62')]['attachments'][_0x66393f][_0x8dd1('0x3f')],'id':_0x402040[_0x8dd1('0x62')]['attachments'][_0x66393f]['id'],'path':path['join'](config[_0x8dd1('0xb6')],_0x8dd1('0xb7'),_0x402040['body']['attachments'][_0x66393f]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x8dd1('0xb8'),{'FaxAccountId':_['isNil'](_0x402040['params']['id'])?undefined:_0x402040[_0x8dd1('0x5c')]['id'],'path':_[_0x8dd1('0xb9')](_0x402040[_0x8dd1('0x62')]['attachments'][0x0][_0x8dd1('0x6')])?undefined:_0x402040[_0x8dd1('0x62')][_0x8dd1('0xb5')][0x0]['path'],'fax':_[_0x8dd1('0xb9')](_0x402040[_0x8dd1('0x62')]['to'][0x0])?undefined:_0x402040[_0x8dd1('0x62')]['to'][0x0]},client9002);})[_0x8dd1('0x23')](function(){if(_0x54d8be){if(_['isNil'](_0x402040[_0x8dd1('0x62')]['from'])){_0x402040[_0x8dd1('0x62')][_0x8dd1('0xba')]=util['format']('\x22%s\x22\x20<%s>',_0x54d8be[_0x8dd1('0x3f')],_0x54d8be[_0x8dd1('0xbb')]);}if(_0x54d8be[_0x8dd1('0xb2')]){if(_0x54d8be[_0x8dd1('0xb2')][_0x8dd1('0xb3')]['length']){return _0x54d8be['List'][_0x8dd1('0xb3')][0x0];}else{return db[_0x8dd1('0x7a')][_0x8dd1('0x61')](_[_0x8dd1('0x1a')](_0x402040[_0x8dd1('0x62')],{'firstName':_0x402040[_0x8dd1('0x62')]['to'][0x0],'phone':_0x402040[_0x8dd1('0x62')]['to'][0x0],'fax':_0x402040['body']['to'][0x0],'ListId':_0x54d8be[_0x8dd1('0xbc')]}));}}else{throw new Error(_0x8dd1('0xbd'));}}else{throw new Error(_0x8dd1('0xbe'));}})[_0x8dd1('0x23')](function(_0xf304ef){if(_0xf304ef){return db[_0x8dd1('0x77')][_0x8dd1('0x60')]({'where':{'ContactId':_0xf304ef['id'],'closed':![],'FaxAccountId':_0x54d8be['id']}})[_0x8dd1('0x23')](function(_0x35f2a9){if(_0x35f2a9){return[_0x35f2a9,![]];}return db['FaxInteraction'][_0x8dd1('0x61')]({'UserId':_0x402040[_0x8dd1('0x65')]['id'],'ContactId':_0xf304ef['id'],'FaxAccountId':_0x54d8be['id'],'fax':_0x402040[_0x8dd1('0x62')]['to'][0x0],'firstMsgDirection':_0x8dd1('0xbf'),'Messages':[_['merge'](_0x402040[_0x8dd1('0x62')],{'read':![],'body':_0x402040[_0x8dd1('0x62')][_0x8dd1('0xb5')][0x0][_0x8dd1('0xc0')],'FaxAccountId':_0x54d8be['id'],'UserId':_0x402040[_0x8dd1('0x65')]['id'],'ContactId':_0xf304ef['id'],'AttachmentId':_0x402040[_0x8dd1('0x62')][_0x8dd1('0xb5')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x8dd1('0xc1')}]})[_0x8dd1('0x23')](function(_0x1a947e){return[_0x1a947e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x8dd1('0xc2')](function(_0x306c85,_0x400e27){if(_0x400e27){return _0x306c85;}return db[_0x8dd1('0xb0')][_0x8dd1('0x61')]({'direction':_0x8dd1('0xbf'),'read':![],'body':_0x402040[_0x8dd1('0x62')][_0x8dd1('0xb5')][0x0]['filename'],'FaxAccountId':_0x54d8be['id'],'FaxInteractionId':_0x306c85['id'],'UserId':_0x402040[_0x8dd1('0x65')]['id'],'ContactId':_0x306c85[_0x8dd1('0xc3')],'AttachmentId':_0x402040['body'][_0x8dd1('0xb5')][0x0]['id']})[_0x8dd1('0x23')](function(_0x1ac22b){_0x306c85[_0x8dd1('0xc4')][_0x8dd1('0xc1')]=[];_0x306c85[_0x8dd1('0xc4')][_0x8dd1('0xc1')]['push'](_0x1ac22b['dataValues']);return _0x306c85;});})[_0x8dd1('0x23')](function(_0x52c9cf){respondWithRpcPromise(_0x8dd1('0xc5'),_0x8dd1('0xc5'),{'FaxAccountId':_[_0x8dd1('0xb9')](_0x402040[_0x8dd1('0x5c')]['id'])?undefined:_0x402040['params']['id'],'path':_['isNil'](_0x402040[_0x8dd1('0x62')]['attachments'][0x0][_0x8dd1('0x6')])?undefined:_0x402040[_0x8dd1('0x62')][_0x8dd1('0xb5')][0x0][_0x8dd1('0x6')],'fax':_[_0x8dd1('0xb9')](_0x402040[_0x8dd1('0x62')]['to'][0x0])?undefined:_0x402040[_0x8dd1('0x62')]['to'][0x0],'AttachmentId':_0x402040[_0x8dd1('0x62')][_0x8dd1('0xb5')][0x0]['id']},client9002)[_0x8dd1('0x23')](function(_0x4ca523){logger[_0x8dd1('0x24')](_0x8dd1('0xc6'),_0x4ca523);})['catch'](function(_0x5a3055){logger['info'](_0x8dd1('0xc6'),_0x5a3055);});return _0x52c9cf;})[_0x8dd1('0x23')](respondWithResult(_0x3887a1,null))[_0x8dd1('0x2e')](handleError(_0x3887a1,null));};exports['addAgents']=function(_0x588852,_0x50190,_0x545256){return db[_0x8dd1('0x44')][_0x8dd1('0x60')]({'where':{'id':_0x588852[_0x8dd1('0x5c')]['id']}})[_0x8dd1('0x23')](handleEntityNotFound(_0x50190,null))[_0x8dd1('0x23')](function(_0x2c775a){if(_0x2c775a){return _0x2c775a['addAgents'](_0x588852[_0x8dd1('0x62')][_0x8dd1('0x76')],_[_0x8dd1('0x78')](_0x588852['body'],[_0x8dd1('0x76'),'id'])||{})[_0x8dd1('0xc2')](function(_0x3be7dd){for(var _0x5591dc=0x0;_0x5591dc<_0x588852['body']['ids']['length'];_0x5591dc+=0x1){socket[_0x8dd1('0xc7')]('userFaxAccount:save',{'UserId':Number(_0x588852[_0x8dd1('0x62')][_0x8dd1('0x76')][_0x5591dc]),'FaxAccountId':Number(_0x588852[_0x8dd1('0x5c')]['id'])});}return _0x3be7dd;});}})['then'](respondWithResult(_0x50190,null))['catch'](handleError(_0x50190,null));};exports[_0x8dd1('0xc8')]=function(_0x433792,_0x74a82d,_0x1581ab){return db[_0x8dd1('0x44')]['find']({'where':{'id':_0x433792[_0x8dd1('0x5c')]['id']}})[_0x8dd1('0x23')](handleEntityNotFound(_0x74a82d,null))[_0x8dd1('0x23')](function(_0x5a47bd){if(_0x5a47bd){return _0x5a47bd[_0x8dd1('0xc8')](_0x433792['query'][_0x8dd1('0x76')])['then'](function(){if(_[_0x8dd1('0xc9')](_0x433792[_0x8dd1('0x49')][_0x8dd1('0x76')])){for(var _0x2a41fc=0x0;_0x2a41fc<_0x433792[_0x8dd1('0x49')][_0x8dd1('0x76')][_0x8dd1('0x6f')];_0x2a41fc+=0x1){socket[_0x8dd1('0xc7')]('userFaxAccount:remove',{'UserId':Number(_0x433792[_0x8dd1('0x49')][_0x8dd1('0x76')][_0x2a41fc]),'FaxAccountId':Number(_0x433792[_0x8dd1('0x5c')]['id'])});}}else{socket[_0x8dd1('0xc7')](_0x8dd1('0xca'),{'UserId':Number(_0x433792[_0x8dd1('0x49')][_0x8dd1('0x76')]),'FaxAccountId':Number(_0x433792['params']['id'])});}});}})[_0x8dd1('0x23')](respondWithStatusCode(_0x74a82d,null))[_0x8dd1('0x2e')](handleError(_0x74a82d,null));};exports['getAgents']=function(_0x385f7a,_0x3231a2,_0x4b0d80){var _0x19799b={};var _0x409ebd={};var _0x9fd918;var _0x1f99c4;return db['FaxAccount'][_0x8dd1('0x6e')]({'where':{'id':_0x385f7a['params']['id']}})[_0x8dd1('0x23')](handleEntityNotFound(_0x3231a2,null))[_0x8dd1('0x23')](function(_0x3c778c){if(_0x3c778c){_0x9fd918=_0x3c778c;_0x409ebd[_0x8dd1('0x4b')]=_[_0x8dd1('0x5d')](db[_0x8dd1('0x7c')][_0x8dd1('0x45')]);_0x409ebd[_0x8dd1('0x49')]=_['keys'](_0x385f7a['query']);_0x409ebd['filters']=_['intersection'](_0x409ebd[_0x8dd1('0x4b')],_0x409ebd[_0x8dd1('0x49')]);_0x19799b[_0x8dd1('0x5f')]=_[_0x8dd1('0x4a')](_0x409ebd[_0x8dd1('0x4b')],qs[_0x8dd1('0x4c')](_0x385f7a[_0x8dd1('0x49')][_0x8dd1('0x4c')]));_0x19799b[_0x8dd1('0x5f')]=_0x19799b[_0x8dd1('0x5f')][_0x8dd1('0x6f')]?_0x19799b['attributes']:_0x409ebd[_0x8dd1('0x4b')];_0x19799b[_0x8dd1('0x4f')]=qs[_0x8dd1('0x50')](_0x385f7a[_0x8dd1('0x49')]['sort']);_0x19799b['where']=qs[_0x8dd1('0x5e')](_[_0x8dd1('0x52')](_0x385f7a['query'],_0x409ebd[_0x8dd1('0x5e')]));if(_0x385f7a[_0x8dd1('0x49')][_0x8dd1('0x53')]){_0x19799b['where']=_['merge'](_0x19799b[_0x8dd1('0x51')],{'$or':_['map'](_0x19799b['attributes'],function(_0x2a90d6){var _0x5b2fbd={};_0x5b2fbd[_0x2a90d6]={'$like':'%'+_0x385f7a[_0x8dd1('0x49')]['filter']+'%'};return _0x5b2fbd;})});}_0x19799b=_['merge']({},_0x19799b,_0x385f7a['options']);return _0x9fd918[_0x8dd1('0xcb')](_0x19799b);}})[_0x8dd1('0x23')](function(_0x4af20d){if(_0x4af20d){_0x1f99c4=_0x4af20d['length'];if(!_0x385f7a[_0x8dd1('0x49')][_0x8dd1('0x4d')](_0x8dd1('0x4e'))){_0x19799b[_0x8dd1('0x34')]=qs[_0x8dd1('0x34')](_0x385f7a[_0x8dd1('0x49')][_0x8dd1('0x34')]);_0x19799b[_0x8dd1('0x32')]=qs[_0x8dd1('0x32')](_0x385f7a[_0x8dd1('0x49')][_0x8dd1('0x32')]);}return _0x9fd918[_0x8dd1('0xcb')](_0x19799b);}})['then'](function(_0x503614){if(_0x503614){return _0x503614?{'count':_0x1f99c4,'rows':_0x503614}:null;}})[_0x8dd1('0x23')](respondWithResult(_0x3231a2,null))[_0x8dd1('0x2e')](handleError(_0x3231a2,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 74a5b06..cab8ef1 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 _0xe064=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0xefe6c8,_0x26682e){var _0x12b760=function(_0x18df5c){while(--_0x18df5c){_0xefe6c8['push'](_0xefe6c8['shift']());}};_0x12b760(++_0x26682e);}(_0xe064,0x73));var _0x4e06=function(_0x17cdcc,_0x29d5de){_0x17cdcc=_0x17cdcc-0x0;var _0x38f5f6=_0xe064[_0x17cdcc];return _0x38f5f6;};'use strict';var EventEmitter=require(_0x4e06('0x0'));var FaxAccount=require(_0x4e06('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4e06('0x2')](0x0);var events={'afterCreate':_0x4e06('0x3'),'afterUpdate':_0x4e06('0x4'),'afterDestroy':'remove'};function emitEvent(_0x54ed8a){return function(_0x4b9d27,_0x3f8692,_0x1c169e){FaxAccountEvents[_0x4e06('0x5')](_0x54ed8a+':'+_0x4b9d27['id'],_0x4b9d27);FaxAccountEvents['emit'](_0x54ed8a,_0x4b9d27);_0x1c169e(null);};}for(var e in events){if(events[_0x4e06('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x4e06('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x9cc3=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x33dc03,_0x1cb4f0){var _0x5bab38=function(_0x5394e1){while(--_0x5394e1){_0x33dc03['push'](_0x33dc03['shift']());}};_0x5bab38(++_0x1cb4f0);}(_0x9cc3,0xeb));var _0x39cc=function(_0x5d7116,_0x4f3c47){_0x5d7116=_0x5d7116-0x0;var _0x5c69b0=_0x9cc3[_0x5d7116];return _0x5c69b0;};'use strict';var EventEmitter=require(_0x39cc('0x0'));var FaxAccount=require(_0x39cc('0x1'))['db'][_0x39cc('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x39cc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x39cc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x29f48d){return function(_0x317c43,_0x33f5f6,_0x35e85f){FaxAccountEvents['emit'](_0x29f48d+':'+_0x317c43['id'],_0x317c43);FaxAccountEvents[_0x39cc('0x5')](_0x29f48d,_0x317c43);_0x35e85f(null);};}for(var e in events){if(events[_0x39cc('0x6')](e)){var event=events[e];FaxAccount[_0x39cc('0x7')](e,emitEvent(event));}}module[_0x39cc('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 9bbb238..5fc6be7 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 _0xd51c=['exports','FaxAccount','fax_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x39f3fa,_0x5b0ef5){var _0x55b85f=function(_0xf5977d){while(--_0xf5977d){_0x39f3fa['push'](_0x39f3fa['shift']());}};_0x55b85f(++_0x5b0ef5);}(_0xd51c,0x147));var _0xcd51=function(_0xac35b3,_0x35e4a6){_0xac35b3=_0xac35b3-0x0;var _0x3cd4d4=_0xd51c[_0xac35b3];return _0x3cd4d4;};'use strict';var _=require(_0xcd51('0x0'));var util=require(_0xcd51('0x1'));var logger=require(_0xcd51('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcd51('0x3'));var rp=require(_0xcd51('0x4'));var fs=require('fs');var path=require(_0xcd51('0x5'));var rimraf=require(_0xcd51('0x6'));var config=require(_0xcd51('0x7'));var attributes=require(_0xcd51('0x8'));module[_0xcd51('0x9')]=function(_0x4e74d8,_0x5b8b9f){return _0x4e74d8['define'](_0xcd51('0xa'),attributes,{'tableName':_0xcd51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4796=['bluebird','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','api','moment'];(function(_0x3d3b8e,_0x220ecb){var _0x503e72=function(_0x11d9f2){while(--_0x11d9f2){_0x3d3b8e['push'](_0x3d3b8e['shift']());}};_0x503e72(++_0x220ecb);}(_0x4796,0x1bf));var _0x6479=function(_0x2ec2f2,_0x3b1ee5){_0x2ec2f2=_0x2ec2f2-0x0;var _0x5b093a=_0x4796[_0x2ec2f2];return _0x5b093a;};'use strict';var _=require('lodash');var util=require(_0x6479('0x0'));var logger=require('../../config/logger')(_0x6479('0x1'));var moment=require(_0x6479('0x2'));var BPromise=require(_0x6479('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6479('0x4'));var config=require('../../config/environment');var attributes=require(_0x6479('0x5'));module[_0x6479('0x6')]=function(_0x47fe4e,_0x232715){return _0x47fe4e[_0x6479('0x7')](_0x6479('0x8'),attributes,{'tableName':_0x6479('0x9'),'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 82242c5..17ed9b6 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 _0x09ee=['AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./faxAccount.socket','register','request','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','FaxAccount','findAll','options','raw','attributes','limit','include','model','map','then','GetFaxAccount','catch','NotifyFaxAccount','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','body','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','orderBy','asc','length','contact','fax','FaxInteraction','create','Contact\x20not\x20found','unmanaged','*,*,*,*','interaction','FaxMessage','ContactId'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x09ee,0x1b2));var _0xe09e=function(_0x228800,_0x1a89fe){_0x228800=_0x228800-0x0;var _0x5383f9=_0x09ee[_0x228800];return _0x5383f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe09e('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe09e('0x1'))['db'];var utils=require(_0xe09e('0x2'));var logger=require(_0xe09e('0x3'))(_0xe09e('0x4'));var config=require(_0xe09e('0x5'));var jayson=require(_0xe09e('0x6'));var client=jayson['client'][_0xe09e('0x7')]({'port':0x232c});config[_0xe09e('0x8')]=_[_0xe09e('0x9')](config[_0xe09e('0x8')],{'host':_0xe09e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe09e('0x8')]));require(_0xe09e('0xb'))[_0xe09e('0xc')](socket);function respondWithRpcPromise(_0x1dceaa,_0x3750a5,_0x542faf){return new BPromise(function(_0x3b4a23,_0x7a472e){return client[_0xe09e('0xd')](_0x1dceaa,_0x542faf)['then'](function(_0x306e8a){logger[_0xe09e('0xe')]('FaxAccount,\x20%s,\x20%s',_0x3750a5,_0xe09e('0xf'));logger['debug'](_0xe09e('0x10'),_0x3750a5,'request\x20sent',JSON[_0xe09e('0x11')](_0x306e8a));if(_0x306e8a['error']){if(_0x306e8a[_0xe09e('0x12')][_0xe09e('0x13')]===0x1f4){logger[_0xe09e('0x12')](_0xe09e('0x14'),_0x3750a5,_0x306e8a[_0xe09e('0x12')]['message']);return _0x7a472e(_0x306e8a[_0xe09e('0x12')]['message']);}logger[_0xe09e('0x12')](_0xe09e('0x14'),_0x3750a5,_0x306e8a[_0xe09e('0x12')]['message']);return _0x3b4a23(_0x306e8a[_0xe09e('0x12')][_0xe09e('0x15')]);}else{logger[_0xe09e('0xe')](_0xe09e('0x14'),_0x3750a5,_0xe09e('0xf'));_0x3b4a23(_0x306e8a[_0xe09e('0x16')][_0xe09e('0x15')]);}})['catch'](function(_0x54f91f){logger[_0xe09e('0x12')](_0xe09e('0x14'),_0x3750a5,_0x54f91f);_0x7a472e(_0x54f91f);});});}exports['GetFaxAccount']=function(_0x20f15b){var _0x1c6eeb=this;return new Promise(function(_0x2ceed8,_0x5f1d2d){return db[_0xe09e('0x17')][_0xe09e('0x18')]({'raw':_0x20f15b[_0xe09e('0x19')]?_0x20f15b[_0xe09e('0x19')][_0xe09e('0x1a')]===undefined?!![]:![]:!![],'where':_0x20f15b[_0xe09e('0x19')]?_0x20f15b[_0xe09e('0x19')]['where']||null:null,'attributes':_0x20f15b[_0xe09e('0x19')]?_0x20f15b['options'][_0xe09e('0x1b')]||null:null,'limit':_0x20f15b[_0xe09e('0x19')]?_0x20f15b[_0xe09e('0x19')][_0xe09e('0x1c')]||null:null,'include':_0x20f15b[_0xe09e('0x19')]?_0x20f15b[_0xe09e('0x19')][_0xe09e('0x1d')]?_['map'](_0x20f15b[_0xe09e('0x19')][_0xe09e('0x1d')],function(_0x919cd3){return{'model':db[_0x919cd3[_0xe09e('0x1e')]],'as':_0x919cd3['as'],'attributes':_0x919cd3[_0xe09e('0x1b')],'include':_0x919cd3['include']?_['map'](_0x919cd3[_0xe09e('0x1d')],function(_0x5d2443){return{'model':db[_0x5d2443[_0xe09e('0x1e')]],'as':_0x5d2443['as'],'attributes':_0x5d2443[_0xe09e('0x1b')],'include':_0x5d2443[_0xe09e('0x1d')]?_[_0xe09e('0x1f')](_0x5d2443[_0xe09e('0x1d')],function(_0x5d0870){return{'model':db[_0x5d0870['model']],'as':_0x5d0870['as'],'attributes':_0x5d0870[_0xe09e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe09e('0x20')](function(_0x2f2776){logger[_0xe09e('0xe')](_0xe09e('0x21'),_0x20f15b);logger['debug']('GetFaxAccount',_0x20f15b,JSON[_0xe09e('0x11')](_0x2f2776));_0x2ceed8(_0x2f2776);})[_0xe09e('0x22')](function(_0x35afcb){logger[_0xe09e('0x12')](_0xe09e('0x21'),_0x35afcb[_0xe09e('0x15')],_0x20f15b);_0x5f1d2d(_0x1c6eeb[_0xe09e('0x12')](0x1f4,_0x35afcb[_0xe09e('0x15')]));});});};exports[_0xe09e('0x23')]=function(_0x94fa10,_0x28a081,_0x4f2cd2){var _0x116b93=this;return new Promise(function(_0x558e2a,_0x49bbad){var _0x4d492a={'body':_0x94fa10['body'],'channel':'fax'};var _0x598da3=[];var _0x25fde2=[];var _0x2fe676={};return db[_0xe09e('0x24')][_0xe09e('0x25')]()[_0xe09e('0x20')](function(_0x5ed07e){if(!_0x5ed07e){throw new db[(_0xe09e('0x26'))][(_0xe09e('0x27'))](_0xe09e('0x28'));}_0x598da3=_[_0xe09e('0x29')](_[_0xe09e('0x2a')](_0x5ed07e),[_0xe09e('0x2b'),_0xe09e('0x2c')]);_0x25fde2=_[_0xe09e('0x29')](_[_0xe09e('0x2a')](_0x5ed07e),['createdAt',_0xe09e('0x2c'),'CompanyId',_0xe09e('0x2d')]);if(_0x94fa10['body']['id']){delete _0x94fa10[_0xe09e('0x2e')]['id'];}if(_['isNil'](_0x94fa10[_0xe09e('0x2e')]['from'])){throw new db['Sequelize'][(_0xe09e('0x27'))](_0xe09e('0x2f'));}if(_['isNil'](_0x94fa10[_0xe09e('0x2e')][_0xe09e('0x2e')])||_0x94fa10[_0xe09e('0x2e')][_0xe09e('0x2e')]===''){throw new db[(_0xe09e('0x26'))][(_0xe09e('0x27'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x94fa10['body']['mapKey'])){throw new db[(_0xe09e('0x26'))][(_0xe09e('0x27'))](_0xe09e('0x30')+_0x25fde2);}if(!_[_0xe09e('0x31')](_0x25fde2,_0x94fa10[_0xe09e('0x2e')][_0xe09e('0x32')])){throw new db[(_0xe09e('0x26'))][(_0xe09e('0x27'))](_0xe09e('0x33')+_0x25fde2);}_0x2fe676[_0x94fa10['body'][_0xe09e('0x32')]]=_0x94fa10[_0xe09e('0x2e')][_0xe09e('0x34')];})[_0xe09e('0x20')](function(){return db[_0xe09e('0x17')][_0xe09e('0x35')]({'where':{'id':_0x94fa10[_0xe09e('0x36')]['id']},'include':[{'model':db[_0xe09e('0x37')],'as':_0xe09e('0x38'),'include':[{'model':db[_0xe09e('0x24')],'as':_0xe09e('0x39'),'where':_0x2fe676,'limit':0x1,'order':[[_0xe09e('0x2c'),_0xe09e('0x3a')]]}]},{'model':db[_0xe09e('0x3b')],'as':_0xe09e('0x3c')}]});})[_0xe09e('0x20')](function(_0x39e6e){if(_0x39e6e&&_0x39e6e['List']){var _0x4ef4c6=_0x39e6e[_0xe09e('0x3d')]({'plain':!![]});_0x4d492a[_0xe09e('0x36')]=_0x4ef4c6;_0x4d492a['applications']=_0x4ef4c6[_0xe09e('0x3c')];_0x4d492a['list']=_0x4ef4c6[_0xe09e('0x38')];_0x4d492a[_0xe09e('0x3e')]=_[_0xe09e('0x3f')](_0x4d492a['applications'],['priority'],[_0xe09e('0x40')]);if(_0x4d492a['account'][_0xe09e('0x3c')]){delete _0x4d492a[_0xe09e('0x36')]['Applications'];}if(_0x4d492a[_0xe09e('0x36')][_0xe09e('0x38')]&&_0x4d492a[_0xe09e('0x36')][_0xe09e('0x38')][_0xe09e('0x39')][_0xe09e('0x41')]){return _0x4d492a[_0xe09e('0x36')][_0xe09e('0x38')][_0xe09e('0x39')][0x0];}var _0x3c8048=_['defaults'](_0x94fa10[_0xe09e('0x2e')],{'firstName':_0x94fa10['body'][_0xe09e('0x34')],'ListId':_0x4ef4c6[_0xe09e('0x2d')]});_0x3c8048[_0x94fa10['body']['mapKey']]=_0x94fa10['body'][_0xe09e('0x34')];return db[_0xe09e('0x24')]['create'](_0x3c8048,{'fields':_0x598da3,'raw':!![]});}})[_0xe09e('0x20')](function(_0x175473){_0x4d492a[_0xe09e('0x42')]=_0x175473;if(_0x175473){var _0x5e8acf={'ContactId':_0x175473['id'],'FaxAccountId':_0x94fa10[_0xe09e('0x36')]['id'],'fax':_0x175473[_0xe09e('0x43')]};return db[_0xe09e('0x44')][_0xe09e('0x35')]({'where':{'ContactId':_0x175473['id'],'closed':![],'FaxAccountId':_0x94fa10['account']['id']}})[_0xe09e('0x20')](function(_0x1c00f4){if(_0x1c00f4){return[_0x1c00f4,![]];}return db[_0xe09e('0x44')][_0xe09e('0x45')](_0x5e8acf)[_0xe09e('0x20')](function(_0x4dd3be){return[_0x4dd3be,!![]];});});}else{throw new Error(_0xe09e('0x46'));}})['spread'](function(_0x70398e,_0x7b0711){var _0x3195e2=_0x70398e[_0xe09e('0x3d')]({'plain':!![]});if(_0x7b0711){if(_0x4d492a[_0xe09e('0x36')]['autoclose']){_0x4d492a[_0xe09e('0x3e')]['push']({'id':0x0,'priority':_0x4d492a[_0xe09e('0x3e')]['length']+0x1,'app':'close','appdata':_0xe09e('0x47'),'interval':_0xe09e('0x48')});}_0x3195e2['created']=!![];}else{_0x3195e2['created']=![];}_0x4d492a[_0xe09e('0x49')]=_0x3195e2;return db[_0xe09e('0x4a')][_0xe09e('0x45')]({'body':_0x94fa10[_0xe09e('0x2e')]['body'],'FaxAccountId':_0x94fa10['account']['id'],'FaxInteractionId':_0x70398e['id'],'direction':'in','ContactId':_0x70398e[_0xe09e('0x4b')],'AttachmentId':_0x94fa10[_0xe09e('0x2e')][_0xe09e('0x4c')]});})['then'](function(_0x4592a9){_0x4d492a[_0xe09e('0x15')]=_0x4592a9;if(_0x4d492a['interaction'][_0xe09e('0x4d')]){return db[_0xe09e('0x4e')][_0xe09e('0x35')]({'attributes':['id',_0xe09e('0x4f')],'where':{'id':_0x4d492a['interaction'][_0xe09e('0x4d')]}})[_0xe09e('0x20')](function(_0x5ba3ea){if(_0x5ba3ea){_0x4d492a['applications'][_0xe09e('0x50')]({'id':0x0,'priority':0x0,'app':_0xe09e('0x51'),'appdata':_0x5ba3ea['name']+','+(_0x4d492a[_0xe09e('0x36')][_0xe09e('0x52')]||0xa),'interval':_0xe09e('0x48')});}return respondWithRpcPromise(_0xe09e('0x53'),'startRouting',_0x4d492a);});}return respondWithRpcPromise(_0xe09e('0x53'),_0xe09e('0x54'),_0x4d492a);})[_0xe09e('0x20')](function(_0x254a95){_0x558e2a(_0x254a95);})[_0xe09e('0x22')](function(_0x56b962){_0x49bbad(_0x116b93[_0xe09e('0x12')](0x1f4,_0x56b962[_0xe09e('0x15')]));});});}; \ No newline at end of file +var _0xa2c4=['waitForTheAssignedAgent','startRouting','Start','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetFaxAccount','FaxAccount','findAll','options','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','keys','createdAt','difference','CompanyId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','DESC','FaxApplication','Applications','get','account','list','applications','asc','length','ListId','contact','FaxInteraction','create','Contact\x20not\x20found','spread','close','unmanaged','created','interaction','ContactId','AttachmentId','User','UserId','unshift','agent','name'];(function(_0x526208,_0x1f5cec){var _0x4058e6=function(_0x4555b0){while(--_0x4555b0){_0x526208['push'](_0x526208['shift']());}};_0x4058e6(++_0x1f5cec);}(_0xa2c4,0x10e));var _0x4a2c=function(_0x3ab785,_0x5e94a3){_0x3ab785=_0x3ab785-0x0;var _0x486e29=_0xa2c4[_0x3ab785];return _0x486e29;};'use strict';var _=require(_0x4a2c('0x0'));var util=require('util');var moment=require(_0x4a2c('0x1'));var BPromise=require(_0x4a2c('0x2'));var rs=require(_0x4a2c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a2c('0x4'))['db'];var utils=require(_0x4a2c('0x5'));var logger=require(_0x4a2c('0x6'))(_0x4a2c('0x7'));var config=require('../../config/environment');var jayson=require(_0x4a2c('0x8'));var client=jayson[_0x4a2c('0x9')]['http']({'port':0x232c});config[_0x4a2c('0xa')]=_[_0x4a2c('0xb')](config[_0x4a2c('0xa')],{'host':_0x4a2c('0xc'),'port':0x18eb});var socket=require(_0x4a2c('0xd'))(new Redis(config['redis']));require(_0x4a2c('0xe'))[_0x4a2c('0xf')](socket);function respondWithRpcPromise(_0x4d56db,_0x2049e0,_0x42c100){return new BPromise(function(_0x146821,_0x1b0f1a){return client[_0x4a2c('0x10')](_0x4d56db,_0x42c100)[_0x4a2c('0x11')](function(_0x1c8433){logger['info'](_0x4a2c('0x12'),_0x2049e0,_0x4a2c('0x13'));logger[_0x4a2c('0x14')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x2049e0,_0x4a2c('0x13'),JSON[_0x4a2c('0x15')](_0x1c8433));if(_0x1c8433['error']){if(_0x1c8433[_0x4a2c('0x16')][_0x4a2c('0x17')]===0x1f4){logger[_0x4a2c('0x16')](_0x4a2c('0x12'),_0x2049e0,_0x1c8433[_0x4a2c('0x16')][_0x4a2c('0x18')]);return _0x1b0f1a(_0x1c8433[_0x4a2c('0x16')][_0x4a2c('0x18')]);}logger[_0x4a2c('0x16')](_0x4a2c('0x12'),_0x2049e0,_0x1c8433[_0x4a2c('0x16')][_0x4a2c('0x18')]);return _0x146821(_0x1c8433['error']['message']);}else{logger[_0x4a2c('0x19')](_0x4a2c('0x12'),_0x2049e0,_0x4a2c('0x13'));_0x146821(_0x1c8433[_0x4a2c('0x1a')][_0x4a2c('0x18')]);}})[_0x4a2c('0x1b')](function(_0x2e1bc4){logger['error'](_0x4a2c('0x12'),_0x2049e0,_0x2e1bc4);_0x1b0f1a(_0x2e1bc4);});});}exports[_0x4a2c('0x1c')]=function(_0x589d72){var _0x33b1f4=this;return new Promise(function(_0x5b8eac,_0x5a0ad3){return db[_0x4a2c('0x1d')][_0x4a2c('0x1e')]({'raw':_0x589d72['options']?_0x589d72[_0x4a2c('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x589d72[_0x4a2c('0x1f')]?_0x589d72[_0x4a2c('0x1f')]['where']||null:null,'attributes':_0x589d72[_0x4a2c('0x1f')]?_0x589d72[_0x4a2c('0x1f')][_0x4a2c('0x20')]||null:null,'limit':_0x589d72[_0x4a2c('0x1f')]?_0x589d72[_0x4a2c('0x1f')][_0x4a2c('0x21')]||null:null,'include':_0x589d72[_0x4a2c('0x1f')]?_0x589d72[_0x4a2c('0x1f')][_0x4a2c('0x22')]?_[_0x4a2c('0x23')](_0x589d72[_0x4a2c('0x1f')]['include'],function(_0x440edf){return{'model':db[_0x440edf[_0x4a2c('0x24')]],'as':_0x440edf['as'],'attributes':_0x440edf[_0x4a2c('0x20')],'include':_0x440edf['include']?_[_0x4a2c('0x23')](_0x440edf[_0x4a2c('0x22')],function(_0x1eb2c5){return{'model':db[_0x1eb2c5[_0x4a2c('0x24')]],'as':_0x1eb2c5['as'],'attributes':_0x1eb2c5[_0x4a2c('0x20')],'include':_0x1eb2c5[_0x4a2c('0x22')]?_[_0x4a2c('0x23')](_0x1eb2c5[_0x4a2c('0x22')],function(_0x22f432){return{'model':db[_0x22f432[_0x4a2c('0x24')]],'as':_0x22f432['as'],'attributes':_0x22f432[_0x4a2c('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xce9248){logger[_0x4a2c('0x19')](_0x4a2c('0x1c'),_0x589d72);logger['debug']('GetFaxAccount',_0x589d72,JSON[_0x4a2c('0x15')](_0xce9248));_0x5b8eac(_0xce9248);})[_0x4a2c('0x1b')](function(_0x35a4d9){logger[_0x4a2c('0x16')](_0x4a2c('0x1c'),_0x35a4d9[_0x4a2c('0x18')],_0x589d72);_0x5a0ad3(_0x33b1f4['error'](0x1f4,_0x35a4d9['message']));});});};exports[_0x4a2c('0x25')]=function(_0x2fc947,_0x42d839,_0x54643e){var _0x442d3b=this;return new Promise(function(_0x267325,_0x2129dd){var _0x1b6237={'body':_0x2fc947[_0x4a2c('0x26')],'channel':_0x4a2c('0x27')};var _0x22fac9=[];var _0x134a84=[];var _0x40659a={};return db[_0x4a2c('0x28')][_0x4a2c('0x29')]()[_0x4a2c('0x11')](function(_0x374dc4){if(!_0x374dc4){throw new db['Sequelize'][(_0x4a2c('0x2a'))]('no\x20available\x20attributes');}_0x22fac9=_['difference'](_[_0x4a2c('0x2b')](_0x374dc4),[_0x4a2c('0x2c'),'updatedAt']);_0x134a84=_[_0x4a2c('0x2d')](_[_0x4a2c('0x2b')](_0x374dc4),[_0x4a2c('0x2c'),'updatedAt',_0x4a2c('0x2e'),'ListId']);if(_0x2fc947[_0x4a2c('0x26')]['id']){delete _0x2fc947[_0x4a2c('0x26')]['id'];}if(_[_0x4a2c('0x2f')](_0x2fc947[_0x4a2c('0x26')][_0x4a2c('0x30')])){throw new db[(_0x4a2c('0x31'))][(_0x4a2c('0x2a'))](_0x4a2c('0x32'));}if(_['isNil'](_0x2fc947[_0x4a2c('0x26')][_0x4a2c('0x26')])||_0x2fc947[_0x4a2c('0x26')][_0x4a2c('0x26')]===''){throw new db[(_0x4a2c('0x31'))][(_0x4a2c('0x2a'))](_0x4a2c('0x33'));}if(_[_0x4a2c('0x2f')](_0x2fc947[_0x4a2c('0x26')]['mapKey'])){throw new db[(_0x4a2c('0x31'))]['ValidationError'](_0x4a2c('0x34')+_0x134a84);}if(!_[_0x4a2c('0x35')](_0x134a84,_0x2fc947[_0x4a2c('0x26')][_0x4a2c('0x36')])){throw new db[(_0x4a2c('0x31'))][(_0x4a2c('0x2a'))](_0x4a2c('0x37')+_0x134a84);}_0x40659a[_0x2fc947[_0x4a2c('0x26')][_0x4a2c('0x36')]]=_0x2fc947[_0x4a2c('0x26')][_0x4a2c('0x30')];})[_0x4a2c('0x11')](function(){return db['FaxAccount'][_0x4a2c('0x38')]({'where':{'id':_0x2fc947['account']['id']},'include':[{'model':db[_0x4a2c('0x39')],'as':_0x4a2c('0x3a'),'include':[{'model':db[_0x4a2c('0x28')],'as':_0x4a2c('0x3b'),'where':_0x40659a,'limit':0x1,'order':[['updatedAt',_0x4a2c('0x3c')]]}]},{'model':db[_0x4a2c('0x3d')],'as':_0x4a2c('0x3e')}]});})[_0x4a2c('0x11')](function(_0x497fc0){if(_0x497fc0&&_0x497fc0[_0x4a2c('0x3a')]){var _0x1dfa95=_0x497fc0[_0x4a2c('0x3f')]({'plain':!![]});_0x1b6237[_0x4a2c('0x40')]=_0x1dfa95;_0x1b6237['applications']=_0x1dfa95[_0x4a2c('0x3e')];_0x1b6237[_0x4a2c('0x41')]=_0x1dfa95[_0x4a2c('0x3a')];_0x1b6237[_0x4a2c('0x42')]=_['orderBy'](_0x1b6237[_0x4a2c('0x42')],['priority'],[_0x4a2c('0x43')]);if(_0x1b6237['account'][_0x4a2c('0x3e')]){delete _0x1b6237['account']['Applications'];}if(_0x1b6237['account']['List']&&_0x1b6237[_0x4a2c('0x40')][_0x4a2c('0x3a')][_0x4a2c('0x3b')][_0x4a2c('0x44')]){return _0x1b6237[_0x4a2c('0x40')][_0x4a2c('0x3a')][_0x4a2c('0x3b')][0x0];}var _0xa41a2b=_[_0x4a2c('0xb')](_0x2fc947[_0x4a2c('0x26')],{'firstName':_0x2fc947['body'][_0x4a2c('0x30')],'ListId':_0x1dfa95[_0x4a2c('0x45')]});_0xa41a2b[_0x2fc947[_0x4a2c('0x26')][_0x4a2c('0x36')]]=_0x2fc947[_0x4a2c('0x26')]['from'];return db[_0x4a2c('0x28')]['create'](_0xa41a2b,{'fields':_0x22fac9,'raw':!![]});}})['then'](function(_0x17982e){_0x1b6237[_0x4a2c('0x46')]=_0x17982e;if(_0x17982e){var _0x43605a={'ContactId':_0x17982e['id'],'FaxAccountId':_0x2fc947[_0x4a2c('0x40')]['id'],'fax':_0x17982e[_0x4a2c('0x27')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x17982e['id'],'closed':![],'FaxAccountId':_0x2fc947[_0x4a2c('0x40')]['id']}})['then'](function(_0x32f5d7){if(_0x32f5d7){return[_0x32f5d7,![]];}return db[_0x4a2c('0x47')][_0x4a2c('0x48')](_0x43605a)[_0x4a2c('0x11')](function(_0x1eac88){return[_0x1eac88,!![]];});});}else{throw new Error(_0x4a2c('0x49'));}})[_0x4a2c('0x4a')](function(_0x15e659,_0x189b88){var _0x3a6b11=_0x15e659[_0x4a2c('0x3f')]({'plain':!![]});if(_0x189b88){if(_0x1b6237[_0x4a2c('0x40')]['autoclose']){_0x1b6237[_0x4a2c('0x42')]['push']({'id':0x0,'priority':_0x1b6237[_0x4a2c('0x42')][_0x4a2c('0x44')]+0x1,'app':_0x4a2c('0x4b'),'appdata':_0x4a2c('0x4c'),'interval':'*,*,*,*'});}_0x3a6b11[_0x4a2c('0x4d')]=!![];}else{_0x3a6b11[_0x4a2c('0x4d')]=![];}_0x1b6237[_0x4a2c('0x4e')]=_0x3a6b11;return db['FaxMessage'][_0x4a2c('0x48')]({'body':_0x2fc947[_0x4a2c('0x26')][_0x4a2c('0x26')],'FaxAccountId':_0x2fc947[_0x4a2c('0x40')]['id'],'FaxInteractionId':_0x15e659['id'],'direction':'in','ContactId':_0x15e659[_0x4a2c('0x4f')],'AttachmentId':_0x2fc947['body'][_0x4a2c('0x50')]});})[_0x4a2c('0x11')](function(_0x1a1108){_0x1b6237['message']=_0x1a1108;if(_0x1b6237[_0x4a2c('0x4e')]['UserId']){return db[_0x4a2c('0x51')][_0x4a2c('0x38')]({'attributes':['id','name'],'where':{'id':_0x1b6237['interaction'][_0x4a2c('0x52')]}})['then'](function(_0x41c63f){if(_0x41c63f){_0x1b6237['applications'][_0x4a2c('0x53')]({'id':0x0,'priority':0x0,'app':_0x4a2c('0x54'),'appdata':_0x41c63f[_0x4a2c('0x55')]+','+(_0x1b6237[_0x4a2c('0x40')][_0x4a2c('0x56')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x4a2c('0x57'),_0x1b6237);});}return respondWithRpcPromise(_0x4a2c('0x58'),_0x4a2c('0x57'),_0x1b6237);})['then'](function(_0x49689b){_0x267325(_0x49689b);})[_0x4a2c('0x1b')](function(_0x493dc4){_0x2129dd(_0x442d3b[_0x4a2c('0x16')](0x1f4,_0x493dc4['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 9c8d677..7da176c 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 _0x92a6=['emit','removeListener','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x11926c,_0x2a2df7){var _0x425644=function(_0x269496){while(--_0x269496){_0x11926c['push'](_0x11926c['shift']());}};_0x425644(++_0x2a2df7);}(_0x92a6,0xfc));var _0x692a=function(_0xc274fe,_0x5c92a6){_0xc274fe=_0xc274fe-0x0;var _0xdb6be0=_0x92a6[_0xc274fe];return _0xdb6be0;};'use strict';var FaxAccountEvents=require(_0x692a('0x0'));var events=[_0x692a('0x1'),_0x692a('0x2'),_0x692a('0x3')];function createListener(_0x2a17a6,_0x4c3067){return function(_0x2e4cd4){_0x4c3067[_0x692a('0x4')](_0x2a17a6,_0x2e4cd4);};}function removeListener(_0x25472e,_0x17fc1f){return function(){FaxAccountEvents[_0x692a('0x5')](_0x25472e,_0x17fc1f);};}exports['register']=function(_0x46cfe3){for(var _0x437768=0x0,_0x3d0aee=events[_0x692a('0x6')];_0x437768<_0x3d0aee;_0x437768++){var _0x7f9434=events[_0x437768];var _0x250bf9=createListener(_0x692a('0x7')+_0x7f9434,_0x46cfe3);FaxAccountEvents['on'](_0x7f9434,_0x250bf9);}}; \ No newline at end of file +var _0x542b=['./faxAccount.events','save','remove','update','emit','removeListener','register','faxAccount:'];(function(_0x4f8a17,_0x1690aa){var _0x7cb8a5=function(_0x3aea2b){while(--_0x3aea2b){_0x4f8a17['push'](_0x4f8a17['shift']());}};_0x7cb8a5(++_0x1690aa);}(_0x542b,0x188));var _0xb542=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x542b[_0x5a95fa];return _0x1a61b8;};'use strict';var FaxAccountEvents=require(_0xb542('0x0'));var events=[_0xb542('0x1'),_0xb542('0x2'),_0xb542('0x3')];function createListener(_0x5e81df,_0x964319){return function(_0x4a86b8){_0x964319[_0xb542('0x4')](_0x5e81df,_0x4a86b8);};}function removeListener(_0x29cf2f,_0x3e3469){return function(){FaxAccountEvents[_0xb542('0x5')](_0x29cf2f,_0x3e3469);};}exports[_0xb542('0x6')]=function(_0x218e45){for(var _0x386630=0x0,_0x435662=events['length'];_0x386630<_0x435662;_0x386630++){var _0x549c21=events[_0x386630];var _0x2dad58=createListener(_0xb542('0x7')+_0x549c21,_0x218e45);FaxAccountEvents['on'](_0x549c21,_0x2dad58);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 50d12cf..c6ef7e5 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(_0x3e86fb,_0x5ca364){var _0xa05c5a=function(_0x46acdb){while(--_0x46acdb){_0x3e86fb['push'](_0x3e86fb['shift']());}};_0xa05c5a(++_0x5ca364);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x3a8abf,_0x2e67a7){var _0x1eebc3=function(_0x41ae35){while(--_0x41ae35){_0x3a8abf['push'](_0x3a8abf['shift']());}};_0x1eebc3(++_0x2e67a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 d66dbd7..5408d41 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 _0x4c0e=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x52a9a8,_0x4c68b4){var _0xb139cc=function(_0x48b3ef){while(--_0x48b3ef){_0x52a9a8['push'](_0x52a9a8['shift']());}};_0xb139cc(++_0x4c68b4);}(_0x4c0e,0x6b));var _0xe4c0=function(_0xf1af27,_0x598bb1){_0xf1af27=_0xf1af27-0x0;var _0x46b274=_0x4c0e[_0xf1af27];return _0x46b274;};'use strict';var Sequelize=require(_0xe4c0('0x0'));module[_0xe4c0('0x1')]={'priority':{'type':Sequelize[_0xe4c0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe4c0('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe4c0('0x4')]()},'description':{'type':Sequelize[_0xe4c0('0x3')]},'interval':{'type':Sequelize[_0xe4c0('0x3')],'defaultValue':_0xe4c0('0x5')}}; \ No newline at end of file +var _0xdfd3=['INTEGER','STRING','noop','TEXT','exports'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0xdfd3,0x162));var _0x3dfd=function(_0x128d75,_0x7ef83c){_0x128d75=_0x128d75-0x0;var _0x2034e3=_0xdfd3[_0x128d75];return _0x2034e3;};'use strict';var Sequelize=require('sequelize');module[_0x3dfd('0x0')]={'priority':{'type':Sequelize[_0x3dfd('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3dfd('0x2')],'allowNull':![],'defaultValue':_0x3dfd('0x3')},'appdata':{'type':Sequelize[_0x3dfd('0x4')]()},'description':{'type':Sequelize[_0x3dfd('0x2')]},'interval':{'type':Sequelize[_0x3dfd('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index d3e8160..7e6976f 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 _0x786a=['end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','FaxApplication','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','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','sendStatus','status'];(function(_0x2166c0,_0xa986aa){var _0x2f68d5=function(_0x4869e3){while(--_0x4869e3){_0x2166c0['push'](_0x2166c0['shift']());}};_0x2f68d5(++_0xa986aa);}(_0x786a,0x1b1));var _0xa786=function(_0x4ca7cb,_0x3b048c){_0x4ca7cb=_0x4ca7cb-0x0;var _0x5b5593=_0x786a[_0x4ca7cb];return _0x5b5593;};'use strict';var emlformat=require(_0xa786('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa786('0x1'));var jsonpatch=require(_0xa786('0x2'));var rp=require('request-promise');var moment=require(_0xa786('0x3'));var BPromise=require(_0xa786('0x4'));var Mustache=require(_0xa786('0x5'));var util=require(_0xa786('0x6'));var path=require(_0xa786('0x7'));var sox=require('sox');var csv=require(_0xa786('0x8'));var ejs=require(_0xa786('0x9'));var fs=require('fs');var fs_extra=require(_0xa786('0xa'));var _=require(_0xa786('0xb'));var squel=require(_0xa786('0xc'));var crypto=require(_0xa786('0xd'));var jsforce=require(_0xa786('0xe'));var deskjs=require(_0xa786('0xf'));var toCsv=require(_0xa786('0x8'));var querystring=require(_0xa786('0x10'));var Papa=require(_0xa786('0x11'));var Redis=require(_0xa786('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa786('0x13'));var as=require(_0xa786('0x14'));var hardwareService=require(_0xa786('0x15'));var logger=require('../../config/logger')(_0xa786('0x16'));var utils=require(_0xa786('0x17'));var config=require(_0xa786('0x18'));var licenseUtil=require(_0xa786('0x19'));var db=require(_0xa786('0x1a'))['db'];function respondWithStatusCode(_0x364cf1,_0x70497){_0x70497=_0x70497||0xcc;return function(_0x1ea5ac){if(_0x1ea5ac){return _0x364cf1[_0xa786('0x1b')](_0x70497);}return _0x364cf1[_0xa786('0x1c')](_0x70497)[_0xa786('0x1d')]();};}function respondWithResult(_0x1f38ed,_0x5ce7e5){_0x5ce7e5=_0x5ce7e5||0xc8;return function(_0x370607){if(_0x370607){return _0x1f38ed['status'](_0x5ce7e5)[_0xa786('0x1e')](_0x370607);}};}function respondWithFilteredResult(_0xff04f2,_0x53785d){return function(_0x4e7e8c){if(_0x4e7e8c){var _0x1fbcf7=typeof _0x53785d[_0xa786('0x1f')]==='undefined'&&typeof _0x53785d[_0xa786('0x20')]===_0xa786('0x21');var _0x34e4ab=_0x4e7e8c[_0xa786('0x22')];var _0x584cfd=_0x1fbcf7?0x0:_0x53785d['offset'];var _0x2ea44a=_0x1fbcf7?_0x4e7e8c['count']:_0x53785d[_0xa786('0x1f')]+_0x53785d[_0xa786('0x20')];var _0x302592;if(_0x2ea44a>=_0x34e4ab){_0x2ea44a=_0x34e4ab;_0x302592=0xc8;}else{_0x302592=0xce;}_0xff04f2[_0xa786('0x1c')](_0x302592);return _0xff04f2[_0xa786('0x23')](_0xa786('0x24'),_0x584cfd+'-'+_0x2ea44a+'/'+_0x34e4ab)[_0xa786('0x1e')](_0x4e7e8c);}return null;};}function patchUpdates(_0x592a07){return function(_0x56556f){try{jsonpatch[_0xa786('0x25')](_0x56556f,_0x592a07,!![]);}catch(_0x501324){return BPromise[_0xa786('0x26')](_0x501324);}return _0x56556f[_0xa786('0x27')]();};}function saveUpdates(_0x4476bc,_0x449a61){return function(_0x35190b){if(_0x35190b){return _0x35190b[_0xa786('0x28')](_0x4476bc)[_0xa786('0x29')](function(_0x26fbf1){return _0x26fbf1;});}return null;};}function removeEntity(_0x5ea579,_0x58297e){return function(_0x3a7ff2){if(_0x3a7ff2){return _0x3a7ff2[_0xa786('0x2a')]()[_0xa786('0x29')](function(){_0x5ea579[_0xa786('0x1c')](0xcc)[_0xa786('0x1d')]();});}};}function handleEntityNotFound(_0x3d40b5,_0x378c71){return function(_0x21d83d){if(!_0x21d83d){_0x3d40b5['sendStatus'](0x194);}return _0x21d83d;};}function handleError(_0x169f30,_0x5c17f1){_0x5c17f1=_0x5c17f1||0x1f4;return function(_0x21031a){logger['error'](_0x21031a[_0xa786('0x2b')]);if(_0x21031a[_0xa786('0x2c')]){delete _0x21031a[_0xa786('0x2c')];}_0x169f30['status'](_0x5c17f1)[_0xa786('0x2d')](_0x21031a);};}exports[_0xa786('0x2e')]=function(_0x48c95b,_0x40c488){var _0x218271={},_0x4421c9={},_0x45b4d9={'count':0x0,'rows':[]};var _0x5b0432=_[_0xa786('0x2f')](db[_0xa786('0x30')][_0xa786('0x31')],function(_0x4cd577){return{'name':_0x4cd577['fieldName'],'type':_0x4cd577[_0xa786('0x32')][_0xa786('0x33')]};});_0x4421c9['model']=_[_0xa786('0x2f')](_0x5b0432,_0xa786('0x2c'));_0x4421c9[_0xa786('0x34')]=_[_0xa786('0x35')](_0x48c95b[_0xa786('0x34')]);_0x4421c9[_0xa786('0x36')]=_[_0xa786('0x37')](_0x4421c9[_0xa786('0x38')],_0x4421c9[_0xa786('0x34')]);_0x218271[_0xa786('0x39')]=_[_0xa786('0x37')](_0x4421c9[_0xa786('0x38')],qs['fields'](_0x48c95b[_0xa786('0x34')][_0xa786('0x3a')]));_0x218271[_0xa786('0x39')]=_0x218271['attributes'][_0xa786('0x3b')]?_0x218271[_0xa786('0x39')]:_0x4421c9[_0xa786('0x38')];if(!_0x48c95b[_0xa786('0x34')][_0xa786('0x3c')](_0xa786('0x3d'))){_0x218271[_0xa786('0x20')]=qs[_0xa786('0x20')](_0x48c95b['query'][_0xa786('0x20')]);_0x218271[_0xa786('0x1f')]=qs[_0xa786('0x1f')](_0x48c95b[_0xa786('0x34')][_0xa786('0x1f')]);}_0x218271[_0xa786('0x3e')]=qs['sort'](_0x48c95b[_0xa786('0x34')][_0xa786('0x3f')]);_0x218271['where']=qs[_0xa786('0x36')](_['pick'](_0x48c95b[_0xa786('0x34')],_0x4421c9[_0xa786('0x36')]),_0x5b0432);if(_0x48c95b[_0xa786('0x34')]['filter']){_0x218271[_0xa786('0x40')]=_[_0xa786('0x41')](_0x218271[_0xa786('0x40')],{'$or':_['map'](_0x5b0432,function(_0xdba792){if(_0xdba792[_0xa786('0x32')]!==_0xa786('0x42')){var _0x374fa6={};_0x374fa6[_0xdba792[_0xa786('0x2c')]]={'$like':'%'+_0x48c95b['query'][_0xa786('0x43')]+'%'};return _0x374fa6;}})});}_0x218271=_[_0xa786('0x41')]({},_0x218271,_0x48c95b['options']);var _0x48eca2={'where':_0x218271[_0xa786('0x40')]};return db['FaxApplication'][_0xa786('0x22')](_0x48eca2)[_0xa786('0x29')](function(_0x1da154){_0x45b4d9['count']=_0x1da154;if(_0x48c95b[_0xa786('0x34')][_0xa786('0x44')]){_0x218271[_0xa786('0x45')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x218271);})[_0xa786('0x29')](function(_0x18db8d){_0x45b4d9[_0xa786('0x46')]=_0x18db8d;return _0x45b4d9;})[_0xa786('0x29')](respondWithFilteredResult(_0x40c488,_0x218271))[_0xa786('0x47')](handleError(_0x40c488,null));};exports[_0xa786('0x48')]=function(_0x4c72b1,_0x4ace46){var _0x22e00f={'raw':!![],'where':{'id':_0x4c72b1[_0xa786('0x49')]['id']}},_0xf33770={};_0xf33770[_0xa786('0x38')]=_[_0xa786('0x35')](db[_0xa786('0x30')][_0xa786('0x31')]);_0xf33770['query']=_[_0xa786('0x35')](_0x4c72b1[_0xa786('0x34')]);_0xf33770[_0xa786('0x36')]=_['intersection'](_0xf33770[_0xa786('0x38')],_0xf33770['query']);_0x22e00f[_0xa786('0x39')]=_['intersection'](_0xf33770['model'],qs['fields'](_0x4c72b1[_0xa786('0x34')][_0xa786('0x3a')]));_0x22e00f['attributes']=_0x22e00f['attributes']['length']?_0x22e00f[_0xa786('0x39')]:_0xf33770['model'];if(_0x4c72b1[_0xa786('0x34')][_0xa786('0x44')]){_0x22e00f[_0xa786('0x45')]=[{'all':!![]}];}_0x22e00f=_[_0xa786('0x41')]({},_0x22e00f,_0x4c72b1['options']);return db[_0xa786('0x30')][_0xa786('0x4a')](_0x22e00f)['then'](handleEntityNotFound(_0x4ace46,null))[_0xa786('0x29')](respondWithResult(_0x4ace46,null))[_0xa786('0x47')](handleError(_0x4ace46,null));};exports[_0xa786('0x4b')]=function(_0x31d33e,_0x2387c6){return db[_0xa786('0x30')][_0xa786('0x4b')](_0x31d33e['body'],{})[_0xa786('0x29')](respondWithResult(_0x2387c6,0xc9))[_0xa786('0x47')](handleError(_0x2387c6,null));};exports['update']=function(_0x387c61,_0x99ccd5){if(_0x387c61['body']['id']){delete _0x387c61['body']['id'];}return db['FaxApplication'][_0xa786('0x4a')]({'where':{'id':_0x387c61['params']['id']}})[_0xa786('0x29')](handleEntityNotFound(_0x99ccd5,null))[_0xa786('0x29')](saveUpdates(_0x387c61[_0xa786('0x4c')],null))['then'](respondWithResult(_0x99ccd5,null))[_0xa786('0x47')](handleError(_0x99ccd5,null));};exports[_0xa786('0x2a')]=function(_0x2fa2e,_0x583ad2){return db['FaxApplication'][_0xa786('0x4a')]({'where':{'id':_0x2fa2e[_0xa786('0x49')]['id']}})[_0xa786('0x29')](handleEntityNotFound(_0x583ad2,null))[_0xa786('0x29')](removeEntity(_0x583ad2,null))[_0xa786('0x47')](handleError(_0x583ad2,null));}; \ No newline at end of file +var _0x1915=['VIRTUAL','options','FaxApplication','include','findAll','rows','catch','show','params','rawAttributes','fields','create','body','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','save','then','destroy','error','name','index','map','fieldName','type','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge'];(function(_0x3c9864,_0x488a3c){var _0x416dcd=function(_0x3f03d6){while(--_0x3f03d6){_0x3c9864['push'](_0x3c9864['shift']());}};_0x416dcd(++_0x488a3c);}(_0x1915,0x177));var _0x5191=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1915[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5191('0x0'));var zipdir=require(_0x5191('0x1'));var jsonpatch=require(_0x5191('0x2'));var rp=require(_0x5191('0x3'));var moment=require(_0x5191('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5191('0x5'));var util=require(_0x5191('0x6'));var path=require(_0x5191('0x7'));var sox=require(_0x5191('0x8'));var csv=require(_0x5191('0x9'));var ejs=require(_0x5191('0xa'));var fs=require('fs');var fs_extra=require(_0x5191('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5191('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5191('0xd'));var toCsv=require(_0x5191('0x9'));var querystring=require(_0x5191('0xe'));var Papa=require(_0x5191('0xf'));var Redis=require(_0x5191('0x10'));var authService=require(_0x5191('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5191('0x12'));var hardwareService=require(_0x5191('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5191('0x14'));var config=require(_0x5191('0x15'));var licenseUtil=require(_0x5191('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37312e,_0x4f0402){_0x4f0402=_0x4f0402||0xcc;return function(_0x47b2c2){if(_0x47b2c2){return _0x37312e[_0x5191('0x17')](_0x4f0402);}return _0x37312e[_0x5191('0x18')](_0x4f0402)[_0x5191('0x19')]();};}function respondWithResult(_0x5f1cf2,_0x1b5b6e){_0x1b5b6e=_0x1b5b6e||0xc8;return function(_0x639b4d){if(_0x639b4d){return _0x5f1cf2['status'](_0x1b5b6e)[_0x5191('0x1a')](_0x639b4d);}};}function respondWithFilteredResult(_0xef9e07,_0x38e755){return function(_0x31749e){if(_0x31749e){var _0x28544e=typeof _0x38e755['offset']==='undefined'&&typeof _0x38e755['limit']===_0x5191('0x1b');var _0x5c9b3b=_0x31749e[_0x5191('0x1c')];var _0x57a914=_0x28544e?0x0:_0x38e755[_0x5191('0x1d')];var _0x472e4f=_0x28544e?_0x31749e[_0x5191('0x1c')]:_0x38e755[_0x5191('0x1d')]+_0x38e755['limit'];var _0x15a979;if(_0x472e4f>=_0x5c9b3b){_0x472e4f=_0x5c9b3b;_0x15a979=0xc8;}else{_0x15a979=0xce;}_0xef9e07['status'](_0x15a979);return _0xef9e07['set'](_0x5191('0x1e'),_0x57a914+'-'+_0x472e4f+'/'+_0x5c9b3b)[_0x5191('0x1a')](_0x31749e);}return null;};}function patchUpdates(_0x397518){return function(_0x342037){try{jsonpatch[_0x5191('0x1f')](_0x342037,_0x397518,!![]);}catch(_0x442b67){return BPromise[_0x5191('0x20')](_0x442b67);}return _0x342037[_0x5191('0x21')]();};}function saveUpdates(_0xb746fa,_0x11b3eb){return function(_0x21efd9){if(_0x21efd9){return _0x21efd9['update'](_0xb746fa)[_0x5191('0x22')](function(_0xe81112){return _0xe81112;});}return null;};}function removeEntity(_0x5e3f78,_0x31a724){return function(_0x120608){if(_0x120608){return _0x120608[_0x5191('0x23')]()[_0x5191('0x22')](function(){_0x5e3f78['status'](0xcc)[_0x5191('0x19')]();});}};}function handleEntityNotFound(_0x31d50e,_0x5544c7){return function(_0x250133){if(!_0x250133){_0x31d50e[_0x5191('0x17')](0x194);}return _0x250133;};}function handleError(_0x3acb49,_0x21d751){_0x21d751=_0x21d751||0x1f4;return function(_0x52e5bd){logger[_0x5191('0x24')](_0x52e5bd['stack']);if(_0x52e5bd[_0x5191('0x25')]){delete _0x52e5bd['name'];}_0x3acb49[_0x5191('0x18')](_0x21d751)['send'](_0x52e5bd);};}exports[_0x5191('0x26')]=function(_0x54fd13,_0x288261){var _0x53dc45={},_0x3a2705={},_0x33f865={'count':0x0,'rows':[]};var _0x28fa77=_[_0x5191('0x27')](db['FaxApplication']['rawAttributes'],function(_0x2cee4a){return{'name':_0x2cee4a[_0x5191('0x28')],'type':_0x2cee4a[_0x5191('0x29')]['key']};});_0x3a2705['model']=_[_0x5191('0x27')](_0x28fa77,_0x5191('0x25'));_0x3a2705[_0x5191('0x2a')]=_[_0x5191('0x2b')](_0x54fd13[_0x5191('0x2a')]);_0x3a2705[_0x5191('0x2c')]=_[_0x5191('0x2d')](_0x3a2705['model'],_0x3a2705[_0x5191('0x2a')]);_0x53dc45[_0x5191('0x2e')]=_[_0x5191('0x2d')](_0x3a2705[_0x5191('0x2f')],qs['fields'](_0x54fd13[_0x5191('0x2a')]['fields']));_0x53dc45[_0x5191('0x2e')]=_0x53dc45[_0x5191('0x2e')][_0x5191('0x30')]?_0x53dc45[_0x5191('0x2e')]:_0x3a2705[_0x5191('0x2f')];if(!_0x54fd13['query'][_0x5191('0x31')](_0x5191('0x32'))){_0x53dc45['limit']=qs[_0x5191('0x33')](_0x54fd13[_0x5191('0x2a')][_0x5191('0x33')]);_0x53dc45[_0x5191('0x1d')]=qs[_0x5191('0x1d')](_0x54fd13['query'][_0x5191('0x1d')]);}_0x53dc45['order']=qs[_0x5191('0x34')](_0x54fd13[_0x5191('0x2a')]['sort']);_0x53dc45[_0x5191('0x35')]=qs['filters'](_[_0x5191('0x36')](_0x54fd13[_0x5191('0x2a')],_0x3a2705[_0x5191('0x2c')]),_0x28fa77);if(_0x54fd13[_0x5191('0x2a')][_0x5191('0x37')]){_0x53dc45[_0x5191('0x35')]=_[_0x5191('0x38')](_0x53dc45['where'],{'$or':_[_0x5191('0x27')](_0x28fa77,function(_0x3cf836){if(_0x3cf836[_0x5191('0x29')]!==_0x5191('0x39')){var _0x5b2040={};_0x5b2040[_0x3cf836[_0x5191('0x25')]]={'$like':'%'+_0x54fd13['query'][_0x5191('0x37')]+'%'};return _0x5b2040;}})});}_0x53dc45=_[_0x5191('0x38')]({},_0x53dc45,_0x54fd13[_0x5191('0x3a')]);var _0x224831={'where':_0x53dc45[_0x5191('0x35')]};return db[_0x5191('0x3b')][_0x5191('0x1c')](_0x224831)[_0x5191('0x22')](function(_0x8e6894){_0x33f865['count']=_0x8e6894;if(_0x54fd13[_0x5191('0x2a')]['includeAll']){_0x53dc45[_0x5191('0x3c')]=[{'all':!![]}];}return db[_0x5191('0x3b')][_0x5191('0x3d')](_0x53dc45);})[_0x5191('0x22')](function(_0x2fe3c2){_0x33f865[_0x5191('0x3e')]=_0x2fe3c2;return _0x33f865;})[_0x5191('0x22')](respondWithFilteredResult(_0x288261,_0x53dc45))[_0x5191('0x3f')](handleError(_0x288261,null));};exports[_0x5191('0x40')]=function(_0x8d6bb6,_0x45c5d7){var _0x319fc7={'raw':!![],'where':{'id':_0x8d6bb6[_0x5191('0x41')]['id']}},_0x17e6de={};_0x17e6de[_0x5191('0x2f')]=_[_0x5191('0x2b')](db[_0x5191('0x3b')][_0x5191('0x42')]);_0x17e6de[_0x5191('0x2a')]=_['keys'](_0x8d6bb6[_0x5191('0x2a')]);_0x17e6de[_0x5191('0x2c')]=_[_0x5191('0x2d')](_0x17e6de['model'],_0x17e6de[_0x5191('0x2a')]);_0x319fc7[_0x5191('0x2e')]=_[_0x5191('0x2d')](_0x17e6de[_0x5191('0x2f')],qs['fields'](_0x8d6bb6['query'][_0x5191('0x43')]));_0x319fc7[_0x5191('0x2e')]=_0x319fc7[_0x5191('0x2e')][_0x5191('0x30')]?_0x319fc7[_0x5191('0x2e')]:_0x17e6de[_0x5191('0x2f')];if(_0x8d6bb6['query']['includeAll']){_0x319fc7['include']=[{'all':!![]}];}_0x319fc7=_[_0x5191('0x38')]({},_0x319fc7,_0x8d6bb6[_0x5191('0x3a')]);return db[_0x5191('0x3b')]['find'](_0x319fc7)[_0x5191('0x22')](handleEntityNotFound(_0x45c5d7,null))[_0x5191('0x22')](respondWithResult(_0x45c5d7,null))[_0x5191('0x3f')](handleError(_0x45c5d7,null));};exports['create']=function(_0x2b98ee,_0xc04586){return db[_0x5191('0x3b')][_0x5191('0x44')](_0x2b98ee[_0x5191('0x45')],{})[_0x5191('0x22')](respondWithResult(_0xc04586,0xc9))['catch'](handleError(_0xc04586,null));};exports[_0x5191('0x46')]=function(_0x30a335,_0x2ca44e){if(_0x30a335['body']['id']){delete _0x30a335[_0x5191('0x45')]['id'];}return db[_0x5191('0x3b')]['find']({'where':{'id':_0x30a335[_0x5191('0x41')]['id']}})['then'](handleEntityNotFound(_0x2ca44e,null))[_0x5191('0x22')](saveUpdates(_0x30a335['body'],null))[_0x5191('0x22')](respondWithResult(_0x2ca44e,null))[_0x5191('0x3f')](handleError(_0x2ca44e,null));};exports[_0x5191('0x23')]=function(_0x54bc77,_0xa9d33d){return db['FaxApplication'][_0x5191('0x47')]({'where':{'id':_0x54bc77[_0x5191('0x41')]['id']}})['then'](handleEntityNotFound(_0xa9d33d,null))[_0x5191('0x22')](removeEntity(_0xa9d33d,null))[_0x5191('0x3f')](handleError(_0xa9d33d,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index e175b27..7d63785 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 _0xeafb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','FaxApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2281e3,_0xd60ed){var _0x109906=function(_0x5a2427){while(--_0x5a2427){_0x2281e3['push'](_0x2281e3['shift']());}};_0x109906(++_0xd60ed);}(_0xeafb,0x9c));var _0xbeaf=function(_0x367ac0,_0x2cb992){_0x367ac0=_0x367ac0-0x0;var _0x26013e=_0xeafb[_0x367ac0];return _0x26013e;};'use strict';var _=require(_0xbeaf('0x0'));var util=require(_0xbeaf('0x1'));var logger=require(_0xbeaf('0x2'))(_0xbeaf('0x3'));var moment=require(_0xbeaf('0x4'));var BPromise=require(_0xbeaf('0x5'));var rp=require(_0xbeaf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbeaf('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0xbeaf('0x8')]=function(_0x43b341,_0x45c042){return _0x43b341['define'](_0xbeaf('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbeaf('0xa'),'collate':_0xbeaf('0xb')});}; \ No newline at end of file +var _0x0956=['request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x0956,0x94));var _0x6095=function(_0x194d1c,_0x12f855){_0x194d1c=_0x194d1c-0x0;var _0x53e3fe=_0x0956[_0x194d1c];return _0x53e3fe;};'use strict';var _=require(_0x6095('0x0'));var util=require(_0x6095('0x1'));var logger=require(_0x6095('0x2'))(_0x6095('0x3'));var moment=require(_0x6095('0x4'));var BPromise=require(_0x6095('0x5'));var rp=require(_0x6095('0x6'));var fs=require('fs');var path=require(_0x6095('0x7'));var rimraf=require('rimraf');var config=require(_0x6095('0x8'));var attributes=require(_0x6095('0x9'));module[_0x6095('0xa')]=function(_0x1a1154,_0x511e34){return _0x1a1154[_0x6095('0xb')]('FaxApplication',attributes,{'tableName':_0x6095('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6095('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 7da929e..2f64868 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 _0x1e2a=['../../config/utils','../../config/logger','rpc','jayson/promise','client','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateFaxApplication','update','options','where','attributes','limit','then','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x532182,_0x5a5a21){var _0x4a7ac0=function(_0xdf50f1){while(--_0xdf50f1){_0x532182['push'](_0x532182['shift']());}};_0x4a7ac0(++_0x5a5a21);}(_0x1e2a,0x9d));var _0xa1e2=function(_0x2d4ed1,_0x52f6a0){_0x2d4ed1=_0x2d4ed1-0x0;var _0x26af94=_0x1e2a[_0x2d4ed1];return _0x26af94;};'use strict';var _=require(_0xa1e2('0x0'));var util=require(_0xa1e2('0x1'));var moment=require('moment');var BPromise=require(_0xa1e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1e2('0x3'));var db=require(_0xa1e2('0x4'))['db'];var utils=require(_0xa1e2('0x5'));var logger=require(_0xa1e2('0x6'))(_0xa1e2('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1e2('0x8'));var client=jayson[_0xa1e2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4db352,_0x116637,_0x1c3301){return new BPromise(function(_0x5f252a,_0xf4f079){return client['request'](_0x4db352,_0x1c3301)['then'](function(_0x316f1b){logger[_0xa1e2('0xa')](_0xa1e2('0xb'),_0x116637,_0xa1e2('0xc'));logger[_0xa1e2('0xd')](_0xa1e2('0xe'),_0x116637,'request\x20sent',JSON[_0xa1e2('0xf')](_0x316f1b));if(_0x316f1b[_0xa1e2('0x10')]){if(_0x316f1b[_0xa1e2('0x10')][_0xa1e2('0x11')]===0x1f4){logger[_0xa1e2('0x10')]('FaxApplication,\x20%s,\x20%s',_0x116637,_0x316f1b[_0xa1e2('0x10')][_0xa1e2('0x12')]);return _0xf4f079(_0x316f1b[_0xa1e2('0x10')][_0xa1e2('0x12')]);}logger[_0xa1e2('0x10')](_0xa1e2('0xb'),_0x116637,_0x316f1b[_0xa1e2('0x10')][_0xa1e2('0x12')]);return _0x5f252a(_0x316f1b[_0xa1e2('0x10')][_0xa1e2('0x12')]);}else{logger[_0xa1e2('0xa')]('FaxApplication,\x20%s,\x20%s',_0x116637,_0xa1e2('0xc'));_0x5f252a(_0x316f1b['result'][_0xa1e2('0x12')]);}})['catch'](function(_0x45d800){logger[_0xa1e2('0x10')](_0xa1e2('0xb'),_0x116637,_0x45d800);_0xf4f079(_0x45d800);});});}exports[_0xa1e2('0x13')]=function(_0x5b4cb0){var _0x40e3c3=this;return new Promise(function(_0x415cb2,_0x4a8b93){return db['FaxApplication'][_0xa1e2('0x14')](_0x5b4cb0['body'],{'raw':_0x5b4cb0[_0xa1e2('0x15')]?_0x5b4cb0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b4cb0[_0xa1e2('0x15')]?_0x5b4cb0[_0xa1e2('0x15')][_0xa1e2('0x16')]||null:null,'attributes':_0x5b4cb0[_0xa1e2('0x15')]?_0x5b4cb0[_0xa1e2('0x15')][_0xa1e2('0x17')]||null:null,'limit':_0x5b4cb0[_0xa1e2('0x15')]?_0x5b4cb0[_0xa1e2('0x15')][_0xa1e2('0x18')]||null:null})[_0xa1e2('0x19')](function(_0x4c2b32){logger[_0xa1e2('0xa')](_0xa1e2('0x13'),_0x5b4cb0);logger[_0xa1e2('0xd')]('UpdateFaxApplication',_0x5b4cb0,JSON[_0xa1e2('0xf')](_0x4c2b32));_0x415cb2(_0x4c2b32);})[_0xa1e2('0x1a')](function(_0x55ad3e){logger[_0xa1e2('0x10')](_0xa1e2('0x13'),_0x55ad3e[_0xa1e2('0x12')],_0x5b4cb0);_0x4a8b93(_0x40e3c3['error'](0x1f4,_0x55ad3e[_0xa1e2('0x12')]));});});}; \ No newline at end of file +var _0xbb50=['randomstring','../../config/utils','../../config/logger','../../config/environment','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','FaxApplication','update','body','options','raw','attributes','debug','UpdateFaxApplication','lodash','util','moment','bluebird'];(function(_0x1d7218,_0x34cc1a){var _0x253cd7=function(_0x3421fa){while(--_0x3421fa){_0x1d7218['push'](_0x1d7218['shift']());}};_0x253cd7(++_0x34cc1a);}(_0xbb50,0x1d8));var _0x0bb5=function(_0x202438,_0x21f696){_0x202438=_0x202438-0x0;var _0x43a7f1=_0xbb50[_0x202438];return _0x43a7f1;};'use strict';var _=require(_0x0bb5('0x0'));var util=require(_0x0bb5('0x1'));var moment=require(_0x0bb5('0x2'));var BPromise=require(_0x0bb5('0x3'));var rs=require(_0x0bb5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0bb5('0x5'));var logger=require(_0x0bb5('0x6'))('rpc');var config=require(_0x0bb5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0bb5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x392049,_0x13aa5b,_0x2dfac9){return new BPromise(function(_0xbf56,_0x294d70){return client[_0x0bb5('0x9')](_0x392049,_0x2dfac9)[_0x0bb5('0xa')](function(_0x421fdf){logger['info'](_0x0bb5('0xb'),_0x13aa5b,_0x0bb5('0xc'));logger['debug'](_0x0bb5('0xd'),_0x13aa5b,_0x0bb5('0xc'),JSON[_0x0bb5('0xe')](_0x421fdf));if(_0x421fdf[_0x0bb5('0xf')]){if(_0x421fdf['error'][_0x0bb5('0x10')]===0x1f4){logger[_0x0bb5('0xf')](_0x0bb5('0xb'),_0x13aa5b,_0x421fdf['error'][_0x0bb5('0x11')]);return _0x294d70(_0x421fdf['error'][_0x0bb5('0x11')]);}logger['error'](_0x0bb5('0xb'),_0x13aa5b,_0x421fdf[_0x0bb5('0xf')][_0x0bb5('0x11')]);return _0xbf56(_0x421fdf[_0x0bb5('0xf')][_0x0bb5('0x11')]);}else{logger[_0x0bb5('0x12')](_0x0bb5('0xb'),_0x13aa5b,'request\x20sent');_0xbf56(_0x421fdf['result']['message']);}})[_0x0bb5('0x13')](function(_0x32335a){logger['error'](_0x0bb5('0xb'),_0x13aa5b,_0x32335a);_0x294d70(_0x32335a);});});}exports['UpdateFaxApplication']=function(_0x2bd3b6){var _0x39dc04=this;return new Promise(function(_0x5bf090,_0xf14657){return db[_0x0bb5('0x14')][_0x0bb5('0x15')](_0x2bd3b6[_0x0bb5('0x16')],{'raw':_0x2bd3b6[_0x0bb5('0x17')]?_0x2bd3b6['options'][_0x0bb5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bd3b6[_0x0bb5('0x17')]?_0x2bd3b6[_0x0bb5('0x17')]['where']||null:null,'attributes':_0x2bd3b6[_0x0bb5('0x17')]?_0x2bd3b6['options'][_0x0bb5('0x19')]||null:null,'limit':_0x2bd3b6[_0x0bb5('0x17')]?_0x2bd3b6[_0x0bb5('0x17')]['limit']||null:null})[_0x0bb5('0xa')](function(_0x1dc366){logger[_0x0bb5('0x12')]('UpdateFaxApplication',_0x2bd3b6);logger[_0x0bb5('0x1a')]('UpdateFaxApplication',_0x2bd3b6,JSON[_0x0bb5('0xe')](_0x1dc366));_0x5bf090(_0x1dc366);})[_0x0bb5('0x13')](function(_0x282322){logger[_0x0bb5('0xf')](_0x0bb5('0x1b'),_0x282322[_0x0bb5('0x11')],_0x2bd3b6);_0xf14657(_0x39dc04[_0x0bb5('0xf')](0x1f4,_0x282322['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index ed73f2c..42ae4cf 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 _0x7708=['multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','delete','destroy'];(function(_0x4bd122,_0x143bb6){var _0x33cace=function(_0x39da7f){while(--_0x39da7f){_0x4bd122['push'](_0x4bd122['shift']());}};_0x33cace(++_0x143bb6);}(_0x7708,0x188));var _0x8770=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0x7708[_0x1b8f5a];return _0x594189;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./faxApplication.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0xa')]('/',auth[_0x8770('0x8')](),controller['create']);router[_0x8770('0xb')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller['update']);router[_0x8770('0xc')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0xd')]);module['exports']=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','./faxApplication.controller','get'];(function(_0x7c9f16,_0x1a5b08){var _0x5a9326=function(_0x2144b3){while(--_0x2144b3){_0x7c9f16['push'](_0x7c9f16['shift']());}};_0x5a9326(++_0x1a5b08);}(_0xda2d,0x102));var _0xdda2=function(_0x4173e4,_0x4ce665){_0x4173e4=_0x4173e4-0x0;var _0x108194=_0xda2d[_0x4173e4];return _0x108194;};'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/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index e64c40c..13f380f 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 _0xaa22=['out','ENUM','BOOLEAN','STRING','DATE'];(function(_0x194e17,_0x547543){var _0x2874f2=function(_0x491e43){while(--_0x491e43){_0x194e17['push'](_0x194e17['shift']());}};_0x2874f2(++_0x547543);}(_0xaa22,0x1dd));var _0x2aa2=function(_0x106575,_0x2481d1){_0x106575=_0x106575-0x0;var _0x45df62=_0xaa22[_0x106575];return _0x45df62;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x2aa2('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2aa2('0x1')]},'secondDisposition':{'type':Sequelize[_0x2aa2('0x1')]},'thirdDisposition':{'type':Sequelize[_0x2aa2('0x1')]},'note':{'type':Sequelize[_0x2aa2('0x1')]},'read1stAt':{'type':Sequelize[_0x2aa2('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x2aa2('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2aa2('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x2aa2('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x4edf=['STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x3e961c,_0x5747e7){var _0x474f9c=function(_0x33f8ea){while(--_0x33f8ea){_0x3e961c['push'](_0x3e961c['shift']());}};_0x474f9c(++_0x5747e7);}(_0x4edf,0x6a));var _0xf4ed=function(_0x1ba43c,_0x5bd2e8){_0x1ba43c=_0x1ba43c-0x0;var _0x2f60eb=_0x4edf[_0x1ba43c];return _0x2f60eb;};'use strict';var Sequelize=require(_0xf4ed('0x0'));module[_0xf4ed('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf4ed('0x2')]},'secondDisposition':{'type':Sequelize[_0xf4ed('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf4ed('0x3')]},'fax':{'type':Sequelize[_0xf4ed('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf4ed('0x4')]('in',_0xf4ed('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf4ed('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf4ed('0x4')]('in',_0xf4ed('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index fc8ef1a..bb59d86 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 _0x2d58=['where','pick','FaxInteractionId','filter','$gte','format','include','rows','addTags','setTags','spread','Tag','emit','faxInteractionTags:save','download','unix','toString','join','server','files','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','util','path','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','error','stack','name','index','map','FaxInteraction','rawAttributes','type','key','getOptions','findAll','fax','user','catch','params','query','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','destroy','describe','addMessage','omit','ids','getMessages','model','keys','FaxMessage','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3c84ad,_0x2601d9){var _0x3b1154=function(_0x2ffe43){while(--_0x2ffe43){_0x3c84ad['push'](_0x3c84ad['shift']());}};_0x3b1154(++_0x2601d9);}(_0x2d58,0x1af));var _0x82d5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2d58[_0x122ef9];return _0x42fba0;};'use strict';var rimraf=require(_0x82d5('0x0'));var zipdir=require(_0x82d5('0x1'));var moment=require(_0x82d5('0x2'));var BPromise=require('bluebird');var util=require(_0x82d5('0x3'));var path=require(_0x82d5('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x82d5('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x82d5('0x6'));var db=require(_0x82d5('0x7'))['db'];config[_0x82d5('0x8')]=_[_0x82d5('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x82d5('0xa'))(new Redis(config[_0x82d5('0x8')]));require(_0x82d5('0xb'))[_0x82d5('0xc')](socket);function respondWithStatusCode(_0x17027b,_0x2a73b1){_0x2a73b1=_0x2a73b1||0xcc;return function(_0x682bc1){if(_0x682bc1){return _0x17027b[_0x82d5('0xd')](_0x2a73b1);}return _0x17027b[_0x82d5('0xe')](_0x2a73b1)[_0x82d5('0xf')]();};}function respondWithResult(_0x30765d,_0x47faba){_0x47faba=_0x47faba||0xc8;return function(_0x1a7a7e){if(_0x1a7a7e){return _0x30765d[_0x82d5('0xe')](_0x47faba)[_0x82d5('0x10')](_0x1a7a7e);}};}function respondWithFilteredResult(_0x84584a,_0x1b5d27){return function(_0x22210b){if(_0x22210b){var _0x3c8f6f=typeof _0x1b5d27[_0x82d5('0x11')]===_0x82d5('0x12')&&typeof _0x1b5d27['limit']==='undefined';var _0x502902=_0x22210b[_0x82d5('0x13')];var _0x3edc89=_0x3c8f6f?0x0:_0x1b5d27[_0x82d5('0x11')];var _0x55e63a=_0x3c8f6f?_0x22210b[_0x82d5('0x13')]:_0x1b5d27[_0x82d5('0x11')]+_0x1b5d27[_0x82d5('0x14')];var _0xb9b3ff;if(_0x55e63a>=_0x502902){_0x55e63a=_0x502902;_0xb9b3ff=0xc8;}else{_0xb9b3ff=0xce;}_0x84584a[_0x82d5('0xe')](_0xb9b3ff);return _0x84584a['set'](_0x82d5('0x15'),_0x3edc89+'-'+_0x55e63a+'/'+_0x502902)['json'](_0x22210b);}return null;};}function saveUpdates(_0x5d8785){return function(_0x5b7fc9){if(_0x5b7fc9){return _0x5b7fc9[_0x82d5('0x16')](_0x5d8785)[_0x82d5('0x17')](function(_0x1d09a9){return _0x1d09a9;});}return null;};}function removeEntity(_0x44da72){return function(_0x3b0192){if(_0x3b0192){return _0x3b0192['destroy']()['then'](function(){_0x44da72[_0x82d5('0xe')](0xcc)[_0x82d5('0xf')]();});}};}function handleEntityNotFound(_0x56fd6c){return function(_0x6f90c3){if(!_0x6f90c3){_0x56fd6c[_0x82d5('0xd')](0x194);}return _0x6f90c3;};}function handleError(_0x1817e0,_0x1fcfb8){_0x1fcfb8=_0x1fcfb8||0x1f4;return function(_0x235f68){logger[_0x82d5('0x18')](_0x235f68[_0x82d5('0x19')]);if(_0x235f68[_0x82d5('0x1a')]){delete _0x235f68[_0x82d5('0x1a')];}_0x1817e0[_0x82d5('0xe')](_0x1fcfb8)['send'](_0x235f68);};}exports[_0x82d5('0x1b')]=function(_0x2aab49,_0x564afa){var _0x329a48={};var _0x2ccb08=_[_0x82d5('0x1c')](db[_0x82d5('0x1d')][_0x82d5('0x1e')],function(_0x14311f){return{'name':_0x14311f['fieldName'],'type':_0x14311f[_0x82d5('0x1f')][_0x82d5('0x20')]};});_0x329a48=qs[_0x82d5('0x21')](_0x2ccb08,_0x2aab49);return interaction[_0x82d5('0x22')](_0x82d5('0x23'),_0x2aab49['query'],_0x2aab49[_0x82d5('0x24')],_0x329a48,_0x2ccb08)[_0x82d5('0x17')](respondWithFilteredResult(_0x564afa,_0x329a48))[_0x82d5('0x25')](handleError(_0x564afa,null));};exports['show']=function(_0x3c6364,_0x54e471){var _0x7b4175={'raw':![],'where':{'id':_0x3c6364[_0x82d5('0x26')]['id']}},_0xdba111={};_0xdba111['model']=_['keys'](db[_0x82d5('0x1d')]['rawAttributes']);_0xdba111[_0x82d5('0x27')]=_['keys'](_0x3c6364[_0x82d5('0x27')]);_0xdba111[_0x82d5('0x28')]=_[_0x82d5('0x29')](_0xdba111['model'],_0xdba111[_0x82d5('0x27')]);_0x7b4175[_0x82d5('0x2a')]=_['intersection'](_0xdba111['model'],qs['fields'](_0x3c6364['query'][_0x82d5('0x2b')]));_0x7b4175[_0x82d5('0x2a')]=_0x7b4175['attributes']['length']?_0x7b4175[_0x82d5('0x2a')]:_0xdba111['model'];if(_0x3c6364[_0x82d5('0x27')][_0x82d5('0x2c')]){_0x7b4175['include']=[{'all':!![]}];}_0x7b4175=_[_0x82d5('0x2d')]({},_0x7b4175,_0x3c6364[_0x82d5('0x2e')]);return db[_0x82d5('0x1d')][_0x82d5('0x2f')](_0x7b4175)[_0x82d5('0x17')](handleEntityNotFound(_0x54e471,null))[_0x82d5('0x17')](respondWithResult(_0x54e471,null))['catch'](handleError(_0x54e471,null));};exports[_0x82d5('0x30')]=function(_0x159800,_0x1890ba){return db[_0x82d5('0x1d')]['create'](_0x159800['body'],{})[_0x82d5('0x17')](respondWithResult(_0x1890ba,0xc9))[_0x82d5('0x25')](handleError(_0x1890ba,null));};exports['update']=function(_0x70add5,_0xafe947){if(_0x70add5[_0x82d5('0x31')]['id']){delete _0x70add5[_0x82d5('0x31')]['id'];}return db['FaxInteraction'][_0x82d5('0x2f')]({'where':{'id':_0x70add5[_0x82d5('0x26')]['id']}})[_0x82d5('0x17')](handleEntityNotFound(_0xafe947,null))['then'](saveUpdates(_0x70add5[_0x82d5('0x31')],null))['then'](respondWithResult(_0xafe947,null))[_0x82d5('0x25')](handleError(_0xafe947,null));};exports[_0x82d5('0x32')]=function(_0x57f0c7,_0x3497ee){return db[_0x82d5('0x1d')][_0x82d5('0x2f')]({'where':{'id':_0x57f0c7[_0x82d5('0x26')]['id']}})[_0x82d5('0x17')](handleEntityNotFound(_0x3497ee,null))[_0x82d5('0x17')](removeEntity(_0x3497ee,null))[_0x82d5('0x25')](handleError(_0x3497ee,null));};exports[_0x82d5('0x33')]=function(_0x239cf7,_0x10e98a){return db[_0x82d5('0x1d')]['describe']()[_0x82d5('0x17')](respondWithResult(_0x10e98a,null))[_0x82d5('0x25')](handleError(_0x10e98a,null));};exports[_0x82d5('0x34')]=function(_0x17def2,_0x2a0d9b){return db['FaxMessage'][_0x82d5('0x2f')]({'where':{'id':_0x17def2[_0x82d5('0x26')]['id']}})['then'](handleEntityNotFound(_0x2a0d9b,null))[_0x82d5('0x17')](function(_0x23f786){if(_0x23f786){return _0x23f786[_0x82d5('0x34')](_0x17def2[_0x82d5('0x31')]['ids'],_[_0x82d5('0x35')](_0x17def2[_0x82d5('0x31')],[_0x82d5('0x36'),'id'])||{});}})['then'](respondWithResult(_0x2a0d9b,null))['catch'](handleError(_0x2a0d9b,null));};exports[_0x82d5('0x37')]=function(_0x4913f5,_0x58f6a7){var _0x1d4f93={'raw':![],'where':{}};var _0x1bf816={};var _0x377b50={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x4913f5[_0x82d5('0x26')]['id']}})['then'](handleEntityNotFound(_0x58f6a7,null))[_0x82d5('0x17')](function(_0x2d700c){if(_0x2d700c){_0x1bf816[_0x82d5('0x38')]=_[_0x82d5('0x39')](db[_0x82d5('0x3a')][_0x82d5('0x1e')]);_0x1bf816[_0x82d5('0x27')]=_['keys'](_0x4913f5[_0x82d5('0x27')]);_0x1bf816[_0x82d5('0x28')]=_['intersection'](_0x1bf816[_0x82d5('0x38')],_0x1bf816[_0x82d5('0x27')]);_0x1d4f93['attributes']=_[_0x82d5('0x29')](_0x1bf816[_0x82d5('0x38')],qs[_0x82d5('0x2b')](_0x4913f5[_0x82d5('0x27')][_0x82d5('0x2b')]));_0x1d4f93[_0x82d5('0x2a')]=_0x1d4f93[_0x82d5('0x2a')][_0x82d5('0x3b')]?_0x1d4f93[_0x82d5('0x2a')]:_0x1bf816[_0x82d5('0x38')];if(!_0x4913f5[_0x82d5('0x27')][_0x82d5('0x3c')](_0x82d5('0x3d'))){_0x1d4f93[_0x82d5('0x14')]=qs[_0x82d5('0x14')](_0x4913f5[_0x82d5('0x27')][_0x82d5('0x14')]);_0x1d4f93['offset']=qs[_0x82d5('0x11')](_0x4913f5['query']['offset']);}_0x1d4f93[_0x82d5('0x3e')]=qs[_0x82d5('0x3f')](_0x4913f5[_0x82d5('0x27')][_0x82d5('0x3f')]);_0x1d4f93[_0x82d5('0x40')]=qs['filters'](_[_0x82d5('0x41')](_0x4913f5[_0x82d5('0x27')],_0x1bf816[_0x82d5('0x28')]));_0x1d4f93['where'][_0x82d5('0x42')]=_0x2d700c['id'];if(_0x4913f5['query']['filter']){_0x1d4f93['where']=_[_0x82d5('0x2d')](_0x1d4f93[_0x82d5('0x40')],{'$or':_[_0x82d5('0x1c')](_0x1d4f93[_0x82d5('0x2a')],function(_0x2e7441){var _0x3a831b={};_0x3a831b[_0x2e7441]={'$like':'%'+_0x4913f5[_0x82d5('0x27')][_0x82d5('0x43')]+'%'};return _0x3a831b;})});}if(_0x4913f5[_0x82d5('0x27')][_0x82d5('0x44')]){var _0x723309=_0x4913f5[_0x82d5('0x27')][_0x82d5('0x44')]['split'](',');var _0x1c6ae0={};_0x1c6ae0[_0x723309[0x0]]={'$gte':moment(_0x723309[0x1])[_0x82d5('0x45')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1d4f93[_0x82d5('0x40')]=_['merge'](_0x1d4f93[_0x82d5('0x40')],_0x1c6ae0);}_0x1d4f93=_['merge']({},_0x1d4f93,_0x4913f5['options']);return db[_0x82d5('0x3a')][_0x82d5('0x13')]({'where':_0x1d4f93[_0x82d5('0x40')]})['then'](function(_0x25de0e){_0x377b50[_0x82d5('0x13')]=_0x25de0e;if(_0x4913f5['query'][_0x82d5('0x2c')]){_0x1d4f93[_0x82d5('0x46')]=[{'all':!![]}];}return db[_0x82d5('0x3a')]['findAll'](_0x1d4f93);})[_0x82d5('0x17')](function(_0x58a610){_0x377b50[_0x82d5('0x47')]=_0x58a610;return _0x377b50;});}})[_0x82d5('0x17')](respondWithFilteredResult(_0x58f6a7,_0x1d4f93))[_0x82d5('0x25')](handleError(_0x58f6a7,null));};exports[_0x82d5('0x48')]=function(_0x4e4b90,_0x5bec01){return db[_0x82d5('0x1d')][_0x82d5('0x2f')]({'where':{'id':_0x4e4b90[_0x82d5('0x26')]['id']}})[_0x82d5('0x17')](handleEntityNotFound(_0x5bec01,null))[_0x82d5('0x17')](function(_0x95418f){if(_0x95418f){return _0x95418f[_0x82d5('0x49')](_0x4e4b90['body']['ids'],_[_0x82d5('0x35')](_0x4e4b90[_0x82d5('0x31')],[_0x82d5('0x36'),'id'])||{})[_0x82d5('0x4a')](function(){return db[_0x82d5('0x4b')][_0x82d5('0x22')]({'attributes':['id','name','color'],'where':{'id':_0x4e4b90[_0x82d5('0x31')]['ids']}});})[_0x82d5('0x17')](function(_0x2a357e){socket[_0x82d5('0x4c')](_0x82d5('0x4d'),{'id':Number(_0x4e4b90[_0x82d5('0x26')]['id']),'tags':_0x2a357e||[]});return{'id':Number(_0x4e4b90[_0x82d5('0x26')]['id']),'tags':_0x2a357e||[]};});}})['then'](respondWithResult(_0x5bec01,null))[_0x82d5('0x25')](handleError(_0x5bec01,null));};exports['removeTags']=function(_0x418f47,_0x2aba3e){return db[_0x82d5('0x1d')][_0x82d5('0x2f')]({'where':{'id':_0x418f47[_0x82d5('0x26')]['id']}})[_0x82d5('0x17')](handleEntityNotFound(_0x2aba3e,null))[_0x82d5('0x17')](function(_0x5a5484){if(_0x5a5484){return _0x5a5484['removeTags'](_0x418f47[_0x82d5('0x27')][_0x82d5('0x36')]);}})[_0x82d5('0x17')](respondWithStatusCode(_0x2aba3e,null))[_0x82d5('0x25')](handleError(_0x2aba3e,null));};exports[_0x82d5('0x4e')]=function(_0x2f128b,_0x37388d){var _0x36304f=moment()[_0x82d5('0x4f')]()[_0x82d5('0x50')]();var _0x48ae9c=path[_0x82d5('0x51')](config['root'],_0x82d5('0x52'),_0x82d5('0x53'),'tmp');var _0x591a70=path['join'](config['root'],_0x82d5('0x52'),_0x82d5('0x53'),_0x82d5('0x54'));var _0x201147=path[_0x82d5('0x51')](_0x48ae9c,_0x36304f);var _0x3c9331=util['format'](_0x82d5('0x55'),_0x2f128b[_0x82d5('0x26')]['id'],_0x36304f);var _0x5dfbe0=path[_0x82d5('0x51')](_0x48ae9c,_0x3c9331);var _0x46e8d4=[];_0x46e8d4[_0x82d5('0x56')]({'model':db['Attachment'],'as':_0x82d5('0x57'),'raw':!![]});var _0x4c1e37=[{'model':db[_0x82d5('0x3a')],'as':_0x82d5('0x58'),'attributes':['id',_0x82d5('0x31'),_0x82d5('0x59')],'include':_0x46e8d4}];return db[_0x82d5('0x1d')]['find']({'where':{'id':_0x2f128b[_0x82d5('0x26')]['id']},'include':_0x4c1e37})[_0x82d5('0x17')](handleEntityNotFound(_0x37388d,null))[_0x82d5('0x17')](function(_0x376a50){if(_0x376a50&&_0x376a50[_0x82d5('0x58')]){var _0x2c13a1=_0x376a50['get']({'plain':!![]});fs['mkdirSync'](_0x201147);for(var _0x11b292=0x0;_0x11b292<_0x2c13a1[_0x82d5('0x58')][_0x82d5('0x3b')];_0x11b292++){var _0x20ead7=_0x2c13a1[_0x82d5('0x58')][_0x11b292][_0x82d5('0x57')];if(_0x20ead7){var _0x47161d=path['join'](_0x591a70,_0x20ead7[_0x82d5('0x5a')]);if(fs[_0x82d5('0x5b')](_0x47161d)){fs[_0x82d5('0x5c')](_0x47161d)[_0x82d5('0x5d')](fs[_0x82d5('0x5e')](path[_0x82d5('0x51')](_0x201147,_0x20ead7[_0x82d5('0x5a')])));}}}return BPromise[_0x82d5('0x5f')]()[_0x82d5('0x17')](function(){return new BPromise(function(_0x5d64b3,_0x294268){zipdir(_0x201147,{'saveTo':_0x5dfbe0},function(_0x384ae6,_0x5c8b19){if(_0x384ae6)return _0x294268(_0x384ae6);return _0x5d64b3(_0x5c8b19);});})[_0x82d5('0x17')](function(){return new BPromise(function(_0x3ba6e9,_0x561af3){rimraf(_0x201147,function(_0x13e7c6){if(_0x13e7c6)_0x561af3(_0x13e7c6);return _0x3ba6e9();});});})[_0x82d5('0x17')](function(){return _0x37388d[_0x82d5('0x4e')](_0x5dfbe0,_0x3c9331,function(_0xc97565){if(_0xc97565){console[_0x82d5('0x60')](_0x82d5('0x61'),_0xc97565);}else{fs[_0x82d5('0x62')](_0x5dfbe0);}});});});}else{return _0x37388d[_0x82d5('0xd')](0xc8);}})['catch'](handleError(_0x37388d,null));}; \ No newline at end of file +var _0xd1b6=['destroy','then','error','name','send','index','map','FaxInteraction','type','key','getOptions','findAll','fax','query','user','catch','show','model','keys','rawAttributes','filters','intersection','fields','attributes','length','includeAll','include','options','create','body','find','params','describe','addMessage','ids','omit','findOne','FaxMessage','hasOwnProperty','nolimit','limit','order','sort','where','pick','FaxInteractionId','filter','merge','$gte','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','root','server','tmp','join','files','format','transcript-%d-%s.zip','push','Attachment','createdAt','Messages','get','mkdirSync','pipe','createWriteStream','basename','resolve','log','err','unlinkSync','zip-dir','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','update'];(function(_0x2d2b63,_0x277d0a){var _0x5d18f8=function(_0x4eca54){while(--_0x4eca54){_0x2d2b63['push'](_0x2d2b63['shift']());}};_0x5d18f8(++_0x277d0a);}(_0xd1b6,0x116));var _0x6d1b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1b6[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x6d1b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x6d1b('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x6d1b('0x2'));var Redis=require(_0x6d1b('0x3'));var interaction=require('../../components/interaction/service');var qs=require(_0x6d1b('0x4'));var logger=require(_0x6d1b('0x5'))('api');var config=require('../../config/environment');var db=require(_0x6d1b('0x6'))['db'];config[_0x6d1b('0x7')]=_['defaults'](config[_0x6d1b('0x7')],{'host':_0x6d1b('0x8'),'port':0x18eb});var socket=require(_0x6d1b('0x9'))(new Redis(config[_0x6d1b('0x7')]));require(_0x6d1b('0xa'))[_0x6d1b('0xb')](socket);function respondWithStatusCode(_0x5baff5,_0x4778a6){_0x4778a6=_0x4778a6||0xcc;return function(_0x5e7810){if(_0x5e7810){return _0x5baff5[_0x6d1b('0xc')](_0x4778a6);}return _0x5baff5['status'](_0x4778a6)[_0x6d1b('0xd')]();};}function respondWithResult(_0x153631,_0x315cf0){_0x315cf0=_0x315cf0||0xc8;return function(_0x52ff93){if(_0x52ff93){return _0x153631[_0x6d1b('0xe')](_0x315cf0)[_0x6d1b('0xf')](_0x52ff93);}};}function respondWithFilteredResult(_0x33312e,_0x1d4b37){return function(_0x2d6dff){if(_0x2d6dff){var _0x39d637=typeof _0x1d4b37[_0x6d1b('0x10')]===_0x6d1b('0x11')&&typeof _0x1d4b37['limit']==='undefined';var _0x1be32b=_0x2d6dff[_0x6d1b('0x12')];var _0x391426=_0x39d637?0x0:_0x1d4b37[_0x6d1b('0x10')];var _0x174796=_0x39d637?_0x2d6dff[_0x6d1b('0x12')]:_0x1d4b37[_0x6d1b('0x10')]+_0x1d4b37['limit'];var _0x2461d0;if(_0x174796>=_0x1be32b){_0x174796=_0x1be32b;_0x2461d0=0xc8;}else{_0x2461d0=0xce;}_0x33312e[_0x6d1b('0xe')](_0x2461d0);return _0x33312e[_0x6d1b('0x13')](_0x6d1b('0x14'),_0x391426+'-'+_0x174796+'/'+_0x1be32b)[_0x6d1b('0xf')](_0x2d6dff);}return null;};}function saveUpdates(_0x1fb09c){return function(_0x3c8df5){if(_0x3c8df5){return _0x3c8df5[_0x6d1b('0x15')](_0x1fb09c)['then'](function(_0x2012fb){return _0x2012fb;});}return null;};}function removeEntity(_0x452ca8){return function(_0xfd9fc8){if(_0xfd9fc8){return _0xfd9fc8[_0x6d1b('0x16')]()[_0x6d1b('0x17')](function(){_0x452ca8[_0x6d1b('0xe')](0xcc)[_0x6d1b('0xd')]();});}};}function handleEntityNotFound(_0x3a490c){return function(_0x1c51a8){if(!_0x1c51a8){_0x3a490c['sendStatus'](0x194);}return _0x1c51a8;};}function handleError(_0xff3a0f,_0x5755ab){_0x5755ab=_0x5755ab||0x1f4;return function(_0x1be793){logger[_0x6d1b('0x18')](_0x1be793['stack']);if(_0x1be793['name']){delete _0x1be793[_0x6d1b('0x19')];}_0xff3a0f['status'](_0x5755ab)[_0x6d1b('0x1a')](_0x1be793);};}exports[_0x6d1b('0x1b')]=function(_0x2bba09,_0x28cb08){var _0x14c335={};var _0x258c27=_[_0x6d1b('0x1c')](db[_0x6d1b('0x1d')]['rawAttributes'],function(_0x482bcf){return{'name':_0x482bcf['fieldName'],'type':_0x482bcf[_0x6d1b('0x1e')][_0x6d1b('0x1f')]};});_0x14c335=qs[_0x6d1b('0x20')](_0x258c27,_0x2bba09);return interaction[_0x6d1b('0x21')](_0x6d1b('0x22'),_0x2bba09[_0x6d1b('0x23')],_0x2bba09[_0x6d1b('0x24')],_0x14c335,_0x258c27)[_0x6d1b('0x17')](respondWithFilteredResult(_0x28cb08,_0x14c335))[_0x6d1b('0x25')](handleError(_0x28cb08,null));};exports[_0x6d1b('0x26')]=function(_0x2ae7cf,_0x5605af){var _0x5644db={'raw':![],'where':{'id':_0x2ae7cf['params']['id']}},_0x30fa84={};_0x30fa84[_0x6d1b('0x27')]=_[_0x6d1b('0x28')](db['FaxInteraction'][_0x6d1b('0x29')]);_0x30fa84[_0x6d1b('0x23')]=_['keys'](_0x2ae7cf[_0x6d1b('0x23')]);_0x30fa84[_0x6d1b('0x2a')]=_[_0x6d1b('0x2b')](_0x30fa84[_0x6d1b('0x27')],_0x30fa84[_0x6d1b('0x23')]);_0x5644db['attributes']=_[_0x6d1b('0x2b')](_0x30fa84[_0x6d1b('0x27')],qs[_0x6d1b('0x2c')](_0x2ae7cf['query'][_0x6d1b('0x2c')]));_0x5644db[_0x6d1b('0x2d')]=_0x5644db[_0x6d1b('0x2d')][_0x6d1b('0x2e')]?_0x5644db[_0x6d1b('0x2d')]:_0x30fa84[_0x6d1b('0x27')];if(_0x2ae7cf['query'][_0x6d1b('0x2f')]){_0x5644db[_0x6d1b('0x30')]=[{'all':!![]}];}_0x5644db=_['merge']({},_0x5644db,_0x2ae7cf[_0x6d1b('0x31')]);return db[_0x6d1b('0x1d')]['find'](_0x5644db)[_0x6d1b('0x17')](handleEntityNotFound(_0x5605af,null))[_0x6d1b('0x17')](respondWithResult(_0x5605af,null))[_0x6d1b('0x25')](handleError(_0x5605af,null));};exports['create']=function(_0x247693,_0x5b1691){return db[_0x6d1b('0x1d')][_0x6d1b('0x32')](_0x247693[_0x6d1b('0x33')],{})[_0x6d1b('0x17')](respondWithResult(_0x5b1691,0xc9))[_0x6d1b('0x25')](handleError(_0x5b1691,null));};exports[_0x6d1b('0x15')]=function(_0x4fd8a1,_0xa1fe04){if(_0x4fd8a1[_0x6d1b('0x33')]['id']){delete _0x4fd8a1[_0x6d1b('0x33')]['id'];}return db[_0x6d1b('0x1d')][_0x6d1b('0x34')]({'where':{'id':_0x4fd8a1[_0x6d1b('0x35')]['id']}})['then'](handleEntityNotFound(_0xa1fe04,null))['then'](saveUpdates(_0x4fd8a1['body'],null))[_0x6d1b('0x17')](respondWithResult(_0xa1fe04,null))[_0x6d1b('0x25')](handleError(_0xa1fe04,null));};exports[_0x6d1b('0x16')]=function(_0x2b56ae,_0x33e158){return db[_0x6d1b('0x1d')][_0x6d1b('0x34')]({'where':{'id':_0x2b56ae['params']['id']}})[_0x6d1b('0x17')](handleEntityNotFound(_0x33e158,null))[_0x6d1b('0x17')](removeEntity(_0x33e158,null))[_0x6d1b('0x25')](handleError(_0x33e158,null));};exports[_0x6d1b('0x36')]=function(_0x40e3fe,_0x2129aa){return db['FaxInteraction'][_0x6d1b('0x36')]()[_0x6d1b('0x17')](respondWithResult(_0x2129aa,null))[_0x6d1b('0x25')](handleError(_0x2129aa,null));};exports['addMessage']=function(_0x213209,_0x62101b){return db['FaxMessage'][_0x6d1b('0x34')]({'where':{'id':_0x213209[_0x6d1b('0x35')]['id']}})[_0x6d1b('0x17')](handleEntityNotFound(_0x62101b,null))[_0x6d1b('0x17')](function(_0x42e5fc){if(_0x42e5fc){return _0x42e5fc[_0x6d1b('0x37')](_0x213209[_0x6d1b('0x33')][_0x6d1b('0x38')],_[_0x6d1b('0x39')](_0x213209['body'],[_0x6d1b('0x38'),'id'])||{});}})[_0x6d1b('0x17')](respondWithResult(_0x62101b,null))[_0x6d1b('0x25')](handleError(_0x62101b,null));};exports['getMessages']=function(_0x51330e,_0x4d5fa8){var _0x1cd983={'raw':![],'where':{}};var _0x4624a0={};var _0x4eefa5={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x6d1b('0x3a')]({'where':{'id':_0x51330e[_0x6d1b('0x35')]['id']}})[_0x6d1b('0x17')](handleEntityNotFound(_0x4d5fa8,null))[_0x6d1b('0x17')](function(_0x2ad7a8){if(_0x2ad7a8){_0x4624a0[_0x6d1b('0x27')]=_[_0x6d1b('0x28')](db[_0x6d1b('0x3b')][_0x6d1b('0x29')]);_0x4624a0['query']=_[_0x6d1b('0x28')](_0x51330e[_0x6d1b('0x23')]);_0x4624a0[_0x6d1b('0x2a')]=_[_0x6d1b('0x2b')](_0x4624a0[_0x6d1b('0x27')],_0x4624a0[_0x6d1b('0x23')]);_0x1cd983['attributes']=_[_0x6d1b('0x2b')](_0x4624a0[_0x6d1b('0x27')],qs[_0x6d1b('0x2c')](_0x51330e[_0x6d1b('0x23')][_0x6d1b('0x2c')]));_0x1cd983[_0x6d1b('0x2d')]=_0x1cd983[_0x6d1b('0x2d')][_0x6d1b('0x2e')]?_0x1cd983[_0x6d1b('0x2d')]:_0x4624a0[_0x6d1b('0x27')];if(!_0x51330e[_0x6d1b('0x23')][_0x6d1b('0x3c')](_0x6d1b('0x3d'))){_0x1cd983[_0x6d1b('0x3e')]=qs[_0x6d1b('0x3e')](_0x51330e['query'][_0x6d1b('0x3e')]);_0x1cd983[_0x6d1b('0x10')]=qs[_0x6d1b('0x10')](_0x51330e[_0x6d1b('0x23')][_0x6d1b('0x10')]);}_0x1cd983[_0x6d1b('0x3f')]=qs[_0x6d1b('0x40')](_0x51330e[_0x6d1b('0x23')][_0x6d1b('0x40')]);_0x1cd983[_0x6d1b('0x41')]=qs[_0x6d1b('0x2a')](_[_0x6d1b('0x42')](_0x51330e[_0x6d1b('0x23')],_0x4624a0[_0x6d1b('0x2a')]));_0x1cd983[_0x6d1b('0x41')][_0x6d1b('0x43')]=_0x2ad7a8['id'];if(_0x51330e[_0x6d1b('0x23')][_0x6d1b('0x44')]){_0x1cd983[_0x6d1b('0x41')]=_[_0x6d1b('0x45')](_0x1cd983['where'],{'$or':_['map'](_0x1cd983['attributes'],function(_0x3e91cd){var _0x1b98f7={};_0x1b98f7[_0x3e91cd]={'$like':'%'+_0x51330e[_0x6d1b('0x23')][_0x6d1b('0x44')]+'%'};return _0x1b98f7;})});}if(_0x51330e[_0x6d1b('0x23')][_0x6d1b('0x46')]){var _0x228012=_0x51330e[_0x6d1b('0x23')][_0x6d1b('0x46')]['split'](',');var _0x4a5c2d={};_0x4a5c2d[_0x228012[0x0]]={'$gte':moment(_0x228012[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1cd983[_0x6d1b('0x41')]=_[_0x6d1b('0x45')](_0x1cd983[_0x6d1b('0x41')],_0x4a5c2d);}_0x1cd983=_[_0x6d1b('0x45')]({},_0x1cd983,_0x51330e[_0x6d1b('0x31')]);return db[_0x6d1b('0x3b')][_0x6d1b('0x12')]({'where':_0x1cd983[_0x6d1b('0x41')]})['then'](function(_0x201665){_0x4eefa5['count']=_0x201665;if(_0x51330e[_0x6d1b('0x23')]['includeAll']){_0x1cd983[_0x6d1b('0x30')]=[{'all':!![]}];}return db[_0x6d1b('0x3b')][_0x6d1b('0x21')](_0x1cd983);})[_0x6d1b('0x17')](function(_0xce6707){_0x4eefa5['rows']=_0xce6707;return _0x4eefa5;});}})[_0x6d1b('0x17')](respondWithFilteredResult(_0x4d5fa8,_0x1cd983))[_0x6d1b('0x25')](handleError(_0x4d5fa8,null));};exports['addTags']=function(_0x28b559,_0x566427){return db['FaxInteraction'][_0x6d1b('0x34')]({'where':{'id':_0x28b559[_0x6d1b('0x35')]['id']}})['then'](handleEntityNotFound(_0x566427,null))[_0x6d1b('0x17')](function(_0x3f1cb7){if(_0x3f1cb7){return _0x3f1cb7[_0x6d1b('0x47')](_0x28b559['body'][_0x6d1b('0x38')],_[_0x6d1b('0x39')](_0x28b559[_0x6d1b('0x33')],[_0x6d1b('0x38'),'id'])||{})[_0x6d1b('0x48')](function(){return db['Tag'][_0x6d1b('0x21')]({'attributes':['id','name',_0x6d1b('0x49')],'where':{'id':_0x28b559[_0x6d1b('0x33')][_0x6d1b('0x38')]}});})['then'](function(_0x5adef9){socket[_0x6d1b('0x4a')](_0x6d1b('0x4b'),{'id':Number(_0x28b559[_0x6d1b('0x35')]['id']),'tags':_0x5adef9||[]});return{'id':Number(_0x28b559[_0x6d1b('0x35')]['id']),'tags':_0x5adef9||[]};});}})['then'](respondWithResult(_0x566427,null))['catch'](handleError(_0x566427,null));};exports[_0x6d1b('0x4c')]=function(_0xcb815e,_0x20d84a){return db[_0x6d1b('0x1d')]['find']({'where':{'id':_0xcb815e[_0x6d1b('0x35')]['id']}})[_0x6d1b('0x17')](handleEntityNotFound(_0x20d84a,null))['then'](function(_0x506946){if(_0x506946){return _0x506946['removeTags'](_0xcb815e['query'][_0x6d1b('0x38')]);}})['then'](respondWithStatusCode(_0x20d84a,null))[_0x6d1b('0x25')](handleError(_0x20d84a,null));};exports[_0x6d1b('0x4d')]=function(_0x1670b7,_0x266928){var _0x106ae7=moment()[_0x6d1b('0x4e')]()[_0x6d1b('0x4f')]();var _0x3b4992=path['join'](config[_0x6d1b('0x50')],_0x6d1b('0x51'),'files',_0x6d1b('0x52'));var _0x3d9e18=path[_0x6d1b('0x53')](config[_0x6d1b('0x50')],_0x6d1b('0x51'),_0x6d1b('0x54'),'attachments');var _0x4f60c0=path[_0x6d1b('0x53')](_0x3b4992,_0x106ae7);var _0x493bf7=util[_0x6d1b('0x55')](_0x6d1b('0x56'),_0x1670b7[_0x6d1b('0x35')]['id'],_0x106ae7);var _0x2b7b80=path[_0x6d1b('0x53')](_0x3b4992,_0x493bf7);var _0x937c21=[];_0x937c21[_0x6d1b('0x57')]({'model':db[_0x6d1b('0x58')],'as':'Attachment','raw':!![]});var _0x1a425a=[{'model':db[_0x6d1b('0x3b')],'as':'Messages','attributes':['id',_0x6d1b('0x33'),_0x6d1b('0x59')],'include':_0x937c21}];return db[_0x6d1b('0x1d')][_0x6d1b('0x34')]({'where':{'id':_0x1670b7[_0x6d1b('0x35')]['id']},'include':_0x1a425a})[_0x6d1b('0x17')](handleEntityNotFound(_0x266928,null))[_0x6d1b('0x17')](function(_0x58e62c){if(_0x58e62c&&_0x58e62c[_0x6d1b('0x5a')]){var _0x59b26d=_0x58e62c[_0x6d1b('0x5b')]({'plain':!![]});fs[_0x6d1b('0x5c')](_0x4f60c0);for(var _0x224d00=0x0;_0x224d00<_0x59b26d[_0x6d1b('0x5a')][_0x6d1b('0x2e')];_0x224d00++){var _0x337f88=_0x59b26d[_0x6d1b('0x5a')][_0x224d00][_0x6d1b('0x58')];if(_0x337f88){var _0x129ee4=path[_0x6d1b('0x53')](_0x3d9e18,_0x337f88['basename']);if(fs['existsSync'](_0x129ee4)){fs['createReadStream'](_0x129ee4)[_0x6d1b('0x5d')](fs[_0x6d1b('0x5e')](path[_0x6d1b('0x53')](_0x4f60c0,_0x337f88[_0x6d1b('0x5f')])));}}}return BPromise[_0x6d1b('0x60')]()[_0x6d1b('0x17')](function(){return new BPromise(function(_0x3495ad,_0x1e71af){zipdir(_0x4f60c0,{'saveTo':_0x2b7b80},function(_0x15fc6f,_0x29ab2e){if(_0x15fc6f)return _0x1e71af(_0x15fc6f);return _0x3495ad(_0x29ab2e);});})[_0x6d1b('0x17')](function(){return new BPromise(function(_0x3f2a07,_0x1181cc){rimraf(_0x4f60c0,function(_0x48d9a7){if(_0x48d9a7)_0x1181cc(_0x48d9a7);return _0x3f2a07();});});})['then'](function(){return _0x266928['download'](_0x2b7b80,_0x493bf7,function(_0x11b289){if(_0x11b289){console[_0x6d1b('0x61')](_0x6d1b('0x62'),_0x11b289);}else{fs[_0x6d1b('0x63')](_0x2b7b80);}});});});}else{return _0x266928[_0x6d1b('0xc')](0xc8);}})[_0x6d1b('0x25')](handleError(_0x266928,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 547cc92..94d057e 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 _0x9534=['remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update'];(function(_0x501a9a,_0x20922f){var _0x13da0b=function(_0x2d531e){while(--_0x2d531e){_0x501a9a['push'](_0x501a9a['shift']());}};_0x13da0b(++_0x20922f);}(_0x9534,0xc5));var _0x4953=function(_0x22d309,_0x31bf3f){_0x22d309=_0x22d309-0x0;var _0x5ef5f8=_0x9534[_0x22d309];return _0x5ef5f8;};'use strict';var EventEmitter=require(_0x4953('0x0'));var FaxInteraction=require(_0x4953('0x1'))['db'][_0x4953('0x2')];var FaxMessage=require(_0x4953('0x1'))['db'][_0x4953('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4953('0x4')](0x0);var events={'afterCreate':_0x4953('0x5'),'afterUpdate':_0x4953('0x6'),'afterDestroy':_0x4953('0x7')};function emitEvent(_0x278cf8){return function(_0x34b9af,_0xc2016e,_0x4abc93){_0x34b9af['getUsers']({'attributes':['id'],'raw':!![]})[_0x4953('0x8')](function(_0xbbb632){_0x34b9af[_0x4953('0x9')]('Users',_0xbbb632[_0x4953('0xa')](function(_0x1c88ed){return{'id':_0x1c88ed['id']};}));return FaxMessage[_0x4953('0xb')]({'where':{'FaxInteractionId':_0x34b9af['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4953('0x8')](function(_0x58f447){_0x34b9af[_0x4953('0x9')](_0x4953('0xc'),_0x58f447[_0x4953('0xd')]);FaxInteractionEvents[_0x4953('0xe')](_0x278cf8+':'+_0x34b9af['id'],_0x34b9af);FaxInteractionEvents[_0x4953('0xe')](_0x278cf8,_0x34b9af);_0x4abc93(null);})[_0x4953('0xf')](_0x4abc93(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x4953('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x7064=['hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x559aab,_0x4b7dc4){var _0x5e5801=function(_0xb3a24f){while(--_0xb3a24f){_0x559aab['push'](_0x559aab['shift']());}};_0x5e5801(++_0x4b7dc4);}(_0x7064,0x132));var _0x4706=function(_0xb5db87,_0x5aec10){_0xb5db87=_0xb5db87-0x0;var _0x541bd2=_0x7064[_0xb5db87];return _0x541bd2;};'use strict';var EventEmitter=require(_0x4706('0x0'));var FaxInteraction=require(_0x4706('0x1'))['db'][_0x4706('0x2')];var FaxMessage=require(_0x4706('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4706('0x3')](0x0);var events={'afterCreate':_0x4706('0x4'),'afterUpdate':_0x4706('0x5'),'afterDestroy':_0x4706('0x6')};function emitEvent(_0x31ba4c){return function(_0x3a8855,_0x555174,_0x189757){_0x3a8855[_0x4706('0x7')]({'attributes':['id'],'raw':!![]})[_0x4706('0x8')](function(_0x2b3d66){_0x3a8855[_0x4706('0x9')](_0x4706('0xa'),_0x2b3d66['map'](function(_0x3a1ee3){return{'id':_0x3a1ee3['id']};}));return FaxMessage[_0x4706('0xb')]({'where':{'FaxInteractionId':_0x3a8855['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4706('0x8')](function(_0x3681f6){_0x3a8855[_0x4706('0x9')](_0x4706('0xc'),_0x3681f6[_0x4706('0xd')]);FaxInteractionEvents[_0x4706('0xe')](_0x31ba4c+':'+_0x3a8855['id'],_0x3a8855);FaxInteractionEvents[_0x4706('0xe')](_0x31ba4c,_0x3a8855);_0x189757(null);})[_0x4706('0xf')](_0x189757(null));};}for(var e in events){if(events[_0x4706('0x10')](e)){var event=events[e];FaxInteraction[_0x4706('0x11')](e,emitEvent(event));}}module[_0x4706('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 836362b..3f5792e 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 _0x4bfb=['api','bluebird','request-promise','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger'];(function(_0x2f6233,_0x90172){var _0x1c9c36=function(_0x3ac680){while(--_0x3ac680){_0x2f6233['push'](_0x2f6233['shift']());}};_0x1c9c36(++_0x90172);}(_0x4bfb,0x98));var _0xb4bf=function(_0x155413,_0x1c89b4){_0x155413=_0x155413-0x0;var _0x434c71=_0x4bfb[_0x155413];return _0x434c71;};'use strict';var _=require(_0xb4bf('0x0'));var util=require('util');var logger=require(_0xb4bf('0x1'))(_0xb4bf('0x2'));var moment=require('moment');var BPromise=require(_0xb4bf('0x3'));var rp=require(_0xb4bf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb4bf('0x5'));module['exports']=function(_0xc3670,_0x568a62){return _0xc3670[_0xb4bf('0x6')](_0xb4bf('0x7'),attributes,{'tableName':_0xb4bf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bf821,_0x39c3c4,_0x2a302a){if(_0x3bf821[_0xb4bf('0x9')](_0xb4bf('0xa'))){_0x3bf821[_0xb4bf('0xb')]=moment()[_0xb4bf('0xc')](_0xb4bf('0xd'));}_0x2a302a(null,_0x3bf821);}}});}; \ No newline at end of file +var _0x3f62=['exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','path','../../config/environment','./faxInteraction.attributes'];(function(_0x5dd9d7,_0x5161de){var _0x159baf=function(_0x459f20){while(--_0x459f20){_0x5dd9d7['push'](_0x5dd9d7['shift']());}};_0x159baf(++_0x5161de);}(_0x3f62,0x144));var _0x23f6=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x3f62[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require(_0x23f6('0x0'));var logger=require(_0x23f6('0x1'))('api');var moment=require(_0x23f6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x23f6('0x3'));var rimraf=require('rimraf');var config=require(_0x23f6('0x4'));var attributes=require(_0x23f6('0x5'));module[_0x23f6('0x6')]=function(_0x3f2581,_0x370ee1){return _0x3f2581[_0x23f6('0x7')](_0x23f6('0x8'),attributes,{'tableName':_0x23f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22ee6b,_0x4eb5a1,_0x480948){if(_0x22ee6b[_0x23f6('0xa')](_0x23f6('0xb'))){_0x22ee6b[_0x23f6('0xc')]=moment()[_0x23f6('0xd')](_0x23f6('0xe'));}_0x480948(null,_0x22ee6b);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 7ff4cb8..ba99ee5 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 _0x6654=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','limit','debug','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x473b2d,_0x3b42af){var _0x562934=function(_0x41760d){while(--_0x41760d){_0x473b2d['push'](_0x473b2d['shift']());}};_0x562934(++_0x3b42af);}(_0x6654,0x1d1));var _0x4665=function(_0x51cb56,_0x3834e7){_0x51cb56=_0x51cb56-0x0;var _0x42937e=_0x6654[_0x51cb56];return _0x42937e;};'use strict';var _=require(_0x4665('0x0'));var util=require(_0x4665('0x1'));var moment=require(_0x4665('0x2'));var BPromise=require(_0x4665('0x3'));var rs=require(_0x4665('0x4'));var fs=require('fs');var Redis=require(_0x4665('0x5'));var db=require(_0x4665('0x6'))['db'];var utils=require(_0x4665('0x7'));var logger=require('../../config/logger')(_0x4665('0x8'));var config=require(_0x4665('0x9'));var jayson=require(_0x4665('0xa'));var client=jayson[_0x4665('0xb')][_0x4665('0xc')]({'port':0x232a});config[_0x4665('0xd')]=_[_0x4665('0xe')](config[_0x4665('0xd')],{'host':_0x4665('0xf'),'port':0x18eb});var socket=require(_0x4665('0x10'))(new Redis(config[_0x4665('0xd')]));require(_0x4665('0x11'))['register'](socket);function respondWithRpcPromise(_0x19cb75,_0x2d7020,_0x50b4c5){return new BPromise(function(_0x1e3839,_0x2afd05){return client[_0x4665('0x12')](_0x19cb75,_0x50b4c5)[_0x4665('0x13')](function(_0x2380ed){logger[_0x4665('0x14')](_0x4665('0x15'),_0x2d7020,'request\x20sent');logger['debug'](_0x4665('0x16'),_0x2d7020,'request\x20sent',JSON[_0x4665('0x17')](_0x2380ed));if(_0x2380ed['error']){if(_0x2380ed[_0x4665('0x18')][_0x4665('0x19')]===0x1f4){logger[_0x4665('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x2d7020,_0x2380ed[_0x4665('0x18')]['message']);return _0x2afd05(_0x2380ed[_0x4665('0x18')][_0x4665('0x1a')]);}logger[_0x4665('0x18')](_0x4665('0x15'),_0x2d7020,_0x2380ed[_0x4665('0x18')]['message']);return _0x1e3839(_0x2380ed[_0x4665('0x18')][_0x4665('0x1a')]);}else{logger[_0x4665('0x14')](_0x4665('0x15'),_0x2d7020,_0x4665('0x1b'));_0x1e3839(_0x2380ed[_0x4665('0x1c')][_0x4665('0x1a')]);}})[_0x4665('0x1d')](function(_0x5ab97e){logger[_0x4665('0x18')](_0x4665('0x15'),_0x2d7020,_0x5ab97e);_0x2afd05(_0x5ab97e);});});}exports[_0x4665('0x1e')]=function(_0x2af419){var _0x6455dc=this;return new Promise(function(_0x5d3e7e,_0x9d3051){return db[_0x4665('0x1f')][_0x4665('0x20')](_0x2af419[_0x4665('0x21')],{'raw':_0x2af419[_0x4665('0x22')]?_0x2af419[_0x4665('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2af419[_0x4665('0x22')]?_0x2af419[_0x4665('0x22')][_0x4665('0x23')]||null:null,'attributes':_0x2af419['options']?_0x2af419['options']['attributes']||null:null,'limit':_0x2af419['options']?_0x2af419[_0x4665('0x22')][_0x4665('0x24')]||null:null})['then'](function(_0x21ca58){logger[_0x4665('0x14')](_0x4665('0x1e'),_0x2af419);logger[_0x4665('0x25')](_0x4665('0x1e'),_0x2af419,JSON['stringify'](_0x21ca58));_0x5d3e7e(_0x21ca58);})['catch'](function(_0x1f4cf9){logger[_0x4665('0x18')](_0x4665('0x1e'),_0x1f4cf9[_0x4665('0x1a')],_0x2af419);_0x9d3051(_0x6455dc[_0x4665('0x18')](0x1f4,_0x1f4cf9[_0x4665('0x1a')]));});});};exports['AddTagsToFaxInteraction']=function(_0x566dc0){return new Promise(function(_0x241105,_0x445a6c){return db[_0x4665('0x1f')]['find']({'where':_0x566dc0['options']?_0x566dc0[_0x4665('0x22')][_0x4665('0x23')]||null:null})[_0x4665('0x13')](function(_0x821662){if(_0x821662){return _0x821662[_0x4665('0x26')](_0x566dc0[_0x4665('0x21')][_0x4665('0x27')],_[_0x4665('0x28')](_0x566dc0['body'],[_0x4665('0x27'),'id'])||{});}})[_0x4665('0x29')](function(_0x567a06){logger[_0x4665('0x14')](_0x4665('0x2a'),_0x566dc0);logger[_0x4665('0x25')](_0x4665('0x2a'),_0x566dc0,JSON[_0x4665('0x17')](_0x567a06));_0x241105(_0x567a06);})[_0x4665('0x1d')](function(_0xa9dcf8){logger[_0x4665('0x18')]('AddTags',_0xa9dcf8[_0x4665('0x1a')],_0x566dc0);_0x445a6c(_this[_0x4665('0x18')](0x1f4,_0xa9dcf8[_0x4665('0x1a')]));});});}; \ No newline at end of file +var _0x862f=['limit','info','AddTagsToFaxInteraction','FaxInteraction','find','then','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateFaxInteraction','update','body','options','raw','where','attributes'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x862f,0x131));var _0xf862=function(_0x9097bc,_0x348605){_0x9097bc=_0x9097bc-0x0;var _0x5af24a=_0x862f[_0x9097bc];return _0x5af24a;};'use strict';var _=require(_0xf862('0x0'));var util=require(_0xf862('0x1'));var moment=require(_0xf862('0x2'));var BPromise=require(_0xf862('0x3'));var rs=require(_0xf862('0x4'));var fs=require('fs');var Redis=require(_0xf862('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf862('0x6'));var logger=require('../../config/logger')(_0xf862('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf862('0x8')][_0xf862('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf862('0xa')],{'host':_0xf862('0xb'),'port':0x18eb});var socket=require(_0xf862('0xc'))(new Redis(config[_0xf862('0xa')]));require(_0xf862('0xd'))[_0xf862('0xe')](socket);function respondWithRpcPromise(_0x3c758e,_0x3bd6fe,_0x471edf){return new BPromise(function(_0x5e96b4,_0x26171f){return client[_0xf862('0xf')](_0x3c758e,_0x471edf)['then'](function(_0xdfed0a){logger['info'](_0xf862('0x10'),_0x3bd6fe,_0xf862('0x11'));logger[_0xf862('0x12')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x3bd6fe,_0xf862('0x11'),JSON[_0xf862('0x13')](_0xdfed0a));if(_0xdfed0a[_0xf862('0x14')]){if(_0xdfed0a['error'][_0xf862('0x15')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x3bd6fe,_0xdfed0a[_0xf862('0x14')][_0xf862('0x16')]);return _0x26171f(_0xdfed0a[_0xf862('0x14')][_0xf862('0x16')]);}logger[_0xf862('0x14')](_0xf862('0x10'),_0x3bd6fe,_0xdfed0a[_0xf862('0x14')][_0xf862('0x16')]);return _0x5e96b4(_0xdfed0a['error'][_0xf862('0x16')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x3bd6fe,_0xf862('0x11'));_0x5e96b4(_0xdfed0a['result'][_0xf862('0x16')]);}})[_0xf862('0x17')](function(_0x41c73c){logger[_0xf862('0x14')](_0xf862('0x10'),_0x3bd6fe,_0x41c73c);_0x26171f(_0x41c73c);});});}exports[_0xf862('0x18')]=function(_0x25e5db){var _0x406fc7=this;return new Promise(function(_0x1833fd,_0x141a6b){return db['FaxInteraction'][_0xf862('0x19')](_0x25e5db[_0xf862('0x1a')],{'raw':_0x25e5db[_0xf862('0x1b')]?_0x25e5db[_0xf862('0x1b')][_0xf862('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25e5db[_0xf862('0x1b')]?_0x25e5db[_0xf862('0x1b')][_0xf862('0x1d')]||null:null,'attributes':_0x25e5db[_0xf862('0x1b')]?_0x25e5db[_0xf862('0x1b')][_0xf862('0x1e')]||null:null,'limit':_0x25e5db['options']?_0x25e5db[_0xf862('0x1b')][_0xf862('0x1f')]||null:null})['then'](function(_0x3e54c7){logger[_0xf862('0x20')](_0xf862('0x18'),_0x25e5db);logger[_0xf862('0x12')](_0xf862('0x18'),_0x25e5db,JSON[_0xf862('0x13')](_0x3e54c7));_0x1833fd(_0x3e54c7);})[_0xf862('0x17')](function(_0x4dc9af){logger[_0xf862('0x14')](_0xf862('0x18'),_0x4dc9af[_0xf862('0x16')],_0x25e5db);_0x141a6b(_0x406fc7[_0xf862('0x14')](0x1f4,_0x4dc9af['message']));});});};exports[_0xf862('0x21')]=function(_0x30bae8){return new Promise(function(_0x48986e,_0x49f53f){return db[_0xf862('0x22')][_0xf862('0x23')]({'where':_0x30bae8[_0xf862('0x1b')]?_0x30bae8[_0xf862('0x1b')]['where']||null:null})[_0xf862('0x24')](function(_0x5d8c00){if(_0x5d8c00){return _0x5d8c00[_0xf862('0x25')](_0x30bae8['body']['ids'],_[_0xf862('0x26')](_0x30bae8[_0xf862('0x1a')],[_0xf862('0x27'),'id'])||{});}})[_0xf862('0x28')](function(_0x17f198){logger['info'](_0xf862('0x29'),_0x30bae8);logger[_0xf862('0x12')](_0xf862('0x29'),_0x30bae8,JSON['stringify'](_0x17f198));_0x48986e(_0x17f198);})[_0xf862('0x17')](function(_0x259fde){logger[_0xf862('0x14')](_0xf862('0x29'),_0x259fde[_0xf862('0x16')],_0x30bae8);_0x49f53f(_this['error'](0x1f4,_0x259fde[_0xf862('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 79f9974..25b5c93 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 _0x59f3=['length','faxInteraction:','save','update','removeListener','register'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x59f3,0x13a));var _0x359f=function(_0x5b7963,_0x10bff5){_0x5b7963=_0x5b7963-0x0;var _0x57f611=_0x59f3[_0x5b7963];return _0x57f611;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x359f('0x0'),'remove',_0x359f('0x1')];function createListener(_0x5e887d,_0x3df232){return function(_0x190a0c){_0x3df232['emit'](_0x5e887d,_0x190a0c);};}function removeListener(_0x3e5c75,_0x116ad1){return function(){FaxInteractionEvents[_0x359f('0x2')](_0x3e5c75,_0x116ad1);};}exports[_0x359f('0x3')]=function(_0x21bd97){for(var _0x586540=0x0,_0x5cd944=events[_0x359f('0x4')];_0x586540<_0x5cd944;_0x586540++){var _0x48ccf6=events[_0x586540];var _0x20d576=createListener(_0x359f('0x5')+_0x48ccf6,_0x21bd97);FaxInteractionEvents['on'](_0x48ccf6,_0x20d576);}}; \ No newline at end of file +var _0x70c8=['removeListener','register','faxInteraction:','./faxInteraction.events','update'];(function(_0x43bf2,_0x38bc23){var _0x3b8f56=function(_0x5f41d2){while(--_0x5f41d2){_0x43bf2['push'](_0x43bf2['shift']());}};_0x3b8f56(++_0x38bc23);}(_0x70c8,0xa3));var _0x870c=function(_0x4a6574,_0x3b892d){_0x4a6574=_0x4a6574-0x0;var _0x201ddb=_0x70c8[_0x4a6574];return _0x201ddb;};'use strict';var FaxInteractionEvents=require(_0x870c('0x0'));var events=['save','remove',_0x870c('0x1')];function createListener(_0xf1aa33,_0x5288d6){return function(_0x11d3aa){_0x5288d6['emit'](_0xf1aa33,_0x11d3aa);};}function removeListener(_0x54f789,_0x27fcd5){return function(){FaxInteractionEvents[_0x870c('0x2')](_0x54f789,_0x27fcd5);};}exports[_0x870c('0x3')]=function(_0x4b3548){for(var _0x1b5d69=0x0,_0x34bc67=events['length'];_0x1b5d69<_0x34bc67;_0x1b5d69++){var _0x1034f6=events[_0x1b5d69];var _0x425441=createListener(_0x870c('0x4')+_0x1034f6,_0x4b3548);FaxInteractionEvents['on'](_0x1034f6,_0x425441);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 3eb021b..e362f43 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 _0x84cc=['update','delete','faxinteraction:destroy','removeTags','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','faxinteraction:update'];(function(_0xf3b099,_0x3a71f5){var _0x153f16=function(_0x3fc365){while(--_0x3fc365){_0xf3b099['push'](_0xf3b099['shift']());}};_0x153f16(++_0x3a71f5);}(_0x84cc,0x1c6));var _0xc84c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x84cc[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xc84c('0x0'));var util=require('util');var path=require(_0xc84c('0x1'));var timeout=require(_0xc84c('0x2'));var express=require(_0xc84c('0x3'));var router=express['Router']();var fs_extra=require(_0xc84c('0x4'));var auth=require(_0xc84c('0x5'));var interaction=require(_0xc84c('0x6'));var config=require('../../config/environment');var controller=require(_0xc84c('0x7'));router[_0xc84c('0x8')]('/',auth[_0xc84c('0x9')](),controller[_0xc84c('0xa')]);router[_0xc84c('0x8')](_0xc84c('0xb'),auth[_0xc84c('0x9')](),controller[_0xc84c('0xc')]);router[_0xc84c('0x8')](_0xc84c('0xd'),auth[_0xc84c('0x9')](),controller['show']);router['get'](_0xc84c('0xe'),auth['isAuthenticated'](),controller[_0xc84c('0xf')]);router[_0xc84c('0x8')](_0xc84c('0x10'),auth[_0xc84c('0x9')](),controller['download']);router[_0xc84c('0x11')]('/',auth[_0xc84c('0x9')](),controller[_0xc84c('0x12')]);router[_0xc84c('0x11')](_0xc84c('0xe'),auth[_0xc84c('0x9')](),controller[_0xc84c('0x13')]);router[_0xc84c('0x11')](_0xc84c('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0xc84c('0x15'),_0xc84c('0x16')),controller[_0xc84c('0x17')]);router[_0xc84c('0x18')](_0xc84c('0xd'),auth[_0xc84c('0x9')](),interaction['tracked'](_0xc84c('0x15'),_0xc84c('0x19')),controller[_0xc84c('0x1a')]);router[_0xc84c('0x1b')](_0xc84c('0xd'),auth[_0xc84c('0x9')](),interaction['tracked'](_0xc84c('0x15'),_0xc84c('0x1c')),controller['destroy']);router[_0xc84c('0x1b')](_0xc84c('0x14'),auth[_0xc84c('0x9')](),controller[_0xc84c('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x6e34=['download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download'];(function(_0x339f21,_0x1191c6){var _0x2e43d4=function(_0x4d2d53){while(--_0x4d2d53){_0x339f21['push'](_0x339f21['shift']());}};_0x2e43d4(++_0x1191c6);}(_0x6e34,0x159));var _0x46e3=function(_0x1e3cde,_0x165911){_0x1e3cde=_0x1e3cde-0x0;var _0x2f8660=_0x6e34[_0x1e3cde];return _0x2f8660;};'use strict';var multer=require(_0x46e3('0x0'));var util=require(_0x46e3('0x1'));var path=require(_0x46e3('0x2'));var timeout=require(_0x46e3('0x3'));var express=require('express');var router=express[_0x46e3('0x4')]();var fs_extra=require(_0x46e3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x46e3('0x6'));var controller=require('./faxInteraction.controller');router[_0x46e3('0x7')]('/',auth[_0x46e3('0x8')](),controller['index']);router[_0x46e3('0x7')](_0x46e3('0x9'),auth[_0x46e3('0x8')](),controller[_0x46e3('0xa')]);router['get'](_0x46e3('0xb'),auth[_0x46e3('0x8')](),controller[_0x46e3('0xc')]);router[_0x46e3('0x7')]('/:id/messages',auth[_0x46e3('0x8')](),controller[_0x46e3('0xd')]);router[_0x46e3('0x7')](_0x46e3('0xe'),auth[_0x46e3('0x8')](),controller[_0x46e3('0xf')]);router[_0x46e3('0x10')]('/',auth[_0x46e3('0x8')](),controller[_0x46e3('0x11')]);router[_0x46e3('0x10')]('/:id/messages',auth[_0x46e3('0x8')](),controller[_0x46e3('0x12')]);router['post'](_0x46e3('0x13'),auth[_0x46e3('0x8')](),interaction[_0x46e3('0x14')](_0x46e3('0x15'),_0x46e3('0x16')),controller[_0x46e3('0x17')]);router[_0x46e3('0x18')](_0x46e3('0xb'),auth[_0x46e3('0x8')](),interaction[_0x46e3('0x14')](_0x46e3('0x15'),_0x46e3('0x19')),controller[_0x46e3('0x1a')]);router[_0x46e3('0x1b')]('/:id',auth[_0x46e3('0x8')](),interaction[_0x46e3('0x14')](_0x46e3('0x15'),_0x46e3('0x1c')),controller['destroy']);router[_0x46e3('0x1b')](_0x46e3('0x13'),auth['isAuthenticated'](),controller['removeTags']);module[_0x46e3('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 699af5d..e040f2f 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 _0x68fc=['sequelize','exports','TEXT','ENUM','out'];(function(_0x16bec0,_0x53be9b){var _0x36dcb6=function(_0x75b1a8){while(--_0x75b1a8){_0x16bec0['push'](_0x16bec0['shift']());}};_0x36dcb6(++_0x53be9b);}(_0x68fc,0xa5));var _0xc68f=function(_0x3bd146,_0x28de48){_0x3bd146=_0x3bd146-0x0;var _0x177e6e=_0x68fc[_0x3bd146];return _0x177e6e;};'use strict';var Sequelize=require(_0xc68f('0x0'));module[_0xc68f('0x1')]={'body':{'type':Sequelize[_0xc68f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc68f('0x3')]('in','out'),'defaultValue':_0xc68f('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x5178=['BOOLEAN','ENUM','DATE','exports','TEXT','medium'];(function(_0x2102ac,_0x1c50b5){var _0x5bb0e9=function(_0x4cefe1){while(--_0x4cefe1){_0x2102ac['push'](_0x2102ac['shift']());}};_0x5bb0e9(++_0x1c50b5);}(_0x5178,0x171));var _0x8517=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5178[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x8517('0x0')]={'body':{'type':Sequelize[_0x8517('0x1')](_0x8517('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8517('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8517('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x8517('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8517('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 3ab8166..b1aa338 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 _0x4419=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','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','status','end','json','offset','limit','undefined','count','reject','save','update','then','destroy','name','send','index','FaxMessage','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','include','body','find','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','SELECT','User','agent','fullname','email','interface','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','internal','SIP/%s','rejectmessage','create','CmContact','findOne','AttachmentId','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','join','root','server','files','attachments','Attachment','basename'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4419,0x122));var _0x9441=function(_0x531836,_0x5a104a){_0x531836=_0x531836-0x0;var _0x2840ae=_0x4419[_0x531836];return _0x2840ae;};'use strict';var emlformat=require(_0x9441('0x0'));var rimraf=require(_0x9441('0x1'));var zipdir=require(_0x9441('0x2'));var jsonpatch=require(_0x9441('0x3'));var rp=require(_0x9441('0x4'));var moment=require(_0x9441('0x5'));var BPromise=require(_0x9441('0x6'));var Mustache=require('mustache');var util=require(_0x9441('0x7'));var path=require(_0x9441('0x8'));var sox=require('sox');var csv=require(_0x9441('0x9'));var ejs=require(_0x9441('0xa'));var fs=require('fs');var fs_extra=require(_0x9441('0xb'));var _=require(_0x9441('0xc'));var squel=require(_0x9441('0xd'));var crypto=require(_0x9441('0xe'));var jsforce=require(_0x9441('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9441('0x9'));var querystring=require(_0x9441('0x10'));var Papa=require(_0x9441('0x11'));var Redis=require(_0x9441('0x12'));var authService=require(_0x9441('0x13'));var qs=require(_0x9441('0x14'));var as=require(_0x9441('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9441('0x16'))(_0x9441('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9441('0x18'));var db=require('../../mysqldb')['db'];config[_0x9441('0x19')]=_[_0x9441('0x1a')](config[_0x9441('0x19')],{'host':_0x9441('0x1b'),'port':0x18eb});var socket=require(_0x9441('0x1c'))(new Redis(config['redis']));require(_0x9441('0x1d'))[_0x9441('0x1e')](socket);var jayson=require(_0x9441('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x9441('0x20')][_0x9441('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5a234f,_0x3c52cb,_0x400cd0,_0x57844e){return new BPromise(function(_0x53ba52,_0x5755af){var _0x3c81e8=_0x57844e||client;return _0x3c81e8[_0x9441('0x22')](_0x5a234f,_0x400cd0)['then'](function(_0x4159dc){logger[_0x9441('0x23')](_0x9441('0x24'),_0x3c52cb,_0x9441('0x25'));logger[_0x9441('0x26')](_0x9441('0x27'),_0x3c52cb,_0x9441('0x25'),JSON[_0x9441('0x28')](_0x4159dc));if(_0x4159dc[_0x9441('0x29')]){if(_0x4159dc[_0x9441('0x29')][_0x9441('0x2a')]===0x1f4){logger[_0x9441('0x29')]('FaxMessage,\x20%s,\x20%s',_0x3c52cb,_0x4159dc[_0x9441('0x29')][_0x9441('0x2b')]);return _0x5755af(_0x4159dc[_0x9441('0x29')][_0x9441('0x2b')]);}logger[_0x9441('0x29')](_0x9441('0x24'),_0x3c52cb,_0x4159dc[_0x9441('0x29')]['message']);return _0x53ba52(_0x4159dc[_0x9441('0x29')][_0x9441('0x2b')]);}else{logger['info'](_0x9441('0x24'),_0x3c52cb,'request\x20sent');_0x53ba52(_0x4159dc[_0x9441('0x2c')][_0x9441('0x2b')]);}})[_0x9441('0x2d')](function(_0x22e422){logger[_0x9441('0x29')](_0x9441('0x24'),_0x3c52cb,_0x22e422);_0x5755af(_0x22e422);});});}function respondWithStatusCode(_0x2c886e,_0x27d9c8){_0x27d9c8=_0x27d9c8||0xcc;return function(_0x1984b0){if(_0x1984b0){return _0x2c886e[_0x9441('0x2e')](_0x27d9c8);}return _0x2c886e[_0x9441('0x2f')](_0x27d9c8)[_0x9441('0x30')]();};}function respondWithResult(_0x233354,_0x1a257d){_0x1a257d=_0x1a257d||0xc8;return function(_0x3b4ff1){if(_0x3b4ff1){return _0x233354['status'](_0x1a257d)[_0x9441('0x31')](_0x3b4ff1);}};}function respondWithFilteredResult(_0x303eb8,_0x4a6c15){return function(_0xf6b1e3){if(_0xf6b1e3){var _0x5b0632=typeof _0x4a6c15[_0x9441('0x32')]==='undefined'&&typeof _0x4a6c15[_0x9441('0x33')]===_0x9441('0x34');var _0x541afe=_0xf6b1e3[_0x9441('0x35')];var _0x288f2e=_0x5b0632?0x0:_0x4a6c15[_0x9441('0x32')];var _0x56e249=_0x5b0632?_0xf6b1e3['count']:_0x4a6c15[_0x9441('0x32')]+_0x4a6c15['limit'];var _0x3a2b93;if(_0x56e249>=_0x541afe){_0x56e249=_0x541afe;_0x3a2b93=0xc8;}else{_0x3a2b93=0xce;}_0x303eb8[_0x9441('0x2f')](_0x3a2b93);return _0x303eb8['set']('Content-Range',_0x288f2e+'-'+_0x56e249+'/'+_0x541afe)['json'](_0xf6b1e3);}return null;};}function patchUpdates(_0x3f9106){return function(_0x462aa5){try{jsonpatch['apply'](_0x462aa5,_0x3f9106,!![]);}catch(_0x51667e){return BPromise[_0x9441('0x36')](_0x51667e);}return _0x462aa5[_0x9441('0x37')]();};}function saveUpdates(_0x341478,_0x11bc55){return function(_0x18a2df){if(_0x18a2df){return _0x18a2df[_0x9441('0x38')](_0x341478)[_0x9441('0x39')](function(_0x3b5645){return _0x3b5645;});}return null;};}function removeEntity(_0x148618,_0x2948df){return function(_0x4f6242){if(_0x4f6242){return _0x4f6242[_0x9441('0x3a')]()[_0x9441('0x39')](function(){_0x148618[_0x9441('0x2f')](0xcc)[_0x9441('0x30')]();});}};}function handleEntityNotFound(_0x4bdba5,_0x31b95d){return function(_0x380158){if(!_0x380158){_0x4bdba5['sendStatus'](0x194);}return _0x380158;};}function handleError(_0xe40f03,_0x2b6df4){_0x2b6df4=_0x2b6df4||0x1f4;return function(_0x5c5b7e){logger['error'](_0x5c5b7e['stack']);if(_0x5c5b7e[_0x9441('0x3b')]){delete _0x5c5b7e['name'];}_0xe40f03['status'](_0x2b6df4)[_0x9441('0x3c')](_0x5c5b7e);};}exports[_0x9441('0x3d')]=function(_0x2dd2a7,_0x1ed425){var _0x4bbfa7={},_0x13e0be={},_0x56ba12={'count':0x0,'rows':[]};var _0x2ed48c=_['map'](db[_0x9441('0x3e')][_0x9441('0x3f')],function(_0x496c8b){return{'name':_0x496c8b['fieldName'],'type':_0x496c8b['type']['key']};});_0x13e0be[_0x9441('0x40')]=_[_0x9441('0x41')](_0x2ed48c,_0x9441('0x3b'));_0x13e0be[_0x9441('0x42')]=_[_0x9441('0x43')](_0x2dd2a7[_0x9441('0x42')]);_0x13e0be[_0x9441('0x44')]=_[_0x9441('0x45')](_0x13e0be[_0x9441('0x40')],_0x13e0be[_0x9441('0x42')]);_0x4bbfa7[_0x9441('0x46')]=_[_0x9441('0x45')](_0x13e0be[_0x9441('0x40')],qs[_0x9441('0x47')](_0x2dd2a7[_0x9441('0x42')][_0x9441('0x47')]));_0x4bbfa7[_0x9441('0x46')]=_0x4bbfa7[_0x9441('0x46')][_0x9441('0x48')]?_0x4bbfa7['attributes']:_0x13e0be[_0x9441('0x40')];if(!_0x2dd2a7[_0x9441('0x42')]['hasOwnProperty'](_0x9441('0x49'))){_0x4bbfa7[_0x9441('0x33')]=qs[_0x9441('0x33')](_0x2dd2a7[_0x9441('0x42')][_0x9441('0x33')]);_0x4bbfa7[_0x9441('0x32')]=qs[_0x9441('0x32')](_0x2dd2a7[_0x9441('0x42')]['offset']);}_0x4bbfa7[_0x9441('0x4a')]=qs[_0x9441('0x4b')](_0x2dd2a7[_0x9441('0x42')][_0x9441('0x4b')]);_0x4bbfa7[_0x9441('0x4c')]=qs[_0x9441('0x44')](_['pick'](_0x2dd2a7[_0x9441('0x42')],_0x13e0be[_0x9441('0x44')]),_0x2ed48c);if(_0x2dd2a7[_0x9441('0x42')][_0x9441('0x4d')]){_0x4bbfa7[_0x9441('0x4c')]=_[_0x9441('0x4e')](_0x4bbfa7['where'],{'$or':_['map'](_0x2ed48c,function(_0x3b7e1f){if(_0x3b7e1f[_0x9441('0x4f')]!==_0x9441('0x50')){var _0x241760={};_0x241760[_0x3b7e1f[_0x9441('0x3b')]]={'$like':'%'+_0x2dd2a7[_0x9441('0x42')][_0x9441('0x4d')]+'%'};return _0x241760;}})});}_0x4bbfa7=_[_0x9441('0x4e')]({},_0x4bbfa7,_0x2dd2a7[_0x9441('0x51')]);var _0x4aab77={'where':_0x4bbfa7[_0x9441('0x4c')]};return db[_0x9441('0x3e')][_0x9441('0x35')](_0x4aab77)['then'](function(_0x499456){_0x56ba12[_0x9441('0x35')]=_0x499456;if(_0x2dd2a7[_0x9441('0x42')][_0x9441('0x52')]){_0x4bbfa7['include']=[{'all':!![]}];}return db[_0x9441('0x3e')][_0x9441('0x53')](_0x4bbfa7);})['then'](function(_0x22f7cb){_0x56ba12[_0x9441('0x54')]=_0x22f7cb;return _0x56ba12;})[_0x9441('0x39')](respondWithFilteredResult(_0x1ed425,_0x4bbfa7))['catch'](handleError(_0x1ed425,null));};exports[_0x9441('0x55')]=function(_0x3e9009,_0x425f08){var _0x239733={'raw':!![],'where':{'id':_0x3e9009[_0x9441('0x56')]['id']}},_0x50eb06={};_0x50eb06[_0x9441('0x40')]=_[_0x9441('0x43')](db[_0x9441('0x3e')][_0x9441('0x3f')]);_0x50eb06['query']=_['keys'](_0x3e9009['query']);_0x50eb06['filters']=_['intersection'](_0x50eb06['model'],_0x50eb06['query']);_0x239733[_0x9441('0x46')]=_[_0x9441('0x45')](_0x50eb06[_0x9441('0x40')],qs[_0x9441('0x47')](_0x3e9009['query'][_0x9441('0x47')]));_0x239733['attributes']=_0x239733[_0x9441('0x46')][_0x9441('0x48')]?_0x239733[_0x9441('0x46')]:_0x50eb06[_0x9441('0x40')];if(_0x3e9009[_0x9441('0x42')][_0x9441('0x52')]){_0x239733[_0x9441('0x57')]=[{'all':!![]}];}_0x239733=_[_0x9441('0x4e')]({},_0x239733,_0x3e9009['options']);return db[_0x9441('0x3e')]['find'](_0x239733)[_0x9441('0x39')](handleEntityNotFound(_0x425f08,null))[_0x9441('0x39')](respondWithResult(_0x425f08,null))[_0x9441('0x2d')](handleError(_0x425f08,null));};exports[_0x9441('0x38')]=function(_0x1a5351,_0x13575f){if(_0x1a5351[_0x9441('0x58')]['id']){delete _0x1a5351['body']['id'];}return db[_0x9441('0x3e')]['find']({'where':{'id':_0x1a5351[_0x9441('0x56')]['id']}})[_0x9441('0x39')](handleEntityNotFound(_0x13575f,null))['then'](saveUpdates(_0x1a5351[_0x9441('0x58')],null))['then'](respondWithResult(_0x13575f,null))[_0x9441('0x2d')](handleError(_0x13575f,null));};exports[_0x9441('0x3a')]=function(_0x5eaca1,_0x10200f){return db[_0x9441('0x3e')][_0x9441('0x59')]({'where':{'id':_0x5eaca1[_0x9441('0x56')]['id']}})[_0x9441('0x39')](handleEntityNotFound(_0x10200f,null))[_0x9441('0x39')](removeEntity(_0x10200f,null))['catch'](handleError(_0x10200f,null));};exports[_0x9441('0x5a')]=function(_0xe3aaab,_0x4d6c8a){return db[_0x9441('0x3e')][_0x9441('0x5a')]()[_0x9441('0x39')](respondWithResult(_0x4d6c8a,null))[_0x9441('0x2d')](handleError(_0x4d6c8a,null));};var interaction_log=require(_0x9441('0x16'))(_0x9441('0x5b'));exports[_0x9441('0x5c')]=function(_0x11caa6,_0x2c3a8e,_0x585884){var _0x564196={'agent':{},'channel':_0x9441('0x5d')};if(_0x11caa6[_0x9441('0x58')]['id']){delete _0x11caa6[_0x9441('0x58')]['id'];}_0x11caa6['body'][_0x9441('0x5e')]=!![];_0x11caa6[_0x9441('0x58')][_0x9441('0x5f')]=moment()[_0x9441('0x60')](_0x9441('0x61'));_0x11caa6[_0x9441('0x58')]['UserId']=_0x11caa6[_0x9441('0x58')][_0x9441('0x62')]||_0x11caa6[_0x9441('0x63')]['id'];_0x564196['agent']['id']=_0x11caa6[_0x9441('0x58')][_0x9441('0x62')];return db[_0x9441('0x3e')][_0x9441('0x59')]({'where':{'id':_0x11caa6[_0x9441('0x56')]['id'],'UserId':null}})[_0x9441('0x39')](handleEntityNotFound(_0x2c3a8e,null))[_0x9441('0x39')](saveUpdates(_0x11caa6[_0x9441('0x58')],null))[_0x9441('0x39')](function(_0x2b6f23){if(_0x2b6f23){_0x564196[_0x9441('0x2b')]=_0x2b6f23[_0x9441('0x64')]({'plain':!![]});return db['FaxInteraction'][_0x9441('0x59')]({'where':{'id':_0x2b6f23[_0x9441('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x2c3a8e,null))[_0x9441('0x39')](function(_0x2c382a){if(_0x2c382a){return _0x2c382a[_0x9441('0x38')]({'UserId':_0x11caa6[_0x9441('0x58')][_0x9441('0x62')],'read1stAt':_[_0x9441('0x66')](_0x2c382a[_0x9441('0x67')])?moment()[_0x9441('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9441('0x39')](function(_0x454802){if(_0x454802){_0x564196[_0x9441('0x68')]=_0x454802[_0x9441('0x64')]({'plain':!![]});interaction_log[_0x9441('0x23')](_0x9441('0x69'),_0x11caa6[_0x9441('0x63')]['id'],_0x11caa6[_0x9441('0x63')][_0x9441('0x3b')],_0x11caa6[_0x9441('0x63')][_0x9441('0x6a')],_0x564196[_0x9441('0x68')]['id'],_0x11caa6[_0x9441('0x58')]?JSON[_0x9441('0x28')](_0x11caa6['body']):_0x9441('0x6b'));return respondWithRpcPromise(_0x9441('0x6c'),_0x9441('0x6d'),_0x564196);}return null;})[_0x9441('0x39')](function(_0x423663){var _0x1a3b9d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x423663[_0x9441('0x2b')][_0x9441('0x6e')];return db['sequelize'][_0x9441('0x42')](_0x1a3b9d,{'type':db['Sequelize']['QueryTypes'][_0x9441('0x6f')],'raw':!![]})[_0x9441('0x39')](function(_0x38d796){return _0x38d796;});})['then'](function(_0x3094e4){if(_0x3094e4){_0x564196['message']['contact']=_0x3094e4[0x0];if(!_0x11caa6[_0x9441('0x58')]['UserId'])return;return db[_0x9441('0x70')][_0x9441('0x59')]({'where':{'id':_0x11caa6[_0x9441('0x58')]['UserId'],'role':_0x9441('0x71')},'attributes':['id',_0x9441('0x3b'),_0x9441('0x72'),_0x9441('0x73'),'internal'],'raw':!![]});}return null;})[_0x9441('0x39')](function(_0x5bc174){if(!_0x5bc174)return null;_0x564196[_0x9441('0x2b')][_0x9441('0x71')]=_0x5bc174;return _0x564196;})['then'](function(_0x1b0afa){if(_0x1b0afa){if(_0x11caa6['body']['manual']){_0x564196[_0x9441('0x2b')][_0x9441('0x74')]=util['format']('SIP/%s',_0x11caa6[_0x9441('0x63')][_0x9441('0x3b')]);_0x564196[_0x9441('0x2b')][_0x9441('0x75')]=_0x564196[_0x9441('0x75')];_0x564196['message'][_0x9441('0x76')]=_0x564196['channel'];_0x564196[_0x9441('0x2b')][_0x9441('0x77')]=_0x9441('0x5c');return respondWithRpcPromise('EventManager',_0x9441('0x78'),{'event':_0x9441('0x79'),'message':_0x564196[_0x9441('0x2b')]},client9002)[_0x9441('0x39')](function(){return _0x564196;});}return _0x564196;}return null;})['then'](respondWithResult(_0x2c3a8e,null))[_0x9441('0x2d')](handleError(_0x2c3a8e,null));};var interaction_log=require(_0x9441('0x16'))('fax-interactions');exports[_0x9441('0x36')]=function(_0x1ae91b,_0xcafa07,_0x5b135e){var _0x51b395={'agent':{},'channel':_0x9441('0x5d')};if(_0x1ae91b[_0x9441('0x58')]['id']){delete _0x1ae91b['body']['id'];}_0x1ae91b['body']['UserId']=_0x1ae91b[_0x9441('0x58')][_0x9441('0x62')]||_0x1ae91b[_0x9441('0x63')]['id'];_0x51b395[_0x9441('0x71')]['id']=_0x1ae91b[_0x9441('0x58')]['UserId'];return db[_0x9441('0x3e')][_0x9441('0x59')]({'where':{'id':_0x1ae91b[_0x9441('0x56')]['id'],'UserId':null}})[_0x9441('0x39')](handleEntityNotFound(_0xcafa07,null))['then'](function(_0x49edc7){if(_0x49edc7){_0x51b395[_0x9441('0x2b')]=_0x49edc7[_0x9441('0x64')]({'plain':!![]});return db['FaxInteraction'][_0x9441('0x59')]({'where':{'id':_0x49edc7['FaxInteractionId']}});}return null;})[_0x9441('0x39')](handleEntityNotFound(_0xcafa07,null))[_0x9441('0x39')](function(_0x468b26){if(_0x468b26){_0x51b395['interaction']=_0x468b26[_0x9441('0x64')]({'plain':!![]});interaction_log[_0x9441('0x23')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ae91b['user']['id'],_0x1ae91b['user'][_0x9441('0x3b')],_0x1ae91b[_0x9441('0x63')][_0x9441('0x6a')],_0x51b395['interaction']['id'],_0x1ae91b[_0x9441('0x58')]?JSON[_0x9441('0x28')](_0x1ae91b['body']):_0x9441('0x6b'));return respondWithRpcPromise(_0x9441('0x7a'),_0x9441('0x7b'),_0x51b395);}return null;})[_0x9441('0x39')](function(_0x18cd35){var _0x281689=_0x9441('0x7c')+_0x18cd35['message'][_0x9441('0x6e')];return db[_0x9441('0x7d')][_0x9441('0x42')](_0x281689,{'type':db[_0x9441('0x7e')][_0x9441('0x7f')][_0x9441('0x6f')],'raw':!![]})[_0x9441('0x39')](function(_0x383751){return _0x383751;});})[_0x9441('0x39')](function(_0x56fd11){if(_0x56fd11){_0x51b395[_0x9441('0x2b')][_0x9441('0x80')]=_0x56fd11[0x0];if(!_0x1ae91b['body'][_0x9441('0x62')])return;return db[_0x9441('0x70')]['find']({'where':{'id':_0x1ae91b['body']['UserId'],'role':'agent'},'attributes':['id',_0x9441('0x3b'),_0x9441('0x72'),_0x9441('0x73'),_0x9441('0x81')],'raw':!![]});}return null;})['then'](function(_0x57d7a9){if(!_0x57d7a9)return null;_0x51b395[_0x9441('0x2b')][_0x9441('0x71')]=_0x57d7a9;return _0x51b395;})[_0x9441('0x39')](function(_0x4fa0d0){if(_0x4fa0d0){_0x4fa0d0[_0x9441('0x2b')][_0x9441('0x74')]=util[_0x9441('0x60')](_0x9441('0x82'),_0x1ae91b[_0x9441('0x63')]['name']);_0x4fa0d0[_0x9441('0x2b')][_0x9441('0x75')]=_0x51b395[_0x9441('0x75')];_0x4fa0d0[_0x9441('0x2b')][_0x9441('0x76')]=_0x51b395[_0x9441('0x75')];_0x4fa0d0[_0x9441('0x2b')][_0x9441('0x77')]=_0x9441('0x36');respondWithRpcPromise(_0x9441('0x78'),_0x9441('0x78'),{'event':_0x9441('0x83'),'message':_0x4fa0d0[_0x9441('0x2b')]},client9002);return _0x51b395;}return null;})[_0x9441('0x39')](respondWithResult(_0xcafa07,null))['catch'](handleError(_0xcafa07,null));};exports[_0x9441('0x84')]=function(_0x2fc4e2,_0x539737){var _0x22426a;return db[_0x9441('0x3e')][_0x9441('0x84')](_0x2fc4e2[_0x9441('0x58')],{})[_0x9441('0x39')](function(_0x479d74){_0x22426a=_0x479d74;return db[_0x9441('0x85')][_0x9441('0x86')]({'where':{'id':_0x22426a[_0x9441('0x6e')]}});})[_0x9441('0x39')](function(_0x144b6f){if(_[_0x9441('0x66')](_0x144b6f)){return;}else{_0x22426a[_0x9441('0x5d')]=_0x144b6f[_0x9441('0x5d')];return db['Attachment'][_0x9441('0x86')]({'where':{'id':_0x22426a[_0x9441('0x87')]}});}})[_0x9441('0x39')](function(_0x570e5f){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x9441('0x66')](_0x2fc4e2['body'])?undefined:_0x2fc4e2['body'][_0x9441('0x88')],'path':_[_0x9441('0x66')](_0x570e5f)?undefined:util[_0x9441('0x60')](_0x9441('0x89'),_0x570e5f['basename']),'fax':_[_0x9441('0x66')](_0x22426a[_0x9441('0x5d')])?undefined:_0x22426a[_0x9441('0x5d')],'AttachmentId':_0x22426a[_0x9441('0x87')]},client9002);})[_0x9441('0x39')](respondWithResult(_0x539737,0xc9))[_0x9441('0x2d')](handleError(_0x539737,null));};exports['download']=function(_0x6b06c9,_0x3a6b15){var _0x57862f=path[_0x9441('0x8a')](config[_0x9441('0x8b')],_0x9441('0x8c'),_0x9441('0x8d'),_0x9441('0x8e'));return db[_0x9441('0x3e')][_0x9441('0x59')]({'where':{'id':_0x6b06c9[_0x9441('0x56')]['id']},'include':[{'model':db[_0x9441('0x8f')],'as':_0x9441('0x8f')}]})[_0x9441('0x39')](handleEntityNotFound(_0x3a6b15,null))[_0x9441('0x39')](function(_0x37d1c3){if(_0x37d1c3){return _0x3a6b15['download'](path[_0x9441('0x8a')](_0x57862f,_0x37d1c3[_0x9441('0x8f')][_0x9441('0x90')]));}})[_0x9441('0x2d')](handleError(_0x3a6b15,null));}; \ No newline at end of file +var _0x8d31=['update','destroy','stack','name','send','index','map','FaxMessage','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','rawAttributes','keys','include','body','find','describe','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','fullname','internal','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','QueryTypes','User','email','rejectmessage','create','CmContact','findOne','Attachment','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','join','root','server','files','attachments','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','then','info','FaxMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x8d31,0xe7));var _0x18d3=function(_0x3cfce7,_0x22c43d){_0x3cfce7=_0x3cfce7-0x0;var _0x200b8b=_0x8d31[_0x3cfce7];return _0x200b8b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x18d3('0x0'));var jsonpatch=require(_0x18d3('0x1'));var rp=require(_0x18d3('0x2'));var moment=require('moment');var BPromise=require(_0x18d3('0x3'));var Mustache=require(_0x18d3('0x4'));var util=require(_0x18d3('0x5'));var path=require(_0x18d3('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x18d3('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x18d3('0x8'));var squel=require(_0x18d3('0x9'));var crypto=require(_0x18d3('0xa'));var jsforce=require(_0x18d3('0xb'));var deskjs=require(_0x18d3('0xc'));var toCsv=require(_0x18d3('0xd'));var querystring=require(_0x18d3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x18d3('0xf'));var qs=require(_0x18d3('0x10'));var as=require(_0x18d3('0x11'));var hardwareService=require(_0x18d3('0x12'));var logger=require(_0x18d3('0x13'))(_0x18d3('0x14'));var utils=require(_0x18d3('0x15'));var config=require(_0x18d3('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x18d3('0x17')]=_[_0x18d3('0x18')](config[_0x18d3('0x17')],{'host':_0x18d3('0x19'),'port':0x18eb});var socket=require(_0x18d3('0x1a'))(new Redis(config[_0x18d3('0x17')]));require(_0x18d3('0x1b'))[_0x18d3('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x18d3('0x1d')][_0x18d3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x179886,_0xb54548,_0x113755,_0x33bacc){return new BPromise(function(_0x1a9808,_0x1e8856){var _0x1b2387=_0x33bacc||client;return _0x1b2387['request'](_0x179886,_0x113755)[_0x18d3('0x1f')](function(_0x1971bb){logger[_0x18d3('0x20')](_0x18d3('0x21'),_0xb54548,'request\x20sent');logger[_0x18d3('0x22')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0xb54548,'request\x20sent',JSON[_0x18d3('0x23')](_0x1971bb));if(_0x1971bb[_0x18d3('0x24')]){if(_0x1971bb['error'][_0x18d3('0x25')]===0x1f4){logger['error'](_0x18d3('0x21'),_0xb54548,_0x1971bb[_0x18d3('0x24')][_0x18d3('0x26')]);return _0x1e8856(_0x1971bb[_0x18d3('0x24')][_0x18d3('0x26')]);}logger[_0x18d3('0x24')](_0x18d3('0x21'),_0xb54548,_0x1971bb[_0x18d3('0x24')][_0x18d3('0x26')]);return _0x1a9808(_0x1971bb['error']['message']);}else{logger[_0x18d3('0x20')](_0x18d3('0x21'),_0xb54548,_0x18d3('0x27'));_0x1a9808(_0x1971bb['result'][_0x18d3('0x26')]);}})[_0x18d3('0x28')](function(_0x547349){logger[_0x18d3('0x24')](_0x18d3('0x21'),_0xb54548,_0x547349);_0x1e8856(_0x547349);});});}function respondWithStatusCode(_0x48eeb4,_0x181db9){_0x181db9=_0x181db9||0xcc;return function(_0x124423){if(_0x124423){return _0x48eeb4['sendStatus'](_0x181db9);}return _0x48eeb4['status'](_0x181db9)[_0x18d3('0x29')]();};}function respondWithResult(_0x42a022,_0x59e728){_0x59e728=_0x59e728||0xc8;return function(_0x4a3fd2){if(_0x4a3fd2){return _0x42a022['status'](_0x59e728)[_0x18d3('0x2a')](_0x4a3fd2);}};}function respondWithFilteredResult(_0x2ab49d,_0x4cac59){return function(_0x615068){if(_0x615068){var _0x28d5dd=typeof _0x4cac59[_0x18d3('0x2b')]===_0x18d3('0x2c')&&typeof _0x4cac59['limit']===_0x18d3('0x2c');var _0x487851=_0x615068['count'];var _0x3349f2=_0x28d5dd?0x0:_0x4cac59['offset'];var _0x8605e1=_0x28d5dd?_0x615068[_0x18d3('0x2d')]:_0x4cac59['offset']+_0x4cac59[_0x18d3('0x2e')];var _0x3f6c40;if(_0x8605e1>=_0x487851){_0x8605e1=_0x487851;_0x3f6c40=0xc8;}else{_0x3f6c40=0xce;}_0x2ab49d[_0x18d3('0x2f')](_0x3f6c40);return _0x2ab49d[_0x18d3('0x30')](_0x18d3('0x31'),_0x3349f2+'-'+_0x8605e1+'/'+_0x487851)['json'](_0x615068);}return null;};}function patchUpdates(_0x25e192){return function(_0x12bf6f){try{jsonpatch[_0x18d3('0x32')](_0x12bf6f,_0x25e192,!![]);}catch(_0x2081e6){return BPromise[_0x18d3('0x33')](_0x2081e6);}return _0x12bf6f[_0x18d3('0x34')]();};}function saveUpdates(_0x37ceec,_0x443ebf){return function(_0x1e91c8){if(_0x1e91c8){return _0x1e91c8[_0x18d3('0x35')](_0x37ceec)[_0x18d3('0x1f')](function(_0x15eba2){return _0x15eba2;});}return null;};}function removeEntity(_0x257e21,_0x5e3d7c){return function(_0x22f934){if(_0x22f934){return _0x22f934[_0x18d3('0x36')]()[_0x18d3('0x1f')](function(){_0x257e21[_0x18d3('0x2f')](0xcc)[_0x18d3('0x29')]();});}};}function handleEntityNotFound(_0x1823ac,_0x346fd3){return function(_0x252835){if(!_0x252835){_0x1823ac['sendStatus'](0x194);}return _0x252835;};}function handleError(_0x406797,_0x40890f){_0x40890f=_0x40890f||0x1f4;return function(_0x56935d){logger[_0x18d3('0x24')](_0x56935d[_0x18d3('0x37')]);if(_0x56935d[_0x18d3('0x38')]){delete _0x56935d[_0x18d3('0x38')];}_0x406797[_0x18d3('0x2f')](_0x40890f)[_0x18d3('0x39')](_0x56935d);};}exports[_0x18d3('0x3a')]=function(_0x1db468,_0x3b34a4){var _0x2a3d69={},_0x231460={},_0x637618={'count':0x0,'rows':[]};var _0x54ce9a=_[_0x18d3('0x3b')](db[_0x18d3('0x3c')]['rawAttributes'],function(_0x2a245a){return{'name':_0x2a245a[_0x18d3('0x3d')],'type':_0x2a245a[_0x18d3('0x3e')]['key']};});_0x231460['model']=_[_0x18d3('0x3b')](_0x54ce9a,'name');_0x231460['query']=_['keys'](_0x1db468[_0x18d3('0x3f')]);_0x231460[_0x18d3('0x40')]=_[_0x18d3('0x41')](_0x231460[_0x18d3('0x42')],_0x231460[_0x18d3('0x3f')]);_0x2a3d69['attributes']=_[_0x18d3('0x41')](_0x231460[_0x18d3('0x42')],qs[_0x18d3('0x43')](_0x1db468['query'][_0x18d3('0x43')]));_0x2a3d69['attributes']=_0x2a3d69[_0x18d3('0x44')][_0x18d3('0x45')]?_0x2a3d69[_0x18d3('0x44')]:_0x231460[_0x18d3('0x42')];if(!_0x1db468[_0x18d3('0x3f')][_0x18d3('0x46')](_0x18d3('0x47'))){_0x2a3d69[_0x18d3('0x2e')]=qs[_0x18d3('0x2e')](_0x1db468[_0x18d3('0x3f')][_0x18d3('0x2e')]);_0x2a3d69[_0x18d3('0x2b')]=qs[_0x18d3('0x2b')](_0x1db468[_0x18d3('0x3f')][_0x18d3('0x2b')]);}_0x2a3d69[_0x18d3('0x48')]=qs['sort'](_0x1db468[_0x18d3('0x3f')][_0x18d3('0x49')]);_0x2a3d69[_0x18d3('0x4a')]=qs['filters'](_[_0x18d3('0x4b')](_0x1db468[_0x18d3('0x3f')],_0x231460[_0x18d3('0x40')]),_0x54ce9a);if(_0x1db468[_0x18d3('0x3f')][_0x18d3('0x4c')]){_0x2a3d69[_0x18d3('0x4a')]=_[_0x18d3('0x4d')](_0x2a3d69[_0x18d3('0x4a')],{'$or':_[_0x18d3('0x3b')](_0x54ce9a,function(_0x1ea676){if(_0x1ea676['type']!==_0x18d3('0x4e')){var _0x4c5ca3={};_0x4c5ca3[_0x1ea676[_0x18d3('0x38')]]={'$like':'%'+_0x1db468[_0x18d3('0x3f')][_0x18d3('0x4c')]+'%'};return _0x4c5ca3;}})});}_0x2a3d69=_[_0x18d3('0x4d')]({},_0x2a3d69,_0x1db468[_0x18d3('0x4f')]);var _0x13d7a3={'where':_0x2a3d69[_0x18d3('0x4a')]};return db[_0x18d3('0x3c')][_0x18d3('0x2d')](_0x13d7a3)[_0x18d3('0x1f')](function(_0x4f15a8){_0x637618[_0x18d3('0x2d')]=_0x4f15a8;if(_0x1db468[_0x18d3('0x3f')][_0x18d3('0x50')]){_0x2a3d69['include']=[{'all':!![]}];}return db[_0x18d3('0x3c')][_0x18d3('0x51')](_0x2a3d69);})['then'](function(_0x535cf7){_0x637618[_0x18d3('0x52')]=_0x535cf7;return _0x637618;})[_0x18d3('0x1f')](respondWithFilteredResult(_0x3b34a4,_0x2a3d69))[_0x18d3('0x28')](handleError(_0x3b34a4,null));};exports['show']=function(_0x47a473,_0x58876f){var _0x2601a3={'raw':!![],'where':{'id':_0x47a473[_0x18d3('0x53')]['id']}},_0x438e01={};_0x438e01['model']=_['keys'](db[_0x18d3('0x3c')][_0x18d3('0x54')]);_0x438e01[_0x18d3('0x3f')]=_[_0x18d3('0x55')](_0x47a473['query']);_0x438e01[_0x18d3('0x40')]=_[_0x18d3('0x41')](_0x438e01[_0x18d3('0x42')],_0x438e01[_0x18d3('0x3f')]);_0x2601a3[_0x18d3('0x44')]=_['intersection'](_0x438e01[_0x18d3('0x42')],qs[_0x18d3('0x43')](_0x47a473['query'][_0x18d3('0x43')]));_0x2601a3[_0x18d3('0x44')]=_0x2601a3[_0x18d3('0x44')][_0x18d3('0x45')]?_0x2601a3[_0x18d3('0x44')]:_0x438e01[_0x18d3('0x42')];if(_0x47a473['query'][_0x18d3('0x50')]){_0x2601a3[_0x18d3('0x56')]=[{'all':!![]}];}_0x2601a3=_[_0x18d3('0x4d')]({},_0x2601a3,_0x47a473[_0x18d3('0x4f')]);return db[_0x18d3('0x3c')]['find'](_0x2601a3)[_0x18d3('0x1f')](handleEntityNotFound(_0x58876f,null))['then'](respondWithResult(_0x58876f,null))[_0x18d3('0x28')](handleError(_0x58876f,null));};exports[_0x18d3('0x35')]=function(_0x5e38fc,_0x484161){if(_0x5e38fc['body']['id']){delete _0x5e38fc[_0x18d3('0x57')]['id'];}return db[_0x18d3('0x3c')][_0x18d3('0x58')]({'where':{'id':_0x5e38fc[_0x18d3('0x53')]['id']}})[_0x18d3('0x1f')](handleEntityNotFound(_0x484161,null))[_0x18d3('0x1f')](saveUpdates(_0x5e38fc['body'],null))[_0x18d3('0x1f')](respondWithResult(_0x484161,null))['catch'](handleError(_0x484161,null));};exports[_0x18d3('0x36')]=function(_0x352c3e,_0x2f35ec){return db[_0x18d3('0x3c')][_0x18d3('0x58')]({'where':{'id':_0x352c3e['params']['id']}})['then'](handleEntityNotFound(_0x2f35ec,null))['then'](removeEntity(_0x2f35ec,null))[_0x18d3('0x28')](handleError(_0x2f35ec,null));};exports[_0x18d3('0x59')]=function(_0x39644c,_0x1bfdde){return db[_0x18d3('0x3c')][_0x18d3('0x59')]()[_0x18d3('0x1f')](respondWithResult(_0x1bfdde,null))[_0x18d3('0x28')](handleError(_0x1bfdde,null));};var interaction_log=require(_0x18d3('0x13'))('fax-interactions');exports['accept']=function(_0x3d3a5d,_0x3adda5,_0xd0540){var _0x167d45={'agent':{},'channel':_0x18d3('0x5a')};if(_0x3d3a5d[_0x18d3('0x57')]['id']){delete _0x3d3a5d[_0x18d3('0x57')]['id'];}_0x3d3a5d[_0x18d3('0x57')]['read']=!![];_0x3d3a5d[_0x18d3('0x57')][_0x18d3('0x5b')]=moment()['format'](_0x18d3('0x5c'));_0x3d3a5d[_0x18d3('0x57')][_0x18d3('0x5d')]=_0x3d3a5d[_0x18d3('0x57')][_0x18d3('0x5d')]||_0x3d3a5d['user']['id'];_0x167d45[_0x18d3('0x5e')]['id']=_0x3d3a5d[_0x18d3('0x57')][_0x18d3('0x5d')];return db[_0x18d3('0x3c')][_0x18d3('0x58')]({'where':{'id':_0x3d3a5d[_0x18d3('0x53')]['id'],'UserId':null}})[_0x18d3('0x1f')](handleEntityNotFound(_0x3adda5,null))[_0x18d3('0x1f')](saveUpdates(_0x3d3a5d[_0x18d3('0x57')],null))[_0x18d3('0x1f')](function(_0x3d4da8){if(_0x3d4da8){_0x167d45['message']=_0x3d4da8['get']({'plain':!![]});return db[_0x18d3('0x5f')][_0x18d3('0x58')]({'where':{'id':_0x3d4da8[_0x18d3('0x60')]}});}return null;})[_0x18d3('0x1f')](handleEntityNotFound(_0x3adda5,null))['then'](function(_0x4ab8af){if(_0x4ab8af){return _0x4ab8af[_0x18d3('0x35')]({'UserId':_0x3d3a5d[_0x18d3('0x57')][_0x18d3('0x5d')],'read1stAt':_[_0x18d3('0x61')](_0x4ab8af[_0x18d3('0x62')])?moment()[_0x18d3('0x63')](_0x18d3('0x5c')):undefined});}return null;})[_0x18d3('0x1f')](function(_0xd5969b){if(_0xd5969b){_0x167d45['interaction']=_0xd5969b['get']({'plain':!![]});interaction_log[_0x18d3('0x20')](_0x18d3('0x64'),_0x3d3a5d[_0x18d3('0x65')]['id'],_0x3d3a5d[_0x18d3('0x65')]['name'],_0x3d3a5d[_0x18d3('0x65')][_0x18d3('0x66')],_0x167d45[_0x18d3('0x67')]['id'],_0x3d3a5d[_0x18d3('0x57')]?JSON[_0x18d3('0x23')](_0x3d3a5d[_0x18d3('0x57')]):_0x18d3('0x68'));return respondWithRpcPromise(_0x18d3('0x69'),'acceptMessage',_0x167d45);}return null;})[_0x18d3('0x1f')](function(_0x30e68c){var _0x3c6f23=_0x18d3('0x6a')+_0x30e68c['message'][_0x18d3('0x6b')];return db['sequelize']['query'](_0x3c6f23,{'type':db[_0x18d3('0x6c')]['QueryTypes'][_0x18d3('0x6d')],'raw':!![]})[_0x18d3('0x1f')](function(_0x534bd8){return _0x534bd8;});})[_0x18d3('0x1f')](function(_0x1c558a){if(_0x1c558a){_0x167d45[_0x18d3('0x26')][_0x18d3('0x6e')]=_0x1c558a[0x0];if(!_0x3d3a5d[_0x18d3('0x57')][_0x18d3('0x5d')])return;return db['User'][_0x18d3('0x58')]({'where':{'id':_0x3d3a5d['body']['UserId'],'role':_0x18d3('0x5e')},'attributes':['id','name',_0x18d3('0x6f'),'email',_0x18d3('0x70')],'raw':!![]});}return null;})[_0x18d3('0x1f')](function(_0x4e6803){if(!_0x4e6803)return null;_0x167d45[_0x18d3('0x26')][_0x18d3('0x5e')]=_0x4e6803;return _0x167d45;})[_0x18d3('0x1f')](function(_0x2c7f22){if(_0x2c7f22){if(_0x3d3a5d[_0x18d3('0x57')]['manual']){_0x167d45[_0x18d3('0x26')][_0x18d3('0x71')]=util['format'](_0x18d3('0x72'),_0x3d3a5d[_0x18d3('0x65')][_0x18d3('0x38')]);_0x167d45[_0x18d3('0x26')][_0x18d3('0x73')]=_0x167d45['channel'];_0x167d45['message'][_0x18d3('0x74')]=_0x167d45['channel'];_0x167d45[_0x18d3('0x26')]['event']=_0x18d3('0x75');return respondWithRpcPromise(_0x18d3('0x76'),'EventManager',{'event':_0x18d3('0x77'),'message':_0x167d45['message']},client9002)[_0x18d3('0x1f')](function(){return _0x167d45;});}return _0x167d45;}return null;})[_0x18d3('0x1f')](respondWithResult(_0x3adda5,null))[_0x18d3('0x28')](handleError(_0x3adda5,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['reject']=function(_0x882204,_0x3c8d14,_0x2b3037){var _0x598d87={'agent':{},'channel':'fax'};if(_0x882204['body']['id']){delete _0x882204[_0x18d3('0x57')]['id'];}_0x882204['body'][_0x18d3('0x5d')]=_0x882204[_0x18d3('0x57')][_0x18d3('0x5d')]||_0x882204['user']['id'];_0x598d87[_0x18d3('0x5e')]['id']=_0x882204[_0x18d3('0x57')][_0x18d3('0x5d')];return db['FaxMessage'][_0x18d3('0x58')]({'where':{'id':_0x882204[_0x18d3('0x53')]['id'],'UserId':null}})[_0x18d3('0x1f')](handleEntityNotFound(_0x3c8d14,null))[_0x18d3('0x1f')](function(_0x155931){if(_0x155931){_0x598d87['message']=_0x155931[_0x18d3('0x78')]({'plain':!![]});return db[_0x18d3('0x5f')][_0x18d3('0x58')]({'where':{'id':_0x155931[_0x18d3('0x60')]}});}return null;})[_0x18d3('0x1f')](handleEntityNotFound(_0x3c8d14,null))['then'](function(_0x3cd582){if(_0x3cd582){_0x598d87[_0x18d3('0x67')]=_0x3cd582[_0x18d3('0x78')]({'plain':!![]});interaction_log[_0x18d3('0x20')](_0x18d3('0x79'),_0x882204['user']['id'],_0x882204['user'][_0x18d3('0x38')],_0x882204[_0x18d3('0x65')][_0x18d3('0x66')],_0x598d87[_0x18d3('0x67')]['id'],_0x882204['body']?JSON[_0x18d3('0x23')](_0x882204[_0x18d3('0x57')]):_0x18d3('0x68'));return respondWithRpcPromise(_0x18d3('0x7a'),_0x18d3('0x7b'),_0x598d87);}return null;})[_0x18d3('0x1f')](function(_0x54e08a){var _0x36ed15='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x54e08a[_0x18d3('0x26')][_0x18d3('0x6b')];return db[_0x18d3('0x7c')]['query'](_0x36ed15,{'type':db[_0x18d3('0x6c')][_0x18d3('0x7d')][_0x18d3('0x6d')],'raw':!![]})[_0x18d3('0x1f')](function(_0x50f667){return _0x50f667;});})[_0x18d3('0x1f')](function(_0x18167f){if(_0x18167f){_0x598d87['message']['contact']=_0x18167f[0x0];if(!_0x882204[_0x18d3('0x57')]['UserId'])return;return db[_0x18d3('0x7e')][_0x18d3('0x58')]({'where':{'id':_0x882204[_0x18d3('0x57')][_0x18d3('0x5d')],'role':_0x18d3('0x5e')},'attributes':['id',_0x18d3('0x38'),_0x18d3('0x6f'),_0x18d3('0x7f'),'internal'],'raw':!![]});}return null;})[_0x18d3('0x1f')](function(_0x3b4c0a){if(!_0x3b4c0a)return null;_0x598d87[_0x18d3('0x26')][_0x18d3('0x5e')]=_0x3b4c0a;return _0x598d87;})[_0x18d3('0x1f')](function(_0x10e903){if(_0x10e903){_0x10e903['message'][_0x18d3('0x71')]=util[_0x18d3('0x63')](_0x18d3('0x72'),_0x882204[_0x18d3('0x65')][_0x18d3('0x38')]);_0x10e903[_0x18d3('0x26')][_0x18d3('0x73')]=_0x598d87[_0x18d3('0x73')];_0x10e903[_0x18d3('0x26')][_0x18d3('0x74')]=_0x598d87['channel'];_0x10e903[_0x18d3('0x26')]['event']=_0x18d3('0x33');respondWithRpcPromise(_0x18d3('0x76'),_0x18d3('0x76'),{'event':_0x18d3('0x80'),'message':_0x10e903[_0x18d3('0x26')]},client9002);return _0x598d87;}return null;})[_0x18d3('0x1f')](respondWithResult(_0x3c8d14,null))['catch'](handleError(_0x3c8d14,null));};exports[_0x18d3('0x81')]=function(_0x59b26d,_0x2a5482){var _0x516b69;return db[_0x18d3('0x3c')][_0x18d3('0x81')](_0x59b26d['body'],{})[_0x18d3('0x1f')](function(_0x57eb36){_0x516b69=_0x57eb36;return db[_0x18d3('0x82')][_0x18d3('0x83')]({'where':{'id':_0x516b69[_0x18d3('0x6b')]}});})[_0x18d3('0x1f')](function(_0x8e5973){if(_[_0x18d3('0x61')](_0x8e5973)){return;}else{_0x516b69[_0x18d3('0x5a')]=_0x8e5973[_0x18d3('0x5a')];return db[_0x18d3('0x84')][_0x18d3('0x83')]({'where':{'id':_0x516b69['AttachmentId']}});}})[_0x18d3('0x1f')](function(_0x4af751){return respondWithRpcPromise('SendFax',_0x18d3('0x85'),{'FaxAccountId':_[_0x18d3('0x61')](_0x59b26d['body'])?undefined:_0x59b26d[_0x18d3('0x57')]['FaxAccountId'],'path':_[_0x18d3('0x61')](_0x4af751)?undefined:util['format'](_0x18d3('0x86'),_0x4af751[_0x18d3('0x87')]),'fax':_[_0x18d3('0x61')](_0x516b69['fax'])?undefined:_0x516b69[_0x18d3('0x5a')],'AttachmentId':_0x516b69[_0x18d3('0x88')]},client9002);})[_0x18d3('0x1f')](respondWithResult(_0x2a5482,0xc9))['catch'](handleError(_0x2a5482,null));};exports['download']=function(_0x2f17bc,_0x41e3ea){var _0x4adb36=path[_0x18d3('0x89')](config[_0x18d3('0x8a')],_0x18d3('0x8b'),_0x18d3('0x8c'),_0x18d3('0x8d'));return db[_0x18d3('0x3c')][_0x18d3('0x58')]({'where':{'id':_0x2f17bc['params']['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x18d3('0x1f')](handleEntityNotFound(_0x41e3ea,null))[_0x18d3('0x1f')](function(_0x2becdf){if(_0x2becdf){return _0x41e3ea['download'](path[_0x18d3('0x89')](_0x4adb36,_0x2becdf[_0x18d3('0x84')][_0x18d3('0x87')]));}})[_0x18d3('0x28')](handleError(_0x41e3ea,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index f8216a5..0267c0d 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 _0x82c4=['FaxMessage','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x21c48,_0x49ac0a){var _0x1f2cea=function(_0x51a5eb){while(--_0x51a5eb){_0x21c48['push'](_0x21c48['shift']());}};_0x1f2cea(++_0x49ac0a);}(_0x82c4,0x1ca));var _0x482c=function(_0xb54b31,_0x4ac97c){_0xb54b31=_0xb54b31-0x0;var _0x49d88b=_0x82c4[_0xb54b31];return _0x49d88b;};'use strict';var EventEmitter=require(_0x482c('0x0'));var FaxMessage=require(_0x482c('0x1'))['db'][_0x482c('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x482c('0x3')](0x0);var events={'afterCreate':_0x482c('0x4'),'afterUpdate':_0x482c('0x5'),'afterDestroy':_0x482c('0x6')};function emitEvent(_0x56de13){return function(_0x16b0f8,_0x5f4dee,_0x4556c8){FaxMessageEvents['emit'](_0x56de13+':'+_0x16b0f8['id'],_0x16b0f8);FaxMessageEvents[_0x482c('0x7')](_0x56de13,_0x16b0f8);_0x4556c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x482c('0x8')](e,emitEvent(event));}}module[_0x482c('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xaa37=['../../mysqldb','FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x182648,_0x2a7b01){var _0x10d106=function(_0x343645){while(--_0x343645){_0x182648['push'](_0x182648['shift']());}};_0x10d106(++_0x2a7b01);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xaa37[_0x21549c];return _0x426cbd;};'use strict';var EventEmitter=require(_0x7aa3('0x0'));var FaxMessage=require(_0x7aa3('0x1'))['db'][_0x7aa3('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7aa3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7aa3('0x4'),'afterDestroy':_0x7aa3('0x5')};function emitEvent(_0x27333d){return function(_0x11e64c,_0x334919,_0x2801a2){FaxMessageEvents[_0x7aa3('0x6')](_0x27333d+':'+_0x11e64c['id'],_0x11e64c);FaxMessageEvents['emit'](_0x27333d,_0x11e64c);_0x2801a2(null);};}for(var e in events){if(events[_0x7aa3('0x7')](e)){var event=events[e];FaxMessage[_0x7aa3('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 73b6b7e..d24bda3 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 _0xbe0a=['createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','then','update'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xbe0a,0x154));var _0xabe0=function(_0x4bb6e6,_0x53f839){_0x4bb6e6=_0x4bb6e6-0x0;var _0x5b37d4=_0xbe0a[_0x4bb6e6];return _0x5b37d4;};'use strict';var _=require(_0xabe0('0x0'));var util=require(_0xabe0('0x1'));var logger=require(_0xabe0('0x2'))('api');var moment=require(_0xabe0('0x3'));var BPromise=require(_0xabe0('0x4'));var rp=require(_0xabe0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabe0('0x6'));var config=require(_0xabe0('0x7'));var attributes=require(_0xabe0('0x8'));module['exports']=function(_0x4fb575,_0x3ef4ae){return _0x4fb575[_0xabe0('0x9')]('FaxMessage',attributes,{'tableName':_0xabe0('0xa'),'paranoid':![],'indexes':[{'name':_0xabe0('0xb'),'fields':[_0xabe0('0xc')],'type':_0xabe0('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x288659,_0x164332,_0xaf5422){var _0x10856c=_0x4fb575[_0xabe0('0xe')];var _0x3bf7cb=_0x288659['get']({'plain':!![]});if(_0x3bf7cb[_0xabe0('0xf')][_0xabe0('0x10')]()==='in'||_0x3bf7cb[_0xabe0('0xf')][_0xabe0('0x10')]()===_0xabe0('0x11')&&!_0x3bf7cb['secret']&&!_[_0xabe0('0x12')](_0x3bf7cb[_0xabe0('0x13')])){_0x10856c[_0xabe0('0x14')][_0xabe0('0x15')]({'where':{'id':_0x3bf7cb['FaxInteractionId']}})[_0xabe0('0x16')](function(_0x451854){if(_0x451854){_0x451854[_0xabe0('0x17')]({'lastMsgAt':_0x3bf7cb[_0xabe0('0x18')],'lastMsgDirection':_0x3bf7cb[_0xabe0('0xf')][_0xabe0('0x10')]()});}})['catch'](function(_0x29930f){console[_0xabe0('0x19')](_0x29930f);});}_0xaf5422();}},'charset':_0xabe0('0x1a'),'collate':_0xabe0('0x1b')});}; \ No newline at end of file +var _0xe75e=['FaxInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','fax_messages','fti_fax_messages','body','models','get','toLowerCase','direction','out','secret','FaxInteraction','findOne'];(function(_0x49394b,_0x58c20e){var _0x13ed70=function(_0x4c44bb){while(--_0x4c44bb){_0x49394b['push'](_0x49394b['shift']());}};_0x13ed70(++_0x58c20e);}(_0xe75e,0x19d));var _0xee75=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0xe75e[_0x356127];return _0x5d4c75;};'use strict';var _=require(_0xee75('0x0'));var util=require(_0xee75('0x1'));var logger=require(_0xee75('0x2'))(_0xee75('0x3'));var moment=require('moment');var BPromise=require(_0xee75('0x4'));var rp=require(_0xee75('0x5'));var fs=require('fs');var path=require(_0xee75('0x6'));var rimraf=require(_0xee75('0x7'));var config=require(_0xee75('0x8'));var attributes=require('./faxMessage.attributes');module[_0xee75('0x9')]=function(_0x32fb1c,_0x670e6c){return _0x32fb1c[_0xee75('0xa')]('FaxMessage',attributes,{'tableName':_0xee75('0xb'),'paranoid':![],'indexes':[{'name':_0xee75('0xc'),'fields':[_0xee75('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57c79e,_0x2f9ee6,_0x266542){var _0x52e8e7=_0x32fb1c[_0xee75('0xe')];var _0x56dffb=_0x57c79e[_0xee75('0xf')]({'plain':!![]});if(_0x56dffb['direction'][_0xee75('0x10')]()==='in'||_0x56dffb[_0xee75('0x11')][_0xee75('0x10')]()===_0xee75('0x12')&&!_0x56dffb[_0xee75('0x13')]&&!_['isNil'](_0x56dffb['UserId'])){_0x52e8e7[_0xee75('0x14')][_0xee75('0x15')]({'where':{'id':_0x56dffb[_0xee75('0x16')]}})[_0xee75('0x17')](function(_0x237f49){if(_0x237f49){_0x237f49[_0xee75('0x18')]({'lastMsgAt':_0x56dffb[_0xee75('0x19')],'lastMsgDirection':_0x56dffb[_0xee75('0x11')][_0xee75('0x10')]()});}})[_0xee75('0x1a')](function(_0x3263ec){console[_0xee75('0x1b')](_0x3263ec);});}_0x266542();}},'charset':'utf8mb4','collate':_0xee75('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index a9198ca..5e0761e 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 _0xd0bb=['CreateFaxMessage','FaxMessage','create','body','options','update','raw','where','attributes','limit','UpdateFaxMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x552041,_0xc34ee7){var _0x198a1a=function(_0x432f54){while(--_0x432f54){_0x552041['push'](_0x552041['shift']());}};_0x198a1a(++_0xc34ee7);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xd0bb[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var moment=require(_0xbd0b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd0b('0x4'))['db'];var utils=require(_0xbd0b('0x5'));var logger=require('../../config/logger')(_0xbd0b('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd0b('0x7'));var client=jayson[_0xbd0b('0x8')][_0xbd0b('0x9')]({'port':0x232a});config[_0xbd0b('0xa')]=_[_0xbd0b('0xb')](config['redis'],{'host':_0xbd0b('0xc'),'port':0x18eb});var socket=require(_0xbd0b('0xd'))(new Redis(config[_0xbd0b('0xa')]));require(_0xbd0b('0xe'))[_0xbd0b('0xf')](socket);function respondWithRpcPromise(_0x53d5e8,_0x51cf98,_0x14bc5b){return new BPromise(function(_0x110cf1,_0x4a69ff){return client[_0xbd0b('0x10')](_0x53d5e8,_0x14bc5b)[_0xbd0b('0x11')](function(_0x526258){logger[_0xbd0b('0x12')](_0xbd0b('0x13'),_0x51cf98,_0xbd0b('0x14'));logger[_0xbd0b('0x15')](_0xbd0b('0x16'),_0x51cf98,_0xbd0b('0x14'),JSON[_0xbd0b('0x17')](_0x526258));if(_0x526258[_0xbd0b('0x18')]){if(_0x526258[_0xbd0b('0x18')][_0xbd0b('0x19')]===0x1f4){logger[_0xbd0b('0x18')]('FaxMessage,\x20%s,\x20%s',_0x51cf98,_0x526258[_0xbd0b('0x18')]['message']);return _0x4a69ff(_0x526258['error'][_0xbd0b('0x1a')]);}logger[_0xbd0b('0x18')](_0xbd0b('0x13'),_0x51cf98,_0x526258[_0xbd0b('0x18')][_0xbd0b('0x1a')]);return _0x110cf1(_0x526258['error']['message']);}else{logger[_0xbd0b('0x12')](_0xbd0b('0x13'),_0x51cf98,_0xbd0b('0x14'));_0x110cf1(_0x526258[_0xbd0b('0x1b')][_0xbd0b('0x1a')]);}})[_0xbd0b('0x1c')](function(_0x5aeb79){logger[_0xbd0b('0x18')]('FaxMessage,\x20%s,\x20%s',_0x51cf98,_0x5aeb79);_0x4a69ff(_0x5aeb79);});});}exports[_0xbd0b('0x1d')]=function(_0x475801){var _0x2d02d0=this;return new Promise(function(_0x3053bb,_0x4b312d){return db[_0xbd0b('0x1e')][_0xbd0b('0x1f')](_0x475801[_0xbd0b('0x20')],{'raw':_0x475801['options']?_0x475801[_0xbd0b('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xbd0b('0x11')](function(_0x3c4938){logger[_0xbd0b('0x12')](_0xbd0b('0x1d'),_0x475801);logger[_0xbd0b('0x15')]('CreateFaxMessage',_0x475801,JSON[_0xbd0b('0x17')](_0x3c4938));_0x3053bb(_0x3c4938);})['catch'](function(_0x3e7e9c){logger[_0xbd0b('0x18')](_0xbd0b('0x1d'),_0x3e7e9c[_0xbd0b('0x1a')],_0x475801);_0x4b312d(_0x2d02d0[_0xbd0b('0x18')](0x1f4,_0x3e7e9c[_0xbd0b('0x1a')]));});});};exports['UpdateFaxMessage']=function(_0x382f76){var _0x1b46a3=this;return new Promise(function(_0x33b752,_0x1b5a00){return db[_0xbd0b('0x1e')][_0xbd0b('0x22')](_0x382f76['body'],{'raw':_0x382f76[_0xbd0b('0x21')]?_0x382f76[_0xbd0b('0x21')][_0xbd0b('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x382f76['options']?_0x382f76['options'][_0xbd0b('0x24')]||null:null,'attributes':_0x382f76[_0xbd0b('0x21')]?_0x382f76[_0xbd0b('0x21')][_0xbd0b('0x25')]||null:null,'limit':_0x382f76[_0xbd0b('0x21')]?_0x382f76[_0xbd0b('0x21')][_0xbd0b('0x26')]||null:null})['then'](function(_0x45f7d6){logger[_0xbd0b('0x12')]('UpdateFaxMessage',_0x382f76);logger['debug'](_0xbd0b('0x27'),_0x382f76,JSON[_0xbd0b('0x17')](_0x45f7d6));_0x33b752(_0x45f7d6);})['catch'](function(_0x31bdd3){logger[_0xbd0b('0x18')](_0xbd0b('0x27'),_0x31bdd3[_0xbd0b('0x1a')],_0x382f76);_0x1b5a00(_0x1b46a3[_0xbd0b('0x18')](0x1f4,_0x31bdd3[_0xbd0b('0x1a')]));});});}; \ No newline at end of file +var _0x4bc3=['CreateFaxMessage','FaxMessage','create','body','options','raw','then','stringify','catch','UpdateFaxMessage','update','where','attributes','limit','info','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4bc3,0x16e));var _0x34bc=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x4bc3[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});config[_0x34bc('0xb')]=_['defaults'](config['redis'],{'host':_0x34bc('0xc'),'port':0x18eb});var socket=require(_0x34bc('0xd'))(new Redis(config[_0x34bc('0xb')]));require(_0x34bc('0xe'))[_0x34bc('0xf')](socket);function respondWithRpcPromise(_0x41b2ff,_0x5de8b5,_0x5a478d){return new BPromise(function(_0x2b8112,_0x33025c){return client[_0x34bc('0x10')](_0x41b2ff,_0x5a478d)['then'](function(_0x41960e){logger['info'](_0x34bc('0x11'),_0x5de8b5,_0x34bc('0x12'));logger[_0x34bc('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5de8b5,_0x34bc('0x12'),JSON['stringify'](_0x41960e));if(_0x41960e[_0x34bc('0x14')]){if(_0x41960e[_0x34bc('0x14')][_0x34bc('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x5de8b5,_0x41960e[_0x34bc('0x14')]['message']);return _0x33025c(_0x41960e[_0x34bc('0x14')][_0x34bc('0x16')]);}logger[_0x34bc('0x14')](_0x34bc('0x11'),_0x5de8b5,_0x41960e[_0x34bc('0x14')][_0x34bc('0x16')]);return _0x2b8112(_0x41960e['error']['message']);}else{logger['info'](_0x34bc('0x11'),_0x5de8b5,_0x34bc('0x12'));_0x2b8112(_0x41960e[_0x34bc('0x17')][_0x34bc('0x16')]);}})['catch'](function(_0x46aa24){logger[_0x34bc('0x14')]('FaxMessage,\x20%s,\x20%s',_0x5de8b5,_0x46aa24);_0x33025c(_0x46aa24);});});}exports[_0x34bc('0x18')]=function(_0x9e9f14){var _0x4d2d5e=this;return new Promise(function(_0x14cec8,_0x26cdec){return db[_0x34bc('0x19')][_0x34bc('0x1a')](_0x9e9f14[_0x34bc('0x1b')],{'raw':_0x9e9f14[_0x34bc('0x1c')]?_0x9e9f14['options'][_0x34bc('0x1d')]===undefined?!![]:![]:!![]})[_0x34bc('0x1e')](function(_0x38882c){logger['info']('CreateFaxMessage',_0x9e9f14);logger[_0x34bc('0x13')](_0x34bc('0x18'),_0x9e9f14,JSON[_0x34bc('0x1f')](_0x38882c));_0x14cec8(_0x38882c);})[_0x34bc('0x20')](function(_0x13094a){logger[_0x34bc('0x14')](_0x34bc('0x18'),_0x13094a[_0x34bc('0x16')],_0x9e9f14);_0x26cdec(_0x4d2d5e[_0x34bc('0x14')](0x1f4,_0x13094a[_0x34bc('0x16')]));});});};exports[_0x34bc('0x21')]=function(_0x1edcb0){var _0x4fd589=this;return new Promise(function(_0x43e527,_0x48ec13){return db['FaxMessage'][_0x34bc('0x22')](_0x1edcb0['body'],{'raw':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1edcb0['options']?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x23')]||null:null,'attributes':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x24')]||null:null,'limit':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0['options'][_0x34bc('0x25')]||null:null})[_0x34bc('0x1e')](function(_0x22aacc){logger[_0x34bc('0x26')](_0x34bc('0x21'),_0x1edcb0);logger[_0x34bc('0x13')]('UpdateFaxMessage',_0x1edcb0,JSON[_0x34bc('0x1f')](_0x22aacc));_0x43e527(_0x22aacc);})['catch'](function(_0x530748){logger[_0x34bc('0x14')]('UpdateFaxMessage',_0x530748[_0x34bc('0x16')],_0x1edcb0);_0x48ec13(_0x4fd589[_0x34bc('0x14')](0x1f4,_0x530748[_0x34bc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 018a7c0..39def8e 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 _0xc30f=['./faxMessage.events','remove','removeListener','register','length','faxMessage:'];(function(_0x1fe4db,_0x5d8d20){var _0x5cf08f=function(_0x5329ce){while(--_0x5329ce){_0x1fe4db['push'](_0x1fe4db['shift']());}};_0x5cf08f(++_0x5d8d20);}(_0xc30f,0x174));var _0xfc30=function(_0x103e64,_0xc1b17d){_0x103e64=_0x103e64-0x0;var _0x4e8bb5=_0xc30f[_0x103e64];return _0x4e8bb5;};'use strict';var FaxMessageEvents=require(_0xfc30('0x0'));var events=['save',_0xfc30('0x1'),'update'];function createListener(_0x2120ae,_0x1f0788){return function(_0xed1931){_0x1f0788['emit'](_0x2120ae,_0xed1931);};}function removeListener(_0x50b1f2,_0x451456){return function(){FaxMessageEvents[_0xfc30('0x2')](_0x50b1f2,_0x451456);};}exports[_0xfc30('0x3')]=function(_0x510e6b){for(var _0x210b5b=0x0,_0x107a01=events[_0xfc30('0x4')];_0x210b5b<_0x107a01;_0x210b5b++){var _0xad8d14=events[_0x210b5b];var _0x2c8675=createListener(_0xfc30('0x5')+_0xad8d14,_0x510e6b);FaxMessageEvents['on'](_0xad8d14,_0x2c8675);}}; \ No newline at end of file +var _0xd5c7=['length','faxMessage:','./faxMessage.events','save','remove','update','removeListener'];(function(_0x1869ef,_0x3db9ef){var _0x9e4059=function(_0x379083){while(--_0x379083){_0x1869ef['push'](_0x1869ef['shift']());}};_0x9e4059(++_0x3db9ef);}(_0xd5c7,0x13d));var _0x7d5c=function(_0x486c36,_0x533c42){_0x486c36=_0x486c36-0x0;var _0x26370c=_0xd5c7[_0x486c36];return _0x26370c;};'use strict';var FaxMessageEvents=require(_0x7d5c('0x0'));var events=[_0x7d5c('0x1'),_0x7d5c('0x2'),_0x7d5c('0x3')];function createListener(_0x150160,_0x125c7b){return function(_0x525b42){_0x125c7b['emit'](_0x150160,_0x525b42);};}function removeListener(_0x5a4276,_0x1050bd){return function(){FaxMessageEvents[_0x7d5c('0x4')](_0x5a4276,_0x1050bd);};}exports['register']=function(_0x65cbe1){for(var _0x4ef71f=0x0,_0x23ea13=events[_0x7d5c('0x5')];_0x4ef71f<_0x23ea13;_0x4ef71f++){var _0x4477f0=events[_0x4ef71f];var _0x161b64=createListener(_0x7d5c('0x6')+_0x4477f0,_0x65cbe1);FaxMessageEvents['on'](_0x4477f0,_0x161b64);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 4a2518e..98c0b58 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 _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(_0x58c851,_0x1f3d96){var _0x534d8a=function(_0x10c1a0){while(--_0x10c1a0){_0x58c851['push'](_0x58c851['shift']());}};_0x534d8a(++_0x1f3d96);}(_0x1be1,0x192));var _0x11be=function(_0x5dab5b,_0x2f0223){_0x5dab5b=_0x5dab5b-0x0;var _0x13fe96=_0x1be1[_0x5dab5b];return _0x13fe96;};'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 +var _0x4ded=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','describe','download','fax','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x357a2b,_0x592aaa){var _0x56903f=function(_0x464180){while(--_0x464180){_0x357a2b['push'](_0x357a2b['shift']());}};_0x56903f(++_0x592aaa);}(_0x4ded,0x116));var _0xd4de=function(_0x425c03,_0x3101e4){_0x425c03=_0x425c03-0x0;var _0x3d0592=_0x4ded[_0x425c03];return _0x3d0592;};'use strict';var multer=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var path=require(_0xd4de('0x2'));var timeout=require(_0xd4de('0x3'));var express=require(_0xd4de('0x4'));var router=express[_0xd4de('0x5')]();var fs_extra=require(_0xd4de('0x6'));var auth=require(_0xd4de('0x7'));var interaction=require(_0xd4de('0x8'));var config=require(_0xd4de('0x9'));var controller=require(_0xd4de('0xa'));router[_0xd4de('0xb')]('/',auth['isAuthenticated'](),controller[_0xd4de('0xc')]);router[_0xd4de('0xb')](_0xd4de('0xd'),auth[_0xd4de('0xe')](),controller[_0xd4de('0xf')]);router[_0xd4de('0xb')]('/:id',auth[_0xd4de('0xe')](),controller['show']);router['get']('/:id/download',auth[_0xd4de('0xe')](),controller[_0xd4de('0x10')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xd4de('0x11'),'faxmessage:create'),controller[_0xd4de('0x12')]);router[_0xd4de('0x13')](_0xd4de('0x14'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x15')]);router[_0xd4de('0x13')](_0xd4de('0x16'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x17')]);router[_0xd4de('0x13')](_0xd4de('0x18'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x19')]);router[_0xd4de('0x1a')](_0xd4de('0x14'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 8083cff..3599ed9 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 _0xdbfd=['exports','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xdbfd,0x18b));var _0xddbf=function(_0x228ca5,_0x2c79d9){_0x228ca5=_0x228ca5-0x0;var _0x2c020b=_0xdbfd[_0x228ca5];return _0x2c020b;};'use strict';var Sequelize=require(_0xddbf('0x0'));module[_0xddbf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xddbf('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xddbf('0x3')]('rrmemory',_0xddbf('0x4'),_0xddbf('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9bcd=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0xaef89c,_0x49d21d){var _0x3cd1bb=function(_0x196451){while(--_0x196451){_0xaef89c['push'](_0xaef89c['shift']());}};_0x3cd1bb(++_0x49d21d);}(_0x9bcd,0xe7));var _0xd9bc=function(_0x5ecafa,_0x22738f){_0x5ecafa=_0x5ecafa-0x0;var _0x5b2a33=_0x9bcd[_0x5ecafa];return _0x5b2a33;};'use strict';var Sequelize=require(_0xd9bc('0x0'));module[_0xd9bc('0x1')]={'name':{'type':Sequelize[_0xd9bc('0x2')],'unique':_0xd9bc('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd9bc('0x2')]},'timeout':{'type':Sequelize[_0xd9bc('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd9bc('0x5')](_0xd9bc('0x6'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xd9bc('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index e127f83..13f99c3 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 _0x45da=['register','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','FaxQueue','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','filter','options','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','User','Agents','online','interface','transaction','addTeams','findOrCreate','forEach','userFaxQueue:save','ids','select','tq.TeamId','from','team_has_fax_queues','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket'];(function(_0x2a1133,_0x43bccf){var _0x124e67=function(_0x351fad){while(--_0x351fad){_0x2a1133['push'](_0x2a1133['shift']());}};_0x124e67(++_0x43bccf);}(_0x45da,0x183));var _0xa45d=function(_0x179ded,_0x5a9b7d){_0x179ded=_0x179ded-0x0;var _0x491a15=_0x45da[_0x179ded];return _0x491a15;};'use strict';var emlformat=require(_0xa45d('0x0'));var rimraf=require(_0xa45d('0x1'));var zipdir=require(_0xa45d('0x2'));var jsonpatch=require(_0xa45d('0x3'));var rp=require('request-promise');var moment=require(_0xa45d('0x4'));var BPromise=require(_0xa45d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa45d('0x6'));var sox=require('sox');var csv=require(_0xa45d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa45d('0x8'));var squel=require(_0xa45d('0x9'));var crypto=require(_0xa45d('0xa'));var jsforce=require(_0xa45d('0xb'));var deskjs=require(_0xa45d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa45d('0xd'));var Papa=require(_0xa45d('0xe'));var Redis=require(_0xa45d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa45d('0x10'));var as=require(_0xa45d('0x11'));var hardwareService=require(_0xa45d('0x12'));var logger=require(_0xa45d('0x13'))('api');var utils=require(_0xa45d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa45d('0x15'));var db=require('../../mysqldb')['db'];config[_0xa45d('0x16')]=_[_0xa45d('0x17')](config[_0xa45d('0x16')],{'host':_0xa45d('0x18'),'port':0x18eb});var socket=require(_0xa45d('0x19'))(new Redis(config[_0xa45d('0x16')]));require(_0xa45d('0x1a'))[_0xa45d('0x1b')](socket);function respondWithStatusCode(_0x4e5f03,_0xb24860){_0xb24860=_0xb24860||0xcc;return function(_0x15574b){if(_0x15574b){return _0x4e5f03['sendStatus'](_0xb24860);}return _0x4e5f03[_0xa45d('0x1c')](_0xb24860)[_0xa45d('0x1d')]();};}function respondWithResult(_0x4ab8b0,_0x294a97){_0x294a97=_0x294a97||0xc8;return function(_0xe12649){if(_0xe12649){return _0x4ab8b0[_0xa45d('0x1c')](_0x294a97)[_0xa45d('0x1e')](_0xe12649);}};}function respondWithFilteredResult(_0x522a3b,_0x2d94e1){return function(_0x3234f2){if(_0x3234f2){var _0x158940=typeof _0x2d94e1[_0xa45d('0x1f')]==='undefined'&&typeof _0x2d94e1['limit']===_0xa45d('0x20');var _0x17670f=_0x3234f2[_0xa45d('0x21')];var _0xabc773=_0x158940?0x0:_0x2d94e1[_0xa45d('0x1f')];var _0x2b2660=_0x158940?_0x3234f2['count']:_0x2d94e1[_0xa45d('0x1f')]+_0x2d94e1[_0xa45d('0x22')];var _0x32a928;if(_0x2b2660>=_0x17670f){_0x2b2660=_0x17670f;_0x32a928=0xc8;}else{_0x32a928=0xce;}_0x522a3b['status'](_0x32a928);return _0x522a3b['set'](_0xa45d('0x23'),_0xabc773+'-'+_0x2b2660+'/'+_0x17670f)[_0xa45d('0x1e')](_0x3234f2);}return null;};}function patchUpdates(_0x38d1f0){return function(_0x53f22a){try{jsonpatch[_0xa45d('0x24')](_0x53f22a,_0x38d1f0,!![]);}catch(_0xa17b19){return BPromise[_0xa45d('0x25')](_0xa17b19);}return _0x53f22a[_0xa45d('0x26')]();};}function saveUpdates(_0x1a6e98,_0x28c336){return function(_0x569e9f){if(_0x569e9f){return _0x569e9f[_0xa45d('0x27')](_0x1a6e98)[_0xa45d('0x28')](function(_0x5c9abb){return _0x5c9abb;});}return null;};}function removeEntity(_0x257bd5,_0x221084){return function(_0x3d575e){if(_0x3d575e){return _0x3d575e[_0xa45d('0x29')]()[_0xa45d('0x28')](function(){var _0x148a17=_0x3d575e[_0xa45d('0x2a')]({'plain':!![]});var _0x3cde28=_0xa45d('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x3cde28,'resourceId':_0x148a17['id']}})['then'](function(){return _0x3d575e;});})[_0xa45d('0x28')](function(){_0x257bd5[_0xa45d('0x1c')](0xcc)[_0xa45d('0x1d')]();});}};}function handleEntityNotFound(_0x93e1eb,_0x343e03){return function(_0x54ab76){if(!_0x54ab76){_0x93e1eb['sendStatus'](0x194);}return _0x54ab76;};}function handleError(_0x10c7d9,_0x4da193){_0x4da193=_0x4da193||0x1f4;return function(_0x172647){logger[_0xa45d('0x2c')](_0x172647[_0xa45d('0x2d')]);if(_0x172647[_0xa45d('0x2e')]){delete _0x172647[_0xa45d('0x2e')];}_0x10c7d9['status'](_0x4da193)[_0xa45d('0x2f')](_0x172647);};}exports['index']=function(_0x4dd226,_0x2dd7d9){var _0x31287c={},_0x37ba18={},_0x15cda9={'count':0x0,'rows':[]};var _0x533d5b=_[_0xa45d('0x30')](db['FaxQueue'][_0xa45d('0x31')],function(_0x4b9474){return{'name':_0x4b9474[_0xa45d('0x32')],'type':_0x4b9474[_0xa45d('0x33')]['key']};});_0x37ba18[_0xa45d('0x34')]=_[_0xa45d('0x30')](_0x533d5b,_0xa45d('0x2e'));_0x37ba18[_0xa45d('0x35')]=_[_0xa45d('0x36')](_0x4dd226[_0xa45d('0x35')]);_0x37ba18[_0xa45d('0x37')]=_['intersection'](_0x37ba18[_0xa45d('0x34')],_0x37ba18['query']);_0x31287c[_0xa45d('0x38')]=_[_0xa45d('0x39')](_0x37ba18[_0xa45d('0x34')],qs[_0xa45d('0x3a')](_0x4dd226[_0xa45d('0x35')][_0xa45d('0x3a')]));_0x31287c[_0xa45d('0x38')]=_0x31287c['attributes'][_0xa45d('0x3b')]?_0x31287c[_0xa45d('0x38')]:_0x37ba18[_0xa45d('0x34')];if(!_0x4dd226['query'][_0xa45d('0x3c')](_0xa45d('0x3d'))){_0x31287c[_0xa45d('0x22')]=qs[_0xa45d('0x22')](_0x4dd226[_0xa45d('0x35')]['limit']);_0x31287c[_0xa45d('0x1f')]=qs[_0xa45d('0x1f')](_0x4dd226['query'][_0xa45d('0x1f')]);}_0x31287c[_0xa45d('0x3e')]=qs[_0xa45d('0x3f')](_0x4dd226[_0xa45d('0x35')]['sort']);_0x31287c[_0xa45d('0x40')]=qs['filters'](_[_0xa45d('0x41')](_0x4dd226[_0xa45d('0x35')],_0x37ba18['filters']),_0x533d5b);if(_0x4dd226['query']['filter']){_0x31287c[_0xa45d('0x40')]=_[_0xa45d('0x42')](_0x31287c[_0xa45d('0x40')],{'$or':_['map'](_0x533d5b,function(_0x54cd5d){if(_0x54cd5d[_0xa45d('0x33')]!==_0xa45d('0x43')){var _0x59ebf7={};_0x59ebf7[_0x54cd5d[_0xa45d('0x2e')]]={'$like':'%'+_0x4dd226[_0xa45d('0x35')]['filter']+'%'};return _0x59ebf7;}})});}_0x31287c=_[_0xa45d('0x42')]({},_0x31287c,_0x4dd226['options']);var _0x5f4563={'where':_0x31287c[_0xa45d('0x40')]};return db[_0xa45d('0x44')][_0xa45d('0x21')](_0x5f4563)[_0xa45d('0x28')](function(_0x379130){_0x15cda9[_0xa45d('0x21')]=_0x379130;if(_0x4dd226[_0xa45d('0x35')][_0xa45d('0x45')]){_0x31287c[_0xa45d('0x46')]=[{'all':!![]}];}return db[_0xa45d('0x44')][_0xa45d('0x47')](_0x31287c);})['then'](function(_0x3f53de){_0x15cda9['rows']=_0x3f53de;return _0x15cda9;})[_0xa45d('0x28')](respondWithFilteredResult(_0x2dd7d9,_0x31287c))[_0xa45d('0x48')](handleError(_0x2dd7d9,null));};exports[_0xa45d('0x49')]=function(_0x46d6b2,_0x72857d){var _0x36b162={'raw':!![],'where':{'id':_0x46d6b2[_0xa45d('0x4a')]['id']}},_0x48e62e={};_0x48e62e['model']=_['keys'](db[_0xa45d('0x44')]['rawAttributes']);_0x48e62e['query']=_[_0xa45d('0x36')](_0x46d6b2[_0xa45d('0x35')]);_0x48e62e[_0xa45d('0x37')]=_[_0xa45d('0x39')](_0x48e62e[_0xa45d('0x34')],_0x48e62e[_0xa45d('0x35')]);_0x36b162['attributes']=_[_0xa45d('0x39')](_0x48e62e[_0xa45d('0x34')],qs[_0xa45d('0x3a')](_0x46d6b2['query'][_0xa45d('0x3a')]));_0x36b162[_0xa45d('0x38')]=_0x36b162[_0xa45d('0x38')][_0xa45d('0x3b')]?_0x36b162[_0xa45d('0x38')]:_0x48e62e[_0xa45d('0x34')];if(_0x46d6b2['query'][_0xa45d('0x45')]){_0x36b162[_0xa45d('0x46')]=[{'all':!![]}];}_0x36b162=_[_0xa45d('0x42')]({},_0x36b162,_0x46d6b2['options']);return db[_0xa45d('0x44')][_0xa45d('0x4b')](_0x36b162)[_0xa45d('0x28')](handleEntityNotFound(_0x72857d,null))[_0xa45d('0x28')](respondWithResult(_0x72857d,null))['catch'](handleError(_0x72857d,null));};exports[_0xa45d('0x4c')]=function(_0x2e2d66,_0x29eaa6){return db[_0xa45d('0x44')]['create'](_0x2e2d66[_0xa45d('0x4d')],{})[_0xa45d('0x28')](function(_0x578bdb){var _0x3389d6=_0x2e2d66[_0xa45d('0x4e')]['get']({'plain':!![]});if(!_0x3389d6)throw new Error(_0xa45d('0x4f'));if(_0x3389d6['role']===_0xa45d('0x4e')){var _0x282e48=_0x578bdb[_0xa45d('0x2a')]({'plain':!![]});var _0x39617d=_0xa45d('0x2b');return db[_0xa45d('0x50')]['find']({'where':{'name':_0x39617d,'userProfileId':_0x3389d6[_0xa45d('0x51')]},'raw':!![]})[_0xa45d('0x28')](function(_0x12f8f1){if(_0x12f8f1&&_0x12f8f1[_0xa45d('0x52')]===0x0){return db[_0xa45d('0x53')][_0xa45d('0x4c')]({'name':_0x282e48[_0xa45d('0x2e')],'resourceId':_0x282e48['id'],'type':_0x12f8f1['name'],'sectionId':_0x12f8f1['id']},{})[_0xa45d('0x28')](function(){return _0x578bdb;});}else{return _0x578bdb;}})['catch'](function(_0x52d94a){logger[_0xa45d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52d94a);throw _0x52d94a;});}return _0x578bdb;})[_0xa45d('0x28')](respondWithResult(_0x29eaa6,0xc9))[_0xa45d('0x48')](handleError(_0x29eaa6,null));};exports[_0xa45d('0x27')]=function(_0x195e84,_0x298221){if(_0x195e84[_0xa45d('0x4d')]['id']){delete _0x195e84[_0xa45d('0x4d')]['id'];}return db[_0xa45d('0x44')][_0xa45d('0x4b')]({'where':{'id':_0x195e84['params']['id']}})[_0xa45d('0x28')](handleEntityNotFound(_0x298221,null))[_0xa45d('0x28')](saveUpdates(_0x195e84[_0xa45d('0x4d')],null))[_0xa45d('0x28')](respondWithResult(_0x298221,null))[_0xa45d('0x48')](handleError(_0x298221,null));};exports[_0xa45d('0x29')]=function(_0x44bfdc,_0x5d5da8){return db[_0xa45d('0x44')][_0xa45d('0x4b')]({'where':{'id':_0x44bfdc[_0xa45d('0x4a')]['id']}})[_0xa45d('0x28')](handleEntityNotFound(_0x5d5da8,null))[_0xa45d('0x28')](removeEntity(_0x5d5da8,null))[_0xa45d('0x48')](handleError(_0x5d5da8,null));};exports['describe']=function(_0x4cc40b,_0x4bea16){return db[_0xa45d('0x44')][_0xa45d('0x54')]()[_0xa45d('0x28')](respondWithResult(_0x4bea16,null))[_0xa45d('0x48')](handleError(_0x4bea16,null));};exports[_0xa45d('0x55')]=function(_0x943b67,_0x120ea8,_0x3f9b0d){var _0x88f264={'raw':!![],'where':{}},_0x292303={},_0x4d6612;return db[_0xa45d('0x44')][_0xa45d('0x56')]({'where':{'id':_0x943b67[_0xa45d('0x4a')]['id']}})[_0xa45d('0x28')](handleEntityNotFound(_0x120ea8,null))['then'](function(_0x298e4f){if(_0x298e4f){_0x4d6612=_0x298e4f[_0xa45d('0x2a')]({'plain':!![]});_0x292303['model']=_[_0xa45d('0x36')](db[_0xa45d('0x57')][_0xa45d('0x31')]);_0x292303[_0xa45d('0x35')]=_[_0xa45d('0x36')](_0x943b67[_0xa45d('0x35')]);_0x292303[_0xa45d('0x37')]=_[_0xa45d('0x39')](_0x292303['model'],_0x292303[_0xa45d('0x35')]);_0x88f264['attributes']=_[_0xa45d('0x39')](_0x292303[_0xa45d('0x34')],qs['fields'](_0x943b67[_0xa45d('0x35')][_0xa45d('0x3a')]));_0x88f264['attributes']=_0x88f264[_0xa45d('0x38')]['length']?_0x88f264[_0xa45d('0x38')]:_0x292303[_0xa45d('0x34')];if(!_0x943b67[_0xa45d('0x35')]['hasOwnProperty']('nolimit')){_0x88f264[_0xa45d('0x22')]=qs['limit'](_0x943b67[_0xa45d('0x35')]['limit']);_0x88f264[_0xa45d('0x1f')]=qs[_0xa45d('0x1f')](_0x943b67[_0xa45d('0x35')]['offset']);}_0x88f264[_0xa45d('0x3e')]=qs[_0xa45d('0x3f')](_0x943b67['query'][_0xa45d('0x3f')]);_0x88f264[_0xa45d('0x40')]=qs['filters'](_[_0xa45d('0x41')](_0x943b67[_0xa45d('0x35')],_0x292303[_0xa45d('0x37')]));_0x88f264['where'][_0xa45d('0x58')]=_0x298e4f['id'];if(_0x943b67[_0xa45d('0x35')]['filter']){_0x88f264[_0xa45d('0x40')]=_[_0xa45d('0x42')](_0x88f264[_0xa45d('0x40')],{'$or':_[_0xa45d('0x30')](_0x88f264[_0xa45d('0x38')],function(_0x41a340){var _0x24df8c={};_0x24df8c[_0x41a340]={'$like':'%'+_0x943b67[_0xa45d('0x35')][_0xa45d('0x59')]+'%'};return _0x24df8c;})});}_0x88f264=_[_0xa45d('0x42')]({},_0x88f264,_0x943b67[_0xa45d('0x5a')]);return db[_0xa45d('0x57')][_0xa45d('0x47')](_0x88f264);}})[_0xa45d('0x28')](function(_0x3b3341){if(_0x3b3341){return db['User'][_0xa45d('0x5b')]({'where':{'id':_[_0xa45d('0x30')](_0x3b3341,_0xa45d('0x5c')),'role':_0xa45d('0x5d')},'attributes':['id',_0xa45d('0x2e'),'faxPause',_0xa45d('0x5e'),_0xa45d('0x5f')]});}})[_0xa45d('0x28')](function(_0x2c5c04){if(_0x2c5c04){return{'count':_0x2c5c04[_0xa45d('0x21')],'rows':_[_0xa45d('0x30')](_0x2c5c04['rows'],function(_0x233b23){return{'membername':_0x233b23['name'],'UserId':_0x233b23['id'],'queue_name':_0x4d6612[_0xa45d('0x2e')],'FaxQueueId':_0x4d6612['id'],'interface':util[_0xa45d('0x60')](_0xa45d('0x61'),_0xa45d('0x62'),_0x233b23[_0xa45d('0x2e')]),'penalty':0x0,'paused':_0x233b23['faxPause'],'createdAt':_0x233b23[_0xa45d('0x5f')],'updatedAt':_0x233b23['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa45d('0x28')](respondWithFilteredResult(_0x120ea8,_0x88f264))[_0xa45d('0x48')](handleError(_0x120ea8,null));};exports['getTeams']=function(_0x212edd,_0x2ae9f4,_0x3e9acf){var _0x2296f3={};var _0x41af0f={};var _0xc4ec15;var _0x512633;return db[_0xa45d('0x44')][_0xa45d('0x56')]({'where':{'id':_0x212edd[_0xa45d('0x4a')]['id']}})[_0xa45d('0x28')](handleEntityNotFound(_0x2ae9f4,null))[_0xa45d('0x28')](function(_0x3116a7){if(_0x3116a7){_0xc4ec15=_0x3116a7;_0x41af0f[_0xa45d('0x34')]=_[_0xa45d('0x36')](db[_0xa45d('0x63')][_0xa45d('0x31')]);_0x41af0f['query']=_[_0xa45d('0x36')](_0x212edd[_0xa45d('0x35')]);_0x41af0f[_0xa45d('0x37')]=_[_0xa45d('0x39')](_0x41af0f['model'],_0x41af0f['query']);_0x2296f3[_0xa45d('0x38')]=_['intersection'](_0x41af0f[_0xa45d('0x34')],qs['fields'](_0x212edd[_0xa45d('0x35')][_0xa45d('0x3a')]));_0x2296f3[_0xa45d('0x38')]=_0x2296f3[_0xa45d('0x38')][_0xa45d('0x3b')]?_0x2296f3[_0xa45d('0x38')]:_0x41af0f[_0xa45d('0x34')];_0x2296f3[_0xa45d('0x3e')]=qs[_0xa45d('0x3f')](_0x212edd[_0xa45d('0x35')][_0xa45d('0x3f')]);_0x2296f3[_0xa45d('0x40')]=qs['filters'](_['pick'](_0x212edd['query'],_0x41af0f[_0xa45d('0x37')]));if(_0x212edd[_0xa45d('0x35')][_0xa45d('0x59')]){_0x2296f3['where']=_[_0xa45d('0x42')](_0x2296f3[_0xa45d('0x40')],{'$or':_[_0xa45d('0x30')](_0x2296f3[_0xa45d('0x38')],function(_0x82aa8){var _0x3650ac={};_0x3650ac[_0x82aa8]={'$like':'%'+_0x212edd['query'][_0xa45d('0x59')]+'%'};return _0x3650ac;})});}_0x2296f3=_[_0xa45d('0x42')]({},_0x2296f3,_0x212edd[_0xa45d('0x5a')]);return _0xc4ec15['getTeams'](_0x2296f3);}})['then'](function(_0x151523){if(_0x151523){_0x512633=_0x151523['length'];if(!_0x212edd[_0xa45d('0x35')][_0xa45d('0x3c')]('nolimit')){_0x2296f3['limit']=qs['limit'](_0x212edd[_0xa45d('0x35')][_0xa45d('0x22')]);_0x2296f3[_0xa45d('0x1f')]=qs[_0xa45d('0x1f')](_0x212edd[_0xa45d('0x35')][_0xa45d('0x1f')]);}return _0xc4ec15[_0xa45d('0x64')](_0x2296f3);}})[_0xa45d('0x28')](function(_0x22d97c){if(_0x22d97c){return _0x22d97c?{'count':_0x512633,'rows':_0x22d97c}:null;}})[_0xa45d('0x28')](respondWithResult(_0x2ae9f4,null))[_0xa45d('0x48')](handleError(_0x2ae9f4,null));};exports['addTeams']=function(_0x9d99ac,_0x20f381,_0x18a819){var _0x5bc608=_0x9d99ac[_0xa45d('0x4d')]['ids'];return db[_0xa45d('0x63')][_0xa45d('0x47')]({'where':{'id':_0x5bc608},'attributes':['id'],'include':[{'model':db[_0xa45d('0x65')],'as':_0xa45d('0x66'),'attributes':['id',_0xa45d('0x2e'),_0xa45d('0x67'),'voicePause',_0xa45d('0x68')],'raw':!![]}]})['then'](function(_0x4bc826){if(_0x4bc826){var _0x1dfa7c=_['flatMap'](_0x4bc826,function(_0x487c13){var _0x232624=_0x487c13[_0xa45d('0x2a')]({'plain':!![]});return _0x232624[_0xa45d('0x66')];});return db[_0xa45d('0x44')]['find']({'where':{'id':_0x9d99ac[_0xa45d('0x4a')]['id']}})['then'](function(_0x384947){return db['sequelize'][_0xa45d('0x69')](function(_0x4eb055){return _0x384947[_0xa45d('0x6a')](_0x5bc608,{'transaction':_0x4eb055})['then'](function(){return BPromise['each'](_0x1dfa7c,function(_0x1811de){return db['UserFaxQueue'][_0xa45d('0x6b')]({'where':{'UserId':_0x1811de['id'],'FaxQueueId':_0x9d99ac['params']['id']},'transaction':_0x4eb055});});})['then'](function(){_0x1dfa7c[_0xa45d('0x6c')](function(_0x451876){socket['emit'](_0xa45d('0x6d'),{'UserId':_0x451876['id'],'FaxQueueId':_0x384947['id']});});});});});}})[_0xa45d('0x28')](respondWithStatusCode(_0x20f381,null))['catch'](handleError(_0x20f381,null));};exports['removeTeams']=function(_0x522a22,_0x159097,_0x50ac8b){return db[_0xa45d('0x63')][_0xa45d('0x47')]({'where':{'id':_0x522a22[_0xa45d('0x35')][_0xa45d('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa45d('0x28')](handleEntityNotFound(_0x159097,null))[_0xa45d('0x28')](function(_0x2f9cfb){var _0x1a7acc=_[_0xa45d('0x30')](_0x2f9cfb,'id');var _0x3ee167=[];var _0x5be8c7=[];var _0x3d571a=squel[_0xa45d('0x6f')]();_0x3d571a['field'](_0xa45d('0x70'))[_0xa45d('0x71')](_0xa45d('0x72'),'tq')['join']('user_has_teams','ut',_0xa45d('0x73'))[_0xa45d('0x40')](_0xa45d('0x74'),_0x522a22[_0xa45d('0x4a')]['id']);for(var _0x362bc3=0x0;_0x362bc3<_0x2f9cfb['length'];_0x362bc3+=0x1){let _0x2b6707=_0x2f9cfb[_0x362bc3];for(var _0x1be9a6=0x0;_0x1be9a6<_0x2b6707[_0xa45d('0x66')][_0xa45d('0x3b')];_0x1be9a6+=0x1){let _0xdddde2=_0x2b6707[_0xa45d('0x66')][_0x1be9a6];var _0x47b7b1=_0x3d571a[_0xa45d('0x75')]();_0x47b7b1[_0xa45d('0x40')]('ut.UserId\x20=\x20?',_0xdddde2['id']);_0x5be8c7[_0xa45d('0x76')](db[_0xa45d('0x77')][_0xa45d('0x35')](_0x47b7b1[_0xa45d('0x78')](),{'type':db['sequelize'][_0xa45d('0x79')][_0xa45d('0x7a')]})['then'](function(_0x4d9806){if(_0x4d9806['length']===0x1){return _0xdddde2['id'];}else{var _0x4db01b=_[_0xa45d('0x7b')](_[_0xa45d('0x30')](_0x4d9806,_0xa45d('0x7c')),function(_0x1a03f4){return _['includes'](_0x1a7acc,_0x1a03f4);});if(_0x4db01b){return _0xdddde2['id'];}}}));}}return BPromise[_0xa45d('0x7d')](_0x5be8c7)[_0xa45d('0x28')](function(_0x1c76fc){_0x3ee167=_(_0x3ee167)['union'](_0x1c76fc)[_0xa45d('0x7e')]()[_0xa45d('0x7f')]();return db[_0xa45d('0x44')]['find']({'where':{'id':_0x522a22[_0xa45d('0x4a')]['id']}})[_0xa45d('0x28')](function(_0x255ac7){return db['sequelize'][_0xa45d('0x69')](function(_0x33bc9c){return _0x255ac7[_0xa45d('0x80')](_0x522a22[_0xa45d('0x35')]['ids'],{'transaction':_0x33bc9c})[_0xa45d('0x28')](function(){if(!_[_0xa45d('0x81')](_0x3ee167)){return _0x255ac7[_0xa45d('0x82')](_0x3ee167,{'transaction':_0x33bc9c});}})[_0xa45d('0x28')](function(){_0x3ee167['forEach'](function(_0x1a94b8){socket['emit'](_0xa45d('0x83'),{'UserId':_0x1a94b8,'FaxQueueId':_0x255ac7['id']});});});});});});})[_0xa45d('0x28')](respondWithStatusCode(_0x159097,null))[_0xa45d('0x48')](handleError(_0x159097,null));};exports[_0xa45d('0x84')]=function(_0x1ae62e,_0x3fc180,_0x217f49){return db[_0xa45d('0x44')]['find']({'where':{'id':_0x1ae62e['params']['id']}})[_0xa45d('0x28')](handleEntityNotFound(_0x3fc180,null))[_0xa45d('0x28')](function(_0x3a4f65){if(_0x3a4f65){return _0x3a4f65[_0xa45d('0x84')](_0x1ae62e[_0xa45d('0x4d')][_0xa45d('0x6e')],_[_0xa45d('0x85')](_0x1ae62e[_0xa45d('0x4d')],[_0xa45d('0x6e'),'id'])||{})[_0xa45d('0x86')](function(_0xb4fecc){for(var _0x15e25c=0x0;_0x15e25c<_0x1ae62e[_0xa45d('0x4d')][_0xa45d('0x6e')][_0xa45d('0x3b')];_0x15e25c+=0x1){socket[_0xa45d('0x87')](_0xa45d('0x6d'),{'UserId':Number(_0x1ae62e[_0xa45d('0x4d')][_0xa45d('0x6e')][_0x15e25c]),'FaxQueueId':Number(_0x1ae62e[_0xa45d('0x4a')]['id'])});}return _0xb4fecc;});}})[_0xa45d('0x28')](respondWithResult(_0x3fc180,null))[_0xa45d('0x48')](handleError(_0x3fc180,null));};exports['removeAgents']=function(_0x57fee6,_0x2ffcc9,_0x11dadd){return db[_0xa45d('0x44')][_0xa45d('0x4b')]({'where':{'id':_0x57fee6['params']['id']}})[_0xa45d('0x28')](handleEntityNotFound(_0x2ffcc9,null))[_0xa45d('0x28')](function(_0x17aa11){if(_0x17aa11){return _0x17aa11[_0xa45d('0x82')](_0x57fee6['query'][_0xa45d('0x6e')])[_0xa45d('0x28')](function(){if(_[_0xa45d('0x88')](_0x57fee6[_0xa45d('0x35')]['ids'])){for(var _0x1e18ae=0x0;_0x1e18ae<_0x57fee6[_0xa45d('0x35')][_0xa45d('0x6e')][_0xa45d('0x3b')];_0x1e18ae+=0x1){socket['emit'](_0xa45d('0x83'),{'UserId':Number(_0x57fee6[_0xa45d('0x35')][_0xa45d('0x6e')][_0x1e18ae]),'FaxQueueId':Number(_0x57fee6['params']['id'])});}}else{socket[_0xa45d('0x87')]('userFaxQueue:remove',{'UserId':Number(_0x57fee6[_0xa45d('0x35')][_0xa45d('0x6e')]),'FaxQueueId':Number(_0x57fee6[_0xa45d('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2ffcc9,null))[_0xa45d('0x48')](handleError(_0x2ffcc9,null));};exports['getAgents']=function(_0x27fc7c,_0x1c6df8,_0x355174){var _0x5b6d37={};var _0x520f8d={};var _0x2d267e;var _0x3d5ae3;return db['FaxQueue'][_0xa45d('0x56')]({'where':{'id':_0x27fc7c[_0xa45d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c6df8,null))[_0xa45d('0x28')](function(_0x3a3ca1){if(_0x3a3ca1){_0x2d267e=_0x3a3ca1;_0x520f8d['model']=_[_0xa45d('0x36')](db[_0xa45d('0x65')][_0xa45d('0x31')]);_0x520f8d[_0xa45d('0x35')]=_[_0xa45d('0x36')](_0x27fc7c[_0xa45d('0x35')]);_0x520f8d[_0xa45d('0x37')]=_[_0xa45d('0x39')](_0x520f8d[_0xa45d('0x34')],_0x520f8d[_0xa45d('0x35')]);_0x5b6d37['attributes']=_[_0xa45d('0x39')](_0x520f8d[_0xa45d('0x34')],qs[_0xa45d('0x3a')](_0x27fc7c['query']['fields']));_0x5b6d37[_0xa45d('0x38')]=_0x5b6d37[_0xa45d('0x38')][_0xa45d('0x3b')]?_0x5b6d37[_0xa45d('0x38')]:_0x520f8d[_0xa45d('0x34')];_0x5b6d37['order']=qs[_0xa45d('0x3f')](_0x27fc7c[_0xa45d('0x35')][_0xa45d('0x3f')]);_0x5b6d37[_0xa45d('0x40')]=qs[_0xa45d('0x37')](_[_0xa45d('0x41')](_0x27fc7c['query'],_0x520f8d[_0xa45d('0x37')]));if(_0x27fc7c[_0xa45d('0x35')]['filter']){_0x5b6d37[_0xa45d('0x40')]=_[_0xa45d('0x42')](_0x5b6d37[_0xa45d('0x40')],{'$or':_[_0xa45d('0x30')](_0x5b6d37[_0xa45d('0x38')],function(_0x2c820f){var _0x577ae2={};_0x577ae2[_0x2c820f]={'$like':'%'+_0x27fc7c[_0xa45d('0x35')]['filter']+'%'};return _0x577ae2;})});}_0x5b6d37=_[_0xa45d('0x42')]({},_0x5b6d37,_0x27fc7c['options']);return _0x2d267e['getAgents'](_0x5b6d37);}})[_0xa45d('0x28')](function(_0x3a2876){if(_0x3a2876){_0x3d5ae3=_0x3a2876[_0xa45d('0x3b')];if(!_0x27fc7c[_0xa45d('0x35')][_0xa45d('0x3c')](_0xa45d('0x3d'))){_0x5b6d37[_0xa45d('0x22')]=qs[_0xa45d('0x22')](_0x27fc7c['query']['limit']);_0x5b6d37[_0xa45d('0x1f')]=qs[_0xa45d('0x1f')](_0x27fc7c[_0xa45d('0x35')][_0xa45d('0x1f')]);}return _0x2d267e[_0xa45d('0x89')](_0x5b6d37);}})[_0xa45d('0x28')](function(_0x2c722f){if(_0x2c722f){return _0x2c722f?{'count':_0x3d5ae3,'rows':_0x2c722f}:null;}})[_0xa45d('0x28')](respondWithResult(_0x1c6df8,null))[_0xa45d('0x48')](handleError(_0x1c6df8,null));}; \ No newline at end of file +var _0x4fdc=['../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','destroy','end','error','stack','name','send','index','rawAttributes','key','model','map','query','keys','intersection','fields','attributes','length','sort','where','filters','filter','merge','type','VIRTUAL','options','FaxQueue','include','findAll','show','params','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxQueues','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','nolimit','order','pick','FaxQueueId','UserId','agent','faxPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','addTeams','Team','User','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x4fdc,0x7c));var _0xc4fd=function(_0x2c8024,_0x18cc3a){_0x2c8024=_0x2c8024-0x0;var _0x2e8589=_0x4fdc[_0x2c8024];return _0x2e8589;};'use strict';var emlformat=require(_0xc4fd('0x0'));var rimraf=require(_0xc4fd('0x1'));var zipdir=require(_0xc4fd('0x2'));var jsonpatch=require(_0xc4fd('0x3'));var rp=require('request-promise');var moment=require(_0xc4fd('0x4'));var BPromise=require(_0xc4fd('0x5'));var Mustache=require(_0xc4fd('0x6'));var util=require(_0xc4fd('0x7'));var path=require(_0xc4fd('0x8'));var sox=require(_0xc4fd('0x9'));var csv=require('to-csv');var ejs=require(_0xc4fd('0xa'));var fs=require('fs');var fs_extra=require(_0xc4fd('0xb'));var _=require(_0xc4fd('0xc'));var squel=require(_0xc4fd('0xd'));var crypto=require('crypto');var jsforce=require(_0xc4fd('0xe'));var deskjs=require(_0xc4fd('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc4fd('0x10'));var Papa=require('papaparse');var Redis=require(_0xc4fd('0x11'));var authService=require(_0xc4fd('0x12'));var qs=require(_0xc4fd('0x13'));var as=require(_0xc4fd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc4fd('0x15'))(_0xc4fd('0x16'));var utils=require('../../config/utils');var config=require(_0xc4fd('0x17'));var licenseUtil=require(_0xc4fd('0x18'));var db=require(_0xc4fd('0x19'))['db'];config['redis']=_[_0xc4fd('0x1a')](config[_0xc4fd('0x1b')],{'host':_0xc4fd('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc4fd('0x1b')]));require(_0xc4fd('0x1d'))[_0xc4fd('0x1e')](socket);function respondWithStatusCode(_0x3e3ac0,_0x3a8891){_0x3a8891=_0x3a8891||0xcc;return function(_0x44eab6){if(_0x44eab6){return _0x3e3ac0[_0xc4fd('0x1f')](_0x3a8891);}return _0x3e3ac0[_0xc4fd('0x20')](_0x3a8891)['end']();};}function respondWithResult(_0x6f492e,_0x178755){_0x178755=_0x178755||0xc8;return function(_0x1659ac){if(_0x1659ac){return _0x6f492e[_0xc4fd('0x20')](_0x178755)[_0xc4fd('0x21')](_0x1659ac);}};}function respondWithFilteredResult(_0x867644,_0x1e6877){return function(_0x108afc){if(_0x108afc){var _0xf4872f=typeof _0x1e6877[_0xc4fd('0x22')]===_0xc4fd('0x23')&&typeof _0x1e6877[_0xc4fd('0x24')]===_0xc4fd('0x23');var _0x55226a=_0x108afc[_0xc4fd('0x25')];var _0x49f731=_0xf4872f?0x0:_0x1e6877[_0xc4fd('0x22')];var _0x216455=_0xf4872f?_0x108afc['count']:_0x1e6877['offset']+_0x1e6877[_0xc4fd('0x24')];var _0x27dd80;if(_0x216455>=_0x55226a){_0x216455=_0x55226a;_0x27dd80=0xc8;}else{_0x27dd80=0xce;}_0x867644[_0xc4fd('0x20')](_0x27dd80);return _0x867644[_0xc4fd('0x26')](_0xc4fd('0x27'),_0x49f731+'-'+_0x216455+'/'+_0x55226a)[_0xc4fd('0x21')](_0x108afc);}return null;};}function patchUpdates(_0xc80713){return function(_0x41abf9){try{jsonpatch[_0xc4fd('0x28')](_0x41abf9,_0xc80713,!![]);}catch(_0x297e9a){return BPromise[_0xc4fd('0x29')](_0x297e9a);}return _0x41abf9[_0xc4fd('0x2a')]();};}function saveUpdates(_0x60a79e,_0xab59f3){return function(_0x1fdca9){if(_0x1fdca9){return _0x1fdca9[_0xc4fd('0x2b')](_0x60a79e)[_0xc4fd('0x2c')](function(_0x13986c){return _0x13986c;});}return null;};}function removeEntity(_0x489c2f,_0x4743a6){return function(_0x5f4d9c){if(_0x5f4d9c){return _0x5f4d9c['destroy']()[_0xc4fd('0x2c')](function(){var _0x7869cf=_0x5f4d9c[_0xc4fd('0x2d')]({'plain':!![]});var _0x537d4b='FaxQueues';return db['UserProfileResource'][_0xc4fd('0x2e')]({'where':{'type':_0x537d4b,'resourceId':_0x7869cf['id']}})[_0xc4fd('0x2c')](function(){return _0x5f4d9c;});})[_0xc4fd('0x2c')](function(){_0x489c2f['status'](0xcc)[_0xc4fd('0x2f')]();});}};}function handleEntityNotFound(_0x3b8938,_0x16c041){return function(_0x399c61){if(!_0x399c61){_0x3b8938[_0xc4fd('0x1f')](0x194);}return _0x399c61;};}function handleError(_0x2e4374,_0x4e173e){_0x4e173e=_0x4e173e||0x1f4;return function(_0x57de4c){logger[_0xc4fd('0x30')](_0x57de4c[_0xc4fd('0x31')]);if(_0x57de4c[_0xc4fd('0x32')]){delete _0x57de4c['name'];}_0x2e4374[_0xc4fd('0x20')](_0x4e173e)[_0xc4fd('0x33')](_0x57de4c);};}exports[_0xc4fd('0x34')]=function(_0x54f82f,_0x4565e6){var _0x363d50={},_0x554720={},_0x46e83e={'count':0x0,'rows':[]};var _0x1bcbfa=_['map'](db['FaxQueue'][_0xc4fd('0x35')],function(_0x1e42aa){return{'name':_0x1e42aa['fieldName'],'type':_0x1e42aa['type'][_0xc4fd('0x36')]};});_0x554720[_0xc4fd('0x37')]=_[_0xc4fd('0x38')](_0x1bcbfa,_0xc4fd('0x32'));_0x554720[_0xc4fd('0x39')]=_[_0xc4fd('0x3a')](_0x54f82f[_0xc4fd('0x39')]);_0x554720['filters']=_[_0xc4fd('0x3b')](_0x554720[_0xc4fd('0x37')],_0x554720[_0xc4fd('0x39')]);_0x363d50['attributes']=_[_0xc4fd('0x3b')](_0x554720['model'],qs[_0xc4fd('0x3c')](_0x54f82f[_0xc4fd('0x39')][_0xc4fd('0x3c')]));_0x363d50[_0xc4fd('0x3d')]=_0x363d50[_0xc4fd('0x3d')][_0xc4fd('0x3e')]?_0x363d50[_0xc4fd('0x3d')]:_0x554720[_0xc4fd('0x37')];if(!_0x54f82f[_0xc4fd('0x39')]['hasOwnProperty']('nolimit')){_0x363d50[_0xc4fd('0x24')]=qs['limit'](_0x54f82f[_0xc4fd('0x39')][_0xc4fd('0x24')]);_0x363d50[_0xc4fd('0x22')]=qs[_0xc4fd('0x22')](_0x54f82f[_0xc4fd('0x39')][_0xc4fd('0x22')]);}_0x363d50['order']=qs['sort'](_0x54f82f['query'][_0xc4fd('0x3f')]);_0x363d50[_0xc4fd('0x40')]=qs[_0xc4fd('0x41')](_['pick'](_0x54f82f[_0xc4fd('0x39')],_0x554720['filters']),_0x1bcbfa);if(_0x54f82f[_0xc4fd('0x39')][_0xc4fd('0x42')]){_0x363d50[_0xc4fd('0x40')]=_[_0xc4fd('0x43')](_0x363d50[_0xc4fd('0x40')],{'$or':_[_0xc4fd('0x38')](_0x1bcbfa,function(_0x44d86a){if(_0x44d86a[_0xc4fd('0x44')]!==_0xc4fd('0x45')){var _0x397963={};_0x397963[_0x44d86a['name']]={'$like':'%'+_0x54f82f[_0xc4fd('0x39')][_0xc4fd('0x42')]+'%'};return _0x397963;}})});}_0x363d50=_[_0xc4fd('0x43')]({},_0x363d50,_0x54f82f[_0xc4fd('0x46')]);var _0x4f86a8={'where':_0x363d50['where']};return db[_0xc4fd('0x47')]['count'](_0x4f86a8)[_0xc4fd('0x2c')](function(_0x2e7f77){_0x46e83e['count']=_0x2e7f77;if(_0x54f82f[_0xc4fd('0x39')]['includeAll']){_0x363d50[_0xc4fd('0x48')]=[{'all':!![]}];}return db['FaxQueue'][_0xc4fd('0x49')](_0x363d50);})['then'](function(_0x54bc5e){_0x46e83e['rows']=_0x54bc5e;return _0x46e83e;})['then'](respondWithFilteredResult(_0x4565e6,_0x363d50))['catch'](handleError(_0x4565e6,null));};exports[_0xc4fd('0x4a')]=function(_0x45a9fe,_0x277e53){var _0xbb7285={'raw':!![],'where':{'id':_0x45a9fe[_0xc4fd('0x4b')]['id']}},_0x65cec7={};_0x65cec7[_0xc4fd('0x37')]=_[_0xc4fd('0x3a')](db[_0xc4fd('0x47')][_0xc4fd('0x35')]);_0x65cec7[_0xc4fd('0x39')]=_['keys'](_0x45a9fe[_0xc4fd('0x39')]);_0x65cec7[_0xc4fd('0x41')]=_[_0xc4fd('0x3b')](_0x65cec7[_0xc4fd('0x37')],_0x65cec7[_0xc4fd('0x39')]);_0xbb7285['attributes']=_[_0xc4fd('0x3b')](_0x65cec7[_0xc4fd('0x37')],qs[_0xc4fd('0x3c')](_0x45a9fe[_0xc4fd('0x39')][_0xc4fd('0x3c')]));_0xbb7285[_0xc4fd('0x3d')]=_0xbb7285['attributes'][_0xc4fd('0x3e')]?_0xbb7285['attributes']:_0x65cec7['model'];if(_0x45a9fe[_0xc4fd('0x39')][_0xc4fd('0x4c')]){_0xbb7285[_0xc4fd('0x48')]=[{'all':!![]}];}_0xbb7285=_[_0xc4fd('0x43')]({},_0xbb7285,_0x45a9fe[_0xc4fd('0x46')]);return db[_0xc4fd('0x47')][_0xc4fd('0x4d')](_0xbb7285)['then'](handleEntityNotFound(_0x277e53,null))[_0xc4fd('0x2c')](respondWithResult(_0x277e53,null))[_0xc4fd('0x4e')](handleError(_0x277e53,null));};exports[_0xc4fd('0x4f')]=function(_0x4861cc,_0x6dfbae){return db[_0xc4fd('0x47')][_0xc4fd('0x4f')](_0x4861cc[_0xc4fd('0x50')],{})[_0xc4fd('0x2c')](function(_0x5651ea){var _0x6a982b=_0x4861cc[_0xc4fd('0x51')][_0xc4fd('0x2d')]({'plain':!![]});if(!_0x6a982b)throw new Error(_0xc4fd('0x52'));if(_0x6a982b['role']===_0xc4fd('0x51')){var _0x20ae7e=_0x5651ea[_0xc4fd('0x2d')]({'plain':!![]});var _0x494738=_0xc4fd('0x53');return db[_0xc4fd('0x54')]['find']({'where':{'name':_0x494738,'userProfileId':_0x6a982b['userProfileId']},'raw':!![]})[_0xc4fd('0x2c')](function(_0x453a8e){if(_0x453a8e&&_0x453a8e[_0xc4fd('0x55')]===0x0){return db[_0xc4fd('0x56')][_0xc4fd('0x4f')]({'name':_0x20ae7e['name'],'resourceId':_0x20ae7e['id'],'type':_0x453a8e[_0xc4fd('0x32')],'sectionId':_0x453a8e['id']},{})[_0xc4fd('0x2c')](function(){return _0x5651ea;});}else{return _0x5651ea;}})[_0xc4fd('0x4e')](function(_0x4c945a){logger['error'](_0xc4fd('0x57'),_0x4c945a);throw _0x4c945a;});}return _0x5651ea;})[_0xc4fd('0x2c')](respondWithResult(_0x6dfbae,0xc9))[_0xc4fd('0x4e')](handleError(_0x6dfbae,null));};exports[_0xc4fd('0x2b')]=function(_0x9269e,_0x25def5){if(_0x9269e[_0xc4fd('0x50')]['id']){delete _0x9269e[_0xc4fd('0x50')]['id'];}return db[_0xc4fd('0x47')]['find']({'where':{'id':_0x9269e[_0xc4fd('0x4b')]['id']}})[_0xc4fd('0x2c')](handleEntityNotFound(_0x25def5,null))[_0xc4fd('0x2c')](saveUpdates(_0x9269e[_0xc4fd('0x50')],null))['then'](respondWithResult(_0x25def5,null))[_0xc4fd('0x4e')](handleError(_0x25def5,null));};exports[_0xc4fd('0x2e')]=function(_0x3575eb,_0x76add1){return db['FaxQueue'][_0xc4fd('0x4d')]({'where':{'id':_0x3575eb[_0xc4fd('0x4b')]['id']}})[_0xc4fd('0x2c')](handleEntityNotFound(_0x76add1,null))[_0xc4fd('0x2c')](removeEntity(_0x76add1,null))['catch'](handleError(_0x76add1,null));};exports[_0xc4fd('0x58')]=function(_0x5b42c7,_0x1ccb67){return db['FaxQueue'][_0xc4fd('0x58')]()[_0xc4fd('0x2c')](respondWithResult(_0x1ccb67,null))[_0xc4fd('0x4e')](handleError(_0x1ccb67,null));};exports[_0xc4fd('0x59')]=function(_0x2cdb0d,_0x1f93bb,_0x17293e){var _0x26d187={'raw':!![],'where':{}},_0x18db72={},_0x3e8168;return db[_0xc4fd('0x47')][_0xc4fd('0x5a')]({'where':{'id':_0x2cdb0d[_0xc4fd('0x4b')]['id']}})[_0xc4fd('0x2c')](handleEntityNotFound(_0x1f93bb,null))[_0xc4fd('0x2c')](function(_0x26e86c){if(_0x26e86c){_0x3e8168=_0x26e86c['get']({'plain':!![]});_0x18db72[_0xc4fd('0x37')]=_['keys'](db[_0xc4fd('0x5b')][_0xc4fd('0x35')]);_0x18db72[_0xc4fd('0x39')]=_['keys'](_0x2cdb0d[_0xc4fd('0x39')]);_0x18db72['filters']=_['intersection'](_0x18db72['model'],_0x18db72[_0xc4fd('0x39')]);_0x26d187['attributes']=_[_0xc4fd('0x3b')](_0x18db72[_0xc4fd('0x37')],qs['fields'](_0x2cdb0d[_0xc4fd('0x39')]['fields']));_0x26d187['attributes']=_0x26d187[_0xc4fd('0x3d')][_0xc4fd('0x3e')]?_0x26d187['attributes']:_0x18db72[_0xc4fd('0x37')];if(!_0x2cdb0d[_0xc4fd('0x39')][_0xc4fd('0x5c')](_0xc4fd('0x5d'))){_0x26d187[_0xc4fd('0x24')]=qs[_0xc4fd('0x24')](_0x2cdb0d[_0xc4fd('0x39')][_0xc4fd('0x24')]);_0x26d187[_0xc4fd('0x22')]=qs[_0xc4fd('0x22')](_0x2cdb0d[_0xc4fd('0x39')][_0xc4fd('0x22')]);}_0x26d187[_0xc4fd('0x5e')]=qs['sort'](_0x2cdb0d[_0xc4fd('0x39')][_0xc4fd('0x3f')]);_0x26d187[_0xc4fd('0x40')]=qs[_0xc4fd('0x41')](_[_0xc4fd('0x5f')](_0x2cdb0d[_0xc4fd('0x39')],_0x18db72['filters']));_0x26d187[_0xc4fd('0x40')][_0xc4fd('0x60')]=_0x26e86c['id'];if(_0x2cdb0d[_0xc4fd('0x39')][_0xc4fd('0x42')]){_0x26d187[_0xc4fd('0x40')]=_['merge'](_0x26d187[_0xc4fd('0x40')],{'$or':_[_0xc4fd('0x38')](_0x26d187[_0xc4fd('0x3d')],function(_0x519ab6){var _0x292fbc={};_0x292fbc[_0x519ab6]={'$like':'%'+_0x2cdb0d[_0xc4fd('0x39')][_0xc4fd('0x42')]+'%'};return _0x292fbc;})});}_0x26d187=_[_0xc4fd('0x43')]({},_0x26d187,_0x2cdb0d[_0xc4fd('0x46')]);return db[_0xc4fd('0x5b')]['findAll'](_0x26d187);}})[_0xc4fd('0x2c')](function(_0x15564d){if(_0x15564d){return db['User']['findAndCountAll']({'where':{'id':_[_0xc4fd('0x38')](_0x15564d,_0xc4fd('0x61')),'role':_0xc4fd('0x62')},'attributes':['id',_0xc4fd('0x32'),_0xc4fd('0x63'),_0xc4fd('0x64'),_0xc4fd('0x65')]});}})[_0xc4fd('0x2c')](function(_0x5b8fb8){if(_0x5b8fb8){return{'count':_0x5b8fb8[_0xc4fd('0x25')],'rows':_[_0xc4fd('0x38')](_0x5b8fb8[_0xc4fd('0x66')],function(_0x4c04a6){return{'membername':_0x4c04a6[_0xc4fd('0x32')],'UserId':_0x4c04a6['id'],'queue_name':_0x3e8168['name'],'FaxQueueId':_0x3e8168['id'],'interface':util['format'](_0xc4fd('0x67'),_0xc4fd('0x68'),_0x4c04a6[_0xc4fd('0x32')]),'penalty':0x0,'paused':_0x4c04a6[_0xc4fd('0x63')],'createdAt':_0x4c04a6['createdAt'],'updatedAt':_0x4c04a6[_0xc4fd('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc4fd('0x2c')](respondWithFilteredResult(_0x1f93bb,_0x26d187))[_0xc4fd('0x4e')](handleError(_0x1f93bb,null));};exports[_0xc4fd('0x69')]=function(_0x4725e8,_0x436fe0,_0x1e1dad){var _0x5d0ddf={};var _0x2541d6={};var _0x28fdec;var _0x380334;return db[_0xc4fd('0x47')][_0xc4fd('0x5a')]({'where':{'id':_0x4725e8[_0xc4fd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x436fe0,null))[_0xc4fd('0x2c')](function(_0x4ce2c3){if(_0x4ce2c3){_0x28fdec=_0x4ce2c3;_0x2541d6[_0xc4fd('0x37')]=_[_0xc4fd('0x3a')](db['Team'][_0xc4fd('0x35')]);_0x2541d6[_0xc4fd('0x39')]=_[_0xc4fd('0x3a')](_0x4725e8['query']);_0x2541d6[_0xc4fd('0x41')]=_[_0xc4fd('0x3b')](_0x2541d6['model'],_0x2541d6[_0xc4fd('0x39')]);_0x5d0ddf[_0xc4fd('0x3d')]=_[_0xc4fd('0x3b')](_0x2541d6[_0xc4fd('0x37')],qs[_0xc4fd('0x3c')](_0x4725e8['query'][_0xc4fd('0x3c')]));_0x5d0ddf[_0xc4fd('0x3d')]=_0x5d0ddf[_0xc4fd('0x3d')][_0xc4fd('0x3e')]?_0x5d0ddf[_0xc4fd('0x3d')]:_0x2541d6[_0xc4fd('0x37')];_0x5d0ddf['order']=qs[_0xc4fd('0x3f')](_0x4725e8[_0xc4fd('0x39')][_0xc4fd('0x3f')]);_0x5d0ddf[_0xc4fd('0x40')]=qs['filters'](_[_0xc4fd('0x5f')](_0x4725e8[_0xc4fd('0x39')],_0x2541d6[_0xc4fd('0x41')]));if(_0x4725e8[_0xc4fd('0x39')][_0xc4fd('0x42')]){_0x5d0ddf[_0xc4fd('0x40')]=_[_0xc4fd('0x43')](_0x5d0ddf[_0xc4fd('0x40')],{'$or':_[_0xc4fd('0x38')](_0x5d0ddf[_0xc4fd('0x3d')],function(_0x297c64){var _0xd2b316={};_0xd2b316[_0x297c64]={'$like':'%'+_0x4725e8[_0xc4fd('0x39')][_0xc4fd('0x42')]+'%'};return _0xd2b316;})});}_0x5d0ddf=_[_0xc4fd('0x43')]({},_0x5d0ddf,_0x4725e8[_0xc4fd('0x46')]);return _0x28fdec['getTeams'](_0x5d0ddf);}})[_0xc4fd('0x2c')](function(_0x140d13){if(_0x140d13){_0x380334=_0x140d13[_0xc4fd('0x3e')];if(!_0x4725e8[_0xc4fd('0x39')][_0xc4fd('0x5c')](_0xc4fd('0x5d'))){_0x5d0ddf[_0xc4fd('0x24')]=qs[_0xc4fd('0x24')](_0x4725e8[_0xc4fd('0x39')][_0xc4fd('0x24')]);_0x5d0ddf[_0xc4fd('0x22')]=qs[_0xc4fd('0x22')](_0x4725e8[_0xc4fd('0x39')][_0xc4fd('0x22')]);}return _0x28fdec[_0xc4fd('0x69')](_0x5d0ddf);}})[_0xc4fd('0x2c')](function(_0x434551){if(_0x434551){return _0x434551?{'count':_0x380334,'rows':_0x434551}:null;}})[_0xc4fd('0x2c')](respondWithResult(_0x436fe0,null))[_0xc4fd('0x4e')](handleError(_0x436fe0,null));};exports[_0xc4fd('0x6a')]=function(_0x5b7f54,_0xcc9229,_0x3b974f){var _0x96ac97=_0x5b7f54['body']['ids'];return db[_0xc4fd('0x6b')][_0xc4fd('0x49')]({'where':{'id':_0x96ac97},'attributes':['id'],'include':[{'model':db[_0xc4fd('0x6c')],'as':_0xc4fd('0x6d'),'attributes':['id',_0xc4fd('0x32'),_0xc4fd('0x6e'),_0xc4fd('0x6f'),_0xc4fd('0x70')],'raw':!![]}]})[_0xc4fd('0x2c')](function(_0xfa863){if(_0xfa863){var _0x1a6871=_[_0xc4fd('0x71')](_0xfa863,function(_0x4433f0){var _0x1b60bd=_0x4433f0['get']({'plain':!![]});return _0x1b60bd[_0xc4fd('0x6d')];});return db[_0xc4fd('0x47')]['find']({'where':{'id':_0x5b7f54[_0xc4fd('0x4b')]['id']}})[_0xc4fd('0x2c')](function(_0x54d14f){return db['sequelize'][_0xc4fd('0x72')](function(_0x4e95a9){return _0x54d14f['addTeams'](_0x96ac97,{'transaction':_0x4e95a9})[_0xc4fd('0x2c')](function(){return BPromise[_0xc4fd('0x73')](_0x1a6871,function(_0x3c8bd0){return db[_0xc4fd('0x5b')][_0xc4fd('0x74')]({'where':{'UserId':_0x3c8bd0['id'],'FaxQueueId':_0x5b7f54[_0xc4fd('0x4b')]['id']},'transaction':_0x4e95a9});});})['then'](function(){_0x1a6871[_0xc4fd('0x75')](function(_0x22b90f){socket[_0xc4fd('0x76')](_0xc4fd('0x77'),{'UserId':_0x22b90f['id'],'FaxQueueId':_0x54d14f['id']});});});});});}})[_0xc4fd('0x2c')](respondWithStatusCode(_0xcc9229,null))[_0xc4fd('0x4e')](handleError(_0xcc9229,null));};exports[_0xc4fd('0x78')]=function(_0x352a47,_0xd0a21b,_0x4ed1de){return db['Team'][_0xc4fd('0x49')]({'where':{'id':_0x352a47['query'][_0xc4fd('0x79')]},'attributes':['id'],'include':[{'model':db[_0xc4fd('0x6c')],'as':_0xc4fd('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xd0a21b,null))[_0xc4fd('0x2c')](function(_0x375e84){var _0x52a6bd=_[_0xc4fd('0x38')](_0x375e84,'id');var _0x390295=[];var _0x57b96d=[];var _0x4ca115=squel['select']();_0x4ca115['field'](_0xc4fd('0x7a'))['from'](_0xc4fd('0x7b'),'tq')['join'](_0xc4fd('0x7c'),'ut',_0xc4fd('0x7d'))['where'](_0xc4fd('0x7e'),_0x352a47[_0xc4fd('0x4b')]['id']);for(var _0x19baed=0x0;_0x19baed<_0x375e84[_0xc4fd('0x3e')];_0x19baed+=0x1){let _0x1660ad=_0x375e84[_0x19baed];for(var _0x2fd8c9=0x0;_0x2fd8c9<_0x1660ad['Agents'][_0xc4fd('0x3e')];_0x2fd8c9+=0x1){let _0x1b55ce=_0x1660ad[_0xc4fd('0x6d')][_0x2fd8c9];var _0x19c766=_0x4ca115[_0xc4fd('0x7f')]();_0x19c766[_0xc4fd('0x40')](_0xc4fd('0x80'),_0x1b55ce['id']);_0x57b96d[_0xc4fd('0x81')](db['sequelize']['query'](_0x19c766[_0xc4fd('0x82')](),{'type':db[_0xc4fd('0x83')][_0xc4fd('0x84')][_0xc4fd('0x85')]})[_0xc4fd('0x2c')](function(_0x2050d9){if(_0x2050d9[_0xc4fd('0x3e')]===0x1){return _0x1b55ce['id'];}else{var _0x4b599a=_[_0xc4fd('0x86')](_[_0xc4fd('0x38')](_0x2050d9,_0xc4fd('0x87')),function(_0x25b5b3){return _[_0xc4fd('0x88')](_0x52a6bd,_0x25b5b3);});if(_0x4b599a){return _0x1b55ce['id'];}}}));}}return BPromise[_0xc4fd('0x89')](_0x57b96d)['then'](function(_0x315119){_0x390295=_(_0x390295)[_0xc4fd('0x8a')](_0x315119)[_0xc4fd('0x8b')]()[_0xc4fd('0x8c')]();return db[_0xc4fd('0x47')][_0xc4fd('0x4d')]({'where':{'id':_0x352a47['params']['id']}})[_0xc4fd('0x2c')](function(_0x95af08){return db['sequelize'][_0xc4fd('0x72')](function(_0x10def0){return _0x95af08[_0xc4fd('0x78')](_0x352a47['query'][_0xc4fd('0x79')],{'transaction':_0x10def0})['then'](function(){if(!_[_0xc4fd('0x8d')](_0x390295)){return _0x95af08[_0xc4fd('0x8e')](_0x390295,{'transaction':_0x10def0});}})[_0xc4fd('0x2c')](function(){_0x390295[_0xc4fd('0x75')](function(_0x40c482){socket[_0xc4fd('0x76')]('userFaxQueue:remove',{'UserId':_0x40c482,'FaxQueueId':_0x95af08['id']});});});});});});})[_0xc4fd('0x2c')](respondWithStatusCode(_0xd0a21b,null))['catch'](handleError(_0xd0a21b,null));};exports['addAgents']=function(_0x1dbe55,_0x281287,_0x5d1f75){return db[_0xc4fd('0x47')][_0xc4fd('0x4d')]({'where':{'id':_0x1dbe55[_0xc4fd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x281287,null))[_0xc4fd('0x2c')](function(_0x36daf8){if(_0x36daf8){return _0x36daf8[_0xc4fd('0x8f')](_0x1dbe55[_0xc4fd('0x50')][_0xc4fd('0x79')],_['omit'](_0x1dbe55[_0xc4fd('0x50')],[_0xc4fd('0x79'),'id'])||{})[_0xc4fd('0x90')](function(_0x3c1cbf){for(var _0x38cc1d=0x0;_0x38cc1d<_0x1dbe55['body'][_0xc4fd('0x79')][_0xc4fd('0x3e')];_0x38cc1d+=0x1){socket[_0xc4fd('0x76')](_0xc4fd('0x77'),{'UserId':Number(_0x1dbe55['body']['ids'][_0x38cc1d]),'FaxQueueId':Number(_0x1dbe55[_0xc4fd('0x4b')]['id'])});}return _0x3c1cbf;});}})[_0xc4fd('0x2c')](respondWithResult(_0x281287,null))['catch'](handleError(_0x281287,null));};exports[_0xc4fd('0x8e')]=function(_0x4f8f96,_0x3ba5db,_0x10fd14){return db[_0xc4fd('0x47')][_0xc4fd('0x4d')]({'where':{'id':_0x4f8f96[_0xc4fd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ba5db,null))[_0xc4fd('0x2c')](function(_0x130046){if(_0x130046){return _0x130046[_0xc4fd('0x8e')](_0x4f8f96[_0xc4fd('0x39')]['ids'])['then'](function(){if(_[_0xc4fd('0x91')](_0x4f8f96[_0xc4fd('0x39')][_0xc4fd('0x79')])){for(var _0x4b2eba=0x0;_0x4b2eba<_0x4f8f96['query'][_0xc4fd('0x79')][_0xc4fd('0x3e')];_0x4b2eba+=0x1){socket['emit'](_0xc4fd('0x92'),{'UserId':Number(_0x4f8f96[_0xc4fd('0x39')][_0xc4fd('0x79')][_0x4b2eba]),'FaxQueueId':Number(_0x4f8f96[_0xc4fd('0x4b')]['id'])});}}else{socket['emit'](_0xc4fd('0x92'),{'UserId':Number(_0x4f8f96[_0xc4fd('0x39')][_0xc4fd('0x79')]),'FaxQueueId':Number(_0x4f8f96['params']['id'])});}});}})[_0xc4fd('0x2c')](respondWithStatusCode(_0x3ba5db,null))[_0xc4fd('0x4e')](handleError(_0x3ba5db,null));};exports['getAgents']=function(_0x1f1936,_0x3631cd,_0x50dd8b){var _0x20efef={};var _0x1cf3d8={};var _0x4d850d;var _0x159be4;return db['FaxQueue'][_0xc4fd('0x5a')]({'where':{'id':_0x1f1936[_0xc4fd('0x4b')]['id']}})[_0xc4fd('0x2c')](handleEntityNotFound(_0x3631cd,null))[_0xc4fd('0x2c')](function(_0x39b5aa){if(_0x39b5aa){_0x4d850d=_0x39b5aa;_0x1cf3d8[_0xc4fd('0x37')]=_[_0xc4fd('0x3a')](db[_0xc4fd('0x6c')][_0xc4fd('0x35')]);_0x1cf3d8[_0xc4fd('0x39')]=_['keys'](_0x1f1936[_0xc4fd('0x39')]);_0x1cf3d8['filters']=_[_0xc4fd('0x3b')](_0x1cf3d8['model'],_0x1cf3d8[_0xc4fd('0x39')]);_0x20efef[_0xc4fd('0x3d')]=_[_0xc4fd('0x3b')](_0x1cf3d8[_0xc4fd('0x37')],qs['fields'](_0x1f1936[_0xc4fd('0x39')][_0xc4fd('0x3c')]));_0x20efef[_0xc4fd('0x3d')]=_0x20efef[_0xc4fd('0x3d')]['length']?_0x20efef['attributes']:_0x1cf3d8[_0xc4fd('0x37')];_0x20efef[_0xc4fd('0x5e')]=qs[_0xc4fd('0x3f')](_0x1f1936[_0xc4fd('0x39')]['sort']);_0x20efef[_0xc4fd('0x40')]=qs[_0xc4fd('0x41')](_[_0xc4fd('0x5f')](_0x1f1936['query'],_0x1cf3d8[_0xc4fd('0x41')]));if(_0x1f1936['query']['filter']){_0x20efef['where']=_[_0xc4fd('0x43')](_0x20efef['where'],{'$or':_[_0xc4fd('0x38')](_0x20efef[_0xc4fd('0x3d')],function(_0xe08f41){var _0x558812={};_0x558812[_0xe08f41]={'$like':'%'+_0x1f1936['query'][_0xc4fd('0x42')]+'%'};return _0x558812;})});}_0x20efef=_[_0xc4fd('0x43')]({},_0x20efef,_0x1f1936['options']);return _0x4d850d[_0xc4fd('0x93')](_0x20efef);}})['then'](function(_0x2508b0){if(_0x2508b0){_0x159be4=_0x2508b0['length'];if(!_0x1f1936['query']['hasOwnProperty'](_0xc4fd('0x5d'))){_0x20efef[_0xc4fd('0x24')]=qs[_0xc4fd('0x24')](_0x1f1936[_0xc4fd('0x39')][_0xc4fd('0x24')]);_0x20efef[_0xc4fd('0x22')]=qs[_0xc4fd('0x22')](_0x1f1936[_0xc4fd('0x39')][_0xc4fd('0x22')]);}return _0x4d850d[_0xc4fd('0x93')](_0x20efef);}})['then'](function(_0x509ec9){if(_0x509ec9){return _0x509ec9?{'count':_0x159be4,'rows':_0x509ec9}:null;}})[_0xc4fd('0x2c')](respondWithResult(_0x3631cd,null))['catch'](handleError(_0x3631cd,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index e8d60bc..cfa5803 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 _0x3ff4=['hasOwnProperty','hook','events','FaxQueue','setMaxListeners','save','update','remove','emit'];(function(_0x44edea,_0x3b4e6d){var _0x2b4b78=function(_0x1c53b3){while(--_0x1c53b3){_0x44edea['push'](_0x44edea['shift']());}};_0x2b4b78(++_0x3b4e6d);}(_0x3ff4,0xad));var _0x43ff=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3ff4[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0x43ff('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x43ff('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x43ff('0x2')](0x0);var events={'afterCreate':_0x43ff('0x3'),'afterUpdate':_0x43ff('0x4'),'afterDestroy':_0x43ff('0x5')};function emitEvent(_0x4d49f9){return function(_0x3966ee,_0x3e8168,_0x56236c){FaxQueueEvents['emit'](_0x4d49f9+':'+_0x3966ee['id'],_0x3966ee);FaxQueueEvents[_0x43ff('0x6')](_0x4d49f9,_0x3966ee);_0x56236c(null);};}for(var e in events){if(events[_0x43ff('0x7')](e)){var event=events[e];FaxQueue[_0x43ff('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x1f6f=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x944797,_0x147b4c){var _0x1908ca=function(_0x5bde5f){while(--_0x5bde5f){_0x944797['push'](_0x944797['shift']());}};_0x1908ca(++_0x147b4c);}(_0x1f6f,0x101));var _0xf1f6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1f6f[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xf1f6('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf1f6('0x1')](0x0);var events={'afterCreate':_0xf1f6('0x2'),'afterUpdate':_0xf1f6('0x3'),'afterDestroy':_0xf1f6('0x4')};function emitEvent(_0x3ba9e9){return function(_0x5b9174,_0x203e02,_0x370b3c){FaxQueueEvents[_0xf1f6('0x5')](_0x3ba9e9+':'+_0x5b9174['id'],_0x5b9174);FaxQueueEvents[_0xf1f6('0x5')](_0x3ba9e9,_0x5b9174);_0x370b3c(null);};}for(var e in events){if(events[_0xf1f6('0x6')](e)){var event=events[e];FaxQueue[_0xf1f6('0x7')](e,emitEvent(event));}}module[_0xf1f6('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 5cb8f45..d06d478 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 _0xb7b6=['api','bluebird','path','../../config/environment','./faxQueue.attributes','FaxQueue','util','../../config/logger'];(function(_0x353d52,_0x57f89d){var _0x561d2a=function(_0x1fa168){while(--_0x1fa168){_0x353d52['push'](_0x353d52['shift']());}};_0x561d2a(++_0x57f89d);}(_0xb7b6,0x14e));var _0x6b7b=function(_0x3ce580,_0x32a051){_0x3ce580=_0x3ce580-0x0;var _0x2e5dd6=_0xb7b6[_0x3ce580];return _0x2e5dd6;};'use strict';var _=require('lodash');var util=require(_0x6b7b('0x0'));var logger=require(_0x6b7b('0x1'))(_0x6b7b('0x2'));var moment=require('moment');var BPromise=require(_0x6b7b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b7b('0x4'));var rimraf=require('rimraf');var config=require(_0x6b7b('0x5'));var attributes=require(_0x6b7b('0x6'));module['exports']=function(_0x36a632,_0x36b433){return _0x36a632['define'](_0x6b7b('0x7'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa502=['request-promise','path','rimraf','../../config/environment','exports','FaxQueue','fax_queues','util','api','bluebird'];(function(_0x16946b,_0x5ea65a){var _0x322ea3=function(_0x131958){while(--_0x131958){_0x16946b['push'](_0x16946b['shift']());}};_0x322ea3(++_0x5ea65a);}(_0xa502,0x9d));var _0x2a50=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa502[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x2a50('0x0'));var logger=require('../../config/logger')(_0x2a50('0x1'));var moment=require('moment');var BPromise=require(_0x2a50('0x2'));var rp=require(_0x2a50('0x3'));var fs=require('fs');var path=require(_0x2a50('0x4'));var rimraf=require(_0x2a50('0x5'));var config=require(_0x2a50('0x6'));var attributes=require('./faxQueue.attributes');module[_0x2a50('0x7')]=function(_0x1326a1,_0xdcc7bb){return _0x1326a1['define'](_0x2a50('0x8'),attributes,{'tableName':_0x2a50('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 7b29758..3fba99c 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 _0xc602=['client','http','redis','defaults','localhost','./faxQueue.socket','register','request','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','attributes','include','map','model','then','ShowFaxQueue','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1191ef,_0xa7b6e0){var _0x4e6175=function(_0x2c711c){while(--_0x2c711c){_0x1191ef['push'](_0x1191ef['shift']());}};_0x4e6175(++_0xa7b6e0);}(_0xc602,0x18f));var _0x2c60=function(_0x342bba,_0x5d05de){_0x342bba=_0x342bba-0x0;var _0x179cf5=_0xc602[_0x342bba];return _0x179cf5;};'use strict';var _=require(_0x2c60('0x0'));var util=require(_0x2c60('0x1'));var moment=require(_0x2c60('0x2'));var BPromise=require(_0x2c60('0x3'));var rs=require(_0x2c60('0x4'));var fs=require('fs');var Redis=require(_0x2c60('0x5'));var db=require(_0x2c60('0x6'))['db'];var utils=require(_0x2c60('0x7'));var logger=require(_0x2c60('0x8'))(_0x2c60('0x9'));var config=require('../../config/environment');var jayson=require(_0x2c60('0xa'));var client=jayson[_0x2c60('0xb')][_0x2c60('0xc')]({'port':0x232a});config[_0x2c60('0xd')]=_[_0x2c60('0xe')](config[_0x2c60('0xd')],{'host':_0x2c60('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2c60('0x10'))[_0x2c60('0x11')](socket);function respondWithRpcPromise(_0x567e6e,_0x247204,_0x1bed20){return new BPromise(function(_0x11052d,_0x21b948){return client[_0x2c60('0x12')](_0x567e6e,_0x1bed20)['then'](function(_0x424dec){logger['info'](_0x2c60('0x13'),_0x247204,_0x2c60('0x14'));logger[_0x2c60('0x15')](_0x2c60('0x16'),_0x247204,_0x2c60('0x14'),JSON[_0x2c60('0x17')](_0x424dec));if(_0x424dec[_0x2c60('0x18')]){if(_0x424dec['error']['code']===0x1f4){logger[_0x2c60('0x18')](_0x2c60('0x13'),_0x247204,_0x424dec[_0x2c60('0x18')]['message']);return _0x21b948(_0x424dec[_0x2c60('0x18')][_0x2c60('0x19')]);}logger[_0x2c60('0x18')](_0x2c60('0x13'),_0x247204,_0x424dec['error']['message']);return _0x11052d(_0x424dec['error'][_0x2c60('0x19')]);}else{logger[_0x2c60('0x1a')]('FaxQueue,\x20%s,\x20%s',_0x247204,_0x2c60('0x14'));_0x11052d(_0x424dec[_0x2c60('0x1b')][_0x2c60('0x19')]);}})[_0x2c60('0x1c')](function(_0x56bfe1){logger['error'](_0x2c60('0x13'),_0x247204,_0x56bfe1);_0x21b948(_0x56bfe1);});});}exports[_0x2c60('0x1d')]=function(_0x5e5e96){var _0x16db50=this;return new Promise(function(_0x35f2da,_0x2cfa63){return db[_0x2c60('0x1e')][_0x2c60('0x1f')]({'raw':_0x5e5e96[_0x2c60('0x20')]?_0x5e5e96[_0x2c60('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x5e5e96[_0x2c60('0x20')]?_0x5e5e96[_0x2c60('0x20')]['where']||null:null,'attributes':_0x5e5e96[_0x2c60('0x20')]?_0x5e5e96['options'][_0x2c60('0x21')]||null:null,'limit':_0x5e5e96[_0x2c60('0x20')]?_0x5e5e96['options']['limit']||null:null,'include':_0x5e5e96['options']?_0x5e5e96['options'][_0x2c60('0x22')]?_['map'](_0x5e5e96[_0x2c60('0x20')][_0x2c60('0x22')],function(_0x34b9e6){return{'model':db[_0x34b9e6['model']],'as':_0x34b9e6['as'],'attributes':_0x34b9e6[_0x2c60('0x21')],'include':_0x34b9e6[_0x2c60('0x22')]?_['map'](_0x34b9e6[_0x2c60('0x22')],function(_0x5f3a9e){return{'model':db[_0x5f3a9e['model']],'as':_0x5f3a9e['as'],'attributes':_0x5f3a9e[_0x2c60('0x21')],'include':_0x5f3a9e[_0x2c60('0x22')]?_[_0x2c60('0x23')](_0x5f3a9e[_0x2c60('0x22')],function(_0x545ea8){return{'model':db[_0x545ea8[_0x2c60('0x24')]],'as':_0x545ea8['as'],'attributes':_0x545ea8[_0x2c60('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2c60('0x25')](function(_0x32ae9f){logger[_0x2c60('0x1a')](_0x2c60('0x1d'),_0x5e5e96);logger['debug'](_0x2c60('0x1d'),_0x5e5e96,JSON['stringify'](_0x32ae9f));_0x35f2da(_0x32ae9f);})[_0x2c60('0x1c')](function(_0x59ad8b){logger[_0x2c60('0x18')](_0x2c60('0x1d'),_0x59ad8b[_0x2c60('0x19')],_0x5e5e96);_0x2cfa63(_0x16db50['error'](0x1f4,_0x59ad8b['message']));});});};exports[_0x2c60('0x26')]=function(_0x49ce50){var _0x33bebf=this;return new Promise(function(_0x468457,_0x38568e){return db[_0x2c60('0x1e')]['find']({'raw':_0x49ce50['options']?_0x49ce50[_0x2c60('0x20')][_0x2c60('0x27')]===undefined?!![]:![]:!![],'where':_0x49ce50[_0x2c60('0x20')]?_0x49ce50[_0x2c60('0x20')][_0x2c60('0x28')]||null:null,'attributes':_0x49ce50['options']?_0x49ce50[_0x2c60('0x20')]['attributes']||null:null,'include':_0x49ce50['options']?_0x49ce50[_0x2c60('0x20')][_0x2c60('0x22')]?_[_0x2c60('0x23')](_0x49ce50[_0x2c60('0x20')][_0x2c60('0x22')],function(_0x477644){return{'model':db[_0x477644[_0x2c60('0x24')]],'as':_0x477644['as'],'attributes':_0x477644[_0x2c60('0x21')],'include':_0x477644[_0x2c60('0x22')]?_[_0x2c60('0x23')](_0x477644['include'],function(_0x22bb39){return{'model':db[_0x22bb39[_0x2c60('0x24')]],'as':_0x22bb39['as'],'attributes':_0x22bb39[_0x2c60('0x21')],'include':_0x22bb39[_0x2c60('0x22')]?_['map'](_0x22bb39[_0x2c60('0x22')],function(_0x2f8abc){return{'model':db[_0x2f8abc[_0x2c60('0x24')]],'as':_0x2f8abc['as'],'attributes':_0x2f8abc[_0x2c60('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2c60('0x25')](function(_0x21001a){logger[_0x2c60('0x1a')]('ShowFaxQueue',_0x49ce50);logger[_0x2c60('0x15')](_0x2c60('0x26'),_0x49ce50,JSON['stringify'](_0x21001a));_0x468457(_0x21001a);})[_0x2c60('0x1c')](function(_0x4b6121){logger[_0x2c60('0x18')]('ShowFaxQueue',_0x4b6121[_0x2c60('0x19')],_0x49ce50);_0x38568e(_0x33bebf['error'](0x1f4,_0x4b6121[_0x2c60('0x19')]));});});}; \ No newline at end of file +var _0x9ecd=['then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','FaxQueue','findAll','options','raw','where','attributes','map','include','model','GetFaxQueue','stringify','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x265094,_0x18c961){var _0x71f9c2=function(_0x548e38){while(--_0x548e38){_0x265094['push'](_0x265094['shift']());}};_0x71f9c2(++_0x18c961);}(_0x9ecd,0xb1));var _0xd9ec=function(_0x468871,_0x26f642){_0x468871=_0x468871-0x0;var _0x1bac93=_0x9ecd[_0x468871];return _0x1bac93;};'use strict';var _=require(_0xd9ec('0x0'));var util=require(_0xd9ec('0x1'));var moment=require(_0xd9ec('0x2'));var BPromise=require(_0xd9ec('0x3'));var rs=require(_0xd9ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9ec('0x5'))['db'];var utils=require(_0xd9ec('0x6'));var logger=require(_0xd9ec('0x7'))(_0xd9ec('0x8'));var config=require(_0xd9ec('0x9'));var jayson=require(_0xd9ec('0xa'));var client=jayson[_0xd9ec('0xb')]['http']({'port':0x232a});config[_0xd9ec('0xc')]=_[_0xd9ec('0xd')](config[_0xd9ec('0xc')],{'host':_0xd9ec('0xe'),'port':0x18eb});var socket=require(_0xd9ec('0xf'))(new Redis(config[_0xd9ec('0xc')]));require('./faxQueue.socket')[_0xd9ec('0x10')](socket);function respondWithRpcPromise(_0x465a48,_0x104d53,_0x397130){return new BPromise(function(_0x37153c,_0x28a84f){return client[_0xd9ec('0x11')](_0x465a48,_0x397130)[_0xd9ec('0x12')](function(_0x2fb6d6){logger['info'](_0xd9ec('0x13'),_0x104d53,_0xd9ec('0x14'));logger[_0xd9ec('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x104d53,_0xd9ec('0x14'),JSON['stringify'](_0x2fb6d6));if(_0x2fb6d6[_0xd9ec('0x16')]){if(_0x2fb6d6[_0xd9ec('0x16')]['code']===0x1f4){logger[_0xd9ec('0x16')](_0xd9ec('0x13'),_0x104d53,_0x2fb6d6[_0xd9ec('0x16')]['message']);return _0x28a84f(_0x2fb6d6[_0xd9ec('0x16')]['message']);}logger[_0xd9ec('0x16')](_0xd9ec('0x13'),_0x104d53,_0x2fb6d6[_0xd9ec('0x16')][_0xd9ec('0x17')]);return _0x37153c(_0x2fb6d6[_0xd9ec('0x16')][_0xd9ec('0x17')]);}else{logger[_0xd9ec('0x18')](_0xd9ec('0x13'),_0x104d53,'request\x20sent');_0x37153c(_0x2fb6d6[_0xd9ec('0x19')][_0xd9ec('0x17')]);}})[_0xd9ec('0x1a')](function(_0x2ee79b){logger[_0xd9ec('0x16')](_0xd9ec('0x13'),_0x104d53,_0x2ee79b);_0x28a84f(_0x2ee79b);});});}exports['GetFaxQueue']=function(_0x90be9e){var _0x4cc6d6=this;return new Promise(function(_0x4ae542,_0x21a3e4){return db[_0xd9ec('0x1b')][_0xd9ec('0x1c')]({'raw':_0x90be9e[_0xd9ec('0x1d')]?_0x90be9e[_0xd9ec('0x1d')][_0xd9ec('0x1e')]===undefined?!![]:![]:!![],'where':_0x90be9e[_0xd9ec('0x1d')]?_0x90be9e['options'][_0xd9ec('0x1f')]||null:null,'attributes':_0x90be9e['options']?_0x90be9e['options'][_0xd9ec('0x20')]||null:null,'limit':_0x90be9e['options']?_0x90be9e[_0xd9ec('0x1d')]['limit']||null:null,'include':_0x90be9e['options']?_0x90be9e['options']['include']?_[_0xd9ec('0x21')](_0x90be9e[_0xd9ec('0x1d')]['include'],function(_0x208654){return{'model':db[_0x208654['model']],'as':_0x208654['as'],'attributes':_0x208654['attributes'],'include':_0x208654[_0xd9ec('0x22')]?_[_0xd9ec('0x21')](_0x208654[_0xd9ec('0x22')],function(_0x12732e){return{'model':db[_0x12732e[_0xd9ec('0x23')]],'as':_0x12732e['as'],'attributes':_0x12732e['attributes'],'include':_0x12732e['include']?_[_0xd9ec('0x21')](_0x12732e[_0xd9ec('0x22')],function(_0x367d11){return{'model':db[_0x367d11[_0xd9ec('0x23')]],'as':_0x367d11['as'],'attributes':_0x367d11[_0xd9ec('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd9ec('0x12')](function(_0x4acac7){logger['info'](_0xd9ec('0x24'),_0x90be9e);logger[_0xd9ec('0x15')]('GetFaxQueue',_0x90be9e,JSON[_0xd9ec('0x25')](_0x4acac7));_0x4ae542(_0x4acac7);})[_0xd9ec('0x1a')](function(_0x4829bf){logger['error'](_0xd9ec('0x24'),_0x4829bf[_0xd9ec('0x17')],_0x90be9e);_0x21a3e4(_0x4cc6d6['error'](0x1f4,_0x4829bf[_0xd9ec('0x17')]));});});};exports[_0xd9ec('0x26')]=function(_0x275ecf){var _0x288ba7=this;return new Promise(function(_0x43a7b4,_0x401f96){return db[_0xd9ec('0x1b')]['find']({'raw':_0x275ecf[_0xd9ec('0x1d')]?_0x275ecf[_0xd9ec('0x1d')][_0xd9ec('0x1e')]===undefined?!![]:![]:!![],'where':_0x275ecf['options']?_0x275ecf[_0xd9ec('0x1d')][_0xd9ec('0x1f')]||null:null,'attributes':_0x275ecf[_0xd9ec('0x1d')]?_0x275ecf['options']['attributes']||null:null,'include':_0x275ecf['options']?_0x275ecf[_0xd9ec('0x1d')]['include']?_[_0xd9ec('0x21')](_0x275ecf[_0xd9ec('0x1d')][_0xd9ec('0x22')],function(_0x32b572){return{'model':db[_0x32b572[_0xd9ec('0x23')]],'as':_0x32b572['as'],'attributes':_0x32b572[_0xd9ec('0x20')],'include':_0x32b572['include']?_['map'](_0x32b572[_0xd9ec('0x22')],function(_0x588079){return{'model':db[_0x588079[_0xd9ec('0x23')]],'as':_0x588079['as'],'attributes':_0x588079[_0xd9ec('0x20')],'include':_0x588079[_0xd9ec('0x22')]?_['map'](_0x588079[_0xd9ec('0x22')],function(_0x2ace5c){return{'model':db[_0x2ace5c[_0xd9ec('0x23')]],'as':_0x2ace5c['as'],'attributes':_0x2ace5c['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9ec('0x12')](function(_0x13e101){logger[_0xd9ec('0x18')](_0xd9ec('0x26'),_0x275ecf);logger[_0xd9ec('0x15')](_0xd9ec('0x26'),_0x275ecf,JSON[_0xd9ec('0x25')](_0x13e101));_0x43a7b4(_0x13e101);})[_0xd9ec('0x1a')](function(_0x1fa6fb){logger[_0xd9ec('0x16')](_0xd9ec('0x26'),_0x1fa6fb['message'],_0x275ecf);_0x401f96(_0x288ba7['error'](0x1f4,_0x1fa6fb[_0xd9ec('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 6f0878a..8070e03 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 _0x5394=['./faxQueue.events','save','update','emit','removeListener','register','faxQueue:'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5394,0x134));var _0x4539=function(_0xf62f27,_0x249f1d){_0xf62f27=_0xf62f27-0x0;var _0x4f7985=_0x5394[_0xf62f27];return _0x4f7985;};'use strict';var FaxQueueEvents=require(_0x4539('0x0'));var events=[_0x4539('0x1'),'remove',_0x4539('0x2')];function createListener(_0x5d9b68,_0x22cc78){return function(_0x28358b){_0x22cc78[_0x4539('0x3')](_0x5d9b68,_0x28358b);};}function removeListener(_0x598de5,_0x466576){return function(){FaxQueueEvents[_0x4539('0x4')](_0x598de5,_0x466576);};}exports[_0x4539('0x5')]=function(_0x59d68d){for(var _0x1830b2=0x0,_0x71ad6d=events['length'];_0x1830b2<_0x71ad6d;_0x1830b2++){var _0x5aafb0=events[_0x1830b2];var _0x35a7d9=createListener(_0x4539('0x6')+_0x5aafb0,_0x59d68d);FaxQueueEvents['on'](_0x5aafb0,_0x35a7d9);}}; \ No newline at end of file +var _0x35d7=['length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x35d7,0x1a9));var _0x735d=function(_0xfb8ebb,_0x32f0ad){_0xfb8ebb=_0xfb8ebb-0x0;var _0x1bd78d=_0x35d7[_0xfb8ebb];return _0x1bd78d;};'use strict';var FaxQueueEvents=require(_0x735d('0x0'));var events=[_0x735d('0x1'),_0x735d('0x2'),_0x735d('0x3')];function createListener(_0x20ae7e,_0x1b5110){return function(_0x4be047){_0x1b5110[_0x735d('0x4')](_0x20ae7e,_0x4be047);};}function removeListener(_0x3e5a93,_0x2c9d02){return function(){FaxQueueEvents[_0x735d('0x5')](_0x3e5a93,_0x2c9d02);};}exports[_0x735d('0x6')]=function(_0x1bf94a){for(var _0x1ed82b=0x0,_0x5883c6=events[_0x735d('0x7')];_0x1ed82b<_0x5883c6;_0x1ed82b++){var _0x1ef32b=events[_0x1ed82b];var _0x14b0f7=createListener(_0x735d('0x8')+_0x1ef32b,_0x1bf94a);FaxQueueEvents['on'](_0x1ef32b,_0x14b0f7);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 7a4983c..159a41e 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 _0x9fe7=['show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x1edd53,_0x3944e9){var _0x404a59=function(_0x35ece6){while(--_0x35ece6){_0x1edd53['push'](_0x1edd53['shift']());}};_0x404a59(++_0x3944e9);}(_0x9fe7,0x1df));var _0x79fe=function(_0xe4db4b,_0x54f6af){_0xe4db4b=_0xe4db4b-0x0;var _0x5d7ac0=_0x9fe7[_0xe4db4b];return _0x5d7ac0;};'use strict';var multer=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var path=require('path');var timeout=require(_0x79fe('0x2'));var express=require('express');var router=express[_0x79fe('0x3')]();var fs_extra=require(_0x79fe('0x4'));var auth=require(_0x79fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x79fe('0x6'));var controller=require(_0x79fe('0x7'));router[_0x79fe('0x8')]('/',auth['isAuthenticated'](),controller[_0x79fe('0x9')]);router[_0x79fe('0x8')](_0x79fe('0xa'),auth['isAuthenticated'](),controller[_0x79fe('0xb')]);router[_0x79fe('0x8')](_0x79fe('0xc'),auth[_0x79fe('0xd')](),controller[_0x79fe('0xe')]);router['get'](_0x79fe('0xf'),auth[_0x79fe('0xd')](),controller['getMembers']);router[_0x79fe('0x8')](_0x79fe('0x10'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x11')]);router['get'](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x13')]);router[_0x79fe('0x14')]('/',auth[_0x79fe('0xd')](),controller[_0x79fe('0x15')]);router[_0x79fe('0x14')](_0x79fe('0x10'),auth['isAuthenticated'](),controller[_0x79fe('0x16')]);router[_0x79fe('0x14')](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x17')]);router[_0x79fe('0x18')]('/:id',auth[_0x79fe('0xd')](),controller[_0x79fe('0x19')]);router[_0x79fe('0x1a')](_0x79fe('0xc'),auth['isAuthenticated'](),controller[_0x79fe('0x1b')]);router[_0x79fe('0x1a')](_0x79fe('0x10'),auth[_0x79fe('0xd')](),controller['removeTeams']);router['delete'](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x4745=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1219a7,_0x63589a){var _0x4b7db6=function(_0x4e8c63){while(--_0x4e8c63){_0x1219a7['push'](_0x1219a7['shift']());}};_0x4b7db6(++_0x63589a);}(_0x4745,0x1e7));var _0x5474=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x4745[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var path=require(_0x5474('0x2'));var timeout=require(_0x5474('0x3'));var express=require(_0x5474('0x4'));var router=express[_0x5474('0x5')]();var fs_extra=require(_0x5474('0x6'));var auth=require(_0x5474('0x7'));var interaction=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var controller=require(_0x5474('0xa'));router[_0x5474('0xb')]('/',auth['isAuthenticated'](),controller[_0x5474('0xc')]);router[_0x5474('0xb')]('/describe',auth[_0x5474('0xd')](),controller['describe']);router[_0x5474('0xb')](_0x5474('0xe'),auth['isAuthenticated'](),controller[_0x5474('0xf')]);router[_0x5474('0xb')](_0x5474('0x10'),auth[_0x5474('0xd')](),controller[_0x5474('0x11')]);router[_0x5474('0xb')](_0x5474('0x12'),auth[_0x5474('0xd')](),controller['getTeams']);router[_0x5474('0xb')](_0x5474('0x13'),auth[_0x5474('0xd')](),controller[_0x5474('0x14')]);router[_0x5474('0x15')]('/',auth[_0x5474('0xd')](),controller[_0x5474('0x16')]);router[_0x5474('0x15')](_0x5474('0x12'),auth['isAuthenticated'](),controller[_0x5474('0x17')]);router[_0x5474('0x15')](_0x5474('0x13'),auth[_0x5474('0xd')](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5474('0x18')]);router[_0x5474('0x19')](_0x5474('0xe'),auth['isAuthenticated'](),controller[_0x5474('0x1a')]);router[_0x5474('0x19')]('/:id/teams',auth[_0x5474('0xd')](),controller[_0x5474('0x1b')]);router[_0x5474('0x19')](_0x5474('0x13'),auth[_0x5474('0xd')](),controller['removeAgents']);module[_0x5474('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 57bcee6..212e951 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 _0x4dca=['sequelize','exports','STRING','DATE','moment'];(function(_0x1f3a3f,_0x4a7acf){var _0x3f8a93=function(_0x822ee){while(--_0x822ee){_0x1f3a3f['push'](_0x1f3a3f['shift']());}};_0x3f8a93(++_0x4a7acf);}(_0x4dca,0x14e));var _0xa4dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4dca[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xa4dc('0x0'));var Sequelize=require(_0xa4dc('0x1'));module[_0xa4dc('0x2')]={'uniqueid':{'type':Sequelize[_0xa4dc('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa4dc('0x3')]},'joinAt':{'type':Sequelize[_0xa4dc('0x4')]},'leaveAt':{'type':Sequelize[_0xa4dc('0x4')]},'acceptAt':{'type':Sequelize[_0xa4dc('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa4dc('0x3')]}}; \ No newline at end of file +var _0xc830=['DATE','moment','STRING'];(function(_0x51bb6a,_0x19fa16){var _0x419391=function(_0x1fc9ef){while(--_0x1fc9ef){_0x51bb6a['push'](_0x51bb6a['shift']());}};_0x419391(++_0x19fa16);}(_0xc830,0x85));var _0x0c83=function(_0x43bb12,_0x32f6b2){_0x43bb12=_0x43bb12-0x0;var _0x54a9f1=_0xc830[_0x43bb12];return _0x54a9f1;};'use strict';var moment=require(_0x0c83('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0c83('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x0c83('0x1')]},'joinAt':{'type':Sequelize[_0x0c83('0x2')]},'leaveAt':{'type':Sequelize[_0x0c83('0x2')]},'acceptAt':{'type':Sequelize[_0x0c83('0x2')]},'exitAt':{'type':Sequelize[_0x0c83('0x2')]},'reason':{'type':Sequelize[_0x0c83('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index ff7ff0b..30df96a 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 _0xe74e=['reject','save','destroy','then','end','error','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply'];(function(_0x2bbb70,_0xde06f4){var _0x588120=function(_0x1709a4){while(--_0x1709a4){_0x2bbb70['push'](_0x2bbb70['shift']());}};_0x588120(++_0xde06f4);}(_0xe74e,0x10a));var _0xee74=function(_0x2d79fe,_0x33dcb0){_0x2d79fe=_0x2d79fe-0x0;var _0x666ce4=_0xe74e[_0x2d79fe];return _0x666ce4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee74('0x0'));var zipdir=require(_0xee74('0x1'));var jsonpatch=require(_0xee74('0x2'));var rp=require(_0xee74('0x3'));var moment=require(_0xee74('0x4'));var BPromise=require(_0xee74('0x5'));var Mustache=require(_0xee74('0x6'));var util=require(_0xee74('0x7'));var path=require(_0xee74('0x8'));var sox=require(_0xee74('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee74('0xa'));var _=require(_0xee74('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xee74('0xc'));var deskjs=require(_0xee74('0xd'));var toCsv=require(_0xee74('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xee74('0xf'));var authService=require(_0xee74('0x10'));var qs=require(_0xee74('0x11'));var as=require(_0xee74('0x12'));var hardwareService=require(_0xee74('0x13'));var logger=require(_0xee74('0x14'))('api');var utils=require(_0xee74('0x15'));var config=require(_0xee74('0x16'));var licenseUtil=require(_0xee74('0x17'));var db=require(_0xee74('0x18'))['db'];function respondWithStatusCode(_0x5b3dab,_0x28c08a){_0x28c08a=_0x28c08a||0xcc;return function(_0xf608e2){if(_0xf608e2){return _0x5b3dab[_0xee74('0x19')](_0x28c08a);}return _0x5b3dab[_0xee74('0x1a')](_0x28c08a)['end']();};}function respondWithResult(_0x31c1dd,_0x524836){_0x524836=_0x524836||0xc8;return function(_0x2dfe0f){if(_0x2dfe0f){return _0x31c1dd[_0xee74('0x1a')](_0x524836)[_0xee74('0x1b')](_0x2dfe0f);}};}function respondWithFilteredResult(_0x24184e,_0x489b98){return function(_0x18789e){if(_0x18789e){var _0x456c3f=typeof _0x489b98[_0xee74('0x1c')]==='undefined'&&typeof _0x489b98[_0xee74('0x1d')]===_0xee74('0x1e');var _0x5aa1db=_0x18789e['count'];var _0x7f1f64=_0x456c3f?0x0:_0x489b98[_0xee74('0x1c')];var _0xdaddfc=_0x456c3f?_0x18789e[_0xee74('0x1f')]:_0x489b98[_0xee74('0x1c')]+_0x489b98['limit'];var _0x15ccdd;if(_0xdaddfc>=_0x5aa1db){_0xdaddfc=_0x5aa1db;_0x15ccdd=0xc8;}else{_0x15ccdd=0xce;}_0x24184e[_0xee74('0x1a')](_0x15ccdd);return _0x24184e['set'](_0xee74('0x20'),_0x7f1f64+'-'+_0xdaddfc+'/'+_0x5aa1db)[_0xee74('0x1b')](_0x18789e);}return null;};}function patchUpdates(_0x179cb3){return function(_0x23ab9e){try{jsonpatch[_0xee74('0x21')](_0x23ab9e,_0x179cb3,!![]);}catch(_0x4f9b0b){return BPromise[_0xee74('0x22')](_0x4f9b0b);}return _0x23ab9e[_0xee74('0x23')]();};}function saveUpdates(_0x32730b,_0x3b515e){return function(_0x5966db){if(_0x5966db){return _0x5966db['update'](_0x32730b)['then'](function(_0x41bc5e){return _0x41bc5e;});}return null;};}function removeEntity(_0x33b59e,_0x29eb39){return function(_0x1aa325){if(_0x1aa325){return _0x1aa325[_0xee74('0x24')]()[_0xee74('0x25')](function(){_0x33b59e[_0xee74('0x1a')](0xcc)[_0xee74('0x26')]();});}};}function handleEntityNotFound(_0x7bbf7e,_0x2ad533){return function(_0xa21779){if(!_0xa21779){_0x7bbf7e[_0xee74('0x19')](0x194);}return _0xa21779;};}function handleError(_0x42e392,_0xcdbcd5){_0xcdbcd5=_0xcdbcd5||0x1f4;return function(_0x40a655){logger[_0xee74('0x27')](_0x40a655[_0xee74('0x28')]);if(_0x40a655[_0xee74('0x29')]){delete _0x40a655[_0xee74('0x29')];}_0x42e392[_0xee74('0x1a')](_0xcdbcd5)['send'](_0x40a655);};}exports[_0xee74('0x2a')]=function(_0x3e62bc,_0x1d217b){var _0x1da568={},_0x887a89={},_0x399b50={'count':0x0,'rows':[]};var _0x4cb971=_[_0xee74('0x2b')](db[_0xee74('0x2c')][_0xee74('0x2d')],function(_0x5aa00d){return{'name':_0x5aa00d[_0xee74('0x2e')],'type':_0x5aa00d[_0xee74('0x2f')][_0xee74('0x30')]};});_0x887a89[_0xee74('0x31')]=_[_0xee74('0x2b')](_0x4cb971,_0xee74('0x29'));_0x887a89[_0xee74('0x32')]=_[_0xee74('0x33')](_0x3e62bc[_0xee74('0x32')]);_0x887a89[_0xee74('0x34')]=_['intersection'](_0x887a89[_0xee74('0x31')],_0x887a89['query']);_0x1da568['attributes']=_[_0xee74('0x35')](_0x887a89['model'],qs['fields'](_0x3e62bc[_0xee74('0x32')][_0xee74('0x36')]));_0x1da568['attributes']=_0x1da568[_0xee74('0x37')][_0xee74('0x38')]?_0x1da568[_0xee74('0x37')]:_0x887a89[_0xee74('0x31')];if(!_0x3e62bc['query'][_0xee74('0x39')]('nolimit')){_0x1da568[_0xee74('0x1d')]=qs[_0xee74('0x1d')](_0x3e62bc[_0xee74('0x32')]['limit']);_0x1da568[_0xee74('0x1c')]=qs['offset'](_0x3e62bc['query'][_0xee74('0x1c')]);}_0x1da568[_0xee74('0x3a')]=qs[_0xee74('0x3b')](_0x3e62bc['query']['sort']);_0x1da568[_0xee74('0x3c')]=qs[_0xee74('0x34')](_[_0xee74('0x3d')](_0x3e62bc[_0xee74('0x32')],_0x887a89[_0xee74('0x34')]),_0x4cb971);if(_0x3e62bc[_0xee74('0x32')][_0xee74('0x3e')]){_0x1da568[_0xee74('0x3c')]=_[_0xee74('0x3f')](_0x1da568[_0xee74('0x3c')],{'$or':_['map'](_0x4cb971,function(_0x3009fb){if(_0x3009fb[_0xee74('0x2f')]!==_0xee74('0x40')){var _0x56dd55={};_0x56dd55[_0x3009fb[_0xee74('0x29')]]={'$like':'%'+_0x3e62bc[_0xee74('0x32')][_0xee74('0x3e')]+'%'};return _0x56dd55;}})});}_0x1da568=_[_0xee74('0x3f')]({},_0x1da568,_0x3e62bc['options']);var _0x47b06b={'where':_0x1da568[_0xee74('0x3c')]};return db['FaxQueueReport'][_0xee74('0x1f')](_0x47b06b)[_0xee74('0x25')](function(_0x398f6d){_0x399b50[_0xee74('0x1f')]=_0x398f6d;if(_0x3e62bc[_0xee74('0x32')][_0xee74('0x41')]){_0x1da568['include']=[{'all':!![]}];}return db[_0xee74('0x2c')][_0xee74('0x42')](_0x1da568);})[_0xee74('0x25')](function(_0x3627c8){_0x399b50['rows']=_0x3627c8;return _0x399b50;})[_0xee74('0x25')](respondWithFilteredResult(_0x1d217b,_0x1da568))[_0xee74('0x43')](handleError(_0x1d217b,null));};exports[_0xee74('0x44')]=function(_0x42bbba,_0x4f1b3f){var _0x572193={'raw':!![],'where':{'id':_0x42bbba['params']['id']}},_0x45904a={};_0x45904a[_0xee74('0x31')]=_[_0xee74('0x33')](db[_0xee74('0x2c')]['rawAttributes']);_0x45904a[_0xee74('0x32')]=_['keys'](_0x42bbba[_0xee74('0x32')]);_0x45904a[_0xee74('0x34')]=_[_0xee74('0x35')](_0x45904a['model'],_0x45904a[_0xee74('0x32')]);_0x572193[_0xee74('0x37')]=_['intersection'](_0x45904a[_0xee74('0x31')],qs[_0xee74('0x36')](_0x42bbba['query'][_0xee74('0x36')]));_0x572193[_0xee74('0x37')]=_0x572193[_0xee74('0x37')][_0xee74('0x38')]?_0x572193['attributes']:_0x45904a[_0xee74('0x31')];if(_0x42bbba[_0xee74('0x32')]['includeAll']){_0x572193[_0xee74('0x45')]=[{'all':!![]}];}_0x572193=_['merge']({},_0x572193,_0x42bbba['options']);return db[_0xee74('0x2c')][_0xee74('0x46')](_0x572193)[_0xee74('0x25')](handleEntityNotFound(_0x4f1b3f,null))[_0xee74('0x25')](respondWithResult(_0x4f1b3f,null))[_0xee74('0x43')](handleError(_0x4f1b3f,null));};exports[_0xee74('0x47')]=function(_0x3c713d,_0x100a4f){return db[_0xee74('0x2c')]['create'](_0x3c713d['body'],{})[_0xee74('0x25')](respondWithResult(_0x100a4f,0xc9))[_0xee74('0x43')](handleError(_0x100a4f,null));};exports['update']=function(_0x12f337,_0x25103a){if(_0x12f337['body']['id']){delete _0x12f337[_0xee74('0x48')]['id'];}return db[_0xee74('0x2c')][_0xee74('0x46')]({'where':{'id':_0x12f337[_0xee74('0x49')]['id']}})[_0xee74('0x25')](handleEntityNotFound(_0x25103a,null))[_0xee74('0x25')](saveUpdates(_0x12f337[_0xee74('0x48')],null))['then'](respondWithResult(_0x25103a,null))[_0xee74('0x43')](handleError(_0x25103a,null));};exports[_0xee74('0x24')]=function(_0xbc1b29,_0x4b9696){return db['FaxQueueReport'][_0xee74('0x46')]({'where':{'id':_0xbc1b29[_0xee74('0x49')]['id']}})[_0xee74('0x25')](handleEntityNotFound(_0x4b9696,null))[_0xee74('0x25')](removeEntity(_0x4b9696,null))[_0xee74('0x43')](handleError(_0x4b9696,null));};exports[_0xee74('0x4a')]=function(_0x23ca2b,_0x4b20ae){return db[_0xee74('0x2c')][_0xee74('0x4a')]()[_0xee74('0x25')](respondWithResult(_0x4b20ae,null))[_0xee74('0x43')](handleError(_0x4b20ae,null));}; \ No newline at end of file +var _0xdab2=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body'];(function(_0x2fa591,_0x25b2ae){var _0x2e76c1=function(_0x48c56f){while(--_0x48c56f){_0x2fa591['push'](_0x2fa591['shift']());}};_0x2e76c1(++_0x25b2ae);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2dab('0x0'));var rimraf=require(_0x2dab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2dab('0x2'));var rp=require(_0x2dab('0x3'));var moment=require(_0x2dab('0x4'));var BPromise=require(_0x2dab('0x5'));var Mustache=require('mustache');var util=require(_0x2dab('0x6'));var path=require(_0x2dab('0x7'));var sox=require(_0x2dab('0x8'));var csv=require(_0x2dab('0x9'));var ejs=require(_0x2dab('0xa'));var fs=require('fs');var fs_extra=require(_0x2dab('0xb'));var _=require(_0x2dab('0xc'));var squel=require(_0x2dab('0xd'));var crypto=require(_0x2dab('0xe'));var jsforce=require(_0x2dab('0xf'));var deskjs=require(_0x2dab('0x10'));var toCsv=require(_0x2dab('0x9'));var querystring=require(_0x2dab('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2dab('0x12'));var qs=require(_0x2dab('0x13'));var as=require(_0x2dab('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2dab('0x15'));var utils=require(_0x2dab('0x16'));var config=require(_0x2dab('0x17'));var licenseUtil=require(_0x2dab('0x18'));var db=require(_0x2dab('0x19'))['db'];function respondWithStatusCode(_0x553435,_0x2653c8){_0x2653c8=_0x2653c8||0xcc;return function(_0x263f53){if(_0x263f53){return _0x553435['sendStatus'](_0x2653c8);}return _0x553435[_0x2dab('0x1a')](_0x2653c8)[_0x2dab('0x1b')]();};}function respondWithResult(_0x1b5161,_0x597a6e){_0x597a6e=_0x597a6e||0xc8;return function(_0x4040d8){if(_0x4040d8){return _0x1b5161[_0x2dab('0x1a')](_0x597a6e)['json'](_0x4040d8);}};}function respondWithFilteredResult(_0x3c00b1,_0x15a9e7){return function(_0x3e8613){if(_0x3e8613){var _0x2f64c8=typeof _0x15a9e7[_0x2dab('0x1c')]==='undefined'&&typeof _0x15a9e7[_0x2dab('0x1d')]===_0x2dab('0x1e');var _0x18d52c=_0x3e8613[_0x2dab('0x1f')];var _0x30bbde=_0x2f64c8?0x0:_0x15a9e7[_0x2dab('0x1c')];var _0x4ff9be=_0x2f64c8?_0x3e8613[_0x2dab('0x1f')]:_0x15a9e7[_0x2dab('0x1c')]+_0x15a9e7[_0x2dab('0x1d')];var _0x5d3c93;if(_0x4ff9be>=_0x18d52c){_0x4ff9be=_0x18d52c;_0x5d3c93=0xc8;}else{_0x5d3c93=0xce;}_0x3c00b1[_0x2dab('0x1a')](_0x5d3c93);return _0x3c00b1[_0x2dab('0x20')](_0x2dab('0x21'),_0x30bbde+'-'+_0x4ff9be+'/'+_0x18d52c)['json'](_0x3e8613);}return null;};}function patchUpdates(_0x477494){return function(_0x14e373){try{jsonpatch[_0x2dab('0x22')](_0x14e373,_0x477494,!![]);}catch(_0x37a4c0){return BPromise[_0x2dab('0x23')](_0x37a4c0);}return _0x14e373[_0x2dab('0x24')]();};}function saveUpdates(_0x528a8c,_0x343bfc){return function(_0x321469){if(_0x321469){return _0x321469['update'](_0x528a8c)[_0x2dab('0x25')](function(_0x3b0b84){return _0x3b0b84;});}return null;};}function removeEntity(_0xf16fec,_0x37cb08){return function(_0x119d38){if(_0x119d38){return _0x119d38[_0x2dab('0x26')]()[_0x2dab('0x25')](function(){_0xf16fec[_0x2dab('0x1a')](0xcc)[_0x2dab('0x1b')]();});}};}function handleEntityNotFound(_0x1b1c5b,_0x50153d){return function(_0x255478){if(!_0x255478){_0x1b1c5b['sendStatus'](0x194);}return _0x255478;};}function handleError(_0xbe611,_0x11454f){_0x11454f=_0x11454f||0x1f4;return function(_0x594f6f){logger[_0x2dab('0x27')](_0x594f6f[_0x2dab('0x28')]);if(_0x594f6f[_0x2dab('0x29')]){delete _0x594f6f[_0x2dab('0x29')];}_0xbe611['status'](_0x11454f)[_0x2dab('0x2a')](_0x594f6f);};}exports[_0x2dab('0x2b')]=function(_0xa93e,_0x2b15c0){var _0x31cde1={},_0x577a09={},_0x39a899={'count':0x0,'rows':[]};var _0x271d4f=_[_0x2dab('0x2c')](db[_0x2dab('0x2d')][_0x2dab('0x2e')],function(_0x11582d){return{'name':_0x11582d[_0x2dab('0x2f')],'type':_0x11582d[_0x2dab('0x30')][_0x2dab('0x31')]};});_0x577a09['model']=_['map'](_0x271d4f,'name');_0x577a09[_0x2dab('0x32')]=_[_0x2dab('0x33')](_0xa93e[_0x2dab('0x32')]);_0x577a09[_0x2dab('0x34')]=_[_0x2dab('0x35')](_0x577a09['model'],_0x577a09[_0x2dab('0x32')]);_0x31cde1['attributes']=_['intersection'](_0x577a09['model'],qs[_0x2dab('0x36')](_0xa93e[_0x2dab('0x32')]['fields']));_0x31cde1['attributes']=_0x31cde1[_0x2dab('0x37')][_0x2dab('0x38')]?_0x31cde1[_0x2dab('0x37')]:_0x577a09[_0x2dab('0x39')];if(!_0xa93e[_0x2dab('0x32')][_0x2dab('0x3a')]('nolimit')){_0x31cde1[_0x2dab('0x1d')]=qs['limit'](_0xa93e[_0x2dab('0x32')][_0x2dab('0x1d')]);_0x31cde1[_0x2dab('0x1c')]=qs[_0x2dab('0x1c')](_0xa93e[_0x2dab('0x32')][_0x2dab('0x1c')]);}_0x31cde1['order']=qs['sort'](_0xa93e[_0x2dab('0x32')][_0x2dab('0x3b')]);_0x31cde1[_0x2dab('0x3c')]=qs[_0x2dab('0x34')](_[_0x2dab('0x3d')](_0xa93e['query'],_0x577a09[_0x2dab('0x34')]),_0x271d4f);if(_0xa93e[_0x2dab('0x32')][_0x2dab('0x3e')]){_0x31cde1[_0x2dab('0x3c')]=_[_0x2dab('0x3f')](_0x31cde1[_0x2dab('0x3c')],{'$or':_[_0x2dab('0x2c')](_0x271d4f,function(_0x3e1b57){if(_0x3e1b57[_0x2dab('0x30')]!==_0x2dab('0x40')){var _0x4dc041={};_0x4dc041[_0x3e1b57[_0x2dab('0x29')]]={'$like':'%'+_0xa93e['query'][_0x2dab('0x3e')]+'%'};return _0x4dc041;}})});}_0x31cde1=_['merge']({},_0x31cde1,_0xa93e[_0x2dab('0x41')]);var _0x5d52b6={'where':_0x31cde1['where']};return db[_0x2dab('0x2d')][_0x2dab('0x1f')](_0x5d52b6)[_0x2dab('0x25')](function(_0x47967e){_0x39a899[_0x2dab('0x1f')]=_0x47967e;if(_0xa93e[_0x2dab('0x32')][_0x2dab('0x42')]){_0x31cde1[_0x2dab('0x43')]=[{'all':!![]}];}return db[_0x2dab('0x2d')][_0x2dab('0x44')](_0x31cde1);})[_0x2dab('0x25')](function(_0x23c7c2){_0x39a899[_0x2dab('0x45')]=_0x23c7c2;return _0x39a899;})[_0x2dab('0x25')](respondWithFilteredResult(_0x2b15c0,_0x31cde1))['catch'](handleError(_0x2b15c0,null));};exports[_0x2dab('0x46')]=function(_0x5c5b73,_0x53239d){var _0x25fd84={'raw':!![],'where':{'id':_0x5c5b73[_0x2dab('0x47')]['id']}},_0x964bad={};_0x964bad['model']=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x964bad[_0x2dab('0x32')]=_['keys'](_0x5c5b73[_0x2dab('0x32')]);_0x964bad[_0x2dab('0x34')]=_[_0x2dab('0x35')](_0x964bad[_0x2dab('0x39')],_0x964bad[_0x2dab('0x32')]);_0x25fd84[_0x2dab('0x37')]=_['intersection'](_0x964bad[_0x2dab('0x39')],qs[_0x2dab('0x36')](_0x5c5b73['query'][_0x2dab('0x36')]));_0x25fd84[_0x2dab('0x37')]=_0x25fd84['attributes']['length']?_0x25fd84[_0x2dab('0x37')]:_0x964bad[_0x2dab('0x39')];if(_0x5c5b73[_0x2dab('0x32')][_0x2dab('0x42')]){_0x25fd84['include']=[{'all':!![]}];}_0x25fd84=_[_0x2dab('0x3f')]({},_0x25fd84,_0x5c5b73[_0x2dab('0x41')]);return db['FaxQueueReport'][_0x2dab('0x48')](_0x25fd84)[_0x2dab('0x25')](handleEntityNotFound(_0x53239d,null))[_0x2dab('0x25')](respondWithResult(_0x53239d,null))[_0x2dab('0x49')](handleError(_0x53239d,null));};exports[_0x2dab('0x4a')]=function(_0x2ee65c,_0x3b0056){return db[_0x2dab('0x2d')][_0x2dab('0x4a')](_0x2ee65c['body'],{})['then'](respondWithResult(_0x3b0056,0xc9))['catch'](handleError(_0x3b0056,null));};exports['update']=function(_0x4b117f,_0x358576){if(_0x4b117f[_0x2dab('0x4b')]['id']){delete _0x4b117f[_0x2dab('0x4b')]['id'];}return db['FaxQueueReport'][_0x2dab('0x48')]({'where':{'id':_0x4b117f[_0x2dab('0x47')]['id']}})[_0x2dab('0x25')](handleEntityNotFound(_0x358576,null))['then'](saveUpdates(_0x4b117f[_0x2dab('0x4b')],null))['then'](respondWithResult(_0x358576,null))[_0x2dab('0x49')](handleError(_0x358576,null));};exports[_0x2dab('0x26')]=function(_0x3d1bfd,_0x83d78d){return db[_0x2dab('0x2d')]['find']({'where':{'id':_0x3d1bfd[_0x2dab('0x47')]['id']}})[_0x2dab('0x25')](handleEntityNotFound(_0x83d78d,null))[_0x2dab('0x25')](removeEntity(_0x83d78d,null))['catch'](handleError(_0x83d78d,null));};exports['describe']=function(_0x580a33,_0x3ce70a){return db[_0x2dab('0x2d')]['describe']()[_0x2dab('0x25')](respondWithResult(_0x3ce70a,null))[_0x2dab('0x49')](handleError(_0x3ce70a,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index cf78443..ab5be9b 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 _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x202e21,_0x50da3a){var _0xf5d3ea=function(_0x413362){while(--_0x413362){_0x202e21['push'](_0x202e21['shift']());}};_0xf5d3ea(++_0x50da3a);}(_0xf494,0x1c6));var _0x4f49=function(_0x218b1e,_0x1bc20e){_0x218b1e=_0x218b1e-0x0;var _0xc5f70f=_0xf494[_0x218b1e];return _0xc5f70f;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x282c7f,_0x460e10){var _0x54bc87=function(_0x383aef){while(--_0x383aef){_0x282c7f['push'](_0x282c7f['shift']());}};_0x54bc87(++_0x460e10);}(_0xe14b,0x93));var _0xbe14=function(_0x54dfad,_0x576b4f){_0x54dfad=_0x54dfad-0x0;var _0x2ba673=_0xe14b[_0x54dfad];return _0x2ba673;};'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 d4163af..58c91c6 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 _0xf4b9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','create','options','UpdateFaxQueueReport','FaxQueueReport','body','attributes','limit','catch','lodash','util','moment'];(function(_0x30ce75,_0x3594ef){var _0x585cb5=function(_0x44395b){while(--_0x44395b){_0x30ce75['push'](_0x30ce75['shift']());}};_0x585cb5(++_0x3594ef);}(_0xf4b9,0x81));var _0x9f4b=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xf4b9[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x9f4b('0x0'));var util=require(_0x9f4b('0x1'));var moment=require(_0x9f4b('0x2'));var BPromise=require(_0x9f4b('0x3'));var rs=require(_0x9f4b('0x4'));var fs=require('fs');var Redis=require(_0x9f4b('0x5'));var db=require(_0x9f4b('0x6'))['db'];var utils=require(_0x9f4b('0x7'));var logger=require(_0x9f4b('0x8'))(_0x9f4b('0x9'));var config=require(_0x9f4b('0xa'));var jayson=require(_0x9f4b('0xb'));var client=jayson[_0x9f4b('0xc')][_0x9f4b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x141787,_0x1f5038,_0x562e28){return new BPromise(function(_0x45a99e,_0x1cd3db){return client[_0x9f4b('0xe')](_0x141787,_0x562e28)[_0x9f4b('0xf')](function(_0x5d2b5d){logger[_0x9f4b('0x10')](_0x9f4b('0x11'),_0x1f5038,'request\x20sent');logger[_0x9f4b('0x12')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1f5038,_0x9f4b('0x13'),JSON[_0x9f4b('0x14')](_0x5d2b5d));if(_0x5d2b5d['error']){if(_0x5d2b5d[_0x9f4b('0x15')][_0x9f4b('0x16')]===0x1f4){logger['error'](_0x9f4b('0x11'),_0x1f5038,_0x5d2b5d[_0x9f4b('0x15')][_0x9f4b('0x17')]);return _0x1cd3db(_0x5d2b5d[_0x9f4b('0x15')][_0x9f4b('0x17')]);}logger[_0x9f4b('0x15')](_0x9f4b('0x11'),_0x1f5038,_0x5d2b5d[_0x9f4b('0x15')][_0x9f4b('0x17')]);return _0x45a99e(_0x5d2b5d[_0x9f4b('0x15')]['message']);}else{logger[_0x9f4b('0x10')](_0x9f4b('0x11'),_0x1f5038,_0x9f4b('0x13'));_0x45a99e(_0x5d2b5d[_0x9f4b('0x18')]['message']);}})['catch'](function(_0xc5dce7){logger[_0x9f4b('0x15')](_0x9f4b('0x11'),_0x1f5038,_0xc5dce7);_0x1cd3db(_0xc5dce7);});});}exports['CreateFaxQueueReport']=function(_0x5a7f2e){var _0x4403b0=this;return new Promise(function(_0x21c36c,_0x275323){return db['FaxQueueReport'][_0x9f4b('0x19')](_0x5a7f2e['body'],{'raw':_0x5a7f2e[_0x9f4b('0x1a')]?_0x5a7f2e['options']['raw']===undefined?!![]:![]:!![]})[_0x9f4b('0xf')](function(_0x475623){logger[_0x9f4b('0x10')]('CreateFaxQueueReport',_0x5a7f2e);logger['debug']('CreateFaxQueueReport',_0x5a7f2e,JSON['stringify'](_0x475623));_0x21c36c(_0x475623);})['catch'](function(_0x121932){logger[_0x9f4b('0x15')]('CreateFaxQueueReport',_0x121932['message'],_0x5a7f2e);_0x275323(_0x4403b0['error'](0x1f4,_0x121932[_0x9f4b('0x17')]));});});};exports[_0x9f4b('0x1b')]=function(_0x4a6386){var _0x1c2bee=this;return new Promise(function(_0x512878,_0x3895b3){return db[_0x9f4b('0x1c')]['update'](_0x4a6386[_0x9f4b('0x1d')],{'raw':_0x4a6386[_0x9f4b('0x1a')]?_0x4a6386[_0x9f4b('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a6386[_0x9f4b('0x1a')]?_0x4a6386[_0x9f4b('0x1a')]['where']||null:null,'attributes':_0x4a6386[_0x9f4b('0x1a')]?_0x4a6386[_0x9f4b('0x1a')][_0x9f4b('0x1e')]||null:null,'limit':_0x4a6386['options']?_0x4a6386[_0x9f4b('0x1a')][_0x9f4b('0x1f')]||null:null})[_0x9f4b('0xf')](function(_0x225abf){logger[_0x9f4b('0x10')](_0x9f4b('0x1b'),_0x4a6386);logger['debug']('UpdateFaxQueueReport',_0x4a6386,JSON[_0x9f4b('0x14')](_0x225abf));_0x512878(_0x225abf);})[_0x9f4b('0x20')](function(_0xf1e223){logger[_0x9f4b('0x15')](_0x9f4b('0x1b'),_0xf1e223['message'],_0x4a6386);_0x3895b3(_0x1c2bee[_0x9f4b('0x15')](0x1f4,_0xf1e223[_0x9f4b('0x17')]));});});}; \ No newline at end of file +var _0x6c62=['body','options','raw','then','debug','stringify','UpdateFaxQueueReport','update','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','FaxQueueReport,\x20%s,\x20%s','CreateFaxQueueReport','FaxQueueReport','create'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x6c62,0x102));var _0x26c6=function(_0x143cc6,_0xf94536){_0x143cc6=_0x143cc6-0x0;var _0x2cedba=_0x6c62[_0x143cc6];return _0x2cedba;};'use strict';var _=require(_0x26c6('0x0'));var util=require(_0x26c6('0x1'));var moment=require(_0x26c6('0x2'));var BPromise=require('bluebird');var rs=require(_0x26c6('0x3'));var fs=require('fs');var Redis=require(_0x26c6('0x4'));var db=require(_0x26c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x26c6('0x6'));var config=require('../../config/environment');var jayson=require(_0x26c6('0x7'));var client=jayson[_0x26c6('0x8')][_0x26c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4cb5b4,_0x34ed60,_0x496c2c){return new BPromise(function(_0x6208e6,_0x268b74){return client['request'](_0x4cb5b4,_0x496c2c)['then'](function(_0x1ae495){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x34ed60,_0x26c6('0xa'));logger['debug'](_0x26c6('0xb'),_0x34ed60,_0x26c6('0xa'),JSON['stringify'](_0x1ae495));if(_0x1ae495[_0x26c6('0xc')]){if(_0x1ae495[_0x26c6('0xc')][_0x26c6('0xd')]===0x1f4){logger[_0x26c6('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x34ed60,_0x1ae495['error'][_0x26c6('0xe')]);return _0x268b74(_0x1ae495['error'][_0x26c6('0xe')]);}logger[_0x26c6('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x34ed60,_0x1ae495[_0x26c6('0xc')][_0x26c6('0xe')]);return _0x6208e6(_0x1ae495[_0x26c6('0xc')]['message']);}else{logger[_0x26c6('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x34ed60,_0x26c6('0xa'));_0x6208e6(_0x1ae495['result'][_0x26c6('0xe')]);}})[_0x26c6('0x10')](function(_0x5e0e27){logger[_0x26c6('0xc')](_0x26c6('0x11'),_0x34ed60,_0x5e0e27);_0x268b74(_0x5e0e27);});});}exports[_0x26c6('0x12')]=function(_0x1e2593){var _0x5985a8=this;return new Promise(function(_0x3a0584,_0x25de25){return db[_0x26c6('0x13')][_0x26c6('0x14')](_0x1e2593[_0x26c6('0x15')],{'raw':_0x1e2593[_0x26c6('0x16')]?_0x1e2593[_0x26c6('0x16')][_0x26c6('0x17')]===undefined?!![]:![]:!![]})[_0x26c6('0x18')](function(_0x46dca2){logger[_0x26c6('0xf')](_0x26c6('0x12'),_0x1e2593);logger[_0x26c6('0x19')](_0x26c6('0x12'),_0x1e2593,JSON[_0x26c6('0x1a')](_0x46dca2));_0x3a0584(_0x46dca2);})[_0x26c6('0x10')](function(_0x3d9449){logger['error'](_0x26c6('0x12'),_0x3d9449[_0x26c6('0xe')],_0x1e2593);_0x25de25(_0x5985a8[_0x26c6('0xc')](0x1f4,_0x3d9449[_0x26c6('0xe')]));});});};exports[_0x26c6('0x1b')]=function(_0x39c2a5){var _0x4ed1bb=this;return new Promise(function(_0x4cec49,_0x3195d3){return db[_0x26c6('0x13')][_0x26c6('0x1c')](_0x39c2a5[_0x26c6('0x15')],{'raw':_0x39c2a5[_0x26c6('0x16')]?_0x39c2a5[_0x26c6('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39c2a5['options']?_0x39c2a5[_0x26c6('0x16')]['where']||null:null,'attributes':_0x39c2a5['options']?_0x39c2a5[_0x26c6('0x16')][_0x26c6('0x1d')]||null:null,'limit':_0x39c2a5[_0x26c6('0x16')]?_0x39c2a5[_0x26c6('0x16')][_0x26c6('0x1e')]||null:null})['then'](function(_0x1bb2d0){logger[_0x26c6('0xf')]('UpdateFaxQueueReport',_0x39c2a5);logger[_0x26c6('0x19')](_0x26c6('0x1b'),_0x39c2a5,JSON[_0x26c6('0x1a')](_0x1bb2d0));_0x4cec49(_0x1bb2d0);})[_0x26c6('0x10')](function(_0x48f444){logger[_0x26c6('0xc')](_0x26c6('0x1b'),_0x48f444[_0x26c6('0xe')],_0x39c2a5);_0x3195d3(_0x4ed1bb['error'](0x1f4,_0x48f444[_0x26c6('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ae8add6..3b2efd5 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 _0x7f18=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','describe','show','post','create','put','delete','/:id','destroy','exports','multer','util','connect-timeout'];(function(_0x5f2de9,_0x29b00e){var _0x2a4fed=function(_0x38f9e6){while(--_0x38f9e6){_0x5f2de9['push'](_0x5f2de9['shift']());}};_0x2a4fed(++_0x29b00e);}(_0x7f18,0x101));var _0x87f1=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0x7f18[_0x2ff238];return _0x204a56;};'use strict';var multer=require(_0x87f1('0x0'));var util=require(_0x87f1('0x1'));var path=require('path');var timeout=require(_0x87f1('0x2'));var express=require(_0x87f1('0x3'));var router=express[_0x87f1('0x4')]();var fs_extra=require(_0x87f1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x87f1('0x6'));var config=require(_0x87f1('0x7'));var controller=require(_0x87f1('0x8'));router[_0x87f1('0x9')]('/',auth[_0x87f1('0xa')](),controller['index']);router[_0x87f1('0x9')]('/describe',auth[_0x87f1('0xa')](),controller[_0x87f1('0xb')]);router[_0x87f1('0x9')]('/:id',auth[_0x87f1('0xa')](),controller[_0x87f1('0xc')]);router[_0x87f1('0xd')]('/',auth[_0x87f1('0xa')](),controller[_0x87f1('0xe')]);router[_0x87f1('0xf')]('/:id',auth[_0x87f1('0xa')](),controller['update']);router[_0x87f1('0x10')](_0x87f1('0x11'),auth[_0x87f1('0xa')](),controller[_0x87f1('0x12')]);module[_0x87f1('0x13')]=router; \ No newline at end of file +var _0x1a06=['isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get'];(function(_0x387433,_0x2d10d7){var _0x4d056a=function(_0x53d2e2){while(--_0x53d2e2){_0x387433['push'](_0x387433['shift']());}};_0x4d056a(++_0x2d10d7);}(_0x1a06,0x7c));var _0x61a0=function(_0x51cb29,_0x1f6289){_0x51cb29=_0x51cb29-0x0;var _0x12e1f3=_0x1a06[_0x51cb29];return _0x12e1f3;};'use strict';var multer=require(_0x61a0('0x0'));var util=require(_0x61a0('0x1'));var path=require(_0x61a0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x61a0('0x3')]();var fs_extra=require(_0x61a0('0x4'));var auth=require(_0x61a0('0x5'));var interaction=require(_0x61a0('0x6'));var config=require('../../config/environment');var controller=require(_0x61a0('0x7'));router[_0x61a0('0x8')]('/',auth[_0x61a0('0x9')](),controller[_0x61a0('0xa')]);router[_0x61a0('0x8')](_0x61a0('0xb'),auth[_0x61a0('0x9')](),controller[_0x61a0('0xc')]);router['get'](_0x61a0('0xd'),auth[_0x61a0('0x9')](),controller[_0x61a0('0xe')]);router['post']('/',auth[_0x61a0('0x9')](),controller[_0x61a0('0xf')]);router['put'](_0x61a0('0xd'),auth[_0x61a0('0x9')](),controller[_0x61a0('0x10')]);router[_0x61a0('0x11')](_0x61a0('0xd'),auth[_0x61a0('0x9')](),controller[_0x61a0('0x12')]);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 e99007f..6830688 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4e7dd7,_0x3e7134){var _0x4f4461=function(_0x17aabb){while(--_0x17aabb){_0x4e7dd7['push'](_0x4e7dd7['shift']());}};_0x4f4461(++_0x3e7134);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x48cd47,_0x4dff07){var _0x55ece3=function(_0x39f9cc){while(--_0x39f9cc){_0x48cd47['push'](_0x48cd47['shift']());}};_0x55ece3(++_0x4dff07);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x00bb[_0x55f8b4];return _0x2475f9;};'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 diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index f2a83e9..6db30e7 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 _0x77b1=['includeAll','include','rows','catch','show','params','fields','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','FaxTransferReport','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0x77b1,0xf3));var _0x177b=function(_0x5849d0,_0x4d68d6){_0x5849d0=_0x5849d0-0x0;var _0x213c8b=_0x77b1[_0x5849d0];return _0x213c8b;};'use strict';var emlformat=require(_0x177b('0x0'));var rimraf=require(_0x177b('0x1'));var zipdir=require(_0x177b('0x2'));var jsonpatch=require(_0x177b('0x3'));var rp=require(_0x177b('0x4'));var moment=require('moment');var BPromise=require(_0x177b('0x5'));var Mustache=require(_0x177b('0x6'));var util=require(_0x177b('0x7'));var path=require('path');var sox=require(_0x177b('0x8'));var csv=require(_0x177b('0x9'));var ejs=require(_0x177b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x177b('0xb'));var squel=require(_0x177b('0xc'));var crypto=require('crypto');var jsforce=require(_0x177b('0xd'));var deskjs=require(_0x177b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x177b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x177b('0x10'));var as=require(_0x177b('0x11'));var hardwareService=require(_0x177b('0x12'));var logger=require(_0x177b('0x13'))(_0x177b('0x14'));var utils=require('../../config/utils');var config=require(_0x177b('0x15'));var licenseUtil=require(_0x177b('0x16'));var db=require(_0x177b('0x17'))['db'];function respondWithStatusCode(_0x126809,_0xac9961){_0xac9961=_0xac9961||0xcc;return function(_0x2c4b72){if(_0x2c4b72){return _0x126809[_0x177b('0x18')](_0xac9961);}return _0x126809['status'](_0xac9961)['end']();};}function respondWithResult(_0x614d5d,_0x333c22){_0x333c22=_0x333c22||0xc8;return function(_0x27421a){if(_0x27421a){return _0x614d5d[_0x177b('0x19')](_0x333c22)[_0x177b('0x1a')](_0x27421a);}};}function respondWithFilteredResult(_0x4eef09,_0x5a238e){return function(_0x53946e){if(_0x53946e){var _0x343413=typeof _0x5a238e[_0x177b('0x1b')]==='undefined'&&typeof _0x5a238e[_0x177b('0x1c')]===_0x177b('0x1d');var _0x567ee3=_0x53946e[_0x177b('0x1e')];var _0x4be120=_0x343413?0x0:_0x5a238e[_0x177b('0x1b')];var _0x307a70=_0x343413?_0x53946e[_0x177b('0x1e')]:_0x5a238e['offset']+_0x5a238e['limit'];var _0x2c8a41;if(_0x307a70>=_0x567ee3){_0x307a70=_0x567ee3;_0x2c8a41=0xc8;}else{_0x2c8a41=0xce;}_0x4eef09[_0x177b('0x19')](_0x2c8a41);return _0x4eef09[_0x177b('0x1f')](_0x177b('0x20'),_0x4be120+'-'+_0x307a70+'/'+_0x567ee3)[_0x177b('0x1a')](_0x53946e);}return null;};}function patchUpdates(_0x547c06){return function(_0x275158){try{jsonpatch[_0x177b('0x21')](_0x275158,_0x547c06,!![]);}catch(_0x1133bb){return BPromise[_0x177b('0x22')](_0x1133bb);}return _0x275158[_0x177b('0x23')]();};}function saveUpdates(_0x17f04d,_0x18d53d){return function(_0xf63b2a){if(_0xf63b2a){return _0xf63b2a[_0x177b('0x24')](_0x17f04d)[_0x177b('0x25')](function(_0x37f39b){return _0x37f39b;});}return null;};}function removeEntity(_0x5558d7,_0x11964a){return function(_0x1398bc){if(_0x1398bc){return _0x1398bc[_0x177b('0x26')]()['then'](function(){_0x5558d7['status'](0xcc)[_0x177b('0x27')]();});}};}function handleEntityNotFound(_0x342598,_0x3f65f2){return function(_0x58f6d6){if(!_0x58f6d6){_0x342598[_0x177b('0x18')](0x194);}return _0x58f6d6;};}function handleError(_0x54d8c5,_0x165722){_0x165722=_0x165722||0x1f4;return function(_0x4758d7){logger[_0x177b('0x28')](_0x4758d7['stack']);if(_0x4758d7[_0x177b('0x29')]){delete _0x4758d7[_0x177b('0x29')];}_0x54d8c5['status'](_0x165722)['send'](_0x4758d7);};}exports[_0x177b('0x2a')]=function(_0x2ab909,_0x1ace21){var _0x171569={},_0x14bdeb={},_0x35f473={'count':0x0,'rows':[]};var _0x2884c6=_['map'](db[_0x177b('0x2b')][_0x177b('0x2c')],function(_0x4fae59){return{'name':_0x4fae59[_0x177b('0x2d')],'type':_0x4fae59[_0x177b('0x2e')][_0x177b('0x2f')]};});_0x14bdeb['model']=_[_0x177b('0x30')](_0x2884c6,_0x177b('0x29'));_0x14bdeb['query']=_[_0x177b('0x31')](_0x2ab909[_0x177b('0x32')]);_0x14bdeb[_0x177b('0x33')]=_[_0x177b('0x34')](_0x14bdeb[_0x177b('0x35')],_0x14bdeb[_0x177b('0x32')]);_0x171569[_0x177b('0x36')]=_['intersection'](_0x14bdeb['model'],qs['fields'](_0x2ab909[_0x177b('0x32')]['fields']));_0x171569[_0x177b('0x36')]=_0x171569['attributes'][_0x177b('0x37')]?_0x171569[_0x177b('0x36')]:_0x14bdeb[_0x177b('0x35')];if(!_0x2ab909[_0x177b('0x32')][_0x177b('0x38')](_0x177b('0x39'))){_0x171569[_0x177b('0x1c')]=qs[_0x177b('0x1c')](_0x2ab909[_0x177b('0x32')][_0x177b('0x1c')]);_0x171569[_0x177b('0x1b')]=qs['offset'](_0x2ab909[_0x177b('0x32')][_0x177b('0x1b')]);}_0x171569[_0x177b('0x3a')]=qs[_0x177b('0x3b')](_0x2ab909[_0x177b('0x32')]['sort']);_0x171569[_0x177b('0x3c')]=qs[_0x177b('0x33')](_[_0x177b('0x3d')](_0x2ab909[_0x177b('0x32')],_0x14bdeb['filters']),_0x2884c6);if(_0x2ab909[_0x177b('0x32')][_0x177b('0x3e')]){_0x171569[_0x177b('0x3c')]=_['merge'](_0x171569[_0x177b('0x3c')],{'$or':_['map'](_0x2884c6,function(_0x39d900){if(_0x39d900[_0x177b('0x2e')]!==_0x177b('0x3f')){var _0x5d1234={};_0x5d1234[_0x39d900['name']]={'$like':'%'+_0x2ab909['query'][_0x177b('0x3e')]+'%'};return _0x5d1234;}})});}_0x171569=_[_0x177b('0x40')]({},_0x171569,_0x2ab909['options']);var _0x13c50d={'where':_0x171569[_0x177b('0x3c')]};return db[_0x177b('0x2b')][_0x177b('0x1e')](_0x13c50d)[_0x177b('0x25')](function(_0xaa81ce){_0x35f473['count']=_0xaa81ce;if(_0x2ab909[_0x177b('0x32')][_0x177b('0x41')]){_0x171569[_0x177b('0x42')]=[{'all':!![]}];}return db[_0x177b('0x2b')]['findAll'](_0x171569);})['then'](function(_0x1b526d){_0x35f473[_0x177b('0x43')]=_0x1b526d;return _0x35f473;})[_0x177b('0x25')](respondWithFilteredResult(_0x1ace21,_0x171569))[_0x177b('0x44')](handleError(_0x1ace21,null));};exports[_0x177b('0x45')]=function(_0x7537d8,_0x52e3e2){var _0x47c9ca={'raw':!![],'where':{'id':_0x7537d8[_0x177b('0x46')]['id']}},_0x1b48a7={};_0x1b48a7[_0x177b('0x35')]=_[_0x177b('0x31')](db[_0x177b('0x2b')][_0x177b('0x2c')]);_0x1b48a7[_0x177b('0x32')]=_[_0x177b('0x31')](_0x7537d8[_0x177b('0x32')]);_0x1b48a7[_0x177b('0x33')]=_[_0x177b('0x34')](_0x1b48a7['model'],_0x1b48a7[_0x177b('0x32')]);_0x47c9ca[_0x177b('0x36')]=_['intersection'](_0x1b48a7['model'],qs[_0x177b('0x47')](_0x7537d8[_0x177b('0x32')]['fields']));_0x47c9ca[_0x177b('0x36')]=_0x47c9ca[_0x177b('0x36')][_0x177b('0x37')]?_0x47c9ca[_0x177b('0x36')]:_0x1b48a7[_0x177b('0x35')];if(_0x7537d8[_0x177b('0x32')][_0x177b('0x41')]){_0x47c9ca['include']=[{'all':!![]}];}_0x47c9ca=_[_0x177b('0x40')]({},_0x47c9ca,_0x7537d8[_0x177b('0x48')]);return db[_0x177b('0x2b')][_0x177b('0x49')](_0x47c9ca)[_0x177b('0x25')](handleEntityNotFound(_0x52e3e2,null))[_0x177b('0x25')](respondWithResult(_0x52e3e2,null))[_0x177b('0x44')](handleError(_0x52e3e2,null));};exports[_0x177b('0x4a')]=function(_0x55278b,_0x259f19){return db[_0x177b('0x2b')][_0x177b('0x4a')](_0x55278b[_0x177b('0x4b')],{})[_0x177b('0x25')](respondWithResult(_0x259f19,0xc9))['catch'](handleError(_0x259f19,null));};exports[_0x177b('0x24')]=function(_0x40c7d6,_0x1c56ea){if(_0x40c7d6[_0x177b('0x4b')]['id']){delete _0x40c7d6[_0x177b('0x4b')]['id'];}return db['FaxTransferReport'][_0x177b('0x49')]({'where':{'id':_0x40c7d6[_0x177b('0x46')]['id']}})[_0x177b('0x25')](handleEntityNotFound(_0x1c56ea,null))[_0x177b('0x25')](saveUpdates(_0x40c7d6[_0x177b('0x4b')],null))[_0x177b('0x25')](respondWithResult(_0x1c56ea,null))[_0x177b('0x44')](handleError(_0x1c56ea,null));};exports[_0x177b('0x26')]=function(_0x86363c,_0x5efc97){return db[_0x177b('0x2b')][_0x177b('0x49')]({'where':{'id':_0x86363c[_0x177b('0x46')]['id']}})[_0x177b('0x25')](handleEntityNotFound(_0x5efc97,null))[_0x177b('0x25')](removeEntity(_0x5efc97,null))[_0x177b('0x44')](handleError(_0x5efc97,null));};exports['describe']=function(_0x785dde,_0x1eaa44){return db[_0x177b('0x2b')][_0x177b('0x4c')]()['then'](respondWithResult(_0x1eaa44,null))[_0x177b('0x44')](handleError(_0x1eaa44,null));}; \ No newline at end of file +var _0xb7ce=['merge','type','VIRTUAL','options','FaxTransferReport','includeAll','findAll','rows','show','params','rawAttributes','include','catch','create','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','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','limit','undefined','count','set','Content-Range','apply','update','then','error','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x4b5815,_0x44fb95){var _0x58634a=function(_0x5565ce){while(--_0x5565ce){_0x4b5815['push'](_0x4b5815['shift']());}};_0x58634a(++_0x44fb95);}(_0xb7ce,0x1ec));var _0xeb7c=function(_0x1ae657,_0x2f384f){_0x1ae657=_0x1ae657-0x0;var _0x3b315f=_0xb7ce[_0x1ae657];return _0x3b315f;};'use strict';var emlformat=require(_0xeb7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeb7c('0x1'));var jsonpatch=require(_0xeb7c('0x2'));var rp=require(_0xeb7c('0x3'));var moment=require(_0xeb7c('0x4'));var BPromise=require(_0xeb7c('0x5'));var Mustache=require(_0xeb7c('0x6'));var util=require(_0xeb7c('0x7'));var path=require(_0xeb7c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeb7c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeb7c('0xa'));var crypto=require(_0xeb7c('0xb'));var jsforce=require(_0xeb7c('0xc'));var deskjs=require(_0xeb7c('0xd'));var toCsv=require(_0xeb7c('0xe'));var querystring=require(_0xeb7c('0xf'));var Papa=require(_0xeb7c('0x10'));var Redis=require(_0xeb7c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xeb7c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb7c('0x13'));var logger=require(_0xeb7c('0x14'))(_0xeb7c('0x15'));var utils=require(_0xeb7c('0x16'));var config=require(_0xeb7c('0x17'));var licenseUtil=require(_0xeb7c('0x18'));var db=require(_0xeb7c('0x19'))['db'];function respondWithStatusCode(_0x4be25b,_0x119d65){_0x119d65=_0x119d65||0xcc;return function(_0x1f7259){if(_0x1f7259){return _0x4be25b[_0xeb7c('0x1a')](_0x119d65);}return _0x4be25b[_0xeb7c('0x1b')](_0x119d65)[_0xeb7c('0x1c')]();};}function respondWithResult(_0x58f96a,_0x13c32f){_0x13c32f=_0x13c32f||0xc8;return function(_0x2697df){if(_0x2697df){return _0x58f96a[_0xeb7c('0x1b')](_0x13c32f)[_0xeb7c('0x1d')](_0x2697df);}};}function respondWithFilteredResult(_0x5cee16,_0x481bf0){return function(_0x491c0d){if(_0x491c0d){var _0x212ca4=typeof _0x481bf0[_0xeb7c('0x1e')]==='undefined'&&typeof _0x481bf0[_0xeb7c('0x1f')]===_0xeb7c('0x20');var _0x493c8c=_0x491c0d[_0xeb7c('0x21')];var _0x47ed78=_0x212ca4?0x0:_0x481bf0[_0xeb7c('0x1e')];var _0x8b1bb7=_0x212ca4?_0x491c0d[_0xeb7c('0x21')]:_0x481bf0[_0xeb7c('0x1e')]+_0x481bf0['limit'];var _0x9c2a3;if(_0x8b1bb7>=_0x493c8c){_0x8b1bb7=_0x493c8c;_0x9c2a3=0xc8;}else{_0x9c2a3=0xce;}_0x5cee16[_0xeb7c('0x1b')](_0x9c2a3);return _0x5cee16[_0xeb7c('0x22')](_0xeb7c('0x23'),_0x47ed78+'-'+_0x8b1bb7+'/'+_0x493c8c)['json'](_0x491c0d);}return null;};}function patchUpdates(_0x348fd7){return function(_0x1b92b7){try{jsonpatch[_0xeb7c('0x24')](_0x1b92b7,_0x348fd7,!![]);}catch(_0xf0e4fe){return BPromise['reject'](_0xf0e4fe);}return _0x1b92b7['save']();};}function saveUpdates(_0x1801f9,_0x483016){return function(_0x25be39){if(_0x25be39){return _0x25be39[_0xeb7c('0x25')](_0x1801f9)[_0xeb7c('0x26')](function(_0x4755d4){return _0x4755d4;});}return null;};}function removeEntity(_0x1766db,_0x150dc8){return function(_0x11c35a){if(_0x11c35a){return _0x11c35a['destroy']()['then'](function(){_0x1766db[_0xeb7c('0x1b')](0xcc)[_0xeb7c('0x1c')]();});}};}function handleEntityNotFound(_0x1cb3b6,_0x480a3d){return function(_0x12175b){if(!_0x12175b){_0x1cb3b6[_0xeb7c('0x1a')](0x194);}return _0x12175b;};}function handleError(_0x434084,_0x55cda6){_0x55cda6=_0x55cda6||0x1f4;return function(_0x25ddcc){logger[_0xeb7c('0x27')](_0x25ddcc['stack']);if(_0x25ddcc[_0xeb7c('0x28')]){delete _0x25ddcc['name'];}_0x434084['status'](_0x55cda6)[_0xeb7c('0x29')](_0x25ddcc);};}exports[_0xeb7c('0x2a')]=function(_0x8c18eb,_0x1428c6){var _0x589732={},_0x10ea58={},_0x29826f={'count':0x0,'rows':[]};var _0x23ef2e=_[_0xeb7c('0x2b')](db['FaxTransferReport']['rawAttributes'],function(_0x2b8baa){return{'name':_0x2b8baa[_0xeb7c('0x2c')],'type':_0x2b8baa['type'][_0xeb7c('0x2d')]};});_0x10ea58[_0xeb7c('0x2e')]=_[_0xeb7c('0x2b')](_0x23ef2e,_0xeb7c('0x28'));_0x10ea58[_0xeb7c('0x2f')]=_[_0xeb7c('0x30')](_0x8c18eb['query']);_0x10ea58[_0xeb7c('0x31')]=_[_0xeb7c('0x32')](_0x10ea58[_0xeb7c('0x2e')],_0x10ea58[_0xeb7c('0x2f')]);_0x589732[_0xeb7c('0x33')]=_[_0xeb7c('0x32')](_0x10ea58[_0xeb7c('0x2e')],qs[_0xeb7c('0x34')](_0x8c18eb[_0xeb7c('0x2f')][_0xeb7c('0x34')]));_0x589732[_0xeb7c('0x33')]=_0x589732[_0xeb7c('0x33')][_0xeb7c('0x35')]?_0x589732['attributes']:_0x10ea58[_0xeb7c('0x2e')];if(!_0x8c18eb[_0xeb7c('0x2f')][_0xeb7c('0x36')](_0xeb7c('0x37'))){_0x589732['limit']=qs[_0xeb7c('0x1f')](_0x8c18eb[_0xeb7c('0x2f')]['limit']);_0x589732['offset']=qs[_0xeb7c('0x1e')](_0x8c18eb[_0xeb7c('0x2f')]['offset']);}_0x589732[_0xeb7c('0x38')]=qs[_0xeb7c('0x39')](_0x8c18eb[_0xeb7c('0x2f')]['sort']);_0x589732[_0xeb7c('0x3a')]=qs[_0xeb7c('0x31')](_[_0xeb7c('0x3b')](_0x8c18eb[_0xeb7c('0x2f')],_0x10ea58[_0xeb7c('0x31')]),_0x23ef2e);if(_0x8c18eb['query'][_0xeb7c('0x3c')]){_0x589732['where']=_[_0xeb7c('0x3d')](_0x589732[_0xeb7c('0x3a')],{'$or':_[_0xeb7c('0x2b')](_0x23ef2e,function(_0x4e805){if(_0x4e805[_0xeb7c('0x3e')]!==_0xeb7c('0x3f')){var _0x1f8d35={};_0x1f8d35[_0x4e805[_0xeb7c('0x28')]]={'$like':'%'+_0x8c18eb[_0xeb7c('0x2f')][_0xeb7c('0x3c')]+'%'};return _0x1f8d35;}})});}_0x589732=_[_0xeb7c('0x3d')]({},_0x589732,_0x8c18eb[_0xeb7c('0x40')]);var _0x3fb8e2={'where':_0x589732['where']};return db[_0xeb7c('0x41')]['count'](_0x3fb8e2)['then'](function(_0x436e9e){_0x29826f[_0xeb7c('0x21')]=_0x436e9e;if(_0x8c18eb[_0xeb7c('0x2f')][_0xeb7c('0x42')]){_0x589732['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0xeb7c('0x43')](_0x589732);})[_0xeb7c('0x26')](function(_0x12c48e){_0x29826f[_0xeb7c('0x44')]=_0x12c48e;return _0x29826f;})[_0xeb7c('0x26')](respondWithFilteredResult(_0x1428c6,_0x589732))['catch'](handleError(_0x1428c6,null));};exports[_0xeb7c('0x45')]=function(_0x401923,_0x162e81){var _0x21d8d1={'raw':!![],'where':{'id':_0x401923[_0xeb7c('0x46')]['id']}},_0x54e78b={};_0x54e78b['model']=_[_0xeb7c('0x30')](db[_0xeb7c('0x41')][_0xeb7c('0x47')]);_0x54e78b[_0xeb7c('0x2f')]=_[_0xeb7c('0x30')](_0x401923['query']);_0x54e78b[_0xeb7c('0x31')]=_['intersection'](_0x54e78b[_0xeb7c('0x2e')],_0x54e78b['query']);_0x21d8d1[_0xeb7c('0x33')]=_[_0xeb7c('0x32')](_0x54e78b[_0xeb7c('0x2e')],qs[_0xeb7c('0x34')](_0x401923[_0xeb7c('0x2f')]['fields']));_0x21d8d1[_0xeb7c('0x33')]=_0x21d8d1[_0xeb7c('0x33')][_0xeb7c('0x35')]?_0x21d8d1['attributes']:_0x54e78b[_0xeb7c('0x2e')];if(_0x401923[_0xeb7c('0x2f')][_0xeb7c('0x42')]){_0x21d8d1[_0xeb7c('0x48')]=[{'all':!![]}];}_0x21d8d1=_[_0xeb7c('0x3d')]({},_0x21d8d1,_0x401923[_0xeb7c('0x40')]);return db[_0xeb7c('0x41')]['find'](_0x21d8d1)[_0xeb7c('0x26')](handleEntityNotFound(_0x162e81,null))[_0xeb7c('0x26')](respondWithResult(_0x162e81,null))[_0xeb7c('0x49')](handleError(_0x162e81,null));};exports[_0xeb7c('0x4a')]=function(_0x5c00b5,_0x5d025b){return db[_0xeb7c('0x41')]['create'](_0x5c00b5[_0xeb7c('0x4b')],{})[_0xeb7c('0x26')](respondWithResult(_0x5d025b,0xc9))[_0xeb7c('0x49')](handleError(_0x5d025b,null));};exports[_0xeb7c('0x25')]=function(_0xe58cbb,_0x2767a7){if(_0xe58cbb[_0xeb7c('0x4b')]['id']){delete _0xe58cbb[_0xeb7c('0x4b')]['id'];}return db[_0xeb7c('0x41')][_0xeb7c('0x4c')]({'where':{'id':_0xe58cbb[_0xeb7c('0x46')]['id']}})[_0xeb7c('0x26')](handleEntityNotFound(_0x2767a7,null))[_0xeb7c('0x26')](saveUpdates(_0xe58cbb[_0xeb7c('0x4b')],null))[_0xeb7c('0x26')](respondWithResult(_0x2767a7,null))['catch'](handleError(_0x2767a7,null));};exports[_0xeb7c('0x4d')]=function(_0x451c5b,_0x569ae6){return db[_0xeb7c('0x41')][_0xeb7c('0x4c')]({'where':{'id':_0x451c5b[_0xeb7c('0x46')]['id']}})[_0xeb7c('0x26')](handleEntityNotFound(_0x569ae6,null))[_0xeb7c('0x26')](removeEntity(_0x569ae6,null))[_0xeb7c('0x49')](handleError(_0x569ae6,null));};exports[_0xeb7c('0x4e')]=function(_0x52e317,_0x209c16){return db[_0xeb7c('0x41')][_0xeb7c('0x4e')]()[_0xeb7c('0x26')](respondWithResult(_0x209c16,null))['catch'](handleError(_0x209c16,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 34b9c6f..da8eb8d 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 _0xef0a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x365b3b,_0x2c414f){var _0x19b3ba=function(_0x14bb05){while(--_0x14bb05){_0x365b3b['push'](_0x365b3b['shift']());}};_0x19b3ba(++_0x2c414f);}(_0xef0a,0xdd));var _0xaef0=function(_0x50e3b3,_0x5a3090){_0x50e3b3=_0x50e3b3-0x0;var _0x2ff644=_0xef0a[_0x50e3b3];return _0x2ff644;};'use strict';var _=require(_0xaef0('0x0'));var util=require(_0xaef0('0x1'));var logger=require(_0xaef0('0x2'))(_0xaef0('0x3'));var moment=require(_0xaef0('0x4'));var BPromise=require(_0xaef0('0x5'));var rp=require(_0xaef0('0x6'));var fs=require('fs');var path=require(_0xaef0('0x7'));var rimraf=require(_0xaef0('0x8'));var config=require(_0xaef0('0x9'));var attributes=require(_0xaef0('0xa'));module['exports']=function(_0x32868a,_0x12dd17){return _0x32868a[_0xaef0('0xb')](_0xaef0('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xaef0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9563=['define','report_fax_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x32a767,_0x4e3e76){var _0x2b4e6d=function(_0x5e0702){while(--_0x5e0702){_0x32a767['push'](_0x32a767['shift']());}};_0x2b4e6d(++_0x4e3e76);}(_0x9563,0x1e7));var _0x3956=function(_0x3372a6,_0x505699){_0x3372a6=_0x3372a6-0x0;var _0x77878=_0x9563[_0x3372a6];return _0x77878;};'use strict';var _=require(_0x3956('0x0'));var util=require(_0x3956('0x1'));var logger=require('../../config/logger')(_0x3956('0x2'));var moment=require(_0x3956('0x3'));var BPromise=require(_0x3956('0x4'));var rp=require(_0x3956('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3956('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x3956('0x7')]=function(_0x332a45,_0x177a1a){return _0x332a45[_0x3956('0x8')]('FaxTransferReport',attributes,{'tableName':_0x3956('0x9'),'paranoid':![],'indexes':[{'name':_0x3956('0xa'),'fields':[_0x3956('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 2e99c78..088bcc4 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 _0xe297=['rpc','../../config/environment','jayson/promise','client','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0xe297,0x142));var _0x7e29=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe297[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7e29('0x0'));var util=require(_0x7e29('0x1'));var moment=require(_0x7e29('0x2'));var BPromise=require(_0x7e29('0x3'));var rs=require(_0x7e29('0x4'));var fs=require('fs');var Redis=require(_0x7e29('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e29('0x6'));var logger=require(_0x7e29('0x7'))(_0x7e29('0x8'));var config=require(_0x7e29('0x9'));var jayson=require(_0x7e29('0xa'));var client=jayson[_0x7e29('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x132bbe,_0x2c5071,_0x4fe756){return new BPromise(function(_0x4215fb,_0x5b073d){return client['request'](_0x132bbe,_0x4fe756)['then'](function(_0x2f1d84){logger[_0x7e29('0xc')](_0x7e29('0xd'),_0x2c5071,_0x7e29('0xe'));logger[_0x7e29('0xf')](_0x7e29('0x10'),_0x2c5071,_0x7e29('0xe'),JSON[_0x7e29('0x11')](_0x2f1d84));if(_0x2f1d84[_0x7e29('0x12')]){if(_0x2f1d84[_0x7e29('0x12')][_0x7e29('0x13')]===0x1f4){logger[_0x7e29('0x12')](_0x7e29('0xd'),_0x2c5071,_0x2f1d84[_0x7e29('0x12')][_0x7e29('0x14')]);return _0x5b073d(_0x2f1d84[_0x7e29('0x12')][_0x7e29('0x14')]);}logger['error'](_0x7e29('0xd'),_0x2c5071,_0x2f1d84[_0x7e29('0x12')][_0x7e29('0x14')]);return _0x4215fb(_0x2f1d84[_0x7e29('0x12')][_0x7e29('0x14')]);}else{logger[_0x7e29('0xc')](_0x7e29('0xd'),_0x2c5071,'request\x20sent');_0x4215fb(_0x2f1d84[_0x7e29('0x15')]['message']);}})['catch'](function(_0x57cb72){logger['error'](_0x7e29('0xd'),_0x2c5071,_0x57cb72);_0x5b073d(_0x57cb72);});});} \ No newline at end of file +var _0x00b2=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','randomstring'];(function(_0x3fa04c,_0x108d8c){var _0x61a73c=function(_0x1051ef){while(--_0x1051ef){_0x3fa04c['push'](_0x3fa04c['shift']());}};_0x61a73c(++_0x108d8c);}(_0x00b2,0x173));var _0x200b=function(_0x23722b,_0x37baa7){_0x23722b=_0x23722b-0x0;var _0x198512=_0x00b2[_0x23722b];return _0x198512;};'use strict';var _=require(_0x200b('0x0'));var util=require('util');var moment=require(_0x200b('0x1'));var BPromise=require('bluebird');var rs=require(_0x200b('0x2'));var fs=require('fs');var Redis=require(_0x200b('0x3'));var db=require(_0x200b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x200b('0x5'))(_0x200b('0x6'));var config=require(_0x200b('0x7'));var jayson=require(_0x200b('0x8'));var client=jayson[_0x200b('0x9')][_0x200b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e1278,_0x510468,_0x21aaee){return new BPromise(function(_0x30ed38,_0xecac0c){return client['request'](_0x2e1278,_0x21aaee)[_0x200b('0xb')](function(_0x16f5c4){logger['info'](_0x200b('0xc'),_0x510468,_0x200b('0xd'));logger[_0x200b('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x510468,_0x200b('0xd'),JSON[_0x200b('0xf')](_0x16f5c4));if(_0x16f5c4[_0x200b('0x10')]){if(_0x16f5c4[_0x200b('0x10')][_0x200b('0x11')]===0x1f4){logger[_0x200b('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x510468,_0x16f5c4['error'][_0x200b('0x12')]);return _0xecac0c(_0x16f5c4[_0x200b('0x10')][_0x200b('0x12')]);}logger['error'](_0x200b('0xc'),_0x510468,_0x16f5c4['error'][_0x200b('0x12')]);return _0x30ed38(_0x16f5c4['error'][_0x200b('0x12')]);}else{logger[_0x200b('0x13')](_0x200b('0xc'),_0x510468,_0x200b('0xd'));_0x30ed38(_0x16f5c4[_0x200b('0x14')]['message']);}})[_0x200b('0x15')](function(_0x497ccb){logger[_0x200b('0x10')](_0x200b('0xc'),_0x510468,_0x497ccb);_0xecac0c(_0x497ccb);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index d11596f..627deed 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 _0x4b84=['fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','util','Router'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x4b84,0x1ae));var _0x44b8=function(_0x228641,_0x25d636){_0x228641=_0x228641-0x0;var _0x5d5d78=_0x4b84[_0x228641];return _0x5d5d78;};'use strict';var multer=require('multer');var util=require(_0x44b8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x44b8('0x1')]();var fs_extra=require(_0x44b8('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x44b8('0x3'));var config=require(_0x44b8('0x4'));var controller=require(_0x44b8('0x5'));router[_0x44b8('0x6')]('/',auth[_0x44b8('0x7')](),controller[_0x44b8('0x8')]);router[_0x44b8('0x6')](_0x44b8('0x9'),auth[_0x44b8('0x7')](),controller['describe']);router[_0x44b8('0x6')](_0x44b8('0xa'),auth[_0x44b8('0x7')](),controller[_0x44b8('0xb')]);router[_0x44b8('0xc')]('/',auth['isAuthenticated'](),controller[_0x44b8('0xd')]);router[_0x44b8('0xe')](_0x44b8('0xa'),auth[_0x44b8('0x7')](),controller[_0x44b8('0xf')]);router[_0x44b8('0x10')]('/:id',auth[_0x44b8('0x7')](),controller[_0x44b8('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc88a=['index','get','/describe','describe','show','create','/:id','update','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated'];(function(_0x627668,_0x3a120d){var _0x3a4319=function(_0x1d9fda){while(--_0x1d9fda){_0x627668['push'](_0x627668['shift']());}};_0x3a4319(++_0x3a120d);}(_0xc88a,0x7c));var _0xac88=function(_0x4427c1,_0xc07dc6){_0x4427c1=_0x4427c1-0x0;var _0x67907b=_0xc88a[_0x4427c1];return _0x67907b;};'use strict';var multer=require(_0xac88('0x0'));var util=require('util');var path=require(_0xac88('0x1'));var timeout=require(_0xac88('0x2'));var express=require(_0xac88('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xac88('0x4'));var interaction=require(_0xac88('0x5'));var config=require(_0xac88('0x6'));var controller=require(_0xac88('0x7'));router['get']('/',auth[_0xac88('0x8')](),controller[_0xac88('0x9')]);router[_0xac88('0xa')](_0xac88('0xb'),auth['isAuthenticated'](),controller[_0xac88('0xc')]);router[_0xac88('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xac88('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xac88('0xe')]);router['put'](_0xac88('0xf'),auth[_0xac88('0x8')](),controller[_0xac88('0x10')]);router[_0xac88('0x11')](_0xac88('0xf'),auth[_0xac88('0x8')](),controller[_0xac88('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 2c8fdf3..8b9c2bf 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 _0xa7e9=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','put','update','delete','destroy'];(function(_0x4ffcaf,_0x270bd6){var _0x9e220b=function(_0x20a9d0){while(--_0x20a9d0){_0x4ffcaf['push'](_0x4ffcaf['shift']());}};_0x9e220b(++_0x270bd6);}(_0xa7e9,0xfc));var _0x9a7e=function(_0x48808f,_0x3a26a6){_0x48808f=_0x48808f-0x0;var _0x699584=_0xa7e9[_0x48808f];return _0x699584;};'use strict';var multer=require('multer');var util=require(_0x9a7e('0x0'));var path=require(_0x9a7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x9a7e('0x2'));var router=express[_0x9a7e('0x3')]();var fs_extra=require(_0x9a7e('0x4'));var auth=require(_0x9a7e('0x5'));var interaction=require(_0x9a7e('0x6'));var config=require(_0x9a7e('0x7'));var controller=require(_0x9a7e('0x8'));router[_0x9a7e('0x9')]('/',auth[_0x9a7e('0xa')](),controller[_0x9a7e('0xb')]);router['get'](_0x9a7e('0xc'),auth[_0x9a7e('0xa')](),controller['show']);router[_0x9a7e('0x9')](_0x9a7e('0xd'),auth[_0x9a7e('0xa')](),controller[_0x9a7e('0xe')]);router[_0x9a7e('0x9')]('/:id/fields',auth[_0x9a7e('0xa')](),controller[_0x9a7e('0xf')]);router[_0x9a7e('0x10')]('/',auth[_0x9a7e('0xa')](),controller['create']);router[_0x9a7e('0x10')](_0x9a7e('0xd'),auth[_0x9a7e('0xa')](),controller['addConfiguration']);router[_0x9a7e('0x11')](_0x9a7e('0xc'),auth['isAuthenticated'](),controller[_0x9a7e('0x12')]);router[_0x9a7e('0x13')]('/:id',auth[_0x9a7e('0xa')](),controller[_0x9a7e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xfb93=['multer','util','path','connect-timeout','Router','fs-extra','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration','put','delete','destroy','exports'];(function(_0x146ef3,_0x1c7bb0){var _0x5d9bae=function(_0x3b70f7){while(--_0x3b70f7){_0x146ef3['push'](_0x146ef3['shift']());}};_0x5d9bae(++_0x1c7bb0);}(_0xfb93,0x111));var _0x3fb9=function(_0x2669de,_0x4a70c4){_0x2669de=_0x2669de-0x0;var _0x22dfe7=_0xfb93[_0x2669de];return _0x22dfe7;};'use strict';var multer=require(_0x3fb9('0x0'));var util=require(_0x3fb9('0x1'));var path=require(_0x3fb9('0x2'));var timeout=require(_0x3fb9('0x3'));var express=require('express');var router=express[_0x3fb9('0x4')]();var fs_extra=require(_0x3fb9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3fb9('0x6'));router[_0x3fb9('0x7')]('/',auth[_0x3fb9('0x8')](),controller[_0x3fb9('0x9')]);router['get']('/:id',auth[_0x3fb9('0x8')](),controller[_0x3fb9('0xa')]);router[_0x3fb9('0x7')](_0x3fb9('0xb'),auth[_0x3fb9('0x8')](),controller[_0x3fb9('0xc')]);router[_0x3fb9('0x7')](_0x3fb9('0xd'),auth[_0x3fb9('0x8')](),controller[_0x3fb9('0xe')]);router['post']('/',auth[_0x3fb9('0x8')](),controller[_0x3fb9('0xf')]);router['post'](_0x3fb9('0xb'),auth[_0x3fb9('0x8')](),controller[_0x3fb9('0x10')]);router[_0x3fb9('0x11')]('/:id',auth[_0x3fb9('0x8')](),controller['update']);router[_0x3fb9('0x12')]('/:id',auth[_0x3fb9('0x8')](),controller[_0x3fb9('0x13')]);module[_0x3fb9('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index c8b9a79..0a20f15 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 _0x5330=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x3d6287,_0x4f62f9){var _0x39da2d=function(_0x128000){while(--_0x128000){_0x3d6287['push'](_0x3d6287['shift']());}};_0x39da2d(++_0x4f62f9);}(_0x5330,0x9e));var _0x0533=function(_0x42cd6a,_0xe106a2){_0x42cd6a=_0x42cd6a-0x0;var _0x43046d=_0x5330[_0x42cd6a];return _0x43046d;};'use strict';var Sequelize=require(_0x0533('0x0'));module[_0x0533('0x1')]={'name':{'type':Sequelize[_0x0533('0x2')]},'description':{'type':Sequelize[_0x0533('0x2')]},'username':{'type':Sequelize[_0x0533('0x2')]},'remoteUri':{'type':Sequelize[_0x0533('0x2')]},'authType':{'type':Sequelize[_0x0533('0x3')]('basic'),'defaultValue':_0x0533('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x0533('0x2')]},'consumerSecret':{'type':Sequelize[_0x0533('0x2')]},'token':{'type':Sequelize[_0x0533('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x0533('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0533('0x3')](_0x0533('0x5'),_0x0533('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x6f26=['STRING','integrationTab','newTab','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f26,0x77));var _0x66f2=function(_0x53150d,_0x55665c){_0x53150d=_0x53150d-0x0;var _0x44eadc=_0x6f26[_0x53150d];return _0x44eadc;};'use strict';var Sequelize=require(_0x66f2('0x0'));module['exports']={'name':{'type':Sequelize[_0x66f2('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x66f2('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x66f2('0x1')]},'consumerKey':{'type':Sequelize[_0x66f2('0x1')]},'consumerSecret':{'type':Sequelize[_0x66f2('0x1')]},'token':{'type':Sequelize[_0x66f2('0x1')]},'tokenSecret':{'type':Sequelize[_0x66f2('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x66f2('0x2'),_0x66f2('0x3')),'defaultValue':_0x66f2('0x2')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index d39855f..a0a3dab 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 _0xa1aa=['include','findAll','rows','show','DeskAccount','rawAttributes','find','catch','create','body','params','getConfigurations','findOne','keys','DeskConfiguration','order','sort','pick','nolimit','addConfiguration','AccountId','Descriptions','channel','DeskField','Subjects','getFields','priority','authType','username','password','consumerKey','consumerSecret','token','remoteUri','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','squel','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','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','limit','where','filter','merge','VIRTUAL','options'];(function(_0x5403a1,_0x29a4e6){var _0x51fde6=function(_0x185c43){while(--_0x185c43){_0x5403a1['push'](_0x5403a1['shift']());}};_0x51fde6(++_0x29a4e6);}(_0xa1aa,0x120));var _0xaa1a=function(_0x3c0892,_0x450bf6){_0x3c0892=_0x3c0892-0x0;var _0x3c1c54=_0xa1aa[_0x3c0892];return _0x3c1c54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa1a('0x0'));var zipdir=require(_0xaa1a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa1a('0x2'));var moment=require(_0xaa1a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaa1a('0x4'));var path=require(_0xaa1a('0x5'));var sox=require(_0xaa1a('0x6'));var csv=require('to-csv');var ejs=require(_0xaa1a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaa1a('0x8'));var crypto=require('crypto');var jsforce=require(_0xaa1a('0x9'));var deskjs=require(_0xaa1a('0xa'));var toCsv=require('to-csv');var querystring=require(_0xaa1a('0xb'));var Papa=require(_0xaa1a('0xc'));var Redis=require(_0xaa1a('0xd'));var authService=require(_0xaa1a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xaa1a('0xf'));var hardwareService=require(_0xaa1a('0x10'));var logger=require(_0xaa1a('0x11'))(_0xaa1a('0x12'));var utils=require(_0xaa1a('0x13'));var config=require(_0xaa1a('0x14'));var licenseUtil=require(_0xaa1a('0x15'));var db=require(_0xaa1a('0x16'))['db'];var integrations=require(_0xaa1a('0x17'));function respondWithStatusCode(_0x8d2e0b,_0x3df435){_0x3df435=_0x3df435||0xcc;return function(_0x27cb8d){if(_0x27cb8d){return _0x8d2e0b[_0xaa1a('0x18')](_0x3df435);}return _0x8d2e0b[_0xaa1a('0x19')](_0x3df435)[_0xaa1a('0x1a')]();};}function respondWithResult(_0x30cee4,_0x3dc74e){_0x3dc74e=_0x3dc74e||0xc8;return function(_0x45988c){if(_0x45988c){return _0x30cee4[_0xaa1a('0x19')](_0x3dc74e)['json'](_0x45988c);}};}function respondWithFilteredResult(_0x423925,_0x2b8102){return function(_0x4ea01c){if(_0x4ea01c){var _0x5de2c6=typeof _0x2b8102[_0xaa1a('0x1b')]===_0xaa1a('0x1c')&&typeof _0x2b8102['limit']===_0xaa1a('0x1c');var _0x7076ca=_0x4ea01c[_0xaa1a('0x1d')];var _0x2ee3b2=_0x5de2c6?0x0:_0x2b8102[_0xaa1a('0x1b')];var _0x51076c=_0x5de2c6?_0x4ea01c[_0xaa1a('0x1d')]:_0x2b8102[_0xaa1a('0x1b')]+_0x2b8102['limit'];var _0x37d7ba;if(_0x51076c>=_0x7076ca){_0x51076c=_0x7076ca;_0x37d7ba=0xc8;}else{_0x37d7ba=0xce;}_0x423925[_0xaa1a('0x19')](_0x37d7ba);return _0x423925[_0xaa1a('0x1e')](_0xaa1a('0x1f'),_0x2ee3b2+'-'+_0x51076c+'/'+_0x7076ca)[_0xaa1a('0x20')](_0x4ea01c);}return null;};}function patchUpdates(_0x1a6dc5){return function(_0x29a040){try{jsonpatch[_0xaa1a('0x21')](_0x29a040,_0x1a6dc5,!![]);}catch(_0x392d4a){return BPromise['reject'](_0x392d4a);}return _0x29a040[_0xaa1a('0x22')]();};}function saveUpdates(_0x152cfa,_0x4f1fcf){return function(_0x204fa5){if(_0x204fa5){return _0x204fa5[_0xaa1a('0x23')](_0x152cfa)[_0xaa1a('0x24')](function(_0x39010e){return _0x39010e;});}return null;};}function removeEntity(_0x325361,_0x4bccbf){return function(_0x236fd7){if(_0x236fd7){return _0x236fd7[_0xaa1a('0x25')]()[_0xaa1a('0x24')](function(){_0x325361['status'](0xcc)[_0xaa1a('0x1a')]();});}};}function handleEntityNotFound(_0x2afee4,_0x3d6862){return function(_0x116100){if(!_0x116100){_0x2afee4['sendStatus'](0x194);}return _0x116100;};}function handleError(_0x26d83d,_0x4c0291){_0x4c0291=_0x4c0291||0x1f4;return function(_0x3bb701){logger[_0xaa1a('0x26')](_0x3bb701[_0xaa1a('0x27')]);if(_0x3bb701[_0xaa1a('0x28')]){delete _0x3bb701['name'];}_0x26d83d[_0xaa1a('0x19')](_0x4c0291)[_0xaa1a('0x29')](_0x3bb701);};}exports[_0xaa1a('0x2a')]=function(_0x244fba,_0x2a4242){var _0x57a5aa={},_0x21bbff={},_0x532d96={'count':0x0,'rows':[]};var _0x534a4a=_[_0xaa1a('0x2b')](db['DeskAccount']['rawAttributes'],function(_0x5ce8ea){return{'name':_0x5ce8ea[_0xaa1a('0x2c')],'type':_0x5ce8ea[_0xaa1a('0x2d')][_0xaa1a('0x2e')]};});_0x21bbff[_0xaa1a('0x2f')]=_[_0xaa1a('0x2b')](_0x534a4a,_0xaa1a('0x28'));_0x21bbff[_0xaa1a('0x30')]=_['keys'](_0x244fba[_0xaa1a('0x30')]);_0x21bbff[_0xaa1a('0x31')]=_[_0xaa1a('0x32')](_0x21bbff[_0xaa1a('0x2f')],_0x21bbff['query']);_0x57a5aa[_0xaa1a('0x33')]=_['intersection'](_0x21bbff[_0xaa1a('0x2f')],qs[_0xaa1a('0x34')](_0x244fba[_0xaa1a('0x30')][_0xaa1a('0x34')]));_0x57a5aa['attributes']=_0x57a5aa[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x57a5aa['attributes']:_0x21bbff['model'];if(!_0x244fba[_0xaa1a('0x30')]['hasOwnProperty']('nolimit')){_0x57a5aa[_0xaa1a('0x36')]=qs[_0xaa1a('0x36')](_0x244fba['query'][_0xaa1a('0x36')]);_0x57a5aa['offset']=qs['offset'](_0x244fba['query'][_0xaa1a('0x1b')]);}_0x57a5aa['order']=qs['sort'](_0x244fba[_0xaa1a('0x30')]['sort']);_0x57a5aa[_0xaa1a('0x37')]=qs[_0xaa1a('0x31')](_['pick'](_0x244fba[_0xaa1a('0x30')],_0x21bbff[_0xaa1a('0x31')]),_0x534a4a);if(_0x244fba[_0xaa1a('0x30')][_0xaa1a('0x38')]){_0x57a5aa[_0xaa1a('0x37')]=_[_0xaa1a('0x39')](_0x57a5aa['where'],{'$or':_['map'](_0x534a4a,function(_0x3df1df){if(_0x3df1df[_0xaa1a('0x2d')]!==_0xaa1a('0x3a')){var _0x316740={};_0x316740[_0x3df1df[_0xaa1a('0x28')]]={'$like':'%'+_0x244fba['query'][_0xaa1a('0x38')]+'%'};return _0x316740;}})});}_0x57a5aa=_[_0xaa1a('0x39')]({},_0x57a5aa,_0x244fba[_0xaa1a('0x3b')]);var _0x14ada4={'where':_0x57a5aa[_0xaa1a('0x37')]};return db['DeskAccount'][_0xaa1a('0x1d')](_0x14ada4)['then'](function(_0x1ebff9){_0x532d96[_0xaa1a('0x1d')]=_0x1ebff9;if(_0x244fba['query']['includeAll']){_0x57a5aa[_0xaa1a('0x3c')]=[{'all':!![]}];}return db['DeskAccount'][_0xaa1a('0x3d')](_0x57a5aa);})[_0xaa1a('0x24')](function(_0x57236c){_0x532d96[_0xaa1a('0x3e')]=_0x57236c;return _0x532d96;})[_0xaa1a('0x24')](respondWithFilteredResult(_0x2a4242,_0x57a5aa))['catch'](handleError(_0x2a4242,null));};exports[_0xaa1a('0x3f')]=function(_0x39d0af,_0x23a9ce){var _0x5ee3eb={'raw':![],'where':{'id':_0x39d0af['params']['id']}},_0x52e6d3={};_0x52e6d3[_0xaa1a('0x2f')]=_['keys'](db[_0xaa1a('0x40')][_0xaa1a('0x41')]);_0x52e6d3[_0xaa1a('0x30')]=_['keys'](_0x39d0af[_0xaa1a('0x30')]);_0x52e6d3[_0xaa1a('0x31')]=_[_0xaa1a('0x32')](_0x52e6d3[_0xaa1a('0x2f')],_0x52e6d3[_0xaa1a('0x30')]);_0x5ee3eb['attributes']=_[_0xaa1a('0x32')](_0x52e6d3[_0xaa1a('0x2f')],qs[_0xaa1a('0x34')](_0x39d0af['query']['fields']));_0x5ee3eb[_0xaa1a('0x33')]=_0x5ee3eb[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x5ee3eb[_0xaa1a('0x33')]:_0x52e6d3[_0xaa1a('0x2f')];if(_0x39d0af['query']['includeAll']){_0x5ee3eb['include']=[{'all':!![]}];}_0x5ee3eb=_[_0xaa1a('0x39')]({},_0x5ee3eb,_0x39d0af[_0xaa1a('0x3b')]);return db[_0xaa1a('0x40')][_0xaa1a('0x42')](_0x5ee3eb)[_0xaa1a('0x24')](handleEntityNotFound(_0x23a9ce,null))[_0xaa1a('0x24')](respondWithResult(_0x23a9ce,null))[_0xaa1a('0x43')](handleError(_0x23a9ce,null));};exports[_0xaa1a('0x44')]=function(_0xf42384,_0x32620b){return db[_0xaa1a('0x40')]['create'](_0xf42384[_0xaa1a('0x45')],{})[_0xaa1a('0x24')](respondWithResult(_0x32620b,0xc9))['catch'](handleError(_0x32620b,null));};exports['update']=function(_0x44c9d8,_0x38ad17){if(_0x44c9d8[_0xaa1a('0x45')]['id']){delete _0x44c9d8[_0xaa1a('0x45')]['id'];}return db['DeskAccount'][_0xaa1a('0x42')]({'where':{'id':_0x44c9d8[_0xaa1a('0x46')]['id']}})[_0xaa1a('0x24')](handleEntityNotFound(_0x38ad17,null))[_0xaa1a('0x24')](saveUpdates(_0x44c9d8['body'],null))['then'](respondWithResult(_0x38ad17,null))['catch'](handleError(_0x38ad17,null));};exports['destroy']=function(_0x4bb01f,_0x41db7e){return db[_0xaa1a('0x40')][_0xaa1a('0x42')]({'where':{'id':_0x4bb01f[_0xaa1a('0x46')]['id']}})['then'](handleEntityNotFound(_0x41db7e,null))[_0xaa1a('0x24')](removeEntity(_0x41db7e,null))[_0xaa1a('0x43')](handleError(_0x41db7e,null));};exports[_0xaa1a('0x47')]=function(_0x1e3334,_0x481a81,_0x53580c){var _0x4190e4={};var _0x5158c4={};var _0xdb410;var _0x10a462;return db[_0xaa1a('0x40')][_0xaa1a('0x48')]({'where':{'id':_0x1e3334[_0xaa1a('0x46')]['id']}})[_0xaa1a('0x24')](handleEntityNotFound(_0x481a81,null))[_0xaa1a('0x24')](function(_0x376131){if(_0x376131){_0xdb410=_0x376131;_0x5158c4[_0xaa1a('0x2f')]=_[_0xaa1a('0x49')](db[_0xaa1a('0x4a')][_0xaa1a('0x41')]);_0x5158c4[_0xaa1a('0x30')]=_[_0xaa1a('0x49')](_0x1e3334['query']);_0x5158c4[_0xaa1a('0x31')]=_[_0xaa1a('0x32')](_0x5158c4[_0xaa1a('0x2f')],_0x5158c4[_0xaa1a('0x30')]);_0x4190e4[_0xaa1a('0x33')]=_[_0xaa1a('0x32')](_0x5158c4[_0xaa1a('0x2f')],qs[_0xaa1a('0x34')](_0x1e3334[_0xaa1a('0x30')]['fields']));_0x4190e4[_0xaa1a('0x33')]=_0x4190e4['attributes'][_0xaa1a('0x35')]?_0x4190e4[_0xaa1a('0x33')]:_0x5158c4[_0xaa1a('0x2f')];_0x4190e4[_0xaa1a('0x4b')]=qs[_0xaa1a('0x4c')](_0x1e3334[_0xaa1a('0x30')][_0xaa1a('0x4c')]);_0x4190e4[_0xaa1a('0x37')]=qs[_0xaa1a('0x31')](_[_0xaa1a('0x4d')](_0x1e3334[_0xaa1a('0x30')],_0x5158c4['filters']));if(_0x1e3334[_0xaa1a('0x30')][_0xaa1a('0x38')]){_0x4190e4[_0xaa1a('0x37')]=_['merge'](_0x4190e4[_0xaa1a('0x37')],{'$or':_['map'](_0x4190e4['attributes'],function(_0x95e73e){var _0xff18fa={};_0xff18fa[_0x95e73e]={'$like':'%'+_0x1e3334[_0xaa1a('0x30')][_0xaa1a('0x38')]+'%'};return _0xff18fa;})});}_0x4190e4=_[_0xaa1a('0x39')]({},_0x4190e4,_0x1e3334[_0xaa1a('0x3b')]);return _0xdb410[_0xaa1a('0x47')](_0x4190e4);}})[_0xaa1a('0x24')](function(_0x3d20a9){if(_0x3d20a9){_0x10a462=_0x3d20a9[_0xaa1a('0x35')];if(!_0x1e3334[_0xaa1a('0x30')]['hasOwnProperty'](_0xaa1a('0x4e'))){_0x4190e4[_0xaa1a('0x36')]=qs['limit'](_0x1e3334[_0xaa1a('0x30')][_0xaa1a('0x36')]);_0x4190e4[_0xaa1a('0x1b')]=qs['offset'](_0x1e3334[_0xaa1a('0x30')][_0xaa1a('0x1b')]);}return _0xdb410[_0xaa1a('0x47')](_0x4190e4);}})[_0xaa1a('0x24')](function(_0x57bef7){if(_0x57bef7){return _0x57bef7?{'count':_0x10a462,'rows':_0x57bef7}:null;}})['then'](respondWithResult(_0x481a81,null))[_0xaa1a('0x43')](handleError(_0x481a81,null));};exports[_0xaa1a('0x4f')]=function(_0x5183f8,_0x269350,_0x267f94){if(_0x5183f8[_0xaa1a('0x45')]['id']){delete _0x5183f8[_0xaa1a('0x45')]['id'];}return db[_0xaa1a('0x40')][_0xaa1a('0x48')]({'where':{'id':_0x5183f8['params']['id']}})[_0xaa1a('0x24')](handleEntityNotFound(_0x269350,null))[_0xaa1a('0x24')](function(_0x5e396a){if(_0x5e396a){_0x5183f8[_0xaa1a('0x45')][_0xaa1a('0x50')]=_0x5e396a['id'];_0x5183f8[_0xaa1a('0x45')]['Subjects']=integrations['getSubjects'](_0x5183f8['body']['channel'],_0x5183f8[_0xaa1a('0x45')][_0xaa1a('0x2d')]);_0x5183f8[_0xaa1a('0x45')][_0xaa1a('0x51')]=integrations['getDescriptions'](_0x5183f8[_0xaa1a('0x45')][_0xaa1a('0x52')],_0x5183f8['body'][_0xaa1a('0x2d')]);return db[_0xaa1a('0x4a')][_0xaa1a('0x44')](_0x5183f8[_0xaa1a('0x45')],{'include':[{'model':db[_0xaa1a('0x53')],'as':_0xaa1a('0x54')},{'model':db[_0xaa1a('0x53')],'as':_0xaa1a('0x51')}]});}return null;})[_0xaa1a('0x24')](respondWithResult(_0x269350,null))['catch'](handleError(_0x269350,null));};exports[_0xaa1a('0x55')]=function(_0x337879,_0x45b90e,_0x222e75){var _0x195a63=[{'name':_0xaa1a('0x56'),'label':_0xaa1a('0x56'),'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 _0x2ea7fb='';return db[_0xaa1a('0x40')][_0xaa1a('0x48')]({'where':{'id':_0x337879['params']['id']},'attributes':['id','remoteUri',_0xaa1a('0x57'),_0xaa1a('0x58'),_0xaa1a('0x59'),_0xaa1a('0x5a'),_0xaa1a('0x5b'),_0xaa1a('0x5c'),'tokenSecret']})[_0xaa1a('0x24')](handleEntityNotFound(_0x45b90e,null))[_0xaa1a('0x24')](function(_0x315cf1){if(_0x315cf1){_0x2ea7fb=_0x315cf1[_0xaa1a('0x5d')];var _0x41b827=_0x2ea7fb[_0xaa1a('0x5e')](-0x1);if(_0x41b827==='/'){_0x2ea7fb=_0x2ea7fb['substring'](0x0,_0x2ea7fb[_0xaa1a('0x5f')](_0x41b827));}var _0x54c0d2={'method':_0xaa1a('0x60'),'uri':util[_0xaa1a('0x61')](_0xaa1a('0x62'),_0x2ea7fb),'headers':{'Content-Type':_0xaa1a('0x63'),'Accept':_0xaa1a('0x63')},'json':!![]};if(_0x315cf1[_0xaa1a('0x57')]===_0xaa1a('0x64')){_0x54c0d2['headers'][_0xaa1a('0x65')]=util[_0xaa1a('0x61')](_0xaa1a('0x66'),new Buffer(util[_0xaa1a('0x61')](_0xaa1a('0x67'),_0x315cf1[_0xaa1a('0x58')],_0x315cf1[_0xaa1a('0x59')]))[_0xaa1a('0x68')](_0xaa1a('0x69')));}return rp(_0x54c0d2)[_0xaa1a('0x24')](function(_0x5bf080){return _0x195a63[_0xaa1a('0x6a')](_[_0xaa1a('0x2b')](_0x5bf080[_0xaa1a('0x6b')][_0xaa1a('0x6c')],function(_0x51b937){return{'id':_0x51b937['name'],'name':_0x51b937[_0xaa1a('0x28')],'type':_0x51b937[_0xaa1a('0x2d')],'active':_0x51b937[_0xaa1a('0x6d')],'label':_0x51b937[_0xaa1a('0x6e')],'custom':!![]};}));});}})['then'](function(_0x2118d3){return{'count':_0x2118d3[_0xaa1a('0x35')],'rows':_0x2118d3};})['then'](respondWithResult(_0x45b90e,null))[_0xaa1a('0x43')](function(_0x3bf0c1){var _0x43dff3=_0x337879['query'][_0xaa1a('0x6f')]?0x1f4:_0x3bf0c1[_0xaa1a('0x70')]||0x1f4;logger['error'](_0xaa1a('0x71'),'getFields',_0x43dff3,JSON[_0xaa1a('0x72')](_0x3bf0c1));delete _0x3bf0c1[_0xaa1a('0x28')];if(_0x43dff3===0x191){_0x43dff3=0x190;}_0x45b90e[_0xaa1a('0x19')](_0x43dff3)['send'](_0x337879[_0xaa1a('0x30')][_0xaa1a('0x6f')]?{'message':_0xaa1a('0x73'),'statusCode':_0x3bf0c1[_0xaa1a('0x70')]}:_0x3bf0c1);});}; \ No newline at end of file +var _0x4d84=['hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','DeskAccount','includeAll','findAll','catch','include','find','create','body','getConfigurations','findOne','DeskConfiguration','nolimit','addConfiguration','params','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','%s:%s','base64','concat','_embedded','active','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2837f1,_0x571485){var _0x5aeb48=function(_0x2ee56a){while(--_0x2ee56a){_0x2837f1['push'](_0x2837f1['shift']());}};_0x5aeb48(++_0x571485);}(_0x4d84,0x18a));var _0x44d8=function(_0x2f56ff,_0x2515cf){_0x2f56ff=_0x2f56ff-0x0;var _0x269e80=_0x4d84[_0x2f56ff];return _0x269e80;};'use strict';var emlformat=require(_0x44d8('0x0'));var rimraf=require(_0x44d8('0x1'));var zipdir=require(_0x44d8('0x2'));var jsonpatch=require(_0x44d8('0x3'));var rp=require(_0x44d8('0x4'));var moment=require(_0x44d8('0x5'));var BPromise=require(_0x44d8('0x6'));var Mustache=require(_0x44d8('0x7'));var util=require(_0x44d8('0x8'));var path=require(_0x44d8('0x9'));var sox=require('sox');var csv=require(_0x44d8('0xa'));var ejs=require(_0x44d8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x44d8('0xc'));var crypto=require(_0x44d8('0xd'));var jsforce=require(_0x44d8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x44d8('0xa'));var querystring=require(_0x44d8('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x44d8('0x10'));var qs=require(_0x44d8('0x11'));var as=require(_0x44d8('0x12'));var hardwareService=require(_0x44d8('0x13'));var logger=require(_0x44d8('0x14'))(_0x44d8('0x15'));var utils=require(_0x44d8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x44d8('0x17'));var db=require(_0x44d8('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x14b24e,_0x5e5673){_0x5e5673=_0x5e5673||0xcc;return function(_0xb2cd49){if(_0xb2cd49){return _0x14b24e[_0x44d8('0x19')](_0x5e5673);}return _0x14b24e['status'](_0x5e5673)[_0x44d8('0x1a')]();};}function respondWithResult(_0x1d9c82,_0x401019){_0x401019=_0x401019||0xc8;return function(_0x11e4bb){if(_0x11e4bb){return _0x1d9c82[_0x44d8('0x1b')](_0x401019)[_0x44d8('0x1c')](_0x11e4bb);}};}function respondWithFilteredResult(_0x5492d3,_0x5bc139){return function(_0x20c363){if(_0x20c363){var _0x5db76b=typeof _0x5bc139[_0x44d8('0x1d')]===_0x44d8('0x1e')&&typeof _0x5bc139[_0x44d8('0x1f')]===_0x44d8('0x1e');var _0x2e0217=_0x20c363[_0x44d8('0x20')];var _0x23b9d7=_0x5db76b?0x0:_0x5bc139[_0x44d8('0x1d')];var _0x18757f=_0x5db76b?_0x20c363[_0x44d8('0x20')]:_0x5bc139['offset']+_0x5bc139[_0x44d8('0x1f')];var _0x4324ae;if(_0x18757f>=_0x2e0217){_0x18757f=_0x2e0217;_0x4324ae=0xc8;}else{_0x4324ae=0xce;}_0x5492d3[_0x44d8('0x1b')](_0x4324ae);return _0x5492d3['set'](_0x44d8('0x21'),_0x23b9d7+'-'+_0x18757f+'/'+_0x2e0217)[_0x44d8('0x1c')](_0x20c363);}return null;};}function patchUpdates(_0x1b9f54){return function(_0x4b4db7){try{jsonpatch[_0x44d8('0x22')](_0x4b4db7,_0x1b9f54,!![]);}catch(_0x489283){return BPromise['reject'](_0x489283);}return _0x4b4db7['save']();};}function saveUpdates(_0xbb655e,_0x3a835d){return function(_0x3d050e){if(_0x3d050e){return _0x3d050e[_0x44d8('0x23')](_0xbb655e)[_0x44d8('0x24')](function(_0x2b1918){return _0x2b1918;});}return null;};}function removeEntity(_0x4960e5,_0x4e83b4){return function(_0x37cbd6){if(_0x37cbd6){return _0x37cbd6[_0x44d8('0x25')]()['then'](function(){_0x4960e5[_0x44d8('0x1b')](0xcc)[_0x44d8('0x1a')]();});}};}function handleEntityNotFound(_0x4f113e,_0x551c28){return function(_0x34dcd){if(!_0x34dcd){_0x4f113e['sendStatus'](0x194);}return _0x34dcd;};}function handleError(_0x216db3,_0x513940){_0x513940=_0x513940||0x1f4;return function(_0x5da4c3){logger['error'](_0x5da4c3[_0x44d8('0x26')]);if(_0x5da4c3[_0x44d8('0x27')]){delete _0x5da4c3[_0x44d8('0x27')];}_0x216db3[_0x44d8('0x1b')](_0x513940)[_0x44d8('0x28')](_0x5da4c3);};}exports['index']=function(_0x4e6d70,_0x15e362){var _0x38449e={},_0x1117e5={},_0x2b0c8a={'count':0x0,'rows':[]};var _0x4dabc5=_[_0x44d8('0x29')](db['DeskAccount'][_0x44d8('0x2a')],function(_0x4e429a){return{'name':_0x4e429a[_0x44d8('0x2b')],'type':_0x4e429a[_0x44d8('0x2c')][_0x44d8('0x2d')]};});_0x1117e5[_0x44d8('0x2e')]=_[_0x44d8('0x29')](_0x4dabc5,_0x44d8('0x27'));_0x1117e5[_0x44d8('0x2f')]=_[_0x44d8('0x30')](_0x4e6d70[_0x44d8('0x2f')]);_0x1117e5[_0x44d8('0x31')]=_[_0x44d8('0x32')](_0x1117e5[_0x44d8('0x2e')],_0x1117e5[_0x44d8('0x2f')]);_0x38449e[_0x44d8('0x33')]=_['intersection'](_0x1117e5[_0x44d8('0x2e')],qs[_0x44d8('0x34')](_0x4e6d70['query']['fields']));_0x38449e[_0x44d8('0x33')]=_0x38449e[_0x44d8('0x33')][_0x44d8('0x35')]?_0x38449e[_0x44d8('0x33')]:_0x1117e5[_0x44d8('0x2e')];if(!_0x4e6d70[_0x44d8('0x2f')][_0x44d8('0x36')]('nolimit')){_0x38449e[_0x44d8('0x1f')]=qs[_0x44d8('0x1f')](_0x4e6d70[_0x44d8('0x2f')][_0x44d8('0x1f')]);_0x38449e[_0x44d8('0x1d')]=qs[_0x44d8('0x1d')](_0x4e6d70[_0x44d8('0x2f')][_0x44d8('0x1d')]);}_0x38449e[_0x44d8('0x37')]=qs['sort'](_0x4e6d70[_0x44d8('0x2f')][_0x44d8('0x38')]);_0x38449e['where']=qs['filters'](_[_0x44d8('0x39')](_0x4e6d70['query'],_0x1117e5[_0x44d8('0x31')]),_0x4dabc5);if(_0x4e6d70[_0x44d8('0x2f')][_0x44d8('0x3a')]){_0x38449e[_0x44d8('0x3b')]=_[_0x44d8('0x3c')](_0x38449e['where'],{'$or':_[_0x44d8('0x29')](_0x4dabc5,function(_0x434066){if(_0x434066[_0x44d8('0x2c')]!==_0x44d8('0x3d')){var _0x453f7c={};_0x453f7c[_0x434066[_0x44d8('0x27')]]={'$like':'%'+_0x4e6d70['query'][_0x44d8('0x3a')]+'%'};return _0x453f7c;}})});}_0x38449e=_[_0x44d8('0x3c')]({},_0x38449e,_0x4e6d70[_0x44d8('0x3e')]);var _0xbbabae={'where':_0x38449e[_0x44d8('0x3b')]};return db[_0x44d8('0x3f')]['count'](_0xbbabae)[_0x44d8('0x24')](function(_0x335df8){_0x2b0c8a[_0x44d8('0x20')]=_0x335df8;if(_0x4e6d70[_0x44d8('0x2f')][_0x44d8('0x40')]){_0x38449e['include']=[{'all':!![]}];}return db[_0x44d8('0x3f')][_0x44d8('0x41')](_0x38449e);})[_0x44d8('0x24')](function(_0x5062e3){_0x2b0c8a['rows']=_0x5062e3;return _0x2b0c8a;})[_0x44d8('0x24')](respondWithFilteredResult(_0x15e362,_0x38449e))[_0x44d8('0x42')](handleError(_0x15e362,null));};exports['show']=function(_0x2173cb,_0x4437b1){var _0x2646c8={'raw':![],'where':{'id':_0x2173cb['params']['id']}},_0x2534bd={};_0x2534bd['model']=_[_0x44d8('0x30')](db[_0x44d8('0x3f')][_0x44d8('0x2a')]);_0x2534bd[_0x44d8('0x2f')]=_[_0x44d8('0x30')](_0x2173cb[_0x44d8('0x2f')]);_0x2534bd[_0x44d8('0x31')]=_[_0x44d8('0x32')](_0x2534bd['model'],_0x2534bd['query']);_0x2646c8[_0x44d8('0x33')]=_[_0x44d8('0x32')](_0x2534bd[_0x44d8('0x2e')],qs['fields'](_0x2173cb['query'][_0x44d8('0x34')]));_0x2646c8[_0x44d8('0x33')]=_0x2646c8[_0x44d8('0x33')][_0x44d8('0x35')]?_0x2646c8['attributes']:_0x2534bd[_0x44d8('0x2e')];if(_0x2173cb[_0x44d8('0x2f')]['includeAll']){_0x2646c8[_0x44d8('0x43')]=[{'all':!![]}];}_0x2646c8=_[_0x44d8('0x3c')]({},_0x2646c8,_0x2173cb[_0x44d8('0x3e')]);return db[_0x44d8('0x3f')][_0x44d8('0x44')](_0x2646c8)[_0x44d8('0x24')](handleEntityNotFound(_0x4437b1,null))[_0x44d8('0x24')](respondWithResult(_0x4437b1,null))[_0x44d8('0x42')](handleError(_0x4437b1,null));};exports[_0x44d8('0x45')]=function(_0x870c71,_0x8f501a){return db['DeskAccount'][_0x44d8('0x45')](_0x870c71[_0x44d8('0x46')],{})['then'](respondWithResult(_0x8f501a,0xc9))['catch'](handleError(_0x8f501a,null));};exports[_0x44d8('0x23')]=function(_0x36b997,_0x1f5459){if(_0x36b997[_0x44d8('0x46')]['id']){delete _0x36b997[_0x44d8('0x46')]['id'];}return db[_0x44d8('0x3f')][_0x44d8('0x44')]({'where':{'id':_0x36b997['params']['id']}})[_0x44d8('0x24')](handleEntityNotFound(_0x1f5459,null))[_0x44d8('0x24')](saveUpdates(_0x36b997[_0x44d8('0x46')],null))[_0x44d8('0x24')](respondWithResult(_0x1f5459,null))['catch'](handleError(_0x1f5459,null));};exports['destroy']=function(_0x42cd66,_0x379db2){return db[_0x44d8('0x3f')]['find']({'where':{'id':_0x42cd66['params']['id']}})[_0x44d8('0x24')](handleEntityNotFound(_0x379db2,null))['then'](removeEntity(_0x379db2,null))[_0x44d8('0x42')](handleError(_0x379db2,null));};exports[_0x44d8('0x47')]=function(_0x2c6885,_0x120b7d,_0x4a7f14){var _0x269d89={};var _0xa70f5={};var _0x16ccf0;var _0x3c743e;return db['DeskAccount'][_0x44d8('0x48')]({'where':{'id':_0x2c6885['params']['id']}})[_0x44d8('0x24')](handleEntityNotFound(_0x120b7d,null))['then'](function(_0x50d39c){if(_0x50d39c){_0x16ccf0=_0x50d39c;_0xa70f5['model']=_[_0x44d8('0x30')](db[_0x44d8('0x49')][_0x44d8('0x2a')]);_0xa70f5['query']=_[_0x44d8('0x30')](_0x2c6885['query']);_0xa70f5[_0x44d8('0x31')]=_[_0x44d8('0x32')](_0xa70f5[_0x44d8('0x2e')],_0xa70f5['query']);_0x269d89[_0x44d8('0x33')]=_[_0x44d8('0x32')](_0xa70f5[_0x44d8('0x2e')],qs[_0x44d8('0x34')](_0x2c6885[_0x44d8('0x2f')][_0x44d8('0x34')]));_0x269d89[_0x44d8('0x33')]=_0x269d89[_0x44d8('0x33')][_0x44d8('0x35')]?_0x269d89['attributes']:_0xa70f5['model'];_0x269d89['order']=qs[_0x44d8('0x38')](_0x2c6885[_0x44d8('0x2f')][_0x44d8('0x38')]);_0x269d89[_0x44d8('0x3b')]=qs[_0x44d8('0x31')](_['pick'](_0x2c6885[_0x44d8('0x2f')],_0xa70f5[_0x44d8('0x31')]));if(_0x2c6885[_0x44d8('0x2f')]['filter']){_0x269d89[_0x44d8('0x3b')]=_[_0x44d8('0x3c')](_0x269d89[_0x44d8('0x3b')],{'$or':_[_0x44d8('0x29')](_0x269d89[_0x44d8('0x33')],function(_0x831552){var _0x472a71={};_0x472a71[_0x831552]={'$like':'%'+_0x2c6885[_0x44d8('0x2f')][_0x44d8('0x3a')]+'%'};return _0x472a71;})});}_0x269d89=_[_0x44d8('0x3c')]({},_0x269d89,_0x2c6885[_0x44d8('0x3e')]);return _0x16ccf0[_0x44d8('0x47')](_0x269d89);}})[_0x44d8('0x24')](function(_0x3771b6){if(_0x3771b6){_0x3c743e=_0x3771b6[_0x44d8('0x35')];if(!_0x2c6885['query']['hasOwnProperty'](_0x44d8('0x4a'))){_0x269d89[_0x44d8('0x1f')]=qs[_0x44d8('0x1f')](_0x2c6885[_0x44d8('0x2f')][_0x44d8('0x1f')]);_0x269d89[_0x44d8('0x1d')]=qs[_0x44d8('0x1d')](_0x2c6885[_0x44d8('0x2f')][_0x44d8('0x1d')]);}return _0x16ccf0[_0x44d8('0x47')](_0x269d89);}})[_0x44d8('0x24')](function(_0x1ae667){if(_0x1ae667){return _0x1ae667?{'count':_0x3c743e,'rows':_0x1ae667}:null;}})['then'](respondWithResult(_0x120b7d,null))[_0x44d8('0x42')](handleError(_0x120b7d,null));};exports[_0x44d8('0x4b')]=function(_0x1fbb88,_0xa2233c,_0x157192){if(_0x1fbb88['body']['id']){delete _0x1fbb88['body']['id'];}return db[_0x44d8('0x3f')][_0x44d8('0x48')]({'where':{'id':_0x1fbb88[_0x44d8('0x4c')]['id']}})[_0x44d8('0x24')](handleEntityNotFound(_0xa2233c,null))[_0x44d8('0x24')](function(_0xad21a){if(_0xad21a){_0x1fbb88['body'][_0x44d8('0x4d')]=_0xad21a['id'];_0x1fbb88[_0x44d8('0x46')][_0x44d8('0x4e')]=integrations[_0x44d8('0x4f')](_0x1fbb88[_0x44d8('0x46')][_0x44d8('0x50')],_0x1fbb88['body'][_0x44d8('0x2c')]);_0x1fbb88[_0x44d8('0x46')][_0x44d8('0x51')]=integrations['getDescriptions'](_0x1fbb88[_0x44d8('0x46')]['channel'],_0x1fbb88[_0x44d8('0x46')][_0x44d8('0x2c')]);return db[_0x44d8('0x49')][_0x44d8('0x45')](_0x1fbb88[_0x44d8('0x46')],{'include':[{'model':db[_0x44d8('0x52')],'as':_0x44d8('0x4e')},{'model':db['DeskField'],'as':_0x44d8('0x51')}]});}return null;})[_0x44d8('0x24')](respondWithResult(_0xa2233c,null))['catch'](handleError(_0xa2233c,null));};exports[_0x44d8('0x53')]=function(_0x520c2d,_0x4af667,_0x276a4f){var _0x274ec5=[{'name':_0x44d8('0x54'),'label':'priority','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 _0x31ecff='';return db['DeskAccount']['findOne']({'where':{'id':_0x520c2d[_0x44d8('0x4c')]['id']},'attributes':['id',_0x44d8('0x55'),_0x44d8('0x56'),_0x44d8('0x57'),_0x44d8('0x58'),_0x44d8('0x59'),_0x44d8('0x5a'),'token','tokenSecret']})['then'](handleEntityNotFound(_0x4af667,null))['then'](function(_0x302d9c){if(_0x302d9c){_0x31ecff=_0x302d9c[_0x44d8('0x55')];var _0x19cda3=_0x31ecff[_0x44d8('0x5b')](-0x1);if(_0x19cda3==='/'){_0x31ecff=_0x31ecff[_0x44d8('0x5c')](0x0,_0x31ecff[_0x44d8('0x5d')](_0x19cda3));}var _0x3ea675={'method':_0x44d8('0x5e'),'uri':util[_0x44d8('0x5f')](_0x44d8('0x60'),_0x31ecff),'headers':{'Content-Type':'application/json','Accept':_0x44d8('0x61')},'json':!![]};if(_0x302d9c['authType']==='basic'){_0x3ea675[_0x44d8('0x62')][_0x44d8('0x63')]=util[_0x44d8('0x5f')](_0x44d8('0x64'),new Buffer(util[_0x44d8('0x5f')](_0x44d8('0x65'),_0x302d9c['username'],_0x302d9c['password']))['toString'](_0x44d8('0x66')));}return rp(_0x3ea675)[_0x44d8('0x24')](function(_0x4bd0d5){return _0x274ec5[_0x44d8('0x67')](_['map'](_0x4bd0d5[_0x44d8('0x68')]['entries'],function(_0x54d52d){return{'id':_0x54d52d[_0x44d8('0x27')],'name':_0x54d52d[_0x44d8('0x27')],'type':_0x54d52d[_0x44d8('0x2c')],'active':_0x54d52d[_0x44d8('0x69')],'label':_0x54d52d[_0x44d8('0x6a')],'custom':!![]};}));});}})[_0x44d8('0x24')](function(_0x52f1f2){return{'count':_0x52f1f2[_0x44d8('0x35')],'rows':_0x52f1f2};})[_0x44d8('0x24')](respondWithResult(_0x4af667,null))['catch'](function(_0x43999a){var _0x3520e4=_0x520c2d[_0x44d8('0x2f')][_0x44d8('0x6b')]?0x1f4:_0x43999a[_0x44d8('0x6c')]||0x1f4;logger[_0x44d8('0x6d')](_0x44d8('0x6e'),_0x44d8('0x53'),_0x3520e4,JSON[_0x44d8('0x6f')](_0x43999a));delete _0x43999a[_0x44d8('0x27')];if(_0x3520e4===0x191){_0x3520e4=0x190;}_0x4af667[_0x44d8('0x1b')](_0x3520e4)[_0x44d8('0x28')](_0x520c2d['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x43999a[_0x44d8('0x6c')]}:_0x43999a);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index ab1c992..85bf023 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 _0x1487=['request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','util','../../config/logger','bluebird'];(function(_0x187399,_0x40c56d){var _0x40fa92=function(_0x36058c){while(--_0x36058c){_0x187399['push'](_0x187399['shift']());}};_0x40fa92(++_0x40c56d);}(_0x1487,0x65));var _0x7148=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0x1487[_0x420d8d];return _0x4865d7;};'use strict';var _=require('lodash');var util=require(_0x7148('0x0'));var logger=require(_0x7148('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7148('0x2'));var rp=require(_0x7148('0x3'));var fs=require('fs');var path=require(_0x7148('0x4'));var rimraf=require(_0x7148('0x5'));var config=require(_0x7148('0x6'));var attributes=require(_0x7148('0x7'));var integrations=require(_0x7148('0x8'));module[_0x7148('0x9')]=function(_0x2b33f0,_0x4c1cb9){return _0x2b33f0[_0x7148('0xa')](_0x7148('0xb'),attributes,{'tableName':_0x7148('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc69=['moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','util','../../config/logger','api'];(function(_0x54f52f,_0x531ad2){var _0x2620d6=function(_0xbb6cca){while(--_0xbb6cca){_0x54f52f['push'](_0x54f52f['shift']());}};_0x2620d6(++_0x531ad2);}(_0xdc69,0x171));var _0x9dc6=function(_0x2b49bc,_0x47b636){_0x2b49bc=_0x2b49bc-0x0;var _0x43cc65=_0xdc69[_0x2b49bc];return _0x43cc65;};'use strict';var _=require('lodash');var util=require(_0x9dc6('0x0'));var logger=require(_0x9dc6('0x1'))(_0x9dc6('0x2'));var moment=require(_0x9dc6('0x3'));var BPromise=require(_0x9dc6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9dc6('0x5'));var rimraf=require(_0x9dc6('0x6'));var config=require(_0x9dc6('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x9dc6('0x8'));module['exports']=function(_0x4d3671,_0x110e9d){return _0x4d3671[_0x9dc6('0x9')](_0x9dc6('0xa'),attributes,{'tableName':_0x9dc6('0xb'),'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 1bef0f8..7c0da1f 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 _0xa09c=['client','then','info','DeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','find','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x5d8084,_0x1947e9){var _0x4c0147=function(_0x20c7f0){while(--_0x20c7f0){_0x5d8084['push'](_0x5d8084['shift']());}};_0x4c0147(++_0x1947e9);}(_0xa09c,0x1c6));var _0xca09=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xa09c[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xca09('0x0'));var BPromise=require(_0xca09('0x1'));var rs=require(_0xca09('0x2'));var fs=require('fs');var Redis=require(_0xca09('0x3'));var db=require(_0xca09('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xca09('0x5'))(_0xca09('0x6'));var config=require('../../config/environment');var jayson=require(_0xca09('0x7'));var client=jayson[_0xca09('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3981f1,_0x5161c2,_0x2369ec){return new BPromise(function(_0x39be37,_0x3f8e73){return client['request'](_0x3981f1,_0x2369ec)[_0xca09('0x9')](function(_0x543c24){logger[_0xca09('0xa')](_0xca09('0xb'),_0x5161c2,'request\x20sent');logger[_0xca09('0xc')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5161c2,_0xca09('0xd'),JSON[_0xca09('0xe')](_0x543c24));if(_0x543c24['error']){if(_0x543c24[_0xca09('0xf')][_0xca09('0x10')]===0x1f4){logger[_0xca09('0xf')](_0xca09('0xb'),_0x5161c2,_0x543c24[_0xca09('0xf')][_0xca09('0x11')]);return _0x3f8e73(_0x543c24['error']['message']);}logger['error'](_0xca09('0xb'),_0x5161c2,_0x543c24[_0xca09('0xf')]['message']);return _0x39be37(_0x543c24[_0xca09('0xf')][_0xca09('0x11')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x5161c2,_0xca09('0xd'));_0x39be37(_0x543c24[_0xca09('0x12')][_0xca09('0x11')]);}})[_0xca09('0x13')](function(_0x5691ce){logger[_0xca09('0xf')](_0xca09('0xb'),_0x5161c2,_0x5691ce);_0x3f8e73(_0x5691ce);});});}exports['GetDeskAccount']=function(_0x6edc35){var _0x366c66=this;return new Promise(function(_0x524f6f,_0x43d126){return db[_0xca09('0x14')][_0xca09('0x15')]({'raw':_0x6edc35[_0xca09('0x16')]?_0x6edc35[_0xca09('0x16')][_0xca09('0x17')]===undefined?!![]:![]:!![],'where':_0x6edc35[_0xca09('0x16')]?_0x6edc35[_0xca09('0x16')]['where']||null:null,'attributes':_0x6edc35[_0xca09('0x16')]?_0x6edc35[_0xca09('0x16')][_0xca09('0x18')]||null:null,'limit':_0x6edc35[_0xca09('0x16')]?_0x6edc35['options'][_0xca09('0x19')]||null:null,'include':_0x6edc35[_0xca09('0x16')]?_0x6edc35[_0xca09('0x16')][_0xca09('0x1a')]?_[_0xca09('0x1b')](_0x6edc35[_0xca09('0x16')][_0xca09('0x1a')],function(_0x5920f3){return{'model':db[_0x5920f3[_0xca09('0x1c')]],'as':_0x5920f3['as'],'attributes':_0x5920f3[_0xca09('0x18')],'include':_0x5920f3[_0xca09('0x1a')]?_[_0xca09('0x1b')](_0x5920f3['include'],function(_0x5cf8a9){return{'model':db[_0x5cf8a9[_0xca09('0x1c')]],'as':_0x5cf8a9['as'],'attributes':_0x5cf8a9[_0xca09('0x18')],'include':_0x5cf8a9[_0xca09('0x1a')]?_[_0xca09('0x1b')](_0x5cf8a9[_0xca09('0x1a')],function(_0x458751){return{'model':db[_0x458751[_0xca09('0x1c')]],'as':_0x458751['as'],'attributes':_0x458751[_0xca09('0x18')]};}):[]};}):[]};}):[]:[]})[_0xca09('0x9')](function(_0x5454ac){logger['info']('GetDeskAccount',_0x6edc35);logger['debug'](_0xca09('0x1d'),_0x6edc35,JSON[_0xca09('0xe')](_0x5454ac));_0x524f6f(_0x5454ac);})[_0xca09('0x13')](function(_0xe446f5){logger['error']('GetDeskAccount',_0xe446f5[_0xca09('0x11')],_0x6edc35);_0x43d126(_0x366c66[_0xca09('0xf')](0x1f4,_0xe446f5[_0xca09('0x11')]));});});};exports[_0xca09('0x1e')]=function(_0xf81635){var _0x19e496=this;return new Promise(function(_0x1140e5,_0x51aceb){return db[_0xca09('0x14')][_0xca09('0x1f')]({'raw':_0xf81635['options']?_0xf81635[_0xca09('0x16')][_0xca09('0x17')]===undefined?!![]:![]:!![],'where':_0xf81635[_0xca09('0x16')]?_0xf81635[_0xca09('0x16')][_0xca09('0x20')]||null:null,'attributes':_0xf81635['options']?_0xf81635['options'][_0xca09('0x18')]||null:null,'include':_0xf81635['options']?_0xf81635[_0xca09('0x16')]['include']?_['map'](_0xf81635[_0xca09('0x16')][_0xca09('0x1a')],function(_0x117a5e){return{'model':db[_0x117a5e[_0xca09('0x1c')]],'as':_0x117a5e['as'],'attributes':_0x117a5e['attributes'],'include':_0x117a5e[_0xca09('0x1a')]?_[_0xca09('0x1b')](_0x117a5e[_0xca09('0x1a')],function(_0x243cee){return{'model':db[_0x243cee[_0xca09('0x1c')]],'as':_0x243cee['as'],'attributes':_0x243cee[_0xca09('0x18')],'include':_0x243cee[_0xca09('0x1a')]?_[_0xca09('0x1b')](_0x243cee[_0xca09('0x1a')],function(_0x2aa8d3){return{'model':db[_0x2aa8d3[_0xca09('0x1c')]],'as':_0x2aa8d3['as'],'attributes':_0x2aa8d3[_0xca09('0x18')]};}):[]};}):[]};}):[]:[]})[_0xca09('0x9')](function(_0xd93b9f){logger[_0xca09('0xa')](_0xca09('0x1e'),_0xf81635);logger[_0xca09('0xc')]('ShowDeskAccount',_0xf81635,JSON[_0xca09('0xe')](_0xd93b9f));_0x1140e5(_0xd93b9f);})['catch'](function(_0x25e64b){logger[_0xca09('0xf')](_0xca09('0x1e'),_0x25e64b[_0xca09('0x11')],_0xf81635);_0x51aceb(_0x19e496[_0xca09('0xf')](0x1f4,_0x25e64b[_0xca09('0x11')]));});});}; \ No newline at end of file +var _0x6733=['request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowDeskAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3abd82,_0x16a38f){var _0x3e6ad0=function(_0x43bc6f){while(--_0x43bc6f){_0x3abd82['push'](_0x3abd82['shift']());}};_0x3e6ad0(++_0x16a38f);}(_0x6733,0x89));var _0x3673=function(_0x10c7db,_0x2f8f67){_0x10c7db=_0x10c7db-0x0;var _0xacfd9=_0x6733[_0x10c7db];return _0xacfd9;};'use strict';var _=require(_0x3673('0x0'));var util=require('util');var moment=require(_0x3673('0x1'));var BPromise=require(_0x3673('0x2'));var rs=require(_0x3673('0x3'));var fs=require('fs');var Redis=require(_0x3673('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3673('0x5'))(_0x3673('0x6'));var config=require(_0x3673('0x7'));var jayson=require(_0x3673('0x8'));var client=jayson[_0x3673('0x9')][_0x3673('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x331c7b,_0x4928a4,_0x4128ea){return new BPromise(function(_0x59e977,_0x38996a){return client[_0x3673('0xb')](_0x331c7b,_0x4128ea)[_0x3673('0xc')](function(_0x2e7daf){logger['info'](_0x3673('0xd'),_0x4928a4,_0x3673('0xe'));logger[_0x3673('0xf')](_0x3673('0x10'),_0x4928a4,'request\x20sent',JSON['stringify'](_0x2e7daf));if(_0x2e7daf[_0x3673('0x11')]){if(_0x2e7daf[_0x3673('0x11')][_0x3673('0x12')]===0x1f4){logger[_0x3673('0x11')](_0x3673('0xd'),_0x4928a4,_0x2e7daf[_0x3673('0x11')]['message']);return _0x38996a(_0x2e7daf[_0x3673('0x11')][_0x3673('0x13')]);}logger[_0x3673('0x11')](_0x3673('0xd'),_0x4928a4,_0x2e7daf[_0x3673('0x11')][_0x3673('0x13')]);return _0x59e977(_0x2e7daf[_0x3673('0x11')][_0x3673('0x13')]);}else{logger[_0x3673('0x14')](_0x3673('0xd'),_0x4928a4,_0x3673('0xe'));_0x59e977(_0x2e7daf[_0x3673('0x15')][_0x3673('0x13')]);}})[_0x3673('0x16')](function(_0x588b13){logger[_0x3673('0x11')]('DeskAccount,\x20%s,\x20%s',_0x4928a4,_0x588b13);_0x38996a(_0x588b13);});});}exports[_0x3673('0x17')]=function(_0x533571){var _0x3dce46=this;return new Promise(function(_0x4ee1b0,_0x2cba17){return db[_0x3673('0x18')][_0x3673('0x19')]({'raw':_0x533571[_0x3673('0x1a')]?_0x533571[_0x3673('0x1a')][_0x3673('0x1b')]===undefined?!![]:![]:!![],'where':_0x533571[_0x3673('0x1a')]?_0x533571[_0x3673('0x1a')][_0x3673('0x1c')]||null:null,'attributes':_0x533571[_0x3673('0x1a')]?_0x533571[_0x3673('0x1a')]['attributes']||null:null,'limit':_0x533571[_0x3673('0x1a')]?_0x533571[_0x3673('0x1a')][_0x3673('0x1d')]||null:null,'include':_0x533571[_0x3673('0x1a')]?_0x533571[_0x3673('0x1a')][_0x3673('0x1e')]?_[_0x3673('0x1f')](_0x533571[_0x3673('0x1a')]['include'],function(_0x4d35ae){return{'model':db[_0x4d35ae[_0x3673('0x20')]],'as':_0x4d35ae['as'],'attributes':_0x4d35ae[_0x3673('0x21')],'include':_0x4d35ae[_0x3673('0x1e')]?_[_0x3673('0x1f')](_0x4d35ae['include'],function(_0x2f2c9f){return{'model':db[_0x2f2c9f['model']],'as':_0x2f2c9f['as'],'attributes':_0x2f2c9f['attributes'],'include':_0x2f2c9f[_0x3673('0x1e')]?_[_0x3673('0x1f')](_0x2f2c9f[_0x3673('0x1e')],function(_0x3d44f9){return{'model':db[_0x3d44f9[_0x3673('0x20')]],'as':_0x3d44f9['as'],'attributes':_0x3d44f9[_0x3673('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fb1c1){logger[_0x3673('0x14')](_0x3673('0x17'),_0x533571);logger[_0x3673('0xf')](_0x3673('0x17'),_0x533571,JSON[_0x3673('0x22')](_0x3fb1c1));_0x4ee1b0(_0x3fb1c1);})[_0x3673('0x16')](function(_0x2db223){logger[_0x3673('0x11')](_0x3673('0x17'),_0x2db223[_0x3673('0x13')],_0x533571);_0x2cba17(_0x3dce46[_0x3673('0x11')](0x1f4,_0x2db223['message']));});});};exports[_0x3673('0x23')]=function(_0x8200d5){var _0x46770e=this;return new Promise(function(_0x4fae14,_0x16e5e5){return db[_0x3673('0x18')][_0x3673('0x24')]({'raw':_0x8200d5[_0x3673('0x1a')]?_0x8200d5[_0x3673('0x1a')][_0x3673('0x1b')]===undefined?!![]:![]:!![],'where':_0x8200d5[_0x3673('0x1a')]?_0x8200d5[_0x3673('0x1a')][_0x3673('0x1c')]||null:null,'attributes':_0x8200d5[_0x3673('0x1a')]?_0x8200d5['options'][_0x3673('0x21')]||null:null,'include':_0x8200d5[_0x3673('0x1a')]?_0x8200d5['options'][_0x3673('0x1e')]?_[_0x3673('0x1f')](_0x8200d5[_0x3673('0x1a')][_0x3673('0x1e')],function(_0x29a539){return{'model':db[_0x29a539[_0x3673('0x20')]],'as':_0x29a539['as'],'attributes':_0x29a539[_0x3673('0x21')],'include':_0x29a539[_0x3673('0x1e')]?_[_0x3673('0x1f')](_0x29a539['include'],function(_0x4122d6){return{'model':db[_0x4122d6[_0x3673('0x20')]],'as':_0x4122d6['as'],'attributes':_0x4122d6[_0x3673('0x21')],'include':_0x4122d6['include']?_[_0x3673('0x1f')](_0x4122d6[_0x3673('0x1e')],function(_0x66bf53){return{'model':db[_0x66bf53['model']],'as':_0x66bf53['as'],'attributes':_0x66bf53[_0x3673('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3673('0xc')](function(_0x17b660){logger['info'](_0x3673('0x23'),_0x8200d5);logger[_0x3673('0xf')](_0x3673('0x23'),_0x8200d5,JSON['stringify'](_0x17b660));_0x4fae14(_0x17b660);})[_0x3673('0x16')](function(_0x204b77){logger[_0x3673('0x11')](_0x3673('0x23'),_0x204b77[_0x3673('0x13')],_0x8200d5);_0x16e5e5(_0x46770e[_0x3673('0x11')](0x1f4,_0x204b77[_0x3673('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index ca66fa5..6eac3ca 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 _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x4a94b1,_0x4f2518){var _0x20949f=function(_0x1c4aa6){while(--_0x1c4aa6){_0x4a94b1['push'](_0x4a94b1['shift']());}};_0x20949f(++_0x4f2518);}(_0x55ca,0x126));var _0xa55c=function(_0x4d73b1,_0x91ab71){_0x4d73b1=_0x4d73b1-0x0;var _0xe394f9=_0x55ca[_0x4d73b1];return _0xe394f9;};'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')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);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['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x4630ff,_0x14e528){var _0x3e359b=function(_0x5a8b88){while(--_0x5a8b88){_0x4630ff['push'](_0x4630ff['shift']());}};_0x3e359b(++_0x14e528);}(_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('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 13dac9a..afe0b66 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 _0x470b=['exports','sequelize'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x470b,0x127));var _0xb470=function(_0x4f4475,_0x44e7bd){_0x4f4475=_0x4f4475-0x0;var _0x347e46=_0x470b[_0x4f4475];return _0x347e46;};'use strict';var Sequelize=require(_0xb470('0x0'));module[_0xb470('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaebd=['sequelize','exports','STRING'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0xaebd,0x108));var _0xdaeb=function(_0x37656f,_0x350ac6){_0x37656f=_0x37656f-0x0;var _0x5cd9d8=_0xaebd[_0x37656f];return _0x5cd9d8;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module[_0xdaeb('0x1')]={'name':{'type':Sequelize[_0xdaeb('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 5bba616..f2e544d 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 _0xbce5=['show','params','options','find','catch','create','body','getFields','findOne','DeskField','pick','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','DeskConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','count','includeAll','include','findAll','rows'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0xbce5,0x110));var _0x5bce=function(_0x46884f,_0x2b5c5a){_0x46884f=_0x46884f-0x0;var _0x78c6c0=_0xbce5[_0x46884f];return _0x78c6c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5bce('0x0'));var zipdir=require(_0x5bce('0x1'));var jsonpatch=require(_0x5bce('0x2'));var rp=require(_0x5bce('0x3'));var moment=require(_0x5bce('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5bce('0x5'));var util=require(_0x5bce('0x6'));var path=require(_0x5bce('0x7'));var sox=require(_0x5bce('0x8'));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(_0x5bce('0x9'));var crypto=require(_0x5bce('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5bce('0xb'));var toCsv=require(_0x5bce('0xc'));var querystring=require(_0x5bce('0xd'));var Papa=require(_0x5bce('0xe'));var Redis=require(_0x5bce('0xf'));var authService=require(_0x5bce('0x10'));var qs=require(_0x5bce('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bce('0x12'));var logger=require(_0x5bce('0x13'))(_0x5bce('0x14'));var utils=require(_0x5bce('0x15'));var config=require(_0x5bce('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bce('0x17'))['db'];function respondWithStatusCode(_0x221128,_0x3240d2){_0x3240d2=_0x3240d2||0xcc;return function(_0x986477){if(_0x986477){return _0x221128[_0x5bce('0x18')](_0x3240d2);}return _0x221128[_0x5bce('0x19')](_0x3240d2)[_0x5bce('0x1a')]();};}function respondWithResult(_0x365e5d,_0x410ebf){_0x410ebf=_0x410ebf||0xc8;return function(_0x4f9590){if(_0x4f9590){return _0x365e5d[_0x5bce('0x19')](_0x410ebf)[_0x5bce('0x1b')](_0x4f9590);}};}function respondWithFilteredResult(_0x52ebd5,_0x385cf8){return function(_0x360f4d){if(_0x360f4d){var _0x4b7ba9=typeof _0x385cf8['offset']==='undefined'&&typeof _0x385cf8[_0x5bce('0x1c')]===_0x5bce('0x1d');var _0x219b89=_0x360f4d['count'];var _0x32180f=_0x4b7ba9?0x0:_0x385cf8[_0x5bce('0x1e')];var _0x117641=_0x4b7ba9?_0x360f4d['count']:_0x385cf8[_0x5bce('0x1e')]+_0x385cf8[_0x5bce('0x1c')];var _0x55c07f;if(_0x117641>=_0x219b89){_0x117641=_0x219b89;_0x55c07f=0xc8;}else{_0x55c07f=0xce;}_0x52ebd5['status'](_0x55c07f);return _0x52ebd5[_0x5bce('0x1f')](_0x5bce('0x20'),_0x32180f+'-'+_0x117641+'/'+_0x219b89)[_0x5bce('0x1b')](_0x360f4d);}return null;};}function patchUpdates(_0x4d9f82){return function(_0x106eaa){try{jsonpatch[_0x5bce('0x21')](_0x106eaa,_0x4d9f82,!![]);}catch(_0x41765d){return BPromise[_0x5bce('0x22')](_0x41765d);}return _0x106eaa['save']();};}function saveUpdates(_0x2153c4,_0x1ac2e5){return function(_0x142454){if(_0x142454){return _0x142454[_0x5bce('0x23')](_0x2153c4)[_0x5bce('0x24')](function(_0x112d68){return _0x112d68;});}return null;};}function removeEntity(_0x9ae223,_0x54fd8a){return function(_0x4e8c02){if(_0x4e8c02){return _0x4e8c02[_0x5bce('0x25')]()['then'](function(){_0x9ae223[_0x5bce('0x19')](0xcc)[_0x5bce('0x1a')]();});}};}function handleEntityNotFound(_0x1c00ac,_0x2905b1){return function(_0x518f0c){if(!_0x518f0c){_0x1c00ac[_0x5bce('0x18')](0x194);}return _0x518f0c;};}function handleError(_0x229101,_0x231741){_0x231741=_0x231741||0x1f4;return function(_0x44fee2){logger[_0x5bce('0x26')](_0x44fee2[_0x5bce('0x27')]);if(_0x44fee2[_0x5bce('0x28')]){delete _0x44fee2[_0x5bce('0x28')];}_0x229101['status'](_0x231741)['send'](_0x44fee2);};}exports[_0x5bce('0x29')]=function(_0x1b12ed,_0x319143){var _0x4e4038={},_0x414773={},_0x19d332={'count':0x0,'rows':[]};var _0x50558d=_['map'](db[_0x5bce('0x2a')][_0x5bce('0x2b')],function(_0x340884){return{'name':_0x340884[_0x5bce('0x2c')],'type':_0x340884[_0x5bce('0x2d')]['key']};});_0x414773[_0x5bce('0x2e')]=_['map'](_0x50558d,_0x5bce('0x28'));_0x414773[_0x5bce('0x2f')]=_[_0x5bce('0x30')](_0x1b12ed[_0x5bce('0x2f')]);_0x414773['filters']=_[_0x5bce('0x31')](_0x414773[_0x5bce('0x2e')],_0x414773[_0x5bce('0x2f')]);_0x4e4038[_0x5bce('0x32')]=_[_0x5bce('0x31')](_0x414773[_0x5bce('0x2e')],qs['fields'](_0x1b12ed[_0x5bce('0x2f')][_0x5bce('0x33')]));_0x4e4038[_0x5bce('0x32')]=_0x4e4038[_0x5bce('0x32')][_0x5bce('0x34')]?_0x4e4038['attributes']:_0x414773[_0x5bce('0x2e')];if(!_0x1b12ed[_0x5bce('0x2f')][_0x5bce('0x35')](_0x5bce('0x36'))){_0x4e4038[_0x5bce('0x1c')]=qs[_0x5bce('0x1c')](_0x1b12ed['query'][_0x5bce('0x1c')]);_0x4e4038[_0x5bce('0x1e')]=qs['offset'](_0x1b12ed['query'][_0x5bce('0x1e')]);}_0x4e4038[_0x5bce('0x37')]=qs['sort'](_0x1b12ed['query'][_0x5bce('0x38')]);_0x4e4038[_0x5bce('0x39')]=qs['filters'](_['pick'](_0x1b12ed['query'],_0x414773[_0x5bce('0x3a')]),_0x50558d);if(_0x1b12ed[_0x5bce('0x2f')][_0x5bce('0x3b')]){_0x4e4038[_0x5bce('0x39')]=_[_0x5bce('0x3c')](_0x4e4038[_0x5bce('0x39')],{'$or':_[_0x5bce('0x3d')](_0x50558d,function(_0x2fbfe0){if(_0x2fbfe0[_0x5bce('0x2d')]!==_0x5bce('0x3e')){var _0x2fdbc6={};_0x2fdbc6[_0x2fbfe0[_0x5bce('0x28')]]={'$like':'%'+_0x1b12ed['query'][_0x5bce('0x3b')]+'%'};return _0x2fdbc6;}})});}_0x4e4038=_[_0x5bce('0x3c')]({},_0x4e4038,_0x1b12ed['options']);var _0x2f42b4={'where':_0x4e4038[_0x5bce('0x39')]};return db[_0x5bce('0x2a')]['count'](_0x2f42b4)[_0x5bce('0x24')](function(_0x2366af){_0x19d332[_0x5bce('0x3f')]=_0x2366af;if(_0x1b12ed[_0x5bce('0x2f')][_0x5bce('0x40')]){_0x4e4038[_0x5bce('0x41')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x5bce('0x42')](_0x4e4038);})[_0x5bce('0x24')](function(_0x58a899){_0x19d332[_0x5bce('0x43')]=_0x58a899;return _0x19d332;})[_0x5bce('0x24')](respondWithFilteredResult(_0x319143,_0x4e4038))['catch'](handleError(_0x319143,null));};exports[_0x5bce('0x44')]=function(_0x22e19d,_0x4e4bdf){var _0x29666d={'raw':![],'where':{'id':_0x22e19d[_0x5bce('0x45')]['id']}},_0x3f4970={};_0x3f4970[_0x5bce('0x2e')]=_['keys'](db[_0x5bce('0x2a')][_0x5bce('0x2b')]);_0x3f4970[_0x5bce('0x2f')]=_[_0x5bce('0x30')](_0x22e19d[_0x5bce('0x2f')]);_0x3f4970['filters']=_[_0x5bce('0x31')](_0x3f4970[_0x5bce('0x2e')],_0x3f4970[_0x5bce('0x2f')]);_0x29666d[_0x5bce('0x32')]=_['intersection'](_0x3f4970[_0x5bce('0x2e')],qs[_0x5bce('0x33')](_0x22e19d[_0x5bce('0x2f')][_0x5bce('0x33')]));_0x29666d[_0x5bce('0x32')]=_0x29666d[_0x5bce('0x32')][_0x5bce('0x34')]?_0x29666d['attributes']:_0x3f4970[_0x5bce('0x2e')];if(_0x22e19d['query'][_0x5bce('0x40')]){_0x29666d[_0x5bce('0x41')]=[{'all':!![]}];}_0x29666d=_[_0x5bce('0x3c')]({},_0x29666d,_0x22e19d[_0x5bce('0x46')]);return db[_0x5bce('0x2a')][_0x5bce('0x47')](_0x29666d)[_0x5bce('0x24')](handleEntityNotFound(_0x4e4bdf,null))[_0x5bce('0x24')](respondWithResult(_0x4e4bdf,null))[_0x5bce('0x48')](handleError(_0x4e4bdf,null));};exports[_0x5bce('0x49')]=function(_0x191ac8,_0x57fa3b){return db['DeskConfiguration']['create'](_0x191ac8[_0x5bce('0x4a')],{})[_0x5bce('0x24')](respondWithResult(_0x57fa3b,0xc9))['catch'](handleError(_0x57fa3b,null));};exports[_0x5bce('0x23')]=function(_0x9a5d7a,_0x46a865){if(_0x9a5d7a['body']['id']){delete _0x9a5d7a[_0x5bce('0x4a')]['id'];}return db['DeskConfiguration'][_0x5bce('0x47')]({'where':{'id':_0x9a5d7a[_0x5bce('0x45')]['id']}})['then'](handleEntityNotFound(_0x46a865,null))['then'](saveUpdates(_0x9a5d7a[_0x5bce('0x4a')],null))[_0x5bce('0x24')](respondWithResult(_0x46a865,null))[_0x5bce('0x48')](handleError(_0x46a865,null));};exports['destroy']=function(_0x1228f5,_0x3741bf){return db['DeskConfiguration']['find']({'where':{'id':_0x1228f5['params']['id']}})[_0x5bce('0x24')](handleEntityNotFound(_0x3741bf,null))[_0x5bce('0x24')](removeEntity(_0x3741bf,null))[_0x5bce('0x48')](handleError(_0x3741bf,null));};exports[_0x5bce('0x4b')]=function(_0x4815b7,_0x310664,_0x17e563){var _0x2609eb={};var _0x129630={};var _0x3edfb9;var _0x26a5b9;return db[_0x5bce('0x2a')][_0x5bce('0x4c')]({'where':{'id':_0x4815b7[_0x5bce('0x45')]['id']}})[_0x5bce('0x24')](handleEntityNotFound(_0x310664,null))[_0x5bce('0x24')](function(_0x52cf5c){if(_0x52cf5c){_0x3edfb9=_0x52cf5c;_0x129630[_0x5bce('0x2e')]=_[_0x5bce('0x30')](db[_0x5bce('0x4d')][_0x5bce('0x2b')]);_0x129630[_0x5bce('0x2f')]=_[_0x5bce('0x30')](_0x4815b7['query']);_0x129630[_0x5bce('0x3a')]=_[_0x5bce('0x31')](_0x129630['model'],_0x129630['query']);_0x2609eb[_0x5bce('0x32')]=_[_0x5bce('0x31')](_0x129630[_0x5bce('0x2e')],qs[_0x5bce('0x33')](_0x4815b7[_0x5bce('0x2f')][_0x5bce('0x33')]));_0x2609eb['attributes']=_0x2609eb[_0x5bce('0x32')][_0x5bce('0x34')]?_0x2609eb[_0x5bce('0x32')]:_0x129630[_0x5bce('0x2e')];_0x2609eb[_0x5bce('0x37')]=qs[_0x5bce('0x38')](_0x4815b7[_0x5bce('0x2f')][_0x5bce('0x38')]);_0x2609eb[_0x5bce('0x39')]=qs[_0x5bce('0x3a')](_[_0x5bce('0x4e')](_0x4815b7[_0x5bce('0x2f')],_0x129630['filters']));if(_0x4815b7[_0x5bce('0x2f')][_0x5bce('0x3b')]){_0x2609eb[_0x5bce('0x39')]=_[_0x5bce('0x3c')](_0x2609eb['where'],{'$or':_[_0x5bce('0x3d')](_0x2609eb[_0x5bce('0x32')],function(_0x2d5800){var _0x7d5a10={};_0x7d5a10[_0x2d5800]={'$like':'%'+_0x4815b7[_0x5bce('0x2f')][_0x5bce('0x3b')]+'%'};return _0x7d5a10;})});}_0x2609eb=_[_0x5bce('0x3c')]({},_0x2609eb,_0x4815b7[_0x5bce('0x46')]);return _0x3edfb9['getFields'](_0x2609eb);}})['then'](function(_0x55711f){if(_0x55711f){_0x26a5b9=_0x55711f[_0x5bce('0x34')];if(!_0x4815b7[_0x5bce('0x2f')][_0x5bce('0x35')](_0x5bce('0x36'))){_0x2609eb['limit']=qs[_0x5bce('0x1c')](_0x4815b7[_0x5bce('0x2f')][_0x5bce('0x1c')]);_0x2609eb[_0x5bce('0x1e')]=qs[_0x5bce('0x1e')](_0x4815b7[_0x5bce('0x2f')][_0x5bce('0x1e')]);}return _0x3edfb9[_0x5bce('0x4b')](_0x2609eb);}})[_0x5bce('0x24')](function(_0x47642a){if(_0x47642a){return _0x47642a?{'count':_0x26a5b9,'rows':_0x47642a}:null;}})[_0x5bce('0x24')](respondWithResult(_0x310664,null))[_0x5bce('0x48')](handleError(_0x310664,null));};exports[_0x5bce('0x4f')]=function(_0x4019dd,_0x384cf8,_0x49837c){var _0xe3f82a={};var _0x348f11={};var _0x48e4aa;var _0x4c1c95;return db[_0x5bce('0x2a')][_0x5bce('0x4c')]({'where':{'id':_0x4019dd[_0x5bce('0x45')]['id']}})[_0x5bce('0x24')](handleEntityNotFound(_0x384cf8,null))[_0x5bce('0x24')](function(_0x57d36f){if(_0x57d36f){_0x48e4aa=_0x57d36f;_0x348f11[_0x5bce('0x2e')]=_[_0x5bce('0x30')](db[_0x5bce('0x4d')][_0x5bce('0x2b')]);_0x348f11[_0x5bce('0x2f')]=_['keys'](_0x4019dd['query']);_0x348f11[_0x5bce('0x3a')]=_[_0x5bce('0x31')](_0x348f11[_0x5bce('0x2e')],_0x348f11[_0x5bce('0x2f')]);_0xe3f82a[_0x5bce('0x32')]=_[_0x5bce('0x31')](_0x348f11[_0x5bce('0x2e')],qs['fields'](_0x4019dd[_0x5bce('0x2f')][_0x5bce('0x33')]));_0xe3f82a[_0x5bce('0x32')]=_0xe3f82a[_0x5bce('0x32')][_0x5bce('0x34')]?_0xe3f82a[_0x5bce('0x32')]:_0x348f11[_0x5bce('0x2e')];_0xe3f82a[_0x5bce('0x37')]=qs[_0x5bce('0x38')](_0x4019dd[_0x5bce('0x2f')][_0x5bce('0x38')]);_0xe3f82a[_0x5bce('0x39')]=qs[_0x5bce('0x3a')](_['pick'](_0x4019dd[_0x5bce('0x2f')],_0x348f11[_0x5bce('0x3a')]));if(_0x4019dd[_0x5bce('0x2f')]['filter']){_0xe3f82a[_0x5bce('0x39')]=_['merge'](_0xe3f82a[_0x5bce('0x39')],{'$or':_['map'](_0xe3f82a[_0x5bce('0x32')],function(_0x4eab04){var _0x33c7ad={};_0x33c7ad[_0x4eab04]={'$like':'%'+_0x4019dd[_0x5bce('0x2f')][_0x5bce('0x3b')]+'%'};return _0x33c7ad;})});}_0xe3f82a=_['merge']({},_0xe3f82a,_0x4019dd[_0x5bce('0x46')]);return _0x48e4aa[_0x5bce('0x4f')](_0xe3f82a);}})['then'](function(_0x28ceb6){if(_0x28ceb6){_0x4c1c95=_0x28ceb6['length'];if(!_0x4019dd[_0x5bce('0x2f')][_0x5bce('0x35')](_0x5bce('0x36'))){_0xe3f82a[_0x5bce('0x1c')]=qs[_0x5bce('0x1c')](_0x4019dd[_0x5bce('0x2f')]['limit']);_0xe3f82a[_0x5bce('0x1e')]=qs[_0x5bce('0x1e')](_0x4019dd[_0x5bce('0x2f')][_0x5bce('0x1e')]);}return _0x48e4aa[_0x5bce('0x4f')](_0xe3f82a);}})[_0x5bce('0x24')](function(_0x23ec28){if(_0x23ec28){return _0x23ec28?{'count':_0x4c1c95,'rows':_0x23ec28}:null;}})[_0x5bce('0x24')](respondWithResult(_0x384cf8,null))[_0x5bce('0x48')](handleError(_0x384cf8,null));};exports['getDescriptions']=function(_0x64cfb1,_0x13edf9,_0x5ecd49){var _0x23c7c1={};var _0x1d8a5d={};var _0x51a91e;var _0x54e839;return db['DeskConfiguration'][_0x5bce('0x4c')]({'where':{'id':_0x64cfb1[_0x5bce('0x45')]['id']}})[_0x5bce('0x24')](handleEntityNotFound(_0x13edf9,null))[_0x5bce('0x24')](function(_0x390227){if(_0x390227){_0x51a91e=_0x390227;_0x1d8a5d[_0x5bce('0x2e')]=_[_0x5bce('0x30')](db[_0x5bce('0x4d')][_0x5bce('0x2b')]);_0x1d8a5d[_0x5bce('0x2f')]=_['keys'](_0x64cfb1['query']);_0x1d8a5d[_0x5bce('0x3a')]=_['intersection'](_0x1d8a5d[_0x5bce('0x2e')],_0x1d8a5d[_0x5bce('0x2f')]);_0x23c7c1[_0x5bce('0x32')]=_[_0x5bce('0x31')](_0x1d8a5d[_0x5bce('0x2e')],qs[_0x5bce('0x33')](_0x64cfb1[_0x5bce('0x2f')][_0x5bce('0x33')]));_0x23c7c1[_0x5bce('0x32')]=_0x23c7c1[_0x5bce('0x32')][_0x5bce('0x34')]?_0x23c7c1[_0x5bce('0x32')]:_0x1d8a5d['model'];_0x23c7c1[_0x5bce('0x37')]=qs[_0x5bce('0x38')](_0x64cfb1['query']['sort']);_0x23c7c1['where']=qs[_0x5bce('0x3a')](_[_0x5bce('0x4e')](_0x64cfb1[_0x5bce('0x2f')],_0x1d8a5d[_0x5bce('0x3a')]));if(_0x64cfb1['query'][_0x5bce('0x3b')]){_0x23c7c1[_0x5bce('0x39')]=_[_0x5bce('0x3c')](_0x23c7c1[_0x5bce('0x39')],{'$or':_['map'](_0x23c7c1[_0x5bce('0x32')],function(_0x525c19){var _0x5953a1={};_0x5953a1[_0x525c19]={'$like':'%'+_0x64cfb1[_0x5bce('0x2f')][_0x5bce('0x3b')]+'%'};return _0x5953a1;})});}_0x23c7c1=_[_0x5bce('0x3c')]({},_0x23c7c1,_0x64cfb1[_0x5bce('0x46')]);return _0x51a91e[_0x5bce('0x50')](_0x23c7c1);}})[_0x5bce('0x24')](function(_0x1e402b){if(_0x1e402b){_0x54e839=_0x1e402b[_0x5bce('0x34')];if(!_0x64cfb1[_0x5bce('0x2f')][_0x5bce('0x35')](_0x5bce('0x36'))){_0x23c7c1[_0x5bce('0x1c')]=qs['limit'](_0x64cfb1[_0x5bce('0x2f')][_0x5bce('0x1c')]);_0x23c7c1[_0x5bce('0x1e')]=qs[_0x5bce('0x1e')](_0x64cfb1['query'][_0x5bce('0x1e')]);}return _0x51a91e[_0x5bce('0x50')](_0x23c7c1);}})[_0x5bce('0x24')](function(_0x1c7041){if(_0x1c7041){return _0x1c7041?{'count':_0x54e839,'rows':_0x1c7041}:null;}})['then'](respondWithResult(_0x13edf9,null))[_0x5bce('0x48')](handleError(_0x13edf9,null));};exports['getTags']=function(_0x403469,_0x462da2,_0x5018c5){var _0x478600={};var _0x462210={};var _0x5df1df;var _0x1e1ef7;return db[_0x5bce('0x2a')][_0x5bce('0x4c')]({'where':{'id':_0x403469[_0x5bce('0x45')]['id']}})[_0x5bce('0x24')](handleEntityNotFound(_0x462da2,null))[_0x5bce('0x24')](function(_0x565487){if(_0x565487){_0x5df1df=_0x565487;_0x462210[_0x5bce('0x2e')]=_['keys'](db[_0x5bce('0x51')][_0x5bce('0x2b')]);_0x462210[_0x5bce('0x2f')]=_[_0x5bce('0x30')](_0x403469[_0x5bce('0x2f')]);_0x462210[_0x5bce('0x3a')]=_[_0x5bce('0x31')](_0x462210['model'],_0x462210[_0x5bce('0x2f')]);_0x478600[_0x5bce('0x32')]=_['intersection'](_0x462210[_0x5bce('0x2e')],qs[_0x5bce('0x33')](_0x403469[_0x5bce('0x2f')][_0x5bce('0x33')]));_0x478600['attributes']=_0x478600['attributes'][_0x5bce('0x34')]?_0x478600[_0x5bce('0x32')]:_0x462210[_0x5bce('0x2e')];_0x478600[_0x5bce('0x37')]=qs['sort'](_0x403469[_0x5bce('0x2f')][_0x5bce('0x38')]);_0x478600[_0x5bce('0x39')]=qs['filters'](_[_0x5bce('0x4e')](_0x403469['query'],_0x462210[_0x5bce('0x3a')]));if(_0x403469['query']['filter']){_0x478600[_0x5bce('0x39')]=_[_0x5bce('0x3c')](_0x478600['where'],{'$or':_['map'](_0x478600[_0x5bce('0x32')],function(_0x19da22){var _0x544316={};_0x544316[_0x19da22]={'$like':'%'+_0x403469['query'][_0x5bce('0x3b')]+'%'};return _0x544316;})});}_0x478600=_[_0x5bce('0x3c')]({},_0x478600,_0x403469[_0x5bce('0x46')]);return _0x5df1df['getTags'](_0x478600);}})[_0x5bce('0x24')](function(_0x23a0d4){if(_0x23a0d4){_0x1e1ef7=_0x23a0d4[_0x5bce('0x34')];if(!_0x403469['query'][_0x5bce('0x35')](_0x5bce('0x36'))){_0x478600[_0x5bce('0x1c')]=qs[_0x5bce('0x1c')](_0x403469[_0x5bce('0x2f')][_0x5bce('0x1c')]);_0x478600[_0x5bce('0x1e')]=qs[_0x5bce('0x1e')](_0x403469['query'][_0x5bce('0x1e')]);}return _0x5df1df[_0x5bce('0x52')](_0x478600);}})['then'](function(_0xb6b98){if(_0xb6b98){return _0xb6b98?{'count':_0x1e1ef7,'rows':_0xb6b98}:null;}})[_0x5bce('0x24')](respondWithResult(_0x462da2,null))[_0x5bce('0x48')](handleError(_0x462da2,null));};exports[_0x5bce('0x53')]=function(_0x538429,_0x5e22b8,_0x2775a0){if(_0x538429[_0x5bce('0x4a')]['id']){delete _0x538429[_0x5bce('0x4a')]['id'];}return db[_0x5bce('0x2a')]['findOne']({'where':{'id':_0x538429['params']['id']}})['then'](handleEntityNotFound(_0x5e22b8,null))[_0x5bce('0x24')](function(_0x3186c3){if(_0x3186c3){return _0x3186c3[_0x5bce('0x53')](_0x538429[_0x5bce('0x4a')][_0x5bce('0x54')]||[]);}return null;})[_0x5bce('0x24')](respondWithResult(_0x5e22b8,null))[_0x5bce('0x48')](handleError(_0x5e22b8,null));}; \ No newline at end of file +var _0x100a=['index','map','DeskConfiguration','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','find','create','body','getFields','findOne','DeskField','rawAttributes','pick','getSubjects','getDescriptions','hasOwnProperty','getTags','setTags','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x100a,0x164));var _0xa100=function(_0x3d4115,_0x3d0cb3){_0x3d4115=_0x3d4115-0x0;var _0x42685f=_0x100a[_0x3d4115];return _0x42685f;};'use strict';var emlformat=require(_0xa100('0x0'));var rimraf=require(_0xa100('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa100('0x2'));var Mustache=require(_0xa100('0x3'));var util=require(_0xa100('0x4'));var path=require('path');var sox=require(_0xa100('0x5'));var csv=require(_0xa100('0x6'));var ejs=require(_0xa100('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa100('0x8'));var crypto=require(_0xa100('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xa100('0xa'));var toCsv=require(_0xa100('0x6'));var querystring=require(_0xa100('0xb'));var Papa=require('papaparse');var Redis=require(_0xa100('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa100('0xd'));var hardwareService=require(_0xa100('0xe'));var logger=require(_0xa100('0xf'))(_0xa100('0x10'));var utils=require(_0xa100('0x11'));var config=require(_0xa100('0x12'));var licenseUtil=require(_0xa100('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x547d5f,_0x214a9f){_0x214a9f=_0x214a9f||0xcc;return function(_0x1eab1b){if(_0x1eab1b){return _0x547d5f[_0xa100('0x14')](_0x214a9f);}return _0x547d5f[_0xa100('0x15')](_0x214a9f)['end']();};}function respondWithResult(_0x1ee1b5,_0x13129e){_0x13129e=_0x13129e||0xc8;return function(_0x3efd2f){if(_0x3efd2f){return _0x1ee1b5[_0xa100('0x15')](_0x13129e)['json'](_0x3efd2f);}};}function respondWithFilteredResult(_0x550922,_0x2ba1d4){return function(_0x1cbfc0){if(_0x1cbfc0){var _0x3442ed=typeof _0x2ba1d4[_0xa100('0x16')]==='undefined'&&typeof _0x2ba1d4[_0xa100('0x17')]===_0xa100('0x18');var _0x29a85f=_0x1cbfc0['count'];var _0x5ee163=_0x3442ed?0x0:_0x2ba1d4['offset'];var _0x39c96c=_0x3442ed?_0x1cbfc0[_0xa100('0x19')]:_0x2ba1d4[_0xa100('0x16')]+_0x2ba1d4[_0xa100('0x17')];var _0x526099;if(_0x39c96c>=_0x29a85f){_0x39c96c=_0x29a85f;_0x526099=0xc8;}else{_0x526099=0xce;}_0x550922[_0xa100('0x15')](_0x526099);return _0x550922[_0xa100('0x1a')](_0xa100('0x1b'),_0x5ee163+'-'+_0x39c96c+'/'+_0x29a85f)[_0xa100('0x1c')](_0x1cbfc0);}return null;};}function patchUpdates(_0x42aba9){return function(_0x53f25f){try{jsonpatch[_0xa100('0x1d')](_0x53f25f,_0x42aba9,!![]);}catch(_0x5da5ed){return BPromise['reject'](_0x5da5ed);}return _0x53f25f[_0xa100('0x1e')]();};}function saveUpdates(_0x1ebd76,_0x41aef1){return function(_0x4ba68a){if(_0x4ba68a){return _0x4ba68a[_0xa100('0x1f')](_0x1ebd76)[_0xa100('0x20')](function(_0x4552a8){return _0x4552a8;});}return null;};}function removeEntity(_0x52a47f,_0x36324d){return function(_0xef4973){if(_0xef4973){return _0xef4973[_0xa100('0x21')]()[_0xa100('0x20')](function(){_0x52a47f[_0xa100('0x15')](0xcc)[_0xa100('0x22')]();});}};}function handleEntityNotFound(_0x100bb2,_0x1899de){return function(_0x1af738){if(!_0x1af738){_0x100bb2[_0xa100('0x14')](0x194);}return _0x1af738;};}function handleError(_0x4465f3,_0x36dfbd){_0x36dfbd=_0x36dfbd||0x1f4;return function(_0x384251){logger[_0xa100('0x23')](_0x384251[_0xa100('0x24')]);if(_0x384251[_0xa100('0x25')]){delete _0x384251[_0xa100('0x25')];}_0x4465f3[_0xa100('0x15')](_0x36dfbd)[_0xa100('0x26')](_0x384251);};}exports[_0xa100('0x27')]=function(_0xacf96b,_0x400a70){var _0x2c4596={},_0xd328d5={},_0x5879f5={'count':0x0,'rows':[]};var _0x41784c=_[_0xa100('0x28')](db[_0xa100('0x29')]['rawAttributes'],function(_0xadd6ec){return{'name':_0xadd6ec['fieldName'],'type':_0xadd6ec[_0xa100('0x2a')][_0xa100('0x2b')]};});_0xd328d5[_0xa100('0x2c')]=_[_0xa100('0x28')](_0x41784c,_0xa100('0x25'));_0xd328d5[_0xa100('0x2d')]=_['keys'](_0xacf96b[_0xa100('0x2d')]);_0xd328d5[_0xa100('0x2e')]=_[_0xa100('0x2f')](_0xd328d5['model'],_0xd328d5['query']);_0x2c4596['attributes']=_[_0xa100('0x2f')](_0xd328d5[_0xa100('0x2c')],qs[_0xa100('0x30')](_0xacf96b[_0xa100('0x2d')][_0xa100('0x30')]));_0x2c4596[_0xa100('0x31')]=_0x2c4596[_0xa100('0x31')][_0xa100('0x32')]?_0x2c4596[_0xa100('0x31')]:_0xd328d5[_0xa100('0x2c')];if(!_0xacf96b['query']['hasOwnProperty'](_0xa100('0x33'))){_0x2c4596[_0xa100('0x17')]=qs['limit'](_0xacf96b[_0xa100('0x2d')][_0xa100('0x17')]);_0x2c4596[_0xa100('0x16')]=qs[_0xa100('0x16')](_0xacf96b['query'][_0xa100('0x16')]);}_0x2c4596[_0xa100('0x34')]=qs[_0xa100('0x35')](_0xacf96b[_0xa100('0x2d')]['sort']);_0x2c4596['where']=qs['filters'](_['pick'](_0xacf96b[_0xa100('0x2d')],_0xd328d5[_0xa100('0x2e')]),_0x41784c);if(_0xacf96b[_0xa100('0x2d')][_0xa100('0x36')]){_0x2c4596['where']=_[_0xa100('0x37')](_0x2c4596[_0xa100('0x38')],{'$or':_['map'](_0x41784c,function(_0x25bbc5){if(_0x25bbc5[_0xa100('0x2a')]!==_0xa100('0x39')){var _0x8e43ea={};_0x8e43ea[_0x25bbc5[_0xa100('0x25')]]={'$like':'%'+_0xacf96b[_0xa100('0x2d')][_0xa100('0x36')]+'%'};return _0x8e43ea;}})});}_0x2c4596=_[_0xa100('0x37')]({},_0x2c4596,_0xacf96b[_0xa100('0x3a')]);var _0x18d30d={'where':_0x2c4596[_0xa100('0x38')]};return db[_0xa100('0x29')]['count'](_0x18d30d)[_0xa100('0x20')](function(_0x5bf886){_0x5879f5[_0xa100('0x19')]=_0x5bf886;if(_0xacf96b[_0xa100('0x2d')]['includeAll']){_0x2c4596[_0xa100('0x3b')]=[{'all':!![]}];}return db[_0xa100('0x29')]['findAll'](_0x2c4596);})[_0xa100('0x20')](function(_0x4afd44){_0x5879f5[_0xa100('0x3c')]=_0x4afd44;return _0x5879f5;})['then'](respondWithFilteredResult(_0x400a70,_0x2c4596))[_0xa100('0x3d')](handleError(_0x400a70,null));};exports[_0xa100('0x3e')]=function(_0x5a0755,_0x11da9f){var _0x31d5f4={'raw':![],'where':{'id':_0x5a0755[_0xa100('0x3f')]['id']}},_0x1e216c={};_0x1e216c[_0xa100('0x2c')]=_['keys'](db[_0xa100('0x29')]['rawAttributes']);_0x1e216c[_0xa100('0x2d')]=_[_0xa100('0x40')](_0x5a0755[_0xa100('0x2d')]);_0x1e216c[_0xa100('0x2e')]=_['intersection'](_0x1e216c['model'],_0x1e216c[_0xa100('0x2d')]);_0x31d5f4[_0xa100('0x31')]=_[_0xa100('0x2f')](_0x1e216c[_0xa100('0x2c')],qs[_0xa100('0x30')](_0x5a0755[_0xa100('0x2d')][_0xa100('0x30')]));_0x31d5f4[_0xa100('0x31')]=_0x31d5f4[_0xa100('0x31')][_0xa100('0x32')]?_0x31d5f4[_0xa100('0x31')]:_0x1e216c['model'];if(_0x5a0755[_0xa100('0x2d')][_0xa100('0x41')]){_0x31d5f4[_0xa100('0x3b')]=[{'all':!![]}];}_0x31d5f4=_[_0xa100('0x37')]({},_0x31d5f4,_0x5a0755[_0xa100('0x3a')]);return db[_0xa100('0x29')][_0xa100('0x42')](_0x31d5f4)[_0xa100('0x20')](handleEntityNotFound(_0x11da9f,null))[_0xa100('0x20')](respondWithResult(_0x11da9f,null))['catch'](handleError(_0x11da9f,null));};exports['create']=function(_0x84a024,_0x355de1){return db[_0xa100('0x29')][_0xa100('0x43')](_0x84a024[_0xa100('0x44')],{})[_0xa100('0x20')](respondWithResult(_0x355de1,0xc9))[_0xa100('0x3d')](handleError(_0x355de1,null));};exports[_0xa100('0x1f')]=function(_0x64a9d8,_0x2af128){if(_0x64a9d8[_0xa100('0x44')]['id']){delete _0x64a9d8[_0xa100('0x44')]['id'];}return db[_0xa100('0x29')]['find']({'where':{'id':_0x64a9d8[_0xa100('0x3f')]['id']}})[_0xa100('0x20')](handleEntityNotFound(_0x2af128,null))['then'](saveUpdates(_0x64a9d8[_0xa100('0x44')],null))[_0xa100('0x20')](respondWithResult(_0x2af128,null))[_0xa100('0x3d')](handleError(_0x2af128,null));};exports[_0xa100('0x21')]=function(_0x1af540,_0x1e7975){return db[_0xa100('0x29')]['find']({'where':{'id':_0x1af540['params']['id']}})[_0xa100('0x20')](handleEntityNotFound(_0x1e7975,null))[_0xa100('0x20')](removeEntity(_0x1e7975,null))[_0xa100('0x3d')](handleError(_0x1e7975,null));};exports[_0xa100('0x45')]=function(_0x11097c,_0x8555df,_0x5b04dc){var _0xfcb714={};var _0x48c95c={};var _0x3d6687;var _0x5d5b53;return db[_0xa100('0x29')][_0xa100('0x46')]({'where':{'id':_0x11097c[_0xa100('0x3f')]['id']}})['then'](handleEntityNotFound(_0x8555df,null))[_0xa100('0x20')](function(_0x4d1eb3){if(_0x4d1eb3){_0x3d6687=_0x4d1eb3;_0x48c95c['model']=_[_0xa100('0x40')](db[_0xa100('0x47')][_0xa100('0x48')]);_0x48c95c[_0xa100('0x2d')]=_[_0xa100('0x40')](_0x11097c[_0xa100('0x2d')]);_0x48c95c[_0xa100('0x2e')]=_[_0xa100('0x2f')](_0x48c95c[_0xa100('0x2c')],_0x48c95c['query']);_0xfcb714[_0xa100('0x31')]=_[_0xa100('0x2f')](_0x48c95c['model'],qs[_0xa100('0x30')](_0x11097c[_0xa100('0x2d')]['fields']));_0xfcb714[_0xa100('0x31')]=_0xfcb714[_0xa100('0x31')][_0xa100('0x32')]?_0xfcb714[_0xa100('0x31')]:_0x48c95c[_0xa100('0x2c')];_0xfcb714['order']=qs[_0xa100('0x35')](_0x11097c[_0xa100('0x2d')][_0xa100('0x35')]);_0xfcb714[_0xa100('0x38')]=qs['filters'](_[_0xa100('0x49')](_0x11097c[_0xa100('0x2d')],_0x48c95c[_0xa100('0x2e')]));if(_0x11097c[_0xa100('0x2d')]['filter']){_0xfcb714[_0xa100('0x38')]=_[_0xa100('0x37')](_0xfcb714[_0xa100('0x38')],{'$or':_[_0xa100('0x28')](_0xfcb714[_0xa100('0x31')],function(_0xef7382){var _0x341f7c={};_0x341f7c[_0xef7382]={'$like':'%'+_0x11097c[_0xa100('0x2d')][_0xa100('0x36')]+'%'};return _0x341f7c;})});}_0xfcb714=_[_0xa100('0x37')]({},_0xfcb714,_0x11097c[_0xa100('0x3a')]);return _0x3d6687[_0xa100('0x45')](_0xfcb714);}})['then'](function(_0xcc2a74){if(_0xcc2a74){_0x5d5b53=_0xcc2a74[_0xa100('0x32')];if(!_0x11097c[_0xa100('0x2d')]['hasOwnProperty'](_0xa100('0x33'))){_0xfcb714['limit']=qs[_0xa100('0x17')](_0x11097c[_0xa100('0x2d')][_0xa100('0x17')]);_0xfcb714[_0xa100('0x16')]=qs[_0xa100('0x16')](_0x11097c['query']['offset']);}return _0x3d6687[_0xa100('0x45')](_0xfcb714);}})[_0xa100('0x20')](function(_0x3636b8){if(_0x3636b8){return _0x3636b8?{'count':_0x5d5b53,'rows':_0x3636b8}:null;}})[_0xa100('0x20')](respondWithResult(_0x8555df,null))[_0xa100('0x3d')](handleError(_0x8555df,null));};exports['getSubjects']=function(_0x572f8b,_0x5bade7,_0x32d03e){var _0xbfb81d={};var _0x7662ea={};var _0x553232;var _0x41ca1d;return db[_0xa100('0x29')]['findOne']({'where':{'id':_0x572f8b[_0xa100('0x3f')]['id']}})[_0xa100('0x20')](handleEntityNotFound(_0x5bade7,null))[_0xa100('0x20')](function(_0x464a87){if(_0x464a87){_0x553232=_0x464a87;_0x7662ea['model']=_[_0xa100('0x40')](db[_0xa100('0x47')]['rawAttributes']);_0x7662ea['query']=_[_0xa100('0x40')](_0x572f8b['query']);_0x7662ea[_0xa100('0x2e')]=_['intersection'](_0x7662ea[_0xa100('0x2c')],_0x7662ea[_0xa100('0x2d')]);_0xbfb81d['attributes']=_['intersection'](_0x7662ea[_0xa100('0x2c')],qs[_0xa100('0x30')](_0x572f8b[_0xa100('0x2d')][_0xa100('0x30')]));_0xbfb81d[_0xa100('0x31')]=_0xbfb81d['attributes']['length']?_0xbfb81d[_0xa100('0x31')]:_0x7662ea[_0xa100('0x2c')];_0xbfb81d[_0xa100('0x34')]=qs['sort'](_0x572f8b[_0xa100('0x2d')][_0xa100('0x35')]);_0xbfb81d[_0xa100('0x38')]=qs[_0xa100('0x2e')](_[_0xa100('0x49')](_0x572f8b[_0xa100('0x2d')],_0x7662ea[_0xa100('0x2e')]));if(_0x572f8b['query']['filter']){_0xbfb81d[_0xa100('0x38')]=_[_0xa100('0x37')](_0xbfb81d['where'],{'$or':_[_0xa100('0x28')](_0xbfb81d[_0xa100('0x31')],function(_0x3ff521){var _0x3918c9={};_0x3918c9[_0x3ff521]={'$like':'%'+_0x572f8b['query'][_0xa100('0x36')]+'%'};return _0x3918c9;})});}_0xbfb81d=_['merge']({},_0xbfb81d,_0x572f8b[_0xa100('0x3a')]);return _0x553232['getSubjects'](_0xbfb81d);}})[_0xa100('0x20')](function(_0x335674){if(_0x335674){_0x41ca1d=_0x335674[_0xa100('0x32')];if(!_0x572f8b[_0xa100('0x2d')]['hasOwnProperty'](_0xa100('0x33'))){_0xbfb81d[_0xa100('0x17')]=qs[_0xa100('0x17')](_0x572f8b[_0xa100('0x2d')][_0xa100('0x17')]);_0xbfb81d[_0xa100('0x16')]=qs['offset'](_0x572f8b['query'][_0xa100('0x16')]);}return _0x553232[_0xa100('0x4a')](_0xbfb81d);}})['then'](function(_0x36e88d){if(_0x36e88d){return _0x36e88d?{'count':_0x41ca1d,'rows':_0x36e88d}:null;}})[_0xa100('0x20')](respondWithResult(_0x5bade7,null))['catch'](handleError(_0x5bade7,null));};exports[_0xa100('0x4b')]=function(_0x462688,_0x4c137f,_0x2ad654){var _0x40c812={};var _0x3b2cad={};var _0x291e3f;var _0x16edbd;return db[_0xa100('0x29')][_0xa100('0x46')]({'where':{'id':_0x462688['params']['id']}})['then'](handleEntityNotFound(_0x4c137f,null))[_0xa100('0x20')](function(_0x4c7acc){if(_0x4c7acc){_0x291e3f=_0x4c7acc;_0x3b2cad['model']=_['keys'](db[_0xa100('0x47')][_0xa100('0x48')]);_0x3b2cad['query']=_[_0xa100('0x40')](_0x462688[_0xa100('0x2d')]);_0x3b2cad[_0xa100('0x2e')]=_[_0xa100('0x2f')](_0x3b2cad[_0xa100('0x2c')],_0x3b2cad[_0xa100('0x2d')]);_0x40c812[_0xa100('0x31')]=_[_0xa100('0x2f')](_0x3b2cad[_0xa100('0x2c')],qs[_0xa100('0x30')](_0x462688[_0xa100('0x2d')]['fields']));_0x40c812[_0xa100('0x31')]=_0x40c812[_0xa100('0x31')]['length']?_0x40c812[_0xa100('0x31')]:_0x3b2cad[_0xa100('0x2c')];_0x40c812[_0xa100('0x34')]=qs[_0xa100('0x35')](_0x462688[_0xa100('0x2d')]['sort']);_0x40c812[_0xa100('0x38')]=qs[_0xa100('0x2e')](_[_0xa100('0x49')](_0x462688[_0xa100('0x2d')],_0x3b2cad[_0xa100('0x2e')]));if(_0x462688[_0xa100('0x2d')]['filter']){_0x40c812[_0xa100('0x38')]=_[_0xa100('0x37')](_0x40c812[_0xa100('0x38')],{'$or':_[_0xa100('0x28')](_0x40c812['attributes'],function(_0x3721f1){var _0x31e9f5={};_0x31e9f5[_0x3721f1]={'$like':'%'+_0x462688[_0xa100('0x2d')][_0xa100('0x36')]+'%'};return _0x31e9f5;})});}_0x40c812=_['merge']({},_0x40c812,_0x462688['options']);return _0x291e3f[_0xa100('0x4b')](_0x40c812);}})['then'](function(_0xc3fa8a){if(_0xc3fa8a){_0x16edbd=_0xc3fa8a[_0xa100('0x32')];if(!_0x462688[_0xa100('0x2d')][_0xa100('0x4c')](_0xa100('0x33'))){_0x40c812[_0xa100('0x17')]=qs['limit'](_0x462688[_0xa100('0x2d')][_0xa100('0x17')]);_0x40c812['offset']=qs['offset'](_0x462688[_0xa100('0x2d')][_0xa100('0x16')]);}return _0x291e3f[_0xa100('0x4b')](_0x40c812);}})[_0xa100('0x20')](function(_0x768db2){if(_0x768db2){return _0x768db2?{'count':_0x16edbd,'rows':_0x768db2}:null;}})[_0xa100('0x20')](respondWithResult(_0x4c137f,null))['catch'](handleError(_0x4c137f,null));};exports[_0xa100('0x4d')]=function(_0x4df4f6,_0x8b3e8,_0xa225ab){var _0xc1bb89={};var _0x2accc5={};var _0x9e3eb7;var _0x1cde61;return db[_0xa100('0x29')][_0xa100('0x46')]({'where':{'id':_0x4df4f6['params']['id']}})[_0xa100('0x20')](handleEntityNotFound(_0x8b3e8,null))[_0xa100('0x20')](function(_0x30a958){if(_0x30a958){_0x9e3eb7=_0x30a958;_0x2accc5['model']=_[_0xa100('0x40')](db['Tag'][_0xa100('0x48')]);_0x2accc5[_0xa100('0x2d')]=_[_0xa100('0x40')](_0x4df4f6[_0xa100('0x2d')]);_0x2accc5['filters']=_[_0xa100('0x2f')](_0x2accc5[_0xa100('0x2c')],_0x2accc5[_0xa100('0x2d')]);_0xc1bb89[_0xa100('0x31')]=_[_0xa100('0x2f')](_0x2accc5[_0xa100('0x2c')],qs[_0xa100('0x30')](_0x4df4f6['query']['fields']));_0xc1bb89[_0xa100('0x31')]=_0xc1bb89[_0xa100('0x31')][_0xa100('0x32')]?_0xc1bb89[_0xa100('0x31')]:_0x2accc5[_0xa100('0x2c')];_0xc1bb89[_0xa100('0x34')]=qs[_0xa100('0x35')](_0x4df4f6['query']['sort']);_0xc1bb89[_0xa100('0x38')]=qs[_0xa100('0x2e')](_[_0xa100('0x49')](_0x4df4f6[_0xa100('0x2d')],_0x2accc5[_0xa100('0x2e')]));if(_0x4df4f6[_0xa100('0x2d')][_0xa100('0x36')]){_0xc1bb89[_0xa100('0x38')]=_[_0xa100('0x37')](_0xc1bb89[_0xa100('0x38')],{'$or':_[_0xa100('0x28')](_0xc1bb89[_0xa100('0x31')],function(_0x1af35b){var _0x51d166={};_0x51d166[_0x1af35b]={'$like':'%'+_0x4df4f6[_0xa100('0x2d')][_0xa100('0x36')]+'%'};return _0x51d166;})});}_0xc1bb89=_[_0xa100('0x37')]({},_0xc1bb89,_0x4df4f6[_0xa100('0x3a')]);return _0x9e3eb7[_0xa100('0x4d')](_0xc1bb89);}})[_0xa100('0x20')](function(_0x216e09){if(_0x216e09){_0x1cde61=_0x216e09[_0xa100('0x32')];if(!_0x4df4f6[_0xa100('0x2d')]['hasOwnProperty'](_0xa100('0x33'))){_0xc1bb89[_0xa100('0x17')]=qs['limit'](_0x4df4f6['query']['limit']);_0xc1bb89[_0xa100('0x16')]=qs['offset'](_0x4df4f6['query'][_0xa100('0x16')]);}return _0x9e3eb7[_0xa100('0x4d')](_0xc1bb89);}})[_0xa100('0x20')](function(_0x30c774){if(_0x30c774){return _0x30c774?{'count':_0x1cde61,'rows':_0x30c774}:null;}})[_0xa100('0x20')](respondWithResult(_0x8b3e8,null))[_0xa100('0x3d')](handleError(_0x8b3e8,null));};exports[_0xa100('0x4e')]=function(_0x23c24d,_0xd8d527,_0x4318ce){if(_0x23c24d['body']['id']){delete _0x23c24d[_0xa100('0x44')]['id'];}return db[_0xa100('0x29')][_0xa100('0x46')]({'where':{'id':_0x23c24d[_0xa100('0x3f')]['id']}})[_0xa100('0x20')](handleEntityNotFound(_0xd8d527,null))[_0xa100('0x20')](function(_0x1c4d41){if(_0x1c4d41){return _0x1c4d41[_0xa100('0x4e')](_0x23c24d[_0xa100('0x44')]['ids']||[]);}return null;})[_0xa100('0x20')](respondWithResult(_0xd8d527,null))[_0xa100('0x3d')](handleError(_0xd8d527,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index e919549..643e6a1 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 _0x3da7=['request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports','int_desk_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x424680,_0x3b4bc8){var _0xc01431=function(_0x4c82f0){while(--_0x4c82f0){_0x424680['push'](_0x424680['shift']());}};_0xc01431(++_0x3b4bc8);}(_0x3da7,0xe2));var _0x73da=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x3da7[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x73da('0x0'));var util=require('util');var logger=require(_0x73da('0x1'))(_0x73da('0x2'));var moment=require(_0x73da('0x3'));var BPromise=require(_0x73da('0x4'));var rp=require(_0x73da('0x5'));var fs=require('fs');var path=require(_0x73da('0x6'));var rimraf=require('rimraf');var config=require(_0x73da('0x7'));var attributes=require(_0x73da('0x8'));module[_0x73da('0x9')]=function(_0xbb84d6,_0x1f61af){return _0xbb84d6['define']('DeskConfiguration',attributes,{'tableName':_0x73da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa55=['exports','define','int_desk_configurations','util','../../config/logger','api','moment','bluebird','path','./intDeskConfiguration.attributes'];(function(_0x2bd070,_0x1dfadf){var _0x1cec2c=function(_0x428ffc){while(--_0x428ffc){_0x2bd070['push'](_0x2bd070['shift']());}};_0x1cec2c(++_0x1dfadf);}(_0xfa55,0x67));var _0x5fa5=function(_0x43e9c9,_0x45f364){_0x43e9c9=_0x43e9c9-0x0;var _0x5e1c74=_0xfa55[_0x43e9c9];return _0x5e1c74;};'use strict';var _=require('lodash');var util=require(_0x5fa5('0x0'));var logger=require(_0x5fa5('0x1'))(_0x5fa5('0x2'));var moment=require(_0x5fa5('0x3'));var BPromise=require(_0x5fa5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fa5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5fa5('0x6'));module[_0x5fa5('0x7')]=function(_0x4499a9,_0x89186e){return _0x4499a9[_0x5fa5('0x8')]('DeskConfiguration',attributes,{'tableName':_0x5fa5('0x9'),'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 61aa270..1ac325f 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 _0xa3db=['client','http','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x10c51f,_0x11270f){var _0x56a0cd=function(_0x563ac6){while(--_0x563ac6){_0x10c51f['push'](_0x10c51f['shift']());}};_0x56a0cd(++_0x11270f);}(_0xa3db,0x10c));var _0xba3d=function(_0x2363c8,_0x5e7a0e){_0x2363c8=_0x2363c8-0x0;var _0x89c588=_0xa3db[_0x2363c8];return _0x89c588;};'use strict';var _=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var moment=require(_0xba3d('0x2'));var BPromise=require(_0xba3d('0x3'));var rs=require(_0xba3d('0x4'));var fs=require('fs');var Redis=require(_0xba3d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba3d('0x6'))('rpc');var config=require(_0xba3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba3d('0x8')][_0xba3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477583,_0x1bacd7,_0x1bd181){return new BPromise(function(_0x426868,_0x3b69e9){return client[_0xba3d('0xa')](_0x477583,_0x1bd181)[_0xba3d('0xb')](function(_0x102fe6){logger[_0xba3d('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x1bacd7,_0xba3d('0xd'));logger[_0xba3d('0xe')](_0xba3d('0xf'),_0x1bacd7,_0xba3d('0xd'),JSON[_0xba3d('0x10')](_0x102fe6));if(_0x102fe6['error']){if(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x12')]===0x1f4){logger[_0xba3d('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x3b69e9(_0x102fe6[_0xba3d('0x11')]['message']);}logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x426868(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x13')]);}else{logger[_0xba3d('0xc')](_0xba3d('0x14'),_0x1bacd7,_0xba3d('0xd'));_0x426868(_0x102fe6[_0xba3d('0x15')][_0xba3d('0x13')]);}})[_0xba3d('0x16')](function(_0x2ce092){logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x2ce092);_0x3b69e9(_0x2ce092);});});} \ No newline at end of file +var _0xb53e=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xb53e,0xa9));var _0xeb53=function(_0x4262c7,_0x12d052){_0x4262c7=_0x4262c7-0x0;var _0x2ab64d=_0xb53e[_0x4262c7];return _0x2ab64d;};'use strict';var _=require(_0xeb53('0x0'));var util=require(_0xeb53('0x1'));var moment=require('moment');var BPromise=require(_0xeb53('0x2'));var rs=require(_0xeb53('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb53('0x4'))['db'];var utils=require(_0xeb53('0x5'));var logger=require('../../config/logger')(_0xeb53('0x6'));var config=require(_0xeb53('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xeb53('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x576ffb,_0x39e1a8,_0x5741a1){return new BPromise(function(_0x15bcd6,_0x4bff94){return client['request'](_0x576ffb,_0x5741a1)[_0xeb53('0x9')](function(_0x1da2e7){logger[_0xeb53('0xa')](_0xeb53('0xb'),_0x39e1a8,'request\x20sent');logger[_0xeb53('0xc')](_0xeb53('0xd'),_0x39e1a8,_0xeb53('0xe'),JSON[_0xeb53('0xf')](_0x1da2e7));if(_0x1da2e7[_0xeb53('0x10')]){if(_0x1da2e7[_0xeb53('0x10')][_0xeb53('0x11')]===0x1f4){logger['error'](_0xeb53('0xb'),_0x39e1a8,_0x1da2e7[_0xeb53('0x10')][_0xeb53('0x12')]);return _0x4bff94(_0x1da2e7['error']['message']);}logger[_0xeb53('0x10')](_0xeb53('0xb'),_0x39e1a8,_0x1da2e7[_0xeb53('0x10')][_0xeb53('0x12')]);return _0x15bcd6(_0x1da2e7[_0xeb53('0x10')]['message']);}else{logger[_0xeb53('0xa')](_0xeb53('0xb'),_0x39e1a8,_0xeb53('0xe'));_0x15bcd6(_0x1da2e7[_0xeb53('0x13')][_0xeb53('0x12')]);}})[_0xeb53('0x14')](function(_0x4ddaf6){logger[_0xeb53('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x39e1a8,_0x4ddaf6);_0x4bff94(_0x4ddaf6);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 82ed9a2..668a298 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 _0xac4a=['Router','fs-extra','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xac4a,0x1e9));var _0xaac4=function(_0x2a559e,_0x5eff58){_0x2a559e=_0x2a559e-0x0;var _0xaba6d3=_0xac4a[_0x2a559e];return _0xaba6d3;};'use strict';var multer=require('multer');var util=require(_0xaac4('0x0'));var path=require(_0xaac4('0x1'));var timeout=require(_0xaac4('0x2'));var express=require(_0xaac4('0x3'));var router=express[_0xaac4('0x4')]();var fs_extra=require(_0xaac4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require('../../config/environment');var controller=require(_0xaac4('0x7'));router[_0xaac4('0x8')]('/',auth[_0xaac4('0x9')](),controller[_0xaac4('0xa')]);router[_0xaac4('0x8')](_0xaac4('0xb'),auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xd')]('/',auth[_0xaac4('0x9')](),controller['create']);router['put'](_0xaac4('0xb'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router[_0xaac4('0xf')](_0xaac4('0xb'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7708=['multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','delete','destroy'];(function(_0x30e3be,_0x1ee853){var _0x309388=function(_0x5918f1){while(--_0x5918f1){_0x30e3be['push'](_0x30e3be['shift']());}};_0x309388(++_0x1ee853);}(_0x7708,0x188));var _0x8770=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0x7708[_0x5447aa];return _0xb21e53;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./intDeskField.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0xa')]('/',auth[_0x8770('0x8')](),controller['create']);router[_0x8770('0xb')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller['update']);router[_0x8770('0xc')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 2a1d3fa..bb0541e 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 _0x2b2a=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2cc0b3,_0x120bf1){var _0x1667ef=function(_0x3abcb4){while(--_0x3abcb4){_0x2cc0b3['push'](_0x2cc0b3['shift']());}};_0x1667ef(++_0x120bf1);}(_0x2b2a,0x165));var _0xa2b2=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x2b2a[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require(_0xa2b2('0x0'));module[_0xa2b2('0x1')]={'type':{'type':Sequelize[_0xa2b2('0x2')](_0xa2b2('0x3'),_0xa2b2('0x4'),_0xa2b2('0x5'),_0xa2b2('0x6'),'picklist'),'defaultValue':_0xa2b2('0x3')},'content':{'type':Sequelize[_0xa2b2('0x7')]},'key':{'type':Sequelize[_0xa2b2('0x7')]},'keyType':{'type':Sequelize[_0xa2b2('0x2')]('string',_0xa2b2('0x4'),_0xa2b2('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa2b2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa2b2('0x7')]}}; \ No newline at end of file +var _0xb0f2=['variable','customVariable','picklist','STRING','sequelize','ENUM','string'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xb0f2,0x107));var _0x2b0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0f2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2b0f('0x0'));module['exports']={'type':{'type':Sequelize[_0x2b0f('0x1')](_0x2b0f('0x2'),_0x2b0f('0x3'),_0x2b0f('0x4'),'keyValue',_0x2b0f('0x5')),'defaultValue':_0x2b0f('0x2')},'content':{'type':Sequelize[_0x2b0f('0x6')]},'key':{'type':Sequelize[_0x2b0f('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x2b0f('0x2'),_0x2b0f('0x3'),_0x2b0f('0x4'))},'keyContent':{'type':Sequelize[_0x2b0f('0x6')]},'idField':{'type':Sequelize[_0x2b0f('0x6')]},'nameField':{'type':Sequelize[_0x2b0f('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2b0f('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 2a0a231..f26e3d6 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 _0xce35=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','name','send','index','map','DeskField'];(function(_0x2c11b3,_0x655b95){var _0x44d727=function(_0x43d903){while(--_0x43d903){_0x2c11b3['push'](_0x2c11b3['shift']());}};_0x44d727(++_0x655b95);}(_0xce35,0x15b));var _0x5ce3=function(_0x16adcd,_0x2696ec){_0x16adcd=_0x16adcd-0x0;var _0x2a41f6=_0xce35[_0x16adcd];return _0x2a41f6;};'use strict';var emlformat=require(_0x5ce3('0x0'));var rimraf=require(_0x5ce3('0x1'));var zipdir=require(_0x5ce3('0x2'));var jsonpatch=require(_0x5ce3('0x3'));var rp=require(_0x5ce3('0x4'));var moment=require(_0x5ce3('0x5'));var BPromise=require(_0x5ce3('0x6'));var Mustache=require(_0x5ce3('0x7'));var util=require(_0x5ce3('0x8'));var path=require(_0x5ce3('0x9'));var sox=require(_0x5ce3('0xa'));var csv=require(_0x5ce3('0xb'));var ejs=require(_0x5ce3('0xc'));var fs=require('fs');var fs_extra=require(_0x5ce3('0xd'));var _=require(_0x5ce3('0xe'));var squel=require(_0x5ce3('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5ce3('0x10'));var toCsv=require(_0x5ce3('0xb'));var querystring=require(_0x5ce3('0x11'));var Papa=require(_0x5ce3('0x12'));var Redis=require(_0x5ce3('0x13'));var authService=require(_0x5ce3('0x14'));var qs=require(_0x5ce3('0x15'));var as=require(_0x5ce3('0x16'));var hardwareService=require(_0x5ce3('0x17'));var logger=require(_0x5ce3('0x18'))(_0x5ce3('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5ce3('0x1a'));var db=require(_0x5ce3('0x1b'))['db'];function respondWithStatusCode(_0x4943fb,_0x154f74){_0x154f74=_0x154f74||0xcc;return function(_0x94f5ef){if(_0x94f5ef){return _0x4943fb[_0x5ce3('0x1c')](_0x154f74);}return _0x4943fb[_0x5ce3('0x1d')](_0x154f74)[_0x5ce3('0x1e')]();};}function respondWithResult(_0x34020a,_0x2c9dd2){_0x2c9dd2=_0x2c9dd2||0xc8;return function(_0x579c2b){if(_0x579c2b){return _0x34020a[_0x5ce3('0x1d')](_0x2c9dd2)['json'](_0x579c2b);}};}function respondWithFilteredResult(_0x248629,_0x447196){return function(_0x2c112c){if(_0x2c112c){var _0x8b4a38=typeof _0x447196['offset']===_0x5ce3('0x1f')&&typeof _0x447196['limit']===_0x5ce3('0x1f');var _0x18125b=_0x2c112c[_0x5ce3('0x20')];var _0x3cae0a=_0x8b4a38?0x0:_0x447196[_0x5ce3('0x21')];var _0x51b225=_0x8b4a38?_0x2c112c[_0x5ce3('0x20')]:_0x447196[_0x5ce3('0x21')]+_0x447196[_0x5ce3('0x22')];var _0x55e293;if(_0x51b225>=_0x18125b){_0x51b225=_0x18125b;_0x55e293=0xc8;}else{_0x55e293=0xce;}_0x248629[_0x5ce3('0x1d')](_0x55e293);return _0x248629[_0x5ce3('0x23')](_0x5ce3('0x24'),_0x3cae0a+'-'+_0x51b225+'/'+_0x18125b)['json'](_0x2c112c);}return null;};}function patchUpdates(_0x30734b){return function(_0x45031f){try{jsonpatch[_0x5ce3('0x25')](_0x45031f,_0x30734b,!![]);}catch(_0x4566b7){return BPromise[_0x5ce3('0x26')](_0x4566b7);}return _0x45031f[_0x5ce3('0x27')]();};}function saveUpdates(_0x5e6040,_0xbf3fa){return function(_0x2b7f8b){if(_0x2b7f8b){return _0x2b7f8b[_0x5ce3('0x28')](_0x5e6040)['then'](function(_0x150064){return _0x150064;});}return null;};}function removeEntity(_0x296f74,_0x52f50e){return function(_0x1068b6){if(_0x1068b6){return _0x1068b6[_0x5ce3('0x29')]()['then'](function(){_0x296f74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e148,_0x417510){return function(_0x184711){if(!_0x184711){_0x17e148[_0x5ce3('0x1c')](0x194);}return _0x184711;};}function handleError(_0x59c2cd,_0x55dce5){_0x55dce5=_0x55dce5||0x1f4;return function(_0xec71ce){logger[_0x5ce3('0x2a')](_0xec71ce['stack']);if(_0xec71ce[_0x5ce3('0x2b')]){delete _0xec71ce[_0x5ce3('0x2b')];}_0x59c2cd[_0x5ce3('0x1d')](_0x55dce5)[_0x5ce3('0x2c')](_0xec71ce);};}exports[_0x5ce3('0x2d')]=function(_0x28f2c8,_0x174b65){var _0x3dff01={},_0x322c23={},_0x38da3f={'count':0x0,'rows':[]};var _0x2132b0=_[_0x5ce3('0x2e')](db[_0x5ce3('0x2f')][_0x5ce3('0x30')],function(_0x5f1c44){return{'name':_0x5f1c44[_0x5ce3('0x31')],'type':_0x5f1c44[_0x5ce3('0x32')][_0x5ce3('0x33')]};});_0x322c23[_0x5ce3('0x34')]=_[_0x5ce3('0x2e')](_0x2132b0,_0x5ce3('0x2b'));_0x322c23[_0x5ce3('0x35')]=_[_0x5ce3('0x36')](_0x28f2c8['query']);_0x322c23[_0x5ce3('0x37')]=_[_0x5ce3('0x38')](_0x322c23[_0x5ce3('0x34')],_0x322c23[_0x5ce3('0x35')]);_0x3dff01[_0x5ce3('0x39')]=_['intersection'](_0x322c23[_0x5ce3('0x34')],qs['fields'](_0x28f2c8[_0x5ce3('0x35')][_0x5ce3('0x3a')]));_0x3dff01['attributes']=_0x3dff01[_0x5ce3('0x39')][_0x5ce3('0x3b')]?_0x3dff01[_0x5ce3('0x39')]:_0x322c23['model'];if(!_0x28f2c8[_0x5ce3('0x35')][_0x5ce3('0x3c')](_0x5ce3('0x3d'))){_0x3dff01['limit']=qs[_0x5ce3('0x22')](_0x28f2c8[_0x5ce3('0x35')][_0x5ce3('0x22')]);_0x3dff01['offset']=qs[_0x5ce3('0x21')](_0x28f2c8[_0x5ce3('0x35')][_0x5ce3('0x21')]);}_0x3dff01[_0x5ce3('0x3e')]=qs[_0x5ce3('0x3f')](_0x28f2c8['query'][_0x5ce3('0x3f')]);_0x3dff01[_0x5ce3('0x40')]=qs[_0x5ce3('0x37')](_['pick'](_0x28f2c8[_0x5ce3('0x35')],_0x322c23[_0x5ce3('0x37')]),_0x2132b0);if(_0x28f2c8['query'][_0x5ce3('0x41')]){_0x3dff01['where']=_[_0x5ce3('0x42')](_0x3dff01[_0x5ce3('0x40')],{'$or':_[_0x5ce3('0x2e')](_0x2132b0,function(_0x434f6a){if(_0x434f6a[_0x5ce3('0x32')]!=='VIRTUAL'){var _0x226d7b={};_0x226d7b[_0x434f6a[_0x5ce3('0x2b')]]={'$like':'%'+_0x28f2c8[_0x5ce3('0x35')]['filter']+'%'};return _0x226d7b;}})});}_0x3dff01=_[_0x5ce3('0x42')]({},_0x3dff01,_0x28f2c8[_0x5ce3('0x43')]);var _0x34d1be={'where':_0x3dff01[_0x5ce3('0x40')]};return db[_0x5ce3('0x2f')][_0x5ce3('0x20')](_0x34d1be)[_0x5ce3('0x44')](function(_0x5b3206){_0x38da3f[_0x5ce3('0x20')]=_0x5b3206;if(_0x28f2c8[_0x5ce3('0x35')][_0x5ce3('0x45')]){_0x3dff01[_0x5ce3('0x46')]=[{'all':!![]}];}return db[_0x5ce3('0x2f')][_0x5ce3('0x47')](_0x3dff01);})[_0x5ce3('0x44')](function(_0x1a7179){_0x38da3f[_0x5ce3('0x48')]=_0x1a7179;return _0x38da3f;})['then'](respondWithFilteredResult(_0x174b65,_0x3dff01))[_0x5ce3('0x49')](handleError(_0x174b65,null));};exports[_0x5ce3('0x4a')]=function(_0x2e306f,_0x407c12){var _0x471bcc={'raw':!![],'where':{'id':_0x2e306f[_0x5ce3('0x4b')]['id']}},_0x3b9e33={};_0x3b9e33[_0x5ce3('0x34')]=_[_0x5ce3('0x36')](db[_0x5ce3('0x2f')][_0x5ce3('0x30')]);_0x3b9e33[_0x5ce3('0x35')]=_[_0x5ce3('0x36')](_0x2e306f[_0x5ce3('0x35')]);_0x3b9e33['filters']=_[_0x5ce3('0x38')](_0x3b9e33[_0x5ce3('0x34')],_0x3b9e33[_0x5ce3('0x35')]);_0x471bcc[_0x5ce3('0x39')]=_['intersection'](_0x3b9e33[_0x5ce3('0x34')],qs[_0x5ce3('0x3a')](_0x2e306f[_0x5ce3('0x35')][_0x5ce3('0x3a')]));_0x471bcc['attributes']=_0x471bcc['attributes'][_0x5ce3('0x3b')]?_0x471bcc[_0x5ce3('0x39')]:_0x3b9e33[_0x5ce3('0x34')];if(_0x2e306f[_0x5ce3('0x35')][_0x5ce3('0x45')]){_0x471bcc[_0x5ce3('0x46')]=[{'all':!![]}];}_0x471bcc=_[_0x5ce3('0x42')]({},_0x471bcc,_0x2e306f['options']);return db[_0x5ce3('0x2f')][_0x5ce3('0x4c')](_0x471bcc)[_0x5ce3('0x44')](handleEntityNotFound(_0x407c12,null))['then'](respondWithResult(_0x407c12,null))[_0x5ce3('0x49')](handleError(_0x407c12,null));};exports[_0x5ce3('0x4d')]=function(_0x1fb0ec,_0x50ef5a){return db['DeskField'][_0x5ce3('0x4d')](_0x1fb0ec[_0x5ce3('0x4e')],{})[_0x5ce3('0x44')](respondWithResult(_0x50ef5a,0xc9))[_0x5ce3('0x49')](handleError(_0x50ef5a,null));};exports[_0x5ce3('0x28')]=function(_0x289fe8,_0x1b8569){if(_0x289fe8['body']['id']){delete _0x289fe8[_0x5ce3('0x4e')]['id'];}return db[_0x5ce3('0x2f')][_0x5ce3('0x4c')]({'where':{'id':_0x289fe8['params']['id']}})['then'](handleEntityNotFound(_0x1b8569,null))[_0x5ce3('0x44')](saveUpdates(_0x289fe8['body'],null))[_0x5ce3('0x44')](respondWithResult(_0x1b8569,null))['catch'](handleError(_0x1b8569,null));};exports[_0x5ce3('0x29')]=function(_0x18a470,_0x5e733b){return db[_0x5ce3('0x2f')]['find']({'where':{'id':_0x18a470[_0x5ce3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e733b,null))[_0x5ce3('0x44')](removeEntity(_0x5e733b,null))['catch'](handleError(_0x5e733b,null));}; \ No newline at end of file +var _0x7097=['stack','name','send','index','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','where','merge','type','VIRTUAL','filter','includeAll','findAll','params','DeskField','options','find','create','body','catch','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','end','sendStatus','error'];(function(_0x5b1477,_0x19f4b2){var _0x4e9d39=function(_0x204e72){while(--_0x204e72){_0x5b1477['push'](_0x5b1477['shift']());}};_0x4e9d39(++_0x19f4b2);}(_0x7097,0x1be));var _0x7709=function(_0x2fc804,_0xb27368){_0x2fc804=_0x2fc804-0x0;var _0x485019=_0x7097[_0x2fc804];return _0x485019;};'use strict';var emlformat=require(_0x7709('0x0'));var rimraf=require(_0x7709('0x1'));var zipdir=require(_0x7709('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7709('0x3'));var BPromise=require(_0x7709('0x4'));var Mustache=require(_0x7709('0x5'));var util=require(_0x7709('0x6'));var path=require(_0x7709('0x7'));var sox=require('sox');var csv=require(_0x7709('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7709('0x9'));var _=require('lodash');var squel=require(_0x7709('0xa'));var crypto=require(_0x7709('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7709('0xc'));var Redis=require(_0x7709('0xd'));var authService=require(_0x7709('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7709('0xf'));var hardwareService=require(_0x7709('0x10'));var logger=require(_0x7709('0x11'))(_0x7709('0x12'));var utils=require(_0x7709('0x13'));var config=require(_0x7709('0x14'));var licenseUtil=require(_0x7709('0x15'));var db=require(_0x7709('0x16'))['db'];function respondWithStatusCode(_0x137f3f,_0x39a850){_0x39a850=_0x39a850||0xcc;return function(_0x3f9faa){if(_0x3f9faa){return _0x137f3f['sendStatus'](_0x39a850);}return _0x137f3f[_0x7709('0x17')](_0x39a850)['end']();};}function respondWithResult(_0x3036de,_0x43176d){_0x43176d=_0x43176d||0xc8;return function(_0x30e583){if(_0x30e583){return _0x3036de[_0x7709('0x17')](_0x43176d)[_0x7709('0x18')](_0x30e583);}};}function respondWithFilteredResult(_0x172936,_0x793584){return function(_0x29b2cf){if(_0x29b2cf){var _0x407632=typeof _0x793584[_0x7709('0x19')]===_0x7709('0x1a')&&typeof _0x793584[_0x7709('0x1b')]==='undefined';var _0x2b2090=_0x29b2cf[_0x7709('0x1c')];var _0xec156a=_0x407632?0x0:_0x793584['offset'];var _0x2db74b=_0x407632?_0x29b2cf['count']:_0x793584['offset']+_0x793584[_0x7709('0x1b')];var _0x13998d;if(_0x2db74b>=_0x2b2090){_0x2db74b=_0x2b2090;_0x13998d=0xc8;}else{_0x13998d=0xce;}_0x172936['status'](_0x13998d);return _0x172936[_0x7709('0x1d')]('Content-Range',_0xec156a+'-'+_0x2db74b+'/'+_0x2b2090)[_0x7709('0x18')](_0x29b2cf);}return null;};}function patchUpdates(_0x5750f3){return function(_0x52fd55){try{jsonpatch[_0x7709('0x1e')](_0x52fd55,_0x5750f3,!![]);}catch(_0x683268){return BPromise['reject'](_0x683268);}return _0x52fd55['save']();};}function saveUpdates(_0x160bb8,_0x5b5b75){return function(_0x30e128){if(_0x30e128){return _0x30e128[_0x7709('0x1f')](_0x160bb8)[_0x7709('0x20')](function(_0x3e3fbe){return _0x3e3fbe;});}return null;};}function removeEntity(_0xd07fe0,_0x487ab){return function(_0x3f0ded){if(_0x3f0ded){return _0x3f0ded[_0x7709('0x21')]()[_0x7709('0x20')](function(){_0xd07fe0[_0x7709('0x17')](0xcc)[_0x7709('0x22')]();});}};}function handleEntityNotFound(_0x35ca8e,_0x4d922d){return function(_0x3ee2d7){if(!_0x3ee2d7){_0x35ca8e[_0x7709('0x23')](0x194);}return _0x3ee2d7;};}function handleError(_0x273e05,_0x490618){_0x490618=_0x490618||0x1f4;return function(_0x332fe3){logger[_0x7709('0x24')](_0x332fe3[_0x7709('0x25')]);if(_0x332fe3['name']){delete _0x332fe3[_0x7709('0x26')];}_0x273e05[_0x7709('0x17')](_0x490618)[_0x7709('0x27')](_0x332fe3);};}exports[_0x7709('0x28')]=function(_0x2fa3da,_0x379f58){var _0x5d473b={},_0x12b925={},_0x1b1580={'count':0x0,'rows':[]};var _0x1429be=_['map'](db['DeskField'][_0x7709('0x29')],function(_0x21c850){return{'name':_0x21c850[_0x7709('0x2a')],'type':_0x21c850['type']['key']};});_0x12b925[_0x7709('0x2b')]=_['map'](_0x1429be,_0x7709('0x26'));_0x12b925['query']=_[_0x7709('0x2c')](_0x2fa3da[_0x7709('0x2d')]);_0x12b925['filters']=_[_0x7709('0x2e')](_0x12b925[_0x7709('0x2b')],_0x12b925[_0x7709('0x2d')]);_0x5d473b[_0x7709('0x2f')]=_['intersection'](_0x12b925[_0x7709('0x2b')],qs['fields'](_0x2fa3da[_0x7709('0x2d')][_0x7709('0x30')]));_0x5d473b['attributes']=_0x5d473b[_0x7709('0x2f')][_0x7709('0x31')]?_0x5d473b['attributes']:_0x12b925[_0x7709('0x2b')];if(!_0x2fa3da[_0x7709('0x2d')]['hasOwnProperty'](_0x7709('0x32'))){_0x5d473b[_0x7709('0x1b')]=qs[_0x7709('0x1b')](_0x2fa3da[_0x7709('0x2d')]['limit']);_0x5d473b[_0x7709('0x19')]=qs[_0x7709('0x19')](_0x2fa3da['query'][_0x7709('0x19')]);}_0x5d473b[_0x7709('0x33')]=qs[_0x7709('0x34')](_0x2fa3da[_0x7709('0x2d')]['sort']);_0x5d473b['where']=qs['filters'](_[_0x7709('0x35')](_0x2fa3da[_0x7709('0x2d')],_0x12b925[_0x7709('0x36')]),_0x1429be);if(_0x2fa3da[_0x7709('0x2d')]['filter']){_0x5d473b[_0x7709('0x37')]=_[_0x7709('0x38')](_0x5d473b[_0x7709('0x37')],{'$or':_['map'](_0x1429be,function(_0xd16dad){if(_0xd16dad[_0x7709('0x39')]!==_0x7709('0x3a')){var _0x13a862={};_0x13a862[_0xd16dad['name']]={'$like':'%'+_0x2fa3da[_0x7709('0x2d')][_0x7709('0x3b')]+'%'};return _0x13a862;}})});}_0x5d473b=_[_0x7709('0x38')]({},_0x5d473b,_0x2fa3da['options']);var _0x15e056={'where':_0x5d473b[_0x7709('0x37')]};return db['DeskField'][_0x7709('0x1c')](_0x15e056)[_0x7709('0x20')](function(_0x40294a){_0x1b1580[_0x7709('0x1c')]=_0x40294a;if(_0x2fa3da['query'][_0x7709('0x3c')]){_0x5d473b['include']=[{'all':!![]}];}return db['DeskField'][_0x7709('0x3d')](_0x5d473b);})[_0x7709('0x20')](function(_0x22807b){_0x1b1580['rows']=_0x22807b;return _0x1b1580;})[_0x7709('0x20')](respondWithFilteredResult(_0x379f58,_0x5d473b))['catch'](handleError(_0x379f58,null));};exports['show']=function(_0x4b6484,_0x4e41ad){var _0x5cf7e0={'raw':!![],'where':{'id':_0x4b6484[_0x7709('0x3e')]['id']}},_0x54d627={};_0x54d627[_0x7709('0x2b')]=_[_0x7709('0x2c')](db[_0x7709('0x3f')][_0x7709('0x29')]);_0x54d627[_0x7709('0x2d')]=_[_0x7709('0x2c')](_0x4b6484[_0x7709('0x2d')]);_0x54d627[_0x7709('0x36')]=_[_0x7709('0x2e')](_0x54d627[_0x7709('0x2b')],_0x54d627[_0x7709('0x2d')]);_0x5cf7e0[_0x7709('0x2f')]=_[_0x7709('0x2e')](_0x54d627['model'],qs['fields'](_0x4b6484['query'][_0x7709('0x30')]));_0x5cf7e0['attributes']=_0x5cf7e0['attributes'][_0x7709('0x31')]?_0x5cf7e0['attributes']:_0x54d627['model'];if(_0x4b6484[_0x7709('0x2d')][_0x7709('0x3c')]){_0x5cf7e0['include']=[{'all':!![]}];}_0x5cf7e0=_[_0x7709('0x38')]({},_0x5cf7e0,_0x4b6484[_0x7709('0x40')]);return db['DeskField'][_0x7709('0x41')](_0x5cf7e0)[_0x7709('0x20')](handleEntityNotFound(_0x4e41ad,null))['then'](respondWithResult(_0x4e41ad,null))['catch'](handleError(_0x4e41ad,null));};exports[_0x7709('0x42')]=function(_0x3ac33f,_0x5808fb){return db[_0x7709('0x3f')][_0x7709('0x42')](_0x3ac33f[_0x7709('0x43')],{})['then'](respondWithResult(_0x5808fb,0xc9))[_0x7709('0x44')](handleError(_0x5808fb,null));};exports[_0x7709('0x1f')]=function(_0x55cf5d,_0x398189){if(_0x55cf5d[_0x7709('0x43')]['id']){delete _0x55cf5d[_0x7709('0x43')]['id'];}return db[_0x7709('0x3f')][_0x7709('0x41')]({'where':{'id':_0x55cf5d[_0x7709('0x3e')]['id']}})['then'](handleEntityNotFound(_0x398189,null))[_0x7709('0x20')](saveUpdates(_0x55cf5d[_0x7709('0x43')],null))['then'](respondWithResult(_0x398189,null))['catch'](handleError(_0x398189,null));};exports[_0x7709('0x21')]=function(_0x6d6243,_0x2e3a9a){return db[_0x7709('0x3f')][_0x7709('0x41')]({'where':{'id':_0x6d6243[_0x7709('0x3e')]['id']}})[_0x7709('0x20')](handleEntityNotFound(_0x2e3a9a,null))['then'](removeEntity(_0x2e3a9a,null))[_0x7709('0x44')](handleError(_0x2e3a9a,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index a5c098c..e2977bb 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 _0xd59b=['idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd59b,0x188));var _0xbd59=function(_0xf5040c,_0x2f314a){_0xf5040c=_0xf5040c-0x0;var _0x1c1134=_0xd59b[_0xf5040c];return _0x1c1134;};'use strict';var _=require(_0xbd59('0x0'));var util=require(_0xbd59('0x1'));var logger=require(_0xbd59('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbd59('0x3'));var rp=require(_0xbd59('0x4'));var fs=require('fs');var path=require(_0xbd59('0x5'));var rimraf=require(_0xbd59('0x6'));var config=require(_0xbd59('0x7'));var attributes=require(_0xbd59('0x8'));module['exports']=function(_0x3ee7dc,_0x2eae26){return _0x3ee7dc[_0xbd59('0x9')](_0xbd59('0xa'),attributes,{'tableName':_0xbd59('0xb'),'paranoid':![],'indexes':[{'name':_0xbd59('0xc'),'fields':[_0xbd59('0xd'),_0xbd59('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x362a=['FieldId','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./intDeskField.attributes','exports','int_desk_fields','desk_unique_index'];(function(_0x47f5a1,_0x1ac565){var _0x1b5fc8=function(_0x36cea2){while(--_0x36cea2){_0x47f5a1['push'](_0x47f5a1['shift']());}};_0x1b5fc8(++_0x1ac565);}(_0x362a,0x1a5));var _0xa362=function(_0x2c7516,_0x2ca7f1){_0x2c7516=_0x2c7516-0x0;var _0x1d76a2=_0x362a[_0x2c7516];return _0x1d76a2;};'use strict';var _=require(_0xa362('0x0'));var util=require('util');var logger=require(_0xa362('0x1'))(_0xa362('0x2'));var moment=require(_0xa362('0x3'));var BPromise=require(_0xa362('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa362('0x5'));var rimraf=require('rimraf');var config=require(_0xa362('0x6'));var attributes=require(_0xa362('0x7'));module[_0xa362('0x8')]=function(_0x5da7a3,_0x10949d){return _0x5da7a3['define']('DeskField',attributes,{'tableName':_0xa362('0x9'),'paranoid':![],'indexes':[{'name':_0xa362('0xa'),'fields':['idField',_0xa362('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 0282de7..86dba6c 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 _0xd349=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x403d4a,_0xf344){var _0x5214a8=function(_0x5aa97e){while(--_0x5aa97e){_0x403d4a['push'](_0x403d4a['shift']());}};_0x5214a8(++_0xf344);}(_0xd349,0xfc));var _0x9d34=function(_0x415ec7,_0xf0ed17){_0x415ec7=_0x415ec7-0x0;var _0x2dcadd=_0xd349[_0x415ec7];return _0x2dcadd;};'use strict';var _=require(_0x9d34('0x0'));var util=require('util');var moment=require(_0x9d34('0x1'));var BPromise=require(_0x9d34('0x2'));var rs=require(_0x9d34('0x3'));var fs=require('fs');var Redis=require(_0x9d34('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d34('0x5'));var logger=require(_0x9d34('0x6'))(_0x9d34('0x7'));var config=require(_0x9d34('0x8'));var jayson=require(_0x9d34('0x9'));var client=jayson[_0x9d34('0xa')][_0x9d34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29ea0b,_0x44c4c3,_0x54105e){return new BPromise(function(_0x261abc,_0x65034b){return client[_0x9d34('0xc')](_0x29ea0b,_0x54105e)[_0x9d34('0xd')](function(_0x2ebfef){logger[_0x9d34('0xe')](_0x9d34('0xf'),_0x44c4c3,_0x9d34('0x10'));logger['debug'](_0x9d34('0x11'),_0x44c4c3,'request\x20sent',JSON['stringify'](_0x2ebfef));if(_0x2ebfef[_0x9d34('0x12')]){if(_0x2ebfef[_0x9d34('0x12')][_0x9d34('0x13')]===0x1f4){logger['error'](_0x9d34('0xf'),_0x44c4c3,_0x2ebfef[_0x9d34('0x12')][_0x9d34('0x14')]);return _0x65034b(_0x2ebfef[_0x9d34('0x12')][_0x9d34('0x14')]);}logger['error'](_0x9d34('0xf'),_0x44c4c3,_0x2ebfef['error'][_0x9d34('0x14')]);return _0x261abc(_0x2ebfef[_0x9d34('0x12')][_0x9d34('0x14')]);}else{logger[_0x9d34('0xe')]('DeskField,\x20%s,\x20%s',_0x44c4c3,_0x9d34('0x10'));_0x261abc(_0x2ebfef[_0x9d34('0x15')][_0x9d34('0x14')]);}})[_0x9d34('0x16')](function(_0x498c97){logger[_0x9d34('0x12')](_0x9d34('0xf'),_0x44c4c3,_0x498c97);_0x65034b(_0x498c97);});});} \ No newline at end of file +var _0x3eb9=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0x3eb9,0xc2));var _0x93eb=function(_0x105a8a,_0x15a3a2){_0x105a8a=_0x105a8a-0x0;var _0x105a0e=_0x3eb9[_0x105a8a];return _0x105a0e;};'use strict';var _=require('lodash');var util=require(_0x93eb('0x0'));var moment=require(_0x93eb('0x1'));var BPromise=require(_0x93eb('0x2'));var rs=require(_0x93eb('0x3'));var fs=require('fs');var Redis=require(_0x93eb('0x4'));var db=require(_0x93eb('0x5'))['db'];var utils=require(_0x93eb('0x6'));var logger=require(_0x93eb('0x7'))(_0x93eb('0x8'));var config=require(_0x93eb('0x9'));var jayson=require(_0x93eb('0xa'));var client=jayson['client'][_0x93eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47cecc,_0x37cfc5,_0x1b2056){return new BPromise(function(_0x5ed118,_0x24d9d9){return client[_0x93eb('0xc')](_0x47cecc,_0x1b2056)['then'](function(_0x1c4b9f){logger[_0x93eb('0xd')](_0x93eb('0xe'),_0x37cfc5,_0x93eb('0xf'));logger[_0x93eb('0x10')](_0x93eb('0x11'),_0x37cfc5,'request\x20sent',JSON['stringify'](_0x1c4b9f));if(_0x1c4b9f[_0x93eb('0x12')]){if(_0x1c4b9f[_0x93eb('0x12')]['code']===0x1f4){logger[_0x93eb('0x12')](_0x93eb('0xe'),_0x37cfc5,_0x1c4b9f[_0x93eb('0x12')]['message']);return _0x24d9d9(_0x1c4b9f['error'][_0x93eb('0x13')]);}logger[_0x93eb('0x12')](_0x93eb('0xe'),_0x37cfc5,_0x1c4b9f[_0x93eb('0x12')][_0x93eb('0x13')]);return _0x5ed118(_0x1c4b9f[_0x93eb('0x12')]['message']);}else{logger[_0x93eb('0xd')]('DeskField,\x20%s,\x20%s',_0x37cfc5,_0x93eb('0xf'));_0x5ed118(_0x1c4b9f[_0x93eb('0x14')][_0x93eb('0x13')]);}})[_0x93eb('0x15')](function(_0x452223){logger[_0x93eb('0x12')](_0x93eb('0xe'),_0x37cfc5,_0x452223);_0x24d9d9(_0x452223);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index d8c56fd..e7d9d1d 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 _0x0f30=['./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','getConfigurations','getFields','post','create','/:id/configurations','put','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5575cd,_0x73ab7a){var _0x4979a0=function(_0x1ac744){while(--_0x1ac744){_0x5575cd['push'](_0x5575cd['shift']());}};_0x4979a0(++_0x73ab7a);}(_0x0f30,0xe1));var _0x00f3=function(_0x1a7a1b,_0x518846){_0x1a7a1b=_0x1a7a1b-0x0;var _0x350750=_0x0f30[_0x1a7a1b];return _0x350750;};'use strict';var multer=require(_0x00f3('0x0'));var util=require(_0x00f3('0x1'));var path=require('path');var timeout=require(_0x00f3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x00f3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x00f3('0x4'));var config=require(_0x00f3('0x5'));var controller=require(_0x00f3('0x6'));router[_0x00f3('0x7')]('/',auth['isAuthenticated'](),controller[_0x00f3('0x8')]);router['get'](_0x00f3('0x9'),auth[_0x00f3('0xa')](),controller[_0x00f3('0xb')]);router[_0x00f3('0x7')]('/:id/configurations',auth[_0x00f3('0xa')](),controller[_0x00f3('0xc')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x00f3('0xd')]);router[_0x00f3('0xe')]('/',auth[_0x00f3('0xa')](),controller[_0x00f3('0xf')]);router[_0x00f3('0xe')](_0x00f3('0x10'),auth[_0x00f3('0xa')](),controller['addConfiguration']);router[_0x00f3('0x11')](_0x00f3('0x9'),auth['isAuthenticated'](),controller[_0x00f3('0x12')]);router['delete']('/:id',auth[_0x00f3('0xa')](),controller[_0x00f3('0x13')]);module[_0x00f3('0x14')]=router; \ No newline at end of file +var _0x70e1=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x70e1,0xfc));var _0x170e=function(_0x48783c,_0x1f986b){_0x48783c=_0x48783c-0x0;var _0x2ce586=_0x70e1[_0x48783c];return _0x2ce586;};'use strict';var multer=require(_0x170e('0x0'));var util=require(_0x170e('0x1'));var path=require('path');var timeout=require(_0x170e('0x2'));var express=require(_0x170e('0x3'));var router=express[_0x170e('0x4')]();var fs_extra=require(_0x170e('0x5'));var auth=require(_0x170e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x170e('0x7'));var controller=require(_0x170e('0x8'));router[_0x170e('0x9')]('/',auth[_0x170e('0xa')](),controller[_0x170e('0xb')]);router[_0x170e('0x9')](_0x170e('0xc'),auth['isAuthenticated'](),controller[_0x170e('0xd')]);router[_0x170e('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x170e('0xe')]);router[_0x170e('0x9')](_0x170e('0xf'),auth['isAuthenticated'](),controller[_0x170e('0x10')]);router[_0x170e('0x11')]('/',auth[_0x170e('0xa')](),controller[_0x170e('0x12')]);router[_0x170e('0x11')](_0x170e('0x13'),auth[_0x170e('0xa')](),controller[_0x170e('0x14')]);router['put'](_0x170e('0xc'),auth[_0x170e('0xa')](),controller[_0x170e('0x15')]);router[_0x170e('0x16')](_0x170e('0xc'),auth['isAuthenticated'](),controller[_0x170e('0x17')]);module[_0x170e('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 72778fa..5952b56 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 _0xe0ae=['STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe0ae,0xa1));var _0xee0a=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0xe0ae[_0x5db99b];return _0x4b2d0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xee0a('0x0')]},'username':{'type':Sequelize[_0xee0a('0x0')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xee0a('0x0')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xee0a('0x0')]},'clientSecret':{'type':Sequelize[_0xee0a('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xee0a('0x0')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x8f9d=['STRING','sequelize'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8f9d,0x93));var _0xd8f9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8f9d[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xd8f9('0x0'));module['exports']={'name':{'type':Sequelize[_0xd8f9('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd8f9('0x1')]},'remoteUri':{'type':Sequelize[_0xd8f9('0x1')]},'tenantId':{'type':Sequelize[_0xd8f9('0x1')]},'clientId':{'type':Sequelize[_0xd8f9('0x1')]},'clientSecret':{'type':Sequelize[_0xd8f9('0x1')]},'serverUrl':{'type':Sequelize[_0xd8f9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd8f9('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 12e492b..c33b4f8 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 _0x301e=['accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridname','owneridtype','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','findOne','username','password','remoteUri','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','https://login.microsoftonline.com/','tenantId','/oauth2/token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','EntityDefinitions(','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','GET',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../config/logger','api','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','end','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','catch','find','create','body','params','getConfigurations','Dynamics365Configuration','rawAttributes','addConfiguration','AccountId','getSubjects','getDescriptions','channel','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','customerid','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x301e,0x6e));var _0xe301=function(_0x31d022,_0x40d762){_0x31d022=_0x31d022-0x0;var _0x769256=_0x301e[_0x31d022];return _0x769256;};'use strict';var rp=require(_0xe301('0x0'));var util=require(_0xe301('0x1'));var _=require(_0xe301('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xe301('0x3'))(_0xe301('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe301('0x5'));function respondWithResult(_0xfec67b,_0x2192c6){_0x2192c6=_0x2192c6||0xc8;return function(_0x4391b6){if(_0x4391b6){return _0xfec67b[_0xe301('0x6')](_0x2192c6)['json'](_0x4391b6);}};}function respondWithFilteredResult(_0x33b2a6,_0x230946){return function(_0x3edea1){if(_0x3edea1){var _0x36357d=typeof _0x230946[_0xe301('0x7')]===_0xe301('0x8')&&typeof _0x230946[_0xe301('0x9')]===_0xe301('0x8');var _0xaa4b2=_0x3edea1[_0xe301('0xa')];var _0x4c4d2c=_0x36357d?0x0:_0x230946[_0xe301('0x7')];var _0x4b528c=_0x36357d?_0x3edea1[_0xe301('0xa')]:_0x230946['offset']+_0x230946[_0xe301('0x9')];var _0x279167;if(_0x4b528c>=_0xaa4b2){_0x4b528c=_0xaa4b2;_0x279167=0xc8;}else{_0x279167=0xce;}_0x33b2a6[_0xe301('0x6')](_0x279167);return _0x33b2a6[_0xe301('0xb')](_0xe301('0xc'),_0x4c4d2c+'-'+_0x4b528c+'/'+_0xaa4b2)[_0xe301('0xd')](_0x3edea1);}return null;};}function saveUpdates(_0x9400ef){return function(_0x5132d1){if(_0x5132d1){return _0x5132d1[_0xe301('0xe')](_0x9400ef)[_0xe301('0xf')](function(_0xd4ea1){return _0xd4ea1;});}return null;};}function removeEntity(_0xca2b87){return function(_0x2aba8f){if(_0x2aba8f){return _0x2aba8f[_0xe301('0x10')]()[_0xe301('0xf')](function(){_0xca2b87[_0xe301('0x6')](0xcc)[_0xe301('0x11')]();});}};}function handleEntityNotFound(_0x3a362a){return function(_0x4525c8){if(!_0x4525c8){_0x3a362a['sendStatus'](0x194);}return _0x4525c8;};}function handleError(_0x49af91,_0x24082c){_0x24082c=_0x24082c||0x1f4;return function(_0x33b871){logger['error'](_0x33b871[_0xe301('0x12')]);if(_0x33b871[_0xe301('0x13')]){delete _0x33b871['name'];}_0x49af91[_0xe301('0x6')](_0x24082c)[_0xe301('0x14')](_0x33b871);};}exports[_0xe301('0x15')]=function(_0x54fef4,_0x5f1806){var _0x38fbf8={},_0x536499={},_0xe9a343={'count':0x0,'rows':[]};var _0xcb9753=_[_0xe301('0x16')](db['Dynamics365Account']['rawAttributes'],function(_0x4e39ba){return{'name':_0x4e39ba[_0xe301('0x17')],'type':_0x4e39ba['type'][_0xe301('0x18')]};});_0x536499[_0xe301('0x19')]=_['map'](_0xcb9753,_0xe301('0x13'));_0x536499[_0xe301('0x1a')]=_[_0xe301('0x1b')](_0x54fef4[_0xe301('0x1a')]);_0x536499[_0xe301('0x1c')]=_[_0xe301('0x1d')](_0x536499[_0xe301('0x19')],_0x536499[_0xe301('0x1a')]);_0x38fbf8[_0xe301('0x1e')]=_[_0xe301('0x1d')](_0x536499['model'],qs[_0xe301('0x1f')](_0x54fef4[_0xe301('0x1a')][_0xe301('0x1f')]));_0x38fbf8[_0xe301('0x1e')]=_0x38fbf8[_0xe301('0x1e')][_0xe301('0x20')]?_0x38fbf8['attributes']:_0x536499[_0xe301('0x19')];if(!_0x54fef4['query'][_0xe301('0x21')](_0xe301('0x22'))){_0x38fbf8[_0xe301('0x9')]=qs[_0xe301('0x9')](_0x54fef4[_0xe301('0x1a')]['limit']);_0x38fbf8[_0xe301('0x7')]=qs['offset'](_0x54fef4[_0xe301('0x1a')][_0xe301('0x7')]);}_0x38fbf8[_0xe301('0x23')]=qs['sort'](_0x54fef4[_0xe301('0x1a')][_0xe301('0x24')]);_0x38fbf8[_0xe301('0x25')]=qs[_0xe301('0x1c')](_[_0xe301('0x26')](_0x54fef4[_0xe301('0x1a')],_0x536499[_0xe301('0x1c')]),_0xcb9753);if(_0x54fef4[_0xe301('0x1a')][_0xe301('0x27')]){_0x38fbf8[_0xe301('0x25')]=_[_0xe301('0x28')](_0x38fbf8['where'],{'$or':_['map'](_0xcb9753,function(_0x28e2f2){if(_0x28e2f2[_0xe301('0x29')]!==_0xe301('0x2a')){var _0x270558={};_0x270558[_0x28e2f2[_0xe301('0x13')]]={'$like':'%'+_0x54fef4[_0xe301('0x1a')]['filter']+'%'};return _0x270558;}})});}_0x38fbf8=_[_0xe301('0x28')]({},_0x38fbf8,_0x54fef4[_0xe301('0x2b')]);var _0x1d8168={'where':_0x38fbf8[_0xe301('0x25')]};return db[_0xe301('0x2c')]['count'](_0x1d8168)[_0xe301('0xf')](function(_0xfca119){_0xe9a343['count']=_0xfca119;if(_0x54fef4[_0xe301('0x1a')][_0xe301('0x2d')]){_0x38fbf8[_0xe301('0x2e')]=[{'all':!![]}];}return db[_0xe301('0x2c')][_0xe301('0x2f')](_0x38fbf8);})[_0xe301('0xf')](function(_0x30c3a9){_0xe9a343[_0xe301('0x30')]=_0x30c3a9;return _0xe9a343;})[_0xe301('0xf')](respondWithFilteredResult(_0x5f1806,_0x38fbf8))[_0xe301('0x31')](handleError(_0x5f1806,null));};exports['show']=function(_0x433f91,_0x32df29){var _0x390eba={'raw':![],'where':{'id':_0x433f91['params']['id']}},_0x948b9={};_0x948b9[_0xe301('0x19')]=_[_0xe301('0x1b')](db[_0xe301('0x2c')]['rawAttributes']);_0x948b9['query']=_[_0xe301('0x1b')](_0x433f91['query']);_0x948b9[_0xe301('0x1c')]=_[_0xe301('0x1d')](_0x948b9[_0xe301('0x19')],_0x948b9[_0xe301('0x1a')]);_0x390eba[_0xe301('0x1e')]=_[_0xe301('0x1d')](_0x948b9[_0xe301('0x19')],qs['fields'](_0x433f91[_0xe301('0x1a')][_0xe301('0x1f')]));_0x390eba[_0xe301('0x1e')]=_0x390eba[_0xe301('0x1e')][_0xe301('0x20')]?_0x390eba[_0xe301('0x1e')]:_0x948b9['model'];if(_0x433f91[_0xe301('0x1a')][_0xe301('0x2d')]){_0x390eba[_0xe301('0x2e')]=[{'all':!![]}];}_0x390eba=_['merge']({},_0x390eba,_0x433f91[_0xe301('0x2b')]);return db['Dynamics365Account'][_0xe301('0x32')](_0x390eba)[_0xe301('0xf')](handleEntityNotFound(_0x32df29,null))[_0xe301('0xf')](respondWithResult(_0x32df29,null))[_0xe301('0x31')](handleError(_0x32df29,null));};exports[_0xe301('0x33')]=function(_0x19c13b,_0x433f39){return db['Dynamics365Account']['create'](_0x19c13b[_0xe301('0x34')],{})['then'](respondWithResult(_0x433f39,0xc9))['catch'](handleError(_0x433f39,null));};exports['update']=function(_0x258340,_0x31bdd5){if(_0x258340[_0xe301('0x34')]['id']){delete _0x258340[_0xe301('0x34')]['id'];}return db[_0xe301('0x2c')][_0xe301('0x32')]({'where':{'id':_0x258340[_0xe301('0x35')]['id']}})[_0xe301('0xf')](handleEntityNotFound(_0x31bdd5,null))['then'](saveUpdates(_0x258340['body'],null))[_0xe301('0xf')](respondWithResult(_0x31bdd5,null))[_0xe301('0x31')](handleError(_0x31bdd5,null));};exports[_0xe301('0x10')]=function(_0x58f4e0,_0x32f388){return db['Dynamics365Account']['find']({'where':{'id':_0x58f4e0[_0xe301('0x35')]['id']}})[_0xe301('0xf')](handleEntityNotFound(_0x32f388,null))[_0xe301('0xf')](removeEntity(_0x32f388,null))[_0xe301('0x31')](handleError(_0x32f388,null));};exports[_0xe301('0x36')]=function(_0x49b5d5,_0x394a95){var _0x4b3e16={};var _0x353a59={};var _0xe649c3;var _0x2a145c;return db['Dynamics365Account']['findOne']({'where':{'id':_0x49b5d5['params']['id']}})[_0xe301('0xf')](handleEntityNotFound(_0x394a95,null))[_0xe301('0xf')](function(_0x3cbec7){if(_0x3cbec7){_0xe649c3=_0x3cbec7;_0x353a59['model']=_[_0xe301('0x1b')](db[_0xe301('0x37')][_0xe301('0x38')]);_0x353a59[_0xe301('0x1a')]=_['keys'](_0x49b5d5['query']);_0x353a59[_0xe301('0x1c')]=_['intersection'](_0x353a59[_0xe301('0x19')],_0x353a59[_0xe301('0x1a')]);_0x4b3e16[_0xe301('0x1e')]=_[_0xe301('0x1d')](_0x353a59['model'],qs[_0xe301('0x1f')](_0x49b5d5[_0xe301('0x1a')][_0xe301('0x1f')]));_0x4b3e16[_0xe301('0x1e')]=_0x4b3e16[_0xe301('0x1e')]['length']?_0x4b3e16[_0xe301('0x1e')]:_0x353a59[_0xe301('0x19')];_0x4b3e16['order']=qs[_0xe301('0x24')](_0x49b5d5[_0xe301('0x1a')][_0xe301('0x24')]);_0x4b3e16[_0xe301('0x25')]=qs[_0xe301('0x1c')](_['pick'](_0x49b5d5[_0xe301('0x1a')],_0x353a59[_0xe301('0x1c')]));if(_0x49b5d5[_0xe301('0x1a')][_0xe301('0x27')]){_0x4b3e16[_0xe301('0x25')]=_[_0xe301('0x28')](_0x4b3e16[_0xe301('0x25')],{'$or':_['map'](_0x4b3e16[_0xe301('0x1e')],function(_0x123c8e){var _0x282707={};_0x282707[_0x123c8e]={'$like':'%'+_0x49b5d5[_0xe301('0x1a')]['filter']+'%'};return _0x282707;})});}_0x4b3e16=_[_0xe301('0x28')]({},_0x4b3e16,_0x49b5d5['options']);return _0xe649c3[_0xe301('0x36')](_0x4b3e16);}})[_0xe301('0xf')](function(_0x128886){if(_0x128886){_0x2a145c=_0x128886[_0xe301('0x20')];if(!_0x49b5d5[_0xe301('0x1a')]['hasOwnProperty'](_0xe301('0x22'))){_0x4b3e16[_0xe301('0x9')]=qs['limit'](_0x49b5d5[_0xe301('0x1a')]['limit']);_0x4b3e16['offset']=qs[_0xe301('0x7')](_0x49b5d5['query']['offset']);}return _0xe649c3['getConfigurations'](_0x4b3e16);}})['then'](function(_0x294131){if(_0x294131){return _0x294131?{'count':_0x2a145c,'rows':_0x294131}:null;}})[_0xe301('0xf')](respondWithResult(_0x394a95,null))[_0xe301('0x31')](handleError(_0x394a95,null));};exports[_0xe301('0x39')]=function(_0x546b14,_0x49848b){if(_0x546b14[_0xe301('0x34')]['id']){delete _0x546b14[_0xe301('0x34')]['id'];}return db[_0xe301('0x2c')]['findOne']({'where':{'id':_0x546b14['params']['id']}})[_0xe301('0xf')](handleEntityNotFound(_0x49848b,null))[_0xe301('0xf')](function(_0x4aaa4a){if(_0x4aaa4a){_0x546b14[_0xe301('0x34')][_0xe301('0x3a')]=_0x4aaa4a['id'];_0x546b14['body']['Subjects']=integrations[_0xe301('0x3b')](_0x546b14[_0xe301('0x34')]['channel'],_0x546b14[_0xe301('0x34')][_0xe301('0x29')]);_0x546b14[_0xe301('0x34')]['Descriptions']=integrations[_0xe301('0x3c')](_0x546b14[_0xe301('0x34')][_0xe301('0x3d')],_0x546b14[_0xe301('0x34')][_0xe301('0x29')]);return db[_0xe301('0x37')][_0xe301('0x33')](_0x546b14[_0xe301('0x34')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0xe301('0x3e')],'as':'Descriptions'}]});}return null;})[_0xe301('0xf')](respondWithResult(_0x49848b,null))[_0xe301('0x31')](handleError(_0x49848b,null));};function sanitizeRemoteUri(_0x41e144){var _0x278917=_0x41e144[_0xe301('0x3f')](-0x1);if(_0x278917==='/')return _0x41e144[_0xe301('0x40')](0x0,_0x41e144[_0xe301('0x41')](_0x278917));return _0x41e144;}function getWebApiUrl(_0x4a7188){return util[_0xe301('0x42')](_0xe301('0x43'),_0x4a7188);}exports['getFields']=function(_0x125e99,_0x4033b8){var _0x536367=_0x125e99['query'][_0xe301('0x44')];var _0x5f306c=_0x536367===_0xe301('0x45')?_0xe301('0x46'):_0xe301('0x47');var _0x471ae8='';var _0x2611c5='';var _0x2806d8='';var _0x373f0b='';var _0x547dfc='';var _0x3d2428='';var _0x13d021='';var _0x5e5cb4='';var _0x3dfa02=[_0xe301('0x48'),'description',_0xe301('0x49'),'ownerid','caseorigincode','subject',_0xe301('0x4a'),_0xe301('0x4b'),_0xe301('0x4c'),_0xe301('0x4d')];var _0x356474=[_0xe301('0x4e'),_0xe301('0x4f'),_0xe301('0x50'),_0xe301('0x51'),'contactidname',_0xe301('0x52'),_0xe301('0x53'),'contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame',_0xe301('0x54'),_0xe301('0x55'),_0xe301('0x56'),_0xe301('0x57'),_0xe301('0x58'),_0xe301('0x59'),_0xe301('0x5a'),_0xe301('0x5b'),_0xe301('0x5c'),_0xe301('0x5d'),_0xe301('0x5e'),_0xe301('0x5f'),_0xe301('0x60'),_0xe301('0x61'),'firstresponsebykpiidname',_0xe301('0x62'),_0xe301('0x63'),'influencescore',_0xe301('0x64'),'lastonholdtime',_0xe301('0x65'),'modifiedbyexternalpartyname',_0xe301('0x66'),_0xe301('0x67'),'modifiedbyyominame','modifiedon',_0xe301('0x68'),_0xe301('0x69'),_0xe301('0x6a'),_0xe301('0x6b'),_0xe301('0x6c'),'onholdtime','overriddencreatedon',_0xe301('0x6d'),_0xe301('0x6e'),'owneridyominame','parentcaseidname',_0xe301('0x6f'),_0xe301('0x70'),_0xe301('0x71'),_0xe301('0x72'),_0xe301('0x73'),_0xe301('0x74'),_0xe301('0x75'),_0xe301('0x76'),'responsiblecontactidname',_0xe301('0x77'),_0xe301('0x78'),_0xe301('0x79'),'slaname',_0xe301('0x7a'),_0xe301('0x7b'),_0xe301('0x7c'),_0xe301('0x7d'),_0xe301('0x7e'),_0xe301('0x7f'),_0xe301('0x80'),_0xe301('0x81'),'utcconversiontimezonecode','versionnumber'];var _0x413249=_0x3dfa02[_0xe301('0x82')](_0x356474);return db[_0xe301('0x2c')][_0xe301('0x83')]({'where':{'id':_0x125e99[_0xe301('0x35')]['id']},'attributes':['id',_0xe301('0x84'),_0xe301('0x85'),_0xe301('0x86'),'tenantId',_0xe301('0x87'),_0xe301('0x88'),_0xe301('0x89')],'include':[{'model':db[_0xe301('0x8a')],'as':_0xe301('0x8a'),'attributes':['id',_0xe301('0x8b'),_0xe301('0x8c')]}]})[_0xe301('0xf')](handleEntityNotFound(_0x4033b8,null))[_0xe301('0xf')](function(_0x2799e8){if(_0x2799e8){if(_0x2799e8[_0xe301('0x89')]){_0x2799e8[_0xe301('0x8d')]=_0x2799e8[_0xe301('0x8a')][_0xe301('0x8b')];_0x5e5cb4=sanitizeRemoteUri(_0x2799e8[_0xe301('0x8a')][_0xe301('0x8c')]);_0x13d021=getWebApiUrl(_0x5e5cb4);return _0x2799e8;}_0x5e5cb4=sanitizeRemoteUri(_0x2799e8['remoteUri']);_0x13d021=getWebApiUrl(_0x5e5cb4);var _0x1a4992={'method':'POST','uri':_0xe301('0x8e')+_0x2799e8[_0xe301('0x8f')]+_0xe301('0x90'),'form':{'client_id':_0x2799e8[_0xe301('0x87')],'resource':_0x5e5cb4,'username':_0x2799e8['username'],'password':_0x2799e8[_0xe301('0x85')],'grant_type':'password','client_secret':_0x2799e8['clientSecret']},'json':!![]};return rp(_0x1a4992);}})[_0xe301('0xf')](function(_0x5ce343){_0x3d2428=_0x5ce343['access_token'];var _0x33d3f4={'method':'GET','uri':encodeURI(_0x13d021+_0xe301('0x91')+_0x5f306c+'\x27'),'headers':{'Authorization':_0xe301('0x92')+_0x3d2428,'If-None-Match':null,'OData-Version':_0xe301('0x93')},'json':!![]};return rp(_0x33d3f4);})[_0xe301('0xf')](function(_0x1ed892){var _0x4d3505=_0x1ed892['value'][0x0];var _0x46db9d=_0x4d3505['MetadataId'];var _0x3e1e57={'method':'GET','uri':_0x13d021+_0xe301('0x94')+_0x46db9d+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x3d2428,'If-None-Match':null,'OData-Version':_0xe301('0x93')},'json':!![]};return rp(_0x3e1e57);})[_0xe301('0xf')](function(_0x5a1527){_0x471ae8=_0x5a1527;_0x2611c5=_0x471ae8[_0xe301('0x95')];_0x2611c5=_[_0xe301('0x96')](_0x2611c5,function(_0x4ec2db){return!_0x413249[_0xe301('0x97')](_0x4ec2db[_0xe301('0x98')]);});var _0x10e6f7=[];var _0x5a486c=[];_0x2611c5[_0xe301('0x99')](function(_0x567849){if(_0x567849[_0xe301('0x9a')]){var _0x59e019=_0x567849[_0xe301('0x9a')]['substring'](_0x567849[_0xe301('0x9a')]['lastIndexOf']('.')+0x1);if(_0x59e019===_0xe301('0x9b')){_0x10e6f7[_0xe301('0x9c')](getSelectList(_0x13d021,_0x536367,_0x5a486c,_0x471ae8['MetadataId'],_0x567849[_0xe301('0x9d')],_0x3d2428));}}});return Promise[_0xe301('0x9e')](_0x10e6f7);})[_0xe301('0xf')](function(_0x22f8f1){_0x2806d8=_0x22f8f1[0x0];var _0x2d8a5=[];var _0x5d1342=[];_0x2611c5[_0xe301('0x99')](function(_0x4fa764){if(!_[_0xe301('0x9f')](_0x4fa764[_0xe301('0x9a')])){var _0x37d6c1=_0x4fa764[_0xe301('0x9a')]['substring'](_0x4fa764[_0xe301('0x9a')][_0xe301('0x41')]('.')+0x1);if(_0x37d6c1===_0xe301('0xa0')){_0x2d8a5[_0xe301('0x9c')](getBooleanList(_0x13d021,_0x536367,_0x5d1342,_0x471ae8[_0xe301('0x9d')],_0x4fa764['MetadataId'],_0x3d2428));}}});return Promise[_0xe301('0x9e')](_0x2d8a5);})[_0xe301('0xf')](function(_0x2c25be){_0x373f0b=_0x2c25be[0x0];var _0x594422=[];var _0x378fd3=[];_0x2611c5[_0xe301('0x99')](function(_0x181dbd){if(_0x181dbd[_0xe301('0x9a')]){var _0x13d15c=_0x181dbd[_0xe301('0x9a')][_0xe301('0x40')](_0x181dbd[_0xe301('0x9a')][_0xe301('0x41')]('.')+0x1);if(_0x13d15c===_0xe301('0xa1')||_0x13d15c===_0xe301('0xa2')||_0x13d15c===_0xe301('0xa3')||_0x13d15c===_0xe301('0xa4')||_0x13d15c==='MemoAttributeMetadata'||_0x13d15c===_0xe301('0xa5')||_0x13d15c===_0xe301('0xa6')||_0x13d15c===_0xe301('0xa7')||_0x13d15c===_0xe301('0xa8')||_0x13d15c===_0xe301('0xa9')){_0x594422['push'](getInputList(_0x13d021,_0x536367,_0x13d15c,_0x378fd3,_0x471ae8['MetadataId'],_0x181dbd[_0xe301('0x9d')],_0x3d2428));}}});return Promise[_0xe301('0x9e')](_0x594422);})[_0xe301('0xf')](function(_0x1abc46){_0x547dfc=_0x1abc46[0x0];var _0x1f73e1=_0x2806d8[_0xe301('0x82')](_0x373f0b)[_0xe301('0x82')](_0x547dfc);var _0x42f3dc={'count':_0x1f73e1['length'],'rows':_0x1f73e1};return _0x42f3dc;})[_0xe301('0xf')](respondWithResult(_0x4033b8,null))[_0xe301('0x31')](function(_0x1a5391){var _0x563e34=_0x125e99['query'][_0xe301('0xaa')]?0x1f4:_0x1a5391[_0xe301('0xab')]||0x1f4;logger['error'](_0x1a5391['stack']);delete _0x1a5391['name'];if(_0x563e34===0x191){_0x563e34=0x190;}_0x4033b8[_0xe301('0x6')](_0x563e34)[_0xe301('0x14')](_0x125e99[_0xe301('0x1a')][_0xe301('0xaa')]?{'message':_0xe301('0xac'),'statusCode':_0x1a5391[_0xe301('0xab')]}:_0x1a5391);});};function getSelectList(_0x164983,_0x36be37,_0x44b46a,_0x16a162,_0x2e9d23,_0xb9cd18){var _0x5dac26={'method':_0xe301('0xad'),'uri':_0x164983+_0xe301('0x94')+_0x16a162+_0xe301('0xae')+_0x2e9d23+_0xe301('0xaf')+_0xe301('0xb0'),'headers':{'Authorization':_0xe301('0x92')+_0xb9cd18,'If-None-Match':null,'OData-Version':_0xe301('0x93')},'json':!![]};return rp(_0x5dac26)['then'](function(_0x555aa0){var _0x1b8000=[];var _0x53da78=_0x555aa0[_0xe301('0xb1')][_0xe301('0xb2')];_0x53da78[_0xe301('0x99')](function(_0x5fe076){_0x1b8000[_0xe301('0x9c')]({'name':_0x5fe076[_0xe301('0xb3')]['UserLocalizedLabel']['Label'],'value':String(_0x5fe076[_0xe301('0xb4')])});});var _0x56fdc7={'id':_0x36be37+'_'+_0x555aa0[_0xe301('0x98')],'name':_0x555aa0[_0xe301('0xb5')][_0xe301('0xb6')][_0xe301('0xb3')],'custom':![],'options':_0x1b8000};_0x44b46a[_0xe301('0x9c')](_0x56fdc7);return _0x44b46a;});}function getBooleanList(_0x3f341a,_0x963dda,_0x146a5a,_0x5cb32c,_0x556d83,_0x2b4ef1){var _0x568008={'method':_0xe301('0xad'),'uri':_0x3f341a+'EntityDefinitions('+_0x5cb32c+_0xe301('0xae')+_0x556d83+_0xe301('0xb7'),'headers':{'Authorization':_0xe301('0x92')+_0x2b4ef1,'If-None-Match':null,'OData-Version':_0xe301('0x93')},'json':!![]};return rp(_0x568008)[_0xe301('0xf')](function(_0x507460){var _0x3a09b9=[];_0x3a09b9['push']({'name':_0x507460[_0xe301('0xb1')][_0xe301('0xb8')][_0xe301('0xb3')][_0xe301('0xb6')][_0xe301('0xb3')],'value':'true'},{'name':_0x507460[_0xe301('0xb1')]['FalseOption'][_0xe301('0xb3')][_0xe301('0xb6')][_0xe301('0xb3')],'value':_0xe301('0xb9')});var _0x492a46={'id':_0x963dda+'_'+_0x507460['LogicalName'],'name':_0x507460['DisplayName'][_0xe301('0xb6')][_0xe301('0xb3')],'custom':![],'options':_0x3a09b9};_0x146a5a[_0xe301('0x9c')](_0x492a46);return _0x146a5a;});}function getInputList(_0x51cba6,_0x390a37,_0x4034c6,_0x1e7ba2,_0x540c37,_0x559dae,_0x2643ad){var _0x44e991={'method':_0xe301('0xad'),'uri':_0x51cba6+'EntityDefinitions('+_0x540c37+_0xe301('0xae')+_0x559dae+_0xe301('0xba')+_0x4034c6+_0xe301('0xbb'),'headers':{'Authorization':'Bearer\x20'+_0x2643ad,'If-None-Match':null,'OData-Version':_0xe301('0x93')},'json':!![]};return rp(_0x44e991)[_0xe301('0xf')](function(_0x1fd13f){var _0x40bc39={'id':_0x390a37+'_'+_0x1fd13f[_0xe301('0x98')],'name':_0x1fd13f[_0xe301('0xb5')]['UserLocalizedLabel']?_0x1fd13f[_0xe301('0xb5')][_0xe301('0xb6')][_0xe301('0xb3')]:_0x1fd13f[_0xe301('0x98')],'custom':![],'options':[]};_0x1e7ba2[_0xe301('0x9c')](_0x40bc39);return _0x1e7ba2;});} \ No newline at end of file +var _0x7daf=['catch','params','options','find','create','body','getConfigurations','Dynamics365Configuration','pick','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','slice','lastIndexOf','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','concat','username','clientId','clientSecret','modernAuthentication','CloudProvider','data5','access_token','data7','remoteUri','https://login.microsoftonline.com/','/oauth2/token','password','GET','4.0','value','MetadataId','Bearer\x20','includes','LogicalName','@odata.type','substring','PicklistAttributeMetadata','push','forEach','BooleanAttributeMetadata','all','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','test','statusCode','send','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','index','map','Dynamics365Account','rawAttributes','fieldName','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows'];(function(_0x51290d,_0x51704b){var _0x36acf8=function(_0x1589d3){while(--_0x1589d3){_0x51290d['push'](_0x51290d['shift']());}};_0x36acf8(++_0x51704b);}(_0x7daf,0x84));var _0xf7da=function(_0x2454da,_0x4fd1ec){_0x2454da=_0x2454da-0x0;var _0x10e3a0=_0x7daf[_0x2454da];return _0x10e3a0;};'use strict';var rp=require(_0xf7da('0x0'));var util=require(_0xf7da('0x1'));var _=require(_0xf7da('0x2'));var qs=require(_0xf7da('0x3'));var logger=require('../../config/logger')(_0xf7da('0x4'));var db=require(_0xf7da('0x5'))['db'];var integrations=require(_0xf7da('0x6'));function respondWithResult(_0x422da9,_0x52283d){_0x52283d=_0x52283d||0xc8;return function(_0x1d8c2d){if(_0x1d8c2d){return _0x422da9[_0xf7da('0x7')](_0x52283d)[_0xf7da('0x8')](_0x1d8c2d);}};}function respondWithFilteredResult(_0x3149fb,_0x3bf9c4){return function(_0x251b84){if(_0x251b84){var _0x1be3ad=typeof _0x3bf9c4[_0xf7da('0x9')]===_0xf7da('0xa')&&typeof _0x3bf9c4[_0xf7da('0xb')]==='undefined';var _0x3d5693=_0x251b84['count'];var _0x304b07=_0x1be3ad?0x0:_0x3bf9c4[_0xf7da('0x9')];var _0x4bb8c1=_0x1be3ad?_0x251b84[_0xf7da('0xc')]:_0x3bf9c4[_0xf7da('0x9')]+_0x3bf9c4[_0xf7da('0xb')];var _0x1cbcb4;if(_0x4bb8c1>=_0x3d5693){_0x4bb8c1=_0x3d5693;_0x1cbcb4=0xc8;}else{_0x1cbcb4=0xce;}_0x3149fb[_0xf7da('0x7')](_0x1cbcb4);return _0x3149fb[_0xf7da('0xd')](_0xf7da('0xe'),_0x304b07+'-'+_0x4bb8c1+'/'+_0x3d5693)[_0xf7da('0x8')](_0x251b84);}return null;};}function saveUpdates(_0x28574f){return function(_0x20e131){if(_0x20e131){return _0x20e131[_0xf7da('0xf')](_0x28574f)[_0xf7da('0x10')](function(_0x578d10){return _0x578d10;});}return null;};}function removeEntity(_0x2aa173){return function(_0x156ad0){if(_0x156ad0){return _0x156ad0[_0xf7da('0x11')]()[_0xf7da('0x10')](function(){_0x2aa173['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ec09){return function(_0x147798){if(!_0x147798){_0x41ec09[_0xf7da('0x12')](0x194);}return _0x147798;};}function handleError(_0x4871be,_0x1a5bf0){_0x1a5bf0=_0x1a5bf0||0x1f4;return function(_0x95f5b0){logger[_0xf7da('0x13')](_0x95f5b0[_0xf7da('0x14')]);if(_0x95f5b0[_0xf7da('0x15')]){delete _0x95f5b0[_0xf7da('0x15')];}_0x4871be[_0xf7da('0x7')](_0x1a5bf0)['send'](_0x95f5b0);};}exports[_0xf7da('0x16')]=function(_0x547915,_0x4b3a4e){var _0x2e5a70={},_0x1a3fb4={},_0xd99d11={'count':0x0,'rows':[]};var _0x5a4681=_[_0xf7da('0x17')](db[_0xf7da('0x18')][_0xf7da('0x19')],function(_0x421fd2){return{'name':_0x421fd2[_0xf7da('0x1a')],'type':_0x421fd2['type'][_0xf7da('0x1b')]};});_0x1a3fb4['model']=_[_0xf7da('0x17')](_0x5a4681,_0xf7da('0x15'));_0x1a3fb4['query']=_[_0xf7da('0x1c')](_0x547915[_0xf7da('0x1d')]);_0x1a3fb4[_0xf7da('0x1e')]=_['intersection'](_0x1a3fb4[_0xf7da('0x1f')],_0x1a3fb4[_0xf7da('0x1d')]);_0x2e5a70[_0xf7da('0x20')]=_[_0xf7da('0x21')](_0x1a3fb4[_0xf7da('0x1f')],qs['fields'](_0x547915['query'][_0xf7da('0x22')]));_0x2e5a70[_0xf7da('0x20')]=_0x2e5a70[_0xf7da('0x20')][_0xf7da('0x23')]?_0x2e5a70[_0xf7da('0x20')]:_0x1a3fb4['model'];if(!_0x547915[_0xf7da('0x1d')][_0xf7da('0x24')](_0xf7da('0x25'))){_0x2e5a70['limit']=qs[_0xf7da('0xb')](_0x547915[_0xf7da('0x1d')]['limit']);_0x2e5a70[_0xf7da('0x9')]=qs[_0xf7da('0x9')](_0x547915[_0xf7da('0x1d')][_0xf7da('0x9')]);}_0x2e5a70[_0xf7da('0x26')]=qs[_0xf7da('0x27')](_0x547915[_0xf7da('0x1d')]['sort']);_0x2e5a70[_0xf7da('0x28')]=qs[_0xf7da('0x1e')](_['pick'](_0x547915[_0xf7da('0x1d')],_0x1a3fb4[_0xf7da('0x1e')]),_0x5a4681);if(_0x547915[_0xf7da('0x1d')][_0xf7da('0x29')]){_0x2e5a70[_0xf7da('0x28')]=_[_0xf7da('0x2a')](_0x2e5a70[_0xf7da('0x28')],{'$or':_[_0xf7da('0x17')](_0x5a4681,function(_0x458a4b){if(_0x458a4b['type']!=='VIRTUAL'){var _0xcaf2b={};_0xcaf2b[_0x458a4b[_0xf7da('0x15')]]={'$like':'%'+_0x547915[_0xf7da('0x1d')][_0xf7da('0x29')]+'%'};return _0xcaf2b;}})});}_0x2e5a70=_['merge']({},_0x2e5a70,_0x547915['options']);var _0x3d6aaf={'where':_0x2e5a70[_0xf7da('0x28')]};return db[_0xf7da('0x18')][_0xf7da('0xc')](_0x3d6aaf)[_0xf7da('0x10')](function(_0x18e368){_0xd99d11[_0xf7da('0xc')]=_0x18e368;if(_0x547915[_0xf7da('0x1d')][_0xf7da('0x2b')]){_0x2e5a70[_0xf7da('0x2c')]=[{'all':!![]}];}return db[_0xf7da('0x18')][_0xf7da('0x2d')](_0x2e5a70);})[_0xf7da('0x10')](function(_0xaa0579){_0xd99d11[_0xf7da('0x2e')]=_0xaa0579;return _0xd99d11;})['then'](respondWithFilteredResult(_0x4b3a4e,_0x2e5a70))[_0xf7da('0x2f')](handleError(_0x4b3a4e,null));};exports['show']=function(_0xfc7031,_0x37ec21){var _0x4b57ea={'raw':![],'where':{'id':_0xfc7031[_0xf7da('0x30')]['id']}},_0x4bbc6b={};_0x4bbc6b['model']=_[_0xf7da('0x1c')](db[_0xf7da('0x18')][_0xf7da('0x19')]);_0x4bbc6b[_0xf7da('0x1d')]=_[_0xf7da('0x1c')](_0xfc7031[_0xf7da('0x1d')]);_0x4bbc6b[_0xf7da('0x1e')]=_['intersection'](_0x4bbc6b[_0xf7da('0x1f')],_0x4bbc6b['query']);_0x4b57ea[_0xf7da('0x20')]=_[_0xf7da('0x21')](_0x4bbc6b[_0xf7da('0x1f')],qs[_0xf7da('0x22')](_0xfc7031[_0xf7da('0x1d')][_0xf7da('0x22')]));_0x4b57ea[_0xf7da('0x20')]=_0x4b57ea[_0xf7da('0x20')]['length']?_0x4b57ea[_0xf7da('0x20')]:_0x4bbc6b['model'];if(_0xfc7031[_0xf7da('0x1d')][_0xf7da('0x2b')]){_0x4b57ea['include']=[{'all':!![]}];}_0x4b57ea=_[_0xf7da('0x2a')]({},_0x4b57ea,_0xfc7031[_0xf7da('0x31')]);return db[_0xf7da('0x18')][_0xf7da('0x32')](_0x4b57ea)[_0xf7da('0x10')](handleEntityNotFound(_0x37ec21,null))[_0xf7da('0x10')](respondWithResult(_0x37ec21,null))[_0xf7da('0x2f')](handleError(_0x37ec21,null));};exports[_0xf7da('0x33')]=function(_0x5e4a80,_0xedb9b4){return db[_0xf7da('0x18')]['create'](_0x5e4a80[_0xf7da('0x34')],{})['then'](respondWithResult(_0xedb9b4,0xc9))['catch'](handleError(_0xedb9b4,null));};exports[_0xf7da('0xf')]=function(_0x6b21ee,_0x198d3e){if(_0x6b21ee[_0xf7da('0x34')]['id']){delete _0x6b21ee['body']['id'];}return db[_0xf7da('0x18')][_0xf7da('0x32')]({'where':{'id':_0x6b21ee['params']['id']}})[_0xf7da('0x10')](handleEntityNotFound(_0x198d3e,null))[_0xf7da('0x10')](saveUpdates(_0x6b21ee[_0xf7da('0x34')],null))[_0xf7da('0x10')](respondWithResult(_0x198d3e,null))[_0xf7da('0x2f')](handleError(_0x198d3e,null));};exports[_0xf7da('0x11')]=function(_0x1483ad,_0x330037){return db[_0xf7da('0x18')]['find']({'where':{'id':_0x1483ad[_0xf7da('0x30')]['id']}})['then'](handleEntityNotFound(_0x330037,null))[_0xf7da('0x10')](removeEntity(_0x330037,null))[_0xf7da('0x2f')](handleError(_0x330037,null));};exports[_0xf7da('0x35')]=function(_0x5c23e3,_0x47fc6d){var _0x4f8c3a={};var _0x4a4b03={};var _0x385a24;var _0x500bab;return db[_0xf7da('0x18')]['findOne']({'where':{'id':_0x5c23e3[_0xf7da('0x30')]['id']}})[_0xf7da('0x10')](handleEntityNotFound(_0x47fc6d,null))[_0xf7da('0x10')](function(_0x18c7d4){if(_0x18c7d4){_0x385a24=_0x18c7d4;_0x4a4b03[_0xf7da('0x1f')]=_[_0xf7da('0x1c')](db[_0xf7da('0x36')][_0xf7da('0x19')]);_0x4a4b03[_0xf7da('0x1d')]=_[_0xf7da('0x1c')](_0x5c23e3[_0xf7da('0x1d')]);_0x4a4b03['filters']=_[_0xf7da('0x21')](_0x4a4b03[_0xf7da('0x1f')],_0x4a4b03[_0xf7da('0x1d')]);_0x4f8c3a['attributes']=_[_0xf7da('0x21')](_0x4a4b03[_0xf7da('0x1f')],qs['fields'](_0x5c23e3[_0xf7da('0x1d')]['fields']));_0x4f8c3a[_0xf7da('0x20')]=_0x4f8c3a[_0xf7da('0x20')][_0xf7da('0x23')]?_0x4f8c3a[_0xf7da('0x20')]:_0x4a4b03[_0xf7da('0x1f')];_0x4f8c3a[_0xf7da('0x26')]=qs[_0xf7da('0x27')](_0x5c23e3[_0xf7da('0x1d')]['sort']);_0x4f8c3a['where']=qs['filters'](_[_0xf7da('0x37')](_0x5c23e3['query'],_0x4a4b03['filters']));if(_0x5c23e3[_0xf7da('0x1d')][_0xf7da('0x29')]){_0x4f8c3a[_0xf7da('0x28')]=_[_0xf7da('0x2a')](_0x4f8c3a['where'],{'$or':_[_0xf7da('0x17')](_0x4f8c3a[_0xf7da('0x20')],function(_0x5d5a1b){var _0x5bd26f={};_0x5bd26f[_0x5d5a1b]={'$like':'%'+_0x5c23e3[_0xf7da('0x1d')][_0xf7da('0x29')]+'%'};return _0x5bd26f;})});}_0x4f8c3a=_['merge']({},_0x4f8c3a,_0x5c23e3[_0xf7da('0x31')]);return _0x385a24['getConfigurations'](_0x4f8c3a);}})['then'](function(_0x329326){if(_0x329326){_0x500bab=_0x329326[_0xf7da('0x23')];if(!_0x5c23e3[_0xf7da('0x1d')][_0xf7da('0x24')](_0xf7da('0x25'))){_0x4f8c3a[_0xf7da('0xb')]=qs[_0xf7da('0xb')](_0x5c23e3['query'][_0xf7da('0xb')]);_0x4f8c3a['offset']=qs[_0xf7da('0x9')](_0x5c23e3[_0xf7da('0x1d')][_0xf7da('0x9')]);}return _0x385a24[_0xf7da('0x35')](_0x4f8c3a);}})['then'](function(_0x176261){if(_0x176261){return _0x176261?{'count':_0x500bab,'rows':_0x176261}:null;}})[_0xf7da('0x10')](respondWithResult(_0x47fc6d,null))[_0xf7da('0x2f')](handleError(_0x47fc6d,null));};exports['addConfiguration']=function(_0x464d56,_0x2008da){if(_0x464d56[_0xf7da('0x34')]['id']){delete _0x464d56[_0xf7da('0x34')]['id'];}return db[_0xf7da('0x18')][_0xf7da('0x38')]({'where':{'id':_0x464d56['params']['id']}})[_0xf7da('0x10')](handleEntityNotFound(_0x2008da,null))[_0xf7da('0x10')](function(_0x38cc59){if(_0x38cc59){_0x464d56[_0xf7da('0x34')][_0xf7da('0x39')]=_0x38cc59['id'];_0x464d56[_0xf7da('0x34')][_0xf7da('0x3a')]=integrations[_0xf7da('0x3b')](_0x464d56['body']['channel'],_0x464d56[_0xf7da('0x34')]['type']);_0x464d56[_0xf7da('0x34')][_0xf7da('0x3c')]=integrations[_0xf7da('0x3d')](_0x464d56['body'][_0xf7da('0x3e')],_0x464d56[_0xf7da('0x34')]['type']);return db[_0xf7da('0x36')][_0xf7da('0x33')](_0x464d56[_0xf7da('0x34')],{'include':[{'model':db[_0xf7da('0x3f')],'as':_0xf7da('0x3a')},{'model':db[_0xf7da('0x3f')],'as':_0xf7da('0x3c')}]});}return null;})[_0xf7da('0x10')](respondWithResult(_0x2008da,null))[_0xf7da('0x2f')](handleError(_0x2008da,null));};function sanitizeRemoteUri(_0x399b9b){var _0x1b46e1=_0x399b9b[_0xf7da('0x40')](-0x1);if(_0x1b46e1==='/')return _0x399b9b['substring'](0x0,_0x399b9b[_0xf7da('0x41')](_0x1b46e1));return _0x399b9b;}function getWebApiUrl(_0x29a27d){return util['format']('%s/api/data/v9.0/',_0x29a27d);}exports[_0xf7da('0x42')]=function(_0x1c25a0,_0x559e6c){var _0x4e9d59=_0x1c25a0[_0xf7da('0x1d')][_0xf7da('0x43')];var _0x58c7c9=_0x4e9d59===_0xf7da('0x44')?_0xf7da('0x45'):_0xf7da('0x46');var _0x289d20='';var _0x598645='';var _0x4bd751='';var _0x22c3f9='';var _0xbc35d6='';var _0x52303c='';var _0x540795='';var _0x120e43='';var _0x4d4a55=['title',_0xf7da('0x47'),_0xf7da('0x48'),_0xf7da('0x49'),_0xf7da('0x4a'),_0xf7da('0x4b'),_0xf7da('0x4c'),'regardingobjectid',_0xf7da('0x4d'),_0xf7da('0x4e')];var _0x9dbf8f=[_0xf7da('0x4f'),_0xf7da('0x50'),'actualserviceunits','billedserviceunits',_0xf7da('0x51'),'contactidyominame',_0xf7da('0x52'),_0xf7da('0x53'),_0xf7da('0x54'),'createdbyexternalpartyyominame','createdbyname',_0xf7da('0x55'),'createdon','createdonbehalfbyname','createdonbehalfbyyominame',_0xf7da('0x56'),_0xf7da('0x57'),'customeridyominame',_0xf7da('0x58'),_0xf7da('0x59'),_0xf7da('0x5a'),_0xf7da('0x5b'),'escalatedon','exchangerate',_0xf7da('0x5c'),'followupby',_0xf7da('0x5d'),_0xf7da('0x5e'),_0xf7da('0x5f'),'lastonholdtime',_0xf7da('0x60'),_0xf7da('0x61'),_0xf7da('0x62'),'modifiedbyname',_0xf7da('0x63'),_0xf7da('0x64'),_0xf7da('0x65'),_0xf7da('0x66'),_0xf7da('0x67'),'msdyn_iotalertname','numberofchildincidents',_0xf7da('0x68'),_0xf7da('0x69'),_0xf7da('0x6a'),'owneridtype',_0xf7da('0x6b'),_0xf7da('0x6c'),_0xf7da('0x6d'),_0xf7da('0x6e'),_0xf7da('0x6f'),_0xf7da('0x70'),'productserialnumber',_0xf7da('0x71'),_0xf7da('0x72'),_0xf7da('0x73'),_0xf7da('0x74'),'responsiblecontactidyominame',_0xf7da('0x75'),_0xf7da('0x76'),_0xf7da('0x77'),_0xf7da('0x78'),_0xf7da('0x79'),'statuscode',_0xf7da('0x7a'),_0xf7da('0x7b'),_0xf7da('0x7c'),_0xf7da('0x7d'),'traversedpath','utcconversiontimezonecode','versionnumber'];var _0x48dff9=_0x4d4a55[_0xf7da('0x7e')](_0x9dbf8f);return db[_0xf7da('0x18')][_0xf7da('0x38')]({'where':{'id':_0x1c25a0[_0xf7da('0x30')]['id']},'attributes':['id',_0xf7da('0x7f'),'password','remoteUri','tenantId',_0xf7da('0x80'),_0xf7da('0x81'),_0xf7da('0x82')],'include':[{'model':db[_0xf7da('0x83')],'as':'CloudProvider','attributes':['id',_0xf7da('0x84'),'data7']}]})['then'](handleEntityNotFound(_0x559e6c,null))[_0xf7da('0x10')](function(_0x89dacc){if(_0x89dacc){if(_0x89dacc[_0xf7da('0x82')]){_0x89dacc[_0xf7da('0x85')]=_0x89dacc[_0xf7da('0x83')][_0xf7da('0x84')];_0x120e43=sanitizeRemoteUri(_0x89dacc[_0xf7da('0x83')][_0xf7da('0x86')]);_0x540795=getWebApiUrl(_0x120e43);return _0x89dacc;}_0x120e43=sanitizeRemoteUri(_0x89dacc[_0xf7da('0x87')]);_0x540795=getWebApiUrl(_0x120e43);var _0x15351a={'method':'POST','uri':_0xf7da('0x88')+_0x89dacc['tenantId']+_0xf7da('0x89'),'form':{'client_id':_0x89dacc['clientId'],'resource':_0x120e43,'username':_0x89dacc[_0xf7da('0x7f')],'password':_0x89dacc[_0xf7da('0x8a')],'grant_type':_0xf7da('0x8a'),'client_secret':_0x89dacc[_0xf7da('0x81')]},'json':!![]};return rp(_0x15351a);}})['then'](function(_0x5cb426){_0x52303c=_0x5cb426['access_token'];var _0x42410a={'method':_0xf7da('0x8b'),'uri':encodeURI(_0x540795+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x58c7c9+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x52303c,'If-None-Match':null,'OData-Version':_0xf7da('0x8c')},'json':!![]};return rp(_0x42410a);})[_0xf7da('0x10')](function(_0x3ca64c){var _0x50db3d=_0x3ca64c[_0xf7da('0x8d')][0x0];var _0x5652cb=_0x50db3d[_0xf7da('0x8e')];var _0x29167f={'method':'GET','uri':_0x540795+'EntityDefinitions('+_0x5652cb+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xf7da('0x8f')+_0x52303c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x29167f);})[_0xf7da('0x10')](function(_0x3224c3){_0x289d20=_0x3224c3;_0x598645=_0x289d20['Attributes'];_0x598645=_['remove'](_0x598645,function(_0x1c0628){return!_0x48dff9[_0xf7da('0x90')](_0x1c0628[_0xf7da('0x91')]);});var _0x2ec543=[];var _0x3ee8de=[];_0x598645['forEach'](function(_0x4836c9){if(_0x4836c9[_0xf7da('0x92')]){var _0x2b9475=_0x4836c9[_0xf7da('0x92')][_0xf7da('0x93')](_0x4836c9[_0xf7da('0x92')][_0xf7da('0x41')]('.')+0x1);if(_0x2b9475===_0xf7da('0x94')){_0x2ec543[_0xf7da('0x95')](getSelectList(_0x540795,_0x4e9d59,_0x3ee8de,_0x289d20[_0xf7da('0x8e')],_0x4836c9[_0xf7da('0x8e')],_0x52303c));}}});return Promise['all'](_0x2ec543);})[_0xf7da('0x10')](function(_0x455bcd){_0x4bd751=_0x455bcd[0x0];var _0x576f15=[];var _0x1d8f8c=[];_0x598645[_0xf7da('0x96')](function(_0x473da7){if(!_['isNil'](_0x473da7[_0xf7da('0x92')])){var _0x497c86=_0x473da7[_0xf7da('0x92')][_0xf7da('0x93')](_0x473da7[_0xf7da('0x92')][_0xf7da('0x41')]('.')+0x1);if(_0x497c86===_0xf7da('0x97')){_0x576f15['push'](getBooleanList(_0x540795,_0x4e9d59,_0x1d8f8c,_0x289d20['MetadataId'],_0x473da7['MetadataId'],_0x52303c));}}});return Promise[_0xf7da('0x98')](_0x576f15);})['then'](function(_0x14a7f9){_0x22c3f9=_0x14a7f9[0x0];var _0x511533=[];var _0x51f76f=[];_0x598645[_0xf7da('0x96')](function(_0x498d1c){if(_0x498d1c[_0xf7da('0x92')]){var _0x553042=_0x498d1c[_0xf7da('0x92')][_0xf7da('0x93')](_0x498d1c[_0xf7da('0x92')][_0xf7da('0x41')]('.')+0x1);if(_0x553042===_0xf7da('0x99')||_0x553042==='DoubleAttributeMetadata'||_0x553042===_0xf7da('0x9a')||_0x553042===_0xf7da('0x9b')||_0x553042==='MemoAttributeMetadata'||_0x553042===_0xf7da('0x9c')||_0x553042===_0xf7da('0x9d')||_0x553042==='EntityNameAttributeMetadata'||_0x553042===_0xf7da('0x9e')||_0x553042==='DecimalAttributeMetadata'){_0x511533[_0xf7da('0x95')](getInputList(_0x540795,_0x4e9d59,_0x553042,_0x51f76f,_0x289d20['MetadataId'],_0x498d1c[_0xf7da('0x8e')],_0x52303c));}}});return Promise[_0xf7da('0x98')](_0x511533);})[_0xf7da('0x10')](function(_0xac68f4){_0xbc35d6=_0xac68f4[0x0];var _0x588665=_0x4bd751[_0xf7da('0x7e')](_0x22c3f9)[_0xf7da('0x7e')](_0xbc35d6);var _0x2504b8={'count':_0x588665[_0xf7da('0x23')],'rows':_0x588665};return _0x2504b8;})[_0xf7da('0x10')](respondWithResult(_0x559e6c,null))['catch'](function(_0x2607e3){var _0x3dd36e=_0x1c25a0['query'][_0xf7da('0x9f')]?0x1f4:_0x2607e3[_0xf7da('0xa0')]||0x1f4;logger[_0xf7da('0x13')](_0x2607e3['stack']);delete _0x2607e3[_0xf7da('0x15')];if(_0x3dd36e===0x191){_0x3dd36e=0x190;}_0x559e6c[_0xf7da('0x7')](_0x3dd36e)[_0xf7da('0xa1')](_0x1c25a0[_0xf7da('0x1d')][_0xf7da('0x9f')]?{'message':_0xf7da('0xa2'),'statusCode':_0x2607e3[_0xf7da('0xa0')]}:_0x2607e3);});};function getSelectList(_0x4f80fe,_0x15072e,_0x55b55e,_0x4ea711,_0x36dad7,_0x234927){var _0x123ba1={'method':_0xf7da('0x8b'),'uri':_0x4f80fe+_0xf7da('0xa3')+_0x4ea711+_0xf7da('0xa4')+_0x36dad7+_0xf7da('0xa5')+_0xf7da('0xa6'),'headers':{'Authorization':_0xf7da('0x8f')+_0x234927,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x123ba1)[_0xf7da('0x10')](function(_0x1dca9b){var _0x1eb628=[];var _0x48a01f=_0x1dca9b[_0xf7da('0xa7')][_0xf7da('0xa8')];_0x48a01f[_0xf7da('0x96')](function(_0x52d7b9){_0x1eb628[_0xf7da('0x95')]({'name':_0x52d7b9[_0xf7da('0xa9')]['UserLocalizedLabel'][_0xf7da('0xa9')],'value':String(_0x52d7b9[_0xf7da('0xaa')])});});var _0xe2b24c={'id':_0x15072e+'_'+_0x1dca9b['LogicalName'],'name':_0x1dca9b[_0xf7da('0xab')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x1eb628};_0x55b55e[_0xf7da('0x95')](_0xe2b24c);return _0x55b55e;});}function getBooleanList(_0xc0121e,_0x5db135,_0x325fb0,_0x7b80e0,_0x202d1e,_0x2d98de){var _0x474023={'method':_0xf7da('0x8b'),'uri':_0xc0121e+'EntityDefinitions('+_0x7b80e0+_0xf7da('0xa4')+_0x202d1e+_0xf7da('0xac'),'headers':{'Authorization':_0xf7da('0x8f')+_0x2d98de,'If-None-Match':null,'OData-Version':_0xf7da('0x8c')},'json':!![]};return rp(_0x474023)[_0xf7da('0x10')](function(_0x32a87b){var _0x2a4d06=[];_0x2a4d06[_0xf7da('0x95')]({'name':_0x32a87b[_0xf7da('0xa7')][_0xf7da('0xad')][_0xf7da('0xa9')][_0xf7da('0xae')]['Label'],'value':_0xf7da('0xaf')},{'name':_0x32a87b[_0xf7da('0xa7')][_0xf7da('0xb0')][_0xf7da('0xa9')][_0xf7da('0xae')][_0xf7da('0xa9')],'value':_0xf7da('0xb1')});var _0x8a797={'id':_0x5db135+'_'+_0x32a87b[_0xf7da('0x91')],'name':_0x32a87b[_0xf7da('0xab')][_0xf7da('0xae')][_0xf7da('0xa9')],'custom':![],'options':_0x2a4d06};_0x325fb0[_0xf7da('0x95')](_0x8a797);return _0x325fb0;});}function getInputList(_0x45d480,_0x5e05e3,_0x46f25d,_0x1a2b7f,_0x550d1a,_0x1d0e67,_0x2fd265){var _0x590983={'method':_0xf7da('0x8b'),'uri':_0x45d480+_0xf7da('0xa3')+_0x550d1a+_0xf7da('0xa4')+_0x1d0e67+_0xf7da('0xb2')+_0x46f25d+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xf7da('0x8f')+_0x2fd265,'If-None-Match':null,'OData-Version':_0xf7da('0x8c')},'json':!![]};return rp(_0x590983)[_0xf7da('0x10')](function(_0x1e864a){var _0x16b43f={'id':_0x5e05e3+'_'+_0x1e864a[_0xf7da('0x91')],'name':_0x1e864a[_0xf7da('0xab')]['UserLocalizedLabel']?_0x1e864a[_0xf7da('0xab')]['UserLocalizedLabel'][_0xf7da('0xa9')]:_0x1e864a[_0xf7da('0x91')],'custom':![],'options':[]};_0x1a2b7f[_0xf7da('0x95')](_0x16b43f);return _0x1a2b7f;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b9c09d2..3183461 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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x409a6,_0x12a0b8){var _0x45c7e1=function(_0x3ada41){while(--_0x3ada41){_0x409a6['push'](_0x409a6['shift']());}};_0x45c7e1(++_0x12a0b8);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e2dee,_0x4b0d60){var _0x6ea27f=function(_0x1f9054){while(--_0x1f9054){_0x5e2dee['push'](_0x5e2dee['shift']());}};_0x6ea27f(++_0x4b0d60);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index a8fb617..bb03a0f 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 _0xb290=['include','model','map','catch','ShowDynamics365Account','find','raw','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','GetDynamics365Account','Dynamics365Account','options','where','attributes','limit'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0xb290,0xc7));var _0x0b29=function(_0x30b406,_0x5d551d){_0x30b406=_0x30b406-0x0;var _0x30b9a0=_0xb290[_0x30b406];return _0x30b9a0;};'use strict';var _=require('lodash');var util=require(_0x0b29('0x0'));var moment=require(_0x0b29('0x1'));var BPromise=require(_0x0b29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0b29('0x3'));var logger=require(_0x0b29('0x4'))(_0x0b29('0x5'));var config=require(_0x0b29('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0b29('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b6967,_0x1e3e0a,_0x48807b){return new BPromise(function(_0x56b86e,_0x152e10){return client['request'](_0x2b6967,_0x48807b)[_0x0b29('0x8')](function(_0x4d635a){logger[_0x0b29('0x9')]('Dynamics365Account,\x20%s,\x20%s',_0x1e3e0a,_0x0b29('0xa'));logger[_0x0b29('0xb')](_0x0b29('0xc'),_0x1e3e0a,'request\x20sent',JSON[_0x0b29('0xd')](_0x4d635a));if(_0x4d635a[_0x0b29('0xe')]){if(_0x4d635a['error'][_0x0b29('0xf')]===0x1f4){logger['error'](_0x0b29('0x10'),_0x1e3e0a,_0x4d635a[_0x0b29('0xe')]['message']);return _0x152e10(_0x4d635a['error'][_0x0b29('0x11')]);}logger[_0x0b29('0xe')](_0x0b29('0x10'),_0x1e3e0a,_0x4d635a[_0x0b29('0xe')][_0x0b29('0x11')]);return _0x56b86e(_0x4d635a['error'][_0x0b29('0x11')]);}else{logger[_0x0b29('0x9')](_0x0b29('0x10'),_0x1e3e0a,_0x0b29('0xa'));_0x56b86e(_0x4d635a[_0x0b29('0x12')][_0x0b29('0x11')]);}})['catch'](function(_0x58d8bd){logger[_0x0b29('0xe')](_0x0b29('0x10'),_0x1e3e0a,_0x58d8bd);_0x152e10(_0x58d8bd);});});}exports[_0x0b29('0x13')]=function(_0x7c5dd0){var _0x333882=this;return new Promise(function(_0xb3e046,_0x41c734){return db[_0x0b29('0x14')]['findAll']({'raw':_0x7c5dd0['options']?_0x7c5dd0[_0x0b29('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x7c5dd0[_0x0b29('0x15')]?_0x7c5dd0[_0x0b29('0x15')][_0x0b29('0x16')]||null:null,'attributes':_0x7c5dd0[_0x0b29('0x15')]?_0x7c5dd0[_0x0b29('0x15')][_0x0b29('0x17')]||null:null,'limit':_0x7c5dd0[_0x0b29('0x15')]?_0x7c5dd0['options'][_0x0b29('0x18')]||null:null,'include':_0x7c5dd0[_0x0b29('0x15')]?_0x7c5dd0[_0x0b29('0x15')][_0x0b29('0x19')]?_['map'](_0x7c5dd0[_0x0b29('0x15')]['include'],function(_0x4bb4c6){return{'model':db[_0x4bb4c6[_0x0b29('0x1a')]],'as':_0x4bb4c6['as'],'attributes':_0x4bb4c6[_0x0b29('0x17')],'include':_0x4bb4c6[_0x0b29('0x19')]?_[_0x0b29('0x1b')](_0x4bb4c6[_0x0b29('0x19')],function(_0xdcae25){return{'model':db[_0xdcae25['model']],'as':_0xdcae25['as'],'attributes':_0xdcae25[_0x0b29('0x17')],'include':_0xdcae25[_0x0b29('0x19')]?_[_0x0b29('0x1b')](_0xdcae25['include'],function(_0x10f748){return{'model':db[_0x10f748[_0x0b29('0x1a')]],'as':_0x10f748['as'],'attributes':_0x10f748[_0x0b29('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0b29('0x8')](function(_0x2a2cb3){logger[_0x0b29('0x9')](_0x0b29('0x13'),_0x7c5dd0);logger[_0x0b29('0xb')]('GetDynamics365Account',_0x7c5dd0,JSON[_0x0b29('0xd')](_0x2a2cb3));_0xb3e046(_0x2a2cb3);})[_0x0b29('0x1c')](function(_0x25bc3e){logger[_0x0b29('0xe')](_0x0b29('0x13'),_0x25bc3e[_0x0b29('0x11')],_0x7c5dd0);_0x41c734(_0x333882[_0x0b29('0xe')](0x1f4,_0x25bc3e['message']));});});};exports[_0x0b29('0x1d')]=function(_0x4470e4){var _0x4052ac=this;return new Promise(function(_0x38b968,_0x199989){return db['Dynamics365Account'][_0x0b29('0x1e')]({'raw':_0x4470e4[_0x0b29('0x15')]?_0x4470e4[_0x0b29('0x15')][_0x0b29('0x1f')]===undefined?!![]:![]:!![],'where':_0x4470e4['options']?_0x4470e4[_0x0b29('0x15')][_0x0b29('0x16')]||null:null,'attributes':_0x4470e4[_0x0b29('0x15')]?_0x4470e4['options'][_0x0b29('0x17')]||null:null,'include':_0x4470e4[_0x0b29('0x15')]?_0x4470e4[_0x0b29('0x15')][_0x0b29('0x19')]?_[_0x0b29('0x1b')](_0x4470e4['options']['include'],function(_0x1a5d30){return{'model':db[_0x1a5d30[_0x0b29('0x1a')]],'as':_0x1a5d30['as'],'attributes':_0x1a5d30['attributes'],'include':_0x1a5d30[_0x0b29('0x19')]?_['map'](_0x1a5d30[_0x0b29('0x19')],function(_0x25af99){return{'model':db[_0x25af99[_0x0b29('0x1a')]],'as':_0x25af99['as'],'attributes':_0x25af99[_0x0b29('0x17')],'include':_0x25af99[_0x0b29('0x19')]?_[_0x0b29('0x1b')](_0x25af99[_0x0b29('0x19')],function(_0x485600){return{'model':db[_0x485600[_0x0b29('0x1a')]],'as':_0x485600['as'],'attributes':_0x485600[_0x0b29('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0b29('0x8')](function(_0x3edc22){logger[_0x0b29('0x9')](_0x0b29('0x1d'),_0x4470e4);logger[_0x0b29('0xb')](_0x0b29('0x1d'),_0x4470e4,JSON[_0x0b29('0xd')](_0x3edc22));_0x38b968(_0x3edc22);})[_0x0b29('0x1c')](function(_0x244ba0){logger[_0x0b29('0xe')](_0x0b29('0x1d'),_0x244ba0[_0x0b29('0x11')],_0x4470e4);_0x199989(_0x4052ac[_0x0b29('0xe')](0x1f4,_0x244ba0['message']));});});}; \ No newline at end of file +var _0x906a=['error','code','message','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','include','model','map','catch','find','ShowDynamics365Account','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x906a,0x17a));var _0xa906=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x906a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xa906('0x0'));var util=require(_0xa906('0x1'));var moment=require('moment');var BPromise=require(_0xa906('0x2'));var rs=require(_0xa906('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa906('0x4'))['db'];var utils=require(_0xa906('0x5'));var logger=require(_0xa906('0x6'))(_0xa906('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa906('0x8')][_0xa906('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a0e4c,_0xa62da7,_0x5171f4){return new BPromise(function(_0x1df59a,_0x321b4c){return client[_0xa906('0xa')](_0x4a0e4c,_0x5171f4)[_0xa906('0xb')](function(_0x1875af){logger[_0xa906('0xc')](_0xa906('0xd'),_0xa62da7,_0xa906('0xe'));logger[_0xa906('0xf')](_0xa906('0x10'),_0xa62da7,_0xa906('0xe'),JSON[_0xa906('0x11')](_0x1875af));if(_0x1875af[_0xa906('0x12')]){if(_0x1875af['error'][_0xa906('0x13')]===0x1f4){logger['error'](_0xa906('0xd'),_0xa62da7,_0x1875af[_0xa906('0x12')][_0xa906('0x14')]);return _0x321b4c(_0x1875af[_0xa906('0x12')][_0xa906('0x14')]);}logger[_0xa906('0x12')](_0xa906('0xd'),_0xa62da7,_0x1875af['error'][_0xa906('0x14')]);return _0x1df59a(_0x1875af['error'][_0xa906('0x14')]);}else{logger[_0xa906('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0xa62da7,_0xa906('0xe'));_0x1df59a(_0x1875af['result']['message']);}})['catch'](function(_0x161372){logger[_0xa906('0x12')](_0xa906('0xd'),_0xa62da7,_0x161372);_0x321b4c(_0x161372);});});}exports[_0xa906('0x15')]=function(_0x1b4954){var _0x184c55=this;return new Promise(function(_0x173063,_0x231f83){return db[_0xa906('0x16')]['findAll']({'raw':_0x1b4954[_0xa906('0x17')]?_0x1b4954[_0xa906('0x17')][_0xa906('0x18')]===undefined?!![]:![]:!![],'where':_0x1b4954['options']?_0x1b4954[_0xa906('0x17')][_0xa906('0x19')]||null:null,'attributes':_0x1b4954[_0xa906('0x17')]?_0x1b4954[_0xa906('0x17')][_0xa906('0x1a')]||null:null,'limit':_0x1b4954[_0xa906('0x17')]?_0x1b4954['options']['limit']||null:null,'include':_0x1b4954[_0xa906('0x17')]?_0x1b4954['options'][_0xa906('0x1b')]?_['map'](_0x1b4954[_0xa906('0x17')][_0xa906('0x1b')],function(_0x25b6bb){return{'model':db[_0x25b6bb[_0xa906('0x1c')]],'as':_0x25b6bb['as'],'attributes':_0x25b6bb['attributes'],'include':_0x25b6bb['include']?_['map'](_0x25b6bb[_0xa906('0x1b')],function(_0x59f00a){return{'model':db[_0x59f00a[_0xa906('0x1c')]],'as':_0x59f00a['as'],'attributes':_0x59f00a['attributes'],'include':_0x59f00a[_0xa906('0x1b')]?_[_0xa906('0x1d')](_0x59f00a[_0xa906('0x1b')],function(_0x233a13){return{'model':db[_0x233a13[_0xa906('0x1c')]],'as':_0x233a13['as'],'attributes':_0x233a13[_0xa906('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa906('0xb')](function(_0x7be473){logger['info'](_0xa906('0x15'),_0x1b4954);logger[_0xa906('0xf')](_0xa906('0x15'),_0x1b4954,JSON['stringify'](_0x7be473));_0x173063(_0x7be473);})[_0xa906('0x1e')](function(_0x4d3981){logger[_0xa906('0x12')]('GetDynamics365Account',_0x4d3981[_0xa906('0x14')],_0x1b4954);_0x231f83(_0x184c55[_0xa906('0x12')](0x1f4,_0x4d3981['message']));});});};exports['ShowDynamics365Account']=function(_0x2ae37c){var _0x560dd8=this;return new Promise(function(_0x106727,_0x9ccc54){return db[_0xa906('0x16')][_0xa906('0x1f')]({'raw':_0x2ae37c[_0xa906('0x17')]?_0x2ae37c['options'][_0xa906('0x18')]===undefined?!![]:![]:!![],'where':_0x2ae37c['options']?_0x2ae37c[_0xa906('0x17')]['where']||null:null,'attributes':_0x2ae37c[_0xa906('0x17')]?_0x2ae37c['options'][_0xa906('0x1a')]||null:null,'include':_0x2ae37c[_0xa906('0x17')]?_0x2ae37c[_0xa906('0x17')][_0xa906('0x1b')]?_[_0xa906('0x1d')](_0x2ae37c['options'][_0xa906('0x1b')],function(_0x2cb98a){return{'model':db[_0x2cb98a[_0xa906('0x1c')]],'as':_0x2cb98a['as'],'attributes':_0x2cb98a[_0xa906('0x1a')],'include':_0x2cb98a[_0xa906('0x1b')]?_[_0xa906('0x1d')](_0x2cb98a[_0xa906('0x1b')],function(_0x1b888b){return{'model':db[_0x1b888b[_0xa906('0x1c')]],'as':_0x1b888b['as'],'attributes':_0x1b888b['attributes'],'include':_0x1b888b[_0xa906('0x1b')]?_[_0xa906('0x1d')](_0x1b888b['include'],function(_0x2b4fc2){return{'model':db[_0x2b4fc2[_0xa906('0x1c')]],'as':_0x2b4fc2['as'],'attributes':_0x2b4fc2['attributes']};}):[]};}):[]};}):[]:[]})[_0xa906('0xb')](function(_0x554b8c){logger['info'](_0xa906('0x20'),_0x2ae37c);logger[_0xa906('0xf')](_0xa906('0x20'),_0x2ae37c,JSON[_0xa906('0x11')](_0x554b8c));_0x106727(_0x554b8c);})[_0xa906('0x1e')](function(_0x13306b){logger['error'](_0xa906('0x20'),_0x13306b['message'],_0x2ae37c);_0x9ccc54(_0x560dd8[_0xa906('0x12')](0x1f4,_0x13306b['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index c457e22..4f491a5 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 _0xed62=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete'];(function(_0x1b61e3,_0xfbbdba){var _0x54eb54=function(_0x3501f6){while(--_0x3501f6){_0x1b61e3['push'](_0x1b61e3['shift']());}};_0x54eb54(++_0xfbbdba);}(_0xed62,0x139));var _0x2ed6=function(_0x39d25f,_0x2d1355){_0x39d25f=_0x39d25f-0x0;var _0x58f5aa=_0xed62[_0x39d25f];return _0x58f5aa;};'use strict';var multer=require(_0x2ed6('0x0'));var util=require(_0x2ed6('0x1'));var path=require(_0x2ed6('0x2'));var timeout=require(_0x2ed6('0x3'));var express=require('express');var router=express[_0x2ed6('0x4')]();var fs_extra=require(_0x2ed6('0x5'));var auth=require(_0x2ed6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ed6('0x7'));var controller=require(_0x2ed6('0x8'));router['get']('/',auth[_0x2ed6('0x9')](),controller[_0x2ed6('0xa')]);router[_0x2ed6('0xb')]('/:id',auth[_0x2ed6('0x9')](),controller[_0x2ed6('0xc')]);router[_0x2ed6('0xb')](_0x2ed6('0xd'),auth[_0x2ed6('0x9')](),controller[_0x2ed6('0xe')]);router[_0x2ed6('0xb')](_0x2ed6('0xf'),auth['isAuthenticated'](),controller[_0x2ed6('0x10')]);router[_0x2ed6('0xb')](_0x2ed6('0x11'),auth['isAuthenticated'](),controller[_0x2ed6('0x12')]);router[_0x2ed6('0x13')]('/',auth[_0x2ed6('0x9')](),controller[_0x2ed6('0x14')]);router[_0x2ed6('0x15')](_0x2ed6('0x16'),auth[_0x2ed6('0x9')](),controller[_0x2ed6('0x17')]);router[_0x2ed6('0x18')](_0x2ed6('0x16'),auth['isAuthenticated'](),controller['destroy']);module[_0x2ed6('0x19')]=router; \ No newline at end of file +var _0x5227=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5227,0x1d1));var _0x7522=function(_0x2c9cf9,_0x2bed45){_0x2c9cf9=_0x2c9cf9-0x0;var _0x560d6d=_0x5227[_0x2c9cf9];return _0x560d6d;};'use strict';var multer=require(_0x7522('0x0'));var util=require(_0x7522('0x1'));var path=require(_0x7522('0x2'));var timeout=require(_0x7522('0x3'));var express=require(_0x7522('0x4'));var router=express[_0x7522('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7522('0x6'));var interaction=require(_0x7522('0x7'));var config=require(_0x7522('0x8'));var controller=require(_0x7522('0x9'));router['get']('/',auth[_0x7522('0xa')](),controller[_0x7522('0xb')]);router[_0x7522('0xc')](_0x7522('0xd'),auth[_0x7522('0xa')](),controller[_0x7522('0xe')]);router[_0x7522('0xc')](_0x7522('0xf'),auth[_0x7522('0xa')](),controller[_0x7522('0x10')]);router[_0x7522('0xc')](_0x7522('0x11'),auth[_0x7522('0xa')](),controller['getSubjects']);router[_0x7522('0xc')](_0x7522('0x12'),auth[_0x7522('0xa')](),controller[_0x7522('0x13')]);router[_0x7522('0x14')]('/',auth[_0x7522('0xa')](),controller['create']);router[_0x7522('0x15')](_0x7522('0xd'),auth[_0x7522('0xa')](),controller[_0x7522('0x16')]);router[_0x7522('0x17')](_0x7522('0xd'),auth[_0x7522('0xa')](),controller[_0x7522('0x18')]);module[_0x7522('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 854b84a..e42ab3b 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 _0x8caf=['phonecall','contact','nothing','BOOLEAN','sequelize','STRING','ENUM','incident'];(function(_0x3f502a,_0x3e42c4){var _0x545a8f=function(_0x3087cc){while(--_0x3087cc){_0x3f502a['push'](_0x3f502a['shift']());}};_0x545a8f(++_0x3e42c4);}(_0x8caf,0x19c));var _0xf8ca=function(_0x4dde94,_0x52b903){_0x4dde94=_0x4dde94-0x0;var _0x30acf7=_0x8caf[_0x4dde94];return _0x30acf7;};'use strict';var Sequelize=require(_0xf8ca('0x0'));module['exports']={'name':{'type':Sequelize[_0xf8ca('0x1')]},'description':{'type':Sequelize[_0xf8ca('0x1')]},'ticketType':{'type':Sequelize[_0xf8ca('0x2')](_0xf8ca('0x3'),_0xf8ca('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xf8ca('0x2')](_0xf8ca('0x5'),_0xf8ca('0x6')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xf8ca('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xf8ca('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe3e8=['sequelize','exports','STRING','incident','phonecall','ENUM','contact','BOOLEAN'];(function(_0x1a54ba,_0x4d79b8){var _0x4c596a=function(_0x5737b1){while(--_0x5737b1){_0x1a54ba['push'](_0x1a54ba['shift']());}};_0x4c596a(++_0x4d79b8);}(_0xe3e8,0x180));var _0x8e3e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xe3e8[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x8e3e('0x0'));module[_0x8e3e('0x1')]={'name':{'type':Sequelize[_0x8e3e('0x2')]},'description':{'type':Sequelize[_0x8e3e('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x8e3e('0x3'),_0x8e3e('0x4')),'defaultValue':_0x8e3e('0x3')},'moduleCreate':{'type':Sequelize[_0x8e3e('0x5')](_0x8e3e('0x6'),'nothing'),'defaultValue':_0x8e3e('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x8e3e('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 506d84a..5ed4ace 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 _0x9e8c=['update','then','destroy','error','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','count','includeAll','include','findAll','show','params','find','catch','create','body','getFields','findOne','Dynamics365Field','order','pick','filter','options','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9e8c,0x11b));var _0xc9e8=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x9e8c[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xc9e8('0x0'));var rimraf=require(_0xc9e8('0x1'));var zipdir=require(_0xc9e8('0x2'));var jsonpatch=require(_0xc9e8('0x3'));var rp=require(_0xc9e8('0x4'));var moment=require(_0xc9e8('0x5'));var BPromise=require(_0xc9e8('0x6'));var Mustache=require(_0xc9e8('0x7'));var util=require(_0xc9e8('0x8'));var path=require(_0xc9e8('0x9'));var sox=require(_0xc9e8('0xa'));var csv=require(_0xc9e8('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9e8('0xc'));var _=require(_0xc9e8('0xd'));var squel=require('squel');var crypto=require(_0xc9e8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc9e8('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc9e8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc9e8('0x10'));var as=require(_0xc9e8('0x11'));var hardwareService=require(_0xc9e8('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc9e8('0x13'));var licenseUtil=require(_0xc9e8('0x14'));var db=require(_0xc9e8('0x15'))['db'];function respondWithStatusCode(_0x5af57a,_0x412775){_0x412775=_0x412775||0xcc;return function(_0x43b718){if(_0x43b718){return _0x5af57a[_0xc9e8('0x16')](_0x412775);}return _0x5af57a[_0xc9e8('0x17')](_0x412775)[_0xc9e8('0x18')]();};}function respondWithResult(_0x1254e1,_0x2437d7){_0x2437d7=_0x2437d7||0xc8;return function(_0x5e0cba){if(_0x5e0cba){return _0x1254e1[_0xc9e8('0x17')](_0x2437d7)[_0xc9e8('0x19')](_0x5e0cba);}};}function respondWithFilteredResult(_0x534315,_0x41c4c8){return function(_0x3d210e){if(_0x3d210e){var _0x2e70cb=typeof _0x41c4c8[_0xc9e8('0x1a')]==='undefined'&&typeof _0x41c4c8['limit']===_0xc9e8('0x1b');var _0x46e957=_0x3d210e['count'];var _0x1b2e07=_0x2e70cb?0x0:_0x41c4c8[_0xc9e8('0x1a')];var _0x50d717=_0x2e70cb?_0x3d210e['count']:_0x41c4c8['offset']+_0x41c4c8[_0xc9e8('0x1c')];var _0x2c2a95;if(_0x50d717>=_0x46e957){_0x50d717=_0x46e957;_0x2c2a95=0xc8;}else{_0x2c2a95=0xce;}_0x534315[_0xc9e8('0x17')](_0x2c2a95);return _0x534315[_0xc9e8('0x1d')](_0xc9e8('0x1e'),_0x1b2e07+'-'+_0x50d717+'/'+_0x46e957)[_0xc9e8('0x19')](_0x3d210e);}return null;};}function patchUpdates(_0x32e4d8){return function(_0x23a965){try{jsonpatch['apply'](_0x23a965,_0x32e4d8,!![]);}catch(_0x781a6f){return BPromise[_0xc9e8('0x1f')](_0x781a6f);}return _0x23a965[_0xc9e8('0x20')]();};}function saveUpdates(_0x420a4b,_0x3f71a9){return function(_0x3538c7){if(_0x3538c7){return _0x3538c7[_0xc9e8('0x21')](_0x420a4b)[_0xc9e8('0x22')](function(_0x3bc205){return _0x3bc205;});}return null;};}function removeEntity(_0x30083a,_0x389c7c){return function(_0x4bfacd){if(_0x4bfacd){return _0x4bfacd[_0xc9e8('0x23')]()[_0xc9e8('0x22')](function(){_0x30083a['status'](0xcc)[_0xc9e8('0x18')]();});}};}function handleEntityNotFound(_0x1e1275,_0x5cbdd2){return function(_0xcc2e08){if(!_0xcc2e08){_0x1e1275[_0xc9e8('0x16')](0x194);}return _0xcc2e08;};}function handleError(_0xac8e40,_0x36f013){_0x36f013=_0x36f013||0x1f4;return function(_0x1752ae){logger[_0xc9e8('0x24')](_0x1752ae['stack']);if(_0x1752ae[_0xc9e8('0x25')]){delete _0x1752ae[_0xc9e8('0x25')];}_0xac8e40[_0xc9e8('0x17')](_0x36f013)[_0xc9e8('0x26')](_0x1752ae);};}exports[_0xc9e8('0x27')]=function(_0x48cd2f,_0x2695df){var _0x3e71f4={},_0x1cb7a1={},_0x66b3b1={'count':0x0,'rows':[]};var _0x57ee38=_[_0xc9e8('0x28')](db[_0xc9e8('0x29')][_0xc9e8('0x2a')],function(_0x508ab1){return{'name':_0x508ab1[_0xc9e8('0x2b')],'type':_0x508ab1[_0xc9e8('0x2c')][_0xc9e8('0x2d')]};});_0x1cb7a1[_0xc9e8('0x2e')]=_[_0xc9e8('0x28')](_0x57ee38,_0xc9e8('0x25'));_0x1cb7a1[_0xc9e8('0x2f')]=_[_0xc9e8('0x30')](_0x48cd2f[_0xc9e8('0x2f')]);_0x1cb7a1['filters']=_[_0xc9e8('0x31')](_0x1cb7a1[_0xc9e8('0x2e')],_0x1cb7a1[_0xc9e8('0x2f')]);_0x3e71f4[_0xc9e8('0x32')]=_[_0xc9e8('0x31')](_0x1cb7a1[_0xc9e8('0x2e')],qs[_0xc9e8('0x33')](_0x48cd2f[_0xc9e8('0x2f')]['fields']));_0x3e71f4[_0xc9e8('0x32')]=_0x3e71f4[_0xc9e8('0x32')][_0xc9e8('0x34')]?_0x3e71f4[_0xc9e8('0x32')]:_0x1cb7a1['model'];if(!_0x48cd2f[_0xc9e8('0x2f')][_0xc9e8('0x35')](_0xc9e8('0x36'))){_0x3e71f4[_0xc9e8('0x1c')]=qs[_0xc9e8('0x1c')](_0x48cd2f[_0xc9e8('0x2f')][_0xc9e8('0x1c')]);_0x3e71f4['offset']=qs[_0xc9e8('0x1a')](_0x48cd2f['query'][_0xc9e8('0x1a')]);}_0x3e71f4['order']=qs[_0xc9e8('0x37')](_0x48cd2f[_0xc9e8('0x2f')]['sort']);_0x3e71f4[_0xc9e8('0x38')]=qs[_0xc9e8('0x39')](_['pick'](_0x48cd2f[_0xc9e8('0x2f')],_0x1cb7a1[_0xc9e8('0x39')]),_0x57ee38);if(_0x48cd2f[_0xc9e8('0x2f')]['filter']){_0x3e71f4[_0xc9e8('0x38')]=_[_0xc9e8('0x3a')](_0x3e71f4[_0xc9e8('0x38')],{'$or':_['map'](_0x57ee38,function(_0x32fdd4){if(_0x32fdd4[_0xc9e8('0x2c')]!==_0xc9e8('0x3b')){var _0x1af13f={};_0x1af13f[_0x32fdd4[_0xc9e8('0x25')]]={'$like':'%'+_0x48cd2f[_0xc9e8('0x2f')]['filter']+'%'};return _0x1af13f;}})});}_0x3e71f4=_['merge']({},_0x3e71f4,_0x48cd2f['options']);var _0x47a017={'where':_0x3e71f4[_0xc9e8('0x38')]};return db[_0xc9e8('0x29')]['count'](_0x47a017)[_0xc9e8('0x22')](function(_0x147dbf){_0x66b3b1[_0xc9e8('0x3c')]=_0x147dbf;if(_0x48cd2f['query'][_0xc9e8('0x3d')]){_0x3e71f4[_0xc9e8('0x3e')]=[{'all':!![]}];}return db[_0xc9e8('0x29')][_0xc9e8('0x3f')](_0x3e71f4);})[_0xc9e8('0x22')](function(_0x2cadb4){_0x66b3b1['rows']=_0x2cadb4;return _0x66b3b1;})['then'](respondWithFilteredResult(_0x2695df,_0x3e71f4))['catch'](handleError(_0x2695df,null));};exports[_0xc9e8('0x40')]=function(_0x2ea307,_0x5aa55d){var _0x31920c={'raw':![],'where':{'id':_0x2ea307[_0xc9e8('0x41')]['id']}},_0x403bd0={};_0x403bd0['model']=_[_0xc9e8('0x30')](db[_0xc9e8('0x29')][_0xc9e8('0x2a')]);_0x403bd0[_0xc9e8('0x2f')]=_['keys'](_0x2ea307[_0xc9e8('0x2f')]);_0x403bd0[_0xc9e8('0x39')]=_[_0xc9e8('0x31')](_0x403bd0['model'],_0x403bd0[_0xc9e8('0x2f')]);_0x31920c[_0xc9e8('0x32')]=_['intersection'](_0x403bd0['model'],qs[_0xc9e8('0x33')](_0x2ea307[_0xc9e8('0x2f')][_0xc9e8('0x33')]));_0x31920c[_0xc9e8('0x32')]=_0x31920c[_0xc9e8('0x32')][_0xc9e8('0x34')]?_0x31920c[_0xc9e8('0x32')]:_0x403bd0[_0xc9e8('0x2e')];if(_0x2ea307[_0xc9e8('0x2f')][_0xc9e8('0x3d')]){_0x31920c['include']=[{'all':!![]}];}_0x31920c=_[_0xc9e8('0x3a')]({},_0x31920c,_0x2ea307['options']);return db['Dynamics365Configuration'][_0xc9e8('0x42')](_0x31920c)[_0xc9e8('0x22')](handleEntityNotFound(_0x5aa55d,null))[_0xc9e8('0x22')](respondWithResult(_0x5aa55d,null))[_0xc9e8('0x43')](handleError(_0x5aa55d,null));};exports[_0xc9e8('0x44')]=function(_0x43b878,_0x4bbd7e){return db['Dynamics365Configuration'][_0xc9e8('0x44')](_0x43b878[_0xc9e8('0x45')],{})[_0xc9e8('0x22')](respondWithResult(_0x4bbd7e,0xc9))[_0xc9e8('0x43')](handleError(_0x4bbd7e,null));};exports['update']=function(_0x5c2688,_0x2e1ee2){if(_0x5c2688[_0xc9e8('0x45')]['id']){delete _0x5c2688[_0xc9e8('0x45')]['id'];}return db['Dynamics365Configuration'][_0xc9e8('0x42')]({'where':{'id':_0x5c2688['params']['id']}})['then'](handleEntityNotFound(_0x2e1ee2,null))[_0xc9e8('0x22')](saveUpdates(_0x5c2688[_0xc9e8('0x45')],null))[_0xc9e8('0x22')](respondWithResult(_0x2e1ee2,null))[_0xc9e8('0x43')](handleError(_0x2e1ee2,null));};exports[_0xc9e8('0x23')]=function(_0x3cf40a,_0x51ccad){return db[_0xc9e8('0x29')]['find']({'where':{'id':_0x3cf40a[_0xc9e8('0x41')]['id']}})[_0xc9e8('0x22')](handleEntityNotFound(_0x51ccad,null))[_0xc9e8('0x22')](removeEntity(_0x51ccad,null))[_0xc9e8('0x43')](handleError(_0x51ccad,null));};exports[_0xc9e8('0x46')]=function(_0x32252f,_0x567ca6,_0x175ddb){var _0x5542b1={};var _0xe056d5={};var _0xcc3961;var _0x19602e;return db['Dynamics365Configuration'][_0xc9e8('0x47')]({'where':{'id':_0x32252f['params']['id']}})[_0xc9e8('0x22')](handleEntityNotFound(_0x567ca6,null))['then'](function(_0x175e65){if(_0x175e65){_0xcc3961=_0x175e65;_0xe056d5[_0xc9e8('0x2e')]=_[_0xc9e8('0x30')](db[_0xc9e8('0x48')][_0xc9e8('0x2a')]);_0xe056d5[_0xc9e8('0x2f')]=_[_0xc9e8('0x30')](_0x32252f[_0xc9e8('0x2f')]);_0xe056d5['filters']=_[_0xc9e8('0x31')](_0xe056d5[_0xc9e8('0x2e')],_0xe056d5[_0xc9e8('0x2f')]);_0x5542b1[_0xc9e8('0x32')]=_['intersection'](_0xe056d5[_0xc9e8('0x2e')],qs[_0xc9e8('0x33')](_0x32252f['query'][_0xc9e8('0x33')]));_0x5542b1[_0xc9e8('0x32')]=_0x5542b1['attributes']['length']?_0x5542b1['attributes']:_0xe056d5[_0xc9e8('0x2e')];_0x5542b1[_0xc9e8('0x49')]=qs['sort'](_0x32252f[_0xc9e8('0x2f')][_0xc9e8('0x37')]);_0x5542b1[_0xc9e8('0x38')]=qs[_0xc9e8('0x39')](_[_0xc9e8('0x4a')](_0x32252f[_0xc9e8('0x2f')],_0xe056d5[_0xc9e8('0x39')]));if(_0x32252f[_0xc9e8('0x2f')][_0xc9e8('0x4b')]){_0x5542b1[_0xc9e8('0x38')]=_['merge'](_0x5542b1['where'],{'$or':_[_0xc9e8('0x28')](_0x5542b1[_0xc9e8('0x32')],function(_0xb2075d){var _0x2707df={};_0x2707df[_0xb2075d]={'$like':'%'+_0x32252f[_0xc9e8('0x2f')][_0xc9e8('0x4b')]+'%'};return _0x2707df;})});}_0x5542b1=_[_0xc9e8('0x3a')]({},_0x5542b1,_0x32252f['options']);return _0xcc3961[_0xc9e8('0x46')](_0x5542b1);}})[_0xc9e8('0x22')](function(_0x5a99ef){if(_0x5a99ef){_0x19602e=_0x5a99ef[_0xc9e8('0x34')];if(!_0x32252f['query']['hasOwnProperty'](_0xc9e8('0x36'))){_0x5542b1[_0xc9e8('0x1c')]=qs[_0xc9e8('0x1c')](_0x32252f['query']['limit']);_0x5542b1[_0xc9e8('0x1a')]=qs[_0xc9e8('0x1a')](_0x32252f[_0xc9e8('0x2f')][_0xc9e8('0x1a')]);}return _0xcc3961['getFields'](_0x5542b1);}})['then'](function(_0x13e575){if(_0x13e575){return _0x13e575?{'count':_0x19602e,'rows':_0x13e575}:null;}})[_0xc9e8('0x22')](respondWithResult(_0x567ca6,null))[_0xc9e8('0x43')](handleError(_0x567ca6,null));};exports['getSubjects']=function(_0x47bb1c,_0x1f4d2f,_0x5e3560){var _0x56a62e={};var _0x2851dd={};var _0xf586e6;var _0x920a1b;return db[_0xc9e8('0x29')][_0xc9e8('0x47')]({'where':{'id':_0x47bb1c[_0xc9e8('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f4d2f,null))[_0xc9e8('0x22')](function(_0x36493b){if(_0x36493b){_0xf586e6=_0x36493b;_0x2851dd[_0xc9e8('0x2e')]=_[_0xc9e8('0x30')](db[_0xc9e8('0x48')][_0xc9e8('0x2a')]);_0x2851dd[_0xc9e8('0x2f')]=_[_0xc9e8('0x30')](_0x47bb1c[_0xc9e8('0x2f')]);_0x2851dd[_0xc9e8('0x39')]=_[_0xc9e8('0x31')](_0x2851dd[_0xc9e8('0x2e')],_0x2851dd[_0xc9e8('0x2f')]);_0x56a62e[_0xc9e8('0x32')]=_[_0xc9e8('0x31')](_0x2851dd['model'],qs[_0xc9e8('0x33')](_0x47bb1c['query'][_0xc9e8('0x33')]));_0x56a62e[_0xc9e8('0x32')]=_0x56a62e[_0xc9e8('0x32')][_0xc9e8('0x34')]?_0x56a62e[_0xc9e8('0x32')]:_0x2851dd[_0xc9e8('0x2e')];_0x56a62e[_0xc9e8('0x49')]=qs[_0xc9e8('0x37')](_0x47bb1c['query'][_0xc9e8('0x37')]);_0x56a62e['where']=qs[_0xc9e8('0x39')](_[_0xc9e8('0x4a')](_0x47bb1c['query'],_0x2851dd[_0xc9e8('0x39')]));if(_0x47bb1c[_0xc9e8('0x2f')][_0xc9e8('0x4b')]){_0x56a62e[_0xc9e8('0x38')]=_[_0xc9e8('0x3a')](_0x56a62e['where'],{'$or':_['map'](_0x56a62e[_0xc9e8('0x32')],function(_0x2004d3){var _0x2db135={};_0x2db135[_0x2004d3]={'$like':'%'+_0x47bb1c[_0xc9e8('0x2f')][_0xc9e8('0x4b')]+'%'};return _0x2db135;})});}_0x56a62e=_['merge']({},_0x56a62e,_0x47bb1c[_0xc9e8('0x4c')]);return _0xf586e6[_0xc9e8('0x4d')](_0x56a62e);}})[_0xc9e8('0x22')](function(_0x30941f){if(_0x30941f){_0x920a1b=_0x30941f['length'];if(!_0x47bb1c[_0xc9e8('0x2f')][_0xc9e8('0x35')](_0xc9e8('0x36'))){_0x56a62e[_0xc9e8('0x1c')]=qs['limit'](_0x47bb1c['query']['limit']);_0x56a62e[_0xc9e8('0x1a')]=qs[_0xc9e8('0x1a')](_0x47bb1c[_0xc9e8('0x2f')]['offset']);}return _0xf586e6[_0xc9e8('0x4d')](_0x56a62e);}})[_0xc9e8('0x22')](function(_0x3a4728){if(_0x3a4728){return _0x3a4728?{'count':_0x920a1b,'rows':_0x3a4728}:null;}})[_0xc9e8('0x22')](respondWithResult(_0x1f4d2f,null))[_0xc9e8('0x43')](handleError(_0x1f4d2f,null));};exports[_0xc9e8('0x4e')]=function(_0x4ad25c,_0x1dd595,_0x58aafb){var _0x572a4a={};var _0x21993a={};var _0x1d0891;var _0x17d486;return db[_0xc9e8('0x29')]['findOne']({'where':{'id':_0x4ad25c['params']['id']}})[_0xc9e8('0x22')](handleEntityNotFound(_0x1dd595,null))[_0xc9e8('0x22')](function(_0x12a3e7){if(_0x12a3e7){_0x1d0891=_0x12a3e7;_0x21993a[_0xc9e8('0x2e')]=_['keys'](db[_0xc9e8('0x48')][_0xc9e8('0x2a')]);_0x21993a[_0xc9e8('0x2f')]=_[_0xc9e8('0x30')](_0x4ad25c[_0xc9e8('0x2f')]);_0x21993a[_0xc9e8('0x39')]=_[_0xc9e8('0x31')](_0x21993a[_0xc9e8('0x2e')],_0x21993a['query']);_0x572a4a[_0xc9e8('0x32')]=_[_0xc9e8('0x31')](_0x21993a[_0xc9e8('0x2e')],qs[_0xc9e8('0x33')](_0x4ad25c[_0xc9e8('0x2f')][_0xc9e8('0x33')]));_0x572a4a[_0xc9e8('0x32')]=_0x572a4a[_0xc9e8('0x32')][_0xc9e8('0x34')]?_0x572a4a['attributes']:_0x21993a['model'];_0x572a4a[_0xc9e8('0x49')]=qs['sort'](_0x4ad25c[_0xc9e8('0x2f')][_0xc9e8('0x37')]);_0x572a4a[_0xc9e8('0x38')]=qs[_0xc9e8('0x39')](_[_0xc9e8('0x4a')](_0x4ad25c[_0xc9e8('0x2f')],_0x21993a['filters']));if(_0x4ad25c[_0xc9e8('0x2f')]['filter']){_0x572a4a['where']=_[_0xc9e8('0x3a')](_0x572a4a[_0xc9e8('0x38')],{'$or':_[_0xc9e8('0x28')](_0x572a4a[_0xc9e8('0x32')],function(_0x48908d){var _0x3298b3={};_0x3298b3[_0x48908d]={'$like':'%'+_0x4ad25c[_0xc9e8('0x2f')][_0xc9e8('0x4b')]+'%'};return _0x3298b3;})});}_0x572a4a=_[_0xc9e8('0x3a')]({},_0x572a4a,_0x4ad25c[_0xc9e8('0x4c')]);return _0x1d0891[_0xc9e8('0x4e')](_0x572a4a);}})['then'](function(_0x1dd017){if(_0x1dd017){_0x17d486=_0x1dd017['length'];if(!_0x4ad25c[_0xc9e8('0x2f')][_0xc9e8('0x35')]('nolimit')){_0x572a4a[_0xc9e8('0x1c')]=qs[_0xc9e8('0x1c')](_0x4ad25c[_0xc9e8('0x2f')][_0xc9e8('0x1c')]);_0x572a4a['offset']=qs[_0xc9e8('0x1a')](_0x4ad25c[_0xc9e8('0x2f')][_0xc9e8('0x1a')]);}return _0x1d0891[_0xc9e8('0x4e')](_0x572a4a);}})['then'](function(_0x1c7f6c){if(_0x1c7f6c){return _0x1c7f6c?{'count':_0x17d486,'rows':_0x1c7f6c}:null;}})[_0xc9e8('0x22')](respondWithResult(_0x1dd595,null))['catch'](handleError(_0x1dd595,null));}; \ No newline at end of file +var _0x9633=['key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','getFields','findOne','Dynamics365Field','order','getSubjects','getDescriptions','nolimit','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type'];(function(_0x46eef8,_0x4baec0){var _0x43a341=function(_0x29aabd){while(--_0x29aabd){_0x46eef8['push'](_0x46eef8['shift']());}};_0x43a341(++_0x4baec0);}(_0x9633,0x17b));var _0x3963=function(_0x28a2ae,_0x5f1f80){_0x28a2ae=_0x28a2ae-0x0;var _0x193b3a=_0x9633[_0x28a2ae];return _0x193b3a;};'use strict';var emlformat=require(_0x3963('0x0'));var rimraf=require(_0x3963('0x1'));var zipdir=require(_0x3963('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3963('0x3'));var BPromise=require(_0x3963('0x4'));var Mustache=require(_0x3963('0x5'));var util=require(_0x3963('0x6'));var path=require(_0x3963('0x7'));var sox=require(_0x3963('0x8'));var csv=require(_0x3963('0x9'));var ejs=require(_0x3963('0xa'));var fs=require('fs');var fs_extra=require(_0x3963('0xb'));var _=require(_0x3963('0xc'));var squel=require(_0x3963('0xd'));var crypto=require(_0x3963('0xe'));var jsforce=require(_0x3963('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3963('0x9'));var querystring=require(_0x3963('0x10'));var Papa=require(_0x3963('0x11'));var Redis=require(_0x3963('0x12'));var authService=require(_0x3963('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3963('0x14'));var hardwareService=require(_0x3963('0x15'));var logger=require(_0x3963('0x16'))(_0x3963('0x17'));var utils=require(_0x3963('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3963('0x19'));var db=require(_0x3963('0x1a'))['db'];function respondWithStatusCode(_0x20b4a1,_0x2c5b04){_0x2c5b04=_0x2c5b04||0xcc;return function(_0x4373be){if(_0x4373be){return _0x20b4a1[_0x3963('0x1b')](_0x2c5b04);}return _0x20b4a1[_0x3963('0x1c')](_0x2c5b04)['end']();};}function respondWithResult(_0xef6296,_0x3b48ee){_0x3b48ee=_0x3b48ee||0xc8;return function(_0xd0827a){if(_0xd0827a){return _0xef6296[_0x3963('0x1c')](_0x3b48ee)[_0x3963('0x1d')](_0xd0827a);}};}function respondWithFilteredResult(_0x3c502e,_0x4b0ad8){return function(_0x3c0b40){if(_0x3c0b40){var _0x148783=typeof _0x4b0ad8[_0x3963('0x1e')]===_0x3963('0x1f')&&typeof _0x4b0ad8[_0x3963('0x20')]===_0x3963('0x1f');var _0x132e52=_0x3c0b40['count'];var _0x3ccb66=_0x148783?0x0:_0x4b0ad8['offset'];var _0x5eba45=_0x148783?_0x3c0b40['count']:_0x4b0ad8[_0x3963('0x1e')]+_0x4b0ad8['limit'];var _0x248130;if(_0x5eba45>=_0x132e52){_0x5eba45=_0x132e52;_0x248130=0xc8;}else{_0x248130=0xce;}_0x3c502e[_0x3963('0x1c')](_0x248130);return _0x3c502e[_0x3963('0x21')](_0x3963('0x22'),_0x3ccb66+'-'+_0x5eba45+'/'+_0x132e52)['json'](_0x3c0b40);}return null;};}function patchUpdates(_0x918929){return function(_0x26c8b3){try{jsonpatch[_0x3963('0x23')](_0x26c8b3,_0x918929,!![]);}catch(_0x29a6ba){return BPromise[_0x3963('0x24')](_0x29a6ba);}return _0x26c8b3[_0x3963('0x25')]();};}function saveUpdates(_0x73dc52,_0x90682b){return function(_0x402970){if(_0x402970){return _0x402970[_0x3963('0x26')](_0x73dc52)[_0x3963('0x27')](function(_0x41f42f){return _0x41f42f;});}return null;};}function removeEntity(_0x2f84ff,_0x3a5be9){return function(_0x4d6b10){if(_0x4d6b10){return _0x4d6b10[_0x3963('0x28')]()['then'](function(){_0x2f84ff[_0x3963('0x1c')](0xcc)[_0x3963('0x29')]();});}};}function handleEntityNotFound(_0x331e83,_0x2a8385){return function(_0x1a2b0b){if(!_0x1a2b0b){_0x331e83['sendStatus'](0x194);}return _0x1a2b0b;};}function handleError(_0x1dc51e,_0x50cf98){_0x50cf98=_0x50cf98||0x1f4;return function(_0x3e1055){logger[_0x3963('0x2a')](_0x3e1055[_0x3963('0x2b')]);if(_0x3e1055[_0x3963('0x2c')]){delete _0x3e1055[_0x3963('0x2c')];}_0x1dc51e[_0x3963('0x1c')](_0x50cf98)[_0x3963('0x2d')](_0x3e1055);};}exports['index']=function(_0x4394d1,_0x249b1d){var _0x1a98f6={},_0xb5b861={},_0x42e99a={'count':0x0,'rows':[]};var _0x518d85=_[_0x3963('0x2e')](db[_0x3963('0x2f')][_0x3963('0x30')],function(_0x1f2700){return{'name':_0x1f2700[_0x3963('0x31')],'type':_0x1f2700[_0x3963('0x32')][_0x3963('0x33')]};});_0xb5b861[_0x3963('0x34')]=_[_0x3963('0x2e')](_0x518d85,_0x3963('0x2c'));_0xb5b861['query']=_[_0x3963('0x35')](_0x4394d1['query']);_0xb5b861[_0x3963('0x36')]=_[_0x3963('0x37')](_0xb5b861[_0x3963('0x34')],_0xb5b861[_0x3963('0x38')]);_0x1a98f6[_0x3963('0x39')]=_[_0x3963('0x37')](_0xb5b861[_0x3963('0x34')],qs[_0x3963('0x3a')](_0x4394d1[_0x3963('0x38')]['fields']));_0x1a98f6[_0x3963('0x39')]=_0x1a98f6[_0x3963('0x39')][_0x3963('0x3b')]?_0x1a98f6[_0x3963('0x39')]:_0xb5b861[_0x3963('0x34')];if(!_0x4394d1['query'][_0x3963('0x3c')]('nolimit')){_0x1a98f6[_0x3963('0x20')]=qs[_0x3963('0x20')](_0x4394d1[_0x3963('0x38')][_0x3963('0x20')]);_0x1a98f6['offset']=qs[_0x3963('0x1e')](_0x4394d1[_0x3963('0x38')]['offset']);}_0x1a98f6['order']=qs[_0x3963('0x3d')](_0x4394d1['query'][_0x3963('0x3d')]);_0x1a98f6[_0x3963('0x3e')]=qs[_0x3963('0x36')](_[_0x3963('0x3f')](_0x4394d1['query'],_0xb5b861[_0x3963('0x36')]),_0x518d85);if(_0x4394d1['query'][_0x3963('0x40')]){_0x1a98f6[_0x3963('0x3e')]=_['merge'](_0x1a98f6[_0x3963('0x3e')],{'$or':_[_0x3963('0x2e')](_0x518d85,function(_0x592f00){if(_0x592f00[_0x3963('0x32')]!==_0x3963('0x41')){var _0x4c9169={};_0x4c9169[_0x592f00['name']]={'$like':'%'+_0x4394d1[_0x3963('0x38')][_0x3963('0x40')]+'%'};return _0x4c9169;}})});}_0x1a98f6=_[_0x3963('0x42')]({},_0x1a98f6,_0x4394d1[_0x3963('0x43')]);var _0x25e459={'where':_0x1a98f6[_0x3963('0x3e')]};return db['Dynamics365Configuration'][_0x3963('0x44')](_0x25e459)[_0x3963('0x27')](function(_0x17f20d){_0x42e99a[_0x3963('0x44')]=_0x17f20d;if(_0x4394d1[_0x3963('0x38')][_0x3963('0x45')]){_0x1a98f6[_0x3963('0x46')]=[{'all':!![]}];}return db[_0x3963('0x2f')][_0x3963('0x47')](_0x1a98f6);})[_0x3963('0x27')](function(_0x408b9b){_0x42e99a[_0x3963('0x48')]=_0x408b9b;return _0x42e99a;})[_0x3963('0x27')](respondWithFilteredResult(_0x249b1d,_0x1a98f6))[_0x3963('0x49')](handleError(_0x249b1d,null));};exports[_0x3963('0x4a')]=function(_0x1c1c24,_0x21d4b5){var _0x39c057={'raw':![],'where':{'id':_0x1c1c24['params']['id']}},_0x5af8d4={};_0x5af8d4[_0x3963('0x34')]=_['keys'](db[_0x3963('0x2f')][_0x3963('0x30')]);_0x5af8d4[_0x3963('0x38')]=_['keys'](_0x1c1c24['query']);_0x5af8d4[_0x3963('0x36')]=_[_0x3963('0x37')](_0x5af8d4['model'],_0x5af8d4[_0x3963('0x38')]);_0x39c057[_0x3963('0x39')]=_['intersection'](_0x5af8d4['model'],qs[_0x3963('0x3a')](_0x1c1c24[_0x3963('0x38')][_0x3963('0x3a')]));_0x39c057['attributes']=_0x39c057[_0x3963('0x39')][_0x3963('0x3b')]?_0x39c057[_0x3963('0x39')]:_0x5af8d4[_0x3963('0x34')];if(_0x1c1c24[_0x3963('0x38')][_0x3963('0x45')]){_0x39c057[_0x3963('0x46')]=[{'all':!![]}];}_0x39c057=_[_0x3963('0x42')]({},_0x39c057,_0x1c1c24['options']);return db[_0x3963('0x2f')][_0x3963('0x4b')](_0x39c057)[_0x3963('0x27')](handleEntityNotFound(_0x21d4b5,null))['then'](respondWithResult(_0x21d4b5,null))['catch'](handleError(_0x21d4b5,null));};exports[_0x3963('0x4c')]=function(_0x3ab09e,_0x1b4573){return db['Dynamics365Configuration']['create'](_0x3ab09e[_0x3963('0x4d')],{})[_0x3963('0x27')](respondWithResult(_0x1b4573,0xc9))[_0x3963('0x49')](handleError(_0x1b4573,null));};exports['update']=function(_0xaed891,_0x16e599){if(_0xaed891[_0x3963('0x4d')]['id']){delete _0xaed891[_0x3963('0x4d')]['id'];}return db[_0x3963('0x2f')]['find']({'where':{'id':_0xaed891[_0x3963('0x4e')]['id']}})[_0x3963('0x27')](handleEntityNotFound(_0x16e599,null))['then'](saveUpdates(_0xaed891[_0x3963('0x4d')],null))[_0x3963('0x27')](respondWithResult(_0x16e599,null))[_0x3963('0x49')](handleError(_0x16e599,null));};exports[_0x3963('0x28')]=function(_0x5191cd,_0x30eaa8){return db[_0x3963('0x2f')]['find']({'where':{'id':_0x5191cd[_0x3963('0x4e')]['id']}})['then'](handleEntityNotFound(_0x30eaa8,null))['then'](removeEntity(_0x30eaa8,null))[_0x3963('0x49')](handleError(_0x30eaa8,null));};exports[_0x3963('0x4f')]=function(_0x33766b,_0x797a26,_0x8dc349){var _0x2e5e9e={};var _0x241f04={};var _0x51958f;var _0x257906;return db[_0x3963('0x2f')][_0x3963('0x50')]({'where':{'id':_0x33766b[_0x3963('0x4e')]['id']}})[_0x3963('0x27')](handleEntityNotFound(_0x797a26,null))[_0x3963('0x27')](function(_0x5edbed){if(_0x5edbed){_0x51958f=_0x5edbed;_0x241f04[_0x3963('0x34')]=_[_0x3963('0x35')](db[_0x3963('0x51')]['rawAttributes']);_0x241f04[_0x3963('0x38')]=_[_0x3963('0x35')](_0x33766b[_0x3963('0x38')]);_0x241f04[_0x3963('0x36')]=_[_0x3963('0x37')](_0x241f04[_0x3963('0x34')],_0x241f04['query']);_0x2e5e9e['attributes']=_['intersection'](_0x241f04['model'],qs['fields'](_0x33766b[_0x3963('0x38')][_0x3963('0x3a')]));_0x2e5e9e[_0x3963('0x39')]=_0x2e5e9e[_0x3963('0x39')]['length']?_0x2e5e9e[_0x3963('0x39')]:_0x241f04[_0x3963('0x34')];_0x2e5e9e[_0x3963('0x52')]=qs[_0x3963('0x3d')](_0x33766b[_0x3963('0x38')][_0x3963('0x3d')]);_0x2e5e9e[_0x3963('0x3e')]=qs[_0x3963('0x36')](_[_0x3963('0x3f')](_0x33766b[_0x3963('0x38')],_0x241f04[_0x3963('0x36')]));if(_0x33766b['query'][_0x3963('0x40')]){_0x2e5e9e[_0x3963('0x3e')]=_[_0x3963('0x42')](_0x2e5e9e[_0x3963('0x3e')],{'$or':_['map'](_0x2e5e9e[_0x3963('0x39')],function(_0x6dde7b){var _0x5a35fe={};_0x5a35fe[_0x6dde7b]={'$like':'%'+_0x33766b['query']['filter']+'%'};return _0x5a35fe;})});}_0x2e5e9e=_[_0x3963('0x42')]({},_0x2e5e9e,_0x33766b[_0x3963('0x43')]);return _0x51958f[_0x3963('0x4f')](_0x2e5e9e);}})[_0x3963('0x27')](function(_0x316f28){if(_0x316f28){_0x257906=_0x316f28[_0x3963('0x3b')];if(!_0x33766b[_0x3963('0x38')][_0x3963('0x3c')]('nolimit')){_0x2e5e9e[_0x3963('0x20')]=qs[_0x3963('0x20')](_0x33766b[_0x3963('0x38')]['limit']);_0x2e5e9e['offset']=qs[_0x3963('0x1e')](_0x33766b[_0x3963('0x38')][_0x3963('0x1e')]);}return _0x51958f[_0x3963('0x4f')](_0x2e5e9e);}})[_0x3963('0x27')](function(_0x38024b){if(_0x38024b){return _0x38024b?{'count':_0x257906,'rows':_0x38024b}:null;}})[_0x3963('0x27')](respondWithResult(_0x797a26,null))['catch'](handleError(_0x797a26,null));};exports[_0x3963('0x53')]=function(_0x15b622,_0x5a23a8,_0x33e366){var _0x4b9cee={};var _0x22177b={};var _0x22dfdc;var _0x413eb6;return db[_0x3963('0x2f')][_0x3963('0x50')]({'where':{'id':_0x15b622[_0x3963('0x4e')]['id']}})[_0x3963('0x27')](handleEntityNotFound(_0x5a23a8,null))[_0x3963('0x27')](function(_0x3d43f9){if(_0x3d43f9){_0x22dfdc=_0x3d43f9;_0x22177b['model']=_[_0x3963('0x35')](db[_0x3963('0x51')][_0x3963('0x30')]);_0x22177b['query']=_['keys'](_0x15b622[_0x3963('0x38')]);_0x22177b['filters']=_[_0x3963('0x37')](_0x22177b[_0x3963('0x34')],_0x22177b['query']);_0x4b9cee[_0x3963('0x39')]=_[_0x3963('0x37')](_0x22177b[_0x3963('0x34')],qs[_0x3963('0x3a')](_0x15b622[_0x3963('0x38')]['fields']));_0x4b9cee[_0x3963('0x39')]=_0x4b9cee[_0x3963('0x39')]['length']?_0x4b9cee['attributes']:_0x22177b[_0x3963('0x34')];_0x4b9cee['order']=qs[_0x3963('0x3d')](_0x15b622[_0x3963('0x38')][_0x3963('0x3d')]);_0x4b9cee['where']=qs[_0x3963('0x36')](_[_0x3963('0x3f')](_0x15b622[_0x3963('0x38')],_0x22177b['filters']));if(_0x15b622['query']['filter']){_0x4b9cee[_0x3963('0x3e')]=_['merge'](_0x4b9cee[_0x3963('0x3e')],{'$or':_[_0x3963('0x2e')](_0x4b9cee[_0x3963('0x39')],function(_0x30b3a9){var _0x4c842f={};_0x4c842f[_0x30b3a9]={'$like':'%'+_0x15b622['query'][_0x3963('0x40')]+'%'};return _0x4c842f;})});}_0x4b9cee=_[_0x3963('0x42')]({},_0x4b9cee,_0x15b622[_0x3963('0x43')]);return _0x22dfdc[_0x3963('0x53')](_0x4b9cee);}})[_0x3963('0x27')](function(_0xb65495){if(_0xb65495){_0x413eb6=_0xb65495['length'];if(!_0x15b622[_0x3963('0x38')]['hasOwnProperty']('nolimit')){_0x4b9cee[_0x3963('0x20')]=qs['limit'](_0x15b622[_0x3963('0x38')][_0x3963('0x20')]);_0x4b9cee[_0x3963('0x1e')]=qs[_0x3963('0x1e')](_0x15b622['query'][_0x3963('0x1e')]);}return _0x22dfdc[_0x3963('0x53')](_0x4b9cee);}})[_0x3963('0x27')](function(_0x2d09c9){if(_0x2d09c9){return _0x2d09c9?{'count':_0x413eb6,'rows':_0x2d09c9}:null;}})[_0x3963('0x27')](respondWithResult(_0x5a23a8,null))[_0x3963('0x49')](handleError(_0x5a23a8,null));};exports[_0x3963('0x54')]=function(_0x4df80b,_0x5164c8,_0x1dff82){var _0x4149c4={};var _0x3c7ba6={};var _0x590916;var _0x422628;return db[_0x3963('0x2f')]['findOne']({'where':{'id':_0x4df80b['params']['id']}})[_0x3963('0x27')](handleEntityNotFound(_0x5164c8,null))['then'](function(_0x5bf0ac){if(_0x5bf0ac){_0x590916=_0x5bf0ac;_0x3c7ba6[_0x3963('0x34')]=_[_0x3963('0x35')](db['Dynamics365Field']['rawAttributes']);_0x3c7ba6['query']=_[_0x3963('0x35')](_0x4df80b[_0x3963('0x38')]);_0x3c7ba6[_0x3963('0x36')]=_[_0x3963('0x37')](_0x3c7ba6['model'],_0x3c7ba6[_0x3963('0x38')]);_0x4149c4['attributes']=_['intersection'](_0x3c7ba6[_0x3963('0x34')],qs[_0x3963('0x3a')](_0x4df80b[_0x3963('0x38')][_0x3963('0x3a')]));_0x4149c4[_0x3963('0x39')]=_0x4149c4[_0x3963('0x39')][_0x3963('0x3b')]?_0x4149c4['attributes']:_0x3c7ba6[_0x3963('0x34')];_0x4149c4[_0x3963('0x52')]=qs[_0x3963('0x3d')](_0x4df80b['query'][_0x3963('0x3d')]);_0x4149c4[_0x3963('0x3e')]=qs[_0x3963('0x36')](_[_0x3963('0x3f')](_0x4df80b[_0x3963('0x38')],_0x3c7ba6[_0x3963('0x36')]));if(_0x4df80b[_0x3963('0x38')][_0x3963('0x40')]){_0x4149c4[_0x3963('0x3e')]=_[_0x3963('0x42')](_0x4149c4['where'],{'$or':_[_0x3963('0x2e')](_0x4149c4[_0x3963('0x39')],function(_0x5b0572){var _0x40c592={};_0x40c592[_0x5b0572]={'$like':'%'+_0x4df80b[_0x3963('0x38')][_0x3963('0x40')]+'%'};return _0x40c592;})});}_0x4149c4=_[_0x3963('0x42')]({},_0x4149c4,_0x4df80b[_0x3963('0x43')]);return _0x590916[_0x3963('0x54')](_0x4149c4);}})['then'](function(_0x3b5795){if(_0x3b5795){_0x422628=_0x3b5795[_0x3963('0x3b')];if(!_0x4df80b['query'][_0x3963('0x3c')](_0x3963('0x55'))){_0x4149c4[_0x3963('0x20')]=qs['limit'](_0x4df80b[_0x3963('0x38')][_0x3963('0x20')]);_0x4149c4[_0x3963('0x1e')]=qs[_0x3963('0x1e')](_0x4df80b[_0x3963('0x38')]['offset']);}return _0x590916[_0x3963('0x54')](_0x4149c4);}})['then'](function(_0x5dcc6c){if(_0x5dcc6c){return _0x5dcc6c?{'count':_0x422628,'rows':_0x5dcc6c}:null;}})[_0x3963('0x27')](respondWithResult(_0x5164c8,null))['catch'](handleError(_0x5164c8,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 581c332..1c1c3f3 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x4b84[_0x4ca6a4];return _0x120555;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d0e=['define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x5bd049,_0x43d163){var _0xc980fa=function(_0x468818){while(--_0x468818){_0x5bd049['push'](_0x5bd049['shift']());}};_0xc980fa(++_0x43d163);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x349d34,_0x26e45c){_0x349d34=_0x349d34-0x0;var _0xba5762=_0x8d0e[_0x349d34];return _0xba5762;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('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 4c24981..c4f660f 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 _0x67d5=['request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','jayson/promise','request','then','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x14d1bd,_0x218ab8){var _0x5ae23a=function(_0x28c5ee){while(--_0x28c5ee){_0x14d1bd['push'](_0x14d1bd['shift']());}};_0x5ae23a(++_0x218ab8);}(_0x67d5,0x1dc));var _0x567d=function(_0x287daf,_0x1c4554){_0x287daf=_0x287daf-0x0;var _0x43faaa=_0x67d5[_0x287daf];return _0x43faaa;};'use strict';var _=require(_0x567d('0x0'));var util=require(_0x567d('0x1'));var moment=require(_0x567d('0x2'));var BPromise=require(_0x567d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x567d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x567d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x567d('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5710ab,_0x1cd280,_0x212589){return new BPromise(function(_0x3c6b97,_0x1e85e7){return client[_0x567d('0x7')](_0x5710ab,_0x212589)[_0x567d('0x8')](function(_0x206d58){logger['info'](_0x567d('0x9'),_0x1cd280,_0x567d('0xa'));logger[_0x567d('0xb')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1cd280,'request\x20sent',JSON[_0x567d('0xc')](_0x206d58));if(_0x206d58[_0x567d('0xd')]){if(_0x206d58[_0x567d('0xd')][_0x567d('0xe')]===0x1f4){logger[_0x567d('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1cd280,_0x206d58[_0x567d('0xd')]['message']);return _0x1e85e7(_0x206d58[_0x567d('0xd')][_0x567d('0xf')]);}logger[_0x567d('0xd')](_0x567d('0x9'),_0x1cd280,_0x206d58[_0x567d('0xd')]['message']);return _0x3c6b97(_0x206d58['error'][_0x567d('0xf')]);}else{logger[_0x567d('0x10')](_0x567d('0x9'),_0x1cd280,_0x567d('0xa'));_0x3c6b97(_0x206d58['result'][_0x567d('0xf')]);}})[_0x567d('0x11')](function(_0xe250c1){logger['error'](_0x567d('0x9'),_0x1cd280,_0xe250c1);_0x1e85e7(_0xe250c1);});});} \ No newline at end of file +var _0x467e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0xff3166,_0x4c5857){var _0x50b90b=function(_0xbc00af){while(--_0xbc00af){_0xff3166['push'](_0xff3166['shift']());}};_0x50b90b(++_0x4c5857);}(_0x467e,0x1cb));var _0xe467=function(_0x11a84d,_0x4dbd0e){_0x11a84d=_0x11a84d-0x0;var _0x1e6b48=_0x467e[_0x11a84d];return _0x1e6b48;};'use strict';var _=require(_0xe467('0x0'));var util=require('util');var moment=require(_0xe467('0x1'));var BPromise=require('bluebird');var rs=require(_0xe467('0x2'));var fs=require('fs');var Redis=require(_0xe467('0x3'));var db=require(_0xe467('0x4'))['db'];var utils=require(_0xe467('0x5'));var logger=require(_0xe467('0x6'))('rpc');var config=require(_0xe467('0x7'));var jayson=require(_0xe467('0x8'));var client=jayson[_0xe467('0x9')][_0xe467('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c6040,_0x3b7265,_0x74bfe8){return new BPromise(function(_0x3432ad,_0x3a9309){return client['request'](_0x5c6040,_0x74bfe8)[_0xe467('0xb')](function(_0x4c2355){logger[_0xe467('0xc')](_0xe467('0xd'),_0x3b7265,_0xe467('0xe'));logger[_0xe467('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x3b7265,_0xe467('0xe'),JSON[_0xe467('0x10')](_0x4c2355));if(_0x4c2355[_0xe467('0x11')]){if(_0x4c2355['error'][_0xe467('0x12')]===0x1f4){logger[_0xe467('0x11')](_0xe467('0xd'),_0x3b7265,_0x4c2355['error'][_0xe467('0x13')]);return _0x3a9309(_0x4c2355[_0xe467('0x11')][_0xe467('0x13')]);}logger[_0xe467('0x11')](_0xe467('0xd'),_0x3b7265,_0x4c2355[_0xe467('0x11')]['message']);return _0x3432ad(_0x4c2355['error'][_0xe467('0x13')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x3b7265,_0xe467('0xe'));_0x3432ad(_0x4c2355[_0xe467('0x14')][_0xe467('0x13')]);}})[_0xe467('0x15')](function(_0x283bae){logger[_0xe467('0x11')](_0xe467('0xd'),_0x3b7265,_0x283bae);_0x3a9309(_0x283bae);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 39651aa..8ebc78e 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 _0x960d=['post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./intDynamics365Field.controller','index','get','/:id','isAuthenticated'];(function(_0x42c4ff,_0x57703c){var _0x265e9f=function(_0x1ad03c){while(--_0x1ad03c){_0x42c4ff['push'](_0x42c4ff['shift']());}};_0x265e9f(++_0x57703c);}(_0x960d,0x1f3));var _0xd960=function(_0x51e6e1,_0x3c2694){_0x51e6e1=_0x51e6e1-0x0;var _0x1c9cab=_0x960d[_0x51e6e1];return _0x1c9cab;};'use strict';var multer=require(_0xd960('0x0'));var util=require(_0xd960('0x1'));var path=require('path');var timeout=require(_0xd960('0x2'));var express=require(_0xd960('0x3'));var router=express[_0xd960('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd960('0x5'));var controller=require(_0xd960('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd960('0x7')]);router[_0xd960('0x8')](_0xd960('0x9'),auth[_0xd960('0xa')](),controller['show']);router[_0xd960('0xb')]('/',auth[_0xd960('0xa')](),controller[_0xd960('0xc')]);router['put']('/:id',auth[_0xd960('0xa')](),controller[_0xd960('0xd')]);router[_0xd960('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xd960('0xf')]);module[_0xd960('0x10')]=router; \ No newline at end of file +var _0xaa4c=['update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x53e0f9,_0x2c84f0){var _0x46afe5=function(_0x3ec870){while(--_0x3ec870){_0x53e0f9['push'](_0x53e0f9['shift']());}};_0x46afe5(++_0x2c84f0);}(_0xaa4c,0x169));var _0xcaa4=function(_0x4b1f9d,_0x483ba0){_0x4b1f9d=_0x4b1f9d-0x0;var _0xeff048=_0xaa4c[_0x4b1f9d];return _0xeff048;};'use strict';var multer=require(_0xcaa4('0x0'));var util=require(_0xcaa4('0x1'));var path=require(_0xcaa4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcaa4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcaa4('0x4'));var interaction=require(_0xcaa4('0x5'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0xcaa4('0x6')]('/',auth[_0xcaa4('0x7')](),controller[_0xcaa4('0x8')]);router['get'](_0xcaa4('0x9'),auth['isAuthenticated'](),controller[_0xcaa4('0xa')]);router[_0xcaa4('0xb')]('/',auth[_0xcaa4('0x7')](),controller[_0xcaa4('0xc')]);router['put'](_0xcaa4('0x9'),auth[_0xcaa4('0x7')](),controller[_0xcaa4('0xd')]);router[_0xcaa4('0xe')](_0xcaa4('0x9'),auth[_0xcaa4('0x7')](),controller[_0xcaa4('0xf')]);module[_0xcaa4('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 83de6b2..1c2d43c 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 _0x5970=['customVariable','string','STRING','sequelize','ENUM','variable'];(function(_0x562362,_0x5d54f4){var _0x3a18ce=function(_0x4b96ed){while(--_0x4b96ed){_0x562362['push'](_0x562362['shift']());}};_0x3a18ce(++_0x5d54f4);}(_0x5970,0xf9));var _0x0597=function(_0x79aa64,_0x25770f){_0x79aa64=_0x79aa64-0x0;var _0x2402b2=_0x5970[_0x79aa64];return _0x2402b2;};'use strict';var Sequelize=require(_0x0597('0x0'));module['exports']={'type':{'type':Sequelize[_0x0597('0x1')]('string',_0x0597('0x2'),_0x0597('0x3'),'keyValue','picklist'),'defaultValue':_0x0597('0x4')},'content':{'type':Sequelize[_0x0597('0x5')]},'key':{'type':Sequelize[_0x0597('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x0597('0x4'),_0x0597('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x0597('0x5')]},'idField':{'type':Sequelize[_0x0597('0x5')]},'nameField':{'type':Sequelize[_0x0597('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3888=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x39717f,_0x137103){var _0x1e7709=function(_0x445faf){while(--_0x445faf){_0x39717f['push'](_0x39717f['shift']());}};_0x1e7709(++_0x137103);}(_0x3888,0xd0));var _0x8388=function(_0x368ddb,_0x409d59){_0x368ddb=_0x368ddb-0x0;var _0x59c380=_0x3888[_0x368ddb];return _0x59c380;};'use strict';var Sequelize=require(_0x8388('0x0'));module[_0x8388('0x1')]={'type':{'type':Sequelize[_0x8388('0x2')](_0x8388('0x3'),_0x8388('0x4'),_0x8388('0x5'),_0x8388('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x8388('0x7')]},'key':{'type':Sequelize[_0x8388('0x7')]},'keyType':{'type':Sequelize[_0x8388('0x2')](_0x8388('0x3'),_0x8388('0x4'),_0x8388('0x5'))},'keyContent':{'type':Sequelize[_0x8388('0x7')]},'idField':{'type':Sequelize[_0x8388('0x7')]},'nameField':{'type':Sequelize[_0x8388('0x7')]},'customField':{'type':Sequelize[_0x8388('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index f01b25c..4f2d982 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 _0x2bab=['sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','rows','catch','params','include','options','find','create','body','eml-format','zip-dir','moment','bluebird','util','path','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'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0x2bab,0x10f));var _0xb2ba=function(_0x819f99,_0x505886){_0x819f99=_0x819f99-0x0;var _0x29c631=_0x2bab[_0x819f99];return _0x29c631;};'use strict';var emlformat=require(_0xb2ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb2ba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb2ba('0x2'));var BPromise=require(_0xb2ba('0x3'));var Mustache=require('mustache');var util=require(_0xb2ba('0x4'));var path=require(_0xb2ba('0x5'));var sox=require(_0xb2ba('0x6'));var csv=require(_0xb2ba('0x7'));var ejs=require(_0xb2ba('0x8'));var fs=require('fs');var fs_extra=require(_0xb2ba('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb2ba('0xa'));var jsforce=require(_0xb2ba('0xb'));var deskjs=require(_0xb2ba('0xc'));var toCsv=require(_0xb2ba('0x7'));var querystring=require(_0xb2ba('0xd'));var Papa=require(_0xb2ba('0xe'));var Redis=require(_0xb2ba('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb2ba('0x10'));var as=require(_0xb2ba('0x11'));var hardwareService=require(_0xb2ba('0x12'));var logger=require(_0xb2ba('0x13'))(_0xb2ba('0x14'));var utils=require(_0xb2ba('0x15'));var config=require(_0xb2ba('0x16'));var licenseUtil=require(_0xb2ba('0x17'));var db=require(_0xb2ba('0x18'))['db'];function respondWithStatusCode(_0x4cebe1,_0x4b74b3){_0x4b74b3=_0x4b74b3||0xcc;return function(_0x1885a4){if(_0x1885a4){return _0x4cebe1[_0xb2ba('0x19')](_0x4b74b3);}return _0x4cebe1['status'](_0x4b74b3)[_0xb2ba('0x1a')]();};}function respondWithResult(_0x2889a3,_0x22a78a){_0x22a78a=_0x22a78a||0xc8;return function(_0x4c5801){if(_0x4c5801){return _0x2889a3[_0xb2ba('0x1b')](_0x22a78a)[_0xb2ba('0x1c')](_0x4c5801);}};}function respondWithFilteredResult(_0x1d0a99,_0x193aca){return function(_0x5877a3){if(_0x5877a3){var _0x106d40=typeof _0x193aca[_0xb2ba('0x1d')]===_0xb2ba('0x1e')&&typeof _0x193aca[_0xb2ba('0x1f')]===_0xb2ba('0x1e');var _0x2459e6=_0x5877a3[_0xb2ba('0x20')];var _0x2dbd1b=_0x106d40?0x0:_0x193aca['offset'];var _0x37c34e=_0x106d40?_0x5877a3[_0xb2ba('0x20')]:_0x193aca[_0xb2ba('0x1d')]+_0x193aca[_0xb2ba('0x1f')];var _0x2a3fb6;if(_0x37c34e>=_0x2459e6){_0x37c34e=_0x2459e6;_0x2a3fb6=0xc8;}else{_0x2a3fb6=0xce;}_0x1d0a99['status'](_0x2a3fb6);return _0x1d0a99[_0xb2ba('0x21')]('Content-Range',_0x2dbd1b+'-'+_0x37c34e+'/'+_0x2459e6)[_0xb2ba('0x1c')](_0x5877a3);}return null;};}function patchUpdates(_0x4f2a60){return function(_0x36e10f){try{jsonpatch[_0xb2ba('0x22')](_0x36e10f,_0x4f2a60,!![]);}catch(_0x5818ef){return BPromise[_0xb2ba('0x23')](_0x5818ef);}return _0x36e10f[_0xb2ba('0x24')]();};}function saveUpdates(_0x5eeac7,_0x4bfe74){return function(_0x56d37c){if(_0x56d37c){return _0x56d37c['update'](_0x5eeac7)['then'](function(_0x1ef081){return _0x1ef081;});}return null;};}function removeEntity(_0x3c229e,_0x12e10b){return function(_0x22eec9){if(_0x22eec9){return _0x22eec9[_0xb2ba('0x25')]()[_0xb2ba('0x26')](function(){_0x3c229e['status'](0xcc)[_0xb2ba('0x1a')]();});}};}function handleEntityNotFound(_0x188957,_0x30f280){return function(_0x5610b4){if(!_0x5610b4){_0x188957[_0xb2ba('0x19')](0x194);}return _0x5610b4;};}function handleError(_0x509699,_0x1db802){_0x1db802=_0x1db802||0x1f4;return function(_0x6d9bc5){logger[_0xb2ba('0x27')](_0x6d9bc5[_0xb2ba('0x28')]);if(_0x6d9bc5[_0xb2ba('0x29')]){delete _0x6d9bc5[_0xb2ba('0x29')];}_0x509699[_0xb2ba('0x1b')](_0x1db802)[_0xb2ba('0x2a')](_0x6d9bc5);};}exports[_0xb2ba('0x2b')]=function(_0x389528,_0x49f6aa){var _0x138bc0={},_0x1ec5f3={},_0x51a2ae={'count':0x0,'rows':[]};var _0x58645d=_[_0xb2ba('0x2c')](db[_0xb2ba('0x2d')][_0xb2ba('0x2e')],function(_0x554257){return{'name':_0x554257['fieldName'],'type':_0x554257[_0xb2ba('0x2f')][_0xb2ba('0x30')]};});_0x1ec5f3['model']=_['map'](_0x58645d,_0xb2ba('0x29'));_0x1ec5f3['query']=_[_0xb2ba('0x31')](_0x389528[_0xb2ba('0x32')]);_0x1ec5f3['filters']=_[_0xb2ba('0x33')](_0x1ec5f3[_0xb2ba('0x34')],_0x1ec5f3[_0xb2ba('0x32')]);_0x138bc0['attributes']=_[_0xb2ba('0x33')](_0x1ec5f3['model'],qs[_0xb2ba('0x35')](_0x389528[_0xb2ba('0x32')]['fields']));_0x138bc0[_0xb2ba('0x36')]=_0x138bc0['attributes'][_0xb2ba('0x37')]?_0x138bc0[_0xb2ba('0x36')]:_0x1ec5f3['model'];if(!_0x389528['query'][_0xb2ba('0x38')](_0xb2ba('0x39'))){_0x138bc0[_0xb2ba('0x1f')]=qs[_0xb2ba('0x1f')](_0x389528[_0xb2ba('0x32')][_0xb2ba('0x1f')]);_0x138bc0[_0xb2ba('0x1d')]=qs[_0xb2ba('0x1d')](_0x389528[_0xb2ba('0x32')]['offset']);}_0x138bc0['order']=qs['sort'](_0x389528['query'][_0xb2ba('0x3a')]);_0x138bc0[_0xb2ba('0x3b')]=qs[_0xb2ba('0x3c')](_[_0xb2ba('0x3d')](_0x389528[_0xb2ba('0x32')],_0x1ec5f3[_0xb2ba('0x3c')]),_0x58645d);if(_0x389528['query'][_0xb2ba('0x3e')]){_0x138bc0[_0xb2ba('0x3b')]=_[_0xb2ba('0x3f')](_0x138bc0[_0xb2ba('0x3b')],{'$or':_[_0xb2ba('0x2c')](_0x58645d,function(_0x4a36d7){if(_0x4a36d7['type']!==_0xb2ba('0x40')){var _0x426998={};_0x426998[_0x4a36d7['name']]={'$like':'%'+_0x389528[_0xb2ba('0x32')][_0xb2ba('0x3e')]+'%'};return _0x426998;}})});}_0x138bc0=_[_0xb2ba('0x3f')]({},_0x138bc0,_0x389528['options']);var _0x168368={'where':_0x138bc0[_0xb2ba('0x3b')]};return db[_0xb2ba('0x2d')]['count'](_0x168368)[_0xb2ba('0x26')](function(_0x1ef9d9){_0x51a2ae[_0xb2ba('0x20')]=_0x1ef9d9;if(_0x389528['query'][_0xb2ba('0x41')]){_0x138bc0['include']=[{'all':!![]}];}return db[_0xb2ba('0x2d')]['findAll'](_0x138bc0);})[_0xb2ba('0x26')](function(_0x217117){_0x51a2ae[_0xb2ba('0x42')]=_0x217117;return _0x51a2ae;})[_0xb2ba('0x26')](respondWithFilteredResult(_0x49f6aa,_0x138bc0))[_0xb2ba('0x43')](handleError(_0x49f6aa,null));};exports['show']=function(_0xbbad76,_0x4a550c){var _0x4a274f={'raw':!![],'where':{'id':_0xbbad76[_0xb2ba('0x44')]['id']}},_0x23d658={};_0x23d658[_0xb2ba('0x34')]=_[_0xb2ba('0x31')](db['Dynamics365Field'][_0xb2ba('0x2e')]);_0x23d658[_0xb2ba('0x32')]=_[_0xb2ba('0x31')](_0xbbad76[_0xb2ba('0x32')]);_0x23d658[_0xb2ba('0x3c')]=_['intersection'](_0x23d658[_0xb2ba('0x34')],_0x23d658[_0xb2ba('0x32')]);_0x4a274f[_0xb2ba('0x36')]=_[_0xb2ba('0x33')](_0x23d658[_0xb2ba('0x34')],qs[_0xb2ba('0x35')](_0xbbad76[_0xb2ba('0x32')][_0xb2ba('0x35')]));_0x4a274f[_0xb2ba('0x36')]=_0x4a274f[_0xb2ba('0x36')]['length']?_0x4a274f['attributes']:_0x23d658[_0xb2ba('0x34')];if(_0xbbad76[_0xb2ba('0x32')]['includeAll']){_0x4a274f[_0xb2ba('0x45')]=[{'all':!![]}];}_0x4a274f=_[_0xb2ba('0x3f')]({},_0x4a274f,_0xbbad76[_0xb2ba('0x46')]);return db[_0xb2ba('0x2d')][_0xb2ba('0x47')](_0x4a274f)[_0xb2ba('0x26')](handleEntityNotFound(_0x4a550c,null))['then'](respondWithResult(_0x4a550c,null))[_0xb2ba('0x43')](handleError(_0x4a550c,null));};exports[_0xb2ba('0x48')]=function(_0x1c28fe,_0x23d0ef){return db[_0xb2ba('0x2d')][_0xb2ba('0x48')](_0x1c28fe[_0xb2ba('0x49')],{})['then'](respondWithResult(_0x23d0ef,0xc9))[_0xb2ba('0x43')](handleError(_0x23d0ef,null));};exports['update']=function(_0x577b8f,_0x46e331){if(_0x577b8f[_0xb2ba('0x49')]['id']){delete _0x577b8f[_0xb2ba('0x49')]['id'];}return db[_0xb2ba('0x2d')][_0xb2ba('0x47')]({'where':{'id':_0x577b8f[_0xb2ba('0x44')]['id']}})[_0xb2ba('0x26')](handleEntityNotFound(_0x46e331,null))[_0xb2ba('0x26')](saveUpdates(_0x577b8f[_0xb2ba('0x49')],null))[_0xb2ba('0x26')](respondWithResult(_0x46e331,null))['catch'](handleError(_0x46e331,null));};exports['destroy']=function(_0x29765d,_0x427dfa){return db[_0xb2ba('0x2d')][_0xb2ba('0x47')]({'where':{'id':_0x29765d[_0xb2ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x427dfa,null))['then'](removeEntity(_0x427dfa,null))['catch'](handleError(_0x427dfa,null));}; \ No newline at end of file +var _0x1b6f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','Dynamics365Field','findAll','catch','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api'];(function(_0x2082da,_0x518117){var _0x332475=function(_0x4ed1ef){while(--_0x4ed1ef){_0x2082da['push'](_0x2082da['shift']());}};_0x332475(++_0x518117);}(_0x1b6f,0x15c));var _0xf1b6=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x1b6f[_0x2f9467];return _0x39894c;};'use strict';var emlformat=require(_0xf1b6('0x0'));var rimraf=require(_0xf1b6('0x1'));var zipdir=require(_0xf1b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1b6('0x3'));var moment=require(_0xf1b6('0x4'));var BPromise=require(_0xf1b6('0x5'));var Mustache=require('mustache');var util=require(_0xf1b6('0x6'));var path=require(_0xf1b6('0x7'));var sox=require(_0xf1b6('0x8'));var csv=require(_0xf1b6('0x9'));var ejs=require(_0xf1b6('0xa'));var fs=require('fs');var fs_extra=require(_0xf1b6('0xb'));var _=require(_0xf1b6('0xc'));var squel=require(_0xf1b6('0xd'));var crypto=require('crypto');var jsforce=require(_0xf1b6('0xe'));var deskjs=require(_0xf1b6('0xf'));var toCsv=require(_0xf1b6('0x9'));var querystring=require(_0xf1b6('0x10'));var Papa=require('papaparse');var Redis=require(_0xf1b6('0x11'));var authService=require(_0xf1b6('0x12'));var qs=require(_0xf1b6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1b6('0x14'))(_0xf1b6('0x15'));var utils=require(_0xf1b6('0x16'));var config=require(_0xf1b6('0x17'));var licenseUtil=require(_0xf1b6('0x18'));var db=require(_0xf1b6('0x19'))['db'];function respondWithStatusCode(_0x1c8528,_0x336ef4){_0x336ef4=_0x336ef4||0xcc;return function(_0x51b881){if(_0x51b881){return _0x1c8528[_0xf1b6('0x1a')](_0x336ef4);}return _0x1c8528[_0xf1b6('0x1b')](_0x336ef4)['end']();};}function respondWithResult(_0x170c2e,_0x41de0e){_0x41de0e=_0x41de0e||0xc8;return function(_0x1ced83){if(_0x1ced83){return _0x170c2e[_0xf1b6('0x1b')](_0x41de0e)[_0xf1b6('0x1c')](_0x1ced83);}};}function respondWithFilteredResult(_0x12446d,_0x335081){return function(_0x68829b){if(_0x68829b){var _0x31ae63=typeof _0x335081[_0xf1b6('0x1d')]==='undefined'&&typeof _0x335081['limit']===_0xf1b6('0x1e');var _0x11c4ef=_0x68829b[_0xf1b6('0x1f')];var _0x2c0f6c=_0x31ae63?0x0:_0x335081['offset'];var _0x4e4ae4=_0x31ae63?_0x68829b[_0xf1b6('0x1f')]:_0x335081['offset']+_0x335081[_0xf1b6('0x20')];var _0x20b983;if(_0x4e4ae4>=_0x11c4ef){_0x4e4ae4=_0x11c4ef;_0x20b983=0xc8;}else{_0x20b983=0xce;}_0x12446d[_0xf1b6('0x1b')](_0x20b983);return _0x12446d[_0xf1b6('0x21')]('Content-Range',_0x2c0f6c+'-'+_0x4e4ae4+'/'+_0x11c4ef)[_0xf1b6('0x1c')](_0x68829b);}return null;};}function patchUpdates(_0x27fa66){return function(_0x2b02f1){try{jsonpatch[_0xf1b6('0x22')](_0x2b02f1,_0x27fa66,!![]);}catch(_0x252293){return BPromise[_0xf1b6('0x23')](_0x252293);}return _0x2b02f1[_0xf1b6('0x24')]();};}function saveUpdates(_0x527778,_0x37f2a5){return function(_0x131f87){if(_0x131f87){return _0x131f87[_0xf1b6('0x25')](_0x527778)[_0xf1b6('0x26')](function(_0x438a28){return _0x438a28;});}return null;};}function removeEntity(_0xdfcb51,_0x208f37){return function(_0x507e0a){if(_0x507e0a){return _0x507e0a[_0xf1b6('0x27')]()['then'](function(){_0xdfcb51[_0xf1b6('0x1b')](0xcc)[_0xf1b6('0x28')]();});}};}function handleEntityNotFound(_0x204fe4,_0xaa384d){return function(_0xbe704){if(!_0xbe704){_0x204fe4[_0xf1b6('0x1a')](0x194);}return _0xbe704;};}function handleError(_0x303272,_0x265b22){_0x265b22=_0x265b22||0x1f4;return function(_0x39fdc0){logger[_0xf1b6('0x29')](_0x39fdc0['stack']);if(_0x39fdc0[_0xf1b6('0x2a')]){delete _0x39fdc0[_0xf1b6('0x2a')];}_0x303272[_0xf1b6('0x1b')](_0x265b22)[_0xf1b6('0x2b')](_0x39fdc0);};}exports[_0xf1b6('0x2c')]=function(_0x44fa03,_0x3e8cbc){var _0x544fb1={},_0x30d7fb={},_0x1635c7={'count':0x0,'rows':[]};var _0x193193=_[_0xf1b6('0x2d')](db['Dynamics365Field'][_0xf1b6('0x2e')],function(_0x3fb733){return{'name':_0x3fb733['fieldName'],'type':_0x3fb733['type'][_0xf1b6('0x2f')]};});_0x30d7fb[_0xf1b6('0x30')]=_[_0xf1b6('0x2d')](_0x193193,_0xf1b6('0x2a'));_0x30d7fb[_0xf1b6('0x31')]=_[_0xf1b6('0x32')](_0x44fa03[_0xf1b6('0x31')]);_0x30d7fb[_0xf1b6('0x33')]=_[_0xf1b6('0x34')](_0x30d7fb[_0xf1b6('0x30')],_0x30d7fb[_0xf1b6('0x31')]);_0x544fb1[_0xf1b6('0x35')]=_[_0xf1b6('0x34')](_0x30d7fb[_0xf1b6('0x30')],qs[_0xf1b6('0x36')](_0x44fa03[_0xf1b6('0x31')]['fields']));_0x544fb1[_0xf1b6('0x35')]=_0x544fb1['attributes'][_0xf1b6('0x37')]?_0x544fb1['attributes']:_0x30d7fb[_0xf1b6('0x30')];if(!_0x44fa03['query'][_0xf1b6('0x38')](_0xf1b6('0x39'))){_0x544fb1[_0xf1b6('0x20')]=qs['limit'](_0x44fa03[_0xf1b6('0x31')]['limit']);_0x544fb1[_0xf1b6('0x1d')]=qs[_0xf1b6('0x1d')](_0x44fa03[_0xf1b6('0x31')][_0xf1b6('0x1d')]);}_0x544fb1['order']=qs[_0xf1b6('0x3a')](_0x44fa03[_0xf1b6('0x31')]['sort']);_0x544fb1[_0xf1b6('0x3b')]=qs[_0xf1b6('0x33')](_[_0xf1b6('0x3c')](_0x44fa03['query'],_0x30d7fb[_0xf1b6('0x33')]),_0x193193);if(_0x44fa03['query']['filter']){_0x544fb1[_0xf1b6('0x3b')]=_[_0xf1b6('0x3d')](_0x544fb1['where'],{'$or':_[_0xf1b6('0x2d')](_0x193193,function(_0x4d1c24){if(_0x4d1c24[_0xf1b6('0x3e')]!==_0xf1b6('0x3f')){var _0x47b462={};_0x47b462[_0x4d1c24[_0xf1b6('0x2a')]]={'$like':'%'+_0x44fa03[_0xf1b6('0x31')][_0xf1b6('0x40')]+'%'};return _0x47b462;}})});}_0x544fb1=_[_0xf1b6('0x3d')]({},_0x544fb1,_0x44fa03[_0xf1b6('0x41')]);var _0x5430ad={'where':_0x544fb1['where']};return db[_0xf1b6('0x42')][_0xf1b6('0x1f')](_0x5430ad)[_0xf1b6('0x26')](function(_0x339dd0){_0x1635c7['count']=_0x339dd0;if(_0x44fa03['query']['includeAll']){_0x544fb1['include']=[{'all':!![]}];}return db[_0xf1b6('0x42')][_0xf1b6('0x43')](_0x544fb1);})[_0xf1b6('0x26')](function(_0x203c74){_0x1635c7['rows']=_0x203c74;return _0x1635c7;})['then'](respondWithFilteredResult(_0x3e8cbc,_0x544fb1))[_0xf1b6('0x44')](handleError(_0x3e8cbc,null));};exports['show']=function(_0x14d385,_0x25a5aa){var _0x3ea64c={'raw':!![],'where':{'id':_0x14d385[_0xf1b6('0x45')]['id']}},_0xf37c69={};_0xf37c69[_0xf1b6('0x30')]=_['keys'](db[_0xf1b6('0x42')]['rawAttributes']);_0xf37c69[_0xf1b6('0x31')]=_[_0xf1b6('0x32')](_0x14d385[_0xf1b6('0x31')]);_0xf37c69[_0xf1b6('0x33')]=_[_0xf1b6('0x34')](_0xf37c69['model'],_0xf37c69[_0xf1b6('0x31')]);_0x3ea64c[_0xf1b6('0x35')]=_[_0xf1b6('0x34')](_0xf37c69['model'],qs[_0xf1b6('0x36')](_0x14d385[_0xf1b6('0x31')][_0xf1b6('0x36')]));_0x3ea64c['attributes']=_0x3ea64c[_0xf1b6('0x35')][_0xf1b6('0x37')]?_0x3ea64c[_0xf1b6('0x35')]:_0xf37c69['model'];if(_0x14d385['query'][_0xf1b6('0x46')]){_0x3ea64c['include']=[{'all':!![]}];}_0x3ea64c=_[_0xf1b6('0x3d')]({},_0x3ea64c,_0x14d385['options']);return db[_0xf1b6('0x42')][_0xf1b6('0x47')](_0x3ea64c)[_0xf1b6('0x26')](handleEntityNotFound(_0x25a5aa,null))[_0xf1b6('0x26')](respondWithResult(_0x25a5aa,null))[_0xf1b6('0x44')](handleError(_0x25a5aa,null));};exports[_0xf1b6('0x48')]=function(_0x22b57b,_0x35bc84){return db['Dynamics365Field'][_0xf1b6('0x48')](_0x22b57b['body'],{})[_0xf1b6('0x26')](respondWithResult(_0x35bc84,0xc9))[_0xf1b6('0x44')](handleError(_0x35bc84,null));};exports[_0xf1b6('0x25')]=function(_0x3f9a64,_0x4ce41e){if(_0x3f9a64[_0xf1b6('0x49')]['id']){delete _0x3f9a64[_0xf1b6('0x49')]['id'];}return db[_0xf1b6('0x42')][_0xf1b6('0x47')]({'where':{'id':_0x3f9a64['params']['id']}})[_0xf1b6('0x26')](handleEntityNotFound(_0x4ce41e,null))[_0xf1b6('0x26')](saveUpdates(_0x3f9a64[_0xf1b6('0x49')],null))['then'](respondWithResult(_0x4ce41e,null))[_0xf1b6('0x44')](handleError(_0x4ce41e,null));};exports[_0xf1b6('0x27')]=function(_0x2dfdb1,_0x2ae2f4){return db[_0xf1b6('0x42')][_0xf1b6('0x47')]({'where':{'id':_0x2dfdb1[_0xf1b6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ae2f4,null))[_0xf1b6('0x26')](removeEntity(_0x2ae2f4,null))[_0xf1b6('0x44')](handleError(_0x2ae2f4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index c1ae259..dbc01b0 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 _0xd3df=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0xd3df,0x1ba));var _0xfd3d=function(_0x4df7b3,_0xc1cadb){_0x4df7b3=_0x4df7b3-0x0;var _0x3dd819=_0xd3df[_0x4df7b3];return _0x3dd819;};'use strict';var _=require(_0xfd3d('0x0'));var util=require(_0xfd3d('0x1'));var logger=require(_0xfd3d('0x2'))(_0xfd3d('0x3'));var moment=require(_0xfd3d('0x4'));var BPromise=require(_0xfd3d('0x5'));var rp=require(_0xfd3d('0x6'));var fs=require('fs');var path=require(_0xfd3d('0x7'));var rimraf=require(_0xfd3d('0x8'));var config=require('../../config/environment');var attributes=require(_0xfd3d('0x9'));module[_0xfd3d('0xa')]=function(_0x1be45b,_0x425d59){return _0x1be45b[_0xfd3d('0xb')](_0xfd3d('0xc'),attributes,{'tableName':_0xfd3d('0xd'),'paranoid':![],'indexes':[{'name':_0xfd3d('0xe'),'fields':[_0xfd3d('0xf'),_0xfd3d('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4eaf=['dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','Dynamics365Field'];(function(_0x523755,_0x4cce83){var _0x28bdef=function(_0x4fa771){while(--_0x4fa771){_0x523755['push'](_0x523755['shift']());}};_0x28bdef(++_0x4cce83);}(_0x4eaf,0x1f1));var _0xf4ea=function(_0x223e2a,_0x3cfb29){_0x223e2a=_0x223e2a-0x0;var _0x4e12bd=_0x4eaf[_0x223e2a];return _0x4e12bd;};'use strict';var _=require(_0xf4ea('0x0'));var util=require(_0xf4ea('0x1'));var logger=require(_0xf4ea('0x2'))('api');var moment=require(_0xf4ea('0x3'));var BPromise=require(_0xf4ea('0x4'));var rp=require(_0xf4ea('0x5'));var fs=require('fs');var path=require(_0xf4ea('0x6'));var rimraf=require('rimraf');var config=require(_0xf4ea('0x7'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x212c4f,_0x1a9c74){return _0x212c4f[_0xf4ea('0x8')](_0xf4ea('0x9'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xf4ea('0xa'),'fields':[_0xf4ea('0xb'),_0xf4ea('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 aae8e1a..cebf337 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 _0xc9c9=['request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','info','result','lodash','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x4a705c,_0x5196c3){var _0x3e1195=function(_0x519726){while(--_0x519726){_0x4a705c['push'](_0x4a705c['shift']());}};_0x3e1195(++_0x5196c3);}(_0xc9c9,0x10c));var _0x9c9c=function(_0x4d9a48,_0x20bc50){_0x4d9a48=_0x4d9a48-0x0;var _0xef464d=_0xc9c9[_0x4d9a48];return _0xef464d;};'use strict';var _=require(_0x9c9c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c9c('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c9c('0x2'));var logger=require(_0x9c9c('0x3'))(_0x9c9c('0x4'));var config=require(_0x9c9c('0x5'));var jayson=require(_0x9c9c('0x6'));var client=jayson['client'][_0x9c9c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x502354,_0x2a6193,_0x558e31){return new BPromise(function(_0xcd2cf1,_0x10099e){return client[_0x9c9c('0x8')](_0x502354,_0x558e31)[_0x9c9c('0x9')](function(_0x12fed0){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x2a6193,'request\x20sent');logger[_0x9c9c('0xa')](_0x9c9c('0xb'),_0x2a6193,_0x9c9c('0xc'),JSON[_0x9c9c('0xd')](_0x12fed0));if(_0x12fed0[_0x9c9c('0xe')]){if(_0x12fed0['error'][_0x9c9c('0xf')]===0x1f4){logger[_0x9c9c('0xe')](_0x9c9c('0x10'),_0x2a6193,_0x12fed0[_0x9c9c('0xe')][_0x9c9c('0x11')]);return _0x10099e(_0x12fed0[_0x9c9c('0xe')]['message']);}logger[_0x9c9c('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x2a6193,_0x12fed0['error']['message']);return _0xcd2cf1(_0x12fed0[_0x9c9c('0xe')][_0x9c9c('0x11')]);}else{logger[_0x9c9c('0x12')](_0x9c9c('0x10'),_0x2a6193,_0x9c9c('0xc'));_0xcd2cf1(_0x12fed0[_0x9c9c('0x13')]['message']);}})['catch'](function(_0x728d23){logger[_0x9c9c('0xe')](_0x9c9c('0x10'),_0x2a6193,_0x728d23);_0x10099e(_0x728d23);});});} \ No newline at end of file +var _0x44ba=['stringify','code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x504044,_0xb4d135){var _0x2975a9=function(_0x47b369){while(--_0x47b369){_0x504044['push'](_0x504044['shift']());}};_0x2975a9(++_0xb4d135);}(_0x44ba,0x176));var _0xa44b=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x44ba[_0x479160];return _0x47ac6d;};'use strict';var _=require(_0xa44b('0x0'));var util=require(_0xa44b('0x1'));var moment=require(_0xa44b('0x2'));var BPromise=require('bluebird');var rs=require(_0xa44b('0x3'));var fs=require('fs');var Redis=require(_0xa44b('0x4'));var db=require(_0xa44b('0x5'))['db'];var utils=require(_0xa44b('0x6'));var logger=require(_0xa44b('0x7'))(_0xa44b('0x8'));var config=require(_0xa44b('0x9'));var jayson=require(_0xa44b('0xa'));var client=jayson['client'][_0xa44b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17cf4f,_0x50fbb8,_0x23bbce){return new BPromise(function(_0x22fb70,_0x179c62){return client[_0xa44b('0xc')](_0x17cf4f,_0x23bbce)[_0xa44b('0xd')](function(_0x4dd8a0){logger['info'](_0xa44b('0xe'),_0x50fbb8,_0xa44b('0xf'));logger[_0xa44b('0x10')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x50fbb8,_0xa44b('0xf'),JSON[_0xa44b('0x11')](_0x4dd8a0));if(_0x4dd8a0['error']){if(_0x4dd8a0['error'][_0xa44b('0x12')]===0x1f4){logger['error'](_0xa44b('0xe'),_0x50fbb8,_0x4dd8a0[_0xa44b('0x13')]['message']);return _0x179c62(_0x4dd8a0[_0xa44b('0x13')][_0xa44b('0x14')]);}logger[_0xa44b('0x13')](_0xa44b('0xe'),_0x50fbb8,_0x4dd8a0['error'][_0xa44b('0x14')]);return _0x22fb70(_0x4dd8a0[_0xa44b('0x13')]['message']);}else{logger['info'](_0xa44b('0xe'),_0x50fbb8,_0xa44b('0xf'));_0x22fb70(_0x4dd8a0[_0xa44b('0x15')][_0xa44b('0x14')]);}})[_0xa44b('0x16')](function(_0x1f7935){logger[_0xa44b('0x13')](_0xa44b('0xe'),_0x50fbb8,_0x1f7935);_0x179c62(_0x1f7935);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 90591c7..4a4150d 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 _0x7f82=['isAuthenticated','/:id','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get'];(function(_0x486334,_0x57ed47){var _0x601c24=function(_0x43ae95){while(--_0x43ae95){_0x486334['push'](_0x486334['shift']());}};_0x601c24(++_0x57ed47);}(_0x7f82,0x145));var _0x27f8=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x7f82[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x27f8('0x0'));var util=require(_0x27f8('0x1'));var path=require(_0x27f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x27f8('0x3'));var router=express[_0x27f8('0x4')]();var fs_extra=require(_0x27f8('0x5'));var auth=require(_0x27f8('0x6'));var interaction=require(_0x27f8('0x7'));var config=require(_0x27f8('0x8'));var controller=require(_0x27f8('0x9'));router[_0x27f8('0xa')]('/',auth[_0x27f8('0xb')](),controller['index']);router['get'](_0x27f8('0xc'),auth[_0x27f8('0xb')](),controller['show']);router[_0x27f8('0xa')]('/:id/configurations',auth[_0x27f8('0xb')](),controller[_0x27f8('0xd')]);router[_0x27f8('0xa')](_0x27f8('0xe'),auth[_0x27f8('0xb')](),controller[_0x27f8('0xf')]);router[_0x27f8('0x10')]('/',auth[_0x27f8('0xb')](),controller['create']);router['post']('/:id/configurations',auth[_0x27f8('0xb')](),controller[_0x27f8('0x11')]);router['put']('/:id',auth[_0x27f8('0xb')](),controller[_0x27f8('0x12')]);router[_0x27f8('0x13')](_0x27f8('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x27f8('0x14')]=router; \ No newline at end of file +var _0xd36f=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x3e65a9,_0x2a29e9){var _0x283476=function(_0x1e517d){while(--_0x1e517d){_0x3e65a9['push'](_0x3e65a9['shift']());}};_0x283476(++_0x2a29e9);}(_0xd36f,0x113));var _0xfd36=function(_0x36b7bf,_0x10153f){_0x36b7bf=_0x36b7bf-0x0;var _0x118674=_0xd36f[_0x36b7bf];return _0x118674;};'use strict';var multer=require(_0xfd36('0x0'));var util=require(_0xfd36('0x1'));var path=require(_0xfd36('0x2'));var timeout=require(_0xfd36('0x3'));var express=require(_0xfd36('0x4'));var router=express['Router']();var fs_extra=require(_0xfd36('0x5'));var auth=require(_0xfd36('0x6'));var interaction=require(_0xfd36('0x7'));var config=require(_0xfd36('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0xfd36('0x9')]('/',auth[_0xfd36('0xa')](),controller['index']);router[_0xfd36('0x9')](_0xfd36('0xb'),auth[_0xfd36('0xa')](),controller[_0xfd36('0xc')]);router[_0xfd36('0x9')](_0xfd36('0xd'),auth[_0xfd36('0xa')](),controller[_0xfd36('0xe')]);router['get'](_0xfd36('0xf'),auth[_0xfd36('0xa')](),controller[_0xfd36('0x10')]);router[_0xfd36('0x11')]('/',auth[_0xfd36('0xa')](),controller[_0xfd36('0x12')]);router[_0xfd36('0x11')](_0xfd36('0xd'),auth[_0xfd36('0xa')](),controller[_0xfd36('0x13')]);router[_0xfd36('0x14')](_0xfd36('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfd36('0x15')](_0xfd36('0xb'),auth[_0xfd36('0xa')](),controller[_0xfd36('0x16')]);module[_0xfd36('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 71670c0..27481a5 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 _0xeb3b=['sequelize','exports','STRING'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x2eea9a,_0x368daf){_0x2eea9a=_0x2eea9a-0x0;var _0x1ec61e=_0xeb3b[_0x2eea9a];return _0x1ec61e;};'use strict';var Sequelize=require(_0xbeb3('0x0'));module[_0xbeb3('0x1')]={'name':{'type':Sequelize[_0xbeb3('0x2')]},'description':{'type':Sequelize[_0xbeb3('0x2')]},'username':{'type':Sequelize[_0xbeb3('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbeb3('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xbeb3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0120=['remoteUri','sequelize','exports','STRING','username'];(function(_0x47dcf7,_0x2e8bbf){var _0x1a8b72=function(_0x22379f){while(--_0x22379f){_0x47dcf7['push'](_0x47dcf7['shift']());}};_0x1a8b72(++_0x2e8bbf);}(_0x0120,0x6f));var _0x0012=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0120[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x0012('0x0'));module[_0x0012('0x1')]={'name':{'type':Sequelize[_0x0012('0x2')]},'description':{'type':Sequelize[_0x0012('0x2')]},'username':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x3')},'apiKey':{'type':Sequelize[_0x0012('0x2')]},'remoteUri':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x4')},'serverUrl':{'type':Sequelize[_0x0012('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 0296386..1452bcd 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 _0x98b8=['lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','base64','requester','subject','agent','description','priority','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','error','getFields,\x20%s,\x20%s,\x20%s','test','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','save','update','destroy','then','stack','name','send','index','map','FreshdeskAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','slice','substring'];(function(_0x347962,_0x48cf62){var _0x3424d9=function(_0x2440f1){while(--_0x2440f1){_0x347962['push'](_0x347962['shift']());}};_0x3424d9(++_0x48cf62);}(_0x98b8,0x93));var _0x898b=function(_0x26cbf5,_0x507741){_0x26cbf5=_0x26cbf5-0x0;var _0x4bbe4c=_0x98b8[_0x26cbf5];return _0x4bbe4c;};'use strict';var emlformat=require(_0x898b('0x0'));var rimraf=require(_0x898b('0x1'));var zipdir=require(_0x898b('0x2'));var jsonpatch=require(_0x898b('0x3'));var rp=require(_0x898b('0x4'));var moment=require(_0x898b('0x5'));var BPromise=require(_0x898b('0x6'));var Mustache=require(_0x898b('0x7'));var util=require(_0x898b('0x8'));var path=require(_0x898b('0x9'));var sox=require(_0x898b('0xa'));var csv=require(_0x898b('0xb'));var ejs=require(_0x898b('0xc'));var fs=require('fs');var fs_extra=require(_0x898b('0xd'));var _=require(_0x898b('0xe'));var squel=require('squel');var crypto=require(_0x898b('0xf'));var jsforce=require(_0x898b('0x10'));var deskjs=require(_0x898b('0x11'));var toCsv=require(_0x898b('0xb'));var querystring=require(_0x898b('0x12'));var Papa=require(_0x898b('0x13'));var Redis=require(_0x898b('0x14'));var authService=require(_0x898b('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x898b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x898b('0x17'));var utils=require(_0x898b('0x18'));var config=require(_0x898b('0x19'));var licenseUtil=require(_0x898b('0x1a'));var db=require(_0x898b('0x1b'))['db'];var integrations=require(_0x898b('0x1c'));function respondWithStatusCode(_0x241756,_0x219de0){_0x219de0=_0x219de0||0xcc;return function(_0x88230c){if(_0x88230c){return _0x241756[_0x898b('0x1d')](_0x219de0);}return _0x241756[_0x898b('0x1e')](_0x219de0)[_0x898b('0x1f')]();};}function respondWithResult(_0x51b5a0,_0x435cba){_0x435cba=_0x435cba||0xc8;return function(_0x561cac){if(_0x561cac){return _0x51b5a0[_0x898b('0x1e')](_0x435cba)['json'](_0x561cac);}};}function respondWithFilteredResult(_0x4baf7b,_0x427cc4){return function(_0x239c41){if(_0x239c41){var _0x1c35c9=typeof _0x427cc4[_0x898b('0x20')]==='undefined'&&typeof _0x427cc4[_0x898b('0x21')]==='undefined';var _0x535847=_0x239c41[_0x898b('0x22')];var _0x250349=_0x1c35c9?0x0:_0x427cc4[_0x898b('0x20')];var _0x4b1a40=_0x1c35c9?_0x239c41[_0x898b('0x22')]:_0x427cc4[_0x898b('0x20')]+_0x427cc4[_0x898b('0x21')];var _0x622f99;if(_0x4b1a40>=_0x535847){_0x4b1a40=_0x535847;_0x622f99=0xc8;}else{_0x622f99=0xce;}_0x4baf7b[_0x898b('0x1e')](_0x622f99);return _0x4baf7b[_0x898b('0x23')](_0x898b('0x24'),_0x250349+'-'+_0x4b1a40+'/'+_0x535847)[_0x898b('0x25')](_0x239c41);}return null;};}function patchUpdates(_0x2eef40){return function(_0x150c37){try{jsonpatch['apply'](_0x150c37,_0x2eef40,!![]);}catch(_0x5c98bb){return BPromise[_0x898b('0x26')](_0x5c98bb);}return _0x150c37[_0x898b('0x27')]();};}function saveUpdates(_0x503390,_0x321ec9){return function(_0x2b8b04){if(_0x2b8b04){return _0x2b8b04[_0x898b('0x28')](_0x503390)['then'](function(_0x4fa723){return _0x4fa723;});}return null;};}function removeEntity(_0x66101f,_0x2bd250){return function(_0x1a70a1){if(_0x1a70a1){return _0x1a70a1[_0x898b('0x29')]()[_0x898b('0x2a')](function(){_0x66101f[_0x898b('0x1e')](0xcc)[_0x898b('0x1f')]();});}};}function handleEntityNotFound(_0x21785b,_0x284dfd){return function(_0x45d5a4){if(!_0x45d5a4){_0x21785b[_0x898b('0x1d')](0x194);}return _0x45d5a4;};}function handleError(_0x3479e1,_0x163a6c){_0x163a6c=_0x163a6c||0x1f4;return function(_0x485460){logger['error'](_0x485460[_0x898b('0x2b')]);if(_0x485460[_0x898b('0x2c')]){delete _0x485460[_0x898b('0x2c')];}_0x3479e1[_0x898b('0x1e')](_0x163a6c)[_0x898b('0x2d')](_0x485460);};}exports[_0x898b('0x2e')]=function(_0xed317a,_0xf9b0ad){var _0x320237={},_0x3d7b20={},_0x511611={'count':0x0,'rows':[]};var _0x4f1bb5=_[_0x898b('0x2f')](db[_0x898b('0x30')]['rawAttributes'],function(_0x63b5df){return{'name':_0x63b5df[_0x898b('0x31')],'type':_0x63b5df[_0x898b('0x32')][_0x898b('0x33')]};});_0x3d7b20[_0x898b('0x34')]=_[_0x898b('0x2f')](_0x4f1bb5,'name');_0x3d7b20[_0x898b('0x35')]=_[_0x898b('0x36')](_0xed317a['query']);_0x3d7b20[_0x898b('0x37')]=_['intersection'](_0x3d7b20[_0x898b('0x34')],_0x3d7b20[_0x898b('0x35')]);_0x320237['attributes']=_[_0x898b('0x38')](_0x3d7b20['model'],qs['fields'](_0xed317a[_0x898b('0x35')][_0x898b('0x39')]));_0x320237[_0x898b('0x3a')]=_0x320237[_0x898b('0x3a')][_0x898b('0x3b')]?_0x320237[_0x898b('0x3a')]:_0x3d7b20[_0x898b('0x34')];if(!_0xed317a[_0x898b('0x35')][_0x898b('0x3c')](_0x898b('0x3d'))){_0x320237[_0x898b('0x21')]=qs[_0x898b('0x21')](_0xed317a['query']['limit']);_0x320237['offset']=qs['offset'](_0xed317a[_0x898b('0x35')][_0x898b('0x20')]);}_0x320237[_0x898b('0x3e')]=qs['sort'](_0xed317a[_0x898b('0x35')][_0x898b('0x3f')]);_0x320237[_0x898b('0x40')]=qs[_0x898b('0x37')](_[_0x898b('0x41')](_0xed317a['query'],_0x3d7b20[_0x898b('0x37')]),_0x4f1bb5);if(_0xed317a[_0x898b('0x35')][_0x898b('0x42')]){_0x320237['where']=_[_0x898b('0x43')](_0x320237[_0x898b('0x40')],{'$or':_['map'](_0x4f1bb5,function(_0x2d6e1b){if(_0x2d6e1b[_0x898b('0x32')]!==_0x898b('0x44')){var _0xb3cde9={};_0xb3cde9[_0x2d6e1b['name']]={'$like':'%'+_0xed317a[_0x898b('0x35')][_0x898b('0x42')]+'%'};return _0xb3cde9;}})});}_0x320237=_[_0x898b('0x43')]({},_0x320237,_0xed317a[_0x898b('0x45')]);var _0x283283={'where':_0x320237[_0x898b('0x40')]};return db[_0x898b('0x30')][_0x898b('0x22')](_0x283283)[_0x898b('0x2a')](function(_0x20d60f){_0x511611['count']=_0x20d60f;if(_0xed317a['query'][_0x898b('0x46')]){_0x320237[_0x898b('0x47')]=[{'all':!![]}];}return db[_0x898b('0x30')][_0x898b('0x48')](_0x320237);})['then'](function(_0x1baa91){_0x511611[_0x898b('0x49')]=_0x1baa91;return _0x511611;})[_0x898b('0x2a')](respondWithFilteredResult(_0xf9b0ad,_0x320237))[_0x898b('0x4a')](handleError(_0xf9b0ad,null));};exports['show']=function(_0x7b16b,_0x2f363e){var _0x4e77be={'raw':![],'where':{'id':_0x7b16b[_0x898b('0x4b')]['id']}},_0x187f71={};_0x187f71['model']=_[_0x898b('0x36')](db['FreshdeskAccount'][_0x898b('0x4c')]);_0x187f71['query']=_[_0x898b('0x36')](_0x7b16b[_0x898b('0x35')]);_0x187f71[_0x898b('0x37')]=_[_0x898b('0x38')](_0x187f71[_0x898b('0x34')],_0x187f71['query']);_0x4e77be[_0x898b('0x3a')]=_[_0x898b('0x38')](_0x187f71[_0x898b('0x34')],qs['fields'](_0x7b16b[_0x898b('0x35')][_0x898b('0x39')]));_0x4e77be['attributes']=_0x4e77be[_0x898b('0x3a')][_0x898b('0x3b')]?_0x4e77be[_0x898b('0x3a')]:_0x187f71[_0x898b('0x34')];if(_0x7b16b[_0x898b('0x35')][_0x898b('0x46')]){_0x4e77be['include']=[{'all':!![]}];}_0x4e77be=_['merge']({},_0x4e77be,_0x7b16b[_0x898b('0x45')]);return db[_0x898b('0x30')]['find'](_0x4e77be)[_0x898b('0x2a')](handleEntityNotFound(_0x2f363e,null))[_0x898b('0x2a')](respondWithResult(_0x2f363e,null))[_0x898b('0x4a')](handleError(_0x2f363e,null));};exports[_0x898b('0x4d')]=function(_0x208be3,_0x463ec9){return db['FreshdeskAccount']['create'](_0x208be3['body'],{})[_0x898b('0x2a')](respondWithResult(_0x463ec9,0xc9))[_0x898b('0x4a')](handleError(_0x463ec9,null));};exports['update']=function(_0x280a53,_0x4555d3){if(_0x280a53[_0x898b('0x4e')]['id']){delete _0x280a53[_0x898b('0x4e')]['id'];}return db['FreshdeskAccount'][_0x898b('0x4f')]({'where':{'id':_0x280a53['params']['id']}})[_0x898b('0x2a')](handleEntityNotFound(_0x4555d3,null))['then'](saveUpdates(_0x280a53[_0x898b('0x4e')],null))[_0x898b('0x2a')](respondWithResult(_0x4555d3,null))[_0x898b('0x4a')](handleError(_0x4555d3,null));};exports['destroy']=function(_0x32ecda,_0x7960a8){return db[_0x898b('0x30')][_0x898b('0x4f')]({'where':{'id':_0x32ecda[_0x898b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x7960a8,null))['then'](removeEntity(_0x7960a8,null))[_0x898b('0x4a')](handleError(_0x7960a8,null));};exports[_0x898b('0x50')]=function(_0x2bbaa7,_0x569ece,_0x26ddbf){var _0x4d555c={};var _0x131ce2={};var _0x2c8278;var _0x59eeaf;return db['FreshdeskAccount'][_0x898b('0x51')]({'where':{'id':_0x2bbaa7[_0x898b('0x4b')]['id']}})[_0x898b('0x2a')](handleEntityNotFound(_0x569ece,null))['then'](function(_0x4ab67b){if(_0x4ab67b){_0x2c8278=_0x4ab67b;_0x131ce2['model']=_[_0x898b('0x36')](db[_0x898b('0x52')][_0x898b('0x4c')]);_0x131ce2[_0x898b('0x35')]=_[_0x898b('0x36')](_0x2bbaa7[_0x898b('0x35')]);_0x131ce2['filters']=_[_0x898b('0x38')](_0x131ce2[_0x898b('0x34')],_0x131ce2[_0x898b('0x35')]);_0x4d555c[_0x898b('0x3a')]=_[_0x898b('0x38')](_0x131ce2[_0x898b('0x34')],qs['fields'](_0x2bbaa7['query'][_0x898b('0x39')]));_0x4d555c[_0x898b('0x3a')]=_0x4d555c[_0x898b('0x3a')][_0x898b('0x3b')]?_0x4d555c[_0x898b('0x3a')]:_0x131ce2[_0x898b('0x34')];_0x4d555c['order']=qs[_0x898b('0x3f')](_0x2bbaa7[_0x898b('0x35')]['sort']);_0x4d555c[_0x898b('0x40')]=qs['filters'](_[_0x898b('0x41')](_0x2bbaa7[_0x898b('0x35')],_0x131ce2[_0x898b('0x37')]));if(_0x2bbaa7[_0x898b('0x35')][_0x898b('0x42')]){_0x4d555c[_0x898b('0x40')]=_[_0x898b('0x43')](_0x4d555c[_0x898b('0x40')],{'$or':_['map'](_0x4d555c[_0x898b('0x3a')],function(_0xe26046){var _0x40060b={};_0x40060b[_0xe26046]={'$like':'%'+_0x2bbaa7['query'][_0x898b('0x42')]+'%'};return _0x40060b;})});}_0x4d555c=_[_0x898b('0x43')]({},_0x4d555c,_0x2bbaa7[_0x898b('0x45')]);return _0x2c8278[_0x898b('0x50')](_0x4d555c);}})[_0x898b('0x2a')](function(_0x49f69c){if(_0x49f69c){_0x59eeaf=_0x49f69c[_0x898b('0x3b')];if(!_0x2bbaa7[_0x898b('0x35')][_0x898b('0x3c')](_0x898b('0x3d'))){_0x4d555c['limit']=qs['limit'](_0x2bbaa7['query']['limit']);_0x4d555c[_0x898b('0x20')]=qs[_0x898b('0x20')](_0x2bbaa7[_0x898b('0x35')][_0x898b('0x20')]);}return _0x2c8278[_0x898b('0x50')](_0x4d555c);}})[_0x898b('0x2a')](function(_0x29d362){if(_0x29d362){return _0x29d362?{'count':_0x59eeaf,'rows':_0x29d362}:null;}})[_0x898b('0x2a')](respondWithResult(_0x569ece,null))[_0x898b('0x4a')](handleError(_0x569ece,null));};exports[_0x898b('0x53')]=function(_0x40b091,_0x47851a,_0x156a27){if(_0x40b091[_0x898b('0x4e')]['id']){delete _0x40b091[_0x898b('0x4e')]['id'];}return db['FreshdeskAccount'][_0x898b('0x51')]({'where':{'id':_0x40b091['params']['id']}})['then'](handleEntityNotFound(_0x47851a,null))[_0x898b('0x2a')](function(_0x1cf6d9){if(_0x1cf6d9){_0x40b091[_0x898b('0x4e')][_0x898b('0x54')]=_0x1cf6d9['id'];_0x40b091[_0x898b('0x4e')][_0x898b('0x55')]=integrations['getSubjects'](_0x40b091[_0x898b('0x4e')]['channel'],_0x40b091[_0x898b('0x4e')][_0x898b('0x32')]);_0x40b091['body'][_0x898b('0x56')]=integrations[_0x898b('0x57')](_0x40b091[_0x898b('0x4e')]['channel'],_0x40b091[_0x898b('0x4e')]['type']);return db[_0x898b('0x52')][_0x898b('0x4d')](_0x40b091[_0x898b('0x4e')],{'include':[{'model':db[_0x898b('0x58')],'as':'Subjects'},{'model':db[_0x898b('0x58')],'as':_0x898b('0x56')}]});}return null;})[_0x898b('0x2a')](respondWithResult(_0x47851a,null))[_0x898b('0x4a')](handleError(_0x47851a,null));};exports[_0x898b('0x59')]=function(_0x4ea3f5,_0x30e35c,_0xb4cb2a){var _0x1232e1='';return db[_0x898b('0x30')]['findOne']({'where':{'id':_0x4ea3f5[_0x898b('0x4b')]['id']},'attributes':['id',_0x898b('0x5a'),'apiKey']})[_0x898b('0x2a')](handleEntityNotFound(_0x30e35c,null))[_0x898b('0x2a')](function(_0x1be43a){if(_0x1be43a){_0x1232e1=_0x1be43a[_0x898b('0x5a')];var _0xda29bb=_0x1232e1[_0x898b('0x5b')](-0x1);if(_0xda29bb==='/'){_0x1232e1=_0x1232e1[_0x898b('0x5c')](0x0,_0x1232e1[_0x898b('0x5d')](_0xda29bb));}return rp({'method':_0x898b('0x5e'),'uri':util[_0x898b('0x5f')](_0x898b('0x60'),_0x1232e1,_0x898b('0x61')),'headers':{'Authorization':util[_0x898b('0x5f')](_0x898b('0x62'),new Buffer(util['format'](_0x898b('0x63'),_0x1be43a[_0x898b('0x64')]))['toString'](_0x898b('0x65')))},'json':!![]});}})[_0x898b('0x2a')](function(_0x596624){if(_0x596624){var _0x134b83=[_0x898b('0x66'),_0x898b('0x67'),_0x898b('0x68'),_0x898b('0x69'),_0x898b('0x1e'),_0x898b('0x6a'),'group','source','ticket_type',_0x898b('0x6b'),_0x898b('0x6c')];_[_0x898b('0x6d')](_0x596624,function(_0x290f94){return _0x134b83[_0x898b('0x6e')](_0x290f94[_0x898b('0x2c')])||!_0x290f94[_0x898b('0x6f')]&&_0x290f94[_0x898b('0x32')]!==_0x898b('0x70')&&_0x290f94[_0x898b('0x32')]!==_0x898b('0x71');});return{'count':_0x596624[_0x898b('0x3b')],'rows':_['map'](_0x596624,function(_0x5e6b69){return{'id':_0x5e6b69['name'],'name':_0x5e6b69[_0x898b('0x72')],'custom':!_0x5e6b69[_0x898b('0x6f')],'options':_0x5e6b69[_0x898b('0x73')]?_['map'](_0x5e6b69[_0x898b('0x73')],function(_0x24c7a2){return{'name':_[_0x898b('0x74')](_0x24c7a2),'value':_0x24c7a2};}):[]};})};}})[_0x898b('0x2a')](respondWithResult(_0x30e35c,null))[_0x898b('0x4a')](function(_0x12b3d2){var _0x31f8e2=_0x4ea3f5[_0x898b('0x35')]['test']?0x1f4:_0x12b3d2['statusCode']||0x1f4;logger[_0x898b('0x75')](_0x898b('0x76'),'getFields',_0x31f8e2,JSON['stringify'](_0x12b3d2));delete _0x12b3d2['name'];if(_0x31f8e2===0x191){_0x31f8e2=0x190;}_0x30e35c['status'](_0x31f8e2)[_0x898b('0x2d')](_0x4ea3f5[_0x898b('0x35')][_0x898b('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x12b3d2['statusCode']}:_0x12b3d2);});}; \ No newline at end of file +var _0x7382=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','findOne','getConfigurations','AccountId','Subjects','getSubjects','channel','getDescriptions','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','base64','agent','description','source','ticket_type','group','company','remove','includes','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','FreshdeskAccount','fieldName','type','key','model','query','keys','attributes','intersection','fields'];(function(_0xe96d3f,_0xa68809){var _0x4a72d0=function(_0x1b0c22){while(--_0x1b0c22){_0xe96d3f['push'](_0xe96d3f['shift']());}};_0x4a72d0(++_0xa68809);}(_0x7382,0x1f2));var _0x2738=function(_0x3b0cb9,_0x1bd07e){_0x3b0cb9=_0x3b0cb9-0x0;var _0x5eea09=_0x7382[_0x3b0cb9];return _0x5eea09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2738('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2738('0x1'));var moment=require('moment');var BPromise=require(_0x2738('0x2'));var Mustache=require('mustache');var util=require(_0x2738('0x3'));var path=require(_0x2738('0x4'));var sox=require('sox');var csv=require(_0x2738('0x5'));var ejs=require(_0x2738('0x6'));var fs=require('fs');var fs_extra=require(_0x2738('0x7'));var _=require(_0x2738('0x8'));var squel=require('squel');var crypto=require(_0x2738('0x9'));var jsforce=require(_0x2738('0xa'));var deskjs=require(_0x2738('0xb'));var toCsv=require(_0x2738('0x5'));var querystring=require(_0x2738('0xc'));var Papa=require('papaparse');var Redis=require(_0x2738('0xd'));var authService=require(_0x2738('0xe'));var qs=require(_0x2738('0xf'));var as=require(_0x2738('0x10'));var hardwareService=require(_0x2738('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2738('0x12'));var licenseUtil=require(_0x2738('0x13'));var db=require(_0x2738('0x14'))['db'];var integrations=require(_0x2738('0x15'));function respondWithStatusCode(_0x263b48,_0x41b111){_0x41b111=_0x41b111||0xcc;return function(_0x39a20f){if(_0x39a20f){return _0x263b48[_0x2738('0x16')](_0x41b111);}return _0x263b48[_0x2738('0x17')](_0x41b111)[_0x2738('0x18')]();};}function respondWithResult(_0x4584f8,_0x1d2de7){_0x1d2de7=_0x1d2de7||0xc8;return function(_0x5af8b6){if(_0x5af8b6){return _0x4584f8[_0x2738('0x17')](_0x1d2de7)[_0x2738('0x19')](_0x5af8b6);}};}function respondWithFilteredResult(_0x547823,_0x4cde16){return function(_0x1542b6){if(_0x1542b6){var _0x3a728e=typeof _0x4cde16[_0x2738('0x1a')]==='undefined'&&typeof _0x4cde16[_0x2738('0x1b')]===_0x2738('0x1c');var _0x38e8d8=_0x1542b6[_0x2738('0x1d')];var _0x19d331=_0x3a728e?0x0:_0x4cde16['offset'];var _0x43cab3=_0x3a728e?_0x1542b6[_0x2738('0x1d')]:_0x4cde16[_0x2738('0x1a')]+_0x4cde16[_0x2738('0x1b')];var _0x36d4e8;if(_0x43cab3>=_0x38e8d8){_0x43cab3=_0x38e8d8;_0x36d4e8=0xc8;}else{_0x36d4e8=0xce;}_0x547823[_0x2738('0x17')](_0x36d4e8);return _0x547823[_0x2738('0x1e')](_0x2738('0x1f'),_0x19d331+'-'+_0x43cab3+'/'+_0x38e8d8)[_0x2738('0x19')](_0x1542b6);}return null;};}function patchUpdates(_0x514e45){return function(_0x2bf857){try{jsonpatch['apply'](_0x2bf857,_0x514e45,!![]);}catch(_0x45e7c9){return BPromise[_0x2738('0x20')](_0x45e7c9);}return _0x2bf857[_0x2738('0x21')]();};}function saveUpdates(_0x36b4bb,_0x532cb8){return function(_0x524a2c){if(_0x524a2c){return _0x524a2c[_0x2738('0x22')](_0x36b4bb)[_0x2738('0x23')](function(_0x1637bb){return _0x1637bb;});}return null;};}function removeEntity(_0x476c38,_0x509c92){return function(_0x26f554){if(_0x26f554){return _0x26f554[_0x2738('0x24')]()[_0x2738('0x23')](function(){_0x476c38[_0x2738('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bb15e,_0x5b7fd0){return function(_0xdafdcd){if(!_0xdafdcd){_0x4bb15e[_0x2738('0x16')](0x194);}return _0xdafdcd;};}function handleError(_0x536d42,_0x2f0002){_0x2f0002=_0x2f0002||0x1f4;return function(_0x246f02){logger[_0x2738('0x25')](_0x246f02['stack']);if(_0x246f02[_0x2738('0x26')]){delete _0x246f02[_0x2738('0x26')];}_0x536d42[_0x2738('0x17')](_0x2f0002)[_0x2738('0x27')](_0x246f02);};}exports[_0x2738('0x28')]=function(_0x263ebd,_0x13343a){var _0x390d2d={},_0x39b7c0={},_0x4e1fc8={'count':0x0,'rows':[]};var _0x591577=_[_0x2738('0x29')](db[_0x2738('0x2a')]['rawAttributes'],function(_0x587f7b){return{'name':_0x587f7b[_0x2738('0x2b')],'type':_0x587f7b[_0x2738('0x2c')][_0x2738('0x2d')]};});_0x39b7c0[_0x2738('0x2e')]=_[_0x2738('0x29')](_0x591577,_0x2738('0x26'));_0x39b7c0[_0x2738('0x2f')]=_[_0x2738('0x30')](_0x263ebd[_0x2738('0x2f')]);_0x39b7c0['filters']=_['intersection'](_0x39b7c0[_0x2738('0x2e')],_0x39b7c0[_0x2738('0x2f')]);_0x390d2d[_0x2738('0x31')]=_[_0x2738('0x32')](_0x39b7c0[_0x2738('0x2e')],qs['fields'](_0x263ebd[_0x2738('0x2f')][_0x2738('0x33')]));_0x390d2d[_0x2738('0x31')]=_0x390d2d[_0x2738('0x31')][_0x2738('0x34')]?_0x390d2d[_0x2738('0x31')]:_0x39b7c0[_0x2738('0x2e')];if(!_0x263ebd[_0x2738('0x2f')][_0x2738('0x35')](_0x2738('0x36'))){_0x390d2d[_0x2738('0x1b')]=qs[_0x2738('0x1b')](_0x263ebd[_0x2738('0x2f')][_0x2738('0x1b')]);_0x390d2d[_0x2738('0x1a')]=qs[_0x2738('0x1a')](_0x263ebd[_0x2738('0x2f')][_0x2738('0x1a')]);}_0x390d2d[_0x2738('0x37')]=qs[_0x2738('0x38')](_0x263ebd[_0x2738('0x2f')][_0x2738('0x38')]);_0x390d2d[_0x2738('0x39')]=qs[_0x2738('0x3a')](_[_0x2738('0x3b')](_0x263ebd[_0x2738('0x2f')],_0x39b7c0[_0x2738('0x3a')]),_0x591577);if(_0x263ebd[_0x2738('0x2f')][_0x2738('0x3c')]){_0x390d2d[_0x2738('0x39')]=_[_0x2738('0x3d')](_0x390d2d[_0x2738('0x39')],{'$or':_[_0x2738('0x29')](_0x591577,function(_0xf94d4a){if(_0xf94d4a['type']!==_0x2738('0x3e')){var _0x5f5d01={};_0x5f5d01[_0xf94d4a[_0x2738('0x26')]]={'$like':'%'+_0x263ebd[_0x2738('0x2f')][_0x2738('0x3c')]+'%'};return _0x5f5d01;}})});}_0x390d2d=_[_0x2738('0x3d')]({},_0x390d2d,_0x263ebd[_0x2738('0x3f')]);var _0x249729={'where':_0x390d2d['where']};return db[_0x2738('0x2a')]['count'](_0x249729)[_0x2738('0x23')](function(_0x66bee0){_0x4e1fc8[_0x2738('0x1d')]=_0x66bee0;if(_0x263ebd[_0x2738('0x2f')][_0x2738('0x40')]){_0x390d2d['include']=[{'all':!![]}];}return db[_0x2738('0x2a')][_0x2738('0x41')](_0x390d2d);})['then'](function(_0x31d16b){_0x4e1fc8[_0x2738('0x42')]=_0x31d16b;return _0x4e1fc8;})['then'](respondWithFilteredResult(_0x13343a,_0x390d2d))[_0x2738('0x43')](handleError(_0x13343a,null));};exports[_0x2738('0x44')]=function(_0x3d4a57,_0x291d51){var _0x3c9fdd={'raw':![],'where':{'id':_0x3d4a57[_0x2738('0x45')]['id']}},_0x58d84d={};_0x58d84d[_0x2738('0x2e')]=_[_0x2738('0x30')](db[_0x2738('0x2a')][_0x2738('0x46')]);_0x58d84d[_0x2738('0x2f')]=_['keys'](_0x3d4a57[_0x2738('0x2f')]);_0x58d84d[_0x2738('0x3a')]=_[_0x2738('0x32')](_0x58d84d[_0x2738('0x2e')],_0x58d84d[_0x2738('0x2f')]);_0x3c9fdd[_0x2738('0x31')]=_[_0x2738('0x32')](_0x58d84d[_0x2738('0x2e')],qs[_0x2738('0x33')](_0x3d4a57[_0x2738('0x2f')][_0x2738('0x33')]));_0x3c9fdd['attributes']=_0x3c9fdd[_0x2738('0x31')]['length']?_0x3c9fdd[_0x2738('0x31')]:_0x58d84d[_0x2738('0x2e')];if(_0x3d4a57['query'][_0x2738('0x40')]){_0x3c9fdd['include']=[{'all':!![]}];}_0x3c9fdd=_['merge']({},_0x3c9fdd,_0x3d4a57['options']);return db[_0x2738('0x2a')][_0x2738('0x47')](_0x3c9fdd)[_0x2738('0x23')](handleEntityNotFound(_0x291d51,null))['then'](respondWithResult(_0x291d51,null))['catch'](handleError(_0x291d51,null));};exports[_0x2738('0x48')]=function(_0x54a9b7,_0x108948){return db[_0x2738('0x2a')][_0x2738('0x48')](_0x54a9b7['body'],{})[_0x2738('0x23')](respondWithResult(_0x108948,0xc9))[_0x2738('0x43')](handleError(_0x108948,null));};exports[_0x2738('0x22')]=function(_0x44edeb,_0x26e12a){if(_0x44edeb[_0x2738('0x49')]['id']){delete _0x44edeb['body']['id'];}return db[_0x2738('0x2a')][_0x2738('0x47')]({'where':{'id':_0x44edeb[_0x2738('0x45')]['id']}})[_0x2738('0x23')](handleEntityNotFound(_0x26e12a,null))[_0x2738('0x23')](saveUpdates(_0x44edeb[_0x2738('0x49')],null))[_0x2738('0x23')](respondWithResult(_0x26e12a,null))[_0x2738('0x43')](handleError(_0x26e12a,null));};exports[_0x2738('0x24')]=function(_0x34967a,_0x4d31aa){return db['FreshdeskAccount']['find']({'where':{'id':_0x34967a['params']['id']}})[_0x2738('0x23')](handleEntityNotFound(_0x4d31aa,null))[_0x2738('0x23')](removeEntity(_0x4d31aa,null))[_0x2738('0x43')](handleError(_0x4d31aa,null));};exports['getConfigurations']=function(_0x178194,_0x58e3b,_0x123462){var _0x53dd04={};var _0x5af65f={};var _0x49c4ef;var _0x71063a;return db[_0x2738('0x2a')][_0x2738('0x4a')]({'where':{'id':_0x178194[_0x2738('0x45')]['id']}})[_0x2738('0x23')](handleEntityNotFound(_0x58e3b,null))[_0x2738('0x23')](function(_0x4300aa){if(_0x4300aa){_0x49c4ef=_0x4300aa;_0x5af65f[_0x2738('0x2e')]=_[_0x2738('0x30')](db['FreshdeskConfiguration'][_0x2738('0x46')]);_0x5af65f[_0x2738('0x2f')]=_['keys'](_0x178194[_0x2738('0x2f')]);_0x5af65f[_0x2738('0x3a')]=_[_0x2738('0x32')](_0x5af65f[_0x2738('0x2e')],_0x5af65f['query']);_0x53dd04[_0x2738('0x31')]=_[_0x2738('0x32')](_0x5af65f['model'],qs[_0x2738('0x33')](_0x178194[_0x2738('0x2f')]['fields']));_0x53dd04[_0x2738('0x31')]=_0x53dd04[_0x2738('0x31')][_0x2738('0x34')]?_0x53dd04[_0x2738('0x31')]:_0x5af65f[_0x2738('0x2e')];_0x53dd04[_0x2738('0x37')]=qs[_0x2738('0x38')](_0x178194['query'][_0x2738('0x38')]);_0x53dd04[_0x2738('0x39')]=qs[_0x2738('0x3a')](_[_0x2738('0x3b')](_0x178194['query'],_0x5af65f[_0x2738('0x3a')]));if(_0x178194[_0x2738('0x2f')][_0x2738('0x3c')]){_0x53dd04[_0x2738('0x39')]=_[_0x2738('0x3d')](_0x53dd04[_0x2738('0x39')],{'$or':_[_0x2738('0x29')](_0x53dd04[_0x2738('0x31')],function(_0x44e996){var _0x463a42={};_0x463a42[_0x44e996]={'$like':'%'+_0x178194[_0x2738('0x2f')][_0x2738('0x3c')]+'%'};return _0x463a42;})});}_0x53dd04=_[_0x2738('0x3d')]({},_0x53dd04,_0x178194['options']);return _0x49c4ef[_0x2738('0x4b')](_0x53dd04);}})[_0x2738('0x23')](function(_0x5b18ec){if(_0x5b18ec){_0x71063a=_0x5b18ec[_0x2738('0x34')];if(!_0x178194[_0x2738('0x2f')][_0x2738('0x35')](_0x2738('0x36'))){_0x53dd04[_0x2738('0x1b')]=qs[_0x2738('0x1b')](_0x178194[_0x2738('0x2f')]['limit']);_0x53dd04['offset']=qs[_0x2738('0x1a')](_0x178194[_0x2738('0x2f')][_0x2738('0x1a')]);}return _0x49c4ef[_0x2738('0x4b')](_0x53dd04);}})[_0x2738('0x23')](function(_0x3f47f6){if(_0x3f47f6){return _0x3f47f6?{'count':_0x71063a,'rows':_0x3f47f6}:null;}})[_0x2738('0x23')](respondWithResult(_0x58e3b,null))['catch'](handleError(_0x58e3b,null));};exports['addConfiguration']=function(_0x4194d0,_0x9e0db1,_0x4c2ea3){if(_0x4194d0['body']['id']){delete _0x4194d0[_0x2738('0x49')]['id'];}return db['FreshdeskAccount'][_0x2738('0x4a')]({'where':{'id':_0x4194d0[_0x2738('0x45')]['id']}})['then'](handleEntityNotFound(_0x9e0db1,null))[_0x2738('0x23')](function(_0x499584){if(_0x499584){_0x4194d0[_0x2738('0x49')][_0x2738('0x4c')]=_0x499584['id'];_0x4194d0[_0x2738('0x49')][_0x2738('0x4d')]=integrations[_0x2738('0x4e')](_0x4194d0[_0x2738('0x49')][_0x2738('0x4f')],_0x4194d0[_0x2738('0x49')][_0x2738('0x2c')]);_0x4194d0[_0x2738('0x49')]['Descriptions']=integrations[_0x2738('0x50')](_0x4194d0[_0x2738('0x49')][_0x2738('0x4f')],_0x4194d0['body'][_0x2738('0x2c')]);return db['FreshdeskConfiguration']['create'](_0x4194d0['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x2738('0x4d')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x2738('0x23')](respondWithResult(_0x9e0db1,null))[_0x2738('0x43')](handleError(_0x9e0db1,null));};exports['getFields']=function(_0x488114,_0x257b5d,_0x2250ea){var _0x44dd79='';return db[_0x2738('0x2a')]['findOne']({'where':{'id':_0x488114['params']['id']},'attributes':['id',_0x2738('0x51'),'apiKey']})[_0x2738('0x23')](handleEntityNotFound(_0x257b5d,null))[_0x2738('0x23')](function(_0x39c866){if(_0x39c866){_0x44dd79=_0x39c866['remoteUri'];var _0x4ac660=_0x44dd79[_0x2738('0x52')](-0x1);if(_0x4ac660==='/'){_0x44dd79=_0x44dd79['substring'](0x0,_0x44dd79[_0x2738('0x53')](_0x4ac660));}return rp({'method':_0x2738('0x54'),'uri':util[_0x2738('0x55')](_0x2738('0x56'),_0x44dd79,_0x2738('0x57')),'headers':{'Authorization':util[_0x2738('0x55')](_0x2738('0x58'),new Buffer(util[_0x2738('0x55')](_0x2738('0x59'),_0x39c866[_0x2738('0x5a')]))['toString'](_0x2738('0x5b')))},'json':!![]});}})[_0x2738('0x23')](function(_0x39efb9){if(_0x39efb9){var _0x152bc6=['requester','subject',_0x2738('0x5c'),_0x2738('0x5d'),'status','priority','group',_0x2738('0x5e'),_0x2738('0x5f'),_0x2738('0x60'),_0x2738('0x61')];_[_0x2738('0x62')](_0x39efb9,function(_0x153574){return _0x152bc6[_0x2738('0x63')](_0x153574['name'])||!_0x153574['default']&&_0x153574[_0x2738('0x2c')]!=='custom_text'&&_0x153574[_0x2738('0x2c')]!=='custom_dropdown';});return{'count':_0x39efb9['length'],'rows':_[_0x2738('0x29')](_0x39efb9,function(_0x443855){return{'id':_0x443855[_0x2738('0x26')],'name':_0x443855[_0x2738('0x64')],'custom':!_0x443855[_0x2738('0x65')],'options':_0x443855[_0x2738('0x66')]?_[_0x2738('0x29')](_0x443855[_0x2738('0x66')],function(_0x286d64){return{'name':_[_0x2738('0x67')](_0x286d64),'value':_0x286d64};}):[]};})};}})[_0x2738('0x23')](respondWithResult(_0x257b5d,null))['catch'](function(_0x340177){var _0x58ab72=_0x488114['query'][_0x2738('0x68')]?0x1f4:_0x340177[_0x2738('0x69')]||0x1f4;logger[_0x2738('0x25')](_0x2738('0x6a'),_0x2738('0x6b'),_0x58ab72,JSON[_0x2738('0x6c')](_0x340177));delete _0x340177[_0x2738('0x26')];if(_0x58ab72===0x191){_0x58ab72=0x190;}_0x257b5d[_0x2738('0x17')](_0x58ab72)[_0x2738('0x27')](_0x488114['query'][_0x2738('0x68')]?{'message':_0x2738('0x6d'),'statusCode':_0x340177['statusCode']}:_0x340177);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 0173f29..0194ab9 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 _0x0c9b=['moment','request-promise','rimraf','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api'];(function(_0x512738,_0x52ef6b){var _0x1bdb2b=function(_0x24d1ff){while(--_0x24d1ff){_0x512738['push'](_0x512738['shift']());}};_0x1bdb2b(++_0x52ef6b);}(_0x0c9b,0x147));var _0xb0c9=function(_0x3bbbc1,_0x6ea9cc){_0x3bbbc1=_0x3bbbc1-0x0;var _0x4e7284=_0x0c9b[_0x3bbbc1];return _0x4e7284;};'use strict';var _=require(_0xb0c9('0x0'));var util=require(_0xb0c9('0x1'));var logger=require('../../config/logger')(_0xb0c9('0x2'));var moment=require(_0xb0c9('0x3'));var BPromise=require('bluebird');var rp=require(_0xb0c9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb0c9('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xb0c9('0x6')]=function(_0x1c82f4,_0x3bfddc){return _0x1c82f4[_0xb0c9('0x7')](_0xb0c9('0x8'),attributes,{'tableName':_0xb0c9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c08=['define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../components/integrations/configuration','exports'];(function(_0x5a16c7,_0x27cb11){var _0x162004=function(_0x12ddad){while(--_0x12ddad){_0x5a16c7['push'](_0x5a16c7['shift']());}};_0x162004(++_0x27cb11);}(_0x8c08,0x18f));var _0x88c0=function(_0x1b5a5a,_0x1c3b75){_0x1b5a5a=_0x1b5a5a-0x0;var _0x42b32d=_0x8c08[_0x1b5a5a];return _0x42b32d;};'use strict';var _=require(_0x88c0('0x0'));var util=require(_0x88c0('0x1'));var logger=require(_0x88c0('0x2'))(_0x88c0('0x3'));var moment=require('moment');var BPromise=require(_0x88c0('0x4'));var rp=require(_0x88c0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x88c0('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x88c0('0x7'));module[_0x88c0('0x8')]=function(_0x4218e1,_0x53f0aa){return _0x4218e1[_0x88c0('0x9')](_0x88c0('0xa'),attributes,{'tableName':_0x88c0('0xb'),'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 8eb56a7..904da46 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 _0x4e3f=['include','map','model','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes'];(function(_0x2ec00a,_0x23412a){var _0x27b616=function(_0x1bb2c5){while(--_0x1bb2c5){_0x2ec00a['push'](_0x2ec00a['shift']());}};_0x27b616(++_0x23412a);}(_0x4e3f,0x11c));var _0xf4e3=function(_0x4b7e5b,_0x36698e){_0x4b7e5b=_0x4b7e5b-0x0;var _0x5a2bf5=_0x4e3f[_0x4b7e5b];return _0x5a2bf5;};'use strict';var _=require(_0xf4e3('0x0'));var util=require(_0xf4e3('0x1'));var moment=require(_0xf4e3('0x2'));var BPromise=require(_0xf4e3('0x3'));var rs=require(_0xf4e3('0x4'));var fs=require('fs');var Redis=require(_0xf4e3('0x5'));var db=require(_0xf4e3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4e3('0x7'))(_0xf4e3('0x8'));var config=require(_0xf4e3('0x9'));var jayson=require(_0xf4e3('0xa'));var client=jayson[_0xf4e3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a7275,_0x305f19,_0x5d2d9d){return new BPromise(function(_0x639d72,_0x1aa65e){return client['request'](_0x1a7275,_0x5d2d9d)[_0xf4e3('0xc')](function(_0x3dc147){logger[_0xf4e3('0xd')](_0xf4e3('0xe'),_0x305f19,'request\x20sent');logger[_0xf4e3('0xf')](_0xf4e3('0x10'),_0x305f19,_0xf4e3('0x11'),JSON[_0xf4e3('0x12')](_0x3dc147));if(_0x3dc147[_0xf4e3('0x13')]){if(_0x3dc147[_0xf4e3('0x13')][_0xf4e3('0x14')]===0x1f4){logger[_0xf4e3('0x13')](_0xf4e3('0xe'),_0x305f19,_0x3dc147[_0xf4e3('0x13')][_0xf4e3('0x15')]);return _0x1aa65e(_0x3dc147['error']['message']);}logger['error'](_0xf4e3('0xe'),_0x305f19,_0x3dc147[_0xf4e3('0x13')][_0xf4e3('0x15')]);return _0x639d72(_0x3dc147[_0xf4e3('0x13')][_0xf4e3('0x15')]);}else{logger[_0xf4e3('0xd')](_0xf4e3('0xe'),_0x305f19,_0xf4e3('0x11'));_0x639d72(_0x3dc147[_0xf4e3('0x16')][_0xf4e3('0x15')]);}})[_0xf4e3('0x17')](function(_0x556b7f){logger['error'](_0xf4e3('0xe'),_0x305f19,_0x556b7f);_0x1aa65e(_0x556b7f);});});}exports[_0xf4e3('0x18')]=function(_0x261fb0){var _0x179bab=this;return new Promise(function(_0x21d20b,_0x121bfd){return db[_0xf4e3('0x19')][_0xf4e3('0x1a')]({'raw':_0x261fb0['options']?_0x261fb0[_0xf4e3('0x1b')][_0xf4e3('0x1c')]===undefined?!![]:![]:!![],'where':_0x261fb0['options']?_0x261fb0[_0xf4e3('0x1b')][_0xf4e3('0x1d')]||null:null,'attributes':_0x261fb0['options']?_0x261fb0[_0xf4e3('0x1b')][_0xf4e3('0x1e')]||null:null,'limit':_0x261fb0[_0xf4e3('0x1b')]?_0x261fb0[_0xf4e3('0x1b')]['limit']||null:null,'include':_0x261fb0[_0xf4e3('0x1b')]?_0x261fb0[_0xf4e3('0x1b')][_0xf4e3('0x1f')]?_[_0xf4e3('0x20')](_0x261fb0[_0xf4e3('0x1b')][_0xf4e3('0x1f')],function(_0x51b533){return{'model':db[_0x51b533[_0xf4e3('0x21')]],'as':_0x51b533['as'],'attributes':_0x51b533['attributes'],'include':_0x51b533[_0xf4e3('0x1f')]?_[_0xf4e3('0x20')](_0x51b533[_0xf4e3('0x1f')],function(_0x40b2ca){return{'model':db[_0x40b2ca['model']],'as':_0x40b2ca['as'],'attributes':_0x40b2ca['attributes'],'include':_0x40b2ca[_0xf4e3('0x1f')]?_[_0xf4e3('0x20')](_0x40b2ca['include'],function(_0x453c79){return{'model':db[_0x453c79[_0xf4e3('0x21')]],'as':_0x453c79['as'],'attributes':_0x453c79[_0xf4e3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf4e3('0xc')](function(_0x523168){logger['info']('GetFreshdeskAccount',_0x261fb0);logger[_0xf4e3('0xf')](_0xf4e3('0x18'),_0x261fb0,JSON[_0xf4e3('0x12')](_0x523168));_0x21d20b(_0x523168);})[_0xf4e3('0x17')](function(_0x410b41){logger[_0xf4e3('0x13')](_0xf4e3('0x18'),_0x410b41[_0xf4e3('0x15')],_0x261fb0);_0x121bfd(_0x179bab[_0xf4e3('0x13')](0x1f4,_0x410b41[_0xf4e3('0x15')]));});});};exports[_0xf4e3('0x22')]=function(_0x5cb8fc){var _0x1f46cc=this;return new Promise(function(_0x1f8384,_0x5d000e){return db[_0xf4e3('0x19')]['find']({'raw':_0x5cb8fc['options']?_0x5cb8fc[_0xf4e3('0x1b')][_0xf4e3('0x1c')]===undefined?!![]:![]:!![],'where':_0x5cb8fc[_0xf4e3('0x1b')]?_0x5cb8fc['options'][_0xf4e3('0x1d')]||null:null,'attributes':_0x5cb8fc[_0xf4e3('0x1b')]?_0x5cb8fc[_0xf4e3('0x1b')][_0xf4e3('0x1e')]||null:null,'include':_0x5cb8fc[_0xf4e3('0x1b')]?_0x5cb8fc[_0xf4e3('0x1b')][_0xf4e3('0x1f')]?_[_0xf4e3('0x20')](_0x5cb8fc['options'][_0xf4e3('0x1f')],function(_0x292b9f){return{'model':db[_0x292b9f[_0xf4e3('0x21')]],'as':_0x292b9f['as'],'attributes':_0x292b9f['attributes'],'include':_0x292b9f['include']?_[_0xf4e3('0x20')](_0x292b9f[_0xf4e3('0x1f')],function(_0x2f5a02){return{'model':db[_0x2f5a02[_0xf4e3('0x21')]],'as':_0x2f5a02['as'],'attributes':_0x2f5a02['attributes'],'include':_0x2f5a02['include']?_[_0xf4e3('0x20')](_0x2f5a02[_0xf4e3('0x1f')],function(_0x218d1a){return{'model':db[_0x218d1a[_0xf4e3('0x21')]],'as':_0x218d1a['as'],'attributes':_0x218d1a[_0xf4e3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf4e3('0xc')](function(_0x30e593){logger[_0xf4e3('0xd')](_0xf4e3('0x22'),_0x5cb8fc);logger[_0xf4e3('0xf')](_0xf4e3('0x22'),_0x5cb8fc,JSON[_0xf4e3('0x12')](_0x30e593));_0x1f8384(_0x30e593);})['catch'](function(_0x5abfcd){logger['error']('ShowFreshdeskAccount',_0x5abfcd[_0xf4e3('0x15')],_0x5cb8fc);_0x5d000e(_0x1f46cc[_0xf4e3('0x13')](0x1f4,_0x5abfcd[_0xf4e3('0x15')]));});});}; \ No newline at end of file +var _0x078c=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetFreshdeskAccount','find','ShowFreshdeskAccount','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0xbf2b15,_0xdaf747){var _0x5bd241=function(_0x46e31e){while(--_0x46e31e){_0xbf2b15['push'](_0xbf2b15['shift']());}};_0x5bd241(++_0xdaf747);}(_0x078c,0x19f));var _0xc078=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x078c[_0x11e30d];return _0x2d4e29;};'use strict';var _=require(_0xc078('0x0'));var util=require('util');var moment=require(_0xc078('0x1'));var BPromise=require(_0xc078('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc078('0x3'));var db=require(_0xc078('0x4'))['db'];var utils=require(_0xc078('0x5'));var logger=require(_0xc078('0x6'))('rpc');var config=require(_0xc078('0x7'));var jayson=require(_0xc078('0x8'));var client=jayson[_0xc078('0x9')][_0xc078('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40e428,_0x1705b0,_0x22661e){return new BPromise(function(_0x4030b1,_0x4d56df){return client['request'](_0x40e428,_0x22661e)['then'](function(_0x28dc54){logger[_0xc078('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x1705b0,_0xc078('0xc'));logger[_0xc078('0xd')](_0xc078('0xe'),_0x1705b0,_0xc078('0xc'),JSON[_0xc078('0xf')](_0x28dc54));if(_0x28dc54['error']){if(_0x28dc54['error'][_0xc078('0x10')]===0x1f4){logger[_0xc078('0x11')](_0xc078('0x12'),_0x1705b0,_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);return _0x4d56df(_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);}logger[_0xc078('0x11')](_0xc078('0x12'),_0x1705b0,_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);return _0x4030b1(_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);}else{logger[_0xc078('0xb')](_0xc078('0x12'),_0x1705b0,'request\x20sent');_0x4030b1(_0x28dc54[_0xc078('0x14')][_0xc078('0x13')]);}})[_0xc078('0x15')](function(_0x595b14){logger[_0xc078('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x1705b0,_0x595b14);_0x4d56df(_0x595b14);});});}exports['GetFreshdeskAccount']=function(_0xfd361b){var _0x4ac728=this;return new Promise(function(_0x2ec2d5,_0x5dad9a){return db[_0xc078('0x16')][_0xc078('0x17')]({'raw':_0xfd361b[_0xc078('0x18')]?_0xfd361b['options'][_0xc078('0x19')]===undefined?!![]:![]:!![],'where':_0xfd361b['options']?_0xfd361b[_0xc078('0x18')][_0xc078('0x1a')]||null:null,'attributes':_0xfd361b[_0xc078('0x18')]?_0xfd361b[_0xc078('0x18')][_0xc078('0x1b')]||null:null,'limit':_0xfd361b['options']?_0xfd361b[_0xc078('0x18')][_0xc078('0x1c')]||null:null,'include':_0xfd361b[_0xc078('0x18')]?_0xfd361b[_0xc078('0x18')]['include']?_[_0xc078('0x1d')](_0xfd361b[_0xc078('0x18')][_0xc078('0x1e')],function(_0x1cb7cb){return{'model':db[_0x1cb7cb[_0xc078('0x1f')]],'as':_0x1cb7cb['as'],'attributes':_0x1cb7cb[_0xc078('0x1b')],'include':_0x1cb7cb[_0xc078('0x1e')]?_[_0xc078('0x1d')](_0x1cb7cb[_0xc078('0x1e')],function(_0x3017a3){return{'model':db[_0x3017a3[_0xc078('0x1f')]],'as':_0x3017a3['as'],'attributes':_0x3017a3['attributes'],'include':_0x3017a3['include']?_[_0xc078('0x1d')](_0x3017a3['include'],function(_0x4a022a){return{'model':db[_0x4a022a['model']],'as':_0x4a022a['as'],'attributes':_0x4a022a[_0xc078('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x71d6ea){logger[_0xc078('0xb')](_0xc078('0x20'),_0xfd361b);logger[_0xc078('0xd')](_0xc078('0x20'),_0xfd361b,JSON[_0xc078('0xf')](_0x71d6ea));_0x2ec2d5(_0x71d6ea);})[_0xc078('0x15')](function(_0x3c481f){logger[_0xc078('0x11')](_0xc078('0x20'),_0x3c481f[_0xc078('0x13')],_0xfd361b);_0x5dad9a(_0x4ac728['error'](0x1f4,_0x3c481f[_0xc078('0x13')]));});});};exports['ShowFreshdeskAccount']=function(_0x3ba511){var _0x10949c=this;return new Promise(function(_0x229be4,_0x15645d){return db['FreshdeskAccount'][_0xc078('0x21')]({'raw':_0x3ba511['options']?_0x3ba511['options'][_0xc078('0x19')]===undefined?!![]:![]:!![],'where':_0x3ba511[_0xc078('0x18')]?_0x3ba511['options'][_0xc078('0x1a')]||null:null,'attributes':_0x3ba511[_0xc078('0x18')]?_0x3ba511[_0xc078('0x18')]['attributes']||null:null,'include':_0x3ba511['options']?_0x3ba511[_0xc078('0x18')]['include']?_[_0xc078('0x1d')](_0x3ba511[_0xc078('0x18')]['include'],function(_0x164552){return{'model':db[_0x164552[_0xc078('0x1f')]],'as':_0x164552['as'],'attributes':_0x164552[_0xc078('0x1b')],'include':_0x164552['include']?_[_0xc078('0x1d')](_0x164552[_0xc078('0x1e')],function(_0x3fb772){return{'model':db[_0x3fb772['model']],'as':_0x3fb772['as'],'attributes':_0x3fb772['attributes'],'include':_0x3fb772[_0xc078('0x1e')]?_[_0xc078('0x1d')](_0x3fb772['include'],function(_0x4d4cfb){return{'model':db[_0x4d4cfb['model']],'as':_0x4d4cfb['as'],'attributes':_0x4d4cfb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4383c9){logger[_0xc078('0xb')](_0xc078('0x22'),_0x3ba511);logger[_0xc078('0xd')]('ShowFreshdeskAccount',_0x3ba511,JSON[_0xc078('0xf')](_0x4383c9));_0x229be4(_0x4383c9);})['catch'](function(_0x5247f6){logger[_0xc078('0x11')](_0xc078('0x22'),_0x5247f6[_0xc078('0x13')],_0x3ba511);_0x15645d(_0x10949c[_0xc078('0x11')](0x1f4,_0x5247f6[_0xc078('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 8f11542..e036517 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 _0xa92c=['get','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','setTags','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated'];(function(_0x234c31,_0x453770){var _0x2dcbf3=function(_0xeecba7){while(--_0xeecba7){_0x234c31['push'](_0x234c31['shift']());}};_0x2dcbf3(++_0x453770);}(_0xa92c,0xf5));var _0xca92=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xa92c[_0x44bcb0];return _0xfaf881;};'use strict';var multer=require(_0xca92('0x0'));var util=require(_0xca92('0x1'));var path=require(_0xca92('0x2'));var timeout=require(_0xca92('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xca92('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xca92('0x5'));var controller=require(_0xca92('0x6'));router['get']('/',auth[_0xca92('0x7')](),controller['index']);router[_0xca92('0x8')]('/:id',auth[_0xca92('0x7')](),controller[_0xca92('0x9')]);router['get'](_0xca92('0xa'),auth[_0xca92('0x7')](),controller[_0xca92('0xb')]);router[_0xca92('0x8')](_0xca92('0xc'),auth[_0xca92('0x7')](),controller[_0xca92('0xd')]);router['get']('/:id/descriptions',auth[_0xca92('0x7')](),controller[_0xca92('0xe')]);router[_0xca92('0x8')](_0xca92('0xf'),auth[_0xca92('0x7')](),controller['getTags']);router['post']('/',auth[_0xca92('0x7')](),controller[_0xca92('0x10')]);router['post'](_0xca92('0xf'),auth[_0xca92('0x7')](),controller[_0xca92('0x11')]);router['put'](_0xca92('0x12'),auth[_0xca92('0x7')](),controller[_0xca92('0x13')]);router[_0xca92('0x14')](_0xca92('0x12'),auth['isAuthenticated'](),controller[_0xca92('0x15')]);module[_0xca92('0x16')]=router; \ No newline at end of file +var _0xfcfa=['post','create','setTags','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags'];(function(_0x2c263d,_0x36dc1c){var _0x2f667b=function(_0x280366){while(--_0x280366){_0x2c263d['push'](_0x2c263d['shift']());}};_0x2f667b(++_0x36dc1c);}(_0xfcfa,0x126));var _0xafcf=function(_0x425b6c,_0x33937d){_0x425b6c=_0x425b6c-0x0;var _0x1ca888=_0xfcfa[_0x425b6c];return _0x1ca888;};'use strict';var multer=require(_0xafcf('0x0'));var util=require('util');var path=require(_0xafcf('0x1'));var timeout=require(_0xafcf('0x2'));var express=require(_0xafcf('0x3'));var router=express[_0xafcf('0x4')]();var fs_extra=require(_0xafcf('0x5'));var auth=require(_0xafcf('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xafcf('0x7'));router[_0xafcf('0x8')]('/',auth[_0xafcf('0x9')](),controller['index']);router[_0xafcf('0x8')](_0xafcf('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xafcf('0x8')](_0xafcf('0xb'),auth[_0xafcf('0x9')](),controller[_0xafcf('0xc')]);router[_0xafcf('0x8')](_0xafcf('0xd'),auth[_0xafcf('0x9')](),controller[_0xafcf('0xe')]);router[_0xafcf('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xafcf('0xf')]);router[_0xafcf('0x8')](_0xafcf('0x10'),auth['isAuthenticated'](),controller[_0xafcf('0x11')]);router[_0xafcf('0x12')]('/',auth[_0xafcf('0x9')](),controller[_0xafcf('0x13')]);router['post'](_0xafcf('0x10'),auth['isAuthenticated'](),controller[_0xafcf('0x14')]);router[_0xafcf('0x15')](_0xafcf('0xa'),auth[_0xafcf('0x9')](),controller[_0xafcf('0x16')]);router[_0xafcf('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 4854b03..4ee7fa9 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 _0x3cd4=['STRING','sequelize','exports'];(function(_0x3db859,_0x4a8478){var _0x583d6c=function(_0x38b511){while(--_0x38b511){_0x3db859['push'](_0x3db859['shift']());}};_0x583d6c(++_0x4a8478);}(_0x3cd4,0xb8));var _0x43cd=function(_0x213560,_0x26e9ba){_0x213560=_0x213560-0x0;var _0xb1e3bd=_0x3cd4[_0x213560];return _0xb1e3bd;};'use strict';var Sequelize=require(_0x43cd('0x0'));module[_0x43cd('0x1')]={'name':{'type':Sequelize[_0x43cd('0x2')]},'description':{'type':Sequelize[_0x43cd('0x2')]}}; \ No newline at end of file +var _0x70e6=['exports','STRING','sequelize'];(function(_0x23fffa,_0x346383){var _0x1c217b=function(_0x411577){while(--_0x411577){_0x23fffa['push'](_0x23fffa['shift']());}};_0x1c217b(++_0x346383);}(_0x70e6,0x149));var _0x670e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x70e6[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0x670e('0x0'));module[_0x670e('0x1')]={'name':{'type':Sequelize[_0x670e('0x2')]},'description':{'type':Sequelize[_0x670e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index ac89f0c..2f11150 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 _0x1253=['reject','save','update','then','destroy','sendStatus','stack','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','name','query','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','keys','length','include','create','body','find','params','getFields','findOne','hasOwnProperty','getSubjects','getDescriptions','FreshdeskField','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','apply'];(function(_0x53b40f,_0x21e868){var _0x451200=function(_0x1bb724){while(--_0x1bb724){_0x53b40f['push'](_0x53b40f['shift']());}};_0x451200(++_0x21e868);}(_0x1253,0xdc));var _0x3125=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1253[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x3125('0x0'));var rimraf=require(_0x3125('0x1'));var zipdir=require(_0x3125('0x2'));var jsonpatch=require(_0x3125('0x3'));var rp=require(_0x3125('0x4'));var moment=require(_0x3125('0x5'));var BPromise=require(_0x3125('0x6'));var Mustache=require('mustache');var util=require(_0x3125('0x7'));var path=require(_0x3125('0x8'));var sox=require(_0x3125('0x9'));var csv=require(_0x3125('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3125('0xb'));var _=require('lodash');var squel=require(_0x3125('0xc'));var crypto=require(_0x3125('0xd'));var jsforce=require(_0x3125('0xe'));var deskjs=require(_0x3125('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3125('0x10'));var Papa=require(_0x3125('0x11'));var Redis=require(_0x3125('0x12'));var authService=require(_0x3125('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3125('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3125('0x15'))(_0x3125('0x16'));var utils=require(_0x3125('0x17'));var config=require(_0x3125('0x18'));var licenseUtil=require(_0x3125('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3436f6,_0x3c79dc){_0x3c79dc=_0x3c79dc||0xcc;return function(_0x3c8f7a){if(_0x3c8f7a){return _0x3436f6['sendStatus'](_0x3c79dc);}return _0x3436f6[_0x3125('0x1a')](_0x3c79dc)[_0x3125('0x1b')]();};}function respondWithResult(_0x196eab,_0x382d91){_0x382d91=_0x382d91||0xc8;return function(_0x52c801){if(_0x52c801){return _0x196eab['status'](_0x382d91)[_0x3125('0x1c')](_0x52c801);}};}function respondWithFilteredResult(_0x57325b,_0x5b549c){return function(_0x44ef4c){if(_0x44ef4c){var _0xcf238e=typeof _0x5b549c['offset']===_0x3125('0x1d')&&typeof _0x5b549c[_0x3125('0x1e')]===_0x3125('0x1d');var _0x4a9246=_0x44ef4c[_0x3125('0x1f')];var _0x21621d=_0xcf238e?0x0:_0x5b549c[_0x3125('0x20')];var _0x133fa5=_0xcf238e?_0x44ef4c[_0x3125('0x1f')]:_0x5b549c[_0x3125('0x20')]+_0x5b549c[_0x3125('0x1e')];var _0x322d8a;if(_0x133fa5>=_0x4a9246){_0x133fa5=_0x4a9246;_0x322d8a=0xc8;}else{_0x322d8a=0xce;}_0x57325b[_0x3125('0x1a')](_0x322d8a);return _0x57325b[_0x3125('0x21')]('Content-Range',_0x21621d+'-'+_0x133fa5+'/'+_0x4a9246)[_0x3125('0x1c')](_0x44ef4c);}return null;};}function patchUpdates(_0x58c8f1){return function(_0x3b7f2c){try{jsonpatch[_0x3125('0x22')](_0x3b7f2c,_0x58c8f1,!![]);}catch(_0x36a5f2){return BPromise[_0x3125('0x23')](_0x36a5f2);}return _0x3b7f2c[_0x3125('0x24')]();};}function saveUpdates(_0x3ff29f,_0x374fc3){return function(_0x26895f){if(_0x26895f){return _0x26895f[_0x3125('0x25')](_0x3ff29f)[_0x3125('0x26')](function(_0x55dd7d){return _0x55dd7d;});}return null;};}function removeEntity(_0x4051d6,_0x53e18c){return function(_0x133886){if(_0x133886){return _0x133886[_0x3125('0x27')]()['then'](function(){_0x4051d6['status'](0xcc)[_0x3125('0x1b')]();});}};}function handleEntityNotFound(_0x33bb54,_0x464448){return function(_0x159da0){if(!_0x159da0){_0x33bb54[_0x3125('0x28')](0x194);}return _0x159da0;};}function handleError(_0x3dacca,_0x341b4c){_0x341b4c=_0x341b4c||0x1f4;return function(_0x3b8342){logger['error'](_0x3b8342[_0x3125('0x29')]);if(_0x3b8342['name']){delete _0x3b8342['name'];}_0x3dacca['status'](_0x341b4c)[_0x3125('0x2a')](_0x3b8342);};}exports[_0x3125('0x2b')]=function(_0x48dc9b,_0x2c106e){var _0x5362de={},_0x808b7e={},_0x50a4c1={'count':0x0,'rows':[]};var _0x549f76=_[_0x3125('0x2c')](db[_0x3125('0x2d')][_0x3125('0x2e')],function(_0x4f703a){return{'name':_0x4f703a['fieldName'],'type':_0x4f703a[_0x3125('0x2f')][_0x3125('0x30')]};});_0x808b7e['model']=_[_0x3125('0x2c')](_0x549f76,_0x3125('0x31'));_0x808b7e[_0x3125('0x32')]=_['keys'](_0x48dc9b[_0x3125('0x32')]);_0x808b7e[_0x3125('0x33')]=_['intersection'](_0x808b7e[_0x3125('0x34')],_0x808b7e['query']);_0x5362de[_0x3125('0x35')]=_[_0x3125('0x36')](_0x808b7e['model'],qs[_0x3125('0x37')](_0x48dc9b[_0x3125('0x32')]['fields']));_0x5362de[_0x3125('0x35')]=_0x5362de[_0x3125('0x35')]['length']?_0x5362de['attributes']:_0x808b7e[_0x3125('0x34')];if(!_0x48dc9b[_0x3125('0x32')]['hasOwnProperty'](_0x3125('0x38'))){_0x5362de[_0x3125('0x1e')]=qs['limit'](_0x48dc9b[_0x3125('0x32')][_0x3125('0x1e')]);_0x5362de[_0x3125('0x20')]=qs[_0x3125('0x20')](_0x48dc9b[_0x3125('0x32')][_0x3125('0x20')]);}_0x5362de[_0x3125('0x39')]=qs['sort'](_0x48dc9b[_0x3125('0x32')][_0x3125('0x3a')]);_0x5362de[_0x3125('0x3b')]=qs[_0x3125('0x33')](_[_0x3125('0x3c')](_0x48dc9b[_0x3125('0x32')],_0x808b7e[_0x3125('0x33')]),_0x549f76);if(_0x48dc9b['query'][_0x3125('0x3d')]){_0x5362de[_0x3125('0x3b')]=_['merge'](_0x5362de[_0x3125('0x3b')],{'$or':_[_0x3125('0x2c')](_0x549f76,function(_0x227c81){if(_0x227c81[_0x3125('0x2f')]!==_0x3125('0x3e')){var _0xc22c4a={};_0xc22c4a[_0x227c81[_0x3125('0x31')]]={'$like':'%'+_0x48dc9b['query'][_0x3125('0x3d')]+'%'};return _0xc22c4a;}})});}_0x5362de=_[_0x3125('0x3f')]({},_0x5362de,_0x48dc9b[_0x3125('0x40')]);var _0x5936c6={'where':_0x5362de['where']};return db[_0x3125('0x2d')]['count'](_0x5936c6)[_0x3125('0x26')](function(_0x2964c9){_0x50a4c1[_0x3125('0x1f')]=_0x2964c9;if(_0x48dc9b['query'][_0x3125('0x41')]){_0x5362de['include']=[{'all':!![]}];}return db[_0x3125('0x2d')][_0x3125('0x42')](_0x5362de);})[_0x3125('0x26')](function(_0x3bd7f5){_0x50a4c1['rows']=_0x3bd7f5;return _0x50a4c1;})[_0x3125('0x26')](respondWithFilteredResult(_0x2c106e,_0x5362de))[_0x3125('0x43')](handleError(_0x2c106e,null));};exports[_0x3125('0x44')]=function(_0xc3053b,_0x2c53ac){var _0x419dee={'raw':![],'where':{'id':_0xc3053b['params']['id']}},_0xb236d8={};_0xb236d8[_0x3125('0x34')]=_['keys'](db['FreshdeskConfiguration'][_0x3125('0x2e')]);_0xb236d8[_0x3125('0x32')]=_[_0x3125('0x45')](_0xc3053b[_0x3125('0x32')]);_0xb236d8['filters']=_[_0x3125('0x36')](_0xb236d8[_0x3125('0x34')],_0xb236d8[_0x3125('0x32')]);_0x419dee[_0x3125('0x35')]=_[_0x3125('0x36')](_0xb236d8[_0x3125('0x34')],qs['fields'](_0xc3053b[_0x3125('0x32')][_0x3125('0x37')]));_0x419dee['attributes']=_0x419dee['attributes'][_0x3125('0x46')]?_0x419dee[_0x3125('0x35')]:_0xb236d8[_0x3125('0x34')];if(_0xc3053b[_0x3125('0x32')][_0x3125('0x41')]){_0x419dee[_0x3125('0x47')]=[{'all':!![]}];}_0x419dee=_[_0x3125('0x3f')]({},_0x419dee,_0xc3053b[_0x3125('0x40')]);return db['FreshdeskConfiguration']['find'](_0x419dee)['then'](handleEntityNotFound(_0x2c53ac,null))[_0x3125('0x26')](respondWithResult(_0x2c53ac,null))[_0x3125('0x43')](handleError(_0x2c53ac,null));};exports['create']=function(_0x2983e4,_0x3e096a){return db['FreshdeskConfiguration'][_0x3125('0x48')](_0x2983e4[_0x3125('0x49')],{})[_0x3125('0x26')](respondWithResult(_0x3e096a,0xc9))[_0x3125('0x43')](handleError(_0x3e096a,null));};exports[_0x3125('0x25')]=function(_0x145aa2,_0x1498aa){if(_0x145aa2[_0x3125('0x49')]['id']){delete _0x145aa2[_0x3125('0x49')]['id'];}return db[_0x3125('0x2d')][_0x3125('0x4a')]({'where':{'id':_0x145aa2[_0x3125('0x4b')]['id']}})[_0x3125('0x26')](handleEntityNotFound(_0x1498aa,null))[_0x3125('0x26')](saveUpdates(_0x145aa2['body'],null))[_0x3125('0x26')](respondWithResult(_0x1498aa,null))[_0x3125('0x43')](handleError(_0x1498aa,null));};exports['destroy']=function(_0x2f5c47,_0x298749){return db[_0x3125('0x2d')][_0x3125('0x4a')]({'where':{'id':_0x2f5c47[_0x3125('0x4b')]['id']}})[_0x3125('0x26')](handleEntityNotFound(_0x298749,null))[_0x3125('0x26')](removeEntity(_0x298749,null))[_0x3125('0x43')](handleError(_0x298749,null));};exports[_0x3125('0x4c')]=function(_0x5213f4,_0x2f1ab1,_0x46d63c){var _0x1f6d5b={};var _0x2c7e45={};var _0x22154a;var _0x94f58a;return db[_0x3125('0x2d')][_0x3125('0x4d')]({'where':{'id':_0x5213f4[_0x3125('0x4b')]['id']}})[_0x3125('0x26')](handleEntityNotFound(_0x2f1ab1,null))['then'](function(_0x401de9){if(_0x401de9){_0x22154a=_0x401de9;_0x2c7e45[_0x3125('0x34')]=_[_0x3125('0x45')](db['FreshdeskField'][_0x3125('0x2e')]);_0x2c7e45[_0x3125('0x32')]=_[_0x3125('0x45')](_0x5213f4[_0x3125('0x32')]);_0x2c7e45[_0x3125('0x33')]=_[_0x3125('0x36')](_0x2c7e45[_0x3125('0x34')],_0x2c7e45[_0x3125('0x32')]);_0x1f6d5b[_0x3125('0x35')]=_[_0x3125('0x36')](_0x2c7e45[_0x3125('0x34')],qs[_0x3125('0x37')](_0x5213f4[_0x3125('0x32')][_0x3125('0x37')]));_0x1f6d5b[_0x3125('0x35')]=_0x1f6d5b[_0x3125('0x35')][_0x3125('0x46')]?_0x1f6d5b[_0x3125('0x35')]:_0x2c7e45[_0x3125('0x34')];_0x1f6d5b['order']=qs[_0x3125('0x3a')](_0x5213f4[_0x3125('0x32')][_0x3125('0x3a')]);_0x1f6d5b[_0x3125('0x3b')]=qs[_0x3125('0x33')](_[_0x3125('0x3c')](_0x5213f4['query'],_0x2c7e45[_0x3125('0x33')]));if(_0x5213f4[_0x3125('0x32')][_0x3125('0x3d')]){_0x1f6d5b['where']=_[_0x3125('0x3f')](_0x1f6d5b['where'],{'$or':_[_0x3125('0x2c')](_0x1f6d5b[_0x3125('0x35')],function(_0x157ecd){var _0x4dd9cf={};_0x4dd9cf[_0x157ecd]={'$like':'%'+_0x5213f4[_0x3125('0x32')][_0x3125('0x3d')]+'%'};return _0x4dd9cf;})});}_0x1f6d5b=_[_0x3125('0x3f')]({},_0x1f6d5b,_0x5213f4['options']);return _0x22154a['getFields'](_0x1f6d5b);}})[_0x3125('0x26')](function(_0x151f86){if(_0x151f86){_0x94f58a=_0x151f86[_0x3125('0x46')];if(!_0x5213f4['query'][_0x3125('0x4e')](_0x3125('0x38'))){_0x1f6d5b[_0x3125('0x1e')]=qs[_0x3125('0x1e')](_0x5213f4['query'][_0x3125('0x1e')]);_0x1f6d5b[_0x3125('0x20')]=qs[_0x3125('0x20')](_0x5213f4['query'][_0x3125('0x20')]);}return _0x22154a[_0x3125('0x4c')](_0x1f6d5b);}})[_0x3125('0x26')](function(_0x48b376){if(_0x48b376){return _0x48b376?{'count':_0x94f58a,'rows':_0x48b376}:null;}})[_0x3125('0x26')](respondWithResult(_0x2f1ab1,null))[_0x3125('0x43')](handleError(_0x2f1ab1,null));};exports[_0x3125('0x4f')]=function(_0x491033,_0x591363,_0x37df87){var _0x7da105={};var _0x454614={};var _0x5990a8;var _0x23fc77;return db[_0x3125('0x2d')][_0x3125('0x4d')]({'where':{'id':_0x491033['params']['id']}})[_0x3125('0x26')](handleEntityNotFound(_0x591363,null))['then'](function(_0x40ba38){if(_0x40ba38){_0x5990a8=_0x40ba38;_0x454614[_0x3125('0x34')]=_[_0x3125('0x45')](db['FreshdeskField'][_0x3125('0x2e')]);_0x454614[_0x3125('0x32')]=_['keys'](_0x491033[_0x3125('0x32')]);_0x454614[_0x3125('0x33')]=_['intersection'](_0x454614['model'],_0x454614[_0x3125('0x32')]);_0x7da105[_0x3125('0x35')]=_[_0x3125('0x36')](_0x454614['model'],qs[_0x3125('0x37')](_0x491033[_0x3125('0x32')]['fields']));_0x7da105[_0x3125('0x35')]=_0x7da105[_0x3125('0x35')][_0x3125('0x46')]?_0x7da105['attributes']:_0x454614[_0x3125('0x34')];_0x7da105[_0x3125('0x39')]=qs[_0x3125('0x3a')](_0x491033[_0x3125('0x32')][_0x3125('0x3a')]);_0x7da105[_0x3125('0x3b')]=qs['filters'](_[_0x3125('0x3c')](_0x491033[_0x3125('0x32')],_0x454614[_0x3125('0x33')]));if(_0x491033['query'][_0x3125('0x3d')]){_0x7da105[_0x3125('0x3b')]=_[_0x3125('0x3f')](_0x7da105[_0x3125('0x3b')],{'$or':_[_0x3125('0x2c')](_0x7da105['attributes'],function(_0xae93c3){var _0x2405c5={};_0x2405c5[_0xae93c3]={'$like':'%'+_0x491033[_0x3125('0x32')][_0x3125('0x3d')]+'%'};return _0x2405c5;})});}_0x7da105=_[_0x3125('0x3f')]({},_0x7da105,_0x491033['options']);return _0x5990a8[_0x3125('0x4f')](_0x7da105);}})[_0x3125('0x26')](function(_0x7705e5){if(_0x7705e5){_0x23fc77=_0x7705e5[_0x3125('0x46')];if(!_0x491033[_0x3125('0x32')]['hasOwnProperty'](_0x3125('0x38'))){_0x7da105['limit']=qs['limit'](_0x491033[_0x3125('0x32')]['limit']);_0x7da105[_0x3125('0x20')]=qs[_0x3125('0x20')](_0x491033['query']['offset']);}return _0x5990a8[_0x3125('0x4f')](_0x7da105);}})[_0x3125('0x26')](function(_0x41b87b){if(_0x41b87b){return _0x41b87b?{'count':_0x23fc77,'rows':_0x41b87b}:null;}})['then'](respondWithResult(_0x591363,null))[_0x3125('0x43')](handleError(_0x591363,null));};exports[_0x3125('0x50')]=function(_0x2c0e63,_0x1f490c,_0x222736){var _0x4e9219={};var _0x1043ff={};var _0x1977f7;var _0x48cf2b;return db[_0x3125('0x2d')][_0x3125('0x4d')]({'where':{'id':_0x2c0e63[_0x3125('0x4b')]['id']}})[_0x3125('0x26')](handleEntityNotFound(_0x1f490c,null))[_0x3125('0x26')](function(_0x522928){if(_0x522928){_0x1977f7=_0x522928;_0x1043ff[_0x3125('0x34')]=_[_0x3125('0x45')](db[_0x3125('0x51')][_0x3125('0x2e')]);_0x1043ff[_0x3125('0x32')]=_[_0x3125('0x45')](_0x2c0e63[_0x3125('0x32')]);_0x1043ff[_0x3125('0x33')]=_[_0x3125('0x36')](_0x1043ff[_0x3125('0x34')],_0x1043ff['query']);_0x4e9219['attributes']=_[_0x3125('0x36')](_0x1043ff[_0x3125('0x34')],qs[_0x3125('0x37')](_0x2c0e63[_0x3125('0x32')][_0x3125('0x37')]));_0x4e9219['attributes']=_0x4e9219[_0x3125('0x35')][_0x3125('0x46')]?_0x4e9219['attributes']:_0x1043ff[_0x3125('0x34')];_0x4e9219[_0x3125('0x39')]=qs['sort'](_0x2c0e63['query'][_0x3125('0x3a')]);_0x4e9219['where']=qs[_0x3125('0x33')](_[_0x3125('0x3c')](_0x2c0e63[_0x3125('0x32')],_0x1043ff[_0x3125('0x33')]));if(_0x2c0e63['query']['filter']){_0x4e9219[_0x3125('0x3b')]=_[_0x3125('0x3f')](_0x4e9219[_0x3125('0x3b')],{'$or':_[_0x3125('0x2c')](_0x4e9219[_0x3125('0x35')],function(_0x491482){var _0x42f807={};_0x42f807[_0x491482]={'$like':'%'+_0x2c0e63[_0x3125('0x32')][_0x3125('0x3d')]+'%'};return _0x42f807;})});}_0x4e9219=_[_0x3125('0x3f')]({},_0x4e9219,_0x2c0e63[_0x3125('0x40')]);return _0x1977f7['getDescriptions'](_0x4e9219);}})[_0x3125('0x26')](function(_0x2b6ab5){if(_0x2b6ab5){_0x48cf2b=_0x2b6ab5['length'];if(!_0x2c0e63['query'][_0x3125('0x4e')](_0x3125('0x38'))){_0x4e9219[_0x3125('0x1e')]=qs[_0x3125('0x1e')](_0x2c0e63[_0x3125('0x32')][_0x3125('0x1e')]);_0x4e9219[_0x3125('0x20')]=qs[_0x3125('0x20')](_0x2c0e63[_0x3125('0x32')][_0x3125('0x20')]);}return _0x1977f7[_0x3125('0x50')](_0x4e9219);}})[_0x3125('0x26')](function(_0x2c9419){if(_0x2c9419){return _0x2c9419?{'count':_0x48cf2b,'rows':_0x2c9419}:null;}})['then'](respondWithResult(_0x1f490c,null))[_0x3125('0x43')](handleError(_0x1f490c,null));};exports[_0x3125('0x52')]=function(_0x16da10,_0x277fc3,_0x2946cb){var _0x282064={};var _0x179b90={};var _0x4209eb;var _0x5a3fbf;return db[_0x3125('0x2d')][_0x3125('0x4d')]({'where':{'id':_0x16da10[_0x3125('0x4b')]['id']}})[_0x3125('0x26')](handleEntityNotFound(_0x277fc3,null))['then'](function(_0x2bd840){if(_0x2bd840){_0x4209eb=_0x2bd840;_0x179b90[_0x3125('0x34')]=_[_0x3125('0x45')](db[_0x3125('0x53')]['rawAttributes']);_0x179b90[_0x3125('0x32')]=_[_0x3125('0x45')](_0x16da10['query']);_0x179b90['filters']=_[_0x3125('0x36')](_0x179b90[_0x3125('0x34')],_0x179b90[_0x3125('0x32')]);_0x282064['attributes']=_['intersection'](_0x179b90[_0x3125('0x34')],qs[_0x3125('0x37')](_0x16da10[_0x3125('0x32')][_0x3125('0x37')]));_0x282064[_0x3125('0x35')]=_0x282064[_0x3125('0x35')]['length']?_0x282064['attributes']:_0x179b90['model'];_0x282064[_0x3125('0x39')]=qs[_0x3125('0x3a')](_0x16da10[_0x3125('0x32')][_0x3125('0x3a')]);_0x282064[_0x3125('0x3b')]=qs[_0x3125('0x33')](_[_0x3125('0x3c')](_0x16da10['query'],_0x179b90['filters']));if(_0x16da10[_0x3125('0x32')][_0x3125('0x3d')]){_0x282064[_0x3125('0x3b')]=_[_0x3125('0x3f')](_0x282064[_0x3125('0x3b')],{'$or':_[_0x3125('0x2c')](_0x282064['attributes'],function(_0x116bb4){var _0x27d3b4={};_0x27d3b4[_0x116bb4]={'$like':'%'+_0x16da10['query'][_0x3125('0x3d')]+'%'};return _0x27d3b4;})});}_0x282064=_[_0x3125('0x3f')]({},_0x282064,_0x16da10[_0x3125('0x40')]);return _0x4209eb['getTags'](_0x282064);}})['then'](function(_0x5d6797){if(_0x5d6797){_0x5a3fbf=_0x5d6797[_0x3125('0x46')];if(!_0x16da10['query'][_0x3125('0x4e')](_0x3125('0x38'))){_0x282064['limit']=qs['limit'](_0x16da10[_0x3125('0x32')][_0x3125('0x1e')]);_0x282064['offset']=qs['offset'](_0x16da10[_0x3125('0x32')][_0x3125('0x20')]);}return _0x4209eb[_0x3125('0x52')](_0x282064);}})[_0x3125('0x26')](function(_0x53e459){if(_0x53e459){return _0x53e459?{'count':_0x5a3fbf,'rows':_0x53e459}:null;}})['then'](respondWithResult(_0x277fc3,null))[_0x3125('0x43')](handleError(_0x277fc3,null));};exports['setTags']=function(_0x1087c9,_0x217c13,_0x502597){if(_0x1087c9['body']['id']){delete _0x1087c9['body']['id'];}return db[_0x3125('0x2d')][_0x3125('0x4d')]({'where':{'id':_0x1087c9[_0x3125('0x4b')]['id']}})[_0x3125('0x26')](handleEntityNotFound(_0x217c13,null))[_0x3125('0x26')](function(_0x1158bb){if(_0x1158bb){return _0x1158bb[_0x3125('0x54')](_0x1087c9[_0x3125('0x49')]['ids']||[]);}return null;})[_0x3125('0x26')](respondWithResult(_0x217c13,null))[_0x3125('0x43')](handleError(_0x217c13,null));}; \ No newline at end of file +var _0xc70c=['fieldName','type','key','keys','filters','intersection','model','attributes','fields','query','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','FreshdeskConfiguration','findAll','rows','catch','length','find','create','body','update','params','getFields','findOne','hasOwnProperty','nolimit','getSubjects','FreshdeskField','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','Content-Range','save','then','destroy','error','name','send','index','map','rawAttributes'];(function(_0x3e14c4,_0x52ce44){var _0x3e639d=function(_0x103aa3){while(--_0x103aa3){_0x3e14c4['push'](_0x3e14c4['shift']());}};_0x3e639d(++_0x52ce44);}(_0xc70c,0xca));var _0xcc70=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc70c[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcc70('0x0'));var jsonpatch=require(_0xcc70('0x1'));var rp=require(_0xcc70('0x2'));var moment=require('moment');var BPromise=require(_0xcc70('0x3'));var Mustache=require(_0xcc70('0x4'));var util=require(_0xcc70('0x5'));var path=require(_0xcc70('0x6'));var sox=require(_0xcc70('0x7'));var csv=require(_0xcc70('0x8'));var ejs=require(_0xcc70('0x9'));var fs=require('fs');var fs_extra=require(_0xcc70('0xa'));var _=require(_0xcc70('0xb'));var squel=require(_0xcc70('0xc'));var crypto=require('crypto');var jsforce=require(_0xcc70('0xd'));var deskjs=require(_0xcc70('0xe'));var toCsv=require(_0xcc70('0x8'));var querystring=require('querystring');var Papa=require(_0xcc70('0xf'));var Redis=require(_0xcc70('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcc70('0x11'));var as=require(_0xcc70('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc70('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xcc70('0x14'));var licenseUtil=require(_0xcc70('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x362b25,_0x4e5a4c){_0x4e5a4c=_0x4e5a4c||0xcc;return function(_0x44f0fe){if(_0x44f0fe){return _0x362b25[_0xcc70('0x16')](_0x4e5a4c);}return _0x362b25[_0xcc70('0x17')](_0x4e5a4c)[_0xcc70('0x18')]();};}function respondWithResult(_0x39873a,_0x1c2205){_0x1c2205=_0x1c2205||0xc8;return function(_0x1557a9){if(_0x1557a9){return _0x39873a[_0xcc70('0x17')](_0x1c2205)['json'](_0x1557a9);}};}function respondWithFilteredResult(_0x48a5e2,_0x10f5bb){return function(_0x148346){if(_0x148346){var _0x447b89=typeof _0x10f5bb[_0xcc70('0x19')]==='undefined'&&typeof _0x10f5bb[_0xcc70('0x1a')]===_0xcc70('0x1b');var _0x96f889=_0x148346['count'];var _0x33ab07=_0x447b89?0x0:_0x10f5bb[_0xcc70('0x19')];var _0x599359=_0x447b89?_0x148346['count']:_0x10f5bb[_0xcc70('0x19')]+_0x10f5bb[_0xcc70('0x1a')];var _0x183076;if(_0x599359>=_0x96f889){_0x599359=_0x96f889;_0x183076=0xc8;}else{_0x183076=0xce;}_0x48a5e2[_0xcc70('0x17')](_0x183076);return _0x48a5e2['set'](_0xcc70('0x1c'),_0x33ab07+'-'+_0x599359+'/'+_0x96f889)['json'](_0x148346);}return null;};}function patchUpdates(_0x2b2676){return function(_0x48c9b2){try{jsonpatch['apply'](_0x48c9b2,_0x2b2676,!![]);}catch(_0x5014f1){return BPromise['reject'](_0x5014f1);}return _0x48c9b2[_0xcc70('0x1d')]();};}function saveUpdates(_0x5c88a7,_0x20b7d7){return function(_0x269782){if(_0x269782){return _0x269782['update'](_0x5c88a7)[_0xcc70('0x1e')](function(_0x331fcb){return _0x331fcb;});}return null;};}function removeEntity(_0x5bacd9,_0x28cb06){return function(_0x44d86c){if(_0x44d86c){return _0x44d86c[_0xcc70('0x1f')]()[_0xcc70('0x1e')](function(){_0x5bacd9['status'](0xcc)[_0xcc70('0x18')]();});}};}function handleEntityNotFound(_0x1ce1e3,_0x30ab94){return function(_0x13a114){if(!_0x13a114){_0x1ce1e3[_0xcc70('0x16')](0x194);}return _0x13a114;};}function handleError(_0x79d43e,_0x49488e){_0x49488e=_0x49488e||0x1f4;return function(_0x186ab3){logger[_0xcc70('0x20')](_0x186ab3['stack']);if(_0x186ab3['name']){delete _0x186ab3[_0xcc70('0x21')];}_0x79d43e[_0xcc70('0x17')](_0x49488e)[_0xcc70('0x22')](_0x186ab3);};}exports[_0xcc70('0x23')]=function(_0x133389,_0x2a047a){var _0x13db36={},_0x3bdfff={},_0x5e98ea={'count':0x0,'rows':[]};var _0x3a34ea=_[_0xcc70('0x24')](db['FreshdeskConfiguration'][_0xcc70('0x25')],function(_0x19152c){return{'name':_0x19152c[_0xcc70('0x26')],'type':_0x19152c[_0xcc70('0x27')][_0xcc70('0x28')]};});_0x3bdfff['model']=_['map'](_0x3a34ea,_0xcc70('0x21'));_0x3bdfff['query']=_[_0xcc70('0x29')](_0x133389['query']);_0x3bdfff[_0xcc70('0x2a')]=_[_0xcc70('0x2b')](_0x3bdfff[_0xcc70('0x2c')],_0x3bdfff['query']);_0x13db36[_0xcc70('0x2d')]=_[_0xcc70('0x2b')](_0x3bdfff[_0xcc70('0x2c')],qs[_0xcc70('0x2e')](_0x133389['query'][_0xcc70('0x2e')]));_0x13db36[_0xcc70('0x2d')]=_0x13db36['attributes']['length']?_0x13db36['attributes']:_0x3bdfff['model'];if(!_0x133389[_0xcc70('0x2f')]['hasOwnProperty']('nolimit')){_0x13db36[_0xcc70('0x1a')]=qs[_0xcc70('0x1a')](_0x133389[_0xcc70('0x2f')][_0xcc70('0x1a')]);_0x13db36[_0xcc70('0x19')]=qs[_0xcc70('0x19')](_0x133389[_0xcc70('0x2f')][_0xcc70('0x19')]);}_0x13db36[_0xcc70('0x30')]=qs[_0xcc70('0x31')](_0x133389[_0xcc70('0x2f')][_0xcc70('0x31')]);_0x13db36['where']=qs[_0xcc70('0x2a')](_[_0xcc70('0x32')](_0x133389['query'],_0x3bdfff['filters']),_0x3a34ea);if(_0x133389[_0xcc70('0x2f')][_0xcc70('0x33')]){_0x13db36[_0xcc70('0x34')]=_['merge'](_0x13db36[_0xcc70('0x34')],{'$or':_['map'](_0x3a34ea,function(_0x454cfb){if(_0x454cfb[_0xcc70('0x27')]!==_0xcc70('0x35')){var _0x36dd9f={};_0x36dd9f[_0x454cfb['name']]={'$like':'%'+_0x133389[_0xcc70('0x2f')]['filter']+'%'};return _0x36dd9f;}})});}_0x13db36=_[_0xcc70('0x36')]({},_0x13db36,_0x133389[_0xcc70('0x37')]);var _0x4f5b29={'where':_0x13db36[_0xcc70('0x34')]};return db['FreshdeskConfiguration'][_0xcc70('0x38')](_0x4f5b29)[_0xcc70('0x1e')](function(_0x2d493b){_0x5e98ea[_0xcc70('0x38')]=_0x2d493b;if(_0x133389[_0xcc70('0x2f')][_0xcc70('0x39')]){_0x13db36[_0xcc70('0x3a')]=[{'all':!![]}];}return db[_0xcc70('0x3b')][_0xcc70('0x3c')](_0x13db36);})['then'](function(_0x4ed4a3){_0x5e98ea[_0xcc70('0x3d')]=_0x4ed4a3;return _0x5e98ea;})[_0xcc70('0x1e')](respondWithFilteredResult(_0x2a047a,_0x13db36))[_0xcc70('0x3e')](handleError(_0x2a047a,null));};exports['show']=function(_0x2ebcb4,_0x4280eb){var _0x30a7ab={'raw':![],'where':{'id':_0x2ebcb4['params']['id']}},_0x12b9c0={};_0x12b9c0['model']=_['keys'](db[_0xcc70('0x3b')]['rawAttributes']);_0x12b9c0[_0xcc70('0x2f')]=_['keys'](_0x2ebcb4[_0xcc70('0x2f')]);_0x12b9c0[_0xcc70('0x2a')]=_[_0xcc70('0x2b')](_0x12b9c0['model'],_0x12b9c0[_0xcc70('0x2f')]);_0x30a7ab[_0xcc70('0x2d')]=_['intersection'](_0x12b9c0[_0xcc70('0x2c')],qs['fields'](_0x2ebcb4['query'][_0xcc70('0x2e')]));_0x30a7ab[_0xcc70('0x2d')]=_0x30a7ab[_0xcc70('0x2d')][_0xcc70('0x3f')]?_0x30a7ab[_0xcc70('0x2d')]:_0x12b9c0[_0xcc70('0x2c')];if(_0x2ebcb4[_0xcc70('0x2f')][_0xcc70('0x39')]){_0x30a7ab[_0xcc70('0x3a')]=[{'all':!![]}];}_0x30a7ab=_['merge']({},_0x30a7ab,_0x2ebcb4['options']);return db[_0xcc70('0x3b')][_0xcc70('0x40')](_0x30a7ab)[_0xcc70('0x1e')](handleEntityNotFound(_0x4280eb,null))[_0xcc70('0x1e')](respondWithResult(_0x4280eb,null))[_0xcc70('0x3e')](handleError(_0x4280eb,null));};exports[_0xcc70('0x41')]=function(_0x1eec46,_0x285379){return db['FreshdeskConfiguration'][_0xcc70('0x41')](_0x1eec46[_0xcc70('0x42')],{})[_0xcc70('0x1e')](respondWithResult(_0x285379,0xc9))[_0xcc70('0x3e')](handleError(_0x285379,null));};exports[_0xcc70('0x43')]=function(_0x3f884a,_0x323f18){if(_0x3f884a['body']['id']){delete _0x3f884a[_0xcc70('0x42')]['id'];}return db['FreshdeskConfiguration'][_0xcc70('0x40')]({'where':{'id':_0x3f884a[_0xcc70('0x44')]['id']}})[_0xcc70('0x1e')](handleEntityNotFound(_0x323f18,null))['then'](saveUpdates(_0x3f884a[_0xcc70('0x42')],null))['then'](respondWithResult(_0x323f18,null))[_0xcc70('0x3e')](handleError(_0x323f18,null));};exports[_0xcc70('0x1f')]=function(_0x585e48,_0x482be2){return db[_0xcc70('0x3b')][_0xcc70('0x40')]({'where':{'id':_0x585e48['params']['id']}})[_0xcc70('0x1e')](handleEntityNotFound(_0x482be2,null))[_0xcc70('0x1e')](removeEntity(_0x482be2,null))[_0xcc70('0x3e')](handleError(_0x482be2,null));};exports[_0xcc70('0x45')]=function(_0x2b21b5,_0x2f15f9,_0x13222f){var _0x23f0b8={};var _0x16e84e={};var _0x42f9aa;var _0x2759eb;return db[_0xcc70('0x3b')][_0xcc70('0x46')]({'where':{'id':_0x2b21b5[_0xcc70('0x44')]['id']}})[_0xcc70('0x1e')](handleEntityNotFound(_0x2f15f9,null))[_0xcc70('0x1e')](function(_0x41c54f){if(_0x41c54f){_0x42f9aa=_0x41c54f;_0x16e84e[_0xcc70('0x2c')]=_['keys'](db['FreshdeskField'][_0xcc70('0x25')]);_0x16e84e[_0xcc70('0x2f')]=_[_0xcc70('0x29')](_0x2b21b5[_0xcc70('0x2f')]);_0x16e84e[_0xcc70('0x2a')]=_[_0xcc70('0x2b')](_0x16e84e[_0xcc70('0x2c')],_0x16e84e[_0xcc70('0x2f')]);_0x23f0b8[_0xcc70('0x2d')]=_[_0xcc70('0x2b')](_0x16e84e['model'],qs[_0xcc70('0x2e')](_0x2b21b5[_0xcc70('0x2f')][_0xcc70('0x2e')]));_0x23f0b8[_0xcc70('0x2d')]=_0x23f0b8[_0xcc70('0x2d')][_0xcc70('0x3f')]?_0x23f0b8['attributes']:_0x16e84e[_0xcc70('0x2c')];_0x23f0b8[_0xcc70('0x30')]=qs['sort'](_0x2b21b5['query'][_0xcc70('0x31')]);_0x23f0b8['where']=qs[_0xcc70('0x2a')](_[_0xcc70('0x32')](_0x2b21b5[_0xcc70('0x2f')],_0x16e84e[_0xcc70('0x2a')]));if(_0x2b21b5[_0xcc70('0x2f')][_0xcc70('0x33')]){_0x23f0b8[_0xcc70('0x34')]=_[_0xcc70('0x36')](_0x23f0b8[_0xcc70('0x34')],{'$or':_[_0xcc70('0x24')](_0x23f0b8[_0xcc70('0x2d')],function(_0xae029e){var _0x52cb07={};_0x52cb07[_0xae029e]={'$like':'%'+_0x2b21b5['query'][_0xcc70('0x33')]+'%'};return _0x52cb07;})});}_0x23f0b8=_['merge']({},_0x23f0b8,_0x2b21b5['options']);return _0x42f9aa['getFields'](_0x23f0b8);}})['then'](function(_0x40fcbc){if(_0x40fcbc){_0x2759eb=_0x40fcbc[_0xcc70('0x3f')];if(!_0x2b21b5[_0xcc70('0x2f')][_0xcc70('0x47')](_0xcc70('0x48'))){_0x23f0b8[_0xcc70('0x1a')]=qs[_0xcc70('0x1a')](_0x2b21b5[_0xcc70('0x2f')]['limit']);_0x23f0b8['offset']=qs[_0xcc70('0x19')](_0x2b21b5[_0xcc70('0x2f')][_0xcc70('0x19')]);}return _0x42f9aa[_0xcc70('0x45')](_0x23f0b8);}})[_0xcc70('0x1e')](function(_0x5124e7){if(_0x5124e7){return _0x5124e7?{'count':_0x2759eb,'rows':_0x5124e7}:null;}})[_0xcc70('0x1e')](respondWithResult(_0x2f15f9,null))[_0xcc70('0x3e')](handleError(_0x2f15f9,null));};exports[_0xcc70('0x49')]=function(_0x2ede5d,_0x3d33cb,_0x527984){var _0x4fa4e5={};var _0x295b10={};var _0x3ec067;var _0x4cf3ee;return db[_0xcc70('0x3b')][_0xcc70('0x46')]({'where':{'id':_0x2ede5d[_0xcc70('0x44')]['id']}})[_0xcc70('0x1e')](handleEntityNotFound(_0x3d33cb,null))['then'](function(_0x5caa82){if(_0x5caa82){_0x3ec067=_0x5caa82;_0x295b10[_0xcc70('0x2c')]=_['keys'](db[_0xcc70('0x4a')][_0xcc70('0x25')]);_0x295b10['query']=_[_0xcc70('0x29')](_0x2ede5d[_0xcc70('0x2f')]);_0x295b10['filters']=_[_0xcc70('0x2b')](_0x295b10['model'],_0x295b10[_0xcc70('0x2f')]);_0x4fa4e5[_0xcc70('0x2d')]=_[_0xcc70('0x2b')](_0x295b10[_0xcc70('0x2c')],qs['fields'](_0x2ede5d[_0xcc70('0x2f')][_0xcc70('0x2e')]));_0x4fa4e5[_0xcc70('0x2d')]=_0x4fa4e5[_0xcc70('0x2d')][_0xcc70('0x3f')]?_0x4fa4e5['attributes']:_0x295b10[_0xcc70('0x2c')];_0x4fa4e5['order']=qs[_0xcc70('0x31')](_0x2ede5d[_0xcc70('0x2f')][_0xcc70('0x31')]);_0x4fa4e5['where']=qs[_0xcc70('0x2a')](_[_0xcc70('0x32')](_0x2ede5d[_0xcc70('0x2f')],_0x295b10[_0xcc70('0x2a')]));if(_0x2ede5d['query'][_0xcc70('0x33')]){_0x4fa4e5[_0xcc70('0x34')]=_['merge'](_0x4fa4e5[_0xcc70('0x34')],{'$or':_[_0xcc70('0x24')](_0x4fa4e5[_0xcc70('0x2d')],function(_0x3f51d1){var _0x188f9f={};_0x188f9f[_0x3f51d1]={'$like':'%'+_0x2ede5d['query']['filter']+'%'};return _0x188f9f;})});}_0x4fa4e5=_['merge']({},_0x4fa4e5,_0x2ede5d[_0xcc70('0x37')]);return _0x3ec067[_0xcc70('0x49')](_0x4fa4e5);}})[_0xcc70('0x1e')](function(_0x54069c){if(_0x54069c){_0x4cf3ee=_0x54069c['length'];if(!_0x2ede5d[_0xcc70('0x2f')][_0xcc70('0x47')]('nolimit')){_0x4fa4e5[_0xcc70('0x1a')]=qs[_0xcc70('0x1a')](_0x2ede5d[_0xcc70('0x2f')][_0xcc70('0x1a')]);_0x4fa4e5[_0xcc70('0x19')]=qs['offset'](_0x2ede5d['query'][_0xcc70('0x19')]);}return _0x3ec067[_0xcc70('0x49')](_0x4fa4e5);}})[_0xcc70('0x1e')](function(_0x4f587b){if(_0x4f587b){return _0x4f587b?{'count':_0x4cf3ee,'rows':_0x4f587b}:null;}})[_0xcc70('0x1e')](respondWithResult(_0x3d33cb,null))[_0xcc70('0x3e')](handleError(_0x3d33cb,null));};exports[_0xcc70('0x4b')]=function(_0x12cf58,_0x41b1f9,_0x35f261){var _0x563643={};var _0x31a965={};var _0x1e56c4;var _0x49e40f;return db['FreshdeskConfiguration'][_0xcc70('0x46')]({'where':{'id':_0x12cf58[_0xcc70('0x44')]['id']}})[_0xcc70('0x1e')](handleEntityNotFound(_0x41b1f9,null))['then'](function(_0xb302b7){if(_0xb302b7){_0x1e56c4=_0xb302b7;_0x31a965['model']=_[_0xcc70('0x29')](db['FreshdeskField']['rawAttributes']);_0x31a965[_0xcc70('0x2f')]=_[_0xcc70('0x29')](_0x12cf58[_0xcc70('0x2f')]);_0x31a965[_0xcc70('0x2a')]=_[_0xcc70('0x2b')](_0x31a965[_0xcc70('0x2c')],_0x31a965['query']);_0x563643[_0xcc70('0x2d')]=_[_0xcc70('0x2b')](_0x31a965['model'],qs[_0xcc70('0x2e')](_0x12cf58[_0xcc70('0x2f')][_0xcc70('0x2e')]));_0x563643[_0xcc70('0x2d')]=_0x563643[_0xcc70('0x2d')][_0xcc70('0x3f')]?_0x563643[_0xcc70('0x2d')]:_0x31a965[_0xcc70('0x2c')];_0x563643[_0xcc70('0x30')]=qs['sort'](_0x12cf58['query'][_0xcc70('0x31')]);_0x563643['where']=qs[_0xcc70('0x2a')](_[_0xcc70('0x32')](_0x12cf58[_0xcc70('0x2f')],_0x31a965[_0xcc70('0x2a')]));if(_0x12cf58[_0xcc70('0x2f')]['filter']){_0x563643['where']=_['merge'](_0x563643[_0xcc70('0x34')],{'$or':_['map'](_0x563643[_0xcc70('0x2d')],function(_0x21dd44){var _0x1532fc={};_0x1532fc[_0x21dd44]={'$like':'%'+_0x12cf58['query'][_0xcc70('0x33')]+'%'};return _0x1532fc;})});}_0x563643=_[_0xcc70('0x36')]({},_0x563643,_0x12cf58[_0xcc70('0x37')]);return _0x1e56c4['getDescriptions'](_0x563643);}})[_0xcc70('0x1e')](function(_0x171caf){if(_0x171caf){_0x49e40f=_0x171caf[_0xcc70('0x3f')];if(!_0x12cf58[_0xcc70('0x2f')][_0xcc70('0x47')](_0xcc70('0x48'))){_0x563643['limit']=qs[_0xcc70('0x1a')](_0x12cf58[_0xcc70('0x2f')]['limit']);_0x563643[_0xcc70('0x19')]=qs[_0xcc70('0x19')](_0x12cf58[_0xcc70('0x2f')][_0xcc70('0x19')]);}return _0x1e56c4['getDescriptions'](_0x563643);}})[_0xcc70('0x1e')](function(_0x4f768e){if(_0x4f768e){return _0x4f768e?{'count':_0x49e40f,'rows':_0x4f768e}:null;}})[_0xcc70('0x1e')](respondWithResult(_0x41b1f9,null))[_0xcc70('0x3e')](handleError(_0x41b1f9,null));};exports[_0xcc70('0x4c')]=function(_0x6854f0,_0x50df11,_0x143a6e){var _0x251f02={};var _0x189a2d={};var _0x116732;var _0x5e4b28;return db[_0xcc70('0x3b')][_0xcc70('0x46')]({'where':{'id':_0x6854f0[_0xcc70('0x44')]['id']}})[_0xcc70('0x1e')](handleEntityNotFound(_0x50df11,null))[_0xcc70('0x1e')](function(_0x4c659a){if(_0x4c659a){_0x116732=_0x4c659a;_0x189a2d[_0xcc70('0x2c')]=_['keys'](db[_0xcc70('0x4d')]['rawAttributes']);_0x189a2d[_0xcc70('0x2f')]=_[_0xcc70('0x29')](_0x6854f0['query']);_0x189a2d['filters']=_[_0xcc70('0x2b')](_0x189a2d[_0xcc70('0x2c')],_0x189a2d['query']);_0x251f02[_0xcc70('0x2d')]=_['intersection'](_0x189a2d[_0xcc70('0x2c')],qs[_0xcc70('0x2e')](_0x6854f0[_0xcc70('0x2f')]['fields']));_0x251f02[_0xcc70('0x2d')]=_0x251f02[_0xcc70('0x2d')][_0xcc70('0x3f')]?_0x251f02['attributes']:_0x189a2d['model'];_0x251f02['order']=qs[_0xcc70('0x31')](_0x6854f0[_0xcc70('0x2f')]['sort']);_0x251f02['where']=qs[_0xcc70('0x2a')](_[_0xcc70('0x32')](_0x6854f0[_0xcc70('0x2f')],_0x189a2d[_0xcc70('0x2a')]));if(_0x6854f0['query'][_0xcc70('0x33')]){_0x251f02[_0xcc70('0x34')]=_[_0xcc70('0x36')](_0x251f02[_0xcc70('0x34')],{'$or':_[_0xcc70('0x24')](_0x251f02[_0xcc70('0x2d')],function(_0x313180){var _0xb9bcaa={};_0xb9bcaa[_0x313180]={'$like':'%'+_0x6854f0[_0xcc70('0x2f')]['filter']+'%'};return _0xb9bcaa;})});}_0x251f02=_[_0xcc70('0x36')]({},_0x251f02,_0x6854f0['options']);return _0x116732['getTags'](_0x251f02);}})['then'](function(_0x1f2c52){if(_0x1f2c52){_0x5e4b28=_0x1f2c52['length'];if(!_0x6854f0[_0xcc70('0x2f')]['hasOwnProperty']('nolimit')){_0x251f02[_0xcc70('0x1a')]=qs[_0xcc70('0x1a')](_0x6854f0['query'][_0xcc70('0x1a')]);_0x251f02[_0xcc70('0x19')]=qs[_0xcc70('0x19')](_0x6854f0['query'][_0xcc70('0x19')]);}return _0x116732['getTags'](_0x251f02);}})[_0xcc70('0x1e')](function(_0x280703){if(_0x280703){return _0x280703?{'count':_0x5e4b28,'rows':_0x280703}:null;}})[_0xcc70('0x1e')](respondWithResult(_0x50df11,null))['catch'](handleError(_0x50df11,null));};exports[_0xcc70('0x4e')]=function(_0x8ac089,_0x20713f,_0x3f3884){if(_0x8ac089[_0xcc70('0x42')]['id']){delete _0x8ac089[_0xcc70('0x42')]['id'];}return db['FreshdeskConfiguration'][_0xcc70('0x46')]({'where':{'id':_0x8ac089['params']['id']}})[_0xcc70('0x1e')](handleEntityNotFound(_0x20713f,null))[_0xcc70('0x1e')](function(_0x1ac1f6){if(_0x1ac1f6){return _0x1ac1f6[_0xcc70('0x4e')](_0x8ac089['body'][_0xcc70('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x20713f,null))[_0xcc70('0x3e')](handleError(_0x20713f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index bb0b588..5590706 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 _0x5802=['moment','bluebird','request-promise','rimraf','../../config/environment','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api'];(function(_0x1678c7,_0x5ad8de){var _0x2ba195=function(_0x29396d){while(--_0x29396d){_0x1678c7['push'](_0x1678c7['shift']());}};_0x2ba195(++_0x5ad8de);}(_0x5802,0x89));var _0x2580=function(_0x9cbfe0,_0x56aada){_0x9cbfe0=_0x9cbfe0-0x0;var _0x1f1534=_0x5802[_0x9cbfe0];return _0x1f1534;};'use strict';var _=require('lodash');var util=require(_0x2580('0x0'));var logger=require(_0x2580('0x1'))(_0x2580('0x2'));var moment=require(_0x2580('0x3'));var BPromise=require(_0x2580('0x4'));var rp=require(_0x2580('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2580('0x6'));var config=require(_0x2580('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x5078dd,_0x39d33a){return _0x5078dd['define'](_0x2580('0x8'),attributes,{'tableName':_0x2580('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5ae=['path','rimraf','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xe5ae,0x157));var _0xee5a=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0xe5ae[_0x31e5cb];return _0x4170df;};'use strict';var _=require(_0xee5a('0x0'));var util=require(_0xee5a('0x1'));var logger=require('../../config/logger')(_0xee5a('0x2'));var moment=require(_0xee5a('0x3'));var BPromise=require(_0xee5a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee5a('0x5'));var rimraf=require(_0xee5a('0x6'));var config=require(_0xee5a('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xee5a('0x8')]=function(_0x1fbbd1,_0x351316){return _0x1fbbd1[_0xee5a('0x9')](_0xee5a('0xa'),attributes,{'tableName':_0xee5a('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 362d6bb..7c492d5 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 _0x15bd=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x1cd439,_0x4154ad){var _0x413696=function(_0x190bfc){while(--_0x190bfc){_0x1cd439['push'](_0x1cd439['shift']());}};_0x413696(++_0x4154ad);}(_0x15bd,0x6f));var _0xd15b=function(_0x2bdf29,_0x40cab0){_0x2bdf29=_0x2bdf29-0x0;var _0x60cb83=_0x15bd[_0x2bdf29];return _0x60cb83;};'use strict';var _=require(_0xd15b('0x0'));var util=require(_0xd15b('0x1'));var moment=require(_0xd15b('0x2'));var BPromise=require(_0xd15b('0x3'));var rs=require(_0xd15b('0x4'));var fs=require('fs');var Redis=require(_0xd15b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd15b('0x6'));var logger=require(_0xd15b('0x7'))(_0xd15b('0x8'));var config=require(_0xd15b('0x9'));var jayson=require(_0xd15b('0xa'));var client=jayson['client'][_0xd15b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x560501,_0x262ffa,_0x550302){return new BPromise(function(_0x514999,_0x27f7dd){return client[_0xd15b('0xc')](_0x560501,_0x550302)['then'](function(_0x87214b){logger[_0xd15b('0xd')](_0xd15b('0xe'),_0x262ffa,'request\x20sent');logger['debug'](_0xd15b('0xf'),_0x262ffa,_0xd15b('0x10'),JSON[_0xd15b('0x11')](_0x87214b));if(_0x87214b[_0xd15b('0x12')]){if(_0x87214b['error']['code']===0x1f4){logger[_0xd15b('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x262ffa,_0x87214b[_0xd15b('0x12')][_0xd15b('0x13')]);return _0x27f7dd(_0x87214b[_0xd15b('0x12')]['message']);}logger[_0xd15b('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x262ffa,_0x87214b['error'][_0xd15b('0x13')]);return _0x514999(_0x87214b[_0xd15b('0x12')][_0xd15b('0x13')]);}else{logger[_0xd15b('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x262ffa,_0xd15b('0x10'));_0x514999(_0x87214b['result'][_0xd15b('0x13')]);}})[_0xd15b('0x14')](function(_0x5d5307){logger[_0xd15b('0x12')](_0xd15b('0xe'),_0x262ffa,_0x5d5307);_0x27f7dd(_0x5d5307);});});} \ No newline at end of file +var _0xd1e0=['info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0xd1e0,0xc2));var _0x0d1e=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0xd1e0[_0x256d6a];return _0x460058;};'use strict';var _=require(_0x0d1e('0x0'));var util=require(_0x0d1e('0x1'));var moment=require('moment');var BPromise=require(_0x0d1e('0x2'));var rs=require(_0x0d1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d1e('0x4'))['db'];var utils=require(_0x0d1e('0x5'));var logger=require(_0x0d1e('0x6'))(_0x0d1e('0x7'));var config=require(_0x0d1e('0x8'));var jayson=require(_0x0d1e('0x9'));var client=jayson[_0x0d1e('0xa')][_0x0d1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50f1d3,_0x29962b,_0x378286){return new BPromise(function(_0x1d4534,_0x47cfd3){return client['request'](_0x50f1d3,_0x378286)[_0x0d1e('0xc')](function(_0x1177c9){logger[_0x0d1e('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x29962b,_0x0d1e('0xe'));logger[_0x0d1e('0xf')](_0x0d1e('0x10'),_0x29962b,'request\x20sent',JSON['stringify'](_0x1177c9));if(_0x1177c9[_0x0d1e('0x11')]){if(_0x1177c9[_0x0d1e('0x11')][_0x0d1e('0x12')]===0x1f4){logger[_0x0d1e('0x11')](_0x0d1e('0x13'),_0x29962b,_0x1177c9[_0x0d1e('0x11')][_0x0d1e('0x14')]);return _0x47cfd3(_0x1177c9[_0x0d1e('0x11')][_0x0d1e('0x14')]);}logger[_0x0d1e('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x29962b,_0x1177c9[_0x0d1e('0x11')][_0x0d1e('0x14')]);return _0x1d4534(_0x1177c9[_0x0d1e('0x11')][_0x0d1e('0x14')]);}else{logger['info'](_0x0d1e('0x13'),_0x29962b,'request\x20sent');_0x1d4534(_0x1177c9[_0x0d1e('0x15')][_0x0d1e('0x14')]);}})[_0x0d1e('0x16')](function(_0x4212f5){logger[_0x0d1e('0x11')](_0x0d1e('0x13'),_0x29962b,_0x4212f5);_0x47cfd3(_0x4212f5);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index d239e50..5e02192 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 _0x2378=['multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','/:id','show','create','put','update','destroy','exports'];(function(_0xde6977,_0x52b58c){var _0x3f0808=function(_0x4bb126){while(--_0x4bb126){_0xde6977['push'](_0xde6977['shift']());}};_0x3f0808(++_0x52b58c);}(_0x2378,0x1ed));var _0x8237=function(_0x4e9396,_0x945647){_0x4e9396=_0x4e9396-0x0;var _0x4ca9e9=_0x2378[_0x4e9396];return _0x4ca9e9;};'use strict';var multer=require(_0x8237('0x0'));var util=require('util');var path=require(_0x8237('0x1'));var timeout=require(_0x8237('0x2'));var express=require('express');var router=express[_0x8237('0x3')]();var fs_extra=require(_0x8237('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8237('0x5'));var config=require(_0x8237('0x6'));var controller=require(_0x8237('0x7'));router['get']('/',auth[_0x8237('0x8')](),controller[_0x8237('0x9')]);router['get'](_0x8237('0xa'),auth[_0x8237('0x8')](),controller[_0x8237('0xb')]);router['post']('/',auth[_0x8237('0x8')](),controller[_0x8237('0xc')]);router[_0x8237('0xd')]('/:id',auth[_0x8237('0x8')](),controller[_0x8237('0xe')]);router['delete'](_0x8237('0xa'),auth['isAuthenticated'](),controller[_0x8237('0xf')]);module[_0x8237('0x10')]=router; \ No newline at end of file +var _0x23cd=['fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x23cd,0x150));var _0xd23c=function(_0x458c55,_0x4ba249){_0x458c55=_0x458c55-0x0;var _0x5ccc1d=_0x23cd[_0x458c55];return _0x5ccc1d;};'use strict';var multer=require(_0xd23c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd23c('0x1'));var express=require(_0xd23c('0x2'));var router=express[_0xd23c('0x3')]();var fs_extra=require(_0xd23c('0x4'));var auth=require(_0xd23c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd23c('0x6'));var controller=require(_0xd23c('0x7'));router['get']('/',auth[_0xd23c('0x8')](),controller[_0xd23c('0x9')]);router[_0xd23c('0xa')](_0xd23c('0xb'),auth[_0xd23c('0x8')](),controller[_0xd23c('0xc')]);router[_0xd23c('0xd')]('/',auth[_0xd23c('0x8')](),controller[_0xd23c('0xe')]);router[_0xd23c('0xf')](_0xd23c('0xb'),auth[_0xd23c('0x8')](),controller[_0xd23c('0x10')]);router[_0xd23c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd23c('0x12')]);module[_0xd23c('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 49dd493..a53f768 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 _0x927e=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x575a3a,_0x45c54b){var _0x572f33=function(_0x3e8fca){while(--_0x3e8fca){_0x575a3a['push'](_0x575a3a['shift']());}};_0x572f33(++_0x45c54b);}(_0x927e,0xb2));var _0xe927=function(_0xe1f858,_0xb86c44){_0xe1f858=_0xe1f858-0x0;var _0x367af6=_0x927e[_0xe1f858];return _0x367af6;};'use strict';var Sequelize=require(_0xe927('0x0'));module[_0xe927('0x1')]={'type':{'type':Sequelize[_0xe927('0x2')](_0xe927('0x3'),_0xe927('0x4'),_0xe927('0x5'),_0xe927('0x6'),'picklist'),'defaultValue':_0xe927('0x3')},'content':{'type':Sequelize[_0xe927('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe927('0x2')](_0xe927('0x3'),_0xe927('0x4'),_0xe927('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe927('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe927('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe927('0x7')]}}; \ No newline at end of file +var _0xdc13=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xdc13,0x1ad));var _0x3dc1=function(_0x259561,_0x4098c3){_0x259561=_0x259561-0x0;var _0x1b78d4=_0xdc13[_0x259561];return _0x1b78d4;};'use strict';var Sequelize=require(_0x3dc1('0x0'));module['exports']={'type':{'type':Sequelize[_0x3dc1('0x1')](_0x3dc1('0x2'),_0x3dc1('0x3'),'customVariable',_0x3dc1('0x4'),_0x3dc1('0x5')),'defaultValue':_0x3dc1('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3dc1('0x6')]},'keyType':{'type':Sequelize[_0x3dc1('0x1')](_0x3dc1('0x2'),_0x3dc1('0x3'),_0x3dc1('0x7'))},'keyContent':{'type':Sequelize[_0x3dc1('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3dc1('0x6')]},'customField':{'type':Sequelize[_0x3dc1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3dc1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index fa0cc9d..72b3842 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 _0xe600=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','include','FreshdeskField','findAll','rows','catch','show','includeAll','create','body','find','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields'];(function(_0x3c1462,_0x4efc2c){var _0x4639cb=function(_0x3bf3d3){while(--_0x3bf3d3){_0x3c1462['push'](_0x3c1462['shift']());}};_0x4639cb(++_0x4efc2c);}(_0xe600,0x159));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e60('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e60('0x1'));var rp=require(_0x0e60('0x2'));var moment=require(_0x0e60('0x3'));var BPromise=require(_0x0e60('0x4'));var Mustache=require(_0x0e60('0x5'));var util=require(_0x0e60('0x6'));var path=require(_0x0e60('0x7'));var sox=require(_0x0e60('0x8'));var csv=require(_0x0e60('0x9'));var ejs=require(_0x0e60('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e60('0xb'));var squel=require(_0x0e60('0xc'));var crypto=require(_0x0e60('0xd'));var jsforce=require(_0x0e60('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e60('0x9'));var querystring=require(_0x0e60('0xf'));var Papa=require(_0x0e60('0x10'));var Redis=require(_0x0e60('0x11'));var authService=require(_0x0e60('0x12'));var qs=require(_0x0e60('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e60('0x14'));var logger=require(_0x0e60('0x15'))(_0x0e60('0x16'));var utils=require(_0x0e60('0x17'));var config=require(_0x0e60('0x18'));var licenseUtil=require(_0x0e60('0x19'));var db=require(_0x0e60('0x1a'))['db'];function respondWithStatusCode(_0x2f5ee4,_0x540411){_0x540411=_0x540411||0xcc;return function(_0x2d848f){if(_0x2d848f){return _0x2f5ee4[_0x0e60('0x1b')](_0x540411);}return _0x2f5ee4[_0x0e60('0x1c')](_0x540411)[_0x0e60('0x1d')]();};}function respondWithResult(_0x45328b,_0x37bf95){_0x37bf95=_0x37bf95||0xc8;return function(_0x5d7f84){if(_0x5d7f84){return _0x45328b[_0x0e60('0x1c')](_0x37bf95)['json'](_0x5d7f84);}};}function respondWithFilteredResult(_0x91cd1,_0x128887){return function(_0x170890){if(_0x170890){var _0x5ab4ba=typeof _0x128887[_0x0e60('0x1e')]===_0x0e60('0x1f')&&typeof _0x128887[_0x0e60('0x20')]===_0x0e60('0x1f');var _0x2e6270=_0x170890['count'];var _0x992490=_0x5ab4ba?0x0:_0x128887[_0x0e60('0x1e')];var _0x599c1d=_0x5ab4ba?_0x170890[_0x0e60('0x21')]:_0x128887[_0x0e60('0x1e')]+_0x128887[_0x0e60('0x20')];var _0x504b31;if(_0x599c1d>=_0x2e6270){_0x599c1d=_0x2e6270;_0x504b31=0xc8;}else{_0x504b31=0xce;}_0x91cd1[_0x0e60('0x1c')](_0x504b31);return _0x91cd1['set'](_0x0e60('0x22'),_0x992490+'-'+_0x599c1d+'/'+_0x2e6270)[_0x0e60('0x23')](_0x170890);}return null;};}function patchUpdates(_0xb9f037){return function(_0xabf953){try{jsonpatch[_0x0e60('0x24')](_0xabf953,_0xb9f037,!![]);}catch(_0x31a63e){return BPromise[_0x0e60('0x25')](_0x31a63e);}return _0xabf953[_0x0e60('0x26')]();};}function saveUpdates(_0x352633,_0x10f875){return function(_0x22c0e0){if(_0x22c0e0){return _0x22c0e0[_0x0e60('0x27')](_0x352633)[_0x0e60('0x28')](function(_0x16985f){return _0x16985f;});}return null;};}function removeEntity(_0x4702f,_0x33f9f3){return function(_0x41642c){if(_0x41642c){return _0x41642c[_0x0e60('0x29')]()[_0x0e60('0x28')](function(){_0x4702f['status'](0xcc)[_0x0e60('0x1d')]();});}};}function handleEntityNotFound(_0x41ad9a,_0x5ea254){return function(_0x10451f){if(!_0x10451f){_0x41ad9a['sendStatus'](0x194);}return _0x10451f;};}function handleError(_0x3ddc19,_0x5665c2){_0x5665c2=_0x5665c2||0x1f4;return function(_0x48d950){logger[_0x0e60('0x2a')](_0x48d950[_0x0e60('0x2b')]);if(_0x48d950['name']){delete _0x48d950['name'];}_0x3ddc19[_0x0e60('0x1c')](_0x5665c2)['send'](_0x48d950);};}exports[_0x0e60('0x2c')]=function(_0x548919,_0x4e6b41){var _0x154478={},_0x3d3c13={},_0x2a282d={'count':0x0,'rows':[]};var _0x4d9b18=_[_0x0e60('0x2d')](db['FreshdeskField'][_0x0e60('0x2e')],function(_0x1d54c0){return{'name':_0x1d54c0[_0x0e60('0x2f')],'type':_0x1d54c0['type'][_0x0e60('0x30')]};});_0x3d3c13[_0x0e60('0x31')]=_[_0x0e60('0x2d')](_0x4d9b18,'name');_0x3d3c13[_0x0e60('0x32')]=_[_0x0e60('0x33')](_0x548919[_0x0e60('0x32')]);_0x3d3c13[_0x0e60('0x34')]=_[_0x0e60('0x35')](_0x3d3c13['model'],_0x3d3c13[_0x0e60('0x32')]);_0x154478['attributes']=_[_0x0e60('0x35')](_0x3d3c13['model'],qs[_0x0e60('0x36')](_0x548919[_0x0e60('0x32')][_0x0e60('0x36')]));_0x154478['attributes']=_0x154478[_0x0e60('0x37')][_0x0e60('0x38')]?_0x154478[_0x0e60('0x37')]:_0x3d3c13[_0x0e60('0x31')];if(!_0x548919[_0x0e60('0x32')][_0x0e60('0x39')](_0x0e60('0x3a'))){_0x154478[_0x0e60('0x20')]=qs[_0x0e60('0x20')](_0x548919[_0x0e60('0x32')][_0x0e60('0x20')]);_0x154478[_0x0e60('0x1e')]=qs['offset'](_0x548919[_0x0e60('0x32')][_0x0e60('0x1e')]);}_0x154478[_0x0e60('0x3b')]=qs[_0x0e60('0x3c')](_0x548919['query']['sort']);_0x154478[_0x0e60('0x3d')]=qs['filters'](_[_0x0e60('0x3e')](_0x548919['query'],_0x3d3c13[_0x0e60('0x34')]),_0x4d9b18);if(_0x548919[_0x0e60('0x32')][_0x0e60('0x3f')]){_0x154478[_0x0e60('0x3d')]=_[_0x0e60('0x40')](_0x154478[_0x0e60('0x3d')],{'$or':_[_0x0e60('0x2d')](_0x4d9b18,function(_0x39fac1){if(_0x39fac1[_0x0e60('0x41')]!==_0x0e60('0x42')){var _0xb0a66c={};_0xb0a66c[_0x39fac1[_0x0e60('0x43')]]={'$like':'%'+_0x548919['query'][_0x0e60('0x3f')]+'%'};return _0xb0a66c;}})});}_0x154478=_['merge']({},_0x154478,_0x548919[_0x0e60('0x44')]);var _0x266cae={'where':_0x154478['where']};return db['FreshdeskField'][_0x0e60('0x21')](_0x266cae)[_0x0e60('0x28')](function(_0x50b793){_0x2a282d[_0x0e60('0x21')]=_0x50b793;if(_0x548919[_0x0e60('0x32')]['includeAll']){_0x154478[_0x0e60('0x45')]=[{'all':!![]}];}return db[_0x0e60('0x46')][_0x0e60('0x47')](_0x154478);})[_0x0e60('0x28')](function(_0x3ac0f0){_0x2a282d[_0x0e60('0x48')]=_0x3ac0f0;return _0x2a282d;})[_0x0e60('0x28')](respondWithFilteredResult(_0x4e6b41,_0x154478))[_0x0e60('0x49')](handleError(_0x4e6b41,null));};exports[_0x0e60('0x4a')]=function(_0x4c89b4,_0x4a2a10){var _0x535c06={'raw':!![],'where':{'id':_0x4c89b4['params']['id']}},_0x39c7d4={};_0x39c7d4[_0x0e60('0x31')]=_[_0x0e60('0x33')](db[_0x0e60('0x46')]['rawAttributes']);_0x39c7d4[_0x0e60('0x32')]=_[_0x0e60('0x33')](_0x4c89b4['query']);_0x39c7d4['filters']=_[_0x0e60('0x35')](_0x39c7d4[_0x0e60('0x31')],_0x39c7d4[_0x0e60('0x32')]);_0x535c06[_0x0e60('0x37')]=_[_0x0e60('0x35')](_0x39c7d4[_0x0e60('0x31')],qs['fields'](_0x4c89b4[_0x0e60('0x32')][_0x0e60('0x36')]));_0x535c06[_0x0e60('0x37')]=_0x535c06[_0x0e60('0x37')][_0x0e60('0x38')]?_0x535c06['attributes']:_0x39c7d4['model'];if(_0x4c89b4['query'][_0x0e60('0x4b')]){_0x535c06[_0x0e60('0x45')]=[{'all':!![]}];}_0x535c06=_[_0x0e60('0x40')]({},_0x535c06,_0x4c89b4[_0x0e60('0x44')]);return db['FreshdeskField']['find'](_0x535c06)['then'](handleEntityNotFound(_0x4a2a10,null))[_0x0e60('0x28')](respondWithResult(_0x4a2a10,null))[_0x0e60('0x49')](handleError(_0x4a2a10,null));};exports[_0x0e60('0x4c')]=function(_0x5fe304,_0x8777f4){return db['FreshdeskField']['create'](_0x5fe304[_0x0e60('0x4d')],{})[_0x0e60('0x28')](respondWithResult(_0x8777f4,0xc9))[_0x0e60('0x49')](handleError(_0x8777f4,null));};exports[_0x0e60('0x27')]=function(_0x4ad156,_0x36a999){if(_0x4ad156[_0x0e60('0x4d')]['id']){delete _0x4ad156[_0x0e60('0x4d')]['id'];}return db['FreshdeskField'][_0x0e60('0x4e')]({'where':{'id':_0x4ad156[_0x0e60('0x4f')]['id']}})['then'](handleEntityNotFound(_0x36a999,null))[_0x0e60('0x28')](saveUpdates(_0x4ad156['body'],null))[_0x0e60('0x28')](respondWithResult(_0x36a999,null))[_0x0e60('0x49')](handleError(_0x36a999,null));};exports[_0x0e60('0x29')]=function(_0x2e887c,_0x477a99){return db['FreshdeskField'][_0x0e60('0x4e')]({'where':{'id':_0x2e887c[_0x0e60('0x4f')]['id']}})[_0x0e60('0x28')](handleEntityNotFound(_0x477a99,null))[_0x0e60('0x28')](removeEntity(_0x477a99,null))['catch'](handleError(_0x477a99,null));}; \ No newline at end of file +var _0x1be1=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','name','send','index','map','FreshdeskField','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','options','includeAll','show','params','rawAttributes','include','create','body','catch','find','destroy','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x574ce3,_0x59eef4){var _0x3447a0=function(_0x27f8cb){while(--_0x27f8cb){_0x574ce3['push'](_0x574ce3['shift']());}};_0x3447a0(++_0x59eef4);}(_0x1be1,0x192));var _0x11be=function(_0xb7453e,_0x29acd0){_0xb7453e=_0xb7453e-0x0;var _0x19bb1d=_0x1be1[_0xb7453e];return _0x19bb1d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11be('0x0'));var jsonpatch=require(_0x11be('0x1'));var rp=require('request-promise');var moment=require(_0x11be('0x2'));var BPromise=require(_0x11be('0x3'));var Mustache=require(_0x11be('0x4'));var util=require(_0x11be('0x5'));var path=require('path');var sox=require(_0x11be('0x6'));var csv=require(_0x11be('0x7'));var ejs=require(_0x11be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11be('0x9'));var squel=require('squel');var crypto=require(_0x11be('0xa'));var jsforce=require(_0x11be('0xb'));var deskjs=require(_0x11be('0xc'));var toCsv=require(_0x11be('0x7'));var querystring=require(_0x11be('0xd'));var Papa=require('papaparse');var Redis=require(_0x11be('0xe'));var authService=require(_0x11be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x11be('0x10'));var hardwareService=require(_0x11be('0x11'));var logger=require(_0x11be('0x12'))(_0x11be('0x13'));var utils=require('../../config/utils');var config=require(_0x11be('0x14'));var licenseUtil=require(_0x11be('0x15'));var db=require(_0x11be('0x16'))['db'];function respondWithStatusCode(_0x4b36c8,_0x3ff31f){_0x3ff31f=_0x3ff31f||0xcc;return function(_0x2dad05){if(_0x2dad05){return _0x4b36c8['sendStatus'](_0x3ff31f);}return _0x4b36c8[_0x11be('0x17')](_0x3ff31f)['end']();};}function respondWithResult(_0x49228e,_0x569842){_0x569842=_0x569842||0xc8;return function(_0x4b6e7e){if(_0x4b6e7e){return _0x49228e['status'](_0x569842)['json'](_0x4b6e7e);}};}function respondWithFilteredResult(_0x588871,_0x2280e2){return function(_0x52bbef){if(_0x52bbef){var _0x31047c=typeof _0x2280e2[_0x11be('0x18')]===_0x11be('0x19')&&typeof _0x2280e2[_0x11be('0x1a')]==='undefined';var _0x2ed725=_0x52bbef[_0x11be('0x1b')];var _0x56ab61=_0x31047c?0x0:_0x2280e2[_0x11be('0x18')];var _0xc3263c=_0x31047c?_0x52bbef[_0x11be('0x1b')]:_0x2280e2['offset']+_0x2280e2['limit'];var _0x141391;if(_0xc3263c>=_0x2ed725){_0xc3263c=_0x2ed725;_0x141391=0xc8;}else{_0x141391=0xce;}_0x588871[_0x11be('0x17')](_0x141391);return _0x588871[_0x11be('0x1c')](_0x11be('0x1d'),_0x56ab61+'-'+_0xc3263c+'/'+_0x2ed725)['json'](_0x52bbef);}return null;};}function patchUpdates(_0x12a5bd){return function(_0x45136f){try{jsonpatch[_0x11be('0x1e')](_0x45136f,_0x12a5bd,!![]);}catch(_0x452315){return BPromise[_0x11be('0x1f')](_0x452315);}return _0x45136f[_0x11be('0x20')]();};}function saveUpdates(_0xa944ac,_0x17678d){return function(_0x3aea14){if(_0x3aea14){return _0x3aea14[_0x11be('0x21')](_0xa944ac)['then'](function(_0xfe3737){return _0xfe3737;});}return null;};}function removeEntity(_0x46b7c2,_0x2fe43c){return function(_0x5d1690){if(_0x5d1690){return _0x5d1690['destroy']()[_0x11be('0x22')](function(){_0x46b7c2[_0x11be('0x17')](0xcc)[_0x11be('0x23')]();});}};}function handleEntityNotFound(_0x4cb27f,_0x106167){return function(_0x518e2b){if(!_0x518e2b){_0x4cb27f[_0x11be('0x24')](0x194);}return _0x518e2b;};}function handleError(_0x563e01,_0x28310d){_0x28310d=_0x28310d||0x1f4;return function(_0xb11f3d){logger['error'](_0xb11f3d[_0x11be('0x25')]);if(_0xb11f3d[_0x11be('0x26')]){delete _0xb11f3d[_0x11be('0x26')];}_0x563e01[_0x11be('0x17')](_0x28310d)[_0x11be('0x27')](_0xb11f3d);};}exports[_0x11be('0x28')]=function(_0xf5a6ac,_0x2cf9aa){var _0x43ab30={},_0x5966c5={},_0x32c796={'count':0x0,'rows':[]};var _0x4e899f=_[_0x11be('0x29')](db[_0x11be('0x2a')]['rawAttributes'],function(_0x584d4c){return{'name':_0x584d4c[_0x11be('0x2b')],'type':_0x584d4c[_0x11be('0x2c')][_0x11be('0x2d')]};});_0x5966c5[_0x11be('0x2e')]=_[_0x11be('0x29')](_0x4e899f,_0x11be('0x26'));_0x5966c5[_0x11be('0x2f')]=_[_0x11be('0x30')](_0xf5a6ac[_0x11be('0x2f')]);_0x5966c5['filters']=_[_0x11be('0x31')](_0x5966c5[_0x11be('0x2e')],_0x5966c5[_0x11be('0x2f')]);_0x43ab30[_0x11be('0x32')]=_[_0x11be('0x31')](_0x5966c5[_0x11be('0x2e')],qs['fields'](_0xf5a6ac[_0x11be('0x2f')][_0x11be('0x33')]));_0x43ab30[_0x11be('0x32')]=_0x43ab30[_0x11be('0x32')][_0x11be('0x34')]?_0x43ab30['attributes']:_0x5966c5[_0x11be('0x2e')];if(!_0xf5a6ac[_0x11be('0x2f')][_0x11be('0x35')]('nolimit')){_0x43ab30[_0x11be('0x1a')]=qs['limit'](_0xf5a6ac['query']['limit']);_0x43ab30['offset']=qs[_0x11be('0x18')](_0xf5a6ac[_0x11be('0x2f')][_0x11be('0x18')]);}_0x43ab30['order']=qs[_0x11be('0x36')](_0xf5a6ac[_0x11be('0x2f')]['sort']);_0x43ab30[_0x11be('0x37')]=qs['filters'](_[_0x11be('0x38')](_0xf5a6ac['query'],_0x5966c5[_0x11be('0x39')]),_0x4e899f);if(_0xf5a6ac[_0x11be('0x2f')][_0x11be('0x3a')]){_0x43ab30[_0x11be('0x37')]=_['merge'](_0x43ab30[_0x11be('0x37')],{'$or':_[_0x11be('0x29')](_0x4e899f,function(_0x3255c0){if(_0x3255c0[_0x11be('0x2c')]!=='VIRTUAL'){var _0x11d5ea={};_0x11d5ea[_0x3255c0[_0x11be('0x26')]]={'$like':'%'+_0xf5a6ac[_0x11be('0x2f')][_0x11be('0x3a')]+'%'};return _0x11d5ea;}})});}_0x43ab30=_[_0x11be('0x3b')]({},_0x43ab30,_0xf5a6ac[_0x11be('0x3c')]);var _0x5742d1={'where':_0x43ab30['where']};return db[_0x11be('0x2a')][_0x11be('0x1b')](_0x5742d1)['then'](function(_0xf303c){_0x32c796[_0x11be('0x1b')]=_0xf303c;if(_0xf5a6ac['query'][_0x11be('0x3d')]){_0x43ab30['include']=[{'all':!![]}];}return db[_0x11be('0x2a')]['findAll'](_0x43ab30);})[_0x11be('0x22')](function(_0x30be21){_0x32c796['rows']=_0x30be21;return _0x32c796;})[_0x11be('0x22')](respondWithFilteredResult(_0x2cf9aa,_0x43ab30))['catch'](handleError(_0x2cf9aa,null));};exports[_0x11be('0x3e')]=function(_0x51a40b,_0x2deae3){var _0x383604={'raw':!![],'where':{'id':_0x51a40b[_0x11be('0x3f')]['id']}},_0x2b847a={};_0x2b847a[_0x11be('0x2e')]=_['keys'](db[_0x11be('0x2a')][_0x11be('0x40')]);_0x2b847a[_0x11be('0x2f')]=_[_0x11be('0x30')](_0x51a40b['query']);_0x2b847a['filters']=_['intersection'](_0x2b847a[_0x11be('0x2e')],_0x2b847a['query']);_0x383604[_0x11be('0x32')]=_['intersection'](_0x2b847a[_0x11be('0x2e')],qs[_0x11be('0x33')](_0x51a40b[_0x11be('0x2f')][_0x11be('0x33')]));_0x383604[_0x11be('0x32')]=_0x383604[_0x11be('0x32')][_0x11be('0x34')]?_0x383604['attributes']:_0x2b847a[_0x11be('0x2e')];if(_0x51a40b['query'][_0x11be('0x3d')]){_0x383604[_0x11be('0x41')]=[{'all':!![]}];}_0x383604=_[_0x11be('0x3b')]({},_0x383604,_0x51a40b['options']);return db['FreshdeskField']['find'](_0x383604)[_0x11be('0x22')](handleEntityNotFound(_0x2deae3,null))[_0x11be('0x22')](respondWithResult(_0x2deae3,null))['catch'](handleError(_0x2deae3,null));};exports['create']=function(_0x5020c7,_0x44e2e8){return db[_0x11be('0x2a')][_0x11be('0x42')](_0x5020c7[_0x11be('0x43')],{})[_0x11be('0x22')](respondWithResult(_0x44e2e8,0xc9))[_0x11be('0x44')](handleError(_0x44e2e8,null));};exports[_0x11be('0x21')]=function(_0x3f2070,_0x2ce110){if(_0x3f2070[_0x11be('0x43')]['id']){delete _0x3f2070[_0x11be('0x43')]['id'];}return db['FreshdeskField'][_0x11be('0x45')]({'where':{'id':_0x3f2070[_0x11be('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2ce110,null))['then'](saveUpdates(_0x3f2070['body'],null))[_0x11be('0x22')](respondWithResult(_0x2ce110,null))['catch'](handleError(_0x2ce110,null));};exports[_0x11be('0x46')]=function(_0x1c1626,_0x2716dc){return db[_0x11be('0x2a')][_0x11be('0x45')]({'where':{'id':_0x1c1626[_0x11be('0x3f')]['id']}})[_0x11be('0x22')](handleEntityNotFound(_0x2716dc,null))[_0x11be('0x22')](removeEntity(_0x2716dc,null))[_0x11be('0x44')](handleError(_0x2716dc,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 6cf3272..95e9ac9 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 _0x1b66=['freshdesk_unique_index','idField','moment','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x54206d,_0x346532){var _0x36e68c=function(_0x413033){while(--_0x413033){_0x54206d['push'](_0x54206d['shift']());}};_0x36e68c(++_0x346532);}(_0x1b66,0xba));var _0x61b6=function(_0x5c9cb5,_0x375ceb){_0x5c9cb5=_0x5c9cb5-0x0;var _0x94dc8a=_0x1b66[_0x5c9cb5];return _0x94dc8a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x61b6('0x0'));var BPromise=require('bluebird');var rp=require(_0x61b6('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61b6('0x2'));var config=require(_0x61b6('0x3'));var attributes=require(_0x61b6('0x4'));module[_0x61b6('0x5')]=function(_0x5b7f78,_0x11bd18){return _0x5b7f78['define']('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x61b6('0x6'),'fields':[_0x61b6('0x7'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0255=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0255,0x110));var _0x5025=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0255[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5025('0x0'));var util=require(_0x5025('0x1'));var logger=require(_0x5025('0x2'))(_0x5025('0x3'));var moment=require(_0x5025('0x4'));var BPromise=require(_0x5025('0x5'));var rp=require(_0x5025('0x6'));var fs=require('fs');var path=require(_0x5025('0x7'));var rimraf=require(_0x5025('0x8'));var config=require('../../config/environment');var attributes=require(_0x5025('0x9'));module[_0x5025('0xa')]=function(_0x715c21,_0x14a448){return _0x715c21[_0x5025('0xb')](_0x5025('0xc'),attributes,{'tableName':_0x5025('0xd'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x5025('0xe'),_0x5025('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index be27334..5246af7 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 _0xf630=['../../config/logger','../../config/environment','jayson/promise','client','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4df85c,_0x248dfb){var _0x4e2a61=function(_0x4e2c8e){while(--_0x4e2c8e){_0x4df85c['push'](_0x4df85c['shift']());}};_0x4e2a61(++_0x248dfb);}(_0xf630,0xc0));var _0x0f63=function(_0x4f9a7f,_0x30d20){_0x4f9a7f=_0x4f9a7f-0x0;var _0x169f92=_0xf630[_0x4f9a7f];return _0x169f92;};'use strict';var _=require('lodash');var util=require(_0x0f63('0x0'));var moment=require(_0x0f63('0x1'));var BPromise=require(_0x0f63('0x2'));var rs=require(_0x0f63('0x3'));var fs=require('fs');var Redis=require(_0x0f63('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f63('0x5'));var logger=require(_0x0f63('0x6'))('rpc');var config=require(_0x0f63('0x7'));var jayson=require(_0x0f63('0x8'));var client=jayson[_0x0f63('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58626a,_0x3601c0,_0xc5ef80){return new BPromise(function(_0x373e58,_0x1d55e9){return client[_0x0f63('0xa')](_0x58626a,_0xc5ef80)['then'](function(_0x2e204e){logger[_0x0f63('0xb')](_0x0f63('0xc'),_0x3601c0,_0x0f63('0xd'));logger[_0x0f63('0xe')](_0x0f63('0xf'),_0x3601c0,_0x0f63('0xd'),JSON[_0x0f63('0x10')](_0x2e204e));if(_0x2e204e[_0x0f63('0x11')]){if(_0x2e204e[_0x0f63('0x11')][_0x0f63('0x12')]===0x1f4){logger[_0x0f63('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x3601c0,_0x2e204e[_0x0f63('0x11')][_0x0f63('0x13')]);return _0x1d55e9(_0x2e204e[_0x0f63('0x11')][_0x0f63('0x13')]);}logger[_0x0f63('0x11')](_0x0f63('0xc'),_0x3601c0,_0x2e204e[_0x0f63('0x11')][_0x0f63('0x13')]);return _0x373e58(_0x2e204e[_0x0f63('0x11')][_0x0f63('0x13')]);}else{logger['info'](_0x0f63('0xc'),_0x3601c0,_0x0f63('0xd'));_0x373e58(_0x2e204e[_0x0f63('0x14')]['message']);}})[_0x0f63('0x15')](function(_0x5f40c9){logger[_0x0f63('0x11')](_0x0f63('0xc'),_0x3601c0,_0x5f40c9);_0x1d55e9(_0x5f40c9);});});} \ No newline at end of file +var _0x1a2a=['FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','debug'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x1a2a,0x188));var _0xa1a2=function(_0x132889,_0x2207a8){_0x132889=_0x132889-0x0;var _0xd93752=_0x1a2a[_0x132889];return _0xd93752;};'use strict';var _=require('lodash');var util=require(_0xa1a2('0x0'));var moment=require(_0xa1a2('0x1'));var BPromise=require(_0xa1a2('0x2'));var rs=require(_0xa1a2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1a2('0x4'))['db'];var utils=require(_0xa1a2('0x5'));var logger=require(_0xa1a2('0x6'))(_0xa1a2('0x7'));var config=require(_0xa1a2('0x8'));var jayson=require(_0xa1a2('0x9'));var client=jayson[_0xa1a2('0xa')][_0xa1a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x288bae,_0x58f064,_0x2dec2e){return new BPromise(function(_0x3de40a,_0x2240ca){return client[_0xa1a2('0xc')](_0x288bae,_0x2dec2e)['then'](function(_0x47176e){logger[_0xa1a2('0xd')](_0xa1a2('0xe'),_0x58f064,'request\x20sent');logger[_0xa1a2('0xf')](_0xa1a2('0x10'),_0x58f064,_0xa1a2('0x11'),JSON[_0xa1a2('0x12')](_0x47176e));if(_0x47176e['error']){if(_0x47176e[_0xa1a2('0x13')][_0xa1a2('0x14')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x58f064,_0x47176e['error'][_0xa1a2('0x15')]);return _0x2240ca(_0x47176e['error'][_0xa1a2('0x15')]);}logger[_0xa1a2('0x13')](_0xa1a2('0xe'),_0x58f064,_0x47176e['error'][_0xa1a2('0x15')]);return _0x3de40a(_0x47176e['error'][_0xa1a2('0x15')]);}else{logger[_0xa1a2('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x58f064,'request\x20sent');_0x3de40a(_0x47176e[_0xa1a2('0x16')][_0xa1a2('0x15')]);}})[_0xa1a2('0x17')](function(_0xc481d6){logger['error'](_0xa1a2('0xe'),_0x58f064,_0xc481d6);_0x2240ca(_0xc481d6);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 57f64c2..593daa4 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 _0xde2c=['getFields','post','/:id/configurations','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields'];(function(_0xd2f473,_0x5cd78e){var _0x3b6303=function(_0x243aaf){while(--_0x243aaf){_0xd2f473['push'](_0xd2f473['shift']());}};_0x3b6303(++_0x5cd78e);}(_0xde2c,0x7f));var _0xcde2=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0xde2c[_0x45c262];return _0x4f2ba6;};'use strict';var multer=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var path=require(_0xcde2('0x2'));var timeout=require(_0xcde2('0x3'));var express=require(_0xcde2('0x4'));var router=express[_0xcde2('0x5')]();var fs_extra=require(_0xcde2('0x6'));var auth=require(_0xcde2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcde2('0x8'));var controller=require(_0xcde2('0x9'));router[_0xcde2('0xa')]('/',auth[_0xcde2('0xb')](),controller[_0xcde2('0xc')]);router['get'](_0xcde2('0xd'),auth[_0xcde2('0xb')](),controller[_0xcde2('0xe')]);router['get']('/:id/configurations',auth[_0xcde2('0xb')](),controller[_0xcde2('0xf')]);router['get'](_0xcde2('0x10'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x11')]);router[_0xcde2('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcde2('0x12')](_0xcde2('0x13'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x14')]);router[_0xcde2('0x15')](_0xcde2('0xd'),auth['isAuthenticated'](),controller[_0xcde2('0x16')]);router['delete'](_0xcde2('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xcde2('0x17')]=router; \ No newline at end of file +var _0x0713=['destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','delete'];(function(_0x581280,_0x553087){var _0x752ff4=function(_0x50969f){while(--_0x50969f){_0x581280['push'](_0x581280['shift']());}};_0x752ff4(++_0x553087);}(_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['getConfigurations']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x10')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x12')]);router['put']('/:id',auth[_0x3071('0x9')](),controller['update']);router[_0x3071('0x13')](_0x3071('0xb'),auth['isAuthenticated'](),controller[_0x3071('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 8806921..8e3544e 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 _0x14a0=['username','exports','STRING'];(function(_0x5b36ac,_0x4767aa){var _0x512bc2=function(_0x312285){while(--_0x312285){_0x5b36ac['push'](_0x5b36ac['shift']());}};_0x512bc2(++_0x4767aa);}(_0x14a0,0x8e));var _0x014a=function(_0x23e030,_0x155e69){_0x23e030=_0x23e030-0x0;var _0x3305dc=_0x14a0[_0x23e030];return _0x3305dc;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'name':{'type':Sequelize[_0x014a('0x1')]},'description':{'type':Sequelize[_0x014a('0x1')]},'username':{'type':Sequelize[_0x014a('0x1')],'unique':_0x014a('0x2')},'apiKey':{'type':Sequelize[_0x014a('0x1')]},'remoteUri':{'type':Sequelize[_0x014a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xcf2f=['exports','STRING','remoteUri','sequelize'];(function(_0xcb16c,_0x2bb83e){var _0x324d15=function(_0xe9942f){while(--_0xe9942f){_0xcb16c['push'](_0xcb16c['shift']());}};_0x324d15(++_0x2bb83e);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x47e639,_0x15659){_0x47e639=_0x47e639-0x0;var _0x416d6d=_0xcf2f[_0x47e639];return _0x416d6d;};'use strict';var Sequelize=require(_0xfcf2('0x0'));module[_0xfcf2('0x1')]={'name':{'type':Sequelize[_0xfcf2('0x2')]},'description':{'type':Sequelize[_0xfcf2('0x2')]},'username':{'type':Sequelize[_0xfcf2('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfcf2('0x2')]},'remoteUri':{'type':Sequelize[_0xfcf2('0x2')],'unique':_0xfcf2('0x3')},'serverUrl':{'type':Sequelize[_0xfcf2('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 7c23ca2..5ab2787 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 _0xd64a=['name','send','index','FreshsalesAccount','rawAttributes','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','find','body','getConfigurations','FreshsalesConfiguration','map','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','create','FreshsalesField','getFields','findOne','username','apiKey','remoteUri','slice','lastIndexOf','GET','format','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','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','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','update','destroy','then'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xd64a,0x179));var _0xad64=function(_0x222777,_0x35e7c5){_0x222777=_0x222777-0x0;var _0x9cae9f=_0xd64a[_0x222777];return _0x9cae9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad64('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad64('0x1'));var rp=require(_0xad64('0x2'));var moment=require(_0xad64('0x3'));var BPromise=require(_0xad64('0x4'));var Mustache=require(_0xad64('0x5'));var util=require(_0xad64('0x6'));var path=require(_0xad64('0x7'));var sox=require(_0xad64('0x8'));var csv=require(_0xad64('0x9'));var ejs=require(_0xad64('0xa'));var fs=require('fs');var fs_extra=require(_0xad64('0xb'));var _=require(_0xad64('0xc'));var squel=require(_0xad64('0xd'));var crypto=require(_0xad64('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xad64('0xf'));var toCsv=require(_0xad64('0x9'));var querystring=require(_0xad64('0x10'));var Papa=require(_0xad64('0x11'));var Redis=require(_0xad64('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xad64('0x13'));var as=require(_0xad64('0x14'));var hardwareService=require(_0xad64('0x15'));var logger=require(_0xad64('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xad64('0x17'));var licenseUtil=require(_0xad64('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xad64('0x19'));function respondWithStatusCode(_0x45f3ff,_0x158337){_0x158337=_0x158337||0xcc;return function(_0x612cc5){if(_0x612cc5){return _0x45f3ff[_0xad64('0x1a')](_0x158337);}return _0x45f3ff[_0xad64('0x1b')](_0x158337)[_0xad64('0x1c')]();};}function respondWithResult(_0x26282d,_0x26ea35){_0x26ea35=_0x26ea35||0xc8;return function(_0xbe4484){if(_0xbe4484){return _0x26282d[_0xad64('0x1b')](_0x26ea35)[_0xad64('0x1d')](_0xbe4484);}};}function respondWithFilteredResult(_0x4c406d,_0x475da9){return function(_0x5faa9b){if(_0x5faa9b){var _0xe2628b=typeof _0x475da9[_0xad64('0x1e')]===_0xad64('0x1f')&&typeof _0x475da9['limit']===_0xad64('0x1f');var _0xb750cf=_0x5faa9b[_0xad64('0x20')];var _0x14c2b4=_0xe2628b?0x0:_0x475da9[_0xad64('0x1e')];var _0x1e8f06=_0xe2628b?_0x5faa9b['count']:_0x475da9[_0xad64('0x1e')]+_0x475da9['limit'];var _0x19ab57;if(_0x1e8f06>=_0xb750cf){_0x1e8f06=_0xb750cf;_0x19ab57=0xc8;}else{_0x19ab57=0xce;}_0x4c406d[_0xad64('0x1b')](_0x19ab57);return _0x4c406d['set'](_0xad64('0x21'),_0x14c2b4+'-'+_0x1e8f06+'/'+_0xb750cf)[_0xad64('0x1d')](_0x5faa9b);}return null;};}function patchUpdates(_0x4d5483){return function(_0x29dee0){try{jsonpatch[_0xad64('0x22')](_0x29dee0,_0x4d5483,!![]);}catch(_0x4c6a97){return BPromise['reject'](_0x4c6a97);}return _0x29dee0[_0xad64('0x23')]();};}function saveUpdates(_0x5b5fe9,_0x32cc60){return function(_0x2a6556){if(_0x2a6556){return _0x2a6556[_0xad64('0x24')](_0x5b5fe9)['then'](function(_0x99650b){return _0x99650b;});}return null;};}function removeEntity(_0x2f1bfc,_0xbf7b95){return function(_0x5d6bdf){if(_0x5d6bdf){return _0x5d6bdf[_0xad64('0x25')]()[_0xad64('0x26')](function(){_0x2f1bfc[_0xad64('0x1b')](0xcc)[_0xad64('0x1c')]();});}};}function handleEntityNotFound(_0x5d4c5a,_0x5ef358){return function(_0x1c5256){if(!_0x1c5256){_0x5d4c5a['sendStatus'](0x194);}return _0x1c5256;};}function handleError(_0xfdd083,_0x4781d0){_0x4781d0=_0x4781d0||0x1f4;return function(_0x1db748){logger['error'](_0x1db748['stack']);if(_0x1db748['name']){delete _0x1db748[_0xad64('0x27')];}_0xfdd083[_0xad64('0x1b')](_0x4781d0)[_0xad64('0x28')](_0x1db748);};}exports[_0xad64('0x29')]=function(_0x584c8f,_0x1ed000){var _0x58cfa9={},_0x351f63={},_0x1e1ffd={'count':0x0,'rows':[]};var _0x3f1247=_['map'](db[_0xad64('0x2a')][_0xad64('0x2b')],function(_0x8cd23e){return{'name':_0x8cd23e['fieldName'],'type':_0x8cd23e[_0xad64('0x2c')][_0xad64('0x2d')]};});_0x351f63['model']=_['map'](_0x3f1247,_0xad64('0x27'));_0x351f63[_0xad64('0x2e')]=_['keys'](_0x584c8f['query']);_0x351f63['filters']=_['intersection'](_0x351f63['model'],_0x351f63[_0xad64('0x2e')]);_0x58cfa9['attributes']=_[_0xad64('0x2f')](_0x351f63[_0xad64('0x30')],qs[_0xad64('0x31')](_0x584c8f['query'][_0xad64('0x31')]));_0x58cfa9[_0xad64('0x32')]=_0x58cfa9[_0xad64('0x32')][_0xad64('0x33')]?_0x58cfa9[_0xad64('0x32')]:_0x351f63[_0xad64('0x30')];if(!_0x584c8f['query'][_0xad64('0x34')](_0xad64('0x35'))){_0x58cfa9[_0xad64('0x36')]=qs['limit'](_0x584c8f['query'][_0xad64('0x36')]);_0x58cfa9['offset']=qs[_0xad64('0x1e')](_0x584c8f[_0xad64('0x2e')][_0xad64('0x1e')]);}_0x58cfa9[_0xad64('0x37')]=qs['sort'](_0x584c8f['query'][_0xad64('0x38')]);_0x58cfa9[_0xad64('0x39')]=qs[_0xad64('0x3a')](_[_0xad64('0x3b')](_0x584c8f[_0xad64('0x2e')],_0x351f63['filters']),_0x3f1247);if(_0x584c8f[_0xad64('0x2e')][_0xad64('0x3c')]){_0x58cfa9['where']=_['merge'](_0x58cfa9[_0xad64('0x39')],{'$or':_['map'](_0x3f1247,function(_0x40c8db){if(_0x40c8db[_0xad64('0x2c')]!==_0xad64('0x3d')){var _0x5b1cdb={};_0x5b1cdb[_0x40c8db[_0xad64('0x27')]]={'$like':'%'+_0x584c8f['query'][_0xad64('0x3c')]+'%'};return _0x5b1cdb;}})});}_0x58cfa9=_[_0xad64('0x3e')]({},_0x58cfa9,_0x584c8f['options']);var _0x399b83={'where':_0x58cfa9[_0xad64('0x39')]};return db['FreshsalesAccount'][_0xad64('0x20')](_0x399b83)['then'](function(_0x463b9c){_0x1e1ffd[_0xad64('0x20')]=_0x463b9c;if(_0x584c8f[_0xad64('0x2e')]['includeAll']){_0x58cfa9[_0xad64('0x3f')]=[{'all':!![]}];}return db[_0xad64('0x2a')][_0xad64('0x40')](_0x58cfa9);})[_0xad64('0x26')](function(_0x2c6b28){_0x1e1ffd[_0xad64('0x41')]=_0x2c6b28;return _0x1e1ffd;})[_0xad64('0x26')](respondWithFilteredResult(_0x1ed000,_0x58cfa9))[_0xad64('0x42')](handleError(_0x1ed000,null));};exports[_0xad64('0x43')]=function(_0x8c5a6c,_0x4efa30){var _0x2f97ef={'raw':![],'where':{'id':_0x8c5a6c[_0xad64('0x44')]['id']}},_0x1f3295={};_0x1f3295['model']=_[_0xad64('0x45')](db[_0xad64('0x2a')][_0xad64('0x2b')]);_0x1f3295['query']=_[_0xad64('0x45')](_0x8c5a6c[_0xad64('0x2e')]);_0x1f3295[_0xad64('0x3a')]=_['intersection'](_0x1f3295[_0xad64('0x30')],_0x1f3295['query']);_0x2f97ef[_0xad64('0x32')]=_[_0xad64('0x2f')](_0x1f3295[_0xad64('0x30')],qs[_0xad64('0x31')](_0x8c5a6c[_0xad64('0x2e')][_0xad64('0x31')]));_0x2f97ef[_0xad64('0x32')]=_0x2f97ef[_0xad64('0x32')][_0xad64('0x33')]?_0x2f97ef[_0xad64('0x32')]:_0x1f3295[_0xad64('0x30')];if(_0x8c5a6c['query'][_0xad64('0x46')]){_0x2f97ef[_0xad64('0x3f')]=[{'all':!![]}];}_0x2f97ef=_[_0xad64('0x3e')]({},_0x2f97ef,_0x8c5a6c[_0xad64('0x47')]);return db['FreshsalesAccount'][_0xad64('0x48')](_0x2f97ef)[_0xad64('0x26')](handleEntityNotFound(_0x4efa30,null))[_0xad64('0x26')](respondWithResult(_0x4efa30,null))[_0xad64('0x42')](handleError(_0x4efa30,null));};exports['create']=function(_0x365d75,_0x554ebf){return db[_0xad64('0x2a')]['create'](_0x365d75[_0xad64('0x49')],{})['then'](respondWithResult(_0x554ebf,0xc9))[_0xad64('0x42')](handleError(_0x554ebf,null));};exports['update']=function(_0x43a718,_0x26ca82){if(_0x43a718['body']['id']){delete _0x43a718[_0xad64('0x49')]['id'];}return db[_0xad64('0x2a')][_0xad64('0x48')]({'where':{'id':_0x43a718[_0xad64('0x44')]['id']}})['then'](handleEntityNotFound(_0x26ca82,null))['then'](saveUpdates(_0x43a718[_0xad64('0x49')],null))[_0xad64('0x26')](respondWithResult(_0x26ca82,null))[_0xad64('0x42')](handleError(_0x26ca82,null));};exports[_0xad64('0x25')]=function(_0x34e49f,_0x23f8ec){return db[_0xad64('0x2a')]['find']({'where':{'id':_0x34e49f[_0xad64('0x44')]['id']}})[_0xad64('0x26')](handleEntityNotFound(_0x23f8ec,null))[_0xad64('0x26')](removeEntity(_0x23f8ec,null))[_0xad64('0x42')](handleError(_0x23f8ec,null));};exports[_0xad64('0x4a')]=function(_0x416ab7,_0x1e1943,_0x27d786){var _0x5e299b={};var _0x4878b6={};var _0x340d86;var _0x154a0b;return db[_0xad64('0x2a')]['findOne']({'where':{'id':_0x416ab7['params']['id']}})[_0xad64('0x26')](handleEntityNotFound(_0x1e1943,null))[_0xad64('0x26')](function(_0x338040){if(_0x338040){_0x340d86=_0x338040;_0x4878b6[_0xad64('0x30')]=_['keys'](db[_0xad64('0x4b')]['rawAttributes']);_0x4878b6['query']=_[_0xad64('0x45')](_0x416ab7[_0xad64('0x2e')]);_0x4878b6[_0xad64('0x3a')]=_['intersection'](_0x4878b6[_0xad64('0x30')],_0x4878b6[_0xad64('0x2e')]);_0x5e299b[_0xad64('0x32')]=_['intersection'](_0x4878b6[_0xad64('0x30')],qs['fields'](_0x416ab7['query'][_0xad64('0x31')]));_0x5e299b['attributes']=_0x5e299b[_0xad64('0x32')][_0xad64('0x33')]?_0x5e299b['attributes']:_0x4878b6[_0xad64('0x30')];_0x5e299b[_0xad64('0x37')]=qs[_0xad64('0x38')](_0x416ab7[_0xad64('0x2e')][_0xad64('0x38')]);_0x5e299b[_0xad64('0x39')]=qs[_0xad64('0x3a')](_[_0xad64('0x3b')](_0x416ab7[_0xad64('0x2e')],_0x4878b6['filters']));if(_0x416ab7[_0xad64('0x2e')]['filter']){_0x5e299b['where']=_[_0xad64('0x3e')](_0x5e299b[_0xad64('0x39')],{'$or':_[_0xad64('0x4c')](_0x5e299b[_0xad64('0x32')],function(_0xba58df){var _0x261fbc={};_0x261fbc[_0xba58df]={'$like':'%'+_0x416ab7[_0xad64('0x2e')][_0xad64('0x3c')]+'%'};return _0x261fbc;})});}_0x5e299b=_[_0xad64('0x3e')]({},_0x5e299b,_0x416ab7['options']);return _0x340d86[_0xad64('0x4a')](_0x5e299b);}})[_0xad64('0x26')](function(_0xa2d47f){if(_0xa2d47f){_0x154a0b=_0xa2d47f['length'];if(!_0x416ab7[_0xad64('0x2e')][_0xad64('0x34')]('nolimit')){_0x5e299b[_0xad64('0x36')]=qs[_0xad64('0x36')](_0x416ab7['query']['limit']);_0x5e299b['offset']=qs[_0xad64('0x1e')](_0x416ab7[_0xad64('0x2e')][_0xad64('0x1e')]);}return _0x340d86['getConfigurations'](_0x5e299b);}})[_0xad64('0x26')](function(_0x3f121e){if(_0x3f121e){return _0x3f121e?{'count':_0x154a0b,'rows':_0x3f121e}:null;}})[_0xad64('0x26')](respondWithResult(_0x1e1943,null))[_0xad64('0x42')](handleError(_0x1e1943,null));};exports[_0xad64('0x4d')]=function(_0x487810,_0xd8cce5,_0x1c33bf){if(_0x487810[_0xad64('0x49')]['id']){delete _0x487810[_0xad64('0x49')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x487810[_0xad64('0x44')]['id']}})[_0xad64('0x26')](handleEntityNotFound(_0xd8cce5,null))[_0xad64('0x26')](function(_0x3547b7){if(_0x3547b7){_0x487810[_0xad64('0x49')][_0xad64('0x4e')]=_0x3547b7['id'];_0x487810[_0xad64('0x49')]['Subjects']=integrations[_0xad64('0x4f')](_0x487810['body'][_0xad64('0x50')],_0x487810[_0xad64('0x49')][_0xad64('0x2c')]);_0x487810['body'][_0xad64('0x51')]=integrations[_0xad64('0x52')](_0x487810['body'][_0xad64('0x50')],_0x487810[_0xad64('0x49')][_0xad64('0x2c')]);return db[_0xad64('0x4b')][_0xad64('0x53')](_0x487810[_0xad64('0x49')],{'include':[{'model':db[_0xad64('0x54')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0xad64('0x51')}]});}return null;})[_0xad64('0x26')](respondWithResult(_0xd8cce5,null))['catch'](handleError(_0xd8cce5,null));};exports[_0xad64('0x55')]=function(_0x49a93f,_0x4d1e38,_0x572ac){var _0x59b34c='';var _0x4e5cd7='';return db[_0xad64('0x2a')][_0xad64('0x56')]({'where':{'id':_0x49a93f[_0xad64('0x44')]['id']},'attributes':['id',_0xad64('0x57'),'remoteUri',_0xad64('0x58')]})['then'](handleEntityNotFound(_0x4d1e38,null))[_0xad64('0x26')](function(_0x573eb5){if(_0x573eb5){_0x4e5cd7=_0x573eb5[_0xad64('0x57')];_0x59b34c=_0x573eb5[_0xad64('0x59')];var _0xea7598=_0x573eb5[_0xad64('0x59')][_0xad64('0x5a')](-0x1);if(_0xea7598==='/'){_0x59b34c=_0x59b34c['substring'](0x0,_0x59b34c[_0xad64('0x5b')](_0xea7598));}return rp({'method':_0xad64('0x5c'),'uri':util[_0xad64('0x5d')]('%s%s',_0x59b34c,_0xad64('0x5e')),'headers':{'Authorization':_0xad64('0x5f')+_0x573eb5['apiKey']},'json':!![]});}})[_0xad64('0x26')](function(_0x130deb){if(_0x130deb){var _0x71c55b=_0x130deb[_0xad64('0x60')];var _0x5a3458=![];var _0x4ac032=null;for(_0x4ac032=0x0;_0x4ac032<_0x71c55b[_0xad64('0x33')];_0x4ac032++){if(_0x71c55b[_0x4ac032][_0xad64('0x61')]===_0x4e5cd7){_0x5a3458=!![];}}if(_0x5a3458){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xad64('0x62')});}}})[_0xad64('0x26')](respondWithResult(_0x4d1e38,null))[_0xad64('0x42')](function(_0x4b4030){var _0xc33643=_0x49a93f['query'][_0xad64('0x63')]?0x1f4:_0x4b4030[_0xad64('0x64')]||0x1f4;logger[_0xad64('0x65')](_0xad64('0x66'),_0xad64('0x55'),_0xc33643,JSON['stringify'](_0x4b4030));delete _0x4b4030[_0xad64('0x27')];if(_0xc33643===0x191){_0xc33643=0x190;}_0x4d1e38[_0xad64('0x1b')](_0xc33643)['send'](_0x49a93f[_0xad64('0x2e')][_0xad64('0x63')]?{'message':_0xad64('0x67'),'statusCode':_0x4b4030[_0xad64('0x64')]}:_0x4b4030);});}; \ No newline at end of file +var _0x934d=['sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','keys','find','create','body','findOne','pick','getConfigurations','nolimit','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','send','index','map','FreshsalesAccount','rawAttributes','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order'];(function(_0x59a033,_0xe7eabb){var _0x5144ef=function(_0x2c4973){while(--_0x2c4973){_0x59a033['push'](_0x59a033['shift']());}};_0x5144ef(++_0xe7eabb);}(_0x934d,0x8d));var _0xd934=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x934d[_0x2faddb];return _0x273c05;};'use strict';var emlformat=require(_0xd934('0x0'));var rimraf=require(_0xd934('0x1'));var zipdir=require(_0xd934('0x2'));var jsonpatch=require(_0xd934('0x3'));var rp=require(_0xd934('0x4'));var moment=require(_0xd934('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd934('0x6'));var path=require(_0xd934('0x7'));var sox=require('sox');var csv=require(_0xd934('0x8'));var ejs=require(_0xd934('0x9'));var fs=require('fs');var fs_extra=require(_0xd934('0xa'));var _=require(_0xd934('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd934('0xc'));var toCsv=require(_0xd934('0x8'));var querystring=require(_0xd934('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd934('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd934('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd934('0x10'))(_0xd934('0x11'));var utils=require(_0xd934('0x12'));var config=require(_0xd934('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd934('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x32a0d8,_0x107985){_0x107985=_0x107985||0xcc;return function(_0x313796){if(_0x313796){return _0x32a0d8[_0xd934('0x15')](_0x107985);}return _0x32a0d8[_0xd934('0x16')](_0x107985)['end']();};}function respondWithResult(_0xa595b7,_0x5acda9){_0x5acda9=_0x5acda9||0xc8;return function(_0x334479){if(_0x334479){return _0xa595b7[_0xd934('0x16')](_0x5acda9)[_0xd934('0x17')](_0x334479);}};}function respondWithFilteredResult(_0x45a822,_0x2a43cc){return function(_0x1c19dc){if(_0x1c19dc){var _0x1cd9fd=typeof _0x2a43cc[_0xd934('0x18')]==='undefined'&&typeof _0x2a43cc['limit']==='undefined';var _0x430749=_0x1c19dc['count'];var _0x3747b2=_0x1cd9fd?0x0:_0x2a43cc['offset'];var _0x15d047=_0x1cd9fd?_0x1c19dc[_0xd934('0x19')]:_0x2a43cc[_0xd934('0x18')]+_0x2a43cc['limit'];var _0x3f1329;if(_0x15d047>=_0x430749){_0x15d047=_0x430749;_0x3f1329=0xc8;}else{_0x3f1329=0xce;}_0x45a822['status'](_0x3f1329);return _0x45a822[_0xd934('0x1a')](_0xd934('0x1b'),_0x3747b2+'-'+_0x15d047+'/'+_0x430749)[_0xd934('0x17')](_0x1c19dc);}return null;};}function patchUpdates(_0x88d644){return function(_0x4a219f){try{jsonpatch[_0xd934('0x1c')](_0x4a219f,_0x88d644,!![]);}catch(_0x3716b9){return BPromise[_0xd934('0x1d')](_0x3716b9);}return _0x4a219f[_0xd934('0x1e')]();};}function saveUpdates(_0x28fa4f,_0x428061){return function(_0x4e5d95){if(_0x4e5d95){return _0x4e5d95[_0xd934('0x1f')](_0x28fa4f)[_0xd934('0x20')](function(_0x4d1085){return _0x4d1085;});}return null;};}function removeEntity(_0x15f945,_0x5e86ba){return function(_0x167c90){if(_0x167c90){return _0x167c90[_0xd934('0x21')]()[_0xd934('0x20')](function(){_0x15f945['status'](0xcc)[_0xd934('0x22')]();});}};}function handleEntityNotFound(_0x5f76f1,_0x39e1ca){return function(_0x671c43){if(!_0x671c43){_0x5f76f1['sendStatus'](0x194);}return _0x671c43;};}function handleError(_0xd6225c,_0x37aeea){_0x37aeea=_0x37aeea||0x1f4;return function(_0x47a477){logger['error'](_0x47a477[_0xd934('0x23')]);if(_0x47a477['name']){delete _0x47a477['name'];}_0xd6225c[_0xd934('0x16')](_0x37aeea)[_0xd934('0x24')](_0x47a477);};}exports[_0xd934('0x25')]=function(_0x1285f5,_0x14e973){var _0xc826e5={},_0x53a817={},_0x461286={'count':0x0,'rows':[]};var _0x1e2570=_[_0xd934('0x26')](db[_0xd934('0x27')][_0xd934('0x28')],function(_0x322272){return{'name':_0x322272['fieldName'],'type':_0x322272['type'][_0xd934('0x29')]};});_0x53a817[_0xd934('0x2a')]=_[_0xd934('0x26')](_0x1e2570,_0xd934('0x2b'));_0x53a817[_0xd934('0x2c')]=_['keys'](_0x1285f5['query']);_0x53a817[_0xd934('0x2d')]=_[_0xd934('0x2e')](_0x53a817[_0xd934('0x2a')],_0x53a817[_0xd934('0x2c')]);_0xc826e5[_0xd934('0x2f')]=_['intersection'](_0x53a817['model'],qs[_0xd934('0x30')](_0x1285f5[_0xd934('0x2c')][_0xd934('0x30')]));_0xc826e5[_0xd934('0x2f')]=_0xc826e5[_0xd934('0x2f')][_0xd934('0x31')]?_0xc826e5[_0xd934('0x2f')]:_0x53a817[_0xd934('0x2a')];if(!_0x1285f5[_0xd934('0x2c')][_0xd934('0x32')]('nolimit')){_0xc826e5['limit']=qs['limit'](_0x1285f5[_0xd934('0x2c')][_0xd934('0x33')]);_0xc826e5[_0xd934('0x18')]=qs['offset'](_0x1285f5['query'][_0xd934('0x18')]);}_0xc826e5[_0xd934('0x34')]=qs['sort'](_0x1285f5[_0xd934('0x2c')][_0xd934('0x35')]);_0xc826e5['where']=qs[_0xd934('0x2d')](_['pick'](_0x1285f5[_0xd934('0x2c')],_0x53a817[_0xd934('0x2d')]),_0x1e2570);if(_0x1285f5[_0xd934('0x2c')]['filter']){_0xc826e5[_0xd934('0x36')]=_[_0xd934('0x37')](_0xc826e5[_0xd934('0x36')],{'$or':_[_0xd934('0x26')](_0x1e2570,function(_0x1aa3ff){if(_0x1aa3ff[_0xd934('0x38')]!==_0xd934('0x39')){var _0x528fe1={};_0x528fe1[_0x1aa3ff['name']]={'$like':'%'+_0x1285f5['query'][_0xd934('0x3a')]+'%'};return _0x528fe1;}})});}_0xc826e5=_['merge']({},_0xc826e5,_0x1285f5[_0xd934('0x3b')]);var _0x25678e={'where':_0xc826e5[_0xd934('0x36')]};return db['FreshsalesAccount'][_0xd934('0x19')](_0x25678e)[_0xd934('0x20')](function(_0x3b1989){_0x461286[_0xd934('0x19')]=_0x3b1989;if(_0x1285f5[_0xd934('0x2c')][_0xd934('0x3c')]){_0xc826e5[_0xd934('0x3d')]=[{'all':!![]}];}return db[_0xd934('0x27')][_0xd934('0x3e')](_0xc826e5);})[_0xd934('0x20')](function(_0x2aece0){_0x461286['rows']=_0x2aece0;return _0x461286;})[_0xd934('0x20')](respondWithFilteredResult(_0x14e973,_0xc826e5))[_0xd934('0x3f')](handleError(_0x14e973,null));};exports['show']=function(_0x57040f,_0x416afa){var _0x4b98ba={'raw':![],'where':{'id':_0x57040f[_0xd934('0x40')]['id']}},_0xf91c16={};_0xf91c16[_0xd934('0x2a')]=_[_0xd934('0x41')](db['FreshsalesAccount'][_0xd934('0x28')]);_0xf91c16[_0xd934('0x2c')]=_[_0xd934('0x41')](_0x57040f[_0xd934('0x2c')]);_0xf91c16[_0xd934('0x2d')]=_[_0xd934('0x2e')](_0xf91c16[_0xd934('0x2a')],_0xf91c16[_0xd934('0x2c')]);_0x4b98ba['attributes']=_[_0xd934('0x2e')](_0xf91c16['model'],qs[_0xd934('0x30')](_0x57040f[_0xd934('0x2c')]['fields']));_0x4b98ba[_0xd934('0x2f')]=_0x4b98ba['attributes']['length']?_0x4b98ba['attributes']:_0xf91c16[_0xd934('0x2a')];if(_0x57040f[_0xd934('0x2c')]['includeAll']){_0x4b98ba[_0xd934('0x3d')]=[{'all':!![]}];}_0x4b98ba=_[_0xd934('0x37')]({},_0x4b98ba,_0x57040f[_0xd934('0x3b')]);return db[_0xd934('0x27')][_0xd934('0x42')](_0x4b98ba)['then'](handleEntityNotFound(_0x416afa,null))['then'](respondWithResult(_0x416afa,null))[_0xd934('0x3f')](handleError(_0x416afa,null));};exports[_0xd934('0x43')]=function(_0x498429,_0x490953){return db[_0xd934('0x27')][_0xd934('0x43')](_0x498429[_0xd934('0x44')],{})[_0xd934('0x20')](respondWithResult(_0x490953,0xc9))[_0xd934('0x3f')](handleError(_0x490953,null));};exports[_0xd934('0x1f')]=function(_0x422692,_0x1d6780){if(_0x422692[_0xd934('0x44')]['id']){delete _0x422692[_0xd934('0x44')]['id'];}return db[_0xd934('0x27')][_0xd934('0x42')]({'where':{'id':_0x422692['params']['id']}})[_0xd934('0x20')](handleEntityNotFound(_0x1d6780,null))['then'](saveUpdates(_0x422692[_0xd934('0x44')],null))[_0xd934('0x20')](respondWithResult(_0x1d6780,null))[_0xd934('0x3f')](handleError(_0x1d6780,null));};exports[_0xd934('0x21')]=function(_0x3c3f61,_0x2bf80d){return db[_0xd934('0x27')][_0xd934('0x42')]({'where':{'id':_0x3c3f61[_0xd934('0x40')]['id']}})['then'](handleEntityNotFound(_0x2bf80d,null))['then'](removeEntity(_0x2bf80d,null))[_0xd934('0x3f')](handleError(_0x2bf80d,null));};exports['getConfigurations']=function(_0x104e05,_0x455b2b,_0x1f5311){var _0x32d263={};var _0x26777c={};var _0x16da4f;var _0x23ee20;return db[_0xd934('0x27')][_0xd934('0x45')]({'where':{'id':_0x104e05[_0xd934('0x40')]['id']}})[_0xd934('0x20')](handleEntityNotFound(_0x455b2b,null))[_0xd934('0x20')](function(_0x5aa2b6){if(_0x5aa2b6){_0x16da4f=_0x5aa2b6;_0x26777c[_0xd934('0x2a')]=_[_0xd934('0x41')](db['FreshsalesConfiguration'][_0xd934('0x28')]);_0x26777c[_0xd934('0x2c')]=_[_0xd934('0x41')](_0x104e05['query']);_0x26777c[_0xd934('0x2d')]=_[_0xd934('0x2e')](_0x26777c[_0xd934('0x2a')],_0x26777c['query']);_0x32d263[_0xd934('0x2f')]=_[_0xd934('0x2e')](_0x26777c[_0xd934('0x2a')],qs[_0xd934('0x30')](_0x104e05[_0xd934('0x2c')][_0xd934('0x30')]));_0x32d263['attributes']=_0x32d263['attributes']['length']?_0x32d263[_0xd934('0x2f')]:_0x26777c[_0xd934('0x2a')];_0x32d263[_0xd934('0x34')]=qs['sort'](_0x104e05[_0xd934('0x2c')][_0xd934('0x35')]);_0x32d263['where']=qs[_0xd934('0x2d')](_[_0xd934('0x46')](_0x104e05['query'],_0x26777c[_0xd934('0x2d')]));if(_0x104e05[_0xd934('0x2c')][_0xd934('0x3a')]){_0x32d263['where']=_[_0xd934('0x37')](_0x32d263[_0xd934('0x36')],{'$or':_[_0xd934('0x26')](_0x32d263[_0xd934('0x2f')],function(_0x49fc5c){var _0x2812a9={};_0x2812a9[_0x49fc5c]={'$like':'%'+_0x104e05[_0xd934('0x2c')][_0xd934('0x3a')]+'%'};return _0x2812a9;})});}_0x32d263=_[_0xd934('0x37')]({},_0x32d263,_0x104e05['options']);return _0x16da4f[_0xd934('0x47')](_0x32d263);}})[_0xd934('0x20')](function(_0x5a5ffb){if(_0x5a5ffb){_0x23ee20=_0x5a5ffb[_0xd934('0x31')];if(!_0x104e05[_0xd934('0x2c')]['hasOwnProperty'](_0xd934('0x48'))){_0x32d263[_0xd934('0x33')]=qs[_0xd934('0x33')](_0x104e05['query'][_0xd934('0x33')]);_0x32d263['offset']=qs[_0xd934('0x18')](_0x104e05[_0xd934('0x2c')][_0xd934('0x18')]);}return _0x16da4f[_0xd934('0x47')](_0x32d263);}})[_0xd934('0x20')](function(_0x1ef17a){if(_0x1ef17a){return _0x1ef17a?{'count':_0x23ee20,'rows':_0x1ef17a}:null;}})['then'](respondWithResult(_0x455b2b,null))[_0xd934('0x3f')](handleError(_0x455b2b,null));};exports['addConfiguration']=function(_0x3aeff3,_0x15da07,_0x45b076){if(_0x3aeff3[_0xd934('0x44')]['id']){delete _0x3aeff3[_0xd934('0x44')]['id'];}return db[_0xd934('0x27')][_0xd934('0x45')]({'where':{'id':_0x3aeff3[_0xd934('0x40')]['id']}})[_0xd934('0x20')](handleEntityNotFound(_0x15da07,null))[_0xd934('0x20')](function(_0x5658db){if(_0x5658db){_0x3aeff3[_0xd934('0x44')]['AccountId']=_0x5658db['id'];_0x3aeff3[_0xd934('0x44')]['Subjects']=integrations[_0xd934('0x49')](_0x3aeff3['body'][_0xd934('0x4a')],_0x3aeff3[_0xd934('0x44')][_0xd934('0x38')]);_0x3aeff3[_0xd934('0x44')][_0xd934('0x4b')]=integrations[_0xd934('0x4c')](_0x3aeff3[_0xd934('0x44')][_0xd934('0x4a')],_0x3aeff3['body'][_0xd934('0x38')]);return db[_0xd934('0x4d')][_0xd934('0x43')](_0x3aeff3['body'],{'include':[{'model':db[_0xd934('0x4e')],'as':'Subjects'},{'model':db[_0xd934('0x4e')],'as':_0xd934('0x4b')}]});}return null;})[_0xd934('0x20')](respondWithResult(_0x15da07,null))[_0xd934('0x3f')](handleError(_0x15da07,null));};exports['getFields']=function(_0x234ce7,_0x58345b,_0x2d0385){var _0x24a79f='';var _0x20c473='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x234ce7['params']['id']},'attributes':['id',_0xd934('0x4f'),_0xd934('0x50'),'apiKey']})[_0xd934('0x20')](handleEntityNotFound(_0x58345b,null))[_0xd934('0x20')](function(_0x47198e){if(_0x47198e){_0x20c473=_0x47198e[_0xd934('0x4f')];_0x24a79f=_0x47198e[_0xd934('0x50')];var _0x4b9e71=_0x47198e[_0xd934('0x50')][_0xd934('0x51')](-0x1);if(_0x4b9e71==='/'){_0x24a79f=_0x24a79f[_0xd934('0x52')](0x0,_0x24a79f[_0xd934('0x53')](_0x4b9e71));}return rp({'method':_0xd934('0x54'),'uri':util[_0xd934('0x55')](_0xd934('0x56'),_0x24a79f,_0xd934('0x57')),'headers':{'Authorization':_0xd934('0x58')+_0x47198e[_0xd934('0x59')]},'json':!![]});}})[_0xd934('0x20')](function(_0x593be9){if(_0x593be9){var _0xad7bd5=_0x593be9[_0xd934('0x5a')];var _0x2d25fb=![];var _0x924d8e=null;for(_0x924d8e=0x0;_0x924d8e<_0xad7bd5[_0xd934('0x31')];_0x924d8e++){if(_0xad7bd5[_0x924d8e][_0xd934('0x5b')]===_0x20c473){_0x2d25fb=!![];}}if(_0x2d25fb){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xd934('0x5c')});}}})[_0xd934('0x20')](respondWithResult(_0x58345b,null))[_0xd934('0x3f')](function(_0x4fed3a){var _0x4c166d=_0x234ce7['query'][_0xd934('0x5d')]?0x1f4:_0x4fed3a[_0xd934('0x5e')]||0x1f4;logger['error'](_0xd934('0x5f'),_0xd934('0x60'),_0x4c166d,JSON['stringify'](_0x4fed3a));delete _0x4fed3a[_0xd934('0x2b')];if(_0x4c166d===0x191){_0x4c166d=0x190;}_0x58345b[_0xd934('0x16')](_0x4c166d)[_0xd934('0x24')](_0x234ce7[_0xd934('0x2c')][_0xd934('0x5d')]?{'message':'Wrong\x20credentials','statusCode':_0x4fed3a[_0xd934('0x5e')]}:_0x4fed3a);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index a909eb2..9731f56 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0x7a54,0x106));var _0x47a5=function(_0x144bc1,_0x84f8db){_0x144bc1=_0x144bc1-0x0;var _0xc41e08=_0x7a54[_0x144bc1];return _0xc41e08;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57ca=['exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x57ca,0x108));var _0xa57c=function(_0x2dcd0d,_0x35dc92){_0x2dcd0d=_0x2dcd0d-0x0;var _0x163e2a=_0x57ca[_0x2dcd0d];return _0x163e2a;};'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'));var integrations=require(_0xa57c('0x8'));module[_0xa57c('0x9')]=function(_0x19473f,_0xbdfffb){return _0x19473f[_0xa57c('0xa')](_0xa57c('0xb'),attributes,{'tableName':_0xa57c('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 4baa8fb..d88831f 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 _0x896e=['limit','include','model','attributes','map','ShowFreshsalesAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x2bf98f,_0x80d1ae){var _0x1f7fd5=function(_0x248756){while(--_0x248756){_0x2bf98f['push'](_0x2bf98f['shift']());}};_0x1f7fd5(++_0x80d1ae);}(_0x896e,0x1e9));var _0xe896=function(_0x243c44,_0x4e7343){_0x243c44=_0x243c44-0x0;var _0x2c64a4=_0x896e[_0x243c44];return _0x2c64a4;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}exports[_0xe896('0x18')]=function(_0x32f86d){var _0x2d4cf0=this;return new Promise(function(_0x5dc89d,_0x782813){return db[_0xe896('0x19')][_0xe896('0x1a')]({'raw':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')]['where']||null:null,'attributes':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options']['attributes']||null:null,'limit':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1d')]||null:null,'include':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options'][_0xe896('0x1e')]?_['map'](_0x32f86d['options'][_0xe896('0x1e')],function(_0x41e689){return{'model':db[_0x41e689[_0xe896('0x1f')]],'as':_0x41e689['as'],'attributes':_0x41e689[_0xe896('0x20')],'include':_0x41e689[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x41e689[_0xe896('0x1e')],function(_0x4b71cc){return{'model':db[_0x4b71cc[_0xe896('0x1f')]],'as':_0x4b71cc['as'],'attributes':_0x4b71cc[_0xe896('0x20')],'include':_0x4b71cc[_0xe896('0x1e')]?_['map'](_0x4b71cc[_0xe896('0x1e')],function(_0xd50fe2){return{'model':db[_0xd50fe2[_0xe896('0x1f')]],'as':_0xd50fe2['as'],'attributes':_0xd50fe2[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe896('0xe')](function(_0x3f8ceb){logger['info'](_0xe896('0x18'),_0x32f86d);logger[_0xe896('0x10')](_0xe896('0x18'),_0x32f86d,JSON[_0xe896('0x12')](_0x3f8ceb));_0x5dc89d(_0x3f8ceb);})[_0xe896('0x17')](function(_0x5e0d9b){logger['error']('GetFreshsalesAccount',_0x5e0d9b['message'],_0x32f86d);_0x782813(_0x2d4cf0['error'](0x1f4,_0x5e0d9b[_0xe896('0x15')]));});});};exports[_0xe896('0x22')]=function(_0x10fd26){var _0x76c781=this;return new Promise(function(_0x3cd88e,_0x1a6090){return db[_0xe896('0x19')][_0xe896('0x23')]({'raw':_0x10fd26['options']?_0x10fd26['options'][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x10fd26[_0xe896('0x1b')]?_0x10fd26[_0xe896('0x1b')][_0xe896('0x24')]||null:null,'attributes':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')]['attributes']||null:null,'include':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')][_0xe896('0x1e')]?_[_0xe896('0x21')](_0x10fd26['options']['include'],function(_0x567589){return{'model':db[_0x567589[_0xe896('0x1f')]],'as':_0x567589['as'],'attributes':_0x567589[_0xe896('0x20')],'include':_0x567589[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x567589[_0xe896('0x1e')],function(_0x486eb5){return{'model':db[_0x486eb5[_0xe896('0x1f')]],'as':_0x486eb5['as'],'attributes':_0x486eb5[_0xe896('0x20')],'include':_0x486eb5[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x486eb5[_0xe896('0x1e')],function(_0x2cce09){return{'model':db[_0x2cce09[_0xe896('0x1f')]],'as':_0x2cce09['as'],'attributes':_0x2cce09[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42f3fb){logger[_0xe896('0x16')]('ShowFreshsalesAccount',_0x10fd26);logger[_0xe896('0x10')]('ShowFreshsalesAccount',_0x10fd26,JSON[_0xe896('0x12')](_0x42f3fb));_0x3cd88e(_0x42f3fb);})['catch'](function(_0x42f445){logger['error'](_0xe896('0x22'),_0x42f445[_0xe896('0x15')],_0x10fd26);_0x1a6090(_0x76c781[_0xe896('0x13')](0x1f4,_0x42f445[_0xe896('0x15')]));});});}; \ No newline at end of file +var _0x82c4=['findAll','options','raw','attributes','include','map','model','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshsalesAccount'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x82c4,0x1ca));var _0x482c=function(_0x23e346,_0x2ffc96){_0x23e346=_0x23e346-0x0;var _0x58fd5a=_0x82c4[_0x23e346];return _0x58fd5a;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rs=require(_0x482c('0x4'));var fs=require('fs');var Redis=require(_0x482c('0x5'));var db=require(_0x482c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x482c('0x7'))('rpc');var config=require(_0x482c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x482c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfdb92,_0x32a503,_0x35cdab){return new BPromise(function(_0x1c10f2,_0x3846d8){return client['request'](_0xfdb92,_0x35cdab)[_0x482c('0xa')](function(_0x135cc1){logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));logger[_0x482c('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x32a503,_0x482c('0xd'),JSON[_0x482c('0xf')](_0x135cc1));if(_0x135cc1[_0x482c('0x10')]){if(_0x135cc1['error'][_0x482c('0x11')]===0x1f4){logger[_0x482c('0x10')](_0x482c('0xc'),_0x32a503,_0x135cc1['error']['message']);return _0x3846d8(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x32a503,_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);return _0x1c10f2(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}else{logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));_0x1c10f2(_0x135cc1[_0x482c('0x13')][_0x482c('0x12')]);}})[_0x482c('0x14')](function(_0x363403){logger[_0x482c('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x32a503,_0x363403);_0x3846d8(_0x363403);});});}exports[_0x482c('0x15')]=function(_0x5b6f7e){var _0x3aed45=this;return new Promise(function(_0x258148,_0x4af05a){return db['FreshsalesAccount'][_0x482c('0x16')]({'raw':_0x5b6f7e['options']?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x18')]===undefined?!![]:![]:!![],'where':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')]['where']||null:null,'attributes':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x19')]||null:null,'limit':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')]['limit']||null:null,'include':_0x5b6f7e['options']?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x1a')]?_[_0x482c('0x1b')](_0x5b6f7e['options'][_0x482c('0x1a')],function(_0x579d2f){return{'model':db[_0x579d2f[_0x482c('0x1c')]],'as':_0x579d2f['as'],'attributes':_0x579d2f[_0x482c('0x19')],'include':_0x579d2f['include']?_[_0x482c('0x1b')](_0x579d2f['include'],function(_0x589bc6){return{'model':db[_0x589bc6[_0x482c('0x1c')]],'as':_0x589bc6['as'],'attributes':_0x589bc6[_0x482c('0x19')],'include':_0x589bc6[_0x482c('0x1a')]?_[_0x482c('0x1b')](_0x589bc6[_0x482c('0x1a')],function(_0x215826){return{'model':db[_0x215826[_0x482c('0x1c')]],'as':_0x215826['as'],'attributes':_0x215826['attributes']};}):[]};}):[]};}):[]:[]})[_0x482c('0xa')](function(_0x255417){logger['info'](_0x482c('0x15'),_0x5b6f7e);logger['debug']('GetFreshsalesAccount',_0x5b6f7e,JSON[_0x482c('0xf')](_0x255417));_0x258148(_0x255417);})['catch'](function(_0x1ac1c4){logger[_0x482c('0x10')](_0x482c('0x15'),_0x1ac1c4[_0x482c('0x12')],_0x5b6f7e);_0x4af05a(_0x3aed45[_0x482c('0x10')](0x1f4,_0x1ac1c4[_0x482c('0x12')]));});});};exports[_0x482c('0x1d')]=function(_0x3e9b22){var _0x24b4df=this;return new Promise(function(_0x2d3800,_0x3135a7){return db[_0x482c('0x1e')][_0x482c('0x1f')]({'raw':_0x3e9b22[_0x482c('0x17')]?_0x3e9b22[_0x482c('0x17')][_0x482c('0x18')]===undefined?!![]:![]:!![],'where':_0x3e9b22[_0x482c('0x17')]?_0x3e9b22[_0x482c('0x17')]['where']||null:null,'attributes':_0x3e9b22['options']?_0x3e9b22['options'][_0x482c('0x19')]||null:null,'include':_0x3e9b22[_0x482c('0x17')]?_0x3e9b22[_0x482c('0x17')][_0x482c('0x1a')]?_['map'](_0x3e9b22[_0x482c('0x17')]['include'],function(_0x31428c){return{'model':db[_0x31428c[_0x482c('0x1c')]],'as':_0x31428c['as'],'attributes':_0x31428c[_0x482c('0x19')],'include':_0x31428c[_0x482c('0x1a')]?_[_0x482c('0x1b')](_0x31428c[_0x482c('0x1a')],function(_0x129a31){return{'model':db[_0x129a31[_0x482c('0x1c')]],'as':_0x129a31['as'],'attributes':_0x129a31['attributes'],'include':_0x129a31['include']?_[_0x482c('0x1b')](_0x129a31['include'],function(_0xe62a02){return{'model':db[_0xe62a02[_0x482c('0x1c')]],'as':_0xe62a02['as'],'attributes':_0xe62a02[_0x482c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29cbaa){logger[_0x482c('0xb')](_0x482c('0x1d'),_0x3e9b22);logger[_0x482c('0xe')]('ShowFreshsalesAccount',_0x3e9b22,JSON[_0x482c('0xf')](_0x29cbaa));_0x2d3800(_0x29cbaa);})['catch'](function(_0x1de7f4){logger['error'](_0x482c('0x1d'),_0x1de7f4['message'],_0x3e9b22);_0x3135a7(_0x24b4df[_0x482c('0x10')](0x1f4,_0x1de7f4[_0x482c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 47c760b..72d46b7 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 _0xdee1=['getSubjects','get','/:id/descriptions','/:id/fields','getFields','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','isAuthenticated','show','/:id/subjects'];(function(_0x2309d7,_0x4be344){var _0x35dcf4=function(_0x3cbf9b){while(--_0x3cbf9b){_0x2309d7['push'](_0x2309d7['shift']());}};_0x35dcf4(++_0x4be344);}(_0xdee1,0x111));var _0x1dee=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xdee1[_0x2b45b5];return _0x1d9c06;};'use strict';var multer=require(_0x1dee('0x0'));var util=require(_0x1dee('0x1'));var path=require(_0x1dee('0x2'));var timeout=require(_0x1dee('0x3'));var express=require(_0x1dee('0x4'));var router=express[_0x1dee('0x5')]();var fs_extra=require(_0x1dee('0x6'));var auth=require(_0x1dee('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1dee('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1dee('0x9')]);router['get']('/:id',auth[_0x1dee('0xa')](),controller[_0x1dee('0xb')]);router['get'](_0x1dee('0xc'),auth[_0x1dee('0xa')](),controller[_0x1dee('0xd')]);router[_0x1dee('0xe')](_0x1dee('0xf'),auth[_0x1dee('0xa')](),controller['getDescriptions']);router[_0x1dee('0xe')](_0x1dee('0x10'),auth[_0x1dee('0xa')](),controller[_0x1dee('0x11')]);router[_0x1dee('0x12')]('/',auth[_0x1dee('0xa')](),controller[_0x1dee('0x13')]);router[_0x1dee('0x14')](_0x1dee('0x15'),auth[_0x1dee('0xa')](),controller[_0x1dee('0x16')]);router[_0x1dee('0x17')](_0x1dee('0x15'),auth[_0x1dee('0xa')](),controller[_0x1dee('0x18')]);module[_0x1dee('0x19')]=router; \ No newline at end of file +var _0x5a07=['destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','put','update'];(function(_0x15f5ce,_0x2dc292){var _0x52ded1=function(_0x14d820){while(--_0x14d820){_0x15f5ce['push'](_0x15f5ce['shift']());}};_0x52ded1(++_0x2dc292);}(_0x5a07,0x1e5));var _0x75a0=function(_0x1284b4,_0x545b72){_0x1284b4=_0x1284b4-0x0;var _0x465573=_0x5a07[_0x1284b4];return _0x465573;};'use strict';var multer=require(_0x75a0('0x0'));var util=require(_0x75a0('0x1'));var path=require(_0x75a0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x75a0('0x3')]();var fs_extra=require(_0x75a0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75a0('0x5'));var config=require(_0x75a0('0x6'));var controller=require(_0x75a0('0x7'));router[_0x75a0('0x8')]('/',auth[_0x75a0('0x9')](),controller[_0x75a0('0xa')]);router[_0x75a0('0x8')](_0x75a0('0xb'),auth[_0x75a0('0x9')](),controller[_0x75a0('0xc')]);router[_0x75a0('0x8')](_0x75a0('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x75a0('0xe'),auth[_0x75a0('0x9')](),controller[_0x75a0('0xf')]);router[_0x75a0('0x8')](_0x75a0('0x10'),auth[_0x75a0('0x9')](),controller['getFields']);router[_0x75a0('0x11')]('/',auth['isAuthenticated'](),controller[_0x75a0('0x12')]);router[_0x75a0('0x13')](_0x75a0('0xb'),auth[_0x75a0('0x9')](),controller[_0x75a0('0x14')]);router['delete'](_0x75a0('0xb'),auth[_0x75a0('0x9')](),controller[_0x75a0('0x15')]);module[_0x75a0('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 89987f7..ca36385 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 _0x7e23=['STRING'];(function(_0x3b5142,_0x3fa46c){var _0x154b18=function(_0x139bed){while(--_0x139bed){_0x3b5142['push'](_0x3b5142['shift']());}};_0x154b18(++_0x3fa46c);}(_0x7e23,0x1d5));var _0x37e2=function(_0x23fb96,_0x1153d3){_0x23fb96=_0x23fb96-0x0;var _0x4241d9=_0x7e23[_0x23fb96];return _0x4241d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x37e2('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2c5d=['exports','STRING','sequelize'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0x2c5d,0x1d6));var _0xd2c5=function(_0x1b3541,_0x456306){_0x1b3541=_0x1b3541-0x0;var _0x3ec0be=_0x2c5d[_0x1b3541];return _0x3ec0be;};'use strict';var Sequelize=require(_0xd2c5('0x0'));module[_0xd2c5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd2c5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index bed6b4d..7a86299 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 _0x4c95=['error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','sort','where','merge','filter','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','getSubjects','findOne','FreshsalesField','order','pick','hasOwnProperty','nolimit','getDescriptions','options','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','then'];(function(_0x35df25,_0x3689a3){var _0x2a30c1=function(_0x5e1462){while(--_0x5e1462){_0x35df25['push'](_0x35df25['shift']());}};_0x2a30c1(++_0x3689a3);}(_0x4c95,0x80));var _0x54c9=function(_0x39ad89,_0x1ecd5a){_0x39ad89=_0x39ad89-0x0;var _0x2338d8=_0x4c95[_0x39ad89];return _0x2338d8;};'use strict';var emlformat=require(_0x54c9('0x0'));var rimraf=require(_0x54c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54c9('0x2'));var rp=require(_0x54c9('0x3'));var moment=require(_0x54c9('0x4'));var BPromise=require(_0x54c9('0x5'));var Mustache=require(_0x54c9('0x6'));var util=require(_0x54c9('0x7'));var path=require(_0x54c9('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x54c9('0x9'));var fs=require('fs');var fs_extra=require(_0x54c9('0xa'));var _=require(_0x54c9('0xb'));var squel=require(_0x54c9('0xc'));var crypto=require(_0x54c9('0xd'));var jsforce=require(_0x54c9('0xe'));var deskjs=require(_0x54c9('0xf'));var toCsv=require(_0x54c9('0x10'));var querystring=require(_0x54c9('0x11'));var Papa=require(_0x54c9('0x12'));var Redis=require(_0x54c9('0x13'));var authService=require(_0x54c9('0x14'));var qs=require(_0x54c9('0x15'));var as=require(_0x54c9('0x16'));var hardwareService=require(_0x54c9('0x17'));var logger=require(_0x54c9('0x18'))('api');var utils=require(_0x54c9('0x19'));var config=require(_0x54c9('0x1a'));var licenseUtil=require(_0x54c9('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5963d5,_0x5cc414){_0x5cc414=_0x5cc414||0xcc;return function(_0x51e4e0){if(_0x51e4e0){return _0x5963d5[_0x54c9('0x1c')](_0x5cc414);}return _0x5963d5[_0x54c9('0x1d')](_0x5cc414)[_0x54c9('0x1e')]();};}function respondWithResult(_0x58c67e,_0x2daeb7){_0x2daeb7=_0x2daeb7||0xc8;return function(_0x23a79f){if(_0x23a79f){return _0x58c67e[_0x54c9('0x1d')](_0x2daeb7)[_0x54c9('0x1f')](_0x23a79f);}};}function respondWithFilteredResult(_0x10a535,_0xc1ee2a){return function(_0xa5810c){if(_0xa5810c){var _0x4d1e4f=typeof _0xc1ee2a[_0x54c9('0x20')]==='undefined'&&typeof _0xc1ee2a[_0x54c9('0x21')]===_0x54c9('0x22');var _0x3c358c=_0xa5810c[_0x54c9('0x23')];var _0x485403=_0x4d1e4f?0x0:_0xc1ee2a['offset'];var _0x3fabfa=_0x4d1e4f?_0xa5810c[_0x54c9('0x23')]:_0xc1ee2a[_0x54c9('0x20')]+_0xc1ee2a['limit'];var _0x403e09;if(_0x3fabfa>=_0x3c358c){_0x3fabfa=_0x3c358c;_0x403e09=0xc8;}else{_0x403e09=0xce;}_0x10a535[_0x54c9('0x1d')](_0x403e09);return _0x10a535[_0x54c9('0x24')]('Content-Range',_0x485403+'-'+_0x3fabfa+'/'+_0x3c358c)['json'](_0xa5810c);}return null;};}function patchUpdates(_0x5cfbc5){return function(_0x1a8c08){try{jsonpatch['apply'](_0x1a8c08,_0x5cfbc5,!![]);}catch(_0x2e2689){return BPromise[_0x54c9('0x25')](_0x2e2689);}return _0x1a8c08[_0x54c9('0x26')]();};}function saveUpdates(_0x300164,_0x1e1903){return function(_0x130ac0){if(_0x130ac0){return _0x130ac0[_0x54c9('0x27')](_0x300164)['then'](function(_0x168791){return _0x168791;});}return null;};}function removeEntity(_0x23e9f2,_0x499cc8){return function(_0x26b06f){if(_0x26b06f){return _0x26b06f[_0x54c9('0x28')]()[_0x54c9('0x29')](function(){_0x23e9f2[_0x54c9('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fd123,_0x37e6a2){return function(_0x360563){if(!_0x360563){_0x4fd123[_0x54c9('0x1c')](0x194);}return _0x360563;};}function handleError(_0x15d59a,_0x125f06){_0x125f06=_0x125f06||0x1f4;return function(_0x1c840d){logger[_0x54c9('0x2a')](_0x1c840d[_0x54c9('0x2b')]);if(_0x1c840d[_0x54c9('0x2c')]){delete _0x1c840d[_0x54c9('0x2c')];}_0x15d59a['status'](_0x125f06)[_0x54c9('0x2d')](_0x1c840d);};}exports[_0x54c9('0x2e')]=function(_0x39cb5a,_0x111f3f){var _0x2fb8aa={},_0x10ecd8={},_0x117d4a={'count':0x0,'rows':[]};var _0x4f8c7c=_[_0x54c9('0x2f')](db[_0x54c9('0x30')][_0x54c9('0x31')],function(_0x426da7){return{'name':_0x426da7[_0x54c9('0x32')],'type':_0x426da7[_0x54c9('0x33')][_0x54c9('0x34')]};});_0x10ecd8[_0x54c9('0x35')]=_[_0x54c9('0x2f')](_0x4f8c7c,_0x54c9('0x2c'));_0x10ecd8[_0x54c9('0x36')]=_[_0x54c9('0x37')](_0x39cb5a[_0x54c9('0x36')]);_0x10ecd8[_0x54c9('0x38')]=_[_0x54c9('0x39')](_0x10ecd8[_0x54c9('0x35')],_0x10ecd8[_0x54c9('0x36')]);_0x2fb8aa[_0x54c9('0x3a')]=_[_0x54c9('0x39')](_0x10ecd8['model'],qs['fields'](_0x39cb5a['query'][_0x54c9('0x3b')]));_0x2fb8aa[_0x54c9('0x3a')]=_0x2fb8aa[_0x54c9('0x3a')]['length']?_0x2fb8aa['attributes']:_0x10ecd8[_0x54c9('0x35')];if(!_0x39cb5a[_0x54c9('0x36')]['hasOwnProperty']('nolimit')){_0x2fb8aa['limit']=qs[_0x54c9('0x21')](_0x39cb5a[_0x54c9('0x36')]['limit']);_0x2fb8aa[_0x54c9('0x20')]=qs[_0x54c9('0x20')](_0x39cb5a[_0x54c9('0x36')][_0x54c9('0x20')]);}_0x2fb8aa['order']=qs['sort'](_0x39cb5a[_0x54c9('0x36')][_0x54c9('0x3c')]);_0x2fb8aa[_0x54c9('0x3d')]=qs[_0x54c9('0x38')](_['pick'](_0x39cb5a[_0x54c9('0x36')],_0x10ecd8[_0x54c9('0x38')]),_0x4f8c7c);if(_0x39cb5a['query']['filter']){_0x2fb8aa[_0x54c9('0x3d')]=_[_0x54c9('0x3e')](_0x2fb8aa['where'],{'$or':_['map'](_0x4f8c7c,function(_0x4a9236){if(_0x4a9236[_0x54c9('0x33')]!=='VIRTUAL'){var _0x4b6323={};_0x4b6323[_0x4a9236[_0x54c9('0x2c')]]={'$like':'%'+_0x39cb5a[_0x54c9('0x36')][_0x54c9('0x3f')]+'%'};return _0x4b6323;}})});}_0x2fb8aa=_[_0x54c9('0x3e')]({},_0x2fb8aa,_0x39cb5a['options']);var _0x14a230={'where':_0x2fb8aa[_0x54c9('0x3d')]};return db[_0x54c9('0x30')][_0x54c9('0x23')](_0x14a230)[_0x54c9('0x29')](function(_0x104d30){_0x117d4a[_0x54c9('0x23')]=_0x104d30;if(_0x39cb5a[_0x54c9('0x36')]['includeAll']){_0x2fb8aa[_0x54c9('0x40')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x54c9('0x41')](_0x2fb8aa);})[_0x54c9('0x29')](function(_0x529b93){_0x117d4a[_0x54c9('0x42')]=_0x529b93;return _0x117d4a;})['then'](respondWithFilteredResult(_0x111f3f,_0x2fb8aa))[_0x54c9('0x43')](handleError(_0x111f3f,null));};exports[_0x54c9('0x44')]=function(_0x51b8de,_0x361361){var _0x50296d={'raw':![],'where':{'id':_0x51b8de[_0x54c9('0x45')]['id']}},_0xa6bc6a={};_0xa6bc6a[_0x54c9('0x35')]=_['keys'](db['FreshsalesConfiguration'][_0x54c9('0x31')]);_0xa6bc6a['query']=_['keys'](_0x51b8de[_0x54c9('0x36')]);_0xa6bc6a[_0x54c9('0x38')]=_[_0x54c9('0x39')](_0xa6bc6a['model'],_0xa6bc6a[_0x54c9('0x36')]);_0x50296d[_0x54c9('0x3a')]=_[_0x54c9('0x39')](_0xa6bc6a[_0x54c9('0x35')],qs[_0x54c9('0x3b')](_0x51b8de[_0x54c9('0x36')][_0x54c9('0x3b')]));_0x50296d['attributes']=_0x50296d['attributes'][_0x54c9('0x46')]?_0x50296d[_0x54c9('0x3a')]:_0xa6bc6a[_0x54c9('0x35')];if(_0x51b8de['query'][_0x54c9('0x47')]){_0x50296d[_0x54c9('0x40')]=[{'all':!![]}];}_0x50296d=_['merge']({},_0x50296d,_0x51b8de['options']);return db[_0x54c9('0x30')]['find'](_0x50296d)[_0x54c9('0x29')](handleEntityNotFound(_0x361361,null))[_0x54c9('0x29')](respondWithResult(_0x361361,null))[_0x54c9('0x43')](handleError(_0x361361,null));};exports[_0x54c9('0x48')]=function(_0x220ed2,_0x426034){return db[_0x54c9('0x30')][_0x54c9('0x48')](_0x220ed2['body'],{})[_0x54c9('0x29')](respondWithResult(_0x426034,0xc9))[_0x54c9('0x43')](handleError(_0x426034,null));};exports['update']=function(_0x4fd80f,_0x21cd63){if(_0x4fd80f['body']['id']){delete _0x4fd80f[_0x54c9('0x49')]['id'];}return db[_0x54c9('0x30')][_0x54c9('0x4a')]({'where':{'id':_0x4fd80f[_0x54c9('0x45')]['id']}})[_0x54c9('0x29')](handleEntityNotFound(_0x21cd63,null))[_0x54c9('0x29')](saveUpdates(_0x4fd80f[_0x54c9('0x49')],null))['then'](respondWithResult(_0x21cd63,null))['catch'](handleError(_0x21cd63,null));};exports[_0x54c9('0x28')]=function(_0x5bbba7,_0x39ea1b){return db[_0x54c9('0x30')]['find']({'where':{'id':_0x5bbba7['params']['id']}})[_0x54c9('0x29')](handleEntityNotFound(_0x39ea1b,null))['then'](removeEntity(_0x39ea1b,null))[_0x54c9('0x43')](handleError(_0x39ea1b,null));};exports[_0x54c9('0x4b')]=function(_0x40d566,_0x2a52f4,_0x51017a){var _0x421dea={};var _0x582ec0={};var _0x523128;var _0xe7eed;return db[_0x54c9('0x30')][_0x54c9('0x4c')]({'where':{'id':_0x40d566[_0x54c9('0x45')]['id']}})[_0x54c9('0x29')](handleEntityNotFound(_0x2a52f4,null))[_0x54c9('0x29')](function(_0x5a2b9b){if(_0x5a2b9b){_0x523128=_0x5a2b9b;_0x582ec0['model']=_['keys'](db[_0x54c9('0x4d')]['rawAttributes']);_0x582ec0['query']=_['keys'](_0x40d566[_0x54c9('0x36')]);_0x582ec0['filters']=_[_0x54c9('0x39')](_0x582ec0[_0x54c9('0x35')],_0x582ec0[_0x54c9('0x36')]);_0x421dea[_0x54c9('0x3a')]=_[_0x54c9('0x39')](_0x582ec0['model'],qs[_0x54c9('0x3b')](_0x40d566[_0x54c9('0x36')][_0x54c9('0x3b')]));_0x421dea['attributes']=_0x421dea[_0x54c9('0x3a')][_0x54c9('0x46')]?_0x421dea[_0x54c9('0x3a')]:_0x582ec0[_0x54c9('0x35')];_0x421dea[_0x54c9('0x4e')]=qs[_0x54c9('0x3c')](_0x40d566[_0x54c9('0x36')][_0x54c9('0x3c')]);_0x421dea[_0x54c9('0x3d')]=qs[_0x54c9('0x38')](_[_0x54c9('0x4f')](_0x40d566[_0x54c9('0x36')],_0x582ec0[_0x54c9('0x38')]));if(_0x40d566['query']['filter']){_0x421dea[_0x54c9('0x3d')]=_['merge'](_0x421dea[_0x54c9('0x3d')],{'$or':_[_0x54c9('0x2f')](_0x421dea[_0x54c9('0x3a')],function(_0x3dd7a7){var _0x303e75={};_0x303e75[_0x3dd7a7]={'$like':'%'+_0x40d566[_0x54c9('0x36')][_0x54c9('0x3f')]+'%'};return _0x303e75;})});}_0x421dea=_[_0x54c9('0x3e')]({},_0x421dea,_0x40d566['options']);return _0x523128[_0x54c9('0x4b')](_0x421dea);}})[_0x54c9('0x29')](function(_0x43c218){if(_0x43c218){_0xe7eed=_0x43c218[_0x54c9('0x46')];if(!_0x40d566[_0x54c9('0x36')][_0x54c9('0x50')](_0x54c9('0x51'))){_0x421dea[_0x54c9('0x21')]=qs[_0x54c9('0x21')](_0x40d566[_0x54c9('0x36')]['limit']);_0x421dea[_0x54c9('0x20')]=qs[_0x54c9('0x20')](_0x40d566[_0x54c9('0x36')]['offset']);}return _0x523128['getSubjects'](_0x421dea);}})['then'](function(_0x3eea75){if(_0x3eea75){return _0x3eea75?{'count':_0xe7eed,'rows':_0x3eea75}:null;}})['then'](respondWithResult(_0x2a52f4,null))[_0x54c9('0x43')](handleError(_0x2a52f4,null));};exports[_0x54c9('0x52')]=function(_0x13becf,_0x185462,_0x2d61b3){var _0x57c32d={};var _0x585029={};var _0x1788ba;var _0x5b2651;return db[_0x54c9('0x30')][_0x54c9('0x4c')]({'where':{'id':_0x13becf[_0x54c9('0x45')]['id']}})[_0x54c9('0x29')](handleEntityNotFound(_0x185462,null))[_0x54c9('0x29')](function(_0x3956ba){if(_0x3956ba){_0x1788ba=_0x3956ba;_0x585029[_0x54c9('0x35')]=_['keys'](db['FreshsalesField'][_0x54c9('0x31')]);_0x585029['query']=_[_0x54c9('0x37')](_0x13becf[_0x54c9('0x36')]);_0x585029[_0x54c9('0x38')]=_[_0x54c9('0x39')](_0x585029[_0x54c9('0x35')],_0x585029['query']);_0x57c32d[_0x54c9('0x3a')]=_['intersection'](_0x585029[_0x54c9('0x35')],qs[_0x54c9('0x3b')](_0x13becf['query'][_0x54c9('0x3b')]));_0x57c32d['attributes']=_0x57c32d[_0x54c9('0x3a')][_0x54c9('0x46')]?_0x57c32d[_0x54c9('0x3a')]:_0x585029[_0x54c9('0x35')];_0x57c32d[_0x54c9('0x4e')]=qs['sort'](_0x13becf[_0x54c9('0x36')][_0x54c9('0x3c')]);_0x57c32d['where']=qs[_0x54c9('0x38')](_['pick'](_0x13becf[_0x54c9('0x36')],_0x585029['filters']));if(_0x13becf['query'][_0x54c9('0x3f')]){_0x57c32d['where']=_[_0x54c9('0x3e')](_0x57c32d[_0x54c9('0x3d')],{'$or':_['map'](_0x57c32d[_0x54c9('0x3a')],function(_0x3d511b){var _0x53ea01={};_0x53ea01[_0x3d511b]={'$like':'%'+_0x13becf['query'][_0x54c9('0x3f')]+'%'};return _0x53ea01;})});}_0x57c32d=_[_0x54c9('0x3e')]({},_0x57c32d,_0x13becf[_0x54c9('0x53')]);return _0x1788ba['getDescriptions'](_0x57c32d);}})[_0x54c9('0x29')](function(_0xa27a6d){if(_0xa27a6d){_0x5b2651=_0xa27a6d[_0x54c9('0x46')];if(!_0x13becf['query']['hasOwnProperty']('nolimit')){_0x57c32d[_0x54c9('0x21')]=qs[_0x54c9('0x21')](_0x13becf[_0x54c9('0x36')][_0x54c9('0x21')]);_0x57c32d[_0x54c9('0x20')]=qs[_0x54c9('0x20')](_0x13becf[_0x54c9('0x36')]['offset']);}return _0x1788ba['getDescriptions'](_0x57c32d);}})[_0x54c9('0x29')](function(_0x789a84){if(_0x789a84){return _0x789a84?{'count':_0x5b2651,'rows':_0x789a84}:null;}})[_0x54c9('0x29')](respondWithResult(_0x185462,null))[_0x54c9('0x43')](handleError(_0x185462,null));};exports['getFields']=function(_0x38ceb0,_0xec12e2,_0x38e914){var _0x3a8d09={};var _0x2f4653={};var _0x481eca;var _0x2091d4;return db[_0x54c9('0x30')][_0x54c9('0x4c')]({'where':{'id':_0x38ceb0['params']['id']}})[_0x54c9('0x29')](handleEntityNotFound(_0xec12e2,null))[_0x54c9('0x29')](function(_0x2b7a42){if(_0x2b7a42){_0x481eca=_0x2b7a42;_0x2f4653['model']=_[_0x54c9('0x37')](db[_0x54c9('0x4d')][_0x54c9('0x31')]);_0x2f4653[_0x54c9('0x36')]=_[_0x54c9('0x37')](_0x38ceb0[_0x54c9('0x36')]);_0x2f4653[_0x54c9('0x38')]=_[_0x54c9('0x39')](_0x2f4653[_0x54c9('0x35')],_0x2f4653[_0x54c9('0x36')]);_0x3a8d09[_0x54c9('0x3a')]=_[_0x54c9('0x39')](_0x2f4653[_0x54c9('0x35')],qs[_0x54c9('0x3b')](_0x38ceb0[_0x54c9('0x36')]['fields']));_0x3a8d09['attributes']=_0x3a8d09[_0x54c9('0x3a')]['length']?_0x3a8d09[_0x54c9('0x3a')]:_0x2f4653[_0x54c9('0x35')];_0x3a8d09[_0x54c9('0x4e')]=qs[_0x54c9('0x3c')](_0x38ceb0['query'][_0x54c9('0x3c')]);_0x3a8d09[_0x54c9('0x3d')]=qs[_0x54c9('0x38')](_[_0x54c9('0x4f')](_0x38ceb0[_0x54c9('0x36')],_0x2f4653[_0x54c9('0x38')]));if(_0x38ceb0[_0x54c9('0x36')][_0x54c9('0x3f')]){_0x3a8d09[_0x54c9('0x3d')]=_[_0x54c9('0x3e')](_0x3a8d09[_0x54c9('0x3d')],{'$or':_[_0x54c9('0x2f')](_0x3a8d09[_0x54c9('0x3a')],function(_0x45e5d4){var _0x3b3fde={};_0x3b3fde[_0x45e5d4]={'$like':'%'+_0x38ceb0['query'][_0x54c9('0x3f')]+'%'};return _0x3b3fde;})});}_0x3a8d09=_[_0x54c9('0x3e')]({},_0x3a8d09,_0x38ceb0['options']);return _0x481eca[_0x54c9('0x54')](_0x3a8d09);}})['then'](function(_0x474542){if(_0x474542){_0x2091d4=_0x474542['length'];if(!_0x38ceb0[_0x54c9('0x36')][_0x54c9('0x50')](_0x54c9('0x51'))){_0x3a8d09[_0x54c9('0x21')]=qs[_0x54c9('0x21')](_0x38ceb0['query']['limit']);_0x3a8d09[_0x54c9('0x20')]=qs[_0x54c9('0x20')](_0x38ceb0[_0x54c9('0x36')][_0x54c9('0x20')]);}return _0x481eca[_0x54c9('0x54')](_0x3a8d09);}})[_0x54c9('0x29')](function(_0x233005){if(_0x233005){return _0x233005?{'count':_0x2091d4,'rows':_0x233005}:null;}})['then'](respondWithResult(_0xec12e2,null))[_0x54c9('0x43')](handleError(_0xec12e2,null));}; \ No newline at end of file +var _0xbfb3=['request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../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','stack','name','send','map','FreshsalesConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','include','findAll','rows','catch','length','includeAll','options','create','body','params','find','getSubjects','findOne','FreshsalesField','pick','nolimit','getDescriptions','getFields','eml-format','rimraf','zip-dir'];(function(_0x39183d,_0x51345b){var _0x1d83ab=function(_0x30f0d7){while(--_0x30f0d7){_0x39183d['push'](_0x39183d['shift']());}};_0x1d83ab(++_0x51345b);}(_0xbfb3,0xe1));var _0x3bfb=function(_0x558392,_0x16a10b){_0x558392=_0x558392-0x0;var _0xad96d4=_0xbfb3[_0x558392];return _0xad96d4;};'use strict';var emlformat=require(_0x3bfb('0x0'));var rimraf=require(_0x3bfb('0x1'));var zipdir=require(_0x3bfb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3bfb('0x3'));var moment=require('moment');var BPromise=require(_0x3bfb('0x4'));var Mustache=require(_0x3bfb('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3bfb('0x6'));var csv=require(_0x3bfb('0x7'));var ejs=require(_0x3bfb('0x8'));var fs=require('fs');var fs_extra=require(_0x3bfb('0x9'));var _=require('lodash');var squel=require(_0x3bfb('0xa'));var crypto=require(_0x3bfb('0xb'));var jsforce=require(_0x3bfb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3bfb('0x7'));var querystring=require('querystring');var Papa=require(_0x3bfb('0xd'));var Redis=require(_0x3bfb('0xe'));var authService=require(_0x3bfb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3bfb('0x10'));var hardwareService=require(_0x3bfb('0x11'));var logger=require(_0x3bfb('0x12'))(_0x3bfb('0x13'));var utils=require(_0x3bfb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bfb('0x15'));var db=require(_0x3bfb('0x16'))['db'];function respondWithStatusCode(_0xa39b94,_0x3a5ddd){_0x3a5ddd=_0x3a5ddd||0xcc;return function(_0x284af6){if(_0x284af6){return _0xa39b94['sendStatus'](_0x3a5ddd);}return _0xa39b94['status'](_0x3a5ddd)[_0x3bfb('0x17')]();};}function respondWithResult(_0x2e34c9,_0x4ee9ed){_0x4ee9ed=_0x4ee9ed||0xc8;return function(_0x202b5f){if(_0x202b5f){return _0x2e34c9[_0x3bfb('0x18')](_0x4ee9ed)[_0x3bfb('0x19')](_0x202b5f);}};}function respondWithFilteredResult(_0x54ea43,_0xe60748){return function(_0x4483c4){if(_0x4483c4){var _0x347733=typeof _0xe60748[_0x3bfb('0x1a')]===_0x3bfb('0x1b')&&typeof _0xe60748[_0x3bfb('0x1c')]===_0x3bfb('0x1b');var _0xadabea=_0x4483c4[_0x3bfb('0x1d')];var _0x2316f4=_0x347733?0x0:_0xe60748[_0x3bfb('0x1a')];var _0x3c74eb=_0x347733?_0x4483c4[_0x3bfb('0x1d')]:_0xe60748[_0x3bfb('0x1a')]+_0xe60748[_0x3bfb('0x1c')];var _0x44a1b8;if(_0x3c74eb>=_0xadabea){_0x3c74eb=_0xadabea;_0x44a1b8=0xc8;}else{_0x44a1b8=0xce;}_0x54ea43[_0x3bfb('0x18')](_0x44a1b8);return _0x54ea43[_0x3bfb('0x1e')]('Content-Range',_0x2316f4+'-'+_0x3c74eb+'/'+_0xadabea)['json'](_0x4483c4);}return null;};}function patchUpdates(_0x23ca80){return function(_0x6d634e){try{jsonpatch[_0x3bfb('0x1f')](_0x6d634e,_0x23ca80,!![]);}catch(_0x25b2ea){return BPromise[_0x3bfb('0x20')](_0x25b2ea);}return _0x6d634e[_0x3bfb('0x21')]();};}function saveUpdates(_0x410484,_0x755890){return function(_0x3fd293){if(_0x3fd293){return _0x3fd293[_0x3bfb('0x22')](_0x410484)['then'](function(_0x2c6110){return _0x2c6110;});}return null;};}function removeEntity(_0x3e8b2a,_0x14c2ac){return function(_0x5c49bd){if(_0x5c49bd){return _0x5c49bd[_0x3bfb('0x23')]()[_0x3bfb('0x24')](function(){_0x3e8b2a['status'](0xcc)[_0x3bfb('0x17')]();});}};}function handleEntityNotFound(_0x7f622c,_0x50964c){return function(_0x1bafa9){if(!_0x1bafa9){_0x7f622c[_0x3bfb('0x25')](0x194);}return _0x1bafa9;};}function handleError(_0x434803,_0x540048){_0x540048=_0x540048||0x1f4;return function(_0x35d738){logger['error'](_0x35d738[_0x3bfb('0x26')]);if(_0x35d738[_0x3bfb('0x27')]){delete _0x35d738['name'];}_0x434803['status'](_0x540048)[_0x3bfb('0x28')](_0x35d738);};}exports['index']=function(_0x5223dd,_0xc31375){var _0x54fb68={},_0xfda4d9={},_0x5a885a={'count':0x0,'rows':[]};var _0x5df705=_[_0x3bfb('0x29')](db[_0x3bfb('0x2a')][_0x3bfb('0x2b')],function(_0x4750f7){return{'name':_0x4750f7['fieldName'],'type':_0x4750f7[_0x3bfb('0x2c')]['key']};});_0xfda4d9[_0x3bfb('0x2d')]=_[_0x3bfb('0x29')](_0x5df705,'name');_0xfda4d9[_0x3bfb('0x2e')]=_[_0x3bfb('0x2f')](_0x5223dd[_0x3bfb('0x2e')]);_0xfda4d9[_0x3bfb('0x30')]=_[_0x3bfb('0x31')](_0xfda4d9[_0x3bfb('0x2d')],_0xfda4d9[_0x3bfb('0x2e')]);_0x54fb68[_0x3bfb('0x32')]=_['intersection'](_0xfda4d9[_0x3bfb('0x2d')],qs[_0x3bfb('0x33')](_0x5223dd['query'][_0x3bfb('0x33')]));_0x54fb68[_0x3bfb('0x32')]=_0x54fb68['attributes']['length']?_0x54fb68[_0x3bfb('0x32')]:_0xfda4d9['model'];if(!_0x5223dd['query'][_0x3bfb('0x34')]('nolimit')){_0x54fb68[_0x3bfb('0x1c')]=qs['limit'](_0x5223dd[_0x3bfb('0x2e')][_0x3bfb('0x1c')]);_0x54fb68[_0x3bfb('0x1a')]=qs[_0x3bfb('0x1a')](_0x5223dd[_0x3bfb('0x2e')]['offset']);}_0x54fb68[_0x3bfb('0x35')]=qs[_0x3bfb('0x36')](_0x5223dd['query'][_0x3bfb('0x36')]);_0x54fb68[_0x3bfb('0x37')]=qs[_0x3bfb('0x30')](_['pick'](_0x5223dd[_0x3bfb('0x2e')],_0xfda4d9[_0x3bfb('0x30')]),_0x5df705);if(_0x5223dd['query'][_0x3bfb('0x38')]){_0x54fb68[_0x3bfb('0x37')]=_[_0x3bfb('0x39')](_0x54fb68[_0x3bfb('0x37')],{'$or':_[_0x3bfb('0x29')](_0x5df705,function(_0x2b57f3){if(_0x2b57f3[_0x3bfb('0x2c')]!=='VIRTUAL'){var _0x428af3={};_0x428af3[_0x2b57f3[_0x3bfb('0x27')]]={'$like':'%'+_0x5223dd[_0x3bfb('0x2e')]['filter']+'%'};return _0x428af3;}})});}_0x54fb68=_[_0x3bfb('0x39')]({},_0x54fb68,_0x5223dd['options']);var _0x473ffa={'where':_0x54fb68[_0x3bfb('0x37')]};return db[_0x3bfb('0x2a')][_0x3bfb('0x1d')](_0x473ffa)['then'](function(_0x44db9d){_0x5a885a[_0x3bfb('0x1d')]=_0x44db9d;if(_0x5223dd[_0x3bfb('0x2e')]['includeAll']){_0x54fb68[_0x3bfb('0x3a')]=[{'all':!![]}];}return db[_0x3bfb('0x2a')][_0x3bfb('0x3b')](_0x54fb68);})['then'](function(_0x819625){_0x5a885a[_0x3bfb('0x3c')]=_0x819625;return _0x5a885a;})[_0x3bfb('0x24')](respondWithFilteredResult(_0xc31375,_0x54fb68))[_0x3bfb('0x3d')](handleError(_0xc31375,null));};exports['show']=function(_0x54b9cf,_0x345402){var _0x2db7b0={'raw':![],'where':{'id':_0x54b9cf['params']['id']}},_0x37fd7f={};_0x37fd7f['model']=_[_0x3bfb('0x2f')](db[_0x3bfb('0x2a')][_0x3bfb('0x2b')]);_0x37fd7f[_0x3bfb('0x2e')]=_[_0x3bfb('0x2f')](_0x54b9cf[_0x3bfb('0x2e')]);_0x37fd7f['filters']=_[_0x3bfb('0x31')](_0x37fd7f[_0x3bfb('0x2d')],_0x37fd7f[_0x3bfb('0x2e')]);_0x2db7b0[_0x3bfb('0x32')]=_[_0x3bfb('0x31')](_0x37fd7f['model'],qs['fields'](_0x54b9cf[_0x3bfb('0x2e')]['fields']));_0x2db7b0['attributes']=_0x2db7b0[_0x3bfb('0x32')][_0x3bfb('0x3e')]?_0x2db7b0['attributes']:_0x37fd7f[_0x3bfb('0x2d')];if(_0x54b9cf[_0x3bfb('0x2e')][_0x3bfb('0x3f')]){_0x2db7b0[_0x3bfb('0x3a')]=[{'all':!![]}];}_0x2db7b0=_['merge']({},_0x2db7b0,_0x54b9cf[_0x3bfb('0x40')]);return db[_0x3bfb('0x2a')]['find'](_0x2db7b0)['then'](handleEntityNotFound(_0x345402,null))[_0x3bfb('0x24')](respondWithResult(_0x345402,null))[_0x3bfb('0x3d')](handleError(_0x345402,null));};exports[_0x3bfb('0x41')]=function(_0x16f594,_0x53927f){return db[_0x3bfb('0x2a')][_0x3bfb('0x41')](_0x16f594[_0x3bfb('0x42')],{})[_0x3bfb('0x24')](respondWithResult(_0x53927f,0xc9))[_0x3bfb('0x3d')](handleError(_0x53927f,null));};exports[_0x3bfb('0x22')]=function(_0x55a3ca,_0x5b9ddc){if(_0x55a3ca[_0x3bfb('0x42')]['id']){delete _0x55a3ca[_0x3bfb('0x42')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x55a3ca[_0x3bfb('0x43')]['id']}})['then'](handleEntityNotFound(_0x5b9ddc,null))[_0x3bfb('0x24')](saveUpdates(_0x55a3ca['body'],null))[_0x3bfb('0x24')](respondWithResult(_0x5b9ddc,null))[_0x3bfb('0x3d')](handleError(_0x5b9ddc,null));};exports[_0x3bfb('0x23')]=function(_0x4d2b83,_0x2cad2a){return db['FreshsalesConfiguration'][_0x3bfb('0x44')]({'where':{'id':_0x4d2b83[_0x3bfb('0x43')]['id']}})[_0x3bfb('0x24')](handleEntityNotFound(_0x2cad2a,null))[_0x3bfb('0x24')](removeEntity(_0x2cad2a,null))[_0x3bfb('0x3d')](handleError(_0x2cad2a,null));};exports[_0x3bfb('0x45')]=function(_0x58cbfd,_0x4897ca,_0x1b7184){var _0x2f6997={};var _0x122949={};var _0x2b1aaa;var _0x28d3db;return db[_0x3bfb('0x2a')][_0x3bfb('0x46')]({'where':{'id':_0x58cbfd[_0x3bfb('0x43')]['id']}})[_0x3bfb('0x24')](handleEntityNotFound(_0x4897ca,null))[_0x3bfb('0x24')](function(_0x2a3488){if(_0x2a3488){_0x2b1aaa=_0x2a3488;_0x122949[_0x3bfb('0x2d')]=_[_0x3bfb('0x2f')](db[_0x3bfb('0x47')]['rawAttributes']);_0x122949[_0x3bfb('0x2e')]=_['keys'](_0x58cbfd[_0x3bfb('0x2e')]);_0x122949[_0x3bfb('0x30')]=_[_0x3bfb('0x31')](_0x122949['model'],_0x122949['query']);_0x2f6997[_0x3bfb('0x32')]=_[_0x3bfb('0x31')](_0x122949['model'],qs[_0x3bfb('0x33')](_0x58cbfd[_0x3bfb('0x2e')][_0x3bfb('0x33')]));_0x2f6997[_0x3bfb('0x32')]=_0x2f6997[_0x3bfb('0x32')]['length']?_0x2f6997[_0x3bfb('0x32')]:_0x122949[_0x3bfb('0x2d')];_0x2f6997[_0x3bfb('0x35')]=qs[_0x3bfb('0x36')](_0x58cbfd['query']['sort']);_0x2f6997[_0x3bfb('0x37')]=qs[_0x3bfb('0x30')](_[_0x3bfb('0x48')](_0x58cbfd[_0x3bfb('0x2e')],_0x122949[_0x3bfb('0x30')]));if(_0x58cbfd[_0x3bfb('0x2e')][_0x3bfb('0x38')]){_0x2f6997[_0x3bfb('0x37')]=_[_0x3bfb('0x39')](_0x2f6997[_0x3bfb('0x37')],{'$or':_[_0x3bfb('0x29')](_0x2f6997[_0x3bfb('0x32')],function(_0x3fba1b){var _0x49584e={};_0x49584e[_0x3fba1b]={'$like':'%'+_0x58cbfd['query']['filter']+'%'};return _0x49584e;})});}_0x2f6997=_[_0x3bfb('0x39')]({},_0x2f6997,_0x58cbfd[_0x3bfb('0x40')]);return _0x2b1aaa[_0x3bfb('0x45')](_0x2f6997);}})[_0x3bfb('0x24')](function(_0x57b669){if(_0x57b669){_0x28d3db=_0x57b669[_0x3bfb('0x3e')];if(!_0x58cbfd[_0x3bfb('0x2e')][_0x3bfb('0x34')](_0x3bfb('0x49'))){_0x2f6997[_0x3bfb('0x1c')]=qs['limit'](_0x58cbfd['query'][_0x3bfb('0x1c')]);_0x2f6997['offset']=qs[_0x3bfb('0x1a')](_0x58cbfd[_0x3bfb('0x2e')]['offset']);}return _0x2b1aaa[_0x3bfb('0x45')](_0x2f6997);}})[_0x3bfb('0x24')](function(_0x187fcb){if(_0x187fcb){return _0x187fcb?{'count':_0x28d3db,'rows':_0x187fcb}:null;}})[_0x3bfb('0x24')](respondWithResult(_0x4897ca,null))['catch'](handleError(_0x4897ca,null));};exports[_0x3bfb('0x4a')]=function(_0x2a2ce9,_0x2172d4,_0x3ee4bb){var _0x59eaf7={};var _0x42dcdd={};var _0x20750a;var _0x439e61;return db[_0x3bfb('0x2a')][_0x3bfb('0x46')]({'where':{'id':_0x2a2ce9['params']['id']}})[_0x3bfb('0x24')](handleEntityNotFound(_0x2172d4,null))[_0x3bfb('0x24')](function(_0x4c8570){if(_0x4c8570){_0x20750a=_0x4c8570;_0x42dcdd[_0x3bfb('0x2d')]=_[_0x3bfb('0x2f')](db[_0x3bfb('0x47')][_0x3bfb('0x2b')]);_0x42dcdd['query']=_[_0x3bfb('0x2f')](_0x2a2ce9[_0x3bfb('0x2e')]);_0x42dcdd[_0x3bfb('0x30')]=_[_0x3bfb('0x31')](_0x42dcdd[_0x3bfb('0x2d')],_0x42dcdd[_0x3bfb('0x2e')]);_0x59eaf7[_0x3bfb('0x32')]=_['intersection'](_0x42dcdd[_0x3bfb('0x2d')],qs['fields'](_0x2a2ce9[_0x3bfb('0x2e')][_0x3bfb('0x33')]));_0x59eaf7[_0x3bfb('0x32')]=_0x59eaf7['attributes'][_0x3bfb('0x3e')]?_0x59eaf7['attributes']:_0x42dcdd[_0x3bfb('0x2d')];_0x59eaf7[_0x3bfb('0x35')]=qs[_0x3bfb('0x36')](_0x2a2ce9['query'][_0x3bfb('0x36')]);_0x59eaf7[_0x3bfb('0x37')]=qs[_0x3bfb('0x30')](_[_0x3bfb('0x48')](_0x2a2ce9[_0x3bfb('0x2e')],_0x42dcdd[_0x3bfb('0x30')]));if(_0x2a2ce9['query']['filter']){_0x59eaf7['where']=_['merge'](_0x59eaf7[_0x3bfb('0x37')],{'$or':_[_0x3bfb('0x29')](_0x59eaf7[_0x3bfb('0x32')],function(_0x22fbfb){var _0x2ce0bf={};_0x2ce0bf[_0x22fbfb]={'$like':'%'+_0x2a2ce9[_0x3bfb('0x2e')][_0x3bfb('0x38')]+'%'};return _0x2ce0bf;})});}_0x59eaf7=_[_0x3bfb('0x39')]({},_0x59eaf7,_0x2a2ce9['options']);return _0x20750a[_0x3bfb('0x4a')](_0x59eaf7);}})[_0x3bfb('0x24')](function(_0x4e8918){if(_0x4e8918){_0x439e61=_0x4e8918[_0x3bfb('0x3e')];if(!_0x2a2ce9['query'][_0x3bfb('0x34')](_0x3bfb('0x49'))){_0x59eaf7['limit']=qs[_0x3bfb('0x1c')](_0x2a2ce9[_0x3bfb('0x2e')][_0x3bfb('0x1c')]);_0x59eaf7[_0x3bfb('0x1a')]=qs['offset'](_0x2a2ce9['query'][_0x3bfb('0x1a')]);}return _0x20750a[_0x3bfb('0x4a')](_0x59eaf7);}})[_0x3bfb('0x24')](function(_0x20343a){if(_0x20343a){return _0x20343a?{'count':_0x439e61,'rows':_0x20343a}:null;}})[_0x3bfb('0x24')](respondWithResult(_0x2172d4,null))['catch'](handleError(_0x2172d4,null));};exports[_0x3bfb('0x4b')]=function(_0xb3e1c1,_0x3d612c,_0x79f7ce){var _0x464e28={};var _0x52322f={};var _0x3df87f;var _0xb8550f;return db[_0x3bfb('0x2a')][_0x3bfb('0x46')]({'where':{'id':_0xb3e1c1[_0x3bfb('0x43')]['id']}})[_0x3bfb('0x24')](handleEntityNotFound(_0x3d612c,null))[_0x3bfb('0x24')](function(_0x312e82){if(_0x312e82){_0x3df87f=_0x312e82;_0x52322f['model']=_['keys'](db[_0x3bfb('0x47')]['rawAttributes']);_0x52322f[_0x3bfb('0x2e')]=_[_0x3bfb('0x2f')](_0xb3e1c1['query']);_0x52322f[_0x3bfb('0x30')]=_[_0x3bfb('0x31')](_0x52322f[_0x3bfb('0x2d')],_0x52322f[_0x3bfb('0x2e')]);_0x464e28[_0x3bfb('0x32')]=_[_0x3bfb('0x31')](_0x52322f['model'],qs[_0x3bfb('0x33')](_0xb3e1c1[_0x3bfb('0x2e')][_0x3bfb('0x33')]));_0x464e28['attributes']=_0x464e28[_0x3bfb('0x32')]['length']?_0x464e28['attributes']:_0x52322f[_0x3bfb('0x2d')];_0x464e28[_0x3bfb('0x35')]=qs[_0x3bfb('0x36')](_0xb3e1c1[_0x3bfb('0x2e')][_0x3bfb('0x36')]);_0x464e28[_0x3bfb('0x37')]=qs[_0x3bfb('0x30')](_[_0x3bfb('0x48')](_0xb3e1c1[_0x3bfb('0x2e')],_0x52322f[_0x3bfb('0x30')]));if(_0xb3e1c1['query']['filter']){_0x464e28[_0x3bfb('0x37')]=_[_0x3bfb('0x39')](_0x464e28['where'],{'$or':_[_0x3bfb('0x29')](_0x464e28['attributes'],function(_0x704cb6){var _0x3c10b6={};_0x3c10b6[_0x704cb6]={'$like':'%'+_0xb3e1c1['query'][_0x3bfb('0x38')]+'%'};return _0x3c10b6;})});}_0x464e28=_[_0x3bfb('0x39')]({},_0x464e28,_0xb3e1c1[_0x3bfb('0x40')]);return _0x3df87f[_0x3bfb('0x4b')](_0x464e28);}})[_0x3bfb('0x24')](function(_0x1b926a){if(_0x1b926a){_0xb8550f=_0x1b926a[_0x3bfb('0x3e')];if(!_0xb3e1c1[_0x3bfb('0x2e')][_0x3bfb('0x34')](_0x3bfb('0x49'))){_0x464e28[_0x3bfb('0x1c')]=qs[_0x3bfb('0x1c')](_0xb3e1c1['query'][_0x3bfb('0x1c')]);_0x464e28[_0x3bfb('0x1a')]=qs[_0x3bfb('0x1a')](_0xb3e1c1['query'][_0x3bfb('0x1a')]);}return _0x3df87f['getFields'](_0x464e28);}})[_0x3bfb('0x24')](function(_0x59ee1a){if(_0x59ee1a){return _0x59ee1a?{'count':_0xb8550f,'rows':_0x59ee1a}:null;}})[_0x3bfb('0x24')](respondWithResult(_0x3d612c,null))[_0x3bfb('0x3d')](handleError(_0x3d612c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 7b44fd3..e96e869 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 _0x9c82=['./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','request-promise','path','rimraf','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9c82,0x11c));var _0x29c8=function(_0x22914a,_0x15ac85){_0x22914a=_0x22914a-0x0;var _0x5d4b45=_0x9c82[_0x22914a];return _0x5d4b45;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x29c8('0x0'));var fs=require('fs');var path=require(_0x29c8('0x1'));var rimraf=require(_0x29c8('0x2'));var config=require(_0x29c8('0x3'));var attributes=require(_0x29c8('0x4'));module[_0x29c8('0x5')]=function(_0x2f2420,_0xca74b9){return _0x2f2420['define'](_0x29c8('0x6'),attributes,{'tableName':_0x29c8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b56=['api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x432b5b,_0x2059bd){var _0x7a4fac=function(_0x4b74c3){while(--_0x4b74c3){_0x432b5b['push'](_0x432b5b['shift']());}};_0x7a4fac(++_0x2059bd);}(_0x9b56,0x1dd));var _0x69b5=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x9b56[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x69b5('0x0'));var moment=require(_0x69b5('0x1'));var BPromise=require('bluebird');var rp=require(_0x69b5('0x2'));var fs=require('fs');var path=require(_0x69b5('0x3'));var rimraf=require(_0x69b5('0x4'));var config=require(_0x69b5('0x5'));var attributes=require(_0x69b5('0x6'));module[_0x69b5('0x7')]=function(_0x42786e,_0x58a4ca){return _0x42786e[_0x69b5('0x8')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','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 0753c4d..cfcbf42 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 _0x18bd=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5a425f,_0x439447){var _0x1ab39e=function(_0x36829a){while(--_0x36829a){_0x5a425f['push'](_0x5a425f['shift']());}};_0x1ab39e(++_0x439447);}(_0x18bd,0x86));var _0xd18b=function(_0x5230bb,_0xa651a6){_0x5230bb=_0x5230bb-0x0;var _0x21c463=_0x18bd[_0x5230bb];return _0x21c463;};'use strict';var _=require(_0xd18b('0x0'));var util=require(_0xd18b('0x1'));var moment=require(_0xd18b('0x2'));var BPromise=require('bluebird');var rs=require(_0xd18b('0x3'));var fs=require('fs');var Redis=require(_0xd18b('0x4'));var db=require(_0xd18b('0x5'))['db'];var utils=require(_0xd18b('0x6'));var logger=require(_0xd18b('0x7'))(_0xd18b('0x8'));var config=require(_0xd18b('0x9'));var jayson=require(_0xd18b('0xa'));var client=jayson[_0xd18b('0xb')][_0xd18b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a56a4,_0x783839,_0x5396d4){return new BPromise(function(_0x364c0f,_0x4eb7ce){return client['request'](_0x1a56a4,_0x5396d4)[_0xd18b('0xd')](function(_0x7f1d9a){logger[_0xd18b('0xe')](_0xd18b('0xf'),_0x783839,'request\x20sent');logger['debug'](_0xd18b('0x10'),_0x783839,_0xd18b('0x11'),JSON[_0xd18b('0x12')](_0x7f1d9a));if(_0x7f1d9a['error']){if(_0x7f1d9a['error']['code']===0x1f4){logger[_0xd18b('0x13')](_0xd18b('0xf'),_0x783839,_0x7f1d9a[_0xd18b('0x13')][_0xd18b('0x14')]);return _0x4eb7ce(_0x7f1d9a[_0xd18b('0x13')][_0xd18b('0x14')]);}logger[_0xd18b('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x783839,_0x7f1d9a['error'][_0xd18b('0x14')]);return _0x364c0f(_0x7f1d9a['error'][_0xd18b('0x14')]);}else{logger[_0xd18b('0xe')](_0xd18b('0xf'),_0x783839,_0xd18b('0x11'));_0x364c0f(_0x7f1d9a[_0xd18b('0x15')][_0xd18b('0x14')]);}})['catch'](function(_0x2a0bf6){logger[_0xd18b('0x13')](_0xd18b('0xf'),_0x783839,_0x2a0bf6);_0x4eb7ce(_0x2a0bf6);});});} \ No newline at end of file +var _0xecf9=['jayson/promise','http','request','then','info','request\x20sent','debug','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment'];(function(_0xbf03ec,_0x1afeea){var _0x11b78d=function(_0x22f339){while(--_0x22f339){_0xbf03ec['push'](_0xbf03ec['shift']());}};_0x11b78d(++_0x1afeea);}(_0xecf9,0x186));var _0x9ecf=function(_0x2ef912,_0x516206){_0x2ef912=_0x2ef912-0x0;var _0x367f2c=_0xecf9[_0x2ef912];return _0x367f2c;};'use strict';var _=require(_0x9ecf('0x0'));var util=require('util');var moment=require(_0x9ecf('0x1'));var BPromise=require(_0x9ecf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ecf('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9ecf('0x4'))('rpc');var config=require(_0x9ecf('0x5'));var jayson=require(_0x9ecf('0x6'));var client=jayson['client'][_0x9ecf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xbb3e0a,_0x1eb327,_0x2fb3a2){return new BPromise(function(_0x975a77,_0x5dc34f){return client[_0x9ecf('0x8')](_0xbb3e0a,_0x2fb3a2)[_0x9ecf('0x9')](function(_0x21cd19){logger[_0x9ecf('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1eb327,_0x9ecf('0xb'));logger[_0x9ecf('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1eb327,'request\x20sent',JSON['stringify'](_0x21cd19));if(_0x21cd19[_0x9ecf('0xd')]){if(_0x21cd19['error'][_0x9ecf('0xe')]===0x1f4){logger[_0x9ecf('0xd')](_0x9ecf('0xf'),_0x1eb327,_0x21cd19[_0x9ecf('0xd')][_0x9ecf('0x10')]);return _0x5dc34f(_0x21cd19[_0x9ecf('0xd')][_0x9ecf('0x10')]);}logger[_0x9ecf('0xd')](_0x9ecf('0xf'),_0x1eb327,_0x21cd19['error'][_0x9ecf('0x10')]);return _0x975a77(_0x21cd19[_0x9ecf('0xd')][_0x9ecf('0x10')]);}else{logger['info'](_0x9ecf('0xf'),_0x1eb327,_0x9ecf('0xb'));_0x975a77(_0x21cd19['result'][_0x9ecf('0x10')]);}})[_0x9ecf('0x11')](function(_0x214eac){logger[_0x9ecf('0xd')](_0x9ecf('0xf'),_0x1eb327,_0x214eac);_0x5dc34f(_0x214eac);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 5af2f72..5b3b807 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 _0xf72b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','put','update','destroy','exports','multer','path','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf72b,0x1d9));var _0xbf72=function(_0x55bbd5,_0x21ada5){_0x55bbd5=_0x55bbd5-0x0;var _0x2fc15a=_0xf72b[_0x55bbd5];return _0x2fc15a;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xb')]);router[_0xbf72('0xc')]('/',auth[_0xbf72('0x9')](),controller['create']);router[_0xbf72('0xd')]('/:id',auth[_0xbf72('0x9')](),controller[_0xbf72('0xe')]);router['delete'](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xf')]);module[_0xbf72('0x10')]=router; \ No newline at end of file +var _0xa631=['update','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','/:id','isAuthenticated','show','create','put'];(function(_0x50fcb4,_0x497e82){var _0x1362d9=function(_0x36fd37){while(--_0x36fd37){_0x50fcb4['push'](_0x50fcb4['shift']());}};_0x1362d9(++_0x497e82);}(_0xa631,0xe4));var _0x1a63=function(_0x55c582,_0x279beb){_0x55c582=_0x55c582-0x0;var _0x2a924a=_0xa631[_0x55c582];return _0x2a924a;};'use strict';var multer=require('multer');var util=require(_0x1a63('0x0'));var path=require(_0x1a63('0x1'));var timeout=require(_0x1a63('0x2'));var express=require('express');var router=express[_0x1a63('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1a63('0x4'));var config=require(_0x1a63('0x5'));var controller=require(_0x1a63('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1a63('0x7'),auth[_0x1a63('0x8')](),controller[_0x1a63('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1a63('0xa')]);router[_0x1a63('0xb')](_0x1a63('0x7'),auth[_0x1a63('0x8')](),controller[_0x1a63('0xc')]);router['delete'](_0x1a63('0x7'),auth[_0x1a63('0x8')](),controller[_0x1a63('0xd')]);module[_0x1a63('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 77271a3..e5ce111 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 _0xd363=['sequelize','exports','ENUM','string','keyValue','picklist','STRING','customVariable','BOOLEAN'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd363,0x1cb));var _0x3d36=function(_0x4f7014,_0x3649ef){_0x4f7014=_0x4f7014-0x0;var _0x8fa130=_0xd363[_0x4f7014];return _0x8fa130;};'use strict';var Sequelize=require(_0x3d36('0x0'));module[_0x3d36('0x1')]={'type':{'type':Sequelize[_0x3d36('0x2')](_0x3d36('0x3'),'variable','customVariable',_0x3d36('0x4'),_0x3d36('0x5')),'defaultValue':_0x3d36('0x3')},'content':{'type':Sequelize[_0x3d36('0x6')]},'key':{'type':Sequelize[_0x3d36('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x3d36('0x7'))},'keyContent':{'type':Sequelize[_0x3d36('0x6')]},'idField':{'type':Sequelize[_0x3d36('0x6')]},'nameField':{'type':Sequelize[_0x3d36('0x6')]},'customField':{'type':Sequelize[_0x3d36('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa742=['BOOLEAN','sequelize','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xa742,0x17b));var _0x2a74=function(_0x577d23,_0x336898){_0x577d23=_0x577d23-0x0;var _0x55c26b=_0xa742[_0x577d23];return _0x55c26b;};'use strict';var Sequelize=require(_0x2a74('0x0'));module['exports']={'type':{'type':Sequelize[_0x2a74('0x1')](_0x2a74('0x2'),_0x2a74('0x3'),'customVariable',_0x2a74('0x4'),_0x2a74('0x5')),'defaultValue':_0x2a74('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2a74('0x6')]},'keyType':{'type':Sequelize[_0x2a74('0x1')](_0x2a74('0x2'),_0x2a74('0x3'),_0x2a74('0x7'))},'keyContent':{'type':Sequelize[_0x2a74('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2a74('0x6')]},'customField':{'type':Sequelize[_0x2a74('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 0e75ee8..0842044 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 _0xfb6b=['merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','save','then','end','error','stack','name','send','index','FreshsalesField','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x213724,_0x231bbc){var _0x45a31f=function(_0x3996a8){while(--_0x3996a8){_0x213724['push'](_0x213724['shift']());}};_0x45a31f(++_0x231bbc);}(_0xfb6b,0x13c));var _0xbfb6=function(_0x5446d2,_0x43f1af){_0x5446d2=_0x5446d2-0x0;var _0x443359=_0xfb6b[_0x5446d2];return _0x443359;};'use strict';var emlformat=require(_0xbfb6('0x0'));var rimraf=require(_0xbfb6('0x1'));var zipdir=require(_0xbfb6('0x2'));var jsonpatch=require(_0xbfb6('0x3'));var rp=require(_0xbfb6('0x4'));var moment=require(_0xbfb6('0x5'));var BPromise=require(_0xbfb6('0x6'));var Mustache=require(_0xbfb6('0x7'));var util=require(_0xbfb6('0x8'));var path=require(_0xbfb6('0x9'));var sox=require(_0xbfb6('0xa'));var csv=require(_0xbfb6('0xb'));var ejs=require(_0xbfb6('0xc'));var fs=require('fs');var fs_extra=require(_0xbfb6('0xd'));var _=require(_0xbfb6('0xe'));var squel=require(_0xbfb6('0xf'));var crypto=require(_0xbfb6('0x10'));var jsforce=require(_0xbfb6('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xbfb6('0xb'));var querystring=require('querystring');var Papa=require(_0xbfb6('0x12'));var Redis=require(_0xbfb6('0x13'));var authService=require(_0xbfb6('0x14'));var qs=require(_0xbfb6('0x15'));var as=require(_0xbfb6('0x16'));var hardwareService=require(_0xbfb6('0x17'));var logger=require(_0xbfb6('0x18'))('api');var utils=require(_0xbfb6('0x19'));var config=require(_0xbfb6('0x1a'));var licenseUtil=require(_0xbfb6('0x1b'));var db=require(_0xbfb6('0x1c'))['db'];function respondWithStatusCode(_0x3a9a8,_0x14f525){_0x14f525=_0x14f525||0xcc;return function(_0x5403da){if(_0x5403da){return _0x3a9a8['sendStatus'](_0x14f525);}return _0x3a9a8['status'](_0x14f525)['end']();};}function respondWithResult(_0x5d26e0,_0x217e09){_0x217e09=_0x217e09||0xc8;return function(_0x2cb778){if(_0x2cb778){return _0x5d26e0[_0xbfb6('0x1d')](_0x217e09)['json'](_0x2cb778);}};}function respondWithFilteredResult(_0x393d16,_0x41bb4d){return function(_0xa2b5de){if(_0xa2b5de){var _0x2f7ecd=typeof _0x41bb4d[_0xbfb6('0x1e')]===_0xbfb6('0x1f')&&typeof _0x41bb4d[_0xbfb6('0x20')]===_0xbfb6('0x1f');var _0x5419db=_0xa2b5de[_0xbfb6('0x21')];var _0x482f1a=_0x2f7ecd?0x0:_0x41bb4d[_0xbfb6('0x1e')];var _0x55a110=_0x2f7ecd?_0xa2b5de[_0xbfb6('0x21')]:_0x41bb4d[_0xbfb6('0x1e')]+_0x41bb4d[_0xbfb6('0x20')];var _0x2e3b34;if(_0x55a110>=_0x5419db){_0x55a110=_0x5419db;_0x2e3b34=0xc8;}else{_0x2e3b34=0xce;}_0x393d16[_0xbfb6('0x1d')](_0x2e3b34);return _0x393d16['set']('Content-Range',_0x482f1a+'-'+_0x55a110+'/'+_0x5419db)['json'](_0xa2b5de);}return null;};}function patchUpdates(_0x3fc4b4){return function(_0x494035){try{jsonpatch['apply'](_0x494035,_0x3fc4b4,!![]);}catch(_0x4122f0){return BPromise['reject'](_0x4122f0);}return _0x494035[_0xbfb6('0x22')]();};}function saveUpdates(_0x3c79f9,_0x3ad8e2){return function(_0x2f4c16){if(_0x2f4c16){return _0x2f4c16['update'](_0x3c79f9)[_0xbfb6('0x23')](function(_0x3c6c2a){return _0x3c6c2a;});}return null;};}function removeEntity(_0xa1faa4,_0xf1c258){return function(_0x4eee50){if(_0x4eee50){return _0x4eee50['destroy']()[_0xbfb6('0x23')](function(){_0xa1faa4[_0xbfb6('0x1d')](0xcc)[_0xbfb6('0x24')]();});}};}function handleEntityNotFound(_0x4020fa,_0x1b6063){return function(_0x14bed3){if(!_0x14bed3){_0x4020fa['sendStatus'](0x194);}return _0x14bed3;};}function handleError(_0x498c0a,_0x3fc912){_0x3fc912=_0x3fc912||0x1f4;return function(_0x1661d6){logger[_0xbfb6('0x25')](_0x1661d6[_0xbfb6('0x26')]);if(_0x1661d6[_0xbfb6('0x27')]){delete _0x1661d6['name'];}_0x498c0a[_0xbfb6('0x1d')](_0x3fc912)[_0xbfb6('0x28')](_0x1661d6);};}exports[_0xbfb6('0x29')]=function(_0x483852,_0x5db82a){var _0x7dfc78={},_0x12feb8={},_0x8024db={'count':0x0,'rows':[]};var _0x4aa2fd=_['map'](db[_0xbfb6('0x2a')]['rawAttributes'],function(_0x19007d){return{'name':_0x19007d['fieldName'],'type':_0x19007d['type']['key']};});_0x12feb8[_0xbfb6('0x2b')]=_[_0xbfb6('0x2c')](_0x4aa2fd,_0xbfb6('0x27'));_0x12feb8[_0xbfb6('0x2d')]=_[_0xbfb6('0x2e')](_0x483852[_0xbfb6('0x2d')]);_0x12feb8[_0xbfb6('0x2f')]=_[_0xbfb6('0x30')](_0x12feb8[_0xbfb6('0x2b')],_0x12feb8['query']);_0x7dfc78[_0xbfb6('0x31')]=_[_0xbfb6('0x30')](_0x12feb8[_0xbfb6('0x2b')],qs[_0xbfb6('0x32')](_0x483852['query'][_0xbfb6('0x32')]));_0x7dfc78[_0xbfb6('0x31')]=_0x7dfc78['attributes'][_0xbfb6('0x33')]?_0x7dfc78[_0xbfb6('0x31')]:_0x12feb8[_0xbfb6('0x2b')];if(!_0x483852['query'][_0xbfb6('0x34')](_0xbfb6('0x35'))){_0x7dfc78[_0xbfb6('0x20')]=qs[_0xbfb6('0x20')](_0x483852[_0xbfb6('0x2d')][_0xbfb6('0x20')]);_0x7dfc78[_0xbfb6('0x1e')]=qs[_0xbfb6('0x1e')](_0x483852['query']['offset']);}_0x7dfc78[_0xbfb6('0x36')]=qs[_0xbfb6('0x37')](_0x483852[_0xbfb6('0x2d')][_0xbfb6('0x37')]);_0x7dfc78['where']=qs[_0xbfb6('0x2f')](_[_0xbfb6('0x38')](_0x483852[_0xbfb6('0x2d')],_0x12feb8[_0xbfb6('0x2f')]),_0x4aa2fd);if(_0x483852['query'][_0xbfb6('0x39')]){_0x7dfc78[_0xbfb6('0x3a')]=_[_0xbfb6('0x3b')](_0x7dfc78[_0xbfb6('0x3a')],{'$or':_[_0xbfb6('0x2c')](_0x4aa2fd,function(_0x5ad847){if(_0x5ad847[_0xbfb6('0x3c')]!==_0xbfb6('0x3d')){var _0x8cc0d7={};_0x8cc0d7[_0x5ad847[_0xbfb6('0x27')]]={'$like':'%'+_0x483852[_0xbfb6('0x2d')][_0xbfb6('0x39')]+'%'};return _0x8cc0d7;}})});}_0x7dfc78=_[_0xbfb6('0x3b')]({},_0x7dfc78,_0x483852[_0xbfb6('0x3e')]);var _0x423396={'where':_0x7dfc78[_0xbfb6('0x3a')]};return db['FreshsalesField'][_0xbfb6('0x21')](_0x423396)[_0xbfb6('0x23')](function(_0x22aebd){_0x8024db[_0xbfb6('0x21')]=_0x22aebd;if(_0x483852['query'][_0xbfb6('0x3f')]){_0x7dfc78[_0xbfb6('0x40')]=[{'all':!![]}];}return db['FreshsalesField'][_0xbfb6('0x41')](_0x7dfc78);})[_0xbfb6('0x23')](function(_0x599e62){_0x8024db[_0xbfb6('0x42')]=_0x599e62;return _0x8024db;})[_0xbfb6('0x23')](respondWithFilteredResult(_0x5db82a,_0x7dfc78))[_0xbfb6('0x43')](handleError(_0x5db82a,null));};exports[_0xbfb6('0x44')]=function(_0x21e0a7,_0x56838c){var _0x4d6f2={'raw':!![],'where':{'id':_0x21e0a7[_0xbfb6('0x45')]['id']}},_0x4b5592={};_0x4b5592[_0xbfb6('0x2b')]=_['keys'](db[_0xbfb6('0x2a')][_0xbfb6('0x46')]);_0x4b5592[_0xbfb6('0x2d')]=_['keys'](_0x21e0a7['query']);_0x4b5592[_0xbfb6('0x2f')]=_[_0xbfb6('0x30')](_0x4b5592['model'],_0x4b5592[_0xbfb6('0x2d')]);_0x4d6f2['attributes']=_[_0xbfb6('0x30')](_0x4b5592['model'],qs[_0xbfb6('0x32')](_0x21e0a7[_0xbfb6('0x2d')][_0xbfb6('0x32')]));_0x4d6f2[_0xbfb6('0x31')]=_0x4d6f2['attributes']['length']?_0x4d6f2['attributes']:_0x4b5592['model'];if(_0x21e0a7[_0xbfb6('0x2d')][_0xbfb6('0x3f')]){_0x4d6f2[_0xbfb6('0x40')]=[{'all':!![]}];}_0x4d6f2=_[_0xbfb6('0x3b')]({},_0x4d6f2,_0x21e0a7[_0xbfb6('0x3e')]);return db[_0xbfb6('0x2a')][_0xbfb6('0x47')](_0x4d6f2)['then'](handleEntityNotFound(_0x56838c,null))[_0xbfb6('0x23')](respondWithResult(_0x56838c,null))['catch'](handleError(_0x56838c,null));};exports[_0xbfb6('0x48')]=function(_0x8a1aa1,_0x3354f0){return db[_0xbfb6('0x2a')][_0xbfb6('0x48')](_0x8a1aa1['body'],{})['then'](respondWithResult(_0x3354f0,0xc9))[_0xbfb6('0x43')](handleError(_0x3354f0,null));};exports[_0xbfb6('0x49')]=function(_0x996c59,_0x3fe434){if(_0x996c59[_0xbfb6('0x4a')]['id']){delete _0x996c59['body']['id'];}return db['FreshsalesField'][_0xbfb6('0x47')]({'where':{'id':_0x996c59[_0xbfb6('0x45')]['id']}})[_0xbfb6('0x23')](handleEntityNotFound(_0x3fe434,null))[_0xbfb6('0x23')](saveUpdates(_0x996c59[_0xbfb6('0x4a')],null))[_0xbfb6('0x23')](respondWithResult(_0x3fe434,null))[_0xbfb6('0x43')](handleError(_0x3fe434,null));};exports['destroy']=function(_0x392271,_0x13ef99){return db[_0xbfb6('0x2a')][_0xbfb6('0x47')]({'where':{'id':_0x392271[_0xbfb6('0x45')]['id']}})[_0xbfb6('0x23')](handleEntityNotFound(_0x13ef99,null))['then'](removeEntity(_0x13ef99,null))[_0xbfb6('0x43')](handleError(_0x13ef99,null));}; \ No newline at end of file +var _0x96f7=['catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','FreshsalesField','includeAll','include','rows'];(function(_0x5c888f,_0xe8f7fd){var _0x4e31f1=function(_0x3d11a0){while(--_0x3d11a0){_0x5c888f['push'](_0x5c888f['shift']());}};_0x4e31f1(++_0xe8f7fd);}(_0x96f7,0x18c));var _0x796f=function(_0x34bd11,_0x322433){_0x34bd11=_0x34bd11-0x0;var _0x2a4f5c=_0x96f7[_0x34bd11];return _0x2a4f5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x796f('0x0'));var zipdir=require(_0x796f('0x1'));var jsonpatch=require(_0x796f('0x2'));var rp=require(_0x796f('0x3'));var moment=require(_0x796f('0x4'));var BPromise=require(_0x796f('0x5'));var Mustache=require(_0x796f('0x6'));var util=require(_0x796f('0x7'));var path=require(_0x796f('0x8'));var sox=require(_0x796f('0x9'));var csv=require('to-csv');var ejs=require(_0x796f('0xa'));var fs=require('fs');var fs_extra=require(_0x796f('0xb'));var _=require(_0x796f('0xc'));var squel=require('squel');var crypto=require(_0x796f('0xd'));var jsforce=require(_0x796f('0xe'));var deskjs=require(_0x796f('0xf'));var toCsv=require(_0x796f('0x10'));var querystring=require(_0x796f('0x11'));var Papa=require(_0x796f('0x12'));var Redis=require(_0x796f('0x13'));var authService=require(_0x796f('0x14'));var qs=require(_0x796f('0x15'));var as=require(_0x796f('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x796f('0x17'))(_0x796f('0x18'));var utils=require(_0x796f('0x19'));var config=require(_0x796f('0x1a'));var licenseUtil=require(_0x796f('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b39f,_0x362f88){_0x362f88=_0x362f88||0xcc;return function(_0x19eca6){if(_0x19eca6){return _0x4b39f[_0x796f('0x1c')](_0x362f88);}return _0x4b39f[_0x796f('0x1d')](_0x362f88)[_0x796f('0x1e')]();};}function respondWithResult(_0x1bb351,_0x27de71){_0x27de71=_0x27de71||0xc8;return function(_0x5ddf03){if(_0x5ddf03){return _0x1bb351['status'](_0x27de71)['json'](_0x5ddf03);}};}function respondWithFilteredResult(_0x462b47,_0x22c294){return function(_0x44569f){if(_0x44569f){var _0x57563f=typeof _0x22c294[_0x796f('0x1f')]===_0x796f('0x20')&&typeof _0x22c294[_0x796f('0x21')]===_0x796f('0x20');var _0x4d857d=_0x44569f['count'];var _0x3f0b6d=_0x57563f?0x0:_0x22c294[_0x796f('0x1f')];var _0x43b3df=_0x57563f?_0x44569f[_0x796f('0x22')]:_0x22c294['offset']+_0x22c294[_0x796f('0x21')];var _0x373b45;if(_0x43b3df>=_0x4d857d){_0x43b3df=_0x4d857d;_0x373b45=0xc8;}else{_0x373b45=0xce;}_0x462b47[_0x796f('0x1d')](_0x373b45);return _0x462b47[_0x796f('0x23')]('Content-Range',_0x3f0b6d+'-'+_0x43b3df+'/'+_0x4d857d)['json'](_0x44569f);}return null;};}function patchUpdates(_0x2cbd7b){return function(_0x8ba453){try{jsonpatch['apply'](_0x8ba453,_0x2cbd7b,!![]);}catch(_0x562c26){return BPromise[_0x796f('0x24')](_0x562c26);}return _0x8ba453[_0x796f('0x25')]();};}function saveUpdates(_0x237e72,_0x11d93c){return function(_0x226bd8){if(_0x226bd8){return _0x226bd8[_0x796f('0x26')](_0x237e72)[_0x796f('0x27')](function(_0x82bfd3){return _0x82bfd3;});}return null;};}function removeEntity(_0xd0bf1f,_0x1e37a2){return function(_0x35186d){if(_0x35186d){return _0x35186d[_0x796f('0x28')]()[_0x796f('0x27')](function(){_0xd0bf1f[_0x796f('0x1d')](0xcc)[_0x796f('0x1e')]();});}};}function handleEntityNotFound(_0x5704b2,_0x463c31){return function(_0x3d253d){if(!_0x3d253d){_0x5704b2['sendStatus'](0x194);}return _0x3d253d;};}function handleError(_0x53e7d5,_0x1ed127){_0x1ed127=_0x1ed127||0x1f4;return function(_0x4b23cf){logger[_0x796f('0x29')](_0x4b23cf[_0x796f('0x2a')]);if(_0x4b23cf[_0x796f('0x2b')]){delete _0x4b23cf[_0x796f('0x2b')];}_0x53e7d5['status'](_0x1ed127)['send'](_0x4b23cf);};}exports[_0x796f('0x2c')]=function(_0x16e700,_0xe0b0fa){var _0x2cb549={},_0x4af8cb={},_0x2945f9={'count':0x0,'rows':[]};var _0x4e1cca=_[_0x796f('0x2d')](db['FreshsalesField'][_0x796f('0x2e')],function(_0x1dd66c){return{'name':_0x1dd66c[_0x796f('0x2f')],'type':_0x1dd66c[_0x796f('0x30')][_0x796f('0x31')]};});_0x4af8cb[_0x796f('0x32')]=_[_0x796f('0x2d')](_0x4e1cca,_0x796f('0x2b'));_0x4af8cb[_0x796f('0x33')]=_[_0x796f('0x34')](_0x16e700[_0x796f('0x33')]);_0x4af8cb['filters']=_[_0x796f('0x35')](_0x4af8cb[_0x796f('0x32')],_0x4af8cb[_0x796f('0x33')]);_0x2cb549['attributes']=_[_0x796f('0x35')](_0x4af8cb[_0x796f('0x32')],qs[_0x796f('0x36')](_0x16e700['query'][_0x796f('0x36')]));_0x2cb549[_0x796f('0x37')]=_0x2cb549[_0x796f('0x37')][_0x796f('0x38')]?_0x2cb549[_0x796f('0x37')]:_0x4af8cb['model'];if(!_0x16e700[_0x796f('0x33')][_0x796f('0x39')](_0x796f('0x3a'))){_0x2cb549[_0x796f('0x21')]=qs[_0x796f('0x21')](_0x16e700[_0x796f('0x33')]['limit']);_0x2cb549[_0x796f('0x1f')]=qs[_0x796f('0x1f')](_0x16e700['query']['offset']);}_0x2cb549[_0x796f('0x3b')]=qs[_0x796f('0x3c')](_0x16e700[_0x796f('0x33')]['sort']);_0x2cb549['where']=qs[_0x796f('0x3d')](_[_0x796f('0x3e')](_0x16e700[_0x796f('0x33')],_0x4af8cb[_0x796f('0x3d')]),_0x4e1cca);if(_0x16e700['query'][_0x796f('0x3f')]){_0x2cb549[_0x796f('0x40')]=_[_0x796f('0x41')](_0x2cb549[_0x796f('0x40')],{'$or':_[_0x796f('0x2d')](_0x4e1cca,function(_0x539198){if(_0x539198[_0x796f('0x30')]!==_0x796f('0x42')){var _0x3fa362={};_0x3fa362[_0x539198['name']]={'$like':'%'+_0x16e700[_0x796f('0x33')]['filter']+'%'};return _0x3fa362;}})});}_0x2cb549=_[_0x796f('0x41')]({},_0x2cb549,_0x16e700[_0x796f('0x43')]);var _0x6f7c90={'where':_0x2cb549['where']};return db[_0x796f('0x44')][_0x796f('0x22')](_0x6f7c90)['then'](function(_0x2e1e0d){_0x2945f9[_0x796f('0x22')]=_0x2e1e0d;if(_0x16e700[_0x796f('0x33')][_0x796f('0x45')]){_0x2cb549[_0x796f('0x46')]=[{'all':!![]}];}return db[_0x796f('0x44')]['findAll'](_0x2cb549);})[_0x796f('0x27')](function(_0x20d591){_0x2945f9[_0x796f('0x47')]=_0x20d591;return _0x2945f9;})['then'](respondWithFilteredResult(_0xe0b0fa,_0x2cb549))[_0x796f('0x48')](handleError(_0xe0b0fa,null));};exports[_0x796f('0x49')]=function(_0x52f5f8,_0x1f6ff9){var _0x2142e3={'raw':!![],'where':{'id':_0x52f5f8[_0x796f('0x4a')]['id']}},_0x5b0695={};_0x5b0695[_0x796f('0x32')]=_[_0x796f('0x34')](db[_0x796f('0x44')][_0x796f('0x2e')]);_0x5b0695[_0x796f('0x33')]=_[_0x796f('0x34')](_0x52f5f8[_0x796f('0x33')]);_0x5b0695['filters']=_[_0x796f('0x35')](_0x5b0695[_0x796f('0x32')],_0x5b0695['query']);_0x2142e3['attributes']=_[_0x796f('0x35')](_0x5b0695[_0x796f('0x32')],qs[_0x796f('0x36')](_0x52f5f8[_0x796f('0x33')]['fields']));_0x2142e3[_0x796f('0x37')]=_0x2142e3[_0x796f('0x37')][_0x796f('0x38')]?_0x2142e3[_0x796f('0x37')]:_0x5b0695[_0x796f('0x32')];if(_0x52f5f8[_0x796f('0x33')]['includeAll']){_0x2142e3['include']=[{'all':!![]}];}_0x2142e3=_[_0x796f('0x41')]({},_0x2142e3,_0x52f5f8[_0x796f('0x43')]);return db[_0x796f('0x44')][_0x796f('0x4b')](_0x2142e3)[_0x796f('0x27')](handleEntityNotFound(_0x1f6ff9,null))[_0x796f('0x27')](respondWithResult(_0x1f6ff9,null))['catch'](handleError(_0x1f6ff9,null));};exports[_0x796f('0x4c')]=function(_0x31862c,_0x1ebc6f){return db[_0x796f('0x44')]['create'](_0x31862c[_0x796f('0x4d')],{})['then'](respondWithResult(_0x1ebc6f,0xc9))['catch'](handleError(_0x1ebc6f,null));};exports[_0x796f('0x26')]=function(_0x38d6e7,_0x363c50){if(_0x38d6e7[_0x796f('0x4d')]['id']){delete _0x38d6e7[_0x796f('0x4d')]['id'];}return db[_0x796f('0x44')][_0x796f('0x4b')]({'where':{'id':_0x38d6e7[_0x796f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x363c50,null))[_0x796f('0x27')](saveUpdates(_0x38d6e7['body'],null))[_0x796f('0x27')](respondWithResult(_0x363c50,null))[_0x796f('0x48')](handleError(_0x363c50,null));};exports['destroy']=function(_0x58b063,_0x3c1b79){return db['FreshsalesField'][_0x796f('0x4b')]({'where':{'id':_0x58b063[_0x796f('0x4a')]['id']}})[_0x796f('0x27')](handleEntityNotFound(_0x3c1b79,null))[_0x796f('0x27')](removeEntity(_0x3c1b79,null))[_0x796f('0x48')](handleError(_0x3c1b79,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 8d97163..2da8c89 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 _0x8eba=['int_freshsales_fields','freshsales_unique_index','idField','lodash','util','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','FreshsalesField'];(function(_0x497188,_0x1c8675){var _0xc8f823=function(_0x3b6787){while(--_0x3b6787){_0x497188['push'](_0x497188['shift']());}};_0xc8f823(++_0x1c8675);}(_0x8eba,0xc3));var _0xa8eb=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x8eba[_0x28aea5];return _0x6a55f9;};'use strict';var _=require(_0xa8eb('0x0'));var util=require(_0xa8eb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa8eb('0x2'));var rp=require(_0xa8eb('0x3'));var fs=require('fs');var path=require(_0xa8eb('0x4'));var rimraf=require(_0xa8eb('0x5'));var config=require('../../config/environment');var attributes=require(_0xa8eb('0x6'));module[_0xa8eb('0x7')]=function(_0x5abab9,_0x321f2f){return _0x5abab9['define'](_0xa8eb('0x8'),attributes,{'tableName':_0xa8eb('0x9'),'paranoid':![],'indexes':[{'name':_0xa8eb('0xa'),'fields':[_0xa8eb('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfcbb=['request-promise','path','rimraf','../../config/environment','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger','bluebird'];(function(_0x288798,_0x246654){var _0x16e717=function(_0x1e01f8){while(--_0x1e01f8){_0x288798['push'](_0x288798['shift']());}};_0x16e717(++_0x246654);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x50a54e,_0x145b3f){_0x50a54e=_0x50a54e-0x0;var _0x3c4251=_0xfcbb[_0x50a54e];return _0x3c4251;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var logger=require(_0xbfcb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbfcb('0x3'));var rp=require(_0xbfcb('0x4'));var fs=require('fs');var path=require(_0xbfcb('0x5'));var rimraf=require(_0xbfcb('0x6'));var config=require(_0xbfcb('0x7'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x32c2aa,_0x4990c){return _0x32c2aa[_0xbfcb('0x8')](_0xbfcb('0x9'),attributes,{'tableName':_0xbfcb('0xa'),'paranoid':![],'indexes':[{'name':_0xbfcb('0xb'),'fields':[_0xbfcb('0xc'),'FieldId'],'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 185a29b..2e5bea5 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 _0x71ab=['http','request','then','info','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshsalesField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x42dd12,_0x167327){var _0x1bc48b=function(_0x587b47){while(--_0x587b47){_0x42dd12['push'](_0x42dd12['shift']());}};_0x1bc48b(++_0x167327);}(_0x71ab,0x64));var _0xb71a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x71ab[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a84e,_0x4358ce,_0x2a4c86){return new BPromise(function(_0x43ca14,_0x471ab6){return client[_0xb71a('0xb')](_0x35a84e,_0x2a4c86)[_0xb71a('0xc')](function(_0x378c96){logger[_0xb71a('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0xb71a('0xe'));logger['debug'](_0xb71a('0xf'),_0x4358ce,_0xb71a('0xe'),JSON[_0xb71a('0x10')](_0x378c96));if(_0x378c96['error']){if(_0x378c96[_0xb71a('0x11')]['code']===0x1f4){logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error'][_0xb71a('0x12')]);return _0x471ab6(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error']['message']);return _0x43ca14(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}else{logger[_0xb71a('0xd')](_0xb71a('0x13'),_0x4358ce,_0xb71a('0xe'));_0x43ca14(_0x378c96[_0xb71a('0x14')][_0xb71a('0x12')]);}})[_0xb71a('0x15')](function(_0x7710a8){logger['error'](_0xb71a('0x13'),_0x4358ce,_0x7710a8);_0x471ab6(_0x7710a8);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x325f5f,_0xa1ff06){var _0x4a2350=function(_0x53a1be){while(--_0x53a1be){_0x325f5f['push'](_0x325f5f['shift']());}};_0x4a2350(++_0xa1ff06);}(_0xabce,0x103));var _0xeabc=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xabce[_0x34021d];return _0x16597b;};'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')]('FreshsalesField,\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/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 442dcd6..03ccc43 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5aab1e,_0x28976d){var _0x35b240=function(_0x50bc13){while(--_0x50bc13){_0x5aab1e['push'](_0x5aab1e['shift']());}};_0x35b240(++_0x28976d);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _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(_0x414abb,_0x8a58fc){var _0x357dee=function(_0x7dd3a3){while(--_0x7dd3a3){_0x414abb['push'](_0x414abb['shift']());}};_0x357dee(++_0x8a58fc);}(_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'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 50f6276..a414574 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 _0x0424=['STRING','username','ENUM','integrationTab','newTab'];(function(_0x18b3cd,_0x179e00){var _0x5c5c7e=function(_0x36bdb0){while(--_0x36bdb0){_0x18b3cd['push'](_0x18b3cd['shift']());}};_0x5c5c7e(++_0x179e00);}(_0x0424,0x159));var _0x4042=function(_0x2e409e,_0x2d227e){_0x2e409e=_0x2e409e-0x0;var _0xe6e039=_0x0424[_0x2e409e];return _0xe6e039;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4042('0x0')]},'description':{'type':Sequelize[_0x4042('0x0')]},'username':{'type':Sequelize[_0x4042('0x0')],'unique':_0x4042('0x1')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4042('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x4042('0x0')]},'serverUrl':{'type':Sequelize[_0x4042('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x4042('0x2')](_0x4042('0x3'),_0x4042('0x4')),'defaultValue':_0x4042('0x3')}}; \ No newline at end of file +var _0xb8de=['integrationTab','newTab','sequelize','exports','STRING','username','ENUM'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb8de,0x152));var _0xeb8d=function(_0xbad0c4,_0x1f787b){_0xbad0c4=_0xbad0c4-0x0;var _0x189fa1=_0xb8de[_0xbad0c4];return _0x189fa1;};'use strict';var Sequelize=require(_0xeb8d('0x0'));module[_0xeb8d('0x1')]={'name':{'type':Sequelize[_0xeb8d('0x2')]},'description':{'type':Sequelize[_0xeb8d('0x2')]},'username':{'type':Sequelize[_0xeb8d('0x2')],'unique':_0xeb8d('0x3')},'remoteUri':{'type':Sequelize[_0xeb8d('0x2')]},'password':{'type':Sequelize[_0xeb8d('0x2')]},'clientId':{'type':Sequelize[_0xeb8d('0x2')]},'clientSecret':{'type':Sequelize[_0xeb8d('0x2')]},'securityToken':{'type':Sequelize[_0xeb8d('0x2')]},'serverUrl':{'type':Sequelize[_0xeb8d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xeb8d('0x4')](_0xeb8d('0x5'),_0xeb8d('0x6')),'defaultValue':_0xeb8d('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 25a3c76..5d2f906 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 _0x25be=['find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','Subjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientSecret','password','securityToken','lastIndexOf','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','picklist','boolean','phone','remove','label','custom','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','SalesforceAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','rows','catch','show','params','keys'];(function(_0x55f380,_0x3e27f0){var _0x36b38e=function(_0x31bbc6){while(--_0x31bbc6){_0x55f380['push'](_0x55f380['shift']());}};_0x36b38e(++_0x3e27f0);}(_0x25be,0xa5));var _0xe25b=function(_0xae5ecc,_0x4653cc){_0xae5ecc=_0xae5ecc-0x0;var _0x4ee86c=_0x25be[_0xae5ecc];return _0x4ee86c;};'use strict';var emlformat=require(_0xe25b('0x0'));var rimraf=require(_0xe25b('0x1'));var zipdir=require(_0xe25b('0x2'));var jsonpatch=require(_0xe25b('0x3'));var rp=require(_0xe25b('0x4'));var moment=require(_0xe25b('0x5'));var BPromise=require(_0xe25b('0x6'));var Mustache=require(_0xe25b('0x7'));var util=require(_0xe25b('0x8'));var path=require(_0xe25b('0x9'));var sox=require('sox');var csv=require(_0xe25b('0xa'));var ejs=require(_0xe25b('0xb'));var fs=require('fs');var fs_extra=require(_0xe25b('0xc'));var _=require('lodash');var squel=require(_0xe25b('0xd'));var crypto=require('crypto');var jsforce=require(_0xe25b('0xe'));var deskjs=require(_0xe25b('0xf'));var toCsv=require(_0xe25b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe25b('0x10'));var authService=require(_0xe25b('0x11'));var qs=require(_0xe25b('0x12'));var as=require(_0xe25b('0x13'));var hardwareService=require(_0xe25b('0x14'));var logger=require('../../config/logger')(_0xe25b('0x15'));var utils=require(_0xe25b('0x16'));var config=require(_0xe25b('0x17'));var licenseUtil=require(_0xe25b('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe25b('0x19'));function respondWithStatusCode(_0x439163,_0x25c3a5){_0x25c3a5=_0x25c3a5||0xcc;return function(_0x290514){if(_0x290514){return _0x439163[_0xe25b('0x1a')](_0x25c3a5);}return _0x439163[_0xe25b('0x1b')](_0x25c3a5)['end']();};}function respondWithResult(_0xa19b0c,_0x41940e){_0x41940e=_0x41940e||0xc8;return function(_0x3cc833){if(_0x3cc833){return _0xa19b0c[_0xe25b('0x1b')](_0x41940e)[_0xe25b('0x1c')](_0x3cc833);}};}function respondWithFilteredResult(_0x236fa6,_0x683e5a){return function(_0x5983d4){if(_0x5983d4){var _0x569437=typeof _0x683e5a['offset']===_0xe25b('0x1d')&&typeof _0x683e5a[_0xe25b('0x1e')]===_0xe25b('0x1d');var _0x551878=_0x5983d4['count'];var _0x4573fc=_0x569437?0x0:_0x683e5a[_0xe25b('0x1f')];var _0x35cf32=_0x569437?_0x5983d4['count']:_0x683e5a[_0xe25b('0x1f')]+_0x683e5a[_0xe25b('0x1e')];var _0x29d4a5;if(_0x35cf32>=_0x551878){_0x35cf32=_0x551878;_0x29d4a5=0xc8;}else{_0x29d4a5=0xce;}_0x236fa6['status'](_0x29d4a5);return _0x236fa6[_0xe25b('0x20')](_0xe25b('0x21'),_0x4573fc+'-'+_0x35cf32+'/'+_0x551878)[_0xe25b('0x1c')](_0x5983d4);}return null;};}function patchUpdates(_0x52eb26){return function(_0x4564c1){try{jsonpatch[_0xe25b('0x22')](_0x4564c1,_0x52eb26,!![]);}catch(_0xa8f3fb){return BPromise[_0xe25b('0x23')](_0xa8f3fb);}return _0x4564c1['save']();};}function saveUpdates(_0x5f0c43,_0x58513c){return function(_0xfc141b){if(_0xfc141b){return _0xfc141b[_0xe25b('0x24')](_0x5f0c43)[_0xe25b('0x25')](function(_0x2d6a8f){return _0x2d6a8f;});}return null;};}function removeEntity(_0x23bbc4,_0xe2f690){return function(_0x3937e8){if(_0x3937e8){return _0x3937e8[_0xe25b('0x26')]()['then'](function(){_0x23bbc4[_0xe25b('0x1b')](0xcc)[_0xe25b('0x27')]();});}};}function handleEntityNotFound(_0x187751,_0x295ded){return function(_0x400b2e){if(!_0x400b2e){_0x187751['sendStatus'](0x194);}return _0x400b2e;};}function handleError(_0xaf22a1,_0x555ece){_0x555ece=_0x555ece||0x1f4;return function(_0x2e0137){logger[_0xe25b('0x28')](_0x2e0137['stack']);if(_0x2e0137[_0xe25b('0x29')]){delete _0x2e0137[_0xe25b('0x29')];}_0xaf22a1['status'](_0x555ece)[_0xe25b('0x2a')](_0x2e0137);};}exports['index']=function(_0x24dbec,_0x4f78d4){var _0x2ba53e={},_0x5a2851={},_0x27eb3b={'count':0x0,'rows':[]};var _0x3eee1c=_['map'](db[_0xe25b('0x2b')][_0xe25b('0x2c')],function(_0x327369){return{'name':_0x327369[_0xe25b('0x2d')],'type':_0x327369[_0xe25b('0x2e')][_0xe25b('0x2f')]};});_0x5a2851[_0xe25b('0x30')]=_[_0xe25b('0x31')](_0x3eee1c,_0xe25b('0x29'));_0x5a2851[_0xe25b('0x32')]=_['keys'](_0x24dbec['query']);_0x5a2851[_0xe25b('0x33')]=_[_0xe25b('0x34')](_0x5a2851['model'],_0x5a2851['query']);_0x2ba53e[_0xe25b('0x35')]=_['intersection'](_0x5a2851[_0xe25b('0x30')],qs[_0xe25b('0x36')](_0x24dbec[_0xe25b('0x32')]['fields']));_0x2ba53e[_0xe25b('0x35')]=_0x2ba53e['attributes'][_0xe25b('0x37')]?_0x2ba53e['attributes']:_0x5a2851[_0xe25b('0x30')];if(!_0x24dbec[_0xe25b('0x32')][_0xe25b('0x38')](_0xe25b('0x39'))){_0x2ba53e[_0xe25b('0x1e')]=qs['limit'](_0x24dbec['query'][_0xe25b('0x1e')]);_0x2ba53e['offset']=qs[_0xe25b('0x1f')](_0x24dbec[_0xe25b('0x32')][_0xe25b('0x1f')]);}_0x2ba53e[_0xe25b('0x3a')]=qs[_0xe25b('0x3b')](_0x24dbec[_0xe25b('0x32')][_0xe25b('0x3b')]);_0x2ba53e[_0xe25b('0x3c')]=qs[_0xe25b('0x33')](_[_0xe25b('0x3d')](_0x24dbec[_0xe25b('0x32')],_0x5a2851[_0xe25b('0x33')]),_0x3eee1c);if(_0x24dbec[_0xe25b('0x32')]['filter']){_0x2ba53e[_0xe25b('0x3c')]=_[_0xe25b('0x3e')](_0x2ba53e['where'],{'$or':_[_0xe25b('0x31')](_0x3eee1c,function(_0x2907b2){if(_0x2907b2[_0xe25b('0x2e')]!==_0xe25b('0x3f')){var _0x2704e8={};_0x2704e8[_0x2907b2[_0xe25b('0x29')]]={'$like':'%'+_0x24dbec[_0xe25b('0x32')][_0xe25b('0x40')]+'%'};return _0x2704e8;}})});}_0x2ba53e=_[_0xe25b('0x3e')]({},_0x2ba53e,_0x24dbec['options']);var _0x210f01={'where':_0x2ba53e['where']};return db[_0xe25b('0x2b')]['count'](_0x210f01)['then'](function(_0xd59ad9){_0x27eb3b[_0xe25b('0x41')]=_0xd59ad9;if(_0x24dbec[_0xe25b('0x32')][_0xe25b('0x42')]){_0x2ba53e[_0xe25b('0x43')]=[{'all':!![]}];}return db[_0xe25b('0x2b')]['findAll'](_0x2ba53e);})['then'](function(_0xca2af9){_0x27eb3b[_0xe25b('0x44')]=_0xca2af9;return _0x27eb3b;})['then'](respondWithFilteredResult(_0x4f78d4,_0x2ba53e))[_0xe25b('0x45')](handleError(_0x4f78d4,null));};exports[_0xe25b('0x46')]=function(_0x2ecc5e,_0x3dc009){var _0x4d563a={'raw':![],'where':{'id':_0x2ecc5e[_0xe25b('0x47')]['id']}},_0x3cbc2e={};_0x3cbc2e[_0xe25b('0x30')]=_[_0xe25b('0x48')](db[_0xe25b('0x2b')][_0xe25b('0x2c')]);_0x3cbc2e['query']=_['keys'](_0x2ecc5e[_0xe25b('0x32')]);_0x3cbc2e[_0xe25b('0x33')]=_['intersection'](_0x3cbc2e[_0xe25b('0x30')],_0x3cbc2e[_0xe25b('0x32')]);_0x4d563a[_0xe25b('0x35')]=_[_0xe25b('0x34')](_0x3cbc2e['model'],qs[_0xe25b('0x36')](_0x2ecc5e['query'][_0xe25b('0x36')]));_0x4d563a[_0xe25b('0x35')]=_0x4d563a['attributes']['length']?_0x4d563a[_0xe25b('0x35')]:_0x3cbc2e[_0xe25b('0x30')];if(_0x2ecc5e[_0xe25b('0x32')][_0xe25b('0x42')]){_0x4d563a[_0xe25b('0x43')]=[{'all':!![]}];}_0x4d563a=_[_0xe25b('0x3e')]({},_0x4d563a,_0x2ecc5e['options']);return db[_0xe25b('0x2b')][_0xe25b('0x49')](_0x4d563a)[_0xe25b('0x25')](handleEntityNotFound(_0x3dc009,null))[_0xe25b('0x25')](respondWithResult(_0x3dc009,null))[_0xe25b('0x45')](handleError(_0x3dc009,null));};exports[_0xe25b('0x4a')]=function(_0x5d9b1b,_0x12aec5){return db['SalesforceAccount'][_0xe25b('0x4a')](_0x5d9b1b[_0xe25b('0x4b')],{})[_0xe25b('0x25')](respondWithResult(_0x12aec5,0xc9))[_0xe25b('0x45')](handleError(_0x12aec5,null));};exports[_0xe25b('0x24')]=function(_0x17840a,_0x2e0346){if(_0x17840a['body']['id']){delete _0x17840a[_0xe25b('0x4b')]['id'];}return db[_0xe25b('0x2b')]['find']({'where':{'id':_0x17840a[_0xe25b('0x47')]['id']}})[_0xe25b('0x25')](handleEntityNotFound(_0x2e0346,null))[_0xe25b('0x25')](saveUpdates(_0x17840a[_0xe25b('0x4b')],null))[_0xe25b('0x25')](respondWithResult(_0x2e0346,null))['catch'](handleError(_0x2e0346,null));};exports[_0xe25b('0x26')]=function(_0x185dcc,_0x123f12){return db[_0xe25b('0x2b')][_0xe25b('0x49')]({'where':{'id':_0x185dcc[_0xe25b('0x47')]['id']}})[_0xe25b('0x25')](handleEntityNotFound(_0x123f12,null))[_0xe25b('0x25')](removeEntity(_0x123f12,null))[_0xe25b('0x45')](handleError(_0x123f12,null));};exports[_0xe25b('0x4c')]=function(_0x42191b,_0x127be4,_0x570b16){var _0x3056e2={};var _0x4c142d={};var _0x504bfa;var _0x591a31;return db[_0xe25b('0x2b')][_0xe25b('0x4d')]({'where':{'id':_0x42191b[_0xe25b('0x47')]['id']}})[_0xe25b('0x25')](handleEntityNotFound(_0x127be4,null))[_0xe25b('0x25')](function(_0x22b284){if(_0x22b284){_0x504bfa=_0x22b284;_0x4c142d['model']=_[_0xe25b('0x48')](db[_0xe25b('0x4e')][_0xe25b('0x2c')]);_0x4c142d['query']=_[_0xe25b('0x48')](_0x42191b[_0xe25b('0x32')]);_0x4c142d[_0xe25b('0x33')]=_[_0xe25b('0x34')](_0x4c142d['model'],_0x4c142d[_0xe25b('0x32')]);_0x3056e2['attributes']=_[_0xe25b('0x34')](_0x4c142d[_0xe25b('0x30')],qs['fields'](_0x42191b[_0xe25b('0x32')][_0xe25b('0x36')]));_0x3056e2[_0xe25b('0x35')]=_0x3056e2[_0xe25b('0x35')][_0xe25b('0x37')]?_0x3056e2['attributes']:_0x4c142d['model'];_0x3056e2[_0xe25b('0x3a')]=qs['sort'](_0x42191b[_0xe25b('0x32')][_0xe25b('0x3b')]);_0x3056e2[_0xe25b('0x3c')]=qs[_0xe25b('0x33')](_[_0xe25b('0x3d')](_0x42191b[_0xe25b('0x32')],_0x4c142d[_0xe25b('0x33')]));if(_0x42191b[_0xe25b('0x32')][_0xe25b('0x40')]){_0x3056e2[_0xe25b('0x3c')]=_[_0xe25b('0x3e')](_0x3056e2[_0xe25b('0x3c')],{'$or':_[_0xe25b('0x31')](_0x3056e2[_0xe25b('0x35')],function(_0xdab4a){var _0x5530d9={};_0x5530d9[_0xdab4a]={'$like':'%'+_0x42191b[_0xe25b('0x32')]['filter']+'%'};return _0x5530d9;})});}_0x3056e2=_[_0xe25b('0x3e')]({},_0x3056e2,_0x42191b['options']);return _0x504bfa[_0xe25b('0x4c')](_0x3056e2);}})[_0xe25b('0x25')](function(_0x3d491b){if(_0x3d491b){_0x591a31=_0x3d491b[_0xe25b('0x37')];if(!_0x42191b[_0xe25b('0x32')][_0xe25b('0x38')](_0xe25b('0x39'))){_0x3056e2[_0xe25b('0x1e')]=qs[_0xe25b('0x1e')](_0x42191b['query'][_0xe25b('0x1e')]);_0x3056e2[_0xe25b('0x1f')]=qs[_0xe25b('0x1f')](_0x42191b[_0xe25b('0x32')][_0xe25b('0x1f')]);}return _0x504bfa[_0xe25b('0x4c')](_0x3056e2);}})[_0xe25b('0x25')](function(_0x415372){if(_0x415372){return _0x415372?{'count':_0x591a31,'rows':_0x415372}:null;}})[_0xe25b('0x25')](respondWithResult(_0x127be4,null))[_0xe25b('0x45')](handleError(_0x127be4,null));};exports[_0xe25b('0x4f')]=function(_0x24a1cc,_0x3dd9af,_0x46b428){if(_0x24a1cc[_0xe25b('0x4b')]['id']){delete _0x24a1cc[_0xe25b('0x4b')]['id'];}return db[_0xe25b('0x2b')][_0xe25b('0x4d')]({'where':{'id':_0x24a1cc[_0xe25b('0x47')]['id']}})[_0xe25b('0x25')](handleEntityNotFound(_0x3dd9af,null))['then'](function(_0x4d3ca4){if(_0x4d3ca4){_0x24a1cc[_0xe25b('0x4b')]['AccountId']=_0x4d3ca4['id'];_0x24a1cc[_0xe25b('0x4b')][_0xe25b('0x50')]=integrations['getSubjects'](_0x24a1cc[_0xe25b('0x4b')]['channel'],_0x24a1cc[_0xe25b('0x4b')]['type']);_0x24a1cc[_0xe25b('0x4b')][_0xe25b('0x51')]=integrations[_0xe25b('0x52')](_0x24a1cc[_0xe25b('0x4b')][_0xe25b('0x53')],_0x24a1cc[_0xe25b('0x4b')][_0xe25b('0x2e')]);return db[_0xe25b('0x4e')][_0xe25b('0x4a')](_0x24a1cc[_0xe25b('0x4b')],{'include':[{'model':db[_0xe25b('0x54')],'as':_0xe25b('0x50')},{'model':db[_0xe25b('0x54')],'as':_0xe25b('0x51')}]});}return null;})[_0xe25b('0x25')](respondWithResult(_0x3dd9af,null))[_0xe25b('0x45')](handleError(_0x3dd9af,null));};exports[_0xe25b('0x55')]=function(_0x18900b,_0x3a4013,_0x1e244b){var _0x3e3552;var _0x327f13='';var _0x1d4c73=_0xe25b('0x56');return db['SalesforceAccount'][_0xe25b('0x4d')]({'where':{'id':_0x18900b[_0xe25b('0x47')]['id']},'attributes':['id',_0xe25b('0x57'),'clientId',_0xe25b('0x58'),'username',_0xe25b('0x59'),_0xe25b('0x5a')]})[_0xe25b('0x25')](handleEntityNotFound(_0x3a4013,null))[_0xe25b('0x25')](function(_0x479ec4){if(_0x479ec4){_0x327f13=_0x479ec4[_0xe25b('0x57')];var _0xd36ccb=_0x327f13['slice'](-0x1);if(_0xd36ccb==='/'){_0x327f13=_0x327f13['substring'](0x0,_0x327f13[_0xe25b('0x5b')](_0xd36ccb));}_0x3e3552=new jsforce['Connection']({'oauth2':{'loginUrl':_0x327f13,'clientId':_0x479ec4['clientId'],'clientSecret':_0x479ec4[_0xe25b('0x58')]}});return _0x3e3552[_0xe25b('0x5c')](_0x479ec4['username'],_0x479ec4[_0xe25b('0x59')][_0xe25b('0x5d')](_0x479ec4[_0xe25b('0x5a')]));}})['then'](function(_0x32287c){if(_0x32287c){if(!_[_0xe25b('0x5e')](_0x18900b['query'][_0xe25b('0x5f')])){_0x1d4c73=_0x18900b[_0xe25b('0x32')][_0xe25b('0x5f')];}return _0x3e3552[_0xe25b('0x60')](_0x1d4c73)[_0xe25b('0x61')]();}})['then'](function(_0x12876c){var _0x2700cf=[_0xe25b('0x62'),_0xe25b('0x63'),_0xe25b('0x64'),_0xe25b('0x65'),'Subject',_0xe25b('0x66')];var _0x5db3b3=[_0xe25b('0x67'),'int',_0xe25b('0x68'),_0xe25b('0x69'),'email','textarea',_0xe25b('0x6a')];if(_0x12876c){_[_0xe25b('0x6b')](_0x12876c[_0xe25b('0x36')],function(_0x7b43f8){return _0x2700cf['includes'](_0x7b43f8[_0xe25b('0x29')])||!_0x5db3b3['includes'](_0x7b43f8[_0xe25b('0x2e')]);});return{'count':_0x12876c[_0xe25b('0x36')][_0xe25b('0x37')],'rows':_['map'](_0x12876c[_0xe25b('0x36')],function(_0x2f6a3a){return{'id':_0x2f6a3a['name'],'name':_0x2f6a3a[_0xe25b('0x6c')],'custom':_0x2f6a3a[_0xe25b('0x6d')],'options':_0x2f6a3a['picklistValues']['length']>0x0?_[_0xe25b('0x31')](_0x2f6a3a['picklistValues'],function(_0x35e3fc){return{'name':_0x35e3fc[_0xe25b('0x6c')],'value':_0x35e3fc[_0xe25b('0x6e')]};}):_0x2f6a3a[_0xe25b('0x2e')]==_0xe25b('0x69')?[{'name':_0xe25b('0x6f'),'value':_0xe25b('0x70')},{'name':_0xe25b('0x71'),'value':_0xe25b('0x72')}]:[]};})};}})[_0xe25b('0x25')](respondWithResult(_0x3a4013,null))[_0xe25b('0x45')](function(_0x3118e8){var _0x531f78=_0x18900b[_0xe25b('0x32')][_0xe25b('0x73')]?0x1f4:_0x3118e8[_0xe25b('0x74')]||0x1f4;logger[_0xe25b('0x28')](_0xe25b('0x75'),_0xe25b('0x55'),_0x531f78,JSON['stringify'](_0x3118e8));delete _0x3118e8[_0xe25b('0x29')];if(_0x531f78===0x191){_0x531f78=0x190;}_0x3a4013[_0xe25b('0x1b')](_0x531f78)[_0xe25b('0x2a')](_0x18900b['query'][_0xe25b('0x73')]?{'message':_0xe25b('0x76'),'statusCode':_0x3118e8[_0xe25b('0x74')]}:_0x3118e8);});}; \ No newline at end of file +var _0x9f6a=['reject','save','then','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','attributes','intersection','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','keys','filters','fields','length','include','find','create','body','update','destroy','params','findOne','SalesforceConfiguration','nolimit','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','Task','remoteUri','clientId','clientSecret','username','slice','substring','Connection','login','password','securityToken','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','textarea','remove','includes','custom','picklistValues','label','value','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','moment','bluebird','path','sox','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/license/util','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9f6a,0x14c));var _0xa9f6=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x9f6a[_0x10f6e8];return _0x35bb3c;};'use strict';var emlformat=require(_0xa9f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9f6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa9f6('0x2'));var BPromise=require(_0xa9f6('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa9f6('0x4'));var sox=require(_0xa9f6('0x5'));var csv=require('to-csv');var ejs=require(_0xa9f6('0x6'));var fs=require('fs');var fs_extra=require(_0xa9f6('0x7'));var _=require(_0xa9f6('0x8'));var squel=require(_0xa9f6('0x9'));var crypto=require(_0xa9f6('0xa'));var jsforce=require(_0xa9f6('0xb'));var deskjs=require(_0xa9f6('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9f6('0xd'));var Papa=require(_0xa9f6('0xe'));var Redis=require('ioredis');var authService=require(_0xa9f6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa9f6('0x10'));var hardwareService=require(_0xa9f6('0x11'));var logger=require(_0xa9f6('0x12'))(_0xa9f6('0x13'));var utils=require(_0xa9f6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa9f6('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa9f6('0x16'));function respondWithStatusCode(_0x3391d4,_0xcb1cf4){_0xcb1cf4=_0xcb1cf4||0xcc;return function(_0x272832){if(_0x272832){return _0x3391d4[_0xa9f6('0x17')](_0xcb1cf4);}return _0x3391d4['status'](_0xcb1cf4)[_0xa9f6('0x18')]();};}function respondWithResult(_0x201b8a,_0x478a49){_0x478a49=_0x478a49||0xc8;return function(_0x2aef08){if(_0x2aef08){return _0x201b8a[_0xa9f6('0x19')](_0x478a49)['json'](_0x2aef08);}};}function respondWithFilteredResult(_0x332c28,_0xbe3c14){return function(_0x478c3d){if(_0x478c3d){var _0x3991c8=typeof _0xbe3c14[_0xa9f6('0x1a')]===_0xa9f6('0x1b')&&typeof _0xbe3c14['limit']===_0xa9f6('0x1b');var _0x5b2f0b=_0x478c3d[_0xa9f6('0x1c')];var _0x4eb4c0=_0x3991c8?0x0:_0xbe3c14[_0xa9f6('0x1a')];var _0x196c85=_0x3991c8?_0x478c3d[_0xa9f6('0x1c')]:_0xbe3c14[_0xa9f6('0x1a')]+_0xbe3c14[_0xa9f6('0x1d')];var _0x5872f8;if(_0x196c85>=_0x5b2f0b){_0x196c85=_0x5b2f0b;_0x5872f8=0xc8;}else{_0x5872f8=0xce;}_0x332c28[_0xa9f6('0x19')](_0x5872f8);return _0x332c28[_0xa9f6('0x1e')](_0xa9f6('0x1f'),_0x4eb4c0+'-'+_0x196c85+'/'+_0x5b2f0b)[_0xa9f6('0x20')](_0x478c3d);}return null;};}function patchUpdates(_0x592eba){return function(_0x4864ad){try{jsonpatch[_0xa9f6('0x21')](_0x4864ad,_0x592eba,!![]);}catch(_0x5dee2a){return BPromise[_0xa9f6('0x22')](_0x5dee2a);}return _0x4864ad[_0xa9f6('0x23')]();};}function saveUpdates(_0x3e7e99,_0x2c12f9){return function(_0x39a1c2){if(_0x39a1c2){return _0x39a1c2['update'](_0x3e7e99)['then'](function(_0x3d8984){return _0x3d8984;});}return null;};}function removeEntity(_0x3781ca,_0x30ad15){return function(_0x17e2de){if(_0x17e2de){return _0x17e2de['destroy']()[_0xa9f6('0x24')](function(){_0x3781ca[_0xa9f6('0x19')](0xcc)[_0xa9f6('0x18')]();});}};}function handleEntityNotFound(_0x11baaf,_0x449a23){return function(_0x73655d){if(!_0x73655d){_0x11baaf[_0xa9f6('0x17')](0x194);}return _0x73655d;};}function handleError(_0x41f3fa,_0x1fba01){_0x1fba01=_0x1fba01||0x1f4;return function(_0x237ccf){logger['error'](_0x237ccf[_0xa9f6('0x25')]);if(_0x237ccf[_0xa9f6('0x26')]){delete _0x237ccf[_0xa9f6('0x26')];}_0x41f3fa[_0xa9f6('0x19')](_0x1fba01)['send'](_0x237ccf);};}exports[_0xa9f6('0x27')]=function(_0x33d02a,_0xaabd8a){var _0x11be91={},_0x3ce3cd={},_0x3bd3b1={'count':0x0,'rows':[]};var _0x125923=_[_0xa9f6('0x28')](db[_0xa9f6('0x29')][_0xa9f6('0x2a')],function(_0x5b54b2){return{'name':_0x5b54b2[_0xa9f6('0x2b')],'type':_0x5b54b2[_0xa9f6('0x2c')]['key']};});_0x3ce3cd[_0xa9f6('0x2d')]=_[_0xa9f6('0x28')](_0x125923,'name');_0x3ce3cd[_0xa9f6('0x2e')]=_['keys'](_0x33d02a['query']);_0x3ce3cd['filters']=_['intersection'](_0x3ce3cd[_0xa9f6('0x2d')],_0x3ce3cd[_0xa9f6('0x2e')]);_0x11be91[_0xa9f6('0x2f')]=_[_0xa9f6('0x30')](_0x3ce3cd[_0xa9f6('0x2d')],qs['fields'](_0x33d02a[_0xa9f6('0x2e')]['fields']));_0x11be91[_0xa9f6('0x2f')]=_0x11be91['attributes']['length']?_0x11be91[_0xa9f6('0x2f')]:_0x3ce3cd[_0xa9f6('0x2d')];if(!_0x33d02a['query']['hasOwnProperty']('nolimit')){_0x11be91[_0xa9f6('0x1d')]=qs[_0xa9f6('0x1d')](_0x33d02a[_0xa9f6('0x2e')][_0xa9f6('0x1d')]);_0x11be91[_0xa9f6('0x1a')]=qs[_0xa9f6('0x1a')](_0x33d02a[_0xa9f6('0x2e')][_0xa9f6('0x1a')]);}_0x11be91[_0xa9f6('0x31')]=qs[_0xa9f6('0x32')](_0x33d02a[_0xa9f6('0x2e')]['sort']);_0x11be91[_0xa9f6('0x33')]=qs['filters'](_[_0xa9f6('0x34')](_0x33d02a['query'],_0x3ce3cd['filters']),_0x125923);if(_0x33d02a[_0xa9f6('0x2e')][_0xa9f6('0x35')]){_0x11be91[_0xa9f6('0x33')]=_[_0xa9f6('0x36')](_0x11be91[_0xa9f6('0x33')],{'$or':_['map'](_0x125923,function(_0x19aa0e){if(_0x19aa0e[_0xa9f6('0x2c')]!==_0xa9f6('0x37')){var _0x533436={};_0x533436[_0x19aa0e[_0xa9f6('0x26')]]={'$like':'%'+_0x33d02a['query'][_0xa9f6('0x35')]+'%'};return _0x533436;}})});}_0x11be91=_[_0xa9f6('0x36')]({},_0x11be91,_0x33d02a[_0xa9f6('0x38')]);var _0x13e2bc={'where':_0x11be91['where']};return db[_0xa9f6('0x29')]['count'](_0x13e2bc)['then'](function(_0x4aae30){_0x3bd3b1['count']=_0x4aae30;if(_0x33d02a[_0xa9f6('0x2e')][_0xa9f6('0x39')]){_0x11be91['include']=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x11be91);})[_0xa9f6('0x24')](function(_0x1ce237){_0x3bd3b1[_0xa9f6('0x3a')]=_0x1ce237;return _0x3bd3b1;})[_0xa9f6('0x24')](respondWithFilteredResult(_0xaabd8a,_0x11be91))[_0xa9f6('0x3b')](handleError(_0xaabd8a,null));};exports[_0xa9f6('0x3c')]=function(_0xd794e2,_0x4e4e0d){var _0x14d033={'raw':![],'where':{'id':_0xd794e2['params']['id']}},_0x3868b5={};_0x3868b5[_0xa9f6('0x2d')]=_[_0xa9f6('0x3d')](db[_0xa9f6('0x29')][_0xa9f6('0x2a')]);_0x3868b5['query']=_[_0xa9f6('0x3d')](_0xd794e2[_0xa9f6('0x2e')]);_0x3868b5[_0xa9f6('0x3e')]=_[_0xa9f6('0x30')](_0x3868b5[_0xa9f6('0x2d')],_0x3868b5[_0xa9f6('0x2e')]);_0x14d033['attributes']=_['intersection'](_0x3868b5['model'],qs['fields'](_0xd794e2[_0xa9f6('0x2e')][_0xa9f6('0x3f')]));_0x14d033[_0xa9f6('0x2f')]=_0x14d033[_0xa9f6('0x2f')][_0xa9f6('0x40')]?_0x14d033[_0xa9f6('0x2f')]:_0x3868b5['model'];if(_0xd794e2[_0xa9f6('0x2e')][_0xa9f6('0x39')]){_0x14d033[_0xa9f6('0x41')]=[{'all':!![]}];}_0x14d033=_[_0xa9f6('0x36')]({},_0x14d033,_0xd794e2[_0xa9f6('0x38')]);return db[_0xa9f6('0x29')][_0xa9f6('0x42')](_0x14d033)[_0xa9f6('0x24')](handleEntityNotFound(_0x4e4e0d,null))[_0xa9f6('0x24')](respondWithResult(_0x4e4e0d,null))[_0xa9f6('0x3b')](handleError(_0x4e4e0d,null));};exports[_0xa9f6('0x43')]=function(_0x10579e,_0x5067c3){return db[_0xa9f6('0x29')][_0xa9f6('0x43')](_0x10579e[_0xa9f6('0x44')],{})[_0xa9f6('0x24')](respondWithResult(_0x5067c3,0xc9))['catch'](handleError(_0x5067c3,null));};exports[_0xa9f6('0x45')]=function(_0x7428ad,_0x192ebc){if(_0x7428ad['body']['id']){delete _0x7428ad[_0xa9f6('0x44')]['id'];}return db[_0xa9f6('0x29')][_0xa9f6('0x42')]({'where':{'id':_0x7428ad['params']['id']}})['then'](handleEntityNotFound(_0x192ebc,null))['then'](saveUpdates(_0x7428ad[_0xa9f6('0x44')],null))[_0xa9f6('0x24')](respondWithResult(_0x192ebc,null))['catch'](handleError(_0x192ebc,null));};exports[_0xa9f6('0x46')]=function(_0x177588,_0x5ca0a8){return db[_0xa9f6('0x29')]['find']({'where':{'id':_0x177588[_0xa9f6('0x47')]['id']}})[_0xa9f6('0x24')](handleEntityNotFound(_0x5ca0a8,null))[_0xa9f6('0x24')](removeEntity(_0x5ca0a8,null))[_0xa9f6('0x3b')](handleError(_0x5ca0a8,null));};exports['getConfigurations']=function(_0x134d2d,_0x4c9a4d,_0x260109){var _0x38deec={};var _0x8a8a67={};var _0x56b534;var _0x2f2948;return db[_0xa9f6('0x29')][_0xa9f6('0x48')]({'where':{'id':_0x134d2d['params']['id']}})[_0xa9f6('0x24')](handleEntityNotFound(_0x4c9a4d,null))[_0xa9f6('0x24')](function(_0x30c6ac){if(_0x30c6ac){_0x56b534=_0x30c6ac;_0x8a8a67[_0xa9f6('0x2d')]=_[_0xa9f6('0x3d')](db[_0xa9f6('0x49')]['rawAttributes']);_0x8a8a67[_0xa9f6('0x2e')]=_[_0xa9f6('0x3d')](_0x134d2d[_0xa9f6('0x2e')]);_0x8a8a67['filters']=_[_0xa9f6('0x30')](_0x8a8a67['model'],_0x8a8a67[_0xa9f6('0x2e')]);_0x38deec[_0xa9f6('0x2f')]=_[_0xa9f6('0x30')](_0x8a8a67[_0xa9f6('0x2d')],qs[_0xa9f6('0x3f')](_0x134d2d[_0xa9f6('0x2e')]['fields']));_0x38deec[_0xa9f6('0x2f')]=_0x38deec[_0xa9f6('0x2f')]['length']?_0x38deec[_0xa9f6('0x2f')]:_0x8a8a67[_0xa9f6('0x2d')];_0x38deec[_0xa9f6('0x31')]=qs[_0xa9f6('0x32')](_0x134d2d['query'][_0xa9f6('0x32')]);_0x38deec[_0xa9f6('0x33')]=qs[_0xa9f6('0x3e')](_[_0xa9f6('0x34')](_0x134d2d['query'],_0x8a8a67[_0xa9f6('0x3e')]));if(_0x134d2d[_0xa9f6('0x2e')][_0xa9f6('0x35')]){_0x38deec[_0xa9f6('0x33')]=_[_0xa9f6('0x36')](_0x38deec[_0xa9f6('0x33')],{'$or':_[_0xa9f6('0x28')](_0x38deec['attributes'],function(_0x3a49a7){var _0x165536={};_0x165536[_0x3a49a7]={'$like':'%'+_0x134d2d[_0xa9f6('0x2e')][_0xa9f6('0x35')]+'%'};return _0x165536;})});}_0x38deec=_['merge']({},_0x38deec,_0x134d2d['options']);return _0x56b534['getConfigurations'](_0x38deec);}})[_0xa9f6('0x24')](function(_0x2bb7b0){if(_0x2bb7b0){_0x2f2948=_0x2bb7b0[_0xa9f6('0x40')];if(!_0x134d2d['query']['hasOwnProperty'](_0xa9f6('0x4a'))){_0x38deec[_0xa9f6('0x1d')]=qs[_0xa9f6('0x1d')](_0x134d2d[_0xa9f6('0x2e')][_0xa9f6('0x1d')]);_0x38deec['offset']=qs[_0xa9f6('0x1a')](_0x134d2d[_0xa9f6('0x2e')][_0xa9f6('0x1a')]);}return _0x56b534[_0xa9f6('0x4b')](_0x38deec);}})[_0xa9f6('0x24')](function(_0x22995b){if(_0x22995b){return _0x22995b?{'count':_0x2f2948,'rows':_0x22995b}:null;}})[_0xa9f6('0x24')](respondWithResult(_0x4c9a4d,null))[_0xa9f6('0x3b')](handleError(_0x4c9a4d,null));};exports[_0xa9f6('0x4c')]=function(_0x3b2466,_0x1901d1,_0x1f3188){if(_0x3b2466[_0xa9f6('0x44')]['id']){delete _0x3b2466['body']['id'];}return db[_0xa9f6('0x29')][_0xa9f6('0x48')]({'where':{'id':_0x3b2466[_0xa9f6('0x47')]['id']}})[_0xa9f6('0x24')](handleEntityNotFound(_0x1901d1,null))[_0xa9f6('0x24')](function(_0xc05f67){if(_0xc05f67){_0x3b2466[_0xa9f6('0x44')][_0xa9f6('0x4d')]=_0xc05f67['id'];_0x3b2466[_0xa9f6('0x44')][_0xa9f6('0x4e')]=integrations[_0xa9f6('0x4f')](_0x3b2466[_0xa9f6('0x44')][_0xa9f6('0x50')],_0x3b2466[_0xa9f6('0x44')]['type']);_0x3b2466[_0xa9f6('0x44')]['Descriptions']=integrations[_0xa9f6('0x51')](_0x3b2466['body'][_0xa9f6('0x50')],_0x3b2466[_0xa9f6('0x44')][_0xa9f6('0x2c')]);return db[_0xa9f6('0x49')][_0xa9f6('0x43')](_0x3b2466[_0xa9f6('0x44')],{'include':[{'model':db[_0xa9f6('0x52')],'as':'Subjects'},{'model':db[_0xa9f6('0x52')],'as':_0xa9f6('0x53')}]});}return null;})['then'](respondWithResult(_0x1901d1,null))[_0xa9f6('0x3b')](handleError(_0x1901d1,null));};exports['getFields']=function(_0x379b42,_0x235426,_0x5b3187){var _0x24f698;var _0x2a057a='';var _0x35e728=_0xa9f6('0x54');return db['SalesforceAccount'][_0xa9f6('0x48')]({'where':{'id':_0x379b42[_0xa9f6('0x47')]['id']},'attributes':['id',_0xa9f6('0x55'),_0xa9f6('0x56'),_0xa9f6('0x57'),_0xa9f6('0x58'),'password','securityToken']})['then'](handleEntityNotFound(_0x235426,null))[_0xa9f6('0x24')](function(_0x323375){if(_0x323375){_0x2a057a=_0x323375[_0xa9f6('0x55')];var _0x3837bc=_0x2a057a[_0xa9f6('0x59')](-0x1);if(_0x3837bc==='/'){_0x2a057a=_0x2a057a[_0xa9f6('0x5a')](0x0,_0x2a057a['lastIndexOf'](_0x3837bc));}_0x24f698=new jsforce[(_0xa9f6('0x5b'))]({'oauth2':{'loginUrl':_0x2a057a,'clientId':_0x323375[_0xa9f6('0x56')],'clientSecret':_0x323375[_0xa9f6('0x57')]}});return _0x24f698[_0xa9f6('0x5c')](_0x323375[_0xa9f6('0x58')],_0x323375[_0xa9f6('0x5d')]['concat'](_0x323375[_0xa9f6('0x5e')]));}})[_0xa9f6('0x24')](function(_0x242299){if(_0x242299){if(!_['isNil'](_0x379b42[_0xa9f6('0x2e')][_0xa9f6('0x5f')])){_0x35e728=_0x379b42['query'][_0xa9f6('0x5f')];}return _0x24f698[_0xa9f6('0x60')](_0x35e728)['describe']();}})[_0xa9f6('0x24')](function(_0x589314){var _0x97fd0f=[_0xa9f6('0x61'),_0xa9f6('0x62'),_0xa9f6('0x63'),_0xa9f6('0x64'),_0xa9f6('0x65'),_0xa9f6('0x66')];var _0x5ecf4a=[_0xa9f6('0x67'),_0xa9f6('0x68'),_0xa9f6('0x69'),_0xa9f6('0x6a'),'email',_0xa9f6('0x6b'),'phone'];if(_0x589314){_[_0xa9f6('0x6c')](_0x589314['fields'],function(_0x95ad31){return _0x97fd0f[_0xa9f6('0x6d')](_0x95ad31['name'])||!_0x5ecf4a[_0xa9f6('0x6d')](_0x95ad31[_0xa9f6('0x2c')]);});return{'count':_0x589314[_0xa9f6('0x3f')][_0xa9f6('0x40')],'rows':_[_0xa9f6('0x28')](_0x589314['fields'],function(_0x44124a){return{'id':_0x44124a[_0xa9f6('0x26')],'name':_0x44124a['label'],'custom':_0x44124a[_0xa9f6('0x6e')],'options':_0x44124a[_0xa9f6('0x6f')][_0xa9f6('0x40')]>0x0?_[_0xa9f6('0x28')](_0x44124a[_0xa9f6('0x6f')],function(_0xb36b9f){return{'name':_0xb36b9f[_0xa9f6('0x70')],'value':_0xb36b9f[_0xa9f6('0x71')]};}):_0x44124a[_0xa9f6('0x2c')]==_0xa9f6('0x6a')?[{'name':_0xa9f6('0x72'),'value':_0xa9f6('0x73')},{'name':'False','value':_0xa9f6('0x74')}]:[]};})};}})[_0xa9f6('0x24')](respondWithResult(_0x235426,null))[_0xa9f6('0x3b')](function(_0x5d6549){var _0x106049=_0x379b42[_0xa9f6('0x2e')][_0xa9f6('0x75')]?0x1f4:_0x5d6549[_0xa9f6('0x76')]||0x1f4;logger['error'](_0xa9f6('0x77'),'getFields',_0x106049,JSON[_0xa9f6('0x78')](_0x5d6549));delete _0x5d6549['name'];if(_0x106049===0x191){_0x106049=0x190;}_0x235426[_0xa9f6('0x19')](_0x106049)['send'](_0x379b42[_0xa9f6('0x2e')][_0xa9f6('0x75')]?{'message':_0xa9f6('0x79'),'statusCode':_0x5d6549[_0xa9f6('0x76')]}:_0x5d6549);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index ad6eaa5..41b8aab 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 _0xac8b=['path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x730a77,_0x1f7e7b){var _0x550737=function(_0x524008){while(--_0x524008){_0x730a77['push'](_0x730a77['shift']());}};_0x550737(++_0x1f7e7b);}(_0xac8b,0x1c2));var _0xbac8=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xac8b[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xbac8('0x0'));var logger=require(_0xbac8('0x1'))('api');var moment=require(_0xbac8('0x2'));var BPromise=require(_0xbac8('0x3'));var rp=require(_0xbac8('0x4'));var fs=require('fs');var path=require(_0xbac8('0x5'));var rimraf=require(_0xbac8('0x6'));var config=require(_0xbac8('0x7'));var attributes=require(_0xbac8('0x8'));var integrations=require(_0xbac8('0x9'));module[_0xbac8('0xa')]=function(_0x2c9733,_0x1a5001){return _0x2c9733[_0xbac8('0xb')](_0xbac8('0xc'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b59=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount'];(function(_0x319997,_0x96e431){var _0x3a9e70=function(_0xbd170b){while(--_0xbd170b){_0x319997['push'](_0x319997['shift']());}};_0x3a9e70(++_0x96e431);}(_0x3b59,0x9c));var _0x93b5=function(_0x10a951,_0x5da875){_0x10a951=_0x10a951-0x0;var _0x6da0d=_0x3b59[_0x10a951];return _0x6da0d;};'use strict';var _=require(_0x93b5('0x0'));var util=require(_0x93b5('0x1'));var logger=require(_0x93b5('0x2'))(_0x93b5('0x3'));var moment=require(_0x93b5('0x4'));var BPromise=require(_0x93b5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x93b5('0x6'));var rimraf=require('rimraf');var config=require(_0x93b5('0x7'));var attributes=require(_0x93b5('0x8'));var integrations=require(_0x93b5('0x9'));module[_0x93b5('0xa')]=function(_0x5665a9,_0x3ecbe3){return _0x5665a9[_0x93b5('0xb')](_0x93b5('0xc'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 171c56a..7b7cb67 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 _0x79fb=['attributes','then','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','include','map','model'];(function(_0x1b659d,_0x21c2e6){var _0x20fd8f=function(_0x4c70fc){while(--_0x4c70fc){_0x1b659d['push'](_0x1b659d['shift']());}};_0x20fd8f(++_0x21c2e6);}(_0x79fb,0xb2));var _0xb79f=function(_0x3efe71,_0x43e88a){_0x3efe71=_0x3efe71-0x0;var _0x4c74be=_0x79fb[_0x3efe71];return _0x4c74be;};'use strict';var _=require(_0xb79f('0x0'));var util=require(_0xb79f('0x1'));var moment=require(_0xb79f('0x2'));var BPromise=require(_0xb79f('0x3'));var rs=require(_0xb79f('0x4'));var fs=require('fs');var Redis=require(_0xb79f('0x5'));var db=require(_0xb79f('0x6'))['db'];var utils=require(_0xb79f('0x7'));var logger=require(_0xb79f('0x8'))('rpc');var config=require(_0xb79f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb79f('0xa')][_0xb79f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46aa95,_0x592c28,_0x5a9dc7){return new BPromise(function(_0x319734,_0xa151cb){return client[_0xb79f('0xc')](_0x46aa95,_0x5a9dc7)['then'](function(_0x204703){logger[_0xb79f('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x592c28,'request\x20sent');logger[_0xb79f('0xe')](_0xb79f('0xf'),_0x592c28,'request\x20sent',JSON[_0xb79f('0x10')](_0x204703));if(_0x204703[_0xb79f('0x11')]){if(_0x204703[_0xb79f('0x11')]['code']===0x1f4){logger['error'](_0xb79f('0x12'),_0x592c28,_0x204703[_0xb79f('0x11')][_0xb79f('0x13')]);return _0xa151cb(_0x204703['error'][_0xb79f('0x13')]);}logger['error'](_0xb79f('0x12'),_0x592c28,_0x204703[_0xb79f('0x11')]['message']);return _0x319734(_0x204703[_0xb79f('0x11')]['message']);}else{logger[_0xb79f('0xd')](_0xb79f('0x12'),_0x592c28,_0xb79f('0x14'));_0x319734(_0x204703[_0xb79f('0x15')][_0xb79f('0x13')]);}})[_0xb79f('0x16')](function(_0x1c0054){logger[_0xb79f('0x11')](_0xb79f('0x12'),_0x592c28,_0x1c0054);_0xa151cb(_0x1c0054);});});}exports[_0xb79f('0x17')]=function(_0x22c7f8){var _0x1b99dc=this;return new Promise(function(_0x471c05,_0x112129){return db[_0xb79f('0x18')][_0xb79f('0x19')]({'raw':_0x22c7f8[_0xb79f('0x1a')]?_0x22c7f8[_0xb79f('0x1a')][_0xb79f('0x1b')]===undefined?!![]:![]:!![],'where':_0x22c7f8[_0xb79f('0x1a')]?_0x22c7f8[_0xb79f('0x1a')][_0xb79f('0x1c')]||null:null,'attributes':_0x22c7f8[_0xb79f('0x1a')]?_0x22c7f8[_0xb79f('0x1a')]['attributes']||null:null,'limit':_0x22c7f8['options']?_0x22c7f8[_0xb79f('0x1a')]['limit']||null:null,'include':_0x22c7f8[_0xb79f('0x1a')]?_0x22c7f8['options'][_0xb79f('0x1d')]?_[_0xb79f('0x1e')](_0x22c7f8[_0xb79f('0x1a')][_0xb79f('0x1d')],function(_0x332175){return{'model':db[_0x332175[_0xb79f('0x1f')]],'as':_0x332175['as'],'attributes':_0x332175['attributes'],'include':_0x332175[_0xb79f('0x1d')]?_['map'](_0x332175['include'],function(_0xa52fbc){return{'model':db[_0xa52fbc[_0xb79f('0x1f')]],'as':_0xa52fbc['as'],'attributes':_0xa52fbc['attributes'],'include':_0xa52fbc['include']?_[_0xb79f('0x1e')](_0xa52fbc[_0xb79f('0x1d')],function(_0x53765b){return{'model':db[_0x53765b[_0xb79f('0x1f')]],'as':_0x53765b['as'],'attributes':_0x53765b[_0xb79f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb79f('0x21')](function(_0x4c6171){logger[_0xb79f('0xd')]('GetSalesforceAccount',_0x22c7f8);logger[_0xb79f('0xe')](_0xb79f('0x17'),_0x22c7f8,JSON['stringify'](_0x4c6171));_0x471c05(_0x4c6171);})[_0xb79f('0x16')](function(_0x293482){logger['error'](_0xb79f('0x17'),_0x293482[_0xb79f('0x13')],_0x22c7f8);_0x112129(_0x1b99dc[_0xb79f('0x11')](0x1f4,_0x293482['message']));});});};exports[_0xb79f('0x22')]=function(_0xe694a){var _0x53ba53=this;return new Promise(function(_0x476d12,_0x278f48){return db[_0xb79f('0x18')]['find']({'raw':_0xe694a['options']?_0xe694a[_0xb79f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xe694a['options']?_0xe694a[_0xb79f('0x1a')][_0xb79f('0x1c')]||null:null,'attributes':_0xe694a[_0xb79f('0x1a')]?_0xe694a['options']['attributes']||null:null,'include':_0xe694a[_0xb79f('0x1a')]?_0xe694a[_0xb79f('0x1a')]['include']?_['map'](_0xe694a[_0xb79f('0x1a')][_0xb79f('0x1d')],function(_0x524859){return{'model':db[_0x524859['model']],'as':_0x524859['as'],'attributes':_0x524859[_0xb79f('0x20')],'include':_0x524859[_0xb79f('0x1d')]?_['map'](_0x524859[_0xb79f('0x1d')],function(_0x2b64e8){return{'model':db[_0x2b64e8['model']],'as':_0x2b64e8['as'],'attributes':_0x2b64e8['attributes'],'include':_0x2b64e8[_0xb79f('0x1d')]?_['map'](_0x2b64e8[_0xb79f('0x1d')],function(_0x381c71){return{'model':db[_0x381c71[_0xb79f('0x1f')]],'as':_0x381c71['as'],'attributes':_0x381c71[_0xb79f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb79f('0x21')](function(_0x5cb86d){logger[_0xb79f('0xd')](_0xb79f('0x22'),_0xe694a);logger['debug']('ShowSalesforceAccount',_0xe694a,JSON[_0xb79f('0x10')](_0x5cb86d));_0x476d12(_0x5cb86d);})['catch'](function(_0x27ddfb){logger['error'](_0xb79f('0x22'),_0x27ddfb[_0xb79f('0x13')],_0xe694a);_0x278f48(_0x53ba53[_0xb79f('0x11')](0x1f4,_0x27ddfb[_0xb79f('0x13')]));});});}; \ No newline at end of file +var _0xbdd7=['request','then','info','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','GetSalesforceAccount','findAll','options','where','attributes','limit','include','map','model','catch','ShowSalesforceAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbdd7,0x174));var _0x7bdd=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbdd7[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7bdd('0x0'));var util=require(_0x7bdd('0x1'));var moment=require(_0x7bdd('0x2'));var BPromise=require(_0x7bdd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bdd('0x4'));var db=require(_0x7bdd('0x5'))['db'];var utils=require(_0x7bdd('0x6'));var logger=require(_0x7bdd('0x7'))(_0x7bdd('0x8'));var config=require(_0x7bdd('0x9'));var jayson=require(_0x7bdd('0xa'));var client=jayson[_0x7bdd('0xb')][_0x7bdd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x229047,_0x1fbf40,_0x58ad87){return new BPromise(function(_0x349936,_0x3332f4){return client[_0x7bdd('0xd')](_0x229047,_0x58ad87)[_0x7bdd('0xe')](function(_0x11fa8a){logger[_0x7bdd('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x1fbf40,'request\x20sent');logger[_0x7bdd('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x1fbf40,'request\x20sent',JSON[_0x7bdd('0x11')](_0x11fa8a));if(_0x11fa8a[_0x7bdd('0x12')]){if(_0x11fa8a[_0x7bdd('0x12')][_0x7bdd('0x13')]===0x1f4){logger[_0x7bdd('0x12')](_0x7bdd('0x14'),_0x1fbf40,_0x11fa8a[_0x7bdd('0x12')]['message']);return _0x3332f4(_0x11fa8a[_0x7bdd('0x12')][_0x7bdd('0x15')]);}logger[_0x7bdd('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x1fbf40,_0x11fa8a['error'][_0x7bdd('0x15')]);return _0x349936(_0x11fa8a[_0x7bdd('0x12')]['message']);}else{logger[_0x7bdd('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x1fbf40,'request\x20sent');_0x349936(_0x11fa8a['result'][_0x7bdd('0x15')]);}})['catch'](function(_0x3780f1){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x1fbf40,_0x3780f1);_0x3332f4(_0x3780f1);});});}exports[_0x7bdd('0x16')]=function(_0x5313b0){var _0x2af3c8=this;return new Promise(function(_0x43063a,_0x586e1f){return db['SalesforceAccount'][_0x7bdd('0x17')]({'raw':_0x5313b0['options']?_0x5313b0['options']['raw']===undefined?!![]:![]:!![],'where':_0x5313b0[_0x7bdd('0x18')]?_0x5313b0[_0x7bdd('0x18')][_0x7bdd('0x19')]||null:null,'attributes':_0x5313b0[_0x7bdd('0x18')]?_0x5313b0[_0x7bdd('0x18')][_0x7bdd('0x1a')]||null:null,'limit':_0x5313b0[_0x7bdd('0x18')]?_0x5313b0[_0x7bdd('0x18')][_0x7bdd('0x1b')]||null:null,'include':_0x5313b0['options']?_0x5313b0[_0x7bdd('0x18')][_0x7bdd('0x1c')]?_[_0x7bdd('0x1d')](_0x5313b0[_0x7bdd('0x18')][_0x7bdd('0x1c')],function(_0x5ea049){return{'model':db[_0x5ea049['model']],'as':_0x5ea049['as'],'attributes':_0x5ea049[_0x7bdd('0x1a')],'include':_0x5ea049['include']?_['map'](_0x5ea049[_0x7bdd('0x1c')],function(_0x4b7718){return{'model':db[_0x4b7718[_0x7bdd('0x1e')]],'as':_0x4b7718['as'],'attributes':_0x4b7718['attributes'],'include':_0x4b7718[_0x7bdd('0x1c')]?_['map'](_0x4b7718[_0x7bdd('0x1c')],function(_0x7da13d){return{'model':db[_0x7da13d['model']],'as':_0x7da13d['as'],'attributes':_0x7da13d[_0x7bdd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7bdd('0xe')](function(_0x3daa3e){logger['info']('GetSalesforceAccount',_0x5313b0);logger[_0x7bdd('0x10')](_0x7bdd('0x16'),_0x5313b0,JSON[_0x7bdd('0x11')](_0x3daa3e));_0x43063a(_0x3daa3e);})[_0x7bdd('0x1f')](function(_0xe0ed30){logger['error'](_0x7bdd('0x16'),_0xe0ed30[_0x7bdd('0x15')],_0x5313b0);_0x586e1f(_0x2af3c8[_0x7bdd('0x12')](0x1f4,_0xe0ed30[_0x7bdd('0x15')]));});});};exports[_0x7bdd('0x20')]=function(_0x51e300){var _0xeae625=this;return new Promise(function(_0x2ccc5a,_0x5d32e0){return db['SalesforceAccount'][_0x7bdd('0x21')]({'raw':_0x51e300[_0x7bdd('0x18')]?_0x51e300['options'][_0x7bdd('0x22')]===undefined?!![]:![]:!![],'where':_0x51e300['options']?_0x51e300[_0x7bdd('0x18')][_0x7bdd('0x19')]||null:null,'attributes':_0x51e300['options']?_0x51e300[_0x7bdd('0x18')][_0x7bdd('0x1a')]||null:null,'include':_0x51e300[_0x7bdd('0x18')]?_0x51e300[_0x7bdd('0x18')][_0x7bdd('0x1c')]?_[_0x7bdd('0x1d')](_0x51e300['options'][_0x7bdd('0x1c')],function(_0x4a8c14){return{'model':db[_0x4a8c14[_0x7bdd('0x1e')]],'as':_0x4a8c14['as'],'attributes':_0x4a8c14[_0x7bdd('0x1a')],'include':_0x4a8c14[_0x7bdd('0x1c')]?_[_0x7bdd('0x1d')](_0x4a8c14[_0x7bdd('0x1c')],function(_0x5a6b9b){return{'model':db[_0x5a6b9b['model']],'as':_0x5a6b9b['as'],'attributes':_0x5a6b9b[_0x7bdd('0x1a')],'include':_0x5a6b9b[_0x7bdd('0x1c')]?_[_0x7bdd('0x1d')](_0x5a6b9b[_0x7bdd('0x1c')],function(_0x5dc62a){return{'model':db[_0x5dc62a[_0x7bdd('0x1e')]],'as':_0x5dc62a['as'],'attributes':_0x5dc62a[_0x7bdd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7bdd('0xe')](function(_0x22ad1f){logger[_0x7bdd('0xf')](_0x7bdd('0x20'),_0x51e300);logger[_0x7bdd('0x10')](_0x7bdd('0x20'),_0x51e300,JSON[_0x7bdd('0x11')](_0x22ad1f));_0x2ccc5a(_0x22ad1f);})[_0x7bdd('0x1f')](function(_0x61cb9d){logger[_0x7bdd('0x12')](_0x7bdd('0x20'),_0x61cb9d[_0x7bdd('0x15')],_0x51e300);_0x5d32e0(_0xeae625['error'](0x1f4,_0x61cb9d['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 12fc3ef..be8c59a 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x43c11f,_0xad1219){var _0x3d0da1=function(_0x1fdf2a){while(--_0x1fdf2a){_0x43c11f['push'](_0x43c11f['shift']());}};_0x3d0da1(++_0xad1219);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2024fc,_0x5e427e){var _0x4f22bc=function(_0x5420db){while(--_0x5420db){_0x2024fc['push'](_0x2024fc['shift']());}};_0x4f22bc(++_0x5e427e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x193bfb,_0x57b53e){_0x193bfb=_0x193bfb-0x0;var _0xdb73de=_0x5f2f[_0x193bfb];return _0xdb73de;};'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('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 3f3c938..0f27547 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 _0xe8f0=['ENUM','Case','Task','lead','account_contact_lead','account','contact_lead','contact','sequelize','exports','STRING'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xe8f0,0x1b5));var _0x0e8f=function(_0x37c033,_0x41b8ee){_0x37c033=_0x37c033-0x0;var _0x4ce9dd=_0xe8f0[_0x37c033];return _0x4ce9dd;};'use strict';var Sequelize=require(_0x0e8f('0x0'));module[_0x0e8f('0x1')]={'name':{'type':Sequelize[_0x0e8f('0x2')]},'description':{'type':Sequelize[_0x0e8f('0x2')]},'ticketType':{'type':Sequelize[_0x0e8f('0x3')]('Task',_0x0e8f('0x4')),'defaultValue':_0x0e8f('0x5')},'moduleSearch':{'type':Sequelize[_0x0e8f('0x3')]('contact_lead','contact',_0x0e8f('0x6'),_0x0e8f('0x7'),_0x0e8f('0x8')),'defaultValue':_0x0e8f('0x9')},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0x0e8f('0xa'),'lead',_0x0e8f('0x8')),'defaultValue':_0x0e8f('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x0e8f('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x0e8f('0x2')]}}; \ No newline at end of file +var _0x7be8=['Task','Case','ENUM','contact_lead','contact','lead','account_contact_lead','nothing','account','sequelize','STRING'];(function(_0x511577,_0x2ec0cf){var _0x1b9201=function(_0x334aac){while(--_0x334aac){_0x511577['push'](_0x511577['shift']());}};_0x1b9201(++_0x2ec0cf);}(_0x7be8,0x1a0));var _0x87be=function(_0x2a702d,_0x10d8e6){_0x2a702d=_0x2a702d-0x0;var _0x454d56=_0x7be8[_0x2a702d];return _0x454d56;};'use strict';var Sequelize=require(_0x87be('0x0'));module['exports']={'name':{'type':Sequelize[_0x87be('0x1')]},'description':{'type':Sequelize[_0x87be('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x87be('0x2'),_0x87be('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x87be('0x4')](_0x87be('0x5'),_0x87be('0x6'),_0x87be('0x7'),_0x87be('0x8'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x87be('0x4')](_0x87be('0x9'),'contact','lead',_0x87be('0xa')),'defaultValue':_0x87be('0x7')},'leadId':{'type':Sequelize[_0x87be('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x87be('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x87be('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 1a8ae14..d09f356 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 _0x6a33=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','intersection','includeAll','create','body','find','getFields','SalesforceField','pick','findOne','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x11a890,_0x59b390){var _0x220a4c=function(_0x2ada9e){while(--_0x2ada9e){_0x11a890['push'](_0x11a890['shift']());}};_0x220a4c(++_0x59b390);}(_0x6a33,0x9b));var _0x36a3=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x6a33[_0x468b0f];return _0x3e74d9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x36a3('0x0'));var jsonpatch=require(_0x36a3('0x1'));var rp=require(_0x36a3('0x2'));var moment=require(_0x36a3('0x3'));var BPromise=require(_0x36a3('0x4'));var Mustache=require(_0x36a3('0x5'));var util=require(_0x36a3('0x6'));var path=require(_0x36a3('0x7'));var sox=require(_0x36a3('0x8'));var csv=require(_0x36a3('0x9'));var ejs=require(_0x36a3('0xa'));var fs=require('fs');var fs_extra=require(_0x36a3('0xb'));var _=require(_0x36a3('0xc'));var squel=require(_0x36a3('0xd'));var crypto=require('crypto');var jsforce=require(_0x36a3('0xe'));var deskjs=require(_0x36a3('0xf'));var toCsv=require(_0x36a3('0x9'));var querystring=require(_0x36a3('0x10'));var Papa=require(_0x36a3('0x11'));var Redis=require('ioredis');var authService=require(_0x36a3('0x12'));var qs=require(_0x36a3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x36a3('0x14'));var logger=require(_0x36a3('0x15'))(_0x36a3('0x16'));var utils=require(_0x36a3('0x17'));var config=require(_0x36a3('0x18'));var licenseUtil=require(_0x36a3('0x19'));var db=require(_0x36a3('0x1a'))['db'];function respondWithStatusCode(_0x208116,_0x258aaf){_0x258aaf=_0x258aaf||0xcc;return function(_0x51c0d2){if(_0x51c0d2){return _0x208116[_0x36a3('0x1b')](_0x258aaf);}return _0x208116[_0x36a3('0x1c')](_0x258aaf)[_0x36a3('0x1d')]();};}function respondWithResult(_0x15491a,_0x2239a0){_0x2239a0=_0x2239a0||0xc8;return function(_0x6ffb9e){if(_0x6ffb9e){return _0x15491a[_0x36a3('0x1c')](_0x2239a0)[_0x36a3('0x1e')](_0x6ffb9e);}};}function respondWithFilteredResult(_0x1085e8,_0x46bdf1){return function(_0x2a820d){if(_0x2a820d){var _0x2fbeb9=typeof _0x46bdf1[_0x36a3('0x1f')]===_0x36a3('0x20')&&typeof _0x46bdf1[_0x36a3('0x21')]==='undefined';var _0x35c421=_0x2a820d[_0x36a3('0x22')];var _0x48abfc=_0x2fbeb9?0x0:_0x46bdf1['offset'];var _0x3eec4f=_0x2fbeb9?_0x2a820d[_0x36a3('0x22')]:_0x46bdf1[_0x36a3('0x1f')]+_0x46bdf1[_0x36a3('0x21')];var _0x1810e1;if(_0x3eec4f>=_0x35c421){_0x3eec4f=_0x35c421;_0x1810e1=0xc8;}else{_0x1810e1=0xce;}_0x1085e8[_0x36a3('0x1c')](_0x1810e1);return _0x1085e8['set'](_0x36a3('0x23'),_0x48abfc+'-'+_0x3eec4f+'/'+_0x35c421)['json'](_0x2a820d);}return null;};}function patchUpdates(_0x1cdc1a){return function(_0x7d365d){try{jsonpatch['apply'](_0x7d365d,_0x1cdc1a,!![]);}catch(_0x4feb9e){return BPromise['reject'](_0x4feb9e);}return _0x7d365d[_0x36a3('0x24')]();};}function saveUpdates(_0x9f355a,_0x28f129){return function(_0x24744b){if(_0x24744b){return _0x24744b[_0x36a3('0x25')](_0x9f355a)[_0x36a3('0x26')](function(_0x392950){return _0x392950;});}return null;};}function removeEntity(_0x2d8ffd,_0x543fb6){return function(_0x7226b4){if(_0x7226b4){return _0x7226b4[_0x36a3('0x27')]()[_0x36a3('0x26')](function(){_0x2d8ffd[_0x36a3('0x1c')](0xcc)[_0x36a3('0x1d')]();});}};}function handleEntityNotFound(_0x10e5f1,_0x571ae9){return function(_0x3a30ab){if(!_0x3a30ab){_0x10e5f1[_0x36a3('0x1b')](0x194);}return _0x3a30ab;};}function handleError(_0x5bf609,_0x1a8c73){_0x1a8c73=_0x1a8c73||0x1f4;return function(_0x411d51){logger[_0x36a3('0x28')](_0x411d51[_0x36a3('0x29')]);if(_0x411d51[_0x36a3('0x2a')]){delete _0x411d51[_0x36a3('0x2a')];}_0x5bf609[_0x36a3('0x1c')](_0x1a8c73)[_0x36a3('0x2b')](_0x411d51);};}exports[_0x36a3('0x2c')]=function(_0x965f1a,_0x5f1a67){var _0x12b9e8={},_0x1f5d78={},_0x51b274={'count':0x0,'rows':[]};var _0x1d2a23=_['map'](db[_0x36a3('0x2d')][_0x36a3('0x2e')],function(_0x17d2d0){return{'name':_0x17d2d0['fieldName'],'type':_0x17d2d0['type']['key']};});_0x1f5d78[_0x36a3('0x2f')]=_[_0x36a3('0x30')](_0x1d2a23,_0x36a3('0x2a'));_0x1f5d78[_0x36a3('0x31')]=_[_0x36a3('0x32')](_0x965f1a[_0x36a3('0x31')]);_0x1f5d78[_0x36a3('0x33')]=_['intersection'](_0x1f5d78[_0x36a3('0x2f')],_0x1f5d78['query']);_0x12b9e8['attributes']=_['intersection'](_0x1f5d78['model'],qs['fields'](_0x965f1a['query'][_0x36a3('0x34')]));_0x12b9e8[_0x36a3('0x35')]=_0x12b9e8[_0x36a3('0x35')][_0x36a3('0x36')]?_0x12b9e8[_0x36a3('0x35')]:_0x1f5d78[_0x36a3('0x2f')];if(!_0x965f1a[_0x36a3('0x31')][_0x36a3('0x37')](_0x36a3('0x38'))){_0x12b9e8[_0x36a3('0x21')]=qs[_0x36a3('0x21')](_0x965f1a[_0x36a3('0x31')]['limit']);_0x12b9e8[_0x36a3('0x1f')]=qs[_0x36a3('0x1f')](_0x965f1a[_0x36a3('0x31')][_0x36a3('0x1f')]);}_0x12b9e8[_0x36a3('0x39')]=qs[_0x36a3('0x3a')](_0x965f1a['query'][_0x36a3('0x3a')]);_0x12b9e8['where']=qs[_0x36a3('0x33')](_['pick'](_0x965f1a[_0x36a3('0x31')],_0x1f5d78['filters']),_0x1d2a23);if(_0x965f1a[_0x36a3('0x31')]['filter']){_0x12b9e8[_0x36a3('0x3b')]=_[_0x36a3('0x3c')](_0x12b9e8[_0x36a3('0x3b')],{'$or':_[_0x36a3('0x30')](_0x1d2a23,function(_0x3f93f3){if(_0x3f93f3[_0x36a3('0x3d')]!==_0x36a3('0x3e')){var _0x287675={};_0x287675[_0x3f93f3[_0x36a3('0x2a')]]={'$like':'%'+_0x965f1a[_0x36a3('0x31')][_0x36a3('0x3f')]+'%'};return _0x287675;}})});}_0x12b9e8=_[_0x36a3('0x3c')]({},_0x12b9e8,_0x965f1a[_0x36a3('0x40')]);var _0x171d1b={'where':_0x12b9e8['where']};return db[_0x36a3('0x2d')][_0x36a3('0x22')](_0x171d1b)['then'](function(_0x2838d8){_0x51b274[_0x36a3('0x22')]=_0x2838d8;if(_0x965f1a[_0x36a3('0x31')]['includeAll']){_0x12b9e8[_0x36a3('0x41')]=[{'all':!![]}];}return db[_0x36a3('0x2d')][_0x36a3('0x42')](_0x12b9e8);})[_0x36a3('0x26')](function(_0x417c76){_0x51b274[_0x36a3('0x43')]=_0x417c76;return _0x51b274;})[_0x36a3('0x26')](respondWithFilteredResult(_0x5f1a67,_0x12b9e8))[_0x36a3('0x44')](handleError(_0x5f1a67,null));};exports[_0x36a3('0x45')]=function(_0x4ba0b1,_0x47e150){var _0x44d383={'raw':![],'where':{'id':_0x4ba0b1[_0x36a3('0x46')]['id']}},_0x326d63={};_0x326d63[_0x36a3('0x2f')]=_[_0x36a3('0x32')](db['SalesforceConfiguration'][_0x36a3('0x2e')]);_0x326d63['query']=_[_0x36a3('0x32')](_0x4ba0b1[_0x36a3('0x31')]);_0x326d63[_0x36a3('0x33')]=_[_0x36a3('0x47')](_0x326d63['model'],_0x326d63[_0x36a3('0x31')]);_0x44d383[_0x36a3('0x35')]=_[_0x36a3('0x47')](_0x326d63[_0x36a3('0x2f')],qs[_0x36a3('0x34')](_0x4ba0b1['query'][_0x36a3('0x34')]));_0x44d383['attributes']=_0x44d383[_0x36a3('0x35')][_0x36a3('0x36')]?_0x44d383[_0x36a3('0x35')]:_0x326d63[_0x36a3('0x2f')];if(_0x4ba0b1['query'][_0x36a3('0x48')]){_0x44d383[_0x36a3('0x41')]=[{'all':!![]}];}_0x44d383=_[_0x36a3('0x3c')]({},_0x44d383,_0x4ba0b1[_0x36a3('0x40')]);return db[_0x36a3('0x2d')]['find'](_0x44d383)[_0x36a3('0x26')](handleEntityNotFound(_0x47e150,null))[_0x36a3('0x26')](respondWithResult(_0x47e150,null))['catch'](handleError(_0x47e150,null));};exports[_0x36a3('0x49')]=function(_0x293e85,_0x1c7aa6){return db['SalesforceConfiguration'][_0x36a3('0x49')](_0x293e85[_0x36a3('0x4a')],{})[_0x36a3('0x26')](respondWithResult(_0x1c7aa6,0xc9))[_0x36a3('0x44')](handleError(_0x1c7aa6,null));};exports[_0x36a3('0x25')]=function(_0x1dea79,_0x399970){if(_0x1dea79['body']['id']){delete _0x1dea79[_0x36a3('0x4a')]['id'];}return db[_0x36a3('0x2d')][_0x36a3('0x4b')]({'where':{'id':_0x1dea79[_0x36a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x399970,null))[_0x36a3('0x26')](saveUpdates(_0x1dea79['body'],null))[_0x36a3('0x26')](respondWithResult(_0x399970,null))[_0x36a3('0x44')](handleError(_0x399970,null));};exports[_0x36a3('0x27')]=function(_0x31336a,_0x267746){return db[_0x36a3('0x2d')]['find']({'where':{'id':_0x31336a[_0x36a3('0x46')]['id']}})[_0x36a3('0x26')](handleEntityNotFound(_0x267746,null))[_0x36a3('0x26')](removeEntity(_0x267746,null))[_0x36a3('0x44')](handleError(_0x267746,null));};exports[_0x36a3('0x4c')]=function(_0x3ff903,_0x4de0e1,_0x350f07){var _0x2cfce3={};var _0x43ac66={};var _0x5df9d6;var _0x477dfc;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x3ff903[_0x36a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x4de0e1,null))[_0x36a3('0x26')](function(_0x2051df){if(_0x2051df){_0x5df9d6=_0x2051df;_0x43ac66[_0x36a3('0x2f')]=_[_0x36a3('0x32')](db[_0x36a3('0x4d')][_0x36a3('0x2e')]);_0x43ac66[_0x36a3('0x31')]=_[_0x36a3('0x32')](_0x3ff903['query']);_0x43ac66[_0x36a3('0x33')]=_['intersection'](_0x43ac66['model'],_0x43ac66[_0x36a3('0x31')]);_0x2cfce3['attributes']=_[_0x36a3('0x47')](_0x43ac66[_0x36a3('0x2f')],qs[_0x36a3('0x34')](_0x3ff903['query'][_0x36a3('0x34')]));_0x2cfce3['attributes']=_0x2cfce3['attributes']['length']?_0x2cfce3[_0x36a3('0x35')]:_0x43ac66[_0x36a3('0x2f')];_0x2cfce3[_0x36a3('0x39')]=qs['sort'](_0x3ff903['query'][_0x36a3('0x3a')]);_0x2cfce3['where']=qs[_0x36a3('0x33')](_[_0x36a3('0x4e')](_0x3ff903['query'],_0x43ac66[_0x36a3('0x33')]));if(_0x3ff903[_0x36a3('0x31')]['filter']){_0x2cfce3[_0x36a3('0x3b')]=_[_0x36a3('0x3c')](_0x2cfce3[_0x36a3('0x3b')],{'$or':_[_0x36a3('0x30')](_0x2cfce3[_0x36a3('0x35')],function(_0x47fc4f){var _0x1e88f9={};_0x1e88f9[_0x47fc4f]={'$like':'%'+_0x3ff903[_0x36a3('0x31')][_0x36a3('0x3f')]+'%'};return _0x1e88f9;})});}_0x2cfce3=_[_0x36a3('0x3c')]({},_0x2cfce3,_0x3ff903[_0x36a3('0x40')]);return _0x5df9d6[_0x36a3('0x4c')](_0x2cfce3);}})[_0x36a3('0x26')](function(_0x3fcbe9){if(_0x3fcbe9){_0x477dfc=_0x3fcbe9[_0x36a3('0x36')];if(!_0x3ff903[_0x36a3('0x31')][_0x36a3('0x37')](_0x36a3('0x38'))){_0x2cfce3[_0x36a3('0x21')]=qs['limit'](_0x3ff903['query']['limit']);_0x2cfce3['offset']=qs['offset'](_0x3ff903[_0x36a3('0x31')][_0x36a3('0x1f')]);}return _0x5df9d6[_0x36a3('0x4c')](_0x2cfce3);}})['then'](function(_0x19e5dd){if(_0x19e5dd){return _0x19e5dd?{'count':_0x477dfc,'rows':_0x19e5dd}:null;}})[_0x36a3('0x26')](respondWithResult(_0x4de0e1,null))['catch'](handleError(_0x4de0e1,null));};exports['getSubjects']=function(_0x29e74d,_0x16d3b7,_0x2882b5){var _0x1921bc={};var _0x4eea76={};var _0x489b52;var _0xf242f9;return db[_0x36a3('0x2d')][_0x36a3('0x4f')]({'where':{'id':_0x29e74d['params']['id']}})[_0x36a3('0x26')](handleEntityNotFound(_0x16d3b7,null))[_0x36a3('0x26')](function(_0x2e8db7){if(_0x2e8db7){_0x489b52=_0x2e8db7;_0x4eea76[_0x36a3('0x2f')]=_[_0x36a3('0x32')](db[_0x36a3('0x4d')]['rawAttributes']);_0x4eea76[_0x36a3('0x31')]=_[_0x36a3('0x32')](_0x29e74d[_0x36a3('0x31')]);_0x4eea76[_0x36a3('0x33')]=_['intersection'](_0x4eea76['model'],_0x4eea76[_0x36a3('0x31')]);_0x1921bc[_0x36a3('0x35')]=_['intersection'](_0x4eea76[_0x36a3('0x2f')],qs[_0x36a3('0x34')](_0x29e74d[_0x36a3('0x31')]['fields']));_0x1921bc[_0x36a3('0x35')]=_0x1921bc[_0x36a3('0x35')][_0x36a3('0x36')]?_0x1921bc[_0x36a3('0x35')]:_0x4eea76[_0x36a3('0x2f')];_0x1921bc[_0x36a3('0x39')]=qs[_0x36a3('0x3a')](_0x29e74d['query'][_0x36a3('0x3a')]);_0x1921bc['where']=qs['filters'](_[_0x36a3('0x4e')](_0x29e74d[_0x36a3('0x31')],_0x4eea76['filters']));if(_0x29e74d['query'][_0x36a3('0x3f')]){_0x1921bc[_0x36a3('0x3b')]=_['merge'](_0x1921bc[_0x36a3('0x3b')],{'$or':_['map'](_0x1921bc[_0x36a3('0x35')],function(_0xea3023){var _0x271171={};_0x271171[_0xea3023]={'$like':'%'+_0x29e74d[_0x36a3('0x31')][_0x36a3('0x3f')]+'%'};return _0x271171;})});}_0x1921bc=_['merge']({},_0x1921bc,_0x29e74d['options']);return _0x489b52[_0x36a3('0x50')](_0x1921bc);}})[_0x36a3('0x26')](function(_0x45d8a9){if(_0x45d8a9){_0xf242f9=_0x45d8a9[_0x36a3('0x36')];if(!_0x29e74d[_0x36a3('0x31')][_0x36a3('0x37')](_0x36a3('0x38'))){_0x1921bc['limit']=qs[_0x36a3('0x21')](_0x29e74d[_0x36a3('0x31')]['limit']);_0x1921bc[_0x36a3('0x1f')]=qs[_0x36a3('0x1f')](_0x29e74d[_0x36a3('0x31')][_0x36a3('0x1f')]);}return _0x489b52[_0x36a3('0x50')](_0x1921bc);}})[_0x36a3('0x26')](function(_0x5b709e){if(_0x5b709e){return _0x5b709e?{'count':_0xf242f9,'rows':_0x5b709e}:null;}})[_0x36a3('0x26')](respondWithResult(_0x16d3b7,null))['catch'](handleError(_0x16d3b7,null));};exports[_0x36a3('0x51')]=function(_0x465f3b,_0x1f9a28,_0x4a629e){var _0x249f90={};var _0x44651c={};var _0x3359d2;var _0x55878c;return db['SalesforceConfiguration'][_0x36a3('0x4f')]({'where':{'id':_0x465f3b['params']['id']}})[_0x36a3('0x26')](handleEntityNotFound(_0x1f9a28,null))[_0x36a3('0x26')](function(_0x128cd6){if(_0x128cd6){_0x3359d2=_0x128cd6;_0x44651c[_0x36a3('0x2f')]=_['keys'](db[_0x36a3('0x4d')][_0x36a3('0x2e')]);_0x44651c[_0x36a3('0x31')]=_[_0x36a3('0x32')](_0x465f3b[_0x36a3('0x31')]);_0x44651c[_0x36a3('0x33')]=_[_0x36a3('0x47')](_0x44651c['model'],_0x44651c[_0x36a3('0x31')]);_0x249f90[_0x36a3('0x35')]=_['intersection'](_0x44651c[_0x36a3('0x2f')],qs[_0x36a3('0x34')](_0x465f3b[_0x36a3('0x31')][_0x36a3('0x34')]));_0x249f90[_0x36a3('0x35')]=_0x249f90[_0x36a3('0x35')]['length']?_0x249f90[_0x36a3('0x35')]:_0x44651c[_0x36a3('0x2f')];_0x249f90[_0x36a3('0x39')]=qs[_0x36a3('0x3a')](_0x465f3b['query'][_0x36a3('0x3a')]);_0x249f90[_0x36a3('0x3b')]=qs[_0x36a3('0x33')](_[_0x36a3('0x4e')](_0x465f3b[_0x36a3('0x31')],_0x44651c[_0x36a3('0x33')]));if(_0x465f3b['query'][_0x36a3('0x3f')]){_0x249f90[_0x36a3('0x3b')]=_[_0x36a3('0x3c')](_0x249f90[_0x36a3('0x3b')],{'$or':_[_0x36a3('0x30')](_0x249f90['attributes'],function(_0x56b7d5){var _0x5f079c={};_0x5f079c[_0x56b7d5]={'$like':'%'+_0x465f3b[_0x36a3('0x31')][_0x36a3('0x3f')]+'%'};return _0x5f079c;})});}_0x249f90=_[_0x36a3('0x3c')]({},_0x249f90,_0x465f3b[_0x36a3('0x40')]);return _0x3359d2[_0x36a3('0x51')](_0x249f90);}})[_0x36a3('0x26')](function(_0x41dab7){if(_0x41dab7){_0x55878c=_0x41dab7[_0x36a3('0x36')];if(!_0x465f3b[_0x36a3('0x31')][_0x36a3('0x37')](_0x36a3('0x38'))){_0x249f90[_0x36a3('0x21')]=qs['limit'](_0x465f3b['query'][_0x36a3('0x21')]);_0x249f90['offset']=qs[_0x36a3('0x1f')](_0x465f3b['query'][_0x36a3('0x1f')]);}return _0x3359d2[_0x36a3('0x51')](_0x249f90);}})[_0x36a3('0x26')](function(_0x22f1f9){if(_0x22f1f9){return _0x22f1f9?{'count':_0x55878c,'rows':_0x22f1f9}:null;}})[_0x36a3('0x26')](respondWithResult(_0x1f9a28,null))[_0x36a3('0x44')](handleError(_0x1f9a28,null));}; \ No newline at end of file +var _0x58dc=['rows','catch','show','params','rawAttributes','include','find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','name','index','map','SalesforceConfiguration','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x58dc,0x199));var _0xc58d=function(_0xc5580e,_0x3c5102){_0xc5580e=_0xc5580e-0x0;var _0x4236b4=_0x58dc[_0xc5580e];return _0x4236b4;};'use strict';var emlformat=require(_0xc58d('0x0'));var rimraf=require(_0xc58d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc58d('0x2'));var rp=require(_0xc58d('0x3'));var moment=require(_0xc58d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc58d('0x5'));var util=require(_0xc58d('0x6'));var path=require(_0xc58d('0x7'));var sox=require(_0xc58d('0x8'));var csv=require(_0xc58d('0x9'));var ejs=require(_0xc58d('0xa'));var fs=require('fs');var fs_extra=require(_0xc58d('0xb'));var _=require(_0xc58d('0xc'));var squel=require('squel');var crypto=require(_0xc58d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc58d('0xe'));var toCsv=require(_0xc58d('0x9'));var querystring=require(_0xc58d('0xf'));var Papa=require(_0xc58d('0x10'));var Redis=require(_0xc58d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc58d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc58d('0x13'))('api');var utils=require(_0xc58d('0x14'));var config=require(_0xc58d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc58d('0x16'))['db'];function respondWithStatusCode(_0x210f1a,_0x5a3baa){_0x5a3baa=_0x5a3baa||0xcc;return function(_0x323375){if(_0x323375){return _0x210f1a[_0xc58d('0x17')](_0x5a3baa);}return _0x210f1a[_0xc58d('0x18')](_0x5a3baa)[_0xc58d('0x19')]();};}function respondWithResult(_0x2e5e3c,_0xb7b206){_0xb7b206=_0xb7b206||0xc8;return function(_0x4122fc){if(_0x4122fc){return _0x2e5e3c[_0xc58d('0x18')](_0xb7b206)[_0xc58d('0x1a')](_0x4122fc);}};}function respondWithFilteredResult(_0x118a40,_0x3be8e5){return function(_0x25619f){if(_0x25619f){var _0x157440=typeof _0x3be8e5[_0xc58d('0x1b')]===_0xc58d('0x1c')&&typeof _0x3be8e5['limit']===_0xc58d('0x1c');var _0x5352f9=_0x25619f['count'];var _0x49c17e=_0x157440?0x0:_0x3be8e5['offset'];var _0x3ffc8e=_0x157440?_0x25619f[_0xc58d('0x1d')]:_0x3be8e5[_0xc58d('0x1b')]+_0x3be8e5[_0xc58d('0x1e')];var _0x14e5cc;if(_0x3ffc8e>=_0x5352f9){_0x3ffc8e=_0x5352f9;_0x14e5cc=0xc8;}else{_0x14e5cc=0xce;}_0x118a40[_0xc58d('0x18')](_0x14e5cc);return _0x118a40[_0xc58d('0x1f')](_0xc58d('0x20'),_0x49c17e+'-'+_0x3ffc8e+'/'+_0x5352f9)[_0xc58d('0x1a')](_0x25619f);}return null;};}function patchUpdates(_0x43a737){return function(_0x34fbdf){try{jsonpatch[_0xc58d('0x21')](_0x34fbdf,_0x43a737,!![]);}catch(_0x45d2e9){return BPromise['reject'](_0x45d2e9);}return _0x34fbdf['save']();};}function saveUpdates(_0x457e59,_0xb94010){return function(_0x230bab){if(_0x230bab){return _0x230bab[_0xc58d('0x22')](_0x457e59)[_0xc58d('0x23')](function(_0x299c1){return _0x299c1;});}return null;};}function removeEntity(_0x362a90,_0x17b676){return function(_0x15b055){if(_0x15b055){return _0x15b055[_0xc58d('0x24')]()[_0xc58d('0x23')](function(){_0x362a90[_0xc58d('0x18')](0xcc)[_0xc58d('0x19')]();});}};}function handleEntityNotFound(_0x33f653,_0x1c9cdc){return function(_0x2c2cb7){if(!_0x2c2cb7){_0x33f653['sendStatus'](0x194);}return _0x2c2cb7;};}function handleError(_0x231497,_0x3a295a){_0x3a295a=_0x3a295a||0x1f4;return function(_0x5f5871){logger[_0xc58d('0x25')](_0x5f5871['stack']);if(_0x5f5871[_0xc58d('0x26')]){delete _0x5f5871[_0xc58d('0x26')];}_0x231497[_0xc58d('0x18')](_0x3a295a)['send'](_0x5f5871);};}exports[_0xc58d('0x27')]=function(_0x58638c,_0x2b5c9b){var _0xaf2907={},_0xbaebaa={},_0x175e32={'count':0x0,'rows':[]};var _0x2b40b1=_[_0xc58d('0x28')](db[_0xc58d('0x29')]['rawAttributes'],function(_0x482111){return{'name':_0x482111[_0xc58d('0x2a')],'type':_0x482111[_0xc58d('0x2b')][_0xc58d('0x2c')]};});_0xbaebaa['model']=_[_0xc58d('0x28')](_0x2b40b1,_0xc58d('0x26'));_0xbaebaa['query']=_[_0xc58d('0x2d')](_0x58638c[_0xc58d('0x2e')]);_0xbaebaa[_0xc58d('0x2f')]=_[_0xc58d('0x30')](_0xbaebaa['model'],_0xbaebaa[_0xc58d('0x2e')]);_0xaf2907[_0xc58d('0x31')]=_[_0xc58d('0x30')](_0xbaebaa[_0xc58d('0x32')],qs[_0xc58d('0x33')](_0x58638c[_0xc58d('0x2e')]['fields']));_0xaf2907[_0xc58d('0x31')]=_0xaf2907[_0xc58d('0x31')][_0xc58d('0x34')]?_0xaf2907[_0xc58d('0x31')]:_0xbaebaa[_0xc58d('0x32')];if(!_0x58638c[_0xc58d('0x2e')][_0xc58d('0x35')](_0xc58d('0x36'))){_0xaf2907[_0xc58d('0x1e')]=qs[_0xc58d('0x1e')](_0x58638c[_0xc58d('0x2e')][_0xc58d('0x1e')]);_0xaf2907[_0xc58d('0x1b')]=qs['offset'](_0x58638c[_0xc58d('0x2e')][_0xc58d('0x1b')]);}_0xaf2907[_0xc58d('0x37')]=qs['sort'](_0x58638c[_0xc58d('0x2e')][_0xc58d('0x38')]);_0xaf2907[_0xc58d('0x39')]=qs[_0xc58d('0x2f')](_[_0xc58d('0x3a')](_0x58638c[_0xc58d('0x2e')],_0xbaebaa['filters']),_0x2b40b1);if(_0x58638c[_0xc58d('0x2e')]['filter']){_0xaf2907['where']=_['merge'](_0xaf2907[_0xc58d('0x39')],{'$or':_[_0xc58d('0x28')](_0x2b40b1,function(_0x54ef96){if(_0x54ef96[_0xc58d('0x2b')]!==_0xc58d('0x3b')){var _0x4dea89={};_0x4dea89[_0x54ef96[_0xc58d('0x26')]]={'$like':'%'+_0x58638c[_0xc58d('0x2e')][_0xc58d('0x3c')]+'%'};return _0x4dea89;}})});}_0xaf2907=_[_0xc58d('0x3d')]({},_0xaf2907,_0x58638c[_0xc58d('0x3e')]);var _0x503933={'where':_0xaf2907[_0xc58d('0x39')]};return db[_0xc58d('0x29')][_0xc58d('0x1d')](_0x503933)['then'](function(_0x4d16b6){_0x175e32[_0xc58d('0x1d')]=_0x4d16b6;if(_0x58638c[_0xc58d('0x2e')][_0xc58d('0x3f')]){_0xaf2907['include']=[{'all':!![]}];}return db[_0xc58d('0x29')][_0xc58d('0x40')](_0xaf2907);})[_0xc58d('0x23')](function(_0x1fb37a){_0x175e32[_0xc58d('0x41')]=_0x1fb37a;return _0x175e32;})[_0xc58d('0x23')](respondWithFilteredResult(_0x2b5c9b,_0xaf2907))[_0xc58d('0x42')](handleError(_0x2b5c9b,null));};exports[_0xc58d('0x43')]=function(_0x2d794a,_0x550f7b){var _0x5a2f10={'raw':![],'where':{'id':_0x2d794a[_0xc58d('0x44')]['id']}},_0x12d86c={};_0x12d86c['model']=_[_0xc58d('0x2d')](db[_0xc58d('0x29')][_0xc58d('0x45')]);_0x12d86c[_0xc58d('0x2e')]=_[_0xc58d('0x2d')](_0x2d794a[_0xc58d('0x2e')]);_0x12d86c[_0xc58d('0x2f')]=_[_0xc58d('0x30')](_0x12d86c[_0xc58d('0x32')],_0x12d86c[_0xc58d('0x2e')]);_0x5a2f10[_0xc58d('0x31')]=_[_0xc58d('0x30')](_0x12d86c[_0xc58d('0x32')],qs[_0xc58d('0x33')](_0x2d794a[_0xc58d('0x2e')]['fields']));_0x5a2f10[_0xc58d('0x31')]=_0x5a2f10['attributes'][_0xc58d('0x34')]?_0x5a2f10[_0xc58d('0x31')]:_0x12d86c['model'];if(_0x2d794a[_0xc58d('0x2e')][_0xc58d('0x3f')]){_0x5a2f10[_0xc58d('0x46')]=[{'all':!![]}];}_0x5a2f10=_[_0xc58d('0x3d')]({},_0x5a2f10,_0x2d794a['options']);return db['SalesforceConfiguration'][_0xc58d('0x47')](_0x5a2f10)[_0xc58d('0x23')](handleEntityNotFound(_0x550f7b,null))[_0xc58d('0x23')](respondWithResult(_0x550f7b,null))[_0xc58d('0x42')](handleError(_0x550f7b,null));};exports[_0xc58d('0x48')]=function(_0x3fb87c,_0x3b4693){return db[_0xc58d('0x29')]['create'](_0x3fb87c[_0xc58d('0x49')],{})[_0xc58d('0x23')](respondWithResult(_0x3b4693,0xc9))[_0xc58d('0x42')](handleError(_0x3b4693,null));};exports['update']=function(_0x33c378,_0x2736d8){if(_0x33c378[_0xc58d('0x49')]['id']){delete _0x33c378[_0xc58d('0x49')]['id'];}return db[_0xc58d('0x29')][_0xc58d('0x47')]({'where':{'id':_0x33c378[_0xc58d('0x44')]['id']}})[_0xc58d('0x23')](handleEntityNotFound(_0x2736d8,null))[_0xc58d('0x23')](saveUpdates(_0x33c378[_0xc58d('0x49')],null))['then'](respondWithResult(_0x2736d8,null))[_0xc58d('0x42')](handleError(_0x2736d8,null));};exports[_0xc58d('0x24')]=function(_0x2f1190,_0x27e6ed){return db[_0xc58d('0x29')][_0xc58d('0x47')]({'where':{'id':_0x2f1190[_0xc58d('0x44')]['id']}})[_0xc58d('0x23')](handleEntityNotFound(_0x27e6ed,null))['then'](removeEntity(_0x27e6ed,null))['catch'](handleError(_0x27e6ed,null));};exports[_0xc58d('0x4a')]=function(_0x116ed6,_0x4dabde,_0x3f67c5){var _0x194400={};var _0x2b91cd={};var _0x46d324;var _0x2fdebd;return db[_0xc58d('0x29')][_0xc58d('0x4b')]({'where':{'id':_0x116ed6[_0xc58d('0x44')]['id']}})[_0xc58d('0x23')](handleEntityNotFound(_0x4dabde,null))[_0xc58d('0x23')](function(_0x38d5c3){if(_0x38d5c3){_0x46d324=_0x38d5c3;_0x2b91cd[_0xc58d('0x32')]=_[_0xc58d('0x2d')](db[_0xc58d('0x4c')][_0xc58d('0x45')]);_0x2b91cd[_0xc58d('0x2e')]=_['keys'](_0x116ed6[_0xc58d('0x2e')]);_0x2b91cd['filters']=_[_0xc58d('0x30')](_0x2b91cd[_0xc58d('0x32')],_0x2b91cd['query']);_0x194400[_0xc58d('0x31')]=_[_0xc58d('0x30')](_0x2b91cd[_0xc58d('0x32')],qs['fields'](_0x116ed6[_0xc58d('0x2e')]['fields']));_0x194400['attributes']=_0x194400[_0xc58d('0x31')][_0xc58d('0x34')]?_0x194400[_0xc58d('0x31')]:_0x2b91cd[_0xc58d('0x32')];_0x194400[_0xc58d('0x37')]=qs[_0xc58d('0x38')](_0x116ed6[_0xc58d('0x2e')][_0xc58d('0x38')]);_0x194400[_0xc58d('0x39')]=qs[_0xc58d('0x2f')](_[_0xc58d('0x3a')](_0x116ed6[_0xc58d('0x2e')],_0x2b91cd['filters']));if(_0x116ed6[_0xc58d('0x2e')]['filter']){_0x194400[_0xc58d('0x39')]=_[_0xc58d('0x3d')](_0x194400['where'],{'$or':_[_0xc58d('0x28')](_0x194400[_0xc58d('0x31')],function(_0x522699){var _0x20a7a8={};_0x20a7a8[_0x522699]={'$like':'%'+_0x116ed6[_0xc58d('0x2e')][_0xc58d('0x3c')]+'%'};return _0x20a7a8;})});}_0x194400=_['merge']({},_0x194400,_0x116ed6[_0xc58d('0x3e')]);return _0x46d324[_0xc58d('0x4a')](_0x194400);}})[_0xc58d('0x23')](function(_0x358fa0){if(_0x358fa0){_0x2fdebd=_0x358fa0['length'];if(!_0x116ed6['query']['hasOwnProperty'](_0xc58d('0x36'))){_0x194400[_0xc58d('0x1e')]=qs[_0xc58d('0x1e')](_0x116ed6[_0xc58d('0x2e')][_0xc58d('0x1e')]);_0x194400[_0xc58d('0x1b')]=qs['offset'](_0x116ed6['query'][_0xc58d('0x1b')]);}return _0x46d324[_0xc58d('0x4a')](_0x194400);}})[_0xc58d('0x23')](function(_0x2f1012){if(_0x2f1012){return _0x2f1012?{'count':_0x2fdebd,'rows':_0x2f1012}:null;}})[_0xc58d('0x23')](respondWithResult(_0x4dabde,null))['catch'](handleError(_0x4dabde,null));};exports[_0xc58d('0x4d')]=function(_0x4f7a11,_0x5a888c,_0x245c01){var _0x2753e0={};var _0x231e73={};var _0x13da06;var _0x52b9b9;return db[_0xc58d('0x29')]['findOne']({'where':{'id':_0x4f7a11['params']['id']}})['then'](handleEntityNotFound(_0x5a888c,null))[_0xc58d('0x23')](function(_0x546f6d){if(_0x546f6d){_0x13da06=_0x546f6d;_0x231e73[_0xc58d('0x32')]=_[_0xc58d('0x2d')](db['SalesforceField'][_0xc58d('0x45')]);_0x231e73['query']=_[_0xc58d('0x2d')](_0x4f7a11[_0xc58d('0x2e')]);_0x231e73[_0xc58d('0x2f')]=_['intersection'](_0x231e73[_0xc58d('0x32')],_0x231e73['query']);_0x2753e0[_0xc58d('0x31')]=_[_0xc58d('0x30')](_0x231e73['model'],qs[_0xc58d('0x33')](_0x4f7a11[_0xc58d('0x2e')][_0xc58d('0x33')]));_0x2753e0[_0xc58d('0x31')]=_0x2753e0[_0xc58d('0x31')][_0xc58d('0x34')]?_0x2753e0[_0xc58d('0x31')]:_0x231e73[_0xc58d('0x32')];_0x2753e0['order']=qs[_0xc58d('0x38')](_0x4f7a11[_0xc58d('0x2e')][_0xc58d('0x38')]);_0x2753e0[_0xc58d('0x39')]=qs[_0xc58d('0x2f')](_[_0xc58d('0x3a')](_0x4f7a11[_0xc58d('0x2e')],_0x231e73[_0xc58d('0x2f')]));if(_0x4f7a11['query'][_0xc58d('0x3c')]){_0x2753e0[_0xc58d('0x39')]=_[_0xc58d('0x3d')](_0x2753e0[_0xc58d('0x39')],{'$or':_['map'](_0x2753e0[_0xc58d('0x31')],function(_0x3432b9){var _0x57c748={};_0x57c748[_0x3432b9]={'$like':'%'+_0x4f7a11[_0xc58d('0x2e')]['filter']+'%'};return _0x57c748;})});}_0x2753e0=_['merge']({},_0x2753e0,_0x4f7a11['options']);return _0x13da06[_0xc58d('0x4d')](_0x2753e0);}})[_0xc58d('0x23')](function(_0x56ed5c){if(_0x56ed5c){_0x52b9b9=_0x56ed5c['length'];if(!_0x4f7a11[_0xc58d('0x2e')][_0xc58d('0x35')](_0xc58d('0x36'))){_0x2753e0[_0xc58d('0x1e')]=qs['limit'](_0x4f7a11[_0xc58d('0x2e')][_0xc58d('0x1e')]);_0x2753e0[_0xc58d('0x1b')]=qs[_0xc58d('0x1b')](_0x4f7a11[_0xc58d('0x2e')]['offset']);}return _0x13da06[_0xc58d('0x4d')](_0x2753e0);}})[_0xc58d('0x23')](function(_0x109033){if(_0x109033){return _0x109033?{'count':_0x52b9b9,'rows':_0x109033}:null;}})['then'](respondWithResult(_0x5a888c,null))['catch'](handleError(_0x5a888c,null));};exports['getDescriptions']=function(_0x19c1cc,_0x3f4bd5,_0x3afc8a){var _0x83cc4e={};var _0x35b1e7={};var _0x155b25;var _0x49f0e2;return db[_0xc58d('0x29')][_0xc58d('0x4b')]({'where':{'id':_0x19c1cc['params']['id']}})[_0xc58d('0x23')](handleEntityNotFound(_0x3f4bd5,null))[_0xc58d('0x23')](function(_0x385af6){if(_0x385af6){_0x155b25=_0x385af6;_0x35b1e7['model']=_[_0xc58d('0x2d')](db['SalesforceField'][_0xc58d('0x45')]);_0x35b1e7[_0xc58d('0x2e')]=_[_0xc58d('0x2d')](_0x19c1cc['query']);_0x35b1e7['filters']=_[_0xc58d('0x30')](_0x35b1e7[_0xc58d('0x32')],_0x35b1e7['query']);_0x83cc4e[_0xc58d('0x31')]=_[_0xc58d('0x30')](_0x35b1e7[_0xc58d('0x32')],qs[_0xc58d('0x33')](_0x19c1cc['query'][_0xc58d('0x33')]));_0x83cc4e[_0xc58d('0x31')]=_0x83cc4e[_0xc58d('0x31')]['length']?_0x83cc4e[_0xc58d('0x31')]:_0x35b1e7[_0xc58d('0x32')];_0x83cc4e['order']=qs[_0xc58d('0x38')](_0x19c1cc[_0xc58d('0x2e')][_0xc58d('0x38')]);_0x83cc4e[_0xc58d('0x39')]=qs[_0xc58d('0x2f')](_[_0xc58d('0x3a')](_0x19c1cc[_0xc58d('0x2e')],_0x35b1e7['filters']));if(_0x19c1cc[_0xc58d('0x2e')][_0xc58d('0x3c')]){_0x83cc4e[_0xc58d('0x39')]=_[_0xc58d('0x3d')](_0x83cc4e[_0xc58d('0x39')],{'$or':_['map'](_0x83cc4e['attributes'],function(_0x5e5e3a){var _0x5145b0={};_0x5145b0[_0x5e5e3a]={'$like':'%'+_0x19c1cc[_0xc58d('0x2e')][_0xc58d('0x3c')]+'%'};return _0x5145b0;})});}_0x83cc4e=_['merge']({},_0x83cc4e,_0x19c1cc[_0xc58d('0x3e')]);return _0x155b25[_0xc58d('0x4e')](_0x83cc4e);}})['then'](function(_0x772330){if(_0x772330){_0x49f0e2=_0x772330[_0xc58d('0x34')];if(!_0x19c1cc[_0xc58d('0x2e')][_0xc58d('0x35')](_0xc58d('0x36'))){_0x83cc4e[_0xc58d('0x1e')]=qs[_0xc58d('0x1e')](_0x19c1cc[_0xc58d('0x2e')][_0xc58d('0x1e')]);_0x83cc4e[_0xc58d('0x1b')]=qs[_0xc58d('0x1b')](_0x19c1cc[_0xc58d('0x2e')][_0xc58d('0x1b')]);}return _0x155b25[_0xc58d('0x4e')](_0x83cc4e);}})[_0xc58d('0x23')](function(_0x31ab99){if(_0x31ab99){return _0x31ab99?{'count':_0x49f0e2,'rows':_0x31ab99}:null;}})['then'](respondWithResult(_0x3f4bd5,null))[_0xc58d('0x42')](handleError(_0x3f4bd5,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index fac63c7..d177022 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 _0x875a=['path','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','moment','bluebird'];(function(_0x32c290,_0x53476d){var _0x450a9c=function(_0x5cc555){while(--_0x5cc555){_0x32c290['push'](_0x32c290['shift']());}};_0x450a9c(++_0x53476d);}(_0x875a,0x13a));var _0xa875=function(_0x39be6b,_0x1f5d5c){_0x39be6b=_0x39be6b-0x0;var _0x29c41f=_0x875a[_0x39be6b];return _0x29c41f;};'use strict';var _=require(_0xa875('0x0'));var util=require(_0xa875('0x1'));var logger=require('../../config/logger')(_0xa875('0x2'));var moment=require(_0xa875('0x3'));var BPromise=require(_0xa875('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa875('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa875('0x6'));module[_0xa875('0x7')]=function(_0x35fb62,_0x318f4f){return _0x35fb62[_0xa875('0x8')](_0xa875('0x9'),attributes,{'tableName':_0xa875('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd342=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','SalesforceConfiguration','int_salesforce_configurations','util'];(function(_0x25766c,_0xd0a4ff){var _0x9cdb04=function(_0x1bcc88){while(--_0x1bcc88){_0x25766c['push'](_0x25766c['shift']());}};_0x9cdb04(++_0xd0a4ff);}(_0xd342,0x171));var _0x2d34=function(_0x4cc030,_0x45cb7b){_0x4cc030=_0x4cc030-0x0;var _0x325db8=_0xd342[_0x4cc030];return _0x325db8;};'use strict';var _=require('lodash');var util=require(_0x2d34('0x0'));var logger=require('../../config/logger')(_0x2d34('0x1'));var moment=require('moment');var BPromise=require(_0x2d34('0x2'));var rp=require(_0x2d34('0x3'));var fs=require('fs');var path=require(_0x2d34('0x4'));var rimraf=require(_0x2d34('0x5'));var config=require(_0x2d34('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x2d34('0x7')]=function(_0x12a2dc,_0x3fadc3){return _0x12a2dc['define'](_0x2d34('0x8'),attributes,{'tableName':_0x2d34('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 e0914d9..d4ed4f2 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 _0xb296=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xb296,0xf7));var _0x6b29=function(_0x7abcf7,_0x3289f8){_0x7abcf7=_0x7abcf7-0x0;var _0x5b244e=_0xb296[_0x7abcf7];return _0x5b244e;};'use strict';var _=require('lodash');var util=require(_0x6b29('0x0'));var moment=require(_0x6b29('0x1'));var BPromise=require('bluebird');var rs=require(_0x6b29('0x2'));var fs=require('fs');var Redis=require(_0x6b29('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6b29('0x4'));var config=require(_0x6b29('0x5'));var jayson=require(_0x6b29('0x6'));var client=jayson['client'][_0x6b29('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14eca3,_0x43afc4,_0x51366){return new BPromise(function(_0x2a6aa2,_0x58d85c){return client['request'](_0x14eca3,_0x51366)[_0x6b29('0x8')](function(_0x5eae7a){logger[_0x6b29('0x9')](_0x6b29('0xa'),_0x43afc4,_0x6b29('0xb'));logger[_0x6b29('0xc')](_0x6b29('0xd'),_0x43afc4,_0x6b29('0xb'),JSON[_0x6b29('0xe')](_0x5eae7a));if(_0x5eae7a[_0x6b29('0xf')]){if(_0x5eae7a[_0x6b29('0xf')][_0x6b29('0x10')]===0x1f4){logger[_0x6b29('0xf')](_0x6b29('0xa'),_0x43afc4,_0x5eae7a['error'][_0x6b29('0x11')]);return _0x58d85c(_0x5eae7a[_0x6b29('0xf')][_0x6b29('0x11')]);}logger['error'](_0x6b29('0xa'),_0x43afc4,_0x5eae7a[_0x6b29('0xf')][_0x6b29('0x11')]);return _0x2a6aa2(_0x5eae7a[_0x6b29('0xf')]['message']);}else{logger[_0x6b29('0x9')](_0x6b29('0xa'),_0x43afc4,_0x6b29('0xb'));_0x2a6aa2(_0x5eae7a[_0x6b29('0x12')][_0x6b29('0x11')]);}})[_0x6b29('0x13')](function(_0x101839){logger[_0x6b29('0xf')](_0x6b29('0xa'),_0x43afc4,_0x101839);_0x58d85c(_0x101839);});});} \ No newline at end of file +var _0xc1b7=['jayson/promise','client','http','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x421aae,_0x888e64){var _0x3caf8c=function(_0x1a0b80){while(--_0x1a0b80){_0x421aae['push'](_0x421aae['shift']());}};_0x3caf8c(++_0x888e64);}(_0xc1b7,0x19b));var _0x7c1b=function(_0x58b35e,_0x17a8cd){_0x58b35e=_0x58b35e-0x0;var _0x86b2a0=_0xc1b7[_0x58b35e];return _0x86b2a0;};'use strict';var _=require('lodash');var util=require(_0x7c1b('0x0'));var moment=require('moment');var BPromise=require(_0x7c1b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c1b('0x2'));var db=require(_0x7c1b('0x3'))['db'];var utils=require(_0x7c1b('0x4'));var logger=require('../../config/logger')(_0x7c1b('0x5'));var config=require(_0x7c1b('0x6'));var jayson=require(_0x7c1b('0x7'));var client=jayson[_0x7c1b('0x8')][_0x7c1b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3239f1,_0x22a584,_0x352f61){return new BPromise(function(_0x5aaa03,_0x130b0a){return client['request'](_0x3239f1,_0x352f61)[_0x7c1b('0xa')](function(_0x4a2378){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x22a584,_0x7c1b('0xb'));logger[_0x7c1b('0xc')](_0x7c1b('0xd'),_0x22a584,'request\x20sent',JSON[_0x7c1b('0xe')](_0x4a2378));if(_0x4a2378['error']){if(_0x4a2378[_0x7c1b('0xf')][_0x7c1b('0x10')]===0x1f4){logger['error'](_0x7c1b('0x11'),_0x22a584,_0x4a2378[_0x7c1b('0xf')][_0x7c1b('0x12')]);return _0x130b0a(_0x4a2378['error'][_0x7c1b('0x12')]);}logger[_0x7c1b('0xf')](_0x7c1b('0x11'),_0x22a584,_0x4a2378[_0x7c1b('0xf')][_0x7c1b('0x12')]);return _0x5aaa03(_0x4a2378[_0x7c1b('0xf')][_0x7c1b('0x12')]);}else{logger[_0x7c1b('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x22a584,_0x7c1b('0xb'));_0x5aaa03(_0x4a2378[_0x7c1b('0x14')][_0x7c1b('0x12')]);}})[_0x7c1b('0x15')](function(_0x570a09){logger['error'](_0x7c1b('0x11'),_0x22a584,_0x570a09);_0x130b0a(_0x570a09);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 3391d9f..d1e711a 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 _0xc548=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','put','update','delete','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc548,0x15b));var _0x8c54=function(_0x1819f4,_0x4e71da){_0x1819f4=_0x1819f4-0x0;var _0x388309=_0xc548[_0x1819f4];return _0x388309;};'use strict';var multer=require('multer');var util=require(_0x8c54('0x0'));var path=require(_0x8c54('0x1'));var timeout=require(_0x8c54('0x2'));var express=require(_0x8c54('0x3'));var router=express['Router']();var fs_extra=require(_0x8c54('0x4'));var auth=require(_0x8c54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8c54('0x6'));var controller=require('./intSalesforceField.controller');router[_0x8c54('0x7')]('/',auth[_0x8c54('0x8')](),controller[_0x8c54('0x9')]);router['get'](_0x8c54('0xa'),auth[_0x8c54('0x8')](),controller['show']);router['post']('/',auth[_0x8c54('0x8')](),controller['create']);router[_0x8c54('0xb')](_0x8c54('0xa'),auth[_0x8c54('0x8')](),controller[_0x8c54('0xc')]);router[_0x8c54('0xd')](_0x8c54('0xa'),auth[_0x8c54('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8425=['show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index','get','/:id'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8425,0x7e));var _0x5842=function(_0x34963b,_0x2d5bc5){_0x34963b=_0x34963b-0x0;var _0x2e8747=_0x8425[_0x34963b];return _0x2e8747;};'use strict';var multer=require(_0x5842('0x0'));var util=require(_0x5842('0x1'));var path=require(_0x5842('0x2'));var timeout=require(_0x5842('0x3'));var express=require(_0x5842('0x4'));var router=express[_0x5842('0x5')]();var fs_extra=require(_0x5842('0x6'));var auth=require(_0x5842('0x7'));var interaction=require(_0x5842('0x8'));var config=require('../../config/environment');var controller=require(_0x5842('0x9'));router['get']('/',auth[_0x5842('0xa')](),controller[_0x5842('0xb')]);router[_0x5842('0xc')](_0x5842('0xd'),auth['isAuthenticated'](),controller[_0x5842('0xe')]);router[_0x5842('0xf')]('/',auth[_0x5842('0xa')](),controller[_0x5842('0x10')]);router[_0x5842('0x11')]('/:id',auth[_0x5842('0xa')](),controller[_0x5842('0x12')]);router['delete'](_0x5842('0xd'),auth['isAuthenticated'](),controller[_0x5842('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 52e094e..08120df 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 _0xb073=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb073,0x105));var _0x3b07=function(_0x3dd6a1,_0x3183d2){_0x3dd6a1=_0x3dd6a1-0x0;var _0x9df55f=_0xb073[_0x3dd6a1];return _0x9df55f;};'use strict';var Sequelize=require(_0x3b07('0x0'));module[_0x3b07('0x1')]={'type':{'type':Sequelize[_0x3b07('0x2')](_0x3b07('0x3'),_0x3b07('0x4'),_0x3b07('0x5'),_0x3b07('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x3b07('0x7')]},'key':{'type':Sequelize[_0x3b07('0x7')]},'keyType':{'type':Sequelize[_0x3b07('0x2')](_0x3b07('0x3'),'variable',_0x3b07('0x5'))},'keyContent':{'type':Sequelize[_0x3b07('0x7')]},'idField':{'type':Sequelize[_0x3b07('0x7')]},'variableName':{'type':Sequelize[_0x3b07('0x7')]}}; \ No newline at end of file +var _0x83d3=['exports','ENUM','customVariable','STRING','string','variable'];(function(_0x177218,_0x5d324d){var _0x2e3c59=function(_0x32df41){while(--_0x32df41){_0x177218['push'](_0x177218['shift']());}};_0x2e3c59(++_0x5d324d);}(_0x83d3,0xea));var _0x383d=function(_0x4f5af0,_0x5af252){_0x4f5af0=_0x4f5af0-0x0;var _0x49647a=_0x83d3[_0x4f5af0];return _0x49647a;};'use strict';var Sequelize=require('sequelize');module[_0x383d('0x0')]={'type':{'type':Sequelize[_0x383d('0x1')]('string','variable',_0x383d('0x2'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x383d('0x3')]},'keyType':{'type':Sequelize[_0x383d('0x1')](_0x383d('0x4'),_0x383d('0x5'),_0x383d('0x2'))},'keyContent':{'type':Sequelize[_0x383d('0x3')]},'idField':{'type':Sequelize[_0x383d('0x3')]},'variableName':{'type':Sequelize[_0x383d('0x3')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 3a11372..2873cc3 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 _0x1902=['key','query','intersection','attributes','fields','length','model','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','include','SalesforceField','catch','show','params','keys','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','map','rawAttributes','fieldName'];(function(_0x536b89,_0x29edda){var _0x592925=function(_0x244468){while(--_0x244468){_0x536b89['push'](_0x536b89['shift']());}};_0x592925(++_0x29edda);}(_0x1902,0x13c));var _0x2190=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1902[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2190('0x0'));var zipdir=require(_0x2190('0x1'));var jsonpatch=require(_0x2190('0x2'));var rp=require(_0x2190('0x3'));var moment=require(_0x2190('0x4'));var BPromise=require(_0x2190('0x5'));var Mustache=require(_0x2190('0x6'));var util=require(_0x2190('0x7'));var path=require(_0x2190('0x8'));var sox=require(_0x2190('0x9'));var csv=require(_0x2190('0xa'));var ejs=require(_0x2190('0xb'));var fs=require('fs');var fs_extra=require(_0x2190('0xc'));var _=require(_0x2190('0xd'));var squel=require(_0x2190('0xe'));var crypto=require(_0x2190('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2190('0xa'));var querystring=require('querystring');var Papa=require(_0x2190('0x10'));var Redis=require(_0x2190('0x11'));var authService=require(_0x2190('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2190('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2190('0x14'))('api');var utils=require(_0x2190('0x15'));var config=require(_0x2190('0x16'));var licenseUtil=require(_0x2190('0x17'));var db=require(_0x2190('0x18'))['db'];function respondWithStatusCode(_0x2dac17,_0x380a31){_0x380a31=_0x380a31||0xcc;return function(_0x435e9d){if(_0x435e9d){return _0x2dac17[_0x2190('0x19')](_0x380a31);}return _0x2dac17[_0x2190('0x1a')](_0x380a31)['end']();};}function respondWithResult(_0x236a16,_0x4c21ab){_0x4c21ab=_0x4c21ab||0xc8;return function(_0x54af2c){if(_0x54af2c){return _0x236a16[_0x2190('0x1a')](_0x4c21ab)[_0x2190('0x1b')](_0x54af2c);}};}function respondWithFilteredResult(_0x10d8fb,_0x3ce328){return function(_0x13262b){if(_0x13262b){var _0x2be66=typeof _0x3ce328[_0x2190('0x1c')]==='undefined'&&typeof _0x3ce328[_0x2190('0x1d')]==='undefined';var _0xe529e5=_0x13262b['count'];var _0xef307a=_0x2be66?0x0:_0x3ce328[_0x2190('0x1c')];var _0x28e066=_0x2be66?_0x13262b[_0x2190('0x1e')]:_0x3ce328[_0x2190('0x1c')]+_0x3ce328[_0x2190('0x1d')];var _0x4ae508;if(_0x28e066>=_0xe529e5){_0x28e066=_0xe529e5;_0x4ae508=0xc8;}else{_0x4ae508=0xce;}_0x10d8fb[_0x2190('0x1a')](_0x4ae508);return _0x10d8fb['set'](_0x2190('0x1f'),_0xef307a+'-'+_0x28e066+'/'+_0xe529e5)['json'](_0x13262b);}return null;};}function patchUpdates(_0x25495e){return function(_0x55a602){try{jsonpatch[_0x2190('0x20')](_0x55a602,_0x25495e,!![]);}catch(_0x168ff6){return BPromise[_0x2190('0x21')](_0x168ff6);}return _0x55a602[_0x2190('0x22')]();};}function saveUpdates(_0x31f064,_0x564c03){return function(_0xe7a16a){if(_0xe7a16a){return _0xe7a16a['update'](_0x31f064)[_0x2190('0x23')](function(_0x352141){return _0x352141;});}return null;};}function removeEntity(_0x25a9cf,_0x1ac570){return function(_0x4650da){if(_0x4650da){return _0x4650da[_0x2190('0x24')]()['then'](function(){_0x25a9cf[_0x2190('0x1a')](0xcc)[_0x2190('0x25')]();});}};}function handleEntityNotFound(_0x378962,_0x4bcd2e){return function(_0x32940e){if(!_0x32940e){_0x378962['sendStatus'](0x194);}return _0x32940e;};}function handleError(_0xb73bf1,_0x2aa24a){_0x2aa24a=_0x2aa24a||0x1f4;return function(_0x2f473a){logger[_0x2190('0x26')](_0x2f473a[_0x2190('0x27')]);if(_0x2f473a[_0x2190('0x28')]){delete _0x2f473a['name'];}_0xb73bf1[_0x2190('0x1a')](_0x2aa24a)['send'](_0x2f473a);};}exports['index']=function(_0x52aa62,_0x4df6ca){var _0x402d16={},_0x15ed31={},_0x3e44e3={'count':0x0,'rows':[]};var _0x5e94c7=_[_0x2190('0x29')](db['SalesforceField'][_0x2190('0x2a')],function(_0x48c6d0){return{'name':_0x48c6d0[_0x2190('0x2b')],'type':_0x48c6d0['type'][_0x2190('0x2c')]};});_0x15ed31['model']=_[_0x2190('0x29')](_0x5e94c7,_0x2190('0x28'));_0x15ed31[_0x2190('0x2d')]=_['keys'](_0x52aa62[_0x2190('0x2d')]);_0x15ed31['filters']=_[_0x2190('0x2e')](_0x15ed31['model'],_0x15ed31['query']);_0x402d16[_0x2190('0x2f')]=_['intersection'](_0x15ed31['model'],qs[_0x2190('0x30')](_0x52aa62['query'][_0x2190('0x30')]));_0x402d16[_0x2190('0x2f')]=_0x402d16[_0x2190('0x2f')][_0x2190('0x31')]?_0x402d16[_0x2190('0x2f')]:_0x15ed31[_0x2190('0x32')];if(!_0x52aa62['query']['hasOwnProperty'](_0x2190('0x33'))){_0x402d16[_0x2190('0x1d')]=qs['limit'](_0x52aa62[_0x2190('0x2d')][_0x2190('0x1d')]);_0x402d16[_0x2190('0x1c')]=qs[_0x2190('0x1c')](_0x52aa62[_0x2190('0x2d')][_0x2190('0x1c')]);}_0x402d16[_0x2190('0x34')]=qs['sort'](_0x52aa62[_0x2190('0x2d')][_0x2190('0x35')]);_0x402d16[_0x2190('0x36')]=qs['filters'](_[_0x2190('0x37')](_0x52aa62[_0x2190('0x2d')],_0x15ed31[_0x2190('0x38')]),_0x5e94c7);if(_0x52aa62[_0x2190('0x2d')][_0x2190('0x39')]){_0x402d16['where']=_['merge'](_0x402d16[_0x2190('0x36')],{'$or':_[_0x2190('0x29')](_0x5e94c7,function(_0x40bbe6){if(_0x40bbe6[_0x2190('0x3a')]!==_0x2190('0x3b')){var _0x35d3be={};_0x35d3be[_0x40bbe6[_0x2190('0x28')]]={'$like':'%'+_0x52aa62[_0x2190('0x2d')][_0x2190('0x39')]+'%'};return _0x35d3be;}})});}_0x402d16=_[_0x2190('0x3c')]({},_0x402d16,_0x52aa62[_0x2190('0x3d')]);var _0x1e0b8c={'where':_0x402d16[_0x2190('0x36')]};return db['SalesforceField'][_0x2190('0x1e')](_0x1e0b8c)[_0x2190('0x23')](function(_0x1f1e8d){_0x3e44e3[_0x2190('0x1e')]=_0x1f1e8d;if(_0x52aa62['query']['includeAll']){_0x402d16[_0x2190('0x3e')]=[{'all':!![]}];}return db[_0x2190('0x3f')]['findAll'](_0x402d16);})[_0x2190('0x23')](function(_0x5969ae){_0x3e44e3['rows']=_0x5969ae;return _0x3e44e3;})['then'](respondWithFilteredResult(_0x4df6ca,_0x402d16))[_0x2190('0x40')](handleError(_0x4df6ca,null));};exports[_0x2190('0x41')]=function(_0x991b9d,_0x4107f1){var _0x138c84={'raw':!![],'where':{'id':_0x991b9d[_0x2190('0x42')]['id']}},_0x1032ef={};_0x1032ef[_0x2190('0x32')]=_[_0x2190('0x43')](db[_0x2190('0x3f')][_0x2190('0x2a')]);_0x1032ef[_0x2190('0x2d')]=_[_0x2190('0x43')](_0x991b9d[_0x2190('0x2d')]);_0x1032ef[_0x2190('0x38')]=_[_0x2190('0x2e')](_0x1032ef[_0x2190('0x32')],_0x1032ef['query']);_0x138c84[_0x2190('0x2f')]=_[_0x2190('0x2e')](_0x1032ef[_0x2190('0x32')],qs[_0x2190('0x30')](_0x991b9d[_0x2190('0x2d')][_0x2190('0x30')]));_0x138c84[_0x2190('0x2f')]=_0x138c84[_0x2190('0x2f')][_0x2190('0x31')]?_0x138c84['attributes']:_0x1032ef['model'];if(_0x991b9d[_0x2190('0x2d')][_0x2190('0x44')]){_0x138c84['include']=[{'all':!![]}];}_0x138c84=_[_0x2190('0x3c')]({},_0x138c84,_0x991b9d[_0x2190('0x3d')]);return db[_0x2190('0x3f')][_0x2190('0x45')](_0x138c84)[_0x2190('0x23')](handleEntityNotFound(_0x4107f1,null))[_0x2190('0x23')](respondWithResult(_0x4107f1,null))[_0x2190('0x40')](handleError(_0x4107f1,null));};exports[_0x2190('0x46')]=function(_0x2dca5a,_0x5579df){return db[_0x2190('0x3f')][_0x2190('0x46')](_0x2dca5a[_0x2190('0x47')],{})[_0x2190('0x23')](respondWithResult(_0x5579df,0xc9))['catch'](handleError(_0x5579df,null));};exports['update']=function(_0x3664ec,_0x588ecb){if(_0x3664ec[_0x2190('0x47')]['id']){delete _0x3664ec[_0x2190('0x47')]['id'];}return db[_0x2190('0x3f')][_0x2190('0x45')]({'where':{'id':_0x3664ec[_0x2190('0x42')]['id']}})['then'](handleEntityNotFound(_0x588ecb,null))[_0x2190('0x23')](saveUpdates(_0x3664ec[_0x2190('0x47')],null))['then'](respondWithResult(_0x588ecb,null))[_0x2190('0x40')](handleError(_0x588ecb,null));};exports[_0x2190('0x24')]=function(_0x3c8ca0,_0x3b3b2e){return db[_0x2190('0x3f')][_0x2190('0x45')]({'where':{'id':_0x3c8ca0[_0x2190('0x42')]['id']}})['then'](handleEntityNotFound(_0x3b3b2e,null))[_0x2190('0x23')](removeEntity(_0x3b3b2e,null))[_0x2190('0x40')](handleError(_0x3b3b2e,null));}; \ No newline at end of file +var _0xae6e=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','update','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','destroy','then','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x1e70ce,_0x4ee8c0){var _0x2277a6=function(_0x380502){while(--_0x380502){_0x1e70ce['push'](_0x1e70ce['shift']());}};_0x2277a6(++_0x4ee8c0);}(_0xae6e,0x135));var _0xeae6=function(_0x15e790,_0x16a92f){_0x15e790=_0x15e790-0x0;var _0x38c23f=_0xae6e[_0x15e790];return _0x38c23f;};'use strict';var emlformat=require(_0xeae6('0x0'));var rimraf=require(_0xeae6('0x1'));var zipdir=require(_0xeae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeae6('0x3'));var moment=require(_0xeae6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeae6('0x5'));var util=require(_0xeae6('0x6'));var path=require(_0xeae6('0x7'));var sox=require('sox');var csv=require(_0xeae6('0x8'));var ejs=require(_0xeae6('0x9'));var fs=require('fs');var fs_extra=require(_0xeae6('0xa'));var _=require(_0xeae6('0xb'));var squel=require('squel');var crypto=require(_0xeae6('0xc'));var jsforce=require(_0xeae6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xeae6('0x8'));var querystring=require(_0xeae6('0xe'));var Papa=require(_0xeae6('0xf'));var Redis=require(_0xeae6('0x10'));var authService=require(_0xeae6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xeae6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xeae6('0x13'));var licenseUtil=require(_0xeae6('0x14'));var db=require(_0xeae6('0x15'))['db'];function respondWithStatusCode(_0x2fae2a,_0x2b4bec){_0x2b4bec=_0x2b4bec||0xcc;return function(_0x1d764f){if(_0x1d764f){return _0x2fae2a[_0xeae6('0x16')](_0x2b4bec);}return _0x2fae2a[_0xeae6('0x17')](_0x2b4bec)[_0xeae6('0x18')]();};}function respondWithResult(_0x3d59de,_0x3e1fab){_0x3e1fab=_0x3e1fab||0xc8;return function(_0x524014){if(_0x524014){return _0x3d59de[_0xeae6('0x17')](_0x3e1fab)[_0xeae6('0x19')](_0x524014);}};}function respondWithFilteredResult(_0xb41bdb,_0x9e4acf){return function(_0xfb22c3){if(_0xfb22c3){var _0xfb2c7d=typeof _0x9e4acf[_0xeae6('0x1a')]===_0xeae6('0x1b')&&typeof _0x9e4acf[_0xeae6('0x1c')]===_0xeae6('0x1b');var _0x340beb=_0xfb22c3[_0xeae6('0x1d')];var _0x5b1ce0=_0xfb2c7d?0x0:_0x9e4acf[_0xeae6('0x1a')];var _0x23bd0d=_0xfb2c7d?_0xfb22c3[_0xeae6('0x1d')]:_0x9e4acf[_0xeae6('0x1a')]+_0x9e4acf['limit'];var _0xc539a8;if(_0x23bd0d>=_0x340beb){_0x23bd0d=_0x340beb;_0xc539a8=0xc8;}else{_0xc539a8=0xce;}_0xb41bdb[_0xeae6('0x17')](_0xc539a8);return _0xb41bdb['set'](_0xeae6('0x1e'),_0x5b1ce0+'-'+_0x23bd0d+'/'+_0x340beb)[_0xeae6('0x19')](_0xfb22c3);}return null;};}function patchUpdates(_0x2cbe38){return function(_0x27bbf8){try{jsonpatch['apply'](_0x27bbf8,_0x2cbe38,!![]);}catch(_0x205619){return BPromise['reject'](_0x205619);}return _0x27bbf8[_0xeae6('0x1f')]();};}function saveUpdates(_0x303d0d,_0x5db271){return function(_0x109bc7){if(_0x109bc7){return _0x109bc7['update'](_0x303d0d)['then'](function(_0x4627ce){return _0x4627ce;});}return null;};}function removeEntity(_0x2ee122,_0x53d636){return function(_0x27bfb3){if(_0x27bfb3){return _0x27bfb3[_0xeae6('0x20')]()[_0xeae6('0x21')](function(){_0x2ee122[_0xeae6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x246a1d,_0x2adb7b){return function(_0x17e771){if(!_0x17e771){_0x246a1d[_0xeae6('0x16')](0x194);}return _0x17e771;};}function handleError(_0x5c0b2a,_0x31e540){_0x31e540=_0x31e540||0x1f4;return function(_0x7c13c1){logger[_0xeae6('0x22')](_0x7c13c1[_0xeae6('0x23')]);if(_0x7c13c1[_0xeae6('0x24')]){delete _0x7c13c1['name'];}_0x5c0b2a['status'](_0x31e540)[_0xeae6('0x25')](_0x7c13c1);};}exports['index']=function(_0x1ef54b,_0x106a3c){var _0x11e701={},_0x271d68={},_0x18659a={'count':0x0,'rows':[]};var _0x4bd72a=_[_0xeae6('0x26')](db[_0xeae6('0x27')][_0xeae6('0x28')],function(_0x5b09f9){return{'name':_0x5b09f9[_0xeae6('0x29')],'type':_0x5b09f9[_0xeae6('0x2a')][_0xeae6('0x2b')]};});_0x271d68[_0xeae6('0x2c')]=_[_0xeae6('0x26')](_0x4bd72a,_0xeae6('0x24'));_0x271d68[_0xeae6('0x2d')]=_[_0xeae6('0x2e')](_0x1ef54b[_0xeae6('0x2d')]);_0x271d68[_0xeae6('0x2f')]=_[_0xeae6('0x30')](_0x271d68['model'],_0x271d68[_0xeae6('0x2d')]);_0x11e701['attributes']=_[_0xeae6('0x30')](_0x271d68[_0xeae6('0x2c')],qs['fields'](_0x1ef54b[_0xeae6('0x2d')][_0xeae6('0x31')]));_0x11e701[_0xeae6('0x32')]=_0x11e701['attributes']['length']?_0x11e701[_0xeae6('0x32')]:_0x271d68[_0xeae6('0x2c')];if(!_0x1ef54b[_0xeae6('0x2d')][_0xeae6('0x33')](_0xeae6('0x34'))){_0x11e701[_0xeae6('0x1c')]=qs[_0xeae6('0x1c')](_0x1ef54b[_0xeae6('0x2d')][_0xeae6('0x1c')]);_0x11e701[_0xeae6('0x1a')]=qs['offset'](_0x1ef54b['query'][_0xeae6('0x1a')]);}_0x11e701[_0xeae6('0x35')]=qs['sort'](_0x1ef54b[_0xeae6('0x2d')][_0xeae6('0x36')]);_0x11e701[_0xeae6('0x37')]=qs[_0xeae6('0x2f')](_[_0xeae6('0x38')](_0x1ef54b['query'],_0x271d68[_0xeae6('0x2f')]),_0x4bd72a);if(_0x1ef54b['query'][_0xeae6('0x39')]){_0x11e701[_0xeae6('0x37')]=_[_0xeae6('0x3a')](_0x11e701[_0xeae6('0x37')],{'$or':_[_0xeae6('0x26')](_0x4bd72a,function(_0x2b6421){if(_0x2b6421[_0xeae6('0x2a')]!==_0xeae6('0x3b')){var _0x32dfed={};_0x32dfed[_0x2b6421[_0xeae6('0x24')]]={'$like':'%'+_0x1ef54b['query'][_0xeae6('0x39')]+'%'};return _0x32dfed;}})});}_0x11e701=_[_0xeae6('0x3a')]({},_0x11e701,_0x1ef54b['options']);var _0x572ec6={'where':_0x11e701[_0xeae6('0x37')]};return db[_0xeae6('0x27')][_0xeae6('0x1d')](_0x572ec6)[_0xeae6('0x21')](function(_0x4be90d){_0x18659a['count']=_0x4be90d;if(_0x1ef54b[_0xeae6('0x2d')][_0xeae6('0x3c')]){_0x11e701[_0xeae6('0x3d')]=[{'all':!![]}];}return db[_0xeae6('0x27')][_0xeae6('0x3e')](_0x11e701);})[_0xeae6('0x21')](function(_0x3aa498){_0x18659a[_0xeae6('0x3f')]=_0x3aa498;return _0x18659a;})['then'](respondWithFilteredResult(_0x106a3c,_0x11e701))[_0xeae6('0x40')](handleError(_0x106a3c,null));};exports[_0xeae6('0x41')]=function(_0x5c7048,_0x51fefa){var _0x2a439c={'raw':!![],'where':{'id':_0x5c7048[_0xeae6('0x42')]['id']}},_0x6b8e13={};_0x6b8e13[_0xeae6('0x2c')]=_[_0xeae6('0x2e')](db[_0xeae6('0x27')][_0xeae6('0x28')]);_0x6b8e13[_0xeae6('0x2d')]=_[_0xeae6('0x2e')](_0x5c7048['query']);_0x6b8e13[_0xeae6('0x2f')]=_[_0xeae6('0x30')](_0x6b8e13[_0xeae6('0x2c')],_0x6b8e13[_0xeae6('0x2d')]);_0x2a439c[_0xeae6('0x32')]=_[_0xeae6('0x30')](_0x6b8e13[_0xeae6('0x2c')],qs[_0xeae6('0x31')](_0x5c7048[_0xeae6('0x2d')][_0xeae6('0x31')]));_0x2a439c[_0xeae6('0x32')]=_0x2a439c[_0xeae6('0x32')]['length']?_0x2a439c[_0xeae6('0x32')]:_0x6b8e13[_0xeae6('0x2c')];if(_0x5c7048['query']['includeAll']){_0x2a439c[_0xeae6('0x3d')]=[{'all':!![]}];}_0x2a439c=_[_0xeae6('0x3a')]({},_0x2a439c,_0x5c7048[_0xeae6('0x43')]);return db[_0xeae6('0x27')]['find'](_0x2a439c)[_0xeae6('0x21')](handleEntityNotFound(_0x51fefa,null))[_0xeae6('0x21')](respondWithResult(_0x51fefa,null))[_0xeae6('0x40')](handleError(_0x51fefa,null));};exports[_0xeae6('0x44')]=function(_0x507fb3,_0x18a3d2){return db[_0xeae6('0x27')][_0xeae6('0x44')](_0x507fb3[_0xeae6('0x45')],{})[_0xeae6('0x21')](respondWithResult(_0x18a3d2,0xc9))['catch'](handleError(_0x18a3d2,null));};exports[_0xeae6('0x46')]=function(_0xf77d7c,_0x5db9da){if(_0xf77d7c[_0xeae6('0x45')]['id']){delete _0xf77d7c[_0xeae6('0x45')]['id'];}return db[_0xeae6('0x27')]['find']({'where':{'id':_0xf77d7c[_0xeae6('0x42')]['id']}})[_0xeae6('0x21')](handleEntityNotFound(_0x5db9da,null))[_0xeae6('0x21')](saveUpdates(_0xf77d7c[_0xeae6('0x45')],null))[_0xeae6('0x21')](respondWithResult(_0x5db9da,null))[_0xeae6('0x40')](handleError(_0x5db9da,null));};exports['destroy']=function(_0x4a22ac,_0x3a3e77){return db[_0xeae6('0x27')][_0xeae6('0x47')]({'where':{'id':_0x4a22ac[_0xeae6('0x42')]['id']}})[_0xeae6('0x21')](handleEntityNotFound(_0x3a3e77,null))[_0xeae6('0x21')](removeEntity(_0x3a3e77,null))['catch'](handleError(_0x3a3e77,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 9743d5e..cb930d2 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 _0x0a03=['salesforce_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields'];(function(_0x389ccc,_0x2dfa34){var _0x18a7c2=function(_0x4bd9f2){while(--_0x4bd9f2){_0x389ccc['push'](_0x389ccc['shift']());}};_0x18a7c2(++_0x2dfa34);}(_0x0a03,0x92));var _0x30a0=function(_0x18c53c,_0x32258c){_0x18c53c=_0x18c53c-0x0;var _0x56dc80=_0x0a03[_0x18c53c];return _0x56dc80;};'use strict';var _=require(_0x30a0('0x0'));var util=require(_0x30a0('0x1'));var logger=require(_0x30a0('0x2'))(_0x30a0('0x3'));var moment=require(_0x30a0('0x4'));var BPromise=require(_0x30a0('0x5'));var rp=require(_0x30a0('0x6'));var fs=require('fs');var path=require(_0x30a0('0x7'));var rimraf=require(_0x30a0('0x8'));var config=require('../../config/environment');var attributes=require(_0x30a0('0x9'));module[_0x30a0('0xa')]=function(_0x3edeb1,_0x139a26){return _0x3edeb1[_0x30a0('0xb')](_0x30a0('0xc'),attributes,{'tableName':_0x30a0('0xd'),'paranoid':![],'indexes':[{'name':_0x30a0('0xe'),'fields':[_0x30a0('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde8f=['../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0xde8f,0x19e));var _0xfde8=function(_0xd04799,_0x2b410b){_0xd04799=_0xd04799-0x0;var _0x4fd587=_0xde8f[_0xd04799];return _0x4fd587;};'use strict';var _=require(_0xfde8('0x0'));var util=require(_0xfde8('0x1'));var logger=require(_0xfde8('0x2'))('api');var moment=require(_0xfde8('0x3'));var BPromise=require(_0xfde8('0x4'));var rp=require(_0xfde8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfde8('0x6'));var attributes=require(_0xfde8('0x7'));module['exports']=function(_0x3eeb70,_0x2eea16){return _0x3eeb70[_0xfde8('0x8')](_0xfde8('0x9'),attributes,{'tableName':_0xfde8('0xa'),'paranoid':![],'indexes':[{'name':_0xfde8('0xb'),'fields':[_0xfde8('0xc'),_0xfde8('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 75683ae..2bacc3a 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 _0x408b=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0x408b,0x145));var _0xb408=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x408b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb408('0x0'));var util=require(_0xb408('0x1'));var moment=require(_0xb408('0x2'));var BPromise=require(_0xb408('0x3'));var rs=require(_0xb408('0x4'));var fs=require('fs');var Redis=require(_0xb408('0x5'));var db=require(_0xb408('0x6'))['db'];var utils=require(_0xb408('0x7'));var logger=require(_0xb408('0x8'))(_0xb408('0x9'));var config=require('../../config/environment');var jayson=require(_0xb408('0xa'));var client=jayson['client'][_0xb408('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f0c3d,_0x368659,_0xd257c6){return new BPromise(function(_0x3271f8,_0x1bcfcf){return client[_0xb408('0xc')](_0x4f0c3d,_0xd257c6)[_0xb408('0xd')](function(_0x153964){logger[_0xb408('0xe')]('SalesforceField,\x20%s,\x20%s',_0x368659,_0xb408('0xf'));logger[_0xb408('0x10')](_0xb408('0x11'),_0x368659,_0xb408('0xf'),JSON[_0xb408('0x12')](_0x153964));if(_0x153964[_0xb408('0x13')]){if(_0x153964[_0xb408('0x13')][_0xb408('0x14')]===0x1f4){logger[_0xb408('0x13')](_0xb408('0x15'),_0x368659,_0x153964[_0xb408('0x13')][_0xb408('0x16')]);return _0x1bcfcf(_0x153964[_0xb408('0x13')][_0xb408('0x16')]);}logger[_0xb408('0x13')](_0xb408('0x15'),_0x368659,_0x153964[_0xb408('0x13')]['message']);return _0x3271f8(_0x153964[_0xb408('0x13')][_0xb408('0x16')]);}else{logger['info'](_0xb408('0x15'),_0x368659,_0xb408('0xf'));_0x3271f8(_0x153964[_0xb408('0x17')][_0xb408('0x16')]);}})[_0xb408('0x18')](function(_0xb49c5c){logger[_0xb408('0x13')](_0xb408('0x15'),_0x368659,_0xb49c5c);_0x1bcfcf(_0xb49c5c);});});} \ No newline at end of file +var _0x25b5=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','error','code','message','SalesforceField,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x133327,_0x12ab30){var _0x698bba=function(_0x49fcd1){while(--_0x49fcd1){_0x133327['push'](_0x133327['shift']());}};_0x698bba(++_0x12ab30);}(_0x25b5,0x1a1));var _0x525b=function(_0x37d5d0,_0x231113){_0x37d5d0=_0x37d5d0-0x0;var _0x2aaf0b=_0x25b5[_0x37d5d0];return _0x2aaf0b;};'use strict';var _=require(_0x525b('0x0'));var util=require(_0x525b('0x1'));var moment=require(_0x525b('0x2'));var BPromise=require(_0x525b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x525b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x525b('0x5'));var logger=require(_0x525b('0x6'))(_0x525b('0x7'));var config=require(_0x525b('0x8'));var jayson=require(_0x525b('0x9'));var client=jayson[_0x525b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f7e74,_0x41b15c,_0x4df78f){return new BPromise(function(_0x3d4a91,_0x4bcca3){return client[_0x525b('0xb')](_0x1f7e74,_0x4df78f)['then'](function(_0x23dc14){logger[_0x525b('0xc')]('SalesforceField,\x20%s,\x20%s',_0x41b15c,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x41b15c,_0x525b('0xd'),JSON['stringify'](_0x23dc14));if(_0x23dc14[_0x525b('0xe')]){if(_0x23dc14['error'][_0x525b('0xf')]===0x1f4){logger[_0x525b('0xe')]('SalesforceField,\x20%s,\x20%s',_0x41b15c,_0x23dc14[_0x525b('0xe')][_0x525b('0x10')]);return _0x4bcca3(_0x23dc14[_0x525b('0xe')][_0x525b('0x10')]);}logger['error'](_0x525b('0x11'),_0x41b15c,_0x23dc14[_0x525b('0xe')]['message']);return _0x3d4a91(_0x23dc14[_0x525b('0xe')][_0x525b('0x10')]);}else{logger['info'](_0x525b('0x11'),_0x41b15c,_0x525b('0xd'));_0x3d4a91(_0x23dc14[_0x525b('0x12')][_0x525b('0x10')]);}})[_0x525b('0x13')](function(_0x4eb629){logger['error'](_0x525b('0x11'),_0x41b15c,_0x4eb629);_0x4bcca3(_0x4eb629);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index c6e9b08..aebfb95 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 _0x81a4=['getFields','post','create','addConfiguration','update','delete','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x52e57f,_0x545436){var _0x2aac74=function(_0x282faa){while(--_0x282faa){_0x52e57f['push'](_0x52e57f['shift']());}};_0x2aac74(++_0x545436);}(_0x81a4,0x1a6));var _0x481a=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x81a4[_0x51a6d6];return _0x5ef1a8;};'use strict';var multer=require(_0x481a('0x0'));var util=require(_0x481a('0x1'));var path=require(_0x481a('0x2'));var timeout=require(_0x481a('0x3'));var express=require('express');var router=express[_0x481a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x481a('0x5'));var interaction=require(_0x481a('0x6'));var config=require(_0x481a('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x481a('0x8')]('/',auth[_0x481a('0x9')](),controller[_0x481a('0xa')]);router[_0x481a('0x8')]('/:id',auth[_0x481a('0x9')](),controller[_0x481a('0xb')]);router[_0x481a('0x8')](_0x481a('0xc'),auth[_0x481a('0x9')](),controller[_0x481a('0xd')]);router['get'](_0x481a('0xe'),auth[_0x481a('0x9')](),controller[_0x481a('0xf')]);router[_0x481a('0x10')]('/',auth[_0x481a('0x9')](),controller[_0x481a('0x11')]);router[_0x481a('0x10')](_0x481a('0xc'),auth[_0x481a('0x9')](),controller[_0x481a('0x12')]);router['put']('/:id',auth[_0x481a('0x9')](),controller[_0x481a('0x13')]);router[_0x481a('0x14')](_0x481a('0x15'),auth[_0x481a('0x9')](),controller[_0x481a('0x16')]);module['exports']=router; \ No newline at end of file +var _0xf0f4=['create','post','addConfiguration','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x4e2a30,_0x594ef9){var _0x41c18d=function(_0x1f18b0){while(--_0x1f18b0){_0x4e2a30['push'](_0x4e2a30['shift']());}};_0x41c18d(++_0x594ef9);}(_0xf0f4,0x1d3));var _0x4f0f=function(_0x37add6,_0x5301ad){_0x37add6=_0x37add6-0x0;var _0x442257=_0xf0f4[_0x37add6];return _0x442257;};'use strict';var multer=require(_0x4f0f('0x0'));var util=require(_0x4f0f('0x1'));var path=require(_0x4f0f('0x2'));var timeout=require(_0x4f0f('0x3'));var express=require(_0x4f0f('0x4'));var router=express[_0x4f0f('0x5')]();var fs_extra=require(_0x4f0f('0x6'));var auth=require(_0x4f0f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4f0f('0x8'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x4f0f('0x9')](),controller['index']);router['get'](_0x4f0f('0xa'),auth[_0x4f0f('0x9')](),controller[_0x4f0f('0xb')]);router[_0x4f0f('0xc')](_0x4f0f('0xd'),auth[_0x4f0f('0x9')](),controller[_0x4f0f('0xe')]);router[_0x4f0f('0xc')](_0x4f0f('0xf'),auth[_0x4f0f('0x9')](),controller[_0x4f0f('0x10')]);router['post']('/',auth[_0x4f0f('0x9')](),controller[_0x4f0f('0x11')]);router[_0x4f0f('0x12')]('/:id/configurations',auth[_0x4f0f('0x9')](),controller[_0x4f0f('0x13')]);router[_0x4f0f('0x14')](_0x4f0f('0xa'),auth[_0x4f0f('0x9')](),controller[_0x4f0f('0x15')]);router['delete'](_0x4f0f('0xa'),auth[_0x4f0f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index a7cb368..1bff118 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 _0x5f19=['STRING','username','remoteUri'];(function(_0x40b7fc,_0x51c685){var _0xe7387a=function(_0x3a9c1d){while(--_0x3a9c1d){_0x40b7fc['push'](_0x40b7fc['shift']());}};_0xe7387a(++_0x51c685);}(_0x5f19,0xab));var _0x95f1=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0x5f19[_0x506d83];return _0x335e8b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x95f1('0x0')],'unique':_0x95f1('0x1')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x95f1('0x0')]},'remoteUri':{'type':Sequelize[_0x95f1('0x0')],'unique':_0x95f1('0x2')},'serverUrl':{'type':Sequelize[_0x95f1('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0xd4bf=['remoteUri','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd4bf,0x1a5));var _0xfd4b=function(_0x20834b,_0x40e0c8){_0x20834b=_0x20834b-0x0;var _0x395d2b=_0xd4bf[_0x20834b];return _0x395d2b;};'use strict';var Sequelize=require(_0xfd4b('0x0'));module[_0xfd4b('0x1')]={'name':{'type':Sequelize[_0xfd4b('0x2')]},'description':{'type':Sequelize[_0xfd4b('0x2')]},'username':{'type':Sequelize[_0xfd4b('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xfd4b('0x2')]},'email':{'type':Sequelize[_0xfd4b('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfd4b('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 5680833..f93d9df 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 _0xff2f=['attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','include','body','update','params','find','getConfigurations','findOne','ServicenowConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','ServicenowField','made_sla','hold_reason','close_code','notify','incident_state','category','parent','caused_by','child_incidents','approval_history','number','resolved_by','sys_updated_by','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','delivery_plan','active','work_notes_list','priority','sys_domain_path','expected_start','opened_at','business_duration','work_end','resolved_at','caller_id','approval_set','subcategory','work_notes','correlation_display','delivery_task','assignment_group','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','assigned_to','severity','approval','due_date','reopen_count','sys_tags','escalation','upon_approval','location','username','email','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','label','push','all','TCL:\x20_object','internalType','ServiceNow\x20error:\x20','test','stack','Wrong\x20credentials','statusCode','boolean','True','true','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','save','then','destroy','error','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields'];(function(_0x5e10b1,_0x48b784){var _0x5c8830=function(_0x42f942){while(--_0x42f942){_0x5e10b1['push'](_0x5e10b1['shift']());}};_0x5c8830(++_0x48b784);}(_0xff2f,0x133));var _0xfff2=function(_0x3eb211,_0x4a2e7f){_0x3eb211=_0x3eb211-0x0;var _0xb32a15=_0xff2f[_0x3eb211];return _0xb32a15;};'use strict';var emlformat=require(_0xfff2('0x0'));var rimraf=require(_0xfff2('0x1'));var zipdir=require(_0xfff2('0x2'));var jsonpatch=require(_0xfff2('0x3'));var rp=require(_0xfff2('0x4'));var moment=require(_0xfff2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfff2('0x6'));var util=require(_0xfff2('0x7'));var path=require(_0xfff2('0x8'));var sox=require(_0xfff2('0x9'));var csv=require(_0xfff2('0xa'));var ejs=require(_0xfff2('0xb'));var fs=require('fs');var fs_extra=require(_0xfff2('0xc'));var _=require(_0xfff2('0xd'));var squel=require('squel');var crypto=require(_0xfff2('0xe'));var jsforce=require(_0xfff2('0xf'));var deskjs=require(_0xfff2('0x10'));var toCsv=require(_0xfff2('0xa'));var querystring=require(_0xfff2('0x11'));var Papa=require(_0xfff2('0x12'));var Redis=require(_0xfff2('0x13'));var authService=require(_0xfff2('0x14'));var qs=require(_0xfff2('0x15'));var as=require(_0xfff2('0x16'));var hardwareService=require(_0xfff2('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xfff2('0x18'));var config=require(_0xfff2('0x19'));var licenseUtil=require(_0xfff2('0x1a'));var db=require(_0xfff2('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1de06a,_0x42a984){_0x42a984=_0x42a984||0xcc;return function(_0x2b5aeb){if(_0x2b5aeb){return _0x1de06a[_0xfff2('0x1c')](_0x42a984);}return _0x1de06a[_0xfff2('0x1d')](_0x42a984)[_0xfff2('0x1e')]();};}function respondWithResult(_0x272d4e,_0x371f00){_0x371f00=_0x371f00||0xc8;return function(_0x32ba34){if(_0x32ba34){return _0x272d4e['status'](_0x371f00)[_0xfff2('0x1f')](_0x32ba34);}};}function respondWithFilteredResult(_0x11badf,_0x3ab169){return function(_0x66723a){if(_0x66723a){var _0x348cab=typeof _0x3ab169[_0xfff2('0x20')]==='undefined'&&typeof _0x3ab169[_0xfff2('0x21')]===_0xfff2('0x22');var _0x239edc=_0x66723a[_0xfff2('0x23')];var _0x36928e=_0x348cab?0x0:_0x3ab169[_0xfff2('0x20')];var _0x3fd230=_0x348cab?_0x66723a['count']:_0x3ab169[_0xfff2('0x20')]+_0x3ab169[_0xfff2('0x21')];var _0x445502;if(_0x3fd230>=_0x239edc){_0x3fd230=_0x239edc;_0x445502=0xc8;}else{_0x445502=0xce;}_0x11badf['status'](_0x445502);return _0x11badf['set']('Content-Range',_0x36928e+'-'+_0x3fd230+'/'+_0x239edc)[_0xfff2('0x1f')](_0x66723a);}return null;};}function patchUpdates(_0x21f612){return function(_0x194ba3){try{jsonpatch['apply'](_0x194ba3,_0x21f612,!![]);}catch(_0x1d3b7d){return BPromise['reject'](_0x1d3b7d);}return _0x194ba3[_0xfff2('0x24')]();};}function saveUpdates(_0xc3b62a,_0x54d736){return function(_0x22d998){if(_0x22d998){return _0x22d998['update'](_0xc3b62a)[_0xfff2('0x25')](function(_0x1d150f){return _0x1d150f;});}return null;};}function removeEntity(_0x348177,_0x1990bc){return function(_0x3d0dc2){if(_0x3d0dc2){return _0x3d0dc2[_0xfff2('0x26')]()[_0xfff2('0x25')](function(){_0x348177[_0xfff2('0x1d')](0xcc)[_0xfff2('0x1e')]();});}};}function handleEntityNotFound(_0xa48dcc,_0x3633a3){return function(_0x125fed){if(!_0x125fed){_0xa48dcc[_0xfff2('0x1c')](0x194);}return _0x125fed;};}function handleError(_0x3cb4ea,_0x544e47){_0x544e47=_0x544e47||0x1f4;return function(_0x387b0e){logger[_0xfff2('0x27')](_0x387b0e['stack']);if(_0x387b0e[_0xfff2('0x28')]){delete _0x387b0e[_0xfff2('0x28')];}_0x3cb4ea['status'](_0x544e47)[_0xfff2('0x29')](_0x387b0e);};}exports[_0xfff2('0x2a')]=function(_0x161b30,_0x405d04){var _0x37b55c={},_0x128450={},_0x522e09={'count':0x0,'rows':[]};var _0x111564=_['map'](db[_0xfff2('0x2b')][_0xfff2('0x2c')],function(_0x1e727b){return{'name':_0x1e727b[_0xfff2('0x2d')],'type':_0x1e727b[_0xfff2('0x2e')][_0xfff2('0x2f')]};});_0x128450[_0xfff2('0x30')]=_[_0xfff2('0x31')](_0x111564,'name');_0x128450['query']=_[_0xfff2('0x32')](_0x161b30[_0xfff2('0x33')]);_0x128450[_0xfff2('0x34')]=_[_0xfff2('0x35')](_0x128450[_0xfff2('0x30')],_0x128450[_0xfff2('0x33')]);_0x37b55c['attributes']=_[_0xfff2('0x35')](_0x128450[_0xfff2('0x30')],qs[_0xfff2('0x36')](_0x161b30[_0xfff2('0x33')][_0xfff2('0x36')]));_0x37b55c[_0xfff2('0x37')]=_0x37b55c[_0xfff2('0x37')][_0xfff2('0x38')]?_0x37b55c[_0xfff2('0x37')]:_0x128450[_0xfff2('0x30')];if(!_0x161b30[_0xfff2('0x33')][_0xfff2('0x39')]('nolimit')){_0x37b55c['limit']=qs[_0xfff2('0x21')](_0x161b30[_0xfff2('0x33')][_0xfff2('0x21')]);_0x37b55c[_0xfff2('0x20')]=qs[_0xfff2('0x20')](_0x161b30['query'][_0xfff2('0x20')]);}_0x37b55c['order']=qs[_0xfff2('0x3a')](_0x161b30[_0xfff2('0x33')]['sort']);_0x37b55c[_0xfff2('0x3b')]=qs[_0xfff2('0x34')](_[_0xfff2('0x3c')](_0x161b30[_0xfff2('0x33')],_0x128450['filters']),_0x111564);if(_0x161b30[_0xfff2('0x33')][_0xfff2('0x3d')]){_0x37b55c[_0xfff2('0x3b')]=_['merge'](_0x37b55c['where'],{'$or':_[_0xfff2('0x31')](_0x111564,function(_0x58ada2){if(_0x58ada2[_0xfff2('0x2e')]!==_0xfff2('0x3e')){var _0xc177b0={};_0xc177b0[_0x58ada2[_0xfff2('0x28')]]={'$like':'%'+_0x161b30[_0xfff2('0x33')][_0xfff2('0x3d')]+'%'};return _0xc177b0;}})});}_0x37b55c=_[_0xfff2('0x3f')]({},_0x37b55c,_0x161b30[_0xfff2('0x40')]);var _0x488a67={'where':_0x37b55c[_0xfff2('0x3b')]};return db[_0xfff2('0x2b')]['count'](_0x488a67)[_0xfff2('0x25')](function(_0x415d98){_0x522e09[_0xfff2('0x23')]=_0x415d98;if(_0x161b30[_0xfff2('0x33')][_0xfff2('0x41')]){_0x37b55c['include']=[{'all':!![]}];}return db[_0xfff2('0x2b')][_0xfff2('0x42')](_0x37b55c);})[_0xfff2('0x25')](function(_0x31666c){_0x522e09[_0xfff2('0x43')]=_0x31666c;return _0x522e09;})[_0xfff2('0x25')](respondWithFilteredResult(_0x405d04,_0x37b55c))[_0xfff2('0x44')](handleError(_0x405d04,null));};exports[_0xfff2('0x45')]=function(_0x38316b,_0x3c5baa){var _0x4bda67={'raw':![],'where':{'id':_0x38316b['params']['id']}},_0x13243d={};_0x13243d[_0xfff2('0x30')]=_['keys'](db[_0xfff2('0x2b')]['rawAttributes']);_0x13243d[_0xfff2('0x33')]=_[_0xfff2('0x32')](_0x38316b[_0xfff2('0x33')]);_0x13243d[_0xfff2('0x34')]=_[_0xfff2('0x35')](_0x13243d[_0xfff2('0x30')],_0x13243d[_0xfff2('0x33')]);_0x4bda67[_0xfff2('0x37')]=_[_0xfff2('0x35')](_0x13243d['model'],qs[_0xfff2('0x36')](_0x38316b[_0xfff2('0x33')][_0xfff2('0x36')]));_0x4bda67[_0xfff2('0x37')]=_0x4bda67[_0xfff2('0x37')][_0xfff2('0x38')]?_0x4bda67[_0xfff2('0x37')]:_0x13243d['model'];if(_0x38316b[_0xfff2('0x33')][_0xfff2('0x41')]){_0x4bda67[_0xfff2('0x46')]=[{'all':!![]}];}_0x4bda67=_['merge']({},_0x4bda67,_0x38316b[_0xfff2('0x40')]);return db['ServicenowAccount']['find'](_0x4bda67)['then'](handleEntityNotFound(_0x3c5baa,null))[_0xfff2('0x25')](respondWithResult(_0x3c5baa,null))[_0xfff2('0x44')](handleError(_0x3c5baa,null));};exports['create']=function(_0x5816c1,_0x3e739e){return db[_0xfff2('0x2b')]['create'](_0x5816c1[_0xfff2('0x47')],{})[_0xfff2('0x25')](respondWithResult(_0x3e739e,0xc9))[_0xfff2('0x44')](handleError(_0x3e739e,null));};exports[_0xfff2('0x48')]=function(_0x43e232,_0x1bb091){if(_0x43e232[_0xfff2('0x47')]['id']){delete _0x43e232[_0xfff2('0x47')]['id'];}return db[_0xfff2('0x2b')]['find']({'where':{'id':_0x43e232[_0xfff2('0x49')]['id']}})['then'](handleEntityNotFound(_0x1bb091,null))[_0xfff2('0x25')](saveUpdates(_0x43e232[_0xfff2('0x47')],null))[_0xfff2('0x25')](respondWithResult(_0x1bb091,null))['catch'](handleError(_0x1bb091,null));};exports[_0xfff2('0x26')]=function(_0x59578a,_0x32e318){return db[_0xfff2('0x2b')][_0xfff2('0x4a')]({'where':{'id':_0x59578a[_0xfff2('0x49')]['id']}})[_0xfff2('0x25')](handleEntityNotFound(_0x32e318,null))[_0xfff2('0x25')](removeEntity(_0x32e318,null))[_0xfff2('0x44')](handleError(_0x32e318,null));};exports[_0xfff2('0x4b')]=function(_0x2ac00f,_0xe5d73c,_0x15431e){var _0x4da276={};var _0x4b5dfe={};var _0x49b860;var _0x7d0a6a;return db[_0xfff2('0x2b')][_0xfff2('0x4c')]({'where':{'id':_0x2ac00f[_0xfff2('0x49')]['id']}})[_0xfff2('0x25')](handleEntityNotFound(_0xe5d73c,null))['then'](function(_0x56ba02){if(_0x56ba02){_0x49b860=_0x56ba02;_0x4b5dfe[_0xfff2('0x30')]=_[_0xfff2('0x32')](db[_0xfff2('0x4d')]['rawAttributes']);_0x4b5dfe[_0xfff2('0x33')]=_['keys'](_0x2ac00f['query']);_0x4b5dfe[_0xfff2('0x34')]=_[_0xfff2('0x35')](_0x4b5dfe[_0xfff2('0x30')],_0x4b5dfe[_0xfff2('0x33')]);_0x4da276['attributes']=_['intersection'](_0x4b5dfe[_0xfff2('0x30')],qs['fields'](_0x2ac00f[_0xfff2('0x33')][_0xfff2('0x36')]));_0x4da276[_0xfff2('0x37')]=_0x4da276[_0xfff2('0x37')]['length']?_0x4da276['attributes']:_0x4b5dfe[_0xfff2('0x30')];_0x4da276['order']=qs[_0xfff2('0x3a')](_0x2ac00f['query']['sort']);_0x4da276['where']=qs[_0xfff2('0x34')](_['pick'](_0x2ac00f['query'],_0x4b5dfe[_0xfff2('0x34')]));if(_0x2ac00f['query'][_0xfff2('0x3d')]){_0x4da276[_0xfff2('0x3b')]=_[_0xfff2('0x3f')](_0x4da276[_0xfff2('0x3b')],{'$or':_['map'](_0x4da276[_0xfff2('0x37')],function(_0xccf95c){var _0x153598={};_0x153598[_0xccf95c]={'$like':'%'+_0x2ac00f[_0xfff2('0x33')]['filter']+'%'};return _0x153598;})});}_0x4da276=_[_0xfff2('0x3f')]({},_0x4da276,_0x2ac00f['options']);return _0x49b860[_0xfff2('0x4b')](_0x4da276);}})[_0xfff2('0x25')](function(_0x2b8879){if(_0x2b8879){_0x7d0a6a=_0x2b8879[_0xfff2('0x38')];if(!_0x2ac00f[_0xfff2('0x33')]['hasOwnProperty'](_0xfff2('0x4e'))){_0x4da276[_0xfff2('0x21')]=qs[_0xfff2('0x21')](_0x2ac00f['query'][_0xfff2('0x21')]);_0x4da276[_0xfff2('0x20')]=qs[_0xfff2('0x20')](_0x2ac00f['query'][_0xfff2('0x20')]);}return _0x49b860[_0xfff2('0x4b')](_0x4da276);}})[_0xfff2('0x25')](function(_0xaf6d6a){if(_0xaf6d6a){return _0xaf6d6a?{'count':_0x7d0a6a,'rows':_0xaf6d6a}:null;}})[_0xfff2('0x25')](respondWithResult(_0xe5d73c,null))[_0xfff2('0x44')](handleError(_0xe5d73c,null));};exports[_0xfff2('0x4f')]=function(_0x5bc737,_0x3a1506,_0x1e77fc){if(_0x5bc737['body']['id']){delete _0x5bc737[_0xfff2('0x47')]['id'];}return db[_0xfff2('0x2b')][_0xfff2('0x4c')]({'where':{'id':_0x5bc737[_0xfff2('0x49')]['id']}})[_0xfff2('0x25')](handleEntityNotFound(_0x3a1506,null))[_0xfff2('0x25')](function(_0x25ce07){if(_0x25ce07){_0x5bc737[_0xfff2('0x47')][_0xfff2('0x50')]=_0x25ce07['id'];_0x5bc737[_0xfff2('0x47')][_0xfff2('0x51')]=integrations[_0xfff2('0x52')](_0x5bc737['body'][_0xfff2('0x53')],_0x5bc737[_0xfff2('0x47')]['type']);_0x5bc737[_0xfff2('0x47')][_0xfff2('0x54')]=integrations[_0xfff2('0x55')](_0x5bc737[_0xfff2('0x47')]['channel'],_0x5bc737[_0xfff2('0x47')]['type']);return db[_0xfff2('0x4d')][_0xfff2('0x56')](_0x5bc737[_0xfff2('0x47')],{'include':[{'model':db[_0xfff2('0x57')],'as':_0xfff2('0x51')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0xfff2('0x25')](respondWithResult(_0x3a1506,null))['catch'](handleError(_0x3a1506,null));};exports['getFields']=function(_0x39c003,_0x16d83a,_0x77ce92){var _0x3d6724=[_0xfff2('0x58'),_0xfff2('0x59'),'knowledge','subcategory',_0xfff2('0x5a'),_0xfff2('0x5b'),_0xfff2('0x5c'),'severity',_0xfff2('0x5d')];var _0xb79f64=[_0xfff2('0x5e'),_0xfff2('0x58'),_0xfff2('0x5f'),'watch_list','upon_reject','sys_updated_on',_0xfff2('0x60'),_0xfff2('0x59'),_0xfff2('0x61'),_0xfff2('0x62'),_0xfff2('0x63'),_0xfff2('0x64'),'opened_by','user_input',_0xfff2('0x65'),_0xfff2('0x66'),_0xfff2('0x67'),_0xfff2('0x68'),_0xfff2('0x69'),'order',_0xfff2('0x6a'),_0xfff2('0x6b'),'cmdb_ci',_0xfff2('0x6c'),'impact',_0xfff2('0x6d'),_0xfff2('0x6e'),'business_service',_0xfff2('0x6f'),_0xfff2('0x70'),'rfc','time_worked',_0xfff2('0x71'),_0xfff2('0x72'),_0xfff2('0x73'),'group_list',_0xfff2('0x74'),'reopened_time',_0xfff2('0x75'),_0xfff2('0x76'),_0xfff2('0x77'),_0xfff2('0x78'),_0xfff2('0x79'),'short_description',_0xfff2('0x5a'),_0xfff2('0x7a'),_0xfff2('0x7b'),'work_start',_0xfff2('0x7c'),'business_stc','additional_assignee_list',_0xfff2('0x7d'),_0xfff2('0x7e'),_0xfff2('0x5b'),_0xfff2('0x7f'),_0xfff2('0x80'),_0xfff2('0x81'),_0xfff2('0x82'),_0xfff2('0x83'),_0xfff2('0x84'),_0xfff2('0x85'),_0xfff2('0x86'),_0xfff2('0x5c'),_0xfff2('0x87'),_0xfff2('0x88'),'company',_0xfff2('0x89'),'activity_due',_0xfff2('0x8a'),_0xfff2('0x8b'),'comments','sla_due',_0xfff2('0x8c'),'comments_and_work_notes',_0xfff2('0x8d'),'sys_mod_count',_0xfff2('0x8e'),_0xfff2('0x8f'),_0xfff2('0x90'),_0xfff2('0x91'),'correlation_id',_0xfff2('0x92'),_0xfff2('0x5d')];var _0x5568b9='';var _0x25f1e1='';var _0x4c1e0d=[];var _0x58b6f8='';var _0x4f2137='';var _0x2b2a41=[];var _0x305055='';var _0x4e1d2f='';var _0x560626={};var _0x230e7e='';return db[_0xfff2('0x2b')][_0xfff2('0x4c')]({'where':{'id':_0x39c003['params']['id']},'attributes':['id',_0xfff2('0x93'),'password',_0xfff2('0x94'),'remoteUri','serverUrl']})[_0xfff2('0x25')](handleEntityNotFound(_0x16d83a,null))[_0xfff2('0x25')](function(_0x268542){if(_0x268542){_0x230e7e=_0x268542[_0xfff2('0x95')];var _0xbaa69b=_0x230e7e['slice'](-0x1);if(_0xbaa69b==='/'){_0x230e7e=_0x230e7e[_0xfff2('0x96')](0x0,_0x230e7e[_0xfff2('0x97')](_0xbaa69b));}_0x4e1d2f=util[_0xfff2('0x98')](_0xfff2('0x99'),_0x230e7e);_0x305055=util[_0xfff2('0x98')](_0xfff2('0x9a'),_0x230e7e);_0x560626={'user':_0x268542['username'],'pass':_0x268542[_0xfff2('0x9b')]};var _0x548f6e={'method':_0xfff2('0x9c'),'uri':_0x4e1d2f+_0xfff2('0x9d'),'auth':_0x560626,'json':!![]};return rp(_0x548f6e);}})[_0xfff2('0x25')](function(_0x422b2d){if(_0x422b2d[_0xfff2('0x9e')][_0xfff2('0x38')]>0x0){_0x5568b9=_0x422b2d[_0xfff2('0x9e')];}console[_0xfff2('0x9f')]('incident\x20table\x20objects',_0x5568b9);_0x2b2a41=[];_0x25f1e1=Object[_0xfff2('0xa0')]([],_0x5568b9);_[_0xfff2('0xa1')](_0x25f1e1,function(_0xa90ee2){return!_0x3d6724[_0xfff2('0xa2')](_0xa90ee2[_0xfff2('0x28')]);});_0x25f1e1[_0xfff2('0xa3')](function(_0xa2a509){var _0xf2a5c8=createFieldObject(_0x305055,_0x560626,_0xa2a509['internalType'],_0xa2a509['name'],_0xa2a509[_0xfff2('0xa4')],![]);_0x2b2a41[_0xfff2('0xa5')](_0xf2a5c8);});return Promise[_0xfff2('0xa6')](_0x2b2a41);})[_0xfff2('0x25')](function(_0x1db249){_0x4c1e0d=_0x1db249;_0x58b6f8=Object[_0xfff2('0xa0')]([],_0x5568b9);console[_0xfff2('0x9f')](_0xfff2('0xa7'),_0x5568b9);_[_0xfff2('0xa1')](_0x58b6f8,function(_0x5d3bfc){return _0xb79f64[_0xfff2('0xa2')](_0x5d3bfc[_0xfff2('0x28')]);});console[_0xfff2('0x9f')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x58b6f8);_0x2b2a41=[];_0x58b6f8['forEach'](function(_0x112bba){var _0x7a9c09=createFieldObject(_0x305055,_0x560626,_0x112bba[_0xfff2('0xa8')],_0x112bba[_0xfff2('0x28')],_0x112bba[_0xfff2('0xa4')],!![]);_0x2b2a41[_0xfff2('0xa5')](_0x7a9c09);});return Promise['all'](_0x2b2a41);})[_0xfff2('0x25')](function(_0x48e1fd){_0x4f2137=_0x48e1fd;var _0x103c27=_0x4c1e0d['concat'](_0x4f2137);return{'count':_0x103c27[_0xfff2('0x38')],'rows':_0x103c27};})[_0xfff2('0x25')](respondWithResult(_0x16d83a,null))[_0xfff2('0x44')](function(_0x38b731){console[_0xfff2('0x9f')](_0xfff2('0xa9')+_0x38b731);var _0x26f08e=_0x39c003[_0xfff2('0x33')][_0xfff2('0xaa')]?0x1f4:_0x38b731['statusCode']||0x1f4;logger['error'](_0x38b731[_0xfff2('0xab')]);delete _0x38b731[_0xfff2('0x28')];if(_0x26f08e===0x191){_0x26f08e=0x190;}_0x16d83a[_0xfff2('0x1d')](_0x26f08e)['send'](_0x39c003['query'][_0xfff2('0xaa')]?{'message':_0xfff2('0xac'),'statusCode':_0x38b731[_0xfff2('0xad')]}:_0x38b731);});};function createFieldObject(_0x29f6da,_0x5da781,_0x515eec,_0x51e4f7,_0x317a06,_0x246545){return new Promise(function(_0x2fe44f,_0x3310fe){var _0x79b9bf={'id':_0x51e4f7,'name':_0x317a06,'custom':_0x246545};if(_0x515eec===_0xfff2('0xae')){_0x79b9bf[_0xfff2('0x40')]=[{'name':_0xfff2('0xaf'),'value':_0xfff2('0xb0')},{'name':'False','value':'false'}];_0x2fe44f(_0x79b9bf);}else{var _0x4cfc62={'method':_0xfff2('0x9c'),'uri':_0x29f6da+_0xfff2('0xb1')+_0x51e4f7,'auth':_0x5da781,'json':!![]};return rp(_0x4cfc62)['then'](function(_0x3d41f4){var _0x23aa9e=[];if(_0x3d41f4['result'][_0xfff2('0x38')]>0x0){_0x3d41f4[_0xfff2('0x9e')][_0xfff2('0xa3')](function(_0x54e5c1){if(_0x54e5c1[_0xfff2('0xb2')]===_0xfff2('0xb3')){var _0x3f4767={'name':_0x54e5c1['label'],'value':_0x54e5c1[_0xfff2('0xb4')]};_0x23aa9e[_0xfff2('0xa5')](_0x3f4767);}});}_0x79b9bf[_0xfff2('0x40')]=_0x23aa9e;if(_0x79b9bf[_0xfff2('0x40')]['length']>0x0){_0x2fe44f(_0x79b9bf);}else{if(_0x246545==![]){_0x2fe44f();}else{_0x2fe44f(_0x79b9bf);}}});}});} \ No newline at end of file +var _0x3886=['%s/api/now/doc/table/schema/','username','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','Content-Range','save','update','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','ServicenowAccount','catch','show','params','keys','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','pick','nolimit','AccountId','channel','Descriptions','ServicenowField','Subjects','made_sla','hold_reason','knowledge','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','sys_created_on','state','sys_created_by','cmdb_ci','delivery_plan','impact','work_notes_list','sys_domain_path','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','close_code','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','location','email','remoteUri','slice','substring','lastIndexOf','format'];(function(_0x2687b9,_0x1d7069){var _0x3d19b7=function(_0x4516bb){while(--_0x4516bb){_0x2687b9['push'](_0x2687b9['shift']());}};_0x3d19b7(++_0x1d7069);}(_0x3886,0x18b));var _0x6388=function(_0x4893da,_0x55e388){_0x4893da=_0x4893da-0x0;var _0x254761=_0x3886[_0x4893da];return _0x254761;};'use strict';var emlformat=require(_0x6388('0x0'));var rimraf=require(_0x6388('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6388('0x2'));var rp=require('request-promise');var moment=require(_0x6388('0x3'));var BPromise=require(_0x6388('0x4'));var Mustache=require(_0x6388('0x5'));var util=require('util');var path=require(_0x6388('0x6'));var sox=require(_0x6388('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6388('0x8'));var squel=require(_0x6388('0x9'));var crypto=require(_0x6388('0xa'));var jsforce=require(_0x6388('0xb'));var deskjs=require(_0x6388('0xc'));var toCsv=require(_0x6388('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6388('0xe'));var qs=require(_0x6388('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6388('0x10'))(_0x6388('0x11'));var utils=require('../../config/utils');var config=require(_0x6388('0x12'));var licenseUtil=require(_0x6388('0x13'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4591fd,_0x26fa60){_0x26fa60=_0x26fa60||0xcc;return function(_0x22fb57){if(_0x22fb57){return _0x4591fd[_0x6388('0x14')](_0x26fa60);}return _0x4591fd[_0x6388('0x15')](_0x26fa60)['end']();};}function respondWithResult(_0xa2029b,_0x3a3e5d){_0x3a3e5d=_0x3a3e5d||0xc8;return function(_0x723b3b){if(_0x723b3b){return _0xa2029b[_0x6388('0x15')](_0x3a3e5d)[_0x6388('0x16')](_0x723b3b);}};}function respondWithFilteredResult(_0x5d4b27,_0x5f4ad0){return function(_0x5bae5a){if(_0x5bae5a){var _0x4aa5c5=typeof _0x5f4ad0[_0x6388('0x17')]==='undefined'&&typeof _0x5f4ad0[_0x6388('0x18')]==='undefined';var _0x1ffc03=_0x5bae5a['count'];var _0x59c3ef=_0x4aa5c5?0x0:_0x5f4ad0[_0x6388('0x17')];var _0x116f7d=_0x4aa5c5?_0x5bae5a[_0x6388('0x19')]:_0x5f4ad0[_0x6388('0x17')]+_0x5f4ad0[_0x6388('0x18')];var _0xfca7f8;if(_0x116f7d>=_0x1ffc03){_0x116f7d=_0x1ffc03;_0xfca7f8=0xc8;}else{_0xfca7f8=0xce;}_0x5d4b27[_0x6388('0x15')](_0xfca7f8);return _0x5d4b27[_0x6388('0x1a')](_0x6388('0x1b'),_0x59c3ef+'-'+_0x116f7d+'/'+_0x1ffc03)[_0x6388('0x16')](_0x5bae5a);}return null;};}function patchUpdates(_0x1dadff){return function(_0x41a1bc){try{jsonpatch['apply'](_0x41a1bc,_0x1dadff,!![]);}catch(_0x16a99f){return BPromise['reject'](_0x16a99f);}return _0x41a1bc[_0x6388('0x1c')]();};}function saveUpdates(_0x506851,_0x4cd146){return function(_0x5a1df4){if(_0x5a1df4){return _0x5a1df4[_0x6388('0x1d')](_0x506851)[_0x6388('0x1e')](function(_0x151188){return _0x151188;});}return null;};}function removeEntity(_0x23cbdb,_0x389dde){return function(_0x320924){if(_0x320924){return _0x320924['destroy']()['then'](function(){_0x23cbdb[_0x6388('0x15')](0xcc)[_0x6388('0x1f')]();});}};}function handleEntityNotFound(_0x4b2ccf,_0x30504b){return function(_0x5e1e94){if(!_0x5e1e94){_0x4b2ccf['sendStatus'](0x194);}return _0x5e1e94;};}function handleError(_0x651ad7,_0x456e3b){_0x456e3b=_0x456e3b||0x1f4;return function(_0x5b95ad){logger[_0x6388('0x20')](_0x5b95ad[_0x6388('0x21')]);if(_0x5b95ad[_0x6388('0x22')]){delete _0x5b95ad['name'];}_0x651ad7[_0x6388('0x15')](_0x456e3b)[_0x6388('0x23')](_0x5b95ad);};}exports[_0x6388('0x24')]=function(_0x3976cd,_0x2f1830){var _0x2b0b4b={},_0x45ba9d={},_0x294b1f={'count':0x0,'rows':[]};var _0x242208=_['map'](db['ServicenowAccount'][_0x6388('0x25')],function(_0x2bc42c){return{'name':_0x2bc42c[_0x6388('0x26')],'type':_0x2bc42c[_0x6388('0x27')][_0x6388('0x28')]};});_0x45ba9d[_0x6388('0x29')]=_[_0x6388('0x2a')](_0x242208,_0x6388('0x22'));_0x45ba9d['query']=_['keys'](_0x3976cd['query']);_0x45ba9d[_0x6388('0x2b')]=_[_0x6388('0x2c')](_0x45ba9d[_0x6388('0x29')],_0x45ba9d[_0x6388('0x2d')]);_0x2b0b4b[_0x6388('0x2e')]=_[_0x6388('0x2c')](_0x45ba9d[_0x6388('0x29')],qs['fields'](_0x3976cd[_0x6388('0x2d')][_0x6388('0x2f')]));_0x2b0b4b[_0x6388('0x2e')]=_0x2b0b4b[_0x6388('0x2e')][_0x6388('0x30')]?_0x2b0b4b[_0x6388('0x2e')]:_0x45ba9d[_0x6388('0x29')];if(!_0x3976cd[_0x6388('0x2d')][_0x6388('0x31')]('nolimit')){_0x2b0b4b[_0x6388('0x18')]=qs['limit'](_0x3976cd[_0x6388('0x2d')][_0x6388('0x18')]);_0x2b0b4b['offset']=qs['offset'](_0x3976cd['query'][_0x6388('0x17')]);}_0x2b0b4b[_0x6388('0x32')]=qs[_0x6388('0x33')](_0x3976cd['query'][_0x6388('0x33')]);_0x2b0b4b[_0x6388('0x34')]=qs[_0x6388('0x2b')](_['pick'](_0x3976cd[_0x6388('0x2d')],_0x45ba9d[_0x6388('0x2b')]),_0x242208);if(_0x3976cd[_0x6388('0x2d')][_0x6388('0x35')]){_0x2b0b4b[_0x6388('0x34')]=_['merge'](_0x2b0b4b['where'],{'$or':_['map'](_0x242208,function(_0x292aac){if(_0x292aac[_0x6388('0x27')]!==_0x6388('0x36')){var _0x2067f0={};_0x2067f0[_0x292aac['name']]={'$like':'%'+_0x3976cd[_0x6388('0x2d')]['filter']+'%'};return _0x2067f0;}})});}_0x2b0b4b=_[_0x6388('0x37')]({},_0x2b0b4b,_0x3976cd[_0x6388('0x38')]);var _0x3d9340={'where':_0x2b0b4b[_0x6388('0x34')]};return db['ServicenowAccount'][_0x6388('0x19')](_0x3d9340)[_0x6388('0x1e')](function(_0x127fa3){_0x294b1f[_0x6388('0x19')]=_0x127fa3;if(_0x3976cd[_0x6388('0x2d')][_0x6388('0x39')]){_0x2b0b4b[_0x6388('0x3a')]=[{'all':!![]}];}return db[_0x6388('0x3b')]['findAll'](_0x2b0b4b);})[_0x6388('0x1e')](function(_0x83db8b){_0x294b1f['rows']=_0x83db8b;return _0x294b1f;})[_0x6388('0x1e')](respondWithFilteredResult(_0x2f1830,_0x2b0b4b))[_0x6388('0x3c')](handleError(_0x2f1830,null));};exports[_0x6388('0x3d')]=function(_0x2848ee,_0x3ddbbd){var _0x265c3b={'raw':![],'where':{'id':_0x2848ee[_0x6388('0x3e')]['id']}},_0x1e644b={};_0x1e644b[_0x6388('0x29')]=_[_0x6388('0x3f')](db[_0x6388('0x3b')][_0x6388('0x25')]);_0x1e644b['query']=_['keys'](_0x2848ee['query']);_0x1e644b[_0x6388('0x2b')]=_[_0x6388('0x2c')](_0x1e644b[_0x6388('0x29')],_0x1e644b[_0x6388('0x2d')]);_0x265c3b[_0x6388('0x2e')]=_['intersection'](_0x1e644b[_0x6388('0x29')],qs[_0x6388('0x2f')](_0x2848ee[_0x6388('0x2d')][_0x6388('0x2f')]));_0x265c3b[_0x6388('0x2e')]=_0x265c3b[_0x6388('0x2e')][_0x6388('0x30')]?_0x265c3b[_0x6388('0x2e')]:_0x1e644b['model'];if(_0x2848ee[_0x6388('0x2d')][_0x6388('0x39')]){_0x265c3b[_0x6388('0x3a')]=[{'all':!![]}];}_0x265c3b=_['merge']({},_0x265c3b,_0x2848ee[_0x6388('0x38')]);return db[_0x6388('0x3b')][_0x6388('0x40')](_0x265c3b)['then'](handleEntityNotFound(_0x3ddbbd,null))[_0x6388('0x1e')](respondWithResult(_0x3ddbbd,null))[_0x6388('0x3c')](handleError(_0x3ddbbd,null));};exports[_0x6388('0x41')]=function(_0x5689a2,_0xfb54b5){return db['ServicenowAccount'][_0x6388('0x41')](_0x5689a2['body'],{})[_0x6388('0x1e')](respondWithResult(_0xfb54b5,0xc9))[_0x6388('0x3c')](handleError(_0xfb54b5,null));};exports[_0x6388('0x1d')]=function(_0x13e686,_0x2832f8){if(_0x13e686[_0x6388('0x42')]['id']){delete _0x13e686[_0x6388('0x42')]['id'];}return db['ServicenowAccount'][_0x6388('0x40')]({'where':{'id':_0x13e686['params']['id']}})[_0x6388('0x1e')](handleEntityNotFound(_0x2832f8,null))['then'](saveUpdates(_0x13e686[_0x6388('0x42')],null))['then'](respondWithResult(_0x2832f8,null))[_0x6388('0x3c')](handleError(_0x2832f8,null));};exports[_0x6388('0x43')]=function(_0x301834,_0x448c0f){return db['ServicenowAccount']['find']({'where':{'id':_0x301834[_0x6388('0x3e')]['id']}})['then'](handleEntityNotFound(_0x448c0f,null))[_0x6388('0x1e')](removeEntity(_0x448c0f,null))['catch'](handleError(_0x448c0f,null));};exports[_0x6388('0x44')]=function(_0x286676,_0x3788bb,_0x4c06bc){var _0x38df54={};var _0x460bd5={};var _0x3a5005;var _0x525f4d;return db[_0x6388('0x3b')][_0x6388('0x45')]({'where':{'id':_0x286676[_0x6388('0x3e')]['id']}})[_0x6388('0x1e')](handleEntityNotFound(_0x3788bb,null))[_0x6388('0x1e')](function(_0x152dfe){if(_0x152dfe){_0x3a5005=_0x152dfe;_0x460bd5[_0x6388('0x29')]=_[_0x6388('0x3f')](db[_0x6388('0x46')][_0x6388('0x25')]);_0x460bd5[_0x6388('0x2d')]=_[_0x6388('0x3f')](_0x286676[_0x6388('0x2d')]);_0x460bd5[_0x6388('0x2b')]=_[_0x6388('0x2c')](_0x460bd5[_0x6388('0x29')],_0x460bd5[_0x6388('0x2d')]);_0x38df54[_0x6388('0x2e')]=_[_0x6388('0x2c')](_0x460bd5[_0x6388('0x29')],qs[_0x6388('0x2f')](_0x286676[_0x6388('0x2d')][_0x6388('0x2f')]));_0x38df54[_0x6388('0x2e')]=_0x38df54[_0x6388('0x2e')][_0x6388('0x30')]?_0x38df54['attributes']:_0x460bd5[_0x6388('0x29')];_0x38df54[_0x6388('0x32')]=qs[_0x6388('0x33')](_0x286676[_0x6388('0x2d')]['sort']);_0x38df54[_0x6388('0x34')]=qs[_0x6388('0x2b')](_[_0x6388('0x47')](_0x286676[_0x6388('0x2d')],_0x460bd5[_0x6388('0x2b')]));if(_0x286676[_0x6388('0x2d')][_0x6388('0x35')]){_0x38df54[_0x6388('0x34')]=_[_0x6388('0x37')](_0x38df54[_0x6388('0x34')],{'$or':_[_0x6388('0x2a')](_0x38df54[_0x6388('0x2e')],function(_0x278219){var _0x20d074={};_0x20d074[_0x278219]={'$like':'%'+_0x286676[_0x6388('0x2d')]['filter']+'%'};return _0x20d074;})});}_0x38df54=_[_0x6388('0x37')]({},_0x38df54,_0x286676[_0x6388('0x38')]);return _0x3a5005[_0x6388('0x44')](_0x38df54);}})[_0x6388('0x1e')](function(_0x2b357d){if(_0x2b357d){_0x525f4d=_0x2b357d[_0x6388('0x30')];if(!_0x286676['query']['hasOwnProperty'](_0x6388('0x48'))){_0x38df54[_0x6388('0x18')]=qs[_0x6388('0x18')](_0x286676[_0x6388('0x2d')]['limit']);_0x38df54[_0x6388('0x17')]=qs[_0x6388('0x17')](_0x286676[_0x6388('0x2d')][_0x6388('0x17')]);}return _0x3a5005['getConfigurations'](_0x38df54);}})['then'](function(_0x45a39f){if(_0x45a39f){return _0x45a39f?{'count':_0x525f4d,'rows':_0x45a39f}:null;}})[_0x6388('0x1e')](respondWithResult(_0x3788bb,null))[_0x6388('0x3c')](handleError(_0x3788bb,null));};exports['addConfiguration']=function(_0x5b122f,_0x5e2d46,_0x265c75){if(_0x5b122f['body']['id']){delete _0x5b122f['body']['id'];}return db[_0x6388('0x3b')]['findOne']({'where':{'id':_0x5b122f[_0x6388('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5e2d46,null))[_0x6388('0x1e')](function(_0x3ae184){if(_0x3ae184){_0x5b122f[_0x6388('0x42')][_0x6388('0x49')]=_0x3ae184['id'];_0x5b122f['body']['Subjects']=integrations['getSubjects'](_0x5b122f[_0x6388('0x42')][_0x6388('0x4a')],_0x5b122f['body'][_0x6388('0x27')]);_0x5b122f[_0x6388('0x42')][_0x6388('0x4b')]=integrations['getDescriptions'](_0x5b122f[_0x6388('0x42')][_0x6388('0x4a')],_0x5b122f['body'][_0x6388('0x27')]);return db['ServicenowConfiguration'][_0x6388('0x41')](_0x5b122f[_0x6388('0x42')],{'include':[{'model':db[_0x6388('0x4c')],'as':_0x6388('0x4d')},{'model':db[_0x6388('0x4c')],'as':_0x6388('0x4b')}]});}return null;})[_0x6388('0x1e')](respondWithResult(_0x5e2d46,null))[_0x6388('0x3c')](handleError(_0x5e2d46,null));};exports['getFields']=function(_0x23d585,_0x2ae605,_0x163720){var _0x22e86e=[_0x6388('0x4e'),_0x6388('0x4f'),_0x6388('0x50'),'subcategory','close_code','notify','incident_state','severity',_0x6388('0x51')];var _0x2601be=[_0x6388('0x52'),_0x6388('0x4e'),_0x6388('0x53'),_0x6388('0x54'),_0x6388('0x55'),_0x6388('0x56'),_0x6388('0x57'),'hold_reason',_0x6388('0x58'),_0x6388('0x59'),_0x6388('0x5a'),_0x6388('0x5b'),'opened_by','user_input',_0x6388('0x5c'),'sys_domain',_0x6388('0x5d'),_0x6388('0x5e'),_0x6388('0x50'),_0x6388('0x32'),'calendar_stc','closed_at',_0x6388('0x5f'),_0x6388('0x60'),_0x6388('0x61'),'active',_0x6388('0x62'),'business_service','priority',_0x6388('0x63'),'rfc',_0x6388('0x64'),_0x6388('0x65'),_0x6388('0x66'),'business_duration',_0x6388('0x67'),_0x6388('0x68'),_0x6388('0x69'),_0x6388('0x6a'),_0x6388('0x6b'),_0x6388('0x6c'),_0x6388('0x6d'),_0x6388('0x6e'),_0x6388('0x6f'),_0x6388('0x70'),'correlation_display','delivery_task',_0x6388('0x71'),_0x6388('0x72'),_0x6388('0x73'),_0x6388('0x74'),_0x6388('0x75'),_0x6388('0x76'),_0x6388('0x77'),_0x6388('0x78'),_0x6388('0x79'),_0x6388('0x7a'),_0x6388('0x7b'),_0x6388('0x7c'),_0x6388('0x7d'),_0x6388('0x7e'),_0x6388('0x7f'),_0x6388('0x80'),'urgency',_0x6388('0x81'),_0x6388('0x82'),_0x6388('0x83'),_0x6388('0x84'),_0x6388('0x85'),'severity',_0x6388('0x86'),_0x6388('0x87'),_0x6388('0x88'),_0x6388('0x89'),_0x6388('0x8a'),_0x6388('0x8b'),_0x6388('0x8c'),'sys_tags',_0x6388('0x8d'),_0x6388('0x8e'),_0x6388('0x8f'),_0x6388('0x90'),_0x6388('0x51')];var _0x5be50c='';var _0x40cab2='';var _0x53d7f6=[];var _0x5ea184='';var _0x3679e8='';var _0x38f1ee=[];var _0x111ae4='';var _0x3d06d6='';var _0x30898b={};var _0x309238='';return db[_0x6388('0x3b')][_0x6388('0x45')]({'where':{'id':_0x23d585['params']['id']},'attributes':['id','username','password',_0x6388('0x91'),_0x6388('0x92'),'serverUrl']})[_0x6388('0x1e')](handleEntityNotFound(_0x2ae605,null))['then'](function(_0x4dc60f){if(_0x4dc60f){_0x309238=_0x4dc60f[_0x6388('0x92')];var _0x204062=_0x309238[_0x6388('0x93')](-0x1);if(_0x204062==='/'){_0x309238=_0x309238[_0x6388('0x94')](0x0,_0x309238[_0x6388('0x95')](_0x204062));}_0x3d06d6=util[_0x6388('0x96')](_0x6388('0x97'),_0x309238);_0x111ae4=util[_0x6388('0x96')]('%s/api/now/table/',_0x309238);_0x30898b={'user':_0x4dc60f[_0x6388('0x98')],'pass':_0x4dc60f[_0x6388('0x99')]};var _0x1a4572={'method':_0x6388('0x9a'),'uri':_0x3d06d6+_0x6388('0x9b'),'auth':_0x30898b,'json':!![]};return rp(_0x1a4572);}})[_0x6388('0x1e')](function(_0x1549a8){if(_0x1549a8['result'][_0x6388('0x30')]>0x0){_0x5be50c=_0x1549a8[_0x6388('0x9c')];}console[_0x6388('0x9d')](_0x6388('0x9e'),_0x5be50c);_0x38f1ee=[];_0x40cab2=Object[_0x6388('0x9f')]([],_0x5be50c);_[_0x6388('0xa0')](_0x40cab2,function(_0x2b5b97){return!_0x22e86e[_0x6388('0xa1')](_0x2b5b97[_0x6388('0x22')]);});_0x40cab2[_0x6388('0xa2')](function(_0x49968f){var _0x19dd57=createFieldObject(_0x111ae4,_0x30898b,_0x49968f[_0x6388('0xa3')],_0x49968f[_0x6388('0x22')],_0x49968f[_0x6388('0xa4')],![]);_0x38f1ee[_0x6388('0xa5')](_0x19dd57);});return Promise[_0x6388('0xa6')](_0x38f1ee);})[_0x6388('0x1e')](function(_0x2c7c07){_0x53d7f6=_0x2c7c07;_0x5ea184=Object[_0x6388('0x9f')]([],_0x5be50c);console[_0x6388('0x9d')](_0x6388('0xa7'),_0x5be50c);_[_0x6388('0xa0')](_0x5ea184,function(_0x3dc32a){return _0x2601be[_0x6388('0xa1')](_0x3dc32a[_0x6388('0x22')]);});console['log'](_0x6388('0xa8'),_0x5ea184);_0x38f1ee=[];_0x5ea184[_0x6388('0xa2')](function(_0x50de6d){var _0x347e7f=createFieldObject(_0x111ae4,_0x30898b,_0x50de6d[_0x6388('0xa3')],_0x50de6d['name'],_0x50de6d[_0x6388('0xa4')],!![]);_0x38f1ee['push'](_0x347e7f);});return Promise[_0x6388('0xa6')](_0x38f1ee);})[_0x6388('0x1e')](function(_0x24dfdb){_0x3679e8=_0x24dfdb;var _0x42a01b=_0x53d7f6[_0x6388('0xa9')](_0x3679e8);return{'count':_0x42a01b['length'],'rows':_0x42a01b};})['then'](respondWithResult(_0x2ae605,null))[_0x6388('0x3c')](function(_0x29d4d5){console[_0x6388('0x9d')](_0x6388('0xaa')+_0x29d4d5);var _0x4c4f5a=_0x23d585['query'][_0x6388('0xab')]?0x1f4:_0x29d4d5[_0x6388('0xac')]||0x1f4;logger[_0x6388('0x20')](_0x29d4d5[_0x6388('0x21')]);delete _0x29d4d5[_0x6388('0x22')];if(_0x4c4f5a===0x191){_0x4c4f5a=0x190;}_0x2ae605[_0x6388('0x15')](_0x4c4f5a)[_0x6388('0x23')](_0x23d585[_0x6388('0x2d')]['test']?{'message':_0x6388('0xad'),'statusCode':_0x29d4d5['statusCode']}:_0x29d4d5);});};function createFieldObject(_0x5eed31,_0x560f90,_0x705804,_0x542a8c,_0x4866ad,_0x286133){return new Promise(function(_0x156e37,_0x396c78){var _0x259ec8={'id':_0x542a8c,'name':_0x4866ad,'custom':_0x286133};if(_0x705804===_0x6388('0xae')){_0x259ec8['options']=[{'name':_0x6388('0xaf'),'value':_0x6388('0xb0')},{'name':_0x6388('0xb1'),'value':_0x6388('0xb2')}];_0x156e37(_0x259ec8);}else{var _0x5c2894={'method':_0x6388('0x9a'),'uri':_0x5eed31+_0x6388('0xb3')+_0x542a8c,'auth':_0x560f90,'json':!![]};return rp(_0x5c2894)['then'](function(_0x43db3d){var _0x4d1309=[];if(_0x43db3d[_0x6388('0x9c')][_0x6388('0x30')]>0x0){_0x43db3d[_0x6388('0x9c')][_0x6388('0xa2')](function(_0x17512f){if(_0x17512f[_0x6388('0xb4')]===_0x6388('0xb2')){var _0xc59af0={'name':_0x17512f[_0x6388('0xa4')],'value':_0x17512f[_0x6388('0xb5')]};_0x4d1309[_0x6388('0xa5')](_0xc59af0);}});}_0x259ec8[_0x6388('0x38')]=_0x4d1309;if(_0x259ec8[_0x6388('0x38')][_0x6388('0x30')]>0x0){_0x156e37(_0x259ec8);}else{if(_0x286133==![]){_0x156e37();}else{_0x156e37(_0x259ec8);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 2217b40..a607cf8 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x1999fe,_0xc888cf){var _0xabf9b3=function(_0x23a204){while(--_0x23a204){_0x1999fe['push'](_0x1999fe['shift']());}};_0xabf9b3(++_0xc888cf);}(_0x814b,0x1a2));var _0xb814=function(_0x324e86,_0x81b1cb){_0x324e86=_0x324e86-0x0;var _0x592846=_0x814b[_0x324e86];return _0x592846;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0xac84f4,_0x5c4b1e){var _0x17640f=function(_0x3ca33a){while(--_0x3ca33a){_0xac84f4['push'](_0xac84f4['shift']());}};_0x17640f(++_0x5c4b1e);}(_0x687b,0x14a));var _0xb687=function(_0x59cf0b,_0x53707a){_0x59cf0b=_0x59cf0b-0x0;var _0x51b771=_0x687b[_0x59cf0b];return _0x51b771;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('ServicenowAccount',attributes,{'tableName':_0xb687('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 669aa77..0ea07d7 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 _0x8cab=['options','raw','where','attributes','include','model','map','then','GetServicenowAccount','ShowServicenowAccount','find','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','ServicenowAccount,\x20%s,\x20%s','message','result','findAll'];(function(_0x59700e,_0x4c28f2){var _0x1563c5=function(_0x557b84){while(--_0x557b84){_0x59700e['push'](_0x59700e['shift']());}};_0x1563c5(++_0x4c28f2);}(_0x8cab,0x1d3));var _0xb8ca=function(_0x4064a0,_0x4c9037){_0x4064a0=_0x4064a0-0x0;var _0xabae07=_0x8cab[_0x4064a0];return _0xabae07;};'use strict';var _=require(_0xb8ca('0x0'));var util=require('util');var moment=require(_0xb8ca('0x1'));var BPromise=require('bluebird');var rs=require(_0xb8ca('0x2'));var fs=require('fs');var Redis=require(_0xb8ca('0x3'));var db=require(_0xb8ca('0x4'))['db'];var utils=require(_0xb8ca('0x5'));var logger=require(_0xb8ca('0x6'))(_0xb8ca('0x7'));var config=require(_0xb8ca('0x8'));var jayson=require(_0xb8ca('0x9'));var client=jayson['client'][_0xb8ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x125189,_0x391021,_0x388ace){return new BPromise(function(_0x133a86,_0x4f6075){return client[_0xb8ca('0xb')](_0x125189,_0x388ace)['then'](function(_0x4b4835){logger[_0xb8ca('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x391021,_0xb8ca('0xd'));logger[_0xb8ca('0xe')](_0xb8ca('0xf'),_0x391021,_0xb8ca('0xd'),JSON[_0xb8ca('0x10')](_0x4b4835));if(_0x4b4835['error']){if(_0x4b4835['error'][_0xb8ca('0x11')]===0x1f4){logger[_0xb8ca('0x12')](_0xb8ca('0x13'),_0x391021,_0x4b4835[_0xb8ca('0x12')][_0xb8ca('0x14')]);return _0x4f6075(_0x4b4835['error'][_0xb8ca('0x14')]);}logger[_0xb8ca('0x12')](_0xb8ca('0x13'),_0x391021,_0x4b4835[_0xb8ca('0x12')][_0xb8ca('0x14')]);return _0x133a86(_0x4b4835[_0xb8ca('0x12')][_0xb8ca('0x14')]);}else{logger[_0xb8ca('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x391021,_0xb8ca('0xd'));_0x133a86(_0x4b4835[_0xb8ca('0x15')]['message']);}})['catch'](function(_0x3ea8e1){logger[_0xb8ca('0x12')](_0xb8ca('0x13'),_0x391021,_0x3ea8e1);_0x4f6075(_0x3ea8e1);});});}exports['GetServicenowAccount']=function(_0xff1fe0){var _0x2523fa=this;return new Promise(function(_0x5e9894,_0x28c38c){return db['ServicenowAccount'][_0xb8ca('0x16')]({'raw':_0xff1fe0[_0xb8ca('0x17')]?_0xff1fe0[_0xb8ca('0x17')][_0xb8ca('0x18')]===undefined?!![]:![]:!![],'where':_0xff1fe0[_0xb8ca('0x17')]?_0xff1fe0[_0xb8ca('0x17')][_0xb8ca('0x19')]||null:null,'attributes':_0xff1fe0[_0xb8ca('0x17')]?_0xff1fe0['options'][_0xb8ca('0x1a')]||null:null,'limit':_0xff1fe0[_0xb8ca('0x17')]?_0xff1fe0[_0xb8ca('0x17')]['limit']||null:null,'include':_0xff1fe0[_0xb8ca('0x17')]?_0xff1fe0[_0xb8ca('0x17')][_0xb8ca('0x1b')]?_['map'](_0xff1fe0[_0xb8ca('0x17')][_0xb8ca('0x1b')],function(_0x2db42e){return{'model':db[_0x2db42e[_0xb8ca('0x1c')]],'as':_0x2db42e['as'],'attributes':_0x2db42e[_0xb8ca('0x1a')],'include':_0x2db42e[_0xb8ca('0x1b')]?_[_0xb8ca('0x1d')](_0x2db42e['include'],function(_0x133c38){return{'model':db[_0x133c38[_0xb8ca('0x1c')]],'as':_0x133c38['as'],'attributes':_0x133c38[_0xb8ca('0x1a')],'include':_0x133c38['include']?_[_0xb8ca('0x1d')](_0x133c38['include'],function(_0x413eb9){return{'model':db[_0x413eb9['model']],'as':_0x413eb9['as'],'attributes':_0x413eb9[_0xb8ca('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb8ca('0x1e')](function(_0x2cb694){logger[_0xb8ca('0xc')](_0xb8ca('0x1f'),_0xff1fe0);logger['debug'](_0xb8ca('0x1f'),_0xff1fe0,JSON['stringify'](_0x2cb694));_0x5e9894(_0x2cb694);})['catch'](function(_0x497893){logger[_0xb8ca('0x12')]('GetServicenowAccount',_0x497893[_0xb8ca('0x14')],_0xff1fe0);_0x28c38c(_0x2523fa[_0xb8ca('0x12')](0x1f4,_0x497893['message']));});});};exports[_0xb8ca('0x20')]=function(_0x1ba44d){var _0x4bcbbc=this;return new Promise(function(_0x2310ed,_0x15d52d){return db['ServicenowAccount'][_0xb8ca('0x21')]({'raw':_0x1ba44d['options']?_0x1ba44d[_0xb8ca('0x17')][_0xb8ca('0x18')]===undefined?!![]:![]:!![],'where':_0x1ba44d[_0xb8ca('0x17')]?_0x1ba44d[_0xb8ca('0x17')][_0xb8ca('0x19')]||null:null,'attributes':_0x1ba44d[_0xb8ca('0x17')]?_0x1ba44d[_0xb8ca('0x17')][_0xb8ca('0x1a')]||null:null,'include':_0x1ba44d[_0xb8ca('0x17')]?_0x1ba44d[_0xb8ca('0x17')]['include']?_[_0xb8ca('0x1d')](_0x1ba44d['options']['include'],function(_0x367c17){return{'model':db[_0x367c17[_0xb8ca('0x1c')]],'as':_0x367c17['as'],'attributes':_0x367c17['attributes'],'include':_0x367c17['include']?_[_0xb8ca('0x1d')](_0x367c17[_0xb8ca('0x1b')],function(_0x1dddc9){return{'model':db[_0x1dddc9[_0xb8ca('0x1c')]],'as':_0x1dddc9['as'],'attributes':_0x1dddc9[_0xb8ca('0x1a')],'include':_0x1dddc9[_0xb8ca('0x1b')]?_[_0xb8ca('0x1d')](_0x1dddc9[_0xb8ca('0x1b')],function(_0x48713d){return{'model':db[_0x48713d[_0xb8ca('0x1c')]],'as':_0x48713d['as'],'attributes':_0x48713d[_0xb8ca('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb8ca('0x1e')](function(_0x3539dd){logger[_0xb8ca('0xc')]('ShowServicenowAccount',_0x1ba44d);logger[_0xb8ca('0xe')](_0xb8ca('0x20'),_0x1ba44d,JSON['stringify'](_0x3539dd));_0x2310ed(_0x3539dd);})[_0xb8ca('0x22')](function(_0x3ca0ea){logger[_0xb8ca('0x12')](_0xb8ca('0x20'),_0x3ca0ea['message'],_0x1ba44d);_0x15d52d(_0x4bcbbc[_0xb8ca('0x12')](0x1f4,_0x3ca0ea[_0xb8ca('0x14')]));});});}; \ No newline at end of file +var _0xc7df=['ShowServicenowAccount','debug','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ServicenowAccount','findAll','options','raw','attributes','limit','include','map','model','where'];(function(_0x3c0d80,_0x5996b1){var _0xd36202=function(_0x2636da){while(--_0x2636da){_0x3c0d80['push'](_0x3c0d80['shift']());}};_0xd36202(++_0x5996b1);}(_0xc7df,0xf0));var _0xfc7d=function(_0x47f711,_0x1cb459){_0x47f711=_0x47f711-0x0;var _0x307fb8=_0xc7df[_0x47f711];return _0x307fb8;};'use strict';var _=require('lodash');var util=require(_0xfc7d('0x0'));var moment=require('moment');var BPromise=require(_0xfc7d('0x1'));var rs=require(_0xfc7d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc7d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc7d('0x4'))(_0xfc7d('0x5'));var config=require(_0xfc7d('0x6'));var jayson=require(_0xfc7d('0x7'));var client=jayson[_0xfc7d('0x8')][_0xfc7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17e50f,_0x311ce0,_0x362f9e){return new BPromise(function(_0x11edd2,_0x362d5e){return client[_0xfc7d('0xa')](_0x17e50f,_0x362f9e)[_0xfc7d('0xb')](function(_0x21e7b4){logger[_0xfc7d('0xc')](_0xfc7d('0xd'),_0x311ce0,_0xfc7d('0xe'));logger['debug'](_0xfc7d('0xf'),_0x311ce0,_0xfc7d('0xe'),JSON[_0xfc7d('0x10')](_0x21e7b4));if(_0x21e7b4[_0xfc7d('0x11')]){if(_0x21e7b4[_0xfc7d('0x11')][_0xfc7d('0x12')]===0x1f4){logger[_0xfc7d('0x11')](_0xfc7d('0xd'),_0x311ce0,_0x21e7b4[_0xfc7d('0x11')][_0xfc7d('0x13')]);return _0x362d5e(_0x21e7b4['error'][_0xfc7d('0x13')]);}logger[_0xfc7d('0x11')](_0xfc7d('0xd'),_0x311ce0,_0x21e7b4[_0xfc7d('0x11')][_0xfc7d('0x13')]);return _0x11edd2(_0x21e7b4[_0xfc7d('0x11')][_0xfc7d('0x13')]);}else{logger[_0xfc7d('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x311ce0,_0xfc7d('0xe'));_0x11edd2(_0x21e7b4[_0xfc7d('0x14')][_0xfc7d('0x13')]);}})[_0xfc7d('0x15')](function(_0x3e6583){logger[_0xfc7d('0x11')](_0xfc7d('0xd'),_0x311ce0,_0x3e6583);_0x362d5e(_0x3e6583);});});}exports['GetServicenowAccount']=function(_0x2af456){var _0x513c70=this;return new Promise(function(_0x49ec24,_0x4f3a04){return db[_0xfc7d('0x16')][_0xfc7d('0x17')]({'raw':_0x2af456[_0xfc7d('0x18')]?_0x2af456[_0xfc7d('0x18')][_0xfc7d('0x19')]===undefined?!![]:![]:!![],'where':_0x2af456[_0xfc7d('0x18')]?_0x2af456[_0xfc7d('0x18')]['where']||null:null,'attributes':_0x2af456['options']?_0x2af456['options'][_0xfc7d('0x1a')]||null:null,'limit':_0x2af456[_0xfc7d('0x18')]?_0x2af456[_0xfc7d('0x18')][_0xfc7d('0x1b')]||null:null,'include':_0x2af456[_0xfc7d('0x18')]?_0x2af456[_0xfc7d('0x18')][_0xfc7d('0x1c')]?_[_0xfc7d('0x1d')](_0x2af456['options'][_0xfc7d('0x1c')],function(_0x13b8ab){return{'model':db[_0x13b8ab['model']],'as':_0x13b8ab['as'],'attributes':_0x13b8ab['attributes'],'include':_0x13b8ab[_0xfc7d('0x1c')]?_[_0xfc7d('0x1d')](_0x13b8ab[_0xfc7d('0x1c')],function(_0x4da285){return{'model':db[_0x4da285['model']],'as':_0x4da285['as'],'attributes':_0x4da285[_0xfc7d('0x1a')],'include':_0x4da285['include']?_['map'](_0x4da285[_0xfc7d('0x1c')],function(_0x49bd4f){return{'model':db[_0x49bd4f[_0xfc7d('0x1e')]],'as':_0x49bd4f['as'],'attributes':_0x49bd4f[_0xfc7d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44efad){logger[_0xfc7d('0xc')]('GetServicenowAccount',_0x2af456);logger['debug']('GetServicenowAccount',_0x2af456,JSON[_0xfc7d('0x10')](_0x44efad));_0x49ec24(_0x44efad);})[_0xfc7d('0x15')](function(_0x4849a0){logger['error']('GetServicenowAccount',_0x4849a0[_0xfc7d('0x13')],_0x2af456);_0x4f3a04(_0x513c70[_0xfc7d('0x11')](0x1f4,_0x4849a0[_0xfc7d('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x1b70f2){var _0x4fcd5d=this;return new Promise(function(_0x593c93,_0x1b8fa9){return db['ServicenowAccount']['find']({'raw':_0x1b70f2['options']?_0x1b70f2['options'][_0xfc7d('0x19')]===undefined?!![]:![]:!![],'where':_0x1b70f2[_0xfc7d('0x18')]?_0x1b70f2['options'][_0xfc7d('0x1f')]||null:null,'attributes':_0x1b70f2[_0xfc7d('0x18')]?_0x1b70f2[_0xfc7d('0x18')][_0xfc7d('0x1a')]||null:null,'include':_0x1b70f2['options']?_0x1b70f2['options']['include']?_[_0xfc7d('0x1d')](_0x1b70f2[_0xfc7d('0x18')][_0xfc7d('0x1c')],function(_0x412824){return{'model':db[_0x412824[_0xfc7d('0x1e')]],'as':_0x412824['as'],'attributes':_0x412824[_0xfc7d('0x1a')],'include':_0x412824[_0xfc7d('0x1c')]?_[_0xfc7d('0x1d')](_0x412824['include'],function(_0x10da8d){return{'model':db[_0x10da8d[_0xfc7d('0x1e')]],'as':_0x10da8d['as'],'attributes':_0x10da8d['attributes'],'include':_0x10da8d[_0xfc7d('0x1c')]?_[_0xfc7d('0x1d')](_0x10da8d[_0xfc7d('0x1c')],function(_0x4e59a1){return{'model':db[_0x4e59a1['model']],'as':_0x4e59a1['as'],'attributes':_0x4e59a1[_0xfc7d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x161fa9){logger[_0xfc7d('0xc')](_0xfc7d('0x20'),_0x1b70f2);logger[_0xfc7d('0x21')](_0xfc7d('0x20'),_0x1b70f2,JSON[_0xfc7d('0x10')](_0x161fa9));_0x593c93(_0x161fa9);})[_0xfc7d('0x15')](function(_0x34318f){logger['error'](_0xfc7d('0x20'),_0x34318f[_0xfc7d('0x13')],_0x1b70f2);_0x1b8fa9(_0x4fcd5d[_0xfc7d('0x11')](0x1f4,_0x34318f['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 4779f7a..999c658 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 _0x68cb=['../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5731ce,_0x26a116){var _0x2d5b14=function(_0x2052a4){while(--_0x2052a4){_0x5731ce['push'](_0x5731ce['shift']());}};_0x2d5b14(++_0x26a116);}(_0x68cb,0x102));var _0xb68c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x68cb[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xb68c('0x0'));var path=require(_0xb68c('0x1'));var timeout=require(_0xb68c('0x2'));var express=require(_0xb68c('0x3'));var router=express[_0xb68c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb68c('0x5'));var interaction=require(_0xb68c('0x6'));var config=require(_0xb68c('0x7'));var controller=require(_0xb68c('0x8'));router[_0xb68c('0x9')]('/',auth[_0xb68c('0xa')](),controller[_0xb68c('0xb')]);router[_0xb68c('0x9')](_0xb68c('0xc'),auth[_0xb68c('0xa')](),controller[_0xb68c('0xd')]);router[_0xb68c('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xb68c('0xe')]);router['get'](_0xb68c('0xf'),auth['isAuthenticated'](),controller[_0xb68c('0x10')]);router[_0xb68c('0x9')]('/:id/descriptions',auth[_0xb68c('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0xb68c('0xa')](),controller['create']);router[_0xb68c('0x11')](_0xb68c('0xc'),auth[_0xb68c('0xa')](),controller[_0xb68c('0x12')]);router[_0xb68c('0x13')](_0xb68c('0xc'),auth[_0xb68c('0xa')](),controller[_0xb68c('0x14')]);module[_0xb68c('0x15')]=router; \ No newline at end of file +var _0xf6d8=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports'];(function(_0x59820d,_0xc8e6ba){var _0x3c72b1=function(_0x1f8971){while(--_0x1f8971){_0x59820d['push'](_0x59820d['shift']());}};_0x3c72b1(++_0xc8e6ba);}(_0xf6d8,0x1cb));var _0x8f6d=function(_0x523d05,_0x1287b4){_0x523d05=_0x523d05-0x0;var _0x3dfa73=_0xf6d8[_0x523d05];return _0x3dfa73;};'use strict';var multer=require('multer');var util=require(_0x8f6d('0x0'));var path=require(_0x8f6d('0x1'));var timeout=require(_0x8f6d('0x2'));var express=require(_0x8f6d('0x3'));var router=express[_0x8f6d('0x4')]();var fs_extra=require(_0x8f6d('0x5'));var auth=require(_0x8f6d('0x6'));var interaction=require(_0x8f6d('0x7'));var config=require(_0x8f6d('0x8'));var controller=require(_0x8f6d('0x9'));router[_0x8f6d('0xa')]('/',auth[_0x8f6d('0xb')](),controller[_0x8f6d('0xc')]);router[_0x8f6d('0xa')](_0x8f6d('0xd'),auth['isAuthenticated'](),controller[_0x8f6d('0xe')]);router[_0x8f6d('0xa')]('/:id/fields',auth[_0x8f6d('0xb')](),controller[_0x8f6d('0xf')]);router[_0x8f6d('0xa')](_0x8f6d('0x10'),auth[_0x8f6d('0xb')](),controller[_0x8f6d('0x11')]);router[_0x8f6d('0xa')](_0x8f6d('0x12'),auth[_0x8f6d('0xb')](),controller[_0x8f6d('0x13')]);router[_0x8f6d('0x14')]('/',auth[_0x8f6d('0xb')](),controller[_0x8f6d('0x15')]);router[_0x8f6d('0x16')](_0x8f6d('0xd'),auth[_0x8f6d('0xb')](),controller[_0x8f6d('0x17')]);router[_0x8f6d('0x18')](_0x8f6d('0xd'),auth[_0x8f6d('0xb')](),controller[_0x8f6d('0x19')]);module[_0x8f6d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 73fecc8..c11866d 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 _0x68d1=['sequelize','exports','STRING'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0x68d1,0x90));var _0x168d=function(_0x2f9788,_0x2fe63e){_0x2f9788=_0x2f9788-0x0;var _0x27ccca=_0x68d1[_0x2f9788];return _0x27ccca;};'use strict';var Sequelize=require(_0x168d('0x0'));module[_0x168d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x168d('0x2')]}}; \ No newline at end of file +var _0x9c33=['sequelize','exports','STRING'];(function(_0x1302c4,_0xa70351){var _0x345dba=function(_0xcc8558){while(--_0xcc8558){_0x1302c4['push'](_0x1302c4['shift']());}};_0x345dba(++_0xa70351);}(_0x9c33,0x165));var _0x39c3=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x9c33[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0x39c3('0x0'));module[_0x39c3('0x1')]={'name':{'type':Sequelize[_0x39c3('0x2')]},'description':{'type':Sequelize[_0x39c3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index b564104..abe3bc9 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 _0x56c3=['count','Content-Range','apply','reject','update','then','destroy','status','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','rimraf','fast-json-patch','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56c3,0x1ae));var _0x356c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56c3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x356c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x356c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x356c('0x2'));var path=require('path');var sox=require(_0x356c('0x3'));var csv=require(_0x356c('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x356c('0x5'));var _=require('lodash');var squel=require(_0x356c('0x6'));var crypto=require(_0x356c('0x7'));var jsforce=require(_0x356c('0x8'));var deskjs=require(_0x356c('0x9'));var toCsv=require(_0x356c('0x4'));var querystring=require(_0x356c('0xa'));var Papa=require(_0x356c('0xb'));var Redis=require(_0x356c('0xc'));var authService=require(_0x356c('0xd'));var qs=require(_0x356c('0xe'));var as=require(_0x356c('0xf'));var hardwareService=require(_0x356c('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x356c('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x356c('0x12'));var db=require(_0x356c('0x13'))['db'];function respondWithStatusCode(_0x488814,_0x3c91c5){_0x3c91c5=_0x3c91c5||0xcc;return function(_0x956488){if(_0x956488){return _0x488814[_0x356c('0x14')](_0x3c91c5);}return _0x488814['status'](_0x3c91c5)[_0x356c('0x15')]();};}function respondWithResult(_0x534b7b,_0x8a2da){_0x8a2da=_0x8a2da||0xc8;return function(_0x4fa2c5){if(_0x4fa2c5){return _0x534b7b['status'](_0x8a2da)[_0x356c('0x16')](_0x4fa2c5);}};}function respondWithFilteredResult(_0x3fe786,_0x2926b1){return function(_0x28706c){if(_0x28706c){var _0x3016ac=typeof _0x2926b1[_0x356c('0x17')]===_0x356c('0x18')&&typeof _0x2926b1[_0x356c('0x19')]===_0x356c('0x18');var _0x31f6bd=_0x28706c[_0x356c('0x1a')];var _0x2aaaac=_0x3016ac?0x0:_0x2926b1[_0x356c('0x17')];var _0x3aeaf4=_0x3016ac?_0x28706c[_0x356c('0x1a')]:_0x2926b1[_0x356c('0x17')]+_0x2926b1[_0x356c('0x19')];var _0x36b068;if(_0x3aeaf4>=_0x31f6bd){_0x3aeaf4=_0x31f6bd;_0x36b068=0xc8;}else{_0x36b068=0xce;}_0x3fe786['status'](_0x36b068);return _0x3fe786['set'](_0x356c('0x1b'),_0x2aaaac+'-'+_0x3aeaf4+'/'+_0x31f6bd)[_0x356c('0x16')](_0x28706c);}return null;};}function patchUpdates(_0x292c35){return function(_0xb5fe9e){try{jsonpatch[_0x356c('0x1c')](_0xb5fe9e,_0x292c35,!![]);}catch(_0x25eaa3){return BPromise[_0x356c('0x1d')](_0x25eaa3);}return _0xb5fe9e['save']();};}function saveUpdates(_0x102cbb,_0x505d1e){return function(_0x3becdf){if(_0x3becdf){return _0x3becdf[_0x356c('0x1e')](_0x102cbb)[_0x356c('0x1f')](function(_0x97bcf){return _0x97bcf;});}return null;};}function removeEntity(_0x4b9d4e,_0x3b0ba1){return function(_0x521a36){if(_0x521a36){return _0x521a36[_0x356c('0x20')]()[_0x356c('0x1f')](function(){_0x4b9d4e[_0x356c('0x21')](0xcc)[_0x356c('0x15')]();});}};}function handleEntityNotFound(_0x2663a1,_0xc1babf){return function(_0x903caa){if(!_0x903caa){_0x2663a1[_0x356c('0x14')](0x194);}return _0x903caa;};}function handleError(_0x4a2619,_0x38153e){_0x38153e=_0x38153e||0x1f4;return function(_0x1e5014){logger['error'](_0x1e5014[_0x356c('0x22')]);if(_0x1e5014[_0x356c('0x23')]){delete _0x1e5014[_0x356c('0x23')];}_0x4a2619[_0x356c('0x21')](_0x38153e)[_0x356c('0x24')](_0x1e5014);};}exports[_0x356c('0x25')]=function(_0x54e438,_0x140d7c){var _0x4c7c99={},_0x5b8b3f={},_0x2b3ffc={'count':0x0,'rows':[]};var _0x520cd2=_[_0x356c('0x26')](db[_0x356c('0x27')][_0x356c('0x28')],function(_0x518516){return{'name':_0x518516[_0x356c('0x29')],'type':_0x518516[_0x356c('0x2a')]['key']};});_0x5b8b3f[_0x356c('0x2b')]=_[_0x356c('0x26')](_0x520cd2,_0x356c('0x23'));_0x5b8b3f[_0x356c('0x2c')]=_[_0x356c('0x2d')](_0x54e438['query']);_0x5b8b3f['filters']=_['intersection'](_0x5b8b3f[_0x356c('0x2b')],_0x5b8b3f[_0x356c('0x2c')]);_0x4c7c99['attributes']=_[_0x356c('0x2e')](_0x5b8b3f['model'],qs[_0x356c('0x2f')](_0x54e438[_0x356c('0x2c')]['fields']));_0x4c7c99[_0x356c('0x30')]=_0x4c7c99[_0x356c('0x30')]['length']?_0x4c7c99[_0x356c('0x30')]:_0x5b8b3f[_0x356c('0x2b')];if(!_0x54e438[_0x356c('0x2c')][_0x356c('0x31')](_0x356c('0x32'))){_0x4c7c99[_0x356c('0x19')]=qs[_0x356c('0x19')](_0x54e438['query'][_0x356c('0x19')]);_0x4c7c99[_0x356c('0x17')]=qs['offset'](_0x54e438[_0x356c('0x2c')][_0x356c('0x17')]);}_0x4c7c99[_0x356c('0x33')]=qs[_0x356c('0x34')](_0x54e438['query'][_0x356c('0x34')]);_0x4c7c99['where']=qs[_0x356c('0x35')](_[_0x356c('0x36')](_0x54e438[_0x356c('0x2c')],_0x5b8b3f['filters']),_0x520cd2);if(_0x54e438[_0x356c('0x2c')][_0x356c('0x37')]){_0x4c7c99[_0x356c('0x38')]=_[_0x356c('0x39')](_0x4c7c99[_0x356c('0x38')],{'$or':_['map'](_0x520cd2,function(_0x23ac7d){if(_0x23ac7d['type']!==_0x356c('0x3a')){var _0x19588e={};_0x19588e[_0x23ac7d[_0x356c('0x23')]]={'$like':'%'+_0x54e438[_0x356c('0x2c')]['filter']+'%'};return _0x19588e;}})});}_0x4c7c99=_[_0x356c('0x39')]({},_0x4c7c99,_0x54e438[_0x356c('0x3b')]);var _0x1a2599={'where':_0x4c7c99[_0x356c('0x38')]};return db[_0x356c('0x27')]['count'](_0x1a2599)[_0x356c('0x1f')](function(_0x57daa0){_0x2b3ffc['count']=_0x57daa0;if(_0x54e438[_0x356c('0x2c')][_0x356c('0x3c')]){_0x4c7c99[_0x356c('0x3d')]=[{'all':!![]}];}return db[_0x356c('0x27')][_0x356c('0x3e')](_0x4c7c99);})[_0x356c('0x1f')](function(_0x17ef78){_0x2b3ffc[_0x356c('0x3f')]=_0x17ef78;return _0x2b3ffc;})[_0x356c('0x1f')](respondWithFilteredResult(_0x140d7c,_0x4c7c99))[_0x356c('0x40')](handleError(_0x140d7c,null));};exports[_0x356c('0x41')]=function(_0x1a1610,_0x5285c1){var _0x583045={'raw':![],'where':{'id':_0x1a1610[_0x356c('0x42')]['id']}},_0x446a00={};_0x446a00[_0x356c('0x2b')]=_['keys'](db[_0x356c('0x27')][_0x356c('0x28')]);_0x446a00[_0x356c('0x2c')]=_['keys'](_0x1a1610[_0x356c('0x2c')]);_0x446a00[_0x356c('0x35')]=_[_0x356c('0x2e')](_0x446a00[_0x356c('0x2b')],_0x446a00[_0x356c('0x2c')]);_0x583045[_0x356c('0x30')]=_[_0x356c('0x2e')](_0x446a00[_0x356c('0x2b')],qs[_0x356c('0x2f')](_0x1a1610[_0x356c('0x2c')]['fields']));_0x583045[_0x356c('0x30')]=_0x583045[_0x356c('0x30')][_0x356c('0x43')]?_0x583045['attributes']:_0x446a00[_0x356c('0x2b')];if(_0x1a1610['query'][_0x356c('0x3c')]){_0x583045[_0x356c('0x3d')]=[{'all':!![]}];}_0x583045=_['merge']({},_0x583045,_0x1a1610[_0x356c('0x3b')]);return db[_0x356c('0x27')][_0x356c('0x44')](_0x583045)[_0x356c('0x1f')](handleEntityNotFound(_0x5285c1,null))[_0x356c('0x1f')](respondWithResult(_0x5285c1,null))[_0x356c('0x40')](handleError(_0x5285c1,null));};exports[_0x356c('0x45')]=function(_0x13ba4c,_0x38ff5b){return db[_0x356c('0x27')][_0x356c('0x45')](_0x13ba4c[_0x356c('0x46')],{})[_0x356c('0x1f')](respondWithResult(_0x38ff5b,0xc9))[_0x356c('0x40')](handleError(_0x38ff5b,null));};exports[_0x356c('0x1e')]=function(_0x452b6a,_0xbd8022){if(_0x452b6a['body']['id']){delete _0x452b6a[_0x356c('0x46')]['id'];}return db[_0x356c('0x27')][_0x356c('0x44')]({'where':{'id':_0x452b6a[_0x356c('0x42')]['id']}})['then'](handleEntityNotFound(_0xbd8022,null))[_0x356c('0x1f')](saveUpdates(_0x452b6a[_0x356c('0x46')],null))['then'](respondWithResult(_0xbd8022,null))[_0x356c('0x40')](handleError(_0xbd8022,null));};exports[_0x356c('0x20')]=function(_0x3e6be1,_0x41b3b6){return db['ServicenowConfiguration'][_0x356c('0x44')]({'where':{'id':_0x3e6be1[_0x356c('0x42')]['id']}})[_0x356c('0x1f')](handleEntityNotFound(_0x41b3b6,null))[_0x356c('0x1f')](removeEntity(_0x41b3b6,null))[_0x356c('0x40')](handleError(_0x41b3b6,null));};exports[_0x356c('0x47')]=function(_0x5712ff,_0x566510,_0xa396e5){var _0x180dc2={};var _0xcf4411={};var _0x2e6a36;var _0xe44a5c;return db[_0x356c('0x27')][_0x356c('0x48')]({'where':{'id':_0x5712ff[_0x356c('0x42')]['id']}})[_0x356c('0x1f')](handleEntityNotFound(_0x566510,null))[_0x356c('0x1f')](function(_0x4d1bee){if(_0x4d1bee){_0x2e6a36=_0x4d1bee;_0xcf4411['model']=_['keys'](db['ServicenowField'][_0x356c('0x28')]);_0xcf4411['query']=_['keys'](_0x5712ff[_0x356c('0x2c')]);_0xcf4411[_0x356c('0x35')]=_[_0x356c('0x2e')](_0xcf4411[_0x356c('0x2b')],_0xcf4411[_0x356c('0x2c')]);_0x180dc2[_0x356c('0x30')]=_['intersection'](_0xcf4411[_0x356c('0x2b')],qs[_0x356c('0x2f')](_0x5712ff[_0x356c('0x2c')]['fields']));_0x180dc2['attributes']=_0x180dc2[_0x356c('0x30')]['length']?_0x180dc2['attributes']:_0xcf4411[_0x356c('0x2b')];_0x180dc2[_0x356c('0x33')]=qs[_0x356c('0x34')](_0x5712ff[_0x356c('0x2c')][_0x356c('0x34')]);_0x180dc2['where']=qs['filters'](_[_0x356c('0x36')](_0x5712ff['query'],_0xcf4411['filters']));if(_0x5712ff[_0x356c('0x2c')][_0x356c('0x37')]){_0x180dc2[_0x356c('0x38')]=_[_0x356c('0x39')](_0x180dc2[_0x356c('0x38')],{'$or':_[_0x356c('0x26')](_0x180dc2[_0x356c('0x30')],function(_0x3316f1){var _0x4ef108={};_0x4ef108[_0x3316f1]={'$like':'%'+_0x5712ff[_0x356c('0x2c')][_0x356c('0x37')]+'%'};return _0x4ef108;})});}_0x180dc2=_['merge']({},_0x180dc2,_0x5712ff['options']);return _0x2e6a36[_0x356c('0x47')](_0x180dc2);}})[_0x356c('0x1f')](function(_0x406a90){if(_0x406a90){_0xe44a5c=_0x406a90[_0x356c('0x43')];if(!_0x5712ff[_0x356c('0x2c')][_0x356c('0x31')](_0x356c('0x32'))){_0x180dc2[_0x356c('0x19')]=qs['limit'](_0x5712ff['query'][_0x356c('0x19')]);_0x180dc2[_0x356c('0x17')]=qs[_0x356c('0x17')](_0x5712ff[_0x356c('0x2c')][_0x356c('0x17')]);}return _0x2e6a36[_0x356c('0x47')](_0x180dc2);}})[_0x356c('0x1f')](function(_0x393b36){if(_0x393b36){return _0x393b36?{'count':_0xe44a5c,'rows':_0x393b36}:null;}})[_0x356c('0x1f')](respondWithResult(_0x566510,null))[_0x356c('0x40')](handleError(_0x566510,null));};exports['getSubjects']=function(_0x39c95b,_0x313822,_0xa0e304){var _0x28914={};var _0x3078c0={};var _0x4a2d0a;var _0x4ce5a2;return db[_0x356c('0x27')][_0x356c('0x48')]({'where':{'id':_0x39c95b[_0x356c('0x42')]['id']}})['then'](handleEntityNotFound(_0x313822,null))['then'](function(_0x4c2744){if(_0x4c2744){_0x4a2d0a=_0x4c2744;_0x3078c0[_0x356c('0x2b')]=_[_0x356c('0x2d')](db[_0x356c('0x49')][_0x356c('0x28')]);_0x3078c0[_0x356c('0x2c')]=_[_0x356c('0x2d')](_0x39c95b[_0x356c('0x2c')]);_0x3078c0[_0x356c('0x35')]=_[_0x356c('0x2e')](_0x3078c0['model'],_0x3078c0[_0x356c('0x2c')]);_0x28914[_0x356c('0x30')]=_['intersection'](_0x3078c0[_0x356c('0x2b')],qs['fields'](_0x39c95b[_0x356c('0x2c')]['fields']));_0x28914['attributes']=_0x28914[_0x356c('0x30')]['length']?_0x28914['attributes']:_0x3078c0[_0x356c('0x2b')];_0x28914[_0x356c('0x33')]=qs[_0x356c('0x34')](_0x39c95b['query'][_0x356c('0x34')]);_0x28914['where']=qs[_0x356c('0x35')](_[_0x356c('0x36')](_0x39c95b['query'],_0x3078c0[_0x356c('0x35')]));if(_0x39c95b[_0x356c('0x2c')][_0x356c('0x37')]){_0x28914[_0x356c('0x38')]=_[_0x356c('0x39')](_0x28914['where'],{'$or':_[_0x356c('0x26')](_0x28914[_0x356c('0x30')],function(_0x5b61a3){var _0x103624={};_0x103624[_0x5b61a3]={'$like':'%'+_0x39c95b[_0x356c('0x2c')][_0x356c('0x37')]+'%'};return _0x103624;})});}_0x28914=_[_0x356c('0x39')]({},_0x28914,_0x39c95b['options']);return _0x4a2d0a[_0x356c('0x4a')](_0x28914);}})[_0x356c('0x1f')](function(_0x4a8445){if(_0x4a8445){_0x4ce5a2=_0x4a8445[_0x356c('0x43')];if(!_0x39c95b['query']['hasOwnProperty'](_0x356c('0x32'))){_0x28914[_0x356c('0x19')]=qs['limit'](_0x39c95b[_0x356c('0x2c')][_0x356c('0x19')]);_0x28914['offset']=qs[_0x356c('0x17')](_0x39c95b[_0x356c('0x2c')][_0x356c('0x17')]);}return _0x4a2d0a[_0x356c('0x4a')](_0x28914);}})[_0x356c('0x1f')](function(_0x57db5e){if(_0x57db5e){return _0x57db5e?{'count':_0x4ce5a2,'rows':_0x57db5e}:null;}})[_0x356c('0x1f')](respondWithResult(_0x313822,null))[_0x356c('0x40')](handleError(_0x313822,null));};exports[_0x356c('0x4b')]=function(_0x1d8e7f,_0x76383c,_0x368636){var _0x576ff5={};var _0x24b092={};var _0x340e6c;var _0x3a9776;return db[_0x356c('0x27')][_0x356c('0x48')]({'where':{'id':_0x1d8e7f[_0x356c('0x42')]['id']}})['then'](handleEntityNotFound(_0x76383c,null))[_0x356c('0x1f')](function(_0x58e2c0){if(_0x58e2c0){_0x340e6c=_0x58e2c0;_0x24b092[_0x356c('0x2b')]=_[_0x356c('0x2d')](db[_0x356c('0x49')][_0x356c('0x28')]);_0x24b092[_0x356c('0x2c')]=_['keys'](_0x1d8e7f['query']);_0x24b092[_0x356c('0x35')]=_[_0x356c('0x2e')](_0x24b092[_0x356c('0x2b')],_0x24b092[_0x356c('0x2c')]);_0x576ff5['attributes']=_[_0x356c('0x2e')](_0x24b092[_0x356c('0x2b')],qs[_0x356c('0x2f')](_0x1d8e7f[_0x356c('0x2c')][_0x356c('0x2f')]));_0x576ff5[_0x356c('0x30')]=_0x576ff5[_0x356c('0x30')]['length']?_0x576ff5[_0x356c('0x30')]:_0x24b092[_0x356c('0x2b')];_0x576ff5[_0x356c('0x33')]=qs[_0x356c('0x34')](_0x1d8e7f[_0x356c('0x2c')][_0x356c('0x34')]);_0x576ff5[_0x356c('0x38')]=qs['filters'](_[_0x356c('0x36')](_0x1d8e7f[_0x356c('0x2c')],_0x24b092[_0x356c('0x35')]));if(_0x1d8e7f[_0x356c('0x2c')]['filter']){_0x576ff5[_0x356c('0x38')]=_[_0x356c('0x39')](_0x576ff5[_0x356c('0x38')],{'$or':_[_0x356c('0x26')](_0x576ff5[_0x356c('0x30')],function(_0x268517){var _0x2326a1={};_0x2326a1[_0x268517]={'$like':'%'+_0x1d8e7f['query'][_0x356c('0x37')]+'%'};return _0x2326a1;})});}_0x576ff5=_['merge']({},_0x576ff5,_0x1d8e7f[_0x356c('0x3b')]);return _0x340e6c['getDescriptions'](_0x576ff5);}})['then'](function(_0x4da9e9){if(_0x4da9e9){_0x3a9776=_0x4da9e9[_0x356c('0x43')];if(!_0x1d8e7f[_0x356c('0x2c')][_0x356c('0x31')](_0x356c('0x32'))){_0x576ff5['limit']=qs[_0x356c('0x19')](_0x1d8e7f[_0x356c('0x2c')][_0x356c('0x19')]);_0x576ff5['offset']=qs['offset'](_0x1d8e7f[_0x356c('0x2c')][_0x356c('0x17')]);}return _0x340e6c[_0x356c('0x4b')](_0x576ff5);}})[_0x356c('0x1f')](function(_0x1daf8a){if(_0x1daf8a){return _0x1daf8a?{'count':_0x3a9776,'rows':_0x1daf8a}:null;}})[_0x356c('0x1f')](respondWithResult(_0x76383c,null))['catch'](handleError(_0x76383c,null));}; \ No newline at end of file +var _0x11e3=['keys','options','find','body','getFields','findOne','ServicenowField','where','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','ServicenowConfiguration','rawAttributes','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','type','merge','includeAll','include','findAll','rows','catch','show','params'];(function(_0x37d870,_0x43470b){var _0x4b2c5f=function(_0x2018bd){while(--_0x2018bd){_0x37d870['push'](_0x37d870['shift']());}};_0x4b2c5f(++_0x43470b);}(_0x11e3,0x19f));var _0x311e=function(_0x5d4314,_0x21f602){_0x5d4314=_0x5d4314-0x0;var _0x5b5259=_0x11e3[_0x5d4314];return _0x5b5259;};'use strict';var emlformat=require(_0x311e('0x0'));var rimraf=require(_0x311e('0x1'));var zipdir=require(_0x311e('0x2'));var jsonpatch=require(_0x311e('0x3'));var rp=require(_0x311e('0x4'));var moment=require(_0x311e('0x5'));var BPromise=require(_0x311e('0x6'));var Mustache=require('mustache');var util=require(_0x311e('0x7'));var path=require(_0x311e('0x8'));var sox=require(_0x311e('0x9'));var csv=require(_0x311e('0xa'));var ejs=require(_0x311e('0xb'));var fs=require('fs');var fs_extra=require(_0x311e('0xc'));var _=require(_0x311e('0xd'));var squel=require('squel');var crypto=require(_0x311e('0xe'));var jsforce=require(_0x311e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x311e('0xa'));var querystring=require(_0x311e('0x10'));var Papa=require(_0x311e('0x11'));var Redis=require(_0x311e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x311e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x311e('0x14'));var logger=require(_0x311e('0x15'))(_0x311e('0x16'));var utils=require('../../config/utils');var config=require(_0x311e('0x17'));var licenseUtil=require(_0x311e('0x18'));var db=require(_0x311e('0x19'))['db'];function respondWithStatusCode(_0x37b8d4,_0x54df2b){_0x54df2b=_0x54df2b||0xcc;return function(_0x54341e){if(_0x54341e){return _0x37b8d4[_0x311e('0x1a')](_0x54df2b);}return _0x37b8d4[_0x311e('0x1b')](_0x54df2b)[_0x311e('0x1c')]();};}function respondWithResult(_0x2fe70a,_0xa0718d){_0xa0718d=_0xa0718d||0xc8;return function(_0x3f812a){if(_0x3f812a){return _0x2fe70a['status'](_0xa0718d)[_0x311e('0x1d')](_0x3f812a);}};}function respondWithFilteredResult(_0xe873a7,_0x3cad4e){return function(_0x6974da){if(_0x6974da){var _0x42eec6=typeof _0x3cad4e[_0x311e('0x1e')]===_0x311e('0x1f')&&typeof _0x3cad4e[_0x311e('0x20')]===_0x311e('0x1f');var _0x592fc9=_0x6974da[_0x311e('0x21')];var _0x3c194a=_0x42eec6?0x0:_0x3cad4e['offset'];var _0x4086ae=_0x42eec6?_0x6974da[_0x311e('0x21')]:_0x3cad4e[_0x311e('0x1e')]+_0x3cad4e[_0x311e('0x20')];var _0x2c021a;if(_0x4086ae>=_0x592fc9){_0x4086ae=_0x592fc9;_0x2c021a=0xc8;}else{_0x2c021a=0xce;}_0xe873a7[_0x311e('0x1b')](_0x2c021a);return _0xe873a7['set'](_0x311e('0x22'),_0x3c194a+'-'+_0x4086ae+'/'+_0x592fc9)[_0x311e('0x1d')](_0x6974da);}return null;};}function patchUpdates(_0x2e3307){return function(_0x22484a){try{jsonpatch[_0x311e('0x23')](_0x22484a,_0x2e3307,!![]);}catch(_0x3c8f3b){return BPromise[_0x311e('0x24')](_0x3c8f3b);}return _0x22484a[_0x311e('0x25')]();};}function saveUpdates(_0x2a6594,_0x14a136){return function(_0x585439){if(_0x585439){return _0x585439[_0x311e('0x26')](_0x2a6594)[_0x311e('0x27')](function(_0x2bb841){return _0x2bb841;});}return null;};}function removeEntity(_0x5f22c3,_0x1dc8ff){return function(_0x1e4024){if(_0x1e4024){return _0x1e4024[_0x311e('0x28')]()[_0x311e('0x27')](function(){_0x5f22c3['status'](0xcc)[_0x311e('0x1c')]();});}};}function handleEntityNotFound(_0x19a096,_0x5ecb19){return function(_0x48eda7){if(!_0x48eda7){_0x19a096[_0x311e('0x1a')](0x194);}return _0x48eda7;};}function handleError(_0x4d9b61,_0x359530){_0x359530=_0x359530||0x1f4;return function(_0x3617d7){logger[_0x311e('0x29')](_0x3617d7[_0x311e('0x2a')]);if(_0x3617d7[_0x311e('0x2b')]){delete _0x3617d7['name'];}_0x4d9b61[_0x311e('0x1b')](_0x359530)[_0x311e('0x2c')](_0x3617d7);};}exports['index']=function(_0x1f968e,_0x330407){var _0x513bb4={},_0x36225c={},_0x5415a9={'count':0x0,'rows':[]};var _0x1f5108=_['map'](db[_0x311e('0x2d')][_0x311e('0x2e')],function(_0x488bcd){return{'name':_0x488bcd['fieldName'],'type':_0x488bcd['type'][_0x311e('0x2f')]};});_0x36225c[_0x311e('0x30')]=_[_0x311e('0x31')](_0x1f5108,_0x311e('0x2b'));_0x36225c[_0x311e('0x32')]=_['keys'](_0x1f968e[_0x311e('0x32')]);_0x36225c[_0x311e('0x33')]=_[_0x311e('0x34')](_0x36225c['model'],_0x36225c[_0x311e('0x32')]);_0x513bb4['attributes']=_[_0x311e('0x34')](_0x36225c['model'],qs[_0x311e('0x35')](_0x1f968e[_0x311e('0x32')][_0x311e('0x35')]));_0x513bb4[_0x311e('0x36')]=_0x513bb4[_0x311e('0x36')][_0x311e('0x37')]?_0x513bb4[_0x311e('0x36')]:_0x36225c['model'];if(!_0x1f968e[_0x311e('0x32')][_0x311e('0x38')](_0x311e('0x39'))){_0x513bb4['limit']=qs[_0x311e('0x20')](_0x1f968e['query'][_0x311e('0x20')]);_0x513bb4[_0x311e('0x1e')]=qs[_0x311e('0x1e')](_0x1f968e[_0x311e('0x32')]['offset']);}_0x513bb4[_0x311e('0x3a')]=qs[_0x311e('0x3b')](_0x1f968e[_0x311e('0x32')]['sort']);_0x513bb4['where']=qs[_0x311e('0x33')](_[_0x311e('0x3c')](_0x1f968e['query'],_0x36225c[_0x311e('0x33')]),_0x1f5108);if(_0x1f968e[_0x311e('0x32')][_0x311e('0x3d')]){_0x513bb4['where']=_['merge'](_0x513bb4['where'],{'$or':_[_0x311e('0x31')](_0x1f5108,function(_0x2b76b7){if(_0x2b76b7[_0x311e('0x3e')]!=='VIRTUAL'){var _0x584e3b={};_0x584e3b[_0x2b76b7[_0x311e('0x2b')]]={'$like':'%'+_0x1f968e[_0x311e('0x32')]['filter']+'%'};return _0x584e3b;}})});}_0x513bb4=_[_0x311e('0x3f')]({},_0x513bb4,_0x1f968e['options']);var _0x409561={'where':_0x513bb4['where']};return db[_0x311e('0x2d')][_0x311e('0x21')](_0x409561)[_0x311e('0x27')](function(_0x5a1b71){_0x5415a9[_0x311e('0x21')]=_0x5a1b71;if(_0x1f968e[_0x311e('0x32')][_0x311e('0x40')]){_0x513bb4[_0x311e('0x41')]=[{'all':!![]}];}return db[_0x311e('0x2d')][_0x311e('0x42')](_0x513bb4);})[_0x311e('0x27')](function(_0x400c94){_0x5415a9[_0x311e('0x43')]=_0x400c94;return _0x5415a9;})[_0x311e('0x27')](respondWithFilteredResult(_0x330407,_0x513bb4))[_0x311e('0x44')](handleError(_0x330407,null));};exports[_0x311e('0x45')]=function(_0xfc26d0,_0x4fbe23){var _0x262319={'raw':![],'where':{'id':_0xfc26d0[_0x311e('0x46')]['id']}},_0x48e0d4={};_0x48e0d4[_0x311e('0x30')]=_['keys'](db['ServicenowConfiguration'][_0x311e('0x2e')]);_0x48e0d4[_0x311e('0x32')]=_[_0x311e('0x47')](_0xfc26d0['query']);_0x48e0d4['filters']=_['intersection'](_0x48e0d4[_0x311e('0x30')],_0x48e0d4[_0x311e('0x32')]);_0x262319[_0x311e('0x36')]=_[_0x311e('0x34')](_0x48e0d4[_0x311e('0x30')],qs[_0x311e('0x35')](_0xfc26d0[_0x311e('0x32')][_0x311e('0x35')]));_0x262319[_0x311e('0x36')]=_0x262319[_0x311e('0x36')]['length']?_0x262319[_0x311e('0x36')]:_0x48e0d4[_0x311e('0x30')];if(_0xfc26d0[_0x311e('0x32')][_0x311e('0x40')]){_0x262319[_0x311e('0x41')]=[{'all':!![]}];}_0x262319=_[_0x311e('0x3f')]({},_0x262319,_0xfc26d0[_0x311e('0x48')]);return db[_0x311e('0x2d')][_0x311e('0x49')](_0x262319)[_0x311e('0x27')](handleEntityNotFound(_0x4fbe23,null))[_0x311e('0x27')](respondWithResult(_0x4fbe23,null))[_0x311e('0x44')](handleError(_0x4fbe23,null));};exports['create']=function(_0x38638d,_0x19f40c){return db[_0x311e('0x2d')]['create'](_0x38638d['body'],{})[_0x311e('0x27')](respondWithResult(_0x19f40c,0xc9))[_0x311e('0x44')](handleError(_0x19f40c,null));};exports[_0x311e('0x26')]=function(_0x92b576,_0x30f920){if(_0x92b576[_0x311e('0x4a')]['id']){delete _0x92b576[_0x311e('0x4a')]['id'];}return db[_0x311e('0x2d')][_0x311e('0x49')]({'where':{'id':_0x92b576[_0x311e('0x46')]['id']}})[_0x311e('0x27')](handleEntityNotFound(_0x30f920,null))[_0x311e('0x27')](saveUpdates(_0x92b576[_0x311e('0x4a')],null))[_0x311e('0x27')](respondWithResult(_0x30f920,null))['catch'](handleError(_0x30f920,null));};exports[_0x311e('0x28')]=function(_0x5bdcb0,_0x50aeed){return db[_0x311e('0x2d')]['find']({'where':{'id':_0x5bdcb0[_0x311e('0x46')]['id']}})['then'](handleEntityNotFound(_0x50aeed,null))['then'](removeEntity(_0x50aeed,null))['catch'](handleError(_0x50aeed,null));};exports[_0x311e('0x4b')]=function(_0x2ac314,_0x137296,_0x185eb8){var _0x6a0eb3={};var _0x2e73ae={};var _0x1212ea;var _0x750fcc;return db[_0x311e('0x2d')][_0x311e('0x4c')]({'where':{'id':_0x2ac314[_0x311e('0x46')]['id']}})[_0x311e('0x27')](handleEntityNotFound(_0x137296,null))[_0x311e('0x27')](function(_0x523028){if(_0x523028){_0x1212ea=_0x523028;_0x2e73ae[_0x311e('0x30')]=_[_0x311e('0x47')](db[_0x311e('0x4d')][_0x311e('0x2e')]);_0x2e73ae[_0x311e('0x32')]=_['keys'](_0x2ac314[_0x311e('0x32')]);_0x2e73ae['filters']=_['intersection'](_0x2e73ae['model'],_0x2e73ae[_0x311e('0x32')]);_0x6a0eb3[_0x311e('0x36')]=_['intersection'](_0x2e73ae[_0x311e('0x30')],qs['fields'](_0x2ac314[_0x311e('0x32')][_0x311e('0x35')]));_0x6a0eb3[_0x311e('0x36')]=_0x6a0eb3[_0x311e('0x36')][_0x311e('0x37')]?_0x6a0eb3[_0x311e('0x36')]:_0x2e73ae[_0x311e('0x30')];_0x6a0eb3[_0x311e('0x3a')]=qs[_0x311e('0x3b')](_0x2ac314[_0x311e('0x32')][_0x311e('0x3b')]);_0x6a0eb3[_0x311e('0x4e')]=qs[_0x311e('0x33')](_['pick'](_0x2ac314[_0x311e('0x32')],_0x2e73ae[_0x311e('0x33')]));if(_0x2ac314['query']['filter']){_0x6a0eb3[_0x311e('0x4e')]=_['merge'](_0x6a0eb3[_0x311e('0x4e')],{'$or':_[_0x311e('0x31')](_0x6a0eb3[_0x311e('0x36')],function(_0x211b7c){var _0x20fb8d={};_0x20fb8d[_0x211b7c]={'$like':'%'+_0x2ac314[_0x311e('0x32')][_0x311e('0x3d')]+'%'};return _0x20fb8d;})});}_0x6a0eb3=_[_0x311e('0x3f')]({},_0x6a0eb3,_0x2ac314[_0x311e('0x48')]);return _0x1212ea['getFields'](_0x6a0eb3);}})[_0x311e('0x27')](function(_0x98fa4c){if(_0x98fa4c){_0x750fcc=_0x98fa4c[_0x311e('0x37')];if(!_0x2ac314[_0x311e('0x32')]['hasOwnProperty'](_0x311e('0x39'))){_0x6a0eb3[_0x311e('0x20')]=qs['limit'](_0x2ac314['query'][_0x311e('0x20')]);_0x6a0eb3[_0x311e('0x1e')]=qs[_0x311e('0x1e')](_0x2ac314[_0x311e('0x32')][_0x311e('0x1e')]);}return _0x1212ea[_0x311e('0x4b')](_0x6a0eb3);}})['then'](function(_0x5f13dd){if(_0x5f13dd){return _0x5f13dd?{'count':_0x750fcc,'rows':_0x5f13dd}:null;}})[_0x311e('0x27')](respondWithResult(_0x137296,null))['catch'](handleError(_0x137296,null));};exports[_0x311e('0x4f')]=function(_0x4ff6ce,_0x48b207,_0x435683){var _0x3e223e={};var _0x187a14={};var _0x5c78d8;var _0x51419e;return db[_0x311e('0x2d')][_0x311e('0x4c')]({'where':{'id':_0x4ff6ce[_0x311e('0x46')]['id']}})[_0x311e('0x27')](handleEntityNotFound(_0x48b207,null))['then'](function(_0x5c218b){if(_0x5c218b){_0x5c78d8=_0x5c218b;_0x187a14[_0x311e('0x30')]=_[_0x311e('0x47')](db[_0x311e('0x4d')][_0x311e('0x2e')]);_0x187a14[_0x311e('0x32')]=_[_0x311e('0x47')](_0x4ff6ce[_0x311e('0x32')]);_0x187a14[_0x311e('0x33')]=_['intersection'](_0x187a14[_0x311e('0x30')],_0x187a14[_0x311e('0x32')]);_0x3e223e[_0x311e('0x36')]=_[_0x311e('0x34')](_0x187a14[_0x311e('0x30')],qs[_0x311e('0x35')](_0x4ff6ce[_0x311e('0x32')][_0x311e('0x35')]));_0x3e223e[_0x311e('0x36')]=_0x3e223e['attributes'][_0x311e('0x37')]?_0x3e223e[_0x311e('0x36')]:_0x187a14['model'];_0x3e223e[_0x311e('0x3a')]=qs[_0x311e('0x3b')](_0x4ff6ce[_0x311e('0x32')][_0x311e('0x3b')]);_0x3e223e[_0x311e('0x4e')]=qs[_0x311e('0x33')](_[_0x311e('0x3c')](_0x4ff6ce['query'],_0x187a14[_0x311e('0x33')]));if(_0x4ff6ce[_0x311e('0x32')][_0x311e('0x3d')]){_0x3e223e[_0x311e('0x4e')]=_[_0x311e('0x3f')](_0x3e223e[_0x311e('0x4e')],{'$or':_[_0x311e('0x31')](_0x3e223e[_0x311e('0x36')],function(_0x234066){var _0x1da1a7={};_0x1da1a7[_0x234066]={'$like':'%'+_0x4ff6ce[_0x311e('0x32')][_0x311e('0x3d')]+'%'};return _0x1da1a7;})});}_0x3e223e=_[_0x311e('0x3f')]({},_0x3e223e,_0x4ff6ce['options']);return _0x5c78d8[_0x311e('0x4f')](_0x3e223e);}})[_0x311e('0x27')](function(_0x1c1e5e){if(_0x1c1e5e){_0x51419e=_0x1c1e5e[_0x311e('0x37')];if(!_0x4ff6ce[_0x311e('0x32')][_0x311e('0x38')](_0x311e('0x39'))){_0x3e223e[_0x311e('0x20')]=qs['limit'](_0x4ff6ce[_0x311e('0x32')]['limit']);_0x3e223e[_0x311e('0x1e')]=qs[_0x311e('0x1e')](_0x4ff6ce[_0x311e('0x32')][_0x311e('0x1e')]);}return _0x5c78d8[_0x311e('0x4f')](_0x3e223e);}})[_0x311e('0x27')](function(_0x34c4df){if(_0x34c4df){return _0x34c4df?{'count':_0x51419e,'rows':_0x34c4df}:null;}})[_0x311e('0x27')](respondWithResult(_0x48b207,null))[_0x311e('0x44')](handleError(_0x48b207,null));};exports[_0x311e('0x50')]=function(_0x880bf8,_0x40cadc,_0x38ee72){var _0x49c3c9={};var _0x1aec13={};var _0x178ef2;var _0x4b68df;return db[_0x311e('0x2d')]['findOne']({'where':{'id':_0x880bf8[_0x311e('0x46')]['id']}})[_0x311e('0x27')](handleEntityNotFound(_0x40cadc,null))['then'](function(_0x2949df){if(_0x2949df){_0x178ef2=_0x2949df;_0x1aec13[_0x311e('0x30')]=_[_0x311e('0x47')](db[_0x311e('0x4d')][_0x311e('0x2e')]);_0x1aec13[_0x311e('0x32')]=_[_0x311e('0x47')](_0x880bf8[_0x311e('0x32')]);_0x1aec13[_0x311e('0x33')]=_['intersection'](_0x1aec13[_0x311e('0x30')],_0x1aec13[_0x311e('0x32')]);_0x49c3c9['attributes']=_[_0x311e('0x34')](_0x1aec13[_0x311e('0x30')],qs[_0x311e('0x35')](_0x880bf8['query'][_0x311e('0x35')]));_0x49c3c9['attributes']=_0x49c3c9[_0x311e('0x36')][_0x311e('0x37')]?_0x49c3c9[_0x311e('0x36')]:_0x1aec13[_0x311e('0x30')];_0x49c3c9['order']=qs[_0x311e('0x3b')](_0x880bf8[_0x311e('0x32')][_0x311e('0x3b')]);_0x49c3c9['where']=qs['filters'](_[_0x311e('0x3c')](_0x880bf8[_0x311e('0x32')],_0x1aec13[_0x311e('0x33')]));if(_0x880bf8[_0x311e('0x32')][_0x311e('0x3d')]){_0x49c3c9[_0x311e('0x4e')]=_[_0x311e('0x3f')](_0x49c3c9[_0x311e('0x4e')],{'$or':_['map'](_0x49c3c9[_0x311e('0x36')],function(_0x42b28d){var _0x226ebf={};_0x226ebf[_0x42b28d]={'$like':'%'+_0x880bf8[_0x311e('0x32')]['filter']+'%'};return _0x226ebf;})});}_0x49c3c9=_[_0x311e('0x3f')]({},_0x49c3c9,_0x880bf8['options']);return _0x178ef2[_0x311e('0x50')](_0x49c3c9);}})[_0x311e('0x27')](function(_0x270283){if(_0x270283){_0x4b68df=_0x270283[_0x311e('0x37')];if(!_0x880bf8[_0x311e('0x32')][_0x311e('0x38')](_0x311e('0x39'))){_0x49c3c9[_0x311e('0x20')]=qs['limit'](_0x880bf8[_0x311e('0x32')][_0x311e('0x20')]);_0x49c3c9['offset']=qs[_0x311e('0x1e')](_0x880bf8[_0x311e('0x32')][_0x311e('0x1e')]);}return _0x178ef2[_0x311e('0x50')](_0x49c3c9);}})[_0x311e('0x27')](function(_0x1fa0c8){if(_0x1fa0c8){return _0x1fa0c8?{'count':_0x4b68df,'rows':_0x1fa0c8}:null;}})[_0x311e('0x27')](respondWithResult(_0x40cadc,null))[_0x311e('0x44')](handleError(_0x40cadc,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 0bb8f76..6df053a 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 _0x9861=['ServicenowConfiguration','int_servicenow_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','define'];(function(_0x7f0a45,_0x522e9a){var _0x2baeb3=function(_0xf9246a){while(--_0xf9246a){_0x7f0a45['push'](_0x7f0a45['shift']());}};_0x2baeb3(++_0x522e9a);}(_0x9861,0x176));var _0x1986=function(_0x4730d9,_0x3c8936){_0x4730d9=_0x4730d9-0x0;var _0x4fb761=_0x9861[_0x4730d9];return _0x4fb761;};'use strict';var _=require(_0x1986('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1986('0x1'));var moment=require(_0x1986('0x2'));var BPromise=require(_0x1986('0x3'));var rp=require(_0x1986('0x4'));var fs=require('fs');var path=require(_0x1986('0x5'));var rimraf=require(_0x1986('0x6'));var config=require('../../config/environment');var attributes=require(_0x1986('0x7'));module[_0x1986('0x8')]=function(_0x1b56d6,_0x17ccbf){return _0x1b56d6[_0x1986('0x9')](_0x1986('0xa'),attributes,{'tableName':_0x1986('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3276=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_servicenow_configurations','lodash'];(function(_0x476b71,_0x23a0ba){var _0x810ab=function(_0x3bee11){while(--_0x3bee11){_0x476b71['push'](_0x476b71['shift']());}};_0x810ab(++_0x23a0ba);}(_0x3276,0xc7));var _0x6327=function(_0xc3d771,_0x332634){_0xc3d771=_0xc3d771-0x0;var _0x3fb677=_0x3276[_0xc3d771];return _0x3fb677;};'use strict';var _=require(_0x6327('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6327('0x1'));var moment=require(_0x6327('0x2'));var BPromise=require(_0x6327('0x3'));var rp=require(_0x6327('0x4'));var fs=require('fs');var path=require(_0x6327('0x5'));var rimraf=require(_0x6327('0x6'));var config=require(_0x6327('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x10b982,_0x37adde){return _0x10b982[_0x6327('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0x6327('0x9'),'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 460c8df..eaed7a8 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 _0x5186=['info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then'];(function(_0x21904f,_0x5d27ef){var _0x343ee1=function(_0x41b7b6){while(--_0x41b7b6){_0x21904f['push'](_0x21904f['shift']());}};_0x343ee1(++_0x5d27ef);}(_0x5186,0x180));var _0x6518=function(_0x2be79f,_0x2c7557){_0x2be79f=_0x2be79f-0x0;var _0xbd81af=_0x5186[_0x2be79f];return _0xbd81af;};'use strict';var _=require(_0x6518('0x0'));var util=require(_0x6518('0x1'));var moment=require(_0x6518('0x2'));var BPromise=require(_0x6518('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6518('0x4'));var db=require(_0x6518('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6518('0x6'));var config=require('../../config/environment');var jayson=require(_0x6518('0x7'));var client=jayson[_0x6518('0x8')][_0x6518('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d5e2f,_0x22c67d,_0x56ae9a){return new BPromise(function(_0x20823d,_0x2b7407){return client[_0x6518('0xa')](_0x5d5e2f,_0x56ae9a)[_0x6518('0xb')](function(_0x49d271){logger[_0x6518('0xc')](_0x6518('0xd'),_0x22c67d,_0x6518('0xe'));logger[_0x6518('0xf')](_0x6518('0x10'),_0x22c67d,_0x6518('0xe'),JSON[_0x6518('0x11')](_0x49d271));if(_0x49d271[_0x6518('0x12')]){if(_0x49d271[_0x6518('0x12')][_0x6518('0x13')]===0x1f4){logger[_0x6518('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x22c67d,_0x49d271[_0x6518('0x12')][_0x6518('0x14')]);return _0x2b7407(_0x49d271[_0x6518('0x12')]['message']);}logger['error'](_0x6518('0xd'),_0x22c67d,_0x49d271[_0x6518('0x12')]['message']);return _0x20823d(_0x49d271[_0x6518('0x12')][_0x6518('0x14')]);}else{logger['info'](_0x6518('0xd'),_0x22c67d,_0x6518('0xe'));_0x20823d(_0x49d271[_0x6518('0x15')]['message']);}})['catch'](function(_0x3484f1){logger[_0x6518('0x12')](_0x6518('0xd'),_0x22c67d,_0x3484f1);_0x2b7407(_0x3484f1);});});} \ No newline at end of file +var _0xfa0b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment'];(function(_0xdeb125,_0x9635e7){var _0x33a87a=function(_0x5b6243){while(--_0x5b6243){_0xdeb125['push'](_0xdeb125['shift']());}};_0x33a87a(++_0x9635e7);}(_0xfa0b,0x1cc));var _0xbfa0=function(_0x2e2720,_0x1ae995){_0x2e2720=_0x2e2720-0x0;var _0x3f9d2d=_0xfa0b[_0x2e2720];return _0x3f9d2d;};'use strict';var _=require(_0xbfa0('0x0'));var util=require('util');var moment=require(_0xbfa0('0x1'));var BPromise=require(_0xbfa0('0x2'));var rs=require(_0xbfa0('0x3'));var fs=require('fs');var Redis=require(_0xbfa0('0x4'));var db=require(_0xbfa0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfa0('0x6'))(_0xbfa0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbfa0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd0673d,_0x49b755,_0x361450){return new BPromise(function(_0x4c4464,_0x5195e9){return client[_0xbfa0('0x9')](_0xd0673d,_0x361450)[_0xbfa0('0xa')](function(_0x3fcd92){logger[_0xbfa0('0xb')](_0xbfa0('0xc'),_0x49b755,'request\x20sent');logger[_0xbfa0('0xd')](_0xbfa0('0xe'),_0x49b755,_0xbfa0('0xf'),JSON[_0xbfa0('0x10')](_0x3fcd92));if(_0x3fcd92['error']){if(_0x3fcd92[_0xbfa0('0x11')][_0xbfa0('0x12')]===0x1f4){logger[_0xbfa0('0x11')](_0xbfa0('0xc'),_0x49b755,_0x3fcd92[_0xbfa0('0x11')][_0xbfa0('0x13')]);return _0x5195e9(_0x3fcd92[_0xbfa0('0x11')]['message']);}logger[_0xbfa0('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x49b755,_0x3fcd92[_0xbfa0('0x11')][_0xbfa0('0x13')]);return _0x4c4464(_0x3fcd92[_0xbfa0('0x11')][_0xbfa0('0x13')]);}else{logger['info'](_0xbfa0('0xc'),_0x49b755,_0xbfa0('0xf'));_0x4c4464(_0x3fcd92[_0xbfa0('0x14')][_0xbfa0('0x13')]);}})[_0xbfa0('0x15')](function(_0x1fc2b2){logger[_0xbfa0('0x11')](_0xbfa0('0xc'),_0x49b755,_0x1fc2b2);_0x5195e9(_0x1fc2b2);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index b7683c4..bc57027 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 _0x8702=['./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x506ca6,_0xe15aa7){var _0x3fd3c8=function(_0x4893f2){while(--_0x4893f2){_0x506ca6['push'](_0x506ca6['shift']());}};_0x3fd3c8(++_0xe15aa7);}(_0x8702,0x1df));var _0x2870=function(_0x4a43c3,_0x44e05a){_0x4a43c3=_0x4a43c3-0x0;var _0x92dcf2=_0x8702[_0x4a43c3];return _0x92dcf2;};'use strict';var multer=require('multer');var util=require(_0x2870('0x0'));var path=require(_0x2870('0x1'));var timeout=require(_0x2870('0x2'));var express=require(_0x2870('0x3'));var router=express[_0x2870('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2870('0x5'));var interaction=require(_0x2870('0x6'));var config=require('../../config/environment');var controller=require(_0x2870('0x7'));router[_0x2870('0x8')]('/',auth[_0x2870('0x9')](),controller[_0x2870('0xa')]);router['get'](_0x2870('0xb'),auth[_0x2870('0x9')](),controller['show']);router[_0x2870('0xc')]('/',auth[_0x2870('0x9')](),controller[_0x2870('0xd')]);router[_0x2870('0xe')](_0x2870('0xb'),auth[_0x2870('0x9')](),controller[_0x2870('0xf')]);router[_0x2870('0x10')](_0x2870('0xb'),auth[_0x2870('0x9')](),controller[_0x2870('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf3ec=['post','create','update','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show'];(function(_0x2a18b7,_0x5041c8){var _0x45e74e=function(_0x1d32d6){while(--_0x1d32d6){_0x2a18b7['push'](_0x2a18b7['shift']());}};_0x45e74e(++_0x5041c8);}(_0xf3ec,0x14d));var _0xcf3e=function(_0x4212d7,_0x401a32){_0x4212d7=_0x4212d7-0x0;var _0x5b31ed=_0xf3ec[_0x4212d7];return _0x5b31ed;};'use strict';var multer=require(_0xcf3e('0x0'));var util=require(_0xcf3e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcf3e('0x2'));var router=express[_0xcf3e('0x3')]();var fs_extra=require(_0xcf3e('0x4'));var auth=require(_0xcf3e('0x5'));var interaction=require(_0xcf3e('0x6'));var config=require(_0xcf3e('0x7'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0xcf3e('0x8')](),controller[_0xcf3e('0x9')]);router['get'](_0xcf3e('0xa'),auth['isAuthenticated'](),controller[_0xcf3e('0xb')]);router[_0xcf3e('0xc')]('/',auth[_0xcf3e('0x8')](),controller[_0xcf3e('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcf3e('0xe')]);router['delete']('/:id',auth[_0xcf3e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 7a1481e..540eb18 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 _0x6995=['STRING','exports','string','variable','customVariable','keyValue'];(function(_0x2b84cc,_0x226929){var _0x5dbd94=function(_0x17f041){while(--_0x17f041){_0x2b84cc['push'](_0x2b84cc['shift']());}};_0x5dbd94(++_0x226929);}(_0x6995,0x97));var _0x5699=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6995[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');module[_0x5699('0x0')]={'type':{'type':Sequelize['ENUM'](_0x5699('0x1'),_0x5699('0x2'),_0x5699('0x3'),_0x5699('0x4'),'picklist'),'defaultValue':_0x5699('0x1')},'content':{'type':Sequelize[_0x5699('0x5')]},'key':{'type':Sequelize[_0x5699('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x5699('0x1'),_0x5699('0x2'),_0x5699('0x3'))},'keyContent':{'type':Sequelize[_0x5699('0x5')]},'idField':{'type':Sequelize[_0x5699('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5699('0x5')]}}; \ No newline at end of file +var _0x525a=['picklist','string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x50e202,_0x268014){var _0x4a4993=function(_0x30f76f){while(--_0x30f76f){_0x50e202['push'](_0x50e202['shift']());}};_0x4a4993(++_0x268014);}(_0x525a,0x1a3));var _0xa525=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x525a[_0x352e09];return _0x1b7094;};'use strict';var Sequelize=require(_0xa525('0x0'));module[_0xa525('0x1')]={'type':{'type':Sequelize[_0xa525('0x2')]('string',_0xa525('0x3'),'customVariable','keyValue',_0xa525('0x4')),'defaultValue':_0xa525('0x5')},'content':{'type':Sequelize[_0xa525('0x6')]},'key':{'type':Sequelize[_0xa525('0x6')]},'keyType':{'type':Sequelize[_0xa525('0x2')]('string',_0xa525('0x3'),_0xa525('0x7'))},'keyContent':{'type':Sequelize[_0xa525('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa525('0x6')]},'customField':{'type':Sequelize[_0xa525('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 7165e58..66f4c0c 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 _0xe8d7=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ServicenowField','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','json'];(function(_0x4d95fd,_0x31129d){var _0x1e152f=function(_0x260a9b){while(--_0x260a9b){_0x4d95fd['push'](_0x4d95fd['shift']());}};_0x1e152f(++_0x31129d);}(_0xe8d7,0x1a3));var _0x7e8d=function(_0x249a11,_0xbc4079){_0x249a11=_0x249a11-0x0;var _0x30c55c=_0xe8d7[_0x249a11];return _0x30c55c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e8d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e8d('0x1'));var rp=require(_0x7e8d('0x2'));var moment=require(_0x7e8d('0x3'));var BPromise=require(_0x7e8d('0x4'));var Mustache=require(_0x7e8d('0x5'));var util=require(_0x7e8d('0x6'));var path=require(_0x7e8d('0x7'));var sox=require('sox');var csv=require(_0x7e8d('0x8'));var ejs=require(_0x7e8d('0x9'));var fs=require('fs');var fs_extra=require(_0x7e8d('0xa'));var _=require('lodash');var squel=require(_0x7e8d('0xb'));var crypto=require('crypto');var jsforce=require(_0x7e8d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7e8d('0xd'));var Papa=require(_0x7e8d('0xe'));var Redis=require(_0x7e8d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7e8d('0x10'));var as=require(_0x7e8d('0x11'));var hardwareService=require(_0x7e8d('0x12'));var logger=require(_0x7e8d('0x13'))('api');var utils=require(_0x7e8d('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ac88d,_0x2a8915){_0x2a8915=_0x2a8915||0xcc;return function(_0x201a25){if(_0x201a25){return _0x3ac88d[_0x7e8d('0x15')](_0x2a8915);}return _0x3ac88d[_0x7e8d('0x16')](_0x2a8915)[_0x7e8d('0x17')]();};}function respondWithResult(_0x155da2,_0x462f13){_0x462f13=_0x462f13||0xc8;return function(_0x50ca5e){if(_0x50ca5e){return _0x155da2[_0x7e8d('0x16')](_0x462f13)[_0x7e8d('0x18')](_0x50ca5e);}};}function respondWithFilteredResult(_0x1ab350,_0x40e8da){return function(_0x119fa9){if(_0x119fa9){var _0x4c9ffb=typeof _0x40e8da[_0x7e8d('0x19')]===_0x7e8d('0x1a')&&typeof _0x40e8da[_0x7e8d('0x1b')]===_0x7e8d('0x1a');var _0x4c5198=_0x119fa9[_0x7e8d('0x1c')];var _0x2d880c=_0x4c9ffb?0x0:_0x40e8da[_0x7e8d('0x19')];var _0x305c06=_0x4c9ffb?_0x119fa9[_0x7e8d('0x1c')]:_0x40e8da[_0x7e8d('0x19')]+_0x40e8da['limit'];var _0x391779;if(_0x305c06>=_0x4c5198){_0x305c06=_0x4c5198;_0x391779=0xc8;}else{_0x391779=0xce;}_0x1ab350[_0x7e8d('0x16')](_0x391779);return _0x1ab350[_0x7e8d('0x1d')](_0x7e8d('0x1e'),_0x2d880c+'-'+_0x305c06+'/'+_0x4c5198)['json'](_0x119fa9);}return null;};}function patchUpdates(_0x56110f){return function(_0x5796a0){try{jsonpatch[_0x7e8d('0x1f')](_0x5796a0,_0x56110f,!![]);}catch(_0x504bc6){return BPromise[_0x7e8d('0x20')](_0x504bc6);}return _0x5796a0[_0x7e8d('0x21')]();};}function saveUpdates(_0x329a55,_0x20a0e8){return function(_0x4e198c){if(_0x4e198c){return _0x4e198c[_0x7e8d('0x22')](_0x329a55)[_0x7e8d('0x23')](function(_0x43a8a4){return _0x43a8a4;});}return null;};}function removeEntity(_0x149218,_0x5407be){return function(_0x1d34b4){if(_0x1d34b4){return _0x1d34b4[_0x7e8d('0x24')]()[_0x7e8d('0x23')](function(){_0x149218[_0x7e8d('0x16')](0xcc)[_0x7e8d('0x17')]();});}};}function handleEntityNotFound(_0xea0753,_0x165ba6){return function(_0x25442d){if(!_0x25442d){_0xea0753['sendStatus'](0x194);}return _0x25442d;};}function handleError(_0x363d45,_0x1d4e03){_0x1d4e03=_0x1d4e03||0x1f4;return function(_0x1d8460){logger[_0x7e8d('0x25')](_0x1d8460[_0x7e8d('0x26')]);if(_0x1d8460['name']){delete _0x1d8460[_0x7e8d('0x27')];}_0x363d45[_0x7e8d('0x16')](_0x1d4e03)[_0x7e8d('0x28')](_0x1d8460);};}exports[_0x7e8d('0x29')]=function(_0x544068,_0x561495){var _0x26e76b={},_0x50e405={},_0x4d1a02={'count':0x0,'rows':[]};var _0x246679=_['map'](db[_0x7e8d('0x2a')]['rawAttributes'],function(_0x5b1893){return{'name':_0x5b1893[_0x7e8d('0x2b')],'type':_0x5b1893[_0x7e8d('0x2c')][_0x7e8d('0x2d')]};});_0x50e405['model']=_[_0x7e8d('0x2e')](_0x246679,_0x7e8d('0x27'));_0x50e405[_0x7e8d('0x2f')]=_[_0x7e8d('0x30')](_0x544068['query']);_0x50e405[_0x7e8d('0x31')]=_['intersection'](_0x50e405[_0x7e8d('0x32')],_0x50e405[_0x7e8d('0x2f')]);_0x26e76b[_0x7e8d('0x33')]=_[_0x7e8d('0x34')](_0x50e405[_0x7e8d('0x32')],qs[_0x7e8d('0x35')](_0x544068['query']['fields']));_0x26e76b[_0x7e8d('0x33')]=_0x26e76b[_0x7e8d('0x33')]['length']?_0x26e76b[_0x7e8d('0x33')]:_0x50e405[_0x7e8d('0x32')];if(!_0x544068[_0x7e8d('0x2f')]['hasOwnProperty'](_0x7e8d('0x36'))){_0x26e76b['limit']=qs['limit'](_0x544068[_0x7e8d('0x2f')]['limit']);_0x26e76b[_0x7e8d('0x19')]=qs[_0x7e8d('0x19')](_0x544068[_0x7e8d('0x2f')][_0x7e8d('0x19')]);}_0x26e76b[_0x7e8d('0x37')]=qs[_0x7e8d('0x38')](_0x544068['query']['sort']);_0x26e76b[_0x7e8d('0x39')]=qs[_0x7e8d('0x31')](_[_0x7e8d('0x3a')](_0x544068['query'],_0x50e405['filters']),_0x246679);if(_0x544068[_0x7e8d('0x2f')]['filter']){_0x26e76b[_0x7e8d('0x39')]=_[_0x7e8d('0x3b')](_0x26e76b[_0x7e8d('0x39')],{'$or':_['map'](_0x246679,function(_0x75a778){if(_0x75a778['type']!==_0x7e8d('0x3c')){var _0x6b36b2={};_0x6b36b2[_0x75a778[_0x7e8d('0x27')]]={'$like':'%'+_0x544068['query'][_0x7e8d('0x3d')]+'%'};return _0x6b36b2;}})});}_0x26e76b=_['merge']({},_0x26e76b,_0x544068[_0x7e8d('0x3e')]);var _0x2180b8={'where':_0x26e76b[_0x7e8d('0x39')]};return db[_0x7e8d('0x2a')][_0x7e8d('0x1c')](_0x2180b8)['then'](function(_0xfb5518){_0x4d1a02['count']=_0xfb5518;if(_0x544068['query'][_0x7e8d('0x3f')]){_0x26e76b[_0x7e8d('0x40')]=[{'all':!![]}];}return db[_0x7e8d('0x2a')][_0x7e8d('0x41')](_0x26e76b);})['then'](function(_0xbda58f){_0x4d1a02[_0x7e8d('0x42')]=_0xbda58f;return _0x4d1a02;})[_0x7e8d('0x23')](respondWithFilteredResult(_0x561495,_0x26e76b))[_0x7e8d('0x43')](handleError(_0x561495,null));};exports['show']=function(_0x1fc523,_0x599c1b){var _0x21737e={'raw':!![],'where':{'id':_0x1fc523[_0x7e8d('0x44')]['id']}},_0x5d922c={};_0x5d922c['model']=_[_0x7e8d('0x30')](db[_0x7e8d('0x2a')][_0x7e8d('0x45')]);_0x5d922c[_0x7e8d('0x2f')]=_['keys'](_0x1fc523[_0x7e8d('0x2f')]);_0x5d922c[_0x7e8d('0x31')]=_['intersection'](_0x5d922c['model'],_0x5d922c['query']);_0x21737e['attributes']=_[_0x7e8d('0x34')](_0x5d922c[_0x7e8d('0x32')],qs['fields'](_0x1fc523[_0x7e8d('0x2f')][_0x7e8d('0x35')]));_0x21737e[_0x7e8d('0x33')]=_0x21737e[_0x7e8d('0x33')][_0x7e8d('0x46')]?_0x21737e[_0x7e8d('0x33')]:_0x5d922c[_0x7e8d('0x32')];if(_0x1fc523[_0x7e8d('0x2f')][_0x7e8d('0x3f')]){_0x21737e['include']=[{'all':!![]}];}_0x21737e=_['merge']({},_0x21737e,_0x1fc523[_0x7e8d('0x3e')]);return db[_0x7e8d('0x2a')][_0x7e8d('0x47')](_0x21737e)[_0x7e8d('0x23')](handleEntityNotFound(_0x599c1b,null))['then'](respondWithResult(_0x599c1b,null))['catch'](handleError(_0x599c1b,null));};exports[_0x7e8d('0x48')]=function(_0x18df15,_0x4a3a26){return db['ServicenowField'][_0x7e8d('0x48')](_0x18df15[_0x7e8d('0x49')],{})[_0x7e8d('0x23')](respondWithResult(_0x4a3a26,0xc9))[_0x7e8d('0x43')](handleError(_0x4a3a26,null));};exports[_0x7e8d('0x22')]=function(_0x43ced0,_0x8e5df2){if(_0x43ced0[_0x7e8d('0x49')]['id']){delete _0x43ced0['body']['id'];}return db['ServicenowField']['find']({'where':{'id':_0x43ced0[_0x7e8d('0x44')]['id']}})[_0x7e8d('0x23')](handleEntityNotFound(_0x8e5df2,null))[_0x7e8d('0x23')](saveUpdates(_0x43ced0[_0x7e8d('0x49')],null))[_0x7e8d('0x23')](respondWithResult(_0x8e5df2,null))['catch'](handleError(_0x8e5df2,null));};exports[_0x7e8d('0x24')]=function(_0x54c10d,_0x5ae6e6){return db[_0x7e8d('0x2a')][_0x7e8d('0x47')]({'where':{'id':_0x54c10d[_0x7e8d('0x44')]['id']}})[_0x7e8d('0x23')](handleEntityNotFound(_0x5ae6e6,null))[_0x7e8d('0x23')](removeEntity(_0x5ae6e6,null))['catch'](handleError(_0x5ae6e6,null));}; \ No newline at end of file +var _0x8069=['options','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','order','sort','pick','filter','where','VIRTUAL','ServicenowField','includeAll','include','findAll','catch','show','params','keys','length','merge'];(function(_0x4312ed,_0x1a9cec){var _0x27073a=function(_0x3df982){while(--_0x3df982){_0x4312ed['push'](_0x4312ed['shift']());}};_0x27073a(++_0x1a9cec);}(_0x8069,0x96));var _0x9806=function(_0x3e166a,_0x1eeb43){_0x3e166a=_0x3e166a-0x0;var _0x4a536b=_0x8069[_0x3e166a];return _0x4a536b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9806('0x0'));var zipdir=require(_0x9806('0x1'));var jsonpatch=require(_0x9806('0x2'));var rp=require(_0x9806('0x3'));var moment=require(_0x9806('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9806('0x5'));var util=require(_0x9806('0x6'));var path=require(_0x9806('0x7'));var sox=require(_0x9806('0x8'));var csv=require(_0x9806('0x9'));var ejs=require(_0x9806('0xa'));var fs=require('fs');var fs_extra=require(_0x9806('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9806('0xc'));var jsforce=require(_0x9806('0xd'));var deskjs=require(_0x9806('0xe'));var toCsv=require(_0x9806('0x9'));var querystring=require(_0x9806('0xf'));var Papa=require('papaparse');var Redis=require(_0x9806('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9806('0x11'));var as=require(_0x9806('0x12'));var hardwareService=require(_0x9806('0x13'));var logger=require(_0x9806('0x14'))('api');var utils=require(_0x9806('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9806('0x16'));var db=require(_0x9806('0x17'))['db'];function respondWithStatusCode(_0x25e121,_0x401e6b){_0x401e6b=_0x401e6b||0xcc;return function(_0x49bdbe){if(_0x49bdbe){return _0x25e121[_0x9806('0x18')](_0x401e6b);}return _0x25e121[_0x9806('0x19')](_0x401e6b)[_0x9806('0x1a')]();};}function respondWithResult(_0x11b031,_0x4b75b6){_0x4b75b6=_0x4b75b6||0xc8;return function(_0xbcc171){if(_0xbcc171){return _0x11b031[_0x9806('0x19')](_0x4b75b6)[_0x9806('0x1b')](_0xbcc171);}};}function respondWithFilteredResult(_0x3aae5d,_0x2fe079){return function(_0x37ec56){if(_0x37ec56){var _0x651e=typeof _0x2fe079['offset']==='undefined'&&typeof _0x2fe079[_0x9806('0x1c')]===_0x9806('0x1d');var _0xf0cd3=_0x37ec56[_0x9806('0x1e')];var _0x43a0f3=_0x651e?0x0:_0x2fe079[_0x9806('0x1f')];var _0x1ede45=_0x651e?_0x37ec56['count']:_0x2fe079['offset']+_0x2fe079[_0x9806('0x1c')];var _0x23419a;if(_0x1ede45>=_0xf0cd3){_0x1ede45=_0xf0cd3;_0x23419a=0xc8;}else{_0x23419a=0xce;}_0x3aae5d[_0x9806('0x19')](_0x23419a);return _0x3aae5d['set'](_0x9806('0x20'),_0x43a0f3+'-'+_0x1ede45+'/'+_0xf0cd3)[_0x9806('0x1b')](_0x37ec56);}return null;};}function patchUpdates(_0x342c66){return function(_0x1fa5be){try{jsonpatch[_0x9806('0x21')](_0x1fa5be,_0x342c66,!![]);}catch(_0x2fd88b){return BPromise[_0x9806('0x22')](_0x2fd88b);}return _0x1fa5be['save']();};}function saveUpdates(_0x18d8c8,_0x136bd1){return function(_0x1302c5){if(_0x1302c5){return _0x1302c5[_0x9806('0x23')](_0x18d8c8)[_0x9806('0x24')](function(_0x5707c6){return _0x5707c6;});}return null;};}function removeEntity(_0x42f714,_0x3c388e){return function(_0x464ee2){if(_0x464ee2){return _0x464ee2[_0x9806('0x25')]()['then'](function(){_0x42f714['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x87cabc,_0x4d5edc){return function(_0x3509a7){if(!_0x3509a7){_0x87cabc[_0x9806('0x18')](0x194);}return _0x3509a7;};}function handleError(_0x3da7d3,_0x40854d){_0x40854d=_0x40854d||0x1f4;return function(_0xa87a7c){logger[_0x9806('0x26')](_0xa87a7c[_0x9806('0x27')]);if(_0xa87a7c[_0x9806('0x28')]){delete _0xa87a7c[_0x9806('0x28')];}_0x3da7d3['status'](_0x40854d)['send'](_0xa87a7c);};}exports[_0x9806('0x29')]=function(_0x1630f9,_0x3ed59d){var _0x8bdd54={},_0x87bd03={},_0x4e4065={'count':0x0,'rows':[]};var _0x1d65d5=_[_0x9806('0x2a')](db['ServicenowField'][_0x9806('0x2b')],function(_0xf3e14a){return{'name':_0xf3e14a[_0x9806('0x2c')],'type':_0xf3e14a[_0x9806('0x2d')][_0x9806('0x2e')]};});_0x87bd03[_0x9806('0x2f')]=_[_0x9806('0x2a')](_0x1d65d5,'name');_0x87bd03[_0x9806('0x30')]=_['keys'](_0x1630f9['query']);_0x87bd03[_0x9806('0x31')]=_[_0x9806('0x32')](_0x87bd03[_0x9806('0x2f')],_0x87bd03[_0x9806('0x30')]);_0x8bdd54[_0x9806('0x33')]=_[_0x9806('0x32')](_0x87bd03[_0x9806('0x2f')],qs[_0x9806('0x34')](_0x1630f9['query'][_0x9806('0x34')]));_0x8bdd54[_0x9806('0x33')]=_0x8bdd54[_0x9806('0x33')]['length']?_0x8bdd54[_0x9806('0x33')]:_0x87bd03['model'];if(!_0x1630f9['query']['hasOwnProperty']('nolimit')){_0x8bdd54[_0x9806('0x1c')]=qs[_0x9806('0x1c')](_0x1630f9['query'][_0x9806('0x1c')]);_0x8bdd54[_0x9806('0x1f')]=qs[_0x9806('0x1f')](_0x1630f9[_0x9806('0x30')][_0x9806('0x1f')]);}_0x8bdd54[_0x9806('0x35')]=qs['sort'](_0x1630f9[_0x9806('0x30')][_0x9806('0x36')]);_0x8bdd54['where']=qs[_0x9806('0x31')](_[_0x9806('0x37')](_0x1630f9[_0x9806('0x30')],_0x87bd03[_0x9806('0x31')]),_0x1d65d5);if(_0x1630f9[_0x9806('0x30')][_0x9806('0x38')]){_0x8bdd54[_0x9806('0x39')]=_['merge'](_0x8bdd54[_0x9806('0x39')],{'$or':_['map'](_0x1d65d5,function(_0x1ed034){if(_0x1ed034[_0x9806('0x2d')]!==_0x9806('0x3a')){var _0x4b975d={};_0x4b975d[_0x1ed034[_0x9806('0x28')]]={'$like':'%'+_0x1630f9[_0x9806('0x30')][_0x9806('0x38')]+'%'};return _0x4b975d;}})});}_0x8bdd54=_['merge']({},_0x8bdd54,_0x1630f9['options']);var _0x2c2e16={'where':_0x8bdd54[_0x9806('0x39')]};return db[_0x9806('0x3b')][_0x9806('0x1e')](_0x2c2e16)[_0x9806('0x24')](function(_0x595825){_0x4e4065[_0x9806('0x1e')]=_0x595825;if(_0x1630f9['query'][_0x9806('0x3c')]){_0x8bdd54[_0x9806('0x3d')]=[{'all':!![]}];}return db['ServicenowField'][_0x9806('0x3e')](_0x8bdd54);})[_0x9806('0x24')](function(_0x548afa){_0x4e4065['rows']=_0x548afa;return _0x4e4065;})[_0x9806('0x24')](respondWithFilteredResult(_0x3ed59d,_0x8bdd54))[_0x9806('0x3f')](handleError(_0x3ed59d,null));};exports[_0x9806('0x40')]=function(_0x3c941d,_0x5dfa89){var _0x841763={'raw':!![],'where':{'id':_0x3c941d[_0x9806('0x41')]['id']}},_0x33433d={};_0x33433d[_0x9806('0x2f')]=_[_0x9806('0x42')](db[_0x9806('0x3b')][_0x9806('0x2b')]);_0x33433d[_0x9806('0x30')]=_[_0x9806('0x42')](_0x3c941d[_0x9806('0x30')]);_0x33433d[_0x9806('0x31')]=_[_0x9806('0x32')](_0x33433d[_0x9806('0x2f')],_0x33433d[_0x9806('0x30')]);_0x841763['attributes']=_['intersection'](_0x33433d['model'],qs['fields'](_0x3c941d[_0x9806('0x30')][_0x9806('0x34')]));_0x841763['attributes']=_0x841763[_0x9806('0x33')][_0x9806('0x43')]?_0x841763['attributes']:_0x33433d['model'];if(_0x3c941d['query'][_0x9806('0x3c')]){_0x841763[_0x9806('0x3d')]=[{'all':!![]}];}_0x841763=_[_0x9806('0x44')]({},_0x841763,_0x3c941d[_0x9806('0x45')]);return db['ServicenowField']['find'](_0x841763)[_0x9806('0x24')](handleEntityNotFound(_0x5dfa89,null))[_0x9806('0x24')](respondWithResult(_0x5dfa89,null))[_0x9806('0x3f')](handleError(_0x5dfa89,null));};exports['create']=function(_0x1871a4,_0x14693b){return db[_0x9806('0x3b')][_0x9806('0x46')](_0x1871a4[_0x9806('0x47')],{})[_0x9806('0x24')](respondWithResult(_0x14693b,0xc9))[_0x9806('0x3f')](handleError(_0x14693b,null));};exports['update']=function(_0x4cbfc3,_0x167102){if(_0x4cbfc3[_0x9806('0x47')]['id']){delete _0x4cbfc3[_0x9806('0x47')]['id'];}return db['ServicenowField'][_0x9806('0x48')]({'where':{'id':_0x4cbfc3[_0x9806('0x41')]['id']}})[_0x9806('0x24')](handleEntityNotFound(_0x167102,null))[_0x9806('0x24')](saveUpdates(_0x4cbfc3['body'],null))['then'](respondWithResult(_0x167102,null))[_0x9806('0x3f')](handleError(_0x167102,null));};exports[_0x9806('0x25')]=function(_0xfaf11a,_0x14b27d){return db[_0x9806('0x3b')][_0x9806('0x48')]({'where':{'id':_0xfaf11a[_0x9806('0x41')]['id']}})[_0x9806('0x24')](handleEntityNotFound(_0x14b27d,null))['then'](removeEntity(_0x14b27d,null))['catch'](handleError(_0x14b27d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 4b29165..dda1936 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 _0x4c49=['rimraf','exports','define','idField','../../config/logger','bluebird'];(function(_0x47e93d,_0x26bbdd){var _0xe86c46=function(_0x10e072){while(--_0x10e072){_0x47e93d['push'](_0x47e93d['shift']());}};_0xe86c46(++_0x26bbdd);}(_0x4c49,0x1f0));var _0x94c4=function(_0x3d445d,_0x32a810){_0x3d445d=_0x3d445d-0x0;var _0x4bca2c=_0x4c49[_0x3d445d];return _0x4bca2c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x94c4('0x0'))('api');var moment=require('moment');var BPromise=require(_0x94c4('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x94c4('0x2'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x94c4('0x3')]=function(_0x2bce43,_0x40bf7d){return _0x2bce43[_0x94c4('0x4')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x94c4('0x5'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb15a=['servicenow_unique_index','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields'];(function(_0x507527,_0x3d1f6e){var _0x2dec80=function(_0x5c1e5f){while(--_0x5c1e5f){_0x507527['push'](_0x507527['shift']());}};_0x2dec80(++_0x3d1f6e);}(_0xb15a,0x161));var _0xab15=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xb15a[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0xab15('0x0'));var util=require(_0xab15('0x1'));var logger=require(_0xab15('0x2'))(_0xab15('0x3'));var moment=require(_0xab15('0x4'));var BPromise=require(_0xab15('0x5'));var rp=require(_0xab15('0x6'));var fs=require('fs');var path=require(_0xab15('0x7'));var rimraf=require(_0xab15('0x8'));var config=require(_0xab15('0x9'));var attributes=require(_0xab15('0xa'));module[_0xab15('0xb')]=function(_0x436689,_0xe0009b){return _0x436689[_0xab15('0xc')](_0xab15('0xd'),attributes,{'tableName':_0xab15('0xe'),'paranoid':![],'indexes':[{'name':_0xab15('0xf'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index c2b6c37..664c705 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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x2f60ac,_0x410f85){var _0x4605e7=function(_0x27edf8){while(--_0x27edf8){_0x2f60ac['push'](_0x2f60ac['shift']());}};_0x4605e7(++_0x410f85);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4a8bcd,_0x2ca051){_0x4a8bcd=_0x4a8bcd-0x0;var _0xe3cd70=_0x9ffd[_0x4a8bcd];return _0xe3cd70;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x379e1c,_0x59ba5f){var _0x1236f9=function(_0xf6f71f){while(--_0xf6f71f){_0x379e1c['push'](_0x379e1c['shift']());}};_0x1236f9(++_0x59ba5f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4fa53f,_0x15a4db){_0x4fa53f=_0x4fa53f-0x0;var _0x41c791=_0xb43b[_0x4fa53f];return _0x41c791;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 975a842..3c60e9f 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 _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(_0x4fdc28,_0x3bd169){var _0x177d5d=function(_0x381419){while(--_0x381419){_0x4fdc28['push'](_0x4fdc28['shift']());}};_0x177d5d(++_0x3bd169);}(_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('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2e1292,_0x146c17){var _0x4a26d6=function(_0x281331){while(--_0x281331){_0x2e1292['push'](_0x2e1292['shift']());}};_0x4a26d6(++_0x146c17);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 35ab751..f713314 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(_0x5f01ba,_0x22249c){var _0x8f0743=function(_0x35984a){while(--_0x35984a){_0x5f01ba['push'](_0x5f01ba['shift']());}};_0x8f0743(++_0x22249c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x12cbd3,_0x4ff068){var _0x42f954=function(_0x15d377){while(--_0x15d377){_0x12cbd3['push'](_0x12cbd3['shift']());}};_0x42f954(++_0x4ff068);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 a8524d8..18cd5ec 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 _0x80c7=['password','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','%s%s','get_module_fields','JSON','Calls','values','module_fields','remove','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','error','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','show','params','length','include','options','find','create','body','catch','getConfigurations','findOne','SugarcrmConfiguration','order','addConfiguration','AccountId','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','remoteUri','slice','substring','lastIndexOf','POST','format','login','stringify','username'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0x80c7,0x8d));var _0x780c=function(_0x118cab,_0xab39e6){_0x118cab=_0x118cab-0x0;var _0x48f461=_0x80c7[_0x118cab];return _0x48f461;};'use strict';var emlformat=require(_0x780c('0x0'));var rimraf=require(_0x780c('0x1'));var zipdir=require(_0x780c('0x2'));var jsonpatch=require(_0x780c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x780c('0x4'));var Mustache=require('mustache');var util=require(_0x780c('0x5'));var path=require(_0x780c('0x6'));var sox=require(_0x780c('0x7'));var csv=require(_0x780c('0x8'));var ejs=require(_0x780c('0x9'));var fs=require('fs');var fs_extra=require(_0x780c('0xa'));var _=require(_0x780c('0xb'));var squel=require(_0x780c('0xc'));var crypto=require(_0x780c('0xd'));var jsforce=require(_0x780c('0xe'));var deskjs=require(_0x780c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x780c('0x10'));var Papa=require(_0x780c('0x11'));var Redis=require('ioredis');var authService=require(_0x780c('0x12'));var qs=require(_0x780c('0x13'));var as=require(_0x780c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x780c('0x15'))(_0x780c('0x16'));var utils=require(_0x780c('0x17'));var config=require(_0x780c('0x18'));var licenseUtil=require(_0x780c('0x19'));var db=require(_0x780c('0x1a'))['db'];var integrations=require(_0x780c('0x1b'));function respondWithStatusCode(_0x5a5986,_0x3aaa99){_0x3aaa99=_0x3aaa99||0xcc;return function(_0x27706){if(_0x27706){return _0x5a5986[_0x780c('0x1c')](_0x3aaa99);}return _0x5a5986[_0x780c('0x1d')](_0x3aaa99)['end']();};}function respondWithResult(_0x4ea5df,_0x244934){_0x244934=_0x244934||0xc8;return function(_0x394822){if(_0x394822){return _0x4ea5df['status'](_0x244934)['json'](_0x394822);}};}function respondWithFilteredResult(_0x2c8c23,_0xccd8c){return function(_0x21b69b){if(_0x21b69b){var _0x2f99d8=typeof _0xccd8c[_0x780c('0x1e')]===_0x780c('0x1f')&&typeof _0xccd8c['limit']===_0x780c('0x1f');var _0xc55c22=_0x21b69b[_0x780c('0x20')];var _0x2dbcd8=_0x2f99d8?0x0:_0xccd8c['offset'];var _0xcd171e=_0x2f99d8?_0x21b69b[_0x780c('0x20')]:_0xccd8c[_0x780c('0x1e')]+_0xccd8c[_0x780c('0x21')];var _0x4bee54;if(_0xcd171e>=_0xc55c22){_0xcd171e=_0xc55c22;_0x4bee54=0xc8;}else{_0x4bee54=0xce;}_0x2c8c23[_0x780c('0x1d')](_0x4bee54);return _0x2c8c23[_0x780c('0x22')]('Content-Range',_0x2dbcd8+'-'+_0xcd171e+'/'+_0xc55c22)['json'](_0x21b69b);}return null;};}function patchUpdates(_0x5cccd3){return function(_0x31cf45){try{jsonpatch[_0x780c('0x23')](_0x31cf45,_0x5cccd3,!![]);}catch(_0x105c5f){return BPromise[_0x780c('0x24')](_0x105c5f);}return _0x31cf45[_0x780c('0x25')]();};}function saveUpdates(_0x21e720,_0x2c66c5){return function(_0xe08ff7){if(_0xe08ff7){return _0xe08ff7[_0x780c('0x26')](_0x21e720)[_0x780c('0x27')](function(_0x1d0c8a){return _0x1d0c8a;});}return null;};}function removeEntity(_0x55fc81,_0x226f7b){return function(_0x252127){if(_0x252127){return _0x252127[_0x780c('0x28')]()['then'](function(){_0x55fc81[_0x780c('0x1d')](0xcc)[_0x780c('0x29')]();});}};}function handleEntityNotFound(_0x38810b,_0x27e326){return function(_0xda9edf){if(!_0xda9edf){_0x38810b[_0x780c('0x1c')](0x194);}return _0xda9edf;};}function handleError(_0x5d675c,_0x1cb65e){_0x1cb65e=_0x1cb65e||0x1f4;return function(_0x481ecf){logger[_0x780c('0x2a')](_0x481ecf['stack']);if(_0x481ecf[_0x780c('0x2b')]){delete _0x481ecf[_0x780c('0x2b')];}_0x5d675c[_0x780c('0x1d')](_0x1cb65e)[_0x780c('0x2c')](_0x481ecf);};}exports[_0x780c('0x2d')]=function(_0x1819bf,_0x37d6c8){var _0x35b97a={},_0x2a19b1={},_0x21f84e={'count':0x0,'rows':[]};var _0x32e3d9=_[_0x780c('0x2e')](db[_0x780c('0x2f')][_0x780c('0x30')],function(_0x583b15){return{'name':_0x583b15[_0x780c('0x31')],'type':_0x583b15[_0x780c('0x32')][_0x780c('0x33')]};});_0x2a19b1[_0x780c('0x34')]=_[_0x780c('0x2e')](_0x32e3d9,_0x780c('0x2b'));_0x2a19b1['query']=_[_0x780c('0x35')](_0x1819bf[_0x780c('0x36')]);_0x2a19b1[_0x780c('0x37')]=_[_0x780c('0x38')](_0x2a19b1['model'],_0x2a19b1['query']);_0x35b97a[_0x780c('0x39')]=_[_0x780c('0x38')](_0x2a19b1['model'],qs['fields'](_0x1819bf['query'][_0x780c('0x3a')]));_0x35b97a[_0x780c('0x39')]=_0x35b97a[_0x780c('0x39')]['length']?_0x35b97a[_0x780c('0x39')]:_0x2a19b1['model'];if(!_0x1819bf['query'][_0x780c('0x3b')](_0x780c('0x3c'))){_0x35b97a[_0x780c('0x21')]=qs[_0x780c('0x21')](_0x1819bf[_0x780c('0x36')][_0x780c('0x21')]);_0x35b97a['offset']=qs[_0x780c('0x1e')](_0x1819bf[_0x780c('0x36')]['offset']);}_0x35b97a['order']=qs[_0x780c('0x3d')](_0x1819bf[_0x780c('0x36')][_0x780c('0x3d')]);_0x35b97a[_0x780c('0x3e')]=qs[_0x780c('0x37')](_[_0x780c('0x3f')](_0x1819bf[_0x780c('0x36')],_0x2a19b1[_0x780c('0x37')]),_0x32e3d9);if(_0x1819bf[_0x780c('0x36')][_0x780c('0x40')]){_0x35b97a['where']=_[_0x780c('0x41')](_0x35b97a[_0x780c('0x3e')],{'$or':_['map'](_0x32e3d9,function(_0x871e0a){if(_0x871e0a[_0x780c('0x32')]!=='VIRTUAL'){var _0x21b75b={};_0x21b75b[_0x871e0a['name']]={'$like':'%'+_0x1819bf[_0x780c('0x36')][_0x780c('0x40')]+'%'};return _0x21b75b;}})});}_0x35b97a=_[_0x780c('0x41')]({},_0x35b97a,_0x1819bf['options']);var _0x5756cf={'where':_0x35b97a[_0x780c('0x3e')]};return db[_0x780c('0x2f')][_0x780c('0x20')](_0x5756cf)[_0x780c('0x27')](function(_0x461d4a){_0x21f84e[_0x780c('0x20')]=_0x461d4a;if(_0x1819bf[_0x780c('0x36')][_0x780c('0x42')]){_0x35b97a['include']=[{'all':!![]}];}return db[_0x780c('0x2f')][_0x780c('0x43')](_0x35b97a);})['then'](function(_0x22ceda){_0x21f84e[_0x780c('0x44')]=_0x22ceda;return _0x21f84e;})[_0x780c('0x27')](respondWithFilteredResult(_0x37d6c8,_0x35b97a))['catch'](handleError(_0x37d6c8,null));};exports[_0x780c('0x45')]=function(_0x14a5d9,_0x37d547){var _0x4be864={'raw':![],'where':{'id':_0x14a5d9[_0x780c('0x46')]['id']}},_0x4e0735={};_0x4e0735[_0x780c('0x34')]=_[_0x780c('0x35')](db[_0x780c('0x2f')][_0x780c('0x30')]);_0x4e0735[_0x780c('0x36')]=_[_0x780c('0x35')](_0x14a5d9['query']);_0x4e0735['filters']=_[_0x780c('0x38')](_0x4e0735[_0x780c('0x34')],_0x4e0735[_0x780c('0x36')]);_0x4be864[_0x780c('0x39')]=_[_0x780c('0x38')](_0x4e0735[_0x780c('0x34')],qs[_0x780c('0x3a')](_0x14a5d9[_0x780c('0x36')]['fields']));_0x4be864[_0x780c('0x39')]=_0x4be864[_0x780c('0x39')][_0x780c('0x47')]?_0x4be864['attributes']:_0x4e0735['model'];if(_0x14a5d9[_0x780c('0x36')][_0x780c('0x42')]){_0x4be864[_0x780c('0x48')]=[{'all':!![]}];}_0x4be864=_[_0x780c('0x41')]({},_0x4be864,_0x14a5d9[_0x780c('0x49')]);return db['SugarcrmAccount'][_0x780c('0x4a')](_0x4be864)[_0x780c('0x27')](handleEntityNotFound(_0x37d547,null))['then'](respondWithResult(_0x37d547,null))['catch'](handleError(_0x37d547,null));};exports[_0x780c('0x4b')]=function(_0x59be69,_0x545ebf){return db['SugarcrmAccount'][_0x780c('0x4b')](_0x59be69['body'],{})[_0x780c('0x27')](respondWithResult(_0x545ebf,0xc9))['catch'](handleError(_0x545ebf,null));};exports[_0x780c('0x26')]=function(_0x4eda4f,_0x2eb744){if(_0x4eda4f[_0x780c('0x4c')]['id']){delete _0x4eda4f[_0x780c('0x4c')]['id'];}return db[_0x780c('0x2f')][_0x780c('0x4a')]({'where':{'id':_0x4eda4f[_0x780c('0x46')]['id']}})[_0x780c('0x27')](handleEntityNotFound(_0x2eb744,null))[_0x780c('0x27')](saveUpdates(_0x4eda4f['body'],null))[_0x780c('0x27')](respondWithResult(_0x2eb744,null))[_0x780c('0x4d')](handleError(_0x2eb744,null));};exports[_0x780c('0x28')]=function(_0x4e780e,_0xfb1e87){return db[_0x780c('0x2f')]['find']({'where':{'id':_0x4e780e[_0x780c('0x46')]['id']}})[_0x780c('0x27')](handleEntityNotFound(_0xfb1e87,null))[_0x780c('0x27')](removeEntity(_0xfb1e87,null))['catch'](handleError(_0xfb1e87,null));};exports[_0x780c('0x4e')]=function(_0x539358,_0x302bc,_0x2ab39d){var _0x21e78a={};var _0x53780d={};var _0x4ac59f;var _0x56131f;return db[_0x780c('0x2f')][_0x780c('0x4f')]({'where':{'id':_0x539358[_0x780c('0x46')]['id']}})['then'](handleEntityNotFound(_0x302bc,null))['then'](function(_0x5d8088){if(_0x5d8088){_0x4ac59f=_0x5d8088;_0x53780d['model']=_[_0x780c('0x35')](db[_0x780c('0x50')][_0x780c('0x30')]);_0x53780d[_0x780c('0x36')]=_['keys'](_0x539358[_0x780c('0x36')]);_0x53780d['filters']=_[_0x780c('0x38')](_0x53780d[_0x780c('0x34')],_0x53780d['query']);_0x21e78a[_0x780c('0x39')]=_['intersection'](_0x53780d[_0x780c('0x34')],qs['fields'](_0x539358[_0x780c('0x36')]['fields']));_0x21e78a[_0x780c('0x39')]=_0x21e78a[_0x780c('0x39')][_0x780c('0x47')]?_0x21e78a[_0x780c('0x39')]:_0x53780d[_0x780c('0x34')];_0x21e78a[_0x780c('0x51')]=qs[_0x780c('0x3d')](_0x539358[_0x780c('0x36')][_0x780c('0x3d')]);_0x21e78a['where']=qs[_0x780c('0x37')](_[_0x780c('0x3f')](_0x539358[_0x780c('0x36')],_0x53780d[_0x780c('0x37')]));if(_0x539358['query'][_0x780c('0x40')]){_0x21e78a[_0x780c('0x3e')]=_['merge'](_0x21e78a[_0x780c('0x3e')],{'$or':_[_0x780c('0x2e')](_0x21e78a[_0x780c('0x39')],function(_0x2d0ef2){var _0x5a7e08={};_0x5a7e08[_0x2d0ef2]={'$like':'%'+_0x539358[_0x780c('0x36')]['filter']+'%'};return _0x5a7e08;})});}_0x21e78a=_['merge']({},_0x21e78a,_0x539358[_0x780c('0x49')]);return _0x4ac59f[_0x780c('0x4e')](_0x21e78a);}})[_0x780c('0x27')](function(_0x4fa59c){if(_0x4fa59c){_0x56131f=_0x4fa59c[_0x780c('0x47')];if(!_0x539358[_0x780c('0x36')][_0x780c('0x3b')](_0x780c('0x3c'))){_0x21e78a[_0x780c('0x21')]=qs['limit'](_0x539358[_0x780c('0x36')][_0x780c('0x21')]);_0x21e78a[_0x780c('0x1e')]=qs[_0x780c('0x1e')](_0x539358[_0x780c('0x36')][_0x780c('0x1e')]);}return _0x4ac59f[_0x780c('0x4e')](_0x21e78a);}})[_0x780c('0x27')](function(_0x14bf45){if(_0x14bf45){return _0x14bf45?{'count':_0x56131f,'rows':_0x14bf45}:null;}})[_0x780c('0x27')](respondWithResult(_0x302bc,null))[_0x780c('0x4d')](handleError(_0x302bc,null));};exports[_0x780c('0x52')]=function(_0x2cdda1,_0x29ef4d,_0x51cfe9){if(_0x2cdda1['body']['id']){delete _0x2cdda1[_0x780c('0x4c')]['id'];}return db[_0x780c('0x2f')]['findOne']({'where':{'id':_0x2cdda1[_0x780c('0x46')]['id']}})[_0x780c('0x27')](handleEntityNotFound(_0x29ef4d,null))['then'](function(_0x4c0a6f){if(_0x4c0a6f){_0x2cdda1[_0x780c('0x4c')][_0x780c('0x53')]=_0x4c0a6f['id'];_0x2cdda1[_0x780c('0x4c')]['Subjects']=integrations['getSubjects'](_0x2cdda1[_0x780c('0x4c')][_0x780c('0x54')],_0x2cdda1[_0x780c('0x4c')]['type']);_0x2cdda1[_0x780c('0x4c')][_0x780c('0x55')]=integrations[_0x780c('0x56')](_0x2cdda1[_0x780c('0x4c')]['channel'],_0x2cdda1[_0x780c('0x4c')][_0x780c('0x32')]);return db[_0x780c('0x50')][_0x780c('0x4b')](_0x2cdda1[_0x780c('0x4c')],{'include':[{'model':db[_0x780c('0x57')],'as':_0x780c('0x58')},{'model':db['SugarcrmField'],'as':_0x780c('0x55')}]});}return null;})[_0x780c('0x27')](respondWithResult(_0x29ef4d,null))[_0x780c('0x4d')](handleError(_0x29ef4d,null));};exports['getFields']=function(_0x183f94,_0x2937d8,_0x53851e){var _0x647296='';var _0x31583e=['id','name',_0x780c('0x59'),_0x780c('0x5a'),_0x780c('0x5b'),_0x780c('0x5c'),_0x780c('0x5d'),_0x780c('0x5e'),_0x780c('0x5f'),'parent_type',_0x780c('0x60'),_0x780c('0x61')];return db[_0x780c('0x2f')][_0x780c('0x4f')]({'where':{'id':_0x183f94[_0x780c('0x46')]['id']},'attributes':['id','username','password',_0x780c('0x62')]})[_0x780c('0x27')](handleEntityNotFound(_0x2937d8,null))[_0x780c('0x27')](function(_0x424c26){if(_0x424c26){_0x647296=_0x424c26[_0x780c('0x62')];var _0x512a24=_0x647296[_0x780c('0x63')](-0x1);if(_0x512a24==='/'){_0x647296=_0x647296[_0x780c('0x64')](0x0,_0x647296[_0x780c('0x65')](_0x512a24));}return rp({'method':_0x780c('0x66'),'uri':util[_0x780c('0x67')]('%s%s',_0x647296,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x780c('0x68'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x780c('0x69')]({'user_auth':{'user_name':_0x424c26[_0x780c('0x6a')],'password':_0x424c26[_0x780c('0x6b')],'encryption':_0x780c('0x6c')},'application':_0x780c('0x6d')})}});}})[_0x780c('0x27')](function(_0x17bbe6){if(_0x17bbe6&&_0x17bbe6[_0x780c('0x2b')]!=='Invalid\x20Login'&&_0x17bbe6[_0x780c('0x2b')]!==_0x780c('0x6e')){return rp({'method':_0x780c('0x66'),'uri':util['format'](_0x780c('0x6f'),_0x647296,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x780c('0x70'),'input_type':_0x780c('0x71'),'response_type':_0x780c('0x71'),'rest_data':JSON[_0x780c('0x69')]({'session':_0x17bbe6['id'],'module_name':_0x780c('0x72')})}})[_0x780c('0x27')](function(_0x5e9d1b){if(_0x5e9d1b){var _0x59d310=_[_0x780c('0x73')](_0x5e9d1b[_0x780c('0x74')]);_[_0x780c('0x75')](_0x59d310,function(_0x2e11f2){return _0x31583e['includes'](_0x2e11f2[_0x780c('0x2b')]);});return{'count':_0x59d310['length'],'rows':_[_0x780c('0x2e')](_0x59d310,function(_0x3a9408){return{'id':_0x3a9408[_0x780c('0x2b')],'name':_0x3a9408['label'],'custom':_['endsWith'](_0x3a9408[_0x780c('0x2b')],'_c')?!![]:![],'options':_0x3a9408['options']?_[_0x780c('0x2e')](_['values'](_0x3a9408[_0x780c('0x49')]),function(_0x9167ce){return{'name':_0x9167ce[_0x780c('0x76')],'value':_0x9167ce['name']};}):[]};})};}})[_0x780c('0x27')](respondWithResult(_0x2937d8,null))[_0x780c('0x4d')](function(_0x23d42f){var _0x1aed85=_0x183f94[_0x780c('0x36')]['test']?0x1f4:_0x23d42f[_0x780c('0x77')]||0x1f4;logger['error'](_0x780c('0x78'),_0x780c('0x79'),_0x1aed85,JSON[_0x780c('0x69')](_0x23d42f));delete _0x23d42f['name'];if(_0x1aed85===0x191){_0x1aed85=0x190;}_0x2937d8[_0x780c('0x1d')](_0x1aed85)[_0x780c('0x2c')](_0x183f94[_0x780c('0x36')][_0x780c('0x7a')]?{'message':_0x780c('0x7b'),'statusCode':_0x23d42f[_0x780c('0x77')]}:_0x23d42f);});}else{var _0x28c817=0x1f4;_0x2937d8[_0x780c('0x1d')](_0x28c817)[_0x780c('0x2c')]({'message':_0x780c('0x7b'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x0bdd=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','nolimit','addConfiguration','Subjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','Calls','values','module_fields','remove','includes','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type'];(function(_0x493bed,_0x3d5f9b){var _0x13cfca=function(_0x244d09){while(--_0x244d09){_0x493bed['push'](_0x493bed['shift']());}};_0x13cfca(++_0x3d5f9b);}(_0x0bdd,0x1c0));var _0xd0bd=function(_0x258d86,_0x2ac3f3){_0x258d86=_0x258d86-0x0;var _0x46ff28=_0x0bdd[_0x258d86];return _0x46ff28;};'use strict';var emlformat=require(_0xd0bd('0x0'));var rimraf=require(_0xd0bd('0x1'));var zipdir=require(_0xd0bd('0x2'));var jsonpatch=require(_0xd0bd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd0bd('0x4'));var Mustache=require(_0xd0bd('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd0bd('0x6'));var csv=require(_0xd0bd('0x7'));var ejs=require(_0xd0bd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0bd('0x9'));var squel=require('squel');var crypto=require(_0xd0bd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd0bd('0xb'));var toCsv=require(_0xd0bd('0x7'));var querystring=require(_0xd0bd('0xc'));var Papa=require(_0xd0bd('0xd'));var Redis=require(_0xd0bd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd0bd('0xf'));var as=require(_0xd0bd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0bd('0x11'))(_0xd0bd('0x12'));var utils=require(_0xd0bd('0x13'));var config=require(_0xd0bd('0x14'));var licenseUtil=require(_0xd0bd('0x15'));var db=require(_0xd0bd('0x16'))['db'];var integrations=require(_0xd0bd('0x17'));function respondWithStatusCode(_0x2e05d9,_0x598e80){_0x598e80=_0x598e80||0xcc;return function(_0x2e7fa7){if(_0x2e7fa7){return _0x2e05d9[_0xd0bd('0x18')](_0x598e80);}return _0x2e05d9[_0xd0bd('0x19')](_0x598e80)[_0xd0bd('0x1a')]();};}function respondWithResult(_0x105205,_0x4ee833){_0x4ee833=_0x4ee833||0xc8;return function(_0x222b22){if(_0x222b22){return _0x105205[_0xd0bd('0x19')](_0x4ee833)['json'](_0x222b22);}};}function respondWithFilteredResult(_0x5381c2,_0x124b66){return function(_0x1a1e33){if(_0x1a1e33){var _0x16e47e=typeof _0x124b66[_0xd0bd('0x1b')]===_0xd0bd('0x1c')&&typeof _0x124b66['limit']===_0xd0bd('0x1c');var _0x288a5c=_0x1a1e33[_0xd0bd('0x1d')];var _0x22c953=_0x16e47e?0x0:_0x124b66[_0xd0bd('0x1b')];var _0x17c5e1=_0x16e47e?_0x1a1e33[_0xd0bd('0x1d')]:_0x124b66[_0xd0bd('0x1b')]+_0x124b66[_0xd0bd('0x1e')];var _0x2409fc;if(_0x17c5e1>=_0x288a5c){_0x17c5e1=_0x288a5c;_0x2409fc=0xc8;}else{_0x2409fc=0xce;}_0x5381c2[_0xd0bd('0x19')](_0x2409fc);return _0x5381c2[_0xd0bd('0x1f')]('Content-Range',_0x22c953+'-'+_0x17c5e1+'/'+_0x288a5c)[_0xd0bd('0x20')](_0x1a1e33);}return null;};}function patchUpdates(_0x39c77b){return function(_0x58921b){try{jsonpatch[_0xd0bd('0x21')](_0x58921b,_0x39c77b,!![]);}catch(_0xd8f9a7){return BPromise[_0xd0bd('0x22')](_0xd8f9a7);}return _0x58921b[_0xd0bd('0x23')]();};}function saveUpdates(_0x4f0be3,_0x1eb0da){return function(_0x31b25d){if(_0x31b25d){return _0x31b25d[_0xd0bd('0x24')](_0x4f0be3)['then'](function(_0x41fde9){return _0x41fde9;});}return null;};}function removeEntity(_0x146b53,_0x51dcda){return function(_0x59d7bb){if(_0x59d7bb){return _0x59d7bb[_0xd0bd('0x25')]()[_0xd0bd('0x26')](function(){_0x146b53['status'](0xcc)[_0xd0bd('0x1a')]();});}};}function handleEntityNotFound(_0x412d5e,_0x124ef8){return function(_0xc8a753){if(!_0xc8a753){_0x412d5e[_0xd0bd('0x18')](0x194);}return _0xc8a753;};}function handleError(_0x1e6238,_0x29ff53){_0x29ff53=_0x29ff53||0x1f4;return function(_0x3048d2){logger[_0xd0bd('0x27')](_0x3048d2[_0xd0bd('0x28')]);if(_0x3048d2[_0xd0bd('0x29')]){delete _0x3048d2['name'];}_0x1e6238[_0xd0bd('0x19')](_0x29ff53)[_0xd0bd('0x2a')](_0x3048d2);};}exports[_0xd0bd('0x2b')]=function(_0x1e43de,_0x2d165e){var _0x1ea846={},_0x4cccf6={},_0x302cdf={'count':0x0,'rows':[]};var _0x298256=_[_0xd0bd('0x2c')](db[_0xd0bd('0x2d')]['rawAttributes'],function(_0x429fbc){return{'name':_0x429fbc[_0xd0bd('0x2e')],'type':_0x429fbc[_0xd0bd('0x2f')][_0xd0bd('0x30')]};});_0x4cccf6[_0xd0bd('0x31')]=_[_0xd0bd('0x2c')](_0x298256,_0xd0bd('0x29'));_0x4cccf6[_0xd0bd('0x32')]=_[_0xd0bd('0x33')](_0x1e43de['query']);_0x4cccf6[_0xd0bd('0x34')]=_[_0xd0bd('0x35')](_0x4cccf6[_0xd0bd('0x31')],_0x4cccf6[_0xd0bd('0x32')]);_0x1ea846[_0xd0bd('0x36')]=_[_0xd0bd('0x35')](_0x4cccf6[_0xd0bd('0x31')],qs[_0xd0bd('0x37')](_0x1e43de[_0xd0bd('0x32')][_0xd0bd('0x37')]));_0x1ea846[_0xd0bd('0x36')]=_0x1ea846[_0xd0bd('0x36')][_0xd0bd('0x38')]?_0x1ea846[_0xd0bd('0x36')]:_0x4cccf6[_0xd0bd('0x31')];if(!_0x1e43de['query'][_0xd0bd('0x39')]('nolimit')){_0x1ea846[_0xd0bd('0x1e')]=qs['limit'](_0x1e43de['query'][_0xd0bd('0x1e')]);_0x1ea846[_0xd0bd('0x1b')]=qs[_0xd0bd('0x1b')](_0x1e43de['query'][_0xd0bd('0x1b')]);}_0x1ea846[_0xd0bd('0x3a')]=qs[_0xd0bd('0x3b')](_0x1e43de['query'][_0xd0bd('0x3b')]);_0x1ea846[_0xd0bd('0x3c')]=qs[_0xd0bd('0x34')](_[_0xd0bd('0x3d')](_0x1e43de['query'],_0x4cccf6[_0xd0bd('0x34')]),_0x298256);if(_0x1e43de[_0xd0bd('0x32')]['filter']){_0x1ea846[_0xd0bd('0x3c')]=_['merge'](_0x1ea846[_0xd0bd('0x3c')],{'$or':_['map'](_0x298256,function(_0x3d0e51){if(_0x3d0e51[_0xd0bd('0x2f')]!==_0xd0bd('0x3e')){var _0x25b604={};_0x25b604[_0x3d0e51[_0xd0bd('0x29')]]={'$like':'%'+_0x1e43de[_0xd0bd('0x32')][_0xd0bd('0x3f')]+'%'};return _0x25b604;}})});}_0x1ea846=_[_0xd0bd('0x40')]({},_0x1ea846,_0x1e43de[_0xd0bd('0x41')]);var _0x134cf1={'where':_0x1ea846[_0xd0bd('0x3c')]};return db[_0xd0bd('0x2d')][_0xd0bd('0x1d')](_0x134cf1)[_0xd0bd('0x26')](function(_0x287802){_0x302cdf[_0xd0bd('0x1d')]=_0x287802;if(_0x1e43de[_0xd0bd('0x32')][_0xd0bd('0x42')]){_0x1ea846[_0xd0bd('0x43')]=[{'all':!![]}];}return db[_0xd0bd('0x2d')][_0xd0bd('0x44')](_0x1ea846);})[_0xd0bd('0x26')](function(_0x59e758){_0x302cdf[_0xd0bd('0x45')]=_0x59e758;return _0x302cdf;})[_0xd0bd('0x26')](respondWithFilteredResult(_0x2d165e,_0x1ea846))['catch'](handleError(_0x2d165e,null));};exports[_0xd0bd('0x46')]=function(_0x2e63c4,_0x3d39a3){var _0x44e6fc={'raw':![],'where':{'id':_0x2e63c4['params']['id']}},_0x30a803={};_0x30a803[_0xd0bd('0x31')]=_[_0xd0bd('0x33')](db[_0xd0bd('0x2d')][_0xd0bd('0x47')]);_0x30a803['query']=_[_0xd0bd('0x33')](_0x2e63c4[_0xd0bd('0x32')]);_0x30a803[_0xd0bd('0x34')]=_[_0xd0bd('0x35')](_0x30a803[_0xd0bd('0x31')],_0x30a803[_0xd0bd('0x32')]);_0x44e6fc['attributes']=_[_0xd0bd('0x35')](_0x30a803['model'],qs[_0xd0bd('0x37')](_0x2e63c4['query'][_0xd0bd('0x37')]));_0x44e6fc[_0xd0bd('0x36')]=_0x44e6fc['attributes'][_0xd0bd('0x38')]?_0x44e6fc[_0xd0bd('0x36')]:_0x30a803['model'];if(_0x2e63c4[_0xd0bd('0x32')][_0xd0bd('0x42')]){_0x44e6fc[_0xd0bd('0x43')]=[{'all':!![]}];}_0x44e6fc=_[_0xd0bd('0x40')]({},_0x44e6fc,_0x2e63c4[_0xd0bd('0x41')]);return db[_0xd0bd('0x2d')][_0xd0bd('0x48')](_0x44e6fc)[_0xd0bd('0x26')](handleEntityNotFound(_0x3d39a3,null))[_0xd0bd('0x26')](respondWithResult(_0x3d39a3,null))[_0xd0bd('0x49')](handleError(_0x3d39a3,null));};exports[_0xd0bd('0x4a')]=function(_0x43d409,_0x22c077){return db[_0xd0bd('0x2d')][_0xd0bd('0x4a')](_0x43d409[_0xd0bd('0x4b')],{})[_0xd0bd('0x26')](respondWithResult(_0x22c077,0xc9))[_0xd0bd('0x49')](handleError(_0x22c077,null));};exports[_0xd0bd('0x24')]=function(_0x266e48,_0x42340b){if(_0x266e48[_0xd0bd('0x4b')]['id']){delete _0x266e48[_0xd0bd('0x4b')]['id'];}return db[_0xd0bd('0x2d')]['find']({'where':{'id':_0x266e48['params']['id']}})[_0xd0bd('0x26')](handleEntityNotFound(_0x42340b,null))[_0xd0bd('0x26')](saveUpdates(_0x266e48[_0xd0bd('0x4b')],null))['then'](respondWithResult(_0x42340b,null))[_0xd0bd('0x49')](handleError(_0x42340b,null));};exports[_0xd0bd('0x25')]=function(_0x340214,_0x465c29){return db[_0xd0bd('0x2d')]['find']({'where':{'id':_0x340214[_0xd0bd('0x4c')]['id']}})[_0xd0bd('0x26')](handleEntityNotFound(_0x465c29,null))['then'](removeEntity(_0x465c29,null))[_0xd0bd('0x49')](handleError(_0x465c29,null));};exports[_0xd0bd('0x4d')]=function(_0x55f4e5,_0x4bbb4c,_0x155683){var _0x31cd17={};var _0x431de4={};var _0x11b3b2;var _0x48290a;return db[_0xd0bd('0x2d')][_0xd0bd('0x4e')]({'where':{'id':_0x55f4e5['params']['id']}})['then'](handleEntityNotFound(_0x4bbb4c,null))[_0xd0bd('0x26')](function(_0x13a2d0){if(_0x13a2d0){_0x11b3b2=_0x13a2d0;_0x431de4[_0xd0bd('0x31')]=_[_0xd0bd('0x33')](db[_0xd0bd('0x4f')]['rawAttributes']);_0x431de4['query']=_[_0xd0bd('0x33')](_0x55f4e5[_0xd0bd('0x32')]);_0x431de4[_0xd0bd('0x34')]=_[_0xd0bd('0x35')](_0x431de4[_0xd0bd('0x31')],_0x431de4[_0xd0bd('0x32')]);_0x31cd17['attributes']=_['intersection'](_0x431de4[_0xd0bd('0x31')],qs[_0xd0bd('0x37')](_0x55f4e5[_0xd0bd('0x32')]['fields']));_0x31cd17[_0xd0bd('0x36')]=_0x31cd17[_0xd0bd('0x36')][_0xd0bd('0x38')]?_0x31cd17[_0xd0bd('0x36')]:_0x431de4[_0xd0bd('0x31')];_0x31cd17[_0xd0bd('0x3a')]=qs[_0xd0bd('0x3b')](_0x55f4e5[_0xd0bd('0x32')]['sort']);_0x31cd17['where']=qs['filters'](_[_0xd0bd('0x3d')](_0x55f4e5['query'],_0x431de4['filters']));if(_0x55f4e5['query'][_0xd0bd('0x3f')]){_0x31cd17[_0xd0bd('0x3c')]=_[_0xd0bd('0x40')](_0x31cd17[_0xd0bd('0x3c')],{'$or':_[_0xd0bd('0x2c')](_0x31cd17['attributes'],function(_0x5240a6){var _0x4e032c={};_0x4e032c[_0x5240a6]={'$like':'%'+_0x55f4e5[_0xd0bd('0x32')][_0xd0bd('0x3f')]+'%'};return _0x4e032c;})});}_0x31cd17=_['merge']({},_0x31cd17,_0x55f4e5[_0xd0bd('0x41')]);return _0x11b3b2[_0xd0bd('0x4d')](_0x31cd17);}})[_0xd0bd('0x26')](function(_0x510eaf){if(_0x510eaf){_0x48290a=_0x510eaf['length'];if(!_0x55f4e5[_0xd0bd('0x32')][_0xd0bd('0x39')](_0xd0bd('0x50'))){_0x31cd17[_0xd0bd('0x1e')]=qs[_0xd0bd('0x1e')](_0x55f4e5[_0xd0bd('0x32')][_0xd0bd('0x1e')]);_0x31cd17['offset']=qs[_0xd0bd('0x1b')](_0x55f4e5[_0xd0bd('0x32')][_0xd0bd('0x1b')]);}return _0x11b3b2[_0xd0bd('0x4d')](_0x31cd17);}})[_0xd0bd('0x26')](function(_0x298045){if(_0x298045){return _0x298045?{'count':_0x48290a,'rows':_0x298045}:null;}})[_0xd0bd('0x26')](respondWithResult(_0x4bbb4c,null))[_0xd0bd('0x49')](handleError(_0x4bbb4c,null));};exports[_0xd0bd('0x51')]=function(_0x258bbc,_0x430f40,_0x22a981){if(_0x258bbc['body']['id']){delete _0x258bbc[_0xd0bd('0x4b')]['id'];}return db['SugarcrmAccount'][_0xd0bd('0x4e')]({'where':{'id':_0x258bbc[_0xd0bd('0x4c')]['id']}})[_0xd0bd('0x26')](handleEntityNotFound(_0x430f40,null))[_0xd0bd('0x26')](function(_0x1ef22f){if(_0x1ef22f){_0x258bbc[_0xd0bd('0x4b')]['AccountId']=_0x1ef22f['id'];_0x258bbc[_0xd0bd('0x4b')][_0xd0bd('0x52')]=integrations['getSubjects'](_0x258bbc['body'][_0xd0bd('0x53')],_0x258bbc[_0xd0bd('0x4b')][_0xd0bd('0x2f')]);_0x258bbc[_0xd0bd('0x4b')]['Descriptions']=integrations[_0xd0bd('0x54')](_0x258bbc[_0xd0bd('0x4b')]['channel'],_0x258bbc[_0xd0bd('0x4b')]['type']);return db[_0xd0bd('0x4f')][_0xd0bd('0x4a')](_0x258bbc[_0xd0bd('0x4b')],{'include':[{'model':db[_0xd0bd('0x55')],'as':_0xd0bd('0x52')},{'model':db['SugarcrmField'],'as':_0xd0bd('0x56')}]});}return null;})[_0xd0bd('0x26')](respondWithResult(_0x430f40,null))[_0xd0bd('0x49')](handleError(_0x430f40,null));};exports[_0xd0bd('0x57')]=function(_0x131810,_0x1a3d8f,_0x2c32c9){var _0x406650='';var _0x19bae8=['id',_0xd0bd('0x29'),_0xd0bd('0x58'),_0xd0bd('0x59'),_0xd0bd('0x5a'),_0xd0bd('0x5b'),_0xd0bd('0x5c'),_0xd0bd('0x5d'),_0xd0bd('0x5e'),'parent_type',_0xd0bd('0x5f'),_0xd0bd('0x60')];return db[_0xd0bd('0x2d')][_0xd0bd('0x4e')]({'where':{'id':_0x131810['params']['id']},'attributes':['id',_0xd0bd('0x61'),_0xd0bd('0x62'),'remoteUri']})['then'](handleEntityNotFound(_0x1a3d8f,null))['then'](function(_0x4345f2){if(_0x4345f2){_0x406650=_0x4345f2[_0xd0bd('0x63')];var _0x48b131=_0x406650['slice'](-0x1);if(_0x48b131==='/'){_0x406650=_0x406650[_0xd0bd('0x64')](0x0,_0x406650[_0xd0bd('0x65')](_0x48b131));}return rp({'method':_0xd0bd('0x66'),'uri':util['format'](_0xd0bd('0x67'),_0x406650,_0xd0bd('0x68')),'json':!![],'form':{'method':_0xd0bd('0x69'),'input_type':_0xd0bd('0x6a'),'response_type':_0xd0bd('0x6a'),'rest_data':JSON[_0xd0bd('0x6b')]({'user_auth':{'user_name':_0x4345f2[_0xd0bd('0x61')],'password':_0x4345f2['password'],'encryption':_0xd0bd('0x6c')},'application':_0xd0bd('0x6d')})}});}})['then'](function(_0x2faacb){if(_0x2faacb&&_0x2faacb['name']!==_0xd0bd('0x6e')&&_0x2faacb[_0xd0bd('0x29')]!==_0xd0bd('0x6f')){return rp({'method':'POST','uri':util[_0xd0bd('0x70')](_0xd0bd('0x67'),_0x406650,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0xd0bd('0x6a'),'rest_data':JSON[_0xd0bd('0x6b')]({'session':_0x2faacb['id'],'module_name':_0xd0bd('0x71')})}})[_0xd0bd('0x26')](function(_0x44c607){if(_0x44c607){var _0x40d9a9=_[_0xd0bd('0x72')](_0x44c607[_0xd0bd('0x73')]);_[_0xd0bd('0x74')](_0x40d9a9,function(_0x4bf292){return _0x19bae8[_0xd0bd('0x75')](_0x4bf292[_0xd0bd('0x29')]);});return{'count':_0x40d9a9['length'],'rows':_['map'](_0x40d9a9,function(_0x1c11f9){return{'id':_0x1c11f9[_0xd0bd('0x29')],'name':_0x1c11f9['label'],'custom':_[_0xd0bd('0x76')](_0x1c11f9[_0xd0bd('0x29')],'_c')?!![]:![],'options':_0x1c11f9['options']?_[_0xd0bd('0x2c')](_[_0xd0bd('0x72')](_0x1c11f9[_0xd0bd('0x41')]),function(_0x50e054){return{'name':_0x50e054[_0xd0bd('0x77')],'value':_0x50e054['name']};}):[]};})};}})['then'](respondWithResult(_0x1a3d8f,null))[_0xd0bd('0x49')](function(_0x4c80f7){var _0x2a92d8=_0x131810['query'][_0xd0bd('0x78')]?0x1f4:_0x4c80f7['statusCode']||0x1f4;logger[_0xd0bd('0x27')](_0xd0bd('0x79'),_0xd0bd('0x57'),_0x2a92d8,JSON[_0xd0bd('0x6b')](_0x4c80f7));delete _0x4c80f7[_0xd0bd('0x29')];if(_0x2a92d8===0x191){_0x2a92d8=0x190;}_0x1a3d8f[_0xd0bd('0x19')](_0x2a92d8)[_0xd0bd('0x2a')](_0x131810[_0xd0bd('0x32')][_0xd0bd('0x78')]?{'message':_0xd0bd('0x7a'),'statusCode':_0x4c80f7[_0xd0bd('0x7b')]}:_0x4c80f7);});}else{var _0x16e071=0x1f4;_0x1a3d8f[_0xd0bd('0x19')](_0x16e071)[_0xd0bd('0x2a')]({'message':_0xd0bd('0x7a'),'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 092b42c..014a49a 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 _0x439f=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts','lodash','../../config/logger','api','request-promise','path'];(function(_0x3ecf0c,_0x5044a3){var _0x1a682b=function(_0x97c1e4){while(--_0x97c1e4){_0x3ecf0c['push'](_0x3ecf0c['shift']());}};_0x1a682b(++_0x5044a3);}(_0x439f,0x1c3));var _0xf439=function(_0x1b8b95,_0x3ea343){_0x1b8b95=_0x1b8b95-0x0;var _0x3657ae=_0x439f[_0x1b8b95];return _0x3657ae;};'use strict';var _=require(_0xf439('0x0'));var util=require('util');var logger=require(_0xf439('0x1'))(_0xf439('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf439('0x3'));var fs=require('fs');var path=require(_0xf439('0x4'));var rimraf=require(_0xf439('0x5'));var config=require(_0xf439('0x6'));var attributes=require(_0xf439('0x7'));var integrations=require(_0xf439('0x8'));module[_0xf439('0x9')]=function(_0x1723b8,_0x395ccc){return _0x1723b8[_0xf439('0xa')]('SugarcrmAccount',attributes,{'tableName':_0xf439('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe798=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xe798,0xe4));var _0x8e79=function(_0x10c13d,_0x104641){_0x10c13d=_0x10c13d-0x0;var _0x25002b=_0xe798[_0x10c13d];return _0x25002b;};'use strict';var _=require(_0x8e79('0x0'));var util=require(_0x8e79('0x1'));var logger=require(_0x8e79('0x2'))('api');var moment=require(_0x8e79('0x3'));var BPromise=require(_0x8e79('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e79('0x5'));var rimraf=require(_0x8e79('0x6'));var config=require(_0x8e79('0x7'));var attributes=require(_0x8e79('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8e79('0x9')]=function(_0x5a7a26,_0x1ea4f2){return _0x5a7a26[_0x8e79('0xa')](_0x8e79('0xb'),attributes,{'tableName':_0x8e79('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 2f91baf..69f8ff0 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 _0x5556=['then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SugarcrmAccount','options','where','attributes','limit','include','map','model','debug','GetSugarcrmAccount','find','raw','ShowSugarcrmAccount','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x5556,0xa0));var _0x6555=function(_0x590114,_0x2ca735){_0x590114=_0x590114-0x0;var _0x149e50=_0x5556[_0x590114];return _0x149e50;};'use strict';var _=require('lodash');var util=require(_0x6555('0x0'));var moment=require(_0x6555('0x1'));var BPromise=require('bluebird');var rs=require(_0x6555('0x2'));var fs=require('fs');var Redis=require(_0x6555('0x3'));var db=require(_0x6555('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6555('0x5'))(_0x6555('0x6'));var config=require('../../config/environment');var jayson=require(_0x6555('0x7'));var client=jayson['client'][_0x6555('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x128096,_0x589201,_0x324ebb){return new BPromise(function(_0x32c017,_0x13fb92){return client[_0x6555('0x9')](_0x128096,_0x324ebb)[_0x6555('0xa')](function(_0x5ac2a4){logger[_0x6555('0xb')](_0x6555('0xc'),_0x589201,_0x6555('0xd'));logger['debug'](_0x6555('0xe'),_0x589201,_0x6555('0xd'),JSON[_0x6555('0xf')](_0x5ac2a4));if(_0x5ac2a4[_0x6555('0x10')]){if(_0x5ac2a4['error'][_0x6555('0x11')]===0x1f4){logger[_0x6555('0x10')](_0x6555('0xc'),_0x589201,_0x5ac2a4[_0x6555('0x10')][_0x6555('0x12')]);return _0x13fb92(_0x5ac2a4[_0x6555('0x10')][_0x6555('0x12')]);}logger[_0x6555('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x589201,_0x5ac2a4[_0x6555('0x10')][_0x6555('0x12')]);return _0x32c017(_0x5ac2a4['error']['message']);}else{logger['info'](_0x6555('0xc'),_0x589201,'request\x20sent');_0x32c017(_0x5ac2a4[_0x6555('0x13')][_0x6555('0x12')]);}})[_0x6555('0x14')](function(_0x4c5dd6){logger[_0x6555('0x10')](_0x6555('0xc'),_0x589201,_0x4c5dd6);_0x13fb92(_0x4c5dd6);});});}exports['GetSugarcrmAccount']=function(_0x1fbabf){var _0xbbe176=this;return new Promise(function(_0x53bf6e,_0x46fa6b){return db[_0x6555('0x15')]['findAll']({'raw':_0x1fbabf[_0x6555('0x16')]?_0x1fbabf[_0x6555('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1fbabf[_0x6555('0x16')]?_0x1fbabf[_0x6555('0x16')][_0x6555('0x17')]||null:null,'attributes':_0x1fbabf[_0x6555('0x16')]?_0x1fbabf[_0x6555('0x16')][_0x6555('0x18')]||null:null,'limit':_0x1fbabf[_0x6555('0x16')]?_0x1fbabf[_0x6555('0x16')][_0x6555('0x19')]||null:null,'include':_0x1fbabf[_0x6555('0x16')]?_0x1fbabf[_0x6555('0x16')][_0x6555('0x1a')]?_[_0x6555('0x1b')](_0x1fbabf[_0x6555('0x16')]['include'],function(_0x56cba5){return{'model':db[_0x56cba5[_0x6555('0x1c')]],'as':_0x56cba5['as'],'attributes':_0x56cba5[_0x6555('0x18')],'include':_0x56cba5['include']?_[_0x6555('0x1b')](_0x56cba5['include'],function(_0x59c06f){return{'model':db[_0x59c06f[_0x6555('0x1c')]],'as':_0x59c06f['as'],'attributes':_0x59c06f[_0x6555('0x18')],'include':_0x59c06f[_0x6555('0x1a')]?_[_0x6555('0x1b')](_0x59c06f[_0x6555('0x1a')],function(_0x5d9e42){return{'model':db[_0x5d9e42['model']],'as':_0x5d9e42['as'],'attributes':_0x5d9e42[_0x6555('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a177f){logger[_0x6555('0xb')]('GetSugarcrmAccount',_0x1fbabf);logger[_0x6555('0x1d')](_0x6555('0x1e'),_0x1fbabf,JSON[_0x6555('0xf')](_0x4a177f));_0x53bf6e(_0x4a177f);})['catch'](function(_0x1f5a45){logger[_0x6555('0x10')](_0x6555('0x1e'),_0x1f5a45['message'],_0x1fbabf);_0x46fa6b(_0xbbe176[_0x6555('0x10')](0x1f4,_0x1f5a45[_0x6555('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x2de2e3){var _0x135c55=this;return new Promise(function(_0x22bbc4,_0x241a03){return db[_0x6555('0x15')][_0x6555('0x1f')]({'raw':_0x2de2e3[_0x6555('0x16')]?_0x2de2e3[_0x6555('0x16')][_0x6555('0x20')]===undefined?!![]:![]:!![],'where':_0x2de2e3['options']?_0x2de2e3[_0x6555('0x16')][_0x6555('0x17')]||null:null,'attributes':_0x2de2e3[_0x6555('0x16')]?_0x2de2e3['options'][_0x6555('0x18')]||null:null,'include':_0x2de2e3[_0x6555('0x16')]?_0x2de2e3['options'][_0x6555('0x1a')]?_[_0x6555('0x1b')](_0x2de2e3[_0x6555('0x16')][_0x6555('0x1a')],function(_0x3f6cbb){return{'model':db[_0x3f6cbb[_0x6555('0x1c')]],'as':_0x3f6cbb['as'],'attributes':_0x3f6cbb[_0x6555('0x18')],'include':_0x3f6cbb[_0x6555('0x1a')]?_['map'](_0x3f6cbb[_0x6555('0x1a')],function(_0x2912d9){return{'model':db[_0x2912d9[_0x6555('0x1c')]],'as':_0x2912d9['as'],'attributes':_0x2912d9[_0x6555('0x18')],'include':_0x2912d9[_0x6555('0x1a')]?_['map'](_0x2912d9[_0x6555('0x1a')],function(_0x36ae61){return{'model':db[_0x36ae61['model']],'as':_0x36ae61['as'],'attributes':_0x36ae61[_0x6555('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6555('0xa')](function(_0x3d8940){logger[_0x6555('0xb')](_0x6555('0x21'),_0x2de2e3);logger[_0x6555('0x1d')](_0x6555('0x21'),_0x2de2e3,JSON[_0x6555('0xf')](_0x3d8940));_0x22bbc4(_0x3d8940);})[_0x6555('0x14')](function(_0x23323d){logger[_0x6555('0x10')](_0x6555('0x21'),_0x23323d['message'],_0x2de2e3);_0x241a03(_0x135c55[_0x6555('0x10')](0x1f4,_0x23323d['message']));});});}; \ No newline at end of file +var _0x4e85=['findAll','options','raw','where','limit','include','map','model','attributes','then','GetSugarcrmAccount','stringify','catch','find','ShowSugarcrmAccount','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','SugarcrmAccount'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0x4e85,0x163));var _0x54e8=function(_0x3ca589,_0x11eff7){_0x3ca589=_0x3ca589-0x0;var _0x7d1b6f=_0x4e85[_0x3ca589];return _0x7d1b6f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x54e8('0x0'));var BPromise=require(_0x54e8('0x1'));var rs=require(_0x54e8('0x2'));var fs=require('fs');var Redis=require(_0x54e8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x54e8('0x4'));var logger=require('../../config/logger')(_0x54e8('0x5'));var config=require(_0x54e8('0x6'));var jayson=require(_0x54e8('0x7'));var client=jayson[_0x54e8('0x8')][_0x54e8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3843ac,_0x3d5ef4,_0x5e2ac8){return new BPromise(function(_0x188725,_0x446602){return client[_0x54e8('0xa')](_0x3843ac,_0x5e2ac8)['then'](function(_0x4a05a4){logger[_0x54e8('0xb')](_0x54e8('0xc'),_0x3d5ef4,_0x54e8('0xd'));logger[_0x54e8('0xe')](_0x54e8('0xf'),_0x3d5ef4,'request\x20sent',JSON['stringify'](_0x4a05a4));if(_0x4a05a4['error']){if(_0x4a05a4[_0x54e8('0x10')]['code']===0x1f4){logger[_0x54e8('0x10')](_0x54e8('0xc'),_0x3d5ef4,_0x4a05a4['error'][_0x54e8('0x11')]);return _0x446602(_0x4a05a4[_0x54e8('0x10')]['message']);}logger['error'](_0x54e8('0xc'),_0x3d5ef4,_0x4a05a4[_0x54e8('0x10')][_0x54e8('0x11')]);return _0x188725(_0x4a05a4[_0x54e8('0x10')]['message']);}else{logger[_0x54e8('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x3d5ef4,_0x54e8('0xd'));_0x188725(_0x4a05a4['result'][_0x54e8('0x11')]);}})['catch'](function(_0x438143){logger[_0x54e8('0x10')](_0x54e8('0xc'),_0x3d5ef4,_0x438143);_0x446602(_0x438143);});});}exports['GetSugarcrmAccount']=function(_0x334208){var _0x59e528=this;return new Promise(function(_0x4327ff,_0x4b17db){return db[_0x54e8('0x12')][_0x54e8('0x13')]({'raw':_0x334208[_0x54e8('0x14')]?_0x334208['options'][_0x54e8('0x15')]===undefined?!![]:![]:!![],'where':_0x334208[_0x54e8('0x14')]?_0x334208[_0x54e8('0x14')][_0x54e8('0x16')]||null:null,'attributes':_0x334208[_0x54e8('0x14')]?_0x334208[_0x54e8('0x14')]['attributes']||null:null,'limit':_0x334208[_0x54e8('0x14')]?_0x334208[_0x54e8('0x14')][_0x54e8('0x17')]||null:null,'include':_0x334208[_0x54e8('0x14')]?_0x334208[_0x54e8('0x14')][_0x54e8('0x18')]?_[_0x54e8('0x19')](_0x334208['options']['include'],function(_0x383efe){return{'model':db[_0x383efe[_0x54e8('0x1a')]],'as':_0x383efe['as'],'attributes':_0x383efe[_0x54e8('0x1b')],'include':_0x383efe[_0x54e8('0x18')]?_[_0x54e8('0x19')](_0x383efe[_0x54e8('0x18')],function(_0x3bbfc6){return{'model':db[_0x3bbfc6[_0x54e8('0x1a')]],'as':_0x3bbfc6['as'],'attributes':_0x3bbfc6[_0x54e8('0x1b')],'include':_0x3bbfc6[_0x54e8('0x18')]?_['map'](_0x3bbfc6[_0x54e8('0x18')],function(_0x35e447){return{'model':db[_0x35e447[_0x54e8('0x1a')]],'as':_0x35e447['as'],'attributes':_0x35e447[_0x54e8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x54e8('0x1c')](function(_0x2b982b){logger['info'](_0x54e8('0x1d'),_0x334208);logger['debug'](_0x54e8('0x1d'),_0x334208,JSON[_0x54e8('0x1e')](_0x2b982b));_0x4327ff(_0x2b982b);})[_0x54e8('0x1f')](function(_0x3ffe07){logger[_0x54e8('0x10')](_0x54e8('0x1d'),_0x3ffe07[_0x54e8('0x11')],_0x334208);_0x4b17db(_0x59e528['error'](0x1f4,_0x3ffe07[_0x54e8('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x40a703){var _0x257580=this;return new Promise(function(_0x4ee048,_0x2c5040){return db[_0x54e8('0x12')][_0x54e8('0x20')]({'raw':_0x40a703[_0x54e8('0x14')]?_0x40a703[_0x54e8('0x14')][_0x54e8('0x15')]===undefined?!![]:![]:!![],'where':_0x40a703[_0x54e8('0x14')]?_0x40a703[_0x54e8('0x14')][_0x54e8('0x16')]||null:null,'attributes':_0x40a703['options']?_0x40a703['options'][_0x54e8('0x1b')]||null:null,'include':_0x40a703[_0x54e8('0x14')]?_0x40a703[_0x54e8('0x14')][_0x54e8('0x18')]?_['map'](_0x40a703['options'][_0x54e8('0x18')],function(_0x2cb3cd){return{'model':db[_0x2cb3cd['model']],'as':_0x2cb3cd['as'],'attributes':_0x2cb3cd['attributes'],'include':_0x2cb3cd[_0x54e8('0x18')]?_['map'](_0x2cb3cd[_0x54e8('0x18')],function(_0x22bbad){return{'model':db[_0x22bbad['model']],'as':_0x22bbad['as'],'attributes':_0x22bbad[_0x54e8('0x1b')],'include':_0x22bbad['include']?_[_0x54e8('0x19')](_0x22bbad['include'],function(_0x373dcf){return{'model':db[_0x373dcf[_0x54e8('0x1a')]],'as':_0x373dcf['as'],'attributes':_0x373dcf[_0x54e8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x54e8('0x1c')](function(_0x4b90be){logger['info']('ShowSugarcrmAccount',_0x40a703);logger['debug'](_0x54e8('0x21'),_0x40a703,JSON['stringify'](_0x4b90be));_0x4ee048(_0x4b90be);})[_0x54e8('0x1f')](function(_0x1e9c79){logger['error'](_0x54e8('0x21'),_0x1e9c79['message'],_0x40a703);_0x2c5040(_0x257580['error'](0x1f4,_0x1e9c79[_0x54e8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 4487e5d..f0d673f 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 _0x0348=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','delete','exports'];(function(_0xd858be,_0x667c24){var _0xbc74b3=function(_0x4a6e21){while(--_0x4a6e21){_0xd858be['push'](_0xd858be['shift']());}};_0xbc74b3(++_0x667c24);}(_0x0348,0x96));var _0x8034=function(_0x389f40,_0x13c234){_0x389f40=_0x389f40-0x0;var _0x41a331=_0x0348[_0x389f40];return _0x41a331;};'use strict';var multer=require(_0x8034('0x0'));var util=require(_0x8034('0x1'));var path=require(_0x8034('0x2'));var timeout=require(_0x8034('0x3'));var express=require(_0x8034('0x4'));var router=express[_0x8034('0x5')]();var fs_extra=require(_0x8034('0x6'));var auth=require(_0x8034('0x7'));var interaction=require(_0x8034('0x8'));var config=require(_0x8034('0x9'));var controller=require(_0x8034('0xa'));router[_0x8034('0xb')]('/',auth[_0x8034('0xc')](),controller[_0x8034('0xd')]);router[_0x8034('0xb')](_0x8034('0xe'),auth[_0x8034('0xc')](),controller[_0x8034('0xf')]);router['get'](_0x8034('0x10'),auth[_0x8034('0xc')](),controller[_0x8034('0x11')]);router['get']('/:id/subjects',auth[_0x8034('0xc')](),controller[_0x8034('0x12')]);router[_0x8034('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x8034('0x13')]);router[_0x8034('0x14')]('/',auth[_0x8034('0xc')](),controller[_0x8034('0x15')]);router[_0x8034('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8034('0x17')](_0x8034('0xe'),auth[_0x8034('0xc')](),controller['destroy']);module[_0x8034('0x18')]=router; \ No newline at end of file +var _0xfce4=['./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','update','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1f93ec,_0x2c47d8){var _0x5bc375=function(_0x522ace){while(--_0x522ace){_0x1f93ec['push'](_0x1f93ec['shift']());}};_0x5bc375(++_0x2c47d8);}(_0xfce4,0xbf));var _0x4fce=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0xfce4[_0x1d930e];return _0x5bbd66;};'use strict';var multer=require(_0x4fce('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4fce('0x1'));var express=require('express');var router=express[_0x4fce('0x2')]();var fs_extra=require(_0x4fce('0x3'));var auth=require(_0x4fce('0x4'));var interaction=require(_0x4fce('0x5'));var config=require(_0x4fce('0x6'));var controller=require(_0x4fce('0x7'));router['get']('/',auth[_0x4fce('0x8')](),controller[_0x4fce('0x9')]);router[_0x4fce('0xa')](_0x4fce('0xb'),auth[_0x4fce('0x8')](),controller[_0x4fce('0xc')]);router[_0x4fce('0xa')](_0x4fce('0xd'),auth[_0x4fce('0x8')](),controller[_0x4fce('0xe')]);router[_0x4fce('0xa')]('/:id/subjects',auth[_0x4fce('0x8')](),controller[_0x4fce('0xf')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x4fce('0x10')]);router[_0x4fce('0x11')]('/',auth[_0x4fce('0x8')](),controller[_0x4fce('0x12')]);router[_0x4fce('0x13')](_0x4fce('0xb'),auth[_0x4fce('0x8')](),controller[_0x4fce('0x14')]);router['delete'](_0x4fce('0xb'),auth[_0x4fce('0x8')](),controller['destroy']);module[_0x4fce('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 77a4d51..afa8623 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 _0x69b7=['sequelize','exports','STRING'];(function(_0x31bd4c,_0x240661){var _0x19f18f=function(_0x52413d){while(--_0x52413d){_0x31bd4c['push'](_0x31bd4c['shift']());}};_0x19f18f(++_0x240661);}(_0x69b7,0x138));var _0x769b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x69b7[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x769b('0x0'));module[_0x769b('0x1')]={'name':{'type':Sequelize[_0x769b('0x2')]},'description':{'type':Sequelize[_0x769b('0x2')]}}; \ No newline at end of file +var _0xe893=['STRING','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe893,0x1c0));var _0x3e89=function(_0x747391,_0x1244cd){_0x747391=_0x747391-0x0;var _0x5ea224=_0xe893[_0x747391];return _0x5ea224;};'use strict';var Sequelize=require(_0x3e89('0x0'));module[_0x3e89('0x1')]={'name':{'type':Sequelize[_0x3e89('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 8374de7..ab2d54f 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 _0x0275=['zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','SugarcrmField','getFields','getSubjects','pick','getDescriptions','findOne','eml-format'];(function(_0x255e76,_0x4e52d5){var _0x21e01e=function(_0x595aaf){while(--_0x595aaf){_0x255e76['push'](_0x255e76['shift']());}};_0x21e01e(++_0x4e52d5);}(_0x0275,0x17b));var _0x5027=function(_0x4bc598,_0x2cab89){_0x4bc598=_0x4bc598-0x0;var _0x1fc7d4=_0x0275[_0x4bc598];return _0x1fc7d4;};'use strict';var emlformat=require(_0x5027('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5027('0x1'));var jsonpatch=require(_0x5027('0x2'));var rp=require(_0x5027('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5027('0x4'));var util=require('util');var path=require(_0x5027('0x5'));var sox=require(_0x5027('0x6'));var csv=require(_0x5027('0x7'));var ejs=require(_0x5027('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5027('0x9'));var squel=require('squel');var crypto=require(_0x5027('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5027('0x7'));var querystring=require(_0x5027('0xb'));var Papa=require(_0x5027('0xc'));var Redis=require('ioredis');var authService=require(_0x5027('0xd'));var qs=require(_0x5027('0xe'));var as=require(_0x5027('0xf'));var hardwareService=require(_0x5027('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x5027('0x11'));var config=require(_0x5027('0x12'));var licenseUtil=require(_0x5027('0x13'));var db=require(_0x5027('0x14'))['db'];function respondWithStatusCode(_0x7c11b8,_0x292dda){_0x292dda=_0x292dda||0xcc;return function(_0x5cb40d){if(_0x5cb40d){return _0x7c11b8['sendStatus'](_0x292dda);}return _0x7c11b8[_0x5027('0x15')](_0x292dda)[_0x5027('0x16')]();};}function respondWithResult(_0x323886,_0x2cfb97){_0x2cfb97=_0x2cfb97||0xc8;return function(_0x3f333e){if(_0x3f333e){return _0x323886['status'](_0x2cfb97)['json'](_0x3f333e);}};}function respondWithFilteredResult(_0xfe954e,_0x52aa6d){return function(_0x1d4afd){if(_0x1d4afd){var _0x1dcf59=typeof _0x52aa6d[_0x5027('0x17')]===_0x5027('0x18')&&typeof _0x52aa6d['limit']===_0x5027('0x18');var _0x468c93=_0x1d4afd['count'];var _0x33df3f=_0x1dcf59?0x0:_0x52aa6d[_0x5027('0x17')];var _0x297659=_0x1dcf59?_0x1d4afd[_0x5027('0x19')]:_0x52aa6d[_0x5027('0x17')]+_0x52aa6d[_0x5027('0x1a')];var _0x305c99;if(_0x297659>=_0x468c93){_0x297659=_0x468c93;_0x305c99=0xc8;}else{_0x305c99=0xce;}_0xfe954e[_0x5027('0x15')](_0x305c99);return _0xfe954e[_0x5027('0x1b')](_0x5027('0x1c'),_0x33df3f+'-'+_0x297659+'/'+_0x468c93)['json'](_0x1d4afd);}return null;};}function patchUpdates(_0x3c1290){return function(_0x5c1594){try{jsonpatch[_0x5027('0x1d')](_0x5c1594,_0x3c1290,!![]);}catch(_0x4a64fe){return BPromise['reject'](_0x4a64fe);}return _0x5c1594[_0x5027('0x1e')]();};}function saveUpdates(_0x13f5fa,_0x4628b2){return function(_0x61037){if(_0x61037){return _0x61037[_0x5027('0x1f')](_0x13f5fa)[_0x5027('0x20')](function(_0x604350){return _0x604350;});}return null;};}function removeEntity(_0x245048,_0x119348){return function(_0x4cbe27){if(_0x4cbe27){return _0x4cbe27[_0x5027('0x21')]()['then'](function(){_0x245048[_0x5027('0x15')](0xcc)[_0x5027('0x16')]();});}};}function handleEntityNotFound(_0x5d09ef,_0x312cb0){return function(_0x1cfc30){if(!_0x1cfc30){_0x5d09ef[_0x5027('0x22')](0x194);}return _0x1cfc30;};}function handleError(_0x50eb10,_0xea16a7){_0xea16a7=_0xea16a7||0x1f4;return function(_0x52e379){logger[_0x5027('0x23')](_0x52e379['stack']);if(_0x52e379['name']){delete _0x52e379[_0x5027('0x24')];}_0x50eb10[_0x5027('0x15')](_0xea16a7)[_0x5027('0x25')](_0x52e379);};}exports[_0x5027('0x26')]=function(_0x5eca30,_0x3b45ee){var _0x4a1ecb={},_0x140965={},_0x5277a7={'count':0x0,'rows':[]};var _0x37d206=_[_0x5027('0x27')](db[_0x5027('0x28')][_0x5027('0x29')],function(_0x27aabc){return{'name':_0x27aabc['fieldName'],'type':_0x27aabc[_0x5027('0x2a')][_0x5027('0x2b')]};});_0x140965[_0x5027('0x2c')]=_[_0x5027('0x27')](_0x37d206,_0x5027('0x24'));_0x140965[_0x5027('0x2d')]=_[_0x5027('0x2e')](_0x5eca30[_0x5027('0x2d')]);_0x140965[_0x5027('0x2f')]=_[_0x5027('0x30')](_0x140965[_0x5027('0x2c')],_0x140965[_0x5027('0x2d')]);_0x4a1ecb[_0x5027('0x31')]=_[_0x5027('0x30')](_0x140965[_0x5027('0x2c')],qs[_0x5027('0x32')](_0x5eca30[_0x5027('0x2d')][_0x5027('0x32')]));_0x4a1ecb['attributes']=_0x4a1ecb[_0x5027('0x31')][_0x5027('0x33')]?_0x4a1ecb[_0x5027('0x31')]:_0x140965[_0x5027('0x2c')];if(!_0x5eca30[_0x5027('0x2d')][_0x5027('0x34')](_0x5027('0x35'))){_0x4a1ecb[_0x5027('0x1a')]=qs['limit'](_0x5eca30[_0x5027('0x2d')]['limit']);_0x4a1ecb[_0x5027('0x17')]=qs['offset'](_0x5eca30['query'][_0x5027('0x17')]);}_0x4a1ecb[_0x5027('0x36')]=qs['sort'](_0x5eca30['query'][_0x5027('0x37')]);_0x4a1ecb[_0x5027('0x38')]=qs[_0x5027('0x2f')](_['pick'](_0x5eca30[_0x5027('0x2d')],_0x140965['filters']),_0x37d206);if(_0x5eca30[_0x5027('0x2d')][_0x5027('0x39')]){_0x4a1ecb[_0x5027('0x38')]=_[_0x5027('0x3a')](_0x4a1ecb[_0x5027('0x38')],{'$or':_['map'](_0x37d206,function(_0x50fe42){if(_0x50fe42[_0x5027('0x2a')]!==_0x5027('0x3b')){var _0xac6741={};_0xac6741[_0x50fe42[_0x5027('0x24')]]={'$like':'%'+_0x5eca30['query'][_0x5027('0x39')]+'%'};return _0xac6741;}})});}_0x4a1ecb=_[_0x5027('0x3a')]({},_0x4a1ecb,_0x5eca30[_0x5027('0x3c')]);var _0x2c4b35={'where':_0x4a1ecb[_0x5027('0x38')]};return db['SugarcrmConfiguration']['count'](_0x2c4b35)[_0x5027('0x20')](function(_0x229851){_0x5277a7[_0x5027('0x19')]=_0x229851;if(_0x5eca30['query'][_0x5027('0x3d')]){_0x4a1ecb[_0x5027('0x3e')]=[{'all':!![]}];}return db[_0x5027('0x28')][_0x5027('0x3f')](_0x4a1ecb);})[_0x5027('0x20')](function(_0x1479d7){_0x5277a7[_0x5027('0x40')]=_0x1479d7;return _0x5277a7;})[_0x5027('0x20')](respondWithFilteredResult(_0x3b45ee,_0x4a1ecb))[_0x5027('0x41')](handleError(_0x3b45ee,null));};exports['show']=function(_0xc37ca4,_0x44c483){var _0x3773b6={'raw':![],'where':{'id':_0xc37ca4[_0x5027('0x42')]['id']}},_0x450445={};_0x450445[_0x5027('0x2c')]=_[_0x5027('0x2e')](db[_0x5027('0x28')][_0x5027('0x29')]);_0x450445[_0x5027('0x2d')]=_['keys'](_0xc37ca4['query']);_0x450445[_0x5027('0x2f')]=_[_0x5027('0x30')](_0x450445[_0x5027('0x2c')],_0x450445[_0x5027('0x2d')]);_0x3773b6[_0x5027('0x31')]=_['intersection'](_0x450445[_0x5027('0x2c')],qs[_0x5027('0x32')](_0xc37ca4[_0x5027('0x2d')]['fields']));_0x3773b6[_0x5027('0x31')]=_0x3773b6[_0x5027('0x31')][_0x5027('0x33')]?_0x3773b6[_0x5027('0x31')]:_0x450445[_0x5027('0x2c')];if(_0xc37ca4[_0x5027('0x2d')][_0x5027('0x3d')]){_0x3773b6['include']=[{'all':!![]}];}_0x3773b6=_['merge']({},_0x3773b6,_0xc37ca4[_0x5027('0x3c')]);return db[_0x5027('0x28')][_0x5027('0x43')](_0x3773b6)[_0x5027('0x20')](handleEntityNotFound(_0x44c483,null))['then'](respondWithResult(_0x44c483,null))[_0x5027('0x41')](handleError(_0x44c483,null));};exports['create']=function(_0x1a9d2a,_0x20aaf8){return db[_0x5027('0x28')][_0x5027('0x44')](_0x1a9d2a[_0x5027('0x45')],{})['then'](respondWithResult(_0x20aaf8,0xc9))[_0x5027('0x41')](handleError(_0x20aaf8,null));};exports[_0x5027('0x1f')]=function(_0x5a9334,_0x1e66dc){if(_0x5a9334['body']['id']){delete _0x5a9334['body']['id'];}return db[_0x5027('0x28')][_0x5027('0x43')]({'where':{'id':_0x5a9334[_0x5027('0x42')]['id']}})[_0x5027('0x20')](handleEntityNotFound(_0x1e66dc,null))[_0x5027('0x20')](saveUpdates(_0x5a9334[_0x5027('0x45')],null))['then'](respondWithResult(_0x1e66dc,null))[_0x5027('0x41')](handleError(_0x1e66dc,null));};exports[_0x5027('0x21')]=function(_0x40b55f,_0x170ad3){return db[_0x5027('0x28')]['find']({'where':{'id':_0x40b55f[_0x5027('0x42')]['id']}})[_0x5027('0x20')](handleEntityNotFound(_0x170ad3,null))[_0x5027('0x20')](removeEntity(_0x170ad3,null))[_0x5027('0x41')](handleError(_0x170ad3,null));};exports['getFields']=function(_0xda0b67,_0x4870aa,_0xfbe1fc){var _0x1ea18f={};var _0x39d240={};var _0x1091d9;var _0x2dd43c;return db[_0x5027('0x28')]['findOne']({'where':{'id':_0xda0b67[_0x5027('0x42')]['id']}})[_0x5027('0x20')](handleEntityNotFound(_0x4870aa,null))[_0x5027('0x20')](function(_0x345b9f){if(_0x345b9f){_0x1091d9=_0x345b9f;_0x39d240[_0x5027('0x2c')]=_['keys'](db[_0x5027('0x46')]['rawAttributes']);_0x39d240[_0x5027('0x2d')]=_[_0x5027('0x2e')](_0xda0b67[_0x5027('0x2d')]);_0x39d240[_0x5027('0x2f')]=_[_0x5027('0x30')](_0x39d240['model'],_0x39d240[_0x5027('0x2d')]);_0x1ea18f[_0x5027('0x31')]=_[_0x5027('0x30')](_0x39d240[_0x5027('0x2c')],qs[_0x5027('0x32')](_0xda0b67[_0x5027('0x2d')][_0x5027('0x32')]));_0x1ea18f[_0x5027('0x31')]=_0x1ea18f[_0x5027('0x31')][_0x5027('0x33')]?_0x1ea18f[_0x5027('0x31')]:_0x39d240[_0x5027('0x2c')];_0x1ea18f[_0x5027('0x36')]=qs[_0x5027('0x37')](_0xda0b67[_0x5027('0x2d')][_0x5027('0x37')]);_0x1ea18f[_0x5027('0x38')]=qs[_0x5027('0x2f')](_['pick'](_0xda0b67[_0x5027('0x2d')],_0x39d240[_0x5027('0x2f')]));if(_0xda0b67[_0x5027('0x2d')][_0x5027('0x39')]){_0x1ea18f['where']=_[_0x5027('0x3a')](_0x1ea18f['where'],{'$or':_[_0x5027('0x27')](_0x1ea18f[_0x5027('0x31')],function(_0x4e88cb){var _0x3ffef3={};_0x3ffef3[_0x4e88cb]={'$like':'%'+_0xda0b67[_0x5027('0x2d')][_0x5027('0x39')]+'%'};return _0x3ffef3;})});}_0x1ea18f=_[_0x5027('0x3a')]({},_0x1ea18f,_0xda0b67[_0x5027('0x3c')]);return _0x1091d9[_0x5027('0x47')](_0x1ea18f);}})['then'](function(_0xf19e58){if(_0xf19e58){_0x2dd43c=_0xf19e58[_0x5027('0x33')];if(!_0xda0b67[_0x5027('0x2d')]['hasOwnProperty'](_0x5027('0x35'))){_0x1ea18f['limit']=qs[_0x5027('0x1a')](_0xda0b67[_0x5027('0x2d')][_0x5027('0x1a')]);_0x1ea18f[_0x5027('0x17')]=qs[_0x5027('0x17')](_0xda0b67['query']['offset']);}return _0x1091d9[_0x5027('0x47')](_0x1ea18f);}})[_0x5027('0x20')](function(_0x11ff68){if(_0x11ff68){return _0x11ff68?{'count':_0x2dd43c,'rows':_0x11ff68}:null;}})[_0x5027('0x20')](respondWithResult(_0x4870aa,null))[_0x5027('0x41')](handleError(_0x4870aa,null));};exports[_0x5027('0x48')]=function(_0x25f320,_0x3c0fcd,_0x1a4e7a){var _0x5d160f={};var _0x230a6a={};var _0x9beae9;var _0x202cec;return db[_0x5027('0x28')]['findOne']({'where':{'id':_0x25f320[_0x5027('0x42')]['id']}})[_0x5027('0x20')](handleEntityNotFound(_0x3c0fcd,null))[_0x5027('0x20')](function(_0x2c95d3){if(_0x2c95d3){_0x9beae9=_0x2c95d3;_0x230a6a[_0x5027('0x2c')]=_['keys'](db[_0x5027('0x46')]['rawAttributes']);_0x230a6a[_0x5027('0x2d')]=_['keys'](_0x25f320['query']);_0x230a6a[_0x5027('0x2f')]=_['intersection'](_0x230a6a['model'],_0x230a6a['query']);_0x5d160f[_0x5027('0x31')]=_['intersection'](_0x230a6a[_0x5027('0x2c')],qs[_0x5027('0x32')](_0x25f320[_0x5027('0x2d')]['fields']));_0x5d160f[_0x5027('0x31')]=_0x5d160f[_0x5027('0x31')][_0x5027('0x33')]?_0x5d160f['attributes']:_0x230a6a[_0x5027('0x2c')];_0x5d160f[_0x5027('0x36')]=qs[_0x5027('0x37')](_0x25f320[_0x5027('0x2d')]['sort']);_0x5d160f[_0x5027('0x38')]=qs[_0x5027('0x2f')](_[_0x5027('0x49')](_0x25f320[_0x5027('0x2d')],_0x230a6a[_0x5027('0x2f')]));if(_0x25f320[_0x5027('0x2d')][_0x5027('0x39')]){_0x5d160f[_0x5027('0x38')]=_['merge'](_0x5d160f['where'],{'$or':_[_0x5027('0x27')](_0x5d160f[_0x5027('0x31')],function(_0x1e4b16){var _0x29ed49={};_0x29ed49[_0x1e4b16]={'$like':'%'+_0x25f320[_0x5027('0x2d')][_0x5027('0x39')]+'%'};return _0x29ed49;})});}_0x5d160f=_['merge']({},_0x5d160f,_0x25f320[_0x5027('0x3c')]);return _0x9beae9['getSubjects'](_0x5d160f);}})[_0x5027('0x20')](function(_0x2e692b){if(_0x2e692b){_0x202cec=_0x2e692b[_0x5027('0x33')];if(!_0x25f320[_0x5027('0x2d')][_0x5027('0x34')](_0x5027('0x35'))){_0x5d160f['limit']=qs[_0x5027('0x1a')](_0x25f320[_0x5027('0x2d')][_0x5027('0x1a')]);_0x5d160f[_0x5027('0x17')]=qs[_0x5027('0x17')](_0x25f320[_0x5027('0x2d')][_0x5027('0x17')]);}return _0x9beae9['getSubjects'](_0x5d160f);}})['then'](function(_0x48e01d){if(_0x48e01d){return _0x48e01d?{'count':_0x202cec,'rows':_0x48e01d}:null;}})['then'](respondWithResult(_0x3c0fcd,null))[_0x5027('0x41')](handleError(_0x3c0fcd,null));};exports[_0x5027('0x4a')]=function(_0x1ed1dc,_0x45a242,_0x572215){var _0x4c22bf={};var _0xb9cc5a={};var _0x2d60e1;var _0x5d4070;return db[_0x5027('0x28')][_0x5027('0x4b')]({'where':{'id':_0x1ed1dc[_0x5027('0x42')]['id']}})[_0x5027('0x20')](handleEntityNotFound(_0x45a242,null))['then'](function(_0x2aed71){if(_0x2aed71){_0x2d60e1=_0x2aed71;_0xb9cc5a['model']=_[_0x5027('0x2e')](db[_0x5027('0x46')][_0x5027('0x29')]);_0xb9cc5a[_0x5027('0x2d')]=_[_0x5027('0x2e')](_0x1ed1dc[_0x5027('0x2d')]);_0xb9cc5a[_0x5027('0x2f')]=_[_0x5027('0x30')](_0xb9cc5a[_0x5027('0x2c')],_0xb9cc5a[_0x5027('0x2d')]);_0x4c22bf[_0x5027('0x31')]=_['intersection'](_0xb9cc5a[_0x5027('0x2c')],qs[_0x5027('0x32')](_0x1ed1dc['query'][_0x5027('0x32')]));_0x4c22bf[_0x5027('0x31')]=_0x4c22bf['attributes']['length']?_0x4c22bf['attributes']:_0xb9cc5a[_0x5027('0x2c')];_0x4c22bf[_0x5027('0x36')]=qs[_0x5027('0x37')](_0x1ed1dc['query']['sort']);_0x4c22bf[_0x5027('0x38')]=qs[_0x5027('0x2f')](_[_0x5027('0x49')](_0x1ed1dc['query'],_0xb9cc5a[_0x5027('0x2f')]));if(_0x1ed1dc[_0x5027('0x2d')][_0x5027('0x39')]){_0x4c22bf[_0x5027('0x38')]=_['merge'](_0x4c22bf[_0x5027('0x38')],{'$or':_[_0x5027('0x27')](_0x4c22bf[_0x5027('0x31')],function(_0x113d10){var _0x2f758e={};_0x2f758e[_0x113d10]={'$like':'%'+_0x1ed1dc['query']['filter']+'%'};return _0x2f758e;})});}_0x4c22bf=_[_0x5027('0x3a')]({},_0x4c22bf,_0x1ed1dc[_0x5027('0x3c')]);return _0x2d60e1[_0x5027('0x4a')](_0x4c22bf);}})[_0x5027('0x20')](function(_0x1d558e){if(_0x1d558e){_0x5d4070=_0x1d558e[_0x5027('0x33')];if(!_0x1ed1dc['query'][_0x5027('0x34')]('nolimit')){_0x4c22bf['limit']=qs['limit'](_0x1ed1dc[_0x5027('0x2d')]['limit']);_0x4c22bf['offset']=qs[_0x5027('0x17')](_0x1ed1dc[_0x5027('0x2d')][_0x5027('0x17')]);}return _0x2d60e1['getDescriptions'](_0x4c22bf);}})[_0x5027('0x20')](function(_0xb2175){if(_0xb2175){return _0xb2175?{'count':_0x5d4070,'rows':_0xb2175}:null;}})[_0x5027('0x20')](respondWithResult(_0x45a242,null))[_0x5027('0x41')](handleError(_0x45a242,null));}; \ No newline at end of file +var _0xf915=['name','send','index','map','SugarcrmConfiguration','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getFields','findOne','SugarcrmField','getSubjects','order','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x4cda99,_0x54b361){var _0xfa31c4=function(_0x17b778){while(--_0x17b778){_0x4cda99['push'](_0x4cda99['shift']());}};_0xfa31c4(++_0x54b361);}(_0xf915,0x1ba));var _0x5f91=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf915[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x5f91('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f91('0x1'));var jsonpatch=require(_0x5f91('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5f91('0x3'));var Mustache=require(_0x5f91('0x4'));var util=require('util');var path=require(_0x5f91('0x5'));var sox=require(_0x5f91('0x6'));var csv=require(_0x5f91('0x7'));var ejs=require(_0x5f91('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f91('0x9'));var squel=require(_0x5f91('0xa'));var crypto=require(_0x5f91('0xb'));var jsforce=require(_0x5f91('0xc'));var deskjs=require(_0x5f91('0xd'));var toCsv=require(_0x5f91('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5f91('0xe'));var authService=require(_0x5f91('0xf'));var qs=require(_0x5f91('0x10'));var as=require(_0x5f91('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f91('0x12'))('api');var utils=require(_0x5f91('0x13'));var config=require(_0x5f91('0x14'));var licenseUtil=require(_0x5f91('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x306b7c,_0x2da51a){_0x2da51a=_0x2da51a||0xcc;return function(_0xcb7ebf){if(_0xcb7ebf){return _0x306b7c[_0x5f91('0x16')](_0x2da51a);}return _0x306b7c[_0x5f91('0x17')](_0x2da51a)[_0x5f91('0x18')]();};}function respondWithResult(_0xba469d,_0x1da0c5){_0x1da0c5=_0x1da0c5||0xc8;return function(_0x1c312d){if(_0x1c312d){return _0xba469d[_0x5f91('0x17')](_0x1da0c5)[_0x5f91('0x19')](_0x1c312d);}};}function respondWithFilteredResult(_0x49f301,_0x23d08b){return function(_0x7898a1){if(_0x7898a1){var _0x1d499b=typeof _0x23d08b['offset']===_0x5f91('0x1a')&&typeof _0x23d08b[_0x5f91('0x1b')]===_0x5f91('0x1a');var _0x46ae87=_0x7898a1['count'];var _0xefbed5=_0x1d499b?0x0:_0x23d08b[_0x5f91('0x1c')];var _0x54b20b=_0x1d499b?_0x7898a1[_0x5f91('0x1d')]:_0x23d08b[_0x5f91('0x1c')]+_0x23d08b[_0x5f91('0x1b')];var _0x153ed0;if(_0x54b20b>=_0x46ae87){_0x54b20b=_0x46ae87;_0x153ed0=0xc8;}else{_0x153ed0=0xce;}_0x49f301['status'](_0x153ed0);return _0x49f301[_0x5f91('0x1e')](_0x5f91('0x1f'),_0xefbed5+'-'+_0x54b20b+'/'+_0x46ae87)['json'](_0x7898a1);}return null;};}function patchUpdates(_0x232a3b){return function(_0x1dd8b5){try{jsonpatch[_0x5f91('0x20')](_0x1dd8b5,_0x232a3b,!![]);}catch(_0x42362e){return BPromise[_0x5f91('0x21')](_0x42362e);}return _0x1dd8b5[_0x5f91('0x22')]();};}function saveUpdates(_0x35ba91,_0x119923){return function(_0x12c656){if(_0x12c656){return _0x12c656[_0x5f91('0x23')](_0x35ba91)[_0x5f91('0x24')](function(_0x2706ab){return _0x2706ab;});}return null;};}function removeEntity(_0x5012f8,_0xfefaa){return function(_0x48520c){if(_0x48520c){return _0x48520c[_0x5f91('0x25')]()[_0x5f91('0x24')](function(){_0x5012f8[_0x5f91('0x17')](0xcc)[_0x5f91('0x18')]();});}};}function handleEntityNotFound(_0x37bc5b,_0x486f06){return function(_0x37943a){if(!_0x37943a){_0x37bc5b['sendStatus'](0x194);}return _0x37943a;};}function handleError(_0x11de9c,_0x26cd00){_0x26cd00=_0x26cd00||0x1f4;return function(_0x1bfb9b){logger['error'](_0x1bfb9b['stack']);if(_0x1bfb9b['name']){delete _0x1bfb9b[_0x5f91('0x26')];}_0x11de9c[_0x5f91('0x17')](_0x26cd00)[_0x5f91('0x27')](_0x1bfb9b);};}exports[_0x5f91('0x28')]=function(_0xece7e8,_0x19047b){var _0x475f5e={},_0x4acaa0={},_0xd358f1={'count':0x0,'rows':[]};var _0x3272fd=_[_0x5f91('0x29')](db[_0x5f91('0x2a')]['rawAttributes'],function(_0x489a42){return{'name':_0x489a42[_0x5f91('0x2b')],'type':_0x489a42[_0x5f91('0x2c')][_0x5f91('0x2d')]};});_0x4acaa0[_0x5f91('0x2e')]=_['map'](_0x3272fd,_0x5f91('0x26'));_0x4acaa0['query']=_[_0x5f91('0x2f')](_0xece7e8[_0x5f91('0x30')]);_0x4acaa0[_0x5f91('0x31')]=_[_0x5f91('0x32')](_0x4acaa0[_0x5f91('0x2e')],_0x4acaa0[_0x5f91('0x30')]);_0x475f5e[_0x5f91('0x33')]=_[_0x5f91('0x32')](_0x4acaa0['model'],qs[_0x5f91('0x34')](_0xece7e8[_0x5f91('0x30')]['fields']));_0x475f5e[_0x5f91('0x33')]=_0x475f5e[_0x5f91('0x33')][_0x5f91('0x35')]?_0x475f5e[_0x5f91('0x33')]:_0x4acaa0[_0x5f91('0x2e')];if(!_0xece7e8[_0x5f91('0x30')][_0x5f91('0x36')](_0x5f91('0x37'))){_0x475f5e[_0x5f91('0x1b')]=qs[_0x5f91('0x1b')](_0xece7e8[_0x5f91('0x30')][_0x5f91('0x1b')]);_0x475f5e[_0x5f91('0x1c')]=qs[_0x5f91('0x1c')](_0xece7e8[_0x5f91('0x30')][_0x5f91('0x1c')]);}_0x475f5e['order']=qs[_0x5f91('0x38')](_0xece7e8[_0x5f91('0x30')][_0x5f91('0x38')]);_0x475f5e[_0x5f91('0x39')]=qs[_0x5f91('0x31')](_[_0x5f91('0x3a')](_0xece7e8[_0x5f91('0x30')],_0x4acaa0[_0x5f91('0x31')]),_0x3272fd);if(_0xece7e8['query'][_0x5f91('0x3b')]){_0x475f5e[_0x5f91('0x39')]=_[_0x5f91('0x3c')](_0x475f5e[_0x5f91('0x39')],{'$or':_[_0x5f91('0x29')](_0x3272fd,function(_0x263cda){if(_0x263cda[_0x5f91('0x2c')]!==_0x5f91('0x3d')){var _0xa91d78={};_0xa91d78[_0x263cda[_0x5f91('0x26')]]={'$like':'%'+_0xece7e8[_0x5f91('0x30')][_0x5f91('0x3b')]+'%'};return _0xa91d78;}})});}_0x475f5e=_['merge']({},_0x475f5e,_0xece7e8[_0x5f91('0x3e')]);var _0x1ff36a={'where':_0x475f5e[_0x5f91('0x39')]};return db['SugarcrmConfiguration']['count'](_0x1ff36a)[_0x5f91('0x24')](function(_0x3a223d){_0xd358f1['count']=_0x3a223d;if(_0xece7e8[_0x5f91('0x30')]['includeAll']){_0x475f5e[_0x5f91('0x3f')]=[{'all':!![]}];}return db[_0x5f91('0x2a')][_0x5f91('0x40')](_0x475f5e);})[_0x5f91('0x24')](function(_0x115c2a){_0xd358f1[_0x5f91('0x41')]=_0x115c2a;return _0xd358f1;})['then'](respondWithFilteredResult(_0x19047b,_0x475f5e))[_0x5f91('0x42')](handleError(_0x19047b,null));};exports[_0x5f91('0x43')]=function(_0x4c917a,_0x131d0f){var _0xedfef={'raw':![],'where':{'id':_0x4c917a[_0x5f91('0x44')]['id']}},_0x4a434c={};_0x4a434c[_0x5f91('0x2e')]=_[_0x5f91('0x2f')](db[_0x5f91('0x2a')][_0x5f91('0x45')]);_0x4a434c['query']=_['keys'](_0x4c917a[_0x5f91('0x30')]);_0x4a434c['filters']=_['intersection'](_0x4a434c['model'],_0x4a434c['query']);_0xedfef[_0x5f91('0x33')]=_[_0x5f91('0x32')](_0x4a434c['model'],qs[_0x5f91('0x34')](_0x4c917a[_0x5f91('0x30')][_0x5f91('0x34')]));_0xedfef[_0x5f91('0x33')]=_0xedfef[_0x5f91('0x33')]['length']?_0xedfef[_0x5f91('0x33')]:_0x4a434c[_0x5f91('0x2e')];if(_0x4c917a[_0x5f91('0x30')][_0x5f91('0x46')]){_0xedfef['include']=[{'all':!![]}];}_0xedfef=_[_0x5f91('0x3c')]({},_0xedfef,_0x4c917a[_0x5f91('0x3e')]);return db[_0x5f91('0x2a')][_0x5f91('0x47')](_0xedfef)[_0x5f91('0x24')](handleEntityNotFound(_0x131d0f,null))['then'](respondWithResult(_0x131d0f,null))[_0x5f91('0x42')](handleError(_0x131d0f,null));};exports[_0x5f91('0x48')]=function(_0x55f989,_0x10ccb0){return db[_0x5f91('0x2a')][_0x5f91('0x48')](_0x55f989[_0x5f91('0x49')],{})[_0x5f91('0x24')](respondWithResult(_0x10ccb0,0xc9))[_0x5f91('0x42')](handleError(_0x10ccb0,null));};exports[_0x5f91('0x23')]=function(_0x36ecca,_0x4f11e1){if(_0x36ecca['body']['id']){delete _0x36ecca[_0x5f91('0x49')]['id'];}return db[_0x5f91('0x2a')][_0x5f91('0x47')]({'where':{'id':_0x36ecca[_0x5f91('0x44')]['id']}})[_0x5f91('0x24')](handleEntityNotFound(_0x4f11e1,null))[_0x5f91('0x24')](saveUpdates(_0x36ecca[_0x5f91('0x49')],null))['then'](respondWithResult(_0x4f11e1,null))[_0x5f91('0x42')](handleError(_0x4f11e1,null));};exports[_0x5f91('0x25')]=function(_0x38b87f,_0xcc70b7){return db[_0x5f91('0x2a')][_0x5f91('0x47')]({'where':{'id':_0x38b87f['params']['id']}})[_0x5f91('0x24')](handleEntityNotFound(_0xcc70b7,null))['then'](removeEntity(_0xcc70b7,null))[_0x5f91('0x42')](handleError(_0xcc70b7,null));};exports[_0x5f91('0x4a')]=function(_0x31590d,_0xaa7ad8,_0x1d8fe3){var _0x5cf56b={};var _0x30ea31={};var _0xcae0bd;var _0x3efea8;return db[_0x5f91('0x2a')][_0x5f91('0x4b')]({'where':{'id':_0x31590d[_0x5f91('0x44')]['id']}})['then'](handleEntityNotFound(_0xaa7ad8,null))[_0x5f91('0x24')](function(_0x2b9f50){if(_0x2b9f50){_0xcae0bd=_0x2b9f50;_0x30ea31['model']=_[_0x5f91('0x2f')](db[_0x5f91('0x4c')][_0x5f91('0x45')]);_0x30ea31['query']=_['keys'](_0x31590d['query']);_0x30ea31[_0x5f91('0x31')]=_['intersection'](_0x30ea31[_0x5f91('0x2e')],_0x30ea31[_0x5f91('0x30')]);_0x5cf56b[_0x5f91('0x33')]=_[_0x5f91('0x32')](_0x30ea31[_0x5f91('0x2e')],qs['fields'](_0x31590d['query'][_0x5f91('0x34')]));_0x5cf56b[_0x5f91('0x33')]=_0x5cf56b['attributes'][_0x5f91('0x35')]?_0x5cf56b[_0x5f91('0x33')]:_0x30ea31['model'];_0x5cf56b['order']=qs[_0x5f91('0x38')](_0x31590d['query'][_0x5f91('0x38')]);_0x5cf56b['where']=qs['filters'](_[_0x5f91('0x3a')](_0x31590d[_0x5f91('0x30')],_0x30ea31[_0x5f91('0x31')]));if(_0x31590d[_0x5f91('0x30')][_0x5f91('0x3b')]){_0x5cf56b[_0x5f91('0x39')]=_[_0x5f91('0x3c')](_0x5cf56b[_0x5f91('0x39')],{'$or':_[_0x5f91('0x29')](_0x5cf56b['attributes'],function(_0x3cd7ac){var _0x42172a={};_0x42172a[_0x3cd7ac]={'$like':'%'+_0x31590d[_0x5f91('0x30')][_0x5f91('0x3b')]+'%'};return _0x42172a;})});}_0x5cf56b=_[_0x5f91('0x3c')]({},_0x5cf56b,_0x31590d['options']);return _0xcae0bd[_0x5f91('0x4a')](_0x5cf56b);}})[_0x5f91('0x24')](function(_0x452bb5){if(_0x452bb5){_0x3efea8=_0x452bb5[_0x5f91('0x35')];if(!_0x31590d[_0x5f91('0x30')]['hasOwnProperty']('nolimit')){_0x5cf56b[_0x5f91('0x1b')]=qs[_0x5f91('0x1b')](_0x31590d[_0x5f91('0x30')][_0x5f91('0x1b')]);_0x5cf56b[_0x5f91('0x1c')]=qs[_0x5f91('0x1c')](_0x31590d['query'][_0x5f91('0x1c')]);}return _0xcae0bd[_0x5f91('0x4a')](_0x5cf56b);}})[_0x5f91('0x24')](function(_0x2af408){if(_0x2af408){return _0x2af408?{'count':_0x3efea8,'rows':_0x2af408}:null;}})[_0x5f91('0x24')](respondWithResult(_0xaa7ad8,null))[_0x5f91('0x42')](handleError(_0xaa7ad8,null));};exports[_0x5f91('0x4d')]=function(_0x3b2965,_0x4c548b,_0x5519c9){var _0x510265={};var _0x72d86e={};var _0x5ae2af;var _0x14361d;return db[_0x5f91('0x2a')]['findOne']({'where':{'id':_0x3b2965[_0x5f91('0x44')]['id']}})['then'](handleEntityNotFound(_0x4c548b,null))['then'](function(_0x374da2){if(_0x374da2){_0x5ae2af=_0x374da2;_0x72d86e[_0x5f91('0x2e')]=_[_0x5f91('0x2f')](db[_0x5f91('0x4c')][_0x5f91('0x45')]);_0x72d86e[_0x5f91('0x30')]=_[_0x5f91('0x2f')](_0x3b2965[_0x5f91('0x30')]);_0x72d86e[_0x5f91('0x31')]=_[_0x5f91('0x32')](_0x72d86e['model'],_0x72d86e['query']);_0x510265[_0x5f91('0x33')]=_[_0x5f91('0x32')](_0x72d86e[_0x5f91('0x2e')],qs[_0x5f91('0x34')](_0x3b2965['query'][_0x5f91('0x34')]));_0x510265['attributes']=_0x510265[_0x5f91('0x33')][_0x5f91('0x35')]?_0x510265[_0x5f91('0x33')]:_0x72d86e['model'];_0x510265[_0x5f91('0x4e')]=qs[_0x5f91('0x38')](_0x3b2965['query'][_0x5f91('0x38')]);_0x510265[_0x5f91('0x39')]=qs[_0x5f91('0x31')](_[_0x5f91('0x3a')](_0x3b2965[_0x5f91('0x30')],_0x72d86e[_0x5f91('0x31')]));if(_0x3b2965[_0x5f91('0x30')][_0x5f91('0x3b')]){_0x510265[_0x5f91('0x39')]=_[_0x5f91('0x3c')](_0x510265[_0x5f91('0x39')],{'$or':_[_0x5f91('0x29')](_0x510265['attributes'],function(_0x4cd5fd){var _0x2c2913={};_0x2c2913[_0x4cd5fd]={'$like':'%'+_0x3b2965['query'][_0x5f91('0x3b')]+'%'};return _0x2c2913;})});}_0x510265=_[_0x5f91('0x3c')]({},_0x510265,_0x3b2965[_0x5f91('0x3e')]);return _0x5ae2af[_0x5f91('0x4d')](_0x510265);}})[_0x5f91('0x24')](function(_0x55aacc){if(_0x55aacc){_0x14361d=_0x55aacc['length'];if(!_0x3b2965[_0x5f91('0x30')][_0x5f91('0x36')]('nolimit')){_0x510265[_0x5f91('0x1b')]=qs[_0x5f91('0x1b')](_0x3b2965[_0x5f91('0x30')][_0x5f91('0x1b')]);_0x510265['offset']=qs[_0x5f91('0x1c')](_0x3b2965[_0x5f91('0x30')][_0x5f91('0x1c')]);}return _0x5ae2af[_0x5f91('0x4d')](_0x510265);}})[_0x5f91('0x24')](function(_0x5f7096){if(_0x5f7096){return _0x5f7096?{'count':_0x14361d,'rows':_0x5f7096}:null;}})[_0x5f91('0x24')](respondWithResult(_0x4c548b,null))[_0x5f91('0x42')](handleError(_0x4c548b,null));};exports[_0x5f91('0x4f')]=function(_0x1ec775,_0x5b0b40,_0x315388){var _0x3add80={};var _0x12a197={};var _0xe559e9;var _0x345628;return db['SugarcrmConfiguration'][_0x5f91('0x4b')]({'where':{'id':_0x1ec775[_0x5f91('0x44')]['id']}})[_0x5f91('0x24')](handleEntityNotFound(_0x5b0b40,null))['then'](function(_0x3c6fb5){if(_0x3c6fb5){_0xe559e9=_0x3c6fb5;_0x12a197[_0x5f91('0x2e')]=_[_0x5f91('0x2f')](db['SugarcrmField'][_0x5f91('0x45')]);_0x12a197[_0x5f91('0x30')]=_[_0x5f91('0x2f')](_0x1ec775[_0x5f91('0x30')]);_0x12a197[_0x5f91('0x31')]=_[_0x5f91('0x32')](_0x12a197[_0x5f91('0x2e')],_0x12a197[_0x5f91('0x30')]);_0x3add80['attributes']=_[_0x5f91('0x32')](_0x12a197[_0x5f91('0x2e')],qs[_0x5f91('0x34')](_0x1ec775['query']['fields']));_0x3add80[_0x5f91('0x33')]=_0x3add80[_0x5f91('0x33')][_0x5f91('0x35')]?_0x3add80[_0x5f91('0x33')]:_0x12a197['model'];_0x3add80[_0x5f91('0x4e')]=qs[_0x5f91('0x38')](_0x1ec775[_0x5f91('0x30')][_0x5f91('0x38')]);_0x3add80[_0x5f91('0x39')]=qs['filters'](_['pick'](_0x1ec775[_0x5f91('0x30')],_0x12a197['filters']));if(_0x1ec775[_0x5f91('0x30')][_0x5f91('0x3b')]){_0x3add80[_0x5f91('0x39')]=_[_0x5f91('0x3c')](_0x3add80[_0x5f91('0x39')],{'$or':_[_0x5f91('0x29')](_0x3add80[_0x5f91('0x33')],function(_0x4236df){var _0x122eba={};_0x122eba[_0x4236df]={'$like':'%'+_0x1ec775[_0x5f91('0x30')][_0x5f91('0x3b')]+'%'};return _0x122eba;})});}_0x3add80=_['merge']({},_0x3add80,_0x1ec775[_0x5f91('0x3e')]);return _0xe559e9['getDescriptions'](_0x3add80);}})[_0x5f91('0x24')](function(_0x425880){if(_0x425880){_0x345628=_0x425880[_0x5f91('0x35')];if(!_0x1ec775['query'][_0x5f91('0x36')]('nolimit')){_0x3add80['limit']=qs[_0x5f91('0x1b')](_0x1ec775[_0x5f91('0x30')][_0x5f91('0x1b')]);_0x3add80[_0x5f91('0x1c')]=qs[_0x5f91('0x1c')](_0x1ec775[_0x5f91('0x30')][_0x5f91('0x1c')]);}return _0xe559e9[_0x5f91('0x4f')](_0x3add80);}})[_0x5f91('0x24')](function(_0x4e507e){if(_0x4e507e){return _0x4e507e?{'count':_0x345628,'rows':_0x4e507e}:null;}})['then'](respondWithResult(_0x5b0b40,null))[_0x5f91('0x42')](handleError(_0x5b0b40,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 71a1b8c..52f7ef1 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 _0x39ea=['SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x5cdad2,_0x129d32){var _0x508c9b=function(_0x481bd5){while(--_0x481bd5){_0x5cdad2['push'](_0x5cdad2['shift']());}};_0x508c9b(++_0x129d32);}(_0x39ea,0x1e3));var _0xa39e=function(_0x1a8d04,_0x50ba5b){_0x1a8d04=_0x1a8d04-0x0;var _0x409144=_0x39ea[_0x1a8d04];return _0x409144;};'use strict';var _=require(_0xa39e('0x0'));var util=require(_0xa39e('0x1'));var logger=require(_0xa39e('0x2'))('api');var moment=require(_0xa39e('0x3'));var BPromise=require(_0xa39e('0x4'));var rp=require(_0xa39e('0x5'));var fs=require('fs');var path=require(_0xa39e('0x6'));var rimraf=require(_0xa39e('0x7'));var config=require(_0xa39e('0x8'));var attributes=require(_0xa39e('0x9'));module[_0xa39e('0xa')]=function(_0x5232b3,_0x4c5c18){return _0x5232b3['define'](_0xa39e('0xb'),attributes,{'tableName':_0xa39e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7e0=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','lodash'];(function(_0x25d5f7,_0x3507ea){var _0x3127ef=function(_0x29cdc8){while(--_0x29cdc8){_0x25d5f7['push'](_0x25d5f7['shift']());}};_0x3127ef(++_0x3507ea);}(_0xe7e0,0x137));var _0x0e7e=function(_0x4d142c,_0x508f9a){_0x4d142c=_0x4d142c-0x0;var _0xe0d0b7=_0xe7e0[_0x4d142c];return _0xe0d0b7;};'use strict';var _=require(_0x0e7e('0x0'));var util=require(_0x0e7e('0x1'));var logger=require(_0x0e7e('0x2'))(_0x0e7e('0x3'));var moment=require(_0x0e7e('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e7e('0x5'));var fs=require('fs');var path=require(_0x0e7e('0x6'));var rimraf=require(_0x0e7e('0x7'));var config=require(_0x0e7e('0x8'));var attributes=require(_0x0e7e('0x9'));module[_0x0e7e('0xa')]=function(_0x1d8850,_0x446520){return _0x1d8850[_0x0e7e('0xb')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index a366a9b..c0ffe84 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 _0x643e=['moment','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','result','message','lodash','util'];(function(_0x2eacf1,_0x2f747f){var _0x147531=function(_0x17b26d){while(--_0x17b26d){_0x2eacf1['push'](_0x2eacf1['shift']());}};_0x147531(++_0x2f747f);}(_0x643e,0xf5));var _0xe643=function(_0x3ebf19,_0x2c5b58){_0x3ebf19=_0x3ebf19-0x0;var _0x18c120=_0x643e[_0x3ebf19];return _0x18c120;};'use strict';var _=require(_0xe643('0x0'));var util=require(_0xe643('0x1'));var moment=require(_0xe643('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe643('0x3'));var logger=require('../../config/logger')(_0xe643('0x4'));var config=require(_0xe643('0x5'));var jayson=require(_0xe643('0x6'));var client=jayson[_0xe643('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x240158,_0xa5a828,_0x55ae17){return new BPromise(function(_0x5edb3c,_0x510868){return client[_0xe643('0x8')](_0x240158,_0x55ae17)[_0xe643('0x9')](function(_0x34d234){logger[_0xe643('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xa5a828,_0xe643('0xb'));logger[_0xe643('0xc')](_0xe643('0xd'),_0xa5a828,_0xe643('0xb'),JSON[_0xe643('0xe')](_0x34d234));if(_0x34d234[_0xe643('0xf')]){if(_0x34d234[_0xe643('0xf')]['code']===0x1f4){logger[_0xe643('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xa5a828,_0x34d234[_0xe643('0xf')]['message']);return _0x510868(_0x34d234[_0xe643('0xf')]['message']);}logger['error'](_0xe643('0x10'),_0xa5a828,_0x34d234[_0xe643('0xf')]['message']);return _0x5edb3c(_0x34d234[_0xe643('0xf')]['message']);}else{logger[_0xe643('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xa5a828,'request\x20sent');_0x5edb3c(_0x34d234[_0xe643('0x11')][_0xe643('0x12')]);}})['catch'](function(_0x587020){logger[_0xe643('0xf')](_0xe643('0x10'),_0xa5a828,_0x587020);_0x510868(_0x587020);});});} \ No newline at end of file +var _0x9809=['info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0x9809,0x163));var _0x9980=function(_0x3da92f,_0x28714b){_0x3da92f=_0x3da92f-0x0;var _0x28696b=_0x9809[_0x3da92f];return _0x28696b;};'use strict';var _=require(_0x9980('0x0'));var util=require(_0x9980('0x1'));var moment=require(_0x9980('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9980('0x3'));var db=require(_0x9980('0x4'))['db'];var utils=require(_0x9980('0x5'));var logger=require(_0x9980('0x6'))(_0x9980('0x7'));var config=require(_0x9980('0x8'));var jayson=require(_0x9980('0x9'));var client=jayson[_0x9980('0xa')][_0x9980('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcb797c,_0x1d388f,_0x2bbf93){return new BPromise(function(_0x1c5a9e,_0x4db79f){return client['request'](_0xcb797c,_0x2bbf93)[_0x9980('0xc')](function(_0x388b04){logger[_0x9980('0xd')](_0x9980('0xe'),_0x1d388f,'request\x20sent');logger[_0x9980('0xf')](_0x9980('0x10'),_0x1d388f,'request\x20sent',JSON[_0x9980('0x11')](_0x388b04));if(_0x388b04[_0x9980('0x12')]){if(_0x388b04[_0x9980('0x12')][_0x9980('0x13')]===0x1f4){logger[_0x9980('0x12')](_0x9980('0xe'),_0x1d388f,_0x388b04[_0x9980('0x12')][_0x9980('0x14')]);return _0x4db79f(_0x388b04['error']['message']);}logger[_0x9980('0x12')](_0x9980('0xe'),_0x1d388f,_0x388b04[_0x9980('0x12')][_0x9980('0x14')]);return _0x1c5a9e(_0x388b04[_0x9980('0x12')]['message']);}else{logger[_0x9980('0xd')](_0x9980('0xe'),_0x1d388f,_0x9980('0x15'));_0x1c5a9e(_0x388b04[_0x9980('0x16')][_0x9980('0x14')]);}})['catch'](function(_0x1c75bb){logger[_0x9980('0x12')](_0x9980('0xe'),_0x1d388f,_0x1c75bb);_0x4db79f(_0x1c75bb);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index ccac621..01f8da7 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 _0x96e6=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x2aa3ed,_0x21bb61){var _0x4e0881=function(_0x581164){while(--_0x581164){_0x2aa3ed['push'](_0x2aa3ed['shift']());}};_0x4e0881(++_0x21bb61);}(_0x96e6,0x18f));var _0x696e=function(_0x29eafd,_0x1c7da6){_0x29eafd=_0x29eafd-0x0;var _0x261c60=_0x96e6[_0x29eafd];return _0x261c60;};'use strict';var multer=require('multer');var util=require(_0x696e('0x0'));var path=require(_0x696e('0x1'));var timeout=require('connect-timeout');var express=require(_0x696e('0x2'));var router=express[_0x696e('0x3')]();var fs_extra=require(_0x696e('0x4'));var auth=require(_0x696e('0x5'));var interaction=require(_0x696e('0x6'));var config=require(_0x696e('0x7'));var controller=require('./intSugarcrmField.controller');router[_0x696e('0x8')]('/',auth[_0x696e('0x9')](),controller[_0x696e('0xa')]);router['get'](_0x696e('0xb'),auth['isAuthenticated'](),controller[_0x696e('0xc')]);router[_0x696e('0xd')]('/',auth[_0x696e('0x9')](),controller[_0x696e('0xe')]);router[_0x696e('0xf')](_0x696e('0xb'),auth['isAuthenticated'](),controller[_0x696e('0x10')]);router[_0x696e('0x11')](_0x696e('0xb'),auth[_0x696e('0x9')](),controller[_0x696e('0x12')]);module[_0x696e('0x13')]=router; \ No newline at end of file +var _0x2a2b=['index','get','/:id','show','post','create','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated'];(function(_0x54f423,_0x5795f5){var _0x240e23=function(_0x575cfc){while(--_0x575cfc){_0x54f423['push'](_0x54f423['shift']());}};_0x240e23(++_0x5795f5);}(_0x2a2b,0x185));var _0xb2a2=function(_0x3edfe4,_0x3301ef){_0x3edfe4=_0x3edfe4-0x0;var _0x44572b=_0x2a2b[_0x3edfe4];return _0x44572b;};'use strict';var multer=require(_0xb2a2('0x0'));var util=require(_0xb2a2('0x1'));var path=require(_0xb2a2('0x2'));var timeout=require('connect-timeout');var express=require(_0xb2a2('0x3'));var router=express[_0xb2a2('0x4')]();var fs_extra=require(_0xb2a2('0x5'));var auth=require(_0xb2a2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb2a2('0x7'));var controller=require(_0xb2a2('0x8'));router['get']('/',auth[_0xb2a2('0x9')](),controller[_0xb2a2('0xa')]);router[_0xb2a2('0xb')](_0xb2a2('0xc'),auth[_0xb2a2('0x9')](),controller[_0xb2a2('0xd')]);router[_0xb2a2('0xe')]('/',auth[_0xb2a2('0x9')](),controller[_0xb2a2('0xf')]);router[_0xb2a2('0x10')](_0xb2a2('0xc'),auth[_0xb2a2('0x9')](),controller[_0xb2a2('0x11')]);router[_0xb2a2('0x12')](_0xb2a2('0xc'),auth[_0xb2a2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 58a663c..b79261f 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 _0x76fc=['picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0x76fc,0x148));var _0xc76f=function(_0x2cb312,_0x521f95){_0x2cb312=_0x2cb312-0x0;var _0x40fdfe=_0x76fc[_0x2cb312];return _0x40fdfe;};'use strict';var Sequelize=require(_0xc76f('0x0'));module[_0xc76f('0x1')]={'type':{'type':Sequelize[_0xc76f('0x2')]('string',_0xc76f('0x3'),_0xc76f('0x4'),'keyValue',_0xc76f('0x5')),'defaultValue':_0xc76f('0x6')},'content':{'type':Sequelize[_0xc76f('0x7')]},'key':{'type':Sequelize[_0xc76f('0x7')]},'keyType':{'type':Sequelize[_0xc76f('0x2')](_0xc76f('0x6'),_0xc76f('0x3'),_0xc76f('0x4'))},'keyContent':{'type':Sequelize[_0xc76f('0x7')]},'idField':{'type':Sequelize[_0xc76f('0x7')]},'nameField':{'type':Sequelize[_0xc76f('0x7')]},'customField':{'type':Sequelize[_0xc76f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7dbc=['STRING','ENUM','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0xce44ee,_0x387d70){var _0xf97a49=function(_0x3ceab0){while(--_0x3ceab0){_0xce44ee['push'](_0xce44ee['shift']());}};_0xf97a49(++_0x387d70);}(_0x7dbc,0x1a0));var _0xc7db=function(_0x4df54f,_0x2c59ff){_0x4df54f=_0x4df54f-0x0;var _0x4c2e1e=_0x7dbc[_0x4df54f];return _0x4c2e1e;};'use strict';var Sequelize=require(_0xc7db('0x0'));module[_0xc7db('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc7db('0x2'),_0xc7db('0x3'),_0xc7db('0x4'),_0xc7db('0x5'),_0xc7db('0x6')),'defaultValue':_0xc7db('0x2')},'content':{'type':Sequelize[_0xc7db('0x7')]},'key':{'type':Sequelize[_0xc7db('0x7')]},'keyType':{'type':Sequelize[_0xc7db('0x8')]('string',_0xc7db('0x3'),_0xc7db('0x4'))},'keyContent':{'type':Sequelize[_0xc7db('0x7')]},'idField':{'type':Sequelize[_0xc7db('0x7')]},'nameField':{'type':Sequelize[_0xc7db('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc7db('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 07b041a..2821766 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 _0x68e7=['rows','catch','params','keys','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include'];(function(_0x314d59,_0x3870ad){var _0x1f2909=function(_0x5f5d2c){while(--_0x5f5d2c){_0x314d59['push'](_0x314d59['shift']());}};_0x1f2909(++_0x3870ad);}(_0x68e7,0x117));var _0x768e=function(_0x477f6e,_0x2781b7){_0x477f6e=_0x477f6e-0x0;var _0x10f1a9=_0x68e7[_0x477f6e];return _0x10f1a9;};'use strict';var emlformat=require(_0x768e('0x0'));var rimraf=require(_0x768e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x768e('0x2'));var moment=require(_0x768e('0x3'));var BPromise=require(_0x768e('0x4'));var Mustache=require(_0x768e('0x5'));var util=require(_0x768e('0x6'));var path=require(_0x768e('0x7'));var sox=require(_0x768e('0x8'));var csv=require(_0x768e('0x9'));var ejs=require(_0x768e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x768e('0xb'));var squel=require(_0x768e('0xc'));var crypto=require('crypto');var jsforce=require(_0x768e('0xd'));var deskjs=require(_0x768e('0xe'));var toCsv=require(_0x768e('0x9'));var querystring=require(_0x768e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x768e('0x10'));var qs=require(_0x768e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x768e('0x12'))('api');var utils=require(_0x768e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x768e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x370997,_0xd29e1f){_0xd29e1f=_0xd29e1f||0xcc;return function(_0x44e31b){if(_0x44e31b){return _0x370997['sendStatus'](_0xd29e1f);}return _0x370997[_0x768e('0x15')](_0xd29e1f)['end']();};}function respondWithResult(_0x1ce34c,_0x25f9ff){_0x25f9ff=_0x25f9ff||0xc8;return function(_0x1564c1){if(_0x1564c1){return _0x1ce34c['status'](_0x25f9ff)['json'](_0x1564c1);}};}function respondWithFilteredResult(_0x2f53ee,_0x21f6df){return function(_0x256be3){if(_0x256be3){var _0x5e0744=typeof _0x21f6df[_0x768e('0x16')]===_0x768e('0x17')&&typeof _0x21f6df['limit']===_0x768e('0x17');var _0x3dd22a=_0x256be3[_0x768e('0x18')];var _0x1a39d9=_0x5e0744?0x0:_0x21f6df['offset'];var _0x4d7e42=_0x5e0744?_0x256be3[_0x768e('0x18')]:_0x21f6df['offset']+_0x21f6df[_0x768e('0x19')];var _0x5c082e;if(_0x4d7e42>=_0x3dd22a){_0x4d7e42=_0x3dd22a;_0x5c082e=0xc8;}else{_0x5c082e=0xce;}_0x2f53ee[_0x768e('0x15')](_0x5c082e);return _0x2f53ee[_0x768e('0x1a')](_0x768e('0x1b'),_0x1a39d9+'-'+_0x4d7e42+'/'+_0x3dd22a)[_0x768e('0x1c')](_0x256be3);}return null;};}function patchUpdates(_0x4400af){return function(_0x97e0c8){try{jsonpatch[_0x768e('0x1d')](_0x97e0c8,_0x4400af,!![]);}catch(_0x317fd3){return BPromise[_0x768e('0x1e')](_0x317fd3);}return _0x97e0c8[_0x768e('0x1f')]();};}function saveUpdates(_0x526b40,_0x2293bd){return function(_0x4bb8e4){if(_0x4bb8e4){return _0x4bb8e4[_0x768e('0x20')](_0x526b40)[_0x768e('0x21')](function(_0x41f1bd){return _0x41f1bd;});}return null;};}function removeEntity(_0x4cb59f,_0x3c35d0){return function(_0x10ec81){if(_0x10ec81){return _0x10ec81[_0x768e('0x22')]()['then'](function(){_0x4cb59f[_0x768e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc90c4f,_0x283392){return function(_0x2803ae){if(!_0x2803ae){_0xc90c4f[_0x768e('0x23')](0x194);}return _0x2803ae;};}function handleError(_0x3b4abd,_0x63533a){_0x63533a=_0x63533a||0x1f4;return function(_0x151ff4){logger['error'](_0x151ff4['stack']);if(_0x151ff4[_0x768e('0x24')]){delete _0x151ff4[_0x768e('0x24')];}_0x3b4abd[_0x768e('0x15')](_0x63533a)[_0x768e('0x25')](_0x151ff4);};}exports['index']=function(_0x4fde11,_0x83778a){var _0x328aff={},_0x56c41e={},_0x5d9547={'count':0x0,'rows':[]};var _0x7f1624=_['map'](db[_0x768e('0x26')][_0x768e('0x27')],function(_0x457534){return{'name':_0x457534[_0x768e('0x28')],'type':_0x457534[_0x768e('0x29')][_0x768e('0x2a')]};});_0x56c41e[_0x768e('0x2b')]=_[_0x768e('0x2c')](_0x7f1624,_0x768e('0x24'));_0x56c41e[_0x768e('0x2d')]=_['keys'](_0x4fde11['query']);_0x56c41e[_0x768e('0x2e')]=_[_0x768e('0x2f')](_0x56c41e[_0x768e('0x2b')],_0x56c41e[_0x768e('0x2d')]);_0x328aff[_0x768e('0x30')]=_[_0x768e('0x2f')](_0x56c41e[_0x768e('0x2b')],qs['fields'](_0x4fde11[_0x768e('0x2d')][_0x768e('0x31')]));_0x328aff['attributes']=_0x328aff[_0x768e('0x30')]['length']?_0x328aff[_0x768e('0x30')]:_0x56c41e[_0x768e('0x2b')];if(!_0x4fde11[_0x768e('0x2d')][_0x768e('0x32')]('nolimit')){_0x328aff[_0x768e('0x19')]=qs[_0x768e('0x19')](_0x4fde11['query'][_0x768e('0x19')]);_0x328aff[_0x768e('0x16')]=qs[_0x768e('0x16')](_0x4fde11[_0x768e('0x2d')][_0x768e('0x16')]);}_0x328aff[_0x768e('0x33')]=qs[_0x768e('0x34')](_0x4fde11['query']['sort']);_0x328aff['where']=qs['filters'](_[_0x768e('0x35')](_0x4fde11[_0x768e('0x2d')],_0x56c41e[_0x768e('0x2e')]),_0x7f1624);if(_0x4fde11['query'][_0x768e('0x36')]){_0x328aff['where']=_['merge'](_0x328aff[_0x768e('0x37')],{'$or':_['map'](_0x7f1624,function(_0x135eec){if(_0x135eec[_0x768e('0x29')]!==_0x768e('0x38')){var _0x2d4e03={};_0x2d4e03[_0x135eec[_0x768e('0x24')]]={'$like':'%'+_0x4fde11[_0x768e('0x2d')][_0x768e('0x36')]+'%'};return _0x2d4e03;}})});}_0x328aff=_[_0x768e('0x39')]({},_0x328aff,_0x4fde11[_0x768e('0x3a')]);var _0x3339fb={'where':_0x328aff[_0x768e('0x37')]};return db['SugarcrmField'][_0x768e('0x18')](_0x3339fb)['then'](function(_0x2ba514){_0x5d9547[_0x768e('0x18')]=_0x2ba514;if(_0x4fde11[_0x768e('0x2d')][_0x768e('0x3b')]){_0x328aff[_0x768e('0x3c')]=[{'all':!![]}];}return db[_0x768e('0x26')]['findAll'](_0x328aff);})['then'](function(_0x2d8746){_0x5d9547[_0x768e('0x3d')]=_0x2d8746;return _0x5d9547;})[_0x768e('0x21')](respondWithFilteredResult(_0x83778a,_0x328aff))[_0x768e('0x3e')](handleError(_0x83778a,null));};exports['show']=function(_0x1a28c8,_0x5cb8f1){var _0x5b27d5={'raw':!![],'where':{'id':_0x1a28c8[_0x768e('0x3f')]['id']}},_0x852c62={};_0x852c62[_0x768e('0x2b')]=_[_0x768e('0x40')](db[_0x768e('0x26')][_0x768e('0x27')]);_0x852c62[_0x768e('0x2d')]=_[_0x768e('0x40')](_0x1a28c8[_0x768e('0x2d')]);_0x852c62[_0x768e('0x2e')]=_[_0x768e('0x2f')](_0x852c62['model'],_0x852c62[_0x768e('0x2d')]);_0x5b27d5[_0x768e('0x30')]=_[_0x768e('0x2f')](_0x852c62[_0x768e('0x2b')],qs[_0x768e('0x31')](_0x1a28c8[_0x768e('0x2d')]['fields']));_0x5b27d5['attributes']=_0x5b27d5[_0x768e('0x30')]['length']?_0x5b27d5[_0x768e('0x30')]:_0x852c62[_0x768e('0x2b')];if(_0x1a28c8[_0x768e('0x2d')][_0x768e('0x3b')]){_0x5b27d5['include']=[{'all':!![]}];}_0x5b27d5=_[_0x768e('0x39')]({},_0x5b27d5,_0x1a28c8[_0x768e('0x3a')]);return db[_0x768e('0x26')][_0x768e('0x41')](_0x5b27d5)['then'](handleEntityNotFound(_0x5cb8f1,null))[_0x768e('0x21')](respondWithResult(_0x5cb8f1,null))[_0x768e('0x3e')](handleError(_0x5cb8f1,null));};exports[_0x768e('0x42')]=function(_0x38025e,_0x2247f6){return db[_0x768e('0x26')][_0x768e('0x42')](_0x38025e['body'],{})['then'](respondWithResult(_0x2247f6,0xc9))[_0x768e('0x3e')](handleError(_0x2247f6,null));};exports[_0x768e('0x20')]=function(_0x107f37,_0x426dd2){if(_0x107f37[_0x768e('0x43')]['id']){delete _0x107f37[_0x768e('0x43')]['id'];}return db[_0x768e('0x26')]['find']({'where':{'id':_0x107f37[_0x768e('0x3f')]['id']}})[_0x768e('0x21')](handleEntityNotFound(_0x426dd2,null))[_0x768e('0x21')](saveUpdates(_0x107f37[_0x768e('0x43')],null))[_0x768e('0x21')](respondWithResult(_0x426dd2,null))[_0x768e('0x3e')](handleError(_0x426dd2,null));};exports[_0x768e('0x22')]=function(_0x33a46d,_0xf2a0b){return db[_0x768e('0x26')][_0x768e('0x41')]({'where':{'id':_0x33a46d['params']['id']}})[_0x768e('0x21')](handleEntityNotFound(_0xf2a0b,null))[_0x768e('0x21')](removeEntity(_0xf2a0b,null))[_0x768e('0x3e')](handleError(_0xf2a0b,null));}; \ No newline at end of file +var _0x0b8a=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','SugarcrmField','includeAll','include','rows','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x40dd56,_0x726ca5){var _0x4f850f=function(_0x5f899e){while(--_0x5f899e){_0x40dd56['push'](_0x40dd56['shift']());}};_0x4f850f(++_0x726ca5);}(_0x0b8a,0x1eb));var _0xa0b8=function(_0x406c75,_0xc45d1c){_0x406c75=_0x406c75-0x0;var _0x3c1579=_0x0b8a[_0x406c75];return _0x3c1579;};'use strict';var emlformat=require(_0xa0b8('0x0'));var rimraf=require(_0xa0b8('0x1'));var zipdir=require(_0xa0b8('0x2'));var jsonpatch=require(_0xa0b8('0x3'));var rp=require(_0xa0b8('0x4'));var moment=require(_0xa0b8('0x5'));var BPromise=require(_0xa0b8('0x6'));var Mustache=require('mustache');var util=require(_0xa0b8('0x7'));var path=require(_0xa0b8('0x8'));var sox=require(_0xa0b8('0x9'));var csv=require('to-csv');var ejs=require(_0xa0b8('0xa'));var fs=require('fs');var fs_extra=require(_0xa0b8('0xb'));var _=require(_0xa0b8('0xc'));var squel=require(_0xa0b8('0xd'));var crypto=require(_0xa0b8('0xe'));var jsforce=require(_0xa0b8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa0b8('0x10'));var querystring=require(_0xa0b8('0x11'));var Papa=require(_0xa0b8('0x12'));var Redis=require('ioredis');var authService=require(_0xa0b8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa0b8('0x14'));var hardwareService=require(_0xa0b8('0x15'));var logger=require(_0xa0b8('0x16'))(_0xa0b8('0x17'));var utils=require('../../config/utils');var config=require(_0xa0b8('0x18'));var licenseUtil=require(_0xa0b8('0x19'));var db=require(_0xa0b8('0x1a'))['db'];function respondWithStatusCode(_0x4b8817,_0x37388a){_0x37388a=_0x37388a||0xcc;return function(_0x270676){if(_0x270676){return _0x4b8817[_0xa0b8('0x1b')](_0x37388a);}return _0x4b8817[_0xa0b8('0x1c')](_0x37388a)[_0xa0b8('0x1d')]();};}function respondWithResult(_0x6f2cfe,_0x5d862f){_0x5d862f=_0x5d862f||0xc8;return function(_0x2ca27f){if(_0x2ca27f){return _0x6f2cfe[_0xa0b8('0x1c')](_0x5d862f)[_0xa0b8('0x1e')](_0x2ca27f);}};}function respondWithFilteredResult(_0xd6ce4,_0x495976){return function(_0x2b9121){if(_0x2b9121){var _0x4d96e7=typeof _0x495976[_0xa0b8('0x1f')]==='undefined'&&typeof _0x495976[_0xa0b8('0x20')]===_0xa0b8('0x21');var _0x37883f=_0x2b9121[_0xa0b8('0x22')];var _0x5cecaf=_0x4d96e7?0x0:_0x495976[_0xa0b8('0x1f')];var _0x3b2bf1=_0x4d96e7?_0x2b9121[_0xa0b8('0x22')]:_0x495976[_0xa0b8('0x1f')]+_0x495976[_0xa0b8('0x20')];var _0x11dc62;if(_0x3b2bf1>=_0x37883f){_0x3b2bf1=_0x37883f;_0x11dc62=0xc8;}else{_0x11dc62=0xce;}_0xd6ce4[_0xa0b8('0x1c')](_0x11dc62);return _0xd6ce4['set'](_0xa0b8('0x23'),_0x5cecaf+'-'+_0x3b2bf1+'/'+_0x37883f)[_0xa0b8('0x1e')](_0x2b9121);}return null;};}function patchUpdates(_0x22dcc3){return function(_0x3cfa16){try{jsonpatch[_0xa0b8('0x24')](_0x3cfa16,_0x22dcc3,!![]);}catch(_0x504100){return BPromise[_0xa0b8('0x25')](_0x504100);}return _0x3cfa16[_0xa0b8('0x26')]();};}function saveUpdates(_0x43336d,_0x1d824c){return function(_0x4b67d5){if(_0x4b67d5){return _0x4b67d5[_0xa0b8('0x27')](_0x43336d)[_0xa0b8('0x28')](function(_0x2254ed){return _0x2254ed;});}return null;};}function removeEntity(_0x3a93dd,_0x559e40){return function(_0x4d762f){if(_0x4d762f){return _0x4d762f[_0xa0b8('0x29')]()[_0xa0b8('0x28')](function(){_0x3a93dd[_0xa0b8('0x1c')](0xcc)[_0xa0b8('0x1d')]();});}};}function handleEntityNotFound(_0x2bf66f,_0x1dc0c0){return function(_0x2f6cc1){if(!_0x2f6cc1){_0x2bf66f[_0xa0b8('0x1b')](0x194);}return _0x2f6cc1;};}function handleError(_0x31e23c,_0x2610a9){_0x2610a9=_0x2610a9||0x1f4;return function(_0x46fa89){logger[_0xa0b8('0x2a')](_0x46fa89[_0xa0b8('0x2b')]);if(_0x46fa89[_0xa0b8('0x2c')]){delete _0x46fa89['name'];}_0x31e23c['status'](_0x2610a9)[_0xa0b8('0x2d')](_0x46fa89);};}exports[_0xa0b8('0x2e')]=function(_0x299fb1,_0x326a2c){var _0x23c179={},_0x5da1d3={},_0x9a88={'count':0x0,'rows':[]};var _0x291f50=_[_0xa0b8('0x2f')](db['SugarcrmField'][_0xa0b8('0x30')],function(_0x151262){return{'name':_0x151262[_0xa0b8('0x31')],'type':_0x151262[_0xa0b8('0x32')][_0xa0b8('0x33')]};});_0x5da1d3['model']=_[_0xa0b8('0x2f')](_0x291f50,'name');_0x5da1d3[_0xa0b8('0x34')]=_[_0xa0b8('0x35')](_0x299fb1['query']);_0x5da1d3[_0xa0b8('0x36')]=_[_0xa0b8('0x37')](_0x5da1d3['model'],_0x5da1d3[_0xa0b8('0x34')]);_0x23c179[_0xa0b8('0x38')]=_['intersection'](_0x5da1d3[_0xa0b8('0x39')],qs['fields'](_0x299fb1[_0xa0b8('0x34')][_0xa0b8('0x3a')]));_0x23c179[_0xa0b8('0x38')]=_0x23c179['attributes'][_0xa0b8('0x3b')]?_0x23c179[_0xa0b8('0x38')]:_0x5da1d3['model'];if(!_0x299fb1['query'][_0xa0b8('0x3c')](_0xa0b8('0x3d'))){_0x23c179[_0xa0b8('0x20')]=qs[_0xa0b8('0x20')](_0x299fb1[_0xa0b8('0x34')][_0xa0b8('0x20')]);_0x23c179[_0xa0b8('0x1f')]=qs[_0xa0b8('0x1f')](_0x299fb1['query'][_0xa0b8('0x1f')]);}_0x23c179[_0xa0b8('0x3e')]=qs[_0xa0b8('0x3f')](_0x299fb1['query'][_0xa0b8('0x3f')]);_0x23c179[_0xa0b8('0x40')]=qs[_0xa0b8('0x36')](_[_0xa0b8('0x41')](_0x299fb1[_0xa0b8('0x34')],_0x5da1d3['filters']),_0x291f50);if(_0x299fb1[_0xa0b8('0x34')][_0xa0b8('0x42')]){_0x23c179[_0xa0b8('0x40')]=_['merge'](_0x23c179[_0xa0b8('0x40')],{'$or':_['map'](_0x291f50,function(_0x3c6189){if(_0x3c6189[_0xa0b8('0x32')]!=='VIRTUAL'){var _0x3dac46={};_0x3dac46[_0x3c6189[_0xa0b8('0x2c')]]={'$like':'%'+_0x299fb1[_0xa0b8('0x34')]['filter']+'%'};return _0x3dac46;}})});}_0x23c179=_['merge']({},_0x23c179,_0x299fb1[_0xa0b8('0x43')]);var _0x2de71f={'where':_0x23c179[_0xa0b8('0x40')]};return db[_0xa0b8('0x44')][_0xa0b8('0x22')](_0x2de71f)[_0xa0b8('0x28')](function(_0x1af79e){_0x9a88['count']=_0x1af79e;if(_0x299fb1[_0xa0b8('0x34')][_0xa0b8('0x45')]){_0x23c179[_0xa0b8('0x46')]=[{'all':!![]}];}return db[_0xa0b8('0x44')]['findAll'](_0x23c179);})[_0xa0b8('0x28')](function(_0x474027){_0x9a88[_0xa0b8('0x47')]=_0x474027;return _0x9a88;})[_0xa0b8('0x28')](respondWithFilteredResult(_0x326a2c,_0x23c179))['catch'](handleError(_0x326a2c,null));};exports['show']=function(_0x1d1df1,_0x231fa2){var _0x5076b9={'raw':!![],'where':{'id':_0x1d1df1['params']['id']}},_0x5eeed0={};_0x5eeed0['model']=_[_0xa0b8('0x35')](db[_0xa0b8('0x44')][_0xa0b8('0x30')]);_0x5eeed0[_0xa0b8('0x34')]=_['keys'](_0x1d1df1[_0xa0b8('0x34')]);_0x5eeed0[_0xa0b8('0x36')]=_['intersection'](_0x5eeed0[_0xa0b8('0x39')],_0x5eeed0[_0xa0b8('0x34')]);_0x5076b9[_0xa0b8('0x38')]=_['intersection'](_0x5eeed0['model'],qs[_0xa0b8('0x3a')](_0x1d1df1[_0xa0b8('0x34')][_0xa0b8('0x3a')]));_0x5076b9[_0xa0b8('0x38')]=_0x5076b9[_0xa0b8('0x38')][_0xa0b8('0x3b')]?_0x5076b9[_0xa0b8('0x38')]:_0x5eeed0[_0xa0b8('0x39')];if(_0x1d1df1[_0xa0b8('0x34')][_0xa0b8('0x45')]){_0x5076b9[_0xa0b8('0x46')]=[{'all':!![]}];}_0x5076b9=_['merge']({},_0x5076b9,_0x1d1df1[_0xa0b8('0x43')]);return db[_0xa0b8('0x44')][_0xa0b8('0x48')](_0x5076b9)[_0xa0b8('0x28')](handleEntityNotFound(_0x231fa2,null))['then'](respondWithResult(_0x231fa2,null))[_0xa0b8('0x49')](handleError(_0x231fa2,null));};exports['create']=function(_0x29657f,_0x5784f8){return db[_0xa0b8('0x44')][_0xa0b8('0x4a')](_0x29657f['body'],{})[_0xa0b8('0x28')](respondWithResult(_0x5784f8,0xc9))[_0xa0b8('0x49')](handleError(_0x5784f8,null));};exports[_0xa0b8('0x27')]=function(_0x397b3a,_0x27a410){if(_0x397b3a[_0xa0b8('0x4b')]['id']){delete _0x397b3a[_0xa0b8('0x4b')]['id'];}return db[_0xa0b8('0x44')][_0xa0b8('0x48')]({'where':{'id':_0x397b3a[_0xa0b8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x27a410,null))[_0xa0b8('0x28')](saveUpdates(_0x397b3a[_0xa0b8('0x4b')],null))[_0xa0b8('0x28')](respondWithResult(_0x27a410,null))[_0xa0b8('0x49')](handleError(_0x27a410,null));};exports[_0xa0b8('0x29')]=function(_0x4d858d,_0x5a6292){return db['SugarcrmField'][_0xa0b8('0x48')]({'where':{'id':_0x4d858d[_0xa0b8('0x4c')]['id']}})[_0xa0b8('0x28')](handleEntityNotFound(_0x5a6292,null))[_0xa0b8('0x28')](removeEntity(_0x5a6292,null))[_0xa0b8('0x49')](handleError(_0x5a6292,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 4b147ce..1f2753b 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 _0x0d1f=['request-promise','path','../../config/environment','exports','define','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x57c155,_0x330013){var _0x280058=function(_0x1cc3da){while(--_0x1cc3da){_0x57c155['push'](_0x57c155['shift']());}};_0x280058(++_0x330013);}(_0x0d1f,0x1f2));var _0xf0d1=function(_0x150aef,_0xb74cf6){_0x150aef=_0x150aef-0x0;var _0x254a5e=_0x0d1f[_0x150aef];return _0x254a5e;};'use strict';var _=require(_0xf0d1('0x0'));var util=require(_0xf0d1('0x1'));var logger=require(_0xf0d1('0x2'))(_0xf0d1('0x3'));var moment=require(_0xf0d1('0x4'));var BPromise=require(_0xf0d1('0x5'));var rp=require(_0xf0d1('0x6'));var fs=require('fs');var path=require(_0xf0d1('0x7'));var rimraf=require('rimraf');var config=require(_0xf0d1('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0xf0d1('0x9')]=function(_0x222ebb,_0x4e8a75){return _0x222ebb[_0xf0d1('0xa')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xf0d1('0xb'),'fields':[_0xf0d1('0xc'),_0xf0d1('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7651=['exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7651,0xd0));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1765('0x0'));var util=require('util');var logger=require(_0x1765('0x1'))(_0x1765('0x2'));var moment=require(_0x1765('0x3'));var BPromise=require(_0x1765('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1765('0x5'));var rimraf=require(_0x1765('0x6'));var config=require(_0x1765('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x1765('0x8')]=function(_0x53b023,_0x40e961){return _0x53b023['define'](_0x1765('0x9'),attributes,{'tableName':_0x1765('0xa'),'paranoid':![],'indexes':[{'name':_0x1765('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index d4a2b69..363bc5f 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 _0x54d0=['request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http'];(function(_0x257ed6,_0x58fb1f){var _0x38b3c9=function(_0x2038bc){while(--_0x2038bc){_0x257ed6['push'](_0x257ed6['shift']());}};_0x38b3c9(++_0x58fb1f);}(_0x54d0,0x110));var _0x054d=function(_0x30fe8c,_0x272cb9){_0x30fe8c=_0x30fe8c-0x0;var _0x4f1068=_0x54d0[_0x30fe8c];return _0x4f1068;};'use strict';var _=require('lodash');var util=require(_0x054d('0x0'));var moment=require('moment');var BPromise=require(_0x054d('0x1'));var rs=require(_0x054d('0x2'));var fs=require('fs');var Redis=require(_0x054d('0x3'));var db=require(_0x054d('0x4'))['db'];var utils=require(_0x054d('0x5'));var logger=require('../../config/logger')(_0x054d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x054d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52dac4,_0x5970d3,_0x3ad187){return new BPromise(function(_0xc108e4,_0x529d28){return client[_0x054d('0x8')](_0x52dac4,_0x3ad187)[_0x054d('0x9')](function(_0x55de85){logger[_0x054d('0xa')](_0x054d('0xb'),_0x5970d3,'request\x20sent');logger['debug'](_0x054d('0xc'),_0x5970d3,_0x054d('0xd'),JSON[_0x054d('0xe')](_0x55de85));if(_0x55de85[_0x054d('0xf')]){if(_0x55de85[_0x054d('0xf')][_0x054d('0x10')]===0x1f4){logger[_0x054d('0xf')](_0x054d('0xb'),_0x5970d3,_0x55de85[_0x054d('0xf')][_0x054d('0x11')]);return _0x529d28(_0x55de85['error'][_0x054d('0x11')]);}logger[_0x054d('0xf')](_0x054d('0xb'),_0x5970d3,_0x55de85['error'][_0x054d('0x11')]);return _0xc108e4(_0x55de85[_0x054d('0xf')][_0x054d('0x11')]);}else{logger[_0x054d('0xa')](_0x054d('0xb'),_0x5970d3,_0x054d('0xd'));_0xc108e4(_0x55de85[_0x054d('0x12')]['message']);}})[_0x054d('0x13')](function(_0x572f47){logger[_0x054d('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x5970d3,_0x572f47);_0x529d28(_0x572f47);});});} \ No newline at end of file +var _0x97e4=['info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2920dd,_0x19d049){var _0x5d4e52=function(_0x46c751){while(--_0x46c751){_0x2920dd['push'](_0x2920dd['shift']());}};_0x5d4e52(++_0x19d049);}(_0x97e4,0x182));var _0x497e=function(_0x1be7fd,_0x51ff5a){_0x1be7fd=_0x1be7fd-0x0;var _0x2f7949=_0x97e4[_0x1be7fd];return _0x2f7949;};'use strict';var _=require(_0x497e('0x0'));var util=require('util');var moment=require(_0x497e('0x1'));var BPromise=require(_0x497e('0x2'));var rs=require(_0x497e('0x3'));var fs=require('fs');var Redis=require(_0x497e('0x4'));var db=require(_0x497e('0x5'))['db'];var utils=require(_0x497e('0x6'));var logger=require(_0x497e('0x7'))('rpc');var config=require(_0x497e('0x8'));var jayson=require(_0x497e('0x9'));var client=jayson[_0x497e('0xa')][_0x497e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282a97,_0xd8ffba,_0x44b683){return new BPromise(function(_0x43eaac,_0x1cd99c){return client[_0x497e('0xc')](_0x282a97,_0x44b683)[_0x497e('0xd')](function(_0x518a30){logger[_0x497e('0xe')](_0x497e('0xf'),_0xd8ffba,_0x497e('0x10'));logger[_0x497e('0x11')](_0x497e('0x12'),_0xd8ffba,_0x497e('0x10'),JSON[_0x497e('0x13')](_0x518a30));if(_0x518a30[_0x497e('0x14')]){if(_0x518a30['error'][_0x497e('0x15')]===0x1f4){logger[_0x497e('0x14')]('SugarcrmField,\x20%s,\x20%s',_0xd8ffba,_0x518a30[_0x497e('0x14')][_0x497e('0x16')]);return _0x1cd99c(_0x518a30[_0x497e('0x14')]['message']);}logger['error'](_0x497e('0xf'),_0xd8ffba,_0x518a30[_0x497e('0x14')][_0x497e('0x16')]);return _0x43eaac(_0x518a30[_0x497e('0x14')]['message']);}else{logger[_0x497e('0xe')](_0x497e('0xf'),_0xd8ffba,_0x497e('0x10'));_0x43eaac(_0x518a30[_0x497e('0x17')][_0x497e('0x16')]);}})[_0x497e('0x18')](function(_0x3deb2f){logger[_0x497e('0x14')](_0x497e('0xf'),_0xd8ffba,_0x3deb2f);_0x1cd99c(_0x3deb2f);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index f0df569..d37a73a 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 _0xc7a4=['/:id/fields','getFields','create','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x35201e,_0x34341b){var _0x4bc5b7=function(_0x504ba7){while(--_0x504ba7){_0x35201e['push'](_0x35201e['shift']());}};_0x4bc5b7(++_0x34341b);}(_0xc7a4,0x8b));var _0x4c7a=function(_0x12d62d,_0x2a5973){_0x12d62d=_0x12d62d-0x0;var _0x667cc6=_0xc7a4[_0x12d62d];return _0x667cc6;};'use strict';var multer=require(_0x4c7a('0x0'));var util=require(_0x4c7a('0x1'));var path=require(_0x4c7a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c7a('0x3')]();var fs_extra=require(_0x4c7a('0x4'));var auth=require(_0x4c7a('0x5'));var interaction=require(_0x4c7a('0x6'));var config=require(_0x4c7a('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x4c7a('0x8')]('/',auth[_0x4c7a('0x9')](),controller[_0x4c7a('0xa')]);router[_0x4c7a('0x8')](_0x4c7a('0xb'),auth['isAuthenticated'](),controller[_0x4c7a('0xc')]);router['get'](_0x4c7a('0xd'),auth['isAuthenticated'](),controller[_0x4c7a('0xe')]);router[_0x4c7a('0x8')](_0x4c7a('0xf'),auth[_0x4c7a('0x9')](),controller[_0x4c7a('0x10')]);router['post']('/',auth[_0x4c7a('0x9')](),controller[_0x4c7a('0x11')]);router['post'](_0x4c7a('0xd'),auth[_0x4c7a('0x9')](),controller['addConfiguration']);router[_0x4c7a('0x12')](_0x4c7a('0xb'),auth[_0x4c7a('0x9')](),controller[_0x4c7a('0x13')]);router[_0x4c7a('0x14')](_0x4c7a('0xb'),auth['isAuthenticated'](),controller[_0x4c7a('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa378=['../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','/:id','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa378,0xb9));var _0x8a37=function(_0x529570,_0x5c3c18){_0x529570=_0x529570-0x0;var _0x7b2bc8=_0xa378[_0x529570];return _0x7b2bc8;};'use strict';var multer=require(_0x8a37('0x0'));var util=require(_0x8a37('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8a37('0x2'));var router=express[_0x8a37('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8a37('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8a37('0x5'));var controller=require(_0x8a37('0x6'));router[_0x8a37('0x7')]('/',auth[_0x8a37('0x8')](),controller['index']);router[_0x8a37('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8a37('0x9')]);router[_0x8a37('0x7')]('/:id/configurations',auth[_0x8a37('0x8')](),controller[_0x8a37('0xa')]);router['get'](_0x8a37('0xb'),auth[_0x8a37('0x8')](),controller['getFields']);router[_0x8a37('0xc')]('/',auth[_0x8a37('0x8')](),controller['create']);router[_0x8a37('0xc')]('/:id/configurations',auth[_0x8a37('0x8')](),controller[_0x8a37('0xd')]);router[_0x8a37('0xe')]('/:id',auth[_0x8a37('0x8')](),controller[_0x8a37('0xf')]);router[_0x8a37('0x10')](_0x8a37('0x11'),auth[_0x8a37('0x8')](),controller['destroy']);module[_0x8a37('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index a42ea1a..eb43f55 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 _0x923e=['exports','STRING','sequelize'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x923e,0x1e5));var _0xe923=function(_0x2c9b50,_0xec89fe){_0x2c9b50=_0x2c9b50-0x0;var _0xb849fc=_0x923e[_0x2c9b50];return _0xb849fc;};'use strict';var Sequelize=require(_0xe923('0x0'));module[_0xe923('0x1')]={'name':{'type':Sequelize[_0xe923('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe923('0x2')]},'username':{'type':Sequelize[_0xe923('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe923('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xe923('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe923('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe923('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x10ba=['exports','STRING','HelpDesk'];(function(_0x42ca78,_0x218a65){var _0x131b6e=function(_0x1587f1){while(--_0x1587f1){_0x42ca78['push'](_0x42ca78['shift']());}};_0x131b6e(++_0x218a65);}(_0x10ba,0x14a));var _0xa10b=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x10ba[_0x342baa];return _0x1208f3;};'use strict';var Sequelize=require('sequelize');module[_0xa10b('0x0')]={'name':{'type':Sequelize[_0xa10b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa10b('0x1')]},'username':{'type':Sequelize[_0xa10b('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xa10b('0x1')],'allowNull':![],'defaultValue':_0xa10b('0x2')},'remoteUri':{'type':Sequelize[_0xa10b('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 3c7edf3..6b59c24 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 _0xfbfa=['reference','owner','includes','editable','false','label','startsWith','picklistValues','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','VtigerAccount','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','update','getConfigurations','findOne','VtigerConfiguration','rawAttributes','pick','options','getSubjects','channel','Descriptions','VtigerField','Subjects','md5','getFields','username','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','GET','success','POST','result','token','describe','sessionName','autogenerated'];(function(_0x1c86d1,_0x2464d4){var _0x2085ec=function(_0x3e5d58){while(--_0x3e5d58){_0x1c86d1['push'](_0x1c86d1['shift']());}};_0x2085ec(++_0x2464d4);}(_0xfbfa,0x89));var _0xafbf=function(_0x45a572,_0x540519){_0x45a572=_0x45a572-0x0;var _0x54442e=_0xfbfa[_0x45a572];return _0x54442e;};'use strict';var emlformat=require(_0xafbf('0x0'));var rimraf=require(_0xafbf('0x1'));var zipdir=require(_0xafbf('0x2'));var jsonpatch=require(_0xafbf('0x3'));var rp=require(_0xafbf('0x4'));var moment=require(_0xafbf('0x5'));var BPromise=require(_0xafbf('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xafbf('0x7'));var sox=require(_0xafbf('0x8'));var csv=require(_0xafbf('0x9'));var ejs=require(_0xafbf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafbf('0xb'));var squel=require(_0xafbf('0xc'));var crypto=require('crypto');var jsforce=require(_0xafbf('0xd'));var deskjs=require(_0xafbf('0xe'));var toCsv=require(_0xafbf('0x9'));var querystring=require(_0xafbf('0xf'));var Papa=require(_0xafbf('0x10'));var Redis=require(_0xafbf('0x11'));var authService=require(_0xafbf('0x12'));var qs=require(_0xafbf('0x13'));var as=require(_0xafbf('0x14'));var hardwareService=require(_0xafbf('0x15'));var logger=require(_0xafbf('0x16'))(_0xafbf('0x17'));var utils=require(_0xafbf('0x18'));var config=require(_0xafbf('0x19'));var licenseUtil=require(_0xafbf('0x1a'));var db=require(_0xafbf('0x1b'))['db'];var integrations=require(_0xafbf('0x1c'));function respondWithStatusCode(_0x243af8,_0x49f55f){_0x49f55f=_0x49f55f||0xcc;return function(_0x53bb41){if(_0x53bb41){return _0x243af8[_0xafbf('0x1d')](_0x49f55f);}return _0x243af8[_0xafbf('0x1e')](_0x49f55f)['end']();};}function respondWithResult(_0x53212d,_0x482eb8){_0x482eb8=_0x482eb8||0xc8;return function(_0x4e8830){if(_0x4e8830){return _0x53212d[_0xafbf('0x1e')](_0x482eb8)[_0xafbf('0x1f')](_0x4e8830);}};}function respondWithFilteredResult(_0xf21b85,_0x119f5e){return function(_0x47864f){if(_0x47864f){var _0x68ae9d=typeof _0x119f5e[_0xafbf('0x20')]===_0xafbf('0x21')&&typeof _0x119f5e[_0xafbf('0x22')]==='undefined';var _0xcf6fea=_0x47864f['count'];var _0x43d04d=_0x68ae9d?0x0:_0x119f5e[_0xafbf('0x20')];var _0x4930da=_0x68ae9d?_0x47864f[_0xafbf('0x23')]:_0x119f5e['offset']+_0x119f5e[_0xafbf('0x22')];var _0x506201;if(_0x4930da>=_0xcf6fea){_0x4930da=_0xcf6fea;_0x506201=0xc8;}else{_0x506201=0xce;}_0xf21b85[_0xafbf('0x1e')](_0x506201);return _0xf21b85[_0xafbf('0x24')](_0xafbf('0x25'),_0x43d04d+'-'+_0x4930da+'/'+_0xcf6fea)[_0xafbf('0x1f')](_0x47864f);}return null;};}function patchUpdates(_0x44d86e){return function(_0x3f2c25){try{jsonpatch[_0xafbf('0x26')](_0x3f2c25,_0x44d86e,!![]);}catch(_0x1eba2e){return BPromise[_0xafbf('0x27')](_0x1eba2e);}return _0x3f2c25[_0xafbf('0x28')]();};}function saveUpdates(_0x47cb2f,_0x55fbd1){return function(_0x9ddf69){if(_0x9ddf69){return _0x9ddf69['update'](_0x47cb2f)[_0xafbf('0x29')](function(_0x456a28){return _0x456a28;});}return null;};}function removeEntity(_0x432007,_0x1bd8d6){return function(_0xe027db){if(_0xe027db){return _0xe027db[_0xafbf('0x2a')]()[_0xafbf('0x29')](function(){_0x432007[_0xafbf('0x1e')](0xcc)[_0xafbf('0x2b')]();});}};}function handleEntityNotFound(_0x3ff8f8,_0x148672){return function(_0x5dd851){if(!_0x5dd851){_0x3ff8f8[_0xafbf('0x1d')](0x194);}return _0x5dd851;};}function handleError(_0x14b3e8,_0x119e0f){_0x119e0f=_0x119e0f||0x1f4;return function(_0x29df90){logger[_0xafbf('0x2c')](_0x29df90[_0xafbf('0x2d')]);if(_0x29df90[_0xafbf('0x2e')]){delete _0x29df90['name'];}_0x14b3e8[_0xafbf('0x1e')](_0x119e0f)[_0xafbf('0x2f')](_0x29df90);};}exports[_0xafbf('0x30')]=function(_0x422fd5,_0x2c75c6){var _0x3d3bdd={},_0x5ec47b={},_0x126924={'count':0x0,'rows':[]};var _0x30f65c=_['map'](db[_0xafbf('0x31')]['rawAttributes'],function(_0x446b9f){return{'name':_0x446b9f[_0xafbf('0x32')],'type':_0x446b9f['type'][_0xafbf('0x33')]};});_0x5ec47b[_0xafbf('0x34')]=_[_0xafbf('0x35')](_0x30f65c,_0xafbf('0x2e'));_0x5ec47b[_0xafbf('0x36')]=_[_0xafbf('0x37')](_0x422fd5[_0xafbf('0x36')]);_0x5ec47b[_0xafbf('0x38')]=_[_0xafbf('0x39')](_0x5ec47b[_0xafbf('0x34')],_0x5ec47b[_0xafbf('0x36')]);_0x3d3bdd[_0xafbf('0x3a')]=_['intersection'](_0x5ec47b[_0xafbf('0x34')],qs[_0xafbf('0x3b')](_0x422fd5[_0xafbf('0x36')][_0xafbf('0x3b')]));_0x3d3bdd[_0xafbf('0x3a')]=_0x3d3bdd['attributes'][_0xafbf('0x3c')]?_0x3d3bdd['attributes']:_0x5ec47b[_0xafbf('0x34')];if(!_0x422fd5[_0xafbf('0x36')]['hasOwnProperty'](_0xafbf('0x3d'))){_0x3d3bdd[_0xafbf('0x22')]=qs[_0xafbf('0x22')](_0x422fd5[_0xafbf('0x36')][_0xafbf('0x22')]);_0x3d3bdd[_0xafbf('0x20')]=qs[_0xafbf('0x20')](_0x422fd5[_0xafbf('0x36')][_0xafbf('0x20')]);}_0x3d3bdd[_0xafbf('0x3e')]=qs['sort'](_0x422fd5[_0xafbf('0x36')][_0xafbf('0x3f')]);_0x3d3bdd[_0xafbf('0x40')]=qs['filters'](_['pick'](_0x422fd5[_0xafbf('0x36')],_0x5ec47b[_0xafbf('0x38')]),_0x30f65c);if(_0x422fd5[_0xafbf('0x36')][_0xafbf('0x41')]){_0x3d3bdd[_0xafbf('0x40')]=_[_0xafbf('0x42')](_0x3d3bdd['where'],{'$or':_[_0xafbf('0x35')](_0x30f65c,function(_0x1a2ae6){if(_0x1a2ae6[_0xafbf('0x43')]!==_0xafbf('0x44')){var _0x2b4b13={};_0x2b4b13[_0x1a2ae6[_0xafbf('0x2e')]]={'$like':'%'+_0x422fd5['query']['filter']+'%'};return _0x2b4b13;}})});}_0x3d3bdd=_[_0xafbf('0x42')]({},_0x3d3bdd,_0x422fd5['options']);var _0x4e8364={'where':_0x3d3bdd[_0xafbf('0x40')]};return db[_0xafbf('0x31')][_0xafbf('0x23')](_0x4e8364)[_0xafbf('0x29')](function(_0x576400){_0x126924['count']=_0x576400;if(_0x422fd5['query'][_0xafbf('0x45')]){_0x3d3bdd[_0xafbf('0x46')]=[{'all':!![]}];}return db[_0xafbf('0x31')][_0xafbf('0x47')](_0x3d3bdd);})[_0xafbf('0x29')](function(_0x121b74){_0x126924[_0xafbf('0x48')]=_0x121b74;return _0x126924;})['then'](respondWithFilteredResult(_0x2c75c6,_0x3d3bdd))[_0xafbf('0x49')](handleError(_0x2c75c6,null));};exports['show']=function(_0x43ec15,_0x1e40e8){var _0x1b6b36={'raw':![],'where':{'id':_0x43ec15[_0xafbf('0x4a')]['id']}},_0x5372e5={};_0x5372e5['model']=_[_0xafbf('0x37')](db['VtigerAccount']['rawAttributes']);_0x5372e5[_0xafbf('0x36')]=_[_0xafbf('0x37')](_0x43ec15[_0xafbf('0x36')]);_0x5372e5[_0xafbf('0x38')]=_[_0xafbf('0x39')](_0x5372e5[_0xafbf('0x34')],_0x5372e5[_0xafbf('0x36')]);_0x1b6b36[_0xafbf('0x3a')]=_[_0xafbf('0x39')](_0x5372e5[_0xafbf('0x34')],qs[_0xafbf('0x3b')](_0x43ec15[_0xafbf('0x36')][_0xafbf('0x3b')]));_0x1b6b36[_0xafbf('0x3a')]=_0x1b6b36[_0xafbf('0x3a')]['length']?_0x1b6b36[_0xafbf('0x3a')]:_0x5372e5['model'];if(_0x43ec15[_0xafbf('0x36')][_0xafbf('0x45')]){_0x1b6b36[_0xafbf('0x46')]=[{'all':!![]}];}_0x1b6b36=_[_0xafbf('0x42')]({},_0x1b6b36,_0x43ec15['options']);return db[_0xafbf('0x31')][_0xafbf('0x4b')](_0x1b6b36)[_0xafbf('0x29')](handleEntityNotFound(_0x1e40e8,null))['then'](respondWithResult(_0x1e40e8,null))['catch'](handleError(_0x1e40e8,null));};exports[_0xafbf('0x4c')]=function(_0x21d233,_0x438013){return db[_0xafbf('0x31')][_0xafbf('0x4c')](_0x21d233[_0xafbf('0x4d')],{})[_0xafbf('0x29')](respondWithResult(_0x438013,0xc9))[_0xafbf('0x49')](handleError(_0x438013,null));};exports[_0xafbf('0x4e')]=function(_0x5ec8f2,_0x52c361){if(_0x5ec8f2[_0xafbf('0x4d')]['id']){delete _0x5ec8f2[_0xafbf('0x4d')]['id'];}return db[_0xafbf('0x31')][_0xafbf('0x4b')]({'where':{'id':_0x5ec8f2['params']['id']}})['then'](handleEntityNotFound(_0x52c361,null))['then'](saveUpdates(_0x5ec8f2['body'],null))['then'](respondWithResult(_0x52c361,null))[_0xafbf('0x49')](handleError(_0x52c361,null));};exports[_0xafbf('0x2a')]=function(_0x2352e4,_0xc42018){return db['VtigerAccount'][_0xafbf('0x4b')]({'where':{'id':_0x2352e4[_0xafbf('0x4a')]['id']}})[_0xafbf('0x29')](handleEntityNotFound(_0xc42018,null))[_0xafbf('0x29')](removeEntity(_0xc42018,null))[_0xafbf('0x49')](handleError(_0xc42018,null));};exports[_0xafbf('0x4f')]=function(_0x6acb98,_0x5d0463,_0x362670){var _0x5a65af={};var _0x215b4e={};var _0x55812e;var _0x449787;return db['VtigerAccount'][_0xafbf('0x50')]({'where':{'id':_0x6acb98[_0xafbf('0x4a')]['id']}})[_0xafbf('0x29')](handleEntityNotFound(_0x5d0463,null))[_0xafbf('0x29')](function(_0x187eb3){if(_0x187eb3){_0x55812e=_0x187eb3;_0x215b4e['model']=_[_0xafbf('0x37')](db[_0xafbf('0x51')][_0xafbf('0x52')]);_0x215b4e[_0xafbf('0x36')]=_['keys'](_0x6acb98[_0xafbf('0x36')]);_0x215b4e[_0xafbf('0x38')]=_[_0xafbf('0x39')](_0x215b4e[_0xafbf('0x34')],_0x215b4e[_0xafbf('0x36')]);_0x5a65af['attributes']=_[_0xafbf('0x39')](_0x215b4e[_0xafbf('0x34')],qs[_0xafbf('0x3b')](_0x6acb98['query'][_0xafbf('0x3b')]));_0x5a65af['attributes']=_0x5a65af['attributes'][_0xafbf('0x3c')]?_0x5a65af['attributes']:_0x215b4e[_0xafbf('0x34')];_0x5a65af['order']=qs[_0xafbf('0x3f')](_0x6acb98[_0xafbf('0x36')][_0xafbf('0x3f')]);_0x5a65af['where']=qs[_0xafbf('0x38')](_[_0xafbf('0x53')](_0x6acb98['query'],_0x215b4e['filters']));if(_0x6acb98[_0xafbf('0x36')]['filter']){_0x5a65af[_0xafbf('0x40')]=_['merge'](_0x5a65af['where'],{'$or':_[_0xafbf('0x35')](_0x5a65af[_0xafbf('0x3a')],function(_0x38c40b){var _0x1a8460={};_0x1a8460[_0x38c40b]={'$like':'%'+_0x6acb98['query'][_0xafbf('0x41')]+'%'};return _0x1a8460;})});}_0x5a65af=_['merge']({},_0x5a65af,_0x6acb98[_0xafbf('0x54')]);return _0x55812e[_0xafbf('0x4f')](_0x5a65af);}})[_0xafbf('0x29')](function(_0x561eaf){if(_0x561eaf){_0x449787=_0x561eaf[_0xafbf('0x3c')];if(!_0x6acb98[_0xafbf('0x36')]['hasOwnProperty'](_0xafbf('0x3d'))){_0x5a65af[_0xafbf('0x22')]=qs[_0xafbf('0x22')](_0x6acb98[_0xafbf('0x36')][_0xafbf('0x22')]);_0x5a65af[_0xafbf('0x20')]=qs[_0xafbf('0x20')](_0x6acb98[_0xafbf('0x36')][_0xafbf('0x20')]);}return _0x55812e[_0xafbf('0x4f')](_0x5a65af);}})['then'](function(_0x58daa3){if(_0x58daa3){return _0x58daa3?{'count':_0x449787,'rows':_0x58daa3}:null;}})['then'](respondWithResult(_0x5d0463,null))[_0xafbf('0x49')](handleError(_0x5d0463,null));};exports['addConfiguration']=function(_0x1f1dbf,_0x127113,_0x58d07a){if(_0x1f1dbf[_0xafbf('0x4d')]['id']){delete _0x1f1dbf[_0xafbf('0x4d')]['id'];}return db[_0xafbf('0x31')]['findOne']({'where':{'id':_0x1f1dbf[_0xafbf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x127113,null))[_0xafbf('0x29')](function(_0x36b806){if(_0x36b806){_0x1f1dbf[_0xafbf('0x4d')]['AccountId']=_0x36b806['id'];_0x1f1dbf[_0xafbf('0x4d')]['Subjects']=integrations[_0xafbf('0x55')](_0x1f1dbf[_0xafbf('0x4d')][_0xafbf('0x56')],_0x1f1dbf[_0xafbf('0x4d')][_0xafbf('0x43')]);_0x1f1dbf['body'][_0xafbf('0x57')]=integrations['getDescriptions'](_0x1f1dbf[_0xafbf('0x4d')][_0xafbf('0x56')],_0x1f1dbf[_0xafbf('0x4d')][_0xafbf('0x43')]);return db[_0xafbf('0x51')]['create'](_0x1f1dbf[_0xafbf('0x4d')],{'include':[{'model':db[_0xafbf('0x58')],'as':_0xafbf('0x59')},{'model':db[_0xafbf('0x58')],'as':_0xafbf('0x57')}]});}return null;})[_0xafbf('0x29')](respondWithResult(_0x127113,null))[_0xafbf('0x49')](handleError(_0x127113,null));};var md5=require(_0xafbf('0x5a'));exports[_0xafbf('0x5b')]=function(_0x124033,_0x191fb2,_0x238806){var _0x5cdfba=null;var _0x135d2f=null;var _0x308d12=null;var _0x1ec801=null;var _0x2c9d43='';return db[_0xafbf('0x31')][_0xafbf('0x50')]({'where':{'id':_0x124033[_0xafbf('0x4a')]['id']},'attributes':['id','name',_0xafbf('0x5c'),'description',_0xafbf('0x5d'),_0xafbf('0x5e'),'serverUrl',_0xafbf('0x5f')]})[_0xafbf('0x29')](handleEntityNotFound(_0x191fb2,null))[_0xafbf('0x29')](function(_0x207ecf){if(_0x207ecf){_0x5cdfba=_0x207ecf[_0xafbf('0x5c')];_0x135d2f=_0x207ecf['accessKey'];_0x308d12=_0x207ecf[_0xafbf('0x5d')];_0x2c9d43=_0x207ecf[_0xafbf('0x5e')];var _0x5bbba1=_0x2c9d43[_0xafbf('0x60')](-0x1);if(_0x5bbba1==='/'){_0x2c9d43=_0x2c9d43[_0xafbf('0x61')](0x0,_0x2c9d43[_0xafbf('0x62')](_0x5bbba1));}_0x1ec801=util['format']('%s/webservice.php',_0x2c9d43);var _0x265b9d={'method':_0xafbf('0x63'),'uri':_0x1ec801,'qs':{'operation':'getchallenge','username':_0x207ecf[_0xafbf('0x5c')]},'json':!![]};return rp(_0x265b9d);}})[_0xafbf('0x29')](function(_0x5b910f){if(_0x5b910f[_0xafbf('0x64')]){var _0x3435a6={'method':_0xafbf('0x65'),'uri':_0x1ec801,'form':{'operation':'login','username':_0x5cdfba,'accessKey':md5(_0x5b910f[_0xafbf('0x66')][_0xafbf('0x67')]+_0x135d2f)},'json':!![]};return rp(_0x3435a6);}})['then'](function(_0xfe884d){if(_0xfe884d[_0xafbf('0x64')]){var _0x5c29e8={'method':_0xafbf('0x63'),'uri':_0x1ec801,'qs':{'operation':_0xafbf('0x68'),'username':_0x5cdfba,'sessionName':_0xfe884d[_0xafbf('0x66')][_0xafbf('0x69')],'elementType':_0x308d12},'json':!![]};return rp(_0x5c29e8);}})['then'](function(_0x2fc488){if(_0x2fc488[_0xafbf('0x64')]){var _0x4f8074=[_0xafbf('0x6a'),_0xafbf('0x6b'),_0xafbf('0x6c')];_['remove'](_0x2fc488[_0xafbf('0x66')]['fields'],function(_0x1f836c){return _0x4f8074[_0xafbf('0x6d')](_0x1f836c[_0xafbf('0x43')][_0xafbf('0x2e')]);});_['remove'](_0x2fc488[_0xafbf('0x66')][_0xafbf('0x3b')],function(_0x2f8e3b){return _0x2f8e3b[_0xafbf('0x6e')]===_0xafbf('0x6f');});return{'count':_0x2fc488[_0xafbf('0x66')][_0xafbf('0x3b')]['length'],'rows':_['map'](_0x2fc488[_0xafbf('0x66')][_0xafbf('0x3b')],function(_0x37d88f){return{'id':_0x37d88f[_0xafbf('0x2e')],'name':_0x37d88f[_0xafbf('0x70')],'custom':_[_0xafbf('0x71')](_0x37d88f[_0xafbf('0x2e')],'cf_')?!![]:![],'options':_0x37d88f[_0xafbf('0x43')][_0xafbf('0x2e')]==='picklist'&&_0x37d88f[_0xafbf('0x43')][_0xafbf('0x72')][_0xafbf('0x3c')]>0x0?_[_0xafbf('0x35')](_0x37d88f[_0xafbf('0x43')][_0xafbf('0x72')],function(_0x35187b){return{'name':_0x35187b[_0xafbf('0x70')],'value':_0x35187b['value']};}):[]};})};}})[_0xafbf('0x29')](respondWithResult(_0x191fb2,null))['catch'](function(_0x4a5cef){console[_0xafbf('0x73')](_0xafbf('0x74')+_0x4a5cef);var _0x22774b=_0x124033['query'][_0xafbf('0x75')]?0x1f4:_0x4a5cef[_0xafbf('0x76')]||0x1f4;logger[_0xafbf('0x2c')](_0xafbf('0x77'),_0xafbf('0x5b'),_0x22774b,JSON[_0xafbf('0x78')](_0x4a5cef));delete _0x4a5cef[_0xafbf('0x2e')];if(_0x22774b===0x191){_0x22774b=0x190;}_0x191fb2[_0xafbf('0x1e')](_0x22774b)[_0xafbf('0x2f')](_0x124033[_0xafbf('0x36')][_0xafbf('0x75')]?{'message':_0xafbf('0x79'),'statusCode':_0x4a5cef[_0xafbf('0x76')]}:_0x4a5cef);});}; \ No newline at end of file +var _0x8373=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VtigerAccount','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','findOne','VtigerConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','result','token','sessionName','autogenerated','reference','owner','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x4b36be,_0x2c72ba){var _0x5e1b78=function(_0x75ce77){while(--_0x75ce77){_0x4b36be['push'](_0x4b36be['shift']());}};_0x5e1b78(++_0x2c72ba);}(_0x8373,0xea));var _0x3837=function(_0x17f1bd,_0x5f5005){_0x17f1bd=_0x17f1bd-0x0;var _0x16bfaa=_0x8373[_0x17f1bd];return _0x16bfaa;};'use strict';var emlformat=require(_0x3837('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3837('0x1'));var jsonpatch=require(_0x3837('0x2'));var rp=require(_0x3837('0x3'));var moment=require('moment');var BPromise=require(_0x3837('0x4'));var Mustache=require(_0x3837('0x5'));var util=require('util');var path=require(_0x3837('0x6'));var sox=require(_0x3837('0x7'));var csv=require(_0x3837('0x8'));var ejs=require(_0x3837('0x9'));var fs=require('fs');var fs_extra=require(_0x3837('0xa'));var _=require(_0x3837('0xb'));var squel=require(_0x3837('0xc'));var crypto=require(_0x3837('0xd'));var jsforce=require(_0x3837('0xe'));var deskjs=require(_0x3837('0xf'));var toCsv=require(_0x3837('0x8'));var querystring=require(_0x3837('0x10'));var Papa=require('papaparse');var Redis=require(_0x3837('0x11'));var authService=require(_0x3837('0x12'));var qs=require(_0x3837('0x13'));var as=require(_0x3837('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3837('0x15'))(_0x3837('0x16'));var utils=require(_0x3837('0x17'));var config=require(_0x3837('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3837('0x19'));function respondWithStatusCode(_0x6068ec,_0x2b4993){_0x2b4993=_0x2b4993||0xcc;return function(_0x2612dd){if(_0x2612dd){return _0x6068ec['sendStatus'](_0x2b4993);}return _0x6068ec[_0x3837('0x1a')](_0x2b4993)[_0x3837('0x1b')]();};}function respondWithResult(_0x203bb3,_0x5bd7dc){_0x5bd7dc=_0x5bd7dc||0xc8;return function(_0x434e7d){if(_0x434e7d){return _0x203bb3[_0x3837('0x1a')](_0x5bd7dc)[_0x3837('0x1c')](_0x434e7d);}};}function respondWithFilteredResult(_0xe775a3,_0x69f5dd){return function(_0x40ab44){if(_0x40ab44){var _0xb12d33=typeof _0x69f5dd[_0x3837('0x1d')]===_0x3837('0x1e')&&typeof _0x69f5dd['limit']===_0x3837('0x1e');var _0x56a929=_0x40ab44[_0x3837('0x1f')];var _0x51b450=_0xb12d33?0x0:_0x69f5dd['offset'];var _0x121e52=_0xb12d33?_0x40ab44['count']:_0x69f5dd['offset']+_0x69f5dd[_0x3837('0x20')];var _0x2a67aa;if(_0x121e52>=_0x56a929){_0x121e52=_0x56a929;_0x2a67aa=0xc8;}else{_0x2a67aa=0xce;}_0xe775a3['status'](_0x2a67aa);return _0xe775a3[_0x3837('0x21')](_0x3837('0x22'),_0x51b450+'-'+_0x121e52+'/'+_0x56a929)['json'](_0x40ab44);}return null;};}function patchUpdates(_0x4f0f04){return function(_0x19deba){try{jsonpatch[_0x3837('0x23')](_0x19deba,_0x4f0f04,!![]);}catch(_0x249d87){return BPromise['reject'](_0x249d87);}return _0x19deba['save']();};}function saveUpdates(_0x3ccb1c,_0x18cfb0){return function(_0x1cb7d4){if(_0x1cb7d4){return _0x1cb7d4[_0x3837('0x24')](_0x3ccb1c)[_0x3837('0x25')](function(_0x59035f){return _0x59035f;});}return null;};}function removeEntity(_0x22c6e,_0x1f04d3){return function(_0x4c1d03){if(_0x4c1d03){return _0x4c1d03['destroy']()[_0x3837('0x25')](function(){_0x22c6e[_0x3837('0x1a')](0xcc)[_0x3837('0x1b')]();});}};}function handleEntityNotFound(_0x1c353f,_0x3f043c){return function(_0x4b2d05){if(!_0x4b2d05){_0x1c353f[_0x3837('0x26')](0x194);}return _0x4b2d05;};}function handleError(_0x2f8ea6,_0x503fca){_0x503fca=_0x503fca||0x1f4;return function(_0x16c0a5){logger[_0x3837('0x27')](_0x16c0a5[_0x3837('0x28')]);if(_0x16c0a5[_0x3837('0x29')]){delete _0x16c0a5['name'];}_0x2f8ea6[_0x3837('0x1a')](_0x503fca)[_0x3837('0x2a')](_0x16c0a5);};}exports[_0x3837('0x2b')]=function(_0x40dfe5,_0x294927){var _0x1e0ad1={},_0x30ef1c={},_0x2a4b89={'count':0x0,'rows':[]};var _0x10fb5a=_[_0x3837('0x2c')](db['VtigerAccount']['rawAttributes'],function(_0x4178f2){return{'name':_0x4178f2[_0x3837('0x2d')],'type':_0x4178f2[_0x3837('0x2e')][_0x3837('0x2f')]};});_0x30ef1c[_0x3837('0x30')]=_[_0x3837('0x2c')](_0x10fb5a,_0x3837('0x29'));_0x30ef1c[_0x3837('0x31')]=_[_0x3837('0x32')](_0x40dfe5[_0x3837('0x31')]);_0x30ef1c[_0x3837('0x33')]=_[_0x3837('0x34')](_0x30ef1c[_0x3837('0x30')],_0x30ef1c[_0x3837('0x31')]);_0x1e0ad1[_0x3837('0x35')]=_[_0x3837('0x34')](_0x30ef1c[_0x3837('0x30')],qs[_0x3837('0x36')](_0x40dfe5[_0x3837('0x31')]['fields']));_0x1e0ad1[_0x3837('0x35')]=_0x1e0ad1[_0x3837('0x35')][_0x3837('0x37')]?_0x1e0ad1[_0x3837('0x35')]:_0x30ef1c[_0x3837('0x30')];if(!_0x40dfe5[_0x3837('0x31')][_0x3837('0x38')](_0x3837('0x39'))){_0x1e0ad1[_0x3837('0x20')]=qs[_0x3837('0x20')](_0x40dfe5['query'][_0x3837('0x20')]);_0x1e0ad1['offset']=qs[_0x3837('0x1d')](_0x40dfe5[_0x3837('0x31')][_0x3837('0x1d')]);}_0x1e0ad1[_0x3837('0x3a')]=qs[_0x3837('0x3b')](_0x40dfe5['query'][_0x3837('0x3b')]);_0x1e0ad1[_0x3837('0x3c')]=qs['filters'](_[_0x3837('0x3d')](_0x40dfe5[_0x3837('0x31')],_0x30ef1c[_0x3837('0x33')]),_0x10fb5a);if(_0x40dfe5['query']['filter']){_0x1e0ad1['where']=_[_0x3837('0x3e')](_0x1e0ad1[_0x3837('0x3c')],{'$or':_[_0x3837('0x2c')](_0x10fb5a,function(_0x5d301d){if(_0x5d301d[_0x3837('0x2e')]!==_0x3837('0x3f')){var _0x33dffe={};_0x33dffe[_0x5d301d[_0x3837('0x29')]]={'$like':'%'+_0x40dfe5[_0x3837('0x31')][_0x3837('0x40')]+'%'};return _0x33dffe;}})});}_0x1e0ad1=_[_0x3837('0x3e')]({},_0x1e0ad1,_0x40dfe5[_0x3837('0x41')]);var _0x425ee2={'where':_0x1e0ad1[_0x3837('0x3c')]};return db[_0x3837('0x42')][_0x3837('0x1f')](_0x425ee2)[_0x3837('0x25')](function(_0xfab414){_0x2a4b89[_0x3837('0x1f')]=_0xfab414;if(_0x40dfe5[_0x3837('0x31')][_0x3837('0x43')]){_0x1e0ad1[_0x3837('0x44')]=[{'all':!![]}];}return db[_0x3837('0x42')][_0x3837('0x45')](_0x1e0ad1);})['then'](function(_0x574b4e){_0x2a4b89[_0x3837('0x46')]=_0x574b4e;return _0x2a4b89;})[_0x3837('0x25')](respondWithFilteredResult(_0x294927,_0x1e0ad1))[_0x3837('0x47')](handleError(_0x294927,null));};exports[_0x3837('0x48')]=function(_0x4a8327,_0x3ff7ad){var _0x3bfd09={'raw':![],'where':{'id':_0x4a8327['params']['id']}},_0x3207fd={};_0x3207fd[_0x3837('0x30')]=_['keys'](db[_0x3837('0x42')][_0x3837('0x49')]);_0x3207fd[_0x3837('0x31')]=_[_0x3837('0x32')](_0x4a8327[_0x3837('0x31')]);_0x3207fd[_0x3837('0x33')]=_[_0x3837('0x34')](_0x3207fd[_0x3837('0x30')],_0x3207fd[_0x3837('0x31')]);_0x3bfd09[_0x3837('0x35')]=_['intersection'](_0x3207fd[_0x3837('0x30')],qs[_0x3837('0x36')](_0x4a8327[_0x3837('0x31')]['fields']));_0x3bfd09[_0x3837('0x35')]=_0x3bfd09[_0x3837('0x35')][_0x3837('0x37')]?_0x3bfd09['attributes']:_0x3207fd[_0x3837('0x30')];if(_0x4a8327[_0x3837('0x31')][_0x3837('0x43')]){_0x3bfd09[_0x3837('0x44')]=[{'all':!![]}];}_0x3bfd09=_[_0x3837('0x3e')]({},_0x3bfd09,_0x4a8327[_0x3837('0x41')]);return db['VtigerAccount'][_0x3837('0x4a')](_0x3bfd09)[_0x3837('0x25')](handleEntityNotFound(_0x3ff7ad,null))[_0x3837('0x25')](respondWithResult(_0x3ff7ad,null))[_0x3837('0x47')](handleError(_0x3ff7ad,null));};exports['create']=function(_0x50883a,_0x38a9e0){return db['VtigerAccount'][_0x3837('0x4b')](_0x50883a[_0x3837('0x4c')],{})[_0x3837('0x25')](respondWithResult(_0x38a9e0,0xc9))[_0x3837('0x47')](handleError(_0x38a9e0,null));};exports[_0x3837('0x24')]=function(_0x32572e,_0x148f05){if(_0x32572e[_0x3837('0x4c')]['id']){delete _0x32572e[_0x3837('0x4c')]['id'];}return db[_0x3837('0x42')][_0x3837('0x4a')]({'where':{'id':_0x32572e[_0x3837('0x4d')]['id']}})[_0x3837('0x25')](handleEntityNotFound(_0x148f05,null))[_0x3837('0x25')](saveUpdates(_0x32572e[_0x3837('0x4c')],null))[_0x3837('0x25')](respondWithResult(_0x148f05,null))[_0x3837('0x47')](handleError(_0x148f05,null));};exports[_0x3837('0x4e')]=function(_0x3bfd9e,_0x443042){return db[_0x3837('0x42')][_0x3837('0x4a')]({'where':{'id':_0x3bfd9e[_0x3837('0x4d')]['id']}})[_0x3837('0x25')](handleEntityNotFound(_0x443042,null))[_0x3837('0x25')](removeEntity(_0x443042,null))[_0x3837('0x47')](handleError(_0x443042,null));};exports['getConfigurations']=function(_0x5c04b8,_0x30121d,_0x1bcac8){var _0x3a39c3={};var _0x4e53ec={};var _0x35ff66;var _0x22301a;return db[_0x3837('0x42')][_0x3837('0x4f')]({'where':{'id':_0x5c04b8[_0x3837('0x4d')]['id']}})[_0x3837('0x25')](handleEntityNotFound(_0x30121d,null))[_0x3837('0x25')](function(_0xa49cc2){if(_0xa49cc2){_0x35ff66=_0xa49cc2;_0x4e53ec[_0x3837('0x30')]=_['keys'](db[_0x3837('0x50')]['rawAttributes']);_0x4e53ec[_0x3837('0x31')]=_['keys'](_0x5c04b8[_0x3837('0x31')]);_0x4e53ec[_0x3837('0x33')]=_[_0x3837('0x34')](_0x4e53ec['model'],_0x4e53ec['query']);_0x3a39c3['attributes']=_[_0x3837('0x34')](_0x4e53ec[_0x3837('0x30')],qs[_0x3837('0x36')](_0x5c04b8[_0x3837('0x31')][_0x3837('0x36')]));_0x3a39c3[_0x3837('0x35')]=_0x3a39c3['attributes'][_0x3837('0x37')]?_0x3a39c3['attributes']:_0x4e53ec[_0x3837('0x30')];_0x3a39c3[_0x3837('0x3a')]=qs[_0x3837('0x3b')](_0x5c04b8['query'][_0x3837('0x3b')]);_0x3a39c3['where']=qs[_0x3837('0x33')](_[_0x3837('0x3d')](_0x5c04b8[_0x3837('0x31')],_0x4e53ec['filters']));if(_0x5c04b8[_0x3837('0x31')][_0x3837('0x40')]){_0x3a39c3[_0x3837('0x3c')]=_['merge'](_0x3a39c3[_0x3837('0x3c')],{'$or':_[_0x3837('0x2c')](_0x3a39c3[_0x3837('0x35')],function(_0x4d417f){var _0x32d120={};_0x32d120[_0x4d417f]={'$like':'%'+_0x5c04b8['query'][_0x3837('0x40')]+'%'};return _0x32d120;})});}_0x3a39c3=_[_0x3837('0x3e')]({},_0x3a39c3,_0x5c04b8[_0x3837('0x41')]);return _0x35ff66[_0x3837('0x51')](_0x3a39c3);}})['then'](function(_0x1a5328){if(_0x1a5328){_0x22301a=_0x1a5328[_0x3837('0x37')];if(!_0x5c04b8['query']['hasOwnProperty'](_0x3837('0x39'))){_0x3a39c3[_0x3837('0x20')]=qs['limit'](_0x5c04b8[_0x3837('0x31')][_0x3837('0x20')]);_0x3a39c3[_0x3837('0x1d')]=qs[_0x3837('0x1d')](_0x5c04b8[_0x3837('0x31')][_0x3837('0x1d')]);}return _0x35ff66[_0x3837('0x51')](_0x3a39c3);}})['then'](function(_0x3b9cde){if(_0x3b9cde){return _0x3b9cde?{'count':_0x22301a,'rows':_0x3b9cde}:null;}})['then'](respondWithResult(_0x30121d,null))[_0x3837('0x47')](handleError(_0x30121d,null));};exports[_0x3837('0x52')]=function(_0x2d10a5,_0x12b2d2,_0xf5e6db){if(_0x2d10a5[_0x3837('0x4c')]['id']){delete _0x2d10a5[_0x3837('0x4c')]['id'];}return db[_0x3837('0x42')][_0x3837('0x4f')]({'where':{'id':_0x2d10a5[_0x3837('0x4d')]['id']}})[_0x3837('0x25')](handleEntityNotFound(_0x12b2d2,null))[_0x3837('0x25')](function(_0x56894f){if(_0x56894f){_0x2d10a5['body']['AccountId']=_0x56894f['id'];_0x2d10a5[_0x3837('0x4c')][_0x3837('0x53')]=integrations[_0x3837('0x54')](_0x2d10a5[_0x3837('0x4c')][_0x3837('0x55')],_0x2d10a5[_0x3837('0x4c')][_0x3837('0x2e')]);_0x2d10a5[_0x3837('0x4c')][_0x3837('0x56')]=integrations[_0x3837('0x57')](_0x2d10a5[_0x3837('0x4c')][_0x3837('0x55')],_0x2d10a5[_0x3837('0x4c')][_0x3837('0x2e')]);return db[_0x3837('0x50')][_0x3837('0x4b')](_0x2d10a5['body'],{'include':[{'model':db[_0x3837('0x58')],'as':'Subjects'},{'model':db[_0x3837('0x58')],'as':_0x3837('0x56')}]});}return null;})[_0x3837('0x25')](respondWithResult(_0x12b2d2,null))['catch'](handleError(_0x12b2d2,null));};var md5=require(_0x3837('0x59'));exports[_0x3837('0x5a')]=function(_0x4bcd08,_0x4a2bbb,_0x50946f){var _0x2f2d9d=null;var _0x407dc3=null;var _0x1fe772=null;var _0x1920d7=null;var _0x4ef52a='';return db[_0x3837('0x42')][_0x3837('0x4f')]({'where':{'id':_0x4bcd08[_0x3837('0x4d')]['id']},'attributes':['id',_0x3837('0x29'),_0x3837('0x5b'),_0x3837('0x5c'),_0x3837('0x5d'),_0x3837('0x5e'),'serverUrl',_0x3837('0x5f')]})[_0x3837('0x25')](handleEntityNotFound(_0x4a2bbb,null))[_0x3837('0x25')](function(_0x46878c){if(_0x46878c){_0x2f2d9d=_0x46878c[_0x3837('0x5b')];_0x407dc3=_0x46878c['accessKey'];_0x1fe772=_0x46878c['moduleName'];_0x4ef52a=_0x46878c[_0x3837('0x5e')];var _0x42954b=_0x4ef52a[_0x3837('0x60')](-0x1);if(_0x42954b==='/'){_0x4ef52a=_0x4ef52a[_0x3837('0x61')](0x0,_0x4ef52a[_0x3837('0x62')](_0x42954b));}_0x1920d7=util[_0x3837('0x63')](_0x3837('0x64'),_0x4ef52a);var _0x3923ff={'method':_0x3837('0x65'),'uri':_0x1920d7,'qs':{'operation':'getchallenge','username':_0x46878c[_0x3837('0x5b')]},'json':!![]};return rp(_0x3923ff);}})[_0x3837('0x25')](function(_0x43b700){if(_0x43b700[_0x3837('0x66')]){var _0x22f1ed={'method':_0x3837('0x67'),'uri':_0x1920d7,'form':{'operation':_0x3837('0x68'),'username':_0x2f2d9d,'accessKey':md5(_0x43b700[_0x3837('0x69')][_0x3837('0x6a')]+_0x407dc3)},'json':!![]};return rp(_0x22f1ed);}})[_0x3837('0x25')](function(_0x4ba707){if(_0x4ba707[_0x3837('0x66')]){var _0x3767d0={'method':_0x3837('0x65'),'uri':_0x1920d7,'qs':{'operation':'describe','username':_0x2f2d9d,'sessionName':_0x4ba707[_0x3837('0x69')][_0x3837('0x6b')],'elementType':_0x1fe772},'json':!![]};return rp(_0x3767d0);}})[_0x3837('0x25')](function(_0x50dd3d){if(_0x50dd3d[_0x3837('0x66')]){var _0x2b7f53=[_0x3837('0x6c'),_0x3837('0x6d'),_0x3837('0x6e')];_[_0x3837('0x6f')](_0x50dd3d['result'][_0x3837('0x36')],function(_0x5e320d){return _0x2b7f53[_0x3837('0x70')](_0x5e320d[_0x3837('0x2e')][_0x3837('0x29')]);});_[_0x3837('0x6f')](_0x50dd3d['result'][_0x3837('0x36')],function(_0x2c2bd6){return _0x2c2bd6['editable']===_0x3837('0x71');});return{'count':_0x50dd3d['result']['fields']['length'],'rows':_[_0x3837('0x2c')](_0x50dd3d['result'][_0x3837('0x36')],function(_0x15127b){return{'id':_0x15127b[_0x3837('0x29')],'name':_0x15127b[_0x3837('0x72')],'custom':_[_0x3837('0x73')](_0x15127b[_0x3837('0x29')],_0x3837('0x74'))?!![]:![],'options':_0x15127b[_0x3837('0x2e')][_0x3837('0x29')]===_0x3837('0x75')&&_0x15127b[_0x3837('0x2e')][_0x3837('0x76')]['length']>0x0?_['map'](_0x15127b[_0x3837('0x2e')][_0x3837('0x76')],function(_0x5c7758){return{'name':_0x5c7758[_0x3837('0x72')],'value':_0x5c7758[_0x3837('0x77')]};}):[]};})};}})[_0x3837('0x25')](respondWithResult(_0x4a2bbb,null))[_0x3837('0x47')](function(_0x3968e2){console[_0x3837('0x78')](_0x3837('0x79')+_0x3968e2);var _0x3e6e66=_0x4bcd08[_0x3837('0x31')][_0x3837('0x7a')]?0x1f4:_0x3968e2[_0x3837('0x7b')]||0x1f4;logger[_0x3837('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x3837('0x5a'),_0x3e6e66,JSON[_0x3837('0x7c')](_0x3968e2));delete _0x3968e2[_0x3837('0x29')];if(_0x3e6e66===0x191){_0x3e6e66=0x190;}_0x4a2bbb[_0x3837('0x1a')](_0x3e6e66)[_0x3837('0x2a')](_0x4bcd08['query'][_0x3837('0x7a')]?{'message':_0x3837('0x7d'),'statusCode':_0x3968e2[_0x3837('0x7b')]}:_0x3968e2);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index ad28e42..1b5998b 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 _0xf3ba=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0xf3ba,0x7b));var _0xaf3b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xf3ba[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0xaf3b('0x0'));var logger=require('../../config/logger')(_0xaf3b('0x1'));var moment=require(_0xaf3b('0x2'));var BPromise=require(_0xaf3b('0x3'));var rp=require(_0xaf3b('0x4'));var fs=require('fs');var path=require(_0xaf3b('0x5'));var rimraf=require(_0xaf3b('0x6'));var config=require(_0xaf3b('0x7'));var attributes=require(_0xaf3b('0x8'));var integrations=require(_0xaf3b('0x9'));module[_0xaf3b('0xa')]=function(_0x5eac4f,_0x10d57d){return _0x5eac4f[_0xaf3b('0xb')]('VtigerAccount',attributes,{'tableName':_0xaf3b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x638f=['request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','util','api','moment','bluebird'];(function(_0x17a754,_0x5f1052){var _0x545d3e=function(_0x24ec39){while(--_0x24ec39){_0x17a754['push'](_0x17a754['shift']());}};_0x545d3e(++_0x5f1052);}(_0x638f,0x13e));var _0xf638=function(_0x244ce0,_0x3331a0){_0x244ce0=_0x244ce0-0x0;var _0x6d5e94=_0x638f[_0x244ce0];return _0x6d5e94;};'use strict';var _=require('lodash');var util=require(_0xf638('0x0'));var logger=require('../../config/logger')(_0xf638('0x1'));var moment=require(_0xf638('0x2'));var BPromise=require(_0xf638('0x3'));var rp=require(_0xf638('0x4'));var fs=require('fs');var path=require(_0xf638('0x5'));var rimraf=require(_0xf638('0x6'));var config=require(_0xf638('0x7'));var attributes=require(_0xf638('0x8'));var integrations=require(_0xf638('0x9'));module[_0xf638('0xa')]=function(_0x8e9e62,_0x414a73){return _0x8e9e62[_0xf638('0xb')](_0xf638('0xc'),attributes,{'tableName':_0xf638('0xd'),'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 bc059e8..2e6aca6 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 _0x236c=['jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','options','raw','where','attributes','include','map','model','VtigerAccount','find','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2abc8e,_0x35a483){var _0x4f9f5a=function(_0x1baf28){while(--_0x1baf28){_0x2abc8e['push'](_0x2abc8e['shift']());}};_0x4f9f5a(++_0x35a483);}(_0x236c,0x155));var _0xc236=function(_0x346d86,_0x3f0303){_0x346d86=_0x346d86-0x0;var _0xf1cca8=_0x236c[_0x346d86];return _0xf1cca8;};'use strict';var _=require(_0xc236('0x0'));var util=require('util');var moment=require(_0xc236('0x1'));var BPromise=require(_0xc236('0x2'));var rs=require(_0xc236('0x3'));var fs=require('fs');var Redis=require(_0xc236('0x4'));var db=require(_0xc236('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc236('0x6'))(_0xc236('0x7'));var config=require(_0xc236('0x8'));var jayson=require(_0xc236('0x9'));var client=jayson[_0xc236('0xa')][_0xc236('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5abd65,_0xd612c6,_0x4d349b){return new BPromise(function(_0x51a13b,_0x5bc6a2){return client['request'](_0x5abd65,_0x4d349b)[_0xc236('0xc')](function(_0x4b8dc6){logger[_0xc236('0xd')](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));logger[_0xc236('0x10')](_0xc236('0x11'),_0xd612c6,'request\x20sent',JSON[_0xc236('0x12')](_0x4b8dc6));if(_0x4b8dc6[_0xc236('0x13')]){if(_0x4b8dc6['error'][_0xc236('0x14')]===0x1f4){logger[_0xc236('0x13')]('VtigerAccount,\x20%s,\x20%s',_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x5bc6a2(_0x4b8dc6['error'][_0xc236('0x15')]);}logger[_0xc236('0x13')](_0xc236('0xe'),_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x51a13b(_0x4b8dc6[_0xc236('0x13')]['message']);}else{logger['info'](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));_0x51a13b(_0x4b8dc6[_0xc236('0x16')][_0xc236('0x15')]);}})[_0xc236('0x17')](function(_0x5ac3ed){logger['error']('VtigerAccount,\x20%s,\x20%s',_0xd612c6,_0x5ac3ed);_0x5bc6a2(_0x5ac3ed);});});}exports[_0xc236('0x18')]=function(_0x76f45){var _0x11ec65=this;return new Promise(function(_0x541a20,_0x13b432){return db['VtigerAccount']['findAll']({'raw':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1a')]===undefined?!![]:![]:!![],'where':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1b')]||null:null,'attributes':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1c')]||null:null,'limit':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')]['limit']||null:null,'include':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1d')]?_[_0xc236('0x1e')](_0x76f45[_0xc236('0x19')][_0xc236('0x1d')],function(_0x3a315b){return{'model':db[_0x3a315b[_0xc236('0x1f')]],'as':_0x3a315b['as'],'attributes':_0x3a315b[_0xc236('0x1c')],'include':_0x3a315b[_0xc236('0x1d')]?_[_0xc236('0x1e')](_0x3a315b['include'],function(_0x308cd6){return{'model':db[_0x308cd6[_0xc236('0x1f')]],'as':_0x308cd6['as'],'attributes':_0x308cd6[_0xc236('0x1c')],'include':_0x308cd6[_0xc236('0x1d')]?_['map'](_0x308cd6[_0xc236('0x1d')],function(_0x5da4b2){return{'model':db[_0x5da4b2['model']],'as':_0x5da4b2['as'],'attributes':_0x5da4b2[_0xc236('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36e578){logger['info'](_0xc236('0x18'),_0x76f45);logger['debug'](_0xc236('0x18'),_0x76f45,JSON[_0xc236('0x12')](_0x36e578));_0x541a20(_0x36e578);})['catch'](function(_0x5a61b5){logger[_0xc236('0x13')](_0xc236('0x18'),_0x5a61b5[_0xc236('0x15')],_0x76f45);_0x13b432(_0x11ec65[_0xc236('0x13')](0x1f4,_0x5a61b5['message']));});});};exports['ShowVtigerAccount']=function(_0x28ffa5){var _0x53b767=this;return new Promise(function(_0x2c756f,_0x4ddc87){return db[_0xc236('0x20')][_0xc236('0x21')]({'raw':_0x28ffa5['options']?_0x28ffa5['options'][_0xc236('0x1a')]===undefined?!![]:![]:!![],'where':_0x28ffa5[_0xc236('0x19')]?_0x28ffa5[_0xc236('0x19')][_0xc236('0x1b')]||null:null,'attributes':_0x28ffa5[_0xc236('0x19')]?_0x28ffa5[_0xc236('0x19')][_0xc236('0x1c')]||null:null,'include':_0x28ffa5[_0xc236('0x19')]?_0x28ffa5[_0xc236('0x19')]['include']?_['map'](_0x28ffa5['options'][_0xc236('0x1d')],function(_0xfda1f9){return{'model':db[_0xfda1f9[_0xc236('0x1f')]],'as':_0xfda1f9['as'],'attributes':_0xfda1f9[_0xc236('0x1c')],'include':_0xfda1f9[_0xc236('0x1d')]?_[_0xc236('0x1e')](_0xfda1f9[_0xc236('0x1d')],function(_0x5761de){return{'model':db[_0x5761de[_0xc236('0x1f')]],'as':_0x5761de['as'],'attributes':_0x5761de[_0xc236('0x1c')],'include':_0x5761de[_0xc236('0x1d')]?_['map'](_0x5761de[_0xc236('0x1d')],function(_0x2a8f33){return{'model':db[_0x2a8f33[_0xc236('0x1f')]],'as':_0x2a8f33['as'],'attributes':_0x2a8f33[_0xc236('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12348b){logger[_0xc236('0xd')](_0xc236('0x22'),_0x28ffa5);logger[_0xc236('0x10')](_0xc236('0x22'),_0x28ffa5,JSON[_0xc236('0x12')](_0x12348b));_0x2c756f(_0x12348b);})[_0xc236('0x17')](function(_0x11ca1c){logger[_0xc236('0x13')](_0xc236('0x22'),_0x11ca1c[_0xc236('0x15')],_0x28ffa5);_0x4ddc87(_0x53b767[_0xc236('0x13')](0x1f4,_0x11ca1c[_0xc236('0x15')]));});});}; \ No newline at end of file +var _0xab40=['VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','VtigerAccount','findAll','options','limit','include','model','map','attributes','GetVtigerAccount','ShowVtigerAccount','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5f1f3e,_0x13c98f){var _0x32c777=function(_0x4d19ed){while(--_0x4d19ed){_0x5f1f3e['push'](_0x5f1f3e['shift']());}};_0x32c777(++_0x13c98f);}(_0xab40,0xcd));var _0x0ab4=function(_0x1d57c2,_0x359fde){_0x1d57c2=_0x1d57c2-0x0;var _0x4cd7d5=_0xab40[_0x1d57c2];return _0x4cd7d5;};'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});function respondWithRpcPromise(_0x10d92b,_0x46d16a,_0x11e99f){return new BPromise(function(_0x6d135d,_0x4cf8de){return client['request'](_0x10d92b,_0x11e99f)['then'](function(_0x24271e){logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));logger[_0x0ab4('0xb')](_0x0ab4('0xc'),_0x46d16a,_0x0ab4('0xa'),JSON[_0x0ab4('0xd')](_0x24271e));if(_0x24271e['error']){if(_0x24271e['error'][_0x0ab4('0xe')]===0x1f4){logger['error'](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x4cf8de(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}logger[_0x0ab4('0xf')](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x6d135d(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}else{logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));_0x6d135d(_0x24271e[_0x0ab4('0x11')][_0x0ab4('0x10')]);}})[_0x0ab4('0x12')](function(_0x2bdda7){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x46d16a,_0x2bdda7);_0x4cf8de(_0x2bdda7);});});}exports['GetVtigerAccount']=function(_0x17422f){var _0x30d5df=this;return new Promise(function(_0x2f50d2,_0x53723c){return db[_0x0ab4('0x13')][_0x0ab4('0x14')]({'raw':_0x17422f[_0x0ab4('0x15')]?_0x17422f[_0x0ab4('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x17422f['options']?_0x17422f[_0x0ab4('0x15')]['where']||null:null,'attributes':_0x17422f[_0x0ab4('0x15')]?_0x17422f[_0x0ab4('0x15')]['attributes']||null:null,'limit':_0x17422f[_0x0ab4('0x15')]?_0x17422f[_0x0ab4('0x15')][_0x0ab4('0x16')]||null:null,'include':_0x17422f[_0x0ab4('0x15')]?_0x17422f[_0x0ab4('0x15')]['include']?_['map'](_0x17422f[_0x0ab4('0x15')][_0x0ab4('0x17')],function(_0x392afe){return{'model':db[_0x392afe[_0x0ab4('0x18')]],'as':_0x392afe['as'],'attributes':_0x392afe['attributes'],'include':_0x392afe[_0x0ab4('0x17')]?_[_0x0ab4('0x19')](_0x392afe[_0x0ab4('0x17')],function(_0x4ea9aa){return{'model':db[_0x4ea9aa['model']],'as':_0x4ea9aa['as'],'attributes':_0x4ea9aa[_0x0ab4('0x1a')],'include':_0x4ea9aa[_0x0ab4('0x17')]?_[_0x0ab4('0x19')](_0x4ea9aa['include'],function(_0x519b23){return{'model':db[_0x519b23['model']],'as':_0x519b23['as'],'attributes':_0x519b23[_0x0ab4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bf844){logger[_0x0ab4('0x8')]('GetVtigerAccount',_0x17422f);logger['debug']('GetVtigerAccount',_0x17422f,JSON[_0x0ab4('0xd')](_0x3bf844));_0x2f50d2(_0x3bf844);})[_0x0ab4('0x12')](function(_0x1cfdad){logger[_0x0ab4('0xf')](_0x0ab4('0x1b'),_0x1cfdad['message'],_0x17422f);_0x53723c(_0x30d5df['error'](0x1f4,_0x1cfdad['message']));});});};exports[_0x0ab4('0x1c')]=function(_0x2b66d5){var _0x155d96=this;return new Promise(function(_0x182bbe,_0x46eda7){return db['VtigerAccount']['find']({'raw':_0x2b66d5[_0x0ab4('0x15')]?_0x2b66d5[_0x0ab4('0x15')][_0x0ab4('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b66d5['options']?_0x2b66d5['options'][_0x0ab4('0x1e')]||null:null,'attributes':_0x2b66d5['options']?_0x2b66d5[_0x0ab4('0x15')][_0x0ab4('0x1a')]||null:null,'include':_0x2b66d5[_0x0ab4('0x15')]?_0x2b66d5[_0x0ab4('0x15')][_0x0ab4('0x17')]?_[_0x0ab4('0x19')](_0x2b66d5['options'][_0x0ab4('0x17')],function(_0x4696fc){return{'model':db[_0x4696fc[_0x0ab4('0x18')]],'as':_0x4696fc['as'],'attributes':_0x4696fc[_0x0ab4('0x1a')],'include':_0x4696fc['include']?_['map'](_0x4696fc[_0x0ab4('0x17')],function(_0x3e65a1){return{'model':db[_0x3e65a1[_0x0ab4('0x18')]],'as':_0x3e65a1['as'],'attributes':_0x3e65a1['attributes'],'include':_0x3e65a1['include']?_['map'](_0x3e65a1[_0x0ab4('0x17')],function(_0x35eab3){return{'model':db[_0x35eab3[_0x0ab4('0x18')]],'as':_0x35eab3['as'],'attributes':_0x35eab3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x492943){logger[_0x0ab4('0x8')](_0x0ab4('0x1c'),_0x2b66d5);logger[_0x0ab4('0xb')](_0x0ab4('0x1c'),_0x2b66d5,JSON[_0x0ab4('0xd')](_0x492943));_0x182bbe(_0x492943);})[_0x0ab4('0x12')](function(_0x52d9bf){logger[_0x0ab4('0xf')](_0x0ab4('0x1c'),_0x52d9bf[_0x0ab4('0x10')],_0x2b66d5);_0x46eda7(_0x155d96['error'](0x1f4,_0x52d9bf[_0x0ab4('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index c055963..683ba23 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 _0xc3a5=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc3a5,0x108));var _0x5c3a=function(_0x2688ee,_0x460d2f){_0x2688ee=_0x2688ee-0x0;var _0x49f052=_0xc3a5[_0x2688ee];return _0x49f052;};'use strict';var multer=require(_0x5c3a('0x0'));var util=require('util');var path=require(_0x5c3a('0x1'));var timeout=require(_0x5c3a('0x2'));var express=require(_0x5c3a('0x3'));var router=express[_0x5c3a('0x4')]();var fs_extra=require(_0x5c3a('0x5'));var auth=require(_0x5c3a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5c3a('0x7'));var controller=require(_0x5c3a('0x8'));router[_0x5c3a('0x9')]('/',auth[_0x5c3a('0xa')](),controller[_0x5c3a('0xb')]);router[_0x5c3a('0x9')](_0x5c3a('0xc'),auth[_0x5c3a('0xa')](),controller['show']);router['get'](_0x5c3a('0xd'),auth[_0x5c3a('0xa')](),controller[_0x5c3a('0xe')]);router[_0x5c3a('0x9')](_0x5c3a('0xf'),auth[_0x5c3a('0xa')](),controller[_0x5c3a('0x10')]);router['get'](_0x5c3a('0x11'),auth[_0x5c3a('0xa')](),controller[_0x5c3a('0x12')]);router['post']('/',auth[_0x5c3a('0xa')](),controller['create']);router[_0x5c3a('0x13')](_0x5c3a('0xc'),auth[_0x5c3a('0xa')](),controller[_0x5c3a('0x14')]);router[_0x5c3a('0x15')](_0x5c3a('0xc'),auth[_0x5c3a('0xa')](),controller[_0x5c3a('0x16')]);module[_0x5c3a('0x17')]=router; \ No newline at end of file +var _0x8421=['create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x2dd46c,_0x5543b4){var _0x3960b4=function(_0x173fb5){while(--_0x173fb5){_0x2dd46c['push'](_0x2dd46c['shift']());}};_0x3960b4(++_0x5543b4);}(_0x8421,0x123));var _0x1842=function(_0xd4a5,_0x12a607){_0xd4a5=_0xd4a5-0x0;var _0x4c99f6=_0x8421[_0xd4a5];return _0x4c99f6;};'use strict';var multer=require(_0x1842('0x0'));var util=require(_0x1842('0x1'));var path=require('path');var timeout=require(_0x1842('0x2'));var express=require(_0x1842('0x3'));var router=express[_0x1842('0x4')]();var fs_extra=require(_0x1842('0x5'));var auth=require(_0x1842('0x6'));var interaction=require(_0x1842('0x7'));var config=require(_0x1842('0x8'));var controller=require(_0x1842('0x9'));router[_0x1842('0xa')]('/',auth['isAuthenticated'](),controller[_0x1842('0xb')]);router[_0x1842('0xa')](_0x1842('0xc'),auth['isAuthenticated'](),controller[_0x1842('0xd')]);router['get']('/:id/fields',auth[_0x1842('0xe')](),controller[_0x1842('0xf')]);router[_0x1842('0xa')](_0x1842('0x10'),auth[_0x1842('0xe')](),controller[_0x1842('0x11')]);router['get'](_0x1842('0x12'),auth['isAuthenticated'](),controller[_0x1842('0x13')]);router[_0x1842('0x14')]('/',auth[_0x1842('0xe')](),controller[_0x1842('0x15')]);router[_0x1842('0x16')](_0x1842('0xc'),auth[_0x1842('0xe')](),controller[_0x1842('0x17')]);router[_0x1842('0x18')]('/:id',auth[_0x1842('0xe')](),controller['destroy']);module[_0x1842('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 2be52c4..013cacc 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 _0xd56c=['exports','STRING','sequelize'];(function(_0x5f524f,_0x4bf691){var _0x265dcd=function(_0x372b0d){while(--_0x372b0d){_0x5f524f['push'](_0x5f524f['shift']());}};_0x265dcd(++_0x4bf691);}(_0xd56c,0xef));var _0xcd56=function(_0x4190e3,_0xc7969d){_0x4190e3=_0x4190e3-0x0;var _0x126f90=_0xd56c[_0x4190e3];return _0x126f90;};'use strict';var Sequelize=require(_0xcd56('0x0'));module[_0xcd56('0x1')]={'name':{'type':Sequelize[_0xcd56('0x2')]},'description':{'type':Sequelize[_0xcd56('0x2')]}}; \ No newline at end of file +var _0xe307=['sequelize'];(function(_0x2c4a52,_0x1a11ef){var _0xf8ddd4=function(_0x59294d){while(--_0x59294d){_0x2c4a52['push'](_0x2c4a52['shift']());}};_0xf8ddd4(++_0x1a11ef);}(_0xe307,0x1e7));var _0x7e30=function(_0x334ef2,_0x50e631){_0x334ef2=_0x334ef2-0x0;var _0x611b8c=_0xe307[_0x334ef2];return _0x611b8c;};'use strict';var Sequelize=require(_0x7e30('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index b555e54..4a2314d 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 _0x8a13=['undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','VtigerConfiguration','include','findAll','rows','catch','params','includeAll','find','create','body','getFields','findOne','rawAttributes','VtigerField','getSubjects','getDescriptions','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json'];(function(_0x5e50b2,_0x465867){var _0x7cbe9a=function(_0x234424){while(--_0x234424){_0x5e50b2['push'](_0x5e50b2['shift']());}};_0x7cbe9a(++_0x465867);}(_0x8a13,0xd6));var _0x38a1=function(_0x5499d9,_0x1abd4f){_0x5499d9=_0x5499d9-0x0;var _0x52054c=_0x8a13[_0x5499d9];return _0x52054c;};'use strict';var emlformat=require(_0x38a1('0x0'));var rimraf=require(_0x38a1('0x1'));var zipdir=require(_0x38a1('0x2'));var jsonpatch=require(_0x38a1('0x3'));var rp=require(_0x38a1('0x4'));var moment=require(_0x38a1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x38a1('0x6'));var util=require(_0x38a1('0x7'));var path=require(_0x38a1('0x8'));var sox=require(_0x38a1('0x9'));var csv=require(_0x38a1('0xa'));var ejs=require(_0x38a1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x38a1('0xc'));var crypto=require(_0x38a1('0xd'));var jsforce=require(_0x38a1('0xe'));var deskjs=require(_0x38a1('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x38a1('0x10'));var Redis=require('ioredis');var authService=require(_0x38a1('0x11'));var qs=require(_0x38a1('0x12'));var as=require(_0x38a1('0x13'));var hardwareService=require(_0x38a1('0x14'));var logger=require(_0x38a1('0x15'))(_0x38a1('0x16'));var utils=require(_0x38a1('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x38a1('0x18'))['db'];function respondWithStatusCode(_0x26c541,_0x302c80){_0x302c80=_0x302c80||0xcc;return function(_0x9eb9e5){if(_0x9eb9e5){return _0x26c541[_0x38a1('0x19')](_0x302c80);}return _0x26c541[_0x38a1('0x1a')](_0x302c80)[_0x38a1('0x1b')]();};}function respondWithResult(_0x31eb8d,_0x507b7d){_0x507b7d=_0x507b7d||0xc8;return function(_0x3fd09d){if(_0x3fd09d){return _0x31eb8d[_0x38a1('0x1a')](_0x507b7d)[_0x38a1('0x1c')](_0x3fd09d);}};}function respondWithFilteredResult(_0xd6b420,_0x382938){return function(_0x3412f7){if(_0x3412f7){var _0x420698=typeof _0x382938['offset']===_0x38a1('0x1d')&&typeof _0x382938[_0x38a1('0x1e')]===_0x38a1('0x1d');var _0x2ffaf0=_0x3412f7[_0x38a1('0x1f')];var _0x314313=_0x420698?0x0:_0x382938[_0x38a1('0x20')];var _0xe7eb53=_0x420698?_0x3412f7[_0x38a1('0x1f')]:_0x382938['offset']+_0x382938[_0x38a1('0x1e')];var _0xccc503;if(_0xe7eb53>=_0x2ffaf0){_0xe7eb53=_0x2ffaf0;_0xccc503=0xc8;}else{_0xccc503=0xce;}_0xd6b420[_0x38a1('0x1a')](_0xccc503);return _0xd6b420[_0x38a1('0x21')](_0x38a1('0x22'),_0x314313+'-'+_0xe7eb53+'/'+_0x2ffaf0)[_0x38a1('0x1c')](_0x3412f7);}return null;};}function patchUpdates(_0x5f05fb){return function(_0x323994){try{jsonpatch[_0x38a1('0x23')](_0x323994,_0x5f05fb,!![]);}catch(_0x5a773d){return BPromise[_0x38a1('0x24')](_0x5a773d);}return _0x323994['save']();};}function saveUpdates(_0x3f710c,_0x5c1580){return function(_0x510fb5){if(_0x510fb5){return _0x510fb5[_0x38a1('0x25')](_0x3f710c)[_0x38a1('0x26')](function(_0x1191c1){return _0x1191c1;});}return null;};}function removeEntity(_0x4d3dcc,_0x5a0f18){return function(_0x56b8a7){if(_0x56b8a7){return _0x56b8a7[_0x38a1('0x27')]()[_0x38a1('0x26')](function(){_0x4d3dcc['status'](0xcc)[_0x38a1('0x1b')]();});}};}function handleEntityNotFound(_0x1d15e1,_0x34737c){return function(_0x5e25b2){if(!_0x5e25b2){_0x1d15e1[_0x38a1('0x19')](0x194);}return _0x5e25b2;};}function handleError(_0x5469d1,_0x147b56){_0x147b56=_0x147b56||0x1f4;return function(_0x870241){logger[_0x38a1('0x28')](_0x870241[_0x38a1('0x29')]);if(_0x870241[_0x38a1('0x2a')]){delete _0x870241[_0x38a1('0x2a')];}_0x5469d1[_0x38a1('0x1a')](_0x147b56)['send'](_0x870241);};}exports[_0x38a1('0x2b')]=function(_0x2ed540,_0x25f981){var _0x4da6cd={},_0x2d893b={},_0xa86390={'count':0x0,'rows':[]};var _0x353774=_[_0x38a1('0x2c')](db['VtigerConfiguration']['rawAttributes'],function(_0x4a8624){return{'name':_0x4a8624[_0x38a1('0x2d')],'type':_0x4a8624[_0x38a1('0x2e')][_0x38a1('0x2f')]};});_0x2d893b[_0x38a1('0x30')]=_[_0x38a1('0x2c')](_0x353774,'name');_0x2d893b[_0x38a1('0x31')]=_[_0x38a1('0x32')](_0x2ed540['query']);_0x2d893b[_0x38a1('0x33')]=_[_0x38a1('0x34')](_0x2d893b[_0x38a1('0x30')],_0x2d893b[_0x38a1('0x31')]);_0x4da6cd[_0x38a1('0x35')]=_['intersection'](_0x2d893b['model'],qs['fields'](_0x2ed540[_0x38a1('0x31')][_0x38a1('0x36')]));_0x4da6cd[_0x38a1('0x35')]=_0x4da6cd[_0x38a1('0x35')][_0x38a1('0x37')]?_0x4da6cd[_0x38a1('0x35')]:_0x2d893b['model'];if(!_0x2ed540[_0x38a1('0x31')]['hasOwnProperty'](_0x38a1('0x38'))){_0x4da6cd['limit']=qs[_0x38a1('0x1e')](_0x2ed540[_0x38a1('0x31')][_0x38a1('0x1e')]);_0x4da6cd['offset']=qs[_0x38a1('0x20')](_0x2ed540[_0x38a1('0x31')][_0x38a1('0x20')]);}_0x4da6cd[_0x38a1('0x39')]=qs[_0x38a1('0x3a')](_0x2ed540['query'][_0x38a1('0x3a')]);_0x4da6cd[_0x38a1('0x3b')]=qs[_0x38a1('0x33')](_[_0x38a1('0x3c')](_0x2ed540[_0x38a1('0x31')],_0x2d893b['filters']),_0x353774);if(_0x2ed540[_0x38a1('0x31')][_0x38a1('0x3d')]){_0x4da6cd[_0x38a1('0x3b')]=_[_0x38a1('0x3e')](_0x4da6cd['where'],{'$or':_['map'](_0x353774,function(_0xd8b015){if(_0xd8b015[_0x38a1('0x2e')]!=='VIRTUAL'){var _0x5790d0={};_0x5790d0[_0xd8b015['name']]={'$like':'%'+_0x2ed540['query'][_0x38a1('0x3d')]+'%'};return _0x5790d0;}})});}_0x4da6cd=_[_0x38a1('0x3e')]({},_0x4da6cd,_0x2ed540[_0x38a1('0x3f')]);var _0x4f0a3a={'where':_0x4da6cd[_0x38a1('0x3b')]};return db[_0x38a1('0x40')][_0x38a1('0x1f')](_0x4f0a3a)['then'](function(_0x3f03c5){_0xa86390[_0x38a1('0x1f')]=_0x3f03c5;if(_0x2ed540['query']['includeAll']){_0x4da6cd[_0x38a1('0x41')]=[{'all':!![]}];}return db[_0x38a1('0x40')][_0x38a1('0x42')](_0x4da6cd);})[_0x38a1('0x26')](function(_0x1e5b89){_0xa86390[_0x38a1('0x43')]=_0x1e5b89;return _0xa86390;})[_0x38a1('0x26')](respondWithFilteredResult(_0x25f981,_0x4da6cd))[_0x38a1('0x44')](handleError(_0x25f981,null));};exports['show']=function(_0x21d1e1,_0x8e7c44){var _0x3d330a={'raw':![],'where':{'id':_0x21d1e1[_0x38a1('0x45')]['id']}},_0x1287ea={};_0x1287ea[_0x38a1('0x30')]=_[_0x38a1('0x32')](db[_0x38a1('0x40')]['rawAttributes']);_0x1287ea['query']=_[_0x38a1('0x32')](_0x21d1e1[_0x38a1('0x31')]);_0x1287ea[_0x38a1('0x33')]=_['intersection'](_0x1287ea['model'],_0x1287ea[_0x38a1('0x31')]);_0x3d330a['attributes']=_[_0x38a1('0x34')](_0x1287ea[_0x38a1('0x30')],qs['fields'](_0x21d1e1['query'][_0x38a1('0x36')]));_0x3d330a['attributes']=_0x3d330a[_0x38a1('0x35')]['length']?_0x3d330a[_0x38a1('0x35')]:_0x1287ea['model'];if(_0x21d1e1[_0x38a1('0x31')][_0x38a1('0x46')]){_0x3d330a['include']=[{'all':!![]}];}_0x3d330a=_[_0x38a1('0x3e')]({},_0x3d330a,_0x21d1e1[_0x38a1('0x3f')]);return db['VtigerConfiguration'][_0x38a1('0x47')](_0x3d330a)[_0x38a1('0x26')](handleEntityNotFound(_0x8e7c44,null))[_0x38a1('0x26')](respondWithResult(_0x8e7c44,null))[_0x38a1('0x44')](handleError(_0x8e7c44,null));};exports['create']=function(_0x36cc25,_0x481dd7){return db[_0x38a1('0x40')][_0x38a1('0x48')](_0x36cc25[_0x38a1('0x49')],{})[_0x38a1('0x26')](respondWithResult(_0x481dd7,0xc9))[_0x38a1('0x44')](handleError(_0x481dd7,null));};exports[_0x38a1('0x25')]=function(_0x500c61,_0xa946a1){if(_0x500c61['body']['id']){delete _0x500c61[_0x38a1('0x49')]['id'];}return db[_0x38a1('0x40')]['find']({'where':{'id':_0x500c61[_0x38a1('0x45')]['id']}})[_0x38a1('0x26')](handleEntityNotFound(_0xa946a1,null))['then'](saveUpdates(_0x500c61['body'],null))[_0x38a1('0x26')](respondWithResult(_0xa946a1,null))[_0x38a1('0x44')](handleError(_0xa946a1,null));};exports['destroy']=function(_0x4b3851,_0x220a96){return db[_0x38a1('0x40')][_0x38a1('0x47')]({'where':{'id':_0x4b3851[_0x38a1('0x45')]['id']}})[_0x38a1('0x26')](handleEntityNotFound(_0x220a96,null))[_0x38a1('0x26')](removeEntity(_0x220a96,null))[_0x38a1('0x44')](handleError(_0x220a96,null));};exports[_0x38a1('0x4a')]=function(_0x384f34,_0xaaa27d,_0x301a2e){var _0x14689e={};var _0x31df94={};var _0x52cedb;var _0x53c96a;return db[_0x38a1('0x40')][_0x38a1('0x4b')]({'where':{'id':_0x384f34['params']['id']}})[_0x38a1('0x26')](handleEntityNotFound(_0xaaa27d,null))['then'](function(_0x2188da){if(_0x2188da){_0x52cedb=_0x2188da;_0x31df94[_0x38a1('0x30')]=_[_0x38a1('0x32')](db['VtigerField'][_0x38a1('0x4c')]);_0x31df94[_0x38a1('0x31')]=_[_0x38a1('0x32')](_0x384f34[_0x38a1('0x31')]);_0x31df94['filters']=_[_0x38a1('0x34')](_0x31df94[_0x38a1('0x30')],_0x31df94['query']);_0x14689e[_0x38a1('0x35')]=_[_0x38a1('0x34')](_0x31df94['model'],qs[_0x38a1('0x36')](_0x384f34[_0x38a1('0x31')][_0x38a1('0x36')]));_0x14689e[_0x38a1('0x35')]=_0x14689e['attributes'][_0x38a1('0x37')]?_0x14689e[_0x38a1('0x35')]:_0x31df94[_0x38a1('0x30')];_0x14689e[_0x38a1('0x39')]=qs['sort'](_0x384f34['query']['sort']);_0x14689e[_0x38a1('0x3b')]=qs[_0x38a1('0x33')](_[_0x38a1('0x3c')](_0x384f34[_0x38a1('0x31')],_0x31df94['filters']));if(_0x384f34[_0x38a1('0x31')][_0x38a1('0x3d')]){_0x14689e[_0x38a1('0x3b')]=_[_0x38a1('0x3e')](_0x14689e[_0x38a1('0x3b')],{'$or':_[_0x38a1('0x2c')](_0x14689e[_0x38a1('0x35')],function(_0x3cfd8e){var _0x12cfc={};_0x12cfc[_0x3cfd8e]={'$like':'%'+_0x384f34[_0x38a1('0x31')][_0x38a1('0x3d')]+'%'};return _0x12cfc;})});}_0x14689e=_[_0x38a1('0x3e')]({},_0x14689e,_0x384f34['options']);return _0x52cedb[_0x38a1('0x4a')](_0x14689e);}})[_0x38a1('0x26')](function(_0x21978f){if(_0x21978f){_0x53c96a=_0x21978f[_0x38a1('0x37')];if(!_0x384f34['query']['hasOwnProperty']('nolimit')){_0x14689e[_0x38a1('0x1e')]=qs[_0x38a1('0x1e')](_0x384f34[_0x38a1('0x31')][_0x38a1('0x1e')]);_0x14689e[_0x38a1('0x20')]=qs[_0x38a1('0x20')](_0x384f34[_0x38a1('0x31')]['offset']);}return _0x52cedb[_0x38a1('0x4a')](_0x14689e);}})[_0x38a1('0x26')](function(_0x367e14){if(_0x367e14){return _0x367e14?{'count':_0x53c96a,'rows':_0x367e14}:null;}})[_0x38a1('0x26')](respondWithResult(_0xaaa27d,null))[_0x38a1('0x44')](handleError(_0xaaa27d,null));};exports['getSubjects']=function(_0x1a84a7,_0x3c94ba,_0x12b76f){var _0x5524f0={};var _0x22266c={};var _0x68e555;var _0x446a9b;return db[_0x38a1('0x40')][_0x38a1('0x4b')]({'where':{'id':_0x1a84a7[_0x38a1('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c94ba,null))[_0x38a1('0x26')](function(_0x1639df){if(_0x1639df){_0x68e555=_0x1639df;_0x22266c[_0x38a1('0x30')]=_[_0x38a1('0x32')](db[_0x38a1('0x4d')]['rawAttributes']);_0x22266c['query']=_[_0x38a1('0x32')](_0x1a84a7[_0x38a1('0x31')]);_0x22266c[_0x38a1('0x33')]=_['intersection'](_0x22266c[_0x38a1('0x30')],_0x22266c[_0x38a1('0x31')]);_0x5524f0['attributes']=_[_0x38a1('0x34')](_0x22266c[_0x38a1('0x30')],qs['fields'](_0x1a84a7[_0x38a1('0x31')]['fields']));_0x5524f0['attributes']=_0x5524f0[_0x38a1('0x35')][_0x38a1('0x37')]?_0x5524f0['attributes']:_0x22266c[_0x38a1('0x30')];_0x5524f0[_0x38a1('0x39')]=qs['sort'](_0x1a84a7[_0x38a1('0x31')][_0x38a1('0x3a')]);_0x5524f0['where']=qs[_0x38a1('0x33')](_[_0x38a1('0x3c')](_0x1a84a7[_0x38a1('0x31')],_0x22266c[_0x38a1('0x33')]));if(_0x1a84a7[_0x38a1('0x31')]['filter']){_0x5524f0[_0x38a1('0x3b')]=_['merge'](_0x5524f0[_0x38a1('0x3b')],{'$or':_['map'](_0x5524f0[_0x38a1('0x35')],function(_0x1ac6bb){var _0x4a0a06={};_0x4a0a06[_0x1ac6bb]={'$like':'%'+_0x1a84a7[_0x38a1('0x31')]['filter']+'%'};return _0x4a0a06;})});}_0x5524f0=_[_0x38a1('0x3e')]({},_0x5524f0,_0x1a84a7[_0x38a1('0x3f')]);return _0x68e555[_0x38a1('0x4e')](_0x5524f0);}})['then'](function(_0x4de282){if(_0x4de282){_0x446a9b=_0x4de282['length'];if(!_0x1a84a7[_0x38a1('0x31')]['hasOwnProperty'](_0x38a1('0x38'))){_0x5524f0[_0x38a1('0x1e')]=qs[_0x38a1('0x1e')](_0x1a84a7[_0x38a1('0x31')][_0x38a1('0x1e')]);_0x5524f0[_0x38a1('0x20')]=qs[_0x38a1('0x20')](_0x1a84a7[_0x38a1('0x31')][_0x38a1('0x20')]);}return _0x68e555['getSubjects'](_0x5524f0);}})[_0x38a1('0x26')](function(_0x18333e){if(_0x18333e){return _0x18333e?{'count':_0x446a9b,'rows':_0x18333e}:null;}})[_0x38a1('0x26')](respondWithResult(_0x3c94ba,null))['catch'](handleError(_0x3c94ba,null));};exports['getDescriptions']=function(_0x1e19bf,_0x116369,_0x10f5bc){var _0x27529e={};var _0x37ac93={};var _0x175282;var _0x39b29b;return db[_0x38a1('0x40')][_0x38a1('0x4b')]({'where':{'id':_0x1e19bf[_0x38a1('0x45')]['id']}})[_0x38a1('0x26')](handleEntityNotFound(_0x116369,null))[_0x38a1('0x26')](function(_0x44a4e8){if(_0x44a4e8){_0x175282=_0x44a4e8;_0x37ac93[_0x38a1('0x30')]=_['keys'](db[_0x38a1('0x4d')][_0x38a1('0x4c')]);_0x37ac93[_0x38a1('0x31')]=_['keys'](_0x1e19bf['query']);_0x37ac93[_0x38a1('0x33')]=_[_0x38a1('0x34')](_0x37ac93[_0x38a1('0x30')],_0x37ac93[_0x38a1('0x31')]);_0x27529e['attributes']=_[_0x38a1('0x34')](_0x37ac93[_0x38a1('0x30')],qs['fields'](_0x1e19bf[_0x38a1('0x31')]['fields']));_0x27529e['attributes']=_0x27529e[_0x38a1('0x35')][_0x38a1('0x37')]?_0x27529e[_0x38a1('0x35')]:_0x37ac93['model'];_0x27529e['order']=qs['sort'](_0x1e19bf[_0x38a1('0x31')]['sort']);_0x27529e[_0x38a1('0x3b')]=qs[_0x38a1('0x33')](_[_0x38a1('0x3c')](_0x1e19bf[_0x38a1('0x31')],_0x37ac93[_0x38a1('0x33')]));if(_0x1e19bf['query'][_0x38a1('0x3d')]){_0x27529e[_0x38a1('0x3b')]=_[_0x38a1('0x3e')](_0x27529e[_0x38a1('0x3b')],{'$or':_[_0x38a1('0x2c')](_0x27529e[_0x38a1('0x35')],function(_0x4ed4aa){var _0x726796={};_0x726796[_0x4ed4aa]={'$like':'%'+_0x1e19bf[_0x38a1('0x31')]['filter']+'%'};return _0x726796;})});}_0x27529e=_[_0x38a1('0x3e')]({},_0x27529e,_0x1e19bf[_0x38a1('0x3f')]);return _0x175282[_0x38a1('0x4f')](_0x27529e);}})[_0x38a1('0x26')](function(_0x554bb2){if(_0x554bb2){_0x39b29b=_0x554bb2[_0x38a1('0x37')];if(!_0x1e19bf[_0x38a1('0x31')][_0x38a1('0x50')](_0x38a1('0x38'))){_0x27529e[_0x38a1('0x1e')]=qs['limit'](_0x1e19bf[_0x38a1('0x31')]['limit']);_0x27529e[_0x38a1('0x20')]=qs['offset'](_0x1e19bf['query'][_0x38a1('0x20')]);}return _0x175282['getDescriptions'](_0x27529e);}})[_0x38a1('0x26')](function(_0x46c419){if(_0x46c419){return _0x46c419?{'count':_0x39b29b,'rows':_0x46c419}:null;}})[_0x38a1('0x26')](respondWithResult(_0x116369,null))[_0x38a1('0x44')](handleError(_0x116369,null));}; \ No newline at end of file +var _0x3105=['destroy','end','error','stack','name','index','map','VtigerConfiguration','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','merge','create','body','find','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','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','json','offset','undefined','limit','count','Content-Range','reject','save','update','then'];(function(_0x5ebb09,_0x5a6fe5){var _0x29d0f4=function(_0x127d09){while(--_0x127d09){_0x5ebb09['push'](_0x5ebb09['shift']());}};_0x29d0f4(++_0x5a6fe5);}(_0x3105,0x7e));var _0x5310=function(_0x510bff,_0x448214){_0x510bff=_0x510bff-0x0;var _0x4d84bd=_0x3105[_0x510bff];return _0x4d84bd;};'use strict';var emlformat=require(_0x5310('0x0'));var rimraf=require(_0x5310('0x1'));var zipdir=require(_0x5310('0x2'));var jsonpatch=require(_0x5310('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5310('0x4'));var Mustache=require(_0x5310('0x5'));var util=require(_0x5310('0x6'));var path=require('path');var sox=require(_0x5310('0x7'));var csv=require(_0x5310('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5310('0x9'));var squel=require(_0x5310('0xa'));var crypto=require(_0x5310('0xb'));var jsforce=require(_0x5310('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5310('0x8'));var querystring=require(_0x5310('0xd'));var Papa=require(_0x5310('0xe'));var Redis=require(_0x5310('0xf'));var authService=require(_0x5310('0x10'));var qs=require(_0x5310('0x11'));var as=require(_0x5310('0x12'));var hardwareService=require(_0x5310('0x13'));var logger=require(_0x5310('0x14'))(_0x5310('0x15'));var utils=require(_0x5310('0x16'));var config=require(_0x5310('0x17'));var licenseUtil=require(_0x5310('0x18'));var db=require(_0x5310('0x19'))['db'];function respondWithStatusCode(_0x33e978,_0x2ed79a){_0x2ed79a=_0x2ed79a||0xcc;return function(_0x5b825b){if(_0x5b825b){return _0x33e978[_0x5310('0x1a')](_0x2ed79a);}return _0x33e978[_0x5310('0x1b')](_0x2ed79a)['end']();};}function respondWithResult(_0x5562e9,_0x262085){_0x262085=_0x262085||0xc8;return function(_0x7cb71c){if(_0x7cb71c){return _0x5562e9[_0x5310('0x1b')](_0x262085)[_0x5310('0x1c')](_0x7cb71c);}};}function respondWithFilteredResult(_0x455072,_0x4f772){return function(_0x22b6ac){if(_0x22b6ac){var _0x2870ca=typeof _0x4f772[_0x5310('0x1d')]===_0x5310('0x1e')&&typeof _0x4f772[_0x5310('0x1f')]===_0x5310('0x1e');var _0x3859bf=_0x22b6ac[_0x5310('0x20')];var _0x132a87=_0x2870ca?0x0:_0x4f772[_0x5310('0x1d')];var _0x5c59c6=_0x2870ca?_0x22b6ac['count']:_0x4f772[_0x5310('0x1d')]+_0x4f772[_0x5310('0x1f')];var _0x4d906d;if(_0x5c59c6>=_0x3859bf){_0x5c59c6=_0x3859bf;_0x4d906d=0xc8;}else{_0x4d906d=0xce;}_0x455072[_0x5310('0x1b')](_0x4d906d);return _0x455072['set'](_0x5310('0x21'),_0x132a87+'-'+_0x5c59c6+'/'+_0x3859bf)[_0x5310('0x1c')](_0x22b6ac);}return null;};}function patchUpdates(_0x55de81){return function(_0x6a950c){try{jsonpatch['apply'](_0x6a950c,_0x55de81,!![]);}catch(_0x2fe21b){return BPromise[_0x5310('0x22')](_0x2fe21b);}return _0x6a950c[_0x5310('0x23')]();};}function saveUpdates(_0x3cd095,_0x12b898){return function(_0x38c4af){if(_0x38c4af){return _0x38c4af[_0x5310('0x24')](_0x3cd095)[_0x5310('0x25')](function(_0x1c8e8a){return _0x1c8e8a;});}return null;};}function removeEntity(_0x1e0e87,_0x4a78f3){return function(_0x4902a1){if(_0x4902a1){return _0x4902a1[_0x5310('0x26')]()['then'](function(){_0x1e0e87[_0x5310('0x1b')](0xcc)[_0x5310('0x27')]();});}};}function handleEntityNotFound(_0x5e9db0,_0x19fbca){return function(_0x3baa0e){if(!_0x3baa0e){_0x5e9db0[_0x5310('0x1a')](0x194);}return _0x3baa0e;};}function handleError(_0x2db375,_0x59a143){_0x59a143=_0x59a143||0x1f4;return function(_0x362258){logger[_0x5310('0x28')](_0x362258[_0x5310('0x29')]);if(_0x362258[_0x5310('0x2a')]){delete _0x362258[_0x5310('0x2a')];}_0x2db375[_0x5310('0x1b')](_0x59a143)['send'](_0x362258);};}exports[_0x5310('0x2b')]=function(_0x2da5f7,_0x415a40){var _0x1c1b72={},_0x4deeb9={},_0x3e502d={'count':0x0,'rows':[]};var _0x2e684c=_[_0x5310('0x2c')](db[_0x5310('0x2d')][_0x5310('0x2e')],function(_0x6ae31b){return{'name':_0x6ae31b['fieldName'],'type':_0x6ae31b[_0x5310('0x2f')][_0x5310('0x30')]};});_0x4deeb9['model']=_[_0x5310('0x2c')](_0x2e684c,_0x5310('0x2a'));_0x4deeb9[_0x5310('0x31')]=_[_0x5310('0x32')](_0x2da5f7[_0x5310('0x31')]);_0x4deeb9[_0x5310('0x33')]=_[_0x5310('0x34')](_0x4deeb9['model'],_0x4deeb9[_0x5310('0x31')]);_0x1c1b72[_0x5310('0x35')]=_['intersection'](_0x4deeb9['model'],qs['fields'](_0x2da5f7[_0x5310('0x31')][_0x5310('0x36')]));_0x1c1b72['attributes']=_0x1c1b72[_0x5310('0x35')][_0x5310('0x37')]?_0x1c1b72[_0x5310('0x35')]:_0x4deeb9[_0x5310('0x38')];if(!_0x2da5f7[_0x5310('0x31')][_0x5310('0x39')](_0x5310('0x3a'))){_0x1c1b72['limit']=qs[_0x5310('0x1f')](_0x2da5f7['query'][_0x5310('0x1f')]);_0x1c1b72[_0x5310('0x1d')]=qs[_0x5310('0x1d')](_0x2da5f7['query']['offset']);}_0x1c1b72['order']=qs[_0x5310('0x3b')](_0x2da5f7['query']['sort']);_0x1c1b72[_0x5310('0x3c')]=qs['filters'](_[_0x5310('0x3d')](_0x2da5f7[_0x5310('0x31')],_0x4deeb9[_0x5310('0x33')]),_0x2e684c);if(_0x2da5f7[_0x5310('0x31')]['filter']){_0x1c1b72[_0x5310('0x3c')]=_['merge'](_0x1c1b72[_0x5310('0x3c')],{'$or':_[_0x5310('0x2c')](_0x2e684c,function(_0x5903b0){if(_0x5903b0[_0x5310('0x2f')]!==_0x5310('0x3e')){var _0x30c183={};_0x30c183[_0x5903b0[_0x5310('0x2a')]]={'$like':'%'+_0x2da5f7['query'][_0x5310('0x3f')]+'%'};return _0x30c183;}})});}_0x1c1b72=_['merge']({},_0x1c1b72,_0x2da5f7[_0x5310('0x40')]);var _0x999b43={'where':_0x1c1b72[_0x5310('0x3c')]};return db['VtigerConfiguration'][_0x5310('0x20')](_0x999b43)[_0x5310('0x25')](function(_0x1a8c4a){_0x3e502d[_0x5310('0x20')]=_0x1a8c4a;if(_0x2da5f7['query']['includeAll']){_0x1c1b72[_0x5310('0x41')]=[{'all':!![]}];}return db[_0x5310('0x2d')][_0x5310('0x42')](_0x1c1b72);})[_0x5310('0x25')](function(_0x83842b){_0x3e502d[_0x5310('0x43')]=_0x83842b;return _0x3e502d;})[_0x5310('0x25')](respondWithFilteredResult(_0x415a40,_0x1c1b72))[_0x5310('0x44')](handleError(_0x415a40,null));};exports[_0x5310('0x45')]=function(_0x1ec2aa,_0x23925a){var _0x3be810={'raw':![],'where':{'id':_0x1ec2aa[_0x5310('0x46')]['id']}},_0x3471b8={};_0x3471b8[_0x5310('0x38')]=_[_0x5310('0x32')](db['VtigerConfiguration']['rawAttributes']);_0x3471b8[_0x5310('0x31')]=_[_0x5310('0x32')](_0x1ec2aa[_0x5310('0x31')]);_0x3471b8[_0x5310('0x33')]=_[_0x5310('0x34')](_0x3471b8[_0x5310('0x38')],_0x3471b8['query']);_0x3be810[_0x5310('0x35')]=_['intersection'](_0x3471b8[_0x5310('0x38')],qs[_0x5310('0x36')](_0x1ec2aa[_0x5310('0x31')]['fields']));_0x3be810[_0x5310('0x35')]=_0x3be810[_0x5310('0x35')][_0x5310('0x37')]?_0x3be810['attributes']:_0x3471b8['model'];if(_0x1ec2aa['query'][_0x5310('0x47')]){_0x3be810[_0x5310('0x41')]=[{'all':!![]}];}_0x3be810=_[_0x5310('0x48')]({},_0x3be810,_0x1ec2aa[_0x5310('0x40')]);return db[_0x5310('0x2d')]['find'](_0x3be810)[_0x5310('0x25')](handleEntityNotFound(_0x23925a,null))['then'](respondWithResult(_0x23925a,null))[_0x5310('0x44')](handleError(_0x23925a,null));};exports[_0x5310('0x49')]=function(_0x11b3a8,_0x37e56a){return db[_0x5310('0x2d')][_0x5310('0x49')](_0x11b3a8[_0x5310('0x4a')],{})['then'](respondWithResult(_0x37e56a,0xc9))[_0x5310('0x44')](handleError(_0x37e56a,null));};exports[_0x5310('0x24')]=function(_0x58d30a,_0x273535){if(_0x58d30a[_0x5310('0x4a')]['id']){delete _0x58d30a['body']['id'];}return db[_0x5310('0x2d')][_0x5310('0x4b')]({'where':{'id':_0x58d30a['params']['id']}})['then'](handleEntityNotFound(_0x273535,null))['then'](saveUpdates(_0x58d30a[_0x5310('0x4a')],null))[_0x5310('0x25')](respondWithResult(_0x273535,null))[_0x5310('0x44')](handleError(_0x273535,null));};exports[_0x5310('0x26')]=function(_0x3e6bb9,_0x5df6f9){return db[_0x5310('0x2d')][_0x5310('0x4b')]({'where':{'id':_0x3e6bb9['params']['id']}})[_0x5310('0x25')](handleEntityNotFound(_0x5df6f9,null))[_0x5310('0x25')](removeEntity(_0x5df6f9,null))['catch'](handleError(_0x5df6f9,null));};exports[_0x5310('0x4c')]=function(_0x280468,_0x2e122b,_0x388f52){var _0x1c9a6b={};var _0x564c7c={};var _0x441b83;var _0x48e1ae;return db[_0x5310('0x2d')][_0x5310('0x4d')]({'where':{'id':_0x280468[_0x5310('0x46')]['id']}})[_0x5310('0x25')](handleEntityNotFound(_0x2e122b,null))['then'](function(_0x46de85){if(_0x46de85){_0x441b83=_0x46de85;_0x564c7c[_0x5310('0x38')]=_[_0x5310('0x32')](db[_0x5310('0x4e')][_0x5310('0x2e')]);_0x564c7c[_0x5310('0x31')]=_[_0x5310('0x32')](_0x280468[_0x5310('0x31')]);_0x564c7c[_0x5310('0x33')]=_['intersection'](_0x564c7c[_0x5310('0x38')],_0x564c7c[_0x5310('0x31')]);_0x1c9a6b['attributes']=_[_0x5310('0x34')](_0x564c7c[_0x5310('0x38')],qs[_0x5310('0x36')](_0x280468['query']['fields']));_0x1c9a6b[_0x5310('0x35')]=_0x1c9a6b[_0x5310('0x35')][_0x5310('0x37')]?_0x1c9a6b[_0x5310('0x35')]:_0x564c7c[_0x5310('0x38')];_0x1c9a6b[_0x5310('0x4f')]=qs['sort'](_0x280468[_0x5310('0x31')]['sort']);_0x1c9a6b[_0x5310('0x3c')]=qs['filters'](_[_0x5310('0x3d')](_0x280468[_0x5310('0x31')],_0x564c7c['filters']));if(_0x280468['query'][_0x5310('0x3f')]){_0x1c9a6b[_0x5310('0x3c')]=_['merge'](_0x1c9a6b['where'],{'$or':_[_0x5310('0x2c')](_0x1c9a6b['attributes'],function(_0x495020){var _0x2fef3d={};_0x2fef3d[_0x495020]={'$like':'%'+_0x280468[_0x5310('0x31')][_0x5310('0x3f')]+'%'};return _0x2fef3d;})});}_0x1c9a6b=_[_0x5310('0x48')]({},_0x1c9a6b,_0x280468[_0x5310('0x40')]);return _0x441b83['getFields'](_0x1c9a6b);}})[_0x5310('0x25')](function(_0x5c5818){if(_0x5c5818){_0x48e1ae=_0x5c5818[_0x5310('0x37')];if(!_0x280468[_0x5310('0x31')][_0x5310('0x39')](_0x5310('0x3a'))){_0x1c9a6b[_0x5310('0x1f')]=qs[_0x5310('0x1f')](_0x280468[_0x5310('0x31')]['limit']);_0x1c9a6b[_0x5310('0x1d')]=qs[_0x5310('0x1d')](_0x280468[_0x5310('0x31')]['offset']);}return _0x441b83[_0x5310('0x4c')](_0x1c9a6b);}})['then'](function(_0x4b264f){if(_0x4b264f){return _0x4b264f?{'count':_0x48e1ae,'rows':_0x4b264f}:null;}})[_0x5310('0x25')](respondWithResult(_0x2e122b,null))[_0x5310('0x44')](handleError(_0x2e122b,null));};exports[_0x5310('0x50')]=function(_0x5b545f,_0x1cbd8c,_0x3054f1){var _0x53113f={};var _0x47e04f={};var _0x2cb478;var _0x46931a;return db[_0x5310('0x2d')][_0x5310('0x4d')]({'where':{'id':_0x5b545f[_0x5310('0x46')]['id']}})[_0x5310('0x25')](handleEntityNotFound(_0x1cbd8c,null))['then'](function(_0x1491e2){if(_0x1491e2){_0x2cb478=_0x1491e2;_0x47e04f[_0x5310('0x38')]=_['keys'](db[_0x5310('0x4e')][_0x5310('0x2e')]);_0x47e04f[_0x5310('0x31')]=_[_0x5310('0x32')](_0x5b545f[_0x5310('0x31')]);_0x47e04f[_0x5310('0x33')]=_[_0x5310('0x34')](_0x47e04f[_0x5310('0x38')],_0x47e04f['query']);_0x53113f['attributes']=_[_0x5310('0x34')](_0x47e04f[_0x5310('0x38')],qs['fields'](_0x5b545f[_0x5310('0x31')][_0x5310('0x36')]));_0x53113f[_0x5310('0x35')]=_0x53113f[_0x5310('0x35')][_0x5310('0x37')]?_0x53113f[_0x5310('0x35')]:_0x47e04f['model'];_0x53113f[_0x5310('0x4f')]=qs[_0x5310('0x3b')](_0x5b545f['query'][_0x5310('0x3b')]);_0x53113f[_0x5310('0x3c')]=qs[_0x5310('0x33')](_['pick'](_0x5b545f[_0x5310('0x31')],_0x47e04f['filters']));if(_0x5b545f[_0x5310('0x31')][_0x5310('0x3f')]){_0x53113f[_0x5310('0x3c')]=_['merge'](_0x53113f['where'],{'$or':_[_0x5310('0x2c')](_0x53113f[_0x5310('0x35')],function(_0x20b19a){var _0x5fe4ea={};_0x5fe4ea[_0x20b19a]={'$like':'%'+_0x5b545f[_0x5310('0x31')][_0x5310('0x3f')]+'%'};return _0x5fe4ea;})});}_0x53113f=_[_0x5310('0x48')]({},_0x53113f,_0x5b545f[_0x5310('0x40')]);return _0x2cb478['getSubjects'](_0x53113f);}})['then'](function(_0x490cf5){if(_0x490cf5){_0x46931a=_0x490cf5[_0x5310('0x37')];if(!_0x5b545f[_0x5310('0x31')]['hasOwnProperty'](_0x5310('0x3a'))){_0x53113f[_0x5310('0x1f')]=qs[_0x5310('0x1f')](_0x5b545f['query'][_0x5310('0x1f')]);_0x53113f[_0x5310('0x1d')]=qs['offset'](_0x5b545f['query'][_0x5310('0x1d')]);}return _0x2cb478[_0x5310('0x50')](_0x53113f);}})[_0x5310('0x25')](function(_0x272a08){if(_0x272a08){return _0x272a08?{'count':_0x46931a,'rows':_0x272a08}:null;}})[_0x5310('0x25')](respondWithResult(_0x1cbd8c,null))[_0x5310('0x44')](handleError(_0x1cbd8c,null));};exports[_0x5310('0x51')]=function(_0x4dd686,_0x1a6881,_0x2c0929){var _0xf4ae48={};var _0xa4eac4={};var _0x5effd2;var _0x51770e;return db[_0x5310('0x2d')][_0x5310('0x4d')]({'where':{'id':_0x4dd686[_0x5310('0x46')]['id']}})[_0x5310('0x25')](handleEntityNotFound(_0x1a6881,null))['then'](function(_0xc40b55){if(_0xc40b55){_0x5effd2=_0xc40b55;_0xa4eac4['model']=_[_0x5310('0x32')](db[_0x5310('0x4e')][_0x5310('0x2e')]);_0xa4eac4[_0x5310('0x31')]=_[_0x5310('0x32')](_0x4dd686[_0x5310('0x31')]);_0xa4eac4['filters']=_[_0x5310('0x34')](_0xa4eac4[_0x5310('0x38')],_0xa4eac4['query']);_0xf4ae48[_0x5310('0x35')]=_['intersection'](_0xa4eac4[_0x5310('0x38')],qs[_0x5310('0x36')](_0x4dd686[_0x5310('0x31')][_0x5310('0x36')]));_0xf4ae48['attributes']=_0xf4ae48[_0x5310('0x35')][_0x5310('0x37')]?_0xf4ae48[_0x5310('0x35')]:_0xa4eac4[_0x5310('0x38')];_0xf4ae48['order']=qs['sort'](_0x4dd686[_0x5310('0x31')][_0x5310('0x3b')]);_0xf4ae48[_0x5310('0x3c')]=qs[_0x5310('0x33')](_[_0x5310('0x3d')](_0x4dd686[_0x5310('0x31')],_0xa4eac4['filters']));if(_0x4dd686['query'][_0x5310('0x3f')]){_0xf4ae48[_0x5310('0x3c')]=_[_0x5310('0x48')](_0xf4ae48[_0x5310('0x3c')],{'$or':_[_0x5310('0x2c')](_0xf4ae48[_0x5310('0x35')],function(_0x1084cb){var _0x354a10={};_0x354a10[_0x1084cb]={'$like':'%'+_0x4dd686[_0x5310('0x31')][_0x5310('0x3f')]+'%'};return _0x354a10;})});}_0xf4ae48=_[_0x5310('0x48')]({},_0xf4ae48,_0x4dd686[_0x5310('0x40')]);return _0x5effd2[_0x5310('0x51')](_0xf4ae48);}})[_0x5310('0x25')](function(_0x1273a6){if(_0x1273a6){_0x51770e=_0x1273a6[_0x5310('0x37')];if(!_0x4dd686[_0x5310('0x31')][_0x5310('0x39')](_0x5310('0x3a'))){_0xf4ae48['limit']=qs['limit'](_0x4dd686[_0x5310('0x31')][_0x5310('0x1f')]);_0xf4ae48['offset']=qs[_0x5310('0x1d')](_0x4dd686[_0x5310('0x31')][_0x5310('0x1d')]);}return _0x5effd2[_0x5310('0x51')](_0xf4ae48);}})['then'](function(_0x4c46c0){if(_0x4c46c0){return _0x4c46c0?{'count':_0x51770e,'rows':_0x4c46c0}:null;}})[_0x5310('0x25')](respondWithResult(_0x1a6881,null))[_0x5310('0x44')](handleError(_0x1a6881,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 7c10c92..8cf1718 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 _0xf072=['bluebird','request-promise','path','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf072,0xdf));var _0x2f07=function(_0x2f3e6d,_0xfd52b9){_0x2f3e6d=_0x2f3e6d-0x0;var _0x37573e=_0xf072[_0x2f3e6d];return _0x37573e;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var logger=require(_0x2f07('0x2'))(_0x2f07('0x3'));var moment=require(_0x2f07('0x4'));var BPromise=require(_0x2f07('0x5'));var rp=require(_0x2f07('0x6'));var fs=require('fs');var path=require(_0x2f07('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2f07('0x8'));module[_0x2f07('0x9')]=function(_0x239381,_0x3be814){return _0x239381[_0x2f07('0xa')]('VtigerConfiguration',attributes,{'tableName':_0x2f07('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x524d=['util','api','moment','bluebird','./intVtigerConfiguration.attributes','exports','define','lodash'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x524d,0xd7));var _0xd524=function(_0x1820dd,_0x520f64){_0x1820dd=_0x1820dd-0x0;var _0x44e682=_0x524d[_0x1820dd];return _0x44e682;};'use strict';var _=require(_0xd524('0x0'));var util=require(_0xd524('0x1'));var logger=require('../../config/logger')(_0xd524('0x2'));var moment=require(_0xd524('0x3'));var BPromise=require(_0xd524('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(_0xd524('0x5'));module[_0xd524('0x6')]=function(_0x450c25,_0x221595){return _0x450c25[_0xd524('0x7')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index b2eee3c..47b42de 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 _0x1a55=['result','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0x3766dc,_0x3c1fac){var _0x9f06c4=function(_0x1a27be){while(--_0x1a27be){_0x3766dc['push'](_0x3766dc['shift']());}};_0x9f06c4(++_0x3c1fac);}(_0x1a55,0x1b9));var _0x51a5=function(_0x4156ac,_0x5143ed){_0x4156ac=_0x4156ac-0x0;var _0x54bd63=_0x1a55[_0x4156ac];return _0x54bd63;};'use strict';var _=require(_0x51a5('0x0'));var util=require('util');var moment=require(_0x51a5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51a5('0x2'));var db=require(_0x51a5('0x3'))['db'];var utils=require(_0x51a5('0x4'));var logger=require('../../config/logger')(_0x51a5('0x5'));var config=require(_0x51a5('0x6'));var jayson=require(_0x51a5('0x7'));var client=jayson[_0x51a5('0x8')][_0x51a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47a891,_0x6c6ae8,_0x1e4a0a){return new BPromise(function(_0x5c6f99,_0x1c86e3){return client[_0x51a5('0xa')](_0x47a891,_0x1e4a0a)[_0x51a5('0xb')](function(_0x3a75e5){logger[_0x51a5('0xc')](_0x51a5('0xd'),_0x6c6ae8,'request\x20sent');logger[_0x51a5('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x6c6ae8,_0x51a5('0xf'),JSON[_0x51a5('0x10')](_0x3a75e5));if(_0x3a75e5[_0x51a5('0x11')]){if(_0x3a75e5[_0x51a5('0x11')]['code']===0x1f4){logger[_0x51a5('0x11')](_0x51a5('0xd'),_0x6c6ae8,_0x3a75e5['error'][_0x51a5('0x12')]);return _0x1c86e3(_0x3a75e5['error'][_0x51a5('0x12')]);}logger['error'](_0x51a5('0xd'),_0x6c6ae8,_0x3a75e5[_0x51a5('0x11')][_0x51a5('0x12')]);return _0x5c6f99(_0x3a75e5[_0x51a5('0x11')]['message']);}else{logger[_0x51a5('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x6c6ae8,_0x51a5('0xf'));_0x5c6f99(_0x3a75e5[_0x51a5('0x13')][_0x51a5('0x12')]);}})['catch'](function(_0x2557ec){logger[_0x51a5('0x11')](_0x51a5('0xd'),_0x6c6ae8,_0x2557ec);_0x1c86e3(_0x2557ec);});});} \ No newline at end of file +var _0x0a02=['../../config/logger','../../config/environment','jayson/promise','client','http','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x4a53cd,_0x1303be){var _0xba171e=function(_0x7d118e){while(--_0x7d118e){_0x4a53cd['push'](_0x4a53cd['shift']());}};_0xba171e(++_0x1303be);}(_0x0a02,0x1db));var _0x20a0=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0x0a02[_0x2bfd4f];return _0x341849;};'use strict';var _=require(_0x20a0('0x0'));var util=require(_0x20a0('0x1'));var moment=require(_0x20a0('0x2'));var BPromise=require(_0x20a0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20a0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x20a0('0x5'))('rpc');var config=require(_0x20a0('0x6'));var jayson=require(_0x20a0('0x7'));var client=jayson[_0x20a0('0x8')][_0x20a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10d699,_0x19f936,_0x1aeaa8){return new BPromise(function(_0x3b1277,_0x370953){return client['request'](_0x10d699,_0x1aeaa8)[_0x20a0('0xa')](function(_0x309e1f){logger['info'](_0x20a0('0xb'),_0x19f936,_0x20a0('0xc'));logger[_0x20a0('0xd')](_0x20a0('0xe'),_0x19f936,_0x20a0('0xc'),JSON['stringify'](_0x309e1f));if(_0x309e1f[_0x20a0('0xf')]){if(_0x309e1f[_0x20a0('0xf')][_0x20a0('0x10')]===0x1f4){logger['error'](_0x20a0('0xb'),_0x19f936,_0x309e1f[_0x20a0('0xf')][_0x20a0('0x11')]);return _0x370953(_0x309e1f[_0x20a0('0xf')]['message']);}logger[_0x20a0('0xf')](_0x20a0('0xb'),_0x19f936,_0x309e1f[_0x20a0('0xf')][_0x20a0('0x11')]);return _0x3b1277(_0x309e1f[_0x20a0('0xf')][_0x20a0('0x11')]);}else{logger['info'](_0x20a0('0xb'),_0x19f936,_0x20a0('0xc'));_0x3b1277(_0x309e1f[_0x20a0('0x12')][_0x20a0('0x11')]);}})[_0x20a0('0x13')](function(_0x382ef7){logger[_0x20a0('0xf')](_0x20a0('0xb'),_0x19f936,_0x382ef7);_0x370953(_0x382ef7);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index a4b4652..7635997 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 _0x2f85=['put','/:id','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','create'];(function(_0x32792d,_0x2f0aae){var _0x4e09aa=function(_0x133f75){while(--_0x133f75){_0x32792d['push'](_0x32792d['shift']());}};_0x4e09aa(++_0x2f0aae);}(_0x2f85,0x148));var _0x52f8=function(_0x50152f,_0x39b919){_0x50152f=_0x50152f-0x0;var _0x462e7c=_0x2f85[_0x50152f];return _0x462e7c;};'use strict';var multer=require(_0x52f8('0x0'));var util=require(_0x52f8('0x1'));var path=require('path');var timeout=require(_0x52f8('0x2'));var express=require('express');var router=express[_0x52f8('0x3')]();var fs_extra=require(_0x52f8('0x4'));var auth=require(_0x52f8('0x5'));var interaction=require(_0x52f8('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router['get']('/',auth[_0x52f8('0x7')](),controller[_0x52f8('0x8')]);router['get']('/:id',auth[_0x52f8('0x7')](),controller['show']);router['post']('/',auth[_0x52f8('0x7')](),controller[_0x52f8('0x9')]);router[_0x52f8('0xa')](_0x52f8('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x52f8('0xb'),auth[_0x52f8('0x7')](),controller['destroy']);module[_0x52f8('0xc')]=router; \ No newline at end of file +var _0xcb12=['delete','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create','put','update'];(function(_0x4a1a94,_0xaa54e3){var _0x280caf=function(_0x1c2652){while(--_0x1c2652){_0x4a1a94['push'](_0x4a1a94['shift']());}};_0x280caf(++_0xaa54e3);}(_0xcb12,0x17c));var _0x2cb1=function(_0x146b0a,_0x4e25bf){_0x146b0a=_0x146b0a-0x0;var _0x4bf1be=_0xcb12[_0x146b0a];return _0x4bf1be;};'use strict';var multer=require(_0x2cb1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2cb1('0x1'));var express=require(_0x2cb1('0x2'));var router=express['Router']();var fs_extra=require(_0x2cb1('0x3'));var auth=require(_0x2cb1('0x4'));var interaction=require(_0x2cb1('0x5'));var config=require(_0x2cb1('0x6'));var controller=require(_0x2cb1('0x7'));router[_0x2cb1('0x8')]('/',auth[_0x2cb1('0x9')](),controller[_0x2cb1('0xa')]);router['get'](_0x2cb1('0xb'),auth[_0x2cb1('0x9')](),controller[_0x2cb1('0xc')]);router['post']('/',auth[_0x2cb1('0x9')](),controller[_0x2cb1('0xd')]);router[_0x2cb1('0xe')](_0x2cb1('0xb'),auth['isAuthenticated'](),controller[_0x2cb1('0xf')]);router[_0x2cb1('0x10')](_0x2cb1('0xb'),auth[_0x2cb1('0x9')](),controller[_0x2cb1('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 8accb44..5a8e355 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 _0x07fc=['string','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','STRING'];(function(_0x411758,_0x1e0438){var _0x139fb5=function(_0x5888b9){while(--_0x5888b9){_0x411758['push'](_0x411758['shift']());}};_0x139fb5(++_0x1e0438);}(_0x07fc,0xda));var _0xc07f=function(_0x3a0f33,_0x430902){_0x3a0f33=_0x3a0f33-0x0;var _0x26d99e=_0x07fc[_0x3a0f33];return _0x26d99e;};'use strict';var Sequelize=require(_0xc07f('0x0'));module[_0xc07f('0x1')]={'type':{'type':Sequelize[_0xc07f('0x2')]('string',_0xc07f('0x3'),_0xc07f('0x4'),_0xc07f('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xc07f('0x6')]},'key':{'type':Sequelize[_0xc07f('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xc07f('0x7'),_0xc07f('0x3'),_0xc07f('0x4'))},'keyContent':{'type':Sequelize[_0xc07f('0x6')]},'idField':{'type':Sequelize[_0xc07f('0x6')]},'nameField':{'type':Sequelize[_0xc07f('0x6')]},'customField':{'type':Sequelize[_0xc07f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc07f('0x6')]}}; \ No newline at end of file +var _0x8925=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x142621,_0xb4e397){var _0x3d31ee=function(_0x285158){while(--_0x285158){_0x142621['push'](_0x142621['shift']());}};_0x3d31ee(++_0xb4e397);}(_0x8925,0x179));var _0x5892=function(_0x60fa35,_0x12abc6){_0x60fa35=_0x60fa35-0x0;var _0x2d9933=_0x8925[_0x60fa35];return _0x2d9933;};'use strict';var Sequelize=require(_0x5892('0x0'));module[_0x5892('0x1')]={'type':{'type':Sequelize[_0x5892('0x2')](_0x5892('0x3'),_0x5892('0x4'),_0x5892('0x5'),_0x5892('0x6'),_0x5892('0x7')),'defaultValue':_0x5892('0x3')},'content':{'type':Sequelize[_0x5892('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x5892('0x4'),_0x5892('0x5'))},'keyContent':{'type':Sequelize[_0x5892('0x8')]},'idField':{'type':Sequelize[_0x5892('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5892('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5892('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b662f5e..44527b9 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 _0xa604=['then','destroy','end','error','name','send','index','map','VtigerField','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','keys','rawAttributes','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update'];(function(_0x5a483f,_0x451854){var _0x45a963=function(_0x3ac23d){while(--_0x3ac23d){_0x5a483f['push'](_0x5a483f['shift']());}};_0x45a963(++_0x451854);}(_0xa604,0x74));var _0x4a60=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa604[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4a60('0x0'));var rimraf=require(_0x4a60('0x1'));var zipdir=require(_0x4a60('0x2'));var jsonpatch=require(_0x4a60('0x3'));var rp=require(_0x4a60('0x4'));var moment=require(_0x4a60('0x5'));var BPromise=require(_0x4a60('0x6'));var Mustache=require(_0x4a60('0x7'));var util=require('util');var path=require(_0x4a60('0x8'));var sox=require(_0x4a60('0x9'));var csv=require(_0x4a60('0xa'));var ejs=require(_0x4a60('0xb'));var fs=require('fs');var fs_extra=require(_0x4a60('0xc'));var _=require(_0x4a60('0xd'));var squel=require(_0x4a60('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4a60('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4a60('0x10'));var Papa=require(_0x4a60('0x11'));var Redis=require(_0x4a60('0x12'));var authService=require(_0x4a60('0x13'));var qs=require(_0x4a60('0x14'));var as=require(_0x4a60('0x15'));var hardwareService=require(_0x4a60('0x16'));var logger=require(_0x4a60('0x17'))(_0x4a60('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4a60('0x19'));var db=require(_0x4a60('0x1a'))['db'];function respondWithStatusCode(_0x1779bc,_0x53575b){_0x53575b=_0x53575b||0xcc;return function(_0x78fa71){if(_0x78fa71){return _0x1779bc[_0x4a60('0x1b')](_0x53575b);}return _0x1779bc[_0x4a60('0x1c')](_0x53575b)['end']();};}function respondWithResult(_0x1d3dc8,_0x569de6){_0x569de6=_0x569de6||0xc8;return function(_0x39558d){if(_0x39558d){return _0x1d3dc8[_0x4a60('0x1c')](_0x569de6)[_0x4a60('0x1d')](_0x39558d);}};}function respondWithFilteredResult(_0x2f8beb,_0x353f4e){return function(_0x4d1d3a){if(_0x4d1d3a){var _0x5aa916=typeof _0x353f4e['offset']===_0x4a60('0x1e')&&typeof _0x353f4e[_0x4a60('0x1f')]===_0x4a60('0x1e');var _0x568b7d=_0x4d1d3a['count'];var _0x1c6852=_0x5aa916?0x0:_0x353f4e[_0x4a60('0x20')];var _0x2a911d=_0x5aa916?_0x4d1d3a[_0x4a60('0x21')]:_0x353f4e[_0x4a60('0x20')]+_0x353f4e[_0x4a60('0x1f')];var _0x59196c;if(_0x2a911d>=_0x568b7d){_0x2a911d=_0x568b7d;_0x59196c=0xc8;}else{_0x59196c=0xce;}_0x2f8beb[_0x4a60('0x1c')](_0x59196c);return _0x2f8beb[_0x4a60('0x22')](_0x4a60('0x23'),_0x1c6852+'-'+_0x2a911d+'/'+_0x568b7d)[_0x4a60('0x1d')](_0x4d1d3a);}return null;};}function patchUpdates(_0x58375e){return function(_0x4f7cd6){try{jsonpatch[_0x4a60('0x24')](_0x4f7cd6,_0x58375e,!![]);}catch(_0x3a36ee){return BPromise[_0x4a60('0x25')](_0x3a36ee);}return _0x4f7cd6[_0x4a60('0x26')]();};}function saveUpdates(_0x2cf876,_0x62404e){return function(_0x1be4be){if(_0x1be4be){return _0x1be4be[_0x4a60('0x27')](_0x2cf876)[_0x4a60('0x28')](function(_0xca5244){return _0xca5244;});}return null;};}function removeEntity(_0x5e972f,_0xde608){return function(_0x2f756d){if(_0x2f756d){return _0x2f756d[_0x4a60('0x29')]()[_0x4a60('0x28')](function(){_0x5e972f['status'](0xcc)[_0x4a60('0x2a')]();});}};}function handleEntityNotFound(_0x47422c,_0x29e2aa){return function(_0x318899){if(!_0x318899){_0x47422c[_0x4a60('0x1b')](0x194);}return _0x318899;};}function handleError(_0x1b1bba,_0x31ab38){_0x31ab38=_0x31ab38||0x1f4;return function(_0x22d8a0){logger[_0x4a60('0x2b')](_0x22d8a0['stack']);if(_0x22d8a0['name']){delete _0x22d8a0[_0x4a60('0x2c')];}_0x1b1bba['status'](_0x31ab38)[_0x4a60('0x2d')](_0x22d8a0);};}exports[_0x4a60('0x2e')]=function(_0x156c4d,_0x3532c4){var _0x187331={},_0x3b8fb7={},_0xa1371={'count':0x0,'rows':[]};var _0x3ae42f=_[_0x4a60('0x2f')](db[_0x4a60('0x30')]['rawAttributes'],function(_0x484bc5){return{'name':_0x484bc5[_0x4a60('0x31')],'type':_0x484bc5[_0x4a60('0x32')][_0x4a60('0x33')]};});_0x3b8fb7[_0x4a60('0x34')]=_['map'](_0x3ae42f,_0x4a60('0x2c'));_0x3b8fb7[_0x4a60('0x35')]=_['keys'](_0x156c4d[_0x4a60('0x35')]);_0x3b8fb7[_0x4a60('0x36')]=_[_0x4a60('0x37')](_0x3b8fb7[_0x4a60('0x34')],_0x3b8fb7[_0x4a60('0x35')]);_0x187331[_0x4a60('0x38')]=_[_0x4a60('0x37')](_0x3b8fb7[_0x4a60('0x34')],qs[_0x4a60('0x39')](_0x156c4d[_0x4a60('0x35')][_0x4a60('0x39')]));_0x187331[_0x4a60('0x38')]=_0x187331[_0x4a60('0x38')][_0x4a60('0x3a')]?_0x187331['attributes']:_0x3b8fb7[_0x4a60('0x34')];if(!_0x156c4d['query']['hasOwnProperty'](_0x4a60('0x3b'))){_0x187331[_0x4a60('0x1f')]=qs[_0x4a60('0x1f')](_0x156c4d[_0x4a60('0x35')][_0x4a60('0x1f')]);_0x187331[_0x4a60('0x20')]=qs['offset'](_0x156c4d[_0x4a60('0x35')][_0x4a60('0x20')]);}_0x187331[_0x4a60('0x3c')]=qs['sort'](_0x156c4d[_0x4a60('0x35')][_0x4a60('0x3d')]);_0x187331[_0x4a60('0x3e')]=qs[_0x4a60('0x36')](_['pick'](_0x156c4d['query'],_0x3b8fb7['filters']),_0x3ae42f);if(_0x156c4d[_0x4a60('0x35')][_0x4a60('0x3f')]){_0x187331[_0x4a60('0x3e')]=_[_0x4a60('0x40')](_0x187331[_0x4a60('0x3e')],{'$or':_[_0x4a60('0x2f')](_0x3ae42f,function(_0x492aa5){if(_0x492aa5[_0x4a60('0x32')]!==_0x4a60('0x41')){var _0x3832b1={};_0x3832b1[_0x492aa5['name']]={'$like':'%'+_0x156c4d[_0x4a60('0x35')][_0x4a60('0x3f')]+'%'};return _0x3832b1;}})});}_0x187331=_[_0x4a60('0x40')]({},_0x187331,_0x156c4d[_0x4a60('0x42')]);var _0x11298b={'where':_0x187331[_0x4a60('0x3e')]};return db[_0x4a60('0x30')]['count'](_0x11298b)[_0x4a60('0x28')](function(_0x731160){_0xa1371[_0x4a60('0x21')]=_0x731160;if(_0x156c4d[_0x4a60('0x35')][_0x4a60('0x43')]){_0x187331['include']=[{'all':!![]}];}return db[_0x4a60('0x30')][_0x4a60('0x44')](_0x187331);})['then'](function(_0x30fa37){_0xa1371[_0x4a60('0x45')]=_0x30fa37;return _0xa1371;})[_0x4a60('0x28')](respondWithFilteredResult(_0x3532c4,_0x187331))[_0x4a60('0x46')](handleError(_0x3532c4,null));};exports['show']=function(_0x37e79f,_0x89c419){var _0x8789e0={'raw':!![],'where':{'id':_0x37e79f['params']['id']}},_0x5a8ae7={};_0x5a8ae7[_0x4a60('0x34')]=_[_0x4a60('0x47')](db[_0x4a60('0x30')][_0x4a60('0x48')]);_0x5a8ae7[_0x4a60('0x35')]=_[_0x4a60('0x47')](_0x37e79f['query']);_0x5a8ae7[_0x4a60('0x36')]=_['intersection'](_0x5a8ae7[_0x4a60('0x34')],_0x5a8ae7[_0x4a60('0x35')]);_0x8789e0[_0x4a60('0x38')]=_['intersection'](_0x5a8ae7[_0x4a60('0x34')],qs[_0x4a60('0x39')](_0x37e79f['query'][_0x4a60('0x39')]));_0x8789e0[_0x4a60('0x38')]=_0x8789e0['attributes'][_0x4a60('0x3a')]?_0x8789e0[_0x4a60('0x38')]:_0x5a8ae7[_0x4a60('0x34')];if(_0x37e79f[_0x4a60('0x35')][_0x4a60('0x43')]){_0x8789e0[_0x4a60('0x49')]=[{'all':!![]}];}_0x8789e0=_[_0x4a60('0x40')]({},_0x8789e0,_0x37e79f['options']);return db['VtigerField'][_0x4a60('0x4a')](_0x8789e0)[_0x4a60('0x28')](handleEntityNotFound(_0x89c419,null))[_0x4a60('0x28')](respondWithResult(_0x89c419,null))[_0x4a60('0x46')](handleError(_0x89c419,null));};exports[_0x4a60('0x4b')]=function(_0x28e181,_0x40077e){return db[_0x4a60('0x30')][_0x4a60('0x4b')](_0x28e181[_0x4a60('0x4c')],{})[_0x4a60('0x28')](respondWithResult(_0x40077e,0xc9))['catch'](handleError(_0x40077e,null));};exports['update']=function(_0x5504fc,_0x442866){if(_0x5504fc[_0x4a60('0x4c')]['id']){delete _0x5504fc[_0x4a60('0x4c')]['id'];}return db[_0x4a60('0x30')][_0x4a60('0x4a')]({'where':{'id':_0x5504fc[_0x4a60('0x4d')]['id']}})[_0x4a60('0x28')](handleEntityNotFound(_0x442866,null))[_0x4a60('0x28')](saveUpdates(_0x5504fc[_0x4a60('0x4c')],null))[_0x4a60('0x28')](respondWithResult(_0x442866,null))[_0x4a60('0x46')](handleError(_0x442866,null));};exports[_0x4a60('0x29')]=function(_0x48a584,_0x3eb237){return db[_0x4a60('0x30')][_0x4a60('0x4a')]({'where':{'id':_0x48a584[_0x4a60('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3eb237,null))['then'](removeEntity(_0x3eb237,null))[_0x4a60('0x46')](handleError(_0x3eb237,null));}; \ No newline at end of file +var _0x4e47=['body','params','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','type','include','VtigerField','findAll','rows','catch','show','includeAll','find','create'];(function(_0x84f57c,_0x2ea321){var _0x37507a=function(_0x2fc746){while(--_0x2fc746){_0x84f57c['push'](_0x84f57c['shift']());}};_0x37507a(++_0x2ea321);}(_0x4e47,0x16a));var _0x74e4=function(_0xef0a44,_0x40378d){_0xef0a44=_0xef0a44-0x0;var _0x33b1be=_0x4e47[_0xef0a44];return _0x33b1be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74e4('0x0'));var zipdir=require(_0x74e4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74e4('0x2'));var moment=require(_0x74e4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74e4('0x4'));var util=require('util');var path=require(_0x74e4('0x5'));var sox=require(_0x74e4('0x6'));var csv=require(_0x74e4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x74e4('0x8'));var _=require(_0x74e4('0x9'));var squel=require(_0x74e4('0xa'));var crypto=require(_0x74e4('0xb'));var jsforce=require(_0x74e4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x74e4('0xd'));var Papa=require(_0x74e4('0xe'));var Redis=require(_0x74e4('0xf'));var authService=require(_0x74e4('0x10'));var qs=require(_0x74e4('0x11'));var as=require(_0x74e4('0x12'));var hardwareService=require(_0x74e4('0x13'));var logger=require(_0x74e4('0x14'))(_0x74e4('0x15'));var utils=require(_0x74e4('0x16'));var config=require(_0x74e4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d4f3d,_0x1ceac1){_0x1ceac1=_0x1ceac1||0xcc;return function(_0x65dde3){if(_0x65dde3){return _0x2d4f3d[_0x74e4('0x18')](_0x1ceac1);}return _0x2d4f3d['status'](_0x1ceac1)['end']();};}function respondWithResult(_0xa0d82,_0x2c6d78){_0x2c6d78=_0x2c6d78||0xc8;return function(_0x43062b){if(_0x43062b){return _0xa0d82[_0x74e4('0x19')](_0x2c6d78)[_0x74e4('0x1a')](_0x43062b);}};}function respondWithFilteredResult(_0x443637,_0x4f8173){return function(_0x1bcd1a){if(_0x1bcd1a){var _0x28d969=typeof _0x4f8173[_0x74e4('0x1b')]===_0x74e4('0x1c')&&typeof _0x4f8173['limit']===_0x74e4('0x1c');var _0x75d350=_0x1bcd1a[_0x74e4('0x1d')];var _0x540559=_0x28d969?0x0:_0x4f8173[_0x74e4('0x1b')];var _0xcbb179=_0x28d969?_0x1bcd1a[_0x74e4('0x1d')]:_0x4f8173[_0x74e4('0x1b')]+_0x4f8173[_0x74e4('0x1e')];var _0x4860ba;if(_0xcbb179>=_0x75d350){_0xcbb179=_0x75d350;_0x4860ba=0xc8;}else{_0x4860ba=0xce;}_0x443637['status'](_0x4860ba);return _0x443637[_0x74e4('0x1f')](_0x74e4('0x20'),_0x540559+'-'+_0xcbb179+'/'+_0x75d350)[_0x74e4('0x1a')](_0x1bcd1a);}return null;};}function patchUpdates(_0xaec222){return function(_0x1c0703){try{jsonpatch[_0x74e4('0x21')](_0x1c0703,_0xaec222,!![]);}catch(_0x19c854){return BPromise['reject'](_0x19c854);}return _0x1c0703[_0x74e4('0x22')]();};}function saveUpdates(_0x4de96b,_0x862cf9){return function(_0x443864){if(_0x443864){return _0x443864[_0x74e4('0x23')](_0x4de96b)[_0x74e4('0x24')](function(_0x1dce21){return _0x1dce21;});}return null;};}function removeEntity(_0x42a2cb,_0x11fbed){return function(_0x535f05){if(_0x535f05){return _0x535f05[_0x74e4('0x25')]()[_0x74e4('0x24')](function(){_0x42a2cb['status'](0xcc)[_0x74e4('0x26')]();});}};}function handleEntityNotFound(_0x540b1f,_0xdc132e){return function(_0x42b805){if(!_0x42b805){_0x540b1f['sendStatus'](0x194);}return _0x42b805;};}function handleError(_0x25dd7c,_0x2a497e){_0x2a497e=_0x2a497e||0x1f4;return function(_0x5339d8){logger[_0x74e4('0x27')](_0x5339d8['stack']);if(_0x5339d8['name']){delete _0x5339d8[_0x74e4('0x28')];}_0x25dd7c[_0x74e4('0x19')](_0x2a497e)['send'](_0x5339d8);};}exports[_0x74e4('0x29')]=function(_0x18c772,_0x2b548d){var _0x20a72c={},_0x26c2f7={},_0x22809f={'count':0x0,'rows':[]};var _0x437cb9=_[_0x74e4('0x2a')](db['VtigerField'][_0x74e4('0x2b')],function(_0x494986){return{'name':_0x494986[_0x74e4('0x2c')],'type':_0x494986['type'][_0x74e4('0x2d')]};});_0x26c2f7[_0x74e4('0x2e')]=_['map'](_0x437cb9,'name');_0x26c2f7[_0x74e4('0x2f')]=_[_0x74e4('0x30')](_0x18c772[_0x74e4('0x2f')]);_0x26c2f7[_0x74e4('0x31')]=_[_0x74e4('0x32')](_0x26c2f7[_0x74e4('0x2e')],_0x26c2f7[_0x74e4('0x2f')]);_0x20a72c['attributes']=_[_0x74e4('0x32')](_0x26c2f7[_0x74e4('0x2e')],qs[_0x74e4('0x33')](_0x18c772['query'][_0x74e4('0x33')]));_0x20a72c[_0x74e4('0x34')]=_0x20a72c['attributes'][_0x74e4('0x35')]?_0x20a72c['attributes']:_0x26c2f7[_0x74e4('0x2e')];if(!_0x18c772[_0x74e4('0x2f')]['hasOwnProperty'](_0x74e4('0x36'))){_0x20a72c[_0x74e4('0x1e')]=qs[_0x74e4('0x1e')](_0x18c772[_0x74e4('0x2f')][_0x74e4('0x1e')]);_0x20a72c[_0x74e4('0x1b')]=qs['offset'](_0x18c772['query'][_0x74e4('0x1b')]);}_0x20a72c[_0x74e4('0x37')]=qs[_0x74e4('0x38')](_0x18c772[_0x74e4('0x2f')][_0x74e4('0x38')]);_0x20a72c[_0x74e4('0x39')]=qs['filters'](_[_0x74e4('0x3a')](_0x18c772[_0x74e4('0x2f')],_0x26c2f7[_0x74e4('0x31')]),_0x437cb9);if(_0x18c772['query'][_0x74e4('0x3b')]){_0x20a72c[_0x74e4('0x39')]=_['merge'](_0x20a72c[_0x74e4('0x39')],{'$or':_[_0x74e4('0x2a')](_0x437cb9,function(_0x39bcc7){if(_0x39bcc7[_0x74e4('0x3c')]!=='VIRTUAL'){var _0x33a8a5={};_0x33a8a5[_0x39bcc7[_0x74e4('0x28')]]={'$like':'%'+_0x18c772[_0x74e4('0x2f')][_0x74e4('0x3b')]+'%'};return _0x33a8a5;}})});}_0x20a72c=_['merge']({},_0x20a72c,_0x18c772['options']);var _0x12a5ca={'where':_0x20a72c[_0x74e4('0x39')]};return db['VtigerField'][_0x74e4('0x1d')](_0x12a5ca)[_0x74e4('0x24')](function(_0x6ee7b3){_0x22809f[_0x74e4('0x1d')]=_0x6ee7b3;if(_0x18c772[_0x74e4('0x2f')]['includeAll']){_0x20a72c[_0x74e4('0x3d')]=[{'all':!![]}];}return db[_0x74e4('0x3e')][_0x74e4('0x3f')](_0x20a72c);})[_0x74e4('0x24')](function(_0x41006b){_0x22809f[_0x74e4('0x40')]=_0x41006b;return _0x22809f;})[_0x74e4('0x24')](respondWithFilteredResult(_0x2b548d,_0x20a72c))[_0x74e4('0x41')](handleError(_0x2b548d,null));};exports[_0x74e4('0x42')]=function(_0x646872,_0x761279){var _0x253ea2={'raw':!![],'where':{'id':_0x646872['params']['id']}},_0x7a934d={};_0x7a934d[_0x74e4('0x2e')]=_[_0x74e4('0x30')](db[_0x74e4('0x3e')][_0x74e4('0x2b')]);_0x7a934d['query']=_[_0x74e4('0x30')](_0x646872[_0x74e4('0x2f')]);_0x7a934d[_0x74e4('0x31')]=_[_0x74e4('0x32')](_0x7a934d[_0x74e4('0x2e')],_0x7a934d[_0x74e4('0x2f')]);_0x253ea2[_0x74e4('0x34')]=_[_0x74e4('0x32')](_0x7a934d[_0x74e4('0x2e')],qs[_0x74e4('0x33')](_0x646872[_0x74e4('0x2f')][_0x74e4('0x33')]));_0x253ea2[_0x74e4('0x34')]=_0x253ea2[_0x74e4('0x34')]['length']?_0x253ea2[_0x74e4('0x34')]:_0x7a934d[_0x74e4('0x2e')];if(_0x646872['query'][_0x74e4('0x43')]){_0x253ea2[_0x74e4('0x3d')]=[{'all':!![]}];}_0x253ea2=_['merge']({},_0x253ea2,_0x646872['options']);return db[_0x74e4('0x3e')][_0x74e4('0x44')](_0x253ea2)[_0x74e4('0x24')](handleEntityNotFound(_0x761279,null))[_0x74e4('0x24')](respondWithResult(_0x761279,null))[_0x74e4('0x41')](handleError(_0x761279,null));};exports[_0x74e4('0x45')]=function(_0x53ffc8,_0x3b4ec2){return db[_0x74e4('0x3e')][_0x74e4('0x45')](_0x53ffc8['body'],{})['then'](respondWithResult(_0x3b4ec2,0xc9))[_0x74e4('0x41')](handleError(_0x3b4ec2,null));};exports[_0x74e4('0x23')]=function(_0x4a2298,_0x25a1c8){if(_0x4a2298[_0x74e4('0x46')]['id']){delete _0x4a2298[_0x74e4('0x46')]['id'];}return db[_0x74e4('0x3e')][_0x74e4('0x44')]({'where':{'id':_0x4a2298[_0x74e4('0x47')]['id']}})[_0x74e4('0x24')](handleEntityNotFound(_0x25a1c8,null))['then'](saveUpdates(_0x4a2298[_0x74e4('0x46')],null))[_0x74e4('0x24')](respondWithResult(_0x25a1c8,null))[_0x74e4('0x41')](handleError(_0x25a1c8,null));};exports[_0x74e4('0x25')]=function(_0x2e6cf7,_0xcb436c){return db[_0x74e4('0x3e')][_0x74e4('0x44')]({'where':{'id':_0x2e6cf7['params']['id']}})[_0x74e4('0x24')](handleEntityNotFound(_0xcb436c,null))[_0x74e4('0x24')](removeEntity(_0xcb436c,null))[_0x74e4('0x41')](handleError(_0xcb436c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 0a39d66..7a4dde8 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 _0x5995=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','vtiger_unique_index','idField','FieldId'];(function(_0x45aac5,_0x5e79a7){var _0x5d5f25=function(_0x56bd52){while(--_0x56bd52){_0x45aac5['push'](_0x45aac5['shift']());}};_0x5d5f25(++_0x5e79a7);}(_0x5995,0x10a));var _0x5599=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x5995[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x5599('0x0'));var util=require(_0x5599('0x1'));var logger=require(_0x5599('0x2'))(_0x5599('0x3'));var moment=require(_0x5599('0x4'));var BPromise=require('bluebird');var rp=require(_0x5599('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5599('0x6'));var config=require(_0x5599('0x7'));var attributes=require(_0x5599('0x8'));module['exports']=function(_0x2791fc,_0x27afb0){return _0x2791fc[_0x5599('0x9')](_0x5599('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x5599('0xb'),'fields':[_0x5599('0xc'),_0x5599('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4aca=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField'];(function(_0x44ae0b,_0x3e9865){var _0x69232a=function(_0x5ae588){while(--_0x5ae588){_0x44ae0b['push'](_0x44ae0b['shift']());}};_0x69232a(++_0x3e9865);}(_0x4aca,0x159));var _0xa4ac=function(_0x3c7035,_0x3e57bb){_0x3c7035=_0x3c7035-0x0;var _0x2bdbea=_0x4aca[_0x3c7035];return _0x2bdbea;};'use strict';var _=require('lodash');var util=require(_0xa4ac('0x0'));var logger=require(_0xa4ac('0x1'))(_0xa4ac('0x2'));var moment=require(_0xa4ac('0x3'));var BPromise=require(_0xa4ac('0x4'));var rp=require(_0xa4ac('0x5'));var fs=require('fs');var path=require(_0xa4ac('0x6'));var rimraf=require(_0xa4ac('0x7'));var config=require('../../config/environment');var attributes=require(_0xa4ac('0x8'));module[_0xa4ac('0x9')]=function(_0x444461,_0x303815){return _0x444461[_0xa4ac('0xa')](_0xa4ac('0xb'),attributes,{'tableName':_0xa4ac('0xc'),'paranoid':![],'indexes':[{'name':_0xa4ac('0xd'),'fields':[_0xa4ac('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index f922a03..aaaf7da 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 _0x64de=['catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','VtigerField,\x20%s,\x20%s','message','result'];(function(_0x151693,_0x3f075c){var _0x50eb86=function(_0x16c3dc){while(--_0x16c3dc){_0x151693['push'](_0x151693['shift']());}};_0x50eb86(++_0x3f075c);}(_0x64de,0x10f));var _0xe64d=function(_0x11a5b9,_0x346de4){_0x11a5b9=_0x11a5b9-0x0;var _0x3d24d8=_0x64de[_0x11a5b9];return _0x3d24d8;};'use strict';var _=require(_0xe64d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe64d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe64d('0x2'));var db=require(_0xe64d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe64d('0x4'))(_0xe64d('0x5'));var config=require(_0xe64d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe64d('0x7')][_0xe64d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ed26d,_0x246f3b,_0x392d34){return new BPromise(function(_0x59a9d7,_0xc8750e){return client['request'](_0x3ed26d,_0x392d34)['then'](function(_0x14b66a){logger[_0xe64d('0x9')]('VtigerField,\x20%s,\x20%s',_0x246f3b,_0xe64d('0xa'));logger[_0xe64d('0xb')](_0xe64d('0xc'),_0x246f3b,_0xe64d('0xa'),JSON['stringify'](_0x14b66a));if(_0x14b66a['error']){if(_0x14b66a['error']['code']===0x1f4){logger[_0xe64d('0xd')](_0xe64d('0xe'),_0x246f3b,_0x14b66a[_0xe64d('0xd')]['message']);return _0xc8750e(_0x14b66a[_0xe64d('0xd')][_0xe64d('0xf')]);}logger['error'](_0xe64d('0xe'),_0x246f3b,_0x14b66a[_0xe64d('0xd')]['message']);return _0x59a9d7(_0x14b66a[_0xe64d('0xd')]['message']);}else{logger[_0xe64d('0x9')](_0xe64d('0xe'),_0x246f3b,_0xe64d('0xa'));_0x59a9d7(_0x14b66a[_0xe64d('0x10')]['message']);}})[_0xe64d('0x11')](function(_0x5091ca){logger['error'](_0xe64d('0xe'),_0x246f3b,_0x5091ca);_0xc8750e(_0x5091ca);});});} \ No newline at end of file +var _0xd3d7=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x155857,_0x2318d6){var _0x32a1fd=function(_0x3d9702){while(--_0x3d9702){_0x155857['push'](_0x155857['shift']());}};_0x32a1fd(++_0x2318d6);}(_0xd3d7,0x11a));var _0x7d3d=function(_0x34e993,_0x41eaa7){_0x34e993=_0x34e993-0x0;var _0x18c11a=_0xd3d7[_0x34e993];return _0x18c11a;};'use strict';var _=require(_0x7d3d('0x0'));var util=require(_0x7d3d('0x1'));var moment=require(_0x7d3d('0x2'));var BPromise=require(_0x7d3d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d3d('0x4'));var db=require(_0x7d3d('0x5'))['db'];var utils=require(_0x7d3d('0x6'));var logger=require(_0x7d3d('0x7'))(_0x7d3d('0x8'));var config=require('../../config/environment');var jayson=require(_0x7d3d('0x9'));var client=jayson[_0x7d3d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x65777c,_0x409f2d,_0x18e47f){return new BPromise(function(_0x31b8cf,_0x5a8e85){return client[_0x7d3d('0xb')](_0x65777c,_0x18e47f)[_0x7d3d('0xc')](function(_0x5b4f76){logger['info'](_0x7d3d('0xd'),_0x409f2d,_0x7d3d('0xe'));logger[_0x7d3d('0xf')](_0x7d3d('0x10'),_0x409f2d,_0x7d3d('0xe'),JSON[_0x7d3d('0x11')](_0x5b4f76));if(_0x5b4f76[_0x7d3d('0x12')]){if(_0x5b4f76[_0x7d3d('0x12')]['code']===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x409f2d,_0x5b4f76[_0x7d3d('0x12')]['message']);return _0x5a8e85(_0x5b4f76[_0x7d3d('0x12')][_0x7d3d('0x13')]);}logger['error'](_0x7d3d('0xd'),_0x409f2d,_0x5b4f76[_0x7d3d('0x12')][_0x7d3d('0x13')]);return _0x31b8cf(_0x5b4f76[_0x7d3d('0x12')]['message']);}else{logger[_0x7d3d('0x14')](_0x7d3d('0xd'),_0x409f2d,'request\x20sent');_0x31b8cf(_0x5b4f76[_0x7d3d('0x15')][_0x7d3d('0x13')]);}})[_0x7d3d('0x16')](function(_0x471662){logger[_0x7d3d('0x12')](_0x7d3d('0xd'),_0x409f2d,_0x471662);_0x5a8e85(_0x471662);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 79d5881..24dc9bb 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 _0x99bd=['/:id','show','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','create','addConfiguration','update','delete','destroy','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index'];(function(_0x1693e1,_0xcd6a2e){var _0x29ccb0=function(_0x469627){while(--_0x469627){_0x1693e1['push'](_0x1693e1['shift']());}};_0x29ccb0(++_0xcd6a2e);}(_0x99bd,0xb4));var _0xd99b=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x99bd[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0xd99b('0x0'));var util=require(_0xd99b('0x1'));var path=require(_0xd99b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd99b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd99b('0x4'));var config=require(_0xd99b('0x5'));var controller=require(_0xd99b('0x6'));router[_0xd99b('0x7')]('/',auth['isAuthenticated'](),controller[_0xd99b('0x8')]);router[_0xd99b('0x7')](_0xd99b('0x9'),auth['isAuthenticated'](),controller[_0xd99b('0xa')]);router['get'](_0xd99b('0xb'),auth[_0xd99b('0xc')](),controller[_0xd99b('0xd')]);router[_0xd99b('0x7')]('/:id/fields',auth[_0xd99b('0xc')](),controller[_0xd99b('0xe')]);router[_0xd99b('0xf')]('/',auth['isAuthenticated'](),controller[_0xd99b('0x10')]);router[_0xd99b('0xf')](_0xd99b('0xb'),auth[_0xd99b('0xc')](),controller[_0xd99b('0x11')]);router['put'](_0xd99b('0x9'),auth[_0xd99b('0xc')](),controller[_0xd99b('0x12')]);router[_0xd99b('0x13')](_0xd99b('0x9'),auth['isAuthenticated'](),controller[_0xd99b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x2f3d=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','./intZendeskAccount.controller','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','/:id'];(function(_0x261d8b,_0x47ec7a){var _0x40adbd=function(_0x85fc0c){while(--_0x85fc0c){_0x261d8b['push'](_0x261d8b['shift']());}};_0x40adbd(++_0x47ec7a);}(_0x2f3d,0x152));var _0xd2f3=function(_0x4bccf7,_0x206ba2){_0x4bccf7=_0x4bccf7-0x0;var _0x2377b4=_0x2f3d[_0x4bccf7];return _0x2377b4;};'use strict';var multer=require('multer');var util=require(_0xd2f3('0x0'));var path=require(_0xd2f3('0x1'));var timeout=require(_0xd2f3('0x2'));var express=require(_0xd2f3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd2f3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2f3('0x5'));router['get']('/',auth[_0xd2f3('0x6')](),controller[_0xd2f3('0x7')]);router['get']('/:id',auth[_0xd2f3('0x6')](),controller['show']);router[_0xd2f3('0x8')](_0xd2f3('0x9'),auth['isAuthenticated'](),controller[_0xd2f3('0xa')]);router[_0xd2f3('0x8')](_0xd2f3('0xb'),auth['isAuthenticated'](),controller[_0xd2f3('0xc')]);router[_0xd2f3('0xd')]('/',auth[_0xd2f3('0x6')](),controller[_0xd2f3('0xe')]);router[_0xd2f3('0xd')](_0xd2f3('0x9'),auth[_0xd2f3('0x6')](),controller[_0xd2f3('0xf')]);router[_0xd2f3('0x10')]('/:id',auth[_0xd2f3('0x6')](),controller['update']);router[_0xd2f3('0x11')](_0xd2f3('0x12'),auth['isAuthenticated'](),controller[_0xd2f3('0x13')]);module[_0xd2f3('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index ca313aa..2521bfc 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 _0xacd6=['remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xacd6,0xef));var _0x6acd=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0xacd6[_0x208d75];return _0x382d27;};'use strict';var Sequelize=require(_0x6acd('0x0'));module[_0x6acd('0x1')]={'name':{'type':Sequelize[_0x6acd('0x2')]},'description':{'type':Sequelize[_0x6acd('0x2')]},'username':{'type':Sequelize[_0x6acd('0x2')],'unique':_0x6acd('0x3')},'password':{'type':Sequelize[_0x6acd('0x2')]},'token':{'type':Sequelize[_0x6acd('0x2')]},'remoteUri':{'type':Sequelize[_0x6acd('0x2')],'unique':_0x6acd('0x4')},'authType':{'type':Sequelize[_0x6acd('0x5')](_0x6acd('0x6'),'token'),'defaultValue':_0x6acd('0x6')},'serverUrl':{'type':Sequelize[_0x6acd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6acd('0x5')](_0x6acd('0x7'),_0x6acd('0x8')),'defaultValue':_0x6acd('0x7')}}; \ No newline at end of file +var _0x01d9=['sequelize','exports','STRING','username','remoteUri','ENUM','password','integrationTab','newTab'];(function(_0x5cb571,_0xaa1b82){var _0x30a784=function(_0x52a74d){while(--_0x52a74d){_0x5cb571['push'](_0x5cb571['shift']());}};_0x30a784(++_0xaa1b82);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x901d('0x0'));module[_0x901d('0x1')]={'name':{'type':Sequelize[_0x901d('0x2')]},'description':{'type':Sequelize[_0x901d('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x901d('0x3')},'password':{'type':Sequelize[_0x901d('0x2')]},'token':{'type':Sequelize[_0x901d('0x2')]},'remoteUri':{'type':Sequelize[_0x901d('0x2')],'unique':_0x901d('0x4')},'authType':{'type':Sequelize[_0x901d('0x5')](_0x901d('0x6'),'token'),'defaultValue':_0x901d('0x6')},'serverUrl':{'type':Sequelize[_0x901d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x901d('0x5')](_0x901d('0x7'),_0x901d('0x8')),'defaultValue':_0x901d('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index c4baac8..c83031b 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 _0x6324=['error','name','send','index','ZendeskAccount','key','model','map','keys','query','intersection','fields','attributes','length','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ZendeskField','Subjects','Descriptions','getFields','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','assignee','remove','includes','ticket_fields','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0x25c411,_0x6fef75){var _0x256acd=function(_0x120865){while(--_0x120865){_0x25c411['push'](_0x25c411['shift']());}};_0x256acd(++_0x6fef75);}(_0x6324,0x142));var _0x4632=function(_0x1ef4ee,_0xd87a11){_0x1ef4ee=_0x1ef4ee-0x0;var _0xabf86f=_0x6324[_0x1ef4ee];return _0xabf86f;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4632('0x18'));function respondWithStatusCode(_0x499d88,_0x4719f7){_0x4719f7=_0x4719f7||0xcc;return function(_0x299073){if(_0x299073){return _0x499d88[_0x4632('0x19')](_0x4719f7);}return _0x499d88[_0x4632('0x1a')](_0x4719f7)['end']();};}function respondWithResult(_0x3ba361,_0x255882){_0x255882=_0x255882||0xc8;return function(_0x3b9901){if(_0x3b9901){return _0x3ba361[_0x4632('0x1a')](_0x255882)[_0x4632('0x1b')](_0x3b9901);}};}function respondWithFilteredResult(_0x5438ab,_0x47b349){return function(_0x2fd7ae){if(_0x2fd7ae){var _0x38bedd=typeof _0x47b349[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x47b349['limit']===_0x4632('0x1d');var _0x113872=_0x2fd7ae[_0x4632('0x1e')];var _0x5b28b7=_0x38bedd?0x0:_0x47b349[_0x4632('0x1c')];var _0x1894bb=_0x38bedd?_0x2fd7ae['count']:_0x47b349['offset']+_0x47b349[_0x4632('0x1f')];var _0x3cf2bd;if(_0x1894bb>=_0x113872){_0x1894bb=_0x113872;_0x3cf2bd=0xc8;}else{_0x3cf2bd=0xce;}_0x5438ab[_0x4632('0x1a')](_0x3cf2bd);return _0x5438ab[_0x4632('0x20')](_0x4632('0x21'),_0x5b28b7+'-'+_0x1894bb+'/'+_0x113872)[_0x4632('0x1b')](_0x2fd7ae);}return null;};}function patchUpdates(_0x9ab826){return function(_0x468ccb){try{jsonpatch[_0x4632('0x22')](_0x468ccb,_0x9ab826,!![]);}catch(_0x3ea0d1){return BPromise[_0x4632('0x23')](_0x3ea0d1);}return _0x468ccb[_0x4632('0x24')]();};}function saveUpdates(_0x2ca6a5,_0x263907){return function(_0x4cfebc){if(_0x4cfebc){return _0x4cfebc[_0x4632('0x25')](_0x2ca6a5)[_0x4632('0x26')](function(_0x3537ed){return _0x3537ed;});}return null;};}function removeEntity(_0x380a9f,_0x1e1b86){return function(_0x38cbbc){if(_0x38cbbc){return _0x38cbbc[_0x4632('0x27')]()[_0x4632('0x26')](function(){_0x380a9f[_0x4632('0x1a')](0xcc)[_0x4632('0x28')]();});}};}function handleEntityNotFound(_0x1b8de0,_0x4af026){return function(_0x2e3428){if(!_0x2e3428){_0x1b8de0[_0x4632('0x19')](0x194);}return _0x2e3428;};}function handleError(_0x372679,_0x22d0f5){_0x22d0f5=_0x22d0f5||0x1f4;return function(_0x2a0b11){logger[_0x4632('0x29')](_0x2a0b11['stack']);if(_0x2a0b11['name']){delete _0x2a0b11[_0x4632('0x2a')];}_0x372679[_0x4632('0x1a')](_0x22d0f5)[_0x4632('0x2b')](_0x2a0b11);};}exports[_0x4632('0x2c')]=function(_0x34079f,_0x119d1b){var _0x3570b2={},_0x5e2ee4={},_0x42d505={'count':0x0,'rows':[]};var _0x135fd2=_['map'](db[_0x4632('0x2d')]['rawAttributes'],function(_0x6599ad){return{'name':_0x6599ad['fieldName'],'type':_0x6599ad['type'][_0x4632('0x2e')]};});_0x5e2ee4[_0x4632('0x2f')]=_[_0x4632('0x30')](_0x135fd2,'name');_0x5e2ee4['query']=_[_0x4632('0x31')](_0x34079f[_0x4632('0x32')]);_0x5e2ee4['filters']=_['intersection'](_0x5e2ee4[_0x4632('0x2f')],_0x5e2ee4[_0x4632('0x32')]);_0x3570b2['attributes']=_[_0x4632('0x33')](_0x5e2ee4[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x34079f[_0x4632('0x32')][_0x4632('0x34')]));_0x3570b2['attributes']=_0x3570b2[_0x4632('0x35')][_0x4632('0x36')]?_0x3570b2['attributes']:_0x5e2ee4['model'];if(!_0x34079f[_0x4632('0x32')]['hasOwnProperty']('nolimit')){_0x3570b2[_0x4632('0x1f')]=qs['limit'](_0x34079f[_0x4632('0x32')][_0x4632('0x1f')]);_0x3570b2[_0x4632('0x1c')]=qs['offset'](_0x34079f[_0x4632('0x32')][_0x4632('0x1c')]);}_0x3570b2[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x34079f[_0x4632('0x32')]['sort']);_0x3570b2['where']=qs[_0x4632('0x39')](_[_0x4632('0x3a')](_0x34079f[_0x4632('0x32')],_0x5e2ee4['filters']),_0x135fd2);if(_0x34079f['query']['filter']){_0x3570b2[_0x4632('0x3b')]=_[_0x4632('0x3c')](_0x3570b2['where'],{'$or':_[_0x4632('0x30')](_0x135fd2,function(_0x20a700){if(_0x20a700[_0x4632('0x3d')]!==_0x4632('0x3e')){var _0x2309f1={};_0x2309f1[_0x20a700[_0x4632('0x2a')]]={'$like':'%'+_0x34079f[_0x4632('0x32')][_0x4632('0x3f')]+'%'};return _0x2309f1;}})});}_0x3570b2=_[_0x4632('0x3c')]({},_0x3570b2,_0x34079f[_0x4632('0x40')]);var _0x1fd3f1={'where':_0x3570b2[_0x4632('0x3b')]};return db['ZendeskAccount'][_0x4632('0x1e')](_0x1fd3f1)[_0x4632('0x26')](function(_0x4c0e13){_0x42d505[_0x4632('0x1e')]=_0x4c0e13;if(_0x34079f[_0x4632('0x32')]['includeAll']){_0x3570b2[_0x4632('0x41')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x4632('0x42')](_0x3570b2);})[_0x4632('0x26')](function(_0x1bfb36){_0x42d505[_0x4632('0x43')]=_0x1bfb36;return _0x42d505;})['then'](respondWithFilteredResult(_0x119d1b,_0x3570b2))[_0x4632('0x44')](handleError(_0x119d1b,null));};exports[_0x4632('0x45')]=function(_0x23ef38,_0x279298){var _0x5cc716={'raw':![],'where':{'id':_0x23ef38[_0x4632('0x46')]['id']}},_0x5b3fa9={};_0x5b3fa9[_0x4632('0x2f')]=_[_0x4632('0x31')](db['ZendeskAccount'][_0x4632('0x47')]);_0x5b3fa9[_0x4632('0x32')]=_[_0x4632('0x31')](_0x23ef38[_0x4632('0x32')]);_0x5b3fa9[_0x4632('0x39')]=_[_0x4632('0x33')](_0x5b3fa9[_0x4632('0x2f')],_0x5b3fa9['query']);_0x5cc716[_0x4632('0x35')]=_[_0x4632('0x33')](_0x5b3fa9[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x23ef38[_0x4632('0x32')]['fields']));_0x5cc716['attributes']=_0x5cc716[_0x4632('0x35')][_0x4632('0x36')]?_0x5cc716[_0x4632('0x35')]:_0x5b3fa9[_0x4632('0x2f')];if(_0x23ef38['query'][_0x4632('0x48')]){_0x5cc716[_0x4632('0x41')]=[{'all':!![]}];}_0x5cc716=_[_0x4632('0x3c')]({},_0x5cc716,_0x23ef38[_0x4632('0x40')]);return db[_0x4632('0x2d')]['find'](_0x5cc716)[_0x4632('0x26')](handleEntityNotFound(_0x279298,null))[_0x4632('0x26')](respondWithResult(_0x279298,null))[_0x4632('0x44')](handleError(_0x279298,null));};exports[_0x4632('0x49')]=function(_0x3676fa,_0x2eb8b0){return db[_0x4632('0x2d')][_0x4632('0x49')](_0x3676fa[_0x4632('0x4a')],{})[_0x4632('0x26')](respondWithResult(_0x2eb8b0,0xc9))[_0x4632('0x44')](handleError(_0x2eb8b0,null));};exports['update']=function(_0xc3ffd0,_0x1ccadb){if(_0xc3ffd0[_0x4632('0x4a')]['id']){delete _0xc3ffd0['body']['id'];}return db[_0x4632('0x2d')][_0x4632('0x4b')]({'where':{'id':_0xc3ffd0[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x1ccadb,null))[_0x4632('0x26')](saveUpdates(_0xc3ffd0[_0x4632('0x4a')],null))[_0x4632('0x26')](respondWithResult(_0x1ccadb,null))[_0x4632('0x44')](handleError(_0x1ccadb,null));};exports[_0x4632('0x27')]=function(_0x1aa831,_0x4e89e3){return db[_0x4632('0x2d')][_0x4632('0x4b')]({'where':{'id':_0x1aa831['params']['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x4e89e3,null))[_0x4632('0x26')](removeEntity(_0x4e89e3,null))[_0x4632('0x44')](handleError(_0x4e89e3,null));};exports[_0x4632('0x4c')]=function(_0x2c59f5,_0xfeeac0,_0x248dcf){var _0xf4880f={};var _0x31b42d={};var _0x1b66e0;var _0x3e66d8;return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x2c59f5[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0xfeeac0,null))[_0x4632('0x26')](function(_0x32cd35){if(_0x32cd35){_0x1b66e0=_0x32cd35;_0x31b42d[_0x4632('0x2f')]=_[_0x4632('0x31')](db[_0x4632('0x4e')]['rawAttributes']);_0x31b42d[_0x4632('0x32')]=_[_0x4632('0x31')](_0x2c59f5[_0x4632('0x32')]);_0x31b42d[_0x4632('0x39')]=_[_0x4632('0x33')](_0x31b42d[_0x4632('0x2f')],_0x31b42d['query']);_0xf4880f[_0x4632('0x35')]=_[_0x4632('0x33')](_0x31b42d[_0x4632('0x2f')],qs['fields'](_0x2c59f5[_0x4632('0x32')][_0x4632('0x34')]));_0xf4880f['attributes']=_0xf4880f[_0x4632('0x35')][_0x4632('0x36')]?_0xf4880f[_0x4632('0x35')]:_0x31b42d['model'];_0xf4880f[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x2c59f5[_0x4632('0x32')][_0x4632('0x38')]);_0xf4880f[_0x4632('0x3b')]=qs[_0x4632('0x39')](_[_0x4632('0x3a')](_0x2c59f5[_0x4632('0x32')],_0x31b42d[_0x4632('0x39')]));if(_0x2c59f5[_0x4632('0x32')]['filter']){_0xf4880f[_0x4632('0x3b')]=_[_0x4632('0x3c')](_0xf4880f['where'],{'$or':_[_0x4632('0x30')](_0xf4880f['attributes'],function(_0x48e942){var _0xa55d76={};_0xa55d76[_0x48e942]={'$like':'%'+_0x2c59f5[_0x4632('0x32')][_0x4632('0x3f')]+'%'};return _0xa55d76;})});}_0xf4880f=_[_0x4632('0x3c')]({},_0xf4880f,_0x2c59f5[_0x4632('0x40')]);return _0x1b66e0[_0x4632('0x4c')](_0xf4880f);}})[_0x4632('0x26')](function(_0x3e2849){if(_0x3e2849){_0x3e66d8=_0x3e2849[_0x4632('0x36')];if(!_0x2c59f5[_0x4632('0x32')][_0x4632('0x4f')](_0x4632('0x50'))){_0xf4880f[_0x4632('0x1f')]=qs[_0x4632('0x1f')](_0x2c59f5['query']['limit']);_0xf4880f[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x2c59f5[_0x4632('0x32')][_0x4632('0x1c')]);}return _0x1b66e0[_0x4632('0x4c')](_0xf4880f);}})[_0x4632('0x26')](function(_0x5b66ee){if(_0x5b66ee){return _0x5b66ee?{'count':_0x3e66d8,'rows':_0x5b66ee}:null;}})[_0x4632('0x26')](respondWithResult(_0xfeeac0,null))[_0x4632('0x44')](handleError(_0xfeeac0,null));};exports[_0x4632('0x51')]=function(_0x2e4d57,_0x5d1994,_0x529be1){if(_0x2e4d57[_0x4632('0x4a')]['id']){delete _0x2e4d57['body']['id'];}return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x2e4d57[_0x4632('0x46')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x5d1994,null))[_0x4632('0x26')](function(_0x5e5669){if(_0x5e5669){_0x2e4d57[_0x4632('0x4a')][_0x4632('0x52')]=_0x5e5669['id'];_0x2e4d57['body']['Subjects']=integrations[_0x4632('0x53')](_0x2e4d57[_0x4632('0x4a')][_0x4632('0x54')],_0x2e4d57[_0x4632('0x4a')]['type']);_0x2e4d57['body']['Descriptions']=integrations[_0x4632('0x55')](_0x2e4d57['body'][_0x4632('0x54')],_0x2e4d57[_0x4632('0x4a')][_0x4632('0x3d')]);return db[_0x4632('0x4e')][_0x4632('0x49')](_0x2e4d57[_0x4632('0x4a')],{'include':[{'model':db[_0x4632('0x56')],'as':_0x4632('0x57')},{'model':db[_0x4632('0x56')],'as':_0x4632('0x58')}]});}return null;})[_0x4632('0x26')](respondWithResult(_0x5d1994,null))[_0x4632('0x44')](handleError(_0x5d1994,null));};exports[_0x4632('0x59')]=function(_0x3d5e65,_0x461700,_0x1b2905){var _0x550c4d='';return db[_0x4632('0x2d')][_0x4632('0x4d')]({'where':{'id':_0x3d5e65[_0x4632('0x46')]['id']},'attributes':['id',_0x4632('0x5a'),_0x4632('0x5b'),_0x4632('0x5c'),_0x4632('0x5d'),_0x4632('0x5e')]})[_0x4632('0x26')](handleEntityNotFound(_0x461700,null))[_0x4632('0x26')](function(_0x16ed40){if(_0x16ed40){_0x550c4d=_0x16ed40[_0x4632('0x5e')];var _0x27e2a6=_0x550c4d['slice'](-0x1);if(_0x27e2a6==='/'){_0x550c4d=_0x550c4d[_0x4632('0x5f')](0x0,_0x550c4d[_0x4632('0x60')](_0x27e2a6));}var _0x348af1={'method':_0x4632('0x61'),'uri':util[_0x4632('0x62')](_0x4632('0x63'),_0x550c4d,'ticket_fields'),'json':!![]};switch(_0x16ed40[_0x4632('0x5d')]){case _0x4632('0x5b'):_0x348af1['headers']={'Authorization':util[_0x4632('0x62')](_0x4632('0x64'),new Buffer(util[_0x4632('0x62')](_0x4632('0x65'),_0x16ed40[_0x4632('0x5a')],_0x16ed40['password']))[_0x4632('0x66')](_0x4632('0x67')))};break;case _0x4632('0x5c'):_0x348af1['headers']={'Authorization':util[_0x4632('0x62')](_0x4632('0x64'),new Buffer(util[_0x4632('0x62')](_0x4632('0x68'),_0x16ed40[_0x4632('0x5a')],_0x16ed40[_0x4632('0x5c')]))[_0x4632('0x66')](_0x4632('0x67')))};break;default:throw new db['Sequelize'][(_0x4632('0x69'))](_0x4632('0x6a'));}return rp(_0x348af1);}})[_0x4632('0x26')](function(_0x525bf9){if(_0x525bf9){var _0xfc48bd=[_0x4632('0x6b'),'description','group',_0x4632('0x6c')];_[_0x4632('0x6d')](_0x525bf9['ticket_fields'],function(_0x63d3e1){return _0xfc48bd[_0x4632('0x6e')](_0x63d3e1[_0x4632('0x3d')]);});return{'count':_0x525bf9[_0x4632('0x6f')][_0x4632('0x36')],'rows':_[_0x4632('0x30')](_0x525bf9[_0x4632('0x6f')],function(_0x130b52){return{'id':_0x130b52['id'],'name':_0x130b52['position']>0x7?_0x130b52[_0x4632('0x70')]:_0x130b52[_0x4632('0x3d')],'custom':_0x130b52[_0x4632('0x71')]>0x7?!![]:![],'options':_0x130b52[_0x4632('0x72')]?_0x130b52['system_field_options']:_0x130b52[_0x4632('0x73')]?_0x130b52[_0x4632('0x73')]:[]};})};}})[_0x4632('0x26')](respondWithResult(_0x461700,null))[_0x4632('0x44')](function(_0x3cee1d){var _0x4ca8a8=_0x3d5e65[_0x4632('0x32')][_0x4632('0x74')]?0x1f4:_0x3cee1d[_0x4632('0x75')]||0x1f4;logger[_0x4632('0x29')](_0x4632('0x76'),_0x4632('0x59'),_0x4ca8a8,JSON[_0x4632('0x77')](_0x3cee1d));delete _0x3cee1d[_0x4632('0x2a')];if(_0x4ca8a8===0x191){_0x4ca8a8=0x190;}_0x461700['status'](_0x4ca8a8)[_0x4632('0x2b')](_0x3d5e65[_0x4632('0x32')][_0x4632('0x74')]?{'message':_0x4632('0x78'),'statusCode':_0x3cee1d[_0x4632('0x75')]}:_0x3cee1d);});}; \ No newline at end of file +var _0x13f6=['where','pick','filters','filter','merge','VIRTUAL','options','ZendeskAccount','include','findAll','rows','show','params','find','catch','create','body','order','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','remove','includes','title','position','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','send','test','statusCode','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x797067,_0x33db4d){var _0x17ab63=function(_0x3db19a){while(--_0x3db19a){_0x797067['push'](_0x797067['shift']());}};_0x17ab63(++_0x33db4d);}(_0x13f6,0x124));var _0x613f=function(_0x2b18ba,_0x5bbe72){_0x2b18ba=_0x2b18ba-0x0;var _0x5db9a2=_0x13f6[_0x2b18ba];return _0x5db9a2;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4c2a85,_0x517f57){_0x517f57=_0x517f57||0xcc;return function(_0x38d90a){if(_0x38d90a){return _0x4c2a85[_0x613f('0x16')](_0x517f57);}return _0x4c2a85[_0x613f('0x17')](_0x517f57)[_0x613f('0x18')]();};}function respondWithResult(_0x329fcf,_0x4a6fc){_0x4a6fc=_0x4a6fc||0xc8;return function(_0x305894){if(_0x305894){return _0x329fcf[_0x613f('0x17')](_0x4a6fc)[_0x613f('0x19')](_0x305894);}};}function respondWithFilteredResult(_0x1d68fd,_0x548218){return function(_0x3c9edf){if(_0x3c9edf){var _0x5d7c69=typeof _0x548218['offset']===_0x613f('0x1a')&&typeof _0x548218[_0x613f('0x1b')]==='undefined';var _0x39e417=_0x3c9edf['count'];var _0x62ebfe=_0x5d7c69?0x0:_0x548218[_0x613f('0x1c')];var _0x431266=_0x5d7c69?_0x3c9edf[_0x613f('0x1d')]:_0x548218[_0x613f('0x1c')]+_0x548218[_0x613f('0x1b')];var _0x4e412c;if(_0x431266>=_0x39e417){_0x431266=_0x39e417;_0x4e412c=0xc8;}else{_0x4e412c=0xce;}_0x1d68fd['status'](_0x4e412c);return _0x1d68fd[_0x613f('0x1e')]('Content-Range',_0x62ebfe+'-'+_0x431266+'/'+_0x39e417)['json'](_0x3c9edf);}return null;};}function patchUpdates(_0x3c9b58){return function(_0x446562){try{jsonpatch['apply'](_0x446562,_0x3c9b58,!![]);}catch(_0x19123f){return BPromise[_0x613f('0x1f')](_0x19123f);}return _0x446562[_0x613f('0x20')]();};}function saveUpdates(_0x48b28a,_0x5401c2){return function(_0x11f5f3){if(_0x11f5f3){return _0x11f5f3[_0x613f('0x21')](_0x48b28a)[_0x613f('0x22')](function(_0x51f376){return _0x51f376;});}return null;};}function removeEntity(_0x41104e,_0x33e0c6){return function(_0x30de90){if(_0x30de90){return _0x30de90[_0x613f('0x23')]()[_0x613f('0x22')](function(){_0x41104e['status'](0xcc)[_0x613f('0x18')]();});}};}function handleEntityNotFound(_0x204185,_0x51bba1){return function(_0x22035f){if(!_0x22035f){_0x204185[_0x613f('0x16')](0x194);}return _0x22035f;};}function handleError(_0x32e747,_0x4a878d){_0x4a878d=_0x4a878d||0x1f4;return function(_0x53e32b){logger['error'](_0x53e32b[_0x613f('0x24')]);if(_0x53e32b['name']){delete _0x53e32b[_0x613f('0x25')];}_0x32e747[_0x613f('0x17')](_0x4a878d)['send'](_0x53e32b);};}exports[_0x613f('0x26')]=function(_0x2551c1,_0x4c8aa1){var _0x4cff5d={},_0x4f892d={},_0x24be7c={'count':0x0,'rows':[]};var _0x7c1a94=_[_0x613f('0x27')](db['ZendeskAccount'][_0x613f('0x28')],function(_0x439478){return{'name':_0x439478[_0x613f('0x29')],'type':_0x439478[_0x613f('0x2a')]['key']};});_0x4f892d[_0x613f('0x2b')]=_[_0x613f('0x27')](_0x7c1a94,_0x613f('0x25'));_0x4f892d[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x2551c1[_0x613f('0x2c')]);_0x4f892d['filters']=_[_0x613f('0x2e')](_0x4f892d[_0x613f('0x2b')],_0x4f892d[_0x613f('0x2c')]);_0x4cff5d['attributes']=_[_0x613f('0x2e')](_0x4f892d['model'],qs[_0x613f('0x2f')](_0x2551c1[_0x613f('0x2c')][_0x613f('0x2f')]));_0x4cff5d[_0x613f('0x30')]=_0x4cff5d[_0x613f('0x30')][_0x613f('0x31')]?_0x4cff5d['attributes']:_0x4f892d[_0x613f('0x2b')];if(!_0x2551c1[_0x613f('0x2c')][_0x613f('0x32')](_0x613f('0x33'))){_0x4cff5d[_0x613f('0x1b')]=qs['limit'](_0x2551c1['query']['limit']);_0x4cff5d[_0x613f('0x1c')]=qs[_0x613f('0x1c')](_0x2551c1[_0x613f('0x2c')][_0x613f('0x1c')]);}_0x4cff5d['order']=qs[_0x613f('0x34')](_0x2551c1[_0x613f('0x2c')]['sort']);_0x4cff5d[_0x613f('0x35')]=qs['filters'](_[_0x613f('0x36')](_0x2551c1['query'],_0x4f892d[_0x613f('0x37')]),_0x7c1a94);if(_0x2551c1['query'][_0x613f('0x38')]){_0x4cff5d[_0x613f('0x35')]=_[_0x613f('0x39')](_0x4cff5d['where'],{'$or':_[_0x613f('0x27')](_0x7c1a94,function(_0x2c6a0c){if(_0x2c6a0c[_0x613f('0x2a')]!==_0x613f('0x3a')){var _0x474432={};_0x474432[_0x2c6a0c[_0x613f('0x25')]]={'$like':'%'+_0x2551c1[_0x613f('0x2c')][_0x613f('0x38')]+'%'};return _0x474432;}})});}_0x4cff5d=_[_0x613f('0x39')]({},_0x4cff5d,_0x2551c1[_0x613f('0x3b')]);var _0x4da8d3={'where':_0x4cff5d[_0x613f('0x35')]};return db[_0x613f('0x3c')][_0x613f('0x1d')](_0x4da8d3)[_0x613f('0x22')](function(_0x301d33){_0x24be7c[_0x613f('0x1d')]=_0x301d33;if(_0x2551c1[_0x613f('0x2c')]['includeAll']){_0x4cff5d[_0x613f('0x3d')]=[{'all':!![]}];}return db[_0x613f('0x3c')][_0x613f('0x3e')](_0x4cff5d);})[_0x613f('0x22')](function(_0x59d34f){_0x24be7c[_0x613f('0x3f')]=_0x59d34f;return _0x24be7c;})[_0x613f('0x22')](respondWithFilteredResult(_0x4c8aa1,_0x4cff5d))['catch'](handleError(_0x4c8aa1,null));};exports[_0x613f('0x40')]=function(_0x18f427,_0x3bb605){var _0x2f584e={'raw':![],'where':{'id':_0x18f427[_0x613f('0x41')]['id']}},_0x3952c9={};_0x3952c9[_0x613f('0x2b')]=_[_0x613f('0x2d')](db[_0x613f('0x3c')][_0x613f('0x28')]);_0x3952c9[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x18f427[_0x613f('0x2c')]);_0x3952c9['filters']=_[_0x613f('0x2e')](_0x3952c9[_0x613f('0x2b')],_0x3952c9[_0x613f('0x2c')]);_0x2f584e[_0x613f('0x30')]=_['intersection'](_0x3952c9[_0x613f('0x2b')],qs[_0x613f('0x2f')](_0x18f427[_0x613f('0x2c')][_0x613f('0x2f')]));_0x2f584e[_0x613f('0x30')]=_0x2f584e[_0x613f('0x30')][_0x613f('0x31')]?_0x2f584e[_0x613f('0x30')]:_0x3952c9[_0x613f('0x2b')];if(_0x18f427[_0x613f('0x2c')]['includeAll']){_0x2f584e['include']=[{'all':!![]}];}_0x2f584e=_[_0x613f('0x39')]({},_0x2f584e,_0x18f427[_0x613f('0x3b')]);return db['ZendeskAccount'][_0x613f('0x42')](_0x2f584e)[_0x613f('0x22')](handleEntityNotFound(_0x3bb605,null))[_0x613f('0x22')](respondWithResult(_0x3bb605,null))[_0x613f('0x43')](handleError(_0x3bb605,null));};exports[_0x613f('0x44')]=function(_0x1c0b07,_0x412dd4){return db[_0x613f('0x3c')][_0x613f('0x44')](_0x1c0b07[_0x613f('0x45')],{})[_0x613f('0x22')](respondWithResult(_0x412dd4,0xc9))[_0x613f('0x43')](handleError(_0x412dd4,null));};exports[_0x613f('0x21')]=function(_0x17f8e5,_0x1fd46c){if(_0x17f8e5[_0x613f('0x45')]['id']){delete _0x17f8e5[_0x613f('0x45')]['id'];}return db[_0x613f('0x3c')]['find']({'where':{'id':_0x17f8e5['params']['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x1fd46c,null))[_0x613f('0x22')](saveUpdates(_0x17f8e5['body'],null))['then'](respondWithResult(_0x1fd46c,null))[_0x613f('0x43')](handleError(_0x1fd46c,null));};exports['destroy']=function(_0x513bf1,_0x6e006b){return db[_0x613f('0x3c')][_0x613f('0x42')]({'where':{'id':_0x513bf1['params']['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x6e006b,null))[_0x613f('0x22')](removeEntity(_0x6e006b,null))['catch'](handleError(_0x6e006b,null));};exports['getConfigurations']=function(_0x1c0c8e,_0x30d7b1,_0x13b585){var _0x145009={};var _0x3f7ead={};var _0x395357;var _0x24d162;return db['ZendeskAccount']['findOne']({'where':{'id':_0x1c0c8e[_0x613f('0x41')]['id']}})['then'](handleEntityNotFound(_0x30d7b1,null))['then'](function(_0x387913){if(_0x387913){_0x395357=_0x387913;_0x3f7ead[_0x613f('0x2b')]=_[_0x613f('0x2d')](db['ZendeskConfiguration'][_0x613f('0x28')]);_0x3f7ead[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x1c0c8e[_0x613f('0x2c')]);_0x3f7ead[_0x613f('0x37')]=_[_0x613f('0x2e')](_0x3f7ead[_0x613f('0x2b')],_0x3f7ead['query']);_0x145009[_0x613f('0x30')]=_['intersection'](_0x3f7ead[_0x613f('0x2b')],qs[_0x613f('0x2f')](_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x2f')]));_0x145009[_0x613f('0x30')]=_0x145009[_0x613f('0x30')][_0x613f('0x31')]?_0x145009[_0x613f('0x30')]:_0x3f7ead[_0x613f('0x2b')];_0x145009[_0x613f('0x46')]=qs[_0x613f('0x34')](_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x34')]);_0x145009['where']=qs['filters'](_[_0x613f('0x36')](_0x1c0c8e['query'],_0x3f7ead[_0x613f('0x37')]));if(_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x38')]){_0x145009[_0x613f('0x35')]=_[_0x613f('0x39')](_0x145009[_0x613f('0x35')],{'$or':_[_0x613f('0x27')](_0x145009[_0x613f('0x30')],function(_0x3ababc){var _0x29bb88={};_0x29bb88[_0x3ababc]={'$like':'%'+_0x1c0c8e[_0x613f('0x2c')]['filter']+'%'};return _0x29bb88;})});}_0x145009=_[_0x613f('0x39')]({},_0x145009,_0x1c0c8e[_0x613f('0x3b')]);return _0x395357[_0x613f('0x47')](_0x145009);}})[_0x613f('0x22')](function(_0x5a3ea1){if(_0x5a3ea1){_0x24d162=_0x5a3ea1[_0x613f('0x31')];if(!_0x1c0c8e[_0x613f('0x2c')]['hasOwnProperty']('nolimit')){_0x145009[_0x613f('0x1b')]=qs['limit'](_0x1c0c8e['query']['limit']);_0x145009[_0x613f('0x1c')]=qs['offset'](_0x1c0c8e['query']['offset']);}return _0x395357[_0x613f('0x47')](_0x145009);}})[_0x613f('0x22')](function(_0x5bf4ce){if(_0x5bf4ce){return _0x5bf4ce?{'count':_0x24d162,'rows':_0x5bf4ce}:null;}})[_0x613f('0x22')](respondWithResult(_0x30d7b1,null))[_0x613f('0x43')](handleError(_0x30d7b1,null));};exports[_0x613f('0x48')]=function(_0x2a7ca7,_0x5b8712,_0x24f25c){if(_0x2a7ca7[_0x613f('0x45')]['id']){delete _0x2a7ca7['body']['id'];}return db[_0x613f('0x3c')][_0x613f('0x49')]({'where':{'id':_0x2a7ca7[_0x613f('0x41')]['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x5b8712,null))[_0x613f('0x22')](function(_0xdf8993){if(_0xdf8993){_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4a')]=_0xdf8993['id'];_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4b')]=integrations[_0x613f('0x4c')](_0x2a7ca7[_0x613f('0x45')]['channel'],_0x2a7ca7[_0x613f('0x45')][_0x613f('0x2a')]);_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4d')]=integrations[_0x613f('0x4e')](_0x2a7ca7[_0x613f('0x45')]['channel'],_0x2a7ca7[_0x613f('0x45')][_0x613f('0x2a')]);return db[_0x613f('0x4f')][_0x613f('0x44')](_0x2a7ca7[_0x613f('0x45')],{'include':[{'model':db[_0x613f('0x50')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x613f('0x4d')}]});}return null;})[_0x613f('0x22')](respondWithResult(_0x5b8712,null))[_0x613f('0x43')](handleError(_0x5b8712,null));};exports[_0x613f('0x51')]=function(_0x4f28c7,_0x11d2f4,_0x29e5c8){var _0x3d8777='';return db[_0x613f('0x3c')]['findOne']({'where':{'id':_0x4f28c7[_0x613f('0x41')]['id']},'attributes':['id',_0x613f('0x52'),_0x613f('0x53'),_0x613f('0x54'),_0x613f('0x55'),_0x613f('0x56')]})[_0x613f('0x22')](handleEntityNotFound(_0x11d2f4,null))[_0x613f('0x22')](function(_0x5dc81a){if(_0x5dc81a){_0x3d8777=_0x5dc81a[_0x613f('0x56')];var _0x792bf3=_0x3d8777[_0x613f('0x57')](-0x1);if(_0x792bf3==='/'){_0x3d8777=_0x3d8777[_0x613f('0x58')](0x0,_0x3d8777[_0x613f('0x59')](_0x792bf3));}var _0x15ef2d={'method':_0x613f('0x5a'),'uri':util[_0x613f('0x5b')](_0x613f('0x5c'),_0x3d8777,_0x613f('0x5d')),'json':!![]};switch(_0x5dc81a['authType']){case _0x613f('0x53'):_0x15ef2d[_0x613f('0x5e')]={'Authorization':util[_0x613f('0x5b')](_0x613f('0x5f'),new Buffer(util[_0x613f('0x5b')](_0x613f('0x60'),_0x5dc81a[_0x613f('0x52')],_0x5dc81a[_0x613f('0x53')]))[_0x613f('0x61')](_0x613f('0x62')))};break;case _0x613f('0x54'):_0x15ef2d['headers']={'Authorization':util[_0x613f('0x5b')](_0x613f('0x5f'),new Buffer(util[_0x613f('0x5b')](_0x613f('0x63'),_0x5dc81a[_0x613f('0x52')],_0x5dc81a[_0x613f('0x54')]))[_0x613f('0x61')](_0x613f('0x62')))};break;default:throw new db[(_0x613f('0x64'))][(_0x613f('0x65'))](_0x613f('0x66'));}return rp(_0x15ef2d);}})[_0x613f('0x22')](function(_0x5b8563){if(_0x5b8563){var _0x30c62f=[_0x613f('0x67'),'description',_0x613f('0x68'),'assignee'];_[_0x613f('0x69')](_0x5b8563['ticket_fields'],function(_0x49cb13){return _0x30c62f[_0x613f('0x6a')](_0x49cb13[_0x613f('0x2a')]);});return{'count':_0x5b8563[_0x613f('0x5d')][_0x613f('0x31')],'rows':_[_0x613f('0x27')](_0x5b8563[_0x613f('0x5d')],function(_0x622812){return{'id':_0x622812['id'],'name':_0x622812['position']>0x7?_0x622812[_0x613f('0x6b')]:_0x622812[_0x613f('0x2a')],'custom':_0x622812[_0x613f('0x6c')]>0x7?!![]:![],'options':_0x622812[_0x613f('0x6d')]?_0x622812[_0x613f('0x6d')]:_0x622812['custom_field_options']?_0x622812[_0x613f('0x6e')]:[]};})};}})[_0x613f('0x22')](respondWithResult(_0x11d2f4,null))['catch'](function(_0x188be6){var _0x8073b2=_0x4f28c7[_0x613f('0x2c')]['test']?0x1f4:_0x188be6['statusCode']||0x1f4;logger['error'](_0x613f('0x6f'),_0x613f('0x51'),_0x8073b2,JSON['stringify'](_0x188be6));delete _0x188be6[_0x613f('0x25')];if(_0x8073b2===0x191){_0x8073b2=0x190;}_0x11d2f4[_0x613f('0x17')](_0x8073b2)[_0x613f('0x70')](_0x4f28c7['query'][_0x613f('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x188be6[_0x613f('0x72')]}:_0x188be6);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index d81d9f1..89c2821 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 _0x04a9=['request-promise','path','rimraf','../../components/integrations/configuration','exports','define','ZendeskAccount','lodash','util','../../config/logger','moment','bluebird'];(function(_0x47b6f3,_0x23c755){var _0xe548c0=function(_0x3496c5){while(--_0x3496c5){_0x47b6f3['push'](_0x47b6f3['shift']());}};_0xe548c0(++_0x23c755);}(_0x04a9,0x127));var _0x904a=function(_0x59f487,_0x50cd64){_0x59f487=_0x59f487-0x0;var _0x930f02=_0x04a9[_0x59f487];return _0x930f02;};'use strict';var _=require(_0x904a('0x0'));var util=require(_0x904a('0x1'));var logger=require(_0x904a('0x2'))('api');var moment=require(_0x904a('0x3'));var BPromise=require(_0x904a('0x4'));var rp=require(_0x904a('0x5'));var fs=require('fs');var path=require(_0x904a('0x6'));var rimraf=require(_0x904a('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x904a('0x8'));module[_0x904a('0x9')]=function(_0x450ac0,_0x4420d6){return _0x450ac0[_0x904a('0xa')](_0x904a('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x912d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api'];(function(_0xc3bc80,_0x2ee578){var _0x24ef95=function(_0x221d5a){while(--_0x221d5a){_0xc3bc80['push'](_0xc3bc80['shift']());}};_0x24ef95(++_0x2ee578);}(_0x912d,0x15c));var _0xd912=function(_0x3c083b,_0x549e68){_0x3c083b=_0x3c083b-0x0;var _0x1c4f50=_0x912d[_0x3c083b];return _0x1c4f50;};'use strict';var _=require(_0xd912('0x0'));var util=require(_0xd912('0x1'));var logger=require(_0xd912('0x2'))(_0xd912('0x3'));var moment=require(_0xd912('0x4'));var BPromise=require(_0xd912('0x5'));var rp=require(_0xd912('0x6'));var fs=require('fs');var path=require(_0xd912('0x7'));var rimraf=require(_0xd912('0x8'));var config=require(_0xd912('0x9'));var attributes=require(_0xd912('0xa'));var integrations=require(_0xd912('0xb'));module[_0xd912('0xc')]=function(_0x44f78b,_0x268a7a){return _0x44f78b[_0xd912('0xd')](_0xd912('0xe'),attributes,{'tableName':_0xd912('0xf'),'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 421c1b5..c715edd 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 _0xd7a0=['then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','limit','map','include','model','stringify','find','ShowZendeskAccount','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd7a0,0xa0));var _0x0d7a=function(_0xbd37da,_0x13b468){_0xbd37da=_0xbd37da-0x0;var _0x2a2a1f=_0xd7a0[_0xbd37da];return _0x2a2a1f;};'use strict';var _=require(_0x0d7a('0x0'));var util=require('util');var moment=require(_0x0d7a('0x1'));var BPromise=require('bluebird');var rs=require(_0x0d7a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d7a('0x3'))['db'];var utils=require(_0x0d7a('0x4'));var logger=require(_0x0d7a('0x5'))(_0x0d7a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d7a('0x7')][_0x0d7a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12e36f,_0x62da50,_0x14cbdf){return new BPromise(function(_0x2536e0,_0x532336){return client[_0x0d7a('0x9')](_0x12e36f,_0x14cbdf)[_0x0d7a('0xa')](function(_0x437c32){logger[_0x0d7a('0xb')](_0x0d7a('0xc'),_0x62da50,_0x0d7a('0xd'));logger[_0x0d7a('0xe')](_0x0d7a('0xf'),_0x62da50,_0x0d7a('0xd'),JSON['stringify'](_0x437c32));if(_0x437c32[_0x0d7a('0x10')]){if(_0x437c32[_0x0d7a('0x10')][_0x0d7a('0x11')]===0x1f4){logger[_0x0d7a('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x62da50,_0x437c32['error'][_0x0d7a('0x12')]);return _0x532336(_0x437c32[_0x0d7a('0x10')][_0x0d7a('0x12')]);}logger[_0x0d7a('0x10')](_0x0d7a('0xc'),_0x62da50,_0x437c32[_0x0d7a('0x10')][_0x0d7a('0x12')]);return _0x2536e0(_0x437c32[_0x0d7a('0x10')][_0x0d7a('0x12')]);}else{logger[_0x0d7a('0xb')](_0x0d7a('0xc'),_0x62da50,'request\x20sent');_0x2536e0(_0x437c32[_0x0d7a('0x13')][_0x0d7a('0x12')]);}})[_0x0d7a('0x14')](function(_0x9417ee){logger[_0x0d7a('0x10')](_0x0d7a('0xc'),_0x62da50,_0x9417ee);_0x532336(_0x9417ee);});});}exports[_0x0d7a('0x15')]=function(_0x17ca78){var _0x4e03c1=this;return new Promise(function(_0x2882c0,_0x46a1a6){return db[_0x0d7a('0x16')]['findAll']({'raw':_0x17ca78['options']?_0x17ca78[_0x0d7a('0x17')][_0x0d7a('0x18')]===undefined?!![]:![]:!![],'where':_0x17ca78[_0x0d7a('0x17')]?_0x17ca78[_0x0d7a('0x17')][_0x0d7a('0x19')]||null:null,'attributes':_0x17ca78[_0x0d7a('0x17')]?_0x17ca78['options'][_0x0d7a('0x1a')]||null:null,'limit':_0x17ca78['options']?_0x17ca78[_0x0d7a('0x17')][_0x0d7a('0x1b')]||null:null,'include':_0x17ca78[_0x0d7a('0x17')]?_0x17ca78[_0x0d7a('0x17')]['include']?_[_0x0d7a('0x1c')](_0x17ca78[_0x0d7a('0x17')][_0x0d7a('0x1d')],function(_0x180da8){return{'model':db[_0x180da8[_0x0d7a('0x1e')]],'as':_0x180da8['as'],'attributes':_0x180da8[_0x0d7a('0x1a')],'include':_0x180da8[_0x0d7a('0x1d')]?_[_0x0d7a('0x1c')](_0x180da8[_0x0d7a('0x1d')],function(_0x40e097){return{'model':db[_0x40e097[_0x0d7a('0x1e')]],'as':_0x40e097['as'],'attributes':_0x40e097[_0x0d7a('0x1a')],'include':_0x40e097[_0x0d7a('0x1d')]?_['map'](_0x40e097[_0x0d7a('0x1d')],function(_0x3a8ea5){return{'model':db[_0x3a8ea5[_0x0d7a('0x1e')]],'as':_0x3a8ea5['as'],'attributes':_0x3a8ea5['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d7a('0xa')](function(_0x16343f){logger[_0x0d7a('0xb')](_0x0d7a('0x15'),_0x17ca78);logger[_0x0d7a('0xe')]('GetZendeskAccount',_0x17ca78,JSON[_0x0d7a('0x1f')](_0x16343f));_0x2882c0(_0x16343f);})[_0x0d7a('0x14')](function(_0x470143){logger[_0x0d7a('0x10')]('GetZendeskAccount',_0x470143[_0x0d7a('0x12')],_0x17ca78);_0x46a1a6(_0x4e03c1[_0x0d7a('0x10')](0x1f4,_0x470143[_0x0d7a('0x12')]));});});};exports['ShowZendeskAccount']=function(_0xdcc87){var _0x5ba18f=this;return new Promise(function(_0x149ee0,_0x40e614){return db[_0x0d7a('0x16')][_0x0d7a('0x20')]({'raw':_0xdcc87[_0x0d7a('0x17')]?_0xdcc87[_0x0d7a('0x17')][_0x0d7a('0x18')]===undefined?!![]:![]:!![],'where':_0xdcc87[_0x0d7a('0x17')]?_0xdcc87[_0x0d7a('0x17')]['where']||null:null,'attributes':_0xdcc87[_0x0d7a('0x17')]?_0xdcc87[_0x0d7a('0x17')][_0x0d7a('0x1a')]||null:null,'include':_0xdcc87['options']?_0xdcc87[_0x0d7a('0x17')][_0x0d7a('0x1d')]?_[_0x0d7a('0x1c')](_0xdcc87[_0x0d7a('0x17')][_0x0d7a('0x1d')],function(_0x37acbd){return{'model':db[_0x37acbd[_0x0d7a('0x1e')]],'as':_0x37acbd['as'],'attributes':_0x37acbd[_0x0d7a('0x1a')],'include':_0x37acbd[_0x0d7a('0x1d')]?_[_0x0d7a('0x1c')](_0x37acbd['include'],function(_0x3c7321){return{'model':db[_0x3c7321['model']],'as':_0x3c7321['as'],'attributes':_0x3c7321[_0x0d7a('0x1a')],'include':_0x3c7321[_0x0d7a('0x1d')]?_[_0x0d7a('0x1c')](_0x3c7321[_0x0d7a('0x1d')],function(_0xc37d9b){return{'model':db[_0xc37d9b['model']],'as':_0xc37d9b['as'],'attributes':_0xc37d9b[_0x0d7a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0d7a('0xa')](function(_0x330430){logger[_0x0d7a('0xb')](_0x0d7a('0x21'),_0xdcc87);logger[_0x0d7a('0xe')](_0x0d7a('0x21'),_0xdcc87,JSON[_0x0d7a('0x1f')](_0x330430));_0x149ee0(_0x330430);})['catch'](function(_0x45681d){logger[_0x0d7a('0x10')](_0x0d7a('0x21'),_0x45681d['message'],_0xdcc87);_0x40e614(_0x5ba18f[_0x0d7a('0x10')](0x1f4,_0x45681d[_0x0d7a('0x12')]));});});}; \ No newline at end of file +var _0x5c79=['util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetZendeskAccount','ShowZendeskAccount','ZendeskAccount','debug'];(function(_0x4b3c25,_0x39b4b8){var _0x391507=function(_0x4eef57){while(--_0x4eef57){_0x4b3c25['push'](_0x4b3c25['shift']());}};_0x391507(++_0x39b4b8);}(_0x5c79,0x18c));var _0x95c7=function(_0x56e790,_0x5bec09){_0x56e790=_0x56e790-0x0;var _0x4fa9fa=_0x5c79[_0x56e790];return _0x4fa9fa;};'use strict';var _=require('lodash');var util=require(_0x95c7('0x0'));var moment=require(_0x95c7('0x1'));var BPromise=require(_0x95c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x95c7('0x4'));var config=require(_0x95c7('0x5'));var jayson=require(_0x95c7('0x6'));var client=jayson[_0x95c7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a1ef,_0x429ae0,_0x4767cb){return new BPromise(function(_0x2b0761,_0x2c2af4){return client[_0x95c7('0x8')](_0x41a1ef,_0x4767cb)[_0x95c7('0x9')](function(_0x191236){logger['info'](_0x95c7('0xa'),_0x429ae0,_0x95c7('0xb'));logger['debug'](_0x95c7('0xc'),_0x429ae0,_0x95c7('0xb'),JSON[_0x95c7('0xd')](_0x191236));if(_0x191236['error']){if(_0x191236[_0x95c7('0xe')][_0x95c7('0xf')]===0x1f4){logger['error'](_0x95c7('0xa'),_0x429ae0,_0x191236['error']['message']);return _0x2c2af4(_0x191236[_0x95c7('0xe')][_0x95c7('0x10')]);}logger[_0x95c7('0xe')](_0x95c7('0xa'),_0x429ae0,_0x191236['error'][_0x95c7('0x10')]);return _0x2b0761(_0x191236[_0x95c7('0xe')][_0x95c7('0x10')]);}else{logger[_0x95c7('0x11')](_0x95c7('0xa'),_0x429ae0,'request\x20sent');_0x2b0761(_0x191236[_0x95c7('0x12')]['message']);}})[_0x95c7('0x13')](function(_0x262796){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x429ae0,_0x262796);_0x2c2af4(_0x262796);});});}exports['GetZendeskAccount']=function(_0x4bf477){var _0x23cacf=this;return new Promise(function(_0x106afd,_0x5848e4){return db['ZendeskAccount'][_0x95c7('0x14')]({'raw':_0x4bf477[_0x95c7('0x15')]?_0x4bf477[_0x95c7('0x15')][_0x95c7('0x16')]===undefined?!![]:![]:!![],'where':_0x4bf477['options']?_0x4bf477[_0x95c7('0x15')][_0x95c7('0x17')]||null:null,'attributes':_0x4bf477[_0x95c7('0x15')]?_0x4bf477[_0x95c7('0x15')][_0x95c7('0x18')]||null:null,'limit':_0x4bf477[_0x95c7('0x15')]?_0x4bf477[_0x95c7('0x15')][_0x95c7('0x19')]||null:null,'include':_0x4bf477['options']?_0x4bf477['options'][_0x95c7('0x1a')]?_['map'](_0x4bf477[_0x95c7('0x15')][_0x95c7('0x1a')],function(_0xabab3a){return{'model':db[_0xabab3a[_0x95c7('0x1b')]],'as':_0xabab3a['as'],'attributes':_0xabab3a[_0x95c7('0x18')],'include':_0xabab3a[_0x95c7('0x1a')]?_[_0x95c7('0x1c')](_0xabab3a[_0x95c7('0x1a')],function(_0x2dd2e9){return{'model':db[_0x2dd2e9[_0x95c7('0x1b')]],'as':_0x2dd2e9['as'],'attributes':_0x2dd2e9[_0x95c7('0x18')],'include':_0x2dd2e9['include']?_['map'](_0x2dd2e9['include'],function(_0x3b9b04){return{'model':db[_0x3b9b04[_0x95c7('0x1b')]],'as':_0x3b9b04['as'],'attributes':_0x3b9b04[_0x95c7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x95c7('0x9')](function(_0x22100d){logger['info'](_0x95c7('0x1d'),_0x4bf477);logger['debug']('GetZendeskAccount',_0x4bf477,JSON[_0x95c7('0xd')](_0x22100d));_0x106afd(_0x22100d);})[_0x95c7('0x13')](function(_0x2e2e6d){logger[_0x95c7('0xe')]('GetZendeskAccount',_0x2e2e6d[_0x95c7('0x10')],_0x4bf477);_0x5848e4(_0x23cacf['error'](0x1f4,_0x2e2e6d[_0x95c7('0x10')]));});});};exports[_0x95c7('0x1e')]=function(_0x4f7a08){var _0x2ed2d4=this;return new Promise(function(_0x366470,_0x1cf324){return db[_0x95c7('0x1f')]['find']({'raw':_0x4f7a08[_0x95c7('0x15')]?_0x4f7a08[_0x95c7('0x15')][_0x95c7('0x16')]===undefined?!![]:![]:!![],'where':_0x4f7a08[_0x95c7('0x15')]?_0x4f7a08['options'][_0x95c7('0x17')]||null:null,'attributes':_0x4f7a08[_0x95c7('0x15')]?_0x4f7a08[_0x95c7('0x15')][_0x95c7('0x18')]||null:null,'include':_0x4f7a08[_0x95c7('0x15')]?_0x4f7a08['options'][_0x95c7('0x1a')]?_['map'](_0x4f7a08[_0x95c7('0x15')][_0x95c7('0x1a')],function(_0xdb9613){return{'model':db[_0xdb9613[_0x95c7('0x1b')]],'as':_0xdb9613['as'],'attributes':_0xdb9613[_0x95c7('0x18')],'include':_0xdb9613[_0x95c7('0x1a')]?_['map'](_0xdb9613[_0x95c7('0x1a')],function(_0xc00f04){return{'model':db[_0xc00f04['model']],'as':_0xc00f04['as'],'attributes':_0xc00f04[_0x95c7('0x18')],'include':_0xc00f04[_0x95c7('0x1a')]?_['map'](_0xc00f04[_0x95c7('0x1a')],function(_0x2e9086){return{'model':db[_0x2e9086[_0x95c7('0x1b')]],'as':_0x2e9086['as'],'attributes':_0x2e9086[_0x95c7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x95c7('0x9')](function(_0x27b5b9){logger[_0x95c7('0x11')](_0x95c7('0x1e'),_0x4f7a08);logger[_0x95c7('0x20')](_0x95c7('0x1e'),_0x4f7a08,JSON['stringify'](_0x27b5b9));_0x366470(_0x27b5b9);})[_0x95c7('0x13')](function(_0x2aa7ae){logger['error'](_0x95c7('0x1e'),_0x2aa7ae[_0x95c7('0x10')],_0x4f7a08);_0x1cf324(_0x2ed2d4[_0x95c7('0xe')](0x1f4,_0x2aa7ae[_0x95c7('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index d49a223..a360213 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 _0x5c00=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/tags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x5de699,_0x2cfafc){var _0x542fa4=function(_0x366612){while(--_0x366612){_0x5de699['push'](_0x5de699['shift']());}};_0x542fa4(++_0x2cfafc);}(_0x5c00,0x17e));var _0x05c0=function(_0x25dfe3,_0x8699a8){_0x25dfe3=_0x25dfe3-0x0;var _0xa2ea8b=_0x5c00[_0x25dfe3];return _0xa2ea8b;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id/fields',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/descriptions',auth[_0x05c0('0x9')](),controller['getDescriptions']);router[_0x05c0('0x8')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller['getTags']);router[_0x05c0('0x10')]('/',auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0x10')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x12')]);router[_0x05c0('0x13')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller['update']);router[_0x05c0('0x15')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x16')]);module[_0x05c0('0x17')]=router; \ No newline at end of file +var _0x0bb5=['put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags'];(function(_0x1d1006,_0x19b38b){var _0x13e4ff=function(_0x505d9e){while(--_0x505d9e){_0x1d1006['push'](_0x1d1006['shift']());}};_0x13e4ff(++_0x19b38b);}(_0x0bb5,0x148));var _0x50bb=function(_0x254259,_0xfa86c3){_0x254259=_0x254259-0x0;var _0x4f4712=_0x0bb5[_0x254259];return _0x4f4712;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/fields',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x9')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x9')](_0x50bb('0x12'),auth['isAuthenticated'](),controller[_0x50bb('0x13')]);router['post']('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id/tags',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')]('/:id',auth[_0x50bb('0xb')](),controller['update']);router[_0x50bb('0x18')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x19')]);module[_0x50bb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 7cc8dc6..39c43a4 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 _0x19e1=['exports','STRING','sequelize'];(function(_0x418432,_0x537680){var _0x3023a9=function(_0x1c42d0){while(--_0x1c42d0){_0x418432['push'](_0x418432['shift']());}};_0x3023a9(++_0x537680);}(_0x19e1,0x8f));var _0x119e=function(_0x1a014b,_0x48acae){_0x1a014b=_0x1a014b-0x0;var _0x462258=_0x19e1[_0x1a014b];return _0x462258;};'use strict';var Sequelize=require(_0x119e('0x0'));module[_0x119e('0x1')]={'name':{'type':Sequelize[_0x119e('0x2')]},'description':{'type':Sequelize[_0x119e('0x2')]}}; \ No newline at end of file +var _0x8965=['sequelize','exports','STRING'];(function(_0x28d6a7,_0x230445){var _0x2a2308=function(_0x5bf2e4){while(--_0x5bf2e4){_0x28d6a7['push'](_0x28d6a7['shift']());}};_0x2a2308(++_0x230445);}(_0x8965,0x13b));var _0x5896=function(_0x366a11,_0x311a4a){_0x366a11=_0x366a11-0x0;var _0x179567=_0x8965[_0x366a11];return _0x179567;};'use strict';var Sequelize=require(_0x5896('0x0'));module[_0x5896('0x1')]={'name':{'type':Sequelize[_0x5896('0x2')]},'description':{'type':Sequelize[_0x5896('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 051edf2..16e7a0d 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 _0xe6ee=['key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','ZendeskConfiguration','findAll','rows','show','params','includeAll','include','merge','options','catch','create','body','find','getFields','findOne','ZendeskField','length','getSubjects','hasOwnProperty','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x5bcbd5,_0x407cb9){var _0x3dd6ff=function(_0xc8d3bf){while(--_0xc8d3bf){_0x5bcbd5['push'](_0x5bcbd5['shift']());}};_0x3dd6ff(++_0x407cb9);}(_0xe6ee,0xc2));var _0xee6e=function(_0x585b22,_0xd64ae1){_0x585b22=_0x585b22-0x0;var _0xb5e53e=_0xe6ee[_0x585b22];return _0xb5e53e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee6e('0x0'));var zipdir=require(_0xee6e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xee6e('0x2'));var BPromise=require(_0xee6e('0x3'));var Mustache=require('mustache');var util=require(_0xee6e('0x4'));var path=require(_0xee6e('0x5'));var sox=require('sox');var csv=require(_0xee6e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee6e('0x7'));var _=require(_0xee6e('0x8'));var squel=require(_0xee6e('0x9'));var crypto=require(_0xee6e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xee6e('0xb'));var toCsv=require(_0xee6e('0x6'));var querystring=require('querystring');var Papa=require(_0xee6e('0xc'));var Redis=require('ioredis');var authService=require(_0xee6e('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee6e('0xe'));var utils=require(_0xee6e('0xf'));var config=require(_0xee6e('0x10'));var licenseUtil=require(_0xee6e('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21a2f9,_0x47d2e2){_0x47d2e2=_0x47d2e2||0xcc;return function(_0x19bcc7){if(_0x19bcc7){return _0x21a2f9[_0xee6e('0x12')](_0x47d2e2);}return _0x21a2f9[_0xee6e('0x13')](_0x47d2e2)[_0xee6e('0x14')]();};}function respondWithResult(_0x5d0a64,_0x325db0){_0x325db0=_0x325db0||0xc8;return function(_0x13d390){if(_0x13d390){return _0x5d0a64['status'](_0x325db0)[_0xee6e('0x15')](_0x13d390);}};}function respondWithFilteredResult(_0x5bd595,_0x46312d){return function(_0x2d8187){if(_0x2d8187){var _0x4287a4=typeof _0x46312d['offset']==='undefined'&&typeof _0x46312d[_0xee6e('0x16')]==='undefined';var _0x3fa135=_0x2d8187[_0xee6e('0x17')];var _0x1dac57=_0x4287a4?0x0:_0x46312d[_0xee6e('0x18')];var _0x3df923=_0x4287a4?_0x2d8187[_0xee6e('0x17')]:_0x46312d['offset']+_0x46312d[_0xee6e('0x16')];var _0x582e41;if(_0x3df923>=_0x3fa135){_0x3df923=_0x3fa135;_0x582e41=0xc8;}else{_0x582e41=0xce;}_0x5bd595['status'](_0x582e41);return _0x5bd595[_0xee6e('0x19')](_0xee6e('0x1a'),_0x1dac57+'-'+_0x3df923+'/'+_0x3fa135)['json'](_0x2d8187);}return null;};}function patchUpdates(_0x111d39){return function(_0x3527de){try{jsonpatch['apply'](_0x3527de,_0x111d39,!![]);}catch(_0x246575){return BPromise[_0xee6e('0x1b')](_0x246575);}return _0x3527de['save']();};}function saveUpdates(_0x8931e9,_0x793f6f){return function(_0x22a678){if(_0x22a678){return _0x22a678[_0xee6e('0x1c')](_0x8931e9)[_0xee6e('0x1d')](function(_0x2f75a9){return _0x2f75a9;});}return null;};}function removeEntity(_0x1369c6,_0x3d5908){return function(_0x1eaebd){if(_0x1eaebd){return _0x1eaebd[_0xee6e('0x1e')]()[_0xee6e('0x1d')](function(){_0x1369c6[_0xee6e('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b56d0,_0x240aab){return function(_0x27ee86){if(!_0x27ee86){_0x3b56d0['sendStatus'](0x194);}return _0x27ee86;};}function handleError(_0x3ca224,_0x258ddd){_0x258ddd=_0x258ddd||0x1f4;return function(_0x319dce){logger[_0xee6e('0x1f')](_0x319dce[_0xee6e('0x20')]);if(_0x319dce['name']){delete _0x319dce[_0xee6e('0x21')];}_0x3ca224[_0xee6e('0x13')](_0x258ddd)[_0xee6e('0x22')](_0x319dce);};}exports[_0xee6e('0x23')]=function(_0x1096a1,_0xbc2f08){var _0x2fcac9={},_0x278150={},_0x510175={'count':0x0,'rows':[]};var _0x278e68=_[_0xee6e('0x24')](db['ZendeskConfiguration'][_0xee6e('0x25')],function(_0x4c9ec5){return{'name':_0x4c9ec5[_0xee6e('0x26')],'type':_0x4c9ec5[_0xee6e('0x27')][_0xee6e('0x28')]};});_0x278150[_0xee6e('0x29')]=_['map'](_0x278e68,'name');_0x278150['query']=_[_0xee6e('0x2a')](_0x1096a1[_0xee6e('0x2b')]);_0x278150['filters']=_[_0xee6e('0x2c')](_0x278150[_0xee6e('0x29')],_0x278150[_0xee6e('0x2b')]);_0x2fcac9[_0xee6e('0x2d')]=_[_0xee6e('0x2c')](_0x278150[_0xee6e('0x29')],qs[_0xee6e('0x2e')](_0x1096a1[_0xee6e('0x2b')]['fields']));_0x2fcac9[_0xee6e('0x2d')]=_0x2fcac9['attributes']['length']?_0x2fcac9['attributes']:_0x278150[_0xee6e('0x29')];if(!_0x1096a1['query']['hasOwnProperty'](_0xee6e('0x2f'))){_0x2fcac9[_0xee6e('0x16')]=qs[_0xee6e('0x16')](_0x1096a1['query'][_0xee6e('0x16')]);_0x2fcac9[_0xee6e('0x18')]=qs[_0xee6e('0x18')](_0x1096a1[_0xee6e('0x2b')][_0xee6e('0x18')]);}_0x2fcac9[_0xee6e('0x30')]=qs['sort'](_0x1096a1[_0xee6e('0x2b')][_0xee6e('0x31')]);_0x2fcac9[_0xee6e('0x32')]=qs[_0xee6e('0x33')](_[_0xee6e('0x34')](_0x1096a1[_0xee6e('0x2b')],_0x278150['filters']),_0x278e68);if(_0x1096a1['query'][_0xee6e('0x35')]){_0x2fcac9['where']=_['merge'](_0x2fcac9[_0xee6e('0x32')],{'$or':_['map'](_0x278e68,function(_0x1ed7cf){if(_0x1ed7cf[_0xee6e('0x27')]!==_0xee6e('0x36')){var _0x368e86={};_0x368e86[_0x1ed7cf[_0xee6e('0x21')]]={'$like':'%'+_0x1096a1[_0xee6e('0x2b')][_0xee6e('0x35')]+'%'};return _0x368e86;}})});}_0x2fcac9=_['merge']({},_0x2fcac9,_0x1096a1['options']);var _0x2d54c2={'where':_0x2fcac9[_0xee6e('0x32')]};return db[_0xee6e('0x37')][_0xee6e('0x17')](_0x2d54c2)[_0xee6e('0x1d')](function(_0x3e0d98){_0x510175[_0xee6e('0x17')]=_0x3e0d98;if(_0x1096a1['query']['includeAll']){_0x2fcac9['include']=[{'all':!![]}];}return db[_0xee6e('0x37')][_0xee6e('0x38')](_0x2fcac9);})[_0xee6e('0x1d')](function(_0x256f3f){_0x510175[_0xee6e('0x39')]=_0x256f3f;return _0x510175;})['then'](respondWithFilteredResult(_0xbc2f08,_0x2fcac9))['catch'](handleError(_0xbc2f08,null));};exports[_0xee6e('0x3a')]=function(_0x385595,_0x5daf69){var _0x2c99b2={'raw':![],'where':{'id':_0x385595[_0xee6e('0x3b')]['id']}},_0x473da5={};_0x473da5[_0xee6e('0x29')]=_[_0xee6e('0x2a')](db[_0xee6e('0x37')][_0xee6e('0x25')]);_0x473da5['query']=_[_0xee6e('0x2a')](_0x385595[_0xee6e('0x2b')]);_0x473da5[_0xee6e('0x33')]=_['intersection'](_0x473da5[_0xee6e('0x29')],_0x473da5[_0xee6e('0x2b')]);_0x2c99b2[_0xee6e('0x2d')]=_[_0xee6e('0x2c')](_0x473da5[_0xee6e('0x29')],qs[_0xee6e('0x2e')](_0x385595['query']['fields']));_0x2c99b2[_0xee6e('0x2d')]=_0x2c99b2[_0xee6e('0x2d')]['length']?_0x2c99b2[_0xee6e('0x2d')]:_0x473da5[_0xee6e('0x29')];if(_0x385595[_0xee6e('0x2b')][_0xee6e('0x3c')]){_0x2c99b2[_0xee6e('0x3d')]=[{'all':!![]}];}_0x2c99b2=_[_0xee6e('0x3e')]({},_0x2c99b2,_0x385595[_0xee6e('0x3f')]);return db[_0xee6e('0x37')]['find'](_0x2c99b2)[_0xee6e('0x1d')](handleEntityNotFound(_0x5daf69,null))['then'](respondWithResult(_0x5daf69,null))[_0xee6e('0x40')](handleError(_0x5daf69,null));};exports[_0xee6e('0x41')]=function(_0xe07d90,_0x516de9){return db[_0xee6e('0x37')][_0xee6e('0x41')](_0xe07d90[_0xee6e('0x42')],{})['then'](respondWithResult(_0x516de9,0xc9))[_0xee6e('0x40')](handleError(_0x516de9,null));};exports['update']=function(_0x194ee2,_0x1e9906){if(_0x194ee2[_0xee6e('0x42')]['id']){delete _0x194ee2[_0xee6e('0x42')]['id'];}return db[_0xee6e('0x37')]['find']({'where':{'id':_0x194ee2['params']['id']}})['then'](handleEntityNotFound(_0x1e9906,null))['then'](saveUpdates(_0x194ee2[_0xee6e('0x42')],null))[_0xee6e('0x1d')](respondWithResult(_0x1e9906,null))[_0xee6e('0x40')](handleError(_0x1e9906,null));};exports[_0xee6e('0x1e')]=function(_0x2b2a7c,_0x1c5614){return db[_0xee6e('0x37')][_0xee6e('0x43')]({'where':{'id':_0x2b2a7c[_0xee6e('0x3b')]['id']}})[_0xee6e('0x1d')](handleEntityNotFound(_0x1c5614,null))[_0xee6e('0x1d')](removeEntity(_0x1c5614,null))[_0xee6e('0x40')](handleError(_0x1c5614,null));};exports[_0xee6e('0x44')]=function(_0x5be287,_0xbc85ba,_0x49cd6c){var _0x365392={};var _0x4b9a24={};var _0xf4c963;var _0x5f1a09;return db['ZendeskConfiguration'][_0xee6e('0x45')]({'where':{'id':_0x5be287['params']['id']}})[_0xee6e('0x1d')](handleEntityNotFound(_0xbc85ba,null))[_0xee6e('0x1d')](function(_0x3fe746){if(_0x3fe746){_0xf4c963=_0x3fe746;_0x4b9a24['model']=_[_0xee6e('0x2a')](db[_0xee6e('0x46')][_0xee6e('0x25')]);_0x4b9a24[_0xee6e('0x2b')]=_[_0xee6e('0x2a')](_0x5be287[_0xee6e('0x2b')]);_0x4b9a24['filters']=_[_0xee6e('0x2c')](_0x4b9a24[_0xee6e('0x29')],_0x4b9a24[_0xee6e('0x2b')]);_0x365392[_0xee6e('0x2d')]=_[_0xee6e('0x2c')](_0x4b9a24['model'],qs[_0xee6e('0x2e')](_0x5be287[_0xee6e('0x2b')][_0xee6e('0x2e')]));_0x365392[_0xee6e('0x2d')]=_0x365392[_0xee6e('0x2d')]['length']?_0x365392[_0xee6e('0x2d')]:_0x4b9a24['model'];_0x365392[_0xee6e('0x30')]=qs[_0xee6e('0x31')](_0x5be287[_0xee6e('0x2b')][_0xee6e('0x31')]);_0x365392[_0xee6e('0x32')]=qs['filters'](_[_0xee6e('0x34')](_0x5be287[_0xee6e('0x2b')],_0x4b9a24['filters']));if(_0x5be287[_0xee6e('0x2b')][_0xee6e('0x35')]){_0x365392[_0xee6e('0x32')]=_['merge'](_0x365392[_0xee6e('0x32')],{'$or':_[_0xee6e('0x24')](_0x365392[_0xee6e('0x2d')],function(_0x3b023d){var _0x5654bb={};_0x5654bb[_0x3b023d]={'$like':'%'+_0x5be287[_0xee6e('0x2b')][_0xee6e('0x35')]+'%'};return _0x5654bb;})});}_0x365392=_[_0xee6e('0x3e')]({},_0x365392,_0x5be287['options']);return _0xf4c963[_0xee6e('0x44')](_0x365392);}})['then'](function(_0x5784b9){if(_0x5784b9){_0x5f1a09=_0x5784b9[_0xee6e('0x47')];if(!_0x5be287[_0xee6e('0x2b')]['hasOwnProperty']('nolimit')){_0x365392[_0xee6e('0x16')]=qs['limit'](_0x5be287['query']['limit']);_0x365392[_0xee6e('0x18')]=qs[_0xee6e('0x18')](_0x5be287[_0xee6e('0x2b')][_0xee6e('0x18')]);}return _0xf4c963[_0xee6e('0x44')](_0x365392);}})[_0xee6e('0x1d')](function(_0x63138c){if(_0x63138c){return _0x63138c?{'count':_0x5f1a09,'rows':_0x63138c}:null;}})[_0xee6e('0x1d')](respondWithResult(_0xbc85ba,null))[_0xee6e('0x40')](handleError(_0xbc85ba,null));};exports[_0xee6e('0x48')]=function(_0x5db312,_0x370120,_0x569201){var _0x33652d={};var _0x5665b8={};var _0x5db463;var _0x1f20e0;return db[_0xee6e('0x37')]['findOne']({'where':{'id':_0x5db312['params']['id']}})[_0xee6e('0x1d')](handleEntityNotFound(_0x370120,null))['then'](function(_0x33b53b){if(_0x33b53b){_0x5db463=_0x33b53b;_0x5665b8[_0xee6e('0x29')]=_[_0xee6e('0x2a')](db[_0xee6e('0x46')][_0xee6e('0x25')]);_0x5665b8[_0xee6e('0x2b')]=_[_0xee6e('0x2a')](_0x5db312['query']);_0x5665b8['filters']=_[_0xee6e('0x2c')](_0x5665b8[_0xee6e('0x29')],_0x5665b8[_0xee6e('0x2b')]);_0x33652d[_0xee6e('0x2d')]=_['intersection'](_0x5665b8[_0xee6e('0x29')],qs[_0xee6e('0x2e')](_0x5db312[_0xee6e('0x2b')]['fields']));_0x33652d['attributes']=_0x33652d[_0xee6e('0x2d')]['length']?_0x33652d[_0xee6e('0x2d')]:_0x5665b8[_0xee6e('0x29')];_0x33652d[_0xee6e('0x30')]=qs[_0xee6e('0x31')](_0x5db312[_0xee6e('0x2b')]['sort']);_0x33652d[_0xee6e('0x32')]=qs[_0xee6e('0x33')](_[_0xee6e('0x34')](_0x5db312[_0xee6e('0x2b')],_0x5665b8['filters']));if(_0x5db312[_0xee6e('0x2b')][_0xee6e('0x35')]){_0x33652d['where']=_[_0xee6e('0x3e')](_0x33652d['where'],{'$or':_['map'](_0x33652d[_0xee6e('0x2d')],function(_0x3f46c0){var _0x37ba49={};_0x37ba49[_0x3f46c0]={'$like':'%'+_0x5db312['query'][_0xee6e('0x35')]+'%'};return _0x37ba49;})});}_0x33652d=_[_0xee6e('0x3e')]({},_0x33652d,_0x5db312[_0xee6e('0x3f')]);return _0x5db463['getSubjects'](_0x33652d);}})[_0xee6e('0x1d')](function(_0x20a651){if(_0x20a651){_0x1f20e0=_0x20a651[_0xee6e('0x47')];if(!_0x5db312[_0xee6e('0x2b')][_0xee6e('0x49')]('nolimit')){_0x33652d[_0xee6e('0x16')]=qs[_0xee6e('0x16')](_0x5db312[_0xee6e('0x2b')][_0xee6e('0x16')]);_0x33652d[_0xee6e('0x18')]=qs[_0xee6e('0x18')](_0x5db312[_0xee6e('0x2b')][_0xee6e('0x18')]);}return _0x5db463[_0xee6e('0x48')](_0x33652d);}})[_0xee6e('0x1d')](function(_0x1e862d){if(_0x1e862d){return _0x1e862d?{'count':_0x1f20e0,'rows':_0x1e862d}:null;}})[_0xee6e('0x1d')](respondWithResult(_0x370120,null))[_0xee6e('0x40')](handleError(_0x370120,null));};exports[_0xee6e('0x4a')]=function(_0x59577b,_0x395ef4,_0x248cea){var _0xe27824={};var _0x3d9590={};var _0x35ef23;var _0x3d9a76;return db[_0xee6e('0x37')][_0xee6e('0x45')]({'where':{'id':_0x59577b[_0xee6e('0x3b')]['id']}})[_0xee6e('0x1d')](handleEntityNotFound(_0x395ef4,null))[_0xee6e('0x1d')](function(_0x8701c1){if(_0x8701c1){_0x35ef23=_0x8701c1;_0x3d9590[_0xee6e('0x29')]=_[_0xee6e('0x2a')](db['ZendeskField'][_0xee6e('0x25')]);_0x3d9590[_0xee6e('0x2b')]=_[_0xee6e('0x2a')](_0x59577b[_0xee6e('0x2b')]);_0x3d9590[_0xee6e('0x33')]=_[_0xee6e('0x2c')](_0x3d9590[_0xee6e('0x29')],_0x3d9590[_0xee6e('0x2b')]);_0xe27824['attributes']=_[_0xee6e('0x2c')](_0x3d9590[_0xee6e('0x29')],qs['fields'](_0x59577b[_0xee6e('0x2b')][_0xee6e('0x2e')]));_0xe27824['attributes']=_0xe27824['attributes']['length']?_0xe27824[_0xee6e('0x2d')]:_0x3d9590['model'];_0xe27824[_0xee6e('0x30')]=qs[_0xee6e('0x31')](_0x59577b['query'][_0xee6e('0x31')]);_0xe27824[_0xee6e('0x32')]=qs['filters'](_[_0xee6e('0x34')](_0x59577b[_0xee6e('0x2b')],_0x3d9590[_0xee6e('0x33')]));if(_0x59577b[_0xee6e('0x2b')][_0xee6e('0x35')]){_0xe27824['where']=_[_0xee6e('0x3e')](_0xe27824[_0xee6e('0x32')],{'$or':_[_0xee6e('0x24')](_0xe27824['attributes'],function(_0x476b6c){var _0x37d4fd={};_0x37d4fd[_0x476b6c]={'$like':'%'+_0x59577b[_0xee6e('0x2b')]['filter']+'%'};return _0x37d4fd;})});}_0xe27824=_[_0xee6e('0x3e')]({},_0xe27824,_0x59577b['options']);return _0x35ef23[_0xee6e('0x4a')](_0xe27824);}})[_0xee6e('0x1d')](function(_0x42c880){if(_0x42c880){_0x3d9a76=_0x42c880['length'];if(!_0x59577b[_0xee6e('0x2b')][_0xee6e('0x49')](_0xee6e('0x2f'))){_0xe27824[_0xee6e('0x16')]=qs[_0xee6e('0x16')](_0x59577b[_0xee6e('0x2b')][_0xee6e('0x16')]);_0xe27824['offset']=qs[_0xee6e('0x18')](_0x59577b['query'][_0xee6e('0x18')]);}return _0x35ef23[_0xee6e('0x4a')](_0xe27824);}})[_0xee6e('0x1d')](function(_0x1ab5d3){if(_0x1ab5d3){return _0x1ab5d3?{'count':_0x3d9a76,'rows':_0x1ab5d3}:null;}})[_0xee6e('0x1d')](respondWithResult(_0x395ef4,null))[_0xee6e('0x40')](handleError(_0x395ef4,null));};exports[_0xee6e('0x4b')]=function(_0x522668,_0x688a81,_0x505f2a){var _0x50ad40={};var _0x5b1ae4={};var _0x2ed55b;var _0xeaaf6a;return db[_0xee6e('0x37')][_0xee6e('0x45')]({'where':{'id':_0x522668['params']['id']}})[_0xee6e('0x1d')](handleEntityNotFound(_0x688a81,null))['then'](function(_0x1eacd6){if(_0x1eacd6){_0x2ed55b=_0x1eacd6;_0x5b1ae4[_0xee6e('0x29')]=_[_0xee6e('0x2a')](db['Tag']['rawAttributes']);_0x5b1ae4['query']=_[_0xee6e('0x2a')](_0x522668[_0xee6e('0x2b')]);_0x5b1ae4[_0xee6e('0x33')]=_['intersection'](_0x5b1ae4[_0xee6e('0x29')],_0x5b1ae4[_0xee6e('0x2b')]);_0x50ad40[_0xee6e('0x2d')]=_['intersection'](_0x5b1ae4[_0xee6e('0x29')],qs[_0xee6e('0x2e')](_0x522668['query'][_0xee6e('0x2e')]));_0x50ad40[_0xee6e('0x2d')]=_0x50ad40[_0xee6e('0x2d')]['length']?_0x50ad40[_0xee6e('0x2d')]:_0x5b1ae4[_0xee6e('0x29')];_0x50ad40[_0xee6e('0x30')]=qs['sort'](_0x522668[_0xee6e('0x2b')]['sort']);_0x50ad40[_0xee6e('0x32')]=qs[_0xee6e('0x33')](_['pick'](_0x522668[_0xee6e('0x2b')],_0x5b1ae4[_0xee6e('0x33')]));if(_0x522668['query'][_0xee6e('0x35')]){_0x50ad40[_0xee6e('0x32')]=_['merge'](_0x50ad40[_0xee6e('0x32')],{'$or':_['map'](_0x50ad40[_0xee6e('0x2d')],function(_0xf76891){var _0x5bb57f={};_0x5bb57f[_0xf76891]={'$like':'%'+_0x522668[_0xee6e('0x2b')][_0xee6e('0x35')]+'%'};return _0x5bb57f;})});}_0x50ad40=_[_0xee6e('0x3e')]({},_0x50ad40,_0x522668[_0xee6e('0x3f')]);return _0x2ed55b[_0xee6e('0x4b')](_0x50ad40);}})[_0xee6e('0x1d')](function(_0xa6073c){if(_0xa6073c){_0xeaaf6a=_0xa6073c[_0xee6e('0x47')];if(!_0x522668[_0xee6e('0x2b')]['hasOwnProperty'](_0xee6e('0x2f'))){_0x50ad40['limit']=qs[_0xee6e('0x16')](_0x522668[_0xee6e('0x2b')][_0xee6e('0x16')]);_0x50ad40[_0xee6e('0x18')]=qs[_0xee6e('0x18')](_0x522668[_0xee6e('0x2b')][_0xee6e('0x18')]);}return _0x2ed55b[_0xee6e('0x4b')](_0x50ad40);}})[_0xee6e('0x1d')](function(_0x11817d){if(_0x11817d){return _0x11817d?{'count':_0xeaaf6a,'rows':_0x11817d}:null;}})['then'](respondWithResult(_0x688a81,null))['catch'](handleError(_0x688a81,null));};exports[_0xee6e('0x4c')]=function(_0x121a48,_0x5f0b35,_0xdbb2ae){if(_0x121a48[_0xee6e('0x42')]['id']){delete _0x121a48['body']['id'];}return db[_0xee6e('0x37')][_0xee6e('0x45')]({'where':{'id':_0x121a48[_0xee6e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x5f0b35,null))[_0xee6e('0x1d')](function(_0x333f8c){if(_0x333f8c){return _0x333f8c[_0xee6e('0x4c')](_0x121a48['body'][_0xee6e('0x4d')]||[]);}return null;})[_0xee6e('0x1d')](respondWithResult(_0x5f0b35,null))['catch'](handleError(_0x5f0b35,null));}; \ No newline at end of file +var _0xa542=['setTags','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','ZendeskConfiguration','then','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','Tag'];(function(_0x2ba7f4,_0xf53b7e){var _0x26c3d2=function(_0x5c80d2){while(--_0x5c80d2){_0x2ba7f4['push'](_0x2ba7f4['shift']());}};_0x26c3d2(++_0xf53b7e);}(_0xa542,0xaf));var _0x2a54=function(_0x4dd80c,_0x20ab07){_0x4dd80c=_0x4dd80c-0x0;var _0x112840=_0xa542[_0x4dd80c];return _0x112840;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a54('0x0'));var zipdir=require(_0x2a54('0x1'));var jsonpatch=require(_0x2a54('0x2'));var rp=require(_0x2a54('0x3'));var moment=require('moment');var BPromise=require(_0x2a54('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a54('0x5'));var sox=require(_0x2a54('0x6'));var csv=require(_0x2a54('0x7'));var ejs=require(_0x2a54('0x8'));var fs=require('fs');var fs_extra=require(_0x2a54('0x9'));var _=require(_0x2a54('0xa'));var squel=require(_0x2a54('0xb'));var crypto=require(_0x2a54('0xc'));var jsforce=require(_0x2a54('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a54('0x7'));var querystring=require(_0x2a54('0xe'));var Papa=require(_0x2a54('0xf'));var Redis=require(_0x2a54('0x10'));var authService=require(_0x2a54('0x11'));var qs=require(_0x2a54('0x12'));var as=require(_0x2a54('0x13'));var hardwareService=require(_0x2a54('0x14'));var logger=require(_0x2a54('0x15'))(_0x2a54('0x16'));var utils=require(_0x2a54('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2a54('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36e5ff,_0x2c525c){_0x2c525c=_0x2c525c||0xcc;return function(_0x209cb2){if(_0x209cb2){return _0x36e5ff['sendStatus'](_0x2c525c);}return _0x36e5ff[_0x2a54('0x19')](_0x2c525c)[_0x2a54('0x1a')]();};}function respondWithResult(_0x3f6b81,_0x9a218f){_0x9a218f=_0x9a218f||0xc8;return function(_0x4ab5a5){if(_0x4ab5a5){return _0x3f6b81[_0x2a54('0x19')](_0x9a218f)['json'](_0x4ab5a5);}};}function respondWithFilteredResult(_0x12afba,_0x3197f6){return function(_0x1c0c09){if(_0x1c0c09){var _0x56ee48=typeof _0x3197f6['offset']===_0x2a54('0x1b')&&typeof _0x3197f6[_0x2a54('0x1c')]===_0x2a54('0x1b');var _0x1e6232=_0x1c0c09['count'];var _0x395b77=_0x56ee48?0x0:_0x3197f6[_0x2a54('0x1d')];var _0x373048=_0x56ee48?_0x1c0c09[_0x2a54('0x1e')]:_0x3197f6[_0x2a54('0x1d')]+_0x3197f6[_0x2a54('0x1c')];var _0x2ab894;if(_0x373048>=_0x1e6232){_0x373048=_0x1e6232;_0x2ab894=0xc8;}else{_0x2ab894=0xce;}_0x12afba['status'](_0x2ab894);return _0x12afba[_0x2a54('0x1f')](_0x2a54('0x20'),_0x395b77+'-'+_0x373048+'/'+_0x1e6232)[_0x2a54('0x21')](_0x1c0c09);}return null;};}function patchUpdates(_0x436353){return function(_0x3cd1a4){try{jsonpatch[_0x2a54('0x22')](_0x3cd1a4,_0x436353,!![]);}catch(_0x5acad1){return BPromise[_0x2a54('0x23')](_0x5acad1);}return _0x3cd1a4[_0x2a54('0x24')]();};}function saveUpdates(_0x225bd6,_0x580cb8){return function(_0x235950){if(_0x235950){return _0x235950[_0x2a54('0x25')](_0x225bd6)['then'](function(_0x57bc6c){return _0x57bc6c;});}return null;};}function removeEntity(_0x507430,_0x3ba147){return function(_0x577f55){if(_0x577f55){return _0x577f55['destroy']()['then'](function(){_0x507430[_0x2a54('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d92d4,_0x1c3904){return function(_0x474823){if(!_0x474823){_0x1d92d4[_0x2a54('0x26')](0x194);}return _0x474823;};}function handleError(_0x1627db,_0x4620af){_0x4620af=_0x4620af||0x1f4;return function(_0x21bfa3){logger[_0x2a54('0x27')](_0x21bfa3['stack']);if(_0x21bfa3['name']){delete _0x21bfa3[_0x2a54('0x28')];}_0x1627db[_0x2a54('0x19')](_0x4620af)[_0x2a54('0x29')](_0x21bfa3);};}exports[_0x2a54('0x2a')]=function(_0x5f5346,_0xee1e1e){var _0x4d556a={},_0x5d0455={},_0x12f9f6={'count':0x0,'rows':[]};var _0x1b45b1=_[_0x2a54('0x2b')](db['ZendeskConfiguration'][_0x2a54('0x2c')],function(_0x57bc09){return{'name':_0x57bc09[_0x2a54('0x2d')],'type':_0x57bc09[_0x2a54('0x2e')][_0x2a54('0x2f')]};});_0x5d0455[_0x2a54('0x30')]=_[_0x2a54('0x2b')](_0x1b45b1,_0x2a54('0x28'));_0x5d0455[_0x2a54('0x31')]=_[_0x2a54('0x32')](_0x5f5346['query']);_0x5d0455[_0x2a54('0x33')]=_[_0x2a54('0x34')](_0x5d0455[_0x2a54('0x30')],_0x5d0455['query']);_0x4d556a['attributes']=_[_0x2a54('0x34')](_0x5d0455[_0x2a54('0x30')],qs['fields'](_0x5f5346['query'][_0x2a54('0x35')]));_0x4d556a[_0x2a54('0x36')]=_0x4d556a[_0x2a54('0x36')][_0x2a54('0x37')]?_0x4d556a['attributes']:_0x5d0455[_0x2a54('0x30')];if(!_0x5f5346['query'][_0x2a54('0x38')](_0x2a54('0x39'))){_0x4d556a[_0x2a54('0x1c')]=qs['limit'](_0x5f5346[_0x2a54('0x31')][_0x2a54('0x1c')]);_0x4d556a[_0x2a54('0x1d')]=qs['offset'](_0x5f5346[_0x2a54('0x31')][_0x2a54('0x1d')]);}_0x4d556a[_0x2a54('0x3a')]=qs[_0x2a54('0x3b')](_0x5f5346['query'][_0x2a54('0x3b')]);_0x4d556a[_0x2a54('0x3c')]=qs['filters'](_['pick'](_0x5f5346[_0x2a54('0x31')],_0x5d0455[_0x2a54('0x33')]),_0x1b45b1);if(_0x5f5346[_0x2a54('0x31')][_0x2a54('0x3d')]){_0x4d556a[_0x2a54('0x3c')]=_['merge'](_0x4d556a['where'],{'$or':_[_0x2a54('0x2b')](_0x1b45b1,function(_0x53b56f){if(_0x53b56f[_0x2a54('0x2e')]!==_0x2a54('0x3e')){var _0x4eebb4={};_0x4eebb4[_0x53b56f['name']]={'$like':'%'+_0x5f5346[_0x2a54('0x31')]['filter']+'%'};return _0x4eebb4;}})});}_0x4d556a=_[_0x2a54('0x3f')]({},_0x4d556a,_0x5f5346[_0x2a54('0x40')]);var _0x3c53d2={'where':_0x4d556a[_0x2a54('0x3c')]};return db[_0x2a54('0x41')]['count'](_0x3c53d2)[_0x2a54('0x42')](function(_0x280d10){_0x12f9f6[_0x2a54('0x1e')]=_0x280d10;if(_0x5f5346['query'][_0x2a54('0x43')]){_0x4d556a[_0x2a54('0x44')]=[{'all':!![]}];}return db[_0x2a54('0x41')][_0x2a54('0x45')](_0x4d556a);})[_0x2a54('0x42')](function(_0x3c1e75){_0x12f9f6[_0x2a54('0x46')]=_0x3c1e75;return _0x12f9f6;})[_0x2a54('0x42')](respondWithFilteredResult(_0xee1e1e,_0x4d556a))['catch'](handleError(_0xee1e1e,null));};exports[_0x2a54('0x47')]=function(_0x19e259,_0x5ee454){var _0x5a6ad4={'raw':![],'where':{'id':_0x19e259[_0x2a54('0x48')]['id']}},_0x1b97af={};_0x1b97af[_0x2a54('0x30')]=_[_0x2a54('0x32')](db[_0x2a54('0x41')]['rawAttributes']);_0x1b97af[_0x2a54('0x31')]=_[_0x2a54('0x32')](_0x19e259[_0x2a54('0x31')]);_0x1b97af[_0x2a54('0x33')]=_[_0x2a54('0x34')](_0x1b97af[_0x2a54('0x30')],_0x1b97af[_0x2a54('0x31')]);_0x5a6ad4['attributes']=_['intersection'](_0x1b97af['model'],qs['fields'](_0x19e259[_0x2a54('0x31')]['fields']));_0x5a6ad4[_0x2a54('0x36')]=_0x5a6ad4[_0x2a54('0x36')][_0x2a54('0x37')]?_0x5a6ad4[_0x2a54('0x36')]:_0x1b97af[_0x2a54('0x30')];if(_0x19e259[_0x2a54('0x31')][_0x2a54('0x43')]){_0x5a6ad4['include']=[{'all':!![]}];}_0x5a6ad4=_[_0x2a54('0x3f')]({},_0x5a6ad4,_0x19e259[_0x2a54('0x40')]);return db[_0x2a54('0x41')][_0x2a54('0x49')](_0x5a6ad4)[_0x2a54('0x42')](handleEntityNotFound(_0x5ee454,null))[_0x2a54('0x42')](respondWithResult(_0x5ee454,null))[_0x2a54('0x4a')](handleError(_0x5ee454,null));};exports[_0x2a54('0x4b')]=function(_0x16519c,_0x240bab){return db[_0x2a54('0x41')][_0x2a54('0x4b')](_0x16519c['body'],{})[_0x2a54('0x42')](respondWithResult(_0x240bab,0xc9))[_0x2a54('0x4a')](handleError(_0x240bab,null));};exports[_0x2a54('0x25')]=function(_0x56f819,_0x309d07){if(_0x56f819[_0x2a54('0x4c')]['id']){delete _0x56f819[_0x2a54('0x4c')]['id'];}return db[_0x2a54('0x41')]['find']({'where':{'id':_0x56f819[_0x2a54('0x48')]['id']}})['then'](handleEntityNotFound(_0x309d07,null))[_0x2a54('0x42')](saveUpdates(_0x56f819['body'],null))[_0x2a54('0x42')](respondWithResult(_0x309d07,null))[_0x2a54('0x4a')](handleError(_0x309d07,null));};exports[_0x2a54('0x4d')]=function(_0x3383c3,_0x12c223){return db[_0x2a54('0x41')][_0x2a54('0x49')]({'where':{'id':_0x3383c3['params']['id']}})[_0x2a54('0x42')](handleEntityNotFound(_0x12c223,null))[_0x2a54('0x42')](removeEntity(_0x12c223,null))[_0x2a54('0x4a')](handleError(_0x12c223,null));};exports[_0x2a54('0x4e')]=function(_0x3fda4a,_0x5bad3d,_0x117038){var _0x4f0fac={};var _0x4dc392={};var _0x270569;var _0x3701e9;return db[_0x2a54('0x41')][_0x2a54('0x4f')]({'where':{'id':_0x3fda4a['params']['id']}})[_0x2a54('0x42')](handleEntityNotFound(_0x5bad3d,null))[_0x2a54('0x42')](function(_0x54407f){if(_0x54407f){_0x270569=_0x54407f;_0x4dc392[_0x2a54('0x30')]=_[_0x2a54('0x32')](db[_0x2a54('0x50')][_0x2a54('0x2c')]);_0x4dc392[_0x2a54('0x31')]=_['keys'](_0x3fda4a[_0x2a54('0x31')]);_0x4dc392[_0x2a54('0x33')]=_[_0x2a54('0x34')](_0x4dc392[_0x2a54('0x30')],_0x4dc392['query']);_0x4f0fac['attributes']=_[_0x2a54('0x34')](_0x4dc392[_0x2a54('0x30')],qs[_0x2a54('0x35')](_0x3fda4a[_0x2a54('0x31')][_0x2a54('0x35')]));_0x4f0fac[_0x2a54('0x36')]=_0x4f0fac[_0x2a54('0x36')]['length']?_0x4f0fac[_0x2a54('0x36')]:_0x4dc392[_0x2a54('0x30')];_0x4f0fac[_0x2a54('0x3a')]=qs['sort'](_0x3fda4a[_0x2a54('0x31')][_0x2a54('0x3b')]);_0x4f0fac[_0x2a54('0x3c')]=qs[_0x2a54('0x33')](_[_0x2a54('0x51')](_0x3fda4a['query'],_0x4dc392['filters']));if(_0x3fda4a[_0x2a54('0x31')][_0x2a54('0x3d')]){_0x4f0fac['where']=_[_0x2a54('0x3f')](_0x4f0fac[_0x2a54('0x3c')],{'$or':_[_0x2a54('0x2b')](_0x4f0fac[_0x2a54('0x36')],function(_0x33ff85){var _0x4b9c02={};_0x4b9c02[_0x33ff85]={'$like':'%'+_0x3fda4a[_0x2a54('0x31')][_0x2a54('0x3d')]+'%'};return _0x4b9c02;})});}_0x4f0fac=_[_0x2a54('0x3f')]({},_0x4f0fac,_0x3fda4a['options']);return _0x270569[_0x2a54('0x4e')](_0x4f0fac);}})[_0x2a54('0x42')](function(_0x58c866){if(_0x58c866){_0x3701e9=_0x58c866[_0x2a54('0x37')];if(!_0x3fda4a[_0x2a54('0x31')][_0x2a54('0x38')]('nolimit')){_0x4f0fac['limit']=qs[_0x2a54('0x1c')](_0x3fda4a[_0x2a54('0x31')][_0x2a54('0x1c')]);_0x4f0fac[_0x2a54('0x1d')]=qs[_0x2a54('0x1d')](_0x3fda4a[_0x2a54('0x31')][_0x2a54('0x1d')]);}return _0x270569[_0x2a54('0x4e')](_0x4f0fac);}})[_0x2a54('0x42')](function(_0x139497){if(_0x139497){return _0x139497?{'count':_0x3701e9,'rows':_0x139497}:null;}})[_0x2a54('0x42')](respondWithResult(_0x5bad3d,null))[_0x2a54('0x4a')](handleError(_0x5bad3d,null));};exports['getSubjects']=function(_0x5b69d9,_0x4f0436,_0x14ef87){var _0x2acb8f={};var _0x2b9f67={};var _0x539b5a;var _0xbb7a9a;return db[_0x2a54('0x41')][_0x2a54('0x4f')]({'where':{'id':_0x5b69d9[_0x2a54('0x48')]['id']}})[_0x2a54('0x42')](handleEntityNotFound(_0x4f0436,null))[_0x2a54('0x42')](function(_0x1d4db1){if(_0x1d4db1){_0x539b5a=_0x1d4db1;_0x2b9f67[_0x2a54('0x30')]=_['keys'](db[_0x2a54('0x50')][_0x2a54('0x2c')]);_0x2b9f67['query']=_[_0x2a54('0x32')](_0x5b69d9['query']);_0x2b9f67[_0x2a54('0x33')]=_[_0x2a54('0x34')](_0x2b9f67[_0x2a54('0x30')],_0x2b9f67[_0x2a54('0x31')]);_0x2acb8f['attributes']=_['intersection'](_0x2b9f67[_0x2a54('0x30')],qs[_0x2a54('0x35')](_0x5b69d9[_0x2a54('0x31')]['fields']));_0x2acb8f[_0x2a54('0x36')]=_0x2acb8f['attributes'][_0x2a54('0x37')]?_0x2acb8f[_0x2a54('0x36')]:_0x2b9f67['model'];_0x2acb8f[_0x2a54('0x3a')]=qs[_0x2a54('0x3b')](_0x5b69d9[_0x2a54('0x31')]['sort']);_0x2acb8f['where']=qs[_0x2a54('0x33')](_[_0x2a54('0x51')](_0x5b69d9['query'],_0x2b9f67['filters']));if(_0x5b69d9[_0x2a54('0x31')][_0x2a54('0x3d')]){_0x2acb8f[_0x2a54('0x3c')]=_['merge'](_0x2acb8f[_0x2a54('0x3c')],{'$or':_[_0x2a54('0x2b')](_0x2acb8f['attributes'],function(_0xebbf77){var _0x62641f={};_0x62641f[_0xebbf77]={'$like':'%'+_0x5b69d9[_0x2a54('0x31')][_0x2a54('0x3d')]+'%'};return _0x62641f;})});}_0x2acb8f=_[_0x2a54('0x3f')]({},_0x2acb8f,_0x5b69d9[_0x2a54('0x40')]);return _0x539b5a[_0x2a54('0x52')](_0x2acb8f);}})[_0x2a54('0x42')](function(_0x55b154){if(_0x55b154){_0xbb7a9a=_0x55b154[_0x2a54('0x37')];if(!_0x5b69d9['query'][_0x2a54('0x38')](_0x2a54('0x39'))){_0x2acb8f[_0x2a54('0x1c')]=qs[_0x2a54('0x1c')](_0x5b69d9['query'][_0x2a54('0x1c')]);_0x2acb8f['offset']=qs[_0x2a54('0x1d')](_0x5b69d9[_0x2a54('0x31')]['offset']);}return _0x539b5a['getSubjects'](_0x2acb8f);}})['then'](function(_0x11b1fb){if(_0x11b1fb){return _0x11b1fb?{'count':_0xbb7a9a,'rows':_0x11b1fb}:null;}})[_0x2a54('0x42')](respondWithResult(_0x4f0436,null))[_0x2a54('0x4a')](handleError(_0x4f0436,null));};exports[_0x2a54('0x53')]=function(_0x5ab28b,_0x319320,_0x570eed){var _0x4fff99={};var _0x1d4106={};var _0x2b5573;var _0xa3106;return db[_0x2a54('0x41')]['findOne']({'where':{'id':_0x5ab28b['params']['id']}})['then'](handleEntityNotFound(_0x319320,null))[_0x2a54('0x42')](function(_0xb26dfc){if(_0xb26dfc){_0x2b5573=_0xb26dfc;_0x1d4106[_0x2a54('0x30')]=_[_0x2a54('0x32')](db[_0x2a54('0x50')]['rawAttributes']);_0x1d4106['query']=_['keys'](_0x5ab28b['query']);_0x1d4106[_0x2a54('0x33')]=_['intersection'](_0x1d4106[_0x2a54('0x30')],_0x1d4106[_0x2a54('0x31')]);_0x4fff99[_0x2a54('0x36')]=_[_0x2a54('0x34')](_0x1d4106[_0x2a54('0x30')],qs[_0x2a54('0x35')](_0x5ab28b[_0x2a54('0x31')][_0x2a54('0x35')]));_0x4fff99[_0x2a54('0x36')]=_0x4fff99['attributes'][_0x2a54('0x37')]?_0x4fff99[_0x2a54('0x36')]:_0x1d4106[_0x2a54('0x30')];_0x4fff99[_0x2a54('0x3a')]=qs[_0x2a54('0x3b')](_0x5ab28b[_0x2a54('0x31')][_0x2a54('0x3b')]);_0x4fff99[_0x2a54('0x3c')]=qs['filters'](_[_0x2a54('0x51')](_0x5ab28b[_0x2a54('0x31')],_0x1d4106['filters']));if(_0x5ab28b[_0x2a54('0x31')][_0x2a54('0x3d')]){_0x4fff99[_0x2a54('0x3c')]=_[_0x2a54('0x3f')](_0x4fff99[_0x2a54('0x3c')],{'$or':_['map'](_0x4fff99['attributes'],function(_0x519428){var _0x283484={};_0x283484[_0x519428]={'$like':'%'+_0x5ab28b[_0x2a54('0x31')][_0x2a54('0x3d')]+'%'};return _0x283484;})});}_0x4fff99=_['merge']({},_0x4fff99,_0x5ab28b[_0x2a54('0x40')]);return _0x2b5573[_0x2a54('0x53')](_0x4fff99);}})[_0x2a54('0x42')](function(_0x5902f2){if(_0x5902f2){_0xa3106=_0x5902f2[_0x2a54('0x37')];if(!_0x5ab28b[_0x2a54('0x31')][_0x2a54('0x38')](_0x2a54('0x39'))){_0x4fff99[_0x2a54('0x1c')]=qs[_0x2a54('0x1c')](_0x5ab28b['query']['limit']);_0x4fff99[_0x2a54('0x1d')]=qs[_0x2a54('0x1d')](_0x5ab28b[_0x2a54('0x31')][_0x2a54('0x1d')]);}return _0x2b5573[_0x2a54('0x53')](_0x4fff99);}})[_0x2a54('0x42')](function(_0x149bf2){if(_0x149bf2){return _0x149bf2?{'count':_0xa3106,'rows':_0x149bf2}:null;}})[_0x2a54('0x42')](respondWithResult(_0x319320,null))[_0x2a54('0x4a')](handleError(_0x319320,null));};exports[_0x2a54('0x54')]=function(_0x401ad4,_0x214152,_0x35a826){var _0x493e90={};var _0x3df72a={};var _0x1f43de;var _0x3885da;return db[_0x2a54('0x41')]['findOne']({'where':{'id':_0x401ad4['params']['id']}})['then'](handleEntityNotFound(_0x214152,null))['then'](function(_0x11a99a){if(_0x11a99a){_0x1f43de=_0x11a99a;_0x3df72a[_0x2a54('0x30')]=_[_0x2a54('0x32')](db[_0x2a54('0x55')][_0x2a54('0x2c')]);_0x3df72a[_0x2a54('0x31')]=_[_0x2a54('0x32')](_0x401ad4[_0x2a54('0x31')]);_0x3df72a[_0x2a54('0x33')]=_['intersection'](_0x3df72a[_0x2a54('0x30')],_0x3df72a['query']);_0x493e90[_0x2a54('0x36')]=_[_0x2a54('0x34')](_0x3df72a['model'],qs[_0x2a54('0x35')](_0x401ad4[_0x2a54('0x31')][_0x2a54('0x35')]));_0x493e90[_0x2a54('0x36')]=_0x493e90['attributes']['length']?_0x493e90[_0x2a54('0x36')]:_0x3df72a[_0x2a54('0x30')];_0x493e90[_0x2a54('0x3a')]=qs[_0x2a54('0x3b')](_0x401ad4[_0x2a54('0x31')][_0x2a54('0x3b')]);_0x493e90[_0x2a54('0x3c')]=qs['filters'](_[_0x2a54('0x51')](_0x401ad4[_0x2a54('0x31')],_0x3df72a[_0x2a54('0x33')]));if(_0x401ad4[_0x2a54('0x31')][_0x2a54('0x3d')]){_0x493e90[_0x2a54('0x3c')]=_[_0x2a54('0x3f')](_0x493e90[_0x2a54('0x3c')],{'$or':_[_0x2a54('0x2b')](_0x493e90[_0x2a54('0x36')],function(_0x1730d3){var _0xf21ebb={};_0xf21ebb[_0x1730d3]={'$like':'%'+_0x401ad4[_0x2a54('0x31')][_0x2a54('0x3d')]+'%'};return _0xf21ebb;})});}_0x493e90=_[_0x2a54('0x3f')]({},_0x493e90,_0x401ad4[_0x2a54('0x40')]);return _0x1f43de[_0x2a54('0x54')](_0x493e90);}})[_0x2a54('0x42')](function(_0x1925dc){if(_0x1925dc){_0x3885da=_0x1925dc[_0x2a54('0x37')];if(!_0x401ad4[_0x2a54('0x31')]['hasOwnProperty']('nolimit')){_0x493e90[_0x2a54('0x1c')]=qs[_0x2a54('0x1c')](_0x401ad4[_0x2a54('0x31')][_0x2a54('0x1c')]);_0x493e90[_0x2a54('0x1d')]=qs[_0x2a54('0x1d')](_0x401ad4[_0x2a54('0x31')][_0x2a54('0x1d')]);}return _0x1f43de['getTags'](_0x493e90);}})[_0x2a54('0x42')](function(_0x5bee09){if(_0x5bee09){return _0x5bee09?{'count':_0x3885da,'rows':_0x5bee09}:null;}})[_0x2a54('0x42')](respondWithResult(_0x214152,null))[_0x2a54('0x4a')](handleError(_0x214152,null));};exports[_0x2a54('0x56')]=function(_0x1702a6,_0x3b624d,_0x22065b){if(_0x1702a6['body']['id']){delete _0x1702a6['body']['id'];}return db[_0x2a54('0x41')][_0x2a54('0x4f')]({'where':{'id':_0x1702a6[_0x2a54('0x48')]['id']}})[_0x2a54('0x42')](handleEntityNotFound(_0x3b624d,null))[_0x2a54('0x42')](function(_0xc98c51){if(_0xc98c51){return _0xc98c51[_0x2a54('0x56')](_0x1702a6[_0x2a54('0x4c')]['ids']||[]);}return null;})[_0x2a54('0x42')](respondWithResult(_0x3b624d,null))['catch'](handleError(_0x3b624d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 6208cf2..0e9193b 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 _0x8952=['exports','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xb21ca5,_0x120b89){var _0x4a81f3=function(_0x14134b){while(--_0x14134b){_0xb21ca5['push'](_0xb21ca5['shift']());}};_0x4a81f3(++_0x120b89);}(_0x8952,0x17e));var _0x2895=function(_0xd880af,_0x7db254){_0xd880af=_0xd880af-0x0;var _0x4aa064=_0x8952[_0xd880af];return _0x4aa064;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var logger=require(_0x2895('0x1'))(_0x2895('0x2'));var moment=require(_0x2895('0x3'));var BPromise=require(_0x2895('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2895('0x5'));var rimraf=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x2895('0x8')]=function(_0x73c245,_0x37305b){return _0x73c245['define']('ZendeskConfiguration',attributes,{'tableName':_0x2895('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb74=['rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5be643,_0x200c53){var _0x5b2394=function(_0x3dbbba){while(--_0x3dbbba){_0x5be643['push'](_0x5be643['shift']());}};_0x5b2394(++_0x200c53);}(_0xeb74,0xe3));var _0x4eb7=function(_0x4c44cc,_0x434f68){_0x4c44cc=_0x4c44cc-0x0;var _0x2a64be=_0xeb74[_0x4c44cc];return _0x2a64be;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var logger=require(_0x4eb7('0x2'))(_0x4eb7('0x3'));var moment=require(_0x4eb7('0x4'));var BPromise=require(_0x4eb7('0x5'));var rp=require(_0x4eb7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4eb7('0x7'));var config=require(_0x4eb7('0x8'));var attributes=require(_0x4eb7('0x9'));module[_0x4eb7('0xa')]=function(_0xa6e086,_0x563d6e){return _0xa6e086[_0x4eb7('0xb')]('ZendeskConfiguration',attributes,{'tableName':_0x4eb7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 00f6cce..0ac5b2f 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 _0x8000=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2a68fe,_0x10b4a6){var _0x2962ab=function(_0x4f4c2e){while(--_0x4f4c2e){_0x2a68fe['push'](_0x2a68fe['shift']());}};_0x2962ab(++_0x10b4a6);}(_0x8000,0xf7));var _0x0800=function(_0x407b7c,_0x14fa43){_0x407b7c=_0x407b7c-0x0;var _0x3f47aa=_0x8000[_0x407b7c];return _0x3f47aa;};'use strict';var _=require('lodash');var util=require(_0x0800('0x0'));var moment=require(_0x0800('0x1'));var BPromise=require(_0x0800('0x2'));var rs=require(_0x0800('0x3'));var fs=require('fs');var Redis=require(_0x0800('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0800('0x5'));var logger=require(_0x0800('0x6'))(_0x0800('0x7'));var config=require(_0x0800('0x8'));var jayson=require(_0x0800('0x9'));var client=jayson[_0x0800('0xa')][_0x0800('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cb4ac,_0x2a7620,_0x1ca977){return new BPromise(function(_0x3493d6,_0x251219){return client[_0x0800('0xc')](_0x2cb4ac,_0x1ca977)[_0x0800('0xd')](function(_0x26c081){logger['info'](_0x0800('0xe'),_0x2a7620,_0x0800('0xf'));logger[_0x0800('0x10')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2a7620,'request\x20sent',JSON['stringify'](_0x26c081));if(_0x26c081['error']){if(_0x26c081[_0x0800('0x11')][_0x0800('0x12')]===0x1f4){logger[_0x0800('0x11')](_0x0800('0xe'),_0x2a7620,_0x26c081[_0x0800('0x11')][_0x0800('0x13')]);return _0x251219(_0x26c081[_0x0800('0x11')]['message']);}logger[_0x0800('0x11')](_0x0800('0xe'),_0x2a7620,_0x26c081['error'][_0x0800('0x13')]);return _0x3493d6(_0x26c081[_0x0800('0x11')][_0x0800('0x13')]);}else{logger[_0x0800('0x14')](_0x0800('0xe'),_0x2a7620,_0x0800('0xf'));_0x3493d6(_0x26c081[_0x0800('0x15')]['message']);}})[_0x0800('0x16')](function(_0x2c7d80){logger[_0x0800('0x11')](_0x0800('0xe'),_0x2a7620,_0x2c7d80);_0x251219(_0x2c7d80);});});} \ No newline at end of file +var _0x86a2=['stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x31042b,_0x32d55a){var _0x21eb26=function(_0xe57ad2){while(--_0xe57ad2){_0x31042b['push'](_0x31042b['shift']());}};_0x21eb26(++_0x32d55a);}(_0x86a2,0x84));var _0x286a=function(_0xffb079,_0x2d5dc0){_0xffb079=_0xffb079-0x0;var _0x4ed0ee=_0x86a2[_0xffb079];return _0x4ed0ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x286a('0x0'));var BPromise=require(_0x286a('0x1'));var rs=require(_0x286a('0x2'));var fs=require('fs');var Redis=require(_0x286a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x286a('0x4'))(_0x286a('0x5'));var config=require(_0x286a('0x6'));var jayson=require(_0x286a('0x7'));var client=jayson['client'][_0x286a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38b9d2,_0x57066b,_0x9f7b18){return new BPromise(function(_0x3dfbe2,_0x3034c6){return client['request'](_0x38b9d2,_0x9f7b18)[_0x286a('0x9')](function(_0x2f363c){logger[_0x286a('0xa')](_0x286a('0xb'),_0x57066b,_0x286a('0xc'));logger[_0x286a('0xd')](_0x286a('0xe'),_0x57066b,_0x286a('0xc'),JSON[_0x286a('0xf')](_0x2f363c));if(_0x2f363c['error']){if(_0x2f363c[_0x286a('0x10')][_0x286a('0x11')]===0x1f4){logger[_0x286a('0x10')](_0x286a('0xb'),_0x57066b,_0x2f363c[_0x286a('0x10')]['message']);return _0x3034c6(_0x2f363c[_0x286a('0x10')]['message']);}logger[_0x286a('0x10')](_0x286a('0xb'),_0x57066b,_0x2f363c['error'][_0x286a('0x12')]);return _0x3dfbe2(_0x2f363c[_0x286a('0x10')][_0x286a('0x12')]);}else{logger[_0x286a('0xa')](_0x286a('0xb'),_0x57066b,_0x286a('0xc'));_0x3dfbe2(_0x2f363c[_0x286a('0x13')][_0x286a('0x12')]);}})[_0x286a('0x14')](function(_0x2c8539){logger[_0x286a('0x10')](_0x286a('0xb'),_0x57066b,_0x2c8539);_0x3034c6(_0x2c8539);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 9bfb5bd..004b161 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 _0x717d=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x3b7a0c,_0xf1a4c2){var _0x3bb70f=function(_0x248b52){while(--_0x248b52){_0x3b7a0c['push'](_0x3b7a0c['shift']());}};_0x3bb70f(++_0xf1a4c2);}(_0x717d,0x1ef));var _0xd717=function(_0x3a99f4,_0x2a81c1){_0x3a99f4=_0x3a99f4-0x0;var _0xea0b42=_0x717d[_0x3a99f4];return _0xea0b42;};'use strict';var multer=require('multer');var util=require(_0xd717('0x0'));var path=require(_0xd717('0x1'));var timeout=require(_0xd717('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd717('0x3'));var auth=require(_0xd717('0x4'));var interaction=require(_0xd717('0x5'));var config=require(_0xd717('0x6'));var controller=require(_0xd717('0x7'));router['get']('/',auth[_0xd717('0x8')](),controller[_0xd717('0x9')]);router[_0xd717('0xa')](_0xd717('0xb'),auth[_0xd717('0x8')](),controller[_0xd717('0xc')]);router[_0xd717('0xd')]('/',auth['isAuthenticated'](),controller[_0xd717('0xe')]);router[_0xd717('0xf')](_0xd717('0xb'),auth[_0xd717('0x8')](),controller[_0xd717('0x10')]);router[_0xd717('0x11')](_0xd717('0xb'),auth['isAuthenticated'](),controller[_0xd717('0x12')]);module[_0xd717('0x13')]=router; \ No newline at end of file +var _0x25a8=['show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x1cbaa2,_0x16f4d8){var _0x114440=function(_0x22d234){while(--_0x22d234){_0x1cbaa2['push'](_0x1cbaa2['shift']());}};_0x114440(++_0x16f4d8);}(_0x25a8,0x196));var _0x825a=function(_0x1683e0,_0x13d554){_0x1683e0=_0x1683e0-0x0;var _0x5f1345=_0x25a8[_0x1683e0];return _0x5f1345;};'use strict';var multer=require(_0x825a('0x0'));var util=require(_0x825a('0x1'));var path=require(_0x825a('0x2'));var timeout=require(_0x825a('0x3'));var express=require(_0x825a('0x4'));var router=express[_0x825a('0x5')]();var fs_extra=require(_0x825a('0x6'));var auth=require(_0x825a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x825a('0x8'));var controller=require('./intZendeskField.controller');router[_0x825a('0x9')]('/',auth[_0x825a('0xa')](),controller['index']);router[_0x825a('0x9')](_0x825a('0xb'),auth[_0x825a('0xa')](),controller[_0x825a('0xc')]);router[_0x825a('0xd')]('/',auth[_0x825a('0xa')](),controller['create']);router[_0x825a('0xe')]('/:id',auth[_0x825a('0xa')](),controller[_0x825a('0xf')]);router[_0x825a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x825a('0x11')]);module[_0x825a('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 743d58f..d123388 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 _0x9d9b=['ENUM','string','BOOLEAN','sequelize','exports','variable','customVariable','STRING'];(function(_0x5f12f5,_0x3257e9){var _0x1f271d=function(_0x497e12){while(--_0x497e12){_0x5f12f5['push'](_0x5f12f5['shift']());}};_0x1f271d(++_0x3257e9);}(_0x9d9b,0x173));var _0xb9d9=function(_0x35e545,_0xc101d8){_0x35e545=_0x35e545-0x0;var _0x10b7aa=_0x9d9b[_0x35e545];return _0x10b7aa;};'use strict';var Sequelize=require(_0xb9d9('0x0'));module[_0xb9d9('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xb9d9('0x2'),_0xb9d9('0x3'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xb9d9('0x4')]},'key':{'type':Sequelize[_0xb9d9('0x4')]},'keyType':{'type':Sequelize[_0xb9d9('0x5')](_0xb9d9('0x6'),_0xb9d9('0x2'),_0xb9d9('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb9d9('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb9d9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x85f8=['variable','customVariable','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x931e83,_0x30fdb5){var _0x51c734=function(_0x305463){while(--_0x305463){_0x931e83['push'](_0x931e83['shift']());}};_0x51c734(++_0x30fdb5);}(_0x85f8,0x102));var _0x885f=function(_0x77ec84,_0x554b03){_0x77ec84=_0x77ec84-0x0;var _0x224ed3=_0x85f8[_0x77ec84];return _0x224ed3;};'use strict';var Sequelize=require(_0x885f('0x0'));module[_0x885f('0x1')]={'type':{'type':Sequelize[_0x885f('0x2')]('string',_0x885f('0x3'),_0x885f('0x4'),'keyValue',_0x885f('0x5')),'defaultValue':_0x885f('0x6')},'content':{'type':Sequelize[_0x885f('0x7')]},'key':{'type':Sequelize[_0x885f('0x7')]},'keyType':{'type':Sequelize[_0x885f('0x2')]('string',_0x885f('0x3'),_0x885f('0x4'))},'keyContent':{'type':Sequelize[_0x885f('0x7')]},'idField':{'type':Sequelize[_0x885f('0x7')]},'nameField':{'type':Sequelize[_0x885f('0x7')]},'customField':{'type':Sequelize[_0x885f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x885f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 480e4f5..f165c89 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 _0x83bd=['name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ZendeskField','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0xcba291,_0x10e9d5){var _0x162274=function(_0x38100e){while(--_0x38100e){_0xcba291['push'](_0xcba291['shift']());}};_0x162274(++_0x10e9d5);}(_0x83bd,0x160));var _0xd83b=function(_0x4b1665,_0xb0c095){_0x4b1665=_0x4b1665-0x0;var _0x5850c0=_0x83bd[_0x4b1665];return _0x5850c0;};'use strict';var emlformat=require(_0xd83b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd83b('0x1'));var jsonpatch=require(_0xd83b('0x2'));var rp=require(_0xd83b('0x3'));var moment=require(_0xd83b('0x4'));var BPromise=require(_0xd83b('0x5'));var Mustache=require(_0xd83b('0x6'));var util=require(_0xd83b('0x7'));var path=require(_0xd83b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd83b('0x9'));var fs=require('fs');var fs_extra=require(_0xd83b('0xa'));var _=require(_0xd83b('0xb'));var squel=require(_0xd83b('0xc'));var crypto=require(_0xd83b('0xd'));var jsforce=require(_0xd83b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd83b('0xf'));var querystring=require(_0xd83b('0x10'));var Papa=require('papaparse');var Redis=require(_0xd83b('0x11'));var authService=require(_0xd83b('0x12'));var qs=require(_0xd83b('0x13'));var as=require(_0xd83b('0x14'));var hardwareService=require(_0xd83b('0x15'));var logger=require(_0xd83b('0x16'))(_0xd83b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd83b('0x18'));var db=require(_0xd83b('0x19'))['db'];function respondWithStatusCode(_0x6daa86,_0x4050c8){_0x4050c8=_0x4050c8||0xcc;return function(_0x37226b){if(_0x37226b){return _0x6daa86[_0xd83b('0x1a')](_0x4050c8);}return _0x6daa86['status'](_0x4050c8)[_0xd83b('0x1b')]();};}function respondWithResult(_0x4ba772,_0x36b289){_0x36b289=_0x36b289||0xc8;return function(_0x4b134f){if(_0x4b134f){return _0x4ba772[_0xd83b('0x1c')](_0x36b289)[_0xd83b('0x1d')](_0x4b134f);}};}function respondWithFilteredResult(_0x13a05f,_0x3f726e){return function(_0x24ca6b){if(_0x24ca6b){var _0x179b07=typeof _0x3f726e['offset']===_0xd83b('0x1e')&&typeof _0x3f726e[_0xd83b('0x1f')]===_0xd83b('0x1e');var _0x3143a5=_0x24ca6b[_0xd83b('0x20')];var _0x57451d=_0x179b07?0x0:_0x3f726e[_0xd83b('0x21')];var _0x2b1f10=_0x179b07?_0x24ca6b['count']:_0x3f726e[_0xd83b('0x21')]+_0x3f726e[_0xd83b('0x1f')];var _0x2a2186;if(_0x2b1f10>=_0x3143a5){_0x2b1f10=_0x3143a5;_0x2a2186=0xc8;}else{_0x2a2186=0xce;}_0x13a05f[_0xd83b('0x1c')](_0x2a2186);return _0x13a05f['set'](_0xd83b('0x22'),_0x57451d+'-'+_0x2b1f10+'/'+_0x3143a5)[_0xd83b('0x1d')](_0x24ca6b);}return null;};}function patchUpdates(_0x36c32d){return function(_0x3398df){try{jsonpatch[_0xd83b('0x23')](_0x3398df,_0x36c32d,!![]);}catch(_0x1ec4e2){return BPromise[_0xd83b('0x24')](_0x1ec4e2);}return _0x3398df[_0xd83b('0x25')]();};}function saveUpdates(_0x4d5ead,_0x643567){return function(_0xd5b58d){if(_0xd5b58d){return _0xd5b58d[_0xd83b('0x26')](_0x4d5ead)[_0xd83b('0x27')](function(_0xbd3587){return _0xbd3587;});}return null;};}function removeEntity(_0x310583,_0x188a4f){return function(_0x211602){if(_0x211602){return _0x211602[_0xd83b('0x28')]()[_0xd83b('0x27')](function(){_0x310583[_0xd83b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x564662,_0x2de48b){return function(_0xc04cd9){if(!_0xc04cd9){_0x564662[_0xd83b('0x1a')](0x194);}return _0xc04cd9;};}function handleError(_0x42c531,_0x2023d6){_0x2023d6=_0x2023d6||0x1f4;return function(_0x31b35c){logger[_0xd83b('0x29')](_0x31b35c[_0xd83b('0x2a')]);if(_0x31b35c[_0xd83b('0x2b')]){delete _0x31b35c[_0xd83b('0x2b')];}_0x42c531[_0xd83b('0x1c')](_0x2023d6)[_0xd83b('0x2c')](_0x31b35c);};}exports[_0xd83b('0x2d')]=function(_0x58d49d,_0x467f7f){var _0x359375={},_0x469814={},_0x5b6e6b={'count':0x0,'rows':[]};var _0x6a1a9f=_[_0xd83b('0x2e')](db['ZendeskField'][_0xd83b('0x2f')],function(_0x3ce0b9){return{'name':_0x3ce0b9[_0xd83b('0x30')],'type':_0x3ce0b9[_0xd83b('0x31')][_0xd83b('0x32')]};});_0x469814[_0xd83b('0x33')]=_[_0xd83b('0x2e')](_0x6a1a9f,_0xd83b('0x2b'));_0x469814['query']=_['keys'](_0x58d49d[_0xd83b('0x34')]);_0x469814['filters']=_[_0xd83b('0x35')](_0x469814[_0xd83b('0x33')],_0x469814['query']);_0x359375['attributes']=_[_0xd83b('0x35')](_0x469814[_0xd83b('0x33')],qs[_0xd83b('0x36')](_0x58d49d[_0xd83b('0x34')]['fields']));_0x359375[_0xd83b('0x37')]=_0x359375['attributes']['length']?_0x359375[_0xd83b('0x37')]:_0x469814[_0xd83b('0x33')];if(!_0x58d49d[_0xd83b('0x34')][_0xd83b('0x38')]('nolimit')){_0x359375['limit']=qs[_0xd83b('0x1f')](_0x58d49d[_0xd83b('0x34')][_0xd83b('0x1f')]);_0x359375[_0xd83b('0x21')]=qs['offset'](_0x58d49d[_0xd83b('0x34')][_0xd83b('0x21')]);}_0x359375[_0xd83b('0x39')]=qs[_0xd83b('0x3a')](_0x58d49d[_0xd83b('0x34')][_0xd83b('0x3a')]);_0x359375[_0xd83b('0x3b')]=qs[_0xd83b('0x3c')](_[_0xd83b('0x3d')](_0x58d49d[_0xd83b('0x34')],_0x469814[_0xd83b('0x3c')]),_0x6a1a9f);if(_0x58d49d[_0xd83b('0x34')][_0xd83b('0x3e')]){_0x359375[_0xd83b('0x3b')]=_[_0xd83b('0x3f')](_0x359375[_0xd83b('0x3b')],{'$or':_[_0xd83b('0x2e')](_0x6a1a9f,function(_0x338de5){if(_0x338de5[_0xd83b('0x31')]!==_0xd83b('0x40')){var _0xa58c15={};_0xa58c15[_0x338de5[_0xd83b('0x2b')]]={'$like':'%'+_0x58d49d['query']['filter']+'%'};return _0xa58c15;}})});}_0x359375=_[_0xd83b('0x3f')]({},_0x359375,_0x58d49d[_0xd83b('0x41')]);var _0x32bdf6={'where':_0x359375['where']};return db[_0xd83b('0x42')][_0xd83b('0x20')](_0x32bdf6)[_0xd83b('0x27')](function(_0x335c35){_0x5b6e6b[_0xd83b('0x20')]=_0x335c35;if(_0x58d49d[_0xd83b('0x34')][_0xd83b('0x43')]){_0x359375[_0xd83b('0x44')]=[{'all':!![]}];}return db['ZendeskField'][_0xd83b('0x45')](_0x359375);})[_0xd83b('0x27')](function(_0x11ae21){_0x5b6e6b[_0xd83b('0x46')]=_0x11ae21;return _0x5b6e6b;})[_0xd83b('0x27')](respondWithFilteredResult(_0x467f7f,_0x359375))[_0xd83b('0x47')](handleError(_0x467f7f,null));};exports[_0xd83b('0x48')]=function(_0x208948,_0x46e967){var _0x3412cb={'raw':!![],'where':{'id':_0x208948['params']['id']}},_0x2869c8={};_0x2869c8[_0xd83b('0x33')]=_[_0xd83b('0x49')](db[_0xd83b('0x42')][_0xd83b('0x2f')]);_0x2869c8[_0xd83b('0x34')]=_[_0xd83b('0x49')](_0x208948[_0xd83b('0x34')]);_0x2869c8[_0xd83b('0x3c')]=_['intersection'](_0x2869c8['model'],_0x2869c8[_0xd83b('0x34')]);_0x3412cb[_0xd83b('0x37')]=_[_0xd83b('0x35')](_0x2869c8['model'],qs[_0xd83b('0x36')](_0x208948['query'][_0xd83b('0x36')]));_0x3412cb[_0xd83b('0x37')]=_0x3412cb['attributes'][_0xd83b('0x4a')]?_0x3412cb[_0xd83b('0x37')]:_0x2869c8[_0xd83b('0x33')];if(_0x208948[_0xd83b('0x34')][_0xd83b('0x43')]){_0x3412cb[_0xd83b('0x44')]=[{'all':!![]}];}_0x3412cb=_[_0xd83b('0x3f')]({},_0x3412cb,_0x208948[_0xd83b('0x41')]);return db[_0xd83b('0x42')][_0xd83b('0x4b')](_0x3412cb)[_0xd83b('0x27')](handleEntityNotFound(_0x46e967,null))[_0xd83b('0x27')](respondWithResult(_0x46e967,null))[_0xd83b('0x47')](handleError(_0x46e967,null));};exports[_0xd83b('0x4c')]=function(_0x3ec0e5,_0xaf86f9){return db[_0xd83b('0x42')]['create'](_0x3ec0e5[_0xd83b('0x4d')],{})[_0xd83b('0x27')](respondWithResult(_0xaf86f9,0xc9))[_0xd83b('0x47')](handleError(_0xaf86f9,null));};exports[_0xd83b('0x26')]=function(_0x1c63c8,_0x16662e){if(_0x1c63c8['body']['id']){delete _0x1c63c8[_0xd83b('0x4d')]['id'];}return db['ZendeskField'][_0xd83b('0x4b')]({'where':{'id':_0x1c63c8[_0xd83b('0x4e')]['id']}})[_0xd83b('0x27')](handleEntityNotFound(_0x16662e,null))[_0xd83b('0x27')](saveUpdates(_0x1c63c8[_0xd83b('0x4d')],null))['then'](respondWithResult(_0x16662e,null))[_0xd83b('0x47')](handleError(_0x16662e,null));};exports[_0xd83b('0x28')]=function(_0x493b7f,_0x5a8864){return db['ZendeskField']['find']({'where':{'id':_0x493b7f[_0xd83b('0x4e')]['id']}})[_0xd83b('0x27')](handleEntityNotFound(_0x5a8864,null))[_0xd83b('0x27')](removeEntity(_0x5a8864,null))[_0xd83b('0x47')](handleError(_0x5a8864,null));}; \ No newline at end of file +var _0xb37b=['update','then','destroy','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','keys','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x9b2aa,_0x48b00d){var _0x497eb9=function(_0xd1ce77){while(--_0xd1ce77){_0x9b2aa['push'](_0x9b2aa['shift']());}};_0x497eb9(++_0x48b00d);}(_0xb37b,0x1de));var _0xbb37=function(_0x45ccbe,_0x3fe213){_0x45ccbe=_0x45ccbe-0x0;var _0x52d6ec=_0xb37b[_0x45ccbe];return _0x52d6ec;};'use strict';var emlformat=require(_0xbb37('0x0'));var rimraf=require(_0xbb37('0x1'));var zipdir=require(_0xbb37('0x2'));var jsonpatch=require(_0xbb37('0x3'));var rp=require(_0xbb37('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbb37('0x5'));var util=require(_0xbb37('0x6'));var path=require(_0xbb37('0x7'));var sox=require('sox');var csv=require(_0xbb37('0x8'));var ejs=require(_0xbb37('0x9'));var fs=require('fs');var fs_extra=require(_0xbb37('0xa'));var _=require(_0xbb37('0xb'));var squel=require(_0xbb37('0xc'));var crypto=require(_0xbb37('0xd'));var jsforce=require(_0xbb37('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbb37('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbb37('0x10'));var qs=require(_0xbb37('0x11'));var as=require(_0xbb37('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb37('0x13'))('api');var utils=require(_0xbb37('0x14'));var config=require(_0xbb37('0x15'));var licenseUtil=require(_0xbb37('0x16'));var db=require(_0xbb37('0x17'))['db'];function respondWithStatusCode(_0x2fa91f,_0x3bdd92){_0x3bdd92=_0x3bdd92||0xcc;return function(_0x4bed97){if(_0x4bed97){return _0x2fa91f[_0xbb37('0x18')](_0x3bdd92);}return _0x2fa91f[_0xbb37('0x19')](_0x3bdd92)[_0xbb37('0x1a')]();};}function respondWithResult(_0x29f8e4,_0x1dfa27){_0x1dfa27=_0x1dfa27||0xc8;return function(_0x2d98f7){if(_0x2d98f7){return _0x29f8e4[_0xbb37('0x19')](_0x1dfa27)[_0xbb37('0x1b')](_0x2d98f7);}};}function respondWithFilteredResult(_0x29e930,_0xad6a30){return function(_0x2357d5){if(_0x2357d5){var _0x4f324d=typeof _0xad6a30[_0xbb37('0x1c')]==='undefined'&&typeof _0xad6a30[_0xbb37('0x1d')]===_0xbb37('0x1e');var _0x9911a8=_0x2357d5[_0xbb37('0x1f')];var _0x47e323=_0x4f324d?0x0:_0xad6a30[_0xbb37('0x1c')];var _0x2fb45d=_0x4f324d?_0x2357d5[_0xbb37('0x1f')]:_0xad6a30[_0xbb37('0x1c')]+_0xad6a30[_0xbb37('0x1d')];var _0x562549;if(_0x2fb45d>=_0x9911a8){_0x2fb45d=_0x9911a8;_0x562549=0xc8;}else{_0x562549=0xce;}_0x29e930['status'](_0x562549);return _0x29e930[_0xbb37('0x20')]('Content-Range',_0x47e323+'-'+_0x2fb45d+'/'+_0x9911a8)[_0xbb37('0x1b')](_0x2357d5);}return null;};}function patchUpdates(_0x3cfce4){return function(_0x56d7d9){try{jsonpatch['apply'](_0x56d7d9,_0x3cfce4,!![]);}catch(_0x1802a3){return BPromise['reject'](_0x1802a3);}return _0x56d7d9['save']();};}function saveUpdates(_0x20bf42,_0x52fe3e){return function(_0x5ff58f){if(_0x5ff58f){return _0x5ff58f[_0xbb37('0x21')](_0x20bf42)[_0xbb37('0x22')](function(_0x565b2a){return _0x565b2a;});}return null;};}function removeEntity(_0x487b5c,_0x202930){return function(_0x256076){if(_0x256076){return _0x256076[_0xbb37('0x23')]()['then'](function(){_0x487b5c[_0xbb37('0x19')](0xcc)[_0xbb37('0x1a')]();});}};}function handleEntityNotFound(_0x3b4758,_0x4d301e){return function(_0x10d9d3){if(!_0x10d9d3){_0x3b4758[_0xbb37('0x18')](0x194);}return _0x10d9d3;};}function handleError(_0x3afed6,_0x8761f4){_0x8761f4=_0x8761f4||0x1f4;return function(_0x19eca3){logger[_0xbb37('0x24')](_0x19eca3[_0xbb37('0x25')]);if(_0x19eca3[_0xbb37('0x26')]){delete _0x19eca3[_0xbb37('0x26')];}_0x3afed6[_0xbb37('0x19')](_0x8761f4)['send'](_0x19eca3);};}exports[_0xbb37('0x27')]=function(_0x26ecd0,_0x5b741c){var _0x4d3b68={},_0x2959eb={},_0x5af88e={'count':0x0,'rows':[]};var _0xa16056=_[_0xbb37('0x28')](db[_0xbb37('0x29')][_0xbb37('0x2a')],function(_0x4339f1){return{'name':_0x4339f1[_0xbb37('0x2b')],'type':_0x4339f1['type'][_0xbb37('0x2c')]};});_0x2959eb[_0xbb37('0x2d')]=_[_0xbb37('0x28')](_0xa16056,_0xbb37('0x26'));_0x2959eb[_0xbb37('0x2e')]=_['keys'](_0x26ecd0[_0xbb37('0x2e')]);_0x2959eb[_0xbb37('0x2f')]=_[_0xbb37('0x30')](_0x2959eb[_0xbb37('0x2d')],_0x2959eb[_0xbb37('0x2e')]);_0x4d3b68[_0xbb37('0x31')]=_[_0xbb37('0x30')](_0x2959eb['model'],qs[_0xbb37('0x32')](_0x26ecd0[_0xbb37('0x2e')][_0xbb37('0x32')]));_0x4d3b68[_0xbb37('0x31')]=_0x4d3b68[_0xbb37('0x31')][_0xbb37('0x33')]?_0x4d3b68['attributes']:_0x2959eb[_0xbb37('0x2d')];if(!_0x26ecd0[_0xbb37('0x2e')][_0xbb37('0x34')](_0xbb37('0x35'))){_0x4d3b68[_0xbb37('0x1d')]=qs['limit'](_0x26ecd0['query'][_0xbb37('0x1d')]);_0x4d3b68[_0xbb37('0x1c')]=qs[_0xbb37('0x1c')](_0x26ecd0[_0xbb37('0x2e')][_0xbb37('0x1c')]);}_0x4d3b68[_0xbb37('0x36')]=qs[_0xbb37('0x37')](_0x26ecd0[_0xbb37('0x2e')][_0xbb37('0x37')]);_0x4d3b68[_0xbb37('0x38')]=qs[_0xbb37('0x2f')](_[_0xbb37('0x39')](_0x26ecd0[_0xbb37('0x2e')],_0x2959eb['filters']),_0xa16056);if(_0x26ecd0[_0xbb37('0x2e')][_0xbb37('0x3a')]){_0x4d3b68[_0xbb37('0x38')]=_[_0xbb37('0x3b')](_0x4d3b68[_0xbb37('0x38')],{'$or':_[_0xbb37('0x28')](_0xa16056,function(_0x5871b4){if(_0x5871b4[_0xbb37('0x3c')]!==_0xbb37('0x3d')){var _0x4c4373={};_0x4c4373[_0x5871b4[_0xbb37('0x26')]]={'$like':'%'+_0x26ecd0[_0xbb37('0x2e')]['filter']+'%'};return _0x4c4373;}})});}_0x4d3b68=_[_0xbb37('0x3b')]({},_0x4d3b68,_0x26ecd0['options']);var _0x27cafa={'where':_0x4d3b68[_0xbb37('0x38')]};return db['ZendeskField'][_0xbb37('0x1f')](_0x27cafa)[_0xbb37('0x22')](function(_0x364fe1){_0x5af88e[_0xbb37('0x1f')]=_0x364fe1;if(_0x26ecd0[_0xbb37('0x2e')][_0xbb37('0x3e')]){_0x4d3b68[_0xbb37('0x3f')]=[{'all':!![]}];}return db[_0xbb37('0x29')]['findAll'](_0x4d3b68);})[_0xbb37('0x22')](function(_0x40d6f5){_0x5af88e[_0xbb37('0x40')]=_0x40d6f5;return _0x5af88e;})['then'](respondWithFilteredResult(_0x5b741c,_0x4d3b68))[_0xbb37('0x41')](handleError(_0x5b741c,null));};exports[_0xbb37('0x42')]=function(_0x4c082c,_0x42159b){var _0x3afae7={'raw':!![],'where':{'id':_0x4c082c[_0xbb37('0x43')]['id']}},_0x2d322e={};_0x2d322e[_0xbb37('0x2d')]=_[_0xbb37('0x44')](db[_0xbb37('0x29')][_0xbb37('0x2a')]);_0x2d322e[_0xbb37('0x2e')]=_[_0xbb37('0x44')](_0x4c082c[_0xbb37('0x2e')]);_0x2d322e['filters']=_[_0xbb37('0x30')](_0x2d322e['model'],_0x2d322e[_0xbb37('0x2e')]);_0x3afae7['attributes']=_[_0xbb37('0x30')](_0x2d322e[_0xbb37('0x2d')],qs[_0xbb37('0x32')](_0x4c082c['query'][_0xbb37('0x32')]));_0x3afae7[_0xbb37('0x31')]=_0x3afae7[_0xbb37('0x31')][_0xbb37('0x33')]?_0x3afae7[_0xbb37('0x31')]:_0x2d322e[_0xbb37('0x2d')];if(_0x4c082c[_0xbb37('0x2e')]['includeAll']){_0x3afae7[_0xbb37('0x3f')]=[{'all':!![]}];}_0x3afae7=_[_0xbb37('0x3b')]({},_0x3afae7,_0x4c082c[_0xbb37('0x45')]);return db[_0xbb37('0x29')]['find'](_0x3afae7)['then'](handleEntityNotFound(_0x42159b,null))[_0xbb37('0x22')](respondWithResult(_0x42159b,null))[_0xbb37('0x41')](handleError(_0x42159b,null));};exports[_0xbb37('0x46')]=function(_0x44dd11,_0x47edb3){return db[_0xbb37('0x29')][_0xbb37('0x46')](_0x44dd11['body'],{})[_0xbb37('0x22')](respondWithResult(_0x47edb3,0xc9))['catch'](handleError(_0x47edb3,null));};exports['update']=function(_0x3eb04c,_0x41f57b){if(_0x3eb04c[_0xbb37('0x47')]['id']){delete _0x3eb04c[_0xbb37('0x47')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x3eb04c['params']['id']}})[_0xbb37('0x22')](handleEntityNotFound(_0x41f57b,null))[_0xbb37('0x22')](saveUpdates(_0x3eb04c[_0xbb37('0x47')],null))['then'](respondWithResult(_0x41f57b,null))[_0xbb37('0x41')](handleError(_0x41f57b,null));};exports[_0xbb37('0x23')]=function(_0x4f9137,_0x207e79){return db[_0xbb37('0x29')][_0xbb37('0x48')]({'where':{'id':_0x4f9137[_0xbb37('0x43')]['id']}})[_0xbb37('0x22')](handleEntityNotFound(_0x207e79,null))[_0xbb37('0x22')](removeEntity(_0x207e79,null))[_0xbb37('0x41')](handleError(_0x207e79,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 8c3444f..99209a5 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 _0x1243=['util','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','lodash'];(function(_0x18ad14,_0x4a4127){var _0x511e6e=function(_0x57c889){while(--_0x57c889){_0x18ad14['push'](_0x18ad14['shift']());}};_0x511e6e(++_0x4a4127);}(_0x1243,0xdf));var _0x3124=function(_0x20909e,_0x32154a){_0x20909e=_0x20909e-0x0;var _0x5d780e=_0x1243[_0x20909e];return _0x5d780e;};'use strict';var _=require(_0x3124('0x0'));var util=require(_0x3124('0x1'));var logger=require('../../config/logger')(_0x3124('0x2'));var moment=require(_0x3124('0x3'));var BPromise=require(_0x3124('0x4'));var rp=require(_0x3124('0x5'));var fs=require('fs');var path=require(_0x3124('0x6'));var rimraf=require('rimraf');var config=require(_0x3124('0x7'));var attributes=require(_0x3124('0x8'));module[_0x3124('0x9')]=function(_0x1a373a,_0x444132){return _0x1a373a[_0x3124('0xa')]('ZendeskField',attributes,{'tableName':_0x3124('0xb'),'paranoid':![],'indexes':[{'name':_0x3124('0xc'),'fields':[_0x3124('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2b3=['zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','ZendeskField','int_zendesk_fields'];(function(_0x1d3168,_0x43b8f9){var _0x497266=function(_0x3ac7f1){while(--_0x3ac7f1){_0x1d3168['push'](_0x1d3168['shift']());}};_0x497266(++_0x43b8f9);}(_0xf2b3,0x13e));var _0x3f2b=function(_0x50dcae,_0x4b310d){_0x50dcae=_0x50dcae-0x0;var _0xa5ff32=_0xf2b3[_0x50dcae];return _0xa5ff32;};'use strict';var _=require(_0x3f2b('0x0'));var util=require(_0x3f2b('0x1'));var logger=require(_0x3f2b('0x2'))(_0x3f2b('0x3'));var moment=require(_0x3f2b('0x4'));var BPromise=require(_0x3f2b('0x5'));var rp=require(_0x3f2b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3f2b('0x7'));var config=require(_0x3f2b('0x8'));var attributes=require('./intZendeskField.attributes');module[_0x3f2b('0x9')]=function(_0x11119f,_0x1c00a8){return _0x11119f['define'](_0x3f2b('0xa'),attributes,{'tableName':_0x3f2b('0xb'),'paranoid':![],'indexes':[{'name':_0x3f2b('0xc'),'fields':[_0x3f2b('0xd'),_0x3f2b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index f753440..a318fca 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 _0xabd0=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0xabd0,0x90));var _0x0abd=function(_0x167ff7,_0x7f8f0){_0x167ff7=_0x167ff7-0x0;var _0x40a4fc=_0xabd0[_0x167ff7];return _0x40a4fc;};'use strict';var _=require(_0x0abd('0x0'));var util=require(_0x0abd('0x1'));var moment=require(_0x0abd('0x2'));var BPromise=require('bluebird');var rs=require(_0x0abd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0abd('0x4'))['db'];var utils=require(_0x0abd('0x5'));var logger=require(_0x0abd('0x6'))('rpc');var config=require(_0x0abd('0x7'));var jayson=require(_0x0abd('0x8'));var client=jayson['client'][_0x0abd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2395fb,_0x393e5f,_0x52fcfc){return new BPromise(function(_0x1d6a43,_0x5bf096){return client[_0x0abd('0xa')](_0x2395fb,_0x52fcfc)[_0x0abd('0xb')](function(_0x1b8731){logger[_0x0abd('0xc')](_0x0abd('0xd'),_0x393e5f,_0x0abd('0xe'));logger['debug'](_0x0abd('0xf'),_0x393e5f,_0x0abd('0xe'),JSON['stringify'](_0x1b8731));if(_0x1b8731['error']){if(_0x1b8731[_0x0abd('0x10')][_0x0abd('0x11')]===0x1f4){logger[_0x0abd('0x10')]('ZendeskField,\x20%s,\x20%s',_0x393e5f,_0x1b8731[_0x0abd('0x10')]['message']);return _0x5bf096(_0x1b8731[_0x0abd('0x10')]['message']);}logger['error'](_0x0abd('0xd'),_0x393e5f,_0x1b8731[_0x0abd('0x10')][_0x0abd('0x12')]);return _0x1d6a43(_0x1b8731[_0x0abd('0x10')][_0x0abd('0x12')]);}else{logger[_0x0abd('0xc')](_0x0abd('0xd'),_0x393e5f,_0x0abd('0xe'));_0x1d6a43(_0x1b8731[_0x0abd('0x13')][_0x0abd('0x12')]);}})[_0x0abd('0x14')](function(_0x17033c){logger['error'](_0x0abd('0xd'),_0x393e5f,_0x17033c);_0x5bf096(_0x17033c);});});} \ No newline at end of file +var _0xf967=['lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x33f408,_0x561686){var _0x16c738=function(_0x4001c0){while(--_0x4001c0){_0x33f408['push'](_0x33f408['shift']());}};_0x16c738(++_0x561686);}(_0xf967,0xcf));var _0x7f96=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xf967[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x7f96('0x0'));var util=require('util');var moment=require(_0x7f96('0x1'));var BPromise=require(_0x7f96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f96('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f96('0x4'));var logger=require(_0x7f96('0x5'))(_0x7f96('0x6'));var config=require(_0x7f96('0x7'));var jayson=require(_0x7f96('0x8'));var client=jayson[_0x7f96('0x9')][_0x7f96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48a59a,_0x2ce655,_0x5bcb1c){return new BPromise(function(_0x599dee,_0x308170){return client['request'](_0x48a59a,_0x5bcb1c)[_0x7f96('0xb')](function(_0x31f8d8){logger[_0x7f96('0xc')](_0x7f96('0xd'),_0x2ce655,_0x7f96('0xe'));logger[_0x7f96('0xf')](_0x7f96('0x10'),_0x2ce655,_0x7f96('0xe'),JSON[_0x7f96('0x11')](_0x31f8d8));if(_0x31f8d8['error']){if(_0x31f8d8[_0x7f96('0x12')][_0x7f96('0x13')]===0x1f4){logger[_0x7f96('0x12')](_0x7f96('0xd'),_0x2ce655,_0x31f8d8[_0x7f96('0x12')][_0x7f96('0x14')]);return _0x308170(_0x31f8d8[_0x7f96('0x12')][_0x7f96('0x14')]);}logger[_0x7f96('0x12')](_0x7f96('0xd'),_0x2ce655,_0x31f8d8[_0x7f96('0x12')][_0x7f96('0x14')]);return _0x599dee(_0x31f8d8[_0x7f96('0x12')][_0x7f96('0x14')]);}else{logger[_0x7f96('0xc')](_0x7f96('0xd'),_0x2ce655,'request\x20sent');_0x599dee(_0x31f8d8[_0x7f96('0x15')][_0x7f96('0x14')]);}})[_0x7f96('0x16')](function(_0x2281f8){logger[_0x7f96('0x12')](_0x7f96('0xd'),_0x2ce655,_0x2281f8);_0x308170(_0x2281f8);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 9d25d9e..ed57285 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 _0x21bd=['../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x21bd,0xb2));var _0xd21b=function(_0x594670,_0x23244f){_0x594670=_0x594670-0x0;var _0x39384c=_0x21bd[_0x594670];return _0x39384c;};'use strict';var multer=require('multer');var util=require(_0xd21b('0x0'));var path=require(_0xd21b('0x1'));var timeout=require(_0xd21b('0x2'));var express=require(_0xd21b('0x3'));var router=express[_0xd21b('0x4')]();var fs_extra=require(_0xd21b('0x5'));var auth=require(_0xd21b('0x6'));var interaction=require(_0xd21b('0x7'));var config=require('../../config/environment');var controller=require(_0xd21b('0x8'));router[_0xd21b('0x9')]('/',auth['isAuthenticated'](),controller[_0xd21b('0xa')]);router['get'](_0xd21b('0xb'),auth[_0xd21b('0xc')](),controller['show']);router[_0xd21b('0x9')](_0xd21b('0xd'),auth['isAuthenticated'](),controller[_0xd21b('0xe')]);router[_0xd21b('0x9')](_0xd21b('0xf'),auth['isAuthenticated'](),controller[_0xd21b('0x10')]);router[_0xd21b('0x11')]('/',auth[_0xd21b('0xc')](),controller[_0xd21b('0x12')]);router[_0xd21b('0x11')]('/:id/configurations',auth[_0xd21b('0xc')](),controller[_0xd21b('0x13')]);router['put'](_0xd21b('0xb'),auth[_0xd21b('0xc')](),controller[_0xd21b('0x14')]);router['delete'](_0xd21b('0xb'),auth['isAuthenticated'](),controller[_0xd21b('0x15')]);module[_0xd21b('0x16')]=router; \ No newline at end of file +var _0xdbd0=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','put','/:id','delete','destroy','exports','multer','util'];(function(_0x4fae29,_0x5a1251){var _0x1bbcd1=function(_0x3566c0){while(--_0x3566c0){_0x4fae29['push'](_0x4fae29['shift']());}};_0x1bbcd1(++_0x5a1251);}(_0xdbd0,0x88));var _0x0dbd=function(_0x3c8b97,_0x33b4e7){_0x3c8b97=_0x3c8b97-0x0;var _0x4c2d7b=_0xdbd0[_0x3c8b97];return _0x4c2d7b;};'use strict';var multer=require(_0x0dbd('0x0'));var util=require(_0x0dbd('0x1'));var path=require(_0x0dbd('0x2'));var timeout=require(_0x0dbd('0x3'));var express=require(_0x0dbd('0x4'));var router=express['Router']();var fs_extra=require(_0x0dbd('0x5'));var auth=require(_0x0dbd('0x6'));var interaction=require(_0x0dbd('0x7'));var config=require('../../config/environment');var controller=require(_0x0dbd('0x8'));router[_0x0dbd('0x9')]('/',auth[_0x0dbd('0xa')](),controller[_0x0dbd('0xb')]);router['get']('/:id',auth[_0x0dbd('0xa')](),controller[_0x0dbd('0xc')]);router[_0x0dbd('0x9')](_0x0dbd('0xd'),auth[_0x0dbd('0xa')](),controller[_0x0dbd('0xe')]);router['get']('/:id/fields',auth[_0x0dbd('0xa')](),controller[_0x0dbd('0xf')]);router[_0x0dbd('0x10')]('/',auth[_0x0dbd('0xa')](),controller[_0x0dbd('0x11')]);router[_0x0dbd('0x10')](_0x0dbd('0xd'),auth[_0x0dbd('0xa')](),controller['addConfiguration']);router[_0x0dbd('0x12')](_0x0dbd('0x13'),auth[_0x0dbd('0xa')](),controller['update']);router[_0x0dbd('0x14')](_0x0dbd('0x13'),auth[_0x0dbd('0xa')](),controller[_0x0dbd('0x15')]);module[_0x0dbd('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 2a11936..de8fb9b 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 _0xedd9=['exports','STRING'];(function(_0x3e36c1,_0x582bde){var _0x526569=function(_0x25684e){while(--_0x25684e){_0x3e36c1['push'](_0x3e36c1['shift']());}};_0x526569(++_0x582bde);}(_0xedd9,0xfc));var _0x9edd=function(_0x4563ce,_0x23cd84){_0x4563ce=_0x4563ce-0x0;var _0x439e98=_0xedd9[_0x4563ce];return _0x439e98;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')]},'description':{'type':Sequelize[_0x9edd('0x1')]},'host':{'type':Sequelize[_0x9edd('0x1')]},'zone':{'type':Sequelize[_0x9edd('0x1')]},'clientId':{'type':Sequelize[_0x9edd('0x1')]},'clientSecret':{'type':Sequelize[_0x9edd('0x1')]},'serverUrl':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x9edd('0x1')]}}; \ No newline at end of file +var _0x4bc3=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bc3,0x16e));var _0x34bc=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x4bc3[_0x2adbeb];return _0x5e18a6;};'use strict';var Sequelize=require(_0x34bc('0x0'));module[_0x34bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x34bc('0x2')]},'host':{'type':Sequelize[_0x34bc('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x34bc('0x2')]},'clientSecret':{'type':Sequelize[_0x34bc('0x2')]},'serverUrl':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x34bc('0x2')]},'refreshToken':{'type':Sequelize[_0x34bc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 7d95ce6..ab48b33 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 _0x9594=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','limit','count','status','Content-Range','apply','reject','update','then','error','name','send','index','ZohoAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','rows','show','length','options','find','catch','create','body','destroy','getConfigurations','findOne','params','ZohoConfiguration','filter','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x9594,0x17b));var _0x4959=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x9594[_0x433a86];return _0x23000c;};'use strict';var emlformat=require(_0x4959('0x0'));var rimraf=require(_0x4959('0x1'));var zipdir=require(_0x4959('0x2'));var jsonpatch=require(_0x4959('0x3'));var rp=require(_0x4959('0x4'));var moment=require('moment');var BPromise=require(_0x4959('0x5'));var Mustache=require(_0x4959('0x6'));var util=require(_0x4959('0x7'));var path=require('path');var sox=require(_0x4959('0x8'));var csv=require(_0x4959('0x9'));var ejs=require(_0x4959('0xa'));var fs=require('fs');var fs_extra=require(_0x4959('0xb'));var _=require('lodash');var squel=require(_0x4959('0xc'));var crypto=require(_0x4959('0xd'));var jsforce=require(_0x4959('0xe'));var deskjs=require(_0x4959('0xf'));var toCsv=require(_0x4959('0x9'));var querystring=require(_0x4959('0x10'));var Papa=require(_0x4959('0x11'));var Redis=require(_0x4959('0x12'));var authService=require(_0x4959('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4959('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4959('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4959('0x16'));var licenseUtil=require(_0x4959('0x17'));var db=require(_0x4959('0x18'))['db'];var integrations=require(_0x4959('0x19'));function respondWithStatusCode(_0x4ae098,_0x8e9f81){_0x8e9f81=_0x8e9f81||0xcc;return function(_0x5097ae){if(_0x5097ae){return _0x4ae098[_0x4959('0x1a')](_0x8e9f81);}return _0x4ae098['status'](_0x8e9f81)[_0x4959('0x1b')]();};}function respondWithResult(_0x307455,_0x5534af){_0x5534af=_0x5534af||0xc8;return function(_0x3e320d){if(_0x3e320d){return _0x307455['status'](_0x5534af)[_0x4959('0x1c')](_0x3e320d);}};}function respondWithFilteredResult(_0x4a9990,_0x214a14){return function(_0x3ea32c){if(_0x3ea32c){var _0x599c4e=typeof _0x214a14[_0x4959('0x1d')]==='undefined'&&typeof _0x214a14[_0x4959('0x1e')]==='undefined';var _0x3f0d9e=_0x3ea32c[_0x4959('0x1f')];var _0x41531f=_0x599c4e?0x0:_0x214a14[_0x4959('0x1d')];var _0x488432=_0x599c4e?_0x3ea32c[_0x4959('0x1f')]:_0x214a14[_0x4959('0x1d')]+_0x214a14[_0x4959('0x1e')];var _0x2d9fa2;if(_0x488432>=_0x3f0d9e){_0x488432=_0x3f0d9e;_0x2d9fa2=0xc8;}else{_0x2d9fa2=0xce;}_0x4a9990[_0x4959('0x20')](_0x2d9fa2);return _0x4a9990['set'](_0x4959('0x21'),_0x41531f+'-'+_0x488432+'/'+_0x3f0d9e)[_0x4959('0x1c')](_0x3ea32c);}return null;};}function patchUpdates(_0x3e2ca0){return function(_0x41c50b){try{jsonpatch[_0x4959('0x22')](_0x41c50b,_0x3e2ca0,!![]);}catch(_0x2c6c0b){return BPromise[_0x4959('0x23')](_0x2c6c0b);}return _0x41c50b['save']();};}function saveUpdates(_0x1151a2,_0x54e65a){return function(_0x54b053){if(_0x54b053){return _0x54b053[_0x4959('0x24')](_0x1151a2)[_0x4959('0x25')](function(_0x4bd0ea){return _0x4bd0ea;});}return null;};}function removeEntity(_0x3931a9,_0x1f776f){return function(_0x29df0d){if(_0x29df0d){return _0x29df0d['destroy']()[_0x4959('0x25')](function(){_0x3931a9['status'](0xcc)[_0x4959('0x1b')]();});}};}function handleEntityNotFound(_0x4d2eb3,_0x3799df){return function(_0x5f3122){if(!_0x5f3122){_0x4d2eb3[_0x4959('0x1a')](0x194);}return _0x5f3122;};}function handleError(_0x34a1b7,_0xae0b25){_0xae0b25=_0xae0b25||0x1f4;return function(_0x3bfda6){logger[_0x4959('0x26')](_0x3bfda6['stack']);if(_0x3bfda6[_0x4959('0x27')]){delete _0x3bfda6['name'];}_0x34a1b7[_0x4959('0x20')](_0xae0b25)[_0x4959('0x28')](_0x3bfda6);};}exports[_0x4959('0x29')]=function(_0xaab039,_0x191073){var _0x51b9e5={},_0x3b508a={},_0x29e0db={'count':0x0,'rows':[]};var _0x6e572d=_['map'](db[_0x4959('0x2a')][_0x4959('0x2b')],function(_0x40dbdd){return{'name':_0x40dbdd[_0x4959('0x2c')],'type':_0x40dbdd[_0x4959('0x2d')]['key']};});_0x3b508a[_0x4959('0x2e')]=_[_0x4959('0x2f')](_0x6e572d,_0x4959('0x27'));_0x3b508a[_0x4959('0x30')]=_[_0x4959('0x31')](_0xaab039[_0x4959('0x30')]);_0x3b508a[_0x4959('0x32')]=_[_0x4959('0x33')](_0x3b508a[_0x4959('0x2e')],_0x3b508a['query']);_0x51b9e5[_0x4959('0x34')]=_[_0x4959('0x33')](_0x3b508a['model'],qs[_0x4959('0x35')](_0xaab039['query'][_0x4959('0x35')]));_0x51b9e5[_0x4959('0x34')]=_0x51b9e5[_0x4959('0x34')]['length']?_0x51b9e5[_0x4959('0x34')]:_0x3b508a[_0x4959('0x2e')];if(!_0xaab039[_0x4959('0x30')][_0x4959('0x36')](_0x4959('0x37'))){_0x51b9e5[_0x4959('0x1e')]=qs[_0x4959('0x1e')](_0xaab039[_0x4959('0x30')]['limit']);_0x51b9e5[_0x4959('0x1d')]=qs[_0x4959('0x1d')](_0xaab039[_0x4959('0x30')]['offset']);}_0x51b9e5[_0x4959('0x38')]=qs[_0x4959('0x39')](_0xaab039[_0x4959('0x30')]['sort']);_0x51b9e5[_0x4959('0x3a')]=qs['filters'](_[_0x4959('0x3b')](_0xaab039[_0x4959('0x30')],_0x3b508a[_0x4959('0x32')]),_0x6e572d);if(_0xaab039[_0x4959('0x30')]['filter']){_0x51b9e5[_0x4959('0x3a')]=_[_0x4959('0x3c')](_0x51b9e5[_0x4959('0x3a')],{'$or':_[_0x4959('0x2f')](_0x6e572d,function(_0x3c29b4){if(_0x3c29b4[_0x4959('0x2d')]!==_0x4959('0x3d')){var _0x5d1148={};_0x5d1148[_0x3c29b4['name']]={'$like':'%'+_0xaab039[_0x4959('0x30')]['filter']+'%'};return _0x5d1148;}})});}_0x51b9e5=_[_0x4959('0x3c')]({},_0x51b9e5,_0xaab039['options']);var _0x312e09={'where':_0x51b9e5[_0x4959('0x3a')]};return db[_0x4959('0x2a')][_0x4959('0x1f')](_0x312e09)[_0x4959('0x25')](function(_0x562757){_0x29e0db[_0x4959('0x1f')]=_0x562757;if(_0xaab039[_0x4959('0x30')][_0x4959('0x3e')]){_0x51b9e5[_0x4959('0x3f')]=[{'all':!![]}];}return db[_0x4959('0x2a')]['findAll'](_0x51b9e5);})[_0x4959('0x25')](function(_0x68f72c){_0x29e0db[_0x4959('0x40')]=_0x68f72c;return _0x29e0db;})[_0x4959('0x25')](respondWithFilteredResult(_0x191073,_0x51b9e5))['catch'](handleError(_0x191073,null));};exports[_0x4959('0x41')]=function(_0x5ea064,_0x4dd272){var _0x3e4f96={'raw':![],'where':{'id':_0x5ea064['params']['id']}},_0x32f9c7={};_0x32f9c7[_0x4959('0x2e')]=_['keys'](db[_0x4959('0x2a')][_0x4959('0x2b')]);_0x32f9c7['query']=_[_0x4959('0x31')](_0x5ea064[_0x4959('0x30')]);_0x32f9c7[_0x4959('0x32')]=_[_0x4959('0x33')](_0x32f9c7['model'],_0x32f9c7['query']);_0x3e4f96[_0x4959('0x34')]=_['intersection'](_0x32f9c7[_0x4959('0x2e')],qs[_0x4959('0x35')](_0x5ea064[_0x4959('0x30')][_0x4959('0x35')]));_0x3e4f96['attributes']=_0x3e4f96[_0x4959('0x34')][_0x4959('0x42')]?_0x3e4f96[_0x4959('0x34')]:_0x32f9c7[_0x4959('0x2e')];if(_0x5ea064['query'][_0x4959('0x3e')]){_0x3e4f96[_0x4959('0x3f')]=[{'all':!![]}];}_0x3e4f96=_[_0x4959('0x3c')]({},_0x3e4f96,_0x5ea064[_0x4959('0x43')]);return db[_0x4959('0x2a')][_0x4959('0x44')](_0x3e4f96)[_0x4959('0x25')](handleEntityNotFound(_0x4dd272,null))[_0x4959('0x25')](respondWithResult(_0x4dd272,null))[_0x4959('0x45')](handleError(_0x4dd272,null));};exports['create']=function(_0x51e179,_0x243aba){return db[_0x4959('0x2a')][_0x4959('0x46')](_0x51e179[_0x4959('0x47')],{})[_0x4959('0x25')](respondWithResult(_0x243aba,0xc9))['catch'](handleError(_0x243aba,null));};exports[_0x4959('0x24')]=function(_0x6d51d2,_0x59ca30){if(_0x6d51d2[_0x4959('0x47')]['id']){delete _0x6d51d2['body']['id'];}return db[_0x4959('0x2a')][_0x4959('0x44')]({'where':{'id':_0x6d51d2['params']['id']}})[_0x4959('0x25')](handleEntityNotFound(_0x59ca30,null))[_0x4959('0x25')](saveUpdates(_0x6d51d2[_0x4959('0x47')],null))[_0x4959('0x25')](respondWithResult(_0x59ca30,null))['catch'](handleError(_0x59ca30,null));};exports[_0x4959('0x48')]=function(_0x5b51b6,_0x2e15fb){return db[_0x4959('0x2a')][_0x4959('0x44')]({'where':{'id':_0x5b51b6['params']['id']}})[_0x4959('0x25')](handleEntityNotFound(_0x2e15fb,null))[_0x4959('0x25')](removeEntity(_0x2e15fb,null))[_0x4959('0x45')](handleError(_0x2e15fb,null));};exports[_0x4959('0x49')]=function(_0x3d6531,_0x582f01,_0x502eab){var _0xa0e14c={};var _0x201d00={};var _0x1e5afe;var _0x58e23e;return db['ZohoAccount'][_0x4959('0x4a')]({'where':{'id':_0x3d6531[_0x4959('0x4b')]['id']}})[_0x4959('0x25')](handleEntityNotFound(_0x582f01,null))[_0x4959('0x25')](function(_0x796668){if(_0x796668){_0x1e5afe=_0x796668;_0x201d00['model']=_[_0x4959('0x31')](db[_0x4959('0x4c')][_0x4959('0x2b')]);_0x201d00['query']=_[_0x4959('0x31')](_0x3d6531[_0x4959('0x30')]);_0x201d00[_0x4959('0x32')]=_['intersection'](_0x201d00[_0x4959('0x2e')],_0x201d00[_0x4959('0x30')]);_0xa0e14c['attributes']=_[_0x4959('0x33')](_0x201d00[_0x4959('0x2e')],qs[_0x4959('0x35')](_0x3d6531['query'][_0x4959('0x35')]));_0xa0e14c[_0x4959('0x34')]=_0xa0e14c[_0x4959('0x34')][_0x4959('0x42')]?_0xa0e14c[_0x4959('0x34')]:_0x201d00[_0x4959('0x2e')];_0xa0e14c[_0x4959('0x38')]=qs['sort'](_0x3d6531[_0x4959('0x30')][_0x4959('0x39')]);_0xa0e14c['where']=qs[_0x4959('0x32')](_[_0x4959('0x3b')](_0x3d6531[_0x4959('0x30')],_0x201d00[_0x4959('0x32')]));if(_0x3d6531[_0x4959('0x30')][_0x4959('0x4d')]){_0xa0e14c[_0x4959('0x3a')]=_[_0x4959('0x3c')](_0xa0e14c[_0x4959('0x3a')],{'$or':_['map'](_0xa0e14c[_0x4959('0x34')],function(_0x222246){var _0x48c8bc={};_0x48c8bc[_0x222246]={'$like':'%'+_0x3d6531[_0x4959('0x30')][_0x4959('0x4d')]+'%'};return _0x48c8bc;})});}_0xa0e14c=_['merge']({},_0xa0e14c,_0x3d6531['options']);return _0x1e5afe[_0x4959('0x49')](_0xa0e14c);}})[_0x4959('0x25')](function(_0x8b0446){if(_0x8b0446){_0x58e23e=_0x8b0446[_0x4959('0x42')];if(!_0x3d6531['query']['hasOwnProperty'](_0x4959('0x37'))){_0xa0e14c['limit']=qs[_0x4959('0x1e')](_0x3d6531[_0x4959('0x30')][_0x4959('0x1e')]);_0xa0e14c['offset']=qs['offset'](_0x3d6531[_0x4959('0x30')][_0x4959('0x1d')]);}return _0x1e5afe[_0x4959('0x49')](_0xa0e14c);}})[_0x4959('0x25')](function(_0x3eb7a4){if(_0x3eb7a4){return _0x3eb7a4?{'count':_0x58e23e,'rows':_0x3eb7a4}:null;}})[_0x4959('0x25')](respondWithResult(_0x582f01,null))['catch'](handleError(_0x582f01,null));};exports[_0x4959('0x4e')]=function(_0x3b0318,_0x5d071a,_0x249040){if(_0x3b0318[_0x4959('0x47')]['id']){delete _0x3b0318[_0x4959('0x47')]['id'];}return db['ZohoAccount'][_0x4959('0x4a')]({'where':{'id':_0x3b0318[_0x4959('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5d071a,null))[_0x4959('0x25')](function(_0x1fab96){if(_0x1fab96){_0x3b0318['body']['AccountId']=_0x1fab96['id'];_0x3b0318[_0x4959('0x47')][_0x4959('0x4f')]=integrations[_0x4959('0x50')](_0x3b0318['body'][_0x4959('0x51')],_0x3b0318[_0x4959('0x47')][_0x4959('0x2d')]);_0x3b0318[_0x4959('0x47')][_0x4959('0x52')]=integrations[_0x4959('0x53')](_0x3b0318[_0x4959('0x47')]['channel'],_0x3b0318[_0x4959('0x47')][_0x4959('0x2d')]);return db[_0x4959('0x4c')][_0x4959('0x46')](_0x3b0318['body'],{'include':[{'model':db[_0x4959('0x54')],'as':_0x4959('0x4f')},{'model':db[_0x4959('0x54')],'as':_0x4959('0x52')}]});}return null;})[_0x4959('0x25')](respondWithResult(_0x5d071a,null))[_0x4959('0x45')](handleError(_0x5d071a,null));};function getAccessToken(_0x12e222){return new Promise(function(_0x278c44,_0xbea6dd){var _0x3c4c2a;switch(_0x12e222[_0x4959('0x55')]){case'US':_0x3c4c2a=_0x4959('0x56');break;case'AU':_0x3c4c2a='https://accounts.zoho.com.au';break;case'EU':_0x3c4c2a=_0x4959('0x57');break;case'IN':_0x3c4c2a=_0x4959('0x58');break;case'CN':_0x3c4c2a='https://accounts.zoho.com.cn';break;default:_0x3c4c2a=_0x4959('0x57');break;}var _0x2754eb={'method':'POST','uri':_0x3c4c2a+_0x4959('0x59'),'qs':{'refresh_token':_0x12e222[_0x4959('0x5a')],'client_id':_0x12e222[_0x4959('0x5b')],'client_secret':_0x12e222[_0x4959('0x5c')],'grant_type':_0x4959('0x5d')},'json':!![]};return rp(_0x2754eb)[_0x4959('0x25')](function(_0x2f4aa4){if(_0x2f4aa4[_0x4959('0x5e')]){_0x278c44(_0x2f4aa4[_0x4959('0x5e')]);}else{_0xbea6dd(_0x4959('0x5f'));}})['catch'](function(_0x4673ed){_0xbea6dd(_0x4673ed);});});}exports[_0x4959('0x60')]=function(_0x4d2c6e,_0x36703d,_0x5f3a1a){var _0x2ab4d6,_0x56a620,_0x1e3432,_0x275e51,_0x3c5b4d;return db[_0x4959('0x2a')][_0x4959('0x4a')]({'where':{'id':_0x4d2c6e[_0x4959('0x4b')]['id']},'attributes':['id',_0x4959('0x61'),'zone',_0x4959('0x5b'),'clientSecret',_0x4959('0x62'),'code',_0x4959('0x5a')]})[_0x4959('0x25')](handleEntityNotFound(_0x36703d,null))[_0x4959('0x25')](function(_0x4b6fff){_0x3c5b4d=_0x4b6fff;_0x2ab4d6=_0x3c5b4d[_0x4959('0x61')];_0x56a620=_0x2ab4d6===_0x4959('0x63')?'eu':_0x4959('0x64');_0x1e3432=_0x3c5b4d[_0x4959('0x62')];var _0x4e7f2f=_0x1e3432[_0x4959('0x65')](-0x1);if(_0x4e7f2f==='/'||_0x4e7f2f==='\x5c'||_0x4e7f2f===':'){_0x1e3432=_0x1e3432[_0x4959('0x66')](0x0,_0x1e3432[_0x4959('0x67')](_0x4e7f2f));}if(!_0x3c5b4d[_0x4959('0x5a')]){throw new Error(_0x4959('0x68'));}return getAccessToken(_0x3c5b4d);})['then'](function(_0x16c7ea){if(_0x16c7ea){return rp({'method':_0x4959('0x69'),'uri':util[_0x4959('0x6a')](_0x4959('0x6b'),_0x56a620),'qs':{'module':_0x4959('0x6c')},'headers':{'Authorization':_0x4959('0x6d')+_0x16c7ea},'json':!![]});}})[_0x4959('0x25')](function(_0x4e1520){if(_0x4e1520){if(_0x4e1520[_0x4959('0x6e')]&&_0x4e1520[_0x4959('0x6e')][_0x4959('0x26')]){throw new Error(_0x4e1520[_0x4959('0x6e')][_0x4959('0x26')][_0x4959('0x6f')]);}var _0x213057=[];var _0xe7b4e7=[];var _0x465bf5=[_0x4959('0x70'),_0x4959('0x71'),_0x4959('0x72'),'WhoId',_0x4959('0x73'),_0x4959('0x74'),_0x4959('0x75'),_0x4959('0x76')];_0xe7b4e7=_[_0x4959('0x77')](_0x4e1520[_0x4959('0x35')],function(_0x42ae56){return _0x465bf5[_0x4959('0x78')](_0x42ae56[_0x4959('0x79')]);});for(var _0x1cbf4a=0x0;_0x1cbf4a<_0xe7b4e7['length'];_0x1cbf4a++){if(_0xe7b4e7[_0x1cbf4a][_0x4959('0x7a')]===![]){_0x213057[_0x4959('0x7b')]({'id':_0xe7b4e7[_0x1cbf4a]['id'],'name':_0xe7b4e7[_0x1cbf4a][_0x4959('0x7c')],'custom':_0xe7b4e7[_0x1cbf4a][_0x4959('0x7d')],'options':_0xe7b4e7[_0x1cbf4a][_0x4959('0x7e')]===_0x4959('0x7f')&&_0xe7b4e7[_0x1cbf4a][_0x4959('0x80')][_0x4959('0x42')]>-0x1?_[_0x4959('0x2f')](_0xe7b4e7[_0x1cbf4a]['pick_list_values'],function(_0xa7469a){return{'name':_0xa7469a,'value':_0xa7469a};}):[]});}}return{'count':_0x213057[_0x4959('0x42')],'rows':_0x213057};}else{return{'count':0x0,'rows':[]};}})[_0x4959('0x25')](respondWithResult(_0x36703d,null))[_0x4959('0x45')](function(_0x28a7cc){var _0x1cbca8=_0x4d2c6e[_0x4959('0x30')]['test']?0x1f4:_0x28a7cc[_0x4959('0x81')]||0x1f4;logger[_0x4959('0x26')](_0x4959('0x82'),_0x4959('0x60'),_0x1cbca8,JSON['stringify'](_0x28a7cc));delete _0x28a7cc[_0x4959('0x27')];if(_0x1cbca8===0x191){_0x1cbca8=0x190;}_0x36703d['status'](_0x1cbca8)[_0x4959('0x28')](_0x4d2c6e[_0x4959('0x30')]['test']?{'message':_0x4959('0x83'),'statusCode':_0x28a7cc[_0x4959('0x81')]}:_0x28a7cc);});}; \ No newline at end of file +var _0xa492=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','index','map','fieldName','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','ZohoAccount','includeAll','include','findAll','rows','catch','find','create','body','params','destroy','getConfigurations','rawAttributes','filters','filter','options','findOne','Subjects','getSubjects','channel','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','host','serverUrl','code','zoho.eu','slice','substring','lastIndexOf','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','display_label','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x51042b,_0x12cca8){var _0x450779=function(_0x394dbc){while(--_0x394dbc){_0x51042b['push'](_0x51042b['shift']());}};_0x450779(++_0x12cca8);}(_0xa492,0x167));var _0x2a49=function(_0x3d5278,_0x55d0cc){_0x3d5278=_0x3d5278-0x0;var _0x4d2c90=_0xa492[_0x3d5278];return _0x4d2c90;};'use strict';var emlformat=require(_0x2a49('0x0'));var rimraf=require(_0x2a49('0x1'));var zipdir=require(_0x2a49('0x2'));var jsonpatch=require(_0x2a49('0x3'));var rp=require(_0x2a49('0x4'));var moment=require(_0x2a49('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2a49('0x6'));var util=require(_0x2a49('0x7'));var path=require(_0x2a49('0x8'));var sox=require(_0x2a49('0x9'));var csv=require(_0x2a49('0xa'));var ejs=require(_0x2a49('0xb'));var fs=require('fs');var fs_extra=require(_0x2a49('0xc'));var _=require('lodash');var squel=require(_0x2a49('0xd'));var crypto=require(_0x2a49('0xe'));var jsforce=require(_0x2a49('0xf'));var deskjs=require(_0x2a49('0x10'));var toCsv=require(_0x2a49('0xa'));var querystring=require(_0x2a49('0x11'));var Papa=require('papaparse');var Redis=require(_0x2a49('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2a49('0x13'));var as=require(_0x2a49('0x14'));var hardwareService=require(_0x2a49('0x15'));var logger=require('../../config/logger')(_0x2a49('0x16'));var utils=require(_0x2a49('0x17'));var config=require(_0x2a49('0x18'));var licenseUtil=require(_0x2a49('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2a49('0x1a'));function respondWithStatusCode(_0x4f58ab,_0x33175c){_0x33175c=_0x33175c||0xcc;return function(_0x2cb65c){if(_0x2cb65c){return _0x4f58ab[_0x2a49('0x1b')](_0x33175c);}return _0x4f58ab[_0x2a49('0x1c')](_0x33175c)[_0x2a49('0x1d')]();};}function respondWithResult(_0x20887b,_0x57b8df){_0x57b8df=_0x57b8df||0xc8;return function(_0x40c913){if(_0x40c913){return _0x20887b[_0x2a49('0x1c')](_0x57b8df)[_0x2a49('0x1e')](_0x40c913);}};}function respondWithFilteredResult(_0x3eff7c,_0x4627ca){return function(_0x33c073){if(_0x33c073){var _0x42d7f3=typeof _0x4627ca[_0x2a49('0x1f')]===_0x2a49('0x20')&&typeof _0x4627ca[_0x2a49('0x21')]==='undefined';var _0x51d487=_0x33c073[_0x2a49('0x22')];var _0x2310c0=_0x42d7f3?0x0:_0x4627ca['offset'];var _0x58ecbd=_0x42d7f3?_0x33c073['count']:_0x4627ca[_0x2a49('0x1f')]+_0x4627ca[_0x2a49('0x21')];var _0x370e79;if(_0x58ecbd>=_0x51d487){_0x58ecbd=_0x51d487;_0x370e79=0xc8;}else{_0x370e79=0xce;}_0x3eff7c[_0x2a49('0x1c')](_0x370e79);return _0x3eff7c[_0x2a49('0x23')](_0x2a49('0x24'),_0x2310c0+'-'+_0x58ecbd+'/'+_0x51d487)[_0x2a49('0x1e')](_0x33c073);}return null;};}function patchUpdates(_0x4bf378){return function(_0x8ff115){try{jsonpatch['apply'](_0x8ff115,_0x4bf378,!![]);}catch(_0x357aae){return BPromise['reject'](_0x357aae);}return _0x8ff115[_0x2a49('0x25')]();};}function saveUpdates(_0x4ce7c3,_0x142267){return function(_0x2c0a37){if(_0x2c0a37){return _0x2c0a37[_0x2a49('0x26')](_0x4ce7c3)['then'](function(_0x4c1d7e){return _0x4c1d7e;});}return null;};}function removeEntity(_0x5bb410,_0x222e99){return function(_0x4b7d3c){if(_0x4b7d3c){return _0x4b7d3c['destroy']()[_0x2a49('0x27')](function(){_0x5bb410[_0x2a49('0x1c')](0xcc)[_0x2a49('0x1d')]();});}};}function handleEntityNotFound(_0x55c1ea,_0x3fde3e){return function(_0x509656){if(!_0x509656){_0x55c1ea[_0x2a49('0x1b')](0x194);}return _0x509656;};}function handleError(_0x5d4564,_0x54874a){_0x54874a=_0x54874a||0x1f4;return function(_0x346751){logger[_0x2a49('0x28')](_0x346751[_0x2a49('0x29')]);if(_0x346751['name']){delete _0x346751[_0x2a49('0x2a')];}_0x5d4564['status'](_0x54874a)['send'](_0x346751);};}exports[_0x2a49('0x2b')]=function(_0x25b653,_0x56c35c){var _0x2f92ae={},_0x4529b3={},_0x48fffc={'count':0x0,'rows':[]};var _0x4284ed=_[_0x2a49('0x2c')](db['ZohoAccount']['rawAttributes'],function(_0x58aa17){return{'name':_0x58aa17[_0x2a49('0x2d')],'type':_0x58aa17[_0x2a49('0x2e')]['key']};});_0x4529b3['model']=_['map'](_0x4284ed,'name');_0x4529b3[_0x2a49('0x2f')]=_[_0x2a49('0x30')](_0x25b653[_0x2a49('0x2f')]);_0x4529b3['filters']=_[_0x2a49('0x31')](_0x4529b3[_0x2a49('0x32')],_0x4529b3['query']);_0x2f92ae['attributes']=_[_0x2a49('0x31')](_0x4529b3[_0x2a49('0x32')],qs[_0x2a49('0x33')](_0x25b653[_0x2a49('0x2f')][_0x2a49('0x33')]));_0x2f92ae[_0x2a49('0x34')]=_0x2f92ae['attributes'][_0x2a49('0x35')]?_0x2f92ae['attributes']:_0x4529b3[_0x2a49('0x32')];if(!_0x25b653['query'][_0x2a49('0x36')](_0x2a49('0x37'))){_0x2f92ae[_0x2a49('0x21')]=qs['limit'](_0x25b653[_0x2a49('0x2f')][_0x2a49('0x21')]);_0x2f92ae[_0x2a49('0x1f')]=qs[_0x2a49('0x1f')](_0x25b653[_0x2a49('0x2f')][_0x2a49('0x1f')]);}_0x2f92ae[_0x2a49('0x38')]=qs[_0x2a49('0x39')](_0x25b653[_0x2a49('0x2f')]['sort']);_0x2f92ae[_0x2a49('0x3a')]=qs['filters'](_[_0x2a49('0x3b')](_0x25b653[_0x2a49('0x2f')],_0x4529b3['filters']),_0x4284ed);if(_0x25b653[_0x2a49('0x2f')]['filter']){_0x2f92ae[_0x2a49('0x3a')]=_[_0x2a49('0x3c')](_0x2f92ae['where'],{'$or':_['map'](_0x4284ed,function(_0x521373){if(_0x521373[_0x2a49('0x2e')]!==_0x2a49('0x3d')){var _0x4752d2={};_0x4752d2[_0x521373[_0x2a49('0x2a')]]={'$like':'%'+_0x25b653[_0x2a49('0x2f')]['filter']+'%'};return _0x4752d2;}})});}_0x2f92ae=_[_0x2a49('0x3c')]({},_0x2f92ae,_0x25b653['options']);var _0x10787c={'where':_0x2f92ae[_0x2a49('0x3a')]};return db[_0x2a49('0x3e')][_0x2a49('0x22')](_0x10787c)[_0x2a49('0x27')](function(_0x2c4843){_0x48fffc['count']=_0x2c4843;if(_0x25b653[_0x2a49('0x2f')][_0x2a49('0x3f')]){_0x2f92ae[_0x2a49('0x40')]=[{'all':!![]}];}return db[_0x2a49('0x3e')][_0x2a49('0x41')](_0x2f92ae);})[_0x2a49('0x27')](function(_0x14546a){_0x48fffc[_0x2a49('0x42')]=_0x14546a;return _0x48fffc;})[_0x2a49('0x27')](respondWithFilteredResult(_0x56c35c,_0x2f92ae))[_0x2a49('0x43')](handleError(_0x56c35c,null));};exports['show']=function(_0xa8564d,_0x54de4d){var _0x57686f={'raw':![],'where':{'id':_0xa8564d['params']['id']}},_0x57da3e={};_0x57da3e[_0x2a49('0x32')]=_[_0x2a49('0x30')](db[_0x2a49('0x3e')]['rawAttributes']);_0x57da3e['query']=_[_0x2a49('0x30')](_0xa8564d[_0x2a49('0x2f')]);_0x57da3e['filters']=_[_0x2a49('0x31')](_0x57da3e['model'],_0x57da3e[_0x2a49('0x2f')]);_0x57686f['attributes']=_[_0x2a49('0x31')](_0x57da3e[_0x2a49('0x32')],qs[_0x2a49('0x33')](_0xa8564d[_0x2a49('0x2f')]['fields']));_0x57686f[_0x2a49('0x34')]=_0x57686f['attributes']['length']?_0x57686f['attributes']:_0x57da3e[_0x2a49('0x32')];if(_0xa8564d['query'][_0x2a49('0x3f')]){_0x57686f['include']=[{'all':!![]}];}_0x57686f=_[_0x2a49('0x3c')]({},_0x57686f,_0xa8564d['options']);return db[_0x2a49('0x3e')][_0x2a49('0x44')](_0x57686f)[_0x2a49('0x27')](handleEntityNotFound(_0x54de4d,null))[_0x2a49('0x27')](respondWithResult(_0x54de4d,null))[_0x2a49('0x43')](handleError(_0x54de4d,null));};exports[_0x2a49('0x45')]=function(_0x2dec09,_0x1b4b4f){return db[_0x2a49('0x3e')]['create'](_0x2dec09[_0x2a49('0x46')],{})[_0x2a49('0x27')](respondWithResult(_0x1b4b4f,0xc9))['catch'](handleError(_0x1b4b4f,null));};exports['update']=function(_0x4570b8,_0x2a1f8a){if(_0x4570b8[_0x2a49('0x46')]['id']){delete _0x4570b8[_0x2a49('0x46')]['id'];}return db[_0x2a49('0x3e')][_0x2a49('0x44')]({'where':{'id':_0x4570b8[_0x2a49('0x47')]['id']}})[_0x2a49('0x27')](handleEntityNotFound(_0x2a1f8a,null))[_0x2a49('0x27')](saveUpdates(_0x4570b8[_0x2a49('0x46')],null))['then'](respondWithResult(_0x2a1f8a,null))[_0x2a49('0x43')](handleError(_0x2a1f8a,null));};exports[_0x2a49('0x48')]=function(_0x1ea0c6,_0x482eca){return db['ZohoAccount'][_0x2a49('0x44')]({'where':{'id':_0x1ea0c6[_0x2a49('0x47')]['id']}})[_0x2a49('0x27')](handleEntityNotFound(_0x482eca,null))[_0x2a49('0x27')](removeEntity(_0x482eca,null))[_0x2a49('0x43')](handleError(_0x482eca,null));};exports[_0x2a49('0x49')]=function(_0x4fc889,_0x3dac7a,_0x130e52){var _0x1c0cf3={};var _0x1ac822={};var _0x5ea59f;var _0x368d0a;return db[_0x2a49('0x3e')]['findOne']({'where':{'id':_0x4fc889['params']['id']}})[_0x2a49('0x27')](handleEntityNotFound(_0x3dac7a,null))['then'](function(_0x7489a8){if(_0x7489a8){_0x5ea59f=_0x7489a8;_0x1ac822['model']=_[_0x2a49('0x30')](db['ZohoConfiguration'][_0x2a49('0x4a')]);_0x1ac822[_0x2a49('0x2f')]=_['keys'](_0x4fc889[_0x2a49('0x2f')]);_0x1ac822['filters']=_[_0x2a49('0x31')](_0x1ac822['model'],_0x1ac822[_0x2a49('0x2f')]);_0x1c0cf3['attributes']=_[_0x2a49('0x31')](_0x1ac822[_0x2a49('0x32')],qs[_0x2a49('0x33')](_0x4fc889[_0x2a49('0x2f')][_0x2a49('0x33')]));_0x1c0cf3[_0x2a49('0x34')]=_0x1c0cf3[_0x2a49('0x34')][_0x2a49('0x35')]?_0x1c0cf3[_0x2a49('0x34')]:_0x1ac822[_0x2a49('0x32')];_0x1c0cf3['order']=qs[_0x2a49('0x39')](_0x4fc889['query'][_0x2a49('0x39')]);_0x1c0cf3[_0x2a49('0x3a')]=qs[_0x2a49('0x4b')](_['pick'](_0x4fc889[_0x2a49('0x2f')],_0x1ac822[_0x2a49('0x4b')]));if(_0x4fc889['query'][_0x2a49('0x4c')]){_0x1c0cf3['where']=_['merge'](_0x1c0cf3[_0x2a49('0x3a')],{'$or':_[_0x2a49('0x2c')](_0x1c0cf3[_0x2a49('0x34')],function(_0x58e16e){var _0xb5ed48={};_0xb5ed48[_0x58e16e]={'$like':'%'+_0x4fc889['query']['filter']+'%'};return _0xb5ed48;})});}_0x1c0cf3=_[_0x2a49('0x3c')]({},_0x1c0cf3,_0x4fc889[_0x2a49('0x4d')]);return _0x5ea59f['getConfigurations'](_0x1c0cf3);}})['then'](function(_0xb478bf){if(_0xb478bf){_0x368d0a=_0xb478bf[_0x2a49('0x35')];if(!_0x4fc889[_0x2a49('0x2f')]['hasOwnProperty']('nolimit')){_0x1c0cf3['limit']=qs[_0x2a49('0x21')](_0x4fc889['query'][_0x2a49('0x21')]);_0x1c0cf3[_0x2a49('0x1f')]=qs['offset'](_0x4fc889[_0x2a49('0x2f')][_0x2a49('0x1f')]);}return _0x5ea59f[_0x2a49('0x49')](_0x1c0cf3);}})['then'](function(_0x4881e8){if(_0x4881e8){return _0x4881e8?{'count':_0x368d0a,'rows':_0x4881e8}:null;}})[_0x2a49('0x27')](respondWithResult(_0x3dac7a,null))[_0x2a49('0x43')](handleError(_0x3dac7a,null));};exports['addConfiguration']=function(_0x2f3e76,_0x19a5a9,_0x415fa7){if(_0x2f3e76['body']['id']){delete _0x2f3e76[_0x2a49('0x46')]['id'];}return db[_0x2a49('0x3e')][_0x2a49('0x4e')]({'where':{'id':_0x2f3e76[_0x2a49('0x47')]['id']}})[_0x2a49('0x27')](handleEntityNotFound(_0x19a5a9,null))['then'](function(_0x140e16){if(_0x140e16){_0x2f3e76[_0x2a49('0x46')]['AccountId']=_0x140e16['id'];_0x2f3e76[_0x2a49('0x46')][_0x2a49('0x4f')]=integrations[_0x2a49('0x50')](_0x2f3e76['body'][_0x2a49('0x51')],_0x2f3e76[_0x2a49('0x46')][_0x2a49('0x2e')]);_0x2f3e76[_0x2a49('0x46')][_0x2a49('0x52')]=integrations['getDescriptions'](_0x2f3e76['body']['channel'],_0x2f3e76[_0x2a49('0x46')][_0x2a49('0x2e')]);return db['ZohoConfiguration'][_0x2a49('0x45')](_0x2f3e76[_0x2a49('0x46')],{'include':[{'model':db['ZohoField'],'as':_0x2a49('0x4f')},{'model':db['ZohoField'],'as':_0x2a49('0x52')}]});}return null;})[_0x2a49('0x27')](respondWithResult(_0x19a5a9,null))[_0x2a49('0x43')](handleError(_0x19a5a9,null));};function getAccessToken(_0xd43d0f){return new Promise(function(_0x5ddef0,_0x106c3a){var _0x10bb01;switch(_0xd43d0f[_0x2a49('0x53')]){case'US':_0x10bb01=_0x2a49('0x54');break;case'AU':_0x10bb01=_0x2a49('0x55');break;case'EU':_0x10bb01=_0x2a49('0x56');break;case'IN':_0x10bb01=_0x2a49('0x57');break;case'CN':_0x10bb01='https://accounts.zoho.com.cn';break;default:_0x10bb01='https://accounts.zoho.eu';break;}var _0xaea9d7={'method':'POST','uri':_0x10bb01+_0x2a49('0x58'),'qs':{'refresh_token':_0xd43d0f[_0x2a49('0x59')],'client_id':_0xd43d0f[_0x2a49('0x5a')],'client_secret':_0xd43d0f['clientSecret'],'grant_type':_0x2a49('0x5b')},'json':!![]};return rp(_0xaea9d7)[_0x2a49('0x27')](function(_0x1dfad5){if(_0x1dfad5['access_token']){_0x5ddef0(_0x1dfad5[_0x2a49('0x5c')]);}else{_0x106c3a('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x2a49('0x43')](function(_0x5decac){_0x106c3a(_0x5decac);});});}exports['getFields']=function(_0x39a250,_0x17946d,_0x5731f6){var _0x52a721,_0x542418,_0x1f5768,_0x9d7528,_0x460228;return db[_0x2a49('0x3e')][_0x2a49('0x4e')]({'where':{'id':_0x39a250[_0x2a49('0x47')]['id']},'attributes':['id',_0x2a49('0x5d'),_0x2a49('0x53'),_0x2a49('0x5a'),'clientSecret',_0x2a49('0x5e'),_0x2a49('0x5f'),_0x2a49('0x59')]})[_0x2a49('0x27')](handleEntityNotFound(_0x17946d,null))[_0x2a49('0x27')](function(_0x4338f8){_0x460228=_0x4338f8;_0x52a721=_0x460228[_0x2a49('0x5d')];_0x542418=_0x52a721===_0x2a49('0x60')?'eu':'com';_0x1f5768=_0x460228['serverUrl'];var _0x193f1a=_0x1f5768[_0x2a49('0x61')](-0x1);if(_0x193f1a==='/'||_0x193f1a==='\x5c'||_0x193f1a===':'){_0x1f5768=_0x1f5768[_0x2a49('0x62')](0x0,_0x1f5768[_0x2a49('0x63')](_0x193f1a));}if(!_0x460228['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x460228);})['then'](function(_0x226df8){if(_0x226df8){return rp({'method':'GET','uri':util[_0x2a49('0x64')](_0x2a49('0x65'),_0x542418),'qs':{'module':_0x2a49('0x66')},'headers':{'Authorization':_0x2a49('0x67')+_0x226df8},'json':!![]});}})['then'](function(_0xa39bce){if(_0xa39bce){if(_0xa39bce[_0x2a49('0x68')]&&_0xa39bce['response'][_0x2a49('0x28')]){throw new Error(_0xa39bce[_0x2a49('0x68')]['error'][_0x2a49('0x69')]);}var _0x116675=[];var _0x5da664=[];var _0x4fc2e8=[_0x2a49('0x6a'),_0x2a49('0x6b'),_0x2a49('0x6c'),_0x2a49('0x6d'),_0x2a49('0x6e'),'Call_Result',_0x2a49('0x6f'),_0x2a49('0x70')];_0x5da664=_[_0x2a49('0x71')](_0xa39bce[_0x2a49('0x33')],function(_0x414f68){return _0x4fc2e8[_0x2a49('0x72')](_0x414f68['api_name']);});for(var _0x57b888=0x0;_0x57b888<_0x5da664[_0x2a49('0x35')];_0x57b888++){if(_0x5da664[_0x57b888]['system_mandatory']===![]){_0x116675['push']({'id':_0x5da664[_0x57b888]['id'],'name':_0x5da664[_0x57b888][_0x2a49('0x73')],'custom':_0x5da664[_0x57b888][_0x2a49('0x74')],'options':_0x5da664[_0x57b888][_0x2a49('0x75')]===_0x2a49('0x76')&&_0x5da664[_0x57b888][_0x2a49('0x77')][_0x2a49('0x35')]>-0x1?_['map'](_0x5da664[_0x57b888][_0x2a49('0x77')],function(_0x7fa1d7){return{'name':_0x7fa1d7,'value':_0x7fa1d7};}):[]});}}return{'count':_0x116675['length'],'rows':_0x116675};}else{return{'count':0x0,'rows':[]};}})[_0x2a49('0x27')](respondWithResult(_0x17946d,null))[_0x2a49('0x43')](function(_0x3c37db){var _0x1e836c=_0x39a250['query'][_0x2a49('0x78')]?0x1f4:_0x3c37db['statusCode']||0x1f4;logger[_0x2a49('0x28')](_0x2a49('0x79'),_0x2a49('0x7a'),_0x1e836c,JSON[_0x2a49('0x7b')](_0x3c37db));delete _0x3c37db[_0x2a49('0x2a')];if(_0x1e836c===0x191){_0x1e836c=0x190;}_0x17946d['status'](_0x1e836c)[_0x2a49('0x7c')](_0x39a250[_0x2a49('0x2f')][_0x2a49('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x3c37db[_0x2a49('0x7d')]}:_0x3c37db);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 8f396a0..0162ce6 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 _0x4d15=['substring','lastIndexOf','authorization_code','refresh_token','refreshToken','catch','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','zone','changed','clientId','clientSecret','host','serverUrl','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','application/x-www-form-urlencoded','then','parse','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','error','code','slice'];(function(_0x5f5c8c,_0x2e3b21){var _0x4c4772=function(_0x421b36){while(--_0x421b36){_0x5f5c8c['push'](_0x5f5c8c['shift']());}};_0x4c4772(++_0x2e3b21);}(_0x4d15,0x156));var _0x54d1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4d15[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x54d1('0x0'));var util=require(_0x54d1('0x1'));var logger=require(_0x54d1('0x2'))(_0x54d1('0x3'));var moment=require('moment');var BPromise=require(_0x54d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x54d1('0x5'));var rimraf=require('rimraf');var config=require(_0x54d1('0x6'));var attributes=require(_0x54d1('0x7'));var integrations=require(_0x54d1('0x8'));module['exports']=function(_0x5afc31,_0x241972){return _0x5afc31[_0x54d1('0x9')](_0x54d1('0xa'),attributes,{'tableName':_0x54d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x375a2b,_0x3c3e8f,_0x4bdb9a){if(_0x375a2b['changed'](_0x54d1('0xc'))||_0x375a2b[_0x54d1('0xd')]('serverUrl')||_0x375a2b['changed'](_0x54d1('0xe'))||_0x375a2b['changed'](_0x54d1('0xf'))||_0x375a2b['changed']('code')||_0x375a2b[_0x54d1('0xd')](_0x54d1('0x10'))){var _0x3f15f1,_0x1aa250;_0x3f15f1=_0x375a2b[_0x54d1('0x11')];var _0x3d4df1=_0x3f15f1['slice'](-0x1);if(_0x3d4df1==='/'||_0x3d4df1==='\x5c'||_0x3d4df1===':'){_0x3f15f1=_0x3f15f1['substring'](0x0,_0x3f15f1['lastIndexOf'](_0x3d4df1));}switch(_0x375a2b[_0x54d1('0xc')]){case'US':_0x1aa250=_0x54d1('0x12');break;case'AU':_0x1aa250=_0x54d1('0x13');break;case'IN':_0x1aa250=_0x54d1('0x14');break;case'CN':_0x1aa250=_0x54d1('0x15');break;default:_0x1aa250=_0x54d1('0x16');break;}var _0x5cd608={'method':_0x54d1('0x17'),'uri':_0x1aa250+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x375a2b[_0x54d1('0xe')],'client_secret':_0x375a2b[_0x54d1('0xf')],'redirect_uri':_0x375a2b[_0x54d1('0x11')],'code':_0x375a2b['code']},'headers':{'Content-Type':_0x54d1('0x18')}};return rp(_0x5cd608)[_0x54d1('0x19')](function(_0xfd0db2){var _0x5983ef=JSON[_0x54d1('0x1a')](_0xfd0db2);if(_0x5983ef['refresh_token']){_0x375a2b['refreshToken']=_0x5983ef['refresh_token'];logger[_0x54d1('0x1b')](util[_0x54d1('0x1c')](_0x54d1('0x1d'),_0x375a2b[_0x54d1('0x1e')],_0x375a2b['id']));}else{logger['error'](util[_0x54d1('0x1c')](_0x54d1('0x1f'),_0x375a2b['name'],_0x375a2b['id']),util[_0x54d1('0x20')](_0x5983ef,{'showHidden':![],'depth':null}));}return _0x4bdb9a(null,_0x3c3e8f);})['catch'](function(_0x5871ae){logger[_0x54d1('0x21')](util[_0x54d1('0x1c')](_0x54d1('0x1f'),_0x375a2b[_0x54d1('0x1e')],_0x375a2b['id']),util[_0x54d1('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x4bdb9a(_0x5871ae);});}else{return _0x4bdb9a(null,_0x3c3e8f);}},'beforeUpdate':function(_0x4348bf,_0x2925e4,_0x191b52){if(_0x4348bf[_0x54d1('0xd')](_0x54d1('0xc'))||_0x4348bf[_0x54d1('0xd')](_0x54d1('0x11'))||_0x4348bf[_0x54d1('0xd')](_0x54d1('0xe'))||_0x4348bf[_0x54d1('0xd')]('clientSecret')||_0x4348bf['changed'](_0x54d1('0x22'))||_0x4348bf[_0x54d1('0xd')](_0x54d1('0x10'))){var _0xf347f3,_0x2adce8;_0xf347f3=_0x4348bf[_0x54d1('0x11')];var _0x4cde82=_0xf347f3[_0x54d1('0x23')](-0x1);if(_0x4cde82==='/'||_0x4cde82==='\x5c'||_0x4cde82===':'){_0xf347f3=_0xf347f3[_0x54d1('0x24')](0x0,_0xf347f3[_0x54d1('0x25')](_0x4cde82));}switch(_0x4348bf[_0x54d1('0xc')]){case'US':_0x2adce8=_0x54d1('0x12');break;case'AU':_0x2adce8=_0x54d1('0x13');break;case'IN':_0x2adce8=_0x54d1('0x14');break;case'CN':_0x2adce8=_0x54d1('0x15');break;default:_0x2adce8=_0x54d1('0x16');break;}var _0x4a7189={'method':_0x54d1('0x17'),'uri':_0x2adce8+'/oauth/v2/token','form':{'grant_type':_0x54d1('0x26'),'client_id':_0x4348bf[_0x54d1('0xe')],'client_secret':_0x4348bf[_0x54d1('0xf')],'redirect_uri':_0x4348bf[_0x54d1('0x11')],'code':_0x4348bf['code']},'headers':{'Content-Type':_0x54d1('0x18')}};return rp(_0x4a7189)['then'](function(_0x2524eb){var _0x59358e=JSON['parse'](_0x2524eb);if(_0x59358e[_0x54d1('0x27')]){_0x4348bf[_0x54d1('0x28')]=_0x59358e[_0x54d1('0x27')];logger[_0x54d1('0x1b')](util['format'](_0x54d1('0x1d'),_0x4348bf[_0x54d1('0x1e')],_0x4348bf['id']));}else{logger[_0x54d1('0x21')](util[_0x54d1('0x1c')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4348bf['name'],_0x4348bf['id']),util[_0x54d1('0x20')](_0x59358e,{'showHidden':![],'depth':null}));}return _0x191b52(null,_0x2925e4);})[_0x54d1('0x29')](function(_0x5f0319){logger[_0x54d1('0x21')](util[_0x54d1('0x1c')](_0x54d1('0x1f'),_0x4348bf[_0x54d1('0x1e')],_0x4348bf['id']),util[_0x54d1('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x191b52(_0x5f0319);});}else{return _0x191b52(null,_0x2925e4);}}}});}; \ No newline at end of file +var _0x0c33=['application/x-www-form-urlencoded','parse','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','changed','serverUrl','clientId','clientSecret','code','slice','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','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','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','substring','lastIndexOf','https://accounts.zoho.com'];(function(_0x29311d,_0x3f9e23){var _0xa29b8f=function(_0x2bb490){while(--_0x2bb490){_0x29311d['push'](_0x29311d['shift']());}};_0xa29b8f(++_0x3f9e23);}(_0x0c33,0x121));var _0x30c3=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x0c33[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x30c3('0x0'));var util=require('util');var logger=require(_0x30c3('0x1'))('api');var moment=require('moment');var BPromise=require(_0x30c3('0x2'));var rp=require(_0x30c3('0x3'));var fs=require('fs');var path=require(_0x30c3('0x4'));var rimraf=require(_0x30c3('0x5'));var config=require(_0x30c3('0x6'));var attributes=require(_0x30c3('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x30c3('0x8')]=function(_0x2687a1,_0x28b1cc){return _0x2687a1[_0x30c3('0x9')](_0x30c3('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5da9d6,_0x440141,_0x4ae7ca){if(_0x5da9d6[_0x30c3('0xb')]('zone')||_0x5da9d6[_0x30c3('0xb')](_0x30c3('0xc'))||_0x5da9d6[_0x30c3('0xb')](_0x30c3('0xd'))||_0x5da9d6[_0x30c3('0xb')](_0x30c3('0xe'))||_0x5da9d6[_0x30c3('0xb')](_0x30c3('0xf'))||_0x5da9d6['changed']('host')){var _0x31bc85,_0xddd5c9;_0x31bc85=_0x5da9d6[_0x30c3('0xc')];var _0x311d23=_0x31bc85[_0x30c3('0x10')](-0x1);if(_0x311d23==='/'||_0x311d23==='\x5c'||_0x311d23===':'){_0x31bc85=_0x31bc85['substring'](0x0,_0x31bc85['lastIndexOf'](_0x311d23));}switch(_0x5da9d6[_0x30c3('0x11')]){case'US':_0xddd5c9='https://accounts.zoho.com';break;case'AU':_0xddd5c9=_0x30c3('0x12');break;case'IN':_0xddd5c9=_0x30c3('0x13');break;case'CN':_0xddd5c9='https://accounts.zoho.com.cn';break;default:_0xddd5c9=_0x30c3('0x14');break;}var _0x11bb25={'method':_0x30c3('0x15'),'uri':_0xddd5c9+_0x30c3('0x16'),'form':{'grant_type':_0x30c3('0x17'),'client_id':_0x5da9d6['clientId'],'client_secret':_0x5da9d6[_0x30c3('0xe')],'redirect_uri':_0x5da9d6['serverUrl'],'code':_0x5da9d6[_0x30c3('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x11bb25)[_0x30c3('0x18')](function(_0x5a8664){var _0x4056b7=JSON['parse'](_0x5a8664);if(_0x4056b7[_0x30c3('0x19')]){_0x5da9d6[_0x30c3('0x1a')]=_0x4056b7[_0x30c3('0x19')];logger[_0x30c3('0x1b')](util[_0x30c3('0x1c')](_0x30c3('0x1d'),_0x5da9d6[_0x30c3('0x1e')],_0x5da9d6['id']));}else{logger[_0x30c3('0x1f')](util[_0x30c3('0x1c')](_0x30c3('0x20'),_0x5da9d6[_0x30c3('0x1e')],_0x5da9d6['id']),util[_0x30c3('0x21')](_0x4056b7,{'showHidden':![],'depth':null}));}return _0x4ae7ca(null,_0x440141);})[_0x30c3('0x22')](function(_0x28a31b){logger[_0x30c3('0x1f')](util[_0x30c3('0x1c')](_0x30c3('0x20'),_0x5da9d6[_0x30c3('0x1e')],_0x5da9d6['id']),util[_0x30c3('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x4ae7ca(_0x28a31b);});}else{return _0x4ae7ca(null,_0x440141);}},'beforeUpdate':function(_0x3a0db4,_0x15e503,_0x183e35){if(_0x3a0db4[_0x30c3('0xb')](_0x30c3('0x11'))||_0x3a0db4['changed'](_0x30c3('0xc'))||_0x3a0db4[_0x30c3('0xb')](_0x30c3('0xd'))||_0x3a0db4[_0x30c3('0xb')](_0x30c3('0xe'))||_0x3a0db4['changed'](_0x30c3('0xf'))||_0x3a0db4[_0x30c3('0xb')](_0x30c3('0x23'))){var _0x5c302e,_0x4fc76f;_0x5c302e=_0x3a0db4[_0x30c3('0xc')];var _0x4bb95a=_0x5c302e[_0x30c3('0x10')](-0x1);if(_0x4bb95a==='/'||_0x4bb95a==='\x5c'||_0x4bb95a===':'){_0x5c302e=_0x5c302e[_0x30c3('0x24')](0x0,_0x5c302e[_0x30c3('0x25')](_0x4bb95a));}switch(_0x3a0db4[_0x30c3('0x11')]){case'US':_0x4fc76f=_0x30c3('0x26');break;case'AU':_0x4fc76f=_0x30c3('0x12');break;case'IN':_0x4fc76f=_0x30c3('0x13');break;case'CN':_0x4fc76f='https://accounts.zoho.com.cn';break;default:_0x4fc76f=_0x30c3('0x14');break;}var _0x48f33a={'method':_0x30c3('0x15'),'uri':_0x4fc76f+_0x30c3('0x16'),'form':{'grant_type':'authorization_code','client_id':_0x3a0db4[_0x30c3('0xd')],'client_secret':_0x3a0db4['clientSecret'],'redirect_uri':_0x3a0db4[_0x30c3('0xc')],'code':_0x3a0db4[_0x30c3('0xf')]},'headers':{'Content-Type':_0x30c3('0x27')}};return rp(_0x48f33a)['then'](function(_0x424acd){var _0x1afd27=JSON[_0x30c3('0x28')](_0x424acd);if(_0x1afd27[_0x30c3('0x19')]){_0x3a0db4[_0x30c3('0x1a')]=_0x1afd27[_0x30c3('0x19')];logger[_0x30c3('0x1b')](util[_0x30c3('0x1c')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3a0db4[_0x30c3('0x1e')],_0x3a0db4['id']));}else{logger[_0x30c3('0x1f')](util['format'](_0x30c3('0x20'),_0x3a0db4[_0x30c3('0x1e')],_0x3a0db4['id']),util[_0x30c3('0x21')](_0x1afd27,{'showHidden':![],'depth':null}));}return _0x183e35(null,_0x15e503);})['catch'](function(_0x505e0c){logger[_0x30c3('0x1f')](util[_0x30c3('0x1c')](_0x30c3('0x20'),_0x3a0db4[_0x30c3('0x1e')],_0x3a0db4['id']),util[_0x30c3('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x183e35(_0x505e0c);});}else{return _0x183e35(null,_0x15e503);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index f559d8c..3781d27 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 _0x48ac=['../../config/environment','jayson/promise','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model','catch','find','where','ShowZohoAccount','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4927dc,_0x54b3f6){var _0x45e1c3=function(_0x45f4f7){while(--_0x45f4f7){_0x4927dc['push'](_0x4927dc['shift']());}};_0x45e1c3(++_0x54b3f6);}(_0x48ac,0xe0));var _0xc48a=function(_0x1bf49b,_0x18edcc){_0x1bf49b=_0x1bf49b-0x0;var _0x297b4f=_0x48ac[_0x1bf49b];return _0x297b4f;};'use strict';var _=require('lodash');var util=require(_0xc48a('0x0'));var moment=require('moment');var BPromise=require(_0xc48a('0x1'));var rs=require(_0xc48a('0x2'));var fs=require('fs');var Redis=require(_0xc48a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc48a('0x4'));var logger=require(_0xc48a('0x5'))(_0xc48a('0x6'));var config=require(_0xc48a('0x7'));var jayson=require(_0xc48a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5df462,_0x5cffd4,_0x1e1e1a){return new BPromise(function(_0xf0c31b,_0x2c3285){return client['request'](_0x5df462,_0x1e1e1a)[_0xc48a('0x9')](function(_0x43461a){logger[_0xc48a('0xa')](_0xc48a('0xb'),_0x5cffd4,_0xc48a('0xc'));logger[_0xc48a('0xd')](_0xc48a('0xe'),_0x5cffd4,_0xc48a('0xc'),JSON[_0xc48a('0xf')](_0x43461a));if(_0x43461a[_0xc48a('0x10')]){if(_0x43461a[_0xc48a('0x10')]['code']===0x1f4){logger[_0xc48a('0x10')](_0xc48a('0xb'),_0x5cffd4,_0x43461a[_0xc48a('0x10')]['message']);return _0x2c3285(_0x43461a[_0xc48a('0x10')][_0xc48a('0x11')]);}logger['error'](_0xc48a('0xb'),_0x5cffd4,_0x43461a[_0xc48a('0x10')][_0xc48a('0x11')]);return _0xf0c31b(_0x43461a['error'][_0xc48a('0x11')]);}else{logger[_0xc48a('0xa')](_0xc48a('0xb'),_0x5cffd4,'request\x20sent');_0xf0c31b(_0x43461a[_0xc48a('0x12')][_0xc48a('0x11')]);}})['catch'](function(_0x5c319b){logger[_0xc48a('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x5cffd4,_0x5c319b);_0x2c3285(_0x5c319b);});});}exports[_0xc48a('0x13')]=function(_0x29a1ad){var _0x188549=this;return new Promise(function(_0x462102,_0x25e389){return db[_0xc48a('0x14')][_0xc48a('0x15')]({'raw':_0x29a1ad['options']?_0x29a1ad[_0xc48a('0x16')][_0xc48a('0x17')]===undefined?!![]:![]:!![],'where':_0x29a1ad['options']?_0x29a1ad[_0xc48a('0x16')]['where']||null:null,'attributes':_0x29a1ad[_0xc48a('0x16')]?_0x29a1ad['options'][_0xc48a('0x18')]||null:null,'limit':_0x29a1ad[_0xc48a('0x16')]?_0x29a1ad[_0xc48a('0x16')][_0xc48a('0x19')]||null:null,'include':_0x29a1ad[_0xc48a('0x16')]?_0x29a1ad[_0xc48a('0x16')][_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x29a1ad[_0xc48a('0x16')][_0xc48a('0x1a')],function(_0x112874){return{'model':db[_0x112874['model']],'as':_0x112874['as'],'attributes':_0x112874['attributes'],'include':_0x112874[_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x112874[_0xc48a('0x1a')],function(_0x1e3618){return{'model':db[_0x1e3618['model']],'as':_0x1e3618['as'],'attributes':_0x1e3618['attributes'],'include':_0x1e3618[_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x1e3618[_0xc48a('0x1a')],function(_0x4ecdaf){return{'model':db[_0x4ecdaf[_0xc48a('0x1c')]],'as':_0x4ecdaf['as'],'attributes':_0x4ecdaf[_0xc48a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc48a('0x9')](function(_0x281100){logger[_0xc48a('0xa')](_0xc48a('0x13'),_0x29a1ad);logger[_0xc48a('0xd')](_0xc48a('0x13'),_0x29a1ad,JSON[_0xc48a('0xf')](_0x281100));_0x462102(_0x281100);})[_0xc48a('0x1d')](function(_0x5da24d){logger['error'](_0xc48a('0x13'),_0x5da24d['message'],_0x29a1ad);_0x25e389(_0x188549[_0xc48a('0x10')](0x1f4,_0x5da24d[_0xc48a('0x11')]));});});};exports['ShowZohoAccount']=function(_0x2f69c7){var _0x2ab3e1=this;return new Promise(function(_0x22e62a,_0x5c6d41){return db[_0xc48a('0x14')][_0xc48a('0x1e')]({'raw':_0x2f69c7['options']?_0x2f69c7[_0xc48a('0x16')][_0xc48a('0x17')]===undefined?!![]:![]:!![],'where':_0x2f69c7[_0xc48a('0x16')]?_0x2f69c7[_0xc48a('0x16')][_0xc48a('0x1f')]||null:null,'attributes':_0x2f69c7['options']?_0x2f69c7[_0xc48a('0x16')][_0xc48a('0x18')]||null:null,'include':_0x2f69c7[_0xc48a('0x16')]?_0x2f69c7[_0xc48a('0x16')][_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x2f69c7[_0xc48a('0x16')][_0xc48a('0x1a')],function(_0x57d803){return{'model':db[_0x57d803[_0xc48a('0x1c')]],'as':_0x57d803['as'],'attributes':_0x57d803[_0xc48a('0x18')],'include':_0x57d803[_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x57d803[_0xc48a('0x1a')],function(_0x35c259){return{'model':db[_0x35c259[_0xc48a('0x1c')]],'as':_0x35c259['as'],'attributes':_0x35c259['attributes'],'include':_0x35c259[_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x35c259[_0xc48a('0x1a')],function(_0x2288ce){return{'model':db[_0x2288ce['model']],'as':_0x2288ce['as'],'attributes':_0x2288ce[_0xc48a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc48a('0x9')](function(_0x4b355c){logger[_0xc48a('0xa')]('ShowZohoAccount',_0x2f69c7);logger[_0xc48a('0xd')]('ShowZohoAccount',_0x2f69c7,JSON['stringify'](_0x4b355c));_0x22e62a(_0x4b355c);})[_0xc48a('0x1d')](function(_0x1e9248){logger['error'](_0xc48a('0x20'),_0x1e9248[_0xc48a('0x11')],_0x2f69c7);_0x5c6d41(_0x2ab3e1[_0xc48a('0x10')](0x1f4,_0x1e9248[_0xc48a('0x11')]));});});}; \ No newline at end of file +var _0x5b12=['where','include','model','attributes','map','ShowZohoAccount','find','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','catch','GetZohoAccount','ZohoAccount','options'];(function(_0x348799,_0x5b7f5d){var _0x51c210=function(_0x3efc84){while(--_0x3efc84){_0x348799['push'](_0x348799['shift']());}};_0x51c210(++_0x5b7f5d);}(_0x5b12,0xa3));var _0x25b1=function(_0x59d18f,_0x1066f2){_0x59d18f=_0x59d18f-0x0;var _0x20b8e4=_0x5b12[_0x59d18f];return _0x20b8e4;};'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')]('ZohoAccount,\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);});});}exports[_0x25b1('0x14')]=function(_0x27ccc9){var _0x1f78c2=this;return new Promise(function(_0x2a7d14,_0x17024a){return db[_0x25b1('0x15')]['findAll']({'raw':_0x27ccc9['options']?_0x27ccc9[_0x25b1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x27ccc9[_0x25b1('0x16')]?_0x27ccc9['options'][_0x25b1('0x17')]||null:null,'attributes':_0x27ccc9['options']?_0x27ccc9[_0x25b1('0x16')]['attributes']||null:null,'limit':_0x27ccc9[_0x25b1('0x16')]?_0x27ccc9['options']['limit']||null:null,'include':_0x27ccc9['options']?_0x27ccc9[_0x25b1('0x16')][_0x25b1('0x18')]?_['map'](_0x27ccc9[_0x25b1('0x16')][_0x25b1('0x18')],function(_0x1e5915){return{'model':db[_0x1e5915[_0x25b1('0x19')]],'as':_0x1e5915['as'],'attributes':_0x1e5915[_0x25b1('0x1a')],'include':_0x1e5915['include']?_[_0x25b1('0x1b')](_0x1e5915[_0x25b1('0x18')],function(_0xd22469){return{'model':db[_0xd22469[_0x25b1('0x19')]],'as':_0xd22469['as'],'attributes':_0xd22469[_0x25b1('0x1a')],'include':_0xd22469[_0x25b1('0x18')]?_['map'](_0xd22469[_0x25b1('0x18')],function(_0x27dd68){return{'model':db[_0x27dd68[_0x25b1('0x19')]],'as':_0x27dd68['as'],'attributes':_0x27dd68['attributes']};}):[]};}):[]};}):[]:[]})[_0x25b1('0x9')](function(_0x9e175f){logger[_0x25b1('0xa')]('GetZohoAccount',_0x27ccc9);logger[_0x25b1('0xc')]('GetZohoAccount',_0x27ccc9,JSON[_0x25b1('0xe')](_0x9e175f));_0x2a7d14(_0x9e175f);})[_0x25b1('0x13')](function(_0x3a4475){logger[_0x25b1('0xf')](_0x25b1('0x14'),_0x3a4475[_0x25b1('0x12')],_0x27ccc9);_0x17024a(_0x1f78c2[_0x25b1('0xf')](0x1f4,_0x3a4475['message']));});});};exports[_0x25b1('0x1c')]=function(_0xca56f0){var _0x925e99=this;return new Promise(function(_0x26f323,_0x274205){return db['ZohoAccount'][_0x25b1('0x1d')]({'raw':_0xca56f0[_0x25b1('0x16')]?_0xca56f0[_0x25b1('0x16')][_0x25b1('0x1e')]===undefined?!![]:![]:!![],'where':_0xca56f0[_0x25b1('0x16')]?_0xca56f0['options']['where']||null:null,'attributes':_0xca56f0[_0x25b1('0x16')]?_0xca56f0['options'][_0x25b1('0x1a')]||null:null,'include':_0xca56f0[_0x25b1('0x16')]?_0xca56f0[_0x25b1('0x16')]['include']?_['map'](_0xca56f0[_0x25b1('0x16')][_0x25b1('0x18')],function(_0x26d3bc){return{'model':db[_0x26d3bc['model']],'as':_0x26d3bc['as'],'attributes':_0x26d3bc[_0x25b1('0x1a')],'include':_0x26d3bc[_0x25b1('0x18')]?_[_0x25b1('0x1b')](_0x26d3bc[_0x25b1('0x18')],function(_0x54f598){return{'model':db[_0x54f598[_0x25b1('0x19')]],'as':_0x54f598['as'],'attributes':_0x54f598[_0x25b1('0x1a')],'include':_0x54f598[_0x25b1('0x18')]?_['map'](_0x54f598['include'],function(_0x357b50){return{'model':db[_0x357b50['model']],'as':_0x357b50['as'],'attributes':_0x357b50[_0x25b1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x25b1('0x9')](function(_0x3ea659){logger[_0x25b1('0xa')](_0x25b1('0x1c'),_0xca56f0);logger[_0x25b1('0xc')](_0x25b1('0x1c'),_0xca56f0,JSON[_0x25b1('0xe')](_0x3ea659));_0x26f323(_0x3ea659);})[_0x25b1('0x13')](function(_0x154f8f){logger[_0x25b1('0xf')](_0x25b1('0x1c'),_0x154f8f[_0x25b1('0x12')],_0xca56f0);_0x274205(_0x925e99[_0x25b1('0xf')](0x1f4,_0x154f8f[_0x25b1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 6d73f3b..a3422f7 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 _0x3740=['get','/:id','isAuthenticated','/: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','./intZohoConfiguration.controller'];(function(_0x1aba1b,_0x152bf2){var _0xdc4780=function(_0x343a33){while(--_0x343a33){_0x1aba1b['push'](_0x1aba1b['shift']());}};_0xdc4780(++_0x152bf2);}(_0x3740,0x10a));var _0x0374=function(_0x6c59fc,_0x5fe88d){_0x6c59fc=_0x6c59fc-0x0;var _0x17c96f=_0x3740[_0x6c59fc];return _0x17c96f;};'use strict';var multer=require(_0x0374('0x0'));var util=require(_0x0374('0x1'));var path=require(_0x0374('0x2'));var timeout=require(_0x0374('0x3'));var express=require(_0x0374('0x4'));var router=express[_0x0374('0x5')]();var fs_extra=require(_0x0374('0x6'));var auth=require(_0x0374('0x7'));var interaction=require(_0x0374('0x8'));var config=require('../../config/environment');var controller=require(_0x0374('0x9'));router[_0x0374('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0374('0xa')](_0x0374('0xb'),auth[_0x0374('0xc')](),controller['show']);router[_0x0374('0xa')](_0x0374('0xd'),auth['isAuthenticated'](),controller[_0x0374('0xe')]);router[_0x0374('0xa')](_0x0374('0xf'),auth['isAuthenticated'](),controller[_0x0374('0x10')]);router[_0x0374('0xa')](_0x0374('0x11'),auth[_0x0374('0xc')](),controller['getDescriptions']);router['post']('/',auth[_0x0374('0xc')](),controller[_0x0374('0x12')]);router[_0x0374('0x13')](_0x0374('0xb'),auth['isAuthenticated'](),controller[_0x0374('0x14')]);router['delete']('/:id',auth[_0x0374('0xc')](),controller[_0x0374('0x15')]);module[_0x0374('0x16')]=router; \ No newline at end of file +var _0xb227=['isAuthenticated','index','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','/:id','destroy','multer','util','path','express','Router','../../components/auth/service','./intZohoConfiguration.controller'];(function(_0x186c47,_0x36986f){var _0x223e41=function(_0x302114){while(--_0x302114){_0x186c47['push'](_0x186c47['shift']());}};_0x223e41(++_0x36986f);}(_0xb227,0xd1));var _0x7b22=function(_0xfab888,_0x31a185){_0xfab888=_0xfab888-0x0;var _0x460051=_0xb227[_0xfab888];return _0x460051;};'use strict';var multer=require(_0x7b22('0x0'));var util=require(_0x7b22('0x1'));var path=require(_0x7b22('0x2'));var timeout=require('connect-timeout');var express=require(_0x7b22('0x3'));var router=express[_0x7b22('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7b22('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7b22('0x6'));router['get']('/',auth[_0x7b22('0x7')](),controller[_0x7b22('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7b22('0x9')]);router[_0x7b22('0xa')](_0x7b22('0xb'),auth[_0x7b22('0x7')](),controller[_0x7b22('0xc')]);router[_0x7b22('0xa')](_0x7b22('0xd'),auth[_0x7b22('0x7')](),controller[_0x7b22('0xe')]);router[_0x7b22('0xa')](_0x7b22('0xf'),auth[_0x7b22('0x7')](),controller[_0x7b22('0x10')]);router[_0x7b22('0x11')]('/',auth[_0x7b22('0x7')](),controller[_0x7b22('0x12')]);router[_0x7b22('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7b22('0x14')]);router[_0x7b22('0x15')](_0x7b22('0x16'),auth[_0x7b22('0x7')](),controller[_0x7b22('0x17')]);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 cacec82..5c9f259 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 _0x268f=['sequelize','exports','STRING','ENUM','contact','lead','contact_lead'];(function(_0xb95306,_0x3a56c7){var _0x2536f5=function(_0x52c84b){while(--_0x52c84b){_0xb95306['push'](_0xb95306['shift']());}};_0x2536f5(++_0x3a56c7);}(_0x268f,0x196));var _0xf268=function(_0x5f5a67,_0x339557){_0x5f5a67=_0x5f5a67-0x0;var _0x4f9e84=_0x268f[_0x5f5a67];return _0x4f9e84;};'use strict';var Sequelize=require(_0xf268('0x0'));module[_0xf268('0x1')]={'name':{'type':Sequelize[_0xf268('0x2')]},'moduleCreate':{'type':Sequelize[_0xf268('0x3')]('lead',_0xf268('0x4'),'nothing'),'defaultValue':_0xf268('0x5')},'moduleSearch':{'type':Sequelize[_0xf268('0x3')](_0xf268('0x6'),'contact',_0xf268('0x5')),'defaultValue':_0xf268('0x6')},'description':{'type':Sequelize[_0xf268('0x2')]}}; \ No newline at end of file +var _0xc0c8=['contact','exports','STRING','nothing','lead','contact_lead'];(function(_0x924623,_0x4e3b66){var _0x57cae3=function(_0x21c8ba){while(--_0x21c8ba){_0x924623['push'](_0x924623['shift']());}};_0x57cae3(++_0x4e3b66);}(_0xc0c8,0x109));var _0x8c0c=function(_0x544792,_0x1005c5){_0x544792=_0x544792-0x0;var _0x1a1132=_0xc0c8[_0x544792];return _0x1a1132;};'use strict';var Sequelize=require('sequelize');module[_0x8c0c('0x0')]={'name':{'type':Sequelize[_0x8c0c('0x1')]},'moduleCreate':{'type':Sequelize['ENUM']('lead','contact',_0x8c0c('0x2')),'defaultValue':_0x8c0c('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x8c0c('0x4'),_0x8c0c('0x5'),_0x8c0c('0x3')),'defaultValue':_0x8c0c('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index d8937fb..a516b0c 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 _0xbaad=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','params','rawAttributes','include','find','create','body','findOne','options','getFields','getSubjects','pick','getDescriptions','ZohoField','rimraf','fast-json-patch','request-promise','moment','bluebird','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/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x1a074c,_0x833ace){var _0x1b88f8=function(_0x8e3ac9){while(--_0x8e3ac9){_0x1a074c['push'](_0x1a074c['shift']());}};_0x1b88f8(++_0x833ace);}(_0xbaad,0x180));var _0xdbaa=function(_0x22891e,_0x16c8d1){_0x22891e=_0x22891e-0x0;var _0x1478db=_0xbaad[_0x22891e];return _0x1478db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdbaa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbaa('0x1'));var rp=require(_0xdbaa('0x2'));var moment=require(_0xdbaa('0x3'));var BPromise=require(_0xdbaa('0x4'));var Mustache=require(_0xdbaa('0x5'));var util=require(_0xdbaa('0x6'));var path=require(_0xdbaa('0x7'));var sox=require('sox');var csv=require(_0xdbaa('0x8'));var ejs=require(_0xdbaa('0x9'));var fs=require('fs');var fs_extra=require(_0xdbaa('0xa'));var _=require(_0xdbaa('0xb'));var squel=require(_0xdbaa('0xc'));var crypto=require(_0xdbaa('0xd'));var jsforce=require(_0xdbaa('0xe'));var deskjs=require(_0xdbaa('0xf'));var toCsv=require(_0xdbaa('0x8'));var querystring=require(_0xdbaa('0x10'));var Papa=require(_0xdbaa('0x11'));var Redis=require('ioredis');var authService=require(_0xdbaa('0x12'));var qs=require(_0xdbaa('0x13'));var as=require(_0xdbaa('0x14'));var hardwareService=require(_0xdbaa('0x15'));var logger=require(_0xdbaa('0x16'))(_0xdbaa('0x17'));var utils=require('../../config/utils');var config=require(_0xdbaa('0x18'));var licenseUtil=require(_0xdbaa('0x19'));var db=require(_0xdbaa('0x1a'))['db'];function respondWithStatusCode(_0x5e4e90,_0x176adc){_0x176adc=_0x176adc||0xcc;return function(_0x23d61d){if(_0x23d61d){return _0x5e4e90[_0xdbaa('0x1b')](_0x176adc);}return _0x5e4e90[_0xdbaa('0x1c')](_0x176adc)[_0xdbaa('0x1d')]();};}function respondWithResult(_0xe3e9be,_0x5a7567){_0x5a7567=_0x5a7567||0xc8;return function(_0x56e94f){if(_0x56e94f){return _0xe3e9be[_0xdbaa('0x1c')](_0x5a7567)[_0xdbaa('0x1e')](_0x56e94f);}};}function respondWithFilteredResult(_0x20a93c,_0x39c8f9){return function(_0x13baee){if(_0x13baee){var _0xfd62fb=typeof _0x39c8f9[_0xdbaa('0x1f')]===_0xdbaa('0x20')&&typeof _0x39c8f9[_0xdbaa('0x21')]===_0xdbaa('0x20');var _0x441401=_0x13baee[_0xdbaa('0x22')];var _0x8b1106=_0xfd62fb?0x0:_0x39c8f9[_0xdbaa('0x1f')];var _0xbf55df=_0xfd62fb?_0x13baee[_0xdbaa('0x22')]:_0x39c8f9[_0xdbaa('0x1f')]+_0x39c8f9['limit'];var _0x389244;if(_0xbf55df>=_0x441401){_0xbf55df=_0x441401;_0x389244=0xc8;}else{_0x389244=0xce;}_0x20a93c[_0xdbaa('0x1c')](_0x389244);return _0x20a93c[_0xdbaa('0x23')]('Content-Range',_0x8b1106+'-'+_0xbf55df+'/'+_0x441401)[_0xdbaa('0x1e')](_0x13baee);}return null;};}function patchUpdates(_0x3fc838){return function(_0x3cb54f){try{jsonpatch[_0xdbaa('0x24')](_0x3cb54f,_0x3fc838,!![]);}catch(_0xb72200){return BPromise[_0xdbaa('0x25')](_0xb72200);}return _0x3cb54f[_0xdbaa('0x26')]();};}function saveUpdates(_0x4db34c,_0x5c9323){return function(_0x31de02){if(_0x31de02){return _0x31de02['update'](_0x4db34c)[_0xdbaa('0x27')](function(_0x121554){return _0x121554;});}return null;};}function removeEntity(_0x3ec95c,_0x4f0a54){return function(_0x1989fa){if(_0x1989fa){return _0x1989fa[_0xdbaa('0x28')]()[_0xdbaa('0x27')](function(){_0x3ec95c[_0xdbaa('0x1c')](0xcc)[_0xdbaa('0x1d')]();});}};}function handleEntityNotFound(_0x316550,_0x1dc2bb){return function(_0x175e9b){if(!_0x175e9b){_0x316550[_0xdbaa('0x1b')](0x194);}return _0x175e9b;};}function handleError(_0x403f4f,_0x4665b2){_0x4665b2=_0x4665b2||0x1f4;return function(_0x4a57ae){logger[_0xdbaa('0x29')](_0x4a57ae[_0xdbaa('0x2a')]);if(_0x4a57ae[_0xdbaa('0x2b')]){delete _0x4a57ae[_0xdbaa('0x2b')];}_0x403f4f[_0xdbaa('0x1c')](_0x4665b2)[_0xdbaa('0x2c')](_0x4a57ae);};}exports[_0xdbaa('0x2d')]=function(_0x38b5e5,_0x2f3bae){var _0x35f9f0={},_0x28d73b={},_0x48e4a1={'count':0x0,'rows':[]};var _0x3c5c5f=_[_0xdbaa('0x2e')](db[_0xdbaa('0x2f')]['rawAttributes'],function(_0x214521){return{'name':_0x214521[_0xdbaa('0x30')],'type':_0x214521[_0xdbaa('0x31')]['key']};});_0x28d73b[_0xdbaa('0x32')]=_['map'](_0x3c5c5f,'name');_0x28d73b[_0xdbaa('0x33')]=_[_0xdbaa('0x34')](_0x38b5e5['query']);_0x28d73b[_0xdbaa('0x35')]=_[_0xdbaa('0x36')](_0x28d73b['model'],_0x28d73b[_0xdbaa('0x33')]);_0x35f9f0[_0xdbaa('0x37')]=_[_0xdbaa('0x36')](_0x28d73b[_0xdbaa('0x32')],qs[_0xdbaa('0x38')](_0x38b5e5['query']['fields']));_0x35f9f0[_0xdbaa('0x37')]=_0x35f9f0[_0xdbaa('0x37')][_0xdbaa('0x39')]?_0x35f9f0[_0xdbaa('0x37')]:_0x28d73b[_0xdbaa('0x32')];if(!_0x38b5e5['query'][_0xdbaa('0x3a')](_0xdbaa('0x3b'))){_0x35f9f0['limit']=qs['limit'](_0x38b5e5[_0xdbaa('0x33')][_0xdbaa('0x21')]);_0x35f9f0['offset']=qs[_0xdbaa('0x1f')](_0x38b5e5[_0xdbaa('0x33')][_0xdbaa('0x1f')]);}_0x35f9f0[_0xdbaa('0x3c')]=qs[_0xdbaa('0x3d')](_0x38b5e5['query'][_0xdbaa('0x3d')]);_0x35f9f0[_0xdbaa('0x3e')]=qs[_0xdbaa('0x35')](_['pick'](_0x38b5e5['query'],_0x28d73b['filters']),_0x3c5c5f);if(_0x38b5e5[_0xdbaa('0x33')][_0xdbaa('0x3f')]){_0x35f9f0[_0xdbaa('0x3e')]=_[_0xdbaa('0x40')](_0x35f9f0[_0xdbaa('0x3e')],{'$or':_[_0xdbaa('0x2e')](_0x3c5c5f,function(_0x5c9955){if(_0x5c9955[_0xdbaa('0x31')]!==_0xdbaa('0x41')){var _0x42aa45={};_0x42aa45[_0x5c9955[_0xdbaa('0x2b')]]={'$like':'%'+_0x38b5e5[_0xdbaa('0x33')]['filter']+'%'};return _0x42aa45;}})});}_0x35f9f0=_[_0xdbaa('0x40')]({},_0x35f9f0,_0x38b5e5['options']);var _0x5a75ee={'where':_0x35f9f0[_0xdbaa('0x3e')]};return db[_0xdbaa('0x2f')][_0xdbaa('0x22')](_0x5a75ee)[_0xdbaa('0x27')](function(_0x1c93b6){_0x48e4a1['count']=_0x1c93b6;if(_0x38b5e5[_0xdbaa('0x33')]['includeAll']){_0x35f9f0['include']=[{'all':!![]}];}return db[_0xdbaa('0x2f')][_0xdbaa('0x42')](_0x35f9f0);})[_0xdbaa('0x27')](function(_0x47d373){_0x48e4a1[_0xdbaa('0x43')]=_0x47d373;return _0x48e4a1;})[_0xdbaa('0x27')](respondWithFilteredResult(_0x2f3bae,_0x35f9f0))[_0xdbaa('0x44')](handleError(_0x2f3bae,null));};exports['show']=function(_0x311e00,_0x324cbe){var _0x19e8e7={'raw':![],'where':{'id':_0x311e00[_0xdbaa('0x45')]['id']}},_0x107f19={};_0x107f19['model']=_[_0xdbaa('0x34')](db[_0xdbaa('0x2f')][_0xdbaa('0x46')]);_0x107f19['query']=_[_0xdbaa('0x34')](_0x311e00[_0xdbaa('0x33')]);_0x107f19[_0xdbaa('0x35')]=_[_0xdbaa('0x36')](_0x107f19[_0xdbaa('0x32')],_0x107f19[_0xdbaa('0x33')]);_0x19e8e7[_0xdbaa('0x37')]=_[_0xdbaa('0x36')](_0x107f19['model'],qs[_0xdbaa('0x38')](_0x311e00[_0xdbaa('0x33')]['fields']));_0x19e8e7[_0xdbaa('0x37')]=_0x19e8e7['attributes']['length']?_0x19e8e7[_0xdbaa('0x37')]:_0x107f19[_0xdbaa('0x32')];if(_0x311e00[_0xdbaa('0x33')]['includeAll']){_0x19e8e7[_0xdbaa('0x47')]=[{'all':!![]}];}_0x19e8e7=_[_0xdbaa('0x40')]({},_0x19e8e7,_0x311e00['options']);return db[_0xdbaa('0x2f')][_0xdbaa('0x48')](_0x19e8e7)[_0xdbaa('0x27')](handleEntityNotFound(_0x324cbe,null))['then'](respondWithResult(_0x324cbe,null))[_0xdbaa('0x44')](handleError(_0x324cbe,null));};exports[_0xdbaa('0x49')]=function(_0x58820d,_0x57a19c){return db[_0xdbaa('0x2f')]['create'](_0x58820d['body'],{})[_0xdbaa('0x27')](respondWithResult(_0x57a19c,0xc9))[_0xdbaa('0x44')](handleError(_0x57a19c,null));};exports['update']=function(_0x24f89e,_0x374938){if(_0x24f89e[_0xdbaa('0x4a')]['id']){delete _0x24f89e['body']['id'];}return db[_0xdbaa('0x2f')]['find']({'where':{'id':_0x24f89e['params']['id']}})[_0xdbaa('0x27')](handleEntityNotFound(_0x374938,null))['then'](saveUpdates(_0x24f89e[_0xdbaa('0x4a')],null))[_0xdbaa('0x27')](respondWithResult(_0x374938,null))[_0xdbaa('0x44')](handleError(_0x374938,null));};exports[_0xdbaa('0x28')]=function(_0x37aadf,_0x4280e9){return db[_0xdbaa('0x2f')][_0xdbaa('0x48')]({'where':{'id':_0x37aadf[_0xdbaa('0x45')]['id']}})[_0xdbaa('0x27')](handleEntityNotFound(_0x4280e9,null))[_0xdbaa('0x27')](removeEntity(_0x4280e9,null))['catch'](handleError(_0x4280e9,null));};exports['getFields']=function(_0x31fb8b,_0x2f69d2,_0x57d405){var _0x1ac9dc={};var _0x3fb44b={};var _0xb72f9;var _0x3f78e0;return db[_0xdbaa('0x2f')][_0xdbaa('0x4b')]({'where':{'id':_0x31fb8b[_0xdbaa('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f69d2,null))[_0xdbaa('0x27')](function(_0x5cc717){if(_0x5cc717){_0xb72f9=_0x5cc717;_0x3fb44b[_0xdbaa('0x32')]=_[_0xdbaa('0x34')](db['ZohoField'][_0xdbaa('0x46')]);_0x3fb44b[_0xdbaa('0x33')]=_[_0xdbaa('0x34')](_0x31fb8b[_0xdbaa('0x33')]);_0x3fb44b[_0xdbaa('0x35')]=_[_0xdbaa('0x36')](_0x3fb44b[_0xdbaa('0x32')],_0x3fb44b[_0xdbaa('0x33')]);_0x1ac9dc[_0xdbaa('0x37')]=_[_0xdbaa('0x36')](_0x3fb44b['model'],qs[_0xdbaa('0x38')](_0x31fb8b[_0xdbaa('0x33')][_0xdbaa('0x38')]));_0x1ac9dc[_0xdbaa('0x37')]=_0x1ac9dc[_0xdbaa('0x37')][_0xdbaa('0x39')]?_0x1ac9dc[_0xdbaa('0x37')]:_0x3fb44b[_0xdbaa('0x32')];_0x1ac9dc[_0xdbaa('0x3c')]=qs['sort'](_0x31fb8b['query'][_0xdbaa('0x3d')]);_0x1ac9dc['where']=qs['filters'](_['pick'](_0x31fb8b['query'],_0x3fb44b['filters']));if(_0x31fb8b[_0xdbaa('0x33')]['filter']){_0x1ac9dc[_0xdbaa('0x3e')]=_['merge'](_0x1ac9dc[_0xdbaa('0x3e')],{'$or':_[_0xdbaa('0x2e')](_0x1ac9dc['attributes'],function(_0x35241d){var _0x18cb30={};_0x18cb30[_0x35241d]={'$like':'%'+_0x31fb8b['query']['filter']+'%'};return _0x18cb30;})});}_0x1ac9dc=_[_0xdbaa('0x40')]({},_0x1ac9dc,_0x31fb8b[_0xdbaa('0x4c')]);return _0xb72f9[_0xdbaa('0x4d')](_0x1ac9dc);}})[_0xdbaa('0x27')](function(_0xb0038e){if(_0xb0038e){_0x3f78e0=_0xb0038e['length'];if(!_0x31fb8b[_0xdbaa('0x33')][_0xdbaa('0x3a')]('nolimit')){_0x1ac9dc[_0xdbaa('0x21')]=qs[_0xdbaa('0x21')](_0x31fb8b[_0xdbaa('0x33')][_0xdbaa('0x21')]);_0x1ac9dc[_0xdbaa('0x1f')]=qs[_0xdbaa('0x1f')](_0x31fb8b[_0xdbaa('0x33')][_0xdbaa('0x1f')]);}return _0xb72f9[_0xdbaa('0x4d')](_0x1ac9dc);}})[_0xdbaa('0x27')](function(_0x1e8538){if(_0x1e8538){return _0x1e8538?{'count':_0x3f78e0,'rows':_0x1e8538}:null;}})[_0xdbaa('0x27')](respondWithResult(_0x2f69d2,null))[_0xdbaa('0x44')](handleError(_0x2f69d2,null));};exports[_0xdbaa('0x4e')]=function(_0x472e4e,_0x208bd6,_0x1b38ea){var _0x2ca8f5={};var _0x4446d1={};var _0x452635;var _0x1222fa;return db[_0xdbaa('0x2f')][_0xdbaa('0x4b')]({'where':{'id':_0x472e4e[_0xdbaa('0x45')]['id']}})[_0xdbaa('0x27')](handleEntityNotFound(_0x208bd6,null))[_0xdbaa('0x27')](function(_0x4418f7){if(_0x4418f7){_0x452635=_0x4418f7;_0x4446d1['model']=_[_0xdbaa('0x34')](db['ZohoField'][_0xdbaa('0x46')]);_0x4446d1[_0xdbaa('0x33')]=_['keys'](_0x472e4e['query']);_0x4446d1[_0xdbaa('0x35')]=_['intersection'](_0x4446d1['model'],_0x4446d1[_0xdbaa('0x33')]);_0x2ca8f5[_0xdbaa('0x37')]=_[_0xdbaa('0x36')](_0x4446d1[_0xdbaa('0x32')],qs[_0xdbaa('0x38')](_0x472e4e['query'][_0xdbaa('0x38')]));_0x2ca8f5['attributes']=_0x2ca8f5[_0xdbaa('0x37')][_0xdbaa('0x39')]?_0x2ca8f5['attributes']:_0x4446d1['model'];_0x2ca8f5[_0xdbaa('0x3c')]=qs[_0xdbaa('0x3d')](_0x472e4e[_0xdbaa('0x33')][_0xdbaa('0x3d')]);_0x2ca8f5[_0xdbaa('0x3e')]=qs[_0xdbaa('0x35')](_[_0xdbaa('0x4f')](_0x472e4e[_0xdbaa('0x33')],_0x4446d1[_0xdbaa('0x35')]));if(_0x472e4e[_0xdbaa('0x33')][_0xdbaa('0x3f')]){_0x2ca8f5[_0xdbaa('0x3e')]=_[_0xdbaa('0x40')](_0x2ca8f5['where'],{'$or':_[_0xdbaa('0x2e')](_0x2ca8f5[_0xdbaa('0x37')],function(_0x5c2804){var _0x105053={};_0x105053[_0x5c2804]={'$like':'%'+_0x472e4e[_0xdbaa('0x33')]['filter']+'%'};return _0x105053;})});}_0x2ca8f5=_['merge']({},_0x2ca8f5,_0x472e4e[_0xdbaa('0x4c')]);return _0x452635[_0xdbaa('0x4e')](_0x2ca8f5);}})[_0xdbaa('0x27')](function(_0x3d5d21){if(_0x3d5d21){_0x1222fa=_0x3d5d21[_0xdbaa('0x39')];if(!_0x472e4e[_0xdbaa('0x33')][_0xdbaa('0x3a')](_0xdbaa('0x3b'))){_0x2ca8f5[_0xdbaa('0x21')]=qs['limit'](_0x472e4e[_0xdbaa('0x33')][_0xdbaa('0x21')]);_0x2ca8f5[_0xdbaa('0x1f')]=qs[_0xdbaa('0x1f')](_0x472e4e[_0xdbaa('0x33')][_0xdbaa('0x1f')]);}return _0x452635['getSubjects'](_0x2ca8f5);}})[_0xdbaa('0x27')](function(_0x4609b0){if(_0x4609b0){return _0x4609b0?{'count':_0x1222fa,'rows':_0x4609b0}:null;}})[_0xdbaa('0x27')](respondWithResult(_0x208bd6,null))[_0xdbaa('0x44')](handleError(_0x208bd6,null));};exports[_0xdbaa('0x50')]=function(_0x48dce4,_0x7df995,_0x352fa7){var _0x2f3801={};var _0xb97127={};var _0x2f64cc;var _0x59fed0;return db[_0xdbaa('0x2f')]['findOne']({'where':{'id':_0x48dce4['params']['id']}})[_0xdbaa('0x27')](handleEntityNotFound(_0x7df995,null))[_0xdbaa('0x27')](function(_0x940700){if(_0x940700){_0x2f64cc=_0x940700;_0xb97127[_0xdbaa('0x32')]=_['keys'](db[_0xdbaa('0x51')][_0xdbaa('0x46')]);_0xb97127[_0xdbaa('0x33')]=_[_0xdbaa('0x34')](_0x48dce4['query']);_0xb97127[_0xdbaa('0x35')]=_[_0xdbaa('0x36')](_0xb97127[_0xdbaa('0x32')],_0xb97127[_0xdbaa('0x33')]);_0x2f3801[_0xdbaa('0x37')]=_[_0xdbaa('0x36')](_0xb97127[_0xdbaa('0x32')],qs['fields'](_0x48dce4[_0xdbaa('0x33')][_0xdbaa('0x38')]));_0x2f3801[_0xdbaa('0x37')]=_0x2f3801['attributes'][_0xdbaa('0x39')]?_0x2f3801['attributes']:_0xb97127[_0xdbaa('0x32')];_0x2f3801[_0xdbaa('0x3c')]=qs[_0xdbaa('0x3d')](_0x48dce4[_0xdbaa('0x33')][_0xdbaa('0x3d')]);_0x2f3801[_0xdbaa('0x3e')]=qs[_0xdbaa('0x35')](_['pick'](_0x48dce4[_0xdbaa('0x33')],_0xb97127[_0xdbaa('0x35')]));if(_0x48dce4[_0xdbaa('0x33')][_0xdbaa('0x3f')]){_0x2f3801[_0xdbaa('0x3e')]=_['merge'](_0x2f3801[_0xdbaa('0x3e')],{'$or':_[_0xdbaa('0x2e')](_0x2f3801[_0xdbaa('0x37')],function(_0x34b5e7){var _0x109fc9={};_0x109fc9[_0x34b5e7]={'$like':'%'+_0x48dce4[_0xdbaa('0x33')][_0xdbaa('0x3f')]+'%'};return _0x109fc9;})});}_0x2f3801=_[_0xdbaa('0x40')]({},_0x2f3801,_0x48dce4[_0xdbaa('0x4c')]);return _0x2f64cc[_0xdbaa('0x50')](_0x2f3801);}})[_0xdbaa('0x27')](function(_0x578d32){if(_0x578d32){_0x59fed0=_0x578d32[_0xdbaa('0x39')];if(!_0x48dce4[_0xdbaa('0x33')][_0xdbaa('0x3a')]('nolimit')){_0x2f3801['limit']=qs[_0xdbaa('0x21')](_0x48dce4[_0xdbaa('0x33')][_0xdbaa('0x21')]);_0x2f3801[_0xdbaa('0x1f')]=qs[_0xdbaa('0x1f')](_0x48dce4[_0xdbaa('0x33')]['offset']);}return _0x2f64cc[_0xdbaa('0x50')](_0x2f3801);}})[_0xdbaa('0x27')](function(_0x59e2d0){if(_0x59e2d0){return _0x59e2d0?{'count':_0x59fed0,'rows':_0x59e2d0}:null;}})[_0xdbaa('0x27')](respondWithResult(_0x7df995,null))[_0xdbaa('0x44')](handleError(_0x7df995,null));}; \ No newline at end of file +var _0xf09c=['stack','name','send','index','map','ZohoConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','find','create','body','params','getFields','findOne','ZohoField','order','getSubjects','getDescriptions','rimraf','request-promise','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error'];(function(_0x396a45,_0x57208b){var _0x5b5c23=function(_0x3d1384){while(--_0x3d1384){_0x396a45['push'](_0x396a45['shift']());}};_0x5b5c23(++_0x57208b);}(_0xf09c,0x1f0));var _0xcf09=function(_0x1cae1b,_0x293cff){_0x1cae1b=_0x1cae1b-0x0;var _0x42f655=_0xf09c[_0x1cae1b];return _0x42f655;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf09('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcf09('0x1'));var moment=require(_0xcf09('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xcf09('0x3'));var util=require(_0xcf09('0x4'));var path=require(_0xcf09('0x5'));var sox=require('sox');var csv=require(_0xcf09('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf09('0x7'));var _=require('lodash');var squel=require(_0xcf09('0x8'));var crypto=require(_0xcf09('0x9'));var jsforce=require(_0xcf09('0xa'));var deskjs=require(_0xcf09('0xb'));var toCsv=require(_0xcf09('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcf09('0xc'));var authService=require(_0xcf09('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xcf09('0xe'));var hardwareService=require(_0xcf09('0xf'));var logger=require('../../config/logger')(_0xcf09('0x10'));var utils=require(_0xcf09('0x11'));var config=require(_0xcf09('0x12'));var licenseUtil=require(_0xcf09('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e6dd0,_0x22e220){_0x22e220=_0x22e220||0xcc;return function(_0x34f23c){if(_0x34f23c){return _0x3e6dd0[_0xcf09('0x14')](_0x22e220);}return _0x3e6dd0['status'](_0x22e220)['end']();};}function respondWithResult(_0x416436,_0x582932){_0x582932=_0x582932||0xc8;return function(_0xf23fa6){if(_0xf23fa6){return _0x416436[_0xcf09('0x15')](_0x582932)[_0xcf09('0x16')](_0xf23fa6);}};}function respondWithFilteredResult(_0x520b74,_0x274555){return function(_0x241dd5){if(_0x241dd5){var _0x1496a3=typeof _0x274555[_0xcf09('0x17')]==='undefined'&&typeof _0x274555[_0xcf09('0x18')]==='undefined';var _0x761916=_0x241dd5[_0xcf09('0x19')];var _0x530be=_0x1496a3?0x0:_0x274555['offset'];var _0x1c2d4d=_0x1496a3?_0x241dd5[_0xcf09('0x19')]:_0x274555['offset']+_0x274555['limit'];var _0x259812;if(_0x1c2d4d>=_0x761916){_0x1c2d4d=_0x761916;_0x259812=0xc8;}else{_0x259812=0xce;}_0x520b74[_0xcf09('0x15')](_0x259812);return _0x520b74[_0xcf09('0x1a')](_0xcf09('0x1b'),_0x530be+'-'+_0x1c2d4d+'/'+_0x761916)[_0xcf09('0x16')](_0x241dd5);}return null;};}function patchUpdates(_0x3ce7dd){return function(_0x392c16){try{jsonpatch[_0xcf09('0x1c')](_0x392c16,_0x3ce7dd,!![]);}catch(_0x3d8982){return BPromise[_0xcf09('0x1d')](_0x3d8982);}return _0x392c16[_0xcf09('0x1e')]();};}function saveUpdates(_0x1d67ab,_0x9a7a5a){return function(_0x8447f){if(_0x8447f){return _0x8447f[_0xcf09('0x1f')](_0x1d67ab)[_0xcf09('0x20')](function(_0x47069d){return _0x47069d;});}return null;};}function removeEntity(_0xc306c9,_0x1d82f5){return function(_0x83928c){if(_0x83928c){return _0x83928c[_0xcf09('0x21')]()['then'](function(){_0xc306c9[_0xcf09('0x15')](0xcc)[_0xcf09('0x22')]();});}};}function handleEntityNotFound(_0x27ddcb,_0x1fd64b){return function(_0x3acc59){if(!_0x3acc59){_0x27ddcb[_0xcf09('0x14')](0x194);}return _0x3acc59;};}function handleError(_0x346618,_0x5f0d35){_0x5f0d35=_0x5f0d35||0x1f4;return function(_0x500052){logger[_0xcf09('0x23')](_0x500052[_0xcf09('0x24')]);if(_0x500052[_0xcf09('0x25')]){delete _0x500052[_0xcf09('0x25')];}_0x346618[_0xcf09('0x15')](_0x5f0d35)[_0xcf09('0x26')](_0x500052);};}exports[_0xcf09('0x27')]=function(_0x18cefb,_0x875d16){var _0x528d2b={},_0x1d9668={},_0x2a3b9e={'count':0x0,'rows':[]};var _0x2cbd35=_[_0xcf09('0x28')](db[_0xcf09('0x29')][_0xcf09('0x2a')],function(_0x542510){return{'name':_0x542510['fieldName'],'type':_0x542510[_0xcf09('0x2b')][_0xcf09('0x2c')]};});_0x1d9668[_0xcf09('0x2d')]=_[_0xcf09('0x28')](_0x2cbd35,_0xcf09('0x25'));_0x1d9668[_0xcf09('0x2e')]=_[_0xcf09('0x2f')](_0x18cefb['query']);_0x1d9668[_0xcf09('0x30')]=_[_0xcf09('0x31')](_0x1d9668['model'],_0x1d9668[_0xcf09('0x2e')]);_0x528d2b[_0xcf09('0x32')]=_[_0xcf09('0x31')](_0x1d9668[_0xcf09('0x2d')],qs[_0xcf09('0x33')](_0x18cefb[_0xcf09('0x2e')][_0xcf09('0x33')]));_0x528d2b[_0xcf09('0x32')]=_0x528d2b[_0xcf09('0x32')][_0xcf09('0x34')]?_0x528d2b[_0xcf09('0x32')]:_0x1d9668['model'];if(!_0x18cefb[_0xcf09('0x2e')][_0xcf09('0x35')](_0xcf09('0x36'))){_0x528d2b['limit']=qs['limit'](_0x18cefb['query']['limit']);_0x528d2b[_0xcf09('0x17')]=qs[_0xcf09('0x17')](_0x18cefb['query'][_0xcf09('0x17')]);}_0x528d2b['order']=qs[_0xcf09('0x37')](_0x18cefb['query'][_0xcf09('0x37')]);_0x528d2b['where']=qs[_0xcf09('0x30')](_[_0xcf09('0x38')](_0x18cefb[_0xcf09('0x2e')],_0x1d9668[_0xcf09('0x30')]),_0x2cbd35);if(_0x18cefb[_0xcf09('0x2e')][_0xcf09('0x39')]){_0x528d2b[_0xcf09('0x3a')]=_[_0xcf09('0x3b')](_0x528d2b['where'],{'$or':_['map'](_0x2cbd35,function(_0x4ca6df){if(_0x4ca6df[_0xcf09('0x2b')]!=='VIRTUAL'){var _0x4383aa={};_0x4383aa[_0x4ca6df[_0xcf09('0x25')]]={'$like':'%'+_0x18cefb['query'][_0xcf09('0x39')]+'%'};return _0x4383aa;}})});}_0x528d2b=_[_0xcf09('0x3b')]({},_0x528d2b,_0x18cefb[_0xcf09('0x3c')]);var _0x534aeb={'where':_0x528d2b[_0xcf09('0x3a')]};return db[_0xcf09('0x29')][_0xcf09('0x19')](_0x534aeb)[_0xcf09('0x20')](function(_0x28c4ea){_0x2a3b9e[_0xcf09('0x19')]=_0x28c4ea;if(_0x18cefb[_0xcf09('0x2e')]['includeAll']){_0x528d2b[_0xcf09('0x3d')]=[{'all':!![]}];}return db[_0xcf09('0x29')][_0xcf09('0x3e')](_0x528d2b);})['then'](function(_0x5ab018){_0x2a3b9e[_0xcf09('0x3f')]=_0x5ab018;return _0x2a3b9e;})[_0xcf09('0x20')](respondWithFilteredResult(_0x875d16,_0x528d2b))[_0xcf09('0x40')](handleError(_0x875d16,null));};exports[_0xcf09('0x41')]=function(_0x24f9b1,_0x2b6f36){var _0xf2964e={'raw':![],'where':{'id':_0x24f9b1['params']['id']}},_0x36b709={};_0x36b709[_0xcf09('0x2d')]=_[_0xcf09('0x2f')](db[_0xcf09('0x29')]['rawAttributes']);_0x36b709[_0xcf09('0x2e')]=_[_0xcf09('0x2f')](_0x24f9b1[_0xcf09('0x2e')]);_0x36b709[_0xcf09('0x30')]=_['intersection'](_0x36b709[_0xcf09('0x2d')],_0x36b709[_0xcf09('0x2e')]);_0xf2964e[_0xcf09('0x32')]=_[_0xcf09('0x31')](_0x36b709[_0xcf09('0x2d')],qs[_0xcf09('0x33')](_0x24f9b1['query'][_0xcf09('0x33')]));_0xf2964e[_0xcf09('0x32')]=_0xf2964e['attributes']['length']?_0xf2964e[_0xcf09('0x32')]:_0x36b709['model'];if(_0x24f9b1[_0xcf09('0x2e')]['includeAll']){_0xf2964e[_0xcf09('0x3d')]=[{'all':!![]}];}_0xf2964e=_[_0xcf09('0x3b')]({},_0xf2964e,_0x24f9b1[_0xcf09('0x3c')]);return db[_0xcf09('0x29')][_0xcf09('0x42')](_0xf2964e)[_0xcf09('0x20')](handleEntityNotFound(_0x2b6f36,null))[_0xcf09('0x20')](respondWithResult(_0x2b6f36,null))[_0xcf09('0x40')](handleError(_0x2b6f36,null));};exports[_0xcf09('0x43')]=function(_0x570d80,_0xeb77b6){return db[_0xcf09('0x29')]['create'](_0x570d80[_0xcf09('0x44')],{})[_0xcf09('0x20')](respondWithResult(_0xeb77b6,0xc9))[_0xcf09('0x40')](handleError(_0xeb77b6,null));};exports[_0xcf09('0x1f')]=function(_0x3dbf9d,_0xeeffc9){if(_0x3dbf9d[_0xcf09('0x44')]['id']){delete _0x3dbf9d[_0xcf09('0x44')]['id'];}return db[_0xcf09('0x29')][_0xcf09('0x42')]({'where':{'id':_0x3dbf9d[_0xcf09('0x45')]['id']}})[_0xcf09('0x20')](handleEntityNotFound(_0xeeffc9,null))[_0xcf09('0x20')](saveUpdates(_0x3dbf9d[_0xcf09('0x44')],null))[_0xcf09('0x20')](respondWithResult(_0xeeffc9,null))[_0xcf09('0x40')](handleError(_0xeeffc9,null));};exports[_0xcf09('0x21')]=function(_0x2148ed,_0x149df6){return db[_0xcf09('0x29')][_0xcf09('0x42')]({'where':{'id':_0x2148ed['params']['id']}})[_0xcf09('0x20')](handleEntityNotFound(_0x149df6,null))['then'](removeEntity(_0x149df6,null))[_0xcf09('0x40')](handleError(_0x149df6,null));};exports[_0xcf09('0x46')]=function(_0x290b76,_0x254632,_0x588c1d){var _0x4a7e29={};var _0x30f48d={};var _0x18617b;var _0x414375;return db[_0xcf09('0x29')][_0xcf09('0x47')]({'where':{'id':_0x290b76['params']['id']}})[_0xcf09('0x20')](handleEntityNotFound(_0x254632,null))[_0xcf09('0x20')](function(_0x47088d){if(_0x47088d){_0x18617b=_0x47088d;_0x30f48d[_0xcf09('0x2d')]=_[_0xcf09('0x2f')](db[_0xcf09('0x48')]['rawAttributes']);_0x30f48d[_0xcf09('0x2e')]=_[_0xcf09('0x2f')](_0x290b76[_0xcf09('0x2e')]);_0x30f48d[_0xcf09('0x30')]=_['intersection'](_0x30f48d['model'],_0x30f48d[_0xcf09('0x2e')]);_0x4a7e29['attributes']=_[_0xcf09('0x31')](_0x30f48d[_0xcf09('0x2d')],qs[_0xcf09('0x33')](_0x290b76[_0xcf09('0x2e')][_0xcf09('0x33')]));_0x4a7e29[_0xcf09('0x32')]=_0x4a7e29[_0xcf09('0x32')][_0xcf09('0x34')]?_0x4a7e29['attributes']:_0x30f48d[_0xcf09('0x2d')];_0x4a7e29[_0xcf09('0x49')]=qs[_0xcf09('0x37')](_0x290b76[_0xcf09('0x2e')]['sort']);_0x4a7e29['where']=qs[_0xcf09('0x30')](_[_0xcf09('0x38')](_0x290b76['query'],_0x30f48d['filters']));if(_0x290b76['query'][_0xcf09('0x39')]){_0x4a7e29[_0xcf09('0x3a')]=_['merge'](_0x4a7e29[_0xcf09('0x3a')],{'$or':_[_0xcf09('0x28')](_0x4a7e29['attributes'],function(_0x5722f7){var _0x2352f7={};_0x2352f7[_0x5722f7]={'$like':'%'+_0x290b76[_0xcf09('0x2e')]['filter']+'%'};return _0x2352f7;})});}_0x4a7e29=_['merge']({},_0x4a7e29,_0x290b76['options']);return _0x18617b[_0xcf09('0x46')](_0x4a7e29);}})[_0xcf09('0x20')](function(_0x197b7a){if(_0x197b7a){_0x414375=_0x197b7a[_0xcf09('0x34')];if(!_0x290b76[_0xcf09('0x2e')][_0xcf09('0x35')](_0xcf09('0x36'))){_0x4a7e29[_0xcf09('0x18')]=qs[_0xcf09('0x18')](_0x290b76[_0xcf09('0x2e')][_0xcf09('0x18')]);_0x4a7e29['offset']=qs[_0xcf09('0x17')](_0x290b76['query']['offset']);}return _0x18617b[_0xcf09('0x46')](_0x4a7e29);}})[_0xcf09('0x20')](function(_0x409b5e){if(_0x409b5e){return _0x409b5e?{'count':_0x414375,'rows':_0x409b5e}:null;}})[_0xcf09('0x20')](respondWithResult(_0x254632,null))[_0xcf09('0x40')](handleError(_0x254632,null));};exports[_0xcf09('0x4a')]=function(_0x4dcc80,_0x5be460,_0x46598a){var _0xd45df1={};var _0x4b70a6={};var _0x43550c;var _0x3ddae5;return db[_0xcf09('0x29')][_0xcf09('0x47')]({'where':{'id':_0x4dcc80['params']['id']}})[_0xcf09('0x20')](handleEntityNotFound(_0x5be460,null))[_0xcf09('0x20')](function(_0x2786b8){if(_0x2786b8){_0x43550c=_0x2786b8;_0x4b70a6[_0xcf09('0x2d')]=_[_0xcf09('0x2f')](db[_0xcf09('0x48')][_0xcf09('0x2a')]);_0x4b70a6[_0xcf09('0x2e')]=_['keys'](_0x4dcc80[_0xcf09('0x2e')]);_0x4b70a6[_0xcf09('0x30')]=_[_0xcf09('0x31')](_0x4b70a6['model'],_0x4b70a6[_0xcf09('0x2e')]);_0xd45df1[_0xcf09('0x32')]=_[_0xcf09('0x31')](_0x4b70a6[_0xcf09('0x2d')],qs['fields'](_0x4dcc80[_0xcf09('0x2e')][_0xcf09('0x33')]));_0xd45df1[_0xcf09('0x32')]=_0xd45df1[_0xcf09('0x32')][_0xcf09('0x34')]?_0xd45df1[_0xcf09('0x32')]:_0x4b70a6[_0xcf09('0x2d')];_0xd45df1['order']=qs[_0xcf09('0x37')](_0x4dcc80[_0xcf09('0x2e')]['sort']);_0xd45df1['where']=qs[_0xcf09('0x30')](_[_0xcf09('0x38')](_0x4dcc80['query'],_0x4b70a6[_0xcf09('0x30')]));if(_0x4dcc80[_0xcf09('0x2e')][_0xcf09('0x39')]){_0xd45df1['where']=_[_0xcf09('0x3b')](_0xd45df1[_0xcf09('0x3a')],{'$or':_[_0xcf09('0x28')](_0xd45df1['attributes'],function(_0x583010){var _0x2db0c2={};_0x2db0c2[_0x583010]={'$like':'%'+_0x4dcc80[_0xcf09('0x2e')]['filter']+'%'};return _0x2db0c2;})});}_0xd45df1=_[_0xcf09('0x3b')]({},_0xd45df1,_0x4dcc80[_0xcf09('0x3c')]);return _0x43550c['getSubjects'](_0xd45df1);}})[_0xcf09('0x20')](function(_0x341c31){if(_0x341c31){_0x3ddae5=_0x341c31['length'];if(!_0x4dcc80[_0xcf09('0x2e')]['hasOwnProperty'](_0xcf09('0x36'))){_0xd45df1[_0xcf09('0x18')]=qs['limit'](_0x4dcc80['query']['limit']);_0xd45df1[_0xcf09('0x17')]=qs['offset'](_0x4dcc80[_0xcf09('0x2e')][_0xcf09('0x17')]);}return _0x43550c['getSubjects'](_0xd45df1);}})['then'](function(_0x4cca54){if(_0x4cca54){return _0x4cca54?{'count':_0x3ddae5,'rows':_0x4cca54}:null;}})[_0xcf09('0x20')](respondWithResult(_0x5be460,null))[_0xcf09('0x40')](handleError(_0x5be460,null));};exports[_0xcf09('0x4b')]=function(_0x257f33,_0x3ee362,_0x4030dc){var _0x2ad74c={};var _0x18c322={};var _0x3b3850;var _0x12e302;return db[_0xcf09('0x29')][_0xcf09('0x47')]({'where':{'id':_0x257f33['params']['id']}})[_0xcf09('0x20')](handleEntityNotFound(_0x3ee362,null))[_0xcf09('0x20')](function(_0x588686){if(_0x588686){_0x3b3850=_0x588686;_0x18c322[_0xcf09('0x2d')]=_['keys'](db['ZohoField'][_0xcf09('0x2a')]);_0x18c322[_0xcf09('0x2e')]=_['keys'](_0x257f33['query']);_0x18c322[_0xcf09('0x30')]=_['intersection'](_0x18c322['model'],_0x18c322[_0xcf09('0x2e')]);_0x2ad74c[_0xcf09('0x32')]=_[_0xcf09('0x31')](_0x18c322[_0xcf09('0x2d')],qs[_0xcf09('0x33')](_0x257f33[_0xcf09('0x2e')][_0xcf09('0x33')]));_0x2ad74c[_0xcf09('0x32')]=_0x2ad74c[_0xcf09('0x32')][_0xcf09('0x34')]?_0x2ad74c['attributes']:_0x18c322[_0xcf09('0x2d')];_0x2ad74c[_0xcf09('0x49')]=qs[_0xcf09('0x37')](_0x257f33[_0xcf09('0x2e')]['sort']);_0x2ad74c['where']=qs[_0xcf09('0x30')](_[_0xcf09('0x38')](_0x257f33[_0xcf09('0x2e')],_0x18c322['filters']));if(_0x257f33[_0xcf09('0x2e')]['filter']){_0x2ad74c[_0xcf09('0x3a')]=_[_0xcf09('0x3b')](_0x2ad74c['where'],{'$or':_['map'](_0x2ad74c['attributes'],function(_0x2aea9f){var _0x461767={};_0x461767[_0x2aea9f]={'$like':'%'+_0x257f33[_0xcf09('0x2e')]['filter']+'%'};return _0x461767;})});}_0x2ad74c=_['merge']({},_0x2ad74c,_0x257f33[_0xcf09('0x3c')]);return _0x3b3850[_0xcf09('0x4b')](_0x2ad74c);}})[_0xcf09('0x20')](function(_0x2b26cb){if(_0x2b26cb){_0x12e302=_0x2b26cb[_0xcf09('0x34')];if(!_0x257f33[_0xcf09('0x2e')][_0xcf09('0x35')](_0xcf09('0x36'))){_0x2ad74c[_0xcf09('0x18')]=qs[_0xcf09('0x18')](_0x257f33[_0xcf09('0x2e')][_0xcf09('0x18')]);_0x2ad74c[_0xcf09('0x17')]=qs[_0xcf09('0x17')](_0x257f33['query'][_0xcf09('0x17')]);}return _0x3b3850[_0xcf09('0x4b')](_0x2ad74c);}})['then'](function(_0x21aa8e){if(_0x21aa8e){return _0x21aa8e?{'count':_0x12e302,'rows':_0x21aa8e}:null;}})[_0xcf09('0x20')](respondWithResult(_0x3ee362,null))[_0xcf09('0x40')](handleError(_0x3ee362,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index abe55f3..cb2c8f6 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 _0x4ede=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration','lodash','util','../../config/logger','api'];(function(_0x45973a,_0x54a03f){var _0x449ae6=function(_0x111a65){while(--_0x111a65){_0x45973a['push'](_0x45973a['shift']());}};_0x449ae6(++_0x54a03f);}(_0x4ede,0x164));var _0xe4ed=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4ede[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe4ed('0x0'));var util=require(_0xe4ed('0x1'));var logger=require(_0xe4ed('0x2'))(_0xe4ed('0x3'));var moment=require(_0xe4ed('0x4'));var BPromise=require(_0xe4ed('0x5'));var rp=require(_0xe4ed('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4ed('0x7'));var config=require(_0xe4ed('0x8'));var attributes=require(_0xe4ed('0x9'));module['exports']=function(_0x27b599,_0x1b6769){return _0x27b599[_0xe4ed('0xa')](_0xe4ed('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ca4=['../../config/logger','api','moment','bluebird','path','rimraf','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x44a1f5,_0x5afa1b){var _0x4bd059=function(_0x19db32){while(--_0x19db32){_0x44a1f5['push'](_0x44a1f5['shift']());}};_0x4bd059(++_0x5afa1b);}(_0x3ca4,0x107));var _0x43ca=function(_0x469388,_0x57d8d8){_0x469388=_0x469388-0x0;var _0x4da104=_0x3ca4[_0x469388];return _0x4da104;};'use strict';var _=require(_0x43ca('0x0'));var util=require('util');var logger=require(_0x43ca('0x1'))(_0x43ca('0x2'));var moment=require(_0x43ca('0x3'));var BPromise=require(_0x43ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x43ca('0x5'));var rimraf=require(_0x43ca('0x6'));var config=require('../../config/environment');var attributes=require(_0x43ca('0x7'));module[_0x43ca('0x8')]=function(_0x566f65,_0x1047ef){return _0x566f65[_0x43ca('0x9')](_0x43ca('0xa'),attributes,{'tableName':_0x43ca('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 63f6805..cd2a0c8 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 _0x63b9=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x5c9dcb,_0x196ad1){var _0x3fda2e=function(_0x36f244){while(--_0x36f244){_0x5c9dcb['push'](_0x5c9dcb['shift']());}};_0x3fda2e(++_0x196ad1);}(_0x63b9,0x188));var _0x963b=function(_0x434f92,_0x2ec78a){_0x434f92=_0x434f92-0x0;var _0x21bc07=_0x63b9[_0x434f92];return _0x21bc07;};'use strict';var _=require(_0x963b('0x0'));var util=require(_0x963b('0x1'));var moment=require(_0x963b('0x2'));var BPromise=require(_0x963b('0x3'));var rs=require(_0x963b('0x4'));var fs=require('fs');var Redis=require(_0x963b('0x5'));var db=require(_0x963b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x963b('0x7'))(_0x963b('0x8'));var config=require(_0x963b('0x9'));var jayson=require(_0x963b('0xa'));var client=jayson[_0x963b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ba082,_0x44dc41,_0x409002){return new BPromise(function(_0x891c50,_0x1d1a00){return client[_0x963b('0xc')](_0x4ba082,_0x409002)[_0x963b('0xd')](function(_0x38967b){logger['info'](_0x963b('0xe'),_0x44dc41,'request\x20sent');logger['debug'](_0x963b('0xf'),_0x44dc41,'request\x20sent',JSON[_0x963b('0x10')](_0x38967b));if(_0x38967b['error']){if(_0x38967b[_0x963b('0x11')]['code']===0x1f4){logger[_0x963b('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x44dc41,_0x38967b[_0x963b('0x11')][_0x963b('0x12')]);return _0x1d1a00(_0x38967b['error']['message']);}logger[_0x963b('0x11')](_0x963b('0xe'),_0x44dc41,_0x38967b['error'][_0x963b('0x12')]);return _0x891c50(_0x38967b[_0x963b('0x11')][_0x963b('0x12')]);}else{logger[_0x963b('0x13')](_0x963b('0xe'),_0x44dc41,'request\x20sent');_0x891c50(_0x38967b[_0x963b('0x14')][_0x963b('0x12')]);}})[_0x963b('0x15')](function(_0x2c1635){logger[_0x963b('0x11')](_0x963b('0xe'),_0x44dc41,_0x2c1635);_0x1d1a00(_0x2c1635);});});} \ No newline at end of file +var _0xec2d=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xec2d,0x151));var _0xdec2=function(_0x1dd69e,_0x417ebb){_0x1dd69e=_0x1dd69e-0x0;var _0x51e902=_0xec2d[_0x1dd69e];return _0x51e902;};'use strict';var _=require(_0xdec2('0x0'));var util=require(_0xdec2('0x1'));var moment=require(_0xdec2('0x2'));var BPromise=require(_0xdec2('0x3'));var rs=require(_0xdec2('0x4'));var fs=require('fs');var Redis=require(_0xdec2('0x5'));var db=require(_0xdec2('0x6'))['db'];var utils=require(_0xdec2('0x7'));var logger=require(_0xdec2('0x8'))(_0xdec2('0x9'));var config=require(_0xdec2('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdec2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35e44a,_0x36b877,_0x359f11){return new BPromise(function(_0x5ae202,_0x46cf2b){return client[_0xdec2('0xc')](_0x35e44a,_0x359f11)[_0xdec2('0xd')](function(_0x37fe01){logger[_0xdec2('0xe')](_0xdec2('0xf'),_0x36b877,_0xdec2('0x10'));logger[_0xdec2('0x11')](_0xdec2('0x12'),_0x36b877,_0xdec2('0x10'),JSON[_0xdec2('0x13')](_0x37fe01));if(_0x37fe01[_0xdec2('0x14')]){if(_0x37fe01[_0xdec2('0x14')][_0xdec2('0x15')]===0x1f4){logger['error'](_0xdec2('0xf'),_0x36b877,_0x37fe01[_0xdec2('0x14')]['message']);return _0x46cf2b(_0x37fe01[_0xdec2('0x14')]['message']);}logger[_0xdec2('0x14')](_0xdec2('0xf'),_0x36b877,_0x37fe01['error'][_0xdec2('0x16')]);return _0x5ae202(_0x37fe01[_0xdec2('0x14')][_0xdec2('0x16')]);}else{logger[_0xdec2('0xe')](_0xdec2('0xf'),_0x36b877,_0xdec2('0x10'));_0x5ae202(_0x37fe01[_0xdec2('0x17')][_0xdec2('0x16')]);}})['catch'](function(_0x4b25a4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x36b877,_0x4b25a4);_0x46cf2b(_0x4b25a4);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 816f09e..0403f9d 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 _0xc09a=['/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index'];(function(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0xc09a,0x142));var _0xac09=function(_0x5e4bf6,_0x5da109){_0x5e4bf6=_0x5e4bf6-0x0;var _0xdfaa51=_0xc09a[_0x5e4bf6];return _0xdfaa51;};'use strict';var multer=require(_0xac09('0x0'));var util=require(_0xac09('0x1'));var path=require(_0xac09('0x2'));var timeout=require(_0xac09('0x3'));var express=require(_0xac09('0x4'));var router=express[_0xac09('0x5')]();var fs_extra=require(_0xac09('0x6'));var auth=require(_0xac09('0x7'));var interaction=require(_0xac09('0x8'));var config=require(_0xac09('0x9'));var controller=require(_0xac09('0xa'));router[_0xac09('0xb')]('/',auth[_0xac09('0xc')](),controller[_0xac09('0xd')]);router[_0xac09('0xb')](_0xac09('0xe'),auth['isAuthenticated'](),controller[_0xac09('0xf')]);router[_0xac09('0x10')]('/',auth[_0xac09('0xc')](),controller[_0xac09('0x11')]);router[_0xac09('0x12')]('/:id',auth[_0xac09('0xc')](),controller['update']);router[_0xac09('0x13')](_0xac09('0xe'),auth[_0xac09('0xc')](),controller['destroy']);module[_0xac09('0x14')]=router; \ No newline at end of file +var _0x8642=['delete','destroy','util','path','connect-timeout','express','get','isAuthenticated','index','show','put','/:id','update'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8642,0x16e));var _0x2864=function(_0x4b5813,_0x5769de){_0x4b5813=_0x4b5813-0x0;var _0x423465=_0x8642[_0x4b5813];return _0x423465;};'use strict';var multer=require('multer');var util=require(_0x2864('0x0'));var path=require(_0x2864('0x1'));var timeout=require(_0x2864('0x2'));var express=require(_0x2864('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('./intZohoField.controller');router[_0x2864('0x4')]('/',auth[_0x2864('0x5')](),controller[_0x2864('0x6')]);router[_0x2864('0x4')]('/:id',auth[_0x2864('0x5')](),controller[_0x2864('0x7')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2864('0x8')](_0x2864('0x9'),auth['isAuthenticated'](),controller[_0x2864('0xa')]);router[_0x2864('0xb')](_0x2864('0x9'),auth['isAuthenticated'](),controller[_0x2864('0xc')]);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 9933d50..bfe40fd 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 _0x5a4e=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0x5a4e,0x92));var _0xe5a4=function(_0x143ce6,_0x46e089){_0x143ce6=_0x143ce6-0x0;var _0x33ed64=_0x5a4e[_0x143ce6];return _0x33ed64;};'use strict';var Sequelize=require(_0xe5a4('0x0'));module[_0xe5a4('0x1')]={'type':{'type':Sequelize[_0xe5a4('0x2')]('string',_0xe5a4('0x3'),_0xe5a4('0x4'),_0xe5a4('0x5'),'picklist'),'defaultValue':_0xe5a4('0x6')},'content':{'type':Sequelize[_0xe5a4('0x7')]},'key':{'type':Sequelize[_0xe5a4('0x7')]},'keyType':{'type':Sequelize[_0xe5a4('0x2')]('string',_0xe5a4('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe5a4('0x7')]},'nameField':{'type':Sequelize[_0xe5a4('0x7')]},'customField':{'type':Sequelize[_0xe5a4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe5a4('0x7')]}}; \ No newline at end of file +var _0x047b=['sequelize','ENUM','variable','customVariable','picklist','string','STRING','BOOLEAN'];(function(_0x2e5c08,_0x59ea41){var _0x752a75=function(_0x147539){while(--_0x147539){_0x2e5c08['push'](_0x2e5c08['shift']());}};_0x752a75(++_0x59ea41);}(_0x047b,0x138));var _0xb047=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0x047b[_0x273dc5];return _0x46dae7;};'use strict';var Sequelize=require(_0xb047('0x0'));module['exports']={'type':{'type':Sequelize[_0xb047('0x1')]('string',_0xb047('0x2'),_0xb047('0x3'),'keyValue',_0xb047('0x4')),'defaultValue':_0xb047('0x5')},'content':{'type':Sequelize[_0xb047('0x6')]},'key':{'type':Sequelize[_0xb047('0x6')]},'keyType':{'type':Sequelize[_0xb047('0x1')](_0xb047('0x5'),'variable',_0xb047('0x3'))},'keyContent':{'type':Sequelize[_0xb047('0x6')]},'idField':{'type':Sequelize[_0xb047('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb047('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index dc5f428..ecf74ab 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 _0xaadd=['where','filters','pick','filter','merge','type','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','show','length','find','catch','create','body','params','destroy','eml-format','rimraf','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort'];(function(_0x16ebbf,_0x429317){var _0x48d0d3=function(_0xa281a5){while(--_0xa281a5){_0x16ebbf['push'](_0x16ebbf['shift']());}};_0x48d0d3(++_0x429317);}(_0xaadd,0x19b));var _0xdaad=function(_0x4d872d,_0x213953){_0x4d872d=_0x4d872d-0x0;var _0x432582=_0xaadd[_0x4d872d];return _0x432582;};'use strict';var emlformat=require(_0xdaad('0x0'));var rimraf=require(_0xdaad('0x1'));var zipdir=require(_0xdaad('0x2'));var jsonpatch=require(_0xdaad('0x3'));var rp=require(_0xdaad('0x4'));var moment=require(_0xdaad('0x5'));var BPromise=require(_0xdaad('0x6'));var Mustache=require(_0xdaad('0x7'));var util=require('util');var path=require(_0xdaad('0x8'));var sox=require(_0xdaad('0x9'));var csv=require(_0xdaad('0xa'));var ejs=require(_0xdaad('0xb'));var fs=require('fs');var fs_extra=require(_0xdaad('0xc'));var _=require('lodash');var squel=require(_0xdaad('0xd'));var crypto=require(_0xdaad('0xe'));var jsforce=require(_0xdaad('0xf'));var deskjs=require(_0xdaad('0x10'));var toCsv=require(_0xdaad('0xa'));var querystring=require(_0xdaad('0x11'));var Papa=require(_0xdaad('0x12'));var Redis=require(_0xdaad('0x13'));var authService=require(_0xdaad('0x14'));var qs=require(_0xdaad('0x15'));var as=require(_0xdaad('0x16'));var hardwareService=require(_0xdaad('0x17'));var logger=require('../../config/logger')(_0xdaad('0x18'));var utils=require('../../config/utils');var config=require(_0xdaad('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xdaad('0x1a'))['db'];function respondWithStatusCode(_0x5f313e,_0x28d373){_0x28d373=_0x28d373||0xcc;return function(_0x4c1eaa){if(_0x4c1eaa){return _0x5f313e[_0xdaad('0x1b')](_0x28d373);}return _0x5f313e[_0xdaad('0x1c')](_0x28d373)[_0xdaad('0x1d')]();};}function respondWithResult(_0x2942cf,_0x173af0){_0x173af0=_0x173af0||0xc8;return function(_0x3b968e){if(_0x3b968e){return _0x2942cf[_0xdaad('0x1c')](_0x173af0)[_0xdaad('0x1e')](_0x3b968e);}};}function respondWithFilteredResult(_0x10ca7b,_0x565db8){return function(_0x4b527f){if(_0x4b527f){var _0x3ea4dc=typeof _0x565db8[_0xdaad('0x1f')]===_0xdaad('0x20')&&typeof _0x565db8[_0xdaad('0x21')]===_0xdaad('0x20');var _0x2c95bf=_0x4b527f[_0xdaad('0x22')];var _0x5ba570=_0x3ea4dc?0x0:_0x565db8[_0xdaad('0x1f')];var _0x28e5d4=_0x3ea4dc?_0x4b527f[_0xdaad('0x22')]:_0x565db8[_0xdaad('0x1f')]+_0x565db8[_0xdaad('0x21')];var _0x157fda;if(_0x28e5d4>=_0x2c95bf){_0x28e5d4=_0x2c95bf;_0x157fda=0xc8;}else{_0x157fda=0xce;}_0x10ca7b[_0xdaad('0x1c')](_0x157fda);return _0x10ca7b['set'](_0xdaad('0x23'),_0x5ba570+'-'+_0x28e5d4+'/'+_0x2c95bf)['json'](_0x4b527f);}return null;};}function patchUpdates(_0x1d68cd){return function(_0x27edff){try{jsonpatch[_0xdaad('0x24')](_0x27edff,_0x1d68cd,!![]);}catch(_0x252bf2){return BPromise['reject'](_0x252bf2);}return _0x27edff[_0xdaad('0x25')]();};}function saveUpdates(_0x47778,_0x445c78){return function(_0x1775e6){if(_0x1775e6){return _0x1775e6[_0xdaad('0x26')](_0x47778)[_0xdaad('0x27')](function(_0x189f1d){return _0x189f1d;});}return null;};}function removeEntity(_0x548302,_0x214045){return function(_0x5dbcfb){if(_0x5dbcfb){return _0x5dbcfb['destroy']()[_0xdaad('0x27')](function(){_0x548302[_0xdaad('0x1c')](0xcc)[_0xdaad('0x1d')]();});}};}function handleEntityNotFound(_0x4e021b,_0x31cdd8){return function(_0x3b265a){if(!_0x3b265a){_0x4e021b[_0xdaad('0x1b')](0x194);}return _0x3b265a;};}function handleError(_0x2eb40c,_0x4eb9cd){_0x4eb9cd=_0x4eb9cd||0x1f4;return function(_0x209941){logger[_0xdaad('0x28')](_0x209941[_0xdaad('0x29')]);if(_0x209941[_0xdaad('0x2a')]){delete _0x209941[_0xdaad('0x2a')];}_0x2eb40c['status'](_0x4eb9cd)['send'](_0x209941);};}exports[_0xdaad('0x2b')]=function(_0x13ae73,_0x3914c9){var _0x489870={},_0x518fac={},_0x2ab040={'count':0x0,'rows':[]};var _0x4ae884=_[_0xdaad('0x2c')](db['ZohoField'][_0xdaad('0x2d')],function(_0x137b9b){return{'name':_0x137b9b[_0xdaad('0x2e')],'type':_0x137b9b['type'][_0xdaad('0x2f')]};});_0x518fac[_0xdaad('0x30')]=_[_0xdaad('0x2c')](_0x4ae884,_0xdaad('0x2a'));_0x518fac[_0xdaad('0x31')]=_[_0xdaad('0x32')](_0x13ae73[_0xdaad('0x31')]);_0x518fac['filters']=_[_0xdaad('0x33')](_0x518fac[_0xdaad('0x30')],_0x518fac[_0xdaad('0x31')]);_0x489870[_0xdaad('0x34')]=_['intersection'](_0x518fac[_0xdaad('0x30')],qs[_0xdaad('0x35')](_0x13ae73[_0xdaad('0x31')]['fields']));_0x489870[_0xdaad('0x34')]=_0x489870[_0xdaad('0x34')]['length']?_0x489870[_0xdaad('0x34')]:_0x518fac[_0xdaad('0x30')];if(!_0x13ae73[_0xdaad('0x31')][_0xdaad('0x36')]('nolimit')){_0x489870[_0xdaad('0x21')]=qs[_0xdaad('0x21')](_0x13ae73[_0xdaad('0x31')][_0xdaad('0x21')]);_0x489870[_0xdaad('0x1f')]=qs[_0xdaad('0x1f')](_0x13ae73[_0xdaad('0x31')][_0xdaad('0x1f')]);}_0x489870[_0xdaad('0x37')]=qs[_0xdaad('0x38')](_0x13ae73['query'][_0xdaad('0x38')]);_0x489870[_0xdaad('0x39')]=qs[_0xdaad('0x3a')](_[_0xdaad('0x3b')](_0x13ae73[_0xdaad('0x31')],_0x518fac['filters']),_0x4ae884);if(_0x13ae73[_0xdaad('0x31')][_0xdaad('0x3c')]){_0x489870[_0xdaad('0x39')]=_[_0xdaad('0x3d')](_0x489870[_0xdaad('0x39')],{'$or':_['map'](_0x4ae884,function(_0x172119){if(_0x172119[_0xdaad('0x3e')]!==_0xdaad('0x3f')){var _0x242493={};_0x242493[_0x172119[_0xdaad('0x2a')]]={'$like':'%'+_0x13ae73[_0xdaad('0x31')]['filter']+'%'};return _0x242493;}})});}_0x489870=_[_0xdaad('0x3d')]({},_0x489870,_0x13ae73[_0xdaad('0x40')]);var _0x382a67={'where':_0x489870[_0xdaad('0x39')]};return db[_0xdaad('0x41')][_0xdaad('0x22')](_0x382a67)['then'](function(_0x4b5268){_0x2ab040[_0xdaad('0x22')]=_0x4b5268;if(_0x13ae73[_0xdaad('0x31')][_0xdaad('0x42')]){_0x489870[_0xdaad('0x43')]=[{'all':!![]}];}return db['ZohoField'][_0xdaad('0x44')](_0x489870);})[_0xdaad('0x27')](function(_0x429f2e){_0x2ab040[_0xdaad('0x45')]=_0x429f2e;return _0x2ab040;})[_0xdaad('0x27')](respondWithFilteredResult(_0x3914c9,_0x489870))['catch'](handleError(_0x3914c9,null));};exports[_0xdaad('0x46')]=function(_0x33e53a,_0x360fcf){var _0x50f958={'raw':!![],'where':{'id':_0x33e53a['params']['id']}},_0x1b8251={};_0x1b8251[_0xdaad('0x30')]=_[_0xdaad('0x32')](db['ZohoField']['rawAttributes']);_0x1b8251[_0xdaad('0x31')]=_[_0xdaad('0x32')](_0x33e53a[_0xdaad('0x31')]);_0x1b8251[_0xdaad('0x3a')]=_['intersection'](_0x1b8251[_0xdaad('0x30')],_0x1b8251['query']);_0x50f958[_0xdaad('0x34')]=_[_0xdaad('0x33')](_0x1b8251[_0xdaad('0x30')],qs[_0xdaad('0x35')](_0x33e53a['query']['fields']));_0x50f958[_0xdaad('0x34')]=_0x50f958['attributes'][_0xdaad('0x47')]?_0x50f958['attributes']:_0x1b8251[_0xdaad('0x30')];if(_0x33e53a['query'][_0xdaad('0x42')]){_0x50f958['include']=[{'all':!![]}];}_0x50f958=_['merge']({},_0x50f958,_0x33e53a[_0xdaad('0x40')]);return db['ZohoField'][_0xdaad('0x48')](_0x50f958)['then'](handleEntityNotFound(_0x360fcf,null))['then'](respondWithResult(_0x360fcf,null))[_0xdaad('0x49')](handleError(_0x360fcf,null));};exports['create']=function(_0x24f2cd,_0xee95ee){return db[_0xdaad('0x41')][_0xdaad('0x4a')](_0x24f2cd['body'],{})[_0xdaad('0x27')](respondWithResult(_0xee95ee,0xc9))['catch'](handleError(_0xee95ee,null));};exports['update']=function(_0x459df0,_0x5571aa){if(_0x459df0[_0xdaad('0x4b')]['id']){delete _0x459df0[_0xdaad('0x4b')]['id'];}return db[_0xdaad('0x41')][_0xdaad('0x48')]({'where':{'id':_0x459df0[_0xdaad('0x4c')]['id']}})[_0xdaad('0x27')](handleEntityNotFound(_0x5571aa,null))['then'](saveUpdates(_0x459df0[_0xdaad('0x4b')],null))['then'](respondWithResult(_0x5571aa,null))[_0xdaad('0x49')](handleError(_0x5571aa,null));};exports[_0xdaad('0x4d')]=function(_0x32a215,_0x2bf96a){return db[_0xdaad('0x41')][_0xdaad('0x48')]({'where':{'id':_0x32a215[_0xdaad('0x4c')]['id']}})[_0xdaad('0x27')](handleEntityNotFound(_0x2bf96a,null))[_0xdaad('0x27')](removeEntity(_0x2bf96a,null))[_0xdaad('0x49')](handleError(_0x2bf96a,null));}; \ No newline at end of file +var _0x1c62=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','map','VIRTUAL','options','includeAll','include','ZohoField','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','type','model','query','keys','filters'];(function(_0xfd2dd2,_0x41e8d6){var _0x3f28f1=function(_0x563b97){while(--_0x563b97){_0xfd2dd2['push'](_0xfd2dd2['shift']());}};_0x3f28f1(++_0x41e8d6);}(_0x1c62,0x66));var _0x21c6=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x1c62[_0x3070dc];return _0x431489;};'use strict';var emlformat=require(_0x21c6('0x0'));var rimraf=require(_0x21c6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21c6('0x2'));var rp=require(_0x21c6('0x3'));var moment=require(_0x21c6('0x4'));var BPromise=require(_0x21c6('0x5'));var Mustache=require(_0x21c6('0x6'));var util=require(_0x21c6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x21c6('0x8'));var ejs=require(_0x21c6('0x9'));var fs=require('fs');var fs_extra=require(_0x21c6('0xa'));var _=require(_0x21c6('0xb'));var squel=require(_0x21c6('0xc'));var crypto=require(_0x21c6('0xd'));var jsforce=require(_0x21c6('0xe'));var deskjs=require(_0x21c6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x21c6('0x10'));var Papa=require(_0x21c6('0x11'));var Redis=require(_0x21c6('0x12'));var authService=require(_0x21c6('0x13'));var qs=require(_0x21c6('0x14'));var as=require(_0x21c6('0x15'));var hardwareService=require(_0x21c6('0x16'));var logger=require(_0x21c6('0x17'))(_0x21c6('0x18'));var utils=require(_0x21c6('0x19'));var config=require(_0x21c6('0x1a'));var licenseUtil=require(_0x21c6('0x1b'));var db=require(_0x21c6('0x1c'))['db'];function respondWithStatusCode(_0x222378,_0x2f541d){_0x2f541d=_0x2f541d||0xcc;return function(_0x19be80){if(_0x19be80){return _0x222378['sendStatus'](_0x2f541d);}return _0x222378[_0x21c6('0x1d')](_0x2f541d)[_0x21c6('0x1e')]();};}function respondWithResult(_0x2f52e9,_0x5c1e59){_0x5c1e59=_0x5c1e59||0xc8;return function(_0x4ebeaa){if(_0x4ebeaa){return _0x2f52e9[_0x21c6('0x1d')](_0x5c1e59)[_0x21c6('0x1f')](_0x4ebeaa);}};}function respondWithFilteredResult(_0x521aaa,_0x2744ca){return function(_0x328b36){if(_0x328b36){var _0x413e55=typeof _0x2744ca['offset']===_0x21c6('0x20')&&typeof _0x2744ca[_0x21c6('0x21')]==='undefined';var _0xeb68b5=_0x328b36['count'];var _0x29ef61=_0x413e55?0x0:_0x2744ca['offset'];var _0x1aaa26=_0x413e55?_0x328b36[_0x21c6('0x22')]:_0x2744ca[_0x21c6('0x23')]+_0x2744ca[_0x21c6('0x21')];var _0x53337c;if(_0x1aaa26>=_0xeb68b5){_0x1aaa26=_0xeb68b5;_0x53337c=0xc8;}else{_0x53337c=0xce;}_0x521aaa['status'](_0x53337c);return _0x521aaa[_0x21c6('0x24')]('Content-Range',_0x29ef61+'-'+_0x1aaa26+'/'+_0xeb68b5)[_0x21c6('0x1f')](_0x328b36);}return null;};}function patchUpdates(_0xddede5){return function(_0x32b5a9){try{jsonpatch[_0x21c6('0x25')](_0x32b5a9,_0xddede5,!![]);}catch(_0xa56bed){return BPromise[_0x21c6('0x26')](_0xa56bed);}return _0x32b5a9[_0x21c6('0x27')]();};}function saveUpdates(_0x141fc4,_0xdda430){return function(_0x401e6c){if(_0x401e6c){return _0x401e6c[_0x21c6('0x28')](_0x141fc4)[_0x21c6('0x29')](function(_0x4b1519){return _0x4b1519;});}return null;};}function removeEntity(_0x13e4f0,_0x37fc1f){return function(_0x3aaedc){if(_0x3aaedc){return _0x3aaedc[_0x21c6('0x2a')]()[_0x21c6('0x29')](function(){_0x13e4f0[_0x21c6('0x1d')](0xcc)[_0x21c6('0x1e')]();});}};}function handleEntityNotFound(_0x243a08,_0x5706bd){return function(_0x210bf5){if(!_0x210bf5){_0x243a08[_0x21c6('0x2b')](0x194);}return _0x210bf5;};}function handleError(_0x2f4164,_0x4df399){_0x4df399=_0x4df399||0x1f4;return function(_0xfe6d8b){logger[_0x21c6('0x2c')](_0xfe6d8b[_0x21c6('0x2d')]);if(_0xfe6d8b[_0x21c6('0x2e')]){delete _0xfe6d8b[_0x21c6('0x2e')];}_0x2f4164['status'](_0x4df399)['send'](_0xfe6d8b);};}exports[_0x21c6('0x2f')]=function(_0x2a6ddb,_0x4350d5){var _0x4fb15d={},_0xb8571={},_0x161ee6={'count':0x0,'rows':[]};var _0x8a8bd3=_['map'](db['ZohoField'][_0x21c6('0x30')],function(_0x2491ba){return{'name':_0x2491ba['fieldName'],'type':_0x2491ba[_0x21c6('0x31')]['key']};});_0xb8571[_0x21c6('0x32')]=_['map'](_0x8a8bd3,'name');_0xb8571[_0x21c6('0x33')]=_[_0x21c6('0x34')](_0x2a6ddb['query']);_0xb8571[_0x21c6('0x35')]=_[_0x21c6('0x36')](_0xb8571[_0x21c6('0x32')],_0xb8571[_0x21c6('0x33')]);_0x4fb15d[_0x21c6('0x37')]=_[_0x21c6('0x36')](_0xb8571[_0x21c6('0x32')],qs['fields'](_0x2a6ddb[_0x21c6('0x33')][_0x21c6('0x38')]));_0x4fb15d[_0x21c6('0x37')]=_0x4fb15d['attributes']['length']?_0x4fb15d[_0x21c6('0x37')]:_0xb8571[_0x21c6('0x32')];if(!_0x2a6ddb[_0x21c6('0x33')][_0x21c6('0x39')](_0x21c6('0x3a'))){_0x4fb15d[_0x21c6('0x21')]=qs['limit'](_0x2a6ddb['query'][_0x21c6('0x21')]);_0x4fb15d[_0x21c6('0x23')]=qs[_0x21c6('0x23')](_0x2a6ddb[_0x21c6('0x33')]['offset']);}_0x4fb15d[_0x21c6('0x3b')]=qs[_0x21c6('0x3c')](_0x2a6ddb[_0x21c6('0x33')][_0x21c6('0x3c')]);_0x4fb15d[_0x21c6('0x3d')]=qs[_0x21c6('0x35')](_['pick'](_0x2a6ddb[_0x21c6('0x33')],_0xb8571[_0x21c6('0x35')]),_0x8a8bd3);if(_0x2a6ddb['query']['filter']){_0x4fb15d[_0x21c6('0x3d')]=_[_0x21c6('0x3e')](_0x4fb15d['where'],{'$or':_[_0x21c6('0x3f')](_0x8a8bd3,function(_0x43e28e){if(_0x43e28e[_0x21c6('0x31')]!==_0x21c6('0x40')){var _0x2b2e3c={};_0x2b2e3c[_0x43e28e[_0x21c6('0x2e')]]={'$like':'%'+_0x2a6ddb[_0x21c6('0x33')]['filter']+'%'};return _0x2b2e3c;}})});}_0x4fb15d=_[_0x21c6('0x3e')]({},_0x4fb15d,_0x2a6ddb[_0x21c6('0x41')]);var _0x2496e4={'where':_0x4fb15d[_0x21c6('0x3d')]};return db['ZohoField']['count'](_0x2496e4)[_0x21c6('0x29')](function(_0x7de889){_0x161ee6[_0x21c6('0x22')]=_0x7de889;if(_0x2a6ddb['query'][_0x21c6('0x42')]){_0x4fb15d[_0x21c6('0x43')]=[{'all':!![]}];}return db[_0x21c6('0x44')][_0x21c6('0x45')](_0x4fb15d);})[_0x21c6('0x29')](function(_0x120cc0){_0x161ee6[_0x21c6('0x46')]=_0x120cc0;return _0x161ee6;})['then'](respondWithFilteredResult(_0x4350d5,_0x4fb15d))[_0x21c6('0x47')](handleError(_0x4350d5,null));};exports[_0x21c6('0x48')]=function(_0x2618ef,_0x1f17a7){var _0x1e169f={'raw':!![],'where':{'id':_0x2618ef[_0x21c6('0x49')]['id']}},_0x202c29={};_0x202c29[_0x21c6('0x32')]=_[_0x21c6('0x34')](db[_0x21c6('0x44')][_0x21c6('0x30')]);_0x202c29['query']=_[_0x21c6('0x34')](_0x2618ef['query']);_0x202c29[_0x21c6('0x35')]=_[_0x21c6('0x36')](_0x202c29[_0x21c6('0x32')],_0x202c29['query']);_0x1e169f[_0x21c6('0x37')]=_[_0x21c6('0x36')](_0x202c29[_0x21c6('0x32')],qs[_0x21c6('0x38')](_0x2618ef[_0x21c6('0x33')][_0x21c6('0x38')]));_0x1e169f[_0x21c6('0x37')]=_0x1e169f['attributes'][_0x21c6('0x4a')]?_0x1e169f[_0x21c6('0x37')]:_0x202c29[_0x21c6('0x32')];if(_0x2618ef[_0x21c6('0x33')][_0x21c6('0x42')]){_0x1e169f['include']=[{'all':!![]}];}_0x1e169f=_[_0x21c6('0x3e')]({},_0x1e169f,_0x2618ef['options']);return db[_0x21c6('0x44')][_0x21c6('0x4b')](_0x1e169f)['then'](handleEntityNotFound(_0x1f17a7,null))[_0x21c6('0x29')](respondWithResult(_0x1f17a7,null))[_0x21c6('0x47')](handleError(_0x1f17a7,null));};exports['create']=function(_0x3608cb,_0x222072){return db[_0x21c6('0x44')][_0x21c6('0x4c')](_0x3608cb[_0x21c6('0x4d')],{})[_0x21c6('0x29')](respondWithResult(_0x222072,0xc9))[_0x21c6('0x47')](handleError(_0x222072,null));};exports['update']=function(_0x3774b7,_0x2a903d){if(_0x3774b7[_0x21c6('0x4d')]['id']){delete _0x3774b7[_0x21c6('0x4d')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x3774b7[_0x21c6('0x49')]['id']}})[_0x21c6('0x29')](handleEntityNotFound(_0x2a903d,null))['then'](saveUpdates(_0x3774b7[_0x21c6('0x4d')],null))[_0x21c6('0x29')](respondWithResult(_0x2a903d,null))[_0x21c6('0x47')](handleError(_0x2a903d,null));};exports['destroy']=function(_0x5990c2,_0xdcd723){return db['ZohoField'][_0x21c6('0x4b')]({'where':{'id':_0x5990c2['params']['id']}})[_0x21c6('0x29')](handleEntityNotFound(_0xdcd723,null))['then'](removeEntity(_0xdcd723,null))[_0x21c6('0x47')](handleError(_0xdcd723,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index fa57f5a..17a6fdb 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 _0xb145=['api','moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x5355b3,_0x2f1e18){var _0x1dbf46=function(_0x2139fe){while(--_0x2139fe){_0x5355b3['push'](_0x5355b3['shift']());}};_0x1dbf46(++_0x2f1e18);}(_0xb145,0xa3));var _0x5b14=function(_0x31d1c0,_0x2fba60){_0x31d1c0=_0x31d1c0-0x0;var _0x5a9e43=_0xb145[_0x31d1c0];return _0x5a9e43;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var logger=require(_0x5b14('0x1'))(_0x5b14('0x2'));var moment=require(_0x5b14('0x3'));var BPromise=require(_0x5b14('0x4'));var rp=require(_0x5b14('0x5'));var fs=require('fs');var path=require(_0x5b14('0x6'));var rimraf=require(_0x5b14('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b14('0x8'));module[_0x5b14('0x9')]=function(_0x392425,_0x4d82ad){return _0x392425['define'](_0x5b14('0xa'),attributes,{'tableName':_0x5b14('0xb'),'paranoid':![],'indexes':[{'name':_0x5b14('0xc'),'fields':[_0x5b14('0xd'),_0x5b14('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x27a0=['../../config/logger','api','moment','bluebird','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','FieldId','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x27a0,0xbf));var _0x027a=function(_0x52e2b8,_0x1da67d){_0x52e2b8=_0x52e2b8-0x0;var _0x517ef7=_0x27a0[_0x52e2b8];return _0x517ef7;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var logger=require(_0x027a('0x1'))(_0x027a('0x2'));var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('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(_0x027a('0x5'));module[_0x027a('0x6')]=function(_0x137b09,_0x639bec){return _0x137b09[_0x027a('0x7')](_0x027a('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x027a('0x9'),'fields':[_0x027a('0xa'),_0x027a('0xb')],'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 73c24e3..270800e 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 _0xc5cc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZohoField,\x20%s,\x20%s','message','result','lodash'];(function(_0x287bbe,_0x27739d){var _0x4c734b=function(_0x233f3f){while(--_0x233f3f){_0x287bbe['push'](_0x287bbe['shift']());}};_0x4c734b(++_0x27739d);}(_0xc5cc,0xbf));var _0xcc5c=function(_0x34018f,_0x27a4ea){_0x34018f=_0x34018f-0x0;var _0x37c030=_0xc5cc[_0x34018f];return _0x37c030;};'use strict';var _=require(_0xcc5c('0x0'));var util=require(_0xcc5c('0x1'));var moment=require(_0xcc5c('0x2'));var BPromise=require(_0xcc5c('0x3'));var rs=require(_0xcc5c('0x4'));var fs=require('fs');var Redis=require(_0xcc5c('0x5'));var db=require(_0xcc5c('0x6'))['db'];var utils=require(_0xcc5c('0x7'));var logger=require(_0xcc5c('0x8'))(_0xcc5c('0x9'));var config=require('../../config/environment');var jayson=require(_0xcc5c('0xa'));var client=jayson[_0xcc5c('0xb')][_0xcc5c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c5b2d,_0x5c0be9,_0x17fe67){return new BPromise(function(_0x44c7e3,_0xd668ae){return client[_0xcc5c('0xd')](_0x3c5b2d,_0x17fe67)[_0xcc5c('0xe')](function(_0x12ef35){logger[_0xcc5c('0xf')]('ZohoField,\x20%s,\x20%s',_0x5c0be9,'request\x20sent');logger[_0xcc5c('0x10')](_0xcc5c('0x11'),_0x5c0be9,_0xcc5c('0x12'),JSON['stringify'](_0x12ef35));if(_0x12ef35[_0xcc5c('0x13')]){if(_0x12ef35['error'][_0xcc5c('0x14')]===0x1f4){logger[_0xcc5c('0x13')](_0xcc5c('0x15'),_0x5c0be9,_0x12ef35[_0xcc5c('0x13')]['message']);return _0xd668ae(_0x12ef35[_0xcc5c('0x13')][_0xcc5c('0x16')]);}logger[_0xcc5c('0x13')](_0xcc5c('0x15'),_0x5c0be9,_0x12ef35[_0xcc5c('0x13')][_0xcc5c('0x16')]);return _0x44c7e3(_0x12ef35[_0xcc5c('0x13')]['message']);}else{logger[_0xcc5c('0xf')](_0xcc5c('0x15'),_0x5c0be9,_0xcc5c('0x12'));_0x44c7e3(_0x12ef35[_0xcc5c('0x17')][_0xcc5c('0x16')]);}})['catch'](function(_0x583232){logger[_0xcc5c('0x13')](_0xcc5c('0x15'),_0x5c0be9,_0x583232);_0xd668ae(_0x583232);});});} \ No newline at end of file +var _0xc455=['ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x17ae1c,_0x46598f){var _0x4dbc63=function(_0x223425){while(--_0x223425){_0x17ae1c['push'](_0x17ae1c['shift']());}};_0x4dbc63(++_0x46598f);}(_0xc455,0x17a));var _0x5c45=function(_0x6c5856,_0x1b2899){_0x6c5856=_0x6c5856-0x0;var _0x46c6f0=_0xc455[_0x6c5856];return _0x46c6f0;};'use strict';var _=require(_0x5c45('0x0'));var util=require(_0x5c45('0x1'));var moment=require(_0x5c45('0x2'));var BPromise=require(_0x5c45('0x3'));var rs=require(_0x5c45('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c45('0x5'));var logger=require(_0x5c45('0x6'))(_0x5c45('0x7'));var config=require(_0x5c45('0x8'));var jayson=require(_0x5c45('0x9'));var client=jayson['client'][_0x5c45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x454f66,_0x99396c,_0x37dac4){return new BPromise(function(_0x72951,_0xfcf9e1){return client[_0x5c45('0xb')](_0x454f66,_0x37dac4)[_0x5c45('0xc')](function(_0x5ac057){logger['info'](_0x5c45('0xd'),_0x99396c,_0x5c45('0xe'));logger[_0x5c45('0xf')](_0x5c45('0x10'),_0x99396c,_0x5c45('0xe'),JSON[_0x5c45('0x11')](_0x5ac057));if(_0x5ac057[_0x5c45('0x12')]){if(_0x5ac057[_0x5c45('0x12')][_0x5c45('0x13')]===0x1f4){logger['error'](_0x5c45('0xd'),_0x99396c,_0x5ac057['error']['message']);return _0xfcf9e1(_0x5ac057[_0x5c45('0x12')][_0x5c45('0x14')]);}logger[_0x5c45('0x12')]('ZohoField,\x20%s,\x20%s',_0x99396c,_0x5ac057[_0x5c45('0x12')][_0x5c45('0x14')]);return _0x72951(_0x5ac057[_0x5c45('0x12')][_0x5c45('0x14')]);}else{logger[_0x5c45('0x15')](_0x5c45('0xd'),_0x99396c,_0x5c45('0xe'));_0x72951(_0x5ac057['result'][_0x5c45('0x14')]);}})[_0x5c45('0x16')](function(_0x280655){logger[_0x5c45('0x12')](_0x5c45('0xd'),_0x99396c,_0x280655);_0xfcf9e1(_0x280655);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 507e54f..270f0ea 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3be7ce,_0x46aba1){var _0x25612b=function(_0x20fa27){while(--_0x20fa27){_0x3be7ce['push'](_0x3be7ce['shift']());}};_0x25612b(++_0x46aba1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x54a229,_0x479dd1){var _0x36232e=function(_0x48a4d3){while(--_0x48a4d3){_0x54a229['push'](_0x54a229['shift']());}};_0x36232e(++_0x479dd1);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index e340d8a..f0723cb 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 _0xca77=['state','exports','STRING','app.js','BOOLEAN'];(function(_0x3bd1fd,_0x1472ce){var _0x28ea80=function(_0x2222fa){while(--_0x2222fa){_0x3bd1fd['push'](_0x3bd1fd['shift']());}};_0x28ea80(++_0x1472ce);}(_0xca77,0x164));var _0x7ca7=function(_0x1a6231,_0x50922f){_0x1a6231=_0x1a6231-0x0;var _0x2be5a4=_0xca77[_0x1a6231];return _0x2be5a4;};'use strict';var Sequelize=require('sequelize');module[_0x7ca7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x7ca7('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x7ca7('0x1')],'defaultValue':_0x7ca7('0x2')},'filename':{'type':Sequelize[_0x7ca7('0x1')]},'path':{'type':Sequelize[_0x7ca7('0x1')]},'type':{'type':Sequelize[_0x7ca7('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x7ca7('0x3')],'defaultValue':![]},'author':{'type':Sequelize[_0x7ca7('0x1')]},'logo':{'type':Sequelize[_0x7ca7('0x1')]},'state':{'type':Sequelize[_0x7ca7('0x1')],'unique':_0x7ca7('0x4')},'description':{'type':Sequelize[_0x7ca7('0x1')]},'title':{'type':Sequelize[_0x7ca7('0x1')]},'remoteUri':{'type':Sequelize[_0x7ca7('0x1')]},'link':{'type':Sequelize[_0x7ca7('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xb6e4=['exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize'];(function(_0x53ccfd,_0x111f53){var _0x34e731=function(_0x3fe5c9){while(--_0x3fe5c9){_0x53ccfd['push'](_0x53ccfd['shift']());}};_0x34e731(++_0x111f53);}(_0xb6e4,0x117));var _0x4b6e=function(_0x4b23eb,_0x1ca954){_0x4b23eb=_0x4b23eb-0x0;var _0x3538d9=_0xb6e4[_0x4b23eb];return _0x3538d9;};'use strict';var Sequelize=require(_0x4b6e('0x0'));module[_0x4b6e('0x1')]={'name':{'type':Sequelize[_0x4b6e('0x2')],'allowNull':![],'unique':_0x4b6e('0x3')},'version':{'type':Sequelize[_0x4b6e('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x4b6e('0x2')],'defaultValue':_0x4b6e('0x4')},'filename':{'type':Sequelize[_0x4b6e('0x2')]},'path':{'type':Sequelize[_0x4b6e('0x2')]},'type':{'type':Sequelize[_0x4b6e('0x2')]},'size':{'type':Sequelize[_0x4b6e('0x5')]},'active':{'type':Sequelize[_0x4b6e('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x4b6e('0x2')]},'state':{'type':Sequelize[_0x4b6e('0x2')],'unique':_0x4b6e('0x7')},'description':{'type':Sequelize[_0x4b6e('0x2')]},'title':{'type':Sequelize[_0x4b6e('0x2')]},'remoteUri':{'type':Sequelize[_0x4b6e('0x2')]},'link':{'type':Sequelize[_0x4b6e('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 66c30a2..383905c 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 _0xafc4=['reject','save','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','Integration','includeAll','catch','show','params','create','body','find','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'];(function(_0x3662a7,_0x26d471){var _0x362ca2=function(_0x50f244){while(--_0x50f244){_0x3662a7['push'](_0x3662a7['shift']());}};_0x362ca2(++_0x26d471);}(_0xafc4,0x69));var _0x4afc=function(_0x72c41,_0x26d48c){_0x72c41=_0x72c41-0x0;var _0x2140f2=_0xafc4[_0x72c41];return _0x2140f2;};'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['Integration'][_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['Integration']['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['Integration']['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));}; \ No newline at end of file +var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Integration','includeAll','rows','catch','show'];(function(_0x48d99d,_0x1e297b){var _0x18b0a6=function(_0x5ed053){while(--_0x5ed053){_0x48d99d['push'](_0x48d99d['shift']());}};_0x18b0a6(++_0x1e297b);}(_0x0295,0x1f0));var _0x5029=function(_0x5a5113,_0x1c008b){_0x5a5113=_0x5a5113-0x0;var _0x16a596=_0x0295[_0x5a5113];return _0x16a596;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['Integration'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['Integration'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 281cd72..3ea18d4 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 _0x083b=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','Integration','integrations','lodash'];(function(_0x474124,_0xbee1cd){var _0x4527b3=function(_0x43195f){while(--_0x43195f){_0x474124['push'](_0x474124['shift']());}};_0x4527b3(++_0xbee1cd);}(_0x083b,0x1eb));var _0xb083=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0x083b[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0xb083('0x0'));var util=require(_0xb083('0x1'));var logger=require(_0xb083('0x2'))('api');var moment=require(_0xb083('0x3'));var BPromise=require('bluebird');var rp=require(_0xb083('0x4'));var fs=require('fs');var path=require(_0xb083('0x5'));var rimraf=require(_0xb083('0x6'));var config=require(_0xb083('0x7'));var attributes=require(_0xb083('0x8'));module[_0xb083('0x9')]=function(_0x2909ea,_0x2a870f){return _0x2909ea['define'](_0xb083('0xa'),attributes,{'tableName':_0xb083('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe975=['exports','Integration','integrations','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0xe975,0xe9));var _0x5e97=function(_0x161d59,_0x14d946){_0x161d59=_0x161d59-0x0;var _0x593a7e=_0xe975[_0x161d59];return _0x593a7e;};'use strict';var _=require(_0x5e97('0x0'));var util=require('util');var logger=require(_0x5e97('0x1'))(_0x5e97('0x2'));var moment=require(_0x5e97('0x3'));var BPromise=require(_0x5e97('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e97('0x5'));var rimraf=require(_0x5e97('0x6'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x5e97('0x7')]=function(_0x5b6fe9,_0x26fe7c){return _0x5b6fe9['define'](_0x5e97('0x8'),attributes,{'tableName':_0x5e97('0x9'),'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 f387600..65c0835 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 _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x47eec5,_0x84b375){var _0x3d05b3=function(_0x5f52eb){while(--_0x5f52eb){_0x47eec5['push'](_0x47eec5['shift']());}};_0x3d05b3(++_0x84b375);}(_0xef0f,0x168));var _0xfef0=function(_0x4e8079,_0x34f064){_0x4e8079=_0x4e8079-0x0;var _0x3a2069=_0xef0f[_0x4e8079];return _0x3a2069;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('Integration,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('Integration,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});} \ 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(_0x52d4ad,_0x25e611){var _0x34a767=function(_0x1f3daa){while(--_0x1f3daa){_0x52d4ad['push'](_0x52d4ad['shift']());}};_0x34a767(++_0x25e611);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x16aaae,_0x57b635){_0x16aaae=_0x16aaae-0x0;var _0x42b6de=_0xd7d1[_0x16aaae];return _0x42b6de;};'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 bcc5c3f..05d411f 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 _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x2ccd06,_0x2f6aae){var _0xb17be4=function(_0x1117a5){while(--_0x1117a5){_0x2ccd06['push'](_0x2ccd06['shift']());}};_0xb17be4(++_0x2f6aae);}(_0x2ef3,0xba));var _0x32ef=function(_0x1ceb06,_0x4645a9){_0x1ceb06=_0x1ceb06-0x0;var _0x4bf310=_0x2ef3[_0x1ceb06];return _0x4bf310;};'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('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router; \ No newline at end of file +var _0x896e=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x896e,0x1e9));var _0xe896=function(_0xad4e13,_0x2a4d16){_0xad4e13=_0xad4e13-0x0;var _0x44b4b9=_0x896e[_0xad4e13];return _0x44b4b9;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['post']('/',auth[_0xe896('0xe')](),controller['create']);router[_0xe896('0x12')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x13')]);router[_0xe896('0x14')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);module[_0xe896('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 96d25b9..cf44958 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 _0x0def=['ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','STRING','DATE','INTEGER','BOOLEAN','TEXT'];(function(_0x154983,_0xc29edf){var _0x3d1243=function(_0x5cb7a4){while(--_0x5cb7a4){_0x154983['push'](_0x154983['shift']());}};_0x3d1243(++_0xc29edf);}(_0x0def,0x165));var _0xf0de=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x0def[_0x4b7895];return _0x264180;};'use strict';var Sequelize=require(_0xf0de('0x0'));module['exports']={'integration':{'type':Sequelize[_0xf0de('0x1')]},'eventChannel':{'type':Sequelize[_0xf0de('0x1')]},'exitStatus':{'type':Sequelize[_0xf0de('0x1')]},'ticketId':{'type':Sequelize[_0xf0de('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xf0de('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf0de('0x1')]},'calleridname':{'type':Sequelize[_0xf0de('0x1')]},'queue':{'type':Sequelize[_0xf0de('0x1')]},'interface':{'type':Sequelize[_0xf0de('0x1')]},'membername':{'type':Sequelize[_0xf0de('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xf0de('0x2')]},'holdtime':{'type':Sequelize[_0xf0de('0x3')]},'agentcomplete':{'type':Sequelize[_0xf0de('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf0de('0x2')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf0de('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xf0de('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf0de('0x2')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf0de('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf0de('0x1')]},'channelstate':{'type':Sequelize[_0xf0de('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xf0de('0x1')]},'connectedlinename':{'type':Sequelize[_0xf0de('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf0de('0x1')]},'context':{'type':Sequelize[_0xf0de('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf0de('0x1')]},'destchannelstate':{'type':Sequelize[_0xf0de('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xf0de('0x1')]},'destcalleridnum':{'type':Sequelize[_0xf0de('0x1')]},'destcalleridname':{'type':Sequelize[_0xf0de('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xf0de('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xf0de('0x1')]},'destcontext':{'type':Sequelize[_0xf0de('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xf0de('0x1')]},'messageId':{'type':Sequelize[_0xf0de('0x1')]},'inReplyTo':{'type':Sequelize[_0xf0de('0x1')]},'subject':{'type':Sequelize[_0xf0de('0x1')]},'from':{'type':Sequelize[_0xf0de('0x1')]},'to':{'type':Sequelize[_0xf0de('0x1')]},'cc':{'type':Sequelize[_0xf0de('0x1')]},'attachment':{'type':Sequelize[_0xf0de('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xf0de('0x6')](_0xf0de('0x7'),_0xf0de('0x8'),_0xf0de('0x9'),_0xf0de('0xa'))},'url':{'type':Sequelize[_0xf0de('0x1')]},'app':{'type':Sequelize[_0xf0de('0x1')]},'appdata':{'type':Sequelize[_0xf0de('0x1')]},'projectId':{'type':Sequelize[_0xf0de('0x3')]}}; \ No newline at end of file +var _0xa6fa=['BOOLEAN','TEXT','SENT','SENDING','FAILED','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x4e2dac,_0x364282){var _0xff3d6c=function(_0x49500b){while(--_0x49500b){_0x4e2dac['push'](_0x4e2dac['shift']());}};_0xff3d6c(++_0x364282);}(_0xa6fa,0x1db));var _0xaa6f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa6fa[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xaa6f('0x0'));module[_0xaa6f('0x1')]={'integration':{'type':Sequelize[_0xaa6f('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xaa6f('0x2')]},'ticketId':{'type':Sequelize[_0xaa6f('0x2')]},'integrationId':{'type':Sequelize[_0xaa6f('0x3')]},'contacts':{'type':Sequelize[_0xaa6f('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xaa6f('0x2')]},'calleridname':{'type':Sequelize[_0xaa6f('0x2')]},'queue':{'type':Sequelize[_0xaa6f('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xaa6f('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xaa6f('0x3')]},'agentcomplete':{'type':Sequelize[_0xaa6f('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xaa6f('0x4')]},'talktime':{'type':Sequelize[_0xaa6f('0x3')]},'agentacw':{'type':Sequelize[_0xaa6f('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xaa6f('0x3')]},'reason':{'type':Sequelize[_0xaa6f('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xaa6f('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xaa6f('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xaa6f('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa6f('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa6f('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa6f('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaa6f('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xaa6f('0x2')]},'destchannel':{'type':Sequelize[_0xaa6f('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa6f('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa6f('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa6f('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa6f('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa6f('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xaa6f('0x2')]},'destcontext':{'type':Sequelize[_0xaa6f('0x2')]},'destexten':{'type':Sequelize[_0xaa6f('0x2')]},'destpriority':{'type':Sequelize[_0xaa6f('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xaa6f('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xaa6f('0x2')]},'from':{'type':Sequelize[_0xaa6f('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xaa6f('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xaa6f('0x6')]},'text':{'type':Sequelize[_0xaa6f('0x6')]},'status':{'type':Sequelize['ENUM'](_0xaa6f('0x7'),_0xaa6f('0x8'),'RECEIVED',_0xaa6f('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 4192fc1..c77bfd8 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 _0xbbcb=['body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../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','apply','reject','update','then','destroy','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','keys','filters','query','attributes','model','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','find','create'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xbbcb,0x1c5));var _0xbbbc=function(_0x51c23c,_0x3ec69f){_0x51c23c=_0x51c23c-0x0;var _0x4f6780=_0xbbcb[_0x51c23c];return _0x4f6780;};'use strict';var emlformat=require(_0xbbbc('0x0'));var rimraf=require(_0xbbbc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbbc('0x2'));var rp=require(_0xbbbc('0x3'));var moment=require(_0xbbbc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbbbc('0x5'));var path=require(_0xbbbc('0x6'));var sox=require(_0xbbbc('0x7'));var csv=require(_0xbbbc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbbbc('0x9'));var _=require(_0xbbbc('0xa'));var squel=require(_0xbbbc('0xb'));var crypto=require(_0xbbbc('0xc'));var jsforce=require(_0xbbbc('0xd'));var deskjs=require(_0xbbbc('0xe'));var toCsv=require(_0xbbbc('0x8'));var querystring=require(_0xbbbc('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbbbc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbbbc('0x11'));var hardwareService=require(_0xbbbc('0x12'));var logger=require(_0xbbbc('0x13'))(_0xbbbc('0x14'));var utils=require(_0xbbbc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbbbc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b27fc,_0x313a1a){_0x313a1a=_0x313a1a||0xcc;return function(_0x45e1f2){if(_0x45e1f2){return _0x3b27fc[_0xbbbc('0x17')](_0x313a1a);}return _0x3b27fc[_0xbbbc('0x18')](_0x313a1a)[_0xbbbc('0x19')]();};}function respondWithResult(_0xfd01c8,_0x5a1449){_0x5a1449=_0x5a1449||0xc8;return function(_0x17d85b){if(_0x17d85b){return _0xfd01c8[_0xbbbc('0x18')](_0x5a1449)[_0xbbbc('0x1a')](_0x17d85b);}};}function respondWithFilteredResult(_0x5ccb3e,_0x3b5d70){return function(_0x2fbd32){if(_0x2fbd32){var _0x268dbc=typeof _0x3b5d70[_0xbbbc('0x1b')]==='undefined'&&typeof _0x3b5d70[_0xbbbc('0x1c')]===_0xbbbc('0x1d');var _0x32a85a=_0x2fbd32[_0xbbbc('0x1e')];var _0x11b4d6=_0x268dbc?0x0:_0x3b5d70[_0xbbbc('0x1b')];var _0x7af8d4=_0x268dbc?_0x2fbd32[_0xbbbc('0x1e')]:_0x3b5d70[_0xbbbc('0x1b')]+_0x3b5d70[_0xbbbc('0x1c')];var _0x524b72;if(_0x7af8d4>=_0x32a85a){_0x7af8d4=_0x32a85a;_0x524b72=0xc8;}else{_0x524b72=0xce;}_0x5ccb3e[_0xbbbc('0x18')](_0x524b72);return _0x5ccb3e[_0xbbbc('0x1f')](_0xbbbc('0x20'),_0x11b4d6+'-'+_0x7af8d4+'/'+_0x32a85a)[_0xbbbc('0x1a')](_0x2fbd32);}return null;};}function patchUpdates(_0x47c110){return function(_0x2e4a90){try{jsonpatch[_0xbbbc('0x21')](_0x2e4a90,_0x47c110,!![]);}catch(_0x2e98f5){return BPromise[_0xbbbc('0x22')](_0x2e98f5);}return _0x2e4a90['save']();};}function saveUpdates(_0x3e5a2e,_0x42e2fa){return function(_0x308999){if(_0x308999){return _0x308999[_0xbbbc('0x23')](_0x3e5a2e)[_0xbbbc('0x24')](function(_0x326359){return _0x326359;});}return null;};}function removeEntity(_0xb8b4db,_0xe953dd){return function(_0x2b3a4f){if(_0x2b3a4f){return _0x2b3a4f[_0xbbbc('0x25')]()['then'](function(){_0xb8b4db['status'](0xcc)[_0xbbbc('0x19')]();});}};}function handleEntityNotFound(_0x45c994,_0x4ef639){return function(_0x2be81a){if(!_0x2be81a){_0x45c994[_0xbbbc('0x17')](0x194);}return _0x2be81a;};}function handleError(_0x3b5ce3,_0xb78963){_0xb78963=_0xb78963||0x1f4;return function(_0x489a2f){logger[_0xbbbc('0x26')](_0x489a2f['stack']);if(_0x489a2f[_0xbbbc('0x27')]){delete _0x489a2f[_0xbbbc('0x27')];}_0x3b5ce3['status'](_0xb78963)[_0xbbbc('0x28')](_0x489a2f);};}exports[_0xbbbc('0x29')]=function(_0x22d0ca,_0x4aa6b4){var _0x2ee208={},_0x4f711e={},_0x455d82={'count':0x0,'rows':[]};var _0x341fd5=_[_0xbbbc('0x2a')](db[_0xbbbc('0x2b')][_0xbbbc('0x2c')],function(_0x15dc41){return{'name':_0x15dc41[_0xbbbc('0x2d')],'type':_0x15dc41[_0xbbbc('0x2e')][_0xbbbc('0x2f')]};});_0x4f711e['model']=_['map'](_0x341fd5,_0xbbbc('0x27'));_0x4f711e['query']=_[_0xbbbc('0x30')](_0x22d0ca['query']);_0x4f711e[_0xbbbc('0x31')]=_['intersection'](_0x4f711e['model'],_0x4f711e[_0xbbbc('0x32')]);_0x2ee208[_0xbbbc('0x33')]=_['intersection'](_0x4f711e[_0xbbbc('0x34')],qs['fields'](_0x22d0ca[_0xbbbc('0x32')]['fields']));_0x2ee208[_0xbbbc('0x33')]=_0x2ee208[_0xbbbc('0x33')][_0xbbbc('0x35')]?_0x2ee208[_0xbbbc('0x33')]:_0x4f711e[_0xbbbc('0x34')];if(!_0x22d0ca[_0xbbbc('0x32')]['hasOwnProperty'](_0xbbbc('0x36'))){_0x2ee208['limit']=qs['limit'](_0x22d0ca[_0xbbbc('0x32')][_0xbbbc('0x1c')]);_0x2ee208[_0xbbbc('0x1b')]=qs[_0xbbbc('0x1b')](_0x22d0ca[_0xbbbc('0x32')][_0xbbbc('0x1b')]);}_0x2ee208[_0xbbbc('0x37')]=qs[_0xbbbc('0x38')](_0x22d0ca[_0xbbbc('0x32')][_0xbbbc('0x38')]);_0x2ee208['where']=qs[_0xbbbc('0x31')](_[_0xbbbc('0x39')](_0x22d0ca[_0xbbbc('0x32')],_0x4f711e[_0xbbbc('0x31')]),_0x341fd5);if(_0x22d0ca[_0xbbbc('0x32')][_0xbbbc('0x3a')]){_0x2ee208[_0xbbbc('0x3b')]=_[_0xbbbc('0x3c')](_0x2ee208[_0xbbbc('0x3b')],{'$or':_['map'](_0x341fd5,function(_0x425aab){if(_0x425aab[_0xbbbc('0x2e')]!==_0xbbbc('0x3d')){var _0x58a383={};_0x58a383[_0x425aab['name']]={'$like':'%'+_0x22d0ca[_0xbbbc('0x32')][_0xbbbc('0x3a')]+'%'};return _0x58a383;}})});}_0x2ee208=_['merge']({},_0x2ee208,_0x22d0ca[_0xbbbc('0x3e')]);var _0x53020d={'where':_0x2ee208[_0xbbbc('0x3b')]};return db['IntegrationReport']['count'](_0x53020d)[_0xbbbc('0x24')](function(_0x426576){_0x455d82[_0xbbbc('0x1e')]=_0x426576;if(_0x22d0ca[_0xbbbc('0x32')][_0xbbbc('0x3f')]){_0x2ee208[_0xbbbc('0x40')]=[{'all':!![]}];}return db[_0xbbbc('0x2b')][_0xbbbc('0x41')](_0x2ee208);})['then'](function(_0x42a50a){_0x455d82[_0xbbbc('0x42')]=_0x42a50a;return _0x455d82;})['then'](respondWithFilteredResult(_0x4aa6b4,_0x2ee208))[_0xbbbc('0x43')](handleError(_0x4aa6b4,null));};exports[_0xbbbc('0x44')]=function(_0x46d0bf,_0x30f3c5){var _0x5df616={'raw':![],'where':{'id':_0x46d0bf['params']['id']}},_0x1c519a={};_0x1c519a[_0xbbbc('0x34')]=_[_0xbbbc('0x30')](db[_0xbbbc('0x2b')][_0xbbbc('0x2c')]);_0x1c519a[_0xbbbc('0x32')]=_['keys'](_0x46d0bf[_0xbbbc('0x32')]);_0x1c519a[_0xbbbc('0x31')]=_[_0xbbbc('0x45')](_0x1c519a[_0xbbbc('0x34')],_0x1c519a[_0xbbbc('0x32')]);_0x5df616['attributes']=_['intersection'](_0x1c519a[_0xbbbc('0x34')],qs['fields'](_0x46d0bf[_0xbbbc('0x32')]['fields']));_0x5df616[_0xbbbc('0x33')]=_0x5df616['attributes'][_0xbbbc('0x35')]?_0x5df616[_0xbbbc('0x33')]:_0x1c519a['model'];if(_0x46d0bf['query'][_0xbbbc('0x3f')]){_0x5df616[_0xbbbc('0x40')]=[{'all':!![]}];}_0x5df616=_['merge']({},_0x5df616,_0x46d0bf['options']);return db[_0xbbbc('0x2b')][_0xbbbc('0x46')](_0x5df616)[_0xbbbc('0x24')](handleEntityNotFound(_0x30f3c5,null))[_0xbbbc('0x24')](respondWithResult(_0x30f3c5,null))[_0xbbbc('0x43')](handleError(_0x30f3c5,null));};exports[_0xbbbc('0x47')]=function(_0x15b366,_0x1fdc35){return db[_0xbbbc('0x2b')][_0xbbbc('0x47')](_0x15b366[_0xbbbc('0x48')],{})[_0xbbbc('0x24')](respondWithResult(_0x1fdc35,0xc9))[_0xbbbc('0x43')](handleError(_0x1fdc35,null));};exports[_0xbbbc('0x23')]=function(_0x3f4245,_0x28643e){if(_0x3f4245['body']['id']){delete _0x3f4245[_0xbbbc('0x48')]['id'];}return db[_0xbbbc('0x2b')]['find']({'where':{'id':_0x3f4245[_0xbbbc('0x49')]['id']}})[_0xbbbc('0x24')](handleEntityNotFound(_0x28643e,null))[_0xbbbc('0x24')](saveUpdates(_0x3f4245[_0xbbbc('0x48')],null))[_0xbbbc('0x24')](respondWithResult(_0x28643e,null))[_0xbbbc('0x43')](handleError(_0x28643e,null));};exports['destroy']=function(_0x160179,_0x16a72b){return db['IntegrationReport'][_0xbbbc('0x46')]({'where':{'id':_0x160179[_0xbbbc('0x49')]['id']}})[_0xbbbc('0x24')](handleEntityNotFound(_0x16a72b,null))[_0xbbbc('0x24')](removeEntity(_0x16a72b,null))[_0xbbbc('0x43')](handleError(_0x16a72b,null));};exports[_0xbbbc('0x4a')]=function(_0x1ea1a3,_0x458636){return db[_0xbbbc('0x2b')]['describe']()[_0xbbbc('0x24')](respondWithResult(_0x458636,null))[_0xbbbc('0x43')](handleError(_0x458636,null));}; \ No newline at end of file +var _0x5e2e=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','body','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x5e8974,_0x715d0){var _0x514ce7=function(_0xbefc85){while(--_0xbefc85){_0x5e8974['push'](_0x5e8974['shift']());}};_0x514ce7(++_0x715d0);}(_0x5e2e,0x1ae));var _0xe5e2=function(_0x1d7f38,_0x3cce58){_0x1d7f38=_0x1d7f38-0x0;var _0x138ae7=_0x5e2e[_0x1d7f38];return _0x138ae7;};'use strict';var emlformat=require(_0xe5e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5e2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5e2('0x2'));var moment=require(_0xe5e2('0x3'));var BPromise=require(_0xe5e2('0x4'));var Mustache=require('mustache');var util=require(_0xe5e2('0x5'));var path=require(_0xe5e2('0x6'));var sox=require('sox');var csv=require(_0xe5e2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe5e2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe5e2('0x9'));var jsforce=require(_0xe5e2('0xa'));var deskjs=require(_0xe5e2('0xb'));var toCsv=require(_0xe5e2('0x7'));var querystring=require(_0xe5e2('0xc'));var Papa=require('papaparse');var Redis=require(_0xe5e2('0xd'));var authService=require(_0xe5e2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe5e2('0xf'));var hardwareService=require(_0xe5e2('0x10'));var logger=require(_0xe5e2('0x11'))(_0xe5e2('0x12'));var utils=require(_0xe5e2('0x13'));var config=require(_0xe5e2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe5e2('0x15'))['db'];function respondWithStatusCode(_0x4a036a,_0x56f3a1){_0x56f3a1=_0x56f3a1||0xcc;return function(_0x5b281e){if(_0x5b281e){return _0x4a036a[_0xe5e2('0x16')](_0x56f3a1);}return _0x4a036a['status'](_0x56f3a1)[_0xe5e2('0x17')]();};}function respondWithResult(_0x144395,_0x34236a){_0x34236a=_0x34236a||0xc8;return function(_0x2a2020){if(_0x2a2020){return _0x144395[_0xe5e2('0x18')](_0x34236a)['json'](_0x2a2020);}};}function respondWithFilteredResult(_0x18c481,_0x47a156){return function(_0x188b35){if(_0x188b35){var _0x2ac160=typeof _0x47a156[_0xe5e2('0x19')]===_0xe5e2('0x1a')&&typeof _0x47a156[_0xe5e2('0x1b')]===_0xe5e2('0x1a');var _0x242040=_0x188b35['count'];var _0x439983=_0x2ac160?0x0:_0x47a156[_0xe5e2('0x19')];var _0x4fa15a=_0x2ac160?_0x188b35[_0xe5e2('0x1c')]:_0x47a156[_0xe5e2('0x19')]+_0x47a156[_0xe5e2('0x1b')];var _0xe62f7f;if(_0x4fa15a>=_0x242040){_0x4fa15a=_0x242040;_0xe62f7f=0xc8;}else{_0xe62f7f=0xce;}_0x18c481[_0xe5e2('0x18')](_0xe62f7f);return _0x18c481['set'](_0xe5e2('0x1d'),_0x439983+'-'+_0x4fa15a+'/'+_0x242040)[_0xe5e2('0x1e')](_0x188b35);}return null;};}function patchUpdates(_0x406d1e){return function(_0x300f7a){try{jsonpatch['apply'](_0x300f7a,_0x406d1e,!![]);}catch(_0x5d06b5){return BPromise[_0xe5e2('0x1f')](_0x5d06b5);}return _0x300f7a[_0xe5e2('0x20')]();};}function saveUpdates(_0x557cbb,_0x3addeb){return function(_0x3bb5f5){if(_0x3bb5f5){return _0x3bb5f5[_0xe5e2('0x21')](_0x557cbb)[_0xe5e2('0x22')](function(_0x26630f){return _0x26630f;});}return null;};}function removeEntity(_0x38620e,_0x118f1b){return function(_0x386fee){if(_0x386fee){return _0x386fee['destroy']()[_0xe5e2('0x22')](function(){_0x38620e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53da1f,_0x399027){return function(_0x58c54d){if(!_0x58c54d){_0x53da1f[_0xe5e2('0x16')](0x194);}return _0x58c54d;};}function handleError(_0x1df57b,_0x29efd9){_0x29efd9=_0x29efd9||0x1f4;return function(_0x1fc9b1){logger[_0xe5e2('0x23')](_0x1fc9b1[_0xe5e2('0x24')]);if(_0x1fc9b1[_0xe5e2('0x25')]){delete _0x1fc9b1[_0xe5e2('0x25')];}_0x1df57b['status'](_0x29efd9)[_0xe5e2('0x26')](_0x1fc9b1);};}exports[_0xe5e2('0x27')]=function(_0x2c8f86,_0x393a08){var _0x1925f6={},_0x25451e={},_0x4a14b3={'count':0x0,'rows':[]};var _0x106dfd=_[_0xe5e2('0x28')](db[_0xe5e2('0x29')][_0xe5e2('0x2a')],function(_0x28c23f){return{'name':_0x28c23f[_0xe5e2('0x2b')],'type':_0x28c23f['type'][_0xe5e2('0x2c')]};});_0x25451e['model']=_[_0xe5e2('0x28')](_0x106dfd,_0xe5e2('0x25'));_0x25451e[_0xe5e2('0x2d')]=_['keys'](_0x2c8f86[_0xe5e2('0x2d')]);_0x25451e[_0xe5e2('0x2e')]=_[_0xe5e2('0x2f')](_0x25451e[_0xe5e2('0x30')],_0x25451e['query']);_0x1925f6[_0xe5e2('0x31')]=_[_0xe5e2('0x2f')](_0x25451e[_0xe5e2('0x30')],qs[_0xe5e2('0x32')](_0x2c8f86[_0xe5e2('0x2d')][_0xe5e2('0x32')]));_0x1925f6[_0xe5e2('0x31')]=_0x1925f6[_0xe5e2('0x31')][_0xe5e2('0x33')]?_0x1925f6[_0xe5e2('0x31')]:_0x25451e[_0xe5e2('0x30')];if(!_0x2c8f86['query'][_0xe5e2('0x34')](_0xe5e2('0x35'))){_0x1925f6['limit']=qs[_0xe5e2('0x1b')](_0x2c8f86[_0xe5e2('0x2d')][_0xe5e2('0x1b')]);_0x1925f6['offset']=qs[_0xe5e2('0x19')](_0x2c8f86[_0xe5e2('0x2d')]['offset']);}_0x1925f6[_0xe5e2('0x36')]=qs[_0xe5e2('0x37')](_0x2c8f86['query'][_0xe5e2('0x37')]);_0x1925f6[_0xe5e2('0x38')]=qs['filters'](_[_0xe5e2('0x39')](_0x2c8f86[_0xe5e2('0x2d')],_0x25451e[_0xe5e2('0x2e')]),_0x106dfd);if(_0x2c8f86['query']['filter']){_0x1925f6[_0xe5e2('0x38')]=_['merge'](_0x1925f6[_0xe5e2('0x38')],{'$or':_[_0xe5e2('0x28')](_0x106dfd,function(_0x4a4640){if(_0x4a4640[_0xe5e2('0x3a')]!==_0xe5e2('0x3b')){var _0xd4992f={};_0xd4992f[_0x4a4640[_0xe5e2('0x25')]]={'$like':'%'+_0x2c8f86[_0xe5e2('0x2d')][_0xe5e2('0x3c')]+'%'};return _0xd4992f;}})});}_0x1925f6=_[_0xe5e2('0x3d')]({},_0x1925f6,_0x2c8f86[_0xe5e2('0x3e')]);var _0x43fcb7={'where':_0x1925f6['where']};return db['IntegrationReport'][_0xe5e2('0x1c')](_0x43fcb7)['then'](function(_0x1e8e93){_0x4a14b3[_0xe5e2('0x1c')]=_0x1e8e93;if(_0x2c8f86['query'][_0xe5e2('0x3f')]){_0x1925f6[_0xe5e2('0x40')]=[{'all':!![]}];}return db[_0xe5e2('0x29')]['findAll'](_0x1925f6);})[_0xe5e2('0x22')](function(_0x3c5acf){_0x4a14b3[_0xe5e2('0x41')]=_0x3c5acf;return _0x4a14b3;})['then'](respondWithFilteredResult(_0x393a08,_0x1925f6))[_0xe5e2('0x42')](handleError(_0x393a08,null));};exports[_0xe5e2('0x43')]=function(_0x2221a4,_0xe6d7fe){var _0x31dfc6={'raw':![],'where':{'id':_0x2221a4[_0xe5e2('0x44')]['id']}},_0x2f7523={};_0x2f7523[_0xe5e2('0x30')]=_[_0xe5e2('0x45')](db['IntegrationReport'][_0xe5e2('0x2a')]);_0x2f7523['query']=_[_0xe5e2('0x45')](_0x2221a4[_0xe5e2('0x2d')]);_0x2f7523[_0xe5e2('0x2e')]=_[_0xe5e2('0x2f')](_0x2f7523[_0xe5e2('0x30')],_0x2f7523[_0xe5e2('0x2d')]);_0x31dfc6[_0xe5e2('0x31')]=_[_0xe5e2('0x2f')](_0x2f7523[_0xe5e2('0x30')],qs[_0xe5e2('0x32')](_0x2221a4[_0xe5e2('0x2d')][_0xe5e2('0x32')]));_0x31dfc6['attributes']=_0x31dfc6['attributes'][_0xe5e2('0x33')]?_0x31dfc6[_0xe5e2('0x31')]:_0x2f7523[_0xe5e2('0x30')];if(_0x2221a4[_0xe5e2('0x2d')][_0xe5e2('0x3f')]){_0x31dfc6['include']=[{'all':!![]}];}_0x31dfc6=_[_0xe5e2('0x3d')]({},_0x31dfc6,_0x2221a4[_0xe5e2('0x3e')]);return db['IntegrationReport'][_0xe5e2('0x46')](_0x31dfc6)[_0xe5e2('0x22')](handleEntityNotFound(_0xe6d7fe,null))[_0xe5e2('0x22')](respondWithResult(_0xe6d7fe,null))[_0xe5e2('0x42')](handleError(_0xe6d7fe,null));};exports['create']=function(_0x17a442,_0x22f609){return db[_0xe5e2('0x29')]['create'](_0x17a442['body'],{})[_0xe5e2('0x22')](respondWithResult(_0x22f609,0xc9))['catch'](handleError(_0x22f609,null));};exports[_0xe5e2('0x21')]=function(_0x93cd13,_0x323070){if(_0x93cd13['body']['id']){delete _0x93cd13[_0xe5e2('0x47')]['id'];}return db[_0xe5e2('0x29')][_0xe5e2('0x46')]({'where':{'id':_0x93cd13[_0xe5e2('0x44')]['id']}})['then'](handleEntityNotFound(_0x323070,null))[_0xe5e2('0x22')](saveUpdates(_0x93cd13[_0xe5e2('0x47')],null))['then'](respondWithResult(_0x323070,null))[_0xe5e2('0x42')](handleError(_0x323070,null));};exports[_0xe5e2('0x48')]=function(_0x450463,_0x19582a){return db[_0xe5e2('0x29')][_0xe5e2('0x46')]({'where':{'id':_0x450463['params']['id']}})[_0xe5e2('0x22')](handleEntityNotFound(_0x19582a,null))[_0xe5e2('0x22')](removeEntity(_0x19582a,null))['catch'](handleError(_0x19582a,null));};exports[_0xe5e2('0x49')]=function(_0x4d16a7,_0x18dc01){return db[_0xe5e2('0x29')][_0xe5e2('0x49')]()[_0xe5e2('0x22')](respondWithResult(_0x18dc01,null))[_0xe5e2('0x42')](handleError(_0x18dc01,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index de787c1..446906e 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 _0xff87=['report_integration','util','../../config/logger','api','request-promise','path','rimraf','exports','define'];(function(_0x4026b3,_0x3cfd05){var _0x451dd6=function(_0x481eca){while(--_0x481eca){_0x4026b3['push'](_0x4026b3['shift']());}};_0x451dd6(++_0x3cfd05);}(_0xff87,0x91));var _0x7ff8=function(_0x190681,_0x590f58){_0x190681=_0x190681-0x0;var _0x4f2ada=_0xff87[_0x190681];return _0x4f2ada;};'use strict';var _=require('lodash');var util=require(_0x7ff8('0x0'));var logger=require(_0x7ff8('0x1'))(_0x7ff8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7ff8('0x3'));var fs=require('fs');var path=require(_0x7ff8('0x4'));var rimraf=require(_0x7ff8('0x5'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x7ff8('0x6')]=function(_0xf3da30,_0x27edfd){return _0xf3da30[_0x7ff8('0x7')]('IntegrationReport',attributes,{'tableName':_0x7ff8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34d6=['report_integration','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x247fda,_0xcf5677){var _0x47bb0c=function(_0x450364){while(--_0x450364){_0x247fda['push'](_0x247fda['shift']());}};_0x47bb0c(++_0xcf5677);}(_0x34d6,0xf3));var _0x634d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x34d6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x634d('0x0'))('api');var moment=require('moment');var BPromise=require(_0x634d('0x1'));var rp=require(_0x634d('0x2'));var fs=require('fs');var path=require(_0x634d('0x3'));var rimraf=require(_0x634d('0x4'));var config=require(_0x634d('0x5'));var attributes=require(_0x634d('0x6'));module[_0x634d('0x7')]=function(_0x28123c,_0x134360){return _0x28123c[_0x634d('0x8')](_0x634d('0x9'),attributes,{'tableName':_0x634d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index a52f235..b9f8e3f 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x51e123,_0x36c704){var _0x4b0b09=function(_0x566025){while(--_0x566025){_0x51e123['push'](_0x51e123['shift']());}};_0x4b0b09(++_0x36c704);}(_0x2ef3,0xba));var _0x32ef=function(_0x5ce8f2,_0x2aa6e5){_0x5ce8f2=_0x5ce8f2-0x0;var _0x37267c=_0x2ef3[_0x5ce8f2];return _0x37267c;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x54816b,_0x467118){var _0x54d115=function(_0x28d44e){while(--_0x28d44e){_0x54816b['push'](_0x54816b['shift']());}};_0x54d115(++_0x467118);}(_0xdb28,0x106));var _0x8db2=function(_0x3b15ce,_0x6471fa){_0x3b15ce=_0x3b15ce-0x0;var _0x4089be=_0xdb28[_0x3b15ce];return _0x4089be;};'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')]('IntegrationReport,\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/interval/index.js b/server/api/interval/index.js index 54b47f7..658baa2 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 _0x2cd0=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','/:id','/:id/sub_intervals','create','post','addInterval','addIntervals','put','update','destroy','multer','util'];(function(_0x242e38,_0x24c05d){var _0x43d2f6=function(_0x3d5139){while(--_0x3d5139){_0x242e38['push'](_0x242e38['shift']());}};_0x43d2f6(++_0x24c05d);}(_0x2cd0,0x10f));var _0x02cd=function(_0x598ace,_0x30c2c0){_0x598ace=_0x598ace-0x0;var _0x278d14=_0x2cd0[_0x598ace];return _0x278d14;};'use strict';var multer=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var path=require(_0x02cd('0x2'));var timeout=require(_0x02cd('0x3'));var express=require(_0x02cd('0x4'));var router=express[_0x02cd('0x5')]();var fs_extra=require(_0x02cd('0x6'));var auth=require(_0x02cd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x02cd('0x8'));var controller=require(_0x02cd('0x9'));router[_0x02cd('0xa')]('/',auth[_0x02cd('0xb')](),controller['index']);router[_0x02cd('0xa')](_0x02cd('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x02cd('0xd'),auth[_0x02cd('0xb')](),controller['getIntervals']);router['post']('/',auth[_0x02cd('0xb')](),controller[_0x02cd('0xe')]);router[_0x02cd('0xf')](_0x02cd('0xd'),auth[_0x02cd('0xb')](),controller[_0x02cd('0x10')]);router['post']('/:id/sub_intervals/create_many',auth[_0x02cd('0xb')](),controller[_0x02cd('0x11')]);router[_0x02cd('0x12')](_0x02cd('0xc'),auth[_0x02cd('0xb')](),controller[_0x02cd('0x13')]);router['delete'](_0x02cd('0xc'),auth['isAuthenticated'](),controller[_0x02cd('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5692=['../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','get','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x9086dc,_0x3f76c7){var _0xd1b678=function(_0xb40b7f){while(--_0xb40b7f){_0x9086dc['push'](_0x9086dc['shift']());}};_0xd1b678(++_0x3f76c7);}(_0x5692,0x14a));var _0x2569=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5692[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x2569('0x0'));var util=require(_0x2569('0x1'));var path=require(_0x2569('0x2'));var timeout=require(_0x2569('0x3'));var express=require('express');var router=express[_0x2569('0x4')]();var fs_extra=require(_0x2569('0x5'));var auth=require(_0x2569('0x6'));var interaction=require(_0x2569('0x7'));var config=require(_0x2569('0x8'));var controller=require(_0x2569('0x9'));router['get']('/',auth[_0x2569('0xa')](),controller[_0x2569('0xb')]);router[_0x2569('0xc')](_0x2569('0xd'),auth[_0x2569('0xa')](),controller['show']);router[_0x2569('0xc')](_0x2569('0xe'),auth['isAuthenticated'](),controller[_0x2569('0xf')]);router[_0x2569('0x10')]('/',auth['isAuthenticated'](),controller[_0x2569('0x11')]);router[_0x2569('0x10')](_0x2569('0xe'),auth[_0x2569('0xa')](),controller[_0x2569('0x12')]);router[_0x2569('0x10')](_0x2569('0x13'),auth[_0x2569('0xa')](),controller['addIntervals']);router[_0x2569('0x14')](_0x2569('0xd'),auth[_0x2569('0xa')](),controller[_0x2569('0x15')]);router['delete']('/:id',auth[_0x2569('0xa')](),controller[_0x2569('0x16')]);module[_0x2569('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 239a24d..5c3cff8 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 _0xcbb2=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbb2,0x1ea));var _0x2cbb=function(_0x3c1a2a,_0x23a562){_0x3c1a2a=_0x3c1a2a-0x0;var _0x102a41=_0xcbb2[_0x3c1a2a];return _0x102a41;};'use strict';var Sequelize=require(_0x2cbb('0x0'));module[_0x2cbb('0x1')]={'name':{'type':Sequelize[_0x2cbb('0x2')]},'description':{'type':Sequelize[_0x2cbb('0x2')]},'interval':{'type':Sequelize[_0x2cbb('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x923c=['sequelize','STRING'];(function(_0x7971bd,_0x1d2627){var _0x44a885=function(_0x107a4b){while(--_0x107a4b){_0x7971bd['push'](_0x7971bd['shift']());}};_0x44a885(++_0x1d2627);}(_0x923c,0x14a));var _0xc923=function(_0x5e811a,_0x201b06){_0x5e811a=_0x5e811a-0x0;var _0x39d30b=_0x923c[_0x5e811a];return _0x39d30b;};'use strict';var Sequelize=require(_0xc923('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc923('0x1')]},'interval':{'type':Sequelize[_0xc923('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 21b24d5..381447c 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 _0x7777=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','findAll','rows','show','params','keys','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','order','addIntervals','sequelize','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox'];(function(_0x42b416,_0x1bd5cc){var _0xfeb658=function(_0x11ef1d){while(--_0x11ef1d){_0x42b416['push'](_0x42b416['shift']());}};_0xfeb658(++_0x1bd5cc);}(_0x7777,0x17f));var _0x7777=function(_0x1f1f3b,_0x227aa9){_0x1f1f3b=_0x1f1f3b-0x0;var _0x2e63aa=_0x7777[_0x1f1f3b];return _0x2e63aa;};'use strict';var emlformat=require(_0x7777('0x0'));var rimraf=require(_0x7777('0x1'));var zipdir=require(_0x7777('0x2'));var jsonpatch=require(_0x7777('0x3'));var rp=require(_0x7777('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7777('0x5'));var util=require(_0x7777('0x6'));var path=require(_0x7777('0x7'));var sox=require(_0x7777('0x8'));var csv=require(_0x7777('0x9'));var ejs=require(_0x7777('0xa'));var fs=require('fs');var fs_extra=require(_0x7777('0xb'));var _=require(_0x7777('0xc'));var squel=require(_0x7777('0xd'));var crypto=require(_0x7777('0xe'));var jsforce=require(_0x7777('0xf'));var deskjs=require(_0x7777('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7777('0x11'));var Papa=require('papaparse');var Redis=require(_0x7777('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7777('0x13'));var as=require(_0x7777('0x14'));var hardwareService=require(_0x7777('0x15'));var logger=require(_0x7777('0x16'))(_0x7777('0x17'));var utils=require(_0x7777('0x18'));var config=require(_0x7777('0x19'));var licenseUtil=require(_0x7777('0x1a'));var db=require(_0x7777('0x1b'))['db'];var extensions=require(_0x7777('0x1c'));function respondWithStatusCode(_0x141a79,_0x367a3b){_0x367a3b=_0x367a3b||0xcc;return function(_0x300c97){if(_0x300c97){return _0x141a79[_0x7777('0x1d')](_0x367a3b);}return _0x141a79[_0x7777('0x1e')](_0x367a3b)[_0x7777('0x1f')]();};}function respondWithResult(_0x1bf9ed,_0x2ad05c){_0x2ad05c=_0x2ad05c||0xc8;return function(_0x312104){if(_0x312104){return _0x1bf9ed[_0x7777('0x1e')](_0x2ad05c)[_0x7777('0x20')](_0x312104);}};}function respondWithFilteredResult(_0x295438,_0x5405aa){return function(_0x44c924){if(_0x44c924){var _0x1de273=typeof _0x5405aa[_0x7777('0x21')]===_0x7777('0x22')&&typeof _0x5405aa['limit']===_0x7777('0x22');var _0x34f8f3=_0x44c924[_0x7777('0x23')];var _0x16876e=_0x1de273?0x0:_0x5405aa[_0x7777('0x21')];var _0x1d1fa2=_0x1de273?_0x44c924['count']:_0x5405aa[_0x7777('0x21')]+_0x5405aa[_0x7777('0x24')];var _0x491458;if(_0x1d1fa2>=_0x34f8f3){_0x1d1fa2=_0x34f8f3;_0x491458=0xc8;}else{_0x491458=0xce;}_0x295438['status'](_0x491458);return _0x295438[_0x7777('0x25')](_0x7777('0x26'),_0x16876e+'-'+_0x1d1fa2+'/'+_0x34f8f3)[_0x7777('0x20')](_0x44c924);}return null;};}function patchUpdates(_0x23d54a){return function(_0x13c370){try{jsonpatch[_0x7777('0x27')](_0x13c370,_0x23d54a,!![]);}catch(_0x246ac7){return BPromise[_0x7777('0x28')](_0x246ac7);}return _0x13c370['save']();};}function saveUpdates(_0x3cc51b,_0x43b856){return function(_0x117e4a){if(_0x117e4a){return _0x117e4a[_0x7777('0x29')](_0x3cc51b)[_0x7777('0x2a')](function(_0x5623bc){return _0x5623bc;});}return null;};}function removeEntity(_0x143232,_0x22b18b){return function(_0x1f723e){if(_0x1f723e){return _0x1f723e[_0x7777('0x2b')]()[_0x7777('0x2a')](function(){var _0x565cb8=_0x1f723e[_0x7777('0x2c')]({'plain':!![]});var _0x1977df=_0x7777('0x2d');return db[_0x7777('0x2e')][_0x7777('0x2b')]({'where':{'type':_0x1977df,'resourceId':_0x565cb8['id']}})[_0x7777('0x2a')](function(){return _0x1f723e;});})[_0x7777('0x2a')](function(){_0x143232['status'](0xcc)[_0x7777('0x1f')]();});}};}function handleEntityNotFound(_0x24087f,_0x88593a){return function(_0x53f341){if(!_0x53f341){_0x24087f[_0x7777('0x1d')](0x194);}return _0x53f341;};}function handleError(_0xf8c76c,_0x5d9db5){_0x5d9db5=_0x5d9db5||0x1f4;return function(_0x16316d){logger[_0x7777('0x2f')](_0x16316d[_0x7777('0x30')]);if(_0x16316d[_0x7777('0x31')]){delete _0x16316d[_0x7777('0x31')];}_0xf8c76c[_0x7777('0x1e')](_0x5d9db5)[_0x7777('0x32')](_0x16316d);};}exports[_0x7777('0x33')]=function(_0x541ea2,_0x4318ed){var _0x425109={},_0x3ad2f0={},_0x5c3614={'count':0x0,'rows':[]};var _0x5b09f1=_[_0x7777('0x34')](db[_0x7777('0x35')][_0x7777('0x36')],function(_0x2b8620){return{'name':_0x2b8620['fieldName'],'type':_0x2b8620['type'][_0x7777('0x37')]};});_0x3ad2f0[_0x7777('0x38')]=_[_0x7777('0x34')](_0x5b09f1,_0x7777('0x31'));_0x3ad2f0[_0x7777('0x39')]=_['keys'](_0x541ea2[_0x7777('0x39')]);_0x3ad2f0['filters']=_[_0x7777('0x3a')](_0x3ad2f0[_0x7777('0x38')],_0x3ad2f0[_0x7777('0x39')]);_0x425109[_0x7777('0x3b')]=_[_0x7777('0x3a')](_0x3ad2f0[_0x7777('0x38')],qs[_0x7777('0x3c')](_0x541ea2['query']['fields']));_0x425109['attributes']=_0x425109[_0x7777('0x3b')][_0x7777('0x3d')]?_0x425109[_0x7777('0x3b')]:_0x3ad2f0[_0x7777('0x38')];if(!_0x541ea2[_0x7777('0x39')][_0x7777('0x3e')](_0x7777('0x3f'))){_0x425109['limit']=qs[_0x7777('0x24')](_0x541ea2[_0x7777('0x39')][_0x7777('0x24')]);_0x425109[_0x7777('0x21')]=qs[_0x7777('0x21')](_0x541ea2['query'][_0x7777('0x21')]);}_0x425109['order']=qs[_0x7777('0x40')](_0x541ea2[_0x7777('0x39')][_0x7777('0x40')]);_0x425109['where']=qs[_0x7777('0x41')](_[_0x7777('0x42')](_0x541ea2[_0x7777('0x39')],_0x3ad2f0[_0x7777('0x41')]),_0x5b09f1);if(_0x541ea2[_0x7777('0x39')]['filter']){_0x425109[_0x7777('0x43')]=_[_0x7777('0x44')](_0x425109[_0x7777('0x43')],{'$or':_[_0x7777('0x34')](_0x5b09f1,function(_0x4e77dc){if(_0x4e77dc[_0x7777('0x45')]!==_0x7777('0x46')){var _0x44150c={};_0x44150c[_0x4e77dc['name']]={'$like':'%'+_0x541ea2[_0x7777('0x39')][_0x7777('0x47')]+'%'};return _0x44150c;}})});}_0x425109=_['merge']({},_0x425109,_0x541ea2[_0x7777('0x48')]);var _0xdff65e={'where':_0x425109[_0x7777('0x43')]};return db['Interval'][_0x7777('0x23')](_0xdff65e)[_0x7777('0x2a')](function(_0x22d3ee){_0x5c3614[_0x7777('0x23')]=_0x22d3ee;if(_0x541ea2[_0x7777('0x39')]['includeAll']){_0x425109['include']=[{'all':!![]}];}return db[_0x7777('0x35')][_0x7777('0x49')](_0x425109);})[_0x7777('0x2a')](function(_0x5e9009){_0x5c3614[_0x7777('0x4a')]=_0x5e9009;return _0x5c3614;})[_0x7777('0x2a')](respondWithFilteredResult(_0x4318ed,_0x425109))['catch'](handleError(_0x4318ed,null));};exports[_0x7777('0x4b')]=function(_0x3e30f0,_0xd0b8ff){var _0x5c0be1={'raw':!![],'where':{'id':_0x3e30f0[_0x7777('0x4c')]['id']}},_0x302f71={};_0x302f71[_0x7777('0x38')]=_[_0x7777('0x4d')](db['Interval'][_0x7777('0x36')]);_0x302f71[_0x7777('0x39')]=_['keys'](_0x3e30f0[_0x7777('0x39')]);_0x302f71[_0x7777('0x41')]=_[_0x7777('0x3a')](_0x302f71['model'],_0x302f71['query']);_0x5c0be1[_0x7777('0x3b')]=_[_0x7777('0x3a')](_0x302f71[_0x7777('0x38')],qs[_0x7777('0x3c')](_0x3e30f0[_0x7777('0x39')]['fields']));_0x5c0be1[_0x7777('0x3b')]=_0x5c0be1['attributes'][_0x7777('0x3d')]?_0x5c0be1['attributes']:_0x302f71['model'];if(_0x3e30f0['query'][_0x7777('0x4e')]){_0x5c0be1['include']=[{'all':!![]}];}_0x5c0be1=_[_0x7777('0x44')]({},_0x5c0be1,_0x3e30f0['options']);return db[_0x7777('0x35')][_0x7777('0x4f')](_0x5c0be1)['then'](handleEntityNotFound(_0xd0b8ff,null))['then'](respondWithResult(_0xd0b8ff,null))[_0x7777('0x50')](handleError(_0xd0b8ff,null));};exports[_0x7777('0x51')]=function(_0x4b168c,_0x2541dd){return db[_0x7777('0x35')][_0x7777('0x51')](_0x4b168c[_0x7777('0x52')],{})[_0x7777('0x2a')](function(_0x15bb82){var _0x24a654=_0x4b168c['user'][_0x7777('0x2c')]({'plain':!![]});if(!_0x24a654)throw new Error(_0x7777('0x53'));if(_0x24a654[_0x7777('0x54')]===_0x7777('0x55')){var _0x771080=_0x15bb82[_0x7777('0x2c')]({'plain':!![]});var _0x39e49c=_0x7777('0x2d');return db[_0x7777('0x56')]['find']({'where':{'name':_0x39e49c,'userProfileId':_0x24a654[_0x7777('0x57')]},'raw':!![]})['then'](function(_0x160ca4){if(_0x160ca4&&_0x160ca4[_0x7777('0x58')]===0x0){return db[_0x7777('0x2e')][_0x7777('0x51')]({'name':_0x771080[_0x7777('0x31')],'resourceId':_0x771080['id'],'type':_0x160ca4[_0x7777('0x31')],'sectionId':_0x160ca4['id']},{})[_0x7777('0x2a')](function(){return _0x15bb82;});}else{return _0x15bb82;}})['catch'](function(_0x1b0430){logger['error'](_0x7777('0x59'),_0x1b0430);throw _0x1b0430;});}return _0x15bb82;})[_0x7777('0x2a')](respondWithResult(_0x2541dd,0xc9))[_0x7777('0x50')](handleError(_0x2541dd,null));};exports['update']=function(_0x8bc92f,_0x1f03da){if(_0x8bc92f[_0x7777('0x52')]['id']){delete _0x8bc92f['body']['id'];}return db[_0x7777('0x35')][_0x7777('0x4f')]({'where':{'id':_0x8bc92f[_0x7777('0x4c')]['id']}})[_0x7777('0x2a')](handleEntityNotFound(_0x1f03da,null))[_0x7777('0x2a')](saveUpdates(_0x8bc92f['body'],null))['then'](respondWithResult(_0x1f03da,null))[_0x7777('0x50')](handleError(_0x1f03da,null));};exports[_0x7777('0x2b')]=function(_0x4da4e9,_0x2a5388){return db[_0x7777('0x35')]['find']({'where':{'id':_0x4da4e9[_0x7777('0x4c')]['id']}})[_0x7777('0x2a')](handleEntityNotFound(_0x2a5388,null))[_0x7777('0x2a')](removeEntity(_0x2a5388,null))['catch'](handleError(_0x2a5388,null));};exports[_0x7777('0x5a')]=function(_0x4a1966,_0x4a2004,_0xd1b82f){if(_0x4a1966[_0x7777('0x52')]['id']){delete _0x4a1966['body']['id'];}return db['Interval'][_0x7777('0x4f')]({'where':{'id':_0x4a1966[_0x7777('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4a2004,null))[_0x7777('0x2a')](function(_0x316c9f){if(_0x316c9f){_0x4a1966[_0x7777('0x52')]['IntervalId']=_0x316c9f['id'];return db[_0x7777('0x35')][_0x7777('0x51')](_0x4a1966[_0x7777('0x52')]);}})[_0x7777('0x2a')](respondWithResult(_0x4a2004,null))['catch'](handleError(_0x4a2004,null));};exports[_0x7777('0x5b')]=function(_0x1516f1,_0x52626c,_0x4f5806){var _0x21b361={};var _0xdbf63e={};var _0x567623;var _0x5e8d32;return db[_0x7777('0x35')][_0x7777('0x5c')]({'where':{'id':_0x1516f1[_0x7777('0x4c')]['id']}})[_0x7777('0x2a')](handleEntityNotFound(_0x52626c,null))['then'](function(_0x3595c9){if(_0x3595c9){_0x567623=_0x3595c9;_0xdbf63e[_0x7777('0x38')]=_[_0x7777('0x4d')](db[_0x7777('0x35')]['rawAttributes']);_0xdbf63e[_0x7777('0x39')]=_[_0x7777('0x4d')](_0x1516f1[_0x7777('0x39')]);_0xdbf63e[_0x7777('0x41')]=_['intersection'](_0xdbf63e[_0x7777('0x38')],_0xdbf63e['query']);_0x21b361[_0x7777('0x3b')]=_[_0x7777('0x3a')](_0xdbf63e[_0x7777('0x38')],qs[_0x7777('0x3c')](_0x1516f1[_0x7777('0x39')][_0x7777('0x3c')]));_0x21b361[_0x7777('0x3b')]=_0x21b361[_0x7777('0x3b')][_0x7777('0x3d')]?_0x21b361[_0x7777('0x3b')]:_0xdbf63e[_0x7777('0x38')];_0x21b361[_0x7777('0x5d')]=qs[_0x7777('0x40')](_0x1516f1[_0x7777('0x39')][_0x7777('0x40')]);_0x21b361['where']=qs[_0x7777('0x41')](_[_0x7777('0x42')](_0x1516f1[_0x7777('0x39')],_0xdbf63e[_0x7777('0x41')]));if(_0x1516f1[_0x7777('0x39')][_0x7777('0x47')]){_0x21b361[_0x7777('0x43')]=_[_0x7777('0x44')](_0x21b361['where'],{'$or':_[_0x7777('0x34')](_0x21b361['attributes'],function(_0x3035da){var _0x4015a1={};_0x4015a1[_0x3035da]={'$like':'%'+_0x1516f1['query']['filter']+'%'};return _0x4015a1;})});}_0x21b361=_[_0x7777('0x44')]({},_0x21b361,_0x1516f1[_0x7777('0x48')]);return _0x567623['getIntervals'](_0x21b361);}})[_0x7777('0x2a')](function(_0x11b994){if(_0x11b994){_0x5e8d32=_0x11b994['length'];if(!_0x1516f1[_0x7777('0x39')][_0x7777('0x3e')](_0x7777('0x3f'))){_0x21b361[_0x7777('0x24')]=qs[_0x7777('0x24')](_0x1516f1[_0x7777('0x39')][_0x7777('0x24')]);_0x21b361[_0x7777('0x21')]=qs['offset'](_0x1516f1['query'][_0x7777('0x21')]);}return _0x567623[_0x7777('0x5b')](_0x21b361);}})[_0x7777('0x2a')](function(_0x3ca22a){if(_0x3ca22a){return _0x3ca22a?{'count':_0x5e8d32,'rows':_0x3ca22a}:null;}})[_0x7777('0x2a')](respondWithResult(_0x52626c,null))[_0x7777('0x50')](handleError(_0x52626c,null));};exports[_0x7777('0x5e')]=function(_0x4041fb,_0x500780,_0x3f93b2){return db[_0x7777('0x35')]['findOne']({'where':{'id':_0x4041fb[_0x7777('0x4c')]['id']}})[_0x7777('0x2a')](handleEntityNotFound(_0x500780,null))[_0x7777('0x2a')](function(_0x6bf47d){if(_0x6bf47d){return db[_0x7777('0x5f')]['transaction'](function(_0x48537e){return db['Interval']['destroy']({'where':{'IntervalId':_0x4041fb[_0x7777('0x4c')]['id']},'transaction':_0x48537e})[_0x7777('0x2a')](function(_0x562a31){var _0x10e7c7=_[_0x7777('0x34')](_0x4041fb['body'],function(_0x79e5b0){delete _0x79e5b0['id'];_0x79e5b0[_0x7777('0x60')]=_0x4041fb[_0x7777('0x4c')]['id'];return _0x79e5b0;});return db[_0x7777('0x35')][_0x7777('0x61')](_0x10e7c7,{'transaction':_0x48537e});});})[_0x7777('0x2a')](function(){return db[_0x7777('0x35')][_0x7777('0x49')]({'where':{'IntervalId':_0x4041fb[_0x7777('0x4c')]['id']}});});}})['then'](respondWithResult(_0x500780,null))[_0x7777('0x50')](handleError(_0x500780,null));}; \ No newline at end of file +var _0x208b=['UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','keys','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get'];(function(_0x287d08,_0x55ab1e){var _0x3e7834=function(_0x3cada6){while(--_0x3cada6){_0x287d08['push'](_0x287d08['shift']());}};_0x3e7834(++_0x55ab1e);}(_0x208b,0xec));var _0xb208=function(_0x45c80e,_0x58a7e2){_0x45c80e=_0x45c80e-0x0;var _0x5374de=_0x208b[_0x45c80e];return _0x5374de;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb208('0x0'));var jsonpatch=require(_0xb208('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb208('0x2'));var Mustache=require(_0xb208('0x3'));var util=require(_0xb208('0x4'));var path=require('path');var sox=require(_0xb208('0x5'));var csv=require(_0xb208('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb208('0x7'));var _=require('lodash');var squel=require(_0xb208('0x8'));var crypto=require(_0xb208('0x9'));var jsforce=require(_0xb208('0xa'));var deskjs=require(_0xb208('0xb'));var toCsv=require(_0xb208('0x6'));var querystring=require(_0xb208('0xc'));var Papa=require(_0xb208('0xd'));var Redis=require(_0xb208('0xe'));var authService=require(_0xb208('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb208('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb208('0x11'))(_0xb208('0x12'));var utils=require(_0xb208('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb208('0x14'));var db=require(_0xb208('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0xd9b216,_0x335df4){_0x335df4=_0x335df4||0xcc;return function(_0x4a6d8c){if(_0x4a6d8c){return _0xd9b216[_0xb208('0x16')](_0x335df4);}return _0xd9b216[_0xb208('0x17')](_0x335df4)['end']();};}function respondWithResult(_0x547a55,_0xce7dce){_0xce7dce=_0xce7dce||0xc8;return function(_0x5df9de){if(_0x5df9de){return _0x547a55[_0xb208('0x17')](_0xce7dce)[_0xb208('0x18')](_0x5df9de);}};}function respondWithFilteredResult(_0xf37adf,_0x1b1170){return function(_0x278518){if(_0x278518){var _0x3a015e=typeof _0x1b1170[_0xb208('0x19')]===_0xb208('0x1a')&&typeof _0x1b1170[_0xb208('0x1b')]===_0xb208('0x1a');var _0x374e67=_0x278518[_0xb208('0x1c')];var _0x41e014=_0x3a015e?0x0:_0x1b1170[_0xb208('0x19')];var _0x4a9213=_0x3a015e?_0x278518[_0xb208('0x1c')]:_0x1b1170[_0xb208('0x19')]+_0x1b1170[_0xb208('0x1b')];var _0x148433;if(_0x4a9213>=_0x374e67){_0x4a9213=_0x374e67;_0x148433=0xc8;}else{_0x148433=0xce;}_0xf37adf[_0xb208('0x17')](_0x148433);return _0xf37adf['set'](_0xb208('0x1d'),_0x41e014+'-'+_0x4a9213+'/'+_0x374e67)[_0xb208('0x18')](_0x278518);}return null;};}function patchUpdates(_0x3048c0){return function(_0x3c03e3){try{jsonpatch[_0xb208('0x1e')](_0x3c03e3,_0x3048c0,!![]);}catch(_0x3277c5){return BPromise[_0xb208('0x1f')](_0x3277c5);}return _0x3c03e3[_0xb208('0x20')]();};}function saveUpdates(_0x4c00e3,_0x248576){return function(_0x2a78bf){if(_0x2a78bf){return _0x2a78bf[_0xb208('0x21')](_0x4c00e3)[_0xb208('0x22')](function(_0x5ddf99){return _0x5ddf99;});}return null;};}function removeEntity(_0x1f065d,_0x3d0030){return function(_0x1edab2){if(_0x1edab2){return _0x1edab2[_0xb208('0x23')]()[_0xb208('0x22')](function(){var _0x820fd7=_0x1edab2[_0xb208('0x24')]({'plain':!![]});var _0x569ff9='Intervals';return db[_0xb208('0x25')][_0xb208('0x23')]({'where':{'type':_0x569ff9,'resourceId':_0x820fd7['id']}})[_0xb208('0x22')](function(){return _0x1edab2;});})[_0xb208('0x22')](function(){_0x1f065d[_0xb208('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a8e8f,_0x519a8b){return function(_0x235e4f){if(!_0x235e4f){_0x5a8e8f['sendStatus'](0x194);}return _0x235e4f;};}function handleError(_0x5b16d2,_0x411fd8){_0x411fd8=_0x411fd8||0x1f4;return function(_0x4de573){logger[_0xb208('0x26')](_0x4de573[_0xb208('0x27')]);if(_0x4de573['name']){delete _0x4de573[_0xb208('0x28')];}_0x5b16d2[_0xb208('0x17')](_0x411fd8)[_0xb208('0x29')](_0x4de573);};}exports[_0xb208('0x2a')]=function(_0xb7d3ee,_0x1ee72b){var _0x7fcb32={},_0x1a343a={},_0x8ee910={'count':0x0,'rows':[]};var _0x318906=_[_0xb208('0x2b')](db[_0xb208('0x2c')][_0xb208('0x2d')],function(_0x58ea03){return{'name':_0x58ea03[_0xb208('0x2e')],'type':_0x58ea03[_0xb208('0x2f')][_0xb208('0x30')]};});_0x1a343a[_0xb208('0x31')]=_[_0xb208('0x2b')](_0x318906,_0xb208('0x28'));_0x1a343a[_0xb208('0x32')]=_['keys'](_0xb7d3ee[_0xb208('0x32')]);_0x1a343a[_0xb208('0x33')]=_[_0xb208('0x34')](_0x1a343a[_0xb208('0x31')],_0x1a343a[_0xb208('0x32')]);_0x7fcb32[_0xb208('0x35')]=_[_0xb208('0x34')](_0x1a343a['model'],qs[_0xb208('0x36')](_0xb7d3ee[_0xb208('0x32')][_0xb208('0x36')]));_0x7fcb32['attributes']=_0x7fcb32['attributes']['length']?_0x7fcb32[_0xb208('0x35')]:_0x1a343a[_0xb208('0x31')];if(!_0xb7d3ee['query'][_0xb208('0x37')](_0xb208('0x38'))){_0x7fcb32[_0xb208('0x1b')]=qs[_0xb208('0x1b')](_0xb7d3ee[_0xb208('0x32')][_0xb208('0x1b')]);_0x7fcb32[_0xb208('0x19')]=qs['offset'](_0xb7d3ee[_0xb208('0x32')][_0xb208('0x19')]);}_0x7fcb32[_0xb208('0x39')]=qs[_0xb208('0x3a')](_0xb7d3ee[_0xb208('0x32')][_0xb208('0x3a')]);_0x7fcb32[_0xb208('0x3b')]=qs[_0xb208('0x33')](_[_0xb208('0x3c')](_0xb7d3ee['query'],_0x1a343a[_0xb208('0x33')]),_0x318906);if(_0xb7d3ee[_0xb208('0x32')][_0xb208('0x3d')]){_0x7fcb32[_0xb208('0x3b')]=_['merge'](_0x7fcb32['where'],{'$or':_['map'](_0x318906,function(_0x17272a){if(_0x17272a[_0xb208('0x2f')]!=='VIRTUAL'){var _0x5e2abe={};_0x5e2abe[_0x17272a[_0xb208('0x28')]]={'$like':'%'+_0xb7d3ee[_0xb208('0x32')][_0xb208('0x3d')]+'%'};return _0x5e2abe;}})});}_0x7fcb32=_[_0xb208('0x3e')]({},_0x7fcb32,_0xb7d3ee['options']);var _0x2b9e9f={'where':_0x7fcb32[_0xb208('0x3b')]};return db[_0xb208('0x2c')][_0xb208('0x1c')](_0x2b9e9f)[_0xb208('0x22')](function(_0x3e1647){_0x8ee910['count']=_0x3e1647;if(_0xb7d3ee[_0xb208('0x32')][_0xb208('0x3f')]){_0x7fcb32[_0xb208('0x40')]=[{'all':!![]}];}return db[_0xb208('0x2c')][_0xb208('0x41')](_0x7fcb32);})[_0xb208('0x22')](function(_0x5535cd){_0x8ee910[_0xb208('0x42')]=_0x5535cd;return _0x8ee910;})['then'](respondWithFilteredResult(_0x1ee72b,_0x7fcb32))[_0xb208('0x43')](handleError(_0x1ee72b,null));};exports[_0xb208('0x44')]=function(_0xe4fbe7,_0x1afece){var _0x536981={'raw':!![],'where':{'id':_0xe4fbe7['params']['id']}},_0x4222f8={};_0x4222f8[_0xb208('0x31')]=_[_0xb208('0x45')](db[_0xb208('0x2c')][_0xb208('0x2d')]);_0x4222f8[_0xb208('0x32')]=_[_0xb208('0x45')](_0xe4fbe7['query']);_0x4222f8['filters']=_['intersection'](_0x4222f8['model'],_0x4222f8[_0xb208('0x32')]);_0x536981[_0xb208('0x35')]=_['intersection'](_0x4222f8[_0xb208('0x31')],qs[_0xb208('0x36')](_0xe4fbe7[_0xb208('0x32')][_0xb208('0x36')]));_0x536981['attributes']=_0x536981['attributes'][_0xb208('0x46')]?_0x536981[_0xb208('0x35')]:_0x4222f8[_0xb208('0x31')];if(_0xe4fbe7['query'][_0xb208('0x3f')]){_0x536981[_0xb208('0x40')]=[{'all':!![]}];}_0x536981=_[_0xb208('0x3e')]({},_0x536981,_0xe4fbe7[_0xb208('0x47')]);return db[_0xb208('0x2c')][_0xb208('0x48')](_0x536981)[_0xb208('0x22')](handleEntityNotFound(_0x1afece,null))[_0xb208('0x22')](respondWithResult(_0x1afece,null))[_0xb208('0x43')](handleError(_0x1afece,null));};exports[_0xb208('0x49')]=function(_0x50f5eb,_0x1897fd){return db[_0xb208('0x2c')][_0xb208('0x49')](_0x50f5eb[_0xb208('0x4a')],{})['then'](function(_0x1551d1){var _0x208b08=_0x50f5eb[_0xb208('0x4b')][_0xb208('0x24')]({'plain':!![]});if(!_0x208b08)throw new Error(_0xb208('0x4c'));if(_0x208b08['role']===_0xb208('0x4b')){var _0xe4f212=_0x1551d1['get']({'plain':!![]});var _0x4248ec=_0xb208('0x4d');return db[_0xb208('0x4e')][_0xb208('0x48')]({'where':{'name':_0x4248ec,'userProfileId':_0x208b08[_0xb208('0x4f')]},'raw':!![]})[_0xb208('0x22')](function(_0x51a60d){if(_0x51a60d&&_0x51a60d[_0xb208('0x50')]===0x0){return db[_0xb208('0x25')]['create']({'name':_0xe4f212[_0xb208('0x28')],'resourceId':_0xe4f212['id'],'type':_0x51a60d[_0xb208('0x28')],'sectionId':_0x51a60d['id']},{})[_0xb208('0x22')](function(){return _0x1551d1;});}else{return _0x1551d1;}})[_0xb208('0x43')](function(_0x2e8596){logger[_0xb208('0x26')](_0xb208('0x51'),_0x2e8596);throw _0x2e8596;});}return _0x1551d1;})[_0xb208('0x22')](respondWithResult(_0x1897fd,0xc9))[_0xb208('0x43')](handleError(_0x1897fd,null));};exports[_0xb208('0x21')]=function(_0x13f684,_0x342d77){if(_0x13f684[_0xb208('0x4a')]['id']){delete _0x13f684[_0xb208('0x4a')]['id'];}return db[_0xb208('0x2c')][_0xb208('0x48')]({'where':{'id':_0x13f684['params']['id']}})['then'](handleEntityNotFound(_0x342d77,null))[_0xb208('0x22')](saveUpdates(_0x13f684['body'],null))[_0xb208('0x22')](respondWithResult(_0x342d77,null))[_0xb208('0x43')](handleError(_0x342d77,null));};exports['destroy']=function(_0x279963,_0x2fab40){return db[_0xb208('0x2c')]['find']({'where':{'id':_0x279963[_0xb208('0x52')]['id']}})[_0xb208('0x22')](handleEntityNotFound(_0x2fab40,null))[_0xb208('0x22')](removeEntity(_0x2fab40,null))['catch'](handleError(_0x2fab40,null));};exports[_0xb208('0x53')]=function(_0x1a8c5e,_0x343cf7,_0x1e1917){if(_0x1a8c5e[_0xb208('0x4a')]['id']){delete _0x1a8c5e['body']['id'];}return db[_0xb208('0x2c')][_0xb208('0x48')]({'where':{'id':_0x1a8c5e[_0xb208('0x52')]['id']}})['then'](handleEntityNotFound(_0x343cf7,null))[_0xb208('0x22')](function(_0xd7c677){if(_0xd7c677){_0x1a8c5e[_0xb208('0x4a')][_0xb208('0x54')]=_0xd7c677['id'];return db[_0xb208('0x2c')][_0xb208('0x49')](_0x1a8c5e[_0xb208('0x4a')]);}})[_0xb208('0x22')](respondWithResult(_0x343cf7,null))[_0xb208('0x43')](handleError(_0x343cf7,null));};exports[_0xb208('0x55')]=function(_0x5c6190,_0x455f35,_0x53f96f){var _0x1046e5={};var _0x2f109a={};var _0x16bd73;var _0x26441b;return db[_0xb208('0x2c')][_0xb208('0x56')]({'where':{'id':_0x5c6190[_0xb208('0x52')]['id']}})[_0xb208('0x22')](handleEntityNotFound(_0x455f35,null))[_0xb208('0x22')](function(_0x569ca2){if(_0x569ca2){_0x16bd73=_0x569ca2;_0x2f109a[_0xb208('0x31')]=_[_0xb208('0x45')](db[_0xb208('0x2c')][_0xb208('0x2d')]);_0x2f109a[_0xb208('0x32')]=_[_0xb208('0x45')](_0x5c6190['query']);_0x2f109a[_0xb208('0x33')]=_[_0xb208('0x34')](_0x2f109a[_0xb208('0x31')],_0x2f109a[_0xb208('0x32')]);_0x1046e5[_0xb208('0x35')]=_[_0xb208('0x34')](_0x2f109a['model'],qs[_0xb208('0x36')](_0x5c6190[_0xb208('0x32')][_0xb208('0x36')]));_0x1046e5[_0xb208('0x35')]=_0x1046e5[_0xb208('0x35')][_0xb208('0x46')]?_0x1046e5['attributes']:_0x2f109a[_0xb208('0x31')];_0x1046e5['order']=qs[_0xb208('0x3a')](_0x5c6190[_0xb208('0x32')][_0xb208('0x3a')]);_0x1046e5[_0xb208('0x3b')]=qs[_0xb208('0x33')](_[_0xb208('0x3c')](_0x5c6190[_0xb208('0x32')],_0x2f109a['filters']));if(_0x5c6190[_0xb208('0x32')]['filter']){_0x1046e5[_0xb208('0x3b')]=_[_0xb208('0x3e')](_0x1046e5[_0xb208('0x3b')],{'$or':_[_0xb208('0x2b')](_0x1046e5[_0xb208('0x35')],function(_0x1e0bad){var _0x2bc398={};_0x2bc398[_0x1e0bad]={'$like':'%'+_0x5c6190['query'][_0xb208('0x3d')]+'%'};return _0x2bc398;})});}_0x1046e5=_[_0xb208('0x3e')]({},_0x1046e5,_0x5c6190['options']);return _0x16bd73[_0xb208('0x55')](_0x1046e5);}})[_0xb208('0x22')](function(_0x3ce9f9){if(_0x3ce9f9){_0x26441b=_0x3ce9f9[_0xb208('0x46')];if(!_0x5c6190[_0xb208('0x32')][_0xb208('0x37')](_0xb208('0x38'))){_0x1046e5['limit']=qs[_0xb208('0x1b')](_0x5c6190['query']['limit']);_0x1046e5[_0xb208('0x19')]=qs['offset'](_0x5c6190[_0xb208('0x32')][_0xb208('0x19')]);}return _0x16bd73['getIntervals'](_0x1046e5);}})[_0xb208('0x22')](function(_0x26a7e6){if(_0x26a7e6){return _0x26a7e6?{'count':_0x26441b,'rows':_0x26a7e6}:null;}})[_0xb208('0x22')](respondWithResult(_0x455f35,null))[_0xb208('0x43')](handleError(_0x455f35,null));};exports[_0xb208('0x57')]=function(_0x412d3c,_0x4960fe,_0x5480f0){return db['Interval'][_0xb208('0x56')]({'where':{'id':_0x412d3c[_0xb208('0x52')]['id']}})['then'](handleEntityNotFound(_0x4960fe,null))[_0xb208('0x22')](function(_0x1457c1){if(_0x1457c1){return db[_0xb208('0x58')][_0xb208('0x59')](function(_0x1b1987){return db[_0xb208('0x2c')][_0xb208('0x23')]({'where':{'IntervalId':_0x412d3c[_0xb208('0x52')]['id']},'transaction':_0x1b1987})[_0xb208('0x22')](function(_0x20c426){var _0x1cdbf9=_['map'](_0x412d3c[_0xb208('0x4a')],function(_0x262724){delete _0x262724['id'];_0x262724['IntervalId']=_0x412d3c['params']['id'];return _0x262724;});return db['Interval'][_0xb208('0x5a')](_0x1cdbf9,{'transaction':_0x1b1987});});})[_0xb208('0x22')](function(){return db[_0xb208('0x2c')][_0xb208('0x41')]({'where':{'IntervalId':_0x412d3c[_0xb208('0x52')]['id']}});});}})[_0xb208('0x22')](respondWithResult(_0x4960fe,null))[_0xb208('0x43')](handleError(_0x4960fe,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 72f260a..2652e94 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 _0xa12e=['lodash','util','bluebird','request-promise','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0x43f1b5,_0x3ef8e5){var _0x15d9e4=function(_0x2197c0){while(--_0x2197c0){_0x43f1b5['push'](_0x43f1b5['shift']());}};_0x15d9e4(++_0x3ef8e5);}(_0xa12e,0x138));var _0xea12=function(_0x1a7a39,_0x47b900){_0x1a7a39=_0x1a7a39-0x0;var _0x24af5b=_0xa12e[_0x1a7a39];return _0x24af5b;};'use strict';var _=require(_0xea12('0x0'));var util=require(_0xea12('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xea12('0x2'));var rp=require(_0xea12('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea12('0x4'));var config=require(_0xea12('0x5'));var attributes=require(_0xea12('0x6'));var extensions=require(_0xea12('0x7'));module[_0xea12('0x8')]=function(_0x2904ef,_0x2f325a){return _0x2904ef[_0xea12('0x9')](_0xea12('0xa'),attributes,{'tableName':_0xea12('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b8e29,_0x35b137){extensions['rewrite'](_0x2904ef,_0x2b8e29);},'afterBulkCreate':function(_0x3f39cf,_0x2a22f9,_0x13bf70){_0x13bf70();extensions[_0xea12('0xc')](_0x2904ef,_0x3f39cf[0x0]);},'afterUpdate':function(_0x1dd0c6,_0x1eccaf){extensions['rewrite'](_0x2904ef,_0x1dd0c6);},'afterDestroy':function(_0x2b65d9,_0x162d5c){extensions[_0xea12('0xc')](_0x2904ef,_0x2b65d9);}}});}; \ No newline at end of file +var _0x51a1=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0x5d2d65,_0x5bb576){var _0x6a74c=function(_0x4f3e61){while(--_0x4f3e61){_0x5d2d65['push'](_0x5d2d65['shift']());}};_0x6a74c(++_0x5bb576);}(_0x51a1,0x134));var _0x151a=function(_0x663d88,_0x56d198){_0x663d88=_0x663d88-0x0;var _0x5bb82d=_0x51a1[_0x663d88];return _0x5bb82d;};'use strict';var _=require('lodash');var util=require(_0x151a('0x0'));var logger=require('../../config/logger')(_0x151a('0x1'));var moment=require(_0x151a('0x2'));var BPromise=require(_0x151a('0x3'));var rp=require(_0x151a('0x4'));var fs=require('fs');var path=require(_0x151a('0x5'));var rimraf=require(_0x151a('0x6'));var config=require(_0x151a('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0x151a('0x8'));module[_0x151a('0x9')]=function(_0x38121b,_0x5b3d9a){return _0x38121b[_0x151a('0xa')](_0x151a('0xb'),attributes,{'tableName':_0x151a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x36d0c5,_0x1b59bd){extensions[_0x151a('0xd')](_0x38121b,_0x36d0c5);},'afterBulkCreate':function(_0x43f3fd,_0x326612,_0x1d5b62){_0x1d5b62();extensions['rewrite'](_0x38121b,_0x43f3fd[0x0]);},'afterUpdate':function(_0x2fbe11,_0x3f3c96){extensions[_0x151a('0xd')](_0x38121b,_0x2fbe11);},'afterDestroy':function(_0x46c740,_0x51290a){extensions[_0x151a('0xd')](_0x38121b,_0x46c740);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 3db483a..8a70372 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 5dee5e4..c1edfd8 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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x263738,_0xcec24e){var _0x564f51=function(_0x54d8fd){while(--_0x54d8fd){_0x263738['push'](_0x263738['shift']());}};_0x564f51(++_0xcec24e);}(_0x2ef3,0xba));var _0x32ef=function(_0x11ffc6,_0x98439){_0x11ffc6=_0x11ffc6-0x0;var _0x1f7551=_0x2ef3[_0x11ffc6];return _0x1f7551;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x474e22,_0x5d5515){_0x474e22=_0x474e22-0x0;var _0x76a179=_0x0b0e[_0x474e22];return _0x76a179;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('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 ab5abc8..f59cb86 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 _0xf0b0=['remoteAddress','bluebird','https','api','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','stringify','issuetype','Bug','fields','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','utf8','data','end','status','statusCode','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','connection','socket'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0xf0b0,0xd3));var _0x0f0b=function(_0x52a466,_0x548f8b){_0x52a466=_0x52a466-0x0;var _0x38b7c5=_0xf0b0[_0x52a466];return _0x38b7c5;};'use strict';var BPromise=require(_0x0f0b('0x0'));var https=require(_0x0f0b('0x1'));var logger=require('../../config/logger')(_0x0f0b('0x2'));var USERNAME='support';var PASSWORD=_0x0f0b('0x3');function openIssue(_0x37fa12,_0x88b31c){var _0x343c1e={'fields':{'project':{'key':_0x37fa12[_0x0f0b('0x4')]||_0x0f0b('0x5')},'summary':(_0x37fa12[_0x0f0b('0x6')]||'Report')+_0x0f0b('0x7')+_0x37fa12['ip'],'description':_0x37fa12['description']||JSON[_0x0f0b('0x8')](_0x37fa12),'issuetype':{'name':_0x37fa12[_0x0f0b('0x9')]||_0x0f0b('0xa')}}};_0x343c1e['fields']['customfield_11500']=_0x37fa12['email'];_0x343c1e[_0x0f0b('0xb')][_0x0f0b('0xc')]=_0x37fa12[_0x0f0b('0xd')];_0x343c1e[_0x0f0b('0xb')]['customfield_11502']=_0x37fa12[_0x0f0b('0xe')];_0x343c1e['fields'][_0x0f0b('0xf')]=_0x37fa12[_0x0f0b('0x10')];_0x343c1e[_0x0f0b('0xb')][_0x0f0b('0x11')]=_0x37fa12[_0x0f0b('0x12')];_0x343c1e['fields']['customfield_10102']=_0x37fa12['ip'];var _0x4ece26={'host':_0x0f0b('0x13'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x0f0b('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x0f0b('0x15'),'Authorization':_0x0f0b('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x0f0b('0x17')](_0x0f0b('0x18'))}};var _0x18420e=JSON[_0x0f0b('0x8')](_0x343c1e);var _0x2f4fa7=https[_0x0f0b('0x19')](_0x4ece26,function(_0x408d0d){_0x408d0d['setEncoding'](_0x0f0b('0x1a'));var _0x24520b='';_0x408d0d['on'](_0x0f0b('0x1b'),function(_0x512917){_0x24520b+=_0x512917;});_0x408d0d['on'](_0x0f0b('0x1c'),function(){if(_0x88b31c){return _0x88b31c[_0x0f0b('0x1d')](_0x408d0d[_0x0f0b('0x1e')])['json'](JSON['parse'](_0x24520b));}});});_0x2f4fa7['on'](_0x0f0b('0x1f'),function(_0x19db2c){if(_0x88b31c){return _0x88b31c['status'](0x1f4)['json']({'errors':[{'message':_0x0f0b('0x20'),'type':_0x0f0b('0x21')}]});}});_0x2f4fa7[_0x0f0b('0x22')](_0x18420e);_0x2f4fa7['end']();}exports[_0x0f0b('0x23')]=openIssue;exports[_0x0f0b('0x24')]=function(_0x2b7050,_0x59fe44){_0x2b7050[_0x0f0b('0x25')]['ip']=_0x2b7050[_0x0f0b('0x26')]['x-forwarded-for']||_0x2b7050[_0x0f0b('0x27')]['remoteAddress']||_0x2b7050[_0x0f0b('0x28')][_0x0f0b('0x29')]||_0x2b7050[_0x0f0b('0x27')][_0x0f0b('0x28')][_0x0f0b('0x29')];return openIssue(_0x2b7050[_0x0f0b('0x25')],_0x59fe44);}; \ No newline at end of file +var _0x4a98=['status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','headers','x-forwarded-for','connection','remoteAddress','socket','body','api','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','toString','base64','request','setEncoding','data'];(function(_0x43a591,_0x4e5f0e){var _0xa993ff=function(_0x45714a){while(--_0x45714a){_0x43a591['push'](_0x43a591['shift']());}};_0xa993ff(++_0x4e5f0e);}(_0x4a98,0x93));var _0x84a9=function(_0x223bdb,_0x5882e6){_0x223bdb=_0x223bdb-0x0;var _0xef8e68=_0x4a98[_0x223bdb];return _0xef8e68;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require('../../config/logger')(_0x84a9('0x0'));var USERNAME='support';var PASSWORD=_0x84a9('0x1');function openIssue(_0x36ac72,_0x42ff3f){var _0x286f49={'fields':{'project':{'key':_0x36ac72[_0x84a9('0x2')]||_0x84a9('0x3')},'summary':(_0x36ac72[_0x84a9('0x4')]||_0x84a9('0x5'))+_0x84a9('0x6')+_0x36ac72['ip'],'description':_0x36ac72[_0x84a9('0x7')]||JSON[_0x84a9('0x8')](_0x36ac72),'issuetype':{'name':_0x36ac72[_0x84a9('0x9')]||_0x84a9('0xa')}}};_0x286f49[_0x84a9('0xb')][_0x84a9('0xc')]=_0x36ac72['email'];_0x286f49[_0x84a9('0xb')]['customfield_11501']=_0x36ac72[_0x84a9('0xd')];_0x286f49[_0x84a9('0xb')][_0x84a9('0xe')]=_0x36ac72[_0x84a9('0xf')];_0x286f49[_0x84a9('0xb')][_0x84a9('0x10')]=_0x36ac72[_0x84a9('0x11')];_0x286f49[_0x84a9('0xb')][_0x84a9('0x12')]=_0x36ac72[_0x84a9('0x13')];_0x286f49[_0x84a9('0xb')][_0x84a9('0x14')]=_0x36ac72['ip'];var _0x5d7b15={'host':_0x84a9('0x15'),'port':0x1bb,'path':_0x84a9('0x16'),'method':_0x84a9('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x84a9('0x18')](_0x84a9('0x19'))}};var _0x5621b4=JSON[_0x84a9('0x8')](_0x286f49);var _0x209dc6=https[_0x84a9('0x1a')](_0x5d7b15,function(_0x4b114f){_0x4b114f[_0x84a9('0x1b')]('utf8');var _0x345c3c='';_0x4b114f['on'](_0x84a9('0x1c'),function(_0x350953){_0x345c3c+=_0x350953;});_0x4b114f['on']('end',function(){if(_0x42ff3f){return _0x42ff3f[_0x84a9('0x1d')](_0x4b114f['statusCode'])[_0x84a9('0x1e')](JSON[_0x84a9('0x1f')](_0x345c3c));}});});_0x209dc6['on'](_0x84a9('0x20'),function(_0x522e8f){if(_0x42ff3f){return _0x42ff3f['status'](0x1f4)[_0x84a9('0x1e')]({'errors':[{'message':_0x84a9('0x21'),'type':_0x84a9('0x22')}]});}});_0x209dc6[_0x84a9('0x23')](_0x5621b4);_0x209dc6[_0x84a9('0x24')]();}exports[_0x84a9('0x25')]=openIssue;exports['send']=function(_0x552511,_0x45e66){_0x552511['body']['ip']=_0x552511[_0x84a9('0x26')][_0x84a9('0x27')]||_0x552511[_0x84a9('0x28')][_0x84a9('0x29')]||_0x552511[_0x84a9('0x2a')][_0x84a9('0x29')]||_0x552511[_0x84a9('0x28')]['socket']['remoteAddress'];return openIssue(_0x552511[_0x84a9('0x2b')],_0x45e66);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index c28070c..eb78b60 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 _0xfd28=['show','put','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0xfd28,0x148));var _0x8fd2=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0xfd28[_0x513545];return _0x18b7c5;};'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')]('/describe',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0x7')](_0x8fd2('0xb'),auth['isAuthenticated'](),controller[_0x8fd2('0xc')]);router['post']('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xd')]('/:id',auth[_0x8fd2('0x8')](),controller['update']);router[_0x8fd2('0xe')]('/:id',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0xf')]);module[_0x8fd2('0x10')]=router; \ No newline at end of file +var _0x4ea3=['multer','util','path','connect-timeout','Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','post','update','destroy','exports'];(function(_0x469c01,_0x10c93c){var _0x534c6f=function(_0x7de94f){while(--_0x7de94f){_0x469c01['push'](_0x469c01['shift']());}};_0x534c6f(++_0x10c93c);}(_0x4ea3,0x70));var _0x34ea=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4ea3[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var path=require(_0x34ea('0x2'));var timeout=require(_0x34ea('0x3'));var express=require('express');var router=express[_0x34ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34ea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x34ea('0x6'));router[_0x34ea('0x7')]('/',auth[_0x34ea('0x8')](),controller[_0x34ea('0x9')]);router[_0x34ea('0x7')](_0x34ea('0xa'),auth[_0x34ea('0x8')](),controller['describe']);router[_0x34ea('0x7')](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller['show']);router[_0x34ea('0xc')]('/',auth[_0x34ea('0x8')](),controller['create']);router['put'](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xd')]);router['delete'](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xe')]);module[_0x34ea('0xf')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 0671af1..6d3291e 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x59dbac,_0x10cd1b){_0x59dbac=_0x59dbac-0x0;var _0x107c28=_0x7a54[_0x59dbac];return _0x107c28;};'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(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x566216,_0x81697){_0x566216=_0x566216-0x0;var _0xcdfe1f=_0x7a54[_0x566216];return _0xcdfe1f;};'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 29f72df..b077dc1 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 _0x02a7=['then','destroy','end','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','undefined','count','offset','status','set','Content-Range','json','apply','reject','save','update'];(function(_0xbda849,_0x2dcb1a){var _0x2d3e9d=function(_0x2c8f10){while(--_0x2c8f10){_0xbda849['push'](_0xbda849['shift']());}};_0x2d3e9d(++_0x2dcb1a);}(_0x02a7,0x7a));var _0x702a=function(_0x108149,_0x1bf997){_0x108149=_0x108149-0x0;var _0xab7d20=_0x02a7[_0x108149];return _0xab7d20;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x702a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x702a('0x1'));var moment=require(_0x702a('0x2'));var BPromise=require(_0x702a('0x3'));var Mustache=require(_0x702a('0x4'));var util=require(_0x702a('0x5'));var path=require(_0x702a('0x6'));var sox=require(_0x702a('0x7'));var csv=require('to-csv');var ejs=require(_0x702a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x702a('0x9'));var squel=require(_0x702a('0xa'));var crypto=require(_0x702a('0xb'));var jsforce=require(_0x702a('0xc'));var deskjs=require(_0x702a('0xd'));var toCsv=require(_0x702a('0xe'));var querystring=require(_0x702a('0xf'));var Papa=require('papaparse');var Redis=require(_0x702a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x702a('0x11'));var hardwareService=require(_0x702a('0x12'));var logger=require(_0x702a('0x13'))(_0x702a('0x14'));var utils=require('../../config/utils');var config=require(_0x702a('0x15'));var licenseUtil=require(_0x702a('0x16'));var db=require(_0x702a('0x17'))['db'];function respondWithStatusCode(_0x221b35,_0x4688d1){_0x4688d1=_0x4688d1||0xcc;return function(_0x75455){if(_0x75455){return _0x221b35[_0x702a('0x18')](_0x4688d1);}return _0x221b35['status'](_0x4688d1)['end']();};}function respondWithResult(_0x38139d,_0x57f5fc){_0x57f5fc=_0x57f5fc||0xc8;return function(_0x576cf8){if(_0x576cf8){return _0x38139d['status'](_0x57f5fc)['json'](_0x576cf8);}};}function respondWithFilteredResult(_0x5c768d,_0x44f7fd){return function(_0x3c9770){if(_0x3c9770){var _0xa124dd=typeof _0x44f7fd['offset']==='undefined'&&typeof _0x44f7fd['limit']===_0x702a('0x19');var _0x469cb2=_0x3c9770[_0x702a('0x1a')];var _0x492cfb=_0xa124dd?0x0:_0x44f7fd[_0x702a('0x1b')];var _0x5ec1b3=_0xa124dd?_0x3c9770[_0x702a('0x1a')]:_0x44f7fd[_0x702a('0x1b')]+_0x44f7fd['limit'];var _0x4f8b29;if(_0x5ec1b3>=_0x469cb2){_0x5ec1b3=_0x469cb2;_0x4f8b29=0xc8;}else{_0x4f8b29=0xce;}_0x5c768d[_0x702a('0x1c')](_0x4f8b29);return _0x5c768d[_0x702a('0x1d')](_0x702a('0x1e'),_0x492cfb+'-'+_0x5ec1b3+'/'+_0x469cb2)[_0x702a('0x1f')](_0x3c9770);}return null;};}function patchUpdates(_0x332254){return function(_0x3152bf){try{jsonpatch[_0x702a('0x20')](_0x3152bf,_0x332254,!![]);}catch(_0x3a4add){return BPromise[_0x702a('0x21')](_0x3a4add);}return _0x3152bf[_0x702a('0x22')]();};}function saveUpdates(_0x47d0f5,_0x1ecd28){return function(_0x3d213c){if(_0x3d213c){return _0x3d213c[_0x702a('0x23')](_0x47d0f5)[_0x702a('0x24')](function(_0x1d6dae){return _0x1d6dae;});}return null;};}function removeEntity(_0x466b74,_0x2aede0){return function(_0x156212){if(_0x156212){return _0x156212[_0x702a('0x25')]()['then'](function(){_0x466b74[_0x702a('0x1c')](0xcc)[_0x702a('0x26')]();});}};}function handleEntityNotFound(_0x57add6,_0xf08699){return function(_0x1a9fbf){if(!_0x1a9fbf){_0x57add6[_0x702a('0x18')](0x194);}return _0x1a9fbf;};}function handleError(_0xf6b463,_0x3d4ed0){_0x3d4ed0=_0x3d4ed0||0x1f4;return function(_0x2eff20){logger['error'](_0x2eff20[_0x702a('0x27')]);if(_0x2eff20[_0x702a('0x28')]){delete _0x2eff20['name'];}_0xf6b463[_0x702a('0x1c')](_0x3d4ed0)[_0x702a('0x29')](_0x2eff20);};}exports[_0x702a('0x2a')]=function(_0x21ba99,_0x1973c7){var _0xa0877a={},_0x1596a8={},_0x5c6da4={'count':0x0,'rows':[]};var _0x2d7044=_[_0x702a('0x2b')](db[_0x702a('0x2c')][_0x702a('0x2d')],function(_0x511e7e){return{'name':_0x511e7e[_0x702a('0x2e')],'type':_0x511e7e['type'][_0x702a('0x2f')]};});_0x1596a8[_0x702a('0x30')]=_['map'](_0x2d7044,'name');_0x1596a8[_0x702a('0x31')]=_[_0x702a('0x32')](_0x21ba99['query']);_0x1596a8[_0x702a('0x33')]=_['intersection'](_0x1596a8['model'],_0x1596a8[_0x702a('0x31')]);_0xa0877a[_0x702a('0x34')]=_[_0x702a('0x35')](_0x1596a8['model'],qs[_0x702a('0x36')](_0x21ba99[_0x702a('0x31')][_0x702a('0x36')]));_0xa0877a[_0x702a('0x34')]=_0xa0877a[_0x702a('0x34')][_0x702a('0x37')]?_0xa0877a[_0x702a('0x34')]:_0x1596a8[_0x702a('0x30')];if(!_0x21ba99[_0x702a('0x31')][_0x702a('0x38')](_0x702a('0x39'))){_0xa0877a[_0x702a('0x3a')]=qs[_0x702a('0x3a')](_0x21ba99[_0x702a('0x31')][_0x702a('0x3a')]);_0xa0877a[_0x702a('0x1b')]=qs[_0x702a('0x1b')](_0x21ba99[_0x702a('0x31')]['offset']);}_0xa0877a[_0x702a('0x3b')]=qs[_0x702a('0x3c')](_0x21ba99[_0x702a('0x31')][_0x702a('0x3c')]);_0xa0877a[_0x702a('0x3d')]=qs[_0x702a('0x33')](_[_0x702a('0x3e')](_0x21ba99[_0x702a('0x31')],_0x1596a8['filters']),_0x2d7044);if(_0x21ba99[_0x702a('0x31')][_0x702a('0x3f')]){_0xa0877a[_0x702a('0x3d')]=_[_0x702a('0x40')](_0xa0877a[_0x702a('0x3d')],{'$or':_[_0x702a('0x2b')](_0x2d7044,function(_0x3bc107){if(_0x3bc107[_0x702a('0x41')]!==_0x702a('0x42')){var _0x10fee4={};_0x10fee4[_0x3bc107[_0x702a('0x28')]]={'$like':'%'+_0x21ba99[_0x702a('0x31')][_0x702a('0x3f')]+'%'};return _0x10fee4;}})});}_0xa0877a=_[_0x702a('0x40')]({},_0xa0877a,_0x21ba99['options']);var _0x252b54={'where':_0xa0877a[_0x702a('0x3d')]};return db[_0x702a('0x2c')]['count'](_0x252b54)[_0x702a('0x24')](function(_0x202425){_0x5c6da4[_0x702a('0x1a')]=_0x202425;if(_0x21ba99[_0x702a('0x31')][_0x702a('0x43')]){_0xa0877a[_0x702a('0x44')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x702a('0x45')](_0xa0877a);})[_0x702a('0x24')](function(_0x34a26f){_0x5c6da4[_0x702a('0x46')]=_0x34a26f;return _0x5c6da4;})[_0x702a('0x24')](respondWithFilteredResult(_0x1973c7,_0xa0877a))[_0x702a('0x47')](handleError(_0x1973c7,null));};exports[_0x702a('0x48')]=function(_0x275262,_0x5a67df){var _0x41a7ab={'raw':!![],'where':{'id':_0x275262[_0x702a('0x49')]['id']}},_0x5dc8f8={};_0x5dc8f8[_0x702a('0x30')]=_[_0x702a('0x32')](db['JscriptyAnswerReport'][_0x702a('0x2d')]);_0x5dc8f8[_0x702a('0x31')]=_[_0x702a('0x32')](_0x275262[_0x702a('0x31')]);_0x5dc8f8[_0x702a('0x33')]=_[_0x702a('0x35')](_0x5dc8f8[_0x702a('0x30')],_0x5dc8f8['query']);_0x41a7ab['attributes']=_[_0x702a('0x35')](_0x5dc8f8[_0x702a('0x30')],qs['fields'](_0x275262['query']['fields']));_0x41a7ab[_0x702a('0x34')]=_0x41a7ab[_0x702a('0x34')][_0x702a('0x37')]?_0x41a7ab[_0x702a('0x34')]:_0x5dc8f8[_0x702a('0x30')];if(_0x275262[_0x702a('0x31')][_0x702a('0x43')]){_0x41a7ab[_0x702a('0x44')]=[{'all':!![]}];}_0x41a7ab=_[_0x702a('0x40')]({},_0x41a7ab,_0x275262[_0x702a('0x4a')]);return db[_0x702a('0x2c')][_0x702a('0x4b')](_0x41a7ab)[_0x702a('0x24')](handleEntityNotFound(_0x5a67df,null))['then'](respondWithResult(_0x5a67df,null))['catch'](handleError(_0x5a67df,null));};exports[_0x702a('0x4c')]=function(_0x919678,_0x5a1cdf){return db[_0x702a('0x2c')][_0x702a('0x4c')](_0x919678['body'],{})[_0x702a('0x24')](respondWithResult(_0x5a1cdf,0xc9))[_0x702a('0x47')](handleError(_0x5a1cdf,null));};exports[_0x702a('0x23')]=function(_0x55e380,_0x3b1bba){if(_0x55e380[_0x702a('0x4d')]['id']){delete _0x55e380['body']['id'];}return db[_0x702a('0x2c')][_0x702a('0x4b')]({'where':{'id':_0x55e380['params']['id']}})[_0x702a('0x24')](handleEntityNotFound(_0x3b1bba,null))[_0x702a('0x24')](saveUpdates(_0x55e380[_0x702a('0x4d')],null))[_0x702a('0x24')](respondWithResult(_0x3b1bba,null))[_0x702a('0x47')](handleError(_0x3b1bba,null));};exports[_0x702a('0x25')]=function(_0xee9f8d,_0xbf2b99){return db[_0x702a('0x2c')]['find']({'where':{'id':_0xee9f8d[_0x702a('0x49')]['id']}})[_0x702a('0x24')](handleEntityNotFound(_0xbf2b99,null))[_0x702a('0x24')](removeEntity(_0xbf2b99,null))[_0x702a('0x47')](handleError(_0xbf2b99,null));};exports['describe']=function(_0x859fe6,_0x4235b4){return db[_0x702a('0x2c')][_0x702a('0x4e')]()[_0x702a('0x24')](respondWithResult(_0x4235b4,null))['catch'](handleError(_0x4235b4,null));}; \ No newline at end of file +var _0xa93e=['../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','sendStatus','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','describe','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x2c87cc,_0x5389d7){var _0x32024c=function(_0x4ea4fe){while(--_0x4ea4fe){_0x2c87cc['push'](_0x2c87cc['shift']());}};_0x32024c(++_0x5389d7);}(_0xa93e,0x1df));var _0xea93=function(_0x16d20a,_0x27b636){_0x16d20a=_0x16d20a-0x0;var _0x397f09=_0xa93e[_0x16d20a];return _0x397f09;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xea93('0x0'));var jsonpatch=require(_0xea93('0x1'));var rp=require('request-promise');var moment=require(_0xea93('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xea93('0x3'));var util=require('util');var path=require('path');var sox=require(_0xea93('0x4'));var csv=require(_0xea93('0x5'));var ejs=require(_0xea93('0x6'));var fs=require('fs');var fs_extra=require(_0xea93('0x7'));var _=require(_0xea93('0x8'));var squel=require(_0xea93('0x9'));var crypto=require('crypto');var jsforce=require(_0xea93('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xea93('0xb'));var Redis=require(_0xea93('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xea93('0xd'));var as=require(_0xea93('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea93('0xf'))(_0xea93('0x10'));var utils=require(_0xea93('0x11'));var config=require(_0xea93('0x12'));var licenseUtil=require(_0xea93('0x13'));var db=require(_0xea93('0x14'))['db'];function respondWithStatusCode(_0x515cb9,_0x32664f){_0x32664f=_0x32664f||0xcc;return function(_0x4b42ef){if(_0x4b42ef){return _0x515cb9['sendStatus'](_0x32664f);}return _0x515cb9[_0xea93('0x15')](_0x32664f)[_0xea93('0x16')]();};}function respondWithResult(_0x1ae4e9,_0x2541b8){_0x2541b8=_0x2541b8||0xc8;return function(_0x21584a){if(_0x21584a){return _0x1ae4e9[_0xea93('0x15')](_0x2541b8)['json'](_0x21584a);}};}function respondWithFilteredResult(_0x190e98,_0x5d32cf){return function(_0x18a1db){if(_0x18a1db){var _0x30ee47=typeof _0x5d32cf[_0xea93('0x17')]===_0xea93('0x18')&&typeof _0x5d32cf[_0xea93('0x19')]===_0xea93('0x18');var _0x3c220d=_0x18a1db[_0xea93('0x1a')];var _0x3e0155=_0x30ee47?0x0:_0x5d32cf[_0xea93('0x17')];var _0x771685=_0x30ee47?_0x18a1db[_0xea93('0x1a')]:_0x5d32cf[_0xea93('0x17')]+_0x5d32cf['limit'];var _0x46a545;if(_0x771685>=_0x3c220d){_0x771685=_0x3c220d;_0x46a545=0xc8;}else{_0x46a545=0xce;}_0x190e98['status'](_0x46a545);return _0x190e98[_0xea93('0x1b')](_0xea93('0x1c'),_0x3e0155+'-'+_0x771685+'/'+_0x3c220d)[_0xea93('0x1d')](_0x18a1db);}return null;};}function patchUpdates(_0xea0f1b){return function(_0x1442ba){try{jsonpatch['apply'](_0x1442ba,_0xea0f1b,!![]);}catch(_0x201f6e){return BPromise['reject'](_0x201f6e);}return _0x1442ba['save']();};}function saveUpdates(_0x37f330,_0x36cd31){return function(_0x622e1b){if(_0x622e1b){return _0x622e1b[_0xea93('0x1e')](_0x37f330)['then'](function(_0x45bef5){return _0x45bef5;});}return null;};}function removeEntity(_0x2a5ebd,_0x1508df){return function(_0x404b74){if(_0x404b74){return _0x404b74[_0xea93('0x1f')]()[_0xea93('0x20')](function(){_0x2a5ebd[_0xea93('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6a71,_0x5e88de){return function(_0x46ef0e){if(!_0x46ef0e){_0x2c6a71[_0xea93('0x21')](0x194);}return _0x46ef0e;};}function handleError(_0x589260,_0x3966f6){_0x3966f6=_0x3966f6||0x1f4;return function(_0x3173c8){logger[_0xea93('0x22')](_0x3173c8[_0xea93('0x23')]);if(_0x3173c8['name']){delete _0x3173c8[_0xea93('0x24')];}_0x589260[_0xea93('0x15')](_0x3966f6)['send'](_0x3173c8);};}exports[_0xea93('0x25')]=function(_0xe48fd1,_0x273ecc){var _0x3ca98b={},_0x5b7412={},_0x2ca687={'count':0x0,'rows':[]};var _0x166850=_[_0xea93('0x26')](db[_0xea93('0x27')][_0xea93('0x28')],function(_0x11c35e){return{'name':_0x11c35e['fieldName'],'type':_0x11c35e[_0xea93('0x29')][_0xea93('0x2a')]};});_0x5b7412[_0xea93('0x2b')]=_[_0xea93('0x26')](_0x166850,_0xea93('0x24'));_0x5b7412['query']=_[_0xea93('0x2c')](_0xe48fd1[_0xea93('0x2d')]);_0x5b7412['filters']=_[_0xea93('0x2e')](_0x5b7412[_0xea93('0x2b')],_0x5b7412[_0xea93('0x2d')]);_0x3ca98b[_0xea93('0x2f')]=_['intersection'](_0x5b7412[_0xea93('0x2b')],qs[_0xea93('0x30')](_0xe48fd1[_0xea93('0x2d')]['fields']));_0x3ca98b[_0xea93('0x2f')]=_0x3ca98b[_0xea93('0x2f')]['length']?_0x3ca98b[_0xea93('0x2f')]:_0x5b7412[_0xea93('0x2b')];if(!_0xe48fd1['query'][_0xea93('0x31')](_0xea93('0x32'))){_0x3ca98b['limit']=qs[_0xea93('0x19')](_0xe48fd1[_0xea93('0x2d')][_0xea93('0x19')]);_0x3ca98b[_0xea93('0x17')]=qs[_0xea93('0x17')](_0xe48fd1[_0xea93('0x2d')][_0xea93('0x17')]);}_0x3ca98b[_0xea93('0x33')]=qs[_0xea93('0x34')](_0xe48fd1[_0xea93('0x2d')]['sort']);_0x3ca98b[_0xea93('0x35')]=qs[_0xea93('0x36')](_['pick'](_0xe48fd1[_0xea93('0x2d')],_0x5b7412[_0xea93('0x36')]),_0x166850);if(_0xe48fd1[_0xea93('0x2d')][_0xea93('0x37')]){_0x3ca98b[_0xea93('0x35')]=_[_0xea93('0x38')](_0x3ca98b[_0xea93('0x35')],{'$or':_['map'](_0x166850,function(_0x1069aa){if(_0x1069aa[_0xea93('0x29')]!==_0xea93('0x39')){var _0xed10fb={};_0xed10fb[_0x1069aa[_0xea93('0x24')]]={'$like':'%'+_0xe48fd1[_0xea93('0x2d')][_0xea93('0x37')]+'%'};return _0xed10fb;}})});}_0x3ca98b=_['merge']({},_0x3ca98b,_0xe48fd1[_0xea93('0x3a')]);var _0x492685={'where':_0x3ca98b['where']};return db[_0xea93('0x27')][_0xea93('0x1a')](_0x492685)[_0xea93('0x20')](function(_0x32cf5c){_0x2ca687[_0xea93('0x1a')]=_0x32cf5c;if(_0xe48fd1[_0xea93('0x2d')][_0xea93('0x3b')]){_0x3ca98b['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xea93('0x3c')](_0x3ca98b);})[_0xea93('0x20')](function(_0x145b2f){_0x2ca687[_0xea93('0x3d')]=_0x145b2f;return _0x2ca687;})[_0xea93('0x20')](respondWithFilteredResult(_0x273ecc,_0x3ca98b))[_0xea93('0x3e')](handleError(_0x273ecc,null));};exports[_0xea93('0x3f')]=function(_0x120c45,_0x3b10ea){var _0x21d27b={'raw':!![],'where':{'id':_0x120c45['params']['id']}},_0x34df4d={};_0x34df4d['model']=_[_0xea93('0x2c')](db[_0xea93('0x27')]['rawAttributes']);_0x34df4d['query']=_['keys'](_0x120c45[_0xea93('0x2d')]);_0x34df4d[_0xea93('0x36')]=_[_0xea93('0x2e')](_0x34df4d['model'],_0x34df4d[_0xea93('0x2d')]);_0x21d27b[_0xea93('0x2f')]=_['intersection'](_0x34df4d[_0xea93('0x2b')],qs['fields'](_0x120c45[_0xea93('0x2d')][_0xea93('0x30')]));_0x21d27b[_0xea93('0x2f')]=_0x21d27b['attributes'][_0xea93('0x40')]?_0x21d27b[_0xea93('0x2f')]:_0x34df4d[_0xea93('0x2b')];if(_0x120c45[_0xea93('0x2d')][_0xea93('0x3b')]){_0x21d27b[_0xea93('0x41')]=[{'all':!![]}];}_0x21d27b=_[_0xea93('0x38')]({},_0x21d27b,_0x120c45['options']);return db[_0xea93('0x27')][_0xea93('0x42')](_0x21d27b)[_0xea93('0x20')](handleEntityNotFound(_0x3b10ea,null))['then'](respondWithResult(_0x3b10ea,null))[_0xea93('0x3e')](handleError(_0x3b10ea,null));};exports[_0xea93('0x43')]=function(_0x4db06e,_0x4d9da1){return db[_0xea93('0x27')]['create'](_0x4db06e[_0xea93('0x44')],{})[_0xea93('0x20')](respondWithResult(_0x4d9da1,0xc9))[_0xea93('0x3e')](handleError(_0x4d9da1,null));};exports[_0xea93('0x1e')]=function(_0x2ecae8,_0x4cc0d9){if(_0x2ecae8[_0xea93('0x44')]['id']){delete _0x2ecae8[_0xea93('0x44')]['id'];}return db['JscriptyAnswerReport'][_0xea93('0x42')]({'where':{'id':_0x2ecae8[_0xea93('0x45')]['id']}})[_0xea93('0x20')](handleEntityNotFound(_0x4cc0d9,null))[_0xea93('0x20')](saveUpdates(_0x2ecae8['body'],null))['then'](respondWithResult(_0x4cc0d9,null))[_0xea93('0x3e')](handleError(_0x4cc0d9,null));};exports['destroy']=function(_0x45dc55,_0xd2a219){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x45dc55[_0xea93('0x45')]['id']}})[_0xea93('0x20')](handleEntityNotFound(_0xd2a219,null))['then'](removeEntity(_0xd2a219,null))['catch'](handleError(_0xd2a219,null));};exports[_0xea93('0x46')]=function(_0x181b33,_0xca5cbf){return db[_0xea93('0x27')][_0xea93('0x46')]()[_0xea93('0x20')](respondWithResult(_0xca5cbf,null))[_0xea93('0x3e')](handleError(_0xca5cbf,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 55569ce..2af00ad 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 _0x071d=['define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x1f96f5,_0x101fa4){var _0x3617c9=function(_0x401058){while(--_0x401058){_0x1f96f5['push'](_0x1f96f5['shift']());}};_0x3617c9(++_0x101fa4);}(_0x071d,0x16b));var _0xd071=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x071d[_0x307d86];return _0x361745;};'use strict';var _=require(_0xd071('0x0'));var util=require(_0xd071('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd071('0x2'));var BPromise=require(_0xd071('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd071('0x4'));var rimraf=require(_0xd071('0x5'));var config=require(_0xd071('0x6'));var attributes=require(_0xd071('0x7'));module[_0xd071('0x8')]=function(_0x1f9e5d,_0x2cae9b){return _0x1f9e5d[_0xd071('0x9')](_0xd071('0xa'),attributes,{'tableName':_0xd071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9b4=['rimraf','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x436fcb,_0x4c5932){var _0x8a9a41=function(_0x426b06){while(--_0x426b06){_0x436fcb['push'](_0x436fcb['shift']());}};_0x8a9a41(++_0x4c5932);}(_0xa9b4,0xfc));var _0x4a9b=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xa9b4[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x4a9b('0x0'));var util=require(_0x4a9b('0x1'));var logger=require(_0x4a9b('0x2'))(_0x4a9b('0x3'));var moment=require(_0x4a9b('0x4'));var BPromise=require(_0x4a9b('0x5'));var rp=require(_0x4a9b('0x6'));var fs=require('fs');var path=require(_0x4a9b('0x7'));var rimraf=require(_0x4a9b('0x8'));var config=require('../../config/environment');var attributes=require(_0x4a9b('0x9'));module[_0x4a9b('0xa')]=function(_0xe19090,_0x5ba05d){return _0xe19090[_0x4a9b('0xb')]('JscriptyAnswerReport',attributes,{'tableName':_0x4a9b('0xc'),'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 315721a..8f6341e 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 _0x3f81=['jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x620ce4,_0x2bdf85){var _0x1ee0de=function(_0x2a4233){while(--_0x2a4233){_0x620ce4['push'](_0x620ce4['shift']());}};_0x1ee0de(++_0x2bdf85);}(_0x3f81,0x151));var _0x13f8=function(_0x28539a,_0x532eba){_0x28539a=_0x28539a-0x0;var _0x4f4554=_0x3f81[_0x28539a];return _0x4f4554;};'use strict';var _=require(_0x13f8('0x0'));var util=require(_0x13f8('0x1'));var moment=require(_0x13f8('0x2'));var BPromise=require(_0x13f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13f8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x13f8('0x5'))(_0x13f8('0x6'));var config=require(_0x13f8('0x7'));var jayson=require(_0x13f8('0x8'));var client=jayson[_0x13f8('0x9')][_0x13f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bd2c1,_0x2e0a1,_0x4b9fdd){return new BPromise(function(_0x51bad7,_0x79e61d){return client[_0x13f8('0xb')](_0x3bd2c1,_0x4b9fdd)[_0x13f8('0xc')](function(_0x437efe){logger['info'](_0x13f8('0xd'),_0x2e0a1,'request\x20sent');logger[_0x13f8('0xe')](_0x13f8('0xf'),_0x2e0a1,_0x13f8('0x10'),JSON[_0x13f8('0x11')](_0x437efe));if(_0x437efe[_0x13f8('0x12')]){if(_0x437efe['error'][_0x13f8('0x13')]===0x1f4){logger[_0x13f8('0x12')](_0x13f8('0xd'),_0x2e0a1,_0x437efe[_0x13f8('0x12')][_0x13f8('0x14')]);return _0x79e61d(_0x437efe['error'][_0x13f8('0x14')]);}logger[_0x13f8('0x12')](_0x13f8('0xd'),_0x2e0a1,_0x437efe[_0x13f8('0x12')][_0x13f8('0x14')]);return _0x51bad7(_0x437efe[_0x13f8('0x12')]['message']);}else{logger[_0x13f8('0x15')](_0x13f8('0xd'),_0x2e0a1,'request\x20sent');_0x51bad7(_0x437efe[_0x13f8('0x16')]['message']);}})['catch'](function(_0x226772){logger[_0x13f8('0x12')](_0x13f8('0xd'),_0x2e0a1,_0x226772);_0x79e61d(_0x226772);});});} \ No newline at end of file +var _0x8d3a=['request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4e9bde,_0x3f5484){var _0x155ff9=function(_0x3f7892){while(--_0x3f7892){_0x4e9bde['push'](_0x4e9bde['shift']());}};_0x155ff9(++_0x3f5484);}(_0x8d3a,0x1db));var _0xa8d3=function(_0x45a58d,_0x105c57){_0x45a58d=_0x45a58d-0x0;var _0x20e996=_0x8d3a[_0x45a58d];return _0x20e996;};'use strict';var _=require(_0xa8d3('0x0'));var util=require(_0xa8d3('0x1'));var moment=require(_0xa8d3('0x2'));var BPromise=require('bluebird');var rs=require(_0xa8d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa8d3('0x4'));var logger=require(_0xa8d3('0x5'))(_0xa8d3('0x6'));var config=require('../../config/environment');var jayson=require(_0xa8d3('0x7'));var client=jayson[_0xa8d3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45bce2,_0x1e8b26,_0x153a86){return new BPromise(function(_0x52bfbd,_0x5172a3){return client[_0xa8d3('0x9')](_0x45bce2,_0x153a86)[_0xa8d3('0xa')](function(_0x4d8dad){logger[_0xa8d3('0xb')](_0xa8d3('0xc'),_0x1e8b26,_0xa8d3('0xd'));logger[_0xa8d3('0xe')](_0xa8d3('0xf'),_0x1e8b26,_0xa8d3('0xd'),JSON[_0xa8d3('0x10')](_0x4d8dad));if(_0x4d8dad[_0xa8d3('0x11')]){if(_0x4d8dad[_0xa8d3('0x11')][_0xa8d3('0x12')]===0x1f4){logger['error'](_0xa8d3('0xc'),_0x1e8b26,_0x4d8dad[_0xa8d3('0x11')]['message']);return _0x5172a3(_0x4d8dad['error'][_0xa8d3('0x13')]);}logger[_0xa8d3('0x11')](_0xa8d3('0xc'),_0x1e8b26,_0x4d8dad[_0xa8d3('0x11')]['message']);return _0x52bfbd(_0x4d8dad['error'][_0xa8d3('0x13')]);}else{logger[_0xa8d3('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1e8b26,_0xa8d3('0xd'));_0x52bfbd(_0x4d8dad[_0xa8d3('0x14')][_0xa8d3('0x13')]);}})[_0xa8d3('0x15')](function(_0x4abe15){logger[_0xa8d3('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1e8b26,_0x4abe15);_0x5172a3(_0x4abe15);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 9c856ef..0a2ad57 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 _0x38e3=['getSummary','post','/:id/clone','update','delete','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/sessions','/:id/answers','getAnswers','30s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x38e3,0x1d2));var _0x338e=function(_0x10cfc2,_0x1cffff){_0x10cfc2=_0x10cfc2-0x0;var _0x19f55e=_0x38e3[_0x10cfc2];return _0x19f55e;};'use strict';var multer=require(_0x338e('0x0'));var util=require('util');var path=require(_0x338e('0x1'));var timeout=require(_0x338e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x338e('0x3'));var interaction=require(_0x338e('0x4'));var config=require(_0x338e('0x5'));var controller=require('./jscriptyProject.controller');router[_0x338e('0x6')]('/',auth[_0x338e('0x7')](),controller['index']);router[_0x338e('0x6')](_0x338e('0x8'),auth['isAuthenticated'](),controller[_0x338e('0x9')]);router[_0x338e('0x6')](_0x338e('0xa'),auth[_0x338e('0x7')](),controller['getSessions']);router['get'](_0x338e('0xb'),auth[_0x338e('0x7')](),controller[_0x338e('0xc')]);router['get']('/:id/summary',auth['isAuthenticated'](),timeout(_0x338e('0xd')),controller[_0x338e('0xe')]);router[_0x338e('0xf')]('/',auth[_0x338e('0x7')](),controller['create']);router[_0x338e('0xf')](_0x338e('0x10'),auth['isAuthenticated'](),controller['clone']);router['put'](_0x338e('0x8'),auth[_0x338e('0x7')](),controller[_0x338e('0x11')]);router[_0x338e('0x12')](_0x338e('0x8'),auth[_0x338e('0x7')](),controller[_0x338e('0x13')]);module['exports']=router; \ No newline at end of file +var _0xbab7=['../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','put','delete','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbab7,0xed));var _0x7bab=function(_0xc3ba17,_0x30f305){_0xc3ba17=_0xc3ba17-0x0;var _0x2f3fb6=_0xbab7[_0xc3ba17];return _0x2f3fb6;};'use strict';var multer=require(_0x7bab('0x0'));var util=require('util');var path=require(_0x7bab('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7bab('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7bab('0x3'));var interaction=require(_0x7bab('0x4'));var config=require(_0x7bab('0x5'));var controller=require(_0x7bab('0x6'));router[_0x7bab('0x7')]('/',auth[_0x7bab('0x8')](),controller[_0x7bab('0x9')]);router[_0x7bab('0x7')](_0x7bab('0xa'),auth['isAuthenticated'](),controller[_0x7bab('0xb')]);router[_0x7bab('0x7')](_0x7bab('0xc'),auth['isAuthenticated'](),controller[_0x7bab('0xd')]);router[_0x7bab('0x7')](_0x7bab('0xe'),auth['isAuthenticated'](),controller[_0x7bab('0xf')]);router[_0x7bab('0x7')]('/:id/summary',auth[_0x7bab('0x8')](),timeout(_0x7bab('0x10')),controller[_0x7bab('0x11')]);router[_0x7bab('0x12')]('/',auth[_0x7bab('0x8')](),controller['create']);router[_0x7bab('0x12')]('/:id/clone',auth[_0x7bab('0x8')](),controller['clone']);router[_0x7bab('0x13')](_0x7bab('0xa'),auth[_0x7bab('0x8')](),controller['update']);router[_0x7bab('0x14')](_0x7bab('0xa'),auth[_0x7bab('0x8')](),controller['destroy']);module[_0x7bab('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 3efd324..3d5a1f8 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 _0x35c3=['description','sequelize','lodash','util','exports','STRING','name','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x84b0f6,_0x120047){var _0x2b6db7=function(_0x8a320e){while(--_0x8a320e){_0x84b0f6['push'](_0x84b0f6['shift']());}};_0x2b6db7(++_0x120047);}(_0x35c3,0x71));var _0x335c=function(_0x2c0602,_0x5a8f29){_0x2c0602=_0x2c0602-0x0;var _0x258b7e=_0x35c3[_0x2c0602];return _0x258b7e;};'use strict';var Sequelize=require(_0x335c('0x0'));var _=require(_0x335c('0x1'));var util=require(_0x335c('0x2'));module[_0x335c('0x3')]={'name':{'type':Sequelize[_0x335c('0x4')],'unique':_0x335c('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x335c('0x6')),'set':function(_0x1bbc85){if(_[_0x335c('0x7')](_0x1bbc85)){this[_0x335c('0x8')](_0x335c('0x9'),JSON[_0x335c('0xa')](_0x1bbc85));}else if(_[_0x335c('0xb')](_0x1bbc85)){this['setDataValue']('formData',_0x1bbc85);}else{this[_0x335c('0x8')](_0x335c('0x9'),util[_0x335c('0xc')](_0x335c('0xd'),this[_0x335c('0xe')](_0x335c('0x5'))||'',this[_0x335c('0xe')](_0x335c('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x773b=['getDataValue','BOOLEAN','sequelize','lodash','util','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','isString','format'];(function(_0x281008,_0x12b933){var _0x405565=function(_0x2b598d){while(--_0x2b598d){_0x281008['push'](_0x281008['shift']());}};_0x405565(++_0x12b933);}(_0x773b,0x11a));var _0xb773=function(_0x47d21a,_0x1def8a){_0x47d21a=_0x47d21a-0x0;var _0x560a3a=_0x773b[_0x47d21a];return _0x560a3a;};'use strict';var Sequelize=require(_0xb773('0x0'));var _=require(_0xb773('0x1'));var util=require(_0xb773('0x2'));module['exports']={'name':{'type':Sequelize[_0xb773('0x3')],'unique':_0xb773('0x4')},'description':{'type':Sequelize[_0xb773('0x3')]},'formData':{'type':Sequelize[_0xb773('0x5')](_0xb773('0x6')),'set':function(_0x1640bb){if(_[_0xb773('0x7')](_0x1640bb)){this[_0xb773('0x8')](_0xb773('0x9'),JSON['stringify'](_0x1640bb));}else if(_[_0xb773('0xa')](_0x1640bb)){this[_0xb773('0x8')]('formData',_0x1640bb);}else{this['setDataValue'](_0xb773('0x9'),util[_0xb773('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xb773('0xc')](_0xb773('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xb773('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xb773('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 26d2b71..a6af014 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 _0xca1d=['getSummary','startTime','starttime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','JscriptyProject','includeAll','include','findAll','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','rows','indexOf','toString','replace'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0xca1d,0x1e6));var _0xdca1=function(_0x253495,_0x5e3fd9){_0x253495=_0x253495-0x0;var _0x43a0d0=_0xca1d[_0x253495];return _0x43a0d0;};'use strict';var emlformat=require(_0xdca1('0x0'));var rimraf=require(_0xdca1('0x1'));var zipdir=require(_0xdca1('0x2'));var jsonpatch=require(_0xdca1('0x3'));var rp=require(_0xdca1('0x4'));var moment=require(_0xdca1('0x5'));var BPromise=require(_0xdca1('0x6'));var Mustache=require('mustache');var util=require(_0xdca1('0x7'));var path=require(_0xdca1('0x8'));var sox=require('sox');var csv=require(_0xdca1('0x9'));var ejs=require(_0xdca1('0xa'));var fs=require('fs');var fs_extra=require(_0xdca1('0xb'));var _=require('lodash');var squel=require(_0xdca1('0xc'));var crypto=require(_0xdca1('0xd'));var jsforce=require(_0xdca1('0xe'));var deskjs=require(_0xdca1('0xf'));var toCsv=require(_0xdca1('0x9'));var querystring=require('querystring');var Papa=require(_0xdca1('0x10'));var Redis=require(_0xdca1('0x11'));var authService=require(_0xdca1('0x12'));var qs=require(_0xdca1('0x13'));var as=require(_0xdca1('0x14'));var hardwareService=require(_0xdca1('0x15'));var logger=require('../../config/logger')(_0xdca1('0x16'));var utils=require(_0xdca1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdca1('0x18'));var db=require(_0xdca1('0x19'))['db'];function respondWithStatusCode(_0xb3c445,_0x7769ce){_0x7769ce=_0x7769ce||0xcc;return function(_0x1f0cc6){if(_0x1f0cc6){return _0xb3c445[_0xdca1('0x1a')](_0x7769ce);}return _0xb3c445['status'](_0x7769ce)[_0xdca1('0x1b')]();};}function respondWithResult(_0x5aa74c,_0x26bb58){_0x26bb58=_0x26bb58||0xc8;return function(_0x2874df){if(_0x2874df){return _0x5aa74c[_0xdca1('0x1c')](_0x26bb58)[_0xdca1('0x1d')](_0x2874df);}};}function respondWithFilteredResult(_0xd88192,_0xd65f29){return function(_0x375590){if(_0x375590){var _0x4ba1e9=typeof _0xd65f29['offset']===_0xdca1('0x1e')&&typeof _0xd65f29[_0xdca1('0x1f')]===_0xdca1('0x1e');var _0x363f75=_0x375590[_0xdca1('0x20')];var _0x1fad53=_0x4ba1e9?0x0:_0xd65f29[_0xdca1('0x21')];var _0x39aded=_0x4ba1e9?_0x375590[_0xdca1('0x20')]:_0xd65f29[_0xdca1('0x21')]+_0xd65f29[_0xdca1('0x1f')];var _0x44377f;if(_0x39aded>=_0x363f75){_0x39aded=_0x363f75;_0x44377f=0xc8;}else{_0x44377f=0xce;}_0xd88192[_0xdca1('0x1c')](_0x44377f);return _0xd88192[_0xdca1('0x22')](_0xdca1('0x23'),_0x1fad53+'-'+_0x39aded+'/'+_0x363f75)[_0xdca1('0x1d')](_0x375590);}return null;};}function patchUpdates(_0xe84014){return function(_0x52a930){try{jsonpatch[_0xdca1('0x24')](_0x52a930,_0xe84014,!![]);}catch(_0x366e00){return BPromise[_0xdca1('0x25')](_0x366e00);}return _0x52a930[_0xdca1('0x26')]();};}function saveUpdates(_0x46ec7c,_0x2f1d49){return function(_0xad5463){if(_0xad5463){return _0xad5463[_0xdca1('0x27')](_0x46ec7c)['then'](function(_0x45a2a8){return _0x45a2a8;});}return null;};}function removeEntity(_0x4068dd,_0x4a4682){return function(_0xd34c45){if(_0xd34c45){return _0xd34c45[_0xdca1('0x28')]()[_0xdca1('0x29')](function(){var _0x89cba8=_0xd34c45[_0xdca1('0x2a')]({'plain':!![]});var _0x363165=_0xdca1('0x2b');return db[_0xdca1('0x2c')][_0xdca1('0x28')]({'where':{'type':_0x363165,'resourceId':_0x89cba8['id']}})[_0xdca1('0x29')](function(){return _0xd34c45;});})['then'](function(){_0x4068dd[_0xdca1('0x1c')](0xcc)[_0xdca1('0x1b')]();});}};}function handleEntityNotFound(_0x33d8fe,_0x4a87af){return function(_0x23e342){if(!_0x23e342){_0x33d8fe[_0xdca1('0x1a')](0x194);}return _0x23e342;};}function handleError(_0x3da067,_0x202924){_0x202924=_0x202924||0x1f4;return function(_0x4c718b){logger[_0xdca1('0x2d')](_0x4c718b[_0xdca1('0x2e')]);if(_0x4c718b[_0xdca1('0x2f')]){delete _0x4c718b[_0xdca1('0x2f')];}_0x3da067[_0xdca1('0x1c')](_0x202924)['send'](_0x4c718b);};}exports[_0xdca1('0x30')]=function(_0x25bb64,_0x271e9d){var _0x2bc734={},_0x3c3b4f={},_0x156c4f={'count':0x0,'rows':[]};var _0xd7b1fd=_[_0xdca1('0x31')](db['JscriptyProject'][_0xdca1('0x32')],function(_0x4b33ed){return{'name':_0x4b33ed[_0xdca1('0x33')],'type':_0x4b33ed[_0xdca1('0x34')][_0xdca1('0x35')]};});_0x3c3b4f['model']=_['map'](_0xd7b1fd,_0xdca1('0x2f'));_0x3c3b4f[_0xdca1('0x36')]=_['keys'](_0x25bb64[_0xdca1('0x36')]);_0x3c3b4f['filters']=_[_0xdca1('0x37')](_0x3c3b4f['model'],_0x3c3b4f['query']);_0x2bc734[_0xdca1('0x38')]=_[_0xdca1('0x37')](_0x3c3b4f[_0xdca1('0x39')],qs['fields'](_0x25bb64[_0xdca1('0x36')][_0xdca1('0x3a')]));_0x2bc734['attributes']=_0x2bc734[_0xdca1('0x38')][_0xdca1('0x3b')]?_0x2bc734[_0xdca1('0x38')]:_0x3c3b4f[_0xdca1('0x39')];if(!_0x25bb64['query'][_0xdca1('0x3c')](_0xdca1('0x3d'))){_0x2bc734['limit']=qs[_0xdca1('0x1f')](_0x25bb64[_0xdca1('0x36')]['limit']);_0x2bc734[_0xdca1('0x21')]=qs['offset'](_0x25bb64[_0xdca1('0x36')][_0xdca1('0x21')]);}_0x2bc734[_0xdca1('0x3e')]=qs[_0xdca1('0x3f')](_0x25bb64[_0xdca1('0x36')][_0xdca1('0x3f')]);_0x2bc734[_0xdca1('0x40')]=qs[_0xdca1('0x41')](_[_0xdca1('0x42')](_0x25bb64['query'],_0x3c3b4f[_0xdca1('0x41')]),_0xd7b1fd);if(_0x25bb64['query'][_0xdca1('0x43')]){_0x2bc734[_0xdca1('0x40')]=_['merge'](_0x2bc734['where'],{'$or':_[_0xdca1('0x31')](_0xd7b1fd,function(_0x376458){if(_0x376458['type']!=='VIRTUAL'){var _0x32ab34={};_0x32ab34[_0x376458[_0xdca1('0x2f')]]={'$like':'%'+_0x25bb64[_0xdca1('0x36')][_0xdca1('0x43')]+'%'};return _0x32ab34;}})});}_0x2bc734=_[_0xdca1('0x44')]({},_0x2bc734,_0x25bb64[_0xdca1('0x45')]);var _0x832440={'where':_0x2bc734[_0xdca1('0x40')]};return db[_0xdca1('0x46')][_0xdca1('0x20')](_0x832440)[_0xdca1('0x29')](function(_0x4cacb2){_0x156c4f[_0xdca1('0x20')]=_0x4cacb2;if(_0x25bb64[_0xdca1('0x36')][_0xdca1('0x47')]){_0x2bc734[_0xdca1('0x48')]=[{'all':!![]}];}return db[_0xdca1('0x46')][_0xdca1('0x49')](_0x2bc734);})['then'](function(_0x1ed3d9){_0x156c4f['rows']=_0x1ed3d9;return _0x156c4f;})[_0xdca1('0x29')](respondWithFilteredResult(_0x271e9d,_0x2bc734))[_0xdca1('0x4a')](handleError(_0x271e9d,null));};exports['show']=function(_0x6120e5,_0x266b38){var _0x488c37={'raw':![],'where':{'id':_0x6120e5[_0xdca1('0x4b')]['id']}},_0x4ca8df={};_0x4ca8df[_0xdca1('0x39')]=_[_0xdca1('0x4c')](db[_0xdca1('0x46')][_0xdca1('0x32')]);_0x4ca8df[_0xdca1('0x36')]=_[_0xdca1('0x4c')](_0x6120e5[_0xdca1('0x36')]);_0x4ca8df[_0xdca1('0x41')]=_[_0xdca1('0x37')](_0x4ca8df[_0xdca1('0x39')],_0x4ca8df[_0xdca1('0x36')]);_0x488c37[_0xdca1('0x38')]=_['intersection'](_0x4ca8df[_0xdca1('0x39')],qs[_0xdca1('0x3a')](_0x6120e5[_0xdca1('0x36')][_0xdca1('0x3a')]));_0x488c37['attributes']=_0x488c37[_0xdca1('0x38')][_0xdca1('0x3b')]?_0x488c37[_0xdca1('0x38')]:_0x4ca8df['model'];if(_0x6120e5['query'][_0xdca1('0x47')]){_0x488c37[_0xdca1('0x48')]=[{'all':!![]}];}_0x488c37=_[_0xdca1('0x44')]({},_0x488c37,_0x6120e5[_0xdca1('0x45')]);return db[_0xdca1('0x46')][_0xdca1('0x4d')](_0x488c37)[_0xdca1('0x29')](handleEntityNotFound(_0x266b38,null))[_0xdca1('0x29')](respondWithResult(_0x266b38,null))[_0xdca1('0x4a')](handleError(_0x266b38,null));};exports[_0xdca1('0x4e')]=function(_0x1a6a02,_0x539ccf){return db[_0xdca1('0x46')][_0xdca1('0x4e')](_0x1a6a02[_0xdca1('0x4f')],{})['then'](function(_0xe09828){var _0x36f24f=_0x1a6a02[_0xdca1('0x50')][_0xdca1('0x2a')]({'plain':!![]});if(!_0x36f24f)throw new Error(_0xdca1('0x51'));if(_0x36f24f[_0xdca1('0x52')]===_0xdca1('0x50')){var _0x256a8a=_0xe09828[_0xdca1('0x2a')]({'plain':!![]});var _0x377cc6=_0xdca1('0x2b');return db[_0xdca1('0x53')]['find']({'where':{'name':_0x377cc6,'userProfileId':_0x36f24f['userProfileId']},'raw':!![]})[_0xdca1('0x29')](function(_0x2df360){if(_0x2df360&&_0x2df360[_0xdca1('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x256a8a['name'],'resourceId':_0x256a8a['id'],'type':_0x2df360[_0xdca1('0x2f')],'sectionId':_0x2df360['id']},{})[_0xdca1('0x29')](function(){return _0xe09828;});}else{return _0xe09828;}})['catch'](function(_0x57778e){logger[_0xdca1('0x2d')](_0xdca1('0x55'),_0x57778e);throw _0x57778e;});}return _0xe09828;})['then'](respondWithResult(_0x539ccf,0xc9))[_0xdca1('0x4a')](handleError(_0x539ccf,null));};exports[_0xdca1('0x56')]=function(_0x5593a9,_0x31d671){var _0x5424a2={'where':{'id':_0x5593a9[_0xdca1('0x4b')]['id']}},_0x1bc5dd={};_0x1bc5dd[_0xdca1('0x39')]=_[_0xdca1('0x4c')](db[_0xdca1('0x46')][_0xdca1('0x32')]);_0x5424a2[_0xdca1('0x38')]=_['intersection'](_0x1bc5dd[_0xdca1('0x39')],qs[_0xdca1('0x3a')](_0x5593a9[_0xdca1('0x36')]['fields']));_0x5424a2[_0xdca1('0x38')]=_0x5424a2['attributes'][_0xdca1('0x3b')]?_0x5424a2['attributes']:_0x1bc5dd[_0xdca1('0x39')];if(_0x5593a9[_0xdca1('0x36')]['includeAll']){_0x5424a2[_0xdca1('0x48')]=[{'all':!![]}];}_0x5424a2=_['merge']({},_0x5424a2,_0x5593a9['options']);return db['JscriptyProject'][_0xdca1('0x4d')](_0x5424a2)[_0xdca1('0x29')](handleEntityNotFound(_0x31d671,null))[_0xdca1('0x29')](function(_0x4a27b1){if(_0x4a27b1){var _0x399dec=_0x4a27b1[_0xdca1('0x2a')]({'plain':!![]});_0x399dec=qs[_0xdca1('0x57')](_0x399dec,['id',_0xdca1('0x58'),'updatedAt']);_0x5593a9[_0xdca1('0x4f')]=_[_0xdca1('0x57')](_0x5593a9[_0xdca1('0x4f')],['id','createdAt',_0xdca1('0x59')]);return db[_0xdca1('0x46')][_0xdca1('0x4e')](_[_0xdca1('0x44')](_0x399dec,_0x5593a9['body']),{'include':_0x5593a9[_0xdca1('0x36')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x560039){var _0x409427=_0x5593a9[_0xdca1('0x50')][_0xdca1('0x2a')]({'plain':!![]});if(!_0x409427)throw new Error(_0xdca1('0x51'));if(_0x409427['role']==='user'){var _0x1c97d0=_0x560039['get']({'plain':!![]});var _0x5cc8fe=_0xdca1('0x2b');return db[_0xdca1('0x53')][_0xdca1('0x4d')]({'where':{'name':_0x5cc8fe,'userProfileId':_0x409427[_0xdca1('0x5a')]},'raw':!![]})[_0xdca1('0x29')](function(_0x30c660){if(_0x30c660&&_0x30c660[_0xdca1('0x54')]===0x0){return db[_0xdca1('0x2c')][_0xdca1('0x4e')]({'name':_0x1c97d0['name'],'resourceId':_0x1c97d0['id'],'type':_0x30c660[_0xdca1('0x2f')],'sectionId':_0x30c660['id']},{})[_0xdca1('0x29')](function(){return _0x560039;});}else{return _0x560039;}})[_0xdca1('0x4a')](function(_0x351b81){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x351b81);throw _0x351b81;});}return _0x560039;});}})[_0xdca1('0x29')](respondWithResult(_0x31d671,0xc9))[_0xdca1('0x4a')](handleError(_0x31d671,null));};exports[_0xdca1('0x27')]=function(_0x4bdfde,_0x462ad9){if(_0x4bdfde[_0xdca1('0x4f')]['id']){delete _0x4bdfde['body']['id'];}return db[_0xdca1('0x46')][_0xdca1('0x4d')]({'where':{'id':_0x4bdfde['params']['id']}})[_0xdca1('0x29')](handleEntityNotFound(_0x462ad9,null))['then'](saveUpdates(_0x4bdfde[_0xdca1('0x4f')],null))[_0xdca1('0x29')](respondWithResult(_0x462ad9,null))[_0xdca1('0x4a')](handleError(_0x462ad9,null));};exports[_0xdca1('0x28')]=function(_0x503fdf,_0x5da413){return db[_0xdca1('0x46')][_0xdca1('0x4d')]({'where':{'id':_0x503fdf[_0xdca1('0x4b')]['id']}})[_0xdca1('0x29')](handleEntityNotFound(_0x5da413,null))[_0xdca1('0x29')](removeEntity(_0x5da413,null))[_0xdca1('0x4a')](handleError(_0x5da413,null));};exports['getSessions']=function(_0x571efb,_0x20594c,_0x358bbd){var _0x53f96e={'raw':!![],'where':{}};var _0x48a84f={};var _0x4b6470={'count':0x0,'rows':[]};return db[_0xdca1('0x46')]['findOne']({'where':{'id':_0x571efb[_0xdca1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x20594c,null))[_0xdca1('0x29')](function(_0x44fbf0){if(_0x44fbf0){_0x48a84f[_0xdca1('0x39')]=_[_0xdca1('0x4c')](db['JscriptySessionReport']['rawAttributes']);_0x48a84f[_0xdca1('0x36')]=_['keys'](_0x571efb[_0xdca1('0x36')]);_0x48a84f['filters']=_['intersection'](_0x48a84f[_0xdca1('0x39')],_0x48a84f[_0xdca1('0x36')]);_0x53f96e['attributes']=_[_0xdca1('0x37')](_0x48a84f[_0xdca1('0x39')],qs[_0xdca1('0x3a')](_0x571efb[_0xdca1('0x36')][_0xdca1('0x3a')]));_0x53f96e[_0xdca1('0x38')]=_0x53f96e['attributes'][_0xdca1('0x3b')]?_0x53f96e[_0xdca1('0x38')]:_0x48a84f['model'];if(!_0x571efb[_0xdca1('0x36')][_0xdca1('0x3c')](_0xdca1('0x3d'))){_0x53f96e['limit']=qs[_0xdca1('0x1f')](_0x571efb[_0xdca1('0x36')][_0xdca1('0x1f')]);_0x53f96e[_0xdca1('0x21')]=qs[_0xdca1('0x21')](_0x571efb[_0xdca1('0x36')][_0xdca1('0x21')]);}_0x53f96e[_0xdca1('0x3e')]=qs['sort'](_0x571efb['query'][_0xdca1('0x3f')]);_0x53f96e[_0xdca1('0x40')]=qs['filters'](_['pick'](_0x571efb[_0xdca1('0x36')],_0x48a84f[_0xdca1('0x41')]));_0x53f96e[_0xdca1('0x40')]['ProjectId']=_0x44fbf0['id'];if(_0x571efb['query'][_0xdca1('0x43')]){_0x53f96e[_0xdca1('0x40')]=_[_0xdca1('0x44')](_0x53f96e[_0xdca1('0x40')],{'$or':_[_0xdca1('0x31')](_0x53f96e[_0xdca1('0x38')],function(_0x28566a){var _0x56631b={};_0x56631b[_0x28566a]={'$like':'%'+_0x571efb['query'][_0xdca1('0x43')]+'%'};return _0x56631b;})});}_0x53f96e=_[_0xdca1('0x44')]({},_0x53f96e,_0x571efb[_0xdca1('0x45')]);return db[_0xdca1('0x5b')][_0xdca1('0x20')]({'where':_0x53f96e['where']})['then'](function(_0x5ca3b9){_0x4b6470['count']=_0x5ca3b9;if(_0x571efb[_0xdca1('0x36')][_0xdca1('0x47')]){_0x53f96e[_0xdca1('0x48')]=[{'all':!![]}];}return db[_0xdca1('0x5b')]['findAll'](_0x53f96e);})[_0xdca1('0x29')](function(_0x209f81){_0x4b6470['rows']=_0x209f81;return _0x4b6470;});}})[_0xdca1('0x29')](respondWithFilteredResult(_0x20594c,_0x53f96e))['catch'](handleError(_0x20594c,null));};exports[_0xdca1('0x5c')]=function(_0x59e56d,_0x5f2ff,_0x263825){var _0x4379e7={'raw':!![],'where':{}};var _0x1b0f7={};var _0x7e2ec6={'count':0x0,'rows':[]};return db[_0xdca1('0x46')][_0xdca1('0x5d')]({'where':{'id':_0x59e56d[_0xdca1('0x4b')]['id']}})[_0xdca1('0x29')](handleEntityNotFound(_0x5f2ff,null))[_0xdca1('0x29')](function(_0x555a42){if(_0x555a42){_0x1b0f7[_0xdca1('0x39')]=_[_0xdca1('0x4c')](db[_0xdca1('0x5e')][_0xdca1('0x32')]);_0x1b0f7['query']=_[_0xdca1('0x4c')](_0x59e56d[_0xdca1('0x36')]);_0x1b0f7[_0xdca1('0x41')]=_[_0xdca1('0x37')](_0x1b0f7[_0xdca1('0x39')],_0x1b0f7['query']);_0x4379e7[_0xdca1('0x38')]=_[_0xdca1('0x37')](_0x1b0f7[_0xdca1('0x39')],qs[_0xdca1('0x3a')](_0x59e56d['query']['fields']));_0x4379e7[_0xdca1('0x38')]=_0x4379e7[_0xdca1('0x38')]['length']?_0x4379e7['attributes']:_0x1b0f7[_0xdca1('0x39')];if(!_0x59e56d['query'][_0xdca1('0x3c')](_0xdca1('0x3d'))){_0x4379e7['limit']=qs[_0xdca1('0x1f')](_0x59e56d['query'][_0xdca1('0x1f')]);_0x4379e7['offset']=qs[_0xdca1('0x21')](_0x59e56d[_0xdca1('0x36')][_0xdca1('0x21')]);}_0x4379e7['order']=qs['sort'](_0x59e56d['query'][_0xdca1('0x3f')]);_0x4379e7[_0xdca1('0x40')]=qs[_0xdca1('0x41')](_[_0xdca1('0x42')](_0x59e56d[_0xdca1('0x36')],_0x1b0f7[_0xdca1('0x41')]));_0x4379e7['where']['ProjectId']=_0x555a42['id'];if(_0x59e56d['query']['filter']){_0x4379e7['where']=_[_0xdca1('0x44')](_0x4379e7[_0xdca1('0x40')],{'$or':_[_0xdca1('0x31')](_0x4379e7[_0xdca1('0x38')],function(_0x5ef442){var _0x3a69={};_0x3a69[_0x5ef442]={'$like':'%'+_0x59e56d['query']['filter']+'%'};return _0x3a69;})});}_0x4379e7=_[_0xdca1('0x44')]({},_0x4379e7,_0x59e56d[_0xdca1('0x45')]);return db['JscriptyAnswerReport']['count']({'where':_0x4379e7[_0xdca1('0x40')]})['then'](function(_0x7cba2){_0x7e2ec6[_0xdca1('0x20')]=_0x7cba2;if(_0x59e56d[_0xdca1('0x36')][_0xdca1('0x47')]){_0x4379e7[_0xdca1('0x48')]=[{'all':!![]}];}return db[_0xdca1('0x5e')][_0xdca1('0x49')](_0x4379e7);})[_0xdca1('0x29')](function(_0x2a04d1){_0x7e2ec6[_0xdca1('0x5f')]=_0x2a04d1;return _0x7e2ec6;});}})[_0xdca1('0x29')](respondWithFilteredResult(_0x5f2ff,_0x4379e7))[_0xdca1('0x4a')](handleError(_0x5f2ff,null));};function char(_0x1b0d4d){return'number'===typeof _0x1b0d4d?String['fromCharCode'][_0xdca1('0x24')](null,arguments):_0x1b0d4d;}function needsEncapsulation(_0x5f4b6e){return!!_0x5f4b6e&&(_0x5f4b6e['toString']()[_0xdca1('0x60')](char(0xd))>=0x0||_0x5f4b6e[_0xdca1('0x61')]()[_0xdca1('0x60')](char(0xa))>=0x0||_0x5f4b6e[_0xdca1('0x61')]()[_0xdca1('0x60')](char(0x2c))>=0x0||_0x5f4b6e[_0xdca1('0x61')]()[_0xdca1('0x60')](char(0x22))>=0x0);}function encapsulate(_0x727157){var _0x15a8a2=char(0x22),_0x14c25a='\x5c'+char(0x22),_0x4c3fda=_0x727157[_0xdca1('0x61')]()[_0xdca1('0x62')](new RegExp(_0x15a8a2,'g'),_0x14c25a);return _0x15a8a2+_0x4c3fda+_0x15a8a2;}exports[_0xdca1('0x63')]=function(_0x31af85,_0x9134c9,_0x417a24){var _0x567d29,_0x23c7f8;var _0x301875={'where':{'ProjectId':_0x31af85['params']['id']}};if(_0x31af85['query'][_0xdca1('0x64')]){_0x301875[_0xdca1('0x40')][_0xdca1('0x65')]=JSON['parse'](_0x31af85['query']['startTime']);}return db[_0xdca1('0x5b')]['findAll'](_0x301875)['then'](handleEntityNotFound(_0x9134c9,null))['then'](function(_0x5104d5){if(_0x5104d5){_0x567d29=_0x5104d5;return db['JscriptyQuestionReport'][_0xdca1('0x49')]({'where':{'SessionId':{'$in':_[_0xdca1('0x31')](_0x567d29,'id')},'ProjectId':_0x31af85['params']['id']},'order':_0xdca1('0x66')});}})[_0xdca1('0x29')](handleEntityNotFound(_0x9134c9,null))['then'](function(_0x5821ec){if(_0x5821ec){_0x23c7f8=_0x5821ec;var _0x194bbd={};for(var _0x1957d0=0x0,_0x366bc0=_0x23c7f8[_0xdca1('0x3b')];_0x1957d0<_0x366bc0;_0x1957d0++){if(!_0x194bbd[_0xdca1('0x3c')](_0x23c7f8[_0x1957d0]['questionId'])){_0x194bbd[_0x23c7f8[_0x1957d0][_0xdca1('0x67')]]=needsEncapsulation(_0x23c7f8[_0x1957d0][_0xdca1('0x68')])?encapsulate(_0x23c7f8[_0x1957d0]['question']):_0x23c7f8[_0x1957d0][_0xdca1('0x68')];}}var _0x2d187c=[],_0xc611f8={};for(var _0x2bc77e=0x0,_0x45f871=_0x567d29[_0xdca1('0x3b')];_0x2bc77e<_0x45f871;_0x2bc77e++){_0xc611f8={'ProjectId':_0x31af85[_0xdca1('0x4b')]['id'],'SessionId':_0x567d29[_0x2bc77e]['id'],'StartTime':moment(_0x567d29[_0x2bc77e]['starttime'])[_0xdca1('0x69')](_0xdca1('0x6a'))};for(var _0x557e08=0x0,_0x2bfd1c=_0x23c7f8[_0xdca1('0x3b')];_0x557e08<_0x2bfd1c;_0x557e08++){if(_0x23c7f8[_0x557e08]['SessionId']==_0x567d29[_0x2bc77e]['id']&&_0x194bbd['hasOwnProperty'](_0x23c7f8[_0x557e08][_0xdca1('0x67')])){_0xc611f8[_0x194bbd[_0x23c7f8[_0x557e08][_0xdca1('0x67')]]]=_0x23c7f8[_0x557e08][_0xdca1('0x6b')];}}for(var _0x460d51 in _0x194bbd){if(!_0xc611f8[_0xdca1('0x3c')](_0x194bbd[_0x460d51])){_0xc611f8[_0x194bbd[_0x460d51]]=null;}}_0x2d187c['push'](_0xc611f8);}return _0x2d187c;}})[_0xdca1('0x29')](function(_0x5a697c){if(!_[_0xdca1('0x6c')](_0x5a697c)){var _0x24c935=toCsv(_0x5a697c);var _0x4ba44d=Date['now']();fs[_0xdca1('0x6d')](util[_0xdca1('0x69')](_0xdca1('0x6e'),_0x31af85[_0xdca1('0x4b')]['id'],_0x4ba44d),_0x24c935);_0x9134c9[_0xdca1('0x6f')](_0xdca1('0x70'),_0xdca1('0x71')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x31af85[_0xdca1('0x4b')]['id'],_0x4ba44d));_0x9134c9[_0xdca1('0x6f')](_0xdca1('0x72'),_0xdca1('0x73'));return _0x9134c9[_0xdca1('0x74')](util[_0xdca1('0x69')](_0xdca1('0x6e'),_0x31af85['params']['id'],_0x4ba44d));}else{return _0x9134c9['sendStatus'](0xcc);}})['catch'](handleError(_0x9134c9,null));}; \ No newline at end of file +var _0xae2b=['attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','filter','options','count','findAll','rows','catch','show','keys','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','clone','params','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','pick','ProjectId','getAnswers','JscriptyAnswerReport','number','indexOf','toString','replace','getSummary','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','set','Content-Range','apply','save','update','destroy','then','get','Projects','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xae2b,0xb3));var _0xbae2=function(_0x168fb5,_0x157bf8){_0x168fb5=_0x168fb5-0x0;var _0x5eb4a3=_0xae2b[_0x168fb5];return _0x5eb4a3;};'use strict';var emlformat=require(_0xbae2('0x0'));var rimraf=require(_0xbae2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbae2('0x2'));var rp=require(_0xbae2('0x3'));var moment=require(_0xbae2('0x4'));var BPromise=require(_0xbae2('0x5'));var Mustache=require(_0xbae2('0x6'));var util=require(_0xbae2('0x7'));var path=require('path');var sox=require(_0xbae2('0x8'));var csv=require('to-csv');var ejs=require(_0xbae2('0x9'));var fs=require('fs');var fs_extra=require(_0xbae2('0xa'));var _=require(_0xbae2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbae2('0xc'));var querystring=require(_0xbae2('0xd'));var Papa=require(_0xbae2('0xe'));var Redis=require(_0xbae2('0xf'));var authService=require(_0xbae2('0x10'));var qs=require(_0xbae2('0x11'));var as=require(_0xbae2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xbae2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbae2('0x14'));var db=require(_0xbae2('0x15'))['db'];function respondWithStatusCode(_0x1b28ce,_0x4c39ef){_0x4c39ef=_0x4c39ef||0xcc;return function(_0x381f69){if(_0x381f69){return _0x1b28ce[_0xbae2('0x16')](_0x4c39ef);}return _0x1b28ce['status'](_0x4c39ef)[_0xbae2('0x17')]();};}function respondWithResult(_0x10aa05,_0xe206f3){_0xe206f3=_0xe206f3||0xc8;return function(_0x379104){if(_0x379104){return _0x10aa05[_0xbae2('0x18')](_0xe206f3)[_0xbae2('0x19')](_0x379104);}};}function respondWithFilteredResult(_0x16263d,_0x4d687b){return function(_0x2e4775){if(_0x2e4775){var _0x523e23=typeof _0x4d687b[_0xbae2('0x1a')]===_0xbae2('0x1b')&&typeof _0x4d687b['limit']===_0xbae2('0x1b');var _0x45ab0f=_0x2e4775['count'];var _0x27e323=_0x523e23?0x0:_0x4d687b[_0xbae2('0x1a')];var _0x46145a=_0x523e23?_0x2e4775['count']:_0x4d687b[_0xbae2('0x1a')]+_0x4d687b['limit'];var _0x4ee2d1;if(_0x46145a>=_0x45ab0f){_0x46145a=_0x45ab0f;_0x4ee2d1=0xc8;}else{_0x4ee2d1=0xce;}_0x16263d[_0xbae2('0x18')](_0x4ee2d1);return _0x16263d[_0xbae2('0x1c')](_0xbae2('0x1d'),_0x27e323+'-'+_0x46145a+'/'+_0x45ab0f)[_0xbae2('0x19')](_0x2e4775);}return null;};}function patchUpdates(_0x53b581){return function(_0x14bbe8){try{jsonpatch[_0xbae2('0x1e')](_0x14bbe8,_0x53b581,!![]);}catch(_0x4a42be){return BPromise['reject'](_0x4a42be);}return _0x14bbe8[_0xbae2('0x1f')]();};}function saveUpdates(_0x3f1e04,_0xd01446){return function(_0x1b9b24){if(_0x1b9b24){return _0x1b9b24[_0xbae2('0x20')](_0x3f1e04)['then'](function(_0x5b93a6){return _0x5b93a6;});}return null;};}function removeEntity(_0x4631b8,_0x2337f0){return function(_0x55deca){if(_0x55deca){return _0x55deca[_0xbae2('0x21')]()[_0xbae2('0x22')](function(){var _0x4154fd=_0x55deca[_0xbae2('0x23')]({'plain':!![]});var _0x5b084f=_0xbae2('0x24');return db['UserProfileResource'][_0xbae2('0x21')]({'where':{'type':_0x5b084f,'resourceId':_0x4154fd['id']}})[_0xbae2('0x22')](function(){return _0x55deca;});})[_0xbae2('0x22')](function(){_0x4631b8[_0xbae2('0x18')](0xcc)[_0xbae2('0x17')]();});}};}function handleEntityNotFound(_0x5ca636,_0x12dd33){return function(_0x2513c1){if(!_0x2513c1){_0x5ca636['sendStatus'](0x194);}return _0x2513c1;};}function handleError(_0x1361e7,_0x403286){_0x403286=_0x403286||0x1f4;return function(_0x339f83){logger[_0xbae2('0x25')](_0x339f83[_0xbae2('0x26')]);if(_0x339f83['name']){delete _0x339f83[_0xbae2('0x27')];}_0x1361e7['status'](_0x403286)[_0xbae2('0x28')](_0x339f83);};}exports[_0xbae2('0x29')]=function(_0x2ef178,_0x3aa169){var _0x327339={},_0x23220f={},_0x13cfb8={'count':0x0,'rows':[]};var _0x12f4c6=_[_0xbae2('0x2a')](db[_0xbae2('0x2b')][_0xbae2('0x2c')],function(_0x252b59){return{'name':_0x252b59[_0xbae2('0x2d')],'type':_0x252b59[_0xbae2('0x2e')][_0xbae2('0x2f')]};});_0x23220f[_0xbae2('0x30')]=_['map'](_0x12f4c6,_0xbae2('0x27'));_0x23220f[_0xbae2('0x31')]=_['keys'](_0x2ef178['query']);_0x23220f[_0xbae2('0x32')]=_[_0xbae2('0x33')](_0x23220f[_0xbae2('0x30')],_0x23220f[_0xbae2('0x31')]);_0x327339['attributes']=_[_0xbae2('0x33')](_0x23220f[_0xbae2('0x30')],qs[_0xbae2('0x34')](_0x2ef178[_0xbae2('0x31')][_0xbae2('0x34')]));_0x327339[_0xbae2('0x35')]=_0x327339[_0xbae2('0x35')][_0xbae2('0x36')]?_0x327339[_0xbae2('0x35')]:_0x23220f['model'];if(!_0x2ef178[_0xbae2('0x31')][_0xbae2('0x37')](_0xbae2('0x38'))){_0x327339[_0xbae2('0x39')]=qs['limit'](_0x2ef178[_0xbae2('0x31')][_0xbae2('0x39')]);_0x327339[_0xbae2('0x1a')]=qs[_0xbae2('0x1a')](_0x2ef178[_0xbae2('0x31')]['offset']);}_0x327339[_0xbae2('0x3a')]=qs['sort'](_0x2ef178[_0xbae2('0x31')][_0xbae2('0x3b')]);_0x327339[_0xbae2('0x3c')]=qs[_0xbae2('0x32')](_['pick'](_0x2ef178[_0xbae2('0x31')],_0x23220f['filters']),_0x12f4c6);if(_0x2ef178['query']['filter']){_0x327339[_0xbae2('0x3c')]=_[_0xbae2('0x3d')](_0x327339[_0xbae2('0x3c')],{'$or':_[_0xbae2('0x2a')](_0x12f4c6,function(_0x78ec8b){if(_0x78ec8b['type']!=='VIRTUAL'){var _0x26cab7={};_0x26cab7[_0x78ec8b['name']]={'$like':'%'+_0x2ef178[_0xbae2('0x31')][_0xbae2('0x3e')]+'%'};return _0x26cab7;}})});}_0x327339=_[_0xbae2('0x3d')]({},_0x327339,_0x2ef178[_0xbae2('0x3f')]);var _0x35be12={'where':_0x327339[_0xbae2('0x3c')]};return db[_0xbae2('0x2b')][_0xbae2('0x40')](_0x35be12)[_0xbae2('0x22')](function(_0x20eee7){_0x13cfb8[_0xbae2('0x40')]=_0x20eee7;if(_0x2ef178[_0xbae2('0x31')]['includeAll']){_0x327339['include']=[{'all':!![]}];}return db['JscriptyProject'][_0xbae2('0x41')](_0x327339);})[_0xbae2('0x22')](function(_0x497c7d){_0x13cfb8[_0xbae2('0x42')]=_0x497c7d;return _0x13cfb8;})[_0xbae2('0x22')](respondWithFilteredResult(_0x3aa169,_0x327339))[_0xbae2('0x43')](handleError(_0x3aa169,null));};exports[_0xbae2('0x44')]=function(_0x21f089,_0x5d4d96){var _0x4b88a9={'raw':![],'where':{'id':_0x21f089['params']['id']}},_0x1991dc={};_0x1991dc[_0xbae2('0x30')]=_[_0xbae2('0x45')](db[_0xbae2('0x2b')][_0xbae2('0x2c')]);_0x1991dc[_0xbae2('0x31')]=_['keys'](_0x21f089['query']);_0x1991dc['filters']=_[_0xbae2('0x33')](_0x1991dc['model'],_0x1991dc['query']);_0x4b88a9[_0xbae2('0x35')]=_[_0xbae2('0x33')](_0x1991dc['model'],qs['fields'](_0x21f089['query']['fields']));_0x4b88a9[_0xbae2('0x35')]=_0x4b88a9[_0xbae2('0x35')]['length']?_0x4b88a9[_0xbae2('0x35')]:_0x1991dc[_0xbae2('0x30')];if(_0x21f089[_0xbae2('0x31')][_0xbae2('0x46')]){_0x4b88a9[_0xbae2('0x47')]=[{'all':!![]}];}_0x4b88a9=_[_0xbae2('0x3d')]({},_0x4b88a9,_0x21f089[_0xbae2('0x3f')]);return db[_0xbae2('0x2b')][_0xbae2('0x48')](_0x4b88a9)[_0xbae2('0x22')](handleEntityNotFound(_0x5d4d96,null))[_0xbae2('0x22')](respondWithResult(_0x5d4d96,null))[_0xbae2('0x43')](handleError(_0x5d4d96,null));};exports['create']=function(_0x105d8b,_0x5630ac){return db[_0xbae2('0x2b')]['create'](_0x105d8b[_0xbae2('0x49')],{})[_0xbae2('0x22')](function(_0x4b184d){var _0x581f49=_0x105d8b[_0xbae2('0x4a')][_0xbae2('0x23')]({'plain':!![]});if(!_0x581f49)throw new Error(_0xbae2('0x4b'));if(_0x581f49[_0xbae2('0x4c')]===_0xbae2('0x4a')){var _0x426866=_0x4b184d[_0xbae2('0x23')]({'plain':!![]});var _0x17eb2c='Projects';return db[_0xbae2('0x4d')][_0xbae2('0x48')]({'where':{'name':_0x17eb2c,'userProfileId':_0x581f49['userProfileId']},'raw':!![]})[_0xbae2('0x22')](function(_0x4779a1){if(_0x4779a1&&_0x4779a1[_0xbae2('0x4e')]===0x0){return db[_0xbae2('0x4f')][_0xbae2('0x50')]({'name':_0x426866[_0xbae2('0x27')],'resourceId':_0x426866['id'],'type':_0x4779a1[_0xbae2('0x27')],'sectionId':_0x4779a1['id']},{})['then'](function(){return _0x4b184d;});}else{return _0x4b184d;}})[_0xbae2('0x43')](function(_0x4303cc){logger[_0xbae2('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4303cc);throw _0x4303cc;});}return _0x4b184d;})[_0xbae2('0x22')](respondWithResult(_0x5630ac,0xc9))['catch'](handleError(_0x5630ac,null));};exports[_0xbae2('0x51')]=function(_0x12e2c0,_0x117ed7){var _0x2309c0={'where':{'id':_0x12e2c0[_0xbae2('0x52')]['id']}},_0x185e7e={};_0x185e7e[_0xbae2('0x30')]=_[_0xbae2('0x45')](db[_0xbae2('0x2b')][_0xbae2('0x2c')]);_0x2309c0['attributes']=_[_0xbae2('0x33')](_0x185e7e[_0xbae2('0x30')],qs[_0xbae2('0x34')](_0x12e2c0[_0xbae2('0x31')][_0xbae2('0x34')]));_0x2309c0[_0xbae2('0x35')]=_0x2309c0[_0xbae2('0x35')][_0xbae2('0x36')]?_0x2309c0['attributes']:_0x185e7e['model'];if(_0x12e2c0[_0xbae2('0x31')][_0xbae2('0x46')]){_0x2309c0[_0xbae2('0x47')]=[{'all':!![]}];}_0x2309c0=_['merge']({},_0x2309c0,_0x12e2c0[_0xbae2('0x3f')]);return db[_0xbae2('0x2b')][_0xbae2('0x48')](_0x2309c0)[_0xbae2('0x22')](handleEntityNotFound(_0x117ed7,null))[_0xbae2('0x22')](function(_0x39074e){if(_0x39074e){var _0x39f697=_0x39074e[_0xbae2('0x23')]({'plain':!![]});_0x39f697=qs['omit'](_0x39f697,['id',_0xbae2('0x53'),'updatedAt']);_0x12e2c0[_0xbae2('0x49')]=_['omit'](_0x12e2c0[_0xbae2('0x49')],['id','createdAt',_0xbae2('0x54')]);return db['JscriptyProject']['create'](_[_0xbae2('0x3d')](_0x39f697,_0x12e2c0[_0xbae2('0x49')]),{'include':_0x12e2c0['query'][_0xbae2('0x46')]?[{'all':!![]}]:undefined})[_0xbae2('0x22')](function(_0x433285){var _0x1df6fc=_0x12e2c0[_0xbae2('0x4a')]['get']({'plain':!![]});if(!_0x1df6fc)throw new Error(_0xbae2('0x4b'));if(_0x1df6fc['role']===_0xbae2('0x4a')){var _0x482615=_0x433285[_0xbae2('0x23')]({'plain':!![]});var _0x412cbc='Projects';return db['UserProfileSection'][_0xbae2('0x48')]({'where':{'name':_0x412cbc,'userProfileId':_0x1df6fc[_0xbae2('0x55')]},'raw':!![]})[_0xbae2('0x22')](function(_0x1b3f56){if(_0x1b3f56&&_0x1b3f56[_0xbae2('0x4e')]===0x0){return db[_0xbae2('0x4f')]['create']({'name':_0x482615[_0xbae2('0x27')],'resourceId':_0x482615['id'],'type':_0x1b3f56[_0xbae2('0x27')],'sectionId':_0x1b3f56['id']},{})[_0xbae2('0x22')](function(){return _0x433285;});}else{return _0x433285;}})[_0xbae2('0x43')](function(_0x28c57e){logger[_0xbae2('0x25')](_0xbae2('0x56'),_0x28c57e);throw _0x28c57e;});}return _0x433285;});}})['then'](respondWithResult(_0x117ed7,0xc9))['catch'](handleError(_0x117ed7,null));};exports[_0xbae2('0x20')]=function(_0x828c72,_0x260990){if(_0x828c72[_0xbae2('0x49')]['id']){delete _0x828c72[_0xbae2('0x49')]['id'];}return db[_0xbae2('0x2b')]['find']({'where':{'id':_0x828c72[_0xbae2('0x52')]['id']}})['then'](handleEntityNotFound(_0x260990,null))['then'](saveUpdates(_0x828c72[_0xbae2('0x49')],null))['then'](respondWithResult(_0x260990,null))[_0xbae2('0x43')](handleError(_0x260990,null));};exports[_0xbae2('0x21')]=function(_0x4f8920,_0x234f5b){return db[_0xbae2('0x2b')][_0xbae2('0x48')]({'where':{'id':_0x4f8920['params']['id']}})[_0xbae2('0x22')](handleEntityNotFound(_0x234f5b,null))[_0xbae2('0x22')](removeEntity(_0x234f5b,null))[_0xbae2('0x43')](handleError(_0x234f5b,null));};exports[_0xbae2('0x57')]=function(_0x395b55,_0x37c0a5,_0x290eab){var _0xf21479={'raw':!![],'where':{}};var _0x369101={};var _0xf70676={'count':0x0,'rows':[]};return db[_0xbae2('0x2b')][_0xbae2('0x58')]({'where':{'id':_0x395b55[_0xbae2('0x52')]['id']}})[_0xbae2('0x22')](handleEntityNotFound(_0x37c0a5,null))[_0xbae2('0x22')](function(_0x2d8cba){if(_0x2d8cba){_0x369101['model']=_['keys'](db[_0xbae2('0x59')]['rawAttributes']);_0x369101[_0xbae2('0x31')]=_['keys'](_0x395b55['query']);_0x369101[_0xbae2('0x32')]=_[_0xbae2('0x33')](_0x369101['model'],_0x369101['query']);_0xf21479[_0xbae2('0x35')]=_[_0xbae2('0x33')](_0x369101[_0xbae2('0x30')],qs[_0xbae2('0x34')](_0x395b55[_0xbae2('0x31')][_0xbae2('0x34')]));_0xf21479[_0xbae2('0x35')]=_0xf21479[_0xbae2('0x35')][_0xbae2('0x36')]?_0xf21479[_0xbae2('0x35')]:_0x369101['model'];if(!_0x395b55[_0xbae2('0x31')][_0xbae2('0x37')](_0xbae2('0x38'))){_0xf21479[_0xbae2('0x39')]=qs[_0xbae2('0x39')](_0x395b55[_0xbae2('0x31')][_0xbae2('0x39')]);_0xf21479[_0xbae2('0x1a')]=qs['offset'](_0x395b55[_0xbae2('0x31')][_0xbae2('0x1a')]);}_0xf21479['order']=qs[_0xbae2('0x3b')](_0x395b55[_0xbae2('0x31')][_0xbae2('0x3b')]);_0xf21479[_0xbae2('0x3c')]=qs['filters'](_[_0xbae2('0x5a')](_0x395b55['query'],_0x369101[_0xbae2('0x32')]));_0xf21479[_0xbae2('0x3c')][_0xbae2('0x5b')]=_0x2d8cba['id'];if(_0x395b55[_0xbae2('0x31')][_0xbae2('0x3e')]){_0xf21479['where']=_[_0xbae2('0x3d')](_0xf21479[_0xbae2('0x3c')],{'$or':_[_0xbae2('0x2a')](_0xf21479[_0xbae2('0x35')],function(_0x58bc1b){var _0x3de69e={};_0x3de69e[_0x58bc1b]={'$like':'%'+_0x395b55['query']['filter']+'%'};return _0x3de69e;})});}_0xf21479=_[_0xbae2('0x3d')]({},_0xf21479,_0x395b55[_0xbae2('0x3f')]);return db[_0xbae2('0x59')]['count']({'where':_0xf21479[_0xbae2('0x3c')]})['then'](function(_0x1641cc){_0xf70676['count']=_0x1641cc;if(_0x395b55['query'][_0xbae2('0x46')]){_0xf21479[_0xbae2('0x47')]=[{'all':!![]}];}return db[_0xbae2('0x59')][_0xbae2('0x41')](_0xf21479);})['then'](function(_0xa423d){_0xf70676['rows']=_0xa423d;return _0xf70676;});}})[_0xbae2('0x22')](respondWithFilteredResult(_0x37c0a5,_0xf21479))[_0xbae2('0x43')](handleError(_0x37c0a5,null));};exports[_0xbae2('0x5c')]=function(_0xc1eb7e,_0x45031e,_0x1bb004){var _0x3a6bba={'raw':!![],'where':{}};var _0x4683a9={};var _0x1d125f={'count':0x0,'rows':[]};return db[_0xbae2('0x2b')][_0xbae2('0x58')]({'where':{'id':_0xc1eb7e[_0xbae2('0x52')]['id']}})['then'](handleEntityNotFound(_0x45031e,null))[_0xbae2('0x22')](function(_0x1b1996){if(_0x1b1996){_0x4683a9[_0xbae2('0x30')]=_[_0xbae2('0x45')](db['JscriptyAnswerReport'][_0xbae2('0x2c')]);_0x4683a9[_0xbae2('0x31')]=_[_0xbae2('0x45')](_0xc1eb7e['query']);_0x4683a9[_0xbae2('0x32')]=_[_0xbae2('0x33')](_0x4683a9[_0xbae2('0x30')],_0x4683a9[_0xbae2('0x31')]);_0x3a6bba[_0xbae2('0x35')]=_[_0xbae2('0x33')](_0x4683a9[_0xbae2('0x30')],qs[_0xbae2('0x34')](_0xc1eb7e[_0xbae2('0x31')][_0xbae2('0x34')]));_0x3a6bba[_0xbae2('0x35')]=_0x3a6bba[_0xbae2('0x35')]['length']?_0x3a6bba[_0xbae2('0x35')]:_0x4683a9[_0xbae2('0x30')];if(!_0xc1eb7e[_0xbae2('0x31')]['hasOwnProperty'](_0xbae2('0x38'))){_0x3a6bba[_0xbae2('0x39')]=qs[_0xbae2('0x39')](_0xc1eb7e[_0xbae2('0x31')][_0xbae2('0x39')]);_0x3a6bba[_0xbae2('0x1a')]=qs[_0xbae2('0x1a')](_0xc1eb7e[_0xbae2('0x31')][_0xbae2('0x1a')]);}_0x3a6bba[_0xbae2('0x3a')]=qs[_0xbae2('0x3b')](_0xc1eb7e[_0xbae2('0x31')][_0xbae2('0x3b')]);_0x3a6bba[_0xbae2('0x3c')]=qs['filters'](_['pick'](_0xc1eb7e[_0xbae2('0x31')],_0x4683a9[_0xbae2('0x32')]));_0x3a6bba[_0xbae2('0x3c')][_0xbae2('0x5b')]=_0x1b1996['id'];if(_0xc1eb7e['query'][_0xbae2('0x3e')]){_0x3a6bba['where']=_[_0xbae2('0x3d')](_0x3a6bba[_0xbae2('0x3c')],{'$or':_['map'](_0x3a6bba[_0xbae2('0x35')],function(_0xc5aa81){var _0x1686de={};_0x1686de[_0xc5aa81]={'$like':'%'+_0xc1eb7e[_0xbae2('0x31')]['filter']+'%'};return _0x1686de;})});}_0x3a6bba=_[_0xbae2('0x3d')]({},_0x3a6bba,_0xc1eb7e['options']);return db[_0xbae2('0x5d')]['count']({'where':_0x3a6bba[_0xbae2('0x3c')]})[_0xbae2('0x22')](function(_0x346d89){_0x1d125f[_0xbae2('0x40')]=_0x346d89;if(_0xc1eb7e[_0xbae2('0x31')][_0xbae2('0x46')]){_0x3a6bba[_0xbae2('0x47')]=[{'all':!![]}];}return db[_0xbae2('0x5d')]['findAll'](_0x3a6bba);})[_0xbae2('0x22')](function(_0x4023f2){_0x1d125f[_0xbae2('0x42')]=_0x4023f2;return _0x1d125f;});}})[_0xbae2('0x22')](respondWithFilteredResult(_0x45031e,_0x3a6bba))[_0xbae2('0x43')](handleError(_0x45031e,null));};function char(_0x2e8c86){return _0xbae2('0x5e')===typeof _0x2e8c86?String['fromCharCode']['apply'](null,arguments):_0x2e8c86;}function needsEncapsulation(_0x35518d){return!!_0x35518d&&(_0x35518d['toString']()[_0xbae2('0x5f')](char(0xd))>=0x0||_0x35518d[_0xbae2('0x60')]()['indexOf'](char(0xa))>=0x0||_0x35518d['toString']()['indexOf'](char(0x2c))>=0x0||_0x35518d[_0xbae2('0x60')]()[_0xbae2('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x1a10e5){var _0x34d2a8=char(0x22),_0x1893cb='\x5c'+char(0x22),_0x5003c7=_0x1a10e5[_0xbae2('0x60')]()[_0xbae2('0x61')](new RegExp(_0x34d2a8,'g'),_0x1893cb);return _0x34d2a8+_0x5003c7+_0x34d2a8;}exports[_0xbae2('0x62')]=function(_0x1c8168,_0x22debe,_0x285c59){var _0x1e375c,_0x491a24;var _0x86dfaa={'where':{'ProjectId':_0x1c8168[_0xbae2('0x52')]['id']}};if(_0x1c8168['query']['startTime']){_0x86dfaa['where']['starttime']=JSON[_0xbae2('0x63')](_0x1c8168['query'][_0xbae2('0x64')]);}return db[_0xbae2('0x59')]['findAll'](_0x86dfaa)['then'](handleEntityNotFound(_0x22debe,null))[_0xbae2('0x22')](function(_0x58507a){if(_0x58507a){_0x1e375c=_0x58507a;return db[_0xbae2('0x65')][_0xbae2('0x41')]({'where':{'SessionId':{'$in':_['map'](_0x1e375c,'id')},'ProjectId':_0x1c8168['params']['id']},'order':_0xbae2('0x66')});}})[_0xbae2('0x22')](handleEntityNotFound(_0x22debe,null))[_0xbae2('0x22')](function(_0x33e221){if(_0x33e221){_0x491a24=_0x33e221;var _0x2d71e3={};for(var _0x4878a9=0x0,_0x15ff64=_0x491a24['length'];_0x4878a9<_0x15ff64;_0x4878a9++){if(!_0x2d71e3[_0xbae2('0x37')](_0x491a24[_0x4878a9][_0xbae2('0x67')])){_0x2d71e3[_0x491a24[_0x4878a9][_0xbae2('0x67')]]=needsEncapsulation(_0x491a24[_0x4878a9][_0xbae2('0x68')])?encapsulate(_0x491a24[_0x4878a9][_0xbae2('0x68')]):_0x491a24[_0x4878a9]['question'];}}var _0x53c50a=[],_0x56670c={};for(var _0x25e385=0x0,_0x5b4afc=_0x1e375c[_0xbae2('0x36')];_0x25e385<_0x5b4afc;_0x25e385++){_0x56670c={'ProjectId':_0x1c8168['params']['id'],'SessionId':_0x1e375c[_0x25e385]['id'],'StartTime':moment(_0x1e375c[_0x25e385][_0xbae2('0x69')])[_0xbae2('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x2d330f=0x0,_0x3559fa=_0x491a24[_0xbae2('0x36')];_0x2d330f<_0x3559fa;_0x2d330f++){if(_0x491a24[_0x2d330f][_0xbae2('0x6b')]==_0x1e375c[_0x25e385]['id']&&_0x2d71e3[_0xbae2('0x37')](_0x491a24[_0x2d330f]['questionId'])){_0x56670c[_0x2d71e3[_0x491a24[_0x2d330f]['questionId']]]=_0x491a24[_0x2d330f]['answer'];}}for(var _0x26867e in _0x2d71e3){if(!_0x56670c[_0xbae2('0x37')](_0x2d71e3[_0x26867e])){_0x56670c[_0x2d71e3[_0x26867e]]=null;}}_0x53c50a[_0xbae2('0x6c')](_0x56670c);}return _0x53c50a;}})[_0xbae2('0x22')](function(_0x30f970){if(!_[_0xbae2('0x6d')](_0x30f970)){var _0x2eb4e6=toCsv(_0x30f970);var _0x47eb7d=Date[_0xbae2('0x6e')]();fs[_0xbae2('0x6f')](util[_0xbae2('0x6a')](_0xbae2('0x70'),_0x1c8168[_0xbae2('0x52')]['id'],_0x47eb7d),_0x2eb4e6);_0x22debe[_0xbae2('0x71')]('Content-disposition','attachment;\x20filename='+util[_0xbae2('0x6a')]('Jscripty_Project_%d_Summary_%s.csv',_0x1c8168['params']['id'],_0x47eb7d));_0x22debe['setHeader'](_0xbae2('0x72'),'text/csv');return _0x22debe[_0xbae2('0x73')](util[_0xbae2('0x6a')](_0xbae2('0x70'),_0x1c8168['params']['id'],_0x47eb7d));}else{return _0x22debe[_0xbae2('0x16')](0xcc);}})[_0xbae2('0x43')](handleError(_0x22debe,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 3b5ebe4..90d6f74 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 _0xc978=['api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','util','../../config/logger'];(function(_0x1e6382,_0x4719f5){var _0x3983b6=function(_0x64d2f2){while(--_0x64d2f2){_0x1e6382['push'](_0x1e6382['shift']());}};_0x3983b6(++_0x4719f5);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var logger=require(_0x8c97('0x2'))(_0x8c97('0x3'));var moment=require(_0x8c97('0x4'));var BPromise=require(_0x8c97('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c97('0x6'));var rimraf=require(_0x8c97('0x7'));var config=require(_0x8c97('0x8'));var attributes=require(_0x8c97('0x9'));module[_0x8c97('0xa')]=function(_0x2a9434,_0xabd146){return _0x2a9434['define'](_0x8c97('0xb'),attributes,{'tableName':_0x8c97('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdfd=['jscripty_projects','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','JscriptyProject'];(function(_0x3d25fe,_0x303df9){var _0x1f7359=function(_0x2ee20c){while(--_0x2ee20c){_0x3d25fe['push'](_0x3d25fe['shift']());}};_0x1f7359(++_0x303df9);}(_0xbdfd,0x135));var _0xdbdf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbdfd[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xdbdf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdbdf('0x1'));var moment=require(_0xdbdf('0x2'));var BPromise=require(_0xdbdf('0x3'));var rp=require(_0xdbdf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdbdf('0x5'));var config=require(_0xdbdf('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0xdbdf('0x7')]=function(_0xa743ff,_0x484034){return _0xa743ff[_0xdbdf('0x8')](_0xdbdf('0x9'),attributes,{'tableName':_0xdbdf('0xa'),'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 4c45242..edaa7f9 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 _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1e076b,_0x480da5){var _0x1eba97=function(_0x4dcd2d){while(--_0x4dcd2d){_0x1e076b['push'](_0x1e076b['shift']());}};_0x1eba97(++_0x480da5);}(_0x70e0,0x17b));var _0x070e=function(_0x5a827b,_0x30f507){_0x5a827b=_0x5a827b-0x0;var _0x5e33e6=_0x70e0[_0x5a827b];return _0x5e33e6;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5cceba,_0x40342e){var _0x30fc05=function(_0x2af4f5){while(--_0x2af4f5){_0x5cceba['push'](_0x5cceba['shift']());}};_0x30fc05(++_0x40342e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5ad697,_0x1f49e7){_0x5ad697=_0x5ad697-0x0;var _0x408d2d=_0xb43b[_0x5ad697];return _0x408d2d;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index f7f13c3..05472a0 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 _0xf474=['./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf474,0x89));var _0x4f47=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xf474[_0x47aa64];return _0x549c7a;};'use strict';var multer=require(_0x4f47('0x0'));var util=require(_0x4f47('0x1'));var path=require('path');var timeout=require(_0x4f47('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4f47('0x3'));var auth=require(_0x4f47('0x4'));var interaction=require(_0x4f47('0x5'));var config=require(_0x4f47('0x6'));var controller=require(_0x4f47('0x7'));router[_0x4f47('0x8')]('/',auth[_0x4f47('0x9')](),controller[_0x4f47('0xa')]);router[_0x4f47('0x8')](_0x4f47('0xb'),auth[_0x4f47('0x9')](),controller[_0x4f47('0xc')]);router[_0x4f47('0x8')](_0x4f47('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x4f47('0x9')](),controller['create']);router['put'](_0x4f47('0xd'),auth['isAuthenticated'](),controller[_0x4f47('0xe')]);router[_0x4f47('0xf')]('/:id',auth[_0x4f47('0x9')](),controller[_0x4f47('0x10')]);module[_0x4f47('0x11')]=router; \ No newline at end of file +var _0xd6ee=['/:id','show','post','create','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','describe'];(function(_0x3ef4f1,_0x101940){var _0x5b873f=function(_0x54f5f1){while(--_0x54f5f1){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x5b873f(++_0x101940);}(_0xd6ee,0x138));var _0xed6e=function(_0x4965ed,_0x5a9970){_0x4965ed=_0x4965ed-0x0;var _0xd8494b=_0xd6ee[_0x4965ed];return _0xd8494b;};'use strict';var multer=require(_0xed6e('0x0'));var util=require('util');var path=require(_0xed6e('0x1'));var timeout=require(_0xed6e('0x2'));var express=require(_0xed6e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xed6e('0x4'));var interaction=require(_0xed6e('0x5'));var config=require(_0xed6e('0x6'));var controller=require(_0xed6e('0x7'));router[_0xed6e('0x8')]('/',auth[_0xed6e('0x9')](),controller['index']);router[_0xed6e('0x8')]('/describe',auth[_0xed6e('0x9')](),controller[_0xed6e('0xa')]);router[_0xed6e('0x8')](_0xed6e('0xb'),auth['isAuthenticated'](),controller[_0xed6e('0xc')]);router[_0xed6e('0xd')]('/',auth[_0xed6e('0x9')](),controller[_0xed6e('0xe')]);router['put']('/:id',auth[_0xed6e('0x9')](),controller['update']);router['delete'](_0xed6e('0xb'),auth[_0xed6e('0x9')](),controller[_0xed6e('0xf')]);module[_0xed6e('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index f8f77cc..324fc04 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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x4ad49c,_0x442435){_0x4ad49c=_0x4ad49c-0x0;var _0x167914=_0x7a54[_0x4ad49c];return _0x167914;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7a54,0x106));var _0x47a5=function(_0x560173,_0x29381a){_0x560173=_0x560173-0x0;var _0x469b4f=_0x7a54[_0x560173];return _0x469b4f;};'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 d838373..fba1aee 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 _0xa82d=['include','options','find','catch','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','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','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','error','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','rows','show','keys'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xa82d,0x12b));var _0xda82=function(_0x30c1ae,_0x49dcfc){_0x30c1ae=_0x30c1ae-0x0;var _0x499c21=_0xa82d[_0x30c1ae];return _0x499c21;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xda82('0x0'));var jsonpatch=require(_0xda82('0x1'));var rp=require(_0xda82('0x2'));var moment=require(_0xda82('0x3'));var BPromise=require(_0xda82('0x4'));var Mustache=require(_0xda82('0x5'));var util=require(_0xda82('0x6'));var path=require(_0xda82('0x7'));var sox=require(_0xda82('0x8'));var csv=require(_0xda82('0x9'));var ejs=require(_0xda82('0xa'));var fs=require('fs');var fs_extra=require(_0xda82('0xb'));var _=require(_0xda82('0xc'));var squel=require(_0xda82('0xd'));var crypto=require(_0xda82('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xda82('0xf'));var toCsv=require(_0xda82('0x9'));var querystring=require('querystring');var Papa=require(_0xda82('0x10'));var Redis=require(_0xda82('0x11'));var authService=require(_0xda82('0x12'));var qs=require(_0xda82('0x13'));var as=require(_0xda82('0x14'));var hardwareService=require(_0xda82('0x15'));var logger=require('../../config/logger')(_0xda82('0x16'));var utils=require(_0xda82('0x17'));var config=require(_0xda82('0x18'));var licenseUtil=require(_0xda82('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59d8ff,_0x48704e){_0x48704e=_0x48704e||0xcc;return function(_0x1b255b){if(_0x1b255b){return _0x59d8ff[_0xda82('0x1a')](_0x48704e);}return _0x59d8ff[_0xda82('0x1b')](_0x48704e)[_0xda82('0x1c')]();};}function respondWithResult(_0x47f858,_0x391253){_0x391253=_0x391253||0xc8;return function(_0x36deac){if(_0x36deac){return _0x47f858['status'](_0x391253)['json'](_0x36deac);}};}function respondWithFilteredResult(_0x355f21,_0x54da4f){return function(_0x3d78a7){if(_0x3d78a7){var _0x13e2fb=typeof _0x54da4f[_0xda82('0x1d')]===_0xda82('0x1e')&&typeof _0x54da4f[_0xda82('0x1f')]===_0xda82('0x1e');var _0x5a4758=_0x3d78a7['count'];var _0xf76395=_0x13e2fb?0x0:_0x54da4f['offset'];var _0x288c57=_0x13e2fb?_0x3d78a7[_0xda82('0x20')]:_0x54da4f[_0xda82('0x1d')]+_0x54da4f[_0xda82('0x1f')];var _0x2b9528;if(_0x288c57>=_0x5a4758){_0x288c57=_0x5a4758;_0x2b9528=0xc8;}else{_0x2b9528=0xce;}_0x355f21[_0xda82('0x1b')](_0x2b9528);return _0x355f21['set'](_0xda82('0x21'),_0xf76395+'-'+_0x288c57+'/'+_0x5a4758)[_0xda82('0x22')](_0x3d78a7);}return null;};}function patchUpdates(_0x4b6dbc){return function(_0x554e4b){try{jsonpatch['apply'](_0x554e4b,_0x4b6dbc,!![]);}catch(_0x5ec047){return BPromise[_0xda82('0x23')](_0x5ec047);}return _0x554e4b[_0xda82('0x24')]();};}function saveUpdates(_0x391288,_0x4cf00b){return function(_0x32736f){if(_0x32736f){return _0x32736f[_0xda82('0x25')](_0x391288)[_0xda82('0x26')](function(_0x213a07){return _0x213a07;});}return null;};}function removeEntity(_0x99086a,_0x2712ce){return function(_0x15ce2d){if(_0x15ce2d){return _0x15ce2d['destroy']()[_0xda82('0x26')](function(){_0x99086a[_0xda82('0x1b')](0xcc)[_0xda82('0x1c')]();});}};}function handleEntityNotFound(_0x2cbb0f,_0x392a08){return function(_0x7a0622){if(!_0x7a0622){_0x2cbb0f['sendStatus'](0x194);}return _0x7a0622;};}function handleError(_0x3b8d91,_0x258270){_0x258270=_0x258270||0x1f4;return function(_0x1a90bb){logger[_0xda82('0x27')](_0x1a90bb['stack']);if(_0x1a90bb[_0xda82('0x28')]){delete _0x1a90bb['name'];}_0x3b8d91[_0xda82('0x1b')](_0x258270)['send'](_0x1a90bb);};}exports[_0xda82('0x29')]=function(_0x20ef73,_0x530bc9){var _0xaa3003={},_0x5de518={},_0xc20d44={'count':0x0,'rows':[]};var _0x47eac1=_[_0xda82('0x2a')](db[_0xda82('0x2b')][_0xda82('0x2c')],function(_0x28775f){return{'name':_0x28775f[_0xda82('0x2d')],'type':_0x28775f['type']['key']};});_0x5de518[_0xda82('0x2e')]=_[_0xda82('0x2a')](_0x47eac1,_0xda82('0x28'));_0x5de518[_0xda82('0x2f')]=_['keys'](_0x20ef73[_0xda82('0x2f')]);_0x5de518[_0xda82('0x30')]=_[_0xda82('0x31')](_0x5de518[_0xda82('0x2e')],_0x5de518['query']);_0xaa3003[_0xda82('0x32')]=_[_0xda82('0x31')](_0x5de518['model'],qs[_0xda82('0x33')](_0x20ef73[_0xda82('0x2f')]['fields']));_0xaa3003[_0xda82('0x32')]=_0xaa3003[_0xda82('0x32')][_0xda82('0x34')]?_0xaa3003[_0xda82('0x32')]:_0x5de518[_0xda82('0x2e')];if(!_0x20ef73['query']['hasOwnProperty'](_0xda82('0x35'))){_0xaa3003[_0xda82('0x1f')]=qs[_0xda82('0x1f')](_0x20ef73[_0xda82('0x2f')][_0xda82('0x1f')]);_0xaa3003[_0xda82('0x1d')]=qs['offset'](_0x20ef73[_0xda82('0x2f')]['offset']);}_0xaa3003[_0xda82('0x36')]=qs[_0xda82('0x37')](_0x20ef73[_0xda82('0x2f')][_0xda82('0x37')]);_0xaa3003[_0xda82('0x38')]=qs[_0xda82('0x30')](_[_0xda82('0x39')](_0x20ef73[_0xda82('0x2f')],_0x5de518[_0xda82('0x30')]),_0x47eac1);if(_0x20ef73[_0xda82('0x2f')][_0xda82('0x3a')]){_0xaa3003[_0xda82('0x38')]=_[_0xda82('0x3b')](_0xaa3003[_0xda82('0x38')],{'$or':_['map'](_0x47eac1,function(_0x3b1684){if(_0x3b1684[_0xda82('0x3c')]!==_0xda82('0x3d')){var _0x264007={};_0x264007[_0x3b1684[_0xda82('0x28')]]={'$like':'%'+_0x20ef73[_0xda82('0x2f')][_0xda82('0x3a')]+'%'};return _0x264007;}})});}_0xaa3003=_[_0xda82('0x3b')]({},_0xaa3003,_0x20ef73['options']);var _0x5bdd3c={'where':_0xaa3003[_0xda82('0x38')]};return db['JscriptyQuestionReport']['count'](_0x5bdd3c)['then'](function(_0xb374ee){_0xc20d44['count']=_0xb374ee;if(_0x20ef73['query'][_0xda82('0x3e')]){_0xaa3003['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0xaa3003);})['then'](function(_0x4917d6){_0xc20d44[_0xda82('0x3f')]=_0x4917d6;return _0xc20d44;})['then'](respondWithFilteredResult(_0x530bc9,_0xaa3003))['catch'](handleError(_0x530bc9,null));};exports[_0xda82('0x40')]=function(_0x5a283b,_0x2bedb8){var _0x10f099={'raw':!![],'where':{'id':_0x5a283b['params']['id']}},_0x3cb712={};_0x3cb712['model']=_[_0xda82('0x41')](db[_0xda82('0x2b')][_0xda82('0x2c')]);_0x3cb712[_0xda82('0x2f')]=_[_0xda82('0x41')](_0x5a283b[_0xda82('0x2f')]);_0x3cb712[_0xda82('0x30')]=_['intersection'](_0x3cb712['model'],_0x3cb712[_0xda82('0x2f')]);_0x10f099[_0xda82('0x32')]=_[_0xda82('0x31')](_0x3cb712[_0xda82('0x2e')],qs[_0xda82('0x33')](_0x5a283b[_0xda82('0x2f')][_0xda82('0x33')]));_0x10f099[_0xda82('0x32')]=_0x10f099[_0xda82('0x32')]['length']?_0x10f099[_0xda82('0x32')]:_0x3cb712[_0xda82('0x2e')];if(_0x5a283b[_0xda82('0x2f')][_0xda82('0x3e')]){_0x10f099[_0xda82('0x42')]=[{'all':!![]}];}_0x10f099=_[_0xda82('0x3b')]({},_0x10f099,_0x5a283b[_0xda82('0x43')]);return db[_0xda82('0x2b')][_0xda82('0x44')](_0x10f099)['then'](handleEntityNotFound(_0x2bedb8,null))[_0xda82('0x26')](respondWithResult(_0x2bedb8,null))[_0xda82('0x45')](handleError(_0x2bedb8,null));};exports[_0xda82('0x46')]=function(_0x4de53d,_0x52bbd5){return db[_0xda82('0x2b')][_0xda82('0x46')](_0x4de53d[_0xda82('0x47')],{})['then'](respondWithResult(_0x52bbd5,0xc9))[_0xda82('0x45')](handleError(_0x52bbd5,null));};exports[_0xda82('0x25')]=function(_0x5f27bb,_0xa7ee5e){if(_0x5f27bb[_0xda82('0x47')]['id']){delete _0x5f27bb[_0xda82('0x47')]['id'];}return db[_0xda82('0x2b')][_0xda82('0x44')]({'where':{'id':_0x5f27bb[_0xda82('0x48')]['id']}})[_0xda82('0x26')](handleEntityNotFound(_0xa7ee5e,null))[_0xda82('0x26')](saveUpdates(_0x5f27bb['body'],null))['then'](respondWithResult(_0xa7ee5e,null))[_0xda82('0x45')](handleError(_0xa7ee5e,null));};exports['destroy']=function(_0x438914,_0x3621ca){return db['JscriptyQuestionReport'][_0xda82('0x44')]({'where':{'id':_0x438914['params']['id']}})[_0xda82('0x26')](handleEntityNotFound(_0x3621ca,null))[_0xda82('0x26')](removeEntity(_0x3621ca,null))['catch'](handleError(_0x3621ca,null));};exports['describe']=function(_0x3f854c,_0xd28b53){return db[_0xda82('0x2b')]['describe']()[_0xda82('0x26')](respondWithResult(_0xd28b53,null))[_0xda82('0x45')](handleError(_0xd28b53,null));}; \ No newline at end of file +var _0x5b3e=['json','offset','undefined','limit','count','apply','reject','save','destroy','then','error','stack','name','send','index','map','JscriptyQuestionReport','type','key','keys','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','sendStatus','end','status'];(function(_0x4089ee,_0x5a62e2){var _0x1b8c3e=function(_0x5b1f43){while(--_0x5b1f43){_0x4089ee['push'](_0x4089ee['shift']());}};_0x1b8c3e(++_0x5a62e2);}(_0x5b3e,0x160));var _0xe5b3=function(_0x1372e7,_0x29540e){_0x1372e7=_0x1372e7-0x0;var _0xb9611e=_0x5b3e[_0x1372e7];return _0xb9611e;};'use strict';var emlformat=require(_0xe5b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5b3('0x1'));var jsonpatch=require(_0xe5b3('0x2'));var rp=require(_0xe5b3('0x3'));var moment=require('moment');var BPromise=require(_0xe5b3('0x4'));var Mustache=require(_0xe5b3('0x5'));var util=require(_0xe5b3('0x6'));var path=require('path');var sox=require(_0xe5b3('0x7'));var csv=require(_0xe5b3('0x8'));var ejs=require(_0xe5b3('0x9'));var fs=require('fs');var fs_extra=require(_0xe5b3('0xa'));var _=require(_0xe5b3('0xb'));var squel=require(_0xe5b3('0xc'));var crypto=require(_0xe5b3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe5b3('0xe'));var toCsv=require(_0xe5b3('0x8'));var querystring=require(_0xe5b3('0xf'));var Papa=require(_0xe5b3('0x10'));var Redis=require(_0xe5b3('0x11'));var authService=require(_0xe5b3('0x12'));var qs=require(_0xe5b3('0x13'));var as=require(_0xe5b3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5b3('0x15'))('api');var utils=require(_0xe5b3('0x16'));var config=require(_0xe5b3('0x17'));var licenseUtil=require(_0xe5b3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17f3c6,_0x135637){_0x135637=_0x135637||0xcc;return function(_0xe1618){if(_0xe1618){return _0x17f3c6[_0xe5b3('0x19')](_0x135637);}return _0x17f3c6['status'](_0x135637)[_0xe5b3('0x1a')]();};}function respondWithResult(_0x1ce899,_0x2b2fc9){_0x2b2fc9=_0x2b2fc9||0xc8;return function(_0x550805){if(_0x550805){return _0x1ce899[_0xe5b3('0x1b')](_0x2b2fc9)[_0xe5b3('0x1c')](_0x550805);}};}function respondWithFilteredResult(_0xe49e31,_0x402ec1){return function(_0x260c37){if(_0x260c37){var _0x3991eb=typeof _0x402ec1[_0xe5b3('0x1d')]===_0xe5b3('0x1e')&&typeof _0x402ec1[_0xe5b3('0x1f')]===_0xe5b3('0x1e');var _0x33ac6e=_0x260c37[_0xe5b3('0x20')];var _0x4635ac=_0x3991eb?0x0:_0x402ec1[_0xe5b3('0x1d')];var _0x2e54be=_0x3991eb?_0x260c37[_0xe5b3('0x20')]:_0x402ec1[_0xe5b3('0x1d')]+_0x402ec1[_0xe5b3('0x1f')];var _0x4b64b4;if(_0x2e54be>=_0x33ac6e){_0x2e54be=_0x33ac6e;_0x4b64b4=0xc8;}else{_0x4b64b4=0xce;}_0xe49e31[_0xe5b3('0x1b')](_0x4b64b4);return _0xe49e31['set']('Content-Range',_0x4635ac+'-'+_0x2e54be+'/'+_0x33ac6e)[_0xe5b3('0x1c')](_0x260c37);}return null;};}function patchUpdates(_0xe5dc73){return function(_0x2a1563){try{jsonpatch[_0xe5b3('0x21')](_0x2a1563,_0xe5dc73,!![]);}catch(_0x12437a){return BPromise[_0xe5b3('0x22')](_0x12437a);}return _0x2a1563[_0xe5b3('0x23')]();};}function saveUpdates(_0x1be566,_0x19ebbd){return function(_0x584259){if(_0x584259){return _0x584259['update'](_0x1be566)['then'](function(_0x5b3930){return _0x5b3930;});}return null;};}function removeEntity(_0x5da779,_0x343c67){return function(_0x4b9b77){if(_0x4b9b77){return _0x4b9b77[_0xe5b3('0x24')]()[_0xe5b3('0x25')](function(){_0x5da779[_0xe5b3('0x1b')](0xcc)[_0xe5b3('0x1a')]();});}};}function handleEntityNotFound(_0x536be4,_0x30dae6){return function(_0x32081c){if(!_0x32081c){_0x536be4['sendStatus'](0x194);}return _0x32081c;};}function handleError(_0x5ebd94,_0x1ce2bb){_0x1ce2bb=_0x1ce2bb||0x1f4;return function(_0x28265a){logger[_0xe5b3('0x26')](_0x28265a[_0xe5b3('0x27')]);if(_0x28265a['name']){delete _0x28265a[_0xe5b3('0x28')];}_0x5ebd94[_0xe5b3('0x1b')](_0x1ce2bb)[_0xe5b3('0x29')](_0x28265a);};}exports[_0xe5b3('0x2a')]=function(_0x1da963,_0x2e7d3e){var _0x575845={},_0x1cab27={},_0x23c682={'count':0x0,'rows':[]};var _0x54cf5d=_[_0xe5b3('0x2b')](db[_0xe5b3('0x2c')]['rawAttributes'],function(_0x5e3e84){return{'name':_0x5e3e84['fieldName'],'type':_0x5e3e84[_0xe5b3('0x2d')][_0xe5b3('0x2e')]};});_0x1cab27['model']=_[_0xe5b3('0x2b')](_0x54cf5d,'name');_0x1cab27['query']=_[_0xe5b3('0x2f')](_0x1da963[_0xe5b3('0x30')]);_0x1cab27[_0xe5b3('0x31')]=_['intersection'](_0x1cab27['model'],_0x1cab27['query']);_0x575845[_0xe5b3('0x32')]=_['intersection'](_0x1cab27[_0xe5b3('0x33')],qs[_0xe5b3('0x34')](_0x1da963[_0xe5b3('0x30')][_0xe5b3('0x34')]));_0x575845[_0xe5b3('0x32')]=_0x575845[_0xe5b3('0x32')][_0xe5b3('0x35')]?_0x575845[_0xe5b3('0x32')]:_0x1cab27[_0xe5b3('0x33')];if(!_0x1da963['query'][_0xe5b3('0x36')](_0xe5b3('0x37'))){_0x575845[_0xe5b3('0x1f')]=qs[_0xe5b3('0x1f')](_0x1da963[_0xe5b3('0x30')]['limit']);_0x575845['offset']=qs['offset'](_0x1da963['query'][_0xe5b3('0x1d')]);}_0x575845[_0xe5b3('0x38')]=qs[_0xe5b3('0x39')](_0x1da963['query'][_0xe5b3('0x39')]);_0x575845[_0xe5b3('0x3a')]=qs[_0xe5b3('0x31')](_['pick'](_0x1da963[_0xe5b3('0x30')],_0x1cab27[_0xe5b3('0x31')]),_0x54cf5d);if(_0x1da963[_0xe5b3('0x30')][_0xe5b3('0x3b')]){_0x575845['where']=_['merge'](_0x575845['where'],{'$or':_[_0xe5b3('0x2b')](_0x54cf5d,function(_0x372cdf){if(_0x372cdf['type']!==_0xe5b3('0x3c')){var _0x50a685={};_0x50a685[_0x372cdf[_0xe5b3('0x28')]]={'$like':'%'+_0x1da963[_0xe5b3('0x30')][_0xe5b3('0x3b')]+'%'};return _0x50a685;}})});}_0x575845=_[_0xe5b3('0x3d')]({},_0x575845,_0x1da963[_0xe5b3('0x3e')]);var _0x3da21f={'where':_0x575845[_0xe5b3('0x3a')]};return db[_0xe5b3('0x2c')][_0xe5b3('0x20')](_0x3da21f)['then'](function(_0x3c0428){_0x23c682[_0xe5b3('0x20')]=_0x3c0428;if(_0x1da963[_0xe5b3('0x30')]['includeAll']){_0x575845[_0xe5b3('0x3f')]=[{'all':!![]}];}return db[_0xe5b3('0x2c')][_0xe5b3('0x40')](_0x575845);})['then'](function(_0x19fc0e){_0x23c682[_0xe5b3('0x41')]=_0x19fc0e;return _0x23c682;})[_0xe5b3('0x25')](respondWithFilteredResult(_0x2e7d3e,_0x575845))[_0xe5b3('0x42')](handleError(_0x2e7d3e,null));};exports[_0xe5b3('0x43')]=function(_0x1e596f,_0x78311a){var _0x57106e={'raw':!![],'where':{'id':_0x1e596f[_0xe5b3('0x44')]['id']}},_0x2f1d0b={};_0x2f1d0b[_0xe5b3('0x33')]=_[_0xe5b3('0x2f')](db[_0xe5b3('0x2c')][_0xe5b3('0x45')]);_0x2f1d0b[_0xe5b3('0x30')]=_[_0xe5b3('0x2f')](_0x1e596f[_0xe5b3('0x30')]);_0x2f1d0b[_0xe5b3('0x31')]=_[_0xe5b3('0x46')](_0x2f1d0b[_0xe5b3('0x33')],_0x2f1d0b[_0xe5b3('0x30')]);_0x57106e['attributes']=_[_0xe5b3('0x46')](_0x2f1d0b[_0xe5b3('0x33')],qs[_0xe5b3('0x34')](_0x1e596f[_0xe5b3('0x30')][_0xe5b3('0x34')]));_0x57106e[_0xe5b3('0x32')]=_0x57106e[_0xe5b3('0x32')][_0xe5b3('0x35')]?_0x57106e[_0xe5b3('0x32')]:_0x2f1d0b[_0xe5b3('0x33')];if(_0x1e596f[_0xe5b3('0x30')][_0xe5b3('0x47')]){_0x57106e[_0xe5b3('0x3f')]=[{'all':!![]}];}_0x57106e=_[_0xe5b3('0x3d')]({},_0x57106e,_0x1e596f[_0xe5b3('0x3e')]);return db[_0xe5b3('0x2c')][_0xe5b3('0x48')](_0x57106e)[_0xe5b3('0x25')](handleEntityNotFound(_0x78311a,null))[_0xe5b3('0x25')](respondWithResult(_0x78311a,null))[_0xe5b3('0x42')](handleError(_0x78311a,null));};exports[_0xe5b3('0x49')]=function(_0x44df15,_0x377c9d){return db[_0xe5b3('0x2c')]['create'](_0x44df15[_0xe5b3('0x4a')],{})['then'](respondWithResult(_0x377c9d,0xc9))[_0xe5b3('0x42')](handleError(_0x377c9d,null));};exports[_0xe5b3('0x4b')]=function(_0x48ee7a,_0x10ec8e){if(_0x48ee7a[_0xe5b3('0x4a')]['id']){delete _0x48ee7a[_0xe5b3('0x4a')]['id'];}return db[_0xe5b3('0x2c')]['find']({'where':{'id':_0x48ee7a[_0xe5b3('0x44')]['id']}})[_0xe5b3('0x25')](handleEntityNotFound(_0x10ec8e,null))[_0xe5b3('0x25')](saveUpdates(_0x48ee7a[_0xe5b3('0x4a')],null))[_0xe5b3('0x25')](respondWithResult(_0x10ec8e,null))['catch'](handleError(_0x10ec8e,null));};exports['destroy']=function(_0x1dad16,_0x3c771c){return db[_0xe5b3('0x2c')][_0xe5b3('0x48')]({'where':{'id':_0x1dad16[_0xe5b3('0x44')]['id']}})[_0xe5b3('0x25')](handleEntityNotFound(_0x3c771c,null))[_0xe5b3('0x25')](removeEntity(_0x3c771c,null))['catch'](handleError(_0x3c771c,null));};exports['describe']=function(_0x27545a,_0x1366ce){return db[_0xe5b3('0x2c')]['describe']()[_0xe5b3('0x25')](respondWithResult(_0x1366ce,null))['catch'](handleError(_0x1366ce,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index b79f126..9b919ef 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 _0xe192=['util','../../config/logger','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','JscriptyQuestionReport','lodash'];(function(_0x995d7b,_0x657cd3){var _0x396664=function(_0x3528ab){while(--_0x3528ab){_0x995d7b['push'](_0x995d7b['shift']());}};_0x396664(++_0x657cd3);}(_0xe192,0xff));var _0x2e19=function(_0x3cf57c,_0x1af43f){_0x3cf57c=_0x3cf57c-0x0;var _0x1ce95a=_0xe192[_0x3cf57c];return _0x1ce95a;};'use strict';var _=require(_0x2e19('0x0'));var util=require(_0x2e19('0x1'));var logger=require(_0x2e19('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e19('0x3'));var rimraf=require(_0x2e19('0x4'));var config=require(_0x2e19('0x5'));var attributes=require(_0x2e19('0x6'));module['exports']=function(_0x494d7d,_0xbae609){return _0x494d7d['define'](_0x2e19('0x7'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a3e=['rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x367e3c,_0x4b79d3){var _0x3c40ae=function(_0x17f43f){while(--_0x17f43f){_0x367e3c['push'](_0x367e3c['shift']());}};_0x3c40ae(++_0x4b79d3);}(_0x9a3e,0xf7));var _0xe9a3=function(_0x1241bb,_0x55f1a2){_0x1241bb=_0x1241bb-0x0;var _0x6ab20a=_0x9a3e[_0x1241bb];return _0x6ab20a;};'use strict';var _=require(_0xe9a3('0x0'));var util=require('util');var logger=require(_0xe9a3('0x1'))('api');var moment=require(_0xe9a3('0x2'));var BPromise=require(_0xe9a3('0x3'));var rp=require(_0xe9a3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9a3('0x5'));var config=require(_0xe9a3('0x6'));var attributes=require(_0xe9a3('0x7'));module[_0xe9a3('0x8')]=function(_0x442c41,_0x5c9f27){return _0x442c41[_0xe9a3('0x9')](_0xe9a3('0xa'),attributes,{'tableName':_0xe9a3('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 31b9d1c..cd6ec8e 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 _0x8d21=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x8d21,0x11d));var _0x18d2=function(_0x463869,_0x2836b2){_0x463869=_0x463869-0x0;var _0x3fe896=_0x8d21[_0x463869];return _0x3fe896;};'use strict';var _=require(_0x18d2('0x0'));var util=require(_0x18d2('0x1'));var moment=require(_0x18d2('0x2'));var BPromise=require(_0x18d2('0x3'));var rs=require(_0x18d2('0x4'));var fs=require('fs');var Redis=require(_0x18d2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x18d2('0x6'));var logger=require(_0x18d2('0x7'))('rpc');var config=require(_0x18d2('0x8'));var jayson=require(_0x18d2('0x9'));var client=jayson[_0x18d2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ef0d5,_0x314aec,_0x5dbb66){return new BPromise(function(_0x6bb1f5,_0x5910a2){return client[_0x18d2('0xb')](_0x4ef0d5,_0x5dbb66)[_0x18d2('0xc')](function(_0x37e315){logger[_0x18d2('0xd')](_0x18d2('0xe'),_0x314aec,_0x18d2('0xf'));logger[_0x18d2('0x10')](_0x18d2('0x11'),_0x314aec,_0x18d2('0xf'),JSON[_0x18d2('0x12')](_0x37e315));if(_0x37e315['error']){if(_0x37e315[_0x18d2('0x13')][_0x18d2('0x14')]===0x1f4){logger[_0x18d2('0x13')](_0x18d2('0xe'),_0x314aec,_0x37e315[_0x18d2('0x13')][_0x18d2('0x15')]);return _0x5910a2(_0x37e315[_0x18d2('0x13')][_0x18d2('0x15')]);}logger['error'](_0x18d2('0xe'),_0x314aec,_0x37e315['error'][_0x18d2('0x15')]);return _0x6bb1f5(_0x37e315[_0x18d2('0x13')]['message']);}else{logger['info'](_0x18d2('0xe'),_0x314aec,_0x18d2('0xf'));_0x6bb1f5(_0x37e315[_0x18d2('0x16')][_0x18d2('0x15')]);}})[_0x18d2('0x17')](function(_0x5abe9d){logger['error'](_0x18d2('0xe'),_0x314aec,_0x5abe9d);_0x5910a2(_0x5abe9d);});});} \ No newline at end of file +var _0x14c3=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','lodash','util'];(function(_0x156c8a,_0x2a464c){var _0x3cd68f=function(_0x58de72){while(--_0x58de72){_0x156c8a['push'](_0x156c8a['shift']());}};_0x3cd68f(++_0x2a464c);}(_0x14c3,0x14e));var _0x314c=function(_0x15b295,_0x446c88){_0x15b295=_0x15b295-0x0;var _0x1c0610=_0x14c3[_0x15b295];return _0x1c0610;};'use strict';var _=require(_0x314c('0x0'));var util=require(_0x314c('0x1'));var moment=require('moment');var BPromise=require(_0x314c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x314c('0x3'));var db=require(_0x314c('0x4'))['db'];var utils=require(_0x314c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x314c('0x6'));var jayson=require(_0x314c('0x7'));var client=jayson[_0x314c('0x8')][_0x314c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22dd05,_0x3587f4,_0x413a24){return new BPromise(function(_0x140e74,_0x3ca5d1){return client[_0x314c('0xa')](_0x22dd05,_0x413a24)[_0x314c('0xb')](function(_0x30b0d0){logger[_0x314c('0xc')](_0x314c('0xd'),_0x3587f4,_0x314c('0xe'));logger[_0x314c('0xf')](_0x314c('0x10'),_0x3587f4,_0x314c('0xe'),JSON[_0x314c('0x11')](_0x30b0d0));if(_0x30b0d0['error']){if(_0x30b0d0['error'][_0x314c('0x12')]===0x1f4){logger[_0x314c('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3587f4,_0x30b0d0[_0x314c('0x13')][_0x314c('0x14')]);return _0x3ca5d1(_0x30b0d0[_0x314c('0x13')][_0x314c('0x14')]);}logger[_0x314c('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3587f4,_0x30b0d0[_0x314c('0x13')][_0x314c('0x14')]);return _0x140e74(_0x30b0d0[_0x314c('0x13')][_0x314c('0x14')]);}else{logger['info'](_0x314c('0xd'),_0x3587f4,_0x314c('0xe'));_0x140e74(_0x30b0d0['result'][_0x314c('0x14')]);}})['catch'](function(_0x2dd9ba){logger['error'](_0x314c('0xd'),_0x3587f4,_0x2dd9ba);_0x3ca5d1(_0x2dd9ba);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 0a0955f..d8d8c3c 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 _0x6c72=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0x6c72,0x154));var _0x26c7=function(_0x553c65,_0x29fe36){_0x553c65=_0x553c65-0x0;var _0x3b5afb=_0x6c72[_0x553c65];return _0x3b5afb;};'use strict';var multer=require(_0x26c7('0x0'));var util=require(_0x26c7('0x1'));var path=require(_0x26c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x26c7('0x3'));var router=express[_0x26c7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x26c7('0x5'));var interaction=require(_0x26c7('0x6'));var config=require(_0x26c7('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x26c7('0x8')]('/',auth[_0x26c7('0x9')](),controller['index']);router[_0x26c7('0x8')](_0x26c7('0xa'),auth[_0x26c7('0x9')](),controller[_0x26c7('0xb')]);router[_0x26c7('0x8')]('/:id',auth[_0x26c7('0x9')](),controller[_0x26c7('0xc')]);router['get']('/:id/questions',auth[_0x26c7('0x9')](),controller['getQuestions']);router['post']('/',auth[_0x26c7('0x9')](),controller[_0x26c7('0xd')]);router[_0x26c7('0xe')](_0x26c7('0xf'),auth[_0x26c7('0x9')](),controller[_0x26c7('0x10')]);router[_0x26c7('0x11')](_0x26c7('0xf'),auth[_0x26c7('0x9')](),controller[_0x26c7('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa1a7=['./jscriptySessionReport.controller','isAuthenticated','get','describe','/:id','getQuestions','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x103365,_0x69dca){var _0x2f2fa2=function(_0x1cf32e){while(--_0x1cf32e){_0x103365['push'](_0x103365['shift']());}};_0x2f2fa2(++_0x69dca);}(_0xa1a7,0x1b0));var _0x7a1a=function(_0x1f6e71,_0x19360b){_0x1f6e71=_0x1f6e71-0x0;var _0x2271aa=_0xa1a7[_0x1f6e71];return _0x2271aa;};'use strict';var multer=require(_0x7a1a('0x0'));var util=require(_0x7a1a('0x1'));var path=require(_0x7a1a('0x2'));var timeout=require(_0x7a1a('0x3'));var express=require(_0x7a1a('0x4'));var router=express['Router']();var fs_extra=require(_0x7a1a('0x5'));var auth=require(_0x7a1a('0x6'));var interaction=require(_0x7a1a('0x7'));var config=require('../../config/environment');var controller=require(_0x7a1a('0x8'));router['get']('/',auth[_0x7a1a('0x9')](),controller['index']);router[_0x7a1a('0xa')]('/describe',auth[_0x7a1a('0x9')](),controller[_0x7a1a('0xb')]);router[_0x7a1a('0xa')](_0x7a1a('0xc'),auth[_0x7a1a('0x9')](),controller['show']);router['get']('/:id/questions',auth[_0x7a1a('0x9')](),controller[_0x7a1a('0xd')]);router[_0x7a1a('0xe')]('/',auth[_0x7a1a('0x9')](),controller[_0x7a1a('0xf')]);router['put'](_0x7a1a('0xc'),auth[_0x7a1a('0x9')](),controller[_0x7a1a('0x10')]);router[_0x7a1a('0x11')](_0x7a1a('0xc'),auth[_0x7a1a('0x9')](),controller[_0x7a1a('0x12')]);module[_0x7a1a('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 35ce900..4411ed7 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 _0x2a14=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','DATE','setDataValue','starttime','endtime'];(function(_0x5cbace,_0x33943c){var _0x6de5b8=function(_0x5aae38){while(--_0x5aae38){_0x5cbace['push'](_0x5cbace['shift']());}};_0x6de5b8(++_0x33943c);}(_0x2a14,0x123));var _0x42a1=function(_0x33686d,_0x5ac235){_0x33686d=_0x33686d-0x0;var _0x2bba26=_0x2a14[_0x33686d];return _0x2bba26;};'use strict';var moment=require(_0x42a1('0x0'));var Sequelize=require(_0x42a1('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x42a1('0x2')],'set':function(_0x44e870){this[_0x42a1('0x3')](_0x42a1('0x4'),_0x44e870);this[_0x42a1('0x3')](_0x42a1('0x5'),moment()[_0x42a1('0x6')](_0x42a1('0x7')));}},'endtime':{'type':Sequelize[_0x42a1('0x2')]},'membername':{'type':Sequelize[_0x42a1('0x8')]},'projectname':{'type':Sequelize[_0x42a1('0x8')]},'queue':{'type':Sequelize[_0x42a1('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x42a1('0x8')]},'calleridnum':{'type':Sequelize[_0x42a1('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3ff6=['BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0xf943c8,_0x24d100){var _0x48a401=function(_0x50431b){while(--_0x50431b){_0xf943c8['push'](_0xf943c8['shift']());}};_0x48a401(++_0x24d100);}(_0x3ff6,0x1a3));var _0x63ff=function(_0x4beed2,_0x2b8fef){_0x4beed2=_0x4beed2-0x0;var _0x564df1=_0x3ff6[_0x4beed2];return _0x564df1;};'use strict';var moment=require(_0x63ff('0x0'));var Sequelize=require(_0x63ff('0x1'));module[_0x63ff('0x2')]={'starttime':{'type':Sequelize[_0x63ff('0x3')],'set':function(_0x414acc){this[_0x63ff('0x4')](_0x63ff('0x5'),_0x414acc);this['setDataValue'](_0x63ff('0x6'),moment()[_0x63ff('0x7')](_0x63ff('0x8')));}},'endtime':{'type':Sequelize[_0x63ff('0x3')]},'membername':{'type':Sequelize[_0x63ff('0x9')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x63ff('0x9')]},'uniqueid':{'type':Sequelize[_0x63ff('0x9')]},'calleridname':{'type':Sequelize[_0x63ff('0x9')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x63ff('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index fb4ee9c..79b8874 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 _0xcf1f=['sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','find','create','catch','update','body','destroy','describe','getQuestions','JscriptyQuestionReport','order','SessionId','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','then','error','name','index','map','JscriptySessionReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x57b48b,_0x4d3a6e){var _0x402862=function(_0x5e7968){while(--_0x5e7968){_0x57b48b['push'](_0x57b48b['shift']());}};_0x402862(++_0x4d3a6e);}(_0xcf1f,0x1a8));var _0xfcf1=function(_0x556634,_0x520958){_0x556634=_0x556634-0x0;var _0x4429fd=_0xcf1f[_0x556634];return _0x4429fd;};'use strict';var emlformat=require(_0xfcf1('0x0'));var rimraf=require(_0xfcf1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfcf1('0x2'));var moment=require(_0xfcf1('0x3'));var BPromise=require(_0xfcf1('0x4'));var Mustache=require(_0xfcf1('0x5'));var util=require(_0xfcf1('0x6'));var path=require('path');var sox=require(_0xfcf1('0x7'));var csv=require(_0xfcf1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcf1('0x9'));var squel=require(_0xfcf1('0xa'));var crypto=require(_0xfcf1('0xb'));var jsforce=require(_0xfcf1('0xc'));var deskjs=require(_0xfcf1('0xd'));var toCsv=require(_0xfcf1('0x8'));var querystring=require('querystring');var Papa=require(_0xfcf1('0xe'));var Redis=require(_0xfcf1('0xf'));var authService=require(_0xfcf1('0x10'));var qs=require(_0xfcf1('0x11'));var as=require(_0xfcf1('0x12'));var hardwareService=require(_0xfcf1('0x13'));var logger=require(_0xfcf1('0x14'))(_0xfcf1('0x15'));var utils=require(_0xfcf1('0x16'));var config=require(_0xfcf1('0x17'));var licenseUtil=require(_0xfcf1('0x18'));var db=require(_0xfcf1('0x19'))['db'];function respondWithStatusCode(_0x2f3458,_0x463353){_0x463353=_0x463353||0xcc;return function(_0x284ccb){if(_0x284ccb){return _0x2f3458[_0xfcf1('0x1a')](_0x463353);}return _0x2f3458[_0xfcf1('0x1b')](_0x463353)[_0xfcf1('0x1c')]();};}function respondWithResult(_0xa17427,_0x72db28){_0x72db28=_0x72db28||0xc8;return function(_0x14d281){if(_0x14d281){return _0xa17427[_0xfcf1('0x1b')](_0x72db28)[_0xfcf1('0x1d')](_0x14d281);}};}function respondWithFilteredResult(_0x501b8f,_0x141bd3){return function(_0x11b2f1){if(_0x11b2f1){var _0x21bb05=typeof _0x141bd3[_0xfcf1('0x1e')]==='undefined'&&typeof _0x141bd3['limit']==='undefined';var _0x5cf18c=_0x11b2f1[_0xfcf1('0x1f')];var _0x48ec72=_0x21bb05?0x0:_0x141bd3[_0xfcf1('0x1e')];var _0x383723=_0x21bb05?_0x11b2f1['count']:_0x141bd3[_0xfcf1('0x1e')]+_0x141bd3[_0xfcf1('0x20')];var _0x3d0033;if(_0x383723>=_0x5cf18c){_0x383723=_0x5cf18c;_0x3d0033=0xc8;}else{_0x3d0033=0xce;}_0x501b8f[_0xfcf1('0x1b')](_0x3d0033);return _0x501b8f[_0xfcf1('0x21')](_0xfcf1('0x22'),_0x48ec72+'-'+_0x383723+'/'+_0x5cf18c)[_0xfcf1('0x1d')](_0x11b2f1);}return null;};}function patchUpdates(_0x37f093){return function(_0x5cbeb4){try{jsonpatch[_0xfcf1('0x23')](_0x5cbeb4,_0x37f093,!![]);}catch(_0x1cdc26){return BPromise[_0xfcf1('0x24')](_0x1cdc26);}return _0x5cbeb4[_0xfcf1('0x25')]();};}function saveUpdates(_0x29c850,_0x55b1cf){return function(_0x295f74){if(_0x295f74){return _0x295f74['update'](_0x29c850)['then'](function(_0x3b4c2a){return _0x3b4c2a;});}return null;};}function removeEntity(_0x7d37d3,_0x5b42eb){return function(_0x103d89){if(_0x103d89){return _0x103d89['destroy']()[_0xfcf1('0x26')](function(){_0x7d37d3[_0xfcf1('0x1b')](0xcc)[_0xfcf1('0x1c')]();});}};}function handleEntityNotFound(_0xc6c3bc,_0x2e66ca){return function(_0x3993ac){if(!_0x3993ac){_0xc6c3bc[_0xfcf1('0x1a')](0x194);}return _0x3993ac;};}function handleError(_0x4036bc,_0x768ddc){_0x768ddc=_0x768ddc||0x1f4;return function(_0x1a1449){logger[_0xfcf1('0x27')](_0x1a1449['stack']);if(_0x1a1449[_0xfcf1('0x28')]){delete _0x1a1449[_0xfcf1('0x28')];}_0x4036bc['status'](_0x768ddc)['send'](_0x1a1449);};}exports[_0xfcf1('0x29')]=function(_0x4cc80b,_0x47b24b){var _0x17917b={},_0x4b29bb={},_0x5b111f={'count':0x0,'rows':[]};var _0x256659=_[_0xfcf1('0x2a')](db[_0xfcf1('0x2b')]['rawAttributes'],function(_0x19fc38){return{'name':_0x19fc38[_0xfcf1('0x2c')],'type':_0x19fc38['type'][_0xfcf1('0x2d')]};});_0x4b29bb[_0xfcf1('0x2e')]=_[_0xfcf1('0x2a')](_0x256659,'name');_0x4b29bb[_0xfcf1('0x2f')]=_[_0xfcf1('0x30')](_0x4cc80b[_0xfcf1('0x2f')]);_0x4b29bb[_0xfcf1('0x31')]=_[_0xfcf1('0x32')](_0x4b29bb[_0xfcf1('0x2e')],_0x4b29bb[_0xfcf1('0x2f')]);_0x17917b['attributes']=_[_0xfcf1('0x32')](_0x4b29bb[_0xfcf1('0x2e')],qs[_0xfcf1('0x33')](_0x4cc80b['query'][_0xfcf1('0x33')]));_0x17917b[_0xfcf1('0x34')]=_0x17917b['attributes'][_0xfcf1('0x35')]?_0x17917b[_0xfcf1('0x34')]:_0x4b29bb['model'];if(!_0x4cc80b[_0xfcf1('0x2f')][_0xfcf1('0x36')](_0xfcf1('0x37'))){_0x17917b[_0xfcf1('0x20')]=qs['limit'](_0x4cc80b['query'][_0xfcf1('0x20')]);_0x17917b[_0xfcf1('0x1e')]=qs['offset'](_0x4cc80b[_0xfcf1('0x2f')][_0xfcf1('0x1e')]);}_0x17917b['order']=qs[_0xfcf1('0x38')](_0x4cc80b[_0xfcf1('0x2f')][_0xfcf1('0x38')]);_0x17917b[_0xfcf1('0x39')]=qs[_0xfcf1('0x31')](_[_0xfcf1('0x3a')](_0x4cc80b[_0xfcf1('0x2f')],_0x4b29bb['filters']),_0x256659);if(_0x4cc80b[_0xfcf1('0x2f')][_0xfcf1('0x3b')]){_0x17917b[_0xfcf1('0x39')]=_[_0xfcf1('0x3c')](_0x17917b[_0xfcf1('0x39')],{'$or':_[_0xfcf1('0x2a')](_0x256659,function(_0xfb5d6d){if(_0xfb5d6d[_0xfcf1('0x3d')]!==_0xfcf1('0x3e')){var _0x68e671={};_0x68e671[_0xfb5d6d[_0xfcf1('0x28')]]={'$like':'%'+_0x4cc80b[_0xfcf1('0x2f')][_0xfcf1('0x3b')]+'%'};return _0x68e671;}})});}_0x17917b=_[_0xfcf1('0x3c')]({},_0x17917b,_0x4cc80b[_0xfcf1('0x3f')]);var _0x17c6d1={'where':_0x17917b[_0xfcf1('0x39')]};return db[_0xfcf1('0x2b')][_0xfcf1('0x1f')](_0x17c6d1)[_0xfcf1('0x26')](function(_0x32aab8){_0x5b111f[_0xfcf1('0x1f')]=_0x32aab8;if(_0x4cc80b['query'][_0xfcf1('0x40')]){_0x17917b[_0xfcf1('0x41')]=[{'all':!![]}];}return db[_0xfcf1('0x2b')]['findAll'](_0x17917b);})['then'](function(_0x1b2444){_0x5b111f[_0xfcf1('0x42')]=_0x1b2444;return _0x5b111f;})[_0xfcf1('0x26')](respondWithFilteredResult(_0x47b24b,_0x17917b))['catch'](handleError(_0x47b24b,null));};exports['show']=function(_0x929155,_0x46a356){var _0x139369={'raw':!![],'where':{'id':_0x929155[_0xfcf1('0x43')]['id']}},_0xe0fd25={};_0xe0fd25['model']=_[_0xfcf1('0x30')](db[_0xfcf1('0x2b')][_0xfcf1('0x44')]);_0xe0fd25[_0xfcf1('0x2f')]=_['keys'](_0x929155[_0xfcf1('0x2f')]);_0xe0fd25['filters']=_['intersection'](_0xe0fd25[_0xfcf1('0x2e')],_0xe0fd25[_0xfcf1('0x2f')]);_0x139369[_0xfcf1('0x34')]=_[_0xfcf1('0x32')](_0xe0fd25['model'],qs['fields'](_0x929155[_0xfcf1('0x2f')][_0xfcf1('0x33')]));_0x139369[_0xfcf1('0x34')]=_0x139369[_0xfcf1('0x34')]['length']?_0x139369[_0xfcf1('0x34')]:_0xe0fd25[_0xfcf1('0x2e')];if(_0x929155[_0xfcf1('0x2f')]['includeAll']){_0x139369[_0xfcf1('0x41')]=[{'all':!![]}];}_0x139369=_[_0xfcf1('0x3c')]({},_0x139369,_0x929155['options']);return db[_0xfcf1('0x2b')][_0xfcf1('0x45')](_0x139369)[_0xfcf1('0x26')](handleEntityNotFound(_0x46a356,null))[_0xfcf1('0x26')](respondWithResult(_0x46a356,null))['catch'](handleError(_0x46a356,null));};exports[_0xfcf1('0x46')]=function(_0x5b1f4f,_0xfb3953){return db['JscriptySessionReport']['create'](_0x5b1f4f['body'],{})[_0xfcf1('0x26')](respondWithResult(_0xfb3953,0xc9))[_0xfcf1('0x47')](handleError(_0xfb3953,null));};exports[_0xfcf1('0x48')]=function(_0x1268e0,_0xbbbad9){if(_0x1268e0['body']['id']){delete _0x1268e0[_0xfcf1('0x49')]['id'];}return db[_0xfcf1('0x2b')]['find']({'where':{'id':_0x1268e0[_0xfcf1('0x43')]['id']}})[_0xfcf1('0x26')](handleEntityNotFound(_0xbbbad9,null))[_0xfcf1('0x26')](saveUpdates(_0x1268e0[_0xfcf1('0x49')],null))[_0xfcf1('0x26')](respondWithResult(_0xbbbad9,null))['catch'](handleError(_0xbbbad9,null));};exports[_0xfcf1('0x4a')]=function(_0x694904,_0x27e514){return db[_0xfcf1('0x2b')]['find']({'where':{'id':_0x694904[_0xfcf1('0x43')]['id']}})[_0xfcf1('0x26')](handleEntityNotFound(_0x27e514,null))['then'](removeEntity(_0x27e514,null))['catch'](handleError(_0x27e514,null));};exports[_0xfcf1('0x4b')]=function(_0x368695,_0x3af179){return db[_0xfcf1('0x2b')][_0xfcf1('0x4b')]()['then'](respondWithResult(_0x3af179,null))['catch'](handleError(_0x3af179,null));};exports[_0xfcf1('0x4c')]=function(_0x366c97,_0x2842be,_0x24228d){var _0x4bcc99={'raw':!![],'where':{}};var _0xd45959={};var _0x15f20c={'count':0x0,'rows':[]};return db[_0xfcf1('0x2b')]['findOne']({'where':{'id':_0x366c97['params']['id']}})[_0xfcf1('0x26')](handleEntityNotFound(_0x2842be,null))[_0xfcf1('0x26')](function(_0x401526){if(_0x401526){_0xd45959['model']=_[_0xfcf1('0x30')](db[_0xfcf1('0x4d')][_0xfcf1('0x44')]);_0xd45959[_0xfcf1('0x2f')]=_[_0xfcf1('0x30')](_0x366c97[_0xfcf1('0x2f')]);_0xd45959[_0xfcf1('0x31')]=_[_0xfcf1('0x32')](_0xd45959['model'],_0xd45959[_0xfcf1('0x2f')]);_0x4bcc99[_0xfcf1('0x34')]=_[_0xfcf1('0x32')](_0xd45959['model'],qs[_0xfcf1('0x33')](_0x366c97[_0xfcf1('0x2f')]['fields']));_0x4bcc99['attributes']=_0x4bcc99['attributes'][_0xfcf1('0x35')]?_0x4bcc99[_0xfcf1('0x34')]:_0xd45959[_0xfcf1('0x2e')];if(!_0x366c97[_0xfcf1('0x2f')][_0xfcf1('0x36')](_0xfcf1('0x37'))){_0x4bcc99['limit']=qs[_0xfcf1('0x20')](_0x366c97[_0xfcf1('0x2f')]['limit']);_0x4bcc99[_0xfcf1('0x1e')]=qs[_0xfcf1('0x1e')](_0x366c97['query'][_0xfcf1('0x1e')]);}_0x4bcc99[_0xfcf1('0x4e')]=qs['sort'](_0x366c97[_0xfcf1('0x2f')][_0xfcf1('0x38')]);_0x4bcc99['where']=qs['filters'](_['pick'](_0x366c97[_0xfcf1('0x2f')],_0xd45959['filters']));_0x4bcc99[_0xfcf1('0x39')][_0xfcf1('0x4f')]=_0x401526['id'];if(_0x366c97[_0xfcf1('0x2f')][_0xfcf1('0x3b')]){_0x4bcc99[_0xfcf1('0x39')]=_['merge'](_0x4bcc99[_0xfcf1('0x39')],{'$or':_[_0xfcf1('0x2a')](_0x4bcc99[_0xfcf1('0x34')],function(_0x12c1ff){var _0x4f57c={};_0x4f57c[_0x12c1ff]={'$like':'%'+_0x366c97[_0xfcf1('0x2f')]['filter']+'%'};return _0x4f57c;})});}_0x4bcc99=_[_0xfcf1('0x3c')]({},_0x4bcc99,_0x366c97[_0xfcf1('0x3f')]);return db[_0xfcf1('0x4d')][_0xfcf1('0x1f')]({'where':_0x4bcc99[_0xfcf1('0x39')]})['then'](function(_0x16640a){_0x15f20c[_0xfcf1('0x1f')]=_0x16640a;if(_0x366c97[_0xfcf1('0x2f')][_0xfcf1('0x40')]){_0x4bcc99[_0xfcf1('0x41')]=[{'all':!![]}];}return db[_0xfcf1('0x4d')]['findAll'](_0x4bcc99);})[_0xfcf1('0x26')](function(_0x588839){_0x15f20c[_0xfcf1('0x42')]=_0x588839;return _0x15f20c;});}})[_0xfcf1('0x26')](respondWithFilteredResult(_0x2842be,_0x4bcc99))['catch'](handleError(_0x2842be,null));}; \ No newline at end of file +var _0x3192=['json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','JscriptySessionReport','includeAll','rows','catch','show','length','include','find','create','body','update','params','destroy','describe','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x5a3f92,_0x23e7df){var _0x467063=function(_0x387be4){while(--_0x387be4){_0x5a3f92['push'](_0x5a3f92['shift']());}};_0x467063(++_0x23e7df);}(_0x3192,0x83));var _0x2319=function(_0x396c50,_0x27c9e4){_0x396c50=_0x396c50-0x0;var _0x266422=_0x3192[_0x396c50];return _0x266422;};'use strict';var emlformat=require(_0x2319('0x0'));var rimraf=require(_0x2319('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2319('0x2'));var rp=require(_0x2319('0x3'));var moment=require(_0x2319('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2319('0x5'));var sox=require(_0x2319('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2319('0x7'));var _=require('lodash');var squel=require(_0x2319('0x8'));var crypto=require('crypto');var jsforce=require(_0x2319('0x9'));var deskjs=require(_0x2319('0xa'));var toCsv=require(_0x2319('0xb'));var querystring=require(_0x2319('0xc'));var Papa=require(_0x2319('0xd'));var Redis=require(_0x2319('0xe'));var authService=require(_0x2319('0xf'));var qs=require(_0x2319('0x10'));var as=require(_0x2319('0x11'));var hardwareService=require(_0x2319('0x12'));var logger=require(_0x2319('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x2319('0x14'));var licenseUtil=require(_0x2319('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20301a,_0x1cd5df){_0x1cd5df=_0x1cd5df||0xcc;return function(_0x40bdaa){if(_0x40bdaa){return _0x20301a[_0x2319('0x16')](_0x1cd5df);}return _0x20301a[_0x2319('0x17')](_0x1cd5df)[_0x2319('0x18')]();};}function respondWithResult(_0x2af087,_0x5921ad){_0x5921ad=_0x5921ad||0xc8;return function(_0x3f8dc8){if(_0x3f8dc8){return _0x2af087['status'](_0x5921ad)[_0x2319('0x19')](_0x3f8dc8);}};}function respondWithFilteredResult(_0x30a1b5,_0x3ab639){return function(_0x195f8d){if(_0x195f8d){var _0x5a6bfd=typeof _0x3ab639['offset']===_0x2319('0x1a')&&typeof _0x3ab639[_0x2319('0x1b')]===_0x2319('0x1a');var _0x206361=_0x195f8d[_0x2319('0x1c')];var _0x5f0764=_0x5a6bfd?0x0:_0x3ab639[_0x2319('0x1d')];var _0x61bac0=_0x5a6bfd?_0x195f8d['count']:_0x3ab639[_0x2319('0x1d')]+_0x3ab639[_0x2319('0x1b')];var _0x3d9ca6;if(_0x61bac0>=_0x206361){_0x61bac0=_0x206361;_0x3d9ca6=0xc8;}else{_0x3d9ca6=0xce;}_0x30a1b5[_0x2319('0x17')](_0x3d9ca6);return _0x30a1b5['set'](_0x2319('0x1e'),_0x5f0764+'-'+_0x61bac0+'/'+_0x206361)[_0x2319('0x19')](_0x195f8d);}return null;};}function patchUpdates(_0x4edec0){return function(_0x4f1fa0){try{jsonpatch[_0x2319('0x1f')](_0x4f1fa0,_0x4edec0,!![]);}catch(_0x4e5ac0){return BPromise[_0x2319('0x20')](_0x4e5ac0);}return _0x4f1fa0[_0x2319('0x21')]();};}function saveUpdates(_0x32f151,_0x44ee31){return function(_0x474200){if(_0x474200){return _0x474200['update'](_0x32f151)['then'](function(_0x3dc116){return _0x3dc116;});}return null;};}function removeEntity(_0x2d6d43,_0x1c667b){return function(_0x142b50){if(_0x142b50){return _0x142b50['destroy']()[_0x2319('0x22')](function(){_0x2d6d43['status'](0xcc)[_0x2319('0x18')]();});}};}function handleEntityNotFound(_0x4ee0b5,_0x1a90d2){return function(_0x47d1b2){if(!_0x47d1b2){_0x4ee0b5[_0x2319('0x16')](0x194);}return _0x47d1b2;};}function handleError(_0x47bc86,_0x4a79ee){_0x4a79ee=_0x4a79ee||0x1f4;return function(_0x402dac){logger[_0x2319('0x23')](_0x402dac['stack']);if(_0x402dac['name']){delete _0x402dac[_0x2319('0x24')];}_0x47bc86['status'](_0x4a79ee)[_0x2319('0x25')](_0x402dac);};}exports[_0x2319('0x26')]=function(_0x401823,_0x534be6){var _0x5f1303={},_0x2de1b4={},_0x1ed816={'count':0x0,'rows':[]};var _0x2119ac=_[_0x2319('0x27')](db['JscriptySessionReport'][_0x2319('0x28')],function(_0xb54b78){return{'name':_0xb54b78[_0x2319('0x29')],'type':_0xb54b78[_0x2319('0x2a')]['key']};});_0x2de1b4[_0x2319('0x2b')]=_['map'](_0x2119ac,_0x2319('0x24'));_0x2de1b4['query']=_[_0x2319('0x2c')](_0x401823['query']);_0x2de1b4[_0x2319('0x2d')]=_[_0x2319('0x2e')](_0x2de1b4['model'],_0x2de1b4[_0x2319('0x2f')]);_0x5f1303[_0x2319('0x30')]=_[_0x2319('0x2e')](_0x2de1b4[_0x2319('0x2b')],qs[_0x2319('0x31')](_0x401823[_0x2319('0x2f')]['fields']));_0x5f1303[_0x2319('0x30')]=_0x5f1303[_0x2319('0x30')]['length']?_0x5f1303['attributes']:_0x2de1b4[_0x2319('0x2b')];if(!_0x401823[_0x2319('0x2f')]['hasOwnProperty'](_0x2319('0x32'))){_0x5f1303[_0x2319('0x1b')]=qs[_0x2319('0x1b')](_0x401823[_0x2319('0x2f')][_0x2319('0x1b')]);_0x5f1303[_0x2319('0x1d')]=qs[_0x2319('0x1d')](_0x401823[_0x2319('0x2f')][_0x2319('0x1d')]);}_0x5f1303[_0x2319('0x33')]=qs['sort'](_0x401823[_0x2319('0x2f')][_0x2319('0x34')]);_0x5f1303['where']=qs[_0x2319('0x2d')](_[_0x2319('0x35')](_0x401823['query'],_0x2de1b4['filters']),_0x2119ac);if(_0x401823['query'][_0x2319('0x36')]){_0x5f1303[_0x2319('0x37')]=_[_0x2319('0x38')](_0x5f1303[_0x2319('0x37')],{'$or':_[_0x2319('0x27')](_0x2119ac,function(_0x5d5e60){if(_0x5d5e60[_0x2319('0x2a')]!==_0x2319('0x39')){var _0x285bdf={};_0x285bdf[_0x5d5e60[_0x2319('0x24')]]={'$like':'%'+_0x401823[_0x2319('0x2f')][_0x2319('0x36')]+'%'};return _0x285bdf;}})});}_0x5f1303=_[_0x2319('0x38')]({},_0x5f1303,_0x401823[_0x2319('0x3a')]);var _0x34a517={'where':_0x5f1303[_0x2319('0x37')]};return db[_0x2319('0x3b')][_0x2319('0x1c')](_0x34a517)[_0x2319('0x22')](function(_0xcd94d4){_0x1ed816[_0x2319('0x1c')]=_0xcd94d4;if(_0x401823[_0x2319('0x2f')][_0x2319('0x3c')]){_0x5f1303['include']=[{'all':!![]}];}return db[_0x2319('0x3b')]['findAll'](_0x5f1303);})['then'](function(_0x18ab7a){_0x1ed816[_0x2319('0x3d')]=_0x18ab7a;return _0x1ed816;})[_0x2319('0x22')](respondWithFilteredResult(_0x534be6,_0x5f1303))[_0x2319('0x3e')](handleError(_0x534be6,null));};exports[_0x2319('0x3f')]=function(_0x3187b2,_0x239d1a){var _0x46bc35={'raw':!![],'where':{'id':_0x3187b2['params']['id']}},_0x1fb5da={};_0x1fb5da[_0x2319('0x2b')]=_[_0x2319('0x2c')](db['JscriptySessionReport'][_0x2319('0x28')]);_0x1fb5da['query']=_[_0x2319('0x2c')](_0x3187b2[_0x2319('0x2f')]);_0x1fb5da[_0x2319('0x2d')]=_[_0x2319('0x2e')](_0x1fb5da[_0x2319('0x2b')],_0x1fb5da[_0x2319('0x2f')]);_0x46bc35[_0x2319('0x30')]=_[_0x2319('0x2e')](_0x1fb5da[_0x2319('0x2b')],qs[_0x2319('0x31')](_0x3187b2[_0x2319('0x2f')][_0x2319('0x31')]));_0x46bc35['attributes']=_0x46bc35[_0x2319('0x30')][_0x2319('0x40')]?_0x46bc35['attributes']:_0x1fb5da[_0x2319('0x2b')];if(_0x3187b2[_0x2319('0x2f')][_0x2319('0x3c')]){_0x46bc35[_0x2319('0x41')]=[{'all':!![]}];}_0x46bc35=_['merge']({},_0x46bc35,_0x3187b2[_0x2319('0x3a')]);return db[_0x2319('0x3b')][_0x2319('0x42')](_0x46bc35)[_0x2319('0x22')](handleEntityNotFound(_0x239d1a,null))[_0x2319('0x22')](respondWithResult(_0x239d1a,null))[_0x2319('0x3e')](handleError(_0x239d1a,null));};exports[_0x2319('0x43')]=function(_0x18f296,_0x4b565c){return db[_0x2319('0x3b')]['create'](_0x18f296[_0x2319('0x44')],{})[_0x2319('0x22')](respondWithResult(_0x4b565c,0xc9))[_0x2319('0x3e')](handleError(_0x4b565c,null));};exports[_0x2319('0x45')]=function(_0x5b12fd,_0x489480){if(_0x5b12fd[_0x2319('0x44')]['id']){delete _0x5b12fd[_0x2319('0x44')]['id'];}return db[_0x2319('0x3b')][_0x2319('0x42')]({'where':{'id':_0x5b12fd[_0x2319('0x46')]['id']}})['then'](handleEntityNotFound(_0x489480,null))['then'](saveUpdates(_0x5b12fd['body'],null))[_0x2319('0x22')](respondWithResult(_0x489480,null))[_0x2319('0x3e')](handleError(_0x489480,null));};exports[_0x2319('0x47')]=function(_0x279cf4,_0x220949){return db[_0x2319('0x3b')][_0x2319('0x42')]({'where':{'id':_0x279cf4[_0x2319('0x46')]['id']}})[_0x2319('0x22')](handleEntityNotFound(_0x220949,null))[_0x2319('0x22')](removeEntity(_0x220949,null))[_0x2319('0x3e')](handleError(_0x220949,null));};exports[_0x2319('0x48')]=function(_0x53bb59,_0x55656e){return db[_0x2319('0x3b')][_0x2319('0x48')]()[_0x2319('0x22')](respondWithResult(_0x55656e,null))[_0x2319('0x3e')](handleError(_0x55656e,null));};exports['getQuestions']=function(_0x2acba3,_0x18678b,_0x10f4bf){var _0x57c18d={'raw':!![],'where':{}};var _0x52747f={};var _0x1914fa={'count':0x0,'rows':[]};return db[_0x2319('0x3b')][_0x2319('0x49')]({'where':{'id':_0x2acba3[_0x2319('0x46')]['id']}})['then'](handleEntityNotFound(_0x18678b,null))[_0x2319('0x22')](function(_0x36266a){if(_0x36266a){_0x52747f[_0x2319('0x2b')]=_[_0x2319('0x2c')](db[_0x2319('0x4a')][_0x2319('0x28')]);_0x52747f['query']=_[_0x2319('0x2c')](_0x2acba3[_0x2319('0x2f')]);_0x52747f[_0x2319('0x2d')]=_[_0x2319('0x2e')](_0x52747f['model'],_0x52747f[_0x2319('0x2f')]);_0x57c18d[_0x2319('0x30')]=_['intersection'](_0x52747f['model'],qs[_0x2319('0x31')](_0x2acba3[_0x2319('0x2f')][_0x2319('0x31')]));_0x57c18d[_0x2319('0x30')]=_0x57c18d['attributes']['length']?_0x57c18d[_0x2319('0x30')]:_0x52747f[_0x2319('0x2b')];if(!_0x2acba3[_0x2319('0x2f')][_0x2319('0x4b')]('nolimit')){_0x57c18d['limit']=qs[_0x2319('0x1b')](_0x2acba3[_0x2319('0x2f')][_0x2319('0x1b')]);_0x57c18d['offset']=qs['offset'](_0x2acba3['query'][_0x2319('0x1d')]);}_0x57c18d[_0x2319('0x33')]=qs[_0x2319('0x34')](_0x2acba3[_0x2319('0x2f')][_0x2319('0x34')]);_0x57c18d[_0x2319('0x37')]=qs[_0x2319('0x2d')](_['pick'](_0x2acba3[_0x2319('0x2f')],_0x52747f[_0x2319('0x2d')]));_0x57c18d[_0x2319('0x37')][_0x2319('0x4c')]=_0x36266a['id'];if(_0x2acba3[_0x2319('0x2f')][_0x2319('0x36')]){_0x57c18d[_0x2319('0x37')]=_[_0x2319('0x38')](_0x57c18d[_0x2319('0x37')],{'$or':_[_0x2319('0x27')](_0x57c18d['attributes'],function(_0x3f9ed2){var _0x57192b={};_0x57192b[_0x3f9ed2]={'$like':'%'+_0x2acba3[_0x2319('0x2f')][_0x2319('0x36')]+'%'};return _0x57192b;})});}_0x57c18d=_[_0x2319('0x38')]({},_0x57c18d,_0x2acba3[_0x2319('0x3a')]);return db[_0x2319('0x4a')][_0x2319('0x1c')]({'where':_0x57c18d[_0x2319('0x37')]})[_0x2319('0x22')](function(_0x1f4bca){_0x1914fa[_0x2319('0x1c')]=_0x1f4bca;if(_0x2acba3['query'][_0x2319('0x3c')]){_0x57c18d['include']=[{'all':!![]}];}return db[_0x2319('0x4a')][_0x2319('0x4d')](_0x57c18d);})[_0x2319('0x22')](function(_0x5aa923){_0x1914fa[_0x2319('0x3d')]=_0x5aa923;return _0x1914fa;});}})[_0x2319('0x22')](respondWithFilteredResult(_0x18678b,_0x57c18d))[_0x2319('0x3e')](handleError(_0x18678b,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 432fb43..045d8d4 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 _0x82c4=['JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptySessionReport.attributes','define'];(function(_0xbafaf9,_0x14aa72){var _0x435c28=function(_0x3b8065){while(--_0x3b8065){_0xbafaf9['push'](_0xbafaf9['shift']());}};_0x435c28(++_0x14aa72);}(_0x82c4,0x1ca));var _0x482c=function(_0x2e1c86,_0x281ecc){_0x2e1c86=_0x2e1c86-0x0;var _0x584f13=_0x82c4[_0x2e1c86];return _0x584f13;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));module['exports']=function(_0x477cf4,_0x5d7c76){return _0x477cf4[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':_0x482c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f4d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x42825b,_0x27e45e){_0x42825b=_0x42825b-0x0;var _0x775713=_0x0f4d[_0x42825b];return _0x775713;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd0f4('0x0'));var moment=require('moment');var BPromise=require(_0xd0f4('0x1'));var rp=require(_0xd0f4('0x2'));var fs=require('fs');var path=require(_0xd0f4('0x3'));var rimraf=require(_0xd0f4('0x4'));var config=require(_0xd0f4('0x5'));var attributes=require(_0xd0f4('0x6'));module[_0xd0f4('0x7')]=function(_0x1d9a9d,_0x531f85){return _0x1d9a9d[_0xd0f4('0x8')](_0xd0f4('0x9'),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 7cb55f8..a601f59 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 _0xa6b0=['client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x432a2d,_0x12f1bb){var _0x1908b0=function(_0x4e2b3d){while(--_0x4e2b3d){_0x432a2d['push'](_0x432a2d['shift']());}};_0x1908b0(++_0x12f1bb);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x1708fd,_0x55a843){_0x1708fd=_0x1708fd-0x0;var _0x3c7644=_0xa6b0[_0x1708fd];return _0x3c7644;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a6b('0x2'));var fs=require('fs');var Redis=require(_0x0a6b('0x3'));var db=require(_0x0a6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a6b('0x5'))(_0x0a6b('0x6'));var config=require(_0x0a6b('0x7'));var jayson=require(_0x0a6b('0x8'));var client=jayson[_0x0a6b('0x9')][_0x0a6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b5fb5,_0xa908dd,_0x26f761){return new BPromise(function(_0x340a33,_0x8e89f){return client[_0x0a6b('0xb')](_0x1b5fb5,_0x26f761)['then'](function(_0x493948){logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));logger[_0x0a6b('0xf')](_0x0a6b('0x10'),_0xa908dd,_0x0a6b('0xe'),JSON[_0x0a6b('0x11')](_0x493948));if(_0x493948[_0x0a6b('0x12')]){if(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x13')]===0x1f4){logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x8e89f(_0x493948['error']['message']);}logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x340a33(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);}else{logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));_0x340a33(_0x493948[_0x0a6b('0x15')]['message']);}})[_0x0a6b('0x16')](function(_0x1538f4){logger['error'](_0x0a6b('0xd'),_0xa908dd,_0x1538f4);_0x8e89f(_0x1538f4);});});} \ No newline at end of file +var _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x75ce5b,_0x3b582f){var _0x22195e=function(_0x166668){while(--_0x166668){_0x75ce5b['push'](_0x75ce5b['shift']());}};_0x22195e(++_0x3b582f);}(_0x687b,0x14a));var _0xb687=function(_0x5abb9c,_0x32f2eb){_0x5abb9c=_0x5abb9c-0x0;var _0x33916e=_0x687b[_0x5abb9c];return _0x33916e;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 5abf39e..bd664aa 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 _0x137a=['./license.controller','get','index','put','isAuthenticated','update','/download_log_file','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1064e2,_0x4a15f){var _0x248bbb=function(_0x272084){while(--_0x272084){_0x1064e2['push'](_0x1064e2['shift']());}};_0x248bbb(++_0x4a15f);}(_0x137a,0x8f));var _0xa137=function(_0x3e09cc,_0xdf5f6a){_0x3e09cc=_0x3e09cc-0x0;var _0x16c80a=_0x137a[_0x3e09cc];return _0x16c80a;};'use strict';var multer=require('multer');var util=require(_0xa137('0x0'));var path=require(_0xa137('0x1'));var timeout=require(_0xa137('0x2'));var express=require(_0xa137('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa137('0x4'));var interaction=require(_0xa137('0x5'));var config=require(_0xa137('0x6'));var controller=require(_0xa137('0x7'));router[_0xa137('0x8')]('/',controller[_0xa137('0x9')]);router[_0xa137('0xa')]('/:id',auth[_0xa137('0xb')](),controller[_0xa137('0xc')]);router[_0xa137('0x8')](_0xa137('0xd'),auth[_0xa137('0xb')](),controller['downloadLogFile']);module[_0xa137('0xe')]=router; \ No newline at end of file +var _0x8364=['/download_log_file','downloadLogFile','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','put','update','get'];(function(_0x8d5ffb,_0x3327dd){var _0x15ed08=function(_0x56c070){while(--_0x56c070){_0x8d5ffb['push'](_0x8d5ffb['shift']());}};_0x15ed08(++_0x3327dd);}(_0x8364,0x111));var _0x4836=function(_0x472072,_0x5add18){_0x472072=_0x472072-0x0;var _0x38ca35=_0x8364[_0x472072];return _0x38ca35;};'use strict';var multer=require(_0x4836('0x0'));var util=require(_0x4836('0x1'));var path=require(_0x4836('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4836('0x3')]();var fs_extra=require(_0x4836('0x4'));var auth=require(_0x4836('0x5'));var interaction=require(_0x4836('0x6'));var config=require(_0x4836('0x7'));var controller=require(_0x4836('0x8'));router['get']('/',controller['index']);router[_0x4836('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4836('0xa')]);router[_0x4836('0xb')](_0x4836('0xc'),auth['isAuthenticated'](),controller[_0x4836('0xd')]);module[_0x4836('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 0c317d9..2ba5137 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 _0x6ff2=['exports','TEXT','STRING'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6ff2,0x114));var _0x26ff=function(_0x4d3e4b,_0x37abc1){_0x4d3e4b=_0x4d3e4b-0x0;var _0x125fbe=_0x6ff2[_0x4d3e4b];return _0x125fbe;};'use strict';var Sequelize=require('sequelize');module[_0x26ff('0x0')]={'license':{'type':Sequelize[_0x26ff('0x1')]},'data1':{'type':Sequelize[_0x26ff('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9a2e=['sequelize','TEXT','STRING','INTEGER'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x9a2e,0xd4));var _0xe9a2=function(_0x2e90a2,_0x1c4e23){_0x2e90a2=_0x2e90a2-0x0;var _0xe03892=_0x9a2e[_0x2e90a2];return _0xe03892;};'use strict';var Sequelize=require(_0xe9a2('0x0'));module['exports']={'license':{'type':Sequelize[_0xe9a2('0x1')]},'data1':{'type':Sequelize[_0xe9a2('0x2')]},'data2':{'type':Sequelize[_0xe9a2('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xe9a2('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 558e7d0..b000f51 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 _0xc4d2=['limit','set','reject','update','then','destroy','stack','name','send','index','model','keys','License','query','filters','intersection','attributes','fields','length','options','getLicense','catch','body','find','params','get','checkLicense','demo','downloadLogFile','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count'];(function(_0x336bbe,_0x27da18){var _0x3eb536=function(_0x1c3a93){while(--_0x1c3a93){_0x336bbe['push'](_0x336bbe['shift']());}};_0x3eb536(++_0x27da18);}(_0xc4d2,0xf4));var _0x2c4d=function(_0x4fcf0f,_0x1208a2){_0x4fcf0f=_0x4fcf0f-0x0;var _0x671071=_0xc4d2[_0x4fcf0f];return _0x671071;};'use strict';var emlformat=require(_0x2c4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c4d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c4d('0x2'));var moment=require(_0x2c4d('0x3'));var BPromise=require(_0x2c4d('0x4'));var Mustache=require(_0x2c4d('0x5'));var util=require(_0x2c4d('0x6'));var path=require('path');var sox=require(_0x2c4d('0x7'));var csv=require(_0x2c4d('0x8'));var ejs=require(_0x2c4d('0x9'));var fs=require('fs');var fs_extra=require(_0x2c4d('0xa'));var _=require(_0x2c4d('0xb'));var squel=require('squel');var crypto=require(_0x2c4d('0xc'));var jsforce=require(_0x2c4d('0xd'));var deskjs=require(_0x2c4d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2c4d('0xf'));var Papa=require('papaparse');var Redis=require(_0x2c4d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2c4d('0x11'));var as=require(_0x2c4d('0x12'));var hardwareService=require(_0x2c4d('0x13'));var logger=require(_0x2c4d('0x14'))(_0x2c4d('0x15'));var utils=require(_0x2c4d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2c4d('0x17'));var db=require(_0x2c4d('0x18'))['db'];function respondWithStatusCode(_0x39a645,_0x37b715){_0x37b715=_0x37b715||0xcc;return function(_0x2695e4){if(_0x2695e4){return _0x39a645[_0x2c4d('0x19')](_0x37b715);}return _0x39a645[_0x2c4d('0x1a')](_0x37b715)[_0x2c4d('0x1b')]();};}function respondWithResult(_0x40232a,_0x5df2e1){_0x5df2e1=_0x5df2e1||0xc8;return function(_0x3afa1c){if(_0x3afa1c){return _0x40232a[_0x2c4d('0x1a')](_0x5df2e1)[_0x2c4d('0x1c')](_0x3afa1c);}};}function respondWithFilteredResult(_0x4aeb5c,_0x9c287f){return function(_0x454e47){if(_0x454e47){var _0x34c060=typeof _0x9c287f[_0x2c4d('0x1d')]===_0x2c4d('0x1e')&&typeof _0x9c287f['limit']===_0x2c4d('0x1e');var _0x21bb6c=_0x454e47[_0x2c4d('0x1f')];var _0xc14607=_0x34c060?0x0:_0x9c287f[_0x2c4d('0x1d')];var _0x3108ec=_0x34c060?_0x454e47[_0x2c4d('0x1f')]:_0x9c287f[_0x2c4d('0x1d')]+_0x9c287f[_0x2c4d('0x20')];var _0x340649;if(_0x3108ec>=_0x21bb6c){_0x3108ec=_0x21bb6c;_0x340649=0xc8;}else{_0x340649=0xce;}_0x4aeb5c[_0x2c4d('0x1a')](_0x340649);return _0x4aeb5c[_0x2c4d('0x21')]('Content-Range',_0xc14607+'-'+_0x3108ec+'/'+_0x21bb6c)[_0x2c4d('0x1c')](_0x454e47);}return null;};}function patchUpdates(_0x11d72c){return function(_0x4f798d){try{jsonpatch['apply'](_0x4f798d,_0x11d72c,!![]);}catch(_0x3fa219){return BPromise[_0x2c4d('0x22')](_0x3fa219);}return _0x4f798d['save']();};}function saveUpdates(_0x4d40cb,_0x598d29){return function(_0x20725b){if(_0x20725b){return _0x20725b[_0x2c4d('0x23')](_0x4d40cb)[_0x2c4d('0x24')](function(_0x59b764){return _0x59b764;});}return null;};}function removeEntity(_0x13dd8c,_0x33cf79){return function(_0x49e74a){if(_0x49e74a){return _0x49e74a[_0x2c4d('0x25')]()[_0x2c4d('0x24')](function(){_0x13dd8c[_0x2c4d('0x1a')](0xcc)[_0x2c4d('0x1b')]();});}};}function handleEntityNotFound(_0x51c422,_0x291323){return function(_0x548b00){if(!_0x548b00){_0x51c422['sendStatus'](0x194);}return _0x548b00;};}function handleError(_0x8f64b1,_0x34e9bd){_0x34e9bd=_0x34e9bd||0x1f4;return function(_0x177edd){logger['error'](_0x177edd[_0x2c4d('0x26')]);if(_0x177edd[_0x2c4d('0x27')]){delete _0x177edd[_0x2c4d('0x27')];}_0x8f64b1[_0x2c4d('0x1a')](_0x34e9bd)[_0x2c4d('0x28')](_0x177edd);};}var utilLicense=require('../../config/license/util');exports[_0x2c4d('0x29')]=function(_0x5c047a,_0x2c898c){var _0x16cc6a={'raw':!![],'where':{'id':0x1}},_0x3ee950={};_0x3ee950[_0x2c4d('0x2a')]=_[_0x2c4d('0x2b')](db[_0x2c4d('0x2c')]['rawAttributes']);_0x3ee950[_0x2c4d('0x2d')]=_['keys'](_0x5c047a[_0x2c4d('0x2d')]);_0x3ee950[_0x2c4d('0x2e')]=_[_0x2c4d('0x2f')](_0x3ee950[_0x2c4d('0x2a')],_0x3ee950[_0x2c4d('0x2d')]);_0x16cc6a[_0x2c4d('0x30')]=_[_0x2c4d('0x2f')](_0x3ee950[_0x2c4d('0x2a')],qs[_0x2c4d('0x31')](_0x5c047a[_0x2c4d('0x2d')]['fields']));_0x16cc6a[_0x2c4d('0x30')]=_0x16cc6a[_0x2c4d('0x30')][_0x2c4d('0x32')]?_0x16cc6a['attributes']:_0x3ee950[_0x2c4d('0x2a')];_0x16cc6a=_['merge']({},_0x16cc6a,_0x5c047a[_0x2c4d('0x33')]);return utilLicense[_0x2c4d('0x34')](_0x16cc6a)[_0x2c4d('0x24')](respondWithResult(_0x2c898c,null))[_0x2c4d('0x35')](handleError(_0x2c898c,null));};exports[_0x2c4d('0x23')]=function(_0x553b8f,_0x4d689c){if(_0x553b8f[_0x2c4d('0x36')]['id']){delete _0x553b8f[_0x2c4d('0x36')]['id'];}return db['License'][_0x2c4d('0x37')]({'where':{'id':_0x553b8f[_0x2c4d('0x38')]['id']}})['then'](handleEntityNotFound(_0x4d689c,null))[_0x2c4d('0x24')](function(_0x77839){var _0x337ed2=_0x77839[_0x2c4d('0x39')]({'plain':!![]});return utilLicense[_0x2c4d('0x3a')](_0x337ed2,_0x553b8f[_0x2c4d('0x36')]['key']);})[_0x2c4d('0x24')](function(_0x1f4d2c){if(!_0x1f4d2c[_0x2c4d('0x3b')]){return saveUpdates(_0x553b8f[_0x2c4d('0x36')],null);}return _0x1f4d2c;})[_0x2c4d('0x24')](respondWithResult(_0x4d689c,null))['catch'](handleError(_0x4d689c,null));};exports[_0x2c4d('0x3c')]=function(_0x2c52e7,_0x40796a){var _0x598844='license-info.log';var _0x55fea6=path[_0x2c4d('0x3d')](_0x2c4d('0x3e'),_0x2c4d('0x3f'),_0x2c4d('0x40'),_0x598844);_0x40796a['setHeader'](_0x2c4d('0x41'),_0x2c4d('0x42')+_0x598844);_0x40796a['set'](_0x2c4d('0x43'),_0x2c4d('0x44'));_0x40796a['download'](_0x55fea6);}; \ No newline at end of file +var _0x37e0=['catch','downloadLogFile','join','log','xcally','Content-disposition','Content-Type','text/plain','download','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','keys','rawAttributes','query','filters','intersection','model','attributes','fields','options','body','License','find','params','get','checkLicense','demo'];(function(_0x263204,_0x19286b){var _0xed3987=function(_0x282bf1){while(--_0x282bf1){_0x263204['push'](_0x263204['shift']());}};_0xed3987(++_0x19286b);}(_0x37e0,0x153));var _0x037e=function(_0x3d1ec0,_0x15f4ec){_0x3d1ec0=_0x3d1ec0-0x0;var _0x37da92=_0x37e0[_0x3d1ec0];return _0x37da92;};'use strict';var emlformat=require(_0x037e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x037e('0x1'));var jsonpatch=require(_0x037e('0x2'));var rp=require('request-promise');var moment=require(_0x037e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x037e('0x4'));var util=require('util');var path=require(_0x037e('0x5'));var sox=require(_0x037e('0x6'));var csv=require(_0x037e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x037e('0x8'));var squel=require('squel');var crypto=require(_0x037e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x037e('0xa'));var toCsv=require(_0x037e('0x7'));var querystring=require(_0x037e('0xb'));var Papa=require(_0x037e('0xc'));var Redis=require(_0x037e('0xd'));var authService=require(_0x037e('0xe'));var qs=require(_0x037e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x037e('0x10'));var logger=require(_0x037e('0x11'))(_0x037e('0x12'));var utils=require(_0x037e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x037e('0x14'));var db=require(_0x037e('0x15'))['db'];function respondWithStatusCode(_0x1aa4b3,_0x3489b4){_0x3489b4=_0x3489b4||0xcc;return function(_0x2faef9){if(_0x2faef9){return _0x1aa4b3['sendStatus'](_0x3489b4);}return _0x1aa4b3[_0x037e('0x16')](_0x3489b4)['end']();};}function respondWithResult(_0x4ea9ef,_0x21e23f){_0x21e23f=_0x21e23f||0xc8;return function(_0x2733b2){if(_0x2733b2){return _0x4ea9ef['status'](_0x21e23f)['json'](_0x2733b2);}};}function respondWithFilteredResult(_0x4a42fc,_0x2157a){return function(_0x4fe24c){if(_0x4fe24c){var _0x4b3b10=typeof _0x2157a['offset']===_0x037e('0x17')&&typeof _0x2157a[_0x037e('0x18')]===_0x037e('0x17');var _0x3a55c2=_0x4fe24c[_0x037e('0x19')];var _0xbffcd0=_0x4b3b10?0x0:_0x2157a[_0x037e('0x1a')];var _0x5c4731=_0x4b3b10?_0x4fe24c['count']:_0x2157a[_0x037e('0x1a')]+_0x2157a[_0x037e('0x18')];var _0x5c3f5c;if(_0x5c4731>=_0x3a55c2){_0x5c4731=_0x3a55c2;_0x5c3f5c=0xc8;}else{_0x5c3f5c=0xce;}_0x4a42fc[_0x037e('0x16')](_0x5c3f5c);return _0x4a42fc['set'](_0x037e('0x1b'),_0xbffcd0+'-'+_0x5c4731+'/'+_0x3a55c2)[_0x037e('0x1c')](_0x4fe24c);}return null;};}function patchUpdates(_0x35701d){return function(_0x17df46){try{jsonpatch[_0x037e('0x1d')](_0x17df46,_0x35701d,!![]);}catch(_0x351ef0){return BPromise[_0x037e('0x1e')](_0x351ef0);}return _0x17df46[_0x037e('0x1f')]();};}function saveUpdates(_0x3c6d23,_0x19bdb5){return function(_0x3767c3){if(_0x3767c3){return _0x3767c3[_0x037e('0x20')](_0x3c6d23)[_0x037e('0x21')](function(_0x384a4e){return _0x384a4e;});}return null;};}function removeEntity(_0x5dae11,_0x16de6e){return function(_0x1c3614){if(_0x1c3614){return _0x1c3614[_0x037e('0x22')]()[_0x037e('0x21')](function(){_0x5dae11[_0x037e('0x16')](0xcc)[_0x037e('0x23')]();});}};}function handleEntityNotFound(_0x199cad,_0x5efc4f){return function(_0x39c414){if(!_0x39c414){_0x199cad[_0x037e('0x24')](0x194);}return _0x39c414;};}function handleError(_0x5ba3a6,_0x2ab7cb){_0x2ab7cb=_0x2ab7cb||0x1f4;return function(_0x3bbf94){logger[_0x037e('0x25')](_0x3bbf94[_0x037e('0x26')]);if(_0x3bbf94[_0x037e('0x27')]){delete _0x3bbf94[_0x037e('0x27')];}_0x5ba3a6[_0x037e('0x16')](_0x2ab7cb)[_0x037e('0x28')](_0x3bbf94);};}var utilLicense=require(_0x037e('0x14'));exports['index']=function(_0x4dffec,_0x5d637f){var _0x470318={'raw':!![],'where':{'id':0x1}},_0x3f15f6={};_0x3f15f6['model']=_[_0x037e('0x29')](db['License'][_0x037e('0x2a')]);_0x3f15f6[_0x037e('0x2b')]=_[_0x037e('0x29')](_0x4dffec['query']);_0x3f15f6[_0x037e('0x2c')]=_[_0x037e('0x2d')](_0x3f15f6[_0x037e('0x2e')],_0x3f15f6[_0x037e('0x2b')]);_0x470318[_0x037e('0x2f')]=_[_0x037e('0x2d')](_0x3f15f6[_0x037e('0x2e')],qs['fields'](_0x4dffec['query'][_0x037e('0x30')]));_0x470318[_0x037e('0x2f')]=_0x470318[_0x037e('0x2f')]['length']?_0x470318[_0x037e('0x2f')]:_0x3f15f6[_0x037e('0x2e')];_0x470318=_['merge']({},_0x470318,_0x4dffec[_0x037e('0x31')]);return utilLicense['getLicense'](_0x470318)['then'](respondWithResult(_0x5d637f,null))['catch'](handleError(_0x5d637f,null));};exports[_0x037e('0x20')]=function(_0x57179e,_0x1ca71f){if(_0x57179e[_0x037e('0x32')]['id']){delete _0x57179e[_0x037e('0x32')]['id'];}return db[_0x037e('0x33')][_0x037e('0x34')]({'where':{'id':_0x57179e[_0x037e('0x35')]['id']}})[_0x037e('0x21')](handleEntityNotFound(_0x1ca71f,null))['then'](function(_0xfff371){var _0xda638d=_0xfff371[_0x037e('0x36')]({'plain':!![]});return utilLicense[_0x037e('0x37')](_0xda638d,_0x57179e[_0x037e('0x32')]['key']);})[_0x037e('0x21')](function(_0x531e34){if(!_0x531e34[_0x037e('0x38')]){return saveUpdates(_0x57179e[_0x037e('0x32')],null);}return _0x531e34;})[_0x037e('0x21')](respondWithResult(_0x1ca71f,null))[_0x037e('0x39')](handleError(_0x1ca71f,null));};exports[_0x037e('0x3a')]=function(_0x4c13c0,_0x3f714e){var _0x4893d7='license-info.log';var _0x24dbac=path[_0x037e('0x3b')]('/var',_0x037e('0x3c'),_0x037e('0x3d'),_0x4893d7);_0x3f714e['setHeader'](_0x037e('0x3e'),'attachment;\x20filename='+_0x4893d7);_0x3f714e['set'](_0x037e('0x3f'),_0x037e('0x40'));_0x3f714e[_0x037e('0x41')](_0x24dbac);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index d6ba4a2..8d08bf7 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 _0x5e3f=['./license.attributes','exports','define','License','license','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1b7390,_0x24ac6c){var _0x5df602=function(_0x3c32ea){while(--_0x3c32ea){_0x1b7390['push'](_0x1b7390['shift']());}};_0x5df602(++_0x24ac6c);}(_0x5e3f,0x1f3));var _0xf5e3=function(_0x417e75,_0x548352){_0x417e75=_0x417e75-0x0;var _0x14beb9=_0x5e3f[_0x417e75];return _0x14beb9;};'use strict';var _=require('lodash');var util=require(_0xf5e3('0x0'));var logger=require(_0xf5e3('0x1'))(_0xf5e3('0x2'));var moment=require(_0xf5e3('0x3'));var BPromise=require(_0xf5e3('0x4'));var rp=require(_0xf5e3('0x5'));var fs=require('fs');var path=require(_0xf5e3('0x6'));var rimraf=require(_0xf5e3('0x7'));var config=require('../../config/environment');var attributes=require(_0xf5e3('0x8'));module[_0xf5e3('0x9')]=function(_0x29ddc0,_0x2f4937){return _0x29ddc0[_0xf5e3('0xa')](_0xf5e3('0xb'),attributes,{'tableName':_0xf5e3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd31b=['rimraf','../../config/environment','./license.attributes','exports','define','license','lodash','../../config/logger','api','moment','request-promise'];(function(_0x5b6986,_0x1decfe){var _0xeeef0e=function(_0x2c0fd9){while(--_0x2c0fd9){_0x5b6986['push'](_0x5b6986['shift']());}};_0xeeef0e(++_0x1decfe);}(_0xd31b,0x1be));var _0xbd31=function(_0x294cca,_0x2d3b8a){_0x294cca=_0x294cca-0x0;var _0x53054b=_0xd31b[_0x294cca];return _0x53054b;};'use strict';var _=require(_0xbd31('0x0'));var util=require('util');var logger=require(_0xbd31('0x1'))(_0xbd31('0x2'));var moment=require(_0xbd31('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd31('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd31('0x5'));var config=require(_0xbd31('0x6'));var attributes=require(_0xbd31('0x7'));module[_0xbd31('0x8')]=function(_0x4ceb9c,_0x3e357c){return _0x4ceb9c[_0xbd31('0x9')]('License',attributes,{'tableName':_0xbd31('0xa'),'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 93f9ca6..f4e2205 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 _0x6dee=['info','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','License,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x3c8222,_0x5d89b2){var _0x22943d=function(_0xc5f710){while(--_0xc5f710){_0x3c8222['push'](_0x3c8222['shift']());}};_0x22943d(++_0x5d89b2);}(_0x6dee,0x1ba));var _0xe6de=function(_0x52ae42,_0x32c409){_0x52ae42=_0x52ae42-0x0;var _0x5e6eec=_0x6dee[_0x52ae42];return _0x5e6eec;};'use strict';var _=require(_0xe6de('0x0'));var util=require('util');var moment=require(_0xe6de('0x1'));var BPromise=require(_0xe6de('0x2'));var rs=require(_0xe6de('0x3'));var fs=require('fs');var Redis=require(_0xe6de('0x4'));var db=require(_0xe6de('0x5'))['db'];var utils=require(_0xe6de('0x6'));var logger=require(_0xe6de('0x7'))(_0xe6de('0x8'));var config=require('../../config/environment');var jayson=require(_0xe6de('0x9'));var client=jayson[_0xe6de('0xa')][_0xe6de('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49cdf9,_0x6c9041,_0x37c7b5){return new BPromise(function(_0x48291f,_0xdf7ee6){return client[_0xe6de('0xc')](_0x49cdf9,_0x37c7b5)[_0xe6de('0xd')](function(_0x4d5ddb){logger[_0xe6de('0xe')]('License,\x20%s,\x20%s',_0x6c9041,'request\x20sent');logger[_0xe6de('0xf')](_0xe6de('0x10'),_0x6c9041,_0xe6de('0x11'),JSON[_0xe6de('0x12')](_0x4d5ddb));if(_0x4d5ddb[_0xe6de('0x13')]){if(_0x4d5ddb['error'][_0xe6de('0x14')]===0x1f4){logger['error'](_0xe6de('0x15'),_0x6c9041,_0x4d5ddb[_0xe6de('0x13')][_0xe6de('0x16')]);return _0xdf7ee6(_0x4d5ddb[_0xe6de('0x13')][_0xe6de('0x16')]);}logger['error'](_0xe6de('0x15'),_0x6c9041,_0x4d5ddb['error'][_0xe6de('0x16')]);return _0x48291f(_0x4d5ddb[_0xe6de('0x13')][_0xe6de('0x16')]);}else{logger[_0xe6de('0xe')](_0xe6de('0x15'),_0x6c9041,_0xe6de('0x11'));_0x48291f(_0x4d5ddb[_0xe6de('0x17')]['message']);}})['catch'](function(_0x3d8769){logger['error']('License,\x20%s,\x20%s',_0x6c9041,_0x3d8769);_0xdf7ee6(_0x3d8769);});});} \ No newline at end of file +var _0xd188=['then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x186b10,_0x30745b){var _0x20eff5=function(_0x4f5f42){while(--_0x4f5f42){_0x186b10['push'](_0x186b10['shift']());}};_0x20eff5(++_0x30745b);}(_0xd188,0x181));var _0x8d18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd188[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8d18('0x0'));var util=require('util');var moment=require(_0x8d18('0x1'));var BPromise=require(_0x8d18('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d18('0x3'));var db=require(_0x8d18('0x4'))['db'];var utils=require(_0x8d18('0x5'));var logger=require(_0x8d18('0x6'))(_0x8d18('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8d18('0x8')][_0x8d18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x119026,_0xe0791c,_0x2d1253){return new BPromise(function(_0x361f6e,_0x3caeca){return client[_0x8d18('0xa')](_0x119026,_0x2d1253)[_0x8d18('0xb')](function(_0x2b4ef5){logger[_0x8d18('0xc')](_0x8d18('0xd'),_0xe0791c,_0x8d18('0xe'));logger[_0x8d18('0xf')](_0x8d18('0x10'),_0xe0791c,'request\x20sent',JSON[_0x8d18('0x11')](_0x2b4ef5));if(_0x2b4ef5[_0x8d18('0x12')]){if(_0x2b4ef5[_0x8d18('0x12')][_0x8d18('0x13')]===0x1f4){logger['error'](_0x8d18('0xd'),_0xe0791c,_0x2b4ef5[_0x8d18('0x12')][_0x8d18('0x14')]);return _0x3caeca(_0x2b4ef5[_0x8d18('0x12')]['message']);}logger[_0x8d18('0x12')](_0x8d18('0xd'),_0xe0791c,_0x2b4ef5['error'][_0x8d18('0x14')]);return _0x361f6e(_0x2b4ef5[_0x8d18('0x12')][_0x8d18('0x14')]);}else{logger[_0x8d18('0xc')](_0x8d18('0xd'),_0xe0791c,_0x8d18('0xe'));_0x361f6e(_0x2b4ef5['result'][_0x8d18('0x14')]);}})[_0x8d18('0x15')](function(_0x39a2fc){logger['error']('License,\x20%s,\x20%s',_0xe0791c,_0x39a2fc);_0x3caeca(_0x39a2fc);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index ee13f2f..89f81af 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 _0x44dc=['describe','isAuthenticated','show','/:id/canned_answers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','addDisposition','post','addAnswer','create','/:id/in_servers','addImap','addApplications','send','put','/:id','update','delete','/:id/dispositions','removeDispositions','removeAnswers','removeImap','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe'];(function(_0x43f542,_0x445999){var _0x3cc9d7=function(_0x15f83e){while(--_0x15f83e){_0x43f542['push'](_0x43f542['shift']());}};_0x3cc9d7(++_0x445999);}(_0x44dc,0x16a));var _0xc44d=function(_0x562e6c,_0x1d4b7c){_0x562e6c=_0x562e6c-0x0;var _0x17d1ab=_0x44dc[_0x562e6c];return _0x17d1ab;};'use strict';var multer=require(_0xc44d('0x0'));var util=require(_0xc44d('0x1'));var path=require(_0xc44d('0x2'));var timeout=require(_0xc44d('0x3'));var express=require(_0xc44d('0x4'));var router=express[_0xc44d('0x5')]();var fs_extra=require(_0xc44d('0x6'));var auth=require(_0xc44d('0x7'));var interaction=require(_0xc44d('0x8'));var config=require(_0xc44d('0x9'));var controller=require(_0xc44d('0xa'));router[_0xc44d('0xb')]('/',auth['isAuthenticated'](),controller[_0xc44d('0xc')]);router[_0xc44d('0xb')](_0xc44d('0xd'),auth['isAuthenticated'](),controller[_0xc44d('0xe')]);router[_0xc44d('0xb')]('/:id',auth[_0xc44d('0xf')](),controller[_0xc44d('0x10')]);router['get']('/:id/dispositions',auth[_0xc44d('0xf')](),controller['getDispositions']);router[_0xc44d('0xb')](_0xc44d('0x11'),auth[_0xc44d('0xf')](),controller['getAnswers']);router[_0xc44d('0xb')]('/:id/in_servers',auth[_0xc44d('0xf')](),controller['getImap']);router['get'](_0xc44d('0x12'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x13')]);router[_0xc44d('0xb')](_0xc44d('0x14'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x15')]);router[_0xc44d('0xb')](_0xc44d('0x16'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x17')]);router['get'](_0xc44d('0x18'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x19')]);router[_0xc44d('0xb')](_0xc44d('0x1a'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x1b')]);router[_0xc44d('0xb')](_0xc44d('0x1c'),auth[_0xc44d('0xf')](),controller['getAgents']);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc44d('0x1d')]);router[_0xc44d('0x1e')]('/:id/canned_answers',auth[_0xc44d('0xf')](),controller[_0xc44d('0x1f')]);router[_0xc44d('0x1e')]('/',auth['isAuthenticated'](),controller[_0xc44d('0x20')]);router[_0xc44d('0x1e')](_0xc44d('0x21'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x22')]);router[_0xc44d('0x1e')](_0xc44d('0x12'),auth[_0xc44d('0xf')](),controller['addSmtp']);router[_0xc44d('0x1e')](_0xc44d('0x14'),auth[_0xc44d('0xf')](),controller['addInteraction']);router[_0xc44d('0x1e')](_0xc44d('0x16'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x23')]);router[_0xc44d('0x1e')]('/:id/send',auth[_0xc44d('0xf')](),controller[_0xc44d('0x24')]);router[_0xc44d('0x1e')](_0xc44d('0x1c'),auth[_0xc44d('0xf')](),controller['addAgents']);router[_0xc44d('0x25')](_0xc44d('0x26'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x27')]);router[_0xc44d('0x28')](_0xc44d('0x29'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x2a')]);router[_0xc44d('0x28')](_0xc44d('0x11'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x2b')]);router['delete'](_0xc44d('0x21'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x2c')]);router[_0xc44d('0x28')](_0xc44d('0x12'),auth[_0xc44d('0xf')](),controller['removeSmtp']);router[_0xc44d('0x28')](_0xc44d('0x26'),auth[_0xc44d('0xf')](),controller['destroy']);router[_0xc44d('0x28')](_0xc44d('0x1c'),auth[_0xc44d('0xf')](),controller[_0xc44d('0x2d')]);module[_0xc44d('0x2e')]=router; \ No newline at end of file +var _0x71b3=['../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/out_servers','addInteraction','addApplications','/:id/send','send','addAgents','put','removeDispositions','delete','removeAnswers','removeSmtp','removeAgents','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x111bf0,_0x306ab1){var _0x87d4b=function(_0x3abbaf){while(--_0x3abbaf){_0x111bf0['push'](_0x111bf0['shift']());}};_0x87d4b(++_0x306ab1);}(_0x71b3,0x1a9));var _0x371b=function(_0x3826c7,_0xf73ee){_0x3826c7=_0x3826c7-0x0;var _0x39fc26=_0x71b3[_0x3826c7];return _0x39fc26;};'use strict';var multer=require('multer');var util=require(_0x371b('0x0'));var path=require(_0x371b('0x1'));var timeout=require(_0x371b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x371b('0x3'));var auth=require(_0x371b('0x4'));var interaction=require(_0x371b('0x5'));var config=require(_0x371b('0x6'));var controller=require(_0x371b('0x7'));router['get']('/',auth[_0x371b('0x8')](),controller['index']);router[_0x371b('0x9')](_0x371b('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x371b('0x9')](_0x371b('0xb'),auth[_0x371b('0x8')](),controller[_0x371b('0xc')]);router[_0x371b('0x9')](_0x371b('0xd'),auth[_0x371b('0x8')](),controller[_0x371b('0xe')]);router[_0x371b('0x9')](_0x371b('0xf'),auth[_0x371b('0x8')](),controller[_0x371b('0x10')]);router[_0x371b('0x9')](_0x371b('0x11'),auth[_0x371b('0x8')](),controller['getImap']);router[_0x371b('0x9')]('/:id/out_servers',auth[_0x371b('0x8')](),controller[_0x371b('0x12')]);router[_0x371b('0x9')](_0x371b('0x13'),auth[_0x371b('0x8')](),controller[_0x371b('0x14')]);router[_0x371b('0x9')](_0x371b('0x15'),auth[_0x371b('0x8')](),controller[_0x371b('0x16')]);router['get']('/:id/messages',auth[_0x371b('0x8')](),controller['getMessages']);router['get'](_0x371b('0x17'),auth[_0x371b('0x8')](),controller[_0x371b('0x18')]);router[_0x371b('0x9')](_0x371b('0x19'),auth[_0x371b('0x8')](),controller[_0x371b('0x1a')]);router[_0x371b('0x1b')]('/:id/dispositions',auth[_0x371b('0x8')](),controller[_0x371b('0x1c')]);router[_0x371b('0x1b')](_0x371b('0xf'),auth[_0x371b('0x8')](),controller[_0x371b('0x1d')]);router[_0x371b('0x1b')]('/',auth[_0x371b('0x8')](),controller[_0x371b('0x1e')]);router[_0x371b('0x1b')](_0x371b('0x11'),auth[_0x371b('0x8')](),controller['addImap']);router[_0x371b('0x1b')](_0x371b('0x1f'),auth[_0x371b('0x8')](),controller['addSmtp']);router[_0x371b('0x1b')](_0x371b('0x13'),auth[_0x371b('0x8')](),controller[_0x371b('0x20')]);router[_0x371b('0x1b')](_0x371b('0x15'),auth[_0x371b('0x8')](),controller[_0x371b('0x21')]);router['post'](_0x371b('0x22'),auth[_0x371b('0x8')](),controller[_0x371b('0x23')]);router[_0x371b('0x1b')](_0x371b('0x19'),auth[_0x371b('0x8')](),controller[_0x371b('0x24')]);router[_0x371b('0x25')](_0x371b('0xb'),auth[_0x371b('0x8')](),controller['update']);router['delete'](_0x371b('0xd'),auth[_0x371b('0x8')](),controller[_0x371b('0x26')]);router[_0x371b('0x27')](_0x371b('0xf'),auth[_0x371b('0x8')](),controller[_0x371b('0x28')]);router[_0x371b('0x27')](_0x371b('0x11'),auth[_0x371b('0x8')](),controller['removeImap']);router[_0x371b('0x27')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x371b('0x29')]);router['delete'](_0x371b('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x371b('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index e27c199..6ced8c6 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 _0x2e05=['yahoo','outlook365','getDataValue','provider','custom','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','ENUM','gmail','hotmail'];(function(_0x55291a,_0x814018){var _0x3c870c=function(_0x1fd787){while(--_0x1fd787){_0x55291a['push'](_0x55291a['shift']());}};_0x3c870c(++_0x814018);}(_0x2e05,0x1bd));var _0x52e0=function(_0x39532d,_0x44d48c){_0x39532d=_0x39532d-0x0;var _0x3efc86=_0x2e05[_0x39532d];return _0x3efc86;};'use strict';var Sequelize=require(_0x52e0('0x0'));module['exports']={'description':{'type':Sequelize[_0x52e0('0x1')]},'name':{'type':Sequelize[_0x52e0('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x52e0('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x52e0('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x52e0('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x52e0('0x3')]},'markAsUnread':{'type':Sequelize[_0x52e0('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x52e0('0x1')],'allowNull':![],'defaultValue':_0x52e0('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x52e0('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x52e0('0x6');}},'notificationSound':{'type':Sequelize[_0x52e0('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x52e0('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x52e0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x52e0('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x52e0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x52e0('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x52e0('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x52e0('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x52e0('0x2')],'defaultValue':![],'comment':_0x52e0('0x9'),'set':function(_0xd500fb){if(!_0xd500fb)this['setDataValue'](_0x52e0('0xa'),null);this[_0x52e0('0xb')]('mandatoryDisposition',_0xd500fb);}},'provider':{'type':Sequelize[_0x52e0('0xc')](_0x52e0('0xd'),_0x52e0('0xe'),_0x52e0('0xf'),_0x52e0('0x10')),'defaultValue':null,'get':function(){if(!this[_0x52e0('0x11')](_0x52e0('0x12')))return _0x52e0('0x13');return this[_0x52e0('0x11')](_0x52e0('0x12'));},'set':function(_0x3743aa){if(_0x3743aa===_0x52e0('0x13'))_0x3743aa=null;return this['setDataValue'](_0x52e0('0x12'),_0x3743aa);}}}; \ No newline at end of file +var _0x499a=['TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','provider','getDataValue','sequelize','STRING','BOOLEAN'];(function(_0x452bed,_0x128e55){var _0x4bb2cf=function(_0x41f9b1){while(--_0x41f9b1){_0x452bed['push'](_0x452bed['shift']());}};_0x4bb2cf(++_0x128e55);}(_0x499a,0x15d));var _0xa499=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x499a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa499('0x0'));module['exports']={'description':{'type':Sequelize[_0xa499('0x1')]},'name':{'type':Sequelize[_0xa499('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xa499('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xa499('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa499('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xa499('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xa499('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xa499('0x1')],'allowNull':![],'defaultValue':_0xa499('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xa499('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa499('0x3')],'defaultValue':function(){return _0xa499('0x6');}},'notificationSound':{'type':Sequelize[_0xa499('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa499('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa499('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa499('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa499('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa499('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa499('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xa499('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xa499('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x9495f7){if(!_0x9495f7)this[_0xa499('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xa499('0xa'),_0x9495f7);}},'provider':{'type':Sequelize[_0xa499('0xb')](_0xa499('0xc'),_0xa499('0xd'),'yahoo','outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0xa499('0xe')))return'custom';return this[_0xa499('0xf')]('provider');},'set':function(_0x417381){if(_0x417381==='custom')_0x417381=null;return this[_0xa499('0x9')](_0xa499('0xe'),_0x417381);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index bbe4c7e..8526bda 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 _0xcda0=['describe','addDisposition','Disposition','getDispositions','rawAttributes','pick','filter','includeAll','removeDispositions','ids','addAnswer','MailAccountId','create','getAnswers','findOne','CannedAnswer','removeAnswers','email','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','options','Contact','Owner','internal','Tag','color','tag','sequelize','transaction','READ_COMMITTED','MailApplication','bulkCreate','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','SendMail','CmContact','ListId','attach','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','get','MailAccounts','UserProfileResource','destroy','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','host','service','username','authentication','Imap','Smtp','port','index','MailServerIn','Pause','mandatoryDispositionPause','map','MailAccount','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','type','merge','findAll','rows','params','MailServerOut','include','find','body','provider','custom','secure','Mail\x20Account\x20not\x20found'];(function(_0x596316,_0x59dd3a){var _0x1450c7=function(_0x58ab73){while(--_0x58ab73){_0x596316['push'](_0x596316['shift']());}};_0x1450c7(++_0x59dd3a);}(_0xcda0,0x1ca));var _0x0cda=function(_0x4d60bb,_0x10c133){_0x4d60bb=_0x4d60bb-0x0;var _0x6775ed=_0xcda0[_0x4d60bb];return _0x6775ed;};'use strict';var moment=require(_0x0cda('0x0'));var BPromise=require(_0x0cda('0x1'));var util=require(_0x0cda('0x2'));var path=require(_0x0cda('0x3'));var _=require(_0x0cda('0x4'));var juice=require('juice');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x0cda('0x5'))(_0x0cda('0x6'));var config=require('../../config/environment');var db=require(_0x0cda('0x7'))['db'];config[_0x0cda('0x8')]=_[_0x0cda('0x9')](config['redis'],{'host':_0x0cda('0xa'),'port':0x18eb});var socket=require(_0x0cda('0xb'))(new Redis(config[_0x0cda('0x8')]));require(_0x0cda('0xc'))[_0x0cda('0xd')](socket);var jayson=require(_0x0cda('0xe'));var client=jayson['client'][_0x0cda('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x3c80b3,_0x361018,_0x277d56,_0x51465d){return new BPromise(function(_0x359675,_0x385e7c){var _0x3501c7=_0x51465d||client;return _0x3501c7[_0x0cda('0x10')](_0x3c80b3,_0x277d56)['then'](function(_0x151e98){logger[_0x0cda('0x11')](_0x0cda('0x12'),_0x361018,_0x0cda('0x13'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x361018,_0x0cda('0x13'),JSON[_0x0cda('0x14')](_0x151e98));if(_0x151e98[_0x0cda('0x15')]){if(_0x151e98[_0x0cda('0x15')][_0x0cda('0x16')]===0x1f4){logger[_0x0cda('0x15')]('MailAccount,\x20%s,\x20%s',_0x361018,_0x151e98['error']['message']);return _0x385e7c(_0x151e98[_0x0cda('0x15')][_0x0cda('0x17')]);}logger[_0x0cda('0x15')]('MailAccount,\x20%s,\x20%s',_0x361018,_0x151e98['error']['message']);return _0x359675(_0x151e98[_0x0cda('0x15')][_0x0cda('0x17')]);}else{logger[_0x0cda('0x11')](_0x0cda('0x12'),_0x361018,'request\x20sent');_0x359675(_0x151e98[_0x0cda('0x18')][_0x0cda('0x17')]);}})[_0x0cda('0x19')](function(_0x322779){logger[_0x0cda('0x15')](_0x0cda('0x12'),_0x361018,_0x322779);_0x385e7c(_0x322779);});});}function respondWithStatusCode(_0x6aaf13,_0x53d84a){_0x53d84a=_0x53d84a||0xcc;return function(_0x5e2e03){if(_0x5e2e03){return _0x6aaf13[_0x0cda('0x1a')](_0x53d84a);}return _0x6aaf13[_0x0cda('0x1b')](_0x53d84a)[_0x0cda('0x1c')]();};}function respondWithResult(_0x46f66a,_0x7e8fa0){_0x7e8fa0=_0x7e8fa0||0xc8;return function(_0x55aca6){if(_0x55aca6){return _0x46f66a['status'](_0x7e8fa0)[_0x0cda('0x1d')](_0x55aca6);}};}function respondWithFilteredResult(_0x152c8d,_0x26b59b){return function(_0x4c0b65){if(_0x4c0b65){var _0x5caacb=typeof _0x26b59b[_0x0cda('0x1e')]===_0x0cda('0x1f')&&typeof _0x26b59b[_0x0cda('0x20')]==='undefined';var _0x2e024f=_0x4c0b65[_0x0cda('0x21')];var _0x1eb5d9=_0x5caacb?0x0:_0x26b59b[_0x0cda('0x1e')];var _0x5a4093=_0x5caacb?_0x4c0b65[_0x0cda('0x21')]:_0x26b59b[_0x0cda('0x1e')]+_0x26b59b[_0x0cda('0x20')];var _0x1734e4;if(_0x5a4093>=_0x2e024f){_0x5a4093=_0x2e024f;_0x1734e4=0xc8;}else{_0x1734e4=0xce;}_0x152c8d[_0x0cda('0x1b')](_0x1734e4);return _0x152c8d[_0x0cda('0x22')](_0x0cda('0x23'),_0x1eb5d9+'-'+_0x5a4093+'/'+_0x2e024f)[_0x0cda('0x1d')](_0x4c0b65);}return null;};}function saveUpdates(_0x39a2e4){return function(_0x2f2b14){if(_0x2f2b14){return _0x2f2b14[_0x0cda('0x24')](_0x39a2e4)[_0x0cda('0x25')](function(_0x45c2d5){return _0x45c2d5;});}return null;};}function removeEntity(_0x71afe4){return function(_0x341331){if(_0x341331){return _0x341331['destroy']()[_0x0cda('0x25')](function(){var _0x1f95d5=_0x341331[_0x0cda('0x26')]({'plain':!![]});var _0x1abbab=_0x0cda('0x27');return db[_0x0cda('0x28')][_0x0cda('0x29')]({'where':{'type':_0x1abbab,'resourceId':_0x1f95d5['id']}})['then'](function(){return _0x341331;});})[_0x0cda('0x25')](function(){_0x71afe4[_0x0cda('0x1b')](0xcc)[_0x0cda('0x1c')]();});}};}function handleEntityNotFound(_0x461e38){return function(_0x36e7aa){if(!_0x36e7aa){_0x461e38[_0x0cda('0x1a')](0x194);}return _0x36e7aa;};}function handleError(_0x39875a,_0x2c7846){_0x2c7846=_0x2c7846||0x1f4;return function(_0x6cf378){logger[_0x0cda('0x15')](_0x6cf378[_0x0cda('0x2a')]);if(_0x6cf378[_0x0cda('0x2b')]){delete _0x6cf378[_0x0cda('0x2b')];}_0x39875a[_0x0cda('0x1b')](_0x2c7846)[_0x0cda('0x2c')](_0x6cf378);};}function getImapHost(_0x258ca6){switch(_0x258ca6){case _0x0cda('0x2d'):return'imap.gmail.com';case _0x0cda('0x2e'):return _0x0cda('0x2f');case _0x0cda('0x30'):return _0x0cda('0x31');case _0x0cda('0x32'):return'outlook.office365.com';}throw new Error(_0x0cda('0x33'),_0x258ca6);}function getSmtpHost(_0x9e3e3f){switch(_0x9e3e3f){case'gmail':return _0x0cda('0x34');case'yahoo':return _0x0cda('0x35');case _0x0cda('0x30'):return'smtp-mail.outlook.com';case _0x0cda('0x32'):return _0x0cda('0x36');}throw new Error(_0x0cda('0x33'),_0x9e3e3f);}function getAuthenticationOptions(_0x518e32,_0x55625a){var _0x4cc690={};var _0x423054={};if(_0x518e32){_0x4cc690[_0x0cda('0x37')]=_0x423054['user']=_0x55625a['username'];_0x4cc690[_0x0cda('0x38')]=_0x423054[_0x0cda('0x39')]=_0x55625a[_0x0cda('0x38')];if(_0x55625a[_0x0cda('0x3a')]){_0x4cc690['modernAuthentication']=_0x423054['modernAuthentication']=!![];_0x4cc690[_0x0cda('0x3b')]=_0x423054[_0x0cda('0x3b')]=_0x55625a[_0x0cda('0x3b')];_0x4cc690[_0x0cda('0x38')]=_0x423054[_0x0cda('0x39')]=null;}else{_0x4cc690[_0x0cda('0x3b')]=_0x423054[_0x0cda('0x3b')]=null;}_0x4cc690[_0x0cda('0x3c')]=getImapHost(_0x518e32);_0x4cc690['port']=0x3e1;_0x423054[_0x0cda('0x3c')]=getSmtpHost(_0x518e32);_0x423054['port']=0x24b;_0x423054['secure']=![];_0x4cc690[_0x0cda('0x3d')]=_0x423054[_0x0cda('0x3d')]=null;}else{if(_0x55625a['authentication']){_0x4cc690['user']=_0x423054[_0x0cda('0x37')]=_0x55625a[_0x0cda('0x3e')];_0x4cc690[_0x0cda('0x38')]=_0x423054[_0x0cda('0x39')]=_0x55625a[_0x0cda('0x38')];}else{_0x4cc690[_0x0cda('0x3f')]=_0x423054[_0x0cda('0x3f')]=![];_0x4cc690[_0x0cda('0x37')]=_0x423054['user']=null;_0x4cc690[_0x0cda('0x38')]=_0x423054[_0x0cda('0x39')]=null;}_0x4cc690[_0x0cda('0x3c')]=_0x55625a[_0x0cda('0x40')][_0x0cda('0x3c')];_0x4cc690['port']=_0x55625a[_0x0cda('0x40')]['port'];_0x423054[_0x0cda('0x3c')]=_0x55625a[_0x0cda('0x41')]['host'];_0x423054[_0x0cda('0x42')]=_0x55625a['Smtp'][_0x0cda('0x42')];}return{'Imap':_0x4cc690,'Smtp':_0x423054};}exports[_0x0cda('0x43')]=function(_0x31a025,_0x3e36ac){var _0x1f628c={'include':[{'model':db[_0x0cda('0x44')],'as':_0x0cda('0x40')},{'model':db['MailServerOut'],'as':_0x0cda('0x41')},{'model':db[_0x0cda('0x45')],'as':_0x0cda('0x46')}]},_0x3670e4={},_0x35ef16={'count':0x0,'rows':[]};var _0x426502=_[_0x0cda('0x47')](db[_0x0cda('0x48')]['rawAttributes'],function(_0xd6a069){return{'name':_0xd6a069['fieldName'],'type':_0xd6a069['type'][_0x0cda('0x49')]};});_0x3670e4[_0x0cda('0x4a')]=_[_0x0cda('0x47')](_0x426502,'name');_0x3670e4[_0x0cda('0x4b')]=_[_0x0cda('0x4c')](_0x31a025[_0x0cda('0x4b')]);_0x3670e4[_0x0cda('0x4d')]=_['intersection'](_0x3670e4[_0x0cda('0x4a')],_0x3670e4['query']);_0x1f628c['attributes']=_[_0x0cda('0x4e')](_0x3670e4[_0x0cda('0x4a')],qs['fields'](_0x31a025[_0x0cda('0x4b')][_0x0cda('0x4f')]));_0x1f628c[_0x0cda('0x50')]=_0x1f628c[_0x0cda('0x50')][_0x0cda('0x51')]?_0x1f628c[_0x0cda('0x50')]:_0x3670e4['model'];if(!_0x31a025[_0x0cda('0x4b')][_0x0cda('0x52')](_0x0cda('0x53'))){_0x1f628c['limit']=qs[_0x0cda('0x20')](_0x31a025[_0x0cda('0x4b')][_0x0cda('0x20')]);_0x1f628c[_0x0cda('0x1e')]=qs[_0x0cda('0x1e')](_0x31a025[_0x0cda('0x4b')]['offset']);}_0x1f628c[_0x0cda('0x54')]=qs[_0x0cda('0x55')](_0x31a025[_0x0cda('0x4b')][_0x0cda('0x55')]);_0x1f628c['where']=qs[_0x0cda('0x4d')](_['pick'](_0x31a025[_0x0cda('0x4b')],_0x3670e4[_0x0cda('0x4d')]),_0x426502);if(_0x31a025[_0x0cda('0x4b')]['filter']){_0x1f628c[_0x0cda('0x56')]=_['merge'](_0x1f628c[_0x0cda('0x56')],{'$or':_[_0x0cda('0x47')](_0x426502,function(_0x35f3e4){if(_0x35f3e4[_0x0cda('0x57')]!=='VIRTUAL'){var _0x523ee6={};_0x523ee6[_0x35f3e4[_0x0cda('0x2b')]]={'$like':'%'+_0x31a025[_0x0cda('0x4b')]['filter']+'%'};return _0x523ee6;}})});}_0x1f628c=_[_0x0cda('0x58')]({},_0x1f628c,_0x31a025['options']);var _0x4245dc={'where':_0x1f628c[_0x0cda('0x56')]};return db[_0x0cda('0x48')]['count'](_0x4245dc)[_0x0cda('0x25')](function(_0xe1bdbf){_0x35ef16[_0x0cda('0x21')]=_0xe1bdbf;if(_0x31a025[_0x0cda('0x4b')]['includeAll']){_0x1f628c['include']=[{'all':!![]}];}return db[_0x0cda('0x48')][_0x0cda('0x59')](_0x1f628c);})[_0x0cda('0x25')](function(_0x23667e){_0x35ef16[_0x0cda('0x5a')]=_0x23667e;return _0x35ef16;})[_0x0cda('0x25')](respondWithFilteredResult(_0x3e36ac,_0x1f628c))[_0x0cda('0x19')](handleError(_0x3e36ac,null));};exports['show']=function(_0x1aa0de,_0x412494){var _0x16b47a={'raw':![],'where':{'id':_0x1aa0de[_0x0cda('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x0cda('0x40')},{'model':db[_0x0cda('0x5c')],'as':'Smtp'},{'model':db[_0x0cda('0x45')],'as':_0x0cda('0x46')}]},_0xd7a91c={};_0xd7a91c['model']=_['keys'](db[_0x0cda('0x48')]['rawAttributes']);_0xd7a91c[_0x0cda('0x4b')]=_[_0x0cda('0x4c')](_0x1aa0de[_0x0cda('0x4b')]);_0xd7a91c[_0x0cda('0x4d')]=_[_0x0cda('0x4e')](_0xd7a91c[_0x0cda('0x4a')],_0xd7a91c[_0x0cda('0x4b')]);_0x16b47a[_0x0cda('0x50')]=_[_0x0cda('0x4e')](_0xd7a91c['model'],qs[_0x0cda('0x4f')](_0x1aa0de[_0x0cda('0x4b')][_0x0cda('0x4f')]));_0x16b47a['attributes']=_0x16b47a[_0x0cda('0x50')][_0x0cda('0x51')]?_0x16b47a[_0x0cda('0x50')]:_0xd7a91c[_0x0cda('0x4a')];if(_0x1aa0de[_0x0cda('0x4b')]['includeAll']){_0x16b47a[_0x0cda('0x5d')]=[{'all':!![]}];}_0x16b47a=_['merge']({},_0x16b47a,_0x1aa0de['options']);return db[_0x0cda('0x48')][_0x0cda('0x5e')](_0x16b47a)[_0x0cda('0x25')](handleEntityNotFound(_0x412494,null))['then'](respondWithResult(_0x412494,null))['catch'](handleError(_0x412494,null));};exports['update']=function(_0x389413,_0x11eda3){if(_0x389413[_0x0cda('0x5f')]['id']){delete _0x389413[_0x0cda('0x5f')]['id'];}var _0xefb6b3=_0x389413[_0x0cda('0x5f')][_0x0cda('0x60')]===_0x0cda('0x61')?null:_0x389413[_0x0cda('0x5f')]['provider'];var _0x30e396=_0x389413[_0x0cda('0x5f')][_0x0cda('0x40')]||{};var _0x580385=_0x389413['body']['Smtp']||{};if(_0xefb6b3){_0x30e396[_0x0cda('0x3c')]=getImapHost(_0xefb6b3);_0x30e396[_0x0cda('0x42')]=0x3e1;_0x580385[_0x0cda('0x3c')]=getSmtpHost(_0xefb6b3);_0x580385['port']=0x24b;_0x580385[_0x0cda('0x62')]=![];}if(_0x580385[_0x0cda('0x3a')]){_0x580385[_0x0cda('0x62')]=![];}else{_0x580385[_0x0cda('0x3b')]=null;}if(!_0x30e396[_0x0cda('0x3a')])_0x30e396[_0x0cda('0x3b')]=null;_0x389413['body']['Imap']=_0x30e396;_0x389413[_0x0cda('0x5f')]['Smtp']=_0x580385;return db[_0x0cda('0x48')]['find']({'where':{'id':_0x389413[_0x0cda('0x5b')]['id']},'include':[{'model':db[_0x0cda('0x44')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0x0cda('0x46')}]})[_0x0cda('0x25')](handleEntityNotFound(_0x11eda3,null))['then'](function(_0x207d9a){if(!_0x207d9a)throw new Error(_0x0cda('0x63'));if(_0x207d9a[_0x0cda('0x3d')])delete _0x389413[_0x0cda('0x5f')][_0x0cda('0x40')];return _0x207d9a;})[_0x0cda('0x25')](saveUpdates(_0x389413[_0x0cda('0x5f')],null))['then'](function(_0x9116d6){if(!_0x389413[_0x0cda('0x5f')]['Imap'])return _0x9116d6;return db[_0x0cda('0x44')][_0x0cda('0x24')](_0x389413['body'][_0x0cda('0x40')],{'where':{'MailAccountId':_0x9116d6['id']}})['then'](function(){return _0x9116d6;});})[_0x0cda('0x25')](function(_0x5d183e){if(!_0x389413['body'][_0x0cda('0x41')])return _0x5d183e;return db['MailServerOut']['update'](_0x389413[_0x0cda('0x5f')]['Smtp'],{'where':{'MailAccountId':_0x5d183e['id']}})[_0x0cda('0x25')](function(){return _0x5d183e;});})[_0x0cda('0x25')](respondWithResult(_0x11eda3,null))[_0x0cda('0x19')](handleError(_0x11eda3,null));};exports[_0x0cda('0x64')]=function(_0xe208d4,_0x5af776){return db['MailAccount'][_0x0cda('0x64')]()['then'](respondWithResult(_0x5af776,null))['catch'](handleError(_0x5af776,null));};exports[_0x0cda('0x65')]=function(_0x4540b3,_0x4a6788){if(_0x4540b3[_0x0cda('0x5f')]['id']){delete _0x4540b3[_0x0cda('0x5f')]['id'];}return db[_0x0cda('0x48')][_0x0cda('0x5e')]({'where':{'id':_0x4540b3[_0x0cda('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4a6788,null))[_0x0cda('0x25')](function(_0x4d3575){if(_0x4d3575){_0x4540b3['body']['MailAccountId']=_0x4d3575['id'];return db[_0x0cda('0x66')]['create'](_0x4540b3[_0x0cda('0x5f')]);}})[_0x0cda('0x25')](respondWithResult(_0x4a6788,null))['catch'](handleError(_0x4a6788,null));};exports[_0x0cda('0x67')]=function(_0x115752,_0x406462){var _0x45af14={'raw':![],'where':{}};var _0x138f9d={};var _0x541add={'count':0x0,'rows':[]};return db[_0x0cda('0x48')]['findOne']({'where':{'id':_0x115752[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x406462,null))['then'](function(_0x46b5ce){if(_0x46b5ce){_0x138f9d[_0x0cda('0x4a')]=_[_0x0cda('0x4c')](db['Disposition'][_0x0cda('0x68')]);_0x138f9d[_0x0cda('0x4b')]=_[_0x0cda('0x4c')](_0x115752[_0x0cda('0x4b')]);_0x138f9d['filters']=_[_0x0cda('0x4e')](_0x138f9d[_0x0cda('0x4a')],_0x138f9d[_0x0cda('0x4b')]);_0x45af14[_0x0cda('0x50')]=_[_0x0cda('0x4e')](_0x138f9d[_0x0cda('0x4a')],qs['fields'](_0x115752[_0x0cda('0x4b')][_0x0cda('0x4f')]));_0x45af14['attributes']=_0x45af14[_0x0cda('0x50')][_0x0cda('0x51')]?_0x45af14[_0x0cda('0x50')]:_0x138f9d['model'];if(!_0x115752[_0x0cda('0x4b')]['hasOwnProperty'](_0x0cda('0x53'))){_0x45af14[_0x0cda('0x20')]=qs[_0x0cda('0x20')](_0x115752[_0x0cda('0x4b')]['limit']);_0x45af14[_0x0cda('0x1e')]=qs[_0x0cda('0x1e')](_0x115752[_0x0cda('0x4b')]['offset']);}_0x45af14['order']=qs[_0x0cda('0x55')](_0x115752['query'][_0x0cda('0x55')]);_0x45af14['where']=qs[_0x0cda('0x4d')](_[_0x0cda('0x69')](_0x115752['query'],_0x138f9d[_0x0cda('0x4d')]));_0x45af14['where']['MailAccountId']=_0x46b5ce['id'];if(_0x115752['query']['filter']){_0x45af14['where']=_['merge'](_0x45af14['where'],{'$or':_[_0x0cda('0x47')](_0x45af14[_0x0cda('0x50')],function(_0x214b81){var _0x4a641b={};_0x4a641b[_0x214b81]={'$like':'%'+_0x115752['query'][_0x0cda('0x6a')]+'%'};return _0x4a641b;})});}_0x45af14=_[_0x0cda('0x58')]({},_0x45af14,_0x115752['options']);return db['Disposition'][_0x0cda('0x21')]({'where':_0x45af14[_0x0cda('0x56')]})[_0x0cda('0x25')](function(_0x3ec394){_0x541add[_0x0cda('0x21')]=_0x3ec394;if(_0x115752[_0x0cda('0x4b')][_0x0cda('0x6b')]){_0x45af14[_0x0cda('0x5d')]=[{'all':!![]}];}return db['Disposition'][_0x0cda('0x59')](_0x45af14);})[_0x0cda('0x25')](function(_0x36812b){_0x541add['rows']=_0x36812b;return _0x541add;});}})[_0x0cda('0x25')](respondWithFilteredResult(_0x406462,_0x45af14))[_0x0cda('0x19')](handleError(_0x406462,null));};exports[_0x0cda('0x6c')]=function(_0x41d1a7,_0x46fdd0){return db['MailAccount'][_0x0cda('0x5e')]({'where':{'id':_0x41d1a7[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x46fdd0,null))[_0x0cda('0x25')](function(_0x447457){if(_0x447457){return _0x447457['removeDispositions'](_0x41d1a7[_0x0cda('0x4b')][_0x0cda('0x6d')]);}})[_0x0cda('0x25')](respondWithStatusCode(_0x46fdd0,null))['catch'](handleError(_0x46fdd0,null));};exports[_0x0cda('0x6e')]=function(_0x209f38,_0xdc8b89){if(_0x209f38[_0x0cda('0x5f')]['id']){delete _0x209f38['body']['id'];}return db[_0x0cda('0x48')][_0x0cda('0x5e')]({'where':{'id':_0x209f38[_0x0cda('0x5b')]['id']}})['then'](handleEntityNotFound(_0xdc8b89,null))[_0x0cda('0x25')](function(_0x12cc3c){if(_0x12cc3c){_0x209f38[_0x0cda('0x5f')][_0x0cda('0x6f')]=_0x12cc3c['id'];return db['CannedAnswer'][_0x0cda('0x70')](_0x209f38[_0x0cda('0x5f')]);}})['then'](respondWithResult(_0xdc8b89,null))[_0x0cda('0x19')](handleError(_0xdc8b89,null));};exports[_0x0cda('0x71')]=function(_0x297625,_0x3ebbac){var _0x223e23={'raw':![],'where':{}};var _0x351087={};var _0x328a4b={'count':0x0,'rows':[]};return db[_0x0cda('0x48')][_0x0cda('0x72')]({'where':{'id':_0x297625['params']['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x3ebbac,null))[_0x0cda('0x25')](function(_0x55e924){if(_0x55e924){_0x351087[_0x0cda('0x4a')]=_[_0x0cda('0x4c')](db[_0x0cda('0x73')][_0x0cda('0x68')]);_0x351087[_0x0cda('0x4b')]=_[_0x0cda('0x4c')](_0x297625[_0x0cda('0x4b')]);_0x351087['filters']=_[_0x0cda('0x4e')](_0x351087[_0x0cda('0x4a')],_0x351087['query']);_0x223e23[_0x0cda('0x50')]=_[_0x0cda('0x4e')](_0x351087[_0x0cda('0x4a')],qs[_0x0cda('0x4f')](_0x297625[_0x0cda('0x4b')][_0x0cda('0x4f')]));_0x223e23[_0x0cda('0x50')]=_0x223e23[_0x0cda('0x50')][_0x0cda('0x51')]?_0x223e23[_0x0cda('0x50')]:_0x351087['model'];if(!_0x297625['query'][_0x0cda('0x52')](_0x0cda('0x53'))){_0x223e23[_0x0cda('0x20')]=qs['limit'](_0x297625[_0x0cda('0x4b')][_0x0cda('0x20')]);_0x223e23[_0x0cda('0x1e')]=qs['offset'](_0x297625[_0x0cda('0x4b')][_0x0cda('0x1e')]);}_0x223e23[_0x0cda('0x54')]=qs['sort'](_0x297625[_0x0cda('0x4b')]['sort']);_0x223e23[_0x0cda('0x56')]=qs[_0x0cda('0x4d')](_[_0x0cda('0x69')](_0x297625[_0x0cda('0x4b')],_0x351087[_0x0cda('0x4d')]));_0x223e23['where'][_0x0cda('0x6f')]=_0x55e924['id'];if(_0x297625['query'][_0x0cda('0x6a')]){_0x223e23[_0x0cda('0x56')]=_['merge'](_0x223e23[_0x0cda('0x56')],{'$or':_[_0x0cda('0x47')](_0x223e23['attributes'],function(_0x30620c){var _0x30d566={};_0x30d566[_0x30620c]={'$like':'%'+_0x297625['query'][_0x0cda('0x6a')]+'%'};return _0x30d566;})});}_0x223e23=_[_0x0cda('0x58')]({},_0x223e23,_0x297625['options']);return db[_0x0cda('0x73')][_0x0cda('0x21')]({'where':_0x223e23[_0x0cda('0x56')]})[_0x0cda('0x25')](function(_0x397ed9){_0x328a4b[_0x0cda('0x21')]=_0x397ed9;if(_0x297625['query']['includeAll']){_0x223e23[_0x0cda('0x5d')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x223e23);})['then'](function(_0x410897){_0x328a4b[_0x0cda('0x5a')]=_0x410897;return _0x328a4b;});}})['then'](respondWithFilteredResult(_0x3ebbac,_0x223e23))[_0x0cda('0x19')](handleError(_0x3ebbac,null));};exports['removeAnswers']=function(_0x3c7507,_0x34b92f){return db[_0x0cda('0x48')]['find']({'where':{'id':_0x3c7507[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x34b92f,null))[_0x0cda('0x25')](function(_0x5b12dc){if(_0x5b12dc){return _0x5b12dc[_0x0cda('0x74')](_0x3c7507['query'][_0x0cda('0x6d')]);}})[_0x0cda('0x25')](respondWithStatusCode(_0x34b92f,null))[_0x0cda('0x19')](handleError(_0x34b92f,null));};exports[_0x0cda('0x70')]=function(_0x1886c0,_0x19ba34){var _0x19c07d={'name':_0x1886c0['body']['name'],'key':_0x1886c0['body'][_0x0cda('0x49')],'provider':_0x1886c0['body'][_0x0cda('0x60')]==='custom'?null:_0x1886c0[_0x0cda('0x5f')]['provider'],'email':_0x1886c0['body'][_0x0cda('0x75')],'ListId':_0x1886c0[_0x0cda('0x5f')]['ListId'],'active':!_[_0x0cda('0x76')](_0x1886c0[_0x0cda('0x5f')][_0x0cda('0x77')])?_0x1886c0['body'][_0x0cda('0x77')]:!![],'description':_0x1886c0['body'][_0x0cda('0x78')]||null};var _0x3dc8e0=getAuthenticationOptions(_0x19c07d[_0x0cda('0x60')],_0x1886c0[_0x0cda('0x5f')]);_0x19c07d[_0x0cda('0x40')]=_0x3dc8e0['Imap'];_0x19c07d[_0x0cda('0x41')]=_0x3dc8e0[_0x0cda('0x41')];return db['MailAccount'][_0x0cda('0x70')](_0x19c07d,{'include':[{'model':db[_0x0cda('0x5c')],'as':_0x0cda('0x41')},{'model':db[_0x0cda('0x44')],'as':_0x0cda('0x40')}]})[_0x0cda('0x25')](function(_0x30f66c){var _0x571c10=_0x1886c0['user'][_0x0cda('0x26')]({'plain':!![]});if(!_0x571c10)throw new Error(_0x0cda('0x79'));if(_0x571c10['role']===_0x0cda('0x37')){var _0x4fc467=_0x30f66c[_0x0cda('0x26')]({'plain':!![]});return db[_0x0cda('0x7a')][_0x0cda('0x5e')]({'where':{'name':'MailAccounts','userProfileId':_0x571c10[_0x0cda('0x7b')]},'raw':!![]})[_0x0cda('0x25')](function(_0x4446d1){if(_0x4446d1&&_0x4446d1[_0x0cda('0x7c')]===0x0){return db[_0x0cda('0x28')][_0x0cda('0x70')]({'name':_0x4fc467['name'],'resourceId':_0x4fc467['id'],'type':_0x4446d1[_0x0cda('0x2b')],'sectionId':_0x4446d1['id']},{})[_0x0cda('0x25')](function(){return _0x30f66c;});}else{return _0x30f66c;}})[_0x0cda('0x19')](function(_0x39b56e){logger[_0x0cda('0x15')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39b56e);throw _0x39b56e;});}return _0x30f66c;})[_0x0cda('0x25')](respondWithResult(_0x19ba34,0xc9))['catch'](handleError(_0x19ba34,null));};exports['getImap']=function(_0x3e0f54,_0x2a0ac4){return db['MailAccount'][_0x0cda('0x72')]({'where':{'id':_0x3e0f54[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x2a0ac4,null))[_0x0cda('0x25')](function(_0x21a686){if(_0x21a686){return _0x21a686[_0x0cda('0x7d')]();}return null;})['then'](respondWithResult(_0x2a0ac4,null))[_0x0cda('0x19')](handleError(_0x2a0ac4,null));};exports['addImap']=function(_0x27f41a,_0x12f1b8){if(_0x27f41a['body']['id']){delete _0x27f41a['body']['id'];}return db[_0x0cda('0x48')][_0x0cda('0x5e')]({'where':{'id':_0x27f41a[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x12f1b8,null))[_0x0cda('0x25')](function(_0x1c194b){if(_0x1c194b){_0x27f41a[_0x0cda('0x5f')][_0x0cda('0x6f')]=_0x1c194b['id'];return db[_0x0cda('0x44')]['create'](_0x27f41a['body']);}})[_0x0cda('0x25')](respondWithResult(_0x12f1b8,null))[_0x0cda('0x19')](handleError(_0x12f1b8,null));};exports[_0x0cda('0x7e')]=function(_0x48d816,_0x29597a){return db[_0x0cda('0x48')]['findOne']({'where':{'id':_0x48d816[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x29597a,null))[_0x0cda('0x25')](function(_0x3e6750){if(_0x3e6750){return _0x3e6750[_0x0cda('0x7f')](null);}return null;})[_0x0cda('0x25')](respondWithStatusCode(_0x29597a,null))[_0x0cda('0x19')](handleError(_0x29597a,null));};exports[_0x0cda('0x80')]=function(_0x1211f4,_0x5b1216){return db['MailAccount'][_0x0cda('0x72')]({'where':{'id':_0x1211f4[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x5b1216,null))[_0x0cda('0x25')](function(_0x4286ae){if(_0x4286ae){return _0x4286ae[_0x0cda('0x80')]();}return null;})[_0x0cda('0x25')](respondWithResult(_0x5b1216,null))[_0x0cda('0x19')](handleError(_0x5b1216,null));};exports['addSmtp']=function(_0x4d87ae,_0x2e05b7){if(_0x4d87ae[_0x0cda('0x5f')]['id']){delete _0x4d87ae[_0x0cda('0x5f')]['id'];}return db['MailAccount'][_0x0cda('0x5e')]({'where':{'id':_0x4d87ae['params']['id']}})['then'](handleEntityNotFound(_0x2e05b7,null))[_0x0cda('0x25')](function(_0x52b5e4){if(_0x52b5e4){_0x4d87ae[_0x0cda('0x5f')][_0x0cda('0x6f')]=_0x52b5e4['id'];return db[_0x0cda('0x5c')][_0x0cda('0x70')](_0x4d87ae[_0x0cda('0x5f')]);}})[_0x0cda('0x25')](respondWithResult(_0x2e05b7,null))[_0x0cda('0x19')](handleError(_0x2e05b7,null));};exports[_0x0cda('0x81')]=function(_0x20d5dc,_0xe68d6a){return db[_0x0cda('0x48')]['findOne']({'where':{'id':_0x20d5dc['params']['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0xe68d6a,null))[_0x0cda('0x25')](function(_0x58f9cd){if(_0x58f9cd){return _0x58f9cd[_0x0cda('0x82')](null);}return null;})[_0x0cda('0x25')](respondWithStatusCode(_0xe68d6a,null))[_0x0cda('0x19')](handleError(_0xe68d6a,null));};exports[_0x0cda('0x83')]=function(_0x274e01,_0x59ccf4){return db['MailInteraction'][_0x0cda('0x5e')]({'where':{'id':_0x274e01[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x59ccf4,null))[_0x0cda('0x25')](function(_0x1c06a4){if(_0x1c06a4){return _0x1c06a4[_0x0cda('0x83')](_0x274e01[_0x0cda('0x5f')]['ids'],_[_0x0cda('0x84')](_0x274e01['body'],[_0x0cda('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x59ccf4,null))[_0x0cda('0x19')](handleError(_0x59ccf4,null));};exports[_0x0cda('0x85')]=function(_0x951d44,_0x200683){var _0x29dd13={'raw':![],'where':{}};var _0x58779e={};var _0x1e415c={'count':0x0,'rows':[]};return db[_0x0cda('0x48')]['findOne']({'where':{'id':_0x951d44[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x200683,null))[_0x0cda('0x25')](function(_0x4781d1){if(_0x4781d1){_0x58779e[_0x0cda('0x4a')]=_[_0x0cda('0x4c')](db[_0x0cda('0x86')]['rawAttributes']);_0x58779e[_0x0cda('0x4b')]=_[_0x0cda('0x4c')](_0x951d44['query']);_0x58779e['filters']=_['intersection'](_0x58779e[_0x0cda('0x4a')],_0x58779e[_0x0cda('0x4b')]);_0x29dd13['attributes']=_[_0x0cda('0x4e')](_0x58779e[_0x0cda('0x4a')],qs['fields'](_0x951d44[_0x0cda('0x4b')][_0x0cda('0x4f')]));_0x29dd13[_0x0cda('0x50')]=_0x29dd13[_0x0cda('0x50')]['length']?_0x29dd13[_0x0cda('0x50')]:_0x58779e['model'];if(!_0x951d44[_0x0cda('0x4b')]['hasOwnProperty']('nolimit')){_0x29dd13[_0x0cda('0x20')]=qs[_0x0cda('0x20')](_0x951d44[_0x0cda('0x4b')][_0x0cda('0x20')]);_0x29dd13[_0x0cda('0x1e')]=qs[_0x0cda('0x1e')](_0x951d44[_0x0cda('0x4b')]['offset']);}_0x29dd13['order']=qs[_0x0cda('0x55')](_0x951d44['query'][_0x0cda('0x55')]);_0x29dd13[_0x0cda('0x56')]=qs[_0x0cda('0x4d')](_[_0x0cda('0x69')](_0x951d44[_0x0cda('0x4b')],_0x58779e[_0x0cda('0x4d')]));_0x29dd13['where']['MailAccountId']=_0x4781d1['id'];if(_0x951d44[_0x0cda('0x4b')][_0x0cda('0x6a')]){_0x29dd13[_0x0cda('0x56')]=_[_0x0cda('0x58')](_0x29dd13[_0x0cda('0x56')],{'$or':_[_0x0cda('0x47')](_0x29dd13['attributes'],function(_0x597345){var _0x38abdf={};_0x38abdf[_0x597345]={'$like':'%'+_0x951d44[_0x0cda('0x4b')][_0x0cda('0x6a')]+'%'};return _0x38abdf;})});}_0x29dd13=_[_0x0cda('0x58')]({},_0x29dd13,_0x951d44[_0x0cda('0x87')]);return db['MailInteraction'][_0x0cda('0x21')]({'where':_0x29dd13[_0x0cda('0x56')]})['then'](function(_0x24ce07){_0x1e415c[_0x0cda('0x21')]=_0x24ce07;if(_0x951d44[_0x0cda('0x4b')][_0x0cda('0x6b')]){_0x29dd13[_0x0cda('0x5d')]=[{'model':db['CmContact'],'as':_0x0cda('0x88'),'required':![]},{'model':db['User'],'as':_0x0cda('0x89'),'attributes':['name','fullname',_0x0cda('0x8a')],'required':![]},{'model':db[_0x0cda('0x8b')],'as':'Tags','attributes':['id','name',_0x0cda('0x8c')],'where':_0x951d44[_0x0cda('0x4b')][_0x0cda('0x8d')]?{'id':_0x951d44[_0x0cda('0x4b')][_0x0cda('0x8d')]}:undefined,'required':_0x951d44[_0x0cda('0x4b')][_0x0cda('0x8d')]?!![]:![]}];}return db[_0x0cda('0x86')]['findAll'](_0x29dd13);})['then'](function(_0x320fb0){_0x1e415c[_0x0cda('0x5a')]=_0x320fb0;return _0x1e415c;});}})['then'](respondWithFilteredResult(_0x200683,_0x29dd13))[_0x0cda('0x19')](handleError(_0x200683,null));};exports['addApplications']=function addApplications(_0x95ad10,_0x4be76e){var _0x454075=_0x95ad10[_0x0cda('0x5b')]['id'];var _0x17bd87=_0x95ad10['body'];var _0x57a44e=0xc8;var _0x286b04=null;return db[_0x0cda('0x8e')][_0x0cda('0x8f')]({'isolationLevel':db[_0x0cda('0x8e')]['Transaction']['ISOLATION_LEVELS'][_0x0cda('0x90')]},function(_0x5500e3){return db[_0x0cda('0x48')][_0x0cda('0x72')]({'where':{'id':_0x454075},'transaction':_0x5500e3})[_0x0cda('0x25')](function(_0x5cb3c4){if(_0x5cb3c4){return db[_0x0cda('0x91')][_0x0cda('0x29')]({'where':{'MailAccountId':_0x454075},'transaction':_0x5500e3})[_0x0cda('0x25')](function(){var _0x1fc5b7=_['map'](_0x17bd87,function(_0x4d600c){_0x4d600c[_0x0cda('0x6f')]=_0x454075;return _0x4d600c;});return db['MailApplication'][_0x0cda('0x92')](_0x1fc5b7,{'transaction':_0x5500e3});});}else{_0x57a44e=0x194;_0x286b04=[];}});})[_0x0cda('0x25')](function(){if(_0x57a44e!==0x194){return db[_0x0cda('0x91')]['findAndCountAll']({'where':{'MailAccountId':_0x454075},'order':'priority'})[_0x0cda('0x25')](function(_0x3d6751){_0x286b04=_0x3d6751;});}})[_0x0cda('0x19')](function(_0xb48517){_0x57a44e=0x1f4;logger[_0x0cda('0x15')](_0xb48517['stack']);if(_0xb48517['name']){delete _0xb48517['name'];}_0x286b04=_0xb48517;})['finally'](function(){if(_0x286b04===null){_0x4be76e['sendStatus'](_0x57a44e);}else{if(_0x57a44e===0x1f4){_0x4be76e[_0x0cda('0x1b')](_0x57a44e)[_0x0cda('0x2c')](_0x286b04);}else{_0x4be76e[_0x0cda('0x1b')](_0x57a44e)[_0x0cda('0x1d')](_0x286b04);}}});};exports[_0x0cda('0x93')]=function(_0x415a59,_0x5af860){var _0x1c26c3={};var _0x3f4099={};var _0x37563e;var _0x15e053;return db[_0x0cda('0x48')][_0x0cda('0x72')]({'where':{'id':_0x415a59[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x5af860,null))['then'](function(_0x46f3f1){if(_0x46f3f1){_0x37563e=_0x46f3f1;_0x3f4099[_0x0cda('0x4a')]=_[_0x0cda('0x4c')](db[_0x0cda('0x91')][_0x0cda('0x68')]);_0x3f4099['query']=_['keys'](_0x415a59[_0x0cda('0x4b')]);_0x3f4099[_0x0cda('0x4d')]=_[_0x0cda('0x4e')](_0x3f4099[_0x0cda('0x4a')],_0x3f4099[_0x0cda('0x4b')]);_0x1c26c3['attributes']=_[_0x0cda('0x4e')](_0x3f4099[_0x0cda('0x4a')],qs[_0x0cda('0x4f')](_0x415a59['query']['fields']));_0x1c26c3[_0x0cda('0x50')]=_0x1c26c3[_0x0cda('0x50')][_0x0cda('0x51')]?_0x1c26c3[_0x0cda('0x50')]:_0x3f4099[_0x0cda('0x4a')];_0x1c26c3['order']=qs[_0x0cda('0x55')](_0x415a59['query']['sort']);_0x1c26c3['where']=qs[_0x0cda('0x4d')](_['pick'](_0x415a59[_0x0cda('0x4b')],_0x3f4099[_0x0cda('0x4d')]));if(_0x415a59[_0x0cda('0x4b')][_0x0cda('0x6a')]){_0x1c26c3[_0x0cda('0x56')]=_[_0x0cda('0x58')](_0x1c26c3[_0x0cda('0x56')],{'$or':_[_0x0cda('0x47')](_0x1c26c3[_0x0cda('0x50')],function(_0x3c8035){var _0xf3bbef={};_0xf3bbef[_0x3c8035]={'$like':'%'+_0x415a59['query'][_0x0cda('0x6a')]+'%'};return _0xf3bbef;})});}_0x1c26c3=_['merge']({},_0x1c26c3,_0x415a59[_0x0cda('0x87')]);return _0x37563e[_0x0cda('0x93')](_0x1c26c3);}})['then'](function(_0x7cf7a4){if(_0x7cf7a4){_0x15e053=_0x7cf7a4[_0x0cda('0x51')];if(!_0x415a59['query'][_0x0cda('0x52')](_0x0cda('0x53'))){_0x1c26c3['limit']=qs[_0x0cda('0x20')](_0x415a59[_0x0cda('0x4b')]['limit']);_0x1c26c3[_0x0cda('0x1e')]=qs[_0x0cda('0x1e')](_0x415a59['query'][_0x0cda('0x1e')]);}return _0x37563e[_0x0cda('0x93')](_0x1c26c3);}})['then'](function(_0x39fe5e){if(_0x39fe5e){return _0x39fe5e?{'count':_0x15e053,'rows':_0x39fe5e}:null;}})['then'](respondWithResult(_0x5af860,null))[_0x0cda('0x19')](handleError(_0x5af860,null));};exports[_0x0cda('0x94')]=function(_0x817990,_0x203444){var _0x8ea4a6={'raw':!![],'where':{}};var _0x53ce0b={};var _0xd880f0={'count':0x0,'rows':[]};return db[_0x0cda('0x48')]['findOne']({'where':{'id':_0x817990[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x203444,null))['then'](function(_0x4fbdd0){if(_0x4fbdd0){_0x53ce0b['model']=_[_0x0cda('0x4c')](db[_0x0cda('0x95')][_0x0cda('0x68')]);_0x53ce0b[_0x0cda('0x4b')]=_[_0x0cda('0x4c')](_0x817990[_0x0cda('0x4b')]);_0x53ce0b['filters']=_[_0x0cda('0x4e')](_0x53ce0b['model'],_0x53ce0b[_0x0cda('0x4b')]);_0x8ea4a6[_0x0cda('0x50')]=_[_0x0cda('0x4e')](_0x53ce0b[_0x0cda('0x4a')],qs['fields'](_0x817990[_0x0cda('0x4b')]['fields']));_0x8ea4a6['attributes']=_0x8ea4a6[_0x0cda('0x50')]['length']?_0x8ea4a6[_0x0cda('0x50')]:_0x53ce0b[_0x0cda('0x4a')];if(!_0x817990[_0x0cda('0x4b')]['hasOwnProperty'](_0x0cda('0x53'))){_0x8ea4a6['limit']=qs[_0x0cda('0x20')](_0x817990[_0x0cda('0x4b')]['limit']);_0x8ea4a6['offset']=qs[_0x0cda('0x1e')](_0x817990[_0x0cda('0x4b')][_0x0cda('0x1e')]);}_0x8ea4a6[_0x0cda('0x54')]=qs[_0x0cda('0x55')](_0x817990[_0x0cda('0x4b')]['sort']);_0x8ea4a6[_0x0cda('0x56')]=qs['filters'](_[_0x0cda('0x69')](_0x817990[_0x0cda('0x4b')],_0x53ce0b['filters']));_0x8ea4a6[_0x0cda('0x56')][_0x0cda('0x6f')]=_0x4fbdd0['id'];if(_0x817990[_0x0cda('0x4b')][_0x0cda('0x6a')]){_0x8ea4a6[_0x0cda('0x56')]=_[_0x0cda('0x58')](_0x8ea4a6[_0x0cda('0x56')],{'$or':_[_0x0cda('0x47')](_0x8ea4a6[_0x0cda('0x50')],function(_0x30734d){var _0x492b71={};_0x492b71[_0x30734d]={'$like':'%'+_0x817990['query'][_0x0cda('0x6a')]+'%'};return _0x492b71;})});}if(_0x817990[_0x0cda('0x4b')][_0x0cda('0x96')]){var _0x159235=_0x817990[_0x0cda('0x4b')][_0x0cda('0x96')][_0x0cda('0x97')](',');var _0x2e1b31={};_0x2e1b31[_0x159235[0x0]]={'$gte':moment(_0x159235[0x1])[_0x0cda('0x98')](_0x0cda('0x99'))};_0x8ea4a6['where']=_[_0x0cda('0x58')](_0x8ea4a6[_0x0cda('0x56')],_0x2e1b31);}_0x8ea4a6=_['merge']({},_0x8ea4a6,_0x817990['options']);return db[_0x0cda('0x95')][_0x0cda('0x21')]({'where':_0x8ea4a6[_0x0cda('0x56')]})[_0x0cda('0x25')](function(_0x43353d){_0xd880f0['count']=_0x43353d;if(_0x817990[_0x0cda('0x4b')][_0x0cda('0x6b')]){_0x8ea4a6[_0x0cda('0x5d')]=[{'all':!![]}];}return db[_0x0cda('0x95')][_0x0cda('0x59')](_0x8ea4a6);})[_0x0cda('0x25')](function(_0x511474){if(_0x817990[_0x0cda('0x4b')]['inlineCss']==='true'){for(var _0x52ad53=0x0;_0x52ad53<_0x511474[_0x0cda('0x51')];_0x52ad53++){_0x511474[_0x52ad53][_0x0cda('0x5f')]=juice(_0x511474[_0x52ad53][_0x0cda('0x5f')]);}}_0xd880f0[_0x0cda('0x5a')]=_0x511474;return _0xd880f0;});}})[_0x0cda('0x25')](respondWithFilteredResult(_0x203444,_0x8ea4a6))[_0x0cda('0x19')](handleError(_0x203444,null));};exports['send']=function(_0x20ba06,_0x153888){var _0x144437,_0x3c48c3={},_0x1f54a3;if(_0x20ba06[_0x0cda('0x5f')]['to']){_0x1f54a3=_0x20ba06[_0x0cda('0x5f')]['to']['split'](',')[0x0];}return db[_0x0cda('0x48')][_0x0cda('0x5e')]({'where':{'id':_0x20ba06['params']['id']},'include':[{'model':db['CmList'],'as':_0x0cda('0x9a'),'include':[{'model':db['CmContact'],'as':_0x0cda('0x9b'),'where':{'email':_0x1f54a3},'limit':0x1,'order':[[_0x0cda('0x9c'),_0x0cda('0x9d')]]}]},{'model':db[_0x0cda('0x5c')],'as':_0x0cda('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x0cda('0x9e'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x153888,null))[_0x0cda('0x25')](function(_0x225076){if(!_0x225076)return;_0x144437=_0x225076;if(!_0x225076['Smtp'])throw new Error(_0x0cda('0x9f'));if(_[_0x0cda('0x76')](_0x20ba06[_0x0cda('0x5f')]['from'])){_0x20ba06[_0x0cda('0x5f')][_0x0cda('0xa0')]=util['format'](_0x0cda('0xa1'),_0x225076[_0x0cda('0x2b')],_0x225076[_0x0cda('0x75')]||_0x225076['Smtp']['user']);}if(_0x20ba06[_0x0cda('0x5f')][_0x0cda('0xa2')]&&_0x20ba06[_0x0cda('0x5f')]['attachments'][_0x0cda('0x51')]){for(var _0x4fd169=0x0;_0x4fd169<_0x20ba06['body'][_0x0cda('0xa2')][_0x0cda('0x51')];_0x4fd169+=0x1){_0x20ba06[_0x0cda('0x5f')][_0x0cda('0xa2')][_0x4fd169]={'filename':_0x20ba06[_0x0cda('0x5f')][_0x0cda('0xa2')][_0x4fd169][_0x0cda('0x2b')],'path':path[_0x0cda('0xa3')](config['root'],_0x0cda('0xa4'),_0x20ba06[_0x0cda('0x5f')]['attachments'][_0x4fd169][_0x0cda('0xa5')])};}}var _0x343352=_0x225076['getSmtpOptions']();return respondWithRpcPromise(_0x0cda('0xa6'),'sendMail',{'account':_0x343352,'message':_0x20ba06[_0x0cda('0x5f')]});})[_0x0cda('0x25')](function(_0x3fe53e){if(!_0x3fe53e)return;_0x3c48c3=_0x3fe53e;if(!_0x144437[_0x0cda('0x9a')])throw new Error('List\x20not\x20found');if(_0x144437['List'][_0x0cda('0x9b')][_0x0cda('0x51')])return _0x144437[_0x0cda('0x9a')][_0x0cda('0x9b')][0x0];return db[_0x0cda('0xa7')][_0x0cda('0x70')](_[_0x0cda('0x9')](_0x20ba06['body'],{'firstName':_0x20ba06['body']['to'],'email':_0x20ba06['body']['to'],'phone':_0x20ba06[_0x0cda('0x5f')]['to'],'ListId':_0x144437[_0x0cda('0xa8')]}));})[_0x0cda('0x25')](function(_0xcda3ae){if(!_0xcda3ae)return;var _0x42c4db={'UserId':_0x20ba06[_0x0cda('0x37')]['id'],'ContactId':_0xcda3ae['id'],'MailAccountId':_0x144437['id'],'inReplyTo':_0x3c48c3['messageId'],'to':_0x20ba06[_0x0cda('0x5f')][_0x0cda('0xa0')],'cc':_0x20ba06[_0x0cda('0x5f')]['cc'],'subject':_0x20ba06[_0x0cda('0x5f')]['subject'],'attach':_0x20ba06[_0x0cda('0x5f')][_0x0cda('0xa9')],'firstMsgDirection':_0x0cda('0xaa'),'lastMsgAt':moment()[_0x0cda('0x98')](_0x0cda('0x99')),'lastMsgDirection':_0x0cda('0xaa'),'Messages':[_[_0x0cda('0x58')](_0x20ba06['body'],{'messageId':_0x3c48c3[_0x0cda('0xab')],'sentAt':moment()[_0x0cda('0x98')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x144437['id'],'UserId':_0x20ba06['user']['id'],'ContactId':_0xcda3ae['id']})]};if(_0x20ba06[_0x0cda('0x5f')]['Interaction']){_0x42c4db=_['merge'](_0x42c4db,_0x20ba06[_0x0cda('0x5f')][_0x0cda('0xac')]);}return db['MailInteraction'][_0x0cda('0x70')](_0x42c4db,{'include':[{'model':db[_0x0cda('0x95')],'as':_0x0cda('0xad')}]});})[_0x0cda('0x25')](respondWithResult(_0x153888,null))['catch'](handleError(_0x153888,null));};exports[_0x0cda('0xae')]=function(_0x3d2934,_0x47cac6){return db[_0x0cda('0x48')][_0x0cda('0x5e')]({'where':{'id':_0x3d2934[_0x0cda('0x5b')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x0cda('0x41'),'raw':!![],'include':[{'model':db[_0x0cda('0x9e')],'as':_0x0cda('0x9e'),'raw':!![]}]}]})[_0x0cda('0x25')](handleEntityNotFound(_0x47cac6,null))[_0x0cda('0x25')](function(_0x5903aa){if(!_0x5903aa[_0x0cda('0x41')])return;var _0x25bad2=_0x5903aa['getSmtpOptions']();return respondWithRpcPromise(_0x0cda('0xaf'),'verifySmtp',{'account':_0x25bad2});})[_0x0cda('0x25')](respondWithResult(_0x47cac6,null))[_0x0cda('0x19')](handleError(_0x47cac6,null));};exports['destroy']=function(_0x36ea0d,_0x227b41){return db[_0x0cda('0x48')][_0x0cda('0x5e')]({'where':{'id':_0x36ea0d[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x227b41,null))[_0x0cda('0x25')](function(_0x3016cd){if(_0x3016cd&&_0x3016cd[_0x0cda('0x3d')]){throw new db[(_0x0cda('0xb0'))][(_0x0cda('0xb1'))](_0x0cda('0xb2'));}return _0x3016cd;})['then'](removeEntity(_0x227b41,null))['catch'](handleError(_0x227b41,null));};exports['addAgents']=function(_0x18631d,_0x561ae7){return db[_0x0cda('0x48')][_0x0cda('0x5e')]({'where':{'id':_0x18631d[_0x0cda('0x5b')]['id']}})[_0x0cda('0x25')](handleEntityNotFound(_0x561ae7,null))[_0x0cda('0x25')](function(_0x1a4f5b){if(_0x1a4f5b){return _0x1a4f5b[_0x0cda('0xb3')](_0x18631d[_0x0cda('0x5f')][_0x0cda('0x6d')],_[_0x0cda('0x84')](_0x18631d[_0x0cda('0x5f')],['ids','id'])||{})[_0x0cda('0xb4')](function(_0x53af50){for(var _0x232c9e=0x0;_0x232c9e<_0x18631d[_0x0cda('0x5f')]['ids'][_0x0cda('0x51')];_0x232c9e+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x18631d['body'][_0x0cda('0x6d')][_0x232c9e]),'MailAccountId':Number(_0x18631d[_0x0cda('0x5b')]['id'])});}return _0x53af50;});}})[_0x0cda('0x25')](respondWithResult(_0x561ae7,null))['catch'](handleError(_0x561ae7,null));};exports[_0x0cda('0xb5')]=function(_0x5e98ee,_0x47b082){return db[_0x0cda('0x48')][_0x0cda('0x5e')]({'where':{'id':_0x5e98ee['params']['id']}})['then'](handleEntityNotFound(_0x47b082,null))[_0x0cda('0x25')](function(_0x3dd8c8){if(_0x3dd8c8){return _0x3dd8c8[_0x0cda('0xb5')](_0x5e98ee['query'][_0x0cda('0x6d')])['then'](function(){if(_[_0x0cda('0xb6')](_0x5e98ee[_0x0cda('0x4b')][_0x0cda('0x6d')])){for(var _0x20e1df=0x0;_0x20e1df<_0x5e98ee[_0x0cda('0x4b')]['ids'][_0x0cda('0x51')];_0x20e1df+=0x1){socket[_0x0cda('0xb7')](_0x0cda('0xb8'),{'UserId':Number(_0x5e98ee['query'][_0x0cda('0x6d')][_0x20e1df]),'MailAccountId':Number(_0x5e98ee['params']['id'])});}}else{socket[_0x0cda('0xb7')]('userMailAccount:remove',{'UserId':Number(_0x5e98ee[_0x0cda('0x4b')]['ids']),'MailAccountId':Number(_0x5e98ee['params']['id'])});}});}})[_0x0cda('0x25')](respondWithStatusCode(_0x47b082,null))[_0x0cda('0x19')](handleError(_0x47b082,null));};exports[_0x0cda('0xb9')]=function(_0x28485d,_0xd349df){var _0x29b41a={};var _0x147018={};var _0x35c8a4;var _0xc84fa8;return db[_0x0cda('0x48')][_0x0cda('0x72')]({'where':{'id':_0x28485d[_0x0cda('0x5b')]['id']}})['then'](handleEntityNotFound(_0xd349df,null))[_0x0cda('0x25')](function(_0x2dbb95){if(_0x2dbb95){_0x35c8a4=_0x2dbb95;_0x147018[_0x0cda('0x4a')]=_[_0x0cda('0x4c')](db['User'][_0x0cda('0x68')]);_0x147018[_0x0cda('0x4b')]=_[_0x0cda('0x4c')](_0x28485d['query']);_0x147018[_0x0cda('0x4d')]=_[_0x0cda('0x4e')](_0x147018['model'],_0x147018['query']);_0x29b41a[_0x0cda('0x50')]=_[_0x0cda('0x4e')](_0x147018[_0x0cda('0x4a')],qs[_0x0cda('0x4f')](_0x28485d[_0x0cda('0x4b')]['fields']));_0x29b41a[_0x0cda('0x50')]=_0x29b41a[_0x0cda('0x50')]['length']?_0x29b41a[_0x0cda('0x50')]:_0x147018[_0x0cda('0x4a')];_0x29b41a[_0x0cda('0x54')]=qs[_0x0cda('0x55')](_0x28485d[_0x0cda('0x4b')]['sort']);_0x29b41a[_0x0cda('0x56')]=qs[_0x0cda('0x4d')](_['pick'](_0x28485d[_0x0cda('0x4b')],_0x147018[_0x0cda('0x4d')]));if(_0x28485d[_0x0cda('0x4b')]['filter']){_0x29b41a[_0x0cda('0x56')]=_['merge'](_0x29b41a[_0x0cda('0x56')],{'$or':_['map'](_0x29b41a[_0x0cda('0x50')],function(_0x58f037){var _0xc6bb9b={};_0xc6bb9b[_0x58f037]={'$like':'%'+_0x28485d['query'][_0x0cda('0x6a')]+'%'};return _0xc6bb9b;})});}_0x29b41a=_[_0x0cda('0x58')]({},_0x29b41a,_0x28485d[_0x0cda('0x87')]);return _0x35c8a4[_0x0cda('0xb9')](_0x29b41a);}})[_0x0cda('0x25')](function(_0x2ad0a0){if(_0x2ad0a0){_0xc84fa8=_0x2ad0a0['length'];if(!_0x28485d[_0x0cda('0x4b')][_0x0cda('0x52')](_0x0cda('0x53'))){_0x29b41a[_0x0cda('0x20')]=qs['limit'](_0x28485d[_0x0cda('0x4b')][_0x0cda('0x20')]);_0x29b41a[_0x0cda('0x1e')]=qs[_0x0cda('0x1e')](_0x28485d[_0x0cda('0x4b')][_0x0cda('0x1e')]);}return _0x35c8a4['getAgents'](_0x29b41a);}})[_0x0cda('0x25')](function(_0x1d5f93){if(_0x1d5f93){return _0x1d5f93?{'count':_0xc84fa8,'rows':_0x1d5f93}:null;}})[_0x0cda('0x25')](respondWithResult(_0xd349df,null))[_0x0cda('0x19')](handleError(_0xd349df,null));}; \ No newline at end of file +var _0x662b=['map','VIRTUAL','merge','includeAll','include','rows','show','params','options','find','update','body','custom','Mail\x20Account\x20not\x20found','service','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','provider','email','ListId','isNil','active','description','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','internal','Tag','Tags','tag','addApplications','sequelize','Transaction','READ_COMMITTED','MailApplication','stack','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','emit','userMailAccount:remove','getAgents','bluebird','util','path','lodash','juice','../../components/parsers/qs','../../config/environment','../../mysqldb','defaults','localhost','redis','./mailAccount.socket','register','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset','limit','undefined','count','set','Content-Range','json','destroy','MailAccounts','sendStatus','name','send','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','gmail','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','password','pass','modernAuthentication','CloudProviderId','host','port','secure','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x3ab9e3,_0x28ce7e){var _0x431630=function(_0x3a4014){while(--_0x3a4014){_0x3ab9e3['push'](_0x3ab9e3['shift']());}};_0x431630(++_0x28ce7e);}(_0x662b,0x6e));var _0xb662=function(_0x20d3a0,_0x25d45a){_0x20d3a0=_0x20d3a0-0x0;var _0x5b1e56=_0x662b[_0x20d3a0];return _0x5b1e56;};'use strict';var moment=require('moment');var BPromise=require(_0xb662('0x0'));var util=require(_0xb662('0x1'));var path=require(_0xb662('0x2'));var _=require(_0xb662('0x3'));var juice=require(_0xb662('0x4'));var Redis=require('ioredis');var qs=require(_0xb662('0x5'));var logger=require('../../config/logger')('api');var config=require(_0xb662('0x6'));var db=require(_0xb662('0x7'))['db'];config['redis']=_[_0xb662('0x8')](config['redis'],{'host':_0xb662('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb662('0xa')]));require(_0xb662('0xb'))[_0xb662('0xc')](socket);var jayson=require(_0xb662('0xd'));var client=jayson[_0xb662('0xe')][_0xb662('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x179489,_0x1f146a,_0x3df9d0,_0x2faee1){return new BPromise(function(_0x5d553a,_0x34190a){var _0x523826=_0x2faee1||client;return _0x523826['request'](_0x179489,_0x3df9d0)[_0xb662('0x10')](function(_0x4d45d6){logger[_0xb662('0x11')](_0xb662('0x12'),_0x1f146a,_0xb662('0x13'));logger[_0xb662('0x14')](_0xb662('0x15'),_0x1f146a,_0xb662('0x13'),JSON[_0xb662('0x16')](_0x4d45d6));if(_0x4d45d6[_0xb662('0x17')]){if(_0x4d45d6[_0xb662('0x17')][_0xb662('0x18')]===0x1f4){logger['error'](_0xb662('0x12'),_0x1f146a,_0x4d45d6['error'][_0xb662('0x19')]);return _0x34190a(_0x4d45d6[_0xb662('0x17')][_0xb662('0x19')]);}logger[_0xb662('0x17')]('MailAccount,\x20%s,\x20%s',_0x1f146a,_0x4d45d6[_0xb662('0x17')]['message']);return _0x5d553a(_0x4d45d6[_0xb662('0x17')]['message']);}else{logger[_0xb662('0x11')](_0xb662('0x12'),_0x1f146a,'request\x20sent');_0x5d553a(_0x4d45d6[_0xb662('0x1a')][_0xb662('0x19')]);}})[_0xb662('0x1b')](function(_0x8a7575){logger['error']('MailAccount,\x20%s,\x20%s',_0x1f146a,_0x8a7575);_0x34190a(_0x8a7575);});});}function respondWithStatusCode(_0x28bd08,_0x1983fc){_0x1983fc=_0x1983fc||0xcc;return function(_0x55d765){if(_0x55d765){return _0x28bd08['sendStatus'](_0x1983fc);}return _0x28bd08[_0xb662('0x1c')](_0x1983fc)[_0xb662('0x1d')]();};}function respondWithResult(_0xf7594d,_0x2f4ea3){_0x2f4ea3=_0x2f4ea3||0xc8;return function(_0x2f0300){if(_0x2f0300){return _0xf7594d[_0xb662('0x1c')](_0x2f4ea3)['json'](_0x2f0300);}};}function respondWithFilteredResult(_0x161924,_0x265e2d){return function(_0x1f1f2d){if(_0x1f1f2d){var _0x4dc1fe=typeof _0x265e2d[_0xb662('0x1e')]==='undefined'&&typeof _0x265e2d[_0xb662('0x1f')]===_0xb662('0x20');var _0x4677a8=_0x1f1f2d[_0xb662('0x21')];var _0x55d1c3=_0x4dc1fe?0x0:_0x265e2d['offset'];var _0xc1b99f=_0x4dc1fe?_0x1f1f2d[_0xb662('0x21')]:_0x265e2d[_0xb662('0x1e')]+_0x265e2d['limit'];var _0x314c6a;if(_0xc1b99f>=_0x4677a8){_0xc1b99f=_0x4677a8;_0x314c6a=0xc8;}else{_0x314c6a=0xce;}_0x161924['status'](_0x314c6a);return _0x161924[_0xb662('0x22')](_0xb662('0x23'),_0x55d1c3+'-'+_0xc1b99f+'/'+_0x4677a8)[_0xb662('0x24')](_0x1f1f2d);}return null;};}function saveUpdates(_0x9c1eef){return function(_0xcee750){if(_0xcee750){return _0xcee750['update'](_0x9c1eef)[_0xb662('0x10')](function(_0x46d0f2){return _0x46d0f2;});}return null;};}function removeEntity(_0x1a2a02){return function(_0x54cc13){if(_0x54cc13){return _0x54cc13[_0xb662('0x25')]()[_0xb662('0x10')](function(){var _0x193882=_0x54cc13['get']({'plain':!![]});var _0x1f8894=_0xb662('0x26');return db['UserProfileResource'][_0xb662('0x25')]({'where':{'type':_0x1f8894,'resourceId':_0x193882['id']}})[_0xb662('0x10')](function(){return _0x54cc13;});})[_0xb662('0x10')](function(){_0x1a2a02['status'](0xcc)[_0xb662('0x1d')]();});}};}function handleEntityNotFound(_0x1072ef){return function(_0x94e310){if(!_0x94e310){_0x1072ef[_0xb662('0x27')](0x194);}return _0x94e310;};}function handleError(_0x6aaf93,_0x15bbc0){_0x15bbc0=_0x15bbc0||0x1f4;return function(_0x4bfc43){logger[_0xb662('0x17')](_0x4bfc43['stack']);if(_0x4bfc43[_0xb662('0x28')]){delete _0x4bfc43[_0xb662('0x28')];}_0x6aaf93['status'](_0x15bbc0)[_0xb662('0x29')](_0x4bfc43);};}function getImapHost(_0x10908d){switch(_0x10908d){case'gmail':return _0xb662('0x2a');case'yahoo':return _0xb662('0x2b');case _0xb662('0x2c'):return _0xb662('0x2d');case _0xb662('0x2e'):return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x10908d);}function getSmtpHost(_0x277e8e){switch(_0x277e8e){case _0xb662('0x2f'):return _0xb662('0x30');case _0xb662('0x31'):return _0xb662('0x32');case _0xb662('0x2c'):return _0xb662('0x33');case _0xb662('0x2e'):return _0xb662('0x34');}throw new Error(_0xb662('0x35'),_0x277e8e);}function getAuthenticationOptions(_0x2a4f5b,_0x2420df){var _0x26bd2c={};var _0x3713ac={};if(_0x2a4f5b){_0x26bd2c[_0xb662('0x36')]=_0x3713ac['user']=_0x2420df['username'];_0x26bd2c[_0xb662('0x37')]=_0x3713ac[_0xb662('0x38')]=_0x2420df[_0xb662('0x37')];if(_0x2420df['modernAuthentication']){_0x26bd2c[_0xb662('0x39')]=_0x3713ac[_0xb662('0x39')]=!![];_0x26bd2c['CloudProviderId']=_0x3713ac[_0xb662('0x3a')]=_0x2420df[_0xb662('0x3a')];_0x26bd2c[_0xb662('0x37')]=_0x3713ac[_0xb662('0x38')]=null;}else{_0x26bd2c['CloudProviderId']=_0x3713ac[_0xb662('0x3a')]=null;}_0x26bd2c[_0xb662('0x3b')]=getImapHost(_0x2a4f5b);_0x26bd2c[_0xb662('0x3c')]=0x3e1;_0x3713ac[_0xb662('0x3b')]=getSmtpHost(_0x2a4f5b);_0x3713ac[_0xb662('0x3c')]=0x24b;_0x3713ac[_0xb662('0x3d')]=![];_0x26bd2c['service']=_0x3713ac['service']=null;}else{if(_0x2420df[_0xb662('0x3e')]){_0x26bd2c[_0xb662('0x36')]=_0x3713ac['user']=_0x2420df['username'];_0x26bd2c[_0xb662('0x37')]=_0x3713ac[_0xb662('0x38')]=_0x2420df[_0xb662('0x37')];}else{_0x26bd2c[_0xb662('0x3e')]=_0x3713ac[_0xb662('0x3e')]=![];_0x26bd2c[_0xb662('0x36')]=_0x3713ac[_0xb662('0x36')]=null;_0x26bd2c[_0xb662('0x37')]=_0x3713ac[_0xb662('0x38')]=null;}_0x26bd2c[_0xb662('0x3b')]=_0x2420df[_0xb662('0x3f')][_0xb662('0x3b')];_0x26bd2c[_0xb662('0x3c')]=_0x2420df['Imap'][_0xb662('0x3c')];_0x3713ac['host']=_0x2420df['Smtp'][_0xb662('0x3b')];_0x3713ac[_0xb662('0x3c')]=_0x2420df[_0xb662('0x40')][_0xb662('0x3c')];}return{'Imap':_0x26bd2c,'Smtp':_0x3713ac};}exports[_0xb662('0x41')]=function(_0xb00cf5,_0x3ea228){var _0x6cdc36={'include':[{'model':db[_0xb662('0x42')],'as':'Imap'},{'model':db[_0xb662('0x43')],'as':'Smtp'},{'model':db[_0xb662('0x44')],'as':_0xb662('0x45')}]},_0xdb90bb={},_0x199e59={'count':0x0,'rows':[]};var _0x4192ee=_['map'](db[_0xb662('0x46')][_0xb662('0x47')],function(_0x45607d){return{'name':_0x45607d[_0xb662('0x48')],'type':_0x45607d[_0xb662('0x49')][_0xb662('0x4a')]};});_0xdb90bb['model']=_['map'](_0x4192ee,_0xb662('0x28'));_0xdb90bb[_0xb662('0x4b')]=_[_0xb662('0x4c')](_0xb00cf5[_0xb662('0x4b')]);_0xdb90bb[_0xb662('0x4d')]=_[_0xb662('0x4e')](_0xdb90bb[_0xb662('0x4f')],_0xdb90bb[_0xb662('0x4b')]);_0x6cdc36[_0xb662('0x50')]=_[_0xb662('0x4e')](_0xdb90bb[_0xb662('0x4f')],qs[_0xb662('0x51')](_0xb00cf5['query']['fields']));_0x6cdc36[_0xb662('0x50')]=_0x6cdc36['attributes'][_0xb662('0x52')]?_0x6cdc36['attributes']:_0xdb90bb[_0xb662('0x4f')];if(!_0xb00cf5[_0xb662('0x4b')][_0xb662('0x53')](_0xb662('0x54'))){_0x6cdc36['limit']=qs[_0xb662('0x1f')](_0xb00cf5['query'][_0xb662('0x1f')]);_0x6cdc36[_0xb662('0x1e')]=qs[_0xb662('0x1e')](_0xb00cf5[_0xb662('0x4b')]['offset']);}_0x6cdc36[_0xb662('0x55')]=qs[_0xb662('0x56')](_0xb00cf5[_0xb662('0x4b')][_0xb662('0x56')]);_0x6cdc36['where']=qs[_0xb662('0x4d')](_['pick'](_0xb00cf5[_0xb662('0x4b')],_0xdb90bb[_0xb662('0x4d')]),_0x4192ee);if(_0xb00cf5['query'][_0xb662('0x57')]){_0x6cdc36[_0xb662('0x58')]=_['merge'](_0x6cdc36[_0xb662('0x58')],{'$or':_[_0xb662('0x59')](_0x4192ee,function(_0x550c6e){if(_0x550c6e[_0xb662('0x49')]!==_0xb662('0x5a')){var _0x28601f={};_0x28601f[_0x550c6e[_0xb662('0x28')]]={'$like':'%'+_0xb00cf5['query'][_0xb662('0x57')]+'%'};return _0x28601f;}})});}_0x6cdc36=_[_0xb662('0x5b')]({},_0x6cdc36,_0xb00cf5['options']);var _0x5901f3={'where':_0x6cdc36[_0xb662('0x58')]};return db['MailAccount'][_0xb662('0x21')](_0x5901f3)[_0xb662('0x10')](function(_0x45f53b){_0x199e59[_0xb662('0x21')]=_0x45f53b;if(_0xb00cf5[_0xb662('0x4b')][_0xb662('0x5c')]){_0x6cdc36[_0xb662('0x5d')]=[{'all':!![]}];}return db[_0xb662('0x46')]['findAll'](_0x6cdc36);})['then'](function(_0x7365b3){_0x199e59[_0xb662('0x5e')]=_0x7365b3;return _0x199e59;})[_0xb662('0x10')](respondWithFilteredResult(_0x3ea228,_0x6cdc36))[_0xb662('0x1b')](handleError(_0x3ea228,null));};exports[_0xb662('0x5f')]=function(_0x252f4d,_0x103cc1){var _0x211d4a={'raw':![],'where':{'id':_0x252f4d[_0xb662('0x60')]['id']},'include':[{'model':db[_0xb662('0x42')],'as':'Imap'},{'model':db[_0xb662('0x43')],'as':_0xb662('0x40')},{'model':db['Pause'],'as':_0xb662('0x45')}]},_0x10cbc9={};_0x10cbc9['model']=_[_0xb662('0x4c')](db[_0xb662('0x46')][_0xb662('0x47')]);_0x10cbc9[_0xb662('0x4b')]=_[_0xb662('0x4c')](_0x252f4d[_0xb662('0x4b')]);_0x10cbc9[_0xb662('0x4d')]=_[_0xb662('0x4e')](_0x10cbc9[_0xb662('0x4f')],_0x10cbc9[_0xb662('0x4b')]);_0x211d4a['attributes']=_[_0xb662('0x4e')](_0x10cbc9[_0xb662('0x4f')],qs[_0xb662('0x51')](_0x252f4d[_0xb662('0x4b')][_0xb662('0x51')]));_0x211d4a[_0xb662('0x50')]=_0x211d4a[_0xb662('0x50')][_0xb662('0x52')]?_0x211d4a['attributes']:_0x10cbc9['model'];if(_0x252f4d['query'][_0xb662('0x5c')]){_0x211d4a['include']=[{'all':!![]}];}_0x211d4a=_[_0xb662('0x5b')]({},_0x211d4a,_0x252f4d[_0xb662('0x61')]);return db[_0xb662('0x46')][_0xb662('0x62')](_0x211d4a)[_0xb662('0x10')](handleEntityNotFound(_0x103cc1,null))[_0xb662('0x10')](respondWithResult(_0x103cc1,null))[_0xb662('0x1b')](handleError(_0x103cc1,null));};exports[_0xb662('0x63')]=function(_0x2f58de,_0x11fa0b){if(_0x2f58de[_0xb662('0x64')]['id']){delete _0x2f58de[_0xb662('0x64')]['id'];}var _0x34c725=_0x2f58de[_0xb662('0x64')]['provider']===_0xb662('0x65')?null:_0x2f58de['body']['provider'];var _0x3c2e3a=_0x2f58de[_0xb662('0x64')][_0xb662('0x3f')]||{};var _0x4d8b3e=_0x2f58de['body'][_0xb662('0x40')]||{};if(_0x34c725){_0x3c2e3a[_0xb662('0x3b')]=getImapHost(_0x34c725);_0x3c2e3a['port']=0x3e1;_0x4d8b3e['host']=getSmtpHost(_0x34c725);_0x4d8b3e[_0xb662('0x3c')]=0x24b;_0x4d8b3e['secure']=![];}if(_0x4d8b3e[_0xb662('0x39')]){_0x4d8b3e[_0xb662('0x3d')]=![];}else{_0x4d8b3e[_0xb662('0x3a')]=null;}if(!_0x3c2e3a['modernAuthentication'])_0x3c2e3a['CloudProviderId']=null;_0x2f58de[_0xb662('0x64')][_0xb662('0x3f')]=_0x3c2e3a;_0x2f58de[_0xb662('0x64')][_0xb662('0x40')]=_0x4d8b3e;return db['MailAccount'][_0xb662('0x62')]({'where':{'id':_0x2f58de[_0xb662('0x60')]['id']},'include':[{'model':db[_0xb662('0x42')],'as':_0xb662('0x3f')},{'model':db[_0xb662('0x43')],'as':_0xb662('0x40')},{'model':db[_0xb662('0x44')],'as':_0xb662('0x45')}]})[_0xb662('0x10')](handleEntityNotFound(_0x11fa0b,null))[_0xb662('0x10')](function(_0x50833b){if(!_0x50833b)throw new Error(_0xb662('0x66'));if(_0x50833b[_0xb662('0x67')])delete _0x2f58de['body']['Imap'];return _0x50833b;})[_0xb662('0x10')](saveUpdates(_0x2f58de[_0xb662('0x64')],null))[_0xb662('0x10')](function(_0x34a82a){if(!_0x2f58de[_0xb662('0x64')][_0xb662('0x3f')])return _0x34a82a;return db[_0xb662('0x42')]['update'](_0x2f58de[_0xb662('0x64')][_0xb662('0x3f')],{'where':{'MailAccountId':_0x34a82a['id']}})[_0xb662('0x10')](function(){return _0x34a82a;});})[_0xb662('0x10')](function(_0x27c4d3){if(!_0x2f58de[_0xb662('0x64')][_0xb662('0x40')])return _0x27c4d3;return db[_0xb662('0x43')]['update'](_0x2f58de[_0xb662('0x64')][_0xb662('0x40')],{'where':{'MailAccountId':_0x27c4d3['id']}})[_0xb662('0x10')](function(){return _0x27c4d3;});})[_0xb662('0x10')](respondWithResult(_0x11fa0b,null))[_0xb662('0x1b')](handleError(_0x11fa0b,null));};exports[_0xb662('0x68')]=function(_0x107064,_0x1469da){return db[_0xb662('0x46')][_0xb662('0x68')]()[_0xb662('0x10')](respondWithResult(_0x1469da,null))[_0xb662('0x1b')](handleError(_0x1469da,null));};exports[_0xb662('0x69')]=function(_0x272a3a,_0x3dc604){if(_0x272a3a[_0xb662('0x64')]['id']){delete _0x272a3a[_0xb662('0x64')]['id'];}return db['MailAccount'][_0xb662('0x62')]({'where':{'id':_0x272a3a['params']['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x3dc604,null))[_0xb662('0x10')](function(_0x641350){if(_0x641350){_0x272a3a[_0xb662('0x64')][_0xb662('0x6a')]=_0x641350['id'];return db[_0xb662('0x6b')][_0xb662('0x6c')](_0x272a3a[_0xb662('0x64')]);}})[_0xb662('0x10')](respondWithResult(_0x3dc604,null))[_0xb662('0x1b')](handleError(_0x3dc604,null));};exports[_0xb662('0x6d')]=function(_0x2cd7ac,_0x9576ee){var _0x14ec0c={'raw':![],'where':{}};var _0x8211a0={};var _0x423176={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x2cd7ac[_0xb662('0x60')]['id']}})['then'](handleEntityNotFound(_0x9576ee,null))[_0xb662('0x10')](function(_0x50386e){if(_0x50386e){_0x8211a0[_0xb662('0x4f')]=_[_0xb662('0x4c')](db[_0xb662('0x6b')]['rawAttributes']);_0x8211a0[_0xb662('0x4b')]=_[_0xb662('0x4c')](_0x2cd7ac['query']);_0x8211a0[_0xb662('0x4d')]=_[_0xb662('0x4e')](_0x8211a0[_0xb662('0x4f')],_0x8211a0['query']);_0x14ec0c[_0xb662('0x50')]=_[_0xb662('0x4e')](_0x8211a0[_0xb662('0x4f')],qs[_0xb662('0x51')](_0x2cd7ac[_0xb662('0x4b')][_0xb662('0x51')]));_0x14ec0c['attributes']=_0x14ec0c['attributes'][_0xb662('0x52')]?_0x14ec0c[_0xb662('0x50')]:_0x8211a0[_0xb662('0x4f')];if(!_0x2cd7ac['query'][_0xb662('0x53')]('nolimit')){_0x14ec0c[_0xb662('0x1f')]=qs[_0xb662('0x1f')](_0x2cd7ac['query'][_0xb662('0x1f')]);_0x14ec0c[_0xb662('0x1e')]=qs[_0xb662('0x1e')](_0x2cd7ac[_0xb662('0x4b')]['offset']);}_0x14ec0c[_0xb662('0x55')]=qs[_0xb662('0x56')](_0x2cd7ac[_0xb662('0x4b')][_0xb662('0x56')]);_0x14ec0c['where']=qs[_0xb662('0x4d')](_[_0xb662('0x6e')](_0x2cd7ac[_0xb662('0x4b')],_0x8211a0[_0xb662('0x4d')]));_0x14ec0c['where'][_0xb662('0x6a')]=_0x50386e['id'];if(_0x2cd7ac[_0xb662('0x4b')][_0xb662('0x57')]){_0x14ec0c[_0xb662('0x58')]=_[_0xb662('0x5b')](_0x14ec0c['where'],{'$or':_[_0xb662('0x59')](_0x14ec0c[_0xb662('0x50')],function(_0x483a9c){var _0x340230={};_0x340230[_0x483a9c]={'$like':'%'+_0x2cd7ac[_0xb662('0x4b')][_0xb662('0x57')]+'%'};return _0x340230;})});}_0x14ec0c=_['merge']({},_0x14ec0c,_0x2cd7ac[_0xb662('0x61')]);return db[_0xb662('0x6b')]['count']({'where':_0x14ec0c[_0xb662('0x58')]})[_0xb662('0x10')](function(_0x54b2ad){_0x423176[_0xb662('0x21')]=_0x54b2ad;if(_0x2cd7ac[_0xb662('0x4b')][_0xb662('0x5c')]){_0x14ec0c[_0xb662('0x5d')]=[{'all':!![]}];}return db['Disposition'][_0xb662('0x6f')](_0x14ec0c);})['then'](function(_0x31e3b9){_0x423176[_0xb662('0x5e')]=_0x31e3b9;return _0x423176;});}})[_0xb662('0x10')](respondWithFilteredResult(_0x9576ee,_0x14ec0c))['catch'](handleError(_0x9576ee,null));};exports[_0xb662('0x70')]=function(_0x1ee686,_0x260142){return db[_0xb662('0x46')][_0xb662('0x62')]({'where':{'id':_0x1ee686[_0xb662('0x60')]['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x260142,null))[_0xb662('0x10')](function(_0xe06588){if(_0xe06588){return _0xe06588[_0xb662('0x70')](_0x1ee686[_0xb662('0x4b')][_0xb662('0x71')]);}})['then'](respondWithStatusCode(_0x260142,null))[_0xb662('0x1b')](handleError(_0x260142,null));};exports[_0xb662('0x72')]=function(_0xb36c65,_0x4b54fc){if(_0xb36c65[_0xb662('0x64')]['id']){delete _0xb36c65[_0xb662('0x64')]['id'];}return db[_0xb662('0x46')][_0xb662('0x62')]({'where':{'id':_0xb36c65[_0xb662('0x60')]['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x4b54fc,null))[_0xb662('0x10')](function(_0x2c4f15){if(_0x2c4f15){_0xb36c65[_0xb662('0x64')]['MailAccountId']=_0x2c4f15['id'];return db[_0xb662('0x73')][_0xb662('0x6c')](_0xb36c65[_0xb662('0x64')]);}})[_0xb662('0x10')](respondWithResult(_0x4b54fc,null))['catch'](handleError(_0x4b54fc,null));};exports['getAnswers']=function(_0x175575,_0x3f55ab){var _0x710e03={'raw':![],'where':{}};var _0x56e14f={};var _0x522675={'count':0x0,'rows':[]};return db[_0xb662('0x46')]['findOne']({'where':{'id':_0x175575[_0xb662('0x60')]['id']}})['then'](handleEntityNotFound(_0x3f55ab,null))[_0xb662('0x10')](function(_0x502ae4){if(_0x502ae4){_0x56e14f[_0xb662('0x4f')]=_['keys'](db[_0xb662('0x73')][_0xb662('0x47')]);_0x56e14f[_0xb662('0x4b')]=_[_0xb662('0x4c')](_0x175575[_0xb662('0x4b')]);_0x56e14f[_0xb662('0x4d')]=_[_0xb662('0x4e')](_0x56e14f[_0xb662('0x4f')],_0x56e14f[_0xb662('0x4b')]);_0x710e03[_0xb662('0x50')]=_[_0xb662('0x4e')](_0x56e14f[_0xb662('0x4f')],qs['fields'](_0x175575[_0xb662('0x4b')][_0xb662('0x51')]));_0x710e03[_0xb662('0x50')]=_0x710e03['attributes'][_0xb662('0x52')]?_0x710e03[_0xb662('0x50')]:_0x56e14f[_0xb662('0x4f')];if(!_0x175575[_0xb662('0x4b')][_0xb662('0x53')](_0xb662('0x54'))){_0x710e03[_0xb662('0x1f')]=qs['limit'](_0x175575[_0xb662('0x4b')][_0xb662('0x1f')]);_0x710e03['offset']=qs[_0xb662('0x1e')](_0x175575['query'][_0xb662('0x1e')]);}_0x710e03[_0xb662('0x55')]=qs[_0xb662('0x56')](_0x175575[_0xb662('0x4b')][_0xb662('0x56')]);_0x710e03[_0xb662('0x58')]=qs[_0xb662('0x4d')](_[_0xb662('0x6e')](_0x175575['query'],_0x56e14f[_0xb662('0x4d')]));_0x710e03[_0xb662('0x58')][_0xb662('0x6a')]=_0x502ae4['id'];if(_0x175575[_0xb662('0x4b')][_0xb662('0x57')]){_0x710e03[_0xb662('0x58')]=_['merge'](_0x710e03[_0xb662('0x58')],{'$or':_['map'](_0x710e03[_0xb662('0x50')],function(_0x1eca9c){var _0x52999f={};_0x52999f[_0x1eca9c]={'$like':'%'+_0x175575[_0xb662('0x4b')][_0xb662('0x57')]+'%'};return _0x52999f;})});}_0x710e03=_['merge']({},_0x710e03,_0x175575['options']);return db[_0xb662('0x73')][_0xb662('0x21')]({'where':_0x710e03[_0xb662('0x58')]})[_0xb662('0x10')](function(_0x10a6b1){_0x522675['count']=_0x10a6b1;if(_0x175575[_0xb662('0x4b')][_0xb662('0x5c')]){_0x710e03[_0xb662('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb662('0x6f')](_0x710e03);})[_0xb662('0x10')](function(_0x596f53){_0x522675['rows']=_0x596f53;return _0x522675;});}})['then'](respondWithFilteredResult(_0x3f55ab,_0x710e03))[_0xb662('0x1b')](handleError(_0x3f55ab,null));};exports[_0xb662('0x74')]=function(_0x19447a,_0x174e49){return db[_0xb662('0x46')]['find']({'where':{'id':_0x19447a[_0xb662('0x60')]['id']}})['then'](handleEntityNotFound(_0x174e49,null))['then'](function(_0x2434a6){if(_0x2434a6){return _0x2434a6[_0xb662('0x74')](_0x19447a[_0xb662('0x4b')]['ids']);}})['then'](respondWithStatusCode(_0x174e49,null))[_0xb662('0x1b')](handleError(_0x174e49,null));};exports[_0xb662('0x6c')]=function(_0x3fcd6f,_0xe50d97){var _0x16b4c9={'name':_0x3fcd6f[_0xb662('0x64')][_0xb662('0x28')],'key':_0x3fcd6f[_0xb662('0x64')][_0xb662('0x4a')],'provider':_0x3fcd6f[_0xb662('0x64')][_0xb662('0x75')]===_0xb662('0x65')?null:_0x3fcd6f[_0xb662('0x64')]['provider'],'email':_0x3fcd6f[_0xb662('0x64')][_0xb662('0x76')],'ListId':_0x3fcd6f[_0xb662('0x64')][_0xb662('0x77')],'active':!_[_0xb662('0x78')](_0x3fcd6f['body'][_0xb662('0x79')])?_0x3fcd6f['body']['active']:!![],'description':_0x3fcd6f[_0xb662('0x64')][_0xb662('0x7a')]||null};var _0x5a99c0=getAuthenticationOptions(_0x16b4c9['provider'],_0x3fcd6f[_0xb662('0x64')]);_0x16b4c9[_0xb662('0x3f')]=_0x5a99c0[_0xb662('0x3f')];_0x16b4c9[_0xb662('0x40')]=_0x5a99c0[_0xb662('0x40')];return db[_0xb662('0x46')][_0xb662('0x6c')](_0x16b4c9,{'include':[{'model':db[_0xb662('0x43')],'as':_0xb662('0x40')},{'model':db[_0xb662('0x42')],'as':_0xb662('0x3f')}]})[_0xb662('0x10')](function(_0x5ce4ed){var _0x20c2de=_0x3fcd6f[_0xb662('0x36')][_0xb662('0x7b')]({'plain':!![]});if(!_0x20c2de)throw new Error(_0xb662('0x7c'));if(_0x20c2de[_0xb662('0x7d')]===_0xb662('0x36')){var _0x557773=_0x5ce4ed['get']({'plain':!![]});return db[_0xb662('0x7e')]['find']({'where':{'name':_0xb662('0x26'),'userProfileId':_0x20c2de[_0xb662('0x7f')]},'raw':!![]})['then'](function(_0x1414c8){if(_0x1414c8&&_0x1414c8[_0xb662('0x80')]===0x0){return db['UserProfileResource'][_0xb662('0x6c')]({'name':_0x557773['name'],'resourceId':_0x557773['id'],'type':_0x1414c8[_0xb662('0x28')],'sectionId':_0x1414c8['id']},{})[_0xb662('0x10')](function(){return _0x5ce4ed;});}else{return _0x5ce4ed;}})[_0xb662('0x1b')](function(_0x3d6b1f){logger['error'](_0xb662('0x81'),_0x3d6b1f);throw _0x3d6b1f;});}return _0x5ce4ed;})['then'](respondWithResult(_0xe50d97,0xc9))['catch'](handleError(_0xe50d97,null));};exports[_0xb662('0x82')]=function(_0x18d63a,_0x4b2bc9){return db[_0xb662('0x46')][_0xb662('0x83')]({'where':{'id':_0x18d63a[_0xb662('0x60')]['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x4b2bc9,null))[_0xb662('0x10')](function(_0xe302e9){if(_0xe302e9){return _0xe302e9[_0xb662('0x82')]();}return null;})[_0xb662('0x10')](respondWithResult(_0x4b2bc9,null))['catch'](handleError(_0x4b2bc9,null));};exports[_0xb662('0x84')]=function(_0x2ce5ea,_0x551be9){if(_0x2ce5ea[_0xb662('0x64')]['id']){delete _0x2ce5ea[_0xb662('0x64')]['id'];}return db[_0xb662('0x46')][_0xb662('0x62')]({'where':{'id':_0x2ce5ea['params']['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x551be9,null))['then'](function(_0x52576c){if(_0x52576c){_0x2ce5ea[_0xb662('0x64')]['MailAccountId']=_0x52576c['id'];return db[_0xb662('0x42')][_0xb662('0x6c')](_0x2ce5ea['body']);}})['then'](respondWithResult(_0x551be9,null))[_0xb662('0x1b')](handleError(_0x551be9,null));};exports[_0xb662('0x85')]=function(_0x429140,_0x3fd4c0){return db[_0xb662('0x46')][_0xb662('0x83')]({'where':{'id':_0x429140[_0xb662('0x60')]['id']}})['then'](handleEntityNotFound(_0x3fd4c0,null))['then'](function(_0x53a66f){if(_0x53a66f){return _0x53a66f[_0xb662('0x86')](null);}return null;})[_0xb662('0x10')](respondWithStatusCode(_0x3fd4c0,null))['catch'](handleError(_0x3fd4c0,null));};exports[_0xb662('0x87')]=function(_0x426646,_0x517b22){return db[_0xb662('0x46')][_0xb662('0x83')]({'where':{'id':_0x426646[_0xb662('0x60')]['id']}})['then'](handleEntityNotFound(_0x517b22,null))[_0xb662('0x10')](function(_0x5a24d7){if(_0x5a24d7){return _0x5a24d7[_0xb662('0x87')]();}return null;})[_0xb662('0x10')](respondWithResult(_0x517b22,null))['catch'](handleError(_0x517b22,null));};exports[_0xb662('0x88')]=function(_0x2f564c,_0x2c3f85){if(_0x2f564c[_0xb662('0x64')]['id']){delete _0x2f564c[_0xb662('0x64')]['id'];}return db[_0xb662('0x46')]['find']({'where':{'id':_0x2f564c['params']['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x2c3f85,null))[_0xb662('0x10')](function(_0x3af33f){if(_0x3af33f){_0x2f564c[_0xb662('0x64')][_0xb662('0x6a')]=_0x3af33f['id'];return db[_0xb662('0x43')]['create'](_0x2f564c['body']);}})['then'](respondWithResult(_0x2c3f85,null))['catch'](handleError(_0x2c3f85,null));};exports[_0xb662('0x89')]=function(_0x5b70f1,_0x143133){return db[_0xb662('0x46')][_0xb662('0x83')]({'where':{'id':_0x5b70f1['params']['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x143133,null))[_0xb662('0x10')](function(_0xc2d279){if(_0xc2d279){return _0xc2d279['setSmtp'](null);}return null;})[_0xb662('0x10')](respondWithStatusCode(_0x143133,null))[_0xb662('0x1b')](handleError(_0x143133,null));};exports[_0xb662('0x8a')]=function(_0x548123,_0x46e86d){return db[_0xb662('0x8b')][_0xb662('0x62')]({'where':{'id':_0x548123[_0xb662('0x60')]['id']}})['then'](handleEntityNotFound(_0x46e86d,null))[_0xb662('0x10')](function(_0xdf811c){if(_0xdf811c){return _0xdf811c[_0xb662('0x8a')](_0x548123[_0xb662('0x64')][_0xb662('0x71')],_[_0xb662('0x8c')](_0x548123['body'],[_0xb662('0x71'),'id'])||{});}})['then'](respondWithResult(_0x46e86d,null))[_0xb662('0x1b')](handleError(_0x46e86d,null));};exports[_0xb662('0x8d')]=function(_0x316d48,_0x14d9df){var _0x157e0f={'raw':![],'where':{}};var _0x42a36c={};var _0xe745={'count':0x0,'rows':[]};return db['MailAccount'][_0xb662('0x83')]({'where':{'id':_0x316d48[_0xb662('0x60')]['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x14d9df,null))[_0xb662('0x10')](function(_0x4880f9){if(_0x4880f9){_0x42a36c['model']=_[_0xb662('0x4c')](db[_0xb662('0x8b')][_0xb662('0x47')]);_0x42a36c['query']=_['keys'](_0x316d48[_0xb662('0x4b')]);_0x42a36c[_0xb662('0x4d')]=_[_0xb662('0x4e')](_0x42a36c[_0xb662('0x4f')],_0x42a36c[_0xb662('0x4b')]);_0x157e0f['attributes']=_[_0xb662('0x4e')](_0x42a36c['model'],qs[_0xb662('0x51')](_0x316d48['query'][_0xb662('0x51')]));_0x157e0f[_0xb662('0x50')]=_0x157e0f[_0xb662('0x50')][_0xb662('0x52')]?_0x157e0f[_0xb662('0x50')]:_0x42a36c[_0xb662('0x4f')];if(!_0x316d48[_0xb662('0x4b')][_0xb662('0x53')](_0xb662('0x54'))){_0x157e0f[_0xb662('0x1f')]=qs['limit'](_0x316d48[_0xb662('0x4b')][_0xb662('0x1f')]);_0x157e0f[_0xb662('0x1e')]=qs[_0xb662('0x1e')](_0x316d48[_0xb662('0x4b')][_0xb662('0x1e')]);}_0x157e0f[_0xb662('0x55')]=qs[_0xb662('0x56')](_0x316d48['query']['sort']);_0x157e0f[_0xb662('0x58')]=qs[_0xb662('0x4d')](_['pick'](_0x316d48['query'],_0x42a36c[_0xb662('0x4d')]));_0x157e0f[_0xb662('0x58')][_0xb662('0x6a')]=_0x4880f9['id'];if(_0x316d48[_0xb662('0x4b')][_0xb662('0x57')]){_0x157e0f[_0xb662('0x58')]=_[_0xb662('0x5b')](_0x157e0f[_0xb662('0x58')],{'$or':_['map'](_0x157e0f[_0xb662('0x50')],function(_0x43b944){var _0x4610bc={};_0x4610bc[_0x43b944]={'$like':'%'+_0x316d48[_0xb662('0x4b')]['filter']+'%'};return _0x4610bc;})});}_0x157e0f=_[_0xb662('0x5b')]({},_0x157e0f,_0x316d48[_0xb662('0x61')]);return db['MailInteraction']['count']({'where':_0x157e0f[_0xb662('0x58')]})[_0xb662('0x10')](function(_0x2e71c5){_0xe745['count']=_0x2e71c5;if(_0x316d48['query']['includeAll']){_0x157e0f['include']=[{'model':db['CmContact'],'as':_0xb662('0x8e'),'required':![]},{'model':db[_0xb662('0x8f')],'as':_0xb662('0x90'),'attributes':['name','fullname',_0xb662('0x91')],'required':![]},{'model':db[_0xb662('0x92')],'as':_0xb662('0x93'),'attributes':['id',_0xb662('0x28'),'color'],'where':_0x316d48[_0xb662('0x4b')][_0xb662('0x94')]?{'id':_0x316d48[_0xb662('0x4b')][_0xb662('0x94')]}:undefined,'required':_0x316d48[_0xb662('0x4b')][_0xb662('0x94')]?!![]:![]}];}return db[_0xb662('0x8b')][_0xb662('0x6f')](_0x157e0f);})['then'](function(_0x55abd0){_0xe745['rows']=_0x55abd0;return _0xe745;});}})[_0xb662('0x10')](respondWithFilteredResult(_0x14d9df,_0x157e0f))[_0xb662('0x1b')](handleError(_0x14d9df,null));};exports[_0xb662('0x95')]=function addApplications(_0x5cd70b,_0x5b50f8){var _0x2b4079=_0x5cd70b[_0xb662('0x60')]['id'];var _0x30b923=_0x5cd70b[_0xb662('0x64')];var _0xd0ea7a=0xc8;var _0x27f023=null;return db[_0xb662('0x96')]['transaction']({'isolationLevel':db[_0xb662('0x96')][_0xb662('0x97')]['ISOLATION_LEVELS'][_0xb662('0x98')]},function(_0x155b55){return db[_0xb662('0x46')][_0xb662('0x83')]({'where':{'id':_0x2b4079},'transaction':_0x155b55})[_0xb662('0x10')](function(_0xa52979){if(_0xa52979){return db[_0xb662('0x99')]['destroy']({'where':{'MailAccountId':_0x2b4079},'transaction':_0x155b55})[_0xb662('0x10')](function(){var _0x44ad28=_[_0xb662('0x59')](_0x30b923,function(_0x4f6a96){_0x4f6a96[_0xb662('0x6a')]=_0x2b4079;return _0x4f6a96;});return db[_0xb662('0x99')]['bulkCreate'](_0x44ad28,{'transaction':_0x155b55});});}else{_0xd0ea7a=0x194;_0x27f023=[];}});})[_0xb662('0x10')](function(){if(_0xd0ea7a!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x2b4079},'order':'priority'})[_0xb662('0x10')](function(_0x4b99c3){_0x27f023=_0x4b99c3;});}})[_0xb662('0x1b')](function(_0x2e439e){_0xd0ea7a=0x1f4;logger['error'](_0x2e439e[_0xb662('0x9a')]);if(_0x2e439e['name']){delete _0x2e439e['name'];}_0x27f023=_0x2e439e;})[_0xb662('0x9b')](function(){if(_0x27f023===null){_0x5b50f8[_0xb662('0x27')](_0xd0ea7a);}else{if(_0xd0ea7a===0x1f4){_0x5b50f8[_0xb662('0x1c')](_0xd0ea7a)[_0xb662('0x29')](_0x27f023);}else{_0x5b50f8['status'](_0xd0ea7a)[_0xb662('0x24')](_0x27f023);}}});};exports[_0xb662('0x9c')]=function(_0x9a575b,_0x435db1){var _0x2fb393={};var _0x137d26={};var _0x211408;var _0x187b2d;return db['MailAccount']['findOne']({'where':{'id':_0x9a575b[_0xb662('0x60')]['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x435db1,null))['then'](function(_0x140af1){if(_0x140af1){_0x211408=_0x140af1;_0x137d26['model']=_[_0xb662('0x4c')](db['MailApplication'][_0xb662('0x47')]);_0x137d26['query']=_[_0xb662('0x4c')](_0x9a575b['query']);_0x137d26[_0xb662('0x4d')]=_[_0xb662('0x4e')](_0x137d26['model'],_0x137d26[_0xb662('0x4b')]);_0x2fb393['attributes']=_['intersection'](_0x137d26['model'],qs['fields'](_0x9a575b[_0xb662('0x4b')]['fields']));_0x2fb393[_0xb662('0x50')]=_0x2fb393[_0xb662('0x50')][_0xb662('0x52')]?_0x2fb393[_0xb662('0x50')]:_0x137d26['model'];_0x2fb393['order']=qs[_0xb662('0x56')](_0x9a575b[_0xb662('0x4b')][_0xb662('0x56')]);_0x2fb393['where']=qs[_0xb662('0x4d')](_['pick'](_0x9a575b[_0xb662('0x4b')],_0x137d26[_0xb662('0x4d')]));if(_0x9a575b[_0xb662('0x4b')][_0xb662('0x57')]){_0x2fb393[_0xb662('0x58')]=_[_0xb662('0x5b')](_0x2fb393['where'],{'$or':_[_0xb662('0x59')](_0x2fb393[_0xb662('0x50')],function(_0x3d7cf0){var _0x2b9f55={};_0x2b9f55[_0x3d7cf0]={'$like':'%'+_0x9a575b[_0xb662('0x4b')][_0xb662('0x57')]+'%'};return _0x2b9f55;})});}_0x2fb393=_['merge']({},_0x2fb393,_0x9a575b['options']);return _0x211408[_0xb662('0x9c')](_0x2fb393);}})['then'](function(_0x14587e){if(_0x14587e){_0x187b2d=_0x14587e['length'];if(!_0x9a575b[_0xb662('0x4b')][_0xb662('0x53')](_0xb662('0x54'))){_0x2fb393[_0xb662('0x1f')]=qs[_0xb662('0x1f')](_0x9a575b[_0xb662('0x4b')][_0xb662('0x1f')]);_0x2fb393[_0xb662('0x1e')]=qs[_0xb662('0x1e')](_0x9a575b[_0xb662('0x4b')][_0xb662('0x1e')]);}return _0x211408[_0xb662('0x9c')](_0x2fb393);}})[_0xb662('0x10')](function(_0x1aba76){if(_0x1aba76){return _0x1aba76?{'count':_0x187b2d,'rows':_0x1aba76}:null;}})[_0xb662('0x10')](respondWithResult(_0x435db1,null))['catch'](handleError(_0x435db1,null));};exports[_0xb662('0x9d')]=function(_0x5e7c9f,_0x4b634f){var _0x4012d9={'raw':!![],'where':{}};var _0x2576d0={};var _0x175298={'count':0x0,'rows':[]};return db[_0xb662('0x46')][_0xb662('0x83')]({'where':{'id':_0x5e7c9f[_0xb662('0x60')]['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x4b634f,null))['then'](function(_0x50a227){if(_0x50a227){_0x2576d0['model']=_[_0xb662('0x4c')](db[_0xb662('0x9e')]['rawAttributes']);_0x2576d0[_0xb662('0x4b')]=_['keys'](_0x5e7c9f[_0xb662('0x4b')]);_0x2576d0[_0xb662('0x4d')]=_[_0xb662('0x4e')](_0x2576d0[_0xb662('0x4f')],_0x2576d0[_0xb662('0x4b')]);_0x4012d9['attributes']=_['intersection'](_0x2576d0[_0xb662('0x4f')],qs[_0xb662('0x51')](_0x5e7c9f[_0xb662('0x4b')][_0xb662('0x51')]));_0x4012d9[_0xb662('0x50')]=_0x4012d9[_0xb662('0x50')]['length']?_0x4012d9['attributes']:_0x2576d0[_0xb662('0x4f')];if(!_0x5e7c9f[_0xb662('0x4b')][_0xb662('0x53')](_0xb662('0x54'))){_0x4012d9[_0xb662('0x1f')]=qs[_0xb662('0x1f')](_0x5e7c9f[_0xb662('0x4b')][_0xb662('0x1f')]);_0x4012d9[_0xb662('0x1e')]=qs['offset'](_0x5e7c9f[_0xb662('0x4b')][_0xb662('0x1e')]);}_0x4012d9[_0xb662('0x55')]=qs[_0xb662('0x56')](_0x5e7c9f['query'][_0xb662('0x56')]);_0x4012d9[_0xb662('0x58')]=qs[_0xb662('0x4d')](_[_0xb662('0x6e')](_0x5e7c9f[_0xb662('0x4b')],_0x2576d0[_0xb662('0x4d')]));_0x4012d9[_0xb662('0x58')][_0xb662('0x6a')]=_0x50a227['id'];if(_0x5e7c9f[_0xb662('0x4b')][_0xb662('0x57')]){_0x4012d9['where']=_[_0xb662('0x5b')](_0x4012d9[_0xb662('0x58')],{'$or':_[_0xb662('0x59')](_0x4012d9[_0xb662('0x50')],function(_0x4a68f9){var _0x13f29f={};_0x13f29f[_0x4a68f9]={'$like':'%'+_0x5e7c9f[_0xb662('0x4b')][_0xb662('0x57')]+'%'};return _0x13f29f;})});}if(_0x5e7c9f[_0xb662('0x4b')][_0xb662('0x9f')]){var _0x3dcba3=_0x5e7c9f[_0xb662('0x4b')]['$gte'][_0xb662('0xa0')](',');var _0xdcab6a={};_0xdcab6a[_0x3dcba3[0x0]]={'$gte':moment(_0x3dcba3[0x1])[_0xb662('0xa1')](_0xb662('0xa2'))};_0x4012d9[_0xb662('0x58')]=_[_0xb662('0x5b')](_0x4012d9[_0xb662('0x58')],_0xdcab6a);}_0x4012d9=_[_0xb662('0x5b')]({},_0x4012d9,_0x5e7c9f[_0xb662('0x61')]);return db[_0xb662('0x9e')][_0xb662('0x21')]({'where':_0x4012d9[_0xb662('0x58')]})[_0xb662('0x10')](function(_0x5ad667){_0x175298['count']=_0x5ad667;if(_0x5e7c9f[_0xb662('0x4b')][_0xb662('0x5c')]){_0x4012d9[_0xb662('0x5d')]=[{'all':!![]}];}return db[_0xb662('0x9e')][_0xb662('0x6f')](_0x4012d9);})['then'](function(_0x28174f){if(_0x5e7c9f[_0xb662('0x4b')][_0xb662('0xa3')]===_0xb662('0xa4')){for(var _0x5cef65=0x0;_0x5cef65<_0x28174f[_0xb662('0x52')];_0x5cef65++){_0x28174f[_0x5cef65][_0xb662('0x64')]=juice(_0x28174f[_0x5cef65][_0xb662('0x64')]);}}_0x175298[_0xb662('0x5e')]=_0x28174f;return _0x175298;});}})[_0xb662('0x10')](respondWithFilteredResult(_0x4b634f,_0x4012d9))[_0xb662('0x1b')](handleError(_0x4b634f,null));};exports[_0xb662('0x29')]=function(_0x396f00,_0x59415c){var _0x4fb779,_0x46684c={},_0x4fd2e1;if(_0x396f00[_0xb662('0x64')]['to']){_0x4fd2e1=_0x396f00[_0xb662('0x64')]['to'][_0xb662('0xa0')](',')[0x0];}return db['MailAccount'][_0xb662('0x62')]({'where':{'id':_0x396f00['params']['id']},'include':[{'model':db[_0xb662('0xa5')],'as':_0xb662('0xa6'),'include':[{'model':db[_0xb662('0xa7')],'as':_0xb662('0xa8'),'where':{'email':_0x4fd2e1},'limit':0x1,'order':[[_0xb662('0xa9'),_0xb662('0xaa')]]}]},{'model':db[_0xb662('0x43')],'as':_0xb662('0x40'),'raw':!![],'include':[{'model':db[_0xb662('0xab')],'as':'CloudProvider','raw':!![]}]}]})[_0xb662('0x10')](handleEntityNotFound(_0x59415c,null))[_0xb662('0x10')](function(_0x242973){if(!_0x242973)return;_0x4fb779=_0x242973;if(!_0x242973[_0xb662('0x40')])throw new Error(_0xb662('0xac'));if(_[_0xb662('0x78')](_0x396f00[_0xb662('0x64')]['from'])){_0x396f00['body'][_0xb662('0xad')]=util[_0xb662('0xa1')](_0xb662('0xae'),_0x242973['name'],_0x242973[_0xb662('0x76')]||_0x242973[_0xb662('0x40')][_0xb662('0x36')]);}if(_0x396f00[_0xb662('0x64')][_0xb662('0xaf')]&&_0x396f00['body'][_0xb662('0xaf')]['length']){for(var _0x137eee=0x0;_0x137eee<_0x396f00[_0xb662('0x64')]['attachments']['length'];_0x137eee+=0x1){_0x396f00[_0xb662('0x64')][_0xb662('0xaf')][_0x137eee]={'filename':_0x396f00[_0xb662('0x64')][_0xb662('0xaf')][_0x137eee][_0xb662('0x28')],'path':path[_0xb662('0xb0')](config[_0xb662('0xb1')],_0xb662('0xb2'),_0x396f00[_0xb662('0x64')][_0xb662('0xaf')][_0x137eee][_0xb662('0xb3')])};}}var _0x1644ea=_0x242973[_0xb662('0xb4')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x1644ea,'message':_0x396f00[_0xb662('0x64')]});})[_0xb662('0x10')](function(_0x2c7873){if(!_0x2c7873)return;_0x46684c=_0x2c7873;if(!_0x4fb779[_0xb662('0xa6')])throw new Error(_0xb662('0xb5'));if(_0x4fb779[_0xb662('0xa6')]['Contacts'][_0xb662('0x52')])return _0x4fb779[_0xb662('0xa6')][_0xb662('0xa8')][0x0];return db[_0xb662('0xa7')][_0xb662('0x6c')](_['defaults'](_0x396f00[_0xb662('0x64')],{'firstName':_0x396f00[_0xb662('0x64')]['to'],'email':_0x396f00[_0xb662('0x64')]['to'],'phone':_0x396f00['body']['to'],'ListId':_0x4fb779[_0xb662('0x77')]}));})[_0xb662('0x10')](function(_0x38d3c8){if(!_0x38d3c8)return;var _0x14be33={'UserId':_0x396f00[_0xb662('0x36')]['id'],'ContactId':_0x38d3c8['id'],'MailAccountId':_0x4fb779['id'],'inReplyTo':_0x46684c[_0xb662('0xb6')],'to':_0x396f00['body'][_0xb662('0xad')],'cc':_0x396f00[_0xb662('0x64')]['cc'],'subject':_0x396f00[_0xb662('0x64')][_0xb662('0xb7')],'attach':_0x396f00[_0xb662('0x64')][_0xb662('0xb8')],'firstMsgDirection':_0xb662('0xb9'),'lastMsgAt':moment()['format'](_0xb662('0xa2')),'lastMsgDirection':_0xb662('0xb9'),'Messages':[_[_0xb662('0x5b')](_0x396f00[_0xb662('0x64')],{'messageId':_0x46684c[_0xb662('0xb6')],'sentAt':moment()['format'](_0xb662('0xa2')),'read':!![],'MailAccountId':_0x4fb779['id'],'UserId':_0x396f00[_0xb662('0x36')]['id'],'ContactId':_0x38d3c8['id']})]};if(_0x396f00['body'][_0xb662('0xba')]){_0x14be33=_[_0xb662('0x5b')](_0x14be33,_0x396f00[_0xb662('0x64')][_0xb662('0xba')]);}return db[_0xb662('0x8b')][_0xb662('0x6c')](_0x14be33,{'include':[{'model':db['MailMessage'],'as':_0xb662('0xbb')}]});})['then'](respondWithResult(_0x59415c,null))[_0xb662('0x1b')](handleError(_0x59415c,null));};exports[_0xb662('0xbc')]=function(_0x497915,_0x217579){return db[_0xb662('0x46')][_0xb662('0x62')]({'where':{'id':_0x497915[_0xb662('0x60')]['id']},'include':[{'model':db[_0xb662('0x43')],'as':_0xb662('0x40'),'raw':!![],'include':[{'model':db[_0xb662('0xab')],'as':'CloudProvider','raw':!![]}]}]})[_0xb662('0x10')](handleEntityNotFound(_0x217579,null))[_0xb662('0x10')](function(_0x593546){if(!_0x593546['Smtp'])return;var _0x418525=_0x593546[_0xb662('0xb4')]();return respondWithRpcPromise(_0xb662('0xbd'),_0xb662('0xbc'),{'account':_0x418525});})[_0xb662('0x10')](respondWithResult(_0x217579,null))[_0xb662('0x1b')](handleError(_0x217579,null));};exports[_0xb662('0x25')]=function(_0x58fd38,_0x1cada3){return db[_0xb662('0x46')][_0xb662('0x62')]({'where':{'id':_0x58fd38[_0xb662('0x60')]['id']}})['then'](handleEntityNotFound(_0x1cada3,null))[_0xb662('0x10')](function(_0x3a99b0){if(_0x3a99b0&&_0x3a99b0[_0xb662('0x67')]){throw new db[(_0xb662('0xbe'))][(_0xb662('0xbf'))](_0xb662('0xc0'));}return _0x3a99b0;})['then'](removeEntity(_0x1cada3,null))[_0xb662('0x1b')](handleError(_0x1cada3,null));};exports[_0xb662('0xc1')]=function(_0x45b313,_0x22b0e0){return db[_0xb662('0x46')][_0xb662('0x62')]({'where':{'id':_0x45b313[_0xb662('0x60')]['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x22b0e0,null))[_0xb662('0x10')](function(_0xb6772b){if(_0xb6772b){return _0xb6772b[_0xb662('0xc1')](_0x45b313['body'][_0xb662('0x71')],_[_0xb662('0x8c')](_0x45b313[_0xb662('0x64')],[_0xb662('0x71'),'id'])||{})[_0xb662('0xc2')](function(_0x325098){for(var _0x388349=0x0;_0x388349<_0x45b313[_0xb662('0x64')][_0xb662('0x71')]['length'];_0x388349+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x45b313[_0xb662('0x64')][_0xb662('0x71')][_0x388349]),'MailAccountId':Number(_0x45b313[_0xb662('0x60')]['id'])});}return _0x325098;});}})['then'](respondWithResult(_0x22b0e0,null))[_0xb662('0x1b')](handleError(_0x22b0e0,null));};exports[_0xb662('0xc3')]=function(_0x2f204b,_0x3ae5f2){return db[_0xb662('0x46')][_0xb662('0x62')]({'where':{'id':_0x2f204b[_0xb662('0x60')]['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x3ae5f2,null))['then'](function(_0x58324f){if(_0x58324f){return _0x58324f[_0xb662('0xc3')](_0x2f204b[_0xb662('0x4b')][_0xb662('0x71')])[_0xb662('0x10')](function(){if(_['isArray'](_0x2f204b[_0xb662('0x4b')][_0xb662('0x71')])){for(var _0x243026=0x0;_0x243026<_0x2f204b[_0xb662('0x4b')][_0xb662('0x71')][_0xb662('0x52')];_0x243026+=0x1){socket[_0xb662('0xc4')]('userMailAccount:remove',{'UserId':Number(_0x2f204b['query'][_0xb662('0x71')][_0x243026]),'MailAccountId':Number(_0x2f204b[_0xb662('0x60')]['id'])});}}else{socket[_0xb662('0xc4')](_0xb662('0xc5'),{'UserId':Number(_0x2f204b[_0xb662('0x4b')][_0xb662('0x71')]),'MailAccountId':Number(_0x2f204b[_0xb662('0x60')]['id'])});}});}})[_0xb662('0x10')](respondWithStatusCode(_0x3ae5f2,null))[_0xb662('0x1b')](handleError(_0x3ae5f2,null));};exports[_0xb662('0xc6')]=function(_0x473fd7,_0x1f6cd5){var _0x5ed311={};var _0x132b8c={};var _0x3641ae;var _0x10a522;return db[_0xb662('0x46')][_0xb662('0x83')]({'where':{'id':_0x473fd7[_0xb662('0x60')]['id']}})[_0xb662('0x10')](handleEntityNotFound(_0x1f6cd5,null))[_0xb662('0x10')](function(_0x49ef21){if(_0x49ef21){_0x3641ae=_0x49ef21;_0x132b8c[_0xb662('0x4f')]=_[_0xb662('0x4c')](db[_0xb662('0x8f')]['rawAttributes']);_0x132b8c[_0xb662('0x4b')]=_[_0xb662('0x4c')](_0x473fd7['query']);_0x132b8c[_0xb662('0x4d')]=_['intersection'](_0x132b8c['model'],_0x132b8c[_0xb662('0x4b')]);_0x5ed311[_0xb662('0x50')]=_['intersection'](_0x132b8c[_0xb662('0x4f')],qs[_0xb662('0x51')](_0x473fd7[_0xb662('0x4b')][_0xb662('0x51')]));_0x5ed311['attributes']=_0x5ed311[_0xb662('0x50')]['length']?_0x5ed311[_0xb662('0x50')]:_0x132b8c['model'];_0x5ed311[_0xb662('0x55')]=qs[_0xb662('0x56')](_0x473fd7[_0xb662('0x4b')]['sort']);_0x5ed311[_0xb662('0x58')]=qs[_0xb662('0x4d')](_[_0xb662('0x6e')](_0x473fd7[_0xb662('0x4b')],_0x132b8c[_0xb662('0x4d')]));if(_0x473fd7['query']['filter']){_0x5ed311[_0xb662('0x58')]=_['merge'](_0x5ed311[_0xb662('0x58')],{'$or':_[_0xb662('0x59')](_0x5ed311[_0xb662('0x50')],function(_0x184b74){var _0x2f9448={};_0x2f9448[_0x184b74]={'$like':'%'+_0x473fd7[_0xb662('0x4b')][_0xb662('0x57')]+'%'};return _0x2f9448;})});}_0x5ed311=_['merge']({},_0x5ed311,_0x473fd7['options']);return _0x3641ae[_0xb662('0xc6')](_0x5ed311);}})['then'](function(_0x30a1fc){if(_0x30a1fc){_0x10a522=_0x30a1fc[_0xb662('0x52')];if(!_0x473fd7['query'][_0xb662('0x53')](_0xb662('0x54'))){_0x5ed311[_0xb662('0x1f')]=qs['limit'](_0x473fd7[_0xb662('0x4b')][_0xb662('0x1f')]);_0x5ed311[_0xb662('0x1e')]=qs['offset'](_0x473fd7[_0xb662('0x4b')][_0xb662('0x1e')]);}return _0x3641ae[_0xb662('0xc6')](_0x5ed311);}})['then'](function(_0x2bd184){if(_0x2bd184){return _0x2bd184?{'count':_0x10a522,'rows':_0x2bd184}:null;}})[_0xb662('0x10')](respondWithResult(_0x1f6cd5,null))['catch'](handleError(_0x1f6cd5,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index ab62992..de04aa7 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 _0x22ca=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove'];(function(_0x39f095,_0x57931e){var _0x56680f=function(_0x229e88){while(--_0x229e88){_0x39f095['push'](_0x39f095['shift']());}};_0x56680f(++_0x57931e);}(_0x22ca,0x1d9));var _0xa22c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x22ca[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xa22c('0x0'));var MailAccount=require(_0xa22c('0x1'))['db'][_0xa22c('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xa22c('0x3')](0x0);var events={'afterCreate':_0xa22c('0x4'),'afterUpdate':_0xa22c('0x5'),'afterDestroy':_0xa22c('0x6')};function emitEvent(_0x915971){return function(_0x3de354,_0xae9f6c,_0x212156){MailAccountEvents['emit'](_0x915971+':'+_0x3de354['id'],_0x3de354);MailAccountEvents['emit'](_0x915971,_0x3de354);_0x212156(null);};}for(var e in events){if(events[_0xa22c('0x7')](e)){var event=events[e];MailAccount[_0xa22c('0x8')](e,emitEvent(event));}}module[_0xa22c('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x6209=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x6209,0x1e8));var _0x9620=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6209[_0x46aff0];return _0x9d78cf;};'use strict';var EventEmitter=require(_0x9620('0x0'));var MailAccount=require(_0x9620('0x1'))['db'][_0x9620('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9620('0x3')](0x0);var events={'afterCreate':_0x9620('0x4'),'afterUpdate':_0x9620('0x5'),'afterDestroy':_0x9620('0x6')};function emitEvent(_0x5deb40){return function(_0x2869e2,_0x17dc92,_0x2fa00b){MailAccountEvents['emit'](_0x5deb40+':'+_0x2869e2['id'],_0x2869e2);MailAccountEvents[_0x9620('0x7')](_0x5deb40,_0x2869e2);_0x2fa00b(null);};}for(var e in events){if(events[_0x9620('0x8')](e)){var event=events[e];MailAccount[_0x9620('0x9')](e,emitEvent(event));}}module[_0x9620('0xa')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 95f99aa..b2d6b11 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 _0xc3a8=['mail_accounts','custom','service','provider','host','Smtp','port','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','exports','MailAccount'];(function(_0x1c1b8c,_0x4c253d){var _0x1ee4c4=function(_0xb9bff5){while(--_0xb9bff5){_0x1c1b8c['push'](_0x1c1b8c['shift']());}};_0x1ee4c4(++_0x4c253d);}(_0xc3a8,0x18a));var _0x8c3a=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0xc3a8[_0x3ba422];return _0x20b5dd;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x8c3a('0x0')]=function(_0x54cefa){return _0x54cefa['define'](_0x8c3a('0x1'),attributes,{'tableName':_0x8c3a('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x28bc01=this;var _0x62ab0={'id':_0x28bc01['id'],'tls':{'rejectUnauthorized':![]}};if(_0x28bc01['provider']!==_0x8c3a('0x3')){_0x62ab0[_0x8c3a('0x4')]=_0x28bc01[_0x8c3a('0x5')];}else{_0x62ab0[_0x8c3a('0x6')]=_0x28bc01[_0x8c3a('0x7')][_0x8c3a('0x6')];_0x62ab0['port']=_0x28bc01[_0x8c3a('0x7')][_0x8c3a('0x8')];_0x62ab0[_0x8c3a('0x9')]=_0x28bc01[_0x8c3a('0x7')]['secure'];}if(_0x28bc01[_0x8c3a('0x7')][_0x8c3a('0xa')]){if(_0x28bc01[_0x8c3a('0x7')]['modernAuthentication']){if(!_0x28bc01[_0x8c3a('0x7')][_0x8c3a('0xb')])throw new Error(_0x8c3a('0xc'));_0x62ab0[_0x8c3a('0xd')]={'type':_0x8c3a('0xe'),'user':_0x28bc01[_0x8c3a('0x7')][_0x8c3a('0xf')],'accessToken':_0x28bc01[_0x8c3a('0x7')][_0x8c3a('0xb')][_0x8c3a('0x10')]};}else{_0x62ab0['auth']={'user':_0x28bc01['Smtp']['user'],'pass':_0x28bc01['Smtp'][_0x8c3a('0x11')]};}}return _0x62ab0;}}});}; \ No newline at end of file +var _0x7381=['Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','exports','define','MailAccount','mail_accounts','provider','custom','host'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7381,0x1a9));var _0x1738=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0x7381[_0x7ad6cb];return _0x22a0ba;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x1738('0x0')]=function(_0x957824){return _0x957824[_0x1738('0x1')](_0x1738('0x2'),attributes,{'tableName':_0x1738('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x425da0=this;var _0xe42d59={'id':_0x425da0['id'],'tls':{'rejectUnauthorized':![]}};if(_0x425da0[_0x1738('0x4')]!==_0x1738('0x5')){_0xe42d59['service']=_0x425da0[_0x1738('0x4')];}else{_0xe42d59[_0x1738('0x6')]=_0x425da0['Smtp'][_0x1738('0x6')];_0xe42d59['port']=_0x425da0[_0x1738('0x7')][_0x1738('0x8')];_0xe42d59[_0x1738('0x9')]=_0x425da0[_0x1738('0x7')][_0x1738('0x9')];}if(_0x425da0[_0x1738('0x7')][_0x1738('0xa')]){if(_0x425da0['Smtp'][_0x1738('0xb')]){if(!_0x425da0[_0x1738('0x7')][_0x1738('0xc')])throw new Error(_0x1738('0xd'));_0xe42d59[_0x1738('0xe')]={'type':_0x1738('0xf'),'user':_0x425da0[_0x1738('0x7')][_0x1738('0x10')],'accessToken':_0x425da0[_0x1738('0x7')][_0x1738('0xc')][_0x1738('0x11')]};}else{_0xe42d59[_0x1738('0xe')]={'user':_0x425da0['Smtp']['user'],'pass':_0x425da0[_0x1738('0x7')]['pass']};}}return _0xe42d59;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 1be28f6..cde8a6c 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 _0xdb28=['DESC','MailApplication','Applications','CloudProvider','get','omit','smtpOptions','list','applications','orderBy','priority','asc','autoclose','push','length','*,*,*,*','Contacts','create','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','subject','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','Attachment','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','model','map','then','find','smtp','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','difference','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact'];(function(_0x18718,_0x39e8c1){var _0x17ff6c=function(_0x3efa99){while(--_0x3efa99){_0x18718['push'](_0x18718['shift']());}};_0x17ff6c(++_0x39e8c1);}(_0xdb28,0x106));var _0x8db2=function(_0x32f046,_0x58d3f3){_0x32f046=_0x32f046-0x0;var _0x496700=_0xdb28[_0x32f046];return _0x496700;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var BPromise=require(_0x8db2('0x2'));var rs=require(_0x8db2('0x3'));var Redis=require('ioredis');var db=require(_0x8db2('0x4'))['db'];var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var jayson=require(_0x8db2('0x8'));var client=jayson['client'][_0x8db2('0x9')]({'port':0x232c});config[_0x8db2('0xa')]=_['defaults'](config['redis'],{'host':_0x8db2('0xb'),'port':0x18eb});var socket=require(_0x8db2('0xc'))(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xd'))[_0x8db2('0xe')](socket);function respondWithRpcPromise(_0x1ff362,_0x126c78,_0x4ba340){return new BPromise(function(_0x30dc90,_0x476216){return client[_0x8db2('0xf')](_0x1ff362,_0x4ba340)['then'](function(_0x1d9371){logger[_0x8db2('0x10')]('MailAccount,\x20%s,\x20%s',_0x126c78,_0x8db2('0x11'));logger[_0x8db2('0x12')](_0x8db2('0x13'),_0x126c78,_0x8db2('0x11'),JSON[_0x8db2('0x14')](_0x1d9371));if(_0x1d9371['error']){if(_0x1d9371['error'][_0x8db2('0x15')]===0x1f4){logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x126c78,_0x1d9371[_0x8db2('0x16')][_0x8db2('0x18')]);return _0x476216(_0x1d9371[_0x8db2('0x16')][_0x8db2('0x18')]);}logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x126c78,_0x1d9371[_0x8db2('0x16')]['message']);return _0x30dc90(_0x1d9371[_0x8db2('0x16')][_0x8db2('0x18')]);}else{logger['info'](_0x8db2('0x17'),_0x126c78,_0x8db2('0x11'));_0x30dc90(_0x1d9371[_0x8db2('0x19')][_0x8db2('0x18')]);}})[_0x8db2('0x1a')](function(_0x46ce14){logger['error']('MailAccount,\x20%s,\x20%s',_0x126c78,_0x46ce14);_0x476216(_0x46ce14);});});}exports[_0x8db2('0x1b')]=function(_0x104e33){var _0x1310d3=this;return new Promise(function(_0x1b64e4,_0x58562e){return db[_0x8db2('0x1c')][_0x8db2('0x1d')]({'raw':_0x104e33[_0x8db2('0x1e')]?_0x104e33[_0x8db2('0x1e')][_0x8db2('0x1f')]===undefined?!![]:![]:!![],'where':_0x104e33['options']?_0x104e33[_0x8db2('0x1e')][_0x8db2('0x20')]||null:null,'attributes':_0x104e33[_0x8db2('0x1e')]?_0x104e33[_0x8db2('0x1e')][_0x8db2('0x21')]||null:null,'limit':_0x104e33[_0x8db2('0x1e')]?_0x104e33[_0x8db2('0x1e')]['limit']||null:null,'include':_0x104e33[_0x8db2('0x1e')]?_0x104e33['options']['include']?_['map'](_0x104e33['options'][_0x8db2('0x22')],function(_0x29b5cd){return{'model':db[_0x29b5cd[_0x8db2('0x23')]],'as':_0x29b5cd['as'],'attributes':_0x29b5cd[_0x8db2('0x21')],'include':_0x29b5cd[_0x8db2('0x22')]?_[_0x8db2('0x24')](_0x29b5cd['include'],function(_0x3544ba){return{'model':db[_0x3544ba[_0x8db2('0x23')]],'as':_0x3544ba['as'],'attributes':_0x3544ba[_0x8db2('0x21')],'include':_0x3544ba[_0x8db2('0x22')]?_['map'](_0x3544ba[_0x8db2('0x22')],function(_0x11f398){return{'model':db[_0x11f398[_0x8db2('0x23')]],'as':_0x11f398['as'],'attributes':_0x11f398[_0x8db2('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0x25')](function(_0x21bae5){logger[_0x8db2('0x10')](_0x8db2('0x1b'),_0x104e33);logger[_0x8db2('0x12')]('GetMailAccount',_0x104e33,JSON[_0x8db2('0x14')](_0x21bae5));_0x1b64e4(_0x21bae5);})['catch'](function(_0x59cb77){logger[_0x8db2('0x16')](_0x8db2('0x1b'),_0x59cb77[_0x8db2('0x18')],_0x104e33);_0x58562e(_0x1310d3['error'](0x1f4,_0x59cb77[_0x8db2('0x18')]));});});};exports['ShowMailAccount']=function(_0x3f7aac){var _0x2b653b=this;return new Promise(function(_0x14bd12,_0x4d9e26){return db['MailAccount'][_0x8db2('0x26')]({'raw':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x20')]||null:null,'attributes':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x21')]||null:null,'include':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x22')]?_[_0x8db2('0x24')](_0x3f7aac['options'][_0x8db2('0x22')],function(_0x304a72){return{'model':db[_0x304a72['model']],'as':_0x304a72['as'],'attributes':_0x304a72[_0x8db2('0x21')],'include':_0x304a72[_0x8db2('0x22')]?_['map'](_0x304a72['include'],function(_0x3c1983){return{'model':db[_0x3c1983['model']],'as':_0x3c1983['as'],'attributes':_0x3c1983[_0x8db2('0x21')],'include':_0x3c1983[_0x8db2('0x22')]?_[_0x8db2('0x24')](_0x3c1983[_0x8db2('0x22')],function(_0x5cc419){return{'model':db[_0x5cc419[_0x8db2('0x23')]],'as':_0x5cc419['as'],'attributes':_0x5cc419['attributes']};}):[]};}):[]};}):[]:[]})[_0x8db2('0x25')](function(_0xd550ae){if(_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x27')]===!![])_0xd550ae['setDataValue']('smtpOptions',_0xd550ae[_0x8db2('0x28')]());logger[_0x8db2('0x10')]('ShowMailAccount',_0x3f7aac);logger[_0x8db2('0x12')](_0x8db2('0x29'),_0x3f7aac,JSON[_0x8db2('0x14')](_0xd550ae));_0x14bd12(_0xd550ae);})['catch'](function(_0x152e15){logger[_0x8db2('0x16')](_0x8db2('0x29'),_0x152e15[_0x8db2('0x18')],_0x3f7aac);_0x4d9e26(_0x2b653b[_0x8db2('0x16')](0x1f4,_0x152e15[_0x8db2('0x18')]));});});};exports[_0x8db2('0x2a')]=function(_0x1575ea){var _0x3793a4=this;return new Promise(function(_0x63c561,_0x21cf7c){var _0x20bf0b={'body':_0x1575ea[_0x8db2('0x2b')],'channel':'mail'};var _0x3ee510=_[_0x8db2('0x2c')](_['keys'](db['CmContact'][_0x8db2('0x2d')]),['createdAt',_0x8db2('0x2e'),_0x8db2('0x2f'),_0x8db2('0x30')]);var _0x307783=![];if(_0x1575ea[_0x8db2('0x2b')]['id']){delete _0x1575ea[_0x8db2('0x2b')]['id'];}if(_[_0x8db2('0x31')](_0x1575ea['body'][_0x8db2('0x32')])){return _0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,_0x8db2('0x33')));}if(_[_0x8db2('0x31')](_0x1575ea['body'][_0x8db2('0x2b')])||_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x2b')]===''){return _0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8db2('0x31')](_0x1575ea['body'][_0x8db2('0x34')])){return _0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,_0x8db2('0x35')+_0x3ee510));}if(!_['includes'](_0x3ee510,_0x1575ea['body'][_0x8db2('0x34')])){return _0x21cf7c(_0x3793a4['error'](0x1f4,_0x8db2('0x36')+_0x3ee510));}var _0x467866={};_0x467866[_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x34')]]=_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x32')];return db[_0x8db2('0x1c')][_0x8db2('0x26')]({'where':{'id':_0x1575ea[_0x8db2('0x37')]['id']},'include':[{'model':db[_0x8db2('0x38')],'as':_0x8db2('0x39'),'include':[{'model':db[_0x8db2('0x3a')],'as':'Contacts','where':_0x467866,'limit':0x1,'order':[[_0x8db2('0x2e'),_0x8db2('0x3b')]]}]},{'model':db[_0x8db2('0x3c')],'as':_0x8db2('0x3d')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x8db2('0x3e')],'as':_0x8db2('0x3e')}]}]})[_0x8db2('0x25')](function(_0x4c66e5){if(_0x4c66e5&&_0x4c66e5['List']){var _0x494d6e=_0x4c66e5[_0x8db2('0x3f')]({'plain':!![]});_0x20bf0b[_0x8db2('0x37')]=_[_0x8db2('0x40')](_0x494d6e,[_0x8db2('0x3d'),_0x8db2('0x39')]);_0x20bf0b[_0x8db2('0x37')][_0x8db2('0x41')]=_0x4c66e5['getSmtpOptions']();_0x20bf0b['applications']=_0x494d6e[_0x8db2('0x3d')];_0x20bf0b[_0x8db2('0x42')]=_0x494d6e[_0x8db2('0x39')];_0x20bf0b[_0x8db2('0x43')]=_[_0x8db2('0x44')](_0x20bf0b[_0x8db2('0x43')],[_0x8db2('0x45')],[_0x8db2('0x46')]);if(_0x20bf0b[_0x8db2('0x37')]&&_0x20bf0b[_0x8db2('0x37')][_0x8db2('0x47')]){_0x20bf0b[_0x8db2('0x43')][_0x8db2('0x48')]({'id':0x0,'priority':_0x20bf0b[_0x8db2('0x43')][_0x8db2('0x49')]+0x1,'app':'close','appdata':_0x8db2('0x47'),'interval':_0x8db2('0x4a')});}if(_0x20bf0b['account'][_0x8db2('0x3d')]){delete _0x20bf0b[_0x8db2('0x37')][_0x8db2('0x3d')];}if(_0x20bf0b['account'][_0x8db2('0x39')]){delete _0x20bf0b[_0x8db2('0x37')][_0x8db2('0x39')];}if(_0x494d6e[_0x8db2('0x39')][_0x8db2('0x4b')]['length']){return _0x494d6e[_0x8db2('0x39')][_0x8db2('0x4b')][0x0];}var _0x469bc2=_['defaults'](_0x1575ea[_0x8db2('0x2b')],{'firstName':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x32')],'ListId':_0x494d6e[_0x8db2('0x30')]});_0x469bc2[_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x34')]]=_0x1575ea[_0x8db2('0x2b')]['from'];return db[_0x8db2('0x3a')][_0x8db2('0x4c')](_0x469bc2);}else{throw new Error('List\x20not\x20found');}})[_0x8db2('0x25')](function(_0x1683b8){_0x20bf0b['contact']=_0x1683b8;if(_0x1683b8){if(!_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')]){_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')]=rs[_0x8db2('0x4e')]()+'\x20'+_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x32')];}var _0x12fd12={'ContactId':_0x1683b8['id'],'MailAccountId':_0x1575ea[_0x8db2('0x37')]['id'],'inReplyTo':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')],'to':_0x1575ea[_0x8db2('0x2b')]['message'][_0x8db2('0x32')],'cc':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['cc'],'subject':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['subject'],'attach':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4f')],'lastMsgAt':moment()[_0x8db2('0x50')](_0x8db2('0x51')),'lastMsgDirection':'in'};return db[_0x8db2('0x52')][_0x8db2('0x26')]({'where':{'closed':![],'MailAccountId':_0x1575ea[_0x8db2('0x37')]['id']},'include':[{'model':db[_0x8db2('0x53')],'as':_0x8db2('0x54'),'attributes':[_0x8db2('0x4d')],'where':{'messageId':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x55')]}}]})[_0x8db2('0x25')](function(_0x270fc0){if(_0x270fc0){return[_0x270fc0,![]];}return db[_0x8db2('0x52')][_0x8db2('0x4c')](_0x12fd12)['then'](function(_0x3273dd){return[_0x3273dd,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x8db2('0x56')](function(_0x570c53,_0x3de11e){if(_0x570c53){_0x307783=_0x3de11e;if(!_0x3de11e){return _0x570c53[_0x8db2('0x57')]({'inReplyTo':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')],'to':_0x1575ea['body']['message'][_0x8db2('0x32')],'cc':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['cc'],'subject':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x58')],'attach':_0x570c53[_0x8db2('0x4f')]?_0x570c53[_0x8db2('0x4f')]:_0x1575ea['body'][_0x8db2('0x18')][_0x8db2('0x4f')],'substatus':null,'substatusAt':moment()[_0x8db2('0x50')](_0x8db2('0x51')),'lastMsgAt':moment()[_0x8db2('0x50')](_0x8db2('0x51')),'lastMsgDirection':'in'});}else{return _0x570c53;}}})[_0x8db2('0x25')](function(_0x20caf0){_0x20bf0b['interaction']=_0x20caf0['get']({'plain':!![]});_0x20bf0b[_0x8db2('0x59')][_0x8db2('0x5a')]=_0x307783;return db[_0x8db2('0x53')][_0x8db2('0x4c')]({'body':_0x1575ea[_0x8db2('0x2b')]['body'],'MailAccountId':_0x1575ea['account']['id'],'MailInteractionId':_0x20caf0['id'],'direction':'in','ContactId':_0x20bf0b[_0x8db2('0x5b')]['id'],'messageId':_0x1575ea[_0x8db2('0x2b')]['message'][_0x8db2('0x4d')],'from':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['from'],'to':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['to'],'cc':_0x1575ea[_0x8db2('0x2b')]['message']['cc'],'subject':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x58')],'attach':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['attach'],'Attachments':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x5c')],'originTo':_0x1575ea['body']['message'][_0x8db2('0x5d')],'originCc':_0x1575ea[_0x8db2('0x2b')]['message'][_0x8db2('0x5e')],'bcc':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x5f')],'ChatWebsiteId':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x60')]||null,'originChannel':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x61')]||_0x8db2('0x62'),'ChatOfflineMessageId':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x8db2('0x63')],'as':'Attachments'}]});})[_0x8db2('0x25')](function(_0x3015ab){_0x20bf0b['message']=_0x3015ab;if(_0x20bf0b[_0x8db2('0x59')][_0x8db2('0x64')]){return db['User'][_0x8db2('0x26')]({'attributes':['id',_0x8db2('0x65')],'where':{'id':_0x20bf0b[_0x8db2('0x59')][_0x8db2('0x64')]}})[_0x8db2('0x25')](function(_0x31a095){if(_0x31a095){_0x20bf0b[_0x8db2('0x43')][_0x8db2('0x66')]({'id':0x0,'priority':0x0,'app':_0x8db2('0x67'),'appdata':_0x31a095['name']+','+(_0x20bf0b['account'][_0x8db2('0x68')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x8db2('0x69'),_0x8db2('0x6a'),_0x20bf0b);});}return respondWithRpcPromise(_0x8db2('0x69'),'startRouting',_0x20bf0b);})[_0x8db2('0x25')](function(_0x9675c1){_0x63c561(_0x9675c1);})[_0x8db2('0x1a')](function(_0x591c5d){_0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,_0x591c5d[_0x8db2('0x18')]));});});}; \ No newline at end of file +var _0x4975=['MailMessage','Messages','create','Contact\x20not\x20found','spread','attach','interaction','created','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','User','UserId','agent','name','waitForTheAssignedAgent','startRouting','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','Applications','list','applications','orderBy','priority','asc','push','close','autoclose','*,*,*,*','length','List\x20not\x20found','contact','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x4975,0x86));var _0x5497=function(_0x85603b,_0x336036){_0x85603b=_0x85603b-0x0;var _0x5e86e6=_0x4975[_0x85603b];return _0x5e86e6;};'use strict';var _=require(_0x5497('0x0'));var moment=require('moment');var BPromise=require(_0x5497('0x1'));var rs=require(_0x5497('0x2'));var Redis=require(_0x5497('0x3'));var db=require(_0x5497('0x4'))['db'];var logger=require(_0x5497('0x5'))(_0x5497('0x6'));var config=require(_0x5497('0x7'));var jayson=require(_0x5497('0x8'));var client=jayson[_0x5497('0x9')][_0x5497('0xa')]({'port':0x232c});config['redis']=_[_0x5497('0xb')](config['redis'],{'host':_0x5497('0xc'),'port':0x18eb});var socket=require(_0x5497('0xd'))(new Redis(config[_0x5497('0xe')]));require('./mailAccount.socket')[_0x5497('0xf')](socket);function respondWithRpcPromise(_0x49d94b,_0x1f63d8,_0x29c93f){return new BPromise(function(_0x2ec5a4,_0x32a8a2){return client[_0x5497('0x10')](_0x49d94b,_0x29c93f)[_0x5497('0x11')](function(_0x3e7886){logger[_0x5497('0x12')]('MailAccount,\x20%s,\x20%s',_0x1f63d8,'request\x20sent');logger['debug'](_0x5497('0x13'),_0x1f63d8,_0x5497('0x14'),JSON[_0x5497('0x15')](_0x3e7886));if(_0x3e7886[_0x5497('0x16')]){if(_0x3e7886[_0x5497('0x16')][_0x5497('0x17')]===0x1f4){logger[_0x5497('0x16')](_0x5497('0x18'),_0x1f63d8,_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);return _0x32a8a2(_0x3e7886['error'][_0x5497('0x19')]);}logger['error'](_0x5497('0x18'),_0x1f63d8,_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);return _0x2ec5a4(_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);}else{logger[_0x5497('0x12')](_0x5497('0x18'),_0x1f63d8,'request\x20sent');_0x2ec5a4(_0x3e7886['result'][_0x5497('0x19')]);}})[_0x5497('0x1a')](function(_0x3a47fd){logger['error'](_0x5497('0x18'),_0x1f63d8,_0x3a47fd);_0x32a8a2(_0x3a47fd);});});}exports[_0x5497('0x1b')]=function(_0x18e8a8){var _0x43da2c=this;return new Promise(function(_0x1b1b43,_0x1f6f18){return db[_0x5497('0x1c')][_0x5497('0x1d')]({'raw':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x1f')]===undefined?!![]:![]:!![],'where':_0x18e8a8['options']?_0x18e8a8[_0x5497('0x1e')]['where']||null:null,'attributes':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x20')]||null:null,'limit':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x21')]||null:null,'include':_0x18e8a8['options']?_0x18e8a8['options'][_0x5497('0x22')]?_[_0x5497('0x23')](_0x18e8a8[_0x5497('0x1e')][_0x5497('0x22')],function(_0x5223b5){return{'model':db[_0x5223b5[_0x5497('0x24')]],'as':_0x5223b5['as'],'attributes':_0x5223b5['attributes'],'include':_0x5223b5[_0x5497('0x22')]?_[_0x5497('0x23')](_0x5223b5[_0x5497('0x22')],function(_0x34a1a5){return{'model':db[_0x34a1a5[_0x5497('0x24')]],'as':_0x34a1a5['as'],'attributes':_0x34a1a5[_0x5497('0x20')],'include':_0x34a1a5['include']?_[_0x5497('0x23')](_0x34a1a5['include'],function(_0x583d06){return{'model':db[_0x583d06['model']],'as':_0x583d06['as'],'attributes':_0x583d06[_0x5497('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e9356){logger[_0x5497('0x12')](_0x5497('0x1b'),_0x18e8a8);logger[_0x5497('0x25')]('GetMailAccount',_0x18e8a8,JSON['stringify'](_0x5e9356));_0x1b1b43(_0x5e9356);})['catch'](function(_0x371874){logger[_0x5497('0x16')](_0x5497('0x1b'),_0x371874['message'],_0x18e8a8);_0x1f6f18(_0x43da2c['error'](0x1f4,_0x371874['message']));});});};exports[_0x5497('0x26')]=function(_0x572460){var _0x438ee4=this;return new Promise(function(_0x258c2d,_0x77c575){return db['MailAccount'][_0x5497('0x27')]({'raw':_0x572460[_0x5497('0x1e')]?_0x572460['options'][_0x5497('0x1f')]===undefined?!![]:![]:!![],'where':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')]['where']||null:null,'attributes':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')][_0x5497('0x20')]||null:null,'include':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')]['include']?_[_0x5497('0x23')](_0x572460[_0x5497('0x1e')]['include'],function(_0x1ffc9b){return{'model':db[_0x1ffc9b[_0x5497('0x24')]],'as':_0x1ffc9b['as'],'attributes':_0x1ffc9b[_0x5497('0x20')],'include':_0x1ffc9b[_0x5497('0x22')]?_[_0x5497('0x23')](_0x1ffc9b[_0x5497('0x22')],function(_0x580e86){return{'model':db[_0x580e86[_0x5497('0x24')]],'as':_0x580e86['as'],'attributes':_0x580e86['attributes'],'include':_0x580e86[_0x5497('0x22')]?_[_0x5497('0x23')](_0x580e86[_0x5497('0x22')],function(_0x5ab18c){return{'model':db[_0x5ab18c['model']],'as':_0x5ab18c['as'],'attributes':_0x5ab18c[_0x5497('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5497('0x11')](function(_0x326d48){if(_0x572460[_0x5497('0x1e')][_0x5497('0x28')]===!![])_0x326d48[_0x5497('0x29')]('smtpOptions',_0x326d48[_0x5497('0x2a')]());logger[_0x5497('0x12')](_0x5497('0x26'),_0x572460);logger[_0x5497('0x25')](_0x5497('0x26'),_0x572460,JSON[_0x5497('0x15')](_0x326d48));_0x258c2d(_0x326d48);})[_0x5497('0x1a')](function(_0x179635){logger[_0x5497('0x16')]('ShowMailAccount',_0x179635[_0x5497('0x19')],_0x572460);_0x77c575(_0x438ee4[_0x5497('0x16')](0x1f4,_0x179635[_0x5497('0x19')]));});});};exports[_0x5497('0x2b')]=function(_0x15029d){var _0xa5ebe6=this;return new Promise(function(_0x4299be,_0x59ed13){var _0x3e5f7d={'body':_0x15029d[_0x5497('0x2c')],'channel':_0x5497('0x2d')};var _0x35993c=_[_0x5497('0x2e')](_[_0x5497('0x2f')](db[_0x5497('0x30')]['rawAttributes']),[_0x5497('0x31'),_0x5497('0x32'),_0x5497('0x33'),_0x5497('0x34')]);var _0x20e947=![];if(_0x15029d[_0x5497('0x2c')]['id']){delete _0x15029d[_0x5497('0x2c')]['id'];}if(_[_0x5497('0x35')](_0x15029d[_0x5497('0x2c')][_0x5497('0x36')])){return _0x59ed13(_0xa5ebe6['error'](0x1f4,_0x5497('0x37')));}if(_['isNil'](_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')])||_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')]===''){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5497('0x35')](_0x15029d[_0x5497('0x2c')]['mapKey'])){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35993c));}if(!_[_0x5497('0x38')](_0x35993c,_0x15029d['body'][_0x5497('0x39')])){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,_0x5497('0x3a')+_0x35993c));}var _0x3a852a={};_0x3a852a[_0x15029d[_0x5497('0x2c')]['mapKey']]=_0x15029d['body']['from'];return db['MailAccount'][_0x5497('0x27')]({'where':{'id':_0x15029d[_0x5497('0x3b')]['id']},'include':[{'model':db[_0x5497('0x3c')],'as':_0x5497('0x3d'),'include':[{'model':db[_0x5497('0x30')],'as':_0x5497('0x3e'),'where':_0x3a852a,'limit':0x1,'order':[[_0x5497('0x32'),_0x5497('0x3f')]]}]},{'model':db[_0x5497('0x40')],'as':'Applications'},{'model':db[_0x5497('0x41')],'as':_0x5497('0x42'),'include':[{'model':db[_0x5497('0x43')],'as':'CloudProvider'}]}]})[_0x5497('0x11')](function(_0x530475){if(_0x530475&&_0x530475[_0x5497('0x3d')]){var _0x31f1ba=_0x530475[_0x5497('0x44')]({'plain':!![]});_0x3e5f7d['account']=_[_0x5497('0x45')](_0x31f1ba,[_0x5497('0x46'),'List']);_0x3e5f7d[_0x5497('0x3b')]['smtpOptions']=_0x530475[_0x5497('0x2a')]();_0x3e5f7d['applications']=_0x31f1ba[_0x5497('0x46')];_0x3e5f7d[_0x5497('0x47')]=_0x31f1ba[_0x5497('0x3d')];_0x3e5f7d[_0x5497('0x48')]=_[_0x5497('0x49')](_0x3e5f7d[_0x5497('0x48')],[_0x5497('0x4a')],[_0x5497('0x4b')]);if(_0x3e5f7d['account']&&_0x3e5f7d[_0x5497('0x3b')]['autoclose']){_0x3e5f7d['applications'][_0x5497('0x4c')]({'id':0x0,'priority':_0x3e5f7d[_0x5497('0x48')]['length']+0x1,'app':_0x5497('0x4d'),'appdata':_0x5497('0x4e'),'interval':_0x5497('0x4f')});}if(_0x3e5f7d[_0x5497('0x3b')]['Applications']){delete _0x3e5f7d[_0x5497('0x3b')]['Applications'];}if(_0x3e5f7d['account'][_0x5497('0x3d')]){delete _0x3e5f7d[_0x5497('0x3b')][_0x5497('0x3d')];}if(_0x31f1ba['List']['Contacts'][_0x5497('0x50')]){return _0x31f1ba['List'][_0x5497('0x3e')][0x0];}var _0x530431=_[_0x5497('0xb')](_0x15029d['body'],{'firstName':_0x15029d[_0x5497('0x2c')][_0x5497('0x36')],'ListId':_0x31f1ba['ListId']});_0x530431[_0x15029d[_0x5497('0x2c')]['mapKey']]=_0x15029d['body'][_0x5497('0x36')];return db[_0x5497('0x30')]['create'](_0x530431);}else{throw new Error(_0x5497('0x51'));}})[_0x5497('0x11')](function(_0x1dbab2){_0x3e5f7d[_0x5497('0x52')]=_0x1dbab2;if(_0x1dbab2){if(!_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['messageId']){_0x15029d[_0x5497('0x2c')]['message']['messageId']=rs['generate']()+'\x20'+_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')];}var _0x544085={'ContactId':_0x1dbab2['id'],'MailAccountId':_0x15029d[_0x5497('0x3b')]['id'],'inReplyTo':_0x15029d['body']['message'][_0x5497('0x53')],'to':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')],'cc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['cc'],'subject':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x54')],'attach':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['attach'],'lastMsgAt':moment()[_0x5497('0x55')](_0x5497('0x56')),'lastMsgDirection':'in'};return db[_0x5497('0x57')][_0x5497('0x27')]({'where':{'closed':![],'MailAccountId':_0x15029d['account']['id']},'include':[{'model':db[_0x5497('0x58')],'as':_0x5497('0x59'),'attributes':[_0x5497('0x53')],'where':{'messageId':_0x15029d['body'][_0x5497('0x19')]['inReplyTo']}}]})['then'](function(_0x53e050){if(_0x53e050){return[_0x53e050,![]];}return db[_0x5497('0x57')][_0x5497('0x5a')](_0x544085)[_0x5497('0x11')](function(_0x4e7d4c){return[_0x4e7d4c,!![]];});});}else{throw new Error(_0x5497('0x5b'));}})[_0x5497('0x5c')](function(_0x3cfebc,_0x35e75a){if(_0x3cfebc){_0x20e947=_0x35e75a;if(!_0x35e75a){return _0x3cfebc['update']({'inReplyTo':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x53')],'to':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x36')],'cc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['cc'],'subject':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x54')],'attach':_0x3cfebc['attach']?_0x3cfebc[_0x5497('0x5d')]:_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x5d')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x5497('0x56')),'lastMsgDirection':'in'});}else{return _0x3cfebc;}}})[_0x5497('0x11')](function(_0x179bbc){_0x3e5f7d['interaction']=_0x179bbc[_0x5497('0x44')]({'plain':!![]});_0x3e5f7d[_0x5497('0x5e')][_0x5497('0x5f')]=_0x20e947;return db[_0x5497('0x58')][_0x5497('0x5a')]({'body':_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')],'MailAccountId':_0x15029d[_0x5497('0x3b')]['id'],'MailInteractionId':_0x179bbc['id'],'direction':'in','ContactId':_0x3e5f7d[_0x5497('0x52')]['id'],'messageId':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['messageId'],'from':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')],'to':_0x15029d['body'][_0x5497('0x19')]['to'],'cc':_0x15029d['body'][_0x5497('0x19')]['cc'],'subject':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x54')],'attach':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x5d')],'Attachments':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x60')],'originTo':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x61')],'originCc':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x62')],'bcc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['bcc'],'ChatWebsiteId':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x63')]||null,'originChannel':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x64')]||_0x5497('0x65'),'ChatOfflineMessageId':_0x15029d[_0x5497('0x2c')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x5497('0x66')],'as':_0x5497('0x67')}]});})['then'](function(_0x15ca59){_0x3e5f7d[_0x5497('0x19')]=_0x15ca59;if(_0x3e5f7d[_0x5497('0x5e')]['UserId']){return db[_0x5497('0x68')][_0x5497('0x27')]({'attributes':['id','name'],'where':{'id':_0x3e5f7d[_0x5497('0x5e')][_0x5497('0x69')]}})[_0x5497('0x11')](function(_0x42d745){if(_0x42d745){_0x3e5f7d[_0x5497('0x48')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5497('0x6a'),'appdata':_0x42d745[_0x5497('0x6b')]+','+(_0x3e5f7d[_0x5497('0x3b')][_0x5497('0x6c')]||0xa),'interval':_0x5497('0x4f')});}return respondWithRpcPromise('Start',_0x5497('0x6d'),_0x3e5f7d);});}return respondWithRpcPromise(_0x5497('0x6e'),_0x5497('0x6d'),_0x3e5f7d);})[_0x5497('0x11')](function(_0x521d74){_0x4299be(_0x521d74);})[_0x5497('0x1a')](function(_0x21fc4e){_0x59ed13(_0xa5ebe6['error'](0x1f4,_0x21fc4e[_0x5497('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index bc85fde..10701ea 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 _0x8433=['./mailAccount.events','save','remove','update','removeListener','register','length','mailAccount:'];(function(_0x42dde5,_0x592d9a){var _0x433fac=function(_0x228565){while(--_0x228565){_0x42dde5['push'](_0x42dde5['shift']());}};_0x433fac(++_0x592d9a);}(_0x8433,0x1d8));var _0x3843=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0x8433[_0x5027b1];return _0x4a46cf;};'use strict';var MailAccountEvents=require(_0x3843('0x0'));var events=[_0x3843('0x1'),_0x3843('0x2'),_0x3843('0x3')];function createListener(_0x43986e,_0x250d72){return function(_0x3ebd56){_0x250d72['emit'](_0x43986e,_0x3ebd56);};}function removeListener(_0x4c87c,_0x48407f){return function(){MailAccountEvents[_0x3843('0x4')](_0x4c87c,_0x48407f);};}exports[_0x3843('0x5')]=function(_0x10d5ec){for(var _0x2118f3=0x0,_0x15eb86=events[_0x3843('0x6')];_0x2118f3<_0x15eb86;_0x2118f3++){var _0x12d85a=events[_0x2118f3];var _0x7bcd82=createListener(_0x3843('0x7')+_0x12d85a,_0x10d5ec);MailAccountEvents['on'](_0x12d85a,_0x7bcd82);}}; \ No newline at end of file +var _0x3eae=['./mailAccount.events','save','remove','update','removeListener','length'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x3eae,0x126));var _0xe3ea=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x3eae[_0x1a7550];return _0x426e22;};'use strict';var MailAccountEvents=require(_0xe3ea('0x0'));var events=[_0xe3ea('0x1'),_0xe3ea('0x2'),_0xe3ea('0x3')];function createListener(_0x58f783,_0x11b5df){return function(_0xfa46c7){_0x11b5df['emit'](_0x58f783,_0xfa46c7);};}function removeListener(_0xfa8364,_0xc9d801){return function(){MailAccountEvents[_0xe3ea('0x4')](_0xfa8364,_0xc9d801);};}exports['register']=function(_0x20b837){for(var _0x345ccd=0x0,_0x216558=events[_0xe3ea('0x5')];_0x345ccd<_0x216558;_0x345ccd++){var _0x106123=events[_0x345ccd];var _0x2cc86f=createListener('mailAccount:'+_0x106123,_0x20b837);MailAccountEvents['on'](_0x106123,_0x2cc86f);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 1d97205..3a0528d 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 _0x0403=['./mailApplication.controller','get','/:id','isAuthenticated','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x261360,_0x30a73b){var _0x862dd5=function(_0x20cfa8){while(--_0x20cfa8){_0x261360['push'](_0x261360['shift']());}};_0x862dd5(++_0x30a73b);}(_0x0403,0x198));var _0x3040=function(_0x48d146,_0x5991dd){_0x48d146=_0x48d146-0x0;var _0xf7dbeb=_0x0403[_0x48d146];return _0xf7dbeb;};'use strict';var multer=require(_0x3040('0x0'));var util=require(_0x3040('0x1'));var path=require(_0x3040('0x2'));var timeout=require('connect-timeout');var express=require(_0x3040('0x3'));var router=express[_0x3040('0x4')]();var fs_extra=require(_0x3040('0x5'));var auth=require(_0x3040('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3040('0x7'));var controller=require(_0x3040('0x8'));router[_0x3040('0x9')](_0x3040('0xa'),auth[_0x3040('0xb')](),controller['show']);router[_0x3040('0xc')](_0x3040('0xa'),auth['isAuthenticated'](),controller[_0x3040('0xd')]);router[_0x3040('0xe')](_0x3040('0xa'),auth[_0x3040('0xb')](),controller['destroy']);module[_0x3040('0xf')]=router; \ No newline at end of file +var _0xdd23=['./mailApplication.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4507bf,_0xa092c7){var _0x3973ae=function(_0x58226c){while(--_0x58226c){_0x4507bf['push'](_0x4507bf['shift']());}};_0x3973ae(++_0xa092c7);}(_0xdd23,0x1d9));var _0x3dd2=function(_0x5350c8,_0x145bb8){_0x5350c8=_0x5350c8-0x0;var _0x4f75e3=_0xdd23[_0x5350c8];return _0x4f75e3;};'use strict';var multer=require('multer');var util=require(_0x3dd2('0x0'));var path=require(_0x3dd2('0x1'));var timeout=require(_0x3dd2('0x2'));var express=require(_0x3dd2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3dd2('0x4'));var interaction=require(_0x3dd2('0x5'));var config=require(_0x3dd2('0x6'));var controller=require(_0x3dd2('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3dd2('0x8')]('/:id',auth[_0x3dd2('0x9')](),controller[_0x3dd2('0xa')]);router[_0x3dd2('0xb')](_0x3dd2('0xc'),auth['isAuthenticated'](),controller[_0x3dd2('0xd')]);module[_0x3dd2('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index be56506..45995f8 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 _0xa312=['exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0xa312,0x159));var _0x2a31=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0xa312[_0x162780];return _0x1ea2dc;};'use strict';var Sequelize=require('sequelize');module[_0x2a31('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2a31('0x1')],'allowNull':![],'defaultValue':_0x2a31('0x2')},'appdata':{'type':Sequelize[_0x2a31('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2a31('0x4')}}; \ No newline at end of file +var _0xbdf7=['noop','*,*,*,*','exports','INTEGER','STRING'];(function(_0x2b6485,_0xbb4dc5){var _0x5e96bd=function(_0x2d9c76){while(--_0x2d9c76){_0x2b6485['push'](_0x2b6485['shift']());}};_0x5e96bd(++_0xbb4dc5);}(_0xbdf7,0x98));var _0x7bdf=function(_0x4e7dd9,_0x2ffcdd){_0x4e7dd9=_0x4e7dd9-0x0;var _0x570a2a=_0xbdf7[_0x4e7dd9];return _0x570a2a;};'use strict';var Sequelize=require('sequelize');module[_0x7bdf('0x0')]={'priority':{'type':Sequelize[_0x7bdf('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7bdf('0x2')],'allowNull':![],'defaultValue':_0x7bdf('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7bdf('0x2')]},'interval':{'type':Sequelize[_0x7bdf('0x2')],'defaultValue':_0x7bdf('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index e2eeff0..3686619 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 _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x25b15b,_0x5d6764){var _0x49dc15=function(_0x2efb1a){while(--_0x2efb1a){_0x25b15b['push'](_0x25b15b['shift']());}};_0x49dc15(++_0x5d6764);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file +var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x44f981,_0x19f8e0){var _0x28fb21=function(_0x4ddb62){while(--_0x4ddb62){_0x44f981['push'](_0x44f981['shift']());}};_0x28fb21(++_0x19f8e0);}(_0xac4a,0x13f));var _0xaac4=function(_0x315e26,_0xa4a803){_0x315e26=_0x315e26-0x0;var _0x1a420b=_0xac4a[_0x315e26];return _0x1a420b;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 3c6411e..49658e5 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 _0x52e5=['MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./mailApplication.attributes','exports','define'];(function(_0x23a971,_0x70b461){var _0x36c6d3=function(_0x3ccc4e){while(--_0x3ccc4e){_0x23a971['push'](_0x23a971['shift']());}};_0x36c6d3(++_0x70b461);}(_0x52e5,0xab));var _0x552e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x52e5[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x552e('0x0'));var util=require(_0x552e('0x1'));var logger=require(_0x552e('0x2'))(_0x552e('0x3'));var moment=require(_0x552e('0x4'));var BPromise=require('bluebird');var rp=require(_0x552e('0x5'));var fs=require('fs');var path=require(_0x552e('0x6'));var rimraf=require(_0x552e('0x7'));var config=require('../../config/environment');var attributes=require(_0x552e('0x8'));module[_0x552e('0x9')]=function(_0x363f30,_0x382542){return _0x363f30[_0x552e('0xa')](_0x552e('0xb'),attributes,{'tableName':_0x552e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x552e('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa850=['utf8mb4','util','moment','request-promise','./mailApplication.attributes','exports','MailApplication','mail_applications'];(function(_0x5ec543,_0x2085ec){var _0x1b75ee=function(_0x499c42){while(--_0x499c42){_0x5ec543['push'](_0x5ec543['shift']());}};_0x1b75ee(++_0x2085ec);}(_0xa850,0x1a9));var _0x0a85=function(_0x51b11f,_0x532d48){_0x51b11f=_0x51b11f-0x0;var _0x59d8ca=_0xa850[_0x51b11f];return _0x59d8ca;};'use strict';var _=require('lodash');var util=require(_0x0a85('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0a85('0x1'));var BPromise=require('bluebird');var rp=require(_0x0a85('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a85('0x3'));module[_0x0a85('0x4')]=function(_0x16b1d8,_0x944a0){return _0x16b1d8['define'](_0x0a85('0x5'),attributes,{'tableName':_0x0a85('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a85('0x7'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6eba9eb..ce95b76 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 _0xadea=['MailApplication','update','options','raw','where','limit','debug','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateMailApplication'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xadea,0x163));var _0xaade=function(_0x44ad4b,_0x13ccad){_0x44ad4b=_0x44ad4b-0x0;var _0x4c0516=_0xadea[_0x44ad4b];return _0x4c0516;};'use strict';var _=require('lodash');var util=require(_0xaade('0x0'));var moment=require(_0xaade('0x1'));var BPromise=require(_0xaade('0x2'));var rs=require(_0xaade('0x3'));var fs=require('fs');var Redis=require(_0xaade('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaade('0x5'))(_0xaade('0x6'));var config=require(_0xaade('0x7'));var jayson=require(_0xaade('0x8'));var client=jayson[_0xaade('0x9')][_0xaade('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d040d,_0x1f3543,_0x4cf9c9){return new BPromise(function(_0x56244d,_0x3c47ee){return client['request'](_0x3d040d,_0x4cf9c9)[_0xaade('0xb')](function(_0x17fbb5){logger[_0xaade('0xc')](_0xaade('0xd'),_0x1f3543,'request\x20sent');logger['debug'](_0xaade('0xe'),_0x1f3543,_0xaade('0xf'),JSON[_0xaade('0x10')](_0x17fbb5));if(_0x17fbb5['error']){if(_0x17fbb5[_0xaade('0x11')][_0xaade('0x12')]===0x1f4){logger[_0xaade('0x11')](_0xaade('0xd'),_0x1f3543,_0x17fbb5['error'][_0xaade('0x13')]);return _0x3c47ee(_0x17fbb5[_0xaade('0x11')][_0xaade('0x13')]);}logger['error'](_0xaade('0xd'),_0x1f3543,_0x17fbb5[_0xaade('0x11')]['message']);return _0x56244d(_0x17fbb5[_0xaade('0x11')][_0xaade('0x13')]);}else{logger['info'](_0xaade('0xd'),_0x1f3543,_0xaade('0xf'));_0x56244d(_0x17fbb5['result'][_0xaade('0x13')]);}})[_0xaade('0x14')](function(_0x3a33b9){logger[_0xaade('0x11')](_0xaade('0xd'),_0x1f3543,_0x3a33b9);_0x3c47ee(_0x3a33b9);});});}exports[_0xaade('0x15')]=function(_0x5cb404){var _0xadd70d=this;return new Promise(function(_0x5498ad,_0x49bf54){return db[_0xaade('0x16')][_0xaade('0x17')](_0x5cb404['body'],{'raw':_0x5cb404[_0xaade('0x18')]?_0x5cb404['options'][_0xaade('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cb404[_0xaade('0x18')]?_0x5cb404[_0xaade('0x18')][_0xaade('0x1a')]||null:null,'attributes':_0x5cb404[_0xaade('0x18')]?_0x5cb404[_0xaade('0x18')]['attributes']||null:null,'limit':_0x5cb404[_0xaade('0x18')]?_0x5cb404[_0xaade('0x18')][_0xaade('0x1b')]||null:null})['then'](function(_0x348f24){logger[_0xaade('0xc')](_0xaade('0x15'),_0x5cb404);logger[_0xaade('0x1c')]('UpdateMailApplication',_0x5cb404,JSON[_0xaade('0x10')](_0x348f24));_0x5498ad(_0x348f24);})[_0xaade('0x14')](function(_0x55816b){logger[_0xaade('0x11')]('UpdateMailApplication',_0x55816b[_0xaade('0x13')],_0x5cb404);_0x49bf54(_0xadd70d[_0xaade('0x11')](0x1f4,_0x55816b['message']));});});}; \ No newline at end of file +var _0x9b37=['../../mysqldb','../../config/utils','../../config/logger','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','result','catch','MailApplication','update','body','options','raw','where','attributes','info','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x34c692,_0x1da6c5){var _0x52ebb3=function(_0x23d86f){while(--_0x23d86f){_0x34c692['push'](_0x34c692['shift']());}};_0x52ebb3(++_0x1da6c5);}(_0x9b37,0x170));var _0x79b3=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x9b37[_0x56756b];return _0xa3002;};'use strict';var _=require(_0x79b3('0x0'));var util=require(_0x79b3('0x1'));var moment=require(_0x79b3('0x2'));var BPromise=require(_0x79b3('0x3'));var rs=require(_0x79b3('0x4'));var fs=require('fs');var Redis=require(_0x79b3('0x5'));var db=require(_0x79b3('0x6'))['db'];var utils=require(_0x79b3('0x7'));var logger=require(_0x79b3('0x8'))(_0x79b3('0x9'));var config=require(_0x79b3('0xa'));var jayson=require(_0x79b3('0xb'));var client=jayson[_0x79b3('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a2529,_0x39d118,_0x314c8c){return new BPromise(function(_0x31f583,_0x1e3136){return client[_0x79b3('0xd')](_0x5a2529,_0x314c8c)[_0x79b3('0xe')](function(_0x5d8f7c){logger['info'](_0x79b3('0xf'),_0x39d118,_0x79b3('0x10'));logger[_0x79b3('0x11')](_0x79b3('0x12'),_0x39d118,_0x79b3('0x10'),JSON[_0x79b3('0x13')](_0x5d8f7c));if(_0x5d8f7c[_0x79b3('0x14')]){if(_0x5d8f7c['error'][_0x79b3('0x15')]===0x1f4){logger[_0x79b3('0x14')](_0x79b3('0xf'),_0x39d118,_0x5d8f7c[_0x79b3('0x14')][_0x79b3('0x16')]);return _0x1e3136(_0x5d8f7c[_0x79b3('0x14')][_0x79b3('0x16')]);}logger[_0x79b3('0x14')]('MailApplication,\x20%s,\x20%s',_0x39d118,_0x5d8f7c[_0x79b3('0x14')][_0x79b3('0x16')]);return _0x31f583(_0x5d8f7c['error'][_0x79b3('0x16')]);}else{logger['info'](_0x79b3('0xf'),_0x39d118,_0x79b3('0x10'));_0x31f583(_0x5d8f7c[_0x79b3('0x17')][_0x79b3('0x16')]);}})[_0x79b3('0x18')](function(_0x219834){logger[_0x79b3('0x14')](_0x79b3('0xf'),_0x39d118,_0x219834);_0x1e3136(_0x219834);});});}exports['UpdateMailApplication']=function(_0x5eb981){var _0x146d5b=this;return new Promise(function(_0x41316e,_0x553691){return db[_0x79b3('0x19')][_0x79b3('0x1a')](_0x5eb981[_0x79b3('0x1b')],{'raw':_0x5eb981['options']?_0x5eb981[_0x79b3('0x1c')][_0x79b3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eb981['options']?_0x5eb981[_0x79b3('0x1c')][_0x79b3('0x1e')]||null:null,'attributes':_0x5eb981[_0x79b3('0x1c')]?_0x5eb981[_0x79b3('0x1c')][_0x79b3('0x1f')]||null:null,'limit':_0x5eb981[_0x79b3('0x1c')]?_0x5eb981['options']['limit']||null:null})['then'](function(_0x11cdd6){logger[_0x79b3('0x20')](_0x79b3('0x21'),_0x5eb981);logger[_0x79b3('0x11')](_0x79b3('0x21'),_0x5eb981,JSON['stringify'](_0x11cdd6));_0x41316e(_0x11cdd6);})[_0x79b3('0x18')](function(_0x3d6894){logger[_0x79b3('0x14')](_0x79b3('0x21'),_0x3d6894[_0x79b3('0x16')],_0x5eb981);_0x553691(_0x146d5b[_0x79b3('0x14')](0x1f4,_0x3d6894[_0x79b3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 2d10ece..6744096 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 _0xa1e0=['get','isAuthenticated','index','/describe','/:id','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','delete','tracked','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller'];(function(_0x1d211b,_0x475f3b){var _0x47c88b=function(_0x3126f5){while(--_0x3126f5){_0x1d211b['push'](_0x1d211b['shift']());}};_0x47c88b(++_0x475f3b);}(_0xa1e0,0x1bb));var _0x0a1e=function(_0x11804f,_0x4c00b0){_0x11804f=_0x11804f-0x0;var _0x237d61=_0xa1e0[_0x11804f];return _0x237d61;};'use strict';var express=require(_0x0a1e('0x0'));var router=express[_0x0a1e('0x1')]();var auth=require(_0x0a1e('0x2'));var interaction=require(_0x0a1e('0x3'));var controller=require(_0x0a1e('0x4'));router[_0x0a1e('0x5')]('/',auth[_0x0a1e('0x6')](),controller[_0x0a1e('0x7')]);router[_0x0a1e('0x5')](_0x0a1e('0x8'),auth[_0x0a1e('0x6')](),controller['describe']);router['get'](_0x0a1e('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x0a1e('0x5')]('/:id/messages',auth['isAuthenticated'](),controller[_0x0a1e('0xa')]);router[_0x0a1e('0x5')](_0x0a1e('0xb'),auth[_0x0a1e('0x6')](),controller[_0x0a1e('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0a1e('0xd')]);router[_0x0a1e('0xe')](_0x0a1e('0xf'),auth[_0x0a1e('0x6')](),controller[_0x0a1e('0x10')]);router[_0x0a1e('0xe')](_0x0a1e('0x11'),auth[_0x0a1e('0x6')](),interaction['tracked'](_0x0a1e('0x12'),_0x0a1e('0x13')),controller[_0x0a1e('0x14')]);router[_0x0a1e('0x15')]('/:id',auth[_0x0a1e('0x6')](),interaction['tracked'](_0x0a1e('0x12'),_0x0a1e('0x16')),controller['update']);router[_0x0a1e('0x17')](_0x0a1e('0x9'),auth[_0x0a1e('0x6')](),interaction[_0x0a1e('0x18')](_0x0a1e('0x12'),'mailinteraction:destroy'),controller[_0x0a1e('0x19')]);router[_0x0a1e('0x17')]('/:id/tags',auth[_0x0a1e('0x6')](),controller[_0x0a1e('0x1a')]);module[_0x0a1e('0x1b')]=router; \ No newline at end of file +var _0x16f5=['express','Router','../../components/interaction/service','./mailInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','show','getMessages','/:id/download','create','post','/:id/tags','mail','mailinteraction:addtags','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports'];(function(_0xfdf1fe,_0x4dde1d){var _0x234fe4=function(_0x1943ff){while(--_0x1943ff){_0xfdf1fe['push'](_0xfdf1fe['shift']());}};_0x234fe4(++_0x4dde1d);}(_0x16f5,0x138));var _0x516f=function(_0x391f13,_0x24d143){_0x391f13=_0x391f13-0x0;var _0x1fd2b2=_0x16f5[_0x391f13];return _0x1fd2b2;};'use strict';var express=require(_0x516f('0x0'));var router=express[_0x516f('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x516f('0x2'));var controller=require(_0x516f('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0x516f('0x4')]);router[_0x516f('0x5')](_0x516f('0x6'),auth[_0x516f('0x7')](),controller[_0x516f('0x8')]);router['get'](_0x516f('0x9'),auth[_0x516f('0x7')](),controller[_0x516f('0xa')]);router[_0x516f('0x5')]('/:id/messages',auth['isAuthenticated'](),controller[_0x516f('0xb')]);router[_0x516f('0x5')](_0x516f('0xc'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x516f('0xd')]);router[_0x516f('0xe')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x516f('0xe')](_0x516f('0xf'),auth['isAuthenticated'](),interaction['tracked'](_0x516f('0x10'),_0x516f('0x11')),controller['addTags']);router['put'](_0x516f('0x9'),auth[_0x516f('0x7')](),interaction[_0x516f('0x12')]('mail',_0x516f('0x13')),controller[_0x516f('0x14')]);router[_0x516f('0x15')](_0x516f('0x9'),auth['isAuthenticated'](),interaction[_0x516f('0x12')](_0x516f('0x10'),_0x516f('0x16')),controller[_0x516f('0x17')]);router[_0x516f('0x15')](_0x516f('0xf'),auth['isAuthenticated'](),controller[_0x516f('0x18')]);module[_0x516f('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 4c075e5..b89eb74 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 _0xe0ae=['exports','BOOLEAN','STRING','TEXT','DATE','ENUM','out'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0xe0ae,0xa1));var _0xee0a=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0xe0ae[_0x5eb22e];return _0x27fed5;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0xee0a('0x0')]={'closed':{'type':Sequelize[_0xee0a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xee0a('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xee0a('0x2')]},'note':{'type':Sequelize[_0xee0a('0x2')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xee0a('0x2')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0xee0a('0x3')]()},'attach':{'type':Sequelize[_0xee0a('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xee0a('0x4')]},'substatus':{'type':Sequelize[_0xee0a('0x2')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xee0a('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xee0a('0x5')]('in',_0xee0a('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xee0a('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x1fc7=['exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv'];(function(_0x1bdfda,_0x1c59e3){var _0x2ef92e=function(_0x17eda0){while(--_0x17eda0){_0x1bdfda['push'](_0x1bdfda['shift']());}};_0x2ef92e(++_0x1c59e3);}(_0x1fc7,0x1ca));var _0x71fc=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x1fc7[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0x71fc('0x0'));var iconv=require(_0x71fc('0x1'));module[_0x71fc('0x2')]={'closed':{'type':Sequelize[_0x71fc('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x71fc('0x4')]},'disposition':{'type':Sequelize[_0x71fc('0x5')]},'secondDisposition':{'type':Sequelize[_0x71fc('0x5')]},'thirdDisposition':{'type':Sequelize[_0x71fc('0x5')]},'note':{'type':Sequelize[_0x71fc('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x71fc('0x5')]},'cc':{'type':Sequelize[_0x71fc('0x6')](_0x71fc('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x71fc('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x71fc('0x4')]},'substatus':{'type':Sequelize[_0x71fc('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x71fc('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x71fc('0x8')]('in',_0x71fc('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x71fc('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x71fc('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x71fc('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index ebe9840..904cef8 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 _0xc84f=['files','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','get','mkdirSync','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','eml-format','rimraf','zip-dir','moment','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','defaults','socket.io-emitter','redis','./mailInteraction.socket','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','end','sendStatus','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','show','keys','filters','model','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','update','params','describe','addMessage','ids','getMessages','findOne','MailMessage','length','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','omit','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc84f,0x10b));var _0xfc84=function(_0x56c419,_0x69c2ca){_0x56c419=_0x56c419-0x0;var _0x467dfb=_0xc84f[_0x56c419];return _0x467dfb;};'use strict';var emlformat=require(_0xfc84('0x0'));var rimraf=require(_0xfc84('0x1'));var zipdir=require(_0xfc84('0x2'));var moment=require(_0xfc84('0x3'));var BPromise=require('bluebird');var util=require(_0xfc84('0x4'));var path=require(_0xfc84('0x5'));var fs=require('fs');var _=require(_0xfc84('0x6'));var juice=require(_0xfc84('0x7'));var Redis=require(_0xfc84('0x8'));var interaction=require(_0xfc84('0x9'));var qs=require(_0xfc84('0xa'));var logger=require(_0xfc84('0xb'))(_0xfc84('0xc'));var config=require(_0xfc84('0xd'));var db=require(_0xfc84('0xe'))['db'];var htmlEntities=require(_0xfc84('0xf'));config['redis']=_[_0xfc84('0x10')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfc84('0x11'))(new Redis(config[_0xfc84('0x12')]));require(_0xfc84('0x13'))['register'](socket);function respondWithStatusCode(_0x5cf452,_0x2dba42){_0x2dba42=_0x2dba42||0xcc;return function(_0x4056cd){if(_0x4056cd){return _0x5cf452['sendStatus'](_0x2dba42);}return _0x5cf452[_0xfc84('0x14')](_0x2dba42)['end']();};}function respondWithResult(_0x3f64c9,_0x52f7b5){_0x52f7b5=_0x52f7b5||0xc8;return function(_0x35f65b){if(_0x35f65b){return _0x3f64c9[_0xfc84('0x14')](_0x52f7b5)['json'](_0x35f65b);}};}function respondWithFilteredResult(_0x4e7e5c,_0x38ce37){return function(_0x573997){if(_0x573997){var _0x3bbada=typeof _0x38ce37[_0xfc84('0x15')]===_0xfc84('0x16')&&typeof _0x38ce37[_0xfc84('0x17')]===_0xfc84('0x16');var _0x1eab4c=_0x573997['count'];var _0x1b5b8e=_0x3bbada?0x0:_0x38ce37[_0xfc84('0x15')];var _0x62b7d0=_0x3bbada?_0x573997[_0xfc84('0x18')]:_0x38ce37[_0xfc84('0x15')]+_0x38ce37[_0xfc84('0x17')];var _0x3e9a83;if(_0x62b7d0>=_0x1eab4c){_0x62b7d0=_0x1eab4c;_0x3e9a83=0xc8;}else{_0x3e9a83=0xce;}_0x4e7e5c[_0xfc84('0x14')](_0x3e9a83);return _0x4e7e5c[_0xfc84('0x19')](_0xfc84('0x1a'),_0x1b5b8e+'-'+_0x62b7d0+'/'+_0x1eab4c)[_0xfc84('0x1b')](_0x573997);}return null;};}function saveUpdates(_0x15e775){return function(_0x20b43d){if(_0x20b43d){return _0x20b43d['update'](_0x15e775)[_0xfc84('0x1c')](function(_0x466041){return _0x466041;});}return null;};}function removeEntity(_0x52a2d8){return function(_0x42163e){if(_0x42163e){return _0x42163e[_0xfc84('0x1d')]()[_0xfc84('0x1c')](function(){_0x52a2d8['status'](0xcc)[_0xfc84('0x1e')]();});}};}function handleEntityNotFound(_0x18d8bb){return function(_0x533ced){if(!_0x533ced){_0x18d8bb[_0xfc84('0x1f')](0x194);}return _0x533ced;};}function handleError(_0x32cf14,_0x26a9f7){_0x26a9f7=_0x26a9f7||0x1f4;return function(_0xb87a6f){logger['error'](_0xb87a6f[_0xfc84('0x20')]);if(_0xb87a6f['name']){delete _0xb87a6f[_0xfc84('0x21')];}_0x32cf14['status'](_0x26a9f7)[_0xfc84('0x22')](_0xb87a6f);};}exports[_0xfc84('0x23')]=function(_0x26e24d,_0x5edaad){var _0x19428f={};var _0x3b7aa7=_[_0xfc84('0x24')](db[_0xfc84('0x25')][_0xfc84('0x26')],function(_0x341cbe){return{'name':_0x341cbe[_0xfc84('0x27')],'type':_0x341cbe[_0xfc84('0x28')][_0xfc84('0x29')]};});_0x19428f=qs[_0xfc84('0x2a')](_0x3b7aa7,_0x26e24d);return interaction[_0xfc84('0x2b')]('mail',_0x26e24d[_0xfc84('0x2c')],_0x26e24d[_0xfc84('0x2d')],_0x19428f,_0x3b7aa7)[_0xfc84('0x1c')](respondWithFilteredResult(_0x5edaad,_0x19428f))['catch'](handleError(_0x5edaad,null));};exports[_0xfc84('0x2e')]=function(_0x2d4c10,_0x49d57c){var _0x1fa0c8={'raw':![],'where':{'id':_0x2d4c10['params']['id']}},_0x174fa0={};_0x174fa0['model']=_[_0xfc84('0x2f')](db[_0xfc84('0x25')][_0xfc84('0x26')]);_0x174fa0[_0xfc84('0x2c')]=_['keys'](_0x2d4c10[_0xfc84('0x2c')]);_0x174fa0[_0xfc84('0x30')]=_['intersection'](_0x174fa0[_0xfc84('0x31')],_0x174fa0[_0xfc84('0x2c')]);_0x1fa0c8['attributes']=_[_0xfc84('0x32')](_0x174fa0['model'],qs[_0xfc84('0x33')](_0x2d4c10[_0xfc84('0x2c')][_0xfc84('0x33')]));_0x1fa0c8[_0xfc84('0x34')]=_0x1fa0c8[_0xfc84('0x34')]['length']?_0x1fa0c8[_0xfc84('0x34')]:_0x174fa0[_0xfc84('0x31')];if(_0x2d4c10[_0xfc84('0x2c')][_0xfc84('0x35')]){_0x1fa0c8[_0xfc84('0x36')]=[{'all':!![]}];}_0x1fa0c8=_[_0xfc84('0x37')]({},_0x1fa0c8,_0x2d4c10[_0xfc84('0x38')]);return db[_0xfc84('0x25')][_0xfc84('0x39')](_0x1fa0c8)[_0xfc84('0x1c')](handleEntityNotFound(_0x49d57c,null))['then'](respondWithResult(_0x49d57c,null))[_0xfc84('0x3a')](handleError(_0x49d57c,null));};exports['create']=function(_0x3b58fc,_0x48b608){return db[_0xfc84('0x25')]['create'](_0x3b58fc[_0xfc84('0x3b')],{})[_0xfc84('0x1c')](respondWithResult(_0x48b608,0xc9))['catch'](handleError(_0x48b608,null));};exports[_0xfc84('0x3c')]=function(_0xb142b7,_0x3bbc9e){if(_0xb142b7[_0xfc84('0x3b')]['id']){delete _0xb142b7[_0xfc84('0x3b')]['id'];}return db[_0xfc84('0x25')][_0xfc84('0x39')]({'where':{'id':_0xb142b7[_0xfc84('0x3d')]['id']}})[_0xfc84('0x1c')](handleEntityNotFound(_0x3bbc9e,null))[_0xfc84('0x1c')](saveUpdates(_0xb142b7[_0xfc84('0x3b')],null))[_0xfc84('0x1c')](respondWithResult(_0x3bbc9e,null))[_0xfc84('0x3a')](handleError(_0x3bbc9e,null));};exports[_0xfc84('0x1d')]=function(_0x3366dd,_0x3407b4){return db[_0xfc84('0x25')][_0xfc84('0x39')]({'where':{'id':_0x3366dd[_0xfc84('0x3d')]['id']}})[_0xfc84('0x1c')](handleEntityNotFound(_0x3407b4,null))[_0xfc84('0x1c')](removeEntity(_0x3407b4,null))['catch'](handleError(_0x3407b4,null));};exports[_0xfc84('0x3e')]=function(_0x39075c,_0x555a8a){return db[_0xfc84('0x25')][_0xfc84('0x3e')]()[_0xfc84('0x1c')](respondWithResult(_0x555a8a,null))[_0xfc84('0x3a')](handleError(_0x555a8a,null));};exports['addMessage']=function(_0x561d0d,_0x14f9b1){return db['MailMessage'][_0xfc84('0x39')]({'where':{'id':_0x561d0d['params']['id']}})[_0xfc84('0x1c')](handleEntityNotFound(_0x14f9b1,null))[_0xfc84('0x1c')](function(_0x419557){if(_0x419557){return _0x419557[_0xfc84('0x3f')](_0x561d0d[_0xfc84('0x3b')][_0xfc84('0x40')],_['omit'](_0x561d0d['body'],['ids','id'])||{});}})[_0xfc84('0x1c')](respondWithResult(_0x14f9b1,null))['catch'](handleError(_0x14f9b1,null));};exports[_0xfc84('0x41')]=function(_0x275592,_0x2033b8){var _0x860650={'raw':![],'where':{}};var _0x1f8484={};var _0x51c876={'count':0x0,'rows':[]};return db['MailInteraction'][_0xfc84('0x42')]({'where':{'id':_0x275592[_0xfc84('0x3d')]['id']}})[_0xfc84('0x1c')](handleEntityNotFound(_0x2033b8,null))['then'](function(_0x1559dd){if(_0x1559dd){_0x1f8484[_0xfc84('0x31')]=_[_0xfc84('0x2f')](db[_0xfc84('0x43')][_0xfc84('0x26')]);_0x1f8484[_0xfc84('0x2c')]=_[_0xfc84('0x2f')](_0x275592[_0xfc84('0x2c')]);_0x1f8484[_0xfc84('0x30')]=_[_0xfc84('0x32')](_0x1f8484[_0xfc84('0x31')],_0x1f8484[_0xfc84('0x2c')]);_0x860650[_0xfc84('0x34')]=_['intersection'](_0x1f8484[_0xfc84('0x31')],qs['fields'](_0x275592[_0xfc84('0x2c')]['fields']));_0x860650['attributes']=_0x860650[_0xfc84('0x34')][_0xfc84('0x44')]?_0x860650[_0xfc84('0x34')]:_0x1f8484[_0xfc84('0x31')];if(!_0x275592['query']['hasOwnProperty'](_0xfc84('0x45'))){_0x860650[_0xfc84('0x17')]=qs[_0xfc84('0x17')](_0x275592[_0xfc84('0x2c')][_0xfc84('0x17')]);_0x860650[_0xfc84('0x15')]=qs[_0xfc84('0x15')](_0x275592[_0xfc84('0x2c')][_0xfc84('0x15')]);}_0x860650[_0xfc84('0x46')]=qs[_0xfc84('0x47')](_0x275592[_0xfc84('0x2c')][_0xfc84('0x47')]);_0x860650[_0xfc84('0x48')]=qs[_0xfc84('0x30')](_[_0xfc84('0x49')](_0x275592['query'],_0x1f8484[_0xfc84('0x30')]));_0x860650[_0xfc84('0x48')][_0xfc84('0x4a')]=_0x1559dd['id'];if(_0x275592[_0xfc84('0x2c')][_0xfc84('0x4b')]){_0x860650[_0xfc84('0x48')]=_[_0xfc84('0x37')](_0x860650[_0xfc84('0x48')],{'$or':_[_0xfc84('0x24')](_0x860650['attributes'],function(_0x5215a8){var _0x33a618={};_0x33a618[_0x5215a8]={'$like':'%'+_0x275592[_0xfc84('0x2c')]['filter']+'%'};return _0x33a618;})});}if(_0x275592['query'][_0xfc84('0x4c')]){var _0x27a83f=_0x275592[_0xfc84('0x2c')][_0xfc84('0x4c')]['split'](',');var _0x268442={};_0x268442[_0x27a83f[0x0]]={'$gte':moment(_0x27a83f[0x1])[_0xfc84('0x4d')](_0xfc84('0x4e'))};_0x860650[_0xfc84('0x48')]=_[_0xfc84('0x37')](_0x860650[_0xfc84('0x48')],_0x268442);}_0x860650=_[_0xfc84('0x37')]({},_0x860650,_0x275592[_0xfc84('0x38')]);return db[_0xfc84('0x43')][_0xfc84('0x18')]({'where':_0x860650[_0xfc84('0x48')]})[_0xfc84('0x1c')](function(_0x243826){_0x51c876['count']=_0x243826;if(_0x275592[_0xfc84('0x2c')][_0xfc84('0x35')]){_0x860650[_0xfc84('0x36')]=[{'all':!![]}];}return db['MailMessage'][_0xfc84('0x2b')](_0x860650);})[_0xfc84('0x1c')](function(_0x3e0a18){if(_0x275592[_0xfc84('0x2c')][_0xfc84('0x4f')]===_0xfc84('0x50')){for(var _0x40be55=0x0;_0x40be55<_0x3e0a18[_0xfc84('0x44')];_0x40be55++){_0x3e0a18[_0x40be55][_0xfc84('0x3b')]=juice(_0x3e0a18[_0x40be55][_0xfc84('0x3b')]);}}_0x51c876[_0xfc84('0x51')]=_0x3e0a18;return _0x51c876;});}})[_0xfc84('0x1c')](respondWithFilteredResult(_0x2033b8,_0x860650))[_0xfc84('0x3a')](handleError(_0x2033b8,null));};exports[_0xfc84('0x52')]=function(_0x116395,_0x3046f3){return db['MailInteraction']['find']({'where':{'id':_0x116395['params']['id']}})[_0xfc84('0x1c')](handleEntityNotFound(_0x3046f3,null))[_0xfc84('0x1c')](function(_0x18a9ef){if(_0x18a9ef){return _0x18a9ef[_0xfc84('0x53')](_0x116395[_0xfc84('0x3b')]['ids'],_[_0xfc84('0x54')](_0x116395['body'],[_0xfc84('0x40'),'id'])||{})[_0xfc84('0x55')](function(){return db[_0xfc84('0x56')][_0xfc84('0x2b')]({'attributes':['id',_0xfc84('0x21'),_0xfc84('0x57')],'where':{'id':_0x116395[_0xfc84('0x3b')][_0xfc84('0x40')]}});})[_0xfc84('0x1c')](function(_0x526dcc){socket[_0xfc84('0x58')](_0xfc84('0x59'),{'id':Number(_0x116395['params']['id']),'tags':_0x526dcc||[]});return{'id':Number(_0x116395[_0xfc84('0x3d')]['id']),'tags':_0x526dcc||[]};});}})[_0xfc84('0x1c')](respondWithResult(_0x3046f3,null))[_0xfc84('0x3a')](handleError(_0x3046f3,null));};exports[_0xfc84('0x5a')]=function(_0x335cb3,_0x5002a5){return db[_0xfc84('0x25')][_0xfc84('0x39')]({'where':{'id':_0x335cb3[_0xfc84('0x3d')]['id']}})[_0xfc84('0x1c')](handleEntityNotFound(_0x5002a5,null))[_0xfc84('0x1c')](function(_0x26518e){if(_0x26518e){return _0x26518e[_0xfc84('0x5a')](_0x335cb3[_0xfc84('0x2c')][_0xfc84('0x40')]);}})[_0xfc84('0x1c')](respondWithStatusCode(_0x5002a5,null))['catch'](handleError(_0x5002a5,null));};exports[_0xfc84('0x5b')]=function(_0x49e0b5,_0x16afae){var _0x53da13=moment()[_0xfc84('0x5c')]()[_0xfc84('0x5d')]();var _0x4a9dcd=path[_0xfc84('0x5e')](config[_0xfc84('0x5f')],'server',_0xfc84('0x60'),'tmp');var _0x301bfd=path[_0xfc84('0x5e')](config['root'],'server',_0xfc84('0x60'),_0xfc84('0x61'));var _0x165486=path['join'](_0x4a9dcd,_0x53da13);var _0x554fcf=util[_0xfc84('0x4d')](_0xfc84('0x62'),_0x49e0b5['params']['id'],_0x53da13);var _0xca7b17=path[_0xfc84('0x5e')](_0x4a9dcd,_0x554fcf);var _0x53ac3c=[];if(_0x49e0b5[_0xfc84('0x2c')][_0xfc84('0x61')]){_0x53ac3c[_0xfc84('0x63')]({'model':db[_0xfc84('0x64')],'as':_0xfc84('0x65'),'raw':!![]});}var _0x48198d=[{'model':db[_0xfc84('0x43')],'as':_0xfc84('0x66'),'attributes':['id',_0xfc84('0x3b'),_0xfc84('0x67'),'to','cc',_0xfc84('0x68'),_0xfc84('0x69'),_0xfc84('0x6a')],'where':{'secret':![]},'order':qs[_0xfc84('0x47')]('id'),'include':_0x53ac3c}];return db[_0xfc84('0x25')][_0xfc84('0x39')]({'where':{'id':_0x49e0b5[_0xfc84('0x3d')]['id']},'include':_0x48198d})[_0xfc84('0x1c')](handleEntityNotFound(_0x16afae,null))[_0xfc84('0x1c')](function(_0xb6a132){if(_0xb6a132&&_0xb6a132[_0xfc84('0x66')]){var _0x4c3be3=_0xb6a132[_0xfc84('0x6b')]({'plain':!![]});fs[_0xfc84('0x6c')](_0x165486);return BPromise['each'](_0x4c3be3[_0xfc84('0x66')],function(_0x2074ef,_0x5467ab){var _0x512d9e={'from':_0x2074ef[_0xfc84('0x67')],'to':_0x2074ef['to']||_0xfc84('0x6d'),'subject':_0x2074ef[_0xfc84('0x69')],'html':htmlEntities[_0xfc84('0x6e')](_0x2074ef['body']),'headers':{'Date':moment(_0x2074ef['createdAt'])['format'](_0xfc84('0x6f'))},'attachments':[]};if(_0x2074ef['cc']){_0x512d9e[_0xfc84('0x70')]['Cc']=_0x2074ef['cc'];}if(_0x2074ef['bcc']){_0x512d9e['headers'][_0xfc84('0x71')]=_0x2074ef[_0xfc84('0x68')];}return new BPromise(function(_0x37d401,_0x556814){if(_0x2074ef[_0xfc84('0x65')]){for(var _0x2bbdf5=0x0;_0x2bbdf5<_0x2074ef[_0xfc84('0x65')][_0xfc84('0x44')];_0x2bbdf5++){var _0x141012=_0x2074ef[_0xfc84('0x65')][_0x2bbdf5];var _0x2f4650=path[_0xfc84('0x5e')](_0x301bfd,_0x141012[_0xfc84('0x72')]);if(fs[_0xfc84('0x73')](_0x2f4650)){_0x512d9e[_0xfc84('0x61')]['push']({'name':_0x141012['name'],'contentType':_0x141012[_0xfc84('0x28')],'data':fs[_0xfc84('0x74')](_0x2f4650)});}}}emlformat[_0xfc84('0x75')](_0x512d9e,function(_0x377f19,_0x392494){if(_0x377f19)return _0x556814(_0x377f19);fs[_0xfc84('0x76')](path['join'](_0x165486,util[_0xfc84('0x4d')](_0xfc84('0x77'),_0x5467ab)),_0x392494);return _0x37d401(_0x392494);});});})['then'](function(){return new BPromise(function(_0x2a7b4a,_0x2d2225){zipdir(_0x165486,{'saveTo':_0xca7b17},function(_0x18a510,_0x4c5205){if(_0x18a510)return _0x2d2225(_0x18a510);return _0x2a7b4a(_0x4c5205);});})[_0xfc84('0x1c')](function(){return new BPromise(function(_0x5f547f,_0x4ed964){rimraf(_0x165486,function(_0x197654){if(_0x197654)_0x4ed964(_0x197654);return _0x5f547f();});});})[_0xfc84('0x1c')](function(){return _0x16afae[_0xfc84('0x5b')](_0xca7b17,_0x554fcf,function(_0x522f84){if(!_0x522f84)fs[_0xfc84('0x78')](_0xca7b17);});});});}else{return _0x16afae[_0xfc84('0x1f')](0xc8);}})[_0xfc84('0x3a')](handleError(_0x16afae,null));}; \ No newline at end of file +var _0x1be8=['files','attachments','transcript-%d-%s.zip','Attachments','subject','createdAt','Messages','get','mkdirSync','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','basename','push','readFileSync','writeFileSync','unlinkSync','eml-format','zip-dir','moment','path','lodash','juice','../../components/interaction/service','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','destroy','then','end','error','stack','name','send','index','MailInteraction','type','key','getOptions','query','user','catch','show','keys','filters','intersection','model','fields','attributes','length','includeAll','merge','options','find','update','body','params','describe','addMessage','ids','omit','getMessages','findOne','rawAttributes','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','map','$gte','split','format','MailMessage','include','findAll','inlineCss','rows','addTags','setTags','spread','Tag','color','emit','removeTags','unix','toString','join','root','tmp','server'];(function(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0x1be8,0x15d));var _0x81be=function(_0x47dd05,_0x4aa69a){_0x47dd05=_0x47dd05-0x0;var _0x1ac7c7=_0x1be8[_0x47dd05];return _0x1ac7c7;};'use strict';var emlformat=require(_0x81be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x81be('0x1'));var moment=require(_0x81be('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x81be('0x3'));var fs=require('fs');var _=require(_0x81be('0x4'));var juice=require(_0x81be('0x5'));var Redis=require('ioredis');var interaction=require(_0x81be('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x81be('0x7'))(_0x81be('0x8'));var config=require('../../config/environment');var db=require(_0x81be('0x9'))['db'];var htmlEntities=require(_0x81be('0xa'));config[_0x81be('0xb')]=_[_0x81be('0xc')](config[_0x81be('0xb')],{'host':_0x81be('0xd'),'port':0x18eb});var socket=require(_0x81be('0xe'))(new Redis(config[_0x81be('0xb')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x2f2dfe,_0x3bd5ec){_0x3bd5ec=_0x3bd5ec||0xcc;return function(_0x5875c3){if(_0x5875c3){return _0x2f2dfe[_0x81be('0xf')](_0x3bd5ec);}return _0x2f2dfe[_0x81be('0x10')](_0x3bd5ec)['end']();};}function respondWithResult(_0x5b5083,_0x369f13){_0x369f13=_0x369f13||0xc8;return function(_0x5dc28a){if(_0x5dc28a){return _0x5b5083[_0x81be('0x10')](_0x369f13)['json'](_0x5dc28a);}};}function respondWithFilteredResult(_0x51f204,_0x4ae13a){return function(_0x178e38){if(_0x178e38){var _0x432c65=typeof _0x4ae13a['offset']===_0x81be('0x11')&&typeof _0x4ae13a[_0x81be('0x12')]===_0x81be('0x11');var _0x5383b8=_0x178e38[_0x81be('0x13')];var _0x4d9aec=_0x432c65?0x0:_0x4ae13a[_0x81be('0x14')];var _0xfa266=_0x432c65?_0x178e38[_0x81be('0x13')]:_0x4ae13a[_0x81be('0x14')]+_0x4ae13a[_0x81be('0x12')];var _0x1694a5;if(_0xfa266>=_0x5383b8){_0xfa266=_0x5383b8;_0x1694a5=0xc8;}else{_0x1694a5=0xce;}_0x51f204[_0x81be('0x10')](_0x1694a5);return _0x51f204[_0x81be('0x15')](_0x81be('0x16'),_0x4d9aec+'-'+_0xfa266+'/'+_0x5383b8)[_0x81be('0x17')](_0x178e38);}return null;};}function saveUpdates(_0x287981){return function(_0x407bce){if(_0x407bce){return _0x407bce['update'](_0x287981)['then'](function(_0x50e764){return _0x50e764;});}return null;};}function removeEntity(_0x53d17f){return function(_0x176865){if(_0x176865){return _0x176865[_0x81be('0x18')]()[_0x81be('0x19')](function(){_0x53d17f[_0x81be('0x10')](0xcc)[_0x81be('0x1a')]();});}};}function handleEntityNotFound(_0x1c8ad5){return function(_0xa0bf34){if(!_0xa0bf34){_0x1c8ad5[_0x81be('0xf')](0x194);}return _0xa0bf34;};}function handleError(_0x14b0d8,_0x555804){_0x555804=_0x555804||0x1f4;return function(_0x41c88d){logger[_0x81be('0x1b')](_0x41c88d[_0x81be('0x1c')]);if(_0x41c88d['name']){delete _0x41c88d[_0x81be('0x1d')];}_0x14b0d8[_0x81be('0x10')](_0x555804)[_0x81be('0x1e')](_0x41c88d);};}exports[_0x81be('0x1f')]=function(_0x2115dc,_0x2fe965){var _0xe3cc4e={};var _0x54c322=_['map'](db[_0x81be('0x20')]['rawAttributes'],function(_0x25144c){return{'name':_0x25144c['fieldName'],'type':_0x25144c[_0x81be('0x21')][_0x81be('0x22')]};});_0xe3cc4e=qs[_0x81be('0x23')](_0x54c322,_0x2115dc);return interaction['findAll']('mail',_0x2115dc[_0x81be('0x24')],_0x2115dc[_0x81be('0x25')],_0xe3cc4e,_0x54c322)[_0x81be('0x19')](respondWithFilteredResult(_0x2fe965,_0xe3cc4e))[_0x81be('0x26')](handleError(_0x2fe965,null));};exports[_0x81be('0x27')]=function(_0x37292d,_0x197b9b){var _0x11c8f4={'raw':![],'where':{'id':_0x37292d['params']['id']}},_0x94f5ac={};_0x94f5ac['model']=_[_0x81be('0x28')](db['MailInteraction']['rawAttributes']);_0x94f5ac['query']=_[_0x81be('0x28')](_0x37292d['query']);_0x94f5ac[_0x81be('0x29')]=_[_0x81be('0x2a')](_0x94f5ac[_0x81be('0x2b')],_0x94f5ac[_0x81be('0x24')]);_0x11c8f4['attributes']=_[_0x81be('0x2a')](_0x94f5ac[_0x81be('0x2b')],qs[_0x81be('0x2c')](_0x37292d['query'][_0x81be('0x2c')]));_0x11c8f4[_0x81be('0x2d')]=_0x11c8f4[_0x81be('0x2d')][_0x81be('0x2e')]?_0x11c8f4[_0x81be('0x2d')]:_0x94f5ac[_0x81be('0x2b')];if(_0x37292d[_0x81be('0x24')][_0x81be('0x2f')]){_0x11c8f4['include']=[{'all':!![]}];}_0x11c8f4=_[_0x81be('0x30')]({},_0x11c8f4,_0x37292d[_0x81be('0x31')]);return db[_0x81be('0x20')][_0x81be('0x32')](_0x11c8f4)['then'](handleEntityNotFound(_0x197b9b,null))['then'](respondWithResult(_0x197b9b,null))['catch'](handleError(_0x197b9b,null));};exports['create']=function(_0x164398,_0x20c0a3){return db[_0x81be('0x20')]['create'](_0x164398['body'],{})[_0x81be('0x19')](respondWithResult(_0x20c0a3,0xc9))[_0x81be('0x26')](handleError(_0x20c0a3,null));};exports[_0x81be('0x33')]=function(_0x3cb5d2,_0x12be3f){if(_0x3cb5d2[_0x81be('0x34')]['id']){delete _0x3cb5d2[_0x81be('0x34')]['id'];}return db['MailInteraction'][_0x81be('0x32')]({'where':{'id':_0x3cb5d2[_0x81be('0x35')]['id']}})['then'](handleEntityNotFound(_0x12be3f,null))[_0x81be('0x19')](saveUpdates(_0x3cb5d2[_0x81be('0x34')],null))[_0x81be('0x19')](respondWithResult(_0x12be3f,null))[_0x81be('0x26')](handleError(_0x12be3f,null));};exports[_0x81be('0x18')]=function(_0x484252,_0x2424e9){return db['MailInteraction'][_0x81be('0x32')]({'where':{'id':_0x484252['params']['id']}})[_0x81be('0x19')](handleEntityNotFound(_0x2424e9,null))['then'](removeEntity(_0x2424e9,null))[_0x81be('0x26')](handleError(_0x2424e9,null));};exports[_0x81be('0x36')]=function(_0x201a91,_0x5ede8b){return db[_0x81be('0x20')][_0x81be('0x36')]()['then'](respondWithResult(_0x5ede8b,null))['catch'](handleError(_0x5ede8b,null));};exports[_0x81be('0x37')]=function(_0x5c8f5b,_0x13b6ef){return db['MailMessage'][_0x81be('0x32')]({'where':{'id':_0x5c8f5b[_0x81be('0x35')]['id']}})[_0x81be('0x19')](handleEntityNotFound(_0x13b6ef,null))['then'](function(_0x3e89d8){if(_0x3e89d8){return _0x3e89d8['addMessage'](_0x5c8f5b['body'][_0x81be('0x38')],_[_0x81be('0x39')](_0x5c8f5b[_0x81be('0x34')],[_0x81be('0x38'),'id'])||{});}})[_0x81be('0x19')](respondWithResult(_0x13b6ef,null))[_0x81be('0x26')](handleError(_0x13b6ef,null));};exports[_0x81be('0x3a')]=function(_0x1b7723,_0xae77d6){var _0x12917f={'raw':![],'where':{}};var _0x333ea1={};var _0x3cee01={'count':0x0,'rows':[]};return db[_0x81be('0x20')][_0x81be('0x3b')]({'where':{'id':_0x1b7723[_0x81be('0x35')]['id']}})[_0x81be('0x19')](handleEntityNotFound(_0xae77d6,null))['then'](function(_0x2cd431){if(_0x2cd431){_0x333ea1['model']=_[_0x81be('0x28')](db['MailMessage'][_0x81be('0x3c')]);_0x333ea1['query']=_[_0x81be('0x28')](_0x1b7723[_0x81be('0x24')]);_0x333ea1['filters']=_[_0x81be('0x2a')](_0x333ea1[_0x81be('0x2b')],_0x333ea1[_0x81be('0x24')]);_0x12917f[_0x81be('0x2d')]=_[_0x81be('0x2a')](_0x333ea1[_0x81be('0x2b')],qs['fields'](_0x1b7723[_0x81be('0x24')][_0x81be('0x2c')]));_0x12917f[_0x81be('0x2d')]=_0x12917f[_0x81be('0x2d')][_0x81be('0x2e')]?_0x12917f['attributes']:_0x333ea1[_0x81be('0x2b')];if(!_0x1b7723[_0x81be('0x24')][_0x81be('0x3d')](_0x81be('0x3e'))){_0x12917f[_0x81be('0x12')]=qs[_0x81be('0x12')](_0x1b7723[_0x81be('0x24')][_0x81be('0x12')]);_0x12917f['offset']=qs[_0x81be('0x14')](_0x1b7723[_0x81be('0x24')]['offset']);}_0x12917f[_0x81be('0x3f')]=qs[_0x81be('0x40')](_0x1b7723[_0x81be('0x24')][_0x81be('0x40')]);_0x12917f[_0x81be('0x41')]=qs['filters'](_[_0x81be('0x42')](_0x1b7723['query'],_0x333ea1['filters']));_0x12917f['where'][_0x81be('0x43')]=_0x2cd431['id'];if(_0x1b7723[_0x81be('0x24')][_0x81be('0x44')]){_0x12917f[_0x81be('0x41')]=_['merge'](_0x12917f[_0x81be('0x41')],{'$or':_[_0x81be('0x45')](_0x12917f[_0x81be('0x2d')],function(_0x51df50){var _0x4acc9d={};_0x4acc9d[_0x51df50]={'$like':'%'+_0x1b7723[_0x81be('0x24')][_0x81be('0x44')]+'%'};return _0x4acc9d;})});}if(_0x1b7723[_0x81be('0x24')]['$gte']){var _0x5f01b1=_0x1b7723[_0x81be('0x24')][_0x81be('0x46')][_0x81be('0x47')](',');var _0x32f34f={};_0x32f34f[_0x5f01b1[0x0]]={'$gte':moment(_0x5f01b1[0x1])[_0x81be('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x12917f['where']=_[_0x81be('0x30')](_0x12917f[_0x81be('0x41')],_0x32f34f);}_0x12917f=_[_0x81be('0x30')]({},_0x12917f,_0x1b7723[_0x81be('0x31')]);return db[_0x81be('0x49')][_0x81be('0x13')]({'where':_0x12917f['where']})['then'](function(_0x4a5918){_0x3cee01[_0x81be('0x13')]=_0x4a5918;if(_0x1b7723[_0x81be('0x24')]['includeAll']){_0x12917f[_0x81be('0x4a')]=[{'all':!![]}];}return db[_0x81be('0x49')][_0x81be('0x4b')](_0x12917f);})[_0x81be('0x19')](function(_0x4d7979){if(_0x1b7723[_0x81be('0x24')][_0x81be('0x4c')]==='true'){for(var _0x1d413d=0x0;_0x1d413d<_0x4d7979[_0x81be('0x2e')];_0x1d413d++){_0x4d7979[_0x1d413d][_0x81be('0x34')]=juice(_0x4d7979[_0x1d413d][_0x81be('0x34')]);}}_0x3cee01[_0x81be('0x4d')]=_0x4d7979;return _0x3cee01;});}})[_0x81be('0x19')](respondWithFilteredResult(_0xae77d6,_0x12917f))[_0x81be('0x26')](handleError(_0xae77d6,null));};exports[_0x81be('0x4e')]=function(_0x191ede,_0xff821c){return db[_0x81be('0x20')][_0x81be('0x32')]({'where':{'id':_0x191ede['params']['id']}})[_0x81be('0x19')](handleEntityNotFound(_0xff821c,null))[_0x81be('0x19')](function(_0x2228b1){if(_0x2228b1){return _0x2228b1[_0x81be('0x4f')](_0x191ede[_0x81be('0x34')]['ids'],_[_0x81be('0x39')](_0x191ede[_0x81be('0x34')],[_0x81be('0x38'),'id'])||{})[_0x81be('0x50')](function(){return db[_0x81be('0x51')][_0x81be('0x4b')]({'attributes':['id',_0x81be('0x1d'),_0x81be('0x52')],'where':{'id':_0x191ede['body'][_0x81be('0x38')]}});})[_0x81be('0x19')](function(_0x29de6e){socket[_0x81be('0x53')]('mailInteractionTags:save',{'id':Number(_0x191ede[_0x81be('0x35')]['id']),'tags':_0x29de6e||[]});return{'id':Number(_0x191ede[_0x81be('0x35')]['id']),'tags':_0x29de6e||[]};});}})[_0x81be('0x19')](respondWithResult(_0xff821c,null))[_0x81be('0x26')](handleError(_0xff821c,null));};exports[_0x81be('0x54')]=function(_0xe8c6e2,_0x5c626c){return db[_0x81be('0x20')]['find']({'where':{'id':_0xe8c6e2[_0x81be('0x35')]['id']}})[_0x81be('0x19')](handleEntityNotFound(_0x5c626c,null))[_0x81be('0x19')](function(_0x3b1e64){if(_0x3b1e64){return _0x3b1e64['removeTags'](_0xe8c6e2[_0x81be('0x24')]['ids']);}})[_0x81be('0x19')](respondWithStatusCode(_0x5c626c,null))['catch'](handleError(_0x5c626c,null));};exports['download']=function(_0x107937,_0x2931f2){var _0x2211ae=moment()[_0x81be('0x55')]()[_0x81be('0x56')]();var _0x474800=path[_0x81be('0x57')](config[_0x81be('0x58')],'server','files',_0x81be('0x59'));var _0x5857ea=path[_0x81be('0x57')](config['root'],_0x81be('0x5a'),_0x81be('0x5b'),_0x81be('0x5c'));var _0x26bce3=path[_0x81be('0x57')](_0x474800,_0x2211ae);var _0x559442=util[_0x81be('0x48')](_0x81be('0x5d'),_0x107937[_0x81be('0x35')]['id'],_0x2211ae);var _0x5d44f0=path[_0x81be('0x57')](_0x474800,_0x559442);var _0x1fb96a=[];if(_0x107937[_0x81be('0x24')]['attachments']){_0x1fb96a['push']({'model':db['Attachment'],'as':_0x81be('0x5e'),'raw':!![]});}var _0x21d9f4=[{'model':db[_0x81be('0x49')],'as':'Messages','attributes':['id','body','from','to','cc','bcc',_0x81be('0x5f'),_0x81be('0x60')],'where':{'secret':![]},'order':qs[_0x81be('0x40')]('id'),'include':_0x1fb96a}];return db[_0x81be('0x20')]['find']({'where':{'id':_0x107937[_0x81be('0x35')]['id']},'include':_0x21d9f4})[_0x81be('0x19')](handleEntityNotFound(_0x2931f2,null))['then'](function(_0x93e1c){if(_0x93e1c&&_0x93e1c[_0x81be('0x61')]){var _0x207905=_0x93e1c[_0x81be('0x62')]({'plain':!![]});fs[_0x81be('0x63')](_0x26bce3);return BPromise['each'](_0x207905['Messages'],function(_0x355a87,_0x26397e){var _0x3c5e9c={'from':_0x355a87[_0x81be('0x64')],'to':_0x355a87['to']||'missing.recipient@your.company.com','subject':_0x355a87[_0x81be('0x5f')],'html':htmlEntities[_0x81be('0x65')](_0x355a87[_0x81be('0x34')]),'headers':{'Date':moment(_0x355a87['createdAt'])['format'](_0x81be('0x66'))},'attachments':[]};if(_0x355a87['cc']){_0x3c5e9c[_0x81be('0x67')]['Cc']=_0x355a87['cc'];}if(_0x355a87[_0x81be('0x68')]){_0x3c5e9c['headers']['Bcc']=_0x355a87[_0x81be('0x68')];}return new BPromise(function(_0x40c6da,_0xf0edd0){if(_0x355a87[_0x81be('0x5e')]){for(var _0x3c0235=0x0;_0x3c0235<_0x355a87[_0x81be('0x5e')][_0x81be('0x2e')];_0x3c0235++){var _0x382c95=_0x355a87['Attachments'][_0x3c0235];var _0x268f65=path[_0x81be('0x57')](_0x5857ea,_0x382c95[_0x81be('0x69')]);if(fs['existsSync'](_0x268f65)){_0x3c5e9c[_0x81be('0x5c')][_0x81be('0x6a')]({'name':_0x382c95[_0x81be('0x1d')],'contentType':_0x382c95[_0x81be('0x21')],'data':fs[_0x81be('0x6b')](_0x268f65)});}}}emlformat['build'](_0x3c5e9c,function(_0x5ab65e,_0x1b3811){if(_0x5ab65e)return _0xf0edd0(_0x5ab65e);fs[_0x81be('0x6c')](path[_0x81be('0x57')](_0x26bce3,util[_0x81be('0x48')]('message%d.eml',_0x26397e)),_0x1b3811);return _0x40c6da(_0x1b3811);});});})['then'](function(){return new BPromise(function(_0x1c8650,_0x15b284){zipdir(_0x26bce3,{'saveTo':_0x5d44f0},function(_0x5a2c3d,_0x4e2045){if(_0x5a2c3d)return _0x15b284(_0x5a2c3d);return _0x1c8650(_0x4e2045);});})['then'](function(){return new BPromise(function(_0x5e9acd,_0x5f1b2e){rimraf(_0x26bce3,function(_0x15ad1b){if(_0x15ad1b)_0x5f1b2e(_0x15ad1b);return _0x5e9acd();});});})[_0x81be('0x19')](function(){return _0x2931f2['download'](_0x5d44f0,_0x559442,function(_0x2baf78){if(!_0x2baf78)fs[_0x81be('0x6d')](_0x5d44f0);});});});}else{return _0x2931f2['sendStatus'](0xc8);}})[_0x81be('0x26')](handleError(_0x2931f2,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 9494f80..69dae7a 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 _0x9c5e=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x2ebfee,_0x134131){var _0x149852=function(_0x50bf2f){while(--_0x50bf2f){_0x2ebfee['push'](_0x2ebfee['shift']());}};_0x149852(++_0x134131);}(_0x9c5e,0x113));var _0xe9c5=function(_0x2ea44f,_0x1e5e99){_0x2ea44f=_0x2ea44f-0x0;var _0x347f86=_0x9c5e[_0x2ea44f];return _0x347f86;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xe9c5('0x0'))['db'][_0xe9c5('0x1')];var MailMessage=require(_0xe9c5('0x0'))['db'][_0xe9c5('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xe9c5('0x3')](0x0);var events={'afterCreate':_0xe9c5('0x4'),'afterUpdate':_0xe9c5('0x5'),'afterDestroy':_0xe9c5('0x6')};function emitEvent(_0x34e50e){return function(_0x343bba,_0x3b6aa6,_0x1f2cfe){_0x343bba[_0xe9c5('0x7')]({'attributes':['id'],'raw':!![]})[_0xe9c5('0x8')](function(_0x4c76af){_0x343bba[_0xe9c5('0x9')](_0xe9c5('0xa'),_0x4c76af[_0xe9c5('0xb')](function(_0x55d0bd){return{'id':_0x55d0bd['id']};}));return MailMessage[_0xe9c5('0xc')]({'where':{'MailInteractionId':_0x343bba['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe9c5('0x8')](function(_0x51d46e){_0x343bba['setDataValue'](_0xe9c5('0xd'),_0x51d46e[_0xe9c5('0xe')]);MailInteractionEvents['emit'](_0x34e50e+':'+_0x343bba['id'],_0x343bba);MailInteractionEvents[_0xe9c5('0xf')](_0x34e50e,_0x343bba);_0x1f2cfe(null);})[_0xe9c5('0x10')](_0x1f2cfe(null));};}for(var e in events){if(events[_0xe9c5('0x11')](e)){var event=events[e];MailInteraction[_0xe9c5('0x12')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x6044=['catch','exports','events','../../mysqldb','setMaxListeners','save','remove','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x31637e,_0x1142e4){var _0x3be315=function(_0x485bb6){while(--_0x485bb6){_0x31637e['push'](_0x31637e['shift']());}};_0x3be315(++_0x1142e4);}(_0x6044,0xc6));var _0x4604=function(_0x4ff9e4,_0x2db750){_0x4ff9e4=_0x4ff9e4-0x0;var _0x168b23=_0x6044[_0x4ff9e4];return _0x168b23;};'use strict';var EventEmitter=require(_0x4604('0x0'));var MailInteraction=require(_0x4604('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4604('0x2')](0x0);var events={'afterCreate':_0x4604('0x3'),'afterUpdate':'update','afterDestroy':_0x4604('0x4')};function emitEvent(_0x4d83c5){return function(_0x8fc38e,_0x3e57da,_0x2e0065){_0x8fc38e['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xa5758b){_0x8fc38e['setDataValue'](_0x4604('0x5'),_0xa5758b[_0x4604('0x6')](function(_0x498053){return{'id':_0x498053['id']};}));return MailMessage[_0x4604('0x7')]({'where':{'MailInteractionId':_0x8fc38e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4604('0x8')](function(_0x2e233e){_0x8fc38e['setDataValue'](_0x4604('0x9'),_0x2e233e[_0x4604('0xa')]);MailInteractionEvents[_0x4604('0xb')](_0x4d83c5+':'+_0x8fc38e['id'],_0x8fc38e);MailInteractionEvents[_0x4604('0xb')](_0x4d83c5,_0x8fc38e);_0x2e0065(null);})[_0x4604('0xc')](_0x2e0065(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x4604('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 139cf3a..45400e1 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 _0x0037=['substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','MailMessage','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus'];(function(_0x19b933,_0x4bda02){var _0x591757=function(_0x418309){while(--_0x418309){_0x19b933['push'](_0x19b933['shift']());}};_0x591757(++_0x4bda02);}(_0x0037,0xd3));var _0x7003=function(_0x771187,_0x14a239){_0x771187=_0x771187-0x0;var _0x2b8e04=_0x0037[_0x771187];return _0x2b8e04;};'use strict';var _=require('lodash');var util=require(_0x7003('0x0'));var logger=require(_0x7003('0x1'))('api');var moment=require(_0x7003('0x2'));var BPromise=require(_0x7003('0x3'));var rp=require(_0x7003('0x4'));var fs=require('fs');var path=require(_0x7003('0x5'));var rimraf=require('rimraf');var config=require(_0x7003('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x7003('0x7')]=function(_0x2a8a6e,_0x5ec135){return _0x2a8a6e[_0x7003('0x8')]('MailInteraction',attributes,{'tableName':_0x7003('0x9'),'paranoid':![],'indexes':[{'name':_0x7003('0xa'),'fields':[_0x7003('0xb'),'to'],'type':_0x7003('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x380545,_0x58d970,_0x4babf9){if(_0x380545[_0x7003('0xd')]){_0x380545[_0x7003('0xe')]=moment()[_0x7003('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x380545[_0x7003('0x10')]){_0x380545[_0x7003('0x11')]=moment()['format'](_0x7003('0x12'));}_0x4babf9(null,_0x58d970);},'beforeUpdate':function(_0x3dc26f,_0x15bd8c,_0x151ca7){if(_0x3dc26f[_0x7003('0x13')]('substatus')){_0x3dc26f['substatusAt']=_0x3dc26f[_0x7003('0xd')]?moment()[_0x7003('0xf')](_0x7003('0x12')):null;}if(_0x3dc26f['changed'](_0x7003('0x10'))){_0x3dc26f[_0x7003('0x11')]=moment()[_0x7003('0xf')](_0x7003('0x12'));_0x3dc26f[_0x7003('0xd')]=null;_0x3dc26f[_0x7003('0xe')]=null;}_0x151ca7(null,_0x3dc26f);},'afterUpdate':function(_0x4acf3d,_0x1be577,_0x549094){var _0x374122=_0x2a8a6e[_0x7003('0x14')];var _0x17208f=_0x4acf3d['get']({'plain':!![]});if(_0x17208f[_0x7003('0x10')]){return _0x374122[_0x7003('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x17208f['id']}})['then'](function(){_0x549094();})[_0x7003('0x16')](function(_0x1032d4){_0x549094(_0x1032d4);});}else{_0x549094();}}},'charset':_0x7003('0x17'),'collate':_0x7003('0x18')});}; \ No newline at end of file +var _0xc7bb=['changed','models','get','closed','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt'];(function(_0x28b56c,_0x20a64b){var _0x41c163=function(_0x3628db){while(--_0x3628db){_0x28b56c['push'](_0x28b56c['shift']());}};_0x41c163(++_0x20a64b);}(_0xc7bb,0x16a));var _0xbc7b=function(_0x253ddf,_0xc66802){_0x253ddf=_0x253ddf-0x0;var _0x20bdd7=_0xc7bb[_0x253ddf];return _0x20bdd7;};'use strict';var _=require(_0xbc7b('0x0'));var util=require(_0xbc7b('0x1'));var logger=require(_0xbc7b('0x2'))(_0xbc7b('0x3'));var moment=require(_0xbc7b('0x4'));var BPromise=require(_0xbc7b('0x5'));var rp=require(_0xbc7b('0x6'));var fs=require('fs');var path=require(_0xbc7b('0x7'));var rimraf=require(_0xbc7b('0x8'));var config=require(_0xbc7b('0x9'));var attributes=require(_0xbc7b('0xa'));module[_0xbc7b('0xb')]=function(_0x494982,_0x5120d8){return _0x494982[_0xbc7b('0xc')](_0xbc7b('0xd'),attributes,{'tableName':_0xbc7b('0xe'),'paranoid':![],'indexes':[{'name':_0xbc7b('0xf'),'fields':['subject','to'],'type':_0xbc7b('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2089c8,_0x57d9f4,_0x5e7365){if(_0x2089c8[_0xbc7b('0x11')]){_0x2089c8[_0xbc7b('0x12')]=moment()[_0xbc7b('0x13')](_0xbc7b('0x14'));}if(_0x2089c8['closed']){_0x2089c8[_0xbc7b('0x15')]=moment()['format'](_0xbc7b('0x14'));}_0x5e7365(null,_0x57d9f4);},'beforeUpdate':function(_0x24ab7e,_0x5103e7,_0x36db55){if(_0x24ab7e[_0xbc7b('0x16')](_0xbc7b('0x11'))){_0x24ab7e['substatusAt']=_0x24ab7e[_0xbc7b('0x11')]?moment()['format'](_0xbc7b('0x14')):null;}if(_0x24ab7e[_0xbc7b('0x16')]('closed')){_0x24ab7e[_0xbc7b('0x15')]=moment()['format'](_0xbc7b('0x14'));_0x24ab7e['substatus']=null;_0x24ab7e[_0xbc7b('0x12')]=null;}_0x36db55(null,_0x24ab7e);},'afterUpdate':function(_0x18d786,_0x109de5,_0x502097){var _0x299c16=_0x494982[_0xbc7b('0x17')];var _0x1be088=_0x18d786[_0xbc7b('0x18')]({'plain':!![]});if(_0x1be088[_0xbc7b('0x19')]){return _0x299c16[_0xbc7b('0x1a')][_0xbc7b('0x1b')]({'read':!![]},{'where':{'MailInteractionId':_0x1be088['id']}})[_0xbc7b('0x1c')](function(){_0x502097();})[_0xbc7b('0x1d')](function(_0x416257){_0x502097(_0x416257);});}else{_0x502097();}}},'charset':_0xbc7b('0x1e'),'collate':_0xbc7b('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 8224e31..ffcb83a 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 _0xe170=['request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','update','body','options','raw','where','attributes','info','AddTagsToMailInteraction','addTags','ids','omit','AddTags','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register'];(function(_0x45ee03,_0x2f5319){var _0x13d535=function(_0x391904){while(--_0x391904){_0x45ee03['push'](_0x45ee03['shift']());}};_0x13d535(++_0x2f5319);}(_0xe170,0x1b3));var _0x0e17=function(_0x53cd9f,_0xac8289){_0x53cd9f=_0x53cd9f-0x0;var _0x3cab9e=_0xe170[_0x53cd9f];return _0x3cab9e;};'use strict';var _=require(_0x0e17('0x0'));var util=require(_0x0e17('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e17('0x2'))['db'];var utils=require(_0x0e17('0x3'));var logger=require(_0x0e17('0x4'))(_0x0e17('0x5'));var config=require(_0x0e17('0x6'));var jayson=require(_0x0e17('0x7'));var client=jayson[_0x0e17('0x8')][_0x0e17('0x9')]({'port':0x232a});config[_0x0e17('0xa')]=_[_0x0e17('0xb')](config['redis'],{'host':_0x0e17('0xc'),'port':0x18eb});var socket=require(_0x0e17('0xd'))(new Redis(config[_0x0e17('0xa')]));require(_0x0e17('0xe'))[_0x0e17('0xf')](socket);function respondWithRpcPromise(_0x562b8c,_0x14d164,_0x3ade62){return new BPromise(function(_0x26b9bf,_0x358cd6){return client[_0x0e17('0x10')](_0x562b8c,_0x3ade62)[_0x0e17('0x11')](function(_0xd1e521){logger['info'](_0x0e17('0x12'),_0x14d164,_0x0e17('0x13'));logger[_0x0e17('0x14')](_0x0e17('0x15'),_0x14d164,_0x0e17('0x13'),JSON[_0x0e17('0x16')](_0xd1e521));if(_0xd1e521[_0x0e17('0x17')]){if(_0xd1e521[_0x0e17('0x17')][_0x0e17('0x18')]===0x1f4){logger[_0x0e17('0x17')]('MailInteraction,\x20%s,\x20%s',_0x14d164,_0xd1e521['error'][_0x0e17('0x19')]);return _0x358cd6(_0xd1e521[_0x0e17('0x17')][_0x0e17('0x19')]);}logger[_0x0e17('0x17')](_0x0e17('0x12'),_0x14d164,_0xd1e521[_0x0e17('0x17')][_0x0e17('0x19')]);return _0x26b9bf(_0xd1e521[_0x0e17('0x17')][_0x0e17('0x19')]);}else{logger['info'](_0x0e17('0x12'),_0x14d164,_0x0e17('0x13'));_0x26b9bf(_0xd1e521[_0x0e17('0x1a')][_0x0e17('0x19')]);}})[_0x0e17('0x1b')](function(_0x4f0855){logger[_0x0e17('0x17')](_0x0e17('0x12'),_0x14d164,_0x4f0855);_0x358cd6(_0x4f0855);});});}exports[_0x0e17('0x1c')]=function(_0x5821fe){var _0x4aaf47=this;return new Promise(function(_0x3394d5,_0x5d0a56){return db['MailInteraction'][_0x0e17('0x1d')](_0x5821fe[_0x0e17('0x1e')],{'raw':_0x5821fe[_0x0e17('0x1f')]?_0x5821fe[_0x0e17('0x1f')][_0x0e17('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5821fe[_0x0e17('0x1f')]?_0x5821fe['options'][_0x0e17('0x21')]||null:null,'attributes':_0x5821fe[_0x0e17('0x1f')]?_0x5821fe[_0x0e17('0x1f')][_0x0e17('0x22')]||null:null,'limit':_0x5821fe[_0x0e17('0x1f')]?_0x5821fe[_0x0e17('0x1f')]['limit']||null:null})[_0x0e17('0x11')](function(_0x62e57e){logger[_0x0e17('0x23')]('UpdateMailInteraction',_0x5821fe);logger[_0x0e17('0x14')]('UpdateMailInteraction',_0x5821fe,JSON['stringify'](_0x62e57e));_0x3394d5(_0x62e57e);})['catch'](function(_0x5a85c6){logger[_0x0e17('0x17')](_0x0e17('0x1c'),_0x5a85c6['message'],_0x5821fe);_0x5d0a56(_0x4aaf47['error'](0x1f4,_0x5a85c6[_0x0e17('0x19')]));});});};exports[_0x0e17('0x24')]=function(_0x5bc00b){return new Promise(function(_0x56ddba,_0x14801a){return db['MailInteraction']['find']({'where':_0x5bc00b[_0x0e17('0x1f')]?_0x5bc00b[_0x0e17('0x1f')][_0x0e17('0x21')]||null:null})[_0x0e17('0x11')](function(_0x4943d4){if(_0x4943d4){return _0x4943d4[_0x0e17('0x25')](_0x5bc00b['body'][_0x0e17('0x26')],_[_0x0e17('0x27')](_0x5bc00b[_0x0e17('0x1e')],['ids','id'])||{});}})['spread'](function(_0x4584bd){logger['info'](_0x0e17('0x28'),_0x5bc00b);logger['debug'](_0x0e17('0x28'),_0x5bc00b,JSON[_0x0e17('0x16')](_0x4584bd));_0x56ddba(_0x4584bd);})['catch'](function(_0x4fa7d5){logger[_0x0e17('0x17')](_0x0e17('0x28'),_0x4fa7d5[_0x0e17('0x19')],_0x5bc00b);_0x14801a(_this[_0x0e17('0x17')](0x1f4,_0x4fa7d5[_0x0e17('0x19')]));});});}; \ No newline at end of file +var _0x2d8e=['../../config/environment','http','redis','defaults','localhost','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','limit','AddTagsToMailInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x68876d,_0x120707){var _0x253d53=function(_0x1dd6d0){while(--_0x1dd6d0){_0x68876d['push'](_0x68876d['shift']());}};_0x253d53(++_0x120707);}(_0x2d8e,0x17a));var _0xe2d8=function(_0x5b8f75,_0x30ee13){_0x5b8f75=_0x5b8f75-0x0;var _0x3643b7=_0x2d8e[_0x5b8f75];return _0x3643b7;};'use strict';var _=require(_0xe2d8('0x0'));var util=require(_0xe2d8('0x1'));var moment=require(_0xe2d8('0x2'));var BPromise=require(_0xe2d8('0x3'));var rs=require(_0xe2d8('0x4'));var fs=require('fs');var Redis=require(_0xe2d8('0x5'));var db=require(_0xe2d8('0x6'))['db'];var utils=require(_0xe2d8('0x7'));var logger=require(_0xe2d8('0x8'))('rpc');var config=require(_0xe2d8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe2d8('0xa')]({'port':0x232a});config[_0xe2d8('0xb')]=_[_0xe2d8('0xc')](config[_0xe2d8('0xb')],{'host':_0xe2d8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe2d8('0xb')]));require(_0xe2d8('0xe'))[_0xe2d8('0xf')](socket);function respondWithRpcPromise(_0x2af96c,_0x3ce1fa,_0x4d0f5a){return new BPromise(function(_0x31dcc3,_0x7f732a){return client[_0xe2d8('0x10')](_0x2af96c,_0x4d0f5a)[_0xe2d8('0x11')](function(_0x43d43d){logger[_0xe2d8('0x12')](_0xe2d8('0x13'),_0x3ce1fa,_0xe2d8('0x14'));logger[_0xe2d8('0x15')](_0xe2d8('0x16'),_0x3ce1fa,_0xe2d8('0x14'),JSON[_0xe2d8('0x17')](_0x43d43d));if(_0x43d43d[_0xe2d8('0x18')]){if(_0x43d43d[_0xe2d8('0x18')][_0xe2d8('0x19')]===0x1f4){logger[_0xe2d8('0x18')](_0xe2d8('0x13'),_0x3ce1fa,_0x43d43d[_0xe2d8('0x18')][_0xe2d8('0x1a')]);return _0x7f732a(_0x43d43d[_0xe2d8('0x18')][_0xe2d8('0x1a')]);}logger[_0xe2d8('0x18')]('MailInteraction,\x20%s,\x20%s',_0x3ce1fa,_0x43d43d['error'][_0xe2d8('0x1a')]);return _0x31dcc3(_0x43d43d[_0xe2d8('0x18')][_0xe2d8('0x1a')]);}else{logger[_0xe2d8('0x12')](_0xe2d8('0x13'),_0x3ce1fa,_0xe2d8('0x14'));_0x31dcc3(_0x43d43d[_0xe2d8('0x1b')]['message']);}})[_0xe2d8('0x1c')](function(_0x57ff32){logger['error'](_0xe2d8('0x13'),_0x3ce1fa,_0x57ff32);_0x7f732a(_0x57ff32);});});}exports[_0xe2d8('0x1d')]=function(_0x5a3978){var _0x44cb73=this;return new Promise(function(_0x5af4c2,_0x1e9b20){return db[_0xe2d8('0x1e')][_0xe2d8('0x1f')](_0x5a3978['body'],{'raw':_0x5a3978[_0xe2d8('0x20')]?_0x5a3978[_0xe2d8('0x20')][_0xe2d8('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a3978['options']?_0x5a3978[_0xe2d8('0x20')][_0xe2d8('0x22')]||null:null,'attributes':_0x5a3978[_0xe2d8('0x20')]?_0x5a3978[_0xe2d8('0x20')]['attributes']||null:null,'limit':_0x5a3978[_0xe2d8('0x20')]?_0x5a3978[_0xe2d8('0x20')][_0xe2d8('0x23')]||null:null})['then'](function(_0x3729cd){logger[_0xe2d8('0x12')](_0xe2d8('0x1d'),_0x5a3978);logger['debug'](_0xe2d8('0x1d'),_0x5a3978,JSON[_0xe2d8('0x17')](_0x3729cd));_0x5af4c2(_0x3729cd);})[_0xe2d8('0x1c')](function(_0x2520cb){logger[_0xe2d8('0x18')]('UpdateMailInteraction',_0x2520cb[_0xe2d8('0x1a')],_0x5a3978);_0x1e9b20(_0x44cb73[_0xe2d8('0x18')](0x1f4,_0x2520cb[_0xe2d8('0x1a')]));});});};exports[_0xe2d8('0x24')]=function(_0x1c4320){return new Promise(function(_0x120750,_0x4b6f1e){return db['MailInteraction']['find']({'where':_0x1c4320['options']?_0x1c4320[_0xe2d8('0x20')][_0xe2d8('0x22')]||null:null})['then'](function(_0xe1789d){if(_0xe1789d){return _0xe1789d[_0xe2d8('0x25')](_0x1c4320[_0xe2d8('0x26')][_0xe2d8('0x27')],_[_0xe2d8('0x28')](_0x1c4320[_0xe2d8('0x26')],[_0xe2d8('0x27'),'id'])||{});}})[_0xe2d8('0x29')](function(_0x1aec51){logger[_0xe2d8('0x12')](_0xe2d8('0x2a'),_0x1c4320);logger[_0xe2d8('0x15')](_0xe2d8('0x2a'),_0x1c4320,JSON['stringify'](_0x1aec51));_0x120750(_0x1aec51);})[_0xe2d8('0x1c')](function(_0x5a1fdf){logger[_0xe2d8('0x18')](_0xe2d8('0x2a'),_0x5a1fdf[_0xe2d8('0x1a')],_0x1c4320);_0x4b6f1e(_this[_0xe2d8('0x18')](0x1f4,_0x5a1fdf[_0xe2d8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 8a6d9df..048c96e 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 _0x22e0=['removeListener','register','length','./mailInteraction.events','remove','update','emit'];(function(_0x3c7bf4,_0x1af5b5){var _0x33218c=function(_0x2d4bed){while(--_0x2d4bed){_0x3c7bf4['push'](_0x3c7bf4['shift']());}};_0x33218c(++_0x1af5b5);}(_0x22e0,0x13e));var _0x022e=function(_0x1ca82e,_0x4c8464){_0x1ca82e=_0x1ca82e-0x0;var _0x545174=_0x22e0[_0x1ca82e];return _0x545174;};'use strict';var MailInteractionEvents=require(_0x022e('0x0'));var events=['save',_0x022e('0x1'),_0x022e('0x2')];function createListener(_0x264713,_0x3b63dd){return function(_0x28c4dd){_0x3b63dd[_0x022e('0x3')](_0x264713,_0x28c4dd);};}function removeListener(_0x30efdf,_0x1488c7){return function(){MailInteractionEvents[_0x022e('0x4')](_0x30efdf,_0x1488c7);};}exports[_0x022e('0x5')]=function(_0x38736b){for(var _0x2c973d=0x0,_0x26a35a=events[_0x022e('0x6')];_0x2c973d<_0x26a35a;_0x2c973d++){var _0x218695=events[_0x2c973d];var _0x580c28=createListener('mailInteraction:'+_0x218695,_0x38736b);MailInteractionEvents['on'](_0x218695,_0x580c28);}}; \ No newline at end of file +var _0xc8de=['register','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0x249089,_0xb88825){var _0x1b8d95=function(_0x23f500){while(--_0x23f500){_0x249089['push'](_0x249089['shift']());}};_0x1b8d95(++_0xb88825);}(_0xc8de,0x10c));var _0xec8d=function(_0x2074ab,_0x43837b){_0x2074ab=_0x2074ab-0x0;var _0xdb8086=_0xc8de[_0x2074ab];return _0xdb8086;};'use strict';var MailInteractionEvents=require(_0xec8d('0x0'));var events=[_0xec8d('0x1'),_0xec8d('0x2'),_0xec8d('0x3')];function createListener(_0x578f3c,_0xd3a284){return function(_0x5b72f4){_0xd3a284[_0xec8d('0x4')](_0x578f3c,_0x5b72f4);};}function removeListener(_0x203480,_0x2ee3d3){return function(){MailInteractionEvents['removeListener'](_0x203480,_0x2ee3d3);};}exports[_0xec8d('0x5')]=function(_0x2f7d4d){for(var _0x5c9f3=0x0,_0xd8a91=events['length'];_0x5c9f3<_0xd8a91;_0x5c9f3++){var _0x28b70d=events[_0x5c9f3];var _0x5276bf=createListener(_0xec8d('0x6')+_0x28b70d,_0x2f7d4d);MailInteractionEvents['on'](_0x28b70d,_0x5276bf);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index fde2a82..9a42db6 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 _0x51a1=['create','update','put','/:id/accept','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/download','post'];(function(_0x2c46c9,_0x453814){var _0x3eb3e4=function(_0x3cd759){while(--_0x3cd759){_0x2c46c9['push'](_0x2c46c9['shift']());}};_0x3eb3e4(++_0x453814);}(_0x51a1,0x1b7));var _0x151a=function(_0x28a804,_0x5df867){_0x28a804=_0x28a804-0x0;var _0x1b19c2=_0x51a1[_0x28a804];return _0x1b19c2;};'use strict';var multer=require(_0x151a('0x0'));var util=require(_0x151a('0x1'));var path=require('path');var timeout=require(_0x151a('0x2'));var express=require(_0x151a('0x3'));var router=express[_0x151a('0x4')]();var fs_extra=require(_0x151a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x151a('0x6'));var config=require(_0x151a('0x7'));var controller=require(_0x151a('0x8'));router['get']('/',auth[_0x151a('0x9')](),controller['index']);router['get'](_0x151a('0xa'),auth[_0x151a('0x9')](),controller[_0x151a('0xb')]);router[_0x151a('0xc')](_0x151a('0xd'),auth[_0x151a('0x9')](),controller[_0x151a('0xe')]);router[_0x151a('0xc')](_0x151a('0xf'),auth[_0x151a('0x9')](),controller['download']);router[_0x151a('0x10')]('/',auth[_0x151a('0x9')](),interaction['tracked']('mail','mailmessage:create'),controller[_0x151a('0x11')]);router['put']('/:id',auth[_0x151a('0x9')](),controller[_0x151a('0x12')]);router[_0x151a('0x13')](_0x151a('0x14'),auth[_0x151a('0x9')](),controller['accept']);router[_0x151a('0x13')]('/:id/reject',auth[_0x151a('0x9')](),controller['reject']);router[_0x151a('0x15')](_0x151a('0xd'),auth['isAuthenticated'](),controller[_0x151a('0x16')]);module[_0x151a('0x17')]=router; \ No newline at end of file +var _0x4124=['show','/:id/download','download','post','mail','mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x439e50,_0x2aa7de){var _0x5157d6=function(_0x411f48){while(--_0x411f48){_0x439e50['push'](_0x439e50['shift']());}};_0x5157d6(++_0x2aa7de);}(_0x4124,0x1c1));var _0x4412=function(_0x48b40e,_0x1762d5){_0x48b40e=_0x48b40e-0x0;var _0x36ce64=_0x4124[_0x48b40e];return _0x36ce64;};'use strict';var multer=require(_0x4412('0x0'));var util=require(_0x4412('0x1'));var path=require(_0x4412('0x2'));var timeout=require(_0x4412('0x3'));var express=require(_0x4412('0x4'));var router=express[_0x4412('0x5')]();var fs_extra=require(_0x4412('0x6'));var auth=require(_0x4412('0x7'));var interaction=require(_0x4412('0x8'));var config=require(_0x4412('0x9'));var controller=require('./mailMessage.controller');router[_0x4412('0xa')]('/',auth[_0x4412('0xb')](),controller[_0x4412('0xc')]);router['get'](_0x4412('0xd'),auth['isAuthenticated'](),controller[_0x4412('0xe')]);router['get'](_0x4412('0xf'),auth['isAuthenticated'](),controller[_0x4412('0x10')]);router['get'](_0x4412('0x11'),auth[_0x4412('0xb')](),controller[_0x4412('0x12')]);router[_0x4412('0x13')]('/',auth[_0x4412('0xb')](),interaction['tracked'](_0x4412('0x14'),_0x4412('0x15')),controller[_0x4412('0x16')]);router[_0x4412('0x17')](_0x4412('0xf'),auth[_0x4412('0xb')](),controller[_0x4412('0x18')]);router[_0x4412('0x17')]('/:id/accept',auth[_0x4412('0xb')](),controller[_0x4412('0x19')]);router[_0x4412('0x17')](_0x4412('0x1a'),auth[_0x4412('0xb')](),controller[_0x4412('0x1b')]);router[_0x4412('0x1c')]('/:id',auth[_0x4412('0xb')](),controller[_0x4412('0x1d')]);module[_0x4412('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index cbd765c..32aa160 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 _0xfa82=['out','STRING','DATE','INTEGER','BOOLEAN','Email','Chat','sequelize','lodash','TEXT','long','medium','ENUM'];(function(_0x371ab2,_0x2a8b02){var _0x2e2ece=function(_0x421515){while(--_0x421515){_0x371ab2['push'](_0x371ab2['shift']());}};_0x2e2ece(++_0x2a8b02);}(_0xfa82,0xca));var _0x2fa8=function(_0x49dea6,_0x91c87b){_0x49dea6=_0x49dea6-0x0;var _0x35761b=_0xfa82[_0x49dea6];return _0x35761b;};'use strict';var Sequelize=require(_0x2fa8('0x0'));var _=require(_0x2fa8('0x1'));module['exports']={'body':{'type':Sequelize[_0x2fa8('0x2')](_0x2fa8('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2fa8('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2fa8('0x5')]('in',_0x2fa8('0x6')),'defaultValue':_0x2fa8('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2fa8('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x2fa8('0x2')](_0x2fa8('0x3'))},'cc':{'type':Sequelize['TEXT'](_0x2fa8('0x3'))},'bcc':{'type':Sequelize[_0x2fa8('0x2')](_0x2fa8('0x3'))},'subject':{'type':Sequelize[_0x2fa8('0x2')]},'sentAt':{'type':Sequelize[_0x2fa8('0x8')]},'attach':{'type':Sequelize[_0x2fa8('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2fa8('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2fa8('0x8')]},'originTo':{'type':Sequelize[_0x2fa8('0x2')](_0x2fa8('0x3'))},'originCc':{'type':Sequelize[_0x2fa8('0x2')](_0x2fa8('0x3'))},'originChannel':{'type':Sequelize[_0x2fa8('0x5')](_0x2fa8('0xb'),_0x2fa8('0xc')),'defaultValue':_0x2fa8('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xf1bf=['STRING','DATE','Chat','Email','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xf1bf,0x1d8));var _0xff1b=function(_0x22dc58,_0x38deff){_0x22dc58=_0x22dc58-0x0;var _0x242216=_0xf1bf[_0x22dc58];return _0x242216;};'use strict';var Sequelize=require('sequelize');var _=require(_0xff1b('0x0'));module[_0xff1b('0x1')]={'body':{'type':Sequelize[_0xff1b('0x2')](_0xff1b('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xff1b('0x2')](_0xff1b('0x4'))},'read':{'type':Sequelize[_0xff1b('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xff1b('0x6')]('in',_0xff1b('0x7')),'defaultValue':_0xff1b('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xff1b('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xff1b('0x2')](_0xff1b('0x3'))},'cc':{'type':Sequelize[_0xff1b('0x2')]('long')},'bcc':{'type':Sequelize[_0xff1b('0x2')](_0xff1b('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xff1b('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xff1b('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xff1b('0x9')]},'originTo':{'type':Sequelize[_0xff1b('0x2')](_0xff1b('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0xff1b('0x3'))},'originChannel':{'type':Sequelize['ENUM']('Email',_0xff1b('0xa')),'defaultValue':_0xff1b('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 34b4be7..afe1541 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 _0xb416=['basename','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','defaults','redis','localhost','html-entities','register','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','json','undefined','count','offset','limit','Content-Range','destroy','end','sendStatus','stack','name','send','index','MailMessage','fieldName','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','include','findAll','show','params','rawAttributes','intersection','length','options','find','body','describe','create','out','secret','split','MailAccount','findOne','CmList','List','Contacts','DESC','MailServerOut','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','ListId','List\x20not\x20found','SendMail','sendMail','update','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','fullname','email','internal','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','MailInteraction','null','RejectMessage','rejectMessage','Sequelize','SELECT','SIP/%s','rejectmessage','download','unix','toString','tmp','server','files','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc'];(function(_0x4fbaf9,_0x3b8190){var _0x1d89a0=function(_0x3b650b){while(--_0x3b650b){_0x4fbaf9['push'](_0x4fbaf9['shift']());}};_0x1d89a0(++_0x3b8190);}(_0xb416,0x147));var _0x6b41=function(_0x29b17c,_0x3aefd8){_0x29b17c=_0x29b17c-0x0;var _0x238c93=_0xb416[_0x29b17c];return _0x238c93;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x6b41('0x0'));var util=require('util');var path=require(_0x6b41('0x1'));var fs=require('fs');var _=require(_0x6b41('0x2'));var Redis=require(_0x6b41('0x3'));var htmlToText=require(_0x6b41('0x4'));var qs=require(_0x6b41('0x5'));var logger=require(_0x6b41('0x6'))(_0x6b41('0x7'));var interaction_log=require(_0x6b41('0x6'))(_0x6b41('0x8'));var config=require(_0x6b41('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6b41('0xa')](config[_0x6b41('0xb')],{'host':_0x6b41('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b41('0xb')]));var htmlEntities=require(_0x6b41('0xd'));require('./mailMessage.socket')[_0x6b41('0xe')](socket);var jayson=require(_0x6b41('0xf'));var client=jayson[_0x6b41('0x10')][_0x6b41('0x11')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x6b41('0x10')][_0x6b41('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x5bf65c,_0x5110a4,_0x91853a,_0x2d655a){return new BPromise(function(_0x256915,_0x3fa0b1){var _0x4ba7dc=_0x2d655a||client;return _0x4ba7dc['request'](_0x5bf65c,_0x91853a)[_0x6b41('0x12')](function(_0x402a5f){logger[_0x6b41('0x13')](_0x6b41('0x14'),_0x5110a4,_0x6b41('0x15'));logger[_0x6b41('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5110a4,_0x6b41('0x15'),JSON[_0x6b41('0x17')](_0x402a5f));if(_0x402a5f['error']){if(_0x402a5f[_0x6b41('0x18')][_0x6b41('0x19')]===0x1f4){logger[_0x6b41('0x18')](_0x6b41('0x14'),_0x5110a4,_0x402a5f[_0x6b41('0x18')]['message']);return _0x3fa0b1(_0x402a5f[_0x6b41('0x18')][_0x6b41('0x1a')]);}logger[_0x6b41('0x18')](_0x6b41('0x14'),_0x5110a4,_0x402a5f[_0x6b41('0x18')][_0x6b41('0x1a')]);return _0x256915(_0x402a5f[_0x6b41('0x18')][_0x6b41('0x1a')]);}else{logger[_0x6b41('0x13')](_0x6b41('0x14'),_0x5110a4,_0x6b41('0x15'));_0x256915(_0x402a5f['result'][_0x6b41('0x1a')]);}})[_0x6b41('0x1b')](function(_0x41d82b){logger[_0x6b41('0x18')](_0x6b41('0x14'),_0x5110a4,_0x41d82b);_0x3fa0b1(_0x41d82b);});});}function respondWithResult(_0x4aa2bc,_0x4e5c67){_0x4e5c67=_0x4e5c67||0xc8;return function(_0x3e2e4f){if(_0x3e2e4f){return _0x4aa2bc[_0x6b41('0x1c')](_0x4e5c67)[_0x6b41('0x1d')](_0x3e2e4f);}};}function respondWithFilteredResult(_0xbd1774,_0x4eba2d){return function(_0x23d2b6){if(_0x23d2b6){var _0x21fc74=typeof _0x4eba2d['offset']===_0x6b41('0x1e')&&typeof _0x4eba2d['limit']==='undefined';var _0x47aa97=_0x23d2b6[_0x6b41('0x1f')];var _0x33d7f5=_0x21fc74?0x0:_0x4eba2d['offset'];var _0x3fd07b=_0x21fc74?_0x23d2b6[_0x6b41('0x1f')]:_0x4eba2d[_0x6b41('0x20')]+_0x4eba2d[_0x6b41('0x21')];var _0x54dcef;if(_0x3fd07b>=_0x47aa97){_0x3fd07b=_0x47aa97;_0x54dcef=0xc8;}else{_0x54dcef=0xce;}_0xbd1774[_0x6b41('0x1c')](_0x54dcef);return _0xbd1774['set'](_0x6b41('0x22'),_0x33d7f5+'-'+_0x3fd07b+'/'+_0x47aa97)[_0x6b41('0x1d')](_0x23d2b6);}return null;};}function saveUpdates(_0xfe3b5d){return function(_0x34b86d){if(_0x34b86d){return _0x34b86d['update'](_0xfe3b5d)[_0x6b41('0x12')](function(_0x3bce53){return _0x3bce53;});}return null;};}function removeEntity(_0x5c4760){return function(_0x1a7b3e){if(_0x1a7b3e){return _0x1a7b3e[_0x6b41('0x23')]()[_0x6b41('0x12')](function(){_0x5c4760['status'](0xcc)[_0x6b41('0x24')]();});}};}function handleEntityNotFound(_0x31be2d){return function(_0xef1179){if(!_0xef1179){_0x31be2d[_0x6b41('0x25')](0x194);}return _0xef1179;};}function handleError(_0x5e182b,_0x5799a4){_0x5799a4=_0x5799a4||0x1f4;return function(_0x4bbfa8){logger[_0x6b41('0x18')](_0x4bbfa8[_0x6b41('0x26')]);if(_0x4bbfa8[_0x6b41('0x27')]){delete _0x4bbfa8[_0x6b41('0x27')];}_0x5e182b['status'](_0x5799a4)[_0x6b41('0x28')](_0x4bbfa8);};}exports[_0x6b41('0x29')]=function(_0x2d6749,_0x3c3d5d){var _0x33b845={},_0x5e824e={},_0x2bf399={'count':0x0,'rows':[]};var _0x33b7e5=_['map'](db[_0x6b41('0x2a')]['rawAttributes'],function(_0x494f68){return{'name':_0x494f68[_0x6b41('0x2b')],'type':_0x494f68[_0x6b41('0x2c')][_0x6b41('0x2d')]};});_0x5e824e[_0x6b41('0x2e')]=_[_0x6b41('0x2f')](_0x33b7e5,_0x6b41('0x27'));_0x5e824e[_0x6b41('0x30')]=_[_0x6b41('0x31')](_0x2d6749[_0x6b41('0x30')]);_0x5e824e[_0x6b41('0x32')]=_['intersection'](_0x5e824e[_0x6b41('0x2e')],_0x5e824e[_0x6b41('0x30')]);_0x33b845[_0x6b41('0x33')]=_['intersection'](_0x5e824e['model'],qs[_0x6b41('0x34')](_0x2d6749['query'][_0x6b41('0x34')]));_0x33b845[_0x6b41('0x33')]=_0x33b845[_0x6b41('0x33')]['length']?_0x33b845[_0x6b41('0x33')]:_0x5e824e[_0x6b41('0x2e')];if(!_0x2d6749[_0x6b41('0x30')][_0x6b41('0x35')](_0x6b41('0x36'))){_0x33b845[_0x6b41('0x21')]=qs[_0x6b41('0x21')](_0x2d6749[_0x6b41('0x30')][_0x6b41('0x21')]);_0x33b845[_0x6b41('0x20')]=qs[_0x6b41('0x20')](_0x2d6749[_0x6b41('0x30')][_0x6b41('0x20')]);}_0x33b845[_0x6b41('0x37')]=qs[_0x6b41('0x38')](_0x2d6749['query'][_0x6b41('0x38')]);_0x33b845[_0x6b41('0x39')]=qs[_0x6b41('0x32')](_[_0x6b41('0x3a')](_0x2d6749[_0x6b41('0x30')],_0x5e824e[_0x6b41('0x32')]),_0x33b7e5);if(_0x2d6749[_0x6b41('0x30')][_0x6b41('0x3b')]){_0x33b845[_0x6b41('0x39')]=_['merge'](_0x33b845[_0x6b41('0x39')],{'$or':_[_0x6b41('0x2f')](_0x33b7e5,function(_0x2b78cf){if(_0x2b78cf[_0x6b41('0x2c')]!==_0x6b41('0x3c')){var _0x19adce={};_0x19adce[_0x2b78cf[_0x6b41('0x27')]]={'$like':'%'+_0x2d6749[_0x6b41('0x30')]['filter']+'%'};return _0x19adce;}})});}_0x33b845=_['merge']({},_0x33b845,_0x2d6749['options']);var _0x289448={'where':_0x33b845[_0x6b41('0x39')]};return db[_0x6b41('0x2a')][_0x6b41('0x1f')](_0x289448)['then'](function(_0x339a6f){_0x2bf399[_0x6b41('0x1f')]=_0x339a6f;if(_0x2d6749[_0x6b41('0x30')]['includeAll']){_0x33b845[_0x6b41('0x3d')]=[{'all':!![]}];}return db[_0x6b41('0x2a')][_0x6b41('0x3e')](_0x33b845);})['then'](function(_0x6a842f){_0x2bf399['rows']=_0x6a842f;return _0x2bf399;})[_0x6b41('0x12')](respondWithFilteredResult(_0x3c3d5d,_0x33b845))[_0x6b41('0x1b')](handleError(_0x3c3d5d,null));};exports[_0x6b41('0x3f')]=function(_0x55d635,_0x2eefbc){var _0x24527c={'raw':!![],'where':{'id':_0x55d635[_0x6b41('0x40')]['id']}},_0xe568fc={};_0xe568fc[_0x6b41('0x2e')]=_['keys'](db['MailMessage'][_0x6b41('0x41')]);_0xe568fc[_0x6b41('0x30')]=_['keys'](_0x55d635[_0x6b41('0x30')]);_0xe568fc['filters']=_[_0x6b41('0x42')](_0xe568fc[_0x6b41('0x2e')],_0xe568fc[_0x6b41('0x30')]);_0x24527c[_0x6b41('0x33')]=_[_0x6b41('0x42')](_0xe568fc['model'],qs[_0x6b41('0x34')](_0x55d635[_0x6b41('0x30')]['fields']));_0x24527c[_0x6b41('0x33')]=_0x24527c[_0x6b41('0x33')][_0x6b41('0x43')]?_0x24527c[_0x6b41('0x33')]:_0xe568fc['model'];if(_0x55d635[_0x6b41('0x30')]['includeAll']){_0x24527c[_0x6b41('0x3d')]=[{'all':!![]}];}_0x24527c=_['merge']({},_0x24527c,_0x55d635[_0x6b41('0x44')]);return db[_0x6b41('0x2a')][_0x6b41('0x45')](_0x24527c)[_0x6b41('0x12')](handleEntityNotFound(_0x2eefbc,null))[_0x6b41('0x12')](respondWithResult(_0x2eefbc,null))[_0x6b41('0x1b')](handleError(_0x2eefbc,null));};exports['update']=function(_0x408cb8,_0x49c840){if(_0x408cb8[_0x6b41('0x46')]['id']){delete _0x408cb8[_0x6b41('0x46')]['id'];}return db[_0x6b41('0x2a')][_0x6b41('0x45')]({'where':{'id':_0x408cb8[_0x6b41('0x40')]['id']}})[_0x6b41('0x12')](handleEntityNotFound(_0x49c840,null))['then'](saveUpdates(_0x408cb8[_0x6b41('0x46')],null))['then'](respondWithResult(_0x49c840,null))[_0x6b41('0x1b')](handleError(_0x49c840,null));};exports['destroy']=function(_0x4e09da,_0x543fe9){return db[_0x6b41('0x2a')][_0x6b41('0x45')]({'where':{'id':_0x4e09da['params']['id']}})[_0x6b41('0x12')](handleEntityNotFound(_0x543fe9,null))[_0x6b41('0x12')](removeEntity(_0x543fe9,null))[_0x6b41('0x1b')](handleError(_0x543fe9,null));};exports[_0x6b41('0x47')]=function(_0x43f60e,_0xc74fa8){return db[_0x6b41('0x2a')][_0x6b41('0x47')]()['then'](respondWithResult(_0xc74fa8,null))[_0x6b41('0x1b')](handleError(_0xc74fa8,null));};exports[_0x6b41('0x48')]=function(_0xdd9014,_0x5ae300){return db[_0x6b41('0x2a')][_0x6b41('0x48')](_0xdd9014[_0x6b41('0x46')])[_0x6b41('0x12')](function(_0x178ad6){if(_0x178ad6){if(_0x178ad6['direction']===_0x6b41('0x49')&&!_0x178ad6[_0x6b41('0x4a')]){var _0x3f9063,_0x470878,_0x2e27a4;if(_0xdd9014[_0x6b41('0x46')]['to']){_0x470878=_0xdd9014[_0x6b41('0x46')]['to'][_0x6b41('0x4b')](',')[0x0];}return db[_0x6b41('0x4c')][_0x6b41('0x4d')]({'where':{'id':_0x178ad6['MailAccountId']},'include':[{'model':db[_0x6b41('0x4e')],'as':_0x6b41('0x4f'),'include':[{'model':db['CmContact'],'as':_0x6b41('0x50'),'where':{'email':_0x470878},'limit':0x1,'order':[['updatedAt',_0x6b41('0x51')]]}]},{'model':db[_0x6b41('0x52')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x6b41('0x53')],'as':_0x6b41('0x53'),'raw':!![]}]}]})['then'](function(_0x45f822){_0x3f9063=_0x45f822;if(!_0x3f9063||!_0x3f9063['Smtp'])return;var _0x30ad4a=_0x3f9063[_0x6b41('0x54')]();if(_0xdd9014[_0x6b41('0x46')]['attachments']&&_0xdd9014['body'][_0x6b41('0x55')][_0x6b41('0x43')]){for(var _0x2ab250=0x0;_0x2ab250<_0xdd9014[_0x6b41('0x46')]['attachments'][_0x6b41('0x43')];_0x2ab250+=0x1){_0xdd9014[_0x6b41('0x46')][_0x6b41('0x55')][_0x2ab250]={'filename':_0xdd9014[_0x6b41('0x46')][_0x6b41('0x55')][_0x2ab250][_0x6b41('0x27')],'path':path[_0x6b41('0x56')](config[_0x6b41('0x57')],_0x6b41('0x58'),_0xdd9014[_0x6b41('0x46')][_0x6b41('0x55')][_0x2ab250]['basename'])};}}_0x2e27a4={'account':_0x30ad4a,'message':_0xdd9014['body']};return;})[_0x6b41('0x12')](function(){if(_0x3f9063[_0x6b41('0x4f')]){if(_0x3f9063[_0x6b41('0x4f')]['Contacts'][_0x6b41('0x43')]){return _0x3f9063[_0x6b41('0x4f')]['Contacts'][0x0];}else{return db['CmContact'][_0x6b41('0x48')](_[_0x6b41('0xa')](_0xdd9014['body'],{'firstName':_0xdd9014[_0x6b41('0x46')]['to'],'email':_0xdd9014[_0x6b41('0x46')]['to'],'phone':_0xdd9014['body']['to'],'ListId':_0x3f9063[_0x6b41('0x59')]}));}}else{throw new Error(_0x6b41('0x5a'));}})['then'](function(){if(_0x2e27a4){return respondWithRpcPromise(_0x6b41('0x5b'),_0x6b41('0x5c'),_0x2e27a4,client9003)['then'](function(_0x487f64){return _0x178ad6[_0x6b41('0x5d')]({'read':!![],'messageId':_0x487f64[_0x6b41('0x5e')],'sentAt':moment()[_0x6b41('0x5f')](_0x6b41('0x60'))});})[_0x6b41('0x1b')](function(_0x108ab5){logger['error']('%s',JSON[_0x6b41('0x17')](_0x108ab5));return _0x178ad6;});}return _0x178ad6;});}return _0x178ad6;}})[_0x6b41('0x12')](respondWithResult(_0x5ae300,0xc9))[_0x6b41('0x1b')](handleError(_0x5ae300,null));};exports[_0x6b41('0x61')]=function(_0x597070,_0x3968fc){var _0x1375d0={'agent':{},'channel':_0x6b41('0x62')};if(_0x597070[_0x6b41('0x46')]['id']){delete _0x597070['body']['id'];}_0x597070[_0x6b41('0x46')][_0x6b41('0x63')]=!![];_0x597070[_0x6b41('0x46')][_0x6b41('0x64')]=moment()[_0x6b41('0x5f')](_0x6b41('0x60'));_0x597070[_0x6b41('0x46')][_0x6b41('0x65')]=_0x597070[_0x6b41('0x46')]['UserId']||_0x597070['user']['id'];_0x1375d0[_0x6b41('0x66')]['id']=_0x597070[_0x6b41('0x46')][_0x6b41('0x65')];return db[_0x6b41('0x2a')][_0x6b41('0x45')]({'where':{'id':_0x597070[_0x6b41('0x40')]['id'],'UserId':null}})[_0x6b41('0x12')](handleEntityNotFound(_0x3968fc,null))[_0x6b41('0x12')](saveUpdates(_0x597070[_0x6b41('0x46')],null))[_0x6b41('0x12')](function(_0x5318f3){if(_0x5318f3){_0x1375d0[_0x6b41('0x1a')]=_0x5318f3[_0x6b41('0x67')]({'plain':!![]});return db['MailInteraction'][_0x6b41('0x45')]({'where':{'id':_0x5318f3[_0x6b41('0x68')]}});}return null;})[_0x6b41('0x12')](handleEntityNotFound(_0x3968fc,null))['then'](function(_0x4fcac4){if(_0x4fcac4){return _0x4fcac4[_0x6b41('0x5d')]({'UserId':_0x597070[_0x6b41('0x46')][_0x6b41('0x65')],'read1stAt':_[_0x6b41('0x69')](_0x4fcac4[_0x6b41('0x6a')])?moment()[_0x6b41('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6b41('0x12')](function(_0x46c4d1){if(_0x46c4d1){_0x1375d0[_0x6b41('0x6b')]=_0x46c4d1[_0x6b41('0x67')]({'plain':!![]});interaction_log[_0x6b41('0x13')](_0x6b41('0x6c'),_0x597070[_0x6b41('0x6d')]['id'],_0x597070['user'][_0x6b41('0x27')],_0x597070[_0x6b41('0x6d')][_0x6b41('0x6e')],_0x1375d0['interaction']['id'],_0x597070['body']?JSON[_0x6b41('0x17')](_0x597070[_0x6b41('0x46')]):'null');return respondWithRpcPromise('AcceptMessage',_0x6b41('0x6f'),_0x1375d0);}return null;})[_0x6b41('0x12')](function(_0x128a28){var _0x283722=_0x6b41('0x70')+_0x128a28[_0x6b41('0x1a')][_0x6b41('0x71')];return db[_0x6b41('0x72')][_0x6b41('0x30')](_0x283722,{'type':db['Sequelize'][_0x6b41('0x73')]['SELECT'],'raw':!![]})[_0x6b41('0x12')](function(_0x3eed37){return _0x3eed37;});})['then'](function(_0x4f57f6){if(_0x4f57f6){_0x1375d0['message'][_0x6b41('0x74')]=_0x4f57f6[0x0];if(!_0x597070[_0x6b41('0x46')][_0x6b41('0x65')])return;return db[_0x6b41('0x75')][_0x6b41('0x45')]({'where':{'id':_0x597070[_0x6b41('0x46')]['UserId'],'role':'agent'},'attributes':['id',_0x6b41('0x27'),_0x6b41('0x76'),_0x6b41('0x77'),_0x6b41('0x78')],'raw':!![]});}return null;})[_0x6b41('0x12')](function(_0x1171ed){if(!_0x1171ed)return null;_0x1375d0['message']['agent']=_0x1171ed;return _0x1375d0;})[_0x6b41('0x12')](function(_0x3c8be7){if(_0x3c8be7){if(_0x597070[_0x6b41('0x46')]['manual']){_0x1375d0['message'][_0x6b41('0x79')]=util['format']('SIP/%s',_0x597070['user']['name']);_0x1375d0[_0x6b41('0x1a')][_0x6b41('0x7a')]=_0x1375d0[_0x6b41('0x7a')];_0x1375d0[_0x6b41('0x1a')][_0x6b41('0x7b')]=_0x1375d0[_0x6b41('0x7a')];_0x1375d0[_0x6b41('0x1a')][_0x6b41('0x7c')]=_0x6b41('0x61');_0x1375d0['message'][_0x6b41('0x46')]=htmlToText[_0x6b41('0x7d')](_0x1375d0[_0x6b41('0x1a')][_0x6b41('0x46')]);return respondWithRpcPromise(_0x6b41('0x7e'),'EventManager',{'event':_0x6b41('0x7f'),'message':_0x1375d0[_0x6b41('0x1a')]},client9002)[_0x6b41('0x12')](function(){return _0x1375d0;});}return _0x1375d0;}return null;})[_0x6b41('0x12')](respondWithResult(_0x3968fc,null))['catch'](handleError(_0x3968fc,null));};exports[_0x6b41('0x80')]=function(_0x2d6dd3,_0x89d611){var _0x4d6fd0={'agent':{},'channel':_0x6b41('0x62')};if(_0x2d6dd3[_0x6b41('0x46')]['id']){delete _0x2d6dd3['body']['id'];}_0x2d6dd3['body']['UserId']=_0x2d6dd3[_0x6b41('0x46')][_0x6b41('0x65')]||_0x2d6dd3['user']['id'];_0x4d6fd0[_0x6b41('0x66')]['id']=_0x2d6dd3[_0x6b41('0x46')][_0x6b41('0x65')];return db['MailMessage']['find']({'where':{'id':_0x2d6dd3[_0x6b41('0x40')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x89d611,null))[_0x6b41('0x12')](function(_0x325aa1){if(_0x325aa1){_0x4d6fd0[_0x6b41('0x1a')]=_0x325aa1[_0x6b41('0x67')]({'plain':!![]});return db[_0x6b41('0x81')]['find']({'where':{'id':_0x325aa1[_0x6b41('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x89d611,null))[_0x6b41('0x12')](function(_0x2453af){if(_0x2453af){_0x4d6fd0[_0x6b41('0x6b')]=_0x2453af[_0x6b41('0x67')]({'plain':!![]});interaction_log[_0x6b41('0x13')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2d6dd3[_0x6b41('0x6d')]['id'],_0x2d6dd3[_0x6b41('0x6d')][_0x6b41('0x27')],_0x2d6dd3['user'][_0x6b41('0x6e')],_0x4d6fd0[_0x6b41('0x6b')]['id'],_0x2d6dd3[_0x6b41('0x46')]?JSON[_0x6b41('0x17')](_0x2d6dd3[_0x6b41('0x46')]):_0x6b41('0x82'));return respondWithRpcPromise(_0x6b41('0x83'),_0x6b41('0x84'),_0x4d6fd0);}return null;})[_0x6b41('0x12')](function(_0x3706f4){var _0x3a3db2=_0x6b41('0x70')+_0x3706f4['message'][_0x6b41('0x71')];return db[_0x6b41('0x72')][_0x6b41('0x30')](_0x3a3db2,{'type':db[_0x6b41('0x85')]['QueryTypes'][_0x6b41('0x86')],'raw':!![]})[_0x6b41('0x12')](function(_0x3217c2){return _0x3217c2;});})[_0x6b41('0x12')](function(_0x132169){if(_0x132169){_0x4d6fd0[_0x6b41('0x1a')][_0x6b41('0x74')]=_0x132169[0x0];if(!_0x2d6dd3[_0x6b41('0x46')][_0x6b41('0x65')])return;return db['User'][_0x6b41('0x45')]({'where':{'id':_0x2d6dd3['body'][_0x6b41('0x65')],'role':'agent'},'attributes':['id',_0x6b41('0x27'),_0x6b41('0x76'),'email',_0x6b41('0x78')],'raw':!![]});}return null;})[_0x6b41('0x12')](function(_0x4c110d){if(!_0x4c110d)return null;_0x4d6fd0[_0x6b41('0x1a')][_0x6b41('0x66')]=_0x4c110d;return _0x4d6fd0;})['then'](function(_0x291926){if(_0x291926){_0x291926[_0x6b41('0x1a')][_0x6b41('0x79')]=util[_0x6b41('0x5f')](_0x6b41('0x87'),_0x2d6dd3[_0x6b41('0x6d')][_0x6b41('0x27')]);_0x291926[_0x6b41('0x1a')]['channel']=_0x4d6fd0[_0x6b41('0x7a')];_0x291926[_0x6b41('0x1a')][_0x6b41('0x7b')]=_0x4d6fd0[_0x6b41('0x7a')];_0x291926[_0x6b41('0x1a')][_0x6b41('0x7c')]=_0x6b41('0x80');_0x291926[_0x6b41('0x1a')][_0x6b41('0x46')]=htmlToText[_0x6b41('0x7d')](_0x4d6fd0['message'][_0x6b41('0x46')]);respondWithRpcPromise(_0x6b41('0x7e'),'EventManager',{'event':_0x6b41('0x88'),'message':_0x291926[_0x6b41('0x1a')]},client9002);return _0x4d6fd0;}return null;})[_0x6b41('0x12')](respondWithResult(_0x89d611,null))['catch'](handleError(_0x89d611,null));};exports[_0x6b41('0x89')]=function(_0x2a85d2,_0x1da350){var _0xf87ed4=moment()[_0x6b41('0x8a')]()[_0x6b41('0x8b')]();var _0x4ea1d3=path[_0x6b41('0x56')](config[_0x6b41('0x57')],'server','files',_0x6b41('0x8c'));var _0xed8447=path[_0x6b41('0x56')](config[_0x6b41('0x57')],_0x6b41('0x8d'),_0x6b41('0x8e'),_0x6b41('0x55'));var _0x246996=util[_0x6b41('0x5f')](_0x6b41('0x8f'),_0xf87ed4);return db[_0x6b41('0x2a')][_0x6b41('0x45')]({'where':{'id':_0x2a85d2[_0x6b41('0x40')]['id']},'attributes':['id',_0x6b41('0x46'),_0x6b41('0x90'),'to','cc',_0x6b41('0x91'),'subject',_0x6b41('0x92')],'include':_0x2a85d2['query'][_0x6b41('0x55')]?[{'model':db[_0x6b41('0x93')],'as':_0x6b41('0x94')}]:undefined})[_0x6b41('0x12')](handleEntityNotFound(_0x1da350,null))[_0x6b41('0x12')](function(_0x456a58){if(_0x456a58){var _0x454c8f=_0x456a58;var _0x5e758a={'from':_0x454c8f[_0x6b41('0x90')],'to':_0x454c8f['to'],'subject':_0x454c8f[_0x6b41('0x95')],'html':htmlEntities['decode'](_0x454c8f[_0x6b41('0x46')]),'headers':{'Date':moment(_0x454c8f[_0x6b41('0x92')])[_0x6b41('0x5f')](_0x6b41('0x96'))},'attachments':[]};if(_0x456a58['cc']){_0x5e758a['headers']['Cc']=_0x456a58['cc'];}if(_0x456a58['bcc']){_0x5e758a[_0x6b41('0x97')][_0x6b41('0x98')]=_0x456a58[_0x6b41('0x91')];}return new BPromise(function(_0x53dea9,_0x25c939){if(_0x456a58[_0x6b41('0x94')]){for(var _0x6ce3f3=0x0;_0x6ce3f3<_0x456a58[_0x6b41('0x94')][_0x6b41('0x43')];_0x6ce3f3++){var _0x2b359e=_0x456a58[_0x6b41('0x94')][_0x6ce3f3];var _0x2c13c2=path[_0x6b41('0x56')](_0xed8447,_0x2b359e[_0x6b41('0x99')]);if(fs[_0x6b41('0x9a')](_0x2c13c2)){_0x5e758a[_0x6b41('0x55')][_0x6b41('0x9b')]({'name':_0x2b359e[_0x6b41('0x27')],'contentType':_0x2b359e['type'],'data':fs[_0x6b41('0x9c')](_0x2c13c2)});}}}emlformat[_0x6b41('0x9d')](_0x5e758a,function(_0x44e1c3,_0x456109){if(_0x44e1c3)return _0x25c939(_0x44e1c3);fs[_0x6b41('0x9e')](path['join'](_0x4ea1d3,_0x246996),_0x456109);return _0x53dea9(_0x456109);});});}})[_0x6b41('0x12')](function(_0x4c460f){if(_0x4c460f){return _0x1da350[_0x6b41('0x89')](path[_0x6b41('0x56')](_0x4ea1d3,_0x246996),_0x246996,function(_0x497746){if(!_0x497746)fs[_0x6b41('0x9f')](path[_0x6b41('0x56')](_0x4ea1d3,_0x246996));});}})['catch'](handleError(_0x1da350,null));}; \ No newline at end of file +var _0xac0a=['update','destroy','end','sendStatus','name','index','map','MailMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','rawAttributes','keys','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','user','get','MailInteraction','MailInteractionId','isNil','interaction','acceptMessage','ContactId','sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','channel','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','Sequelize','SELECT','SIP/%s','motionChannel','event','fromString','rejectmessage','download','unix','join','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','build','writeFileSync','moment','bluebird','util','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','limit','count','set','Content-Range'];(function(_0x2ba3bd,_0x10d4aa){var _0x53a169=function(_0x58b0c5){while(--_0x58b0c5){_0x2ba3bd['push'](_0x2ba3bd['shift']());}};_0x53a169(++_0x10d4aa);}(_0xac0a,0x1b2));var _0xaac0=function(_0x5e7f8e,_0x4ae19e){_0x5e7f8e=_0x5e7f8e-0x0;var _0x4d79c4=_0xac0a[_0x5e7f8e];return _0x4d79c4;};'use strict';var emlformat=require('eml-format');var moment=require(_0xaac0('0x0'));var BPromise=require(_0xaac0('0x1'));var util=require(_0xaac0('0x2'));var path=require(_0xaac0('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xaac0('0x4'));var htmlToText=require(_0xaac0('0x5'));var qs=require(_0xaac0('0x6'));var logger=require(_0xaac0('0x7'))(_0xaac0('0x8'));var interaction_log=require('../../config/logger')(_0xaac0('0x9'));var config=require(_0xaac0('0xa'));var db=require(_0xaac0('0xb'))['db'];config[_0xaac0('0xc')]=_[_0xaac0('0xd')](config[_0xaac0('0xc')],{'host':_0xaac0('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaac0('0xc')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')['register'](socket);var jayson=require(_0xaac0('0xf'));var client=jayson[_0xaac0('0x10')][_0xaac0('0x11')]({'port':0x232c});var client9003=jayson[_0xaac0('0x10')][_0xaac0('0x11')]({'port':0x232b});var client9002=jayson[_0xaac0('0x10')][_0xaac0('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x54e8da,_0xc29528,_0x21c162,_0x4fbcd8){return new BPromise(function(_0x395be9,_0x494962){var _0x6d1a4d=_0x4fbcd8||client;return _0x6d1a4d['request'](_0x54e8da,_0x21c162)[_0xaac0('0x12')](function(_0x574845){logger[_0xaac0('0x13')](_0xaac0('0x14'),_0xc29528,_0xaac0('0x15'));logger[_0xaac0('0x16')](_0xaac0('0x17'),_0xc29528,_0xaac0('0x15'),JSON[_0xaac0('0x18')](_0x574845));if(_0x574845['error']){if(_0x574845[_0xaac0('0x19')][_0xaac0('0x1a')]===0x1f4){logger['error'](_0xaac0('0x14'),_0xc29528,_0x574845[_0xaac0('0x19')][_0xaac0('0x1b')]);return _0x494962(_0x574845[_0xaac0('0x19')][_0xaac0('0x1b')]);}logger[_0xaac0('0x19')]('MailMessage,\x20%s,\x20%s',_0xc29528,_0x574845[_0xaac0('0x19')][_0xaac0('0x1b')]);return _0x395be9(_0x574845[_0xaac0('0x19')]['message']);}else{logger[_0xaac0('0x13')](_0xaac0('0x14'),_0xc29528,_0xaac0('0x15'));_0x395be9(_0x574845[_0xaac0('0x1c')][_0xaac0('0x1b')]);}})[_0xaac0('0x1d')](function(_0x26e1d7){logger[_0xaac0('0x19')](_0xaac0('0x14'),_0xc29528,_0x26e1d7);_0x494962(_0x26e1d7);});});}function respondWithResult(_0x55ae4e,_0x377931){_0x377931=_0x377931||0xc8;return function(_0x542142){if(_0x542142){return _0x55ae4e[_0xaac0('0x1e')](_0x377931)[_0xaac0('0x1f')](_0x542142);}};}function respondWithFilteredResult(_0xf79dc5,_0x545200){return function(_0x36b1b5){if(_0x36b1b5){var _0x5f57d8=typeof _0x545200[_0xaac0('0x20')]==='undefined'&&typeof _0x545200[_0xaac0('0x21')]==='undefined';var _0x3a7243=_0x36b1b5[_0xaac0('0x22')];var _0x40113c=_0x5f57d8?0x0:_0x545200['offset'];var _0x26f981=_0x5f57d8?_0x36b1b5[_0xaac0('0x22')]:_0x545200[_0xaac0('0x20')]+_0x545200[_0xaac0('0x21')];var _0x4e47e9;if(_0x26f981>=_0x3a7243){_0x26f981=_0x3a7243;_0x4e47e9=0xc8;}else{_0x4e47e9=0xce;}_0xf79dc5[_0xaac0('0x1e')](_0x4e47e9);return _0xf79dc5[_0xaac0('0x23')](_0xaac0('0x24'),_0x40113c+'-'+_0x26f981+'/'+_0x3a7243)[_0xaac0('0x1f')](_0x36b1b5);}return null;};}function saveUpdates(_0x14049e){return function(_0x4335fc){if(_0x4335fc){return _0x4335fc[_0xaac0('0x25')](_0x14049e)[_0xaac0('0x12')](function(_0x15a003){return _0x15a003;});}return null;};}function removeEntity(_0x470a07){return function(_0x3a67ae){if(_0x3a67ae){return _0x3a67ae[_0xaac0('0x26')]()[_0xaac0('0x12')](function(){_0x470a07['status'](0xcc)[_0xaac0('0x27')]();});}};}function handleEntityNotFound(_0x386218){return function(_0x121f85){if(!_0x121f85){_0x386218[_0xaac0('0x28')](0x194);}return _0x121f85;};}function handleError(_0x46922d,_0x3d92b7){_0x3d92b7=_0x3d92b7||0x1f4;return function(_0x1742b2){logger['error'](_0x1742b2['stack']);if(_0x1742b2[_0xaac0('0x29')]){delete _0x1742b2[_0xaac0('0x29')];}_0x46922d[_0xaac0('0x1e')](_0x3d92b7)['send'](_0x1742b2);};}exports[_0xaac0('0x2a')]=function(_0x5c5cbb,_0x2afdc5){var _0x2f752a={},_0x1758bc={},_0x56756c={'count':0x0,'rows':[]};var _0x2e878b=_[_0xaac0('0x2b')](db[_0xaac0('0x2c')]['rawAttributes'],function(_0x562181){return{'name':_0x562181[_0xaac0('0x2d')],'type':_0x562181[_0xaac0('0x2e')][_0xaac0('0x2f')]};});_0x1758bc[_0xaac0('0x30')]=_[_0xaac0('0x2b')](_0x2e878b,_0xaac0('0x29'));_0x1758bc[_0xaac0('0x31')]=_['keys'](_0x5c5cbb[_0xaac0('0x31')]);_0x1758bc[_0xaac0('0x32')]=_[_0xaac0('0x33')](_0x1758bc['model'],_0x1758bc[_0xaac0('0x31')]);_0x2f752a[_0xaac0('0x34')]=_[_0xaac0('0x33')](_0x1758bc[_0xaac0('0x30')],qs[_0xaac0('0x35')](_0x5c5cbb[_0xaac0('0x31')]['fields']));_0x2f752a['attributes']=_0x2f752a['attributes'][_0xaac0('0x36')]?_0x2f752a[_0xaac0('0x34')]:_0x1758bc[_0xaac0('0x30')];if(!_0x5c5cbb[_0xaac0('0x31')][_0xaac0('0x37')]('nolimit')){_0x2f752a[_0xaac0('0x21')]=qs[_0xaac0('0x21')](_0x5c5cbb[_0xaac0('0x31')][_0xaac0('0x21')]);_0x2f752a[_0xaac0('0x20')]=qs['offset'](_0x5c5cbb[_0xaac0('0x31')]['offset']);}_0x2f752a[_0xaac0('0x38')]=qs[_0xaac0('0x39')](_0x5c5cbb['query'][_0xaac0('0x39')]);_0x2f752a[_0xaac0('0x3a')]=qs[_0xaac0('0x32')](_[_0xaac0('0x3b')](_0x5c5cbb[_0xaac0('0x31')],_0x1758bc[_0xaac0('0x32')]),_0x2e878b);if(_0x5c5cbb[_0xaac0('0x31')][_0xaac0('0x3c')]){_0x2f752a[_0xaac0('0x3a')]=_[_0xaac0('0x3d')](_0x2f752a[_0xaac0('0x3a')],{'$or':_[_0xaac0('0x2b')](_0x2e878b,function(_0x5d7ca6){if(_0x5d7ca6[_0xaac0('0x2e')]!==_0xaac0('0x3e')){var _0x44cf81={};_0x44cf81[_0x5d7ca6['name']]={'$like':'%'+_0x5c5cbb[_0xaac0('0x31')][_0xaac0('0x3c')]+'%'};return _0x44cf81;}})});}_0x2f752a=_[_0xaac0('0x3d')]({},_0x2f752a,_0x5c5cbb[_0xaac0('0x3f')]);var _0x2d4d02={'where':_0x2f752a[_0xaac0('0x3a')]};return db['MailMessage'][_0xaac0('0x22')](_0x2d4d02)[_0xaac0('0x12')](function(_0x34b926){_0x56756c[_0xaac0('0x22')]=_0x34b926;if(_0x5c5cbb[_0xaac0('0x31')][_0xaac0('0x40')]){_0x2f752a[_0xaac0('0x41')]=[{'all':!![]}];}return db[_0xaac0('0x2c')][_0xaac0('0x42')](_0x2f752a);})[_0xaac0('0x12')](function(_0x47f074){_0x56756c['rows']=_0x47f074;return _0x56756c;})[_0xaac0('0x12')](respondWithFilteredResult(_0x2afdc5,_0x2f752a))[_0xaac0('0x1d')](handleError(_0x2afdc5,null));};exports['show']=function(_0x3b140c,_0x327c2c){var _0x5ca0d1={'raw':!![],'where':{'id':_0x3b140c[_0xaac0('0x43')]['id']}},_0x4bca04={};_0x4bca04['model']=_['keys'](db['MailMessage'][_0xaac0('0x44')]);_0x4bca04[_0xaac0('0x31')]=_[_0xaac0('0x45')](_0x3b140c[_0xaac0('0x31')]);_0x4bca04[_0xaac0('0x32')]=_[_0xaac0('0x33')](_0x4bca04[_0xaac0('0x30')],_0x4bca04[_0xaac0('0x31')]);_0x5ca0d1[_0xaac0('0x34')]=_[_0xaac0('0x33')](_0x4bca04[_0xaac0('0x30')],qs['fields'](_0x3b140c[_0xaac0('0x31')][_0xaac0('0x35')]));_0x5ca0d1[_0xaac0('0x34')]=_0x5ca0d1[_0xaac0('0x34')][_0xaac0('0x36')]?_0x5ca0d1[_0xaac0('0x34')]:_0x4bca04[_0xaac0('0x30')];if(_0x3b140c[_0xaac0('0x31')]['includeAll']){_0x5ca0d1[_0xaac0('0x41')]=[{'all':!![]}];}_0x5ca0d1=_['merge']({},_0x5ca0d1,_0x3b140c[_0xaac0('0x3f')]);return db[_0xaac0('0x2c')][_0xaac0('0x46')](_0x5ca0d1)[_0xaac0('0x12')](handleEntityNotFound(_0x327c2c,null))[_0xaac0('0x12')](respondWithResult(_0x327c2c,null))[_0xaac0('0x1d')](handleError(_0x327c2c,null));};exports[_0xaac0('0x25')]=function(_0x136e9d,_0x26e108){if(_0x136e9d[_0xaac0('0x47')]['id']){delete _0x136e9d['body']['id'];}return db[_0xaac0('0x2c')][_0xaac0('0x46')]({'where':{'id':_0x136e9d['params']['id']}})[_0xaac0('0x12')](handleEntityNotFound(_0x26e108,null))[_0xaac0('0x12')](saveUpdates(_0x136e9d['body'],null))[_0xaac0('0x12')](respondWithResult(_0x26e108,null))[_0xaac0('0x1d')](handleError(_0x26e108,null));};exports[_0xaac0('0x26')]=function(_0x284dd5,_0x4bdad6){return db['MailMessage'][_0xaac0('0x46')]({'where':{'id':_0x284dd5[_0xaac0('0x43')]['id']}})[_0xaac0('0x12')](handleEntityNotFound(_0x4bdad6,null))[_0xaac0('0x12')](removeEntity(_0x4bdad6,null))[_0xaac0('0x1d')](handleError(_0x4bdad6,null));};exports[_0xaac0('0x48')]=function(_0x464d41,_0x206a05){return db[_0xaac0('0x2c')][_0xaac0('0x48')]()['then'](respondWithResult(_0x206a05,null))['catch'](handleError(_0x206a05,null));};exports[_0xaac0('0x49')]=function(_0x3fd198,_0x5c3a6e){return db[_0xaac0('0x2c')][_0xaac0('0x49')](_0x3fd198[_0xaac0('0x47')])[_0xaac0('0x12')](function(_0x55ee3f){if(_0x55ee3f){if(_0x55ee3f[_0xaac0('0x4a')]===_0xaac0('0x4b')&&!_0x55ee3f[_0xaac0('0x4c')]){var _0x5c4334,_0x45a57e,_0x3ab5ee;if(_0x3fd198[_0xaac0('0x47')]['to']){_0x45a57e=_0x3fd198[_0xaac0('0x47')]['to'][_0xaac0('0x4d')](',')[0x0];}return db[_0xaac0('0x4e')][_0xaac0('0x4f')]({'where':{'id':_0x55ee3f[_0xaac0('0x50')]},'include':[{'model':db[_0xaac0('0x51')],'as':_0xaac0('0x52'),'include':[{'model':db[_0xaac0('0x53')],'as':'Contacts','where':{'email':_0x45a57e},'limit':0x1,'order':[[_0xaac0('0x54'),'DESC']]}]},{'model':db[_0xaac0('0x55')],'as':_0xaac0('0x56'),'raw':!![],'include':[{'model':db[_0xaac0('0x57')],'as':_0xaac0('0x57'),'raw':!![]}]}]})['then'](function(_0x3c4db6){_0x5c4334=_0x3c4db6;if(!_0x5c4334||!_0x5c4334['Smtp'])return;var _0x1488a7=_0x5c4334[_0xaac0('0x58')]();if(_0x3fd198['body']['attachments']&&_0x3fd198[_0xaac0('0x47')][_0xaac0('0x59')][_0xaac0('0x36')]){for(var _0x20ac7e=0x0;_0x20ac7e<_0x3fd198[_0xaac0('0x47')][_0xaac0('0x59')][_0xaac0('0x36')];_0x20ac7e+=0x1){_0x3fd198[_0xaac0('0x47')]['attachments'][_0x20ac7e]={'filename':_0x3fd198[_0xaac0('0x47')][_0xaac0('0x59')][_0x20ac7e][_0xaac0('0x29')],'path':path['join'](config[_0xaac0('0x5a')],_0xaac0('0x5b'),_0x3fd198['body']['attachments'][_0x20ac7e][_0xaac0('0x5c')])};}}_0x3ab5ee={'account':_0x1488a7,'message':_0x3fd198['body']};return;})[_0xaac0('0x12')](function(){if(_0x5c4334[_0xaac0('0x52')]){if(_0x5c4334[_0xaac0('0x52')][_0xaac0('0x5d')][_0xaac0('0x36')]){return _0x5c4334['List']['Contacts'][0x0];}else{return db[_0xaac0('0x53')][_0xaac0('0x49')](_['defaults'](_0x3fd198[_0xaac0('0x47')],{'firstName':_0x3fd198[_0xaac0('0x47')]['to'],'email':_0x3fd198['body']['to'],'phone':_0x3fd198[_0xaac0('0x47')]['to'],'ListId':_0x5c4334[_0xaac0('0x5e')]}));}}else{throw new Error(_0xaac0('0x5f'));}})['then'](function(){if(_0x3ab5ee){return respondWithRpcPromise(_0xaac0('0x60'),_0xaac0('0x61'),_0x3ab5ee,client9003)[_0xaac0('0x12')](function(_0x2980e0){return _0x55ee3f['update']({'read':!![],'messageId':_0x2980e0['messageId'],'sentAt':moment()[_0xaac0('0x62')](_0xaac0('0x63'))});})[_0xaac0('0x1d')](function(_0x25d16a){logger[_0xaac0('0x19')]('%s',JSON['stringify'](_0x25d16a));return _0x55ee3f;});}return _0x55ee3f;});}return _0x55ee3f;}})['then'](respondWithResult(_0x5c3a6e,0xc9))[_0xaac0('0x1d')](handleError(_0x5c3a6e,null));};exports[_0xaac0('0x64')]=function(_0x2cc817,_0x4b71fb){var _0x2892f2={'agent':{},'channel':'mail'};if(_0x2cc817[_0xaac0('0x47')]['id']){delete _0x2cc817[_0xaac0('0x47')]['id'];}_0x2cc817[_0xaac0('0x47')][_0xaac0('0x65')]=!![];_0x2cc817[_0xaac0('0x47')][_0xaac0('0x66')]=moment()[_0xaac0('0x62')](_0xaac0('0x63'));_0x2cc817[_0xaac0('0x47')][_0xaac0('0x67')]=_0x2cc817['body'][_0xaac0('0x67')]||_0x2cc817[_0xaac0('0x68')]['id'];_0x2892f2['agent']['id']=_0x2cc817[_0xaac0('0x47')][_0xaac0('0x67')];return db[_0xaac0('0x2c')][_0xaac0('0x46')]({'where':{'id':_0x2cc817[_0xaac0('0x43')]['id'],'UserId':null}})[_0xaac0('0x12')](handleEntityNotFound(_0x4b71fb,null))[_0xaac0('0x12')](saveUpdates(_0x2cc817[_0xaac0('0x47')],null))['then'](function(_0x500585){if(_0x500585){_0x2892f2['message']=_0x500585[_0xaac0('0x69')]({'plain':!![]});return db[_0xaac0('0x6a')][_0xaac0('0x46')]({'where':{'id':_0x500585[_0xaac0('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x4b71fb,null))[_0xaac0('0x12')](function(_0x2bd978){if(_0x2bd978){return _0x2bd978[_0xaac0('0x25')]({'UserId':_0x2cc817['body'][_0xaac0('0x67')],'read1stAt':_[_0xaac0('0x6c')](_0x2bd978['read1stAt'])?moment()[_0xaac0('0x62')](_0xaac0('0x63')):undefined});}return null;})['then'](function(_0x4e7b95){if(_0x4e7b95){_0x2892f2[_0xaac0('0x6d')]=_0x4e7b95[_0xaac0('0x69')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2cc817[_0xaac0('0x68')]['id'],_0x2cc817['user'][_0xaac0('0x29')],_0x2cc817['user']['role'],_0x2892f2['interaction']['id'],_0x2cc817[_0xaac0('0x47')]?JSON['stringify'](_0x2cc817[_0xaac0('0x47')]):'null');return respondWithRpcPromise('AcceptMessage',_0xaac0('0x6e'),_0x2892f2);}return null;})[_0xaac0('0x12')](function(_0x3bf8f0){var _0x2198d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3bf8f0[_0xaac0('0x1b')][_0xaac0('0x6f')];return db[_0xaac0('0x70')]['query'](_0x2198d,{'type':db['Sequelize'][_0xaac0('0x71')]['SELECT'],'raw':!![]})[_0xaac0('0x12')](function(_0x23785a){return _0x23785a;});})[_0xaac0('0x12')](function(_0x201e57){if(_0x201e57){_0x2892f2[_0xaac0('0x1b')][_0xaac0('0x72')]=_0x201e57[0x0];if(!_0x2cc817[_0xaac0('0x47')][_0xaac0('0x67')])return;return db[_0xaac0('0x73')][_0xaac0('0x46')]({'where':{'id':_0x2cc817[_0xaac0('0x47')][_0xaac0('0x67')],'role':_0xaac0('0x74')},'attributes':['id',_0xaac0('0x29'),_0xaac0('0x75'),_0xaac0('0x76'),_0xaac0('0x77')],'raw':!![]});}return null;})[_0xaac0('0x12')](function(_0x5c0f5f){if(!_0x5c0f5f)return null;_0x2892f2['message']['agent']=_0x5c0f5f;return _0x2892f2;})[_0xaac0('0x12')](function(_0xe01c93){if(_0xe01c93){if(_0x2cc817[_0xaac0('0x47')][_0xaac0('0x78')]){_0x2892f2[_0xaac0('0x1b')]['interface']=util[_0xaac0('0x62')]('SIP/%s',_0x2cc817[_0xaac0('0x68')][_0xaac0('0x29')]);_0x2892f2['message']['channel']=_0x2892f2[_0xaac0('0x79')];_0x2892f2['message']['motionChannel']=_0x2892f2[_0xaac0('0x79')];_0x2892f2[_0xaac0('0x1b')]['event']=_0xaac0('0x64');_0x2892f2['message'][_0xaac0('0x47')]=htmlToText['fromString'](_0x2892f2[_0xaac0('0x1b')][_0xaac0('0x47')]);return respondWithRpcPromise(_0xaac0('0x7a'),_0xaac0('0x7a'),{'event':_0xaac0('0x7b'),'message':_0x2892f2['message']},client9002)[_0xaac0('0x12')](function(){return _0x2892f2;});}return _0x2892f2;}return null;})[_0xaac0('0x12')](respondWithResult(_0x4b71fb,null))[_0xaac0('0x1d')](handleError(_0x4b71fb,null));};exports[_0xaac0('0x7c')]=function(_0x599c40,_0x33a34e){var _0x293de2={'agent':{},'channel':_0xaac0('0x7d')};if(_0x599c40[_0xaac0('0x47')]['id']){delete _0x599c40[_0xaac0('0x47')]['id'];}_0x599c40[_0xaac0('0x47')][_0xaac0('0x67')]=_0x599c40[_0xaac0('0x47')]['UserId']||_0x599c40[_0xaac0('0x68')]['id'];_0x293de2['agent']['id']=_0x599c40[_0xaac0('0x47')][_0xaac0('0x67')];return db[_0xaac0('0x2c')][_0xaac0('0x46')]({'where':{'id':_0x599c40[_0xaac0('0x43')]['id'],'UserId':null}})[_0xaac0('0x12')](handleEntityNotFound(_0x33a34e,null))[_0xaac0('0x12')](function(_0x30751e){if(_0x30751e){_0x293de2[_0xaac0('0x1b')]=_0x30751e[_0xaac0('0x69')]({'plain':!![]});return db[_0xaac0('0x6a')][_0xaac0('0x46')]({'where':{'id':_0x30751e[_0xaac0('0x6b')]}});}return null;})[_0xaac0('0x12')](handleEntityNotFound(_0x33a34e,null))[_0xaac0('0x12')](function(_0x3b8579){if(_0x3b8579){_0x293de2[_0xaac0('0x6d')]=_0x3b8579['get']({'plain':!![]});interaction_log[_0xaac0('0x13')](_0xaac0('0x7e'),_0x599c40[_0xaac0('0x68')]['id'],_0x599c40[_0xaac0('0x68')][_0xaac0('0x29')],_0x599c40['user'][_0xaac0('0x7f')],_0x293de2[_0xaac0('0x6d')]['id'],_0x599c40['body']?JSON[_0xaac0('0x18')](_0x599c40[_0xaac0('0x47')]):_0xaac0('0x80'));return respondWithRpcPromise('RejectMessage',_0xaac0('0x81'),_0x293de2);}return null;})[_0xaac0('0x12')](function(_0x32ede2){var _0x45dc4e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x32ede2['message']['ContactId'];return db[_0xaac0('0x70')][_0xaac0('0x31')](_0x45dc4e,{'type':db[_0xaac0('0x82')][_0xaac0('0x71')][_0xaac0('0x83')],'raw':!![]})['then'](function(_0x15dd37){return _0x15dd37;});})['then'](function(_0x922004){if(_0x922004){_0x293de2[_0xaac0('0x1b')]['contact']=_0x922004[0x0];if(!_0x599c40[_0xaac0('0x47')][_0xaac0('0x67')])return;return db[_0xaac0('0x73')][_0xaac0('0x46')]({'where':{'id':_0x599c40['body']['UserId'],'role':'agent'},'attributes':['id','name',_0xaac0('0x75'),'email','internal'],'raw':!![]});}return null;})[_0xaac0('0x12')](function(_0x583c23){if(!_0x583c23)return null;_0x293de2[_0xaac0('0x1b')]['agent']=_0x583c23;return _0x293de2;})[_0xaac0('0x12')](function(_0x36aab3){if(_0x36aab3){_0x36aab3[_0xaac0('0x1b')]['interface']=util[_0xaac0('0x62')](_0xaac0('0x84'),_0x599c40[_0xaac0('0x68')][_0xaac0('0x29')]);_0x36aab3['message']['channel']=_0x293de2['channel'];_0x36aab3['message'][_0xaac0('0x85')]=_0x293de2[_0xaac0('0x79')];_0x36aab3[_0xaac0('0x1b')][_0xaac0('0x86')]='reject';_0x36aab3[_0xaac0('0x1b')]['body']=htmlToText[_0xaac0('0x87')](_0x293de2[_0xaac0('0x1b')][_0xaac0('0x47')]);respondWithRpcPromise(_0xaac0('0x7a'),_0xaac0('0x7a'),{'event':_0xaac0('0x88'),'message':_0x36aab3[_0xaac0('0x1b')]},client9002);return _0x293de2;}return null;})[_0xaac0('0x12')](respondWithResult(_0x33a34e,null))[_0xaac0('0x1d')](handleError(_0x33a34e,null));};exports[_0xaac0('0x89')]=function(_0x596860,_0x517055){var _0x2f3458=moment()[_0xaac0('0x8a')]()['toString']();var _0x287f9a=path[_0xaac0('0x8b')](config[_0xaac0('0x5a')],_0xaac0('0x8c'),_0xaac0('0x8d'),_0xaac0('0x8e'));var _0xf0cc9e=path[_0xaac0('0x8b')](config['root'],_0xaac0('0x8c'),_0xaac0('0x8d'),_0xaac0('0x59'));var _0x35d03d=util[_0xaac0('0x62')](_0xaac0('0x8f'),_0x2f3458);return db[_0xaac0('0x2c')][_0xaac0('0x46')]({'where':{'id':_0x596860[_0xaac0('0x43')]['id']},'attributes':['id',_0xaac0('0x47'),_0xaac0('0x90'),'to','cc',_0xaac0('0x91'),_0xaac0('0x92'),_0xaac0('0x93')],'include':_0x596860[_0xaac0('0x31')][_0xaac0('0x59')]?[{'model':db[_0xaac0('0x94')],'as':_0xaac0('0x95')}]:undefined})['then'](handleEntityNotFound(_0x517055,null))[_0xaac0('0x12')](function(_0x3c2de5){if(_0x3c2de5){var _0x17dadd=_0x3c2de5;var _0x231676={'from':_0x17dadd[_0xaac0('0x90')],'to':_0x17dadd['to'],'subject':_0x17dadd[_0xaac0('0x92')],'html':htmlEntities[_0xaac0('0x96')](_0x17dadd[_0xaac0('0x47')]),'headers':{'Date':moment(_0x17dadd[_0xaac0('0x93')])[_0xaac0('0x62')](_0xaac0('0x97'))},'attachments':[]};if(_0x3c2de5['cc']){_0x231676[_0xaac0('0x98')]['Cc']=_0x3c2de5['cc'];}if(_0x3c2de5[_0xaac0('0x91')]){_0x231676['headers'][_0xaac0('0x99')]=_0x3c2de5[_0xaac0('0x91')];}return new BPromise(function(_0x88ec48,_0x187c3b){if(_0x3c2de5[_0xaac0('0x95')]){for(var _0x3d36e0=0x0;_0x3d36e0<_0x3c2de5[_0xaac0('0x95')]['length'];_0x3d36e0++){var _0x16895d=_0x3c2de5[_0xaac0('0x95')][_0x3d36e0];var _0x3a1a48=path[_0xaac0('0x8b')](_0xf0cc9e,_0x16895d['basename']);if(fs['existsSync'](_0x3a1a48)){_0x231676['attachments'][_0xaac0('0x9a')]({'name':_0x16895d[_0xaac0('0x29')],'contentType':_0x16895d[_0xaac0('0x2e')],'data':fs['readFileSync'](_0x3a1a48)});}}}emlformat[_0xaac0('0x9b')](_0x231676,function(_0x704018,_0xa575a1){if(_0x704018)return _0x187c3b(_0x704018);fs[_0xaac0('0x9c')](path[_0xaac0('0x8b')](_0x287f9a,_0x35d03d),_0xa575a1);return _0x88ec48(_0xa575a1);});});}})['then'](function(_0x43a2b1){if(_0x43a2b1){return _0x517055[_0xaac0('0x89')](path['join'](_0x287f9a,_0x35d03d),_0x35d03d,function(_0x6b1223){if(!_0x6b1223)fs['unlinkSync'](path[_0xaac0('0x8b')](_0x287f9a,_0x35d03d));});}})[_0xaac0('0x1d')](handleError(_0x517055,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 50e17d0..bcf87b0 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 _0x1fe8=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x1fe8,0x15f));var _0x81fe=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x1fe8[_0x5d2803];return _0xdcad2c;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x81fe('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x81fe('0x1')](0x0);var events={'afterCreate':_0x81fe('0x2'),'afterUpdate':_0x81fe('0x3'),'afterDestroy':_0x81fe('0x4')};function emitEvent(_0x116975){return function(_0x148d4a,_0x5a9832,_0x1dbd7a){MailMessageEvents[_0x81fe('0x5')](_0x116975+':'+_0x148d4a['id'],_0x148d4a);MailMessageEvents['emit'](_0x116975,_0x148d4a);_0x1dbd7a(null);};}for(var e in events){if(events[_0x81fe('0x6')](e)){var event=events[e];MailMessage[_0x81fe('0x7')](e,emitEvent(event));}}module[_0x81fe('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xba7b=['hook','exports','MailMessage','save','remove','emit'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xba7b,0xda));var _0xbba7=function(_0x5761bd,_0x4f9e21){_0x5761bd=_0x5761bd-0x0;var _0x3efb26=_0xba7b[_0x5761bd];return _0x3efb26;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0xbba7('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbba7('0x1'),'afterUpdate':'update','afterDestroy':_0xbba7('0x2')};function emitEvent(_0x219dbe){return function(_0x5bfa7e,_0x3134a0,_0xfe10fd){MailMessageEvents[_0xbba7('0x3')](_0x219dbe+':'+_0x5bfa7e['id'],_0x5bfa7e);MailMessageEvents[_0xbba7('0x3')](_0x219dbe,_0x5bfa7e);_0xfe10fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xbba7('0x4')](e,emitEvent(event));}}module[_0xbba7('0x5')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index c43d714..a1a2d31 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 _0xf207=['path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text'];(function(_0x535f2c,_0x234446){var _0x47d61f=function(_0x494c29){while(--_0x494c29){_0x535f2c['push'](_0x535f2c['shift']());}};_0x47d61f(++_0x234446);}(_0xf207,0x1f0));var _0x7f20=function(_0x5ef7b8,_0x15cc07){_0x5ef7b8=_0x5ef7b8-0x0;var _0x2c7148=_0xf207[_0x5ef7b8];return _0x2c7148;};'use strict';var _=require(_0x7f20('0x0'));var util=require(_0x7f20('0x1'));var logger=require(_0x7f20('0x2'))(_0x7f20('0x3'));var moment=require(_0x7f20('0x4'));var BPromise=require(_0x7f20('0x5'));var rp=require(_0x7f20('0x6'));var htmlToText=require(_0x7f20('0x7'));var fs=require('fs');var path=require(_0x7f20('0x8'));var rimraf=require(_0x7f20('0x9'));var config=require(_0x7f20('0xa'));var attributes=require(_0x7f20('0xb'));module[_0x7f20('0xc')]=function(_0x20aeb7,_0x5aa9be){return _0x20aeb7[_0x7f20('0xd')](_0x7f20('0xe'),attributes,{'tableName':_0x7f20('0xf'),'paranoid':![],'indexes':[{'name':_0x7f20('0x10'),'fields':[_0x7f20('0x10')]},{'name':_0x7f20('0x11'),'fields':[_0x7f20('0x12'),_0x7f20('0x13')],'type':_0x7f20('0x14')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2027dd,_0x125654,_0x4c6d43){if(_0x2027dd['body']){_0x2027dd[_0x7f20('0x12')]=htmlToText[_0x7f20('0x15')](_0x2027dd[_0x7f20('0x16')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4c6d43(null,_0x125654);},'afterCreate':function(_0x5349f1,_0xbf2382,_0x80c74c){var _0x5cd528=_0x20aeb7['models'];var _0x2d1316=_0x5349f1[_0x7f20('0x17')]({'plain':!![]});if(_0x2d1316[_0x7f20('0x18')][_0x7f20('0x19')]()==='in'||_0x2d1316[_0x7f20('0x18')][_0x7f20('0x19')]()===_0x7f20('0x1a')&&!_0x2d1316[_0x7f20('0x1b')]&&!_[_0x7f20('0x1c')](_0x2d1316[_0x7f20('0x1d')])){_0x5cd528[_0x7f20('0x1e')]['findOne']({'where':{'id':_0x2d1316[_0x7f20('0x1f')]}})['then'](function(_0x1c777b){if(_0x1c777b){_0x1c777b[_0x7f20('0x20')]({'lastMsgAt':_0x2d1316['createdAt'],'lastMsgDirection':_0x2d1316['direction'][_0x7f20('0x19')]()});}})['catch'](function(_0x34c38c){console[_0x7f20('0x21')](_0x34c38c);});}_0x80c74c();}},'charset':_0x7f20('0x22'),'collate':_0x7f20('0x23')});}; \ No newline at end of file +var _0xd915=['secret','MailInteraction','MailInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out'];(function(_0x31f692,_0x12610e){var _0x108ff1=function(_0xdecc78){while(--_0xdecc78){_0x31f692['push'](_0x31f692['shift']());}};_0x108ff1(++_0x12610e);}(_0xd915,0x8d));var _0x5d91=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xd915[_0x376b45];return _0x2341b3;};'use strict';var _=require('lodash');var util=require(_0x5d91('0x0'));var logger=require(_0x5d91('0x1'))(_0x5d91('0x2'));var moment=require(_0x5d91('0x3'));var BPromise=require(_0x5d91('0x4'));var rp=require(_0x5d91('0x5'));var htmlToText=require(_0x5d91('0x6'));var fs=require('fs');var path=require(_0x5d91('0x7'));var rimraf=require(_0x5d91('0x8'));var config=require(_0x5d91('0x9'));var attributes=require(_0x5d91('0xa'));module['exports']=function(_0x3334f3,_0x21358e){return _0x3334f3['define'](_0x5d91('0xb'),attributes,{'tableName':_0x5d91('0xc'),'paranoid':![],'indexes':[{'name':_0x5d91('0xd'),'fields':[_0x5d91('0xd')]},{'name':_0x5d91('0xe'),'fields':['plainBody',_0x5d91('0xf')],'type':_0x5d91('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1bbdea,_0xed301c,_0x5c5c57){if(_0x1bbdea[_0x5d91('0x11')]){_0x1bbdea['plainBody']=htmlToText[_0x5d91('0x12')](_0x1bbdea[_0x5d91('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5c5c57(null,_0xed301c);},'afterCreate':function(_0x4269b9,_0x36b750,_0x3b8b40){var _0x2ee3ee=_0x3334f3[_0x5d91('0x13')];var _0xf5b636=_0x4269b9[_0x5d91('0x14')]({'plain':!![]});if(_0xf5b636[_0x5d91('0x15')][_0x5d91('0x16')]()==='in'||_0xf5b636[_0x5d91('0x15')]['toLowerCase']()===_0x5d91('0x17')&&!_0xf5b636[_0x5d91('0x18')]&&!_['isNil'](_0xf5b636['UserId'])){_0x2ee3ee[_0x5d91('0x19')]['findOne']({'where':{'id':_0xf5b636[_0x5d91('0x1a')]}})[_0x5d91('0x1b')](function(_0x79c2d4){if(_0x79c2d4){_0x79c2d4[_0x5d91('0x1c')]({'lastMsgAt':_0xf5b636[_0x5d91('0x1d')],'lastMsgDirection':_0xf5b636['direction'][_0x5d91('0x16')]()});}})['catch'](function(_0x40d405){console[_0x5d91('0x1e')](_0x40d405);});}_0x3b8b40();}},'charset':_0x5d91('0x1f'),'collate':_0x5d91('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index b8bb75a..6f6eaaf 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 _0xd7d1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','debug','stringify','error','message','result','CreateMailMessage','MailMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x5330d5,_0x3cda5c){_0x5330d5=_0x5330d5-0x0;var _0x50eb55=_0xd7d1[_0x5330d5];return _0x50eb55;};'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});config[_0x1d7d('0xd')]=_[_0x1d7d('0xe')](config[_0x1d7d('0xd')],{'host':_0x1d7d('0xf'),'port':0x18eb});var socket=require(_0x1d7d('0x10'))(new Redis(config[_0x1d7d('0xd')]));require(_0x1d7d('0x11'))[_0x1d7d('0x12')](socket);function respondWithRpcPromise(_0x1ad06f,_0x8b258b,_0x2765fe){return new BPromise(function(_0x547f7b,_0xe6b9eb){return client['request'](_0x1ad06f,_0x2765fe)[_0x1d7d('0x13')](function(_0x3a7add){logger[_0x1d7d('0x14')](_0x1d7d('0x15'),_0x8b258b,'request\x20sent');logger[_0x1d7d('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x8b258b,'request\x20sent',JSON[_0x1d7d('0x17')](_0x3a7add));if(_0x3a7add[_0x1d7d('0x18')]){if(_0x3a7add['error']['code']===0x1f4){logger[_0x1d7d('0x18')](_0x1d7d('0x15'),_0x8b258b,_0x3a7add[_0x1d7d('0x18')][_0x1d7d('0x19')]);return _0xe6b9eb(_0x3a7add[_0x1d7d('0x18')]['message']);}logger[_0x1d7d('0x18')](_0x1d7d('0x15'),_0x8b258b,_0x3a7add['error'][_0x1d7d('0x19')]);return _0x547f7b(_0x3a7add[_0x1d7d('0x18')][_0x1d7d('0x19')]);}else{logger[_0x1d7d('0x14')](_0x1d7d('0x15'),_0x8b258b,'request\x20sent');_0x547f7b(_0x3a7add[_0x1d7d('0x1a')][_0x1d7d('0x19')]);}})['catch'](function(_0x495212){logger[_0x1d7d('0x18')](_0x1d7d('0x15'),_0x8b258b,_0x495212);_0xe6b9eb(_0x495212);});});}exports[_0x1d7d('0x1b')]=function(_0x396802){var _0x2ae740=this;return new Promise(function(_0x275d3c,_0x54d401){return db[_0x1d7d('0x1c')][_0x1d7d('0x1d')](_0x396802[_0x1d7d('0x1e')],{'raw':_0x396802['options']?_0x396802[_0x1d7d('0x1f')][_0x1d7d('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x5950bd){logger[_0x1d7d('0x14')](_0x1d7d('0x1b'),_0x396802);logger[_0x1d7d('0x16')]('CreateMailMessage',_0x396802,JSON[_0x1d7d('0x17')](_0x5950bd));_0x275d3c(_0x5950bd);})[_0x1d7d('0x21')](function(_0x2d4c0c){logger[_0x1d7d('0x18')]('CreateMailMessage',_0x2d4c0c[_0x1d7d('0x19')],_0x396802);_0x54d401(_0x2ae740[_0x1d7d('0x18')](0x1f4,_0x2d4c0c['message']));});});}; \ No newline at end of file +var _0xb03e=['raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateMailMessage','MailMessage','create','body','options'];(function(_0x244ccc,_0x11c235){var _0x592d81=function(_0x4a5382){while(--_0x4a5382){_0x244ccc['push'](_0x244ccc['shift']());}};_0x592d81(++_0x11c235);}(_0xb03e,0x1eb));var _0xeb03=function(_0x26955a,_0x45b75e){_0x26955a=_0x26955a-0x0;var _0x328b5e=_0xb03e[_0x26955a];return _0x328b5e;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var moment=require(_0xeb03('0x1'));var BPromise=require(_0xeb03('0x2'));var rs=require(_0xeb03('0x3'));var fs=require('fs');var Redis=require(_0xeb03('0x4'));var db=require(_0xeb03('0x5'))['db'];var utils=require(_0xeb03('0x6'));var logger=require(_0xeb03('0x7'))(_0xeb03('0x8'));var config=require(_0xeb03('0x9'));var jayson=require(_0xeb03('0xa'));var client=jayson[_0xeb03('0xb')]['http']({'port':0x232a});config[_0xeb03('0xc')]=_[_0xeb03('0xd')](config[_0xeb03('0xc')],{'host':_0xeb03('0xe'),'port':0x18eb});var socket=require(_0xeb03('0xf'))(new Redis(config[_0xeb03('0xc')]));require('./mailMessage.socket')[_0xeb03('0x10')](socket);function respondWithRpcPromise(_0x99f4e2,_0x14cfa0,_0x4f5013){return new BPromise(function(_0x31af2c,_0x48af4f){return client[_0xeb03('0x11')](_0x99f4e2,_0x4f5013)[_0xeb03('0x12')](function(_0x3de728){logger[_0xeb03('0x13')](_0xeb03('0x14'),_0x14cfa0,_0xeb03('0x15'));logger[_0xeb03('0x16')](_0xeb03('0x17'),_0x14cfa0,_0xeb03('0x15'),JSON[_0xeb03('0x18')](_0x3de728));if(_0x3de728[_0xeb03('0x19')]){if(_0x3de728[_0xeb03('0x19')]['code']===0x1f4){logger[_0xeb03('0x19')](_0xeb03('0x14'),_0x14cfa0,_0x3de728[_0xeb03('0x19')][_0xeb03('0x1a')]);return _0x48af4f(_0x3de728['error'][_0xeb03('0x1a')]);}logger[_0xeb03('0x19')](_0xeb03('0x14'),_0x14cfa0,_0x3de728['error'][_0xeb03('0x1a')]);return _0x31af2c(_0x3de728[_0xeb03('0x19')][_0xeb03('0x1a')]);}else{logger[_0xeb03('0x13')](_0xeb03('0x14'),_0x14cfa0,_0xeb03('0x15'));_0x31af2c(_0x3de728[_0xeb03('0x1b')][_0xeb03('0x1a')]);}})[_0xeb03('0x1c')](function(_0x469d25){logger[_0xeb03('0x19')](_0xeb03('0x14'),_0x14cfa0,_0x469d25);_0x48af4f(_0x469d25);});});}exports[_0xeb03('0x1d')]=function(_0x19bddf){var _0x4d307c=this;return new Promise(function(_0x1bea3f,_0x3855dd){return db[_0xeb03('0x1e')][_0xeb03('0x1f')](_0x19bddf[_0xeb03('0x20')],{'raw':_0x19bddf[_0xeb03('0x21')]?_0x19bddf[_0xeb03('0x21')][_0xeb03('0x22')]===undefined?!![]:![]:!![]})[_0xeb03('0x12')](function(_0x5a704b){logger[_0xeb03('0x13')](_0xeb03('0x1d'),_0x19bddf);logger[_0xeb03('0x16')](_0xeb03('0x1d'),_0x19bddf,JSON[_0xeb03('0x18')](_0x5a704b));_0x1bea3f(_0x5a704b);})['catch'](function(_0x638353){logger[_0xeb03('0x19')](_0xeb03('0x1d'),_0x638353[_0xeb03('0x1a')],_0x19bddf);_0x3855dd(_0x4d307c[_0xeb03('0x19')](0x1f4,_0x638353[_0xeb03('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 1435583..ae1b857 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 _0x1d20=['remove','removeListener','length','mailMessage:','./mailMessage.events','save'];(function(_0x577519,_0x346daf){var _0x5b12f7=function(_0x4aecb6){while(--_0x4aecb6){_0x577519['push'](_0x577519['shift']());}};_0x5b12f7(++_0x346daf);}(_0x1d20,0x106));var _0x01d2=function(_0x4a609c,_0x311cbe){_0x4a609c=_0x4a609c-0x0;var _0x5c0db4=_0x1d20[_0x4a609c];return _0x5c0db4;};'use strict';var MailMessageEvents=require(_0x01d2('0x0'));var events=[_0x01d2('0x1'),_0x01d2('0x2'),'update'];function createListener(_0x1cc231,_0x120685){return function(_0x287d6b){_0x120685['emit'](_0x1cc231,_0x287d6b);};}function removeListener(_0x3e1b2e,_0x75a70b){return function(){MailMessageEvents[_0x01d2('0x3')](_0x3e1b2e,_0x75a70b);};}exports['register']=function(_0x2d35d5){for(var _0x49c7ce=0x0,_0x447f8c=events[_0x01d2('0x4')];_0x49c7ce<_0x447f8c;_0x49c7ce++){var _0x30e2b6=events[_0x49c7ce];var _0x4ce3ce=createListener(_0x01d2('0x5')+_0x30e2b6,_0x2d35d5);MailMessageEvents['on'](_0x30e2b6,_0x4ce3ce);}}; \ No newline at end of file +var _0xb763=['save','remove','update','emit','removeListener','register','length','mailMessage:','./mailMessage.events'];(function(_0x2c9894,_0x43aebe){var _0x52b2d3=function(_0x1782d2){while(--_0x1782d2){_0x2c9894['push'](_0x2c9894['shift']());}};_0x52b2d3(++_0x43aebe);}(_0xb763,0x155));var _0x3b76=function(_0x54aadd,_0x3b957b){_0x54aadd=_0x54aadd-0x0;var _0x5f25e4=_0xb763[_0x54aadd];return _0x5f25e4;};'use strict';var MailMessageEvents=require(_0x3b76('0x0'));var events=[_0x3b76('0x1'),_0x3b76('0x2'),_0x3b76('0x3')];function createListener(_0x535caf,_0x5d966d){return function(_0x2f6e42){_0x5d966d[_0x3b76('0x4')](_0x535caf,_0x2f6e42);};}function removeListener(_0x32b878,_0x222d63){return function(){MailMessageEvents[_0x3b76('0x5')](_0x32b878,_0x222d63);};}exports[_0x3b76('0x6')]=function(_0x54f432){for(var _0x4c5a23=0x0,_0x4a0428=events[_0x3b76('0x7')];_0x4c5a23<_0x4a0428;_0x4c5a23++){var _0xe60f92=events[_0x4c5a23];var _0x4b7b35=createListener(_0x3b76('0x8')+_0xe60f92,_0x54f432);MailMessageEvents['on'](_0xe60f92,_0x4b7b35);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 93a958c..19724e2 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 _0x63d0=['create','addTeams','addAgents','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','post'];(function(_0xb85fd5,_0x3362ae){var _0x34228e=function(_0x1e62fa){while(--_0x1e62fa){_0xb85fd5['push'](_0xb85fd5['shift']());}};_0x34228e(++_0x3362ae);}(_0x63d0,0x70));var _0x063d=function(_0x3cf2e0,_0x41834e){_0x3cf2e0=_0x3cf2e0-0x0;var _0x32a045=_0x63d0[_0x3cf2e0];return _0x32a045;};'use strict';var multer=require('multer');var util=require(_0x063d('0x0'));var path=require(_0x063d('0x1'));var timeout=require(_0x063d('0x2'));var express=require(_0x063d('0x3'));var router=express['Router']();var fs_extra=require(_0x063d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x063d('0x5'));var config=require(_0x063d('0x6'));var controller=require(_0x063d('0x7'));router[_0x063d('0x8')]('/',auth[_0x063d('0x9')](),controller[_0x063d('0xa')]);router[_0x063d('0x8')]('/describe',auth[_0x063d('0x9')](),controller[_0x063d('0xb')]);router[_0x063d('0x8')]('/:id',auth[_0x063d('0x9')](),controller[_0x063d('0xc')]);router[_0x063d('0x8')](_0x063d('0xd'),auth[_0x063d('0x9')](),controller['getMembers']);router[_0x063d('0x8')](_0x063d('0xe'),auth[_0x063d('0x9')](),controller[_0x063d('0xf')]);router['get'](_0x063d('0x10'),auth[_0x063d('0x9')](),controller['getAgents']);router[_0x063d('0x11')]('/',auth['isAuthenticated'](),controller[_0x063d('0x12')]);router['post'](_0x063d('0xe'),auth[_0x063d('0x9')](),controller[_0x063d('0x13')]);router[_0x063d('0x11')](_0x063d('0x10'),auth[_0x063d('0x9')](),controller[_0x063d('0x14')]);router['put']('/:id',auth[_0x063d('0x9')](),controller[_0x063d('0x15')]);router[_0x063d('0x16')](_0x063d('0x17'),auth[_0x063d('0x9')](),controller[_0x063d('0x18')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x063d('0x10'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x063d('0x19')]=router; \ No newline at end of file +var _0xeb69=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','index','get','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','addTeams','/:id/users','addAgents','put','delete','removeTeams','removeAgents','multer'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0xeb69,0xdf));var _0x9eb6=function(_0x503940,_0x157744){_0x503940=_0x503940-0x0;var _0x27f3f5=_0xeb69[_0x503940];return _0x27f3f5;};'use strict';var multer=require(_0x9eb6('0x0'));var util=require(_0x9eb6('0x1'));var path=require(_0x9eb6('0x2'));var timeout=require(_0x9eb6('0x3'));var express=require(_0x9eb6('0x4'));var router=express[_0x9eb6('0x5')]();var fs_extra=require(_0x9eb6('0x6'));var auth=require(_0x9eb6('0x7'));var interaction=require(_0x9eb6('0x8'));var config=require(_0x9eb6('0x9'));var controller=require(_0x9eb6('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x9eb6('0xb')]);router[_0x9eb6('0xc')]('/describe',auth[_0x9eb6('0xd')](),controller['describe']);router[_0x9eb6('0xc')](_0x9eb6('0xe'),auth['isAuthenticated'](),controller[_0x9eb6('0xf')]);router[_0x9eb6('0xc')](_0x9eb6('0x10'),auth[_0x9eb6('0xd')](),controller[_0x9eb6('0x11')]);router['get'](_0x9eb6('0x12'),auth[_0x9eb6('0xd')](),controller['getTeams']);router[_0x9eb6('0xc')]('/:id/users',auth[_0x9eb6('0xd')](),controller[_0x9eb6('0x13')]);router[_0x9eb6('0x14')]('/',auth[_0x9eb6('0xd')](),controller['create']);router['post'](_0x9eb6('0x12'),auth[_0x9eb6('0xd')](),controller[_0x9eb6('0x15')]);router[_0x9eb6('0x14')](_0x9eb6('0x16'),auth['isAuthenticated'](),controller[_0x9eb6('0x17')]);router[_0x9eb6('0x18')](_0x9eb6('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x9eb6('0x19')](_0x9eb6('0xe'),auth[_0x9eb6('0xd')](),controller['destroy']);router[_0x9eb6('0x19')](_0x9eb6('0x12'),auth[_0x9eb6('0xd')](),controller[_0x9eb6('0x1a')]);router['delete'](_0x9eb6('0x16'),auth[_0x9eb6('0xd')](),controller[_0x9eb6('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 896e912..fd4d3be 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 _0x1dee=['roundrobin','sequelize','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x168717,_0x23d1db){var _0x45630b=function(_0x23ac9c){while(--_0x23ac9c){_0x168717['push'](_0x168717['shift']());}};_0x45630b(++_0x23d1db);}(_0x1dee,0x189));var _0xe1de=function(_0x5477b0,_0x527602){_0x5477b0=_0x5477b0-0x0;var _0x388d97=_0x1dee[_0x5477b0];return _0x388d97;};'use strict';var Sequelize=require(_0xe1de('0x0'));module[_0xe1de('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe1de('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe1de('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe1de('0x4')](_0xe1de('0x5'),'beepall',_0xe1de('0x6'))}}; \ No newline at end of file +var _0x781f=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x54760a,_0x10306a){var _0x2de4f3=function(_0x5aacc6){while(--_0x5aacc6){_0x54760a['push'](_0x54760a['shift']());}};_0x2de4f3(++_0x10306a);}(_0x781f,0x1c6));var _0xf781=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x781f[_0x4f431d];return _0x4f31e1;};'use strict';var Sequelize=require(_0xf781('0x0'));module[_0xf781('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf781('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf781('0x3'),_0xf781('0x4'),_0xf781('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 2a7b2d4..4d76cb8 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 _0x96cc=['sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','hasOwnProperty','nolimit','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','format','%s/%s','SIP','createdAt','findOne','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','emit','removeTeams','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','userMailQueue:save','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','MailQueues','UserProfileResource','stack','name','send','map','MailQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','order'];(function(_0x380d90,_0x4f711d){var _0x1ff262=function(_0x4c2b9b){while(--_0x4c2b9b){_0x380d90['push'](_0x380d90['shift']());}};_0x1ff262(++_0x4f711d);}(_0x96cc,0x16c));var _0xc96c=function(_0x409deb,_0x2b731){_0x409deb=_0x409deb-0x0;var _0x15a4f7=_0x96cc[_0x409deb];return _0x15a4f7;};'use strict';var emlformat=require(_0xc96c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc96c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc96c('0x2'));var moment=require(_0xc96c('0x3'));var BPromise=require(_0xc96c('0x4'));var Mustache=require(_0xc96c('0x5'));var util=require(_0xc96c('0x6'));var path=require(_0xc96c('0x7'));var sox=require(_0xc96c('0x8'));var csv=require(_0xc96c('0x9'));var ejs=require(_0xc96c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0x9'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc96c('0x14'));var logger=require('../../config/logger')(_0xc96c('0x15'));var utils=require('../../config/utils');var config=require(_0xc96c('0x16'));var licenseUtil=require(_0xc96c('0x17'));var db=require(_0xc96c('0x18'))['db'];config[_0xc96c('0x19')]=_['defaults'](config[_0xc96c('0x19')],{'host':_0xc96c('0x1a'),'port':0x18eb});var socket=require(_0xc96c('0x1b'))(new Redis(config[_0xc96c('0x19')]));require('./mailQueue.socket')[_0xc96c('0x1c')](socket);function respondWithStatusCode(_0xbed0c9,_0x399267){_0x399267=_0x399267||0xcc;return function(_0x32e640){if(_0x32e640){return _0xbed0c9[_0xc96c('0x1d')](_0x399267);}return _0xbed0c9[_0xc96c('0x1e')](_0x399267)[_0xc96c('0x1f')]();};}function respondWithResult(_0x23e357,_0x174852){_0x174852=_0x174852||0xc8;return function(_0x4248c9){if(_0x4248c9){return _0x23e357[_0xc96c('0x1e')](_0x174852)['json'](_0x4248c9);}};}function respondWithFilteredResult(_0x509376,_0x406791){return function(_0x99c402){if(_0x99c402){var _0x16b6ce=typeof _0x406791[_0xc96c('0x20')]==='undefined'&&typeof _0x406791[_0xc96c('0x21')]===_0xc96c('0x22');var _0x2a361c=_0x99c402[_0xc96c('0x23')];var _0x184128=_0x16b6ce?0x0:_0x406791[_0xc96c('0x20')];var _0x43cc22=_0x16b6ce?_0x99c402[_0xc96c('0x23')]:_0x406791[_0xc96c('0x20')]+_0x406791[_0xc96c('0x21')];var _0x2bb397;if(_0x43cc22>=_0x2a361c){_0x43cc22=_0x2a361c;_0x2bb397=0xc8;}else{_0x2bb397=0xce;}_0x509376[_0xc96c('0x1e')](_0x2bb397);return _0x509376[_0xc96c('0x24')](_0xc96c('0x25'),_0x184128+'-'+_0x43cc22+'/'+_0x2a361c)[_0xc96c('0x26')](_0x99c402);}return null;};}function patchUpdates(_0x3b5c6c){return function(_0x3e2615){try{jsonpatch['apply'](_0x3e2615,_0x3b5c6c,!![]);}catch(_0xd63951){return BPromise[_0xc96c('0x27')](_0xd63951);}return _0x3e2615[_0xc96c('0x28')]();};}function saveUpdates(_0x10ae21,_0x2b1df9){return function(_0x35f480){if(_0x35f480){return _0x35f480[_0xc96c('0x29')](_0x10ae21)[_0xc96c('0x2a')](function(_0x1a77df){return _0x1a77df;});}return null;};}function removeEntity(_0x14f171,_0x50fc07){return function(_0x3a23cb){if(_0x3a23cb){return _0x3a23cb[_0xc96c('0x2b')]()[_0xc96c('0x2a')](function(){var _0x294fee=_0x3a23cb['get']({'plain':!![]});var _0x5c00b6=_0xc96c('0x2c');return db[_0xc96c('0x2d')][_0xc96c('0x2b')]({'where':{'type':_0x5c00b6,'resourceId':_0x294fee['id']}})[_0xc96c('0x2a')](function(){return _0x3a23cb;});})[_0xc96c('0x2a')](function(){_0x14f171[_0xc96c('0x1e')](0xcc)[_0xc96c('0x1f')]();});}};}function handleEntityNotFound(_0x1c911b,_0xa0efbc){return function(_0x27925f){if(!_0x27925f){_0x1c911b[_0xc96c('0x1d')](0x194);}return _0x27925f;};}function handleError(_0x40c72b,_0x20f258){_0x20f258=_0x20f258||0x1f4;return function(_0x328ee4){logger['error'](_0x328ee4[_0xc96c('0x2e')]);if(_0x328ee4['name']){delete _0x328ee4[_0xc96c('0x2f')];}_0x40c72b[_0xc96c('0x1e')](_0x20f258)[_0xc96c('0x30')](_0x328ee4);};}exports['index']=function(_0xfdc972,_0x3240ba){var _0x446e5c={},_0x26c5b7={},_0x4da9b5={'count':0x0,'rows':[]};var _0x54a454=_[_0xc96c('0x31')](db[_0xc96c('0x32')][_0xc96c('0x33')],function(_0x5de66b){return{'name':_0x5de66b[_0xc96c('0x34')],'type':_0x5de66b[_0xc96c('0x35')][_0xc96c('0x36')]};});_0x26c5b7[_0xc96c('0x37')]=_['map'](_0x54a454,_0xc96c('0x2f'));_0x26c5b7[_0xc96c('0x38')]=_['keys'](_0xfdc972[_0xc96c('0x38')]);_0x26c5b7[_0xc96c('0x39')]=_[_0xc96c('0x3a')](_0x26c5b7[_0xc96c('0x37')],_0x26c5b7[_0xc96c('0x38')]);_0x446e5c[_0xc96c('0x3b')]=_['intersection'](_0x26c5b7[_0xc96c('0x37')],qs[_0xc96c('0x3c')](_0xfdc972[_0xc96c('0x38')][_0xc96c('0x3c')]));_0x446e5c[_0xc96c('0x3b')]=_0x446e5c[_0xc96c('0x3b')]['length']?_0x446e5c['attributes']:_0x26c5b7[_0xc96c('0x37')];if(!_0xfdc972[_0xc96c('0x38')]['hasOwnProperty']('nolimit')){_0x446e5c[_0xc96c('0x21')]=qs[_0xc96c('0x21')](_0xfdc972[_0xc96c('0x38')][_0xc96c('0x21')]);_0x446e5c[_0xc96c('0x20')]=qs[_0xc96c('0x20')](_0xfdc972[_0xc96c('0x38')][_0xc96c('0x20')]);}_0x446e5c[_0xc96c('0x3d')]=qs[_0xc96c('0x3e')](_0xfdc972[_0xc96c('0x38')]['sort']);_0x446e5c[_0xc96c('0x3f')]=qs[_0xc96c('0x39')](_[_0xc96c('0x40')](_0xfdc972[_0xc96c('0x38')],_0x26c5b7['filters']),_0x54a454);if(_0xfdc972[_0xc96c('0x38')][_0xc96c('0x41')]){_0x446e5c[_0xc96c('0x3f')]=_['merge'](_0x446e5c['where'],{'$or':_[_0xc96c('0x31')](_0x54a454,function(_0x29a772){if(_0x29a772[_0xc96c('0x35')]!=='VIRTUAL'){var _0x315914={};_0x315914[_0x29a772[_0xc96c('0x2f')]]={'$like':'%'+_0xfdc972[_0xc96c('0x38')][_0xc96c('0x41')]+'%'};return _0x315914;}})});}_0x446e5c=_[_0xc96c('0x42')]({},_0x446e5c,_0xfdc972[_0xc96c('0x43')]);var _0x21aec1={'where':_0x446e5c[_0xc96c('0x3f')]};return db[_0xc96c('0x32')]['count'](_0x21aec1)['then'](function(_0x30b3ac){_0x4da9b5[_0xc96c('0x23')]=_0x30b3ac;if(_0xfdc972[_0xc96c('0x38')][_0xc96c('0x44')]){_0x446e5c['include']=[{'all':!![]}];}return db['MailQueue'][_0xc96c('0x45')](_0x446e5c);})[_0xc96c('0x2a')](function(_0x44eb20){_0x4da9b5[_0xc96c('0x46')]=_0x44eb20;return _0x4da9b5;})[_0xc96c('0x2a')](respondWithFilteredResult(_0x3240ba,_0x446e5c))[_0xc96c('0x47')](handleError(_0x3240ba,null));};exports[_0xc96c('0x48')]=function(_0x54b8e7,_0x2207cc){var _0xa7c6eb={'raw':!![],'where':{'id':_0x54b8e7[_0xc96c('0x49')]['id']}},_0x2612d3={};_0x2612d3['model']=_['keys'](db[_0xc96c('0x32')][_0xc96c('0x33')]);_0x2612d3[_0xc96c('0x38')]=_[_0xc96c('0x4a')](_0x54b8e7[_0xc96c('0x38')]);_0x2612d3[_0xc96c('0x39')]=_[_0xc96c('0x3a')](_0x2612d3[_0xc96c('0x37')],_0x2612d3[_0xc96c('0x38')]);_0xa7c6eb[_0xc96c('0x3b')]=_[_0xc96c('0x3a')](_0x2612d3[_0xc96c('0x37')],qs[_0xc96c('0x3c')](_0x54b8e7['query'][_0xc96c('0x3c')]));_0xa7c6eb[_0xc96c('0x3b')]=_0xa7c6eb[_0xc96c('0x3b')][_0xc96c('0x4b')]?_0xa7c6eb['attributes']:_0x2612d3[_0xc96c('0x37')];if(_0x54b8e7['query'][_0xc96c('0x44')]){_0xa7c6eb[_0xc96c('0x4c')]=[{'all':!![]}];}_0xa7c6eb=_['merge']({},_0xa7c6eb,_0x54b8e7[_0xc96c('0x43')]);return db[_0xc96c('0x32')][_0xc96c('0x4d')](_0xa7c6eb)[_0xc96c('0x2a')](handleEntityNotFound(_0x2207cc,null))[_0xc96c('0x2a')](respondWithResult(_0x2207cc,null))[_0xc96c('0x47')](handleError(_0x2207cc,null));};exports['create']=function(_0x5a1989,_0x557511){return db[_0xc96c('0x32')]['create'](_0x5a1989[_0xc96c('0x4e')],{})[_0xc96c('0x2a')](function(_0x65a0a7){var _0x17c764=_0x5a1989[_0xc96c('0x4f')][_0xc96c('0x50')]({'plain':!![]});if(!_0x17c764)throw new Error(_0xc96c('0x51'));if(_0x17c764[_0xc96c('0x52')]===_0xc96c('0x4f')){var _0xd78e10=_0x65a0a7['get']({'plain':!![]});var _0x3adefb=_0xc96c('0x2c');return db[_0xc96c('0x53')][_0xc96c('0x4d')]({'where':{'name':_0x3adefb,'userProfileId':_0x17c764[_0xc96c('0x54')]},'raw':!![]})[_0xc96c('0x2a')](function(_0xad88c3){if(_0xad88c3&&_0xad88c3[_0xc96c('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0xd78e10['name'],'resourceId':_0xd78e10['id'],'type':_0xad88c3['name'],'sectionId':_0xad88c3['id']},{})[_0xc96c('0x2a')](function(){return _0x65a0a7;});}else{return _0x65a0a7;}})[_0xc96c('0x47')](function(_0x2157b9){logger[_0xc96c('0x56')](_0xc96c('0x57'),_0x2157b9);throw _0x2157b9;});}return _0x65a0a7;})[_0xc96c('0x2a')](respondWithResult(_0x557511,0xc9))[_0xc96c('0x47')](handleError(_0x557511,null));};exports['update']=function(_0x47115b,_0x48dc98){if(_0x47115b[_0xc96c('0x4e')]['id']){delete _0x47115b[_0xc96c('0x4e')]['id'];}return db[_0xc96c('0x32')][_0xc96c('0x4d')]({'where':{'id':_0x47115b[_0xc96c('0x49')]['id']}})['then'](handleEntityNotFound(_0x48dc98,null))[_0xc96c('0x2a')](saveUpdates(_0x47115b[_0xc96c('0x4e')],null))[_0xc96c('0x2a')](respondWithResult(_0x48dc98,null))[_0xc96c('0x47')](handleError(_0x48dc98,null));};exports[_0xc96c('0x2b')]=function(_0x3c9de9,_0x258f79){return db[_0xc96c('0x32')][_0xc96c('0x4d')]({'where':{'id':_0x3c9de9[_0xc96c('0x49')]['id']}})[_0xc96c('0x2a')](handleEntityNotFound(_0x258f79,null))[_0xc96c('0x2a')](removeEntity(_0x258f79,null))[_0xc96c('0x47')](handleError(_0x258f79,null));};exports[_0xc96c('0x58')]=function(_0x5a6e3e,_0xb1629c){return db[_0xc96c('0x32')][_0xc96c('0x58')]()[_0xc96c('0x2a')](respondWithResult(_0xb1629c,null))[_0xc96c('0x47')](handleError(_0xb1629c,null));};exports['getMembers']=function(_0xd034a7,_0x3f4ab5,_0x9cd1fd){var _0x12bf27={'raw':!![],'where':{}},_0x5696cc={},_0x302ff2;return db[_0xc96c('0x32')]['findOne']({'where':{'id':_0xd034a7['params']['id']}})['then'](handleEntityNotFound(_0x3f4ab5,null))[_0xc96c('0x2a')](function(_0x190d99){if(_0x190d99){_0x302ff2=_0x190d99[_0xc96c('0x50')]({'plain':!![]});_0x5696cc[_0xc96c('0x37')]=_[_0xc96c('0x4a')](db['UserMailQueue']['rawAttributes']);_0x5696cc[_0xc96c('0x38')]=_[_0xc96c('0x4a')](_0xd034a7[_0xc96c('0x38')]);_0x5696cc[_0xc96c('0x39')]=_[_0xc96c('0x3a')](_0x5696cc['model'],_0x5696cc[_0xc96c('0x38')]);_0x12bf27[_0xc96c('0x3b')]=_[_0xc96c('0x3a')](_0x5696cc[_0xc96c('0x37')],qs['fields'](_0xd034a7['query'][_0xc96c('0x3c')]));_0x12bf27[_0xc96c('0x3b')]=_0x12bf27['attributes'][_0xc96c('0x4b')]?_0x12bf27['attributes']:_0x5696cc[_0xc96c('0x37')];if(!_0xd034a7[_0xc96c('0x38')][_0xc96c('0x59')](_0xc96c('0x5a'))){_0x12bf27[_0xc96c('0x21')]=qs[_0xc96c('0x21')](_0xd034a7[_0xc96c('0x38')][_0xc96c('0x21')]);_0x12bf27[_0xc96c('0x20')]=qs[_0xc96c('0x20')](_0xd034a7['query'][_0xc96c('0x20')]);}_0x12bf27['order']=qs[_0xc96c('0x3e')](_0xd034a7[_0xc96c('0x38')]['sort']);_0x12bf27[_0xc96c('0x3f')]=qs['filters'](_[_0xc96c('0x40')](_0xd034a7[_0xc96c('0x38')],_0x5696cc[_0xc96c('0x39')]));_0x12bf27[_0xc96c('0x3f')][_0xc96c('0x5b')]=_0x190d99['id'];if(_0xd034a7[_0xc96c('0x38')][_0xc96c('0x41')]){_0x12bf27[_0xc96c('0x3f')]=_[_0xc96c('0x42')](_0x12bf27['where'],{'$or':_[_0xc96c('0x31')](_0x12bf27[_0xc96c('0x3b')],function(_0x1b8b5e){var _0x43f94e={};_0x43f94e[_0x1b8b5e]={'$like':'%'+_0xd034a7['query'][_0xc96c('0x41')]+'%'};return _0x43f94e;})});}_0x12bf27=_[_0xc96c('0x42')]({},_0x12bf27,_0xd034a7['options']);return db['UserMailQueue'][_0xc96c('0x45')](_0x12bf27);}})['then'](function(_0xb870d6){if(_0xb870d6){return db[_0xc96c('0x5c')][_0xc96c('0x5d')]({'where':{'id':_[_0xc96c('0x31')](_0xb870d6,_0xc96c('0x5e')),'role':_0xc96c('0x5f')},'attributes':['id',_0xc96c('0x2f'),_0xc96c('0x60'),_0xc96c('0x61'),'createdAt']});}})[_0xc96c('0x2a')](function(_0x18cf04){if(_0x18cf04){return{'count':_0x18cf04[_0xc96c('0x23')],'rows':_['map'](_0x18cf04['rows'],function(_0x1f32b3){return{'membername':_0x1f32b3[_0xc96c('0x2f')],'UserId':_0x1f32b3['id'],'queue_name':_0x302ff2[_0xc96c('0x2f')],'MailQueueId':_0x302ff2['id'],'interface':util[_0xc96c('0x62')](_0xc96c('0x63'),_0xc96c('0x64'),_0x1f32b3[_0xc96c('0x2f')]),'penalty':0x0,'paused':_0x1f32b3['mailPause'],'createdAt':_0x1f32b3[_0xc96c('0x65')],'updatedAt':_0x1f32b3[_0xc96c('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3f4ab5,_0x12bf27))[_0xc96c('0x47')](handleError(_0x3f4ab5,null));};exports['getTeams']=function(_0x195f04,_0x213a35,_0x4557ae){var _0x1f79e6={};var _0x24c724={};var _0x42bebd;var _0x409492;return db[_0xc96c('0x32')][_0xc96c('0x66')]({'where':{'id':_0x195f04['params']['id']}})[_0xc96c('0x2a')](handleEntityNotFound(_0x213a35,null))[_0xc96c('0x2a')](function(_0x50b547){if(_0x50b547){_0x42bebd=_0x50b547;_0x24c724[_0xc96c('0x37')]=_['keys'](db[_0xc96c('0x67')][_0xc96c('0x33')]);_0x24c724[_0xc96c('0x38')]=_['keys'](_0x195f04[_0xc96c('0x38')]);_0x24c724[_0xc96c('0x39')]=_['intersection'](_0x24c724[_0xc96c('0x37')],_0x24c724[_0xc96c('0x38')]);_0x1f79e6[_0xc96c('0x3b')]=_['intersection'](_0x24c724[_0xc96c('0x37')],qs[_0xc96c('0x3c')](_0x195f04[_0xc96c('0x38')][_0xc96c('0x3c')]));_0x1f79e6[_0xc96c('0x3b')]=_0x1f79e6[_0xc96c('0x3b')][_0xc96c('0x4b')]?_0x1f79e6[_0xc96c('0x3b')]:_0x24c724[_0xc96c('0x37')];_0x1f79e6[_0xc96c('0x3d')]=qs[_0xc96c('0x3e')](_0x195f04[_0xc96c('0x38')][_0xc96c('0x3e')]);_0x1f79e6[_0xc96c('0x3f')]=qs[_0xc96c('0x39')](_['pick'](_0x195f04[_0xc96c('0x38')],_0x24c724[_0xc96c('0x39')]));if(_0x195f04[_0xc96c('0x38')][_0xc96c('0x41')]){_0x1f79e6[_0xc96c('0x3f')]=_['merge'](_0x1f79e6[_0xc96c('0x3f')],{'$or':_[_0xc96c('0x31')](_0x1f79e6[_0xc96c('0x3b')],function(_0x239846){var _0x96c678={};_0x96c678[_0x239846]={'$like':'%'+_0x195f04['query']['filter']+'%'};return _0x96c678;})});}_0x1f79e6=_[_0xc96c('0x42')]({},_0x1f79e6,_0x195f04[_0xc96c('0x43')]);return _0x42bebd['getTeams'](_0x1f79e6);}})[_0xc96c('0x2a')](function(_0x256cb6){if(_0x256cb6){_0x409492=_0x256cb6['length'];if(!_0x195f04[_0xc96c('0x38')][_0xc96c('0x59')]('nolimit')){_0x1f79e6[_0xc96c('0x21')]=qs[_0xc96c('0x21')](_0x195f04[_0xc96c('0x38')][_0xc96c('0x21')]);_0x1f79e6['offset']=qs[_0xc96c('0x20')](_0x195f04[_0xc96c('0x38')]['offset']);}return _0x42bebd['getTeams'](_0x1f79e6);}})[_0xc96c('0x2a')](function(_0x490a9a){if(_0x490a9a){return _0x490a9a?{'count':_0x409492,'rows':_0x490a9a}:null;}})[_0xc96c('0x2a')](respondWithResult(_0x213a35,null))[_0xc96c('0x47')](handleError(_0x213a35,null));};exports['addTeams']=function(_0x5d4c37,_0xbdb2a4,_0x30524d){var _0x5cf014=_0x5d4c37[_0xc96c('0x4e')][_0xc96c('0x68')];return db[_0xc96c('0x67')][_0xc96c('0x45')]({'where':{'id':_0x5cf014},'attributes':['id'],'include':[{'model':db[_0xc96c('0x5c')],'as':_0xc96c('0x69'),'attributes':['id',_0xc96c('0x2f'),_0xc96c('0x6a'),_0xc96c('0x6b'),_0xc96c('0x6c')],'raw':!![]}]})[_0xc96c('0x2a')](function(_0xcbe587){if(_0xcbe587){var _0x211a60=_[_0xc96c('0x6d')](_0xcbe587,function(_0x36a176){var _0x135676=_0x36a176['get']({'plain':!![]});return _0x135676[_0xc96c('0x69')];});return db[_0xc96c('0x32')][_0xc96c('0x4d')]({'where':{'id':_0x5d4c37[_0xc96c('0x49')]['id']}})['then'](function(_0xda88ef){return db[_0xc96c('0x6e')][_0xc96c('0x6f')](function(_0x210a8c){return _0xda88ef[_0xc96c('0x70')](_0x5cf014,{'transaction':_0x210a8c})[_0xc96c('0x2a')](function(){return BPromise['each'](_0x211a60,function(_0x431872){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x431872['id'],'MailQueueId':_0x5d4c37['params']['id']},'transaction':_0x210a8c});});})['then'](function(){_0x211a60['forEach'](function(_0x22b92a){socket[_0xc96c('0x71')]('userMailQueue:save',{'UserId':_0x22b92a['id'],'MailQueueId':_0xda88ef['id']});});});});});}})['then'](respondWithStatusCode(_0xbdb2a4,null))[_0xc96c('0x47')](handleError(_0xbdb2a4,null));};exports[_0xc96c('0x72')]=function(_0x14f80f,_0x1907a2,_0x3893e2){return db[_0xc96c('0x67')][_0xc96c('0x45')]({'where':{'id':_0x14f80f[_0xc96c('0x38')][_0xc96c('0x68')]},'attributes':['id'],'include':[{'model':db[_0xc96c('0x5c')],'as':_0xc96c('0x69'),'attributes':['id'],'raw':!![]}]})[_0xc96c('0x2a')](handleEntityNotFound(_0x1907a2,null))[_0xc96c('0x2a')](function(_0x2159af){var _0x3bb791=_[_0xc96c('0x31')](_0x2159af,'id');var _0x5927bb=[];var _0x274e54=[];var _0x35c32e=squel['select']();_0x35c32e[_0xc96c('0x73')](_0xc96c('0x74'))[_0xc96c('0x75')](_0xc96c('0x76'),'tq')[_0xc96c('0x77')](_0xc96c('0x78'),'ut',_0xc96c('0x79'))[_0xc96c('0x3f')](_0xc96c('0x7a'),_0x14f80f[_0xc96c('0x49')]['id']);for(var _0x6cecd7=0x0;_0x6cecd7<_0x2159af[_0xc96c('0x4b')];_0x6cecd7+=0x1){let _0x6b9120=_0x2159af[_0x6cecd7];for(var _0x8b26da=0x0;_0x8b26da<_0x6b9120[_0xc96c('0x69')][_0xc96c('0x4b')];_0x8b26da+=0x1){let _0x292f51=_0x6b9120['Agents'][_0x8b26da];var _0x2b4b4d=_0x35c32e[_0xc96c('0x7b')]();_0x2b4b4d['where'](_0xc96c('0x7c'),_0x292f51['id']);_0x274e54[_0xc96c('0x7d')](db[_0xc96c('0x6e')][_0xc96c('0x38')](_0x2b4b4d[_0xc96c('0x7e')](),{'type':db['sequelize'][_0xc96c('0x7f')][_0xc96c('0x80')]})[_0xc96c('0x2a')](function(_0x301fb1){if(_0x301fb1[_0xc96c('0x4b')]===0x1){return _0x292f51['id'];}else{var _0x23cbf8=_[_0xc96c('0x81')](_['map'](_0x301fb1,_0xc96c('0x82')),function(_0x53be56){return _[_0xc96c('0x83')](_0x3bb791,_0x53be56);});if(_0x23cbf8){return _0x292f51['id'];}}}));}}return BPromise[_0xc96c('0x84')](_0x274e54)[_0xc96c('0x2a')](function(_0x50cfc4){_0x5927bb=_(_0x5927bb)['union'](_0x50cfc4)['compact']()[_0xc96c('0x85')]();return db[_0xc96c('0x32')][_0xc96c('0x4d')]({'where':{'id':_0x14f80f['params']['id']}})[_0xc96c('0x2a')](function(_0x8d50d1){return db[_0xc96c('0x6e')][_0xc96c('0x6f')](function(_0x474021){return _0x8d50d1[_0xc96c('0x72')](_0x14f80f[_0xc96c('0x38')][_0xc96c('0x68')],{'transaction':_0x474021})[_0xc96c('0x2a')](function(){if(!_[_0xc96c('0x86')](_0x5927bb)){return _0x8d50d1[_0xc96c('0x87')](_0x5927bb,{'transaction':_0x474021});}})[_0xc96c('0x2a')](function(){_0x5927bb['forEach'](function(_0x17c693){socket[_0xc96c('0x71')](_0xc96c('0x88'),{'UserId':_0x17c693,'MailQueueId':_0x8d50d1['id']});});});});});});})[_0xc96c('0x2a')](respondWithStatusCode(_0x1907a2,null))[_0xc96c('0x47')](handleError(_0x1907a2,null));};exports[_0xc96c('0x89')]=function(_0x4aff02,_0x47dca5,_0x43718f){return db[_0xc96c('0x32')]['find']({'where':{'id':_0x4aff02[_0xc96c('0x49')]['id']}})[_0xc96c('0x2a')](handleEntityNotFound(_0x47dca5,null))['then'](function(_0x408855){if(_0x408855){return _0x408855[_0xc96c('0x89')](_0x4aff02[_0xc96c('0x4e')][_0xc96c('0x68')],_['omit'](_0x4aff02[_0xc96c('0x4e')],[_0xc96c('0x68'),'id'])||{})[_0xc96c('0x8a')](function(_0x496b01){for(var _0x42d105=0x0;_0x42d105<_0x4aff02[_0xc96c('0x4e')][_0xc96c('0x68')][_0xc96c('0x4b')];_0x42d105+=0x1){socket[_0xc96c('0x71')](_0xc96c('0x8b'),{'UserId':Number(_0x4aff02['body'][_0xc96c('0x68')][_0x42d105]),'MailQueueId':Number(_0x4aff02[_0xc96c('0x49')]['id'])});}return _0x496b01;});}})['then'](respondWithResult(_0x47dca5,null))[_0xc96c('0x47')](handleError(_0x47dca5,null));};exports[_0xc96c('0x87')]=function(_0x261594,_0x2d80e6,_0x937887){return db[_0xc96c('0x32')][_0xc96c('0x4d')]({'where':{'id':_0x261594[_0xc96c('0x49')]['id']}})[_0xc96c('0x2a')](handleEntityNotFound(_0x2d80e6,null))['then'](function(_0x29f1d2){if(_0x29f1d2){return _0x29f1d2[_0xc96c('0x87')](_0x261594[_0xc96c('0x38')][_0xc96c('0x68')])['then'](function(){if(_[_0xc96c('0x8c')](_0x261594['query']['ids'])){for(var _0x1478b7=0x0;_0x1478b7<_0x261594[_0xc96c('0x38')][_0xc96c('0x68')]['length'];_0x1478b7+=0x1){socket[_0xc96c('0x71')](_0xc96c('0x88'),{'UserId':Number(_0x261594[_0xc96c('0x38')][_0xc96c('0x68')][_0x1478b7]),'MailQueueId':Number(_0x261594[_0xc96c('0x49')]['id'])});}}else{socket[_0xc96c('0x71')]('userMailQueue:remove',{'UserId':Number(_0x261594['query']['ids']),'MailQueueId':Number(_0x261594['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2d80e6,null))[_0xc96c('0x47')](handleError(_0x2d80e6,null));};exports[_0xc96c('0x8d')]=function(_0x31e1bd,_0x5d98d4,_0x3a8da0){var _0x2700e9={};var _0x47b11d={};var _0x2b1f19;var _0xb0074c;return db[_0xc96c('0x32')]['findOne']({'where':{'id':_0x31e1bd[_0xc96c('0x49')]['id']}})['then'](handleEntityNotFound(_0x5d98d4,null))['then'](function(_0x2dc533){if(_0x2dc533){_0x2b1f19=_0x2dc533;_0x47b11d[_0xc96c('0x37')]=_[_0xc96c('0x4a')](db[_0xc96c('0x5c')][_0xc96c('0x33')]);_0x47b11d[_0xc96c('0x38')]=_[_0xc96c('0x4a')](_0x31e1bd[_0xc96c('0x38')]);_0x47b11d[_0xc96c('0x39')]=_[_0xc96c('0x3a')](_0x47b11d[_0xc96c('0x37')],_0x47b11d[_0xc96c('0x38')]);_0x2700e9[_0xc96c('0x3b')]=_[_0xc96c('0x3a')](_0x47b11d['model'],qs[_0xc96c('0x3c')](_0x31e1bd[_0xc96c('0x38')][_0xc96c('0x3c')]));_0x2700e9[_0xc96c('0x3b')]=_0x2700e9[_0xc96c('0x3b')][_0xc96c('0x4b')]?_0x2700e9[_0xc96c('0x3b')]:_0x47b11d[_0xc96c('0x37')];_0x2700e9['order']=qs[_0xc96c('0x3e')](_0x31e1bd['query'][_0xc96c('0x3e')]);_0x2700e9[_0xc96c('0x3f')]=qs[_0xc96c('0x39')](_[_0xc96c('0x40')](_0x31e1bd['query'],_0x47b11d[_0xc96c('0x39')]));if(_0x31e1bd[_0xc96c('0x38')][_0xc96c('0x41')]){_0x2700e9[_0xc96c('0x3f')]=_['merge'](_0x2700e9[_0xc96c('0x3f')],{'$or':_[_0xc96c('0x31')](_0x2700e9['attributes'],function(_0x30dcff){var _0x20b596={};_0x20b596[_0x30dcff]={'$like':'%'+_0x31e1bd[_0xc96c('0x38')][_0xc96c('0x41')]+'%'};return _0x20b596;})});}_0x2700e9=_[_0xc96c('0x42')]({},_0x2700e9,_0x31e1bd[_0xc96c('0x43')]);return _0x2b1f19['getAgents'](_0x2700e9);}})['then'](function(_0x26c523){if(_0x26c523){_0xb0074c=_0x26c523[_0xc96c('0x4b')];if(!_0x31e1bd[_0xc96c('0x38')]['hasOwnProperty'](_0xc96c('0x5a'))){_0x2700e9[_0xc96c('0x21')]=qs[_0xc96c('0x21')](_0x31e1bd['query'][_0xc96c('0x21')]);_0x2700e9[_0xc96c('0x20')]=qs[_0xc96c('0x20')](_0x31e1bd[_0xc96c('0x38')][_0xc96c('0x20')]);}return _0x2b1f19[_0xc96c('0x8d')](_0x2700e9);}})['then'](function(_0x437dbf){if(_0x437dbf){return _0x437dbf?{'count':_0xb0074c,'rows':_0x437dbf}:null;}})[_0xc96c('0x2a')](respondWithResult(_0x5d98d4,null))[_0xc96c('0x47')](handleError(_0x5d98d4,null));}; \ No newline at end of file +var _0x6594=['VIRTUAL','merge','options','include','findAll','rows','show','params','keys','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','pick','MailQueueId','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','Team','getTeams','addTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','field','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','compact','isEmpty','removeAgents','addAgents','spread','isArray','userMailQueue:remove','getAgents','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','save','update','then','destroy','get','MailQueues','UserProfileResource','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x5f1c59,_0x3fff4c){var _0xbfb242=function(_0x2a64e2){while(--_0x2a64e2){_0x5f1c59['push'](_0x5f1c59['shift']());}};_0xbfb242(++_0x3fff4c);}(_0x6594,0xcb));var _0x4659=function(_0x38a6c6,_0x4062ca){_0x38a6c6=_0x38a6c6-0x0;var _0x142f0a=_0x6594[_0x38a6c6];return _0x142f0a;};'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(_0x4659('0x0'));var moment=require(_0x4659('0x1'));var BPromise=require(_0x4659('0x2'));var Mustache=require(_0x4659('0x3'));var util=require(_0x4659('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4659('0x5'));var ejs=require(_0x4659('0x6'));var fs=require('fs');var fs_extra=require(_0x4659('0x7'));var _=require(_0x4659('0x8'));var squel=require('squel');var crypto=require(_0x4659('0x9'));var jsforce=require(_0x4659('0xa'));var deskjs=require(_0x4659('0xb'));var toCsv=require(_0x4659('0x5'));var querystring=require(_0x4659('0xc'));var Papa=require(_0x4659('0xd'));var Redis=require('ioredis');var authService=require(_0x4659('0xe'));var qs=require(_0x4659('0xf'));var as=require(_0x4659('0x10'));var hardwareService=require(_0x4659('0x11'));var logger=require(_0x4659('0x12'))(_0x4659('0x13'));var utils=require(_0x4659('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4659('0x15'))['db'];config[_0x4659('0x16')]=_[_0x4659('0x17')](config[_0x4659('0x16')],{'host':_0x4659('0x18'),'port':0x18eb});var socket=require(_0x4659('0x19'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x4659('0x1a')](socket);function respondWithStatusCode(_0x4c3c05,_0x39d8ba){_0x39d8ba=_0x39d8ba||0xcc;return function(_0x22b87f){if(_0x22b87f){return _0x4c3c05[_0x4659('0x1b')](_0x39d8ba);}return _0x4c3c05['status'](_0x39d8ba)[_0x4659('0x1c')]();};}function respondWithResult(_0x429b72,_0x1d78a5){_0x1d78a5=_0x1d78a5||0xc8;return function(_0x29a208){if(_0x29a208){return _0x429b72['status'](_0x1d78a5)[_0x4659('0x1d')](_0x29a208);}};}function respondWithFilteredResult(_0xb9e922,_0x73f3f5){return function(_0x2fdd7a){if(_0x2fdd7a){var _0x4c8820=typeof _0x73f3f5[_0x4659('0x1e')]===_0x4659('0x1f')&&typeof _0x73f3f5['limit']===_0x4659('0x1f');var _0x3c7bd0=_0x2fdd7a[_0x4659('0x20')];var _0x3133b6=_0x4c8820?0x0:_0x73f3f5['offset'];var _0x5d2c8f=_0x4c8820?_0x2fdd7a[_0x4659('0x20')]:_0x73f3f5[_0x4659('0x1e')]+_0x73f3f5[_0x4659('0x21')];var _0xd6012e;if(_0x5d2c8f>=_0x3c7bd0){_0x5d2c8f=_0x3c7bd0;_0xd6012e=0xc8;}else{_0xd6012e=0xce;}_0xb9e922[_0x4659('0x22')](_0xd6012e);return _0xb9e922[_0x4659('0x23')](_0x4659('0x24'),_0x3133b6+'-'+_0x5d2c8f+'/'+_0x3c7bd0)[_0x4659('0x1d')](_0x2fdd7a);}return null;};}function patchUpdates(_0x1a016e){return function(_0x494631){try{jsonpatch['apply'](_0x494631,_0x1a016e,!![]);}catch(_0x31273d){return BPromise['reject'](_0x31273d);}return _0x494631[_0x4659('0x25')]();};}function saveUpdates(_0x47c73d,_0x1715ba){return function(_0x2e5f78){if(_0x2e5f78){return _0x2e5f78[_0x4659('0x26')](_0x47c73d)[_0x4659('0x27')](function(_0x20fc37){return _0x20fc37;});}return null;};}function removeEntity(_0x1fe661,_0x2b4ad8){return function(_0x1d1cba){if(_0x1d1cba){return _0x1d1cba[_0x4659('0x28')]()['then'](function(){var _0x428dd5=_0x1d1cba[_0x4659('0x29')]({'plain':!![]});var _0x2f6b1d=_0x4659('0x2a');return db[_0x4659('0x2b')][_0x4659('0x28')]({'where':{'type':_0x2f6b1d,'resourceId':_0x428dd5['id']}})[_0x4659('0x27')](function(){return _0x1d1cba;});})[_0x4659('0x27')](function(){_0x1fe661[_0x4659('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0c89,_0xde3c49){return function(_0x26d67f){if(!_0x26d67f){_0x5d0c89['sendStatus'](0x194);}return _0x26d67f;};}function handleError(_0x507fc1,_0x40d87b){_0x40d87b=_0x40d87b||0x1f4;return function(_0x47b219){logger['error'](_0x47b219[_0x4659('0x2c')]);if(_0x47b219[_0x4659('0x2d')]){delete _0x47b219['name'];}_0x507fc1[_0x4659('0x22')](_0x40d87b)[_0x4659('0x2e')](_0x47b219);};}exports[_0x4659('0x2f')]=function(_0xecf7dc,_0x1719a0){var _0x12ded6={},_0x1ab79e={},_0x5e705e={'count':0x0,'rows':[]};var _0x26897e=_[_0x4659('0x30')](db[_0x4659('0x31')][_0x4659('0x32')],function(_0x52bd53){return{'name':_0x52bd53[_0x4659('0x33')],'type':_0x52bd53[_0x4659('0x34')][_0x4659('0x35')]};});_0x1ab79e[_0x4659('0x36')]=_[_0x4659('0x30')](_0x26897e,_0x4659('0x2d'));_0x1ab79e['query']=_['keys'](_0xecf7dc['query']);_0x1ab79e[_0x4659('0x37')]=_[_0x4659('0x38')](_0x1ab79e['model'],_0x1ab79e[_0x4659('0x39')]);_0x12ded6[_0x4659('0x3a')]=_['intersection'](_0x1ab79e[_0x4659('0x36')],qs[_0x4659('0x3b')](_0xecf7dc['query']['fields']));_0x12ded6[_0x4659('0x3a')]=_0x12ded6[_0x4659('0x3a')][_0x4659('0x3c')]?_0x12ded6[_0x4659('0x3a')]:_0x1ab79e[_0x4659('0x36')];if(!_0xecf7dc[_0x4659('0x39')][_0x4659('0x3d')](_0x4659('0x3e'))){_0x12ded6[_0x4659('0x21')]=qs['limit'](_0xecf7dc[_0x4659('0x39')][_0x4659('0x21')]);_0x12ded6['offset']=qs['offset'](_0xecf7dc['query']['offset']);}_0x12ded6[_0x4659('0x3f')]=qs[_0x4659('0x40')](_0xecf7dc[_0x4659('0x39')]['sort']);_0x12ded6[_0x4659('0x41')]=qs[_0x4659('0x37')](_['pick'](_0xecf7dc[_0x4659('0x39')],_0x1ab79e['filters']),_0x26897e);if(_0xecf7dc[_0x4659('0x39')][_0x4659('0x42')]){_0x12ded6['where']=_['merge'](_0x12ded6[_0x4659('0x41')],{'$or':_[_0x4659('0x30')](_0x26897e,function(_0x2ad82b){if(_0x2ad82b['type']!==_0x4659('0x43')){var _0x3f70b9={};_0x3f70b9[_0x2ad82b['name']]={'$like':'%'+_0xecf7dc[_0x4659('0x39')][_0x4659('0x42')]+'%'};return _0x3f70b9;}})});}_0x12ded6=_[_0x4659('0x44')]({},_0x12ded6,_0xecf7dc[_0x4659('0x45')]);var _0x111b7a={'where':_0x12ded6[_0x4659('0x41')]};return db['MailQueue'][_0x4659('0x20')](_0x111b7a)[_0x4659('0x27')](function(_0xd38f94){_0x5e705e[_0x4659('0x20')]=_0xd38f94;if(_0xecf7dc['query']['includeAll']){_0x12ded6[_0x4659('0x46')]=[{'all':!![]}];}return db[_0x4659('0x31')][_0x4659('0x47')](_0x12ded6);})[_0x4659('0x27')](function(_0xf8089f){_0x5e705e[_0x4659('0x48')]=_0xf8089f;return _0x5e705e;})[_0x4659('0x27')](respondWithFilteredResult(_0x1719a0,_0x12ded6))['catch'](handleError(_0x1719a0,null));};exports[_0x4659('0x49')]=function(_0x3f5a0d,_0x13ad71){var _0x4258a6={'raw':!![],'where':{'id':_0x3f5a0d[_0x4659('0x4a')]['id']}},_0x5ce08d={};_0x5ce08d['model']=_['keys'](db['MailQueue']['rawAttributes']);_0x5ce08d['query']=_[_0x4659('0x4b')](_0x3f5a0d[_0x4659('0x39')]);_0x5ce08d[_0x4659('0x37')]=_[_0x4659('0x38')](_0x5ce08d[_0x4659('0x36')],_0x5ce08d['query']);_0x4258a6[_0x4659('0x3a')]=_[_0x4659('0x38')](_0x5ce08d[_0x4659('0x36')],qs[_0x4659('0x3b')](_0x3f5a0d['query'][_0x4659('0x3b')]));_0x4258a6[_0x4659('0x3a')]=_0x4258a6[_0x4659('0x3a')][_0x4659('0x3c')]?_0x4258a6[_0x4659('0x3a')]:_0x5ce08d['model'];if(_0x3f5a0d[_0x4659('0x39')][_0x4659('0x4c')]){_0x4258a6['include']=[{'all':!![]}];}_0x4258a6=_[_0x4659('0x44')]({},_0x4258a6,_0x3f5a0d['options']);return db[_0x4659('0x31')]['find'](_0x4258a6)[_0x4659('0x27')](handleEntityNotFound(_0x13ad71,null))['then'](respondWithResult(_0x13ad71,null))[_0x4659('0x4d')](handleError(_0x13ad71,null));};exports[_0x4659('0x4e')]=function(_0x2cd106,_0x146594){return db[_0x4659('0x31')][_0x4659('0x4e')](_0x2cd106[_0x4659('0x4f')],{})[_0x4659('0x27')](function(_0x722dea){var _0x4a39a2=_0x2cd106[_0x4659('0x50')][_0x4659('0x29')]({'plain':!![]});if(!_0x4a39a2)throw new Error(_0x4659('0x51'));if(_0x4a39a2[_0x4659('0x52')]==='user'){var _0x3b4a2d=_0x722dea['get']({'plain':!![]});var _0x1d8b61=_0x4659('0x2a');return db[_0x4659('0x53')][_0x4659('0x54')]({'where':{'name':_0x1d8b61,'userProfileId':_0x4a39a2['userProfileId']},'raw':!![]})[_0x4659('0x27')](function(_0x225f98){if(_0x225f98&&_0x225f98[_0x4659('0x55')]===0x0){return db[_0x4659('0x2b')]['create']({'name':_0x3b4a2d[_0x4659('0x2d')],'resourceId':_0x3b4a2d['id'],'type':_0x225f98[_0x4659('0x2d')],'sectionId':_0x225f98['id']},{})[_0x4659('0x27')](function(){return _0x722dea;});}else{return _0x722dea;}})[_0x4659('0x4d')](function(_0x685314){logger[_0x4659('0x56')](_0x4659('0x57'),_0x685314);throw _0x685314;});}return _0x722dea;})[_0x4659('0x27')](respondWithResult(_0x146594,0xc9))[_0x4659('0x4d')](handleError(_0x146594,null));};exports[_0x4659('0x26')]=function(_0x4473eb,_0x2b8385){if(_0x4473eb[_0x4659('0x4f')]['id']){delete _0x4473eb[_0x4659('0x4f')]['id'];}return db['MailQueue'][_0x4659('0x54')]({'where':{'id':_0x4473eb[_0x4659('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2b8385,null))[_0x4659('0x27')](saveUpdates(_0x4473eb[_0x4659('0x4f')],null))[_0x4659('0x27')](respondWithResult(_0x2b8385,null))[_0x4659('0x4d')](handleError(_0x2b8385,null));};exports[_0x4659('0x28')]=function(_0x92e10d,_0x39f48e){return db['MailQueue'][_0x4659('0x54')]({'where':{'id':_0x92e10d[_0x4659('0x4a')]['id']}})[_0x4659('0x27')](handleEntityNotFound(_0x39f48e,null))[_0x4659('0x27')](removeEntity(_0x39f48e,null))[_0x4659('0x4d')](handleError(_0x39f48e,null));};exports[_0x4659('0x58')]=function(_0x1111f3,_0x55e3b3){return db[_0x4659('0x31')][_0x4659('0x58')]()['then'](respondWithResult(_0x55e3b3,null))[_0x4659('0x4d')](handleError(_0x55e3b3,null));};exports[_0x4659('0x59')]=function(_0xfcec1a,_0x5e896b,_0x36d2cc){var _0x20f7ec={'raw':!![],'where':{}},_0x4afd2a={},_0x2c9636;return db['MailQueue'][_0x4659('0x5a')]({'where':{'id':_0xfcec1a[_0x4659('0x4a')]['id']}})[_0x4659('0x27')](handleEntityNotFound(_0x5e896b,null))['then'](function(_0x58bd99){if(_0x58bd99){_0x2c9636=_0x58bd99[_0x4659('0x29')]({'plain':!![]});_0x4afd2a['model']=_[_0x4659('0x4b')](db[_0x4659('0x5b')][_0x4659('0x32')]);_0x4afd2a['query']=_['keys'](_0xfcec1a[_0x4659('0x39')]);_0x4afd2a[_0x4659('0x37')]=_[_0x4659('0x38')](_0x4afd2a['model'],_0x4afd2a['query']);_0x20f7ec[_0x4659('0x3a')]=_[_0x4659('0x38')](_0x4afd2a[_0x4659('0x36')],qs[_0x4659('0x3b')](_0xfcec1a[_0x4659('0x39')][_0x4659('0x3b')]));_0x20f7ec[_0x4659('0x3a')]=_0x20f7ec['attributes'][_0x4659('0x3c')]?_0x20f7ec['attributes']:_0x4afd2a[_0x4659('0x36')];if(!_0xfcec1a['query'][_0x4659('0x3d')](_0x4659('0x3e'))){_0x20f7ec[_0x4659('0x21')]=qs['limit'](_0xfcec1a['query'][_0x4659('0x21')]);_0x20f7ec[_0x4659('0x1e')]=qs[_0x4659('0x1e')](_0xfcec1a[_0x4659('0x39')][_0x4659('0x1e')]);}_0x20f7ec[_0x4659('0x3f')]=qs[_0x4659('0x40')](_0xfcec1a[_0x4659('0x39')][_0x4659('0x40')]);_0x20f7ec[_0x4659('0x41')]=qs[_0x4659('0x37')](_[_0x4659('0x5c')](_0xfcec1a['query'],_0x4afd2a[_0x4659('0x37')]));_0x20f7ec['where'][_0x4659('0x5d')]=_0x58bd99['id'];if(_0xfcec1a[_0x4659('0x39')]['filter']){_0x20f7ec[_0x4659('0x41')]=_[_0x4659('0x44')](_0x20f7ec[_0x4659('0x41')],{'$or':_['map'](_0x20f7ec[_0x4659('0x3a')],function(_0x376e6b){var _0x32a665={};_0x32a665[_0x376e6b]={'$like':'%'+_0xfcec1a['query'][_0x4659('0x42')]+'%'};return _0x32a665;})});}_0x20f7ec=_['merge']({},_0x20f7ec,_0xfcec1a[_0x4659('0x45')]);return db[_0x4659('0x5b')]['findAll'](_0x20f7ec);}})[_0x4659('0x27')](function(_0x460d58){if(_0x460d58){return db[_0x4659('0x5e')][_0x4659('0x5f')]({'where':{'id':_[_0x4659('0x30')](_0x460d58,'UserId'),'role':_0x4659('0x60')},'attributes':['id',_0x4659('0x2d'),_0x4659('0x61'),_0x4659('0x62'),_0x4659('0x63')]});}})[_0x4659('0x27')](function(_0x551ed8){if(_0x551ed8){return{'count':_0x551ed8['count'],'rows':_['map'](_0x551ed8['rows'],function(_0x3a322f){return{'membername':_0x3a322f[_0x4659('0x2d')],'UserId':_0x3a322f['id'],'queue_name':_0x2c9636[_0x4659('0x2d')],'MailQueueId':_0x2c9636['id'],'interface':util['format']('%s/%s','SIP',_0x3a322f[_0x4659('0x2d')]),'penalty':0x0,'paused':_0x3a322f[_0x4659('0x61')],'createdAt':_0x3a322f[_0x4659('0x63')],'updatedAt':_0x3a322f[_0x4659('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4659('0x27')](respondWithFilteredResult(_0x5e896b,_0x20f7ec))['catch'](handleError(_0x5e896b,null));};exports['getTeams']=function(_0x5875f6,_0x5f401f,_0x59c4a6){var _0x59b9d1={};var _0xd39c7c={};var _0x19a5cf;var _0x115740;return db[_0x4659('0x31')][_0x4659('0x5a')]({'where':{'id':_0x5875f6[_0x4659('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5f401f,null))[_0x4659('0x27')](function(_0x393cdc){if(_0x393cdc){_0x19a5cf=_0x393cdc;_0xd39c7c['model']=_[_0x4659('0x4b')](db[_0x4659('0x64')]['rawAttributes']);_0xd39c7c[_0x4659('0x39')]=_['keys'](_0x5875f6[_0x4659('0x39')]);_0xd39c7c['filters']=_[_0x4659('0x38')](_0xd39c7c[_0x4659('0x36')],_0xd39c7c[_0x4659('0x39')]);_0x59b9d1[_0x4659('0x3a')]=_['intersection'](_0xd39c7c['model'],qs[_0x4659('0x3b')](_0x5875f6[_0x4659('0x39')][_0x4659('0x3b')]));_0x59b9d1[_0x4659('0x3a')]=_0x59b9d1[_0x4659('0x3a')][_0x4659('0x3c')]?_0x59b9d1[_0x4659('0x3a')]:_0xd39c7c[_0x4659('0x36')];_0x59b9d1[_0x4659('0x3f')]=qs['sort'](_0x5875f6[_0x4659('0x39')][_0x4659('0x40')]);_0x59b9d1['where']=qs[_0x4659('0x37')](_[_0x4659('0x5c')](_0x5875f6[_0x4659('0x39')],_0xd39c7c['filters']));if(_0x5875f6[_0x4659('0x39')]['filter']){_0x59b9d1[_0x4659('0x41')]=_[_0x4659('0x44')](_0x59b9d1[_0x4659('0x41')],{'$or':_['map'](_0x59b9d1[_0x4659('0x3a')],function(_0x307aa9){var _0x1c83bf={};_0x1c83bf[_0x307aa9]={'$like':'%'+_0x5875f6[_0x4659('0x39')][_0x4659('0x42')]+'%'};return _0x1c83bf;})});}_0x59b9d1=_[_0x4659('0x44')]({},_0x59b9d1,_0x5875f6[_0x4659('0x45')]);return _0x19a5cf[_0x4659('0x65')](_0x59b9d1);}})['then'](function(_0x1b9662){if(_0x1b9662){_0x115740=_0x1b9662[_0x4659('0x3c')];if(!_0x5875f6[_0x4659('0x39')][_0x4659('0x3d')](_0x4659('0x3e'))){_0x59b9d1[_0x4659('0x21')]=qs['limit'](_0x5875f6[_0x4659('0x39')][_0x4659('0x21')]);_0x59b9d1['offset']=qs[_0x4659('0x1e')](_0x5875f6['query'][_0x4659('0x1e')]);}return _0x19a5cf['getTeams'](_0x59b9d1);}})[_0x4659('0x27')](function(_0x1656cc){if(_0x1656cc){return _0x1656cc?{'count':_0x115740,'rows':_0x1656cc}:null;}})[_0x4659('0x27')](respondWithResult(_0x5f401f,null))[_0x4659('0x4d')](handleError(_0x5f401f,null));};exports[_0x4659('0x66')]=function(_0x3776e1,_0x193e96,_0x273c52){var _0x14ee45=_0x3776e1[_0x4659('0x4f')][_0x4659('0x67')];return db['Team'][_0x4659('0x47')]({'where':{'id':_0x14ee45},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4659('0x68'),'attributes':['id',_0x4659('0x2d'),'online',_0x4659('0x69'),'interface'],'raw':!![]}]})[_0x4659('0x27')](function(_0x10468b){if(_0x10468b){var _0xf27d03=_[_0x4659('0x6a')](_0x10468b,function(_0x560ec5){var _0x2997b7=_0x560ec5[_0x4659('0x29')]({'plain':!![]});return _0x2997b7[_0x4659('0x68')];});return db[_0x4659('0x31')][_0x4659('0x54')]({'where':{'id':_0x3776e1[_0x4659('0x4a')]['id']}})[_0x4659('0x27')](function(_0x46c430){return db[_0x4659('0x6b')][_0x4659('0x6c')](function(_0x2c2577){return _0x46c430[_0x4659('0x66')](_0x14ee45,{'transaction':_0x2c2577})[_0x4659('0x27')](function(){return BPromise[_0x4659('0x6d')](_0xf27d03,function(_0x4f40f1){return db[_0x4659('0x5b')][_0x4659('0x6e')]({'where':{'UserId':_0x4f40f1['id'],'MailQueueId':_0x3776e1['params']['id']},'transaction':_0x2c2577});});})['then'](function(){_0xf27d03[_0x4659('0x6f')](function(_0x3e8446){socket[_0x4659('0x70')]('userMailQueue:save',{'UserId':_0x3e8446['id'],'MailQueueId':_0x46c430['id']});});});});});}})[_0x4659('0x27')](respondWithStatusCode(_0x193e96,null))[_0x4659('0x4d')](handleError(_0x193e96,null));};exports[_0x4659('0x71')]=function(_0x35509b,_0x19ed59,_0x43633b){return db[_0x4659('0x64')]['findAll']({'where':{'id':_0x35509b[_0x4659('0x39')][_0x4659('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4659('0x27')](handleEntityNotFound(_0x19ed59,null))['then'](function(_0x58ea22){var _0x15a799=_[_0x4659('0x30')](_0x58ea22,'id');var _0x4b302b=[];var _0x399f72=[];var _0x34527c=squel['select']();_0x34527c[_0x4659('0x72')]('tq.TeamId')[_0x4659('0x73')](_0x4659('0x74'),'tq')['join'](_0x4659('0x75'),'ut',_0x4659('0x76'))[_0x4659('0x41')](_0x4659('0x77'),_0x35509b[_0x4659('0x4a')]['id']);for(var _0x235758=0x0;_0x235758<_0x58ea22[_0x4659('0x3c')];_0x235758+=0x1){let _0x2a069d=_0x58ea22[_0x235758];for(var _0x220e5d=0x0;_0x220e5d<_0x2a069d[_0x4659('0x68')][_0x4659('0x3c')];_0x220e5d+=0x1){let _0x1fa258=_0x2a069d[_0x4659('0x68')][_0x220e5d];var _0x9cc53b=_0x34527c['clone']();_0x9cc53b[_0x4659('0x41')](_0x4659('0x78'),_0x1fa258['id']);_0x399f72['push'](db[_0x4659('0x6b')][_0x4659('0x39')](_0x9cc53b[_0x4659('0x79')](),{'type':db[_0x4659('0x6b')][_0x4659('0x7a')][_0x4659('0x7b')]})[_0x4659('0x27')](function(_0x579211){if(_0x579211[_0x4659('0x3c')]===0x1){return _0x1fa258['id'];}else{var _0xe2be8c=_[_0x4659('0x7c')](_[_0x4659('0x30')](_0x579211,_0x4659('0x7d')),function(_0x26f67c){return _['includes'](_0x15a799,_0x26f67c);});if(_0xe2be8c){return _0x1fa258['id'];}}}));}}return BPromise[_0x4659('0x7e')](_0x399f72)[_0x4659('0x27')](function(_0x39782c){_0x4b302b=_(_0x4b302b)['union'](_0x39782c)[_0x4659('0x7f')]()['value']();return db['MailQueue'][_0x4659('0x54')]({'where':{'id':_0x35509b[_0x4659('0x4a')]['id']}})[_0x4659('0x27')](function(_0x36e1f9){return db[_0x4659('0x6b')][_0x4659('0x6c')](function(_0x2d6ae2){return _0x36e1f9[_0x4659('0x71')](_0x35509b['query']['ids'],{'transaction':_0x2d6ae2})[_0x4659('0x27')](function(){if(!_[_0x4659('0x80')](_0x4b302b)){return _0x36e1f9[_0x4659('0x81')](_0x4b302b,{'transaction':_0x2d6ae2});}})[_0x4659('0x27')](function(){_0x4b302b[_0x4659('0x6f')](function(_0x2d7617){socket[_0x4659('0x70')]('userMailQueue:remove',{'UserId':_0x2d7617,'MailQueueId':_0x36e1f9['id']});});});});});});})[_0x4659('0x27')](respondWithStatusCode(_0x19ed59,null))[_0x4659('0x4d')](handleError(_0x19ed59,null));};exports[_0x4659('0x82')]=function(_0x156a00,_0x531940,_0x476648){return db[_0x4659('0x31')][_0x4659('0x54')]({'where':{'id':_0x156a00['params']['id']}})[_0x4659('0x27')](handleEntityNotFound(_0x531940,null))[_0x4659('0x27')](function(_0x4c5abc){if(_0x4c5abc){return _0x4c5abc[_0x4659('0x82')](_0x156a00[_0x4659('0x4f')][_0x4659('0x67')],_['omit'](_0x156a00[_0x4659('0x4f')],[_0x4659('0x67'),'id'])||{})[_0x4659('0x83')](function(_0x135153){for(var _0x4aefdd=0x0;_0x4aefdd<_0x156a00['body'][_0x4659('0x67')][_0x4659('0x3c')];_0x4aefdd+=0x1){socket[_0x4659('0x70')]('userMailQueue:save',{'UserId':Number(_0x156a00[_0x4659('0x4f')][_0x4659('0x67')][_0x4aefdd]),'MailQueueId':Number(_0x156a00[_0x4659('0x4a')]['id'])});}return _0x135153;});}})[_0x4659('0x27')](respondWithResult(_0x531940,null))[_0x4659('0x4d')](handleError(_0x531940,null));};exports[_0x4659('0x81')]=function(_0x5b3e1d,_0x1eea46,_0x5dd2a5){return db[_0x4659('0x31')][_0x4659('0x54')]({'where':{'id':_0x5b3e1d[_0x4659('0x4a')]['id']}})[_0x4659('0x27')](handleEntityNotFound(_0x1eea46,null))[_0x4659('0x27')](function(_0x1032cb){if(_0x1032cb){return _0x1032cb[_0x4659('0x81')](_0x5b3e1d[_0x4659('0x39')][_0x4659('0x67')])[_0x4659('0x27')](function(){if(_[_0x4659('0x84')](_0x5b3e1d[_0x4659('0x39')][_0x4659('0x67')])){for(var _0x3c6e60=0x0;_0x3c6e60<_0x5b3e1d[_0x4659('0x39')][_0x4659('0x67')][_0x4659('0x3c')];_0x3c6e60+=0x1){socket[_0x4659('0x70')](_0x4659('0x85'),{'UserId':Number(_0x5b3e1d[_0x4659('0x39')]['ids'][_0x3c6e60]),'MailQueueId':Number(_0x5b3e1d[_0x4659('0x4a')]['id'])});}}else{socket[_0x4659('0x70')](_0x4659('0x85'),{'UserId':Number(_0x5b3e1d['query'][_0x4659('0x67')]),'MailQueueId':Number(_0x5b3e1d[_0x4659('0x4a')]['id'])});}});}})[_0x4659('0x27')](respondWithStatusCode(_0x1eea46,null))[_0x4659('0x4d')](handleError(_0x1eea46,null));};exports[_0x4659('0x86')]=function(_0x43de57,_0x564670,_0x325cf6){var _0xf194df={};var _0x3404cc={};var _0x371341;var _0x2fd186;return db[_0x4659('0x31')][_0x4659('0x5a')]({'where':{'id':_0x43de57['params']['id']}})[_0x4659('0x27')](handleEntityNotFound(_0x564670,null))[_0x4659('0x27')](function(_0x1bfa63){if(_0x1bfa63){_0x371341=_0x1bfa63;_0x3404cc[_0x4659('0x36')]=_['keys'](db['User'][_0x4659('0x32')]);_0x3404cc[_0x4659('0x39')]=_['keys'](_0x43de57[_0x4659('0x39')]);_0x3404cc[_0x4659('0x37')]=_[_0x4659('0x38')](_0x3404cc[_0x4659('0x36')],_0x3404cc[_0x4659('0x39')]);_0xf194df[_0x4659('0x3a')]=_[_0x4659('0x38')](_0x3404cc[_0x4659('0x36')],qs[_0x4659('0x3b')](_0x43de57['query'][_0x4659('0x3b')]));_0xf194df[_0x4659('0x3a')]=_0xf194df['attributes'][_0x4659('0x3c')]?_0xf194df['attributes']:_0x3404cc['model'];_0xf194df[_0x4659('0x3f')]=qs[_0x4659('0x40')](_0x43de57[_0x4659('0x39')][_0x4659('0x40')]);_0xf194df[_0x4659('0x41')]=qs['filters'](_[_0x4659('0x5c')](_0x43de57['query'],_0x3404cc['filters']));if(_0x43de57[_0x4659('0x39')][_0x4659('0x42')]){_0xf194df['where']=_['merge'](_0xf194df[_0x4659('0x41')],{'$or':_['map'](_0xf194df['attributes'],function(_0x5f1ea6){var _0x2eef25={};_0x2eef25[_0x5f1ea6]={'$like':'%'+_0x43de57[_0x4659('0x39')]['filter']+'%'};return _0x2eef25;})});}_0xf194df=_[_0x4659('0x44')]({},_0xf194df,_0x43de57['options']);return _0x371341[_0x4659('0x86')](_0xf194df);}})[_0x4659('0x27')](function(_0x5a5c88){if(_0x5a5c88){_0x2fd186=_0x5a5c88[_0x4659('0x3c')];if(!_0x43de57[_0x4659('0x39')][_0x4659('0x3d')](_0x4659('0x3e'))){_0xf194df['limit']=qs[_0x4659('0x21')](_0x43de57['query'][_0x4659('0x21')]);_0xf194df[_0x4659('0x1e')]=qs[_0x4659('0x1e')](_0x43de57['query']['offset']);}return _0x371341[_0x4659('0x86')](_0xf194df);}})['then'](function(_0x465e2b){if(_0x465e2b){return _0x465e2b?{'count':_0x2fd186,'rows':_0x465e2b}:null;}})['then'](respondWithResult(_0x564670,null))[_0x4659('0x4d')](handleError(_0x564670,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index c55b201..7d3e433 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 _0x6991=['events','MailQueue','save','update','remove','emit','hook','exports'];(function(_0x312873,_0xeee173){var _0x149d47=function(_0x5851a7){while(--_0x5851a7){_0x312873['push'](_0x312873['shift']());}};_0x149d47(++_0xeee173);}(_0x6991,0xc0));var _0x1699=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x6991[_0x298ed3];return _0x5aad28;};'use strict';var EventEmitter=require(_0x1699('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x1699('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1699('0x2'),'afterUpdate':_0x1699('0x3'),'afterDestroy':_0x1699('0x4')};function emitEvent(_0x2a1623){return function(_0x55c0c7,_0x16b6eb,_0x1c84e0){MailQueueEvents['emit'](_0x2a1623+':'+_0x55c0c7['id'],_0x55c0c7);MailQueueEvents[_0x1699('0x5')](_0x2a1623,_0x55c0c7);_0x1c84e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x1699('0x6')](e,emitEvent(event));}}module[_0x1699('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x3fb5=['hasOwnProperty','hook','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit'];(function(_0x379ea8,_0xaaa8f0){var _0x2d5e66=function(_0x291489){while(--_0x291489){_0x379ea8['push'](_0x379ea8['shift']());}};_0x2d5e66(++_0xaaa8f0);}(_0x3fb5,0x98));var _0x53fb=function(_0x3ca8e1,_0x1fff67){_0x3ca8e1=_0x3ca8e1-0x0;var _0x23bb96=_0x3fb5[_0x3ca8e1];return _0x23bb96;};'use strict';var EventEmitter=require(_0x53fb('0x0'));var MailQueue=require(_0x53fb('0x1'))['db'][_0x53fb('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x53fb('0x3')](0x0);var events={'afterCreate':_0x53fb('0x4'),'afterUpdate':_0x53fb('0x5'),'afterDestroy':_0x53fb('0x6')};function emitEvent(_0x85c941){return function(_0x587528,_0x37e885,_0x1259aa){MailQueueEvents['emit'](_0x85c941+':'+_0x587528['id'],_0x587528);MailQueueEvents[_0x53fb('0x7')](_0x85c941,_0x587528);_0x1259aa(null);};}for(var e in events){if(events[_0x53fb('0x8')](e)){var event=events[e];MailQueue[_0x53fb('0x9')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 76f6041..9a442a1 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 _0x4471=['bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','define','MailQueue','../../config/logger','api','moment'];(function(_0x2073b3,_0x48bcb4){var _0x209032=function(_0xda946e){while(--_0xda946e){_0x2073b3['push'](_0x2073b3['shift']());}};_0x209032(++_0x48bcb4);}(_0x4471,0x179));var _0x1447=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4471[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1447('0x0'))(_0x1447('0x1'));var moment=require(_0x1447('0x2'));var BPromise=require(_0x1447('0x3'));var rp=require(_0x1447('0x4'));var fs=require('fs');var path=require(_0x1447('0x5'));var rimraf=require('rimraf');var config=require(_0x1447('0x6'));var attributes=require(_0x1447('0x7'));module['exports']=function(_0x5baf0e,_0x25ce5f){return _0x5baf0e[_0x1447('0x8')](_0x1447('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d8e=['./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x339998,_0x11b727){var _0x1074b5=function(_0x20b149){while(--_0x20b149){_0x339998['push'](_0x339998['shift']());}};_0x1074b5(++_0x11b727);}(_0x8d8e,0x1dd));var _0xe8d8=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x8d8e[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xe8d8('0x0'));var util=require(_0xe8d8('0x1'));var logger=require(_0xe8d8('0x2'))(_0xe8d8('0x3'));var moment=require('moment');var BPromise=require(_0xe8d8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8d8('0x5'));var rimraf=require('rimraf');var config=require(_0xe8d8('0x6'));var attributes=require(_0xe8d8('0x7'));module['exports']=function(_0x358b6a,_0x54ba98){return _0x358b6a[_0xe8d8('0x8')](_0xe8d8('0x9'),attributes,{'tableName':_0xe8d8('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 64f296f..b7a1e04 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 _0x3bf7=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','findAll','options','raw','attributes','include','map','model','then','GetMailQueue','ShowMailQueue','find','where','catch'];(function(_0x2b7a30,_0x3fe0fe){var _0x55c6bd=function(_0x39c543){while(--_0x39c543){_0x2b7a30['push'](_0x2b7a30['shift']());}};_0x55c6bd(++_0x3fe0fe);}(_0x3bf7,0xc3));var _0x73bf=function(_0x31b363,_0x3eca73){_0x31b363=_0x31b363-0x0;var _0x17bf39=_0x3bf7[_0x31b363];return _0x17bf39;};'use strict';var _=require(_0x73bf('0x0'));var util=require(_0x73bf('0x1'));var moment=require(_0x73bf('0x2'));var BPromise=require('bluebird');var rs=require(_0x73bf('0x3'));var fs=require('fs');var Redis=require(_0x73bf('0x4'));var db=require(_0x73bf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x73bf('0x6'))('rpc');var config=require(_0x73bf('0x7'));var jayson=require(_0x73bf('0x8'));var client=jayson[_0x73bf('0x9')]['http']({'port':0x232a});config[_0x73bf('0xa')]=_[_0x73bf('0xb')](config[_0x73bf('0xa')],{'host':_0x73bf('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73bf('0xa')]));require(_0x73bf('0xd'))[_0x73bf('0xe')](socket);function respondWithRpcPromise(_0x491a3c,_0x3a789b,_0x5b8e60){return new BPromise(function(_0x3547fc,_0x31f5e0){return client[_0x73bf('0xf')](_0x491a3c,_0x5b8e60)['then'](function(_0x588c3f){logger[_0x73bf('0x10')](_0x73bf('0x11'),_0x3a789b,'request\x20sent');logger[_0x73bf('0x12')](_0x73bf('0x13'),_0x3a789b,_0x73bf('0x14'),JSON[_0x73bf('0x15')](_0x588c3f));if(_0x588c3f[_0x73bf('0x16')]){if(_0x588c3f[_0x73bf('0x16')][_0x73bf('0x17')]===0x1f4){logger[_0x73bf('0x16')](_0x73bf('0x11'),_0x3a789b,_0x588c3f[_0x73bf('0x16')]['message']);return _0x31f5e0(_0x588c3f[_0x73bf('0x16')][_0x73bf('0x18')]);}logger[_0x73bf('0x16')](_0x73bf('0x11'),_0x3a789b,_0x588c3f[_0x73bf('0x16')][_0x73bf('0x18')]);return _0x3547fc(_0x588c3f['error'][_0x73bf('0x18')]);}else{logger[_0x73bf('0x10')](_0x73bf('0x11'),_0x3a789b,'request\x20sent');_0x3547fc(_0x588c3f[_0x73bf('0x19')]['message']);}})['catch'](function(_0x3fa1a6){logger[_0x73bf('0x16')](_0x73bf('0x11'),_0x3a789b,_0x3fa1a6);_0x31f5e0(_0x3fa1a6);});});}exports['GetMailQueue']=function(_0x51c3a6){var _0x251e0f=this;return new Promise(function(_0x10e054,_0x3b9979){return db['MailQueue'][_0x73bf('0x1a')]({'raw':_0x51c3a6['options']?_0x51c3a6[_0x73bf('0x1b')][_0x73bf('0x1c')]===undefined?!![]:![]:!![],'where':_0x51c3a6[_0x73bf('0x1b')]?_0x51c3a6[_0x73bf('0x1b')]['where']||null:null,'attributes':_0x51c3a6[_0x73bf('0x1b')]?_0x51c3a6['options'][_0x73bf('0x1d')]||null:null,'limit':_0x51c3a6['options']?_0x51c3a6[_0x73bf('0x1b')]['limit']||null:null,'include':_0x51c3a6['options']?_0x51c3a6[_0x73bf('0x1b')][_0x73bf('0x1e')]?_[_0x73bf('0x1f')](_0x51c3a6['options'][_0x73bf('0x1e')],function(_0x214d3f){return{'model':db[_0x214d3f[_0x73bf('0x20')]],'as':_0x214d3f['as'],'attributes':_0x214d3f[_0x73bf('0x1d')],'include':_0x214d3f[_0x73bf('0x1e')]?_[_0x73bf('0x1f')](_0x214d3f[_0x73bf('0x1e')],function(_0x131939){return{'model':db[_0x131939[_0x73bf('0x20')]],'as':_0x131939['as'],'attributes':_0x131939[_0x73bf('0x1d')],'include':_0x131939[_0x73bf('0x1e')]?_['map'](_0x131939[_0x73bf('0x1e')],function(_0x311150){return{'model':db[_0x311150[_0x73bf('0x20')]],'as':_0x311150['as'],'attributes':_0x311150[_0x73bf('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x73bf('0x21')](function(_0x5840ff){logger[_0x73bf('0x10')](_0x73bf('0x22'),_0x51c3a6);logger[_0x73bf('0x12')](_0x73bf('0x22'),_0x51c3a6,JSON[_0x73bf('0x15')](_0x5840ff));_0x10e054(_0x5840ff);})['catch'](function(_0x41c3c4){logger[_0x73bf('0x16')]('GetMailQueue',_0x41c3c4[_0x73bf('0x18')],_0x51c3a6);_0x3b9979(_0x251e0f['error'](0x1f4,_0x41c3c4[_0x73bf('0x18')]));});});};exports[_0x73bf('0x23')]=function(_0x2dcb36){var _0x54134c=this;return new Promise(function(_0xf0185,_0x195258){return db['MailQueue'][_0x73bf('0x24')]({'raw':_0x2dcb36[_0x73bf('0x1b')]?_0x2dcb36['options'][_0x73bf('0x1c')]===undefined?!![]:![]:!![],'where':_0x2dcb36[_0x73bf('0x1b')]?_0x2dcb36[_0x73bf('0x1b')][_0x73bf('0x25')]||null:null,'attributes':_0x2dcb36['options']?_0x2dcb36['options'][_0x73bf('0x1d')]||null:null,'include':_0x2dcb36['options']?_0x2dcb36['options'][_0x73bf('0x1e')]?_[_0x73bf('0x1f')](_0x2dcb36['options'][_0x73bf('0x1e')],function(_0x1c7d39){return{'model':db[_0x1c7d39[_0x73bf('0x20')]],'as':_0x1c7d39['as'],'attributes':_0x1c7d39['attributes'],'include':_0x1c7d39[_0x73bf('0x1e')]?_['map'](_0x1c7d39[_0x73bf('0x1e')],function(_0x7543d6){return{'model':db[_0x7543d6['model']],'as':_0x7543d6['as'],'attributes':_0x7543d6[_0x73bf('0x1d')],'include':_0x7543d6[_0x73bf('0x1e')]?_[_0x73bf('0x1f')](_0x7543d6[_0x73bf('0x1e')],function(_0x43ec3b){return{'model':db[_0x43ec3b[_0x73bf('0x20')]],'as':_0x43ec3b['as'],'attributes':_0x43ec3b[_0x73bf('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x70c8b1){logger[_0x73bf('0x10')](_0x73bf('0x23'),_0x2dcb36);logger['debug'](_0x73bf('0x23'),_0x2dcb36,JSON['stringify'](_0x70c8b1));_0xf0185(_0x70c8b1);})[_0x73bf('0x26')](function(_0x8bade0){logger['error'](_0x73bf('0x23'),_0x8bade0[_0x73bf('0x18')],_0x2dcb36);_0x195258(_0x54134c[_0x73bf('0x16')](0x1f4,_0x8bade0[_0x73bf('0x18')]));});});}; \ No newline at end of file +var _0xeeaf=['redis','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults'];(function(_0x3d563f,_0x3d4087){var _0x3efdb7=function(_0x3ad54f){while(--_0x3ad54f){_0x3d563f['push'](_0x3d563f['shift']());}};_0x3efdb7(++_0x3d4087);}(_0xeeaf,0x1bc));var _0xfeea=function(_0x1c49f9,_0x627e53){_0x1c49f9=_0x1c49f9-0x0;var _0x5e3aa2=_0xeeaf[_0x1c49f9];return _0x5e3aa2;};'use strict';var _=require(_0xfeea('0x0'));var util=require(_0xfeea('0x1'));var moment=require(_0xfeea('0x2'));var BPromise=require(_0xfeea('0x3'));var rs=require(_0xfeea('0x4'));var fs=require('fs');var Redis=require(_0xfeea('0x5'));var db=require(_0xfeea('0x6'))['db'];var utils=require(_0xfeea('0x7'));var logger=require('../../config/logger')(_0xfeea('0x8'));var config=require(_0xfeea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfeea('0xa')]['http']({'port':0x232a});config['redis']=_[_0xfeea('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfeea('0xc')]));require(_0xfeea('0xd'))['register'](socket);function respondWithRpcPromise(_0x128321,_0x252748,_0xa276aa){return new BPromise(function(_0x3c3afb,_0x2314f3){return client[_0xfeea('0xe')](_0x128321,_0xa276aa)[_0xfeea('0xf')](function(_0x19eba6){logger[_0xfeea('0x10')](_0xfeea('0x11'),_0x252748,_0xfeea('0x12'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x252748,_0xfeea('0x12'),JSON['stringify'](_0x19eba6));if(_0x19eba6[_0xfeea('0x13')]){if(_0x19eba6[_0xfeea('0x13')][_0xfeea('0x14')]===0x1f4){logger['error'](_0xfeea('0x11'),_0x252748,_0x19eba6[_0xfeea('0x13')][_0xfeea('0x15')]);return _0x2314f3(_0x19eba6[_0xfeea('0x13')][_0xfeea('0x15')]);}logger[_0xfeea('0x13')](_0xfeea('0x11'),_0x252748,_0x19eba6[_0xfeea('0x13')][_0xfeea('0x15')]);return _0x3c3afb(_0x19eba6[_0xfeea('0x13')][_0xfeea('0x15')]);}else{logger['info'](_0xfeea('0x11'),_0x252748,_0xfeea('0x12'));_0x3c3afb(_0x19eba6['result']['message']);}})[_0xfeea('0x16')](function(_0x1c421d){logger['error'](_0xfeea('0x11'),_0x252748,_0x1c421d);_0x2314f3(_0x1c421d);});});}exports[_0xfeea('0x17')]=function(_0x15e1f3){var _0x157332=this;return new Promise(function(_0x734ebf,_0x9878ae){return db[_0xfeea('0x18')][_0xfeea('0x19')]({'raw':_0x15e1f3[_0xfeea('0x1a')]?_0x15e1f3[_0xfeea('0x1a')][_0xfeea('0x1b')]===undefined?!![]:![]:!![],'where':_0x15e1f3['options']?_0x15e1f3[_0xfeea('0x1a')][_0xfeea('0x1c')]||null:null,'attributes':_0x15e1f3[_0xfeea('0x1a')]?_0x15e1f3[_0xfeea('0x1a')][_0xfeea('0x1d')]||null:null,'limit':_0x15e1f3[_0xfeea('0x1a')]?_0x15e1f3['options'][_0xfeea('0x1e')]||null:null,'include':_0x15e1f3[_0xfeea('0x1a')]?_0x15e1f3['options'][_0xfeea('0x1f')]?_['map'](_0x15e1f3[_0xfeea('0x1a')][_0xfeea('0x1f')],function(_0x38437b){return{'model':db[_0x38437b['model']],'as':_0x38437b['as'],'attributes':_0x38437b[_0xfeea('0x1d')],'include':_0x38437b[_0xfeea('0x1f')]?_[_0xfeea('0x20')](_0x38437b[_0xfeea('0x1f')],function(_0x1cef67){return{'model':db[_0x1cef67[_0xfeea('0x21')]],'as':_0x1cef67['as'],'attributes':_0x1cef67[_0xfeea('0x1d')],'include':_0x1cef67['include']?_['map'](_0x1cef67[_0xfeea('0x1f')],function(_0x5536f3){return{'model':db[_0x5536f3[_0xfeea('0x21')]],'as':_0x5536f3['as'],'attributes':_0x5536f3[_0xfeea('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfeea('0xf')](function(_0x4b14cb){logger[_0xfeea('0x10')](_0xfeea('0x17'),_0x15e1f3);logger[_0xfeea('0x22')](_0xfeea('0x17'),_0x15e1f3,JSON[_0xfeea('0x23')](_0x4b14cb));_0x734ebf(_0x4b14cb);})[_0xfeea('0x16')](function(_0x2d4bcb){logger[_0xfeea('0x13')](_0xfeea('0x17'),_0x2d4bcb[_0xfeea('0x15')],_0x15e1f3);_0x9878ae(_0x157332[_0xfeea('0x13')](0x1f4,_0x2d4bcb['message']));});});};exports[_0xfeea('0x24')]=function(_0x1450e2){var _0x6ff623=this;return new Promise(function(_0x1ee8cc,_0x398ec1){return db['MailQueue'][_0xfeea('0x25')]({'raw':_0x1450e2[_0xfeea('0x1a')]?_0x1450e2[_0xfeea('0x1a')][_0xfeea('0x1b')]===undefined?!![]:![]:!![],'where':_0x1450e2[_0xfeea('0x1a')]?_0x1450e2[_0xfeea('0x1a')][_0xfeea('0x1c')]||null:null,'attributes':_0x1450e2[_0xfeea('0x1a')]?_0x1450e2['options'][_0xfeea('0x1d')]||null:null,'include':_0x1450e2[_0xfeea('0x1a')]?_0x1450e2[_0xfeea('0x1a')][_0xfeea('0x1f')]?_[_0xfeea('0x20')](_0x1450e2['options']['include'],function(_0x78fc7d){return{'model':db[_0x78fc7d[_0xfeea('0x21')]],'as':_0x78fc7d['as'],'attributes':_0x78fc7d[_0xfeea('0x1d')],'include':_0x78fc7d[_0xfeea('0x1f')]?_[_0xfeea('0x20')](_0x78fc7d['include'],function(_0x5bcdd7){return{'model':db[_0x5bcdd7[_0xfeea('0x21')]],'as':_0x5bcdd7['as'],'attributes':_0x5bcdd7[_0xfeea('0x1d')],'include':_0x5bcdd7[_0xfeea('0x1f')]?_[_0xfeea('0x20')](_0x5bcdd7['include'],function(_0x5e9fd7){return{'model':db[_0x5e9fd7[_0xfeea('0x21')]],'as':_0x5e9fd7['as'],'attributes':_0x5e9fd7[_0xfeea('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfeea('0xf')](function(_0xfdf9f2){logger[_0xfeea('0x10')](_0xfeea('0x24'),_0x1450e2);logger[_0xfeea('0x22')](_0xfeea('0x24'),_0x1450e2,JSON[_0xfeea('0x23')](_0xfdf9f2));_0x1ee8cc(_0xfdf9f2);})['catch'](function(_0x406645){logger[_0xfeea('0x13')]('ShowMailQueue',_0x406645['message'],_0x1450e2);_0x398ec1(_0x6ff623[_0xfeea('0x13')](0x1f4,_0x406645[_0xfeea('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 580fd92..9a26c66 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 _0x6a59=['mailQueue:','./mailQueue.events','remove','update','emit','removeListener','register'];(function(_0x5aa168,_0x138ff7){var _0x1a831b=function(_0x42e10f){while(--_0x42e10f){_0x5aa168['push'](_0x5aa168['shift']());}};_0x1a831b(++_0x138ff7);}(_0x6a59,0x1d6));var _0x96a5=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x6a59[_0x3ba924];return _0x4cc1df;};'use strict';var MailQueueEvents=require(_0x96a5('0x0'));var events=['save',_0x96a5('0x1'),_0x96a5('0x2')];function createListener(_0x4d8ffa,_0x2eeff6){return function(_0x3a76f9){_0x2eeff6[_0x96a5('0x3')](_0x4d8ffa,_0x3a76f9);};}function removeListener(_0x1f63c1,_0x467abe){return function(){MailQueueEvents[_0x96a5('0x4')](_0x1f63c1,_0x467abe);};}exports[_0x96a5('0x5')]=function(_0x503d4f){for(var _0xdc370e=0x0,_0x400594=events['length'];_0xdc370e<_0x400594;_0xdc370e++){var _0x2989b8=events[_0xdc370e];var _0x277a8c=createListener(_0x96a5('0x6')+_0x2989b8,_0x503d4f);MailQueueEvents['on'](_0x2989b8,_0x277a8c);}}; \ No newline at end of file +var _0x602a=['update','emit','removeListener','register','length','mailQueue:','./mailQueue.events','remove'];(function(_0x57a4b7,_0x79297a){var _0x2977ca=function(_0x1f7981){while(--_0x1f7981){_0x57a4b7['push'](_0x57a4b7['shift']());}};_0x2977ca(++_0x79297a);}(_0x602a,0x1de));var _0xa602=function(_0x38a6c6,_0x3be58f){_0x38a6c6=_0x38a6c6-0x0;var _0xa69bd7=_0x602a[_0x38a6c6];return _0xa69bd7;};'use strict';var MailQueueEvents=require(_0xa602('0x0'));var events=['save',_0xa602('0x1'),_0xa602('0x2')];function createListener(_0x403c06,_0x1e9fa4){return function(_0x4f8890){_0x1e9fa4[_0xa602('0x3')](_0x403c06,_0x4f8890);};}function removeListener(_0x25afef,_0x583cba){return function(){MailQueueEvents[_0xa602('0x4')](_0x25afef,_0x583cba);};}exports[_0xa602('0x5')]=function(_0x5c79a1){for(var _0x2a9d2f=0x0,_0x58d7d5=events[_0xa602('0x6')];_0x2a9d2f<_0x58d7d5;_0x2a9d2f++){var _0x1c4ee9=events[_0x2a9d2f];var _0x31bc1b=createListener(_0xa602('0x7')+_0x1c4ee9,_0x5c79a1);MailQueueEvents['on'](_0x1c4ee9,_0x31bc1b);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 36768da..b30a77b 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 _0x69d0=['Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x55684a,_0xc2dbdc){var _0x1a97d6=function(_0x46b5a6){while(--_0x46b5a6){_0x55684a['push'](_0x55684a['shift']());}};_0x1a97d6(++_0xc2dbdc);}(_0x69d0,0x162));var _0x069d=function(_0x158700,_0x4c8b20){_0x158700=_0x158700-0x0;var _0x59254a=_0x69d0[_0x158700];return _0x59254a;};'use strict';var multer=require(_0x069d('0x0'));var util=require(_0x069d('0x1'));var path=require(_0x069d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x069d('0x3')]();var fs_extra=require(_0x069d('0x4'));var auth=require(_0x069d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x069d('0x6'));var controller=require(_0x069d('0x7'));router[_0x069d('0x8')]('/',auth['isAuthenticated'](),controller[_0x069d('0x9')]);router['get'](_0x069d('0xa'),auth['isAuthenticated'](),controller[_0x069d('0xb')]);router[_0x069d('0x8')](_0x069d('0xc'),auth[_0x069d('0xd')](),controller[_0x069d('0xe')]);router[_0x069d('0xf')]('/',auth['isAuthenticated'](),controller[_0x069d('0x10')]);router['put']('/:id',auth[_0x069d('0xd')](),controller[_0x069d('0x11')]);router[_0x069d('0x12')](_0x069d('0xc'),auth['isAuthenticated'](),controller[_0x069d('0x13')]);module[_0x069d('0x14')]=router; \ No newline at end of file +var _0xcaea=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller'];(function(_0x15f266,_0xb023f){var _0x2d153b=function(_0x501530){while(--_0x501530){_0x15f266['push'](_0x15f266['shift']());}};_0x2d153b(++_0xb023f);}(_0xcaea,0xdd));var _0xacae=function(_0x402071,_0x3f74e2){_0x402071=_0x402071-0x0;var _0x1f1694=_0xcaea[_0x402071];return _0x1f1694;};'use strict';var multer=require(_0xacae('0x0'));var util=require('util');var path=require(_0xacae('0x1'));var timeout=require(_0xacae('0x2'));var express=require(_0xacae('0x3'));var router=express[_0xacae('0x4')]();var fs_extra=require(_0xacae('0x5'));var auth=require(_0xacae('0x6'));var interaction=require(_0xacae('0x7'));var config=require('../../config/environment');var controller=require(_0xacae('0x8'));router[_0xacae('0x9')]('/',auth[_0xacae('0xa')](),controller[_0xacae('0xb')]);router['get'](_0xacae('0xc'),auth[_0xacae('0xa')](),controller[_0xacae('0xd')]);router[_0xacae('0x9')](_0xacae('0xe'),auth[_0xacae('0xa')](),controller[_0xacae('0xf')]);router[_0xacae('0x10')]('/',auth[_0xacae('0xa')](),controller[_0xacae('0x11')]);router[_0xacae('0x12')]('/:id',auth[_0xacae('0xa')](),controller[_0xacae('0x13')]);router[_0xacae('0x14')]('/:id',auth[_0xacae('0xa')](),controller[_0xacae('0x15')]);module[_0xacae('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index e628aa3..6e0b525 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 _0x3cf5=['sequelize','exports','STRING','DATE','moment'];(function(_0x2ddad0,_0x517607){var _0x526567=function(_0x500664){while(--_0x500664){_0x2ddad0['push'](_0x2ddad0['shift']());}};_0x526567(++_0x517607);}(_0x3cf5,0x1a3));var _0x53cf=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x3cf5[_0x534c8f];return _0x5a57f5;};'use strict';var moment=require(_0x53cf('0x0'));var Sequelize=require(_0x53cf('0x1'));module[_0x53cf('0x2')]={'uniqueid':{'type':Sequelize[_0x53cf('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x53cf('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x53cf('0x4')]},'exitAt':{'type':Sequelize[_0x53cf('0x4')]},'reason':{'type':Sequelize[_0x53cf('0x3')]}}; \ No newline at end of file +var _0xc6e7=['moment','sequelize','STRING','DATE'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xc6e7,0x1a4));var _0x7c6e=function(_0x54aacc,_0xb457b9){_0x54aacc=_0x54aacc-0x0;var _0x22528c=_0xc6e7[_0x54aacc];return _0x22528c;};'use strict';var moment=require(_0x7c6e('0x0'));var Sequelize=require(_0x7c6e('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x7c6e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7c6e('0x2')]},'joinAt':{'type':Sequelize[_0x7c6e('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7c6e('0x3')]},'exitAt':{'type':Sequelize[_0x7c6e('0x3')]},'reason':{'type':Sequelize[_0x7c6e('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 1c023e1..0245d07 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 _0x8aad=['sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x15b388,_0x4288d8){var _0x2f8770=function(_0x5c831b){while(--_0x5c831b){_0x15b388['push'](_0x15b388['shift']());}};_0x2f8770(++_0x4288d8);}(_0x8aad,0x146));var _0xd8aa=function(_0x353785,_0x523ae8){_0x353785=_0x353785-0x0;var _0x4464d7=_0x8aad[_0x353785];return _0x4464d7;};'use strict';var emlformat=require(_0xd8aa('0x0'));var rimraf=require(_0xd8aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8aa('0x2'));var rp=require('request-promise');var moment=require(_0xd8aa('0x3'));var BPromise=require(_0xd8aa('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd8aa('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8aa('0x6'));var fs=require('fs');var fs_extra=require(_0xd8aa('0x7'));var _=require(_0xd8aa('0x8'));var squel=require('squel');var crypto=require(_0xd8aa('0x9'));var jsforce=require(_0xd8aa('0xa'));var deskjs=require(_0xd8aa('0xb'));var toCsv=require(_0xd8aa('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8aa('0xd'));var authService=require(_0xd8aa('0xe'));var qs=require(_0xd8aa('0xf'));var as=require(_0xd8aa('0x10'));var hardwareService=require(_0xd8aa('0x11'));var logger=require('../../config/logger')(_0xd8aa('0x12'));var utils=require(_0xd8aa('0x13'));var config=require(_0xd8aa('0x14'));var licenseUtil=require(_0xd8aa('0x15'));var db=require(_0xd8aa('0x16'))['db'];function respondWithStatusCode(_0x6ec0eb,_0x549fad){_0x549fad=_0x549fad||0xcc;return function(_0x1e7db8){if(_0x1e7db8){return _0x6ec0eb[_0xd8aa('0x17')](_0x549fad);}return _0x6ec0eb[_0xd8aa('0x18')](_0x549fad)['end']();};}function respondWithResult(_0x5a8c79,_0x275eff){_0x275eff=_0x275eff||0xc8;return function(_0x319ffe){if(_0x319ffe){return _0x5a8c79[_0xd8aa('0x18')](_0x275eff)['json'](_0x319ffe);}};}function respondWithFilteredResult(_0x2678ed,_0x180c56){return function(_0x39b5bc){if(_0x39b5bc){var _0x404ed6=typeof _0x180c56['offset']===_0xd8aa('0x19')&&typeof _0x180c56[_0xd8aa('0x1a')]==='undefined';var _0x16d5c6=_0x39b5bc[_0xd8aa('0x1b')];var _0x32e2cd=_0x404ed6?0x0:_0x180c56[_0xd8aa('0x1c')];var _0x2d34ac=_0x404ed6?_0x39b5bc['count']:_0x180c56[_0xd8aa('0x1c')]+_0x180c56[_0xd8aa('0x1a')];var _0xb156e6;if(_0x2d34ac>=_0x16d5c6){_0x2d34ac=_0x16d5c6;_0xb156e6=0xc8;}else{_0xb156e6=0xce;}_0x2678ed[_0xd8aa('0x18')](_0xb156e6);return _0x2678ed['set'](_0xd8aa('0x1d'),_0x32e2cd+'-'+_0x2d34ac+'/'+_0x16d5c6)[_0xd8aa('0x1e')](_0x39b5bc);}return null;};}function patchUpdates(_0x46d69b){return function(_0x3588ee){try{jsonpatch[_0xd8aa('0x1f')](_0x3588ee,_0x46d69b,!![]);}catch(_0x4fe5d8){return BPromise[_0xd8aa('0x20')](_0x4fe5d8);}return _0x3588ee[_0xd8aa('0x21')]();};}function saveUpdates(_0xc4f55c,_0x5910b3){return function(_0xa7cf85){if(_0xa7cf85){return _0xa7cf85[_0xd8aa('0x22')](_0xc4f55c)[_0xd8aa('0x23')](function(_0x290849){return _0x290849;});}return null;};}function removeEntity(_0x3ef3a9,_0x16758a){return function(_0x1f64f8){if(_0x1f64f8){return _0x1f64f8[_0xd8aa('0x24')]()[_0xd8aa('0x23')](function(){_0x3ef3a9[_0xd8aa('0x18')](0xcc)[_0xd8aa('0x25')]();});}};}function handleEntityNotFound(_0x370d6f,_0x26cc66){return function(_0x5f1027){if(!_0x5f1027){_0x370d6f[_0xd8aa('0x17')](0x194);}return _0x5f1027;};}function handleError(_0x59eb3f,_0xd4d204){_0xd4d204=_0xd4d204||0x1f4;return function(_0x1f6ab2){logger[_0xd8aa('0x26')](_0x1f6ab2[_0xd8aa('0x27')]);if(_0x1f6ab2[_0xd8aa('0x28')]){delete _0x1f6ab2[_0xd8aa('0x28')];}_0x59eb3f[_0xd8aa('0x18')](_0xd4d204)[_0xd8aa('0x29')](_0x1f6ab2);};}exports['index']=function(_0x1f2a28,_0x34b792){var _0x214393={},_0x49a7c8={},_0x19a59d={'count':0x0,'rows':[]};var _0x51c6f4=_[_0xd8aa('0x2a')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')],function(_0x168a2e){return{'name':_0x168a2e[_0xd8aa('0x2d')],'type':_0x168a2e[_0xd8aa('0x2e')][_0xd8aa('0x2f')]};});_0x49a7c8[_0xd8aa('0x30')]=_['map'](_0x51c6f4,_0xd8aa('0x28'));_0x49a7c8[_0xd8aa('0x31')]=_[_0xd8aa('0x32')](_0x1f2a28[_0xd8aa('0x31')]);_0x49a7c8[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],_0x49a7c8[_0xd8aa('0x31')]);_0x214393['attributes']=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],qs[_0xd8aa('0x35')](_0x1f2a28['query'][_0xd8aa('0x35')]));_0x214393[_0xd8aa('0x36')]=_0x214393[_0xd8aa('0x36')][_0xd8aa('0x37')]?_0x214393[_0xd8aa('0x36')]:_0x49a7c8[_0xd8aa('0x30')];if(!_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x38')](_0xd8aa('0x39'))){_0x214393['limit']=qs[_0xd8aa('0x1a')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1a')]);_0x214393[_0xd8aa('0x1c')]=qs[_0xd8aa('0x1c')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1c')]);}_0x214393[_0xd8aa('0x3a')]=qs[_0xd8aa('0x3b')](_0x1f2a28['query'][_0xd8aa('0x3b')]);_0x214393['where']=qs[_0xd8aa('0x33')](_[_0xd8aa('0x3c')](_0x1f2a28['query'],_0x49a7c8[_0xd8aa('0x33')]),_0x51c6f4);if(_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]){_0x214393[_0xd8aa('0x3e')]=_[_0xd8aa('0x3f')](_0x214393['where'],{'$or':_['map'](_0x51c6f4,function(_0x25145c){if(_0x25145c['type']!==_0xd8aa('0x40')){var _0x7a6df2={};_0x7a6df2[_0x25145c[_0xd8aa('0x28')]]={'$like':'%'+_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]+'%'};return _0x7a6df2;}})});}_0x214393=_[_0xd8aa('0x3f')]({},_0x214393,_0x1f2a28[_0xd8aa('0x41')]);var _0x3b0220={'where':_0x214393[_0xd8aa('0x3e')]};return db[_0xd8aa('0x2b')][_0xd8aa('0x1b')](_0x3b0220)['then'](function(_0x17ebb4){_0x19a59d[_0xd8aa('0x1b')]=_0x17ebb4;if(_0x1f2a28[_0xd8aa('0x31')]['includeAll']){_0x214393[_0xd8aa('0x42')]=[{'all':!![]}];}return db[_0xd8aa('0x2b')][_0xd8aa('0x43')](_0x214393);})[_0xd8aa('0x23')](function(_0x3a0284){_0x19a59d[_0xd8aa('0x44')]=_0x3a0284;return _0x19a59d;})[_0xd8aa('0x23')](respondWithFilteredResult(_0x34b792,_0x214393))[_0xd8aa('0x45')](handleError(_0x34b792,null));};exports[_0xd8aa('0x46')]=function(_0x3f5857,_0x20c7a0){var _0x3ec42f={'raw':!![],'where':{'id':_0x3f5857[_0xd8aa('0x47')]['id']}},_0x3b26c9={};_0x3b26c9[_0xd8aa('0x30')]=_[_0xd8aa('0x32')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')]);_0x3b26c9['query']=_[_0xd8aa('0x32')](_0x3f5857[_0xd8aa('0x31')]);_0x3b26c9[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x3b26c9[_0xd8aa('0x30')],_0x3b26c9[_0xd8aa('0x31')]);_0x3ec42f['attributes']=_[_0xd8aa('0x34')](_0x3b26c9['model'],qs[_0xd8aa('0x35')](_0x3f5857['query'][_0xd8aa('0x35')]));_0x3ec42f['attributes']=_0x3ec42f['attributes'][_0xd8aa('0x37')]?_0x3ec42f[_0xd8aa('0x36')]:_0x3b26c9[_0xd8aa('0x30')];if(_0x3f5857[_0xd8aa('0x31')][_0xd8aa('0x48')]){_0x3ec42f[_0xd8aa('0x42')]=[{'all':!![]}];}_0x3ec42f=_['merge']({},_0x3ec42f,_0x3f5857[_0xd8aa('0x41')]);return db[_0xd8aa('0x2b')][_0xd8aa('0x49')](_0x3ec42f)[_0xd8aa('0x23')](handleEntityNotFound(_0x20c7a0,null))[_0xd8aa('0x23')](respondWithResult(_0x20c7a0,null))['catch'](handleError(_0x20c7a0,null));};exports['create']=function(_0x58cf42,_0x1fd1dc){return db[_0xd8aa('0x2b')][_0xd8aa('0x4a')](_0x58cf42[_0xd8aa('0x4b')],{})[_0xd8aa('0x23')](respondWithResult(_0x1fd1dc,0xc9))[_0xd8aa('0x45')](handleError(_0x1fd1dc,null));};exports['update']=function(_0x221e2b,_0x241e23){if(_0x221e2b['body']['id']){delete _0x221e2b[_0xd8aa('0x4b')]['id'];}return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x221e2b['params']['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x241e23,null))[_0xd8aa('0x23')](saveUpdates(_0x221e2b[_0xd8aa('0x4b')],null))[_0xd8aa('0x23')](respondWithResult(_0x241e23,null))[_0xd8aa('0x45')](handleError(_0x241e23,null));};exports[_0xd8aa('0x24')]=function(_0x4f494d,_0x566d52){return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x4f494d[_0xd8aa('0x47')]['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x566d52,null))[_0xd8aa('0x23')](removeEntity(_0x566d52,null))[_0xd8aa('0x45')](handleError(_0x566d52,null));};exports[_0xd8aa('0x4c')]=function(_0x4f9d21,_0x9db7e3){return db[_0xd8aa('0x2b')]['describe']()[_0xd8aa('0x23')](respondWithResult(_0x9db7e3,null))['catch'](handleError(_0x9db7e3,null));}; \ No newline at end of file +var _0xbff5=['squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','map','MailQueueReport','rawAttributes','fieldName','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash'];(function(_0x2808d0,_0x221a9f){var _0x3aef7c=function(_0x331dc1){while(--_0x331dc1){_0x2808d0['push'](_0x2808d0['shift']());}};_0x3aef7c(++_0x221a9f);}(_0xbff5,0x1bc));var _0x5bff=function(_0x1f15e5,_0x164cba){_0x1f15e5=_0x1f15e5-0x0;var _0x7c19d3=_0xbff5[_0x1f15e5];return _0x7c19d3;};'use strict';var emlformat=require(_0x5bff('0x0'));var rimraf=require(_0x5bff('0x1'));var zipdir=require(_0x5bff('0x2'));var jsonpatch=require(_0x5bff('0x3'));var rp=require(_0x5bff('0x4'));var moment=require(_0x5bff('0x5'));var BPromise=require(_0x5bff('0x6'));var Mustache=require('mustache');var util=require(_0x5bff('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5bff('0x8'));var ejs=require(_0x5bff('0x9'));var fs=require('fs');var fs_extra=require(_0x5bff('0xa'));var _=require(_0x5bff('0xb'));var squel=require(_0x5bff('0xc'));var crypto=require(_0x5bff('0xd'));var jsforce=require(_0x5bff('0xe'));var deskjs=require(_0x5bff('0xf'));var toCsv=require(_0x5bff('0x8'));var querystring=require('querystring');var Papa=require(_0x5bff('0x10'));var Redis=require('ioredis');var authService=require(_0x5bff('0x11'));var qs=require(_0x5bff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bff('0x13'));var logger=require('../../config/logger')(_0x5bff('0x14'));var utils=require('../../config/utils');var config=require(_0x5bff('0x15'));var licenseUtil=require(_0x5bff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132dc9,_0x50e1e9){_0x50e1e9=_0x50e1e9||0xcc;return function(_0x335e78){if(_0x335e78){return _0x132dc9[_0x5bff('0x17')](_0x50e1e9);}return _0x132dc9['status'](_0x50e1e9)[_0x5bff('0x18')]();};}function respondWithResult(_0xa16a3f,_0x5b0d2d){_0x5b0d2d=_0x5b0d2d||0xc8;return function(_0x5f2a55){if(_0x5f2a55){return _0xa16a3f[_0x5bff('0x19')](_0x5b0d2d)[_0x5bff('0x1a')](_0x5f2a55);}};}function respondWithFilteredResult(_0x3a507c,_0x4d883e){return function(_0x2d22ab){if(_0x2d22ab){var _0x4612ec=typeof _0x4d883e[_0x5bff('0x1b')]==='undefined'&&typeof _0x4d883e[_0x5bff('0x1c')]===_0x5bff('0x1d');var _0x38daa0=_0x2d22ab['count'];var _0xc9fbc3=_0x4612ec?0x0:_0x4d883e[_0x5bff('0x1b')];var _0x36653b=_0x4612ec?_0x2d22ab[_0x5bff('0x1e')]:_0x4d883e['offset']+_0x4d883e[_0x5bff('0x1c')];var _0x5357d4;if(_0x36653b>=_0x38daa0){_0x36653b=_0x38daa0;_0x5357d4=0xc8;}else{_0x5357d4=0xce;}_0x3a507c[_0x5bff('0x19')](_0x5357d4);return _0x3a507c['set'](_0x5bff('0x1f'),_0xc9fbc3+'-'+_0x36653b+'/'+_0x38daa0)[_0x5bff('0x1a')](_0x2d22ab);}return null;};}function patchUpdates(_0x2a83ce){return function(_0x6cbfa){try{jsonpatch[_0x5bff('0x20')](_0x6cbfa,_0x2a83ce,!![]);}catch(_0x2012e4){return BPromise[_0x5bff('0x21')](_0x2012e4);}return _0x6cbfa[_0x5bff('0x22')]();};}function saveUpdates(_0x155e16,_0x490bc1){return function(_0x5f2593){if(_0x5f2593){return _0x5f2593[_0x5bff('0x23')](_0x155e16)[_0x5bff('0x24')](function(_0x1e7f8a){return _0x1e7f8a;});}return null;};}function removeEntity(_0x352b1f,_0x31d26b){return function(_0x3913fd){if(_0x3913fd){return _0x3913fd[_0x5bff('0x25')]()['then'](function(){_0x352b1f['status'](0xcc)[_0x5bff('0x18')]();});}};}function handleEntityNotFound(_0x53bd97,_0x220c8f){return function(_0xcc091d){if(!_0xcc091d){_0x53bd97[_0x5bff('0x17')](0x194);}return _0xcc091d;};}function handleError(_0x6f18f1,_0xfa361d){_0xfa361d=_0xfa361d||0x1f4;return function(_0x1140eb){logger[_0x5bff('0x26')](_0x1140eb[_0x5bff('0x27')]);if(_0x1140eb['name']){delete _0x1140eb['name'];}_0x6f18f1[_0x5bff('0x19')](_0xfa361d)[_0x5bff('0x28')](_0x1140eb);};}exports['index']=function(_0x36a7d2,_0x588078){var _0x5470cb={},_0x3eda3a={},_0x5cf207={'count':0x0,'rows':[]};var _0x3ed23b=_[_0x5bff('0x29')](db[_0x5bff('0x2a')][_0x5bff('0x2b')],function(_0x48aee1){return{'name':_0x48aee1[_0x5bff('0x2c')],'type':_0x48aee1['type'][_0x5bff('0x2d')]};});_0x3eda3a['model']=_[_0x5bff('0x29')](_0x3ed23b,_0x5bff('0x2e'));_0x3eda3a[_0x5bff('0x2f')]=_[_0x5bff('0x30')](_0x36a7d2[_0x5bff('0x2f')]);_0x3eda3a[_0x5bff('0x31')]=_['intersection'](_0x3eda3a[_0x5bff('0x32')],_0x3eda3a[_0x5bff('0x2f')]);_0x5470cb[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x3eda3a[_0x5bff('0x32')],qs[_0x5bff('0x35')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x35')]));_0x5470cb['attributes']=_0x5470cb[_0x5bff('0x33')][_0x5bff('0x36')]?_0x5470cb[_0x5bff('0x33')]:_0x3eda3a[_0x5bff('0x32')];if(!_0x36a7d2['query'][_0x5bff('0x37')](_0x5bff('0x38'))){_0x5470cb['limit']=qs[_0x5bff('0x1c')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1c')]);_0x5470cb[_0x5bff('0x1b')]=qs['offset'](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1b')]);}_0x5470cb[_0x5bff('0x39')]=qs['sort'](_0x36a7d2[_0x5bff('0x2f')]['sort']);_0x5470cb[_0x5bff('0x3a')]=qs[_0x5bff('0x31')](_[_0x5bff('0x3b')](_0x36a7d2['query'],_0x3eda3a[_0x5bff('0x31')]),_0x3ed23b);if(_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x3c')]){_0x5470cb['where']=_[_0x5bff('0x3d')](_0x5470cb[_0x5bff('0x3a')],{'$or':_['map'](_0x3ed23b,function(_0x265cdb){if(_0x265cdb[_0x5bff('0x3e')]!==_0x5bff('0x3f')){var _0x77a071={};_0x77a071[_0x265cdb[_0x5bff('0x2e')]]={'$like':'%'+_0x36a7d2['query'][_0x5bff('0x3c')]+'%'};return _0x77a071;}})});}_0x5470cb=_['merge']({},_0x5470cb,_0x36a7d2[_0x5bff('0x40')]);var _0x2fecb9={'where':_0x5470cb[_0x5bff('0x3a')]};return db[_0x5bff('0x2a')][_0x5bff('0x1e')](_0x2fecb9)[_0x5bff('0x24')](function(_0x1d0346){_0x5cf207['count']=_0x1d0346;if(_0x36a7d2['query'][_0x5bff('0x41')]){_0x5470cb[_0x5bff('0x42')]=[{'all':!![]}];}return db[_0x5bff('0x2a')][_0x5bff('0x43')](_0x5470cb);})[_0x5bff('0x24')](function(_0xb7b82a){_0x5cf207[_0x5bff('0x44')]=_0xb7b82a;return _0x5cf207;})[_0x5bff('0x24')](respondWithFilteredResult(_0x588078,_0x5470cb))['catch'](handleError(_0x588078,null));};exports[_0x5bff('0x45')]=function(_0x49676f,_0x3dc13f){var _0x1b8c7f={'raw':!![],'where':{'id':_0x49676f[_0x5bff('0x46')]['id']}},_0x543517={};_0x543517[_0x5bff('0x32')]=_['keys'](db[_0x5bff('0x2a')][_0x5bff('0x2b')]);_0x543517[_0x5bff('0x2f')]=_['keys'](_0x49676f[_0x5bff('0x2f')]);_0x543517[_0x5bff('0x31')]=_[_0x5bff('0x34')](_0x543517['model'],_0x543517[_0x5bff('0x2f')]);_0x1b8c7f[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x543517[_0x5bff('0x32')],qs['fields'](_0x49676f[_0x5bff('0x2f')]['fields']));_0x1b8c7f['attributes']=_0x1b8c7f[_0x5bff('0x33')][_0x5bff('0x36')]?_0x1b8c7f['attributes']:_0x543517[_0x5bff('0x32')];if(_0x49676f[_0x5bff('0x2f')]['includeAll']){_0x1b8c7f[_0x5bff('0x42')]=[{'all':!![]}];}_0x1b8c7f=_[_0x5bff('0x3d')]({},_0x1b8c7f,_0x49676f[_0x5bff('0x40')]);return db[_0x5bff('0x2a')]['find'](_0x1b8c7f)[_0x5bff('0x24')](handleEntityNotFound(_0x3dc13f,null))[_0x5bff('0x24')](respondWithResult(_0x3dc13f,null))[_0x5bff('0x47')](handleError(_0x3dc13f,null));};exports[_0x5bff('0x48')]=function(_0x1e94c5,_0x2588b8){return db['MailQueueReport'][_0x5bff('0x48')](_0x1e94c5[_0x5bff('0x49')],{})['then'](respondWithResult(_0x2588b8,0xc9))[_0x5bff('0x47')](handleError(_0x2588b8,null));};exports['update']=function(_0x47fc14,_0x4ff13a){if(_0x47fc14[_0x5bff('0x49')]['id']){delete _0x47fc14[_0x5bff('0x49')]['id'];}return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x47fc14[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x4ff13a,null))[_0x5bff('0x24')](saveUpdates(_0x47fc14[_0x5bff('0x49')],null))['then'](respondWithResult(_0x4ff13a,null))[_0x5bff('0x47')](handleError(_0x4ff13a,null));};exports[_0x5bff('0x25')]=function(_0x5e99f5,_0x16c61e){return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x5e99f5[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x16c61e,null))[_0x5bff('0x24')](removeEntity(_0x16c61e,null))[_0x5bff('0x47')](handleError(_0x16c61e,null));};exports['describe']=function(_0x36089e,_0x18018e){return db['MailQueueReport'][_0x5bff('0x4b')]()[_0x5bff('0x24')](respondWithResult(_0x18018e,null))['catch'](handleError(_0x18018e,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index af875bf..8b4aea3 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 _0xa1a9=['lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x42ff6b,_0xf50096){var _0xecee6c=function(_0x2b1900){while(--_0x2b1900){_0x42ff6b['push'](_0x42ff6b['shift']());}};_0xecee6c(++_0xf50096);}(_0xa1a9,0x75));var _0x9a1a=function(_0x3b8b60,_0x1e1ec9){_0x3b8b60=_0x3b8b60-0x0;var _0x23f4f3=_0xa1a9[_0x3b8b60];return _0x23f4f3;};'use strict';var _=require(_0x9a1a('0x0'));var util=require(_0x9a1a('0x1'));var logger=require('../../config/logger')(_0x9a1a('0x2'));var moment=require('moment');var BPromise=require(_0x9a1a('0x3'));var rp=require(_0x9a1a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a1a('0x5'));var config=require(_0x9a1a('0x6'));var attributes=require(_0x9a1a('0x7'));module[_0x9a1a('0x8')]=function(_0x4bcff9,_0x44e319){return _0x4bcff9[_0x9a1a('0x9')](_0x9a1a('0xa'),attributes,{'tableName':_0x9a1a('0xb'),'paranoid':![],'indexes':[{'name':_0x9a1a('0xc'),'fields':[_0x9a1a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3bd=['../../config/logger','api','moment','bluebird','path','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','lodash','util'];(function(_0x100a92,_0x5b27e3){var _0x51dbaa=function(_0x44fc79){while(--_0x44fc79){_0x100a92['push'](_0x100a92['shift']());}};_0x51dbaa(++_0x5b27e3);}(_0xa3bd,0xae));var _0xda3b=function(_0x59c5b7,_0x4fb175){_0x59c5b7=_0x59c5b7-0x0;var _0x1a79ff=_0xa3bd[_0x59c5b7];return _0x1a79ff;};'use strict';var _=require(_0xda3b('0x0'));var util=require(_0xda3b('0x1'));var logger=require(_0xda3b('0x2'))(_0xda3b('0x3'));var moment=require(_0xda3b('0x4'));var BPromise=require(_0xda3b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda3b('0x6'));var rimraf=require('rimraf');var config=require(_0xda3b('0x7'));var attributes=require(_0xda3b('0x8'));module[_0xda3b('0x9')]=function(_0x28fefe,_0x56a26a){return _0x28fefe['define'](_0xda3b('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 2a70b57..80c1917 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 _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x21b0c9,_0x1d9b67){var _0x8843fe=function(_0x20db09){while(--_0x20db09){_0x21b0c9['push'](_0x21b0c9['shift']());}};_0x8843fe(++_0x1d9b67);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x1645ca,_0x57cbe8){var _0x5f041b=function(_0x467c6c){while(--_0x467c6c){_0x1645ca['push'](_0x1645ca['shift']());}};_0x5f041b(++_0x57cbe8);}(_0x7a54,0x106));var _0x47a5=function(_0x5d7a27,_0x39d0dd){_0x5d7a27=_0x5d7a27-0x0;var _0x90aee=_0x7a54[_0x5d7a27];return _0x90aee;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index d3d53fd..4f4b8bb 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x581f69,_0x5ba234){var _0x3ca155=function(_0x575571){while(--_0x575571){_0x581f69['push'](_0x581f69['shift']());}};_0x3ca155(++_0x5ba234);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x15797a,_0x16274f){_0x15797a=_0x15797a-0x0;var _0x3e2618=_0xcb91[_0x15797a];return _0x3e2618;};'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(_0x45c4aa,_0xfc934c){var _0x5bdd28=function(_0x22b2f6){while(--_0x22b2f6){_0x45c4aa['push'](_0x45c4aa['shift']());}};_0x5bdd28(++_0xfc934c);}(_0x70e0,0x17b));var _0x070e=function(_0x1f77d8,_0x4174a9){_0x1f77d8=_0x1f77d8-0x0;var _0x2e93c0=_0x70e0[_0x1f77d8];return _0x2e93c0;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index bdc0e6a..df2e2d2 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 _0xb411=['STRING','INTEGER','BOOLEAN','INBOX','sequelize','exports'];(function(_0x510000,_0x3ad84a){var _0x38f83b=function(_0x1c5a25){while(--_0x1c5a25){_0x510000['push'](_0x510000['shift']());}};_0x38f83b(++_0x3ad84a);}(_0xb411,0x190));var _0x1b41=function(_0xcfaa6a,_0x16f16f){_0xcfaa6a=_0xcfaa6a-0x0;var _0x2d3252=_0xb411[_0xcfaa6a];return _0x2d3252;};'use strict';var Sequelize=require(_0x1b41('0x0'));module[_0x1b41('0x1')]={'description':{'type':Sequelize[_0x1b41('0x2')]},'host':{'type':Sequelize[_0x1b41('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x1b41('0x2')]},'password':{'type':Sequelize[_0x1b41('0x2')]},'port':{'type':Sequelize[_0x1b41('0x3')]},'tls':{'type':Sequelize[_0x1b41('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1b41('0x2')],'defaultValue':_0x1b41('0x5')},'connTimeout':{'type':Sequelize[_0x1b41('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1b41('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x1b41('0x2')]},'modernAuthentication':{'type':Sequelize[_0x1b41('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x8a87=['sequelize','exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x1c8701,_0x81d8c8){var _0x240600=function(_0x2cf5b5){while(--_0x2cf5b5){_0x1c8701['push'](_0x1c8701['shift']());}};_0x240600(++_0x81d8c8);}(_0x8a87,0x192));var _0x78a8=function(_0x22074d,_0x33df85){_0x22074d=_0x22074d-0x0;var _0x3a24ce=_0x8a87[_0x22074d];return _0x3a24ce;};'use strict';var Sequelize=require(_0x78a8('0x0'));module[_0x78a8('0x1')]={'description':{'type':Sequelize[_0x78a8('0x2')]},'host':{'type':Sequelize[_0x78a8('0x2')]},'authentication':{'type':Sequelize[_0x78a8('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x78a8('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x78a8('0x4')]},'tls':{'type':Sequelize[_0x78a8('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x78a8('0x2')],'defaultValue':_0x78a8('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x78a8('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x78a8('0x2')]},'modernAuthentication':{'type':Sequelize[_0x78a8('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 0e32027..19fed04 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 _0x0b5b=['path','rimraf','../../config/environment','./mailServerIn.attributes','define','mail_servers_in','lodash','api','moment','bluebird'];(function(_0x21ecc8,_0x2bdead){var _0x510c1d=function(_0x3b6862){while(--_0x3b6862){_0x21ecc8['push'](_0x21ecc8['shift']());}};_0x510c1d(++_0x2bdead);}(_0x0b5b,0x114));var _0xb0b5=function(_0x130f8c,_0x9fa96){_0x130f8c=_0x130f8c-0x0;var _0x1f436b=_0x0b5b[_0x130f8c];return _0x1f436b;};'use strict';var _=require(_0xb0b5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb0b5('0x1'));var moment=require(_0xb0b5('0x2'));var BPromise=require(_0xb0b5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0b5('0x4'));var rimraf=require(_0xb0b5('0x5'));var config=require(_0xb0b5('0x6'));var attributes=require(_0xb0b5('0x7'));module['exports']=function(_0x56ebd8,_0x551727){return _0x56ebd8[_0xb0b5('0x8')]('MailServerIn',attributes,{'tableName':_0xb0b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59a8=['./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x359b49,_0x46d186){var _0x37293c=function(_0x51ed90){while(--_0x51ed90){_0x359b49['push'](_0x359b49['shift']());}};_0x37293c(++_0x46d186);}(_0x59a8,0xc5));var _0x859a=function(_0x20122a,_0x113c49){_0x20122a=_0x20122a-0x0;var _0x3bcec4=_0x59a8[_0x20122a];return _0x3bcec4;};'use strict';var _=require(_0x859a('0x0'));var util=require(_0x859a('0x1'));var logger=require('../../config/logger')(_0x859a('0x2'));var moment=require(_0x859a('0x3'));var BPromise=require(_0x859a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x859a('0x5'));var rimraf=require('rimraf');var config=require(_0x859a('0x6'));var attributes=require(_0x859a('0x7'));module[_0x859a('0x8')]=function(_0x2197f3,_0x15baa1){return _0x2197f3[_0x859a('0x9')](_0x859a('0xa'),attributes,{'tableName':_0x859a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index c1e0deb..c8606c4 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 _0x688a=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailServerIn,\x20%s,\x20%s','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetMailServerIn','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x64207e,_0x49f785){var _0x2f0246=function(_0x56256a){while(--_0x56256a){_0x64207e['push'](_0x64207e['shift']());}};_0x2f0246(++_0x49f785);}(_0x688a,0x124));var _0xa688=function(_0x117d40,_0x16d96b){_0x117d40=_0x117d40-0x0;var _0x10e9e2=_0x688a[_0x117d40];return _0x10e9e2;};'use strict';var _=require(_0xa688('0x0'));var util=require(_0xa688('0x1'));var moment=require(_0xa688('0x2'));var BPromise=require('bluebird');var rs=require(_0xa688('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa688('0x4'))['db'];var utils=require(_0xa688('0x5'));var logger=require('../../config/logger')(_0xa688('0x6'));var config=require(_0xa688('0x7'));var jayson=require(_0xa688('0x8'));var client=jayson[_0xa688('0x9')][_0xa688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a362a,_0x49e75d,_0x5aee29){return new BPromise(function(_0x45c969,_0x3f3d81){return client[_0xa688('0xb')](_0x2a362a,_0x5aee29)['then'](function(_0x4d3b92){logger[_0xa688('0xc')]('MailServerIn,\x20%s,\x20%s',_0x49e75d,'request\x20sent');logger[_0xa688('0xd')](_0xa688('0xe'),_0x49e75d,_0xa688('0xf'),JSON[_0xa688('0x10')](_0x4d3b92));if(_0x4d3b92[_0xa688('0x11')]){if(_0x4d3b92[_0xa688('0x11')]['code']===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x49e75d,_0x4d3b92[_0xa688('0x11')][_0xa688('0x12')]);return _0x3f3d81(_0x4d3b92['error'][_0xa688('0x12')]);}logger['error'](_0xa688('0x13'),_0x49e75d,_0x4d3b92[_0xa688('0x11')]['message']);return _0x45c969(_0x4d3b92['error'][_0xa688('0x12')]);}else{logger['info'](_0xa688('0x13'),_0x49e75d,'request\x20sent');_0x45c969(_0x4d3b92[_0xa688('0x14')][_0xa688('0x12')]);}})[_0xa688('0x15')](function(_0x25b453){logger[_0xa688('0x11')](_0xa688('0x13'),_0x49e75d,_0x25b453);_0x3f3d81(_0x25b453);});});}exports['GetMailServerIn']=function(_0x59e392){var _0x14ca3c=this;return new Promise(function(_0x1330d5,_0x5dc07f){return db['MailServerIn'][_0xa688('0x16')]({'raw':_0x59e392[_0xa688('0x17')]?_0x59e392['options'][_0xa688('0x18')]===undefined?!![]:![]:!![],'where':_0x59e392['options']?_0x59e392['options'][_0xa688('0x19')]||null:null,'attributes':_0x59e392[_0xa688('0x17')]?_0x59e392[_0xa688('0x17')][_0xa688('0x1a')]||null:null,'limit':_0x59e392[_0xa688('0x17')]?_0x59e392[_0xa688('0x17')][_0xa688('0x1b')]||null:null,'include':_0x59e392[_0xa688('0x17')]?_0x59e392[_0xa688('0x17')][_0xa688('0x1c')]?_[_0xa688('0x1d')](_0x59e392[_0xa688('0x17')][_0xa688('0x1c')],function(_0x11133b){return{'model':db[_0x11133b['model']],'as':_0x11133b['as'],'attributes':_0x11133b[_0xa688('0x1a')],'include':_0x11133b[_0xa688('0x1c')]?_['map'](_0x11133b[_0xa688('0x1c')],function(_0x1e3106){return{'model':db[_0x1e3106['model']],'as':_0x1e3106['as'],'attributes':_0x1e3106[_0xa688('0x1a')],'include':_0x1e3106[_0xa688('0x1c')]?_[_0xa688('0x1d')](_0x1e3106[_0xa688('0x1c')],function(_0x153a86){return{'model':db[_0x153a86[_0xa688('0x1e')]],'as':_0x153a86['as'],'attributes':_0x153a86[_0xa688('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa688('0x1f')](function(_0x3fa53f){logger[_0xa688('0xc')](_0xa688('0x20'),_0x59e392);logger[_0xa688('0xd')](_0xa688('0x20'),_0x59e392,JSON[_0xa688('0x10')](_0x3fa53f));_0x1330d5(_0x3fa53f);})[_0xa688('0x15')](function(_0x5d1657){logger[_0xa688('0x11')](_0xa688('0x20'),_0x5d1657[_0xa688('0x12')],_0x59e392);_0x5dc07f(_0x14ca3c[_0xa688('0x11')](0x1f4,_0x5d1657[_0xa688('0x12')]));});});}; \ No newline at end of file +var _0x2bc5=['findAll','options','where','include','map','model','attributes','debug','GetMailServerIn','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','MailServerIn'];(function(_0x87ac6d,_0x47f9ac){var _0xe60c11=function(_0x3b07b8){while(--_0x3b07b8){_0x87ac6d['push'](_0x87ac6d['shift']());}};_0xe60c11(++_0x47f9ac);}(_0x2bc5,0x1bb));var _0x52bc=function(_0x27dc75,_0x10560b){_0x27dc75=_0x27dc75-0x0;var _0x316106=_0x2bc5[_0x27dc75];return _0x316106;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x52bc('0x0'));var rs=require(_0x52bc('0x1'));var fs=require('fs');var Redis=require(_0x52bc('0x2'));var db=require(_0x52bc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x52bc('0x4'))(_0x52bc('0x5'));var config=require(_0x52bc('0x6'));var jayson=require(_0x52bc('0x7'));var client=jayson[_0x52bc('0x8')][_0x52bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1802c9,_0x4da223,_0x4e99d8){return new BPromise(function(_0x3f85aa,_0x16c03f){return client[_0x52bc('0xa')](_0x1802c9,_0x4e99d8)[_0x52bc('0xb')](function(_0x5413b7){logger['info'](_0x52bc('0xc'),_0x4da223,_0x52bc('0xd'));logger['debug'](_0x52bc('0xe'),_0x4da223,_0x52bc('0xd'),JSON[_0x52bc('0xf')](_0x5413b7));if(_0x5413b7[_0x52bc('0x10')]){if(_0x5413b7[_0x52bc('0x10')]['code']===0x1f4){logger[_0x52bc('0x10')]('MailServerIn,\x20%s,\x20%s',_0x4da223,_0x5413b7[_0x52bc('0x10')][_0x52bc('0x11')]);return _0x16c03f(_0x5413b7[_0x52bc('0x10')][_0x52bc('0x11')]);}logger[_0x52bc('0x10')](_0x52bc('0xc'),_0x4da223,_0x5413b7['error']['message']);return _0x3f85aa(_0x5413b7[_0x52bc('0x10')]['message']);}else{logger[_0x52bc('0x12')]('MailServerIn,\x20%s,\x20%s',_0x4da223,_0x52bc('0xd'));_0x3f85aa(_0x5413b7[_0x52bc('0x13')]['message']);}})[_0x52bc('0x14')](function(_0xe0f5aa){logger[_0x52bc('0x10')](_0x52bc('0xc'),_0x4da223,_0xe0f5aa);_0x16c03f(_0xe0f5aa);});});}exports['GetMailServerIn']=function(_0x17d78b){var _0x2314ff=this;return new Promise(function(_0x14ee4b,_0x1a528e){return db[_0x52bc('0x15')][_0x52bc('0x16')]({'raw':_0x17d78b[_0x52bc('0x17')]?_0x17d78b[_0x52bc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x17d78b[_0x52bc('0x17')]?_0x17d78b[_0x52bc('0x17')][_0x52bc('0x18')]||null:null,'attributes':_0x17d78b[_0x52bc('0x17')]?_0x17d78b['options']['attributes']||null:null,'limit':_0x17d78b['options']?_0x17d78b[_0x52bc('0x17')]['limit']||null:null,'include':_0x17d78b[_0x52bc('0x17')]?_0x17d78b[_0x52bc('0x17')][_0x52bc('0x19')]?_[_0x52bc('0x1a')](_0x17d78b['options'][_0x52bc('0x19')],function(_0x380197){return{'model':db[_0x380197[_0x52bc('0x1b')]],'as':_0x380197['as'],'attributes':_0x380197[_0x52bc('0x1c')],'include':_0x380197['include']?_[_0x52bc('0x1a')](_0x380197[_0x52bc('0x19')],function(_0x59200d){return{'model':db[_0x59200d[_0x52bc('0x1b')]],'as':_0x59200d['as'],'attributes':_0x59200d[_0x52bc('0x1c')],'include':_0x59200d[_0x52bc('0x19')]?_[_0x52bc('0x1a')](_0x59200d[_0x52bc('0x19')],function(_0x13b7c6){return{'model':db[_0x13b7c6[_0x52bc('0x1b')]],'as':_0x13b7c6['as'],'attributes':_0x13b7c6[_0x52bc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x52bc('0xb')](function(_0x5c89f9){logger[_0x52bc('0x12')]('GetMailServerIn',_0x17d78b);logger[_0x52bc('0x1d')](_0x52bc('0x1e'),_0x17d78b,JSON[_0x52bc('0xf')](_0x5c89f9));_0x14ee4b(_0x5c89f9);})[_0x52bc('0x14')](function(_0x5518ef){logger[_0x52bc('0x10')](_0x52bc('0x1e'),_0x5518ef[_0x52bc('0x11')],_0x17d78b);_0x1a528e(_0x2314ff['error'](0x1f4,_0x5518ef[_0x52bc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 87662ca..8878632 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(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7a54,0x106));var _0x47a5=function(_0x187314,_0x41f2b2){_0x187314=_0x187314-0x0;var _0x1e1c24=_0x7a54[_0x187314];return _0x1e1c24;};'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 _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(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x7a54,0x106));var _0x47a5=function(_0x34d427,_0x375f4c){_0x34d427=_0x34d427-0x0;var _0x58479c=_0x7a54[_0x34d427];return _0x58479c;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 184a888..7bc09b5 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 _0x28f2=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0xe2409,_0x2dc202){var _0x54b706=function(_0xcdc872){while(--_0xcdc872){_0xe2409['push'](_0xe2409['shift']());}};_0x54b706(++_0x2dc202);}(_0x28f2,0x193));var _0x228f=function(_0x136af2,_0x29531b){_0x136af2=_0x136af2-0x0;var _0x5bbf3d=_0x28f2[_0x136af2];return _0x5bbf3d;};'use strict';var Sequelize=require(_0x228f('0x0'));module[_0x228f('0x1')]={'description':{'type':Sequelize[_0x228f('0x2')]},'host':{'type':Sequelize[_0x228f('0x2')]},'user':{'type':Sequelize[_0x228f('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x228f('0x3')]},'secure':{'type':Sequelize[_0x228f('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x228f('0x2')]},'authentication':{'type':Sequelize[_0x228f('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x228f('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x96cc=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x19201b,_0x216e48){var _0x2a13e2=function(_0x35112f){while(--_0x35112f){_0x19201b['push'](_0x19201b['shift']());}};_0x2a13e2(++_0x216e48);}(_0x96cc,0x16c));var _0xc96c=function(_0x3b6b2b,_0x4965d7){_0x3b6b2b=_0x3b6b2b-0x0;var _0x225076=_0x96cc[_0x3b6b2b];return _0x225076;};'use strict';var Sequelize=require(_0xc96c('0x0'));module['exports']={'description':{'type':Sequelize[_0xc96c('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xc96c('0x1')]},'pass':{'type':Sequelize[_0xc96c('0x1')]},'port':{'type':Sequelize[_0xc96c('0x2')]},'secure':{'type':Sequelize[_0xc96c('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xc96c('0x1')]},'authentication':{'type':Sequelize[_0xc96c('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xc96c('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 6e3094e..1b664c2 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 _0x468a=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','stack','name','map','MailServerOut','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x39df83,_0x4aa143){var _0x3ff770=function(_0x1cfe39){while(--_0x1cfe39){_0x39df83['push'](_0x39df83['shift']());}};_0x3ff770(++_0x4aa143);}(_0x468a,0x16e));var _0xa468=function(_0x38e7db,_0x2e39b7){_0x38e7db=_0x38e7db-0x0;var _0x4c0517=_0x468a[_0x38e7db];return _0x4c0517;};'use strict';var emlformat=require(_0xa468('0x0'));var rimraf=require(_0xa468('0x1'));var zipdir=require(_0xa468('0x2'));var jsonpatch=require(_0xa468('0x3'));var rp=require('request-promise');var moment=require(_0xa468('0x4'));var BPromise=require(_0xa468('0x5'));var Mustache=require(_0xa468('0x6'));var util=require(_0xa468('0x7'));var path=require(_0xa468('0x8'));var sox=require(_0xa468('0x9'));var csv=require(_0xa468('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa468('0xb'));var _=require(_0xa468('0xc'));var squel=require(_0xa468('0xd'));var crypto=require(_0xa468('0xe'));var jsforce=require(_0xa468('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa468('0xa'));var querystring=require('querystring');var Papa=require(_0xa468('0x10'));var Redis=require(_0xa468('0x11'));var authService=require(_0xa468('0x12'));var qs=require(_0xa468('0x13'));var as=require(_0xa468('0x14'));var hardwareService=require(_0xa468('0x15'));var logger=require(_0xa468('0x16'))(_0xa468('0x17'));var utils=require(_0xa468('0x18'));var config=require(_0xa468('0x19'));var licenseUtil=require(_0xa468('0x1a'));var db=require(_0xa468('0x1b'))['db'];function respondWithStatusCode(_0x1c5f68,_0x598233){_0x598233=_0x598233||0xcc;return function(_0x582791){if(_0x582791){return _0x1c5f68[_0xa468('0x1c')](_0x598233);}return _0x1c5f68[_0xa468('0x1d')](_0x598233)[_0xa468('0x1e')]();};}function respondWithResult(_0x1ff484,_0xf1fa03){_0xf1fa03=_0xf1fa03||0xc8;return function(_0x1c96c7){if(_0x1c96c7){return _0x1ff484[_0xa468('0x1d')](_0xf1fa03)[_0xa468('0x1f')](_0x1c96c7);}};}function respondWithFilteredResult(_0x34abe2,_0xf44b0a){return function(_0x1dd0d3){if(_0x1dd0d3){var _0x4474d1=typeof _0xf44b0a['offset']===_0xa468('0x20')&&typeof _0xf44b0a[_0xa468('0x21')]==='undefined';var _0x168e3a=_0x1dd0d3['count'];var _0x346265=_0x4474d1?0x0:_0xf44b0a['offset'];var _0x1b4f4a=_0x4474d1?_0x1dd0d3[_0xa468('0x22')]:_0xf44b0a[_0xa468('0x23')]+_0xf44b0a[_0xa468('0x21')];var _0x1eb699;if(_0x1b4f4a>=_0x168e3a){_0x1b4f4a=_0x168e3a;_0x1eb699=0xc8;}else{_0x1eb699=0xce;}_0x34abe2[_0xa468('0x1d')](_0x1eb699);return _0x34abe2[_0xa468('0x24')]('Content-Range',_0x346265+'-'+_0x1b4f4a+'/'+_0x168e3a)[_0xa468('0x1f')](_0x1dd0d3);}return null;};}function patchUpdates(_0x31a994){return function(_0x58f70e){try{jsonpatch[_0xa468('0x25')](_0x58f70e,_0x31a994,!![]);}catch(_0x594706){return BPromise[_0xa468('0x26')](_0x594706);}return _0x58f70e['save']();};}function saveUpdates(_0x3fe55c,_0x599a85){return function(_0x80e5b9){if(_0x80e5b9){return _0x80e5b9[_0xa468('0x27')](_0x3fe55c)['then'](function(_0x20ae8c){return _0x20ae8c;});}return null;};}function removeEntity(_0x169e2f,_0xc81fa){return function(_0x3aa911){if(_0x3aa911){return _0x3aa911['destroy']()[_0xa468('0x28')](function(){_0x169e2f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f4a21,_0x1a42bb){return function(_0x6634ae){if(!_0x6634ae){_0x5f4a21['sendStatus'](0x194);}return _0x6634ae;};}function handleError(_0x1dc209,_0x2c6d95){_0x2c6d95=_0x2c6d95||0x1f4;return function(_0x9c39dd){logger['error'](_0x9c39dd[_0xa468('0x29')]);if(_0x9c39dd['name']){delete _0x9c39dd[_0xa468('0x2a')];}_0x1dc209[_0xa468('0x1d')](_0x2c6d95)['send'](_0x9c39dd);};}exports['index']=function(_0x3b1914,_0x5ba5f7){var _0x2b6f95={},_0xa92fde={},_0x452717={'count':0x0,'rows':[]};var _0x9fe883=_[_0xa468('0x2b')](db[_0xa468('0x2c')][_0xa468('0x2d')],function(_0x37d0ee){return{'name':_0x37d0ee['fieldName'],'type':_0x37d0ee[_0xa468('0x2e')][_0xa468('0x2f')]};});_0xa92fde[_0xa468('0x30')]=_['map'](_0x9fe883,_0xa468('0x2a'));_0xa92fde[_0xa468('0x31')]=_[_0xa468('0x32')](_0x3b1914[_0xa468('0x31')]);_0xa92fde[_0xa468('0x33')]=_['intersection'](_0xa92fde[_0xa468('0x30')],_0xa92fde[_0xa468('0x31')]);_0x2b6f95[_0xa468('0x34')]=_[_0xa468('0x35')](_0xa92fde['model'],qs[_0xa468('0x36')](_0x3b1914[_0xa468('0x31')][_0xa468('0x36')]));_0x2b6f95[_0xa468('0x34')]=_0x2b6f95['attributes'][_0xa468('0x37')]?_0x2b6f95[_0xa468('0x34')]:_0xa92fde[_0xa468('0x30')];if(!_0x3b1914[_0xa468('0x31')][_0xa468('0x38')](_0xa468('0x39'))){_0x2b6f95[_0xa468('0x21')]=qs['limit'](_0x3b1914[_0xa468('0x31')][_0xa468('0x21')]);_0x2b6f95[_0xa468('0x23')]=qs['offset'](_0x3b1914[_0xa468('0x31')][_0xa468('0x23')]);}_0x2b6f95[_0xa468('0x3a')]=qs[_0xa468('0x3b')](_0x3b1914[_0xa468('0x31')]['sort']);_0x2b6f95[_0xa468('0x3c')]=qs[_0xa468('0x33')](_['pick'](_0x3b1914[_0xa468('0x31')],_0xa92fde['filters']),_0x9fe883);if(_0x3b1914[_0xa468('0x31')]['filter']){_0x2b6f95[_0xa468('0x3c')]=_[_0xa468('0x3d')](_0x2b6f95[_0xa468('0x3c')],{'$or':_['map'](_0x9fe883,function(_0x3308ee){if(_0x3308ee[_0xa468('0x2e')]!=='VIRTUAL'){var _0x4f00aa={};_0x4f00aa[_0x3308ee['name']]={'$like':'%'+_0x3b1914[_0xa468('0x31')][_0xa468('0x3e')]+'%'};return _0x4f00aa;}})});}_0x2b6f95=_[_0xa468('0x3d')]({},_0x2b6f95,_0x3b1914[_0xa468('0x3f')]);var _0x47d1bf={'where':_0x2b6f95[_0xa468('0x3c')]};return db['MailServerOut'][_0xa468('0x22')](_0x47d1bf)[_0xa468('0x28')](function(_0x10914f){_0x452717[_0xa468('0x22')]=_0x10914f;if(_0x3b1914[_0xa468('0x31')]['includeAll']){_0x2b6f95[_0xa468('0x40')]=[{'all':!![]}];}return db[_0xa468('0x2c')][_0xa468('0x41')](_0x2b6f95);})[_0xa468('0x28')](function(_0x55eaa6){_0x452717[_0xa468('0x42')]=_0x55eaa6;return _0x452717;})[_0xa468('0x28')](respondWithFilteredResult(_0x5ba5f7,_0x2b6f95))[_0xa468('0x43')](handleError(_0x5ba5f7,null));};exports['show']=function(_0x27d0ab,_0x4183db){var _0xb68502={'raw':!![],'where':{'id':_0x27d0ab[_0xa468('0x44')]['id']}},_0x59dba6={};_0x59dba6[_0xa468('0x30')]=_['keys'](db[_0xa468('0x2c')][_0xa468('0x2d')]);_0x59dba6[_0xa468('0x31')]=_[_0xa468('0x32')](_0x27d0ab[_0xa468('0x31')]);_0x59dba6[_0xa468('0x33')]=_[_0xa468('0x35')](_0x59dba6['model'],_0x59dba6[_0xa468('0x31')]);_0xb68502['attributes']=_['intersection'](_0x59dba6[_0xa468('0x30')],qs[_0xa468('0x36')](_0x27d0ab[_0xa468('0x31')][_0xa468('0x36')]));_0xb68502[_0xa468('0x34')]=_0xb68502['attributes']['length']?_0xb68502['attributes']:_0x59dba6[_0xa468('0x30')];if(_0x27d0ab['query'][_0xa468('0x45')]){_0xb68502['include']=[{'all':!![]}];}_0xb68502=_['merge']({},_0xb68502,_0x27d0ab[_0xa468('0x3f')]);return db['MailServerOut'][_0xa468('0x46')](_0xb68502)[_0xa468('0x28')](handleEntityNotFound(_0x4183db,null))['then'](respondWithResult(_0x4183db,null))[_0xa468('0x43')](handleError(_0x4183db,null));};exports[_0xa468('0x47')]=function(_0x2d2edb,_0x103238){return db['MailServerOut'][_0xa468('0x47')](_0x2d2edb['body'],{})['then'](respondWithResult(_0x103238,0xc9))[_0xa468('0x43')](handleError(_0x103238,null));};exports[_0xa468('0x27')]=function(_0x5b027f,_0x446139){if(_0x5b027f[_0xa468('0x48')]['id']){delete _0x5b027f[_0xa468('0x48')]['id'];}return db[_0xa468('0x2c')][_0xa468('0x46')]({'where':{'id':_0x5b027f['params']['id']}})[_0xa468('0x28')](handleEntityNotFound(_0x446139,null))[_0xa468('0x28')](saveUpdates(_0x5b027f[_0xa468('0x48')],null))[_0xa468('0x28')](respondWithResult(_0x446139,null))['catch'](handleError(_0x446139,null));};exports[_0xa468('0x49')]=function(_0x4a3170,_0x34923f){return db['MailServerOut'][_0xa468('0x46')]({'where':{'id':_0x4a3170['params']['id']}})[_0xa468('0x28')](handleEntityNotFound(_0x34923f,null))[_0xa468('0x28')](removeEntity(_0x34923f,null))[_0xa468('0x43')](handleError(_0x34923f,null));}; \ No newline at end of file +var _0x2db9=['nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','rawAttributes','intersection','length','create','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','MailServerOut','fieldName','key','model','query','keys','filters','attributes','fields'];(function(_0x452e33,_0x11369d){var _0x1f433b=function(_0x462ecd){while(--_0x462ecd){_0x452e33['push'](_0x452e33['shift']());}};_0x1f433b(++_0x11369d);}(_0x2db9,0x188));var _0x92db=function(_0x44b9ae,_0x528cdd){_0x44b9ae=_0x44b9ae-0x0;var _0x83fb06=_0x2db9[_0x44b9ae];return _0x83fb06;};'use strict';var emlformat=require(_0x92db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92db('0x1'));var jsonpatch=require(_0x92db('0x2'));var rp=require(_0x92db('0x3'));var moment=require(_0x92db('0x4'));var BPromise=require(_0x92db('0x5'));var Mustache=require(_0x92db('0x6'));var util=require(_0x92db('0x7'));var path=require(_0x92db('0x8'));var sox=require(_0x92db('0x9'));var csv=require('to-csv');var ejs=require(_0x92db('0xa'));var fs=require('fs');var fs_extra=require(_0x92db('0xb'));var _=require(_0x92db('0xc'));var squel=require(_0x92db('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x92db('0xe'));var toCsv=require('to-csv');var querystring=require(_0x92db('0xf'));var Papa=require(_0x92db('0x10'));var Redis=require('ioredis');var authService=require(_0x92db('0x11'));var qs=require(_0x92db('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92db('0x13'));var logger=require(_0x92db('0x14'))(_0x92db('0x15'));var utils=require(_0x92db('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x92db('0x17'))['db'];function respondWithStatusCode(_0x525480,_0x2a84f3){_0x2a84f3=_0x2a84f3||0xcc;return function(_0x34088a){if(_0x34088a){return _0x525480[_0x92db('0x18')](_0x2a84f3);}return _0x525480['status'](_0x2a84f3)[_0x92db('0x19')]();};}function respondWithResult(_0x31122c,_0x8c35f4){_0x8c35f4=_0x8c35f4||0xc8;return function(_0x102d7b){if(_0x102d7b){return _0x31122c[_0x92db('0x1a')](_0x8c35f4)[_0x92db('0x1b')](_0x102d7b);}};}function respondWithFilteredResult(_0x4223f9,_0x1c83c1){return function(_0x251072){if(_0x251072){var _0x499a2b=typeof _0x1c83c1['offset']===_0x92db('0x1c')&&typeof _0x1c83c1[_0x92db('0x1d')]===_0x92db('0x1c');var _0xbc6a58=_0x251072['count'];var _0x48747e=_0x499a2b?0x0:_0x1c83c1[_0x92db('0x1e')];var _0x260bc9=_0x499a2b?_0x251072['count']:_0x1c83c1['offset']+_0x1c83c1[_0x92db('0x1d')];var _0x526912;if(_0x260bc9>=_0xbc6a58){_0x260bc9=_0xbc6a58;_0x526912=0xc8;}else{_0x526912=0xce;}_0x4223f9[_0x92db('0x1a')](_0x526912);return _0x4223f9[_0x92db('0x1f')](_0x92db('0x20'),_0x48747e+'-'+_0x260bc9+'/'+_0xbc6a58)['json'](_0x251072);}return null;};}function patchUpdates(_0x55a763){return function(_0x18bad5){try{jsonpatch[_0x92db('0x21')](_0x18bad5,_0x55a763,!![]);}catch(_0x3ad61a){return BPromise[_0x92db('0x22')](_0x3ad61a);}return _0x18bad5[_0x92db('0x23')]();};}function saveUpdates(_0x310871,_0x192d8e){return function(_0x49e4de){if(_0x49e4de){return _0x49e4de[_0x92db('0x24')](_0x310871)[_0x92db('0x25')](function(_0x45ddcc){return _0x45ddcc;});}return null;};}function removeEntity(_0x1d74fd,_0x4705b1){return function(_0x2a191e){if(_0x2a191e){return _0x2a191e[_0x92db('0x26')]()[_0x92db('0x25')](function(){_0x1d74fd[_0x92db('0x1a')](0xcc)[_0x92db('0x19')]();});}};}function handleEntityNotFound(_0x2d4cb2,_0x46c6dc){return function(_0x2e21c1){if(!_0x2e21c1){_0x2d4cb2[_0x92db('0x18')](0x194);}return _0x2e21c1;};}function handleError(_0x17c15b,_0x269666){_0x269666=_0x269666||0x1f4;return function(_0x2fe693){logger['error'](_0x2fe693['stack']);if(_0x2fe693['name']){delete _0x2fe693[_0x92db('0x27')];}_0x17c15b[_0x92db('0x1a')](_0x269666)[_0x92db('0x28')](_0x2fe693);};}exports[_0x92db('0x29')]=function(_0x5f58c3,_0x5250e8){var _0x20ffc6={},_0x95f61d={},_0x544c22={'count':0x0,'rows':[]};var _0x1e5cb6=_[_0x92db('0x2a')](db[_0x92db('0x2b')]['rawAttributes'],function(_0x201c00){return{'name':_0x201c00[_0x92db('0x2c')],'type':_0x201c00['type'][_0x92db('0x2d')]};});_0x95f61d[_0x92db('0x2e')]=_[_0x92db('0x2a')](_0x1e5cb6,_0x92db('0x27'));_0x95f61d[_0x92db('0x2f')]=_[_0x92db('0x30')](_0x5f58c3[_0x92db('0x2f')]);_0x95f61d[_0x92db('0x31')]=_['intersection'](_0x95f61d['model'],_0x95f61d[_0x92db('0x2f')]);_0x20ffc6[_0x92db('0x32')]=_['intersection'](_0x95f61d[_0x92db('0x2e')],qs[_0x92db('0x33')](_0x5f58c3['query'][_0x92db('0x33')]));_0x20ffc6['attributes']=_0x20ffc6[_0x92db('0x32')]['length']?_0x20ffc6['attributes']:_0x95f61d['model'];if(!_0x5f58c3[_0x92db('0x2f')]['hasOwnProperty'](_0x92db('0x34'))){_0x20ffc6[_0x92db('0x1d')]=qs[_0x92db('0x1d')](_0x5f58c3[_0x92db('0x2f')][_0x92db('0x1d')]);_0x20ffc6['offset']=qs[_0x92db('0x1e')](_0x5f58c3[_0x92db('0x2f')]['offset']);}_0x20ffc6[_0x92db('0x35')]=qs[_0x92db('0x36')](_0x5f58c3[_0x92db('0x2f')][_0x92db('0x36')]);_0x20ffc6[_0x92db('0x37')]=qs['filters'](_[_0x92db('0x38')](_0x5f58c3[_0x92db('0x2f')],_0x95f61d[_0x92db('0x31')]),_0x1e5cb6);if(_0x5f58c3['query']['filter']){_0x20ffc6[_0x92db('0x37')]=_[_0x92db('0x39')](_0x20ffc6['where'],{'$or':_['map'](_0x1e5cb6,function(_0x4d2f36){if(_0x4d2f36[_0x92db('0x3a')]!==_0x92db('0x3b')){var _0x597a1e={};_0x597a1e[_0x4d2f36['name']]={'$like':'%'+_0x5f58c3[_0x92db('0x2f')][_0x92db('0x3c')]+'%'};return _0x597a1e;}})});}_0x20ffc6=_['merge']({},_0x20ffc6,_0x5f58c3['options']);var _0x2b98f8={'where':_0x20ffc6[_0x92db('0x37')]};return db[_0x92db('0x2b')][_0x92db('0x3d')](_0x2b98f8)[_0x92db('0x25')](function(_0x10d08b){_0x544c22[_0x92db('0x3d')]=_0x10d08b;if(_0x5f58c3[_0x92db('0x2f')][_0x92db('0x3e')]){_0x20ffc6[_0x92db('0x3f')]=[{'all':!![]}];}return db[_0x92db('0x2b')][_0x92db('0x40')](_0x20ffc6);})['then'](function(_0x311315){_0x544c22[_0x92db('0x41')]=_0x311315;return _0x544c22;})[_0x92db('0x25')](respondWithFilteredResult(_0x5250e8,_0x20ffc6))[_0x92db('0x42')](handleError(_0x5250e8,null));};exports['show']=function(_0x1a1c3b,_0x36f2ee){var _0x24a422={'raw':!![],'where':{'id':_0x1a1c3b['params']['id']}},_0x2aa953={};_0x2aa953[_0x92db('0x2e')]=_[_0x92db('0x30')](db[_0x92db('0x2b')][_0x92db('0x43')]);_0x2aa953[_0x92db('0x2f')]=_['keys'](_0x1a1c3b[_0x92db('0x2f')]);_0x2aa953[_0x92db('0x31')]=_[_0x92db('0x44')](_0x2aa953[_0x92db('0x2e')],_0x2aa953[_0x92db('0x2f')]);_0x24a422[_0x92db('0x32')]=_[_0x92db('0x44')](_0x2aa953[_0x92db('0x2e')],qs[_0x92db('0x33')](_0x1a1c3b['query'][_0x92db('0x33')]));_0x24a422['attributes']=_0x24a422[_0x92db('0x32')][_0x92db('0x45')]?_0x24a422[_0x92db('0x32')]:_0x2aa953[_0x92db('0x2e')];if(_0x1a1c3b[_0x92db('0x2f')][_0x92db('0x3e')]){_0x24a422[_0x92db('0x3f')]=[{'all':!![]}];}_0x24a422=_[_0x92db('0x39')]({},_0x24a422,_0x1a1c3b['options']);return db[_0x92db('0x2b')]['find'](_0x24a422)[_0x92db('0x25')](handleEntityNotFound(_0x36f2ee,null))[_0x92db('0x25')](respondWithResult(_0x36f2ee,null))[_0x92db('0x42')](handleError(_0x36f2ee,null));};exports[_0x92db('0x46')]=function(_0x280c0f,_0x32b540){return db[_0x92db('0x2b')]['create'](_0x280c0f[_0x92db('0x47')],{})['then'](respondWithResult(_0x32b540,0xc9))[_0x92db('0x42')](handleError(_0x32b540,null));};exports[_0x92db('0x24')]=function(_0x4856f5,_0x14b1f9){if(_0x4856f5[_0x92db('0x47')]['id']){delete _0x4856f5[_0x92db('0x47')]['id'];}return db[_0x92db('0x2b')][_0x92db('0x48')]({'where':{'id':_0x4856f5[_0x92db('0x49')]['id']}})[_0x92db('0x25')](handleEntityNotFound(_0x14b1f9,null))[_0x92db('0x25')](saveUpdates(_0x4856f5[_0x92db('0x47')],null))[_0x92db('0x25')](respondWithResult(_0x14b1f9,null))[_0x92db('0x42')](handleError(_0x14b1f9,null));};exports['destroy']=function(_0x56c909,_0x58b385){return db[_0x92db('0x2b')][_0x92db('0x48')]({'where':{'id':_0x56c909[_0x92db('0x49')]['id']}})[_0x92db('0x25')](handleEntityNotFound(_0x58b385,null))['then'](removeEntity(_0x58b385,null))[_0x92db('0x42')](handleError(_0x58b385,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index d934f80..f08e4af 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 _0x5be5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MailServerOut','mail_servers_out','util','../../config/logger','api'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x5be5,0x1b9));var _0x55be=function(_0x427cce,_0x718314){_0x427cce=_0x427cce-0x0;var _0x283078=_0x5be5[_0x427cce];return _0x283078;};'use strict';var _=require('lodash');var util=require(_0x55be('0x0'));var logger=require(_0x55be('0x1'))(_0x55be('0x2'));var moment=require(_0x55be('0x3'));var BPromise=require(_0x55be('0x4'));var rp=require(_0x55be('0x5'));var fs=require('fs');var path=require(_0x55be('0x6'));var rimraf=require(_0x55be('0x7'));var config=require(_0x55be('0x8'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x4e6a46,_0x9800ca){return _0x4e6a46[_0x55be('0x9')](_0x55be('0xa'),attributes,{'tableName':_0x55be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d8d=['moment','bluebird','request-promise','rimraf','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','util','api'];(function(_0x549cef,_0x1c6fbe){var _0x3a30a1=function(_0x1cbc74){while(--_0x1cbc74){_0x549cef['push'](_0x549cef['shift']());}};_0x3a30a1(++_0x1c6fbe);}(_0x1d8d,0x147));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd1d8('0x0'));var util=require(_0xd1d8('0x1'));var logger=require('../../config/logger')(_0xd1d8('0x2'));var moment=require(_0xd1d8('0x3'));var BPromise=require(_0xd1d8('0x4'));var rp=require(_0xd1d8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1d8('0x6'));var config=require('../../config/environment');var attributes=require(_0xd1d8('0x7'));module[_0xd1d8('0x8')]=function(_0x4e38d1,_0x273235){return _0x4e38d1['define'](_0xd1d8('0x9'),attributes,{'tableName':_0xd1d8('0xa'),'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 c8aa98f..455cb49 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x14a39e,_0x2f0be7){_0x14a39e=_0x14a39e-0x0;var _0x4dc22c=_0x7a54[_0x14a39e];return _0x4dc22c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x539b86,_0x47d9e8){var _0x160228=function(_0x4d41a5){while(--_0x4d41a5){_0x539b86['push'](_0x539b86['shift']());}};_0x160228(++_0x47d9e8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18292e,_0x196689){_0x18292e=_0x18292e-0x0;var _0x1f7c24=_0x5f2f[_0x18292e];return _0x1f7c24;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 5a5bf8d..4dca58c 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 _0x19ca=['post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x12309b,_0x59dd8c){var _0x482e4d=function(_0x308407){while(--_0x308407){_0x12309b['push'](_0x12309b['shift']());}};_0x482e4d(++_0x59dd8c);}(_0x19ca,0xcb));var _0xa19c=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x19ca[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0xa19c('0x0'));var util=require(_0xa19c('0x1'));var path=require(_0xa19c('0x2'));var timeout=require(_0xa19c('0x3'));var express=require(_0xa19c('0x4'));var router=express[_0xa19c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa19c('0x6'));var interaction=require(_0xa19c('0x7'));var config=require(_0xa19c('0x8'));var controller=require(_0xa19c('0x9'));router['get']('/',auth[_0xa19c('0xa')](),controller[_0xa19c('0xb')]);router[_0xa19c('0xc')](_0xa19c('0xd'),auth[_0xa19c('0xa')](),controller[_0xa19c('0xe')]);router[_0xa19c('0xc')](_0xa19c('0xf'),auth['isAuthenticated'](),controller[_0xa19c('0x10')]);router[_0xa19c('0x11')]('/',auth[_0xa19c('0xa')](),controller[_0xa19c('0x12')]);router['put'](_0xa19c('0xf'),auth[_0xa19c('0xa')](),controller[_0xa19c('0x13')]);router['delete'](_0xa19c('0xf'),auth[_0xa19c('0xa')](),controller[_0xa19c('0x14')]);module[_0xa19c('0x15')]=router; \ No newline at end of file +var _0xe277=['isAuthenticated','get','/describe','/:id','show','create','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailSubstatus.controller'];(function(_0x2c6ed7,_0x165312){var _0x34b3a0=function(_0x52201f){while(--_0x52201f){_0x2c6ed7['push'](_0x2c6ed7['shift']());}};_0x34b3a0(++_0x165312);}(_0xe277,0xd5));var _0x7e27=function(_0xe9289a,_0x429361){_0xe9289a=_0xe9289a-0x0;var _0x4c056f=_0xe277[_0xe9289a];return _0x4c056f;};'use strict';var multer=require('multer');var util=require(_0x7e27('0x0'));var path=require(_0x7e27('0x1'));var timeout=require(_0x7e27('0x2'));var express=require(_0x7e27('0x3'));var router=express[_0x7e27('0x4')]();var fs_extra=require(_0x7e27('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7e27('0x6'));var controller=require(_0x7e27('0x7'));router['get']('/',auth[_0x7e27('0x8')](),controller['index']);router[_0x7e27('0x9')](_0x7e27('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x7e27('0xb'),auth[_0x7e27('0x8')](),controller[_0x7e27('0xc')]);router['post']('/',auth[_0x7e27('0x8')](),controller[_0x7e27('0xd')]);router[_0x7e27('0xe')](_0x7e27('0xb'),auth[_0x7e27('0x8')](),controller['update']);router['delete']('/:id',auth[_0x7e27('0x8')](),controller[_0x7e27('0xf')]);module[_0x7e27('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 1fa53c4..3a8834e 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 _0x02a7=['exports','STRING'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0x02a7,0x7a));var _0x702a=function(_0x2ead68,_0x7c1d09){_0x2ead68=_0x2ead68-0x0;var _0x25d046=_0x02a7[_0x2ead68];return _0x25d046;};'use strict';var Sequelize=require('sequelize');module[_0x702a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x702a('0x1')]}}; \ No newline at end of file +var _0x6657=['STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6657,0x17f));var _0x7665=function(_0x10a5a7,_0x241ba8){_0x10a5a7=_0x10a5a7-0x0;var _0x402f69=_0x6657[_0x10a5a7];return _0x402f69;};'use strict';var Sequelize=require(_0x7665('0x0'));module['exports']={'name':{'type':Sequelize[_0x7665('0x1')],'unique':_0x7665('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7665('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 7488cb4..31e5c71 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 _0x329d=['squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','catch','create','body','params','find','describe','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5026ee,_0x50af2c){var _0x516b21=function(_0x8dbab7){while(--_0x8dbab7){_0x5026ee['push'](_0x5026ee['shift']());}};_0x516b21(++_0x50af2c);}(_0x329d,0x8b));var _0xd329=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0x329d[_0x2f87cd];return _0x5d7eda;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd329('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd329('0x1'));var BPromise=require(_0xd329('0x2'));var Mustache=require(_0xd329('0x3'));var util=require(_0xd329('0x4'));var path=require(_0xd329('0x5'));var sox=require(_0xd329('0x6'));var csv=require(_0xd329('0x7'));var ejs=require(_0xd329('0x8'));var fs=require('fs');var fs_extra=require(_0xd329('0x9'));var _=require(_0xd329('0xa'));var squel=require(_0xd329('0xb'));var crypto=require('crypto');var jsforce=require(_0xd329('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd329('0x7'));var querystring=require(_0xd329('0xd'));var Papa=require('papaparse');var Redis=require(_0xd329('0xe'));var authService=require(_0xd329('0xf'));var qs=require(_0xd329('0x10'));var as=require(_0xd329('0x11'));var hardwareService=require(_0xd329('0x12'));var logger=require('../../config/logger')(_0xd329('0x13'));var utils=require(_0xd329('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd329('0x15'));var db=require(_0xd329('0x16'))['db'];function respondWithStatusCode(_0x14cd05,_0x5bb30f){_0x5bb30f=_0x5bb30f||0xcc;return function(_0x4f20f7){if(_0x4f20f7){return _0x14cd05['sendStatus'](_0x5bb30f);}return _0x14cd05['status'](_0x5bb30f)[_0xd329('0x17')]();};}function respondWithResult(_0x470902,_0x2c240d){_0x2c240d=_0x2c240d||0xc8;return function(_0x178ef3){if(_0x178ef3){return _0x470902[_0xd329('0x18')](_0x2c240d)[_0xd329('0x19')](_0x178ef3);}};}function respondWithFilteredResult(_0x467c5a,_0x245820){return function(_0x2ae502){if(_0x2ae502){var _0x4a6b31=typeof _0x245820[_0xd329('0x1a')]===_0xd329('0x1b')&&typeof _0x245820[_0xd329('0x1c')]==='undefined';var _0x45bbd4=_0x2ae502[_0xd329('0x1d')];var _0x3528b4=_0x4a6b31?0x0:_0x245820[_0xd329('0x1a')];var _0xa4ed1=_0x4a6b31?_0x2ae502[_0xd329('0x1d')]:_0x245820['offset']+_0x245820[_0xd329('0x1c')];var _0x487acd;if(_0xa4ed1>=_0x45bbd4){_0xa4ed1=_0x45bbd4;_0x487acd=0xc8;}else{_0x487acd=0xce;}_0x467c5a[_0xd329('0x18')](_0x487acd);return _0x467c5a[_0xd329('0x1e')](_0xd329('0x1f'),_0x3528b4+'-'+_0xa4ed1+'/'+_0x45bbd4)[_0xd329('0x19')](_0x2ae502);}return null;};}function patchUpdates(_0x447085){return function(_0x32e77e){try{jsonpatch[_0xd329('0x20')](_0x32e77e,_0x447085,!![]);}catch(_0x190c02){return BPromise[_0xd329('0x21')](_0x190c02);}return _0x32e77e[_0xd329('0x22')]();};}function saveUpdates(_0x553573,_0x141674){return function(_0x2d1578){if(_0x2d1578){return _0x2d1578[_0xd329('0x23')](_0x553573)[_0xd329('0x24')](function(_0x52be97){return _0x52be97;});}return null;};}function removeEntity(_0x31b79d,_0x5c3d24){return function(_0x4a76b8){if(_0x4a76b8){return _0x4a76b8[_0xd329('0x25')]()[_0xd329('0x24')](function(){_0x31b79d['status'](0xcc)[_0xd329('0x17')]();});}};}function handleEntityNotFound(_0x24fa3a,_0x424465){return function(_0x2911cf){if(!_0x2911cf){_0x24fa3a[_0xd329('0x26')](0x194);}return _0x2911cf;};}function handleError(_0x12b289,_0x4ef123){_0x4ef123=_0x4ef123||0x1f4;return function(_0x3ce66a){logger[_0xd329('0x27')](_0x3ce66a['stack']);if(_0x3ce66a[_0xd329('0x28')]){delete _0x3ce66a[_0xd329('0x28')];}_0x12b289['status'](_0x4ef123)[_0xd329('0x29')](_0x3ce66a);};}exports[_0xd329('0x2a')]=function(_0x4565d1,_0x3c6f63){var _0x2460f7={},_0x36c900={},_0x45c6be={'count':0x0,'rows':[]};var _0x53ebe7=_[_0xd329('0x2b')](db[_0xd329('0x2c')][_0xd329('0x2d')],function(_0x44a709){return{'name':_0x44a709[_0xd329('0x2e')],'type':_0x44a709[_0xd329('0x2f')]['key']};});_0x36c900['model']=_[_0xd329('0x2b')](_0x53ebe7,_0xd329('0x28'));_0x36c900[_0xd329('0x30')]=_[_0xd329('0x31')](_0x4565d1[_0xd329('0x30')]);_0x36c900[_0xd329('0x32')]=_[_0xd329('0x33')](_0x36c900[_0xd329('0x34')],_0x36c900['query']);_0x2460f7['attributes']=_['intersection'](_0x36c900[_0xd329('0x34')],qs['fields'](_0x4565d1[_0xd329('0x30')][_0xd329('0x35')]));_0x2460f7[_0xd329('0x36')]=_0x2460f7[_0xd329('0x36')][_0xd329('0x37')]?_0x2460f7['attributes']:_0x36c900['model'];if(!_0x4565d1[_0xd329('0x30')][_0xd329('0x38')](_0xd329('0x39'))){_0x2460f7[_0xd329('0x1c')]=qs[_0xd329('0x1c')](_0x4565d1['query'][_0xd329('0x1c')]);_0x2460f7[_0xd329('0x1a')]=qs[_0xd329('0x1a')](_0x4565d1[_0xd329('0x30')]['offset']);}_0x2460f7[_0xd329('0x3a')]=qs['sort'](_0x4565d1['query'][_0xd329('0x3b')]);_0x2460f7[_0xd329('0x3c')]=qs['filters'](_[_0xd329('0x3d')](_0x4565d1[_0xd329('0x30')],_0x36c900[_0xd329('0x32')]),_0x53ebe7);if(_0x4565d1['query'][_0xd329('0x3e')]){_0x2460f7['where']=_[_0xd329('0x3f')](_0x2460f7[_0xd329('0x3c')],{'$or':_[_0xd329('0x2b')](_0x53ebe7,function(_0x4ece9e){if(_0x4ece9e[_0xd329('0x2f')]!=='VIRTUAL'){var _0x19475f={};_0x19475f[_0x4ece9e[_0xd329('0x28')]]={'$like':'%'+_0x4565d1[_0xd329('0x30')][_0xd329('0x3e')]+'%'};return _0x19475f;}})});}_0x2460f7=_[_0xd329('0x3f')]({},_0x2460f7,_0x4565d1[_0xd329('0x40')]);var _0xf791b8={'where':_0x2460f7['where']};return db['MailSubstatus'][_0xd329('0x1d')](_0xf791b8)[_0xd329('0x24')](function(_0x1ad33a){_0x45c6be[_0xd329('0x1d')]=_0x1ad33a;if(_0x4565d1[_0xd329('0x30')][_0xd329('0x41')]){_0x2460f7[_0xd329('0x42')]=[{'all':!![]}];}return db[_0xd329('0x2c')]['findAll'](_0x2460f7);})[_0xd329('0x24')](function(_0x29641b){_0x45c6be[_0xd329('0x43')]=_0x29641b;return _0x45c6be;})['then'](respondWithFilteredResult(_0x3c6f63,_0x2460f7))['catch'](handleError(_0x3c6f63,null));};exports[_0xd329('0x44')]=function(_0x3b714e,_0x360db1){var _0x547a0={'raw':!![],'where':{'id':_0x3b714e['params']['id']}},_0x20bcb3={};_0x20bcb3[_0xd329('0x34')]=_[_0xd329('0x31')](db[_0xd329('0x2c')]['rawAttributes']);_0x20bcb3['query']=_['keys'](_0x3b714e['query']);_0x20bcb3['filters']=_[_0xd329('0x33')](_0x20bcb3['model'],_0x20bcb3[_0xd329('0x30')]);_0x547a0[_0xd329('0x36')]=_[_0xd329('0x33')](_0x20bcb3[_0xd329('0x34')],qs['fields'](_0x3b714e[_0xd329('0x30')][_0xd329('0x35')]));_0x547a0[_0xd329('0x36')]=_0x547a0[_0xd329('0x36')][_0xd329('0x37')]?_0x547a0[_0xd329('0x36')]:_0x20bcb3['model'];if(_0x3b714e[_0xd329('0x30')]['includeAll']){_0x547a0['include']=[{'all':!![]}];}_0x547a0=_['merge']({},_0x547a0,_0x3b714e['options']);return db[_0xd329('0x2c')]['find'](_0x547a0)[_0xd329('0x24')](handleEntityNotFound(_0x360db1,null))[_0xd329('0x24')](respondWithResult(_0x360db1,null))[_0xd329('0x45')](handleError(_0x360db1,null));};exports[_0xd329('0x46')]=function(_0x2bbc85,_0x18951f){return db[_0xd329('0x2c')][_0xd329('0x46')](_0x2bbc85[_0xd329('0x47')],{})[_0xd329('0x24')](respondWithResult(_0x18951f,0xc9))[_0xd329('0x45')](handleError(_0x18951f,null));};exports['update']=function(_0x303de5,_0x315194){if(_0x303de5[_0xd329('0x47')]['id']){delete _0x303de5[_0xd329('0x47')]['id'];}return db[_0xd329('0x2c')]['find']({'where':{'id':_0x303de5[_0xd329('0x48')]['id']}})[_0xd329('0x24')](handleEntityNotFound(_0x315194,null))['then'](saveUpdates(_0x303de5['body'],null))[_0xd329('0x24')](respondWithResult(_0x315194,null))[_0xd329('0x45')](handleError(_0x315194,null));};exports[_0xd329('0x25')]=function(_0x34ea15,_0x47559b){return db['MailSubstatus'][_0xd329('0x49')]({'where':{'id':_0x34ea15[_0xd329('0x48')]['id']}})[_0xd329('0x24')](handleEntityNotFound(_0x47559b,null))['then'](removeEntity(_0x47559b,null))['catch'](handleError(_0x47559b,null));};exports[_0xd329('0x4a')]=function(_0x1cc8bc,_0x67a3ee){return db[_0xd329('0x2c')]['describe']()['then'](respondWithResult(_0x67a3ee,null))[_0xd329('0x45')](handleError(_0x67a3ee,null));}; \ No newline at end of file +var _0x2300=['destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','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','Content-Range','apply','reject','update','then','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0x2300,0x94));var _0x0230=function(_0x42b0c3,_0x45b080){_0x42b0c3=_0x42b0c3-0x0;var _0x43f208=_0x2300[_0x42b0c3];return _0x43f208;};'use strict';var emlformat=require(_0x0230('0x0'));var rimraf=require(_0x0230('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0230('0x2'));var rp=require('request-promise');var moment=require(_0x0230('0x3'));var BPromise=require(_0x0230('0x4'));var Mustache=require('mustache');var util=require(_0x0230('0x5'));var path=require(_0x0230('0x6'));var sox=require(_0x0230('0x7'));var csv=require(_0x0230('0x8'));var ejs=require(_0x0230('0x9'));var fs=require('fs');var fs_extra=require(_0x0230('0xa'));var _=require(_0x0230('0xb'));var squel=require(_0x0230('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0230('0xd'));var toCsv=require(_0x0230('0x8'));var querystring=require(_0x0230('0xe'));var Papa=require('papaparse');var Redis=require(_0x0230('0xf'));var authService=require(_0x0230('0x10'));var qs=require(_0x0230('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0230('0x12'));var logger=require('../../config/logger')(_0x0230('0x13'));var utils=require(_0x0230('0x14'));var config=require(_0x0230('0x15'));var licenseUtil=require(_0x0230('0x16'));var db=require(_0x0230('0x17'))['db'];function respondWithStatusCode(_0x5af5b5,_0xe21139){_0xe21139=_0xe21139||0xcc;return function(_0x2dd1ba){if(_0x2dd1ba){return _0x5af5b5[_0x0230('0x18')](_0xe21139);}return _0x5af5b5[_0x0230('0x19')](_0xe21139)[_0x0230('0x1a')]();};}function respondWithResult(_0x4f400e,_0x570de6){_0x570de6=_0x570de6||0xc8;return function(_0x20e526){if(_0x20e526){return _0x4f400e['status'](_0x570de6)[_0x0230('0x1b')](_0x20e526);}};}function respondWithFilteredResult(_0x295d47,_0x47a0c1){return function(_0x4adc67){if(_0x4adc67){var _0x53e8ea=typeof _0x47a0c1['offset']===_0x0230('0x1c')&&typeof _0x47a0c1[_0x0230('0x1d')]==='undefined';var _0xd8e4e8=_0x4adc67[_0x0230('0x1e')];var _0x21dca5=_0x53e8ea?0x0:_0x47a0c1['offset'];var _0x41f5dc=_0x53e8ea?_0x4adc67[_0x0230('0x1e')]:_0x47a0c1[_0x0230('0x1f')]+_0x47a0c1['limit'];var _0x23ebbe;if(_0x41f5dc>=_0xd8e4e8){_0x41f5dc=_0xd8e4e8;_0x23ebbe=0xc8;}else{_0x23ebbe=0xce;}_0x295d47[_0x0230('0x19')](_0x23ebbe);return _0x295d47['set'](_0x0230('0x20'),_0x21dca5+'-'+_0x41f5dc+'/'+_0xd8e4e8)[_0x0230('0x1b')](_0x4adc67);}return null;};}function patchUpdates(_0x7d19c4){return function(_0x1d7e3c){try{jsonpatch[_0x0230('0x21')](_0x1d7e3c,_0x7d19c4,!![]);}catch(_0x2a9dee){return BPromise[_0x0230('0x22')](_0x2a9dee);}return _0x1d7e3c['save']();};}function saveUpdates(_0x3ab83f,_0x494ff8){return function(_0x58a537){if(_0x58a537){return _0x58a537[_0x0230('0x23')](_0x3ab83f)[_0x0230('0x24')](function(_0x1a2eed){return _0x1a2eed;});}return null;};}function removeEntity(_0x10e723,_0x35820e){return function(_0x1be678){if(_0x1be678){return _0x1be678['destroy']()[_0x0230('0x24')](function(){_0x10e723[_0x0230('0x19')](0xcc)[_0x0230('0x1a')]();});}};}function handleEntityNotFound(_0x4235c2,_0x202b50){return function(_0x54a408){if(!_0x54a408){_0x4235c2[_0x0230('0x18')](0x194);}return _0x54a408;};}function handleError(_0x42fa9a,_0x302f0d){_0x302f0d=_0x302f0d||0x1f4;return function(_0x7f4999){logger[_0x0230('0x25')](_0x7f4999[_0x0230('0x26')]);if(_0x7f4999[_0x0230('0x27')]){delete _0x7f4999[_0x0230('0x27')];}_0x42fa9a[_0x0230('0x19')](_0x302f0d)[_0x0230('0x28')](_0x7f4999);};}exports['index']=function(_0xb9634b,_0x1186ad){var _0x764506={},_0x41060d={},_0x36287b={'count':0x0,'rows':[]};var _0x4a807c=_[_0x0230('0x29')](db[_0x0230('0x2a')][_0x0230('0x2b')],function(_0x486140){return{'name':_0x486140[_0x0230('0x2c')],'type':_0x486140[_0x0230('0x2d')][_0x0230('0x2e')]};});_0x41060d[_0x0230('0x2f')]=_['map'](_0x4a807c,_0x0230('0x27'));_0x41060d[_0x0230('0x30')]=_[_0x0230('0x31')](_0xb9634b[_0x0230('0x30')]);_0x41060d[_0x0230('0x32')]=_[_0x0230('0x33')](_0x41060d[_0x0230('0x2f')],_0x41060d['query']);_0x764506[_0x0230('0x34')]=_['intersection'](_0x41060d[_0x0230('0x2f')],qs[_0x0230('0x35')](_0xb9634b['query'][_0x0230('0x35')]));_0x764506[_0x0230('0x34')]=_0x764506[_0x0230('0x34')][_0x0230('0x36')]?_0x764506[_0x0230('0x34')]:_0x41060d[_0x0230('0x2f')];if(!_0xb9634b[_0x0230('0x30')]['hasOwnProperty']('nolimit')){_0x764506['limit']=qs[_0x0230('0x1d')](_0xb9634b[_0x0230('0x30')]['limit']);_0x764506['offset']=qs[_0x0230('0x1f')](_0xb9634b[_0x0230('0x30')][_0x0230('0x1f')]);}_0x764506['order']=qs[_0x0230('0x37')](_0xb9634b[_0x0230('0x30')][_0x0230('0x37')]);_0x764506[_0x0230('0x38')]=qs['filters'](_['pick'](_0xb9634b[_0x0230('0x30')],_0x41060d[_0x0230('0x32')]),_0x4a807c);if(_0xb9634b[_0x0230('0x30')][_0x0230('0x39')]){_0x764506[_0x0230('0x38')]=_[_0x0230('0x3a')](_0x764506[_0x0230('0x38')],{'$or':_[_0x0230('0x29')](_0x4a807c,function(_0x525b69){if(_0x525b69[_0x0230('0x2d')]!==_0x0230('0x3b')){var _0x13d0ec={};_0x13d0ec[_0x525b69[_0x0230('0x27')]]={'$like':'%'+_0xb9634b[_0x0230('0x30')][_0x0230('0x39')]+'%'};return _0x13d0ec;}})});}_0x764506=_['merge']({},_0x764506,_0xb9634b[_0x0230('0x3c')]);var _0x118d35={'where':_0x764506[_0x0230('0x38')]};return db['MailSubstatus'][_0x0230('0x1e')](_0x118d35)[_0x0230('0x24')](function(_0x28f13a){_0x36287b[_0x0230('0x1e')]=_0x28f13a;if(_0xb9634b[_0x0230('0x30')]['includeAll']){_0x764506[_0x0230('0x3d')]=[{'all':!![]}];}return db[_0x0230('0x2a')][_0x0230('0x3e')](_0x764506);})['then'](function(_0xb91798){_0x36287b[_0x0230('0x3f')]=_0xb91798;return _0x36287b;})[_0x0230('0x24')](respondWithFilteredResult(_0x1186ad,_0x764506))[_0x0230('0x40')](handleError(_0x1186ad,null));};exports[_0x0230('0x41')]=function(_0x294516,_0x214fea){var _0x5387d2={'raw':!![],'where':{'id':_0x294516[_0x0230('0x42')]['id']}},_0x41c9d0={};_0x41c9d0[_0x0230('0x2f')]=_[_0x0230('0x31')](db[_0x0230('0x2a')][_0x0230('0x2b')]);_0x41c9d0['query']=_[_0x0230('0x31')](_0x294516[_0x0230('0x30')]);_0x41c9d0[_0x0230('0x32')]=_[_0x0230('0x33')](_0x41c9d0['model'],_0x41c9d0[_0x0230('0x30')]);_0x5387d2[_0x0230('0x34')]=_[_0x0230('0x33')](_0x41c9d0[_0x0230('0x2f')],qs[_0x0230('0x35')](_0x294516[_0x0230('0x30')][_0x0230('0x35')]));_0x5387d2[_0x0230('0x34')]=_0x5387d2[_0x0230('0x34')][_0x0230('0x36')]?_0x5387d2[_0x0230('0x34')]:_0x41c9d0[_0x0230('0x2f')];if(_0x294516[_0x0230('0x30')][_0x0230('0x43')]){_0x5387d2[_0x0230('0x3d')]=[{'all':!![]}];}_0x5387d2=_['merge']({},_0x5387d2,_0x294516[_0x0230('0x3c')]);return db[_0x0230('0x2a')][_0x0230('0x44')](_0x5387d2)[_0x0230('0x24')](handleEntityNotFound(_0x214fea,null))[_0x0230('0x24')](respondWithResult(_0x214fea,null))[_0x0230('0x40')](handleError(_0x214fea,null));};exports[_0x0230('0x45')]=function(_0x14af24,_0x3b0d04){return db['MailSubstatus'][_0x0230('0x45')](_0x14af24[_0x0230('0x46')],{})[_0x0230('0x24')](respondWithResult(_0x3b0d04,0xc9))[_0x0230('0x40')](handleError(_0x3b0d04,null));};exports['update']=function(_0x2a4685,_0x13034b){if(_0x2a4685[_0x0230('0x46')]['id']){delete _0x2a4685[_0x0230('0x46')]['id'];}return db['MailSubstatus'][_0x0230('0x44')]({'where':{'id':_0x2a4685[_0x0230('0x42')]['id']}})[_0x0230('0x24')](handleEntityNotFound(_0x13034b,null))['then'](saveUpdates(_0x2a4685[_0x0230('0x46')],null))[_0x0230('0x24')](respondWithResult(_0x13034b,null))[_0x0230('0x40')](handleError(_0x13034b,null));};exports[_0x0230('0x47')]=function(_0x1436fd,_0x3bef66){return db[_0x0230('0x2a')][_0x0230('0x44')]({'where':{'id':_0x1436fd[_0x0230('0x42')]['id']}})[_0x0230('0x24')](handleEntityNotFound(_0x3bef66,null))[_0x0230('0x24')](removeEntity(_0x3bef66,null))[_0x0230('0x40')](handleError(_0x3bef66,null));};exports[_0x0230('0x48')]=function(_0x4a401a,_0x50f0e7){return db['MailSubstatus']['describe']()[_0x0230('0x24')](respondWithResult(_0x50f0e7,null))[_0x0230('0x40')](handleError(_0x50f0e7,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index ce6b160..f97f62f 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 _0x44d1=['emit','hasOwnProperty','exports','events','MailSubstatus','setMaxListeners','update'];(function(_0x58996f,_0x6203cf){var _0x49cfaa=function(_0xf0d9){while(--_0xf0d9){_0x58996f['push'](_0x58996f['shift']());}};_0x49cfaa(++_0x6203cf);}(_0x44d1,0x1a0));var _0x144d=function(_0x5d9795,_0x2f47dd){_0x5d9795=_0x5d9795-0x0;var _0x5a4617=_0x44d1[_0x5d9795];return _0x5a4617;};'use strict';var EventEmitter=require(_0x144d('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x144d('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x144d('0x2')](0x0);var events={'afterUpdate':_0x144d('0x3')};function emitEvent(_0x1c23d6){return function(_0x4180c4,_0x213293,_0x5191e9){MailSubstatusEvents[_0x144d('0x4')](_0x1c23d6+':'+_0x4180c4['id'],_0x4180c4);MailSubstatusEvents[_0x144d('0x4')](_0x1c23d6,_0x4180c4);_0x5191e9(null);};}for(var e in events){if(events[_0x144d('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x144d('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0xf22f=['emit','hasOwnProperty','hook','events','../../mysqldb','MailSubstatus','update'];(function(_0x4cb095,_0x58da07){var _0x2b565d=function(_0x4d41b3){while(--_0x4d41b3){_0x4cb095['push'](_0x4cb095['shift']());}};_0x2b565d(++_0x58da07);}(_0xf22f,0x13e));var _0xff22=function(_0x41f061,_0x2d19bc){_0x41f061=_0x41f061-0x0;var _0x282dc5=_0xf22f[_0x41f061];return _0x282dc5;};'use strict';var EventEmitter=require(_0xff22('0x0'));var MailSubstatus=require(_0xff22('0x1'))['db'][_0xff22('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xff22('0x3')};function emitEvent(_0x32acf7){return function(_0x31eee9,_0x43e86c,_0x128443){MailSubstatusEvents[_0xff22('0x4')](_0x32acf7+':'+_0x31eee9['id'],_0x31eee9);MailSubstatusEvents[_0xff22('0x4')](_0x32acf7,_0x31eee9);_0x128443(null);};}for(var e in events){if(events[_0xff22('0x5')](e)){var event=events[e];MailSubstatus[_0xff22('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index c02e8fb..10e2390 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 _0xb6a9=['models','define','mail_substatuses','Condition','update','mailSubstatus','_previousDataValues','name','then','catch','./mailSubstatus.attributes'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xb6a9,0x13e));var _0x9b6a=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xb6a9[_0x1b7368];return _0x25d54c;};'use strict';var attributes=require(_0x9b6a('0x0'));module['exports']=function(_0x17fffe){var _0x4b93ee=_0x17fffe[_0x9b6a('0x1')];return _0x17fffe[_0x9b6a('0x2')]('MailSubstatus',attributes,{'tableName':_0x9b6a('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x284b44,_0x794577,_0x432e70){return _0x4b93ee[_0x9b6a('0x4')][_0x9b6a('0x5')]({'value':_0x284b44['name']},{'where':{'field':_0x9b6a('0x6'),'value':_0x284b44[_0x9b6a('0x7')][_0x9b6a('0x8')]}})[_0x9b6a('0x9')](function(){_0x432e70();})[_0x9b6a('0xa')](function(_0x53a5f4){_0x432e70(_0x53a5f4);});}}});}; \ No newline at end of file +var _0xf249=['name','then','catch','./mailSubstatus.attributes','exports','models','MailSubstatus','mail_substatuses','mailSubstatus','_previousDataValues'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0xf249,0xe9));var _0x9f24=function(_0x245d35,_0x5d8a4f){_0x245d35=_0x245d35-0x0;var _0x374c1d=_0xf249[_0x245d35];return _0x374c1d;};'use strict';var attributes=require(_0x9f24('0x0'));module[_0x9f24('0x1')]=function(_0x9684b2){var _0x2a00cd=_0x9684b2[_0x9f24('0x2')];return _0x9684b2['define'](_0x9f24('0x3'),attributes,{'tableName':_0x9f24('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x56929f,_0x4f758f,_0x4211f0){return _0x2a00cd['Condition']['update']({'value':_0x56929f['name']},{'where':{'field':_0x9f24('0x5'),'value':_0x56929f[_0x9f24('0x6')][_0x9f24('0x7')]}})[_0x9f24('0x8')](function(){_0x4211f0();})[_0x9f24('0x9')](function(_0x242280){_0x4211f0(_0x242280);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index ab06646..61e4d98 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 _0x6c4f=['rpc','../../config/environment','client','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x565130,_0x27cfde){var _0x38de76=function(_0x344725){while(--_0x344725){_0x565130['push'](_0x565130['shift']());}};_0x38de76(++_0x27cfde);}(_0x6c4f,0x10c));var _0xf6c4=function(_0x4a4d3c,_0x55f637){_0x4a4d3c=_0x4a4d3c-0x0;var _0x25d118=_0x6c4f[_0x4a4d3c];return _0x25d118;};'use strict';var _=require(_0xf6c4('0x0'));var util=require(_0xf6c4('0x1'));var moment=require(_0xf6c4('0x2'));var BPromise=require(_0xf6c4('0x3'));var rs=require(_0xf6c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6c4('0x5'))['db'];var utils=require(_0xf6c4('0x6'));var logger=require(_0xf6c4('0x7'))(_0xf6c4('0x8'));var config=require(_0xf6c4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf6c4('0xa')][_0xf6c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x597dc1,_0x910a9,_0x5b3839){return new BPromise(function(_0x33ebe5,_0xea3c66){return client[_0xf6c4('0xc')](_0x597dc1,_0x5b3839)['then'](function(_0x57ee90){logger[_0xf6c4('0xd')](_0xf6c4('0xe'),_0x910a9,_0xf6c4('0xf'));logger[_0xf6c4('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x910a9,'request\x20sent',JSON[_0xf6c4('0x11')](_0x57ee90));if(_0x57ee90['error']){if(_0x57ee90['error'][_0xf6c4('0x12')]===0x1f4){logger['error'](_0xf6c4('0xe'),_0x910a9,_0x57ee90[_0xf6c4('0x13')][_0xf6c4('0x14')]);return _0xea3c66(_0x57ee90[_0xf6c4('0x13')][_0xf6c4('0x14')]);}logger[_0xf6c4('0x13')](_0xf6c4('0xe'),_0x910a9,_0x57ee90[_0xf6c4('0x13')][_0xf6c4('0x14')]);return _0x33ebe5(_0x57ee90[_0xf6c4('0x13')][_0xf6c4('0x14')]);}else{logger[_0xf6c4('0xd')](_0xf6c4('0xe'),_0x910a9,_0xf6c4('0xf'));_0x33ebe5(_0x57ee90[_0xf6c4('0x15')][_0xf6c4('0x14')]);}})[_0xf6c4('0x16')](function(_0x6aa74f){logger[_0xf6c4('0x13')](_0xf6c4('0xe'),_0x910a9,_0x6aa74f);_0xea3c66(_0x6aa74f);});});} \ No newline at end of file +var _0xbecc=['../../config/utils','../../config/logger','../../config/environment','then','info','request\x20sent','debug','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xe522b0,_0x4ccc37){var _0x5e480a=function(_0x21c85f){while(--_0x21c85f){_0xe522b0['push'](_0xe522b0['shift']());}};_0x5e480a(++_0x4ccc37);}(_0xbecc,0x126));var _0xcbec=function(_0x47294e,_0x522530){_0x47294e=_0x47294e-0x0;var _0x4aa797=_0xbecc[_0x47294e];return _0x4aa797;};'use strict';var _=require(_0xcbec('0x0'));var util=require(_0xcbec('0x1'));var moment=require('moment');var BPromise=require(_0xcbec('0x2'));var rs=require(_0xcbec('0x3'));var fs=require('fs');var Redis=require(_0xcbec('0x4'));var db=require(_0xcbec('0x5'))['db'];var utils=require(_0xcbec('0x6'));var logger=require(_0xcbec('0x7'))('rpc');var config=require(_0xcbec('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x392320,_0x1484c5,_0xe80129){return new BPromise(function(_0x21a185,_0x43c1f2){return client['request'](_0x392320,_0xe80129)[_0xcbec('0x9')](function(_0x5e2c66){logger[_0xcbec('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x1484c5,_0xcbec('0xb'));logger[_0xcbec('0xc')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x1484c5,'request\x20sent',JSON[_0xcbec('0xd')](_0x5e2c66));if(_0x5e2c66[_0xcbec('0xe')]){if(_0x5e2c66[_0xcbec('0xe')][_0xcbec('0xf')]===0x1f4){logger[_0xcbec('0xe')](_0xcbec('0x10'),_0x1484c5,_0x5e2c66[_0xcbec('0xe')]['message']);return _0x43c1f2(_0x5e2c66[_0xcbec('0xe')][_0xcbec('0x11')]);}logger[_0xcbec('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x1484c5,_0x5e2c66[_0xcbec('0xe')][_0xcbec('0x11')]);return _0x21a185(_0x5e2c66[_0xcbec('0xe')]['message']);}else{logger[_0xcbec('0xa')](_0xcbec('0x10'),_0x1484c5,_0xcbec('0xb'));_0x21a185(_0x5e2c66[_0xcbec('0x12')][_0xcbec('0x11')]);}})[_0xcbec('0x13')](function(_0x483d40){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x1484c5,_0x483d40);_0x43c1f2(_0x483d40);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 3f6c780..453a0fa 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 _0xa6fc=['../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x270bb2,_0x2229d1){var _0x32e5c6=function(_0x9baf36){while(--_0x9baf36){_0x270bb2['push'](_0x270bb2['shift']());}};_0x32e5c6(++_0x2229d1);}(_0xa6fc,0xca));var _0xca6f=function(_0x26fd11,_0x24f8b1){_0x26fd11=_0x26fd11-0x0;var _0x42d242=_0xa6fc[_0x26fd11];return _0x42d242;};'use strict';var multer=require(_0xca6f('0x0'));var util=require(_0xca6f('0x1'));var path=require(_0xca6f('0x2'));var timeout=require(_0xca6f('0x3'));var express=require(_0xca6f('0x4'));var router=express[_0xca6f('0x5')]();var fs_extra=require(_0xca6f('0x6'));var auth=require(_0xca6f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xca6f('0x8'));var controller=require('./mailTransferReport.controller');router[_0xca6f('0x9')]('/',auth['isAuthenticated'](),controller[_0xca6f('0xa')]);router[_0xca6f('0x9')](_0xca6f('0xb'),auth['isAuthenticated'](),controller[_0xca6f('0xc')]);router['get'](_0xca6f('0xd'),auth[_0xca6f('0xe')](),controller[_0xca6f('0xf')]);router['post']('/',auth[_0xca6f('0xe')](),controller[_0xca6f('0x10')]);router['put'](_0xca6f('0xd'),auth[_0xca6f('0xe')](),controller[_0xca6f('0x11')]);router[_0xca6f('0x12')]('/:id',auth[_0xca6f('0xe')](),controller[_0xca6f('0x13')]);module[_0xca6f('0x14')]=router; \ No newline at end of file +var _0xb3a2=['/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','./mailTransferReport.controller','isAuthenticated','index','get'];(function(_0x57e465,_0x5166f6){var _0x4ef074=function(_0x19a2e0){while(--_0x19a2e0){_0x57e465['push'](_0x57e465['shift']());}};_0x4ef074(++_0x5166f6);}(_0xb3a2,0x1ae));var _0x2b3a=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xb3a2[_0x543084];return _0x306a57;};'use strict';var multer=require(_0x2b3a('0x0'));var util=require(_0x2b3a('0x1'));var path=require(_0x2b3a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2b3a('0x3')]();var fs_extra=require(_0x2b3a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2b3a('0x5'));var config=require('../../config/environment');var controller=require(_0x2b3a('0x6'));router['get']('/',auth[_0x2b3a('0x7')](),controller[_0x2b3a('0x8')]);router[_0x2b3a('0x9')](_0x2b3a('0xa'),auth['isAuthenticated'](),controller[_0x2b3a('0xb')]);router['get'](_0x2b3a('0xc'),auth[_0x2b3a('0x7')](),controller['show']);router[_0x2b3a('0xd')]('/',auth[_0x2b3a('0x7')](),controller[_0x2b3a('0xe')]);router[_0x2b3a('0xf')](_0x2b3a('0xc'),auth['isAuthenticated'](),controller[_0x2b3a('0x10')]);router[_0x2b3a('0x11')](_0x2b3a('0xc'),auth[_0x2b3a('0x7')](),controller[_0x2b3a('0x12')]);module[_0x2b3a('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 8bba082..b61817d 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0x9bde,0xe1));var _0xe9bd=function(_0x189b32,_0xb4759f){_0x189b32=_0x189b32-0x0;var _0x3d3817=_0x9bde[_0x189b32];return _0x3d3817;};'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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x19a490,_0x4627d9){var _0x52081c=function(_0x418ba5){while(--_0x418ba5){_0x19a490['push'](_0x19a490['shift']());}};_0x52081c(++_0x4627d9);}(_0x54ef,0x112));var _0xf54e=function(_0x33c58a,_0x376f4a){_0x33c58a=_0x33c58a-0x0;var _0x48cbce=_0x54ef[_0x33c58a];return _0x48cbce;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index a15d0a4..30778b3 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 _0xdff8=['body','catch','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','MailTransferReport','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','create'];(function(_0x41b654,_0x39239c){var _0x55c219=function(_0x1f55c0){while(--_0x1f55c0){_0x41b654['push'](_0x41b654['shift']());}};_0x55c219(++_0x39239c);}(_0xdff8,0x18a));var _0x8dff=function(_0xed6ed0,_0x28e1ad){_0xed6ed0=_0xed6ed0-0x0;var _0x20a428=_0xdff8[_0xed6ed0];return _0x20a428;};'use strict';var emlformat=require(_0x8dff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8dff('0x1'));var jsonpatch=require(_0x8dff('0x2'));var rp=require(_0x8dff('0x3'));var moment=require(_0x8dff('0x4'));var BPromise=require(_0x8dff('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8dff('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8dff('0x7'));var fs=require('fs');var fs_extra=require(_0x8dff('0x8'));var _=require(_0x8dff('0x9'));var squel=require(_0x8dff('0xa'));var crypto=require('crypto');var jsforce=require(_0x8dff('0xb'));var deskjs=require(_0x8dff('0xc'));var toCsv=require(_0x8dff('0xd'));var querystring=require('querystring');var Papa=require(_0x8dff('0xe'));var Redis=require('ioredis');var authService=require(_0x8dff('0xf'));var qs=require(_0x8dff('0x10'));var as=require(_0x8dff('0x11'));var hardwareService=require(_0x8dff('0x12'));var logger=require(_0x8dff('0x13'))(_0x8dff('0x14'));var utils=require(_0x8dff('0x15'));var config=require(_0x8dff('0x16'));var licenseUtil=require(_0x8dff('0x17'));var db=require(_0x8dff('0x18'))['db'];function respondWithStatusCode(_0x3865dc,_0x59f488){_0x59f488=_0x59f488||0xcc;return function(_0x33cc69){if(_0x33cc69){return _0x3865dc[_0x8dff('0x19')](_0x59f488);}return _0x3865dc['status'](_0x59f488)[_0x8dff('0x1a')]();};}function respondWithResult(_0x1638db,_0xec2a83){_0xec2a83=_0xec2a83||0xc8;return function(_0xf60959){if(_0xf60959){return _0x1638db['status'](_0xec2a83)[_0x8dff('0x1b')](_0xf60959);}};}function respondWithFilteredResult(_0x1eddc7,_0x1b860a){return function(_0x5e0f78){if(_0x5e0f78){var _0x336215=typeof _0x1b860a[_0x8dff('0x1c')]===_0x8dff('0x1d')&&typeof _0x1b860a[_0x8dff('0x1e')]==='undefined';var _0x3724c5=_0x5e0f78[_0x8dff('0x1f')];var _0x23149=_0x336215?0x0:_0x1b860a[_0x8dff('0x1c')];var _0x1089e5=_0x336215?_0x5e0f78[_0x8dff('0x1f')]:_0x1b860a[_0x8dff('0x1c')]+_0x1b860a[_0x8dff('0x1e')];var _0x121a68;if(_0x1089e5>=_0x3724c5){_0x1089e5=_0x3724c5;_0x121a68=0xc8;}else{_0x121a68=0xce;}_0x1eddc7[_0x8dff('0x20')](_0x121a68);return _0x1eddc7[_0x8dff('0x21')](_0x8dff('0x22'),_0x23149+'-'+_0x1089e5+'/'+_0x3724c5)['json'](_0x5e0f78);}return null;};}function patchUpdates(_0xb23364){return function(_0x26a2e2){try{jsonpatch[_0x8dff('0x23')](_0x26a2e2,_0xb23364,!![]);}catch(_0x2fc416){return BPromise[_0x8dff('0x24')](_0x2fc416);}return _0x26a2e2['save']();};}function saveUpdates(_0x24df0c,_0x562872){return function(_0x2e7b90){if(_0x2e7b90){return _0x2e7b90[_0x8dff('0x25')](_0x24df0c)[_0x8dff('0x26')](function(_0x469f20){return _0x469f20;});}return null;};}function removeEntity(_0x2f898d,_0x13c8af){return function(_0x540a38){if(_0x540a38){return _0x540a38['destroy']()[_0x8dff('0x26')](function(){_0x2f898d[_0x8dff('0x20')](0xcc)[_0x8dff('0x1a')]();});}};}function handleEntityNotFound(_0x312f0f,_0x2744e6){return function(_0x54a6d4){if(!_0x54a6d4){_0x312f0f['sendStatus'](0x194);}return _0x54a6d4;};}function handleError(_0x190d57,_0x29a2b5){_0x29a2b5=_0x29a2b5||0x1f4;return function(_0x4c9cf3){logger[_0x8dff('0x27')](_0x4c9cf3[_0x8dff('0x28')]);if(_0x4c9cf3['name']){delete _0x4c9cf3[_0x8dff('0x29')];}_0x190d57[_0x8dff('0x20')](_0x29a2b5)[_0x8dff('0x2a')](_0x4c9cf3);};}exports[_0x8dff('0x2b')]=function(_0x289f70,_0x56120e){var _0x306ffb={},_0x270c88={},_0xe6a155={'count':0x0,'rows':[]};var _0x2be74a=_[_0x8dff('0x2c')](db[_0x8dff('0x2d')][_0x8dff('0x2e')],function(_0x2d4f8e){return{'name':_0x2d4f8e['fieldName'],'type':_0x2d4f8e[_0x8dff('0x2f')][_0x8dff('0x30')]};});_0x270c88[_0x8dff('0x31')]=_['map'](_0x2be74a,_0x8dff('0x29'));_0x270c88[_0x8dff('0x32')]=_[_0x8dff('0x33')](_0x289f70[_0x8dff('0x32')]);_0x270c88[_0x8dff('0x34')]=_['intersection'](_0x270c88[_0x8dff('0x31')],_0x270c88[_0x8dff('0x32')]);_0x306ffb['attributes']=_['intersection'](_0x270c88['model'],qs[_0x8dff('0x35')](_0x289f70[_0x8dff('0x32')][_0x8dff('0x35')]));_0x306ffb['attributes']=_0x306ffb[_0x8dff('0x36')][_0x8dff('0x37')]?_0x306ffb[_0x8dff('0x36')]:_0x270c88[_0x8dff('0x31')];if(!_0x289f70[_0x8dff('0x32')][_0x8dff('0x38')](_0x8dff('0x39'))){_0x306ffb['limit']=qs[_0x8dff('0x1e')](_0x289f70[_0x8dff('0x32')][_0x8dff('0x1e')]);_0x306ffb[_0x8dff('0x1c')]=qs[_0x8dff('0x1c')](_0x289f70[_0x8dff('0x32')][_0x8dff('0x1c')]);}_0x306ffb[_0x8dff('0x3a')]=qs[_0x8dff('0x3b')](_0x289f70[_0x8dff('0x32')]['sort']);_0x306ffb[_0x8dff('0x3c')]=qs[_0x8dff('0x34')](_[_0x8dff('0x3d')](_0x289f70[_0x8dff('0x32')],_0x270c88[_0x8dff('0x34')]),_0x2be74a);if(_0x289f70[_0x8dff('0x32')][_0x8dff('0x3e')]){_0x306ffb[_0x8dff('0x3c')]=_[_0x8dff('0x3f')](_0x306ffb[_0x8dff('0x3c')],{'$or':_[_0x8dff('0x2c')](_0x2be74a,function(_0x38f4c6){if(_0x38f4c6[_0x8dff('0x2f')]!==_0x8dff('0x40')){var _0x2fc848={};_0x2fc848[_0x38f4c6[_0x8dff('0x29')]]={'$like':'%'+_0x289f70[_0x8dff('0x32')]['filter']+'%'};return _0x2fc848;}})});}_0x306ffb=_[_0x8dff('0x3f')]({},_0x306ffb,_0x289f70[_0x8dff('0x41')]);var _0x5d3dca={'where':_0x306ffb[_0x8dff('0x3c')]};return db['MailTransferReport'][_0x8dff('0x1f')](_0x5d3dca)['then'](function(_0x11b5dc){_0xe6a155[_0x8dff('0x1f')]=_0x11b5dc;if(_0x289f70[_0x8dff('0x32')][_0x8dff('0x42')]){_0x306ffb[_0x8dff('0x43')]=[{'all':!![]}];}return db[_0x8dff('0x2d')][_0x8dff('0x44')](_0x306ffb);})[_0x8dff('0x26')](function(_0x6bae47){_0xe6a155[_0x8dff('0x45')]=_0x6bae47;return _0xe6a155;})[_0x8dff('0x26')](respondWithFilteredResult(_0x56120e,_0x306ffb))['catch'](handleError(_0x56120e,null));};exports[_0x8dff('0x46')]=function(_0x25420f,_0x10a322){var _0x11b259={'raw':!![],'where':{'id':_0x25420f[_0x8dff('0x47')]['id']}},_0x468f4b={};_0x468f4b['model']=_['keys'](db[_0x8dff('0x2d')][_0x8dff('0x2e')]);_0x468f4b['query']=_['keys'](_0x25420f[_0x8dff('0x32')]);_0x468f4b[_0x8dff('0x34')]=_[_0x8dff('0x48')](_0x468f4b[_0x8dff('0x31')],_0x468f4b[_0x8dff('0x32')]);_0x11b259[_0x8dff('0x36')]=_[_0x8dff('0x48')](_0x468f4b[_0x8dff('0x31')],qs[_0x8dff('0x35')](_0x25420f[_0x8dff('0x32')][_0x8dff('0x35')]));_0x11b259['attributes']=_0x11b259['attributes'][_0x8dff('0x37')]?_0x11b259[_0x8dff('0x36')]:_0x468f4b[_0x8dff('0x31')];if(_0x25420f['query']['includeAll']){_0x11b259[_0x8dff('0x43')]=[{'all':!![]}];}_0x11b259=_[_0x8dff('0x3f')]({},_0x11b259,_0x25420f[_0x8dff('0x41')]);return db[_0x8dff('0x2d')]['find'](_0x11b259)[_0x8dff('0x26')](handleEntityNotFound(_0x10a322,null))[_0x8dff('0x26')](respondWithResult(_0x10a322,null))['catch'](handleError(_0x10a322,null));};exports[_0x8dff('0x49')]=function(_0x1ffd7b,_0x198c06){return db[_0x8dff('0x2d')][_0x8dff('0x49')](_0x1ffd7b['body'],{})[_0x8dff('0x26')](respondWithResult(_0x198c06,0xc9))['catch'](handleError(_0x198c06,null));};exports[_0x8dff('0x25')]=function(_0x1419ac,_0x385479){if(_0x1419ac[_0x8dff('0x4a')]['id']){delete _0x1419ac[_0x8dff('0x4a')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x1419ac[_0x8dff('0x47')]['id']}})[_0x8dff('0x26')](handleEntityNotFound(_0x385479,null))[_0x8dff('0x26')](saveUpdates(_0x1419ac[_0x8dff('0x4a')],null))['then'](respondWithResult(_0x385479,null))[_0x8dff('0x4b')](handleError(_0x385479,null));};exports[_0x8dff('0x4c')]=function(_0x13b231,_0x1cb1b3){return db[_0x8dff('0x2d')]['find']({'where':{'id':_0x13b231['params']['id']}})[_0x8dff('0x26')](handleEntityNotFound(_0x1cb1b3,null))[_0x8dff('0x26')](removeEntity(_0x1cb1b3,null))['catch'](handleError(_0x1cb1b3,null));};exports['describe']=function(_0x32bab8,_0x545a00){return db[_0x8dff('0x2d')][_0x8dff('0x4d')]()['then'](respondWithResult(_0x545a00,null))[_0x8dff('0x4b')](handleError(_0x545a00,null));}; \ No newline at end of file +var _0x6db7=['stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','MailTransferReport','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus'];(function(_0x2dc5c5,_0x176502){var _0x288e39=function(_0x53fdf0){while(--_0x53fdf0){_0x2dc5c5['push'](_0x2dc5c5['shift']());}};_0x288e39(++_0x176502);}(_0x6db7,0x115));var _0x76db=function(_0x8d695e,_0x394999){_0x8d695e=_0x8d695e-0x0;var _0x3d156e=_0x6db7[_0x8d695e];return _0x3d156e;};'use strict';var emlformat=require(_0x76db('0x0'));var rimraf=require(_0x76db('0x1'));var zipdir=require(_0x76db('0x2'));var jsonpatch=require(_0x76db('0x3'));var rp=require(_0x76db('0x4'));var moment=require(_0x76db('0x5'));var BPromise=require(_0x76db('0x6'));var Mustache=require(_0x76db('0x7'));var util=require(_0x76db('0x8'));var path=require(_0x76db('0x9'));var sox=require(_0x76db('0xa'));var csv=require(_0x76db('0xb'));var ejs=require(_0x76db('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76db('0xd'));var squel=require(_0x76db('0xe'));var crypto=require(_0x76db('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x76db('0xb'));var querystring=require('querystring');var Papa=require(_0x76db('0x10'));var Redis=require(_0x76db('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x76db('0x12'));var as=require(_0x76db('0x13'));var hardwareService=require(_0x76db('0x14'));var logger=require(_0x76db('0x15'))(_0x76db('0x16'));var utils=require(_0x76db('0x17'));var config=require(_0x76db('0x18'));var licenseUtil=require(_0x76db('0x19'));var db=require(_0x76db('0x1a'))['db'];function respondWithStatusCode(_0x4d466b,_0x48532f){_0x48532f=_0x48532f||0xcc;return function(_0xbad83f){if(_0xbad83f){return _0x4d466b['sendStatus'](_0x48532f);}return _0x4d466b[_0x76db('0x1b')](_0x48532f)['end']();};}function respondWithResult(_0x209163,_0x5a86e8){_0x5a86e8=_0x5a86e8||0xc8;return function(_0x15c214){if(_0x15c214){return _0x209163[_0x76db('0x1b')](_0x5a86e8)[_0x76db('0x1c')](_0x15c214);}};}function respondWithFilteredResult(_0x4b6e50,_0x37b48d){return function(_0x95254d){if(_0x95254d){var _0x50d998=typeof _0x37b48d[_0x76db('0x1d')]===_0x76db('0x1e')&&typeof _0x37b48d[_0x76db('0x1f')]===_0x76db('0x1e');var _0x42f9e9=_0x95254d[_0x76db('0x20')];var _0x1e5337=_0x50d998?0x0:_0x37b48d['offset'];var _0xdc96b3=_0x50d998?_0x95254d[_0x76db('0x20')]:_0x37b48d[_0x76db('0x1d')]+_0x37b48d[_0x76db('0x1f')];var _0x36cae4;if(_0xdc96b3>=_0x42f9e9){_0xdc96b3=_0x42f9e9;_0x36cae4=0xc8;}else{_0x36cae4=0xce;}_0x4b6e50[_0x76db('0x1b')](_0x36cae4);return _0x4b6e50[_0x76db('0x21')](_0x76db('0x22'),_0x1e5337+'-'+_0xdc96b3+'/'+_0x42f9e9)[_0x76db('0x1c')](_0x95254d);}return null;};}function patchUpdates(_0x1d919d){return function(_0x118f97){try{jsonpatch[_0x76db('0x23')](_0x118f97,_0x1d919d,!![]);}catch(_0x52156a){return BPromise[_0x76db('0x24')](_0x52156a);}return _0x118f97[_0x76db('0x25')]();};}function saveUpdates(_0x370523,_0x5ac5e0){return function(_0x57b514){if(_0x57b514){return _0x57b514[_0x76db('0x26')](_0x370523)[_0x76db('0x27')](function(_0x535d46){return _0x535d46;});}return null;};}function removeEntity(_0xd89afe,_0x1ad63a){return function(_0x4c317b){if(_0x4c317b){return _0x4c317b[_0x76db('0x28')]()['then'](function(){_0xd89afe['status'](0xcc)[_0x76db('0x29')]();});}};}function handleEntityNotFound(_0x27ed75,_0x4515ee){return function(_0x109756){if(!_0x109756){_0x27ed75[_0x76db('0x2a')](0x194);}return _0x109756;};}function handleError(_0x3f2d64,_0x22ffcd){_0x22ffcd=_0x22ffcd||0x1f4;return function(_0x13f1f2){logger['error'](_0x13f1f2[_0x76db('0x2b')]);if(_0x13f1f2[_0x76db('0x2c')]){delete _0x13f1f2[_0x76db('0x2c')];}_0x3f2d64[_0x76db('0x1b')](_0x22ffcd)[_0x76db('0x2d')](_0x13f1f2);};}exports['index']=function(_0x3ffab3,_0x2e716e){var _0xddfe7f={},_0x428c9e={},_0x2d13eb={'count':0x0,'rows':[]};var _0x3646e2=_[_0x76db('0x2e')](db['MailTransferReport'][_0x76db('0x2f')],function(_0x143365){return{'name':_0x143365[_0x76db('0x30')],'type':_0x143365[_0x76db('0x31')][_0x76db('0x32')]};});_0x428c9e[_0x76db('0x33')]=_[_0x76db('0x2e')](_0x3646e2,_0x76db('0x2c'));_0x428c9e['query']=_[_0x76db('0x34')](_0x3ffab3[_0x76db('0x35')]);_0x428c9e[_0x76db('0x36')]=_[_0x76db('0x37')](_0x428c9e[_0x76db('0x33')],_0x428c9e[_0x76db('0x35')]);_0xddfe7f[_0x76db('0x38')]=_[_0x76db('0x37')](_0x428c9e[_0x76db('0x33')],qs[_0x76db('0x39')](_0x3ffab3[_0x76db('0x35')]['fields']));_0xddfe7f['attributes']=_0xddfe7f[_0x76db('0x38')][_0x76db('0x3a')]?_0xddfe7f[_0x76db('0x38')]:_0x428c9e[_0x76db('0x33')];if(!_0x3ffab3[_0x76db('0x35')][_0x76db('0x3b')](_0x76db('0x3c'))){_0xddfe7f['limit']=qs[_0x76db('0x1f')](_0x3ffab3[_0x76db('0x35')][_0x76db('0x1f')]);_0xddfe7f['offset']=qs[_0x76db('0x1d')](_0x3ffab3[_0x76db('0x35')][_0x76db('0x1d')]);}_0xddfe7f[_0x76db('0x3d')]=qs[_0x76db('0x3e')](_0x3ffab3[_0x76db('0x35')]['sort']);_0xddfe7f[_0x76db('0x3f')]=qs[_0x76db('0x36')](_[_0x76db('0x40')](_0x3ffab3[_0x76db('0x35')],_0x428c9e[_0x76db('0x36')]),_0x3646e2);if(_0x3ffab3[_0x76db('0x35')][_0x76db('0x41')]){_0xddfe7f[_0x76db('0x3f')]=_['merge'](_0xddfe7f[_0x76db('0x3f')],{'$or':_['map'](_0x3646e2,function(_0x398089){if(_0x398089['type']!=='VIRTUAL'){var _0x30b428={};_0x30b428[_0x398089[_0x76db('0x2c')]]={'$like':'%'+_0x3ffab3[_0x76db('0x35')][_0x76db('0x41')]+'%'};return _0x30b428;}})});}_0xddfe7f=_[_0x76db('0x42')]({},_0xddfe7f,_0x3ffab3[_0x76db('0x43')]);var _0x4bbc68={'where':_0xddfe7f[_0x76db('0x3f')]};return db[_0x76db('0x44')][_0x76db('0x20')](_0x4bbc68)[_0x76db('0x27')](function(_0xc94a25){_0x2d13eb['count']=_0xc94a25;if(_0x3ffab3[_0x76db('0x35')][_0x76db('0x45')]){_0xddfe7f[_0x76db('0x46')]=[{'all':!![]}];}return db['MailTransferReport'][_0x76db('0x47')](_0xddfe7f);})['then'](function(_0x219213){_0x2d13eb[_0x76db('0x48')]=_0x219213;return _0x2d13eb;})[_0x76db('0x27')](respondWithFilteredResult(_0x2e716e,_0xddfe7f))[_0x76db('0x49')](handleError(_0x2e716e,null));};exports[_0x76db('0x4a')]=function(_0x8b2774,_0x1fa0aa){var _0x109244={'raw':!![],'where':{'id':_0x8b2774['params']['id']}},_0x5933f3={};_0x5933f3[_0x76db('0x33')]=_[_0x76db('0x34')](db[_0x76db('0x44')][_0x76db('0x2f')]);_0x5933f3[_0x76db('0x35')]=_[_0x76db('0x34')](_0x8b2774[_0x76db('0x35')]);_0x5933f3['filters']=_[_0x76db('0x37')](_0x5933f3['model'],_0x5933f3[_0x76db('0x35')]);_0x109244['attributes']=_[_0x76db('0x37')](_0x5933f3[_0x76db('0x33')],qs[_0x76db('0x39')](_0x8b2774[_0x76db('0x35')][_0x76db('0x39')]));_0x109244['attributes']=_0x109244[_0x76db('0x38')][_0x76db('0x3a')]?_0x109244[_0x76db('0x38')]:_0x5933f3[_0x76db('0x33')];if(_0x8b2774['query'][_0x76db('0x45')]){_0x109244[_0x76db('0x46')]=[{'all':!![]}];}_0x109244=_[_0x76db('0x42')]({},_0x109244,_0x8b2774[_0x76db('0x43')]);return db[_0x76db('0x44')]['find'](_0x109244)[_0x76db('0x27')](handleEntityNotFound(_0x1fa0aa,null))[_0x76db('0x27')](respondWithResult(_0x1fa0aa,null))[_0x76db('0x49')](handleError(_0x1fa0aa,null));};exports[_0x76db('0x4b')]=function(_0x1d91c5,_0x1d2e9e){return db[_0x76db('0x44')][_0x76db('0x4b')](_0x1d91c5['body'],{})[_0x76db('0x27')](respondWithResult(_0x1d2e9e,0xc9))[_0x76db('0x49')](handleError(_0x1d2e9e,null));};exports['update']=function(_0xbc70c9,_0x150a58){if(_0xbc70c9[_0x76db('0x4c')]['id']){delete _0xbc70c9[_0x76db('0x4c')]['id'];}return db['MailTransferReport'][_0x76db('0x4d')]({'where':{'id':_0xbc70c9[_0x76db('0x4e')]['id']}})[_0x76db('0x27')](handleEntityNotFound(_0x150a58,null))['then'](saveUpdates(_0xbc70c9[_0x76db('0x4c')],null))[_0x76db('0x27')](respondWithResult(_0x150a58,null))[_0x76db('0x49')](handleError(_0x150a58,null));};exports[_0x76db('0x28')]=function(_0x379df1,_0x166fcb){return db[_0x76db('0x44')][_0x76db('0x4d')]({'where':{'id':_0x379df1[_0x76db('0x4e')]['id']}})[_0x76db('0x27')](handleEntityNotFound(_0x166fcb,null))['then'](removeEntity(_0x166fcb,null))[_0x76db('0x49')](handleError(_0x166fcb,null));};exports[_0x76db('0x4f')]=function(_0x523ca8,_0x45ff3a){return db['MailTransferReport'][_0x76db('0x4f')]()[_0x76db('0x27')](respondWithResult(_0x45ff3a,null))[_0x76db('0x49')](handleError(_0x45ff3a,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index bf3b9f1..744665f 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 _0x8ebf=['moment','bluebird','path','rimraf','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0x8ebf[_0x4e697a];return _0x88850c;};'use strict';var _=require(_0xf8eb('0x0'));var util=require(_0xf8eb('0x1'));var logger=require(_0xf8eb('0x2'))('api');var moment=require(_0xf8eb('0x3'));var BPromise=require(_0xf8eb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8eb('0x5'));var rimraf=require(_0xf8eb('0x6'));var config=require(_0xf8eb('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xf8eb('0x8')]=function(_0x36fde3,_0x4cbeaa){return _0x36fde3[_0xf8eb('0x9')](_0xf8eb('0xa'),attributes,{'tableName':_0xf8eb('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf8eb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5410=['./mailTransferReport.attributes','define','MailTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0x5410,0xa0));var _0x0541=function(_0x5597e3,_0x485dab){_0x5597e3=_0x5597e3-0x0;var _0x427a32=_0x5410[_0x5597e3];return _0x427a32;};'use strict';var _=require('lodash');var util=require(_0x0541('0x0'));var logger=require(_0x0541('0x1'))(_0x0541('0x2'));var moment=require(_0x0541('0x3'));var BPromise=require(_0x0541('0x4'));var rp=require(_0x0541('0x5'));var fs=require('fs');var path=require(_0x0541('0x6'));var rimraf=require(_0x0541('0x7'));var config=require(_0x0541('0x8'));var attributes=require(_0x0541('0x9'));module['exports']=function(_0x19e8e5,_0x3a199b){return _0x19e8e5[_0x0541('0xa')](_0x0541('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x0541('0xc'),'fields':[_0x0541('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 a2ed24d..37aaf31 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 _0x2c6d=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4848a4,_0xb1949b){var _0x3acc51=function(_0x5d740c){while(--_0x5d740c){_0x4848a4['push'](_0x4848a4['shift']());}};_0x3acc51(++_0xb1949b);}(_0x2c6d,0x71));var _0xd2c6=function(_0x59652a,_0x2dba89){_0x59652a=_0x59652a-0x0;var _0x55c03f=_0x2c6d[_0x59652a];return _0x55c03f;};'use strict';var _=require(_0xd2c6('0x0'));var util=require(_0xd2c6('0x1'));var moment=require('moment');var BPromise=require(_0xd2c6('0x2'));var rs=require(_0xd2c6('0x3'));var fs=require('fs');var Redis=require(_0xd2c6('0x4'));var db=require(_0xd2c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2c6('0x6'))('rpc');var config=require(_0xd2c6('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd2c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47cc68,_0x289d1c,_0x5399d7){return new BPromise(function(_0x1d22f2,_0x2f12f2){return client[_0xd2c6('0x9')](_0x47cc68,_0x5399d7)[_0xd2c6('0xa')](function(_0x50bcf5){logger[_0xd2c6('0xb')](_0xd2c6('0xc'),_0x289d1c,_0xd2c6('0xd'));logger[_0xd2c6('0xe')](_0xd2c6('0xf'),_0x289d1c,_0xd2c6('0xd'),JSON[_0xd2c6('0x10')](_0x50bcf5));if(_0x50bcf5[_0xd2c6('0x11')]){if(_0x50bcf5[_0xd2c6('0x11')][_0xd2c6('0x12')]===0x1f4){logger[_0xd2c6('0x11')](_0xd2c6('0xc'),_0x289d1c,_0x50bcf5[_0xd2c6('0x11')][_0xd2c6('0x13')]);return _0x2f12f2(_0x50bcf5[_0xd2c6('0x11')]['message']);}logger[_0xd2c6('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x289d1c,_0x50bcf5[_0xd2c6('0x11')][_0xd2c6('0x13')]);return _0x1d22f2(_0x50bcf5[_0xd2c6('0x11')][_0xd2c6('0x13')]);}else{logger[_0xd2c6('0xb')](_0xd2c6('0xc'),_0x289d1c,_0xd2c6('0xd'));_0x1d22f2(_0x50bcf5[_0xd2c6('0x14')][_0xd2c6('0x13')]);}})[_0xd2c6('0x15')](function(_0x3d2d84){logger['error'](_0xd2c6('0xc'),_0x289d1c,_0x3d2d84);_0x2f12f2(_0x3d2d84);});});} \ No newline at end of file +var _0xb8e4=['util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x1a22d7,_0x3dc850){var _0xcde07=function(_0x55bdd7){while(--_0x55bdd7){_0x1a22d7['push'](_0x1a22d7['shift']());}};_0xcde07(++_0x3dc850);}(_0xb8e4,0xce));var _0x4b8e=function(_0x12d750,_0x5ea210){_0x12d750=_0x12d750-0x0;var _0x1f4f42=_0xb8e4[_0x12d750];return _0x1f4f42;};'use strict';var _=require(_0x4b8e('0x0'));var util=require(_0x4b8e('0x1'));var moment=require(_0x4b8e('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b8e('0x3'));var fs=require('fs');var Redis=require(_0x4b8e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b8e('0x5'));var logger=require('../../config/logger')(_0x4b8e('0x6'));var config=require(_0x4b8e('0x7'));var jayson=require(_0x4b8e('0x8'));var client=jayson[_0x4b8e('0x9')][_0x4b8e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a883b,_0x201315,_0x4deae2){return new BPromise(function(_0xce956e,_0x5052df){return client[_0x4b8e('0xb')](_0x2a883b,_0x4deae2)[_0x4b8e('0xc')](function(_0x7d49ea){logger[_0x4b8e('0xd')](_0x4b8e('0xe'),_0x201315,_0x4b8e('0xf'));logger[_0x4b8e('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x201315,_0x4b8e('0xf'),JSON[_0x4b8e('0x11')](_0x7d49ea));if(_0x7d49ea[_0x4b8e('0x12')]){if(_0x7d49ea[_0x4b8e('0x12')][_0x4b8e('0x13')]===0x1f4){logger['error'](_0x4b8e('0xe'),_0x201315,_0x7d49ea['error'][_0x4b8e('0x14')]);return _0x5052df(_0x7d49ea['error']['message']);}logger[_0x4b8e('0x12')](_0x4b8e('0xe'),_0x201315,_0x7d49ea[_0x4b8e('0x12')][_0x4b8e('0x14')]);return _0xce956e(_0x7d49ea['error']['message']);}else{logger[_0x4b8e('0xd')](_0x4b8e('0xe'),_0x201315,_0x4b8e('0xf'));_0xce956e(_0x7d49ea[_0x4b8e('0x15')]['message']);}})[_0x4b8e('0x16')](function(_0x4015d7){logger[_0x4b8e('0x12')](_0x4b8e('0xe'),_0x201315,_0x4015d7);_0x5052df(_0x4015d7);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 2f0c129..5b1f2ae 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 _0x7869=['isAuthenticated','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x2eef80,_0x241f70){var _0x4bdd07=function(_0xf6c6db){while(--_0xf6c6db){_0x2eef80['push'](_0x2eef80['shift']());}};_0x4bdd07(++_0x241f70);}(_0x7869,0x186));var _0x9786=function(_0x2d46ba,_0x4f66a7){_0x2d46ba=_0x2d46ba-0x0;var _0x6f179f=_0x7869[_0x2d46ba];return _0x6f179f;};'use strict';var multer=require(_0x9786('0x0'));var util=require(_0x9786('0x1'));var path=require('path');var timeout=require(_0x9786('0x2'));var express=require(_0x9786('0x3'));var router=express['Router']();var fs_extra=require(_0x9786('0x4'));var auth=require(_0x9786('0x5'));var interaction=require(_0x9786('0x6'));var config=require(_0x9786('0x7'));var controller=require(_0x9786('0x8'));router[_0x9786('0x9')]('/',auth[_0x9786('0xa')](),controller['index']);router[_0x9786('0x9')](_0x9786('0xb'),auth[_0x9786('0xa')](),controller['describe']);router['get'](_0x9786('0xc'),auth[_0x9786('0xa')](),controller[_0x9786('0xd')]);router[_0x9786('0xe')]('/',auth[_0x9786('0xa')](),controller[_0x9786('0xf')]);router[_0x9786('0x10')]('/:id',auth[_0x9786('0xa')](),controller[_0x9786('0x11')]);router['delete'](_0x9786('0xc'),auth[_0x9786('0xa')](),controller[_0x9786('0x12')]);module[_0x9786('0x13')]=router; \ No newline at end of file +var _0x1e4e=['/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x1e4e,0x143));var _0xe1e4=function(_0x3b1fa1,_0xc7e92f){_0x3b1fa1=_0x3b1fa1-0x0;var _0x471d1b=_0x1e4e[_0x3b1fa1];return _0x471d1b;};'use strict';var multer=require(_0xe1e4('0x0'));var util=require(_0xe1e4('0x1'));var path=require(_0xe1e4('0x2'));var timeout=require('connect-timeout');var express=require(_0xe1e4('0x3'));var router=express[_0xe1e4('0x4')]();var fs_extra=require(_0xe1e4('0x5'));var auth=require(_0xe1e4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe1e4('0x7'));var controller=require(_0xe1e4('0x8'));router[_0xe1e4('0x9')]('/',auth[_0xe1e4('0xa')](),controller['index']);router[_0xe1e4('0x9')](_0xe1e4('0xb'),auth['isAuthenticated'](),controller[_0xe1e4('0xc')]);router[_0xe1e4('0x9')](_0xe1e4('0xd'),auth[_0xe1e4('0xa')](),controller[_0xe1e4('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe1e4('0xf')]);router[_0xe1e4('0x10')]('/:id',auth[_0xe1e4('0xa')](),controller[_0xe1e4('0x11')]);router[_0xe1e4('0x12')](_0xe1e4('0xd'),auth['isAuthenticated'](),controller[_0xe1e4('0x13')]);module[_0xe1e4('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 480936f..b7bca0c 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 _0x5080=['enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue'];(function(_0x8c0883,_0x1ccc96){var _0x175f31=function(_0x3fb5b1){while(--_0x3fb5b1){_0x8c0883['push'](_0x8c0883['shift']());}};_0x175f31(++_0x1ccc96);}(_0x5080,0x64));var _0x0508=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5080[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0508('0x0'));module[_0x0508('0x1')]={'channel':{'type':Sequelize[_0x0508('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x0508('0x2')]},'type':{'type':Sequelize[_0x0508('0x2')],'defaultValue':_0x0508('0x3'),'comment':_0x0508('0x4')},'duration':{'type':Sequelize[_0x0508('0x5')]},'enterAt':{'type':Sequelize[_0x0508('0x6')]},'exitAt':{'type':Sequelize[_0x0508('0x6')],'set':function(_0x165931){var _0x373cd8=moment(_0x165931);var _0x393c33=moment(this[_0x0508('0x7')](_0x0508('0x8')));var _0x15b146=_0x373cd8[_0x0508('0x9')](_0x393c33,_0x0508('0xa'));this[_0x0508('0xb')](_0x0508('0xc'),_0x165931);this['setDataValue'](_0x0508('0xd'),_0x15b146>=0x0?_0x15b146:null);}},'data1':{'type':Sequelize[_0x0508('0x2')],'comment':_0x0508('0xe')},'data2':{'type':Sequelize[_0x0508('0x2')],'comment':_0x0508('0xf')},'data3':{'type':Sequelize[_0x0508('0x2')],'comment':_0x0508('0x10')},'data4':{'type':Sequelize[_0x0508('0x2')],'comment':_0x0508('0x11')},'data5':{'type':Sequelize[_0x0508('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x0508('0x2')]},'internal':{'type':Sequelize[_0x0508('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2e9d=['enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue'];(function(_0x1e83fc,_0x54beb0){var _0x19612a=function(_0x16c6d4){while(--_0x16c6d4){_0x1e83fc['push'](_0x1e83fc['shift']());}};_0x19612a(++_0x54beb0);}(_0x2e9d,0x15d));var _0xd2e9=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0x2e9d[_0x273dc5];return _0x46dae7;};'use strict';var Sequelize=require(_0xd2e9('0x0'));var moment=require('moment');module[_0xd2e9('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xd2e9('0x2')]},'type':{'type':Sequelize[_0xd2e9('0x2')],'defaultValue':_0xd2e9('0x3'),'comment':_0xd2e9('0x4')},'duration':{'type':Sequelize[_0xd2e9('0x5')]},'enterAt':{'type':Sequelize[_0xd2e9('0x6')]},'exitAt':{'type':Sequelize[_0xd2e9('0x6')],'set':function(_0x491ef2){var _0x42cfab=moment(_0x491ef2);var _0x57ccbe=moment(this[_0xd2e9('0x7')](_0xd2e9('0x8')));var _0x2e6ccd=_0x42cfab[_0xd2e9('0x9')](_0x57ccbe,_0xd2e9('0xa'));this[_0xd2e9('0xb')](_0xd2e9('0xc'),_0x491ef2);this[_0xd2e9('0xb')]('duration',_0x2e6ccd>=0x0?_0x2e6ccd:null);}},'data1':{'type':Sequelize[_0xd2e9('0x2')],'comment':_0xd2e9('0xd')},'data2':{'type':Sequelize[_0xd2e9('0x2')],'comment':_0xd2e9('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0xd2e9('0xf')},'data4':{'type':Sequelize[_0xd2e9('0x2')],'comment':_0xd2e9('0x10')},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xd2e9('0x2')]},'internal':{'type':Sequelize[_0xd2e9('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 1142341..6466219 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xedd9,0xfc));var _0x9edd=function(_0x4fddea,_0x47ecad){_0x4fddea=_0x4fddea-0x0;var _0x4a4eed=_0xedd9[_0x4fddea];return _0x4a4eed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _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(_0x3a1b35,_0x43f746){var _0x27fd53=function(_0x398150){while(--_0x398150){_0x3a1b35['push'](_0x3a1b35['shift']());}};_0x27fd53(++_0x43f746);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 16a491e..0d304a0 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 _0x2ef1=['define','MemberReport','membername','interface','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x2ef1,0x9e));var _0x12ef=function(_0x35f2e8,_0x192dde){_0x35f2e8=_0x35f2e8-0x0;var _0x583c42=_0x2ef1[_0x35f2e8];return _0x583c42;};'use strict';var _=require(_0x12ef('0x0'));var util=require(_0x12ef('0x1'));var logger=require(_0x12ef('0x2'))(_0x12ef('0x3'));var moment=require('moment');var BPromise=require(_0x12ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12ef('0x5'));var rimraf=require(_0x12ef('0x6'));var config=require(_0x12ef('0x7'));var attributes=require(_0x12ef('0x8'));module[_0x12ef('0x9')]=function(_0xce19e4,_0x265f36){return _0xce19e4[_0x12ef('0xa')](_0x12ef('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x12ef('0xc'),_0x12ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb1ab=['../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x49bc4e,_0x24ea0d){var _0x5dbd2f=function(_0x4eb194){while(--_0x4eb194){_0x49bc4e['push'](_0x49bc4e['shift']());}};_0x5dbd2f(++_0x24ea0d);}(_0xb1ab,0x6f));var _0xbb1a=function(_0x1e7345,_0x18bcce){_0x1e7345=_0x1e7345-0x0;var _0x33017c=_0xb1ab[_0x1e7345];return _0x33017c;};'use strict';var _=require('lodash');var util=require(_0xbb1a('0x0'));var logger=require(_0xbb1a('0x1'))(_0xbb1a('0x2'));var moment=require(_0xbb1a('0x3'));var BPromise=require(_0xbb1a('0x4'));var rp=require(_0xbb1a('0x5'));var fs=require('fs');var path=require(_0xbb1a('0x6'));var rimraf=require(_0xbb1a('0x7'));var config=require(_0xbb1a('0x8'));var attributes=require(_0xbb1a('0x9'));module[_0xbb1a('0xa')]=function(_0x9df83a,_0x45505b){return _0x9df83a[_0xbb1a('0xb')](_0xbb1a('0xc'),attributes,{'tableName':_0xbb1a('0xd'),'paranoid':![],'indexes':[{'name':_0xbb1a('0xe'),'fields':[_0xbb1a('0xf'),_0xbb1a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 602cef1..13a8873 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 _0x938d=['request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','CreateMemberReport','create','body','catch','UpdateMemberReport','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MemberReport,\x20%s,\x20%s'];(function(_0xcefc5b,_0x18c979){var _0x3f21ea=function(_0xfe3b1f){while(--_0xfe3b1f){_0xcefc5b['push'](_0xcefc5b['shift']());}};_0x3f21ea(++_0x18c979);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd938('0x0'));var util=require(_0xd938('0x1'));var moment=require('moment');var BPromise=require(_0xd938('0x2'));var rs=require(_0xd938('0x3'));var fs=require('fs');var Redis=require(_0xd938('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd938('0x5'))(_0xd938('0x6'));var config=require(_0xd938('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd938('0x8')][_0xd938('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ed46b,_0x29fcaa,_0x678164){return new BPromise(function(_0x419e0b,_0x4792db){return client[_0xd938('0xa')](_0x1ed46b,_0x678164)[_0xd938('0xb')](function(_0x19fac0){logger[_0xd938('0xc')](_0xd938('0xd'),_0x29fcaa,_0xd938('0xe'));logger['debug'](_0xd938('0xf'),_0x29fcaa,_0xd938('0xe'),JSON[_0xd938('0x10')](_0x19fac0));if(_0x19fac0[_0xd938('0x11')]){if(_0x19fac0[_0xd938('0x11')][_0xd938('0x12')]===0x1f4){logger[_0xd938('0x11')](_0xd938('0xd'),_0x29fcaa,_0x19fac0[_0xd938('0x11')][_0xd938('0x13')]);return _0x4792db(_0x19fac0[_0xd938('0x11')][_0xd938('0x13')]);}logger[_0xd938('0x11')]('MemberReport,\x20%s,\x20%s',_0x29fcaa,_0x19fac0['error']['message']);return _0x419e0b(_0x19fac0[_0xd938('0x11')][_0xd938('0x13')]);}else{logger[_0xd938('0xc')]('MemberReport,\x20%s,\x20%s',_0x29fcaa,'request\x20sent');_0x419e0b(_0x19fac0[_0xd938('0x14')][_0xd938('0x13')]);}})['catch'](function(_0x5aef15){logger['error'](_0xd938('0xd'),_0x29fcaa,_0x5aef15);_0x4792db(_0x5aef15);});});}exports[_0xd938('0x15')]=function(_0x355185){var _0x54b652=this;return new Promise(function(_0x103e84,_0x34d512){return db[_0xd938('0x16')][_0xd938('0x17')]({'raw':_0x355185[_0xd938('0x18')]?_0x355185['options'][_0xd938('0x19')]===undefined?!![]:![]:!![],'where':_0x355185['options']?_0x355185['options'][_0xd938('0x1a')]||null:null,'attributes':_0x355185['options']?_0x355185[_0xd938('0x18')][_0xd938('0x1b')]||null:null,'limit':_0x355185[_0xd938('0x18')]?_0x355185[_0xd938('0x18')][_0xd938('0x1c')]||null:null,'include':_0x355185['options']?_0x355185[_0xd938('0x18')][_0xd938('0x1d')]?_[_0xd938('0x1e')](_0x355185[_0xd938('0x18')][_0xd938('0x1d')],function(_0x28f56a){return{'model':db[_0x28f56a[_0xd938('0x1f')]],'as':_0x28f56a['as'],'attributes':_0x28f56a[_0xd938('0x1b')],'include':_0x28f56a[_0xd938('0x1d')]?_[_0xd938('0x1e')](_0x28f56a[_0xd938('0x1d')],function(_0x5bc216){return{'model':db[_0x5bc216['model']],'as':_0x5bc216['as'],'attributes':_0x5bc216[_0xd938('0x1b')],'include':_0x5bc216[_0xd938('0x1d')]?_[_0xd938('0x1e')](_0x5bc216['include'],function(_0x10044c){return{'model':db[_0x10044c['model']],'as':_0x10044c['as'],'attributes':_0x10044c[_0xd938('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43fc62){logger['info'](_0xd938('0x15'),_0x355185);logger[_0xd938('0x20')](_0xd938('0x15'),_0x355185,JSON[_0xd938('0x10')](_0x43fc62));_0x103e84(_0x43fc62);})['catch'](function(_0x20a873){logger[_0xd938('0x11')](_0xd938('0x15'),_0x20a873[_0xd938('0x13')],_0x355185);_0x34d512(_0x54b652['error'](0x1f4,_0x20a873[_0xd938('0x13')]));});});};exports[_0xd938('0x21')]=function(_0xd55990){var _0x4bf006=this;return new Promise(function(_0x3ff1ce,_0x2d8fc0){return db[_0xd938('0x16')][_0xd938('0x22')](_0xd55990[_0xd938('0x23')],{'raw':_0xd55990[_0xd938('0x18')]?_0xd55990[_0xd938('0x18')][_0xd938('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xe29731){logger[_0xd938('0xc')](_0xd938('0x21'),_0xd55990);logger[_0xd938('0x20')]('CreateMemberReport',_0xd55990,JSON[_0xd938('0x10')](_0xe29731));_0x3ff1ce(_0xe29731);})[_0xd938('0x24')](function(_0x45ad58){logger[_0xd938('0x11')]('CreateMemberReport',_0x45ad58[_0xd938('0x13')],_0xd55990);_0x2d8fc0(_0x4bf006[_0xd938('0x11')](0x1f4,_0x45ad58[_0xd938('0x13')]));});});};exports[_0xd938('0x25')]=function(_0x51aa80){var _0x10bb45=this;return new Promise(function(_0x1a77fc,_0x4eaa97){return db[_0xd938('0x16')]['update'](_0x51aa80['body'],{'raw':_0x51aa80[_0xd938('0x18')]?_0x51aa80[_0xd938('0x18')][_0xd938('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51aa80['options']?_0x51aa80[_0xd938('0x18')][_0xd938('0x1a')]||null:null,'attributes':_0x51aa80[_0xd938('0x18')]?_0x51aa80[_0xd938('0x18')]['attributes']||null:null,'limit':_0x51aa80['options']?_0x51aa80[_0xd938('0x18')][_0xd938('0x1c')]||null:null})['then'](function(_0x4ddbc6){logger['info'](_0xd938('0x25'),_0x51aa80);logger[_0xd938('0x20')](_0xd938('0x25'),_0x51aa80,JSON[_0xd938('0x10')](_0x4ddbc6));_0x1a77fc(_0x4ddbc6);})[_0xd938('0x24')](function(_0x342da0){logger['error'](_0xd938('0x25'),_0x342da0[_0xd938('0x13')],_0x51aa80);_0x4eaa97(_0x10bb45[_0xd938('0x11')](0x1f4,_0x342da0['message']));});});}; \ No newline at end of file +var _0x0af5=['MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','include','map','model','info','debug','CreateMemberReport','create','body','catch','UpdateMemberReport','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','MemberReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x0af5,0x158));var _0x50af=function(_0x4a77a6,_0xe59a00){_0x4a77a6=_0x4a77a6-0x0;var _0x59b9d2=_0x0af5[_0x4a77a6];return _0x59b9d2;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var moment=require(_0x50af('0x1'));var BPromise=require(_0x50af('0x2'));var rs=require(_0x50af('0x3'));var fs=require('fs');var Redis=require(_0x50af('0x4'));var db=require(_0x50af('0x5'))['db'];var utils=require(_0x50af('0x6'));var logger=require(_0x50af('0x7'))(_0x50af('0x8'));var config=require(_0x50af('0x9'));var jayson=require(_0x50af('0xa'));var client=jayson[_0x50af('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a5c0a,_0x3724ed,_0x120038){return new BPromise(function(_0x4dc2b9,_0x49814d){return client[_0x50af('0xc')](_0x5a5c0a,_0x120038)[_0x50af('0xd')](function(_0x4c7c19){logger['info'](_0x50af('0xe'),_0x3724ed,_0x50af('0xf'));logger['debug'](_0x50af('0x10'),_0x3724ed,_0x50af('0xf'),JSON[_0x50af('0x11')](_0x4c7c19));if(_0x4c7c19[_0x50af('0x12')]){if(_0x4c7c19['error'][_0x50af('0x13')]===0x1f4){logger[_0x50af('0x12')](_0x50af('0xe'),_0x3724ed,_0x4c7c19[_0x50af('0x12')][_0x50af('0x14')]);return _0x49814d(_0x4c7c19[_0x50af('0x12')]['message']);}logger['error']('MemberReport,\x20%s,\x20%s',_0x3724ed,_0x4c7c19[_0x50af('0x12')]['message']);return _0x4dc2b9(_0x4c7c19[_0x50af('0x12')][_0x50af('0x14')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x3724ed,_0x50af('0xf'));_0x4dc2b9(_0x4c7c19[_0x50af('0x15')]['message']);}})['catch'](function(_0x615464){logger[_0x50af('0x12')](_0x50af('0xe'),_0x3724ed,_0x615464);_0x49814d(_0x615464);});});}exports[_0x50af('0x16')]=function(_0x1906e6){var _0x3c5bf7=this;return new Promise(function(_0x23bad2,_0x8a90ef){return db[_0x50af('0x17')][_0x50af('0x18')]({'raw':_0x1906e6['options']?_0x1906e6[_0x50af('0x19')][_0x50af('0x1a')]===undefined?!![]:![]:!![],'where':_0x1906e6[_0x50af('0x19')]?_0x1906e6[_0x50af('0x19')]['where']||null:null,'attributes':_0x1906e6[_0x50af('0x19')]?_0x1906e6[_0x50af('0x19')][_0x50af('0x1b')]||null:null,'limit':_0x1906e6[_0x50af('0x19')]?_0x1906e6[_0x50af('0x19')][_0x50af('0x1c')]||null:null,'include':_0x1906e6[_0x50af('0x19')]?_0x1906e6[_0x50af('0x19')][_0x50af('0x1d')]?_[_0x50af('0x1e')](_0x1906e6['options'][_0x50af('0x1d')],function(_0x156154){return{'model':db[_0x156154[_0x50af('0x1f')]],'as':_0x156154['as'],'attributes':_0x156154[_0x50af('0x1b')],'include':_0x156154[_0x50af('0x1d')]?_[_0x50af('0x1e')](_0x156154['include'],function(_0xb3c15a){return{'model':db[_0xb3c15a[_0x50af('0x1f')]],'as':_0xb3c15a['as'],'attributes':_0xb3c15a['attributes'],'include':_0xb3c15a[_0x50af('0x1d')]?_[_0x50af('0x1e')](_0xb3c15a[_0x50af('0x1d')],function(_0x5dc58a){return{'model':db[_0x5dc58a['model']],'as':_0x5dc58a['as'],'attributes':_0x5dc58a[_0x50af('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x50af('0xd')](function(_0x1e12b2){logger[_0x50af('0x20')](_0x50af('0x16'),_0x1906e6);logger[_0x50af('0x21')](_0x50af('0x16'),_0x1906e6,JSON[_0x50af('0x11')](_0x1e12b2));_0x23bad2(_0x1e12b2);})['catch'](function(_0x1a1104){logger[_0x50af('0x12')](_0x50af('0x16'),_0x1a1104['message'],_0x1906e6);_0x8a90ef(_0x3c5bf7[_0x50af('0x12')](0x1f4,_0x1a1104['message']));});});};exports[_0x50af('0x22')]=function(_0x52d65a){var _0x4a6ea4=this;return new Promise(function(_0x52ce35,_0x27b476){return db[_0x50af('0x17')][_0x50af('0x23')](_0x52d65a[_0x50af('0x24')],{'raw':_0x52d65a[_0x50af('0x19')]?_0x52d65a[_0x50af('0x19')][_0x50af('0x1a')]===undefined?!![]:![]:!![]})[_0x50af('0xd')](function(_0x239cf2){logger[_0x50af('0x20')]('CreateMemberReport',_0x52d65a);logger[_0x50af('0x21')](_0x50af('0x22'),_0x52d65a,JSON[_0x50af('0x11')](_0x239cf2));_0x52ce35(_0x239cf2);})[_0x50af('0x25')](function(_0x11e51c){logger['error'](_0x50af('0x22'),_0x11e51c['message'],_0x52d65a);_0x27b476(_0x4a6ea4['error'](0x1f4,_0x11e51c['message']));});});};exports[_0x50af('0x26')]=function(_0x1da181){var _0xb1ed5b=this;return new Promise(function(_0x3e63eb,_0x5d6cbc){return db['MemberReport']['update'](_0x1da181[_0x50af('0x24')],{'raw':_0x1da181[_0x50af('0x19')]?_0x1da181[_0x50af('0x19')][_0x50af('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1da181[_0x50af('0x19')]?_0x1da181['options'][_0x50af('0x27')]||null:null,'attributes':_0x1da181[_0x50af('0x19')]?_0x1da181[_0x50af('0x19')][_0x50af('0x1b')]||null:null,'limit':_0x1da181['options']?_0x1da181[_0x50af('0x19')][_0x50af('0x1c')]||null:null})[_0x50af('0xd')](function(_0x4bab50){logger[_0x50af('0x20')]('UpdateMemberReport',_0x1da181);logger['debug']('UpdateMemberReport',_0x1da181,JSON[_0x50af('0x11')](_0x4bab50));_0x3e63eb(_0x4bab50);})[_0x50af('0x25')](function(_0x366f6b){logger[_0x50af('0x12')](_0x50af('0x26'),_0x366f6b[_0x50af('0x14')],_0x1da181);_0x5d6cbc(_0xb1ed5b[_0x50af('0x12')](0x1f4,_0x366f6b[_0x50af('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index d3c3164..24c2cd2 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 _0x9092=['./migration.controller','get','index','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x9092,0xa9));var _0x2909=function(_0x26ef11,_0x37346a){_0x26ef11=_0x26ef11-0x0;var _0x55f498=_0x9092[_0x26ef11];return _0x55f498;};'use strict';var multer=require(_0x2909('0x0'));var util=require(_0x2909('0x1'));var path=require(_0x2909('0x2'));var timeout=require(_0x2909('0x3'));var express=require(_0x2909('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2909('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2909('0x6'));var controller=require(_0x2909('0x7'));router[_0x2909('0x8')]('/',controller[_0x2909('0x9')]);module[_0x2909('0xa')]=router; \ No newline at end of file +var _0xaa7d=['../../config/environment','./migration.controller','get','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2864ad,_0x5eb0e0){var _0x5cb4f4=function(_0x2ca956){while(--_0x2ca956){_0x2864ad['push'](_0x2864ad['shift']());}};_0x5cb4f4(++_0x5eb0e0);}(_0xaa7d,0x1ea));var _0xdaa7=function(_0x7538c5,_0xa5d8ac){_0x7538c5=_0x7538c5-0x0;var _0x8b56be=_0xaa7d[_0x7538c5];return _0x8b56be;};'use strict';var multer=require(_0xdaa7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdaa7('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdaa7('0x2'));var auth=require(_0xdaa7('0x3'));var interaction=require(_0xdaa7('0x4'));var config=require(_0xdaa7('0x5'));var controller=require(_0xdaa7('0x6'));router[_0xdaa7('0x7')]('/',controller['index']);module[_0xdaa7('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 937fcb4..b3ab989 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 _0x51dc=['exports','STRING','version','sequelize'];(function(_0x4b5512,_0x2d530b){var _0x4c8e3c=function(_0x4b2d91){while(--_0x4b2d91){_0x4b5512['push'](_0x4b5512['shift']());}};_0x4c8e3c(++_0x2d530b);}(_0x51dc,0xd3));var _0xc51d=function(_0x5e456c,_0xe835be){_0x5e456c=_0x5e456c-0x0;var _0x15f613=_0x51dc[_0x5e456c];return _0x15f613;};'use strict';var Sequelize=require(_0xc51d('0x0'));module[_0xc51d('0x1')]={'version':{'type':Sequelize[_0xc51d('0x2')],'unique':_0xc51d('0x3')}}; \ No newline at end of file +var _0xbf8d=['sequelize','exports','STRING','version'];(function(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0xbf8d,0x88));var _0xdbf8=function(_0x443494,_0x51fc7e){_0x443494=_0x443494-0x0;var _0x4a6794=_0xbf8d[_0x443494];return _0x4a6794;};'use strict';var Sequelize=require(_0xdbf8('0x0'));module[_0xdbf8('0x1')]={'version':{'type':Sequelize[_0xdbf8('0x2')],'unique':_0xdbf8('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 41b2504..244bba7 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 _0xd575=['query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','Migration','includeAll','include','rows','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','type','key','model','map'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xd575,0xca));var _0x5d57=function(_0x431796,_0xe746e0){_0x431796=_0x431796-0x0;var _0x83316e=_0xd575[_0x431796];return _0x83316e;};'use strict';var emlformat=require(_0x5d57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d57('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d57('0x2'));var moment=require(_0x5d57('0x3'));var BPromise=require(_0x5d57('0x4'));var Mustache=require(_0x5d57('0x5'));var util=require(_0x5d57('0x6'));var path=require(_0x5d57('0x7'));var sox=require(_0x5d57('0x8'));var csv=require(_0x5d57('0x9'));var ejs=require(_0x5d57('0xa'));var fs=require('fs');var fs_extra=require(_0x5d57('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5d57('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5d57('0x9'));var querystring=require('querystring');var Papa=require(_0x5d57('0xd'));var Redis=require('ioredis');var authService=require(_0x5d57('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5d57('0xf'));var hardwareService=require(_0x5d57('0x10'));var logger=require(_0x5d57('0x11'))(_0x5d57('0x12'));var utils=require('../../config/utils');var config=require(_0x5d57('0x13'));var licenseUtil=require(_0x5d57('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x318fbd,_0xe504d1){_0xe504d1=_0xe504d1||0xcc;return function(_0xc3406c){if(_0xc3406c){return _0x318fbd[_0x5d57('0x15')](_0xe504d1);}return _0x318fbd[_0x5d57('0x16')](_0xe504d1)['end']();};}function respondWithResult(_0x2396f5,_0x2b9755){_0x2b9755=_0x2b9755||0xc8;return function(_0x5517dc){if(_0x5517dc){return _0x2396f5['status'](_0x2b9755)['json'](_0x5517dc);}};}function respondWithFilteredResult(_0x4d178c,_0x2c6289){return function(_0x27cc53){if(_0x27cc53){var _0x122f53=typeof _0x2c6289['offset']===_0x5d57('0x17')&&typeof _0x2c6289[_0x5d57('0x18')]===_0x5d57('0x17');var _0x38e106=_0x27cc53[_0x5d57('0x19')];var _0x44f831=_0x122f53?0x0:_0x2c6289[_0x5d57('0x1a')];var _0x56b4a6=_0x122f53?_0x27cc53[_0x5d57('0x19')]:_0x2c6289[_0x5d57('0x1a')]+_0x2c6289[_0x5d57('0x18')];var _0x501a13;if(_0x56b4a6>=_0x38e106){_0x56b4a6=_0x38e106;_0x501a13=0xc8;}else{_0x501a13=0xce;}_0x4d178c[_0x5d57('0x16')](_0x501a13);return _0x4d178c['set'](_0x5d57('0x1b'),_0x44f831+'-'+_0x56b4a6+'/'+_0x38e106)['json'](_0x27cc53);}return null;};}function patchUpdates(_0x3a36a3){return function(_0x23bca4){try{jsonpatch[_0x5d57('0x1c')](_0x23bca4,_0x3a36a3,!![]);}catch(_0x38c37e){return BPromise[_0x5d57('0x1d')](_0x38c37e);}return _0x23bca4[_0x5d57('0x1e')]();};}function saveUpdates(_0x17208c,_0x59278f){return function(_0x104633){if(_0x104633){return _0x104633[_0x5d57('0x1f')](_0x17208c)[_0x5d57('0x20')](function(_0x44d820){return _0x44d820;});}return null;};}function removeEntity(_0x198e3f,_0x322981){return function(_0x5e9ebb){if(_0x5e9ebb){return _0x5e9ebb['destroy']()['then'](function(){_0x198e3f[_0x5d57('0x16')](0xcc)[_0x5d57('0x21')]();});}};}function handleEntityNotFound(_0x1cfa90,_0x18d8ce){return function(_0x327d07){if(!_0x327d07){_0x1cfa90[_0x5d57('0x15')](0x194);}return _0x327d07;};}function handleError(_0x13fc36,_0x1e3932){_0x1e3932=_0x1e3932||0x1f4;return function(_0x4e25ce){logger[_0x5d57('0x22')](_0x4e25ce[_0x5d57('0x23')]);if(_0x4e25ce[_0x5d57('0x24')]){delete _0x4e25ce[_0x5d57('0x24')];}_0x13fc36[_0x5d57('0x16')](_0x1e3932)[_0x5d57('0x25')](_0x4e25ce);};}exports['index']=function(_0xd9892a,_0x2a81ed){var _0x450214={},_0x4108ec={},_0x564023={'count':0x0,'rows':[]};var _0x5dc419=_['map'](db['Migration']['rawAttributes'],function(_0x425fcb){return{'name':_0x425fcb['fieldName'],'type':_0x425fcb[_0x5d57('0x26')][_0x5d57('0x27')]};});_0x4108ec[_0x5d57('0x28')]=_[_0x5d57('0x29')](_0x5dc419,_0x5d57('0x24'));_0x4108ec[_0x5d57('0x2a')]=_[_0x5d57('0x2b')](_0xd9892a[_0x5d57('0x2a')]);_0x4108ec['filters']=_[_0x5d57('0x2c')](_0x4108ec[_0x5d57('0x28')],_0x4108ec['query']);_0x450214[_0x5d57('0x2d')]=_[_0x5d57('0x2c')](_0x4108ec['model'],qs[_0x5d57('0x2e')](_0xd9892a[_0x5d57('0x2a')][_0x5d57('0x2e')]));_0x450214[_0x5d57('0x2d')]=_0x450214['attributes'][_0x5d57('0x2f')]?_0x450214['attributes']:_0x4108ec[_0x5d57('0x28')];if(!_0xd9892a[_0x5d57('0x2a')]['hasOwnProperty'](_0x5d57('0x30'))){_0x450214['limit']=qs[_0x5d57('0x18')](_0xd9892a[_0x5d57('0x2a')][_0x5d57('0x18')]);_0x450214[_0x5d57('0x1a')]=qs[_0x5d57('0x1a')](_0xd9892a['query'][_0x5d57('0x1a')]);}_0x450214[_0x5d57('0x31')]=qs['sort'](_0xd9892a[_0x5d57('0x2a')][_0x5d57('0x32')]);_0x450214[_0x5d57('0x33')]=qs['filters'](_[_0x5d57('0x34')](_0xd9892a['query'],_0x4108ec[_0x5d57('0x35')]),_0x5dc419);if(_0xd9892a[_0x5d57('0x2a')][_0x5d57('0x36')]){_0x450214[_0x5d57('0x33')]=_[_0x5d57('0x37')](_0x450214[_0x5d57('0x33')],{'$or':_[_0x5d57('0x29')](_0x5dc419,function(_0x26c109){if(_0x26c109[_0x5d57('0x26')]!==_0x5d57('0x38')){var _0x33747a={};_0x33747a[_0x26c109[_0x5d57('0x24')]]={'$like':'%'+_0xd9892a['query'][_0x5d57('0x36')]+'%'};return _0x33747a;}})});}_0x450214=_[_0x5d57('0x37')]({},_0x450214,_0xd9892a['options']);var _0x487775={'where':_0x450214[_0x5d57('0x33')]};return db[_0x5d57('0x39')][_0x5d57('0x19')](_0x487775)[_0x5d57('0x20')](function(_0x2d6eb8){_0x564023['count']=_0x2d6eb8;if(_0xd9892a[_0x5d57('0x2a')][_0x5d57('0x3a')]){_0x450214[_0x5d57('0x3b')]=[{'all':!![]}];}return db[_0x5d57('0x39')]['findAll'](_0x450214);})[_0x5d57('0x20')](function(_0x5c0fec){_0x564023[_0x5d57('0x3c')]=_0x5c0fec;return _0x564023;})[_0x5d57('0x20')](respondWithFilteredResult(_0x2a81ed,_0x450214))['catch'](handleError(_0x2a81ed,null));}; \ No newline at end of file +var _0x779d=['destroy','error','name','map','Migration','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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','sendStatus','status','end','json','offset','count','apply','save','then'];(function(_0x2662d2,_0xbfa925){var _0x242ff4=function(_0x423e6d){while(--_0x423e6d){_0x2662d2['push'](_0x2662d2['shift']());}};_0x242ff4(++_0xbfa925);}(_0x779d,0x16c));var _0xd779=function(_0x1e1903,_0x28ffd6){_0x1e1903=_0x1e1903-0x0;var _0x3e8ecc=_0x779d[_0x1e1903];return _0x3e8ecc;};'use strict';var emlformat=require(_0xd779('0x0'));var rimraf=require(_0xd779('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd779('0x2'));var rp=require(_0xd779('0x3'));var moment=require(_0xd779('0x4'));var BPromise=require(_0xd779('0x5'));var Mustache=require(_0xd779('0x6'));var util=require(_0xd779('0x7'));var path=require(_0xd779('0x8'));var sox=require(_0xd779('0x9'));var csv=require(_0xd779('0xa'));var ejs=require(_0xd779('0xb'));var fs=require('fs');var fs_extra=require(_0xd779('0xc'));var _=require(_0xd779('0xd'));var squel=require(_0xd779('0xe'));var crypto=require('crypto');var jsforce=require(_0xd779('0xf'));var deskjs=require(_0xd779('0x10'));var toCsv=require(_0xd779('0xa'));var querystring=require(_0xd779('0x11'));var Papa=require(_0xd779('0x12'));var Redis=require(_0xd779('0x13'));var authService=require(_0xd779('0x14'));var qs=require(_0xd779('0x15'));var as=require(_0xd779('0x16'));var hardwareService=require(_0xd779('0x17'));var logger=require(_0xd779('0x18'))(_0xd779('0x19'));var utils=require(_0xd779('0x1a'));var config=require(_0xd779('0x1b'));var licenseUtil=require(_0xd779('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x374870,_0x24e4f4){_0x24e4f4=_0x24e4f4||0xcc;return function(_0x41a211){if(_0x41a211){return _0x374870[_0xd779('0x1d')](_0x24e4f4);}return _0x374870[_0xd779('0x1e')](_0x24e4f4)[_0xd779('0x1f')]();};}function respondWithResult(_0x59e1c9,_0x1fa66c){_0x1fa66c=_0x1fa66c||0xc8;return function(_0x3d8c24){if(_0x3d8c24){return _0x59e1c9[_0xd779('0x1e')](_0x1fa66c)[_0xd779('0x20')](_0x3d8c24);}};}function respondWithFilteredResult(_0x3ba9ff,_0x3d1ba9){return function(_0x3cbfb1){if(_0x3cbfb1){var _0x369771=typeof _0x3d1ba9[_0xd779('0x21')]==='undefined'&&typeof _0x3d1ba9['limit']==='undefined';var _0x393daf=_0x3cbfb1[_0xd779('0x22')];var _0x2b2319=_0x369771?0x0:_0x3d1ba9[_0xd779('0x21')];var _0xdeee4b=_0x369771?_0x3cbfb1['count']:_0x3d1ba9['offset']+_0x3d1ba9['limit'];var _0x3b2db6;if(_0xdeee4b>=_0x393daf){_0xdeee4b=_0x393daf;_0x3b2db6=0xc8;}else{_0x3b2db6=0xce;}_0x3ba9ff[_0xd779('0x1e')](_0x3b2db6);return _0x3ba9ff['set']('Content-Range',_0x2b2319+'-'+_0xdeee4b+'/'+_0x393daf)['json'](_0x3cbfb1);}return null;};}function patchUpdates(_0x633a97){return function(_0x4d9e12){try{jsonpatch[_0xd779('0x23')](_0x4d9e12,_0x633a97,!![]);}catch(_0x27008c){return BPromise['reject'](_0x27008c);}return _0x4d9e12[_0xd779('0x24')]();};}function saveUpdates(_0x5e0461,_0x427d44){return function(_0x31a666){if(_0x31a666){return _0x31a666['update'](_0x5e0461)[_0xd779('0x25')](function(_0x1ec9f8){return _0x1ec9f8;});}return null;};}function removeEntity(_0xf214dc,_0x40d3f7){return function(_0x1afc04){if(_0x1afc04){return _0x1afc04[_0xd779('0x26')]()[_0xd779('0x25')](function(){_0xf214dc[_0xd779('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f342e,_0x3e4f15){return function(_0xa65d31){if(!_0xa65d31){_0x4f342e[_0xd779('0x1d')](0x194);}return _0xa65d31;};}function handleError(_0x4d7e19,_0x450986){_0x450986=_0x450986||0x1f4;return function(_0x93c55a){logger[_0xd779('0x27')](_0x93c55a['stack']);if(_0x93c55a['name']){delete _0x93c55a[_0xd779('0x28')];}_0x4d7e19[_0xd779('0x1e')](_0x450986)['send'](_0x93c55a);};}exports['index']=function(_0x2ad735,_0x376e9d){var _0x5d0576={},_0x52d370={},_0x3a2e92={'count':0x0,'rows':[]};var _0x252f91=_[_0xd779('0x29')](db[_0xd779('0x2a')][_0xd779('0x2b')],function(_0x28e3d8){return{'name':_0x28e3d8[_0xd779('0x2c')],'type':_0x28e3d8[_0xd779('0x2d')][_0xd779('0x2e')]};});_0x52d370[_0xd779('0x2f')]=_[_0xd779('0x29')](_0x252f91,'name');_0x52d370[_0xd779('0x30')]=_['keys'](_0x2ad735['query']);_0x52d370['filters']=_[_0xd779('0x31')](_0x52d370['model'],_0x52d370[_0xd779('0x30')]);_0x5d0576[_0xd779('0x32')]=_[_0xd779('0x31')](_0x52d370[_0xd779('0x2f')],qs[_0xd779('0x33')](_0x2ad735[_0xd779('0x30')][_0xd779('0x33')]));_0x5d0576['attributes']=_0x5d0576[_0xd779('0x32')][_0xd779('0x34')]?_0x5d0576[_0xd779('0x32')]:_0x52d370[_0xd779('0x2f')];if(!_0x2ad735[_0xd779('0x30')][_0xd779('0x35')]('nolimit')){_0x5d0576[_0xd779('0x36')]=qs[_0xd779('0x36')](_0x2ad735[_0xd779('0x30')][_0xd779('0x36')]);_0x5d0576[_0xd779('0x21')]=qs[_0xd779('0x21')](_0x2ad735[_0xd779('0x30')][_0xd779('0x21')]);}_0x5d0576[_0xd779('0x37')]=qs['sort'](_0x2ad735['query'][_0xd779('0x38')]);_0x5d0576[_0xd779('0x39')]=qs[_0xd779('0x3a')](_[_0xd779('0x3b')](_0x2ad735[_0xd779('0x30')],_0x52d370[_0xd779('0x3a')]),_0x252f91);if(_0x2ad735[_0xd779('0x30')][_0xd779('0x3c')]){_0x5d0576[_0xd779('0x39')]=_[_0xd779('0x3d')](_0x5d0576[_0xd779('0x39')],{'$or':_[_0xd779('0x29')](_0x252f91,function(_0x160ec8){if(_0x160ec8[_0xd779('0x2d')]!==_0xd779('0x3e')){var _0xd69bdd={};_0xd69bdd[_0x160ec8[_0xd779('0x28')]]={'$like':'%'+_0x2ad735[_0xd779('0x30')]['filter']+'%'};return _0xd69bdd;}})});}_0x5d0576=_['merge']({},_0x5d0576,_0x2ad735[_0xd779('0x3f')]);var _0x161e2b={'where':_0x5d0576[_0xd779('0x39')]};return db[_0xd779('0x2a')][_0xd779('0x22')](_0x161e2b)['then'](function(_0x2ab77a){_0x3a2e92[_0xd779('0x22')]=_0x2ab77a;if(_0x2ad735[_0xd779('0x30')][_0xd779('0x40')]){_0x5d0576[_0xd779('0x41')]=[{'all':!![]}];}return db[_0xd779('0x2a')][_0xd779('0x42')](_0x5d0576);})[_0xd779('0x25')](function(_0x57a48c){_0x3a2e92['rows']=_0x57a48c;return _0x3a2e92;})['then'](respondWithFilteredResult(_0x376e9d,_0x5d0576))['catch'](handleError(_0x376e9d,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 10ff1b2..6212973 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 _0x82bf=['rimraf','./migration.attributes','exports','Migration','migrations','lodash','api','moment','bluebird'];(function(_0x38b8f8,_0x4c1c61){var _0x3aa50f=function(_0x44828c){while(--_0x44828c){_0x38b8f8['push'](_0x38b8f8['shift']());}};_0x3aa50f(++_0x4c1c61);}(_0x82bf,0x7a));var _0xf82b=function(_0x41ab84,_0x5cdc3d){_0x41ab84=_0x41ab84-0x0;var _0x2d54d5=_0x82bf[_0x41ab84];return _0x2d54d5;};'use strict';var _=require(_0xf82b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf82b('0x1'));var moment=require(_0xf82b('0x2'));var BPromise=require(_0xf82b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf82b('0x4'));var config=require('../../config/environment');var attributes=require(_0xf82b('0x5'));module[_0xf82b('0x6')]=function(_0x4bdf6e,_0x161634){return _0x4bdf6e['define'](_0xf82b('0x7'),attributes,{'tableName':_0xf82b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7c5=['bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','Migration','lodash','util','../../config/logger','api','moment'];(function(_0x3f6a40,_0x306d6c){var _0x1e6073=function(_0x30eaaa){while(--_0x30eaaa){_0x3f6a40['push'](_0x3f6a40['shift']());}};_0x1e6073(++_0x306d6c);}(_0xe7c5,0x1b5));var _0x5e7c=function(_0x12d1e5,_0x12d165){_0x12d1e5=_0x12d1e5-0x0;var _0x52483e=_0xe7c5[_0x12d1e5];return _0x52483e;};'use strict';var _=require(_0x5e7c('0x0'));var util=require(_0x5e7c('0x1'));var logger=require(_0x5e7c('0x2'))(_0x5e7c('0x3'));var moment=require(_0x5e7c('0x4'));var BPromise=require(_0x5e7c('0x5'));var rp=require(_0x5e7c('0x6'));var fs=require('fs');var path=require(_0x5e7c('0x7'));var rimraf=require(_0x5e7c('0x8'));var config=require(_0x5e7c('0x9'));var attributes=require(_0x5e7c('0xa'));module[_0x5e7c('0xb')]=function(_0x43214d,_0x47295b){return _0x43214d['define'](_0x5e7c('0xc'),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 1183851..7249087 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 _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(_0x4d5577,_0xc52226){var _0x723613=function(_0x3f859b){while(--_0x3f859b){_0x4d5577['push'](_0x4d5577['shift']());}};_0x723613(++_0xc52226);}(_0x8aa7,0xb6));var _0x78aa=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x8aa7[_0x166742];return _0xb7814a;};'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 +var _0xa62c=['request','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x30ae0c,_0x528309){var _0x4149e8=function(_0x19e997){while(--_0x19e997){_0x30ae0c['push'](_0x30ae0c['shift']());}};_0x4149e8(++_0x528309);}(_0xa62c,0x70));var _0xca62=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0xa62c[_0x2c7dc6];return _0x10002b;};'use strict';var _=require(_0xca62('0x0'));var util=require(_0xca62('0x1'));var moment=require(_0xca62('0x2'));var BPromise=require(_0xca62('0x3'));var rs=require(_0xca62('0x4'));var fs=require('fs');var Redis=require(_0xca62('0x5'));var db=require(_0xca62('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xca62('0x7'))(_0xca62('0x8'));var config=require(_0xca62('0x9'));var jayson=require(_0xca62('0xa'));var client=jayson[_0xca62('0xb')][_0xca62('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x310378,_0x4584ab,_0x5da9b9){return new BPromise(function(_0x2160c4,_0xd7f11b){return client[_0xca62('0xd')](_0x310378,_0x5da9b9)['then'](function(_0x29fce7){logger[_0xca62('0xe')](_0xca62('0xf'),_0x4584ab,'request\x20sent');logger[_0xca62('0x10')](_0xca62('0x11'),_0x4584ab,_0xca62('0x12'),JSON[_0xca62('0x13')](_0x29fce7));if(_0x29fce7[_0xca62('0x14')]){if(_0x29fce7[_0xca62('0x14')][_0xca62('0x15')]===0x1f4){logger[_0xca62('0x14')](_0xca62('0xf'),_0x4584ab,_0x29fce7['error'][_0xca62('0x16')]);return _0xd7f11b(_0x29fce7[_0xca62('0x14')][_0xca62('0x16')]);}logger['error']('Migration,\x20%s,\x20%s',_0x4584ab,_0x29fce7['error'][_0xca62('0x16')]);return _0x2160c4(_0x29fce7['error'][_0xca62('0x16')]);}else{logger[_0xca62('0xe')]('Migration,\x20%s,\x20%s',_0x4584ab,'request\x20sent');_0x2160c4(_0x29fce7[_0xca62('0x17')][_0xca62('0x16')]);}})[_0xca62('0x18')](function(_0x5512c2){logger[_0xca62('0x14')](_0xca62('0xf'),_0x4584ab,_0x5512c2);_0xd7f11b(_0x5512c2);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 7d01c1b..c5a69c2 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 _0xee55=['index','/:id','show','create','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated'];(function(_0x5ab5c8,_0x322675){var _0x5e97fe=function(_0x2e6e32){while(--_0x2e6e32){_0x5ab5c8['push'](_0x5ab5c8['shift']());}};_0x5e97fe(++_0x322675);}(_0xee55,0x1a0));var _0x5ee5=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xee55[_0x5d9867];return _0x7d2118;};'use strict';var multer=require(_0x5ee5('0x0'));var util=require('util');var path=require(_0x5ee5('0x1'));var timeout=require('connect-timeout');var express=require(_0x5ee5('0x2'));var router=express['Router']();var fs_extra=require(_0x5ee5('0x3'));var auth=require(_0x5ee5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5ee5('0x5'));var controller=require(_0x5ee5('0x6'));router[_0x5ee5('0x7')]('/',auth[_0x5ee5('0x8')](),controller[_0x5ee5('0x9')]);router[_0x5ee5('0x7')](_0x5ee5('0xa'),auth['isAuthenticated'](),controller[_0x5ee5('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5ee5('0xc')]);router['put']('/:id',auth[_0x5ee5('0x8')](),controller[_0x5ee5('0xd')]);router[_0x5ee5('0xe')](_0x5ee5('0xa'),auth['isAuthenticated'](),controller[_0x5ee5('0xf')]);module[_0x5ee5('0x10')]=router; \ No newline at end of file +var _0x9ed7=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','put','destroy','exports','multer','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ed7,0x16d));var _0x79ed=function(_0x2e655a,_0x6d5799){_0x2e655a=_0x2e655a-0x0;var _0x26f13b=_0x9ed7[_0x2e655a];return _0x26f13b;};'use strict';var multer=require(_0x79ed('0x0'));var util=require('util');var path=require(_0x79ed('0x1'));var timeout=require(_0x79ed('0x2'));var express=require(_0x79ed('0x3'));var router=express[_0x79ed('0x4')]();var fs_extra=require(_0x79ed('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x79ed('0x6'));var config=require(_0x79ed('0x7'));var controller=require('./network.controller');router['get']('/',auth[_0x79ed('0x8')](),controller[_0x79ed('0x9')]);router[_0x79ed('0xa')](_0x79ed('0xb'),auth[_0x79ed('0x8')](),controller['show']);router[_0x79ed('0xc')]('/',auth[_0x79ed('0x8')](),controller['create']);router[_0x79ed('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x79ed('0xb'),auth['isAuthenticated'](),controller[_0x79ed('0xe')]);module[_0x79ed('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 59ecd1b..1fb87c7 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 _0xce10=['STRING','sequelize','exports','ENUM','localnet','externip','turn'];(function(_0x3bd9ce,_0x5874d4){var _0x1e67a9=function(_0x213dca){while(--_0x213dca){_0x3bd9ce['push'](_0x3bd9ce['shift']());}};_0x1e67a9(++_0x5874d4);}(_0xce10,0x189));var _0x0ce1=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xce10[_0x26f702];return _0x11417d;};'use strict';var Sequelize=require(_0x0ce1('0x0'));module[_0x0ce1('0x1')]={'type':{'type':Sequelize[_0x0ce1('0x2')](_0x0ce1('0x3'),_0x0ce1('0x4'),'stun',_0x0ce1('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0ce1('0x6')]},'password':{'type':Sequelize[_0x0ce1('0x6')]}}; \ No newline at end of file +var _0x3437=['sequelize','exports','ENUM','externip','stun','turn','STRING'];(function(_0x3c8bc4,_0x10e254){var _0x195fb7=function(_0x23a0ea){while(--_0x23a0ea){_0x3c8bc4['push'](_0x3c8bc4['shift']());}};_0x195fb7(++_0x10e254);}(_0x3437,0x157));var _0x7343=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3437[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x7343('0x0'));module[_0x7343('0x1')]={'type':{'type':Sequelize[_0x7343('0x2')]('localnet',_0x7343('0x3'),_0x7343('0x4'),_0x7343('0x5'))},'value':{'type':Sequelize[_0x7343('0x6')]},'username':{'type':Sequelize[_0x7343('0x6')]},'password':{'type':Sequelize[_0x7343('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index bc49500..f405382 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 _0xaaee=['server/files/templates/network.ejs','render','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','TURN','find','findAll','/etc/asterisk/stun_xcally.conf','format','util','path','ejs','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','json','offset','undefined','count','limit','status','set','Content-Range','update','destroy','stack','name','send','map','Network','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','include','create','body','toUpperCase','STUN','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','readFileSync','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xaaee,0xb6));var _0xeaae=function(_0x22dee5,_0x30816b){_0x22dee5=_0x22dee5-0x0;var _0x265a64=_0xaaee[_0x22dee5];return _0x265a64;};'use strict';var util=require(_0xeaae('0x0'));var path=require(_0xeaae('0x1'));var ejs=require(_0xeaae('0x2'));var fs=require('fs');var _=require(_0xeaae('0x3'));var qs=require(_0xeaae('0x4'));var logger=require('../../config/logger')(_0xeaae('0x5'));var config=require(_0xeaae('0x6'));var db=require(_0xeaae('0x7'))['db'];var jayson=require(_0xeaae('0x8'));var client=jayson[_0xeaae('0x9')][_0xeaae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x452598,_0x1a476a,_0x3e04c1,_0x24b048){return new Promise(function(_0x302c66,_0xf4c208){var _0x347ccd=_0x24b048||client;return _0x347ccd[_0xeaae('0xb')](_0x452598,_0x3e04c1)[_0xeaae('0xc')](function(_0x140446){logger[_0xeaae('0xd')](_0xeaae('0xe'),_0x1a476a,_0xeaae('0xf'));logger[_0xeaae('0x10')]('Network,\x20%s,\x20%s,\x20%s',_0x1a476a,_0xeaae('0xf'),JSON[_0xeaae('0x11')](_0x140446));if(_0x140446[_0xeaae('0x12')]){if(_0x140446['error'][_0xeaae('0x13')]===0x1f4){logger[_0xeaae('0x12')]('Network,\x20%s,\x20%s',_0x1a476a,_0x140446[_0xeaae('0x12')][_0xeaae('0x14')]);return _0xf4c208(_0x140446['error'][_0xeaae('0x14')]);}logger[_0xeaae('0x12')]('Network,\x20%s,\x20%s',_0x1a476a,_0x140446[_0xeaae('0x12')][_0xeaae('0x14')]);return _0x302c66(_0x140446['error'][_0xeaae('0x14')]);}else{logger[_0xeaae('0xd')](_0xeaae('0xe'),_0x1a476a,_0xeaae('0xf'));_0x302c66(_0x140446[_0xeaae('0x15')][_0xeaae('0x14')]);}})[_0xeaae('0x16')](function(_0x25dc6e){logger[_0xeaae('0x12')](_0xeaae('0xe'),_0x1a476a,_0x25dc6e);_0xf4c208(_0x25dc6e);});});}function respondWithResult(_0x37f322,_0x20b0e1){_0x20b0e1=_0x20b0e1||0xc8;return function(_0x25cb0f){if(_0x25cb0f){return _0x37f322['status'](_0x20b0e1)[_0xeaae('0x17')](_0x25cb0f);}};}function respondWithFilteredResult(_0x716da3,_0x5e4467){return function(_0x44d2c5){if(_0x44d2c5){var _0x3a183c=typeof _0x5e4467[_0xeaae('0x18')]===_0xeaae('0x19')&&typeof _0x5e4467['limit']===_0xeaae('0x19');var _0x43ce40=_0x44d2c5[_0xeaae('0x1a')];var _0x14bdbb=_0x3a183c?0x0:_0x5e4467[_0xeaae('0x18')];var _0x2ccef4=_0x3a183c?_0x44d2c5['count']:_0x5e4467['offset']+_0x5e4467[_0xeaae('0x1b')];var _0x1bc9f5;if(_0x2ccef4>=_0x43ce40){_0x2ccef4=_0x43ce40;_0x1bc9f5=0xc8;}else{_0x1bc9f5=0xce;}_0x716da3[_0xeaae('0x1c')](_0x1bc9f5);return _0x716da3[_0xeaae('0x1d')](_0xeaae('0x1e'),_0x14bdbb+'-'+_0x2ccef4+'/'+_0x43ce40)[_0xeaae('0x17')](_0x44d2c5);}return null;};}function saveUpdates(_0x221620){return function(_0x45fee1){if(_0x45fee1){return _0x45fee1[_0xeaae('0x1f')](_0x221620)[_0xeaae('0xc')](function(_0x713496){return _0x713496;});}return null;};}function removeEntity(_0x568779){return function(_0x4539cd){if(_0x4539cd){return _0x4539cd[_0xeaae('0x20')]()[_0xeaae('0xc')](function(){_0x568779['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ceab2){return function(_0x3fb2e9){if(!_0x3fb2e9){_0x9ceab2['sendStatus'](0x194);}return _0x3fb2e9;};}function handleError(_0x2ef861,_0xb34211){_0xb34211=_0xb34211||0x1f4;return function(_0x159df6){logger['error'](_0x159df6[_0xeaae('0x21')]);if(_0x159df6[_0xeaae('0x22')]){delete _0x159df6[_0xeaae('0x22')];}_0x2ef861[_0xeaae('0x1c')](_0xb34211)[_0xeaae('0x23')](_0x159df6);};}exports['index']=function(_0x742928,_0x39c3bb){var _0x189706={},_0x33c132={},_0x3b169f={'count':0x0,'rows':[]};var _0x29f2a9=_[_0xeaae('0x24')](db[_0xeaae('0x25')]['rawAttributes'],function(_0x3ba670){return{'name':_0x3ba670[_0xeaae('0x26')],'type':_0x3ba670[_0xeaae('0x27')][_0xeaae('0x28')]};});_0x33c132[_0xeaae('0x29')]=_[_0xeaae('0x24')](_0x29f2a9,_0xeaae('0x22'));_0x33c132[_0xeaae('0x2a')]=_[_0xeaae('0x2b')](_0x742928[_0xeaae('0x2a')]);_0x33c132['filters']=_[_0xeaae('0x2c')](_0x33c132[_0xeaae('0x29')],_0x33c132['query']);_0x189706[_0xeaae('0x2d')]=_[_0xeaae('0x2c')](_0x33c132['model'],qs[_0xeaae('0x2e')](_0x742928[_0xeaae('0x2a')][_0xeaae('0x2e')]));_0x189706[_0xeaae('0x2d')]=_0x189706[_0xeaae('0x2d')][_0xeaae('0x2f')]?_0x189706[_0xeaae('0x2d')]:_0x33c132[_0xeaae('0x29')];if(!_0x742928[_0xeaae('0x2a')][_0xeaae('0x30')](_0xeaae('0x31'))){_0x189706[_0xeaae('0x1b')]=qs[_0xeaae('0x1b')](_0x742928[_0xeaae('0x2a')]['limit']);_0x189706[_0xeaae('0x18')]=qs[_0xeaae('0x18')](_0x742928[_0xeaae('0x2a')][_0xeaae('0x18')]);}_0x189706['order']=qs['sort'](_0x742928['query']['sort']);_0x189706['where']=qs[_0xeaae('0x32')](_[_0xeaae('0x33')](_0x742928['query'],_0x33c132[_0xeaae('0x32')]),_0x29f2a9);if(_0x742928['query'][_0xeaae('0x34')]){_0x189706[_0xeaae('0x35')]=_[_0xeaae('0x36')](_0x189706[_0xeaae('0x35')],{'$or':_[_0xeaae('0x24')](_0x29f2a9,function(_0x279946){if(_0x279946[_0xeaae('0x27')]!==_0xeaae('0x37')){var _0x1d228a={};_0x1d228a[_0x279946[_0xeaae('0x22')]]={'$like':'%'+_0x742928['query']['filter']+'%'};return _0x1d228a;}})});}_0x189706=_[_0xeaae('0x36')]({},_0x189706,_0x742928[_0xeaae('0x38')]);var _0x190f30={'where':_0x189706['where']};return db[_0xeaae('0x25')][_0xeaae('0x1a')](_0x190f30)[_0xeaae('0xc')](function(_0x580c17){_0x3b169f[_0xeaae('0x1a')]=_0x580c17;if(_0x742928[_0xeaae('0x2a')][_0xeaae('0x39')]){_0x189706['include']=[{'all':!![]}];}return db['Network']['findAll'](_0x189706);})[_0xeaae('0xc')](function(_0x1f22d2){_0x3b169f[_0xeaae('0x3a')]=_0x1f22d2;return _0x3b169f;})['then'](respondWithFilteredResult(_0x39c3bb,_0x189706))[_0xeaae('0x16')](handleError(_0x39c3bb,null));};exports[_0xeaae('0x3b')]=function(_0x8ac15b,_0xd07d73){var _0xca7417={'raw':!![],'where':{'id':_0x8ac15b[_0xeaae('0x3c')]['id']}},_0x2de768={};_0x2de768[_0xeaae('0x29')]=_['keys'](db[_0xeaae('0x25')]['rawAttributes']);_0x2de768[_0xeaae('0x2a')]=_['keys'](_0x8ac15b[_0xeaae('0x2a')]);_0x2de768[_0xeaae('0x32')]=_[_0xeaae('0x2c')](_0x2de768['model'],_0x2de768[_0xeaae('0x2a')]);_0xca7417['attributes']=_[_0xeaae('0x2c')](_0x2de768[_0xeaae('0x29')],qs['fields'](_0x8ac15b[_0xeaae('0x2a')][_0xeaae('0x2e')]));_0xca7417[_0xeaae('0x2d')]=_0xca7417[_0xeaae('0x2d')][_0xeaae('0x2f')]?_0xca7417[_0xeaae('0x2d')]:_0x2de768[_0xeaae('0x29')];if(_0x8ac15b['query']['includeAll']){_0xca7417[_0xeaae('0x3d')]=[{'all':!![]}];}_0xca7417=_['merge']({},_0xca7417,_0x8ac15b[_0xeaae('0x38')]);return db[_0xeaae('0x25')]['find'](_0xca7417)[_0xeaae('0xc')](handleEntityNotFound(_0xd07d73,null))[_0xeaae('0xc')](respondWithResult(_0xd07d73,null))[_0xeaae('0x16')](handleError(_0xd07d73,null));};exports[_0xeaae('0x3e')]=function(_0x3e4371,_0x189881){var _0x1fb87c;return db[_0xeaae('0x25')][_0xeaae('0x3e')](_0x3e4371[_0xeaae('0x3f')],{'raw':!![]})['then'](function(_0x30bd26){_0x1fb87c=_0x30bd26;return db[_0xeaae('0x25')]['findAll']({'where':{'type':_0x3e4371['body'][_0xeaae('0x27')]},'raw':!![]});})[_0xeaae('0xc')](function(_0x2cc720){if(_0x1fb87c[_0xeaae('0x27')][_0xeaae('0x40')]()==_0xeaae('0x41')){var _0x5a3708=fs['readFileSync'](path['join'](config[_0xeaae('0x42')],_0xeaae('0x43')),_0xeaae('0x44'));var _0x57552d=ejs['render'](_0x5a3708,{'networks':_0x2cc720||[]});fs[_0xeaae('0x45')]('/etc/asterisk/stun_xcally.conf',_0x57552d);return respondWithRpcPromise(_0xeaae('0x46'),_0xeaae('0x3e'),{'module':_0xeaae('0x47')});}else if(_0x1fb87c[_0xeaae('0x27')]['toUpperCase']()=='TURN'){var _0x5068e6=fs[_0xeaae('0x48')](path[_0xeaae('0x49')](config['root'],_0xeaae('0x4a')),_0xeaae('0x44'));var _0x24ce21=ejs['render'](_0x5068e6,{'networks':_0x2cc720||[]});fs[_0xeaae('0x45')](_0xeaae('0x4b'),_0x24ce21);return respondWithRpcPromise(_0xeaae('0x46'),_0xeaae('0x3e'),{'module':_0xeaae('0x47')});}else{var _0x275f94=fs['readFileSync'](path['join'](config['root'],_0xeaae('0x4c')),'utf8');var _0x56424d=ejs[_0xeaae('0x4d')](_0x275f94,{'networks':_0x2cc720||[]});fs[_0xeaae('0x45')](util['format'](_0xeaae('0x4e'),_0x3e4371[_0xeaae('0x3f')][_0xeaae('0x27')][_0xeaae('0x4f')]()),_0x56424d);return respondWithRpcPromise('Reload',_0xeaae('0x3e'),{'module':_0xeaae('0x50')});}})[_0xeaae('0xc')](function(){return _0x1fb87c;})[_0xeaae('0xc')](respondWithResult(_0x189881,0xc9))[_0xeaae('0x16')](handleError(_0x189881,null));};exports[_0xeaae('0x1f')]=function(_0x57a402,_0x5dcff0){var _0x597fe1;return db[_0xeaae('0x25')]['find']({'where':{'id':_0x57a402[_0xeaae('0x3c')]['id']}})[_0xeaae('0xc')](handleEntityNotFound(_0x5dcff0,null))[_0xeaae('0xc')](saveUpdates(_0x57a402['body'],null))[_0xeaae('0xc')](function(_0x23939b){if(_0x23939b){_0x597fe1=_0x23939b;return db[_0xeaae('0x25')]['findAll']({'where':{'type':_0x597fe1[_0xeaae('0x27')]},'raw':!![]});}return null;})[_0xeaae('0xc')](function(_0x59d6a4){if(_0x597fe1[_0xeaae('0x27')]['toUpperCase']()=='STUN'){var _0x4bff5f=fs[_0xeaae('0x48')](path[_0xeaae('0x49')](config[_0xeaae('0x42')],_0xeaae('0x43')),_0xeaae('0x44'));var _0x3ec00b=ejs['render'](_0x4bff5f,{'networks':_0x59d6a4||[]});fs[_0xeaae('0x45')]('/etc/asterisk/stun_xcally.conf',_0x3ec00b);return respondWithRpcPromise(_0xeaae('0x46'),_0xeaae('0x1f'),{'module':'res_stun_monitor.so'});}else if(_0x597fe1['type'][_0xeaae('0x40')]()==_0xeaae('0x51')){var _0x22f9ce=fs[_0xeaae('0x48')](path[_0xeaae('0x49')](config[_0xeaae('0x42')],_0xeaae('0x4a')),'utf8');var _0x1e1ecc=ejs[_0xeaae('0x4d')](_0x22f9ce,{'networks':_0x59d6a4||[]});fs[_0xeaae('0x45')]('/etc/asterisk/turn_xcally.conf',_0x1e1ecc);return respondWithRpcPromise(_0xeaae('0x46'),'update',{'module':_0xeaae('0x47')});}else{var _0x22490e=fs[_0xeaae('0x48')](path['join'](config['root'],'server/files/templates/network.ejs'),_0xeaae('0x44'));var _0x19387e=ejs[_0xeaae('0x4d')](_0x22490e,{'networks':_0x59d6a4||[]});fs[_0xeaae('0x45')](util['format'](_0xeaae('0x4e'),_0x57a402[_0xeaae('0x3f')][_0xeaae('0x27')][_0xeaae('0x4f')]()),_0x19387e);return respondWithRpcPromise(_0xeaae('0x46'),_0xeaae('0x1f'),{'module':'chan_sip.so'});}})[_0xeaae('0xc')](function(_0x17e429){if(_0x17e429){return _0x597fe1;}return null;})[_0xeaae('0xc')](respondWithResult(_0x5dcff0,null))['catch'](handleError(_0x5dcff0,null));};exports['destroy']=function(_0x10253a,_0xfc1efd){var _0x126b8f;return db[_0xeaae('0x25')][_0xeaae('0x52')]({'where':{'id':_0x10253a['params']['id']}})['then'](function(_0x986b29){_0x126b8f=_0x986b29;return _0x986b29;})[_0xeaae('0xc')](handleEntityNotFound(_0xfc1efd,null))[_0xeaae('0xc')](removeEntity(_0xfc1efd,null))[_0xeaae('0xc')](function(){if(_0x126b8f){return db[_0xeaae('0x25')][_0xeaae('0x53')]({'where':{'type':_0x126b8f[_0xeaae('0x27')]},'raw':!![]});}})[_0xeaae('0xc')](function(_0x8a0a53){if(_0x126b8f[_0xeaae('0x27')][_0xeaae('0x40')]()==_0xeaae('0x41')){var _0x2eec3d=fs['readFileSync'](path[_0xeaae('0x49')](config[_0xeaae('0x42')],_0xeaae('0x43')),_0xeaae('0x44'));var _0x523988=ejs[_0xeaae('0x4d')](_0x2eec3d,{'networks':_0x8a0a53||[]});fs[_0xeaae('0x45')](_0xeaae('0x54'),_0x523988);return respondWithRpcPromise(_0xeaae('0x46'),_0xeaae('0x20'),{'module':_0xeaae('0x47')});}else if(_0x126b8f[_0xeaae('0x27')][_0xeaae('0x40')]()==_0xeaae('0x51')){var _0x4801b4=fs[_0xeaae('0x48')](path['join'](config[_0xeaae('0x42')],_0xeaae('0x4a')),'utf8');var _0x48c8e1=ejs[_0xeaae('0x4d')](_0x4801b4,{'networks':_0x8a0a53||[]});fs[_0xeaae('0x45')](_0xeaae('0x4b'),_0x48c8e1);return respondWithRpcPromise(_0xeaae('0x46'),_0xeaae('0x20'),{'module':_0xeaae('0x47')});}else{var _0x543014=fs['readFileSync'](path[_0xeaae('0x49')](config[_0xeaae('0x42')],_0xeaae('0x4c')),_0xeaae('0x44'));var _0x5336ca=ejs[_0xeaae('0x4d')](_0x543014,{'networks':_0x8a0a53||[]});fs[_0xeaae('0x45')](util[_0xeaae('0x55')](_0xeaae('0x4e'),_0x126b8f[_0xeaae('0x27')][_0xeaae('0x4f')]()),_0x5336ca);return respondWithRpcPromise(_0xeaae('0x46'),'destroy',{'module':_0xeaae('0x50')});}})[_0xeaae('0x16')](handleError(_0xfc1efd,null));}; \ No newline at end of file +var _0x50b6=['includeAll','include','findAll','rows','params','create','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','server/files/templates/network.ejs','util','ejs','../../components/parsers/qs','api','../../config/environment','../../mysqldb','client','request','then','Network,\x20%s,\x20%s','debug','error','code','message','info','result','catch','status','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','Network','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x106399,_0x58cd11){var _0x52b966=function(_0x5adf0b){while(--_0x5adf0b){_0x106399['push'](_0x106399['shift']());}};_0x52b966(++_0x58cd11);}(_0x50b6,0x6b));var _0x650b=function(_0x5cf4d6,_0x525d25){_0x5cf4d6=_0x5cf4d6-0x0;var _0x94a745=_0x50b6[_0x5cf4d6];return _0x94a745;};'use strict';var util=require(_0x650b('0x0'));var path=require('path');var ejs=require(_0x650b('0x1'));var fs=require('fs');var _=require('lodash');var qs=require(_0x650b('0x2'));var logger=require('../../config/logger')(_0x650b('0x3'));var config=require(_0x650b('0x4'));var db=require(_0x650b('0x5'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x650b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x172417,_0x12a26a,_0x24539c,_0x229432){return new Promise(function(_0x14cbc4,_0x33fdba){var _0x29e084=_0x229432||client;return _0x29e084[_0x650b('0x7')](_0x172417,_0x24539c)[_0x650b('0x8')](function(_0x9b11ea){logger['info'](_0x650b('0x9'),_0x12a26a,'request\x20sent');logger[_0x650b('0xa')]('Network,\x20%s,\x20%s,\x20%s',_0x12a26a,'request\x20sent',JSON['stringify'](_0x9b11ea));if(_0x9b11ea['error']){if(_0x9b11ea[_0x650b('0xb')][_0x650b('0xc')]===0x1f4){logger[_0x650b('0xb')]('Network,\x20%s,\x20%s',_0x12a26a,_0x9b11ea[_0x650b('0xb')]['message']);return _0x33fdba(_0x9b11ea[_0x650b('0xb')]['message']);}logger[_0x650b('0xb')](_0x650b('0x9'),_0x12a26a,_0x9b11ea[_0x650b('0xb')][_0x650b('0xd')]);return _0x14cbc4(_0x9b11ea[_0x650b('0xb')]['message']);}else{logger[_0x650b('0xe')](_0x650b('0x9'),_0x12a26a,'request\x20sent');_0x14cbc4(_0x9b11ea[_0x650b('0xf')][_0x650b('0xd')]);}})[_0x650b('0x10')](function(_0x2b235c){logger['error'](_0x650b('0x9'),_0x12a26a,_0x2b235c);_0x33fdba(_0x2b235c);});});}function respondWithResult(_0x55c1bd,_0x3a608c){_0x3a608c=_0x3a608c||0xc8;return function(_0x35c541){if(_0x35c541){return _0x55c1bd[_0x650b('0x11')](_0x3a608c)['json'](_0x35c541);}};}function respondWithFilteredResult(_0x413253,_0x3533ba){return function(_0x5d6dc0){if(_0x5d6dc0){var _0x1031cc=typeof _0x3533ba[_0x650b('0x12')]===_0x650b('0x13')&&typeof _0x3533ba[_0x650b('0x14')]===_0x650b('0x13');var _0x3826bb=_0x5d6dc0[_0x650b('0x15')];var _0x410f03=_0x1031cc?0x0:_0x3533ba[_0x650b('0x12')];var _0x10b83b=_0x1031cc?_0x5d6dc0[_0x650b('0x15')]:_0x3533ba[_0x650b('0x12')]+_0x3533ba['limit'];var _0x4d0f7d;if(_0x10b83b>=_0x3826bb){_0x10b83b=_0x3826bb;_0x4d0f7d=0xc8;}else{_0x4d0f7d=0xce;}_0x413253['status'](_0x4d0f7d);return _0x413253[_0x650b('0x16')](_0x650b('0x17'),_0x410f03+'-'+_0x10b83b+'/'+_0x3826bb)['json'](_0x5d6dc0);}return null;};}function saveUpdates(_0x237680){return function(_0x2be839){if(_0x2be839){return _0x2be839[_0x650b('0x18')](_0x237680)['then'](function(_0x22ffad){return _0x22ffad;});}return null;};}function removeEntity(_0x2de780){return function(_0x5cb647){if(_0x5cb647){return _0x5cb647[_0x650b('0x19')]()['then'](function(){_0x2de780[_0x650b('0x11')](0xcc)[_0x650b('0x1a')]();});}};}function handleEntityNotFound(_0x5db11b){return function(_0x333f80){if(!_0x333f80){_0x5db11b[_0x650b('0x1b')](0x194);}return _0x333f80;};}function handleError(_0x23a526,_0x2fbfdc){_0x2fbfdc=_0x2fbfdc||0x1f4;return function(_0x45f181){logger[_0x650b('0xb')](_0x45f181[_0x650b('0x1c')]);if(_0x45f181[_0x650b('0x1d')]){delete _0x45f181[_0x650b('0x1d')];}_0x23a526[_0x650b('0x11')](_0x2fbfdc)['send'](_0x45f181);};}exports[_0x650b('0x1e')]=function(_0x14da1e,_0x648c4){var _0x5ebd11={},_0x13dd83={},_0x2280cf={'count':0x0,'rows':[]};var _0x160f16=_['map'](db[_0x650b('0x1f')][_0x650b('0x20')],function(_0x412fcb){return{'name':_0x412fcb[_0x650b('0x21')],'type':_0x412fcb[_0x650b('0x22')][_0x650b('0x23')]};});_0x13dd83[_0x650b('0x24')]=_[_0x650b('0x25')](_0x160f16,_0x650b('0x1d'));_0x13dd83[_0x650b('0x26')]=_[_0x650b('0x27')](_0x14da1e['query']);_0x13dd83[_0x650b('0x28')]=_['intersection'](_0x13dd83[_0x650b('0x24')],_0x13dd83['query']);_0x5ebd11[_0x650b('0x29')]=_[_0x650b('0x2a')](_0x13dd83['model'],qs[_0x650b('0x2b')](_0x14da1e[_0x650b('0x26')][_0x650b('0x2b')]));_0x5ebd11[_0x650b('0x29')]=_0x5ebd11[_0x650b('0x29')][_0x650b('0x2c')]?_0x5ebd11[_0x650b('0x29')]:_0x13dd83[_0x650b('0x24')];if(!_0x14da1e[_0x650b('0x26')]['hasOwnProperty'](_0x650b('0x2d'))){_0x5ebd11['limit']=qs[_0x650b('0x14')](_0x14da1e[_0x650b('0x26')][_0x650b('0x14')]);_0x5ebd11[_0x650b('0x12')]=qs['offset'](_0x14da1e[_0x650b('0x26')][_0x650b('0x12')]);}_0x5ebd11[_0x650b('0x2e')]=qs[_0x650b('0x2f')](_0x14da1e['query'][_0x650b('0x2f')]);_0x5ebd11[_0x650b('0x30')]=qs[_0x650b('0x28')](_[_0x650b('0x31')](_0x14da1e[_0x650b('0x26')],_0x13dd83[_0x650b('0x28')]),_0x160f16);if(_0x14da1e[_0x650b('0x26')][_0x650b('0x32')]){_0x5ebd11['where']=_[_0x650b('0x33')](_0x5ebd11[_0x650b('0x30')],{'$or':_[_0x650b('0x25')](_0x160f16,function(_0x42f87f){if(_0x42f87f[_0x650b('0x22')]!==_0x650b('0x34')){var _0x1c8471={};_0x1c8471[_0x42f87f[_0x650b('0x1d')]]={'$like':'%'+_0x14da1e[_0x650b('0x26')][_0x650b('0x32')]+'%'};return _0x1c8471;}})});}_0x5ebd11=_['merge']({},_0x5ebd11,_0x14da1e['options']);var _0x4b69ba={'where':_0x5ebd11[_0x650b('0x30')]};return db['Network']['count'](_0x4b69ba)[_0x650b('0x8')](function(_0x59ed2e){_0x2280cf[_0x650b('0x15')]=_0x59ed2e;if(_0x14da1e['query'][_0x650b('0x35')]){_0x5ebd11[_0x650b('0x36')]=[{'all':!![]}];}return db[_0x650b('0x1f')][_0x650b('0x37')](_0x5ebd11);})[_0x650b('0x8')](function(_0x2552a8){_0x2280cf[_0x650b('0x38')]=_0x2552a8;return _0x2280cf;})[_0x650b('0x8')](respondWithFilteredResult(_0x648c4,_0x5ebd11))[_0x650b('0x10')](handleError(_0x648c4,null));};exports['show']=function(_0x51b33d,_0x44df9e){var _0x43863e={'raw':!![],'where':{'id':_0x51b33d[_0x650b('0x39')]['id']}},_0x35fca9={};_0x35fca9[_0x650b('0x24')]=_['keys'](db['Network'][_0x650b('0x20')]);_0x35fca9['query']=_[_0x650b('0x27')](_0x51b33d[_0x650b('0x26')]);_0x35fca9[_0x650b('0x28')]=_[_0x650b('0x2a')](_0x35fca9[_0x650b('0x24')],_0x35fca9['query']);_0x43863e[_0x650b('0x29')]=_['intersection'](_0x35fca9['model'],qs[_0x650b('0x2b')](_0x51b33d[_0x650b('0x26')][_0x650b('0x2b')]));_0x43863e[_0x650b('0x29')]=_0x43863e[_0x650b('0x29')][_0x650b('0x2c')]?_0x43863e[_0x650b('0x29')]:_0x35fca9['model'];if(_0x51b33d[_0x650b('0x26')][_0x650b('0x35')]){_0x43863e['include']=[{'all':!![]}];}_0x43863e=_[_0x650b('0x33')]({},_0x43863e,_0x51b33d['options']);return db[_0x650b('0x1f')]['find'](_0x43863e)[_0x650b('0x8')](handleEntityNotFound(_0x44df9e,null))[_0x650b('0x8')](respondWithResult(_0x44df9e,null))['catch'](handleError(_0x44df9e,null));};exports[_0x650b('0x3a')]=function(_0x1e9ddd,_0x507c40){var _0xe7e745;return db[_0x650b('0x1f')][_0x650b('0x3a')](_0x1e9ddd[_0x650b('0x3b')],{'raw':!![]})['then'](function(_0x1b8fbf){_0xe7e745=_0x1b8fbf;return db[_0x650b('0x1f')][_0x650b('0x37')]({'where':{'type':_0x1e9ddd[_0x650b('0x3b')][_0x650b('0x22')]},'raw':!![]});})[_0x650b('0x8')](function(_0x292ce0){if(_0xe7e745[_0x650b('0x22')]['toUpperCase']()==_0x650b('0x3c')){var _0x5eb62b=fs[_0x650b('0x3d')](path[_0x650b('0x3e')](config[_0x650b('0x3f')],_0x650b('0x40')),_0x650b('0x41'));var _0x484eaf=ejs[_0x650b('0x42')](_0x5eb62b,{'networks':_0x292ce0||[]});fs[_0x650b('0x43')](_0x650b('0x44'),_0x484eaf);return respondWithRpcPromise(_0x650b('0x45'),_0x650b('0x3a'),{'module':_0x650b('0x46')});}else if(_0xe7e745['type'][_0x650b('0x47')]()==_0x650b('0x48')){var _0x35a45e=fs[_0x650b('0x3d')](path['join'](config[_0x650b('0x3f')],'server/files/templates/turn_multiple.ejs'),_0x650b('0x41'));var _0x3db56c=ejs[_0x650b('0x42')](_0x35a45e,{'networks':_0x292ce0||[]});fs[_0x650b('0x43')](_0x650b('0x49'),_0x3db56c);return respondWithRpcPromise('Reload',_0x650b('0x3a'),{'module':_0x650b('0x46')});}else{var _0x2ccf38=fs[_0x650b('0x3d')](path[_0x650b('0x3e')](config[_0x650b('0x3f')],'server/files/templates/network.ejs'),'utf8');var _0x3d00ed=ejs['render'](_0x2ccf38,{'networks':_0x292ce0||[]});fs[_0x650b('0x43')](util[_0x650b('0x4a')](_0x650b('0x4b'),_0x1e9ddd[_0x650b('0x3b')][_0x650b('0x22')][_0x650b('0x4c')]()),_0x3d00ed);return respondWithRpcPromise(_0x650b('0x45'),'create',{'module':_0x650b('0x4d')});}})[_0x650b('0x8')](function(){return _0xe7e745;})[_0x650b('0x8')](respondWithResult(_0x507c40,0xc9))[_0x650b('0x10')](handleError(_0x507c40,null));};exports[_0x650b('0x18')]=function(_0x484fa4,_0x8beaac){var _0x42cb3d;return db[_0x650b('0x1f')][_0x650b('0x4e')]({'where':{'id':_0x484fa4[_0x650b('0x39')]['id']}})[_0x650b('0x8')](handleEntityNotFound(_0x8beaac,null))[_0x650b('0x8')](saveUpdates(_0x484fa4['body'],null))[_0x650b('0x8')](function(_0x5b7942){if(_0x5b7942){_0x42cb3d=_0x5b7942;return db[_0x650b('0x1f')][_0x650b('0x37')]({'where':{'type':_0x42cb3d[_0x650b('0x22')]},'raw':!![]});}return null;})[_0x650b('0x8')](function(_0x17bc0e){if(_0x42cb3d['type'][_0x650b('0x47')]()==_0x650b('0x3c')){var _0x2d8f7f=fs[_0x650b('0x3d')](path[_0x650b('0x3e')](config[_0x650b('0x3f')],_0x650b('0x40')),_0x650b('0x41'));var _0x35da14=ejs['render'](_0x2d8f7f,{'networks':_0x17bc0e||[]});fs[_0x650b('0x43')](_0x650b('0x44'),_0x35da14);return respondWithRpcPromise('Reload',_0x650b('0x18'),{'module':_0x650b('0x46')});}else if(_0x42cb3d[_0x650b('0x22')][_0x650b('0x47')]()==_0x650b('0x48')){var _0x5aa16f=fs[_0x650b('0x3d')](path[_0x650b('0x3e')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x650b('0x41'));var _0x1e8a72=ejs[_0x650b('0x42')](_0x5aa16f,{'networks':_0x17bc0e||[]});fs[_0x650b('0x43')](_0x650b('0x49'),_0x1e8a72);return respondWithRpcPromise('Reload','update',{'module':_0x650b('0x46')});}else{var _0x53d3ea=fs[_0x650b('0x3d')](path[_0x650b('0x3e')](config['root'],'server/files/templates/network.ejs'),_0x650b('0x41'));var _0x58442e=ejs[_0x650b('0x42')](_0x53d3ea,{'networks':_0x17bc0e||[]});fs['writeFileSync'](util[_0x650b('0x4a')]('/etc/asterisk/sip_xcally_%s.conf',_0x484fa4[_0x650b('0x3b')][_0x650b('0x22')][_0x650b('0x4c')]()),_0x58442e);return respondWithRpcPromise(_0x650b('0x45'),'update',{'module':_0x650b('0x4d')});}})[_0x650b('0x8')](function(_0x1660e9){if(_0x1660e9){return _0x42cb3d;}return null;})[_0x650b('0x8')](respondWithResult(_0x8beaac,null))[_0x650b('0x10')](handleError(_0x8beaac,null));};exports[_0x650b('0x19')]=function(_0x389473,_0x5cba70){var _0x34bdca;return db[_0x650b('0x1f')]['find']({'where':{'id':_0x389473[_0x650b('0x39')]['id']}})[_0x650b('0x8')](function(_0x36ff0d){_0x34bdca=_0x36ff0d;return _0x36ff0d;})[_0x650b('0x8')](handleEntityNotFound(_0x5cba70,null))[_0x650b('0x8')](removeEntity(_0x5cba70,null))[_0x650b('0x8')](function(){if(_0x34bdca){return db['Network']['findAll']({'where':{'type':_0x34bdca['type']},'raw':!![]});}})['then'](function(_0x4ac66c){if(_0x34bdca[_0x650b('0x22')][_0x650b('0x47')]()==_0x650b('0x3c')){var _0x7e2def=fs[_0x650b('0x3d')](path[_0x650b('0x3e')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x650b('0x41'));var _0x1cd5be=ejs['render'](_0x7e2def,{'networks':_0x4ac66c||[]});fs[_0x650b('0x43')](_0x650b('0x44'),_0x1cd5be);return respondWithRpcPromise(_0x650b('0x45'),_0x650b('0x19'),{'module':_0x650b('0x46')});}else if(_0x34bdca[_0x650b('0x22')]['toUpperCase']()==_0x650b('0x48')){var _0x436d2d=fs[_0x650b('0x3d')](path[_0x650b('0x3e')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x650b('0x41'));var _0x12063b=ejs[_0x650b('0x42')](_0x436d2d,{'networks':_0x4ac66c||[]});fs[_0x650b('0x43')](_0x650b('0x49'),_0x12063b);return respondWithRpcPromise(_0x650b('0x45'),_0x650b('0x19'),{'module':_0x650b('0x46')});}else{var _0x17fe13=fs[_0x650b('0x3d')](path[_0x650b('0x3e')](config['root'],_0x650b('0x4f')),_0x650b('0x41'));var _0x14a69e=ejs[_0x650b('0x42')](_0x17fe13,{'networks':_0x4ac66c||[]});fs[_0x650b('0x43')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x34bdca[_0x650b('0x22')]['toLowerCase']()),_0x14a69e);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});}})[_0x650b('0x10')](handleError(_0x5cba70,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8f036d6..fcc3566 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 _0xa74f=['network','../../config/logger','bluebird','request-promise','path','rimraf','./network.attributes','define','Network'];(function(_0x4c88df,_0x8202fc){var _0x197e64=function(_0x763435){while(--_0x763435){_0x4c88df['push'](_0x4c88df['shift']());}};_0x197e64(++_0x8202fc);}(_0xa74f,0x9a));var _0xfa74=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0xa74f[_0x529f1c];return _0x4d57ab;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa74('0x0'))('api');var moment=require('moment');var BPromise=require(_0xfa74('0x1'));var rp=require(_0xfa74('0x2'));var fs=require('fs');var path=require(_0xfa74('0x3'));var rimraf=require(_0xfa74('0x4'));var config=require('../../config/environment');var attributes=require(_0xfa74('0x5'));module['exports']=function(_0x543cfe,_0x43dd2f){return _0x543cfe[_0xfa74('0x6')](_0xfa74('0x7'),attributes,{'tableName':_0xfa74('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a2c=['path','rimraf','../../config/environment','exports','network','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1c4ae4,_0x590ce0){var _0x16ce85=function(_0x53237e){while(--_0x53237e){_0x1c4ae4['push'](_0x1c4ae4['shift']());}};_0x16ce85(++_0x590ce0);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x4eb9ad,_0x4c5a6d){_0x4eb9ad=_0x4eb9ad-0x0;var _0x5667ac=_0x7a2c[_0x4eb9ad];return _0x5667ac;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var moment=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var rp=require(_0xc7a2('0x5'));var fs=require('fs');var path=require(_0xc7a2('0x6'));var rimraf=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var attributes=require('./network.attributes');module[_0xc7a2('0x9')]=function(_0x1ddbae,_0x5f334e){return _0x1ddbae['define']('Network',attributes,{'tableName':_0xc7a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index ef78915..0f6a11d 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(_0x5dbd44,_0x4dd7bf){_0x5dbd44=_0x5dbd44-0x0;var _0x19e965=_0x7a54[_0x5dbd44];return _0x19e965;};'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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x21fde6,_0x1bc74e){_0x21fde6=_0x21fde6-0x0;var _0x3ec315=_0x7a54[_0x21fde6];return _0x3ec315;};'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 27506d0..64be59b 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 _0xa1b9=['removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','/:id/dispositions','getDispositions','/:id/applications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','delete','destroy'];(function(_0x53844e,_0x1e6f5c){var _0x439066=function(_0x51cbbe){while(--_0x51cbbe){_0x53844e['push'](_0x53844e['shift']());}};_0x439066(++_0x1e6f5c);}(_0xa1b9,0x101));var _0x9a1b=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa1b9[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x9a1b('0x0'));var util=require('util');var path=require(_0x9a1b('0x1'));var timeout=require(_0x9a1b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9a1b('0x3'));var interaction=require(_0x9a1b('0x4'));var config=require(_0x9a1b('0x5'));var controller=require(_0x9a1b('0x6'));router[_0x9a1b('0x7')]('/',auth[_0x9a1b('0x8')](),controller[_0x9a1b('0x9')]);router[_0x9a1b('0x7')](_0x9a1b('0xa'),auth[_0x9a1b('0x8')](),controller['describe']);router['get'](_0x9a1b('0xb'),auth[_0x9a1b('0x8')](),controller['show']);router['get'](_0x9a1b('0xc'),auth['isAuthenticated'](),controller[_0x9a1b('0xd')]);router[_0x9a1b('0x7')]('/:id/canned_answers',auth[_0x9a1b('0x8')](),controller['getAnswers']);router[_0x9a1b('0x7')](_0x9a1b('0xe'),auth['isAuthenticated'](),controller['getApplications']);router[_0x9a1b('0x7')](_0x9a1b('0xf'),auth[_0x9a1b('0x8')](),controller[_0x9a1b('0x10')]);router[_0x9a1b('0x7')](_0x9a1b('0x11'),auth[_0x9a1b('0x8')](),controller['getAgents']);router[_0x9a1b('0x12')]('/',auth[_0x9a1b('0x8')](),controller[_0x9a1b('0x13')]);router['post'](_0x9a1b('0xc'),auth[_0x9a1b('0x8')](),controller[_0x9a1b('0x14')]);router[_0x9a1b('0x12')]('/:id/canned_answers',auth[_0x9a1b('0x8')](),controller[_0x9a1b('0x15')]);router[_0x9a1b('0x12')](_0x9a1b('0x16'),controller[_0x9a1b('0x17')]);router['post'](_0x9a1b('0xe'),auth[_0x9a1b('0x8')](),controller[_0x9a1b('0x18')]);router[_0x9a1b('0x12')](_0x9a1b('0x11'),auth['isAuthenticated'](),controller[_0x9a1b('0x19')]);router[_0x9a1b('0x12')](_0x9a1b('0x1a'),auth[_0x9a1b('0x8')](),controller[_0x9a1b('0x1b')]);router[_0x9a1b('0x1c')](_0x9a1b('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9a1b('0x1d')](_0x9a1b('0xb'),auth[_0x9a1b('0x8')](),controller[_0x9a1b('0x1e')]);router[_0x9a1b('0x1d')](_0x9a1b('0xc'),auth[_0x9a1b('0x8')](),controller[_0x9a1b('0x1f')]);router[_0x9a1b('0x1d')](_0x9a1b('0x20'),auth[_0x9a1b('0x8')](),controller[_0x9a1b('0x21')]);router[_0x9a1b('0x1d')](_0x9a1b('0x11'),auth['isAuthenticated'](),controller[_0x9a1b('0x22')]);module[_0x9a1b('0x23')]=router; \ No newline at end of file +var _0xaa02=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','show','getAnswers','getApplications','getInteractions','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','/:id/users','addAgents','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path'];(function(_0x4be57c,_0x151881){var _0x5901da=function(_0x455972){while(--_0x455972){_0x4be57c['push'](_0x4be57c['shift']());}};_0x5901da(++_0x151881);}(_0xaa02,0xe7));var _0x2aa0=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xaa02[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require(_0x2aa0('0x0'));var util=require(_0x2aa0('0x1'));var path=require(_0x2aa0('0x2'));var timeout=require(_0x2aa0('0x3'));var express=require(_0x2aa0('0x4'));var router=express[_0x2aa0('0x5')]();var fs_extra=require(_0x2aa0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2aa0('0x7'));var config=require('../../config/environment');var controller=require(_0x2aa0('0x8'));router['get']('/',auth[_0x2aa0('0x9')](),controller[_0x2aa0('0xa')]);router[_0x2aa0('0xb')](_0x2aa0('0xc'),auth[_0x2aa0('0x9')](),controller[_0x2aa0('0xd')]);router[_0x2aa0('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x2aa0('0xe')]);router[_0x2aa0('0xb')]('/:id/dispositions',auth[_0x2aa0('0x9')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x2aa0('0x9')](),controller[_0x2aa0('0xf')]);router[_0x2aa0('0xb')]('/:id/applications',auth[_0x2aa0('0x9')](),controller[_0x2aa0('0x10')]);router[_0x2aa0('0xb')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x2aa0('0x11')]);router[_0x2aa0('0xb')]('/:id/users',auth[_0x2aa0('0x9')](),controller[_0x2aa0('0x12')]);router[_0x2aa0('0x13')]('/',auth[_0x2aa0('0x9')](),controller[_0x2aa0('0x14')]);router['post'](_0x2aa0('0x15'),auth['isAuthenticated'](),controller[_0x2aa0('0x16')]);router['post'](_0x2aa0('0x17'),auth[_0x2aa0('0x9')](),controller[_0x2aa0('0x18')]);router['post'](_0x2aa0('0x19'),controller[_0x2aa0('0x1a')]);router[_0x2aa0('0x13')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x2aa0('0x13')](_0x2aa0('0x1b'),auth[_0x2aa0('0x9')](),controller[_0x2aa0('0x1c')]);router[_0x2aa0('0x13')](_0x2aa0('0x1d'),auth[_0x2aa0('0x9')](),controller[_0x2aa0('0x1e')]);router[_0x2aa0('0x1f')](_0x2aa0('0x20'),auth[_0x2aa0('0x9')](),controller[_0x2aa0('0x21')]);router[_0x2aa0('0x22')](_0x2aa0('0x20'),auth[_0x2aa0('0x9')](),controller[_0x2aa0('0x23')]);router[_0x2aa0('0x22')](_0x2aa0('0x15'),auth[_0x2aa0('0x9')](),controller[_0x2aa0('0x24')]);router[_0x2aa0('0x22')](_0x2aa0('0x17'),auth[_0x2aa0('0x9')](),controller[_0x2aa0('0x25')]);router[_0x2aa0('0x22')](_0x2aa0('0x1b'),auth[_0x2aa0('0x9')](),controller[_0x2aa0('0x26')]);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 35b757b..b8e7b66 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 _0x4398=['exports','STRING','generate','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','randomstring'];(function(_0x565fc6,_0x4ad48f){var _0x2fa55a=function(_0x41bdd9){while(--_0x41bdd9){_0x565fc6['push'](_0x565fc6['shift']());}};_0x2fa55a(++_0x4ad48f);}(_0x4398,0x1ba));var _0x8439=function(_0x3ed413,_0x1eb747){_0x3ed413=_0x3ed413-0x0;var _0x19babb=_0x4398[_0x3ed413];return _0x19babb;};'use strict';var Sequelize=require(_0x8439('0x0'));var rs=require(_0x8439('0x1'));module[_0x8439('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x8439('0x3')]},'token':{'type':Sequelize[_0x8439('0x3')],'defaultValue':function(){return rs[_0x8439('0x4')]();}},'replyUri':{'type':Sequelize[_0x8439('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x8439('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8439('0x5');}},'notificationSound':{'type':Sequelize[_0x8439('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8439('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x8439('0x3')]},'queueTransfer':{'type':Sequelize[_0x8439('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8439('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8439('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x8439('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1544a7){if(!_0x1544a7)this[_0x8439('0x9')](_0x8439('0xa'),null);this[_0x8439('0x9')](_0x8439('0xb'),_0x1544a7);}}}; \ No newline at end of file +var _0x9e8c=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x345beb,_0x31d13f){var _0x1b710c=function(_0x27766e){while(--_0x27766e){_0x345beb['push'](_0x345beb['shift']());}};_0x1b710c(++_0x31d13f);}(_0x9e8c,0x8c));var _0xc9e8=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9e8c[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xc9e8('0x0'));var rs=require(_0xc9e8('0x1'));module[_0xc9e8('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xc9e8('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc9e8('0x4')]},'token':{'type':Sequelize[_0xc9e8('0x4')],'defaultValue':function(){return rs[_0xc9e8('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc9e8('0x6')],'defaultValue':function(){return _0xc9e8('0x7');}},'notificationSound':{'type':Sequelize[_0xc9e8('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc9e8('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc9e8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc9e8('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc9e8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc9e8('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xc9e8('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xc9e8('0x8')],'defaultValue':![],'comment':_0xc9e8('0xb'),'set':function(_0xe3e6fc){if(!_0xe3e6fc)this[_0xc9e8('0xc')](_0xc9e8('0xd'),null);this['setDataValue'](_0xc9e8('0xe'),_0xe3e6fc);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 1c9bd8e..945c5b0 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 _0x28a2=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','OpenchannelAccountId','getDispositions','findOne','Disposition','findAll','removeDispositions','ids','CannedAnswer','nolimit','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','applications','list','orderBy','priority','asc','account','Applications','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','send','getApplications','getInteractions','Contact','User','Owner','internal','Tag','Tags','color','tag','rows','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','http','client','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','limit','undefined','count','offset','set','apply','reject','save','destroy','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','Pause','mandatoryDispositionPause','OpenchannelAccount','fieldName','key','model','map'];(function(_0x43fa6f,_0x13701d){var _0x46d76=function(_0x2790ef){while(--_0x2790ef){_0x43fa6f['push'](_0x43fa6f['shift']());}};_0x46d76(++_0x13701d);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x228a('0x0'));var rimraf=require(_0x228a('0x1'));var zipdir=require(_0x228a('0x2'));var jsonpatch=require(_0x228a('0x3'));var rp=require(_0x228a('0x4'));var moment=require(_0x228a('0x5'));var BPromise=require(_0x228a('0x6'));var Mustache=require('mustache');var util=require(_0x228a('0x7'));var path=require('path');var sox=require(_0x228a('0x8'));var csv=require(_0x228a('0x9'));var ejs=require(_0x228a('0xa'));var fs=require('fs');var fs_extra=require(_0x228a('0xb'));var _=require(_0x228a('0xc'));var squel=require('squel');var crypto=require(_0x228a('0xd'));var jsforce=require(_0x228a('0xe'));var deskjs=require(_0x228a('0xf'));var toCsv=require(_0x228a('0x9'));var querystring=require('querystring');var Papa=require(_0x228a('0x10'));var Redis=require(_0x228a('0x11'));var authService=require(_0x228a('0x12'));var qs=require(_0x228a('0x13'));var as=require(_0x228a('0x14'));var hardwareService=require(_0x228a('0x15'));var logger=require(_0x228a('0x16'))(_0x228a('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x228a('0x18'))['db'];config[_0x228a('0x19')]=_[_0x228a('0x1a')](config[_0x228a('0x19')],{'host':_0x228a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x228a('0x19')]));require(_0x228a('0x1c'))[_0x228a('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x228a('0x1e')]({'port':0x232c});var client9002=jayson[_0x228a('0x1f')][_0x228a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2e4f17,_0x262ce9,_0x36f4d1,_0xa01bc){return new BPromise(function(_0x40c8de,_0x487bd3){var _0x34de98=_0xa01bc||client;return _0x34de98['request'](_0x2e4f17,_0x36f4d1)[_0x228a('0x20')](function(_0x2c764e){logger[_0x228a('0x21')](_0x228a('0x22'),_0x262ce9,'request\x20sent');logger['debug'](_0x228a('0x23'),_0x262ce9,_0x228a('0x24'),JSON[_0x228a('0x25')](_0x2c764e));if(_0x2c764e[_0x228a('0x26')]){if(_0x2c764e[_0x228a('0x26')][_0x228a('0x27')]===0x1f4){logger[_0x228a('0x26')](_0x228a('0x22'),_0x262ce9,_0x2c764e[_0x228a('0x26')]['message']);return _0x487bd3(_0x2c764e[_0x228a('0x26')]['message']);}logger[_0x228a('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x262ce9,_0x2c764e[_0x228a('0x26')][_0x228a('0x28')]);return _0x40c8de(_0x2c764e[_0x228a('0x26')][_0x228a('0x28')]);}else{logger[_0x228a('0x21')](_0x228a('0x22'),_0x262ce9,_0x228a('0x24'));_0x40c8de(_0x2c764e[_0x228a('0x29')][_0x228a('0x28')]);}})[_0x228a('0x2a')](function(_0x40a2b7){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x262ce9,_0x40a2b7);_0x487bd3(_0x40a2b7);});});}function respondWithStatusCode(_0xda1c4c,_0x2f5ce3){_0x2f5ce3=_0x2f5ce3||0xcc;return function(_0x2c1ef1){if(_0x2c1ef1){return _0xda1c4c['sendStatus'](_0x2f5ce3);}return _0xda1c4c[_0x228a('0x2b')](_0x2f5ce3)[_0x228a('0x2c')]();};}function respondWithResult(_0x28e4d6,_0x574820){_0x574820=_0x574820||0xc8;return function(_0x5e374d){if(_0x5e374d){return _0x28e4d6['status'](_0x574820)[_0x228a('0x2d')](_0x5e374d);}};}function respondWithFilteredResult(_0x196f7,_0x4b5961){return function(_0x1d6d87){if(_0x1d6d87){var _0x4065e0=typeof _0x4b5961['offset']==='undefined'&&typeof _0x4b5961[_0x228a('0x2e')]===_0x228a('0x2f');var _0x59cc09=_0x1d6d87['count'];var _0x20cb70=_0x4065e0?0x0:_0x4b5961['offset'];var _0x2811f1=_0x4065e0?_0x1d6d87[_0x228a('0x30')]:_0x4b5961[_0x228a('0x31')]+_0x4b5961[_0x228a('0x2e')];var _0x5535c0;if(_0x2811f1>=_0x59cc09){_0x2811f1=_0x59cc09;_0x5535c0=0xc8;}else{_0x5535c0=0xce;}_0x196f7[_0x228a('0x2b')](_0x5535c0);return _0x196f7[_0x228a('0x32')]('Content-Range',_0x20cb70+'-'+_0x2811f1+'/'+_0x59cc09)[_0x228a('0x2d')](_0x1d6d87);}return null;};}function patchUpdates(_0x269b81){return function(_0x342acf){try{jsonpatch[_0x228a('0x33')](_0x342acf,_0x269b81,!![]);}catch(_0xf8f5bc){return BPromise[_0x228a('0x34')](_0xf8f5bc);}return _0x342acf[_0x228a('0x35')]();};}function saveUpdates(_0x345a54,_0x21f36a){return function(_0x3a5270){if(_0x3a5270){return _0x3a5270['update'](_0x345a54)[_0x228a('0x20')](function(_0x3ca313){return _0x3ca313;});}return null;};}function removeEntity(_0x2f6ac3,_0x5ed7a4){return function(_0x303735){if(_0x303735){return _0x303735[_0x228a('0x36')]()[_0x228a('0x20')](function(){var _0x144bbe=_0x303735['get']({'plain':!![]});var _0x51f1f3=_0x228a('0x37');return db[_0x228a('0x38')]['destroy']({'where':{'type':_0x51f1f3,'resourceId':_0x144bbe['id']}})[_0x228a('0x20')](function(){return _0x303735;});})['then'](function(){_0x2f6ac3[_0x228a('0x2b')](0xcc)[_0x228a('0x2c')]();});}};}function handleEntityNotFound(_0x1dbf73,_0x540083){return function(_0x5fd27f){if(!_0x5fd27f){_0x1dbf73[_0x228a('0x39')](0x194);}return _0x5fd27f;};}function handleError(_0x242cad,_0x540144){_0x540144=_0x540144||0x1f4;return function(_0x67e498){logger[_0x228a('0x26')](_0x67e498[_0x228a('0x3a')]);if(_0x67e498[_0x228a('0x3b')]){delete _0x67e498[_0x228a('0x3b')];}_0x242cad[_0x228a('0x2b')](_0x540144)['send'](_0x67e498);};}exports['index']=function(_0x567f13,_0x4c8b80){var _0x4f2977={'include':[{'model':db[_0x228a('0x3c')],'as':_0x228a('0x3d')}]},_0x3957e0={},_0x32005a={'count':0x0,'rows':[]};var _0x48e81e=_['map'](db[_0x228a('0x3e')]['rawAttributes'],function(_0x4b0cee){return{'name':_0x4b0cee[_0x228a('0x3f')],'type':_0x4b0cee['type'][_0x228a('0x40')]};});_0x3957e0[_0x228a('0x41')]=_[_0x228a('0x42')](_0x48e81e,_0x228a('0x3b'));_0x3957e0[_0x228a('0x43')]=_[_0x228a('0x44')](_0x567f13[_0x228a('0x43')]);_0x3957e0[_0x228a('0x45')]=_[_0x228a('0x46')](_0x3957e0[_0x228a('0x41')],_0x3957e0[_0x228a('0x43')]);_0x4f2977[_0x228a('0x47')]=_[_0x228a('0x46')](_0x3957e0[_0x228a('0x41')],qs['fields'](_0x567f13['query'][_0x228a('0x48')]));_0x4f2977[_0x228a('0x47')]=_0x4f2977[_0x228a('0x47')][_0x228a('0x49')]?_0x4f2977[_0x228a('0x47')]:_0x3957e0[_0x228a('0x41')];if(!_0x567f13[_0x228a('0x43')][_0x228a('0x4a')]('nolimit')){_0x4f2977[_0x228a('0x2e')]=qs[_0x228a('0x2e')](_0x567f13[_0x228a('0x43')][_0x228a('0x2e')]);_0x4f2977['offset']=qs['offset'](_0x567f13['query'][_0x228a('0x31')]);}_0x4f2977[_0x228a('0x4b')]=qs[_0x228a('0x4c')](_0x567f13[_0x228a('0x43')][_0x228a('0x4c')]);_0x4f2977[_0x228a('0x4d')]=qs[_0x228a('0x45')](_[_0x228a('0x4e')](_0x567f13['query'],_0x3957e0['filters']),_0x48e81e);if(_0x567f13['query'][_0x228a('0x4f')]){_0x4f2977[_0x228a('0x4d')]=_[_0x228a('0x50')](_0x4f2977[_0x228a('0x4d')],{'$or':_['map'](_0x48e81e,function(_0x1eeb6a){if(_0x1eeb6a[_0x228a('0x51')]!==_0x228a('0x52')){var _0x5bbb39={};_0x5bbb39[_0x1eeb6a[_0x228a('0x3b')]]={'$like':'%'+_0x567f13['query'][_0x228a('0x4f')]+'%'};return _0x5bbb39;}})});}_0x4f2977=_[_0x228a('0x50')]({},_0x4f2977,_0x567f13[_0x228a('0x53')]);var _0x310a75={'where':_0x4f2977['where']};return db[_0x228a('0x3e')][_0x228a('0x30')](_0x310a75)[_0x228a('0x20')](function(_0x56e717){_0x32005a[_0x228a('0x30')]=_0x56e717;if(_0x567f13[_0x228a('0x43')][_0x228a('0x54')]){_0x4f2977[_0x228a('0x55')]=[{'all':!![]}];}return db[_0x228a('0x3e')]['findAll'](_0x4f2977);})['then'](function(_0x40f208){_0x32005a['rows']=_0x40f208;return _0x32005a;})[_0x228a('0x20')](respondWithFilteredResult(_0x4c8b80,_0x4f2977))['catch'](handleError(_0x4c8b80,null));};exports[_0x228a('0x56')]=function(_0x28b415,_0x4fa2cd){var _0x55166f={'raw':![],'where':{'id':_0x28b415[_0x228a('0x57')]['id']},'include':[{'model':db[_0x228a('0x3c')],'as':'mandatoryDispositionPause'}]},_0x3aef69={};_0x3aef69['model']=_[_0x228a('0x44')](db[_0x228a('0x3e')][_0x228a('0x58')]);_0x3aef69[_0x228a('0x43')]=_[_0x228a('0x44')](_0x28b415['query']);_0x3aef69[_0x228a('0x45')]=_[_0x228a('0x46')](_0x3aef69[_0x228a('0x41')],_0x3aef69['query']);_0x55166f['attributes']=_[_0x228a('0x46')](_0x3aef69[_0x228a('0x41')],qs[_0x228a('0x48')](_0x28b415[_0x228a('0x43')][_0x228a('0x48')]));_0x55166f[_0x228a('0x47')]=_0x55166f['attributes'][_0x228a('0x49')]?_0x55166f['attributes']:_0x3aef69['model'];if(_0x28b415[_0x228a('0x43')][_0x228a('0x54')]){_0x55166f[_0x228a('0x55')]=[{'all':!![]}];}_0x55166f=_['merge']({},_0x55166f,_0x28b415[_0x228a('0x53')]);return db[_0x228a('0x3e')]['find'](_0x55166f)[_0x228a('0x20')](handleEntityNotFound(_0x4fa2cd,null))[_0x228a('0x20')](respondWithResult(_0x4fa2cd,null))[_0x228a('0x2a')](handleError(_0x4fa2cd,null));};exports[_0x228a('0x59')]=function(_0x46fe25,_0xc3e686){return db['OpenchannelAccount'][_0x228a('0x59')](_0x46fe25[_0x228a('0x5a')],{})[_0x228a('0x20')](function(_0x8ee3eb){var _0x476410=_0x46fe25[_0x228a('0x5b')]['get']({'plain':!![]});if(!_0x476410)throw new Error(_0x228a('0x5c'));if(_0x476410[_0x228a('0x5d')]===_0x228a('0x5b')){var _0x14d5c8=_0x8ee3eb[_0x228a('0x5e')]({'plain':!![]});var _0x3515cb=_0x228a('0x37');return db[_0x228a('0x5f')]['find']({'where':{'name':_0x3515cb,'userProfileId':_0x476410['userProfileId']},'raw':!![]})[_0x228a('0x20')](function(_0x297895){if(_0x297895&&_0x297895[_0x228a('0x60')]===0x0){return db['UserProfileResource'][_0x228a('0x59')]({'name':_0x14d5c8[_0x228a('0x3b')],'resourceId':_0x14d5c8['id'],'type':_0x297895[_0x228a('0x3b')],'sectionId':_0x297895['id']},{})['then'](function(){return _0x8ee3eb;});}else{return _0x8ee3eb;}})[_0x228a('0x2a')](function(_0x3c9988){logger[_0x228a('0x26')](_0x228a('0x61'),_0x3c9988);throw _0x3c9988;});}return _0x8ee3eb;})[_0x228a('0x20')](respondWithResult(_0xc3e686,0xc9))['catch'](handleError(_0xc3e686,null));};exports[_0x228a('0x62')]=function(_0x1052ef,_0x267226){if(_0x1052ef[_0x228a('0x5a')]['id']){delete _0x1052ef[_0x228a('0x5a')]['id'];}return db[_0x228a('0x3e')]['find']({'where':{'id':_0x1052ef[_0x228a('0x57')]['id']},'include':[{'model':db[_0x228a('0x3c')],'as':_0x228a('0x3d')}]})['then'](handleEntityNotFound(_0x267226,null))[_0x228a('0x20')](saveUpdates(_0x1052ef[_0x228a('0x5a')],null))[_0x228a('0x20')](respondWithResult(_0x267226,null))[_0x228a('0x2a')](handleError(_0x267226,null));};exports[_0x228a('0x36')]=function(_0x34986f,_0x2fab8b){return db[_0x228a('0x3e')][_0x228a('0x63')]({'where':{'id':_0x34986f[_0x228a('0x57')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x2fab8b,null))[_0x228a('0x20')](removeEntity(_0x2fab8b,null))[_0x228a('0x2a')](handleError(_0x2fab8b,null));};exports[_0x228a('0x64')]=function(_0x115e85,_0x5091a9){return db['OpenchannelAccount'][_0x228a('0x64')]()[_0x228a('0x20')](respondWithResult(_0x5091a9,null))[_0x228a('0x2a')](handleError(_0x5091a9,null));};exports['addDisposition']=function(_0x23a2db,_0xec2256,_0x1957f9){if(_0x23a2db[_0x228a('0x5a')]['id']){delete _0x23a2db[_0x228a('0x5a')]['id'];}return db[_0x228a('0x3e')][_0x228a('0x63')]({'where':{'id':_0x23a2db[_0x228a('0x57')]['id']}})['then'](handleEntityNotFound(_0xec2256,null))[_0x228a('0x20')](function(_0x2f6e83){if(_0x2f6e83){_0x23a2db['body'][_0x228a('0x65')]=_0x2f6e83['id'];return db['Disposition']['create'](_0x23a2db[_0x228a('0x5a')]);}})['then'](respondWithResult(_0xec2256,null))['catch'](handleError(_0xec2256,null));};exports[_0x228a('0x66')]=function(_0x4006f4,_0x36faac,_0x1e9212){var _0x50f9df={'raw':![],'where':{}};var _0x1f5233={};var _0x578705={'count':0x0,'rows':[]};return db[_0x228a('0x3e')][_0x228a('0x67')]({'where':{'id':_0x4006f4[_0x228a('0x57')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x36faac,null))[_0x228a('0x20')](function(_0x1dddec){if(_0x1dddec){_0x1f5233['model']=_[_0x228a('0x44')](db[_0x228a('0x68')][_0x228a('0x58')]);_0x1f5233[_0x228a('0x43')]=_[_0x228a('0x44')](_0x4006f4[_0x228a('0x43')]);_0x1f5233['filters']=_[_0x228a('0x46')](_0x1f5233[_0x228a('0x41')],_0x1f5233['query']);_0x50f9df['attributes']=_[_0x228a('0x46')](_0x1f5233[_0x228a('0x41')],qs[_0x228a('0x48')](_0x4006f4[_0x228a('0x43')][_0x228a('0x48')]));_0x50f9df[_0x228a('0x47')]=_0x50f9df[_0x228a('0x47')][_0x228a('0x49')]?_0x50f9df[_0x228a('0x47')]:_0x1f5233[_0x228a('0x41')];if(!_0x4006f4[_0x228a('0x43')][_0x228a('0x4a')]('nolimit')){_0x50f9df[_0x228a('0x2e')]=qs[_0x228a('0x2e')](_0x4006f4['query']['limit']);_0x50f9df[_0x228a('0x31')]=qs[_0x228a('0x31')](_0x4006f4['query']['offset']);}_0x50f9df[_0x228a('0x4b')]=qs[_0x228a('0x4c')](_0x4006f4['query']['sort']);_0x50f9df[_0x228a('0x4d')]=qs['filters'](_[_0x228a('0x4e')](_0x4006f4['query'],_0x1f5233['filters']));_0x50f9df['where']['OpenchannelAccountId']=_0x1dddec['id'];if(_0x4006f4['query']['filter']){_0x50f9df[_0x228a('0x4d')]=_[_0x228a('0x50')](_0x50f9df[_0x228a('0x4d')],{'$or':_['map'](_0x50f9df[_0x228a('0x47')],function(_0x13be94){var _0x24dbc3={};_0x24dbc3[_0x13be94]={'$like':'%'+_0x4006f4[_0x228a('0x43')]['filter']+'%'};return _0x24dbc3;})});}_0x50f9df=_[_0x228a('0x50')]({},_0x50f9df,_0x4006f4[_0x228a('0x53')]);return db[_0x228a('0x68')][_0x228a('0x30')]({'where':_0x50f9df['where']})[_0x228a('0x20')](function(_0x1b2e69){_0x578705[_0x228a('0x30')]=_0x1b2e69;if(_0x4006f4[_0x228a('0x43')]['includeAll']){_0x50f9df[_0x228a('0x55')]=[{'all':!![]}];}return db[_0x228a('0x68')][_0x228a('0x69')](_0x50f9df);})[_0x228a('0x20')](function(_0x43c15){_0x578705['rows']=_0x43c15;return _0x578705;});}})['then'](respondWithFilteredResult(_0x36faac,_0x50f9df))[_0x228a('0x2a')](handleError(_0x36faac,null));};exports[_0x228a('0x6a')]=function(_0x2e0672,_0x2df7e4,_0x37eccd){return db['OpenchannelAccount'][_0x228a('0x63')]({'where':{'id':_0x2e0672[_0x228a('0x57')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x2df7e4,null))[_0x228a('0x20')](function(_0x76c65c){if(_0x76c65c){return _0x76c65c[_0x228a('0x6a')](_0x2e0672['query'][_0x228a('0x6b')]);}})[_0x228a('0x20')](respondWithStatusCode(_0x2df7e4,null))['catch'](handleError(_0x2df7e4,null));};exports['addAnswer']=function(_0x57f33d,_0x4187c1,_0x159bbf){if(_0x57f33d[_0x228a('0x5a')]['id']){delete _0x57f33d[_0x228a('0x5a')]['id'];}return db[_0x228a('0x3e')]['find']({'where':{'id':_0x57f33d['params']['id']}})['then'](handleEntityNotFound(_0x4187c1,null))[_0x228a('0x20')](function(_0x52528b){if(_0x52528b){_0x57f33d['body'][_0x228a('0x65')]=_0x52528b['id'];return db[_0x228a('0x6c')][_0x228a('0x59')](_0x57f33d['body']);}})[_0x228a('0x20')](respondWithResult(_0x4187c1,null))[_0x228a('0x2a')](handleError(_0x4187c1,null));};exports['getAnswers']=function(_0x5fb41,_0x3b8721,_0x25bc84){var _0x92d1dd={'raw':![],'where':{}};var _0x1b8d93={};var _0x54cb9b={'count':0x0,'rows':[]};return db[_0x228a('0x3e')]['findOne']({'where':{'id':_0x5fb41[_0x228a('0x57')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x3b8721,null))[_0x228a('0x20')](function(_0x3c2b9c){if(_0x3c2b9c){_0x1b8d93['model']=_[_0x228a('0x44')](db[_0x228a('0x6c')][_0x228a('0x58')]);_0x1b8d93[_0x228a('0x43')]=_[_0x228a('0x44')](_0x5fb41[_0x228a('0x43')]);_0x1b8d93[_0x228a('0x45')]=_[_0x228a('0x46')](_0x1b8d93['model'],_0x1b8d93[_0x228a('0x43')]);_0x92d1dd[_0x228a('0x47')]=_[_0x228a('0x46')](_0x1b8d93[_0x228a('0x41')],qs[_0x228a('0x48')](_0x5fb41[_0x228a('0x43')][_0x228a('0x48')]));_0x92d1dd[_0x228a('0x47')]=_0x92d1dd[_0x228a('0x47')][_0x228a('0x49')]?_0x92d1dd[_0x228a('0x47')]:_0x1b8d93['model'];if(!_0x5fb41[_0x228a('0x43')]['hasOwnProperty'](_0x228a('0x6d'))){_0x92d1dd[_0x228a('0x2e')]=qs[_0x228a('0x2e')](_0x5fb41[_0x228a('0x43')][_0x228a('0x2e')]);_0x92d1dd[_0x228a('0x31')]=qs[_0x228a('0x31')](_0x5fb41[_0x228a('0x43')][_0x228a('0x31')]);}_0x92d1dd[_0x228a('0x4b')]=qs[_0x228a('0x4c')](_0x5fb41[_0x228a('0x43')]['sort']);_0x92d1dd['where']=qs[_0x228a('0x45')](_[_0x228a('0x4e')](_0x5fb41[_0x228a('0x43')],_0x1b8d93[_0x228a('0x45')]));_0x92d1dd[_0x228a('0x4d')][_0x228a('0x65')]=_0x3c2b9c['id'];if(_0x5fb41[_0x228a('0x43')][_0x228a('0x4f')]){_0x92d1dd[_0x228a('0x4d')]=_['merge'](_0x92d1dd[_0x228a('0x4d')],{'$or':_[_0x228a('0x42')](_0x92d1dd['attributes'],function(_0x4df864){var _0x36617d={};_0x36617d[_0x4df864]={'$like':'%'+_0x5fb41[_0x228a('0x43')][_0x228a('0x4f')]+'%'};return _0x36617d;})});}_0x92d1dd=_[_0x228a('0x50')]({},_0x92d1dd,_0x5fb41[_0x228a('0x53')]);return db[_0x228a('0x6c')]['count']({'where':_0x92d1dd[_0x228a('0x4d')]})[_0x228a('0x20')](function(_0xc5b226){_0x54cb9b[_0x228a('0x30')]=_0xc5b226;if(_0x5fb41[_0x228a('0x43')]['includeAll']){_0x92d1dd[_0x228a('0x55')]=[{'all':!![]}];}return db[_0x228a('0x6c')][_0x228a('0x69')](_0x92d1dd);})[_0x228a('0x20')](function(_0x36ec99){_0x54cb9b['rows']=_0x36ec99;return _0x54cb9b;});}})[_0x228a('0x20')](respondWithFilteredResult(_0x3b8721,_0x92d1dd))['catch'](handleError(_0x3b8721,null));};exports[_0x228a('0x6e')]=function(_0x5c1178,_0x5b0da7,_0x27ca7e){return db[_0x228a('0x3e')][_0x228a('0x63')]({'where':{'id':_0x5c1178[_0x228a('0x57')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x5b0da7,null))[_0x228a('0x20')](function(_0xf83f5d){if(_0xf83f5d){return _0xf83f5d[_0x228a('0x6e')](_0x5c1178[_0x228a('0x43')][_0x228a('0x6b')]);}})[_0x228a('0x20')](respondWithStatusCode(_0x5b0da7,null))[_0x228a('0x2a')](handleError(_0x5b0da7,null));};exports[_0x228a('0x6f')]=function(_0x5b6c1d,_0x2c249c,_0x637e59){var _0x12a1de={'body':_0x5b6c1d[_0x228a('0x5a')],'channel':_0x228a('0x70')};var _0x1eb790=[];var _0x11fb80=[];var _0xfd2768={};var _0x21b669=![];return db[_0x228a('0x71')][_0x228a('0x64')]()[_0x228a('0x20')](function(_0x5770f9){if(!_0x5770f9){throw new db[(_0x228a('0x72'))][(_0x228a('0x73'))](_0x228a('0x74'));}_0x1eb790=_[_0x228a('0x75')](_[_0x228a('0x44')](_0x5770f9),['createdAt',_0x228a('0x76')]);_0x11fb80=_[_0x228a('0x75')](_[_0x228a('0x44')](_0x5770f9),[_0x228a('0x77'),_0x228a('0x76'),_0x228a('0x78'),'ListId']);if(_0x5b6c1d[_0x228a('0x5a')]['id']){delete _0x5b6c1d[_0x228a('0x5a')]['id'];}if(_[_0x228a('0x79')](_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x7a')])){throw new db[(_0x228a('0x72'))]['ValidationError'](_0x228a('0x7b'));}if(_[_0x228a('0x79')](_0x5b6c1d['body']['body'])||_0x5b6c1d['body'][_0x228a('0x5a')]===''){throw new db[(_0x228a('0x72'))][(_0x228a('0x73'))](_0x228a('0x7c'));}if(_[_0x228a('0x79')](_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x7d')])){throw new db[(_0x228a('0x72'))][(_0x228a('0x73'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x11fb80);}if(!_['includes'](_0x11fb80,_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x7d')])){throw new db[(_0x228a('0x72'))]['ValidationError'](_0x228a('0x7e')+_0x11fb80);}_0xfd2768[_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x7d')]]=_0x5b6c1d['body'][_0x228a('0x7a')];})[_0x228a('0x20')](function(){return db[_0x228a('0x3e')][_0x228a('0x63')]({'where':{'id':_0x5b6c1d['params']['id']},'include':[{'model':db[_0x228a('0x7f')],'as':_0x228a('0x80'),'include':[{'model':db[_0x228a('0x71')],'as':_0x228a('0x81'),'where':_0xfd2768,'limit':0x1,'order':[[_0x228a('0x76'),_0x228a('0x82')]]}]},{'model':db[_0x228a('0x83')],'as':'Applications'}]});})[_0x228a('0x20')](handleEntityNotFound(_0x2c249c,null))[_0x228a('0x20')](function(_0x48bf0d){if(_0x48bf0d&&_0x48bf0d[_0x228a('0x80')]){_0x12a1de['account']=_0x48bf0d;_0x12a1de[_0x228a('0x84')]=_0x48bf0d['Applications'];_0x12a1de[_0x228a('0x85')]=_0x48bf0d[_0x228a('0x80')];_0x12a1de[_0x228a('0x84')]=_[_0x228a('0x86')](_0x12a1de[_0x228a('0x84')],[_0x228a('0x87')],[_0x228a('0x88')]);if(_0x12a1de[_0x228a('0x89')][_0x228a('0x8a')]){delete _0x12a1de[_0x228a('0x89')]['Applications'];}if(_0x12a1de[_0x228a('0x89')][_0x228a('0x80')]&&_0x12a1de[_0x228a('0x89')][_0x228a('0x80')][_0x228a('0x81')]['length']){return _0x12a1de[_0x228a('0x89')]['List'][_0x228a('0x81')][0x0];}var _0x3b7866=_['defaults'](_0x5b6c1d['body'],{'firstName':_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x7a')],'ListId':_0x48bf0d[_0x228a('0x8b')]});_0x3b7866[_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x7d')]]=_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x7a')];return db[_0x228a('0x71')][_0x228a('0x59')](_0x3b7866,{'fields':_0x1eb790,'raw':!![]});}})[_0x228a('0x20')](handleEntityNotFound(_0x2c249c,null))[_0x228a('0x20')](function(_0x48c008){_0x12a1de[_0x228a('0x8c')]=_0x48c008;if(_0x48c008){var _0x408928={'ContactId':_0x48c008['id'],'OpenchannelAccountId':_0x5b6c1d[_0x228a('0x57')]['id'],'from':(_0x48c008[_0x228a('0x8d')]||'')+'\x20'+(_0x48c008[_0x228a('0x8e')]||'')};var _0x363732={'OpenchannelAccountId':_0x5b6c1d[_0x228a('0x57')]['id'],'closed':![]};if(_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x8f')]){_0x363732[_0x228a('0x8f')]=_0x5b6c1d['body'][_0x228a('0x8f')];return db[_0x228a('0x90')][_0x228a('0x63')]({'where':_0x363732})[_0x228a('0x20')](function(_0x2cfaad){if(_0x2cfaad){return[_0x2cfaad,![]];}_0x408928[_0x228a('0x8f')]=_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x8f')];_0x408928['externalUrl']=_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x91')];return db['OpenchannelInteraction'][_0x228a('0x59')](_0x408928)['then'](function(_0x56ef15){return[_0x56ef15,!![]];});});}else{_0x363732[_0x228a('0x8f')]=null;}_0x363732[_0x228a('0x92')]=_0x48c008['id'];return db['OpenchannelInteraction'][_0x228a('0x63')]({'where':_0x363732})[_0x228a('0x20')](function(_0x47643f){if(_0x47643f){return[_0x47643f,![]];}return db['OpenchannelInteraction'][_0x228a('0x59')](_0x408928)[_0x228a('0x20')](function(_0x408682){return[_0x408682,!![]];});});}})[_0x228a('0x93')](function(_0xce377d,_0x5eb739){if(_0xce377d){_0x21b669=_0x5eb739;if(!_0x5eb739){var _0x477fa0={'from':(_0x12a1de[_0x228a('0x8c')]['firstName']||'')+'\x20'+(_0x12a1de[_0x228a('0x8c')]['lastName']||'')};if(_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x8f')]&&_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x94')]&&_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x8f')]!=_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x94')]){_0x477fa0[_0x228a('0x8f')]=_0x5b6c1d['body'][_0x228a('0x94')];}return _0xce377d[_0x228a('0x62')](_0x477fa0);}else{return _0xce377d;}}})[_0x228a('0x20')](function(_0x28ff71){_0x12a1de[_0x228a('0x95')]=_0x28ff71['get']({'plain':!![]});_0x12a1de[_0x228a('0x95')][_0x228a('0x96')]=_0x21b669;if(_0x12a1de[_0x228a('0x95')][_0x228a('0x96')]){if(_0x12a1de[_0x228a('0x89')][_0x228a('0x97')]){_0x12a1de[_0x228a('0x84')][_0x228a('0x98')]({'id':0x0,'priority':_0x12a1de['applications'][_0x228a('0x49')]+0x1,'app':'close','appdata':_0x228a('0x99'),'interval':_0x228a('0x9a')});}}return db['OpenchannelMessage']['create']({'body':_0x5b6c1d[_0x228a('0x5a')][_0x228a('0x5a')],'OpenchannelAccountId':_0x5b6c1d['params']['id'],'OpenchannelInteractionId':_0x28ff71['id'],'direction':'in','ContactId':_0x12a1de[_0x228a('0x8c')]['id'],'AttachmentId':_0x5b6c1d['body'][_0x228a('0x9b')]});})['then'](function(_0x1ca8fb){_0x12a1de[_0x228a('0x28')]=_0x1ca8fb;if(_0x12a1de[_0x228a('0x95')][_0x228a('0x9c')]){return db['User']['find']({'attributes':['id',_0x228a('0x3b')],'where':{'id':_0x12a1de[_0x228a('0x95')][_0x228a('0x9c')]}})[_0x228a('0x20')](function(_0x4c561c){if(_0x4c561c){_0x12a1de['applications'][_0x228a('0x9d')]({'id':0x0,'priority':0x0,'app':_0x228a('0x9e'),'appdata':_0x4c561c['name']+','+(_0x12a1de[_0x228a('0x89')][_0x228a('0x9f')]||0xa),'interval':_0x228a('0x9a')});_0x12a1de['forcedOwnership']=![];}return respondWithRpcPromise(_0x228a('0xa0'),_0x228a('0xa1'),_0x12a1de);});}return respondWithRpcPromise(_0x228a('0xa0'),_0x228a('0xa1'),_0x12a1de);})[_0x228a('0x20')](function(_0x102b81){respondWithRpcPromise(_0x228a('0xa2'),_0x228a('0xa2'),{'event':'notify','message':_0x102b81},client9002);return _0x102b81;})['then'](respondWithResult(_0x2c249c,null))[_0x228a('0x2a')](handleError(_0x2c249c,null));};exports[_0x228a('0xa3')]=function(_0x4ad046,_0x3b3420){var _0x4addab=_0x4ad046[_0x228a('0x57')]['id'];var _0x30e35c=_0x4ad046[_0x228a('0x5a')];var _0x3d5f39=0xc8;var _0x57b1cd=null;return db[_0x228a('0xa4')][_0x228a('0xa5')]({'isolationLevel':db[_0x228a('0xa4')][_0x228a('0xa6')][_0x228a('0xa7')][_0x228a('0xa8')]},function(_0x5622b9){return db[_0x228a('0x3e')]['findOne']({'where':{'id':_0x4addab},'transaction':_0x5622b9})[_0x228a('0x20')](function(_0x514da0){if(_0x514da0){return db[_0x228a('0x83')]['destroy']({'where':{'OpenchannelAccountId':_0x4addab},'transaction':_0x5622b9})[_0x228a('0x20')](function(){var _0x3244b8=_[_0x228a('0x42')](_0x30e35c,function(_0x47ba68){_0x47ba68[_0x228a('0x65')]=_0x4addab;return _0x47ba68;});return db[_0x228a('0x83')]['bulkCreate'](_0x3244b8,{'transaction':_0x5622b9});});}else{_0x3d5f39=0x194;_0x57b1cd=[];}});})[_0x228a('0x20')](function(){if(_0x3d5f39!==0x194){return db[_0x228a('0x83')][_0x228a('0xa9')]({'where':{'OpenchannelAccountId':_0x4addab},'order':_0x228a('0x87')})[_0x228a('0x20')](function(_0x3e872f){_0x57b1cd=_0x3e872f;});}})[_0x228a('0x2a')](function(_0x473de3){_0x3d5f39=0x1f4;logger[_0x228a('0x26')](_0x473de3[_0x228a('0x3a')]);if(_0x473de3['name']){delete _0x473de3['name'];}_0x57b1cd=_0x473de3;})[_0x228a('0xaa')](function(){if(_0x57b1cd===null){_0x3b3420['sendStatus'](_0x3d5f39);}else{if(_0x3d5f39===0x1f4){_0x3b3420[_0x228a('0x2b')](_0x3d5f39)[_0x228a('0xab')](_0x57b1cd);}else{_0x3b3420[_0x228a('0x2b')](_0x3d5f39)[_0x228a('0x2d')](_0x57b1cd);}}});};exports[_0x228a('0xac')]=function(_0x485abb,_0x20f2ff,_0x58b875){var _0x566735={};var _0x3b55b3={};var _0x1079af;var _0x48f622;return db['OpenchannelAccount'][_0x228a('0x67')]({'where':{'id':_0x485abb[_0x228a('0x57')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x20f2ff,null))['then'](function(_0x30a844){if(_0x30a844){_0x1079af=_0x30a844;_0x3b55b3[_0x228a('0x41')]=_[_0x228a('0x44')](db[_0x228a('0x83')][_0x228a('0x58')]);_0x3b55b3[_0x228a('0x43')]=_[_0x228a('0x44')](_0x485abb[_0x228a('0x43')]);_0x3b55b3['filters']=_[_0x228a('0x46')](_0x3b55b3['model'],_0x3b55b3[_0x228a('0x43')]);_0x566735[_0x228a('0x47')]=_[_0x228a('0x46')](_0x3b55b3[_0x228a('0x41')],qs[_0x228a('0x48')](_0x485abb[_0x228a('0x43')]['fields']));_0x566735[_0x228a('0x47')]=_0x566735[_0x228a('0x47')][_0x228a('0x49')]?_0x566735[_0x228a('0x47')]:_0x3b55b3[_0x228a('0x41')];_0x566735[_0x228a('0x4b')]=qs[_0x228a('0x4c')](_0x485abb[_0x228a('0x43')][_0x228a('0x4c')]);_0x566735['where']=qs[_0x228a('0x45')](_['pick'](_0x485abb[_0x228a('0x43')],_0x3b55b3[_0x228a('0x45')]));if(_0x485abb['query']['filter']){_0x566735[_0x228a('0x4d')]=_[_0x228a('0x50')](_0x566735['where'],{'$or':_[_0x228a('0x42')](_0x566735[_0x228a('0x47')],function(_0x4a336e){var _0x2a823a={};_0x2a823a[_0x4a336e]={'$like':'%'+_0x485abb[_0x228a('0x43')][_0x228a('0x4f')]+'%'};return _0x2a823a;})});}_0x566735=_[_0x228a('0x50')]({},_0x566735,_0x485abb[_0x228a('0x53')]);return _0x1079af[_0x228a('0xac')](_0x566735);}})['then'](function(_0x5ca946){if(_0x5ca946){_0x48f622=_0x5ca946[_0x228a('0x49')];if(!_0x485abb[_0x228a('0x43')][_0x228a('0x4a')]('nolimit')){_0x566735[_0x228a('0x2e')]=qs[_0x228a('0x2e')](_0x485abb['query'][_0x228a('0x2e')]);_0x566735[_0x228a('0x31')]=qs[_0x228a('0x31')](_0x485abb[_0x228a('0x43')][_0x228a('0x31')]);}return _0x1079af[_0x228a('0xac')](_0x566735);}})['then'](function(_0x140412){if(_0x140412){return _0x140412?{'count':_0x48f622,'rows':_0x140412}:null;}})[_0x228a('0x20')](respondWithResult(_0x20f2ff,null))['catch'](handleError(_0x20f2ff,null));};exports[_0x228a('0xad')]=function(_0x26c40e,_0x4237ae,_0x2c0a01){var _0x4c6481={'raw':![],'where':{}};var _0x3a5dfb={};var _0x3acf3c={'count':0x0,'rows':[]};return db[_0x228a('0x3e')][_0x228a('0x67')]({'where':{'id':_0x26c40e[_0x228a('0x57')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x4237ae,null))[_0x228a('0x20')](function(_0x8b4369){if(_0x8b4369){_0x3a5dfb[_0x228a('0x41')]=_[_0x228a('0x44')](db['OpenchannelInteraction']['rawAttributes']);_0x3a5dfb[_0x228a('0x43')]=_[_0x228a('0x44')](_0x26c40e[_0x228a('0x43')]);_0x3a5dfb['filters']=_[_0x228a('0x46')](_0x3a5dfb[_0x228a('0x41')],_0x3a5dfb[_0x228a('0x43')]);_0x4c6481[_0x228a('0x47')]=_[_0x228a('0x46')](_0x3a5dfb[_0x228a('0x41')],qs['fields'](_0x26c40e[_0x228a('0x43')][_0x228a('0x48')]));_0x4c6481[_0x228a('0x47')]=_0x4c6481[_0x228a('0x47')][_0x228a('0x49')]?_0x4c6481[_0x228a('0x47')]:_0x3a5dfb[_0x228a('0x41')];if(!_0x26c40e['query']['hasOwnProperty']('nolimit')){_0x4c6481[_0x228a('0x2e')]=qs[_0x228a('0x2e')](_0x26c40e['query'][_0x228a('0x2e')]);_0x4c6481[_0x228a('0x31')]=qs['offset'](_0x26c40e[_0x228a('0x43')][_0x228a('0x31')]);}_0x4c6481['order']=qs[_0x228a('0x4c')](_0x26c40e[_0x228a('0x43')]['sort']);_0x4c6481[_0x228a('0x4d')]=qs[_0x228a('0x45')](_[_0x228a('0x4e')](_0x26c40e['query'],_0x3a5dfb[_0x228a('0x45')]));_0x4c6481[_0x228a('0x4d')]['OpenchannelAccountId']=_0x8b4369['id'];if(_0x26c40e[_0x228a('0x43')]['filter']){_0x4c6481['where']=_[_0x228a('0x50')](_0x4c6481['where'],{'$or':_[_0x228a('0x42')](_0x4c6481[_0x228a('0x47')],function(_0x4d3b09){var _0x433c6e={};_0x433c6e[_0x4d3b09]={'$like':'%'+_0x26c40e[_0x228a('0x43')][_0x228a('0x4f')]+'%'};return _0x433c6e;})});}_0x4c6481=_[_0x228a('0x50')]({},_0x4c6481,_0x26c40e[_0x228a('0x53')]);return db[_0x228a('0x90')][_0x228a('0x30')]({'where':_0x4c6481['where']})[_0x228a('0x20')](function(_0x2383c6){_0x3acf3c[_0x228a('0x30')]=_0x2383c6;if(_0x26c40e[_0x228a('0x43')][_0x228a('0x54')]){_0x4c6481[_0x228a('0x55')]=[{'model':db['CmContact'],'as':_0x228a('0xae'),'required':![]},{'model':db[_0x228a('0xaf')],'as':_0x228a('0xb0'),'attributes':['name','fullname',_0x228a('0xb1')],'required':![]},{'model':db[_0x228a('0xb2')],'as':_0x228a('0xb3'),'attributes':['id',_0x228a('0x3b'),_0x228a('0xb4')],'where':_0x26c40e['query']['tag']?{'id':_0x26c40e[_0x228a('0x43')]['tag']}:undefined,'required':_0x26c40e[_0x228a('0x43')][_0x228a('0xb5')]?!![]:![]}];}return db[_0x228a('0x90')][_0x228a('0x69')](_0x4c6481);})[_0x228a('0x20')](function(_0x100cd2){_0x3acf3c[_0x228a('0xb6')]=_0x100cd2;return _0x3acf3c;});}})[_0x228a('0x20')](respondWithFilteredResult(_0x4237ae,_0x4c6481))[_0x228a('0x2a')](handleError(_0x4237ae,null));};exports['addAgents']=function(_0x5a3521,_0x2095dc,_0x4b2d1b){return db[_0x228a('0x3e')][_0x228a('0x63')]({'where':{'id':_0x5a3521['params']['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x2095dc,null))[_0x228a('0x20')](function(_0x57e378){if(_0x57e378){return _0x57e378[_0x228a('0xb7')](_0x5a3521[_0x228a('0x5a')][_0x228a('0x6b')],_[_0x228a('0xb8')](_0x5a3521[_0x228a('0x5a')],[_0x228a('0x6b'),'id'])||{})['spread'](function(_0x3fcc22){for(var _0x46a1be=0x0;_0x46a1be<_0x5a3521[_0x228a('0x5a')]['ids']['length'];_0x46a1be+=0x1){socket['emit'](_0x228a('0xb9'),{'UserId':Number(_0x5a3521[_0x228a('0x5a')][_0x228a('0x6b')][_0x46a1be]),'OpenchannelAccountId':Number(_0x5a3521[_0x228a('0x57')]['id'])});}return _0x3fcc22;});}})[_0x228a('0x20')](respondWithResult(_0x2095dc,null))[_0x228a('0x2a')](handleError(_0x2095dc,null));};exports[_0x228a('0xba')]=function(_0x4869f9,_0x468481,_0x18a829){return db[_0x228a('0x3e')][_0x228a('0x63')]({'where':{'id':_0x4869f9[_0x228a('0x57')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x468481,null))['then'](function(_0x47070e){if(_0x47070e){return _0x47070e[_0x228a('0xba')](_0x4869f9[_0x228a('0x43')][_0x228a('0x6b')])[_0x228a('0x20')](function(){if(_[_0x228a('0xbb')](_0x4869f9[_0x228a('0x43')]['ids'])){for(var _0x4698b3=0x0;_0x4698b3<_0x4869f9['query'][_0x228a('0x6b')]['length'];_0x4698b3+=0x1){socket[_0x228a('0xbc')](_0x228a('0xbd'),{'UserId':Number(_0x4869f9[_0x228a('0x43')][_0x228a('0x6b')][_0x4698b3]),'OpenchannelAccountId':Number(_0x4869f9['params']['id'])});}}else{socket[_0x228a('0xbc')](_0x228a('0xbd'),{'UserId':Number(_0x4869f9[_0x228a('0x43')]['ids']),'OpenchannelAccountId':Number(_0x4869f9[_0x228a('0x57')]['id'])});}});}})[_0x228a('0x20')](respondWithStatusCode(_0x468481,null))[_0x228a('0x2a')](handleError(_0x468481,null));};exports[_0x228a('0xbe')]=function(_0x21497a,_0x30df62,_0x40f2f7){var _0x3c4b23={};var _0x5a47e9={};var _0x1cec5b;var _0x3c2bf2;return db[_0x228a('0x3e')][_0x228a('0x67')]({'where':{'id':_0x21497a[_0x228a('0x57')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x30df62,null))[_0x228a('0x20')](function(_0x55fa4f){if(_0x55fa4f){_0x1cec5b=_0x55fa4f;_0x5a47e9[_0x228a('0x41')]=_[_0x228a('0x44')](db[_0x228a('0xaf')]['rawAttributes']);_0x5a47e9[_0x228a('0x43')]=_[_0x228a('0x44')](_0x21497a[_0x228a('0x43')]);_0x5a47e9[_0x228a('0x45')]=_[_0x228a('0x46')](_0x5a47e9[_0x228a('0x41')],_0x5a47e9[_0x228a('0x43')]);_0x3c4b23[_0x228a('0x47')]=_['intersection'](_0x5a47e9['model'],qs[_0x228a('0x48')](_0x21497a[_0x228a('0x43')][_0x228a('0x48')]));_0x3c4b23[_0x228a('0x47')]=_0x3c4b23[_0x228a('0x47')][_0x228a('0x49')]?_0x3c4b23[_0x228a('0x47')]:_0x5a47e9[_0x228a('0x41')];_0x3c4b23[_0x228a('0x4b')]=qs[_0x228a('0x4c')](_0x21497a[_0x228a('0x43')][_0x228a('0x4c')]);_0x3c4b23[_0x228a('0x4d')]=qs[_0x228a('0x45')](_[_0x228a('0x4e')](_0x21497a[_0x228a('0x43')],_0x5a47e9[_0x228a('0x45')]));if(_0x21497a[_0x228a('0x43')]['filter']){_0x3c4b23[_0x228a('0x4d')]=_[_0x228a('0x50')](_0x3c4b23['where'],{'$or':_['map'](_0x3c4b23[_0x228a('0x47')],function(_0x1821ff){var _0x20e5d1={};_0x20e5d1[_0x1821ff]={'$like':'%'+_0x21497a[_0x228a('0x43')][_0x228a('0x4f')]+'%'};return _0x20e5d1;})});}_0x3c4b23=_[_0x228a('0x50')]({},_0x3c4b23,_0x21497a['options']);return _0x1cec5b[_0x228a('0xbe')](_0x3c4b23);}})[_0x228a('0x20')](function(_0x9d395c){if(_0x9d395c){_0x3c2bf2=_0x9d395c[_0x228a('0x49')];if(!_0x21497a['query'][_0x228a('0x4a')](_0x228a('0x6d'))){_0x3c4b23[_0x228a('0x2e')]=qs['limit'](_0x21497a['query'][_0x228a('0x2e')]);_0x3c4b23[_0x228a('0x31')]=qs[_0x228a('0x31')](_0x21497a[_0x228a('0x43')]['offset']);}return _0x1cec5b[_0x228a('0xbe')](_0x3c4b23);}})[_0x228a('0x20')](function(_0x46964e){if(_0x46964e){return _0x46964e?{'count':_0x3c2bf2,'rows':_0x46964e}:null;}})[_0x228a('0x20')](respondWithResult(_0x30df62,null))[_0x228a('0x2a')](handleError(_0x30df62,null));};exports[_0x228a('0xab')]=function(_0xdb55b0,_0x260b72,_0x355eee){var _0x14fada,_0x10f4ab,_0x7f71e6;if(_[_0x228a('0x79')](_0xdb55b0[_0x228a('0x5a')][_0x228a('0x5a')])||_0xdb55b0[_0x228a('0x5a')][_0x228a('0x5a')]===''){throw new db[(_0x228a('0x72'))][(_0x228a('0x73'))](_0x228a('0x7c'));}if(_[_0x228a('0x79')](_0xdb55b0[_0x228a('0x5a')]['to'])){}_0x14fada=_0xdb55b0[_0x228a('0x5a')]['to'];return db[_0x228a('0x3e')][_0x228a('0x67')]({'where':{'id':_0xdb55b0[_0x228a('0x57')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x260b72,null))[_0x228a('0x20')](function(_0x59b80d){if(_0x59b80d){return db['OpenchannelAccount'][_0x228a('0x63')]({'where':{'id':_0x59b80d['id']},'include':[{'model':db[_0x228a('0x7f')],'as':_0x228a('0x80'),'include':[{'model':db[_0x228a('0x71')],'as':'Contacts','where':{[_0x59b80d[_0x228a('0x7d')]]:_0x14fada},'limit':0x1,'order':[[_0x228a('0x76'),_0x228a('0x82')]]}]}]})[_0x228a('0x20')](handleEntityNotFound(_0x260b72,null))[_0x228a('0x20')](function(_0x56c491){if(_0x56c491&&_0x56c491[_0x228a('0x80')]){_0x10f4ab=_0x56c491[_0x228a('0x5e')]({'plain':!![]});if(_0x10f4ab[_0x228a('0x80')]&&_0x10f4ab[_0x228a('0x80')][_0x228a('0x81')][_0x228a('0x49')]){return _0x10f4ab['List'][_0x228a('0x81')][0x0];}return db['CmContact']['create'](_[_0x228a('0x1a')](_0xdb55b0[_0x228a('0x5a')],{'firstName':_0x14fada,[_0x56c491[_0x228a('0x7d')]]:_0x14fada,'phone':_0x14fada,'ListId':_0x10f4ab[_0x228a('0x8b')]}));}})['then'](handleEntityNotFound(_0x260b72,null))[_0x228a('0x20')](function(_0x1edb22){if(_0x1edb22){_0x7f71e6=_0x1edb22;return db[_0x228a('0x90')][_0x228a('0x63')]({'where':{'ContactId':_0x7f71e6['id'],'closed':![],'OpenchannelAccountId':_0x10f4ab['id']}})[_0x228a('0x20')](function(_0x250d3b){if(_0x250d3b){return[_0x250d3b,![]];}return db[_0x228a('0x90')][_0x228a('0x59')]({'UserId':_0xdb55b0['user']['id'],'ContactId':_0x7f71e6['id'],'OpenchannelAccountId':_0x10f4ab['id'],'lastMsgDirection':'out','firstMsgDirection':'out','Messages':[_[_0x228a('0x50')](_0xdb55b0[_0x228a('0x5a')],{'read':![],'body':_0xdb55b0[_0x228a('0x5a')][_0x228a('0x5a')],'OpenchannelAccountId':_0x10f4ab['id'],'UserId':_0xdb55b0[_0x228a('0x5b')]['id'],'ContactId':_0x7f71e6['id']})]},{'include':[{'model':db[_0x228a('0xbf')],'as':_0x228a('0xc0')}]})[_0x228a('0x20')](function(_0x1e8946){return[_0x1e8946,!![]];});});}})[_0x228a('0x93')](function(_0x562bcd,_0x374992){if(_0x374992){return _0x562bcd;}return db[_0x228a('0xbf')]['create'](_[_0x228a('0x50')](_0xdb55b0[_0x228a('0x5a')],{'read':![],'body':_0xdb55b0[_0x228a('0x5a')][_0x228a('0x5a')],'OpenchannelAccountId':_0x10f4ab['id'],'OpenchannelInteractionId':_0x562bcd['id'],'UserId':_0xdb55b0[_0x228a('0x5b')]['id'],'ContactId':_0x7f71e6['id']}))['then'](function(_0x2d8781){_0x562bcd['dataValues'][_0x228a('0xc0')]=[];_0x562bcd['dataValues'][_0x228a('0xc0')][_0x228a('0x98')](_0x2d8781[_0x228a('0xc1')]);return _0x562bcd;});});}})[_0x228a('0x20')](respondWithResult(_0x260b72,null))[_0x228a('0x2a')](handleError(_0x260b72,null));}; \ No newline at end of file +var _0x615d=['list','orderBy','applications','priority','asc','ListId','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','lastName','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','User','fullname','Tag','Tags','tag','addAgents','omit','emit','removeAgents','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','filter','merge','options','includeAll','rows','show','params','Pause','rawAttributes','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','sort','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account'];(function(_0x1449d0,_0x39756f){var _0x28991f=function(_0x24d1f3){while(--_0x24d1f3){_0x1449d0['push'](_0x1449d0['shift']());}};_0x28991f(++_0x39756f);}(_0x615d,0xfc));var _0xd615=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x615d[_0x1344d6];return _0xf45b24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd615('0x0'));var zipdir=require(_0xd615('0x1'));var jsonpatch=require(_0xd615('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd615('0x3'));var Mustache=require('mustache');var util=require(_0xd615('0x4'));var path=require(_0xd615('0x5'));var sox=require(_0xd615('0x6'));var csv=require(_0xd615('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd615('0x8'));var _=require(_0xd615('0x9'));var squel=require(_0xd615('0xa'));var crypto=require('crypto');var jsforce=require(_0xd615('0xb'));var deskjs=require(_0xd615('0xc'));var toCsv=require(_0xd615('0x7'));var querystring=require(_0xd615('0xd'));var Papa=require(_0xd615('0xe'));var Redis=require(_0xd615('0xf'));var authService=require(_0xd615('0x10'));var qs=require(_0xd615('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd615('0x12'));var logger=require(_0xd615('0x13'))(_0xd615('0x14'));var utils=require(_0xd615('0x15'));var config=require(_0xd615('0x16'));var licenseUtil=require(_0xd615('0x17'));var db=require(_0xd615('0x18'))['db'];config['redis']=_[_0xd615('0x19')](config['redis'],{'host':_0xd615('0x1a'),'port':0x18eb});var socket=require(_0xd615('0x1b'))(new Redis(config[_0xd615('0x1c')]));require(_0xd615('0x1d'))[_0xd615('0x1e')](socket);var jayson=require(_0xd615('0x1f'));var client=jayson[_0xd615('0x20')][_0xd615('0x21')]({'port':0x232c});var client9002=jayson[_0xd615('0x20')][_0xd615('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x479a06,_0x4ebded,_0x20ace0,_0x3563d6){return new BPromise(function(_0x2d3313,_0x582883){var _0x57f9d9=_0x3563d6||client;return _0x57f9d9[_0xd615('0x22')](_0x479a06,_0x20ace0)[_0xd615('0x23')](function(_0x16725a){logger[_0xd615('0x24')](_0xd615('0x25'),_0x4ebded,_0xd615('0x26'));logger[_0xd615('0x27')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x4ebded,'request\x20sent',JSON[_0xd615('0x28')](_0x16725a));if(_0x16725a[_0xd615('0x29')]){if(_0x16725a[_0xd615('0x29')][_0xd615('0x2a')]===0x1f4){logger[_0xd615('0x29')](_0xd615('0x25'),_0x4ebded,_0x16725a[_0xd615('0x29')]['message']);return _0x582883(_0x16725a[_0xd615('0x29')][_0xd615('0x2b')]);}logger[_0xd615('0x29')](_0xd615('0x25'),_0x4ebded,_0x16725a[_0xd615('0x29')][_0xd615('0x2b')]);return _0x2d3313(_0x16725a[_0xd615('0x29')][_0xd615('0x2b')]);}else{logger[_0xd615('0x24')](_0xd615('0x25'),_0x4ebded,'request\x20sent');_0x2d3313(_0x16725a[_0xd615('0x2c')][_0xd615('0x2b')]);}})[_0xd615('0x2d')](function(_0x49acb1){logger[_0xd615('0x29')](_0xd615('0x25'),_0x4ebded,_0x49acb1);_0x582883(_0x49acb1);});});}function respondWithStatusCode(_0x2ce7b7,_0x369f05){_0x369f05=_0x369f05||0xcc;return function(_0xfcabb0){if(_0xfcabb0){return _0x2ce7b7[_0xd615('0x2e')](_0x369f05);}return _0x2ce7b7[_0xd615('0x2f')](_0x369f05)[_0xd615('0x30')]();};}function respondWithResult(_0x586559,_0x2b37c2){_0x2b37c2=_0x2b37c2||0xc8;return function(_0x4221e0){if(_0x4221e0){return _0x586559[_0xd615('0x2f')](_0x2b37c2)[_0xd615('0x31')](_0x4221e0);}};}function respondWithFilteredResult(_0xd93357,_0x2a6232){return function(_0x20262c){if(_0x20262c){var _0x5a26d3=typeof _0x2a6232[_0xd615('0x32')]===_0xd615('0x33')&&typeof _0x2a6232[_0xd615('0x34')]==='undefined';var _0x361884=_0x20262c[_0xd615('0x35')];var _0x1d4afb=_0x5a26d3?0x0:_0x2a6232[_0xd615('0x32')];var _0x3a5410=_0x5a26d3?_0x20262c[_0xd615('0x35')]:_0x2a6232[_0xd615('0x32')]+_0x2a6232[_0xd615('0x34')];var _0x257429;if(_0x3a5410>=_0x361884){_0x3a5410=_0x361884;_0x257429=0xc8;}else{_0x257429=0xce;}_0xd93357['status'](_0x257429);return _0xd93357[_0xd615('0x36')](_0xd615('0x37'),_0x1d4afb+'-'+_0x3a5410+'/'+_0x361884)[_0xd615('0x31')](_0x20262c);}return null;};}function patchUpdates(_0xde9a3d){return function(_0x1564e5){try{jsonpatch[_0xd615('0x38')](_0x1564e5,_0xde9a3d,!![]);}catch(_0x558867){return BPromise[_0xd615('0x39')](_0x558867);}return _0x1564e5[_0xd615('0x3a')]();};}function saveUpdates(_0x3eff84,_0x260541){return function(_0x36042f){if(_0x36042f){return _0x36042f[_0xd615('0x3b')](_0x3eff84)['then'](function(_0x23be6c){return _0x23be6c;});}return null;};}function removeEntity(_0x13bec3,_0x1b00bf){return function(_0x26c1a7){if(_0x26c1a7){return _0x26c1a7[_0xd615('0x3c')]()[_0xd615('0x23')](function(){var _0x3dc82a=_0x26c1a7[_0xd615('0x3d')]({'plain':!![]});var _0x1aa67f='OpenchannelAccounts';return db[_0xd615('0x3e')][_0xd615('0x3c')]({'where':{'type':_0x1aa67f,'resourceId':_0x3dc82a['id']}})[_0xd615('0x23')](function(){return _0x26c1a7;});})[_0xd615('0x23')](function(){_0x13bec3[_0xd615('0x2f')](0xcc)[_0xd615('0x30')]();});}};}function handleEntityNotFound(_0x54a971,_0x76ded4){return function(_0x1165ee){if(!_0x1165ee){_0x54a971[_0xd615('0x2e')](0x194);}return _0x1165ee;};}function handleError(_0x4f54db,_0x3d54d9){_0x3d54d9=_0x3d54d9||0x1f4;return function(_0x1f5784){logger[_0xd615('0x29')](_0x1f5784[_0xd615('0x3f')]);if(_0x1f5784[_0xd615('0x40')]){delete _0x1f5784[_0xd615('0x40')];}_0x4f54db['status'](_0x3d54d9)[_0xd615('0x41')](_0x1f5784);};}exports[_0xd615('0x42')]=function(_0xb7e39e,_0xe53340){var _0x16bf0d={'include':[{'model':db['Pause'],'as':_0xd615('0x43')}]},_0x38e052={},_0x1144b8={'count':0x0,'rows':[]};var _0xfbb21c=_[_0xd615('0x44')](db[_0xd615('0x45')]['rawAttributes'],function(_0x2bf01a){return{'name':_0x2bf01a[_0xd615('0x46')],'type':_0x2bf01a[_0xd615('0x47')][_0xd615('0x48')]};});_0x38e052[_0xd615('0x49')]=_[_0xd615('0x44')](_0xfbb21c,'name');_0x38e052[_0xd615('0x4a')]=_[_0xd615('0x4b')](_0xb7e39e['query']);_0x38e052[_0xd615('0x4c')]=_['intersection'](_0x38e052[_0xd615('0x49')],_0x38e052[_0xd615('0x4a')]);_0x16bf0d[_0xd615('0x4d')]=_[_0xd615('0x4e')](_0x38e052['model'],qs[_0xd615('0x4f')](_0xb7e39e[_0xd615('0x4a')][_0xd615('0x4f')]));_0x16bf0d[_0xd615('0x4d')]=_0x16bf0d[_0xd615('0x4d')][_0xd615('0x50')]?_0x16bf0d[_0xd615('0x4d')]:_0x38e052[_0xd615('0x49')];if(!_0xb7e39e['query'][_0xd615('0x51')](_0xd615('0x52'))){_0x16bf0d['limit']=qs['limit'](_0xb7e39e['query'][_0xd615('0x34')]);_0x16bf0d[_0xd615('0x32')]=qs[_0xd615('0x32')](_0xb7e39e['query'][_0xd615('0x32')]);}_0x16bf0d[_0xd615('0x53')]=qs['sort'](_0xb7e39e['query']['sort']);_0x16bf0d[_0xd615('0x54')]=qs[_0xd615('0x4c')](_[_0xd615('0x55')](_0xb7e39e[_0xd615('0x4a')],_0x38e052[_0xd615('0x4c')]),_0xfbb21c);if(_0xb7e39e[_0xd615('0x4a')]['filter']){_0x16bf0d[_0xd615('0x54')]=_['merge'](_0x16bf0d['where'],{'$or':_[_0xd615('0x44')](_0xfbb21c,function(_0x5bdbb0){if(_0x5bdbb0[_0xd615('0x47')]!==_0xd615('0x56')){var _0x5b0c6d={};_0x5b0c6d[_0x5bdbb0[_0xd615('0x40')]]={'$like':'%'+_0xb7e39e[_0xd615('0x4a')][_0xd615('0x57')]+'%'};return _0x5b0c6d;}})});}_0x16bf0d=_[_0xd615('0x58')]({},_0x16bf0d,_0xb7e39e[_0xd615('0x59')]);var _0x5484a3={'where':_0x16bf0d['where']};return db[_0xd615('0x45')]['count'](_0x5484a3)['then'](function(_0x55bb91){_0x1144b8[_0xd615('0x35')]=_0x55bb91;if(_0xb7e39e[_0xd615('0x4a')][_0xd615('0x5a')]){_0x16bf0d['include']=[{'all':!![]}];}return db[_0xd615('0x45')]['findAll'](_0x16bf0d);})[_0xd615('0x23')](function(_0x5b2ca7){_0x1144b8[_0xd615('0x5b')]=_0x5b2ca7;return _0x1144b8;})['then'](respondWithFilteredResult(_0xe53340,_0x16bf0d))['catch'](handleError(_0xe53340,null));};exports[_0xd615('0x5c')]=function(_0x40cc88,_0x4966f1){var _0x419069={'raw':![],'where':{'id':_0x40cc88[_0xd615('0x5d')]['id']},'include':[{'model':db[_0xd615('0x5e')],'as':_0xd615('0x43')}]},_0x353303={};_0x353303[_0xd615('0x49')]=_[_0xd615('0x4b')](db[_0xd615('0x45')][_0xd615('0x5f')]);_0x353303[_0xd615('0x4a')]=_[_0xd615('0x4b')](_0x40cc88[_0xd615('0x4a')]);_0x353303[_0xd615('0x4c')]=_[_0xd615('0x4e')](_0x353303[_0xd615('0x49')],_0x353303[_0xd615('0x4a')]);_0x419069['attributes']=_[_0xd615('0x4e')](_0x353303[_0xd615('0x49')],qs[_0xd615('0x4f')](_0x40cc88[_0xd615('0x4a')][_0xd615('0x4f')]));_0x419069[_0xd615('0x4d')]=_0x419069[_0xd615('0x4d')][_0xd615('0x50')]?_0x419069[_0xd615('0x4d')]:_0x353303[_0xd615('0x49')];if(_0x40cc88[_0xd615('0x4a')][_0xd615('0x5a')]){_0x419069[_0xd615('0x60')]=[{'all':!![]}];}_0x419069=_[_0xd615('0x58')]({},_0x419069,_0x40cc88['options']);return db['OpenchannelAccount']['find'](_0x419069)[_0xd615('0x23')](handleEntityNotFound(_0x4966f1,null))['then'](respondWithResult(_0x4966f1,null))[_0xd615('0x2d')](handleError(_0x4966f1,null));};exports[_0xd615('0x61')]=function(_0xdf3931,_0x130dd6){return db['OpenchannelAccount'][_0xd615('0x61')](_0xdf3931[_0xd615('0x62')],{})[_0xd615('0x23')](function(_0x217816){var _0x30ca21=_0xdf3931['user'][_0xd615('0x3d')]({'plain':!![]});if(!_0x30ca21)throw new Error(_0xd615('0x63'));if(_0x30ca21[_0xd615('0x64')]===_0xd615('0x65')){var _0x250870=_0x217816[_0xd615('0x3d')]({'plain':!![]});var _0xe0b9aa=_0xd615('0x66');return db[_0xd615('0x67')]['find']({'where':{'name':_0xe0b9aa,'userProfileId':_0x30ca21['userProfileId']},'raw':!![]})['then'](function(_0x31ae37){if(_0x31ae37&&_0x31ae37[_0xd615('0x68')]===0x0){return db['UserProfileResource']['create']({'name':_0x250870[_0xd615('0x40')],'resourceId':_0x250870['id'],'type':_0x31ae37[_0xd615('0x40')],'sectionId':_0x31ae37['id']},{})[_0xd615('0x23')](function(){return _0x217816;});}else{return _0x217816;}})['catch'](function(_0x2c0a5b){logger[_0xd615('0x29')](_0xd615('0x69'),_0x2c0a5b);throw _0x2c0a5b;});}return _0x217816;})[_0xd615('0x23')](respondWithResult(_0x130dd6,0xc9))[_0xd615('0x2d')](handleError(_0x130dd6,null));};exports[_0xd615('0x3b')]=function(_0x4ed243,_0x4b5b8f){if(_0x4ed243[_0xd615('0x62')]['id']){delete _0x4ed243[_0xd615('0x62')]['id'];}return db[_0xd615('0x45')][_0xd615('0x6a')]({'where':{'id':_0x4ed243['params']['id']},'include':[{'model':db[_0xd615('0x5e')],'as':_0xd615('0x43')}]})[_0xd615('0x23')](handleEntityNotFound(_0x4b5b8f,null))[_0xd615('0x23')](saveUpdates(_0x4ed243[_0xd615('0x62')],null))['then'](respondWithResult(_0x4b5b8f,null))[_0xd615('0x2d')](handleError(_0x4b5b8f,null));};exports['destroy']=function(_0x457c60,_0x3cc7c3){return db[_0xd615('0x45')]['find']({'where':{'id':_0x457c60[_0xd615('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3cc7c3,null))[_0xd615('0x23')](removeEntity(_0x3cc7c3,null))[_0xd615('0x2d')](handleError(_0x3cc7c3,null));};exports[_0xd615('0x6b')]=function(_0x44bf2f,_0x28b63f){return db[_0xd615('0x45')][_0xd615('0x6b')]()[_0xd615('0x23')](respondWithResult(_0x28b63f,null))[_0xd615('0x2d')](handleError(_0x28b63f,null));};exports[_0xd615('0x6c')]=function(_0x5c0fa7,_0x327cfc,_0x3407ea){if(_0x5c0fa7[_0xd615('0x62')]['id']){delete _0x5c0fa7[_0xd615('0x62')]['id'];}return db[_0xd615('0x45')][_0xd615('0x6a')]({'where':{'id':_0x5c0fa7[_0xd615('0x5d')]['id']}})[_0xd615('0x23')](handleEntityNotFound(_0x327cfc,null))[_0xd615('0x23')](function(_0x391581){if(_0x391581){_0x5c0fa7[_0xd615('0x62')][_0xd615('0x6d')]=_0x391581['id'];return db[_0xd615('0x6e')][_0xd615('0x61')](_0x5c0fa7['body']);}})[_0xd615('0x23')](respondWithResult(_0x327cfc,null))[_0xd615('0x2d')](handleError(_0x327cfc,null));};exports[_0xd615('0x6f')]=function(_0x556f76,_0x2db8f9,_0x4fc9aa){var _0x313f08={'raw':![],'where':{}};var _0x16cddc={};var _0x4d9244={'count':0x0,'rows':[]};return db[_0xd615('0x45')][_0xd615('0x70')]({'where':{'id':_0x556f76['params']['id']}})[_0xd615('0x23')](handleEntityNotFound(_0x2db8f9,null))[_0xd615('0x23')](function(_0x2a4119){if(_0x2a4119){_0x16cddc[_0xd615('0x49')]=_[_0xd615('0x4b')](db[_0xd615('0x6e')]['rawAttributes']);_0x16cddc['query']=_[_0xd615('0x4b')](_0x556f76['query']);_0x16cddc[_0xd615('0x4c')]=_['intersection'](_0x16cddc[_0xd615('0x49')],_0x16cddc[_0xd615('0x4a')]);_0x313f08[_0xd615('0x4d')]=_['intersection'](_0x16cddc[_0xd615('0x49')],qs[_0xd615('0x4f')](_0x556f76[_0xd615('0x4a')]['fields']));_0x313f08[_0xd615('0x4d')]=_0x313f08['attributes'][_0xd615('0x50')]?_0x313f08[_0xd615('0x4d')]:_0x16cddc[_0xd615('0x49')];if(!_0x556f76[_0xd615('0x4a')]['hasOwnProperty']('nolimit')){_0x313f08['limit']=qs[_0xd615('0x34')](_0x556f76[_0xd615('0x4a')][_0xd615('0x34')]);_0x313f08[_0xd615('0x32')]=qs['offset'](_0x556f76[_0xd615('0x4a')][_0xd615('0x32')]);}_0x313f08[_0xd615('0x53')]=qs[_0xd615('0x71')](_0x556f76[_0xd615('0x4a')][_0xd615('0x71')]);_0x313f08[_0xd615('0x54')]=qs['filters'](_['pick'](_0x556f76[_0xd615('0x4a')],_0x16cddc['filters']));_0x313f08[_0xd615('0x54')]['OpenchannelAccountId']=_0x2a4119['id'];if(_0x556f76['query'][_0xd615('0x57')]){_0x313f08[_0xd615('0x54')]=_['merge'](_0x313f08[_0xd615('0x54')],{'$or':_[_0xd615('0x44')](_0x313f08[_0xd615('0x4d')],function(_0x11f60d){var _0x2f026b={};_0x2f026b[_0x11f60d]={'$like':'%'+_0x556f76[_0xd615('0x4a')][_0xd615('0x57')]+'%'};return _0x2f026b;})});}_0x313f08=_['merge']({},_0x313f08,_0x556f76[_0xd615('0x59')]);return db['Disposition'][_0xd615('0x35')]({'where':_0x313f08[_0xd615('0x54')]})[_0xd615('0x23')](function(_0x4a8e71){_0x4d9244[_0xd615('0x35')]=_0x4a8e71;if(_0x556f76[_0xd615('0x4a')]['includeAll']){_0x313f08[_0xd615('0x60')]=[{'all':!![]}];}return db['Disposition'][_0xd615('0x72')](_0x313f08);})[_0xd615('0x23')](function(_0x44336d){_0x4d9244[_0xd615('0x5b')]=_0x44336d;return _0x4d9244;});}})[_0xd615('0x23')](respondWithFilteredResult(_0x2db8f9,_0x313f08))[_0xd615('0x2d')](handleError(_0x2db8f9,null));};exports[_0xd615('0x73')]=function(_0x245976,_0x3cfaa2,_0x5cf31a){return db[_0xd615('0x45')][_0xd615('0x6a')]({'where':{'id':_0x245976['params']['id']}})[_0xd615('0x23')](handleEntityNotFound(_0x3cfaa2,null))[_0xd615('0x23')](function(_0x2b38cc){if(_0x2b38cc){return _0x2b38cc[_0xd615('0x73')](_0x245976['query'][_0xd615('0x74')]);}})[_0xd615('0x23')](respondWithStatusCode(_0x3cfaa2,null))[_0xd615('0x2d')](handleError(_0x3cfaa2,null));};exports[_0xd615('0x75')]=function(_0x37193c,_0x2d0e5e,_0x2ce68e){if(_0x37193c[_0xd615('0x62')]['id']){delete _0x37193c[_0xd615('0x62')]['id'];}return db[_0xd615('0x45')][_0xd615('0x6a')]({'where':{'id':_0x37193c[_0xd615('0x5d')]['id']}})[_0xd615('0x23')](handleEntityNotFound(_0x2d0e5e,null))[_0xd615('0x23')](function(_0x55db18){if(_0x55db18){_0x37193c[_0xd615('0x62')][_0xd615('0x6d')]=_0x55db18['id'];return db[_0xd615('0x76')]['create'](_0x37193c[_0xd615('0x62')]);}})[_0xd615('0x23')](respondWithResult(_0x2d0e5e,null))[_0xd615('0x2d')](handleError(_0x2d0e5e,null));};exports[_0xd615('0x77')]=function(_0x3766c7,_0x3e2b59,_0x39a690){var _0x4f8b6e={'raw':![],'where':{}};var _0x320a96={};var _0x279734={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xd615('0x70')]({'where':{'id':_0x3766c7[_0xd615('0x5d')]['id']}})[_0xd615('0x23')](handleEntityNotFound(_0x3e2b59,null))[_0xd615('0x23')](function(_0x207bd9){if(_0x207bd9){_0x320a96[_0xd615('0x49')]=_[_0xd615('0x4b')](db['CannedAnswer'][_0xd615('0x5f')]);_0x320a96[_0xd615('0x4a')]=_[_0xd615('0x4b')](_0x3766c7[_0xd615('0x4a')]);_0x320a96['filters']=_[_0xd615('0x4e')](_0x320a96['model'],_0x320a96[_0xd615('0x4a')]);_0x4f8b6e[_0xd615('0x4d')]=_['intersection'](_0x320a96[_0xd615('0x49')],qs[_0xd615('0x4f')](_0x3766c7[_0xd615('0x4a')]['fields']));_0x4f8b6e[_0xd615('0x4d')]=_0x4f8b6e['attributes'][_0xd615('0x50')]?_0x4f8b6e[_0xd615('0x4d')]:_0x320a96[_0xd615('0x49')];if(!_0x3766c7[_0xd615('0x4a')][_0xd615('0x51')]('nolimit')){_0x4f8b6e['limit']=qs[_0xd615('0x34')](_0x3766c7[_0xd615('0x4a')][_0xd615('0x34')]);_0x4f8b6e[_0xd615('0x32')]=qs[_0xd615('0x32')](_0x3766c7[_0xd615('0x4a')]['offset']);}_0x4f8b6e[_0xd615('0x53')]=qs[_0xd615('0x71')](_0x3766c7[_0xd615('0x4a')][_0xd615('0x71')]);_0x4f8b6e[_0xd615('0x54')]=qs['filters'](_[_0xd615('0x55')](_0x3766c7[_0xd615('0x4a')],_0x320a96[_0xd615('0x4c')]));_0x4f8b6e[_0xd615('0x54')][_0xd615('0x6d')]=_0x207bd9['id'];if(_0x3766c7[_0xd615('0x4a')][_0xd615('0x57')]){_0x4f8b6e['where']=_['merge'](_0x4f8b6e[_0xd615('0x54')],{'$or':_[_0xd615('0x44')](_0x4f8b6e[_0xd615('0x4d')],function(_0x5043ea){var _0x2ab99a={};_0x2ab99a[_0x5043ea]={'$like':'%'+_0x3766c7['query'][_0xd615('0x57')]+'%'};return _0x2ab99a;})});}_0x4f8b6e=_[_0xd615('0x58')]({},_0x4f8b6e,_0x3766c7[_0xd615('0x59')]);return db['CannedAnswer']['count']({'where':_0x4f8b6e[_0xd615('0x54')]})[_0xd615('0x23')](function(_0x33fe4f){_0x279734[_0xd615('0x35')]=_0x33fe4f;if(_0x3766c7[_0xd615('0x4a')][_0xd615('0x5a')]){_0x4f8b6e[_0xd615('0x60')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd615('0x72')](_0x4f8b6e);})[_0xd615('0x23')](function(_0x2a895d){_0x279734[_0xd615('0x5b')]=_0x2a895d;return _0x279734;});}})['then'](respondWithFilteredResult(_0x3e2b59,_0x4f8b6e))[_0xd615('0x2d')](handleError(_0x3e2b59,null));};exports[_0xd615('0x78')]=function(_0x22355d,_0x22e948,_0x54b7b3){return db['OpenchannelAccount'][_0xd615('0x6a')]({'where':{'id':_0x22355d['params']['id']}})[_0xd615('0x23')](handleEntityNotFound(_0x22e948,null))['then'](function(_0x5c6819){if(_0x5c6819){return _0x5c6819[_0xd615('0x78')](_0x22355d[_0xd615('0x4a')]['ids']);}})[_0xd615('0x23')](respondWithStatusCode(_0x22e948,null))[_0xd615('0x2d')](handleError(_0x22e948,null));};exports[_0xd615('0x79')]=function(_0x289fce,_0x37fdd1,_0x4c6753){var _0x6cfdb1={'body':_0x289fce[_0xd615('0x62')],'channel':_0xd615('0x7a')};var _0x10e5b5=[];var _0x46225b=[];var _0x143799={};var _0x4b99c0=![];return db[_0xd615('0x7b')][_0xd615('0x6b')]()['then'](function(_0x49e52c){if(!_0x49e52c){throw new db[(_0xd615('0x7c'))][(_0xd615('0x7d'))](_0xd615('0x7e'));}_0x10e5b5=_[_0xd615('0x7f')](_[_0xd615('0x4b')](_0x49e52c),['createdAt',_0xd615('0x80')]);_0x46225b=_[_0xd615('0x7f')](_[_0xd615('0x4b')](_0x49e52c),[_0xd615('0x81'),_0xd615('0x80'),_0xd615('0x82'),'ListId']);if(_0x289fce['body']['id']){delete _0x289fce[_0xd615('0x62')]['id'];}if(_[_0xd615('0x83')](_0x289fce['body'][_0xd615('0x84')])){throw new db[(_0xd615('0x7c'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xd615('0x83')](_0x289fce[_0xd615('0x62')]['body'])||_0x289fce['body'][_0xd615('0x62')]===''){throw new db[(_0xd615('0x7c'))]['ValidationError'](_0xd615('0x85'));}if(_[_0xd615('0x83')](_0x289fce[_0xd615('0x62')][_0xd615('0x86')])){throw new db['Sequelize']['ValidationError'](_0xd615('0x87')+_0x46225b);}if(!_[_0xd615('0x88')](_0x46225b,_0x289fce[_0xd615('0x62')]['mapKey'])){throw new db[(_0xd615('0x7c'))][(_0xd615('0x7d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x46225b);}_0x143799[_0x289fce[_0xd615('0x62')]['mapKey']]=_0x289fce[_0xd615('0x62')][_0xd615('0x84')];})['then'](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x289fce['params']['id']},'include':[{'model':db[_0xd615('0x89')],'as':_0xd615('0x8a'),'include':[{'model':db['CmContact'],'as':_0xd615('0x8b'),'where':_0x143799,'limit':0x1,'order':[['updatedAt',_0xd615('0x8c')]]}]},{'model':db[_0xd615('0x8d')],'as':_0xd615('0x8e')}]});})['then'](handleEntityNotFound(_0x37fdd1,null))[_0xd615('0x23')](function(_0x2c92b8){if(_0x2c92b8&&_0x2c92b8[_0xd615('0x8a')]){_0x6cfdb1[_0xd615('0x8f')]=_0x2c92b8;_0x6cfdb1['applications']=_0x2c92b8[_0xd615('0x8e')];_0x6cfdb1[_0xd615('0x90')]=_0x2c92b8[_0xd615('0x8a')];_0x6cfdb1['applications']=_[_0xd615('0x91')](_0x6cfdb1[_0xd615('0x92')],[_0xd615('0x93')],[_0xd615('0x94')]);if(_0x6cfdb1[_0xd615('0x8f')][_0xd615('0x8e')]){delete _0x6cfdb1['account'][_0xd615('0x8e')];}if(_0x6cfdb1[_0xd615('0x8f')]['List']&&_0x6cfdb1['account'][_0xd615('0x8a')]['Contacts']['length']){return _0x6cfdb1[_0xd615('0x8f')][_0xd615('0x8a')][_0xd615('0x8b')][0x0];}var _0x34c259=_[_0xd615('0x19')](_0x289fce['body'],{'firstName':_0x289fce[_0xd615('0x62')][_0xd615('0x84')],'ListId':_0x2c92b8[_0xd615('0x95')]});_0x34c259[_0x289fce[_0xd615('0x62')][_0xd615('0x86')]]=_0x289fce['body']['from'];return db[_0xd615('0x7b')][_0xd615('0x61')](_0x34c259,{'fields':_0x10e5b5,'raw':!![]});}})['then'](handleEntityNotFound(_0x37fdd1,null))[_0xd615('0x23')](function(_0x4393e6){_0x6cfdb1[_0xd615('0x96')]=_0x4393e6;if(_0x4393e6){var _0xbedd44={'ContactId':_0x4393e6['id'],'OpenchannelAccountId':_0x289fce['params']['id'],'from':(_0x4393e6[_0xd615('0x97')]||'')+'\x20'+(_0x4393e6['lastName']||'')};var _0x65cfa1={'OpenchannelAccountId':_0x289fce[_0xd615('0x5d')]['id'],'closed':![]};if(_0x289fce[_0xd615('0x62')]['threadId']){_0x65cfa1[_0xd615('0x98')]=_0x289fce[_0xd615('0x62')][_0xd615('0x98')];return db[_0xd615('0x99')][_0xd615('0x6a')]({'where':_0x65cfa1})[_0xd615('0x23')](function(_0x11dcbd){if(_0x11dcbd){return[_0x11dcbd,![]];}_0xbedd44[_0xd615('0x98')]=_0x289fce[_0xd615('0x62')][_0xd615('0x98')];_0xbedd44[_0xd615('0x9a')]=_0x289fce['body'][_0xd615('0x9a')];return db[_0xd615('0x99')][_0xd615('0x61')](_0xbedd44)['then'](function(_0x4c30bf){return[_0x4c30bf,!![]];});});}else{_0x65cfa1[_0xd615('0x98')]=null;}_0x65cfa1[_0xd615('0x9b')]=_0x4393e6['id'];return db[_0xd615('0x99')][_0xd615('0x6a')]({'where':_0x65cfa1})[_0xd615('0x23')](function(_0x44ddcd){if(_0x44ddcd){return[_0x44ddcd,![]];}return db[_0xd615('0x99')][_0xd615('0x61')](_0xbedd44)[_0xd615('0x23')](function(_0x5d0e5f){return[_0x5d0e5f,!![]];});});}})[_0xd615('0x9c')](function(_0x411b7d,_0x1e33a9){if(_0x411b7d){_0x4b99c0=_0x1e33a9;if(!_0x1e33a9){var _0x359af0={'from':(_0x6cfdb1[_0xd615('0x96')]['firstName']||'')+'\x20'+(_0x6cfdb1[_0xd615('0x96')][_0xd615('0x9d')]||'')};if(_0x289fce[_0xd615('0x62')][_0xd615('0x98')]&&_0x289fce[_0xd615('0x62')]['messageId']&&_0x289fce[_0xd615('0x62')]['threadId']!=_0x289fce[_0xd615('0x62')][_0xd615('0x9e')]){_0x359af0['threadId']=_0x289fce[_0xd615('0x62')][_0xd615('0x9e')];}return _0x411b7d[_0xd615('0x3b')](_0x359af0);}else{return _0x411b7d;}}})[_0xd615('0x23')](function(_0x2bbc61){_0x6cfdb1[_0xd615('0x9f')]=_0x2bbc61[_0xd615('0x3d')]({'plain':!![]});_0x6cfdb1['interaction'][_0xd615('0xa0')]=_0x4b99c0;if(_0x6cfdb1[_0xd615('0x9f')][_0xd615('0xa0')]){if(_0x6cfdb1[_0xd615('0x8f')]['autoclose']){_0x6cfdb1[_0xd615('0x92')][_0xd615('0xa1')]({'id':0x0,'priority':_0x6cfdb1['applications'][_0xd615('0x50')]+0x1,'app':_0xd615('0xa2'),'appdata':_0xd615('0xa3'),'interval':_0xd615('0xa4')});}}return db[_0xd615('0xa5')][_0xd615('0x61')]({'body':_0x289fce['body'][_0xd615('0x62')],'OpenchannelAccountId':_0x289fce[_0xd615('0x5d')]['id'],'OpenchannelInteractionId':_0x2bbc61['id'],'direction':'in','ContactId':_0x6cfdb1[_0xd615('0x96')]['id'],'AttachmentId':_0x289fce['body'][_0xd615('0xa6')]});})['then'](function(_0x56c404){_0x6cfdb1['message']=_0x56c404;if(_0x6cfdb1[_0xd615('0x9f')][_0xd615('0xa7')]){return db['User'][_0xd615('0x6a')]({'attributes':['id',_0xd615('0x40')],'where':{'id':_0x6cfdb1['interaction'][_0xd615('0xa7')]}})[_0xd615('0x23')](function(_0x16804c){if(_0x16804c){_0x6cfdb1[_0xd615('0x92')][_0xd615('0xa8')]({'id':0x0,'priority':0x0,'app':_0xd615('0xa9'),'appdata':_0x16804c[_0xd615('0x40')]+','+(_0x6cfdb1[_0xd615('0x8f')][_0xd615('0xaa')]||0xa),'interval':_0xd615('0xa4')});_0x6cfdb1[_0xd615('0xab')]=![];}return respondWithRpcPromise(_0xd615('0xac'),_0xd615('0xad'),_0x6cfdb1);});}return respondWithRpcPromise(_0xd615('0xac'),_0xd615('0xad'),_0x6cfdb1);})[_0xd615('0x23')](function(_0xcb0842){respondWithRpcPromise(_0xd615('0xae'),_0xd615('0xae'),{'event':'notify','message':_0xcb0842},client9002);return _0xcb0842;})[_0xd615('0x23')](respondWithResult(_0x37fdd1,null))[_0xd615('0x2d')](handleError(_0x37fdd1,null));};exports[_0xd615('0xaf')]=function(_0x515b14,_0x56dc8c){var _0x14b64e=_0x515b14[_0xd615('0x5d')]['id'];var _0x412e7d=_0x515b14[_0xd615('0x62')];var _0x38ccaf=0xc8;var _0x125759=null;return db[_0xd615('0xb0')][_0xd615('0xb1')]({'isolationLevel':db['sequelize'][_0xd615('0xb2')][_0xd615('0xb3')][_0xd615('0xb4')]},function(_0x1d8913){return db['OpenchannelAccount'][_0xd615('0x70')]({'where':{'id':_0x14b64e},'transaction':_0x1d8913})[_0xd615('0x23')](function(_0x1cb655){if(_0x1cb655){return db[_0xd615('0x8d')][_0xd615('0x3c')]({'where':{'OpenchannelAccountId':_0x14b64e},'transaction':_0x1d8913})[_0xd615('0x23')](function(){var _0x1d255c=_[_0xd615('0x44')](_0x412e7d,function(_0x1555e8){_0x1555e8['OpenchannelAccountId']=_0x14b64e;return _0x1555e8;});return db[_0xd615('0x8d')]['bulkCreate'](_0x1d255c,{'transaction':_0x1d8913});});}else{_0x38ccaf=0x194;_0x125759=[];}});})[_0xd615('0x23')](function(){if(_0x38ccaf!==0x194){return db[_0xd615('0x8d')][_0xd615('0xb5')]({'where':{'OpenchannelAccountId':_0x14b64e},'order':'priority'})['then'](function(_0x5a97a1){_0x125759=_0x5a97a1;});}})[_0xd615('0x2d')](function(_0x2fc727){_0x38ccaf=0x1f4;logger['error'](_0x2fc727[_0xd615('0x3f')]);if(_0x2fc727['name']){delete _0x2fc727[_0xd615('0x40')];}_0x125759=_0x2fc727;})[_0xd615('0xb6')](function(){if(_0x125759===null){_0x56dc8c['sendStatus'](_0x38ccaf);}else{if(_0x38ccaf===0x1f4){_0x56dc8c['status'](_0x38ccaf)['send'](_0x125759);}else{_0x56dc8c[_0xd615('0x2f')](_0x38ccaf)['json'](_0x125759);}}});};exports[_0xd615('0xb7')]=function(_0x555c26,_0x35705d,_0x219857){var _0x4b4f04={};var _0x4c3f7e={};var _0xc50fe;var _0x227504;return db[_0xd615('0x45')]['findOne']({'where':{'id':_0x555c26[_0xd615('0x5d')]['id']}})['then'](handleEntityNotFound(_0x35705d,null))['then'](function(_0x578c69){if(_0x578c69){_0xc50fe=_0x578c69;_0x4c3f7e[_0xd615('0x49')]=_[_0xd615('0x4b')](db['OpenchannelApplication']['rawAttributes']);_0x4c3f7e[_0xd615('0x4a')]=_['keys'](_0x555c26[_0xd615('0x4a')]);_0x4c3f7e[_0xd615('0x4c')]=_['intersection'](_0x4c3f7e[_0xd615('0x49')],_0x4c3f7e['query']);_0x4b4f04[_0xd615('0x4d')]=_[_0xd615('0x4e')](_0x4c3f7e[_0xd615('0x49')],qs[_0xd615('0x4f')](_0x555c26['query'][_0xd615('0x4f')]));_0x4b4f04['attributes']=_0x4b4f04[_0xd615('0x4d')]['length']?_0x4b4f04['attributes']:_0x4c3f7e[_0xd615('0x49')];_0x4b4f04['order']=qs[_0xd615('0x71')](_0x555c26[_0xd615('0x4a')][_0xd615('0x71')]);_0x4b4f04[_0xd615('0x54')]=qs[_0xd615('0x4c')](_[_0xd615('0x55')](_0x555c26['query'],_0x4c3f7e[_0xd615('0x4c')]));if(_0x555c26[_0xd615('0x4a')][_0xd615('0x57')]){_0x4b4f04[_0xd615('0x54')]=_['merge'](_0x4b4f04['where'],{'$or':_['map'](_0x4b4f04[_0xd615('0x4d')],function(_0x4d7bff){var _0x21d99d={};_0x21d99d[_0x4d7bff]={'$like':'%'+_0x555c26[_0xd615('0x4a')]['filter']+'%'};return _0x21d99d;})});}_0x4b4f04=_['merge']({},_0x4b4f04,_0x555c26[_0xd615('0x59')]);return _0xc50fe[_0xd615('0xb7')](_0x4b4f04);}})[_0xd615('0x23')](function(_0x48d14f){if(_0x48d14f){_0x227504=_0x48d14f[_0xd615('0x50')];if(!_0x555c26['query'][_0xd615('0x51')]('nolimit')){_0x4b4f04[_0xd615('0x34')]=qs['limit'](_0x555c26[_0xd615('0x4a')][_0xd615('0x34')]);_0x4b4f04['offset']=qs[_0xd615('0x32')](_0x555c26[_0xd615('0x4a')]['offset']);}return _0xc50fe[_0xd615('0xb7')](_0x4b4f04);}})['then'](function(_0x37bd71){if(_0x37bd71){return _0x37bd71?{'count':_0x227504,'rows':_0x37bd71}:null;}})[_0xd615('0x23')](respondWithResult(_0x35705d,null))[_0xd615('0x2d')](handleError(_0x35705d,null));};exports['getInteractions']=function(_0x494cec,_0x5179dd,_0xe64dfe){var _0xfeaab4={'raw':![],'where':{}};var _0x53749c={};var _0x179df9={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xd615('0x70')]({'where':{'id':_0x494cec['params']['id']}})[_0xd615('0x23')](handleEntityNotFound(_0x5179dd,null))['then'](function(_0x410073){if(_0x410073){_0x53749c[_0xd615('0x49')]=_[_0xd615('0x4b')](db['OpenchannelInteraction'][_0xd615('0x5f')]);_0x53749c[_0xd615('0x4a')]=_['keys'](_0x494cec[_0xd615('0x4a')]);_0x53749c['filters']=_['intersection'](_0x53749c[_0xd615('0x49')],_0x53749c['query']);_0xfeaab4[_0xd615('0x4d')]=_[_0xd615('0x4e')](_0x53749c[_0xd615('0x49')],qs[_0xd615('0x4f')](_0x494cec[_0xd615('0x4a')][_0xd615('0x4f')]));_0xfeaab4[_0xd615('0x4d')]=_0xfeaab4[_0xd615('0x4d')][_0xd615('0x50')]?_0xfeaab4[_0xd615('0x4d')]:_0x53749c[_0xd615('0x49')];if(!_0x494cec['query'][_0xd615('0x51')](_0xd615('0x52'))){_0xfeaab4[_0xd615('0x34')]=qs[_0xd615('0x34')](_0x494cec[_0xd615('0x4a')][_0xd615('0x34')]);_0xfeaab4[_0xd615('0x32')]=qs[_0xd615('0x32')](_0x494cec[_0xd615('0x4a')][_0xd615('0x32')]);}_0xfeaab4[_0xd615('0x53')]=qs[_0xd615('0x71')](_0x494cec['query'][_0xd615('0x71')]);_0xfeaab4['where']=qs[_0xd615('0x4c')](_[_0xd615('0x55')](_0x494cec['query'],_0x53749c[_0xd615('0x4c')]));_0xfeaab4[_0xd615('0x54')][_0xd615('0x6d')]=_0x410073['id'];if(_0x494cec[_0xd615('0x4a')][_0xd615('0x57')]){_0xfeaab4[_0xd615('0x54')]=_['merge'](_0xfeaab4[_0xd615('0x54')],{'$or':_[_0xd615('0x44')](_0xfeaab4[_0xd615('0x4d')],function(_0x30af61){var _0x2dc3b7={};_0x2dc3b7[_0x30af61]={'$like':'%'+_0x494cec[_0xd615('0x4a')][_0xd615('0x57')]+'%'};return _0x2dc3b7;})});}_0xfeaab4=_['merge']({},_0xfeaab4,_0x494cec[_0xd615('0x59')]);return db[_0xd615('0x99')]['count']({'where':_0xfeaab4[_0xd615('0x54')]})[_0xd615('0x23')](function(_0x129fdb){_0x179df9[_0xd615('0x35')]=_0x129fdb;if(_0x494cec[_0xd615('0x4a')][_0xd615('0x5a')]){_0xfeaab4[_0xd615('0x60')]=[{'model':db[_0xd615('0x7b')],'as':'Contact','required':![]},{'model':db[_0xd615('0xb8')],'as':'Owner','attributes':[_0xd615('0x40'),_0xd615('0xb9'),'internal'],'required':![]},{'model':db[_0xd615('0xba')],'as':_0xd615('0xbb'),'attributes':['id',_0xd615('0x40'),'color'],'where':_0x494cec[_0xd615('0x4a')][_0xd615('0xbc')]?{'id':_0x494cec[_0xd615('0x4a')][_0xd615('0xbc')]}:undefined,'required':_0x494cec[_0xd615('0x4a')][_0xd615('0xbc')]?!![]:![]}];}return db[_0xd615('0x99')][_0xd615('0x72')](_0xfeaab4);})['then'](function(_0x59a86f){_0x179df9[_0xd615('0x5b')]=_0x59a86f;return _0x179df9;});}})[_0xd615('0x23')](respondWithFilteredResult(_0x5179dd,_0xfeaab4))[_0xd615('0x2d')](handleError(_0x5179dd,null));};exports[_0xd615('0xbd')]=function(_0x17189f,_0x462de2,_0x5ec2af){return db['OpenchannelAccount']['find']({'where':{'id':_0x17189f['params']['id']}})[_0xd615('0x23')](handleEntityNotFound(_0x462de2,null))[_0xd615('0x23')](function(_0x167ccf){if(_0x167ccf){return _0x167ccf[_0xd615('0xbd')](_0x17189f[_0xd615('0x62')][_0xd615('0x74')],_[_0xd615('0xbe')](_0x17189f['body'],[_0xd615('0x74'),'id'])||{})[_0xd615('0x9c')](function(_0x12bc34){for(var _0x43372f=0x0;_0x43372f<_0x17189f[_0xd615('0x62')][_0xd615('0x74')][_0xd615('0x50')];_0x43372f+=0x1){socket[_0xd615('0xbf')]('userOpenchannelAccount:save',{'UserId':Number(_0x17189f[_0xd615('0x62')][_0xd615('0x74')][_0x43372f]),'OpenchannelAccountId':Number(_0x17189f[_0xd615('0x5d')]['id'])});}return _0x12bc34;});}})[_0xd615('0x23')](respondWithResult(_0x462de2,null))[_0xd615('0x2d')](handleError(_0x462de2,null));};exports[_0xd615('0xc0')]=function(_0x3f0168,_0x5e9767,_0x2d0b83){return db[_0xd615('0x45')][_0xd615('0x6a')]({'where':{'id':_0x3f0168['params']['id']}})[_0xd615('0x23')](handleEntityNotFound(_0x5e9767,null))[_0xd615('0x23')](function(_0x4728dc){if(_0x4728dc){return _0x4728dc[_0xd615('0xc0')](_0x3f0168['query'][_0xd615('0x74')])[_0xd615('0x23')](function(){if(_['isArray'](_0x3f0168[_0xd615('0x4a')][_0xd615('0x74')])){for(var _0x597151=0x0;_0x597151<_0x3f0168[_0xd615('0x4a')][_0xd615('0x74')][_0xd615('0x50')];_0x597151+=0x1){socket[_0xd615('0xbf')](_0xd615('0xc1'),{'UserId':Number(_0x3f0168[_0xd615('0x4a')]['ids'][_0x597151]),'OpenchannelAccountId':Number(_0x3f0168[_0xd615('0x5d')]['id'])});}}else{socket['emit'](_0xd615('0xc1'),{'UserId':Number(_0x3f0168['query'][_0xd615('0x74')]),'OpenchannelAccountId':Number(_0x3f0168[_0xd615('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x5e9767,null))['catch'](handleError(_0x5e9767,null));};exports['getAgents']=function(_0x16506f,_0x2499ef,_0x4f50d3){var _0x22385f={};var _0x425385={};var _0x4eabc9;var _0xaaca2d;return db[_0xd615('0x45')][_0xd615('0x70')]({'where':{'id':_0x16506f[_0xd615('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2499ef,null))[_0xd615('0x23')](function(_0x5e5f96){if(_0x5e5f96){_0x4eabc9=_0x5e5f96;_0x425385['model']=_['keys'](db[_0xd615('0xb8')]['rawAttributes']);_0x425385[_0xd615('0x4a')]=_[_0xd615('0x4b')](_0x16506f[_0xd615('0x4a')]);_0x425385[_0xd615('0x4c')]=_['intersection'](_0x425385[_0xd615('0x49')],_0x425385[_0xd615('0x4a')]);_0x22385f[_0xd615('0x4d')]=_['intersection'](_0x425385[_0xd615('0x49')],qs[_0xd615('0x4f')](_0x16506f[_0xd615('0x4a')]['fields']));_0x22385f['attributes']=_0x22385f[_0xd615('0x4d')][_0xd615('0x50')]?_0x22385f[_0xd615('0x4d')]:_0x425385[_0xd615('0x49')];_0x22385f[_0xd615('0x53')]=qs[_0xd615('0x71')](_0x16506f[_0xd615('0x4a')][_0xd615('0x71')]);_0x22385f[_0xd615('0x54')]=qs[_0xd615('0x4c')](_[_0xd615('0x55')](_0x16506f[_0xd615('0x4a')],_0x425385[_0xd615('0x4c')]));if(_0x16506f[_0xd615('0x4a')][_0xd615('0x57')]){_0x22385f[_0xd615('0x54')]=_['merge'](_0x22385f[_0xd615('0x54')],{'$or':_[_0xd615('0x44')](_0x22385f[_0xd615('0x4d')],function(_0x328f03){var _0x536a1f={};_0x536a1f[_0x328f03]={'$like':'%'+_0x16506f[_0xd615('0x4a')][_0xd615('0x57')]+'%'};return _0x536a1f;})});}_0x22385f=_[_0xd615('0x58')]({},_0x22385f,_0x16506f[_0xd615('0x59')]);return _0x4eabc9[_0xd615('0xc2')](_0x22385f);}})[_0xd615('0x23')](function(_0x4a38ce){if(_0x4a38ce){_0xaaca2d=_0x4a38ce[_0xd615('0x50')];if(!_0x16506f[_0xd615('0x4a')][_0xd615('0x51')]('nolimit')){_0x22385f['limit']=qs[_0xd615('0x34')](_0x16506f[_0xd615('0x4a')]['limit']);_0x22385f['offset']=qs[_0xd615('0x32')](_0x16506f[_0xd615('0x4a')]['offset']);}return _0x4eabc9[_0xd615('0xc2')](_0x22385f);}})['then'](function(_0x5545c0){if(_0x5545c0){return _0x5545c0?{'count':_0xaaca2d,'rows':_0x5545c0}:null;}})[_0xd615('0x23')](respondWithResult(_0x2499ef,null))[_0xd615('0x2d')](handleError(_0x2499ef,null));};exports[_0xd615('0x41')]=function(_0x246d0c,_0x3ed12c,_0x40ba02){var _0x18003b,_0x20d979,_0xe246d5;if(_[_0xd615('0x83')](_0x246d0c['body']['body'])||_0x246d0c[_0xd615('0x62')][_0xd615('0x62')]===''){throw new db['Sequelize']['ValidationError'](_0xd615('0x85'));}if(_[_0xd615('0x83')](_0x246d0c[_0xd615('0x62')]['to'])){}_0x18003b=_0x246d0c[_0xd615('0x62')]['to'];return db[_0xd615('0x45')][_0xd615('0x70')]({'where':{'id':_0x246d0c[_0xd615('0x5d')]['id']}})[_0xd615('0x23')](handleEntityNotFound(_0x3ed12c,null))[_0xd615('0x23')](function(_0x1e5c6b){if(_0x1e5c6b){return db[_0xd615('0x45')]['find']({'where':{'id':_0x1e5c6b['id']},'include':[{'model':db[_0xd615('0x89')],'as':_0xd615('0x8a'),'include':[{'model':db[_0xd615('0x7b')],'as':_0xd615('0x8b'),'where':{[_0x1e5c6b['mapKey']]:_0x18003b},'limit':0x1,'order':[[_0xd615('0x80'),_0xd615('0x8c')]]}]}]})[_0xd615('0x23')](handleEntityNotFound(_0x3ed12c,null))['then'](function(_0x2f5a6d){if(_0x2f5a6d&&_0x2f5a6d[_0xd615('0x8a')]){_0x20d979=_0x2f5a6d['get']({'plain':!![]});if(_0x20d979[_0xd615('0x8a')]&&_0x20d979[_0xd615('0x8a')][_0xd615('0x8b')]['length']){return _0x20d979[_0xd615('0x8a')][_0xd615('0x8b')][0x0];}return db[_0xd615('0x7b')]['create'](_[_0xd615('0x19')](_0x246d0c[_0xd615('0x62')],{'firstName':_0x18003b,[_0x2f5a6d['mapKey']]:_0x18003b,'phone':_0x18003b,'ListId':_0x20d979[_0xd615('0x95')]}));}})[_0xd615('0x23')](handleEntityNotFound(_0x3ed12c,null))[_0xd615('0x23')](function(_0x178e96){if(_0x178e96){_0xe246d5=_0x178e96;return db[_0xd615('0x99')][_0xd615('0x6a')]({'where':{'ContactId':_0xe246d5['id'],'closed':![],'OpenchannelAccountId':_0x20d979['id']}})[_0xd615('0x23')](function(_0xaeecfa){if(_0xaeecfa){return[_0xaeecfa,![]];}return db[_0xd615('0x99')][_0xd615('0x61')]({'UserId':_0x246d0c['user']['id'],'ContactId':_0xe246d5['id'],'OpenchannelAccountId':_0x20d979['id'],'lastMsgDirection':_0xd615('0xc3'),'firstMsgDirection':_0xd615('0xc3'),'Messages':[_['merge'](_0x246d0c['body'],{'read':![],'body':_0x246d0c[_0xd615('0x62')][_0xd615('0x62')],'OpenchannelAccountId':_0x20d979['id'],'UserId':_0x246d0c[_0xd615('0x65')]['id'],'ContactId':_0xe246d5['id']})]},{'include':[{'model':db[_0xd615('0xa5')],'as':_0xd615('0xc4')}]})['then'](function(_0x4c5f8b){return[_0x4c5f8b,!![]];});});}})['spread'](function(_0x16db6d,_0x31d184){if(_0x31d184){return _0x16db6d;}return db['OpenchannelMessage']['create'](_[_0xd615('0x58')](_0x246d0c[_0xd615('0x62')],{'read':![],'body':_0x246d0c[_0xd615('0x62')]['body'],'OpenchannelAccountId':_0x20d979['id'],'OpenchannelInteractionId':_0x16db6d['id'],'UserId':_0x246d0c[_0xd615('0x65')]['id'],'ContactId':_0xe246d5['id']}))[_0xd615('0x23')](function(_0x456027){_0x16db6d[_0xd615('0xc5')][_0xd615('0xc4')]=[];_0x16db6d['dataValues']['Messages'][_0xd615('0xa1')](_0x456027['dataValues']);return _0x16db6d;});});}})[_0xd615('0x23')](respondWithResult(_0x3ed12c,null))[_0xd615('0x2d')](handleError(_0x3ed12c,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index fd74860..6402d74 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 _0xf4eb=['hook','events','update','emit','hasOwnProperty'];(function(_0x3672fd,_0x85be06){var _0x3394b5=function(_0x2f2e4f){while(--_0x2f2e4f){_0x3672fd['push'](_0x3672fd['shift']());}};_0x3394b5(++_0x85be06);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2981e2,_0x54fbda){_0x2981e2=_0x2981e2-0x0;var _0x45dc89=_0xf4eb[_0x2981e2];return _0x45dc89;};'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 +var _0xd8b0=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3d8105,_0x2a8efd){var _0x20e908=function(_0x344ddf){while(--_0x344ddf){_0x3d8105['push'](_0x3d8105['shift']());}};_0x20e908(++_0x2a8efd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x0d8b('0x0'));var OpenchannelAccount=require(_0x0d8b('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0d8b('0x2'),'afterDestroy':_0x0d8b('0x3')};function emitEvent(_0x43bca1){return function(_0x364286,_0x8196ed,_0x577834){OpenchannelAccountEvents['emit'](_0x43bca1+':'+_0x364286['id'],_0x364286);OpenchannelAccountEvents[_0x0d8b('0x4')](_0x43bca1,_0x364286);_0x577834(null);};}for(var e in events){if(events[_0x0d8b('0x5')](e)){var event=events[e];OpenchannelAccount[_0x0d8b('0x6')](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 c3a1bf7..a9364cd 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(_0x3cf013,_0x5ee1ef){var _0x54c490=function(_0x44e3b0){while(--_0x44e3b0){_0x3cf013['push'](_0x3cf013['shift']());}};_0x54c490(++_0x5ee1ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x2d8c52,_0x12d8eb){var _0x22c42c=function(_0xcb7509){while(--_0xcb7509){_0x2d8c52['push'](_0x2d8c52['shift']());}};_0x22c42c(++_0x12d8eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 61f8e77..c53e47a 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 _0xae60=['client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x3f07f9,_0xf9863c){var _0x45475f=function(_0x2ab10f){while(--_0x2ab10f){_0x3f07f9['push'](_0x3f07f9['shift']());}};_0x45475f(++_0xf9863c);}(_0xae60,0x1c7));var _0x0ae6=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xae60[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var moment=require(_0x0ae6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae6('0x3'));var fs=require('fs');var Redis=require(_0x0ae6('0x4'));var db=require(_0x0ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ae6('0x8'));var client=jayson[_0x0ae6('0x9')][_0x0ae6('0xa')]({'port':0x232a});config[_0x0ae6('0xb')]=_[_0x0ae6('0xc')](config[_0x0ae6('0xb')],{'host':_0x0ae6('0xd'),'port':0x18eb});var socket=require(_0x0ae6('0xe'))(new Redis(config['redis']));require(_0x0ae6('0xf'))[_0x0ae6('0x10')](socket);function respondWithRpcPromise(_0x3a8b0e,_0x39787a,_0x4c2698){return new BPromise(function(_0x24e211,_0x1def8c){return client[_0x0ae6('0x11')](_0x3a8b0e,_0x4c2698)[_0x0ae6('0x12')](function(_0x3ae7fa){logger[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x39787a,_0x0ae6('0x15'));logger[_0x0ae6('0x16')](_0x0ae6('0x17'),_0x39787a,_0x0ae6('0x15'),JSON[_0x0ae6('0x18')](_0x3ae7fa));if(_0x3ae7fa[_0x0ae6('0x19')]){if(_0x3ae7fa[_0x0ae6('0x19')]['code']===0x1f4){logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);return _0x1def8c(_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);}logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);return _0x24e211(_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);}else{logger[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x39787a,_0x0ae6('0x15'));_0x24e211(_0x3ae7fa[_0x0ae6('0x1b')][_0x0ae6('0x1a')]);}})[_0x0ae6('0x1c')](function(_0x2ca2a3){logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x2ca2a3);_0x1def8c(_0x2ca2a3);});});} \ No newline at end of file +var _0x7794=['localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','http','redis'];(function(_0xdb96e0,_0x456fe0){var _0x29aa51=function(_0x2a02d3){while(--_0x2a02d3){_0xdb96e0['push'](_0xdb96e0['shift']());}};_0x29aa51(++_0x456fe0);}(_0x7794,0x7b));var _0x4779=function(_0x10e31a,_0x6a302d){_0x10e31a=_0x10e31a-0x0;var _0xa3e8a0=_0x7794[_0x10e31a];return _0xa3e8a0;};'use strict';var _=require('lodash');var util=require(_0x4779('0x0'));var moment=require(_0x4779('0x1'));var BPromise=require(_0x4779('0x2'));var rs=require(_0x4779('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4779('0x4'))['db'];var utils=require(_0x4779('0x5'));var logger=require('../../config/logger')(_0x4779('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4779('0x7')]({'port':0x232a});config[_0x4779('0x8')]=_['defaults'](config[_0x4779('0x8')],{'host':_0x4779('0x9'),'port':0x18eb});var socket=require(_0x4779('0xa'))(new Redis(config[_0x4779('0x8')]));require(_0x4779('0xb'))[_0x4779('0xc')](socket);function respondWithRpcPromise(_0x42e4c0,_0x5e4992,_0x42883e){return new BPromise(function(_0x33ebc7,_0x3a5f2d){return client[_0x4779('0xd')](_0x42e4c0,_0x42883e)[_0x4779('0xe')](function(_0x106081){logger[_0x4779('0xf')](_0x4779('0x10'),_0x5e4992,_0x4779('0x11'));logger[_0x4779('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5e4992,'request\x20sent',JSON['stringify'](_0x106081));if(_0x106081[_0x4779('0x13')]){if(_0x106081[_0x4779('0x13')][_0x4779('0x14')]===0x1f4){logger[_0x4779('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x5e4992,_0x106081[_0x4779('0x13')][_0x4779('0x15')]);return _0x3a5f2d(_0x106081['error']['message']);}logger[_0x4779('0x13')](_0x4779('0x10'),_0x5e4992,_0x106081[_0x4779('0x13')][_0x4779('0x15')]);return _0x33ebc7(_0x106081['error']['message']);}else{logger[_0x4779('0xf')](_0x4779('0x10'),_0x5e4992,_0x4779('0x11'));_0x33ebc7(_0x106081['result'][_0x4779('0x15')]);}})['catch'](function(_0x2b40f9){logger[_0x4779('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x5e4992,_0x2b40f9);_0x3a5f2d(_0x2b40f9);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 8772925..7670758 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 _0x544a=['./openchannelAccount.events','save','remove','emit','openchannelAccount:'];(function(_0x58127e,_0x36ec76){var _0x5611b4=function(_0x5daeda){while(--_0x5daeda){_0x58127e['push'](_0x58127e['shift']());}};_0x5611b4(++_0x36ec76);}(_0x544a,0x118));var _0xa544=function(_0x5ca55d,_0x419186){_0x5ca55d=_0x5ca55d-0x0;var _0x29ad4c=_0x544a[_0x5ca55d];return _0x29ad4c;};'use strict';var OpenchannelAccountEvents=require(_0xa544('0x0'));var events=[_0xa544('0x1'),_0xa544('0x2'),'update'];function createListener(_0x56dbc4,_0x32a74a){return function(_0x456f1){_0x32a74a[_0xa544('0x3')](_0x56dbc4,_0x456f1);};}function removeListener(_0xf2d6a0,_0x4b4677){return function(){OpenchannelAccountEvents['removeListener'](_0xf2d6a0,_0x4b4677);};}exports['register']=function(_0x2cb8c5){for(var _0x3690ce=0x0,_0x9609d4=events['length'];_0x3690ce<_0x9609d4;_0x3690ce++){var _0x196f1e=events[_0x3690ce];var _0x13ce7a=createListener(_0xa544('0x4')+_0x196f1e,_0x2cb8c5);OpenchannelAccountEvents['on'](_0x196f1e,_0x13ce7a);}}; \ No newline at end of file +var _0x79d8=['remove','update','removeListener','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x79d8,0x67));var _0x879d=function(_0x2893f8,_0x2a4043){_0x2893f8=_0x2893f8-0x0;var _0x554049=_0x79d8[_0x2893f8];return _0x554049;};'use strict';var OpenchannelAccountEvents=require(_0x879d('0x0'));var events=[_0x879d('0x1'),_0x879d('0x2'),_0x879d('0x3')];function createListener(_0x5d4308,_0x20dbdc){return function(_0x858c6){_0x20dbdc['emit'](_0x5d4308,_0x858c6);};}function removeListener(_0x2b38f9,_0x3d8c64){return function(){OpenchannelAccountEvents[_0x879d('0x4')](_0x2b38f9,_0x3d8c64);};}exports['register']=function(_0x2d578e){for(var _0x46ed21=0x0,_0x142181=events[_0x879d('0x5')];_0x46ed21<_0x142181;_0x46ed21++){var _0x49c05d=events[_0x46ed21];var _0x257050=createListener(_0x879d('0x6')+_0x49c05d,_0x2d578e);OpenchannelAccountEvents['on'](_0x49c05d,_0x257050);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 5c1bee1..51acf3f 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 _0x1448=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1448,0x1ca));var _0x8144=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1448[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x8144('0x0'));var util=require(_0x8144('0x1'));var path=require(_0x8144('0x2'));var timeout=require(_0x8144('0x3'));var express=require('express');var router=express[_0x8144('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8144('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8144('0x6'));var controller=require(_0x8144('0x7'));router[_0x8144('0x8')]('/',auth[_0x8144('0x9')](),controller[_0x8144('0xa')]);router[_0x8144('0x8')](_0x8144('0xb'),auth[_0x8144('0x9')](),controller[_0x8144('0xc')]);router[_0x8144('0xd')]('/',auth[_0x8144('0x9')](),controller[_0x8144('0xe')]);router[_0x8144('0xf')](_0x8144('0xb'),auth[_0x8144('0x9')](),controller[_0x8144('0x10')]);router[_0x8144('0x11')](_0x8144('0xb'),auth[_0x8144('0x9')](),controller[_0x8144('0x12')]);module[_0x8144('0x13')]=router; \ No newline at end of file +var _0xd5d4=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path'];(function(_0x11ef22,_0x4195e2){var _0x3ec9f6=function(_0x362b7){while(--_0x362b7){_0x11ef22['push'](_0x11ef22['shift']());}};_0x3ec9f6(++_0x4195e2);}(_0xd5d4,0x11e));var _0x4d5d=function(_0x2493a8,_0x5a240d){_0x2493a8=_0x2493a8-0x0;var _0x2b06c9=_0xd5d4[_0x2493a8];return _0x2b06c9;};'use strict';var multer=require(_0x4d5d('0x0'));var util=require(_0x4d5d('0x1'));var path=require(_0x4d5d('0x2'));var timeout=require(_0x4d5d('0x3'));var express=require('express');var router=express[_0x4d5d('0x4')]();var fs_extra=require(_0x4d5d('0x5'));var auth=require(_0x4d5d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4d5d('0x7'));var controller=require('./openchannelApplication.controller');router[_0x4d5d('0x8')]('/',auth[_0x4d5d('0x9')](),controller[_0x4d5d('0xa')]);router[_0x4d5d('0x8')](_0x4d5d('0xb'),auth[_0x4d5d('0x9')](),controller['show']);router[_0x4d5d('0xc')]('/',auth[_0x4d5d('0x9')](),controller['create']);router[_0x4d5d('0xd')](_0x4d5d('0xb'),auth['isAuthenticated'](),controller[_0x4d5d('0xe')]);router[_0x4d5d('0xf')](_0x4d5d('0xb'),auth[_0x4d5d('0x9')](),controller['destroy']);module[_0x4d5d('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 3e12a4d..bdcd588 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 _0x6b96=['*,*,*,*','sequelize','INTEGER','noop','TEXT','STRING'];(function(_0xe5c5f7,_0x4d0b9d){var _0x57c7c5=function(_0x452e93){while(--_0x452e93){_0xe5c5f7['push'](_0xe5c5f7['shift']());}};_0x57c7c5(++_0x4d0b9d);}(_0x6b96,0x151));var _0x66b9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6b96[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x66b9('0x0'));module['exports']={'priority':{'type':Sequelize[_0x66b9('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x66b9('0x2')},'appdata':{'type':Sequelize[_0x66b9('0x3')]()},'description':{'type':Sequelize[_0x66b9('0x4')]},'interval':{'type':Sequelize[_0x66b9('0x4')],'defaultValue':_0x66b9('0x5')}}; \ No newline at end of file +var _0xab2d=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x2efec9,_0x37fb84){var _0x294858=function(_0x4b60ac){while(--_0x4b60ac){_0x2efec9['push'](_0x2efec9['shift']());}};_0x294858(++_0x37fb84);}(_0xab2d,0x92));var _0xdab2=function(_0x3c6da3,_0x1bb960){_0x3c6da3=_0x3c6da3-0x0;var _0x19581e=_0xab2d[_0x3c6da3];return _0x19581e;};'use strict';var Sequelize=require(_0xdab2('0x0'));module[_0xdab2('0x1')]={'priority':{'type':Sequelize[_0xdab2('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdab2('0x3')},'appdata':{'type':Sequelize[_0xdab2('0x4')]()},'description':{'type':Sequelize[_0xdab2('0x5')]},'interval':{'type':Sequelize[_0xdab2('0x5')],'defaultValue':_0xdab2('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index d57872c..8ca2f41 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 _0x4c22=['destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','find','body','params'];(function(_0x3735a7,_0xeac4c2){var _0x24c0d6=function(_0x47cc5b){while(--_0x47cc5b){_0x3735a7['push'](_0x3735a7['shift']());}};_0x24c0d6(++_0xeac4c2);}(_0x4c22,0x121));var _0x24c2=function(_0x4f71ad,_0x2e8767){_0x4f71ad=_0x4f71ad-0x0;var _0xb99d8d=_0x4c22[_0x4f71ad];return _0xb99d8d;};'use strict';var emlformat=require(_0x24c2('0x0'));var rimraf=require(_0x24c2('0x1'));var zipdir=require(_0x24c2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24c2('0x3'));var moment=require(_0x24c2('0x4'));var BPromise=require(_0x24c2('0x5'));var Mustache=require(_0x24c2('0x6'));var util=require(_0x24c2('0x7'));var path=require(_0x24c2('0x8'));var sox=require('sox');var csv=require(_0x24c2('0x9'));var ejs=require(_0x24c2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x24c2('0xb'));var crypto=require(_0x24c2('0xc'));var jsforce=require(_0x24c2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x24c2('0x9'));var querystring=require('querystring');var Papa=require(_0x24c2('0xe'));var Redis=require('ioredis');var authService=require(_0x24c2('0xf'));var qs=require(_0x24c2('0x10'));var as=require(_0x24c2('0x11'));var hardwareService=require(_0x24c2('0x12'));var logger=require(_0x24c2('0x13'))(_0x24c2('0x14'));var utils=require(_0x24c2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x24c2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2afb7f,_0x222e83){_0x222e83=_0x222e83||0xcc;return function(_0xa12542){if(_0xa12542){return _0x2afb7f[_0x24c2('0x17')](_0x222e83);}return _0x2afb7f[_0x24c2('0x18')](_0x222e83)['end']();};}function respondWithResult(_0x34d76d,_0xf10112){_0xf10112=_0xf10112||0xc8;return function(_0x303fd){if(_0x303fd){return _0x34d76d['status'](_0xf10112)[_0x24c2('0x19')](_0x303fd);}};}function respondWithFilteredResult(_0xd3b177,_0x3fee1e){return function(_0x5354c1){if(_0x5354c1){var _0xeacc07=typeof _0x3fee1e[_0x24c2('0x1a')]==='undefined'&&typeof _0x3fee1e[_0x24c2('0x1b')]===_0x24c2('0x1c');var _0x558f5a=_0x5354c1[_0x24c2('0x1d')];var _0x39a147=_0xeacc07?0x0:_0x3fee1e[_0x24c2('0x1a')];var _0x3f06b7=_0xeacc07?_0x5354c1['count']:_0x3fee1e[_0x24c2('0x1a')]+_0x3fee1e['limit'];var _0x3d6ade;if(_0x3f06b7>=_0x558f5a){_0x3f06b7=_0x558f5a;_0x3d6ade=0xc8;}else{_0x3d6ade=0xce;}_0xd3b177[_0x24c2('0x18')](_0x3d6ade);return _0xd3b177[_0x24c2('0x1e')](_0x24c2('0x1f'),_0x39a147+'-'+_0x3f06b7+'/'+_0x558f5a)[_0x24c2('0x19')](_0x5354c1);}return null;};}function patchUpdates(_0x5d4995){return function(_0x778f0e){try{jsonpatch[_0x24c2('0x20')](_0x778f0e,_0x5d4995,!![]);}catch(_0x29e850){return BPromise[_0x24c2('0x21')](_0x29e850);}return _0x778f0e['save']();};}function saveUpdates(_0x144fbd,_0x5f269a){return function(_0x33c04d){if(_0x33c04d){return _0x33c04d[_0x24c2('0x22')](_0x144fbd)[_0x24c2('0x23')](function(_0x3f39ad){return _0x3f39ad;});}return null;};}function removeEntity(_0x1c9f78,_0x8dba07){return function(_0xf1c123){if(_0xf1c123){return _0xf1c123['destroy']()[_0x24c2('0x23')](function(){_0x1c9f78[_0x24c2('0x18')](0xcc)[_0x24c2('0x24')]();});}};}function handleEntityNotFound(_0x2ef6d8,_0x4a258c){return function(_0x45512c){if(!_0x45512c){_0x2ef6d8[_0x24c2('0x17')](0x194);}return _0x45512c;};}function handleError(_0x36213d,_0x52d03a){_0x52d03a=_0x52d03a||0x1f4;return function(_0x51fe0e){logger[_0x24c2('0x25')](_0x51fe0e[_0x24c2('0x26')]);if(_0x51fe0e[_0x24c2('0x27')]){delete _0x51fe0e[_0x24c2('0x27')];}_0x36213d['status'](_0x52d03a)['send'](_0x51fe0e);};}exports['index']=function(_0x4edb13,_0x53ab61){var _0x5bec1f={},_0x555cc4={},_0x47db41={'count':0x0,'rows':[]};var _0x15e8e0=_[_0x24c2('0x28')](db[_0x24c2('0x29')][_0x24c2('0x2a')],function(_0x3d6842){return{'name':_0x3d6842[_0x24c2('0x2b')],'type':_0x3d6842[_0x24c2('0x2c')][_0x24c2('0x2d')]};});_0x555cc4[_0x24c2('0x2e')]=_[_0x24c2('0x28')](_0x15e8e0,_0x24c2('0x27'));_0x555cc4['query']=_[_0x24c2('0x2f')](_0x4edb13[_0x24c2('0x30')]);_0x555cc4['filters']=_['intersection'](_0x555cc4[_0x24c2('0x2e')],_0x555cc4['query']);_0x5bec1f[_0x24c2('0x31')]=_[_0x24c2('0x32')](_0x555cc4[_0x24c2('0x2e')],qs[_0x24c2('0x33')](_0x4edb13[_0x24c2('0x30')][_0x24c2('0x33')]));_0x5bec1f[_0x24c2('0x31')]=_0x5bec1f[_0x24c2('0x31')][_0x24c2('0x34')]?_0x5bec1f['attributes']:_0x555cc4[_0x24c2('0x2e')];if(!_0x4edb13[_0x24c2('0x30')][_0x24c2('0x35')]('nolimit')){_0x5bec1f[_0x24c2('0x1b')]=qs[_0x24c2('0x1b')](_0x4edb13[_0x24c2('0x30')]['limit']);_0x5bec1f['offset']=qs[_0x24c2('0x1a')](_0x4edb13['query'][_0x24c2('0x1a')]);}_0x5bec1f[_0x24c2('0x36')]=qs[_0x24c2('0x37')](_0x4edb13[_0x24c2('0x30')][_0x24c2('0x37')]);_0x5bec1f['where']=qs[_0x24c2('0x38')](_[_0x24c2('0x39')](_0x4edb13[_0x24c2('0x30')],_0x555cc4[_0x24c2('0x38')]),_0x15e8e0);if(_0x4edb13[_0x24c2('0x30')][_0x24c2('0x3a')]){_0x5bec1f['where']=_[_0x24c2('0x3b')](_0x5bec1f[_0x24c2('0x3c')],{'$or':_[_0x24c2('0x28')](_0x15e8e0,function(_0xf825c0){if(_0xf825c0[_0x24c2('0x2c')]!==_0x24c2('0x3d')){var _0x2bf4a6={};_0x2bf4a6[_0xf825c0['name']]={'$like':'%'+_0x4edb13[_0x24c2('0x30')][_0x24c2('0x3a')]+'%'};return _0x2bf4a6;}})});}_0x5bec1f=_[_0x24c2('0x3b')]({},_0x5bec1f,_0x4edb13[_0x24c2('0x3e')]);var _0x27d4d2={'where':_0x5bec1f[_0x24c2('0x3c')]};return db[_0x24c2('0x29')][_0x24c2('0x1d')](_0x27d4d2)[_0x24c2('0x23')](function(_0x3e89e2){_0x47db41[_0x24c2('0x1d')]=_0x3e89e2;if(_0x4edb13[_0x24c2('0x30')][_0x24c2('0x3f')]){_0x5bec1f[_0x24c2('0x40')]=[{'all':!![]}];}return db[_0x24c2('0x29')]['findAll'](_0x5bec1f);})[_0x24c2('0x23')](function(_0xbf928a){_0x47db41[_0x24c2('0x41')]=_0xbf928a;return _0x47db41;})['then'](respondWithFilteredResult(_0x53ab61,_0x5bec1f))[_0x24c2('0x42')](handleError(_0x53ab61,null));};exports[_0x24c2('0x43')]=function(_0x14e393,_0x431b28){var _0x364dd5={'raw':!![],'where':{'id':_0x14e393['params']['id']}},_0x4bd315={};_0x4bd315[_0x24c2('0x2e')]=_[_0x24c2('0x2f')](db[_0x24c2('0x29')][_0x24c2('0x2a')]);_0x4bd315[_0x24c2('0x30')]=_['keys'](_0x14e393[_0x24c2('0x30')]);_0x4bd315[_0x24c2('0x38')]=_['intersection'](_0x4bd315[_0x24c2('0x2e')],_0x4bd315[_0x24c2('0x30')]);_0x364dd5[_0x24c2('0x31')]=_['intersection'](_0x4bd315['model'],qs[_0x24c2('0x33')](_0x14e393[_0x24c2('0x30')][_0x24c2('0x33')]));_0x364dd5[_0x24c2('0x31')]=_0x364dd5['attributes']['length']?_0x364dd5[_0x24c2('0x31')]:_0x4bd315['model'];if(_0x14e393[_0x24c2('0x30')][_0x24c2('0x3f')]){_0x364dd5[_0x24c2('0x40')]=[{'all':!![]}];}_0x364dd5=_['merge']({},_0x364dd5,_0x14e393[_0x24c2('0x3e')]);return db[_0x24c2('0x29')][_0x24c2('0x44')](_0x364dd5)[_0x24c2('0x23')](handleEntityNotFound(_0x431b28,null))['then'](respondWithResult(_0x431b28,null))[_0x24c2('0x42')](handleError(_0x431b28,null));};exports['create']=function(_0x403d20,_0x1788b9){return db[_0x24c2('0x29')]['create'](_0x403d20[_0x24c2('0x45')],{})['then'](respondWithResult(_0x1788b9,0xc9))[_0x24c2('0x42')](handleError(_0x1788b9,null));};exports[_0x24c2('0x22')]=function(_0x3f57a2,_0xbad8ef){if(_0x3f57a2[_0x24c2('0x45')]['id']){delete _0x3f57a2['body']['id'];}return db[_0x24c2('0x29')][_0x24c2('0x44')]({'where':{'id':_0x3f57a2[_0x24c2('0x46')]['id']}})[_0x24c2('0x23')](handleEntityNotFound(_0xbad8ef,null))[_0x24c2('0x23')](saveUpdates(_0x3f57a2[_0x24c2('0x45')],null))[_0x24c2('0x23')](respondWithResult(_0xbad8ef,null))[_0x24c2('0x42')](handleError(_0xbad8ef,null));};exports[_0x24c2('0x47')]=function(_0x58949e,_0x46e540){return db[_0x24c2('0x29')][_0x24c2('0x44')]({'where':{'id':_0x58949e[_0x24c2('0x46')]['id']}})[_0x24c2('0x23')](handleEntityNotFound(_0x46e540,null))[_0x24c2('0x23')](removeEntity(_0x46e540,null))['catch'](handleError(_0x46e540,null));}; \ No newline at end of file +var _0x138f=['length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','rimraf','bluebird','util','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x5dd6d8,_0xe461ae){var _0x271126=function(_0x1536f8){while(--_0x1536f8){_0x5dd6d8['push'](_0x5dd6d8['shift']());}};_0x271126(++_0xe461ae);}(_0x138f,0x159));var _0xf138=function(_0x1c79a7,_0x38220e){_0x1c79a7=_0x1c79a7-0x0;var _0x4de69f=_0x138f[_0x1c79a7];return _0x4de69f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf138('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf138('0x1'));var Mustache=require('mustache');var util=require(_0xf138('0x2'));var path=require('path');var sox=require(_0xf138('0x3'));var csv=require(_0xf138('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf138('0x5'));var _=require('lodash');var squel=require(_0xf138('0x6'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf138('0x7'));var toCsv=require(_0xf138('0x4'));var querystring=require(_0xf138('0x8'));var Papa=require(_0xf138('0x9'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf138('0xa'));var as=require(_0xf138('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf138('0xc'));var licenseUtil=require(_0xf138('0xd'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5649c8,_0x3864b6){_0x3864b6=_0x3864b6||0xcc;return function(_0x3755fb){if(_0x3755fb){return _0x5649c8[_0xf138('0xe')](_0x3864b6);}return _0x5649c8[_0xf138('0xf')](_0x3864b6)[_0xf138('0x10')]();};}function respondWithResult(_0x141bb5,_0x142bbc){_0x142bbc=_0x142bbc||0xc8;return function(_0x446861){if(_0x446861){return _0x141bb5[_0xf138('0xf')](_0x142bbc)[_0xf138('0x11')](_0x446861);}};}function respondWithFilteredResult(_0x3f34ac,_0x20a100){return function(_0x15d090){if(_0x15d090){var _0x4b5e71=typeof _0x20a100['offset']===_0xf138('0x12')&&typeof _0x20a100[_0xf138('0x13')]===_0xf138('0x12');var _0x1d7468=_0x15d090['count'];var _0x1f4974=_0x4b5e71?0x0:_0x20a100[_0xf138('0x14')];var _0x40ceb9=_0x4b5e71?_0x15d090[_0xf138('0x15')]:_0x20a100[_0xf138('0x14')]+_0x20a100[_0xf138('0x13')];var _0x171889;if(_0x40ceb9>=_0x1d7468){_0x40ceb9=_0x1d7468;_0x171889=0xc8;}else{_0x171889=0xce;}_0x3f34ac[_0xf138('0xf')](_0x171889);return _0x3f34ac[_0xf138('0x16')](_0xf138('0x17'),_0x1f4974+'-'+_0x40ceb9+'/'+_0x1d7468)[_0xf138('0x11')](_0x15d090);}return null;};}function patchUpdates(_0xbd7cee){return function(_0x521d95){try{jsonpatch[_0xf138('0x18')](_0x521d95,_0xbd7cee,!![]);}catch(_0x571f02){return BPromise['reject'](_0x571f02);}return _0x521d95['save']();};}function saveUpdates(_0x465ff2,_0x57b749){return function(_0x186d4d){if(_0x186d4d){return _0x186d4d[_0xf138('0x19')](_0x465ff2)[_0xf138('0x1a')](function(_0x20af57){return _0x20af57;});}return null;};}function removeEntity(_0x99f172,_0x36a98c){return function(_0x4d6d0a){if(_0x4d6d0a){return _0x4d6d0a['destroy']()[_0xf138('0x1a')](function(){_0x99f172[_0xf138('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a97a,_0x174162){return function(_0x505153){if(!_0x505153){_0x59a97a['sendStatus'](0x194);}return _0x505153;};}function handleError(_0x101f40,_0x2c5c35){_0x2c5c35=_0x2c5c35||0x1f4;return function(_0x46b703){logger[_0xf138('0x1b')](_0x46b703[_0xf138('0x1c')]);if(_0x46b703[_0xf138('0x1d')]){delete _0x46b703[_0xf138('0x1d')];}_0x101f40[_0xf138('0xf')](_0x2c5c35)[_0xf138('0x1e')](_0x46b703);};}exports[_0xf138('0x1f')]=function(_0x56d5f2,_0x48c6a0){var _0xeda8e2={},_0x4aea79={},_0x4935da={'count':0x0,'rows':[]};var _0x26f02b=_[_0xf138('0x20')](db[_0xf138('0x21')][_0xf138('0x22')],function(_0x352069){return{'name':_0x352069[_0xf138('0x23')],'type':_0x352069[_0xf138('0x24')][_0xf138('0x25')]};});_0x4aea79[_0xf138('0x26')]=_[_0xf138('0x20')](_0x26f02b,_0xf138('0x1d'));_0x4aea79[_0xf138('0x27')]=_[_0xf138('0x28')](_0x56d5f2[_0xf138('0x27')]);_0x4aea79[_0xf138('0x29')]=_[_0xf138('0x2a')](_0x4aea79[_0xf138('0x26')],_0x4aea79[_0xf138('0x27')]);_0xeda8e2['attributes']=_[_0xf138('0x2a')](_0x4aea79[_0xf138('0x26')],qs[_0xf138('0x2b')](_0x56d5f2['query'][_0xf138('0x2b')]));_0xeda8e2['attributes']=_0xeda8e2[_0xf138('0x2c')][_0xf138('0x2d')]?_0xeda8e2[_0xf138('0x2c')]:_0x4aea79['model'];if(!_0x56d5f2['query'][_0xf138('0x2e')]('nolimit')){_0xeda8e2['limit']=qs[_0xf138('0x13')](_0x56d5f2['query'][_0xf138('0x13')]);_0xeda8e2['offset']=qs[_0xf138('0x14')](_0x56d5f2['query'][_0xf138('0x14')]);}_0xeda8e2[_0xf138('0x2f')]=qs[_0xf138('0x30')](_0x56d5f2[_0xf138('0x27')][_0xf138('0x30')]);_0xeda8e2[_0xf138('0x31')]=qs[_0xf138('0x29')](_[_0xf138('0x32')](_0x56d5f2['query'],_0x4aea79[_0xf138('0x29')]),_0x26f02b);if(_0x56d5f2[_0xf138('0x27')][_0xf138('0x33')]){_0xeda8e2[_0xf138('0x31')]=_[_0xf138('0x34')](_0xeda8e2['where'],{'$or':_[_0xf138('0x20')](_0x26f02b,function(_0xad2d5f){if(_0xad2d5f[_0xf138('0x24')]!=='VIRTUAL'){var _0x8f4f63={};_0x8f4f63[_0xad2d5f[_0xf138('0x1d')]]={'$like':'%'+_0x56d5f2[_0xf138('0x27')][_0xf138('0x33')]+'%'};return _0x8f4f63;}})});}_0xeda8e2=_[_0xf138('0x34')]({},_0xeda8e2,_0x56d5f2[_0xf138('0x35')]);var _0x17f0f2={'where':_0xeda8e2[_0xf138('0x31')]};return db[_0xf138('0x21')][_0xf138('0x15')](_0x17f0f2)['then'](function(_0x51cc92){_0x4935da[_0xf138('0x15')]=_0x51cc92;if(_0x56d5f2[_0xf138('0x27')][_0xf138('0x36')]){_0xeda8e2[_0xf138('0x37')]=[{'all':!![]}];}return db[_0xf138('0x21')][_0xf138('0x38')](_0xeda8e2);})[_0xf138('0x1a')](function(_0x1c370d){_0x4935da[_0xf138('0x39')]=_0x1c370d;return _0x4935da;})['then'](respondWithFilteredResult(_0x48c6a0,_0xeda8e2))[_0xf138('0x3a')](handleError(_0x48c6a0,null));};exports[_0xf138('0x3b')]=function(_0x1f3e8b,_0x3eb41b){var _0xe72f1b={'raw':!![],'where':{'id':_0x1f3e8b[_0xf138('0x3c')]['id']}},_0x2fb1fe={};_0x2fb1fe['model']=_[_0xf138('0x28')](db[_0xf138('0x21')][_0xf138('0x22')]);_0x2fb1fe['query']=_[_0xf138('0x28')](_0x1f3e8b[_0xf138('0x27')]);_0x2fb1fe[_0xf138('0x29')]=_[_0xf138('0x2a')](_0x2fb1fe[_0xf138('0x26')],_0x2fb1fe[_0xf138('0x27')]);_0xe72f1b[_0xf138('0x2c')]=_['intersection'](_0x2fb1fe['model'],qs[_0xf138('0x2b')](_0x1f3e8b['query'][_0xf138('0x2b')]));_0xe72f1b['attributes']=_0xe72f1b['attributes']['length']?_0xe72f1b['attributes']:_0x2fb1fe[_0xf138('0x26')];if(_0x1f3e8b['query'][_0xf138('0x36')]){_0xe72f1b[_0xf138('0x37')]=[{'all':!![]}];}_0xe72f1b=_[_0xf138('0x34')]({},_0xe72f1b,_0x1f3e8b[_0xf138('0x35')]);return db[_0xf138('0x21')][_0xf138('0x3d')](_0xe72f1b)[_0xf138('0x1a')](handleEntityNotFound(_0x3eb41b,null))['then'](respondWithResult(_0x3eb41b,null))[_0xf138('0x3a')](handleError(_0x3eb41b,null));};exports[_0xf138('0x3e')]=function(_0x2f3156,_0x5a8019){return db[_0xf138('0x21')][_0xf138('0x3e')](_0x2f3156['body'],{})[_0xf138('0x1a')](respondWithResult(_0x5a8019,0xc9))[_0xf138('0x3a')](handleError(_0x5a8019,null));};exports[_0xf138('0x19')]=function(_0x5e3eef,_0x8117a1){if(_0x5e3eef[_0xf138('0x3f')]['id']){delete _0x5e3eef[_0xf138('0x3f')]['id'];}return db[_0xf138('0x21')]['find']({'where':{'id':_0x5e3eef[_0xf138('0x3c')]['id']}})['then'](handleEntityNotFound(_0x8117a1,null))[_0xf138('0x1a')](saveUpdates(_0x5e3eef[_0xf138('0x3f')],null))[_0xf138('0x1a')](respondWithResult(_0x8117a1,null))[_0xf138('0x3a')](handleError(_0x8117a1,null));};exports[_0xf138('0x40')]=function(_0x42e2db,_0x256f75){return db['OpenchannelApplication'][_0xf138('0x3d')]({'where':{'id':_0x42e2db[_0xf138('0x3c')]['id']}})[_0xf138('0x1a')](handleEntityNotFound(_0x256f75,null))[_0xf138('0x1a')](removeEntity(_0x256f75,null))[_0xf138('0x3a')](handleError(_0x256f75,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index e1b2eaa..852a28e 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 _0x8183=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger'];(function(_0x24457c,_0x3b02d6){var _0xfec2fa=function(_0x5688f3){while(--_0x5688f3){_0x24457c['push'](_0x24457c['shift']());}};_0xfec2fa(++_0x3b02d6);}(_0x8183,0x169));var _0x3818=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x8183[_0x26b8b5];return _0x2150a9;};'use strict';var _=require(_0x3818('0x0'));var util=require(_0x3818('0x1'));var logger=require(_0x3818('0x2'))(_0x3818('0x3'));var moment=require(_0x3818('0x4'));var BPromise=require(_0x3818('0x5'));var rp=require(_0x3818('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3818('0x7'));var config=require(_0x3818('0x8'));var attributes=require(_0x3818('0x9'));module[_0x3818('0xa')]=function(_0x2ca554,_0x3627f8){return _0x2ca554[_0x3818('0xb')](_0x3818('0xc'),attributes,{'tableName':_0x3818('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x39eb=['openchannel_applications','utf8mb4','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication'];(function(_0xe6e78c,_0x582369){var _0x2a09c8=function(_0x470ccc){while(--_0x470ccc){_0xe6e78c['push'](_0xe6e78c['shift']());}};_0x2a09c8(++_0x582369);}(_0x39eb,0x106));var _0xb39e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x39eb[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb39e('0x0'))(_0xb39e('0x1'));var moment=require('moment');var BPromise=require(_0xb39e('0x2'));var rp=require(_0xb39e('0x3'));var fs=require('fs');var path=require(_0xb39e('0x4'));var rimraf=require(_0xb39e('0x5'));var config=require(_0xb39e('0x6'));var attributes=require(_0xb39e('0x7'));module[_0xb39e('0x8')]=function(_0x3d6705,_0x22b75a){return _0x3d6705[_0xb39e('0x9')](_0xb39e('0xa'),attributes,{'tableName':_0xb39e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb39e('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 43cf7e1..3d0a359 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 _0x9b34=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','limit','then','stringify','moment','bluebird'];(function(_0xdfac08,_0x4e4296){var _0x2897b7=function(_0x430cb3){while(--_0x430cb3){_0xdfac08['push'](_0xdfac08['shift']());}};_0x2897b7(++_0x4e4296);}(_0x9b34,0x7a));var _0x49b3=function(_0x10802c,_0x3858d6){_0x10802c=_0x10802c-0x0;var _0x426fa6=_0x9b34[_0x10802c];return _0x426fa6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49b3('0x0'));var BPromise=require(_0x49b3('0x1'));var rs=require(_0x49b3('0x2'));var fs=require('fs');var Redis=require(_0x49b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x49b3('0x4'));var logger=require(_0x49b3('0x5'))(_0x49b3('0x6'));var config=require(_0x49b3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x49b3('0x8')][_0x49b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36967d,_0x3f6986,_0x3653b9){return new BPromise(function(_0x15f9f6,_0x3321c1){return client[_0x49b3('0xa')](_0x36967d,_0x3653b9)['then'](function(_0x43a410){logger[_0x49b3('0xb')](_0x49b3('0xc'),_0x3f6986,_0x49b3('0xd'));logger[_0x49b3('0xe')](_0x49b3('0xf'),_0x3f6986,_0x49b3('0xd'),JSON['stringify'](_0x43a410));if(_0x43a410[_0x49b3('0x10')]){if(_0x43a410[_0x49b3('0x10')][_0x49b3('0x11')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x3f6986,_0x43a410['error'][_0x49b3('0x12')]);return _0x3321c1(_0x43a410[_0x49b3('0x10')][_0x49b3('0x12')]);}logger[_0x49b3('0x10')](_0x49b3('0xc'),_0x3f6986,_0x43a410['error'][_0x49b3('0x12')]);return _0x15f9f6(_0x43a410[_0x49b3('0x10')]['message']);}else{logger[_0x49b3('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x3f6986,_0x49b3('0xd'));_0x15f9f6(_0x43a410[_0x49b3('0x13')][_0x49b3('0x12')]);}})[_0x49b3('0x14')](function(_0x19604f){logger[_0x49b3('0x10')](_0x49b3('0xc'),_0x3f6986,_0x19604f);_0x3321c1(_0x19604f);});});}exports[_0x49b3('0x15')]=function(_0x472e80){var _0x20a92a=this;return new Promise(function(_0x4b0fa7,_0xf58f7b){return db[_0x49b3('0x16')][_0x49b3('0x17')](_0x472e80[_0x49b3('0x18')],{'raw':_0x472e80[_0x49b3('0x19')]?_0x472e80['options'][_0x49b3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x472e80[_0x49b3('0x19')]?_0x472e80[_0x49b3('0x19')]['where']||null:null,'attributes':_0x472e80['options']?_0x472e80['options'][_0x49b3('0x1b')]||null:null,'limit':_0x472e80[_0x49b3('0x19')]?_0x472e80[_0x49b3('0x19')][_0x49b3('0x1c')]||null:null})[_0x49b3('0x1d')](function(_0x159e93){logger[_0x49b3('0xb')](_0x49b3('0x15'),_0x472e80);logger['debug']('UpdateOpenchannelApplication',_0x472e80,JSON[_0x49b3('0x1e')](_0x159e93));_0x4b0fa7(_0x159e93);})['catch'](function(_0x460ab3){logger[_0x49b3('0x10')](_0x49b3('0x15'),_0x460ab3[_0x49b3('0x12')],_0x472e80);_0xf58f7b(_0x20a92a['error'](0x1f4,_0x460ab3[_0x49b3('0x12')]));});});}; \ No newline at end of file +var _0xdbfe=['raw','where','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','update','body','options'];(function(_0x1935c1,_0x23d24b){var _0x28017b=function(_0x4fdbd9){while(--_0x4fdbd9){_0x1935c1['push'](_0x1935c1['shift']());}};_0x28017b(++_0x23d24b);}(_0xdbfe,0x1a7));var _0xedbf=function(_0x3bb87f,_0x2f3d13){_0x3bb87f=_0x3bb87f-0x0;var _0xc47aaa=_0xdbfe[_0x3bb87f];return _0xc47aaa;};'use strict';var _=require(_0xedbf('0x0'));var util=require(_0xedbf('0x1'));var moment=require(_0xedbf('0x2'));var BPromise=require(_0xedbf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedbf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xedbf('0x5'));var logger=require(_0xedbf('0x6'))('rpc');var config=require(_0xedbf('0x7'));var jayson=require(_0xedbf('0x8'));var client=jayson['client'][_0xedbf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8e71dc,_0x2ae949,_0x26ceab){return new BPromise(function(_0x315d13,_0xa627f9){return client[_0xedbf('0xa')](_0x8e71dc,_0x26ceab)[_0xedbf('0xb')](function(_0x34b0bd){logger[_0xedbf('0xc')](_0xedbf('0xd'),_0x2ae949,_0xedbf('0xe'));logger[_0xedbf('0xf')](_0xedbf('0x10'),_0x2ae949,_0xedbf('0xe'),JSON[_0xedbf('0x11')](_0x34b0bd));if(_0x34b0bd[_0xedbf('0x12')]){if(_0x34b0bd[_0xedbf('0x12')][_0xedbf('0x13')]===0x1f4){logger[_0xedbf('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x2ae949,_0x34b0bd[_0xedbf('0x12')][_0xedbf('0x14')]);return _0xa627f9(_0x34b0bd['error'][_0xedbf('0x14')]);}logger['error'](_0xedbf('0xd'),_0x2ae949,_0x34b0bd[_0xedbf('0x12')][_0xedbf('0x14')]);return _0x315d13(_0x34b0bd[_0xedbf('0x12')][_0xedbf('0x14')]);}else{logger[_0xedbf('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x2ae949,_0xedbf('0xe'));_0x315d13(_0x34b0bd[_0xedbf('0x15')][_0xedbf('0x14')]);}})[_0xedbf('0x16')](function(_0x1ee5e4){logger[_0xedbf('0x12')](_0xedbf('0xd'),_0x2ae949,_0x1ee5e4);_0xa627f9(_0x1ee5e4);});});}exports[_0xedbf('0x17')]=function(_0x394f8e){var _0x7c0ca4=this;return new Promise(function(_0x1c0bd9,_0x551b17){return db['OpenchannelApplication'][_0xedbf('0x18')](_0x394f8e[_0xedbf('0x19')],{'raw':_0x394f8e['options']?_0x394f8e[_0xedbf('0x1a')][_0xedbf('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x394f8e[_0xedbf('0x1a')]?_0x394f8e[_0xedbf('0x1a')][_0xedbf('0x1c')]||null:null,'attributes':_0x394f8e[_0xedbf('0x1a')]?_0x394f8e[_0xedbf('0x1a')]['attributes']||null:null,'limit':_0x394f8e[_0xedbf('0x1a')]?_0x394f8e['options'][_0xedbf('0x1d')]||null:null})['then'](function(_0x8609e1){logger['info'](_0xedbf('0x17'),_0x394f8e);logger[_0xedbf('0xf')]('UpdateOpenchannelApplication',_0x394f8e,JSON[_0xedbf('0x11')](_0x8609e1));_0x1c0bd9(_0x8609e1);})[_0xedbf('0x16')](function(_0x52bea7){logger[_0xedbf('0x12')](_0xedbf('0x17'),_0x52bea7['message'],_0x394f8e);_0x551b17(_0x7c0ca4[_0xedbf('0x12')](0x1f4,_0x52bea7['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index c0c8357..5a32f17 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 _0x8340=['put','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked'];(function(_0x2f1ff5,_0x4602a2){var _0x3f2d07=function(_0x1ac968){while(--_0x1ac968){_0x2f1ff5['push'](_0x2f1ff5['shift']());}};_0x3f2d07(++_0x4602a2);}(_0x8340,0xa3));var _0x0834=function(_0x3b922b,_0x5ceaa7){_0x3b922b=_0x3b922b-0x0;var _0x306b4f=_0x8340[_0x3b922b];return _0x306b4f;};'use strict';var multer=require('multer');var util=require(_0x0834('0x0'));var path=require(_0x0834('0x1'));var timeout=require(_0x0834('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0834('0x3'));var interaction=require(_0x0834('0x4'));var config=require(_0x0834('0x5'));var controller=require('./openchannelInteraction.controller');router[_0x0834('0x6')]('/',auth[_0x0834('0x7')](),controller['index']);router['get']('/describe',auth[_0x0834('0x7')](),controller[_0x0834('0x8')]);router[_0x0834('0x6')](_0x0834('0x9'),auth[_0x0834('0x7')](),controller[_0x0834('0xa')]);router['get'](_0x0834('0xb'),auth[_0x0834('0x7')](),controller[_0x0834('0xc')]);router[_0x0834('0x6')](_0x0834('0xd'),auth[_0x0834('0x7')](),controller['download']);router[_0x0834('0xe')]('/',auth[_0x0834('0x7')](),controller[_0x0834('0xf')]);router[_0x0834('0xe')](_0x0834('0xb'),auth[_0x0834('0x7')](),controller[_0x0834('0x10')]);router[_0x0834('0xe')](_0x0834('0x11'),auth['isAuthenticated'](),interaction[_0x0834('0x12')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0x0834('0x13')](_0x0834('0x9'),auth[_0x0834('0x7')](),interaction[_0x0834('0x12')](_0x0834('0x14'),_0x0834('0x15')),controller[_0x0834('0x16')]);router[_0x0834('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0x0834('0x12')](_0x0834('0x14'),_0x0834('0x18')),controller['destroy']);router[_0x0834('0x17')]('/:id/tags',auth[_0x0834('0x7')](),controller[_0x0834('0x19')]);module['exports']=router; \ No newline at end of file +var _0x4cbc=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x4cbc,0x154));var _0xc4cb=function(_0x348bac,_0x1804b2){_0x348bac=_0x348bac-0x0;var _0x4e2cbf=_0x4cbc[_0x348bac];return _0x4e2cbf;};'use strict';var multer=require(_0xc4cb('0x0'));var util=require('util');var path=require(_0xc4cb('0x1'));var timeout=require('connect-timeout');var express=require(_0xc4cb('0x2'));var router=express['Router']();var fs_extra=require(_0xc4cb('0x3'));var auth=require(_0xc4cb('0x4'));var interaction=require(_0xc4cb('0x5'));var config=require('../../config/environment');var controller=require(_0xc4cb('0x6'));router[_0xc4cb('0x7')]('/',auth[_0xc4cb('0x8')](),controller['index']);router[_0xc4cb('0x7')](_0xc4cb('0x9'),auth[_0xc4cb('0x8')](),controller[_0xc4cb('0xa')]);router['get'](_0xc4cb('0xb'),auth['isAuthenticated'](),controller[_0xc4cb('0xc')]);router[_0xc4cb('0x7')](_0xc4cb('0xd'),auth[_0xc4cb('0x8')](),controller[_0xc4cb('0xe')]);router['get'](_0xc4cb('0xf'),auth['isAuthenticated'](),controller[_0xc4cb('0x10')]);router[_0xc4cb('0x11')]('/',auth[_0xc4cb('0x8')](),controller[_0xc4cb('0x12')]);router['post'](_0xc4cb('0xd'),auth[_0xc4cb('0x8')](),controller['addMessage']);router[_0xc4cb('0x11')]('/:id/tags',auth[_0xc4cb('0x8')](),interaction[_0xc4cb('0x13')](_0xc4cb('0x14'),_0xc4cb('0x15')),controller[_0xc4cb('0x16')]);router[_0xc4cb('0x17')](_0xc4cb('0xb'),auth[_0xc4cb('0x8')](),interaction[_0xc4cb('0x13')]('openchannel',_0xc4cb('0x18')),controller[_0xc4cb('0x19')]);router['delete'](_0xc4cb('0xb'),auth[_0xc4cb('0x8')](),interaction['tracked']('openchannel',_0xc4cb('0x1a')),controller[_0xc4cb('0x1b')]);router[_0xc4cb('0x1c')]('/:id/tags',auth[_0xc4cb('0x8')](),controller[_0xc4cb('0x1d')]);module[_0xc4cb('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 6f0c371..4e22277 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 _0x3e5c=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x4a1cb7,_0x36e55d){_0x4a1cb7=_0x4a1cb7-0x0;var _0x5d5d38=_0x3e5c[_0x4a1cb7];return _0x5d5d38;};'use strict';var Sequelize=require(_0xc3e5('0x0'));module[_0xc3e5('0x1')]={'closed':{'type':Sequelize[_0xc3e5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc3e5('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc3e5('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc3e5('0x4')]},'note':{'type':Sequelize[_0xc3e5('0x4')]},'read1stAt':{'type':Sequelize[_0xc3e5('0x3')]},'threadId':{'type':Sequelize[_0xc3e5('0x4')]},'externalUrl':{'type':Sequelize[_0xc3e5('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xc3e5('0x5')]('in',_0xc3e5('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xc3e5('0x5')]('in',_0xc3e5('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc3e5('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe799=['out','ENUM','sequelize','BOOLEAN','STRING','DATE'];(function(_0x14a62c,_0x5c77e1){var _0x5bab14=function(_0xa6dc35){while(--_0xa6dc35){_0x14a62c['push'](_0x14a62c['shift']());}};_0x5bab14(++_0x5c77e1);}(_0xe799,0x170));var _0x9e79=function(_0x5b7bde,_0x2552a5){_0x5b7bde=_0x5b7bde-0x0;var _0x193610=_0xe799[_0x5b7bde];return _0x193610;};'use strict';var Sequelize=require(_0x9e79('0x0'));module['exports']={'closed':{'type':Sequelize[_0x9e79('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9e79('0x2')]},'secondDisposition':{'type':Sequelize[_0x9e79('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9e79('0x2')]},'read1stAt':{'type':Sequelize[_0x9e79('0x3')]},'threadId':{'type':Sequelize[_0x9e79('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x9e79('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9e79('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x9e79('0x5')]('in',_0x9e79('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x9e79('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index a8eaad5..57baaab 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 _0x15b2=['model','fields','attributes','length','includeAll','include','merge','options','find','create','body','update','describe','addMessage','OpenchannelMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','color','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','tmp','files','attachments','transcript-%d-%s.zip','User','fullname','push','firstName','lastName','Messages','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','threadId','Public','Private','Attachment','basename','existsSync','createReadStream','pipe','Contact','out','read','value','server','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','then','error','name','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','findAll','openchannel','query','catch','show','from','params','keys','filters','intersection'];(function(_0x2bb3f6,_0x25fde0){var _0x62b339=function(_0x53e014){while(--_0x53e014){_0x2bb3f6['push'](_0x2bb3f6['shift']());}};_0x62b339(++_0x25fde0);}(_0x15b2,0xd3));var _0x215b=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0x15b2[_0x5b077b];return _0x16faf7;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x215b('0x0'));var moment=require(_0x215b('0x1'));var util=require(_0x215b('0x2'));var path=require(_0x215b('0x3'));var ejs=require(_0x215b('0x4'));var fs=require('fs');var _=require(_0x215b('0x5'));var Redis=require(_0x215b('0x6'));var interaction=require(_0x215b('0x7'));var qs=require(_0x215b('0x8'));var pdf=require(_0x215b('0x9'));var logger=require(_0x215b('0xa'))(_0x215b('0xb'));var config=require('../../config/environment');var db=require(_0x215b('0xc'))['db'];config[_0x215b('0xd')]=_[_0x215b('0xe')](config[_0x215b('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x215b('0xd')]));require(_0x215b('0xf'))[_0x215b('0x10')](socket);function respondWithStatusCode(_0x91d12f,_0x5ea1fd){_0x5ea1fd=_0x5ea1fd||0xcc;return function(_0x231a5c){if(_0x231a5c){return _0x91d12f[_0x215b('0x11')](_0x5ea1fd);}return _0x91d12f[_0x215b('0x12')](_0x5ea1fd)[_0x215b('0x13')]();};}function respondWithResult(_0x398363,_0x1a0804){_0x1a0804=_0x1a0804||0xc8;return function(_0x5b3885){if(_0x5b3885){return _0x398363[_0x215b('0x12')](_0x1a0804)[_0x215b('0x14')](_0x5b3885);}};}function respondWithFilteredResult(_0x27d48a,_0x36948c){return function(_0x7ec125){if(_0x7ec125){var _0x29de56=typeof _0x36948c['offset']===_0x215b('0x15')&&typeof _0x36948c[_0x215b('0x16')]===_0x215b('0x15');var _0x47abc4=_0x7ec125[_0x215b('0x17')];var _0x56705e=_0x29de56?0x0:_0x36948c[_0x215b('0x18')];var _0x5cf762=_0x29de56?_0x7ec125[_0x215b('0x17')]:_0x36948c[_0x215b('0x18')]+_0x36948c[_0x215b('0x16')];var _0x3aeb95;if(_0x5cf762>=_0x47abc4){_0x5cf762=_0x47abc4;_0x3aeb95=0xc8;}else{_0x3aeb95=0xce;}_0x27d48a[_0x215b('0x12')](_0x3aeb95);return _0x27d48a['set'](_0x215b('0x19'),_0x56705e+'-'+_0x5cf762+'/'+_0x47abc4)[_0x215b('0x14')](_0x7ec125);}return null;};}function saveUpdates(_0x5186b2){return function(_0x24ac1f){if(_0x24ac1f){return _0x24ac1f['update'](_0x5186b2)[_0x215b('0x1a')](function(_0x160970){return _0x160970;});}return null;};}function removeEntity(_0x46294d){return function(_0x599f5d){if(_0x599f5d){return _0x599f5d['destroy']()[_0x215b('0x1a')](function(){_0x46294d[_0x215b('0x12')](0xcc)[_0x215b('0x13')]();});}};}function handleEntityNotFound(_0x11db24){return function(_0x5e610f){if(!_0x5e610f){_0x11db24[_0x215b('0x11')](0x194);}return _0x5e610f;};}function handleError(_0x546336,_0x28ee73){_0x28ee73=_0x28ee73||0x1f4;return function(_0x174a8e){logger[_0x215b('0x1b')](_0x174a8e['stack']);if(_0x174a8e[_0x215b('0x1c')]){delete _0x174a8e[_0x215b('0x1c')];}_0x546336[_0x215b('0x12')](_0x28ee73)['send'](_0x174a8e);};}exports[_0x215b('0x1d')]=function(_0x50e7e6,_0x3cde6c){var _0x4ba0da={};var _0x4c47fa=_['map'](db[_0x215b('0x1e')][_0x215b('0x1f')],function(_0x53f0e0){return{'name':_0x53f0e0[_0x215b('0x20')],'type':_0x53f0e0[_0x215b('0x21')][_0x215b('0x22')]};});_0x4ba0da=qs['getOptions'](_0x4c47fa,_0x50e7e6);return interaction[_0x215b('0x23')](_0x215b('0x24'),_0x50e7e6[_0x215b('0x25')],_0x50e7e6['user'],_0x4ba0da,_0x4c47fa)[_0x215b('0x1a')](respondWithFilteredResult(_0x3cde6c,_0x4ba0da))[_0x215b('0x26')](handleError(_0x3cde6c,null));};exports[_0x215b('0x27')]=function(_0x545a21,_0x4ddfcc){var _0x2d5862={};if(_0x545a21['query']['type']&&_0x545a21['query']['type']==='from'){_0x2d5862[_0x215b('0x28')]=_0x545a21[_0x215b('0x29')]['id'];}else{_0x2d5862['id']=_0x545a21['params']['id'];}var _0x4180f8={'raw':![],'where':_0x2d5862},_0x2cdae2={};_0x2cdae2['model']=_[_0x215b('0x2a')](db[_0x215b('0x1e')][_0x215b('0x1f')]);_0x2cdae2['query']=_[_0x215b('0x2a')](_0x545a21['query']);_0x2cdae2[_0x215b('0x2b')]=_[_0x215b('0x2c')](_0x2cdae2[_0x215b('0x2d')],_0x2cdae2['query']);_0x4180f8['attributes']=_['intersection'](_0x2cdae2[_0x215b('0x2d')],qs[_0x215b('0x2e')](_0x545a21[_0x215b('0x25')][_0x215b('0x2e')]));_0x4180f8[_0x215b('0x2f')]=_0x4180f8[_0x215b('0x2f')][_0x215b('0x30')]?_0x4180f8[_0x215b('0x2f')]:_0x2cdae2[_0x215b('0x2d')];if(_0x545a21['query'][_0x215b('0x31')]){_0x4180f8[_0x215b('0x32')]=[{'all':!![]}];}_0x4180f8=_[_0x215b('0x33')]({},_0x4180f8,_0x545a21[_0x215b('0x34')]);return db[_0x215b('0x1e')][_0x215b('0x35')](_0x4180f8)[_0x215b('0x1a')](handleEntityNotFound(_0x4ddfcc,null))[_0x215b('0x1a')](respondWithResult(_0x4ddfcc,null))['catch'](handleError(_0x4ddfcc,null));};exports['create']=function(_0x530b4b,_0x2509f9){return db['OpenchannelInteraction'][_0x215b('0x36')](_0x530b4b[_0x215b('0x37')],{})[_0x215b('0x1a')](respondWithResult(_0x2509f9,0xc9))[_0x215b('0x26')](handleError(_0x2509f9,null));};exports[_0x215b('0x38')]=function(_0xccb975,_0x4e3e5e){if(_0xccb975['body']['id']){delete _0xccb975['body']['id'];}return db['OpenchannelInteraction'][_0x215b('0x35')]({'where':{'id':_0xccb975['params']['id']}})['then'](handleEntityNotFound(_0x4e3e5e,null))[_0x215b('0x1a')](saveUpdates(_0xccb975[_0x215b('0x37')],null))[_0x215b('0x1a')](respondWithResult(_0x4e3e5e,null))['catch'](handleError(_0x4e3e5e,null));};exports['destroy']=function(_0x34cba0,_0x1ebacd){return db[_0x215b('0x1e')]['find']({'where':{'id':_0x34cba0['params']['id']}})[_0x215b('0x1a')](handleEntityNotFound(_0x1ebacd,null))[_0x215b('0x1a')](removeEntity(_0x1ebacd,null))[_0x215b('0x26')](handleError(_0x1ebacd,null));};exports[_0x215b('0x39')]=function(_0x38af1f,_0x4f2363){return db[_0x215b('0x1e')]['describe']()['then'](respondWithResult(_0x4f2363,null))['catch'](handleError(_0x4f2363,null));};exports[_0x215b('0x3a')]=function(_0x5274e4,_0xeef0f){return db[_0x215b('0x3b')][_0x215b('0x35')]({'where':{'id':_0x5274e4[_0x215b('0x29')]['id']}})[_0x215b('0x1a')](handleEntityNotFound(_0xeef0f,null))['then'](function(_0x2e19f7){if(_0x2e19f7){return _0x2e19f7[_0x215b('0x3a')](_0x5274e4['body'][_0x215b('0x3c')],_[_0x215b('0x3d')](_0x5274e4[_0x215b('0x37')],[_0x215b('0x3c'),'id'])||{});}})['then'](respondWithResult(_0xeef0f,null))[_0x215b('0x26')](handleError(_0xeef0f,null));};exports['getMessages']=function(_0x4e2f3b,_0x5510a3){var _0x5dc737={'raw':![],'where':{}};var _0x10cf15={};var _0x17f8ed={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x215b('0x3e')]({'where':{'id':_0x4e2f3b[_0x215b('0x29')]['id']}})[_0x215b('0x1a')](handleEntityNotFound(_0x5510a3,null))[_0x215b('0x1a')](function(_0x195af2){if(_0x195af2){_0x10cf15['model']=_[_0x215b('0x2a')](db['OpenchannelMessage'][_0x215b('0x1f')]);_0x10cf15[_0x215b('0x25')]=_['keys'](_0x4e2f3b[_0x215b('0x25')]);_0x10cf15[_0x215b('0x2b')]=_[_0x215b('0x2c')](_0x10cf15[_0x215b('0x2d')],_0x10cf15['query']);_0x5dc737[_0x215b('0x2f')]=_[_0x215b('0x2c')](_0x10cf15[_0x215b('0x2d')],qs['fields'](_0x4e2f3b[_0x215b('0x25')][_0x215b('0x2e')]));_0x5dc737[_0x215b('0x2f')]=_0x5dc737[_0x215b('0x2f')][_0x215b('0x30')]?_0x5dc737['attributes']:_0x10cf15['model'];if(!_0x4e2f3b[_0x215b('0x25')][_0x215b('0x3f')](_0x215b('0x40'))){_0x5dc737['limit']=qs[_0x215b('0x16')](_0x4e2f3b['query'][_0x215b('0x16')]);_0x5dc737[_0x215b('0x18')]=qs[_0x215b('0x18')](_0x4e2f3b['query']['offset']);}_0x5dc737[_0x215b('0x41')]=qs['sort'](_0x4e2f3b['query'][_0x215b('0x42')]);_0x5dc737[_0x215b('0x43')]=qs[_0x215b('0x2b')](_[_0x215b('0x44')](_0x4e2f3b['query'],_0x10cf15['filters']));_0x5dc737[_0x215b('0x43')][_0x215b('0x45')]=_0x195af2['id'];if(_0x4e2f3b[_0x215b('0x25')]['filter']){_0x5dc737[_0x215b('0x43')]=_[_0x215b('0x33')](_0x5dc737[_0x215b('0x43')],{'$or':_[_0x215b('0x46')](_0x5dc737['attributes'],function(_0x44fb3b){var _0x3ded65={};_0x3ded65[_0x44fb3b]={'$like':'%'+_0x4e2f3b['query'][_0x215b('0x47')]+'%'};return _0x3ded65;})});}if(_0x4e2f3b[_0x215b('0x25')][_0x215b('0x48')]){var _0x52bd1=_0x4e2f3b[_0x215b('0x25')][_0x215b('0x48')][_0x215b('0x49')](',');var _0x5e5e22={};_0x5e5e22[_0x52bd1[0x0]]={'$gte':moment(_0x52bd1[0x1])[_0x215b('0x4a')](_0x215b('0x4b'))};_0x5dc737[_0x215b('0x43')]=_[_0x215b('0x33')](_0x5dc737[_0x215b('0x43')],_0x5e5e22);}_0x5dc737=_[_0x215b('0x33')]({},_0x5dc737,_0x4e2f3b[_0x215b('0x34')]);return db[_0x215b('0x3b')][_0x215b('0x17')]({'where':_0x5dc737[_0x215b('0x43')]})[_0x215b('0x1a')](function(_0x1790aa){_0x17f8ed[_0x215b('0x17')]=_0x1790aa;if(_0x4e2f3b[_0x215b('0x25')]['includeAll']){_0x5dc737[_0x215b('0x32')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x215b('0x23')](_0x5dc737);})[_0x215b('0x1a')](function(_0x51b38b){_0x17f8ed[_0x215b('0x4c')]=_0x51b38b;return _0x17f8ed;});}})['then'](respondWithFilteredResult(_0x5510a3,_0x5dc737))['catch'](handleError(_0x5510a3,null));};exports[_0x215b('0x4d')]=function(_0x158c52,_0x2c61de){return db['OpenchannelInteraction'][_0x215b('0x35')]({'where':{'id':_0x158c52[_0x215b('0x29')]['id']}})[_0x215b('0x1a')](handleEntityNotFound(_0x2c61de,null))[_0x215b('0x1a')](function(_0x2b163c){if(_0x2b163c){return _0x2b163c[_0x215b('0x4e')](_0x158c52['body'][_0x215b('0x3c')],_['omit'](_0x158c52['body'],[_0x215b('0x3c'),'id'])||{})[_0x215b('0x4f')](function(){return db['Tag'][_0x215b('0x23')]({'attributes':['id',_0x215b('0x1c'),_0x215b('0x50')],'where':{'id':_0x158c52[_0x215b('0x37')][_0x215b('0x3c')]}});})[_0x215b('0x1a')](function(_0x506256){socket['emit'](_0x215b('0x51'),{'id':Number(_0x158c52[_0x215b('0x29')]['id']),'tags':_0x506256||[]});return{'id':Number(_0x158c52[_0x215b('0x29')]['id']),'tags':_0x506256||[]};});}})[_0x215b('0x1a')](respondWithResult(_0x2c61de,null))['catch'](handleError(_0x2c61de,null));};exports[_0x215b('0x52')]=function(_0x34d891,_0x55427d){return db[_0x215b('0x1e')][_0x215b('0x35')]({'where':{'id':_0x34d891[_0x215b('0x29')]['id']}})[_0x215b('0x1a')](handleEntityNotFound(_0x55427d,null))['then'](function(_0x13fc16){if(_0x13fc16){return _0x13fc16[_0x215b('0x52')](_0x34d891['query']['ids']);}})[_0x215b('0x1a')](respondWithStatusCode(_0x55427d,null))['catch'](handleError(_0x55427d,null));};exports[_0x215b('0x53')]=function(_0x43e171,_0x108dd9){var _0x1c88a1=moment()[_0x215b('0x54')]()[_0x215b('0x55')]();var _0x2e2176=path[_0x215b('0x56')](config[_0x215b('0x57')],'server','files',_0x215b('0x58'));var _0x22cda4=path[_0x215b('0x56')](config[_0x215b('0x57')],'server',_0x215b('0x59'),_0x215b('0x5a'));var _0xa6f73a=path['join'](_0x2e2176,_0x1c88a1);var _0x3497ce=util[_0x215b('0x4a')](_0x215b('0x5b'),_0x43e171[_0x215b('0x29')]['id'],_0x1c88a1);var _0xd15cc=path[_0x215b('0x56')](_0x2e2176,_0x3497ce);var _0x57ae8e=[];_0x57ae8e['push']({'model':db[_0x215b('0x5c')],'as':_0x215b('0x5c'),'attributes':['id',_0x215b('0x5d')],'raw':!![]});_0x57ae8e[_0x215b('0x5e')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x215b('0x5f'),_0x215b('0x60')],'raw':!![]});if(_0x43e171['query'][_0x215b('0x5a')]){_0x57ae8e['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x214ac7=[{'model':db[_0x215b('0x3b')],'as':_0x215b('0x61'),'attributes':['id','body',_0x215b('0x62'),_0x215b('0x63'),_0x215b('0x64'),'read'],'include':_0x57ae8e}];_0x214ac7[_0x215b('0x5e')]({'model':db[_0x215b('0x65')],'as':_0x215b('0x66'),'attributes':['id',_0x215b('0x1c')]});_0x214ac7[_0x215b('0x5e')]({'model':db[_0x215b('0x5c')],'as':_0x215b('0x67'),'attributes':['id',_0x215b('0x5d')]});return db[_0x215b('0x1e')][_0x215b('0x35')]({'where':{'id':_0x43e171['params']['id']},'include':_0x214ac7})[_0x215b('0x1a')](handleEntityNotFound(_0x108dd9,null))[_0x215b('0x1a')](function(_0x4b29d2){if(_0x4b29d2){var _0x29087d=_0x4b29d2[_0x215b('0x68')]({'plain':!![]});fs[_0x215b('0x69')](_0xa6f73a);var _0x17e018={'channel':_0x215b('0x6a'),'account':_0x29087d['Account'][_0x215b('0x1c')],'agent':_0x29087d[_0x215b('0x67')]?_0x29087d[_0x215b('0x67')][_0x215b('0x5d')]:_0x215b('0x6b'),'createdAt':moment(_0x29087d[_0x215b('0x62')])[_0x215b('0x4a')](_0x215b('0x4b'))[_0x215b('0x55')](),'closedAt':_0x29087d['closed']?moment(_0x29087d[_0x215b('0x6c')])['format'](_0x215b('0x4b'))[_0x215b('0x55')]():'','disposition':_0x29087d['disposition'],'visibility':_0x29087d[_0x215b('0x6d')]?_0x215b('0x6e'):_0x215b('0x6f'),'messages':_(_0x29087d[_0x215b('0x61')])[_0x215b('0x47')]({'secret':![]})['map'](function(_0x5f16ed){if(_0x5f16ed[_0x215b('0x70')]){var _0x4eede5=path[_0x215b('0x56')](_0x22cda4,_0x5f16ed[_0x215b('0x70')][_0x215b('0x71')]);if(fs[_0x215b('0x72')](_0x4eede5)){fs[_0x215b('0x73')](_0x4eede5)[_0x215b('0x74')](fs['createWriteStream'](path[_0x215b('0x56')](_0xa6f73a,_0x5f16ed[_0x215b('0x70')][_0x215b('0x71')])));}}return{'date':moment(_0x5f16ed[_0x215b('0x62')])[_0x215b('0x4a')](_0x215b('0x4b'))['toString'](),'sender':_0x5f16ed[_0x215b('0x63')]==='out'?_0x5f16ed[_0x215b('0x5c')]?_0x5f16ed[_0x215b('0x5c')][_0x215b('0x5d')]:'System':_0x5f16ed[_0x215b('0x75')]['firstName']+(_0x5f16ed[_0x215b('0x75')][_0x215b('0x60')]?'\x20'+_0x5f16ed[_0x215b('0x75')][_0x215b('0x60')]:''),'body':_0x5f16ed['Attachment']?_0x5f16ed['Attachment'][_0x215b('0x71')]:_0x5f16ed[_0x215b('0x37')],'direction':_0x5f16ed['direction']===_0x215b('0x76')?'A':'C','secret':_0x5f16ed[_0x215b('0x64')],'read':_0x5f16ed[_0x215b('0x77')],'attachment':_0x5f16ed[_0x215b('0x70')]};})[_0x215b('0x78')]()};return ejs['renderFile'](path[_0x215b('0x56')](config['root'],_0x215b('0x79'),_0x215b('0x7a'),_0x215b('0x7b')),{'interaction':_0x17e018})[_0x215b('0x1a')](function(_0x42a752){var _0x57aa04=path['join'](_0xa6f73a,_0x215b('0x7c')+_0x29087d['id']+'-'+_0x1c88a1+'.pdf');var _0x5ee084={'path':_0x57aa04,'channel':_0x215b('0x6a'),'interactionId':_0x29087d['id']};return pdf[_0x215b('0x7d')](_0x42a752,_0x5ee084);})[_0x215b('0x1a')](function(){return new Promise(function(_0x17e52e,_0x4984ee){zipdir(_0xa6f73a,{'saveTo':_0xd15cc},function(_0xc3e3d9,_0x23f007){if(_0xc3e3d9)return _0x4984ee(_0xc3e3d9);return _0x17e52e(_0x23f007);});})[_0x215b('0x1a')](function(){return new Promise(function(_0x6407bd,_0x46ef4e){rimraf(_0xa6f73a,function(_0x12b9ae){if(_0x12b9ae)_0x46ef4e(_0x12b9ae);return _0x6407bd();});});})[_0x215b('0x1a')](function(){return _0x108dd9[_0x215b('0x53')](_0xd15cc,_0x3497ce,function(_0x2cb1b1){if(_0x2cb1b1){logger[_0x215b('0x1b')](_0x215b('0x7e'),_0x2cb1b1);}else{fs[_0x215b('0x7f')](_0xd15cc);}});});});}else{return _0x108dd9[_0x215b('0x11')](0xc8);}})[_0x215b('0x26')](handleError(_0x108dd9,null));}; \ No newline at end of file +var _0x655f=['files','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','attachments','Attachment','Messages','createdAt','secret','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','N.A.','closed','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','read','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','util','path','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','update','then','destroy','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','type','key','getOptions','findAll','openchannel','query','catch','show','from','params','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','describe','OpenchannelMessage','addMessage','ids','findOne','length','hasOwnProperty','nolimit','sort','where','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0x655f,0xaf));var _0xf655=function(_0x32a68a,_0x4a803b){_0x32a68a=_0x32a68a-0x0;var _0x2609a7=_0x655f[_0x32a68a];return _0x2609a7;};'use strict';var rimraf=require(_0xf655('0x0'));var zipdir=require(_0xf655('0x1'));var moment=require('moment');var util=require(_0xf655('0x2'));var path=require(_0xf655('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xf655('0x4'));var qs=require(_0xf655('0x5'));var pdf=require(_0xf655('0x6'));var logger=require(_0xf655('0x7'))(_0xf655('0x8'));var config=require(_0xf655('0x9'));var db=require(_0xf655('0xa'))['db'];config[_0xf655('0xb')]=_[_0xf655('0xc')](config['redis'],{'host':_0xf655('0xd'),'port':0x18eb});var socket=require(_0xf655('0xe'))(new Redis(config[_0xf655('0xb')]));require(_0xf655('0xf'))[_0xf655('0x10')](socket);function respondWithStatusCode(_0x51bb42,_0x41af7d){_0x41af7d=_0x41af7d||0xcc;return function(_0x46b79e){if(_0x46b79e){return _0x51bb42[_0xf655('0x11')](_0x41af7d);}return _0x51bb42[_0xf655('0x12')](_0x41af7d)[_0xf655('0x13')]();};}function respondWithResult(_0x5547ab,_0x15c162){_0x15c162=_0x15c162||0xc8;return function(_0x4effd6){if(_0x4effd6){return _0x5547ab[_0xf655('0x12')](_0x15c162)[_0xf655('0x14')](_0x4effd6);}};}function respondWithFilteredResult(_0x389ccd,_0x293070){return function(_0x26dd9e){if(_0x26dd9e){var _0x26b829=typeof _0x293070[_0xf655('0x15')]==='undefined'&&typeof _0x293070['limit']===_0xf655('0x16');var _0x28669c=_0x26dd9e[_0xf655('0x17')];var _0x5f4950=_0x26b829?0x0:_0x293070[_0xf655('0x15')];var _0x520fa5=_0x26b829?_0x26dd9e[_0xf655('0x17')]:_0x293070['offset']+_0x293070[_0xf655('0x18')];var _0x1dee61;if(_0x520fa5>=_0x28669c){_0x520fa5=_0x28669c;_0x1dee61=0xc8;}else{_0x1dee61=0xce;}_0x389ccd[_0xf655('0x12')](_0x1dee61);return _0x389ccd[_0xf655('0x19')]('Content-Range',_0x5f4950+'-'+_0x520fa5+'/'+_0x28669c)[_0xf655('0x14')](_0x26dd9e);}return null;};}function saveUpdates(_0x54109e){return function(_0xc6b96f){if(_0xc6b96f){return _0xc6b96f[_0xf655('0x1a')](_0x54109e)[_0xf655('0x1b')](function(_0xc67476){return _0xc67476;});}return null;};}function removeEntity(_0x3b230e){return function(_0x599c7e){if(_0x599c7e){return _0x599c7e[_0xf655('0x1c')]()['then'](function(){_0x3b230e[_0xf655('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x548d04){return function(_0x1d26d1){if(!_0x1d26d1){_0x548d04[_0xf655('0x11')](0x194);}return _0x1d26d1;};}function handleError(_0x25d9f4,_0x35cc6f){_0x35cc6f=_0x35cc6f||0x1f4;return function(_0x52de08){logger[_0xf655('0x1d')](_0x52de08[_0xf655('0x1e')]);if(_0x52de08['name']){delete _0x52de08[_0xf655('0x1f')];}_0x25d9f4['status'](_0x35cc6f)[_0xf655('0x20')](_0x52de08);};}exports[_0xf655('0x21')]=function(_0x2943cd,_0x5c3d50){var _0x1d2acd={};var _0x4f44d0=_[_0xf655('0x22')](db[_0xf655('0x23')][_0xf655('0x24')],function(_0x3c7320){return{'name':_0x3c7320['fieldName'],'type':_0x3c7320[_0xf655('0x25')][_0xf655('0x26')]};});_0x1d2acd=qs[_0xf655('0x27')](_0x4f44d0,_0x2943cd);return interaction[_0xf655('0x28')](_0xf655('0x29'),_0x2943cd[_0xf655('0x2a')],_0x2943cd['user'],_0x1d2acd,_0x4f44d0)['then'](respondWithFilteredResult(_0x5c3d50,_0x1d2acd))[_0xf655('0x2b')](handleError(_0x5c3d50,null));};exports[_0xf655('0x2c')]=function(_0x28bfb2,_0x557f3b){var _0x39906d={};if(_0x28bfb2['query'][_0xf655('0x25')]&&_0x28bfb2[_0xf655('0x2a')]['type']===_0xf655('0x2d')){_0x39906d[_0xf655('0x2d')]=_0x28bfb2[_0xf655('0x2e')]['id'];}else{_0x39906d['id']=_0x28bfb2['params']['id'];}var _0x4d096d={'raw':![],'where':_0x39906d},_0x52f101={};_0x52f101[_0xf655('0x2f')]=_['keys'](db[_0xf655('0x23')]['rawAttributes']);_0x52f101[_0xf655('0x2a')]=_[_0xf655('0x30')](_0x28bfb2[_0xf655('0x2a')]);_0x52f101[_0xf655('0x31')]=_[_0xf655('0x32')](_0x52f101['model'],_0x52f101[_0xf655('0x2a')]);_0x4d096d[_0xf655('0x33')]=_[_0xf655('0x32')](_0x52f101[_0xf655('0x2f')],qs[_0xf655('0x34')](_0x28bfb2[_0xf655('0x2a')][_0xf655('0x34')]));_0x4d096d['attributes']=_0x4d096d[_0xf655('0x33')]['length']?_0x4d096d[_0xf655('0x33')]:_0x52f101[_0xf655('0x2f')];if(_0x28bfb2[_0xf655('0x2a')][_0xf655('0x35')]){_0x4d096d[_0xf655('0x36')]=[{'all':!![]}];}_0x4d096d=_[_0xf655('0x37')]({},_0x4d096d,_0x28bfb2[_0xf655('0x38')]);return db[_0xf655('0x23')][_0xf655('0x39')](_0x4d096d)[_0xf655('0x1b')](handleEntityNotFound(_0x557f3b,null))[_0xf655('0x1b')](respondWithResult(_0x557f3b,null))[_0xf655('0x2b')](handleError(_0x557f3b,null));};exports[_0xf655('0x3a')]=function(_0x3a193c,_0x48969f){return db['OpenchannelInteraction']['create'](_0x3a193c[_0xf655('0x3b')],{})['then'](respondWithResult(_0x48969f,0xc9))['catch'](handleError(_0x48969f,null));};exports[_0xf655('0x1a')]=function(_0x42b789,_0x3004c8){if(_0x42b789[_0xf655('0x3b')]['id']){delete _0x42b789['body']['id'];}return db['OpenchannelInteraction'][_0xf655('0x39')]({'where':{'id':_0x42b789['params']['id']}})[_0xf655('0x1b')](handleEntityNotFound(_0x3004c8,null))[_0xf655('0x1b')](saveUpdates(_0x42b789['body'],null))[_0xf655('0x1b')](respondWithResult(_0x3004c8,null))[_0xf655('0x2b')](handleError(_0x3004c8,null));};exports[_0xf655('0x1c')]=function(_0x378d25,_0x596c3b){return db[_0xf655('0x23')][_0xf655('0x39')]({'where':{'id':_0x378d25[_0xf655('0x2e')]['id']}})[_0xf655('0x1b')](handleEntityNotFound(_0x596c3b,null))['then'](removeEntity(_0x596c3b,null))[_0xf655('0x2b')](handleError(_0x596c3b,null));};exports[_0xf655('0x3c')]=function(_0x250968,_0xe6f209){return db[_0xf655('0x23')][_0xf655('0x3c')]()[_0xf655('0x1b')](respondWithResult(_0xe6f209,null))[_0xf655('0x2b')](handleError(_0xe6f209,null));};exports['addMessage']=function(_0x40a406,_0x4535b1){return db[_0xf655('0x3d')]['find']({'where':{'id':_0x40a406['params']['id']}})[_0xf655('0x1b')](handleEntityNotFound(_0x4535b1,null))[_0xf655('0x1b')](function(_0xac26d5){if(_0xac26d5){return _0xac26d5[_0xf655('0x3e')](_0x40a406[_0xf655('0x3b')][_0xf655('0x3f')],_['omit'](_0x40a406[_0xf655('0x3b')],['ids','id'])||{});}})['then'](respondWithResult(_0x4535b1,null))['catch'](handleError(_0x4535b1,null));};exports['getMessages']=function(_0x5f0b89,_0x1acb54){var _0x205b9d={'raw':![],'where':{}};var _0x15c26f={};var _0x244449={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xf655('0x40')]({'where':{'id':_0x5f0b89[_0xf655('0x2e')]['id']}})['then'](handleEntityNotFound(_0x1acb54,null))[_0xf655('0x1b')](function(_0x27ad0a){if(_0x27ad0a){_0x15c26f['model']=_['keys'](db[_0xf655('0x3d')][_0xf655('0x24')]);_0x15c26f[_0xf655('0x2a')]=_[_0xf655('0x30')](_0x5f0b89[_0xf655('0x2a')]);_0x15c26f['filters']=_['intersection'](_0x15c26f[_0xf655('0x2f')],_0x15c26f[_0xf655('0x2a')]);_0x205b9d[_0xf655('0x33')]=_[_0xf655('0x32')](_0x15c26f['model'],qs[_0xf655('0x34')](_0x5f0b89[_0xf655('0x2a')][_0xf655('0x34')]));_0x205b9d[_0xf655('0x33')]=_0x205b9d[_0xf655('0x33')][_0xf655('0x41')]?_0x205b9d['attributes']:_0x15c26f[_0xf655('0x2f')];if(!_0x5f0b89['query'][_0xf655('0x42')](_0xf655('0x43'))){_0x205b9d[_0xf655('0x18')]=qs[_0xf655('0x18')](_0x5f0b89['query'][_0xf655('0x18')]);_0x205b9d[_0xf655('0x15')]=qs[_0xf655('0x15')](_0x5f0b89[_0xf655('0x2a')]['offset']);}_0x205b9d['order']=qs['sort'](_0x5f0b89['query'][_0xf655('0x44')]);_0x205b9d[_0xf655('0x45')]=qs['filters'](_['pick'](_0x5f0b89[_0xf655('0x2a')],_0x15c26f[_0xf655('0x31')]));_0x205b9d['where'][_0xf655('0x46')]=_0x27ad0a['id'];if(_0x5f0b89[_0xf655('0x2a')][_0xf655('0x47')]){_0x205b9d[_0xf655('0x45')]=_['merge'](_0x205b9d[_0xf655('0x45')],{'$or':_[_0xf655('0x22')](_0x205b9d[_0xf655('0x33')],function(_0x802992){var _0x304319={};_0x304319[_0x802992]={'$like':'%'+_0x5f0b89['query'][_0xf655('0x47')]+'%'};return _0x304319;})});}if(_0x5f0b89[_0xf655('0x2a')][_0xf655('0x48')]){var _0x1b8af0=_0x5f0b89['query'][_0xf655('0x48')][_0xf655('0x49')](',');var _0x3ff984={};_0x3ff984[_0x1b8af0[0x0]]={'$gte':moment(_0x1b8af0[0x1])[_0xf655('0x4a')](_0xf655('0x4b'))};_0x205b9d[_0xf655('0x45')]=_['merge'](_0x205b9d['where'],_0x3ff984);}_0x205b9d=_[_0xf655('0x37')]({},_0x205b9d,_0x5f0b89[_0xf655('0x38')]);return db['OpenchannelMessage'][_0xf655('0x17')]({'where':_0x205b9d[_0xf655('0x45')]})[_0xf655('0x1b')](function(_0xb5a546){_0x244449[_0xf655('0x17')]=_0xb5a546;if(_0x5f0b89[_0xf655('0x2a')][_0xf655('0x35')]){_0x205b9d[_0xf655('0x36')]=[{'all':!![]}];}return db[_0xf655('0x3d')][_0xf655('0x28')](_0x205b9d);})[_0xf655('0x1b')](function(_0x274e03){_0x244449[_0xf655('0x4c')]=_0x274e03;return _0x244449;});}})['then'](respondWithFilteredResult(_0x1acb54,_0x205b9d))[_0xf655('0x2b')](handleError(_0x1acb54,null));};exports['addTags']=function(_0x5b0f06,_0x351378){return db[_0xf655('0x23')][_0xf655('0x39')]({'where':{'id':_0x5b0f06[_0xf655('0x2e')]['id']}})['then'](handleEntityNotFound(_0x351378,null))[_0xf655('0x1b')](function(_0x6c2ee){if(_0x6c2ee){return _0x6c2ee[_0xf655('0x4d')](_0x5b0f06[_0xf655('0x3b')][_0xf655('0x3f')],_['omit'](_0x5b0f06['body'],[_0xf655('0x3f'),'id'])||{})['spread'](function(){return db[_0xf655('0x4e')][_0xf655('0x28')]({'attributes':['id',_0xf655('0x1f'),_0xf655('0x4f')],'where':{'id':_0x5b0f06['body'][_0xf655('0x3f')]}});})['then'](function(_0xaf22f){socket[_0xf655('0x50')](_0xf655('0x51'),{'id':Number(_0x5b0f06[_0xf655('0x2e')]['id']),'tags':_0xaf22f||[]});return{'id':Number(_0x5b0f06[_0xf655('0x2e')]['id']),'tags':_0xaf22f||[]};});}})[_0xf655('0x1b')](respondWithResult(_0x351378,null))['catch'](handleError(_0x351378,null));};exports[_0xf655('0x52')]=function(_0x45cc5b,_0x313630){return db[_0xf655('0x23')][_0xf655('0x39')]({'where':{'id':_0x45cc5b['params']['id']}})[_0xf655('0x1b')](handleEntityNotFound(_0x313630,null))['then'](function(_0x25e665){if(_0x25e665){return _0x25e665[_0xf655('0x52')](_0x45cc5b[_0xf655('0x2a')][_0xf655('0x3f')]);}})[_0xf655('0x1b')](respondWithStatusCode(_0x313630,null))[_0xf655('0x2b')](handleError(_0x313630,null));};exports[_0xf655('0x53')]=function(_0x146711,_0x127d86){var _0x4b5a79=moment()[_0xf655('0x54')]()[_0xf655('0x55')]();var _0x3f5ed5=path[_0xf655('0x56')](config[_0xf655('0x57')],_0xf655('0x58'),_0xf655('0x59'),_0xf655('0x5a'));var _0x3f062e=path['join'](config[_0xf655('0x57')],_0xf655('0x58'),_0xf655('0x59'),'attachments');var _0x3628d7=path[_0xf655('0x56')](_0x3f5ed5,_0x4b5a79);var _0x5d0e09=util['format'](_0xf655('0x5b'),_0x146711[_0xf655('0x2e')]['id'],_0x4b5a79);var _0x3345d7=path[_0xf655('0x56')](_0x3f5ed5,_0x5d0e09);var _0x1aeac1=[];_0x1aeac1[_0xf655('0x5c')]({'model':db[_0xf655('0x5d')],'as':_0xf655('0x5d'),'attributes':['id',_0xf655('0x5e')],'raw':!![]});_0x1aeac1[_0xf655('0x5c')]({'model':db[_0xf655('0x5f')],'as':_0xf655('0x60'),'attributes':['id',_0xf655('0x61'),_0xf655('0x62')],'raw':!![]});if(_0x146711[_0xf655('0x2a')][_0xf655('0x63')]){_0x1aeac1['push']({'model':db[_0xf655('0x64')],'as':'Attachment','raw':!![]});}var _0x3556b4=[{'model':db[_0xf655('0x3d')],'as':_0xf655('0x65'),'attributes':['id',_0xf655('0x3b'),_0xf655('0x66'),'direction',_0xf655('0x67'),'read'],'include':_0x1aeac1}];_0x3556b4[_0xf655('0x5c')]({'model':db[_0xf655('0x68')],'as':_0xf655('0x69'),'attributes':['id',_0xf655('0x1f')]});_0x3556b4[_0xf655('0x5c')]({'model':db[_0xf655('0x5d')],'as':'Owner','attributes':['id','fullname']});return db[_0xf655('0x23')]['find']({'where':{'id':_0x146711[_0xf655('0x2e')]['id']},'include':_0x3556b4})[_0xf655('0x1b')](handleEntityNotFound(_0x127d86,null))[_0xf655('0x1b')](function(_0x52c1cb){if(_0x52c1cb){var _0x6a5e1f=_0x52c1cb[_0xf655('0x6a')]({'plain':!![]});fs[_0xf655('0x6b')](_0x3628d7);var _0x3fcc9a={'channel':_0xf655('0x6c'),'account':_0x6a5e1f[_0xf655('0x69')][_0xf655('0x1f')],'agent':_0x6a5e1f[_0xf655('0x6d')]?_0x6a5e1f[_0xf655('0x6d')][_0xf655('0x5e')]:_0xf655('0x6e'),'createdAt':moment(_0x6a5e1f[_0xf655('0x66')])[_0xf655('0x4a')](_0xf655('0x4b'))[_0xf655('0x55')](),'closedAt':_0x6a5e1f[_0xf655('0x6f')]?moment(_0x6a5e1f[_0xf655('0x70')])[_0xf655('0x4a')](_0xf655('0x4b'))[_0xf655('0x55')]():'','disposition':_0x6a5e1f[_0xf655('0x71')],'visibility':_0x6a5e1f[_0xf655('0x72')]?'Public':_0xf655('0x73'),'messages':_(_0x6a5e1f[_0xf655('0x65')])[_0xf655('0x47')]({'secret':![]})[_0xf655('0x22')](function(_0x484f64){if(_0x484f64[_0xf655('0x64')]){var _0xb3209c=path[_0xf655('0x56')](_0x3f062e,_0x484f64['Attachment'][_0xf655('0x74')]);if(fs[_0xf655('0x75')](_0xb3209c)){fs[_0xf655('0x76')](_0xb3209c)[_0xf655('0x77')](fs[_0xf655('0x78')](path['join'](_0x3628d7,_0x484f64[_0xf655('0x64')][_0xf655('0x74')])));}}return{'date':moment(_0x484f64['createdAt'])[_0xf655('0x4a')](_0xf655('0x4b'))[_0xf655('0x55')](),'sender':_0x484f64[_0xf655('0x79')]===_0xf655('0x7a')?_0x484f64['User']?_0x484f64[_0xf655('0x5d')][_0xf655('0x5e')]:_0xf655('0x7b'):_0x484f64[_0xf655('0x60')][_0xf655('0x61')]+(_0x484f64['Contact'][_0xf655('0x62')]?'\x20'+_0x484f64[_0xf655('0x60')][_0xf655('0x62')]:''),'body':_0x484f64['Attachment']?_0x484f64[_0xf655('0x64')]['basename']:_0x484f64[_0xf655('0x3b')],'direction':_0x484f64[_0xf655('0x79')]==='out'?'A':'C','secret':_0x484f64[_0xf655('0x67')],'read':_0x484f64[_0xf655('0x7c')],'attachment':_0x484f64[_0xf655('0x64')]};})[_0xf655('0x7d')]()};return ejs['renderFile'](path[_0xf655('0x56')](config[_0xf655('0x57')],_0xf655('0x58'),_0xf655('0x7e'),_0xf655('0x7f')),{'interaction':_0x3fcc9a})[_0xf655('0x1b')](function(_0x5d81dd){var _0x4ce386=path[_0xf655('0x56')](_0x3628d7,_0xf655('0x80')+_0x6a5e1f['id']+'-'+_0x4b5a79+_0xf655('0x81'));var _0xc85a72={'path':_0x4ce386,'channel':'Openchannel','interactionId':_0x6a5e1f['id']};return pdf[_0xf655('0x82')](_0x5d81dd,_0xc85a72);})[_0xf655('0x1b')](function(){return new Promise(function(_0x3953a8,_0x40cbd0){zipdir(_0x3628d7,{'saveTo':_0x3345d7},function(_0x59e97d,_0x4f65c2){if(_0x59e97d)return _0x40cbd0(_0x59e97d);return _0x3953a8(_0x4f65c2);});})[_0xf655('0x1b')](function(){return new Promise(function(_0xc84347,_0x221ec2){rimraf(_0x3628d7,function(_0x2ea5a4){if(_0x2ea5a4)_0x221ec2(_0x2ea5a4);return _0xc84347();});});})[_0xf655('0x1b')](function(){return _0x127d86[_0xf655('0x53')](_0x3345d7,_0x5d0e09,function(_0x497afb){if(_0x497afb){logger[_0xf655('0x1d')]('Unable\x20to\x20delete\x20zip\x20file',_0x497afb);}else{fs[_0xf655('0x83')](_0x3345d7);}});});});}else{return _0x127d86['sendStatus'](0xc8);}})['catch'](handleError(_0x127d86,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 3bcaad8..c48b47a 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 _0xca8c=['Users','findAll','unreadMessages','length','catch','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','getUsers','setDataValue'];(function(_0x47ed6a,_0x5a80c8){var _0x18548a=function(_0x2ae717){while(--_0x2ae717){_0x47ed6a['push'](_0x47ed6a['shift']());}};_0x18548a(++_0x5a80c8);}(_0xca8c,0x107));var _0xcca8=function(_0x457919,_0x3471d3){_0x457919=_0x457919-0x0;var _0x4b774e=_0xca8c[_0x457919];return _0x4b774e;};'use strict';var EventEmitter=require(_0xcca8('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xcca8('0x1')];var OpenchannelMessage=require(_0xcca8('0x2'))['db'][_0xcca8('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xcca8('0x4')](0x0);var events={'afterCreate':_0xcca8('0x5'),'afterUpdate':'update','afterDestroy':_0xcca8('0x6')};function emitEvent(_0x4d6685){return function(_0x1fc005,_0x5b7a09,_0x8745d3){_0x1fc005[_0xcca8('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x29f52d){_0x1fc005[_0xcca8('0x8')](_0xcca8('0x9'),_0x29f52d['map'](function(_0xaa24d4){return{'id':_0xaa24d4['id']};}));return OpenchannelMessage[_0xcca8('0xa')]({'where':{'OpenchannelInteractionId':_0x1fc005['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x288617){_0x1fc005[_0xcca8('0x8')](_0xcca8('0xb'),_0x288617[_0xcca8('0xc')]);OpenchannelInteractionEvents['emit'](_0x4d6685+':'+_0x1fc005['id'],_0x1fc005);OpenchannelInteractionEvents['emit'](_0x4d6685,_0x1fc005);_0x8745d3(null);})[_0xcca8('0xd')](_0x8745d3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xcca8('0xe')](e,emitEvent(event));}}module[_0xcca8('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x50e0=['remove','getUsers','then','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x50e0,0x83));var _0x050e=function(_0x36bf4b,_0xdf86b3){_0x36bf4b=_0x36bf4b-0x0;var _0x51f460=_0x50e0[_0x36bf4b];return _0x51f460;};'use strict';var EventEmitter=require(_0x050e('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0x050e('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x050e('0x2')](0x0);var events={'afterCreate':_0x050e('0x3'),'afterUpdate':_0x050e('0x4'),'afterDestroy':_0x050e('0x5')};function emitEvent(_0x192622){return function(_0x42ac7d,_0x868f0,_0x418cbc){_0x42ac7d[_0x050e('0x6')]({'attributes':['id'],'raw':!![]})[_0x050e('0x7')](function(_0x579f75){_0x42ac7d['setDataValue']('Users',_0x579f75[_0x050e('0x8')](function(_0x26fa3f){return{'id':_0x26fa3f['id']};}));return OpenchannelMessage[_0x050e('0x9')]({'where':{'OpenchannelInteractionId':_0x42ac7d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x17642b){_0x42ac7d[_0x050e('0xa')]('unreadMessages',_0x17642b[_0x050e('0xb')]);OpenchannelInteractionEvents[_0x050e('0xc')](_0x192622+':'+_0x42ac7d['id'],_0x42ac7d);OpenchannelInteractionEvents[_0x050e('0xc')](_0x192622,_0x42ac7d);_0x418cbc(null);})[_0x050e('0xd')](_0x418cbc(null));};}for(var e in events){if(events[_0x050e('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x050e('0xf')](e,emitEvent(event));}}module[_0x050e('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index ee4223b..efa338b 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 _0x0755=['OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define'];(function(_0x3e618a,_0x135251){var _0x1f3d61=function(_0x12131b){while(--_0x12131b){_0x3e618a['push'](_0x3e618a['shift']());}};_0x1f3d61(++_0x135251);}(_0x0755,0x194));var _0x5075=function(_0x19f008,_0xbec22b){_0x19f008=_0x19f008-0x0;var _0xaa946b=_0x0755[_0x19f008];return _0xaa946b;};'use strict';var _=require(_0x5075('0x0'));var util=require(_0x5075('0x1'));var logger=require('../../config/logger')(_0x5075('0x2'));var moment=require('moment');var BPromise=require(_0x5075('0x3'));var rp=require(_0x5075('0x4'));var fs=require('fs');var path=require(_0x5075('0x5'));var rimraf=require(_0x5075('0x6'));var config=require(_0x5075('0x7'));var attributes=require(_0x5075('0x8'));module['exports']=function(_0x4139c4,_0x29c235){return _0x4139c4[_0x5075('0x9')](_0x5075('0xa'),attributes,{'tableName':_0x5075('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5075('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x141ef6,_0x3badd4,_0x827be8){if(_0x141ef6[_0x5075('0xd')](_0x5075('0xe'))){_0x141ef6[_0x5075('0xf')]=moment()[_0x5075('0x10')](_0x5075('0x11'));}_0x827be8(null,_0x141ef6);}}});}; \ No newline at end of file +var _0x0150=['exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes'];(function(_0x3fb5a8,_0x57d3f6){var _0x519841=function(_0x35c08a){while(--_0x35c08a){_0x3fb5a8['push'](_0x3fb5a8['shift']());}};_0x519841(++_0x57d3f6);}(_0x0150,0xc3));var _0x0015=function(_0x252874,_0x20f338){_0x252874=_0x252874-0x0;var _0x4761ad=_0x0150[_0x252874];return _0x4761ad;};'use strict';var _=require(_0x0015('0x0'));var util=require('util');var logger=require(_0x0015('0x1'))(_0x0015('0x2'));var moment=require(_0x0015('0x3'));var BPromise=require('bluebird');var rp=require(_0x0015('0x4'));var fs=require('fs');var path=require(_0x0015('0x5'));var rimraf=require(_0x0015('0x6'));var config=require(_0x0015('0x7'));var attributes=require(_0x0015('0x8'));module[_0x0015('0x9')]=function(_0x9cae87,_0x517d4e){return _0x9cae87['define'](_0x0015('0xa'),attributes,{'tableName':_0x0015('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0015('0xc'),'collate':_0x0015('0xd'),'hooks':{'beforeUpdate':function(_0x54f202,_0x45274e,_0x4030d2){if(_0x54f202['changed'](_0x0015('0xe'))){_0x54f202[_0x0015('0xf')]=moment()['format'](_0x0015('0x10'));}_0x4030d2(null,_0x54f202);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index a32dd89..95d2bad 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 _0xc431=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','catch','addTags','ids','omit','spread','AddTags','util','moment','bluebird'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xc431,0x197));var _0x1c43=function(_0x3fd2bd,_0x3b671b){_0x3fd2bd=_0x3fd2bd-0x0;var _0x1511cb=_0xc431[_0x3fd2bd];return _0x1511cb;};'use strict';var _=require('lodash');var util=require(_0x1c43('0x0'));var moment=require(_0x1c43('0x1'));var BPromise=require(_0x1c43('0x2'));var rs=require(_0x1c43('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c43('0x4'))['db'];var utils=require(_0x1c43('0x5'));var logger=require(_0x1c43('0x6'))(_0x1c43('0x7'));var config=require('../../config/environment');var jayson=require(_0x1c43('0x8'));var client=jayson[_0x1c43('0x9')][_0x1c43('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1c43('0xb')],{'host':_0x1c43('0xc'),'port':0x18eb});var socket=require(_0x1c43('0xd'))(new Redis(config[_0x1c43('0xb')]));require('./openchannelInteraction.socket')[_0x1c43('0xe')](socket);function respondWithRpcPromise(_0x5cc1e9,_0x1a1013,_0x168d0f){return new BPromise(function(_0x2f51c4,_0x4ebe93){return client[_0x1c43('0xf')](_0x5cc1e9,_0x168d0f)[_0x1c43('0x10')](function(_0x5975f5){logger[_0x1c43('0x11')](_0x1c43('0x12'),_0x1a1013,'request\x20sent');logger[_0x1c43('0x13')](_0x1c43('0x14'),_0x1a1013,_0x1c43('0x15'),JSON[_0x1c43('0x16')](_0x5975f5));if(_0x5975f5[_0x1c43('0x17')]){if(_0x5975f5[_0x1c43('0x17')][_0x1c43('0x18')]===0x1f4){logger[_0x1c43('0x17')](_0x1c43('0x12'),_0x1a1013,_0x5975f5['error']['message']);return _0x4ebe93(_0x5975f5['error']['message']);}logger[_0x1c43('0x17')](_0x1c43('0x12'),_0x1a1013,_0x5975f5[_0x1c43('0x17')][_0x1c43('0x19')]);return _0x2f51c4(_0x5975f5['error']['message']);}else{logger[_0x1c43('0x11')](_0x1c43('0x12'),_0x1a1013,_0x1c43('0x15'));_0x2f51c4(_0x5975f5[_0x1c43('0x1a')][_0x1c43('0x19')]);}})['catch'](function(_0x541854){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1a1013,_0x541854);_0x4ebe93(_0x541854);});});}exports[_0x1c43('0x1b')]=function(_0x141139){var _0x15579=this;return new Promise(function(_0x5ad9f8,_0x2f21c){return db[_0x1c43('0x1c')][_0x1c43('0x1d')](_0x141139[_0x1c43('0x1e')],{'raw':_0x141139[_0x1c43('0x1f')]?_0x141139[_0x1c43('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x141139[_0x1c43('0x1f')]?_0x141139[_0x1c43('0x1f')][_0x1c43('0x20')]||null:null,'attributes':_0x141139[_0x1c43('0x1f')]?_0x141139[_0x1c43('0x1f')][_0x1c43('0x21')]||null:null,'limit':_0x141139[_0x1c43('0x1f')]?_0x141139[_0x1c43('0x1f')][_0x1c43('0x22')]||null:null})[_0x1c43('0x10')](function(_0x35b749){logger[_0x1c43('0x11')](_0x1c43('0x1b'),_0x141139);logger[_0x1c43('0x13')](_0x1c43('0x1b'),_0x141139,JSON[_0x1c43('0x16')](_0x35b749));_0x5ad9f8(_0x35b749);})[_0x1c43('0x23')](function(_0x484482){logger[_0x1c43('0x17')](_0x1c43('0x1b'),_0x484482[_0x1c43('0x19')],_0x141139);_0x2f21c(_0x15579['error'](0x1f4,_0x484482['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x446d0c){return new Promise(function(_0x5d825a,_0x29b5c4){return db[_0x1c43('0x1c')]['find']({'where':_0x446d0c[_0x1c43('0x1f')]?_0x446d0c['options'][_0x1c43('0x20')]||null:null})['then'](function(_0x499b6d){if(_0x499b6d){return _0x499b6d[_0x1c43('0x24')](_0x446d0c[_0x1c43('0x1e')][_0x1c43('0x25')],_[_0x1c43('0x26')](_0x446d0c[_0x1c43('0x1e')],['ids','id'])||{});}})[_0x1c43('0x27')](function(_0x261df3){logger[_0x1c43('0x11')](_0x1c43('0x28'),_0x446d0c);logger[_0x1c43('0x13')](_0x1c43('0x28'),_0x446d0c,JSON[_0x1c43('0x16')](_0x261df3));_0x5d825a(_0x261df3);})[_0x1c43('0x23')](function(_0x574c3c){logger[_0x1c43('0x17')](_0x1c43('0x28'),_0x574c3c['message'],_0x446d0c);_0x29b5c4(_this[_0x1c43('0x17')](0x1f4,_0x574c3c[_0x1c43('0x19')]));});});}; \ No newline at end of file +var _0xb29b=['then','UpdateOpenchannelInteraction','stringify','catch','OpenchannelInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','body','options','raw','where','limit'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xb29b,0x8b));var _0xbb29=function(_0x376e54,_0x224b13){_0x376e54=_0x376e54-0x0;var _0x49da65=_0xb29b[_0x376e54];return _0x49da65;};'use strict';var _=require(_0xbb29('0x0'));var util=require(_0xbb29('0x1'));var moment=require(_0xbb29('0x2'));var BPromise=require(_0xbb29('0x3'));var rs=require(_0xbb29('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb29('0x5'))['db'];var utils=require(_0xbb29('0x6'));var logger=require(_0xbb29('0x7'))('rpc');var config=require(_0xbb29('0x8'));var jayson=require(_0xbb29('0x9'));var client=jayson[_0xbb29('0xa')][_0xbb29('0xb')]({'port':0x232a});config['redis']=_[_0xbb29('0xc')](config[_0xbb29('0xd')],{'host':_0xbb29('0xe'),'port':0x18eb});var socket=require(_0xbb29('0xf'))(new Redis(config[_0xbb29('0xd')]));require(_0xbb29('0x10'))[_0xbb29('0x11')](socket);function respondWithRpcPromise(_0x27984d,_0x1b3cff,_0x20ea33){return new BPromise(function(_0x34698d,_0x125c03){return client[_0xbb29('0x12')](_0x27984d,_0x20ea33)['then'](function(_0x3eca90){logger[_0xbb29('0x13')](_0xbb29('0x14'),_0x1b3cff,_0xbb29('0x15'));logger[_0xbb29('0x16')](_0xbb29('0x17'),_0x1b3cff,'request\x20sent',JSON['stringify'](_0x3eca90));if(_0x3eca90['error']){if(_0x3eca90[_0xbb29('0x18')][_0xbb29('0x19')]===0x1f4){logger['error'](_0xbb29('0x14'),_0x1b3cff,_0x3eca90[_0xbb29('0x18')][_0xbb29('0x1a')]);return _0x125c03(_0x3eca90[_0xbb29('0x18')][_0xbb29('0x1a')]);}logger[_0xbb29('0x18')](_0xbb29('0x14'),_0x1b3cff,_0x3eca90[_0xbb29('0x18')][_0xbb29('0x1a')]);return _0x34698d(_0x3eca90[_0xbb29('0x18')][_0xbb29('0x1a')]);}else{logger[_0xbb29('0x13')](_0xbb29('0x14'),_0x1b3cff,_0xbb29('0x15'));_0x34698d(_0x3eca90[_0xbb29('0x1b')][_0xbb29('0x1a')]);}})['catch'](function(_0x389d73){logger[_0xbb29('0x18')](_0xbb29('0x14'),_0x1b3cff,_0x389d73);_0x125c03(_0x389d73);});});}exports['UpdateOpenchannelInteraction']=function(_0x351224){var _0x5e5aa5=this;return new Promise(function(_0x66c815,_0x12f6c5){return db['OpenchannelInteraction']['update'](_0x351224[_0xbb29('0x1c')],{'raw':_0x351224[_0xbb29('0x1d')]?_0x351224['options'][_0xbb29('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x351224[_0xbb29('0x1d')]?_0x351224['options'][_0xbb29('0x1f')]||null:null,'attributes':_0x351224[_0xbb29('0x1d')]?_0x351224['options']['attributes']||null:null,'limit':_0x351224[_0xbb29('0x1d')]?_0x351224[_0xbb29('0x1d')][_0xbb29('0x20')]||null:null})[_0xbb29('0x21')](function(_0x27b6e6){logger[_0xbb29('0x13')]('UpdateOpenchannelInteraction',_0x351224);logger[_0xbb29('0x16')](_0xbb29('0x22'),_0x351224,JSON[_0xbb29('0x23')](_0x27b6e6));_0x66c815(_0x27b6e6);})[_0xbb29('0x24')](function(_0x25fc34){logger[_0xbb29('0x18')](_0xbb29('0x22'),_0x25fc34[_0xbb29('0x1a')],_0x351224);_0x12f6c5(_0x5e5aa5[_0xbb29('0x18')](0x1f4,_0x25fc34[_0xbb29('0x1a')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x71e711){return new Promise(function(_0xa960ac,_0x4e70c0){return db[_0xbb29('0x25')]['find']({'where':_0x71e711[_0xbb29('0x1d')]?_0x71e711[_0xbb29('0x1d')][_0xbb29('0x1f')]||null:null})[_0xbb29('0x21')](function(_0x12fa91){if(_0x12fa91){return _0x12fa91[_0xbb29('0x26')](_0x71e711[_0xbb29('0x1c')][_0xbb29('0x27')],_[_0xbb29('0x28')](_0x71e711[_0xbb29('0x1c')],[_0xbb29('0x27'),'id'])||{});}})[_0xbb29('0x29')](function(_0x2d5211){logger['info']('AddTags',_0x71e711);logger[_0xbb29('0x16')](_0xbb29('0x2a'),_0x71e711,JSON[_0xbb29('0x23')](_0x2d5211));_0xa960ac(_0x2d5211);})['catch'](function(_0x53b196){logger[_0xbb29('0x18')](_0xbb29('0x2a'),_0x53b196[_0xbb29('0x1a')],_0x71e711);_0x4e70c0(_this['error'](0x1f4,_0x53b196[_0xbb29('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index e0a5987..e5fbc84 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 _0x474e=['register','length','openchannelInteraction:','save','remove','emit'];(function(_0x5ab930,_0x4f0129){var _0x59f5cb=function(_0x5dfd94){while(--_0x5dfd94){_0x5ab930['push'](_0x5ab930['shift']());}};_0x59f5cb(++_0x4f0129);}(_0x474e,0x9f));var _0xe474=function(_0xbd9065,_0x1b6de8){_0xbd9065=_0xbd9065-0x0;var _0x5d0e59=_0x474e[_0xbd9065];return _0x5d0e59;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xe474('0x0'),_0xe474('0x1'),'update'];function createListener(_0x1f162b,_0xeeb477){return function(_0x5235e4){_0xeeb477[_0xe474('0x2')](_0x1f162b,_0x5235e4);};}function removeListener(_0x7538d1,_0x587b4e){return function(){OpenchannelInteractionEvents['removeListener'](_0x7538d1,_0x587b4e);};}exports[_0xe474('0x3')]=function(_0x5183be){for(var _0x1faec3=0x0,_0x4c719b=events[_0xe474('0x4')];_0x1faec3<_0x4c719b;_0x1faec3++){var _0x3e670b=events[_0x1faec3];var _0x1ed0c6=createListener(_0xe474('0x5')+_0x3e670b,_0x5183be);OpenchannelInteractionEvents['on'](_0x3e670b,_0x1ed0c6);}}; \ No newline at end of file +var _0x9332=['register','openchannelInteraction:','save','remove','update','removeListener'];(function(_0x3bf96e,_0xa94f5a){var _0x2b9a71=function(_0x196bf2){while(--_0x196bf2){_0x3bf96e['push'](_0x3bf96e['shift']());}};_0x2b9a71(++_0xa94f5a);}(_0x9332,0x188));var _0x2933=function(_0x1f5890,_0x599bd3){_0x1f5890=_0x1f5890-0x0;var _0x5dde01=_0x9332[_0x1f5890];return _0x5dde01;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x2933('0x0'),_0x2933('0x1'),_0x2933('0x2')];function createListener(_0xca47e,_0x427b48){return function(_0x3044d1){_0x427b48['emit'](_0xca47e,_0x3044d1);};}function removeListener(_0x65078a,_0xd8d3e5){return function(){OpenchannelInteractionEvents[_0x2933('0x3')](_0x65078a,_0xd8d3e5);};}exports[_0x2933('0x4')]=function(_0x3dc8d4){for(var _0x23015d=0x0,_0x133c34=events['length'];_0x23015d<_0x133c34;_0x23015d++){var _0x10da0c=events[_0x23015d];var _0x539fe6=createListener(_0x2933('0x5')+_0x10da0c,_0x3dc8d4);OpenchannelInteractionEvents['on'](_0x10da0c,_0x539fe6);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 74e63ec..8521b11 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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x111ba1,_0x3abd25){_0x111ba1=_0x111ba1-0x0;var _0x5905ba=_0x70e0[_0x111ba1];return _0x5905ba;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x1ccc12,_0x561b44){_0x1ccc12=_0x1ccc12-0x0;var _0x1bdbdd=_0x70e0[_0x1ccc12];return _0x1bdbdd;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 8397a8a..facf809 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 _0xcf66=['exports','TEXT','BOOLEAN','out','DATE','sequelize'];(function(_0x1eaf6c,_0x545058){var _0x259163=function(_0x28b3f0){while(--_0x28b3f0){_0x1eaf6c['push'](_0x1eaf6c['shift']());}};_0x259163(++_0x545058);}(_0xcf66,0x71));var _0x6cf6=function(_0x252db4,_0x3e8db7){_0x252db4=_0x252db4-0x0;var _0x4bb326=_0xcf66[_0x252db4];return _0x4bb326;};'use strict';var Sequelize=require(_0x6cf6('0x0'));module[_0x6cf6('0x1')]={'body':{'type':Sequelize[_0x6cf6('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6cf6('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6cf6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x6cf6('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x6cf6('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x6cf6('0x2')]}}; \ No newline at end of file +var _0x9a2d=['out','DATE','STRING','TEXT','BOOLEAN','ENUM'];(function(_0x802aae,_0x3403f2){var _0x35dc0c=function(_0x20d621){while(--_0x20d621){_0x802aae['push'](_0x802aae['shift']());}};_0x35dc0c(++_0x3403f2);}(_0x9a2d,0x123));var _0xd9a2=function(_0x2320b5,_0x4ca182){_0x2320b5=_0x2320b5-0x0;var _0x1a302a=_0x9a2d[_0x2320b5];return _0x1a302a;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd9a2('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd9a2('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd9a2('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9a2('0x2')]('in',_0xd9a2('0x3')),'defaultValue':_0xd9a2('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd9a2('0x4')]},'providerName':{'type':Sequelize[_0xd9a2('0x5')]},'providerResponse':{'type':Sequelize[_0xd9a2('0x0')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 334fbad..b1acd2b 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 _0x2ea5=['intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','create','body','params','find','describe','accept','openchannel','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','openchannel-interactions','role','ContactId','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','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','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','name','send','index','OpenchannelMessage','rawAttributes','type','key','model','map','query','keys','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ea5,0x1c1));var _0x52ea=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2ea5[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x52ea('0x0'));var rimraf=require(_0x52ea('0x1'));var zipdir=require(_0x52ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x52ea('0x3'));var moment=require(_0x52ea('0x4'));var BPromise=require(_0x52ea('0x5'));var Mustache=require(_0x52ea('0x6'));var util=require('util');var path=require(_0x52ea('0x7'));var sox=require(_0x52ea('0x8'));var csv=require('to-csv');var ejs=require(_0x52ea('0x9'));var fs=require('fs');var fs_extra=require(_0x52ea('0xa'));var _=require('lodash');var squel=require(_0x52ea('0xb'));var crypto=require(_0x52ea('0xc'));var jsforce=require(_0x52ea('0xd'));var deskjs=require(_0x52ea('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x52ea('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x52ea('0x10'));var as=require(_0x52ea('0x11'));var hardwareService=require(_0x52ea('0x12'));var logger=require('../../config/logger')(_0x52ea('0x13'));var utils=require(_0x52ea('0x14'));var config=require(_0x52ea('0x15'));var licenseUtil=require(_0x52ea('0x16'));var db=require(_0x52ea('0x17'))['db'];config[_0x52ea('0x18')]=_[_0x52ea('0x19')](config[_0x52ea('0x18')],{'host':_0x52ea('0x1a'),'port':0x18eb});var socket=require(_0x52ea('0x1b'))(new Redis(config[_0x52ea('0x18')]));require(_0x52ea('0x1c'))[_0x52ea('0x1d')](socket);var jayson=require(_0x52ea('0x1e'));var client=jayson[_0x52ea('0x1f')][_0x52ea('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31c1d8,_0x645bec,_0x597f6c,_0x5ddaaa){return new BPromise(function(_0x962025,_0x5ec049){var _0x371352=_0x5ddaaa||client;return _0x371352[_0x52ea('0x21')](_0x31c1d8,_0x597f6c)[_0x52ea('0x22')](function(_0x2f0524){logger[_0x52ea('0x23')](_0x52ea('0x24'),_0x645bec,'request\x20sent');logger['debug'](_0x52ea('0x25'),_0x645bec,_0x52ea('0x26'),JSON[_0x52ea('0x27')](_0x2f0524));if(_0x2f0524[_0x52ea('0x28')]){if(_0x2f0524[_0x52ea('0x28')][_0x52ea('0x29')]===0x1f4){logger[_0x52ea('0x28')](_0x52ea('0x24'),_0x645bec,_0x2f0524['error'][_0x52ea('0x2a')]);return _0x5ec049(_0x2f0524['error']['message']);}logger[_0x52ea('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x645bec,_0x2f0524[_0x52ea('0x28')][_0x52ea('0x2a')]);return _0x962025(_0x2f0524['error'][_0x52ea('0x2a')]);}else{logger[_0x52ea('0x23')](_0x52ea('0x24'),_0x645bec,'request\x20sent');_0x962025(_0x2f0524[_0x52ea('0x2b')][_0x52ea('0x2a')]);}})[_0x52ea('0x2c')](function(_0x3a94c8){logger[_0x52ea('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x645bec,_0x3a94c8);_0x5ec049(_0x3a94c8);});});}function respondWithStatusCode(_0x100165,_0x33e0a4){_0x33e0a4=_0x33e0a4||0xcc;return function(_0x1025f0){if(_0x1025f0){return _0x100165[_0x52ea('0x2d')](_0x33e0a4);}return _0x100165['status'](_0x33e0a4)[_0x52ea('0x2e')]();};}function respondWithResult(_0x578bac,_0x1653da){_0x1653da=_0x1653da||0xc8;return function(_0x121a98){if(_0x121a98){return _0x578bac[_0x52ea('0x2f')](_0x1653da)[_0x52ea('0x30')](_0x121a98);}};}function respondWithFilteredResult(_0x2f81c1,_0x3bc8af){return function(_0x1b0ec9){if(_0x1b0ec9){var _0x46c4cd=typeof _0x3bc8af['offset']===_0x52ea('0x31')&&typeof _0x3bc8af[_0x52ea('0x32')]==='undefined';var _0x2db0cb=_0x1b0ec9[_0x52ea('0x33')];var _0x4857a5=_0x46c4cd?0x0:_0x3bc8af[_0x52ea('0x34')];var _0x511a28=_0x46c4cd?_0x1b0ec9['count']:_0x3bc8af['offset']+_0x3bc8af[_0x52ea('0x32')];var _0x3408dc;if(_0x511a28>=_0x2db0cb){_0x511a28=_0x2db0cb;_0x3408dc=0xc8;}else{_0x3408dc=0xce;}_0x2f81c1[_0x52ea('0x2f')](_0x3408dc);return _0x2f81c1['set'](_0x52ea('0x35'),_0x4857a5+'-'+_0x511a28+'/'+_0x2db0cb)['json'](_0x1b0ec9);}return null;};}function patchUpdates(_0x536ecd){return function(_0x43a464){try{jsonpatch[_0x52ea('0x36')](_0x43a464,_0x536ecd,!![]);}catch(_0x2e31e3){return BPromise[_0x52ea('0x37')](_0x2e31e3);}return _0x43a464[_0x52ea('0x38')]();};}function saveUpdates(_0x42ea7d,_0x3ed912){return function(_0x24c98f){if(_0x24c98f){return _0x24c98f[_0x52ea('0x39')](_0x42ea7d)['then'](function(_0x1c5167){return _0x1c5167;});}return null;};}function removeEntity(_0x3078f7,_0x24dff5){return function(_0x46c16c){if(_0x46c16c){return _0x46c16c[_0x52ea('0x3a')]()[_0x52ea('0x22')](function(){_0x3078f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x366b57,_0xa56519){return function(_0x520495){if(!_0x520495){_0x366b57[_0x52ea('0x2d')](0x194);}return _0x520495;};}function handleError(_0x2059b0,_0x171ad7){_0x171ad7=_0x171ad7||0x1f4;return function(_0x37ba89){logger['error'](_0x37ba89['stack']);if(_0x37ba89[_0x52ea('0x3b')]){delete _0x37ba89[_0x52ea('0x3b')];}_0x2059b0[_0x52ea('0x2f')](_0x171ad7)[_0x52ea('0x3c')](_0x37ba89);};}exports[_0x52ea('0x3d')]=function(_0xad3ac0,_0x266339){var _0x4f9fa7={},_0x2f68e8={},_0x20e1ef={'count':0x0,'rows':[]};var _0x1ca1f2=_['map'](db[_0x52ea('0x3e')][_0x52ea('0x3f')],function(_0x1287db){return{'name':_0x1287db['fieldName'],'type':_0x1287db[_0x52ea('0x40')][_0x52ea('0x41')]};});_0x2f68e8[_0x52ea('0x42')]=_[_0x52ea('0x43')](_0x1ca1f2,_0x52ea('0x3b'));_0x2f68e8[_0x52ea('0x44')]=_[_0x52ea('0x45')](_0xad3ac0[_0x52ea('0x44')]);_0x2f68e8[_0x52ea('0x46')]=_[_0x52ea('0x47')](_0x2f68e8['model'],_0x2f68e8[_0x52ea('0x44')]);_0x4f9fa7[_0x52ea('0x48')]=_[_0x52ea('0x47')](_0x2f68e8[_0x52ea('0x42')],qs[_0x52ea('0x49')](_0xad3ac0['query'][_0x52ea('0x49')]));_0x4f9fa7[_0x52ea('0x48')]=_0x4f9fa7[_0x52ea('0x48')][_0x52ea('0x4a')]?_0x4f9fa7[_0x52ea('0x48')]:_0x2f68e8[_0x52ea('0x42')];if(!_0xad3ac0[_0x52ea('0x44')][_0x52ea('0x4b')]('nolimit')){_0x4f9fa7[_0x52ea('0x32')]=qs[_0x52ea('0x32')](_0xad3ac0[_0x52ea('0x44')][_0x52ea('0x32')]);_0x4f9fa7[_0x52ea('0x34')]=qs[_0x52ea('0x34')](_0xad3ac0[_0x52ea('0x44')][_0x52ea('0x34')]);}_0x4f9fa7[_0x52ea('0x4c')]=qs[_0x52ea('0x4d')](_0xad3ac0[_0x52ea('0x44')][_0x52ea('0x4d')]);_0x4f9fa7[_0x52ea('0x4e')]=qs[_0x52ea('0x46')](_[_0x52ea('0x4f')](_0xad3ac0[_0x52ea('0x44')],_0x2f68e8[_0x52ea('0x46')]),_0x1ca1f2);if(_0xad3ac0['query'][_0x52ea('0x50')]){_0x4f9fa7[_0x52ea('0x4e')]=_[_0x52ea('0x51')](_0x4f9fa7[_0x52ea('0x4e')],{'$or':_[_0x52ea('0x43')](_0x1ca1f2,function(_0x407033){if(_0x407033['type']!==_0x52ea('0x52')){var _0x3512f9={};_0x3512f9[_0x407033[_0x52ea('0x3b')]]={'$like':'%'+_0xad3ac0[_0x52ea('0x44')][_0x52ea('0x50')]+'%'};return _0x3512f9;}})});}_0x4f9fa7=_[_0x52ea('0x51')]({},_0x4f9fa7,_0xad3ac0['options']);var _0x2dd3f8={'where':_0x4f9fa7[_0x52ea('0x4e')]};return db[_0x52ea('0x3e')][_0x52ea('0x33')](_0x2dd3f8)[_0x52ea('0x22')](function(_0x3bb70c){_0x20e1ef[_0x52ea('0x33')]=_0x3bb70c;if(_0xad3ac0[_0x52ea('0x44')][_0x52ea('0x53')]){_0x4f9fa7[_0x52ea('0x54')]=[{'all':!![]}];}return db[_0x52ea('0x3e')][_0x52ea('0x55')](_0x4f9fa7);})['then'](function(_0x46d482){_0x20e1ef[_0x52ea('0x56')]=_0x46d482;return _0x20e1ef;})['then'](respondWithFilteredResult(_0x266339,_0x4f9fa7))[_0x52ea('0x2c')](handleError(_0x266339,null));};exports[_0x52ea('0x57')]=function(_0x5a6b6d,_0x481b4b){var _0x50bdb7={'raw':!![],'where':{'id':_0x5a6b6d['params']['id']}},_0xaf0398={};_0xaf0398[_0x52ea('0x42')]=_[_0x52ea('0x45')](db['OpenchannelMessage'][_0x52ea('0x3f')]);_0xaf0398[_0x52ea('0x44')]=_[_0x52ea('0x45')](_0x5a6b6d['query']);_0xaf0398['filters']=_['intersection'](_0xaf0398[_0x52ea('0x42')],_0xaf0398[_0x52ea('0x44')]);_0x50bdb7[_0x52ea('0x48')]=_[_0x52ea('0x47')](_0xaf0398['model'],qs[_0x52ea('0x49')](_0x5a6b6d[_0x52ea('0x44')][_0x52ea('0x49')]));_0x50bdb7[_0x52ea('0x48')]=_0x50bdb7[_0x52ea('0x48')]['length']?_0x50bdb7[_0x52ea('0x48')]:_0xaf0398['model'];if(_0x5a6b6d[_0x52ea('0x44')][_0x52ea('0x53')]){_0x50bdb7['include']=[{'all':!![]}];}_0x50bdb7=_['merge']({},_0x50bdb7,_0x5a6b6d[_0x52ea('0x58')]);return db['OpenchannelMessage']['find'](_0x50bdb7)[_0x52ea('0x22')](handleEntityNotFound(_0x481b4b,null))[_0x52ea('0x22')](respondWithResult(_0x481b4b,null))[_0x52ea('0x2c')](handleError(_0x481b4b,null));};exports[_0x52ea('0x59')]=function(_0x36185c,_0x2db153){return db[_0x52ea('0x3e')][_0x52ea('0x59')](_0x36185c[_0x52ea('0x5a')],{})[_0x52ea('0x22')](respondWithResult(_0x2db153,0xc9))[_0x52ea('0x2c')](handleError(_0x2db153,null));};exports[_0x52ea('0x39')]=function(_0x53ba5c,_0x224377){if(_0x53ba5c[_0x52ea('0x5a')]['id']){delete _0x53ba5c[_0x52ea('0x5a')]['id'];}return db[_0x52ea('0x3e')]['find']({'where':{'id':_0x53ba5c[_0x52ea('0x5b')]['id']}})[_0x52ea('0x22')](handleEntityNotFound(_0x224377,null))[_0x52ea('0x22')](saveUpdates(_0x53ba5c['body'],null))[_0x52ea('0x22')](respondWithResult(_0x224377,null))[_0x52ea('0x2c')](handleError(_0x224377,null));};exports['destroy']=function(_0x4269d5,_0x5c9c68){return db[_0x52ea('0x3e')][_0x52ea('0x5c')]({'where':{'id':_0x4269d5[_0x52ea('0x5b')]['id']}})[_0x52ea('0x22')](handleEntityNotFound(_0x5c9c68,null))[_0x52ea('0x22')](removeEntity(_0x5c9c68,null))[_0x52ea('0x2c')](handleError(_0x5c9c68,null));};exports['describe']=function(_0x1468b7,_0x3be935){return db[_0x52ea('0x3e')][_0x52ea('0x5d')]()[_0x52ea('0x22')](respondWithResult(_0x3be935,null))[_0x52ea('0x2c')](handleError(_0x3be935,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x52ea('0x5e')]=function(_0x4c9511,_0x3d5065,_0x2c9d07){var _0x2f798f={'agent':{},'channel':_0x52ea('0x5f')};if(_0x4c9511[_0x52ea('0x5a')]['id']){delete _0x4c9511[_0x52ea('0x5a')]['id'];}_0x4c9511['body']['read']=!![];_0x4c9511['body']['readAt']=moment()['format'](_0x52ea('0x60'));_0x4c9511[_0x52ea('0x5a')]['UserId']=_0x4c9511[_0x52ea('0x5a')][_0x52ea('0x61')]||_0x4c9511[_0x52ea('0x62')]['id'];_0x2f798f[_0x52ea('0x63')]['id']=_0x4c9511[_0x52ea('0x5a')][_0x52ea('0x61')];return db['OpenchannelMessage']['find']({'where':{'id':_0x4c9511[_0x52ea('0x5b')]['id'],'UserId':null}})[_0x52ea('0x22')](handleEntityNotFound(_0x3d5065,null))[_0x52ea('0x22')](saveUpdates(_0x4c9511[_0x52ea('0x5a')],null))[_0x52ea('0x22')](function(_0x30e42f){if(_0x30e42f){_0x2f798f[_0x52ea('0x2a')]=_0x30e42f[_0x52ea('0x64')]({'plain':!![]});return db[_0x52ea('0x65')]['find']({'where':{'id':_0x30e42f[_0x52ea('0x66')]}});}return null;})[_0x52ea('0x22')](handleEntityNotFound(_0x3d5065,null))['then'](function(_0x569b68){if(_0x569b68){return _0x569b68['update']({'UserId':_0x4c9511[_0x52ea('0x5a')][_0x52ea('0x61')],'read1stAt':_[_0x52ea('0x67')](_0x569b68[_0x52ea('0x68')])?moment()[_0x52ea('0x69')](_0x52ea('0x60')):undefined});}return null;})[_0x52ea('0x22')](function(_0x5fc40d){if(_0x5fc40d){_0x2f798f['interaction']=_0x5fc40d['get']({'plain':!![]});interaction_log[_0x52ea('0x23')](_0x52ea('0x6a'),_0x4c9511[_0x52ea('0x62')]['id'],_0x4c9511[_0x52ea('0x62')]['name'],_0x4c9511[_0x52ea('0x62')]['role'],_0x2f798f[_0x52ea('0x6b')]['id'],_0x4c9511[_0x52ea('0x5a')]?JSON[_0x52ea('0x27')](_0x4c9511['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x52ea('0x6c'),_0x2f798f);}return null;})['then'](function(_0x346182){var _0x1b735f=_0x52ea('0x6d')+_0x346182[_0x52ea('0x2a')]['ContactId'];return db[_0x52ea('0x6e')][_0x52ea('0x44')](_0x1b735f,{'type':db[_0x52ea('0x6f')][_0x52ea('0x70')][_0x52ea('0x71')],'raw':!![]})[_0x52ea('0x22')](function(_0x36ac5b){return _0x36ac5b;});})[_0x52ea('0x22')](function(_0x127520){if(_0x127520){_0x2f798f[_0x52ea('0x2a')][_0x52ea('0x72')]=_0x127520[0x0];if(!_0x4c9511[_0x52ea('0x5a')][_0x52ea('0x61')])return;return db[_0x52ea('0x73')][_0x52ea('0x5c')]({'where':{'id':_0x4c9511[_0x52ea('0x5a')][_0x52ea('0x61')],'role':_0x52ea('0x63')},'attributes':['id',_0x52ea('0x3b'),_0x52ea('0x74'),_0x52ea('0x75'),_0x52ea('0x76')],'raw':!![]});}return null;})[_0x52ea('0x22')](function(_0x536cd7){if(!_0x536cd7)return null;_0x2f798f[_0x52ea('0x2a')][_0x52ea('0x63')]=_0x536cd7;return _0x2f798f;})[_0x52ea('0x22')](function(_0x379d2b){if(_0x379d2b){if(_0x4c9511[_0x52ea('0x5a')][_0x52ea('0x77')]){_0x2f798f['message'][_0x52ea('0x78')]=util[_0x52ea('0x69')](_0x52ea('0x79'),_0x4c9511[_0x52ea('0x62')][_0x52ea('0x3b')]);_0x2f798f['message'][_0x52ea('0x7a')]=_0x2f798f[_0x52ea('0x7a')];_0x2f798f[_0x52ea('0x2a')]['motionChannel']=_0x2f798f[_0x52ea('0x7a')];_0x2f798f['message'][_0x52ea('0x7b')]=_0x52ea('0x5e');return respondWithRpcPromise(_0x52ea('0x7c'),_0x52ea('0x7c'),{'event':'acceptmessage','message':_0x2f798f['message']},client9002)[_0x52ea('0x22')](function(){return _0x2f798f;});}return _0x2f798f;}return null;})[_0x52ea('0x22')](respondWithResult(_0x3d5065,null))[_0x52ea('0x2c')](handleError(_0x3d5065,null));};var interaction_log=require('../../config/logger')(_0x52ea('0x7d'));exports[_0x52ea('0x37')]=function(_0x2a5a32,_0x2a7841,_0xd55692){var _0x301825={'agent':{},'channel':_0x52ea('0x5f')};if(_0x2a5a32[_0x52ea('0x5a')]['id']){delete _0x2a5a32[_0x52ea('0x5a')]['id'];}_0x2a5a32[_0x52ea('0x5a')][_0x52ea('0x61')]=_0x2a5a32[_0x52ea('0x5a')][_0x52ea('0x61')]||_0x2a5a32[_0x52ea('0x62')]['id'];_0x301825[_0x52ea('0x63')]['id']=_0x2a5a32[_0x52ea('0x5a')]['UserId'];return db[_0x52ea('0x3e')][_0x52ea('0x5c')]({'where':{'id':_0x2a5a32['params']['id'],'UserId':null}})[_0x52ea('0x22')](handleEntityNotFound(_0x2a7841,null))['then'](function(_0xb67e36){if(_0xb67e36){_0x301825[_0x52ea('0x2a')]=_0xb67e36['get']({'plain':!![]});return db[_0x52ea('0x65')][_0x52ea('0x5c')]({'where':{'id':_0xb67e36[_0x52ea('0x66')]}});}return null;})[_0x52ea('0x22')](handleEntityNotFound(_0x2a7841,null))[_0x52ea('0x22')](function(_0x45ef35){if(_0x45ef35){_0x301825[_0x52ea('0x6b')]=_0x45ef35[_0x52ea('0x64')]({'plain':!![]});interaction_log[_0x52ea('0x23')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2a5a32[_0x52ea('0x62')]['id'],_0x2a5a32[_0x52ea('0x62')]['name'],_0x2a5a32[_0x52ea('0x62')][_0x52ea('0x7e')],_0x301825[_0x52ea('0x6b')]['id'],_0x2a5a32[_0x52ea('0x5a')]?JSON['stringify'](_0x2a5a32[_0x52ea('0x5a')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x301825);}return null;})[_0x52ea('0x22')](function(_0x5e5699){var _0x50fb4d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e5699[_0x52ea('0x2a')][_0x52ea('0x7f')];return db[_0x52ea('0x6e')][_0x52ea('0x44')](_0x50fb4d,{'type':db[_0x52ea('0x6f')][_0x52ea('0x70')][_0x52ea('0x71')],'raw':!![]})[_0x52ea('0x22')](function(_0x100450){return _0x100450;});})['then'](function(_0x186b35){if(_0x186b35){_0x301825[_0x52ea('0x2a')]['contact']=_0x186b35[0x0];if(!_0x2a5a32[_0x52ea('0x5a')][_0x52ea('0x61')])return;return db[_0x52ea('0x73')][_0x52ea('0x5c')]({'where':{'id':_0x2a5a32[_0x52ea('0x5a')][_0x52ea('0x61')],'role':_0x52ea('0x63')},'attributes':['id',_0x52ea('0x3b'),_0x52ea('0x74'),_0x52ea('0x75'),_0x52ea('0x76')],'raw':!![]});}return null;})['then'](function(_0x33cd1d){if(!_0x33cd1d)return null;_0x301825['message'][_0x52ea('0x63')]=_0x33cd1d;return _0x301825;})[_0x52ea('0x22')](function(_0x45140b){if(_0x45140b){_0x45140b[_0x52ea('0x2a')]['interface']=util[_0x52ea('0x69')](_0x52ea('0x79'),_0x2a5a32[_0x52ea('0x62')][_0x52ea('0x3b')]);_0x45140b[_0x52ea('0x2a')][_0x52ea('0x7a')]=_0x301825[_0x52ea('0x7a')];_0x45140b[_0x52ea('0x2a')][_0x52ea('0x80')]=_0x301825[_0x52ea('0x7a')];_0x45140b[_0x52ea('0x2a')]['event']=_0x52ea('0x37');respondWithRpcPromise(_0x52ea('0x7c'),'EventManager',{'event':_0x52ea('0x81'),'message':_0x45140b[_0x52ea('0x2a')]},client9002);return _0x301825;}return null;})[_0x52ea('0x22')](respondWithResult(_0x2a7841,null))[_0x52ea('0x2c')](handleError(_0x2a7841,null));}; \ No newline at end of file +var _0x6bb0=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./openchannelMessage.socket','register','client','http','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','map','OpenchannelMessage','fieldName','type','model','name','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','params','keys','rawAttributes','intersection','include','find','create','body','describe','openchannel-interactions','accept','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','rejectmessage','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x6bb0,0x6f));var _0x06bb=function(_0x2b3207,_0x4192a7){_0x2b3207=_0x2b3207-0x0;var _0x7977b6=_0x6bb0[_0x2b3207];return _0x7977b6;};'use strict';var emlformat=require(_0x06bb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x06bb('0x1'));var BPromise=require(_0x06bb('0x2'));var Mustache=require(_0x06bb('0x3'));var util=require(_0x06bb('0x4'));var path=require(_0x06bb('0x5'));var sox=require(_0x06bb('0x6'));var csv=require(_0x06bb('0x7'));var ejs=require(_0x06bb('0x8'));var fs=require('fs');var fs_extra=require(_0x06bb('0x9'));var _=require(_0x06bb('0xa'));var squel=require(_0x06bb('0xb'));var crypto=require('crypto');var jsforce=require(_0x06bb('0xc'));var deskjs=require(_0x06bb('0xd'));var toCsv=require(_0x06bb('0x7'));var querystring=require(_0x06bb('0xe'));var Papa=require(_0x06bb('0xf'));var Redis=require('ioredis');var authService=require(_0x06bb('0x10'));var qs=require(_0x06bb('0x11'));var as=require(_0x06bb('0x12'));var hardwareService=require(_0x06bb('0x13'));var logger=require(_0x06bb('0x14'))(_0x06bb('0x15'));var utils=require(_0x06bb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x06bb('0x17'));var db=require(_0x06bb('0x18'))['db'];config[_0x06bb('0x19')]=_['defaults'](config[_0x06bb('0x19')],{'host':_0x06bb('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x06bb('0x19')]));require(_0x06bb('0x1b'))[_0x06bb('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x06bb('0x1d')][_0x06bb('0x1e')]({'port':0x232c});var client9002=jayson[_0x06bb('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4162f3,_0x245dff,_0x3455e3,_0x1ebf4c){return new BPromise(function(_0x5e884f,_0x1698ea){var _0x2339ad=_0x1ebf4c||client;return _0x2339ad['request'](_0x4162f3,_0x3455e3)['then'](function(_0xf337c4){logger[_0x06bb('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x245dff,_0x06bb('0x20'));logger[_0x06bb('0x21')](_0x06bb('0x22'),_0x245dff,_0x06bb('0x20'),JSON['stringify'](_0xf337c4));if(_0xf337c4[_0x06bb('0x23')]){if(_0xf337c4[_0x06bb('0x23')]['code']===0x1f4){logger[_0x06bb('0x23')](_0x06bb('0x24'),_0x245dff,_0xf337c4['error'][_0x06bb('0x25')]);return _0x1698ea(_0xf337c4[_0x06bb('0x23')][_0x06bb('0x25')]);}logger[_0x06bb('0x23')](_0x06bb('0x24'),_0x245dff,_0xf337c4[_0x06bb('0x23')][_0x06bb('0x25')]);return _0x5e884f(_0xf337c4[_0x06bb('0x23')][_0x06bb('0x25')]);}else{logger['info'](_0x06bb('0x24'),_0x245dff,'request\x20sent');_0x5e884f(_0xf337c4[_0x06bb('0x26')][_0x06bb('0x25')]);}})[_0x06bb('0x27')](function(_0x1f6cfd){logger['error'](_0x06bb('0x24'),_0x245dff,_0x1f6cfd);_0x1698ea(_0x1f6cfd);});});}function respondWithStatusCode(_0x363f47,_0x4285e7){_0x4285e7=_0x4285e7||0xcc;return function(_0x42c896){if(_0x42c896){return _0x363f47['sendStatus'](_0x4285e7);}return _0x363f47[_0x06bb('0x28')](_0x4285e7)[_0x06bb('0x29')]();};}function respondWithResult(_0x5d66ec,_0x38843c){_0x38843c=_0x38843c||0xc8;return function(_0x31d564){if(_0x31d564){return _0x5d66ec[_0x06bb('0x28')](_0x38843c)[_0x06bb('0x2a')](_0x31d564);}};}function respondWithFilteredResult(_0xb34e2e,_0x7eecab){return function(_0x17e396){if(_0x17e396){var _0x298e27=typeof _0x7eecab[_0x06bb('0x2b')]===_0x06bb('0x2c')&&typeof _0x7eecab[_0x06bb('0x2d')]===_0x06bb('0x2c');var _0x5991a9=_0x17e396['count'];var _0x2dbf96=_0x298e27?0x0:_0x7eecab[_0x06bb('0x2b')];var _0x4feb77=_0x298e27?_0x17e396['count']:_0x7eecab[_0x06bb('0x2b')]+_0x7eecab['limit'];var _0x5642f3;if(_0x4feb77>=_0x5991a9){_0x4feb77=_0x5991a9;_0x5642f3=0xc8;}else{_0x5642f3=0xce;}_0xb34e2e[_0x06bb('0x28')](_0x5642f3);return _0xb34e2e[_0x06bb('0x2e')](_0x06bb('0x2f'),_0x2dbf96+'-'+_0x4feb77+'/'+_0x5991a9)[_0x06bb('0x2a')](_0x17e396);}return null;};}function patchUpdates(_0x1e0332){return function(_0x5675da){try{jsonpatch[_0x06bb('0x30')](_0x5675da,_0x1e0332,!![]);}catch(_0x3fb782){return BPromise[_0x06bb('0x31')](_0x3fb782);}return _0x5675da[_0x06bb('0x32')]();};}function saveUpdates(_0x2f0449,_0x1e2bf4){return function(_0x4dfc22){if(_0x4dfc22){return _0x4dfc22[_0x06bb('0x33')](_0x2f0449)[_0x06bb('0x34')](function(_0x3ae906){return _0x3ae906;});}return null;};}function removeEntity(_0x2437a2,_0x3c571a){return function(_0x179c34){if(_0x179c34){return _0x179c34[_0x06bb('0x35')]()[_0x06bb('0x34')](function(){_0x2437a2[_0x06bb('0x28')](0xcc)[_0x06bb('0x29')]();});}};}function handleEntityNotFound(_0x2f142a,_0x5ee91d){return function(_0x2a12c6){if(!_0x2a12c6){_0x2f142a[_0x06bb('0x36')](0x194);}return _0x2a12c6;};}function handleError(_0x33ca7d,_0xd0eee2){_0xd0eee2=_0xd0eee2||0x1f4;return function(_0x35754c){logger['error'](_0x35754c[_0x06bb('0x37')]);if(_0x35754c['name']){delete _0x35754c['name'];}_0x33ca7d['status'](_0xd0eee2)[_0x06bb('0x38')](_0x35754c);};}exports['index']=function(_0x5d762d,_0x58bccb){var _0x376d5f={},_0x441d57={},_0x36fc27={'count':0x0,'rows':[]};var _0x59d279=_[_0x06bb('0x39')](db[_0x06bb('0x3a')]['rawAttributes'],function(_0x2cbebc){return{'name':_0x2cbebc[_0x06bb('0x3b')],'type':_0x2cbebc[_0x06bb('0x3c')]['key']};});_0x441d57[_0x06bb('0x3d')]=_[_0x06bb('0x39')](_0x59d279,_0x06bb('0x3e'));_0x441d57[_0x06bb('0x3f')]=_['keys'](_0x5d762d[_0x06bb('0x3f')]);_0x441d57[_0x06bb('0x40')]=_['intersection'](_0x441d57[_0x06bb('0x3d')],_0x441d57[_0x06bb('0x3f')]);_0x376d5f[_0x06bb('0x41')]=_['intersection'](_0x441d57[_0x06bb('0x3d')],qs['fields'](_0x5d762d['query'][_0x06bb('0x42')]));_0x376d5f[_0x06bb('0x41')]=_0x376d5f[_0x06bb('0x41')][_0x06bb('0x43')]?_0x376d5f[_0x06bb('0x41')]:_0x441d57[_0x06bb('0x3d')];if(!_0x5d762d['query'][_0x06bb('0x44')]('nolimit')){_0x376d5f[_0x06bb('0x2d')]=qs['limit'](_0x5d762d[_0x06bb('0x3f')][_0x06bb('0x2d')]);_0x376d5f[_0x06bb('0x2b')]=qs[_0x06bb('0x2b')](_0x5d762d['query'][_0x06bb('0x2b')]);}_0x376d5f[_0x06bb('0x45')]=qs[_0x06bb('0x46')](_0x5d762d[_0x06bb('0x3f')][_0x06bb('0x46')]);_0x376d5f[_0x06bb('0x47')]=qs[_0x06bb('0x40')](_[_0x06bb('0x48')](_0x5d762d[_0x06bb('0x3f')],_0x441d57[_0x06bb('0x40')]),_0x59d279);if(_0x5d762d[_0x06bb('0x3f')][_0x06bb('0x49')]){_0x376d5f[_0x06bb('0x47')]=_[_0x06bb('0x4a')](_0x376d5f[_0x06bb('0x47')],{'$or':_['map'](_0x59d279,function(_0x4a34bd){if(_0x4a34bd[_0x06bb('0x3c')]!==_0x06bb('0x4b')){var _0x18d017={};_0x18d017[_0x4a34bd[_0x06bb('0x3e')]]={'$like':'%'+_0x5d762d[_0x06bb('0x3f')]['filter']+'%'};return _0x18d017;}})});}_0x376d5f=_[_0x06bb('0x4a')]({},_0x376d5f,_0x5d762d[_0x06bb('0x4c')]);var _0xc6cea3={'where':_0x376d5f[_0x06bb('0x47')]};return db[_0x06bb('0x3a')]['count'](_0xc6cea3)['then'](function(_0x388df6){_0x36fc27[_0x06bb('0x4d')]=_0x388df6;if(_0x5d762d['query'][_0x06bb('0x4e')]){_0x376d5f['include']=[{'all':!![]}];}return db[_0x06bb('0x3a')][_0x06bb('0x4f')](_0x376d5f);})[_0x06bb('0x34')](function(_0x3aa851){_0x36fc27['rows']=_0x3aa851;return _0x36fc27;})[_0x06bb('0x34')](respondWithFilteredResult(_0x58bccb,_0x376d5f))[_0x06bb('0x27')](handleError(_0x58bccb,null));};exports['show']=function(_0x1423d4,_0x233521){var _0x516390={'raw':!![],'where':{'id':_0x1423d4[_0x06bb('0x50')]['id']}},_0x5b5be3={};_0x5b5be3['model']=_[_0x06bb('0x51')](db['OpenchannelMessage'][_0x06bb('0x52')]);_0x5b5be3[_0x06bb('0x3f')]=_[_0x06bb('0x51')](_0x1423d4[_0x06bb('0x3f')]);_0x5b5be3[_0x06bb('0x40')]=_[_0x06bb('0x53')](_0x5b5be3[_0x06bb('0x3d')],_0x5b5be3['query']);_0x516390[_0x06bb('0x41')]=_[_0x06bb('0x53')](_0x5b5be3[_0x06bb('0x3d')],qs['fields'](_0x1423d4[_0x06bb('0x3f')][_0x06bb('0x42')]));_0x516390['attributes']=_0x516390['attributes'][_0x06bb('0x43')]?_0x516390[_0x06bb('0x41')]:_0x5b5be3[_0x06bb('0x3d')];if(_0x1423d4[_0x06bb('0x3f')][_0x06bb('0x4e')]){_0x516390[_0x06bb('0x54')]=[{'all':!![]}];}_0x516390=_[_0x06bb('0x4a')]({},_0x516390,_0x1423d4['options']);return db[_0x06bb('0x3a')][_0x06bb('0x55')](_0x516390)['then'](handleEntityNotFound(_0x233521,null))[_0x06bb('0x34')](respondWithResult(_0x233521,null))['catch'](handleError(_0x233521,null));};exports[_0x06bb('0x56')]=function(_0x1e2c81,_0x13f649){return db['OpenchannelMessage'][_0x06bb('0x56')](_0x1e2c81[_0x06bb('0x57')],{})[_0x06bb('0x34')](respondWithResult(_0x13f649,0xc9))['catch'](handleError(_0x13f649,null));};exports[_0x06bb('0x33')]=function(_0x507c8c,_0x23abf9){if(_0x507c8c['body']['id']){delete _0x507c8c[_0x06bb('0x57')]['id'];}return db[_0x06bb('0x3a')][_0x06bb('0x55')]({'where':{'id':_0x507c8c[_0x06bb('0x50')]['id']}})[_0x06bb('0x34')](handleEntityNotFound(_0x23abf9,null))[_0x06bb('0x34')](saveUpdates(_0x507c8c[_0x06bb('0x57')],null))[_0x06bb('0x34')](respondWithResult(_0x23abf9,null))[_0x06bb('0x27')](handleError(_0x23abf9,null));};exports['destroy']=function(_0x477bad,_0xb1e5e3){return db[_0x06bb('0x3a')][_0x06bb('0x55')]({'where':{'id':_0x477bad[_0x06bb('0x50')]['id']}})[_0x06bb('0x34')](handleEntityNotFound(_0xb1e5e3,null))[_0x06bb('0x34')](removeEntity(_0xb1e5e3,null))['catch'](handleError(_0xb1e5e3,null));};exports['describe']=function(_0xad4e79,_0x18c3e8){return db[_0x06bb('0x3a')][_0x06bb('0x58')]()[_0x06bb('0x34')](respondWithResult(_0x18c3e8,null))[_0x06bb('0x27')](handleError(_0x18c3e8,null));};var interaction_log=require(_0x06bb('0x14'))(_0x06bb('0x59'));exports[_0x06bb('0x5a')]=function(_0x5a4d9d,_0x33155a,_0x2ab967){var _0x5cb9ba={'agent':{},'channel':'openchannel'};if(_0x5a4d9d[_0x06bb('0x57')]['id']){delete _0x5a4d9d[_0x06bb('0x57')]['id'];}_0x5a4d9d[_0x06bb('0x57')]['read']=!![];_0x5a4d9d['body']['readAt']=moment()[_0x06bb('0x5b')](_0x06bb('0x5c'));_0x5a4d9d['body'][_0x06bb('0x5d')]=_0x5a4d9d['body']['UserId']||_0x5a4d9d[_0x06bb('0x5e')]['id'];_0x5cb9ba[_0x06bb('0x5f')]['id']=_0x5a4d9d['body'][_0x06bb('0x5d')];return db[_0x06bb('0x3a')][_0x06bb('0x55')]({'where':{'id':_0x5a4d9d['params']['id'],'UserId':null}})[_0x06bb('0x34')](handleEntityNotFound(_0x33155a,null))['then'](saveUpdates(_0x5a4d9d[_0x06bb('0x57')],null))[_0x06bb('0x34')](function(_0xbad0b){if(_0xbad0b){_0x5cb9ba[_0x06bb('0x25')]=_0xbad0b['get']({'plain':!![]});return db[_0x06bb('0x60')][_0x06bb('0x55')]({'where':{'id':_0xbad0b['OpenchannelInteractionId']}});}return null;})[_0x06bb('0x34')](handleEntityNotFound(_0x33155a,null))['then'](function(_0x51e670){if(_0x51e670){return _0x51e670[_0x06bb('0x33')]({'UserId':_0x5a4d9d[_0x06bb('0x57')][_0x06bb('0x5d')],'read1stAt':_[_0x06bb('0x61')](_0x51e670[_0x06bb('0x62')])?moment()[_0x06bb('0x5b')](_0x06bb('0x5c')):undefined});}return null;})[_0x06bb('0x34')](function(_0x3adede){if(_0x3adede){_0x5cb9ba[_0x06bb('0x63')]=_0x3adede[_0x06bb('0x64')]({'plain':!![]});interaction_log[_0x06bb('0x1f')](_0x06bb('0x65'),_0x5a4d9d[_0x06bb('0x5e')]['id'],_0x5a4d9d[_0x06bb('0x5e')][_0x06bb('0x3e')],_0x5a4d9d[_0x06bb('0x5e')][_0x06bb('0x66')],_0x5cb9ba['interaction']['id'],_0x5a4d9d[_0x06bb('0x57')]?JSON[_0x06bb('0x67')](_0x5a4d9d[_0x06bb('0x57')]):_0x06bb('0x68'));return respondWithRpcPromise(_0x06bb('0x69'),_0x06bb('0x6a'),_0x5cb9ba);}return null;})['then'](function(_0x49aa82){var _0x318ee2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49aa82[_0x06bb('0x25')][_0x06bb('0x6b')];return db[_0x06bb('0x6c')]['query'](_0x318ee2,{'type':db['Sequelize'][_0x06bb('0x6d')][_0x06bb('0x6e')],'raw':!![]})[_0x06bb('0x34')](function(_0x3c7fc3){return _0x3c7fc3;});})[_0x06bb('0x34')](function(_0x43a1ef){if(_0x43a1ef){_0x5cb9ba[_0x06bb('0x25')][_0x06bb('0x6f')]=_0x43a1ef[0x0];if(!_0x5a4d9d[_0x06bb('0x57')]['UserId'])return;return db['User'][_0x06bb('0x55')]({'where':{'id':_0x5a4d9d[_0x06bb('0x57')][_0x06bb('0x5d')],'role':_0x06bb('0x5f')},'attributes':['id',_0x06bb('0x3e'),_0x06bb('0x70'),_0x06bb('0x71'),_0x06bb('0x72')],'raw':!![]});}return null;})['then'](function(_0x4b18f){if(!_0x4b18f)return null;_0x5cb9ba[_0x06bb('0x25')][_0x06bb('0x5f')]=_0x4b18f;return _0x5cb9ba;})[_0x06bb('0x34')](function(_0x407c1e){if(_0x407c1e){if(_0x5a4d9d[_0x06bb('0x57')]['manual']){_0x5cb9ba['message'][_0x06bb('0x73')]=util['format'](_0x06bb('0x74'),_0x5a4d9d[_0x06bb('0x5e')][_0x06bb('0x3e')]);_0x5cb9ba[_0x06bb('0x25')][_0x06bb('0x75')]=_0x5cb9ba[_0x06bb('0x75')];_0x5cb9ba[_0x06bb('0x25')][_0x06bb('0x76')]=_0x5cb9ba[_0x06bb('0x75')];_0x5cb9ba[_0x06bb('0x25')][_0x06bb('0x77')]=_0x06bb('0x5a');return respondWithRpcPromise(_0x06bb('0x78'),'EventManager',{'event':'acceptmessage','message':_0x5cb9ba[_0x06bb('0x25')]},client9002)['then'](function(){return _0x5cb9ba;});}return _0x5cb9ba;}return null;})[_0x06bb('0x34')](respondWithResult(_0x33155a,null))['catch'](handleError(_0x33155a,null));};var interaction_log=require(_0x06bb('0x14'))(_0x06bb('0x59'));exports[_0x06bb('0x31')]=function(_0x38e16b,_0x4cc71b,_0x5205e2){var _0xc10580={'agent':{},'channel':_0x06bb('0x79')};if(_0x38e16b['body']['id']){delete _0x38e16b[_0x06bb('0x57')]['id'];}_0x38e16b[_0x06bb('0x57')][_0x06bb('0x5d')]=_0x38e16b[_0x06bb('0x57')]['UserId']||_0x38e16b[_0x06bb('0x5e')]['id'];_0xc10580[_0x06bb('0x5f')]['id']=_0x38e16b[_0x06bb('0x57')][_0x06bb('0x5d')];return db[_0x06bb('0x3a')][_0x06bb('0x55')]({'where':{'id':_0x38e16b[_0x06bb('0x50')]['id'],'UserId':null}})[_0x06bb('0x34')](handleEntityNotFound(_0x4cc71b,null))[_0x06bb('0x34')](function(_0x5c7dac){if(_0x5c7dac){_0xc10580[_0x06bb('0x25')]=_0x5c7dac[_0x06bb('0x64')]({'plain':!![]});return db[_0x06bb('0x60')]['find']({'where':{'id':_0x5c7dac['OpenchannelInteractionId']}});}return null;})[_0x06bb('0x34')](handleEntityNotFound(_0x4cc71b,null))[_0x06bb('0x34')](function(_0x21f20e){if(_0x21f20e){_0xc10580[_0x06bb('0x63')]=_0x21f20e['get']({'plain':!![]});interaction_log[_0x06bb('0x1f')](_0x06bb('0x7a'),_0x38e16b['user']['id'],_0x38e16b['user']['name'],_0x38e16b[_0x06bb('0x5e')][_0x06bb('0x66')],_0xc10580[_0x06bb('0x63')]['id'],_0x38e16b['body']?JSON[_0x06bb('0x67')](_0x38e16b[_0x06bb('0x57')]):_0x06bb('0x68'));return respondWithRpcPromise(_0x06bb('0x7b'),_0x06bb('0x7c'),_0xc10580);}return null;})[_0x06bb('0x34')](function(_0x5c1c8d){var _0x4e3f83=_0x06bb('0x7d')+_0x5c1c8d[_0x06bb('0x25')][_0x06bb('0x6b')];return db[_0x06bb('0x6c')][_0x06bb('0x3f')](_0x4e3f83,{'type':db['Sequelize'][_0x06bb('0x6d')]['SELECT'],'raw':!![]})[_0x06bb('0x34')](function(_0x133ecc){return _0x133ecc;});})[_0x06bb('0x34')](function(_0x240b70){if(_0x240b70){_0xc10580['message'][_0x06bb('0x6f')]=_0x240b70[0x0];if(!_0x38e16b[_0x06bb('0x57')][_0x06bb('0x5d')])return;return db[_0x06bb('0x7e')][_0x06bb('0x55')]({'where':{'id':_0x38e16b[_0x06bb('0x57')][_0x06bb('0x5d')],'role':_0x06bb('0x5f')},'attributes':['id',_0x06bb('0x3e'),_0x06bb('0x70'),_0x06bb('0x71'),_0x06bb('0x72')],'raw':!![]});}return null;})[_0x06bb('0x34')](function(_0x1cae6c){if(!_0x1cae6c)return null;_0xc10580['message'][_0x06bb('0x5f')]=_0x1cae6c;return _0xc10580;})[_0x06bb('0x34')](function(_0x4d6ed7){if(_0x4d6ed7){_0x4d6ed7[_0x06bb('0x25')][_0x06bb('0x73')]=util[_0x06bb('0x5b')](_0x06bb('0x74'),_0x38e16b[_0x06bb('0x5e')][_0x06bb('0x3e')]);_0x4d6ed7[_0x06bb('0x25')][_0x06bb('0x75')]=_0xc10580[_0x06bb('0x75')];_0x4d6ed7[_0x06bb('0x25')]['motionChannel']=_0xc10580[_0x06bb('0x75')];_0x4d6ed7[_0x06bb('0x25')][_0x06bb('0x77')]=_0x06bb('0x31');respondWithRpcPromise('EventManager',_0x06bb('0x78'),{'event':_0x06bb('0x7f'),'message':_0x4d6ed7[_0x06bb('0x25')]},client9002);return _0xc10580;}return null;})[_0x06bb('0x34')](respondWithResult(_0x4cc71b,null))[_0x06bb('0x27')](handleError(_0x4cc71b,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index be514d7..95101d6 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 _0x0664=['remove','emit','hook','exports','events','OpenchannelMessage','setMaxListeners','save'];(function(_0x48aae3,_0x5a47de){var _0x24c19d=function(_0x5c1ba2){while(--_0x5c1ba2){_0x48aae3['push'](_0x48aae3['shift']());}};_0x24c19d(++_0x5a47de);}(_0x0664,0x1ac));var _0x4066=function(_0x5c0ceb,_0x2520d3){_0x5c0ceb=_0x5c0ceb-0x0;var _0x160bc3=_0x0664[_0x5c0ceb];return _0x160bc3;};'use strict';var EventEmitter=require(_0x4066('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x4066('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4066('0x2')](0x0);var events={'afterCreate':_0x4066('0x3'),'afterUpdate':'update','afterDestroy':_0x4066('0x4')};function emitEvent(_0x341ac3){return function(_0x1d0edf,_0x41e251,_0x4c1ca3){OpenchannelMessageEvents[_0x4066('0x5')](_0x341ac3+':'+_0x1d0edf['id'],_0x1d0edf);OpenchannelMessageEvents[_0x4066('0x5')](_0x341ac3,_0x1d0edf);_0x4c1ca3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x4066('0x6')](e,emitEvent(event));}}module[_0x4066('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x01ea=['events','../../mysqldb','OpenchannelMessage','emit','hasOwnProperty','hook'];(function(_0xe2266f,_0x8137a0){var _0x37e2be=function(_0x2fe020){while(--_0x2fe020){_0xe2266f['push'](_0xe2266f['shift']());}};_0x37e2be(++_0x8137a0);}(_0x01ea,0x150));var _0xa01e=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x01ea[_0x3de8a4];return _0x4635cf;};'use strict';var EventEmitter=require(_0xa01e('0x0'));var OpenchannelMessage=require(_0xa01e('0x1'))['db'][_0xa01e('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x24a793){return function(_0x338d04,_0x5afe40,_0xf1fc13){OpenchannelMessageEvents[_0xa01e('0x3')](_0x24a793+':'+_0x338d04['id'],_0x338d04);OpenchannelMessageEvents[_0xa01e('0x3')](_0x24a793,_0x338d04);_0xf1fc13(null);};}for(var e in events){if(events[_0xa01e('0x4')](e)){var event=events[e];OpenchannelMessage[_0xa01e('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index e173873..ad79449 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 _0xbb9f=['OpenchannelInteractionId','then','createdAt','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','catch','inspect','finally','utf8mb4','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','out','secret','isNil','UserId'];(function(_0x20a63e,_0xcb0bea){var _0x56fe3d=function(_0x2d4208){while(--_0x2d4208){_0x20a63e['push'](_0x20a63e['shift']());}};_0x56fe3d(++_0xcb0bea);}(_0xbb9f,0xd7));var _0xfbb9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb9f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfbb9('0x0'));var logger=require(_0xfbb9('0x1'))(_0xfbb9('0x2'));var moment=require('moment');var BPromise=require(_0xfbb9('0x3'));var rp=require(_0xfbb9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfbb9('0x5'));var attributes=require(_0xfbb9('0x6'));module[_0xfbb9('0x7')]=function(_0x421ab5,_0x3c2eb7){return _0x421ab5[_0xfbb9('0x8')](_0xfbb9('0x9'),attributes,{'tableName':_0xfbb9('0xa'),'paranoid':![],'indexes':[{'name':_0xfbb9('0xb'),'fields':[_0xfbb9('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x483221,_0x2066fb,_0x35dc89){var _0x579fa6=_0x421ab5[_0xfbb9('0xd')];var _0x104511=_0x483221[_0xfbb9('0xe')]({'plain':!![]});if(_0x104511['direction']['toLowerCase']()==='in'||_0x104511[_0xfbb9('0xf')]['toLowerCase']()===_0xfbb9('0x10')&&!_0x104511[_0xfbb9('0x11')]&&!_[_0xfbb9('0x12')](_0x104511[_0xfbb9('0x13')])){_0x579fa6['OpenchannelInteraction']['findOne']({'where':{'id':_0x104511[_0xfbb9('0x14')]}})[_0xfbb9('0x15')](function(_0x406cc0){if(_0x406cc0){_0x406cc0['update']({'lastMsgAt':_0x104511[_0xfbb9('0x16')],'lastMsgDirection':_0x104511[_0xfbb9('0xf')]['toLowerCase']()});}})['catch'](function(_0x9aac15){console['error'](_0x9aac15);});}if(_0x104511[_0xfbb9('0xf')]==='out'&&!_0x104511[_0xfbb9('0x11')]){var _0x5bfaeb;_0x579fa6[_0xfbb9('0x17')][_0xfbb9('0x18')]()[_0xfbb9('0x15')](function(_0x631bbf){return _0x579fa6[_0xfbb9('0x19')][_0xfbb9('0x1a')]({'where':{'id':_0x104511[_0xfbb9('0x1b')]},'include':[{'model':_0x579fa6[_0xfbb9('0x1c')],'as':_0xfbb9('0x1d'),'where':{'id':_0x104511[_0xfbb9('0x14')]},'limit':0x1,'include':[{'model':_0x579fa6['CmContact'],'as':_0xfbb9('0x1e'),'attributes':_[_0xfbb9('0x1f')](_0x631bbf)}]}]});})['then'](function(_0x1006e9){_0x5bfaeb=_0x1006e9['get']({'plain':!![]});if(_0x5bfaeb&&_0x5bfaeb[_0xfbb9('0x20')]){logger[_0xfbb9('0x21')](_0xfbb9('0x22'),'afterCreate',util['format'](_0xfbb9('0x23'),_0x104511['id'],_0x5bfaeb['replyUri']));if(_0x5bfaeb[_0xfbb9('0x1d')]&&_0x5bfaeb['Interactions'][_0xfbb9('0x24')]){_0x104511[_0xfbb9('0x25')]=_[_0xfbb9('0x26')](_0x5bfaeb[_0xfbb9('0x1d')][0x0],_0xfbb9('0x1e'));_0x104511[_0xfbb9('0x1e')]=_0x5bfaeb[_0xfbb9('0x1d')][0x0][_0xfbb9('0x1e')];}var _0x2066fb={'method':'POST','uri':encodeURI(_0x5bfaeb['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2066fb['method']){case'GET':_0x2066fb['qs']=_0x104511;break;case'POST':_0x2066fb[_0xfbb9('0xc')]=_0x104511;break;}return rp(_0x2066fb)[_0xfbb9('0x15')](function(_0x1edbc6){logger[_0xfbb9('0x21')](_0xfbb9('0x22'),_0xfbb9('0x27'),util['format'](_0xfbb9('0x28'),_0x104511['id'],_0x5bfaeb[_0xfbb9('0x20')]));if(_0x1edbc6[_0xfbb9('0xc')][_0xfbb9('0x29')]&&_0x1edbc6['body'][_0xfbb9('0x29')]!=_0x104511[_0xfbb9('0x25')][_0xfbb9('0x29')]){return _0x579fa6[_0xfbb9('0x1c')][_0xfbb9('0x2a')]({'threadId':_0x1edbc6[_0xfbb9('0xc')][_0xfbb9('0x29')]},{'where':{'id':_0x104511[_0xfbb9('0x25')]['id']}});}else{return;}})['then'](function(){return _0x483221[_0xfbb9('0x2a')]({'read':!![]});})[_0xfbb9('0x2b')](function(_0x45403e){logger['error'](_0xfbb9('0x22'),_0xfbb9('0x27'),util[_0xfbb9('0x2c')](_0x45403e,{'showHidden':![],'depth':null}));_0x35dc89();});}else{_0x35dc89();}})[_0xfbb9('0x2d')](function(){_0x35dc89();});}else{_0x35dc89();}}},'charset':_0xfbb9('0x2e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb84e=['finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','secret','CmContact','describe','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','body','threadId','Interaction','inspect'];(function(_0x4a125a,_0x1aa19a){var _0x3ef05e=function(_0x3e1e68){while(--_0x3e1e68){_0x4a125a['push'](_0x4a125a['shift']());}};_0x3ef05e(++_0x1aa19a);}(_0xb84e,0x1e9));var _0xeb84=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0xb84e[_0x3b2244];return _0x2dcc14;};'use strict';var _=require(_0xeb84('0x0'));var util=require(_0xeb84('0x1'));var logger=require(_0xeb84('0x2'))('api');var moment=require(_0xeb84('0x3'));var BPromise=require(_0xeb84('0x4'));var rp=require(_0xeb84('0x5'));var fs=require('fs');var path=require(_0xeb84('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeb84('0x7'));module[_0xeb84('0x8')]=function(_0x3be65e,_0x29ade1){return _0x3be65e[_0xeb84('0x9')](_0xeb84('0xa'),attributes,{'tableName':_0xeb84('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0xeb84('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x281d73,_0x1dac3f,_0x4660d1){var _0x2d259e=_0x3be65e[_0xeb84('0xd')];var _0x234f4d=_0x281d73[_0xeb84('0xe')]({'plain':!![]});if(_0x234f4d[_0xeb84('0xf')][_0xeb84('0x10')]()==='in'||_0x234f4d['direction'][_0xeb84('0x10')]()===_0xeb84('0x11')&&!_0x234f4d['secret']&&!_[_0xeb84('0x12')](_0x234f4d[_0xeb84('0x13')])){_0x2d259e[_0xeb84('0x14')][_0xeb84('0x15')]({'where':{'id':_0x234f4d[_0xeb84('0x16')]}})[_0xeb84('0x17')](function(_0x44b103){if(_0x44b103){_0x44b103[_0xeb84('0x18')]({'lastMsgAt':_0x234f4d[_0xeb84('0x19')],'lastMsgDirection':_0x234f4d[_0xeb84('0xf')][_0xeb84('0x10')]()});}})[_0xeb84('0x1a')](function(_0x243bf3){console[_0xeb84('0x1b')](_0x243bf3);});}if(_0x234f4d['direction']===_0xeb84('0x11')&&!_0x234f4d[_0xeb84('0x1c')]){var _0x3cc805;_0x2d259e[_0xeb84('0x1d')][_0xeb84('0x1e')]()[_0xeb84('0x17')](function(_0x5656e5){return _0x2d259e['OpenchannelAccount'][_0xeb84('0x1f')]({'where':{'id':_0x234f4d[_0xeb84('0x20')]},'include':[{'model':_0x2d259e[_0xeb84('0x14')],'as':_0xeb84('0x21'),'where':{'id':_0x234f4d[_0xeb84('0x16')]},'limit':0x1,'include':[{'model':_0x2d259e[_0xeb84('0x1d')],'as':_0xeb84('0x22'),'attributes':_[_0xeb84('0x23')](_0x5656e5)}]}]});})[_0xeb84('0x17')](function(_0xe51db3){_0x3cc805=_0xe51db3[_0xeb84('0xe')]({'plain':!![]});if(_0x3cc805&&_0x3cc805[_0xeb84('0x24')]){logger[_0xeb84('0x25')](_0xeb84('0x26'),_0xeb84('0x27'),util[_0xeb84('0x28')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x234f4d['id'],_0x3cc805['replyUri']));if(_0x3cc805[_0xeb84('0x21')]&&_0x3cc805[_0xeb84('0x21')][_0xeb84('0x29')]){_0x234f4d['Interaction']=_[_0xeb84('0x2a')](_0x3cc805[_0xeb84('0x21')][0x0],_0xeb84('0x22'));_0x234f4d[_0xeb84('0x22')]=_0x3cc805['Interactions'][0x0][_0xeb84('0x22')];}var _0x1dac3f={'method':_0xeb84('0x2b'),'uri':encodeURI(_0x3cc805[_0xeb84('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1dac3f[_0xeb84('0x2c')]){case _0xeb84('0x2d'):_0x1dac3f['qs']=_0x234f4d;break;case _0xeb84('0x2b'):_0x1dac3f['body']=_0x234f4d;break;}return rp(_0x1dac3f)[_0xeb84('0x17')](function(_0x20dfdd){logger[_0xeb84('0x25')](_0xeb84('0x26'),'afterCreate',util['format'](_0xeb84('0x2e'),_0x234f4d['id'],_0x3cc805[_0xeb84('0x24')]));if(_0x20dfdd[_0xeb84('0x2f')][_0xeb84('0x30')]&&_0x20dfdd['body'][_0xeb84('0x30')]!=_0x234f4d[_0xeb84('0x31')][_0xeb84('0x30')]){return _0x2d259e[_0xeb84('0x14')]['update']({'threadId':_0x20dfdd[_0xeb84('0x2f')][_0xeb84('0x30')]},{'where':{'id':_0x234f4d[_0xeb84('0x31')]['id']}});}else{return;}})[_0xeb84('0x17')](function(){return _0x281d73['update']({'read':!![]});})[_0xeb84('0x1a')](function(_0x162a9e){logger[_0xeb84('0x1b')](_0xeb84('0x26'),_0xeb84('0x27'),util[_0xeb84('0x32')](_0x162a9e,{'showHidden':![],'depth':null}));_0x4660d1();});}else{_0x4660d1();}})[_0xeb84('0x33')](function(){_0x4660d1();});}else{_0x4660d1();}}},'charset':_0xeb84('0x34'),'collate':_0xeb84('0x35')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 7e33548..f2e0430 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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x1c3281,_0x5c69a0){var _0x27588d=function(_0x47114c){while(--_0x47114c){_0x1c3281['push'](_0x1c3281['shift']());}};_0x27588d(++_0x5c69a0);}(_0xdb28,0x106));var _0x8db2=function(_0x3f1357,_0x27bad6){_0x3f1357=_0x3f1357-0x0;var _0x29a7e2=_0xdb28[_0x3f1357];return _0x29a7e2;};'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});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x1a8c89,_0x4133a2){var _0x79c797=function(_0x110633){while(--_0x110633){_0x1a8c89['push'](_0x1a8c89['shift']());}};_0x79c797(++_0x4133a2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f66[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index b8ba26b..8d03c23 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 _0x2856=['remove','update','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save'];(function(_0x39b8ed,_0x421ef4){var _0x11cff9=function(_0x49e18c){while(--_0x49e18c){_0x39b8ed['push'](_0x39b8ed['shift']());}};_0x11cff9(++_0x421ef4);}(_0x2856,0xb2));var _0x6285=function(_0x18a81a,_0x4fc65b){_0x18a81a=_0x18a81a-0x0;var _0x114027=_0x2856[_0x18a81a];return _0x114027;};'use strict';var OpenchannelMessageEvents=require(_0x6285('0x0'));var events=[_0x6285('0x1'),_0x6285('0x2'),_0x6285('0x3')];function createListener(_0x19d83e,_0x46bebf){return function(_0x18defb){_0x46bebf[_0x6285('0x4')](_0x19d83e,_0x18defb);};}function removeListener(_0x5b9d96,_0xc0807c){return function(){OpenchannelMessageEvents[_0x6285('0x5')](_0x5b9d96,_0xc0807c);};}exports[_0x6285('0x6')]=function(_0x3527f3){for(var _0x3d213c=0x0,_0x4a31d8=events[_0x6285('0x7')];_0x3d213c<_0x4a31d8;_0x3d213c++){var _0x23b959=events[_0x3d213c];var _0x482d2c=createListener(_0x6285('0x8')+_0x23b959,_0x3527f3);OpenchannelMessageEvents['on'](_0x23b959,_0x482d2c);}}; \ No newline at end of file +var _0x5a5a=['emit','length','openchannelMessage:','save','remove','update'];(function(_0x2a0d7b,_0x282f57){var _0x23a5d4=function(_0x4bb30f){while(--_0x4bb30f){_0x2a0d7b['push'](_0x2a0d7b['shift']());}};_0x23a5d4(++_0x282f57);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x2c022d,_0x53e9c5){_0x2c022d=_0x2c022d-0x0;var _0x1b835f=_0x5a5a[_0x2c022d];return _0x1b835f;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xa5a5('0x0'),_0xa5a5('0x1'),_0xa5a5('0x2')];function createListener(_0x2552b1,_0x42cf19){return function(_0x50c2ad){_0x42cf19[_0xa5a5('0x3')](_0x2552b1,_0x50c2ad);};}function removeListener(_0x3307f1,_0x1fd3f0){return function(){OpenchannelMessageEvents['removeListener'](_0x3307f1,_0x1fd3f0);};}exports['register']=function(_0x43943d){for(var _0x1fe96d=0x0,_0x5691f1=events[_0xa5a5('0x4')];_0x1fe96d<_0x5691f1;_0x1fe96d++){var _0xf2ea20=events[_0x1fe96d];var _0x1234c2=createListener(_0xa5a5('0x5')+_0xf2ea20,_0x43943d);OpenchannelMessageEvents['on'](_0xf2ea20,_0x1234c2);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 6fb349b..9194898 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 _0x7fc7=['destroy','removeTeams','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete'];(function(_0x704a1,_0x32d5c5){var _0xcb4c0=function(_0x5eeaa0){while(--_0x5eeaa0){_0x704a1['push'](_0x704a1['shift']());}};_0xcb4c0(++_0x32d5c5);}(_0x7fc7,0xbd));var _0x77fc=function(_0x42825a,_0x21ecb6){_0x42825a=_0x42825a-0x0;var _0x10604e=_0x7fc7[_0x42825a];return _0x10604e;};'use strict';var multer=require(_0x77fc('0x0'));var util=require(_0x77fc('0x1'));var path=require(_0x77fc('0x2'));var timeout=require(_0x77fc('0x3'));var express=require(_0x77fc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x77fc('0x5'));var interaction=require(_0x77fc('0x6'));var config=require(_0x77fc('0x7'));var controller=require(_0x77fc('0x8'));router[_0x77fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x77fc('0xa'),auth['isAuthenticated'](),controller[_0x77fc('0xb')]);router[_0x77fc('0x9')](_0x77fc('0xc'),auth[_0x77fc('0xd')](),controller[_0x77fc('0xe')]);router[_0x77fc('0x9')](_0x77fc('0xf'),auth[_0x77fc('0xd')](),controller[_0x77fc('0x10')]);router['get'](_0x77fc('0x11'),auth[_0x77fc('0xd')](),controller[_0x77fc('0x12')]);router['get']('/:id/users',auth[_0x77fc('0xd')](),controller[_0x77fc('0x13')]);router[_0x77fc('0x14')]('/',auth['isAuthenticated'](),controller[_0x77fc('0x15')]);router[_0x77fc('0x14')](_0x77fc('0x11'),auth[_0x77fc('0xd')](),controller[_0x77fc('0x16')]);router[_0x77fc('0x14')](_0x77fc('0x17'),auth[_0x77fc('0xd')](),controller[_0x77fc('0x18')]);router[_0x77fc('0x19')]('/:id',auth[_0x77fc('0xd')](),controller[_0x77fc('0x1a')]);router[_0x77fc('0x1b')]('/:id',auth[_0x77fc('0xd')](),controller[_0x77fc('0x1c')]);router[_0x77fc('0x1b')](_0x77fc('0x11'),auth[_0x77fc('0xd')](),controller[_0x77fc('0x1d')]);router['delete']('/:id/users',auth[_0x77fc('0xd')](),controller['removeAgents']);module[_0x77fc('0x1e')]=router; \ No newline at end of file +var _0x85c0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addTeams','update','delete','/:id','destroy','removeAgents','exports','multer','connect-timeout','express'];(function(_0x75b801,_0x567b15){var _0x10c0aa=function(_0x136eab){while(--_0x136eab){_0x75b801['push'](_0x75b801['shift']());}};_0x10c0aa(++_0x567b15);}(_0x85c0,0xf0));var _0x085c=function(_0x16e1d8,_0x384658){_0x16e1d8=_0x16e1d8-0x0;var _0x3bb13b=_0x85c0[_0x16e1d8];return _0x3bb13b;};'use strict';var multer=require(_0x085c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x085c('0x1'));var express=require(_0x085c('0x2'));var router=express[_0x085c('0x3')]();var fs_extra=require(_0x085c('0x4'));var auth=require(_0x085c('0x5'));var interaction=require(_0x085c('0x6'));var config=require(_0x085c('0x7'));var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0x085c('0x8')](),controller[_0x085c('0x9')]);router[_0x085c('0xa')](_0x085c('0xb'),auth['isAuthenticated'](),controller[_0x085c('0xc')]);router[_0x085c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x085c('0xd')]);router['get'](_0x085c('0xe'),auth['isAuthenticated'](),controller[_0x085c('0xf')]);router[_0x085c('0xa')](_0x085c('0x10'),auth[_0x085c('0x8')](),controller['getTeams']);router[_0x085c('0xa')](_0x085c('0x11'),auth[_0x085c('0x8')](),controller['getAgents']);router[_0x085c('0x12')]('/',auth[_0x085c('0x8')](),controller[_0x085c('0x13')]);router[_0x085c('0x12')](_0x085c('0x10'),auth[_0x085c('0x8')](),controller[_0x085c('0x14')]);router[_0x085c('0x12')](_0x085c('0x11'),auth[_0x085c('0x8')](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x085c('0x15')]);router[_0x085c('0x16')](_0x085c('0x17'),auth[_0x085c('0x8')](),controller[_0x085c('0x18')]);router[_0x085c('0x16')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x085c('0x16')](_0x085c('0x11'),auth[_0x085c('0x8')](),controller[_0x085c('0x19')]);module[_0x085c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 7796791..50dea80 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 _0x42ff=['INTEGER','ENUM','roundrobin','sequelize','STRING','name'];(function(_0x34298a,_0x236854){var _0x11ac81=function(_0x216cfb){while(--_0x216cfb){_0x34298a['push'](_0x34298a['shift']());}};_0x11ac81(++_0x236854);}(_0x42ff,0xed));var _0xf42f=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x42ff[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require(_0xf42f('0x0'));module['exports']={'name':{'type':Sequelize[_0xf42f('0x1')],'unique':_0xf42f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf42f('0x1')]},'timeout':{'type':Sequelize[_0xf42f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf42f('0x4')]('rrmemory','beepall',_0xf42f('0x5'))}}; \ No newline at end of file +var _0x041b=['INTEGER','rrmemory','beepall','sequelize','STRING'];(function(_0xf8886b,_0x504891){var _0x321bd5=function(_0x3c116b){while(--_0x3c116b){_0xf8886b['push'](_0xf8886b['shift']());}};_0x321bd5(++_0x504891);}(_0x041b,0x8f));var _0xb041=function(_0x445bd1,_0x4ae5d6){_0x445bd1=_0x445bd1-0x0;var _0x4b9fa6=_0x041b[_0x445bd1];return _0x4b9fa6;};'use strict';var Sequelize=require(_0xb041('0x0'));module['exports']={'name':{'type':Sequelize[_0xb041('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb041('0x1')]},'timeout':{'type':Sequelize[_0xb041('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb041('0x3'),_0xb041('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index fe3a2f0..0836d22 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 _0x3be8=['zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','then','get','OpenchannelQueues','UserProfileResource','destroy','name','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','OpenchannelQueue','rows','catch','show','params','rawAttributes','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','options','User','UserId','agent','openchannelPause','updatedAt','%s/%s','SIP','getTeams','addTeams','ids','findAll','Agents','online','flatMap','sequelize','forEach','userOpenchannelQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','includes','all','union','compact','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','emit','getAgents','eml-format'];(function(_0x1c5796,_0x126be5){var _0x220140=function(_0x1611ac){while(--_0x1611ac){_0x1c5796['push'](_0x1c5796['shift']());}};_0x220140(++_0x126be5);}(_0x3be8,0x7e));var _0x83be=function(_0x3e6f1e,_0x305234){_0x3e6f1e=_0x3e6f1e-0x0;var _0x941ad1=_0x3be8[_0x3e6f1e];return _0x941ad1;};'use strict';var emlformat=require(_0x83be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x83be('0x1'));var jsonpatch=require(_0x83be('0x2'));var rp=require(_0x83be('0x3'));var moment=require(_0x83be('0x4'));var BPromise=require(_0x83be('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x83be('0x6'));var csv=require(_0x83be('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83be('0x8'));var _=require(_0x83be('0x9'));var squel=require(_0x83be('0xa'));var crypto=require(_0x83be('0xb'));var jsforce=require(_0x83be('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x83be('0x7'));var querystring=require(_0x83be('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x83be('0xe'));var hardwareService=require(_0x83be('0xf'));var logger=require(_0x83be('0x10'))(_0x83be('0x11'));var utils=require(_0x83be('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x83be('0x13'));var db=require(_0x83be('0x14'))['db'];config[_0x83be('0x15')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x83be('0x16'))(new Redis(config[_0x83be('0x15')]));require('./openchannelQueue.socket')[_0x83be('0x17')](socket);function respondWithStatusCode(_0x1f0a8f,_0x1af4f7){_0x1af4f7=_0x1af4f7||0xcc;return function(_0x7c1140){if(_0x7c1140){return _0x1f0a8f[_0x83be('0x18')](_0x1af4f7);}return _0x1f0a8f[_0x83be('0x19')](_0x1af4f7)[_0x83be('0x1a')]();};}function respondWithResult(_0x210e41,_0x3a8264){_0x3a8264=_0x3a8264||0xc8;return function(_0x59f897){if(_0x59f897){return _0x210e41[_0x83be('0x19')](_0x3a8264)[_0x83be('0x1b')](_0x59f897);}};}function respondWithFilteredResult(_0x28a944,_0x17e51a){return function(_0x211fa5){if(_0x211fa5){var _0x30d506=typeof _0x17e51a[_0x83be('0x1c')]===_0x83be('0x1d')&&typeof _0x17e51a[_0x83be('0x1e')]==='undefined';var _0x23db6e=_0x211fa5[_0x83be('0x1f')];var _0x1c26f2=_0x30d506?0x0:_0x17e51a[_0x83be('0x1c')];var _0x4a06e9=_0x30d506?_0x211fa5['count']:_0x17e51a['offset']+_0x17e51a[_0x83be('0x1e')];var _0x4be00c;if(_0x4a06e9>=_0x23db6e){_0x4a06e9=_0x23db6e;_0x4be00c=0xc8;}else{_0x4be00c=0xce;}_0x28a944[_0x83be('0x19')](_0x4be00c);return _0x28a944[_0x83be('0x20')]('Content-Range',_0x1c26f2+'-'+_0x4a06e9+'/'+_0x23db6e)[_0x83be('0x1b')](_0x211fa5);}return null;};}function patchUpdates(_0x468fc8){return function(_0x40be94){try{jsonpatch['apply'](_0x40be94,_0x468fc8,!![]);}catch(_0xe52465){return BPromise[_0x83be('0x21')](_0xe52465);}return _0x40be94['save']();};}function saveUpdates(_0x44dd7d,_0x107d81){return function(_0x109952){if(_0x109952){return _0x109952['update'](_0x44dd7d)[_0x83be('0x22')](function(_0x121790){return _0x121790;});}return null;};}function removeEntity(_0x1ff9d1,_0x4824d1){return function(_0x560873){if(_0x560873){return _0x560873['destroy']()[_0x83be('0x22')](function(){var _0x4fbdd4=_0x560873[_0x83be('0x23')]({'plain':!![]});var _0x584617=_0x83be('0x24');return db[_0x83be('0x25')][_0x83be('0x26')]({'where':{'type':_0x584617,'resourceId':_0x4fbdd4['id']}})[_0x83be('0x22')](function(){return _0x560873;});})['then'](function(){_0x1ff9d1[_0x83be('0x19')](0xcc)[_0x83be('0x1a')]();});}};}function handleEntityNotFound(_0x3f17d1,_0x45d689){return function(_0x239dfa){if(!_0x239dfa){_0x3f17d1[_0x83be('0x18')](0x194);}return _0x239dfa;};}function handleError(_0x5eae61,_0x291cf5){_0x291cf5=_0x291cf5||0x1f4;return function(_0x332cf5){logger['error'](_0x332cf5['stack']);if(_0x332cf5['name']){delete _0x332cf5[_0x83be('0x27')];}_0x5eae61[_0x83be('0x19')](_0x291cf5)['send'](_0x332cf5);};}exports['index']=function(_0x238186,_0x457eb3){var _0x3eb842={},_0x26fe21={},_0x5f4190={'count':0x0,'rows':[]};var _0x450c1d=_[_0x83be('0x28')](db['OpenchannelQueue']['rawAttributes'],function(_0x3a55f3){return{'name':_0x3a55f3[_0x83be('0x29')],'type':_0x3a55f3['type'][_0x83be('0x2a')]};});_0x26fe21[_0x83be('0x2b')]=_[_0x83be('0x28')](_0x450c1d,_0x83be('0x27'));_0x26fe21[_0x83be('0x2c')]=_[_0x83be('0x2d')](_0x238186[_0x83be('0x2c')]);_0x26fe21[_0x83be('0x2e')]=_[_0x83be('0x2f')](_0x26fe21[_0x83be('0x2b')],_0x26fe21[_0x83be('0x2c')]);_0x3eb842[_0x83be('0x30')]=_['intersection'](_0x26fe21[_0x83be('0x2b')],qs[_0x83be('0x31')](_0x238186[_0x83be('0x2c')][_0x83be('0x31')]));_0x3eb842['attributes']=_0x3eb842[_0x83be('0x30')][_0x83be('0x32')]?_0x3eb842['attributes']:_0x26fe21['model'];if(!_0x238186[_0x83be('0x2c')][_0x83be('0x33')](_0x83be('0x34'))){_0x3eb842[_0x83be('0x1e')]=qs['limit'](_0x238186[_0x83be('0x2c')][_0x83be('0x1e')]);_0x3eb842[_0x83be('0x1c')]=qs['offset'](_0x238186[_0x83be('0x2c')]['offset']);}_0x3eb842[_0x83be('0x35')]=qs[_0x83be('0x36')](_0x238186[_0x83be('0x2c')][_0x83be('0x36')]);_0x3eb842[_0x83be('0x37')]=qs[_0x83be('0x2e')](_[_0x83be('0x38')](_0x238186[_0x83be('0x2c')],_0x26fe21[_0x83be('0x2e')]),_0x450c1d);if(_0x238186[_0x83be('0x2c')][_0x83be('0x39')]){_0x3eb842['where']=_[_0x83be('0x3a')](_0x3eb842[_0x83be('0x37')],{'$or':_[_0x83be('0x28')](_0x450c1d,function(_0x28392f){if(_0x28392f['type']!==_0x83be('0x3b')){var _0x2fe747={};_0x2fe747[_0x28392f[_0x83be('0x27')]]={'$like':'%'+_0x238186['query'][_0x83be('0x39')]+'%'};return _0x2fe747;}})});}_0x3eb842=_['merge']({},_0x3eb842,_0x238186['options']);var _0x21935d={'where':_0x3eb842['where']};return db[_0x83be('0x3c')][_0x83be('0x1f')](_0x21935d)[_0x83be('0x22')](function(_0x5055cc){_0x5f4190['count']=_0x5055cc;if(_0x238186[_0x83be('0x2c')]['includeAll']){_0x3eb842['include']=[{'all':!![]}];}return db[_0x83be('0x3c')]['findAll'](_0x3eb842);})[_0x83be('0x22')](function(_0x59886c){_0x5f4190[_0x83be('0x3d')]=_0x59886c;return _0x5f4190;})[_0x83be('0x22')](respondWithFilteredResult(_0x457eb3,_0x3eb842))[_0x83be('0x3e')](handleError(_0x457eb3,null));};exports[_0x83be('0x3f')]=function(_0x30bcc4,_0x18dd8f){var _0x42f0a0={'raw':!![],'where':{'id':_0x30bcc4[_0x83be('0x40')]['id']}},_0x554fa6={};_0x554fa6[_0x83be('0x2b')]=_[_0x83be('0x2d')](db[_0x83be('0x3c')][_0x83be('0x41')]);_0x554fa6[_0x83be('0x2c')]=_[_0x83be('0x2d')](_0x30bcc4[_0x83be('0x2c')]);_0x554fa6['filters']=_['intersection'](_0x554fa6[_0x83be('0x2b')],_0x554fa6['query']);_0x42f0a0[_0x83be('0x30')]=_['intersection'](_0x554fa6[_0x83be('0x2b')],qs[_0x83be('0x31')](_0x30bcc4[_0x83be('0x2c')][_0x83be('0x31')]));_0x42f0a0['attributes']=_0x42f0a0[_0x83be('0x30')][_0x83be('0x32')]?_0x42f0a0[_0x83be('0x30')]:_0x554fa6[_0x83be('0x2b')];if(_0x30bcc4['query'][_0x83be('0x42')]){_0x42f0a0[_0x83be('0x43')]=[{'all':!![]}];}_0x42f0a0=_[_0x83be('0x3a')]({},_0x42f0a0,_0x30bcc4['options']);return db[_0x83be('0x3c')]['find'](_0x42f0a0)[_0x83be('0x22')](handleEntityNotFound(_0x18dd8f,null))[_0x83be('0x22')](respondWithResult(_0x18dd8f,null))['catch'](handleError(_0x18dd8f,null));};exports[_0x83be('0x44')]=function(_0x4d48da,_0x434337){return db[_0x83be('0x3c')]['create'](_0x4d48da[_0x83be('0x45')],{})[_0x83be('0x22')](function(_0x30e11e){var _0x5d40ae=_0x4d48da[_0x83be('0x46')][_0x83be('0x23')]({'plain':!![]});if(!_0x5d40ae)throw new Error(_0x83be('0x47'));if(_0x5d40ae[_0x83be('0x48')]==='user'){var _0x55d8b0=_0x30e11e['get']({'plain':!![]});var _0x5e8e33='OpenchannelQueues';return db[_0x83be('0x49')][_0x83be('0x4a')]({'where':{'name':_0x5e8e33,'userProfileId':_0x5d40ae['userProfileId']},'raw':!![]})[_0x83be('0x22')](function(_0x46fb1e){if(_0x46fb1e&&_0x46fb1e[_0x83be('0x4b')]===0x0){return db[_0x83be('0x25')]['create']({'name':_0x55d8b0[_0x83be('0x27')],'resourceId':_0x55d8b0['id'],'type':_0x46fb1e['name'],'sectionId':_0x46fb1e['id']},{})[_0x83be('0x22')](function(){return _0x30e11e;});}else{return _0x30e11e;}})[_0x83be('0x3e')](function(_0x147601){logger[_0x83be('0x4c')](_0x83be('0x4d'),_0x147601);throw _0x147601;});}return _0x30e11e;})['then'](respondWithResult(_0x434337,0xc9))['catch'](handleError(_0x434337,null));};exports['update']=function(_0xe4b05c,_0x203874){if(_0xe4b05c['body']['id']){delete _0xe4b05c['body']['id'];}return db[_0x83be('0x3c')]['find']({'where':{'id':_0xe4b05c[_0x83be('0x40')]['id']}})[_0x83be('0x22')](handleEntityNotFound(_0x203874,null))[_0x83be('0x22')](saveUpdates(_0xe4b05c['body'],null))[_0x83be('0x22')](respondWithResult(_0x203874,null))[_0x83be('0x3e')](handleError(_0x203874,null));};exports[_0x83be('0x26')]=function(_0x4bb641,_0x2a74a6){return db[_0x83be('0x3c')][_0x83be('0x4a')]({'where':{'id':_0x4bb641[_0x83be('0x40')]['id']}})['then'](handleEntityNotFound(_0x2a74a6,null))[_0x83be('0x22')](removeEntity(_0x2a74a6,null))[_0x83be('0x3e')](handleError(_0x2a74a6,null));};exports[_0x83be('0x4e')]=function(_0x37112b,_0x59b17e){return db['OpenchannelQueue'][_0x83be('0x4e')]()['then'](respondWithResult(_0x59b17e,null))[_0x83be('0x3e')](handleError(_0x59b17e,null));};exports['getMembers']=function(_0x1317ef,_0x277157,_0x343406){var _0x38cb6c={'raw':!![],'where':{}},_0x3d2adc={},_0x2031bb;return db[_0x83be('0x3c')][_0x83be('0x4f')]({'where':{'id':_0x1317ef[_0x83be('0x40')]['id']}})[_0x83be('0x22')](handleEntityNotFound(_0x277157,null))[_0x83be('0x22')](function(_0x26a765){if(_0x26a765){_0x2031bb=_0x26a765[_0x83be('0x23')]({'plain':!![]});_0x3d2adc[_0x83be('0x2b')]=_[_0x83be('0x2d')](db[_0x83be('0x50')][_0x83be('0x41')]);_0x3d2adc[_0x83be('0x2c')]=_[_0x83be('0x2d')](_0x1317ef['query']);_0x3d2adc[_0x83be('0x2e')]=_[_0x83be('0x2f')](_0x3d2adc[_0x83be('0x2b')],_0x3d2adc[_0x83be('0x2c')]);_0x38cb6c['attributes']=_[_0x83be('0x2f')](_0x3d2adc[_0x83be('0x2b')],qs[_0x83be('0x31')](_0x1317ef[_0x83be('0x2c')]['fields']));_0x38cb6c[_0x83be('0x30')]=_0x38cb6c[_0x83be('0x30')][_0x83be('0x32')]?_0x38cb6c[_0x83be('0x30')]:_0x3d2adc[_0x83be('0x2b')];if(!_0x1317ef[_0x83be('0x2c')][_0x83be('0x33')]('nolimit')){_0x38cb6c[_0x83be('0x1e')]=qs['limit'](_0x1317ef[_0x83be('0x2c')]['limit']);_0x38cb6c['offset']=qs[_0x83be('0x1c')](_0x1317ef[_0x83be('0x2c')][_0x83be('0x1c')]);}_0x38cb6c[_0x83be('0x35')]=qs[_0x83be('0x36')](_0x1317ef[_0x83be('0x2c')][_0x83be('0x36')]);_0x38cb6c[_0x83be('0x37')]=qs['filters'](_[_0x83be('0x38')](_0x1317ef['query'],_0x3d2adc[_0x83be('0x2e')]));_0x38cb6c[_0x83be('0x37')][_0x83be('0x51')]=_0x26a765['id'];if(_0x1317ef[_0x83be('0x2c')][_0x83be('0x39')]){_0x38cb6c[_0x83be('0x37')]=_[_0x83be('0x3a')](_0x38cb6c[_0x83be('0x37')],{'$or':_[_0x83be('0x28')](_0x38cb6c[_0x83be('0x30')],function(_0xc710f0){var _0x18875f={};_0x18875f[_0xc710f0]={'$like':'%'+_0x1317ef[_0x83be('0x2c')][_0x83be('0x39')]+'%'};return _0x18875f;})});}_0x38cb6c=_['merge']({},_0x38cb6c,_0x1317ef[_0x83be('0x52')]);return db[_0x83be('0x50')]['findAll'](_0x38cb6c);}})[_0x83be('0x22')](function(_0x460d58){if(_0x460d58){return db[_0x83be('0x53')]['findAndCountAll']({'where':{'id':_[_0x83be('0x28')](_0x460d58,_0x83be('0x54')),'role':_0x83be('0x55')},'attributes':['id',_0x83be('0x27'),_0x83be('0x56'),_0x83be('0x57'),'createdAt']});}})[_0x83be('0x22')](function(_0x4b9e5e){if(_0x4b9e5e){return{'count':_0x4b9e5e[_0x83be('0x1f')],'rows':_[_0x83be('0x28')](_0x4b9e5e[_0x83be('0x3d')],function(_0x5245ae){return{'membername':_0x5245ae[_0x83be('0x27')],'UserId':_0x5245ae['id'],'queue_name':_0x2031bb[_0x83be('0x27')],'OpenchannelQueueId':_0x2031bb['id'],'interface':util['format'](_0x83be('0x58'),_0x83be('0x59'),_0x5245ae[_0x83be('0x27')]),'penalty':0x0,'paused':_0x5245ae['openchannelPause'],'createdAt':_0x5245ae['createdAt'],'updatedAt':_0x5245ae[_0x83be('0x57')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x277157,_0x38cb6c))['catch'](handleError(_0x277157,null));};exports[_0x83be('0x5a')]=function(_0x3f7fdd,_0x11f383,_0x3573f1){var _0x434032={};var _0x4db055={};var _0x241944;var _0x49212e;return db[_0x83be('0x3c')][_0x83be('0x4f')]({'where':{'id':_0x3f7fdd[_0x83be('0x40')]['id']}})[_0x83be('0x22')](handleEntityNotFound(_0x11f383,null))[_0x83be('0x22')](function(_0x211a7f){if(_0x211a7f){_0x241944=_0x211a7f;_0x4db055['model']=_[_0x83be('0x2d')](db['Team'][_0x83be('0x41')]);_0x4db055[_0x83be('0x2c')]=_['keys'](_0x3f7fdd[_0x83be('0x2c')]);_0x4db055['filters']=_['intersection'](_0x4db055[_0x83be('0x2b')],_0x4db055['query']);_0x434032['attributes']=_[_0x83be('0x2f')](_0x4db055[_0x83be('0x2b')],qs[_0x83be('0x31')](_0x3f7fdd['query'][_0x83be('0x31')]));_0x434032[_0x83be('0x30')]=_0x434032['attributes'][_0x83be('0x32')]?_0x434032[_0x83be('0x30')]:_0x4db055[_0x83be('0x2b')];_0x434032[_0x83be('0x35')]=qs[_0x83be('0x36')](_0x3f7fdd[_0x83be('0x2c')][_0x83be('0x36')]);_0x434032[_0x83be('0x37')]=qs[_0x83be('0x2e')](_['pick'](_0x3f7fdd[_0x83be('0x2c')],_0x4db055[_0x83be('0x2e')]));if(_0x3f7fdd[_0x83be('0x2c')][_0x83be('0x39')]){_0x434032[_0x83be('0x37')]=_[_0x83be('0x3a')](_0x434032[_0x83be('0x37')],{'$or':_[_0x83be('0x28')](_0x434032['attributes'],function(_0x46a873){var _0x558352={};_0x558352[_0x46a873]={'$like':'%'+_0x3f7fdd[_0x83be('0x2c')][_0x83be('0x39')]+'%'};return _0x558352;})});}_0x434032=_[_0x83be('0x3a')]({},_0x434032,_0x3f7fdd[_0x83be('0x52')]);return _0x241944[_0x83be('0x5a')](_0x434032);}})[_0x83be('0x22')](function(_0x2831aa){if(_0x2831aa){_0x49212e=_0x2831aa[_0x83be('0x32')];if(!_0x3f7fdd[_0x83be('0x2c')][_0x83be('0x33')](_0x83be('0x34'))){_0x434032['limit']=qs['limit'](_0x3f7fdd['query'][_0x83be('0x1e')]);_0x434032[_0x83be('0x1c')]=qs[_0x83be('0x1c')](_0x3f7fdd[_0x83be('0x2c')][_0x83be('0x1c')]);}return _0x241944[_0x83be('0x5a')](_0x434032);}})['then'](function(_0x3d2341){if(_0x3d2341){return _0x3d2341?{'count':_0x49212e,'rows':_0x3d2341}:null;}})['then'](respondWithResult(_0x11f383,null))[_0x83be('0x3e')](handleError(_0x11f383,null));};exports[_0x83be('0x5b')]=function(_0x25fc9c,_0x34d471,_0x2e3eec){var _0x472b65=_0x25fc9c['body'][_0x83be('0x5c')];return db['Team'][_0x83be('0x5d')]({'where':{'id':_0x472b65},'attributes':['id'],'include':[{'model':db[_0x83be('0x53')],'as':_0x83be('0x5e'),'attributes':['id',_0x83be('0x27'),_0x83be('0x5f'),'voicePause','interface'],'raw':!![]}]})[_0x83be('0x22')](function(_0x4efc04){if(_0x4efc04){var _0x33b911=_[_0x83be('0x60')](_0x4efc04,function(_0x4fd0ae){var _0x4f5786=_0x4fd0ae[_0x83be('0x23')]({'plain':!![]});return _0x4f5786[_0x83be('0x5e')];});return db['OpenchannelQueue']['find']({'where':{'id':_0x25fc9c[_0x83be('0x40')]['id']}})['then'](function(_0x269735){return db[_0x83be('0x61')]['transaction'](function(_0x1ea250){return _0x269735['addTeams'](_0x472b65,{'transaction':_0x1ea250})[_0x83be('0x22')](function(){return BPromise['each'](_0x33b911,function(_0x380a22){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x380a22['id'],'OpenchannelQueueId':_0x25fc9c[_0x83be('0x40')]['id']},'transaction':_0x1ea250});});})[_0x83be('0x22')](function(){_0x33b911[_0x83be('0x62')](function(_0xbba8b8){socket['emit'](_0x83be('0x63'),{'UserId':_0xbba8b8['id'],'OpenchannelQueueId':_0x269735['id']});});});});});}})[_0x83be('0x22')](respondWithStatusCode(_0x34d471,null))[_0x83be('0x3e')](handleError(_0x34d471,null));};exports[_0x83be('0x64')]=function(_0x48387a,_0x3c49b6,_0x292bd4){return db[_0x83be('0x65')][_0x83be('0x5d')]({'where':{'id':_0x48387a[_0x83be('0x2c')][_0x83be('0x5c')]},'attributes':['id'],'include':[{'model':db[_0x83be('0x53')],'as':_0x83be('0x5e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3c49b6,null))[_0x83be('0x22')](function(_0x386b13){var _0x3d9c14=_[_0x83be('0x28')](_0x386b13,'id');var _0x3caaad=[];var _0x1aa2da=[];var _0x123a78=squel['select']();_0x123a78[_0x83be('0x66')](_0x83be('0x67'))[_0x83be('0x68')](_0x83be('0x69'),'tq')[_0x83be('0x6a')](_0x83be('0x6b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x83be('0x37')](_0x83be('0x6c'),_0x48387a[_0x83be('0x40')]['id']);for(var _0x442ac0=0x0;_0x442ac0<_0x386b13[_0x83be('0x32')];_0x442ac0+=0x1){let _0x5b7e6c=_0x386b13[_0x442ac0];for(var _0x5b3f94=0x0;_0x5b3f94<_0x5b7e6c[_0x83be('0x5e')]['length'];_0x5b3f94+=0x1){let _0x46c223=_0x5b7e6c['Agents'][_0x5b3f94];var _0x26d87f=_0x123a78[_0x83be('0x6d')]();_0x26d87f['where']('ut.UserId\x20=\x20?',_0x46c223['id']);_0x1aa2da[_0x83be('0x6e')](db['sequelize'][_0x83be('0x2c')](_0x26d87f[_0x83be('0x6f')](),{'type':db[_0x83be('0x61')][_0x83be('0x70')][_0x83be('0x71')]})[_0x83be('0x22')](function(_0x2bf47c){if(_0x2bf47c[_0x83be('0x32')]===0x1){return _0x46c223['id'];}else{var _0x13afe1=_['every'](_[_0x83be('0x28')](_0x2bf47c,'TeamId'),function(_0x1dc374){return _[_0x83be('0x72')](_0x3d9c14,_0x1dc374);});if(_0x13afe1){return _0x46c223['id'];}}}));}}return BPromise[_0x83be('0x73')](_0x1aa2da)[_0x83be('0x22')](function(_0x11a24d){_0x3caaad=_(_0x3caaad)[_0x83be('0x74')](_0x11a24d)[_0x83be('0x75')]()['value']();return db[_0x83be('0x3c')][_0x83be('0x4a')]({'where':{'id':_0x48387a[_0x83be('0x40')]['id']}})[_0x83be('0x22')](function(_0x3c1985){return db[_0x83be('0x61')][_0x83be('0x76')](function(_0xba954f){return _0x3c1985[_0x83be('0x64')](_0x48387a[_0x83be('0x2c')]['ids'],{'transaction':_0xba954f})[_0x83be('0x22')](function(){if(!_[_0x83be('0x77')](_0x3caaad)){return _0x3c1985[_0x83be('0x78')](_0x3caaad,{'transaction':_0xba954f});}})[_0x83be('0x22')](function(){_0x3caaad[_0x83be('0x62')](function(_0xde227d){socket['emit'](_0x83be('0x79'),{'UserId':_0xde227d,'OpenchannelQueueId':_0x3c1985['id']});});});});});});})['then'](respondWithStatusCode(_0x3c49b6,null))[_0x83be('0x3e')](handleError(_0x3c49b6,null));};exports[_0x83be('0x7a')]=function(_0x3f4886,_0x5ba1eb,_0xa329b7){return db[_0x83be('0x3c')]['find']({'where':{'id':_0x3f4886['params']['id']}})[_0x83be('0x22')](handleEntityNotFound(_0x5ba1eb,null))[_0x83be('0x22')](function(_0x2171e7){if(_0x2171e7){return _0x2171e7[_0x83be('0x7a')](_0x3f4886[_0x83be('0x45')][_0x83be('0x5c')],_[_0x83be('0x7b')](_0x3f4886[_0x83be('0x45')],[_0x83be('0x5c'),'id'])||{})[_0x83be('0x7c')](function(_0x3deade){for(var _0x3b20ef=0x0;_0x3b20ef<_0x3f4886[_0x83be('0x45')][_0x83be('0x5c')][_0x83be('0x32')];_0x3b20ef+=0x1){socket[_0x83be('0x7d')](_0x83be('0x63'),{'UserId':Number(_0x3f4886[_0x83be('0x45')][_0x83be('0x5c')][_0x3b20ef]),'OpenchannelQueueId':Number(_0x3f4886[_0x83be('0x40')]['id'])});}return _0x3deade;});}})[_0x83be('0x22')](respondWithResult(_0x5ba1eb,null))[_0x83be('0x3e')](handleError(_0x5ba1eb,null));};exports['removeAgents']=function(_0x4d9025,_0x5b3781,_0x5c6a3f){return db[_0x83be('0x3c')][_0x83be('0x4a')]({'where':{'id':_0x4d9025[_0x83be('0x40')]['id']}})[_0x83be('0x22')](handleEntityNotFound(_0x5b3781,null))[_0x83be('0x22')](function(_0x4ac698){if(_0x4ac698){return _0x4ac698[_0x83be('0x78')](_0x4d9025[_0x83be('0x2c')]['ids'])[_0x83be('0x22')](function(){if(_['isArray'](_0x4d9025[_0x83be('0x2c')]['ids'])){for(var _0x241270=0x0;_0x241270<_0x4d9025[_0x83be('0x2c')][_0x83be('0x5c')]['length'];_0x241270+=0x1){socket[_0x83be('0x7d')](_0x83be('0x79'),{'UserId':Number(_0x4d9025[_0x83be('0x2c')][_0x83be('0x5c')][_0x241270]),'OpenchannelQueueId':Number(_0x4d9025[_0x83be('0x40')]['id'])});}}else{socket[_0x83be('0x7d')](_0x83be('0x79'),{'UserId':Number(_0x4d9025[_0x83be('0x2c')]['ids']),'OpenchannelQueueId':Number(_0x4d9025[_0x83be('0x40')]['id'])});}});}})[_0x83be('0x22')](respondWithStatusCode(_0x5b3781,null))[_0x83be('0x3e')](handleError(_0x5b3781,null));};exports[_0x83be('0x7e')]=function(_0x425411,_0x2e0672,_0x5f5270){var _0x4856f1={};var _0x4e97c6={};var _0x675d77;var _0x29e239;return db[_0x83be('0x3c')]['findOne']({'where':{'id':_0x425411['params']['id']}})[_0x83be('0x22')](handleEntityNotFound(_0x2e0672,null))[_0x83be('0x22')](function(_0x844a63){if(_0x844a63){_0x675d77=_0x844a63;_0x4e97c6['model']=_[_0x83be('0x2d')](db['User'][_0x83be('0x41')]);_0x4e97c6[_0x83be('0x2c')]=_['keys'](_0x425411[_0x83be('0x2c')]);_0x4e97c6[_0x83be('0x2e')]=_[_0x83be('0x2f')](_0x4e97c6[_0x83be('0x2b')],_0x4e97c6[_0x83be('0x2c')]);_0x4856f1[_0x83be('0x30')]=_[_0x83be('0x2f')](_0x4e97c6[_0x83be('0x2b')],qs['fields'](_0x425411[_0x83be('0x2c')][_0x83be('0x31')]));_0x4856f1[_0x83be('0x30')]=_0x4856f1[_0x83be('0x30')][_0x83be('0x32')]?_0x4856f1[_0x83be('0x30')]:_0x4e97c6[_0x83be('0x2b')];_0x4856f1[_0x83be('0x35')]=qs[_0x83be('0x36')](_0x425411[_0x83be('0x2c')][_0x83be('0x36')]);_0x4856f1[_0x83be('0x37')]=qs[_0x83be('0x2e')](_[_0x83be('0x38')](_0x425411[_0x83be('0x2c')],_0x4e97c6['filters']));if(_0x425411[_0x83be('0x2c')]['filter']){_0x4856f1[_0x83be('0x37')]=_['merge'](_0x4856f1[_0x83be('0x37')],{'$or':_[_0x83be('0x28')](_0x4856f1['attributes'],function(_0x6b3a7e){var _0xc1a935={};_0xc1a935[_0x6b3a7e]={'$like':'%'+_0x425411[_0x83be('0x2c')][_0x83be('0x39')]+'%'};return _0xc1a935;})});}_0x4856f1=_['merge']({},_0x4856f1,_0x425411[_0x83be('0x52')]);return _0x675d77[_0x83be('0x7e')](_0x4856f1);}})['then'](function(_0x2fb140){if(_0x2fb140){_0x29e239=_0x2fb140[_0x83be('0x32')];if(!_0x425411[_0x83be('0x2c')][_0x83be('0x33')]('nolimit')){_0x4856f1[_0x83be('0x1e')]=qs[_0x83be('0x1e')](_0x425411[_0x83be('0x2c')][_0x83be('0x1e')]);_0x4856f1['offset']=qs['offset'](_0x425411[_0x83be('0x2c')][_0x83be('0x1c')]);}return _0x675d77[_0x83be('0x7e')](_0x4856f1);}})[_0x83be('0x22')](function(_0x2f2b55){if(_0x2f2b55){return _0x2f2b55?{'count':_0x29e239,'rows':_0x2f2b55}:null;}})[_0x83be('0x22')](respondWithResult(_0x2e0672,null))['catch'](handleError(_0x2e0672,null));}; \ No newline at end of file +var _0x2828=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','send','map','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','name','filter','includeAll','OpenchannelQueue','rows','catch','show','params','intersection','merge','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','options','findAll','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','%s/%s','SIP','updatedAt','getTeams','findOne','addTeams','Team','Agents','online','interface','sequelize','each','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x4c22a5,_0x4b435b){var _0x4184cb=function(_0x1436d2){while(--_0x1436d2){_0x4c22a5['push'](_0x4c22a5['shift']());}};_0x4184cb(++_0x4b435b);}(_0x2828,0x1a5));var _0x8282=function(_0x4c8779,_0x399ca4){_0x4c8779=_0x4c8779-0x0;var _0x55a207=_0x2828[_0x4c8779];return _0x55a207;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8282('0x0'));var zipdir=require(_0x8282('0x1'));var jsonpatch=require(_0x8282('0x2'));var rp=require('request-promise');var moment=require(_0x8282('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8282('0x4'));var path=require('path');var sox=require(_0x8282('0x5'));var csv=require(_0x8282('0x6'));var ejs=require(_0x8282('0x7'));var fs=require('fs');var fs_extra=require(_0x8282('0x8'));var _=require(_0x8282('0x9'));var squel=require(_0x8282('0xa'));var crypto=require(_0x8282('0xb'));var jsforce=require(_0x8282('0xc'));var deskjs=require(_0x8282('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8282('0xe'));var Papa=require(_0x8282('0xf'));var Redis=require(_0x8282('0x10'));var authService=require(_0x8282('0x11'));var qs=require(_0x8282('0x12'));var as=require(_0x8282('0x13'));var hardwareService=require(_0x8282('0x14'));var logger=require('../../config/logger')(_0x8282('0x15'));var utils=require(_0x8282('0x16'));var config=require(_0x8282('0x17'));var licenseUtil=require(_0x8282('0x18'));var db=require(_0x8282('0x19'))['db'];config[_0x8282('0x1a')]=_[_0x8282('0x1b')](config[_0x8282('0x1a')],{'host':_0x8282('0x1c'),'port':0x18eb});var socket=require(_0x8282('0x1d'))(new Redis(config[_0x8282('0x1a')]));require(_0x8282('0x1e'))['register'](socket);function respondWithStatusCode(_0x1dbb05,_0x186022){_0x186022=_0x186022||0xcc;return function(_0x33cd15){if(_0x33cd15){return _0x1dbb05[_0x8282('0x1f')](_0x186022);}return _0x1dbb05[_0x8282('0x20')](_0x186022)['end']();};}function respondWithResult(_0x1ad401,_0x1fff36){_0x1fff36=_0x1fff36||0xc8;return function(_0x12de79){if(_0x12de79){return _0x1ad401['status'](_0x1fff36)['json'](_0x12de79);}};}function respondWithFilteredResult(_0x578be2,_0x40754f){return function(_0x2181d4){if(_0x2181d4){var _0x2d63a8=typeof _0x40754f[_0x8282('0x21')]===_0x8282('0x22')&&typeof _0x40754f[_0x8282('0x23')]===_0x8282('0x22');var _0x52dec2=_0x2181d4[_0x8282('0x24')];var _0x3f78a1=_0x2d63a8?0x0:_0x40754f[_0x8282('0x21')];var _0x3c7697=_0x2d63a8?_0x2181d4['count']:_0x40754f[_0x8282('0x21')]+_0x40754f[_0x8282('0x23')];var _0x3d7f1a;if(_0x3c7697>=_0x52dec2){_0x3c7697=_0x52dec2;_0x3d7f1a=0xc8;}else{_0x3d7f1a=0xce;}_0x578be2[_0x8282('0x20')](_0x3d7f1a);return _0x578be2[_0x8282('0x25')](_0x8282('0x26'),_0x3f78a1+'-'+_0x3c7697+'/'+_0x52dec2)['json'](_0x2181d4);}return null;};}function patchUpdates(_0x58984a){return function(_0x3275e0){try{jsonpatch[_0x8282('0x27')](_0x3275e0,_0x58984a,!![]);}catch(_0x5bc2e4){return BPromise[_0x8282('0x28')](_0x5bc2e4);}return _0x3275e0[_0x8282('0x29')]();};}function saveUpdates(_0x21f2ac,_0x805020){return function(_0x2a139e){if(_0x2a139e){return _0x2a139e[_0x8282('0x2a')](_0x21f2ac)[_0x8282('0x2b')](function(_0x502fa6){return _0x502fa6;});}return null;};}function removeEntity(_0x549c5a,_0x494257){return function(_0x2cdb3c){if(_0x2cdb3c){return _0x2cdb3c[_0x8282('0x2c')]()[_0x8282('0x2b')](function(){var _0x226246=_0x2cdb3c['get']({'plain':!![]});var _0x1352de=_0x8282('0x2d');return db[_0x8282('0x2e')][_0x8282('0x2c')]({'where':{'type':_0x1352de,'resourceId':_0x226246['id']}})[_0x8282('0x2b')](function(){return _0x2cdb3c;});})[_0x8282('0x2b')](function(){_0x549c5a[_0x8282('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ccf19,_0x40525c){return function(_0x421406){if(!_0x421406){_0x3ccf19[_0x8282('0x1f')](0x194);}return _0x421406;};}function handleError(_0x55d09d,_0xf6ea5b){_0xf6ea5b=_0xf6ea5b||0x1f4;return function(_0x298d81){logger[_0x8282('0x2f')](_0x298d81[_0x8282('0x30')]);if(_0x298d81['name']){delete _0x298d81['name'];}_0x55d09d['status'](_0xf6ea5b)[_0x8282('0x31')](_0x298d81);};}exports['index']=function(_0xef8879,_0x2607ef){var _0x7e3da0={},_0x19dc17={},_0x2e72ac={'count':0x0,'rows':[]};var _0x5df368=_[_0x8282('0x32')](db['OpenchannelQueue'][_0x8282('0x33')],function(_0x4ef0e9){return{'name':_0x4ef0e9[_0x8282('0x34')],'type':_0x4ef0e9[_0x8282('0x35')][_0x8282('0x36')]};});_0x19dc17['model']=_[_0x8282('0x32')](_0x5df368,'name');_0x19dc17['query']=_[_0x8282('0x37')](_0xef8879[_0x8282('0x38')]);_0x19dc17[_0x8282('0x39')]=_['intersection'](_0x19dc17[_0x8282('0x3a')],_0x19dc17['query']);_0x7e3da0[_0x8282('0x3b')]=_['intersection'](_0x19dc17['model'],qs[_0x8282('0x3c')](_0xef8879[_0x8282('0x38')]['fields']));_0x7e3da0[_0x8282('0x3b')]=_0x7e3da0[_0x8282('0x3b')][_0x8282('0x3d')]?_0x7e3da0[_0x8282('0x3b')]:_0x19dc17[_0x8282('0x3a')];if(!_0xef8879[_0x8282('0x38')][_0x8282('0x3e')](_0x8282('0x3f'))){_0x7e3da0['limit']=qs['limit'](_0xef8879[_0x8282('0x38')]['limit']);_0x7e3da0[_0x8282('0x21')]=qs[_0x8282('0x21')](_0xef8879[_0x8282('0x38')][_0x8282('0x21')]);}_0x7e3da0[_0x8282('0x40')]=qs[_0x8282('0x41')](_0xef8879[_0x8282('0x38')][_0x8282('0x41')]);_0x7e3da0['where']=qs[_0x8282('0x39')](_[_0x8282('0x42')](_0xef8879[_0x8282('0x38')],_0x19dc17[_0x8282('0x39')]),_0x5df368);if(_0xef8879['query']['filter']){_0x7e3da0[_0x8282('0x43')]=_['merge'](_0x7e3da0[_0x8282('0x43')],{'$or':_[_0x8282('0x32')](_0x5df368,function(_0x1ac944){if(_0x1ac944[_0x8282('0x35')]!=='VIRTUAL'){var _0x29f8c4={};_0x29f8c4[_0x1ac944[_0x8282('0x44')]]={'$like':'%'+_0xef8879[_0x8282('0x38')][_0x8282('0x45')]+'%'};return _0x29f8c4;}})});}_0x7e3da0=_['merge']({},_0x7e3da0,_0xef8879['options']);var _0x5bff87={'where':_0x7e3da0[_0x8282('0x43')]};return db['OpenchannelQueue']['count'](_0x5bff87)[_0x8282('0x2b')](function(_0x59132b){_0x2e72ac[_0x8282('0x24')]=_0x59132b;if(_0xef8879[_0x8282('0x38')][_0x8282('0x46')]){_0x7e3da0['include']=[{'all':!![]}];}return db[_0x8282('0x47')]['findAll'](_0x7e3da0);})[_0x8282('0x2b')](function(_0x2e3585){_0x2e72ac[_0x8282('0x48')]=_0x2e3585;return _0x2e72ac;})['then'](respondWithFilteredResult(_0x2607ef,_0x7e3da0))[_0x8282('0x49')](handleError(_0x2607ef,null));};exports[_0x8282('0x4a')]=function(_0x1c1549,_0x4bbf32){var _0x5df051={'raw':!![],'where':{'id':_0x1c1549[_0x8282('0x4b')]['id']}},_0x2def17={};_0x2def17[_0x8282('0x3a')]=_[_0x8282('0x37')](db[_0x8282('0x47')]['rawAttributes']);_0x2def17['query']=_[_0x8282('0x37')](_0x1c1549[_0x8282('0x38')]);_0x2def17[_0x8282('0x39')]=_['intersection'](_0x2def17[_0x8282('0x3a')],_0x2def17[_0x8282('0x38')]);_0x5df051['attributes']=_[_0x8282('0x4c')](_0x2def17[_0x8282('0x3a')],qs['fields'](_0x1c1549[_0x8282('0x38')]['fields']));_0x5df051[_0x8282('0x3b')]=_0x5df051[_0x8282('0x3b')][_0x8282('0x3d')]?_0x5df051[_0x8282('0x3b')]:_0x2def17[_0x8282('0x3a')];if(_0x1c1549['query'][_0x8282('0x46')]){_0x5df051['include']=[{'all':!![]}];}_0x5df051=_[_0x8282('0x4d')]({},_0x5df051,_0x1c1549['options']);return db[_0x8282('0x47')]['find'](_0x5df051)[_0x8282('0x2b')](handleEntityNotFound(_0x4bbf32,null))[_0x8282('0x2b')](respondWithResult(_0x4bbf32,null))[_0x8282('0x49')](handleError(_0x4bbf32,null));};exports['create']=function(_0x16809f,_0x426df5){return db[_0x8282('0x47')]['create'](_0x16809f[_0x8282('0x4e')],{})['then'](function(_0x1558bd){var _0x3dac56=_0x16809f[_0x8282('0x4f')]['get']({'plain':!![]});if(!_0x3dac56)throw new Error(_0x8282('0x50'));if(_0x3dac56[_0x8282('0x51')]===_0x8282('0x4f')){var _0x5acf0c=_0x1558bd[_0x8282('0x52')]({'plain':!![]});var _0x2e8a85=_0x8282('0x2d');return db[_0x8282('0x53')][_0x8282('0x54')]({'where':{'name':_0x2e8a85,'userProfileId':_0x3dac56[_0x8282('0x55')]},'raw':!![]})[_0x8282('0x2b')](function(_0x4cbd98){if(_0x4cbd98&&_0x4cbd98[_0x8282('0x56')]===0x0){return db[_0x8282('0x2e')][_0x8282('0x57')]({'name':_0x5acf0c[_0x8282('0x44')],'resourceId':_0x5acf0c['id'],'type':_0x4cbd98['name'],'sectionId':_0x4cbd98['id']},{})[_0x8282('0x2b')](function(){return _0x1558bd;});}else{return _0x1558bd;}})[_0x8282('0x49')](function(_0x3ce678){logger[_0x8282('0x2f')](_0x8282('0x58'),_0x3ce678);throw _0x3ce678;});}return _0x1558bd;})[_0x8282('0x2b')](respondWithResult(_0x426df5,0xc9))['catch'](handleError(_0x426df5,null));};exports[_0x8282('0x2a')]=function(_0x1f681d,_0x1cdc00){if(_0x1f681d[_0x8282('0x4e')]['id']){delete _0x1f681d[_0x8282('0x4e')]['id'];}return db['OpenchannelQueue'][_0x8282('0x54')]({'where':{'id':_0x1f681d[_0x8282('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1cdc00,null))['then'](saveUpdates(_0x1f681d[_0x8282('0x4e')],null))['then'](respondWithResult(_0x1cdc00,null))[_0x8282('0x49')](handleError(_0x1cdc00,null));};exports[_0x8282('0x2c')]=function(_0x517c64,_0x1cf167){return db['OpenchannelQueue'][_0x8282('0x54')]({'where':{'id':_0x517c64[_0x8282('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1cf167,null))['then'](removeEntity(_0x1cf167,null))['catch'](handleError(_0x1cf167,null));};exports[_0x8282('0x59')]=function(_0x3c2ed3,_0x551d54){return db[_0x8282('0x47')][_0x8282('0x59')]()['then'](respondWithResult(_0x551d54,null))[_0x8282('0x49')](handleError(_0x551d54,null));};exports[_0x8282('0x5a')]=function(_0x51f67c,_0x55cc58,_0x588239){var _0x29b870={'raw':!![],'where':{}},_0x4883f8={},_0x1be565;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x51f67c['params']['id']}})[_0x8282('0x2b')](handleEntityNotFound(_0x55cc58,null))[_0x8282('0x2b')](function(_0x2031ec){if(_0x2031ec){_0x1be565=_0x2031ec['get']({'plain':!![]});_0x4883f8[_0x8282('0x3a')]=_[_0x8282('0x37')](db[_0x8282('0x5b')][_0x8282('0x33')]);_0x4883f8[_0x8282('0x38')]=_[_0x8282('0x37')](_0x51f67c[_0x8282('0x38')]);_0x4883f8[_0x8282('0x39')]=_[_0x8282('0x4c')](_0x4883f8[_0x8282('0x3a')],_0x4883f8[_0x8282('0x38')]);_0x29b870[_0x8282('0x3b')]=_['intersection'](_0x4883f8[_0x8282('0x3a')],qs[_0x8282('0x3c')](_0x51f67c[_0x8282('0x38')][_0x8282('0x3c')]));_0x29b870[_0x8282('0x3b')]=_0x29b870[_0x8282('0x3b')]['length']?_0x29b870[_0x8282('0x3b')]:_0x4883f8[_0x8282('0x3a')];if(!_0x51f67c[_0x8282('0x38')][_0x8282('0x3e')](_0x8282('0x3f'))){_0x29b870['limit']=qs['limit'](_0x51f67c['query'][_0x8282('0x23')]);_0x29b870[_0x8282('0x21')]=qs[_0x8282('0x21')](_0x51f67c['query'][_0x8282('0x21')]);}_0x29b870[_0x8282('0x40')]=qs[_0x8282('0x41')](_0x51f67c[_0x8282('0x38')][_0x8282('0x41')]);_0x29b870[_0x8282('0x43')]=qs[_0x8282('0x39')](_['pick'](_0x51f67c[_0x8282('0x38')],_0x4883f8[_0x8282('0x39')]));_0x29b870[_0x8282('0x43')][_0x8282('0x5c')]=_0x2031ec['id'];if(_0x51f67c[_0x8282('0x38')][_0x8282('0x45')]){_0x29b870[_0x8282('0x43')]=_[_0x8282('0x4d')](_0x29b870[_0x8282('0x43')],{'$or':_[_0x8282('0x32')](_0x29b870[_0x8282('0x3b')],function(_0x770086){var _0x326812={};_0x326812[_0x770086]={'$like':'%'+_0x51f67c[_0x8282('0x38')][_0x8282('0x45')]+'%'};return _0x326812;})});}_0x29b870=_[_0x8282('0x4d')]({},_0x29b870,_0x51f67c[_0x8282('0x5d')]);return db['UserOpenchannelQueue'][_0x8282('0x5e')](_0x29b870);}})[_0x8282('0x2b')](function(_0x1b962c){if(_0x1b962c){return db[_0x8282('0x5f')][_0x8282('0x60')]({'where':{'id':_[_0x8282('0x32')](_0x1b962c,_0x8282('0x61')),'role':_0x8282('0x62')},'attributes':['id','name',_0x8282('0x63'),'updatedAt',_0x8282('0x64')]});}})[_0x8282('0x2b')](function(_0x31751c){if(_0x31751c){return{'count':_0x31751c['count'],'rows':_[_0x8282('0x32')](_0x31751c[_0x8282('0x48')],function(_0x4daa49){return{'membername':_0x4daa49[_0x8282('0x44')],'UserId':_0x4daa49['id'],'queue_name':_0x1be565[_0x8282('0x44')],'OpenchannelQueueId':_0x1be565['id'],'interface':util['format'](_0x8282('0x65'),_0x8282('0x66'),_0x4daa49[_0x8282('0x44')]),'penalty':0x0,'paused':_0x4daa49[_0x8282('0x63')],'createdAt':_0x4daa49['createdAt'],'updatedAt':_0x4daa49[_0x8282('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8282('0x2b')](respondWithFilteredResult(_0x55cc58,_0x29b870))['catch'](handleError(_0x55cc58,null));};exports[_0x8282('0x68')]=function(_0x62ffce,_0x304ffc,_0xdaf78){var _0x177c5d={};var _0x5adfe0={};var _0x5cb172;var _0x4f7863;return db[_0x8282('0x47')][_0x8282('0x69')]({'where':{'id':_0x62ffce[_0x8282('0x4b')]['id']}})[_0x8282('0x2b')](handleEntityNotFound(_0x304ffc,null))[_0x8282('0x2b')](function(_0x2f7e7c){if(_0x2f7e7c){_0x5cb172=_0x2f7e7c;_0x5adfe0[_0x8282('0x3a')]=_['keys'](db['Team'][_0x8282('0x33')]);_0x5adfe0[_0x8282('0x38')]=_[_0x8282('0x37')](_0x62ffce[_0x8282('0x38')]);_0x5adfe0['filters']=_[_0x8282('0x4c')](_0x5adfe0[_0x8282('0x3a')],_0x5adfe0[_0x8282('0x38')]);_0x177c5d['attributes']=_['intersection'](_0x5adfe0[_0x8282('0x3a')],qs[_0x8282('0x3c')](_0x62ffce[_0x8282('0x38')][_0x8282('0x3c')]));_0x177c5d[_0x8282('0x3b')]=_0x177c5d['attributes'][_0x8282('0x3d')]?_0x177c5d[_0x8282('0x3b')]:_0x5adfe0[_0x8282('0x3a')];_0x177c5d[_0x8282('0x40')]=qs[_0x8282('0x41')](_0x62ffce[_0x8282('0x38')][_0x8282('0x41')]);_0x177c5d['where']=qs[_0x8282('0x39')](_[_0x8282('0x42')](_0x62ffce[_0x8282('0x38')],_0x5adfe0[_0x8282('0x39')]));if(_0x62ffce[_0x8282('0x38')][_0x8282('0x45')]){_0x177c5d[_0x8282('0x43')]=_[_0x8282('0x4d')](_0x177c5d[_0x8282('0x43')],{'$or':_[_0x8282('0x32')](_0x177c5d[_0x8282('0x3b')],function(_0x1be58a){var _0x47833b={};_0x47833b[_0x1be58a]={'$like':'%'+_0x62ffce['query']['filter']+'%'};return _0x47833b;})});}_0x177c5d=_[_0x8282('0x4d')]({},_0x177c5d,_0x62ffce[_0x8282('0x5d')]);return _0x5cb172['getTeams'](_0x177c5d);}})['then'](function(_0x34691e){if(_0x34691e){_0x4f7863=_0x34691e[_0x8282('0x3d')];if(!_0x62ffce[_0x8282('0x38')][_0x8282('0x3e')]('nolimit')){_0x177c5d[_0x8282('0x23')]=qs[_0x8282('0x23')](_0x62ffce[_0x8282('0x38')][_0x8282('0x23')]);_0x177c5d[_0x8282('0x21')]=qs[_0x8282('0x21')](_0x62ffce['query'][_0x8282('0x21')]);}return _0x5cb172[_0x8282('0x68')](_0x177c5d);}})[_0x8282('0x2b')](function(_0x5d2873){if(_0x5d2873){return _0x5d2873?{'count':_0x4f7863,'rows':_0x5d2873}:null;}})[_0x8282('0x2b')](respondWithResult(_0x304ffc,null))[_0x8282('0x49')](handleError(_0x304ffc,null));};exports[_0x8282('0x6a')]=function(_0x1f9163,_0x473232,_0x3e9bc2){var _0x243978=_0x1f9163[_0x8282('0x4e')]['ids'];return db[_0x8282('0x6b')][_0x8282('0x5e')]({'where':{'id':_0x243978},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8282('0x6c'),'attributes':['id','name',_0x8282('0x6d'),'voicePause',_0x8282('0x6e')],'raw':!![]}]})['then'](function(_0x3c2c2a){if(_0x3c2c2a){var _0x37d3ed=_['flatMap'](_0x3c2c2a,function(_0x313b41){var _0x3b3e50=_0x313b41[_0x8282('0x52')]({'plain':!![]});return _0x3b3e50[_0x8282('0x6c')];});return db[_0x8282('0x47')][_0x8282('0x54')]({'where':{'id':_0x1f9163[_0x8282('0x4b')]['id']}})[_0x8282('0x2b')](function(_0x32d46f){return db[_0x8282('0x6f')]['transaction'](function(_0x36e142){return _0x32d46f[_0x8282('0x6a')](_0x243978,{'transaction':_0x36e142})['then'](function(){return BPromise[_0x8282('0x70')](_0x37d3ed,function(_0x30b933){return db[_0x8282('0x5b')]['findOrCreate']({'where':{'UserId':_0x30b933['id'],'OpenchannelQueueId':_0x1f9163[_0x8282('0x4b')]['id']},'transaction':_0x36e142});});})['then'](function(){_0x37d3ed['forEach'](function(_0x579479){socket[_0x8282('0x71')](_0x8282('0x72'),{'UserId':_0x579479['id'],'OpenchannelQueueId':_0x32d46f['id']});});});});});}})[_0x8282('0x2b')](respondWithStatusCode(_0x473232,null))[_0x8282('0x49')](handleError(_0x473232,null));};exports[_0x8282('0x73')]=function(_0x314094,_0x4bb502,_0x12ee77){return db['Team'][_0x8282('0x5e')]({'where':{'id':_0x314094[_0x8282('0x38')][_0x8282('0x74')]},'attributes':['id'],'include':[{'model':db[_0x8282('0x5f')],'as':_0x8282('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x8282('0x2b')](handleEntityNotFound(_0x4bb502,null))['then'](function(_0x166939){var _0x53de4f=_[_0x8282('0x32')](_0x166939,'id');var _0x33ad88=[];var _0x440ba6=[];var _0x21ac6d=squel[_0x8282('0x75')]();_0x21ac6d[_0x8282('0x76')]('tq.TeamId')[_0x8282('0x77')](_0x8282('0x78'),'tq')[_0x8282('0x79')](_0x8282('0x7a'),'ut',_0x8282('0x7b'))[_0x8282('0x43')](_0x8282('0x7c'),_0x314094['params']['id']);for(var _0xbfc0e2=0x0;_0xbfc0e2<_0x166939[_0x8282('0x3d')];_0xbfc0e2+=0x1){let _0x12019e=_0x166939[_0xbfc0e2];for(var _0xa7cd26=0x0;_0xa7cd26<_0x12019e[_0x8282('0x6c')][_0x8282('0x3d')];_0xa7cd26+=0x1){let _0x4cfae5=_0x12019e['Agents'][_0xa7cd26];var _0x16f542=_0x21ac6d[_0x8282('0x7d')]();_0x16f542[_0x8282('0x43')](_0x8282('0x7e'),_0x4cfae5['id']);_0x440ba6['push'](db[_0x8282('0x6f')]['query'](_0x16f542[_0x8282('0x7f')](),{'type':db['sequelize'][_0x8282('0x80')]['SELECT']})[_0x8282('0x2b')](function(_0x4c33fe){if(_0x4c33fe[_0x8282('0x3d')]===0x1){return _0x4cfae5['id'];}else{var _0x42925f=_['every'](_['map'](_0x4c33fe,_0x8282('0x81')),function(_0x462036){return _[_0x8282('0x82')](_0x53de4f,_0x462036);});if(_0x42925f){return _0x4cfae5['id'];}}}));}}return BPromise[_0x8282('0x83')](_0x440ba6)[_0x8282('0x2b')](function(_0x3c8af6){_0x33ad88=_(_0x33ad88)[_0x8282('0x84')](_0x3c8af6)[_0x8282('0x85')]()[_0x8282('0x86')]();return db[_0x8282('0x47')][_0x8282('0x54')]({'where':{'id':_0x314094[_0x8282('0x4b')]['id']}})[_0x8282('0x2b')](function(_0x1f6686){return db[_0x8282('0x6f')][_0x8282('0x87')](function(_0x36ed6c){return _0x1f6686['removeTeams'](_0x314094[_0x8282('0x38')][_0x8282('0x74')],{'transaction':_0x36ed6c})[_0x8282('0x2b')](function(){if(!_[_0x8282('0x88')](_0x33ad88)){return _0x1f6686[_0x8282('0x89')](_0x33ad88,{'transaction':_0x36ed6c});}})['then'](function(){_0x33ad88['forEach'](function(_0x43aba9){socket[_0x8282('0x71')](_0x8282('0x8a'),{'UserId':_0x43aba9,'OpenchannelQueueId':_0x1f6686['id']});});});});});});})[_0x8282('0x2b')](respondWithStatusCode(_0x4bb502,null))['catch'](handleError(_0x4bb502,null));};exports[_0x8282('0x8b')]=function(_0x26e503,_0x11fdce,_0x581916){return db[_0x8282('0x47')][_0x8282('0x54')]({'where':{'id':_0x26e503[_0x8282('0x4b')]['id']}})[_0x8282('0x2b')](handleEntityNotFound(_0x11fdce,null))['then'](function(_0x3f11b2){if(_0x3f11b2){return _0x3f11b2[_0x8282('0x8b')](_0x26e503[_0x8282('0x4e')][_0x8282('0x74')],_[_0x8282('0x8c')](_0x26e503['body'],[_0x8282('0x74'),'id'])||{})[_0x8282('0x8d')](function(_0x1509e7){for(var _0xc5d538=0x0;_0xc5d538<_0x26e503[_0x8282('0x4e')][_0x8282('0x74')][_0x8282('0x3d')];_0xc5d538+=0x1){socket['emit'](_0x8282('0x72'),{'UserId':Number(_0x26e503[_0x8282('0x4e')]['ids'][_0xc5d538]),'OpenchannelQueueId':Number(_0x26e503[_0x8282('0x4b')]['id'])});}return _0x1509e7;});}})[_0x8282('0x2b')](respondWithResult(_0x11fdce,null))[_0x8282('0x49')](handleError(_0x11fdce,null));};exports['removeAgents']=function(_0x41014d,_0x362350,_0x1b70f0){return db[_0x8282('0x47')][_0x8282('0x54')]({'where':{'id':_0x41014d[_0x8282('0x4b')]['id']}})[_0x8282('0x2b')](handleEntityNotFound(_0x362350,null))['then'](function(_0x4b1f01){if(_0x4b1f01){return _0x4b1f01[_0x8282('0x89')](_0x41014d[_0x8282('0x38')][_0x8282('0x74')])[_0x8282('0x2b')](function(){if(_[_0x8282('0x8e')](_0x41014d['query'][_0x8282('0x74')])){for(var _0x2d5ce2=0x0;_0x2d5ce2<_0x41014d['query'][_0x8282('0x74')]['length'];_0x2d5ce2+=0x1){socket['emit'](_0x8282('0x8a'),{'UserId':Number(_0x41014d['query']['ids'][_0x2d5ce2]),'OpenchannelQueueId':Number(_0x41014d[_0x8282('0x4b')]['id'])});}}else{socket[_0x8282('0x71')](_0x8282('0x8a'),{'UserId':Number(_0x41014d[_0x8282('0x38')]['ids']),'OpenchannelQueueId':Number(_0x41014d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x362350,null))[_0x8282('0x49')](handleError(_0x362350,null));};exports[_0x8282('0x8f')]=function(_0x3d0800,_0x4007c5,_0x126a05){var _0x55c784={};var _0xb315b0={};var _0x587b6d;var _0x73f30;return db[_0x8282('0x47')][_0x8282('0x69')]({'where':{'id':_0x3d0800[_0x8282('0x4b')]['id']}})[_0x8282('0x2b')](handleEntityNotFound(_0x4007c5,null))['then'](function(_0x4261f6){if(_0x4261f6){_0x587b6d=_0x4261f6;_0xb315b0[_0x8282('0x3a')]=_[_0x8282('0x37')](db[_0x8282('0x5f')][_0x8282('0x33')]);_0xb315b0[_0x8282('0x38')]=_[_0x8282('0x37')](_0x3d0800['query']);_0xb315b0[_0x8282('0x39')]=_[_0x8282('0x4c')](_0xb315b0[_0x8282('0x3a')],_0xb315b0[_0x8282('0x38')]);_0x55c784['attributes']=_[_0x8282('0x4c')](_0xb315b0[_0x8282('0x3a')],qs[_0x8282('0x3c')](_0x3d0800['query'][_0x8282('0x3c')]));_0x55c784[_0x8282('0x3b')]=_0x55c784[_0x8282('0x3b')]['length']?_0x55c784[_0x8282('0x3b')]:_0xb315b0[_0x8282('0x3a')];_0x55c784[_0x8282('0x40')]=qs['sort'](_0x3d0800[_0x8282('0x38')][_0x8282('0x41')]);_0x55c784[_0x8282('0x43')]=qs[_0x8282('0x39')](_[_0x8282('0x42')](_0x3d0800[_0x8282('0x38')],_0xb315b0[_0x8282('0x39')]));if(_0x3d0800[_0x8282('0x38')]['filter']){_0x55c784[_0x8282('0x43')]=_[_0x8282('0x4d')](_0x55c784['where'],{'$or':_[_0x8282('0x32')](_0x55c784[_0x8282('0x3b')],function(_0x538af9){var _0x5c8b98={};_0x5c8b98[_0x538af9]={'$like':'%'+_0x3d0800[_0x8282('0x38')]['filter']+'%'};return _0x5c8b98;})});}_0x55c784=_[_0x8282('0x4d')]({},_0x55c784,_0x3d0800[_0x8282('0x5d')]);return _0x587b6d['getAgents'](_0x55c784);}})['then'](function(_0x3be572){if(_0x3be572){_0x73f30=_0x3be572[_0x8282('0x3d')];if(!_0x3d0800[_0x8282('0x38')][_0x8282('0x3e')](_0x8282('0x3f'))){_0x55c784[_0x8282('0x23')]=qs['limit'](_0x3d0800[_0x8282('0x38')][_0x8282('0x23')]);_0x55c784[_0x8282('0x21')]=qs[_0x8282('0x21')](_0x3d0800[_0x8282('0x38')]['offset']);}return _0x587b6d['getAgents'](_0x55c784);}})[_0x8282('0x2b')](function(_0x243cb2){if(_0x243cb2){return _0x243cb2?{'count':_0x73f30,'rows':_0x243cb2}:null;}})[_0x8282('0x2b')](respondWithResult(_0x4007c5,null))[_0x8282('0x49')](handleError(_0x4007c5,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 34eba4f..79211cc 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 _0x729a=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','save'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x729a,0x188));var _0xa729=function(_0x51c932,_0x3efdc5){_0x51c932=_0x51c932-0x0;var _0x2d8cb0=_0x729a[_0x51c932];return _0x2d8cb0;};'use strict';var EventEmitter=require(_0xa729('0x0'));var OpenchannelQueue=require(_0xa729('0x1'))['db'][_0xa729('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa729('0x3'),'afterUpdate':_0xa729('0x4'),'afterDestroy':_0xa729('0x5')};function emitEvent(_0x7b0bf0){return function(_0x33c593,_0x26dab1,_0x147843){OpenchannelQueueEvents['emit'](_0x7b0bf0+':'+_0x33c593['id'],_0x33c593);OpenchannelQueueEvents['emit'](_0x7b0bf0,_0x33c593);_0x147843(null);};}for(var e in events){if(events[_0xa729('0x6')](e)){var event=events[e];OpenchannelQueue[_0xa729('0x7')](e,emitEvent(event));}}module[_0xa729('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x53d7=['../../mysqldb','OpenchannelQueue','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3d8515,_0x459e8d){var _0x54c495=function(_0x471018){while(--_0x471018){_0x3d8515['push'](_0x3d8515['shift']());}};_0x54c495(++_0x459e8d);}(_0x53d7,0xf8));var _0x753d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x753d('0x0'))['db'][_0x753d('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x753d('0x2'),'afterUpdate':_0x753d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x229b33){return function(_0x4fe054,_0x2f771f,_0x55606c){OpenchannelQueueEvents[_0x753d('0x4')](_0x229b33+':'+_0x4fe054['id'],_0x4fe054);OpenchannelQueueEvents['emit'](_0x229b33,_0x4fe054);_0x55606c(null);};}for(var e in events){if(events[_0x753d('0x5')](e)){var event=events[e];OpenchannelQueue[_0x753d('0x6')](e,emitEvent(event));}}module[_0x753d('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 9243a13..7f99192 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 _0xd4a0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger'];(function(_0xd202dc,_0x2f2bfb){var _0x16ad38=function(_0x521998){while(--_0x521998){_0xd202dc['push'](_0xd202dc['shift']());}};_0x16ad38(++_0x2f2bfb);}(_0xd4a0,0xf4));var _0x0d4a=function(_0x201796,_0x596702){_0x201796=_0x201796-0x0;var _0xaea6a3=_0xd4a0[_0x201796];return _0xaea6a3;};'use strict';var _=require(_0x0d4a('0x0'));var util=require(_0x0d4a('0x1'));var logger=require(_0x0d4a('0x2'))(_0x0d4a('0x3'));var moment=require(_0x0d4a('0x4'));var BPromise=require(_0x0d4a('0x5'));var rp=require(_0x0d4a('0x6'));var fs=require('fs');var path=require(_0x0d4a('0x7'));var rimraf=require(_0x0d4a('0x8'));var config=require(_0x0d4a('0x9'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x1964ab,_0xca721d){return _0x1964ab[_0x0d4a('0xa')](_0x0d4a('0xb'),attributes,{'tableName':_0x0d4a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaea6=['../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueue.attributes','exports','OpenchannelQueue','lodash','util'];(function(_0x24f58a,_0x4405ed){var _0x561da2=function(_0x97a63e){while(--_0x97a63e){_0x24f58a['push'](_0x24f58a['shift']());}};_0x561da2(++_0x4405ed);}(_0xaea6,0x174));var _0x6aea=function(_0x5123b8,_0x29dfdc){_0x5123b8=_0x5123b8-0x0;var _0x3da0d5=_0xaea6[_0x5123b8];return _0x3da0d5;};'use strict';var _=require(_0x6aea('0x0'));var util=require(_0x6aea('0x1'));var logger=require(_0x6aea('0x2'))(_0x6aea('0x3'));var moment=require(_0x6aea('0x4'));var BPromise=require(_0x6aea('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6aea('0x6'));var rimraf=require(_0x6aea('0x7'));var config=require('../../config/environment');var attributes=require(_0x6aea('0x8'));module[_0x6aea('0x9')]=function(_0x248fcd,_0x125f23){return _0x248fcd['define'](_0x6aea('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 0827b03..9534260 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 _0xd42f=['attributes','limit','include','map','model','ShowOpenchannelQueue','find','where','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','findAll','options','raw'];(function(_0x39f92c,_0x409f40){var _0x1a8e5f=function(_0x56cf70){while(--_0x56cf70){_0x39f92c['push'](_0x39f92c['shift']());}};_0x1a8e5f(++_0x409f40);}(_0xd42f,0xa9));var _0xfd42=function(_0x349c92,_0x120dc0){_0x349c92=_0x349c92-0x0;var _0x280b09=_0xd42f[_0x349c92];return _0x280b09;};'use strict';var _=require(_0xfd42('0x0'));var util=require(_0xfd42('0x1'));var moment=require('moment');var BPromise=require(_0xfd42('0x2'));var rs=require(_0xfd42('0x3'));var fs=require('fs');var Redis=require(_0xfd42('0x4'));var db=require(_0xfd42('0x5'))['db'];var utils=require(_0xfd42('0x6'));var logger=require('../../config/logger')(_0xfd42('0x7'));var config=require(_0xfd42('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd42('0x9')][_0xfd42('0xa')]({'port':0x232a});config[_0xfd42('0xb')]=_[_0xfd42('0xc')](config['redis'],{'host':_0xfd42('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xfd42('0xe')](socket);function respondWithRpcPromise(_0xe0a7bc,_0x56dbe7,_0x53466b){return new BPromise(function(_0x1799d1,_0x53036e){return client[_0xfd42('0xf')](_0xe0a7bc,_0x53466b)[_0xfd42('0x10')](function(_0x176519){logger[_0xfd42('0x11')](_0xfd42('0x12'),_0x56dbe7,_0xfd42('0x13'));logger['debug'](_0xfd42('0x14'),_0x56dbe7,_0xfd42('0x13'),JSON[_0xfd42('0x15')](_0x176519));if(_0x176519['error']){if(_0x176519[_0xfd42('0x16')][_0xfd42('0x17')]===0x1f4){logger['error'](_0xfd42('0x12'),_0x56dbe7,_0x176519['error'][_0xfd42('0x18')]);return _0x53036e(_0x176519[_0xfd42('0x16')][_0xfd42('0x18')]);}logger[_0xfd42('0x16')](_0xfd42('0x12'),_0x56dbe7,_0x176519[_0xfd42('0x16')]['message']);return _0x1799d1(_0x176519[_0xfd42('0x16')]['message']);}else{logger[_0xfd42('0x11')](_0xfd42('0x12'),_0x56dbe7,'request\x20sent');_0x1799d1(_0x176519[_0xfd42('0x19')]['message']);}})[_0xfd42('0x1a')](function(_0x124a68){logger[_0xfd42('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x56dbe7,_0x124a68);_0x53036e(_0x124a68);});});}exports[_0xfd42('0x1b')]=function(_0x55b7b3){var _0x5dff73=this;return new Promise(function(_0x3e88ea,_0x83d35c){return db['OpenchannelQueue'][_0xfd42('0x1c')]({'raw':_0x55b7b3[_0xfd42('0x1d')]?_0x55b7b3[_0xfd42('0x1d')][_0xfd42('0x1e')]===undefined?!![]:![]:!![],'where':_0x55b7b3[_0xfd42('0x1d')]?_0x55b7b3[_0xfd42('0x1d')]['where']||null:null,'attributes':_0x55b7b3[_0xfd42('0x1d')]?_0x55b7b3['options'][_0xfd42('0x1f')]||null:null,'limit':_0x55b7b3[_0xfd42('0x1d')]?_0x55b7b3[_0xfd42('0x1d')][_0xfd42('0x20')]||null:null,'include':_0x55b7b3[_0xfd42('0x1d')]?_0x55b7b3[_0xfd42('0x1d')][_0xfd42('0x21')]?_[_0xfd42('0x22')](_0x55b7b3[_0xfd42('0x1d')][_0xfd42('0x21')],function(_0x78f19e){return{'model':db[_0x78f19e[_0xfd42('0x23')]],'as':_0x78f19e['as'],'attributes':_0x78f19e[_0xfd42('0x1f')],'include':_0x78f19e[_0xfd42('0x21')]?_[_0xfd42('0x22')](_0x78f19e[_0xfd42('0x21')],function(_0x2fd593){return{'model':db[_0x2fd593['model']],'as':_0x2fd593['as'],'attributes':_0x2fd593[_0xfd42('0x1f')],'include':_0x2fd593[_0xfd42('0x21')]?_['map'](_0x2fd593[_0xfd42('0x21')],function(_0x10c6d6){return{'model':db[_0x10c6d6[_0xfd42('0x23')]],'as':_0x10c6d6['as'],'attributes':_0x10c6d6[_0xfd42('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfd42('0x10')](function(_0x459e7a){logger[_0xfd42('0x11')](_0xfd42('0x1b'),_0x55b7b3);logger['debug'](_0xfd42('0x1b'),_0x55b7b3,JSON[_0xfd42('0x15')](_0x459e7a));_0x3e88ea(_0x459e7a);})[_0xfd42('0x1a')](function(_0xf1f9a0){logger[_0xfd42('0x16')](_0xfd42('0x1b'),_0xf1f9a0[_0xfd42('0x18')],_0x55b7b3);_0x83d35c(_0x5dff73['error'](0x1f4,_0xf1f9a0[_0xfd42('0x18')]));});});};exports[_0xfd42('0x24')]=function(_0x536e32){var _0x4007a7=this;return new Promise(function(_0x43094f,_0x1c2283){return db['OpenchannelQueue'][_0xfd42('0x25')]({'raw':_0x536e32[_0xfd42('0x1d')]?_0x536e32['options'][_0xfd42('0x1e')]===undefined?!![]:![]:!![],'where':_0x536e32['options']?_0x536e32[_0xfd42('0x1d')][_0xfd42('0x26')]||null:null,'attributes':_0x536e32[_0xfd42('0x1d')]?_0x536e32[_0xfd42('0x1d')][_0xfd42('0x1f')]||null:null,'include':_0x536e32[_0xfd42('0x1d')]?_0x536e32[_0xfd42('0x1d')][_0xfd42('0x21')]?_['map'](_0x536e32['options'][_0xfd42('0x21')],function(_0x1474ce){return{'model':db[_0x1474ce[_0xfd42('0x23')]],'as':_0x1474ce['as'],'attributes':_0x1474ce[_0xfd42('0x1f')],'include':_0x1474ce['include']?_[_0xfd42('0x22')](_0x1474ce[_0xfd42('0x21')],function(_0x4da322){return{'model':db[_0x4da322['model']],'as':_0x4da322['as'],'attributes':_0x4da322[_0xfd42('0x1f')],'include':_0x4da322[_0xfd42('0x21')]?_[_0xfd42('0x22')](_0x4da322[_0xfd42('0x21')],function(_0x451633){return{'model':db[_0x451633[_0xfd42('0x23')]],'as':_0x451633['as'],'attributes':_0x451633[_0xfd42('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfd42('0x10')](function(_0x104361){logger[_0xfd42('0x11')](_0xfd42('0x24'),_0x536e32);logger[_0xfd42('0x27')]('ShowOpenchannelQueue',_0x536e32,JSON[_0xfd42('0x15')](_0x104361));_0x43094f(_0x104361);})[_0xfd42('0x1a')](function(_0x1be8d5){logger[_0xfd42('0x16')](_0xfd42('0x24'),_0x1be8d5[_0xfd42('0x18')],_0x536e32);_0x1c2283(_0x4007a7[_0xfd42('0x16')](0x1f4,_0x1be8d5[_0xfd42('0x18')]));});});}; \ No newline at end of file +var _0x4701=['OpenchannelQueue','options','attributes','limit','include','map','model','stringify','ShowOpenchannelQueue','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','GetOpenchannelQueue'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4701,0x18b));var _0x1470=function(_0x3927c,_0x4dee92){_0x3927c=_0x3927c-0x0;var _0x46e643=_0x4701[_0x3927c];return _0x46e643;};'use strict';var _=require(_0x1470('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1470('0x1'));var fs=require('fs');var Redis=require(_0x1470('0x2'));var db=require(_0x1470('0x3'))['db'];var utils=require(_0x1470('0x4'));var logger=require('../../config/logger')(_0x1470('0x5'));var config=require(_0x1470('0x6'));var jayson=require(_0x1470('0x7'));var client=jayson[_0x1470('0x8')]['http']({'port':0x232a});config['redis']=_[_0x1470('0x9')](config['redis'],{'host':_0x1470('0xa'),'port':0x18eb});var socket=require(_0x1470('0xb'))(new Redis(config[_0x1470('0xc')]));require(_0x1470('0xd'))[_0x1470('0xe')](socket);function respondWithRpcPromise(_0x537c04,_0x329629,_0x4497df){return new BPromise(function(_0x1cb252,_0x593dc2){return client['request'](_0x537c04,_0x4497df)[_0x1470('0xf')](function(_0xfb2def){logger[_0x1470('0x10')](_0x1470('0x11'),_0x329629,'request\x20sent');logger[_0x1470('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x329629,_0x1470('0x13'),JSON['stringify'](_0xfb2def));if(_0xfb2def[_0x1470('0x14')]){if(_0xfb2def[_0x1470('0x14')]['code']===0x1f4){logger[_0x1470('0x14')](_0x1470('0x11'),_0x329629,_0xfb2def[_0x1470('0x14')][_0x1470('0x15')]);return _0x593dc2(_0xfb2def[_0x1470('0x14')]['message']);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x329629,_0xfb2def[_0x1470('0x14')]['message']);return _0x1cb252(_0xfb2def['error'][_0x1470('0x15')]);}else{logger[_0x1470('0x10')](_0x1470('0x11'),_0x329629,_0x1470('0x13'));_0x1cb252(_0xfb2def[_0x1470('0x16')][_0x1470('0x15')]);}})[_0x1470('0x17')](function(_0x2b8c99){logger[_0x1470('0x14')](_0x1470('0x11'),_0x329629,_0x2b8c99);_0x593dc2(_0x2b8c99);});});}exports[_0x1470('0x18')]=function(_0x150e2e){var _0x9f9c74=this;return new Promise(function(_0x3144a0,_0x358bea){return db[_0x1470('0x19')]['findAll']({'raw':_0x150e2e['options']?_0x150e2e[_0x1470('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x150e2e[_0x1470('0x1a')]?_0x150e2e[_0x1470('0x1a')]['where']||null:null,'attributes':_0x150e2e[_0x1470('0x1a')]?_0x150e2e[_0x1470('0x1a')][_0x1470('0x1b')]||null:null,'limit':_0x150e2e['options']?_0x150e2e[_0x1470('0x1a')][_0x1470('0x1c')]||null:null,'include':_0x150e2e[_0x1470('0x1a')]?_0x150e2e[_0x1470('0x1a')][_0x1470('0x1d')]?_[_0x1470('0x1e')](_0x150e2e['options'][_0x1470('0x1d')],function(_0x517490){return{'model':db[_0x517490['model']],'as':_0x517490['as'],'attributes':_0x517490['attributes'],'include':_0x517490[_0x1470('0x1d')]?_[_0x1470('0x1e')](_0x517490[_0x1470('0x1d')],function(_0xb8df4c){return{'model':db[_0xb8df4c[_0x1470('0x1f')]],'as':_0xb8df4c['as'],'attributes':_0xb8df4c[_0x1470('0x1b')],'include':_0xb8df4c[_0x1470('0x1d')]?_[_0x1470('0x1e')](_0xb8df4c[_0x1470('0x1d')],function(_0x12dc67){return{'model':db[_0x12dc67[_0x1470('0x1f')]],'as':_0x12dc67['as'],'attributes':_0x12dc67[_0x1470('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1470('0xf')](function(_0x498bf5){logger['info'](_0x1470('0x18'),_0x150e2e);logger['debug']('GetOpenchannelQueue',_0x150e2e,JSON[_0x1470('0x20')](_0x498bf5));_0x3144a0(_0x498bf5);})[_0x1470('0x17')](function(_0x5653eb){logger[_0x1470('0x14')](_0x1470('0x18'),_0x5653eb[_0x1470('0x15')],_0x150e2e);_0x358bea(_0x9f9c74[_0x1470('0x14')](0x1f4,_0x5653eb[_0x1470('0x15')]));});});};exports[_0x1470('0x21')]=function(_0x4260e6){var _0x2a7ceb=this;return new Promise(function(_0xcf692a,_0x119984){return db[_0x1470('0x19')]['find']({'raw':_0x4260e6['options']?_0x4260e6[_0x1470('0x1a')][_0x1470('0x22')]===undefined?!![]:![]:!![],'where':_0x4260e6[_0x1470('0x1a')]?_0x4260e6[_0x1470('0x1a')]['where']||null:null,'attributes':_0x4260e6['options']?_0x4260e6[_0x1470('0x1a')][_0x1470('0x1b')]||null:null,'include':_0x4260e6[_0x1470('0x1a')]?_0x4260e6[_0x1470('0x1a')]['include']?_[_0x1470('0x1e')](_0x4260e6[_0x1470('0x1a')][_0x1470('0x1d')],function(_0x302bbf){return{'model':db[_0x302bbf[_0x1470('0x1f')]],'as':_0x302bbf['as'],'attributes':_0x302bbf[_0x1470('0x1b')],'include':_0x302bbf[_0x1470('0x1d')]?_[_0x1470('0x1e')](_0x302bbf['include'],function(_0x5bec0c){return{'model':db[_0x5bec0c['model']],'as':_0x5bec0c['as'],'attributes':_0x5bec0c[_0x1470('0x1b')],'include':_0x5bec0c[_0x1470('0x1d')]?_['map'](_0x5bec0c[_0x1470('0x1d')],function(_0x4727c3){return{'model':db[_0x4727c3['model']],'as':_0x4727c3['as'],'attributes':_0x4727c3[_0x1470('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1470('0xf')](function(_0x607688){logger[_0x1470('0x10')](_0x1470('0x21'),_0x4260e6);logger[_0x1470('0x12')](_0x1470('0x21'),_0x4260e6,JSON[_0x1470('0x20')](_0x607688));_0xcf692a(_0x607688);})[_0x1470('0x17')](function(_0x31491e){logger[_0x1470('0x14')](_0x1470('0x21'),_0x31491e[_0x1470('0x15')],_0x4260e6);_0x119984(_0x2a7ceb[_0x1470('0x14')](0x1f4,_0x31491e[_0x1470('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index c6251b0..278e266 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 _0x9718=['emit','removeListener','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9718,0x176));var _0x8971=function(_0x54f7c7,_0x284b46){_0x54f7c7=_0x54f7c7-0x0;var _0x4aadf5=_0x9718[_0x54f7c7];return _0x4aadf5;};'use strict';var OpenchannelQueueEvents=require(_0x8971('0x0'));var events=['save','remove','update'];function createListener(_0x3b6747,_0x281c45){return function(_0x43bb80){_0x281c45[_0x8971('0x1')](_0x3b6747,_0x43bb80);};}function removeListener(_0x5c5569,_0x144941){return function(){OpenchannelQueueEvents[_0x8971('0x2')](_0x5c5569,_0x144941);};}exports['register']=function(_0x4408e4){for(var _0x2d4bf8=0x0,_0xb16520=events[_0x8971('0x3')];_0x2d4bf8<_0xb16520;_0x2d4bf8++){var _0x324ade=events[_0x2d4bf8];var _0x366adc=createListener(_0x8971('0x4')+_0x324ade,_0x4408e4);OpenchannelQueueEvents['on'](_0x324ade,_0x366adc);}}; \ No newline at end of file +var _0x5b3d=['openchannelQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5b3d,0x71));var _0xd5b3=function(_0x592ebe,_0x299ff7){_0x592ebe=_0x592ebe-0x0;var _0x58948d=_0x5b3d[_0x592ebe];return _0x58948d;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xd5b3('0x0'),_0xd5b3('0x1'),_0xd5b3('0x2')];function createListener(_0x2620ec,_0x51f1ca){return function(_0x2c05f6){_0x51f1ca[_0xd5b3('0x3')](_0x2620ec,_0x2c05f6);};}function removeListener(_0x2deb5e,_0x224873){return function(){OpenchannelQueueEvents[_0xd5b3('0x4')](_0x2deb5e,_0x224873);};}exports[_0xd5b3('0x5')]=function(_0x3fcac9){for(var _0x4dc055=0x0,_0x4a604e=events[_0xd5b3('0x6')];_0x4dc055<_0x4a604e;_0x4dc055++){var _0x12750f=events[_0x4dc055];var _0xbe5bed=createListener(_0xd5b3('0x7')+_0x12750f,_0x3fcac9);OpenchannelQueueEvents['on'](_0x12750f,_0xbe5bed);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 06a80a9..8e6fe02 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 _0x1c9f=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xd274ec,_0x6b590b){var _0x5345c8=function(_0x3bf623){while(--_0x3bf623){_0xd274ec['push'](_0xd274ec['shift']());}};_0x5345c8(++_0x6b590b);}(_0x1c9f,0xa8));var _0xf1c9=function(_0x410c10,_0x3b54fa){_0x410c10=_0x410c10-0x0;var _0x2a7ce7=_0x1c9f[_0x410c10];return _0x2a7ce7;};'use strict';var multer=require(_0xf1c9('0x0'));var util=require(_0xf1c9('0x1'));var path=require(_0xf1c9('0x2'));var timeout=require(_0xf1c9('0x3'));var express=require(_0xf1c9('0x4'));var router=express[_0xf1c9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf1c9('0x6'));var interaction=require(_0xf1c9('0x7'));var config=require(_0xf1c9('0x8'));var controller=require('./openchannelQueueReport.controller');router[_0xf1c9('0x9')]('/',auth[_0xf1c9('0xa')](),controller[_0xf1c9('0xb')]);router[_0xf1c9('0x9')](_0xf1c9('0xc'),auth[_0xf1c9('0xa')](),controller[_0xf1c9('0xd')]);router[_0xf1c9('0x9')]('/:id',auth[_0xf1c9('0xa')](),controller[_0xf1c9('0xe')]);router[_0xf1c9('0xf')]('/',auth[_0xf1c9('0xa')](),controller[_0xf1c9('0x10')]);router[_0xf1c9('0x11')](_0xf1c9('0x12'),auth[_0xf1c9('0xa')](),controller[_0xf1c9('0x13')]);router['delete'](_0xf1c9('0x12'),auth[_0xf1c9('0xa')](),controller[_0xf1c9('0x14')]);module[_0xf1c9('0x15')]=router; \ No newline at end of file +var _0x4722=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x416e89,_0x1c1069){var _0x3a4662=function(_0x2ca1dc){while(--_0x2ca1dc){_0x416e89['push'](_0x416e89['shift']());}};_0x3a4662(++_0x1c1069);}(_0x4722,0x112));var _0x2472=function(_0x567ab1,_0x4bbef0){_0x567ab1=_0x567ab1-0x0;var _0x376f3e=_0x4722[_0x567ab1];return _0x376f3e;};'use strict';var multer=require(_0x2472('0x0'));var util=require(_0x2472('0x1'));var path=require('path');var timeout=require(_0x2472('0x2'));var express=require(_0x2472('0x3'));var router=express[_0x2472('0x4')]();var fs_extra=require(_0x2472('0x5'));var auth=require(_0x2472('0x6'));var interaction=require(_0x2472('0x7'));var config=require(_0x2472('0x8'));var controller=require('./openchannelQueueReport.controller');router[_0x2472('0x9')]('/',auth[_0x2472('0xa')](),controller['index']);router['get'](_0x2472('0xb'),auth[_0x2472('0xa')](),controller[_0x2472('0xc')]);router['get'](_0x2472('0xd'),auth['isAuthenticated'](),controller[_0x2472('0xe')]);router[_0x2472('0xf')]('/',auth[_0x2472('0xa')](),controller['create']);router[_0x2472('0x10')](_0x2472('0xd'),auth['isAuthenticated'](),controller[_0x2472('0x11')]);router[_0x2472('0x12')](_0x2472('0xd'),auth['isAuthenticated'](),controller[_0x2472('0x13')]);module[_0x2472('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index b81c735..c28a986 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 _0x655d=['STRING','DATE','moment','exports'];(function(_0x13a2de,_0x35b4e2){var _0x35e65d=function(_0x2b9098){while(--_0x2b9098){_0x13a2de['push'](_0x13a2de['shift']());}};_0x35e65d(++_0x35b4e2);}(_0x655d,0x172));var _0xd655=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x655d[_0x413feb];return _0x40ee88;};'use strict';var moment=require(_0xd655('0x0'));var Sequelize=require('sequelize');module[_0xd655('0x1')]={'uniqueid':{'type':Sequelize[_0xd655('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd655('0x3')]},'leaveAt':{'type':Sequelize[_0xd655('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd655('0x3')]},'reason':{'type':Sequelize[_0xd655('0x2')]}}; \ No newline at end of file +var _0xf181=['exports','DATE','STRING','moment','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf181,0x6c));var _0x1f18=function(_0x57fc06,_0xb11b51){_0x57fc06=_0x57fc06-0x0;var _0x4596b6=_0xf181[_0x57fc06];return _0x4596b6;};'use strict';var moment=require(_0x1f18('0x0'));var Sequelize=require(_0x1f18('0x1'));module[_0x1f18('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1f18('0x3')]},'leaveAt':{'type':Sequelize[_0x1f18('0x3')]},'acceptAt':{'type':Sequelize[_0x1f18('0x3')]},'exitAt':{'type':Sequelize[_0x1f18('0x3')]},'reason':{'type':Sequelize[_0x1f18('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index d7d578c..5232891 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 _0xbfd2=['OpenchannelQueueReport','rawAttributes','fieldName','type','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','order','sort','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','body','catch','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map'];(function(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0xbfd2,0x1e6));var _0x2bfd=function(_0x337743,_0x3e28be){_0x337743=_0x337743-0x0;var _0x180dfc=_0xbfd2[_0x337743];return _0x180dfc;};'use strict';var emlformat=require(_0x2bfd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2bfd('0x1'));var jsonpatch=require(_0x2bfd('0x2'));var rp=require(_0x2bfd('0x3'));var moment=require(_0x2bfd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2bfd('0x5'));var path=require(_0x2bfd('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2bfd('0x7'));var fs=require('fs');var fs_extra=require(_0x2bfd('0x8'));var _=require('lodash');var squel=require(_0x2bfd('0x9'));var crypto=require(_0x2bfd('0xa'));var jsforce=require(_0x2bfd('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2bfd('0xc'));var querystring=require(_0x2bfd('0xd'));var Papa=require(_0x2bfd('0xe'));var Redis=require(_0x2bfd('0xf'));var authService=require(_0x2bfd('0x10'));var qs=require(_0x2bfd('0x11'));var as=require(_0x2bfd('0x12'));var hardwareService=require(_0x2bfd('0x13'));var logger=require(_0x2bfd('0x14'))(_0x2bfd('0x15'));var utils=require(_0x2bfd('0x16'));var config=require(_0x2bfd('0x17'));var licenseUtil=require(_0x2bfd('0x18'));var db=require(_0x2bfd('0x19'))['db'];function respondWithStatusCode(_0x3b8059,_0x3f5e12){_0x3f5e12=_0x3f5e12||0xcc;return function(_0x3171a2){if(_0x3171a2){return _0x3b8059[_0x2bfd('0x1a')](_0x3f5e12);}return _0x3b8059[_0x2bfd('0x1b')](_0x3f5e12)[_0x2bfd('0x1c')]();};}function respondWithResult(_0x10e0a1,_0x39289b){_0x39289b=_0x39289b||0xc8;return function(_0x40e0d7){if(_0x40e0d7){return _0x10e0a1[_0x2bfd('0x1b')](_0x39289b)[_0x2bfd('0x1d')](_0x40e0d7);}};}function respondWithFilteredResult(_0x1a2485,_0x3ff2a1){return function(_0x2e8f38){if(_0x2e8f38){var _0x2a6081=typeof _0x3ff2a1[_0x2bfd('0x1e')]===_0x2bfd('0x1f')&&typeof _0x3ff2a1[_0x2bfd('0x20')]==='undefined';var _0x29459e=_0x2e8f38[_0x2bfd('0x21')];var _0x57ff50=_0x2a6081?0x0:_0x3ff2a1[_0x2bfd('0x1e')];var _0xa5e21c=_0x2a6081?_0x2e8f38['count']:_0x3ff2a1[_0x2bfd('0x1e')]+_0x3ff2a1[_0x2bfd('0x20')];var _0x217585;if(_0xa5e21c>=_0x29459e){_0xa5e21c=_0x29459e;_0x217585=0xc8;}else{_0x217585=0xce;}_0x1a2485[_0x2bfd('0x1b')](_0x217585);return _0x1a2485[_0x2bfd('0x22')](_0x2bfd('0x23'),_0x57ff50+'-'+_0xa5e21c+'/'+_0x29459e)[_0x2bfd('0x1d')](_0x2e8f38);}return null;};}function patchUpdates(_0x3d4750){return function(_0x517c88){try{jsonpatch['apply'](_0x517c88,_0x3d4750,!![]);}catch(_0xf68e03){return BPromise[_0x2bfd('0x24')](_0xf68e03);}return _0x517c88['save']();};}function saveUpdates(_0x3652c1,_0xa74de2){return function(_0x14ee07){if(_0x14ee07){return _0x14ee07[_0x2bfd('0x25')](_0x3652c1)[_0x2bfd('0x26')](function(_0x40036b){return _0x40036b;});}return null;};}function removeEntity(_0x93a00b,_0x2b8e59){return function(_0x341fb3){if(_0x341fb3){return _0x341fb3[_0x2bfd('0x27')]()[_0x2bfd('0x26')](function(){_0x93a00b[_0x2bfd('0x1b')](0xcc)[_0x2bfd('0x1c')]();});}};}function handleEntityNotFound(_0x435c22,_0x1304b4){return function(_0x36588e){if(!_0x36588e){_0x435c22[_0x2bfd('0x1a')](0x194);}return _0x36588e;};}function handleError(_0x134893,_0x3d7567){_0x3d7567=_0x3d7567||0x1f4;return function(_0x4d8f7e){logger[_0x2bfd('0x28')](_0x4d8f7e[_0x2bfd('0x29')]);if(_0x4d8f7e['name']){delete _0x4d8f7e[_0x2bfd('0x2a')];}_0x134893[_0x2bfd('0x1b')](_0x3d7567)[_0x2bfd('0x2b')](_0x4d8f7e);};}exports[_0x2bfd('0x2c')]=function(_0x19717b,_0x47fb5e){var _0x23d053={},_0x567f4b={},_0x57eebf={'count':0x0,'rows':[]};var _0x371cd6=_[_0x2bfd('0x2d')](db[_0x2bfd('0x2e')][_0x2bfd('0x2f')],function(_0x155719){return{'name':_0x155719[_0x2bfd('0x30')],'type':_0x155719[_0x2bfd('0x31')]['key']};});_0x567f4b['model']=_[_0x2bfd('0x2d')](_0x371cd6,_0x2bfd('0x2a'));_0x567f4b['query']=_[_0x2bfd('0x32')](_0x19717b[_0x2bfd('0x33')]);_0x567f4b[_0x2bfd('0x34')]=_[_0x2bfd('0x35')](_0x567f4b['model'],_0x567f4b['query']);_0x23d053['attributes']=_[_0x2bfd('0x35')](_0x567f4b['model'],qs['fields'](_0x19717b[_0x2bfd('0x33')][_0x2bfd('0x36')]));_0x23d053[_0x2bfd('0x37')]=_0x23d053[_0x2bfd('0x37')][_0x2bfd('0x38')]?_0x23d053[_0x2bfd('0x37')]:_0x567f4b[_0x2bfd('0x39')];if(!_0x19717b[_0x2bfd('0x33')][_0x2bfd('0x3a')]('nolimit')){_0x23d053['limit']=qs['limit'](_0x19717b[_0x2bfd('0x33')]['limit']);_0x23d053[_0x2bfd('0x1e')]=qs[_0x2bfd('0x1e')](_0x19717b[_0x2bfd('0x33')][_0x2bfd('0x1e')]);}_0x23d053[_0x2bfd('0x3b')]=qs[_0x2bfd('0x3c')](_0x19717b['query'][_0x2bfd('0x3c')]);_0x23d053['where']=qs[_0x2bfd('0x34')](_['pick'](_0x19717b['query'],_0x567f4b[_0x2bfd('0x34')]),_0x371cd6);if(_0x19717b[_0x2bfd('0x33')][_0x2bfd('0x3d')]){_0x23d053['where']=_[_0x2bfd('0x3e')](_0x23d053['where'],{'$or':_['map'](_0x371cd6,function(_0x159295){if(_0x159295[_0x2bfd('0x31')]!==_0x2bfd('0x3f')){var _0x380af0={};_0x380af0[_0x159295[_0x2bfd('0x2a')]]={'$like':'%'+_0x19717b['query'][_0x2bfd('0x3d')]+'%'};return _0x380af0;}})});}_0x23d053=_[_0x2bfd('0x3e')]({},_0x23d053,_0x19717b[_0x2bfd('0x40')]);var _0x42a133={'where':_0x23d053[_0x2bfd('0x41')]};return db[_0x2bfd('0x2e')][_0x2bfd('0x21')](_0x42a133)[_0x2bfd('0x26')](function(_0x5844e3){_0x57eebf['count']=_0x5844e3;if(_0x19717b[_0x2bfd('0x33')][_0x2bfd('0x42')]){_0x23d053[_0x2bfd('0x43')]=[{'all':!![]}];}return db[_0x2bfd('0x2e')][_0x2bfd('0x44')](_0x23d053);})[_0x2bfd('0x26')](function(_0x5bc8aa){_0x57eebf[_0x2bfd('0x45')]=_0x5bc8aa;return _0x57eebf;})[_0x2bfd('0x26')](respondWithFilteredResult(_0x47fb5e,_0x23d053))['catch'](handleError(_0x47fb5e,null));};exports[_0x2bfd('0x46')]=function(_0x4b4a1d,_0x3aed0e){var _0x33ecf2={'raw':!![],'where':{'id':_0x4b4a1d[_0x2bfd('0x47')]['id']}},_0x3be835={};_0x3be835['model']=_[_0x2bfd('0x32')](db['OpenchannelQueueReport'][_0x2bfd('0x2f')]);_0x3be835['query']=_['keys'](_0x4b4a1d[_0x2bfd('0x33')]);_0x3be835[_0x2bfd('0x34')]=_['intersection'](_0x3be835[_0x2bfd('0x39')],_0x3be835['query']);_0x33ecf2[_0x2bfd('0x37')]=_[_0x2bfd('0x35')](_0x3be835[_0x2bfd('0x39')],qs[_0x2bfd('0x36')](_0x4b4a1d[_0x2bfd('0x33')][_0x2bfd('0x36')]));_0x33ecf2[_0x2bfd('0x37')]=_0x33ecf2[_0x2bfd('0x37')][_0x2bfd('0x38')]?_0x33ecf2[_0x2bfd('0x37')]:_0x3be835[_0x2bfd('0x39')];if(_0x4b4a1d[_0x2bfd('0x33')]['includeAll']){_0x33ecf2['include']=[{'all':!![]}];}_0x33ecf2=_[_0x2bfd('0x3e')]({},_0x33ecf2,_0x4b4a1d['options']);return db[_0x2bfd('0x2e')]['find'](_0x33ecf2)[_0x2bfd('0x26')](handleEntityNotFound(_0x3aed0e,null))[_0x2bfd('0x26')](respondWithResult(_0x3aed0e,null))['catch'](handleError(_0x3aed0e,null));};exports['create']=function(_0x5c3fb7,_0x9acca9){return db['OpenchannelQueueReport']['create'](_0x5c3fb7[_0x2bfd('0x48')],{})[_0x2bfd('0x26')](respondWithResult(_0x9acca9,0xc9))[_0x2bfd('0x49')](handleError(_0x9acca9,null));};exports['update']=function(_0x2ffe62,_0x17da1b){if(_0x2ffe62['body']['id']){delete _0x2ffe62[_0x2bfd('0x48')]['id'];}return db[_0x2bfd('0x2e')][_0x2bfd('0x4a')]({'where':{'id':_0x2ffe62[_0x2bfd('0x47')]['id']}})['then'](handleEntityNotFound(_0x17da1b,null))[_0x2bfd('0x26')](saveUpdates(_0x2ffe62['body'],null))['then'](respondWithResult(_0x17da1b,null))[_0x2bfd('0x49')](handleError(_0x17da1b,null));};exports[_0x2bfd('0x27')]=function(_0x20f483,_0x54c167){return db[_0x2bfd('0x2e')][_0x2bfd('0x4a')]({'where':{'id':_0x20f483[_0x2bfd('0x47')]['id']}})[_0x2bfd('0x26')](handleEntityNotFound(_0x54c167,null))[_0x2bfd('0x26')](removeEntity(_0x54c167,null))[_0x2bfd('0x49')](handleError(_0x54c167,null));};exports[_0x2bfd('0x4b')]=function(_0x592e59,_0x7bdcf2){return db['OpenchannelQueueReport']['describe']()[_0x2bfd('0x26')](respondWithResult(_0x7bdcf2,null))[_0x2bfd('0x49')](handleError(_0x7bdcf2,null));}; \ No newline at end of file +var _0x6751=['json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','OpenchannelQueueReport','rawAttributes','key','map','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','order','sort','filter','merge','where','include','findAll','rows','catch','params','length','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end'];(function(_0xbc8873,_0x160489){var _0x5289fd=function(_0x35583f){while(--_0x35583f){_0xbc8873['push'](_0xbc8873['shift']());}};_0x5289fd(++_0x160489);}(_0x6751,0x185));var _0x1675=function(_0x36d20f,_0x133196){_0x36d20f=_0x36d20f-0x0;var _0x324a71=_0x6751[_0x36d20f];return _0x324a71;};'use strict';var emlformat=require(_0x1675('0x0'));var rimraf=require(_0x1675('0x1'));var zipdir=require(_0x1675('0x2'));var jsonpatch=require(_0x1675('0x3'));var rp=require(_0x1675('0x4'));var moment=require('moment');var BPromise=require(_0x1675('0x5'));var Mustache=require('mustache');var util=require(_0x1675('0x6'));var path=require(_0x1675('0x7'));var sox=require(_0x1675('0x8'));var csv=require(_0x1675('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1675('0xa'));var _=require(_0x1675('0xb'));var squel=require('squel');var crypto=require(_0x1675('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1675('0xd'));var toCsv=require(_0x1675('0x9'));var querystring=require(_0x1675('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1675('0xf'));var qs=require(_0x1675('0x10'));var as=require(_0x1675('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1675('0x12'))(_0x1675('0x13'));var utils=require(_0x1675('0x14'));var config=require(_0x1675('0x15'));var licenseUtil=require(_0x1675('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bbafa,_0x2f9cba){_0x2f9cba=_0x2f9cba||0xcc;return function(_0x2f4af2){if(_0x2f4af2){return _0x5bbafa['sendStatus'](_0x2f9cba);}return _0x5bbafa[_0x1675('0x17')](_0x2f9cba)[_0x1675('0x18')]();};}function respondWithResult(_0x2becae,_0x49f044){_0x49f044=_0x49f044||0xc8;return function(_0x48f170){if(_0x48f170){return _0x2becae['status'](_0x49f044)[_0x1675('0x19')](_0x48f170);}};}function respondWithFilteredResult(_0x3d223c,_0x255170){return function(_0x3f65a6){if(_0x3f65a6){var _0x2d3f04=typeof _0x255170[_0x1675('0x1a')]==='undefined'&&typeof _0x255170[_0x1675('0x1b')]===_0x1675('0x1c');var _0x4ce9fd=_0x3f65a6[_0x1675('0x1d')];var _0x4ac12f=_0x2d3f04?0x0:_0x255170[_0x1675('0x1a')];var _0x441229=_0x2d3f04?_0x3f65a6['count']:_0x255170[_0x1675('0x1a')]+_0x255170[_0x1675('0x1b')];var _0x324844;if(_0x441229>=_0x4ce9fd){_0x441229=_0x4ce9fd;_0x324844=0xc8;}else{_0x324844=0xce;}_0x3d223c['status'](_0x324844);return _0x3d223c[_0x1675('0x1e')]('Content-Range',_0x4ac12f+'-'+_0x441229+'/'+_0x4ce9fd)['json'](_0x3f65a6);}return null;};}function patchUpdates(_0xbd5e14){return function(_0x351130){try{jsonpatch[_0x1675('0x1f')](_0x351130,_0xbd5e14,!![]);}catch(_0x42fb7e){return BPromise[_0x1675('0x20')](_0x42fb7e);}return _0x351130[_0x1675('0x21')]();};}function saveUpdates(_0x28d701,_0x743762){return function(_0x34f7dd){if(_0x34f7dd){return _0x34f7dd[_0x1675('0x22')](_0x28d701)[_0x1675('0x23')](function(_0x463a18){return _0x463a18;});}return null;};}function removeEntity(_0x652f43,_0x2dfae6){return function(_0x3d82c1){if(_0x3d82c1){return _0x3d82c1['destroy']()[_0x1675('0x23')](function(){_0x652f43[_0x1675('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfd4acd,_0x5e6f53){return function(_0x9c01ca){if(!_0x9c01ca){_0xfd4acd['sendStatus'](0x194);}return _0x9c01ca;};}function handleError(_0xe2c149,_0x37757b){_0x37757b=_0x37757b||0x1f4;return function(_0x31f5ca){logger[_0x1675('0x24')](_0x31f5ca[_0x1675('0x25')]);if(_0x31f5ca[_0x1675('0x26')]){delete _0x31f5ca['name'];}_0xe2c149['status'](_0x37757b)[_0x1675('0x27')](_0x31f5ca);};}exports['index']=function(_0x6526ee,_0x35b371){var _0x53d86f={},_0x5e28c2={},_0x52b9b3={'count':0x0,'rows':[]};var _0x3d2259=_['map'](db[_0x1675('0x28')][_0x1675('0x29')],function(_0x3c0190){return{'name':_0x3c0190['fieldName'],'type':_0x3c0190['type'][_0x1675('0x2a')]};});_0x5e28c2['model']=_[_0x1675('0x2b')](_0x3d2259,_0x1675('0x26'));_0x5e28c2[_0x1675('0x2c')]=_[_0x1675('0x2d')](_0x6526ee['query']);_0x5e28c2[_0x1675('0x2e')]=_['intersection'](_0x5e28c2['model'],_0x5e28c2['query']);_0x53d86f[_0x1675('0x2f')]=_[_0x1675('0x30')](_0x5e28c2[_0x1675('0x31')],qs[_0x1675('0x32')](_0x6526ee[_0x1675('0x2c')]['fields']));_0x53d86f['attributes']=_0x53d86f['attributes']['length']?_0x53d86f['attributes']:_0x5e28c2[_0x1675('0x31')];if(!_0x6526ee[_0x1675('0x2c')][_0x1675('0x33')]('nolimit')){_0x53d86f[_0x1675('0x1b')]=qs['limit'](_0x6526ee[_0x1675('0x2c')][_0x1675('0x1b')]);_0x53d86f[_0x1675('0x1a')]=qs['offset'](_0x6526ee[_0x1675('0x2c')][_0x1675('0x1a')]);}_0x53d86f[_0x1675('0x34')]=qs[_0x1675('0x35')](_0x6526ee['query'][_0x1675('0x35')]);_0x53d86f['where']=qs[_0x1675('0x2e')](_['pick'](_0x6526ee[_0x1675('0x2c')],_0x5e28c2[_0x1675('0x2e')]),_0x3d2259);if(_0x6526ee[_0x1675('0x2c')][_0x1675('0x36')]){_0x53d86f['where']=_[_0x1675('0x37')](_0x53d86f[_0x1675('0x38')],{'$or':_[_0x1675('0x2b')](_0x3d2259,function(_0x58c59f){if(_0x58c59f['type']!=='VIRTUAL'){var _0x533d67={};_0x533d67[_0x58c59f[_0x1675('0x26')]]={'$like':'%'+_0x6526ee[_0x1675('0x2c')][_0x1675('0x36')]+'%'};return _0x533d67;}})});}_0x53d86f=_[_0x1675('0x37')]({},_0x53d86f,_0x6526ee['options']);var _0x58dde5={'where':_0x53d86f['where']};return db['OpenchannelQueueReport'][_0x1675('0x1d')](_0x58dde5)[_0x1675('0x23')](function(_0x3b4a26){_0x52b9b3[_0x1675('0x1d')]=_0x3b4a26;if(_0x6526ee[_0x1675('0x2c')]['includeAll']){_0x53d86f[_0x1675('0x39')]=[{'all':!![]}];}return db[_0x1675('0x28')][_0x1675('0x3a')](_0x53d86f);})['then'](function(_0x2b1aa1){_0x52b9b3[_0x1675('0x3b')]=_0x2b1aa1;return _0x52b9b3;})['then'](respondWithFilteredResult(_0x35b371,_0x53d86f))[_0x1675('0x3c')](handleError(_0x35b371,null));};exports['show']=function(_0x146323,_0x2c7396){var _0x5e4224={'raw':!![],'where':{'id':_0x146323[_0x1675('0x3d')]['id']}},_0x156e18={};_0x156e18[_0x1675('0x31')]=_['keys'](db[_0x1675('0x28')][_0x1675('0x29')]);_0x156e18[_0x1675('0x2c')]=_[_0x1675('0x2d')](_0x146323[_0x1675('0x2c')]);_0x156e18['filters']=_[_0x1675('0x30')](_0x156e18[_0x1675('0x31')],_0x156e18[_0x1675('0x2c')]);_0x5e4224[_0x1675('0x2f')]=_[_0x1675('0x30')](_0x156e18[_0x1675('0x31')],qs[_0x1675('0x32')](_0x146323[_0x1675('0x2c')][_0x1675('0x32')]));_0x5e4224[_0x1675('0x2f')]=_0x5e4224['attributes'][_0x1675('0x3e')]?_0x5e4224[_0x1675('0x2f')]:_0x156e18[_0x1675('0x31')];if(_0x146323[_0x1675('0x2c')]['includeAll']){_0x5e4224[_0x1675('0x39')]=[{'all':!![]}];}_0x5e4224=_[_0x1675('0x37')]({},_0x5e4224,_0x146323[_0x1675('0x3f')]);return db['OpenchannelQueueReport'][_0x1675('0x40')](_0x5e4224)[_0x1675('0x23')](handleEntityNotFound(_0x2c7396,null))[_0x1675('0x23')](respondWithResult(_0x2c7396,null))[_0x1675('0x3c')](handleError(_0x2c7396,null));};exports[_0x1675('0x41')]=function(_0x35e121,_0x2345c4){return db[_0x1675('0x28')][_0x1675('0x41')](_0x35e121['body'],{})[_0x1675('0x23')](respondWithResult(_0x2345c4,0xc9))['catch'](handleError(_0x2345c4,null));};exports[_0x1675('0x22')]=function(_0x1504e5,_0x47dc91){if(_0x1504e5[_0x1675('0x42')]['id']){delete _0x1504e5[_0x1675('0x42')]['id'];}return db[_0x1675('0x28')][_0x1675('0x40')]({'where':{'id':_0x1504e5[_0x1675('0x3d')]['id']}})[_0x1675('0x23')](handleEntityNotFound(_0x47dc91,null))[_0x1675('0x23')](saveUpdates(_0x1504e5[_0x1675('0x42')],null))[_0x1675('0x23')](respondWithResult(_0x47dc91,null))[_0x1675('0x3c')](handleError(_0x47dc91,null));};exports[_0x1675('0x43')]=function(_0x1ec6fb,_0x29fe2a){return db['OpenchannelQueueReport'][_0x1675('0x40')]({'where':{'id':_0x1ec6fb['params']['id']}})[_0x1675('0x23')](handleEntityNotFound(_0x29fe2a,null))[_0x1675('0x23')](removeEntity(_0x29fe2a,null))[_0x1675('0x3c')](handleError(_0x29fe2a,null));};exports[_0x1675('0x44')]=function(_0x5d344d,_0x156a17){return db['OpenchannelQueueReport']['describe']()[_0x1675('0x23')](respondWithResult(_0x156a17,null))[_0x1675('0x3c')](handleError(_0x156a17,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index bfa17ce..c2462d6 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x104e79,_0x4b529c){var _0x5eb4ad=function(_0x5f31de){while(--_0x5f31de){_0x104e79['push'](_0x104e79['shift']());}};_0x5eb4ad(++_0x4b529c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x52d823,_0x3c8c77){var _0x1cdfde=function(_0x64fef5){while(--_0x64fef5){_0x52d823['push'](_0x52d823['shift']());}};_0x1cdfde(++_0x3c8c77);}(_0x7a54,0x106));var _0x47a5=function(_0x5eea6d,_0x5cdf7a){_0x5eea6d=_0x5eea6d-0x0;var _0x373962=_0x7a54[_0x5eea6d];return _0x373962;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index df9eb2b..60094f6 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 _0x4fad=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','update','attributes','limit','then','UpdateOpenchannelQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4dce97,_0x1b9719){var _0x417143=function(_0x1a5472){while(--_0x1a5472){_0x4dce97['push'](_0x4dce97['shift']());}};_0x417143(++_0x1b9719);}(_0x4fad,0xcb));var _0xd4fa=function(_0x27087b,_0x3c6968){_0x27087b=_0x27087b-0x0;var _0x56f1d0=_0x4fad[_0x27087b];return _0x56f1d0;};'use strict';var _=require(_0xd4fa('0x0'));var util=require(_0xd4fa('0x1'));var moment=require(_0xd4fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xd4fa('0x3'));var fs=require('fs');var Redis=require(_0xd4fa('0x4'));var db=require(_0xd4fa('0x5'))['db'];var utils=require(_0xd4fa('0x6'));var logger=require(_0xd4fa('0x7'))(_0xd4fa('0x8'));var config=require(_0xd4fa('0x9'));var jayson=require(_0xd4fa('0xa'));var client=jayson['client'][_0xd4fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52b426,_0x2b9f6a,_0x19a910){return new BPromise(function(_0x155c09,_0x3fff99){return client[_0xd4fa('0xc')](_0x52b426,_0x19a910)['then'](function(_0x26a894){logger[_0xd4fa('0xd')](_0xd4fa('0xe'),_0x2b9f6a,'request\x20sent');logger[_0xd4fa('0xf')](_0xd4fa('0x10'),_0x2b9f6a,_0xd4fa('0x11'),JSON[_0xd4fa('0x12')](_0x26a894));if(_0x26a894['error']){if(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x14')]===0x1f4){logger[_0xd4fa('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2b9f6a,_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);return _0x3fff99(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);}logger[_0xd4fa('0x13')](_0xd4fa('0xe'),_0x2b9f6a,_0x26a894['error'][_0xd4fa('0x15')]);return _0x155c09(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);}else{logger[_0xd4fa('0xd')](_0xd4fa('0xe'),_0x2b9f6a,_0xd4fa('0x11'));_0x155c09(_0x26a894[_0xd4fa('0x16')]['message']);}})[_0xd4fa('0x17')](function(_0x3a3b8c){logger[_0xd4fa('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2b9f6a,_0x3a3b8c);_0x3fff99(_0x3a3b8c);});});}exports['CreateOpenchannelQueueReport']=function(_0x1faa0b){var _0x5601d6=this;return new Promise(function(_0x5df190,_0x1f9be1){return db[_0xd4fa('0x18')][_0xd4fa('0x19')](_0x1faa0b[_0xd4fa('0x1a')],{'raw':_0x1faa0b['options']?_0x1faa0b[_0xd4fa('0x1b')][_0xd4fa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xbf7dcf){logger['info']('CreateOpenchannelQueueReport',_0x1faa0b);logger[_0xd4fa('0xf')](_0xd4fa('0x1d'),_0x1faa0b,JSON[_0xd4fa('0x12')](_0xbf7dcf));_0x5df190(_0xbf7dcf);})[_0xd4fa('0x17')](function(_0x586af0){logger[_0xd4fa('0x13')](_0xd4fa('0x1d'),_0x586af0[_0xd4fa('0x15')],_0x1faa0b);_0x1f9be1(_0x5601d6[_0xd4fa('0x13')](0x1f4,_0x586af0[_0xd4fa('0x15')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2a9d07){var _0x14ea6e=this;return new Promise(function(_0x4c5836,_0x162459){return db[_0xd4fa('0x18')][_0xd4fa('0x1e')](_0x2a9d07[_0xd4fa('0x1a')],{'raw':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07[_0xd4fa('0x1b')][_0xd4fa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07[_0xd4fa('0x1b')]['where']||null:null,'attributes':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07['options'][_0xd4fa('0x1f')]||null:null,'limit':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07['options'][_0xd4fa('0x20')]||null:null})[_0xd4fa('0x21')](function(_0x1b16ba){logger['info'](_0xd4fa('0x22'),_0x2a9d07);logger[_0xd4fa('0xf')]('UpdateOpenchannelQueueReport',_0x2a9d07,JSON[_0xd4fa('0x12')](_0x1b16ba));_0x4c5836(_0x1b16ba);})[_0xd4fa('0x17')](function(_0x5455a2){logger[_0xd4fa('0x13')](_0xd4fa('0x22'),_0x5455a2[_0xd4fa('0x15')],_0x2a9d07);_0x162459(_0x14ea6e[_0xd4fa('0x13')](0x1f4,_0x5455a2[_0xd4fa('0x15')]));});});}; \ No newline at end of file +var _0x955f=['../../mysqldb','rpc','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x955f,0x1eb));var _0xf955=function(_0x5dc986,_0x5dab58){_0x5dc986=_0x5dc986-0x0;var _0x185a7b=_0x955f[_0x5dc986];return _0x185a7b;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});}exports['CreateOpenchannelQueueReport']=function(_0x5ac6cb){var _0x1e20d1=this;return new Promise(function(_0xe6de5c,_0x3c49c0){return db['OpenchannelQueueReport'][_0xf955('0x15')](_0x5ac6cb[_0xf955('0x16')],{'raw':_0x5ac6cb[_0xf955('0x17')]?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x17d86a){logger[_0xf955('0xc')](_0xf955('0x19'),_0x5ac6cb);logger['debug'](_0xf955('0x19'),_0x5ac6cb,JSON['stringify'](_0x17d86a));_0xe6de5c(_0x17d86a);})[_0xf955('0x14')](function(_0x43b078){logger[_0xf955('0x11')](_0xf955('0x19'),_0x43b078[_0xf955('0x12')],_0x5ac6cb);_0x3c49c0(_0x1e20d1['error'](0x1f4,_0x43b078[_0xf955('0x12')]));});});};exports[_0xf955('0x1a')]=function(_0x3585c7){var _0x13a1a7=this;return new Promise(function(_0x17dec2,_0x102e36){return db[_0xf955('0x1b')]['update'](_0x3585c7[_0xf955('0x16')],{'raw':_0x3585c7[_0xf955('0x17')]?_0x3585c7[_0xf955('0x17')][_0xf955('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3585c7[_0xf955('0x17')]?_0x3585c7[_0xf955('0x17')][_0xf955('0x1c')]||null:null,'attributes':_0x3585c7['options']?_0x3585c7[_0xf955('0x17')][_0xf955('0x1d')]||null:null,'limit':_0x3585c7[_0xf955('0x17')]?_0x3585c7[_0xf955('0x17')][_0xf955('0x1e')]||null:null})[_0xf955('0xb')](function(_0x4d4af0){logger[_0xf955('0xc')](_0xf955('0x1a'),_0x3585c7);logger['debug'](_0xf955('0x1a'),_0x3585c7,JSON[_0xf955('0x10')](_0x4d4af0));_0x17dec2(_0x4d4af0);})[_0xf955('0x14')](function(_0x1ef794){logger['error'](_0xf955('0x1a'),_0x1ef794['message'],_0x3585c7);_0x102e36(_0x13a1a7[_0xf955('0x11')](0x1f4,_0x1ef794[_0xf955('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index f28733d..9f82558 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 _0xdd2f=['isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0xe95f05,_0x4ab464){var _0x5eeeca=function(_0x5483fb){while(--_0x5483fb){_0xe95f05['push'](_0xe95f05['shift']());}};_0x5eeeca(++_0x4ab464);}(_0xdd2f,0x14d));var _0xfdd2=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xdd2f[_0x4709c0];return _0x13348b;};'use strict';var multer=require('multer');var util=require(_0xfdd2('0x0'));var path=require(_0xfdd2('0x1'));var timeout=require('connect-timeout');var express=require(_0xfdd2('0x2'));var router=express['Router']();var fs_extra=require(_0xfdd2('0x3'));var auth=require(_0xfdd2('0x4'));var interaction=require(_0xfdd2('0x5'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0xfdd2('0x6')]('/',auth[_0xfdd2('0x7')](),controller[_0xfdd2('0x8')]);router[_0xfdd2('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xfdd2('0x6')](_0xfdd2('0x9'),auth[_0xfdd2('0x7')](),controller[_0xfdd2('0xa')]);router[_0xfdd2('0xb')]('/',auth['isAuthenticated'](),controller[_0xfdd2('0xc')]);router['put'](_0xfdd2('0x9'),auth[_0xfdd2('0x7')](),controller[_0xfdd2('0xd')]);router[_0xfdd2('0xe')](_0xfdd2('0x9'),auth[_0xfdd2('0x7')](),controller[_0xfdd2('0xf')]);module[_0xfdd2('0x10')]=router; \ No newline at end of file +var _0x6ce2=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','/describe','post','create','/:id','update','delete','destroy'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x6ce2,0xc7));var _0x26ce=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6ce2[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x26ce('0x0'));var util=require('util');var path=require(_0x26ce('0x1'));var timeout=require(_0x26ce('0x2'));var express=require(_0x26ce('0x3'));var router=express[_0x26ce('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x26ce('0x5'));var interaction=require(_0x26ce('0x6'));var config=require('../../config/environment');var controller=require(_0x26ce('0x7'));router[_0x26ce('0x8')]('/',auth[_0x26ce('0x9')](),controller['index']);router['get'](_0x26ce('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x26ce('0x8')]('/:id',auth[_0x26ce('0x9')](),controller['show']);router[_0x26ce('0xb')]('/',auth['isAuthenticated'](),controller[_0x26ce('0xc')]);router['put'](_0x26ce('0xd'),auth[_0x26ce('0x9')](),controller[_0x26ce('0xe')]);router[_0x26ce('0xf')]('/:id',auth[_0x26ce('0x9')](),controller[_0x26ce('0x10')]);module[_0x26ce('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 3c6ebd1..0ac1cc2 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x53bb98,_0x57f9e5){var _0x290b02=function(_0xba0af7){while(--_0xba0af7){_0x53bb98['push'](_0x53bb98['shift']());}};_0x290b02(++_0x57f9e5);}(_0x70e0,0x17b));var _0x070e=function(_0x30cc65,_0xe82820){_0x30cc65=_0x30cc65-0x0;var _0xa355de=_0x70e0[_0x30cc65];return _0xa355de;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x5abcd9,_0x4b57b0){var _0x47d3e3=function(_0x5cf97b){while(--_0x5cf97b){_0x5abcd9['push'](_0x5abcd9['shift']());}};_0x47d3e3(++_0x4b57b0);}(_0xedd9,0xfc));var _0x9edd=function(_0x11279c,_0x37b77d){_0x11279c=_0x11279c-0x0;var _0x127940=_0xedd9[_0x11279c];return _0x127940;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 9f07cf0..7385de4 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 _0x4530=['count','set','Content-Range','apply','reject','update','end','sendStatus','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','then','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit'];(function(_0x3ae660,_0x7259b0){var _0x11b5db=function(_0x292211){while(--_0x292211){_0x3ae660['push'](_0x3ae660['shift']());}};_0x11b5db(++_0x7259b0);}(_0x4530,0x10c));var _0x0453=function(_0x5c8147,_0x161d15){_0x5c8147=_0x5c8147-0x0;var _0x137fc9=_0x4530[_0x5c8147];return _0x137fc9;};'use strict';var emlformat=require(_0x0453('0x0'));var rimraf=require(_0x0453('0x1'));var zipdir=require(_0x0453('0x2'));var jsonpatch=require(_0x0453('0x3'));var rp=require(_0x0453('0x4'));var moment=require('moment');var BPromise=require(_0x0453('0x5'));var Mustache=require(_0x0453('0x6'));var util=require(_0x0453('0x7'));var path=require(_0x0453('0x8'));var sox=require('sox');var csv=require(_0x0453('0x9'));var ejs=require(_0x0453('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0453('0xb'));var squel=require('squel');var crypto=require(_0x0453('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0453('0x9'));var querystring=require(_0x0453('0xd'));var Papa=require(_0x0453('0xe'));var Redis=require(_0x0453('0xf'));var authService=require(_0x0453('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0453('0x11'));var hardwareService=require(_0x0453('0x12'));var logger=require(_0x0453('0x13'))(_0x0453('0x14'));var utils=require('../../config/utils');var config=require(_0x0453('0x15'));var licenseUtil=require(_0x0453('0x16'));var db=require(_0x0453('0x17'))['db'];function respondWithStatusCode(_0x1e90fb,_0x406245){_0x406245=_0x406245||0xcc;return function(_0x13ad3c){if(_0x13ad3c){return _0x1e90fb['sendStatus'](_0x406245);}return _0x1e90fb[_0x0453('0x18')](_0x406245)['end']();};}function respondWithResult(_0x32c78f,_0x46afe2){_0x46afe2=_0x46afe2||0xc8;return function(_0x3b5a96){if(_0x3b5a96){return _0x32c78f['status'](_0x46afe2)['json'](_0x3b5a96);}};}function respondWithFilteredResult(_0x3dd058,_0x1d50c7){return function(_0x1e1337){if(_0x1e1337){var _0x47c098=typeof _0x1d50c7[_0x0453('0x19')]===_0x0453('0x1a')&&typeof _0x1d50c7[_0x0453('0x1b')]==='undefined';var _0x3d6d3c=_0x1e1337[_0x0453('0x1c')];var _0x20238e=_0x47c098?0x0:_0x1d50c7[_0x0453('0x19')];var _0x41e1a0=_0x47c098?_0x1e1337[_0x0453('0x1c')]:_0x1d50c7[_0x0453('0x19')]+_0x1d50c7[_0x0453('0x1b')];var _0x19bba9;if(_0x41e1a0>=_0x3d6d3c){_0x41e1a0=_0x3d6d3c;_0x19bba9=0xc8;}else{_0x19bba9=0xce;}_0x3dd058['status'](_0x19bba9);return _0x3dd058[_0x0453('0x1d')](_0x0453('0x1e'),_0x20238e+'-'+_0x41e1a0+'/'+_0x3d6d3c)['json'](_0x1e1337);}return null;};}function patchUpdates(_0x3eea51){return function(_0x23c022){try{jsonpatch[_0x0453('0x1f')](_0x23c022,_0x3eea51,!![]);}catch(_0x5e4ebc){return BPromise[_0x0453('0x20')](_0x5e4ebc);}return _0x23c022['save']();};}function saveUpdates(_0x550777,_0xc06979){return function(_0x4ac615){if(_0x4ac615){return _0x4ac615[_0x0453('0x21')](_0x550777)['then'](function(_0x395f6e){return _0x395f6e;});}return null;};}function removeEntity(_0x5c253b,_0x272863){return function(_0x5c03b1){if(_0x5c03b1){return _0x5c03b1['destroy']()['then'](function(){_0x5c253b[_0x0453('0x18')](0xcc)[_0x0453('0x22')]();});}};}function handleEntityNotFound(_0x14ad17,_0x51bd71){return function(_0x3e174d){if(!_0x3e174d){_0x14ad17[_0x0453('0x23')](0x194);}return _0x3e174d;};}function handleError(_0x327ed4,_0x286b84){_0x286b84=_0x286b84||0x1f4;return function(_0x38f978){logger[_0x0453('0x24')](_0x38f978[_0x0453('0x25')]);if(_0x38f978[_0x0453('0x26')]){delete _0x38f978[_0x0453('0x26')];}_0x327ed4[_0x0453('0x18')](_0x286b84)['send'](_0x38f978);};}exports[_0x0453('0x27')]=function(_0x5ea9f9,_0x59ba07){var _0x2d8d5a={},_0x174ef5={},_0x449a7c={'count':0x0,'rows':[]};var _0x101ca5=_[_0x0453('0x28')](db[_0x0453('0x29')][_0x0453('0x2a')],function(_0x39e990){return{'name':_0x39e990[_0x0453('0x2b')],'type':_0x39e990[_0x0453('0x2c')][_0x0453('0x2d')]};});_0x174ef5[_0x0453('0x2e')]=_['map'](_0x101ca5,_0x0453('0x26'));_0x174ef5[_0x0453('0x2f')]=_[_0x0453('0x30')](_0x5ea9f9[_0x0453('0x2f')]);_0x174ef5[_0x0453('0x31')]=_['intersection'](_0x174ef5['model'],_0x174ef5['query']);_0x2d8d5a[_0x0453('0x32')]=_[_0x0453('0x33')](_0x174ef5['model'],qs[_0x0453('0x34')](_0x5ea9f9[_0x0453('0x2f')][_0x0453('0x34')]));_0x2d8d5a[_0x0453('0x32')]=_0x2d8d5a[_0x0453('0x32')][_0x0453('0x35')]?_0x2d8d5a['attributes']:_0x174ef5[_0x0453('0x2e')];if(!_0x5ea9f9['query'][_0x0453('0x36')]('nolimit')){_0x2d8d5a[_0x0453('0x1b')]=qs['limit'](_0x5ea9f9[_0x0453('0x2f')][_0x0453('0x1b')]);_0x2d8d5a[_0x0453('0x19')]=qs[_0x0453('0x19')](_0x5ea9f9['query'][_0x0453('0x19')]);}_0x2d8d5a['order']=qs['sort'](_0x5ea9f9[_0x0453('0x2f')][_0x0453('0x37')]);_0x2d8d5a[_0x0453('0x38')]=qs[_0x0453('0x31')](_[_0x0453('0x39')](_0x5ea9f9[_0x0453('0x2f')],_0x174ef5[_0x0453('0x31')]),_0x101ca5);if(_0x5ea9f9[_0x0453('0x2f')][_0x0453('0x3a')]){_0x2d8d5a[_0x0453('0x38')]=_['merge'](_0x2d8d5a[_0x0453('0x38')],{'$or':_['map'](_0x101ca5,function(_0x2d8662){if(_0x2d8662[_0x0453('0x2c')]!=='VIRTUAL'){var _0x14698a={};_0x14698a[_0x2d8662['name']]={'$like':'%'+_0x5ea9f9[_0x0453('0x2f')][_0x0453('0x3a')]+'%'};return _0x14698a;}})});}_0x2d8d5a=_[_0x0453('0x3b')]({},_0x2d8d5a,_0x5ea9f9[_0x0453('0x3c')]);var _0x48067a={'where':_0x2d8d5a[_0x0453('0x38')]};return db['OpenchannelTransferReport'][_0x0453('0x1c')](_0x48067a)[_0x0453('0x3d')](function(_0x134fde){_0x449a7c[_0x0453('0x1c')]=_0x134fde;if(_0x5ea9f9[_0x0453('0x2f')]['includeAll']){_0x2d8d5a[_0x0453('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x0453('0x3f')](_0x2d8d5a);})[_0x0453('0x3d')](function(_0x2f9201){_0x449a7c[_0x0453('0x40')]=_0x2f9201;return _0x449a7c;})[_0x0453('0x3d')](respondWithFilteredResult(_0x59ba07,_0x2d8d5a))[_0x0453('0x41')](handleError(_0x59ba07,null));};exports[_0x0453('0x42')]=function(_0x474e58,_0x4158a4){var _0x4ea664={'raw':!![],'where':{'id':_0x474e58[_0x0453('0x43')]['id']}},_0x4d0ba2={};_0x4d0ba2[_0x0453('0x2e')]=_[_0x0453('0x30')](db['OpenchannelTransferReport'][_0x0453('0x2a')]);_0x4d0ba2[_0x0453('0x2f')]=_[_0x0453('0x30')](_0x474e58[_0x0453('0x2f')]);_0x4d0ba2[_0x0453('0x31')]=_[_0x0453('0x33')](_0x4d0ba2['model'],_0x4d0ba2[_0x0453('0x2f')]);_0x4ea664[_0x0453('0x32')]=_[_0x0453('0x33')](_0x4d0ba2[_0x0453('0x2e')],qs[_0x0453('0x34')](_0x474e58[_0x0453('0x2f')][_0x0453('0x34')]));_0x4ea664[_0x0453('0x32')]=_0x4ea664[_0x0453('0x32')][_0x0453('0x35')]?_0x4ea664['attributes']:_0x4d0ba2[_0x0453('0x2e')];if(_0x474e58[_0x0453('0x2f')][_0x0453('0x44')]){_0x4ea664[_0x0453('0x3e')]=[{'all':!![]}];}_0x4ea664=_[_0x0453('0x3b')]({},_0x4ea664,_0x474e58[_0x0453('0x3c')]);return db['OpenchannelTransferReport'][_0x0453('0x45')](_0x4ea664)[_0x0453('0x3d')](handleEntityNotFound(_0x4158a4,null))[_0x0453('0x3d')](respondWithResult(_0x4158a4,null))[_0x0453('0x41')](handleError(_0x4158a4,null));};exports[_0x0453('0x46')]=function(_0x184699,_0x45ae61){return db['OpenchannelTransferReport'][_0x0453('0x46')](_0x184699[_0x0453('0x47')],{})['then'](respondWithResult(_0x45ae61,0xc9))[_0x0453('0x41')](handleError(_0x45ae61,null));};exports[_0x0453('0x21')]=function(_0x1063a2,_0x443cdb){if(_0x1063a2[_0x0453('0x47')]['id']){delete _0x1063a2[_0x0453('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x0453('0x45')]({'where':{'id':_0x1063a2[_0x0453('0x43')]['id']}})[_0x0453('0x3d')](handleEntityNotFound(_0x443cdb,null))[_0x0453('0x3d')](saveUpdates(_0x1063a2[_0x0453('0x47')],null))[_0x0453('0x3d')](respondWithResult(_0x443cdb,null))[_0x0453('0x41')](handleError(_0x443cdb,null));};exports[_0x0453('0x48')]=function(_0x419992,_0x2d3ce1){return db[_0x0453('0x29')][_0x0453('0x45')]({'where':{'id':_0x419992['params']['id']}})[_0x0453('0x3d')](handleEntityNotFound(_0x2d3ce1,null))[_0x0453('0x3d')](removeEntity(_0x2d3ce1,null))[_0x0453('0x41')](handleError(_0x2d3ce1,null));};exports[_0x0453('0x49')]=function(_0x3e9f75,_0x44c60c){return db[_0x0453('0x29')][_0x0453('0x49')]()[_0x0453('0x3d')](respondWithResult(_0x44c60c,null))[_0x0453('0x41')](handleError(_0x44c60c,null));}; \ No newline at end of file +var _0xbfa6=['json','offset','limit','undefined','count','set','Content-Range','reject','update','then','stack','name','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x41aa4d,_0x51e45f){var _0x3fb7d6=function(_0x3833ec){while(--_0x3833ec){_0x41aa4d['push'](_0x41aa4d['shift']());}};_0x3fb7d6(++_0x51e45f);}(_0xbfa6,0x186));var _0x6bfa=function(_0x3ca29d,_0x5a8d31){_0x3ca29d=_0x3ca29d-0x0;var _0x5c5d2e=_0xbfa6[_0x3ca29d];return _0x5c5d2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6bfa('0x0'));var zipdir=require(_0x6bfa('0x1'));var jsonpatch=require(_0x6bfa('0x2'));var rp=require(_0x6bfa('0x3'));var moment=require('moment');var BPromise=require(_0x6bfa('0x4'));var Mustache=require(_0x6bfa('0x5'));var util=require(_0x6bfa('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6bfa('0x7'));var fs=require('fs');var fs_extra=require(_0x6bfa('0x8'));var _=require(_0x6bfa('0x9'));var squel=require(_0x6bfa('0xa'));var crypto=require(_0x6bfa('0xb'));var jsforce=require(_0x6bfa('0xc'));var deskjs=require(_0x6bfa('0xd'));var toCsv=require(_0x6bfa('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6bfa('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6bfa('0x10'));var hardwareService=require(_0x6bfa('0x11'));var logger=require(_0x6bfa('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6bfa('0x13'));var licenseUtil=require(_0x6bfa('0x14'));var db=require(_0x6bfa('0x15'))['db'];function respondWithStatusCode(_0x481fa0,_0x2ab6b4){_0x2ab6b4=_0x2ab6b4||0xcc;return function(_0x235439){if(_0x235439){return _0x481fa0['sendStatus'](_0x2ab6b4);}return _0x481fa0[_0x6bfa('0x16')](_0x2ab6b4)[_0x6bfa('0x17')]();};}function respondWithResult(_0x5290b9,_0xbb66c3){_0xbb66c3=_0xbb66c3||0xc8;return function(_0xe94a62){if(_0xe94a62){return _0x5290b9['status'](_0xbb66c3)[_0x6bfa('0x18')](_0xe94a62);}};}function respondWithFilteredResult(_0x2c1477,_0xd972b5){return function(_0x5e5fc4){if(_0x5e5fc4){var _0x1b2e78=typeof _0xd972b5[_0x6bfa('0x19')]==='undefined'&&typeof _0xd972b5[_0x6bfa('0x1a')]===_0x6bfa('0x1b');var _0x4d5c71=_0x5e5fc4[_0x6bfa('0x1c')];var _0x393cbb=_0x1b2e78?0x0:_0xd972b5[_0x6bfa('0x19')];var _0x3ad65d=_0x1b2e78?_0x5e5fc4['count']:_0xd972b5[_0x6bfa('0x19')]+_0xd972b5[_0x6bfa('0x1a')];var _0x57943b;if(_0x3ad65d>=_0x4d5c71){_0x3ad65d=_0x4d5c71;_0x57943b=0xc8;}else{_0x57943b=0xce;}_0x2c1477[_0x6bfa('0x16')](_0x57943b);return _0x2c1477[_0x6bfa('0x1d')](_0x6bfa('0x1e'),_0x393cbb+'-'+_0x3ad65d+'/'+_0x4d5c71)['json'](_0x5e5fc4);}return null;};}function patchUpdates(_0x19ee32){return function(_0xf81c1){try{jsonpatch['apply'](_0xf81c1,_0x19ee32,!![]);}catch(_0x4eaae1){return BPromise[_0x6bfa('0x1f')](_0x4eaae1);}return _0xf81c1['save']();};}function saveUpdates(_0x30b69c,_0x3548cb){return function(_0x51b18e){if(_0x51b18e){return _0x51b18e[_0x6bfa('0x20')](_0x30b69c)[_0x6bfa('0x21')](function(_0xba91a4){return _0xba91a4;});}return null;};}function removeEntity(_0x4db41c,_0x1cc02c){return function(_0x510096){if(_0x510096){return _0x510096['destroy']()[_0x6bfa('0x21')](function(){_0x4db41c[_0x6bfa('0x16')](0xcc)[_0x6bfa('0x17')]();});}};}function handleEntityNotFound(_0x178154,_0x5b700b){return function(_0x16f339){if(!_0x16f339){_0x178154['sendStatus'](0x194);}return _0x16f339;};}function handleError(_0x1c47b5,_0x2d462e){_0x2d462e=_0x2d462e||0x1f4;return function(_0x4deee2){logger['error'](_0x4deee2[_0x6bfa('0x22')]);if(_0x4deee2[_0x6bfa('0x23')]){delete _0x4deee2[_0x6bfa('0x23')];}_0x1c47b5[_0x6bfa('0x16')](_0x2d462e)['send'](_0x4deee2);};}exports[_0x6bfa('0x24')]=function(_0x2d958e,_0x16569a){var _0x1aa920={},_0x439f7c={},_0x244190={'count':0x0,'rows':[]};var _0x4350a7=_[_0x6bfa('0x25')](db['OpenchannelTransferReport'][_0x6bfa('0x26')],function(_0x44deb6){return{'name':_0x44deb6[_0x6bfa('0x27')],'type':_0x44deb6['type'][_0x6bfa('0x28')]};});_0x439f7c['model']=_[_0x6bfa('0x25')](_0x4350a7,_0x6bfa('0x23'));_0x439f7c['query']=_[_0x6bfa('0x29')](_0x2d958e[_0x6bfa('0x2a')]);_0x439f7c[_0x6bfa('0x2b')]=_[_0x6bfa('0x2c')](_0x439f7c[_0x6bfa('0x2d')],_0x439f7c[_0x6bfa('0x2a')]);_0x1aa920[_0x6bfa('0x2e')]=_['intersection'](_0x439f7c['model'],qs[_0x6bfa('0x2f')](_0x2d958e[_0x6bfa('0x2a')]['fields']));_0x1aa920[_0x6bfa('0x2e')]=_0x1aa920[_0x6bfa('0x2e')]['length']?_0x1aa920[_0x6bfa('0x2e')]:_0x439f7c['model'];if(!_0x2d958e[_0x6bfa('0x2a')]['hasOwnProperty'](_0x6bfa('0x30'))){_0x1aa920[_0x6bfa('0x1a')]=qs[_0x6bfa('0x1a')](_0x2d958e['query']['limit']);_0x1aa920[_0x6bfa('0x19')]=qs['offset'](_0x2d958e[_0x6bfa('0x2a')]['offset']);}_0x1aa920[_0x6bfa('0x31')]=qs[_0x6bfa('0x32')](_0x2d958e[_0x6bfa('0x2a')]['sort']);_0x1aa920[_0x6bfa('0x33')]=qs[_0x6bfa('0x2b')](_['pick'](_0x2d958e[_0x6bfa('0x2a')],_0x439f7c[_0x6bfa('0x2b')]),_0x4350a7);if(_0x2d958e[_0x6bfa('0x2a')][_0x6bfa('0x34')]){_0x1aa920['where']=_[_0x6bfa('0x35')](_0x1aa920[_0x6bfa('0x33')],{'$or':_[_0x6bfa('0x25')](_0x4350a7,function(_0x4cc8f1){if(_0x4cc8f1[_0x6bfa('0x36')]!==_0x6bfa('0x37')){var _0x10998f={};_0x10998f[_0x4cc8f1['name']]={'$like':'%'+_0x2d958e['query'][_0x6bfa('0x34')]+'%'};return _0x10998f;}})});}_0x1aa920=_[_0x6bfa('0x35')]({},_0x1aa920,_0x2d958e[_0x6bfa('0x38')]);var _0x9b9c1={'where':_0x1aa920['where']};return db[_0x6bfa('0x39')][_0x6bfa('0x1c')](_0x9b9c1)[_0x6bfa('0x21')](function(_0x28c21e){_0x244190['count']=_0x28c21e;if(_0x2d958e[_0x6bfa('0x2a')][_0x6bfa('0x3a')]){_0x1aa920[_0x6bfa('0x3b')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x6bfa('0x3c')](_0x1aa920);})[_0x6bfa('0x21')](function(_0x2a7edf){_0x244190['rows']=_0x2a7edf;return _0x244190;})[_0x6bfa('0x21')](respondWithFilteredResult(_0x16569a,_0x1aa920))[_0x6bfa('0x3d')](handleError(_0x16569a,null));};exports[_0x6bfa('0x3e')]=function(_0x50ae63,_0xcc01d9){var _0x48d4ca={'raw':!![],'where':{'id':_0x50ae63[_0x6bfa('0x3f')]['id']}},_0x35c0bb={};_0x35c0bb[_0x6bfa('0x2d')]=_['keys'](db[_0x6bfa('0x39')]['rawAttributes']);_0x35c0bb[_0x6bfa('0x2a')]=_['keys'](_0x50ae63[_0x6bfa('0x2a')]);_0x35c0bb[_0x6bfa('0x2b')]=_[_0x6bfa('0x2c')](_0x35c0bb['model'],_0x35c0bb[_0x6bfa('0x2a')]);_0x48d4ca[_0x6bfa('0x2e')]=_[_0x6bfa('0x2c')](_0x35c0bb['model'],qs[_0x6bfa('0x2f')](_0x50ae63[_0x6bfa('0x2a')]['fields']));_0x48d4ca[_0x6bfa('0x2e')]=_0x48d4ca['attributes']['length']?_0x48d4ca[_0x6bfa('0x2e')]:_0x35c0bb[_0x6bfa('0x2d')];if(_0x50ae63[_0x6bfa('0x2a')][_0x6bfa('0x3a')]){_0x48d4ca[_0x6bfa('0x3b')]=[{'all':!![]}];}_0x48d4ca=_[_0x6bfa('0x35')]({},_0x48d4ca,_0x50ae63[_0x6bfa('0x38')]);return db[_0x6bfa('0x39')][_0x6bfa('0x40')](_0x48d4ca)['then'](handleEntityNotFound(_0xcc01d9,null))[_0x6bfa('0x21')](respondWithResult(_0xcc01d9,null))['catch'](handleError(_0xcc01d9,null));};exports[_0x6bfa('0x41')]=function(_0xc47e01,_0x38899d){return db[_0x6bfa('0x39')][_0x6bfa('0x41')](_0xc47e01[_0x6bfa('0x42')],{})[_0x6bfa('0x21')](respondWithResult(_0x38899d,0xc9))[_0x6bfa('0x3d')](handleError(_0x38899d,null));};exports['update']=function(_0x32e704,_0x455d16){if(_0x32e704['body']['id']){delete _0x32e704[_0x6bfa('0x42')]['id'];}return db[_0x6bfa('0x39')]['find']({'where':{'id':_0x32e704[_0x6bfa('0x3f')]['id']}})['then'](handleEntityNotFound(_0x455d16,null))[_0x6bfa('0x21')](saveUpdates(_0x32e704[_0x6bfa('0x42')],null))[_0x6bfa('0x21')](respondWithResult(_0x455d16,null))[_0x6bfa('0x3d')](handleError(_0x455d16,null));};exports[_0x6bfa('0x43')]=function(_0x588e01,_0x4b5db4){return db[_0x6bfa('0x39')][_0x6bfa('0x40')]({'where':{'id':_0x588e01['params']['id']}})['then'](handleEntityNotFound(_0x4b5db4,null))['then'](removeEntity(_0x4b5db4,null))[_0x6bfa('0x3d')](handleError(_0x4b5db4,null));};exports[_0x6bfa('0x44')]=function(_0x2d7d15,_0x2e43b8){return db[_0x6bfa('0x39')][_0x6bfa('0x44')]()[_0x6bfa('0x21')](respondWithResult(_0x2e43b8,null))[_0x6bfa('0x3d')](handleError(_0x2e43b8,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a35f1df..22cdafd 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 _0xe119=['path','rimraf','../../config/environment','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','request-promise'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe119,0xe3));var _0x9e11=function(_0x14309b,_0x31003c){_0x14309b=_0x14309b-0x0;var _0x279563=_0xe119[_0x14309b];return _0x279563;};'use strict';var _=require('lodash');var util=require(_0x9e11('0x0'));var logger=require(_0x9e11('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9e11('0x2'));var fs=require('fs');var path=require(_0x9e11('0x3'));var rimraf=require(_0x9e11('0x4'));var config=require(_0x9e11('0x5'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x13745a,_0x117d3c){return _0x13745a[_0x9e11('0x6')](_0x9e11('0x7'),attributes,{'tableName':_0x9e11('0x8'),'paranoid':![],'indexes':[{'name':_0x9e11('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6523=['exports','define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x2935f6,_0x41e56b){var _0x14e743=function(_0x58563b){while(--_0x58563b){_0x2935f6['push'](_0x2935f6['shift']());}};_0x14e743(++_0x41e56b);}(_0x6523,0x196));var _0x3652=function(_0x141486,_0x58ed56){_0x141486=_0x141486-0x0;var _0x1b5fb9=_0x6523[_0x141486];return _0x1b5fb9;};'use strict';var _=require(_0x3652('0x0'));var util=require(_0x3652('0x1'));var logger=require(_0x3652('0x2'))(_0x3652('0x3'));var moment=require(_0x3652('0x4'));var BPromise=require(_0x3652('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3652('0x6'));var rimraf=require(_0x3652('0x7'));var config=require(_0x3652('0x8'));var attributes=require(_0x3652('0x9'));module[_0x3652('0xa')]=function(_0x3b8805,_0x2c8317){return _0x3b8805[_0x3652('0xb')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x3652('0xc'),'fields':[_0x3652('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index d7f3f0a..295471a 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 _0x55d2=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelTransferReport,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','request\x20sent'];(function(_0x4314c9,_0x1a6d36){var _0x1f8798=function(_0x27858f){while(--_0x27858f){_0x4314c9['push'](_0x4314c9['shift']());}};_0x1f8798(++_0x1a6d36);}(_0x55d2,0x9f));var _0x255d=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x55d2[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x255d('0x0'));var BPromise=require(_0x255d('0x1'));var rs=require(_0x255d('0x2'));var fs=require('fs');var Redis=require(_0x255d('0x3'));var db=require(_0x255d('0x4'))['db'];var utils=require(_0x255d('0x5'));var logger=require('../../config/logger')(_0x255d('0x6'));var config=require(_0x255d('0x7'));var jayson=require(_0x255d('0x8'));var client=jayson[_0x255d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f93b4,_0x15469e,_0xcf66a2){return new BPromise(function(_0x253ac9,_0xdb6ea7){return client[_0x255d('0xa')](_0x4f93b4,_0xcf66a2)['then'](function(_0x5198d7){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x15469e,_0x255d('0xb'));logger['debug'](_0x255d('0xc'),_0x15469e,_0x255d('0xb'),JSON[_0x255d('0xd')](_0x5198d7));if(_0x5198d7['error']){if(_0x5198d7['error'][_0x255d('0xe')]===0x1f4){logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);return _0xdb6ea7(_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);}logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);return _0x253ac9(_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);}else{logger['info'](_0x255d('0x10'),_0x15469e,_0x255d('0xb'));_0x253ac9(_0x5198d7['result'][_0x255d('0x11')]);}})[_0x255d('0x12')](function(_0x37c217){logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x37c217);_0xdb6ea7(_0x37c217);});});} \ No newline at end of file +var _0xdf98=['lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x14e663,_0x3316bd){var _0x5a9aab=function(_0x1287fb){while(--_0x1287fb){_0x14e663['push'](_0x14e663['shift']());}};_0x5a9aab(++_0x3316bd);}(_0xdf98,0xcf));var _0x8df9=function(_0x12c4cd,_0xdebe29){_0x12c4cd=_0x12c4cd-0x0;var _0x18a029=_0xdf98[_0x12c4cd];return _0x18a029;};'use strict';var _=require(_0x8df9('0x0'));var util=require('util');var moment=require(_0x8df9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8df9('0x2'));var db=require(_0x8df9('0x3'))['db'];var utils=require(_0x8df9('0x4'));var logger=require(_0x8df9('0x5'))(_0x8df9('0x6'));var config=require(_0x8df9('0x7'));var jayson=require(_0x8df9('0x8'));var client=jayson[_0x8df9('0x9')][_0x8df9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e79af,_0x1ffe3b,_0x393533){return new BPromise(function(_0x410568,_0x48bc8e){return client['request'](_0x5e79af,_0x393533)[_0x8df9('0xb')](function(_0x513b37){logger[_0x8df9('0xc')](_0x8df9('0xd'),_0x1ffe3b,_0x8df9('0xe'));logger[_0x8df9('0xf')](_0x8df9('0x10'),_0x1ffe3b,_0x8df9('0xe'),JSON[_0x8df9('0x11')](_0x513b37));if(_0x513b37[_0x8df9('0x12')]){if(_0x513b37['error'][_0x8df9('0x13')]===0x1f4){logger[_0x8df9('0x12')](_0x8df9('0xd'),_0x1ffe3b,_0x513b37['error'][_0x8df9('0x14')]);return _0x48bc8e(_0x513b37[_0x8df9('0x12')][_0x8df9('0x14')]);}logger[_0x8df9('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1ffe3b,_0x513b37['error'][_0x8df9('0x14')]);return _0x410568(_0x513b37[_0x8df9('0x12')][_0x8df9('0x14')]);}else{logger['info'](_0x8df9('0xd'),_0x1ffe3b,'request\x20sent');_0x410568(_0x513b37[_0x8df9('0x15')]['message']);}})[_0x8df9('0x16')](function(_0x8e547d){logger[_0x8df9('0x12')](_0x8df9('0xd'),_0x1ffe3b,_0x8e547d);_0x48bc8e(_0x8e547d);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index fb62fbc..a3ef121 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 _0xf679=['../../config/environment','./pause.controller','get','index','isAuthenticated','post','create','put','/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x5ac220,_0x12ce2e){var _0x28510e=function(_0x58efbe){while(--_0x58efbe){_0x5ac220['push'](_0x5ac220['shift']());}};_0x28510e(++_0x12ce2e);}(_0xf679,0x11a));var _0x9f67=function(_0x22e3a6,_0x33ce61){_0x22e3a6=_0x22e3a6-0x0;var _0x782d1b=_0xf679[_0x22e3a6];return _0x782d1b;};'use strict';var multer=require(_0x9f67('0x0'));var util=require(_0x9f67('0x1'));var path=require(_0x9f67('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f67('0x3'));var router=express[_0x9f67('0x4')]();var fs_extra=require(_0x9f67('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9f67('0x6'));var controller=require(_0x9f67('0x7'));router[_0x9f67('0x8')]('/',auth['isAuthenticated'](),controller[_0x9f67('0x9')]);router[_0x9f67('0x8')]('/:id',auth[_0x9f67('0xa')](),controller['show']);router[_0x9f67('0xb')]('/',auth[_0x9f67('0xa')](),controller[_0x9f67('0xc')]);router[_0x9f67('0xd')](_0x9f67('0xe'),auth['isAuthenticated'](),controller[_0x9f67('0xf')]);router['delete'](_0x9f67('0xe'),auth['isAuthenticated'](),controller[_0x9f67('0x10')]);module[_0x9f67('0x11')]=router; \ No newline at end of file +var _0x2a9a=['./pause.controller','get','isAuthenticated','index','/:id','show','create','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1f3694,_0x6b042){var _0x134527=function(_0x2caa0a){while(--_0x2caa0a){_0x1f3694['push'](_0x1f3694['shift']());}};_0x134527(++_0x6b042);}(_0x2a9a,0x186));var _0xa2a9=function(_0x2a37ed,_0x59d54e){_0x2a37ed=_0x2a37ed-0x0;var _0x16e085=_0x2a9a[_0x2a37ed];return _0x16e085;};'use strict';var multer=require(_0xa2a9('0x0'));var util=require('util');var path=require(_0xa2a9('0x1'));var timeout=require(_0xa2a9('0x2'));var express=require(_0xa2a9('0x3'));var router=express[_0xa2a9('0x4')]();var fs_extra=require(_0xa2a9('0x5'));var auth=require(_0xa2a9('0x6'));var interaction=require(_0xa2a9('0x7'));var config=require(_0xa2a9('0x8'));var controller=require(_0xa2a9('0x9'));router[_0xa2a9('0xa')]('/',auth[_0xa2a9('0xb')](),controller[_0xa2a9('0xc')]);router[_0xa2a9('0xa')](_0xa2a9('0xd'),auth[_0xa2a9('0xb')](),controller[_0xa2a9('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa2a9('0xf')]);router[_0xa2a9('0x10')](_0xa2a9('0xd'),auth[_0xa2a9('0xb')](),controller['update']);router[_0xa2a9('0x11')](_0xa2a9('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xa2a9('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 8f0c62b..844d000 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 _0x2ab3=['name','STRING','sequelize'];(function(_0x6cbff2,_0x3f084c){var _0x18ac55=function(_0x5d262e){while(--_0x5d262e){_0x6cbff2['push'](_0x6cbff2['shift']());}};_0x18ac55(++_0x3f084c);}(_0x2ab3,0x143));var _0x32ab=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x2ab3[_0x8dc04d];return _0x2f5f28;};'use strict';var Sequelize=require(_0x32ab('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x32ab('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x32ab('0x2')]}}; \ No newline at end of file +var _0x245f=['STRING','name','sequelize'];(function(_0x552e06,_0x521844){var _0x3c0a76=function(_0xde4d7b){while(--_0xde4d7b){_0x552e06['push'](_0x552e06['shift']());}};_0x3c0a76(++_0x521844);}(_0x245f,0x17c));var _0xf245=function(_0xdb8b33,_0x34b468){_0xdb8b33=_0xdb8b33-0x0;var _0x3d9ba6=_0x245f[_0xdb8b33];return _0x3d9ba6;};'use strict';var Sequelize=require(_0xf245('0x0'));module['exports']={'name':{'type':Sequelize[_0xf245('0x1')],'unique':_0xf245('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xf245('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 0b92184..f63bc04 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 _0xbea3=['Content-Range','json','apply','reject','then','destroy','Pauses','UserProfileResource','sendStatus','stack','name','send','index','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','Pause','count','includeAll','include','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','limit','offset','set'];(function(_0x19e3c2,_0x177a95){var _0x2bb88f=function(_0x165f84){while(--_0x165f84){_0x19e3c2['push'](_0x19e3c2['shift']());}};_0x2bb88f(++_0x177a95);}(_0xbea3,0xe0));var _0x3bea=function(_0x209285,_0x54b0b4){_0x209285=_0x209285-0x0;var _0x165b8d=_0xbea3[_0x209285];return _0x165b8d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bea('0x0'));var zipdir=require(_0x3bea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3bea('0x2'));var moment=require('moment');var BPromise=require(_0x3bea('0x3'));var Mustache=require(_0x3bea('0x4'));var util=require('util');var path=require(_0x3bea('0x5'));var sox=require(_0x3bea('0x6'));var csv=require(_0x3bea('0x7'));var ejs=require(_0x3bea('0x8'));var fs=require('fs');var fs_extra=require(_0x3bea('0x9'));var _=require(_0x3bea('0xa'));var squel=require(_0x3bea('0xb'));var crypto=require(_0x3bea('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3bea('0x7'));var querystring=require(_0x3bea('0xd'));var Papa=require(_0x3bea('0xe'));var Redis=require(_0x3bea('0xf'));var authService=require(_0x3bea('0x10'));var qs=require(_0x3bea('0x11'));var as=require(_0x3bea('0x12'));var hardwareService=require(_0x3bea('0x13'));var logger=require(_0x3bea('0x14'))(_0x3bea('0x15'));var utils=require(_0x3bea('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3bea('0x17'));var db=require(_0x3bea('0x18'))['db'];function respondWithStatusCode(_0x5b87b2,_0x3b0525){_0x3b0525=_0x3b0525||0xcc;return function(_0x5f2418){if(_0x5f2418){return _0x5b87b2['sendStatus'](_0x3b0525);}return _0x5b87b2[_0x3bea('0x19')](_0x3b0525)[_0x3bea('0x1a')]();};}function respondWithResult(_0x5298b4,_0x24b9b3){_0x24b9b3=_0x24b9b3||0xc8;return function(_0x3e59c9){if(_0x3e59c9){return _0x5298b4[_0x3bea('0x19')](_0x24b9b3)['json'](_0x3e59c9);}};}function respondWithFilteredResult(_0x414037,_0x4b550e){return function(_0x576d87){if(_0x576d87){var _0x1aadad=typeof _0x4b550e['offset']===_0x3bea('0x1b')&&typeof _0x4b550e[_0x3bea('0x1c')]===_0x3bea('0x1b');var _0x1d4206=_0x576d87['count'];var _0x6ae83c=_0x1aadad?0x0:_0x4b550e[_0x3bea('0x1d')];var _0x2f25f9=_0x1aadad?_0x576d87['count']:_0x4b550e[_0x3bea('0x1d')]+_0x4b550e[_0x3bea('0x1c')];var _0x277236;if(_0x2f25f9>=_0x1d4206){_0x2f25f9=_0x1d4206;_0x277236=0xc8;}else{_0x277236=0xce;}_0x414037[_0x3bea('0x19')](_0x277236);return _0x414037[_0x3bea('0x1e')](_0x3bea('0x1f'),_0x6ae83c+'-'+_0x2f25f9+'/'+_0x1d4206)[_0x3bea('0x20')](_0x576d87);}return null;};}function patchUpdates(_0x1178c4){return function(_0x35b793){try{jsonpatch[_0x3bea('0x21')](_0x35b793,_0x1178c4,!![]);}catch(_0x4338fc){return BPromise[_0x3bea('0x22')](_0x4338fc);}return _0x35b793['save']();};}function saveUpdates(_0xdfcf6c,_0x1edfcb){return function(_0x2afdcf){if(_0x2afdcf){return _0x2afdcf['update'](_0xdfcf6c)[_0x3bea('0x23')](function(_0x282488){return _0x282488;});}return null;};}function removeEntity(_0x5ac64f,_0x561d41){return function(_0x44a74a){if(_0x44a74a){return _0x44a74a[_0x3bea('0x24')]()[_0x3bea('0x23')](function(){var _0x52319f=_0x44a74a['get']({'plain':!![]});var _0x1110f1=_0x3bea('0x25');return db[_0x3bea('0x26')]['destroy']({'where':{'type':_0x1110f1,'resourceId':_0x52319f['id']}})['then'](function(){return _0x44a74a;});})[_0x3bea('0x23')](function(){_0x5ac64f[_0x3bea('0x19')](0xcc)[_0x3bea('0x1a')]();});}};}function handleEntityNotFound(_0x138826,_0x1a7893){return function(_0x15cd15){if(!_0x15cd15){_0x138826[_0x3bea('0x27')](0x194);}return _0x15cd15;};}function handleError(_0x5f3917,_0xaf04d5){_0xaf04d5=_0xaf04d5||0x1f4;return function(_0xad938f){logger['error'](_0xad938f[_0x3bea('0x28')]);if(_0xad938f[_0x3bea('0x29')]){delete _0xad938f['name'];}_0x5f3917[_0x3bea('0x19')](_0xaf04d5)[_0x3bea('0x2a')](_0xad938f);};}exports[_0x3bea('0x2b')]=function(_0x2caf2a,_0x5425fd){var _0x58119a={},_0x2c4fae={},_0x2576f4={'count':0x0,'rows':[]};var _0x22f05b=_['map'](db['Pause'][_0x3bea('0x2c')],function(_0x207a04){return{'name':_0x207a04[_0x3bea('0x2d')],'type':_0x207a04['type']['key']};});_0x2c4fae[_0x3bea('0x2e')]=_['map'](_0x22f05b,'name');_0x2c4fae[_0x3bea('0x2f')]=_[_0x3bea('0x30')](_0x2caf2a[_0x3bea('0x2f')]);_0x2c4fae['filters']=_[_0x3bea('0x31')](_0x2c4fae['model'],_0x2c4fae[_0x3bea('0x2f')]);_0x58119a[_0x3bea('0x32')]=_[_0x3bea('0x31')](_0x2c4fae['model'],qs[_0x3bea('0x33')](_0x2caf2a[_0x3bea('0x2f')]['fields']));_0x58119a[_0x3bea('0x32')]=_0x58119a[_0x3bea('0x32')][_0x3bea('0x34')]?_0x58119a[_0x3bea('0x32')]:_0x2c4fae[_0x3bea('0x2e')];if(!_0x2caf2a[_0x3bea('0x2f')][_0x3bea('0x35')](_0x3bea('0x36'))){_0x58119a[_0x3bea('0x1c')]=qs[_0x3bea('0x1c')](_0x2caf2a[_0x3bea('0x2f')][_0x3bea('0x1c')]);_0x58119a[_0x3bea('0x1d')]=qs[_0x3bea('0x1d')](_0x2caf2a['query'][_0x3bea('0x1d')]);}_0x58119a[_0x3bea('0x37')]=qs[_0x3bea('0x38')](_0x2caf2a[_0x3bea('0x2f')][_0x3bea('0x38')]);_0x58119a['where']=qs[_0x3bea('0x39')](_[_0x3bea('0x3a')](_0x2caf2a[_0x3bea('0x2f')],_0x2c4fae[_0x3bea('0x39')]),_0x22f05b);if(_0x2caf2a[_0x3bea('0x2f')][_0x3bea('0x3b')]){_0x58119a[_0x3bea('0x3c')]=_[_0x3bea('0x3d')](_0x58119a['where'],{'$or':_['map'](_0x22f05b,function(_0x33ff1d){if(_0x33ff1d[_0x3bea('0x3e')]!=='VIRTUAL'){var _0x3dc093={};_0x3dc093[_0x33ff1d[_0x3bea('0x29')]]={'$like':'%'+_0x2caf2a[_0x3bea('0x2f')]['filter']+'%'};return _0x3dc093;}})});}_0x58119a=_[_0x3bea('0x3d')]({},_0x58119a,_0x2caf2a[_0x3bea('0x3f')]);var _0x50523e={'where':_0x58119a[_0x3bea('0x3c')]};return db[_0x3bea('0x40')][_0x3bea('0x41')](_0x50523e)['then'](function(_0x33ddd4){_0x2576f4[_0x3bea('0x41')]=_0x33ddd4;if(_0x2caf2a[_0x3bea('0x2f')][_0x3bea('0x42')]){_0x58119a[_0x3bea('0x43')]=[{'all':!![]}];}return db[_0x3bea('0x40')]['findAll'](_0x58119a);})['then'](function(_0x43e3f4){_0x2576f4[_0x3bea('0x44')]=_0x43e3f4;return _0x2576f4;})[_0x3bea('0x23')](respondWithFilteredResult(_0x5425fd,_0x58119a))[_0x3bea('0x45')](handleError(_0x5425fd,null));};exports[_0x3bea('0x46')]=function(_0x323205,_0x505b8c){var _0xf6c3d5={'raw':!![],'where':{'id':_0x323205[_0x3bea('0x47')]['id']}},_0x1fbd45={};_0x1fbd45[_0x3bea('0x2e')]=_[_0x3bea('0x30')](db[_0x3bea('0x40')][_0x3bea('0x2c')]);_0x1fbd45['query']=_[_0x3bea('0x30')](_0x323205[_0x3bea('0x2f')]);_0x1fbd45['filters']=_[_0x3bea('0x31')](_0x1fbd45[_0x3bea('0x2e')],_0x1fbd45['query']);_0xf6c3d5[_0x3bea('0x32')]=_['intersection'](_0x1fbd45['model'],qs[_0x3bea('0x33')](_0x323205[_0x3bea('0x2f')][_0x3bea('0x33')]));_0xf6c3d5[_0x3bea('0x32')]=_0xf6c3d5[_0x3bea('0x32')][_0x3bea('0x34')]?_0xf6c3d5['attributes']:_0x1fbd45[_0x3bea('0x2e')];if(_0x323205[_0x3bea('0x2f')][_0x3bea('0x42')]){_0xf6c3d5['include']=[{'all':!![]}];}_0xf6c3d5=_['merge']({},_0xf6c3d5,_0x323205['options']);return db['Pause'][_0x3bea('0x48')](_0xf6c3d5)[_0x3bea('0x23')](handleEntityNotFound(_0x505b8c,null))['then'](respondWithResult(_0x505b8c,null))['catch'](handleError(_0x505b8c,null));};exports[_0x3bea('0x49')]=function(_0x30ef68,_0x3e8928){return db[_0x3bea('0x40')][_0x3bea('0x49')](_0x30ef68[_0x3bea('0x4a')],{})[_0x3bea('0x23')](function(_0x1a0980){var _0x52772a=_0x30ef68['user'][_0x3bea('0x4b')]({'plain':!![]});if(!_0x52772a)throw new Error(_0x3bea('0x4c'));if(_0x52772a[_0x3bea('0x4d')]===_0x3bea('0x4e')){var _0x35f036=_0x1a0980[_0x3bea('0x4b')]({'plain':!![]});var _0x341bb9='Pauses';return db[_0x3bea('0x4f')][_0x3bea('0x48')]({'where':{'name':_0x341bb9,'userProfileId':_0x52772a[_0x3bea('0x50')]},'raw':!![]})['then'](function(_0x43dc89){if(_0x43dc89&&_0x43dc89[_0x3bea('0x51')]===0x0){return db['UserProfileResource'][_0x3bea('0x49')]({'name':_0x35f036['name'],'resourceId':_0x35f036['id'],'type':_0x43dc89[_0x3bea('0x29')],'sectionId':_0x43dc89['id']},{})['then'](function(){return _0x1a0980;});}else{return _0x1a0980;}})['catch'](function(_0xed46c2){logger[_0x3bea('0x52')](_0x3bea('0x53'),_0xed46c2);throw _0xed46c2;});}return _0x1a0980;})['then'](respondWithResult(_0x3e8928,0xc9))[_0x3bea('0x45')](handleError(_0x3e8928,null));};exports[_0x3bea('0x54')]=function(_0x39fff7,_0x56001c){if(_0x39fff7['body']['id']){delete _0x39fff7[_0x3bea('0x4a')]['id'];}return db['Pause'][_0x3bea('0x48')]({'where':{'id':_0x39fff7[_0x3bea('0x47')]['id']}})[_0x3bea('0x23')](handleEntityNotFound(_0x56001c,null))['then'](saveUpdates(_0x39fff7[_0x3bea('0x4a')],null))['then'](respondWithResult(_0x56001c,null))[_0x3bea('0x45')](handleError(_0x56001c,null));};exports[_0x3bea('0x24')]=function(_0x2b1e03,_0x3f20d6){return db[_0x3bea('0x40')]['find']({'where':{'id':_0x2b1e03['params']['id']}})[_0x3bea('0x23')](handleEntityNotFound(_0x3f20d6,null))[_0x3bea('0x23')](removeEntity(_0x3f20d6,null))[_0x3bea('0x45')](handleError(_0x3f20d6,null));}; \ No newline at end of file +var _0xf932=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','status','sendStatus','name','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3f553b,_0x49a9c2){var _0x183c4e=function(_0x873b22){while(--_0x873b22){_0x3f553b['push'](_0x3f553b['shift']());}};_0x183c4e(++_0x49a9c2);}(_0xf932,0xe8));var _0x2f93=function(_0x49a19b,_0x29d695){_0x49a19b=_0x49a19b-0x0;var _0x1bc083=_0xf932[_0x49a19b];return _0x1bc083;};'use strict';var emlformat=require(_0x2f93('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f93('0x1'));var jsonpatch=require(_0x2f93('0x2'));var rp=require(_0x2f93('0x3'));var moment=require(_0x2f93('0x4'));var BPromise=require(_0x2f93('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2f93('0x6'));var csv=require(_0x2f93('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f93('0x8'));var squel=require(_0x2f93('0x9'));var crypto=require(_0x2f93('0xa'));var jsforce=require(_0x2f93('0xb'));var deskjs=require(_0x2f93('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2f93('0xd'));var Papa=require(_0x2f93('0xe'));var Redis=require(_0x2f93('0xf'));var authService=require(_0x2f93('0x10'));var qs=require(_0x2f93('0x11'));var as=require(_0x2f93('0x12'));var hardwareService=require(_0x2f93('0x13'));var logger=require(_0x2f93('0x14'))(_0x2f93('0x15'));var utils=require(_0x2f93('0x16'));var config=require(_0x2f93('0x17'));var licenseUtil=require(_0x2f93('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a8cea,_0x455122){_0x455122=_0x455122||0xcc;return function(_0x3f644b){if(_0x3f644b){return _0x2a8cea['sendStatus'](_0x455122);}return _0x2a8cea['status'](_0x455122)[_0x2f93('0x19')]();};}function respondWithResult(_0xcd5f79,_0x44ab48){_0x44ab48=_0x44ab48||0xc8;return function(_0x5211dd){if(_0x5211dd){return _0xcd5f79['status'](_0x44ab48)[_0x2f93('0x1a')](_0x5211dd);}};}function respondWithFilteredResult(_0x17987a,_0x43f6ff){return function(_0x3686cb){if(_0x3686cb){var _0x7a4b11=typeof _0x43f6ff[_0x2f93('0x1b')]==='undefined'&&typeof _0x43f6ff[_0x2f93('0x1c')]===_0x2f93('0x1d');var _0x165e9a=_0x3686cb['count'];var _0x437a2f=_0x7a4b11?0x0:_0x43f6ff[_0x2f93('0x1b')];var _0x7bf3fa=_0x7a4b11?_0x3686cb[_0x2f93('0x1e')]:_0x43f6ff[_0x2f93('0x1b')]+_0x43f6ff[_0x2f93('0x1c')];var _0x222598;if(_0x7bf3fa>=_0x165e9a){_0x7bf3fa=_0x165e9a;_0x222598=0xc8;}else{_0x222598=0xce;}_0x17987a['status'](_0x222598);return _0x17987a['set'](_0x2f93('0x1f'),_0x437a2f+'-'+_0x7bf3fa+'/'+_0x165e9a)[_0x2f93('0x1a')](_0x3686cb);}return null;};}function patchUpdates(_0x12c0d9){return function(_0x2e7fcb){try{jsonpatch[_0x2f93('0x20')](_0x2e7fcb,_0x12c0d9,!![]);}catch(_0x5a4086){return BPromise[_0x2f93('0x21')](_0x5a4086);}return _0x2e7fcb['save']();};}function saveUpdates(_0x279536,_0x5b9a80){return function(_0x5735a7){if(_0x5735a7){return _0x5735a7[_0x2f93('0x22')](_0x279536)[_0x2f93('0x23')](function(_0x2027ed){return _0x2027ed;});}return null;};}function removeEntity(_0x598dde,_0xb3c563){return function(_0x285de4){if(_0x285de4){return _0x285de4[_0x2f93('0x24')]()[_0x2f93('0x23')](function(){var _0x2a4c25=_0x285de4[_0x2f93('0x25')]({'plain':!![]});var _0x41e606='Pauses';return db[_0x2f93('0x26')][_0x2f93('0x24')]({'where':{'type':_0x41e606,'resourceId':_0x2a4c25['id']}})['then'](function(){return _0x285de4;});})[_0x2f93('0x23')](function(){_0x598dde[_0x2f93('0x27')](0xcc)[_0x2f93('0x19')]();});}};}function handleEntityNotFound(_0x4dd126,_0x253b7b){return function(_0x3276e7){if(!_0x3276e7){_0x4dd126[_0x2f93('0x28')](0x194);}return _0x3276e7;};}function handleError(_0x35381d,_0x1d561e){_0x1d561e=_0x1d561e||0x1f4;return function(_0x333594){logger['error'](_0x333594['stack']);if(_0x333594[_0x2f93('0x29')]){delete _0x333594['name'];}_0x35381d['status'](_0x1d561e)['send'](_0x333594);};}exports[_0x2f93('0x2a')]=function(_0x5234e,_0x2b2409){var _0x4470bb={},_0x387cfe={},_0x17b8da={'count':0x0,'rows':[]};var _0x2717cf=_[_0x2f93('0x2b')](db[_0x2f93('0x2c')][_0x2f93('0x2d')],function(_0x30b321){return{'name':_0x30b321[_0x2f93('0x2e')],'type':_0x30b321[_0x2f93('0x2f')][_0x2f93('0x30')]};});_0x387cfe[_0x2f93('0x31')]=_[_0x2f93('0x2b')](_0x2717cf,_0x2f93('0x29'));_0x387cfe[_0x2f93('0x32')]=_[_0x2f93('0x33')](_0x5234e[_0x2f93('0x32')]);_0x387cfe[_0x2f93('0x34')]=_['intersection'](_0x387cfe[_0x2f93('0x31')],_0x387cfe[_0x2f93('0x32')]);_0x4470bb[_0x2f93('0x35')]=_[_0x2f93('0x36')](_0x387cfe['model'],qs[_0x2f93('0x37')](_0x5234e[_0x2f93('0x32')]['fields']));_0x4470bb[_0x2f93('0x35')]=_0x4470bb['attributes'][_0x2f93('0x38')]?_0x4470bb[_0x2f93('0x35')]:_0x387cfe['model'];if(!_0x5234e[_0x2f93('0x32')][_0x2f93('0x39')]('nolimit')){_0x4470bb[_0x2f93('0x1c')]=qs[_0x2f93('0x1c')](_0x5234e[_0x2f93('0x32')][_0x2f93('0x1c')]);_0x4470bb['offset']=qs[_0x2f93('0x1b')](_0x5234e['query'][_0x2f93('0x1b')]);}_0x4470bb['order']=qs[_0x2f93('0x3a')](_0x5234e['query'][_0x2f93('0x3a')]);_0x4470bb[_0x2f93('0x3b')]=qs['filters'](_[_0x2f93('0x3c')](_0x5234e[_0x2f93('0x32')],_0x387cfe['filters']),_0x2717cf);if(_0x5234e[_0x2f93('0x32')][_0x2f93('0x3d')]){_0x4470bb[_0x2f93('0x3b')]=_[_0x2f93('0x3e')](_0x4470bb[_0x2f93('0x3b')],{'$or':_[_0x2f93('0x2b')](_0x2717cf,function(_0x1ed1d6){if(_0x1ed1d6[_0x2f93('0x2f')]!==_0x2f93('0x3f')){var _0x2ac58b={};_0x2ac58b[_0x1ed1d6[_0x2f93('0x29')]]={'$like':'%'+_0x5234e[_0x2f93('0x32')]['filter']+'%'};return _0x2ac58b;}})});}_0x4470bb=_[_0x2f93('0x3e')]({},_0x4470bb,_0x5234e[_0x2f93('0x40')]);var _0x94f9dd={'where':_0x4470bb[_0x2f93('0x3b')]};return db[_0x2f93('0x2c')][_0x2f93('0x1e')](_0x94f9dd)[_0x2f93('0x23')](function(_0x50d5e6){_0x17b8da[_0x2f93('0x1e')]=_0x50d5e6;if(_0x5234e[_0x2f93('0x32')][_0x2f93('0x41')]){_0x4470bb[_0x2f93('0x42')]=[{'all':!![]}];}return db[_0x2f93('0x2c')][_0x2f93('0x43')](_0x4470bb);})['then'](function(_0x54defd){_0x17b8da[_0x2f93('0x44')]=_0x54defd;return _0x17b8da;})['then'](respondWithFilteredResult(_0x2b2409,_0x4470bb))[_0x2f93('0x45')](handleError(_0x2b2409,null));};exports[_0x2f93('0x46')]=function(_0x1356a3,_0x305dd2){var _0x44642a={'raw':!![],'where':{'id':_0x1356a3[_0x2f93('0x47')]['id']}},_0x101d02={};_0x101d02['model']=_[_0x2f93('0x33')](db[_0x2f93('0x2c')][_0x2f93('0x2d')]);_0x101d02['query']=_[_0x2f93('0x33')](_0x1356a3[_0x2f93('0x32')]);_0x101d02[_0x2f93('0x34')]=_[_0x2f93('0x36')](_0x101d02['model'],_0x101d02['query']);_0x44642a[_0x2f93('0x35')]=_[_0x2f93('0x36')](_0x101d02[_0x2f93('0x31')],qs[_0x2f93('0x37')](_0x1356a3[_0x2f93('0x32')]['fields']));_0x44642a[_0x2f93('0x35')]=_0x44642a['attributes'][_0x2f93('0x38')]?_0x44642a[_0x2f93('0x35')]:_0x101d02[_0x2f93('0x31')];if(_0x1356a3[_0x2f93('0x32')][_0x2f93('0x41')]){_0x44642a[_0x2f93('0x42')]=[{'all':!![]}];}_0x44642a=_['merge']({},_0x44642a,_0x1356a3['options']);return db[_0x2f93('0x2c')][_0x2f93('0x48')](_0x44642a)[_0x2f93('0x23')](handleEntityNotFound(_0x305dd2,null))[_0x2f93('0x23')](respondWithResult(_0x305dd2,null))[_0x2f93('0x45')](handleError(_0x305dd2,null));};exports[_0x2f93('0x49')]=function(_0x52eb12,_0x1d6288){return db[_0x2f93('0x2c')][_0x2f93('0x49')](_0x52eb12[_0x2f93('0x4a')],{})[_0x2f93('0x23')](function(_0x194419){var _0x3ddae6=_0x52eb12[_0x2f93('0x4b')][_0x2f93('0x25')]({'plain':!![]});if(!_0x3ddae6)throw new Error(_0x2f93('0x4c'));if(_0x3ddae6[_0x2f93('0x4d')]===_0x2f93('0x4b')){var _0x2fff4b=_0x194419[_0x2f93('0x25')]({'plain':!![]});var _0x28d7dc=_0x2f93('0x4e');return db['UserProfileSection'][_0x2f93('0x48')]({'where':{'name':_0x28d7dc,'userProfileId':_0x3ddae6[_0x2f93('0x4f')]},'raw':!![]})['then'](function(_0x1b6f5b){if(_0x1b6f5b&&_0x1b6f5b[_0x2f93('0x50')]===0x0){return db['UserProfileResource'][_0x2f93('0x49')]({'name':_0x2fff4b['name'],'resourceId':_0x2fff4b['id'],'type':_0x1b6f5b[_0x2f93('0x29')],'sectionId':_0x1b6f5b['id']},{})[_0x2f93('0x23')](function(){return _0x194419;});}else{return _0x194419;}})[_0x2f93('0x45')](function(_0x1a79ae){logger[_0x2f93('0x51')](_0x2f93('0x52'),_0x1a79ae);throw _0x1a79ae;});}return _0x194419;})[_0x2f93('0x23')](respondWithResult(_0x1d6288,0xc9))['catch'](handleError(_0x1d6288,null));};exports['update']=function(_0x581bcd,_0x56b67c){if(_0x581bcd[_0x2f93('0x4a')]['id']){delete _0x581bcd['body']['id'];}return db[_0x2f93('0x2c')][_0x2f93('0x48')]({'where':{'id':_0x581bcd[_0x2f93('0x47')]['id']}})[_0x2f93('0x23')](handleEntityNotFound(_0x56b67c,null))[_0x2f93('0x23')](saveUpdates(_0x581bcd['body'],null))[_0x2f93('0x23')](respondWithResult(_0x56b67c,null))[_0x2f93('0x45')](handleError(_0x56b67c,null));};exports[_0x2f93('0x24')]=function(_0x4c93cf,_0x8ac98e){return db[_0x2f93('0x2c')][_0x2f93('0x48')]({'where':{'id':_0x4c93cf[_0x2f93('0x47')]['id']}})['then'](handleEntityNotFound(_0x8ac98e,null))['then'](removeEntity(_0x8ac98e,null))['catch'](handleError(_0x8ac98e,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 814166b..433b5fb 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index c754da3..8ccb99d 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(_0x1188a1,_0x7563ba){var _0x3e43b5=function(_0x191811){while(--_0x191811){_0x1188a1['push'](_0x1188a1['shift']());}};_0x3e43b5(++_0x7563ba);}(_0x7a54,0x106));var _0x47a5=function(_0x33138c,_0x3855ab){_0x33138c=_0x33138c-0x0;var _0x5304a6=_0x7a54[_0x33138c];return _0x5304a6;};'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(_0x3e7f77,_0x3c2cb6){var _0x510cad=function(_0x8695d0){while(--_0x8695d0){_0x3e7f77['push'](_0x3e7f77['shift']());}};_0x510cad(++_0x3c2cb6);}(_0xb10b,0x12a));var _0xbb10=function(_0x5732d6,_0x2c9500){_0x5732d6=_0x5732d6-0x0;var _0x3a1a0f=_0xb10b[_0x5732d6];return _0x3a1a0f;};'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 7380f08..2252dea 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 _0xbec5=['get','index','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','upload','webhookPost','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x208dc3,_0x5d1c2a){var _0x4b89b1=function(_0x106700){while(--_0x106700){_0x208dc3['push'](_0x208dc3['shift']());}};_0x4b89b1(++_0x5d1c2a);}(_0xbec5,0xe5));var _0x5bec=function(_0x42d2af,_0x3961b5){_0x42d2af=_0x42d2af-0x0;var _0x1d6d63=_0xbec5[_0x42d2af];return _0x1d6d63;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),controller[_0x5bec('0xc')]);router[_0x5bec('0x9')](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0xf')]);router['get'](_0x5bec('0x10'),auth['isAuthenticated'](),controller[_0x5bec('0x11')]);var upload=multer({'storage':multer[_0x5bec('0x12')]({'destination':function(_0x117162,_0x4a5482,_0x288d1b){_0x288d1b(null,path[_0x5bec('0x13')](config[_0x5bec('0x14')],'server/files/plugins'));},'filename':function(_0x6bee21,_0x1c888f,_0x589d14){_0x1c888f[_0x5bec('0x15')]=_0x1c888f[_0x5bec('0x15')][_0x5bec('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x589d14(null,util[_0x5bec('0x17')](_0x5bec('0x18'),path[_0x5bec('0x19')](_0x1c888f[_0x5bec('0x15')],path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])),Date[_0x5bec('0x1b')](),path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])));}})});router[_0x5bec('0x1c')]('/',upload['single']('file'),controller[_0x5bec('0x1d')]);router[_0x5bec('0x1c')](_0x5bec('0xb'),controller[_0x5bec('0x1e')]);router['put']('/:id',auth[_0x5bec('0xe')](),controller[_0x5bec('0x1f')]);router['delete'](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0x20')]);module[_0x5bec('0x21')]=router; \ No newline at end of file +var _0x5c12=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/:id','show','download','diskStorage','join','root','originalname','basename','extname','now','upload','post','put','update','delete','exports'];(function(_0x1120d2,_0x153c1e){var _0x3ca064=function(_0x431859){while(--_0x431859){_0x1120d2['push'](_0x1120d2['shift']());}};_0x3ca064(++_0x153c1e);}(_0x5c12,0x188));var _0x25c1=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0x5c12[_0x5c7a85];return _0x35290f;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var fs_extra=require(_0x25c1('0x4'));var auth=require(_0x25c1('0x5'));var interaction=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var controller=require(_0x25c1('0x8'));router['get']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xa')]);router[_0x25c1('0xb')]('/webhook',controller['webhookGet']);router[_0x25c1('0xb')](_0x25c1('0xc'),auth[_0x25c1('0x9')](),controller[_0x25c1('0xd')]);router[_0x25c1('0xb')]('/:id/download',auth[_0x25c1('0x9')](),controller[_0x25c1('0xe')]);var upload=multer({'storage':multer[_0x25c1('0xf')]({'destination':function(_0x81f0f4,_0x2872b2,_0x5e44e2){_0x5e44e2(null,path[_0x25c1('0x10')](config[_0x25c1('0x11')],'server/files/plugins'));},'filename':function(_0x256ecd,_0x209af5,_0x323d3c){_0x209af5[_0x25c1('0x12')]=_0x209af5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x323d3c(null,util['format']('%s-%s%s',path[_0x25c1('0x13')](_0x209af5[_0x25c1('0x12')],path[_0x25c1('0x14')](_0x209af5[_0x25c1('0x12')])),Date[_0x25c1('0x15')](),path['extname'](_0x209af5[_0x25c1('0x12')])));}})});router['post']('/',upload['single']('file'),controller[_0x25c1('0x16')]);router[_0x25c1('0x17')]('/webhook',controller['webhookPost']);router[_0x25c1('0x18')]('/:id',auth[_0x25c1('0x9')](),controller[_0x25c1('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x25c1('0x1a')]);module[_0x25c1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 8386e20..8185572 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 _0xc126=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT'];(function(_0x2b3e8f,_0x561ce0){var _0x1c2f80=function(_0x10c322){while(--_0x10c322){_0x2b3e8f['push'](_0x2b3e8f['shift']());}};_0x1c2f80(++_0x561ce0);}(_0xc126,0x1e7));var _0x6c12=function(_0x1e3eea,_0x10c3c2){_0x1e3eea=_0x1e3eea-0x0;var _0x6dcac=_0xc126[_0x1e3eea];return _0x6dcac;};'use strict';var Sequelize=require(_0x6c12('0x0'));module[_0x6c12('0x1')]={'name':{'type':Sequelize[_0x6c12('0x2')]},'type':{'type':Sequelize[_0x6c12('0x3')](_0x6c12('0x4'),_0x6c12('0x5'))},'description':{'type':Sequelize[_0x6c12('0x6')]},'version':{'type':Sequelize[_0x6c12('0x6')]},'path':{'type':Sequelize[_0x6c12('0x2')],'comment':_0x6c12('0x7')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x6c12('0x8')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x6c12('0x9'),'always',_0x6c12('0xa')),'defaultValue':_0x6c12('0xb'),'comment':_0x6c12('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x6c12('0x2')]},'agentUrl':{'type':Sequelize[_0x6c12('0x2')]},'scriptName':{'type':Sequelize[_0x6c12('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd465=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT'];(function(_0x52dff8,_0x5c30ce){var _0x5c2c52=function(_0x190449){while(--_0x190449){_0x52dff8['push'](_0x52dff8['shift']());}};_0x5c2c52(++_0x5c30ce);}(_0xd465,0x80));var _0x5d46=function(_0x5f485c,_0x53def4){_0x5f485c=_0x5f485c-0x0;var _0x2970a2=_0xd465[_0x5f485c];return _0x2970a2;};'use strict';var Sequelize=require(_0x5d46('0x0'));module[_0x5d46('0x1')]={'name':{'type':Sequelize[_0x5d46('0x2')]},'type':{'type':Sequelize[_0x5d46('0x3')](_0x5d46('0x4'),_0x5d46('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x5d46('0x6')]},'path':{'type':Sequelize['STRING'],'comment':_0x5d46('0x7')},'active':{'type':Sequelize[_0x5d46('0x8')],'defaultValue':0x0,'comment':_0x5d46('0x9')},'sidebar':{'type':Sequelize[_0x5d46('0x3')](_0x5d46('0xa'),_0x5d46('0xb'),_0x5d46('0xc'),_0x5d46('0xd')),'defaultValue':'always','comment':_0x5d46('0xe')},'icon':{'type':Sequelize[_0x5d46('0x2')]},'adminUrl':{'type':Sequelize[_0x5d46('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x5d46('0x2')]},'scriptPath':{'type':Sequelize[_0x5d46('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index a1b57fc..9ba67d0 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 _0x70d3=['isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','parameters','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','headers','content-type','statusCode','webhookPost','method','%s%s','content-length','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','update','then','destroy','get','Plugins','UserProfileResource','end','stack','name','send','index','map','Plugin','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','filter','include','findAll','rows','show','params','rawAttributes','length','options','find','catch','download','path','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','error','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x70d3,0x18b));var _0x370d=function(_0x32fa5f,_0xe5a16b){_0x32fa5f=_0x32fa5f-0x0;var _0x2e617d=_0x70d3[_0x32fa5f];return _0x2e617d;};'use strict';var emlformat=require(_0x370d('0x0'));var rimraf=require(_0x370d('0x1'));var zipdir=require(_0x370d('0x2'));var jsonpatch=require(_0x370d('0x3'));var rp=require(_0x370d('0x4'));var moment=require(_0x370d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x370d('0x6'));var util=require(_0x370d('0x7'));var path=require('path');var sox=require(_0x370d('0x8'));var csv=require(_0x370d('0x9'));var ejs=require(_0x370d('0xa'));var fs=require('fs');var fs_extra=require(_0x370d('0xb'));var _=require(_0x370d('0xc'));var squel=require(_0x370d('0xd'));var crypto=require(_0x370d('0xe'));var jsforce=require(_0x370d('0xf'));var deskjs=require(_0x370d('0x10'));var toCsv=require(_0x370d('0x9'));var querystring=require(_0x370d('0x11'));var Papa=require(_0x370d('0x12'));var extract=require(_0x370d('0x13'));var rimraf=require(_0x370d('0x1'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x370d('0x14'));var qs=require(_0x370d('0x15'));var as=require(_0x370d('0x16'));var hardwareService=require(_0x370d('0x17'));var logger=require(_0x370d('0x18'))(_0x370d('0x19'));var utils=require(_0x370d('0x1a'));var config=require(_0x370d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x370d('0x1c'))['db'];config[_0x370d('0x1d')]=_['defaults'](config[_0x370d('0x1d')],{'host':_0x370d('0x1e'),'port':0x18eb});var socket=require(_0x370d('0x1f'))(new Redis(config[_0x370d('0x1d')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x51a121,_0x511d33){_0x511d33=_0x511d33||0xcc;return function(_0x3dbe1e){if(_0x3dbe1e){return _0x51a121[_0x370d('0x20')](_0x511d33);}return _0x51a121[_0x370d('0x21')](_0x511d33)['end']();};}function respondWithResult(_0x5e1d48,_0x2a6f1f){_0x2a6f1f=_0x2a6f1f||0xc8;return function(_0x1d1123){if(_0x1d1123){return _0x5e1d48[_0x370d('0x21')](_0x2a6f1f)[_0x370d('0x22')](_0x1d1123);}};}function respondWithFilteredResult(_0x1dd49a,_0x4be517){return function(_0x3fca49){if(_0x3fca49){var _0x1d1d11=typeof _0x4be517['offset']==='undefined'&&typeof _0x4be517[_0x370d('0x23')]===_0x370d('0x24');var _0x302635=_0x3fca49[_0x370d('0x25')];var _0x592e15=_0x1d1d11?0x0:_0x4be517[_0x370d('0x26')];var _0x80a4f7=_0x1d1d11?_0x3fca49[_0x370d('0x25')]:_0x4be517[_0x370d('0x26')]+_0x4be517['limit'];var _0x2dce0e;if(_0x80a4f7>=_0x302635){_0x80a4f7=_0x302635;_0x2dce0e=0xc8;}else{_0x2dce0e=0xce;}_0x1dd49a['status'](_0x2dce0e);return _0x1dd49a[_0x370d('0x27')](_0x370d('0x28'),_0x592e15+'-'+_0x80a4f7+'/'+_0x302635)[_0x370d('0x22')](_0x3fca49);}return null;};}function patchUpdates(_0x2db031){return function(_0x20870d){try{jsonpatch[_0x370d('0x29')](_0x20870d,_0x2db031,!![]);}catch(_0x20a2b1){return BPromise['reject'](_0x20a2b1);}return _0x20870d['save']();};}function saveUpdates(_0x30caf8,_0x2f7fb1){return function(_0xfa3738){if(_0xfa3738){return _0xfa3738[_0x370d('0x2a')](_0x30caf8)[_0x370d('0x2b')](function(_0x4d5129){return _0x4d5129;});}return null;};}function removeEntity(_0x96619f,_0x328a3e){return function(_0x38f896){if(_0x38f896){return _0x38f896[_0x370d('0x2c')]()[_0x370d('0x2b')](function(){var _0x4f1601=_0x38f896[_0x370d('0x2d')]({'plain':!![]});var _0x12c90e=_0x370d('0x2e');return db[_0x370d('0x2f')][_0x370d('0x2c')]({'where':{'type':_0x12c90e,'resourceId':_0x4f1601['id']}})[_0x370d('0x2b')](function(){return _0x38f896;});})[_0x370d('0x2b')](function(){_0x96619f[_0x370d('0x21')](0xcc)[_0x370d('0x30')]();});}};}function handleEntityNotFound(_0x3f9075,_0x5c1b52){return function(_0x1cf911){if(!_0x1cf911){_0x3f9075[_0x370d('0x20')](0x194);}return _0x1cf911;};}function handleError(_0xd2be48,_0x1dee18){_0x1dee18=_0x1dee18||0x1f4;return function(_0x19a0fe){logger['error'](_0x19a0fe[_0x370d('0x31')]);if(_0x19a0fe['name']){delete _0x19a0fe[_0x370d('0x32')];}_0xd2be48[_0x370d('0x21')](_0x1dee18)[_0x370d('0x33')](_0x19a0fe);};}exports[_0x370d('0x34')]=function(_0x197ca9,_0xb23956){var _0x476733={},_0x11e2f2={},_0xc8cc7c={'count':0x0,'rows':[]};var _0xb19853=_[_0x370d('0x35')](db[_0x370d('0x36')]['rawAttributes'],function(_0x24c415){return{'name':_0x24c415['fieldName'],'type':_0x24c415[_0x370d('0x37')]['key']};});_0x11e2f2[_0x370d('0x38')]=_[_0x370d('0x35')](_0xb19853,_0x370d('0x32'));_0x11e2f2['query']=_[_0x370d('0x39')](_0x197ca9[_0x370d('0x3a')]);_0x11e2f2[_0x370d('0x3b')]=_[_0x370d('0x3c')](_0x11e2f2[_0x370d('0x38')],_0x11e2f2[_0x370d('0x3a')]);_0x476733[_0x370d('0x3d')]=_[_0x370d('0x3c')](_0x11e2f2[_0x370d('0x38')],qs['fields'](_0x197ca9[_0x370d('0x3a')][_0x370d('0x3e')]));_0x476733[_0x370d('0x3d')]=_0x476733[_0x370d('0x3d')]['length']?_0x476733[_0x370d('0x3d')]:_0x11e2f2[_0x370d('0x38')];if(!_0x197ca9[_0x370d('0x3a')][_0x370d('0x3f')](_0x370d('0x40'))){_0x476733[_0x370d('0x23')]=qs[_0x370d('0x23')](_0x197ca9['query'][_0x370d('0x23')]);_0x476733[_0x370d('0x26')]=qs[_0x370d('0x26')](_0x197ca9[_0x370d('0x3a')][_0x370d('0x26')]);}_0x476733[_0x370d('0x41')]=qs[_0x370d('0x42')](_0x197ca9[_0x370d('0x3a')][_0x370d('0x42')]);_0x476733[_0x370d('0x43')]=qs[_0x370d('0x3b')](_['pick'](_0x197ca9[_0x370d('0x3a')],_0x11e2f2[_0x370d('0x3b')]),_0xb19853);if(_0x197ca9[_0x370d('0x3a')]['filter']){_0x476733[_0x370d('0x43')]=_[_0x370d('0x44')](_0x476733[_0x370d('0x43')],{'$or':_[_0x370d('0x35')](_0xb19853,function(_0xe0b335){if(_0xe0b335[_0x370d('0x37')]!=='VIRTUAL'){var _0x42e868={};_0x42e868[_0xe0b335[_0x370d('0x32')]]={'$like':'%'+_0x197ca9[_0x370d('0x3a')][_0x370d('0x45')]+'%'};return _0x42e868;}})});}_0x476733=_[_0x370d('0x44')]({},_0x476733,_0x197ca9['options']);var _0x111568={'where':_0x476733[_0x370d('0x43')]};return db[_0x370d('0x36')][_0x370d('0x25')](_0x111568)[_0x370d('0x2b')](function(_0x559a23){_0xc8cc7c[_0x370d('0x25')]=_0x559a23;if(_0x197ca9['query']['includeAll']){_0x476733[_0x370d('0x46')]=[{'all':!![]}];}return db[_0x370d('0x36')][_0x370d('0x47')](_0x476733);})[_0x370d('0x2b')](function(_0x50d4b7){_0xc8cc7c[_0x370d('0x48')]=_0x50d4b7;return _0xc8cc7c;})[_0x370d('0x2b')](respondWithFilteredResult(_0xb23956,_0x476733))['catch'](handleError(_0xb23956,null));};exports[_0x370d('0x49')]=function(_0x36b3c4,_0x4c1365){var _0x55839a={'raw':!![],'where':{'id':_0x36b3c4[_0x370d('0x4a')]['id']}},_0x3d91bd={};_0x3d91bd['model']=_[_0x370d('0x39')](db[_0x370d('0x36')][_0x370d('0x4b')]);_0x3d91bd[_0x370d('0x3a')]=_[_0x370d('0x39')](_0x36b3c4[_0x370d('0x3a')]);_0x3d91bd['filters']=_[_0x370d('0x3c')](_0x3d91bd[_0x370d('0x38')],_0x3d91bd[_0x370d('0x3a')]);_0x55839a['attributes']=_[_0x370d('0x3c')](_0x3d91bd['model'],qs[_0x370d('0x3e')](_0x36b3c4['query']['fields']));_0x55839a[_0x370d('0x3d')]=_0x55839a[_0x370d('0x3d')][_0x370d('0x4c')]?_0x55839a[_0x370d('0x3d')]:_0x3d91bd[_0x370d('0x38')];if(_0x36b3c4[_0x370d('0x3a')]['includeAll']){_0x55839a['include']=[{'all':!![]}];}_0x55839a=_[_0x370d('0x44')]({},_0x55839a,_0x36b3c4[_0x370d('0x4d')]);return db[_0x370d('0x36')][_0x370d('0x4e')](_0x55839a)[_0x370d('0x2b')](handleEntityNotFound(_0x4c1365,null))[_0x370d('0x2b')](respondWithResult(_0x4c1365,null))[_0x370d('0x4f')](handleError(_0x4c1365,null));};exports[_0x370d('0x50')]=function(_0x33dc2a,_0x1aac55,_0x347f66){return db[_0x370d('0x36')][_0x370d('0x4e')]({'where':{'id':_0x33dc2a[_0x370d('0x4a')]['id']},'attributes':[_0x370d('0x32'),_0x370d('0x51')],'raw':!![]})[_0x370d('0x2b')](handleEntityNotFound(_0x1aac55,null))[_0x370d('0x2b')](function(_0x2baed9){if(_0x2baed9){var _0x4b33d5=path[_0x370d('0x52')](config[_0x370d('0x53')],_0x370d('0x54'),util[_0x370d('0x55')](_0x370d('0x56'),path[_0x370d('0x57')](_0x2baed9[_0x370d('0x51')])));var _0x398d4d=fs[_0x370d('0x58')](_0x4b33d5);var _0x1926fc=archiver(_0x370d('0x59'),{'zlib':{'level':0x9}});_0x1926fc['on'](_0x370d('0x5a'),function(_0x113e8c){if(_0x113e8c['code']===_0x370d('0x5b')){logger['error'](_0x113e8c);}else{throw new db[(_0x370d('0x5c'))][(_0x370d('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1926fc['on']('error',function(_0x7f1dfc){throw new db[(_0x370d('0x5c'))][(_0x370d('0x5d'))](_0x370d('0x5e'));});_0x1926fc[_0x370d('0x5f')](_0x398d4d);_0x1926fc[_0x370d('0x60')]('**/*',{'cwd':path[_0x370d('0x52')](config[_0x370d('0x53')],_0x370d('0x54'),path[_0x370d('0x61')](_0x2baed9[_0x370d('0x51')])),'ignore':[path['join'](path[_0x370d('0x57')](_0x2baed9[_0x370d('0x51')]),'node_modules/**/*'),path[_0x370d('0x52')](path[_0x370d('0x57')](_0x2baed9['path']),_0x370d('0x62'))],'nodir':!![]})[_0x370d('0x63')]();_0x398d4d['on'](_0x370d('0x64'),function(){if(!fs[_0x370d('0x65')](_0x4b33d5)){throw new db[(_0x370d('0x5c'))]['Error'](_0x370d('0x66'));}return _0x1aac55[_0x370d('0x50')](_0x4b33d5,util['format']('%s.zip',path[_0x370d('0x57')](_0x2baed9[_0x370d('0x51')])),function(_0x38ef70){if(_0x38ef70){throw new db[(_0x370d('0x5c'))][(_0x370d('0x5d'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x370d('0x67')](_0x4b33d5);logger[_0x370d('0x68')](_0x370d('0x69'));logger[_0x370d('0x68')](_0x370d('0x6a'));});});}return null;})[_0x370d('0x4f')](handleError(_0x1aac55,null));};exports['upload']=function(_0x32b969,_0x123884,_0x47257a){var _0x682795=path['basename'](_0x32b969[_0x370d('0x6b')][_0x370d('0x6c')],path[_0x370d('0x6d')](_0x32b969[_0x370d('0x6b')][_0x370d('0x6c')]));var _0x5b4850=path[_0x370d('0x52')](config['root'],'server/files/plugins',_0x32b969[_0x370d('0x6b')][_0x370d('0x6c')]);var _0x4df7ca=path[_0x370d('0x52')](config[_0x370d('0x53')],_0x370d('0x54'),_0x682795);logger[_0x370d('0x68')](_0x370d('0x6e'),_0x5b4850);logger['info'](_0x370d('0x6f'),_0x4df7ca);try{fs[_0x370d('0x70')](_0x5b4850,parseInt('0777',0x8));extract(_0x5b4850,{'dir':_0x4df7ca},function(_0x42ce95){if(_0x42ce95){logger[_0x370d('0x71')](_0x42ce95);handleError(_0x42ce95,!![]);};var _0x40342c=fs[_0x370d('0x72')](_0x4df7ca);if(_0x40342c[_0x370d('0x4c')]>0x1){removeReferences(_0x5b4850,_0x4df7ca);logger[_0x370d('0x71')](_0x370d('0x73'));return _0x47257a(new Error('Invalid\x20plugin\x20structure'));}var _0x38321a=fs[_0x370d('0x74')](path[_0x370d('0x52')](_0x4df7ca,_0x40342c[0x0]));if(_0x38321a[_0x370d('0x75')]()){removeReferences(_0x5b4850,_0x4df7ca);logger[_0x370d('0x71')](_0x370d('0x73'));return _0x47257a(new Error(_0x370d('0x73')));}if(_0x38321a[_0x370d('0x76')]()){var _0x4f0bef=fs['readdirSync'](path[_0x370d('0x52')](_0x4df7ca,_0x40342c[0x0]));if(_0x4f0bef[_0x370d('0x4c')]===0x0){removeReferences(_0x5b4850,_0x4df7ca);logger[_0x370d('0x71')](_0x370d('0x73'));return _0x47257a(new Error(_0x370d('0x73')));}var _0xe310e3=_0x4f0bef[_0x370d('0x77')](function(_0x1de1dc){return _0x1de1dc===_0x370d('0x78');});if(!_0xe310e3){return _0x47257a(new Error('Plugin\x20manifest\x20missing'));}var _0x237d86=fs[_0x370d('0x79')](path[_0x370d('0x52')](_0x4df7ca,_0x40342c[0x0],_0x370d('0x78')));var _0x3fa136=JSON[_0x370d('0x7a')](_0x237d86);if('undefined'==typeof _0x3fa136['name']){return _0x47257a(new Error(_0x370d('0x7b')));}if(_0x370d('0x24')==typeof _0x3fa136['type']){return _0x47257a(new Error(_0x370d('0x7c')));}if(_0x370d('0x24')==typeof _0x3fa136['version']){return _0x47257a(new Error(_0x370d('0x7d')));}if(_0x370d('0x24')==typeof _0x3fa136['parameters']){return _0x47257a(new Error(_0x370d('0x7e')));}if(_0x3fa136[_0x370d('0x37')]==='html'){if('undefined'==typeof _0x3fa136[_0x370d('0x7f')][_0x370d('0x80')]){return _0x47257a(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x370d('0x24')==typeof _0x3fa136[_0x370d('0x7f')][_0x370d('0x80')][_0x370d('0x81')]&&_0x370d('0x24')==typeof _0x3fa136[_0x370d('0x7f')]['views']['agent']){return _0x47257a(new Error(_0x370d('0x82')));}}else if(_0x3fa136[_0x370d('0x37')]===_0x370d('0x83')){if(_0x370d('0x24')==typeof _0x3fa136[_0x370d('0x7f')][_0x370d('0x84')]){return _0x47257a(new Error(_0x370d('0x85')));}if('undefined'==typeof _0x3fa136[_0x370d('0x7f')][_0x370d('0x86')]){return _0x47257a(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x47257a(new Error(_0x370d('0x87')));}var _0x45c0cb=_0x3fa136['name'];var _0x19043d=_0x3fa136[_0x370d('0x88')];var _0x53b8fb=_0x3fa136[_0x370d('0x37')];var _0x15c873=_0x3fa136[_0x370d('0x89')]?_0x3fa136[_0x370d('0x89')]:_0x370d('0x8a');var _0x138b05=_0x3fa136['icon']?_0x3fa136[_0x370d('0x8b')]:_0x370d('0x8c');var _0x14c009='';var _0x29b483='';var _0x148c1a='';var _0x2c0ac8='';var _0x5913a6=_0x3fa136[_0x370d('0x8d')];if(_0x53b8fb===_0x370d('0x8e')){if('undefined'!=typeof _0x3fa136[_0x370d('0x7f')][_0x370d('0x80')][_0x370d('0x81')]){var _0x29df71=_0x3fa136['parameters']['views'][_0x370d('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x370d('0x8f')](_0x29df71)){_0x14c009=path['join'](_0x370d('0x90'),_0x682795,_0x40342c[0x0],_0x29df71);}else{_0x14c009=_0x29df71;}}else{logger['info'](_0x370d('0x91'));}if('undefined'!=typeof _0x3fa136[_0x370d('0x7f')][_0x370d('0x80')][_0x370d('0x92')]){var _0x255b36=_0x3fa136[_0x370d('0x7f')][_0x370d('0x80')][_0x370d('0x92')];if(!/^(f|ht)tps?:\/\//i[_0x370d('0x8f')](_0x255b36)){_0x29b483=path[_0x370d('0x52')](_0x370d('0x90'),_0x682795,_0x40342c[0x0],_0x255b36);}else{_0x29b483=_0x255b36;}}else{logger[_0x370d('0x68')](_0x370d('0x93'));}}else if(_0x53b8fb===_0x370d('0x83')){_0x148c1a=_0x3fa136[_0x370d('0x7f')][_0x370d('0x84')];_0x2c0ac8=_0x3fa136['parameters'][_0x370d('0x86')];if(_0x370d('0x24')!=typeof _0x3fa136[_0x370d('0x7f')]['views']){if(_0x370d('0x24')!=typeof _0x3fa136['parameters']['views'][_0x370d('0x81')]){var _0x29df71=_0x3fa136['parameters']['views'][_0x370d('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x29df71)){_0x14c009=path[_0x370d('0x52')](_0x370d('0x90'),_0x682795,_0x40342c[0x0],_0x29df71);}else{_0x14c009=_0x29df71;}}if('undefined'!=typeof _0x3fa136['parameters'][_0x370d('0x80')]['agent']){var _0x255b36=_0x3fa136['parameters'][_0x370d('0x80')][_0x370d('0x92')];if(!/^(f|ht)tps?:\/\//i[_0x370d('0x8f')](_0x255b36)){_0x29b483=path[_0x370d('0x52')](_0x370d('0x90'),_0x682795,_0x40342c[0x0],_0x255b36);}else{_0x29b483=_0x255b36;}}}}var _0x39005f={'name':_0x45c0cb,'description':_0x19043d,'path':path['join'](_0x682795,_0x40342c[0x0]),'type':_0x53b8fb,'sidebar':_0x15c873,'icon':_0x138b05,'adminUrl':_0x14c009,'agentUrl':_0x29b483,'scriptName':_0x148c1a,'scriptPath':_0x2c0ac8,'version':_0x5913a6};removeReferences(_0x5b4850,null);return db[_0x370d('0x36')][_0x370d('0x94')](_0x39005f)[_0x370d('0x2b')](function(_0x2465c6){var _0x4d3ebe={'role':_0x32b969[_0x370d('0x95')][_0x370d('0x96')],'userProfileId':_0x32b969[_0x370d('0x95')][_0x370d('0x97')]};if(!_0x4d3ebe)throw new Error(_0x370d('0x98'));if(_0x4d3ebe[_0x370d('0x96')]==='user'){var _0x1a8bca=_0x2465c6[_0x370d('0x2d')]({'plain':!![]});return db[_0x370d('0x99')][_0x370d('0x4e')]({'where':{'name':'Plugins','userProfileId':_0x4d3ebe[_0x370d('0x97')]},'raw':!![]})[_0x370d('0x2b')](function(_0x179f06){if(_0x179f06&&_0x179f06[_0x370d('0x9a')]===0x0){return db[_0x370d('0x2f')][_0x370d('0x94')]({'name':_0x1a8bca[_0x370d('0x32')],'resourceId':_0x1a8bca['id'],'type':_0x179f06[_0x370d('0x32')],'sectionId':_0x179f06['id']},{})['then'](function(){return _0x2465c6;});}else{return _0x2465c6;}})[_0x370d('0x4f')](function(_0x11633e){logger[_0x370d('0x71')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11633e);throw _0x11633e;});}return _0x2465c6;})[_0x370d('0x2b')](respondWithResult(_0x123884,null))[_0x370d('0x4f')](handleError(_0x123884,null));}});}catch(_0x25f221){_0x123884['status'](0x1f4)['send'](_0x25f221);}};function removeReferences(_0x261257,_0x86f56c){try{if(_0x261257){fs[_0x370d('0x67')](_0x261257);logger[_0x370d('0x68')](_0x370d('0x9b'));}if(_0x86f56c){rimraf(_0x86f56c,function(){});logger['info'](_0x370d('0x9c'));}}catch(_0x5df8c6){logger[_0x370d('0x71')](_0x5df8c6);}}exports[_0x370d('0x2a')]=function(_0x3d3087,_0x18eb60,_0x453d16){return db[_0x370d('0x36')][_0x370d('0x4e')]({'where':{'id':_0x3d3087[_0x370d('0x4a')]['id']}})[_0x370d('0x2b')](handleEntityNotFound(_0x18eb60,null))['then'](saveUpdates(_0x3d3087[_0x370d('0x95')],null))['then'](respondWithResult(_0x18eb60,null))[_0x370d('0x4f')](handleError(_0x18eb60,null));};exports[_0x370d('0x9d')]=function(_0x438cf9,_0x21f135,_0x1f651c){return db['Plugin'][_0x370d('0x4e')]({'where':{'id':_0x438cf9[_0x370d('0x4a')]['id']}})['then'](function(_0x2169fd){if(_0x2169fd){return _0x2169fd['destroy']();}})['then'](function(_0x5d74d0){rimraf(path['join'](config[_0x370d('0x53')],_0x370d('0x54'),path['dirname'](_0x5d74d0[_0x370d('0x51')])),function(){});return _0x5d74d0;})[_0x370d('0x2b')](handleEntityNotFound(_0x21f135,null))[_0x370d('0x2b')](respondWithStatusCode(_0x21f135,null))[_0x370d('0x4f')](handleError(_0x21f135,null));};exports[_0x370d('0x9e')]=function(_0x3f797f,_0x3c1ab9,_0x495ca6){return BPromise['resolve']()[_0x370d('0x2b')](function(){if(!_0x3f797f[_0x370d('0x3a')][_0x370d('0x51')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x3f797f[_0x370d('0x3a')][_0x370d('0x9f')]){throw new Error(_0x370d('0xa0'));}var _0x2a9283=_0x3f797f['query'][_0x370d('0xa1')]?_0x3f797f[_0x370d('0x3a')]['hostname']+':'+_0x3f797f[_0x370d('0x3a')][_0x370d('0x9f')]:_0x370d('0xa2')+_0x3f797f['query'][_0x370d('0x9f')];var _0x3850f8=_0x3f797f[_0x370d('0x3a')][_0x370d('0x22')]?_0x3f797f[_0x370d('0x3a')][_0x370d('0x22')]:!![];var _0x14cd43=_0x3f797f[_0x370d('0x3a')][_0x370d('0xa3')]?_0x3f797f[_0x370d('0x3a')][_0x370d('0xa3')]:null;var _0x587b0d={'method':_0x3f797f['method'],'uri':util['format']('%s%s',_0x2a9283,_0x3f797f[_0x370d('0x3a')][_0x370d('0x51')]),'json':_0x3850f8,'resolveWithFullResponse':!![],'encoding':_0x14cd43,'qs':_0x3f797f[_0x370d('0x3a')]};if(_0x3f797f['headers']){_0x587b0d[_0x370d('0xa4')]=_0x3f797f[_0x370d('0xa4')];if(_0x587b0d[_0x370d('0xa4')]['content-length']){delete _0x587b0d[_0x370d('0xa4')]['content-length'];}}if(_0x587b0d[_0x370d('0xa4')][_0x370d('0xa5')]){delete _0x587b0d[_0x370d('0xa4')][_0x370d('0xa5')];}return rp(_0x587b0d);})[_0x370d('0x2b')](function(_0x43c0d1){if(_0x43c0d1){_0x3c1ab9[_0x370d('0x27')](_0x43c0d1[_0x370d('0xa4')]);logger['info'](_0x43c0d1[_0x370d('0x95')]);if(_['endsWith'](_0x3f797f[_0x370d('0x3a')][_0x370d('0x51')],'download')&&_0x43c0d1[_0x370d('0xa6')]==0x1f4){return _0x3c1ab9[_0x370d('0x20')](_0x43c0d1[_0x370d('0xa6')]);}else{return _0x3c1ab9[_0x370d('0x21')](_0x43c0d1[_0x370d('0xa6')])[_0x370d('0x33')](_0x43c0d1[_0x370d('0x95')]);}}else{return _0x3c1ab9[_0x370d('0x20')](0xc8);}})[_0x370d('0x4f')](handleError(_0x3c1ab9,null));};exports[_0x370d('0xa7')]=function(_0x2ae529,_0x2e4e1b,_0x374a62){return BPromise['resolve']()[_0x370d('0x2b')](function(){if(!_0x2ae529[_0x370d('0x3a')][_0x370d('0x51')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2ae529[_0x370d('0x3a')][_0x370d('0x9f')]){throw new Error(_0x370d('0xa0'));}var _0x2dc910=_0x2ae529[_0x370d('0x3a')]['hostname']?_0x2ae529['query'][_0x370d('0xa1')]+':'+_0x2ae529[_0x370d('0x3a')][_0x370d('0x9f')]:'http://localhost:'+_0x2ae529[_0x370d('0x3a')][_0x370d('0x9f')];var _0x31beb7=_0x2ae529[_0x370d('0x3a')][_0x370d('0x22')]?_0x2ae529[_0x370d('0x3a')]['json']:!![];var _0x136553=_0x2ae529[_0x370d('0x3a')][_0x370d('0xa3')]?_0x2ae529['query'][_0x370d('0xa3')]:null;var _0x2caf77={'method':_0x2ae529[_0x370d('0xa8')],'uri':util['format'](_0x370d('0xa9'),_0x2dc910,_0x2ae529[_0x370d('0x3a')][_0x370d('0x51')]),'json':_0x31beb7,'resolveWithFullResponse':!![],'encoding':_0x136553,'body':_0x2ae529[_0x370d('0x95')]};if(_0x2ae529[_0x370d('0xa4')]){_0x2caf77[_0x370d('0xa4')]=_0x2ae529[_0x370d('0xa4')];if(_0x2caf77[_0x370d('0xa4')][_0x370d('0xaa')]){delete _0x2caf77[_0x370d('0xa4')][_0x370d('0xaa')];}}if(_0x2caf77[_0x370d('0xa4')][_0x370d('0xa5')]){delete _0x2caf77[_0x370d('0xa4')][_0x370d('0xa5')];}return rp(_0x2caf77);})[_0x370d('0x2b')](function(_0xf897a8){if(_0xf897a8){_0x2e4e1b[_0x370d('0x27')](_0xf897a8[_0x370d('0xa4')]);logger[_0x370d('0x68')](_0xf897a8[_0x370d('0x95')]);return _0x2e4e1b[_0x370d('0x21')](_0xf897a8[_0x370d('0xa6')])[_0x370d('0x33')](_0xf897a8['body']);}else{return _0x2e4e1b[_0x370d('0x20')](0xc8);}})[_0x370d('0x4f')](handleError(_0x2e4e1b,null));}; \ No newline at end of file +var _0xd3db=['UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','Plugin','includeAll','include','findAll','show','params','keys','options','download','find','path','root','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','join','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','basename','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','catch','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','admin','script','scriptName','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd3db,0x122));var _0xbd3d=function(_0x51d506,_0x145319){_0x51d506=_0x51d506-0x0;var _0xaa86cd=_0xd3db[_0x51d506];return _0xaa86cd;};'use strict';var emlformat=require(_0xbd3d('0x0'));var rimraf=require(_0xbd3d('0x1'));var zipdir=require(_0xbd3d('0x2'));var jsonpatch=require(_0xbd3d('0x3'));var rp=require(_0xbd3d('0x4'));var moment=require('moment');var BPromise=require(_0xbd3d('0x5'));var Mustache=require('mustache');var util=require(_0xbd3d('0x6'));var path=require('path');var sox=require(_0xbd3d('0x7'));var csv=require(_0xbd3d('0x8'));var ejs=require(_0xbd3d('0x9'));var fs=require('fs');var fs_extra=require(_0xbd3d('0xa'));var _=require(_0xbd3d('0xb'));var squel=require(_0xbd3d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbd3d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbd3d('0xe'));var Papa=require(_0xbd3d('0xf'));var extract=require(_0xbd3d('0x10'));var rimraf=require(_0xbd3d('0x1'));var archiver=require(_0xbd3d('0x11'));var Redis=require(_0xbd3d('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbd3d('0x13'));var hardwareService=require(_0xbd3d('0x14'));var logger=require(_0xbd3d('0x15'))(_0xbd3d('0x16'));var utils=require('../../config/utils');var config=require(_0xbd3d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd3d('0x18'))['db'];config[_0xbd3d('0x19')]=_[_0xbd3d('0x1a')](config[_0xbd3d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xbd3d('0x1b'))(new Redis(config['redis']));require(_0xbd3d('0x1c'))[_0xbd3d('0x1d')](socket);function respondWithStatusCode(_0x1a3324,_0x42d22d){_0x42d22d=_0x42d22d||0xcc;return function(_0x2d510a){if(_0x2d510a){return _0x1a3324['sendStatus'](_0x42d22d);}return _0x1a3324[_0xbd3d('0x1e')](_0x42d22d)['end']();};}function respondWithResult(_0x24fca8,_0x1d5954){_0x1d5954=_0x1d5954||0xc8;return function(_0x37fa90){if(_0x37fa90){return _0x24fca8[_0xbd3d('0x1e')](_0x1d5954)[_0xbd3d('0x1f')](_0x37fa90);}};}function respondWithFilteredResult(_0x20de62,_0x4181e9){return function(_0x4cfbfc){if(_0x4cfbfc){var _0x3aa61a=typeof _0x4181e9[_0xbd3d('0x20')]===_0xbd3d('0x21')&&typeof _0x4181e9[_0xbd3d('0x22')]==='undefined';var _0x238653=_0x4cfbfc['count'];var _0x4bd704=_0x3aa61a?0x0:_0x4181e9[_0xbd3d('0x20')];var _0x93b07b=_0x3aa61a?_0x4cfbfc[_0xbd3d('0x23')]:_0x4181e9[_0xbd3d('0x20')]+_0x4181e9[_0xbd3d('0x22')];var _0x1a7aa9;if(_0x93b07b>=_0x238653){_0x93b07b=_0x238653;_0x1a7aa9=0xc8;}else{_0x1a7aa9=0xce;}_0x20de62[_0xbd3d('0x1e')](_0x1a7aa9);return _0x20de62[_0xbd3d('0x24')]('Content-Range',_0x4bd704+'-'+_0x93b07b+'/'+_0x238653)[_0xbd3d('0x1f')](_0x4cfbfc);}return null;};}function patchUpdates(_0x1fed96){return function(_0x223e08){try{jsonpatch[_0xbd3d('0x25')](_0x223e08,_0x1fed96,!![]);}catch(_0x219429){return BPromise[_0xbd3d('0x26')](_0x219429);}return _0x223e08[_0xbd3d('0x27')]();};}function saveUpdates(_0x47ed59,_0x31cc28){return function(_0xb3a678){if(_0xb3a678){return _0xb3a678[_0xbd3d('0x28')](_0x47ed59)[_0xbd3d('0x29')](function(_0x35c413){return _0x35c413;});}return null;};}function removeEntity(_0x5d5732,_0x39c712){return function(_0x363e03){if(_0x363e03){return _0x363e03[_0xbd3d('0x2a')]()[_0xbd3d('0x29')](function(){var _0xaffc9c=_0x363e03[_0xbd3d('0x2b')]({'plain':!![]});var _0x2fd701='Plugins';return db[_0xbd3d('0x2c')][_0xbd3d('0x2a')]({'where':{'type':_0x2fd701,'resourceId':_0xaffc9c['id']}})[_0xbd3d('0x29')](function(){return _0x363e03;});})[_0xbd3d('0x29')](function(){_0x5d5732[_0xbd3d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6ba374,_0x1f24b2){return function(_0x3a584e){if(!_0x3a584e){_0x6ba374['sendStatus'](0x194);}return _0x3a584e;};}function handleError(_0x3472d5,_0x5c5702){_0x5c5702=_0x5c5702||0x1f4;return function(_0x4e2e96){logger[_0xbd3d('0x2d')](_0x4e2e96[_0xbd3d('0x2e')]);if(_0x4e2e96[_0xbd3d('0x2f')]){delete _0x4e2e96['name'];}_0x3472d5[_0xbd3d('0x1e')](_0x5c5702)[_0xbd3d('0x30')](_0x4e2e96);};}exports[_0xbd3d('0x31')]=function(_0x353d96,_0x15de69){var _0x3717fd={},_0x2707c1={},_0x41b633={'count':0x0,'rows':[]};var _0x31a5fd=_[_0xbd3d('0x32')](db['Plugin'][_0xbd3d('0x33')],function(_0x160c05){return{'name':_0x160c05[_0xbd3d('0x34')],'type':_0x160c05[_0xbd3d('0x35')][_0xbd3d('0x36')]};});_0x2707c1[_0xbd3d('0x37')]=_[_0xbd3d('0x32')](_0x31a5fd,_0xbd3d('0x2f'));_0x2707c1[_0xbd3d('0x38')]=_['keys'](_0x353d96[_0xbd3d('0x38')]);_0x2707c1[_0xbd3d('0x39')]=_[_0xbd3d('0x3a')](_0x2707c1['model'],_0x2707c1[_0xbd3d('0x38')]);_0x3717fd[_0xbd3d('0x3b')]=_['intersection'](_0x2707c1[_0xbd3d('0x37')],qs[_0xbd3d('0x3c')](_0x353d96[_0xbd3d('0x38')]['fields']));_0x3717fd[_0xbd3d('0x3b')]=_0x3717fd[_0xbd3d('0x3b')][_0xbd3d('0x3d')]?_0x3717fd[_0xbd3d('0x3b')]:_0x2707c1[_0xbd3d('0x37')];if(!_0x353d96[_0xbd3d('0x38')]['hasOwnProperty'](_0xbd3d('0x3e'))){_0x3717fd[_0xbd3d('0x22')]=qs['limit'](_0x353d96[_0xbd3d('0x38')][_0xbd3d('0x22')]);_0x3717fd[_0xbd3d('0x20')]=qs[_0xbd3d('0x20')](_0x353d96[_0xbd3d('0x38')][_0xbd3d('0x20')]);}_0x3717fd[_0xbd3d('0x3f')]=qs['sort'](_0x353d96[_0xbd3d('0x38')][_0xbd3d('0x40')]);_0x3717fd[_0xbd3d('0x41')]=qs[_0xbd3d('0x39')](_[_0xbd3d('0x42')](_0x353d96[_0xbd3d('0x38')],_0x2707c1[_0xbd3d('0x39')]),_0x31a5fd);if(_0x353d96[_0xbd3d('0x38')]['filter']){_0x3717fd[_0xbd3d('0x41')]=_[_0xbd3d('0x43')](_0x3717fd[_0xbd3d('0x41')],{'$or':_[_0xbd3d('0x32')](_0x31a5fd,function(_0x12d7a6){if(_0x12d7a6[_0xbd3d('0x35')]!=='VIRTUAL'){var _0x640a22={};_0x640a22[_0x12d7a6[_0xbd3d('0x2f')]]={'$like':'%'+_0x353d96[_0xbd3d('0x38')]['filter']+'%'};return _0x640a22;}})});}_0x3717fd=_[_0xbd3d('0x43')]({},_0x3717fd,_0x353d96['options']);var _0x4a65e9={'where':_0x3717fd[_0xbd3d('0x41')]};return db[_0xbd3d('0x44')][_0xbd3d('0x23')](_0x4a65e9)['then'](function(_0x4f5e40){_0x41b633[_0xbd3d('0x23')]=_0x4f5e40;if(_0x353d96[_0xbd3d('0x38')][_0xbd3d('0x45')]){_0x3717fd[_0xbd3d('0x46')]=[{'all':!![]}];}return db[_0xbd3d('0x44')][_0xbd3d('0x47')](_0x3717fd);})[_0xbd3d('0x29')](function(_0x42787c){_0x41b633['rows']=_0x42787c;return _0x41b633;})[_0xbd3d('0x29')](respondWithFilteredResult(_0x15de69,_0x3717fd))['catch'](handleError(_0x15de69,null));};exports[_0xbd3d('0x48')]=function(_0xb100dd,_0x13ddee){var _0x42e37c={'raw':!![],'where':{'id':_0xb100dd[_0xbd3d('0x49')]['id']}},_0xd4d93f={};_0xd4d93f['model']=_[_0xbd3d('0x4a')](db[_0xbd3d('0x44')]['rawAttributes']);_0xd4d93f[_0xbd3d('0x38')]=_[_0xbd3d('0x4a')](_0xb100dd['query']);_0xd4d93f[_0xbd3d('0x39')]=_[_0xbd3d('0x3a')](_0xd4d93f[_0xbd3d('0x37')],_0xd4d93f[_0xbd3d('0x38')]);_0x42e37c['attributes']=_[_0xbd3d('0x3a')](_0xd4d93f['model'],qs[_0xbd3d('0x3c')](_0xb100dd[_0xbd3d('0x38')]['fields']));_0x42e37c[_0xbd3d('0x3b')]=_0x42e37c[_0xbd3d('0x3b')][_0xbd3d('0x3d')]?_0x42e37c[_0xbd3d('0x3b')]:_0xd4d93f[_0xbd3d('0x37')];if(_0xb100dd[_0xbd3d('0x38')][_0xbd3d('0x45')]){_0x42e37c[_0xbd3d('0x46')]=[{'all':!![]}];}_0x42e37c=_[_0xbd3d('0x43')]({},_0x42e37c,_0xb100dd[_0xbd3d('0x4b')]);return db[_0xbd3d('0x44')]['find'](_0x42e37c)[_0xbd3d('0x29')](handleEntityNotFound(_0x13ddee,null))[_0xbd3d('0x29')](respondWithResult(_0x13ddee,null))['catch'](handleError(_0x13ddee,null));};exports[_0xbd3d('0x4c')]=function(_0x585e68,_0x4e1bee,_0x2cfe8c){return db[_0xbd3d('0x44')][_0xbd3d('0x4d')]({'where':{'id':_0x585e68[_0xbd3d('0x49')]['id']},'attributes':[_0xbd3d('0x2f'),_0xbd3d('0x4e')],'raw':!![]})[_0xbd3d('0x29')](handleEntityNotFound(_0x4e1bee,null))[_0xbd3d('0x29')](function(_0x2bd535){if(_0x2bd535){var _0x5c6cb8=path['join'](config[_0xbd3d('0x4f')],_0xbd3d('0x50'),util[_0xbd3d('0x51')](_0xbd3d('0x52'),path['basename'](_0x2bd535[_0xbd3d('0x4e')])));var _0x4556f5=fs[_0xbd3d('0x53')](_0x5c6cb8);var _0x330afc=archiver(_0xbd3d('0x54'),{'zlib':{'level':0x9}});_0x330afc['on'](_0xbd3d('0x55'),function(_0x4304fa){if(_0x4304fa[_0xbd3d('0x56')]===_0xbd3d('0x57')){logger[_0xbd3d('0x2d')](_0x4304fa);}else{throw new db[(_0xbd3d('0x58'))][(_0xbd3d('0x59'))](_0xbd3d('0x5a'));}});_0x330afc['on'](_0xbd3d('0x2d'),function(_0x27bf55){throw new db[(_0xbd3d('0x58'))][(_0xbd3d('0x59'))](_0xbd3d('0x5a'));});_0x330afc['pipe'](_0x4556f5);_0x330afc['glob'](_0xbd3d('0x5b'),{'cwd':path[_0xbd3d('0x5c')](config[_0xbd3d('0x4f')],_0xbd3d('0x50'),path['dirname'](_0x2bd535[_0xbd3d('0x4e')])),'ignore':[path[_0xbd3d('0x5c')](path['basename'](_0x2bd535['path']),_0xbd3d('0x5d')),path[_0xbd3d('0x5c')](path['basename'](_0x2bd535['path']),_0xbd3d('0x5e'))],'nodir':!![]})[_0xbd3d('0x5f')]();_0x4556f5['on'](_0xbd3d('0x60'),function(){if(!fs['existsSync'](_0x5c6cb8)){throw new db['Sequelize'][(_0xbd3d('0x59'))](_0xbd3d('0x61'));}return _0x4e1bee['download'](_0x5c6cb8,util[_0xbd3d('0x51')]('%s.zip',path[_0xbd3d('0x62')](_0x2bd535[_0xbd3d('0x4e')])),function(_0x2617bf){if(_0x2617bf){throw new db[(_0xbd3d('0x58'))][(_0xbd3d('0x59'))](_0xbd3d('0x63'));}fs[_0xbd3d('0x64')](_0x5c6cb8);logger[_0xbd3d('0x65')](_0xbd3d('0x66'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0xbd3d('0x67')](handleError(_0x4e1bee,null));};exports[_0xbd3d('0x68')]=function(_0x2fa3c7,_0x2bd8b7,_0x556267){var _0x5c4fb0=path[_0xbd3d('0x62')](_0x2fa3c7[_0xbd3d('0x69')][_0xbd3d('0x6a')],path[_0xbd3d('0x6b')](_0x2fa3c7[_0xbd3d('0x69')][_0xbd3d('0x6a')]));var _0x5da989=path[_0xbd3d('0x5c')](config['root'],_0xbd3d('0x50'),_0x2fa3c7[_0xbd3d('0x69')][_0xbd3d('0x6a')]);var _0x184511=path[_0xbd3d('0x5c')](config[_0xbd3d('0x4f')],_0xbd3d('0x50'),_0x5c4fb0);logger[_0xbd3d('0x65')](_0xbd3d('0x6c'),_0x5da989);logger['info'](_0xbd3d('0x6d'),_0x184511);try{fs[_0xbd3d('0x6e')](_0x5da989,parseInt(_0xbd3d('0x6f'),0x8));extract(_0x5da989,{'dir':_0x184511},function(_0x31344a){if(_0x31344a){logger[_0xbd3d('0x2d')](_0x31344a);handleError(_0x31344a,!![]);};var _0x3ecd28=fs[_0xbd3d('0x70')](_0x184511);if(_0x3ecd28[_0xbd3d('0x3d')]>0x1){removeReferences(_0x5da989,_0x184511);logger[_0xbd3d('0x2d')]('Invalid\x20plugin\x20structure');return _0x556267(new Error(_0xbd3d('0x71')));}var _0x29e27a=fs[_0xbd3d('0x72')](path['join'](_0x184511,_0x3ecd28[0x0]));if(_0x29e27a['isFile']()){removeReferences(_0x5da989,_0x184511);logger[_0xbd3d('0x2d')](_0xbd3d('0x71'));return _0x556267(new Error(_0xbd3d('0x71')));}if(_0x29e27a['isDirectory']()){var _0xf94b7f=fs[_0xbd3d('0x70')](path['join'](_0x184511,_0x3ecd28[0x0]));if(_0xf94b7f[_0xbd3d('0x3d')]===0x0){removeReferences(_0x5da989,_0x184511);logger[_0xbd3d('0x2d')]('Invalid\x20plugin\x20structure');return _0x556267(new Error('Invalid\x20plugin\x20structure'));}var _0x508ac9=_0xf94b7f[_0xbd3d('0x73')](function(_0x55d905){return _0x55d905===_0xbd3d('0x74');});if(!_0x508ac9){return _0x556267(new Error('Plugin\x20manifest\x20missing'));}var _0x36dfc8=fs[_0xbd3d('0x75')](path[_0xbd3d('0x5c')](_0x184511,_0x3ecd28[0x0],'manifest.json'));var _0x3723cd=JSON[_0xbd3d('0x76')](_0x36dfc8);if(_0xbd3d('0x21')==typeof _0x3723cd[_0xbd3d('0x2f')]){return _0x556267(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xbd3d('0x21')==typeof _0x3723cd['type']){return _0x556267(new Error(_0xbd3d('0x77')));}if('undefined'==typeof _0x3723cd['version']){return _0x556267(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xbd3d('0x21')==typeof _0x3723cd[_0xbd3d('0x78')]){return _0x556267(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x3723cd['type']===_0xbd3d('0x79')){if(_0xbd3d('0x21')==typeof _0x3723cd[_0xbd3d('0x78')]['views']){return _0x556267(new Error(_0xbd3d('0x7a')));}if(_0xbd3d('0x21')==typeof _0x3723cd['parameters'][_0xbd3d('0x7b')][_0xbd3d('0x7c')]&&_0xbd3d('0x21')==typeof _0x3723cd[_0xbd3d('0x78')][_0xbd3d('0x7b')]['agent']){return _0x556267(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x3723cd[_0xbd3d('0x35')]===_0xbd3d('0x7d')){if(_0xbd3d('0x21')==typeof _0x3723cd['parameters'][_0xbd3d('0x7e')]){return _0x556267(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xbd3d('0x21')==typeof _0x3723cd[_0xbd3d('0x78')][_0xbd3d('0x7f')]){return _0x556267(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x556267(new Error(_0xbd3d('0x80')));}var _0x391e12=_0x3723cd[_0xbd3d('0x2f')];var _0x39ed18=_0x3723cd[_0xbd3d('0x81')];var _0x1c1069=_0x3723cd['type'];var _0x18c373=_0x3723cd[_0xbd3d('0x82')]?_0x3723cd[_0xbd3d('0x82')]:_0xbd3d('0x83');var _0x196533=_0x3723cd[_0xbd3d('0x84')]?_0x3723cd[_0xbd3d('0x84')]:_0xbd3d('0x85');var _0x3ded2b='';var _0x3399d7='';var _0x20ef7f='';var _0x2c6313='';var _0x4332db=_0x3723cd[_0xbd3d('0x86')];if(_0x1c1069===_0xbd3d('0x79')){if('undefined'!=typeof _0x3723cd['parameters'][_0xbd3d('0x7b')][_0xbd3d('0x7c')]){var _0x4fc6ec=_0x3723cd['parameters'][_0xbd3d('0x7b')][_0xbd3d('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0xbd3d('0x87')](_0x4fc6ec)){_0x3ded2b=path['join'](_0xbd3d('0x88'),_0x5c4fb0,_0x3ecd28[0x0],_0x4fc6ec);}else{_0x3ded2b=_0x4fc6ec;}}else{logger[_0xbd3d('0x65')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x3723cd[_0xbd3d('0x78')][_0xbd3d('0x7b')][_0xbd3d('0x89')]){var _0x5d5496=_0x3723cd[_0xbd3d('0x78')][_0xbd3d('0x7b')][_0xbd3d('0x89')];if(!/^(f|ht)tps?:\/\//i[_0xbd3d('0x87')](_0x5d5496)){_0x3399d7=path['join']('plugins',_0x5c4fb0,_0x3ecd28[0x0],_0x5d5496);}else{_0x3399d7=_0x5d5496;}}else{logger[_0xbd3d('0x65')](_0xbd3d('0x8a'));}}else if(_0x1c1069===_0xbd3d('0x7d')){_0x20ef7f=_0x3723cd[_0xbd3d('0x78')][_0xbd3d('0x7e')];_0x2c6313=_0x3723cd[_0xbd3d('0x78')]['scriptPath'];if(_0xbd3d('0x21')!=typeof _0x3723cd[_0xbd3d('0x78')][_0xbd3d('0x7b')]){if(_0xbd3d('0x21')!=typeof _0x3723cd[_0xbd3d('0x78')][_0xbd3d('0x7b')]['admin']){var _0x4fc6ec=_0x3723cd[_0xbd3d('0x78')][_0xbd3d('0x7b')][_0xbd3d('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0xbd3d('0x87')](_0x4fc6ec)){_0x3ded2b=path[_0xbd3d('0x5c')]('plugins',_0x5c4fb0,_0x3ecd28[0x0],_0x4fc6ec);}else{_0x3ded2b=_0x4fc6ec;}}if('undefined'!=typeof _0x3723cd['parameters']['views'][_0xbd3d('0x89')]){var _0x5d5496=_0x3723cd[_0xbd3d('0x78')][_0xbd3d('0x7b')][_0xbd3d('0x89')];if(!/^(f|ht)tps?:\/\//i[_0xbd3d('0x87')](_0x5d5496)){_0x3399d7=path['join'](_0xbd3d('0x88'),_0x5c4fb0,_0x3ecd28[0x0],_0x5d5496);}else{_0x3399d7=_0x5d5496;}}}}var _0x1b7f17={'name':_0x391e12,'description':_0x39ed18,'path':path[_0xbd3d('0x5c')](_0x5c4fb0,_0x3ecd28[0x0]),'type':_0x1c1069,'sidebar':_0x18c373,'icon':_0x196533,'adminUrl':_0x3ded2b,'agentUrl':_0x3399d7,'scriptName':_0x20ef7f,'scriptPath':_0x2c6313,'version':_0x4332db};removeReferences(_0x5da989,null);return db['Plugin'][_0xbd3d('0x8b')](_0x1b7f17)['then'](function(_0x44fa05){var _0x45ab08={'role':_0x2fa3c7['body']['role'],'userProfileId':_0x2fa3c7[_0xbd3d('0x8c')]['userProfileId']};if(!_0x45ab08)throw new Error(_0xbd3d('0x8d'));if(_0x45ab08['role']===_0xbd3d('0x8e')){var _0x37f552=_0x44fa05[_0xbd3d('0x2b')]({'plain':!![]});return db[_0xbd3d('0x8f')][_0xbd3d('0x4d')]({'where':{'name':_0xbd3d('0x90'),'userProfileId':_0x45ab08[_0xbd3d('0x91')]},'raw':!![]})[_0xbd3d('0x29')](function(_0x361aad){if(_0x361aad&&_0x361aad['autoAssociation']===0x0){return db[_0xbd3d('0x2c')][_0xbd3d('0x8b')]({'name':_0x37f552[_0xbd3d('0x2f')],'resourceId':_0x37f552['id'],'type':_0x361aad[_0xbd3d('0x2f')],'sectionId':_0x361aad['id']},{})[_0xbd3d('0x29')](function(){return _0x44fa05;});}else{return _0x44fa05;}})[_0xbd3d('0x67')](function(_0x1d6897){logger[_0xbd3d('0x2d')](_0xbd3d('0x92'),_0x1d6897);throw _0x1d6897;});}return _0x44fa05;})[_0xbd3d('0x29')](respondWithResult(_0x2bd8b7,null))[_0xbd3d('0x67')](handleError(_0x2bd8b7,null));}});}catch(_0xea33ad){_0x2bd8b7[_0xbd3d('0x1e')](0x1f4)[_0xbd3d('0x30')](_0xea33ad);}};function removeReferences(_0x1d7bda,_0x32319b){try{if(_0x1d7bda){fs[_0xbd3d('0x64')](_0x1d7bda);logger[_0xbd3d('0x65')](_0xbd3d('0x93'));}if(_0x32319b){rimraf(_0x32319b,function(){});logger[_0xbd3d('0x65')](_0xbd3d('0x94'));}}catch(_0x80fdaf){logger[_0xbd3d('0x2d')](_0x80fdaf);}}exports[_0xbd3d('0x28')]=function(_0x34dd92,_0x32025b,_0x1fa252){return db['Plugin'][_0xbd3d('0x4d')]({'where':{'id':_0x34dd92[_0xbd3d('0x49')]['id']}})['then'](handleEntityNotFound(_0x32025b,null))[_0xbd3d('0x29')](saveUpdates(_0x34dd92['body'],null))[_0xbd3d('0x29')](respondWithResult(_0x32025b,null))[_0xbd3d('0x67')](handleError(_0x32025b,null));};exports[_0xbd3d('0x95')]=function(_0x3ae44d,_0x1516a3,_0xd7328a){return db[_0xbd3d('0x44')][_0xbd3d('0x4d')]({'where':{'id':_0x3ae44d[_0xbd3d('0x49')]['id']}})['then'](function(_0x41900e){if(_0x41900e){return _0x41900e['destroy']();}})[_0xbd3d('0x29')](function(_0x3c505b){rimraf(path['join'](config['root'],_0xbd3d('0x50'),path[_0xbd3d('0x96')](_0x3c505b[_0xbd3d('0x4e')])),function(){});return _0x3c505b;})[_0xbd3d('0x29')](handleEntityNotFound(_0x1516a3,null))[_0xbd3d('0x29')](respondWithStatusCode(_0x1516a3,null))[_0xbd3d('0x67')](handleError(_0x1516a3,null));};exports[_0xbd3d('0x97')]=function(_0x1b0288,_0x20d9b9,_0x1a0144){return BPromise[_0xbd3d('0x98')]()['then'](function(){if(!_0x1b0288['query'][_0xbd3d('0x4e')]){throw new Error(_0xbd3d('0x99'));}if(!_0x1b0288[_0xbd3d('0x38')][_0xbd3d('0x9a')]){throw new Error(_0xbd3d('0x9b'));}var _0x418f75=_0x1b0288[_0xbd3d('0x38')][_0xbd3d('0x9c')]?_0x1b0288[_0xbd3d('0x38')][_0xbd3d('0x9c')]+':'+_0x1b0288[_0xbd3d('0x38')][_0xbd3d('0x9a')]:_0xbd3d('0x9d')+_0x1b0288[_0xbd3d('0x38')]['port'];var _0x1417d7=_0x1b0288['query']['json']?_0x1b0288[_0xbd3d('0x38')][_0xbd3d('0x1f')]:!![];var _0x25ae72=_0x1b0288['query']['encoding']?_0x1b0288[_0xbd3d('0x38')][_0xbd3d('0x9e')]:null;var _0x24ce13={'method':_0x1b0288[_0xbd3d('0x9f')],'uri':util[_0xbd3d('0x51')](_0xbd3d('0xa0'),_0x418f75,_0x1b0288[_0xbd3d('0x38')][_0xbd3d('0x4e')]),'json':_0x1417d7,'resolveWithFullResponse':!![],'encoding':_0x25ae72,'qs':_0x1b0288[_0xbd3d('0x38')]};if(_0x1b0288[_0xbd3d('0xa1')]){_0x24ce13[_0xbd3d('0xa1')]=_0x1b0288[_0xbd3d('0xa1')];if(_0x24ce13[_0xbd3d('0xa1')]['content-length']){delete _0x24ce13[_0xbd3d('0xa1')][_0xbd3d('0xa2')];}}if(_0x24ce13[_0xbd3d('0xa1')][_0xbd3d('0xa3')]){delete _0x24ce13[_0xbd3d('0xa1')][_0xbd3d('0xa3')];}return rp(_0x24ce13);})[_0xbd3d('0x29')](function(_0x491d0b){if(_0x491d0b){_0x20d9b9[_0xbd3d('0x24')](_0x491d0b['headers']);logger[_0xbd3d('0x65')](_0x491d0b[_0xbd3d('0x8c')]);if(_[_0xbd3d('0xa4')](_0x1b0288['query'][_0xbd3d('0x4e')],_0xbd3d('0x4c'))&&_0x491d0b[_0xbd3d('0xa5')]==0x1f4){return _0x20d9b9[_0xbd3d('0xa6')](_0x491d0b[_0xbd3d('0xa5')]);}else{return _0x20d9b9[_0xbd3d('0x1e')](_0x491d0b[_0xbd3d('0xa5')])['send'](_0x491d0b[_0xbd3d('0x8c')]);}}else{return _0x20d9b9[_0xbd3d('0xa6')](0xc8);}})['catch'](handleError(_0x20d9b9,null));};exports['webhookPost']=function(_0x215850,_0x9864e3,_0x294b3d){return BPromise['resolve']()[_0xbd3d('0x29')](function(){if(!_0x215850[_0xbd3d('0x38')]['path']){throw new Error(_0xbd3d('0x99'));}if(!_0x215850[_0xbd3d('0x38')][_0xbd3d('0x9a')]){throw new Error(_0xbd3d('0x9b'));}var _0x469f96=_0x215850[_0xbd3d('0x38')]['hostname']?_0x215850[_0xbd3d('0x38')][_0xbd3d('0x9c')]+':'+_0x215850['query']['port']:_0xbd3d('0x9d')+_0x215850[_0xbd3d('0x38')]['port'];var _0x4cadba=_0x215850[_0xbd3d('0x38')][_0xbd3d('0x1f')]?_0x215850[_0xbd3d('0x38')]['json']:!![];var _0x24af9b=_0x215850[_0xbd3d('0x38')][_0xbd3d('0x9e')]?_0x215850['query']['encoding']:null;var _0x3bee78={'method':_0x215850[_0xbd3d('0x9f')],'uri':util['format'](_0xbd3d('0xa0'),_0x469f96,_0x215850[_0xbd3d('0x38')][_0xbd3d('0x4e')]),'json':_0x4cadba,'resolveWithFullResponse':!![],'encoding':_0x24af9b,'body':_0x215850[_0xbd3d('0x8c')]};if(_0x215850['headers']){_0x3bee78[_0xbd3d('0xa1')]=_0x215850[_0xbd3d('0xa1')];if(_0x3bee78[_0xbd3d('0xa1')][_0xbd3d('0xa2')]){delete _0x3bee78['headers'][_0xbd3d('0xa2')];}}if(_0x3bee78[_0xbd3d('0xa1')][_0xbd3d('0xa3')]){delete _0x3bee78[_0xbd3d('0xa1')]['content-type'];}return rp(_0x3bee78);})['then'](function(_0x24220c){if(_0x24220c){_0x9864e3[_0xbd3d('0x24')](_0x24220c[_0xbd3d('0xa1')]);logger['info'](_0x24220c[_0xbd3d('0x8c')]);return _0x9864e3['status'](_0x24220c[_0xbd3d('0xa5')])[_0xbd3d('0x30')](_0x24220c[_0xbd3d('0x8c')]);}else{return _0x9864e3['sendStatus'](0xc8);}})[_0xbd3d('0x67')](handleError(_0x9864e3,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 1f1b486..106db05 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 _0xaee6=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x50a463,_0x517a1a){var _0x2971df=function(_0x1f9cf1){while(--_0x1f9cf1){_0x50a463['push'](_0x50a463['shift']());}};_0x2971df(++_0x517a1a);}(_0xaee6,0x187));var _0x6aee=function(_0x404090,_0x295542){_0x404090=_0x404090-0x0;var _0xfbcd74=_0xaee6[_0x404090];return _0xfbcd74;};'use strict';var EventEmitter=require(_0x6aee('0x0'));var Plugin=require(_0x6aee('0x1'))['db'][_0x6aee('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x6aee('0x3')](0x0);var events={'afterCreate':_0x6aee('0x4'),'afterUpdate':_0x6aee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x46980d){return function(_0x3f11af,_0x1e23ba,_0x5e83b4){PluginEvents[_0x6aee('0x6')](_0x46980d+':'+_0x3f11af['id'],_0x3f11af);PluginEvents[_0x6aee('0x6')](_0x46980d,_0x3f11af);_0x5e83b4(null);};}for(var e in events){if(events[_0x6aee('0x7')](e)){var event=events[e];Plugin[_0x6aee('0x8')](e,emitEvent(event));}}module[_0x6aee('0x9')]=PluginEvents; \ No newline at end of file +var _0x714c=['save','update','emit','hasOwnProperty','hook','../../mysqldb','Plugin','setMaxListeners'];(function(_0x2eceb4,_0x44ce9d){var _0x5514fe=function(_0x488c04){while(--_0x488c04){_0x2eceb4['push'](_0x2eceb4['shift']());}};_0x5514fe(++_0x44ce9d);}(_0x714c,0x18d));var _0xc714=function(_0x89a001,_0x3a9a8c){_0x89a001=_0x89a001-0x0;var _0x5f3ec2=_0x714c[_0x89a001];return _0x5f3ec2;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xc714('0x0'))['db'][_0xc714('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xc714('0x2')](0x0);var events={'afterCreate':_0xc714('0x3'),'afterUpdate':_0xc714('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3d1101){return function(_0x19f8fc,_0x541cdc,_0x4a1ce5){PluginEvents[_0xc714('0x5')](_0x3d1101+':'+_0x19f8fc['id'],_0x19f8fc);PluginEvents[_0xc714('0x5')](_0x3d1101,_0x19f8fc);_0x4a1ce5(null);};}for(var e in events){if(events[_0xc714('0x6')](e)){var event=events[e];Plugin[_0xc714('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 2083a5a..54d1dcd 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 _0x6bc9=['Plugin','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./plugin.attributes','exports','define'];(function(_0x1709e7,_0x2ced21){var _0x402819=function(_0x3637a0){while(--_0x3637a0){_0x1709e7['push'](_0x1709e7['shift']());}};_0x402819(++_0x2ced21);}(_0x6bc9,0x6f));var _0x96bc=function(_0x55cdc5,_0x2b2297){_0x55cdc5=_0x55cdc5-0x0;var _0x29acd5=_0x6bc9[_0x55cdc5];return _0x29acd5;};'use strict';var _=require(_0x96bc('0x0'));var util=require(_0x96bc('0x1'));var logger=require(_0x96bc('0x2'))(_0x96bc('0x3'));var moment=require('moment');var BPromise=require(_0x96bc('0x4'));var rp=require(_0x96bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x96bc('0x6'));var config=require('../../config/environment');var attributes=require(_0x96bc('0x7'));module[_0x96bc('0x8')]=function(_0x2031a1,_0x7f99c2){return _0x2031a1[_0x96bc('0x9')](_0x96bc('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb71=['./plugin.attributes','exports','define','plugins','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4f133f,_0x3025f5){var _0x1b26e2=function(_0x19b83d){while(--_0x19b83d){_0x4f133f['push'](_0x4f133f['shift']());}};_0x1b26e2(++_0x3025f5);}(_0xfb71,0x1c6));var _0x1fb7=function(_0xffd09f,_0x1c57a9){_0xffd09f=_0xffd09f-0x0;var _0x4a8c52=_0xfb71[_0xffd09f];return _0x4a8c52;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1fb7('0x0'))(_0x1fb7('0x1'));var moment=require('moment');var BPromise=require(_0x1fb7('0x2'));var rp=require(_0x1fb7('0x3'));var fs=require('fs');var path=require(_0x1fb7('0x4'));var rimraf=require(_0x1fb7('0x5'));var config=require('../../config/environment');var attributes=require(_0x1fb7('0x6'));module[_0x1fb7('0x7')]=function(_0x5f22bd,_0x77147e){return _0x5f22bd[_0x1fb7('0x8')]('Plugin',attributes,{'tableName':_0x1fb7('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 6cc5acf..46b5adb 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 _0xebae=['request\x20sent','error','code','message','info','result','CreatePlugin','Plugin','create','body','options','raw','stringify','catch','lodash','util','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','Plugin,\x20%s,\x20%s','debug'];(function(_0x5081ae,_0x1c6b35){var _0x257ebb=function(_0x501069){while(--_0x501069){_0x5081ae['push'](_0x5081ae['shift']());}};_0x257ebb(++_0x1c6b35);}(_0xebae,0x1ee));var _0xeeba=function(_0x5d6482,_0x1c9b00){_0x5d6482=_0x5d6482-0x0;var _0x32e681=_0xebae[_0x5d6482];return _0x32e681;};'use strict';var _=require(_0xeeba('0x0'));var util=require(_0xeeba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeeba('0x2'))['db'];var utils=require(_0xeeba('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xeeba('0x4'));var jayson=require(_0xeeba('0x5'));var client=jayson[_0xeeba('0x6')][_0xeeba('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xeeba('0x8')],{'host':_0xeeba('0x9'),'port':0x18eb});var socket=require(_0xeeba('0xa'))(new Redis(config[_0xeeba('0x8')]));require('./plugin.socket')[_0xeeba('0xb')](socket);function respondWithRpcPromise(_0x13ab4f,_0x15aef0,_0x1bc535){return new BPromise(function(_0x5e85b6,_0x2fd744){return client[_0xeeba('0xc')](_0x13ab4f,_0x1bc535)[_0xeeba('0xd')](function(_0x4b7024){logger['info'](_0xeeba('0xe'),_0x15aef0,'request\x20sent');logger[_0xeeba('0xf')]('Plugin,\x20%s,\x20%s,\x20%s',_0x15aef0,_0xeeba('0x10'),JSON['stringify'](_0x4b7024));if(_0x4b7024[_0xeeba('0x11')]){if(_0x4b7024[_0xeeba('0x11')][_0xeeba('0x12')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x15aef0,_0x4b7024['error'][_0xeeba('0x13')]);return _0x2fd744(_0x4b7024['error']['message']);}logger[_0xeeba('0x11')](_0xeeba('0xe'),_0x15aef0,_0x4b7024[_0xeeba('0x11')][_0xeeba('0x13')]);return _0x5e85b6(_0x4b7024[_0xeeba('0x11')][_0xeeba('0x13')]);}else{logger[_0xeeba('0x14')](_0xeeba('0xe'),_0x15aef0,'request\x20sent');_0x5e85b6(_0x4b7024[_0xeeba('0x15')][_0xeeba('0x13')]);}})['catch'](function(_0x1fbb8d){logger[_0xeeba('0x11')](_0xeeba('0xe'),_0x15aef0,_0x1fbb8d);_0x2fd744(_0x1fbb8d);});});}exports[_0xeeba('0x16')]=function(_0x4c554b){var _0x469cb2=this;return new Promise(function(_0x192e79,_0xb48323){return db[_0xeeba('0x17')][_0xeeba('0x18')](_0x4c554b[_0xeeba('0x19')],{'raw':_0x4c554b[_0xeeba('0x1a')]?_0x4c554b[_0xeeba('0x1a')][_0xeeba('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x13648f){logger[_0xeeba('0x14')](_0xeeba('0x16'),_0x4c554b);logger[_0xeeba('0xf')](_0xeeba('0x16'),_0x4c554b,JSON[_0xeeba('0x1c')](_0x13648f));_0x192e79(_0x13648f);})[_0xeeba('0x1d')](function(_0x1f8150){logger[_0xeeba('0x11')](_0xeeba('0x16'),_0x1f8150[_0xeeba('0x13')],_0x4c554b);_0xb48323(_0x469cb2['error'](0x1f4,_0x1f8150[_0xeeba('0x13')]));});});}; \ No newline at end of file +var _0x4ee2=['request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreatePlugin','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s'];(function(_0x18b9fd,_0xcf8c93){var _0x50d5d6=function(_0x486057){while(--_0x486057){_0x18b9fd['push'](_0x18b9fd['shift']());}};_0x50d5d6(++_0xcf8c93);}(_0x4ee2,0x140));var _0x24ee=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4ee2[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x24ee('0x0'));var util=require(_0x24ee('0x1'));var moment=require(_0x24ee('0x2'));var BPromise=require(_0x24ee('0x3'));var rs=require(_0x24ee('0x4'));var fs=require('fs');var Redis=require(_0x24ee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x24ee('0x6'));var logger=require(_0x24ee('0x7'))(_0x24ee('0x8'));var config=require(_0x24ee('0x9'));var jayson=require(_0x24ee('0xa'));var client=jayson['client'][_0x24ee('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x24ee('0xc')],{'host':_0x24ee('0xd'),'port':0x18eb});var socket=require(_0x24ee('0xe'))(new Redis(config[_0x24ee('0xc')]));require(_0x24ee('0xf'))[_0x24ee('0x10')](socket);function respondWithRpcPromise(_0x198231,_0x3e5359,_0x2f130b){return new BPromise(function(_0x3a26b0,_0x15ddc4){return client[_0x24ee('0x11')](_0x198231,_0x2f130b)[_0x24ee('0x12')](function(_0x9a009c){logger['info'](_0x24ee('0x13'),_0x3e5359,_0x24ee('0x14'));logger[_0x24ee('0x15')](_0x24ee('0x16'),_0x3e5359,_0x24ee('0x14'),JSON[_0x24ee('0x17')](_0x9a009c));if(_0x9a009c['error']){if(_0x9a009c[_0x24ee('0x18')][_0x24ee('0x19')]===0x1f4){logger[_0x24ee('0x18')](_0x24ee('0x13'),_0x3e5359,_0x9a009c[_0x24ee('0x18')][_0x24ee('0x1a')]);return _0x15ddc4(_0x9a009c[_0x24ee('0x18')]['message']);}logger[_0x24ee('0x18')](_0x24ee('0x13'),_0x3e5359,_0x9a009c['error'][_0x24ee('0x1a')]);return _0x3a26b0(_0x9a009c[_0x24ee('0x18')][_0x24ee('0x1a')]);}else{logger[_0x24ee('0x1b')](_0x24ee('0x13'),_0x3e5359,'request\x20sent');_0x3a26b0(_0x9a009c[_0x24ee('0x1c')]['message']);}})[_0x24ee('0x1d')](function(_0x2c703b){logger['error'](_0x24ee('0x13'),_0x3e5359,_0x2c703b);_0x15ddc4(_0x2c703b);});});}exports[_0x24ee('0x1e')]=function(_0x5dc668){var _0x4f359f=this;return new Promise(function(_0x4e14c4,_0x699112){return db['Plugin'][_0x24ee('0x1f')](_0x5dc668['body'],{'raw':_0x5dc668[_0x24ee('0x20')]?_0x5dc668[_0x24ee('0x20')][_0x24ee('0x21')]===undefined?!![]:![]:!![]})[_0x24ee('0x12')](function(_0x13c710){logger[_0x24ee('0x1b')]('CreatePlugin',_0x5dc668);logger[_0x24ee('0x15')]('CreatePlugin',_0x5dc668,JSON[_0x24ee('0x17')](_0x13c710));_0x4e14c4(_0x13c710);})['catch'](function(_0xddad00){logger[_0x24ee('0x18')](_0x24ee('0x1e'),_0xddad00[_0x24ee('0x1a')],_0x5dc668);_0x699112(_0x4f359f['error'](0x1f4,_0xddad00[_0x24ee('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 471fbad..03e368b 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 _0xa3da=['remove','update','removeListener','length','plugin:','./plugin.events','save'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa3da,0x18d));var _0xaa3d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa3da[_0x3b380d];return _0x54502b;};'use strict';var PluginEvents=require(_0xaa3d('0x0'));var events=[_0xaa3d('0x1'),_0xaa3d('0x2'),_0xaa3d('0x3')];function createListener(_0x553177,_0x5e7278){return function(_0x5d929b){_0x5e7278['emit'](_0x553177,_0x5d929b);};}function removeListener(_0x521ed4,_0x268758){return function(){PluginEvents[_0xaa3d('0x4')](_0x521ed4,_0x268758);};}exports['register']=function(_0x21f4bb){for(var _0x36cb09=0x0,_0x3a13e0=events[_0xaa3d('0x5')];_0x36cb09<_0x3a13e0;_0x36cb09++){var _0x35d0ec=events[_0x36cb09];var _0x55d4ca=createListener(_0xaa3d('0x6')+_0x35d0ec,_0x21f4bb);PluginEvents['on'](_0x35d0ec,_0x55d4ca);}}; \ No newline at end of file +var _0x2121=['update','emit','removeListener','register','length','plugin:','./plugin.events','save','remove'];(function(_0x32a2cf,_0x20b153){var _0x250e9d=function(_0x506bf2){while(--_0x506bf2){_0x32a2cf['push'](_0x32a2cf['shift']());}};_0x250e9d(++_0x20b153);}(_0x2121,0x153));var _0x1212=function(_0x4cdf92,_0x27b5b1){_0x4cdf92=_0x4cdf92-0x0;var _0xab3532=_0x2121[_0x4cdf92];return _0xab3532;};'use strict';var PluginEvents=require(_0x1212('0x0'));var events=[_0x1212('0x1'),_0x1212('0x2'),_0x1212('0x3')];function createListener(_0x4e1109,_0x45bbb5){return function(_0x2f445b){_0x45bbb5[_0x1212('0x4')](_0x4e1109,_0x2f445b);};}function removeListener(_0x5b2af8,_0x4a56e4){return function(){PluginEvents[_0x1212('0x5')](_0x5b2af8,_0x4a56e4);};}exports[_0x1212('0x6')]=function(_0x12e060){for(var _0x47f9f6=0x0,_0x45a53e=events[_0x1212('0x7')];_0x47f9f6<_0x45a53e;_0x47f9f6++){var _0x4e2030=events[_0x47f9f6];var _0x2f9baa=createListener(_0x1212('0x8')+_0x4e2030,_0x12e060);PluginEvents['on'](_0x4e2030,_0x2f9baa);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index b12b234..502c83f 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(_0x5ab0e9,_0x1d916d){var _0x4ed117=function(_0x3d5d44){while(--_0x3d5d44){_0x5ab0e9['push'](_0x5ab0e9['shift']());}};_0x4ed117(++_0x1d916d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x4a44b4,_0x2d09dd){var _0x1384ba=function(_0x2da10a){while(--_0x2da10a){_0x4a44b4['push'](_0x4a44b4['shift']());}};_0x1384ba(++_0x2d09dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 04b42d2..48e7e70 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 _0x7af2=['sendStatus','json','error','stack','name','status','info','index','list','then','reject','express','motion2','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','params','send','destroy','Unknown\x20id','../../config/pm2','../../config/logger','api','path','exec','bluebird'];(function(_0x191dff,_0xb60d16){var _0x410a43=function(_0x25ccdc){while(--_0x25ccdc){_0x191dff['push'](_0x191dff['shift']());}};_0x410a43(++_0xb60d16);}(_0x7af2,0x119));var _0x27af=function(_0x4f4fb9,_0x3798bc){_0x4f4fb9=_0x4f4fb9-0x0;var _0x1d9828=_0x7af2[_0x4f4fb9];return _0x1d9828;};'use strict';var _=require('lodash');var pm2=require(_0x27af('0x0'));var logger=require(_0x27af('0x1'))(_0x27af('0x2'));var path=require(_0x27af('0x3'));var exec=require('child_process')[_0x27af('0x4')];var BPromise=require(_0x27af('0x5'));function handleEntityNotFound(_0x709cb6,_0x2a542f){return function(_0x22ae46){if(!_0x22ae46){_0x709cb6[_0x27af('0x6')](0x194);;}return _0x22ae46;};}function respondWithResult(_0x350532,_0x184630){_0x184630=_0x184630||0xc8;return function(_0x2193c6){if(_0x2193c6){return _0x350532['status'](_0x184630)[_0x27af('0x7')](_0x2193c6);}return null;};}function handleError(_0x366868,_0x389e97){_0x389e97=_0x389e97||0x1f4;return function(_0x583db8){logger[_0x27af('0x8')](_0x583db8[_0x27af('0x9')]);if(_0x583db8[_0x27af('0xa')]){delete _0x583db8['name'];}_0x366868[_0x27af('0xb')](_0x389e97)['send'](_0x583db8);};}function execChildProcess(){return new BPromise(function(_0x4d4729,_0x3e4b33){exec('npm\x20install',function(_0x50fe01,_0x184e25,_0x59c073){logger[_0x27af('0xc')](_0x184e25);logger['info'](_0x59c073);if(_0x50fe01){logger[_0x27af('0x8')](_0x50fe01);return _0x3e4b33(_0x50fe01);}return _0x4d4729(_0x184e25);});});}exports[_0x27af('0xd')]=function(_0x1fd964,_0x23f9ec){return pm2[_0x27af('0xe')]()[_0x27af('0xf')](function(_0x234825){if(_0x234825){var _0x3da435=_[_0x27af('0x10')](_0x234825,function(_0x4724e0){return _0x4724e0[_0x27af('0xa')]===_0x27af('0x11')||_0x4724e0[_0x27af('0xa')]===_0x27af('0x12');});return{'rows':_0x3da435,'count':_0x3da435[_0x27af('0x13')]};}return null;})[_0x27af('0xf')](respondWithResult(_0x23f9ec,null))[_0x27af('0x14')](handleError(_0x23f9ec,null));};exports[_0x27af('0x15')]=function(_0x58583a,_0x315661){return pm2[_0x27af('0x16')](_0x58583a['params']['id'])['then'](respondWithResult(_0x315661,null))[_0x27af('0xf')](handleEntityNotFound(_0x315661,null))[_0x27af('0x14')](handleError(_0x315661,null));};exports[_0x27af('0x17')]=function(_0x31573a,_0xec699a){if(_0x31573a['body'][_0x27af('0xa')]&&_0x31573a[_0x27af('0x18')][_0x27af('0x19')]){var _0x5e7c19=path[_0x27af('0x1a')](__dirname,_0x27af('0x1b'),_0x31573a[_0x27af('0x18')]['script']);var _0x2dce2b=process[_0x27af('0x1c')]();process[_0x27af('0x1d')](path[_0x27af('0x1e')](_0x5e7c19));return execChildProcess()[_0x27af('0xf')](function(_0x396156){process[_0x27af('0x1d')](_0x2dce2b);return pm2[_0x27af('0x1f')]({'name':_0x31573a[_0x27af('0x18')]['name'],'script':_0x5e7c19});})['then'](function(_0x4b8fe6){pm2[_0x27af('0x20')]();return _0x4b8fe6[0x0];})['then'](respondWithResult(_0xec699a,0xc9))[_0x27af('0x14')](handleError(_0xec699a,null));}else{return _0xec699a[_0x27af('0xb')](0x1f4)['send']({'message':_0x27af('0x21')});}};exports[_0x27af('0x22')]=function(_0x463e36,_0x424490){if(_0x463e36[_0x27af('0x18')]['id']){delete _0x463e36[_0x27af('0x18')]['id'];}var _0x775d4e={'online':'restart','stopped':_0x27af('0x23')};if(_0x775d4e[_0x27af('0x24')](_0x463e36[_0x27af('0x18')][_0x27af('0xb')])){return pm2[_0x775d4e[_0x463e36[_0x27af('0x18')][_0x27af('0xb')]]](_0x463e36[_0x27af('0x25')]['id'])[_0x27af('0xf')](respondWithResult(_0x424490,0xc8))[_0x27af('0x14')](handleError(_0x424490,null));}else{return _0x424490[_0x27af('0xb')](0x1f4)[_0x27af('0x26')]({'message':'Unknown\x20status'});}};exports[_0x27af('0x27')]=function(_0x14b2e7,_0x3800a1){if(_0x14b2e7[_0x27af('0x18')]['id']){delete _0x14b2e7[_0x27af('0x18')]['id'];}if(_0x14b2e7[_0x27af('0x25')]['id']){return pm2['delete'](_0x14b2e7['params']['id'])[_0x27af('0xf')](function(_0x37cb41){pm2['dump']();return _0x37cb41[0x0];})[_0x27af('0xf')](respondWithResult(_0x3800a1,null))[_0x27af('0x14')](handleError(_0x3800a1,null));}else{return _0x3800a1[_0x27af('0xb')](0x1f4)[_0x27af('0x26')]({'message':_0x27af('0x28')});}}; \ No newline at end of file +var _0x878f=['dirname','start','dump','restart','stop','hasOwnProperty','params','send','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','name','info','index','then','express','motion2','length','catch','show','describe','create','body','script','../../files/plugins','cwd','chdir'];(function(_0x38edba,_0xe05e1){var _0x3213df=function(_0x43de86){while(--_0x43de86){_0x38edba['push'](_0x38edba['shift']());}};_0x3213df(++_0xe05e1);}(_0x878f,0x173));var _0xf878=function(_0x254aca,_0x3229f1){_0x254aca=_0x254aca-0x0;var _0x3cd904=_0x878f[_0x254aca];return _0x3cd904;};'use strict';var _=require('lodash');var pm2=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));var path=require(_0xf878('0x3'));var exec=require(_0xf878('0x4'))[_0xf878('0x5')];var BPromise=require(_0xf878('0x6'));function handleEntityNotFound(_0x45a37b,_0x240b48){return function(_0xcf1927){if(!_0xcf1927){_0x45a37b[_0xf878('0x7')](0x194);;}return _0xcf1927;};}function respondWithResult(_0x4bc9aa,_0x4ac8d8){_0x4ac8d8=_0x4ac8d8||0xc8;return function(_0x3c5f5c){if(_0x3c5f5c){return _0x4bc9aa[_0xf878('0x8')](_0x4ac8d8)['json'](_0x3c5f5c);}return null;};}function handleError(_0x52851e,_0x530767){_0x530767=_0x530767||0x1f4;return function(_0x3329df){logger['error'](_0x3329df['stack']);if(_0x3329df[_0xf878('0x9')]){delete _0x3329df[_0xf878('0x9')];}_0x52851e[_0xf878('0x8')](_0x530767)['send'](_0x3329df);};}function execChildProcess(){return new BPromise(function(_0xb2863e,_0x1399a3){exec('npm\x20install',function(_0xdf76,_0x4f7e7f,_0x31d3d2){logger[_0xf878('0xa')](_0x4f7e7f);logger[_0xf878('0xa')](_0x31d3d2);if(_0xdf76){logger['error'](_0xdf76);return _0x1399a3(_0xdf76);}return _0xb2863e(_0x4f7e7f);});});}exports[_0xf878('0xb')]=function(_0x38eddf,_0x39b1bb){return pm2['list']()[_0xf878('0xc')](function(_0x3902f7){if(_0x3902f7){var _0x119e9e=_['reject'](_0x3902f7,function(_0x568a3a){return _0x568a3a[_0xf878('0x9')]===_0xf878('0xd')||_0x568a3a[_0xf878('0x9')]===_0xf878('0xe');});return{'rows':_0x119e9e,'count':_0x119e9e[_0xf878('0xf')]};}return null;})[_0xf878('0xc')](respondWithResult(_0x39b1bb,null))[_0xf878('0x10')](handleError(_0x39b1bb,null));};exports[_0xf878('0x11')]=function(_0x3c5dee,_0x3a55f3){return pm2[_0xf878('0x12')](_0x3c5dee['params']['id'])[_0xf878('0xc')](respondWithResult(_0x3a55f3,null))[_0xf878('0xc')](handleEntityNotFound(_0x3a55f3,null))[_0xf878('0x10')](handleError(_0x3a55f3,null));};exports[_0xf878('0x13')]=function(_0x3714f6,_0x237d15){if(_0x3714f6[_0xf878('0x14')]['name']&&_0x3714f6[_0xf878('0x14')][_0xf878('0x15')]){var _0x250f85=path['join'](__dirname,_0xf878('0x16'),_0x3714f6[_0xf878('0x14')][_0xf878('0x15')]);var _0x392822=process[_0xf878('0x17')]();process[_0xf878('0x18')](path[_0xf878('0x19')](_0x250f85));return execChildProcess()[_0xf878('0xc')](function(_0x212436){process[_0xf878('0x18')](_0x392822);return pm2[_0xf878('0x1a')]({'name':_0x3714f6['body'][_0xf878('0x9')],'script':_0x250f85});})['then'](function(_0xa3d3d3){pm2[_0xf878('0x1b')]();return _0xa3d3d3[0x0];})[_0xf878('0xc')](respondWithResult(_0x237d15,0xc9))[_0xf878('0x10')](handleError(_0x237d15,null));}else{return _0x237d15[_0xf878('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x242926,_0x3baba4){if(_0x242926[_0xf878('0x14')]['id']){delete _0x242926['body']['id'];}var _0xfa3e11={'online':_0xf878('0x1c'),'stopped':_0xf878('0x1d')};if(_0xfa3e11[_0xf878('0x1e')](_0x242926[_0xf878('0x14')]['status'])){return pm2[_0xfa3e11[_0x242926['body'][_0xf878('0x8')]]](_0x242926[_0xf878('0x1f')]['id'])['then'](respondWithResult(_0x3baba4,0xc8))[_0xf878('0x10')](handleError(_0x3baba4,null));}else{return _0x3baba4['status'](0x1f4)[_0xf878('0x20')]({'message':'Unknown\x20status'});}};exports[_0xf878('0x21')]=function(_0x49e66a,_0x2630fb){if(_0x49e66a['body']['id']){delete _0x49e66a[_0xf878('0x14')]['id'];}if(_0x49e66a[_0xf878('0x1f')]['id']){return pm2[_0xf878('0x22')](_0x49e66a[_0xf878('0x1f')]['id'])[_0xf878('0xc')](function(_0x716782){pm2['dump']();return _0x716782[0x0];})[_0xf878('0xc')](respondWithResult(_0x2630fb,null))[_0xf878('0x10')](handleError(_0x2630fb,null));}else{return _0x2630fb[_0xf878('0x8')](0x1f4)[_0xf878('0x20')]({'message':_0xf878('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index f5fcfe4..090060e 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 _0x37c8=['get','/agents','isAuthenticated','getAgents','/queues','getQueues','exports','express','./realtime.controller'];(function(_0x4c5d68,_0x482d04){var _0x148235=function(_0x17767b){while(--_0x17767b){_0x4c5d68['push'](_0x4c5d68['shift']());}};_0x148235(++_0x482d04);}(_0x37c8,0x181));var _0x837c=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x37c8[_0x3b96cf];return _0x2e315a;};'use strict';var express=require(_0x837c('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x837c('0x1'));router[_0x837c('0x2')](_0x837c('0x3'),auth[_0x837c('0x4')](),controller[_0x837c('0x5')]);router[_0x837c('0x2')](_0x837c('0x6'),auth[_0x837c('0x4')](),controller[_0x837c('0x7')]);module[_0x837c('0x8')]=router; \ No newline at end of file +var _0x74ea=['./realtime.controller','/agents','getAgents','get','/queues','getQueues','exports','express','Router','../../components/auth/service'];(function(_0x452cc3,_0x3bca5c){var _0x10bd3e=function(_0x2e3107){while(--_0x2e3107){_0x452cc3['push'](_0x452cc3['shift']());}};_0x10bd3e(++_0x3bca5c);}(_0x74ea,0xbb));var _0xa74e=function(_0x1283d2,_0x2b2db5){_0x1283d2=_0x1283d2-0x0;var _0x6a6637=_0x74ea[_0x1283d2];return _0x6a6637;};'use strict';var express=require(_0xa74e('0x0'));var router=express[_0xa74e('0x1')]();var auth=require(_0xa74e('0x2'));var controller=require(_0xa74e('0x3'));router['get'](_0xa74e('0x4'),auth['isAuthenticated'](),controller[_0xa74e('0x5')]);router[_0xa74e('0x6')](_0xa74e('0x7'),auth['isAuthenticated'](),controller[_0xa74e('0x8')]);module[_0xa74e('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 8090ad4..419876e 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 _0x970f=['loggedInDb','loggedIn','waiting','busy','find','merge','filter','length','some','connectedlinenum','internal','toString','getMembers','UserId','online','User','Queue','Pause','findAll','QueueId','getChannels','toLowerCase','Invalid\x20channel','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','resolve','channel','sort','includes','validateSortParameter','getUpdatedSortOptions','fields','join','order','getRealtimeAgents','rows','getAgentIdsByStatus','rawAttributes','fieldName','type','key','role','agent','getOptions','sequelize','literal','FIELD(id,','*pause','where','user','extraQueryConditions','assign','getResources','globalStatus','getAgentStatus','forEach','Status','sortAgentsByStatus','getQueues','userProfileId','QueueCampaigns','findAndCountAll','all','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','offset','undefined','count','limit','status','set','Content-Range','error','stack','name','send','voice','request','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','talking','paused','outbound','push','pTalking','originated','message','dialActive','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','map','get','agents'];(function(_0x336d63,_0x5026aa){var _0x4ec2ce=function(_0x17d954){while(--_0x17d954){_0x336d63['push'](_0x336d63['shift']());}};_0x4ec2ce(++_0x5026aa);}(_0x970f,0x1a8));var _0xf970=function(_0x30e137,_0x3f8408){_0x30e137=_0x30e137-0x0;var _0x19d31c=_0x970f[_0x30e137];return _0x19d31c;};'use strict';var util=require('util');var _=require('lodash');var jayson=require(_0xf970('0x0'));var rta=require(_0xf970('0x1'));var qs=require(_0xf970('0x2'));var utils=require('../../config/utils');var logger=require(_0xf970('0x3'))('api');var db=require(_0xf970('0x4'))['db'];var amiClient=jayson[_0xf970('0x5')][_0xf970('0x6')]({'port':0x232a});var routingClient=jayson[_0xf970('0x5')][_0xf970('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x1b7b31,_0x33e6d3){return function(_0x3a3480){if(_0x3a3480){var _0x2c94d1=typeof _0x33e6d3[_0xf970('0x7')]===_0xf970('0x8')&&typeof _0x33e6d3['limit']==='undefined';var _0x5c3b40=_0x3a3480[_0xf970('0x9')];var _0x19ee72=_0x2c94d1?0x0:_0x33e6d3[_0xf970('0x7')];var _0x1ef8ab=_0x2c94d1?_0x3a3480['count']:_0x33e6d3[_0xf970('0x7')]+_0x33e6d3[_0xf970('0xa')];var _0x198f02;if(_0x1ef8ab>=_0x5c3b40){_0x1ef8ab=_0x5c3b40;_0x198f02=0xc8;}else{_0x198f02=0xce;}_0x1b7b31[_0xf970('0xb')](_0x198f02);return _0x1b7b31[_0xf970('0xc')](_0xf970('0xd'),_0x19ee72+'-'+_0x1ef8ab+'/'+_0x5c3b40)['json'](_0x3a3480);}return null;};}function handleError(_0x582010,_0x3f821b){_0x3f821b=_0x3f821b||0x1f4;return function(_0x36abd2){logger[_0xf970('0xe')](_0x36abd2[_0xf970('0xf')]);if(_0x36abd2[_0xf970('0x10')]){delete _0x36abd2['name'];}_0x582010[_0xf970('0xb')](_0x3f821b)[_0xf970('0x11')](_0x36abd2);};}function getRealtimeQueues(_0x590aa3,_0x161938){return new Promise(function(_0x24c448,_0x391654){var _0x13c739=_0x161938===_0xf970('0x12')?amiClient:routingClient;return _0x13c739[_0xf970('0x13')](_[_0xf970('0x14')](_0x161938)+_0xf970('0x15'),_0x590aa3)[_0xf970('0x16')](function(_0x48a002){if(_0x48a002[_0xf970('0xe')])throw new Error(util[_0xf970('0x17')](_0xf970('0x18'),_0x161938));return _0x24c448(_0x48a002[_0xf970('0x19')]);})[_0xf970('0x1a')](function(_0x3d631a){_0x391654(_0x3d631a);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x348c36,_0x445eb5){return amiClient['request']('VoiceQueuesChannels',{})[_0xf970('0x16')](function(_0xaf8a74){if(_0xaf8a74[_0xf970('0xe')])throw new Error(_0xf970('0x1b'));return _0x348c36(_0xaf8a74['result']);})['catch'](function(_0x3d3f44){_0x445eb5(_0x3d3f44);});});}function initializeQueues(_0x12f3a0,_0x40e08c,_0x46d069,_0x16078){var _0x4160b3=['loggedIn',_0xf970('0x1c'),'waiting',_0xf970('0x1d'),_0xf970('0x1e')];if(_0x46d069===_0xf970('0x12')&&_0x16078===_0xf970('0x1f')){_0x4160b3[_0xf970('0x20')](_0xf970('0x21'),_0xf970('0x22'),_0xf970('0x23'),_0xf970('0x24'),'dialMethod','Trunk',_0xf970('0x25'),_0xf970('0x26'),_0xf970('0x27'),_0xf970('0x28'),_0xf970('0x29'),_0xf970('0x2a'),_0xf970('0x2b'),_0xf970('0x2c'),_0xf970('0x2d'),_0xf970('0x2e'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0xf970('0x2f'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0xf970('0x30'));}return _0x12f3a0[_0xf970('0x31')](function(_0x1fff8f){var _0x17c83d=_0x1fff8f[_0xf970('0x32')]({'plain':!![]});_0x17c83d[_0xf970('0x33')]=[];_0x17c83d['paused']=0x0;_0x17c83d[_0xf970('0x34')]=0x0;_0x17c83d[_0xf970('0x35')]=0x0;_0x17c83d[_0xf970('0x1c')]=0x0;_0x17c83d[_0xf970('0x36')]=0x0;if(_0x46d069===_0xf970('0x12')){_0x17c83d[_0xf970('0x1d')]=0x0;_0x17c83d[_0xf970('0x37')]=0x0;if(_0x16078===_0xf970('0x1f')){_0x17c83d[_0xf970('0x21')]=0x0;_0x17c83d['originated']=0x0;}}var _0x378abf=_[_0xf970('0x38')](_0x40e08c,['id',_0x17c83d['id']]);if(_0x378abf)_[_0xf970('0x39')](_0x17c83d,_['pick'](_0x378abf,_0x4160b3));return _0x17c83d;});}function updateAgentVoiceStatus(_0x109585,_0x3aa774,_0x597a70){var _0x3eb213=_[_0xf970('0x3a')](_0x597a70,['queue',_0x3aa774[_0xf970('0x10')]]);if(_0x3eb213[_0xf970('0x3b')]===0x0)return _0x109585['busy']=!![];if(_[_0xf970('0x3c')](_0x3eb213,[_0xf970('0x3d'),_0x109585[_0xf970('0x3e')][_0xf970('0x3f')]()]))return _0x109585[_0xf970('0x1d')]=!![];if(!_0x109585[_0xf970('0x1d')])return _0x109585[_0xf970('0x37')]=!![];}function getVoiceQueueAgents(_0x4f8ad2,_0x25c4b7,_0x121012,_0x388ac1){var _0x44bccb=_['find'](_0x25c4b7,['id',_0x4f8ad2['id']]);if(!_0x44bccb)return _0x4f8ad2;return _0x44bccb[_0xf970('0x40')]({'raw':!![]})[_0xf970('0x16')](function(_0x37cd3e){for(var _0x98f542=0x0;_0x98f542<_0x37cd3e['length'];_0x98f542++){var _0x275eff=_[_0xf970('0x38')](_0x121012,['id',_0x37cd3e[_0x98f542]['UserId']]);if(!_0x275eff){_0x275eff={'id':_0x37cd3e[_0x98f542][_0xf970('0x41')],'name':_0x37cd3e[_0x98f542]['UserId'],'accountcode':'','online':![]};}var _0xbe2bde={'id':_0x275eff['id'],'name':_0x275eff[_0xf970('0x10')],'internal':_0x275eff['accountcode'],'online':Boolean(_0x275eff[_0xf970('0x42')]),'paused':Boolean(_0x37cd3e[_0x98f542][_0xf970('0x1e')])};if(_0x275eff['voiceStatus']===_0xf970('0x1d'))updateAgentVoiceStatus(_0xbe2bde,_0x4f8ad2,_0x388ac1);if(_0xbe2bde[_0xf970('0x42')])_0x4f8ad2['loggedInDb']++;if(_0xbe2bde[_0xf970('0x37')])_0x4f8ad2['busy']++;if(_0xbe2bde[_0xf970('0x1e')]&&!_0xbe2bde[_0xf970('0x37')]&&!_0xbe2bde[_0xf970('0x1d')])_0x4f8ad2[_0xf970('0x1e')]++;_0x4f8ad2['agents'][_0xf970('0x20')](_0xbe2bde);}return _0x4f8ad2;});}function getQueueAgents(_0x31afd1,_0x3adbd7,_0x42d500){var _0x4b9ec7=_0xf970('0x43')+_['startCase'](_0x42d500)+_0xf970('0x44');var _0x40b34d=_0x42d500+_0xf970('0x45');return db[_0x4b9ec7][_0xf970('0x46')]({'where':{[_['startCase'](_0x42d500)+_0xf970('0x47')]:_0x31afd1['id']},'raw':!![]})['then'](function(_0x30e99d){for(var _0x4aea22=0x0;_0x4aea22<_0x30e99d[_0xf970('0x3b')];_0x4aea22++){var _0x4d1fc7=_[_0xf970('0x38')](_0x3adbd7,['id',_0x30e99d[_0x4aea22][_0xf970('0x41')]]);if(!_0x4d1fc7){_0x4d1fc7={'id':_0x30e99d[_0x4aea22][_0xf970('0x41')],'name':_0x30e99d[_0x4aea22][_0xf970('0x41')],'online':![],['pauseField']:![]};}var _0x488a39={'id':_0x4d1fc7['id'],'name':_0x4d1fc7[_0xf970('0x10')],'online':Boolean(_0x4d1fc7[_0xf970('0x42')]),'paused':Boolean(_0x4d1fc7[_0x40b34d])};if(_0x488a39[_0xf970('0x42')])_0x31afd1[_0xf970('0x34')]++;_0x31afd1['agents'][_0xf970('0x20')](_0x488a39);}return _0x31afd1;});}function validateChannel(_0x6afd3c){var _0x53ff85=utils[_0xf970('0x48')]();if(!_['includes'](_0x53ff85,_0x6afd3c[_0xf970('0x49')]()))throw new Error(_0xf970('0x4a'));return _0x6afd3c['toLowerCase']();}exports[_0xf970('0x4b')]=function(_0x741691,_0x1e5baf){var _0x5cab9e={'count':0x0,'rows':[]};var _0x5aec3a={};var _0x18ae2e;var _0x20e7e2;var _0x38109d;var _0x1775e4;var _0x1655b9=utils[_0xf970('0x48')]();var _0x440d15=_0x741691[_0xf970('0x4c')][_0xf970('0x4d')];var _0x5acb48=_0x741691[_0xf970('0x4c')][_0xf970('0x4e')];var _0xc3522e=_0x741691[_0xf970('0x4c')][_0xf970('0x4f')];var _0x42f7f9=_0x5acb48===_0xf970('0x50')||_0x5acb48==='*pause'?!![]:![];var _0x1a019e=[];var _0x35d7ac;Promise[_0xf970('0x51')]()[_0xf970('0x16')](function(){if(_0x741691[_0xf970('0x4c')][_0xf970('0x52')]){_0x18ae2e=validateChannel(_0x741691[_0xf970('0x4c')][_0xf970('0x52')]);}if(!_0x741691[_0xf970('0x4c')][_0xf970('0x53')]||!_0x741691[_0xf970('0x4c')][_0xf970('0x53')][_0xf970('0x54')]('globalStatus')){_0x741691[_0xf970('0x4c')][_0xf970('0x53')]=rta[_0xf970('0x55')](_0x741691[_0xf970('0x4c')]['sort']);return;}var _0x19d8dd=rta[_0xf970('0x56')](_0x741691['query'][_0xf970('0x53')]);_0x741691['query'][_0xf970('0x53')]=_0x19d8dd[_0xf970('0x57')][_0xf970('0x58')](',');_0x20e7e2=_0x19d8dd[_0xf970('0x59')];})[_0xf970('0x16')](function(){if(!_0x440d15){return[];}return rta['getAgentIdsByQueues'](_0x440d15,_0x18ae2e);})['then'](function(_0x12196f){_0x1a019e=_0x12196f;return rta[_0xf970('0x5a')]();})[_0xf970('0x16')](function(_0x4cfa57){_0x1775e4=_0x4cfa57[_0xf970('0x5b')];if((!_0x5acb48||_0x42f7f9)&&!_0x20e7e2){return _0x1a019e;}if(_0x20e7e2&&!_0x5acb48){return rta['getSortedAgentsIdsByStatus'](_0x1775e4,_0x1a019e,_0x20e7e2);}else{return rta[_0xf970('0x5c')](_0x1775e4,_0x1a019e,_0x5acb48);}})[_0xf970('0x16')](function(_0x4626e5){_0x1a019e=_0x4626e5;var _0x51ccd6=![];if(_0x1a019e['length']===0x0){if(_0x440d15||_0x5acb48){_0x51ccd6=!![];}if(_0x42f7f9){_0x51ccd6=![];}}if(_0x51ccd6){return _0x5cab9e;}var _0x596c91=_[_0xf970('0x31')](db[_0xf970('0x43')][_0xf970('0x5d')],function(_0x4dd4ec){return{'name':_0x4dd4ec[_0xf970('0x5e')],'type':_0x4dd4ec[_0xf970('0x5f')][_0xf970('0x60')]};});_0x741691[_0xf970('0x4c')][_0xf970('0x61')]=_0xf970('0x62');_0x741691[_0xf970('0x4c')][_0xf970('0x42')]=!![];_0x5aec3a=qs[_0xf970('0x63')](_0x596c91,_0x741691);_0x5aec3a['raw']=!![];var _0x167213=[];if(_0x1a019e['length']>0x0){_0x167213[_0xf970('0x20')]({'id':{'$in':_0x1a019e}});if(_0x20e7e2&&!_0x5acb48){_0x35d7ac=[db[_0xf970('0x64')][_0xf970('0x65')](_0xf970('0x66')+_0x1a019e+')')];_0x5aec3a[_0xf970('0x59')]=_0x35d7ac;}}if(_0x42f7f9){_0x1655b9['forEach'](function(_0x4e7409){var _0x4d071c=!![];if(_0x5acb48===_0xf970('0x67')&&_0x18ae2e!==_0x4e7409){_0x4d071c=![];}_0x167213[_0xf970('0x20')]({[_0x4e7409+_0xf970('0x45')]:_0x4d071c});});if(_0xc3522e){_0x167213[_0xf970('0x20')]({'pauseType':_0xc3522e});}}else if(_0x5acb48){_0x1655b9['forEach'](function(_0x546d8a){_0x167213[_0xf970('0x20')]({[_0x546d8a+_0xf970('0x45')]:![]});});}_0x5aec3a[_0xf970('0x68')]=_[_0xf970('0x39')](_0x5aec3a[_0xf970('0x68')],{'$and':_0x167213});if(_0x741691['user']['role']===_0xf970('0x69')){var _0x265deb={'params':{'id':_0x741691[_0xf970('0x69')]['userProfileId']},'query':{'section':'Agents','role':_0xf970('0x62'),'online':!![],'raw':!![],'ids':_0x1a019e,'customSorting':_0x35d7ac}};if(_0x42f7f9){_0x265deb[_0xf970('0x4c')][_0xf970('0x6a')]=_0x167213;}_0x265deb['query']=Object[_0xf970('0x6b')](_0x265deb['query'],_0x741691[_0xf970('0x4c')]);delete _0x265deb[_0xf970('0x4c')]['id'];return db['UserProfile'][_0xf970('0x6c')](_0x265deb);}return db['User']['findAndCountAll'](_0x5aec3a);})['then'](function(_0x2e17df){_0x5cab9e[_0xf970('0x9')]=_0x2e17df[_0xf970('0x9')];_0x38109d=_0x2e17df[_0xf970('0x5b')];return _0x38109d[_0xf970('0x31')](function(_0x3261be){var _0x4672bb=_[_0xf970('0x38')](_0x1775e4,['id',_0x3261be['id']]);if(_0x4672bb){var _0x4ee396=rta['filterAgentAttributes'](_0x4672bb);_[_0xf970('0x39')](_0x3261be,_0x4ee396);}_0x3261be[_0xf970('0x6d')]=rta[_0xf970('0x6e')](_0x3261be);if(_0x3261be[_0xf970('0x6d')][_0xf970('0x54')](_0xf970('0x50'))){_0x1655b9[_0xf970('0x6f')](function(_0x1b01fd){if(_0x3261be[_0x1b01fd+_0xf970('0x45')]){_0x3261be[_0x1b01fd+_0xf970('0x70')]='pause';}});}return _0x3261be;});})['then'](function(_0xc29031){if(!_0x20e7e2||_0x35d7ac){return _0xc29031;}return rta[_0xf970('0x71')](_0xc29031,_0x20e7e2);})[_0xf970('0x16')](function(_0x467fa4){_0x5cab9e['rows']=_0x467fa4;return _0x5cab9e;})[_0xf970('0x16')](respondWithFilteredResult(_0x1e5baf,_0x5aec3a))['catch'](handleError(_0x1e5baf,null));};exports[_0xf970('0x72')]=function(_0x124269,_0x57b26f){var _0xf64c5={'count':0x0,'rows':[]},_0xdc3326={},_0x28db53,_0x4da11a,_0x3961b4,_0x58272b,_0x438d83;Promise[_0xf970('0x51')]()[_0xf970('0x16')](function(){if(_0x124269[_0xf970('0x4c')][_0xf970('0x52')])_0x28db53=validateChannel(_0x124269[_0xf970('0x4c')][_0xf970('0x52')]);var _0x2a2eee=_[_0xf970('0x14')](_0x28db53)+_0xf970('0x44');var _0x3ded20=_[_0xf970('0x31')](db[_0x2a2eee][_0xf970('0x5d')],function(_0x27db5e){return{'name':_0x27db5e['fieldName'],'type':_0x27db5e[_0xf970('0x5f')][_0xf970('0x60')]};});_0xdc3326=qs[_0xf970('0x63')](_0x3ded20,_0x124269);if(_0x124269[_0xf970('0x69')][_0xf970('0x61')]==='user'){var _0x3ea95c={'params':{'id':_0x124269[_0xf970('0x69')][_0xf970('0x73')]},'query':{'section':_0x28db53===_0xf970('0x12')&&_0x124269[_0xf970('0x4c')][_0xf970('0x5f')]===_0xf970('0x1f')?_0xf970('0x74'):_[_0xf970('0x14')](_0x28db53)+_0xf970('0x15'),'type':_0x124269[_0xf970('0x4c')][_0xf970('0x5f')],'nolimit':!![],'sort':_0xf970('0x10'),'filter':_0x124269[_0xf970('0x4c')][_0xf970('0x3a')]}};return db['UserProfile'][_0xf970('0x6c')](_0x3ea95c);}return db[_0x2a2eee][_0xf970('0x75')](_0xdc3326);})[_0xf970('0x16')](function(_0x1f2646){_0xf64c5[_0xf970('0x9')]=_0x1f2646[_0xf970('0x9')];_0x4da11a=_0x1f2646[_0xf970('0x5b')];return getRealtimeQueues(_0x124269,_0x28db53);})[_0xf970('0x16')](function(_0x4c46e0){_0x58272b=_0x4c46e0[_0xf970('0x5b')];return rta[_0xf970('0x5a')]();})['then'](function(_0x77893a){_0x3961b4=_0x77893a[_0xf970('0x5b')];if(_0x28db53!=_0xf970('0x12'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x5ce117){_0x438d83=_0x5ce117?_0x5ce117[_0xf970('0x5b')]:[];return initializeQueues(_0x4da11a,_0x58272b,_0x28db53,_0x124269[_0xf970('0x4c')][_0xf970('0x5f')]);})['then'](function(_0x4b1c3d){var _0x401740=_0x4b1c3d['map'](function(_0x450e7f){if(_0x28db53==='voice')return getVoiceQueueAgents(_0x450e7f,_0x4da11a,_0x3961b4,_0x438d83);else return getQueueAgents(_0x450e7f,_0x3961b4,_0x28db53);});return Promise[_0xf970('0x76')](_0x401740);})[_0xf970('0x16')](function(_0x3930fa){_0xf64c5['rows']=_0x3930fa;return _0xf64c5;})['then'](respondWithFilteredResult(_0x57b26f,_0xdc3326))[_0xf970('0x1a')](handleError(_0x57b26f,null));}; \ No newline at end of file +var _0x0f68=['rawAttributes','type','key','role','agent','raw','sequelize','literal','FIELD(id,','forEach','where','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','globalStatus','getAgentStatus','sortAgentsByStatus','getQueues','fieldName','getOptions','QueueCampaigns','rows','all','util','lodash','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','json','name','status','request','startCase','Queues','then','error','format','catch','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','result','loggedIn','available','waiting','talking','paused','voice','pTalking','originated','message','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','find','merge','filter','some','connectedlinenum','internal','toString','getMembers','length','UserId','accountcode','online','push','User','Queue','Pause','findAll','getChannels','includes','Invalid\x20channel','toLowerCase','getAgents','query','globalStatusFilter','pause','*pause','resolve','channel','sort','getUpdatedSortOptions','fields','order','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus'];(function(_0x1db0d3,_0x1c9ad0){var _0x1392c9=function(_0x5570c4){while(--_0x5570c4){_0x1db0d3['push'](_0x1db0d3['shift']());}};_0x1392c9(++_0x1c9ad0);}(_0x0f68,0x92));var _0x80f6=function(_0x245ee4,_0x180441){_0x245ee4=_0x245ee4-0x0;var _0x33b107=_0x0f68[_0x245ee4];return _0x33b107;};'use strict';var util=require(_0x80f6('0x0'));var _=require(_0x80f6('0x1'));var jayson=require('jayson/promise');var rta=require(_0x80f6('0x2'));var qs=require(_0x80f6('0x3'));var utils=require(_0x80f6('0x4'));var logger=require(_0x80f6('0x5'))('api');var db=require(_0x80f6('0x6'))['db'];var amiClient=jayson[_0x80f6('0x7')][_0x80f6('0x8')]({'port':0x232a});var routingClient=jayson[_0x80f6('0x7')][_0x80f6('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x50efb4,_0x2515ad){return function(_0x581e61){if(_0x581e61){var _0x32a3b9=typeof _0x2515ad[_0x80f6('0x9')]===_0x80f6('0xa')&&typeof _0x2515ad[_0x80f6('0xb')]===_0x80f6('0xa');var _0xcdac03=_0x581e61[_0x80f6('0xc')];var _0x245a4f=_0x32a3b9?0x0:_0x2515ad[_0x80f6('0x9')];var _0x5c0ecb=_0x32a3b9?_0x581e61[_0x80f6('0xc')]:_0x2515ad['offset']+_0x2515ad[_0x80f6('0xb')];var _0x2364e9;if(_0x5c0ecb>=_0xcdac03){_0x5c0ecb=_0xcdac03;_0x2364e9=0xc8;}else{_0x2364e9=0xce;}_0x50efb4['status'](_0x2364e9);return _0x50efb4['set']('Content-Range',_0x245a4f+'-'+_0x5c0ecb+'/'+_0xcdac03)[_0x80f6('0xd')](_0x581e61);}return null;};}function handleError(_0x3d21d1,_0x4c2b50){_0x4c2b50=_0x4c2b50||0x1f4;return function(_0x6d4266){logger['error'](_0x6d4266['stack']);if(_0x6d4266[_0x80f6('0xe')]){delete _0x6d4266[_0x80f6('0xe')];}_0x3d21d1[_0x80f6('0xf')](_0x4c2b50)['send'](_0x6d4266);};}function getRealtimeQueues(_0x2fd93a,_0x2459a9){return new Promise(function(_0x1534fa,_0x1a1cd0){var _0x24e29d=_0x2459a9==='voice'?amiClient:routingClient;return _0x24e29d[_0x80f6('0x10')](_[_0x80f6('0x11')](_0x2459a9)+_0x80f6('0x12'),_0x2fd93a)[_0x80f6('0x13')](function(_0x38b44d){if(_0x38b44d[_0x80f6('0x14')])throw new Error(util[_0x80f6('0x15')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x2459a9));return _0x1534fa(_0x38b44d['result']);})[_0x80f6('0x16')](function(_0x270ff5){_0x1a1cd0(_0x270ff5);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x3b07b0,_0x525ca5){return amiClient['request']('VoiceQueuesChannels',{})[_0x80f6('0x13')](function(_0x5b4ac5){if(_0x5b4ac5[_0x80f6('0x14')])throw new Error(_0x80f6('0x17'));return _0x3b07b0(_0x5b4ac5[_0x80f6('0x18')]);})[_0x80f6('0x16')](function(_0x1a3a20){_0x525ca5(_0x1a3a20);});});}function initializeQueues(_0x2e6944,_0x1e5959,_0x554b6b,_0x4d241d){var _0x405ecb=[_0x80f6('0x19'),_0x80f6('0x1a'),_0x80f6('0x1b'),_0x80f6('0x1c'),_0x80f6('0x1d')];if(_0x554b6b===_0x80f6('0x1e')&&_0x4d241d==='outbound'){_0x405ecb['push'](_0x80f6('0x1f'),_0x80f6('0x20'),_0x80f6('0x21'),_0x80f6('0x22'),_0x80f6('0x23'),'Trunk',_0x80f6('0x24'),_0x80f6('0x25'),_0x80f6('0x26'),_0x80f6('0x27'),'erlangAbandonmentRate',_0x80f6('0x28'),'dialPredictiveInterval',_0x80f6('0x29'),_0x80f6('0x2a'),'predictiveIntervalAvailable',_0x80f6('0x2b'),_0x80f6('0x2c'),_0x80f6('0x2d'),_0x80f6('0x2e'),'predictiveIntervalAvgHoldtime',_0x80f6('0x2f'));}return _0x2e6944[_0x80f6('0x30')](function(_0x359d2d){var _0xe9d57=_0x359d2d[_0x80f6('0x31')]({'plain':!![]});_0xe9d57[_0x80f6('0x32')]=[];_0xe9d57['paused']=0x0;_0xe9d57[_0x80f6('0x33')]=0x0;_0xe9d57[_0x80f6('0x19')]=0x0;_0xe9d57[_0x80f6('0x1a')]=0x0;_0xe9d57['waiting']=0x0;if(_0x554b6b==='voice'){_0xe9d57['talking']=0x0;_0xe9d57[_0x80f6('0x34')]=0x0;if(_0x4d241d==='outbound'){_0xe9d57[_0x80f6('0x1f')]=0x0;_0xe9d57[_0x80f6('0x20')]=0x0;}}var _0x5c496d=_[_0x80f6('0x35')](_0x1e5959,['id',_0xe9d57['id']]);if(_0x5c496d)_[_0x80f6('0x36')](_0xe9d57,_['pick'](_0x5c496d,_0x405ecb));return _0xe9d57;});}function updateAgentVoiceStatus(_0x4ec923,_0x1d6e17,_0x1a7bf1){var _0x129df0=_[_0x80f6('0x37')](_0x1a7bf1,['queue',_0x1d6e17[_0x80f6('0xe')]]);if(_0x129df0['length']===0x0)return _0x4ec923[_0x80f6('0x34')]=!![];if(_[_0x80f6('0x38')](_0x129df0,[_0x80f6('0x39'),_0x4ec923[_0x80f6('0x3a')][_0x80f6('0x3b')]()]))return _0x4ec923[_0x80f6('0x1c')]=!![];if(!_0x4ec923[_0x80f6('0x1c')])return _0x4ec923[_0x80f6('0x34')]=!![];}function getVoiceQueueAgents(_0x3eee0a,_0x525930,_0x2f5e79,_0x5af186){var _0xce8f9f=_[_0x80f6('0x35')](_0x525930,['id',_0x3eee0a['id']]);if(!_0xce8f9f)return _0x3eee0a;return _0xce8f9f[_0x80f6('0x3c')]({'raw':!![]})[_0x80f6('0x13')](function(_0x515c49){for(var _0x57189a=0x0;_0x57189a<_0x515c49[_0x80f6('0x3d')];_0x57189a++){var _0x8e4092=_[_0x80f6('0x35')](_0x2f5e79,['id',_0x515c49[_0x57189a][_0x80f6('0x3e')]]);if(!_0x8e4092){_0x8e4092={'id':_0x515c49[_0x57189a][_0x80f6('0x3e')],'name':_0x515c49[_0x57189a][_0x80f6('0x3e')],'accountcode':'','online':![]};}var _0x468c45={'id':_0x8e4092['id'],'name':_0x8e4092['name'],'internal':_0x8e4092[_0x80f6('0x3f')],'online':Boolean(_0x8e4092[_0x80f6('0x40')]),'paused':Boolean(_0x515c49[_0x57189a][_0x80f6('0x1d')])};if(_0x8e4092['voiceStatus']==='talking')updateAgentVoiceStatus(_0x468c45,_0x3eee0a,_0x5af186);if(_0x468c45[_0x80f6('0x40')])_0x3eee0a[_0x80f6('0x33')]++;if(_0x468c45[_0x80f6('0x34')])_0x3eee0a[_0x80f6('0x34')]++;if(_0x468c45[_0x80f6('0x1d')]&&!_0x468c45['busy']&&!_0x468c45['talking'])_0x3eee0a['paused']++;_0x3eee0a[_0x80f6('0x32')][_0x80f6('0x41')](_0x468c45);}return _0x3eee0a;});}function getQueueAgents(_0x96fc8c,_0x51cc2c,_0x51670e){var _0x3aceeb=_0x80f6('0x42')+_['startCase'](_0x51670e)+_0x80f6('0x43');var _0x389432=_0x51670e+_0x80f6('0x44');return db[_0x3aceeb][_0x80f6('0x45')]({'where':{[_[_0x80f6('0x11')](_0x51670e)+'QueueId']:_0x96fc8c['id']},'raw':!![]})[_0x80f6('0x13')](function(_0x347800){for(var _0x370d52=0x0;_0x370d52<_0x347800[_0x80f6('0x3d')];_0x370d52++){var _0x4e67c1=_[_0x80f6('0x35')](_0x51cc2c,['id',_0x347800[_0x370d52][_0x80f6('0x3e')]]);if(!_0x4e67c1){_0x4e67c1={'id':_0x347800[_0x370d52]['UserId'],'name':_0x347800[_0x370d52]['UserId'],'online':![],['pauseField']:![]};}var _0x344da1={'id':_0x4e67c1['id'],'name':_0x4e67c1[_0x80f6('0xe')],'online':Boolean(_0x4e67c1[_0x80f6('0x40')]),'paused':Boolean(_0x4e67c1[_0x389432])};if(_0x344da1['online'])_0x96fc8c['loggedInDb']++;_0x96fc8c[_0x80f6('0x32')][_0x80f6('0x41')](_0x344da1);}return _0x96fc8c;});}function validateChannel(_0x42ec74){var _0x321044=utils[_0x80f6('0x46')]();if(!_[_0x80f6('0x47')](_0x321044,_0x42ec74['toLowerCase']()))throw new Error(_0x80f6('0x48'));return _0x42ec74[_0x80f6('0x49')]();}exports[_0x80f6('0x4a')]=function(_0x4339b5,_0x89050d){var _0xbfe7dc={'count':0x0,'rows':[]};var _0x32c00e={};var _0x58d401;var _0x136b91;var _0x445c60;var _0x64a9f9;var _0x231d82=utils[_0x80f6('0x46')]();var _0x543a55=_0x4339b5[_0x80f6('0x4b')]['globalQueueFilter'];var _0x5ad15e=_0x4339b5['query'][_0x80f6('0x4c')];var _0x5656e5=_0x4339b5[_0x80f6('0x4b')]['pauseTypeFilter'];var _0x58e5c9=_0x5ad15e===_0x80f6('0x4d')||_0x5ad15e===_0x80f6('0x4e')?!![]:![];var _0x54655a=[];var _0x1e21d6;Promise[_0x80f6('0x4f')]()[_0x80f6('0x13')](function(){if(_0x4339b5['query'][_0x80f6('0x50')]){_0x58d401=validateChannel(_0x4339b5[_0x80f6('0x4b')][_0x80f6('0x50')]);}if(!_0x4339b5[_0x80f6('0x4b')][_0x80f6('0x51')]||!_0x4339b5[_0x80f6('0x4b')][_0x80f6('0x51')][_0x80f6('0x47')]('globalStatus')){_0x4339b5[_0x80f6('0x4b')]['sort']=rta['validateSortParameter'](_0x4339b5[_0x80f6('0x4b')][_0x80f6('0x51')]);return;}var _0x127edd=rta[_0x80f6('0x52')](_0x4339b5[_0x80f6('0x4b')][_0x80f6('0x51')]);_0x4339b5[_0x80f6('0x4b')][_0x80f6('0x51')]=_0x127edd[_0x80f6('0x53')]['join'](',');_0x136b91=_0x127edd[_0x80f6('0x54')];})['then'](function(){if(!_0x543a55){return[];}return rta[_0x80f6('0x55')](_0x543a55,_0x58d401);})['then'](function(_0x55e59f){_0x54655a=_0x55e59f;return rta[_0x80f6('0x56')]();})[_0x80f6('0x13')](function(_0xa3c7e3){_0x64a9f9=_0xa3c7e3['rows'];if((!_0x5ad15e||_0x58e5c9)&&!_0x136b91){return _0x54655a;}if(_0x136b91&&!_0x5ad15e){return rta[_0x80f6('0x57')](_0x64a9f9,_0x54655a,_0x136b91);}else{return rta['getAgentIdsByStatus'](_0x64a9f9,_0x54655a,_0x5ad15e);}})['then'](function(_0x2e94d7){_0x54655a=_0x2e94d7;var _0x2c7b9b=![];if(_0x54655a[_0x80f6('0x3d')]===0x0){if(_0x543a55||_0x5ad15e){_0x2c7b9b=!![];}if(_0x58e5c9){_0x2c7b9b=![];}}if(_0x2c7b9b){return _0xbfe7dc;}var _0x1a2040=_[_0x80f6('0x30')](db['User'][_0x80f6('0x58')],function(_0x1cfd62){return{'name':_0x1cfd62['fieldName'],'type':_0x1cfd62[_0x80f6('0x59')][_0x80f6('0x5a')]};});_0x4339b5[_0x80f6('0x4b')][_0x80f6('0x5b')]=_0x80f6('0x5c');_0x4339b5[_0x80f6('0x4b')][_0x80f6('0x40')]=!![];_0x32c00e=qs['getOptions'](_0x1a2040,_0x4339b5);_0x32c00e[_0x80f6('0x5d')]=!![];var _0x251281=[];if(_0x54655a[_0x80f6('0x3d')]>0x0){_0x251281[_0x80f6('0x41')]({'id':{'$in':_0x54655a}});if(_0x136b91&&!_0x5ad15e){_0x1e21d6=[db[_0x80f6('0x5e')][_0x80f6('0x5f')](_0x80f6('0x60')+_0x54655a+')')];_0x32c00e[_0x80f6('0x54')]=_0x1e21d6;}}if(_0x58e5c9){_0x231d82[_0x80f6('0x61')](function(_0x54aee3){var _0x9a3d22=!![];if(_0x5ad15e===_0x80f6('0x4e')&&_0x58d401!==_0x54aee3){_0x9a3d22=![];}_0x251281[_0x80f6('0x41')]({[_0x54aee3+_0x80f6('0x44')]:_0x9a3d22});});if(_0x5656e5){_0x251281[_0x80f6('0x41')]({'pauseType':_0x5656e5});}}else if(_0x5ad15e){_0x231d82[_0x80f6('0x61')](function(_0x4df5ff){_0x251281[_0x80f6('0x41')]({[_0x4df5ff+'Pause']:![]});});}_0x32c00e[_0x80f6('0x62')]=_[_0x80f6('0x36')](_0x32c00e[_0x80f6('0x62')],{'$and':_0x251281});if(_0x4339b5['user']['role']===_0x80f6('0x63')){var _0x3f6906={'params':{'id':_0x4339b5['user'][_0x80f6('0x64')]},'query':{'section':_0x80f6('0x65'),'role':'agent','online':!![],'raw':!![],'ids':_0x54655a,'customSorting':_0x1e21d6}};if(_0x58e5c9){_0x3f6906[_0x80f6('0x4b')][_0x80f6('0x66')]=_0x251281;}_0x3f6906[_0x80f6('0x4b')]=Object[_0x80f6('0x67')](_0x3f6906['query'],_0x4339b5[_0x80f6('0x4b')]);delete _0x3f6906[_0x80f6('0x4b')]['id'];return db[_0x80f6('0x68')][_0x80f6('0x69')](_0x3f6906);}return db[_0x80f6('0x42')][_0x80f6('0x6a')](_0x32c00e);})[_0x80f6('0x13')](function(_0x218951){_0xbfe7dc[_0x80f6('0xc')]=_0x218951[_0x80f6('0xc')];_0x445c60=_0x218951['rows'];return _0x445c60[_0x80f6('0x30')](function(_0x4cbe78){var _0x73977=_[_0x80f6('0x35')](_0x64a9f9,['id',_0x4cbe78['id']]);if(_0x73977){var _0x442693=rta[_0x80f6('0x6b')](_0x73977);_[_0x80f6('0x36')](_0x4cbe78,_0x442693);}_0x4cbe78[_0x80f6('0x6c')]=rta[_0x80f6('0x6d')](_0x4cbe78);if(_0x4cbe78[_0x80f6('0x6c')]['includes'](_0x80f6('0x4d'))){_0x231d82['forEach'](function(_0x4de0b4){if(_0x4cbe78[_0x4de0b4+_0x80f6('0x44')]){_0x4cbe78[_0x4de0b4+'Status']='pause';}});}return _0x4cbe78;});})[_0x80f6('0x13')](function(_0x5f08c9){if(!_0x136b91||_0x1e21d6){return _0x5f08c9;}return rta[_0x80f6('0x6e')](_0x5f08c9,_0x136b91);})[_0x80f6('0x13')](function(_0x3f86f7){_0xbfe7dc['rows']=_0x3f86f7;return _0xbfe7dc;})['then'](respondWithFilteredResult(_0x89050d,_0x32c00e))[_0x80f6('0x16')](handleError(_0x89050d,null));};exports[_0x80f6('0x6f')]=function(_0x338126,_0x54297d){var _0x1a74c2={'count':0x0,'rows':[]},_0x443534={},_0x3c7aac,_0x56bb65,_0x126173,_0x23a017,_0x2e2d11;Promise[_0x80f6('0x4f')]()['then'](function(){if(_0x338126[_0x80f6('0x4b')][_0x80f6('0x50')])_0x3c7aac=validateChannel(_0x338126[_0x80f6('0x4b')][_0x80f6('0x50')]);var _0x333286=_[_0x80f6('0x11')](_0x3c7aac)+_0x80f6('0x43');var _0x7072f2=_[_0x80f6('0x30')](db[_0x333286][_0x80f6('0x58')],function(_0x18c205){return{'name':_0x18c205[_0x80f6('0x70')],'type':_0x18c205[_0x80f6('0x59')][_0x80f6('0x5a')]};});_0x443534=qs[_0x80f6('0x71')](_0x7072f2,_0x338126);if(_0x338126[_0x80f6('0x63')][_0x80f6('0x5b')]===_0x80f6('0x63')){var _0x51d4ce={'params':{'id':_0x338126[_0x80f6('0x63')][_0x80f6('0x64')]},'query':{'section':_0x3c7aac===_0x80f6('0x1e')&&_0x338126[_0x80f6('0x4b')][_0x80f6('0x59')]==='outbound'?_0x80f6('0x72'):_[_0x80f6('0x11')](_0x3c7aac)+'Queues','type':_0x338126[_0x80f6('0x4b')][_0x80f6('0x59')],'nolimit':!![],'sort':_0x80f6('0xe'),'filter':_0x338126['query'][_0x80f6('0x37')]}};return db[_0x80f6('0x68')][_0x80f6('0x69')](_0x51d4ce);}return db[_0x333286][_0x80f6('0x6a')](_0x443534);})[_0x80f6('0x13')](function(_0x291f09){_0x1a74c2[_0x80f6('0xc')]=_0x291f09[_0x80f6('0xc')];_0x56bb65=_0x291f09['rows'];return getRealtimeQueues(_0x338126,_0x3c7aac);})['then'](function(_0x4d1ed1){_0x23a017=_0x4d1ed1[_0x80f6('0x73')];return rta[_0x80f6('0x56')]();})['then'](function(_0x49a7f5){_0x126173=_0x49a7f5[_0x80f6('0x73')];if(_0x3c7aac!=_0x80f6('0x1e'))return;return getRealtimeVoiceQueueChannels();})[_0x80f6('0x13')](function(_0x27c36c){_0x2e2d11=_0x27c36c?_0x27c36c[_0x80f6('0x73')]:[];return initializeQueues(_0x56bb65,_0x23a017,_0x3c7aac,_0x338126[_0x80f6('0x4b')]['type']);})[_0x80f6('0x13')](function(_0x36ac58){var _0x31f548=_0x36ac58[_0x80f6('0x30')](function(_0x2dc30f){if(_0x3c7aac==='voice')return getVoiceQueueAgents(_0x2dc30f,_0x56bb65,_0x126173,_0x2e2d11);else return getQueueAgents(_0x2dc30f,_0x126173,_0x3c7aac);});return Promise[_0x80f6('0x74')](_0x31f548);})[_0x80f6('0x13')](function(_0x93e0ba){_0x1a74c2['rows']=_0x93e0ba;return _0x1a74c2;})['then'](respondWithFilteredResult(_0x54297d,_0x443534))['catch'](handleError(_0x54297d,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 4bd37d8..e2e499a 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x49f9db,_0x381079){var _0x315df4=function(_0x599aaa){while(--_0x599aaa){_0x49f9db['push'](_0x49f9db['shift']());}};_0x315df4(++_0x381079);}(_0x70e0,0x17b));var _0x070e=function(_0x3ad336,_0x51bf60){_0x3ad336=_0x3ad336-0x0;var _0x5558ab=_0x70e0[_0x3ad336];return _0x5558ab;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x395b12,_0x3a396b){var _0x5cddfb=function(_0x19f1c5){while(--_0x19f1c5){_0x395b12['push'](_0x395b12['shift']());}};_0x5cddfb(++_0x3a396b);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 85015e3..2019adc 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 _0x3148=['DATE','INTEGER','sequelize','exports','STRING'];(function(_0x1064ba,_0x3c4aa4){var _0x15e125=function(_0x1bf2a1){while(--_0x1bf2a1){_0x1064ba['push'](_0x1064ba['shift']());}};_0x15e125(++_0x3c4aa4);}(_0x3148,0x1d3));var _0x8314=function(_0x97def9,_0x320c56){_0x97def9=_0x97def9-0x0;var _0x53c5ad=_0x3148[_0x97def9];return _0x53c5ad;};'use strict';var Sequelize=require(_0x8314('0x0'));module[_0x8314('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8314('0x2')]},'scheduledat':{'type':Sequelize[_0x8314('0x3')]},'uniqueid':{'type':Sequelize[_0x8314('0x2')]},'starttime':{'type':Sequelize[_0x8314('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x8314('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8314('0x2')]},'campaigntype':{'type':Sequelize[_0x8314('0x2')]},'membername':{'type':Sequelize[_0x8314('0x2')]}}; \ No newline at end of file +var _0x3d49=['DATE','exports','INTEGER','STRING'];(function(_0x190822,_0x410b67){var _0x5763d4=function(_0xa0d222){while(--_0xa0d222){_0x190822['push'](_0x190822['shift']());}};_0x5763d4(++_0x410b67);}(_0x3d49,0x151));var _0x93d4=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x3d49[_0xe8129c];return _0x709fc5;};'use strict';var Sequelize=require('sequelize');module[_0x93d4('0x0')]={'state':{'type':Sequelize[_0x93d4('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x93d4('0x2')]},'scheduledat':{'type':Sequelize[_0x93d4('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x93d4('0x3')]},'responsetime':{'type':Sequelize[_0x93d4('0x3')]},'ringtime':{'type':Sequelize[_0x93d4('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x93d4('0x2')]},'campaigntype':{'type':Sequelize[_0x93d4('0x2')]},'membername':{'type':Sequelize[_0x93d4('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index c1b6ec8..df77823 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 _0xf460=['./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util','../../config/logger','request-promise','path','../../config/environment'];(function(_0x39b21d,_0x1baef9){var _0x73b4dc=function(_0x34a737){while(--_0x34a737){_0x39b21d['push'](_0x39b21d['shift']());}};_0x73b4dc(++_0x1baef9);}(_0xf460,0xd7));var _0x0f46=function(_0x272d82,_0x4e5d8a){_0x272d82=_0x272d82-0x0;var _0x26dcda=_0xf460[_0x272d82];return _0x26dcda;};'use strict';var _=require('lodash');var util=require(_0x0f46('0x0'));var logger=require(_0x0f46('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0f46('0x2'));var fs=require('fs');var path=require(_0x0f46('0x3'));var rimraf=require('rimraf');var config=require(_0x0f46('0x4'));var attributes=require(_0x0f46('0x5'));module[_0x0f46('0x6')]=function(_0xb4957e,_0x1a473f){return _0xb4957e[_0x0f46('0x7')](_0x0f46('0x8'),attributes,{'tableName':_0x0f46('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e69=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger'];(function(_0x7d587a,_0x4027cb){var _0x33c6a8=function(_0x35ebf1){while(--_0x35ebf1){_0x7d587a['push'](_0x7d587a['shift']());}};_0x33c6a8(++_0x4027cb);}(_0x6e69,0x9a));var _0x96e6=function(_0x3f9eee,_0x3ed8c3){_0x3f9eee=_0x3f9eee-0x0;var _0xe791f=_0x6e69[_0x3f9eee];return _0xe791f;};'use strict';var _=require(_0x96e6('0x0'));var util=require('util');var logger=require(_0x96e6('0x1'))(_0x96e6('0x2'));var moment=require(_0x96e6('0x3'));var BPromise=require(_0x96e6('0x4'));var rp=require(_0x96e6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x96e6('0x6'));var config=require(_0x96e6('0x7'));var attributes=require(_0x96e6('0x8'));module[_0x96e6('0x9')]=function(_0x15b45c,_0x55e4f5){return _0x15b45c[_0x96e6('0xa')](_0x96e6('0xb'),attributes,{'tableName':_0x96e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 90184e0..1a9c3fa 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 _0xba9b=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','debug','lodash','util'];(function(_0x5048c2,_0x3786d2){var _0x4bf2a6=function(_0x2104dc){while(--_0x2104dc){_0x5048c2['push'](_0x5048c2['shift']());}};_0x4bf2a6(++_0x3786d2);}(_0xba9b,0xd6));var _0xbba9=function(_0x37d9eb,_0x1b6708){_0x37d9eb=_0x37d9eb-0x0;var _0x2c9240=_0xba9b[_0x37d9eb];return _0x2c9240;};'use strict';var _=require(_0xbba9('0x0'));var util=require(_0xbba9('0x1'));var moment=require('moment');var BPromise=require(_0xbba9('0x2'));var rs=require(_0xbba9('0x3'));var fs=require('fs');var Redis=require(_0xbba9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbba9('0x5'))(_0xbba9('0x6'));var config=require(_0xbba9('0x7'));var jayson=require(_0xbba9('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24d0a5,_0x3ff6dc,_0x59bea8){return new BPromise(function(_0xf64c21,_0x14ca6b){return client[_0xbba9('0x9')](_0x24d0a5,_0x59bea8)[_0xbba9('0xa')](function(_0x1b9c49){logger[_0xbba9('0xb')](_0xbba9('0xc'),_0x3ff6dc,_0xbba9('0xd'));logger['debug'](_0xbba9('0xe'),_0x3ff6dc,_0xbba9('0xd'),JSON[_0xbba9('0xf')](_0x1b9c49));if(_0x1b9c49[_0xbba9('0x10')]){if(_0x1b9c49['error'][_0xbba9('0x11')]===0x1f4){logger[_0xbba9('0x10')](_0xbba9('0xc'),_0x3ff6dc,_0x1b9c49['error'][_0xbba9('0x12')]);return _0x14ca6b(_0x1b9c49[_0xbba9('0x10')][_0xbba9('0x12')]);}logger[_0xbba9('0x10')](_0xbba9('0xc'),_0x3ff6dc,_0x1b9c49['error']['message']);return _0xf64c21(_0x1b9c49[_0xbba9('0x10')][_0xbba9('0x12')]);}else{logger[_0xbba9('0xb')](_0xbba9('0xc'),_0x3ff6dc,'request\x20sent');_0xf64c21(_0x1b9c49['result']['message']);}})[_0xbba9('0x13')](function(_0x5d54b8){logger[_0xbba9('0x10')](_0xbba9('0xc'),_0x3ff6dc,_0x5d54b8);_0x14ca6b(_0x5d54b8);});});}exports['CreateReportAgentPreview']=function(_0x5b6a7b){var _0x251e8a=this;return new Promise(function(_0x14ae16,_0x166f9b){return db[_0xbba9('0x14')][_0xbba9('0x15')](_0x5b6a7b[_0xbba9('0x16')],{'raw':_0x5b6a7b['options']?_0x5b6a7b[_0xbba9('0x17')][_0xbba9('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x242b79){logger[_0xbba9('0xb')](_0xbba9('0x19'),_0x5b6a7b);logger[_0xbba9('0x1a')]('CreateReportAgentPreview',_0x5b6a7b,JSON[_0xbba9('0xf')](_0x242b79));_0x14ae16(_0x242b79);})[_0xbba9('0x13')](function(_0x6d6e72){logger[_0xbba9('0x10')](_0xbba9('0x19'),_0x6d6e72['message'],_0x5b6a7b);_0x166f9b(_0x251e8a['error'](0x1f4,_0x6d6e72['message']));});});}; \ No newline at end of file +var _0x81cb=['options','raw','debug','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','catch','CreateReportAgentPreview','ReportAgentPreview','body'];(function(_0x18fe54,_0xff789){var _0xccb1ee=function(_0x513cf3){while(--_0x513cf3){_0x18fe54['push'](_0x18fe54['shift']());}};_0xccb1ee(++_0xff789);}(_0x81cb,0x99));var _0xb81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81cb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb81c('0x0'));var util=require(_0xb81c('0x1'));var moment=require('moment');var BPromise=require(_0xb81c('0x2'));var rs=require(_0xb81c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb81c('0x4'))('rpc');var config=require(_0xb81c('0x5'));var jayson=require(_0xb81c('0x6'));var client=jayson['client'][_0xb81c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5772a7,_0x166a20,_0x2cce52){return new BPromise(function(_0x3dfb9d,_0x115069){return client[_0xb81c('0x8')](_0x5772a7,_0x2cce52)[_0xb81c('0x9')](function(_0x59107f){logger[_0xb81c('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x166a20,_0xb81c('0xb'));logger['debug'](_0xb81c('0xc'),_0x166a20,_0xb81c('0xb'),JSON[_0xb81c('0xd')](_0x59107f));if(_0x59107f[_0xb81c('0xe')]){if(_0x59107f[_0xb81c('0xe')][_0xb81c('0xf')]===0x1f4){logger[_0xb81c('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x166a20,_0x59107f[_0xb81c('0xe')]['message']);return _0x115069(_0x59107f[_0xb81c('0xe')][_0xb81c('0x10')]);}logger['error'](_0xb81c('0x11'),_0x166a20,_0x59107f[_0xb81c('0xe')][_0xb81c('0x10')]);return _0x3dfb9d(_0x59107f[_0xb81c('0xe')][_0xb81c('0x10')]);}else{logger[_0xb81c('0xa')](_0xb81c('0x11'),_0x166a20,_0xb81c('0xb'));_0x3dfb9d(_0x59107f['result'][_0xb81c('0x10')]);}})[_0xb81c('0x12')](function(_0x32eeeb){logger[_0xb81c('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x166a20,_0x32eeeb);_0x115069(_0x32eeeb);});});}exports[_0xb81c('0x13')]=function(_0x2621d9){var _0x205611=this;return new Promise(function(_0x187119,_0x202ad6){return db[_0xb81c('0x14')]['create'](_0x2621d9[_0xb81c('0x15')],{'raw':_0x2621d9['options']?_0x2621d9[_0xb81c('0x16')][_0xb81c('0x17')]===undefined?!![]:![]:!![]})[_0xb81c('0x9')](function(_0x145b3a){logger[_0xb81c('0xa')](_0xb81c('0x13'),_0x2621d9);logger[_0xb81c('0x18')](_0xb81c('0x13'),_0x2621d9,JSON[_0xb81c('0xd')](_0x145b3a));_0x187119(_0x145b3a);})[_0xb81c('0x12')](function(_0x1b59da){logger[_0xb81c('0xe')](_0xb81c('0x13'),_0x1b59da[_0xb81c('0x10')],_0x2621d9);_0x202ad6(_0x205611[_0xb81c('0xe')](0x1f4,_0x1b59da['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 1a876e5..d402aac 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 _0x4546=['chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/openchannel/queues/:id/notify','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','showWhatsappQueues','/agents/:id/notify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify'];(function(_0x2ef4bd,_0x20fedc){var _0x3dcd0b=function(_0x8de2){while(--_0x8de2){_0x2ef4bd['push'](_0x2ef4bd['shift']());}};_0x3dcd0b(++_0x20fedc);}(_0x4546,0x1a3));var _0x6454=function(_0x91d674,_0x328c08){_0x91d674=_0x91d674-0x0;var _0x86554f=_0x4546[_0x91d674];return _0x86554f;};'use strict';var multer=require(_0x6454('0x0'));var util=require('util');var path=require(_0x6454('0x1'));var express=require(_0x6454('0x2'));var router=express[_0x6454('0x3')]();var auth=require(_0x6454('0x4'));var controller=require(_0x6454('0x5'));router[_0x6454('0x6')](_0x6454('0x7'),auth[_0x6454('0x8')](),controller[_0x6454('0x9')]);router[_0x6454('0x6')](_0x6454('0xa'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x6454('0x6')](_0x6454('0xb'),auth[_0x6454('0x8')](),controller[_0x6454('0xc')]);router[_0x6454('0x6')]('/voice/queues',auth['isAuthenticated'](),controller['voiceQueues']);router[_0x6454('0x6')](_0x6454('0xd'),auth['isAuthenticated'](),controller[_0x6454('0xe')]);router[_0x6454('0x6')](_0x6454('0xf'),auth[_0x6454('0x8')](),controller[_0x6454('0x10')]);router[_0x6454('0x6')](_0x6454('0x11'),auth['isAuthenticated'](),controller[_0x6454('0x12')]);router[_0x6454('0x6')](_0x6454('0x13'),auth['isAuthenticated'](),controller[_0x6454('0x14')]);router[_0x6454('0x6')](_0x6454('0x15'),auth[_0x6454('0x8')](),controller[_0x6454('0x16')]);router[_0x6454('0x6')](_0x6454('0x17'),auth[_0x6454('0x8')](),controller['whatsappQueues']);router[_0x6454('0x6')](_0x6454('0x18'),auth[_0x6454('0x8')](),controller[_0x6454('0x19')]);router[_0x6454('0x6')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x6454('0x1a')]);router['get']('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x6454('0x1b')]);router[_0x6454('0x6')](_0x6454('0x1c'),auth[_0x6454('0x8')](),controller[_0x6454('0x1d')]);router[_0x6454('0x6')](_0x6454('0x1e'),auth[_0x6454('0x8')](),controller['voiceQueuesChannelHangup']);router[_0x6454('0x6')](_0x6454('0x1f'),auth[_0x6454('0x8')](),controller[_0x6454('0x20')]);router[_0x6454('0x6')](_0x6454('0x21'),auth[_0x6454('0x8')](),controller[_0x6454('0x22')]);router[_0x6454('0x23')](_0x6454('0x21'),auth[_0x6454('0x8')](),controller[_0x6454('0x24')]);router[_0x6454('0x6')](_0x6454('0x25'),auth[_0x6454('0x8')](),controller[_0x6454('0x26')]);router[_0x6454('0x6')](_0x6454('0x27'),auth[_0x6454('0x8')](),controller[_0x6454('0x28')]);router['get']('/agents',auth[_0x6454('0x8')](),controller[_0x6454('0x29')]);router[_0x6454('0x23')](_0x6454('0x2a'),auth['isAuthenticated'](),controller['agentCapacity']);router['get'](_0x6454('0x2b'),auth[_0x6454('0x8')](),controller[_0x6454('0x2c')]);router[_0x6454('0x6')](_0x6454('0x2d'),auth[_0x6454('0x8')](),controller[_0x6454('0x2e')]);router['get'](_0x6454('0x2f'),auth['isAuthenticated'](),controller[_0x6454('0x30')]);router[_0x6454('0x6')]('/fax/accounts',auth[_0x6454('0x8')](),controller[_0x6454('0x31')]);router[_0x6454('0x6')](_0x6454('0x32'),auth[_0x6454('0x8')](),controller[_0x6454('0x33')]);router['get'](_0x6454('0x34'),auth[_0x6454('0x8')](),controller[_0x6454('0x35')]);router[_0x6454('0x6')]('/openchannel/queues/waitinginteractions',auth[_0x6454('0x8')](),controller[_0x6454('0x36')]);router[_0x6454('0x6')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0x6454('0x37')]);router[_0x6454('0x6')]('/sms/queues/waitinginteractions',auth[_0x6454('0x8')](),controller[_0x6454('0x38')]);router[_0x6454('0x6')](_0x6454('0x39'),auth['isAuthenticated'](),controller[_0x6454('0x3a')]);router[_0x6454('0x6')](_0x6454('0x3b'),auth[_0x6454('0x8')](),controller[_0x6454('0x3c')]);router[_0x6454('0x3d')](_0x6454('0x3e'),auth[_0x6454('0x8')](),controller['queueNotify']('mail'));router[_0x6454('0x6')](_0x6454('0x3f'),auth['isAuthenticated'](),controller[_0x6454('0x40')]);router[_0x6454('0x3d')](_0x6454('0x41'),auth[_0x6454('0x8')](),controller[_0x6454('0x42')](_0x6454('0x43')));router[_0x6454('0x6')](_0x6454('0x44'),auth[_0x6454('0x8')](),controller[_0x6454('0x45')]);router[_0x6454('0x3d')](_0x6454('0x46'),auth[_0x6454('0x8')](),controller['queueNotify']('fax'));router[_0x6454('0x6')]('/fax/queues/:id',auth[_0x6454('0x8')](),controller['showFaxQueues']);router[_0x6454('0x3d')](_0x6454('0x47'),auth[_0x6454('0x8')](),controller['queueNotify']('openchannel'));router[_0x6454('0x6')]('/openchannel/queues/:id',auth[_0x6454('0x8')](),controller[_0x6454('0x48')]);router['post'](_0x6454('0x49'),auth[_0x6454('0x8')](),controller[_0x6454('0x42')](_0x6454('0x4a')));router['post'](_0x6454('0x4b'),auth[_0x6454('0x8')](),controller[_0x6454('0x42')](_0x6454('0x4c')));router[_0x6454('0x6')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x6454('0x4d')]);router[_0x6454('0x6')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0x6454('0x4e')]);router[_0x6454('0x3d')](_0x6454('0x4f'),auth['isAuthenticated'](),controller['agentNotify']);module[_0x6454('0x50')]=router; \ No newline at end of file +var _0x3c6a=['/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','multer','util','Router','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','chatQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','chat'];(function(_0x462f8e,_0x48131f){var _0x284f8b=function(_0x1ca405){while(--_0x1ca405){_0x462f8e['push'](_0x462f8e['shift']());}};_0x284f8b(++_0x48131f);}(_0x3c6a,0xb5));var _0xa3c6=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0x3c6a[_0x21af3a];return _0x268a49;};'use strict';var multer=require(_0xa3c6('0x0'));var util=require(_0xa3c6('0x1'));var path=require('path');var express=require('express');var router=express[_0xa3c6('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0xa3c6('0x3'));router[_0xa3c6('0x4')](_0xa3c6('0x5'),auth[_0xa3c6('0x6')](),controller['voiceChannels']);router[_0xa3c6('0x4')](_0xa3c6('0x7'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x8')]);router[_0xa3c6('0x4')](_0xa3c6('0x9'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0xa')]);router[_0xa3c6('0x4')]('/voice/queues',auth[_0xa3c6('0x6')](),controller['voiceQueues']);router[_0xa3c6('0x4')]('/chat/queues',auth[_0xa3c6('0x6')](),controller[_0xa3c6('0xb')]);router[_0xa3c6('0x4')]('/mail/queues',auth[_0xa3c6('0x6')](),controller['mailQueues']);router['get'](_0xa3c6('0xc'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0xd')]);router[_0xa3c6('0x4')](_0xa3c6('0xe'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0xf')]);router['get']('/sms/queues',auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x10')]);router['get'](_0xa3c6('0x11'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x12')]);router[_0xa3c6('0x4')](_0xa3c6('0x13'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x14')]);router[_0xa3c6('0x4')](_0xa3c6('0x15'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x16')]);router['get'](_0xa3c6('0x17'),auth['isAuthenticated'](),controller[_0xa3c6('0x18')]);router[_0xa3c6('0x4')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0xa3c6('0x19')]);router['get'](_0xa3c6('0x1a'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x1b')]);router['get'](_0xa3c6('0x1c'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x1d')]);router[_0xa3c6('0x4')](_0xa3c6('0x1e'),auth[_0xa3c6('0x6')](),controller['showVoiceQueues']);router['put'](_0xa3c6('0x1e'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x1f')]);router[_0xa3c6('0x4')]('/outbound',auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x20')]);router['get'](_0xa3c6('0x21'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x22')]);router['get'](_0xa3c6('0x23'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x24')]);router[_0xa3c6('0x25')]('/agents/:id/capacity',auth[_0xa3c6('0x6')](),controller['agentCapacity']);router['get'](_0xa3c6('0x26'),auth['isAuthenticated'](),controller['telephones']);router[_0xa3c6('0x4')](_0xa3c6('0x27'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x28')]);router[_0xa3c6('0x4')](_0xa3c6('0x29'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x2a')]);router[_0xa3c6('0x4')](_0xa3c6('0x2b'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x2c')]);router[_0xa3c6('0x4')](_0xa3c6('0x2d'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x2e')]);router['get']('/mail/queues/waitinginteractions',auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x2f')]);router[_0xa3c6('0x4')](_0xa3c6('0x30'),auth['isAuthenticated'](),controller[_0xa3c6('0x31')]);router[_0xa3c6('0x4')](_0xa3c6('0x32'),auth['isAuthenticated'](),controller[_0xa3c6('0x33')]);router[_0xa3c6('0x4')](_0xa3c6('0x34'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x35')]);router['get'](_0xa3c6('0x36'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x37')]);router[_0xa3c6('0x4')](_0xa3c6('0x38'),auth['isAuthenticated'](),controller[_0xa3c6('0x39')]);router[_0xa3c6('0x3a')](_0xa3c6('0x3b'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x3c')](_0xa3c6('0x3d')));router[_0xa3c6('0x4')](_0xa3c6('0x3e'),auth['isAuthenticated'](),controller[_0xa3c6('0x3f')]);router[_0xa3c6('0x3a')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0xa3c6('0x40')));router[_0xa3c6('0x4')](_0xa3c6('0x41'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x42')]);router[_0xa3c6('0x3a')](_0xa3c6('0x43'),auth[_0xa3c6('0x6')](),controller['queueNotify'](_0xa3c6('0x44')));router['get'](_0xa3c6('0x45'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x46')]);router['post']('/openchannel/queues/:id/notify',auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x3c')](_0xa3c6('0x47')));router[_0xa3c6('0x4')]('/openchannel/queues/:id',auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x48')]);router['post'](_0xa3c6('0x49'),auth[_0xa3c6('0x6')](),controller['queueNotify'](_0xa3c6('0x4a')));router['post'](_0xa3c6('0x4b'),auth['isAuthenticated'](),controller[_0xa3c6('0x3c')](_0xa3c6('0x4c')));router[_0xa3c6('0x4')](_0xa3c6('0x4d'),auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x4e')]);router[_0xa3c6('0x4')](_0xa3c6('0x4f'),auth['isAuthenticated'](),controller[_0xa3c6('0x50')]);router[_0xa3c6('0x3a')]('/agents/:id/notify',auth[_0xa3c6('0x6')](),controller[_0xa3c6('0x51')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index c597587..05f5db0 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 _0x2bd8=['SmsQueues','showSmsQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','queue_id','uniq','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','User','Agent\x20not\x20found','\x20Message\x20not\x20found','update','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','error','message','result','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','SIP/%s','format','agent','internal','telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues'];(function(_0xced4,_0x10ebd8){var _0x1cb0c1=function(_0x274297){while(--_0x274297){_0xced4['push'](_0xced4['shift']());}};_0x1cb0c1(++_0x10ebd8);}(_0x2bd8,0x130));var _0x82bd=function(_0x347b14,_0xb08ea2){_0x347b14=_0x347b14-0x0;var _0x861e48=_0x2bd8[_0x347b14];return _0x861e48;};'use strict';var BPromise=require(_0x82bd('0x0'));var moment=require('moment');var _=require(_0x82bd('0x1'));var util=require(_0x82bd('0x2'));var db=require(_0x82bd('0x3'))['db'];var logger=require(_0x82bd('0x4'))(_0x82bd('0x5'));var jayson=require(_0x82bd('0x6'));var amiClient=jayson[_0x82bd('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0x82bd('0x7')][_0x82bd('0x8')]({'port':0x232b});var routingClient=jayson[_0x82bd('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){var _0x1666cf=_0x226f60?_0x226f60:amiClient;return _0x1666cf['request'](_0x19dbb1,_0x77d7a9)['then'](function(_0x51c6ea){if(_0x51c6ea[_0x82bd('0x9')]){if(_0x51c6ea['error']['code']===0x1f4){return _0x4dc3a6(_0x51c6ea[_0x82bd('0x9')]['message']);}return _0x1f7463(_0x51c6ea['error'][_0x82bd('0xa')]);}else{_0x1f7463(_0x51c6ea[_0x82bd('0xb')]);}})['catch'](function(_0x140ad6){_0x4dc3a6(_0x140ad6);});});}function respondWithResult(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xc8;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0xc')](_0xfaccf7)[_0x82bd('0xd')](_0x51e17e);}return _0x5f1ab9[_0x82bd('0xe')](0x194);};}function handleError(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0x1f4;return function(_0x446ffc){logger[_0x82bd('0x9')](_0x446ffc['stack']);if(_0x446ffc[_0x82bd('0xf')]){delete _0x446ffc['name'];}_0x2ca530[_0x82bd('0xc')](_0x58d82b)[_0x82bd('0x10')](_0x446ffc);};}function findById(_0x2c5155){return function(_0x300982){if(!_[_0x82bd('0x11')](_0x2c5155)&&!_[_0x82bd('0x11')](_0x300982)&&!_[_0x82bd('0x11')](_0x300982[_0x82bd('0x12')])){return _[_0x82bd('0x13')](_0x300982[_0x82bd('0x12')],function(_0x390107){return _0x390107['id']==_0x2c5155;});}return null;};}exports[_0x82bd('0x14')]=function(_0x1c3779,_0x253741){return respondWithRpcPromise('VoiceChannels',_0x1c3779['query'])[_0x82bd('0x15')](respondWithResult(_0x253741,null))[_0x82bd('0x16')](handleError(_0x253741,null));};exports[_0x82bd('0x17')]=function(_0xc9fcdf,_0x34899b){return respondWithRpcPromise(_0x82bd('0x18'),_[_0x82bd('0x19')](_0xc9fcdf[_0x82bd('0x1a')],_0xc9fcdf[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x34899b,null))[_0x82bd('0x16')](handleError(_0x34899b,null));};exports[_0x82bd('0x1c')]=function(_0x1ca91f,_0x3260c4){return respondWithRpcPromise(_0x82bd('0x1d'),_[_0x82bd('0x19')](_0x1ca91f[_0x82bd('0x1a')],_0x1ca91f[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x3260c4,null))['catch'](handleError(_0x3260c4,null));};exports['voiceQueues']=function(_0x4248be,_0x436ecd){return respondWithRpcPromise(_0x82bd('0x1e'),_0x4248be[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x436ecd,null))[_0x82bd('0x16')](handleError(_0x436ecd,null));};exports[_0x82bd('0x1f')]=function(_0xbef23b,_0x2f0bb6){return respondWithRpcPromise(_0x82bd('0x1e'),_0xbef23b['query'])['then'](findById(_0xbef23b['params']['id']))['then'](respondWithResult(_0x2f0bb6,null))[_0x82bd('0x16')](handleError(_0x2f0bb6,null));};exports[_0x82bd('0x20')]=function(_0x351d3d,_0x190bca){return respondWithRpcPromise(_0x82bd('0x21'),_['merge'](_0x351d3d['body'],_0x351d3d['params']))[_0x82bd('0x15')](respondWithResult(_0x190bca,null))[_0x82bd('0x16')](handleError(_0x190bca,null));};exports[_0x82bd('0x22')]=function(_0x580ba8,_0x166c46){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x82bd('0x19')](_0x580ba8[_0x82bd('0x1a')],_0x580ba8[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x166c46,null))[_0x82bd('0x16')](handleError(_0x166c46,null));};exports[_0x82bd('0x23')]=function(_0x5ca7fc,_0x591b38){return respondWithRpcPromise(_0x82bd('0x24'),_0x5ca7fc[_0x82bd('0x1a')])['then'](respondWithResult(_0x591b38,null))[_0x82bd('0x16')](handleError(_0x591b38,null));};exports['voiceQueuesChannel']=function(_0x578e6e,_0x3b8015){return respondWithRpcPromise(_0x82bd('0x25'),_[_0x82bd('0x19')](_0x578e6e[_0x82bd('0x1a')],_0x578e6e[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x3b8015,null))[_0x82bd('0x16')](handleError(_0x3b8015,null));};exports[_0x82bd('0x26')]=function(_0x42dc7f,_0xefc6e4){return respondWithRpcPromise(_0x82bd('0x27'),_[_0x82bd('0x19')](_0x42dc7f[_0x82bd('0x1a')],_0x42dc7f[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0xefc6e4,null))[_0x82bd('0x16')](handleError(_0xefc6e4,null));};exports[_0x82bd('0x28')]=function(_0x4bdcae,_0x59b7ca){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x82bd('0x19')](_0x4bdcae[_0x82bd('0x1a')],_0x4bdcae['params']))[_0x82bd('0x15')](respondWithResult(_0x59b7ca,null))['catch'](handleError(_0x59b7ca,null));};exports['outbound']=function(_0x4c5f8d,_0x2b7675){return respondWithRpcPromise(_0x82bd('0x29'),_0x4c5f8d[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x2b7675,null))[_0x82bd('0x16')](handleError(_0x2b7675,null));};exports['outboundChannels']=function(_0x54e33f,_0x575c14){return respondWithRpcPromise(_0x82bd('0x2a'),_0x54e33f['query'])['then'](respondWithResult(_0x575c14,null))[_0x82bd('0x16')](handleError(_0x575c14,null));};exports[_0x82bd('0x2b')]=function(_0x3192e2,_0x2c5e7d){var _0x3ff054;return respondWithRpcPromise(_0x82bd('0x2c'),_0x3192e2[_0x82bd('0x1a')])[_0x82bd('0x15')](function(_0x18752a){_0x3ff054=_0x18752a;return respondWithRpcPromise('Agents',_0x3192e2['query'],routingClient);})[_0x82bd('0x15')](function(_0x689b3c){return _['merge']({},_0x689b3c,_0x3ff054);})['then'](respondWithResult(_0x2c5e7d,null))[_0x82bd('0x16')](handleError(_0x2c5e7d,null));};exports[_0x82bd('0x2d')]=function(_0x4d310b,_0x121f1f){if(_0x4d310b[_0x82bd('0x2e')]&&_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')]&&_0x4d310b[_0x82bd('0x30')]&&_0x4d310b[_0x82bd('0x30')][_0x82bd('0xf')]){for(var _0x2c429d in _0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')]){if(_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')]['hasOwnProperty'](_0x2c429d)){db[_0x82bd('0x31')][_0x82bd('0x32')]({'where':{'channel':_0x2c429d,'membername':_0x4d310b['user']['name'],'type':_0x82bd('0x33'),'exitAt':null,'uniqueid':_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')][_0x2c429d]&&_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')][_0x2c429d]['length']?{'$notIn':_0x4d310b['body'][_0x82bd('0x2f')][_0x2c429d]}:{'$ne':null}}})[_0x82bd('0x15')](function(_0x4b2fb8){var _0x158957=moment()['format'](_0x82bd('0x34'));for(var _0x6d65c6=0x0,_0x587aec=_0x4b2fb8[_0x82bd('0x35')];_0x6d65c6<_0x587aec;_0x6d65c6+=0x1){_0x4b2fb8[_0x6d65c6][_0x82bd('0x36')]({'exitAt':_0x158957});}});for(var _0x54d12e=0x0;_0x54d12e<_0x4d310b['body'][_0x82bd('0x2f')][_0x2c429d]['length'];_0x54d12e+=0x1){db[_0x82bd('0x31')][_0x82bd('0x37')]({'where':{'channel':_0x2c429d,'membername':_0x4d310b[_0x82bd('0x30')][_0x82bd('0xf')],'type':'INTERACTION','uniqueid':_0x4d310b['body'][_0x82bd('0x2f')][_0x2c429d][_0x54d12e],'exitAt':null},'defaults':{'channel':_0x2c429d,'membername':_0x4d310b[_0x82bd('0x30')]['name'],'interface':_[_0x82bd('0x11')](_0x4d310b[_0x82bd('0x30')][_0x82bd('0x38')])?util['format'](_0x82bd('0x39'),_0x4d310b[_0x82bd('0x30')][_0x82bd('0xf')]):_0x4d310b[_0x82bd('0x30')][_0x82bd('0x38')],'type':_0x82bd('0x33'),'enterAt':moment()[_0x82bd('0x3a')](_0x82bd('0x34')),'role':_0x82bd('0x3b'),'internal':_0x4d310b[_0x82bd('0x30')][_0x82bd('0x3c')],'uniqueid':_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')][_0x2c429d][_0x54d12e]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x4d310b[_0x82bd('0x1b')]['id'],'capacity':_0x4d310b[_0x82bd('0x2e')]['capacity']},routingClient)[_0x82bd('0x15')](respondWithResult(_0x121f1f,null))[_0x82bd('0x16')](handleError(_0x121f1f,null));};exports[_0x82bd('0x3d')]=function(_0x4237ef,_0x55a2e6){return respondWithRpcPromise('Telephones',_0x4237ef[_0x82bd('0x1a')])['then'](respondWithResult(_0x55a2e6,null))['catch'](handleError(_0x55a2e6,null));};exports[_0x82bd('0x3e')]=function(_0x4c35dd,_0x523cbe){return respondWithRpcPromise(_0x82bd('0x3f'),_0x4c35dd[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x523cbe,null))[_0x82bd('0x16')](handleError(_0x523cbe,null));};exports[_0x82bd('0x40')]=function(_0x1a7402,_0x417c29){return respondWithRpcPromise(_0x82bd('0x41'),_0x1a7402[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x417c29,null))[_0x82bd('0x16')](handleError(_0x417c29,null));};exports[_0x82bd('0x42')]=function(_0x153fad,_0x1a1cdc){return respondWithRpcPromise(_0x82bd('0x43'),_0x153fad['query'],routingClient)[_0x82bd('0x15')](respondWithResult(_0x1a1cdc,null))[_0x82bd('0x16')](handleError(_0x1a1cdc,null));};exports[_0x82bd('0x44')]=function(_0x354581,_0x9bf8fa){return respondWithRpcPromise('ChatQueues',_0x354581['query'],routingClient)['then'](findById(_0x354581['params']['id']))[_0x82bd('0x15')](respondWithResult(_0x9bf8fa,null))[_0x82bd('0x16')](handleError(_0x9bf8fa,null));};exports[_0x82bd('0x45')]=function(_0x127f8f,_0x568fc3){return respondWithRpcPromise('MailQueues',_0x127f8f[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](respondWithResult(_0x568fc3,null))[_0x82bd('0x16')](handleError(_0x568fc3,null));};exports['showMailQueues']=function(_0x2657bc,_0x2252ef){return respondWithRpcPromise(_0x82bd('0x46'),_0x2657bc[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x2657bc[_0x82bd('0x1b')]['id']))[_0x82bd('0x15')](respondWithResult(_0x2252ef,null))[_0x82bd('0x16')](handleError(_0x2252ef,null));};exports[_0x82bd('0x47')]=function(_0x20b636,_0x3ae44e){return respondWithRpcPromise(_0x82bd('0x48'),_0x20b636[_0x82bd('0x1a')],mailClient)[_0x82bd('0x15')](respondWithResult(_0x3ae44e,null))[_0x82bd('0x16')](handleError(_0x3ae44e,null));};exports[_0x82bd('0x49')]=function(_0x124ca4,_0x1fa71d){return respondWithRpcPromise('OpenchannelQueues',_0x124ca4[_0x82bd('0x1a')],routingClient)['then'](respondWithResult(_0x1fa71d,null))['catch'](handleError(_0x1fa71d,null));};exports[_0x82bd('0x4a')]=function(_0x4d2305,_0x306247){return respondWithRpcPromise(_0x82bd('0x4b'),_0x4d2305[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x4d2305[_0x82bd('0x1b')]['id']))[_0x82bd('0x15')](respondWithResult(_0x306247,null))[_0x82bd('0x16')](handleError(_0x306247,null));};exports[_0x82bd('0x4c')]=function(_0x40d6cf,_0x37ede1){return respondWithRpcPromise(_0x82bd('0x4d'),_0x40d6cf['query'],routingClient)['then'](respondWithResult(_0x37ede1,null))[_0x82bd('0x16')](handleError(_0x37ede1,null));};exports[_0x82bd('0x4e')]=function(_0x513e1d,_0x47d136){return respondWithRpcPromise(_0x82bd('0x4d'),_0x513e1d[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x513e1d[_0x82bd('0x1b')]['id']))['then'](respondWithResult(_0x47d136,null))[_0x82bd('0x16')](handleError(_0x47d136,null));};exports['whatsappQueues']=function(_0x1a16c1,_0x6ff77c){return respondWithRpcPromise('WhatsappQueues',_0x1a16c1[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](respondWithResult(_0x6ff77c,null))[_0x82bd('0x16')](handleError(_0x6ff77c,null));};exports[_0x82bd('0x4f')]=function(_0x5a5d66,_0x1b5b39){return respondWithRpcPromise(_0x82bd('0x50'),_0x5a5d66[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x5a5d66[_0x82bd('0x1b')]['id']))[_0x82bd('0x15')](respondWithResult(_0x1b5b39,null))[_0x82bd('0x16')](handleError(_0x1b5b39,null));};exports[_0x82bd('0x51')]=function(_0x1384b0,_0x544f10){return respondWithRpcPromise(_0x82bd('0x52'),_0x1384b0['query'],routingClient)['then'](respondWithResult(_0x544f10,null))[_0x82bd('0x16')](handleError(_0x544f10,null));};exports[_0x82bd('0x53')]=function(_0x529cb2,_0x2d2a7e){return respondWithRpcPromise('FaxQueues',_0x529cb2[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x529cb2['params']['id']))[_0x82bd('0x15')](respondWithResult(_0x2d2a7e,null))[_0x82bd('0x16')](handleError(_0x2d2a7e,null));};exports['faxAccounts']=function(_0x505032,_0x5bd3ae){return respondWithRpcPromise(_0x82bd('0x54'),_0x505032[_0x82bd('0x1a')])['then'](respondWithResult(_0x5bd3ae,null))[_0x82bd('0x16')](handleError(_0x5bd3ae,null));};exports[_0x82bd('0x55')]=function(_0x52b73f,_0x5591af){return respondWithRpcPromise(_0x82bd('0x56'),_0x52b73f['query'],routingClient)['then'](respondWithResult(_0x5591af,null))[_0x82bd('0x16')](handleError(_0x5591af,null));};exports[_0x82bd('0x57')]=function(_0x988094,_0x3d1f0d){return respondWithRpcPromise(_0x82bd('0x58'),_0x988094['query'],routingClient)[_0x82bd('0x15')](respondWithResult(_0x3d1f0d,null))['catch'](handleError(_0x3d1f0d,null));};exports[_0x82bd('0x59')]=function(_0x5e25c3,_0x2fbf08){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5e25c3['query'],routingClient)[_0x82bd('0x15')](respondWithResult(_0x2fbf08,null))[_0x82bd('0x16')](handleError(_0x2fbf08,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x282263,_0x15a849){return respondWithRpcPromise(_0x82bd('0x5a'),_0x282263['query'],routingClient)['then'](function(_0x197368){if(_0x282263[_0x82bd('0x1a')]['type']!==undefined){var _0x222f9d=_(_0x197368[_0x82bd('0x12')])['filter']([_0x282263[_0x82bd('0x1a')][_0x82bd('0x5b')],_0x282263[_0x82bd('0x1b')]['id']])[_0x82bd('0x5c')](_0x82bd('0x5d'))[_0x82bd('0x5e')]()['value']();return _0x197368[_0x82bd('0x12')][_0x82bd('0x5f')](function(_0x12bc87){return _0x222f9d['indexOf'](_0x12bc87[_0x82bd('0x5d')])>-0x1;});}else{return _0x197368['rows'][_0x82bd('0x5f')](function(_0x2d9bc0){return _0x2d9bc0[_0x82bd('0x5d')]===parseInt(_0x282263[_0x82bd('0x1b')]['id']);});}})[_0x82bd('0x15')](respondWithResult(_0x15a849,null))['catch'](handleError(_0x15a849,null));};exports[_0x82bd('0x60')]=function(_0x39b9d5,_0x54e547){return respondWithRpcPromise(_0x82bd('0x61'),_0x39b9d5[_0x82bd('0x1a')],routingClient)['then'](respondWithResult(_0x54e547,null))[_0x82bd('0x16')](handleError(_0x54e547,null));};exports[_0x82bd('0x62')]=function(_0x42d4c9,_0x55fe38){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x42d4c9[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](respondWithResult(_0x55fe38,null))[_0x82bd('0x16')](handleError(_0x55fe38,null));};exports['faxQueuesWaitingInteractions']=function(_0x465979,_0x4721c3){return respondWithRpcPromise(_0x82bd('0x63'),_0x465979['query'],routingClient)['then'](respondWithResult(_0x4721c3,null))['catch'](handleError(_0x4721c3,null));};exports['queueNotify']=function(_0x437463){return function(_0x45bbf7,_0x4b5bf4){var _0x35d111,_0x546106;var _0x1da93f=_['capitalize'](_0x437463);var _0x43d8a2=_0x437463===_0x82bd('0x64')?_0x82bd('0x65'):'Account';return db[_0x1da93f+_0x82bd('0x66')][_0x82bd('0x67')]({'raw':!![],'where':{'id':_0x45bbf7[_0x82bd('0x1b')]['id']}})[_0x82bd('0x15')](function(_0xbe937d){if(_['isNil'](_0xbe937d)){throw new Error(_0x1da93f+_0x82bd('0x68'));}_0x35d111=_0xbe937d;return db[_0x1da93f+_0x82bd('0x69')][_0x82bd('0x67')]({'where':{'id':_0x45bbf7['body']['messageId']},'include':[{'model':db[_0x1da93f+'Interaction'],'as':_0x82bd('0x6a')},{'model':db[_0x1da93f+_0x43d8a2],'as':_0x82bd('0x6b')}]});})[_0x82bd('0x15')](function(_0x1a7f98){if(_[_0x82bd('0x11')](_0x1a7f98)){throw new Error(_0x1da93f+'\x20Message\x20not\x20found');}_0x546106=_0x1a7f98;return _0x1a7f98['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5a8e7f={'uniqueid':_0x437463+'.'+_0x546106['id']+'.'+_0x546106[_0x82bd('0x6a')]['id'],'FromUserId':_0x45bbf7[_0x82bd('0x30')]['id'],'type':_0x82bd('0x6c')};_0x5a8e7f[_0x1da93f+_0x82bd('0x6d')]=_0x546106['id'];_0x5a8e7f[_0x1da93f+_0x82bd('0x6e')]=_0x546106[_0x82bd('0x6a')]['id'];_0x5a8e7f[_0x82bd('0x6f')+_0x1da93f+_0x43d8a2+'Id']=_0x546106['Account']['id'];_0x5a8e7f['To'+_0x1da93f+_0x82bd('0x70')]=_0x35d111['id'];return db[_0x1da93f+_0x82bd('0x71')][_0x82bd('0x72')](_0x5a8e7f);})[_0x82bd('0x15')](function(){return respondWithRpcPromise(_0x82bd('0x73'),{'channel':_0x437463,'interaction':_0x546106[_0x82bd('0x6a')],'message':_0x546106,'account':_0x546106[_0x82bd('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x82bd('0x6c'),'appdata':_0x35d111[_0x82bd('0xf')]+','+(_0x546106[_0x82bd('0x6b')][_0x82bd('0x74')]||0x12c),'interval':_0x82bd('0x75')}]},routingClient);})[_0x82bd('0x15')](respondWithResult(_0x4b5bf4,null))['catch'](handleError(_0x4b5bf4,null));};};exports[_0x82bd('0x76')]=function(_0x3d14c7,_0x57c71c){var _0x588d7f,_0x5ca4b5;if(_['isNil'](_0x3d14c7[_0x82bd('0x2e')][_0x82bd('0x77')])){throw new Error(_0x82bd('0x78'));}var _0x2eda47=_0x3d14c7[_0x82bd('0x2e')][_0x82bd('0x77')];var _0x17f2aa=_[_0x82bd('0x79')](_0x2eda47);var _0x534fee=_0x2eda47===_0x82bd('0x64')?'Website':_0x82bd('0x6b');return db[_0x82bd('0x7a')][_0x82bd('0x67')]({'raw':!![],'where':{'id':_0x3d14c7[_0x82bd('0x1b')]['id'],'role':'agent'}})[_0x82bd('0x15')](function(_0x2c92d8){if(_[_0x82bd('0x11')](_0x2c92d8)){throw new Error(_0x82bd('0x7b'));}_0x588d7f=_0x2c92d8;return db[_0x17f2aa+'Message'][_0x82bd('0x67')]({'where':{'id':_0x3d14c7[_0x82bd('0x2e')]['messageId']},'include':[{'model':db[_0x17f2aa+'Interaction'],'as':'Interaction'},{'model':db[_0x17f2aa+_0x534fee],'as':_0x82bd('0x6b')}]});})[_0x82bd('0x15')](function(_0x291587){if(_[_0x82bd('0x11')](_0x291587)){throw new Error(_0x17f2aa+_0x82bd('0x7c'));}_0x5ca4b5=_0x291587;return _0x291587[_0x82bd('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x82bd('0x15')](function(){var _0x8f45e2={'uniqueid':_0x2eda47+'.'+_0x5ca4b5['id']+'.'+_0x5ca4b5[_0x82bd('0x6a')]['id'],'FromUserId':_0x3d14c7[_0x82bd('0x30')]['id'],'type':_0x82bd('0x6c'),'ToUserId':_0x588d7f['id']};_0x8f45e2[_0x17f2aa+_0x82bd('0x6d')]=_0x5ca4b5['id'];_0x8f45e2[_0x17f2aa+_0x82bd('0x6e')]=_0x5ca4b5[_0x82bd('0x6a')]['id'];_0x8f45e2[_0x82bd('0x6f')+_0x17f2aa+_0x534fee+'Id']=_0x5ca4b5[_0x82bd('0x6b')]['id'];return db[_0x17f2aa+_0x82bd('0x71')][_0x82bd('0x72')](_0x8f45e2);})[_0x82bd('0x15')](function(){return respondWithRpcPromise(_0x82bd('0x73'),{'channel':_0x2eda47,'interaction':_0x5ca4b5[_0x82bd('0x6a')],'message':_0x5ca4b5,'account':_0x5ca4b5['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x588d7f[_0x82bd('0xf')]+','+(_0x5ca4b5[_0x82bd('0x6b')][_0x82bd('0x7e')]||0x12c),'interval':_0x82bd('0x75')}]},routingClient);})['then'](respondWithResult(_0x57c71c,null))['catch'](handleError(_0x57c71c,null));}; \ No newline at end of file +var _0xb458=['InteractionId','TransferReport','agentTransferTimeout','bluebird','moment','lodash','../../config/logger','api','jayson/promise','client','http','request','then','error','code','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','VoiceChannelStopMixMonitor','params','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','MemberReport','interface','SIP/%s','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','Campaigns','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showFaxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','Message','Interaction','update','queue','MessageId','From','QueueId','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','findOne','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found'];(function(_0x44713c,_0x4a20b2){var _0x7886f6=function(_0x24e8ae){while(--_0x24e8ae){_0x44713c['push'](_0x44713c['shift']());}};_0x7886f6(++_0x4a20b2);}(_0xb458,0x103));var _0x8b45=function(_0x548eae,_0xad69de){_0x548eae=_0x548eae-0x0;var _0x5b1a01=_0xb458[_0x548eae];return _0x5b1a01;};'use strict';var BPromise=require(_0x8b45('0x0'));var moment=require(_0x8b45('0x1'));var _=require(_0x8b45('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x8b45('0x3'))(_0x8b45('0x4'));var jayson=require(_0x8b45('0x5'));var amiClient=jayson[_0x8b45('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0x8b45('0x6')]['http']({'port':0x232b});var routingClient=jayson['client'][_0x8b45('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){var _0xa54725=_0x3a8ccb?_0x3a8ccb:amiClient;return _0xa54725[_0x8b45('0x8')](_0x12bd05,_0x2daa9a)[_0x8b45('0x9')](function(_0x2bc809){if(_0x2bc809[_0x8b45('0xa')]){if(_0x2bc809['error'][_0x8b45('0xb')]===0x1f4){return _0x4d1718(_0x2bc809[_0x8b45('0xa')]['message']);}return _0x32342f(_0x2bc809['error']['message']);}else{_0x32342f(_0x2bc809['result']);}})[_0x8b45('0xc')](function(_0x285728){_0x4d1718(_0x285728);});});}function respondWithResult(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xc8;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0xd')](_0x52c4db)[_0x8b45('0xe')](_0x30d38c);}return _0x37c220[_0x8b45('0xf')](0x194);};}function handleError(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0x1f4;return function(_0x5f0b20){logger['error'](_0x5f0b20[_0x8b45('0x10')]);if(_0x5f0b20[_0x8b45('0x11')]){delete _0x5f0b20[_0x8b45('0x11')];}_0x32babc[_0x8b45('0xd')](_0x2ad2ae)[_0x8b45('0x12')](_0x5f0b20);};}function findById(_0x27ebb3){return function(_0x902c50){if(!_[_0x8b45('0x13')](_0x27ebb3)&&!_[_0x8b45('0x13')](_0x902c50)&&!_[_0x8b45('0x13')](_0x902c50[_0x8b45('0x14')])){return _[_0x8b45('0x15')](_0x902c50[_0x8b45('0x14')],function(_0x43ffb7){return _0x43ffb7['id']==_0x27ebb3;});}return null;};}exports[_0x8b45('0x16')]=function(_0x31c6b4,_0x23c520){return respondWithRpcPromise(_0x8b45('0x17'),_0x31c6b4['query'])[_0x8b45('0x9')](respondWithResult(_0x23c520,null))[_0x8b45('0xc')](handleError(_0x23c520,null));};exports[_0x8b45('0x18')]=function(_0x46e21a,_0x3e1438){return respondWithRpcPromise(_0x8b45('0x19'),_[_0x8b45('0x1a')](_0x46e21a[_0x8b45('0x1b')],_0x46e21a['params']))['then'](respondWithResult(_0x3e1438,null))[_0x8b45('0xc')](handleError(_0x3e1438,null));};exports['voiceChannelStopMixMonitor']=function(_0x1952fc,_0x3ddb50){return respondWithRpcPromise(_0x8b45('0x1c'),_[_0x8b45('0x1a')](_0x1952fc[_0x8b45('0x1b')],_0x1952fc[_0x8b45('0x1d')]))[_0x8b45('0x9')](respondWithResult(_0x3ddb50,null))['catch'](handleError(_0x3ddb50,null));};exports['voiceQueues']=function(_0x11ffcc,_0x2c2c06){return respondWithRpcPromise('VoiceQueues',_0x11ffcc['query'])[_0x8b45('0x9')](respondWithResult(_0x2c2c06,null))[_0x8b45('0xc')](handleError(_0x2c2c06,null));};exports[_0x8b45('0x1e')]=function(_0x2f37bc,_0x4e84cc){return respondWithRpcPromise(_0x8b45('0x1f'),_0x2f37bc[_0x8b45('0x1b')])[_0x8b45('0x9')](findById(_0x2f37bc[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x4e84cc,null))[_0x8b45('0xc')](handleError(_0x4e84cc,null));};exports[_0x8b45('0x20')]=function(_0x234f62,_0x1733a7){return respondWithRpcPromise(_0x8b45('0x21'),_[_0x8b45('0x1a')](_0x234f62[_0x8b45('0x22')],_0x234f62[_0x8b45('0x1d')]))['then'](respondWithResult(_0x1733a7,null))[_0x8b45('0xc')](handleError(_0x1733a7,null));};exports[_0x8b45('0x23')]=function(_0x34eb03,_0x15107a){return respondWithRpcPromise(_0x8b45('0x24'),_[_0x8b45('0x1a')](_0x34eb03[_0x8b45('0x1b')],_0x34eb03[_0x8b45('0x1d')]))['then'](respondWithResult(_0x15107a,null))[_0x8b45('0xc')](handleError(_0x15107a,null));};exports[_0x8b45('0x25')]=function(_0x50302,_0xc2ae94){return respondWithRpcPromise(_0x8b45('0x26'),_0x50302['query'])[_0x8b45('0x9')](respondWithResult(_0xc2ae94,null))['catch'](handleError(_0xc2ae94,null));};exports['voiceQueuesChannel']=function(_0x1f8a11,_0x94e3b6){return respondWithRpcPromise(_0x8b45('0x27'),_[_0x8b45('0x1a')](_0x1f8a11[_0x8b45('0x1b')],_0x1f8a11[_0x8b45('0x1d')]))['then'](respondWithResult(_0x94e3b6,null))[_0x8b45('0xc')](handleError(_0x94e3b6,null));};exports[_0x8b45('0x28')]=function(_0x264be7,_0x1f66a3){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x8b45('0x1a')](_0x264be7[_0x8b45('0x1b')],_0x264be7[_0x8b45('0x1d')]))['then'](respondWithResult(_0x1f66a3,null))[_0x8b45('0xc')](handleError(_0x1f66a3,null));};exports[_0x8b45('0x29')]=function(_0x1571b7,_0x58f32e){return respondWithRpcPromise(_0x8b45('0x2a'),_[_0x8b45('0x1a')](_0x1571b7[_0x8b45('0x1b')],_0x1571b7[_0x8b45('0x1d')]))['then'](respondWithResult(_0x58f32e,null))[_0x8b45('0xc')](handleError(_0x58f32e,null));};exports[_0x8b45('0x2b')]=function(_0x2de02d,_0x15df7c){return respondWithRpcPromise(_0x8b45('0x2c'),_0x2de02d[_0x8b45('0x1b')])['then'](respondWithResult(_0x15df7c,null))['catch'](handleError(_0x15df7c,null));};exports[_0x8b45('0x2d')]=function(_0x179f3b,_0x41d6b5){return respondWithRpcPromise(_0x8b45('0x2e'),_0x179f3b[_0x8b45('0x1b')])['then'](respondWithResult(_0x41d6b5,null))[_0x8b45('0xc')](handleError(_0x41d6b5,null));};exports['agents']=function(_0x67c59a,_0x17e9a8){var _0x5fae26;return respondWithRpcPromise(_0x8b45('0x2f'),_0x67c59a[_0x8b45('0x1b')])[_0x8b45('0x9')](function(_0x14d665){_0x5fae26=_0x14d665;return respondWithRpcPromise(_0x8b45('0x2f'),_0x67c59a[_0x8b45('0x1b')],routingClient);})[_0x8b45('0x9')](function(_0x3a97d5){return _['merge']({},_0x3a97d5,_0x5fae26);})[_0x8b45('0x9')](respondWithResult(_0x17e9a8,null))['catch'](handleError(_0x17e9a8,null));};exports[_0x8b45('0x30')]=function(_0x4eda71,_0x412c53){if(_0x4eda71[_0x8b45('0x22')]&&_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')]&&_0x4eda71[_0x8b45('0x32')]&&_0x4eda71[_0x8b45('0x32')]['name']){for(var _0x6fbca4 in _0x4eda71['body']['interaction']){if(_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x8b45('0x33')](_0x6fbca4)){db['MemberReport'][_0x8b45('0x34')]({'where':{'channel':_0x6fbca4,'membername':_0x4eda71['user'][_0x8b45('0x11')],'type':_0x8b45('0x35'),'exitAt':null,'uniqueid':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4]&&_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4]['length']?{'$notIn':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4]}:{'$ne':null}}})[_0x8b45('0x9')](function(_0xee45ac){var _0x1a13dd=moment()[_0x8b45('0x36')](_0x8b45('0x37'));for(var _0x3de3c2=0x0,_0x37b94a=_0xee45ac[_0x8b45('0x38')];_0x3de3c2<_0x37b94a;_0x3de3c2+=0x1){_0xee45ac[_0x3de3c2][_0x8b45('0x39')]({'exitAt':_0x1a13dd});}});for(var _0x3385db=0x0;_0x3385db<_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4][_0x8b45('0x38')];_0x3385db+=0x1){db[_0x8b45('0x3a')]['findOrCreate']({'where':{'channel':_0x6fbca4,'membername':_0x4eda71['user']['name'],'type':_0x8b45('0x35'),'uniqueid':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4][_0x3385db],'exitAt':null},'defaults':{'channel':_0x6fbca4,'membername':_0x4eda71[_0x8b45('0x32')][_0x8b45('0x11')],'interface':_[_0x8b45('0x13')](_0x4eda71[_0x8b45('0x32')][_0x8b45('0x3b')])?util['format'](_0x8b45('0x3c'),_0x4eda71['user'][_0x8b45('0x11')]):_0x4eda71[_0x8b45('0x32')][_0x8b45('0x3b')],'type':_0x8b45('0x35'),'enterAt':moment()['format'](_0x8b45('0x37')),'role':_0x8b45('0x3d'),'internal':_0x4eda71['user'][_0x8b45('0x3e')],'uniqueid':_0x4eda71[_0x8b45('0x22')]['interaction'][_0x6fbca4][_0x3385db]}});}}}}return respondWithRpcPromise(_0x8b45('0x3f'),{'id':_0x4eda71[_0x8b45('0x1d')]['id'],'capacity':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x40')]},routingClient)[_0x8b45('0x9')](respondWithResult(_0x412c53,null))[_0x8b45('0xc')](handleError(_0x412c53,null));};exports['telephones']=function(_0x4b8826,_0x3f7a16){return respondWithRpcPromise(_0x8b45('0x41'),_0x4b8826[_0x8b45('0x1b')])['then'](respondWithResult(_0x3f7a16,null))[_0x8b45('0xc')](handleError(_0x3f7a16,null));};exports[_0x8b45('0x42')]=function(_0x20a68b,_0x3e8a7d){return respondWithRpcPromise(_0x8b45('0x43'),_0x20a68b['query'])[_0x8b45('0x9')](respondWithResult(_0x3e8a7d,null))[_0x8b45('0xc')](handleError(_0x3e8a7d,null));};exports['campaigns']=function(_0x422da0,_0x4c3f38){return respondWithRpcPromise(_0x8b45('0x44'),_0x422da0[_0x8b45('0x1b')])[_0x8b45('0x9')](respondWithResult(_0x4c3f38,null))[_0x8b45('0xc')](handleError(_0x4c3f38,null));};exports['chatQueues']=function(_0xb9f390,_0x423231){return respondWithRpcPromise(_0x8b45('0x45'),_0xb9f390[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x423231,null))[_0x8b45('0xc')](handleError(_0x423231,null));};exports[_0x8b45('0x46')]=function(_0x2a35c1,_0x446fe5){return respondWithRpcPromise(_0x8b45('0x45'),_0x2a35c1[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x2a35c1[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x446fe5,null))[_0x8b45('0xc')](handleError(_0x446fe5,null));};exports['mailQueues']=function(_0x1744f8,_0x1477bd){return respondWithRpcPromise(_0x8b45('0x47'),_0x1744f8['query'],routingClient)[_0x8b45('0x9')](respondWithResult(_0x1477bd,null))[_0x8b45('0xc')](handleError(_0x1477bd,null));};exports[_0x8b45('0x48')]=function(_0x9eacc1,_0x5795ca){return respondWithRpcPromise(_0x8b45('0x47'),_0x9eacc1[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x9eacc1[_0x8b45('0x1d')]['id']))['then'](respondWithResult(_0x5795ca,null))[_0x8b45('0xc')](handleError(_0x5795ca,null));};exports[_0x8b45('0x49')]=function(_0x417778,_0x27503f){return respondWithRpcPromise(_0x8b45('0x4a'),_0x417778['query'],mailClient)[_0x8b45('0x9')](respondWithResult(_0x27503f,null))['catch'](handleError(_0x27503f,null));};exports[_0x8b45('0x4b')]=function(_0x2f7ab0,_0x19152b){return respondWithRpcPromise(_0x8b45('0x4c'),_0x2f7ab0[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x19152b,null))['catch'](handleError(_0x19152b,null));};exports['showOpenchannelQueues']=function(_0x5ace1,_0x2224b7){return respondWithRpcPromise('OpenchannelQueues',_0x5ace1[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x5ace1[_0x8b45('0x1d')]['id']))['then'](respondWithResult(_0x2224b7,null))['catch'](handleError(_0x2224b7,null));};exports[_0x8b45('0x4d')]=function(_0x8e5a41,_0x5abc79){return respondWithRpcPromise(_0x8b45('0x4e'),_0x8e5a41['query'],routingClient)[_0x8b45('0x9')](respondWithResult(_0x5abc79,null))['catch'](handleError(_0x5abc79,null));};exports['showSmsQueues']=function(_0x28e57a,_0x7f5a4e){return respondWithRpcPromise('SmsQueues',_0x28e57a[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x28e57a[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x7f5a4e,null))[_0x8b45('0xc')](handleError(_0x7f5a4e,null));};exports['whatsappQueues']=function(_0x37f580,_0x3b3d21){return respondWithRpcPromise(_0x8b45('0x4f'),_0x37f580['query'],routingClient)['then'](respondWithResult(_0x3b3d21,null))[_0x8b45('0xc')](handleError(_0x3b3d21,null));};exports['showWhatsappQueues']=function(_0x43f031,_0x5a4834){return respondWithRpcPromise('WhatsappQueues',_0x43f031['query'],routingClient)[_0x8b45('0x9')](findById(_0x43f031['params']['id']))[_0x8b45('0x9')](respondWithResult(_0x5a4834,null))[_0x8b45('0xc')](handleError(_0x5a4834,null));};exports['faxQueues']=function(_0x3db84e,_0x1b3890){return respondWithRpcPromise('FaxQueues',_0x3db84e[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x1b3890,null))[_0x8b45('0xc')](handleError(_0x1b3890,null));};exports[_0x8b45('0x50')]=function(_0x15cf9d,_0x877766){return respondWithRpcPromise(_0x8b45('0x51'),_0x15cf9d[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x15cf9d[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x877766,null))[_0x8b45('0xc')](handleError(_0x877766,null));};exports['faxAccounts']=function(_0x225180,_0x403ee2){return respondWithRpcPromise(_0x8b45('0x52'),_0x225180[_0x8b45('0x1b')])[_0x8b45('0x9')](respondWithResult(_0x403ee2,null))[_0x8b45('0xc')](handleError(_0x403ee2,null));};exports[_0x8b45('0x53')]=function(_0x3d3216,_0x243632){return respondWithRpcPromise(_0x8b45('0x54'),_0x3d3216[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x243632,null))[_0x8b45('0xc')](handleError(_0x243632,null));};exports[_0x8b45('0x55')]=function(_0x562c5f,_0x53143d){return respondWithRpcPromise(_0x8b45('0x56'),_0x562c5f[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x53143d,null))[_0x8b45('0xc')](handleError(_0x53143d,null));};exports[_0x8b45('0x57')]=function(_0xd88538,_0x1ebbca){return respondWithRpcPromise(_0x8b45('0x58'),_0xd88538['query'],routingClient)[_0x8b45('0x9')](respondWithResult(_0x1ebbca,null))[_0x8b45('0xc')](handleError(_0x1ebbca,null));};exports[_0x8b45('0x59')]=function(_0xa22bd0,_0xa44ba5){return respondWithRpcPromise(_0x8b45('0x58'),_0xa22bd0[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](function(_0x2a6fee){if(_0xa22bd0[_0x8b45('0x1b')][_0x8b45('0x5a')]!==undefined){var _0x5e54c6=_(_0x2a6fee['rows'])[_0x8b45('0x5b')]([_0xa22bd0[_0x8b45('0x1b')][_0x8b45('0x5a')],_0xa22bd0[_0x8b45('0x1d')]['id']])[_0x8b45('0x5c')](_0x8b45('0x5d'))[_0x8b45('0x5e')]()[_0x8b45('0x5f')]();return _0x2a6fee[_0x8b45('0x14')]['filter'](function(_0x55acf0){return _0x5e54c6[_0x8b45('0x60')](_0x55acf0[_0x8b45('0x5d')])>-0x1;});}else{return _0x2a6fee[_0x8b45('0x14')][_0x8b45('0x5b')](function(_0x55bafb){return _0x55bafb[_0x8b45('0x5d')]===parseInt(_0xa22bd0[_0x8b45('0x1d')]['id']);});}})[_0x8b45('0x9')](respondWithResult(_0xa44ba5,null))[_0x8b45('0xc')](handleError(_0xa44ba5,null));};exports[_0x8b45('0x61')]=function(_0x17588b,_0x4ed113){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x17588b[_0x8b45('0x1b')],routingClient)['then'](respondWithResult(_0x4ed113,null))['catch'](handleError(_0x4ed113,null));};exports['whatsappQueuesWaitingInteractions']=function(_0xf602c7,_0x170b95){return respondWithRpcPromise(_0x8b45('0x62'),_0xf602c7[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x170b95,null))[_0x8b45('0xc')](handleError(_0x170b95,null));};exports[_0x8b45('0x63')]=function(_0xc9be77,_0xc89fc6){return respondWithRpcPromise(_0x8b45('0x64'),_0xc9be77[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0xc89fc6,null))[_0x8b45('0xc')](handleError(_0xc89fc6,null));};exports[_0x8b45('0x65')]=function(_0x42b192){return function(_0x4a42e1,_0x29bfcc){var _0x91270d,_0x217798;var _0x19a135=_[_0x8b45('0x66')](_0x42b192);var _0x1446b1=_0x42b192===_0x8b45('0x67')?_0x8b45('0x68'):_0x8b45('0x69');return db[_0x19a135+_0x8b45('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x4a42e1[_0x8b45('0x1d')]['id']}})[_0x8b45('0x9')](function(_0x408fff){if(_[_0x8b45('0x13')](_0x408fff)){throw new Error(_0x19a135+'\x20Queue\x20not\x20found');}_0x91270d=_0x408fff;return db[_0x19a135+_0x8b45('0x6b')]['findOne']({'where':{'id':_0x4a42e1[_0x8b45('0x22')]['messageId']},'include':[{'model':db[_0x19a135+_0x8b45('0x6c')],'as':_0x8b45('0x6c')},{'model':db[_0x19a135+_0x1446b1],'as':_0x8b45('0x69')}]});})[_0x8b45('0x9')](function(_0x16bb83){if(_[_0x8b45('0x13')](_0x16bb83)){throw new Error(_0x19a135+'\x20Message\x20not\x20found');}_0x217798=_0x16bb83;return _0x16bb83[_0x8b45('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8b45('0x9')](function(){var _0x17364d={'uniqueid':_0x42b192+'.'+_0x217798['id']+'.'+_0x217798[_0x8b45('0x6c')]['id'],'FromUserId':_0x4a42e1['user']['id'],'type':_0x8b45('0x6e')};_0x17364d[_0x19a135+_0x8b45('0x6f')]=_0x217798['id'];_0x17364d[_0x19a135+'InteractionId']=_0x217798['Interaction']['id'];_0x17364d[_0x8b45('0x70')+_0x19a135+_0x1446b1+'Id']=_0x217798[_0x8b45('0x69')]['id'];_0x17364d['To'+_0x19a135+_0x8b45('0x71')]=_0x91270d['id'];return db[_0x19a135+'TransferReport'][_0x8b45('0x72')](_0x17364d);})['then'](function(){return respondWithRpcPromise(_0x8b45('0x73'),{'channel':_0x42b192,'interaction':_0x217798[_0x8b45('0x6c')],'message':_0x217798,'account':_0x217798['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x91270d[_0x8b45('0x11')]+','+(_0x217798[_0x8b45('0x69')][_0x8b45('0x74')]||0x12c),'interval':_0x8b45('0x75')}]},routingClient);})['then'](respondWithResult(_0x29bfcc,null))[_0x8b45('0xc')](handleError(_0x29bfcc,null));};};exports[_0x8b45('0x76')]=function(_0x376416,_0x1d475c){var _0x2680d5,_0x1abe69;if(_['isNil'](_0x376416[_0x8b45('0x22')][_0x8b45('0x77')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x10a91a=_0x376416[_0x8b45('0x22')]['channel'];var _0x4837af=_['capitalize'](_0x10a91a);var _0x186aa2=_0x10a91a===_0x8b45('0x67')?_0x8b45('0x68'):_0x8b45('0x69');return db[_0x8b45('0x78')][_0x8b45('0x79')]({'raw':!![],'where':{'id':_0x376416[_0x8b45('0x1d')]['id'],'role':'agent'}})[_0x8b45('0x9')](function(_0x3d321f){if(_[_0x8b45('0x13')](_0x3d321f)){throw new Error(_0x8b45('0x7a'));}_0x2680d5=_0x3d321f;return db[_0x4837af+_0x8b45('0x6b')][_0x8b45('0x79')]({'where':{'id':_0x376416['body'][_0x8b45('0x7b')]},'include':[{'model':db[_0x4837af+_0x8b45('0x6c')],'as':_0x8b45('0x6c')},{'model':db[_0x4837af+_0x186aa2],'as':_0x8b45('0x69')}]});})[_0x8b45('0x9')](function(_0x4c3bc9){if(_['isNil'](_0x4c3bc9)){throw new Error(_0x4837af+_0x8b45('0x7c'));}_0x1abe69=_0x4c3bc9;return _0x4c3bc9[_0x8b45('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8b45('0x9')](function(){var _0x9993ce={'uniqueid':_0x10a91a+'.'+_0x1abe69['id']+'.'+_0x1abe69[_0x8b45('0x6c')]['id'],'FromUserId':_0x376416['user']['id'],'type':_0x8b45('0x6e'),'ToUserId':_0x2680d5['id']};_0x9993ce[_0x4837af+'MessageId']=_0x1abe69['id'];_0x9993ce[_0x4837af+_0x8b45('0x7d')]=_0x1abe69['Interaction']['id'];_0x9993ce[_0x8b45('0x70')+_0x4837af+_0x186aa2+'Id']=_0x1abe69[_0x8b45('0x69')]['id'];return db[_0x4837af+_0x8b45('0x7e')][_0x8b45('0x72')](_0x9993ce);})[_0x8b45('0x9')](function(){return respondWithRpcPromise(_0x8b45('0x73'),{'channel':_0x10a91a,'interaction':_0x1abe69[_0x8b45('0x6c')],'message':_0x1abe69,'account':_0x1abe69[_0x8b45('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8b45('0x3d'),'appdata':_0x2680d5[_0x8b45('0x11')]+','+(_0x1abe69[_0x8b45('0x69')][_0x8b45('0x7f')]||0x12c),'interval':_0x8b45('0x75')}]},routingClient);})[_0x8b45('0x9')](respondWithResult(_0x1d475c,null))['catch'](handleError(_0x1d475c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 3d6215d..f001f0b 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 _0x16fe=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','show','/:id/run','run','post','put','/:id','update','delete','destroy','exports','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x16fe,0x1e3));var _0xe16f=function(_0x1e6f17,_0x39f434){_0x1e6f17=_0x1e6f17-0x0;var _0x17e6ab=_0x16fe[_0x1e6f17];return _0x17e6ab;};'use strict';var multer=require(_0xe16f('0x0'));var util=require(_0xe16f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe16f('0x2'));var router=express[_0xe16f('0x3')]();var fs_extra=require(_0xe16f('0x4'));var auth=require(_0xe16f('0x5'));var interaction=require(_0xe16f('0x6'));var config=require(_0xe16f('0x7'));var controller=require(_0xe16f('0x8'));router['get']('/',auth[_0xe16f('0x9')](),controller[_0xe16f('0xa')]);router[_0xe16f('0xb')]('/:id',auth[_0xe16f('0x9')](),controller[_0xe16f('0xc')]);router[_0xe16f('0xb')](_0xe16f('0xd'),auth[_0xe16f('0x9')](),controller[_0xe16f('0xe')]);router[_0xe16f('0xf')]('/',auth[_0xe16f('0x9')](),controller['create']);router[_0xe16f('0x10')](_0xe16f('0x11'),auth[_0xe16f('0x9')](),controller[_0xe16f('0x12')]);router[_0xe16f('0x13')](_0xe16f('0x11'),auth[_0xe16f('0x9')](),controller[_0xe16f('0x14')]);module[_0xe16f('0x15')]=router; \ No newline at end of file +var _0x9366=['destroy','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show','/:id/run','run','post','create','put','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9366,0xa3));var _0x6936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9366[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6936('0x0'));var util=require(_0x6936('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6936('0x2')]();var fs_extra=require(_0x6936('0x3'));var auth=require(_0x6936('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6936('0x5'));var controller=require(_0x6936('0x6'));router[_0x6936('0x7')]('/',auth[_0x6936('0x8')](),controller[_0x6936('0x9')]);router[_0x6936('0x7')]('/:id',auth[_0x6936('0x8')](),controller[_0x6936('0xa')]);router[_0x6936('0x7')](_0x6936('0xb'),auth[_0x6936('0x8')](),controller[_0x6936('0xc')]);router[_0x6936('0xd')]('/',auth[_0x6936('0x8')](),controller[_0x6936('0xe')]);router[_0x6936('0xf')](_0x6936('0x10'),auth[_0x6936('0x8')](),controller['update']);router['delete'](_0x6936('0x10'),auth[_0x6936('0x8')](),controller[_0x6936('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index d42fc93..dc7ab9a 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 _0xfaee=['xlsx','csv','custom','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','hours','minutes','pdf'];(function(_0x1fc2dd,_0x34e096){var _0x41905b=function(_0x91839){while(--_0x91839){_0x1fc2dd['push'](_0x1fc2dd['shift']());}};_0x41905b(++_0x34e096);}(_0xfaee,0x122));var _0xefae=function(_0x2fc1f6,_0x51543e){_0x2fc1f6=_0x2fc1f6-0x0;var _0x7a3346=_0xfaee[_0x2fc1f6];return _0x7a3346;};'use strict';var Sequelize=require(_0xefae('0x0'));module[_0xefae('0x1')]={'name':{'type':Sequelize[_0xefae('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xefae('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xefae('0x2')],'allowNull':![],'defaultValue':_0xefae('0x3')},'startAt':{'type':Sequelize[_0xefae('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xefae('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xefae('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xefae('0x6')](_0xefae('0x7'),_0xefae('0x8'),_0xefae('0x9'),_0xefae('0xa'),'days',_0xefae('0xb'),_0xefae('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xefae('0x6')]('csv',_0xefae('0xd'),_0xefae('0xe')),'allowNull':![],'defaultValue':_0xefae('0xf')},'type':{'type':Sequelize[_0xefae('0x6')]('custom','default'),'allowNull':![],'defaultValue':_0xefae('0x10')},'sendMail':{'type':Sequelize[_0xefae('0x11')],'defaultValue':![]},'email':{'type':Sequelize[_0xefae('0x2')]},'cc':{'type':Sequelize[_0xefae('0x12')]},'bcc':{'type':Sequelize[_0xefae('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xefae('0x11')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdaa9=['0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','days','hours','minutes','csv','pdf','xlsx','custom','BOOLEAN','TEXT','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdaa9,0x166));var _0x9daa=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xdaa9[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x9daa('0x0'));module[_0x9daa('0x1')]={'name':{'type':Sequelize[_0x9daa('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9daa('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9daa('0x2')],'allowNull':![],'defaultValue':_0x9daa('0x3')},'startAt':{'type':Sequelize[_0x9daa('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x9daa('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9daa('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9daa('0x6')](_0x9daa('0x7'),_0x9daa('0x8'),'months',_0x9daa('0x9'),_0x9daa('0xa'),_0x9daa('0xb'),_0x9daa('0xc')),'allowNull':![],'defaultValue':_0x9daa('0xa')},'output':{'type':Sequelize['ENUM'](_0x9daa('0xd'),_0x9daa('0xe'),_0x9daa('0xf')),'allowNull':![],'defaultValue':_0x9daa('0xd')},'type':{'type':Sequelize['ENUM'](_0x9daa('0x10'),'default'),'allowNull':![],'defaultValue':_0x9daa('0x10')},'sendMail':{'type':Sequelize[_0x9daa('0x11')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x9daa('0x12')]},'bcc':{'type':Sequelize[_0x9daa('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x9daa('0x11')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index a124d8e..e69b5cb 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 _0x88b4=['options','include','findAll','catch','params','rawAttributes','length','includeAll','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','update','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','Scheduler','error','stack','send','map','Schedule','fieldName','type','key','name','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL'];(function(_0x202a11,_0x17fc90){var _0x52a85f=function(_0x523646){while(--_0x523646){_0x202a11['push'](_0x202a11['shift']());}};_0x52a85f(++_0x17fc90);}(_0x88b4,0xbe));var _0x488b=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0x88b4[_0x999b85];return _0x1d7124;};'use strict';var emlformat=require(_0x488b('0x0'));var rimraf=require(_0x488b('0x1'));var zipdir=require(_0x488b('0x2'));var jsonpatch=require(_0x488b('0x3'));var rp=require(_0x488b('0x4'));var moment=require(_0x488b('0x5'));var BPromise=require(_0x488b('0x6'));var Mustache=require(_0x488b('0x7'));var util=require(_0x488b('0x8'));var path=require(_0x488b('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x488b('0xa'));var fs=require('fs');var fs_extra=require(_0x488b('0xb'));var _=require('lodash');var squel=require(_0x488b('0xc'));var crypto=require(_0x488b('0xd'));var jsforce=require(_0x488b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x488b('0xf'));var querystring=require(_0x488b('0x10'));var Papa=require('papaparse');var Redis=require(_0x488b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x488b('0x12'));var as=require(_0x488b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x488b('0x14'))('api');var utils=require(_0x488b('0x15'));var config=require(_0x488b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x488b('0x17'))['db'];function respondWithStatusCode(_0x3669d0,_0x6ec792){_0x6ec792=_0x6ec792||0xcc;return function(_0x403d65){if(_0x403d65){return _0x3669d0[_0x488b('0x18')](_0x6ec792);}return _0x3669d0[_0x488b('0x19')](_0x6ec792)[_0x488b('0x1a')]();};}function respondWithResult(_0x2b1b24,_0x2d7b93){_0x2d7b93=_0x2d7b93||0xc8;return function(_0x479a3b){if(_0x479a3b){return _0x2b1b24['status'](_0x2d7b93)['json'](_0x479a3b);}};}function respondWithFilteredResult(_0x451581,_0x544a48){return function(_0x1b425a){if(_0x1b425a){var _0x4e7220=typeof _0x544a48[_0x488b('0x1b')]==='undefined'&&typeof _0x544a48['limit']===_0x488b('0x1c');var _0x2ee48b=_0x1b425a[_0x488b('0x1d')];var _0xd7d9e=_0x4e7220?0x0:_0x544a48['offset'];var _0x415744=_0x4e7220?_0x1b425a[_0x488b('0x1d')]:_0x544a48[_0x488b('0x1b')]+_0x544a48[_0x488b('0x1e')];var _0x202ff7;if(_0x415744>=_0x2ee48b){_0x415744=_0x2ee48b;_0x202ff7=0xc8;}else{_0x202ff7=0xce;}_0x451581['status'](_0x202ff7);return _0x451581[_0x488b('0x1f')](_0x488b('0x20'),_0xd7d9e+'-'+_0x415744+'/'+_0x2ee48b)[_0x488b('0x21')](_0x1b425a);}return null;};}function patchUpdates(_0x405967){return function(_0x3c436a){try{jsonpatch[_0x488b('0x22')](_0x3c436a,_0x405967,!![]);}catch(_0x34f417){return BPromise[_0x488b('0x23')](_0x34f417);}return _0x3c436a[_0x488b('0x24')]();};}function saveUpdates(_0x46208f,_0x3dd90c){return function(_0x3b716e){if(_0x3b716e){return _0x3b716e['update'](_0x46208f)[_0x488b('0x25')](function(_0x5c4fe4){return _0x5c4fe4;});}return null;};}function removeEntity(_0x34dfda,_0x4f6b45){return function(_0x1e2cc4){if(_0x1e2cc4){return _0x1e2cc4[_0x488b('0x26')]()[_0x488b('0x25')](function(){var _0x317919=_0x1e2cc4[_0x488b('0x27')]({'plain':!![]});var _0x55a7d1=_0x488b('0x28');return db['UserProfileResource'][_0x488b('0x26')]({'where':{'type':_0x55a7d1,'resourceId':_0x317919['id']}})['then'](function(){return _0x1e2cc4;});})[_0x488b('0x25')](function(){_0x34dfda[_0x488b('0x19')](0xcc)[_0x488b('0x1a')]();});}};}function handleEntityNotFound(_0x29f8fa,_0x33f2de){return function(_0x5a5cef){if(!_0x5a5cef){_0x29f8fa[_0x488b('0x18')](0x194);}return _0x5a5cef;};}function handleError(_0x1728ff,_0x180693){_0x180693=_0x180693||0x1f4;return function(_0x367025){logger[_0x488b('0x29')](_0x367025[_0x488b('0x2a')]);if(_0x367025['name']){delete _0x367025['name'];}_0x1728ff[_0x488b('0x19')](_0x180693)[_0x488b('0x2b')](_0x367025);};}exports['index']=function(_0x1552f0,_0x3acfba){var _0x503f2f={},_0x16ba5f={},_0x181f2f={'count':0x0,'rows':[]};var _0x35d612=_[_0x488b('0x2c')](db[_0x488b('0x2d')]['rawAttributes'],function(_0x1c7a23){return{'name':_0x1c7a23[_0x488b('0x2e')],'type':_0x1c7a23[_0x488b('0x2f')][_0x488b('0x30')]};});_0x16ba5f['model']=_[_0x488b('0x2c')](_0x35d612,_0x488b('0x31'));_0x16ba5f[_0x488b('0x32')]=_[_0x488b('0x33')](_0x1552f0[_0x488b('0x32')]);_0x16ba5f['filters']=_['intersection'](_0x16ba5f['model'],_0x16ba5f[_0x488b('0x32')]);_0x503f2f[_0x488b('0x34')]=_[_0x488b('0x35')](_0x16ba5f[_0x488b('0x36')],qs[_0x488b('0x37')](_0x1552f0[_0x488b('0x32')][_0x488b('0x37')]));_0x503f2f[_0x488b('0x34')]=_0x503f2f[_0x488b('0x34')]['length']?_0x503f2f[_0x488b('0x34')]:_0x16ba5f[_0x488b('0x36')];if(!_0x1552f0[_0x488b('0x32')][_0x488b('0x38')](_0x488b('0x39'))){_0x503f2f['limit']=qs[_0x488b('0x1e')](_0x1552f0[_0x488b('0x32')]['limit']);_0x503f2f[_0x488b('0x1b')]=qs['offset'](_0x1552f0[_0x488b('0x32')][_0x488b('0x1b')]);}_0x503f2f[_0x488b('0x3a')]=qs[_0x488b('0x3b')](_0x1552f0[_0x488b('0x32')][_0x488b('0x3b')]);_0x503f2f[_0x488b('0x3c')]=qs[_0x488b('0x3d')](_[_0x488b('0x3e')](_0x1552f0['query'],_0x16ba5f['filters']),_0x35d612);if(_0x1552f0[_0x488b('0x32')][_0x488b('0x3f')]){_0x503f2f[_0x488b('0x3c')]=_['merge'](_0x503f2f[_0x488b('0x3c')],{'$or':_[_0x488b('0x2c')](_0x35d612,function(_0x15a1e2){if(_0x15a1e2[_0x488b('0x2f')]!==_0x488b('0x40')){var _0x591d9d={};_0x591d9d[_0x15a1e2[_0x488b('0x31')]]={'$like':'%'+_0x1552f0[_0x488b('0x32')]['filter']+'%'};return _0x591d9d;}})});}_0x503f2f=_['merge']({},_0x503f2f,_0x1552f0[_0x488b('0x41')]);var _0x5aeb1f={'where':_0x503f2f['where']};return db[_0x488b('0x2d')]['count'](_0x5aeb1f)[_0x488b('0x25')](function(_0x3bb743){_0x181f2f[_0x488b('0x1d')]=_0x3bb743;if(_0x1552f0['query']['includeAll']){_0x503f2f[_0x488b('0x42')]=[{'all':!![]}];}return db[_0x488b('0x2d')][_0x488b('0x43')](_0x503f2f);})[_0x488b('0x25')](function(_0x51e2b1){_0x181f2f['rows']=_0x51e2b1;return _0x181f2f;})[_0x488b('0x25')](respondWithFilteredResult(_0x3acfba,_0x503f2f))[_0x488b('0x44')](handleError(_0x3acfba,null));};exports['show']=function(_0x3ed865,_0x9d8d9b){var _0x6cf8cc={'raw':![],'where':{'id':_0x3ed865[_0x488b('0x45')]['id']}},_0x3bcc81={};_0x3bcc81[_0x488b('0x36')]=_[_0x488b('0x33')](db[_0x488b('0x2d')][_0x488b('0x46')]);_0x3bcc81['query']=_[_0x488b('0x33')](_0x3ed865[_0x488b('0x32')]);_0x3bcc81[_0x488b('0x3d')]=_[_0x488b('0x35')](_0x3bcc81['model'],_0x3bcc81[_0x488b('0x32')]);_0x6cf8cc[_0x488b('0x34')]=_[_0x488b('0x35')](_0x3bcc81[_0x488b('0x36')],qs[_0x488b('0x37')](_0x3ed865['query']['fields']));_0x6cf8cc[_0x488b('0x34')]=_0x6cf8cc[_0x488b('0x34')][_0x488b('0x47')]?_0x6cf8cc[_0x488b('0x34')]:_0x3bcc81[_0x488b('0x36')];if(_0x3ed865['query'][_0x488b('0x48')]){_0x6cf8cc[_0x488b('0x42')]=[{'all':!![]}];}_0x6cf8cc=_[_0x488b('0x49')]({},_0x6cf8cc,_0x3ed865[_0x488b('0x41')]);return db[_0x488b('0x2d')]['find'](_0x6cf8cc)[_0x488b('0x25')](handleEntityNotFound(_0x9d8d9b,null))[_0x488b('0x25')](respondWithResult(_0x9d8d9b,null))['catch'](handleError(_0x9d8d9b,null));};exports[_0x488b('0x4a')]=function(_0x53d406,_0x2b19be){return db[_0x488b('0x2d')]['create'](_0x53d406[_0x488b('0x4b')],{})[_0x488b('0x25')](function(_0x2d3c95){var _0x1354b5=_0x53d406[_0x488b('0x4c')]['get']({'plain':!![]});if(!_0x1354b5)throw new Error(_0x488b('0x4d'));if(_0x1354b5[_0x488b('0x4e')]==='user'){var _0x570f58=_0x2d3c95[_0x488b('0x27')]({'plain':!![]});var _0x43ccdb=_0x488b('0x28');return db['UserProfileSection'][_0x488b('0x4f')]({'where':{'name':_0x43ccdb,'userProfileId':_0x1354b5['userProfileId']},'raw':!![]})[_0x488b('0x25')](function(_0x25a0ef){if(_0x25a0ef&&_0x25a0ef[_0x488b('0x50')]===0x0){return db[_0x488b('0x51')]['create']({'name':_0x570f58[_0x488b('0x31')],'resourceId':_0x570f58['id'],'type':_0x25a0ef[_0x488b('0x31')],'sectionId':_0x25a0ef['id']},{})[_0x488b('0x25')](function(){return _0x2d3c95;});}else{return _0x2d3c95;}})[_0x488b('0x44')](function(_0xa036a7){logger[_0x488b('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa036a7);throw _0xa036a7;});}return _0x2d3c95;})[_0x488b('0x25')](respondWithResult(_0x2b19be,0xc9))[_0x488b('0x44')](handleError(_0x2b19be,null));};exports[_0x488b('0x52')]=function(_0x32e4c5,_0x47eb77){if(_0x32e4c5[_0x488b('0x4b')]['id']){delete _0x32e4c5['body']['id'];}return db[_0x488b('0x2d')][_0x488b('0x4f')]({'where':{'id':_0x32e4c5[_0x488b('0x45')]['id']}})[_0x488b('0x25')](handleEntityNotFound(_0x47eb77,null))['then'](saveUpdates(_0x32e4c5['body'],null))['then'](respondWithResult(_0x47eb77,null))[_0x488b('0x44')](handleError(_0x47eb77,null));};exports['destroy']=function(_0x2f9f8c,_0x23b165){return db[_0x488b('0x2d')]['find']({'where':{'id':_0x2f9f8c[_0x488b('0x45')]['id']}})[_0x488b('0x25')](handleEntityNotFound(_0x23b165,null))[_0x488b('0x25')](removeEntity(_0x23b165,null))[_0x488b('0x44')](handleError(_0x23b165,null));};exports[_0x488b('0x53')]=function(_0x263f77,_0x4176d2,_0x160d93){var _0x1cc077=require(_0x488b('0x54'));return db[_0x488b('0x2d')][_0x488b('0x4f')]({'where':{'id':_0x263f77[_0x488b('0x45')]['id']},'raw':!![]})[_0x488b('0x25')](handleEntityNotFound(_0x4176d2,null))[_0x488b('0x25')](function(){_0x1cc077[_0x488b('0x53')](_0x263f77[_0x488b('0x45')]['id']);})[_0x488b('0x25')](respondWithStatusCode(_0x4176d2,null))[_0x488b('0x44')](handleError(_0x4176d2,null));}; \ No newline at end of file +var _0x5a3e=['end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','get','Scheduler','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','Schedule','includeAll','include','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status'];(function(_0x52ee2d,_0x4200c9){var _0x425468=function(_0x35f405){while(--_0x35f405){_0x52ee2d['push'](_0x52ee2d['shift']());}};_0x425468(++_0x4200c9);}(_0x5a3e,0x95));var _0xe5a3=function(_0x2860dc,_0x4a46fe){_0x2860dc=_0x2860dc-0x0;var _0x45ed72=_0x5a3e[_0x2860dc];return _0x45ed72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe5a3('0x0'));var zipdir=require(_0xe5a3('0x1'));var jsonpatch=require(_0xe5a3('0x2'));var rp=require('request-promise');var moment=require(_0xe5a3('0x3'));var BPromise=require(_0xe5a3('0x4'));var Mustache=require(_0xe5a3('0x5'));var util=require(_0xe5a3('0x6'));var path=require(_0xe5a3('0x7'));var sox=require(_0xe5a3('0x8'));var csv=require(_0xe5a3('0x9'));var ejs=require(_0xe5a3('0xa'));var fs=require('fs');var fs_extra=require(_0xe5a3('0xb'));var _=require(_0xe5a3('0xc'));var squel=require(_0xe5a3('0xd'));var crypto=require(_0xe5a3('0xe'));var jsforce=require(_0xe5a3('0xf'));var deskjs=require(_0xe5a3('0x10'));var toCsv=require(_0xe5a3('0x9'));var querystring=require(_0xe5a3('0x11'));var Papa=require(_0xe5a3('0x12'));var Redis=require(_0xe5a3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe5a3('0x14'));var as=require(_0xe5a3('0x15'));var hardwareService=require(_0xe5a3('0x16'));var logger=require(_0xe5a3('0x17'))(_0xe5a3('0x18'));var utils=require(_0xe5a3('0x19'));var config=require(_0xe5a3('0x1a'));var licenseUtil=require(_0xe5a3('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c53c3,_0x2dee37){_0x2dee37=_0x2dee37||0xcc;return function(_0x31c6ca){if(_0x31c6ca){return _0x3c53c3['sendStatus'](_0x2dee37);}return _0x3c53c3[_0xe5a3('0x1c')](_0x2dee37)[_0xe5a3('0x1d')]();};}function respondWithResult(_0x53f5a0,_0x58c6ac){_0x58c6ac=_0x58c6ac||0xc8;return function(_0x12a129){if(_0x12a129){return _0x53f5a0[_0xe5a3('0x1c')](_0x58c6ac)['json'](_0x12a129);}};}function respondWithFilteredResult(_0x423304,_0x553ffb){return function(_0x334598){if(_0x334598){var _0xe9330a=typeof _0x553ffb[_0xe5a3('0x1e')]===_0xe5a3('0x1f')&&typeof _0x553ffb['limit']==='undefined';var _0xa63ead=_0x334598[_0xe5a3('0x20')];var _0x5d41b5=_0xe9330a?0x0:_0x553ffb[_0xe5a3('0x1e')];var _0xcc9bae=_0xe9330a?_0x334598[_0xe5a3('0x20')]:_0x553ffb['offset']+_0x553ffb[_0xe5a3('0x21')];var _0x230300;if(_0xcc9bae>=_0xa63ead){_0xcc9bae=_0xa63ead;_0x230300=0xc8;}else{_0x230300=0xce;}_0x423304['status'](_0x230300);return _0x423304[_0xe5a3('0x22')](_0xe5a3('0x23'),_0x5d41b5+'-'+_0xcc9bae+'/'+_0xa63ead)[_0xe5a3('0x24')](_0x334598);}return null;};}function patchUpdates(_0x5ca204){return function(_0x3e4769){try{jsonpatch[_0xe5a3('0x25')](_0x3e4769,_0x5ca204,!![]);}catch(_0x4c19db){return BPromise['reject'](_0x4c19db);}return _0x3e4769[_0xe5a3('0x26')]();};}function saveUpdates(_0x384c90,_0x54e809){return function(_0x4e73b9){if(_0x4e73b9){return _0x4e73b9[_0xe5a3('0x27')](_0x384c90)['then'](function(_0x2a3ad2){return _0x2a3ad2;});}return null;};}function removeEntity(_0x53a50c,_0x561eda){return function(_0x138f58){if(_0x138f58){return _0x138f58[_0xe5a3('0x28')]()[_0xe5a3('0x29')](function(){var _0x3f5835=_0x138f58[_0xe5a3('0x2a')]({'plain':!![]});var _0x64b1dd=_0xe5a3('0x2b');return db[_0xe5a3('0x2c')][_0xe5a3('0x28')]({'where':{'type':_0x64b1dd,'resourceId':_0x3f5835['id']}})['then'](function(){return _0x138f58;});})[_0xe5a3('0x29')](function(){_0x53a50c[_0xe5a3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d90c3,_0x19255e){return function(_0x1bd2ac){if(!_0x1bd2ac){_0x3d90c3['sendStatus'](0x194);}return _0x1bd2ac;};}function handleError(_0x10c4ee,_0x473009){_0x473009=_0x473009||0x1f4;return function(_0x518545){logger[_0xe5a3('0x2d')](_0x518545[_0xe5a3('0x2e')]);if(_0x518545[_0xe5a3('0x2f')]){delete _0x518545[_0xe5a3('0x2f')];}_0x10c4ee[_0xe5a3('0x1c')](_0x473009)[_0xe5a3('0x30')](_0x518545);};}exports[_0xe5a3('0x31')]=function(_0x123eeb,_0x2e41f4){var _0x2937cc={},_0x4ccab4={},_0x2dbdcc={'count':0x0,'rows':[]};var _0x41492a=_[_0xe5a3('0x32')](db['Schedule'][_0xe5a3('0x33')],function(_0x2afeef){return{'name':_0x2afeef[_0xe5a3('0x34')],'type':_0x2afeef[_0xe5a3('0x35')][_0xe5a3('0x36')]};});_0x4ccab4[_0xe5a3('0x37')]=_[_0xe5a3('0x32')](_0x41492a,_0xe5a3('0x2f'));_0x4ccab4['query']=_[_0xe5a3('0x38')](_0x123eeb['query']);_0x4ccab4[_0xe5a3('0x39')]=_[_0xe5a3('0x3a')](_0x4ccab4['model'],_0x4ccab4[_0xe5a3('0x3b')]);_0x2937cc[_0xe5a3('0x3c')]=_[_0xe5a3('0x3a')](_0x4ccab4[_0xe5a3('0x37')],qs[_0xe5a3('0x3d')](_0x123eeb[_0xe5a3('0x3b')][_0xe5a3('0x3d')]));_0x2937cc['attributes']=_0x2937cc[_0xe5a3('0x3c')]['length']?_0x2937cc[_0xe5a3('0x3c')]:_0x4ccab4['model'];if(!_0x123eeb[_0xe5a3('0x3b')][_0xe5a3('0x3e')](_0xe5a3('0x3f'))){_0x2937cc[_0xe5a3('0x21')]=qs[_0xe5a3('0x21')](_0x123eeb[_0xe5a3('0x3b')][_0xe5a3('0x21')]);_0x2937cc[_0xe5a3('0x1e')]=qs[_0xe5a3('0x1e')](_0x123eeb[_0xe5a3('0x3b')][_0xe5a3('0x1e')]);}_0x2937cc[_0xe5a3('0x40')]=qs['sort'](_0x123eeb[_0xe5a3('0x3b')]['sort']);_0x2937cc[_0xe5a3('0x41')]=qs[_0xe5a3('0x39')](_[_0xe5a3('0x42')](_0x123eeb[_0xe5a3('0x3b')],_0x4ccab4['filters']),_0x41492a);if(_0x123eeb[_0xe5a3('0x3b')][_0xe5a3('0x43')]){_0x2937cc[_0xe5a3('0x41')]=_[_0xe5a3('0x44')](_0x2937cc['where'],{'$or':_[_0xe5a3('0x32')](_0x41492a,function(_0x5afea0){if(_0x5afea0[_0xe5a3('0x35')]!==_0xe5a3('0x45')){var _0x441824={};_0x441824[_0x5afea0[_0xe5a3('0x2f')]]={'$like':'%'+_0x123eeb['query'][_0xe5a3('0x43')]+'%'};return _0x441824;}})});}_0x2937cc=_[_0xe5a3('0x44')]({},_0x2937cc,_0x123eeb[_0xe5a3('0x46')]);var _0x248415={'where':_0x2937cc['where']};return db[_0xe5a3('0x47')][_0xe5a3('0x20')](_0x248415)[_0xe5a3('0x29')](function(_0x57f124){_0x2dbdcc[_0xe5a3('0x20')]=_0x57f124;if(_0x123eeb[_0xe5a3('0x3b')][_0xe5a3('0x48')]){_0x2937cc[_0xe5a3('0x49')]=[{'all':!![]}];}return db[_0xe5a3('0x47')]['findAll'](_0x2937cc);})['then'](function(_0x378866){_0x2dbdcc['rows']=_0x378866;return _0x2dbdcc;})['then'](respondWithFilteredResult(_0x2e41f4,_0x2937cc))[_0xe5a3('0x4a')](handleError(_0x2e41f4,null));};exports[_0xe5a3('0x4b')]=function(_0x190645,_0x49cbeb){var _0x5ed98c={'raw':![],'where':{'id':_0x190645[_0xe5a3('0x4c')]['id']}},_0x3e6daf={};_0x3e6daf[_0xe5a3('0x37')]=_[_0xe5a3('0x38')](db[_0xe5a3('0x47')][_0xe5a3('0x33')]);_0x3e6daf[_0xe5a3('0x3b')]=_[_0xe5a3('0x38')](_0x190645[_0xe5a3('0x3b')]);_0x3e6daf[_0xe5a3('0x39')]=_[_0xe5a3('0x3a')](_0x3e6daf['model'],_0x3e6daf['query']);_0x5ed98c['attributes']=_[_0xe5a3('0x3a')](_0x3e6daf[_0xe5a3('0x37')],qs['fields'](_0x190645[_0xe5a3('0x3b')]['fields']));_0x5ed98c[_0xe5a3('0x3c')]=_0x5ed98c[_0xe5a3('0x3c')][_0xe5a3('0x4d')]?_0x5ed98c[_0xe5a3('0x3c')]:_0x3e6daf['model'];if(_0x190645[_0xe5a3('0x3b')]['includeAll']){_0x5ed98c[_0xe5a3('0x49')]=[{'all':!![]}];}_0x5ed98c=_[_0xe5a3('0x44')]({},_0x5ed98c,_0x190645[_0xe5a3('0x46')]);return db['Schedule'][_0xe5a3('0x4e')](_0x5ed98c)[_0xe5a3('0x29')](handleEntityNotFound(_0x49cbeb,null))[_0xe5a3('0x29')](respondWithResult(_0x49cbeb,null))['catch'](handleError(_0x49cbeb,null));};exports[_0xe5a3('0x4f')]=function(_0x241c61,_0x287072){return db['Schedule'][_0xe5a3('0x4f')](_0x241c61['body'],{})[_0xe5a3('0x29')](function(_0x1c43e5){var _0x3457fb=_0x241c61[_0xe5a3('0x50')]['get']({'plain':!![]});if(!_0x3457fb)throw new Error(_0xe5a3('0x51'));if(_0x3457fb[_0xe5a3('0x52')]===_0xe5a3('0x50')){var _0x59b1d0=_0x1c43e5[_0xe5a3('0x2a')]({'plain':!![]});var _0x4258aa=_0xe5a3('0x2b');return db[_0xe5a3('0x53')]['find']({'where':{'name':_0x4258aa,'userProfileId':_0x3457fb[_0xe5a3('0x54')]},'raw':!![]})[_0xe5a3('0x29')](function(_0x4d0a70){if(_0x4d0a70&&_0x4d0a70[_0xe5a3('0x55')]===0x0){return db[_0xe5a3('0x2c')][_0xe5a3('0x4f')]({'name':_0x59b1d0[_0xe5a3('0x2f')],'resourceId':_0x59b1d0['id'],'type':_0x4d0a70[_0xe5a3('0x2f')],'sectionId':_0x4d0a70['id']},{})[_0xe5a3('0x29')](function(){return _0x1c43e5;});}else{return _0x1c43e5;}})[_0xe5a3('0x4a')](function(_0x252169){logger['error'](_0xe5a3('0x56'),_0x252169);throw _0x252169;});}return _0x1c43e5;})[_0xe5a3('0x29')](respondWithResult(_0x287072,0xc9))[_0xe5a3('0x4a')](handleError(_0x287072,null));};exports[_0xe5a3('0x27')]=function(_0x322b8a,_0x340910){if(_0x322b8a[_0xe5a3('0x57')]['id']){delete _0x322b8a[_0xe5a3('0x57')]['id'];}return db['Schedule'][_0xe5a3('0x4e')]({'where':{'id':_0x322b8a[_0xe5a3('0x4c')]['id']}})[_0xe5a3('0x29')](handleEntityNotFound(_0x340910,null))[_0xe5a3('0x29')](saveUpdates(_0x322b8a['body'],null))[_0xe5a3('0x29')](respondWithResult(_0x340910,null))[_0xe5a3('0x4a')](handleError(_0x340910,null));};exports['destroy']=function(_0xf44ea8,_0x28089f){return db[_0xe5a3('0x47')]['find']({'where':{'id':_0xf44ea8[_0xe5a3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x28089f,null))[_0xe5a3('0x29')](removeEntity(_0x28089f,null))['catch'](handleError(_0x28089f,null));};exports[_0xe5a3('0x58')]=function(_0x592785,_0x47bbac,_0x529935){var _0x3eb2f1=require('../../config/schedule');return db[_0xe5a3('0x47')][_0xe5a3('0x4e')]({'where':{'id':_0x592785[_0xe5a3('0x4c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x47bbac,null))[_0xe5a3('0x29')](function(){_0x3eb2f1[_0xe5a3('0x58')](_0x592785[_0xe5a3('0x4c')]['id']);})['then'](respondWithStatusCode(_0x47bbac,null))['catch'](handleError(_0x47bbac,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 7e5ad25..8646ef0 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 _0xc397=['bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','moment'];(function(_0x173cdf,_0xcad472){var _0x21c1f6=function(_0x5640fb){while(--_0x5640fb){_0x173cdf['push'](_0x173cdf['shift']());}};_0x21c1f6(++_0xcad472);}(_0xc397,0x13e));var _0x7c39=function(_0x2bef0c,_0x47f6c1){_0x2bef0c=_0x2bef0c-0x0;var _0x4e0da4=_0xc397[_0x2bef0c];return _0x4e0da4;};'use strict';var _=require(_0x7c39('0x0'));var util=require(_0x7c39('0x1'));var logger=require(_0x7c39('0x2'))('api');var moment=require(_0x7c39('0x3'));var BPromise=require(_0x7c39('0x4'));var rp=require(_0x7c39('0x5'));var fs=require('fs');var path=require(_0x7c39('0x6'));var rimraf=require(_0x7c39('0x7'));var config=require(_0x7c39('0x8'));var attributes=require(_0x7c39('0x9'));module[_0x7c39('0xa')]=function(_0x542ede,_0x23e10f){return _0x542ede[_0x7c39('0xb')](_0x7c39('0xc'),attributes,{'tableName':_0x7c39('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44ab=['tools_schedules','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x44ab,0x1c8));var _0xb44a=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x44ab[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0xb44a('0x0'));var util=require(_0xb44a('0x1'));var logger=require('../../config/logger')(_0xb44a('0x2'));var moment=require('moment');var BPromise=require(_0xb44a('0x3'));var rp=require(_0xb44a('0x4'));var fs=require('fs');var path=require(_0xb44a('0x5'));var rimraf=require(_0xb44a('0x6'));var config=require(_0xb44a('0x7'));var attributes=require(_0xb44a('0x8'));module[_0xb44a('0x9')]=function(_0x3ec753,_0x314b66){return _0x3ec753[_0xb44a('0xa')](_0xb44a('0xb'),attributes,{'tableName':_0xb44a('0xc'),'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 4dc4794..8b1b8eb 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 _0xbde8=['Schedule,\x20%s,\x20%s,\x20%s','error','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x9e9ead,_0x1a7ff3){var _0x31ff57=function(_0x22a9da){while(--_0x22a9da){_0x9e9ead['push'](_0x9e9ead['shift']());}};_0x31ff57(++_0x1a7ff3);}(_0xbde8,0x11d));var _0x8bde=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0xbde8[_0x37a7c6];return _0x539905;};'use strict';var _=require(_0x8bde('0x0'));var util=require(_0x8bde('0x1'));var moment=require('moment');var BPromise=require(_0x8bde('0x2'));var rs=require(_0x8bde('0x3'));var fs=require('fs');var Redis=require(_0x8bde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bde('0x5'));var logger=require(_0x8bde('0x6'))('rpc');var config=require(_0x8bde('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8bde('0x8')][_0x8bde('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b881a,_0x4f2469,_0x174351){return new BPromise(function(_0x3366f0,_0x27cc62){return client[_0x8bde('0xa')](_0x4b881a,_0x174351)[_0x8bde('0xb')](function(_0x3ebaf9){logger['info'](_0x8bde('0xc'),_0x4f2469,_0x8bde('0xd'));logger[_0x8bde('0xe')](_0x8bde('0xf'),_0x4f2469,'request\x20sent',JSON['stringify'](_0x3ebaf9));if(_0x3ebaf9[_0x8bde('0x10')]){if(_0x3ebaf9[_0x8bde('0x10')]['code']===0x1f4){logger[_0x8bde('0x10')]('Schedule,\x20%s,\x20%s',_0x4f2469,_0x3ebaf9[_0x8bde('0x10')][_0x8bde('0x11')]);return _0x27cc62(_0x3ebaf9[_0x8bde('0x10')][_0x8bde('0x11')]);}logger[_0x8bde('0x10')]('Schedule,\x20%s,\x20%s',_0x4f2469,_0x3ebaf9[_0x8bde('0x10')][_0x8bde('0x11')]);return _0x3366f0(_0x3ebaf9[_0x8bde('0x10')][_0x8bde('0x11')]);}else{logger[_0x8bde('0x12')](_0x8bde('0xc'),_0x4f2469,_0x8bde('0xd'));_0x3366f0(_0x3ebaf9['result']['message']);}})[_0x8bde('0x13')](function(_0x3706a2){logger[_0x8bde('0x10')](_0x8bde('0xc'),_0x4f2469,_0x3706a2);_0x27cc62(_0x3706a2);});});} \ No newline at end of file +var _0xc5e6=['rpc','../../config/environment','jayson/promise','client','http','then','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','../../mysqldb'];(function(_0x48fa0d,_0x5a72b1){var _0x287748=function(_0x5c3d9a){while(--_0x5c3d9a){_0x48fa0d['push'](_0x48fa0d['shift']());}};_0x287748(++_0x5a72b1);}(_0xc5e6,0x106));var _0x6c5e=function(_0x4072d0,_0x2c84bd){_0x4072d0=_0x4072d0-0x0;var _0x2fc971=_0xc5e6[_0x4072d0];return _0x2fc971;};'use strict';var _=require(_0x6c5e('0x0'));var util=require('util');var moment=require(_0x6c5e('0x1'));var BPromise=require(_0x6c5e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c5e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6c5e('0x4'));var config=require(_0x6c5e('0x5'));var jayson=require(_0x6c5e('0x6'));var client=jayson[_0x6c5e('0x7')][_0x6c5e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58e326,_0x4d88b1,_0x79d670){return new BPromise(function(_0x4e58df,_0x3cfd23){return client['request'](_0x58e326,_0x79d670)[_0x6c5e('0x9')](function(_0x702e8c){logger['info'](_0x6c5e('0xa'),_0x4d88b1,_0x6c5e('0xb'));logger['debug'](_0x6c5e('0xc'),_0x4d88b1,'request\x20sent',JSON[_0x6c5e('0xd')](_0x702e8c));if(_0x702e8c['error']){if(_0x702e8c[_0x6c5e('0xe')]['code']===0x1f4){logger[_0x6c5e('0xe')](_0x6c5e('0xa'),_0x4d88b1,_0x702e8c['error'][_0x6c5e('0xf')]);return _0x3cfd23(_0x702e8c[_0x6c5e('0xe')]['message']);}logger['error'](_0x6c5e('0xa'),_0x4d88b1,_0x702e8c[_0x6c5e('0xe')][_0x6c5e('0xf')]);return _0x4e58df(_0x702e8c[_0x6c5e('0xe')][_0x6c5e('0xf')]);}else{logger[_0x6c5e('0x10')]('Schedule,\x20%s,\x20%s',_0x4d88b1,_0x6c5e('0xb'));_0x4e58df(_0x702e8c[_0x6c5e('0x11')]['message']);}})[_0x6c5e('0x12')](function(_0x2bde2a){logger[_0x6c5e('0xe')](_0x6c5e('0xa'),_0x4d88b1,_0x2bde2a);_0x3cfd23(_0x2bde2a);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index c4add21..7c35097 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 _0xb23f=['describe','/:id','isAuthenticated','show','get','/:id/download','download','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','index','/describe'];(function(_0x1c9801,_0x17b7a2){var _0x3fd117=function(_0x50e93b){while(--_0x50e93b){_0x1c9801['push'](_0x1c9801['shift']());}};_0x3fd117(++_0x17b7a2);}(_0xb23f,0xad));var _0xfb23=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb23f[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xfb23('0x0'));var util=require(_0xfb23('0x1'));var path=require(_0xfb23('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb23('0x3'));var router=express[_0xfb23('0x4')]();var fs_extra=require(_0xfb23('0x5'));var auth=require(_0xfb23('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfb23('0x7'));var controller=require(_0xfb23('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfb23('0x9')]);router['get'](_0xfb23('0xa'),auth['isAuthenticated'](),controller[_0xfb23('0xb')]);router['get'](_0xfb23('0xc'),auth[_0xfb23('0xd')](),controller[_0xfb23('0xe')]);router[_0xfb23('0xf')](_0xfb23('0x10'),auth['isAuthenticated'](),controller[_0xfb23('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfb23('0x12')](_0xfb23('0xc'),auth[_0xfb23('0xd')](),controller[_0xfb23('0x13')]);router[_0xfb23('0x14')]('/:id',auth[_0xfb23('0xd')](),controller[_0xfb23('0x15')]);module[_0xfb23('0x16')]=router; \ No newline at end of file +var _0x8119=['isAuthenticated','describe','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','/describe'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8119,0xc8));var _0x9811=function(_0x23a299,_0x30e49c){_0x23a299=_0x23a299-0x0;var _0x560bb3=_0x8119[_0x23a299];return _0x560bb3;};'use strict';var multer=require(_0x9811('0x0'));var util=require(_0x9811('0x1'));var path=require(_0x9811('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9811('0x3')]();var fs_extra=require(_0x9811('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9811('0x5'));var config=require(_0x9811('0x6'));var controller=require(_0x9811('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9811('0x8')](_0x9811('0x9'),auth[_0x9811('0xa')](),controller[_0x9811('0xb')]);router[_0x9811('0x8')](_0x9811('0xc'),auth['isAuthenticated'](),controller[_0x9811('0xd')]);router[_0x9811('0x8')](_0x9811('0xe'),auth[_0x9811('0xa')](),controller[_0x9811('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9811('0x10')]);router[_0x9811('0x11')](_0x9811('0xc'),auth[_0x9811('0xa')](),controller[_0x9811('0x12')]);router[_0x9811('0x13')]('/:id',auth[_0x9811('0xa')](),controller[_0x9811('0x14')]);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 0bd86ac..f196851 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 _0xdac7=['duration','format','toString','MM-DD-YYYY\x20HH:mm','DATE','updatedAt','sequelize','moment','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt'];(function(_0x14f7fe,_0x5132c4){var _0x3d8309=function(_0x22f5c7){while(--_0x22f5c7){_0x14f7fe['push'](_0x14f7fe['shift']());}};_0x3d8309(++_0x5132c4);}(_0xdac7,0x180));var _0x7dac=function(_0x2292a3,_0x509a3b){_0x2292a3=_0x2292a3-0x0;var _0x2f61fb=_0xdac7[_0x2292a3];return _0x2f61fb;};'use strict';var Sequelize=require(_0x7dac('0x0'));var moment=require(_0x7dac('0x1'));var path=require('path');var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x7dac('0x2')],'get':function(){return this[_0x7dac('0x3')](_0x7dac('0x4'))?path[_0x7dac('0x5')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7dac('0x6')]},'value':{'type':Sequelize[_0x7dac('0x6')],'set':function(_0x505705){var _0x28cc84=_0x505705['replace'](/\\/g,'/');this[_0x7dac('0x7')]('value',_0x28cc84);}},'rating':{'type':Sequelize[_0x7dac('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x7dac('0x8')],'set':function(_0x45fbdc){this[_0x7dac('0x7')](_0x7dac('0x9'),moment()[_0x7dac('0xa')](_0x45fbdc,'ms'));this[_0x7dac('0x7')](_0x7dac('0xb'),moment());this[_0x7dac('0x7')](_0x7dac('0xc'),_0x45fbdc);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x7dac('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x7dac('0xe')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x7dac('0x3')](_0x7dac('0xb')))[_0x7dac('0xd')](_0x7dac('0xf'))[_0x7dac('0xe')]();}},'createdAt':{'type':Sequelize[_0x7dac('0x10')],'get':function(){return moment(this[_0x7dac('0x3')]('createdAt'))[_0x7dac('0xd')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0x7dac('0x10')],'get':function(){return moment(this[_0x7dac('0x3')](_0x7dac('0x11')))[_0x7dac('0xd')](_0x7dac('0xf'))['toString']();}}}; \ No newline at end of file +var _0xf29d=['DATE','startedAt','format','toString','createdAt','MM-DD-YYYY\x20HH:mm','sequelize','moment','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','closedAt','duration'];(function(_0x12d5e9,_0x1decd6){var _0x343939=function(_0x36ea80){while(--_0x36ea80){_0x12d5e9['push'](_0x12d5e9['shift']());}};_0x343939(++_0x1decd6);}(_0xf29d,0xc4));var _0xdf29=function(_0x341aa3,_0xa93441){_0x341aa3=_0x341aa3-0x0;var _0x55ed7e=_0xf29d[_0x341aa3];return _0x55ed7e;};'use strict';var Sequelize=require(_0xdf29('0x0'));var moment=require(_0xdf29('0x1'));var path=require('path');var config=require(_0xdf29('0x2'));module[_0xdf29('0x3')]={'format':{'type':Sequelize[_0xdf29('0x4')],'get':function(){return this[_0xdf29('0x5')](_0xdf29('0x6'))?path['extname'](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0xdf29('0x7')]},'channel':{'type':Sequelize[_0xdf29('0x7')]},'value':{'type':Sequelize[_0xdf29('0x7')],'set':function(_0x4b648e){var _0x39b352=_0x4b648e[_0xdf29('0x8')](/\\/g,'/');this[_0xdf29('0x9')]('value',_0x39b352);}},'rating':{'type':Sequelize[_0xdf29('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdf29('0xa')],'set':function(_0x1fb3f1){this[_0xdf29('0x9')]('startedAt',moment()['subtract'](_0x1fb3f1,'ms'));this[_0xdf29('0x9')](_0xdf29('0xb'),moment());this['setDataValue'](_0xdf29('0xc'),_0x1fb3f1);}},'startedAt':{'type':Sequelize[_0xdf29('0xd')],'get':function(){return moment(this[_0xdf29('0x5')](_0xdf29('0xe')))[_0xdf29('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xdf29('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdf29('0x5')](_0xdf29('0xb')))[_0xdf29('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xdf29('0x10')]();}},'createdAt':{'type':Sequelize[_0xdf29('0xd')],'get':function(){return moment(this['getDataValue'](_0xdf29('0x11')))[_0xdf29('0xf')](_0xdf29('0x12'))['toString']();}},'updatedAt':{'type':Sequelize[_0xdf29('0xd')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0xdf29('0xf')](_0xdf29('0x12'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 15fe699..11bb372 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 _0x7dfd=['../../components/encryptor','uniqueid','join','%s.cypher','existsSync','decryptFile','secrets','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','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','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','stack','name','send','index','ScreenRecording','fieldName','key','model','map','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','catch','create','body','duration','createdAt','closedAt','value','find','describe','download'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd7df('0x0'));var rimraf=require(_0xd7df('0x1'));var zipdir=require(_0xd7df('0x2'));var jsonpatch=require(_0xd7df('0x3'));var rp=require(_0xd7df('0x4'));var moment=require(_0xd7df('0x5'));var BPromise=require(_0xd7df('0x6'));var Mustache=require(_0xd7df('0x7'));var util=require(_0xd7df('0x8'));var path=require(_0xd7df('0x9'));var sox=require(_0xd7df('0xa'));var csv=require(_0xd7df('0xb'));var ejs=require(_0xd7df('0xc'));var fs=require('fs');var fs_extra=require(_0xd7df('0xd'));var _=require(_0xd7df('0xe'));var squel=require(_0xd7df('0xf'));var crypto=require(_0xd7df('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd7df('0x11'));var toCsv=require(_0xd7df('0xb'));var querystring=require(_0xd7df('0x12'));var Papa=require(_0xd7df('0x13'));var Redis=require('ioredis');var authService=require(_0xd7df('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd7df('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7df('0x16'))(_0xd7df('0x17'));var utils=require(_0xd7df('0x18'));var config=require(_0xd7df('0x19'));var licenseUtil=require(_0xd7df('0x1a'));var db=require(_0xd7df('0x1b'))['db'];function respondWithStatusCode(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xcc;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x1c')](_0x3da618);}return _0x2e8187[_0xd7df('0x1d')](_0x3da618)[_0xd7df('0x1e')]();};}function respondWithResult(_0xe1595f,_0x196632){_0x196632=_0x196632||0xc8;return function(_0x3b2559){if(_0x3b2559){return _0xe1595f[_0xd7df('0x1d')](_0x196632)[_0xd7df('0x1f')](_0x3b2559);}};}function respondWithFilteredResult(_0x57b8be,_0x4c5cf){return function(_0x23cdbc){if(_0x23cdbc){var _0x513b13=typeof _0x4c5cf[_0xd7df('0x20')]===_0xd7df('0x21')&&typeof _0x4c5cf['limit']===_0xd7df('0x21');var _0x30ee65=_0x23cdbc[_0xd7df('0x22')];var _0x5210e5=_0x513b13?0x0:_0x4c5cf[_0xd7df('0x20')];var _0x471621=_0x513b13?_0x23cdbc[_0xd7df('0x22')]:_0x4c5cf['offset']+_0x4c5cf[_0xd7df('0x23')];var _0x20dc3e;if(_0x471621>=_0x30ee65){_0x471621=_0x30ee65;_0x20dc3e=0xc8;}else{_0x20dc3e=0xce;}_0x57b8be[_0xd7df('0x1d')](_0x20dc3e);return _0x57b8be['set'](_0xd7df('0x24'),_0x5210e5+'-'+_0x471621+'/'+_0x30ee65)['json'](_0x23cdbc);}return null;};}function patchUpdates(_0x225e33){return function(_0x5ab737){try{jsonpatch[_0xd7df('0x25')](_0x5ab737,_0x225e33,!![]);}catch(_0x342b54){return BPromise[_0xd7df('0x26')](_0x342b54);}return _0x5ab737['save']();};}function saveUpdates(_0xc50077,_0x502ae8){return function(_0x44079b){if(_0x44079b){return _0x44079b[_0xd7df('0x27')](_0xc50077)[_0xd7df('0x28')](function(_0x29f354){return _0x29f354;});}return null;};}function removeEntity(_0x1c774b,_0xa80cbf){return function(_0x1e3bf3){if(_0x1e3bf3){return _0x1e3bf3['destroy']()['then'](function(){_0x1c774b[_0xd7df('0x1d')](0xcc)[_0xd7df('0x1e')]();});}};}function handleEntityNotFound(_0x26047f,_0x459f11){return function(_0x13f190){if(!_0x13f190){_0x26047f[_0xd7df('0x1c')](0x194);}return _0x13f190;};}function handleError(_0x373359,_0x2b6fde){_0x2b6fde=_0x2b6fde||0x1f4;return function(_0x163904){logger['error'](_0x163904[_0xd7df('0x29')]);if(_0x163904[_0xd7df('0x2a')]){delete _0x163904[_0xd7df('0x2a')];}_0x373359[_0xd7df('0x1d')](_0x2b6fde)[_0xd7df('0x2b')](_0x163904);};}exports[_0xd7df('0x2c')]=function(_0x3f78fa,_0x36de76){var _0x5195cf={},_0x4ba779={},_0x52b56a={'count':0x0,'rows':[]};var _0x58584d=_['map'](db[_0xd7df('0x2d')]['rawAttributes'],function(_0xd366b){return{'name':_0xd366b[_0xd7df('0x2e')],'type':_0xd366b['type'][_0xd7df('0x2f')]};});_0x4ba779[_0xd7df('0x30')]=_['differenceBy'](_[_0xd7df('0x31')](_0x58584d,_0xd7df('0x2a')),[_0xd7df('0x32')]);_0x4ba779[_0xd7df('0x33')]=_[_0xd7df('0x34')](_0x3f78fa[_0xd7df('0x33')]);_0x4ba779['filters']=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],_0x4ba779[_0xd7df('0x33')]);_0x5195cf[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5195cf[_0xd7df('0x36')]=_0x5195cf[_0xd7df('0x36')]['length']?_0x5195cf['attributes']:_0x4ba779[_0xd7df('0x30')];if(!_0x3f78fa['query'][_0xd7df('0x38')](_0xd7df('0x39'))){_0x5195cf[_0xd7df('0x23')]=qs[_0xd7df('0x23')](_0x3f78fa['query']['limit']);_0x5195cf['offset']=qs[_0xd7df('0x20')](_0x3f78fa[_0xd7df('0x33')]['offset']);}_0x5195cf[_0xd7df('0x3a')]=qs[_0xd7df('0x3b')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3b')]);_0x5195cf['where']=qs[_0xd7df('0x3c')](_[_0xd7df('0x3d')](_0x3f78fa['query'],_0x4ba779[_0xd7df('0x3c')]),_0x58584d);if(_0x3f78fa['query'][_0xd7df('0x3e')]){_0x5195cf[_0xd7df('0x3f')]=_[_0xd7df('0x40')](_0x5195cf['where'],{'$or':_[_0xd7df('0x31')](_0x58584d,function(_0x2a7252){if(_0x2a7252[_0xd7df('0x41')]!==_0xd7df('0x42')){var _0x54ea42={};_0x54ea42[_0x2a7252[_0xd7df('0x2a')]]={'$like':'%'+_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3e')]+'%'};return _0x54ea42;}})});}_0x5195cf=_['merge']({},_0x5195cf,_0x3f78fa[_0xd7df('0x43')]);var _0x207852={'where':_0x5195cf[_0xd7df('0x3f')]};return db['ScreenRecording'][_0xd7df('0x22')](_0x207852)[_0xd7df('0x28')](function(_0x4910cb){_0x52b56a['count']=_0x4910cb;if(_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5195cf[_0xd7df('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x5195cf);})[_0xd7df('0x28')](function(_0x4ebdbe){_0x52b56a[_0xd7df('0x46')]=_0x4ebdbe;return _0x52b56a;})['then'](respondWithFilteredResult(_0x36de76,_0x5195cf))['catch'](handleError(_0x36de76,null));};exports[_0xd7df('0x47')]=function(_0x579d0f,_0x18ef10){var _0x5302f4={'raw':![],'where':{'id':_0x579d0f[_0xd7df('0x48')]['id']}},_0xad2d69={};_0xad2d69[_0xd7df('0x30')]=_[_0xd7df('0x34')](db[_0xd7df('0x2d')][_0xd7df('0x49')]);_0xad2d69[_0xd7df('0x33')]=_['keys'](_0x579d0f[_0xd7df('0x33')]);_0xad2d69['filters']=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],_0xad2d69[_0xd7df('0x33')]);_0x5302f4[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x579d0f[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5302f4['attributes']=_0x5302f4[_0xd7df('0x36')][_0xd7df('0x4a')]?_0x5302f4['attributes']:_0xad2d69['model'];if(_0x579d0f[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5302f4[_0xd7df('0x45')]=[{'all':!![]}];}_0x5302f4=_['merge']({},_0x5302f4,_0x579d0f['options']);return db[_0xd7df('0x2d')]['find'](_0x5302f4)[_0xd7df('0x28')](handleEntityNotFound(_0x18ef10,null))[_0xd7df('0x28')](respondWithResult(_0x18ef10,null))[_0xd7df('0x4b')](handleError(_0x18ef10,null));};exports[_0xd7df('0x4c')]=function(_0x1838aa,_0x28c13f){return db[_0xd7df('0x2d')][_0xd7df('0x4c')](_0x1838aa[_0xd7df('0x4d')],{})[_0xd7df('0x28')](respondWithResult(_0x28c13f,0xc9))[_0xd7df('0x4b')](handleError(_0x28c13f,null));};exports[_0xd7df('0x27')]=function(_0x54222c,_0x1f2f99){if(_0x54222c[_0xd7df('0x4d')]['id']){delete _0x54222c[_0xd7df('0x4d')]['id'];}delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x4e')];delete _0x54222c['body'][_0xd7df('0x4f')];delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x50')];delete _0x54222c['body'][_0xd7df('0x51')];return db['ScreenRecording'][_0xd7df('0x52')]({'where':{'id':_0x54222c[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x1f2f99,null))[_0xd7df('0x28')](saveUpdates(_0x54222c[_0xd7df('0x4d')],null))['then'](respondWithResult(_0x1f2f99,null))['catch'](handleError(_0x1f2f99,null));};exports['describe']=function(_0xe4b221,_0x4a6cf5){return db[_0xd7df('0x2d')][_0xd7df('0x53')]()[_0xd7df('0x28')](respondWithResult(_0x4a6cf5,null))[_0xd7df('0x4b')](handleError(_0x4a6cf5,null));};exports[_0xd7df('0x54')]=function(_0x418da,_0xf72803,_0xb054d7){var _0x453876=require(_0xd7df('0x55'));var _0x382d11=![];var _0x327365={};if(_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]&&_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]==='uniqueid'){_0x327365[_0xd7df('0x56')]=_0x418da[_0xd7df('0x48')]['id'];}else{_0x327365['id']=_0x418da['params']['id'];}return db['ScreenRecording'][_0xd7df('0x52')]({'where':_0x327365,'attributes':['id','value'],'raw':!![]})[_0xd7df('0x28')](handleEntityNotFound(_0xf72803,null))['then'](function(_0x1f34c2){if(_0x1f34c2){var _0x28151a=path[_0xd7df('0x57')](config['root'],'server/files/screen_recordings',_0x1f34c2['value']);var _0x3666ba=util[_0xd7df('0x32')](_0xd7df('0x58'),_0x28151a);if(fs[_0xd7df('0x59')](_0x3666ba)){_0x382d11=!![];return _0x453876[_0xd7df('0x5a')](_0x3666ba,_0x28151a,config[_0xd7df('0x5b')]['recording'])[_0xd7df('0x28')](function(){return _0x1f34c2;});}return _0x1f34c2;}})[_0xd7df('0x28')](function(_0x35204f){if(_0x35204f){var _0x25d187=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x35204f[_0xd7df('0x51')]);if(!fs[_0xd7df('0x59')](_0x25d187)){throw new db[(_0xd7df('0x5e'))][(_0xd7df('0x5f'))](_0xd7df('0x60'));}if(_0x35204f[_0xd7df('0x61')]){return _0xf72803[_0xd7df('0x54')](_0x25d187,_0x35204f[_0xd7df('0x61')]+path[_0xd7df('0x62')](_0x25d187),function(){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}else{return _0xf72803[_0xd7df('0x54')](_0x25d187,function(_0x3f2775){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}}})[_0xd7df('0x4b')](function(_0x393a3a){if(_0x393a3a[_0xd7df('0x64')]===_0xd7df('0x60')){_0xf72803[_0xd7df('0x1d')](0x194)[_0xd7df('0x2b')]('Not\x20found');}else{return handleError(_0xf72803,null);}});};exports['destroy']=function(_0x327402,_0x28f550){return db[_0xd7df('0x2d')]['find']({'where':{'id':_0x327402[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](function(_0x1e87aa){if(_[_0xd7df('0x65')](_0x1e87aa)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1e87aa;})[_0xd7df('0x28')](function(_0x20ad50){var _0xb06a56=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x20ad50[_0xd7df('0x51')]);logger[_0xd7df('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0xb06a56);if(!_[_0xd7df('0x65')](_0x20ad50[_0xd7df('0x51')])&&fs['existsSync'](_0xb06a56)){logger['info']('File:\x20\x22'+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}_0xb06a56=_0xb06a56+_0xd7df('0x69');if(!_[_0xd7df('0x65')](_0x20ad50['value'])&&fs[_0xd7df('0x59')](_0xb06a56)){logger[_0xd7df('0x66')](_0xd7df('0x6a')+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}return _0x20ad50;})[_0xd7df('0x28')](function(_0x4124b8){if(!_0x4124b8)throw new InternalError();return _0x4124b8['destroy']();})['then'](function(){_0x28f550[_0xd7df('0x1d')](0xcc)['end']();})[_0xd7df('0x4b')](handleError(_0x28f550,null));}; \ No newline at end of file +var _0x6aa7=['fieldName','type','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','find','catch','create','body','duration','createdAt','closedAt','params','describe','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','download','message','Not\x20found','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','rawAttributes'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x6aa7,0x178));var _0x76aa=function(_0x11960e,_0x1d973b){_0x11960e=_0x11960e-0x0;var _0xa770d2=_0x6aa7[_0x11960e];return _0xa770d2;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x26b75e,_0x3599a9){return function(_0x4ef9b0){if(!_0x4ef9b0){_0x26b75e[_0x76aa('0x19')](0x194);}return _0x4ef9b0;};}function handleError(_0x1d6d15,_0x25c614){_0x25c614=_0x25c614||0x1f4;return function(_0x2e7ab4){logger[_0x76aa('0x29')](_0x2e7ab4[_0x76aa('0x2a')]);if(_0x2e7ab4[_0x76aa('0x2b')]){delete _0x2e7ab4[_0x76aa('0x2b')];}_0x1d6d15[_0x76aa('0x1a')](_0x25c614)[_0x76aa('0x2c')](_0x2e7ab4);};}exports['index']=function(_0x3fcb7f,_0x5a8030){var _0x994550={},_0x365ff8={},_0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x2d')](db[_0x76aa('0x2e')][_0x76aa('0x2f')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x30')],'type':_0x3827ec[_0x76aa('0x31')]['key']};});_0x365ff8[_0x76aa('0x32')]=_[_0x76aa('0x33')](_[_0x76aa('0x2d')](_0x1e90b9,_0x76aa('0x2b')),[_0x76aa('0x34')]);_0x365ff8[_0x76aa('0x35')]=_[_0x76aa('0x36')](_0x3fcb7f['query']);_0x365ff8[_0x76aa('0x37')]=_[_0x76aa('0x38')](_0x365ff8['model'],_0x365ff8[_0x76aa('0x35')]);_0x994550['attributes']=_[_0x76aa('0x38')](_0x365ff8['model'],qs[_0x76aa('0x39')](_0x3fcb7f['query']['fields']));_0x994550[_0x76aa('0x3a')]=_0x994550[_0x76aa('0x3a')][_0x76aa('0x3b')]?_0x994550[_0x76aa('0x3a')]:_0x365ff8['model'];if(!_0x3fcb7f['query'][_0x76aa('0x3c')](_0x76aa('0x3d'))){_0x994550[_0x76aa('0x1f')]=qs[_0x76aa('0x1f')](_0x3fcb7f[_0x76aa('0x35')]['limit']);_0x994550[_0x76aa('0x1e')]=qs['offset'](_0x3fcb7f['query'][_0x76aa('0x1e')]);}_0x994550[_0x76aa('0x3e')]=qs[_0x76aa('0x3f')](_0x3fcb7f[_0x76aa('0x35')]['sort']);_0x994550[_0x76aa('0x40')]=qs[_0x76aa('0x37')](_[_0x76aa('0x41')](_0x3fcb7f['query'],_0x365ff8[_0x76aa('0x37')]),_0x1e90b9);if(_0x3fcb7f[_0x76aa('0x35')][_0x76aa('0x42')]){_0x994550[_0x76aa('0x40')]=_[_0x76aa('0x43')](_0x994550[_0x76aa('0x40')],{'$or':_[_0x76aa('0x2d')](_0x1e90b9,function(_0x307d67){if(_0x307d67[_0x76aa('0x31')]!=='VIRTUAL'){var _0x1525cb={};_0x1525cb[_0x307d67[_0x76aa('0x2b')]]={'$like':'%'+_0x3fcb7f[_0x76aa('0x35')][_0x76aa('0x42')]+'%'};return _0x1525cb;}})});}_0x994550=_[_0x76aa('0x43')]({},_0x994550,_0x3fcb7f[_0x76aa('0x44')]);var _0x572fdb={'where':_0x994550['where']};return db[_0x76aa('0x2e')][_0x76aa('0x1d')](_0x572fdb)[_0x76aa('0x27')](function(_0x365612){_0x2dec94['count']=_0x365612;if(_0x3fcb7f[_0x76aa('0x35')][_0x76aa('0x45')]){_0x994550[_0x76aa('0x46')]=[{'all':!![]}];}return db[_0x76aa('0x2e')][_0x76aa('0x47')](_0x994550);})['then'](function(_0x13dafe){_0x2dec94['rows']=_0x13dafe;return _0x2dec94;})[_0x76aa('0x27')](respondWithFilteredResult(_0x5a8030,_0x994550))['catch'](handleError(_0x5a8030,null));};exports['show']=function(_0x4f7f3a,_0x144f0a){var _0x541594={'raw':![],'where':{'id':_0x4f7f3a['params']['id']}},_0x5cf314={};_0x5cf314[_0x76aa('0x32')]=_[_0x76aa('0x36')](db[_0x76aa('0x2e')][_0x76aa('0x2f')]);_0x5cf314[_0x76aa('0x35')]=_['keys'](_0x4f7f3a[_0x76aa('0x35')]);_0x5cf314[_0x76aa('0x37')]=_[_0x76aa('0x38')](_0x5cf314[_0x76aa('0x32')],_0x5cf314[_0x76aa('0x35')]);_0x541594['attributes']=_[_0x76aa('0x38')](_0x5cf314[_0x76aa('0x32')],qs['fields'](_0x4f7f3a[_0x76aa('0x35')]['fields']));_0x541594[_0x76aa('0x3a')]=_0x541594[_0x76aa('0x3a')][_0x76aa('0x3b')]?_0x541594[_0x76aa('0x3a')]:_0x5cf314[_0x76aa('0x32')];if(_0x4f7f3a[_0x76aa('0x35')][_0x76aa('0x45')]){_0x541594[_0x76aa('0x46')]=[{'all':!![]}];}_0x541594=_[_0x76aa('0x43')]({},_0x541594,_0x4f7f3a[_0x76aa('0x44')]);return db['ScreenRecording'][_0x76aa('0x48')](_0x541594)['then'](handleEntityNotFound(_0x144f0a,null))[_0x76aa('0x27')](respondWithResult(_0x144f0a,null))[_0x76aa('0x49')](handleError(_0x144f0a,null));};exports[_0x76aa('0x4a')]=function(_0x156d4e,_0x5ca721){return db['ScreenRecording'][_0x76aa('0x4a')](_0x156d4e['body'],{})[_0x76aa('0x27')](respondWithResult(_0x5ca721,0xc9))[_0x76aa('0x49')](handleError(_0x5ca721,null));};exports[_0x76aa('0x26')]=function(_0x2e5633,_0x30c577){if(_0x2e5633[_0x76aa('0x4b')]['id']){delete _0x2e5633['body']['id'];}delete _0x2e5633['body'][_0x76aa('0x4c')];delete _0x2e5633[_0x76aa('0x4b')][_0x76aa('0x4d')];delete _0x2e5633[_0x76aa('0x4b')][_0x76aa('0x4e')];delete _0x2e5633[_0x76aa('0x4b')]['value'];return db[_0x76aa('0x2e')][_0x76aa('0x48')]({'where':{'id':_0x2e5633[_0x76aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x30c577,null))[_0x76aa('0x27')](saveUpdates(_0x2e5633['body'],null))[_0x76aa('0x27')](respondWithResult(_0x30c577,null))['catch'](handleError(_0x30c577,null));};exports[_0x76aa('0x50')]=function(_0x4449c1,_0x3c63e5){return db[_0x76aa('0x2e')][_0x76aa('0x50')]()[_0x76aa('0x27')](respondWithResult(_0x3c63e5,null))[_0x76aa('0x49')](handleError(_0x3c63e5,null));};exports['download']=function(_0x186654,_0x5eeaa5,_0x3ee32){var _0x311bd5=require(_0x76aa('0x51'));var _0x53be10=![];var _0x3fa7ec={};if(_0x186654[_0x76aa('0x35')][_0x76aa('0x31')]&&_0x186654['query'][_0x76aa('0x31')]===_0x76aa('0x52')){_0x3fa7ec[_0x76aa('0x52')]=_0x186654[_0x76aa('0x4f')]['id'];}else{_0x3fa7ec['id']=_0x186654['params']['id'];}return db[_0x76aa('0x2e')][_0x76aa('0x48')]({'where':_0x3fa7ec,'attributes':['id',_0x76aa('0x53')],'raw':!![]})[_0x76aa('0x27')](handleEntityNotFound(_0x5eeaa5,null))[_0x76aa('0x27')](function(_0xf7732){if(_0xf7732){var _0x4e6c09=path[_0x76aa('0x54')](config[_0x76aa('0x55')],_0x76aa('0x56'),_0xf7732[_0x76aa('0x53')]);var _0x3967f3=util[_0x76aa('0x34')](_0x76aa('0x57'),_0x4e6c09);if(fs['existsSync'](_0x3967f3)){_0x53be10=!![];return _0x311bd5['decryptFile'](_0x3967f3,_0x4e6c09,config[_0x76aa('0x58')][_0x76aa('0x59')])['then'](function(){return _0xf7732;});}return _0xf7732;}})[_0x76aa('0x27')](function(_0x1e6f3c){if(_0x1e6f3c){var _0x4f832d=path[_0x76aa('0x54')](config[_0x76aa('0x55')],_0x76aa('0x56'),_0x1e6f3c[_0x76aa('0x53')]);if(!fs[_0x76aa('0x5a')](_0x4f832d)){throw new db[(_0x76aa('0x5b'))][(_0x76aa('0x5c'))](_0x76aa('0x5d'));}if(_0x1e6f3c[_0x76aa('0x5e')]){return _0x5eeaa5['download'](_0x4f832d,_0x1e6f3c[_0x76aa('0x5e')]+path['extname'](_0x4f832d),function(){if(_0x53be10){fs[_0x76aa('0x5f')](_0x4f832d);}});}else{return _0x5eeaa5[_0x76aa('0x60')](_0x4f832d,function(_0x2fef92){if(_0x53be10){fs[_0x76aa('0x5f')](_0x4f832d);}});}}})[_0x76aa('0x49')](function(_0x260ad2){if(_0x260ad2[_0x76aa('0x61')]===_0x76aa('0x5d')){_0x5eeaa5[_0x76aa('0x1a')](0x194)['send'](_0x76aa('0x62'));}else{return handleError(_0x5eeaa5,null);}});};exports[_0x76aa('0x28')]=function(_0x5c542b,_0xe5957d){return db[_0x76aa('0x2e')][_0x76aa('0x48')]({'where':{'id':_0x5c542b[_0x76aa('0x4f')]['id']}})[_0x76aa('0x27')](function(_0x5546b6){if(_[_0x76aa('0x63')](_0x5546b6)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5546b6;})[_0x76aa('0x27')](function(_0x35881c){var _0x3e97f8=path[_0x76aa('0x54')](config[_0x76aa('0x55')],_0x76aa('0x56'),_0x35881c[_0x76aa('0x53')]);logger['info'](_0x76aa('0x64'),_0x3e97f8);if(!_[_0x76aa('0x63')](_0x35881c['value'])&&fs['existsSync'](_0x3e97f8)){logger[_0x76aa('0x65')](_0x76aa('0x66')+_0x3e97f8+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x76aa('0x67')](_0x3e97f8);}_0x3e97f8=_0x3e97f8+_0x76aa('0x68');if(!_[_0x76aa('0x63')](_0x35881c['value'])&&fs[_0x76aa('0x5a')](_0x3e97f8)){logger['info'](_0x76aa('0x66')+_0x3e97f8+_0x76aa('0x69'));fs[_0x76aa('0x67')](_0x3e97f8);}return _0x35881c;})[_0x76aa('0x27')](function(_0x55ca84){if(!_0x55ca84)throw new InternalError();return _0x55ca84['destroy']();})[_0x76aa('0x27')](function(){_0xe5957d['status'](0xcc)[_0x76aa('0x1b')]();})[_0x76aa('0x49')](handleError(_0xe5957d,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 5656da4..db4e9c5 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 _0x78d7=['api','moment','path','rimraf','./screenRecording.attributes','exports','util','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x78d7,0x18e));var _0x778d=function(_0x17ee9f,_0x2b333f){_0x17ee9f=_0x17ee9f-0x0;var _0x36fe8d=_0x78d7[_0x17ee9f];return _0x36fe8d;};'use strict';var _=require('lodash');var util=require(_0x778d('0x0'));var logger=require(_0x778d('0x1'))(_0x778d('0x2'));var moment=require(_0x778d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x778d('0x4'));var rimraf=require(_0x778d('0x5'));var config=require('../../config/environment');var attributes=require(_0x778d('0x6'));module[_0x778d('0x7')]=function(_0x13ad28,_0x8720c5){return _0x13ad28['define']('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x414d=['moment','bluebird','request-promise','path','rimraf','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','../../config/logger'];(function(_0x5b3622,_0x2b27a2){var _0x67605f=function(_0x5d42f7){while(--_0x5d42f7){_0x5b3622['push'](_0x5b3622['shift']());}};_0x67605f(++_0x2b27a2);}(_0x414d,0xfc));var _0xd414=function(_0x1e4d97,_0x31b63e){_0x1e4d97=_0x1e4d97-0x0;var _0x3194e3=_0x414d[_0x1e4d97];return _0x3194e3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd414('0x0'))('api');var moment=require(_0xd414('0x1'));var BPromise=require(_0xd414('0x2'));var rp=require(_0xd414('0x3'));var fs=require('fs');var path=require(_0xd414('0x4'));var rimraf=require(_0xd414('0x5'));var config=require('../../config/environment');var attributes=require(_0xd414('0x6'));module[_0xd414('0x7')]=function(_0x1ab284,_0x274a36){return _0x1ab284['define'](_0xd414('0x8'),attributes,{'tableName':_0xd414('0x9'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xd414('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 093c674..f146c32 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 _0x3912=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0x3912,0x95));var _0x2391=function(_0x3ae4e0,_0x3a35f1){_0x3ae4e0=_0x3ae4e0-0x0;var _0x9e580a=_0x3912[_0x3ae4e0];return _0x9e580a;};'use strict';var _=require(_0x2391('0x0'));var util=require(_0x2391('0x1'));var moment=require(_0x2391('0x2'));var BPromise=require(_0x2391('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2391('0x4'));var db=require(_0x2391('0x5'))['db'];var utils=require(_0x2391('0x6'));var logger=require(_0x2391('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2391('0x8'));var client=jayson[_0x2391('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x304570,_0x4152ad,_0x10e2c5){return new BPromise(function(_0x5b87e1,_0x449206){return client['request'](_0x304570,_0x10e2c5)[_0x2391('0xa')](function(_0x4cf0fe){logger[_0x2391('0xb')](_0x2391('0xc'),_0x4152ad,_0x2391('0xd'));logger[_0x2391('0xe')](_0x2391('0xf'),_0x4152ad,_0x2391('0xd'),JSON['stringify'](_0x4cf0fe));if(_0x4cf0fe['error']){if(_0x4cf0fe[_0x2391('0x10')][_0x2391('0x11')]===0x1f4){logger['error'](_0x2391('0xc'),_0x4152ad,_0x4cf0fe[_0x2391('0x10')][_0x2391('0x12')]);return _0x449206(_0x4cf0fe['error'][_0x2391('0x12')]);}logger[_0x2391('0x10')](_0x2391('0xc'),_0x4152ad,_0x4cf0fe[_0x2391('0x10')][_0x2391('0x12')]);return _0x5b87e1(_0x4cf0fe[_0x2391('0x10')][_0x2391('0x12')]);}else{logger[_0x2391('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x4152ad,_0x2391('0xd'));_0x5b87e1(_0x4cf0fe[_0x2391('0x13')][_0x2391('0x12')]);}})[_0x2391('0x14')](function(_0x99e064){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4152ad,_0x99e064);_0x449206(_0x99e064);});});} \ No newline at end of file +var _0x3d7a=['request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0x3d7a,0x69));var _0xa3d7=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0x3d7a[_0x233cb1];return _0x29ee7e;};'use strict';var _=require('lodash');var util=require(_0xa3d7('0x0'));var moment=require(_0xa3d7('0x1'));var BPromise=require(_0xa3d7('0x2'));var rs=require(_0xa3d7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3d7('0x4'))['db'];var utils=require(_0xa3d7('0x5'));var logger=require('../../config/logger')(_0xa3d7('0x6'));var config=require('../../config/environment');var jayson=require(_0xa3d7('0x7'));var client=jayson[_0xa3d7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x126a5c,_0x12efb1,_0x56e944){return new BPromise(function(_0x108065,_0x24d3bb){return client[_0xa3d7('0x9')](_0x126a5c,_0x56e944)[_0xa3d7('0xa')](function(_0x557ac4){logger[_0xa3d7('0xb')](_0xa3d7('0xc'),_0x12efb1,_0xa3d7('0xd'));logger['debug'](_0xa3d7('0xe'),_0x12efb1,'request\x20sent',JSON[_0xa3d7('0xf')](_0x557ac4));if(_0x557ac4[_0xa3d7('0x10')]){if(_0x557ac4[_0xa3d7('0x10')][_0xa3d7('0x11')]===0x1f4){logger['error'](_0xa3d7('0xc'),_0x12efb1,_0x557ac4[_0xa3d7('0x10')][_0xa3d7('0x12')]);return _0x24d3bb(_0x557ac4[_0xa3d7('0x10')][_0xa3d7('0x12')]);}logger['error'](_0xa3d7('0xc'),_0x12efb1,_0x557ac4['error'][_0xa3d7('0x12')]);return _0x108065(_0x557ac4[_0xa3d7('0x10')][_0xa3d7('0x12')]);}else{logger[_0xa3d7('0xb')](_0xa3d7('0xc'),_0x12efb1,_0xa3d7('0xd'));_0x108065(_0x557ac4['result']['message']);}})['catch'](function(_0x5c442d){logger[_0xa3d7('0x10')](_0xa3d7('0xc'),_0x12efb1,_0x5c442d);_0x24d3bb(_0x5c442d);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 31b989c..6dd033e 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 _0x8371=['express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','join','server/files/images/logos/','format','%s%s','logo','originalname','file','addLogo','diskStorage','post','addLogoLogin','root','extname','single','addPreferred','favicon','addFavicon','put','update','exports','multer','util','connect-timeout'];(function(_0x213612,_0x5b72ba){var _0x1711dc=function(_0x5d8c17){while(--_0x5d8c17){_0x213612['push'](_0x213612['shift']());}};_0x1711dc(++_0x5b72ba);}(_0x8371,0x1b5));var _0x1837=function(_0x414717,_0x154093){_0x414717=_0x414717-0x0;var _0x405fb0=_0x8371[_0x414717];return _0x405fb0;};'use strict';var multer=require(_0x1837('0x0'));var util=require(_0x1837('0x1'));var path=require('path');var timeout=require(_0x1837('0x2'));var express=require(_0x1837('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1837('0x4'));var interaction=require(_0x1837('0x5'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0x1837('0x6')]('/',auth[_0x1837('0x7')](),controller[_0x1837('0x8')]);router[_0x1837('0x6')](_0x1837('0x9'),controller[_0x1837('0xa')]);router[_0x1837('0x6')](_0x1837('0xb'),controller[_0x1837('0xc')]);router[_0x1837('0x6')](_0x1837('0xd'),controller['getLogo']);router[_0x1837('0x6')](_0x1837('0xe'),controller['getLogoLogin']);router[_0x1837('0x6')](_0x1837('0xf'),controller[_0x1837('0x10')]);router[_0x1837('0x6')](_0x1837('0x11'),controller['getPreferred']);router[_0x1837('0x6')](_0x1837('0x12'),controller[_0x1837('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e85e6,_0x1b5da0,_0x248092){_0x248092(null,path[_0x1837('0x14')](config['root'],_0x1837('0x15')));},'filename':function(_0x29e4b5,_0x29d984,_0x27c764){_0x27c764(null,util[_0x1837('0x16')](_0x1837('0x17'),_0x1837('0x18'),path['extname'](_0x29d984[_0x1837('0x19')])));}})});router['post']('/:id/logo',upload['single'](_0x1837('0x1a')),controller[_0x1837('0x1b')]);var upload=multer({'storage':multer[_0x1837('0x1c')]({'destination':function(_0x3bee4e,_0x1d9af0,_0x91bbdc){_0x91bbdc(null,path[_0x1837('0x14')](config['root'],_0x1837('0x15')));},'filename':function(_0x34cde3,_0x4fcef3,_0x296fa2){_0x296fa2(null,util[_0x1837('0x16')](_0x1837('0x17'),'logologin',path['extname'](_0x4fcef3['originalname'])));}})});router[_0x1837('0x1d')]('/:id/logo_login',upload['single'](_0x1837('0x1a')),controller[_0x1837('0x1e')]);var upload=multer({'storage':multer[_0x1837('0x1c')]({'destination':function(_0x2511cd,_0x321a5a,_0x134564){_0x134564(null,path[_0x1837('0x14')](config[_0x1837('0x1f')],_0x1837('0x15')));},'filename':function(_0x30d5fe,_0x186438,_0x16d9f8){_0x16d9f8(null,util['format'](_0x1837('0x17'),'preferred',path[_0x1837('0x20')](_0x186438[_0x1837('0x19')])));}})});router[_0x1837('0x1d')](_0x1837('0x11'),upload[_0x1837('0x21')](_0x1837('0x1a')),controller[_0x1837('0x22')]);var upload=multer({'storage':multer[_0x1837('0x1c')]({'destination':function(_0x415e2d,_0x527d4f,_0x3cd868){_0x3cd868(null,path['join'](config['root'],_0x1837('0x15')));},'filename':function(_0x332d3c,_0x3eba1b,_0x1f69f8){_0x1f69f8(null,util[_0x1837('0x16')](_0x1837('0x17'),_0x1837('0x23'),path[_0x1837('0x20')](_0x3eba1b['originalname'])));}})});router[_0x1837('0x1d')](_0x1837('0x12'),upload['single']('file'),controller[_0x1837('0x24')]);router[_0x1837('0x25')]('/:id',auth[_0x1837('0x7')](),controller[_0x1837('0x26')]);module[_0x1837('0x27')]=router; \ No newline at end of file +var _0xd34e=['join','preferred','favicon','/:id/favicon','put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','getDate','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','server/files/images/logos/','format','%s%s','logo','extname','post','single','file','root','originalname'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd34e,0x1a1));var _0xed34=function(_0x281822,_0x536f7e){_0x281822=_0x281822-0x0;var _0x325940=_0xd34e[_0x281822];return _0x325940;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xed34('0x0'));var timeout=require(_0xed34('0x1'));var express=require(_0xed34('0x2'));var router=express[_0xed34('0x3')]();var fs_extra=require(_0xed34('0x4'));var auth=require(_0xed34('0x5'));var interaction=require(_0xed34('0x6'));var config=require(_0xed34('0x7'));var controller=require(_0xed34('0x8'));router['get']('/',auth[_0xed34('0x9')](),controller[_0xed34('0xa')]);router[_0xed34('0xb')]('/now',controller[_0xed34('0xc')]);router[_0xed34('0xb')](_0xed34('0xd'),controller['show']);router[_0xed34('0xb')](_0xed34('0xe'),controller[_0xed34('0xf')]);router[_0xed34('0xb')](_0xed34('0x10'),controller[_0xed34('0x11')]);router[_0xed34('0xb')](_0xed34('0x12'),controller[_0xed34('0x13')]);router['get'](_0xed34('0x14'),controller[_0xed34('0x15')]);router[_0xed34('0xb')]('/:id/favicon',controller[_0xed34('0x16')]);var upload=multer({'storage':multer[_0xed34('0x17')]({'destination':function(_0x3e79a3,_0x2bc103,_0x4a5f27){_0x4a5f27(null,path['join'](config['root'],_0xed34('0x18')));},'filename':function(_0x2febdd,_0x14cdfe,_0x3e1a38){_0x3e1a38(null,util[_0xed34('0x19')](_0xed34('0x1a'),_0xed34('0x1b'),path[_0xed34('0x1c')](_0x14cdfe['originalname'])));}})});router[_0xed34('0x1d')]('/:id/logo',upload[_0xed34('0x1e')](_0xed34('0x1f')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1eb936,_0x7149d9,_0x2d9473){_0x2d9473(null,path['join'](config[_0xed34('0x20')],_0xed34('0x18')));},'filename':function(_0x230934,_0x1a7e71,_0x15ac25){_0x15ac25(null,util[_0xed34('0x19')](_0xed34('0x1a'),'logologin',path['extname'](_0x1a7e71[_0xed34('0x21')])));}})});router['post']('/:id/logo_login',upload[_0xed34('0x1e')](_0xed34('0x1f')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xed34('0x17')]({'destination':function(_0x5257de,_0x41921e,_0x4d7ad0){_0x4d7ad0(null,path[_0xed34('0x22')](config[_0xed34('0x20')],'server/files/images/logos/'));},'filename':function(_0x1e38b5,_0x26f584,_0x5d21b8){_0x5d21b8(null,util['format'](_0xed34('0x1a'),_0xed34('0x23'),path['extname'](_0x26f584['originalname'])));}})});router['post'](_0xed34('0x14'),upload[_0xed34('0x1e')](_0xed34('0x1f')),controller['addPreferred']);var upload=multer({'storage':multer[_0xed34('0x17')]({'destination':function(_0x2980d4,_0x3a5ca5,_0x4a586e){_0x4a586e(null,path[_0xed34('0x22')](config[_0xed34('0x20')],_0xed34('0x18')));},'filename':function(_0x1213d9,_0x24bcbe,_0x2f0aa1){_0x2f0aa1(null,util[_0xed34('0x19')](_0xed34('0x1a'),_0xed34('0x24'),path[_0xed34('0x1c')](_0x24bcbe[_0xed34('0x21')])));}})});router[_0xed34('0x1d')](_0xed34('0x25'),upload[_0xed34('0x1e')]('file'),controller['addFavicon']);router[_0xed34('0x26')](_0xed34('0xd'),auth[_0xed34('0x9')](),controller[_0xed34('0x27')]);module[_0xed34('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index d55c100..6734da6 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(_0x359281,_0x2e3d6a){var _0x23f5d1=function(_0xcdf840){while(--_0xcdf840){_0x359281['push'](_0x359281['shift']());}};_0x23f5d1(++_0x2e3d6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x4ed3c7,_0x2e46e2){var _0x137d33=function(_0xc39b7d){while(--_0xc39b7d){_0x4ed3c7['push'](_0x4ed3c7['shift']());}};_0x137d33(++_0x2e46e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 85e58eb..34eda74 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 _0xd976=['getLicense','preferred','defaultLogo','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.svg','Sequelize','download','defaultLoginLogo','defaultPreferred','default_loginLogo.svg','ValidationError','gdpr','securePassword','getPreferred','favicon','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','eml-format','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','apply','save','destroy','name','send','index','map','Setting','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','length','find','update','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos'];(function(_0x5f5c9e,_0x61ae35){var _0x1026ae=function(_0xf9a384){while(--_0xf9a384){_0x5f5c9e['push'](_0x5f5c9e['shift']());}};_0x1026ae(++_0x61ae35);}(_0xd976,0x179));var _0x6d97=function(_0x585ad3,_0x5ba12f){_0x585ad3=_0x585ad3-0x0;var _0x35ce45=_0xd976[_0x585ad3];return _0x35ce45;};'use strict';var emlformat=require(_0x6d97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d97('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d97('0x2'));var moment=require('moment');var BPromise=require(_0x6d97('0x3'));var Mustache=require('mustache');var util=require(_0x6d97('0x4'));var path=require('path');var sox=require(_0x6d97('0x5'));var csv=require('to-csv');var ejs=require(_0x6d97('0x6'));var fs=require('fs');var fs_extra=require(_0x6d97('0x7'));var _=require(_0x6d97('0x8'));var squel=require(_0x6d97('0x9'));var crypto=require('crypto');var jsforce=require(_0x6d97('0xa'));var deskjs=require(_0x6d97('0xb'));var toCsv=require(_0x6d97('0xc'));var querystring=require(_0x6d97('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6d97('0xe'));var as=require(_0x6d97('0xf'));var hardwareService=require(_0x6d97('0x10'));var logger=require(_0x6d97('0x11'))(_0x6d97('0x12'));var utils=require(_0x6d97('0x13'));var config=require(_0x6d97('0x14'));var licenseUtil=require(_0x6d97('0x15'));var db=require(_0x6d97('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x6d97('0x17')][_0x6d97('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x2ca76e,_0x55ae41,_0xf70975,_0x18fb77){return new BPromise(function(_0x53f38d,_0x25229b){var _0x11fecb=_0x18fb77||client;return _0x11fecb['request'](_0x2ca76e,_0xf70975)[_0x6d97('0x19')](function(_0x358966){logger[_0x6d97('0x1a')](_0x6d97('0x1b'),_0x55ae41,_0x6d97('0x1c'));logger[_0x6d97('0x1d')]('Setting,\x20%s,\x20%s,\x20%s',_0x55ae41,_0x6d97('0x1c'),JSON[_0x6d97('0x1e')](_0x358966));if(_0x358966[_0x6d97('0x1f')]){if(_0x358966[_0x6d97('0x1f')][_0x6d97('0x20')]===0x1f4){logger['error'](_0x6d97('0x1b'),_0x55ae41,_0x358966[_0x6d97('0x1f')][_0x6d97('0x21')]);return _0x25229b(_0x358966['error'][_0x6d97('0x21')]);}logger[_0x6d97('0x1f')]('Setting,\x20%s,\x20%s',_0x55ae41,_0x358966[_0x6d97('0x1f')][_0x6d97('0x21')]);return _0x53f38d(_0x358966[_0x6d97('0x1f')][_0x6d97('0x21')]);}else{logger[_0x6d97('0x1a')](_0x6d97('0x1b'),_0x55ae41,'request\x20sent');_0x53f38d(_0x358966[_0x6d97('0x22')][_0x6d97('0x21')]);}})[_0x6d97('0x23')](function(_0x51ac10){logger['error'](_0x6d97('0x1b'),_0x55ae41,_0x51ac10);_0x25229b(_0x51ac10);});});}function respondWithStatusCode(_0x31c800,_0x48d97c){_0x48d97c=_0x48d97c||0xcc;return function(_0x1f59b4){if(_0x1f59b4){return _0x31c800[_0x6d97('0x24')](_0x48d97c);}return _0x31c800[_0x6d97('0x25')](_0x48d97c)['end']();};}function respondWithResult(_0xe053bd,_0x10e967){_0x10e967=_0x10e967||0xc8;return function(_0x39299f){if(_0x39299f){return _0xe053bd[_0x6d97('0x25')](_0x10e967)['json'](_0x39299f);}};}function respondWithFilteredResult(_0x4729be,_0x186102){return function(_0x113f47){if(_0x113f47){var _0x52a5e4=typeof _0x186102[_0x6d97('0x26')]===_0x6d97('0x27')&&typeof _0x186102['limit']==='undefined';var _0xc0b8bd=_0x113f47['count'];var _0x4abb13=_0x52a5e4?0x0:_0x186102[_0x6d97('0x26')];var _0x39cb85=_0x52a5e4?_0x113f47['count']:_0x186102[_0x6d97('0x26')]+_0x186102['limit'];var _0x1a8075;if(_0x39cb85>=_0xc0b8bd){_0x39cb85=_0xc0b8bd;_0x1a8075=0xc8;}else{_0x1a8075=0xce;}_0x4729be['status'](_0x1a8075);return _0x4729be['set']('Content-Range',_0x4abb13+'-'+_0x39cb85+'/'+_0xc0b8bd)['json'](_0x113f47);}return null;};}function patchUpdates(_0x5a3ad0){return function(_0x67615b){try{jsonpatch[_0x6d97('0x28')](_0x67615b,_0x5a3ad0,!![]);}catch(_0x239b93){return BPromise['reject'](_0x239b93);}return _0x67615b[_0x6d97('0x29')]();};}function saveUpdates(_0x1f7bf4,_0xc725ac){return function(_0x24a75d){if(_0x24a75d){return _0x24a75d['update'](_0x1f7bf4)[_0x6d97('0x19')](function(_0x4b261e){return _0x4b261e;});}return null;};}function removeEntity(_0x40ed34,_0x1a7168){return function(_0x418694){if(_0x418694){return _0x418694[_0x6d97('0x2a')]()[_0x6d97('0x19')](function(){_0x40ed34[_0x6d97('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x128a93,_0x10dec1){return function(_0x80a23c){if(!_0x80a23c){_0x128a93[_0x6d97('0x24')](0x194);}return _0x80a23c;};}function handleError(_0x27bdaf,_0x22e30e){_0x22e30e=_0x22e30e||0x1f4;return function(_0x5c4706){logger[_0x6d97('0x1f')](_0x5c4706['stack']);if(_0x5c4706[_0x6d97('0x2b')]){delete _0x5c4706[_0x6d97('0x2b')];}_0x27bdaf['status'](_0x22e30e)[_0x6d97('0x2c')](_0x5c4706);};}exports[_0x6d97('0x2d')]=function(_0x4dc447,_0x3bc4d5){var _0x469c3c={},_0x38bb07={},_0x39c83a={'count':0x0,'rows':[]};var _0x4d3fd4=_[_0x6d97('0x2e')](db[_0x6d97('0x2f')]['rawAttributes'],function(_0x13a103){return{'name':_0x13a103[_0x6d97('0x30')],'type':_0x13a103[_0x6d97('0x31')][_0x6d97('0x32')]};});_0x38bb07[_0x6d97('0x33')]=_['map'](_0x4d3fd4,_0x6d97('0x2b'));_0x38bb07[_0x6d97('0x34')]=_[_0x6d97('0x35')](_0x4dc447[_0x6d97('0x34')]);_0x38bb07['filters']=_[_0x6d97('0x36')](_0x38bb07[_0x6d97('0x33')],_0x38bb07[_0x6d97('0x34')]);_0x469c3c[_0x6d97('0x37')]=_[_0x6d97('0x36')](_0x38bb07['model'],qs[_0x6d97('0x38')](_0x4dc447[_0x6d97('0x34')]['fields']));_0x469c3c[_0x6d97('0x37')]=_0x469c3c[_0x6d97('0x37')]['length']?_0x469c3c['attributes']:_0x38bb07[_0x6d97('0x33')];if(!_0x4dc447[_0x6d97('0x34')][_0x6d97('0x39')](_0x6d97('0x3a'))){_0x469c3c['limit']=qs[_0x6d97('0x3b')](_0x4dc447[_0x6d97('0x34')][_0x6d97('0x3b')]);_0x469c3c[_0x6d97('0x26')]=qs[_0x6d97('0x26')](_0x4dc447[_0x6d97('0x34')]['offset']);}_0x469c3c[_0x6d97('0x3c')]=qs['sort'](_0x4dc447[_0x6d97('0x34')][_0x6d97('0x3d')]);_0x469c3c[_0x6d97('0x3e')]=qs[_0x6d97('0x3f')](_[_0x6d97('0x40')](_0x4dc447[_0x6d97('0x34')],_0x38bb07[_0x6d97('0x3f')]),_0x4d3fd4);if(_0x4dc447[_0x6d97('0x34')][_0x6d97('0x41')]){_0x469c3c[_0x6d97('0x3e')]=_[_0x6d97('0x42')](_0x469c3c['where'],{'$or':_['map'](_0x4d3fd4,function(_0x25646e){if(_0x25646e[_0x6d97('0x31')]!==_0x6d97('0x43')){var _0x4c2933={};_0x4c2933[_0x25646e[_0x6d97('0x2b')]]={'$like':'%'+_0x4dc447[_0x6d97('0x34')][_0x6d97('0x41')]+'%'};return _0x4c2933;}})});}_0x469c3c=_[_0x6d97('0x42')]({},_0x469c3c,_0x4dc447[_0x6d97('0x44')]);var _0x190334={'where':_0x469c3c[_0x6d97('0x3e')]};return db['Setting'][_0x6d97('0x45')](_0x190334)[_0x6d97('0x19')](function(_0x5cad2a){_0x39c83a[_0x6d97('0x45')]=_0x5cad2a;if(_0x4dc447[_0x6d97('0x34')][_0x6d97('0x46')]){_0x469c3c[_0x6d97('0x47')]=[{'all':!![]}];}return db[_0x6d97('0x2f')][_0x6d97('0x48')](_0x469c3c);})['then'](function(_0x43eb49){_0x39c83a[_0x6d97('0x49')]=_0x43eb49;return _0x39c83a;})['then'](respondWithFilteredResult(_0x3bc4d5,_0x469c3c))['catch'](handleError(_0x3bc4d5,null));};exports['show']=function(_0x18b153,_0x5614c2){var _0x4947a9={'raw':![],'where':{'id':_0x18b153[_0x6d97('0x4a')]['id']}},_0x398b40={};_0x398b40[_0x6d97('0x33')]=_[_0x6d97('0x35')](db['Setting']['rawAttributes']);_0x398b40[_0x6d97('0x34')]=_[_0x6d97('0x35')](_0x18b153['query']);_0x398b40[_0x6d97('0x3f')]=_['intersection'](_0x398b40['model'],_0x398b40[_0x6d97('0x34')]);_0x4947a9['attributes']=_[_0x6d97('0x36')](_0x398b40[_0x6d97('0x33')],qs['fields'](_0x18b153[_0x6d97('0x34')]['fields']));_0x4947a9[_0x6d97('0x37')]=_0x4947a9['attributes'][_0x6d97('0x4b')]?_0x4947a9['attributes']:_0x398b40[_0x6d97('0x33')];if(_0x18b153[_0x6d97('0x34')][_0x6d97('0x46')]){_0x4947a9[_0x6d97('0x47')]=[{'all':!![]}];}_0x4947a9=_[_0x6d97('0x42')]({},_0x4947a9,_0x18b153[_0x6d97('0x44')]);return db['Setting'][_0x6d97('0x4c')](_0x4947a9)[_0x6d97('0x19')](handleEntityNotFound(_0x5614c2,null))[_0x6d97('0x19')](respondWithResult(_0x5614c2,null))[_0x6d97('0x23')](handleError(_0x5614c2,null));};exports[_0x6d97('0x4d')]=function(_0x5f4300,_0x2633e9){if(_0x5f4300[_0x6d97('0x4e')]['id']){delete _0x5f4300[_0x6d97('0x4e')]['id'];}return db[_0x6d97('0x2f')]['find']({'where':{'id':_0x5f4300[_0x6d97('0x4a')]['id']}})[_0x6d97('0x19')](handleEntityNotFound(_0x2633e9,null))[_0x6d97('0x19')](saveUpdates(_0x5f4300[_0x6d97('0x4e')],null))['then'](respondWithResult(_0x2633e9,null))[_0x6d97('0x23')](handleError(_0x2633e9,null));};exports[_0x6d97('0x4f')]=function(_0x33507c,_0x192d66,_0x2f3bec){if(_0x33507c[_0x6d97('0x50')]&&_0x33507c[_0x6d97('0x50')]['filename']){_0x33507c[_0x6d97('0x4e')][_0x6d97('0x51')]=_0x33507c['file'][_0x6d97('0x52')];}return db[_0x6d97('0x2f')]['find']({'where':{'id':_0x33507c[_0x6d97('0x4a')]['id']}})[_0x6d97('0x19')](handleEntityNotFound(_0x192d66,null))[_0x6d97('0x19')](saveUpdates(_0x33507c[_0x6d97('0x4e')],null))[_0x6d97('0x19')](respondWithResult(_0x192d66,null))[_0x6d97('0x23')](handleError(_0x192d66,null));};exports[_0x6d97('0x53')]=function(_0x12cc4f,_0x1b0121,_0x333ae0){if(_0x12cc4f[_0x6d97('0x50')]&&_0x12cc4f[_0x6d97('0x50')][_0x6d97('0x52')]){_0x12cc4f['body'][_0x6d97('0x54')]=_0x12cc4f['file'][_0x6d97('0x52')];}return db[_0x6d97('0x2f')][_0x6d97('0x4c')]({'where':{'id':_0x12cc4f[_0x6d97('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b0121,null))[_0x6d97('0x19')](saveUpdates(_0x12cc4f['body'],null))['then'](respondWithResult(_0x1b0121,null))[_0x6d97('0x23')](handleError(_0x1b0121,null));};var utilLicense=require('../../config/license/util');exports[_0x6d97('0x55')]=function(_0x106420,_0x563305,_0x27bfdd){var _0x1b55b1=_0x6d97('0x56');var _0x454ed1={'custom':![]};return utilLicense[_0x6d97('0x57')]()['then'](function(_0x4f8a9a){if(_0x4f8a9a){_0x454ed1=_0x4f8a9a;}return db[_0x6d97('0x2f')][_0x6d97('0x4c')]({'where':{'id':_0x106420[_0x6d97('0x4a')]['id']},'attributes':[_0x6d97('0x51'),_0x6d97('0x54'),_0x6d97('0x58'),'favicon',_0x6d97('0x59'),'defaultLoginLogo','defaultPreferred',_0x6d97('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x563305,null))['then'](function(_0x7a07bc){if(_0x7a07bc){var _0x360051=_0x7a07bc[_0x6d97('0x51')]&&fs[_0x6d97('0x5b')](path[_0x6d97('0x5c')](config[_0x6d97('0x5d')],_0x1b55b1,_[_0x6d97('0x5e')](_0x7a07bc[_0x6d97('0x51')])))?path[_0x6d97('0x5c')](config[_0x6d97('0x5d')],_0x1b55b1,_[_0x6d97('0x5e')](_0x7a07bc[_0x6d97('0x51')])):path[_0x6d97('0x5c')](config[_0x6d97('0x5d')],_0x1b55b1,_[_0x6d97('0x5e')]('default_logo.svg'));var _0xab0d36=_0x6d97('0x5f')+_[_0x6d97('0x60')](_0x6d97('0x51'));if(_0x7a07bc[_0xab0d36]||!_0x454ed1[_0x6d97('0x61')]){_0x360051=path['join'](config[_0x6d97('0x5d')],_0x1b55b1,_[_0x6d97('0x5e')](_0x6d97('0x62')));}if(!fs[_0x6d97('0x5b')](_0x360051)){throw new db[(_0x6d97('0x63'))]['ValidationError'](_[_0x6d97('0x60')]('logo')+'\x20not\x20found');}return _0x563305[_0x6d97('0x64')](_0x360051);}})[_0x6d97('0x23')](handleError(_0x563305,null));};var utilLicense=require(_0x6d97('0x15'));exports['getLogoLogin']=function(_0x494ffd,_0x2acc39,_0x134b03){var _0x1f06c2='server/files/images/logos';var _0x5d873e={'custom':![]};return utilLicense['getLicense']()[_0x6d97('0x19')](function(_0x285cfc){if(_0x285cfc){_0x5d873e=_0x285cfc;}return db[_0x6d97('0x2f')][_0x6d97('0x4c')]({'where':{'id':_0x494ffd[_0x6d97('0x4a')]['id']},'attributes':['logo','loginLogo',_0x6d97('0x58'),'favicon',_0x6d97('0x59'),_0x6d97('0x65'),_0x6d97('0x66'),_0x6d97('0x5a')],'raw':!![]});})[_0x6d97('0x19')](handleEntityNotFound(_0x2acc39,null))['then'](function(_0x2b9e13){if(_0x2b9e13){var _0x52dc84=_0x2b9e13['loginLogo']&&fs[_0x6d97('0x5b')](path['join'](config['root'],_0x1f06c2,_[_0x6d97('0x5e')](_0x2b9e13[_0x6d97('0x54')])))?path[_0x6d97('0x5c')](config[_0x6d97('0x5d')],_0x1f06c2,_[_0x6d97('0x5e')](_0x2b9e13[_0x6d97('0x54')])):path['join'](config[_0x6d97('0x5d')],_0x1f06c2,_[_0x6d97('0x5e')](_0x6d97('0x67')));var _0x21f666=_0x6d97('0x5f')+_[_0x6d97('0x60')](_0x6d97('0x54'));if(_0x2b9e13[_0x21f666]||!_0x5d873e[_0x6d97('0x61')]){_0x52dc84=path[_0x6d97('0x5c')](config[_0x6d97('0x5d')],_0x1f06c2,_[_0x6d97('0x5e')](_0x6d97('0x67')));}if(!fs[_0x6d97('0x5b')](_0x52dc84)){throw new db['Sequelize'][(_0x6d97('0x68'))](_[_0x6d97('0x60')](_0x6d97('0x54'))+'\x20not\x20found');}return _0x2acc39[_0x6d97('0x64')](_0x52dc84);}})['catch'](handleError(_0x2acc39,null));};exports[_0x6d97('0x69')]=function(_0x33ef97,_0x442646){return db['Setting'][_0x6d97('0x4c')]({'where':{'id':_0x33ef97[_0x6d97('0x4a')]['id']},'attributes':[_0x6d97('0x6a')]})['then'](respondWithResult(_0x442646,null))['catch'](handleError(_0x442646,null));};exports['addPreferred']=function(_0x3ed72a,_0x5ab1c4,_0x1cedbb){if(_0x3ed72a[_0x6d97('0x50')]&&_0x3ed72a['file'][_0x6d97('0x52')]){_0x3ed72a[_0x6d97('0x4e')][_0x6d97('0x58')]=_0x3ed72a['file']['filename'];}return db[_0x6d97('0x2f')][_0x6d97('0x4c')]({'where':{'id':_0x3ed72a[_0x6d97('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5ab1c4,null))[_0x6d97('0x19')](saveUpdates(_0x3ed72a[_0x6d97('0x4e')],null))[_0x6d97('0x19')](respondWithResult(_0x5ab1c4,null))[_0x6d97('0x23')](handleError(_0x5ab1c4,null));};var utilLicense=require(_0x6d97('0x15'));exports[_0x6d97('0x6b')]=function(_0x385be2,_0x15f6c3,_0x4b1314){var _0x5b2264=_0x6d97('0x56');var _0x402707={'custom':![]};return utilLicense['getLicense']()[_0x6d97('0x19')](function(_0x24865b){if(_0x24865b){_0x402707=_0x24865b;}return db[_0x6d97('0x2f')][_0x6d97('0x4c')]({'where':{'id':_0x385be2[_0x6d97('0x4a')]['id']},'attributes':['logo',_0x6d97('0x54'),_0x6d97('0x58'),_0x6d97('0x6c'),_0x6d97('0x59'),_0x6d97('0x65'),'defaultPreferred',_0x6d97('0x5a')],'raw':!![]});})[_0x6d97('0x19')](handleEntityNotFound(_0x15f6c3,null))[_0x6d97('0x19')](function(_0x51dad5){if(_0x51dad5){var _0x384320=_0x51dad5['preferred']&&fs[_0x6d97('0x5b')](path[_0x6d97('0x5c')](config['root'],_0x5b2264,_['toLower'](_0x51dad5[_0x6d97('0x58')])))?path['join'](config[_0x6d97('0x5d')],_0x5b2264,_[_0x6d97('0x5e')](_0x51dad5[_0x6d97('0x58')])):path[_0x6d97('0x5c')](config[_0x6d97('0x5d')],_0x5b2264,_[_0x6d97('0x5e')](_0x6d97('0x6d')));var _0x4e8c76=_0x6d97('0x5f')+_[_0x6d97('0x60')](_0x6d97('0x58'));if(_0x51dad5[_0x4e8c76]||!_0x402707[_0x6d97('0x61')]||!_0x402707[_0x6d97('0x58')]){_0x384320=path[_0x6d97('0x5c')](config[_0x6d97('0x5d')],_0x5b2264,_[_0x6d97('0x5e')](_0x6d97('0x6d')));}if(!fs[_0x6d97('0x5b')](_0x384320)){throw new db[(_0x6d97('0x63'))][(_0x6d97('0x68'))](_[_0x6d97('0x60')](_0x6d97('0x58'))+_0x6d97('0x6e'));}return _0x15f6c3[_0x6d97('0x64')](_0x384320);}})[_0x6d97('0x23')](handleError(_0x15f6c3,null));};exports[_0x6d97('0x6f')]=function(_0x386e3f,_0x568324,_0x2a2288){if(_0x386e3f[_0x6d97('0x50')]&&_0x386e3f[_0x6d97('0x50')][_0x6d97('0x52')]){_0x386e3f[_0x6d97('0x4e')][_0x6d97('0x6c')]=_0x386e3f[_0x6d97('0x50')][_0x6d97('0x52')];}return db[_0x6d97('0x2f')][_0x6d97('0x4c')]({'where':{'id':_0x386e3f[_0x6d97('0x4a')]['id']}})['then'](handleEntityNotFound(_0x568324,null))['then'](saveUpdates(_0x386e3f['body'],null))[_0x6d97('0x19')](respondWithResult(_0x568324,null))[_0x6d97('0x23')](handleError(_0x568324,null));};var utilLicense=require(_0x6d97('0x15'));exports[_0x6d97('0x70')]=function(_0x3d9958,_0x25a759,_0x2026d4){var _0x33e17a=_0x6d97('0x56');var _0x33ffac={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x255f6d){if(_0x255f6d){_0x33ffac=_0x255f6d;}return db[_0x6d97('0x2f')][_0x6d97('0x4c')]({'where':{'id':_0x3d9958['params']['id']},'attributes':[_0x6d97('0x51'),_0x6d97('0x54'),_0x6d97('0x58'),_0x6d97('0x6c'),'defaultLogo',_0x6d97('0x65'),_0x6d97('0x66'),_0x6d97('0x5a')],'raw':!![]});})[_0x6d97('0x19')](handleEntityNotFound(_0x25a759,null))[_0x6d97('0x19')](function(_0x5cd2fe){if(_0x5cd2fe){var _0x2667bb=_0x5cd2fe[_0x6d97('0x6c')]&&fs[_0x6d97('0x5b')](path['join'](config['root'],_0x33e17a,_[_0x6d97('0x5e')](_0x5cd2fe[_0x6d97('0x6c')])))?path[_0x6d97('0x5c')](config['root'],_0x33e17a,_['toLower'](_0x5cd2fe['favicon'])):path['join'](config[_0x6d97('0x5d')],_0x33e17a,_['toLower'](_0x6d97('0x71')));var _0x5da8b7='default'+_[_0x6d97('0x60')](_0x6d97('0x6c'));if(_0x5cd2fe[_0x5da8b7]||!_0x33ffac[_0x6d97('0x61')]){_0x2667bb=path[_0x6d97('0x5c')](config[_0x6d97('0x5d')],_0x33e17a,_[_0x6d97('0x5e')](_0x6d97('0x71')));}if(!fs[_0x6d97('0x5b')](_0x2667bb)){throw new db[(_0x6d97('0x63'))]['ValidationError'](_[_0x6d97('0x60')](_0x6d97('0x6c'))+_0x6d97('0x6e'));}return _0x25a759[_0x6d97('0x64')](_0x2667bb);}})[_0x6d97('0x23')](handleError(_0x25a759,null));};exports['getDate']=function(_0x10574b,_0xc69a7c){var _0x233be3={'offset':moment()['utcOffset']()};_0x233be3['now']=moment()[_0x6d97('0x72')](_0x233be3['offset'])[_0x6d97('0x73')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0xc69a7c['status'](0xc8)[_0x6d97('0x2c')](_0x233be3);}; \ No newline at end of file +var _0xde0f=['find','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','join','toLower','root','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','defaultLoginLogo','existsSync','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','body','addLogo','file','filename','logo'];(function(_0x4fcb07,_0x4a77a4){var _0xf2eeb=function(_0x279b1a){while(--_0x279b1a){_0x4fcb07['push'](_0x4fcb07['shift']());}};_0xf2eeb(++_0x4a77a4);}(_0xde0f,0xa2));var _0xfde0=function(_0x374cc1,_0x5412bd){_0x374cc1=_0x374cc1-0x0;var _0x508f24=_0xde0f[_0x374cc1];return _0x508f24;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfde0('0x0'));var jsonpatch=require(_0xfde0('0x1'));var rp=require(_0xfde0('0x2'));var moment=require(_0xfde0('0x3'));var BPromise=require(_0xfde0('0x4'));var Mustache=require('mustache');var util=require(_0xfde0('0x5'));var path=require(_0xfde0('0x6'));var sox=require(_0xfde0('0x7'));var csv=require(_0xfde0('0x8'));var ejs=require(_0xfde0('0x9'));var fs=require('fs');var fs_extra=require(_0xfde0('0xa'));var _=require(_0xfde0('0xb'));var squel=require(_0xfde0('0xc'));var crypto=require(_0xfde0('0xd'));var jsforce=require(_0xfde0('0xe'));var deskjs=require(_0xfde0('0xf'));var toCsv=require(_0xfde0('0x8'));var querystring=require(_0xfde0('0x10'));var Papa=require('papaparse');var Redis=require(_0xfde0('0x11'));var authService=require(_0xfde0('0x12'));var qs=require(_0xfde0('0x13'));var as=require(_0xfde0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfde0('0x15'))(_0xfde0('0x16'));var utils=require(_0xfde0('0x17'));var config=require(_0xfde0('0x18'));var licenseUtil=require(_0xfde0('0x19'));var db=require(_0xfde0('0x1a'))['db'];var jayson=require(_0xfde0('0x1b'));var client=jayson[_0xfde0('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29023f,_0x9accee,_0x5e801d,_0x4c58b5){return new BPromise(function(_0x40cdcf,_0x41a1a9){var _0x4e06ea=_0x4c58b5||client;return _0x4e06ea[_0xfde0('0x1d')](_0x29023f,_0x5e801d)['then'](function(_0x239e69){logger[_0xfde0('0x1e')](_0xfde0('0x1f'),_0x9accee,_0xfde0('0x20'));logger[_0xfde0('0x21')](_0xfde0('0x22'),_0x9accee,'request\x20sent',JSON['stringify'](_0x239e69));if(_0x239e69[_0xfde0('0x23')]){if(_0x239e69['error'][_0xfde0('0x24')]===0x1f4){logger[_0xfde0('0x23')](_0xfde0('0x1f'),_0x9accee,_0x239e69[_0xfde0('0x23')]['message']);return _0x41a1a9(_0x239e69[_0xfde0('0x23')][_0xfde0('0x25')]);}logger['error'](_0xfde0('0x1f'),_0x9accee,_0x239e69[_0xfde0('0x23')][_0xfde0('0x25')]);return _0x40cdcf(_0x239e69[_0xfde0('0x23')]['message']);}else{logger[_0xfde0('0x1e')]('Setting,\x20%s,\x20%s',_0x9accee,_0xfde0('0x20'));_0x40cdcf(_0x239e69[_0xfde0('0x26')][_0xfde0('0x25')]);}})['catch'](function(_0x1f1819){logger['error'](_0xfde0('0x1f'),_0x9accee,_0x1f1819);_0x41a1a9(_0x1f1819);});});}function respondWithStatusCode(_0x14488e,_0x46ba35){_0x46ba35=_0x46ba35||0xcc;return function(_0x36521a){if(_0x36521a){return _0x14488e[_0xfde0('0x27')](_0x46ba35);}return _0x14488e[_0xfde0('0x28')](_0x46ba35)['end']();};}function respondWithResult(_0x4743db,_0x592f4a){_0x592f4a=_0x592f4a||0xc8;return function(_0x42a70b){if(_0x42a70b){return _0x4743db[_0xfde0('0x28')](_0x592f4a)[_0xfde0('0x29')](_0x42a70b);}};}function respondWithFilteredResult(_0x53153c,_0x5cf933){return function(_0xd7c23e){if(_0xd7c23e){var _0x542123=typeof _0x5cf933[_0xfde0('0x2a')]===_0xfde0('0x2b')&&typeof _0x5cf933[_0xfde0('0x2c')]==='undefined';var _0x45d7a3=_0xd7c23e[_0xfde0('0x2d')];var _0x1c3b98=_0x542123?0x0:_0x5cf933[_0xfde0('0x2a')];var _0x9617a3=_0x542123?_0xd7c23e[_0xfde0('0x2d')]:_0x5cf933[_0xfde0('0x2a')]+_0x5cf933[_0xfde0('0x2c')];var _0x2d926c;if(_0x9617a3>=_0x45d7a3){_0x9617a3=_0x45d7a3;_0x2d926c=0xc8;}else{_0x2d926c=0xce;}_0x53153c[_0xfde0('0x28')](_0x2d926c);return _0x53153c[_0xfde0('0x2e')](_0xfde0('0x2f'),_0x1c3b98+'-'+_0x9617a3+'/'+_0x45d7a3)[_0xfde0('0x29')](_0xd7c23e);}return null;};}function patchUpdates(_0x28aa24){return function(_0x2b9e77){try{jsonpatch['apply'](_0x2b9e77,_0x28aa24,!![]);}catch(_0x371ba9){return BPromise[_0xfde0('0x30')](_0x371ba9);}return _0x2b9e77[_0xfde0('0x31')]();};}function saveUpdates(_0x3e10b7,_0x4c4607){return function(_0x4d753d){if(_0x4d753d){return _0x4d753d[_0xfde0('0x32')](_0x3e10b7)[_0xfde0('0x33')](function(_0x466fd1){return _0x466fd1;});}return null;};}function removeEntity(_0xd0f4dc,_0x2dab00){return function(_0x279888){if(_0x279888){return _0x279888[_0xfde0('0x34')]()[_0xfde0('0x33')](function(){_0xd0f4dc[_0xfde0('0x28')](0xcc)[_0xfde0('0x35')]();});}};}function handleEntityNotFound(_0x243d90,_0x10e714){return function(_0xca89aa){if(!_0xca89aa){_0x243d90[_0xfde0('0x27')](0x194);}return _0xca89aa;};}function handleError(_0x466b8d,_0x6324c8){_0x6324c8=_0x6324c8||0x1f4;return function(_0x478009){logger[_0xfde0('0x23')](_0x478009['stack']);if(_0x478009[_0xfde0('0x36')]){delete _0x478009[_0xfde0('0x36')];}_0x466b8d[_0xfde0('0x28')](_0x6324c8)[_0xfde0('0x37')](_0x478009);};}exports[_0xfde0('0x38')]=function(_0x5bfed1,_0x49f129){var _0x326a0e={},_0x42b82d={},_0x1f9d45={'count':0x0,'rows':[]};var _0x2d14d0=_[_0xfde0('0x39')](db[_0xfde0('0x3a')][_0xfde0('0x3b')],function(_0x35acc9){return{'name':_0x35acc9[_0xfde0('0x3c')],'type':_0x35acc9[_0xfde0('0x3d')][_0xfde0('0x3e')]};});_0x42b82d[_0xfde0('0x3f')]=_[_0xfde0('0x39')](_0x2d14d0,_0xfde0('0x36'));_0x42b82d[_0xfde0('0x40')]=_[_0xfde0('0x41')](_0x5bfed1[_0xfde0('0x40')]);_0x42b82d[_0xfde0('0x42')]=_[_0xfde0('0x43')](_0x42b82d[_0xfde0('0x3f')],_0x42b82d['query']);_0x326a0e[_0xfde0('0x44')]=_[_0xfde0('0x43')](_0x42b82d[_0xfde0('0x3f')],qs[_0xfde0('0x45')](_0x5bfed1[_0xfde0('0x40')][_0xfde0('0x45')]));_0x326a0e[_0xfde0('0x44')]=_0x326a0e['attributes'][_0xfde0('0x46')]?_0x326a0e['attributes']:_0x42b82d[_0xfde0('0x3f')];if(!_0x5bfed1[_0xfde0('0x40')][_0xfde0('0x47')]('nolimit')){_0x326a0e[_0xfde0('0x2c')]=qs[_0xfde0('0x2c')](_0x5bfed1[_0xfde0('0x40')]['limit']);_0x326a0e[_0xfde0('0x2a')]=qs['offset'](_0x5bfed1[_0xfde0('0x40')][_0xfde0('0x2a')]);}_0x326a0e['order']=qs[_0xfde0('0x48')](_0x5bfed1[_0xfde0('0x40')]['sort']);_0x326a0e[_0xfde0('0x49')]=qs[_0xfde0('0x42')](_[_0xfde0('0x4a')](_0x5bfed1[_0xfde0('0x40')],_0x42b82d[_0xfde0('0x42')]),_0x2d14d0);if(_0x5bfed1[_0xfde0('0x40')][_0xfde0('0x4b')]){_0x326a0e[_0xfde0('0x49')]=_[_0xfde0('0x4c')](_0x326a0e['where'],{'$or':_[_0xfde0('0x39')](_0x2d14d0,function(_0x42eaf1){if(_0x42eaf1[_0xfde0('0x3d')]!==_0xfde0('0x4d')){var _0x2fd705={};_0x2fd705[_0x42eaf1[_0xfde0('0x36')]]={'$like':'%'+_0x5bfed1['query'][_0xfde0('0x4b')]+'%'};return _0x2fd705;}})});}_0x326a0e=_[_0xfde0('0x4c')]({},_0x326a0e,_0x5bfed1[_0xfde0('0x4e')]);var _0x364340={'where':_0x326a0e[_0xfde0('0x49')]};return db['Setting'][_0xfde0('0x2d')](_0x364340)[_0xfde0('0x33')](function(_0x433e9a){_0x1f9d45[_0xfde0('0x2d')]=_0x433e9a;if(_0x5bfed1[_0xfde0('0x40')]['includeAll']){_0x326a0e['include']=[{'all':!![]}];}return db[_0xfde0('0x3a')]['findAll'](_0x326a0e);})[_0xfde0('0x33')](function(_0x4a8d9e){_0x1f9d45[_0xfde0('0x4f')]=_0x4a8d9e;return _0x1f9d45;})['then'](respondWithFilteredResult(_0x49f129,_0x326a0e))[_0xfde0('0x50')](handleError(_0x49f129,null));};exports[_0xfde0('0x51')]=function(_0x421858,_0x5d3d97){var _0x3dd89b={'raw':![],'where':{'id':_0x421858[_0xfde0('0x52')]['id']}},_0x1d3efe={};_0x1d3efe[_0xfde0('0x3f')]=_[_0xfde0('0x41')](db[_0xfde0('0x3a')][_0xfde0('0x3b')]);_0x1d3efe['query']=_[_0xfde0('0x41')](_0x421858[_0xfde0('0x40')]);_0x1d3efe[_0xfde0('0x42')]=_[_0xfde0('0x43')](_0x1d3efe[_0xfde0('0x3f')],_0x1d3efe[_0xfde0('0x40')]);_0x3dd89b[_0xfde0('0x44')]=_[_0xfde0('0x43')](_0x1d3efe['model'],qs[_0xfde0('0x45')](_0x421858[_0xfde0('0x40')][_0xfde0('0x45')]));_0x3dd89b[_0xfde0('0x44')]=_0x3dd89b['attributes'][_0xfde0('0x46')]?_0x3dd89b[_0xfde0('0x44')]:_0x1d3efe[_0xfde0('0x3f')];if(_0x421858[_0xfde0('0x40')][_0xfde0('0x53')]){_0x3dd89b[_0xfde0('0x54')]=[{'all':!![]}];}_0x3dd89b=_[_0xfde0('0x4c')]({},_0x3dd89b,_0x421858['options']);return db['Setting']['find'](_0x3dd89b)[_0xfde0('0x33')](handleEntityNotFound(_0x5d3d97,null))[_0xfde0('0x33')](respondWithResult(_0x5d3d97,null))['catch'](handleError(_0x5d3d97,null));};exports[_0xfde0('0x32')]=function(_0x4c69a2,_0x44d1c0){if(_0x4c69a2[_0xfde0('0x55')]['id']){delete _0x4c69a2[_0xfde0('0x55')]['id'];}return db['Setting']['find']({'where':{'id':_0x4c69a2[_0xfde0('0x52')]['id']}})[_0xfde0('0x33')](handleEntityNotFound(_0x44d1c0,null))[_0xfde0('0x33')](saveUpdates(_0x4c69a2[_0xfde0('0x55')],null))['then'](respondWithResult(_0x44d1c0,null))[_0xfde0('0x50')](handleError(_0x44d1c0,null));};exports[_0xfde0('0x56')]=function(_0x289c3c,_0x533772,_0x42ad2a){if(_0x289c3c[_0xfde0('0x57')]&&_0x289c3c[_0xfde0('0x57')][_0xfde0('0x58')]){_0x289c3c[_0xfde0('0x55')][_0xfde0('0x59')]=_0x289c3c['file']['filename'];}return db[_0xfde0('0x3a')][_0xfde0('0x5a')]({'where':{'id':_0x289c3c['params']['id']}})['then'](handleEntityNotFound(_0x533772,null))[_0xfde0('0x33')](saveUpdates(_0x289c3c['body'],null))[_0xfde0('0x33')](respondWithResult(_0x533772,null))['catch'](handleError(_0x533772,null));};exports[_0xfde0('0x5b')]=function(_0x457fab,_0x4e18b6,_0x16db4b){if(_0x457fab[_0xfde0('0x57')]&&_0x457fab[_0xfde0('0x57')][_0xfde0('0x58')]){_0x457fab[_0xfde0('0x55')][_0xfde0('0x5c')]=_0x457fab[_0xfde0('0x57')]['filename'];}return db[_0xfde0('0x3a')]['find']({'where':{'id':_0x457fab[_0xfde0('0x52')]['id']}})['then'](handleEntityNotFound(_0x4e18b6,null))['then'](saveUpdates(_0x457fab[_0xfde0('0x55')],null))[_0xfde0('0x33')](respondWithResult(_0x4e18b6,null))[_0xfde0('0x50')](handleError(_0x4e18b6,null));};var utilLicense=require(_0xfde0('0x19'));exports[_0xfde0('0x5d')]=function(_0x13614b,_0x4be2dc,_0x29f75b){var _0x17657c=_0xfde0('0x5e');var _0x1919fd={'custom':![]};return utilLicense[_0xfde0('0x5f')]()[_0xfde0('0x33')](function(_0x439686){if(_0x439686){_0x1919fd=_0x439686;}return db[_0xfde0('0x3a')]['find']({'where':{'id':_0x13614b['params']['id']},'attributes':[_0xfde0('0x59'),'loginLogo',_0xfde0('0x60'),_0xfde0('0x61'),_0xfde0('0x62'),'defaultLoginLogo',_0xfde0('0x63'),_0xfde0('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x4be2dc,null))[_0xfde0('0x33')](function(_0x308d41){if(_0x308d41){var _0x3ad7bc=_0x308d41[_0xfde0('0x59')]&&fs['existsSync'](path[_0xfde0('0x65')](config['root'],_0x17657c,_[_0xfde0('0x66')](_0x308d41['logo'])))?path[_0xfde0('0x65')](config[_0xfde0('0x67')],_0x17657c,_[_0xfde0('0x66')](_0x308d41[_0xfde0('0x59')])):path[_0xfde0('0x65')](config[_0xfde0('0x67')],_0x17657c,_[_0xfde0('0x66')]('default_logo.svg'));var _0x26bb65=_0xfde0('0x68')+_[_0xfde0('0x69')]('logo');if(_0x308d41[_0x26bb65]||!_0x1919fd[_0xfde0('0x6a')]){_0x3ad7bc=path['join'](config[_0xfde0('0x67')],_0x17657c,_[_0xfde0('0x66')](_0xfde0('0x6b')));}if(!fs['existsSync'](_0x3ad7bc)){throw new db[(_0xfde0('0x6c'))][(_0xfde0('0x6d'))](_['upperFirst'](_0xfde0('0x59'))+_0xfde0('0x6e'));}return _0x4be2dc[_0xfde0('0x6f')](_0x3ad7bc);}})[_0xfde0('0x50')](handleError(_0x4be2dc,null));};var utilLicense=require(_0xfde0('0x19'));exports['getLogoLogin']=function(_0x1e6fa8,_0x520134,_0x3e9eac){var _0xbad2b5=_0xfde0('0x5e');var _0x318b95={'custom':![]};return utilLicense[_0xfde0('0x5f')]()['then'](function(_0x15aded){if(_0x15aded){_0x318b95=_0x15aded;}return db[_0xfde0('0x3a')][_0xfde0('0x5a')]({'where':{'id':_0x1e6fa8[_0xfde0('0x52')]['id']},'attributes':[_0xfde0('0x59'),_0xfde0('0x5c'),_0xfde0('0x60'),_0xfde0('0x61'),_0xfde0('0x62'),_0xfde0('0x70'),_0xfde0('0x63'),_0xfde0('0x64')],'raw':!![]});})[_0xfde0('0x33')](handleEntityNotFound(_0x520134,null))[_0xfde0('0x33')](function(_0x4ffc0d){if(_0x4ffc0d){var _0x1b88e6=_0x4ffc0d[_0xfde0('0x5c')]&&fs[_0xfde0('0x71')](path['join'](config['root'],_0xbad2b5,_[_0xfde0('0x66')](_0x4ffc0d[_0xfde0('0x5c')])))?path[_0xfde0('0x65')](config[_0xfde0('0x67')],_0xbad2b5,_[_0xfde0('0x66')](_0x4ffc0d[_0xfde0('0x5c')])):path['join'](config[_0xfde0('0x67')],_0xbad2b5,_[_0xfde0('0x66')](_0xfde0('0x72')));var _0x1aab5a=_0xfde0('0x68')+_[_0xfde0('0x69')]('loginLogo');if(_0x4ffc0d[_0x1aab5a]||!_0x318b95[_0xfde0('0x6a')]){_0x1b88e6=path[_0xfde0('0x65')](config['root'],_0xbad2b5,_[_0xfde0('0x66')]('default_loginLogo.svg'));}if(!fs[_0xfde0('0x71')](_0x1b88e6)){throw new db[(_0xfde0('0x6c'))][(_0xfde0('0x6d'))](_[_0xfde0('0x69')](_0xfde0('0x5c'))+_0xfde0('0x6e'));}return _0x520134[_0xfde0('0x6f')](_0x1b88e6);}})['catch'](handleError(_0x520134,null));};exports[_0xfde0('0x73')]=function(_0xae8667,_0x18df57){return db[_0xfde0('0x3a')][_0xfde0('0x5a')]({'where':{'id':_0xae8667['params']['id']},'attributes':[_0xfde0('0x74')]})[_0xfde0('0x33')](respondWithResult(_0x18df57,null))[_0xfde0('0x50')](handleError(_0x18df57,null));};exports[_0xfde0('0x75')]=function(_0x270ece,_0x46177c,_0x154941){if(_0x270ece[_0xfde0('0x57')]&&_0x270ece['file']['filename']){_0x270ece[_0xfde0('0x55')][_0xfde0('0x60')]=_0x270ece[_0xfde0('0x57')][_0xfde0('0x58')];}return db[_0xfde0('0x3a')]['find']({'where':{'id':_0x270ece[_0xfde0('0x52')]['id']}})[_0xfde0('0x33')](handleEntityNotFound(_0x46177c,null))[_0xfde0('0x33')](saveUpdates(_0x270ece['body'],null))[_0xfde0('0x33')](respondWithResult(_0x46177c,null))[_0xfde0('0x50')](handleError(_0x46177c,null));};var utilLicense=require(_0xfde0('0x19'));exports[_0xfde0('0x76')]=function(_0x55cb08,_0x595d29,_0x5e3b12){var _0x1e1868=_0xfde0('0x5e');var _0x59f600={'custom':![]};return utilLicense[_0xfde0('0x5f')]()[_0xfde0('0x33')](function(_0x50fab3){if(_0x50fab3){_0x59f600=_0x50fab3;}return db[_0xfde0('0x3a')][_0xfde0('0x5a')]({'where':{'id':_0x55cb08[_0xfde0('0x52')]['id']},'attributes':[_0xfde0('0x59'),_0xfde0('0x5c'),_0xfde0('0x60'),_0xfde0('0x61'),_0xfde0('0x62'),_0xfde0('0x70'),_0xfde0('0x63'),_0xfde0('0x64')],'raw':!![]});})[_0xfde0('0x33')](handleEntityNotFound(_0x595d29,null))[_0xfde0('0x33')](function(_0x3b0dd5){if(_0x3b0dd5){var _0x401f34=_0x3b0dd5['preferred']&&fs[_0xfde0('0x71')](path[_0xfde0('0x65')](config['root'],_0x1e1868,_['toLower'](_0x3b0dd5['preferred'])))?path[_0xfde0('0x65')](config[_0xfde0('0x67')],_0x1e1868,_[_0xfde0('0x66')](_0x3b0dd5[_0xfde0('0x60')])):path[_0xfde0('0x65')](config[_0xfde0('0x67')],_0x1e1868,_[_0xfde0('0x66')](_0xfde0('0x77')));var _0x443562='default'+_[_0xfde0('0x69')](_0xfde0('0x60'));if(_0x3b0dd5[_0x443562]||!_0x59f600[_0xfde0('0x6a')]||!_0x59f600[_0xfde0('0x60')]){_0x401f34=path[_0xfde0('0x65')](config[_0xfde0('0x67')],_0x1e1868,_[_0xfde0('0x66')]('default_preferred.png'));}if(!fs[_0xfde0('0x71')](_0x401f34)){throw new db[(_0xfde0('0x6c'))][(_0xfde0('0x6d'))](_['upperFirst'](_0xfde0('0x60'))+_0xfde0('0x6e'));}return _0x595d29[_0xfde0('0x6f')](_0x401f34);}})['catch'](handleError(_0x595d29,null));};exports['addFavicon']=function(_0x285a9f,_0x118b81,_0x559337){if(_0x285a9f['file']&&_0x285a9f[_0xfde0('0x57')][_0xfde0('0x58')]){_0x285a9f['body'][_0xfde0('0x61')]=_0x285a9f[_0xfde0('0x57')][_0xfde0('0x58')];}return db[_0xfde0('0x3a')]['find']({'where':{'id':_0x285a9f[_0xfde0('0x52')]['id']}})[_0xfde0('0x33')](handleEntityNotFound(_0x118b81,null))['then'](saveUpdates(_0x285a9f[_0xfde0('0x55')],null))[_0xfde0('0x33')](respondWithResult(_0x118b81,null))[_0xfde0('0x50')](handleError(_0x118b81,null));};var utilLicense=require('../../config/license/util');exports[_0xfde0('0x78')]=function(_0x282015,_0x177fe1,_0x3d66a4){var _0x375387=_0xfde0('0x5e');var _0x326d0c={'custom':![]};return utilLicense[_0xfde0('0x5f')]()['then'](function(_0x45c836){if(_0x45c836){_0x326d0c=_0x45c836;}return db[_0xfde0('0x3a')][_0xfde0('0x5a')]({'where':{'id':_0x282015[_0xfde0('0x52')]['id']},'attributes':[_0xfde0('0x59'),_0xfde0('0x5c'),_0xfde0('0x60'),_0xfde0('0x61'),_0xfde0('0x62'),_0xfde0('0x70'),_0xfde0('0x63'),'defaultFavicon'],'raw':!![]});})[_0xfde0('0x33')](handleEntityNotFound(_0x177fe1,null))[_0xfde0('0x33')](function(_0x45f40f){if(_0x45f40f){var _0x278df9=_0x45f40f[_0xfde0('0x61')]&&fs[_0xfde0('0x71')](path['join'](config[_0xfde0('0x67')],_0x375387,_['toLower'](_0x45f40f[_0xfde0('0x61')])))?path[_0xfde0('0x65')](config[_0xfde0('0x67')],_0x375387,_[_0xfde0('0x66')](_0x45f40f['favicon'])):path[_0xfde0('0x65')](config[_0xfde0('0x67')],_0x375387,_['toLower']('default_favicon.ico'));var _0x29932a=_0xfde0('0x68')+_[_0xfde0('0x69')](_0xfde0('0x61'));if(_0x45f40f[_0x29932a]||!_0x326d0c[_0xfde0('0x6a')]){_0x278df9=path[_0xfde0('0x65')](config[_0xfde0('0x67')],_0x375387,_[_0xfde0('0x66')](_0xfde0('0x79')));}if(!fs[_0xfde0('0x71')](_0x278df9)){throw new db['Sequelize'][(_0xfde0('0x6d'))](_[_0xfde0('0x69')](_0xfde0('0x61'))+_0xfde0('0x6e'));}return _0x177fe1[_0xfde0('0x6f')](_0x278df9);}})[_0xfde0('0x50')](handleError(_0x177fe1,null));};exports[_0xfde0('0x7a')]=function(_0x4e4520,_0x2a4ce6){var _0x37efdc={'offset':moment()[_0xfde0('0x7b')]()};_0x37efdc[_0xfde0('0x7c')]=moment()[_0xfde0('0x7b')](_0x37efdc[_0xfde0('0x2a')])['format'](_0xfde0('0x7d'));return _0x2a4ce6[_0xfde0('0x28')](0xc8)[_0xfde0('0x37')](_0x37efdc);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 4481ef4..b5b7e59 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x5cc118,_0x479136){var _0x87ff2b=function(_0x2e3aa7){while(--_0x2e3aa7){_0x5cc118['push'](_0x5cc118['shift']());}};_0x87ff2b(++_0x479136);}(_0x3e74,0x175));var _0x43e7=function(_0x318241,_0x38f0dc){_0x318241=_0x318241-0x0;var _0xf83b59=_0x3e74[_0x318241];return _0xf83b59;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'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(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 9a2f977..cf3c939 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 _0xdeed=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowSetting','Setting','options','raw','where','attributes','map','model','include','stringify','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3ca73f,_0x7acb18){var _0x5787c8=function(_0x154f12){while(--_0x154f12){_0x3ca73f['push'](_0x3ca73f['shift']());}};_0x5787c8(++_0x7acb18);}(_0xdeed,0x15b));var _0xddee=function(_0xa0d7ac,_0x23735e){_0xa0d7ac=_0xa0d7ac-0x0;var _0x44d7b1=_0xdeed[_0xa0d7ac];return _0x44d7b1;};'use strict';var _=require('lodash');var util=require(_0xddee('0x0'));var moment=require(_0xddee('0x1'));var BPromise=require(_0xddee('0x2'));var rs=require(_0xddee('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddee('0x4'))['db'];var utils=require(_0xddee('0x5'));var logger=require(_0xddee('0x6'))(_0xddee('0x7'));var config=require(_0xddee('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xddee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x420167,_0x2bc45f,_0x1acc95){return new BPromise(function(_0x48e01b,_0x396d7b){return client[_0xddee('0xa')](_0x420167,_0x1acc95)[_0xddee('0xb')](function(_0x4fa899){logger[_0xddee('0xc')](_0xddee('0xd'),_0x2bc45f,_0xddee('0xe'));logger[_0xddee('0xf')](_0xddee('0x10'),_0x2bc45f,_0xddee('0xe'),JSON['stringify'](_0x4fa899));if(_0x4fa899[_0xddee('0x11')]){if(_0x4fa899[_0xddee('0x11')][_0xddee('0x12')]===0x1f4){logger[_0xddee('0x11')](_0xddee('0xd'),_0x2bc45f,_0x4fa899[_0xddee('0x11')][_0xddee('0x13')]);return _0x396d7b(_0x4fa899[_0xddee('0x11')][_0xddee('0x13')]);}logger[_0xddee('0x11')](_0xddee('0xd'),_0x2bc45f,_0x4fa899[_0xddee('0x11')][_0xddee('0x13')]);return _0x48e01b(_0x4fa899['error'][_0xddee('0x13')]);}else{logger['info'](_0xddee('0xd'),_0x2bc45f,'request\x20sent');_0x48e01b(_0x4fa899[_0xddee('0x14')][_0xddee('0x13')]);}})['catch'](function(_0x19a30d){logger['error']('Setting,\x20%s,\x20%s',_0x2bc45f,_0x19a30d);_0x396d7b(_0x19a30d);});});}exports[_0xddee('0x15')]=function(_0x4f30b6){var _0x3a0f24=this;return new Promise(function(_0x363b09,_0x8c3de4){return db[_0xddee('0x16')]['find']({'raw':_0x4f30b6[_0xddee('0x17')]?_0x4f30b6[_0xddee('0x17')][_0xddee('0x18')]===undefined?!![]:![]:!![],'where':_0x4f30b6['options']?_0x4f30b6[_0xddee('0x17')][_0xddee('0x19')]||null:null,'attributes':_0x4f30b6[_0xddee('0x17')]?_0x4f30b6['options'][_0xddee('0x1a')]||null:null,'include':_0x4f30b6[_0xddee('0x17')]?_0x4f30b6[_0xddee('0x17')]['include']?_[_0xddee('0x1b')](_0x4f30b6[_0xddee('0x17')]['include'],function(_0x118272){return{'model':db[_0x118272[_0xddee('0x1c')]],'as':_0x118272['as'],'attributes':_0x118272['attributes'],'include':_0x118272[_0xddee('0x1d')]?_[_0xddee('0x1b')](_0x118272[_0xddee('0x1d')],function(_0x1f27af){return{'model':db[_0x1f27af[_0xddee('0x1c')]],'as':_0x1f27af['as'],'attributes':_0x1f27af[_0xddee('0x1a')],'include':_0x1f27af['include']?_['map'](_0x1f27af[_0xddee('0x1d')],function(_0x18b0ca){return{'model':db[_0x18b0ca[_0xddee('0x1c')]],'as':_0x18b0ca['as'],'attributes':_0x18b0ca['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ca3ac){logger['info'](_0xddee('0x15'),_0x4f30b6);logger['debug'](_0xddee('0x15'),_0x4f30b6,JSON[_0xddee('0x1e')](_0x5ca3ac));_0x363b09(_0x5ca3ac);})[_0xddee('0x1f')](function(_0x3d1964){logger[_0xddee('0x11')](_0xddee('0x15'),_0x3d1964[_0xddee('0x13')],_0x4f30b6);_0x8c3de4(_0x3a0f24['error'](0x1f4,_0x3d1964[_0xddee('0x13')]));});});}; \ No newline at end of file +var _0x3818=['../../config/logger','rpc','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSetting','Setting','find','options','raw','where','include','model','attributes','map','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x680b65,_0x5b2e9c){var _0x1c2053=function(_0x1128e0){while(--_0x1128e0){_0x680b65['push'](_0x680b65['shift']());}};_0x1c2053(++_0x5b2e9c);}(_0x3818,0x111));var _0x8381=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3818[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x8381('0x0'));var moment=require(_0x8381('0x1'));var BPromise=require('bluebird');var rs=require(_0x8381('0x2'));var fs=require('fs');var Redis=require(_0x8381('0x3'));var db=require(_0x8381('0x4'))['db'];var utils=require(_0x8381('0x5'));var logger=require(_0x8381('0x6'))(_0x8381('0x7'));var config=require('../../config/environment');var jayson=require(_0x8381('0x8'));var client=jayson[_0x8381('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b814,_0x2e85a5,_0x333f92){return new BPromise(function(_0x3fd4b0,_0x1c0ddf){return client[_0x8381('0xa')](_0x10b814,_0x333f92)[_0x8381('0xb')](function(_0x41e95a){logger[_0x8381('0xc')](_0x8381('0xd'),_0x2e85a5,_0x8381('0xe'));logger[_0x8381('0xf')]('Setting,\x20%s,\x20%s,\x20%s',_0x2e85a5,_0x8381('0xe'),JSON[_0x8381('0x10')](_0x41e95a));if(_0x41e95a['error']){if(_0x41e95a[_0x8381('0x11')][_0x8381('0x12')]===0x1f4){logger[_0x8381('0x11')](_0x8381('0xd'),_0x2e85a5,_0x41e95a[_0x8381('0x11')]['message']);return _0x1c0ddf(_0x41e95a[_0x8381('0x11')][_0x8381('0x13')]);}logger[_0x8381('0x11')](_0x8381('0xd'),_0x2e85a5,_0x41e95a['error'][_0x8381('0x13')]);return _0x3fd4b0(_0x41e95a[_0x8381('0x11')][_0x8381('0x13')]);}else{logger[_0x8381('0xc')]('Setting,\x20%s,\x20%s',_0x2e85a5,_0x8381('0xe'));_0x3fd4b0(_0x41e95a['result'][_0x8381('0x13')]);}})[_0x8381('0x14')](function(_0x5c5835){logger['error'](_0x8381('0xd'),_0x2e85a5,_0x5c5835);_0x1c0ddf(_0x5c5835);});});}exports[_0x8381('0x15')]=function(_0x4b23a5){var _0x28f65e=this;return new Promise(function(_0x36ebee,_0x4bb4e7){return db[_0x8381('0x16')][_0x8381('0x17')]({'raw':_0x4b23a5[_0x8381('0x18')]?_0x4b23a5[_0x8381('0x18')][_0x8381('0x19')]===undefined?!![]:![]:!![],'where':_0x4b23a5[_0x8381('0x18')]?_0x4b23a5['options'][_0x8381('0x1a')]||null:null,'attributes':_0x4b23a5['options']?_0x4b23a5[_0x8381('0x18')]['attributes']||null:null,'include':_0x4b23a5[_0x8381('0x18')]?_0x4b23a5['options']['include']?_['map'](_0x4b23a5[_0x8381('0x18')][_0x8381('0x1b')],function(_0x416e5b){return{'model':db[_0x416e5b[_0x8381('0x1c')]],'as':_0x416e5b['as'],'attributes':_0x416e5b[_0x8381('0x1d')],'include':_0x416e5b[_0x8381('0x1b')]?_[_0x8381('0x1e')](_0x416e5b[_0x8381('0x1b')],function(_0x22993b){return{'model':db[_0x22993b['model']],'as':_0x22993b['as'],'attributes':_0x22993b['attributes'],'include':_0x22993b[_0x8381('0x1b')]?_['map'](_0x22993b[_0x8381('0x1b')],function(_0x3c23f6){return{'model':db[_0x3c23f6['model']],'as':_0x3c23f6['as'],'attributes':_0x3c23f6[_0x8381('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8381('0xb')](function(_0x5349e8){logger[_0x8381('0xc')](_0x8381('0x15'),_0x4b23a5);logger[_0x8381('0xf')](_0x8381('0x15'),_0x4b23a5,JSON['stringify'](_0x5349e8));_0x36ebee(_0x5349e8);})['catch'](function(_0x428a66){logger[_0x8381('0x11')]('ShowSetting',_0x428a66[_0x8381('0x13')],_0x4b23a5);_0x4bb4e7(_0x28f65e[_0x8381('0x11')](0x1f4,_0x428a66[_0x8381('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index f509982..c07b5f0 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 _0x55ca=['describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x55ca,0x126));var _0xa55c=function(_0x497d8c,_0x2904c9){_0x497d8c=_0x497d8c-0x0;var _0xeafed7=_0x55ca[_0x497d8c];return _0xeafed7;};'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['getApplications']);router['get'](_0xa55c('0x11'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0xa55c('0x12'),controller[_0xa55c('0x13')]);router[_0xa55c('0x7')](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x17')](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);router[_0xa55c('0x17')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller['addAnswer']);router[_0xa55c('0x17')](_0xa55c('0x19'),controller[_0xa55c('0x1a')]);router[_0xa55c('0x17')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['addApplications']);router['post'](_0xa55c('0x1b'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x1c')]);router['post'](_0xa55c('0x12'),controller[_0xa55c('0x1d')]);router['post'](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x1e')]);router[_0xa55c('0x1f')](_0xa55c('0xb'),auth['isAuthenticated'](),controller[_0xa55c('0x20')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x21')]);router['delete'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x22')]);router[_0xa55c('0x23')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x24')]);router[_0xa55c('0x23')](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x25')]);module['exports']=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x23e280,_0x394724){var _0x2e33bc=function(_0x3c7289){while(--_0x3c7289){_0x23e280['push'](_0x23e280['shift']());}};_0x2e33bc(++_0x394724);}(_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',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 8a0b97e..120661e 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 _0x8761=['STRING','name','generate','connectel','clicksend','plivo','bandwidth','infobip','intelepeer','ENUM','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'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x8761,0xa5));var _0x1876=function(_0x250779,_0x59660e){_0x250779=_0x250779-0x0;var _0xf93d04=_0x8761[_0x250779];return _0xf93d04;};'use strict';var Sequelize=require(_0x1876('0x0'));var rs=require(_0x1876('0x1'));module[_0x1876('0x2')]={'name':{'type':Sequelize[_0x1876('0x3')],'unique':_0x1876('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x1876('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x1876('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x1876('0x3')],'defaultValue':function(){return rs[_0x1876('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('twilio','skebby',_0x1876('0x6'),_0x1876('0x7'),_0x1876('0x8'),'clickatell',_0x1876('0x9'),'csc',_0x1876('0xa'),_0x1876('0xb'))},'accountSid':{'type':Sequelize[_0x1876('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x1876('0x3')]},'smsMethod':{'type':Sequelize[_0x1876('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x1876('0x3')]},'password':{'type':Sequelize[_0x1876('0x3')]},'apiKey':{'type':Sequelize[_0x1876('0x3')]},'applicationId':{'type':Sequelize[_0x1876('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x1876('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x1876('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1876('0xe')],'defaultValue':function(){return _0x1876('0xf');}},'notificationSound':{'type':Sequelize[_0x1876('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1876('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1876('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1876('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1876('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1876('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x1876('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1876('0x10')],'comment':_0x1876('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x1876('0xd')],'defaultValue':![],'comment':_0x1876('0x12'),'set':function(_0x5afd1e){if(!_0x5afd1e)this[_0x1876('0x13')]('mandatoryDispositionPauseId',null);this[_0x1876('0x13')](_0x1876('0x14'),_0x5afd1e);}}}; \ No newline at end of file +var _0xf422=['sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','clickatell','csc','infobip','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf422,0xc8));var _0x2f42=function(_0xc5a190,_0x523f32){_0xc5a190=_0xc5a190-0x0;var _0x1eeb4a=_0xf422[_0xc5a190];return _0x1eeb4a;};'use strict';var Sequelize=require(_0x2f42('0x0'));var rs=require(_0x2f42('0x1'));module[_0x2f42('0x2')]={'name':{'type':Sequelize[_0x2f42('0x3')],'unique':_0x2f42('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x2f42('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x2f42('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x2f42('0x3')],'defaultValue':function(){return rs[_0x2f42('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2f42('0x6')](_0x2f42('0x7'),_0x2f42('0x8'),_0x2f42('0x9'),_0x2f42('0xa'),'plivo',_0x2f42('0xb'),'bandwidth',_0x2f42('0xc'),_0x2f42('0xd'),'intelepeer')},'accountSid':{'type':Sequelize[_0x2f42('0x3')]},'authId':{'type':Sequelize[_0x2f42('0x3')]},'authToken':{'type':Sequelize[_0x2f42('0x3')]},'smsMethod':{'type':Sequelize[_0x2f42('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x2f42('0x3')]},'password':{'type':Sequelize[_0x2f42('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x2f42('0x3')]},'accountId':{'type':Sequelize[_0x2f42('0x3')]},'senderString':{'type':Sequelize[_0x2f42('0x3')]},'deliveryReport':{'type':Sequelize[_0x2f42('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x2f42('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2f42('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2f42('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2f42('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2f42('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2f42('0xf')],'comment':_0x2f42('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2f42('0x11'),'set':function(_0x4f9d3b){if(!_0x4f9d3b)this[_0x2f42('0x12')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x2f42('0x13'),_0x4f9d3b);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index d070fd9..2104641 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 _0x1d7e=['priority','Applications','Sequelize','ValidationError','createdAt','updatedAt','CompanyId','ListId','mobile','From','messageId','MessageSid','skebby','sender','text','connectel','from','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','refid','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','omit','contact','SmsInteraction','interaction','push','close','unmanaged','*,*,*,*','UserId','User','unshift','waitForTheAssignedAgent','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','set','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','stack','finally','getApplications','CmContact','Owner','internal','Tag','Tags','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','SmsMessage','spread','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','message-id','state','csc','addAgents','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./smsAccount.socket','register','jayson/promise','client','http','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','get','SmsAccounts','UserProfileResource','destroy','name','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','sms','SmsApplication','account','applications','orderBy'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x1d7e,0x66));var _0xe1d7=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x1d7e[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require(_0xe1d7('0x0'));var rimraf=require(_0xe1d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1d7('0x2'));var rp=require(_0xe1d7('0x3'));var moment=require('moment');var BPromise=require(_0xe1d7('0x4'));var Mustache=require(_0xe1d7('0x5'));var util=require(_0xe1d7('0x6'));var path=require(_0xe1d7('0x7'));var sox=require(_0xe1d7('0x8'));var csv=require(_0xe1d7('0x9'));var ejs=require(_0xe1d7('0xa'));var fs=require('fs');var fs_extra=require(_0xe1d7('0xb'));var _=require(_0xe1d7('0xc'));var squel=require('squel');var crypto=require(_0xe1d7('0xd'));var jsforce=require(_0xe1d7('0xe'));var deskjs=require(_0xe1d7('0xf'));var toCsv=require(_0xe1d7('0x9'));var querystring=require(_0xe1d7('0x10'));var Papa=require(_0xe1d7('0x11'));var Redis=require(_0xe1d7('0x12'));var authService=require(_0xe1d7('0x13'));var qs=require(_0xe1d7('0x14'));var as=require(_0xe1d7('0x15'));var hardwareService=require(_0xe1d7('0x16'));var logger=require(_0xe1d7('0x17'))('api');var utils=require(_0xe1d7('0x18'));var config=require(_0xe1d7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe1d7('0x1a'))['db'];config[_0xe1d7('0x1b')]=_[_0xe1d7('0x1c')](config[_0xe1d7('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe1d7('0x1b')]));require(_0xe1d7('0x1d'))[_0xe1d7('0x1e')](socket);var jayson=require(_0xe1d7('0x1f'));var client=jayson[_0xe1d7('0x20')][_0xe1d7('0x21')]({'port':0x232c});function respondWithRpcPromise(_0xe2167f,_0x4344df,_0x1913b3,_0x4aeca6){return new BPromise(function(_0x52b8b0,_0x2a6569){var _0x43c77e=_0x4aeca6||client;return _0x43c77e['request'](_0xe2167f,_0x1913b3)[_0xe1d7('0x22')](function(_0xc0dbed){logger['info'](_0xe1d7('0x23'),_0x4344df,_0xe1d7('0x24'));logger[_0xe1d7('0x25')](_0xe1d7('0x26'),_0x4344df,_0xe1d7('0x24'),JSON['stringify'](_0xc0dbed));if(_0xc0dbed[_0xe1d7('0x27')]){if(_0xc0dbed[_0xe1d7('0x27')]['code']===0x1f4){logger['error'](_0xe1d7('0x23'),_0x4344df,_0xc0dbed[_0xe1d7('0x27')][_0xe1d7('0x28')]);return _0x2a6569(_0xc0dbed[_0xe1d7('0x27')][_0xe1d7('0x28')]);}logger[_0xe1d7('0x27')](_0xe1d7('0x23'),_0x4344df,_0xc0dbed['error'][_0xe1d7('0x28')]);return _0x52b8b0(_0xc0dbed['error']['message']);}else{logger[_0xe1d7('0x29')](_0xe1d7('0x23'),_0x4344df,_0xe1d7('0x24'));_0x52b8b0(_0xc0dbed[_0xe1d7('0x2a')][_0xe1d7('0x28')]);}})[_0xe1d7('0x2b')](function(_0x1becb8){logger[_0xe1d7('0x27')](_0xe1d7('0x23'),_0x4344df,_0x1becb8);_0x2a6569(_0x1becb8);});});}function respondWithStatusCode(_0x3ca5f6,_0x350977){_0x350977=_0x350977||0xcc;return function(_0x16b535){if(_0x16b535){return _0x3ca5f6[_0xe1d7('0x2c')](_0x350977);}return _0x3ca5f6[_0xe1d7('0x2d')](_0x350977)[_0xe1d7('0x2e')]();};}function respondWithResult(_0x541d08,_0x2da8a){_0x2da8a=_0x2da8a||0xc8;return function(_0x51633a){if(_0x51633a){return _0x541d08[_0xe1d7('0x2d')](_0x2da8a)[_0xe1d7('0x2f')](_0x51633a);}};}function respondWithFilteredResult(_0x3a0ebc,_0x109bab){return function(_0xceded0){if(_0xceded0){var _0x567595=typeof _0x109bab[_0xe1d7('0x30')]===_0xe1d7('0x31')&&typeof _0x109bab['limit']==='undefined';var _0x5dedb8=_0xceded0[_0xe1d7('0x32')];var _0xcf67ee=_0x567595?0x0:_0x109bab[_0xe1d7('0x30')];var _0x5c7af6=_0x567595?_0xceded0[_0xe1d7('0x32')]:_0x109bab[_0xe1d7('0x30')]+_0x109bab[_0xe1d7('0x33')];var _0x21741d;if(_0x5c7af6>=_0x5dedb8){_0x5c7af6=_0x5dedb8;_0x21741d=0xc8;}else{_0x21741d=0xce;}_0x3a0ebc['status'](_0x21741d);return _0x3a0ebc['set'](_0xe1d7('0x34'),_0xcf67ee+'-'+_0x5c7af6+'/'+_0x5dedb8)['json'](_0xceded0);}return null;};}function patchUpdates(_0x20fb67){return function(_0x898ce7){try{jsonpatch[_0xe1d7('0x35')](_0x898ce7,_0x20fb67,!![]);}catch(_0x14288d){return BPromise['reject'](_0x14288d);}return _0x898ce7[_0xe1d7('0x36')]();};}function saveUpdates(_0x2bb043,_0x44323e){return function(_0x3209ea){if(_0x3209ea){return _0x3209ea[_0xe1d7('0x37')](_0x2bb043)[_0xe1d7('0x22')](function(_0x3a691a){return _0x3a691a;});}return null;};}function removeEntity(_0x18db32,_0xcad6db){return function(_0x773c12){if(_0x773c12){return _0x773c12['destroy']()['then'](function(){var _0x266b5f=_0x773c12[_0xe1d7('0x38')]({'plain':!![]});var _0x5327bf=_0xe1d7('0x39');return db[_0xe1d7('0x3a')][_0xe1d7('0x3b')]({'where':{'type':_0x5327bf,'resourceId':_0x266b5f['id']}})[_0xe1d7('0x22')](function(){return _0x773c12;});})[_0xe1d7('0x22')](function(){_0x18db32[_0xe1d7('0x2d')](0xcc)[_0xe1d7('0x2e')]();});}};}function handleEntityNotFound(_0x507938,_0x4a7805){return function(_0x265392){if(!_0x265392){_0x507938['sendStatus'](0x194);}return _0x265392;};}function handleError(_0xef95aa,_0x3921b6){_0x3921b6=_0x3921b6||0x1f4;return function(_0x4737ca){logger[_0xe1d7('0x27')](_0x4737ca['stack']);if(_0x4737ca[_0xe1d7('0x3c')]){delete _0x4737ca[_0xe1d7('0x3c')];}_0xef95aa['status'](_0x3921b6)[_0xe1d7('0x3d')](_0x4737ca);};}exports[_0xe1d7('0x3e')]=function(_0x5c6d51,_0x1254de){var _0x46eec1={'include':[{'model':db['Pause'],'as':_0xe1d7('0x3f')}]},_0xafb46c={},_0xc80047={'count':0x0,'rows':[]};var _0x185238=_[_0xe1d7('0x40')](db[_0xe1d7('0x41')][_0xe1d7('0x42')],function(_0x9ff4af){return{'name':_0x9ff4af[_0xe1d7('0x43')],'type':_0x9ff4af[_0xe1d7('0x44')][_0xe1d7('0x45')]};});_0xafb46c['model']=_[_0xe1d7('0x40')](_0x185238,_0xe1d7('0x3c'));_0xafb46c[_0xe1d7('0x46')]=_[_0xe1d7('0x47')](_0x5c6d51['query']);_0xafb46c[_0xe1d7('0x48')]=_[_0xe1d7('0x49')](_0xafb46c[_0xe1d7('0x4a')],_0xafb46c['query']);_0x46eec1[_0xe1d7('0x4b')]=_[_0xe1d7('0x49')](_0xafb46c['model'],qs[_0xe1d7('0x4c')](_0x5c6d51['query'][_0xe1d7('0x4c')]));_0x46eec1[_0xe1d7('0x4b')]=_0x46eec1[_0xe1d7('0x4b')][_0xe1d7('0x4d')]?_0x46eec1['attributes']:_0xafb46c[_0xe1d7('0x4a')];if(!_0x5c6d51[_0xe1d7('0x46')][_0xe1d7('0x4e')](_0xe1d7('0x4f'))){_0x46eec1['limit']=qs[_0xe1d7('0x33')](_0x5c6d51[_0xe1d7('0x46')][_0xe1d7('0x33')]);_0x46eec1[_0xe1d7('0x30')]=qs[_0xe1d7('0x30')](_0x5c6d51['query'][_0xe1d7('0x30')]);}_0x46eec1['order']=qs[_0xe1d7('0x50')](_0x5c6d51[_0xe1d7('0x46')][_0xe1d7('0x50')]);_0x46eec1[_0xe1d7('0x51')]=qs[_0xe1d7('0x48')](_[_0xe1d7('0x52')](_0x5c6d51[_0xe1d7('0x46')],_0xafb46c['filters']),_0x185238);if(_0x5c6d51[_0xe1d7('0x46')][_0xe1d7('0x53')]){_0x46eec1['where']=_[_0xe1d7('0x54')](_0x46eec1['where'],{'$or':_['map'](_0x185238,function(_0x1a25e3){if(_0x1a25e3[_0xe1d7('0x44')]!==_0xe1d7('0x55')){var _0x49c529={};_0x49c529[_0x1a25e3[_0xe1d7('0x3c')]]={'$like':'%'+_0x5c6d51[_0xe1d7('0x46')][_0xe1d7('0x53')]+'%'};return _0x49c529;}})});}_0x46eec1=_[_0xe1d7('0x54')]({},_0x46eec1,_0x5c6d51[_0xe1d7('0x56')]);var _0x1cebeb={'where':_0x46eec1[_0xe1d7('0x51')]};return db[_0xe1d7('0x41')]['count'](_0x1cebeb)[_0xe1d7('0x22')](function(_0x2a9c97){_0xc80047[_0xe1d7('0x32')]=_0x2a9c97;if(_0x5c6d51['query'][_0xe1d7('0x57')]){_0x46eec1[_0xe1d7('0x58')]=[{'all':!![]}];}return db['SmsAccount'][_0xe1d7('0x59')](_0x46eec1);})[_0xe1d7('0x22')](function(_0x3d9823){_0xc80047[_0xe1d7('0x5a')]=_0x3d9823;return _0xc80047;})[_0xe1d7('0x22')](respondWithFilteredResult(_0x1254de,_0x46eec1))['catch'](handleError(_0x1254de,null));};exports[_0xe1d7('0x5b')]=function(_0x254c46,_0x49e697){var _0x2370db={'raw':![],'where':{'id':_0x254c46[_0xe1d7('0x5c')]['id']},'include':[{'model':db[_0xe1d7('0x5d')],'as':_0xe1d7('0x3f')}]},_0x2f6aef={};_0x2f6aef[_0xe1d7('0x4a')]=_[_0xe1d7('0x47')](db[_0xe1d7('0x41')][_0xe1d7('0x42')]);_0x2f6aef[_0xe1d7('0x46')]=_[_0xe1d7('0x47')](_0x254c46[_0xe1d7('0x46')]);_0x2f6aef[_0xe1d7('0x48')]=_[_0xe1d7('0x49')](_0x2f6aef['model'],_0x2f6aef['query']);_0x2370db[_0xe1d7('0x4b')]=_[_0xe1d7('0x49')](_0x2f6aef[_0xe1d7('0x4a')],qs[_0xe1d7('0x4c')](_0x254c46[_0xe1d7('0x46')][_0xe1d7('0x4c')]));_0x2370db[_0xe1d7('0x4b')]=_0x2370db[_0xe1d7('0x4b')][_0xe1d7('0x4d')]?_0x2370db['attributes']:_0x2f6aef['model'];if(_0x254c46[_0xe1d7('0x46')][_0xe1d7('0x57')]){_0x2370db['include']=[{'all':!![]}];}_0x2370db=_[_0xe1d7('0x54')]({},_0x2370db,_0x254c46[_0xe1d7('0x56')]);return db[_0xe1d7('0x41')][_0xe1d7('0x5e')](_0x2370db)['then'](handleEntityNotFound(_0x49e697,null))[_0xe1d7('0x22')](respondWithResult(_0x49e697,null))[_0xe1d7('0x2b')](handleError(_0x49e697,null));};exports['create']=function(_0x11995c,_0xa99f7){return db[_0xe1d7('0x41')][_0xe1d7('0x5f')](_0x11995c[_0xe1d7('0x60')],{})['then'](function(_0x811d55){var _0x5b3575=_0x11995c[_0xe1d7('0x61')]['get']({'plain':!![]});if(!_0x5b3575)throw new Error(_0xe1d7('0x62'));if(_0x5b3575[_0xe1d7('0x63')]==='user'){var _0x21c938=_0x811d55[_0xe1d7('0x38')]({'plain':!![]});var _0xfd98a=_0xe1d7('0x39');return db[_0xe1d7('0x64')][_0xe1d7('0x5e')]({'where':{'name':_0xfd98a,'userProfileId':_0x5b3575['userProfileId']},'raw':!![]})[_0xe1d7('0x22')](function(_0x34c0c4){if(_0x34c0c4&&_0x34c0c4[_0xe1d7('0x65')]===0x0){return db[_0xe1d7('0x3a')][_0xe1d7('0x5f')]({'name':_0x21c938[_0xe1d7('0x3c')],'resourceId':_0x21c938['id'],'type':_0x34c0c4[_0xe1d7('0x3c')],'sectionId':_0x34c0c4['id']},{})[_0xe1d7('0x22')](function(){return _0x811d55;});}else{return _0x811d55;}})[_0xe1d7('0x2b')](function(_0x362c53){logger[_0xe1d7('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x362c53);throw _0x362c53;});}return _0x811d55;})['then'](respondWithResult(_0xa99f7,0xc9))['catch'](handleError(_0xa99f7,null));};exports['update']=function(_0x3cc117,_0x417fea){if(_0x3cc117[_0xe1d7('0x60')]['id']){delete _0x3cc117[_0xe1d7('0x60')]['id'];}return db[_0xe1d7('0x41')][_0xe1d7('0x5e')]({'where':{'id':_0x3cc117[_0xe1d7('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xe1d7('0x3f')}]})[_0xe1d7('0x22')](handleEntityNotFound(_0x417fea,null))[_0xe1d7('0x22')](saveUpdates(_0x3cc117['body'],null))[_0xe1d7('0x22')](respondWithResult(_0x417fea,null))[_0xe1d7('0x2b')](handleError(_0x417fea,null));};exports[_0xe1d7('0x3b')]=function(_0x14f40a,_0x2090e0){return db[_0xe1d7('0x41')]['find']({'where':{'id':_0x14f40a[_0xe1d7('0x5c')]['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x2090e0,null))[_0xe1d7('0x22')](removeEntity(_0x2090e0,null))[_0xe1d7('0x2b')](handleError(_0x2090e0,null));};exports[_0xe1d7('0x66')]=function(_0x473aab,_0x51f264){return db['SmsAccount'][_0xe1d7('0x66')]()['then'](respondWithResult(_0x51f264,null))[_0xe1d7('0x2b')](handleError(_0x51f264,null));};exports[_0xe1d7('0x67')]=function(_0x225af3,_0x27fb2f,_0x290cb3){if(_0x225af3[_0xe1d7('0x60')]['id']){delete _0x225af3['body']['id'];}return db[_0xe1d7('0x41')][_0xe1d7('0x5e')]({'where':{'id':_0x225af3[_0xe1d7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x27fb2f,null))[_0xe1d7('0x22')](function(_0x15b756){if(_0x15b756){_0x225af3['body'][_0xe1d7('0x68')]=_0x15b756['id'];return db[_0xe1d7('0x69')][_0xe1d7('0x5f')](_0x225af3[_0xe1d7('0x60')]);}})['then'](respondWithResult(_0x27fb2f,null))[_0xe1d7('0x2b')](handleError(_0x27fb2f,null));};exports[_0xe1d7('0x6a')]=function(_0x289200,_0x183b86,_0xdc42e3){var _0x48c790={'raw':![],'where':{}};var _0x2fe94d={};var _0x159dad={'count':0x0,'rows':[]};return db[_0xe1d7('0x41')][_0xe1d7('0x6b')]({'where':{'id':_0x289200['params']['id']}})['then'](handleEntityNotFound(_0x183b86,null))[_0xe1d7('0x22')](function(_0x35fe2d){if(_0x35fe2d){_0x2fe94d['model']=_['keys'](db[_0xe1d7('0x69')]['rawAttributes']);_0x2fe94d[_0xe1d7('0x46')]=_[_0xe1d7('0x47')](_0x289200[_0xe1d7('0x46')]);_0x2fe94d[_0xe1d7('0x48')]=_[_0xe1d7('0x49')](_0x2fe94d[_0xe1d7('0x4a')],_0x2fe94d[_0xe1d7('0x46')]);_0x48c790['attributes']=_[_0xe1d7('0x49')](_0x2fe94d[_0xe1d7('0x4a')],qs[_0xe1d7('0x4c')](_0x289200['query'][_0xe1d7('0x4c')]));_0x48c790[_0xe1d7('0x4b')]=_0x48c790[_0xe1d7('0x4b')]['length']?_0x48c790[_0xe1d7('0x4b')]:_0x2fe94d['model'];if(!_0x289200['query'][_0xe1d7('0x4e')](_0xe1d7('0x4f'))){_0x48c790[_0xe1d7('0x33')]=qs[_0xe1d7('0x33')](_0x289200[_0xe1d7('0x46')][_0xe1d7('0x33')]);_0x48c790[_0xe1d7('0x30')]=qs[_0xe1d7('0x30')](_0x289200[_0xe1d7('0x46')][_0xe1d7('0x30')]);}_0x48c790['order']=qs[_0xe1d7('0x50')](_0x289200[_0xe1d7('0x46')][_0xe1d7('0x50')]);_0x48c790['where']=qs[_0xe1d7('0x48')](_[_0xe1d7('0x52')](_0x289200[_0xe1d7('0x46')],_0x2fe94d[_0xe1d7('0x48')]));_0x48c790['where'][_0xe1d7('0x68')]=_0x35fe2d['id'];if(_0x289200[_0xe1d7('0x46')][_0xe1d7('0x53')]){_0x48c790[_0xe1d7('0x51')]=_[_0xe1d7('0x54')](_0x48c790['where'],{'$or':_[_0xe1d7('0x40')](_0x48c790[_0xe1d7('0x4b')],function(_0x1f99eb){var _0x29e15c={};_0x29e15c[_0x1f99eb]={'$like':'%'+_0x289200[_0xe1d7('0x46')][_0xe1d7('0x53')]+'%'};return _0x29e15c;})});}_0x48c790=_[_0xe1d7('0x54')]({},_0x48c790,_0x289200[_0xe1d7('0x56')]);return db[_0xe1d7('0x69')][_0xe1d7('0x32')]({'where':_0x48c790[_0xe1d7('0x51')]})[_0xe1d7('0x22')](function(_0x264d7c){_0x159dad[_0xe1d7('0x32')]=_0x264d7c;if(_0x289200['query']['includeAll']){_0x48c790[_0xe1d7('0x58')]=[{'all':!![]}];}return db[_0xe1d7('0x69')]['findAll'](_0x48c790);})[_0xe1d7('0x22')](function(_0x468801){_0x159dad[_0xe1d7('0x5a')]=_0x468801;return _0x159dad;});}})[_0xe1d7('0x22')](respondWithFilteredResult(_0x183b86,_0x48c790))[_0xe1d7('0x2b')](handleError(_0x183b86,null));};exports[_0xe1d7('0x6c')]=function(_0x46fb2b,_0x3242dc,_0x3c79d9){return db[_0xe1d7('0x41')][_0xe1d7('0x5e')]({'where':{'id':_0x46fb2b[_0xe1d7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3242dc,null))[_0xe1d7('0x22')](function(_0x4408b6){if(_0x4408b6){return _0x4408b6[_0xe1d7('0x6c')](_0x46fb2b[_0xe1d7('0x46')][_0xe1d7('0x6d')]);}})[_0xe1d7('0x22')](respondWithStatusCode(_0x3242dc,null))[_0xe1d7('0x2b')](handleError(_0x3242dc,null));};exports[_0xe1d7('0x6e')]=function(_0x442574,_0x2f2046,_0x594e60){if(_0x442574[_0xe1d7('0x60')]['id']){delete _0x442574[_0xe1d7('0x60')]['id'];}return db[_0xe1d7('0x41')]['find']({'where':{'id':_0x442574['params']['id']}})['then'](handleEntityNotFound(_0x2f2046,null))[_0xe1d7('0x22')](function(_0x1d8fce){if(_0x1d8fce){_0x442574[_0xe1d7('0x60')][_0xe1d7('0x68')]=_0x1d8fce['id'];return db[_0xe1d7('0x6f')][_0xe1d7('0x5f')](_0x442574[_0xe1d7('0x60')]);}})[_0xe1d7('0x22')](respondWithResult(_0x2f2046,null))[_0xe1d7('0x2b')](handleError(_0x2f2046,null));};exports[_0xe1d7('0x70')]=function(_0x3d8470,_0x8229d8,_0x2474f8){var _0x33b7ed={'raw':![],'where':{}};var _0x3793f8={};var _0x56f648={'count':0x0,'rows':[]};return db[_0xe1d7('0x41')][_0xe1d7('0x6b')]({'where':{'id':_0x3d8470['params']['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x8229d8,null))[_0xe1d7('0x22')](function(_0x46c6be){if(_0x46c6be){_0x3793f8[_0xe1d7('0x4a')]=_['keys'](db[_0xe1d7('0x6f')]['rawAttributes']);_0x3793f8[_0xe1d7('0x46')]=_[_0xe1d7('0x47')](_0x3d8470[_0xe1d7('0x46')]);_0x3793f8[_0xe1d7('0x48')]=_['intersection'](_0x3793f8[_0xe1d7('0x4a')],_0x3793f8[_0xe1d7('0x46')]);_0x33b7ed[_0xe1d7('0x4b')]=_[_0xe1d7('0x49')](_0x3793f8[_0xe1d7('0x4a')],qs['fields'](_0x3d8470[_0xe1d7('0x46')]['fields']));_0x33b7ed[_0xe1d7('0x4b')]=_0x33b7ed[_0xe1d7('0x4b')][_0xe1d7('0x4d')]?_0x33b7ed[_0xe1d7('0x4b')]:_0x3793f8[_0xe1d7('0x4a')];if(!_0x3d8470['query'][_0xe1d7('0x4e')]('nolimit')){_0x33b7ed[_0xe1d7('0x33')]=qs[_0xe1d7('0x33')](_0x3d8470[_0xe1d7('0x46')][_0xe1d7('0x33')]);_0x33b7ed[_0xe1d7('0x30')]=qs[_0xe1d7('0x30')](_0x3d8470['query'][_0xe1d7('0x30')]);}_0x33b7ed[_0xe1d7('0x71')]=qs[_0xe1d7('0x50')](_0x3d8470[_0xe1d7('0x46')]['sort']);_0x33b7ed['where']=qs[_0xe1d7('0x48')](_[_0xe1d7('0x52')](_0x3d8470[_0xe1d7('0x46')],_0x3793f8['filters']));_0x33b7ed['where'][_0xe1d7('0x68')]=_0x46c6be['id'];if(_0x3d8470[_0xe1d7('0x46')][_0xe1d7('0x53')]){_0x33b7ed[_0xe1d7('0x51')]=_[_0xe1d7('0x54')](_0x33b7ed['where'],{'$or':_[_0xe1d7('0x40')](_0x33b7ed[_0xe1d7('0x4b')],function(_0x38f332){var _0x4a3ee4={};_0x4a3ee4[_0x38f332]={'$like':'%'+_0x3d8470[_0xe1d7('0x46')][_0xe1d7('0x53')]+'%'};return _0x4a3ee4;})});}_0x33b7ed=_['merge']({},_0x33b7ed,_0x3d8470[_0xe1d7('0x56')]);return db[_0xe1d7('0x6f')][_0xe1d7('0x32')]({'where':_0x33b7ed[_0xe1d7('0x51')]})[_0xe1d7('0x22')](function(_0x457344){_0x56f648[_0xe1d7('0x32')]=_0x457344;if(_0x3d8470[_0xe1d7('0x46')][_0xe1d7('0x57')]){_0x33b7ed[_0xe1d7('0x58')]=[{'all':!![]}];}return db[_0xe1d7('0x6f')]['findAll'](_0x33b7ed);})['then'](function(_0x149fbd){_0x56f648['rows']=_0x149fbd;return _0x56f648;});}})[_0xe1d7('0x22')](respondWithFilteredResult(_0x8229d8,_0x33b7ed))[_0xe1d7('0x2b')](handleError(_0x8229d8,null));};exports['removeAnswers']=function(_0x437501,_0x2c70a5,_0x430f91){return db['SmsAccount'][_0xe1d7('0x5e')]({'where':{'id':_0x437501[_0xe1d7('0x5c')]['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x2c70a5,null))['then'](function(_0x2adcbe){if(_0x2adcbe){return _0x2adcbe['removeAnswers'](_0x437501['query'][_0xe1d7('0x6d')]);}})[_0xe1d7('0x22')](respondWithStatusCode(_0x2c70a5,null))[_0xe1d7('0x2b')](handleError(_0x2c70a5,null));};exports['notify']=function(_0x23b66c,_0x244dbe,_0x4f0d64){var _0x278626={'channel':_0xe1d7('0x72')};var _0x7c6b6f=[];var _0x19b008=[];var _0x3825ce={};return db[_0xe1d7('0x41')][_0xe1d7('0x5e')]({'where':{'id':_0x23b66c[_0xe1d7('0x5c')]['id']},'include':[{'model':db[_0xe1d7('0x73')],'as':'Applications'}]})[_0xe1d7('0x22')](handleEntityNotFound(_0x244dbe,null))[_0xe1d7('0x22')](function(_0x2eee63){_0x278626[_0xe1d7('0x74')]=_0x2eee63;_0x278626[_0xe1d7('0x75')]=_[_0xe1d7('0x76')](_0x2eee63['Applications'],[_0xe1d7('0x77')],['asc']);if(_0x278626[_0xe1d7('0x74')][_0xe1d7('0x78')]){delete _0x278626['account'][_0xe1d7('0x78')];}return db['CmContact'][_0xe1d7('0x66')]();})[_0xe1d7('0x22')](function(_0x5222c6){if(!_0x5222c6){throw new db[(_0xe1d7('0x79'))][(_0xe1d7('0x7a'))]('no\x20available\x20attributes');}_0x7c6b6f=_['difference'](_[_0xe1d7('0x47')](_0x5222c6),[_0xe1d7('0x7b'),_0xe1d7('0x7c')]);_0x19b008=_['difference'](_['keys'](_0x5222c6),['createdAt','updatedAt',_0xe1d7('0x7d'),_0xe1d7('0x7e')]);_0x278626[_0xe1d7('0x60')]={'mapKey':_0xe1d7('0x7f')};if(_0x278626[_0xe1d7('0x74')]['type']){switch(_0x278626[_0xe1d7('0x74')][_0xe1d7('0x44')]){case'twilio':_0x278626['body']['from']=_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x80')];_0x278626[_0xe1d7('0x60')][_0xe1d7('0x60')]=_0x23b66c[_0xe1d7('0x60')]['Body'];_0x278626[_0xe1d7('0x60')][_0xe1d7('0x81')]=_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x82')];break;case _0xe1d7('0x83'):_0x278626[_0xe1d7('0x60')]['from']='+'+_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x84')];_0x278626['body'][_0xe1d7('0x60')]=_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x85')];break;case _0xe1d7('0x86'):_0x278626[_0xe1d7('0x60')][_0xe1d7('0x87')]=_0x23b66c['body'][_0xe1d7('0x87')];_0x278626[_0xe1d7('0x60')][_0xe1d7('0x60')]=_0x23b66c[_0xe1d7('0x60')]['message'];break;case _0xe1d7('0x88'):_0x278626[_0xe1d7('0x60')]['from']=_0x23b66c['body'][_0xe1d7('0x87')];_0x278626[_0xe1d7('0x60')]['body']=_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x60')];_0x278626['body'][_0xe1d7('0x81')]=_0x23b66c['body'][_0xe1d7('0x89')];break;case _0xe1d7('0x8a'):_0x278626[_0xe1d7('0x60')][_0xe1d7('0x87')]=_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x80')];_0x278626[_0xe1d7('0x60')]['body']=_0x23b66c['body'][_0xe1d7('0x8b')];_0x278626['body'][_0xe1d7('0x81')]=_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x8c')];break;case _0xe1d7('0x8d'):_0x278626[_0xe1d7('0x60')][_0xe1d7('0x87')]='+'+_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x8e')][0x0][_0xe1d7('0x87')];_0x278626[_0xe1d7('0x60')][_0xe1d7('0x60')]=_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x8e')][0x0][_0xe1d7('0x85')];_0x278626['body'][_0xe1d7('0x81')]=_0x23b66c['body']['results'][0x0][_0xe1d7('0x81')];break;case'csc':_0x278626['body'][_0xe1d7('0x87')]=_0x23b66c['body']['originatingAddress'];_0x278626[_0xe1d7('0x60')][_0xe1d7('0x60')]=_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x8f')][_0xe1d7('0x28')];break;case _0xe1d7('0x90'):_0x278626[_0xe1d7('0x60')][_0xe1d7('0x87')]=_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x91')];_0x278626[_0xe1d7('0x60')]['body']=_0x23b66c['body'][_0xe1d7('0x85')];_0x278626[_0xe1d7('0x60')][_0xe1d7('0x81')]=_0x23b66c[_0xe1d7('0x60')]['replyMessageId'];break;case _0xe1d7('0x92'):_0x278626[_0xe1d7('0x60')]['messageId']=_0x23b66c[_0xe1d7('0x60')][0x0][_0xe1d7('0x28')]['id'];_0x278626['body']['from']=_0x23b66c[_0xe1d7('0x60')][0x0]['message'][_0xe1d7('0x87')];_0x278626[_0xe1d7('0x60')][_0xe1d7('0x60')]=_0x23b66c[_0xe1d7('0x60')][0x0][_0xe1d7('0x28')]['text'];break;case _0xe1d7('0x93'):_0x278626[_0xe1d7('0x60')]['from']=_0x23b66c['body'][_0xe1d7('0x87')];_0x278626[_0xe1d7('0x60')][_0xe1d7('0x60')]=_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x28')];_0x278626[_0xe1d7('0x60')][_0xe1d7('0x81')]=_0x23b66c[_0xe1d7('0x60')][_0xe1d7('0x94')];break;}}if(_0x278626[_0xe1d7('0x60')]['id']){delete _0x278626['body']['id'];}if(_[_0xe1d7('0x95')](_0x278626[_0xe1d7('0x60')][_0xe1d7('0x87')])){throw new db[(_0xe1d7('0x79'))][(_0xe1d7('0x7a'))]('from\x20is\x20mandatory');}if(_[_0xe1d7('0x95')](_0x278626['body'][_0xe1d7('0x60')])||_0x278626[_0xe1d7('0x60')][_0xe1d7('0x60')]===''){throw new db['Sequelize'][(_0xe1d7('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe1d7('0x95')](_0x278626[_0xe1d7('0x60')][_0xe1d7('0x96')])){throw new db[(_0xe1d7('0x79'))][(_0xe1d7('0x7a'))](_0xe1d7('0x97')+_0x19b008);}if(!_[_0xe1d7('0x98')](_0x19b008,_0x278626[_0xe1d7('0x60')][_0xe1d7('0x96')])){throw new db['Sequelize'][(_0xe1d7('0x7a'))](_0xe1d7('0x99')+_0x19b008);}_0x3825ce[_0x278626[_0xe1d7('0x60')][_0xe1d7('0x96')]]=_0x278626['body']['from'];return db['CmList']['find']({'where':{'id':_0x278626[_0xe1d7('0x74')]['ListId']},'include':[{'model':db['CmContact'],'as':_0xe1d7('0x9a'),'where':_0x3825ce,'limit':0x1,'order':[['updatedAt',_0xe1d7('0x9b')]]}]});})[_0xe1d7('0x22')](handleEntityNotFound(_0x244dbe,null))[_0xe1d7('0x22')](function(_0x1dcf39){if(_0x1dcf39){_0x278626['list']=_[_0xe1d7('0x9c')](_0x1dcf39,[_0xe1d7('0x9a')]);if(_0x1dcf39[_0xe1d7('0x9a')][_0xe1d7('0x4d')]){return _0x1dcf39[_0xe1d7('0x9a')][0x0];}var _0x1eb60f=_[_0xe1d7('0x1c')](_0x278626[_0xe1d7('0x60')],{'firstName':_0x278626['body'][_0xe1d7('0x87')],'ListId':_0x1dcf39['id']});_0x1eb60f[_0x278626['body']['mapKey']]=_0x278626[_0xe1d7('0x60')][_0xe1d7('0x87')];return db['CmContact'][_0xe1d7('0x5f')](_0x1eb60f,{'fields':_0x7c6b6f,'raw':!![]});}})[_0xe1d7('0x22')](handleEntityNotFound(_0x244dbe,null))[_0xe1d7('0x22')](function(_0x56b201){if(_0x56b201){_0x278626[_0xe1d7('0x9d')]=_0x56b201;var _0x458d81={'ContactId':_0x56b201['id'],'phone':_0x278626['body'][_0xe1d7('0x87')],'SmsAccountId':_0x23b66c['params']['id']};var _0x9b6296={'ContactId':_0x56b201['id'],'SmsAccountId':_0x23b66c[_0xe1d7('0x5c')]['id'],'closed':![]};return db[_0xe1d7('0x9e')][_0xe1d7('0x5e')]({'where':_0x9b6296})[_0xe1d7('0x22')](function(_0x50c909){if(_0x50c909){return[_0x50c909,![]];}return db['SmsInteraction'][_0xe1d7('0x5f')](_0x458d81)[_0xe1d7('0x22')](function(_0x5552c8){return[_0x5552c8,!![]];});});}})['spread'](function(_0x449891,_0x55cecb){_0x278626['interaction']=_0x449891[_0xe1d7('0x38')]({'plain':!![]});_0x278626[_0xe1d7('0x9f')]['created']=![];if(_0x55cecb){if(_0x278626[_0xe1d7('0x74')]['autoclose']){_0x278626[_0xe1d7('0x75')][_0xe1d7('0xa0')]({'id':0x0,'priority':_0x278626[_0xe1d7('0x75')][_0xe1d7('0x4d')]+0x1,'app':_0xe1d7('0xa1'),'appdata':_0xe1d7('0xa2'),'interval':_0xe1d7('0xa3')});}_0x278626[_0xe1d7('0x9f')]['created']=!![];}return db['SmsMessage'][_0xe1d7('0x5f')]({'phone':_0x278626[_0xe1d7('0x60')][_0xe1d7('0x87')],'messageId':_0x278626[_0xe1d7('0x60')][_0xe1d7('0x81')],'body':_0x278626[_0xe1d7('0x60')][_0xe1d7('0x60')],'SmsAccountId':_0x23b66c[_0xe1d7('0x5c')]['id'],'SmsInteractionId':_0x449891['id'],'direction':'in','ContactId':_0x449891['ContactId'],'AttachmentId':_0x278626[_0xe1d7('0x60')]['AttachmentId']});})[_0xe1d7('0x22')](function(_0x1e20d7){_0x278626['message']=_0x1e20d7;if(_0x278626[_0xe1d7('0x9f')][_0xe1d7('0xa4')]){return db[_0xe1d7('0xa5')][_0xe1d7('0x5e')]({'attributes':['id',_0xe1d7('0x3c')],'where':{'id':_0x278626[_0xe1d7('0x9f')]['UserId']}})['then'](function(_0x574f60){if(_0x574f60){_0x278626[_0xe1d7('0x75')][_0xe1d7('0xa6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x574f60[_0xe1d7('0x3c')]+','+(_0x278626['account'][_0xe1d7('0xa7')]||0xa),'interval':_0xe1d7('0xa3')});}return respondWithRpcPromise(_0xe1d7('0xa8'),'startRouting',_0x278626);});}return respondWithRpcPromise(_0xe1d7('0xa8'),'startRouting',_0x278626);})[_0xe1d7('0x22')](function(_0x46ab35){if(_0x46ab35){var _0x59bc6f=0xc8;var _0x2424b4=_0xe1d7('0xa9');logger['info'](_0xe1d7('0x26'),_0x2424b4,_0x59bc6f,'entity\x20found');logger[_0xe1d7('0x25')](_0xe1d7('0xaa'),_0x2424b4,_0x59bc6f,_0xe1d7('0xab'),JSON[_0xe1d7('0xac')](_0x46ab35));if(_0x278626[_0xe1d7('0x74')][_0xe1d7('0x44')]==='twilio'){return _0x244dbe['status'](_0x59bc6f)[_0xe1d7('0xad')](_0xe1d7('0xae'),_0xe1d7('0xaf'))[_0xe1d7('0x3d')](_0xe1d7('0xb0'));}else{return _0x244dbe['status'](_0x59bc6f)[_0xe1d7('0x2f')](_0x46ab35);}}})[_0xe1d7('0x2b')](handleError(_0x244dbe,null));};exports[_0xe1d7('0xb1')]=function(_0x38b35b,_0x21c180){var _0x2111c9=_0x38b35b[_0xe1d7('0x5c')]['id'];var _0x567a31=_0x38b35b[_0xe1d7('0x60')];var _0x24a67d=0xc8;var _0x88b20b=null;return db[_0xe1d7('0xb2')][_0xe1d7('0xb3')]({'isolationLevel':db[_0xe1d7('0xb2')][_0xe1d7('0xb4')]['ISOLATION_LEVELS'][_0xe1d7('0xb5')]},function(_0x5a2006){return db[_0xe1d7('0x41')]['findOne']({'where':{'id':_0x2111c9},'transaction':_0x5a2006})[_0xe1d7('0x22')](function(_0x3aacee){if(_0x3aacee){return db[_0xe1d7('0x73')][_0xe1d7('0x3b')]({'where':{'SmsAccountId':_0x2111c9},'transaction':_0x5a2006})[_0xe1d7('0x22')](function(){var _0x2ff5ab=_['map'](_0x567a31,function(_0x3af330){_0x3af330[_0xe1d7('0x68')]=_0x2111c9;return _0x3af330;});return db[_0xe1d7('0x73')][_0xe1d7('0xb6')](_0x2ff5ab,{'transaction':_0x5a2006});});}else{_0x24a67d=0x194;_0x88b20b=[];}});})[_0xe1d7('0x22')](function(){if(_0x24a67d!==0x194){return db[_0xe1d7('0x73')]['findAndCountAll']({'where':{'SmsAccountId':_0x2111c9},'order':_0xe1d7('0x77')})[_0xe1d7('0x22')](function(_0x2b5377){_0x88b20b=_0x2b5377;});}})[_0xe1d7('0x2b')](function(_0xbc8cf5){_0x24a67d=0x1f4;logger[_0xe1d7('0x27')](_0xbc8cf5[_0xe1d7('0xb7')]);if(_0xbc8cf5[_0xe1d7('0x3c')]){delete _0xbc8cf5['name'];}_0x88b20b=_0xbc8cf5;})[_0xe1d7('0xb8')](function(){if(_0x88b20b===null){_0x21c180[_0xe1d7('0x2c')](_0x24a67d);}else{if(_0x24a67d===0x1f4){_0x21c180[_0xe1d7('0x2d')](_0x24a67d)[_0xe1d7('0x3d')](_0x88b20b);}else{_0x21c180[_0xe1d7('0x2d')](_0x24a67d)[_0xe1d7('0x2f')](_0x88b20b);}}});};exports[_0xe1d7('0xb9')]=function(_0xcd9dd0,_0x574e9c,_0x268eb0){var _0x279817={};var _0x95750e={};var _0x3d68ca;var _0x4347f7;return db['SmsAccount']['findOne']({'where':{'id':_0xcd9dd0[_0xe1d7('0x5c')]['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x574e9c,null))[_0xe1d7('0x22')](function(_0x3822fe){if(_0x3822fe){_0x3d68ca=_0x3822fe;_0x95750e['model']=_[_0xe1d7('0x47')](db['SmsApplication']['rawAttributes']);_0x95750e[_0xe1d7('0x46')]=_['keys'](_0xcd9dd0[_0xe1d7('0x46')]);_0x95750e[_0xe1d7('0x48')]=_[_0xe1d7('0x49')](_0x95750e[_0xe1d7('0x4a')],_0x95750e[_0xe1d7('0x46')]);_0x279817[_0xe1d7('0x4b')]=_[_0xe1d7('0x49')](_0x95750e[_0xe1d7('0x4a')],qs[_0xe1d7('0x4c')](_0xcd9dd0[_0xe1d7('0x46')][_0xe1d7('0x4c')]));_0x279817['attributes']=_0x279817[_0xe1d7('0x4b')]['length']?_0x279817[_0xe1d7('0x4b')]:_0x95750e[_0xe1d7('0x4a')];_0x279817[_0xe1d7('0x71')]=qs[_0xe1d7('0x50')](_0xcd9dd0[_0xe1d7('0x46')][_0xe1d7('0x50')]);_0x279817[_0xe1d7('0x51')]=qs[_0xe1d7('0x48')](_[_0xe1d7('0x52')](_0xcd9dd0[_0xe1d7('0x46')],_0x95750e[_0xe1d7('0x48')]));if(_0xcd9dd0['query'][_0xe1d7('0x53')]){_0x279817['where']=_['merge'](_0x279817['where'],{'$or':_[_0xe1d7('0x40')](_0x279817[_0xe1d7('0x4b')],function(_0x2f2b27){var _0x1b7e4f={};_0x1b7e4f[_0x2f2b27]={'$like':'%'+_0xcd9dd0[_0xe1d7('0x46')]['filter']+'%'};return _0x1b7e4f;})});}_0x279817=_['merge']({},_0x279817,_0xcd9dd0[_0xe1d7('0x56')]);return _0x3d68ca['getApplications'](_0x279817);}})[_0xe1d7('0x22')](function(_0x2bcf31){if(_0x2bcf31){_0x4347f7=_0x2bcf31[_0xe1d7('0x4d')];if(!_0xcd9dd0[_0xe1d7('0x46')][_0xe1d7('0x4e')]('nolimit')){_0x279817[_0xe1d7('0x33')]=qs[_0xe1d7('0x33')](_0xcd9dd0[_0xe1d7('0x46')]['limit']);_0x279817[_0xe1d7('0x30')]=qs[_0xe1d7('0x30')](_0xcd9dd0[_0xe1d7('0x46')][_0xe1d7('0x30')]);}return _0x3d68ca[_0xe1d7('0xb9')](_0x279817);}})['then'](function(_0x58a809){if(_0x58a809){return _0x58a809?{'count':_0x4347f7,'rows':_0x58a809}:null;}})[_0xe1d7('0x22')](respondWithResult(_0x574e9c,null))['catch'](handleError(_0x574e9c,null));};exports['getInteractions']=function(_0x2e14c2,_0x29f1a9,_0x3a6ea9){var _0x55359d={'raw':![],'where':{}};var _0x2a8040={};var _0x39af41={'count':0x0,'rows':[]};return db[_0xe1d7('0x41')]['findOne']({'where':{'id':_0x2e14c2[_0xe1d7('0x5c')]['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x29f1a9,null))[_0xe1d7('0x22')](function(_0x3742a1){if(_0x3742a1){_0x2a8040[_0xe1d7('0x4a')]=_[_0xe1d7('0x47')](db[_0xe1d7('0x9e')][_0xe1d7('0x42')]);_0x2a8040['query']=_[_0xe1d7('0x47')](_0x2e14c2[_0xe1d7('0x46')]);_0x2a8040[_0xe1d7('0x48')]=_['intersection'](_0x2a8040[_0xe1d7('0x4a')],_0x2a8040[_0xe1d7('0x46')]);_0x55359d[_0xe1d7('0x4b')]=_[_0xe1d7('0x49')](_0x2a8040[_0xe1d7('0x4a')],qs[_0xe1d7('0x4c')](_0x2e14c2[_0xe1d7('0x46')]['fields']));_0x55359d[_0xe1d7('0x4b')]=_0x55359d[_0xe1d7('0x4b')]['length']?_0x55359d[_0xe1d7('0x4b')]:_0x2a8040['model'];if(!_0x2e14c2['query'][_0xe1d7('0x4e')](_0xe1d7('0x4f'))){_0x55359d[_0xe1d7('0x33')]=qs[_0xe1d7('0x33')](_0x2e14c2[_0xe1d7('0x46')][_0xe1d7('0x33')]);_0x55359d['offset']=qs['offset'](_0x2e14c2['query']['offset']);}_0x55359d[_0xe1d7('0x71')]=qs[_0xe1d7('0x50')](_0x2e14c2[_0xe1d7('0x46')][_0xe1d7('0x50')]);_0x55359d[_0xe1d7('0x51')]=qs[_0xe1d7('0x48')](_[_0xe1d7('0x52')](_0x2e14c2['query'],_0x2a8040[_0xe1d7('0x48')]));_0x55359d['where'][_0xe1d7('0x68')]=_0x3742a1['id'];if(_0x2e14c2['query'][_0xe1d7('0x53')]){_0x55359d[_0xe1d7('0x51')]=_[_0xe1d7('0x54')](_0x55359d[_0xe1d7('0x51')],{'$or':_['map'](_0x55359d['attributes'],function(_0x31fe17){var _0x4cdab7={};_0x4cdab7[_0x31fe17]={'$like':'%'+_0x2e14c2[_0xe1d7('0x46')][_0xe1d7('0x53')]+'%'};return _0x4cdab7;})});}_0x55359d=_[_0xe1d7('0x54')]({},_0x55359d,_0x2e14c2['options']);return db['SmsInteraction'][_0xe1d7('0x32')]({'where':_0x55359d[_0xe1d7('0x51')]})['then'](function(_0x595aba){_0x39af41[_0xe1d7('0x32')]=_0x595aba;if(_0x2e14c2[_0xe1d7('0x46')][_0xe1d7('0x57')]){_0x55359d[_0xe1d7('0x58')]=[{'model':db[_0xe1d7('0xba')],'as':'Contact','required':![]},{'model':db[_0xe1d7('0xa5')],'as':_0xe1d7('0xbb'),'attributes':[_0xe1d7('0x3c'),'fullname',_0xe1d7('0xbc')],'required':![]},{'model':db[_0xe1d7('0xbd')],'as':_0xe1d7('0xbe'),'attributes':['id','name','color'],'where':_0x2e14c2[_0xe1d7('0x46')]['tag']?{'id':_0x2e14c2['query']['tag']}:undefined,'required':_0x2e14c2[_0xe1d7('0x46')][_0xe1d7('0xbf')]?!![]:![]}];}return db[_0xe1d7('0x9e')][_0xe1d7('0x59')](_0x55359d);})[_0xe1d7('0x22')](function(_0x3be196){_0x39af41[_0xe1d7('0x5a')]=_0x3be196;return _0x39af41;});}})[_0xe1d7('0x22')](respondWithFilteredResult(_0x29f1a9,_0x55359d))['catch'](handleError(_0x29f1a9,null));};exports[_0xe1d7('0x3d')]=function(_0x439033,_0x56461e,_0x208027){var _0x16a340,_0x160a9f,_0x19d172;if(_[_0xe1d7('0x95')](_0x439033[_0xe1d7('0x60')][_0xe1d7('0x60')])||_0x439033['body'][_0xe1d7('0x60')]===''){throw new db[(_0xe1d7('0x79'))]['ValidationError'](_0xe1d7('0xc0'));}if(_[_0xe1d7('0x95')](_0x439033['body']['to'])){throw new db[(_0xe1d7('0x79'))][(_0xe1d7('0x7a'))](_0xe1d7('0xc1'));}_0x16a340=_0x439033[_0xe1d7('0x60')]['to'];return db[_0xe1d7('0x41')]['find']({'where':{'id':_0x439033['params']['id']},'include':[{'model':db[_0xe1d7('0xc2')],'as':_0xe1d7('0xc3'),'include':[{'model':db['CmContact'],'as':_0xe1d7('0x9a'),'where':{'mobile':_0x16a340},'limit':0x1,'order':[[_0xe1d7('0x7c'),_0xe1d7('0x9b')]]}]}]})[_0xe1d7('0x22')](handleEntityNotFound(_0x56461e,null))[_0xe1d7('0x22')](function(_0x73466a){if(_0x73466a&&_0x73466a[_0xe1d7('0xc3')]){_0x160a9f=_0x73466a[_0xe1d7('0x38')]({'plain':!![]});if(_0x160a9f[_0xe1d7('0xc3')]&&_0x160a9f['List'][_0xe1d7('0x9a')][_0xe1d7('0x4d')]){return _0x160a9f[_0xe1d7('0xc3')]['Contacts'][0x0];}return db[_0xe1d7('0xba')][_0xe1d7('0x5f')](_[_0xe1d7('0x1c')](_0x439033[_0xe1d7('0x60')],{'firstName':_0x16a340,'mobile':_0x16a340,'phone':_0x16a340,'ListId':_0x160a9f[_0xe1d7('0x7e')]}));}})[_0xe1d7('0x22')](handleEntityNotFound(_0x56461e,null))[_0xe1d7('0x22')](function(_0x4a7823){if(_0x4a7823){_0x19d172=_0x4a7823;return db[_0xe1d7('0x9e')][_0xe1d7('0x5e')]({'where':{'ContactId':_0x19d172['id'],'closed':![],'SmsAccountId':_0x160a9f['id']}})[_0xe1d7('0x22')](function(_0x548ab8){if(_0x548ab8){return[_0x548ab8,![]];}return db[_0xe1d7('0x9e')][_0xe1d7('0x5f')]({'UserId':_0x439033[_0xe1d7('0x61')]['id'],'ContactId':_0x19d172['id'],'SmsAccountId':_0x160a9f['id'],'phone':_0x16a340,'firstMsgDirection':'out','Messages':[_[_0xe1d7('0x54')](_0x439033['body'],{'read':![],'body':_0x439033[_0xe1d7('0x60')][_0xe1d7('0x60')],'phone':_0x16a340,'SmsAccountId':_0x160a9f['id'],'UserId':_0x439033[_0xe1d7('0x61')]['id'],'ContactId':_0x19d172['id']})]},{'include':[{'model':db[_0xe1d7('0xc4')],'as':'Messages'}]})[_0xe1d7('0x22')](function(_0x217f00){return[_0x217f00,!![]];});});}})[_0xe1d7('0xc5')](function(_0x3eec3b,_0x14422f){if(_0x14422f){return _0x3eec3b;}return db['SmsMessage'][_0xe1d7('0x5f')](_[_0xe1d7('0x54')](_0x439033[_0xe1d7('0x60')],{'read':![],'body':_0x439033['body'][_0xe1d7('0x60')],'phone':_0x16a340,'SmsAccountId':_0x160a9f['id'],'SmsInteractionId':_0x3eec3b['id'],'UserId':_0x439033[_0xe1d7('0x61')]['id'],'ContactId':_0x19d172['id']}))[_0xe1d7('0x22')](function(_0x1dad7e){_0x3eec3b[_0xe1d7('0xc6')][_0xe1d7('0xc7')]=[];_0x3eec3b[_0xe1d7('0xc6')][_0xe1d7('0xc7')][_0xe1d7('0xa0')](_0x1dad7e[_0xe1d7('0xc6')]);return _0x3eec3b;});})['then'](respondWithResult(_0x56461e,null))[_0xe1d7('0x2b')](handleError(_0x56461e,null));};exports[_0xe1d7('0x2d')]=function(_0x490b39,_0x5c0461,_0x14f945){if(_0x490b39['body']['id']){delete _0x490b39[_0xe1d7('0x60')]['id'];}var _0x21a0d8,_0x557a54,_0x366a60;return db['SmsAccount']['find']({'where':{'id':_0x490b39['params']['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x5c0461,null))['then'](function(_0x4c1456){if(_0x4c1456){_0x366a60=_0x4c1456;logger['debug'](_0xe1d7('0x26'),_0xe1d7('0x2d'),_0xe1d7('0xc8'),_0x4c1456[_0xe1d7('0x44')],util[_0xe1d7('0xc9')](_0x490b39[_0xe1d7('0x60')],{'showHidden':![],'depth':null}));switch(_0x4c1456['type']){case _0xe1d7('0x83'):if(_0x490b39[_0xe1d7('0x60')][_0xe1d7('0xca')]&&_0x490b39[_0xe1d7('0x60')][_0xe1d7('0x2d')]){_0x557a54=_0x490b39['body'][_0xe1d7('0x2d')];return db[_0xe1d7('0xc4')]['find']({'where':{'messageId':_0x490b39[_0xe1d7('0x60')][_0xe1d7('0xca')]}});}break;case'connectel':if(_0x490b39[_0xe1d7('0x60')][_0xe1d7('0xcb')]&&_0x490b39[_0xe1d7('0x60')][_0xe1d7('0xcc')]){_0x557a54=_0x490b39[_0xe1d7('0x60')][_0xe1d7('0xcc')];return db[_0xe1d7('0xc4')][_0xe1d7('0x5e')]({'where':{'messageId':_0x490b39['body'][_0xe1d7('0xcb')]}});}break;case'clicksend':if(_0x490b39['body'][_0xe1d7('0x89')]&&_0x490b39[_0xe1d7('0x60')]['status_code']){_0x557a54=_0x490b39[_0xe1d7('0x60')][_0xe1d7('0xcd')];return db['SmsMessage'][_0xe1d7('0x5e')]({'where':{'messageId':_0x490b39[_0xe1d7('0x60')][_0xe1d7('0x89')]}});}break;case _0xe1d7('0x8d'):var _0x575ffb=_0x490b39[_0xe1d7('0x60')][_0xe1d7('0x8e')][0x0];if(_0x575ffb[_0xe1d7('0x81')]&&_0x575ffb[_0xe1d7('0x2d')]['groupName']===_0xe1d7('0xce')){_0x557a54=_0x575ffb[_0xe1d7('0x2d')][_0xe1d7('0xcf')];return db[_0xe1d7('0xc4')][_0xe1d7('0x5e')]({'where':{'messageId':_0x575ffb['messageId']}});}break;case _0xe1d7('0x90'):if(_0x490b39[_0xe1d7('0x60')][_0xe1d7('0x81')]&&_0x490b39[_0xe1d7('0x60')][_0xe1d7('0x2d')]){_0x557a54=_0x490b39[_0xe1d7('0x60')][_0xe1d7('0x2d')];return db[_0xe1d7('0xc4')][_0xe1d7('0x5e')]({'where':{'messageId':_0x490b39['body'][_0xe1d7('0x81')]}});}break;case _0xe1d7('0x92'):if(_0x490b39[_0xe1d7('0x60')][0x0][_0xe1d7('0x28')]['id']){_0x557a54=_0x490b39[_0xe1d7('0x60')][0x0][_0xe1d7('0x44')];return db['SmsMessage']['find']({'where':{'messageId':_0x490b39[_0xe1d7('0x60')][0x0][_0xe1d7('0x28')]['id']}});}break;case'intelepeer':if(_0x490b39[_0xe1d7('0x60')][_0xe1d7('0xd0')]&&_0x490b39[_0xe1d7('0x60')][_0xe1d7('0x2d')]){_0x557a54=_0x490b39['body'][_0xe1d7('0x2d')];return db['SmsMessage'][_0xe1d7('0x5e')]({'where':{'messageId':_0x490b39['body']['redif']}});}break;}}})[_0xe1d7('0x22')](handleEntityNotFound(_0x5c0461,null))[_0xe1d7('0x22')](function(_0x380f3b){if(_0x380f3b){_0x21a0d8=_0x380f3b;switch(_0x366a60['type']){case _0xe1d7('0x83'):if(_0x557a54===_0xe1d7('0xce')){return _0x21a0d8[_0xe1d7('0x37')]({'read':!![]});}else{logger[_0xe1d7('0x27')](_0xe1d7('0x26'),'status','skebby',util['inspect'](_0x490b39[_0xe1d7('0x60')],{'showHidden':![],'depth':null}));}break;case _0xe1d7('0x86'):if(_0x557a54==='1'){return _0x21a0d8[_0xe1d7('0x37')]({'read':!![]});}else{logger[_0xe1d7('0x27')](_0xe1d7('0x26'),_0xe1d7('0x2d'),_0xe1d7('0x83'),util[_0xe1d7('0xc9')](_0x490b39[_0xe1d7('0x60')],{'showHidden':![],'depth':null}));}break;case _0xe1d7('0x88'):if(!_0x490b39['body'][_0xe1d7('0xd1')]&&_0x557a54>=0xc8&&_0x557a54<=0xce){return _0x21a0d8[_0xe1d7('0x37')]({'read':!![]});}else{logger[_0xe1d7('0x27')](_0xe1d7('0x26'),_0xe1d7('0x2d'),'clicksend',util[_0xe1d7('0xc9')](_0x490b39['body'],{'showHidden':![],'depth':null}));}break;case _0xe1d7('0x8d'):var _0x485392=_0x490b39[_0xe1d7('0x60')][_0xe1d7('0x8e')][0x0];if(_0x485392[_0xe1d7('0x2d')][_0xe1d7('0xcf')]===_0xe1d7('0xce')){return _0x21a0d8[_0xe1d7('0x37')]({'read':!![]});}else{logger[_0xe1d7('0x27')](_0xe1d7('0x26'),_0xe1d7('0x2d'),'infobip',util['inspect'](_0x490b39[_0xe1d7('0x60')],{'showHidden':![],'depth':null}));}break;case _0xe1d7('0x90'):if(_0x557a54==_0xe1d7('0xd2')||_0x557a54==_0xe1d7('0xd3')){return _0x21a0d8[_0xe1d7('0x37')]({'read':!![]});}else{logger[_0xe1d7('0x27')](_0xe1d7('0x26'),_0xe1d7('0x2d'),_0xe1d7('0x90'),util['inspect'](_0x490b39[_0xe1d7('0x60')],{'showHidden':![],'depth':null}));}break;case _0xe1d7('0x92'):if(_0x557a54=='message-delivered'){return _0x21a0d8[_0xe1d7('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe1d7('0x2d'),'bandwidth',util[_0xe1d7('0xc9')](_0x490b39['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x557a54===_0xe1d7('0xd4')||_0x557a54==='ACCEPTD'){return _0x21a0d8[_0xe1d7('0x37')]({'read':!![]});}else{logger[_0xe1d7('0x27')](_0xe1d7('0x26'),_0xe1d7('0x2d'),'intelepeer',util[_0xe1d7('0xc9')](_0x490b39[_0xe1d7('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x21a0d8;}})['then'](respondWithResult(_0x5c0461,null))[_0xe1d7('0x2b')](handleError(_0x5c0461,null));};exports['statusGet']=function(_0x4e3f89,_0x5dddd,_0x26a63a){var _0x3a2f27,_0x17f5db,_0x4c416f;return db[_0xe1d7('0x41')][_0xe1d7('0x5e')]({'where':{'id':_0x4e3f89[_0xe1d7('0x5c')]['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x5dddd,null))[_0xe1d7('0x22')](function(_0x216216){if(_0x216216){_0x4c416f=_0x216216;logger['debug'](_0xe1d7('0x26'),'status',_0xe1d7('0xc8'),_0x216216[_0xe1d7('0x44')],util[_0xe1d7('0xc9')](_0x4e3f89[_0xe1d7('0x46')],{'showHidden':![],'depth':null}));switch(_0x216216[_0xe1d7('0x44')]){case'csc':if(_0x4e3f89[_0xe1d7('0x46')][_0xe1d7('0xd5')]&&_0x4e3f89[_0xe1d7('0x46')][_0xe1d7('0xd6')]){_0x17f5db=_0x4e3f89['query'][_0xe1d7('0xd6')];return db['SmsMessage'][_0xe1d7('0x5e')]({'where':{'messageId':_0x4e3f89['query'][_0xe1d7('0xd5')]}});}break;}}})[_0xe1d7('0x22')](handleEntityNotFound(_0x5dddd,null))[_0xe1d7('0x22')](function(_0x941106){if(_0x941106){_0x3a2f27=_0x941106;switch(_0x4c416f[_0xe1d7('0x44')]){case _0xe1d7('0xd7'):if(_0x17f5db==='2'||_0x17f5db==='6'){return _0x3a2f27[_0xe1d7('0x37')]({'read':!![]});}else{logger[_0xe1d7('0x27')](_0xe1d7('0x26'),_0xe1d7('0x2d'),_0xe1d7('0xd7'),util[_0xe1d7('0xc9')](_0x4e3f89[_0xe1d7('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x3a2f27;}})[_0xe1d7('0x22')](respondWithResult(_0x5dddd,null))[_0xe1d7('0x2b')](handleError(_0x5dddd,null));};exports[_0xe1d7('0xd8')]=function(_0xaae814,_0x55b437,_0x5128e1){return db[_0xe1d7('0x41')][_0xe1d7('0x5e')]({'where':{'id':_0xaae814[_0xe1d7('0x5c')]['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x55b437,null))[_0xe1d7('0x22')](function(_0x3bf5d2){if(_0x3bf5d2){return _0x3bf5d2['addAgents'](_0xaae814[_0xe1d7('0x60')]['ids'],_[_0xe1d7('0x9c')](_0xaae814['body'],[_0xe1d7('0x6d'),'id'])||{})[_0xe1d7('0xc5')](function(_0x30dd99){for(var _0x26c29c=0x0;_0x26c29c<_0xaae814['body'][_0xe1d7('0x6d')][_0xe1d7('0x4d')];_0x26c29c+=0x1){socket['emit'](_0xe1d7('0xd9'),{'UserId':Number(_0xaae814[_0xe1d7('0x60')][_0xe1d7('0x6d')][_0x26c29c]),'SmsAccountId':Number(_0xaae814[_0xe1d7('0x5c')]['id'])});}return _0x30dd99;});}})[_0xe1d7('0x22')](respondWithResult(_0x55b437,null))[_0xe1d7('0x2b')](handleError(_0x55b437,null));};exports['removeAgents']=function(_0x5d441c,_0x5d6d18,_0x58a497){return db[_0xe1d7('0x41')][_0xe1d7('0x5e')]({'where':{'id':_0x5d441c[_0xe1d7('0x5c')]['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x5d6d18,null))['then'](function(_0x1807e3){if(_0x1807e3){return _0x1807e3[_0xe1d7('0xda')](_0x5d441c['query']['ids'])[_0xe1d7('0x22')](function(){if(_['isArray'](_0x5d441c[_0xe1d7('0x46')][_0xe1d7('0x6d')])){for(var _0x2b1a41=0x0;_0x2b1a41<_0x5d441c[_0xe1d7('0x46')][_0xe1d7('0x6d')][_0xe1d7('0x4d')];_0x2b1a41+=0x1){socket['emit'](_0xe1d7('0xdb'),{'UserId':Number(_0x5d441c[_0xe1d7('0x46')][_0xe1d7('0x6d')][_0x2b1a41]),'SmsAccountId':Number(_0x5d441c[_0xe1d7('0x5c')]['id'])});}}else{socket['emit'](_0xe1d7('0xdb'),{'UserId':Number(_0x5d441c[_0xe1d7('0x46')][_0xe1d7('0x6d')]),'SmsAccountId':Number(_0x5d441c[_0xe1d7('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x5d6d18,null))['catch'](handleError(_0x5d6d18,null));};exports[_0xe1d7('0xdc')]=function(_0x2c9f69,_0x4d815b,_0xd10939){var _0x2947d6={};var _0x11cae3={};var _0x183e39;var _0x55fe85;return db[_0xe1d7('0x41')]['findOne']({'where':{'id':_0x2c9f69['params']['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x4d815b,null))['then'](function(_0x388956){if(_0x388956){_0x183e39=_0x388956;_0x11cae3[_0xe1d7('0x4a')]=_[_0xe1d7('0x47')](db[_0xe1d7('0xa5')][_0xe1d7('0x42')]);_0x11cae3[_0xe1d7('0x46')]=_[_0xe1d7('0x47')](_0x2c9f69[_0xe1d7('0x46')]);_0x11cae3[_0xe1d7('0x48')]=_[_0xe1d7('0x49')](_0x11cae3[_0xe1d7('0x4a')],_0x11cae3[_0xe1d7('0x46')]);_0x2947d6[_0xe1d7('0x4b')]=_[_0xe1d7('0x49')](_0x11cae3[_0xe1d7('0x4a')],qs['fields'](_0x2c9f69[_0xe1d7('0x46')][_0xe1d7('0x4c')]));_0x2947d6[_0xe1d7('0x4b')]=_0x2947d6[_0xe1d7('0x4b')]['length']?_0x2947d6['attributes']:_0x11cae3[_0xe1d7('0x4a')];_0x2947d6[_0xe1d7('0x71')]=qs['sort'](_0x2c9f69[_0xe1d7('0x46')][_0xe1d7('0x50')]);_0x2947d6[_0xe1d7('0x51')]=qs[_0xe1d7('0x48')](_[_0xe1d7('0x52')](_0x2c9f69['query'],_0x11cae3[_0xe1d7('0x48')]));if(_0x2c9f69['query'][_0xe1d7('0x53')]){_0x2947d6[_0xe1d7('0x51')]=_[_0xe1d7('0x54')](_0x2947d6[_0xe1d7('0x51')],{'$or':_['map'](_0x2947d6['attributes'],function(_0x216f4c){var _0x31311d={};_0x31311d[_0x216f4c]={'$like':'%'+_0x2c9f69[_0xe1d7('0x46')][_0xe1d7('0x53')]+'%'};return _0x31311d;})});}_0x2947d6=_[_0xe1d7('0x54')]({},_0x2947d6,_0x2c9f69[_0xe1d7('0x56')]);return _0x183e39[_0xe1d7('0xdc')](_0x2947d6);}})[_0xe1d7('0x22')](function(_0x56d64d){if(_0x56d64d){_0x55fe85=_0x56d64d[_0xe1d7('0x4d')];if(!_0x2c9f69[_0xe1d7('0x46')]['hasOwnProperty'](_0xe1d7('0x4f'))){_0x2947d6[_0xe1d7('0x33')]=qs[_0xe1d7('0x33')](_0x2c9f69[_0xe1d7('0x46')][_0xe1d7('0x33')]);_0x2947d6[_0xe1d7('0x30')]=qs[_0xe1d7('0x30')](_0x2c9f69[_0xe1d7('0x46')][_0xe1d7('0x30')]);}return _0x183e39[_0xe1d7('0xdc')](_0x2947d6);}})[_0xe1d7('0x22')](function(_0xf8d438){if(_0xf8d438){return _0xf8d438?{'count':_0x55fe85,'rows':_0xf8d438}:null;}})[_0xe1d7('0x22')](respondWithResult(_0x4d815b,null))['catch'](handleError(_0x4d815b,null));}; \ No newline at end of file +var _0xea05=['csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','agent','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','stack','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','groupName','bandwidth','redif','DELIVERED','connectel','error_code','DELIVERED_TO_GATEWAY','message-delivered','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','destroy','UserProfileResource','name','send','Pause','mandatoryDispositionPause','fieldName','type','key','map','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsAccount','includeAll','include','findAll','catch','show','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','find','autoAssociation','params','describe','addDisposition','SmsAccountId','Disposition','findOne','rawAttributes','nolimit','rows','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','Body','messageId','MessageSid','skebby','from','sender','clicksend','message_id','plivo','MessageUUID','infobip','results','text'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xea05,0x13a));var _0x5ea0=function(_0x491773,_0x3f8160){_0x491773=_0x491773-0x0;var _0x498646=_0xea05[_0x491773];return _0x498646;};'use strict';var emlformat=require(_0x5ea0('0x0'));var rimraf=require(_0x5ea0('0x1'));var zipdir=require(_0x5ea0('0x2'));var jsonpatch=require(_0x5ea0('0x3'));var rp=require(_0x5ea0('0x4'));var moment=require('moment');var BPromise=require(_0x5ea0('0x5'));var Mustache=require('mustache');var util=require(_0x5ea0('0x6'));var path=require(_0x5ea0('0x7'));var sox=require(_0x5ea0('0x8'));var csv=require(_0x5ea0('0x9'));var ejs=require(_0x5ea0('0xa'));var fs=require('fs');var fs_extra=require(_0x5ea0('0xb'));var _=require(_0x5ea0('0xc'));var squel=require(_0x5ea0('0xd'));var crypto=require(_0x5ea0('0xe'));var jsforce=require(_0x5ea0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5ea0('0x9'));var querystring=require(_0x5ea0('0x10'));var Papa=require(_0x5ea0('0x11'));var Redis=require(_0x5ea0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5ea0('0x13'));var as=require(_0x5ea0('0x14'));var hardwareService=require(_0x5ea0('0x15'));var logger=require(_0x5ea0('0x16'))('api');var utils=require(_0x5ea0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5ea0('0x18'));var db=require(_0x5ea0('0x19'))['db'];config['redis']=_[_0x5ea0('0x1a')](config[_0x5ea0('0x1b')],{'host':_0x5ea0('0x1c'),'port':0x18eb});var socket=require(_0x5ea0('0x1d'))(new Redis(config[_0x5ea0('0x1b')]));require(_0x5ea0('0x1e'))[_0x5ea0('0x1f')](socket);var jayson=require(_0x5ea0('0x20'));var client=jayson['client'][_0x5ea0('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x4d7d93,_0x37a750,_0x3577c7,_0x1930e4){return new BPromise(function(_0x33b47f,_0x1544a9){var _0x3e90fe=_0x1930e4||client;return _0x3e90fe['request'](_0x4d7d93,_0x3577c7)[_0x5ea0('0x22')](function(_0xb2304b){logger[_0x5ea0('0x23')](_0x5ea0('0x24'),_0x37a750,_0x5ea0('0x25'));logger[_0x5ea0('0x26')](_0x5ea0('0x27'),_0x37a750,'request\x20sent',JSON[_0x5ea0('0x28')](_0xb2304b));if(_0xb2304b[_0x5ea0('0x29')]){if(_0xb2304b[_0x5ea0('0x29')]['code']===0x1f4){logger['error'](_0x5ea0('0x24'),_0x37a750,_0xb2304b[_0x5ea0('0x29')][_0x5ea0('0x2a')]);return _0x1544a9(_0xb2304b[_0x5ea0('0x29')]['message']);}logger[_0x5ea0('0x29')](_0x5ea0('0x24'),_0x37a750,_0xb2304b['error'][_0x5ea0('0x2a')]);return _0x33b47f(_0xb2304b['error'][_0x5ea0('0x2a')]);}else{logger['info'](_0x5ea0('0x24'),_0x37a750,_0x5ea0('0x25'));_0x33b47f(_0xb2304b['result'][_0x5ea0('0x2a')]);}})['catch'](function(_0x4163f7){logger['error'](_0x5ea0('0x24'),_0x37a750,_0x4163f7);_0x1544a9(_0x4163f7);});});}function respondWithStatusCode(_0x3c872b,_0x46860e){_0x46860e=_0x46860e||0xcc;return function(_0x16299d){if(_0x16299d){return _0x3c872b[_0x5ea0('0x2b')](_0x46860e);}return _0x3c872b[_0x5ea0('0x2c')](_0x46860e)[_0x5ea0('0x2d')]();};}function respondWithResult(_0x56834b,_0x5ed76c){_0x5ed76c=_0x5ed76c||0xc8;return function(_0x5baec6){if(_0x5baec6){return _0x56834b[_0x5ea0('0x2c')](_0x5ed76c)['json'](_0x5baec6);}};}function respondWithFilteredResult(_0x25eb3a,_0x3d9fc5){return function(_0x3c07ab){if(_0x3c07ab){var _0x15211d=typeof _0x3d9fc5[_0x5ea0('0x2e')]===_0x5ea0('0x2f')&&typeof _0x3d9fc5['limit']===_0x5ea0('0x2f');var _0x52806c=_0x3c07ab[_0x5ea0('0x30')];var _0x20ba06=_0x15211d?0x0:_0x3d9fc5[_0x5ea0('0x2e')];var _0x1203c8=_0x15211d?_0x3c07ab[_0x5ea0('0x30')]:_0x3d9fc5[_0x5ea0('0x2e')]+_0x3d9fc5[_0x5ea0('0x31')];var _0x515911;if(_0x1203c8>=_0x52806c){_0x1203c8=_0x52806c;_0x515911=0xc8;}else{_0x515911=0xce;}_0x25eb3a['status'](_0x515911);return _0x25eb3a['set'](_0x5ea0('0x32'),_0x20ba06+'-'+_0x1203c8+'/'+_0x52806c)[_0x5ea0('0x33')](_0x3c07ab);}return null;};}function patchUpdates(_0x3d80bb){return function(_0x87a67e){try{jsonpatch[_0x5ea0('0x34')](_0x87a67e,_0x3d80bb,!![]);}catch(_0x3c0089){return BPromise[_0x5ea0('0x35')](_0x3c0089);}return _0x87a67e['save']();};}function saveUpdates(_0x3ba2c2,_0x444259){return function(_0xa09b00){if(_0xa09b00){return _0xa09b00[_0x5ea0('0x36')](_0x3ba2c2)['then'](function(_0x1b09ac){return _0x1b09ac;});}return null;};}function removeEntity(_0x1fc616,_0x4cae34){return function(_0x337bfe){if(_0x337bfe){return _0x337bfe[_0x5ea0('0x37')]()[_0x5ea0('0x22')](function(){var _0x2e8b73=_0x337bfe['get']({'plain':!![]});var _0x422b22='SmsAccounts';return db[_0x5ea0('0x38')][_0x5ea0('0x37')]({'where':{'type':_0x422b22,'resourceId':_0x2e8b73['id']}})[_0x5ea0('0x22')](function(){return _0x337bfe;});})[_0x5ea0('0x22')](function(){_0x1fc616['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48bbd0,_0x27ca68){return function(_0x2e99fc){if(!_0x2e99fc){_0x48bbd0[_0x5ea0('0x2b')](0x194);}return _0x2e99fc;};}function handleError(_0x321c58,_0x2abfb8){_0x2abfb8=_0x2abfb8||0x1f4;return function(_0x7acea7){logger['error'](_0x7acea7['stack']);if(_0x7acea7[_0x5ea0('0x39')]){delete _0x7acea7['name'];}_0x321c58[_0x5ea0('0x2c')](_0x2abfb8)[_0x5ea0('0x3a')](_0x7acea7);};}exports['index']=function(_0x2328cd,_0x4385d0){var _0x200bdc={'include':[{'model':db[_0x5ea0('0x3b')],'as':_0x5ea0('0x3c')}]},_0xa058d7={},_0x22d444={'count':0x0,'rows':[]};var _0x4ed0ce=_['map'](db['SmsAccount']['rawAttributes'],function(_0x2598bb){return{'name':_0x2598bb[_0x5ea0('0x3d')],'type':_0x2598bb[_0x5ea0('0x3e')][_0x5ea0('0x3f')]};});_0xa058d7['model']=_[_0x5ea0('0x40')](_0x4ed0ce,_0x5ea0('0x39'));_0xa058d7[_0x5ea0('0x41')]=_[_0x5ea0('0x42')](_0x2328cd[_0x5ea0('0x41')]);_0xa058d7[_0x5ea0('0x43')]=_['intersection'](_0xa058d7['model'],_0xa058d7[_0x5ea0('0x41')]);_0x200bdc[_0x5ea0('0x44')]=_[_0x5ea0('0x45')](_0xa058d7[_0x5ea0('0x46')],qs['fields'](_0x2328cd[_0x5ea0('0x41')][_0x5ea0('0x47')]));_0x200bdc[_0x5ea0('0x44')]=_0x200bdc['attributes'][_0x5ea0('0x48')]?_0x200bdc[_0x5ea0('0x44')]:_0xa058d7[_0x5ea0('0x46')];if(!_0x2328cd[_0x5ea0('0x41')][_0x5ea0('0x49')]('nolimit')){_0x200bdc[_0x5ea0('0x31')]=qs[_0x5ea0('0x31')](_0x2328cd[_0x5ea0('0x41')]['limit']);_0x200bdc['offset']=qs[_0x5ea0('0x2e')](_0x2328cd[_0x5ea0('0x41')][_0x5ea0('0x2e')]);}_0x200bdc[_0x5ea0('0x4a')]=qs[_0x5ea0('0x4b')](_0x2328cd['query']['sort']);_0x200bdc[_0x5ea0('0x4c')]=qs[_0x5ea0('0x43')](_[_0x5ea0('0x4d')](_0x2328cd[_0x5ea0('0x41')],_0xa058d7['filters']),_0x4ed0ce);if(_0x2328cd[_0x5ea0('0x41')][_0x5ea0('0x4e')]){_0x200bdc[_0x5ea0('0x4c')]=_[_0x5ea0('0x4f')](_0x200bdc[_0x5ea0('0x4c')],{'$or':_[_0x5ea0('0x40')](_0x4ed0ce,function(_0x127a23){if(_0x127a23[_0x5ea0('0x3e')]!==_0x5ea0('0x50')){var _0x16d6d0={};_0x16d6d0[_0x127a23['name']]={'$like':'%'+_0x2328cd[_0x5ea0('0x41')][_0x5ea0('0x4e')]+'%'};return _0x16d6d0;}})});}_0x200bdc=_[_0x5ea0('0x4f')]({},_0x200bdc,_0x2328cd[_0x5ea0('0x51')]);var _0x42a39e={'where':_0x200bdc[_0x5ea0('0x4c')]};return db[_0x5ea0('0x52')][_0x5ea0('0x30')](_0x42a39e)[_0x5ea0('0x22')](function(_0xca40c){_0x22d444['count']=_0xca40c;if(_0x2328cd[_0x5ea0('0x41')][_0x5ea0('0x53')]){_0x200bdc[_0x5ea0('0x54')]=[{'all':!![]}];}return db[_0x5ea0('0x52')][_0x5ea0('0x55')](_0x200bdc);})[_0x5ea0('0x22')](function(_0xdacb6a){_0x22d444['rows']=_0xdacb6a;return _0x22d444;})[_0x5ea0('0x22')](respondWithFilteredResult(_0x4385d0,_0x200bdc))[_0x5ea0('0x56')](handleError(_0x4385d0,null));};exports[_0x5ea0('0x57')]=function(_0x5b3c17,_0x16e911){var _0x26a952={'raw':![],'where':{'id':_0x5b3c17['params']['id']},'include':[{'model':db[_0x5ea0('0x3b')],'as':_0x5ea0('0x3c')}]},_0x48906f={};_0x48906f[_0x5ea0('0x46')]=_[_0x5ea0('0x42')](db[_0x5ea0('0x52')]['rawAttributes']);_0x48906f['query']=_[_0x5ea0('0x42')](_0x5b3c17[_0x5ea0('0x41')]);_0x48906f[_0x5ea0('0x43')]=_['intersection'](_0x48906f[_0x5ea0('0x46')],_0x48906f[_0x5ea0('0x41')]);_0x26a952[_0x5ea0('0x44')]=_[_0x5ea0('0x45')](_0x48906f[_0x5ea0('0x46')],qs[_0x5ea0('0x47')](_0x5b3c17['query'][_0x5ea0('0x47')]));_0x26a952[_0x5ea0('0x44')]=_0x26a952[_0x5ea0('0x44')][_0x5ea0('0x48')]?_0x26a952['attributes']:_0x48906f[_0x5ea0('0x46')];if(_0x5b3c17['query'][_0x5ea0('0x53')]){_0x26a952[_0x5ea0('0x54')]=[{'all':!![]}];}_0x26a952=_[_0x5ea0('0x4f')]({},_0x26a952,_0x5b3c17[_0x5ea0('0x51')]);return db[_0x5ea0('0x52')]['find'](_0x26a952)['then'](handleEntityNotFound(_0x16e911,null))[_0x5ea0('0x22')](respondWithResult(_0x16e911,null))[_0x5ea0('0x56')](handleError(_0x16e911,null));};exports[_0x5ea0('0x58')]=function(_0x3191b1,_0xc057b){return db[_0x5ea0('0x52')][_0x5ea0('0x58')](_0x3191b1[_0x5ea0('0x59')],{})[_0x5ea0('0x22')](function(_0x494b13){var _0x21eaed=_0x3191b1[_0x5ea0('0x5a')][_0x5ea0('0x5b')]({'plain':!![]});if(!_0x21eaed)throw new Error(_0x5ea0('0x5c'));if(_0x21eaed[_0x5ea0('0x5d')]===_0x5ea0('0x5a')){var _0x169fd8=_0x494b13[_0x5ea0('0x5b')]({'plain':!![]});var _0x2a2c41=_0x5ea0('0x5e');return db[_0x5ea0('0x5f')][_0x5ea0('0x60')]({'where':{'name':_0x2a2c41,'userProfileId':_0x21eaed['userProfileId']},'raw':!![]})['then'](function(_0x204720){if(_0x204720&&_0x204720[_0x5ea0('0x61')]===0x0){return db[_0x5ea0('0x38')][_0x5ea0('0x58')]({'name':_0x169fd8[_0x5ea0('0x39')],'resourceId':_0x169fd8['id'],'type':_0x204720['name'],'sectionId':_0x204720['id']},{})[_0x5ea0('0x22')](function(){return _0x494b13;});}else{return _0x494b13;}})[_0x5ea0('0x56')](function(_0x5203a2){logger[_0x5ea0('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5203a2);throw _0x5203a2;});}return _0x494b13;})[_0x5ea0('0x22')](respondWithResult(_0xc057b,0xc9))[_0x5ea0('0x56')](handleError(_0xc057b,null));};exports[_0x5ea0('0x36')]=function(_0x318c6a,_0x29ea2c){if(_0x318c6a[_0x5ea0('0x59')]['id']){delete _0x318c6a[_0x5ea0('0x59')]['id'];}return db['SmsAccount'][_0x5ea0('0x60')]({'where':{'id':_0x318c6a[_0x5ea0('0x62')]['id']},'include':[{'model':db[_0x5ea0('0x3b')],'as':_0x5ea0('0x3c')}]})[_0x5ea0('0x22')](handleEntityNotFound(_0x29ea2c,null))[_0x5ea0('0x22')](saveUpdates(_0x318c6a[_0x5ea0('0x59')],null))[_0x5ea0('0x22')](respondWithResult(_0x29ea2c,null))['catch'](handleError(_0x29ea2c,null));};exports[_0x5ea0('0x37')]=function(_0x5bebae,_0x1394d9){return db['SmsAccount'][_0x5ea0('0x60')]({'where':{'id':_0x5bebae[_0x5ea0('0x62')]['id']}})[_0x5ea0('0x22')](handleEntityNotFound(_0x1394d9,null))['then'](removeEntity(_0x1394d9,null))[_0x5ea0('0x56')](handleError(_0x1394d9,null));};exports['describe']=function(_0x54032f,_0x2292b3){return db[_0x5ea0('0x52')][_0x5ea0('0x63')]()[_0x5ea0('0x22')](respondWithResult(_0x2292b3,null))[_0x5ea0('0x56')](handleError(_0x2292b3,null));};exports[_0x5ea0('0x64')]=function(_0x9c9cd2,_0xd71444,_0x2411aa){if(_0x9c9cd2[_0x5ea0('0x59')]['id']){delete _0x9c9cd2[_0x5ea0('0x59')]['id'];}return db[_0x5ea0('0x52')][_0x5ea0('0x60')]({'where':{'id':_0x9c9cd2['params']['id']}})[_0x5ea0('0x22')](handleEntityNotFound(_0xd71444,null))[_0x5ea0('0x22')](function(_0x12a5e0){if(_0x12a5e0){_0x9c9cd2[_0x5ea0('0x59')][_0x5ea0('0x65')]=_0x12a5e0['id'];return db[_0x5ea0('0x66')][_0x5ea0('0x58')](_0x9c9cd2[_0x5ea0('0x59')]);}})[_0x5ea0('0x22')](respondWithResult(_0xd71444,null))[_0x5ea0('0x56')](handleError(_0xd71444,null));};exports['getDispositions']=function(_0x4739d1,_0x2ffd35,_0x52c2ff){var _0x382138={'raw':![],'where':{}};var _0x3b1cc8={};var _0xc1d41d={'count':0x0,'rows':[]};return db['SmsAccount'][_0x5ea0('0x67')]({'where':{'id':_0x4739d1['params']['id']}})[_0x5ea0('0x22')](handleEntityNotFound(_0x2ffd35,null))[_0x5ea0('0x22')](function(_0x599f9e){if(_0x599f9e){_0x3b1cc8[_0x5ea0('0x46')]=_[_0x5ea0('0x42')](db['Disposition'][_0x5ea0('0x68')]);_0x3b1cc8[_0x5ea0('0x41')]=_[_0x5ea0('0x42')](_0x4739d1[_0x5ea0('0x41')]);_0x3b1cc8['filters']=_[_0x5ea0('0x45')](_0x3b1cc8[_0x5ea0('0x46')],_0x3b1cc8[_0x5ea0('0x41')]);_0x382138[_0x5ea0('0x44')]=_[_0x5ea0('0x45')](_0x3b1cc8[_0x5ea0('0x46')],qs[_0x5ea0('0x47')](_0x4739d1[_0x5ea0('0x41')][_0x5ea0('0x47')]));_0x382138[_0x5ea0('0x44')]=_0x382138[_0x5ea0('0x44')][_0x5ea0('0x48')]?_0x382138['attributes']:_0x3b1cc8[_0x5ea0('0x46')];if(!_0x4739d1[_0x5ea0('0x41')][_0x5ea0('0x49')](_0x5ea0('0x69'))){_0x382138['limit']=qs[_0x5ea0('0x31')](_0x4739d1[_0x5ea0('0x41')][_0x5ea0('0x31')]);_0x382138[_0x5ea0('0x2e')]=qs['offset'](_0x4739d1[_0x5ea0('0x41')][_0x5ea0('0x2e')]);}_0x382138[_0x5ea0('0x4a')]=qs[_0x5ea0('0x4b')](_0x4739d1['query'][_0x5ea0('0x4b')]);_0x382138[_0x5ea0('0x4c')]=qs[_0x5ea0('0x43')](_['pick'](_0x4739d1[_0x5ea0('0x41')],_0x3b1cc8[_0x5ea0('0x43')]));_0x382138[_0x5ea0('0x4c')][_0x5ea0('0x65')]=_0x599f9e['id'];if(_0x4739d1[_0x5ea0('0x41')][_0x5ea0('0x4e')]){_0x382138[_0x5ea0('0x4c')]=_[_0x5ea0('0x4f')](_0x382138[_0x5ea0('0x4c')],{'$or':_[_0x5ea0('0x40')](_0x382138['attributes'],function(_0x5282d7){var _0x296e84={};_0x296e84[_0x5282d7]={'$like':'%'+_0x4739d1[_0x5ea0('0x41')][_0x5ea0('0x4e')]+'%'};return _0x296e84;})});}_0x382138=_['merge']({},_0x382138,_0x4739d1['options']);return db[_0x5ea0('0x66')]['count']({'where':_0x382138['where']})['then'](function(_0x5ee3fe){_0xc1d41d[_0x5ea0('0x30')]=_0x5ee3fe;if(_0x4739d1[_0x5ea0('0x41')]['includeAll']){_0x382138['include']=[{'all':!![]}];}return db[_0x5ea0('0x66')][_0x5ea0('0x55')](_0x382138);})[_0x5ea0('0x22')](function(_0x357610){_0xc1d41d[_0x5ea0('0x6a')]=_0x357610;return _0xc1d41d;});}})[_0x5ea0('0x22')](respondWithFilteredResult(_0x2ffd35,_0x382138))['catch'](handleError(_0x2ffd35,null));};exports['removeDispositions']=function(_0x302f11,_0xdd8ffd,_0x4c3680){return db[_0x5ea0('0x52')][_0x5ea0('0x60')]({'where':{'id':_0x302f11[_0x5ea0('0x62')]['id']}})[_0x5ea0('0x22')](handleEntityNotFound(_0xdd8ffd,null))[_0x5ea0('0x22')](function(_0x4f739e){if(_0x4f739e){return _0x4f739e['removeDispositions'](_0x302f11['query']['ids']);}})[_0x5ea0('0x22')](respondWithStatusCode(_0xdd8ffd,null))[_0x5ea0('0x56')](handleError(_0xdd8ffd,null));};exports[_0x5ea0('0x6b')]=function(_0x14e586,_0x9895ab,_0x3d9e34){if(_0x14e586[_0x5ea0('0x59')]['id']){delete _0x14e586[_0x5ea0('0x59')]['id'];}return db['SmsAccount'][_0x5ea0('0x60')]({'where':{'id':_0x14e586[_0x5ea0('0x62')]['id']}})[_0x5ea0('0x22')](handleEntityNotFound(_0x9895ab,null))[_0x5ea0('0x22')](function(_0x4f7332){if(_0x4f7332){_0x14e586[_0x5ea0('0x59')][_0x5ea0('0x65')]=_0x4f7332['id'];return db[_0x5ea0('0x6c')]['create'](_0x14e586['body']);}})[_0x5ea0('0x22')](respondWithResult(_0x9895ab,null))[_0x5ea0('0x56')](handleError(_0x9895ab,null));};exports[_0x5ea0('0x6d')]=function(_0x34cd7a,_0x89cc59,_0x524cc9){var _0x375ee6={'raw':![],'where':{}};var _0x642db4={};var _0x5e3a8e={'count':0x0,'rows':[]};return db[_0x5ea0('0x52')]['findOne']({'where':{'id':_0x34cd7a[_0x5ea0('0x62')]['id']}})['then'](handleEntityNotFound(_0x89cc59,null))[_0x5ea0('0x22')](function(_0x1faf95){if(_0x1faf95){_0x642db4[_0x5ea0('0x46')]=_['keys'](db[_0x5ea0('0x6c')]['rawAttributes']);_0x642db4[_0x5ea0('0x41')]=_['keys'](_0x34cd7a[_0x5ea0('0x41')]);_0x642db4[_0x5ea0('0x43')]=_[_0x5ea0('0x45')](_0x642db4[_0x5ea0('0x46')],_0x642db4['query']);_0x375ee6['attributes']=_[_0x5ea0('0x45')](_0x642db4[_0x5ea0('0x46')],qs[_0x5ea0('0x47')](_0x34cd7a['query'][_0x5ea0('0x47')]));_0x375ee6[_0x5ea0('0x44')]=_0x375ee6[_0x5ea0('0x44')][_0x5ea0('0x48')]?_0x375ee6[_0x5ea0('0x44')]:_0x642db4[_0x5ea0('0x46')];if(!_0x34cd7a[_0x5ea0('0x41')][_0x5ea0('0x49')]('nolimit')){_0x375ee6[_0x5ea0('0x31')]=qs['limit'](_0x34cd7a[_0x5ea0('0x41')]['limit']);_0x375ee6[_0x5ea0('0x2e')]=qs[_0x5ea0('0x2e')](_0x34cd7a['query'][_0x5ea0('0x2e')]);}_0x375ee6[_0x5ea0('0x4a')]=qs['sort'](_0x34cd7a[_0x5ea0('0x41')]['sort']);_0x375ee6['where']=qs[_0x5ea0('0x43')](_[_0x5ea0('0x4d')](_0x34cd7a['query'],_0x642db4[_0x5ea0('0x43')]));_0x375ee6[_0x5ea0('0x4c')]['SmsAccountId']=_0x1faf95['id'];if(_0x34cd7a[_0x5ea0('0x41')][_0x5ea0('0x4e')]){_0x375ee6[_0x5ea0('0x4c')]=_[_0x5ea0('0x4f')](_0x375ee6[_0x5ea0('0x4c')],{'$or':_[_0x5ea0('0x40')](_0x375ee6[_0x5ea0('0x44')],function(_0x250125){var _0x34cb4a={};_0x34cb4a[_0x250125]={'$like':'%'+_0x34cd7a[_0x5ea0('0x41')][_0x5ea0('0x4e')]+'%'};return _0x34cb4a;})});}_0x375ee6=_[_0x5ea0('0x4f')]({},_0x375ee6,_0x34cd7a[_0x5ea0('0x51')]);return db[_0x5ea0('0x6c')][_0x5ea0('0x30')]({'where':_0x375ee6[_0x5ea0('0x4c')]})[_0x5ea0('0x22')](function(_0x268037){_0x5e3a8e[_0x5ea0('0x30')]=_0x268037;if(_0x34cd7a[_0x5ea0('0x41')]['includeAll']){_0x375ee6[_0x5ea0('0x54')]=[{'all':!![]}];}return db[_0x5ea0('0x6c')][_0x5ea0('0x55')](_0x375ee6);})[_0x5ea0('0x22')](function(_0x42a5ba){_0x5e3a8e[_0x5ea0('0x6a')]=_0x42a5ba;return _0x5e3a8e;});}})[_0x5ea0('0x22')](respondWithFilteredResult(_0x89cc59,_0x375ee6))[_0x5ea0('0x56')](handleError(_0x89cc59,null));};exports[_0x5ea0('0x6e')]=function(_0x6060c2,_0x4e2891,_0x5f3078){return db[_0x5ea0('0x52')]['find']({'where':{'id':_0x6060c2[_0x5ea0('0x62')]['id']}})[_0x5ea0('0x22')](handleEntityNotFound(_0x4e2891,null))[_0x5ea0('0x22')](function(_0x332916){if(_0x332916){return _0x332916[_0x5ea0('0x6e')](_0x6060c2[_0x5ea0('0x41')][_0x5ea0('0x6f')]);}})[_0x5ea0('0x22')](respondWithStatusCode(_0x4e2891,null))[_0x5ea0('0x56')](handleError(_0x4e2891,null));};exports[_0x5ea0('0x70')]=function(_0x6b68f6,_0x5b0a6d,_0x589254){var _0xc264e6={'channel':_0x5ea0('0x71')};var _0x5576cd=[];var _0x2d97c7=[];var _0x538ca5={};return db[_0x5ea0('0x52')][_0x5ea0('0x60')]({'where':{'id':_0x6b68f6[_0x5ea0('0x62')]['id']},'include':[{'model':db[_0x5ea0('0x72')],'as':_0x5ea0('0x73')}]})['then'](handleEntityNotFound(_0x5b0a6d,null))[_0x5ea0('0x22')](function(_0x511673){_0xc264e6[_0x5ea0('0x74')]=_0x511673;_0xc264e6[_0x5ea0('0x75')]=_[_0x5ea0('0x76')](_0x511673[_0x5ea0('0x73')],[_0x5ea0('0x77')],[_0x5ea0('0x78')]);if(_0xc264e6[_0x5ea0('0x74')][_0x5ea0('0x73')]){delete _0xc264e6['account'][_0x5ea0('0x73')];}return db['CmContact'][_0x5ea0('0x63')]();})[_0x5ea0('0x22')](function(_0x2d22e0){if(!_0x2d22e0){throw new db[(_0x5ea0('0x79'))]['ValidationError'](_0x5ea0('0x7a'));}_0x5576cd=_[_0x5ea0('0x7b')](_['keys'](_0x2d22e0),[_0x5ea0('0x7c'),_0x5ea0('0x7d')]);_0x2d97c7=_[_0x5ea0('0x7b')](_[_0x5ea0('0x42')](_0x2d22e0),['createdAt',_0x5ea0('0x7d'),_0x5ea0('0x7e'),_0x5ea0('0x7f')]);_0xc264e6[_0x5ea0('0x59')]={'mapKey':'mobile'};if(_0xc264e6[_0x5ea0('0x74')][_0x5ea0('0x3e')]){switch(_0xc264e6[_0x5ea0('0x74')][_0x5ea0('0x3e')]){case _0x5ea0('0x80'):_0xc264e6[_0x5ea0('0x59')]['from']=_0x6b68f6[_0x5ea0('0x59')]['From'];_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x59')]=_0x6b68f6[_0x5ea0('0x59')][_0x5ea0('0x81')];_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x82')]=_0x6b68f6[_0x5ea0('0x59')][_0x5ea0('0x83')];break;case _0x5ea0('0x84'):_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x85')]='+'+_0x6b68f6[_0x5ea0('0x59')][_0x5ea0('0x86')];_0xc264e6['body'][_0x5ea0('0x59')]=_0x6b68f6[_0x5ea0('0x59')]['text'];break;case'connectel':_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x85')]=_0x6b68f6[_0x5ea0('0x59')]['from'];_0xc264e6[_0x5ea0('0x59')]['body']=_0x6b68f6[_0x5ea0('0x59')][_0x5ea0('0x2a')];break;case _0x5ea0('0x87'):_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x85')]=_0x6b68f6[_0x5ea0('0x59')]['from'];_0xc264e6['body'][_0x5ea0('0x59')]=_0x6b68f6[_0x5ea0('0x59')]['body'];_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x82')]=_0x6b68f6[_0x5ea0('0x59')][_0x5ea0('0x88')];break;case _0x5ea0('0x89'):_0xc264e6['body'][_0x5ea0('0x85')]=_0x6b68f6[_0x5ea0('0x59')]['From'];_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x59')]=_0x6b68f6[_0x5ea0('0x59')]['Text'];_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x82')]=_0x6b68f6[_0x5ea0('0x59')][_0x5ea0('0x8a')];break;case _0x5ea0('0x8b'):_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x85')]='+'+_0x6b68f6[_0x5ea0('0x59')]['results'][0x0][_0x5ea0('0x85')];_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x59')]=_0x6b68f6[_0x5ea0('0x59')][_0x5ea0('0x8c')][0x0][_0x5ea0('0x8d')];_0xc264e6[_0x5ea0('0x59')]['messageId']=_0x6b68f6['body'][_0x5ea0('0x8c')][0x0]['messageId'];break;case _0x5ea0('0x8e'):_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x85')]=_0x6b68f6['body'][_0x5ea0('0x8f')];_0xc264e6['body'][_0x5ea0('0x59')]=_0x6b68f6[_0x5ea0('0x59')][_0x5ea0('0x90')][_0x5ea0('0x2a')];break;case _0x5ea0('0x91'):_0xc264e6['body'][_0x5ea0('0x85')]=_0x6b68f6[_0x5ea0('0x59')]['fromNumber'];_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x59')]=_0x6b68f6['body']['text'];_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x82')]=_0x6b68f6[_0x5ea0('0x59')][_0x5ea0('0x92')];break;case'bandwidth':_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x82')]=_0x6b68f6[_0x5ea0('0x59')][0x0][_0x5ea0('0x2a')]['id'];_0xc264e6[_0x5ea0('0x59')]['from']=_0x6b68f6[_0x5ea0('0x59')][0x0][_0x5ea0('0x2a')][_0x5ea0('0x85')];_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x59')]=_0x6b68f6[_0x5ea0('0x59')][0x0]['message'][_0x5ea0('0x8d')];break;case _0x5ea0('0x93'):_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x85')]=_0x6b68f6[_0x5ea0('0x59')][_0x5ea0('0x85')];_0xc264e6['body'][_0x5ea0('0x59')]=_0x6b68f6['body']['message'];_0xc264e6[_0x5ea0('0x59')]['messageId']=_0x6b68f6[_0x5ea0('0x59')][_0x5ea0('0x94')];break;}}if(_0xc264e6[_0x5ea0('0x59')]['id']){delete _0xc264e6['body']['id'];}if(_['isNil'](_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x85')])){throw new db[(_0x5ea0('0x79'))][(_0x5ea0('0x95'))](_0x5ea0('0x96'));}if(_['isNil'](_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x59')])||_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x59')]===''){throw new db[(_0x5ea0('0x79'))][(_0x5ea0('0x95'))](_0x5ea0('0x97'));}if(_[_0x5ea0('0x98')](_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x99')])){throw new db[(_0x5ea0('0x79'))][(_0x5ea0('0x95'))](_0x5ea0('0x9a')+_0x2d97c7);}if(!_['includes'](_0x2d97c7,_0xc264e6['body'][_0x5ea0('0x99')])){throw new db[(_0x5ea0('0x79'))][(_0x5ea0('0x95'))](_0x5ea0('0x9b')+_0x2d97c7);}_0x538ca5[_0xc264e6['body'][_0x5ea0('0x99')]]=_0xc264e6['body'][_0x5ea0('0x85')];return db[_0x5ea0('0x9c')][_0x5ea0('0x60')]({'where':{'id':_0xc264e6['account'][_0x5ea0('0x7f')]},'include':[{'model':db[_0x5ea0('0x9d')],'as':'Contacts','where':_0x538ca5,'limit':0x1,'order':[[_0x5ea0('0x7d'),_0x5ea0('0x9e')]]}]});})['then'](handleEntityNotFound(_0x5b0a6d,null))[_0x5ea0('0x22')](function(_0x4dcfda){if(_0x4dcfda){_0xc264e6[_0x5ea0('0x9f')]=_[_0x5ea0('0xa0')](_0x4dcfda,['Contacts']);if(_0x4dcfda[_0x5ea0('0xa1')][_0x5ea0('0x48')]){return _0x4dcfda[_0x5ea0('0xa1')][0x0];}var _0x13022a=_[_0x5ea0('0x1a')](_0xc264e6[_0x5ea0('0x59')],{'firstName':_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x85')],'ListId':_0x4dcfda['id']});_0x13022a[_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x99')]]=_0xc264e6[_0x5ea0('0x59')]['from'];return db[_0x5ea0('0x9d')]['create'](_0x13022a,{'fields':_0x5576cd,'raw':!![]});}})[_0x5ea0('0x22')](handleEntityNotFound(_0x5b0a6d,null))[_0x5ea0('0x22')](function(_0x3e0c76){if(_0x3e0c76){_0xc264e6[_0x5ea0('0xa2')]=_0x3e0c76;var _0x28b8da={'ContactId':_0x3e0c76['id'],'phone':_0xc264e6[_0x5ea0('0x59')][_0x5ea0('0x85')],'SmsAccountId':_0x6b68f6[_0x5ea0('0x62')]['id']};var _0x46d513={'ContactId':_0x3e0c76['id'],'SmsAccountId':_0x6b68f6[_0x5ea0('0x62')]['id'],'closed':![]};return db[_0x5ea0('0xa3')][_0x5ea0('0x60')]({'where':_0x46d513})[_0x5ea0('0x22')](function(_0x21b7dd){if(_0x21b7dd){return[_0x21b7dd,![]];}return db[_0x5ea0('0xa3')][_0x5ea0('0x58')](_0x28b8da)[_0x5ea0('0x22')](function(_0x3d937d){return[_0x3d937d,!![]];});});}})[_0x5ea0('0xa4')](function(_0x4445f5,_0x4bffea){_0xc264e6['interaction']=_0x4445f5[_0x5ea0('0x5b')]({'plain':!![]});_0xc264e6[_0x5ea0('0xa5')][_0x5ea0('0xa6')]=![];if(_0x4bffea){if(_0xc264e6[_0x5ea0('0x74')][_0x5ea0('0xa7')]){_0xc264e6[_0x5ea0('0x75')][_0x5ea0('0xa8')]({'id':0x0,'priority':_0xc264e6['applications'][_0x5ea0('0x48')]+0x1,'app':_0x5ea0('0xa9'),'appdata':_0x5ea0('0xaa'),'interval':_0x5ea0('0xab')});}_0xc264e6[_0x5ea0('0xa5')]['created']=!![];}return db[_0x5ea0('0xac')][_0x5ea0('0x58')]({'phone':_0xc264e6['body'][_0x5ea0('0x85')],'messageId':_0xc264e6['body']['messageId'],'body':_0xc264e6['body']['body'],'SmsAccountId':_0x6b68f6['params']['id'],'SmsInteractionId':_0x4445f5['id'],'direction':'in','ContactId':_0x4445f5[_0x5ea0('0xad')],'AttachmentId':_0xc264e6[_0x5ea0('0x59')]['AttachmentId']});})[_0x5ea0('0x22')](function(_0x25cd7f){_0xc264e6[_0x5ea0('0x2a')]=_0x25cd7f;if(_0xc264e6[_0x5ea0('0xa5')][_0x5ea0('0xae')]){return db[_0x5ea0('0xaf')][_0x5ea0('0x60')]({'attributes':['id',_0x5ea0('0x39')],'where':{'id':_0xc264e6[_0x5ea0('0xa5')][_0x5ea0('0xae')]}})['then'](function(_0x29e34c){if(_0x29e34c){_0xc264e6[_0x5ea0('0x75')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5ea0('0xb0'),'appdata':_0x29e34c[_0x5ea0('0x39')]+','+(_0xc264e6['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x5ea0('0xb1'),_0xc264e6);});}return respondWithRpcPromise(_0x5ea0('0xb2'),'startRouting',_0xc264e6);})[_0x5ea0('0x22')](function(_0x22f91a){if(_0x22f91a){var _0x5ef29c=0xc8;var _0xb9bd64=_0x5ea0('0xb3');logger[_0x5ea0('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb9bd64,_0x5ef29c,_0x5ea0('0xb4'));logger[_0x5ea0('0x26')](_0x5ea0('0xb5'),_0xb9bd64,_0x5ef29c,_0x5ea0('0xb4'),JSON[_0x5ea0('0x28')](_0x22f91a));if(_0xc264e6['account'][_0x5ea0('0x3e')]==='twilio'){return _0x5b0a6d['status'](_0x5ef29c)[_0x5ea0('0xb6')](_0x5ea0('0xb7'),_0x5ea0('0xb8'))['send'](_0x5ea0('0xb9'));}else{return _0x5b0a6d[_0x5ea0('0x2c')](_0x5ef29c)[_0x5ea0('0x33')](_0x22f91a);}}})[_0x5ea0('0x56')](handleError(_0x5b0a6d,null));};exports[_0x5ea0('0xba')]=function(_0x57b3b2,_0x25e865){var _0x43c8a0=_0x57b3b2['params']['id'];var _0x56926a=_0x57b3b2[_0x5ea0('0x59')];var _0x322084=0xc8;var _0x20387a=null;return db[_0x5ea0('0xbb')][_0x5ea0('0xbc')]({'isolationLevel':db[_0x5ea0('0xbb')][_0x5ea0('0xbd')][_0x5ea0('0xbe')][_0x5ea0('0xbf')]},function(_0x347a18){return db[_0x5ea0('0x52')][_0x5ea0('0x67')]({'where':{'id':_0x43c8a0},'transaction':_0x347a18})[_0x5ea0('0x22')](function(_0x24677f){if(_0x24677f){return db[_0x5ea0('0x72')]['destroy']({'where':{'SmsAccountId':_0x43c8a0},'transaction':_0x347a18})[_0x5ea0('0x22')](function(){var _0x451b7f=_[_0x5ea0('0x40')](_0x56926a,function(_0x1f0ccc){_0x1f0ccc[_0x5ea0('0x65')]=_0x43c8a0;return _0x1f0ccc;});return db[_0x5ea0('0x72')]['bulkCreate'](_0x451b7f,{'transaction':_0x347a18});});}else{_0x322084=0x194;_0x20387a=[];}});})[_0x5ea0('0x22')](function(){if(_0x322084!==0x194){return db[_0x5ea0('0x72')]['findAndCountAll']({'where':{'SmsAccountId':_0x43c8a0},'order':'priority'})[_0x5ea0('0x22')](function(_0x49c49d){_0x20387a=_0x49c49d;});}})['catch'](function(_0x4739c0){_0x322084=0x1f4;logger[_0x5ea0('0x29')](_0x4739c0[_0x5ea0('0xc0')]);if(_0x4739c0[_0x5ea0('0x39')]){delete _0x4739c0[_0x5ea0('0x39')];}_0x20387a=_0x4739c0;})['finally'](function(){if(_0x20387a===null){_0x25e865[_0x5ea0('0x2b')](_0x322084);}else{if(_0x322084===0x1f4){_0x25e865['status'](_0x322084)[_0x5ea0('0x3a')](_0x20387a);}else{_0x25e865[_0x5ea0('0x2c')](_0x322084)[_0x5ea0('0x33')](_0x20387a);}}});};exports['getApplications']=function(_0x38b0bd,_0x5c772c,_0x16b790){var _0x3136e8={};var _0x167552={};var _0x198196;var _0x3cdf0f;return db[_0x5ea0('0x52')][_0x5ea0('0x67')]({'where':{'id':_0x38b0bd[_0x5ea0('0x62')]['id']}})[_0x5ea0('0x22')](handleEntityNotFound(_0x5c772c,null))[_0x5ea0('0x22')](function(_0x7e6bde){if(_0x7e6bde){_0x198196=_0x7e6bde;_0x167552[_0x5ea0('0x46')]=_[_0x5ea0('0x42')](db['SmsApplication'][_0x5ea0('0x68')]);_0x167552[_0x5ea0('0x41')]=_[_0x5ea0('0x42')](_0x38b0bd[_0x5ea0('0x41')]);_0x167552[_0x5ea0('0x43')]=_[_0x5ea0('0x45')](_0x167552[_0x5ea0('0x46')],_0x167552[_0x5ea0('0x41')]);_0x3136e8[_0x5ea0('0x44')]=_[_0x5ea0('0x45')](_0x167552[_0x5ea0('0x46')],qs['fields'](_0x38b0bd['query'][_0x5ea0('0x47')]));_0x3136e8[_0x5ea0('0x44')]=_0x3136e8[_0x5ea0('0x44')][_0x5ea0('0x48')]?_0x3136e8[_0x5ea0('0x44')]:_0x167552[_0x5ea0('0x46')];_0x3136e8[_0x5ea0('0x4a')]=qs[_0x5ea0('0x4b')](_0x38b0bd[_0x5ea0('0x41')][_0x5ea0('0x4b')]);_0x3136e8['where']=qs[_0x5ea0('0x43')](_['pick'](_0x38b0bd[_0x5ea0('0x41')],_0x167552[_0x5ea0('0x43')]));if(_0x38b0bd['query'][_0x5ea0('0x4e')]){_0x3136e8['where']=_['merge'](_0x3136e8['where'],{'$or':_['map'](_0x3136e8[_0x5ea0('0x44')],function(_0x173831){var _0x2e7476={};_0x2e7476[_0x173831]={'$like':'%'+_0x38b0bd['query'][_0x5ea0('0x4e')]+'%'};return _0x2e7476;})});}_0x3136e8=_[_0x5ea0('0x4f')]({},_0x3136e8,_0x38b0bd['options']);return _0x198196['getApplications'](_0x3136e8);}})['then'](function(_0x316354){if(_0x316354){_0x3cdf0f=_0x316354['length'];if(!_0x38b0bd['query'][_0x5ea0('0x49')](_0x5ea0('0x69'))){_0x3136e8[_0x5ea0('0x31')]=qs[_0x5ea0('0x31')](_0x38b0bd[_0x5ea0('0x41')][_0x5ea0('0x31')]);_0x3136e8['offset']=qs[_0x5ea0('0x2e')](_0x38b0bd[_0x5ea0('0x41')][_0x5ea0('0x2e')]);}return _0x198196[_0x5ea0('0xc1')](_0x3136e8);}})[_0x5ea0('0x22')](function(_0x281a1d){if(_0x281a1d){return _0x281a1d?{'count':_0x3cdf0f,'rows':_0x281a1d}:null;}})[_0x5ea0('0x22')](respondWithResult(_0x5c772c,null))[_0x5ea0('0x56')](handleError(_0x5c772c,null));};exports[_0x5ea0('0xc2')]=function(_0x46b022,_0x2e55d8,_0x5abc42){var _0x36d0fb={'raw':![],'where':{}};var _0x4a7612={};var _0x1b01b4={'count':0x0,'rows':[]};return db[_0x5ea0('0x52')]['findOne']({'where':{'id':_0x46b022[_0x5ea0('0x62')]['id']}})[_0x5ea0('0x22')](handleEntityNotFound(_0x2e55d8,null))[_0x5ea0('0x22')](function(_0x30b5bc){if(_0x30b5bc){_0x4a7612[_0x5ea0('0x46')]=_['keys'](db['SmsInteraction'][_0x5ea0('0x68')]);_0x4a7612[_0x5ea0('0x41')]=_[_0x5ea0('0x42')](_0x46b022['query']);_0x4a7612[_0x5ea0('0x43')]=_[_0x5ea0('0x45')](_0x4a7612['model'],_0x4a7612[_0x5ea0('0x41')]);_0x36d0fb[_0x5ea0('0x44')]=_[_0x5ea0('0x45')](_0x4a7612[_0x5ea0('0x46')],qs['fields'](_0x46b022[_0x5ea0('0x41')][_0x5ea0('0x47')]));_0x36d0fb[_0x5ea0('0x44')]=_0x36d0fb[_0x5ea0('0x44')]['length']?_0x36d0fb[_0x5ea0('0x44')]:_0x4a7612[_0x5ea0('0x46')];if(!_0x46b022['query'][_0x5ea0('0x49')](_0x5ea0('0x69'))){_0x36d0fb[_0x5ea0('0x31')]=qs[_0x5ea0('0x31')](_0x46b022[_0x5ea0('0x41')]['limit']);_0x36d0fb[_0x5ea0('0x2e')]=qs[_0x5ea0('0x2e')](_0x46b022[_0x5ea0('0x41')][_0x5ea0('0x2e')]);}_0x36d0fb[_0x5ea0('0x4a')]=qs[_0x5ea0('0x4b')](_0x46b022[_0x5ea0('0x41')][_0x5ea0('0x4b')]);_0x36d0fb[_0x5ea0('0x4c')]=qs[_0x5ea0('0x43')](_[_0x5ea0('0x4d')](_0x46b022['query'],_0x4a7612[_0x5ea0('0x43')]));_0x36d0fb['where']['SmsAccountId']=_0x30b5bc['id'];if(_0x46b022[_0x5ea0('0x41')][_0x5ea0('0x4e')]){_0x36d0fb[_0x5ea0('0x4c')]=_[_0x5ea0('0x4f')](_0x36d0fb['where'],{'$or':_[_0x5ea0('0x40')](_0x36d0fb[_0x5ea0('0x44')],function(_0xc345c0){var _0x5275bb={};_0x5275bb[_0xc345c0]={'$like':'%'+_0x46b022['query'][_0x5ea0('0x4e')]+'%'};return _0x5275bb;})});}_0x36d0fb=_[_0x5ea0('0x4f')]({},_0x36d0fb,_0x46b022[_0x5ea0('0x51')]);return db[_0x5ea0('0xa3')][_0x5ea0('0x30')]({'where':_0x36d0fb[_0x5ea0('0x4c')]})[_0x5ea0('0x22')](function(_0x57c356){_0x1b01b4[_0x5ea0('0x30')]=_0x57c356;if(_0x46b022[_0x5ea0('0x41')][_0x5ea0('0x53')]){_0x36d0fb[_0x5ea0('0x54')]=[{'model':db[_0x5ea0('0x9d')],'as':_0x5ea0('0xc3'),'required':![]},{'model':db['User'],'as':_0x5ea0('0xc4'),'attributes':[_0x5ea0('0x39'),_0x5ea0('0xc5'),'internal'],'required':![]},{'model':db[_0x5ea0('0xc6')],'as':_0x5ea0('0xc7'),'attributes':['id',_0x5ea0('0x39'),_0x5ea0('0xc8')],'where':_0x46b022['query'][_0x5ea0('0xc9')]?{'id':_0x46b022[_0x5ea0('0x41')][_0x5ea0('0xc9')]}:undefined,'required':_0x46b022[_0x5ea0('0x41')][_0x5ea0('0xc9')]?!![]:![]}];}return db[_0x5ea0('0xa3')][_0x5ea0('0x55')](_0x36d0fb);})[_0x5ea0('0x22')](function(_0x653eeb){_0x1b01b4[_0x5ea0('0x6a')]=_0x653eeb;return _0x1b01b4;});}})['then'](respondWithFilteredResult(_0x2e55d8,_0x36d0fb))[_0x5ea0('0x56')](handleError(_0x2e55d8,null));};exports[_0x5ea0('0x3a')]=function(_0x5d03d9,_0x33f4bf,_0xac7097){var _0x374782,_0x3bc10a,_0x50181a;if(_[_0x5ea0('0x98')](_0x5d03d9[_0x5ea0('0x59')]['body'])||_0x5d03d9[_0x5ea0('0x59')][_0x5ea0('0x59')]===''){throw new db[(_0x5ea0('0x79'))][(_0x5ea0('0x95'))](_0x5ea0('0x97'));}if(_['isNil'](_0x5d03d9[_0x5ea0('0x59')]['to'])){throw new db['Sequelize']['ValidationError'](_0x5ea0('0xca'));}_0x374782=_0x5d03d9[_0x5ea0('0x59')]['to'];return db[_0x5ea0('0x52')]['find']({'where':{'id':_0x5d03d9['params']['id']},'include':[{'model':db['CmList'],'as':_0x5ea0('0xcb'),'include':[{'model':db[_0x5ea0('0x9d')],'as':_0x5ea0('0xa1'),'where':{'mobile':_0x374782},'limit':0x1,'order':[[_0x5ea0('0x7d'),_0x5ea0('0x9e')]]}]}]})[_0x5ea0('0x22')](handleEntityNotFound(_0x33f4bf,null))[_0x5ea0('0x22')](function(_0x3f429c){if(_0x3f429c&&_0x3f429c[_0x5ea0('0xcb')]){_0x3bc10a=_0x3f429c[_0x5ea0('0x5b')]({'plain':!![]});if(_0x3bc10a['List']&&_0x3bc10a[_0x5ea0('0xcb')][_0x5ea0('0xa1')]['length']){return _0x3bc10a[_0x5ea0('0xcb')][_0x5ea0('0xa1')][0x0];}return db[_0x5ea0('0x9d')]['create'](_['defaults'](_0x5d03d9[_0x5ea0('0x59')],{'firstName':_0x374782,'mobile':_0x374782,'phone':_0x374782,'ListId':_0x3bc10a[_0x5ea0('0x7f')]}));}})[_0x5ea0('0x22')](handleEntityNotFound(_0x33f4bf,null))[_0x5ea0('0x22')](function(_0x197573){if(_0x197573){_0x50181a=_0x197573;return db['SmsInteraction']['find']({'where':{'ContactId':_0x50181a['id'],'closed':![],'SmsAccountId':_0x3bc10a['id']}})[_0x5ea0('0x22')](function(_0x4574cf){if(_0x4574cf){return[_0x4574cf,![]];}return db[_0x5ea0('0xa3')][_0x5ea0('0x58')]({'UserId':_0x5d03d9[_0x5ea0('0x5a')]['id'],'ContactId':_0x50181a['id'],'SmsAccountId':_0x3bc10a['id'],'phone':_0x374782,'firstMsgDirection':'out','Messages':[_['merge'](_0x5d03d9['body'],{'read':![],'body':_0x5d03d9['body'][_0x5ea0('0x59')],'phone':_0x374782,'SmsAccountId':_0x3bc10a['id'],'UserId':_0x5d03d9['user']['id'],'ContactId':_0x50181a['id']})]},{'include':[{'model':db[_0x5ea0('0xac')],'as':_0x5ea0('0xcc')}]})[_0x5ea0('0x22')](function(_0x208c63){return[_0x208c63,!![]];});});}})[_0x5ea0('0xa4')](function(_0x2d3a5e,_0x2b893c){if(_0x2b893c){return _0x2d3a5e;}return db[_0x5ea0('0xac')]['create'](_[_0x5ea0('0x4f')](_0x5d03d9[_0x5ea0('0x59')],{'read':![],'body':_0x5d03d9['body']['body'],'phone':_0x374782,'SmsAccountId':_0x3bc10a['id'],'SmsInteractionId':_0x2d3a5e['id'],'UserId':_0x5d03d9[_0x5ea0('0x5a')]['id'],'ContactId':_0x50181a['id']}))[_0x5ea0('0x22')](function(_0x2026ed){_0x2d3a5e[_0x5ea0('0xcd')]['Messages']=[];_0x2d3a5e[_0x5ea0('0xcd')][_0x5ea0('0xcc')][_0x5ea0('0xa8')](_0x2026ed[_0x5ea0('0xcd')]);return _0x2d3a5e;});})[_0x5ea0('0x22')](respondWithResult(_0x33f4bf,null))[_0x5ea0('0x56')](handleError(_0x33f4bf,null));};exports[_0x5ea0('0x2c')]=function(_0x5d4593,_0x4a4e70,_0x4c3628){if(_0x5d4593['body']['id']){delete _0x5d4593[_0x5ea0('0x59')]['id'];}var _0x344c3c,_0x14c38b,_0x9935d9;return db['SmsAccount']['find']({'where':{'id':_0x5d4593[_0x5ea0('0x62')]['id']}})['then'](handleEntityNotFound(_0x4a4e70,null))[_0x5ea0('0x22')](function(_0x20fba5){if(_0x20fba5){_0x9935d9=_0x20fba5;logger[_0x5ea0('0x26')](_0x5ea0('0x27'),_0x5ea0('0x2c'),'received\x20delivery\x20report\x20from',_0x20fba5[_0x5ea0('0x3e')],util[_0x5ea0('0xce')](_0x5d4593[_0x5ea0('0x59')],{'showHidden':![],'depth':null}));switch(_0x20fba5[_0x5ea0('0x3e')]){case _0x5ea0('0x84'):if(_0x5d4593[_0x5ea0('0x59')][_0x5ea0('0xcf')]&&_0x5d4593[_0x5ea0('0x59')][_0x5ea0('0x2c')]){_0x14c38b=_0x5d4593['body'][_0x5ea0('0x2c')];return db['SmsMessage'][_0x5ea0('0x60')]({'where':{'messageId':_0x5d4593[_0x5ea0('0x59')][_0x5ea0('0xcf')]}});}break;case'connectel':if(_0x5d4593['body'][_0x5ea0('0xd0')]&&_0x5d4593[_0x5ea0('0x59')]['statusInt']){_0x14c38b=_0x5d4593[_0x5ea0('0x59')][_0x5ea0('0xd1')];return db['SmsMessage'][_0x5ea0('0x60')]({'where':{'messageId':_0x5d4593[_0x5ea0('0x59')]['requestid']}});}break;case'clicksend':if(_0x5d4593[_0x5ea0('0x59')][_0x5ea0('0x88')]&&_0x5d4593[_0x5ea0('0x59')]['status_code']){_0x14c38b=_0x5d4593[_0x5ea0('0x59')]['status_code'];return db[_0x5ea0('0xac')][_0x5ea0('0x60')]({'where':{'messageId':_0x5d4593[_0x5ea0('0x59')]['message_id']}});}break;case _0x5ea0('0x8b'):var _0x2cb044=_0x5d4593[_0x5ea0('0x59')][_0x5ea0('0x8c')][0x0];if(_0x2cb044[_0x5ea0('0x82')]&&_0x2cb044['status'][_0x5ea0('0xd2')]==='DELIVERED'){_0x14c38b=_0x2cb044['status']['groupName'];return db['SmsMessage'][_0x5ea0('0x60')]({'where':{'messageId':_0x2cb044['messageId']}});}break;case _0x5ea0('0x91'):if(_0x5d4593[_0x5ea0('0x59')]['messageId']&&_0x5d4593['body'][_0x5ea0('0x2c')]){_0x14c38b=_0x5d4593['body'][_0x5ea0('0x2c')];return db[_0x5ea0('0xac')][_0x5ea0('0x60')]({'where':{'messageId':_0x5d4593[_0x5ea0('0x59')]['messageId']}});}break;case _0x5ea0('0xd3'):if(_0x5d4593['body'][0x0][_0x5ea0('0x2a')]['id']){_0x14c38b=_0x5d4593[_0x5ea0('0x59')][0x0][_0x5ea0('0x3e')];return db['SmsMessage'][_0x5ea0('0x60')]({'where':{'messageId':_0x5d4593['body'][0x0][_0x5ea0('0x2a')]['id']}});}break;case'intelepeer':if(_0x5d4593['body'][_0x5ea0('0xd4')]&&_0x5d4593[_0x5ea0('0x59')][_0x5ea0('0x2c')]){_0x14c38b=_0x5d4593['body']['status'];return db['SmsMessage'][_0x5ea0('0x60')]({'where':{'messageId':_0x5d4593[_0x5ea0('0x59')][_0x5ea0('0xd4')]}});}break;}}})[_0x5ea0('0x22')](handleEntityNotFound(_0x4a4e70,null))[_0x5ea0('0x22')](function(_0x1d7b32){if(_0x1d7b32){_0x344c3c=_0x1d7b32;switch(_0x9935d9[_0x5ea0('0x3e')]){case _0x5ea0('0x84'):if(_0x14c38b===_0x5ea0('0xd5')){return _0x344c3c[_0x5ea0('0x36')]({'read':!![]});}else{logger[_0x5ea0('0x29')](_0x5ea0('0x27'),_0x5ea0('0x2c'),_0x5ea0('0x84'),util[_0x5ea0('0xce')](_0x5d4593['body'],{'showHidden':![],'depth':null}));}break;case _0x5ea0('0xd6'):if(_0x14c38b==='1'){return _0x344c3c[_0x5ea0('0x36')]({'read':!![]});}else{logger['error'](_0x5ea0('0x27'),_0x5ea0('0x2c'),_0x5ea0('0x84'),util[_0x5ea0('0xce')](_0x5d4593[_0x5ea0('0x59')],{'showHidden':![],'depth':null}));}break;case _0x5ea0('0x87'):if(!_0x5d4593[_0x5ea0('0x59')][_0x5ea0('0xd7')]&&_0x14c38b>=0xc8&&_0x14c38b<=0xce){return _0x344c3c[_0x5ea0('0x36')]({'read':!![]});}else{logger[_0x5ea0('0x29')](_0x5ea0('0x27'),_0x5ea0('0x2c'),_0x5ea0('0x87'),util[_0x5ea0('0xce')](_0x5d4593[_0x5ea0('0x59')],{'showHidden':![],'depth':null}));}break;case _0x5ea0('0x8b'):var _0x1fa80f=_0x5d4593['body'][_0x5ea0('0x8c')][0x0];if(_0x1fa80f[_0x5ea0('0x2c')][_0x5ea0('0xd2')]===_0x5ea0('0xd5')){return _0x344c3c[_0x5ea0('0x36')]({'read':!![]});}else{logger['error'](_0x5ea0('0x27'),_0x5ea0('0x2c'),_0x5ea0('0x8b'),util[_0x5ea0('0xce')](_0x5d4593['body'],{'showHidden':![],'depth':null}));}break;case _0x5ea0('0x91'):if(_0x14c38b==_0x5ea0('0xd8')||_0x14c38b=='RECEIVED_BY_RECIPIENT'){return _0x344c3c[_0x5ea0('0x36')]({'read':!![]});}else{logger[_0x5ea0('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5ea0('0x2c'),_0x5ea0('0x91'),util[_0x5ea0('0xce')](_0x5d4593[_0x5ea0('0x59')],{'showHidden':![],'depth':null}));}break;case _0x5ea0('0xd3'):if(_0x14c38b==_0x5ea0('0xd9')){return _0x344c3c['update']({'read':!![]});}else{logger['error'](_0x5ea0('0x27'),_0x5ea0('0x2c'),_0x5ea0('0xd3'),util[_0x5ea0('0xce')](_0x5d4593[_0x5ea0('0x59')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x14c38b==='DELIVRD'||_0x14c38b===_0x5ea0('0xda')){return _0x344c3c[_0x5ea0('0x36')]({'read':!![]});}else{logger['error'](_0x5ea0('0x27'),_0x5ea0('0x2c'),'intelepeer',util[_0x5ea0('0xce')](_0x5d4593[_0x5ea0('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x344c3c;}})['then'](respondWithResult(_0x4a4e70,null))[_0x5ea0('0x56')](handleError(_0x4a4e70,null));};exports[_0x5ea0('0xdb')]=function(_0x5162cb,_0x45a8c5,_0x15d103){var _0x1aae07,_0x3ee3e5,_0x4838ee;return db[_0x5ea0('0x52')][_0x5ea0('0x60')]({'where':{'id':_0x5162cb[_0x5ea0('0x62')]['id']}})['then'](handleEntityNotFound(_0x45a8c5,null))[_0x5ea0('0x22')](function(_0x1cb553){if(_0x1cb553){_0x4838ee=_0x1cb553;logger[_0x5ea0('0x26')](_0x5ea0('0x27'),'status',_0x5ea0('0xdc'),_0x1cb553[_0x5ea0('0x3e')],util[_0x5ea0('0xce')](_0x5162cb[_0x5ea0('0x41')],{'showHidden':![],'depth':null}));switch(_0x1cb553['type']){case _0x5ea0('0x8e'):if(_0x5162cb[_0x5ea0('0x41')][_0x5ea0('0xdd')]&&_0x5162cb[_0x5ea0('0x41')][_0x5ea0('0xde')]){_0x3ee3e5=_0x5162cb['query'][_0x5ea0('0xde')];return db[_0x5ea0('0xac')][_0x5ea0('0x60')]({'where':{'messageId':_0x5162cb[_0x5ea0('0x41')][_0x5ea0('0xdd')]}});}break;}}})[_0x5ea0('0x22')](handleEntityNotFound(_0x45a8c5,null))[_0x5ea0('0x22')](function(_0x1fc04e){if(_0x1fc04e){_0x1aae07=_0x1fc04e;switch(_0x4838ee['type']){case _0x5ea0('0x8e'):if(_0x3ee3e5==='2'||_0x3ee3e5==='6'){return _0x1aae07[_0x5ea0('0x36')]({'read':!![]});}else{logger[_0x5ea0('0x29')](_0x5ea0('0x27'),_0x5ea0('0x2c'),_0x5ea0('0x8e'),util[_0x5ea0('0xce')](_0x5162cb[_0x5ea0('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x1aae07;}})[_0x5ea0('0x22')](respondWithResult(_0x45a8c5,null))['catch'](handleError(_0x45a8c5,null));};exports['addAgents']=function(_0x317176,_0xa99bb4,_0x44fe1b){return db[_0x5ea0('0x52')][_0x5ea0('0x60')]({'where':{'id':_0x317176[_0x5ea0('0x62')]['id']}})[_0x5ea0('0x22')](handleEntityNotFound(_0xa99bb4,null))[_0x5ea0('0x22')](function(_0x6a4326){if(_0x6a4326){return _0x6a4326['addAgents'](_0x317176[_0x5ea0('0x59')][_0x5ea0('0x6f')],_['omit'](_0x317176[_0x5ea0('0x59')],[_0x5ea0('0x6f'),'id'])||{})[_0x5ea0('0xa4')](function(_0x32bd11){for(var _0xb8428a=0x0;_0xb8428a<_0x317176['body']['ids'][_0x5ea0('0x48')];_0xb8428a+=0x1){socket[_0x5ea0('0xdf')]('userSmsAccount:save',{'UserId':Number(_0x317176[_0x5ea0('0x59')][_0x5ea0('0x6f')][_0xb8428a]),'SmsAccountId':Number(_0x317176[_0x5ea0('0x62')]['id'])});}return _0x32bd11;});}})[_0x5ea0('0x22')](respondWithResult(_0xa99bb4,null))[_0x5ea0('0x56')](handleError(_0xa99bb4,null));};exports[_0x5ea0('0xe0')]=function(_0x5369bb,_0x250ce3,_0x9d3491){return db['SmsAccount']['find']({'where':{'id':_0x5369bb['params']['id']}})[_0x5ea0('0x22')](handleEntityNotFound(_0x250ce3,null))['then'](function(_0x5d240f){if(_0x5d240f){return _0x5d240f['removeAgents'](_0x5369bb['query'][_0x5ea0('0x6f')])[_0x5ea0('0x22')](function(){if(_[_0x5ea0('0xe1')](_0x5369bb[_0x5ea0('0x41')][_0x5ea0('0x6f')])){for(var _0x5b38d8=0x0;_0x5b38d8<_0x5369bb['query'][_0x5ea0('0x6f')]['length'];_0x5b38d8+=0x1){socket[_0x5ea0('0xdf')](_0x5ea0('0xe2'),{'UserId':Number(_0x5369bb[_0x5ea0('0x41')][_0x5ea0('0x6f')][_0x5b38d8]),'SmsAccountId':Number(_0x5369bb['params']['id'])});}}else{socket['emit'](_0x5ea0('0xe2'),{'UserId':Number(_0x5369bb[_0x5ea0('0x41')][_0x5ea0('0x6f')]),'SmsAccountId':Number(_0x5369bb['params']['id'])});}});}})[_0x5ea0('0x22')](respondWithStatusCode(_0x250ce3,null))[_0x5ea0('0x56')](handleError(_0x250ce3,null));};exports[_0x5ea0('0xe3')]=function(_0x3fd72c,_0x2886b6,_0xce270c){var _0x531d55={};var _0x367313={};var _0x5faab3;var _0x28c67c;return db[_0x5ea0('0x52')][_0x5ea0('0x67')]({'where':{'id':_0x3fd72c[_0x5ea0('0x62')]['id']}})['then'](handleEntityNotFound(_0x2886b6,null))['then'](function(_0xc56669){if(_0xc56669){_0x5faab3=_0xc56669;_0x367313[_0x5ea0('0x46')]=_[_0x5ea0('0x42')](db[_0x5ea0('0xaf')][_0x5ea0('0x68')]);_0x367313[_0x5ea0('0x41')]=_[_0x5ea0('0x42')](_0x3fd72c[_0x5ea0('0x41')]);_0x367313[_0x5ea0('0x43')]=_['intersection'](_0x367313[_0x5ea0('0x46')],_0x367313[_0x5ea0('0x41')]);_0x531d55[_0x5ea0('0x44')]=_['intersection'](_0x367313[_0x5ea0('0x46')],qs[_0x5ea0('0x47')](_0x3fd72c[_0x5ea0('0x41')]['fields']));_0x531d55['attributes']=_0x531d55[_0x5ea0('0x44')][_0x5ea0('0x48')]?_0x531d55['attributes']:_0x367313[_0x5ea0('0x46')];_0x531d55['order']=qs[_0x5ea0('0x4b')](_0x3fd72c[_0x5ea0('0x41')]['sort']);_0x531d55[_0x5ea0('0x4c')]=qs['filters'](_[_0x5ea0('0x4d')](_0x3fd72c[_0x5ea0('0x41')],_0x367313[_0x5ea0('0x43')]));if(_0x3fd72c[_0x5ea0('0x41')][_0x5ea0('0x4e')]){_0x531d55[_0x5ea0('0x4c')]=_[_0x5ea0('0x4f')](_0x531d55[_0x5ea0('0x4c')],{'$or':_[_0x5ea0('0x40')](_0x531d55['attributes'],function(_0x14177f){var _0x283866={};_0x283866[_0x14177f]={'$like':'%'+_0x3fd72c[_0x5ea0('0x41')][_0x5ea0('0x4e')]+'%'};return _0x283866;})});}_0x531d55=_[_0x5ea0('0x4f')]({},_0x531d55,_0x3fd72c[_0x5ea0('0x51')]);return _0x5faab3['getAgents'](_0x531d55);}})['then'](function(_0x37be1f){if(_0x37be1f){_0x28c67c=_0x37be1f[_0x5ea0('0x48')];if(!_0x3fd72c[_0x5ea0('0x41')][_0x5ea0('0x49')](_0x5ea0('0x69'))){_0x531d55['limit']=qs[_0x5ea0('0x31')](_0x3fd72c[_0x5ea0('0x41')][_0x5ea0('0x31')]);_0x531d55[_0x5ea0('0x2e')]=qs[_0x5ea0('0x2e')](_0x3fd72c['query']['offset']);}return _0x5faab3['getAgents'](_0x531d55);}})['then'](function(_0x2fe60b){if(_0x2fe60b){return _0x2fe60b?{'count':_0x28c67c,'rows':_0x2fe60b}:null;}})['then'](respondWithResult(_0x2886b6,null))['catch'](handleError(_0x2886b6,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 21cd326..0e477ec 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 _0xcfd2=['events','../../mysqldb','SmsAccount','setMaxListeners','save','emit','hook','exports'];(function(_0x22a1ba,_0x33de4e){var _0x30f28d=function(_0x576bb6){while(--_0x576bb6){_0x22a1ba['push'](_0x22a1ba['shift']());}};_0x30f28d(++_0x33de4e);}(_0xcfd2,0x80));var _0x2cfd=function(_0x529620,_0x534a42){_0x529620=_0x529620-0x0;var _0x159701=_0xcfd2[_0x529620];return _0x159701;};'use strict';var EventEmitter=require(_0x2cfd('0x0'));var SmsAccount=require(_0x2cfd('0x1'))['db'][_0x2cfd('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x2cfd('0x3')](0x0);var events={'afterCreate':_0x2cfd('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc8257c){return function(_0x35ab77,_0xcdec85,_0x60ea31){SmsAccountEvents[_0x2cfd('0x5')](_0xc8257c+':'+_0x35ab77['id'],_0x35ab77);SmsAccountEvents[_0x2cfd('0x5')](_0xc8257c,_0x35ab77);_0x60ea31(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x2cfd('0x6')](e,emitEvent(event));}}module[_0x2cfd('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x9cc6=['exports','events','SmsAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x48736b,_0x15ab78){var _0x144d7f=function(_0x34e2eb){while(--_0x34e2eb){_0x48736b['push'](_0x48736b['shift']());}};_0x144d7f(++_0x15ab78);}(_0x9cc6,0x160));var _0x69cc=function(_0xd1f854,_0x532346){_0xd1f854=_0xd1f854-0x0;var _0x548294=_0x9cc6[_0xd1f854];return _0x548294;};'use strict';var EventEmitter=require(_0x69cc('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x69cc('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x69cc('0x2')](0x0);var events={'afterCreate':_0x69cc('0x3'),'afterUpdate':'update','afterDestroy':_0x69cc('0x4')};function emitEvent(_0x51a308){return function(_0x108767,_0x4898f5,_0x26b9a5){SmsAccountEvents[_0x69cc('0x5')](_0x51a308+':'+_0x108767['id'],_0x108767);SmsAccountEvents[_0x69cc('0x5')](_0x51a308,_0x108767);_0x26b9a5(null);};}for(var e in events){if(events[_0x69cc('0x6')](e)){var event=events[e];SmsAccount[_0x69cc('0x7')](e,emitEvent(event));}}module[_0x69cc('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 6d77b70..7e33e63 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 _0xd12a=['exports','define','SmsAccount','sms_accounts','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0xd12a,0x112));var _0xad12=function(_0x56ee31,_0x53079f){_0x56ee31=_0x56ee31-0x0;var _0x4b664c=_0xd12a[_0x56ee31];return _0x4b664c;};'use strict';var _=require(_0xad12('0x0'));var util=require('util');var logger=require(_0xad12('0x1'))(_0xad12('0x2'));var moment=require(_0xad12('0x3'));var BPromise=require('bluebird');var rp=require(_0xad12('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad12('0x5'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0xad12('0x6')]=function(_0x35ca0e,_0x57762a){return _0x35ca0e[_0xad12('0x7')](_0xad12('0x8'),attributes,{'tableName':_0xad12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb176=['api','moment','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xb176,0x189));var _0x6b17=function(_0x3ea022,_0x2d5328){_0x3ea022=_0x3ea022-0x0;var _0x3b97a2=_0xb176[_0x3ea022];return _0x3b97a2;};'use strict';var _=require(_0x6b17('0x0'));var util=require(_0x6b17('0x1'));var logger=require(_0x6b17('0x2'))(_0x6b17('0x3'));var moment=require(_0x6b17('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b17('0x5'));var rimraf=require(_0x6b17('0x6'));var config=require(_0x6b17('0x7'));var attributes=require(_0x6b17('0x8'));module[_0x6b17('0x9')]=function(_0xf662aa,_0x5489d7){return _0xf662aa[_0x6b17('0xa')](_0x6b17('0xb'),attributes,{'tableName':'sms_accounts','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 02c8395..89519d8 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 _0xb34c=['request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','raw','options','where','attributes','include','map','model','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register'];(function(_0xdd52b7,_0x4f630f){var _0x1057c2=function(_0x118859){while(--_0x118859){_0xdd52b7['push'](_0xdd52b7['shift']());}};_0x1057c2(++_0x4f630f);}(_0xb34c,0x1de));var _0xcb34=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb34c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcb34('0x0'));var BPromise=require(_0xcb34('0x1'));var rs=require(_0xcb34('0x2'));var fs=require('fs');var Redis=require(_0xcb34('0x3'));var db=require(_0xcb34('0x4'))['db'];var utils=require(_0xcb34('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcb34('0x6'));var jayson=require(_0xcb34('0x7'));var client=jayson[_0xcb34('0x8')][_0xcb34('0x9')]({'port':0x232a});config[_0xcb34('0xa')]=_[_0xcb34('0xb')](config['redis'],{'host':_0xcb34('0xc'),'port':0x18eb});var socket=require(_0xcb34('0xd'))(new Redis(config[_0xcb34('0xa')]));require(_0xcb34('0xe'))[_0xcb34('0xf')](socket);function respondWithRpcPromise(_0x10135c,_0x5b0552,_0x13ae76){return new BPromise(function(_0x2810ee,_0x1732b4){return client[_0xcb34('0x10')](_0x10135c,_0x13ae76)[_0xcb34('0x11')](function(_0x17d21b){logger[_0xcb34('0x12')](_0xcb34('0x13'),_0x5b0552,_0xcb34('0x14'));logger[_0xcb34('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5b0552,'request\x20sent',JSON[_0xcb34('0x16')](_0x17d21b));if(_0x17d21b[_0xcb34('0x17')]){if(_0x17d21b[_0xcb34('0x17')][_0xcb34('0x18')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x5b0552,_0x17d21b['error'][_0xcb34('0x19')]);return _0x1732b4(_0x17d21b[_0xcb34('0x17')]['message']);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x5b0552,_0x17d21b['error'][_0xcb34('0x19')]);return _0x2810ee(_0x17d21b[_0xcb34('0x17')][_0xcb34('0x19')]);}else{logger['info'](_0xcb34('0x13'),_0x5b0552,_0xcb34('0x14'));_0x2810ee(_0x17d21b[_0xcb34('0x1a')][_0xcb34('0x19')]);}})[_0xcb34('0x1b')](function(_0xff964){logger['error'](_0xcb34('0x13'),_0x5b0552,_0xff964);_0x1732b4(_0xff964);});});}exports[_0xcb34('0x1c')]=function(_0x8f8e88){var _0x5ca75f=this;return new Promise(function(_0x5add5e,_0x53e016){return db[_0xcb34('0x1d')][_0xcb34('0x1e')]({'raw':_0x8f8e88['options']?_0x8f8e88['options'][_0xcb34('0x1f')]===undefined?!![]:![]:!![],'where':_0x8f8e88[_0xcb34('0x20')]?_0x8f8e88['options'][_0xcb34('0x21')]||null:null,'attributes':_0x8f8e88[_0xcb34('0x20')]?_0x8f8e88['options'][_0xcb34('0x22')]||null:null,'include':_0x8f8e88['options']?_0x8f8e88['options'][_0xcb34('0x23')]?_[_0xcb34('0x24')](_0x8f8e88[_0xcb34('0x20')][_0xcb34('0x23')],function(_0x416aba){return{'model':db[_0x416aba[_0xcb34('0x25')]],'as':_0x416aba['as'],'attributes':_0x416aba['attributes'],'include':_0x416aba[_0xcb34('0x23')]?_[_0xcb34('0x24')](_0x416aba[_0xcb34('0x23')],function(_0x4d34c8){return{'model':db[_0x4d34c8[_0xcb34('0x25')]],'as':_0x4d34c8['as'],'attributes':_0x4d34c8[_0xcb34('0x22')],'include':_0x4d34c8[_0xcb34('0x23')]?_[_0xcb34('0x24')](_0x4d34c8['include'],function(_0x2d50c7){return{'model':db[_0x2d50c7['model']],'as':_0x2d50c7['as'],'attributes':_0x2d50c7['attributes']};}):[]};}):[]};}):[]:[]})[_0xcb34('0x11')](function(_0x23041e){logger[_0xcb34('0x12')](_0xcb34('0x1c'),_0x8f8e88);logger[_0xcb34('0x15')](_0xcb34('0x1c'),_0x8f8e88,JSON[_0xcb34('0x16')](_0x23041e));_0x5add5e(_0x23041e);})[_0xcb34('0x1b')](function(_0x5a6b1a){logger[_0xcb34('0x17')](_0xcb34('0x1c'),_0x5a6b1a[_0xcb34('0x19')],_0x8f8e88);_0x53e016(_0x5ca75f[_0xcb34('0x17')](0x1f4,_0x5a6b1a[_0xcb34('0x19')]));});});}; \ No newline at end of file +var _0xee89=['message','result','catch','ShowSmsAccount','find','options','where','attributes','include','map','model','stringify','lodash','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0xee89,0x72));var _0x9ee8=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xee89[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x9ee8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9ee8('0x1'));var rs=require(_0x9ee8('0x2'));var fs=require('fs');var Redis=require(_0x9ee8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9ee8('0x4'));var config=require(_0x9ee8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x9ee8('0x6')][_0x9ee8('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9ee8('0x8')],{'host':_0x9ee8('0x9'),'port':0x18eb});var socket=require(_0x9ee8('0xa'))(new Redis(config[_0x9ee8('0x8')]));require(_0x9ee8('0xb'))[_0x9ee8('0xc')](socket);function respondWithRpcPromise(_0x5e8df4,_0x2fbd06,_0x574dc7){return new BPromise(function(_0x15a221,_0x2a2a3a){return client[_0x9ee8('0xd')](_0x5e8df4,_0x574dc7)[_0x9ee8('0xe')](function(_0x6a46c7){logger[_0x9ee8('0xf')](_0x9ee8('0x10'),_0x2fbd06,_0x9ee8('0x11'));logger[_0x9ee8('0x12')](_0x9ee8('0x13'),_0x2fbd06,'request\x20sent',JSON['stringify'](_0x6a46c7));if(_0x6a46c7[_0x9ee8('0x14')]){if(_0x6a46c7['error'][_0x9ee8('0x15')]===0x1f4){logger[_0x9ee8('0x14')](_0x9ee8('0x10'),_0x2fbd06,_0x6a46c7['error'][_0x9ee8('0x16')]);return _0x2a2a3a(_0x6a46c7[_0x9ee8('0x14')][_0x9ee8('0x16')]);}logger['error'](_0x9ee8('0x10'),_0x2fbd06,_0x6a46c7['error'][_0x9ee8('0x16')]);return _0x15a221(_0x6a46c7[_0x9ee8('0x14')][_0x9ee8('0x16')]);}else{logger[_0x9ee8('0xf')](_0x9ee8('0x10'),_0x2fbd06,'request\x20sent');_0x15a221(_0x6a46c7[_0x9ee8('0x17')][_0x9ee8('0x16')]);}})[_0x9ee8('0x18')](function(_0x11fedd){logger['error']('SmsAccount,\x20%s,\x20%s',_0x2fbd06,_0x11fedd);_0x2a2a3a(_0x11fedd);});});}exports[_0x9ee8('0x19')]=function(_0x4c5377){var _0x4e5713=this;return new Promise(function(_0x491498,_0x291fbc){return db['SmsAccount'][_0x9ee8('0x1a')]({'raw':_0x4c5377['options']?_0x4c5377[_0x9ee8('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4c5377[_0x9ee8('0x1b')]?_0x4c5377[_0x9ee8('0x1b')][_0x9ee8('0x1c')]||null:null,'attributes':_0x4c5377[_0x9ee8('0x1b')]?_0x4c5377[_0x9ee8('0x1b')][_0x9ee8('0x1d')]||null:null,'include':_0x4c5377[_0x9ee8('0x1b')]?_0x4c5377[_0x9ee8('0x1b')][_0x9ee8('0x1e')]?_[_0x9ee8('0x1f')](_0x4c5377[_0x9ee8('0x1b')][_0x9ee8('0x1e')],function(_0x17069c){return{'model':db[_0x17069c[_0x9ee8('0x20')]],'as':_0x17069c['as'],'attributes':_0x17069c[_0x9ee8('0x1d')],'include':_0x17069c[_0x9ee8('0x1e')]?_['map'](_0x17069c[_0x9ee8('0x1e')],function(_0x1aa3b2){return{'model':db[_0x1aa3b2['model']],'as':_0x1aa3b2['as'],'attributes':_0x1aa3b2['attributes'],'include':_0x1aa3b2[_0x9ee8('0x1e')]?_[_0x9ee8('0x1f')](_0x1aa3b2[_0x9ee8('0x1e')],function(_0x47f29e){return{'model':db[_0x47f29e[_0x9ee8('0x20')]],'as':_0x47f29e['as'],'attributes':_0x47f29e[_0x9ee8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x433fc7){logger[_0x9ee8('0xf')](_0x9ee8('0x19'),_0x4c5377);logger['debug']('ShowSmsAccount',_0x4c5377,JSON[_0x9ee8('0x21')](_0x433fc7));_0x491498(_0x433fc7);})[_0x9ee8('0x18')](function(_0x17ebbb){logger[_0x9ee8('0x14')](_0x9ee8('0x19'),_0x17ebbb['message'],_0x4c5377);_0x291fbc(_0x4e5713[_0x9ee8('0x14')](0x1f4,_0x17ebbb[_0x9ee8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index ae0d6bc..b703f4a 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 d5fd46d..ebfe970 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x1b5d5f,_0x5ed766){var _0x3c9347=function(_0x21afdd){while(--_0x21afdd){_0x1b5d5f['push'](_0x1b5d5f['shift']());}};_0x3c9347(++_0x5ed766);}(_0x3e74,0x175));var _0x43e7=function(_0x2796f2,_0x4f25f7){_0x2796f2=_0x2796f2-0x0;var _0x9f2004=_0x3e74[_0x2796f2];return _0x9f2004;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4a8eaf,_0x39ce59){var _0x5a658f=function(_0x4d935a){while(--_0x4d935a){_0x4a8eaf['push'](_0x4a8eaf['shift']());}};_0x5a658f(++_0x39ce59);}(_0x7217,0x19e));var _0x7721=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x7217[_0x139a3c];return _0x2b375b;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 263d20d..e2a2bd4 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 _0xd2da=['TEXT','*,*,*,*','STRING'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0xd2da,0xb3));var _0xad2d=function(_0x10dc60,_0x2fcce1){_0x10dc60=_0x10dc60-0x0;var _0x47dec5=_0xd2da[_0x10dc60];return _0x47dec5;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xad2d('0x0')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xad2d('0x1')]()},'description':{'type':Sequelize[_0xad2d('0x0')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xad2d('0x2')}}; \ No newline at end of file +var _0xcba9=['INTEGER','STRING','noop'];(function(_0x50dcb8,_0x511cde){var _0x27b179=function(_0x3370bf){while(--_0x3370bf){_0x50dcb8['push'](_0x50dcb8['shift']());}};_0x27b179(++_0x511cde);}(_0xcba9,0x132));var _0x9cba=function(_0x4f57fe,_0x5e9e7f){_0x4f57fe=_0x4f57fe-0x0;var _0x7d096=_0xcba9[_0x4f57fe];return _0x7d096;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9cba('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9cba('0x1')],'allowNull':![],'defaultValue':_0x9cba('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9cba('0x1')]},'interval':{'type':Sequelize[_0x9cba('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index ad1ed29..274d6db 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 _0xe535=['map','SmsApplication','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','update','then','destroy','error','name','send','index'];(function(_0xfeeb53,_0x153a3a){var _0x1cca91=function(_0x1b2712){while(--_0x1b2712){_0xfeeb53['push'](_0xfeeb53['shift']());}};_0x1cca91(++_0x153a3a);}(_0xe535,0xad));var _0x5e53=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xe535[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0x5e53('0x0'));var rimraf=require(_0x5e53('0x1'));var zipdir=require(_0x5e53('0x2'));var jsonpatch=require(_0x5e53('0x3'));var rp=require(_0x5e53('0x4'));var moment=require('moment');var BPromise=require(_0x5e53('0x5'));var Mustache=require(_0x5e53('0x6'));var util=require(_0x5e53('0x7'));var path=require(_0x5e53('0x8'));var sox=require(_0x5e53('0x9'));var csv=require(_0x5e53('0xa'));var ejs=require(_0x5e53('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5e53('0xc'));var squel=require(_0x5e53('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5e53('0xe'));var toCsv=require(_0x5e53('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e53('0xf'));var authService=require(_0x5e53('0x10'));var qs=require(_0x5e53('0x11'));var as=require(_0x5e53('0x12'));var hardwareService=require(_0x5e53('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5e53('0x14'));var licenseUtil=require(_0x5e53('0x15'));var db=require(_0x5e53('0x16'))['db'];function respondWithStatusCode(_0x35d7f4,_0x5a0467){_0x5a0467=_0x5a0467||0xcc;return function(_0x5d0b90){if(_0x5d0b90){return _0x35d7f4[_0x5e53('0x17')](_0x5a0467);}return _0x35d7f4['status'](_0x5a0467)[_0x5e53('0x18')]();};}function respondWithResult(_0x3ebfdd,_0x30a197){_0x30a197=_0x30a197||0xc8;return function(_0x5d12b6){if(_0x5d12b6){return _0x3ebfdd[_0x5e53('0x19')](_0x30a197)[_0x5e53('0x1a')](_0x5d12b6);}};}function respondWithFilteredResult(_0x134637,_0x463508){return function(_0x4d3596){if(_0x4d3596){var _0x36e407=typeof _0x463508[_0x5e53('0x1b')]===_0x5e53('0x1c')&&typeof _0x463508['limit']==='undefined';var _0x4416c2=_0x4d3596[_0x5e53('0x1d')];var _0x3594b8=_0x36e407?0x0:_0x463508[_0x5e53('0x1b')];var _0x3f4cc1=_0x36e407?_0x4d3596[_0x5e53('0x1d')]:_0x463508[_0x5e53('0x1b')]+_0x463508[_0x5e53('0x1e')];var _0x31cfe0;if(_0x3f4cc1>=_0x4416c2){_0x3f4cc1=_0x4416c2;_0x31cfe0=0xc8;}else{_0x31cfe0=0xce;}_0x134637[_0x5e53('0x19')](_0x31cfe0);return _0x134637['set'](_0x5e53('0x1f'),_0x3594b8+'-'+_0x3f4cc1+'/'+_0x4416c2)[_0x5e53('0x1a')](_0x4d3596);}return null;};}function patchUpdates(_0x6f88a0){return function(_0x3e4e7c){try{jsonpatch[_0x5e53('0x20')](_0x3e4e7c,_0x6f88a0,!![]);}catch(_0xb17a71){return BPromise['reject'](_0xb17a71);}return _0x3e4e7c['save']();};}function saveUpdates(_0x8ac48d,_0x101a62){return function(_0x1772e6){if(_0x1772e6){return _0x1772e6[_0x5e53('0x21')](_0x8ac48d)[_0x5e53('0x22')](function(_0x298e87){return _0x298e87;});}return null;};}function removeEntity(_0x176ce2,_0x2e7dda){return function(_0x4dcf71){if(_0x4dcf71){return _0x4dcf71[_0x5e53('0x23')]()[_0x5e53('0x22')](function(){_0x176ce2[_0x5e53('0x19')](0xcc)[_0x5e53('0x18')]();});}};}function handleEntityNotFound(_0x3703fc,_0x2c9b3c){return function(_0x255a38){if(!_0x255a38){_0x3703fc[_0x5e53('0x17')](0x194);}return _0x255a38;};}function handleError(_0x22a3b8,_0x18c605){_0x18c605=_0x18c605||0x1f4;return function(_0x47ba43){logger[_0x5e53('0x24')](_0x47ba43['stack']);if(_0x47ba43[_0x5e53('0x25')]){delete _0x47ba43[_0x5e53('0x25')];}_0x22a3b8['status'](_0x18c605)[_0x5e53('0x26')](_0x47ba43);};}exports[_0x5e53('0x27')]=function(_0x56d08f,_0x5cfacf){var _0x465e77={},_0x599fc1={},_0x560682={'count':0x0,'rows':[]};var _0x4a5ba1=_[_0x5e53('0x28')](db[_0x5e53('0x29')]['rawAttributes'],function(_0x1b720c){return{'name':_0x1b720c['fieldName'],'type':_0x1b720c['type'][_0x5e53('0x2a')]};});_0x599fc1[_0x5e53('0x2b')]=_[_0x5e53('0x28')](_0x4a5ba1,_0x5e53('0x25'));_0x599fc1[_0x5e53('0x2c')]=_[_0x5e53('0x2d')](_0x56d08f[_0x5e53('0x2c')]);_0x599fc1[_0x5e53('0x2e')]=_[_0x5e53('0x2f')](_0x599fc1['model'],_0x599fc1['query']);_0x465e77['attributes']=_[_0x5e53('0x2f')](_0x599fc1[_0x5e53('0x2b')],qs[_0x5e53('0x30')](_0x56d08f[_0x5e53('0x2c')]['fields']));_0x465e77['attributes']=_0x465e77[_0x5e53('0x31')][_0x5e53('0x32')]?_0x465e77[_0x5e53('0x31')]:_0x599fc1[_0x5e53('0x2b')];if(!_0x56d08f[_0x5e53('0x2c')][_0x5e53('0x33')](_0x5e53('0x34'))){_0x465e77[_0x5e53('0x1e')]=qs['limit'](_0x56d08f[_0x5e53('0x2c')]['limit']);_0x465e77[_0x5e53('0x1b')]=qs[_0x5e53('0x1b')](_0x56d08f[_0x5e53('0x2c')]['offset']);}_0x465e77[_0x5e53('0x35')]=qs[_0x5e53('0x36')](_0x56d08f[_0x5e53('0x2c')][_0x5e53('0x36')]);_0x465e77[_0x5e53('0x37')]=qs[_0x5e53('0x2e')](_[_0x5e53('0x38')](_0x56d08f[_0x5e53('0x2c')],_0x599fc1[_0x5e53('0x2e')]),_0x4a5ba1);if(_0x56d08f[_0x5e53('0x2c')]['filter']){_0x465e77['where']=_[_0x5e53('0x39')](_0x465e77[_0x5e53('0x37')],{'$or':_[_0x5e53('0x28')](_0x4a5ba1,function(_0xbc0127){if(_0xbc0127[_0x5e53('0x3a')]!==_0x5e53('0x3b')){var _0x19c2c6={};_0x19c2c6[_0xbc0127[_0x5e53('0x25')]]={'$like':'%'+_0x56d08f['query'][_0x5e53('0x3c')]+'%'};return _0x19c2c6;}})});}_0x465e77=_['merge']({},_0x465e77,_0x56d08f[_0x5e53('0x3d')]);var _0x347193={'where':_0x465e77[_0x5e53('0x37')]};return db[_0x5e53('0x29')][_0x5e53('0x1d')](_0x347193)[_0x5e53('0x22')](function(_0x4566ed){_0x560682[_0x5e53('0x1d')]=_0x4566ed;if(_0x56d08f[_0x5e53('0x2c')][_0x5e53('0x3e')]){_0x465e77[_0x5e53('0x3f')]=[{'all':!![]}];}return db[_0x5e53('0x29')][_0x5e53('0x40')](_0x465e77);})[_0x5e53('0x22')](function(_0x4b3d8a){_0x560682['rows']=_0x4b3d8a;return _0x560682;})[_0x5e53('0x22')](respondWithFilteredResult(_0x5cfacf,_0x465e77))[_0x5e53('0x41')](handleError(_0x5cfacf,null));};exports[_0x5e53('0x42')]=function(_0xceb71b,_0xf1ce18){var _0x5d6787={'raw':!![],'where':{'id':_0xceb71b[_0x5e53('0x43')]['id']}},_0x47b079={};_0x47b079[_0x5e53('0x2b')]=_['keys'](db['SmsApplication']['rawAttributes']);_0x47b079[_0x5e53('0x2c')]=_['keys'](_0xceb71b[_0x5e53('0x2c')]);_0x47b079[_0x5e53('0x2e')]=_[_0x5e53('0x2f')](_0x47b079['model'],_0x47b079['query']);_0x5d6787[_0x5e53('0x31')]=_[_0x5e53('0x2f')](_0x47b079['model'],qs[_0x5e53('0x30')](_0xceb71b[_0x5e53('0x2c')][_0x5e53('0x30')]));_0x5d6787[_0x5e53('0x31')]=_0x5d6787['attributes']['length']?_0x5d6787[_0x5e53('0x31')]:_0x47b079[_0x5e53('0x2b')];if(_0xceb71b[_0x5e53('0x2c')]['includeAll']){_0x5d6787['include']=[{'all':!![]}];}_0x5d6787=_[_0x5e53('0x39')]({},_0x5d6787,_0xceb71b[_0x5e53('0x3d')]);return db[_0x5e53('0x29')][_0x5e53('0x44')](_0x5d6787)[_0x5e53('0x22')](handleEntityNotFound(_0xf1ce18,null))[_0x5e53('0x22')](respondWithResult(_0xf1ce18,null))['catch'](handleError(_0xf1ce18,null));};exports[_0x5e53('0x45')]=function(_0x2009a2,_0x25fca2){return db[_0x5e53('0x29')]['create'](_0x2009a2[_0x5e53('0x46')],{})[_0x5e53('0x22')](respondWithResult(_0x25fca2,0xc9))[_0x5e53('0x41')](handleError(_0x25fca2,null));};exports[_0x5e53('0x21')]=function(_0x140d08,_0x35e96d){if(_0x140d08[_0x5e53('0x46')]['id']){delete _0x140d08[_0x5e53('0x46')]['id'];}return db[_0x5e53('0x29')][_0x5e53('0x44')]({'where':{'id':_0x140d08[_0x5e53('0x43')]['id']}})['then'](handleEntityNotFound(_0x35e96d,null))[_0x5e53('0x22')](saveUpdates(_0x140d08[_0x5e53('0x46')],null))[_0x5e53('0x22')](respondWithResult(_0x35e96d,null))[_0x5e53('0x41')](handleError(_0x35e96d,null));};exports[_0x5e53('0x23')]=function(_0x413c24,_0xe2eb15){return db[_0x5e53('0x29')][_0x5e53('0x44')]({'where':{'id':_0x413c24[_0x5e53('0x43')]['id']}})[_0x5e53('0x22')](handleEntityNotFound(_0xe2eb15,null))[_0x5e53('0x22')](removeEntity(_0xe2eb15,null))[_0x5e53('0x41')](handleError(_0xe2eb15,null));}; \ No newline at end of file +var _0x84d7=['findAll','catch','show','params','fields','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','SmsApplication','fieldName','type','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x446eff,_0x4e88e2){var _0x178fcf=function(_0x3c45ed){while(--_0x3c45ed){_0x446eff['push'](_0x446eff['shift']());}};_0x178fcf(++_0x4e88e2);}(_0x84d7,0x1bf));var _0x784d=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x84d7[_0x38ced4];return _0x547c07;};'use strict';var emlformat=require(_0x784d('0x0'));var rimraf=require(_0x784d('0x1'));var zipdir=require(_0x784d('0x2'));var jsonpatch=require(_0x784d('0x3'));var rp=require(_0x784d('0x4'));var moment=require(_0x784d('0x5'));var BPromise=require(_0x784d('0x6'));var Mustache=require(_0x784d('0x7'));var util=require(_0x784d('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x784d('0x9'));var ejs=require(_0x784d('0xa'));var fs=require('fs');var fs_extra=require(_0x784d('0xb'));var _=require(_0x784d('0xc'));var squel=require(_0x784d('0xd'));var crypto=require(_0x784d('0xe'));var jsforce=require(_0x784d('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x784d('0x10'));var Redis=require('ioredis');var authService=require(_0x784d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x784d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x784d('0x13'))(_0x784d('0x14'));var utils=require(_0x784d('0x15'));var config=require(_0x784d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x784d('0x17'))['db'];function respondWithStatusCode(_0x5dc5f6,_0x499696){_0x499696=_0x499696||0xcc;return function(_0x5cecfb){if(_0x5cecfb){return _0x5dc5f6[_0x784d('0x18')](_0x499696);}return _0x5dc5f6['status'](_0x499696)[_0x784d('0x19')]();};}function respondWithResult(_0x1b0ca4,_0x5013f1){_0x5013f1=_0x5013f1||0xc8;return function(_0x25c4b5){if(_0x25c4b5){return _0x1b0ca4[_0x784d('0x1a')](_0x5013f1)[_0x784d('0x1b')](_0x25c4b5);}};}function respondWithFilteredResult(_0x356105,_0x4874fe){return function(_0x3cd1fb){if(_0x3cd1fb){var _0x59996b=typeof _0x4874fe[_0x784d('0x1c')]===_0x784d('0x1d')&&typeof _0x4874fe[_0x784d('0x1e')]===_0x784d('0x1d');var _0x89f252=_0x3cd1fb[_0x784d('0x1f')];var _0x43f4d2=_0x59996b?0x0:_0x4874fe['offset'];var _0x14c3d2=_0x59996b?_0x3cd1fb[_0x784d('0x1f')]:_0x4874fe[_0x784d('0x1c')]+_0x4874fe['limit'];var _0x109565;if(_0x14c3d2>=_0x89f252){_0x14c3d2=_0x89f252;_0x109565=0xc8;}else{_0x109565=0xce;}_0x356105[_0x784d('0x1a')](_0x109565);return _0x356105[_0x784d('0x20')](_0x784d('0x21'),_0x43f4d2+'-'+_0x14c3d2+'/'+_0x89f252)['json'](_0x3cd1fb);}return null;};}function patchUpdates(_0x3d541b){return function(_0x2f6016){try{jsonpatch[_0x784d('0x22')](_0x2f6016,_0x3d541b,!![]);}catch(_0x3a8065){return BPromise[_0x784d('0x23')](_0x3a8065);}return _0x2f6016[_0x784d('0x24')]();};}function saveUpdates(_0xe2cb00,_0x533f16){return function(_0x35c10b){if(_0x35c10b){return _0x35c10b['update'](_0xe2cb00)[_0x784d('0x25')](function(_0x4d0544){return _0x4d0544;});}return null;};}function removeEntity(_0x41e38e,_0x557a0d){return function(_0x111279){if(_0x111279){return _0x111279[_0x784d('0x26')]()['then'](function(){_0x41e38e[_0x784d('0x1a')](0xcc)[_0x784d('0x19')]();});}};}function handleEntityNotFound(_0x3cfc65,_0x57f4bd){return function(_0x25ade3){if(!_0x25ade3){_0x3cfc65['sendStatus'](0x194);}return _0x25ade3;};}function handleError(_0x517d8e,_0x2b3fe4){_0x2b3fe4=_0x2b3fe4||0x1f4;return function(_0x15bbb0){logger[_0x784d('0x27')](_0x15bbb0[_0x784d('0x28')]);if(_0x15bbb0[_0x784d('0x29')]){delete _0x15bbb0[_0x784d('0x29')];}_0x517d8e['status'](_0x2b3fe4)[_0x784d('0x2a')](_0x15bbb0);};}exports['index']=function(_0x157c12,_0x2c6a04){var _0x4cb2a3={},_0x26555f={},_0x11e97a={'count':0x0,'rows':[]};var _0x3d6482=_[_0x784d('0x2b')](db[_0x784d('0x2c')]['rawAttributes'],function(_0x12b135){return{'name':_0x12b135[_0x784d('0x2d')],'type':_0x12b135[_0x784d('0x2e')]['key']};});_0x26555f['model']=_['map'](_0x3d6482,'name');_0x26555f[_0x784d('0x2f')]=_[_0x784d('0x30')](_0x157c12[_0x784d('0x2f')]);_0x26555f[_0x784d('0x31')]=_['intersection'](_0x26555f[_0x784d('0x32')],_0x26555f['query']);_0x4cb2a3[_0x784d('0x33')]=_[_0x784d('0x34')](_0x26555f[_0x784d('0x32')],qs['fields'](_0x157c12[_0x784d('0x2f')]['fields']));_0x4cb2a3[_0x784d('0x33')]=_0x4cb2a3['attributes'][_0x784d('0x35')]?_0x4cb2a3[_0x784d('0x33')]:_0x26555f[_0x784d('0x32')];if(!_0x157c12[_0x784d('0x2f')][_0x784d('0x36')](_0x784d('0x37'))){_0x4cb2a3[_0x784d('0x1e')]=qs['limit'](_0x157c12[_0x784d('0x2f')]['limit']);_0x4cb2a3[_0x784d('0x1c')]=qs[_0x784d('0x1c')](_0x157c12[_0x784d('0x2f')]['offset']);}_0x4cb2a3['order']=qs[_0x784d('0x38')](_0x157c12[_0x784d('0x2f')][_0x784d('0x38')]);_0x4cb2a3['where']=qs['filters'](_['pick'](_0x157c12[_0x784d('0x2f')],_0x26555f[_0x784d('0x31')]),_0x3d6482);if(_0x157c12[_0x784d('0x2f')][_0x784d('0x39')]){_0x4cb2a3[_0x784d('0x3a')]=_[_0x784d('0x3b')](_0x4cb2a3[_0x784d('0x3a')],{'$or':_[_0x784d('0x2b')](_0x3d6482,function(_0x58a278){if(_0x58a278[_0x784d('0x2e')]!==_0x784d('0x3c')){var _0x3bd6f4={};_0x3bd6f4[_0x58a278[_0x784d('0x29')]]={'$like':'%'+_0x157c12['query'][_0x784d('0x39')]+'%'};return _0x3bd6f4;}})});}_0x4cb2a3=_[_0x784d('0x3b')]({},_0x4cb2a3,_0x157c12[_0x784d('0x3d')]);var _0x1cb36f={'where':_0x4cb2a3[_0x784d('0x3a')]};return db[_0x784d('0x2c')][_0x784d('0x1f')](_0x1cb36f)[_0x784d('0x25')](function(_0x461bea){_0x11e97a[_0x784d('0x1f')]=_0x461bea;if(_0x157c12[_0x784d('0x2f')][_0x784d('0x3e')]){_0x4cb2a3[_0x784d('0x3f')]=[{'all':!![]}];}return db[_0x784d('0x2c')][_0x784d('0x40')](_0x4cb2a3);})['then'](function(_0x48a721){_0x11e97a['rows']=_0x48a721;return _0x11e97a;})[_0x784d('0x25')](respondWithFilteredResult(_0x2c6a04,_0x4cb2a3))[_0x784d('0x41')](handleError(_0x2c6a04,null));};exports[_0x784d('0x42')]=function(_0x1f9787,_0x594f80){var _0x1bcd48={'raw':!![],'where':{'id':_0x1f9787[_0x784d('0x43')]['id']}},_0x82c0aa={};_0x82c0aa[_0x784d('0x32')]=_[_0x784d('0x30')](db[_0x784d('0x2c')]['rawAttributes']);_0x82c0aa[_0x784d('0x2f')]=_[_0x784d('0x30')](_0x1f9787['query']);_0x82c0aa[_0x784d('0x31')]=_[_0x784d('0x34')](_0x82c0aa['model'],_0x82c0aa[_0x784d('0x2f')]);_0x1bcd48[_0x784d('0x33')]=_[_0x784d('0x34')](_0x82c0aa['model'],qs[_0x784d('0x44')](_0x1f9787[_0x784d('0x2f')][_0x784d('0x44')]));_0x1bcd48['attributes']=_0x1bcd48[_0x784d('0x33')][_0x784d('0x35')]?_0x1bcd48['attributes']:_0x82c0aa['model'];if(_0x1f9787[_0x784d('0x2f')][_0x784d('0x3e')]){_0x1bcd48[_0x784d('0x3f')]=[{'all':!![]}];}_0x1bcd48=_[_0x784d('0x3b')]({},_0x1bcd48,_0x1f9787[_0x784d('0x3d')]);return db[_0x784d('0x2c')]['find'](_0x1bcd48)['then'](handleEntityNotFound(_0x594f80,null))[_0x784d('0x25')](respondWithResult(_0x594f80,null))[_0x784d('0x41')](handleError(_0x594f80,null));};exports[_0x784d('0x45')]=function(_0x2e3082,_0x2257b6){return db[_0x784d('0x2c')][_0x784d('0x45')](_0x2e3082[_0x784d('0x46')],{})['then'](respondWithResult(_0x2257b6,0xc9))[_0x784d('0x41')](handleError(_0x2257b6,null));};exports[_0x784d('0x47')]=function(_0x351957,_0x5f4492){if(_0x351957[_0x784d('0x46')]['id']){delete _0x351957['body']['id'];}return db['SmsApplication']['find']({'where':{'id':_0x351957['params']['id']}})[_0x784d('0x25')](handleEntityNotFound(_0x5f4492,null))[_0x784d('0x25')](saveUpdates(_0x351957['body'],null))[_0x784d('0x25')](respondWithResult(_0x5f4492,null))[_0x784d('0x41')](handleError(_0x5f4492,null));};exports[_0x784d('0x26')]=function(_0x4a422e,_0x1d316a){return db[_0x784d('0x2c')][_0x784d('0x48')]({'where':{'id':_0x4a422e[_0x784d('0x43')]['id']}})[_0x784d('0x25')](handleEntityNotFound(_0x1d316a,null))[_0x784d('0x25')](removeEntity(_0x1d316a,null))[_0x784d('0x41')](handleError(_0x1d316a,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 31a7ad9..b08c59e 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 _0xe676=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xe676,0x14f));var _0x6e67=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xe676[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x6e67('0x0'));var util=require('util');var logger=require(_0x6e67('0x1'))(_0x6e67('0x2'));var moment=require(_0x6e67('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e67('0x4'));var fs=require('fs');var path=require(_0x6e67('0x5'));var rimraf=require(_0x6e67('0x6'));var config=require(_0x6e67('0x7'));var attributes=require(_0x6e67('0x8'));module['exports']=function(_0x226490,_0xf1aae6){return _0x226490[_0x6e67('0x9')](_0x6e67('0xa'),attributes,{'tableName':_0x6e67('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e67('0xc'),'collate':_0x6e67('0xd')});}; \ No newline at end of file +var _0xd5da=['SmsApplication','sms_applications','utf8mb4','lodash','util','api','moment','bluebird','path','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x4e1416,_0x29cb24){var _0x3bd8ad=function(_0x3f0ba1){while(--_0x3f0ba1){_0x4e1416['push'](_0x4e1416['shift']());}};_0x3bd8ad(++_0x29cb24);}(_0xd5da,0x9f));var _0xad5d=function(_0x1b95d2,_0x2f340e){_0x1b95d2=_0x1b95d2-0x0;var _0x52d639=_0xd5da[_0x1b95d2];return _0x52d639;};'use strict';var _=require(_0xad5d('0x0'));var util=require(_0xad5d('0x1'));var logger=require('../../config/logger')(_0xad5d('0x2'));var moment=require(_0xad5d('0x3'));var BPromise=require(_0xad5d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad5d('0x5'));var rimraf=require('rimraf');var config=require(_0xad5d('0x6'));var attributes=require(_0xad5d('0x7'));module[_0xad5d('0x8')]=function(_0x2bec21,_0x1ff6fc){return _0x2bec21[_0xad5d('0x9')](_0xad5d('0xa'),attributes,{'tableName':_0xad5d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xad5d('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index b0d9fb8..3306926 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 _0x2ace=['debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0x2ace,0x17e));var _0xe2ac=function(_0x20b035,_0x33e530){_0x20b035=_0x20b035-0x0;var _0x26d5ec=_0x2ace[_0x20b035];return _0x26d5ec;};'use strict';var _=require('lodash');var util=require(_0xe2ac('0x0'));var moment=require(_0xe2ac('0x1'));var BPromise=require(_0xe2ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2ac('0x3'));var db=require(_0xe2ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2ac('0x5'))(_0xe2ac('0x6'));var config=require(_0xe2ac('0x7'));var jayson=require(_0xe2ac('0x8'));var client=jayson[_0xe2ac('0x9')][_0xe2ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f1f8c,_0x391f96,_0x8e831b){return new BPromise(function(_0x28d0d1,_0x4064f9){return client[_0xe2ac('0xb')](_0x2f1f8c,_0x8e831b)[_0xe2ac('0xc')](function(_0x4fb111){logger['info'](_0xe2ac('0xd'),_0x391f96,'request\x20sent');logger[_0xe2ac('0xe')](_0xe2ac('0xf'),_0x391f96,'request\x20sent',JSON[_0xe2ac('0x10')](_0x4fb111));if(_0x4fb111[_0xe2ac('0x11')]){if(_0x4fb111[_0xe2ac('0x11')]['code']===0x1f4){logger[_0xe2ac('0x11')](_0xe2ac('0xd'),_0x391f96,_0x4fb111[_0xe2ac('0x11')][_0xe2ac('0x12')]);return _0x4064f9(_0x4fb111[_0xe2ac('0x11')]['message']);}logger[_0xe2ac('0x11')]('SmsApplication,\x20%s,\x20%s',_0x391f96,_0x4fb111[_0xe2ac('0x11')][_0xe2ac('0x12')]);return _0x28d0d1(_0x4fb111[_0xe2ac('0x11')][_0xe2ac('0x12')]);}else{logger[_0xe2ac('0x13')](_0xe2ac('0xd'),_0x391f96,_0xe2ac('0x14'));_0x28d0d1(_0x4fb111[_0xe2ac('0x15')][_0xe2ac('0x12')]);}})['catch'](function(_0x557ef6){logger[_0xe2ac('0x11')]('SmsApplication,\x20%s,\x20%s',_0x391f96,_0x557ef6);_0x4064f9(_0x557ef6);});});} \ No newline at end of file +var _0x1a38=['lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x369746,_0xa84e2a){var _0x4dbb50=function(_0x28b8b8){while(--_0x28b8b8){_0x369746['push'](_0x369746['shift']());}};_0x4dbb50(++_0xa84e2a);}(_0x1a38,0xb0));var _0x81a3=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x1a38[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require(_0x81a3('0x0'));var util=require(_0x81a3('0x1'));var moment=require(_0x81a3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81a3('0x3'))['db'];var utils=require(_0x81a3('0x4'));var logger=require(_0x81a3('0x5'))(_0x81a3('0x6'));var config=require(_0x81a3('0x7'));var jayson=require(_0x81a3('0x8'));var client=jayson[_0x81a3('0x9')][_0x81a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3153ee,_0x2d331e,_0x207345){return new BPromise(function(_0xe10e0a,_0x3be616){return client['request'](_0x3153ee,_0x207345)[_0x81a3('0xb')](function(_0x252685){logger[_0x81a3('0xc')](_0x81a3('0xd'),_0x2d331e,_0x81a3('0xe'));logger['debug'](_0x81a3('0xf'),_0x2d331e,_0x81a3('0xe'),JSON[_0x81a3('0x10')](_0x252685));if(_0x252685['error']){if(_0x252685['error'][_0x81a3('0x11')]===0x1f4){logger[_0x81a3('0x12')](_0x81a3('0xd'),_0x2d331e,_0x252685[_0x81a3('0x12')][_0x81a3('0x13')]);return _0x3be616(_0x252685[_0x81a3('0x12')][_0x81a3('0x13')]);}logger[_0x81a3('0x12')](_0x81a3('0xd'),_0x2d331e,_0x252685[_0x81a3('0x12')][_0x81a3('0x13')]);return _0xe10e0a(_0x252685[_0x81a3('0x12')]['message']);}else{logger[_0x81a3('0xc')](_0x81a3('0xd'),_0x2d331e,_0x81a3('0xe'));_0xe10e0a(_0x252685[_0x81a3('0x14')]['message']);}})[_0x81a3('0x15')](function(_0x18fc8d){logger['error'](_0x81a3('0xd'),_0x2d331e,_0x18fc8d);_0x3be616(_0x18fc8d);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 38f7756..47a2169 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 _0x9348=['addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','put','/:id','tracked','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id/messages','getMessages','/:id/download','download','post','create'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x9348,0x10d));var _0x8934=function(_0x57f42a,_0x38c263){_0x57f42a=_0x57f42a-0x0;var _0x184881=_0x9348[_0x57f42a];return _0x184881;};'use strict';var multer=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var path=require(_0x8934('0x2'));var timeout=require(_0x8934('0x3'));var express=require(_0x8934('0x4'));var router=express['Router']();var fs_extra=require(_0x8934('0x5'));var auth=require(_0x8934('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8934('0x7'));var controller=require(_0x8934('0x8'));router[_0x8934('0x9')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0xb')]);router[_0x8934('0x9')]('/describe',auth[_0x8934('0xa')](),controller[_0x8934('0xc')]);router[_0x8934('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x8934('0xd'),auth['isAuthenticated'](),controller[_0x8934('0xe')]);router[_0x8934('0x9')](_0x8934('0xf'),auth[_0x8934('0xa')](),controller[_0x8934('0x10')]);router[_0x8934('0x11')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0x12')]);router['post'](_0x8934('0xd'),auth[_0x8934('0xa')](),controller[_0x8934('0x13')]);router[_0x8934('0x11')](_0x8934('0x14'),auth[_0x8934('0xa')](),interaction['tracked'](_0x8934('0x15'),_0x8934('0x16')),controller[_0x8934('0x17')]);router[_0x8934('0x18')](_0x8934('0x19'),auth[_0x8934('0xa')](),interaction[_0x8934('0x1a')](_0x8934('0x15'),'smsinteraction:update'),controller[_0x8934('0x1b')]);router[_0x8934('0x1c')](_0x8934('0x19'),auth['isAuthenticated'](),interaction['tracked']('sms',_0x8934('0x1d')),controller['destroy']);router[_0x8934('0x1c')](_0x8934('0x14'),auth[_0x8934('0xa')](),controller[_0x8934('0x1e')]);module[_0x8934('0x1f')]=router; \ No newline at end of file +var _0x3266=['isAuthenticated','index','get','/:id','show','getMessages','/:id/download','download','post','create','addMessage','sms','smsinteraction:addtags','addTags','put','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller'];(function(_0x1baecd,_0x4ba3b6){var _0x3b520f=function(_0x31e233){while(--_0x31e233){_0x1baecd['push'](_0x1baecd['shift']());}};_0x3b520f(++_0x4ba3b6);}(_0x3266,0x6a));var _0x6326=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x3266[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var path=require(_0x6326('0x2'));var timeout=require(_0x6326('0x3'));var express=require(_0x6326('0x4'));var router=express[_0x6326('0x5')]();var fs_extra=require(_0x6326('0x6'));var auth=require(_0x6326('0x7'));var interaction=require(_0x6326('0x8'));var config=require('../../config/environment');var controller=require(_0x6326('0x9'));router['get']('/',auth[_0x6326('0xa')](),controller[_0x6326('0xb')]);router[_0x6326('0xc')]('/describe',auth[_0x6326('0xa')](),controller['describe']);router[_0x6326('0xc')](_0x6326('0xd'),auth[_0x6326('0xa')](),controller[_0x6326('0xe')]);router[_0x6326('0xc')]('/:id/messages',auth[_0x6326('0xa')](),controller[_0x6326('0xf')]);router[_0x6326('0xc')](_0x6326('0x10'),auth[_0x6326('0xa')](),controller[_0x6326('0x11')]);router[_0x6326('0x12')]('/',auth[_0x6326('0xa')](),controller[_0x6326('0x13')]);router[_0x6326('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6326('0x14')]);router[_0x6326('0x12')]('/:id/tags',auth[_0x6326('0xa')](),interaction['tracked'](_0x6326('0x15'),_0x6326('0x16')),controller[_0x6326('0x17')]);router[_0x6326('0x18')](_0x6326('0xd'),auth[_0x6326('0xa')](),interaction['tracked'](_0x6326('0x15'),'smsinteraction:update'),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x6326('0x15'),_0x6326('0x19')),controller[_0x6326('0x1a')]);router['delete']('/:id/tags',auth[_0x6326('0xa')](),controller[_0x6326('0x1b')]);module[_0x6326('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 472dbc9..294e953 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 _0xc1fc=['moment','exports','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x355b06,_0x2f7c9f){var _0x46844a=function(_0x3045f1){while(--_0x3045f1){_0x355b06['push'](_0x355b06['shift']());}};_0x46844a(++_0x2f7c9f);}(_0xc1fc,0x93));var _0xcc1f=function(_0x18872a,_0x151df4){_0x18872a=_0x18872a-0x0;var _0x50bf06=_0xc1fc[_0x18872a];return _0x50bf06;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcc1f('0x0'));module[_0xcc1f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcc1f('0x2')]},'disposition':{'type':Sequelize[_0xcc1f('0x3')]},'secondDisposition':{'type':Sequelize[_0xcc1f('0x3')]},'thirdDisposition':{'type':Sequelize[_0xcc1f('0x3')]},'note':{'type':Sequelize[_0xcc1f('0x3')]},'phone':{'type':Sequelize[_0xcc1f('0x3')]},'read1stAt':{'type':Sequelize[_0xcc1f('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xcc1f('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcc1f('0x4')]('in',_0xcc1f('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xcc1f('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x4cfd=['DATE','STRING','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4cfd,0x170));var _0xd4cf=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0x4cfd[_0x186d17];return _0x5d4b89;};'use strict';var Sequelize=require(_0xd4cf('0x0'));var moment=require(_0xd4cf('0x1'));module['exports']={'closed':{'type':Sequelize[_0xd4cf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd4cf('0x3')]},'disposition':{'type':Sequelize[_0xd4cf('0x4')]},'secondDisposition':{'type':Sequelize[_0xd4cf('0x4')]},'thirdDisposition':{'type':Sequelize[_0xd4cf('0x4')]},'note':{'type':Sequelize[_0xd4cf('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xd4cf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd4cf('0x5')]('in',_0xd4cf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd4cf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xd4cf('0x5')]('in',_0xd4cf('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 4a114fa..0d18b7a 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 _0xba4f=['root','server','tmp','transcript-%d-%s.zip','push','User','fullname','firstName','Messages','createdAt','secret','SmsAccount','get','mkdirSync','Account','Owner','N.A.','closed','closedAt','disposition','map','direction','System','Contact','lastName','out','renderFile','views','downloadInteraction.ejs','Sms','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','util','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','destroy','name','send','index','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','catch','params','model','keys','intersection','attributes','fields','length','includeAll','include','merge','SmsInteraction','find','create','body','update','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','filters','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join'];(function(_0x4c76ad,_0x24bdab){var _0xde0a18=function(_0x575d21){while(--_0x575d21){_0x4c76ad['push'](_0x4c76ad['shift']());}};_0xde0a18(++_0x24bdab);}(_0xba4f,0x180));var _0xfba4=function(_0x2fdfb7,_0x2667b7){_0x2fdfb7=_0x2fdfb7-0x0;var _0x2faafc=_0xba4f[_0x2fdfb7];return _0x2faafc;};'use strict';var rimraf=require(_0xfba4('0x0'));var zipdir=require(_0xfba4('0x1'));var moment=require(_0xfba4('0x2'));var BPromise=require('bluebird');var util=require(_0xfba4('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xfba4('0x4'));var Redis=require(_0xfba4('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xfba4('0x6'));var pdf=require(_0xfba4('0x7'));var logger=require('../../config/logger')(_0xfba4('0x8'));var config=require(_0xfba4('0x9'));var db=require(_0xfba4('0xa'))['db'];config[_0xfba4('0xb')]=_[_0xfba4('0xc')](config[_0xfba4('0xb')],{'host':_0xfba4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfba4('0xb')]));require('./smsInteraction.socket')[_0xfba4('0xe')](socket);function respondWithStatusCode(_0xaf0242,_0x35d4db){_0x35d4db=_0x35d4db||0xcc;return function(_0x22e50f){if(_0x22e50f){return _0xaf0242[_0xfba4('0xf')](_0x35d4db);}return _0xaf0242[_0xfba4('0x10')](_0x35d4db)[_0xfba4('0x11')]();};}function respondWithResult(_0x5c4404,_0x5c0475){_0x5c0475=_0x5c0475||0xc8;return function(_0x4db646){if(_0x4db646){return _0x5c4404[_0xfba4('0x10')](_0x5c0475)[_0xfba4('0x12')](_0x4db646);}};}function respondWithFilteredResult(_0x47e5ed,_0x5b1f56){return function(_0x351c04){if(_0x351c04){var _0x3b10b=typeof _0x5b1f56[_0xfba4('0x13')]===_0xfba4('0x14')&&typeof _0x5b1f56[_0xfba4('0x15')]===_0xfba4('0x14');var _0xb63866=_0x351c04[_0xfba4('0x16')];var _0x5bb8b9=_0x3b10b?0x0:_0x5b1f56[_0xfba4('0x13')];var _0x3f408e=_0x3b10b?_0x351c04[_0xfba4('0x16')]:_0x5b1f56[_0xfba4('0x13')]+_0x5b1f56[_0xfba4('0x15')];var _0x2a451a;if(_0x3f408e>=_0xb63866){_0x3f408e=_0xb63866;_0x2a451a=0xc8;}else{_0x2a451a=0xce;}_0x47e5ed[_0xfba4('0x10')](_0x2a451a);return _0x47e5ed['set'](_0xfba4('0x17'),_0x5bb8b9+'-'+_0x3f408e+'/'+_0xb63866)[_0xfba4('0x12')](_0x351c04);}return null;};}function saveUpdates(_0x2a7b4e){return function(_0x244223){if(_0x244223){return _0x244223['update'](_0x2a7b4e)[_0xfba4('0x18')](function(_0x136313){return _0x136313;});}return null;};}function removeEntity(_0x1c7683){return function(_0x45aaed){if(_0x45aaed){return _0x45aaed[_0xfba4('0x19')]()['then'](function(){_0x1c7683[_0xfba4('0x10')](0xcc)[_0xfba4('0x11')]();});}};}function handleEntityNotFound(_0x515381){return function(_0x58abb8){if(!_0x58abb8){_0x515381[_0xfba4('0xf')](0x194);}return _0x58abb8;};}function handleError(_0x381a6c,_0x341b31){_0x341b31=_0x341b31||0x1f4;return function(_0x32a107){logger['error'](_0x32a107['stack']);if(_0x32a107['name']){delete _0x32a107[_0xfba4('0x1a')];}_0x381a6c[_0xfba4('0x10')](_0x341b31)[_0xfba4('0x1b')](_0x32a107);};}exports[_0xfba4('0x1c')]=function(_0x3d040c,_0xecc8fa){var _0x38d6d0={};var _0x15871f=_['map'](db['SmsInteraction'][_0xfba4('0x1d')],function(_0x176c8a){return{'name':_0x176c8a[_0xfba4('0x1e')],'type':_0x176c8a[_0xfba4('0x1f')][_0xfba4('0x20')]};});_0x38d6d0=qs[_0xfba4('0x21')](_0x15871f,_0x3d040c);return interaction[_0xfba4('0x22')](_0xfba4('0x23'),_0x3d040c[_0xfba4('0x24')],_0x3d040c[_0xfba4('0x25')],_0x38d6d0,_0x15871f)['then'](respondWithFilteredResult(_0xecc8fa,_0x38d6d0))[_0xfba4('0x26')](handleError(_0xecc8fa,null));};exports['show']=function(_0x2aff37,_0x25b45b){var _0x3d87bc={'raw':![],'where':{'id':_0x2aff37[_0xfba4('0x27')]['id']}},_0x4cb158={};_0x4cb158[_0xfba4('0x28')]=_[_0xfba4('0x29')](db['SmsInteraction'][_0xfba4('0x1d')]);_0x4cb158[_0xfba4('0x24')]=_['keys'](_0x2aff37[_0xfba4('0x24')]);_0x4cb158['filters']=_[_0xfba4('0x2a')](_0x4cb158['model'],_0x4cb158['query']);_0x3d87bc[_0xfba4('0x2b')]=_[_0xfba4('0x2a')](_0x4cb158['model'],qs[_0xfba4('0x2c')](_0x2aff37[_0xfba4('0x24')][_0xfba4('0x2c')]));_0x3d87bc['attributes']=_0x3d87bc[_0xfba4('0x2b')][_0xfba4('0x2d')]?_0x3d87bc[_0xfba4('0x2b')]:_0x4cb158['model'];if(_0x2aff37[_0xfba4('0x24')][_0xfba4('0x2e')]){_0x3d87bc[_0xfba4('0x2f')]=[{'all':!![]}];}_0x3d87bc=_[_0xfba4('0x30')]({},_0x3d87bc,_0x2aff37['options']);return db[_0xfba4('0x31')][_0xfba4('0x32')](_0x3d87bc)[_0xfba4('0x18')](handleEntityNotFound(_0x25b45b,null))['then'](respondWithResult(_0x25b45b,null))['catch'](handleError(_0x25b45b,null));};exports[_0xfba4('0x33')]=function(_0xe2abfb,_0x26d15f){return db['SmsInteraction']['create'](_0xe2abfb[_0xfba4('0x34')],{})[_0xfba4('0x18')](respondWithResult(_0x26d15f,0xc9))['catch'](handleError(_0x26d15f,null));};exports[_0xfba4('0x35')]=function(_0xa6f96e,_0x5ded82){if(_0xa6f96e[_0xfba4('0x34')]['id']){delete _0xa6f96e[_0xfba4('0x34')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0xa6f96e[_0xfba4('0x27')]['id']}})[_0xfba4('0x18')](handleEntityNotFound(_0x5ded82,null))[_0xfba4('0x18')](saveUpdates(_0xa6f96e[_0xfba4('0x34')],null))[_0xfba4('0x18')](respondWithResult(_0x5ded82,null))[_0xfba4('0x26')](handleError(_0x5ded82,null));};exports[_0xfba4('0x19')]=function(_0x399181,_0x46b0f4){return db[_0xfba4('0x31')][_0xfba4('0x32')]({'where':{'id':_0x399181[_0xfba4('0x27')]['id']}})[_0xfba4('0x18')](handleEntityNotFound(_0x46b0f4,null))['then'](removeEntity(_0x46b0f4,null))['catch'](handleError(_0x46b0f4,null));};exports[_0xfba4('0x36')]=function(_0x3190f6,_0xb460f3){return db[_0xfba4('0x31')][_0xfba4('0x36')]()['then'](respondWithResult(_0xb460f3,null))['catch'](handleError(_0xb460f3,null));};exports[_0xfba4('0x37')]=function(_0x260509,_0x209b1a){return db['SmsMessage']['find']({'where':{'id':_0x260509[_0xfba4('0x27')]['id']}})[_0xfba4('0x18')](handleEntityNotFound(_0x209b1a,null))[_0xfba4('0x18')](function(_0xe98168){if(_0xe98168){return _0xe98168[_0xfba4('0x37')](_0x260509[_0xfba4('0x34')][_0xfba4('0x38')],_[_0xfba4('0x39')](_0x260509[_0xfba4('0x34')],[_0xfba4('0x38'),'id'])||{});}})[_0xfba4('0x18')](respondWithResult(_0x209b1a,null))[_0xfba4('0x26')](handleError(_0x209b1a,null));};exports[_0xfba4('0x3a')]=function(_0xb6dd2e,_0x36e69c){var _0x56e505={'raw':![],'where':{}};var _0x114891={};var _0x34f0cc={'count':0x0,'rows':[]};return db[_0xfba4('0x31')][_0xfba4('0x3b')]({'where':{'id':_0xb6dd2e[_0xfba4('0x27')]['id']}})[_0xfba4('0x18')](handleEntityNotFound(_0x36e69c,null))[_0xfba4('0x18')](function(_0x487f93){if(_0x487f93){_0x114891[_0xfba4('0x28')]=_[_0xfba4('0x29')](db[_0xfba4('0x3c')]['rawAttributes']);_0x114891[_0xfba4('0x24')]=_['keys'](_0xb6dd2e[_0xfba4('0x24')]);_0x114891[_0xfba4('0x3d')]=_[_0xfba4('0x2a')](_0x114891[_0xfba4('0x28')],_0x114891['query']);_0x56e505['attributes']=_['intersection'](_0x114891[_0xfba4('0x28')],qs[_0xfba4('0x2c')](_0xb6dd2e[_0xfba4('0x24')][_0xfba4('0x2c')]));_0x56e505[_0xfba4('0x2b')]=_0x56e505[_0xfba4('0x2b')][_0xfba4('0x2d')]?_0x56e505[_0xfba4('0x2b')]:_0x114891[_0xfba4('0x28')];if(!_0xb6dd2e['query'][_0xfba4('0x3e')](_0xfba4('0x3f'))){_0x56e505[_0xfba4('0x15')]=qs[_0xfba4('0x15')](_0xb6dd2e[_0xfba4('0x24')]['limit']);_0x56e505[_0xfba4('0x13')]=qs['offset'](_0xb6dd2e[_0xfba4('0x24')]['offset']);}_0x56e505[_0xfba4('0x40')]=qs[_0xfba4('0x41')](_0xb6dd2e[_0xfba4('0x24')]['sort']);_0x56e505[_0xfba4('0x42')]=qs[_0xfba4('0x3d')](_[_0xfba4('0x43')](_0xb6dd2e['query'],_0x114891[_0xfba4('0x3d')]));_0x56e505[_0xfba4('0x42')]['SmsInteractionId']=_0x487f93['id'];if(_0xb6dd2e[_0xfba4('0x24')][_0xfba4('0x44')]){_0x56e505[_0xfba4('0x42')]=_[_0xfba4('0x30')](_0x56e505[_0xfba4('0x42')],{'$or':_['map'](_0x56e505[_0xfba4('0x2b')],function(_0x503a02){var _0xc76a0f={};_0xc76a0f[_0x503a02]={'$like':'%'+_0xb6dd2e['query']['filter']+'%'};return _0xc76a0f;})});}if(_0xb6dd2e['query'][_0xfba4('0x45')]){var _0x158e4c=_0xb6dd2e[_0xfba4('0x24')][_0xfba4('0x45')][_0xfba4('0x46')](',');var _0x403462={};_0x403462[_0x158e4c[0x0]]={'$gte':moment(_0x158e4c[0x1])[_0xfba4('0x47')](_0xfba4('0x48'))};_0x56e505['where']=_[_0xfba4('0x30')](_0x56e505['where'],_0x403462);}_0x56e505=_[_0xfba4('0x30')]({},_0x56e505,_0xb6dd2e['options']);return db[_0xfba4('0x3c')][_0xfba4('0x16')]({'where':_0x56e505['where']})[_0xfba4('0x18')](function(_0x184586){_0x34f0cc[_0xfba4('0x16')]=_0x184586;if(_0xb6dd2e[_0xfba4('0x24')][_0xfba4('0x2e')]){_0x56e505[_0xfba4('0x2f')]=[{'all':!![]}];}return db[_0xfba4('0x3c')][_0xfba4('0x22')](_0x56e505);})[_0xfba4('0x18')](function(_0x2e7700){_0x34f0cc['rows']=_0x2e7700;return _0x34f0cc;});}})[_0xfba4('0x18')](respondWithFilteredResult(_0x36e69c,_0x56e505))[_0xfba4('0x26')](handleError(_0x36e69c,null));};exports[_0xfba4('0x49')]=function(_0x3e10ca,_0x3342dd){return db[_0xfba4('0x31')][_0xfba4('0x32')]({'where':{'id':_0x3e10ca[_0xfba4('0x27')]['id']}})['then'](handleEntityNotFound(_0x3342dd,null))['then'](function(_0x4474c5){if(_0x4474c5){return _0x4474c5['setTags'](_0x3e10ca[_0xfba4('0x34')][_0xfba4('0x38')],_[_0xfba4('0x39')](_0x3e10ca[_0xfba4('0x34')],[_0xfba4('0x38'),'id'])||{})[_0xfba4('0x4a')](function(){return db[_0xfba4('0x4b')]['findAll']({'attributes':['id',_0xfba4('0x1a'),_0xfba4('0x4c')],'where':{'id':_0x3e10ca['body'][_0xfba4('0x38')]}});})[_0xfba4('0x18')](function(_0x576e17){socket[_0xfba4('0x4d')](_0xfba4('0x4e'),{'id':Number(_0x3e10ca[_0xfba4('0x27')]['id']),'tags':_0x576e17||[]});return{'id':Number(_0x3e10ca[_0xfba4('0x27')]['id']),'tags':_0x576e17||[]};});}})['then'](respondWithResult(_0x3342dd,null))['catch'](handleError(_0x3342dd,null));};exports[_0xfba4('0x4f')]=function(_0x12e077,_0x2aa423){return db[_0xfba4('0x31')][_0xfba4('0x32')]({'where':{'id':_0x12e077[_0xfba4('0x27')]['id']}})[_0xfba4('0x18')](handleEntityNotFound(_0x2aa423,null))[_0xfba4('0x18')](function(_0x5d10d1){if(_0x5d10d1){return _0x5d10d1[_0xfba4('0x4f')](_0x12e077[_0xfba4('0x24')]['ids']);}})[_0xfba4('0x18')](respondWithStatusCode(_0x2aa423,null))[_0xfba4('0x26')](handleError(_0x2aa423,null));};exports[_0xfba4('0x50')]=function(_0x3dac2f,_0xc508ba){var _0x3d5227=moment()[_0xfba4('0x51')]()[_0xfba4('0x52')]();var _0x1ef1ab=path[_0xfba4('0x53')](config[_0xfba4('0x54')],_0xfba4('0x55'),'files',_0xfba4('0x56'));var _0x30e2d6=path[_0xfba4('0x53')](_0x1ef1ab,_0x3d5227);var _0x2ee7c2=util['format'](_0xfba4('0x57'),_0x3dac2f[_0xfba4('0x27')]['id'],_0x3d5227);var _0x33ad36=path[_0xfba4('0x53')](_0x1ef1ab,_0x2ee7c2);var _0x359690=[];_0x359690[_0xfba4('0x58')]({'model':db[_0xfba4('0x59')],'as':_0xfba4('0x59'),'attributes':['id',_0xfba4('0x5a')],'raw':!![]});_0x359690[_0xfba4('0x58')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xfba4('0x5b'),'lastName'],'raw':!![]});var _0xda34ed=[{'model':db[_0xfba4('0x3c')],'as':_0xfba4('0x5c'),'attributes':['id',_0xfba4('0x34'),_0xfba4('0x5d'),'direction',_0xfba4('0x5e'),'read'],'include':_0x359690}];_0xda34ed[_0xfba4('0x58')]({'model':db[_0xfba4('0x5f')],'as':'Account','attributes':['id',_0xfba4('0x1a')]});_0xda34ed['push']({'model':db[_0xfba4('0x59')],'as':'Owner','attributes':['id','fullname']});return db[_0xfba4('0x31')][_0xfba4('0x32')]({'where':{'id':_0x3dac2f['params']['id']},'include':_0xda34ed})[_0xfba4('0x18')](handleEntityNotFound(_0xc508ba,null))[_0xfba4('0x18')](function(_0x2576e2){if(_0x2576e2){var _0x2a971b=_0x2576e2[_0xfba4('0x60')]({'plain':!![]});fs[_0xfba4('0x61')](_0x30e2d6);var _0x140ecb={'channel':'Sms','account':_0x2a971b[_0xfba4('0x62')][_0xfba4('0x1a')],'agent':_0x2a971b[_0xfba4('0x63')]?_0x2a971b['Owner'][_0xfba4('0x5a')]:_0xfba4('0x64'),'createdAt':moment(_0x2a971b[_0xfba4('0x5d')])[_0xfba4('0x47')](_0xfba4('0x48'))[_0xfba4('0x52')](),'closedAt':_0x2a971b[_0xfba4('0x65')]?moment(_0x2a971b[_0xfba4('0x66')])[_0xfba4('0x47')](_0xfba4('0x48'))[_0xfba4('0x52')]():'','disposition':_0x2a971b[_0xfba4('0x67')],'messages':_(_0x2a971b['Messages'])[_0xfba4('0x44')]({'secret':![]})[_0xfba4('0x68')](function(_0x3ca9f6){return{'date':moment(_0x3ca9f6['createdAt'])[_0xfba4('0x47')](_0xfba4('0x48'))[_0xfba4('0x52')](),'sender':_0x3ca9f6[_0xfba4('0x69')]==='out'?_0x3ca9f6['User']?_0x3ca9f6[_0xfba4('0x59')][_0xfba4('0x5a')]:_0xfba4('0x6a'):_0x3ca9f6[_0xfba4('0x6b')][_0xfba4('0x5b')]+(_0x3ca9f6['Contact'][_0xfba4('0x6c')]?'\x20'+_0x3ca9f6[_0xfba4('0x6b')][_0xfba4('0x6c')]:''),'body':_0x3ca9f6[_0xfba4('0x34')],'direction':_0x3ca9f6[_0xfba4('0x69')]===_0xfba4('0x6d')?'A':'C','secret':_0x3ca9f6[_0xfba4('0x5e')],'read':_0x3ca9f6['read']};})['value']()};return ejs[_0xfba4('0x6e')](path[_0xfba4('0x53')](config[_0xfba4('0x54')],'server',_0xfba4('0x6f'),_0xfba4('0x70')),{'interaction':_0x140ecb})[_0xfba4('0x18')](function(_0x28a104){var _0x56e442=path['join'](_0x30e2d6,'transcript-'+_0x2a971b['id']+'-'+_0x3d5227+'.pdf');var _0x5d1c0f={'path':_0x56e442,'channel':_0xfba4('0x71'),'interactionId':_0x2a971b['id']};return pdf[_0xfba4('0x72')](_0x28a104,_0x5d1c0f);})[_0xfba4('0x18')](function(){return new BPromise(function(_0x1da1aa,_0xd18b5c){zipdir(_0x30e2d6,{'saveTo':_0x33ad36},function(_0x1c324d,_0x5874dc){if(_0x1c324d)return _0xd18b5c(_0x1c324d);return _0x1da1aa(_0x5874dc);});})[_0xfba4('0x18')](function(){return new BPromise(function(_0x15962b,_0x41d034){rimraf(_0x30e2d6,function(_0x50ddb1){if(_0x50ddb1)_0x41d034(_0x50ddb1);return _0x15962b();});});})[_0xfba4('0x18')](function(){return _0xc508ba[_0xfba4('0x50')](_0x33ad36,_0x2ee7c2,function(_0x2444a0){if(_0x2444a0){console[_0xfba4('0x73')]('err',_0x2444a0);}else{fs[_0xfba4('0x74')](_0x33ad36);}});});});}else{return _0xc508ba[_0xfba4('0xf')](0xc8);}})['catch'](handleError(_0xc508ba,null));}; \ No newline at end of file +var _0x389a=['addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','pick','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','findAll','removeTags','download','unix','toString','server','join','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','Messages','createdAt','direction','secret','read','SmsAccount','Account','mkdirSync','Owner','N.A.','closed','closedAt','disposition','out','System','lastName','value','renderFile','root','views','downloadInteraction.ejs','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','end','error','name','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','query','user','catch','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x389a,0xb2));var _0xa389=function(_0x59b738,_0x34e9e3){_0x59b738=_0x59b738-0x0;var _0x58567d=_0x389a[_0x59b738];return _0x58567d;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0xa389('0x0'));var BPromise=require(_0xa389('0x1'));var util=require(_0xa389('0x2'));var path=require('path');var ejs=require(_0xa389('0x3'));var fs=require('fs');var _=require(_0xa389('0x4'));var Redis=require(_0xa389('0x5'));var interaction=require(_0xa389('0x6'));var qs=require(_0xa389('0x7'));var pdf=require(_0xa389('0x8'));var logger=require(_0xa389('0x9'))('api');var config=require(_0xa389('0xa'));var db=require(_0xa389('0xb'))['db'];config[_0xa389('0xc')]=_['defaults'](config[_0xa389('0xc')],{'host':_0xa389('0xd'),'port':0x18eb});var socket=require(_0xa389('0xe'))(new Redis(config['redis']));require(_0xa389('0xf'))['register'](socket);function respondWithStatusCode(_0x2d84af,_0x46ed9a){_0x46ed9a=_0x46ed9a||0xcc;return function(_0xfe795d){if(_0xfe795d){return _0x2d84af[_0xa389('0x10')](_0x46ed9a);}return _0x2d84af['status'](_0x46ed9a)['end']();};}function respondWithResult(_0x12d4f8,_0x5b273a){_0x5b273a=_0x5b273a||0xc8;return function(_0x255d4b){if(_0x255d4b){return _0x12d4f8[_0xa389('0x11')](_0x5b273a)[_0xa389('0x12')](_0x255d4b);}};}function respondWithFilteredResult(_0x20500b,_0x4648a5){return function(_0x14a672){if(_0x14a672){var _0x36a6a5=typeof _0x4648a5['offset']===_0xa389('0x13')&&typeof _0x4648a5['limit']===_0xa389('0x13');var _0xd59fc5=_0x14a672[_0xa389('0x14')];var _0x42932a=_0x36a6a5?0x0:_0x4648a5[_0xa389('0x15')];var _0x1f24da=_0x36a6a5?_0x14a672[_0xa389('0x14')]:_0x4648a5[_0xa389('0x15')]+_0x4648a5[_0xa389('0x16')];var _0x5ee8a5;if(_0x1f24da>=_0xd59fc5){_0x1f24da=_0xd59fc5;_0x5ee8a5=0xc8;}else{_0x5ee8a5=0xce;}_0x20500b[_0xa389('0x11')](_0x5ee8a5);return _0x20500b[_0xa389('0x17')](_0xa389('0x18'),_0x42932a+'-'+_0x1f24da+'/'+_0xd59fc5)[_0xa389('0x12')](_0x14a672);}return null;};}function saveUpdates(_0x168f2a){return function(_0x1899c3){if(_0x1899c3){return _0x1899c3[_0xa389('0x19')](_0x168f2a)[_0xa389('0x1a')](function(_0x3998b2){return _0x3998b2;});}return null;};}function removeEntity(_0x5de4d0){return function(_0x1164ee){if(_0x1164ee){return _0x1164ee[_0xa389('0x1b')]()['then'](function(){_0x5de4d0['status'](0xcc)[_0xa389('0x1c')]();});}};}function handleEntityNotFound(_0x3b24a0){return function(_0x4aa68b){if(!_0x4aa68b){_0x3b24a0[_0xa389('0x10')](0x194);}return _0x4aa68b;};}function handleError(_0x497e1,_0x216bf5){_0x216bf5=_0x216bf5||0x1f4;return function(_0x4adf57){logger[_0xa389('0x1d')](_0x4adf57['stack']);if(_0x4adf57['name']){delete _0x4adf57[_0xa389('0x1e')];}_0x497e1[_0xa389('0x11')](_0x216bf5)['send'](_0x4adf57);};}exports[_0xa389('0x1f')]=function(_0x4caeb4,_0x1e517d){var _0x516dda={};var _0x334bb3=_[_0xa389('0x20')](db[_0xa389('0x21')][_0xa389('0x22')],function(_0x3caf4e){return{'name':_0x3caf4e[_0xa389('0x23')],'type':_0x3caf4e[_0xa389('0x24')][_0xa389('0x25')]};});_0x516dda=qs[_0xa389('0x26')](_0x334bb3,_0x4caeb4);return interaction['findAll']('sms',_0x4caeb4[_0xa389('0x27')],_0x4caeb4[_0xa389('0x28')],_0x516dda,_0x334bb3)[_0xa389('0x1a')](respondWithFilteredResult(_0x1e517d,_0x516dda))[_0xa389('0x29')](handleError(_0x1e517d,null));};exports['show']=function(_0x2d544f,_0x16aaf4){var _0x12a64b={'raw':![],'where':{'id':_0x2d544f['params']['id']}},_0x4e711b={};_0x4e711b['model']=_[_0xa389('0x2a')](db['SmsInteraction']['rawAttributes']);_0x4e711b[_0xa389('0x27')]=_[_0xa389('0x2a')](_0x2d544f['query']);_0x4e711b[_0xa389('0x2b')]=_[_0xa389('0x2c')](_0x4e711b[_0xa389('0x2d')],_0x4e711b['query']);_0x12a64b[_0xa389('0x2e')]=_[_0xa389('0x2c')](_0x4e711b['model'],qs[_0xa389('0x2f')](_0x2d544f['query'][_0xa389('0x2f')]));_0x12a64b['attributes']=_0x12a64b[_0xa389('0x2e')][_0xa389('0x30')]?_0x12a64b[_0xa389('0x2e')]:_0x4e711b['model'];if(_0x2d544f[_0xa389('0x27')][_0xa389('0x31')]){_0x12a64b[_0xa389('0x32')]=[{'all':!![]}];}_0x12a64b=_[_0xa389('0x33')]({},_0x12a64b,_0x2d544f[_0xa389('0x34')]);return db['SmsInteraction'][_0xa389('0x35')](_0x12a64b)['then'](handleEntityNotFound(_0x16aaf4,null))[_0xa389('0x1a')](respondWithResult(_0x16aaf4,null))[_0xa389('0x29')](handleError(_0x16aaf4,null));};exports[_0xa389('0x36')]=function(_0x334a5e,_0x288476){return db['SmsInteraction'][_0xa389('0x36')](_0x334a5e[_0xa389('0x37')],{})[_0xa389('0x1a')](respondWithResult(_0x288476,0xc9))[_0xa389('0x29')](handleError(_0x288476,null));};exports['update']=function(_0x5335e9,_0x35a8cc){if(_0x5335e9['body']['id']){delete _0x5335e9[_0xa389('0x37')]['id'];}return db[_0xa389('0x21')][_0xa389('0x35')]({'where':{'id':_0x5335e9[_0xa389('0x38')]['id']}})[_0xa389('0x1a')](handleEntityNotFound(_0x35a8cc,null))[_0xa389('0x1a')](saveUpdates(_0x5335e9[_0xa389('0x37')],null))[_0xa389('0x1a')](respondWithResult(_0x35a8cc,null))[_0xa389('0x29')](handleError(_0x35a8cc,null));};exports[_0xa389('0x1b')]=function(_0x274eda,_0x5ae15b){return db['SmsInteraction'][_0xa389('0x35')]({'where':{'id':_0x274eda['params']['id']}})[_0xa389('0x1a')](handleEntityNotFound(_0x5ae15b,null))[_0xa389('0x1a')](removeEntity(_0x5ae15b,null))[_0xa389('0x29')](handleError(_0x5ae15b,null));};exports[_0xa389('0x39')]=function(_0x2ab355,_0x2241bc){return db[_0xa389('0x21')]['describe']()[_0xa389('0x1a')](respondWithResult(_0x2241bc,null))[_0xa389('0x29')](handleError(_0x2241bc,null));};exports[_0xa389('0x3a')]=function(_0x4eabea,_0x3f7cf4){return db[_0xa389('0x3b')][_0xa389('0x35')]({'where':{'id':_0x4eabea[_0xa389('0x38')]['id']}})[_0xa389('0x1a')](handleEntityNotFound(_0x3f7cf4,null))[_0xa389('0x1a')](function(_0x316466){if(_0x316466){return _0x316466[_0xa389('0x3a')](_0x4eabea['body'][_0xa389('0x3c')],_[_0xa389('0x3d')](_0x4eabea[_0xa389('0x37')],['ids','id'])||{});}})[_0xa389('0x1a')](respondWithResult(_0x3f7cf4,null))[_0xa389('0x29')](handleError(_0x3f7cf4,null));};exports[_0xa389('0x3e')]=function(_0x49f6ed,_0x5cbaf1){var _0x39d03d={'raw':![],'where':{}};var _0x426f02={};var _0x100dab={'count':0x0,'rows':[]};return db[_0xa389('0x21')][_0xa389('0x3f')]({'where':{'id':_0x49f6ed[_0xa389('0x38')]['id']}})['then'](handleEntityNotFound(_0x5cbaf1,null))[_0xa389('0x1a')](function(_0x32b0ce){if(_0x32b0ce){_0x426f02[_0xa389('0x2d')]=_['keys'](db[_0xa389('0x3b')]['rawAttributes']);_0x426f02[_0xa389('0x27')]=_[_0xa389('0x2a')](_0x49f6ed[_0xa389('0x27')]);_0x426f02[_0xa389('0x2b')]=_[_0xa389('0x2c')](_0x426f02[_0xa389('0x2d')],_0x426f02['query']);_0x39d03d[_0xa389('0x2e')]=_[_0xa389('0x2c')](_0x426f02[_0xa389('0x2d')],qs[_0xa389('0x2f')](_0x49f6ed[_0xa389('0x27')][_0xa389('0x2f')]));_0x39d03d['attributes']=_0x39d03d[_0xa389('0x2e')][_0xa389('0x30')]?_0x39d03d[_0xa389('0x2e')]:_0x426f02[_0xa389('0x2d')];if(!_0x49f6ed['query'][_0xa389('0x40')]('nolimit')){_0x39d03d[_0xa389('0x16')]=qs[_0xa389('0x16')](_0x49f6ed['query'][_0xa389('0x16')]);_0x39d03d['offset']=qs['offset'](_0x49f6ed[_0xa389('0x27')][_0xa389('0x15')]);}_0x39d03d[_0xa389('0x41')]=qs[_0xa389('0x42')](_0x49f6ed['query'][_0xa389('0x42')]);_0x39d03d['where']=qs['filters'](_[_0xa389('0x43')](_0x49f6ed[_0xa389('0x27')],_0x426f02[_0xa389('0x2b')]));_0x39d03d[_0xa389('0x44')]['SmsInteractionId']=_0x32b0ce['id'];if(_0x49f6ed[_0xa389('0x27')][_0xa389('0x45')]){_0x39d03d[_0xa389('0x44')]=_['merge'](_0x39d03d[_0xa389('0x44')],{'$or':_[_0xa389('0x20')](_0x39d03d[_0xa389('0x2e')],function(_0x499091){var _0x4ca8de={};_0x4ca8de[_0x499091]={'$like':'%'+_0x49f6ed[_0xa389('0x27')][_0xa389('0x45')]+'%'};return _0x4ca8de;})});}if(_0x49f6ed[_0xa389('0x27')][_0xa389('0x46')]){var _0x207d26=_0x49f6ed['query'][_0xa389('0x46')][_0xa389('0x47')](',');var _0x2e85ab={};_0x2e85ab[_0x207d26[0x0]]={'$gte':moment(_0x207d26[0x1])[_0xa389('0x48')](_0xa389('0x49'))};_0x39d03d[_0xa389('0x44')]=_[_0xa389('0x33')](_0x39d03d['where'],_0x2e85ab);}_0x39d03d=_['merge']({},_0x39d03d,_0x49f6ed[_0xa389('0x34')]);return db[_0xa389('0x3b')][_0xa389('0x14')]({'where':_0x39d03d[_0xa389('0x44')]})['then'](function(_0x40111b){_0x100dab[_0xa389('0x14')]=_0x40111b;if(_0x49f6ed[_0xa389('0x27')][_0xa389('0x31')]){_0x39d03d['include']=[{'all':!![]}];}return db[_0xa389('0x3b')]['findAll'](_0x39d03d);})['then'](function(_0x15b9a1){_0x100dab[_0xa389('0x4a')]=_0x15b9a1;return _0x100dab;});}})[_0xa389('0x1a')](respondWithFilteredResult(_0x5cbaf1,_0x39d03d))['catch'](handleError(_0x5cbaf1,null));};exports[_0xa389('0x4b')]=function(_0x1c7a62,_0x75dbca){return db['SmsInteraction']['find']({'where':{'id':_0x1c7a62['params']['id']}})[_0xa389('0x1a')](handleEntityNotFound(_0x75dbca,null))[_0xa389('0x1a')](function(_0x1f3d63){if(_0x1f3d63){return _0x1f3d63[_0xa389('0x4c')](_0x1c7a62[_0xa389('0x37')]['ids'],_[_0xa389('0x3d')](_0x1c7a62[_0xa389('0x37')],[_0xa389('0x3c'),'id'])||{})[_0xa389('0x4d')](function(){return db['Tag'][_0xa389('0x4e')]({'attributes':['id','name','color'],'where':{'id':_0x1c7a62[_0xa389('0x37')][_0xa389('0x3c')]}});})['then'](function(_0x4b8231){socket['emit']('smsInteractionTags:save',{'id':Number(_0x1c7a62[_0xa389('0x38')]['id']),'tags':_0x4b8231||[]});return{'id':Number(_0x1c7a62[_0xa389('0x38')]['id']),'tags':_0x4b8231||[]};});}})[_0xa389('0x1a')](respondWithResult(_0x75dbca,null))[_0xa389('0x29')](handleError(_0x75dbca,null));};exports[_0xa389('0x4f')]=function(_0x55b0aa,_0x505eb8){return db[_0xa389('0x21')][_0xa389('0x35')]({'where':{'id':_0x55b0aa[_0xa389('0x38')]['id']}})[_0xa389('0x1a')](handleEntityNotFound(_0x505eb8,null))[_0xa389('0x1a')](function(_0x4de179){if(_0x4de179){return _0x4de179[_0xa389('0x4f')](_0x55b0aa['query'][_0xa389('0x3c')]);}})[_0xa389('0x1a')](respondWithStatusCode(_0x505eb8,null))[_0xa389('0x29')](handleError(_0x505eb8,null));};exports[_0xa389('0x50')]=function(_0x1b47b5,_0x23d0d5){var _0x50b2e9=moment()[_0xa389('0x51')]()[_0xa389('0x52')]();var _0x2bbc3d=path['join'](config['root'],_0xa389('0x53'),'files','tmp');var _0x368a76=path[_0xa389('0x54')](_0x2bbc3d,_0x50b2e9);var _0x5b4382=util['format'](_0xa389('0x55'),_0x1b47b5[_0xa389('0x38')]['id'],_0x50b2e9);var _0x57b8c3=path['join'](_0x2bbc3d,_0x5b4382);var _0x54b749=[];_0x54b749[_0xa389('0x56')]({'model':db[_0xa389('0x57')],'as':_0xa389('0x57'),'attributes':['id',_0xa389('0x58')],'raw':!![]});_0x54b749[_0xa389('0x56')]({'model':db['CmContact'],'as':_0xa389('0x59'),'attributes':['id',_0xa389('0x5a'),'lastName'],'raw':!![]});var _0x263ff9=[{'model':db['SmsMessage'],'as':_0xa389('0x5b'),'attributes':['id',_0xa389('0x37'),_0xa389('0x5c'),_0xa389('0x5d'),_0xa389('0x5e'),_0xa389('0x5f')],'include':_0x54b749}];_0x263ff9[_0xa389('0x56')]({'model':db[_0xa389('0x60')],'as':_0xa389('0x61'),'attributes':['id',_0xa389('0x1e')]});_0x263ff9[_0xa389('0x56')]({'model':db[_0xa389('0x57')],'as':'Owner','attributes':['id','fullname']});return db['SmsInteraction'][_0xa389('0x35')]({'where':{'id':_0x1b47b5['params']['id']},'include':_0x263ff9})[_0xa389('0x1a')](handleEntityNotFound(_0x23d0d5,null))[_0xa389('0x1a')](function(_0x4785b0){if(_0x4785b0){var _0x3bad77=_0x4785b0['get']({'plain':!![]});fs[_0xa389('0x62')](_0x368a76);var _0x3ff344={'channel':'Sms','account':_0x3bad77[_0xa389('0x61')][_0xa389('0x1e')],'agent':_0x3bad77[_0xa389('0x63')]?_0x3bad77[_0xa389('0x63')][_0xa389('0x58')]:_0xa389('0x64'),'createdAt':moment(_0x3bad77[_0xa389('0x5c')])[_0xa389('0x48')](_0xa389('0x49'))[_0xa389('0x52')](),'closedAt':_0x3bad77[_0xa389('0x65')]?moment(_0x3bad77[_0xa389('0x66')])[_0xa389('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa389('0x52')]():'','disposition':_0x3bad77[_0xa389('0x67')],'messages':_(_0x3bad77[_0xa389('0x5b')])[_0xa389('0x45')]({'secret':![]})[_0xa389('0x20')](function(_0x498040){return{'date':moment(_0x498040[_0xa389('0x5c')])[_0xa389('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa389('0x52')](),'sender':_0x498040[_0xa389('0x5d')]===_0xa389('0x68')?_0x498040[_0xa389('0x57')]?_0x498040[_0xa389('0x57')][_0xa389('0x58')]:_0xa389('0x69'):_0x498040[_0xa389('0x59')][_0xa389('0x5a')]+(_0x498040[_0xa389('0x59')][_0xa389('0x6a')]?'\x20'+_0x498040['Contact']['lastName']:''),'body':_0x498040[_0xa389('0x37')],'direction':_0x498040[_0xa389('0x5d')]===_0xa389('0x68')?'A':'C','secret':_0x498040[_0xa389('0x5e')],'read':_0x498040[_0xa389('0x5f')]};})[_0xa389('0x6b')]()};return ejs[_0xa389('0x6c')](path['join'](config[_0xa389('0x6d')],_0xa389('0x53'),_0xa389('0x6e'),_0xa389('0x6f')),{'interaction':_0x3ff344})['then'](function(_0xce3888){var _0x37f361=path[_0xa389('0x54')](_0x368a76,'transcript-'+_0x3bad77['id']+'-'+_0x50b2e9+_0xa389('0x70'));var _0x9e5db6={'path':_0x37f361,'channel':_0xa389('0x71'),'interactionId':_0x3bad77['id']};return pdf[_0xa389('0x72')](_0xce3888,_0x9e5db6);})[_0xa389('0x1a')](function(){return new BPromise(function(_0x282b94,_0x1fba30){zipdir(_0x368a76,{'saveTo':_0x57b8c3},function(_0x5349fc,_0x34681c){if(_0x5349fc)return _0x1fba30(_0x5349fc);return _0x282b94(_0x34681c);});})[_0xa389('0x1a')](function(){return new BPromise(function(_0x266a3b,_0x3eedca){rimraf(_0x368a76,function(_0x3bb524){if(_0x3bb524)_0x3eedca(_0x3bb524);return _0x266a3b();});});})[_0xa389('0x1a')](function(){return _0x23d0d5[_0xa389('0x50')](_0x57b8c3,_0x5b4382,function(_0xa9aa4){if(_0xa9aa4){console[_0xa389('0x73')](_0xa389('0x74'),_0xa9aa4);}else{fs[_0xa389('0x75')](_0x57b8c3);}});});});}else{return _0x23d0d5[_0xa389('0x10')](0xc8);}})[_0xa389('0x29')](handleError(_0x23d0d5,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 1a14b23..318477c 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 _0x32b6=['exports','events','../../mysqldb','SmsMessage','update','remove','getUsers','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook'];(function(_0x4ef32f,_0x53ceef){var _0xfe32bc=function(_0x577116){while(--_0x577116){_0x4ef32f['push'](_0x4ef32f['shift']());}};_0xfe32bc(++_0x53ceef);}(_0x32b6,0x1d1));var _0x632b=function(_0x54fff5,_0x5c8d98){_0x54fff5=_0x54fff5-0x0;var _0x571cdf=_0x32b6[_0x54fff5];return _0x571cdf;};'use strict';var EventEmitter=require(_0x632b('0x0'));var SmsInteraction=require(_0x632b('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x632b('0x1'))['db'][_0x632b('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x632b('0x3'),'afterDestroy':_0x632b('0x4')};function emitEvent(_0x3ba3a7){return function(_0x3a0e0e,_0x1adfe6,_0x122768){_0x3a0e0e[_0x632b('0x5')]({'attributes':['id'],'raw':!![]})[_0x632b('0x6')](function(_0x3bbf43){_0x3a0e0e[_0x632b('0x7')]('Users',_0x3bbf43[_0x632b('0x8')](function(_0x173270){return{'id':_0x173270['id']};}));return SmsMessage[_0x632b('0x9')]({'where':{'SmsInteractionId':_0x3a0e0e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x632b('0x6')](function(_0x4961b1){_0x3a0e0e['setDataValue']('unreadMessages',_0x4961b1[_0x632b('0xa')]);SmsInteractionEvents['emit'](_0x3ba3a7+':'+_0x3a0e0e['id'],_0x3a0e0e);SmsInteractionEvents[_0x632b('0xb')](_0x3ba3a7,_0x3a0e0e);_0x122768(null);})[_0x632b('0xc')](_0x122768(null));};}for(var e in events){if(events[_0x632b('0xd')](e)){var event=events[e];SmsInteraction[_0x632b('0xe')](e,emitEvent(event));}}module[_0x632b('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0xf4f4=['findAll','unreadMessages','length','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x3a6fc3,_0x1564d0){_0x3a6fc3=_0x3a6fc3-0x0;var _0x4bf3dc=_0xf4f4[_0x3a6fc3];return _0x4bf3dc;};'use strict';var EventEmitter=require(_0x4f4f('0x0'));var SmsInteraction=require(_0x4f4f('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4f4f('0x1'))['db'][_0x4f4f('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4f4f('0x3')](0x0);var events={'afterCreate':_0x4f4f('0x4'),'afterUpdate':_0x4f4f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5a752b){return function(_0x593952,_0x3f274d,_0x132d5c){_0x593952[_0x4f4f('0x6')]({'attributes':['id'],'raw':!![]})[_0x4f4f('0x7')](function(_0x3c4877){_0x593952[_0x4f4f('0x8')](_0x4f4f('0x9'),_0x3c4877[_0x4f4f('0xa')](function(_0x48f6b9){return{'id':_0x48f6b9['id']};}));return SmsMessage[_0x4f4f('0xb')]({'where':{'SmsInteractionId':_0x593952['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4f4f('0x7')](function(_0x39e36b){_0x593952[_0x4f4f('0x8')](_0x4f4f('0xc'),_0x39e36b[_0x4f4f('0xd')]);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b+':'+_0x593952['id'],_0x593952);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b,_0x593952);_0x132d5c(null);})['catch'](_0x132d5c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x4f4f('0xf')](e,emitEvent(event));}}module[_0x4f4f('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 8331117..b654fc0 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 _0x301b=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SmsInteraction','sms_interactions'];(function(_0x38add4,_0x387637){var _0x40eba6=function(_0x1dcddc){while(--_0x1dcddc){_0x38add4['push'](_0x38add4['shift']());}};_0x40eba6(++_0x387637);}(_0x301b,0xae));var _0xb301=function(_0x375138,_0x55a5d5){_0x375138=_0x375138-0x0;var _0x9b59bf=_0x301b[_0x375138];return _0x9b59bf;};'use strict';var _=require(_0xb301('0x0'));var util=require(_0xb301('0x1'));var logger=require(_0xb301('0x2'))(_0xb301('0x3'));var moment=require(_0xb301('0x4'));var BPromise=require(_0xb301('0x5'));var rp=require(_0xb301('0x6'));var fs=require('fs');var path=require(_0xb301('0x7'));var rimraf=require(_0xb301('0x8'));var config=require(_0xb301('0x9'));var attributes=require('./smsInteraction.attributes');module[_0xb301('0xa')]=function(_0x44271d,_0x234440){return _0x44271d['define'](_0xb301('0xb'),attributes,{'tableName':_0xb301('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f0f86,_0x2926c2,_0x5aadcb){if(_0x2f0f86[_0xb301('0xd')](_0xb301('0xe'))){_0x2f0f86[_0xb301('0xf')]=moment()['format'](_0xb301('0x10'));}_0x5aadcb(null,_0x2f0f86);}}});}; \ No newline at end of file +var _0x7201=['sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','define'];(function(_0x4af82a,_0x324b56){var _0x31a7f6=function(_0x4cea72){while(--_0x4cea72){_0x4af82a['push'](_0x4af82a['shift']());}};_0x31a7f6(++_0x324b56);}(_0x7201,0xef));var _0x1720=function(_0x3ff783,_0x5a4968){_0x3ff783=_0x3ff783-0x0;var _0x35613c=_0x7201[_0x3ff783];return _0x35613c;};'use strict';var _=require(_0x1720('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1720('0x1'));var moment=require('moment');var BPromise=require(_0x1720('0x2'));var rp=require(_0x1720('0x3'));var fs=require('fs');var path=require(_0x1720('0x4'));var rimraf=require('rimraf');var config=require(_0x1720('0x5'));var attributes=require(_0x1720('0x6'));module['exports']=function(_0x55ab2f,_0x5d82ad){return _0x55ab2f[_0x1720('0x7')]('SmsInteraction',attributes,{'tableName':_0x1720('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8f51ee,_0x4e1b50,_0x4f7485){if(_0x8f51ee['changed'](_0x1720('0x9'))){_0x8f51ee[_0x1720('0xa')]=moment()[_0x1720('0xb')](_0x1720('0xc'));}_0x4f7485(null,_0x8f51ee);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 574cd99..51fad45 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 _0x1b3c=['options','raw','where','attributes','limit','catch','find','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','UpdateSmsInteraction','SmsInteraction','body'];(function(_0xedc5db,_0x210b81){var _0x319879=function(_0x342d63){while(--_0x342d63){_0xedc5db['push'](_0xedc5db['shift']());}};_0x319879(++_0x210b81);}(_0x1b3c,0x78));var _0xc1b3=function(_0x185104,_0x52a2e4){_0x185104=_0x185104-0x0;var _0xd07500=_0x1b3c[_0x185104];return _0xd07500;};'use strict';var _=require(_0xc1b3('0x0'));var util=require(_0xc1b3('0x1'));var moment=require(_0xc1b3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1b3('0x3'));var db=require(_0xc1b3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1b3('0x5'))(_0xc1b3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc1b3('0x7')]['http']({'port':0x232a});config[_0xc1b3('0x8')]=_[_0xc1b3('0x9')](config[_0xc1b3('0x8')],{'host':_0xc1b3('0xa'),'port':0x18eb});var socket=require(_0xc1b3('0xb'))(new Redis(config[_0xc1b3('0x8')]));require(_0xc1b3('0xc'))[_0xc1b3('0xd')](socket);function respondWithRpcPromise(_0x12c88f,_0x159deb,_0x28ff83){return new BPromise(function(_0x527582,_0x288db3){return client[_0xc1b3('0xe')](_0x12c88f,_0x28ff83)[_0xc1b3('0xf')](function(_0x108e94){logger[_0xc1b3('0x10')](_0xc1b3('0x11'),_0x159deb,'request\x20sent');logger[_0xc1b3('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x159deb,_0xc1b3('0x13'),JSON[_0xc1b3('0x14')](_0x108e94));if(_0x108e94[_0xc1b3('0x15')]){if(_0x108e94['error'][_0xc1b3('0x16')]===0x1f4){logger[_0xc1b3('0x15')](_0xc1b3('0x11'),_0x159deb,_0x108e94['error'][_0xc1b3('0x17')]);return _0x288db3(_0x108e94['error'][_0xc1b3('0x17')]);}logger[_0xc1b3('0x15')](_0xc1b3('0x11'),_0x159deb,_0x108e94['error']['message']);return _0x527582(_0x108e94[_0xc1b3('0x15')]['message']);}else{logger[_0xc1b3('0x10')](_0xc1b3('0x11'),_0x159deb,'request\x20sent');_0x527582(_0x108e94[_0xc1b3('0x18')][_0xc1b3('0x17')]);}})['catch'](function(_0x4a79cf){logger[_0xc1b3('0x15')](_0xc1b3('0x11'),_0x159deb,_0x4a79cf);_0x288db3(_0x4a79cf);});});}exports[_0xc1b3('0x19')]=function(_0x13f473){var _0x4424b5=this;return new Promise(function(_0x402feb,_0x4d10c0){return db[_0xc1b3('0x1a')]['update'](_0x13f473[_0xc1b3('0x1b')],{'raw':_0x13f473[_0xc1b3('0x1c')]?_0x13f473['options'][_0xc1b3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13f473['options']?_0x13f473[_0xc1b3('0x1c')][_0xc1b3('0x1e')]||null:null,'attributes':_0x13f473['options']?_0x13f473[_0xc1b3('0x1c')][_0xc1b3('0x1f')]||null:null,'limit':_0x13f473['options']?_0x13f473['options'][_0xc1b3('0x20')]||null:null})[_0xc1b3('0xf')](function(_0x517459){logger[_0xc1b3('0x10')](_0xc1b3('0x19'),_0x13f473);logger['debug'](_0xc1b3('0x19'),_0x13f473,JSON[_0xc1b3('0x14')](_0x517459));_0x402feb(_0x517459);})[_0xc1b3('0x21')](function(_0x95a830){logger[_0xc1b3('0x15')]('UpdateSmsInteraction',_0x95a830[_0xc1b3('0x17')],_0x13f473);_0x4d10c0(_0x4424b5[_0xc1b3('0x15')](0x1f4,_0x95a830['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x22d108){return new Promise(function(_0x411c89,_0x5b1fce){return db[_0xc1b3('0x1a')][_0xc1b3('0x22')]({'where':_0x22d108[_0xc1b3('0x1c')]?_0x22d108[_0xc1b3('0x1c')][_0xc1b3('0x1e')]||null:null})[_0xc1b3('0xf')](function(_0xb7454){if(_0xb7454){return _0xb7454['addTags'](_0x22d108[_0xc1b3('0x1b')]['ids'],_['omit'](_0x22d108['body'],['ids','id'])||{});}})[_0xc1b3('0x23')](function(_0x2a1c5e){logger['info'](_0xc1b3('0x24'),_0x22d108);logger[_0xc1b3('0x12')](_0xc1b3('0x24'),_0x22d108,JSON[_0xc1b3('0x14')](_0x2a1c5e));_0x411c89(_0x2a1c5e);})[_0xc1b3('0x21')](function(_0x459613){logger[_0xc1b3('0x15')](_0xc1b3('0x24'),_0x459613[_0xc1b3('0x17')],_0x22d108);_0x5b1fce(_this[_0xc1b3('0x15')](0x1f4,_0x459613[_0xc1b3('0x17')]));});});}; \ No newline at end of file +var _0xd609=['UpdateSmsInteraction','debug','catch','AddTagsToSmsInteraction','SmsInteraction','ids','spread','AddTags','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','request\x20sent','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','body','options','where','attributes','limit','then'];(function(_0x1a7185,_0x5091d1){var _0x29cc6b=function(_0x39d3ac){while(--_0x39d3ac){_0x1a7185['push'](_0x1a7185['shift']());}};_0x29cc6b(++_0x5091d1);}(_0xd609,0x184));var _0x9d60=function(_0x3ffcc0,_0x30f9fd){_0x3ffcc0=_0x3ffcc0-0x0;var _0x5e83ba=_0xd609[_0x3ffcc0];return _0x5e83ba;};'use strict';var _=require(_0x9d60('0x0'));var util=require(_0x9d60('0x1'));var moment=require('moment');var BPromise=require(_0x9d60('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d60('0x3'))['db'];var utils=require(_0x9d60('0x4'));var logger=require(_0x9d60('0x5'))(_0x9d60('0x6'));var config=require(_0x9d60('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d60('0x8')][_0x9d60('0x9')]({'port':0x232a});config[_0x9d60('0xa')]=_[_0x9d60('0xb')](config[_0x9d60('0xa')],{'host':_0x9d60('0xc'),'port':0x18eb});var socket=require(_0x9d60('0xd'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x9d60('0xe')](socket);function respondWithRpcPromise(_0x2aac3b,_0xec5816,_0x4b57af){return new BPromise(function(_0x4b16a1,_0x2de4ea){return client[_0x9d60('0xf')](_0x2aac3b,_0x4b57af)['then'](function(_0x518cc9){logger['info']('SmsInteraction,\x20%s,\x20%s',_0xec5816,_0x9d60('0x10'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0xec5816,'request\x20sent',JSON[_0x9d60('0x11')](_0x518cc9));if(_0x518cc9[_0x9d60('0x12')]){if(_0x518cc9[_0x9d60('0x12')][_0x9d60('0x13')]===0x1f4){logger['error'](_0x9d60('0x14'),_0xec5816,_0x518cc9['error'][_0x9d60('0x15')]);return _0x2de4ea(_0x518cc9[_0x9d60('0x12')][_0x9d60('0x15')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0xec5816,_0x518cc9[_0x9d60('0x12')][_0x9d60('0x15')]);return _0x4b16a1(_0x518cc9['error'][_0x9d60('0x15')]);}else{logger[_0x9d60('0x16')](_0x9d60('0x14'),_0xec5816,_0x9d60('0x10'));_0x4b16a1(_0x518cc9[_0x9d60('0x17')]['message']);}})['catch'](function(_0x39dd03){logger[_0x9d60('0x12')](_0x9d60('0x14'),_0xec5816,_0x39dd03);_0x2de4ea(_0x39dd03);});});}exports['UpdateSmsInteraction']=function(_0x144062){var _0x49fd85=this;return new Promise(function(_0x2aba21,_0x5ef96b){return db['SmsInteraction']['update'](_0x144062[_0x9d60('0x18')],{'raw':_0x144062['options']?_0x144062[_0x9d60('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x144062[_0x9d60('0x19')]?_0x144062['options'][_0x9d60('0x1a')]||null:null,'attributes':_0x144062['options']?_0x144062[_0x9d60('0x19')][_0x9d60('0x1b')]||null:null,'limit':_0x144062[_0x9d60('0x19')]?_0x144062[_0x9d60('0x19')][_0x9d60('0x1c')]||null:null})[_0x9d60('0x1d')](function(_0xcfe926){logger['info'](_0x9d60('0x1e'),_0x144062);logger[_0x9d60('0x1f')](_0x9d60('0x1e'),_0x144062,JSON['stringify'](_0xcfe926));_0x2aba21(_0xcfe926);})[_0x9d60('0x20')](function(_0x3b449a){logger[_0x9d60('0x12')](_0x9d60('0x1e'),_0x3b449a[_0x9d60('0x15')],_0x144062);_0x5ef96b(_0x49fd85[_0x9d60('0x12')](0x1f4,_0x3b449a[_0x9d60('0x15')]));});});};exports[_0x9d60('0x21')]=function(_0x34d38d){return new Promise(function(_0x37c3f9,_0x1d2e76){return db[_0x9d60('0x22')]['find']({'where':_0x34d38d['options']?_0x34d38d[_0x9d60('0x19')][_0x9d60('0x1a')]||null:null})[_0x9d60('0x1d')](function(_0x2cbdf1){if(_0x2cbdf1){return _0x2cbdf1['addTags'](_0x34d38d[_0x9d60('0x18')][_0x9d60('0x23')],_['omit'](_0x34d38d[_0x9d60('0x18')],[_0x9d60('0x23'),'id'])||{});}})[_0x9d60('0x24')](function(_0x913feb){logger[_0x9d60('0x16')](_0x9d60('0x25'),_0x34d38d);logger[_0x9d60('0x1f')](_0x9d60('0x25'),_0x34d38d,JSON[_0x9d60('0x11')](_0x913feb));_0x37c3f9(_0x913feb);})['catch'](function(_0x265969){logger[_0x9d60('0x12')](_0x9d60('0x25'),_0x265969[_0x9d60('0x15')],_0x34d38d);_0x1d2e76(_this[_0x9d60('0x12')](0x1f4,_0x265969[_0x9d60('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 3df64d7..ef86d49 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 _0xb02f=['./smsInteraction.events','save','remove','update','emit','register'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb02f,0x180));var _0xfb02=function(_0x341236,_0x5ba95f){_0x341236=_0x341236-0x0;var _0x2de581=_0xb02f[_0x341236];return _0x2de581;};'use strict';var SmsInteractionEvents=require(_0xfb02('0x0'));var events=[_0xfb02('0x1'),_0xfb02('0x2'),_0xfb02('0x3')];function createListener(_0x1f1a83,_0x3c19e1){return function(_0x5adc62){_0x3c19e1[_0xfb02('0x4')](_0x1f1a83,_0x5adc62);};}function removeListener(_0x154750,_0x276ec5){return function(){SmsInteractionEvents['removeListener'](_0x154750,_0x276ec5);};}exports[_0xfb02('0x5')]=function(_0x576a7a){for(var _0x23b884=0x0,_0x41e6f6=events['length'];_0x23b884<_0x41e6f6;_0x23b884++){var _0x3c21f1=events[_0x23b884];var _0x431d=createListener('smsInteraction:'+_0x3c21f1,_0x576a7a);SmsInteractionEvents['on'](_0x3c21f1,_0x431d);}}; \ No newline at end of file +var _0x84a7=['smsInteraction:','./smsInteraction.events','save','remove','update','removeListener','register','length'];(function(_0x26f827,_0x2da0dd){var _0x2f8405=function(_0x54d5f4){while(--_0x54d5f4){_0x26f827['push'](_0x26f827['shift']());}};_0x2f8405(++_0x2da0dd);}(_0x84a7,0x91));var _0x784a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x84a7[_0x321bb2];return _0x9c12ed;};'use strict';var SmsInteractionEvents=require(_0x784a('0x0'));var events=[_0x784a('0x1'),_0x784a('0x2'),_0x784a('0x3')];function createListener(_0x382941,_0x10abe4){return function(_0x42853b){_0x10abe4['emit'](_0x382941,_0x42853b);};}function removeListener(_0x4975f2,_0x66bb04){return function(){SmsInteractionEvents[_0x784a('0x4')](_0x4975f2,_0x66bb04);};}exports[_0x784a('0x5')]=function(_0x2a3f0c){for(var _0x546c60=0x0,_0x5afa19=events[_0x784a('0x6')];_0x546c60<_0x5afa19;_0x546c60++){var _0x449ca4=events[_0x546c60];var _0xe74b54=createListener(_0x784a('0x7')+_0x449ca4,_0x2a3f0c);SmsInteractionEvents['on'](_0x449ca4,_0xe74b54);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index cc839ce..36a36f6 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 _0x4f6f=['put','/:id','/:id/accept','accept','reject','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','describe','isAuthenticated','show','post','tracked','smsmessage:create','/:id/status','status'];(function(_0x3f8814,_0x54a6a9){var _0x41d095=function(_0x54b809){while(--_0x54b809){_0x3f8814['push'](_0x3f8814['shift']());}};_0x41d095(++_0x54a6a9);}(_0x4f6f,0x17e));var _0xf4f6=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x4f6f[_0xef4cf0];return _0x497ad2;};'use strict';var multer=require(_0xf4f6('0x0'));var util=require(_0xf4f6('0x1'));var path=require(_0xf4f6('0x2'));var timeout=require(_0xf4f6('0x3'));var express=require(_0xf4f6('0x4'));var router=express[_0xf4f6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf4f6('0x6'));var interaction=require(_0xf4f6('0x7'));var config=require('../../config/environment');var controller=require(_0xf4f6('0x8'));router[_0xf4f6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf4f6('0xa')]);router[_0xf4f6('0x9')]('/:id',auth[_0xf4f6('0xb')](),controller[_0xf4f6('0xc')]);router[_0xf4f6('0xd')]('/',auth[_0xf4f6('0xb')](),interaction[_0xf4f6('0xe')]('sms',_0xf4f6('0xf')),controller['create']);router['post'](_0xf4f6('0x10'),controller[_0xf4f6('0x11')]);router[_0xf4f6('0x12')](_0xf4f6('0x13'),auth['isAuthenticated'](),controller['update']);router['put'](_0xf4f6('0x14'),auth[_0xf4f6('0xb')](),controller[_0xf4f6('0x15')]);router[_0xf4f6('0x12')]('/:id/reject',auth[_0xf4f6('0xb')](),controller[_0xf4f6('0x16')]);router[_0xf4f6('0x17')](_0xf4f6('0x13'),auth[_0xf4f6('0xb')](),controller['destroy']);module[_0xf4f6('0x18')]=router; \ No newline at end of file +var _0x0b70=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','show','tracked','smsmessage:create','create','/:id/status','status','/:id','update','/:id/accept','put','delete','destroy','exports','multer','util','path'];(function(_0x5df5e1,_0x3e0305){var _0x2fffd3=function(_0x532a7c){while(--_0x532a7c){_0x5df5e1['push'](_0x5df5e1['shift']());}};_0x2fffd3(++_0x3e0305);}(_0x0b70,0x192));var _0x00b7=function(_0x7b3fa8,_0x4fe314){_0x7b3fa8=_0x7b3fa8-0x0;var _0x227ec7=_0x0b70[_0x7b3fa8];return _0x227ec7;};'use strict';var multer=require(_0x00b7('0x0'));var util=require(_0x00b7('0x1'));var path=require(_0x00b7('0x2'));var timeout=require(_0x00b7('0x3'));var express=require(_0x00b7('0x4'));var router=express['Router']();var fs_extra=require(_0x00b7('0x5'));var auth=require(_0x00b7('0x6'));var interaction=require(_0x00b7('0x7'));var config=require(_0x00b7('0x8'));var controller=require(_0x00b7('0x9'));router[_0x00b7('0xa')]('/',auth[_0x00b7('0xb')](),controller[_0x00b7('0xc')]);router[_0x00b7('0xa')]('/describe',auth[_0x00b7('0xb')](),controller[_0x00b7('0xd')]);router[_0x00b7('0xa')]('/:id',auth[_0x00b7('0xb')](),controller[_0x00b7('0xe')]);router['post']('/',auth[_0x00b7('0xb')](),interaction[_0x00b7('0xf')]('sms',_0x00b7('0x10')),controller[_0x00b7('0x11')]);router['post'](_0x00b7('0x12'),controller[_0x00b7('0x13')]);router['put'](_0x00b7('0x14'),auth['isAuthenticated'](),controller[_0x00b7('0x15')]);router['put'](_0x00b7('0x16'),auth[_0x00b7('0xb')](),controller['accept']);router[_0x00b7('0x17')]('/:id/reject',auth[_0x00b7('0xb')](),controller['reject']);router[_0x00b7('0x18')](_0x00b7('0x14'),auth[_0x00b7('0xb')](),controller[_0x00b7('0x19')]);module[_0x00b7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 0927359..a80341f 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 _0x9a0b=['STRING','DATE','BOOLEAN','TEXT','medium','ENUM','out'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x9a0b,0xff));var _0xb9a0=function(_0x4826c3,_0x4eb013){_0x4826c3=_0x4826c3-0x0;var _0x542e60=_0x9a0b[_0x4826c3];return _0x542e60;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xb9a0('0x0')](_0xb9a0('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb9a0('0x2')]('in',_0xb9a0('0x3')),'defaultValue':_0xb9a0('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb9a0('0x4')](0xbe)},'phone':{'type':Sequelize[_0xb9a0('0x4')]},'readAt':{'type':Sequelize[_0xb9a0('0x5')]},'secret':{'type':Sequelize[_0xb9a0('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb9a0('0x4')]},'providerResponse':{'type':Sequelize[_0xb9a0('0x0')]}}; \ No newline at end of file +var _0x1a8f=['sequelize','exports','medium','ENUM','out','STRING','DATE','TEXT'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1a8f,0x88));var _0xf1a8=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0x1a8f[_0x509273];return _0x38ef40;};'use strict';var Sequelize=require(_0xf1a8('0x0'));module[_0xf1a8('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf1a8('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf1a8('0x3')]('in',_0xf1a8('0x4')),'defaultValue':_0xf1a8('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xf1a8('0x5')]},'readAt':{'type':Sequelize[_0xf1a8('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf1a8('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 078cf16..99c8b04 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 _0x4b20=['fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','count','offset','limit','reject','save','destroy','stack','name','send','index','SmsMessage','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','length','find','create','update','body','describe','sms-interactions','accept','sms','read','readAt','format','UserId','user','agent','params','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','User','email','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','messageId','sent','Status','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x4b20,0x116));var _0x04b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b20[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x04b2('0x0'));var rimraf=require(_0x04b2('0x1'));var zipdir=require(_0x04b2('0x2'));var jsonpatch=require(_0x04b2('0x3'));var rp=require(_0x04b2('0x4'));var moment=require(_0x04b2('0x5'));var BPromise=require(_0x04b2('0x6'));var Mustache=require(_0x04b2('0x7'));var util=require(_0x04b2('0x8'));var path=require(_0x04b2('0x9'));var sox=require(_0x04b2('0xa'));var csv=require('to-csv');var ejs=require(_0x04b2('0xb'));var fs=require('fs');var fs_extra=require(_0x04b2('0xc'));var _=require('lodash');var squel=require(_0x04b2('0xd'));var crypto=require(_0x04b2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x04b2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x04b2('0x10'));var Papa=require('papaparse');var Redis=require(_0x04b2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x04b2('0x12'));var as=require(_0x04b2('0x13'));var hardwareService=require(_0x04b2('0x14'));var logger=require(_0x04b2('0x15'))(_0x04b2('0x16'));var utils=require('../../config/utils');var config=require(_0x04b2('0x17'));var licenseUtil=require(_0x04b2('0x18'));var db=require('../../mysqldb')['db'];config[_0x04b2('0x19')]=_['defaults'](config[_0x04b2('0x19')],{'host':_0x04b2('0x1a'),'port':0x18eb});var socket=require(_0x04b2('0x1b'))(new Redis(config[_0x04b2('0x19')]));require('./smsMessage.socket')[_0x04b2('0x1c')](socket);var jayson=require(_0x04b2('0x1d'));var client=jayson['client'][_0x04b2('0x1e')]({'port':0x232c});var client9002=jayson[_0x04b2('0x1f')][_0x04b2('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x49c773,_0xfdda48,_0x218557,_0x43547a){return new BPromise(function(_0x22d007,_0x1bff09){var _0xdcf19c=_0x43547a||client;return _0xdcf19c['request'](_0x49c773,_0x218557)['then'](function(_0x4662d7){logger[_0x04b2('0x20')](_0x04b2('0x21'),_0xfdda48,_0x04b2('0x22'));logger[_0x04b2('0x23')](_0x04b2('0x24'),_0xfdda48,_0x04b2('0x22'),JSON[_0x04b2('0x25')](_0x4662d7));if(_0x4662d7[_0x04b2('0x26')]){if(_0x4662d7[_0x04b2('0x26')][_0x04b2('0x27')]===0x1f4){logger[_0x04b2('0x26')]('SmsMessage,\x20%s,\x20%s',_0xfdda48,_0x4662d7[_0x04b2('0x26')][_0x04b2('0x28')]);return _0x1bff09(_0x4662d7[_0x04b2('0x26')][_0x04b2('0x28')]);}logger[_0x04b2('0x26')](_0x04b2('0x21'),_0xfdda48,_0x4662d7[_0x04b2('0x26')]['message']);return _0x22d007(_0x4662d7[_0x04b2('0x26')]['message']);}else{logger[_0x04b2('0x20')](_0x04b2('0x21'),_0xfdda48,_0x04b2('0x22'));_0x22d007(_0x4662d7['result'][_0x04b2('0x28')]);}})[_0x04b2('0x29')](function(_0x4be996){logger[_0x04b2('0x26')](_0x04b2('0x21'),_0xfdda48,_0x4be996);_0x1bff09(_0x4be996);});});}function respondWithStatusCode(_0x45ff15,_0x28610f){_0x28610f=_0x28610f||0xcc;return function(_0x3693b5){if(_0x3693b5){return _0x45ff15[_0x04b2('0x2a')](_0x28610f);}return _0x45ff15['status'](_0x28610f)[_0x04b2('0x2b')]();};}function respondWithResult(_0x3b84af,_0x1fa60d){_0x1fa60d=_0x1fa60d||0xc8;return function(_0x555320){if(_0x555320){return _0x3b84af[_0x04b2('0x2c')](_0x1fa60d)[_0x04b2('0x2d')](_0x555320);}};}function respondWithFilteredResult(_0x2d51f1,_0xd80ed7){return function(_0x350f74){if(_0x350f74){var _0x1f07c4=typeof _0xd80ed7['offset']==='undefined'&&typeof _0xd80ed7['limit']==='undefined';var _0x250f89=_0x350f74[_0x04b2('0x2e')];var _0x466d32=_0x1f07c4?0x0:_0xd80ed7[_0x04b2('0x2f')];var _0x309170=_0x1f07c4?_0x350f74['count']:_0xd80ed7[_0x04b2('0x2f')]+_0xd80ed7[_0x04b2('0x30')];var _0x383ed1;if(_0x309170>=_0x250f89){_0x309170=_0x250f89;_0x383ed1=0xc8;}else{_0x383ed1=0xce;}_0x2d51f1['status'](_0x383ed1);return _0x2d51f1['set']('Content-Range',_0x466d32+'-'+_0x309170+'/'+_0x250f89)[_0x04b2('0x2d')](_0x350f74);}return null;};}function patchUpdates(_0x3b0bfb){return function(_0x4c78b2){try{jsonpatch['apply'](_0x4c78b2,_0x3b0bfb,!![]);}catch(_0x345069){return BPromise[_0x04b2('0x31')](_0x345069);}return _0x4c78b2[_0x04b2('0x32')]();};}function saveUpdates(_0x14a11b,_0x4f44ac){return function(_0x1630a1){if(_0x1630a1){return _0x1630a1['update'](_0x14a11b)['then'](function(_0x1e55d7){return _0x1e55d7;});}return null;};}function removeEntity(_0x586141,_0x1eb536){return function(_0x35fe1f){if(_0x35fe1f){return _0x35fe1f[_0x04b2('0x33')]()['then'](function(){_0x586141[_0x04b2('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55241e,_0x5dcb85){return function(_0xb05585){if(!_0xb05585){_0x55241e['sendStatus'](0x194);}return _0xb05585;};}function handleError(_0x487bbd,_0x2d3b68){_0x2d3b68=_0x2d3b68||0x1f4;return function(_0x34f9bd){logger['error'](_0x34f9bd[_0x04b2('0x34')]);if(_0x34f9bd[_0x04b2('0x35')]){delete _0x34f9bd['name'];}_0x487bbd[_0x04b2('0x2c')](_0x2d3b68)[_0x04b2('0x36')](_0x34f9bd);};}exports[_0x04b2('0x37')]=function(_0x46beff,_0x1f47ed){var _0x20dc9e={},_0x572ca9={},_0x56e85d={'count':0x0,'rows':[]};var _0x324bf1=_['map'](db[_0x04b2('0x38')]['rawAttributes'],function(_0x5e3a04){return{'name':_0x5e3a04[_0x04b2('0x39')],'type':_0x5e3a04[_0x04b2('0x3a')][_0x04b2('0x3b')]};});_0x572ca9[_0x04b2('0x3c')]=_[_0x04b2('0x3d')](_0x324bf1,_0x04b2('0x35'));_0x572ca9['query']=_[_0x04b2('0x3e')](_0x46beff[_0x04b2('0x3f')]);_0x572ca9[_0x04b2('0x40')]=_['intersection'](_0x572ca9[_0x04b2('0x3c')],_0x572ca9['query']);_0x20dc9e[_0x04b2('0x41')]=_[_0x04b2('0x42')](_0x572ca9[_0x04b2('0x3c')],qs[_0x04b2('0x43')](_0x46beff[_0x04b2('0x3f')][_0x04b2('0x43')]));_0x20dc9e[_0x04b2('0x41')]=_0x20dc9e[_0x04b2('0x41')]['length']?_0x20dc9e[_0x04b2('0x41')]:_0x572ca9['model'];if(!_0x46beff[_0x04b2('0x3f')][_0x04b2('0x44')](_0x04b2('0x45'))){_0x20dc9e[_0x04b2('0x30')]=qs[_0x04b2('0x30')](_0x46beff[_0x04b2('0x3f')]['limit']);_0x20dc9e[_0x04b2('0x2f')]=qs[_0x04b2('0x2f')](_0x46beff[_0x04b2('0x3f')][_0x04b2('0x2f')]);}_0x20dc9e[_0x04b2('0x46')]=qs[_0x04b2('0x47')](_0x46beff[_0x04b2('0x3f')][_0x04b2('0x47')]);_0x20dc9e[_0x04b2('0x48')]=qs['filters'](_[_0x04b2('0x49')](_0x46beff[_0x04b2('0x3f')],_0x572ca9[_0x04b2('0x40')]),_0x324bf1);if(_0x46beff[_0x04b2('0x3f')][_0x04b2('0x4a')]){_0x20dc9e[_0x04b2('0x48')]=_[_0x04b2('0x4b')](_0x20dc9e[_0x04b2('0x48')],{'$or':_[_0x04b2('0x3d')](_0x324bf1,function(_0x3118e8){if(_0x3118e8[_0x04b2('0x3a')]!==_0x04b2('0x4c')){var _0xcdfba4={};_0xcdfba4[_0x3118e8[_0x04b2('0x35')]]={'$like':'%'+_0x46beff[_0x04b2('0x3f')][_0x04b2('0x4a')]+'%'};return _0xcdfba4;}})});}_0x20dc9e=_[_0x04b2('0x4b')]({},_0x20dc9e,_0x46beff[_0x04b2('0x4d')]);var _0x118a36={'where':_0x20dc9e[_0x04b2('0x48')]};return db['SmsMessage'][_0x04b2('0x2e')](_0x118a36)['then'](function(_0x292582){_0x56e85d['count']=_0x292582;if(_0x46beff[_0x04b2('0x3f')][_0x04b2('0x4e')]){_0x20dc9e[_0x04b2('0x4f')]=[{'all':!![]}];}return db['SmsMessage'][_0x04b2('0x50')](_0x20dc9e);})[_0x04b2('0x51')](function(_0x357b73){_0x56e85d['rows']=_0x357b73;return _0x56e85d;})[_0x04b2('0x51')](respondWithFilteredResult(_0x1f47ed,_0x20dc9e))['catch'](handleError(_0x1f47ed,null));};exports['show']=function(_0x4b6d81,_0x2e22b3){var _0x1d6109={'raw':!![],'where':{'id':_0x4b6d81['params']['id']}},_0x562427={};_0x562427[_0x04b2('0x3c')]=_[_0x04b2('0x3e')](db['SmsMessage']['rawAttributes']);_0x562427[_0x04b2('0x3f')]=_[_0x04b2('0x3e')](_0x4b6d81[_0x04b2('0x3f')]);_0x562427[_0x04b2('0x40')]=_[_0x04b2('0x42')](_0x562427[_0x04b2('0x3c')],_0x562427[_0x04b2('0x3f')]);_0x1d6109[_0x04b2('0x41')]=_['intersection'](_0x562427[_0x04b2('0x3c')],qs[_0x04b2('0x43')](_0x4b6d81[_0x04b2('0x3f')][_0x04b2('0x43')]));_0x1d6109['attributes']=_0x1d6109[_0x04b2('0x41')][_0x04b2('0x52')]?_0x1d6109['attributes']:_0x562427['model'];if(_0x4b6d81['query'][_0x04b2('0x4e')]){_0x1d6109[_0x04b2('0x4f')]=[{'all':!![]}];}_0x1d6109=_[_0x04b2('0x4b')]({},_0x1d6109,_0x4b6d81[_0x04b2('0x4d')]);return db[_0x04b2('0x38')][_0x04b2('0x53')](_0x1d6109)[_0x04b2('0x51')](handleEntityNotFound(_0x2e22b3,null))[_0x04b2('0x51')](respondWithResult(_0x2e22b3,null))[_0x04b2('0x29')](handleError(_0x2e22b3,null));};exports[_0x04b2('0x54')]=function(_0x19d561,_0x528b45){return db[_0x04b2('0x38')]['create'](_0x19d561['body'],{})[_0x04b2('0x51')](respondWithResult(_0x528b45,0xc9))[_0x04b2('0x29')](handleError(_0x528b45,null));};exports[_0x04b2('0x55')]=function(_0xd55a40,_0x3ee51f){if(_0xd55a40[_0x04b2('0x56')]['id']){delete _0xd55a40[_0x04b2('0x56')]['id'];}return db[_0x04b2('0x38')][_0x04b2('0x53')]({'where':{'id':_0xd55a40['params']['id']}})[_0x04b2('0x51')](handleEntityNotFound(_0x3ee51f,null))[_0x04b2('0x51')](saveUpdates(_0xd55a40[_0x04b2('0x56')],null))['then'](respondWithResult(_0x3ee51f,null))[_0x04b2('0x29')](handleError(_0x3ee51f,null));};exports['destroy']=function(_0x4c95b4,_0x2ee019){return db[_0x04b2('0x38')][_0x04b2('0x53')]({'where':{'id':_0x4c95b4['params']['id']}})[_0x04b2('0x51')](handleEntityNotFound(_0x2ee019,null))[_0x04b2('0x51')](removeEntity(_0x2ee019,null))[_0x04b2('0x29')](handleError(_0x2ee019,null));};exports[_0x04b2('0x57')]=function(_0x4dd7cf,_0x479520){return db[_0x04b2('0x38')][_0x04b2('0x57')]()[_0x04b2('0x51')](respondWithResult(_0x479520,null))[_0x04b2('0x29')](handleError(_0x479520,null));};var interaction_log=require(_0x04b2('0x15'))(_0x04b2('0x58'));exports[_0x04b2('0x59')]=function(_0x12b356,_0x410a9d,_0x15a376){var _0x16f422={'agent':{},'channel':_0x04b2('0x5a')};if(_0x12b356[_0x04b2('0x56')]['id']){delete _0x12b356[_0x04b2('0x56')]['id'];}_0x12b356[_0x04b2('0x56')][_0x04b2('0x5b')]=!![];_0x12b356[_0x04b2('0x56')][_0x04b2('0x5c')]=moment()[_0x04b2('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x12b356[_0x04b2('0x56')][_0x04b2('0x5e')]=_0x12b356[_0x04b2('0x56')][_0x04b2('0x5e')]||_0x12b356[_0x04b2('0x5f')]['id'];_0x16f422[_0x04b2('0x60')]['id']=_0x12b356[_0x04b2('0x56')][_0x04b2('0x5e')];return db[_0x04b2('0x38')][_0x04b2('0x53')]({'where':{'id':_0x12b356[_0x04b2('0x61')]['id'],'UserId':null}})[_0x04b2('0x51')](handleEntityNotFound(_0x410a9d,null))[_0x04b2('0x51')](saveUpdates(_0x12b356[_0x04b2('0x56')],null))[_0x04b2('0x51')](function(_0x471c85){if(_0x471c85){_0x16f422[_0x04b2('0x28')]=_0x471c85['get']({'plain':!![]});return db[_0x04b2('0x62')]['find']({'where':{'id':_0x471c85[_0x04b2('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x410a9d,null))[_0x04b2('0x51')](function(_0x15f9aa){if(_0x15f9aa){return _0x15f9aa['update']({'UserId':_0x12b356[_0x04b2('0x56')][_0x04b2('0x5e')],'read1stAt':_[_0x04b2('0x64')](_0x15f9aa[_0x04b2('0x65')])?moment()[_0x04b2('0x5d')](_0x04b2('0x66')):undefined});}return null;})['then'](function(_0x2d0714){if(_0x2d0714){_0x16f422['interaction']=_0x2d0714[_0x04b2('0x67')]({'plain':!![]});interaction_log[_0x04b2('0x20')](_0x04b2('0x68'),_0x12b356['user']['id'],_0x12b356[_0x04b2('0x5f')][_0x04b2('0x35')],_0x12b356['user']['role'],_0x16f422[_0x04b2('0x69')]['id'],_0x12b356[_0x04b2('0x56')]?JSON['stringify'](_0x12b356['body']):_0x04b2('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x16f422);}return null;})['then'](function(_0xe38cd8){var _0x1a8d78='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xe38cd8['message'][_0x04b2('0x6b')];return db['sequelize'][_0x04b2('0x3f')](_0x1a8d78,{'type':db[_0x04b2('0x6c')][_0x04b2('0x6d')][_0x04b2('0x6e')],'raw':!![]})[_0x04b2('0x51')](function(_0x2004f4){return _0x2004f4;});})[_0x04b2('0x51')](function(_0x40b898){if(_0x40b898){_0x16f422[_0x04b2('0x28')][_0x04b2('0x6f')]=_0x40b898[0x0];if(!_0x12b356[_0x04b2('0x56')]['UserId'])return;return db['User'][_0x04b2('0x53')]({'where':{'id':_0x12b356['body']['UserId'],'role':'agent'},'attributes':['id',_0x04b2('0x35'),_0x04b2('0x70'),'email',_0x04b2('0x71')],'raw':!![]});}return null;})[_0x04b2('0x51')](function(_0x374a8f){if(!_0x374a8f)return null;_0x16f422[_0x04b2('0x28')]['agent']=_0x374a8f;return _0x16f422;})[_0x04b2('0x51')](function(_0x420e12){if(_0x420e12){if(_0x12b356[_0x04b2('0x56')]['manual']){_0x16f422[_0x04b2('0x28')][_0x04b2('0x72')]=util[_0x04b2('0x5d')](_0x04b2('0x73'),_0x12b356[_0x04b2('0x5f')][_0x04b2('0x35')]);_0x16f422[_0x04b2('0x28')]['channel']=_0x16f422['channel'];_0x16f422['message']['motionChannel']=_0x16f422[_0x04b2('0x74')];_0x16f422['message'][_0x04b2('0x75')]=_0x04b2('0x59');return respondWithRpcPromise(_0x04b2('0x76'),_0x04b2('0x76'),{'event':_0x04b2('0x77'),'message':_0x16f422[_0x04b2('0x28')]},client9002)[_0x04b2('0x51')](function(){return _0x16f422;});}return _0x16f422;}return null;})['then'](respondWithResult(_0x410a9d,null))[_0x04b2('0x29')](handleError(_0x410a9d,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports['reject']=function(_0x4769b9,_0x2f4a59,_0x39523){var _0x56a54c={'agent':{},'channel':'sms'};if(_0x4769b9[_0x04b2('0x56')]['id']){delete _0x4769b9[_0x04b2('0x56')]['id'];}_0x4769b9[_0x04b2('0x56')][_0x04b2('0x5e')]=_0x4769b9['body'][_0x04b2('0x5e')]||_0x4769b9[_0x04b2('0x5f')]['id'];_0x56a54c['agent']['id']=_0x4769b9[_0x04b2('0x56')][_0x04b2('0x5e')];return db[_0x04b2('0x38')][_0x04b2('0x53')]({'where':{'id':_0x4769b9['params']['id'],'UserId':null}})[_0x04b2('0x51')](handleEntityNotFound(_0x2f4a59,null))[_0x04b2('0x51')](function(_0x41eaba){if(_0x41eaba){_0x56a54c[_0x04b2('0x28')]=_0x41eaba[_0x04b2('0x67')]({'plain':!![]});return db[_0x04b2('0x62')][_0x04b2('0x53')]({'where':{'id':_0x41eaba[_0x04b2('0x63')]}});}return null;})[_0x04b2('0x51')](handleEntityNotFound(_0x2f4a59,null))[_0x04b2('0x51')](function(_0x5a1307){if(_0x5a1307){_0x56a54c[_0x04b2('0x69')]=_0x5a1307[_0x04b2('0x67')]({'plain':!![]});interaction_log['info'](_0x04b2('0x78'),_0x4769b9[_0x04b2('0x5f')]['id'],_0x4769b9[_0x04b2('0x5f')][_0x04b2('0x35')],_0x4769b9[_0x04b2('0x5f')]['role'],_0x56a54c[_0x04b2('0x69')]['id'],_0x4769b9[_0x04b2('0x56')]?JSON[_0x04b2('0x25')](_0x4769b9[_0x04b2('0x56')]):_0x04b2('0x6a'));return respondWithRpcPromise(_0x04b2('0x79'),_0x04b2('0x7a'),_0x56a54c);}return null;})[_0x04b2('0x51')](function(_0xb41aca){var _0xf256a9=_0x04b2('0x7b')+_0xb41aca['message'][_0x04b2('0x6b')];return db[_0x04b2('0x7c')][_0x04b2('0x3f')](_0xf256a9,{'type':db[_0x04b2('0x6c')][_0x04b2('0x6d')]['SELECT'],'raw':!![]})[_0x04b2('0x51')](function(_0x4ba239){return _0x4ba239;});})[_0x04b2('0x51')](function(_0x3251dd){if(_0x3251dd){_0x56a54c[_0x04b2('0x28')][_0x04b2('0x6f')]=_0x3251dd[0x0];if(!_0x4769b9[_0x04b2('0x56')][_0x04b2('0x5e')])return;return db[_0x04b2('0x7d')]['find']({'where':{'id':_0x4769b9['body'][_0x04b2('0x5e')],'role':_0x04b2('0x60')},'attributes':['id',_0x04b2('0x35'),_0x04b2('0x70'),_0x04b2('0x7e'),_0x04b2('0x71')],'raw':!![]});}return null;})[_0x04b2('0x51')](function(_0x2e42cd){if(!_0x2e42cd)return null;_0x56a54c[_0x04b2('0x28')][_0x04b2('0x60')]=_0x2e42cd;return _0x56a54c;})[_0x04b2('0x51')](function(_0xb32702){if(_0xb32702){_0xb32702['message'][_0x04b2('0x72')]=util[_0x04b2('0x5d')]('SIP/%s',_0x4769b9[_0x04b2('0x5f')][_0x04b2('0x35')]);_0xb32702[_0x04b2('0x28')][_0x04b2('0x74')]=_0x56a54c['channel'];_0xb32702[_0x04b2('0x28')][_0x04b2('0x7f')]=_0x56a54c['channel'];_0xb32702[_0x04b2('0x28')]['event']=_0x04b2('0x31');respondWithRpcPromise(_0x04b2('0x76'),'EventManager',{'event':_0x04b2('0x80'),'message':_0xb32702[_0x04b2('0x28')]},client9002);return _0x56a54c;}return null;})['then'](respondWithResult(_0x2f4a59,null))[_0x04b2('0x29')](handleError(_0x2f4a59,null));};exports[_0x04b2('0x2c')]=function(_0x20dc1f,_0x26c98d,_0x2bda4a){if(_0x20dc1f[_0x04b2('0x56')]['id']){delete _0x20dc1f[_0x04b2('0x56')]['id'];}var _0x5cb1f7;return db[_0x04b2('0x38')]['find']({'where':{'id':_0x20dc1f['params']['id']}})[_0x04b2('0x51')](handleEntityNotFound(_0x26c98d,null))['then'](function(_0x39bc15){if(_0x39bc15){_0x5cb1f7=_0x39bc15;return db[_0x04b2('0x81')][_0x04b2('0x53')]({'where':{'id':_0x39bc15[_0x04b2('0x82')]}});}})[_0x04b2('0x51')](handleEntityNotFound(_0x26c98d,null))[_0x04b2('0x51')](function(_0x7ad315){if(_0x7ad315){logger[_0x04b2('0x23')](_0x04b2('0x24'),_0x04b2('0x2c'),_0x04b2('0x83'),_0x7ad315[_0x04b2('0x3a')],util[_0x04b2('0x84')](_0x20dc1f[_0x04b2('0x56')],{'showHidden':![],'depth':null}));switch(_0x7ad315[_0x04b2('0x3a')]){case'twilio':if(_0x20dc1f[_0x04b2('0x56')][_0x04b2('0x85')]&&_0x20dc1f[_0x04b2('0x56')][_0x04b2('0x85')]===_0x5cb1f7['messageId']){return _0x5cb1f7[_0x04b2('0x55')]({'read':!![]});}else{logger[_0x04b2('0x26')](_0x04b2('0x86'),_0x04b2('0x2c'),_0x04b2('0x87'),util[_0x04b2('0x84')](_0x20dc1f['body'],{'showHidden':![],'depth':null}));}break;case _0x04b2('0x88'):if(_0x20dc1f['body'][_0x04b2('0x89')]&&_0x20dc1f[_0x04b2('0x56')][_0x04b2('0x89')]===_0x5cb1f7[_0x04b2('0x8a')]&&_['indexOf']([_0x04b2('0x8b'),'delivered'],_0x20dc1f['body'][_0x04b2('0x8c')])>=0x0){return _0x5cb1f7[_0x04b2('0x55')]({'read':!![]});}else{logger['error'](_0x04b2('0x86'),_0x04b2('0x2c'),_0x04b2('0x8d'),util[_0x04b2('0x84')](_0x20dc1f[_0x04b2('0x56')],{'showHidden':![],'depth':null}));}break;case _0x04b2('0x8e'):var _0x226767=_0x20dc1f[_0x04b2('0x56')][_0x04b2('0x8f')][0x0];if(_0x226767[_0x04b2('0x2c')]['groupName']===_0x04b2('0x90')){return _0x5cb1f7[_0x04b2('0x55')]({'read':!![]});}else{logger[_0x04b2('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x04b2('0x2c'),_0x04b2('0x8e'),util[_0x04b2('0x84')](_0x20dc1f[_0x04b2('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x5cb1f7;}})[_0x04b2('0x51')](respondWithResult(_0x26c98d,null))[_0x04b2('0x29')](handleError(_0x26c98d,null));}; \ No newline at end of file +var _0x64e6=['sent','Status','plivio','infobip','results','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','./smsMessage.socket','register','client','http','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','map','SmsMessage','fieldName','type','query','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','keys','rawAttributes','length','include','options','find','create','body','update','params','describe','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','internal','interface','format','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','email','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x64e6,0x1b2));var _0x664e=function(_0x44dfc6,_0x1ceb74){_0x44dfc6=_0x44dfc6-0x0;var _0x1cf133=_0x64e6[_0x44dfc6];return _0x1cf133;};'use strict';var emlformat=require(_0x664e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x664e('0x1'));var jsonpatch=require(_0x664e('0x2'));var rp=require(_0x664e('0x3'));var moment=require(_0x664e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x664e('0x5'));var path=require('path');var sox=require(_0x664e('0x6'));var csv=require(_0x664e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x664e('0x8'));var _=require(_0x664e('0x9'));var squel=require(_0x664e('0xa'));var crypto=require('crypto');var jsforce=require(_0x664e('0xb'));var deskjs=require(_0x664e('0xc'));var toCsv=require(_0x664e('0x7'));var querystring=require(_0x664e('0xd'));var Papa=require(_0x664e('0xe'));var Redis=require(_0x664e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x664e('0x10'));var as=require(_0x664e('0x11'));var hardwareService=require(_0x664e('0x12'));var logger=require(_0x664e('0x13'))(_0x664e('0x14'));var utils=require('../../config/utils');var config=require(_0x664e('0x15'));var licenseUtil=require(_0x664e('0x16'));var db=require('../../mysqldb')['db'];config[_0x664e('0x17')]=_['defaults'](config[_0x664e('0x17')],{'host':_0x664e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x664e('0x19'))[_0x664e('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x664e('0x1b')][_0x664e('0x1c')]({'port':0x232c});var client9002=jayson[_0x664e('0x1b')][_0x664e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2a967f,_0x4e9a56,_0xb1da9e,_0x47c019){return new BPromise(function(_0x3b5bef,_0x493eaa){var _0x36b3ca=_0x47c019||client;return _0x36b3ca['request'](_0x2a967f,_0xb1da9e)[_0x664e('0x1d')](function(_0x3d52ca){logger['info'](_0x664e('0x1e'),_0x4e9a56,_0x664e('0x1f'));logger[_0x664e('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4e9a56,_0x664e('0x1f'),JSON['stringify'](_0x3d52ca));if(_0x3d52ca[_0x664e('0x21')]){if(_0x3d52ca[_0x664e('0x21')][_0x664e('0x22')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x4e9a56,_0x3d52ca[_0x664e('0x21')]['message']);return _0x493eaa(_0x3d52ca[_0x664e('0x21')][_0x664e('0x23')]);}logger[_0x664e('0x21')](_0x664e('0x1e'),_0x4e9a56,_0x3d52ca[_0x664e('0x21')]['message']);return _0x3b5bef(_0x3d52ca[_0x664e('0x21')][_0x664e('0x23')]);}else{logger[_0x664e('0x24')](_0x664e('0x1e'),_0x4e9a56,_0x664e('0x1f'));_0x3b5bef(_0x3d52ca['result'][_0x664e('0x23')]);}})[_0x664e('0x25')](function(_0x393212){logger[_0x664e('0x21')](_0x664e('0x1e'),_0x4e9a56,_0x393212);_0x493eaa(_0x393212);});});}function respondWithStatusCode(_0x5d6533,_0x2cbca1){_0x2cbca1=_0x2cbca1||0xcc;return function(_0x4196f9){if(_0x4196f9){return _0x5d6533['sendStatus'](_0x2cbca1);}return _0x5d6533[_0x664e('0x26')](_0x2cbca1)[_0x664e('0x27')]();};}function respondWithResult(_0x5582d9,_0x6ae86e){_0x6ae86e=_0x6ae86e||0xc8;return function(_0x12f3f6){if(_0x12f3f6){return _0x5582d9[_0x664e('0x26')](_0x6ae86e)['json'](_0x12f3f6);}};}function respondWithFilteredResult(_0x35220f,_0x54f4a1){return function(_0x5b5371){if(_0x5b5371){var _0x5deef4=typeof _0x54f4a1[_0x664e('0x28')]===_0x664e('0x29')&&typeof _0x54f4a1[_0x664e('0x2a')]===_0x664e('0x29');var _0x224959=_0x5b5371[_0x664e('0x2b')];var _0x3cbaf6=_0x5deef4?0x0:_0x54f4a1['offset'];var _0x5d6639=_0x5deef4?_0x5b5371[_0x664e('0x2b')]:_0x54f4a1[_0x664e('0x28')]+_0x54f4a1[_0x664e('0x2a')];var _0x3542c1;if(_0x5d6639>=_0x224959){_0x5d6639=_0x224959;_0x3542c1=0xc8;}else{_0x3542c1=0xce;}_0x35220f['status'](_0x3542c1);return _0x35220f[_0x664e('0x2c')](_0x664e('0x2d'),_0x3cbaf6+'-'+_0x5d6639+'/'+_0x224959)[_0x664e('0x2e')](_0x5b5371);}return null;};}function patchUpdates(_0x14b02b){return function(_0x5c6a40){try{jsonpatch[_0x664e('0x2f')](_0x5c6a40,_0x14b02b,!![]);}catch(_0x1b9e34){return BPromise[_0x664e('0x30')](_0x1b9e34);}return _0x5c6a40[_0x664e('0x31')]();};}function saveUpdates(_0x1b7682,_0x3915de){return function(_0x2a508f){if(_0x2a508f){return _0x2a508f['update'](_0x1b7682)[_0x664e('0x1d')](function(_0x178a50){return _0x178a50;});}return null;};}function removeEntity(_0x2d8992,_0x4bf4a8){return function(_0xa4fb3a){if(_0xa4fb3a){return _0xa4fb3a[_0x664e('0x32')]()['then'](function(){_0x2d8992[_0x664e('0x26')](0xcc)[_0x664e('0x27')]();});}};}function handleEntityNotFound(_0x5ec34a,_0x3636ef){return function(_0x296160){if(!_0x296160){_0x5ec34a['sendStatus'](0x194);}return _0x296160;};}function handleError(_0x1d6879,_0x2e8c29){_0x2e8c29=_0x2e8c29||0x1f4;return function(_0x548cb7){logger['error'](_0x548cb7[_0x664e('0x33')]);if(_0x548cb7[_0x664e('0x34')]){delete _0x548cb7[_0x664e('0x34')];}_0x1d6879[_0x664e('0x26')](_0x2e8c29)[_0x664e('0x35')](_0x548cb7);};}exports['index']=function(_0x165578,_0x1f71f0){var _0x471d3a={},_0x23140d={},_0x5b1880={'count':0x0,'rows':[]};var _0x1bfa32=_[_0x664e('0x36')](db[_0x664e('0x37')]['rawAttributes'],function(_0xb6d217){return{'name':_0xb6d217[_0x664e('0x38')],'type':_0xb6d217[_0x664e('0x39')]['key']};});_0x23140d['model']=_[_0x664e('0x36')](_0x1bfa32,_0x664e('0x34'));_0x23140d[_0x664e('0x3a')]=_['keys'](_0x165578[_0x664e('0x3a')]);_0x23140d[_0x664e('0x3b')]=_[_0x664e('0x3c')](_0x23140d['model'],_0x23140d[_0x664e('0x3a')]);_0x471d3a[_0x664e('0x3d')]=_[_0x664e('0x3c')](_0x23140d[_0x664e('0x3e')],qs[_0x664e('0x3f')](_0x165578[_0x664e('0x3a')][_0x664e('0x3f')]));_0x471d3a[_0x664e('0x3d')]=_0x471d3a[_0x664e('0x3d')]['length']?_0x471d3a[_0x664e('0x3d')]:_0x23140d[_0x664e('0x3e')];if(!_0x165578['query']['hasOwnProperty'](_0x664e('0x40'))){_0x471d3a[_0x664e('0x2a')]=qs[_0x664e('0x2a')](_0x165578[_0x664e('0x3a')][_0x664e('0x2a')]);_0x471d3a[_0x664e('0x28')]=qs[_0x664e('0x28')](_0x165578[_0x664e('0x3a')]['offset']);}_0x471d3a[_0x664e('0x41')]=qs[_0x664e('0x42')](_0x165578['query']['sort']);_0x471d3a[_0x664e('0x43')]=qs[_0x664e('0x3b')](_[_0x664e('0x44')](_0x165578[_0x664e('0x3a')],_0x23140d['filters']),_0x1bfa32);if(_0x165578['query'][_0x664e('0x45')]){_0x471d3a[_0x664e('0x43')]=_['merge'](_0x471d3a[_0x664e('0x43')],{'$or':_[_0x664e('0x36')](_0x1bfa32,function(_0x49a366){if(_0x49a366[_0x664e('0x39')]!==_0x664e('0x46')){var _0x47c4db={};_0x47c4db[_0x49a366[_0x664e('0x34')]]={'$like':'%'+_0x165578[_0x664e('0x3a')][_0x664e('0x45')]+'%'};return _0x47c4db;}})});}_0x471d3a=_[_0x664e('0x47')]({},_0x471d3a,_0x165578['options']);var _0x3c61c0={'where':_0x471d3a[_0x664e('0x43')]};return db[_0x664e('0x37')][_0x664e('0x2b')](_0x3c61c0)[_0x664e('0x1d')](function(_0x522b94){_0x5b1880[_0x664e('0x2b')]=_0x522b94;if(_0x165578[_0x664e('0x3a')][_0x664e('0x48')]){_0x471d3a['include']=[{'all':!![]}];}return db[_0x664e('0x37')][_0x664e('0x49')](_0x471d3a);})[_0x664e('0x1d')](function(_0x42fb4e){_0x5b1880[_0x664e('0x4a')]=_0x42fb4e;return _0x5b1880;})[_0x664e('0x1d')](respondWithFilteredResult(_0x1f71f0,_0x471d3a))['catch'](handleError(_0x1f71f0,null));};exports[_0x664e('0x4b')]=function(_0x42bd7f,_0x43a54f){var _0x2efca2={'raw':!![],'where':{'id':_0x42bd7f['params']['id']}},_0x4475da={};_0x4475da['model']=_[_0x664e('0x4c')](db[_0x664e('0x37')][_0x664e('0x4d')]);_0x4475da['query']=_[_0x664e('0x4c')](_0x42bd7f['query']);_0x4475da[_0x664e('0x3b')]=_['intersection'](_0x4475da['model'],_0x4475da['query']);_0x2efca2[_0x664e('0x3d')]=_[_0x664e('0x3c')](_0x4475da['model'],qs[_0x664e('0x3f')](_0x42bd7f[_0x664e('0x3a')][_0x664e('0x3f')]));_0x2efca2['attributes']=_0x2efca2[_0x664e('0x3d')][_0x664e('0x4e')]?_0x2efca2[_0x664e('0x3d')]:_0x4475da[_0x664e('0x3e')];if(_0x42bd7f[_0x664e('0x3a')][_0x664e('0x48')]){_0x2efca2[_0x664e('0x4f')]=[{'all':!![]}];}_0x2efca2=_[_0x664e('0x47')]({},_0x2efca2,_0x42bd7f[_0x664e('0x50')]);return db[_0x664e('0x37')][_0x664e('0x51')](_0x2efca2)[_0x664e('0x1d')](handleEntityNotFound(_0x43a54f,null))['then'](respondWithResult(_0x43a54f,null))['catch'](handleError(_0x43a54f,null));};exports[_0x664e('0x52')]=function(_0x22ce72,_0x3350a4){return db['SmsMessage'][_0x664e('0x52')](_0x22ce72[_0x664e('0x53')],{})[_0x664e('0x1d')](respondWithResult(_0x3350a4,0xc9))[_0x664e('0x25')](handleError(_0x3350a4,null));};exports[_0x664e('0x54')]=function(_0x1c3915,_0x21fafb){if(_0x1c3915['body']['id']){delete _0x1c3915[_0x664e('0x53')]['id'];}return db[_0x664e('0x37')][_0x664e('0x51')]({'where':{'id':_0x1c3915[_0x664e('0x55')]['id']}})[_0x664e('0x1d')](handleEntityNotFound(_0x21fafb,null))[_0x664e('0x1d')](saveUpdates(_0x1c3915['body'],null))[_0x664e('0x1d')](respondWithResult(_0x21fafb,null))[_0x664e('0x25')](handleError(_0x21fafb,null));};exports[_0x664e('0x32')]=function(_0x4ebbd5,_0x302826){return db[_0x664e('0x37')]['find']({'where':{'id':_0x4ebbd5[_0x664e('0x55')]['id']}})[_0x664e('0x1d')](handleEntityNotFound(_0x302826,null))[_0x664e('0x1d')](removeEntity(_0x302826,null))[_0x664e('0x25')](handleError(_0x302826,null));};exports[_0x664e('0x56')]=function(_0x4ae256,_0x5a4e02){return db[_0x664e('0x37')]['describe']()[_0x664e('0x1d')](respondWithResult(_0x5a4e02,null))[_0x664e('0x25')](handleError(_0x5a4e02,null));};var interaction_log=require(_0x664e('0x13'))(_0x664e('0x57'));exports[_0x664e('0x58')]=function(_0x4355b6,_0x6e8f28,_0x5ec73a){var _0x598216={'agent':{},'channel':_0x664e('0x59')};if(_0x4355b6[_0x664e('0x53')]['id']){delete _0x4355b6[_0x664e('0x53')]['id'];}_0x4355b6[_0x664e('0x53')][_0x664e('0x5a')]=!![];_0x4355b6[_0x664e('0x53')][_0x664e('0x5b')]=moment()['format'](_0x664e('0x5c'));_0x4355b6[_0x664e('0x53')]['UserId']=_0x4355b6[_0x664e('0x53')][_0x664e('0x5d')]||_0x4355b6[_0x664e('0x5e')]['id'];_0x598216[_0x664e('0x5f')]['id']=_0x4355b6[_0x664e('0x53')][_0x664e('0x5d')];return db['SmsMessage'][_0x664e('0x51')]({'where':{'id':_0x4355b6['params']['id'],'UserId':null}})[_0x664e('0x1d')](handleEntityNotFound(_0x6e8f28,null))[_0x664e('0x1d')](saveUpdates(_0x4355b6[_0x664e('0x53')],null))[_0x664e('0x1d')](function(_0x2fb2ac){if(_0x2fb2ac){_0x598216['message']=_0x2fb2ac[_0x664e('0x60')]({'plain':!![]});return db[_0x664e('0x61')][_0x664e('0x51')]({'where':{'id':_0x2fb2ac[_0x664e('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x6e8f28,null))[_0x664e('0x1d')](function(_0x3adcc2){if(_0x3adcc2){return _0x3adcc2[_0x664e('0x54')]({'UserId':_0x4355b6[_0x664e('0x53')][_0x664e('0x5d')],'read1stAt':_[_0x664e('0x63')](_0x3adcc2[_0x664e('0x64')])?moment()['format'](_0x664e('0x5c')):undefined});}return null;})[_0x664e('0x1d')](function(_0x449731){if(_0x449731){_0x598216[_0x664e('0x65')]=_0x449731['get']({'plain':!![]});interaction_log[_0x664e('0x24')](_0x664e('0x66'),_0x4355b6[_0x664e('0x5e')]['id'],_0x4355b6[_0x664e('0x5e')][_0x664e('0x34')],_0x4355b6[_0x664e('0x5e')]['role'],_0x598216[_0x664e('0x65')]['id'],_0x4355b6[_0x664e('0x53')]?JSON[_0x664e('0x67')](_0x4355b6[_0x664e('0x53')]):_0x664e('0x68'));return respondWithRpcPromise(_0x664e('0x69'),_0x664e('0x6a'),_0x598216);}return null;})[_0x664e('0x1d')](function(_0x53fff2){var _0xb12683=_0x664e('0x6b')+_0x53fff2[_0x664e('0x23')][_0x664e('0x6c')];return db[_0x664e('0x6d')][_0x664e('0x3a')](_0xb12683,{'type':db[_0x664e('0x6e')][_0x664e('0x6f')]['SELECT'],'raw':!![]})[_0x664e('0x1d')](function(_0x25e21c){return _0x25e21c;});})[_0x664e('0x1d')](function(_0xb88ef1){if(_0xb88ef1){_0x598216[_0x664e('0x23')][_0x664e('0x70')]=_0xb88ef1[0x0];if(!_0x4355b6[_0x664e('0x53')]['UserId'])return;return db[_0x664e('0x71')]['find']({'where':{'id':_0x4355b6[_0x664e('0x53')][_0x664e('0x5d')],'role':'agent'},'attributes':['id',_0x664e('0x34'),_0x664e('0x72'),'email',_0x664e('0x73')],'raw':!![]});}return null;})[_0x664e('0x1d')](function(_0x175d67){if(!_0x175d67)return null;_0x598216[_0x664e('0x23')][_0x664e('0x5f')]=_0x175d67;return _0x598216;})[_0x664e('0x1d')](function(_0x2367d4){if(_0x2367d4){if(_0x4355b6[_0x664e('0x53')]['manual']){_0x598216[_0x664e('0x23')][_0x664e('0x74')]=util[_0x664e('0x75')]('SIP/%s',_0x4355b6[_0x664e('0x5e')][_0x664e('0x34')]);_0x598216[_0x664e('0x23')][_0x664e('0x76')]=_0x598216[_0x664e('0x76')];_0x598216[_0x664e('0x23')][_0x664e('0x77')]=_0x598216[_0x664e('0x76')];_0x598216[_0x664e('0x23')][_0x664e('0x78')]='accept';return respondWithRpcPromise('EventManager',_0x664e('0x79'),{'event':_0x664e('0x7a'),'message':_0x598216[_0x664e('0x23')]},client9002)[_0x664e('0x1d')](function(){return _0x598216;});}return _0x598216;}return null;})[_0x664e('0x1d')](respondWithResult(_0x6e8f28,null))[_0x664e('0x25')](handleError(_0x6e8f28,null));};var interaction_log=require(_0x664e('0x13'))(_0x664e('0x57'));exports[_0x664e('0x30')]=function(_0x4b16eb,_0x4c9797,_0x5ea7e0){var _0xc3f75e={'agent':{},'channel':_0x664e('0x59')};if(_0x4b16eb[_0x664e('0x53')]['id']){delete _0x4b16eb[_0x664e('0x53')]['id'];}_0x4b16eb['body']['UserId']=_0x4b16eb[_0x664e('0x53')][_0x664e('0x5d')]||_0x4b16eb[_0x664e('0x5e')]['id'];_0xc3f75e[_0x664e('0x5f')]['id']=_0x4b16eb['body'][_0x664e('0x5d')];return db[_0x664e('0x37')]['find']({'where':{'id':_0x4b16eb['params']['id'],'UserId':null}})[_0x664e('0x1d')](handleEntityNotFound(_0x4c9797,null))[_0x664e('0x1d')](function(_0x38b283){if(_0x38b283){_0xc3f75e[_0x664e('0x23')]=_0x38b283[_0x664e('0x60')]({'plain':!![]});return db[_0x664e('0x61')][_0x664e('0x51')]({'where':{'id':_0x38b283[_0x664e('0x62')]}});}return null;})[_0x664e('0x1d')](handleEntityNotFound(_0x4c9797,null))['then'](function(_0x3ce93a){if(_0x3ce93a){_0xc3f75e[_0x664e('0x65')]=_0x3ce93a[_0x664e('0x60')]({'plain':!![]});interaction_log[_0x664e('0x24')](_0x664e('0x7b'),_0x4b16eb[_0x664e('0x5e')]['id'],_0x4b16eb['user'][_0x664e('0x34')],_0x4b16eb[_0x664e('0x5e')][_0x664e('0x7c')],_0xc3f75e[_0x664e('0x65')]['id'],_0x4b16eb[_0x664e('0x53')]?JSON[_0x664e('0x67')](_0x4b16eb[_0x664e('0x53')]):_0x664e('0x68'));return respondWithRpcPromise('RejectMessage',_0x664e('0x7d'),_0xc3f75e);}return null;})[_0x664e('0x1d')](function(_0x53636f){var _0x3611df='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x53636f[_0x664e('0x23')][_0x664e('0x6c')];return db[_0x664e('0x6d')][_0x664e('0x3a')](_0x3611df,{'type':db[_0x664e('0x6e')][_0x664e('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x3c2598){return _0x3c2598;});})[_0x664e('0x1d')](function(_0x4a8018){if(_0x4a8018){_0xc3f75e[_0x664e('0x23')][_0x664e('0x70')]=_0x4a8018[0x0];if(!_0x4b16eb[_0x664e('0x53')][_0x664e('0x5d')])return;return db[_0x664e('0x71')][_0x664e('0x51')]({'where':{'id':_0x4b16eb['body'][_0x664e('0x5d')],'role':'agent'},'attributes':['id',_0x664e('0x34'),'fullname',_0x664e('0x7e'),_0x664e('0x73')],'raw':!![]});}return null;})[_0x664e('0x1d')](function(_0x459a1f){if(!_0x459a1f)return null;_0xc3f75e['message'][_0x664e('0x5f')]=_0x459a1f;return _0xc3f75e;})['then'](function(_0x61c7c1){if(_0x61c7c1){_0x61c7c1[_0x664e('0x23')][_0x664e('0x74')]=util['format'](_0x664e('0x7f'),_0x4b16eb[_0x664e('0x5e')][_0x664e('0x34')]);_0x61c7c1[_0x664e('0x23')][_0x664e('0x76')]=_0xc3f75e[_0x664e('0x76')];_0x61c7c1['message'][_0x664e('0x77')]=_0xc3f75e['channel'];_0x61c7c1[_0x664e('0x23')]['event']=_0x664e('0x30');respondWithRpcPromise('EventManager','EventManager',{'event':_0x664e('0x80'),'message':_0x61c7c1['message']},client9002);return _0xc3f75e;}return null;})[_0x664e('0x1d')](respondWithResult(_0x4c9797,null))[_0x664e('0x25')](handleError(_0x4c9797,null));};exports[_0x664e('0x26')]=function(_0x3e0a3b,_0x487d18,_0x11f4f6){if(_0x3e0a3b[_0x664e('0x53')]['id']){delete _0x3e0a3b['body']['id'];}var _0x3a9517;return db['SmsMessage'][_0x664e('0x51')]({'where':{'id':_0x3e0a3b['params']['id']}})[_0x664e('0x1d')](handleEntityNotFound(_0x487d18,null))['then'](function(_0x19966e){if(_0x19966e){_0x3a9517=_0x19966e;return db[_0x664e('0x81')][_0x664e('0x51')]({'where':{'id':_0x19966e[_0x664e('0x82')]}});}})[_0x664e('0x1d')](handleEntityNotFound(_0x487d18,null))[_0x664e('0x1d')](function(_0x2de836){if(_0x2de836){logger[_0x664e('0x20')](_0x664e('0x83'),_0x664e('0x26'),'received\x20delivery\x20report\x20from',_0x2de836[_0x664e('0x39')],util[_0x664e('0x84')](_0x3e0a3b[_0x664e('0x53')],{'showHidden':![],'depth':null}));switch(_0x2de836[_0x664e('0x39')]){case'twilio':if(_0x3e0a3b[_0x664e('0x53')][_0x664e('0x85')]&&_0x3e0a3b[_0x664e('0x53')]['MessageSid']===_0x3a9517['messageId']){return _0x3a9517[_0x664e('0x54')]({'read':!![]});}else{logger[_0x664e('0x21')](_0x664e('0x86'),'status','twilio',util[_0x664e('0x84')](_0x3e0a3b[_0x664e('0x53')],{'showHidden':![],'depth':null}));}break;case _0x664e('0x87'):if(_0x3e0a3b[_0x664e('0x53')]['MessageUUID']&&_0x3e0a3b[_0x664e('0x53')][_0x664e('0x88')]===_0x3a9517['messageId']&&_[_0x664e('0x89')]([_0x664e('0x8a'),'delivered'],_0x3e0a3b[_0x664e('0x53')][_0x664e('0x8b')])>=0x0){return _0x3a9517[_0x664e('0x54')]({'read':!![]});}else{logger[_0x664e('0x21')](_0x664e('0x86'),_0x664e('0x26'),_0x664e('0x8c'),util[_0x664e('0x84')](_0x3e0a3b[_0x664e('0x53')],{'showHidden':![],'depth':null}));}break;case _0x664e('0x8d'):var _0x317062=_0x3e0a3b[_0x664e('0x53')][_0x664e('0x8e')][0x0];if(_0x317062[_0x664e('0x26')]['groupName']==='DELIVERED'){return _0x3a9517[_0x664e('0x54')]({'read':!![]});}else{logger[_0x664e('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x664e('0x84')](_0x3e0a3b['body'],{'showHidden':![],'depth':null}));}break;}return _0x3a9517;}})[_0x664e('0x1d')](respondWithResult(_0x487d18,null))[_0x664e('0x25')](handleError(_0x487d18,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index ccfe53f..1bce8af 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 _0xd9d8=['events','../../mysqldb','save','remove','hasOwnProperty'];(function(_0x484405,_0x5b40d9){var _0x2de033=function(_0xc17e09){while(--_0xc17e09){_0x484405['push'](_0x484405['shift']());}};_0x2de033(++_0x5b40d9);}(_0xd9d8,0xb4));var _0x8d9d=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0xd9d8[_0x2431d6];return _0x4d0f9b;};'use strict';var EventEmitter=require(_0x8d9d('0x0'));var SmsMessage=require(_0x8d9d('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8d9d('0x2'),'afterUpdate':'update','afterDestroy':_0x8d9d('0x3')};function emitEvent(_0x40b021){return function(_0x3b05ac,_0x54209e,_0x3ae3b0){SmsMessageEvents['emit'](_0x40b021+':'+_0x3b05ac['id'],_0x3b05ac);SmsMessageEvents['emit'](_0x40b021,_0x3b05ac);_0x3ae3b0(null);};}for(var e in events){if(events[_0x8d9d('0x4')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xfd6a=['hook','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xfd6a,0x83));var _0xafd6=function(_0x3735d0,_0x251b23){_0x3735d0=_0x3735d0-0x0;var _0x141ab6=_0xfd6a[_0x3735d0];return _0x141ab6;};'use strict';var EventEmitter=require(_0xafd6('0x0'));var SmsMessage=require(_0xafd6('0x1'))['db'][_0xafd6('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xafd6('0x3')](0x0);var events={'afterCreate':_0xafd6('0x4'),'afterUpdate':_0xafd6('0x5'),'afterDestroy':_0xafd6('0x6')};function emitEvent(_0x4bc69f){return function(_0x59f9b9,_0x4b6d4b,_0xf6aed4){SmsMessageEvents[_0xafd6('0x7')](_0x4bc69f+':'+_0x59f9b9['id'],_0x59f9b9);SmsMessageEvents[_0xafd6('0x7')](_0x4bc69f,_0x59f9b9);_0xf6aed4(null);};}for(var e in events){if(events[_0xafd6('0x8')](e)){var event=events[e];SmsMessage[_0xafd6('0x9')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index c2e796a..e9d9c6e 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 _0xf3ff=['SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','authToken','phone','accountSid','messages','create','body','/api/sms/messages/','/status?token=','token','sid','afterCreate','twilio','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','login?username=','&password=','GET','split','POST','user_key','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','message_id','clickSend','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','crypto','login','text','timestamp','keys','sort','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','message','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','messageId','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne'];(function(_0xc22d25,_0x95180b){var _0x291ebd=function(_0x3be563){while(--_0x3be563){_0xc22d25['push'](_0xc22d25['shift']());}};_0x291ebd(++_0x95180b);}(_0xf3ff,0x6b));var _0xff3f=function(_0x5548c5,_0x21e47b){_0x5548c5=_0x5548c5-0x0;var _0x4a81d9=_0xf3ff[_0x5548c5];return _0x4a81d9;};'use strict';var _=require(_0xff3f('0x0'));var util=require(_0xff3f('0x1'));var logger=require(_0xff3f('0x2'))(_0xff3f('0x3'));var moment=require(_0xff3f('0x4'));var BPromise=require(_0xff3f('0x5'));var rp=require(_0xff3f('0x6'));var fs=require('fs');var path=require(_0xff3f('0x7'));var rimraf=require(_0xff3f('0x8'));var config=require(_0xff3f('0x9'));var attributes=require(_0xff3f('0xa'));module[_0xff3f('0xb')]=function(_0x3af353,_0x463b47){return _0x3af353[_0xff3f('0xc')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xff3f('0xd'),'fields':[_0xff3f('0xd')]},{'name':'fti_sms_messages','fields':['body'],'type':_0xff3f('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x27470a,_0x4e52ff,_0x47a69d){var _0x48e007=_0x3af353[_0xff3f('0xf')];var _0x2b6618=_0x27470a[_0xff3f('0x10')]({'plain':!![]});if(_0x2b6618[_0xff3f('0x11')][_0xff3f('0x12')]()==='in'||_0x2b6618[_0xff3f('0x11')][_0xff3f('0x12')]()===_0xff3f('0x13')&&!_0x2b6618[_0xff3f('0x14')]&&!_[_0xff3f('0x15')](_0x2b6618[_0xff3f('0x16')])&&!_[_0xff3f('0x15')](_0x2b6618['SmsInteractionId'])){_0x48e007['SmsInteraction'][_0xff3f('0x17')]({'where':{'id':_0x2b6618[_0xff3f('0x18')]}})[_0xff3f('0x19')](function(_0xae5f0e){if(_0xae5f0e){_0xae5f0e[_0xff3f('0x1a')]({'lastMsgAt':_0x2b6618[_0xff3f('0x1b')],'lastMsgDirection':_0x2b6618[_0xff3f('0x11')][_0xff3f('0x12')]()});}})[_0xff3f('0x1c')](function(_0x38bd9f){console[_0xff3f('0x1d')](_0x38bd9f);});}if(_0x2b6618[_0xff3f('0x11')]===_0xff3f('0x13')&&!_0x2b6618['secret']){var _0x2243f7;_0x48e007[_0xff3f('0x1e')][_0xff3f('0x1f')]({'where':{'id':_0x2b6618[_0xff3f('0x20')]},'raw':!![]})[_0xff3f('0x19')](function(_0x2591ae){_0x2243f7=_0x2591ae;if(_0x2243f7&&_0x2243f7[_0xff3f('0x21')]){switch(_0x2243f7[_0xff3f('0x21')]){case'twilio':var _0x5c98bf=require('twilio');if(_0x2243f7['accountSid']&&_0x2243f7[_0xff3f('0x22')]&&_0x2243f7[_0xff3f('0x23')]){var _0x1aa96f=new _0x5c98bf(_0x2243f7[_0xff3f('0x24')],_0x2243f7['authToken']);_0x1aa96f[_0xff3f('0x25')][_0xff3f('0x26')]({'body':_0x2b6618[_0xff3f('0x27')],'to':_0x2b6618['phone'],'from':_0x2243f7['phone'],'statusCallback':_0x2243f7['remote']+_0xff3f('0x28')+_0x2b6618['id']+_0xff3f('0x29')+_0x2243f7[_0xff3f('0x2a')]})[_0xff3f('0x19')](function(_0x152bac){if(_0x152bac[_0xff3f('0x2b')]){return _0x27470a[_0xff3f('0x1a')]({'messageId':_0x152bac[_0xff3f('0x2b')]});}})[_0xff3f('0x1c')](function(_0x147372){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xff3f('0x2c'),_0xff3f('0x2d'),util[_0xff3f('0x2e')](_0x147372,{'showHidden':![],'depth':null}));});}else{logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),'twilio',_0xff3f('0x30'));}break;case _0xff3f('0x31'):var _0x409011='https://api.skebby.it/API/v1.0/REST/';if(_0x2243f7[_0xff3f('0x32')]&&_0x2243f7[_0xff3f('0x33')]){var _0x1a04d9={'recipient':[_0x2b6618['phone']],'message':_0x2b6618[_0xff3f('0x27')],'message_type':_0x2243f7[_0xff3f('0x34')]};if(_0x2243f7[_0xff3f('0x34')]&&_0x2243f7[_0xff3f('0x34')]!=='SI'){_0x1a04d9[_0xff3f('0x35')]=_0x2243f7[_0xff3f('0x23')];}var _0x20381b={'url':_0x409011+_0xff3f('0x36')+_0x2243f7['username']+_0xff3f('0x37')+_0x2243f7[_0xff3f('0x33')],'method':_0xff3f('0x38')};rp(_0x20381b)[_0xff3f('0x19')](function(_0x1c5264){var _0x27cf80=_0x1c5264[_0xff3f('0x39')](';');var _0xb39242={'user_key':_0x27cf80[0x0],'session_key':_0x27cf80[0x1]};_0x20381b={'url':_0x409011+'sms','method':_0xff3f('0x3a'),'headers':{'user_key':_0xb39242[_0xff3f('0x3b')],'Session_key':_0xb39242[_0xff3f('0x3c')]},'json':!![],'body':_0x1a04d9};return rp(_0x20381b);})[_0xff3f('0x19')](function(_0x4a5e6d){if(_0x4a5e6d[_0xff3f('0x3d')]>=0x1){var _0x1f1009={'messageId':_0x4a5e6d['internal_order_id']};if(_0x2243f7[_0xff3f('0x34')]!=='GP'||!_0x2243f7[_0xff3f('0x3e')]){_0x1f1009[_0xff3f('0x3f')]=!![];}return _0x27470a['update'](_0x1f1009);}else{return logger['error'](_0xff3f('0x2f'),'afterCreate',_0xff3f('0x31'),util['inspect'](_0x4a5e6d,{'showHidden':![],'depth':null}));}})[_0xff3f('0x1c')](function(_0x3ec2da){return logger['error'](_0xff3f('0x2f'),_0xff3f('0x2c'),_0xff3f('0x31'),util['inspect'](_0x3ec2da,{'showHidden':![],'depth':null}));});}else{logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),'skebby',_0xff3f('0x40'));}break;case _0xff3f('0x41'):if(_0x2243f7[_0xff3f('0x22')]){var _0x131f2e={'recipient':_0x2b6618[_0xff3f('0x23')],'message':_0x2b6618['body'],'sender':_0x2243f7[_0xff3f('0x42')]||_0x2243f7[_0xff3f('0x23')],'authorization':_0x2243f7[_0xff3f('0x22')]};var _0x4e52ff={'method':_0xff3f('0x3a'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x131f2e,'json':!![]};rp(_0x4e52ff)[_0xff3f('0x19')](function(_0x4b5b8c){var _0x13b1e9={'messageId':_0x4b5b8c[_0xff3f('0x43')]};if(!_0x2243f7[_0xff3f('0x3e')]){_0x13b1e9[_0xff3f('0x3f')]=!![];}return _0x27470a[_0xff3f('0x1a')](_0x13b1e9);})[_0xff3f('0x1c')](function(_0x4ba6b5){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xff3f('0x2c'),'connectel',util[_0xff3f('0x2e')](_0x4ba6b5,{'showHidden':![],'depth':null}));});}else{logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),_0xff3f('0x41'),_0xff3f('0x44'));}break;case _0xff3f('0x45'):if(_0x2243f7[_0xff3f('0x32')]&&_0x2243f7[_0xff3f('0x33')]){var _0x131f2e={'messages':[{'source':_0xff3f('0x46'),'to':_0x2b6618['phone'],'body':_0x2b6618['body'],'from':_0x2243f7[_0xff3f('0x42')]||_0x2243f7[_0xff3f('0x23')]}]};var _0x29df20=util[_0xff3f('0x47')](_0xff3f('0x48'),_0x2243f7[_0xff3f('0x32')],_0x2243f7[_0xff3f('0x33')]);var _0x4e52ff={'method':_0xff3f('0x3a'),'uri':_0xff3f('0x49'),'body':_0x131f2e,'headers':{'Authorization':util[_0xff3f('0x47')](_0xff3f('0x4a'),new Buffer(_0x29df20)[_0xff3f('0x4b')]('base64'))},'json':!![]};rp(_0x4e52ff)[_0xff3f('0x19')](function(_0x30efd2){if(_0x30efd2['http_code']>=0xc8&&_0x30efd2[_0xff3f('0x4c')]<=0xce){if(_0x30efd2[_0xff3f('0x4d')]&&_0x30efd2[_0xff3f('0x4d')][_0xff3f('0x4e')]>0x0){var _0x17eca5=_['head'](_0x30efd2[_0xff3f('0x4d')][_0xff3f('0x25')]);var _0x1ee9a5={'messageId':_0x17eca5[_0xff3f('0x4f')]};if(!_0x2243f7[_0xff3f('0x3e')]){_0x1ee9a5['read']=!![];}return _0x27470a[_0xff3f('0x1a')](_0x1ee9a5);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xff3f('0x2c'),_0xff3f('0x50'),util[_0xff3f('0x2e')](_0x30efd2,{'showHidden':![],'depth':null}));}}else{logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),'clickSend',util[_0xff3f('0x2e')](_0x30efd2,{'showHidden':![],'depth':null}));}})['catch'](function(_0xf5adfc){logger['error'](_0xff3f('0x2f'),_0xff3f('0x2c'),_0xff3f('0x50'),util[_0xff3f('0x2e')](_0xf5adfc,{'showHidden':![],'depth':null}));});}else{logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),_0xff3f('0x50'),_0xff3f('0x40'));}break;case'plivo':if(_0x2243f7[_0xff3f('0x51')]&&_0x2243f7['authToken']){var _0x131f2e={'dst':_0x2b6618[_0xff3f('0x23')],'text':_0x2b6618['body'],'src':_0x2243f7[_0xff3f('0x42')]||_0x2243f7[_0xff3f('0x23')],'url':_0x2243f7[_0xff3f('0x52')]+_0xff3f('0x28')+_0x2b6618['id']+_0xff3f('0x29')+_0x2243f7[_0xff3f('0x2a')]};var _0x29df20=util['format'](_0xff3f('0x48'),_0x2243f7[_0xff3f('0x51')],_0x2243f7['authToken']);var _0x4e52ff={'method':'POST','uri':util[_0xff3f('0x47')](_0xff3f('0x53'),_0x2243f7[_0xff3f('0x51')]),'body':_0x131f2e,'headers':{'Authorization':util[_0xff3f('0x47')](_0xff3f('0x4a'),new Buffer(_0x29df20)[_0xff3f('0x4b')](_0xff3f('0x54')))},'json':!![]};rp(_0x4e52ff)[_0xff3f('0x19')](function(_0x4a4066){var _0x275cc5={'messageId':_0x4a4066[_0xff3f('0x55')][0x0]};return _0x27470a[_0xff3f('0x1a')](_0x275cc5);})[_0xff3f('0x1c')](function(_0x30d4d8){logger['error'](_0xff3f('0x2f'),_0xff3f('0x2c'),'plivo',util[_0xff3f('0x2e')](_0x30d4d8,{'showHidden':![],'depth':null}));});}else{logger[_0xff3f('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xff3f('0x2c'),_0xff3f('0x56'),_0xff3f('0x57'));}break;case'infobip':if(_0x2243f7['username']&&_0x2243f7[_0xff3f('0x33')]){if(_0x2243f7[_0xff3f('0x58')]){var _0x5471f3={'method':_0xff3f('0x3a'),'uri':_0x2243f7[_0xff3f('0x58')]+_0xff3f('0x59'),'body':{'username':_0x2243f7[_0xff3f('0x32')],'password':_0x2243f7[_0xff3f('0x33')]},'json':!![]};return rp(_0x5471f3)[_0xff3f('0x19')](function(_0x14f293){var _0x3ab012={'method':_0xff3f('0x3a'),'uri':_0x2243f7[_0xff3f('0x58')]+_0xff3f('0x5a'),'body':{'messages':[{'from':_0x2243f7[_0xff3f('0x23')],'destinations':[{'to':_0x2b6618['phone']}],'text':_0x2b6618['body'],'notifyUrl':_0x2243f7[_0xff3f('0x52')]+'/api/sms/messages/'+_0x2b6618['id']+_0xff3f('0x29')+_0x2243f7[_0xff3f('0x2a')],'notifyContentType':_0xff3f('0x5b'),'callbackData':_0x2243f7[_0xff3f('0x23')]+';'+_0x2b6618[_0xff3f('0x27')]}]},'headers':{'Authorization':_0xff3f('0x5c')+_0x14f293[_0xff3f('0x2a')]},'json':!![]};return rp(_0x3ab012)[_0xff3f('0x19')](function(_0x5c7671){if(_0x5c7671[_0xff3f('0x25')]){var _0x28ff4b={'messageId':_0x5c7671[_0xff3f('0x25')][0x0][_0xff3f('0xd')]};if(!_0x2243f7['deliveryReport']){_0x28ff4b['read']=!![];}return _0x27470a['update'](_0x28ff4b);}else{return logger[_0xff3f('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',util[_0xff3f('0x2e')](_0x5c7671,{'showHidden':![],'depth':null}));}});})['catch'](function(_0xd74efe){return logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),'infobip',util[_0xff3f('0x2e')](_0xd74efe,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xff3f('0x2f'),_0xff3f('0x2c'),_0xff3f('0x5d'),_0xff3f('0x5e'));}}else{logger['error'](_0xff3f('0x2f'),_0xff3f('0x2c'),_0xff3f('0x5d'),_0xff3f('0x40'));}break;case'csc':var _0x53a976=require(_0xff3f('0x5f'));if(_0x2243f7['apiKey']){var _0x49a295={};_0x49a295[_0xff3f('0x60')]=_0x2243f7[_0xff3f('0x32')];_0x49a295['phone']=_0x2b6618['phone'];_0x49a295[_0xff3f('0x35')]=_0x2243f7[_0xff3f('0x23')];_0x49a295[_0xff3f('0x61')]=_0x2b6618[_0xff3f('0x27')];_0x49a295[_0xff3f('0x62')]=+new Date();var _0x4be218='';var _0x3c4000='';var _0x255985=Object[_0xff3f('0x63')](_0x49a295);_0x255985[_0xff3f('0x64')]();for(var _0x2b3f7b=0x0;_0x2b3f7b<_0x255985[_0xff3f('0x65')];_0x2b3f7b++){if(_0x4be218!=''){_0x4be218+='&';}_0x4be218+=_0x255985[_0x2b3f7b]+'='+encodeURIComponent(_0x49a295[_0x255985[_0x2b3f7b]]);_0x3c4000+=_0x49a295[_0x255985[_0x2b3f7b]];}_0x3c4000+=_0x2243f7[_0xff3f('0x66')];_0x3c4000=_0x53a976[_0xff3f('0x67')](_0xff3f('0x68'))[_0xff3f('0x1a')](_0x3c4000)[_0xff3f('0x69')](_0xff3f('0x6a'));if(_0x4be218!==''){_0x4be218+='&';}_0x4be218+=_0xff3f('0x6b')+_0x3c4000;var _0x20381b={'method':_0xff3f('0x38'),'uri':_0x2243f7['baseUrl']+_0xff3f('0x6c')+_0x4be218,'json':!![]};return rp(_0x20381b)[_0xff3f('0x19')](function(_0x19ef8e){var _0xbd5004=Object[_0xff3f('0x63')](_0x19ef8e);if(_0x19ef8e[_0xbd5004[0x0]][_0xff3f('0x1d')]&&parseInt(_0x19ef8e[_0xbd5004[0x0]][_0xff3f('0x1d')])===0x0){var _0x5674e2={'messageId':_0x19ef8e[_0xbd5004[0x0]]['id_sms']};if(!_0x2243f7['deliveryReport']){_0x5674e2[_0xff3f('0x3f')]=!![];}return _0x27470a[_0xff3f('0x1a')](_0x5674e2);}else{return logger[_0xff3f('0x1d')](_0xff3f('0x2f'),'afterCreate',_0xff3f('0x6d'),util[_0xff3f('0x2e')](_0x19ef8e[_0xff3f('0x1d')],{'showHidden':![],'depth':null}));}})[_0xff3f('0x1c')](function(_0x4661a1){return logger[_0xff3f('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xff3f('0x2c'),_0xff3f('0x6d'),util[_0xff3f('0x2e')](_0x4661a1,{'showHidden':![],'depth':null}));});}else{logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),_0xff3f('0x6d'),_0xff3f('0x6e'));}break;case _0xff3f('0x6f'):if(_0x2243f7['apiKey']){var _0x19a002={'method':_0xff3f('0x3a'),'uri':_0xff3f('0x70'),'headers':{'Authorization':_0x2243f7[_0xff3f('0x66')]},'body':{'content':_0x2b6618['body'],'to':[_0x2b6618[_0xff3f('0x23')]],'from':_0x2243f7[_0xff3f('0x23')],'binary':![],'clientMessageId':_0xff3f('0x71'),'charset':'UTF-8'},'json':!![]};rp(_0x19a002)['then'](function(_0x3dd4ba){if(!_0x3dd4ba[_0xff3f('0x1d')]){var _0x1044e0={'messageId':_0x3dd4ba[_0xff3f('0x25')][0x0][_0xff3f('0x72')]};if(!_0x2243f7[_0xff3f('0x3e')]){_0x1044e0[_0xff3f('0x3f')]=!![];}return _0x27470a[_0xff3f('0x1a')](_0x1044e0);}else{return logger[_0xff3f('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xff3f('0x2c'),_0xff3f('0x6f'),util[_0xff3f('0x2e')](_0x3dd4ba['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0xacb295){return logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),'clickatell',util[_0xff3f('0x2e')](_0xacb295,{'showHidden':![],'depth':null}));});}else{logger[_0xff3f('0x1d')](_0xff3f('0x2f'),'afterCreate',_0xff3f('0x6f'),_0xff3f('0x6e'));}break;case _0xff3f('0x73'):if(_0x2243f7['username']&&_0x2243f7[_0xff3f('0x33')]){var _0x29df20=util[_0xff3f('0x47')]('%s:%s',_0x2243f7[_0xff3f('0x32')],_0x2243f7['password']);var _0x4e52ff={'method':_0xff3f('0x3a'),'uri':_0xff3f('0x74')+_0x2243f7[_0xff3f('0x75')]+_0xff3f('0x76'),'body':{'to':[_0x2b6618[_0xff3f('0x23')]],'text':_0x2b6618[_0xff3f('0x27')],'from':_0x2243f7['phone'],'applicationId':_0x2243f7[_0xff3f('0x77')]},'headers':{'Authorization':util[_0xff3f('0x47')]('Basic\x20%s',new Buffer(_0x29df20)[_0xff3f('0x4b')](_0xff3f('0x54')))},'json':!![]};rp(_0x4e52ff)['then'](function(_0x58f499){if(_0x58f499['id']){var _0x3a22e3={'messageId':_0x58f499['id']};return _0x27470a[_0xff3f('0x1a')](_0x3a22e3);}else{logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),_0xff3f('0x73'),util[_0xff3f('0x2e')](_0x58f499,{'showHidden':![],'depth':null}));}})['catch'](function(_0x25683e){logger[_0xff3f('0x1d')](_0xff3f('0x2f'),'afterCreate',_0xff3f('0x73'),util[_0xff3f('0x2e')](_0x25683e,{'showHidden':![],'depth':null}));});}else{logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xff3f('0x78'):if(_0x2243f7[_0xff3f('0x66')]){var _0x5981b0={};var _0x20381b={'method':_0xff3f('0x3a'),'uri':_0xff3f('0x79'),'headers':{'Authorization':_0xff3f('0x7a')+_0x2243f7[_0xff3f('0x66')],'Content-Type':_0xff3f('0x5b')},'body':{'from':_0x2243f7[_0xff3f('0x23')],'to':_0x2b6618[_0xff3f('0x23')],'text':_0x2b6618[_0xff3f('0x27')]},'json':!![]};return rp(_0x20381b)[_0xff3f('0x19')](function(_0x2f1df6){if(_0x2f1df6[_0xff3f('0x7b')]==0xca){_0x5981b0['message']=_0x2f1df6;var _0x200540={'method':_0xff3f('0x3a'),'uri':_0xff3f('0x7c'),'headers':{'Authorization':_0xff3f('0x7a')+_0x2243f7[_0xff3f('0x66')],'Content-Type':'application/json'},'body':{'refid':_0x5981b0['message'][_0xff3f('0x7d')]},'json':!![]};return rp(_0x200540)[_0xff3f('0x19')](function(_0x30716d){_0x5981b0[_0xff3f('0x7e')]=_0x30716d;var _0x5149d7={'messageId':_0x5981b0[_0xff3f('0x7f')]['refid'],'read':!![]};return _0x27470a[_0xff3f('0x1a')](_0x5149d7);});}else{return logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),'intelepeer',util['inspect'](_0x2f1df6,{'showHidden':![],'depth':null}));}})[_0xff3f('0x1c')](function(_0x342188){return logger[_0xff3f('0x1d')](_0xff3f('0x2f'),_0xff3f('0x2c'),_0xff3f('0x78'),util[_0xff3f('0x2e')](_0x342188,{'showHidden':![],'depth':null}));});}else{return logger[_0xff3f('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer','Token\x20not\x20received');}break;}}})[_0xff3f('0x80')](function(){_0x47a69d();});}else{_0x47a69d();}}},'charset':_0xff3f('0x81'),'collate':_0xff3f('0x82')});}; \ No newline at end of file +var _0xc999=['message','Bearer\x20','status','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','isNil','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','split','sms','POST','user_key','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','head','message_id','clickSend','plivo','authId','/status?token=','token','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','csc','crypto','login','sender','text','timestamp','keys','sort','createHash','md5','digest','signature=','GET','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','apiKey','https://platform.clickatell.com/messages','uuid','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','toString','bandwidth','code'];(function(_0x5e968c,_0x3d9d44){var _0x5a9fb3=function(_0x586a9f){while(--_0x586a9f){_0x5e968c['push'](_0x5e968c['shift']());}};_0x5a9fb3(++_0x3d9d44);}(_0xc999,0x184));var _0x9c99=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc999[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x9c99('0x0'));var util=require(_0x9c99('0x1'));var logger=require(_0x9c99('0x2'))(_0x9c99('0x3'));var moment=require(_0x9c99('0x4'));var BPromise=require(_0x9c99('0x5'));var rp=require(_0x9c99('0x6'));var fs=require('fs');var path=require(_0x9c99('0x7'));var rimraf=require(_0x9c99('0x8'));var config=require(_0x9c99('0x9'));var attributes=require(_0x9c99('0xa'));module['exports']=function(_0x1ebf73,_0x1f4e0a){return _0x1ebf73[_0x9c99('0xb')](_0x9c99('0xc'),attributes,{'tableName':_0x9c99('0xd'),'paranoid':![],'indexes':[{'name':_0x9c99('0xe'),'fields':[_0x9c99('0xe')]},{'name':_0x9c99('0xf'),'fields':[_0x9c99('0x10')],'type':_0x9c99('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x696ffe,_0x197294,_0x267e4e){var _0x2eb138=_0x1ebf73[_0x9c99('0x12')];var _0x46aa6c=_0x696ffe[_0x9c99('0x13')]({'plain':!![]});if(_0x46aa6c[_0x9c99('0x14')]['toLowerCase']()==='in'||_0x46aa6c['direction'][_0x9c99('0x15')]()===_0x9c99('0x16')&&!_0x46aa6c[_0x9c99('0x17')]&&!_['isNil'](_0x46aa6c[_0x9c99('0x18')])&&!_[_0x9c99('0x19')](_0x46aa6c[_0x9c99('0x1a')])){_0x2eb138[_0x9c99('0x1b')]['findOne']({'where':{'id':_0x46aa6c[_0x9c99('0x1a')]}})[_0x9c99('0x1c')](function(_0x10d263){if(_0x10d263){_0x10d263[_0x9c99('0x1d')]({'lastMsgAt':_0x46aa6c[_0x9c99('0x1e')],'lastMsgDirection':_0x46aa6c['direction'][_0x9c99('0x15')]()});}})[_0x9c99('0x1f')](function(_0x43a7b7){console[_0x9c99('0x20')](_0x43a7b7);});}if(_0x46aa6c['direction']===_0x9c99('0x16')&&!_0x46aa6c[_0x9c99('0x17')]){var _0x328825;_0x2eb138[_0x9c99('0x21')]['find']({'where':{'id':_0x46aa6c[_0x9c99('0x22')]},'raw':!![]})[_0x9c99('0x1c')](function(_0x5eb2ed){_0x328825=_0x5eb2ed;if(_0x328825&&_0x328825[_0x9c99('0x23')]){switch(_0x328825[_0x9c99('0x23')]){case _0x9c99('0x24'):var _0x186f13=require(_0x9c99('0x24'));if(_0x328825[_0x9c99('0x25')]&&_0x328825['authToken']&&_0x328825['phone']){var _0x3928e6=new _0x186f13(_0x328825[_0x9c99('0x25')],_0x328825[_0x9c99('0x26')]);_0x3928e6[_0x9c99('0x27')][_0x9c99('0x28')]({'body':_0x46aa6c['body'],'to':_0x46aa6c[_0x9c99('0x29')],'from':_0x328825[_0x9c99('0x29')],'statusCallback':_0x328825[_0x9c99('0x2a')]+_0x9c99('0x2b')+_0x46aa6c['id']+'/status?token='+_0x328825['token']})['then'](function(_0x2fffe1){if(_0x2fffe1[_0x9c99('0x2c')]){return _0x696ffe[_0x9c99('0x1d')]({'messageId':_0x2fffe1[_0x9c99('0x2c')]});}})[_0x9c99('0x1f')](function(_0x4c3abf){logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),'twilio',util[_0x9c99('0x2f')](_0x4c3abf,{'showHidden':![],'depth':null}));});}else{logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),'twilio',_0x9c99('0x30'));}break;case _0x9c99('0x31'):var _0x208d05=_0x9c99('0x32');if(_0x328825[_0x9c99('0x33')]&&_0x328825[_0x9c99('0x34')]){var _0x327379={'recipient':[_0x46aa6c[_0x9c99('0x29')]],'message':_0x46aa6c[_0x9c99('0x10')],'message_type':_0x328825['smsMethod']};if(_0x328825[_0x9c99('0x35')]&&_0x328825[_0x9c99('0x35')]!=='SI'){_0x327379['sender']=_0x328825[_0x9c99('0x29')];}var _0x345550={'url':_0x208d05+_0x9c99('0x36')+_0x328825[_0x9c99('0x33')]+_0x9c99('0x37')+_0x328825[_0x9c99('0x34')],'method':'GET'};rp(_0x345550)[_0x9c99('0x1c')](function(_0x5f56d7){var _0x2f2a32=_0x5f56d7[_0x9c99('0x38')](';');var _0x4a629f={'user_key':_0x2f2a32[0x0],'session_key':_0x2f2a32[0x1]};_0x345550={'url':_0x208d05+_0x9c99('0x39'),'method':_0x9c99('0x3a'),'headers':{'user_key':_0x4a629f[_0x9c99('0x3b')],'Session_key':_0x4a629f[_0x9c99('0x3c')]},'json':!![],'body':_0x327379};return rp(_0x345550);})[_0x9c99('0x1c')](function(_0x3b3aa5){if(_0x3b3aa5[_0x9c99('0x3d')]>=0x1){var _0x254472={'messageId':_0x3b3aa5['internal_order_id']};if(_0x328825['smsMethod']!=='GP'||!_0x328825[_0x9c99('0x3e')]){_0x254472[_0x9c99('0x3f')]=!![];}return _0x696ffe['update'](_0x254472);}else{return logger[_0x9c99('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x9c99('0x31'),util[_0x9c99('0x2f')](_0x3b3aa5,{'showHidden':![],'depth':null}));}})[_0x9c99('0x1f')](function(_0x1e0b41){return logger[_0x9c99('0x20')](_0x9c99('0x2d'),'afterCreate',_0x9c99('0x31'),util[_0x9c99('0x2f')](_0x1e0b41,{'showHidden':![],'depth':null}));});}else{logger[_0x9c99('0x20')](_0x9c99('0x2d'),'afterCreate','skebby',_0x9c99('0x40'));}break;case _0x9c99('0x41'):if(_0x328825['authToken']){var _0x14a475={'recipient':_0x46aa6c['phone'],'message':_0x46aa6c[_0x9c99('0x10')],'sender':_0x328825[_0x9c99('0x42')]||_0x328825[_0x9c99('0x29')],'authorization':_0x328825['authToken']};var _0x197294={'method':_0x9c99('0x3a'),'uri':_0x9c99('0x43'),'body':_0x14a475,'json':!![]};rp(_0x197294)[_0x9c99('0x1c')](function(_0x2a7b71){var _0x18901c={'messageId':_0x2a7b71[_0x9c99('0x44')]};if(!_0x328825[_0x9c99('0x3e')]){_0x18901c['read']=!![];}return _0x696ffe[_0x9c99('0x1d')](_0x18901c);})['catch'](function(_0x18c625){logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x41'),util[_0x9c99('0x2f')](_0x18c625,{'showHidden':![],'depth':null}));});}else{logger[_0x9c99('0x20')](_0x9c99('0x2d'),'afterCreate',_0x9c99('0x41'),_0x9c99('0x45'));}break;case _0x9c99('0x46'):if(_0x328825['username']&&_0x328825[_0x9c99('0x34')]){var _0x14a475={'messages':[{'source':_0x9c99('0x47'),'to':_0x46aa6c['phone'],'body':_0x46aa6c[_0x9c99('0x10')],'from':_0x328825[_0x9c99('0x42')]||_0x328825[_0x9c99('0x29')]}]};var _0x1df018=util[_0x9c99('0x48')]('%s:%s',_0x328825['username'],_0x328825['password']);var _0x197294={'method':_0x9c99('0x3a'),'uri':_0x9c99('0x49'),'body':_0x14a475,'headers':{'Authorization':util[_0x9c99('0x48')](_0x9c99('0x4a'),new Buffer(_0x1df018)['toString'](_0x9c99('0x4b')))},'json':!![]};rp(_0x197294)[_0x9c99('0x1c')](function(_0x303818){if(_0x303818['http_code']>=0xc8&&_0x303818[_0x9c99('0x4c')]<=0xce){if(_0x303818[_0x9c99('0x4d')]&&_0x303818['data']['queued_count']>0x0){var _0x5414b0=_[_0x9c99('0x4e')](_0x303818[_0x9c99('0x4d')][_0x9c99('0x27')]);var _0x18794e={'messageId':_0x5414b0[_0x9c99('0x4f')]};if(!_0x328825[_0x9c99('0x3e')]){_0x18794e[_0x9c99('0x3f')]=!![];}return _0x696ffe[_0x9c99('0x1d')](_0x18794e);}else{logger['error'](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x50'),util[_0x9c99('0x2f')](_0x303818,{'showHidden':![],'depth':null}));}}else{logger[_0x9c99('0x20')](_0x9c99('0x2d'),'afterCreate',_0x9c99('0x50'),util[_0x9c99('0x2f')](_0x303818,{'showHidden':![],'depth':null}));}})[_0x9c99('0x1f')](function(_0x1563f5){logger[_0x9c99('0x20')](_0x9c99('0x2d'),'afterCreate',_0x9c99('0x50'),util[_0x9c99('0x2f')](_0x1563f5,{'showHidden':![],'depth':null}));});}else{logger[_0x9c99('0x20')](_0x9c99('0x2d'),'afterCreate',_0x9c99('0x50'),_0x9c99('0x40'));}break;case _0x9c99('0x51'):if(_0x328825[_0x9c99('0x52')]&&_0x328825[_0x9c99('0x26')]){var _0x14a475={'dst':_0x46aa6c[_0x9c99('0x29')],'text':_0x46aa6c['body'],'src':_0x328825['senderString']||_0x328825[_0x9c99('0x29')],'url':_0x328825[_0x9c99('0x2a')]+'/api/sms/messages/'+_0x46aa6c['id']+_0x9c99('0x53')+_0x328825[_0x9c99('0x54')]};var _0x1df018=util[_0x9c99('0x48')](_0x9c99('0x55'),_0x328825[_0x9c99('0x52')],_0x328825[_0x9c99('0x26')]);var _0x197294={'method':_0x9c99('0x3a'),'uri':util['format'](_0x9c99('0x56'),_0x328825[_0x9c99('0x52')]),'body':_0x14a475,'headers':{'Authorization':util[_0x9c99('0x48')](_0x9c99('0x4a'),new Buffer(_0x1df018)['toString']('base64'))},'json':!![]};rp(_0x197294)[_0x9c99('0x1c')](function(_0xcea667){var _0x26dce6={'messageId':_0xcea667[_0x9c99('0x57')][0x0]};return _0x696ffe['update'](_0x26dce6);})[_0x9c99('0x1f')](function(_0x17d5be){logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x51'),util[_0x9c99('0x2f')](_0x17d5be,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9c99('0x2d'),_0x9c99('0x2e'),'plivo',_0x9c99('0x58'));}break;case'infobip':if(_0x328825[_0x9c99('0x33')]&&_0x328825['password']){if(_0x328825[_0x9c99('0x59')]){var _0x412f8e={'method':_0x9c99('0x3a'),'uri':_0x328825[_0x9c99('0x59')]+_0x9c99('0x5a'),'body':{'username':_0x328825[_0x9c99('0x33')],'password':_0x328825['password']},'json':!![]};return rp(_0x412f8e)[_0x9c99('0x1c')](function(_0x17c5a4){var _0x1296dd={'method':_0x9c99('0x3a'),'uri':_0x328825[_0x9c99('0x59')]+_0x9c99('0x5b'),'body':{'messages':[{'from':_0x328825[_0x9c99('0x29')],'destinations':[{'to':_0x46aa6c['phone']}],'text':_0x46aa6c[_0x9c99('0x10')],'notifyUrl':_0x328825[_0x9c99('0x2a')]+'/api/sms/messages/'+_0x46aa6c['id']+_0x9c99('0x53')+_0x328825[_0x9c99('0x54')],'notifyContentType':_0x9c99('0x5c'),'callbackData':_0x328825[_0x9c99('0x29')]+';'+_0x46aa6c['body']}]},'headers':{'Authorization':_0x9c99('0x5d')+_0x17c5a4[_0x9c99('0x54')]},'json':!![]};return rp(_0x1296dd)['then'](function(_0x4b8063){if(_0x4b8063['messages']){var _0x33c59d={'messageId':_0x4b8063['messages'][0x0]['messageId']};if(!_0x328825[_0x9c99('0x3e')]){_0x33c59d[_0x9c99('0x3f')]=!![];}return _0x696ffe[_0x9c99('0x1d')](_0x33c59d);}else{return logger[_0x9c99('0x20')](_0x9c99('0x2d'),'afterCreate',_0x9c99('0x5e'),util[_0x9c99('0x2f')](_0x4b8063,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2b5f94){return logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x5e'),util[_0x9c99('0x2f')](_0x2b5f94,{'showHidden':![],'depth':null}));});}else{logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x5e'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x9c99('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c99('0x2e'),_0x9c99('0x5e'),_0x9c99('0x40'));}break;case _0x9c99('0x5f'):var _0x42a2d2=require(_0x9c99('0x60'));if(_0x328825['apiKey']){var _0x4964d0={};_0x4964d0[_0x9c99('0x61')]=_0x328825[_0x9c99('0x33')];_0x4964d0[_0x9c99('0x29')]=_0x46aa6c[_0x9c99('0x29')];_0x4964d0[_0x9c99('0x62')]=_0x328825['phone'];_0x4964d0[_0x9c99('0x63')]=_0x46aa6c[_0x9c99('0x10')];_0x4964d0[_0x9c99('0x64')]=+new Date();var _0x551af8='';var _0x1d73cf='';var _0x5de2cc=Object[_0x9c99('0x65')](_0x4964d0);_0x5de2cc[_0x9c99('0x66')]();for(var _0x2dae70=0x0;_0x2dae70<_0x5de2cc['length'];_0x2dae70++){if(_0x551af8!=''){_0x551af8+='&';}_0x551af8+=_0x5de2cc[_0x2dae70]+'='+encodeURIComponent(_0x4964d0[_0x5de2cc[_0x2dae70]]);_0x1d73cf+=_0x4964d0[_0x5de2cc[_0x2dae70]];}_0x1d73cf+=_0x328825['apiKey'];_0x1d73cf=_0x42a2d2[_0x9c99('0x67')](_0x9c99('0x68'))[_0x9c99('0x1d')](_0x1d73cf)[_0x9c99('0x69')]('hex');if(_0x551af8!==''){_0x551af8+='&';}_0x551af8+=_0x9c99('0x6a')+_0x1d73cf;var _0x345550={'method':_0x9c99('0x6b'),'uri':_0x328825[_0x9c99('0x59')]+_0x9c99('0x6c')+_0x551af8,'json':!![]};return rp(_0x345550)['then'](function(_0x30f806){var _0x59ec9e=Object[_0x9c99('0x65')](_0x30f806);if(_0x30f806[_0x59ec9e[0x0]][_0x9c99('0x20')]&&parseInt(_0x30f806[_0x59ec9e[0x0]][_0x9c99('0x20')])===0x0){var _0x5bb2f8={'messageId':_0x30f806[_0x59ec9e[0x0]]['id_sms']};if(!_0x328825[_0x9c99('0x3e')]){_0x5bb2f8['read']=!![];}return _0x696ffe[_0x9c99('0x1d')](_0x5bb2f8);}else{return logger[_0x9c99('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9c99('0x2e'),_0x9c99('0x5f'),util[_0x9c99('0x2f')](_0x30f806[_0x9c99('0x20')],{'showHidden':![],'depth':null}));}})[_0x9c99('0x1f')](function(_0x38d940){return logger['error'](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x5f'),util[_0x9c99('0x2f')](_0x38d940,{'showHidden':![],'depth':null}));});}else{logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x5f'),_0x9c99('0x6d'));}break;case _0x9c99('0x6e'):if(_0x328825[_0x9c99('0x6f')]){var _0xd17ab4={'method':_0x9c99('0x3a'),'uri':_0x9c99('0x70'),'headers':{'Authorization':_0x328825[_0x9c99('0x6f')]},'body':{'content':_0x46aa6c['body'],'to':[_0x46aa6c[_0x9c99('0x29')]],'from':_0x328825['phone'],'binary':![],'clientMessageId':_0x9c99('0x71'),'charset':'UTF-8'},'json':!![]};rp(_0xd17ab4)[_0x9c99('0x1c')](function(_0x351c18){if(!_0x351c18['error']){var _0xf0f73e={'messageId':_0x351c18[_0x9c99('0x27')][0x0]['apiMessageId']};if(!_0x328825[_0x9c99('0x3e')]){_0xf0f73e[_0x9c99('0x3f')]=!![];}return _0x696ffe[_0x9c99('0x1d')](_0xf0f73e);}else{return logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x6e'),util[_0x9c99('0x2f')](_0x351c18[_0x9c99('0x20')],{'showHidden':![],'depth':null}));}})[_0x9c99('0x1f')](function(_0xaa540){return logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x6e'),util[_0x9c99('0x2f')](_0xaa540,{'showHidden':![],'depth':null}));});}else{logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),'clickatell',_0x9c99('0x6d'));}break;case'bandwidth':if(_0x328825[_0x9c99('0x33')]&&_0x328825['password']){var _0x1df018=util[_0x9c99('0x48')](_0x9c99('0x55'),_0x328825[_0x9c99('0x33')],_0x328825[_0x9c99('0x34')]);var _0x197294={'method':_0x9c99('0x3a'),'uri':_0x9c99('0x72')+_0x328825[_0x9c99('0x73')]+_0x9c99('0x74'),'body':{'to':[_0x46aa6c[_0x9c99('0x29')]],'text':_0x46aa6c['body'],'from':_0x328825[_0x9c99('0x29')],'applicationId':_0x328825['applicationId']},'headers':{'Authorization':util[_0x9c99('0x48')]('Basic\x20%s',new Buffer(_0x1df018)[_0x9c99('0x75')](_0x9c99('0x4b')))},'json':!![]};rp(_0x197294)[_0x9c99('0x1c')](function(_0x2cbea2){if(_0x2cbea2['id']){var _0x49d829={'messageId':_0x2cbea2['id']};return _0x696ffe['update'](_0x49d829);}else{logger[_0x9c99('0x20')](_0x9c99('0x2d'),'afterCreate',_0x9c99('0x76'),util[_0x9c99('0x2f')](_0x2cbea2,{'showHidden':![],'depth':null}));}})['catch'](function(_0x21df99){logger[_0x9c99('0x20')](_0x9c99('0x2d'),'afterCreate',_0x9c99('0x76'),util['inspect'](_0x21df99,{'showHidden':![],'depth':null}));});}else{logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x328825[_0x9c99('0x6f')]){var _0x2b6459={};var _0x345550={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x328825[_0x9c99('0x6f')],'Content-Type':_0x9c99('0x5c')},'body':{'from':_0x328825[_0x9c99('0x29')],'to':_0x46aa6c[_0x9c99('0x29')],'text':_0x46aa6c['body']},'json':!![]};return rp(_0x345550)['then'](function(_0x8eaf6b){if(_0x8eaf6b[_0x9c99('0x77')]==0xca){_0x2b6459[_0x9c99('0x78')]=_0x8eaf6b;var _0x7f9d3d={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x9c99('0x79')+_0x328825[_0x9c99('0x6f')],'Content-Type':_0x9c99('0x5c')},'body':{'refid':_0x2b6459['message']['refid']},'json':!![]};return rp(_0x7f9d3d)[_0x9c99('0x1c')](function(_0x579e2c){_0x2b6459[_0x9c99('0x7a')]=_0x579e2c;var _0x2e23eb={'messageId':_0x2b6459['message']['refid'],'read':!![]};return _0x696ffe['update'](_0x2e23eb);});}else{return logger[_0x9c99('0x20')](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x7b'),util['inspect'](_0x8eaf6b,{'showHidden':![],'depth':null}));}})[_0x9c99('0x1f')](function(_0x5e1187){return logger['error'](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x7b'),util['inspect'](_0x5e1187,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x9c99('0x2d'),_0x9c99('0x2e'),_0x9c99('0x7b'),_0x9c99('0x7c'));}break;}}})[_0x9c99('0x7d')](function(){_0x267e4e();});}else{_0x267e4e();}}},'charset':'utf8mb4','collate':_0x9c99('0x7e')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 9c20a1e..af3b164 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 _0x5f30=['request\x20sent','stringify','error','message','result','catch','create','body','options','CreateSmsMessage','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','debug'];(function(_0x5db4f8,_0x44ca9e){var _0x35393c=function(_0x18eac0){while(--_0x18eac0){_0x5db4f8['push'](_0x5db4f8['shift']());}};_0x35393c(++_0x44ca9e);}(_0x5f30,0x7a));var _0x05f3=function(_0x38d79,_0x3e6438){_0x38d79=_0x38d79-0x0;var _0x57c97e=_0x5f30[_0x38d79];return _0x57c97e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x05f3('0x0'));var rs=require(_0x05f3('0x1'));var fs=require('fs');var Redis=require(_0x05f3('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x05f3('0x3'));var logger=require('../../config/logger')(_0x05f3('0x4'));var config=require(_0x05f3('0x5'));var jayson=require(_0x05f3('0x6'));var client=jayson[_0x05f3('0x7')]['http']({'port':0x232a});config[_0x05f3('0x8')]=_[_0x05f3('0x9')](config[_0x05f3('0x8')],{'host':_0x05f3('0xa'),'port':0x18eb});var socket=require(_0x05f3('0xb'))(new Redis(config[_0x05f3('0x8')]));require(_0x05f3('0xc'))[_0x05f3('0xd')](socket);function respondWithRpcPromise(_0x4a9b8c,_0x517345,_0x13da0c){return new BPromise(function(_0x35df9d,_0x47215d){return client['request'](_0x4a9b8c,_0x13da0c)[_0x05f3('0xe')](function(_0x21b797){logger[_0x05f3('0xf')](_0x05f3('0x10'),_0x517345,'request\x20sent');logger[_0x05f3('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x517345,_0x05f3('0x12'),JSON[_0x05f3('0x13')](_0x21b797));if(_0x21b797[_0x05f3('0x14')]){if(_0x21b797[_0x05f3('0x14')]['code']===0x1f4){logger[_0x05f3('0x14')]('SmsMessage,\x20%s,\x20%s',_0x517345,_0x21b797[_0x05f3('0x14')][_0x05f3('0x15')]);return _0x47215d(_0x21b797[_0x05f3('0x14')]['message']);}logger[_0x05f3('0x14')](_0x05f3('0x10'),_0x517345,_0x21b797[_0x05f3('0x14')][_0x05f3('0x15')]);return _0x35df9d(_0x21b797[_0x05f3('0x14')][_0x05f3('0x15')]);}else{logger[_0x05f3('0xf')](_0x05f3('0x10'),_0x517345,_0x05f3('0x12'));_0x35df9d(_0x21b797[_0x05f3('0x16')][_0x05f3('0x15')]);}})[_0x05f3('0x17')](function(_0x21a28b){logger['error'](_0x05f3('0x10'),_0x517345,_0x21a28b);_0x47215d(_0x21a28b);});});}exports['CreateSmsMessage']=function(_0x21af00){var _0x1fcdc0=this;return new Promise(function(_0x21d3a4,_0x15b828){return db['SmsMessage'][_0x05f3('0x18')](_0x21af00[_0x05f3('0x19')],{'raw':_0x21af00[_0x05f3('0x1a')]?_0x21af00['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1ba608){logger[_0x05f3('0xf')](_0x05f3('0x1b'),_0x21af00);logger['debug'](_0x05f3('0x1b'),_0x21af00,JSON[_0x05f3('0x13')](_0x1ba608));_0x21d3a4(_0x1ba608);})[_0x05f3('0x17')](function(_0x467e73){logger[_0x05f3('0x14')](_0x05f3('0x1b'),_0x467e73[_0x05f3('0x15')],_0x21af00);_0x15b828(_0x1fcdc0['error'](0x1f4,_0x467e73[_0x05f3('0x15')]));});});}; \ No newline at end of file +var _0x876c=['defaults','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis'];(function(_0x5bbf93,_0x30dcbd){var _0x567242=function(_0x147709){while(--_0x147709){_0x5bbf93['push'](_0x5bbf93['shift']());}};_0x567242(++_0x30dcbd);}(_0x876c,0x1a2));var _0xc876=function(_0x450bcb,_0xc7a84d){_0x450bcb=_0x450bcb-0x0;var _0x48e4a4=_0x876c[_0x450bcb];return _0x48e4a4;};'use strict';var _=require('lodash');var util=require(_0xc876('0x0'));var moment=require(_0xc876('0x1'));var BPromise=require(_0xc876('0x2'));var rs=require(_0xc876('0x3'));var fs=require('fs');var Redis=require(_0xc876('0x4'));var db=require(_0xc876('0x5'))['db'];var utils=require(_0xc876('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc876('0x7'));var jayson=require(_0xc876('0x8'));var client=jayson[_0xc876('0x9')]['http']({'port':0x232a});config[_0xc876('0xa')]=_[_0xc876('0xb')](config[_0xc876('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc876('0xc'))(new Redis(config[_0xc876('0xa')]));require(_0xc876('0xd'))[_0xc876('0xe')](socket);function respondWithRpcPromise(_0x722134,_0x302cc7,_0x1cf03a){return new BPromise(function(_0x15fc6a,_0x50a260){return client[_0xc876('0xf')](_0x722134,_0x1cf03a)[_0xc876('0x10')](function(_0x3360a8){logger['info'](_0xc876('0x11'),_0x302cc7,_0xc876('0x12'));logger[_0xc876('0x13')](_0xc876('0x14'),_0x302cc7,_0xc876('0x12'),JSON['stringify'](_0x3360a8));if(_0x3360a8[_0xc876('0x15')]){if(_0x3360a8['error'][_0xc876('0x16')]===0x1f4){logger['error'](_0xc876('0x11'),_0x302cc7,_0x3360a8[_0xc876('0x15')][_0xc876('0x17')]);return _0x50a260(_0x3360a8['error']['message']);}logger[_0xc876('0x15')]('SmsMessage,\x20%s,\x20%s',_0x302cc7,_0x3360a8[_0xc876('0x15')][_0xc876('0x17')]);return _0x15fc6a(_0x3360a8[_0xc876('0x15')]['message']);}else{logger[_0xc876('0x18')](_0xc876('0x11'),_0x302cc7,_0xc876('0x12'));_0x15fc6a(_0x3360a8[_0xc876('0x19')][_0xc876('0x17')]);}})[_0xc876('0x1a')](function(_0x473e91){logger['error'](_0xc876('0x11'),_0x302cc7,_0x473e91);_0x50a260(_0x473e91);});});}exports[_0xc876('0x1b')]=function(_0x1c4f58){var _0x4d2aca=this;return new Promise(function(_0x44f6a9,_0x4d8fa2){return db[_0xc876('0x1c')]['create'](_0x1c4f58[_0xc876('0x1d')],{'raw':_0x1c4f58[_0xc876('0x1e')]?_0x1c4f58['options'][_0xc876('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x54696b){logger['info']('CreateSmsMessage',_0x1c4f58);logger[_0xc876('0x13')]('CreateSmsMessage',_0x1c4f58,JSON[_0xc876('0x20')](_0x54696b));_0x44f6a9(_0x54696b);})[_0xc876('0x1a')](function(_0x5a7701){logger[_0xc876('0x15')](_0xc876('0x1b'),_0x5a7701['message'],_0x1c4f58);_0x4d8fa2(_0x4d2aca[_0xc876('0x15')](0x1f4,_0x5a7701[_0xc876('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index a6f56cd..d66a44a 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 _0x2024=['register','smsMessage:','./smsMessage.events','remove','emit'];(function(_0x4d1c39,_0x18728a){var _0x515558=function(_0x5daf89){while(--_0x5daf89){_0x4d1c39['push'](_0x4d1c39['shift']());}};_0x515558(++_0x18728a);}(_0x2024,0x179));var _0x4202=function(_0x5047dc,_0x5d7710){_0x5047dc=_0x5047dc-0x0;var _0x2a150c=_0x2024[_0x5047dc];return _0x2a150c;};'use strict';var SmsMessageEvents=require(_0x4202('0x0'));var events=['save',_0x4202('0x1'),'update'];function createListener(_0x46ef81,_0x16203e){return function(_0x2da55a){_0x16203e[_0x4202('0x2')](_0x46ef81,_0x2da55a);};}function removeListener(_0x5dd088,_0x3a9a7f){return function(){SmsMessageEvents['removeListener'](_0x5dd088,_0x3a9a7f);};}exports[_0x4202('0x3')]=function(_0x18d49f){for(var _0x4c940e=0x0,_0x261a41=events['length'];_0x4c940e<_0x261a41;_0x4c940e++){var _0x4c57b1=events[_0x4c940e];var _0x1f2f4=createListener(_0x4202('0x4')+_0x4c57b1,_0x18d49f);SmsMessageEvents['on'](_0x4c57b1,_0x1f2f4);}}; \ No newline at end of file +var _0x7314=['remove','update','emit','removeListener','length','smsMessage:','./smsMessage.events','save'];(function(_0x42ab30,_0x5797fc){var _0x30aa0e=function(_0x4a19d4){while(--_0x4a19d4){_0x42ab30['push'](_0x42ab30['shift']());}};_0x30aa0e(++_0x5797fc);}(_0x7314,0x1b6));var _0x4731=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7314[_0x321bb2];return _0x9c12ed;};'use strict';var SmsMessageEvents=require(_0x4731('0x0'));var events=[_0x4731('0x1'),_0x4731('0x2'),_0x4731('0x3')];function createListener(_0x502aef,_0x2a2988){return function(_0x16c283){_0x2a2988[_0x4731('0x4')](_0x502aef,_0x16c283);};}function removeListener(_0xed7a5e,_0x61bebc){return function(){SmsMessageEvents[_0x4731('0x5')](_0xed7a5e,_0x61bebc);};}exports['register']=function(_0x5aa514){for(var _0x114c3a=0x0,_0x4861c7=events[_0x4731('0x6')];_0x114c3a<_0x4861c7;_0x114c3a++){var _0x4bd579=events[_0x114c3a];var _0x3c0ba3=createListener(_0x4731('0x7')+_0x4bd579,_0x5aa514);SmsMessageEvents['on'](_0x4bd579,_0x3c0ba3);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 06cfc4c..8d3c248 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 _0xb48c=['../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getTeams','getAgents','post','/:id/teams','addTeams','/:id/users','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb48c,0x1aa));var _0xcb48=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb48c[_0x3dd15e];return _0x231fd0;};'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('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcb48('0x6'));var config=require('../../config/environment');var controller=require(_0xcb48('0x7'));router[_0xcb48('0x8')]('/',auth[_0xcb48('0x9')](),controller[_0xcb48('0xa')]);router[_0xcb48('0x8')](_0xcb48('0xb'),auth[_0xcb48('0x9')](),controller[_0xcb48('0xc')]);router[_0xcb48('0x8')](_0xcb48('0xd'),auth['isAuthenticated'](),controller[_0xcb48('0xe')]);router[_0xcb48('0x8')](_0xcb48('0xf'),auth[_0xcb48('0x9')](),controller['getMembers']);router['get']('/:id/teams',auth[_0xcb48('0x9')](),controller[_0xcb48('0x10')]);router[_0xcb48('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xcb48('0x11')]);router[_0xcb48('0x12')]('/',auth[_0xcb48('0x9')](),controller['create']);router[_0xcb48('0x12')](_0xcb48('0x13'),auth[_0xcb48('0x9')](),controller[_0xcb48('0x14')]);router[_0xcb48('0x12')](_0xcb48('0x15'),auth[_0xcb48('0x9')](),controller['addAgents']);router['put'](_0xcb48('0xd'),auth[_0xcb48('0x9')](),controller[_0xcb48('0x16')]);router[_0xcb48('0x17')](_0xcb48('0xd'),auth[_0xcb48('0x9')](),controller[_0xcb48('0x18')]);router[_0xcb48('0x17')](_0xcb48('0x13'),auth[_0xcb48('0x9')](),controller[_0xcb48('0x19')]);router[_0xcb48('0x17')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xcb48('0x1a')]=router; \ No newline at end of file +var _0x45e9=['getTeams','/:id/users','getAgents','post','create','addAgents','put','update','/:id','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/members'];(function(_0x1d4d0c,_0x539918){var _0x4d7a91=function(_0xb45192){while(--_0xb45192){_0x1d4d0c['push'](_0x1d4d0c['shift']());}};_0x4d7a91(++_0x539918);}(_0x45e9,0x1be));var _0x945e=function(_0x148cec,_0xda5b36){_0x148cec=_0x148cec-0x0;var _0x285ee7=_0x45e9[_0x148cec];return _0x285ee7;};'use strict';var multer=require(_0x945e('0x0'));var util=require(_0x945e('0x1'));var path=require(_0x945e('0x2'));var timeout=require(_0x945e('0x3'));var express=require('express');var router=express[_0x945e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x945e('0x5'));var config=require(_0x945e('0x6'));var controller=require('./smsQueue.controller');router[_0x945e('0x7')]('/',auth[_0x945e('0x8')](),controller[_0x945e('0x9')]);router[_0x945e('0x7')]('/describe',auth[_0x945e('0x8')](),controller[_0x945e('0xa')]);router['get']('/:id',auth[_0x945e('0x8')](),controller[_0x945e('0xb')]);router[_0x945e('0x7')](_0x945e('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x945e('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0x945e('0xd')]);router['get'](_0x945e('0xe'),auth[_0x945e('0x8')](),controller[_0x945e('0xf')]);router[_0x945e('0x10')]('/',auth[_0x945e('0x8')](),controller[_0x945e('0x11')]);router[_0x945e('0x10')]('/:id/teams',auth[_0x945e('0x8')](),controller['addTeams']);router[_0x945e('0x10')](_0x945e('0xe'),auth[_0x945e('0x8')](),controller[_0x945e('0x12')]);router[_0x945e('0x13')]('/:id',auth[_0x945e('0x8')](),controller[_0x945e('0x14')]);router['delete'](_0x945e('0x15'),auth[_0x945e('0x8')](),controller[_0x945e('0x16')]);router[_0x945e('0x17')]('/:id/teams',auth[_0x945e('0x8')](),controller[_0x945e('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x945e('0x19')]);module[_0x945e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index fd4c943..417acad 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 _0x7316=['beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0x20c72d,_0x52fe1c){var _0xec7469=function(_0x236667){while(--_0x236667){_0x20c72d['push'](_0x20c72d['shift']());}};_0xec7469(++_0x52fe1c);}(_0x7316,0x139));var _0x6731=function(_0x143565,_0x54d887){_0x143565=_0x143565-0x0;var _0x4dc1d9=_0x7316[_0x143565];return _0x4dc1d9;};'use strict';var Sequelize=require(_0x6731('0x0'));module[_0x6731('0x1')]={'name':{'type':Sequelize[_0x6731('0x2')],'unique':_0x6731('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6731('0x2')]},'timeout':{'type':Sequelize[_0x6731('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x6731('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xa7be=['beepall','roundrobin','STRING','ENUM'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xa7be,0x122));var _0xea7b=function(_0x4921af,_0x437a66){_0x4921af=_0x4921af-0x0;var _0x36fe50=_0xa7be[_0x4921af];return _0x36fe50;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xea7b('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xea7b('0x1')]('rrmemory',_0xea7b('0x2'),_0xea7b('0x3'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 423876e..4fb48a7 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 _0x0ee6=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','./smsQueue.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','SmsQueue','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','keys','rawAttributes','find','create','user','SmsQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','findAll','User','findAndCountAll','UserId','smsPause','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Team','online','voicePause','interface','flatMap','sequelize','transaction','each','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ee6,0x106));var _0x60ee=function(_0x36728c,_0x2dcf8a){_0x36728c=_0x36728c-0x0;var _0x4d3b6c=_0x0ee6[_0x36728c];return _0x4d3b6c;};'use strict';var emlformat=require(_0x60ee('0x0'));var rimraf=require(_0x60ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x60ee('0x2'));var rp=require(_0x60ee('0x3'));var moment=require(_0x60ee('0x4'));var BPromise=require(_0x60ee('0x5'));var Mustache=require('mustache');var util=require(_0x60ee('0x6'));var path=require(_0x60ee('0x7'));var sox=require(_0x60ee('0x8'));var csv=require(_0x60ee('0x9'));var ejs=require(_0x60ee('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x60ee('0xb'));var crypto=require(_0x60ee('0xc'));var jsforce=require(_0x60ee('0xd'));var deskjs=require(_0x60ee('0xe'));var toCsv=require(_0x60ee('0x9'));var querystring=require(_0x60ee('0xf'));var Papa=require(_0x60ee('0x10'));var Redis=require(_0x60ee('0x11'));var authService=require(_0x60ee('0x12'));var qs=require(_0x60ee('0x13'));var as=require(_0x60ee('0x14'));var hardwareService=require(_0x60ee('0x15'));var logger=require(_0x60ee('0x16'))(_0x60ee('0x17'));var utils=require('../../config/utils');var config=require(_0x60ee('0x18'));var licenseUtil=require(_0x60ee('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x60ee('0x1a')](config[_0x60ee('0x1b')],{'host':_0x60ee('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x60ee('0x1d'))[_0x60ee('0x1e')](socket);function respondWithStatusCode(_0x47549c,_0x174fda){_0x174fda=_0x174fda||0xcc;return function(_0x21ca3b){if(_0x21ca3b){return _0x47549c[_0x60ee('0x1f')](_0x174fda);}return _0x47549c[_0x60ee('0x20')](_0x174fda)['end']();};}function respondWithResult(_0x4e0b7a,_0x44ee77){_0x44ee77=_0x44ee77||0xc8;return function(_0x5c23d9){if(_0x5c23d9){return _0x4e0b7a['status'](_0x44ee77)['json'](_0x5c23d9);}};}function respondWithFilteredResult(_0x11f4e8,_0x26f844){return function(_0x1ce021){if(_0x1ce021){var _0x1d5688=typeof _0x26f844[_0x60ee('0x21')]==='undefined'&&typeof _0x26f844[_0x60ee('0x22')]===_0x60ee('0x23');var _0x5d7f53=_0x1ce021[_0x60ee('0x24')];var _0x4416ba=_0x1d5688?0x0:_0x26f844['offset'];var _0x4c0574=_0x1d5688?_0x1ce021[_0x60ee('0x24')]:_0x26f844[_0x60ee('0x21')]+_0x26f844[_0x60ee('0x22')];var _0x42169d;if(_0x4c0574>=_0x5d7f53){_0x4c0574=_0x5d7f53;_0x42169d=0xc8;}else{_0x42169d=0xce;}_0x11f4e8[_0x60ee('0x20')](_0x42169d);return _0x11f4e8[_0x60ee('0x25')](_0x60ee('0x26'),_0x4416ba+'-'+_0x4c0574+'/'+_0x5d7f53)['json'](_0x1ce021);}return null;};}function patchUpdates(_0x392434){return function(_0x4ee3ce){try{jsonpatch[_0x60ee('0x27')](_0x4ee3ce,_0x392434,!![]);}catch(_0x519c88){return BPromise['reject'](_0x519c88);}return _0x4ee3ce[_0x60ee('0x28')]();};}function saveUpdates(_0x2d55ab,_0x137aa4){return function(_0x18d1c1){if(_0x18d1c1){return _0x18d1c1['update'](_0x2d55ab)[_0x60ee('0x29')](function(_0x5a075a){return _0x5a075a;});}return null;};}function removeEntity(_0x266318,_0x188557){return function(_0xb867da){if(_0xb867da){return _0xb867da[_0x60ee('0x2a')]()[_0x60ee('0x29')](function(){var _0x198246=_0xb867da[_0x60ee('0x2b')]({'plain':!![]});var _0x26ca0c='SmsQueues';return db[_0x60ee('0x2c')][_0x60ee('0x2a')]({'where':{'type':_0x26ca0c,'resourceId':_0x198246['id']}})['then'](function(){return _0xb867da;});})[_0x60ee('0x29')](function(){_0x266318[_0x60ee('0x20')](0xcc)[_0x60ee('0x2d')]();});}};}function handleEntityNotFound(_0x45c3e0,_0x29d09f){return function(_0x4c385e){if(!_0x4c385e){_0x45c3e0[_0x60ee('0x1f')](0x194);}return _0x4c385e;};}function handleError(_0x53e1d4,_0xb139b2){_0xb139b2=_0xb139b2||0x1f4;return function(_0x3c3658){logger['error'](_0x3c3658[_0x60ee('0x2e')]);if(_0x3c3658[_0x60ee('0x2f')]){delete _0x3c3658[_0x60ee('0x2f')];}_0x53e1d4[_0x60ee('0x20')](_0xb139b2)[_0x60ee('0x30')](_0x3c3658);};}exports[_0x60ee('0x31')]=function(_0xcbd5c0,_0x252488){var _0x44e604={},_0x179c78={},_0x43dbb0={'count':0x0,'rows':[]};var _0x407469=_[_0x60ee('0x32')](db[_0x60ee('0x33')]['rawAttributes'],function(_0x1ddf21){return{'name':_0x1ddf21[_0x60ee('0x34')],'type':_0x1ddf21['type'][_0x60ee('0x35')]};});_0x179c78[_0x60ee('0x36')]=_[_0x60ee('0x32')](_0x407469,_0x60ee('0x2f'));_0x179c78[_0x60ee('0x37')]=_['keys'](_0xcbd5c0[_0x60ee('0x37')]);_0x179c78[_0x60ee('0x38')]=_['intersection'](_0x179c78[_0x60ee('0x36')],_0x179c78['query']);_0x44e604[_0x60ee('0x39')]=_[_0x60ee('0x3a')](_0x179c78['model'],qs[_0x60ee('0x3b')](_0xcbd5c0['query'][_0x60ee('0x3b')]));_0x44e604[_0x60ee('0x39')]=_0x44e604['attributes'][_0x60ee('0x3c')]?_0x44e604[_0x60ee('0x39')]:_0x179c78[_0x60ee('0x36')];if(!_0xcbd5c0[_0x60ee('0x37')][_0x60ee('0x3d')](_0x60ee('0x3e'))){_0x44e604['limit']=qs[_0x60ee('0x22')](_0xcbd5c0[_0x60ee('0x37')][_0x60ee('0x22')]);_0x44e604['offset']=qs[_0x60ee('0x21')](_0xcbd5c0[_0x60ee('0x37')][_0x60ee('0x21')]);}_0x44e604[_0x60ee('0x3f')]=qs[_0x60ee('0x40')](_0xcbd5c0[_0x60ee('0x37')][_0x60ee('0x40')]);_0x44e604[_0x60ee('0x41')]=qs[_0x60ee('0x38')](_[_0x60ee('0x42')](_0xcbd5c0[_0x60ee('0x37')],_0x179c78[_0x60ee('0x38')]),_0x407469);if(_0xcbd5c0[_0x60ee('0x37')][_0x60ee('0x43')]){_0x44e604[_0x60ee('0x41')]=_[_0x60ee('0x44')](_0x44e604['where'],{'$or':_[_0x60ee('0x32')](_0x407469,function(_0x4033f1){if(_0x4033f1[_0x60ee('0x45')]!==_0x60ee('0x46')){var _0xfff04b={};_0xfff04b[_0x4033f1[_0x60ee('0x2f')]]={'$like':'%'+_0xcbd5c0[_0x60ee('0x37')]['filter']+'%'};return _0xfff04b;}})});}_0x44e604=_[_0x60ee('0x44')]({},_0x44e604,_0xcbd5c0[_0x60ee('0x47')]);var _0x3436fe={'where':_0x44e604[_0x60ee('0x41')]};return db['SmsQueue'][_0x60ee('0x24')](_0x3436fe)['then'](function(_0x215aa2){_0x43dbb0[_0x60ee('0x24')]=_0x215aa2;if(_0xcbd5c0['query'][_0x60ee('0x48')]){_0x44e604[_0x60ee('0x49')]=[{'all':!![]}];}return db[_0x60ee('0x33')]['findAll'](_0x44e604);})[_0x60ee('0x29')](function(_0x9d5e88){_0x43dbb0[_0x60ee('0x4a')]=_0x9d5e88;return _0x43dbb0;})[_0x60ee('0x29')](respondWithFilteredResult(_0x252488,_0x44e604))[_0x60ee('0x4b')](handleError(_0x252488,null));};exports['show']=function(_0xe9818c,_0x2a6645){var _0x2093a8={'raw':!![],'where':{'id':_0xe9818c[_0x60ee('0x4c')]['id']}},_0x365e7d={};_0x365e7d[_0x60ee('0x36')]=_[_0x60ee('0x4d')](db['SmsQueue'][_0x60ee('0x4e')]);_0x365e7d['query']=_['keys'](_0xe9818c['query']);_0x365e7d[_0x60ee('0x38')]=_[_0x60ee('0x3a')](_0x365e7d[_0x60ee('0x36')],_0x365e7d[_0x60ee('0x37')]);_0x2093a8[_0x60ee('0x39')]=_[_0x60ee('0x3a')](_0x365e7d[_0x60ee('0x36')],qs[_0x60ee('0x3b')](_0xe9818c['query'][_0x60ee('0x3b')]));_0x2093a8[_0x60ee('0x39')]=_0x2093a8[_0x60ee('0x39')][_0x60ee('0x3c')]?_0x2093a8['attributes']:_0x365e7d['model'];if(_0xe9818c[_0x60ee('0x37')][_0x60ee('0x48')]){_0x2093a8[_0x60ee('0x49')]=[{'all':!![]}];}_0x2093a8=_[_0x60ee('0x44')]({},_0x2093a8,_0xe9818c[_0x60ee('0x47')]);return db[_0x60ee('0x33')][_0x60ee('0x4f')](_0x2093a8)[_0x60ee('0x29')](handleEntityNotFound(_0x2a6645,null))[_0x60ee('0x29')](respondWithResult(_0x2a6645,null))[_0x60ee('0x4b')](handleError(_0x2a6645,null));};exports[_0x60ee('0x50')]=function(_0x9183ec,_0x36a9e7){return db[_0x60ee('0x33')][_0x60ee('0x50')](_0x9183ec['body'],{})['then'](function(_0x3846f2){var _0x35a5d6=_0x9183ec[_0x60ee('0x51')][_0x60ee('0x2b')]({'plain':!![]});if(!_0x35a5d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35a5d6['role']===_0x60ee('0x51')){var _0x16e008=_0x3846f2[_0x60ee('0x2b')]({'plain':!![]});var _0x2ef95f=_0x60ee('0x52');return db[_0x60ee('0x53')]['find']({'where':{'name':_0x2ef95f,'userProfileId':_0x35a5d6[_0x60ee('0x54')]},'raw':!![]})['then'](function(_0x3f98bf){if(_0x3f98bf&&_0x3f98bf[_0x60ee('0x55')]===0x0){return db[_0x60ee('0x2c')][_0x60ee('0x50')]({'name':_0x16e008[_0x60ee('0x2f')],'resourceId':_0x16e008['id'],'type':_0x3f98bf['name'],'sectionId':_0x3f98bf['id']},{})[_0x60ee('0x29')](function(){return _0x3846f2;});}else{return _0x3846f2;}})[_0x60ee('0x4b')](function(_0x29a3e7){logger[_0x60ee('0x56')](_0x60ee('0x57'),_0x29a3e7);throw _0x29a3e7;});}return _0x3846f2;})[_0x60ee('0x29')](respondWithResult(_0x36a9e7,0xc9))[_0x60ee('0x4b')](handleError(_0x36a9e7,null));};exports[_0x60ee('0x58')]=function(_0x2d4e02,_0x5f1072){if(_0x2d4e02[_0x60ee('0x59')]['id']){delete _0x2d4e02['body']['id'];}return db[_0x60ee('0x33')][_0x60ee('0x4f')]({'where':{'id':_0x2d4e02['params']['id']}})['then'](handleEntityNotFound(_0x5f1072,null))[_0x60ee('0x29')](saveUpdates(_0x2d4e02['body'],null))['then'](respondWithResult(_0x5f1072,null))[_0x60ee('0x4b')](handleError(_0x5f1072,null));};exports[_0x60ee('0x2a')]=function(_0x1e23a9,_0x2fdcd1){return db[_0x60ee('0x33')][_0x60ee('0x4f')]({'where':{'id':_0x1e23a9[_0x60ee('0x4c')]['id']}})[_0x60ee('0x29')](handleEntityNotFound(_0x2fdcd1,null))[_0x60ee('0x29')](removeEntity(_0x2fdcd1,null))['catch'](handleError(_0x2fdcd1,null));};exports[_0x60ee('0x5a')]=function(_0x3fe753,_0x2a5aa2){return db['SmsQueue']['describe']()['then'](respondWithResult(_0x2a5aa2,null))[_0x60ee('0x4b')](handleError(_0x2a5aa2,null));};exports[_0x60ee('0x5b')]=function(_0x5d6738,_0x4d5a1e,_0x194c83){var _0x561ced={'raw':!![],'where':{}},_0xf41b6c={},_0x3d2f53;return db[_0x60ee('0x33')][_0x60ee('0x5c')]({'where':{'id':_0x5d6738['params']['id']}})['then'](handleEntityNotFound(_0x4d5a1e,null))[_0x60ee('0x29')](function(_0x174f69){if(_0x174f69){_0x3d2f53=_0x174f69['get']({'plain':!![]});_0xf41b6c[_0x60ee('0x36')]=_[_0x60ee('0x4d')](db[_0x60ee('0x5d')][_0x60ee('0x4e')]);_0xf41b6c[_0x60ee('0x37')]=_[_0x60ee('0x4d')](_0x5d6738[_0x60ee('0x37')]);_0xf41b6c[_0x60ee('0x38')]=_[_0x60ee('0x3a')](_0xf41b6c[_0x60ee('0x36')],_0xf41b6c['query']);_0x561ced[_0x60ee('0x39')]=_[_0x60ee('0x3a')](_0xf41b6c['model'],qs[_0x60ee('0x3b')](_0x5d6738['query'][_0x60ee('0x3b')]));_0x561ced[_0x60ee('0x39')]=_0x561ced[_0x60ee('0x39')][_0x60ee('0x3c')]?_0x561ced[_0x60ee('0x39')]:_0xf41b6c[_0x60ee('0x36')];if(!_0x5d6738[_0x60ee('0x37')][_0x60ee('0x3d')](_0x60ee('0x3e'))){_0x561ced['limit']=qs['limit'](_0x5d6738[_0x60ee('0x37')][_0x60ee('0x22')]);_0x561ced[_0x60ee('0x21')]=qs[_0x60ee('0x21')](_0x5d6738['query']['offset']);}_0x561ced[_0x60ee('0x3f')]=qs[_0x60ee('0x40')](_0x5d6738[_0x60ee('0x37')][_0x60ee('0x40')]);_0x561ced[_0x60ee('0x41')]=qs[_0x60ee('0x38')](_[_0x60ee('0x42')](_0x5d6738[_0x60ee('0x37')],_0xf41b6c[_0x60ee('0x38')]));_0x561ced['where'][_0x60ee('0x5e')]=_0x174f69['id'];if(_0x5d6738[_0x60ee('0x37')][_0x60ee('0x43')]){_0x561ced['where']=_[_0x60ee('0x44')](_0x561ced[_0x60ee('0x41')],{'$or':_[_0x60ee('0x32')](_0x561ced['attributes'],function(_0x1efc6a){var _0x2cce8f={};_0x2cce8f[_0x1efc6a]={'$like':'%'+_0x5d6738[_0x60ee('0x37')][_0x60ee('0x43')]+'%'};return _0x2cce8f;})});}_0x561ced=_[_0x60ee('0x44')]({},_0x561ced,_0x5d6738['options']);return db[_0x60ee('0x5d')][_0x60ee('0x5f')](_0x561ced);}})[_0x60ee('0x29')](function(_0x3ba1d1){if(_0x3ba1d1){return db[_0x60ee('0x60')][_0x60ee('0x61')]({'where':{'id':_[_0x60ee('0x32')](_0x3ba1d1,_0x60ee('0x62')),'role':'agent'},'attributes':['id',_0x60ee('0x2f'),_0x60ee('0x63'),'updatedAt','createdAt']});}})[_0x60ee('0x29')](function(_0x664611){if(_0x664611){return{'count':_0x664611['count'],'rows':_[_0x60ee('0x32')](_0x664611[_0x60ee('0x4a')],function(_0x699368){return{'membername':_0x699368[_0x60ee('0x2f')],'UserId':_0x699368['id'],'queue_name':_0x3d2f53[_0x60ee('0x2f')],'SmsQueueId':_0x3d2f53['id'],'interface':util['format'](_0x60ee('0x64'),_0x60ee('0x65'),_0x699368[_0x60ee('0x2f')]),'penalty':0x0,'paused':_0x699368[_0x60ee('0x63')],'createdAt':_0x699368[_0x60ee('0x66')],'updatedAt':_0x699368['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x60ee('0x29')](respondWithFilteredResult(_0x4d5a1e,_0x561ced))[_0x60ee('0x4b')](handleError(_0x4d5a1e,null));};exports[_0x60ee('0x67')]=function(_0x35d549,_0x12890e,_0x1769ab){var _0x337eb6={};var _0x38d573={};var _0x5aefcf;var _0x18f61d;return db['SmsQueue'][_0x60ee('0x5c')]({'where':{'id':_0x35d549[_0x60ee('0x4c')]['id']}})['then'](handleEntityNotFound(_0x12890e,null))[_0x60ee('0x29')](function(_0x487e87){if(_0x487e87){_0x5aefcf=_0x487e87;_0x38d573[_0x60ee('0x36')]=_[_0x60ee('0x4d')](db['Team']['rawAttributes']);_0x38d573[_0x60ee('0x37')]=_[_0x60ee('0x4d')](_0x35d549[_0x60ee('0x37')]);_0x38d573[_0x60ee('0x38')]=_[_0x60ee('0x3a')](_0x38d573['model'],_0x38d573[_0x60ee('0x37')]);_0x337eb6[_0x60ee('0x39')]=_[_0x60ee('0x3a')](_0x38d573[_0x60ee('0x36')],qs[_0x60ee('0x3b')](_0x35d549[_0x60ee('0x37')]['fields']));_0x337eb6[_0x60ee('0x39')]=_0x337eb6[_0x60ee('0x39')][_0x60ee('0x3c')]?_0x337eb6['attributes']:_0x38d573[_0x60ee('0x36')];_0x337eb6[_0x60ee('0x3f')]=qs[_0x60ee('0x40')](_0x35d549[_0x60ee('0x37')][_0x60ee('0x40')]);_0x337eb6[_0x60ee('0x41')]=qs[_0x60ee('0x38')](_[_0x60ee('0x42')](_0x35d549[_0x60ee('0x37')],_0x38d573[_0x60ee('0x38')]));if(_0x35d549[_0x60ee('0x37')][_0x60ee('0x43')]){_0x337eb6['where']=_[_0x60ee('0x44')](_0x337eb6[_0x60ee('0x41')],{'$or':_['map'](_0x337eb6[_0x60ee('0x39')],function(_0x1e3df3){var _0xc40247={};_0xc40247[_0x1e3df3]={'$like':'%'+_0x35d549['query']['filter']+'%'};return _0xc40247;})});}_0x337eb6=_[_0x60ee('0x44')]({},_0x337eb6,_0x35d549[_0x60ee('0x47')]);return _0x5aefcf[_0x60ee('0x67')](_0x337eb6);}})[_0x60ee('0x29')](function(_0x58b082){if(_0x58b082){_0x18f61d=_0x58b082[_0x60ee('0x3c')];if(!_0x35d549['query'][_0x60ee('0x3d')](_0x60ee('0x3e'))){_0x337eb6[_0x60ee('0x22')]=qs['limit'](_0x35d549[_0x60ee('0x37')][_0x60ee('0x22')]);_0x337eb6[_0x60ee('0x21')]=qs[_0x60ee('0x21')](_0x35d549[_0x60ee('0x37')]['offset']);}return _0x5aefcf[_0x60ee('0x67')](_0x337eb6);}})[_0x60ee('0x29')](function(_0x550470){if(_0x550470){return _0x550470?{'count':_0x18f61d,'rows':_0x550470}:null;}})[_0x60ee('0x29')](respondWithResult(_0x12890e,null))['catch'](handleError(_0x12890e,null));};exports[_0x60ee('0x68')]=function(_0x47d80d,_0x36bb52,_0x4a04d8){var _0x1627fa=_0x47d80d['body'][_0x60ee('0x69')];return db[_0x60ee('0x6a')][_0x60ee('0x5f')]({'where':{'id':_0x1627fa},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x60ee('0x2f'),_0x60ee('0x6b'),_0x60ee('0x6c'),_0x60ee('0x6d')],'raw':!![]}]})[_0x60ee('0x29')](function(_0x2b3238){if(_0x2b3238){var _0x23395d=_[_0x60ee('0x6e')](_0x2b3238,function(_0x35baae){var _0x3518c2=_0x35baae[_0x60ee('0x2b')]({'plain':!![]});return _0x3518c2['Agents'];});return db['SmsQueue'][_0x60ee('0x4f')]({'where':{'id':_0x47d80d[_0x60ee('0x4c')]['id']}})[_0x60ee('0x29')](function(_0x397e87){return db[_0x60ee('0x6f')][_0x60ee('0x70')](function(_0x1ded1d){return _0x397e87[_0x60ee('0x68')](_0x1627fa,{'transaction':_0x1ded1d})['then'](function(){return BPromise[_0x60ee('0x71')](_0x23395d,function(_0x2c9ab9){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x2c9ab9['id'],'SmsQueueId':_0x47d80d['params']['id']},'transaction':_0x1ded1d});});})[_0x60ee('0x29')](function(){_0x23395d['forEach'](function(_0x2180f9){socket[_0x60ee('0x72')](_0x60ee('0x73'),{'UserId':_0x2180f9['id'],'SmsQueueId':_0x397e87['id']});});});});});}})[_0x60ee('0x29')](respondWithStatusCode(_0x36bb52,null))[_0x60ee('0x4b')](handleError(_0x36bb52,null));};exports[_0x60ee('0x74')]=function(_0x2a323c,_0xce2a36,_0x574ed6){return db[_0x60ee('0x6a')][_0x60ee('0x5f')]({'where':{'id':_0x2a323c[_0x60ee('0x37')][_0x60ee('0x69')]},'attributes':['id'],'include':[{'model':db[_0x60ee('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x60ee('0x29')](handleEntityNotFound(_0xce2a36,null))[_0x60ee('0x29')](function(_0x54b539){var _0x3f6d74=_[_0x60ee('0x32')](_0x54b539,'id');var _0x13ddd9=[];var _0xdee7c9=[];var _0xa9e2ba=squel[_0x60ee('0x75')]();_0xa9e2ba['field'](_0x60ee('0x76'))[_0x60ee('0x77')]('team_has_sms_queues','tq')['join'](_0x60ee('0x78'),'ut',_0x60ee('0x79'))[_0x60ee('0x41')](_0x60ee('0x7a'),_0x2a323c[_0x60ee('0x4c')]['id']);for(var _0x4199c1=0x0;_0x4199c1<_0x54b539[_0x60ee('0x3c')];_0x4199c1+=0x1){let _0x503500=_0x54b539[_0x4199c1];for(var _0x13c318=0x0;_0x13c318<_0x503500[_0x60ee('0x7b')][_0x60ee('0x3c')];_0x13c318+=0x1){let _0x28b16f=_0x503500[_0x60ee('0x7b')][_0x13c318];var _0x3ec30b=_0xa9e2ba[_0x60ee('0x7c')]();_0x3ec30b[_0x60ee('0x41')](_0x60ee('0x7d'),_0x28b16f['id']);_0xdee7c9['push'](db[_0x60ee('0x6f')][_0x60ee('0x37')](_0x3ec30b['toString'](),{'type':db[_0x60ee('0x6f')]['QueryTypes'][_0x60ee('0x7e')]})[_0x60ee('0x29')](function(_0xa633cf){if(_0xa633cf['length']===0x1){return _0x28b16f['id'];}else{var _0x43b7b6=_[_0x60ee('0x7f')](_[_0x60ee('0x32')](_0xa633cf,_0x60ee('0x80')),function(_0x2ef46f){return _[_0x60ee('0x81')](_0x3f6d74,_0x2ef46f);});if(_0x43b7b6){return _0x28b16f['id'];}}}));}}return BPromise['all'](_0xdee7c9)[_0x60ee('0x29')](function(_0x169be7){_0x13ddd9=_(_0x13ddd9)[_0x60ee('0x82')](_0x169be7)[_0x60ee('0x83')]()[_0x60ee('0x84')]();return db[_0x60ee('0x33')][_0x60ee('0x4f')]({'where':{'id':_0x2a323c[_0x60ee('0x4c')]['id']}})[_0x60ee('0x29')](function(_0x304604){return db[_0x60ee('0x6f')][_0x60ee('0x70')](function(_0x4b1f2d){return _0x304604[_0x60ee('0x74')](_0x2a323c['query'][_0x60ee('0x69')],{'transaction':_0x4b1f2d})[_0x60ee('0x29')](function(){if(!_[_0x60ee('0x85')](_0x13ddd9)){return _0x304604[_0x60ee('0x86')](_0x13ddd9,{'transaction':_0x4b1f2d});}})[_0x60ee('0x29')](function(){_0x13ddd9[_0x60ee('0x87')](function(_0x4ae3dd){socket[_0x60ee('0x72')](_0x60ee('0x88'),{'UserId':_0x4ae3dd,'SmsQueueId':_0x304604['id']});});});});});});})['then'](respondWithStatusCode(_0xce2a36,null))[_0x60ee('0x4b')](handleError(_0xce2a36,null));};exports[_0x60ee('0x89')]=function(_0x3ad2bd,_0x4092f2,_0xfebd05){return db[_0x60ee('0x33')][_0x60ee('0x4f')]({'where':{'id':_0x3ad2bd[_0x60ee('0x4c')]['id']}})[_0x60ee('0x29')](handleEntityNotFound(_0x4092f2,null))[_0x60ee('0x29')](function(_0x286305){if(_0x286305){return _0x286305[_0x60ee('0x89')](_0x3ad2bd[_0x60ee('0x59')][_0x60ee('0x69')],_[_0x60ee('0x8a')](_0x3ad2bd[_0x60ee('0x59')],[_0x60ee('0x69'),'id'])||{})['spread'](function(_0x264be9){for(var _0x3875db=0x0;_0x3875db<_0x3ad2bd[_0x60ee('0x59')][_0x60ee('0x69')][_0x60ee('0x3c')];_0x3875db+=0x1){socket[_0x60ee('0x72')]('userSmsQueue:save',{'UserId':Number(_0x3ad2bd['body'][_0x60ee('0x69')][_0x3875db]),'SmsQueueId':Number(_0x3ad2bd[_0x60ee('0x4c')]['id'])});}return _0x264be9;});}})[_0x60ee('0x29')](respondWithResult(_0x4092f2,null))[_0x60ee('0x4b')](handleError(_0x4092f2,null));};exports[_0x60ee('0x86')]=function(_0x2124ea,_0xf0217,_0x47dc61){return db[_0x60ee('0x33')][_0x60ee('0x4f')]({'where':{'id':_0x2124ea['params']['id']}})['then'](handleEntityNotFound(_0xf0217,null))[_0x60ee('0x29')](function(_0x16bf48){if(_0x16bf48){return _0x16bf48[_0x60ee('0x86')](_0x2124ea[_0x60ee('0x37')][_0x60ee('0x69')])[_0x60ee('0x29')](function(){if(_[_0x60ee('0x8b')](_0x2124ea[_0x60ee('0x37')][_0x60ee('0x69')])){for(var _0x5a87eb=0x0;_0x5a87eb<_0x2124ea['query'][_0x60ee('0x69')][_0x60ee('0x3c')];_0x5a87eb+=0x1){socket[_0x60ee('0x72')]('userSmsQueue:remove',{'UserId':Number(_0x2124ea[_0x60ee('0x37')][_0x60ee('0x69')][_0x5a87eb]),'SmsQueueId':Number(_0x2124ea[_0x60ee('0x4c')]['id'])});}}else{socket['emit'](_0x60ee('0x88'),{'UserId':Number(_0x2124ea[_0x60ee('0x37')][_0x60ee('0x69')]),'SmsQueueId':Number(_0x2124ea[_0x60ee('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0xf0217,null))[_0x60ee('0x4b')](handleError(_0xf0217,null));};exports['getAgents']=function(_0xd06c6c,_0x210410,_0x44adcb){var _0x5bb647={};var _0xdc8ab1={};var _0x1340ea;var _0x5c8e0a;return db[_0x60ee('0x33')][_0x60ee('0x5c')]({'where':{'id':_0xd06c6c[_0x60ee('0x4c')]['id']}})['then'](handleEntityNotFound(_0x210410,null))[_0x60ee('0x29')](function(_0x49acdf){if(_0x49acdf){_0x1340ea=_0x49acdf;_0xdc8ab1[_0x60ee('0x36')]=_['keys'](db[_0x60ee('0x60')][_0x60ee('0x4e')]);_0xdc8ab1['query']=_[_0x60ee('0x4d')](_0xd06c6c[_0x60ee('0x37')]);_0xdc8ab1[_0x60ee('0x38')]=_[_0x60ee('0x3a')](_0xdc8ab1['model'],_0xdc8ab1[_0x60ee('0x37')]);_0x5bb647[_0x60ee('0x39')]=_['intersection'](_0xdc8ab1[_0x60ee('0x36')],qs[_0x60ee('0x3b')](_0xd06c6c['query'][_0x60ee('0x3b')]));_0x5bb647[_0x60ee('0x39')]=_0x5bb647[_0x60ee('0x39')][_0x60ee('0x3c')]?_0x5bb647[_0x60ee('0x39')]:_0xdc8ab1[_0x60ee('0x36')];_0x5bb647[_0x60ee('0x3f')]=qs[_0x60ee('0x40')](_0xd06c6c[_0x60ee('0x37')]['sort']);_0x5bb647['where']=qs[_0x60ee('0x38')](_[_0x60ee('0x42')](_0xd06c6c[_0x60ee('0x37')],_0xdc8ab1[_0x60ee('0x38')]));if(_0xd06c6c[_0x60ee('0x37')][_0x60ee('0x43')]){_0x5bb647['where']=_[_0x60ee('0x44')](_0x5bb647[_0x60ee('0x41')],{'$or':_['map'](_0x5bb647['attributes'],function(_0x5a355a){var _0x36132a={};_0x36132a[_0x5a355a]={'$like':'%'+_0xd06c6c[_0x60ee('0x37')]['filter']+'%'};return _0x36132a;})});}_0x5bb647=_[_0x60ee('0x44')]({},_0x5bb647,_0xd06c6c[_0x60ee('0x47')]);return _0x1340ea['getAgents'](_0x5bb647);}})['then'](function(_0x56470a){if(_0x56470a){_0x5c8e0a=_0x56470a[_0x60ee('0x3c')];if(!_0xd06c6c[_0x60ee('0x37')][_0x60ee('0x3d')](_0x60ee('0x3e'))){_0x5bb647[_0x60ee('0x22')]=qs[_0x60ee('0x22')](_0xd06c6c[_0x60ee('0x37')][_0x60ee('0x22')]);_0x5bb647[_0x60ee('0x21')]=qs[_0x60ee('0x21')](_0xd06c6c['query'][_0x60ee('0x21')]);}return _0x1340ea[_0x60ee('0x8c')](_0x5bb647);}})[_0x60ee('0x29')](function(_0x43e8f2){if(_0x43e8f2){return _0x43e8f2?{'count':_0x5c8e0a,'rows':_0x43e8f2}:null;}})[_0x60ee('0x29')](respondWithResult(_0x210410,null))['catch'](handleError(_0x210410,null));}; \ No newline at end of file +var _0x2fa5=['User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','SIP','getTeams','Team','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','removeTeams','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','ids','emit','userSmsQueue:remove','addAgents','omit','userSmsQueue:save','removeAgents','isArray','getAgents','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','./smsQueue.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','SmsQueues','UserProfileResource','destroy','end','sendStatus','error','name','send','index','map','SmsQueue','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','include','rows','rawAttributes','includeAll','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserSmsQueue','sort','SmsQueueId','findAll'];(function(_0x3366ea,_0xccbc6c){var _0x2d2fb9=function(_0x37cd61){while(--_0x37cd61){_0x3366ea['push'](_0x3366ea['shift']());}};_0x2d2fb9(++_0xccbc6c);}(_0x2fa5,0x1c4));var _0x52fa=function(_0x57c43c,_0x276606){_0x57c43c=_0x57c43c-0x0;var _0x69ff99=_0x2fa5[_0x57c43c];return _0x69ff99;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x52fa('0x0'));var rp=require('request-promise');var moment=require(_0x52fa('0x1'));var BPromise=require(_0x52fa('0x2'));var Mustache=require('mustache');var util=require(_0x52fa('0x3'));var path=require(_0x52fa('0x4'));var sox=require(_0x52fa('0x5'));var csv=require(_0x52fa('0x6'));var ejs=require(_0x52fa('0x7'));var fs=require('fs');var fs_extra=require(_0x52fa('0x8'));var _=require(_0x52fa('0x9'));var squel=require(_0x52fa('0xa'));var crypto=require('crypto');var jsforce=require(_0x52fa('0xb'));var deskjs=require(_0x52fa('0xc'));var toCsv=require(_0x52fa('0x6'));var querystring=require('querystring');var Papa=require(_0x52fa('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x52fa('0xe'));var hardwareService=require(_0x52fa('0xf'));var logger=require(_0x52fa('0x10'))(_0x52fa('0x11'));var utils=require(_0x52fa('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x52fa('0x13'))['db'];config[_0x52fa('0x14')]=_[_0x52fa('0x15')](config[_0x52fa('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x52fa('0x14')]));require(_0x52fa('0x16'))[_0x52fa('0x17')](socket);function respondWithStatusCode(_0xa96246,_0x35419c){_0x35419c=_0x35419c||0xcc;return function(_0x53f590){if(_0x53f590){return _0xa96246['sendStatus'](_0x35419c);}return _0xa96246[_0x52fa('0x18')](_0x35419c)['end']();};}function respondWithResult(_0x146f85,_0x31f25c){_0x31f25c=_0x31f25c||0xc8;return function(_0x4233cb){if(_0x4233cb){return _0x146f85[_0x52fa('0x18')](_0x31f25c)[_0x52fa('0x19')](_0x4233cb);}};}function respondWithFilteredResult(_0x19a692,_0x1fed8b){return function(_0x23033d){if(_0x23033d){var _0x3dc190=typeof _0x1fed8b['offset']===_0x52fa('0x1a')&&typeof _0x1fed8b[_0x52fa('0x1b')]==='undefined';var _0x4d61a1=_0x23033d[_0x52fa('0x1c')];var _0x4fb803=_0x3dc190?0x0:_0x1fed8b[_0x52fa('0x1d')];var _0x1077f8=_0x3dc190?_0x23033d[_0x52fa('0x1c')]:_0x1fed8b[_0x52fa('0x1d')]+_0x1fed8b[_0x52fa('0x1b')];var _0x27a55d;if(_0x1077f8>=_0x4d61a1){_0x1077f8=_0x4d61a1;_0x27a55d=0xc8;}else{_0x27a55d=0xce;}_0x19a692['status'](_0x27a55d);return _0x19a692[_0x52fa('0x1e')](_0x52fa('0x1f'),_0x4fb803+'-'+_0x1077f8+'/'+_0x4d61a1)[_0x52fa('0x19')](_0x23033d);}return null;};}function patchUpdates(_0x181ba6){return function(_0x4d6956){try{jsonpatch['apply'](_0x4d6956,_0x181ba6,!![]);}catch(_0x28976a){return BPromise[_0x52fa('0x20')](_0x28976a);}return _0x4d6956[_0x52fa('0x21')]();};}function saveUpdates(_0x4889d9,_0xe0a50b){return function(_0x5ddb11){if(_0x5ddb11){return _0x5ddb11['update'](_0x4889d9)[_0x52fa('0x22')](function(_0x417a9d){return _0x417a9d;});}return null;};}function removeEntity(_0x217233,_0x271a0e){return function(_0x10b69e){if(_0x10b69e){return _0x10b69e['destroy']()[_0x52fa('0x22')](function(){var _0x59da2a=_0x10b69e['get']({'plain':!![]});var _0x4af484=_0x52fa('0x23');return db[_0x52fa('0x24')][_0x52fa('0x25')]({'where':{'type':_0x4af484,'resourceId':_0x59da2a['id']}})[_0x52fa('0x22')](function(){return _0x10b69e;});})[_0x52fa('0x22')](function(){_0x217233[_0x52fa('0x18')](0xcc)[_0x52fa('0x26')]();});}};}function handleEntityNotFound(_0x13199c,_0xefd8a6){return function(_0x143c93){if(!_0x143c93){_0x13199c[_0x52fa('0x27')](0x194);}return _0x143c93;};}function handleError(_0x1ef373,_0x2e9730){_0x2e9730=_0x2e9730||0x1f4;return function(_0x25a7c9){logger[_0x52fa('0x28')](_0x25a7c9['stack']);if(_0x25a7c9[_0x52fa('0x29')]){delete _0x25a7c9[_0x52fa('0x29')];}_0x1ef373[_0x52fa('0x18')](_0x2e9730)[_0x52fa('0x2a')](_0x25a7c9);};}exports[_0x52fa('0x2b')]=function(_0x590859,_0x1f45cc){var _0x340f28={},_0x31ba77={},_0x152bc8={'count':0x0,'rows':[]};var _0x19a901=_[_0x52fa('0x2c')](db[_0x52fa('0x2d')]['rawAttributes'],function(_0x5a0a82){return{'name':_0x5a0a82['fieldName'],'type':_0x5a0a82[_0x52fa('0x2e')][_0x52fa('0x2f')]};});_0x31ba77[_0x52fa('0x30')]=_[_0x52fa('0x2c')](_0x19a901,_0x52fa('0x29'));_0x31ba77['query']=_[_0x52fa('0x31')](_0x590859[_0x52fa('0x32')]);_0x31ba77[_0x52fa('0x33')]=_[_0x52fa('0x34')](_0x31ba77[_0x52fa('0x30')],_0x31ba77[_0x52fa('0x32')]);_0x340f28[_0x52fa('0x35')]=_[_0x52fa('0x34')](_0x31ba77[_0x52fa('0x30')],qs['fields'](_0x590859[_0x52fa('0x32')][_0x52fa('0x36')]));_0x340f28[_0x52fa('0x35')]=_0x340f28[_0x52fa('0x35')][_0x52fa('0x37')]?_0x340f28[_0x52fa('0x35')]:_0x31ba77[_0x52fa('0x30')];if(!_0x590859['query'][_0x52fa('0x38')]('nolimit')){_0x340f28['limit']=qs[_0x52fa('0x1b')](_0x590859[_0x52fa('0x32')][_0x52fa('0x1b')]);_0x340f28[_0x52fa('0x1d')]=qs[_0x52fa('0x1d')](_0x590859['query'][_0x52fa('0x1d')]);}_0x340f28[_0x52fa('0x39')]=qs['sort'](_0x590859[_0x52fa('0x32')]['sort']);_0x340f28[_0x52fa('0x3a')]=qs[_0x52fa('0x33')](_[_0x52fa('0x3b')](_0x590859[_0x52fa('0x32')],_0x31ba77[_0x52fa('0x33')]),_0x19a901);if(_0x590859['query'][_0x52fa('0x3c')]){_0x340f28[_0x52fa('0x3a')]=_[_0x52fa('0x3d')](_0x340f28[_0x52fa('0x3a')],{'$or':_['map'](_0x19a901,function(_0x3c2529){if(_0x3c2529[_0x52fa('0x2e')]!==_0x52fa('0x3e')){var _0x14af98={};_0x14af98[_0x3c2529[_0x52fa('0x29')]]={'$like':'%'+_0x590859[_0x52fa('0x32')][_0x52fa('0x3c')]+'%'};return _0x14af98;}})});}_0x340f28=_[_0x52fa('0x3d')]({},_0x340f28,_0x590859[_0x52fa('0x3f')]);var _0xf7221d={'where':_0x340f28[_0x52fa('0x3a')]};return db[_0x52fa('0x2d')]['count'](_0xf7221d)['then'](function(_0x151516){_0x152bc8['count']=_0x151516;if(_0x590859[_0x52fa('0x32')]['includeAll']){_0x340f28[_0x52fa('0x40')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x340f28);})['then'](function(_0x1d9799){_0x152bc8[_0x52fa('0x41')]=_0x1d9799;return _0x152bc8;})[_0x52fa('0x22')](respondWithFilteredResult(_0x1f45cc,_0x340f28))['catch'](handleError(_0x1f45cc,null));};exports['show']=function(_0x3304d8,_0x20b6d6){var _0x2a4bc9={'raw':!![],'where':{'id':_0x3304d8['params']['id']}},_0x45caa4={};_0x45caa4[_0x52fa('0x30')]=_[_0x52fa('0x31')](db[_0x52fa('0x2d')][_0x52fa('0x42')]);_0x45caa4[_0x52fa('0x32')]=_[_0x52fa('0x31')](_0x3304d8[_0x52fa('0x32')]);_0x45caa4[_0x52fa('0x33')]=_[_0x52fa('0x34')](_0x45caa4[_0x52fa('0x30')],_0x45caa4[_0x52fa('0x32')]);_0x2a4bc9['attributes']=_[_0x52fa('0x34')](_0x45caa4[_0x52fa('0x30')],qs['fields'](_0x3304d8[_0x52fa('0x32')][_0x52fa('0x36')]));_0x2a4bc9[_0x52fa('0x35')]=_0x2a4bc9[_0x52fa('0x35')]['length']?_0x2a4bc9['attributes']:_0x45caa4[_0x52fa('0x30')];if(_0x3304d8['query'][_0x52fa('0x43')]){_0x2a4bc9[_0x52fa('0x40')]=[{'all':!![]}];}_0x2a4bc9=_[_0x52fa('0x3d')]({},_0x2a4bc9,_0x3304d8[_0x52fa('0x3f')]);return db['SmsQueue'][_0x52fa('0x44')](_0x2a4bc9)[_0x52fa('0x22')](handleEntityNotFound(_0x20b6d6,null))[_0x52fa('0x22')](respondWithResult(_0x20b6d6,null))[_0x52fa('0x45')](handleError(_0x20b6d6,null));};exports[_0x52fa('0x46')]=function(_0xbc7ee9,_0xce2fd7){return db[_0x52fa('0x2d')][_0x52fa('0x46')](_0xbc7ee9[_0x52fa('0x47')],{})[_0x52fa('0x22')](function(_0x345a79){var _0x478837=_0xbc7ee9['user'][_0x52fa('0x48')]({'plain':!![]});if(!_0x478837)throw new Error(_0x52fa('0x49'));if(_0x478837[_0x52fa('0x4a')]===_0x52fa('0x4b')){var _0x23c767=_0x345a79[_0x52fa('0x48')]({'plain':!![]});var _0x20025d=_0x52fa('0x23');return db[_0x52fa('0x4c')]['find']({'where':{'name':_0x20025d,'userProfileId':_0x478837[_0x52fa('0x4d')]},'raw':!![]})[_0x52fa('0x22')](function(_0x125e1c){if(_0x125e1c&&_0x125e1c[_0x52fa('0x4e')]===0x0){return db[_0x52fa('0x24')][_0x52fa('0x46')]({'name':_0x23c767[_0x52fa('0x29')],'resourceId':_0x23c767['id'],'type':_0x125e1c['name'],'sectionId':_0x125e1c['id']},{})[_0x52fa('0x22')](function(){return _0x345a79;});}else{return _0x345a79;}})[_0x52fa('0x45')](function(_0x10c33f){logger[_0x52fa('0x28')](_0x52fa('0x4f'),_0x10c33f);throw _0x10c33f;});}return _0x345a79;})[_0x52fa('0x22')](respondWithResult(_0xce2fd7,0xc9))[_0x52fa('0x45')](handleError(_0xce2fd7,null));};exports[_0x52fa('0x50')]=function(_0x3b83a4,_0x336094){if(_0x3b83a4[_0x52fa('0x47')]['id']){delete _0x3b83a4['body']['id'];}return db[_0x52fa('0x2d')][_0x52fa('0x44')]({'where':{'id':_0x3b83a4[_0x52fa('0x51')]['id']}})[_0x52fa('0x22')](handleEntityNotFound(_0x336094,null))[_0x52fa('0x22')](saveUpdates(_0x3b83a4[_0x52fa('0x47')],null))[_0x52fa('0x22')](respondWithResult(_0x336094,null))[_0x52fa('0x45')](handleError(_0x336094,null));};exports[_0x52fa('0x25')]=function(_0x4c09b8,_0x24e930){return db['SmsQueue'][_0x52fa('0x44')]({'where':{'id':_0x4c09b8['params']['id']}})['then'](handleEntityNotFound(_0x24e930,null))[_0x52fa('0x22')](removeEntity(_0x24e930,null))[_0x52fa('0x45')](handleError(_0x24e930,null));};exports[_0x52fa('0x52')]=function(_0x387145,_0x453bba){return db[_0x52fa('0x2d')][_0x52fa('0x52')]()['then'](respondWithResult(_0x453bba,null))[_0x52fa('0x45')](handleError(_0x453bba,null));};exports['getMembers']=function(_0xf34c22,_0x31a884,_0x3bf4e2){var _0x103ef5={'raw':!![],'where':{}},_0x4e9553={},_0x15cb8e;return db[_0x52fa('0x2d')][_0x52fa('0x53')]({'where':{'id':_0xf34c22[_0x52fa('0x51')]['id']}})[_0x52fa('0x22')](handleEntityNotFound(_0x31a884,null))[_0x52fa('0x22')](function(_0x3008eb){if(_0x3008eb){_0x15cb8e=_0x3008eb[_0x52fa('0x48')]({'plain':!![]});_0x4e9553[_0x52fa('0x30')]=_[_0x52fa('0x31')](db[_0x52fa('0x54')]['rawAttributes']);_0x4e9553[_0x52fa('0x32')]=_[_0x52fa('0x31')](_0xf34c22[_0x52fa('0x32')]);_0x4e9553[_0x52fa('0x33')]=_[_0x52fa('0x34')](_0x4e9553[_0x52fa('0x30')],_0x4e9553[_0x52fa('0x32')]);_0x103ef5[_0x52fa('0x35')]=_['intersection'](_0x4e9553[_0x52fa('0x30')],qs[_0x52fa('0x36')](_0xf34c22[_0x52fa('0x32')]['fields']));_0x103ef5['attributes']=_0x103ef5[_0x52fa('0x35')][_0x52fa('0x37')]?_0x103ef5[_0x52fa('0x35')]:_0x4e9553['model'];if(!_0xf34c22[_0x52fa('0x32')][_0x52fa('0x38')]('nolimit')){_0x103ef5['limit']=qs['limit'](_0xf34c22[_0x52fa('0x32')][_0x52fa('0x1b')]);_0x103ef5['offset']=qs['offset'](_0xf34c22['query']['offset']);}_0x103ef5[_0x52fa('0x39')]=qs[_0x52fa('0x55')](_0xf34c22[_0x52fa('0x32')][_0x52fa('0x55')]);_0x103ef5[_0x52fa('0x3a')]=qs['filters'](_[_0x52fa('0x3b')](_0xf34c22[_0x52fa('0x32')],_0x4e9553[_0x52fa('0x33')]));_0x103ef5[_0x52fa('0x3a')][_0x52fa('0x56')]=_0x3008eb['id'];if(_0xf34c22[_0x52fa('0x32')][_0x52fa('0x3c')]){_0x103ef5['where']=_[_0x52fa('0x3d')](_0x103ef5[_0x52fa('0x3a')],{'$or':_[_0x52fa('0x2c')](_0x103ef5[_0x52fa('0x35')],function(_0x2b1ade){var _0x38e74b={};_0x38e74b[_0x2b1ade]={'$like':'%'+_0xf34c22[_0x52fa('0x32')]['filter']+'%'};return _0x38e74b;})});}_0x103ef5=_[_0x52fa('0x3d')]({},_0x103ef5,_0xf34c22[_0x52fa('0x3f')]);return db[_0x52fa('0x54')][_0x52fa('0x57')](_0x103ef5);}})[_0x52fa('0x22')](function(_0x110afa){if(_0x110afa){return db[_0x52fa('0x58')][_0x52fa('0x59')]({'where':{'id':_[_0x52fa('0x2c')](_0x110afa,_0x52fa('0x5a')),'role':_0x52fa('0x5b')},'attributes':['id',_0x52fa('0x29'),_0x52fa('0x5c'),_0x52fa('0x5d'),_0x52fa('0x5e')]});}})['then'](function(_0x2a1356){if(_0x2a1356){return{'count':_0x2a1356['count'],'rows':_[_0x52fa('0x2c')](_0x2a1356[_0x52fa('0x41')],function(_0x4cb78e){return{'membername':_0x4cb78e[_0x52fa('0x29')],'UserId':_0x4cb78e['id'],'queue_name':_0x15cb8e['name'],'SmsQueueId':_0x15cb8e['id'],'interface':util[_0x52fa('0x5f')]('%s/%s',_0x52fa('0x60'),_0x4cb78e[_0x52fa('0x29')]),'penalty':0x0,'paused':_0x4cb78e[_0x52fa('0x5c')],'createdAt':_0x4cb78e['createdAt'],'updatedAt':_0x4cb78e[_0x52fa('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x52fa('0x22')](respondWithFilteredResult(_0x31a884,_0x103ef5))[_0x52fa('0x45')](handleError(_0x31a884,null));};exports[_0x52fa('0x61')]=function(_0x15c762,_0x3a108c,_0x4f21f8){var _0x2a7ed8={};var _0x47e1f2={};var _0x28e0e9;var _0x3bd548;return db['SmsQueue'][_0x52fa('0x53')]({'where':{'id':_0x15c762[_0x52fa('0x51')]['id']}})['then'](handleEntityNotFound(_0x3a108c,null))[_0x52fa('0x22')](function(_0x420634){if(_0x420634){_0x28e0e9=_0x420634;_0x47e1f2[_0x52fa('0x30')]=_[_0x52fa('0x31')](db['Team']['rawAttributes']);_0x47e1f2[_0x52fa('0x32')]=_[_0x52fa('0x31')](_0x15c762[_0x52fa('0x32')]);_0x47e1f2[_0x52fa('0x33')]=_[_0x52fa('0x34')](_0x47e1f2[_0x52fa('0x30')],_0x47e1f2[_0x52fa('0x32')]);_0x2a7ed8[_0x52fa('0x35')]=_['intersection'](_0x47e1f2['model'],qs[_0x52fa('0x36')](_0x15c762[_0x52fa('0x32')][_0x52fa('0x36')]));_0x2a7ed8[_0x52fa('0x35')]=_0x2a7ed8[_0x52fa('0x35')][_0x52fa('0x37')]?_0x2a7ed8[_0x52fa('0x35')]:_0x47e1f2[_0x52fa('0x30')];_0x2a7ed8[_0x52fa('0x39')]=qs[_0x52fa('0x55')](_0x15c762[_0x52fa('0x32')][_0x52fa('0x55')]);_0x2a7ed8[_0x52fa('0x3a')]=qs[_0x52fa('0x33')](_['pick'](_0x15c762[_0x52fa('0x32')],_0x47e1f2[_0x52fa('0x33')]));if(_0x15c762[_0x52fa('0x32')]['filter']){_0x2a7ed8[_0x52fa('0x3a')]=_[_0x52fa('0x3d')](_0x2a7ed8[_0x52fa('0x3a')],{'$or':_[_0x52fa('0x2c')](_0x2a7ed8[_0x52fa('0x35')],function(_0x4580b5){var _0x431f93={};_0x431f93[_0x4580b5]={'$like':'%'+_0x15c762[_0x52fa('0x32')][_0x52fa('0x3c')]+'%'};return _0x431f93;})});}_0x2a7ed8=_[_0x52fa('0x3d')]({},_0x2a7ed8,_0x15c762[_0x52fa('0x3f')]);return _0x28e0e9[_0x52fa('0x61')](_0x2a7ed8);}})[_0x52fa('0x22')](function(_0x599f56){if(_0x599f56){_0x3bd548=_0x599f56[_0x52fa('0x37')];if(!_0x15c762['query'][_0x52fa('0x38')]('nolimit')){_0x2a7ed8[_0x52fa('0x1b')]=qs[_0x52fa('0x1b')](_0x15c762[_0x52fa('0x32')][_0x52fa('0x1b')]);_0x2a7ed8[_0x52fa('0x1d')]=qs[_0x52fa('0x1d')](_0x15c762[_0x52fa('0x32')][_0x52fa('0x1d')]);}return _0x28e0e9[_0x52fa('0x61')](_0x2a7ed8);}})[_0x52fa('0x22')](function(_0x47cbdb){if(_0x47cbdb){return _0x47cbdb?{'count':_0x3bd548,'rows':_0x47cbdb}:null;}})[_0x52fa('0x22')](respondWithResult(_0x3a108c,null))[_0x52fa('0x45')](handleError(_0x3a108c,null));};exports['addTeams']=function(_0x269b6d,_0x461971,_0x3913a6){var _0x4625df=_0x269b6d['body']['ids'];return db[_0x52fa('0x62')][_0x52fa('0x57')]({'where':{'id':_0x4625df},'attributes':['id'],'include':[{'model':db[_0x52fa('0x58')],'as':_0x52fa('0x63'),'attributes':['id',_0x52fa('0x29'),_0x52fa('0x64'),_0x52fa('0x65'),'interface'],'raw':!![]}]})[_0x52fa('0x22')](function(_0x203284){if(_0x203284){var _0x1d0c69=_[_0x52fa('0x66')](_0x203284,function(_0x544b31){var _0x5df2fc=_0x544b31[_0x52fa('0x48')]({'plain':!![]});return _0x5df2fc['Agents'];});return db[_0x52fa('0x2d')]['find']({'where':{'id':_0x269b6d['params']['id']}})[_0x52fa('0x22')](function(_0xe7ef50){return db[_0x52fa('0x67')][_0x52fa('0x68')](function(_0x2785da){return _0xe7ef50[_0x52fa('0x69')](_0x4625df,{'transaction':_0x2785da})[_0x52fa('0x22')](function(){return BPromise['each'](_0x1d0c69,function(_0x12ae6c){return db[_0x52fa('0x54')][_0x52fa('0x6a')]({'where':{'UserId':_0x12ae6c['id'],'SmsQueueId':_0x269b6d[_0x52fa('0x51')]['id']},'transaction':_0x2785da});});})[_0x52fa('0x22')](function(){_0x1d0c69[_0x52fa('0x6b')](function(_0x19fdc3){socket['emit']('userSmsQueue:save',{'UserId':_0x19fdc3['id'],'SmsQueueId':_0xe7ef50['id']});});});});});}})['then'](respondWithStatusCode(_0x461971,null))[_0x52fa('0x45')](handleError(_0x461971,null));};exports[_0x52fa('0x6c')]=function(_0x410a6b,_0x39b3a0,_0x6219d4){return db[_0x52fa('0x62')]['findAll']({'where':{'id':_0x410a6b[_0x52fa('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x52fa('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x52fa('0x22')](handleEntityNotFound(_0x39b3a0,null))[_0x52fa('0x22')](function(_0x1557b3){var _0x8dcd20=_[_0x52fa('0x2c')](_0x1557b3,'id');var _0x2f6c60=[];var _0x28b2cd=[];var _0x491078=squel['select']();_0x491078['field']('tq.TeamId')[_0x52fa('0x6d')](_0x52fa('0x6e'),'tq')[_0x52fa('0x6f')](_0x52fa('0x70'),'ut',_0x52fa('0x71'))[_0x52fa('0x3a')](_0x52fa('0x72'),_0x410a6b[_0x52fa('0x51')]['id']);for(var _0x3dacc5=0x0;_0x3dacc5<_0x1557b3[_0x52fa('0x37')];_0x3dacc5+=0x1){let _0x352352=_0x1557b3[_0x3dacc5];for(var _0x53bb29=0x0;_0x53bb29<_0x352352[_0x52fa('0x63')]['length'];_0x53bb29+=0x1){let _0x2dd0fb=_0x352352[_0x52fa('0x63')][_0x53bb29];var _0x142bb0=_0x491078[_0x52fa('0x73')]();_0x142bb0[_0x52fa('0x3a')]('ut.UserId\x20=\x20?',_0x2dd0fb['id']);_0x28b2cd[_0x52fa('0x74')](db['sequelize'][_0x52fa('0x32')](_0x142bb0[_0x52fa('0x75')](),{'type':db[_0x52fa('0x67')][_0x52fa('0x76')]['SELECT']})['then'](function(_0x2016d5){if(_0x2016d5[_0x52fa('0x37')]===0x1){return _0x2dd0fb['id'];}else{var _0x4fadb3=_[_0x52fa('0x77')](_[_0x52fa('0x2c')](_0x2016d5,_0x52fa('0x78')),function(_0x32f76f){return _[_0x52fa('0x79')](_0x8dcd20,_0x32f76f);});if(_0x4fadb3){return _0x2dd0fb['id'];}}}));}}return BPromise[_0x52fa('0x7a')](_0x28b2cd)['then'](function(_0x8dabd1){_0x2f6c60=_(_0x2f6c60)[_0x52fa('0x7b')](_0x8dabd1)[_0x52fa('0x7c')]()[_0x52fa('0x7d')]();return db[_0x52fa('0x2d')][_0x52fa('0x44')]({'where':{'id':_0x410a6b['params']['id']}})[_0x52fa('0x22')](function(_0x48f589){return db[_0x52fa('0x67')][_0x52fa('0x68')](function(_0x4771aa){return _0x48f589[_0x52fa('0x6c')](_0x410a6b['query'][_0x52fa('0x7e')],{'transaction':_0x4771aa})['then'](function(){if(!_['isEmpty'](_0x2f6c60)){return _0x48f589['removeAgents'](_0x2f6c60,{'transaction':_0x4771aa});}})['then'](function(){_0x2f6c60[_0x52fa('0x6b')](function(_0x39d94b){socket[_0x52fa('0x7f')](_0x52fa('0x80'),{'UserId':_0x39d94b,'SmsQueueId':_0x48f589['id']});});});});});});})[_0x52fa('0x22')](respondWithStatusCode(_0x39b3a0,null))[_0x52fa('0x45')](handleError(_0x39b3a0,null));};exports[_0x52fa('0x81')]=function(_0xc517f7,_0xd2f9d9,_0x4f64c0){return db[_0x52fa('0x2d')][_0x52fa('0x44')]({'where':{'id':_0xc517f7[_0x52fa('0x51')]['id']}})[_0x52fa('0x22')](handleEntityNotFound(_0xd2f9d9,null))[_0x52fa('0x22')](function(_0x348235){if(_0x348235){return _0x348235[_0x52fa('0x81')](_0xc517f7[_0x52fa('0x47')][_0x52fa('0x7e')],_[_0x52fa('0x82')](_0xc517f7[_0x52fa('0x47')],[_0x52fa('0x7e'),'id'])||{})['spread'](function(_0x166361){for(var _0x31f793=0x0;_0x31f793<_0xc517f7['body']['ids'][_0x52fa('0x37')];_0x31f793+=0x1){socket[_0x52fa('0x7f')](_0x52fa('0x83'),{'UserId':Number(_0xc517f7['body'][_0x52fa('0x7e')][_0x31f793]),'SmsQueueId':Number(_0xc517f7['params']['id'])});}return _0x166361;});}})[_0x52fa('0x22')](respondWithResult(_0xd2f9d9,null))['catch'](handleError(_0xd2f9d9,null));};exports['removeAgents']=function(_0x1f6fad,_0x4b03ff,_0x3a12aa){return db[_0x52fa('0x2d')]['find']({'where':{'id':_0x1f6fad[_0x52fa('0x51')]['id']}})['then'](handleEntityNotFound(_0x4b03ff,null))[_0x52fa('0x22')](function(_0x7c3110){if(_0x7c3110){return _0x7c3110[_0x52fa('0x84')](_0x1f6fad[_0x52fa('0x32')][_0x52fa('0x7e')])[_0x52fa('0x22')](function(){if(_[_0x52fa('0x85')](_0x1f6fad[_0x52fa('0x32')][_0x52fa('0x7e')])){for(var _0x31b2e2=0x0;_0x31b2e2<_0x1f6fad['query'][_0x52fa('0x7e')]['length'];_0x31b2e2+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x1f6fad[_0x52fa('0x32')][_0x52fa('0x7e')][_0x31b2e2]),'SmsQueueId':Number(_0x1f6fad['params']['id'])});}}else{socket[_0x52fa('0x7f')](_0x52fa('0x80'),{'UserId':Number(_0x1f6fad[_0x52fa('0x32')][_0x52fa('0x7e')]),'SmsQueueId':Number(_0x1f6fad['params']['id'])});}});}})[_0x52fa('0x22')](respondWithStatusCode(_0x4b03ff,null))[_0x52fa('0x45')](handleError(_0x4b03ff,null));};exports[_0x52fa('0x86')]=function(_0x5b5166,_0x57b2a6,_0xe1722b){var _0x362a43={};var _0x127ff1={};var _0x2dcde6;var _0x5b61f3;return db[_0x52fa('0x2d')][_0x52fa('0x53')]({'where':{'id':_0x5b5166['params']['id']}})[_0x52fa('0x22')](handleEntityNotFound(_0x57b2a6,null))[_0x52fa('0x22')](function(_0x4e37b9){if(_0x4e37b9){_0x2dcde6=_0x4e37b9;_0x127ff1['model']=_[_0x52fa('0x31')](db[_0x52fa('0x58')][_0x52fa('0x42')]);_0x127ff1['query']=_[_0x52fa('0x31')](_0x5b5166[_0x52fa('0x32')]);_0x127ff1[_0x52fa('0x33')]=_['intersection'](_0x127ff1[_0x52fa('0x30')],_0x127ff1['query']);_0x362a43['attributes']=_[_0x52fa('0x34')](_0x127ff1[_0x52fa('0x30')],qs[_0x52fa('0x36')](_0x5b5166['query'][_0x52fa('0x36')]));_0x362a43[_0x52fa('0x35')]=_0x362a43['attributes'][_0x52fa('0x37')]?_0x362a43[_0x52fa('0x35')]:_0x127ff1['model'];_0x362a43[_0x52fa('0x39')]=qs[_0x52fa('0x55')](_0x5b5166[_0x52fa('0x32')]['sort']);_0x362a43['where']=qs['filters'](_[_0x52fa('0x3b')](_0x5b5166[_0x52fa('0x32')],_0x127ff1[_0x52fa('0x33')]));if(_0x5b5166[_0x52fa('0x32')][_0x52fa('0x3c')]){_0x362a43['where']=_[_0x52fa('0x3d')](_0x362a43[_0x52fa('0x3a')],{'$or':_[_0x52fa('0x2c')](_0x362a43[_0x52fa('0x35')],function(_0x533bda){var _0xe76512={};_0xe76512[_0x533bda]={'$like':'%'+_0x5b5166['query'][_0x52fa('0x3c')]+'%'};return _0xe76512;})});}_0x362a43=_[_0x52fa('0x3d')]({},_0x362a43,_0x5b5166['options']);return _0x2dcde6[_0x52fa('0x86')](_0x362a43);}})['then'](function(_0x1f5911){if(_0x1f5911){_0x5b61f3=_0x1f5911[_0x52fa('0x37')];if(!_0x5b5166[_0x52fa('0x32')][_0x52fa('0x38')]('nolimit')){_0x362a43[_0x52fa('0x1b')]=qs[_0x52fa('0x1b')](_0x5b5166[_0x52fa('0x32')][_0x52fa('0x1b')]);_0x362a43['offset']=qs[_0x52fa('0x1d')](_0x5b5166[_0x52fa('0x32')][_0x52fa('0x1d')]);}return _0x2dcde6[_0x52fa('0x86')](_0x362a43);}})[_0x52fa('0x22')](function(_0x20d82b){if(_0x20d82b){return _0x20d82b?{'count':_0x5b61f3,'rows':_0x20d82b}:null;}})[_0x52fa('0x22')](respondWithResult(_0x57b2a6,null))[_0x52fa('0x45')](handleError(_0x57b2a6,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index ffb0022..f699540 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 _0x5855=['events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x44a682,_0x400fa7){var _0x5a1e95=function(_0x4f1deb){while(--_0x4f1deb){_0x44a682['push'](_0x44a682['shift']());}};_0x5a1e95(++_0x400fa7);}(_0x5855,0x15c));var _0x5585=function(_0x4e52b9,_0x3b39b2){_0x4e52b9=_0x4e52b9-0x0;var _0xca4e2a=_0x5855[_0x4e52b9];return _0xca4e2a;};'use strict';var EventEmitter=require(_0x5585('0x0'));var SmsQueue=require(_0x5585('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x5585('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5585('0x3'),'afterDestroy':_0x5585('0x4')};function emitEvent(_0x47a09f){return function(_0x520ff6,_0x148377,_0x92bffc){SmsQueueEvents[_0x5585('0x5')](_0x47a09f+':'+_0x520ff6['id'],_0x520ff6);SmsQueueEvents['emit'](_0x47a09f,_0x520ff6);_0x92bffc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x283b=['save','update','remove','hasOwnProperty','hook','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x464777,_0xed4cbf){var _0x5dd03f=function(_0x4a00f5){while(--_0x4a00f5){_0x464777['push'](_0x464777['shift']());}};_0x5dd03f(++_0xed4cbf);}(_0x283b,0x188));var _0xb283=function(_0x283ce1,_0x52f230){_0x283ce1=_0x283ce1-0x0;var _0xda31d8=_0x283b[_0x283ce1];return _0xda31d8;};'use strict';var EventEmitter=require(_0xb283('0x0'));var SmsQueue=require(_0xb283('0x1'))['db'][_0xb283('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb283('0x3')](0x0);var events={'afterCreate':_0xb283('0x4'),'afterUpdate':_0xb283('0x5'),'afterDestroy':_0xb283('0x6')};function emitEvent(_0x278bd6){return function(_0x4f082e,_0x59a4ea,_0x5a2483){SmsQueueEvents['emit'](_0x278bd6+':'+_0x4f082e['id'],_0x4f082e);SmsQueueEvents['emit'](_0x278bd6,_0x4f082e);_0x5a2483(null);};}for(var e in events){if(events[_0xb283('0x7')](e)){var event=events[e];SmsQueue[_0xb283('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 1ebea84..0f19298 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 _0x518c=['path','rimraf','../../config/environment','exports','define','sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5675d8,_0x1c2ed2){var _0x1717fc=function(_0x2541e2){while(--_0x2541e2){_0x5675d8['push'](_0x5675d8['shift']());}};_0x1717fc(++_0x1c2ed2);}(_0x518c,0x10e));var _0xc518=function(_0x233fac,_0x5669c3){_0x233fac=_0x233fac-0x0;var _0x23816f=_0x518c[_0x233fac];return _0x23816f;};'use strict';var _=require(_0xc518('0x0'));var util=require('util');var logger=require(_0xc518('0x1'))(_0xc518('0x2'));var moment=require(_0xc518('0x3'));var BPromise=require(_0xc518('0x4'));var rp=require(_0xc518('0x5'));var fs=require('fs');var path=require(_0xc518('0x6'));var rimraf=require(_0xc518('0x7'));var config=require(_0xc518('0x8'));var attributes=require('./smsQueue.attributes');module[_0xc518('0x9')]=function(_0x388a68,_0x42a673){return _0x388a68[_0xc518('0xa')]('SmsQueue',attributes,{'tableName':_0xc518('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9748=['request-promise','../../config/environment','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x44f8e7,_0x540110){var _0x4b9b60=function(_0x1cecb1){while(--_0x1cecb1){_0x44f8e7['push'](_0x44f8e7['shift']());}};_0x4b9b60(++_0x540110);}(_0x9748,0x1d1));var _0x8974=function(_0x374ace,_0x4b737d){_0x374ace=_0x374ace-0x0;var _0x527369=_0x9748[_0x374ace];return _0x527369;};'use strict';var _=require(_0x8974('0x0'));var util=require(_0x8974('0x1'));var logger=require(_0x8974('0x2'))(_0x8974('0x3'));var moment=require('moment');var BPromise=require(_0x8974('0x4'));var rp=require(_0x8974('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8974('0x6'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x149dce,_0x5d196f){return _0x149dce[_0x8974('0x7')](_0x8974('0x8'),attributes,{'tableName':_0x8974('0x9'),'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 bf666eb..1401877 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 _0x5429=['../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','SmsQueue','findAll','options','raw','where','limit','include','model','attributes','map','then','GetSmsQueue','stringify','catch','ShowSmsQueue','find','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x1c0224,_0x1b073b){var _0xd6e770=function(_0x403b64){while(--_0x403b64){_0x1c0224['push'](_0x1c0224['shift']());}};_0xd6e770(++_0x1b073b);}(_0x5429,0xeb));var _0x9542=function(_0x687ce7,_0x39db4f){_0x687ce7=_0x687ce7-0x0;var _0x8bb835=_0x5429[_0x687ce7];return _0x8bb835;};'use strict';var _=require(_0x9542('0x0'));var util=require(_0x9542('0x1'));var moment=require('moment');var BPromise=require(_0x9542('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9542('0x3'));var db=require(_0x9542('0x4'))['db'];var utils=require(_0x9542('0x5'));var logger=require(_0x9542('0x6'))(_0x9542('0x7'));var config=require(_0x9542('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9542('0x9')]['http']({'port':0x232a});config[_0x9542('0xa')]=_['defaults'](config[_0x9542('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9542('0xb'))(new Redis(config[_0x9542('0xa')]));require(_0x9542('0xc'))[_0x9542('0xd')](socket);function respondWithRpcPromise(_0x222b07,_0x3496de,_0x242738){return new BPromise(function(_0x5803e7,_0x3475fe){return client[_0x9542('0xe')](_0x222b07,_0x242738)['then'](function(_0x231240){logger[_0x9542('0xf')](_0x9542('0x10'),_0x3496de,_0x9542('0x11'));logger[_0x9542('0x12')](_0x9542('0x13'),_0x3496de,_0x9542('0x11'),JSON['stringify'](_0x231240));if(_0x231240[_0x9542('0x14')]){if(_0x231240[_0x9542('0x14')][_0x9542('0x15')]===0x1f4){logger['error'](_0x9542('0x10'),_0x3496de,_0x231240[_0x9542('0x14')]['message']);return _0x3475fe(_0x231240[_0x9542('0x14')][_0x9542('0x16')]);}logger[_0x9542('0x14')](_0x9542('0x10'),_0x3496de,_0x231240['error'][_0x9542('0x16')]);return _0x5803e7(_0x231240[_0x9542('0x14')][_0x9542('0x16')]);}else{logger[_0x9542('0xf')](_0x9542('0x10'),_0x3496de,'request\x20sent');_0x5803e7(_0x231240[_0x9542('0x17')][_0x9542('0x16')]);}})['catch'](function(_0x13e03d){logger[_0x9542('0x14')](_0x9542('0x10'),_0x3496de,_0x13e03d);_0x3475fe(_0x13e03d);});});}exports['GetSmsQueue']=function(_0x13d4c5){var _0x6eb39c=this;return new Promise(function(_0x1e8980,_0x214828){return db[_0x9542('0x18')][_0x9542('0x19')]({'raw':_0x13d4c5['options']?_0x13d4c5[_0x9542('0x1a')][_0x9542('0x1b')]===undefined?!![]:![]:!![],'where':_0x13d4c5[_0x9542('0x1a')]?_0x13d4c5['options'][_0x9542('0x1c')]||null:null,'attributes':_0x13d4c5[_0x9542('0x1a')]?_0x13d4c5[_0x9542('0x1a')]['attributes']||null:null,'limit':_0x13d4c5[_0x9542('0x1a')]?_0x13d4c5[_0x9542('0x1a')][_0x9542('0x1d')]||null:null,'include':_0x13d4c5[_0x9542('0x1a')]?_0x13d4c5[_0x9542('0x1a')][_0x9542('0x1e')]?_['map'](_0x13d4c5[_0x9542('0x1a')][_0x9542('0x1e')],function(_0x3de47d){return{'model':db[_0x3de47d[_0x9542('0x1f')]],'as':_0x3de47d['as'],'attributes':_0x3de47d[_0x9542('0x20')],'include':_0x3de47d['include']?_[_0x9542('0x21')](_0x3de47d[_0x9542('0x1e')],function(_0x3d7331){return{'model':db[_0x3d7331[_0x9542('0x1f')]],'as':_0x3d7331['as'],'attributes':_0x3d7331[_0x9542('0x20')],'include':_0x3d7331[_0x9542('0x1e')]?_[_0x9542('0x21')](_0x3d7331[_0x9542('0x1e')],function(_0x2d95fb){return{'model':db[_0x2d95fb['model']],'as':_0x2d95fb['as'],'attributes':_0x2d95fb[_0x9542('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9542('0x22')](function(_0x45d3e7){logger[_0x9542('0xf')](_0x9542('0x23'),_0x13d4c5);logger[_0x9542('0x12')](_0x9542('0x23'),_0x13d4c5,JSON[_0x9542('0x24')](_0x45d3e7));_0x1e8980(_0x45d3e7);})[_0x9542('0x25')](function(_0x504ebf){logger['error'](_0x9542('0x23'),_0x504ebf[_0x9542('0x16')],_0x13d4c5);_0x214828(_0x6eb39c[_0x9542('0x14')](0x1f4,_0x504ebf['message']));});});};exports[_0x9542('0x26')]=function(_0x32a6dc){var _0x140501=this;return new Promise(function(_0x3297bf,_0x3a0a25){return db['SmsQueue'][_0x9542('0x27')]({'raw':_0x32a6dc[_0x9542('0x1a')]?_0x32a6dc[_0x9542('0x1a')][_0x9542('0x1b')]===undefined?!![]:![]:!![],'where':_0x32a6dc[_0x9542('0x1a')]?_0x32a6dc['options'][_0x9542('0x1c')]||null:null,'attributes':_0x32a6dc[_0x9542('0x1a')]?_0x32a6dc[_0x9542('0x1a')]['attributes']||null:null,'include':_0x32a6dc['options']?_0x32a6dc[_0x9542('0x1a')][_0x9542('0x1e')]?_[_0x9542('0x21')](_0x32a6dc[_0x9542('0x1a')][_0x9542('0x1e')],function(_0x41aad3){return{'model':db[_0x41aad3[_0x9542('0x1f')]],'as':_0x41aad3['as'],'attributes':_0x41aad3[_0x9542('0x20')],'include':_0x41aad3[_0x9542('0x1e')]?_[_0x9542('0x21')](_0x41aad3['include'],function(_0x550aed){return{'model':db[_0x550aed[_0x9542('0x1f')]],'as':_0x550aed['as'],'attributes':_0x550aed[_0x9542('0x20')],'include':_0x550aed['include']?_[_0x9542('0x21')](_0x550aed[_0x9542('0x1e')],function(_0x33eb2a){return{'model':db[_0x33eb2a[_0x9542('0x1f')]],'as':_0x33eb2a['as'],'attributes':_0x33eb2a['attributes']};}):[]};}):[]};}):[]:[]})[_0x9542('0x22')](function(_0x3c6892){logger['info']('ShowSmsQueue',_0x32a6dc);logger[_0x9542('0x12')]('ShowSmsQueue',_0x32a6dc,JSON[_0x9542('0x24')](_0x3c6892));_0x3297bf(_0x3c6892);})[_0x9542('0x25')](function(_0x33a509){logger['error']('ShowSmsQueue',_0x33a509[_0x9542('0x16')],_0x32a6dc);_0x3a0a25(_0x140501[_0x9542('0x14')](0x1f4,_0x33a509[_0x9542('0x16')]));});});}; \ No newline at end of file +var _0x3129=['../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','GetSmsQueue','ShowSmsQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1a0886,_0xcbf8b4){var _0x5e7161=function(_0x49aebd){while(--_0x49aebd){_0x1a0886['push'](_0x1a0886['shift']());}};_0x5e7161(++_0xcbf8b4);}(_0x3129,0x14d));var _0x9312=function(_0xbf2f86,_0x308049){_0xbf2f86=_0xbf2f86-0x0;var _0x581172=_0x3129[_0xbf2f86];return _0x581172;};'use strict';var _=require(_0x9312('0x0'));var util=require('util');var moment=require(_0x9312('0x1'));var BPromise=require(_0x9312('0x2'));var rs=require(_0x9312('0x3'));var fs=require('fs');var Redis=require(_0x9312('0x4'));var db=require(_0x9312('0x5'))['db'];var utils=require(_0x9312('0x6'));var logger=require(_0x9312('0x7'))(_0x9312('0x8'));var config=require(_0x9312('0x9'));var jayson=require(_0x9312('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x9312('0xb')]=_['defaults'](config[_0x9312('0xb')],{'host':_0x9312('0xc'),'port':0x18eb});var socket=require(_0x9312('0xd'))(new Redis(config[_0x9312('0xb')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5ee36e,_0x223e2a,_0xeca5e3){return new BPromise(function(_0x347e74,_0x4163bb){return client[_0x9312('0xe')](_0x5ee36e,_0xeca5e3)[_0x9312('0xf')](function(_0x55f611){logger[_0x9312('0x10')](_0x9312('0x11'),_0x223e2a,_0x9312('0x12'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x223e2a,'request\x20sent',JSON[_0x9312('0x13')](_0x55f611));if(_0x55f611['error']){if(_0x55f611[_0x9312('0x14')]['code']===0x1f4){logger[_0x9312('0x14')](_0x9312('0x11'),_0x223e2a,_0x55f611[_0x9312('0x14')]['message']);return _0x4163bb(_0x55f611['error'][_0x9312('0x15')]);}logger[_0x9312('0x14')](_0x9312('0x11'),_0x223e2a,_0x55f611[_0x9312('0x14')][_0x9312('0x15')]);return _0x347e74(_0x55f611[_0x9312('0x14')][_0x9312('0x15')]);}else{logger[_0x9312('0x10')](_0x9312('0x11'),_0x223e2a,_0x9312('0x12'));_0x347e74(_0x55f611[_0x9312('0x16')]['message']);}})[_0x9312('0x17')](function(_0x166b75){logger[_0x9312('0x14')](_0x9312('0x11'),_0x223e2a,_0x166b75);_0x4163bb(_0x166b75);});});}exports['GetSmsQueue']=function(_0x32f2e8){var _0x204eb5=this;return new Promise(function(_0x4eb1a3,_0x391103){return db[_0x9312('0x18')][_0x9312('0x19')]({'raw':_0x32f2e8[_0x9312('0x1a')]?_0x32f2e8['options'][_0x9312('0x1b')]===undefined?!![]:![]:!![],'where':_0x32f2e8[_0x9312('0x1a')]?_0x32f2e8[_0x9312('0x1a')][_0x9312('0x1c')]||null:null,'attributes':_0x32f2e8[_0x9312('0x1a')]?_0x32f2e8['options'][_0x9312('0x1d')]||null:null,'limit':_0x32f2e8[_0x9312('0x1a')]?_0x32f2e8[_0x9312('0x1a')][_0x9312('0x1e')]||null:null,'include':_0x32f2e8['options']?_0x32f2e8[_0x9312('0x1a')][_0x9312('0x1f')]?_[_0x9312('0x20')](_0x32f2e8[_0x9312('0x1a')]['include'],function(_0x3e7b11){return{'model':db[_0x3e7b11[_0x9312('0x21')]],'as':_0x3e7b11['as'],'attributes':_0x3e7b11[_0x9312('0x1d')],'include':_0x3e7b11[_0x9312('0x1f')]?_[_0x9312('0x20')](_0x3e7b11['include'],function(_0x3a3822){return{'model':db[_0x3a3822['model']],'as':_0x3a3822['as'],'attributes':_0x3a3822['attributes'],'include':_0x3a3822[_0x9312('0x1f')]?_['map'](_0x3a3822['include'],function(_0x56cfa3){return{'model':db[_0x56cfa3[_0x9312('0x21')]],'as':_0x56cfa3['as'],'attributes':_0x56cfa3[_0x9312('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9312('0xf')](function(_0x565204){logger[_0x9312('0x10')]('GetSmsQueue',_0x32f2e8);logger[_0x9312('0x22')]('GetSmsQueue',_0x32f2e8,JSON[_0x9312('0x13')](_0x565204));_0x4eb1a3(_0x565204);})['catch'](function(_0xe4a334){logger['error'](_0x9312('0x23'),_0xe4a334['message'],_0x32f2e8);_0x391103(_0x204eb5['error'](0x1f4,_0xe4a334[_0x9312('0x15')]));});});};exports[_0x9312('0x24')]=function(_0x2ec993){var _0x5a123f=this;return new Promise(function(_0x30b8a9,_0x43ec09){return db[_0x9312('0x18')][_0x9312('0x25')]({'raw':_0x2ec993[_0x9312('0x1a')]?_0x2ec993[_0x9312('0x1a')][_0x9312('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ec993[_0x9312('0x1a')]?_0x2ec993[_0x9312('0x1a')][_0x9312('0x1c')]||null:null,'attributes':_0x2ec993[_0x9312('0x1a')]?_0x2ec993[_0x9312('0x1a')]['attributes']||null:null,'include':_0x2ec993[_0x9312('0x1a')]?_0x2ec993[_0x9312('0x1a')][_0x9312('0x1f')]?_[_0x9312('0x20')](_0x2ec993[_0x9312('0x1a')]['include'],function(_0x32fba8){return{'model':db[_0x32fba8[_0x9312('0x21')]],'as':_0x32fba8['as'],'attributes':_0x32fba8['attributes'],'include':_0x32fba8[_0x9312('0x1f')]?_[_0x9312('0x20')](_0x32fba8[_0x9312('0x1f')],function(_0x44d998){return{'model':db[_0x44d998[_0x9312('0x21')]],'as':_0x44d998['as'],'attributes':_0x44d998[_0x9312('0x1d')],'include':_0x44d998[_0x9312('0x1f')]?_[_0x9312('0x20')](_0x44d998['include'],function(_0x48fc69){return{'model':db[_0x48fc69['model']],'as':_0x48fc69['as'],'attributes':_0x48fc69[_0x9312('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9312('0xf')](function(_0x4911c5){logger[_0x9312('0x10')](_0x9312('0x24'),_0x2ec993);logger[_0x9312('0x22')]('ShowSmsQueue',_0x2ec993,JSON['stringify'](_0x4911c5));_0x30b8a9(_0x4911c5);})[_0x9312('0x17')](function(_0x5b1dec){logger[_0x9312('0x14')](_0x9312('0x24'),_0x5b1dec[_0x9312('0x15')],_0x2ec993);_0x43ec09(_0x5a123f[_0x9312('0x14')](0x1f4,_0x5b1dec[_0x9312('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index bca9113..dc3fe81 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 _0x6bf8=['smsQueue:','./smsQueue.events','save','remove','update','register','length'];(function(_0x161e88,_0x49ce5e){var _0x40ee62=function(_0x2c4660){while(--_0x2c4660){_0x161e88['push'](_0x161e88['shift']());}};_0x40ee62(++_0x49ce5e);}(_0x6bf8,0x143));var _0x86bf=function(_0x2a140b,_0x2cb1eb){_0x2a140b=_0x2a140b-0x0;var _0xd4f1e4=_0x6bf8[_0x2a140b];return _0xd4f1e4;};'use strict';var SmsQueueEvents=require(_0x86bf('0x0'));var events=[_0x86bf('0x1'),_0x86bf('0x2'),_0x86bf('0x3')];function createListener(_0x3c477b,_0x109b9b){return function(_0x20a5fc){_0x109b9b['emit'](_0x3c477b,_0x20a5fc);};}function removeListener(_0x197d24,_0x459270){return function(){SmsQueueEvents['removeListener'](_0x197d24,_0x459270);};}exports[_0x86bf('0x4')]=function(_0x34b658){for(var _0x256fe4=0x0,_0x28e41c=events[_0x86bf('0x5')];_0x256fe4<_0x28e41c;_0x256fe4++){var _0xbb23cd=events[_0x256fe4];var _0x5b249f=createListener(_0x86bf('0x6')+_0xbb23cd,_0x34b658);SmsQueueEvents['on'](_0xbb23cd,_0x5b249f);}}; \ No newline at end of file +var _0xa751=['register','length','./smsQueue.events','save','remove','update','removeListener'];(function(_0x1bddd9,_0x1fd156){var _0x10f85c=function(_0x440826){while(--_0x440826){_0x1bddd9['push'](_0x1bddd9['shift']());}};_0x10f85c(++_0x1fd156);}(_0xa751,0xdb));var _0x1a75=function(_0x1ba804,_0x37147b){_0x1ba804=_0x1ba804-0x0;var _0x3185af=_0xa751[_0x1ba804];return _0x3185af;};'use strict';var SmsQueueEvents=require(_0x1a75('0x0'));var events=[_0x1a75('0x1'),_0x1a75('0x2'),_0x1a75('0x3')];function createListener(_0x3a4530,_0x5ecc6b){return function(_0x10fcb0){_0x5ecc6b['emit'](_0x3a4530,_0x10fcb0);};}function removeListener(_0x444bef,_0x1c2e9c){return function(){SmsQueueEvents[_0x1a75('0x4')](_0x444bef,_0x1c2e9c);};}exports[_0x1a75('0x5')]=function(_0x54a0fa){for(var _0x15b26d=0x0,_0x33672=events[_0x1a75('0x6')];_0x15b26d<_0x33672;_0x15b26d++){var _0x1ecc90=events[_0x15b26d];var _0x44b7d3=createListener('smsQueue:'+_0x1ecc90,_0x54a0fa);SmsQueueEvents['on'](_0x1ecc90,_0x44b7d3);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index e28fd85..4154c7d 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 _0x5d66=['multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','exports'];(function(_0xd2cb9e,_0x5e86c2){var _0x20168d=function(_0x58ecc7){while(--_0x58ecc7){_0xd2cb9e['push'](_0xd2cb9e['shift']());}};_0x20168d(++_0x5e86c2);}(_0x5d66,0x130));var _0x65d6=function(_0x276a46,_0x3c5f3a){_0x276a46=_0x276a46-0x0;var _0x1549e2=_0x5d66[_0x276a46];return _0x1549e2;};'use strict';var multer=require(_0x65d6('0x0'));var util=require(_0x65d6('0x1'));var path=require(_0x65d6('0x2'));var timeout=require(_0x65d6('0x3'));var express=require('express');var router=express[_0x65d6('0x4')]();var fs_extra=require(_0x65d6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x65d6('0x6'));var controller=require(_0x65d6('0x7'));router[_0x65d6('0x8')]('/',auth[_0x65d6('0x9')](),controller[_0x65d6('0xa')]);router[_0x65d6('0x8')](_0x65d6('0xb'),auth['isAuthenticated'](),controller[_0x65d6('0xc')]);router[_0x65d6('0x8')](_0x65d6('0xd'),auth[_0x65d6('0x9')](),controller[_0x65d6('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65d6('0xf')]);router[_0x65d6('0x10')]('/:id',auth[_0x65d6('0x9')](),controller[_0x65d6('0x11')]);router['delete'](_0x65d6('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x65d6('0x12')]=router; \ No newline at end of file +var _0xb353=['./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x368675,_0x4c8b97){var _0xdd32b=function(_0x3a9ef3){while(--_0x3a9ef3){_0x368675['push'](_0x368675['shift']());}};_0xdd32b(++_0x4c8b97);}(_0xb353,0xdd));var _0x3b35=function(_0x41a5f4,_0x557e5a){_0x41a5f4=_0x41a5f4-0x0;var _0xd2c097=_0xb353[_0x41a5f4];return _0xd2c097;};'use strict';var multer=require(_0x3b35('0x0'));var util=require(_0x3b35('0x1'));var path=require(_0x3b35('0x2'));var timeout=require('connect-timeout');var express=require(_0x3b35('0x3'));var router=express[_0x3b35('0x4')]();var fs_extra=require(_0x3b35('0x5'));var auth=require(_0x3b35('0x6'));var interaction=require(_0x3b35('0x7'));var config=require(_0x3b35('0x8'));var controller=require(_0x3b35('0x9'));router[_0x3b35('0xa')]('/',auth['isAuthenticated'](),controller[_0x3b35('0xb')]);router['get'](_0x3b35('0xc'),auth[_0x3b35('0xd')](),controller[_0x3b35('0xe')]);router['get'](_0x3b35('0xf'),auth['isAuthenticated'](),controller[_0x3b35('0x10')]);router[_0x3b35('0x11')]('/',auth['isAuthenticated'](),controller[_0x3b35('0x12')]);router[_0x3b35('0x13')](_0x3b35('0xf'),auth[_0x3b35('0xd')](),controller[_0x3b35('0x14')]);router['delete'](_0x3b35('0xf'),auth['isAuthenticated'](),controller[_0x3b35('0x15')]);module[_0x3b35('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 288e884..dbd5ddc 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 _0x4891=['DATE','moment','sequelize'];(function(_0x998ab8,_0x2ee311){var _0x5db3f9=function(_0x1d8681){while(--_0x1d8681){_0x998ab8['push'](_0x998ab8['shift']());}};_0x5db3f9(++_0x2ee311);}(_0x4891,0x166));var _0x1489=function(_0x26efa0,_0x3d82da){_0x26efa0=_0x26efa0-0x0;var _0x1f3e61=_0x4891[_0x26efa0];return _0x1f3e61;};'use strict';var moment=require(_0x1489('0x0'));var Sequelize=require(_0x1489('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1489('0x2')]},'leaveAt':{'type':Sequelize[_0x1489('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1489('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3ef1=['STRING','sequelize','exports','DATE'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x3ef1,0x99));var _0x13ef=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3ef1[_0x3ab51d];return _0x29a04e;};'use strict';var moment=require('moment');var Sequelize=require(_0x13ef('0x0'));module[_0x13ef('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x13ef('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x13ef('0x2')]},'exitAt':{'type':Sequelize[_0x13ef('0x2')]},'reason':{'type':Sequelize[_0x13ef('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 65d3942..ab153b6 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 _0x2f0f=['offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','send','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0x2f0f,0x11f));var _0xf2f0=function(_0x16bf05,_0x4f70da){_0x16bf05=_0x16bf05-0x0;var _0xbcf546=_0x2f0f[_0x16bf05];return _0xbcf546;};'use strict';var emlformat=require(_0xf2f0('0x0'));var rimraf=require(_0xf2f0('0x1'));var zipdir=require(_0xf2f0('0x2'));var jsonpatch=require(_0xf2f0('0x3'));var rp=require(_0xf2f0('0x4'));var moment=require(_0xf2f0('0x5'));var BPromise=require(_0xf2f0('0x6'));var Mustache=require('mustache');var util=require(_0xf2f0('0x7'));var path=require(_0xf2f0('0x8'));var sox=require(_0xf2f0('0x9'));var csv=require(_0xf2f0('0xa'));var ejs=require(_0xf2f0('0xb'));var fs=require('fs');var fs_extra=require(_0xf2f0('0xc'));var _=require(_0xf2f0('0xd'));var squel=require('squel');var crypto=require(_0xf2f0('0xe'));var jsforce=require(_0xf2f0('0xf'));var deskjs=require(_0xf2f0('0x10'));var toCsv=require(_0xf2f0('0xa'));var querystring=require(_0xf2f0('0x11'));var Papa=require('papaparse');var Redis=require(_0xf2f0('0x12'));var authService=require(_0xf2f0('0x13'));var qs=require(_0xf2f0('0x14'));var as=require(_0xf2f0('0x15'));var hardwareService=require(_0xf2f0('0x16'));var logger=require(_0xf2f0('0x17'))(_0xf2f0('0x18'));var utils=require(_0xf2f0('0x19'));var config=require(_0xf2f0('0x1a'));var licenseUtil=require(_0xf2f0('0x1b'));var db=require(_0xf2f0('0x1c'))['db'];function respondWithStatusCode(_0x1ed071,_0x54b9d1){_0x54b9d1=_0x54b9d1||0xcc;return function(_0x3b9baf){if(_0x3b9baf){return _0x1ed071[_0xf2f0('0x1d')](_0x54b9d1);}return _0x1ed071[_0xf2f0('0x1e')](_0x54b9d1)[_0xf2f0('0x1f')]();};}function respondWithResult(_0x4053eb,_0x318107){_0x318107=_0x318107||0xc8;return function(_0x2054f6){if(_0x2054f6){return _0x4053eb[_0xf2f0('0x1e')](_0x318107)[_0xf2f0('0x20')](_0x2054f6);}};}function respondWithFilteredResult(_0x8d38a7,_0x52809c){return function(_0x4b9033){if(_0x4b9033){var _0x4d267c=typeof _0x52809c[_0xf2f0('0x21')]===_0xf2f0('0x22')&&typeof _0x52809c[_0xf2f0('0x23')]===_0xf2f0('0x22');var _0x3bb763=_0x4b9033[_0xf2f0('0x24')];var _0x47bf70=_0x4d267c?0x0:_0x52809c[_0xf2f0('0x21')];var _0x4b36e9=_0x4d267c?_0x4b9033[_0xf2f0('0x24')]:_0x52809c[_0xf2f0('0x21')]+_0x52809c[_0xf2f0('0x23')];var _0x2beb74;if(_0x4b36e9>=_0x3bb763){_0x4b36e9=_0x3bb763;_0x2beb74=0xc8;}else{_0x2beb74=0xce;}_0x8d38a7[_0xf2f0('0x1e')](_0x2beb74);return _0x8d38a7[_0xf2f0('0x25')]('Content-Range',_0x47bf70+'-'+_0x4b36e9+'/'+_0x3bb763)['json'](_0x4b9033);}return null;};}function patchUpdates(_0x264e66){return function(_0x10c96c){try{jsonpatch[_0xf2f0('0x26')](_0x10c96c,_0x264e66,!![]);}catch(_0x4a706d){return BPromise[_0xf2f0('0x27')](_0x4a706d);}return _0x10c96c[_0xf2f0('0x28')]();};}function saveUpdates(_0x1ccd30,_0x3966ab){return function(_0x1d9fb1){if(_0x1d9fb1){return _0x1d9fb1['update'](_0x1ccd30)[_0xf2f0('0x29')](function(_0x1e9f0b){return _0x1e9f0b;});}return null;};}function removeEntity(_0x68e023,_0x52950a){return function(_0x5a7b5f){if(_0x5a7b5f){return _0x5a7b5f[_0xf2f0('0x2a')]()['then'](function(){_0x68e023[_0xf2f0('0x1e')](0xcc)[_0xf2f0('0x1f')]();});}};}function handleEntityNotFound(_0x1e3b3a,_0x67d8f8){return function(_0x108b94){if(!_0x108b94){_0x1e3b3a['sendStatus'](0x194);}return _0x108b94;};}function handleError(_0x293629,_0x5d4b93){_0x5d4b93=_0x5d4b93||0x1f4;return function(_0x4ed701){logger['error'](_0x4ed701[_0xf2f0('0x2b')]);if(_0x4ed701['name']){delete _0x4ed701[_0xf2f0('0x2c')];}_0x293629[_0xf2f0('0x1e')](_0x5d4b93)[_0xf2f0('0x2d')](_0x4ed701);};}exports['index']=function(_0x4fa842,_0x5836e1){var _0x2e0d47={},_0x1d12a7={},_0x129ff9={'count':0x0,'rows':[]};var _0x49cfd8=_[_0xf2f0('0x2e')](db[_0xf2f0('0x2f')][_0xf2f0('0x30')],function(_0x1ac6e1){return{'name':_0x1ac6e1[_0xf2f0('0x31')],'type':_0x1ac6e1[_0xf2f0('0x32')][_0xf2f0('0x33')]};});_0x1d12a7[_0xf2f0('0x34')]=_[_0xf2f0('0x2e')](_0x49cfd8,_0xf2f0('0x2c'));_0x1d12a7[_0xf2f0('0x35')]=_[_0xf2f0('0x36')](_0x4fa842[_0xf2f0('0x35')]);_0x1d12a7[_0xf2f0('0x37')]=_[_0xf2f0('0x38')](_0x1d12a7[_0xf2f0('0x34')],_0x1d12a7[_0xf2f0('0x35')]);_0x2e0d47[_0xf2f0('0x39')]=_[_0xf2f0('0x38')](_0x1d12a7[_0xf2f0('0x34')],qs['fields'](_0x4fa842[_0xf2f0('0x35')]['fields']));_0x2e0d47[_0xf2f0('0x39')]=_0x2e0d47[_0xf2f0('0x39')][_0xf2f0('0x3a')]?_0x2e0d47['attributes']:_0x1d12a7['model'];if(!_0x4fa842['query'][_0xf2f0('0x3b')]('nolimit')){_0x2e0d47[_0xf2f0('0x23')]=qs[_0xf2f0('0x23')](_0x4fa842[_0xf2f0('0x35')][_0xf2f0('0x23')]);_0x2e0d47[_0xf2f0('0x21')]=qs[_0xf2f0('0x21')](_0x4fa842[_0xf2f0('0x35')][_0xf2f0('0x21')]);}_0x2e0d47[_0xf2f0('0x3c')]=qs[_0xf2f0('0x3d')](_0x4fa842['query'][_0xf2f0('0x3d')]);_0x2e0d47[_0xf2f0('0x3e')]=qs['filters'](_[_0xf2f0('0x3f')](_0x4fa842[_0xf2f0('0x35')],_0x1d12a7[_0xf2f0('0x37')]),_0x49cfd8);if(_0x4fa842[_0xf2f0('0x35')][_0xf2f0('0x40')]){_0x2e0d47[_0xf2f0('0x3e')]=_[_0xf2f0('0x41')](_0x2e0d47[_0xf2f0('0x3e')],{'$or':_[_0xf2f0('0x2e')](_0x49cfd8,function(_0x394abc){if(_0x394abc[_0xf2f0('0x32')]!==_0xf2f0('0x42')){var _0x3da1f0={};_0x3da1f0[_0x394abc['name']]={'$like':'%'+_0x4fa842[_0xf2f0('0x35')][_0xf2f0('0x40')]+'%'};return _0x3da1f0;}})});}_0x2e0d47=_[_0xf2f0('0x41')]({},_0x2e0d47,_0x4fa842[_0xf2f0('0x43')]);var _0x5d3b0c={'where':_0x2e0d47[_0xf2f0('0x3e')]};return db[_0xf2f0('0x2f')]['count'](_0x5d3b0c)['then'](function(_0x22d6a9){_0x129ff9[_0xf2f0('0x24')]=_0x22d6a9;if(_0x4fa842[_0xf2f0('0x35')][_0xf2f0('0x44')]){_0x2e0d47[_0xf2f0('0x45')]=[{'all':!![]}];}return db[_0xf2f0('0x2f')][_0xf2f0('0x46')](_0x2e0d47);})[_0xf2f0('0x29')](function(_0x3347c0){_0x129ff9['rows']=_0x3347c0;return _0x129ff9;})[_0xf2f0('0x29')](respondWithFilteredResult(_0x5836e1,_0x2e0d47))[_0xf2f0('0x47')](handleError(_0x5836e1,null));};exports[_0xf2f0('0x48')]=function(_0x133cd4,_0x8efb84){var _0x14b8f5={'raw':!![],'where':{'id':_0x133cd4[_0xf2f0('0x49')]['id']}},_0x492576={};_0x492576[_0xf2f0('0x34')]=_[_0xf2f0('0x36')](db[_0xf2f0('0x2f')][_0xf2f0('0x30')]);_0x492576[_0xf2f0('0x35')]=_[_0xf2f0('0x36')](_0x133cd4['query']);_0x492576[_0xf2f0('0x37')]=_[_0xf2f0('0x38')](_0x492576[_0xf2f0('0x34')],_0x492576[_0xf2f0('0x35')]);_0x14b8f5['attributes']=_['intersection'](_0x492576[_0xf2f0('0x34')],qs[_0xf2f0('0x4a')](_0x133cd4[_0xf2f0('0x35')]['fields']));_0x14b8f5[_0xf2f0('0x39')]=_0x14b8f5[_0xf2f0('0x39')][_0xf2f0('0x3a')]?_0x14b8f5[_0xf2f0('0x39')]:_0x492576[_0xf2f0('0x34')];if(_0x133cd4[_0xf2f0('0x35')]['includeAll']){_0x14b8f5[_0xf2f0('0x45')]=[{'all':!![]}];}_0x14b8f5=_[_0xf2f0('0x41')]({},_0x14b8f5,_0x133cd4['options']);return db[_0xf2f0('0x2f')][_0xf2f0('0x4b')](_0x14b8f5)[_0xf2f0('0x29')](handleEntityNotFound(_0x8efb84,null))['then'](respondWithResult(_0x8efb84,null))['catch'](handleError(_0x8efb84,null));};exports[_0xf2f0('0x4c')]=function(_0x2c579c,_0x5e92c0){return db[_0xf2f0('0x2f')]['create'](_0x2c579c[_0xf2f0('0x4d')],{})[_0xf2f0('0x29')](respondWithResult(_0x5e92c0,0xc9))[_0xf2f0('0x47')](handleError(_0x5e92c0,null));};exports[_0xf2f0('0x4e')]=function(_0x56296c,_0x18edb5){if(_0x56296c[_0xf2f0('0x4d')]['id']){delete _0x56296c[_0xf2f0('0x4d')]['id'];}return db['SmsQueueReport'][_0xf2f0('0x4b')]({'where':{'id':_0x56296c[_0xf2f0('0x49')]['id']}})['then'](handleEntityNotFound(_0x18edb5,null))[_0xf2f0('0x29')](saveUpdates(_0x56296c[_0xf2f0('0x4d')],null))[_0xf2f0('0x29')](respondWithResult(_0x18edb5,null))[_0xf2f0('0x47')](handleError(_0x18edb5,null));};exports[_0xf2f0('0x2a')]=function(_0x49f6e5,_0x496b48){return db['SmsQueueReport']['find']({'where':{'id':_0x49f6e5[_0xf2f0('0x49')]['id']}})['then'](handleEntityNotFound(_0x496b48,null))[_0xf2f0('0x29')](removeEntity(_0x496b48,null))['catch'](handleError(_0x496b48,null));};exports[_0xf2f0('0x4f')]=function(_0x5ecbf9,_0xd2b2c3){return db[_0xf2f0('0x2f')][_0xf2f0('0x4f')]()[_0xf2f0('0x29')](respondWithResult(_0xd2b2c3,null))[_0xf2f0('0x47')](handleError(_0xd2b2c3,null));}; \ No newline at end of file +var _0xb4cf=['name','send','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','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','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0xb4cf,0x155));var _0xfb4c=function(_0xa4d8fd,_0x9e5be1){_0xa4d8fd=_0xa4d8fd-0x0;var _0xec2ade=_0xb4cf[_0xa4d8fd];return _0xec2ade;};'use strict';var emlformat=require(_0xfb4c('0x0'));var rimraf=require(_0xfb4c('0x1'));var zipdir=require(_0xfb4c('0x2'));var jsonpatch=require(_0xfb4c('0x3'));var rp=require(_0xfb4c('0x4'));var moment=require(_0xfb4c('0x5'));var BPromise=require(_0xfb4c('0x6'));var Mustache=require(_0xfb4c('0x7'));var util=require(_0xfb4c('0x8'));var path=require('path');var sox=require(_0xfb4c('0x9'));var csv=require(_0xfb4c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb4c('0xb'));var _=require(_0xfb4c('0xc'));var squel=require(_0xfb4c('0xd'));var crypto=require(_0xfb4c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfb4c('0xf'));var toCsv=require(_0xfb4c('0xa'));var querystring=require(_0xfb4c('0x10'));var Papa=require(_0xfb4c('0x11'));var Redis=require(_0xfb4c('0x12'));var authService=require(_0xfb4c('0x13'));var qs=require(_0xfb4c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb4c('0x15'));var logger=require(_0xfb4c('0x16'))('api');var utils=require(_0xfb4c('0x17'));var config=require(_0xfb4c('0x18'));var licenseUtil=require(_0xfb4c('0x19'));var db=require(_0xfb4c('0x1a'))['db'];function respondWithStatusCode(_0xe5b13c,_0x5aaaa1){_0x5aaaa1=_0x5aaaa1||0xcc;return function(_0x313de7){if(_0x313de7){return _0xe5b13c[_0xfb4c('0x1b')](_0x5aaaa1);}return _0xe5b13c[_0xfb4c('0x1c')](_0x5aaaa1)[_0xfb4c('0x1d')]();};}function respondWithResult(_0x7911f5,_0x170828){_0x170828=_0x170828||0xc8;return function(_0x12e54b){if(_0x12e54b){return _0x7911f5[_0xfb4c('0x1c')](_0x170828)[_0xfb4c('0x1e')](_0x12e54b);}};}function respondWithFilteredResult(_0xca3653,_0x115cff){return function(_0x424f8c){if(_0x424f8c){var _0x2c3f50=typeof _0x115cff['offset']==='undefined'&&typeof _0x115cff['limit']===_0xfb4c('0x1f');var _0x496897=_0x424f8c[_0xfb4c('0x20')];var _0x1ce3ac=_0x2c3f50?0x0:_0x115cff[_0xfb4c('0x21')];var _0x35e8e9=_0x2c3f50?_0x424f8c[_0xfb4c('0x20')]:_0x115cff[_0xfb4c('0x21')]+_0x115cff[_0xfb4c('0x22')];var _0x41e560;if(_0x35e8e9>=_0x496897){_0x35e8e9=_0x496897;_0x41e560=0xc8;}else{_0x41e560=0xce;}_0xca3653['status'](_0x41e560);return _0xca3653[_0xfb4c('0x23')](_0xfb4c('0x24'),_0x1ce3ac+'-'+_0x35e8e9+'/'+_0x496897)[_0xfb4c('0x1e')](_0x424f8c);}return null;};}function patchUpdates(_0x2b5670){return function(_0x2ee633){try{jsonpatch['apply'](_0x2ee633,_0x2b5670,!![]);}catch(_0x745377){return BPromise[_0xfb4c('0x25')](_0x745377);}return _0x2ee633[_0xfb4c('0x26')]();};}function saveUpdates(_0x1c07c9,_0x559f56){return function(_0x5694c1){if(_0x5694c1){return _0x5694c1[_0xfb4c('0x27')](_0x1c07c9)[_0xfb4c('0x28')](function(_0x134f08){return _0x134f08;});}return null;};}function removeEntity(_0x2ddc15,_0xd93304){return function(_0x446e87){if(_0x446e87){return _0x446e87[_0xfb4c('0x29')]()[_0xfb4c('0x28')](function(){_0x2ddc15[_0xfb4c('0x1c')](0xcc)[_0xfb4c('0x1d')]();});}};}function handleEntityNotFound(_0x5eb9bf,_0x89a956){return function(_0x3ec3bb){if(!_0x3ec3bb){_0x5eb9bf['sendStatus'](0x194);}return _0x3ec3bb;};}function handleError(_0x15aa2b,_0x2cda8d){_0x2cda8d=_0x2cda8d||0x1f4;return function(_0x28f4a3){logger[_0xfb4c('0x2a')](_0x28f4a3[_0xfb4c('0x2b')]);if(_0x28f4a3['name']){delete _0x28f4a3[_0xfb4c('0x2c')];}_0x15aa2b[_0xfb4c('0x1c')](_0x2cda8d)[_0xfb4c('0x2d')](_0x28f4a3);};}exports['index']=function(_0x47e08f,_0x37daf3){var _0x4ab08f={},_0x42653e={},_0x5b91ae={'count':0x0,'rows':[]};var _0x16d238=_[_0xfb4c('0x2e')](db[_0xfb4c('0x2f')][_0xfb4c('0x30')],function(_0x22f599){return{'name':_0x22f599[_0xfb4c('0x31')],'type':_0x22f599[_0xfb4c('0x32')][_0xfb4c('0x33')]};});_0x42653e[_0xfb4c('0x34')]=_['map'](_0x16d238,_0xfb4c('0x2c'));_0x42653e['query']=_['keys'](_0x47e08f[_0xfb4c('0x35')]);_0x42653e['filters']=_[_0xfb4c('0x36')](_0x42653e['model'],_0x42653e[_0xfb4c('0x35')]);_0x4ab08f['attributes']=_[_0xfb4c('0x36')](_0x42653e[_0xfb4c('0x34')],qs[_0xfb4c('0x37')](_0x47e08f['query']['fields']));_0x4ab08f[_0xfb4c('0x38')]=_0x4ab08f[_0xfb4c('0x38')][_0xfb4c('0x39')]?_0x4ab08f[_0xfb4c('0x38')]:_0x42653e[_0xfb4c('0x34')];if(!_0x47e08f[_0xfb4c('0x35')]['hasOwnProperty'](_0xfb4c('0x3a'))){_0x4ab08f[_0xfb4c('0x22')]=qs[_0xfb4c('0x22')](_0x47e08f[_0xfb4c('0x35')][_0xfb4c('0x22')]);_0x4ab08f[_0xfb4c('0x21')]=qs['offset'](_0x47e08f[_0xfb4c('0x35')][_0xfb4c('0x21')]);}_0x4ab08f[_0xfb4c('0x3b')]=qs[_0xfb4c('0x3c')](_0x47e08f[_0xfb4c('0x35')]['sort']);_0x4ab08f[_0xfb4c('0x3d')]=qs[_0xfb4c('0x3e')](_['pick'](_0x47e08f[_0xfb4c('0x35')],_0x42653e['filters']),_0x16d238);if(_0x47e08f[_0xfb4c('0x35')][_0xfb4c('0x3f')]){_0x4ab08f[_0xfb4c('0x3d')]=_[_0xfb4c('0x40')](_0x4ab08f['where'],{'$or':_['map'](_0x16d238,function(_0x584f32){if(_0x584f32[_0xfb4c('0x32')]!==_0xfb4c('0x41')){var _0xc21bc3={};_0xc21bc3[_0x584f32[_0xfb4c('0x2c')]]={'$like':'%'+_0x47e08f[_0xfb4c('0x35')][_0xfb4c('0x3f')]+'%'};return _0xc21bc3;}})});}_0x4ab08f=_[_0xfb4c('0x40')]({},_0x4ab08f,_0x47e08f[_0xfb4c('0x42')]);var _0x4547c3={'where':_0x4ab08f['where']};return db['SmsQueueReport']['count'](_0x4547c3)[_0xfb4c('0x28')](function(_0x188059){_0x5b91ae['count']=_0x188059;if(_0x47e08f[_0xfb4c('0x35')][_0xfb4c('0x43')]){_0x4ab08f[_0xfb4c('0x44')]=[{'all':!![]}];}return db[_0xfb4c('0x2f')][_0xfb4c('0x45')](_0x4ab08f);})[_0xfb4c('0x28')](function(_0x2e327a){_0x5b91ae['rows']=_0x2e327a;return _0x5b91ae;})['then'](respondWithFilteredResult(_0x37daf3,_0x4ab08f))[_0xfb4c('0x46')](handleError(_0x37daf3,null));};exports[_0xfb4c('0x47')]=function(_0x357e74,_0x473c3c){var _0x46935c={'raw':!![],'where':{'id':_0x357e74['params']['id']}},_0x22d4e4={};_0x22d4e4['model']=_[_0xfb4c('0x48')](db['SmsQueueReport'][_0xfb4c('0x30')]);_0x22d4e4[_0xfb4c('0x35')]=_[_0xfb4c('0x48')](_0x357e74[_0xfb4c('0x35')]);_0x22d4e4[_0xfb4c('0x3e')]=_[_0xfb4c('0x36')](_0x22d4e4['model'],_0x22d4e4[_0xfb4c('0x35')]);_0x46935c[_0xfb4c('0x38')]=_[_0xfb4c('0x36')](_0x22d4e4[_0xfb4c('0x34')],qs['fields'](_0x357e74[_0xfb4c('0x35')][_0xfb4c('0x37')]));_0x46935c['attributes']=_0x46935c[_0xfb4c('0x38')][_0xfb4c('0x39')]?_0x46935c[_0xfb4c('0x38')]:_0x22d4e4['model'];if(_0x357e74[_0xfb4c('0x35')][_0xfb4c('0x43')]){_0x46935c[_0xfb4c('0x44')]=[{'all':!![]}];}_0x46935c=_[_0xfb4c('0x40')]({},_0x46935c,_0x357e74[_0xfb4c('0x42')]);return db['SmsQueueReport'][_0xfb4c('0x49')](_0x46935c)['then'](handleEntityNotFound(_0x473c3c,null))[_0xfb4c('0x28')](respondWithResult(_0x473c3c,null))[_0xfb4c('0x46')](handleError(_0x473c3c,null));};exports[_0xfb4c('0x4a')]=function(_0x1537b1,_0x109f47){return db['SmsQueueReport'][_0xfb4c('0x4a')](_0x1537b1['body'],{})[_0xfb4c('0x28')](respondWithResult(_0x109f47,0xc9))[_0xfb4c('0x46')](handleError(_0x109f47,null));};exports['update']=function(_0x69773,_0x16ab59){if(_0x69773[_0xfb4c('0x4b')]['id']){delete _0x69773[_0xfb4c('0x4b')]['id'];}return db[_0xfb4c('0x2f')][_0xfb4c('0x49')]({'where':{'id':_0x69773['params']['id']}})[_0xfb4c('0x28')](handleEntityNotFound(_0x16ab59,null))['then'](saveUpdates(_0x69773['body'],null))[_0xfb4c('0x28')](respondWithResult(_0x16ab59,null))[_0xfb4c('0x46')](handleError(_0x16ab59,null));};exports['destroy']=function(_0x5f49a3,_0x53df9b){return db['SmsQueueReport']['find']({'where':{'id':_0x5f49a3['params']['id']}})[_0xfb4c('0x28')](handleEntityNotFound(_0x53df9b,null))['then'](removeEntity(_0x53df9b,null))[_0xfb4c('0x46')](handleError(_0x53df9b,null));};exports[_0xfb4c('0x4c')]=function(_0x1f8504,_0x206ba6){return db['SmsQueueReport'][_0xfb4c('0x4c')]()[_0xfb4c('0x28')](respondWithResult(_0x206ba6,null))[_0xfb4c('0x46')](handleError(_0x206ba6,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index a8fdad0..2f9b7bd 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_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','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x14fe87,_0x28a837){var _0x306792=function(_0x3792ab){while(--_0x3792ab){_0x14fe87['push'](_0x14fe87['shift']());}};_0x306792(++_0x28a837);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index d9dfd64..b67f7cc 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 _0xe7bf=['where','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','SmsQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7bf,0x8e));var _0xfe7b=function(_0x4c53f2,_0x58a136){_0x4c53f2=_0x4c53f2-0x0;var _0x2fd8ab=_0xe7bf[_0x4c53f2];return _0x2fd8ab;};'use strict';var _=require(_0xfe7b('0x0'));var util=require('util');var moment=require(_0xfe7b('0x1'));var BPromise=require(_0xfe7b('0x2'));var rs=require(_0xfe7b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe7b('0x4'))['db'];var utils=require(_0xfe7b('0x5'));var logger=require(_0xfe7b('0x6'))(_0xfe7b('0x7'));var config=require(_0xfe7b('0x8'));var jayson=require(_0xfe7b('0x9'));var client=jayson[_0xfe7b('0xa')][_0xfe7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x188e67,_0xb0161e,_0x33a7e1){return new BPromise(function(_0x5625a6,_0x44880b){return client[_0xfe7b('0xc')](_0x188e67,_0x33a7e1)[_0xfe7b('0xd')](function(_0xee86e5){logger[_0xfe7b('0xe')](_0xfe7b('0xf'),_0xb0161e,_0xfe7b('0x10'));logger[_0xfe7b('0x11')](_0xfe7b('0x12'),_0xb0161e,_0xfe7b('0x10'),JSON[_0xfe7b('0x13')](_0xee86e5));if(_0xee86e5[_0xfe7b('0x14')]){if(_0xee86e5['error'][_0xfe7b('0x15')]===0x1f4){logger['error'](_0xfe7b('0xf'),_0xb0161e,_0xee86e5[_0xfe7b('0x14')][_0xfe7b('0x16')]);return _0x44880b(_0xee86e5[_0xfe7b('0x14')][_0xfe7b('0x16')]);}logger['error'](_0xfe7b('0xf'),_0xb0161e,_0xee86e5[_0xfe7b('0x14')]['message']);return _0x5625a6(_0xee86e5[_0xfe7b('0x14')][_0xfe7b('0x16')]);}else{logger[_0xfe7b('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0xb0161e,_0xfe7b('0x10'));_0x5625a6(_0xee86e5[_0xfe7b('0x17')][_0xfe7b('0x16')]);}})[_0xfe7b('0x18')](function(_0xed643b){logger[_0xfe7b('0x14')](_0xfe7b('0xf'),_0xb0161e,_0xed643b);_0x44880b(_0xed643b);});});}exports[_0xfe7b('0x19')]=function(_0x39fb71){var _0x511903=this;return new Promise(function(_0x59fd89,_0x9c308a){return db['SmsQueueReport'][_0xfe7b('0x1a')](_0x39fb71[_0xfe7b('0x1b')],{'raw':_0x39fb71['options']?_0x39fb71[_0xfe7b('0x1c')][_0xfe7b('0x1d')]===undefined?!![]:![]:!![]})[_0xfe7b('0xd')](function(_0x1361a9){logger['info']('CreateSmsQueueReport',_0x39fb71);logger[_0xfe7b('0x11')](_0xfe7b('0x19'),_0x39fb71,JSON[_0xfe7b('0x13')](_0x1361a9));_0x59fd89(_0x1361a9);})[_0xfe7b('0x18')](function(_0x448c34){logger[_0xfe7b('0x14')]('CreateSmsQueueReport',_0x448c34[_0xfe7b('0x16')],_0x39fb71);_0x9c308a(_0x511903[_0xfe7b('0x14')](0x1f4,_0x448c34['message']));});});};exports[_0xfe7b('0x1e')]=function(_0x54cdab){var _0x5c6f21=this;return new Promise(function(_0x312c39,_0x19405d){return db[_0xfe7b('0x1f')][_0xfe7b('0x20')](_0x54cdab[_0xfe7b('0x1b')],{'raw':_0x54cdab[_0xfe7b('0x1c')]?_0x54cdab[_0xfe7b('0x1c')][_0xfe7b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54cdab['options']?_0x54cdab[_0xfe7b('0x1c')][_0xfe7b('0x21')]||null:null,'attributes':_0x54cdab[_0xfe7b('0x1c')]?_0x54cdab[_0xfe7b('0x1c')]['attributes']||null:null,'limit':_0x54cdab['options']?_0x54cdab[_0xfe7b('0x1c')][_0xfe7b('0x22')]||null:null})[_0xfe7b('0xd')](function(_0x3630a9){logger[_0xfe7b('0xe')]('UpdateSmsQueueReport',_0x54cdab);logger['debug'](_0xfe7b('0x1e'),_0x54cdab,JSON['stringify'](_0x3630a9));_0x312c39(_0x3630a9);})['catch'](function(_0x16ed60){logger[_0xfe7b('0x14')](_0xfe7b('0x1e'),_0x16ed60[_0xfe7b('0x16')],_0x54cdab);_0x19405d(_0x5c6f21['error'](0x1f4,_0x16ed60[_0xfe7b('0x16')]));});});}; \ No newline at end of file +var _0xfa5c=['error','code','message','SmsQueueReport,\x20%s,\x20%s','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','then','stringify','UpdateSmsQueueReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xfa5c,0xb0));var _0xcfa5=function(_0x52cb89,_0x42fca1){_0x52cb89=_0x52cb89-0x0;var _0x4ab7be=_0xfa5c[_0x52cb89];return _0x4ab7be;};'use strict';var _=require(_0xcfa5('0x0'));var util=require(_0xcfa5('0x1'));var moment=require(_0xcfa5('0x2'));var BPromise=require(_0xcfa5('0x3'));var rs=require(_0xcfa5('0x4'));var fs=require('fs');var Redis=require(_0xcfa5('0x5'));var db=require(_0xcfa5('0x6'))['db'];var utils=require(_0xcfa5('0x7'));var logger=require('../../config/logger')(_0xcfa5('0x8'));var config=require(_0xcfa5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcfa5('0xa')][_0xcfa5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x519791,_0x336e73,_0x4b5979){return new BPromise(function(_0x28c94f,_0x5f3dbe){return client['request'](_0x519791,_0x4b5979)['then'](function(_0x45ca13){logger[_0xcfa5('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x336e73,_0xcfa5('0xd'));logger[_0xcfa5('0xe')](_0xcfa5('0xf'),_0x336e73,_0xcfa5('0xd'),JSON['stringify'](_0x45ca13));if(_0x45ca13[_0xcfa5('0x10')]){if(_0x45ca13[_0xcfa5('0x10')][_0xcfa5('0x11')]===0x1f4){logger[_0xcfa5('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x336e73,_0x45ca13['error'][_0xcfa5('0x12')]);return _0x5f3dbe(_0x45ca13['error'][_0xcfa5('0x12')]);}logger[_0xcfa5('0x10')](_0xcfa5('0x13'),_0x336e73,_0x45ca13[_0xcfa5('0x10')][_0xcfa5('0x12')]);return _0x28c94f(_0x45ca13[_0xcfa5('0x10')][_0xcfa5('0x12')]);}else{logger[_0xcfa5('0xc')](_0xcfa5('0x13'),_0x336e73,_0xcfa5('0xd'));_0x28c94f(_0x45ca13[_0xcfa5('0x14')][_0xcfa5('0x12')]);}})[_0xcfa5('0x15')](function(_0x472fad){logger[_0xcfa5('0x10')](_0xcfa5('0x13'),_0x336e73,_0x472fad);_0x5f3dbe(_0x472fad);});});}exports[_0xcfa5('0x16')]=function(_0x5bb4c8){var _0x46b9bb=this;return new Promise(function(_0x285c28,_0x2eea04){return db[_0xcfa5('0x17')]['create'](_0x5bb4c8[_0xcfa5('0x18')],{'raw':_0x5bb4c8['options']?_0x5bb4c8[_0xcfa5('0x19')][_0xcfa5('0x1a')]===undefined?!![]:![]:!![]})[_0xcfa5('0x1b')](function(_0x2d06b2){logger[_0xcfa5('0xc')](_0xcfa5('0x16'),_0x5bb4c8);logger[_0xcfa5('0xe')](_0xcfa5('0x16'),_0x5bb4c8,JSON[_0xcfa5('0x1c')](_0x2d06b2));_0x285c28(_0x2d06b2);})[_0xcfa5('0x15')](function(_0x47c617){logger[_0xcfa5('0x10')](_0xcfa5('0x16'),_0x47c617[_0xcfa5('0x12')],_0x5bb4c8);_0x2eea04(_0x46b9bb['error'](0x1f4,_0x47c617['message']));});});};exports[_0xcfa5('0x1d')]=function(_0xc14365){var _0x5836ba=this;return new Promise(function(_0x3da88b,_0x1845d6){return db[_0xcfa5('0x17')][_0xcfa5('0x1e')](_0xc14365['body'],{'raw':_0xc14365['options']?_0xc14365[_0xcfa5('0x19')][_0xcfa5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc14365[_0xcfa5('0x19')]?_0xc14365[_0xcfa5('0x19')]['where']||null:null,'attributes':_0xc14365[_0xcfa5('0x19')]?_0xc14365[_0xcfa5('0x19')]['attributes']||null:null,'limit':_0xc14365[_0xcfa5('0x19')]?_0xc14365[_0xcfa5('0x19')][_0xcfa5('0x1f')]||null:null})['then'](function(_0x350c66){logger[_0xcfa5('0xc')](_0xcfa5('0x1d'),_0xc14365);logger[_0xcfa5('0xe')](_0xcfa5('0x1d'),_0xc14365,JSON[_0xcfa5('0x1c')](_0x350c66));_0x3da88b(_0x350c66);})[_0xcfa5('0x15')](function(_0x13c40f){logger['error'](_0xcfa5('0x1d'),_0x13c40f['message'],_0xc14365);_0x1845d6(_0x5836ba[_0xcfa5('0x10')](0x1f4,_0x13c40f[_0xcfa5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 00fb14f..17910da 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 _0xed95=['isAuthenticated','describe','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','/describe'];(function(_0x2839f3,_0x49862f){var _0x11c9a7=function(_0x2b6e6d){while(--_0x2b6e6d){_0x2839f3['push'](_0x2839f3['shift']());}};_0x11c9a7(++_0x49862f);}(_0xed95,0xb9));var _0x5ed9=function(_0x1cb7ec,_0x5d5f93){_0x1cb7ec=_0x1cb7ec-0x0;var _0x697b5=_0xed95[_0x1cb7ec];return _0x697b5;};'use strict';var multer=require(_0x5ed9('0x0'));var util=require(_0x5ed9('0x1'));var path=require(_0x5ed9('0x2'));var timeout=require(_0x5ed9('0x3'));var express=require(_0x5ed9('0x4'));var router=express[_0x5ed9('0x5')]();var fs_extra=require(_0x5ed9('0x6'));var auth=require(_0x5ed9('0x7'));var interaction=require(_0x5ed9('0x8'));var config=require(_0x5ed9('0x9'));var controller=require(_0x5ed9('0xa'));router[_0x5ed9('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5ed9('0xb')](_0x5ed9('0xc'),auth[_0x5ed9('0xd')](),controller[_0x5ed9('0xe')]);router[_0x5ed9('0xb')](_0x5ed9('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x5ed9('0x10')]('/',auth[_0x5ed9('0xd')](),controller[_0x5ed9('0x11')]);router[_0x5ed9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5ed9('0x13')]);router[_0x5ed9('0x14')](_0x5ed9('0xf'),auth[_0x5ed9('0xd')](),controller['destroy']);module[_0x5ed9('0x15')]=router; \ No newline at end of file +var _0x950a=['/:id','isAuthenticated','show','post','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','index','describe'];(function(_0xdb7888,_0x54f2c7){var _0xc7cb4e=function(_0x1f01ae){while(--_0x1f01ae){_0xdb7888['push'](_0xdb7888['shift']());}};_0xc7cb4e(++_0x54f2c7);}(_0x950a,0x111));var _0xa950=function(_0xbfba6,_0x344461){_0xbfba6=_0xbfba6-0x0;var _0x3c5291=_0x950a[_0xbfba6];return _0x3c5291;};'use strict';var multer=require(_0xa950('0x0'));var util=require(_0xa950('0x1'));var path=require(_0xa950('0x2'));var timeout=require(_0xa950('0x3'));var express=require('express');var router=express[_0xa950('0x4')]();var fs_extra=require(_0xa950('0x5'));var auth=require(_0xa950('0x6'));var interaction=require(_0xa950('0x7'));var config=require('../../config/environment');var controller=require(_0xa950('0x8'));router[_0xa950('0x9')]('/',auth['isAuthenticated'](),controller[_0xa950('0xa')]);router[_0xa950('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xa950('0xb')]);router[_0xa950('0x9')](_0xa950('0xc'),auth[_0xa950('0xd')](),controller[_0xa950('0xe')]);router[_0xa950('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa950('0xc'),auth['isAuthenticated'](),controller[_0xa950('0x10')]);router[_0xa950('0x11')](_0xa950('0xc'),auth['isAuthenticated'](),controller[_0xa950('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index f15b6b4..f5519bf 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x39439f,_0x5de32c){var _0x5bb4d7=function(_0x4dfe56){while(--_0x4dfe56){_0x39439f['push'](_0x39439f['shift']());}};_0x5bb4d7(++_0x5de32c);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x159f9b,_0x5b015c){var _0x5af408=function(_0x3d8a15){while(--_0x3d8a15){_0x159f9b['push'](_0x159f9b['shift']());}};_0x5af408(++_0x5b015c);}(_0x54ef,0x112));var _0xf54e=function(_0x453419,_0x30efa9){_0x453419=_0x453419-0x0;var _0x3e5196=_0x54ef[_0x453419];return _0x3e5196;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index d8d9c2d..dcf7ad5 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 _0xeccc=['mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','error','stack','send','index','map','SmsTransferReport','rawAttributes','key','name','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','includeAll','include','findAll','rows','keys','merge','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','moment'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0xeccc,0x8e));var _0xcecc=function(_0x3564d6,_0x37d1cb){_0x3564d6=_0x3564d6-0x0;var _0x1f2267=_0xeccc[_0x3564d6];return _0x1f2267;};'use strict';var emlformat=require(_0xcecc('0x0'));var rimraf=require(_0xcecc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcecc('0x2'));var rp=require('request-promise');var moment=require(_0xcecc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcecc('0x4'));var util=require(_0xcecc('0x5'));var path=require('path');var sox=require(_0xcecc('0x6'));var csv=require(_0xcecc('0x7'));var ejs=require(_0xcecc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcecc('0x9'));var crypto=require('crypto');var jsforce=require(_0xcecc('0xa'));var deskjs=require(_0xcecc('0xb'));var toCsv=require(_0xcecc('0x7'));var querystring=require(_0xcecc('0xc'));var Papa=require(_0xcecc('0xd'));var Redis=require(_0xcecc('0xe'));var authService=require(_0xcecc('0xf'));var qs=require(_0xcecc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcecc('0x11'))(_0xcecc('0x12'));var utils=require('../../config/utils');var config=require(_0xcecc('0x13'));var licenseUtil=require(_0xcecc('0x14'));var db=require(_0xcecc('0x15'))['db'];function respondWithStatusCode(_0x584cf8,_0x4539a3){_0x4539a3=_0x4539a3||0xcc;return function(_0x2c22fc){if(_0x2c22fc){return _0x584cf8[_0xcecc('0x16')](_0x4539a3);}return _0x584cf8[_0xcecc('0x17')](_0x4539a3)[_0xcecc('0x18')]();};}function respondWithResult(_0x26147b,_0x2fed5c){_0x2fed5c=_0x2fed5c||0xc8;return function(_0x45b705){if(_0x45b705){return _0x26147b['status'](_0x2fed5c)['json'](_0x45b705);}};}function respondWithFilteredResult(_0x53fe75,_0x4e8e35){return function(_0x213a90){if(_0x213a90){var _0x545e15=typeof _0x4e8e35[_0xcecc('0x19')]===_0xcecc('0x1a')&&typeof _0x4e8e35[_0xcecc('0x1b')]===_0xcecc('0x1a');var _0x5f571a=_0x213a90[_0xcecc('0x1c')];var _0x28a5b0=_0x545e15?0x0:_0x4e8e35[_0xcecc('0x19')];var _0x49fd8f=_0x545e15?_0x213a90[_0xcecc('0x1c')]:_0x4e8e35['offset']+_0x4e8e35[_0xcecc('0x1b')];var _0x4a5c88;if(_0x49fd8f>=_0x5f571a){_0x49fd8f=_0x5f571a;_0x4a5c88=0xc8;}else{_0x4a5c88=0xce;}_0x53fe75[_0xcecc('0x17')](_0x4a5c88);return _0x53fe75[_0xcecc('0x1d')]('Content-Range',_0x28a5b0+'-'+_0x49fd8f+'/'+_0x5f571a)[_0xcecc('0x1e')](_0x213a90);}return null;};}function patchUpdates(_0x3c6e8f){return function(_0xfa7e83){try{jsonpatch[_0xcecc('0x1f')](_0xfa7e83,_0x3c6e8f,!![]);}catch(_0x4a3bde){return BPromise[_0xcecc('0x20')](_0x4a3bde);}return _0xfa7e83[_0xcecc('0x21')]();};}function saveUpdates(_0x1705e3,_0x42928e){return function(_0x5e5fa1){if(_0x5e5fa1){return _0x5e5fa1[_0xcecc('0x22')](_0x1705e3)['then'](function(_0x33d92c){return _0x33d92c;});}return null;};}function removeEntity(_0x2bc586,_0x23144a){return function(_0xd74b72){if(_0xd74b72){return _0xd74b72[_0xcecc('0x23')]()[_0xcecc('0x24')](function(){_0x2bc586['status'](0xcc)[_0xcecc('0x18')]();});}};}function handleEntityNotFound(_0x5e0571,_0xc348f8){return function(_0x2e9506){if(!_0x2e9506){_0x5e0571[_0xcecc('0x16')](0x194);}return _0x2e9506;};}function handleError(_0x2086fd,_0x55b701){_0x55b701=_0x55b701||0x1f4;return function(_0x4cb9da){logger[_0xcecc('0x25')](_0x4cb9da[_0xcecc('0x26')]);if(_0x4cb9da['name']){delete _0x4cb9da['name'];}_0x2086fd['status'](_0x55b701)[_0xcecc('0x27')](_0x4cb9da);};}exports[_0xcecc('0x28')]=function(_0x30505c,_0x4b5377){var _0x4ea439={},_0x1a5e06={},_0x121dad={'count':0x0,'rows':[]};var _0x142890=_[_0xcecc('0x29')](db[_0xcecc('0x2a')][_0xcecc('0x2b')],function(_0x9d1721){return{'name':_0x9d1721['fieldName'],'type':_0x9d1721['type'][_0xcecc('0x2c')]};});_0x1a5e06['model']=_[_0xcecc('0x29')](_0x142890,_0xcecc('0x2d'));_0x1a5e06[_0xcecc('0x2e')]=_['keys'](_0x30505c[_0xcecc('0x2e')]);_0x1a5e06['filters']=_[_0xcecc('0x2f')](_0x1a5e06[_0xcecc('0x30')],_0x1a5e06['query']);_0x4ea439[_0xcecc('0x31')]=_[_0xcecc('0x2f')](_0x1a5e06[_0xcecc('0x30')],qs[_0xcecc('0x32')](_0x30505c['query'][_0xcecc('0x32')]));_0x4ea439[_0xcecc('0x31')]=_0x4ea439[_0xcecc('0x31')][_0xcecc('0x33')]?_0x4ea439[_0xcecc('0x31')]:_0x1a5e06[_0xcecc('0x30')];if(!_0x30505c[_0xcecc('0x2e')][_0xcecc('0x34')](_0xcecc('0x35'))){_0x4ea439[_0xcecc('0x1b')]=qs[_0xcecc('0x1b')](_0x30505c[_0xcecc('0x2e')][_0xcecc('0x1b')]);_0x4ea439[_0xcecc('0x19')]=qs[_0xcecc('0x19')](_0x30505c[_0xcecc('0x2e')][_0xcecc('0x19')]);}_0x4ea439[_0xcecc('0x36')]=qs[_0xcecc('0x37')](_0x30505c[_0xcecc('0x2e')][_0xcecc('0x37')]);_0x4ea439[_0xcecc('0x38')]=qs[_0xcecc('0x39')](_[_0xcecc('0x3a')](_0x30505c['query'],_0x1a5e06['filters']),_0x142890);if(_0x30505c[_0xcecc('0x2e')]['filter']){_0x4ea439[_0xcecc('0x38')]=_['merge'](_0x4ea439[_0xcecc('0x38')],{'$or':_['map'](_0x142890,function(_0x2e74a8){if(_0x2e74a8['type']!==_0xcecc('0x3b')){var _0x342421={};_0x342421[_0x2e74a8[_0xcecc('0x2d')]]={'$like':'%'+_0x30505c[_0xcecc('0x2e')][_0xcecc('0x3c')]+'%'};return _0x342421;}})});}_0x4ea439=_['merge']({},_0x4ea439,_0x30505c['options']);var _0x15c4c6={'where':_0x4ea439[_0xcecc('0x38')]};return db['SmsTransferReport'][_0xcecc('0x1c')](_0x15c4c6)[_0xcecc('0x24')](function(_0x4ca30c){_0x121dad[_0xcecc('0x1c')]=_0x4ca30c;if(_0x30505c[_0xcecc('0x2e')][_0xcecc('0x3d')]){_0x4ea439[_0xcecc('0x3e')]=[{'all':!![]}];}return db[_0xcecc('0x2a')][_0xcecc('0x3f')](_0x4ea439);})['then'](function(_0x43074b){_0x121dad[_0xcecc('0x40')]=_0x43074b;return _0x121dad;})['then'](respondWithFilteredResult(_0x4b5377,_0x4ea439))['catch'](handleError(_0x4b5377,null));};exports['show']=function(_0x4ecf74,_0xf84d62){var _0x5a61d8={'raw':!![],'where':{'id':_0x4ecf74['params']['id']}},_0xa6ab61={};_0xa6ab61[_0xcecc('0x30')]=_['keys'](db[_0xcecc('0x2a')][_0xcecc('0x2b')]);_0xa6ab61[_0xcecc('0x2e')]=_[_0xcecc('0x41')](_0x4ecf74[_0xcecc('0x2e')]);_0xa6ab61[_0xcecc('0x39')]=_[_0xcecc('0x2f')](_0xa6ab61['model'],_0xa6ab61['query']);_0x5a61d8[_0xcecc('0x31')]=_[_0xcecc('0x2f')](_0xa6ab61[_0xcecc('0x30')],qs['fields'](_0x4ecf74['query'][_0xcecc('0x32')]));_0x5a61d8[_0xcecc('0x31')]=_0x5a61d8[_0xcecc('0x31')][_0xcecc('0x33')]?_0x5a61d8['attributes']:_0xa6ab61[_0xcecc('0x30')];if(_0x4ecf74['query'][_0xcecc('0x3d')]){_0x5a61d8['include']=[{'all':!![]}];}_0x5a61d8=_[_0xcecc('0x42')]({},_0x5a61d8,_0x4ecf74['options']);return db[_0xcecc('0x2a')][_0xcecc('0x43')](_0x5a61d8)[_0xcecc('0x24')](handleEntityNotFound(_0xf84d62,null))[_0xcecc('0x24')](respondWithResult(_0xf84d62,null))[_0xcecc('0x44')](handleError(_0xf84d62,null));};exports[_0xcecc('0x45')]=function(_0x28dbc8,_0x2f29a8){return db['SmsTransferReport'][_0xcecc('0x45')](_0x28dbc8['body'],{})[_0xcecc('0x24')](respondWithResult(_0x2f29a8,0xc9))['catch'](handleError(_0x2f29a8,null));};exports[_0xcecc('0x22')]=function(_0x3bb3fe,_0x521ae8){if(_0x3bb3fe[_0xcecc('0x46')]['id']){delete _0x3bb3fe[_0xcecc('0x46')]['id'];}return db['SmsTransferReport'][_0xcecc('0x43')]({'where':{'id':_0x3bb3fe[_0xcecc('0x47')]['id']}})[_0xcecc('0x24')](handleEntityNotFound(_0x521ae8,null))[_0xcecc('0x24')](saveUpdates(_0x3bb3fe[_0xcecc('0x46')],null))[_0xcecc('0x24')](respondWithResult(_0x521ae8,null))[_0xcecc('0x44')](handleError(_0x521ae8,null));};exports['destroy']=function(_0x34bdbd,_0x2cbe3d){return db[_0xcecc('0x2a')][_0xcecc('0x43')]({'where':{'id':_0x34bdbd[_0xcecc('0x47')]['id']}})[_0xcecc('0x24')](handleEntityNotFound(_0x2cbe3d,null))[_0xcecc('0x24')](removeEntity(_0x2cbe3d,null))[_0xcecc('0x44')](handleError(_0x2cbe3d,null));};exports[_0xcecc('0x48')]=function(_0x4c2c26,_0x4860bd){return db[_0xcecc('0x2a')][_0xcecc('0x48')]()[_0xcecc('0x24')](respondWithResult(_0x4860bd,null))[_0xcecc('0x44')](handleError(_0x4860bd,null));}; \ No newline at end of file +var _0xf556=['nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','apply','reject','save','update','then','destroy','error','name','index','SmsTransferReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x14ef73,_0x3fc6b7){var _0x442f54=function(_0x121510){while(--_0x121510){_0x14ef73['push'](_0x14ef73['shift']());}};_0x442f54(++_0x3fc6b7);}(_0xf556,0x12e));var _0x6f55=function(_0x3ea61c,_0x42150f){_0x3ea61c=_0x3ea61c-0x0;var _0x5a9497=_0xf556[_0x3ea61c];return _0x5a9497;};'use strict';var emlformat=require(_0x6f55('0x0'));var rimraf=require(_0x6f55('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6f55('0x2'));var moment=require(_0x6f55('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f55('0x4'));var util=require(_0x6f55('0x5'));var path=require('path');var sox=require(_0x6f55('0x6'));var csv=require(_0x6f55('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6f55('0x8'));var crypto=require(_0x6f55('0x9'));var jsforce=require(_0x6f55('0xa'));var deskjs=require(_0x6f55('0xb'));var toCsv=require(_0x6f55('0x7'));var querystring=require(_0x6f55('0xc'));var Papa=require(_0x6f55('0xd'));var Redis=require(_0x6f55('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6f55('0xf'));var as=require(_0x6f55('0x10'));var hardwareService=require(_0x6f55('0x11'));var logger=require(_0x6f55('0x12'))('api');var utils=require(_0x6f55('0x13'));var config=require(_0x6f55('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f55('0x15'))['db'];function respondWithStatusCode(_0x489280,_0x46f321){_0x46f321=_0x46f321||0xcc;return function(_0x576d8d){if(_0x576d8d){return _0x489280[_0x6f55('0x16')](_0x46f321);}return _0x489280[_0x6f55('0x17')](_0x46f321)[_0x6f55('0x18')]();};}function respondWithResult(_0x5508de,_0x5889e7){_0x5889e7=_0x5889e7||0xc8;return function(_0x5285f5){if(_0x5285f5){return _0x5508de[_0x6f55('0x17')](_0x5889e7)[_0x6f55('0x19')](_0x5285f5);}};}function respondWithFilteredResult(_0xf0695a,_0x190b81){return function(_0x274ce9){if(_0x274ce9){var _0x433074=typeof _0x190b81[_0x6f55('0x1a')]==='undefined'&&typeof _0x190b81[_0x6f55('0x1b')]==='undefined';var _0x2de01a=_0x274ce9[_0x6f55('0x1c')];var _0x1bae58=_0x433074?0x0:_0x190b81['offset'];var _0xbc43b8=_0x433074?_0x274ce9[_0x6f55('0x1c')]:_0x190b81['offset']+_0x190b81[_0x6f55('0x1b')];var _0x558007;if(_0xbc43b8>=_0x2de01a){_0xbc43b8=_0x2de01a;_0x558007=0xc8;}else{_0x558007=0xce;}_0xf0695a[_0x6f55('0x17')](_0x558007);return _0xf0695a['set']('Content-Range',_0x1bae58+'-'+_0xbc43b8+'/'+_0x2de01a)[_0x6f55('0x19')](_0x274ce9);}return null;};}function patchUpdates(_0xb41266){return function(_0x2f48d4){try{jsonpatch[_0x6f55('0x1d')](_0x2f48d4,_0xb41266,!![]);}catch(_0x55e6a4){return BPromise[_0x6f55('0x1e')](_0x55e6a4);}return _0x2f48d4[_0x6f55('0x1f')]();};}function saveUpdates(_0x1b104b,_0xfe5f34){return function(_0x1c78fd){if(_0x1c78fd){return _0x1c78fd[_0x6f55('0x20')](_0x1b104b)[_0x6f55('0x21')](function(_0x1ebfa9){return _0x1ebfa9;});}return null;};}function removeEntity(_0x6a8462,_0x20f57a){return function(_0x1544c5){if(_0x1544c5){return _0x1544c5[_0x6f55('0x22')]()[_0x6f55('0x21')](function(){_0x6a8462['status'](0xcc)[_0x6f55('0x18')]();});}};}function handleEntityNotFound(_0x19b67b,_0x50d1e3){return function(_0x56c9b3){if(!_0x56c9b3){_0x19b67b[_0x6f55('0x16')](0x194);}return _0x56c9b3;};}function handleError(_0x37ddf4,_0x5e8ce1){_0x5e8ce1=_0x5e8ce1||0x1f4;return function(_0x541ad6){logger[_0x6f55('0x23')](_0x541ad6['stack']);if(_0x541ad6[_0x6f55('0x24')]){delete _0x541ad6['name'];}_0x37ddf4[_0x6f55('0x17')](_0x5e8ce1)['send'](_0x541ad6);};}exports[_0x6f55('0x25')]=function(_0x4a65cd,_0x49ef8e){var _0xf265ae={},_0xabb02f={},_0x2bedc9={'count':0x0,'rows':[]};var _0x3a7f60=_['map'](db[_0x6f55('0x26')][_0x6f55('0x27')],function(_0x4c0151){return{'name':_0x4c0151[_0x6f55('0x28')],'type':_0x4c0151[_0x6f55('0x29')][_0x6f55('0x2a')]};});_0xabb02f[_0x6f55('0x2b')]=_[_0x6f55('0x2c')](_0x3a7f60,_0x6f55('0x24'));_0xabb02f['query']=_[_0x6f55('0x2d')](_0x4a65cd[_0x6f55('0x2e')]);_0xabb02f[_0x6f55('0x2f')]=_['intersection'](_0xabb02f[_0x6f55('0x2b')],_0xabb02f[_0x6f55('0x2e')]);_0xf265ae[_0x6f55('0x30')]=_[_0x6f55('0x31')](_0xabb02f[_0x6f55('0x2b')],qs[_0x6f55('0x32')](_0x4a65cd[_0x6f55('0x2e')][_0x6f55('0x32')]));_0xf265ae['attributes']=_0xf265ae[_0x6f55('0x30')][_0x6f55('0x33')]?_0xf265ae[_0x6f55('0x30')]:_0xabb02f[_0x6f55('0x2b')];if(!_0x4a65cd[_0x6f55('0x2e')][_0x6f55('0x34')](_0x6f55('0x35'))){_0xf265ae['limit']=qs[_0x6f55('0x1b')](_0x4a65cd[_0x6f55('0x2e')]['limit']);_0xf265ae['offset']=qs[_0x6f55('0x1a')](_0x4a65cd[_0x6f55('0x2e')]['offset']);}_0xf265ae['order']=qs[_0x6f55('0x36')](_0x4a65cd[_0x6f55('0x2e')][_0x6f55('0x36')]);_0xf265ae[_0x6f55('0x37')]=qs['filters'](_[_0x6f55('0x38')](_0x4a65cd['query'],_0xabb02f['filters']),_0x3a7f60);if(_0x4a65cd['query'][_0x6f55('0x39')]){_0xf265ae['where']=_[_0x6f55('0x3a')](_0xf265ae[_0x6f55('0x37')],{'$or':_[_0x6f55('0x2c')](_0x3a7f60,function(_0x352d06){if(_0x352d06['type']!=='VIRTUAL'){var _0x2e26c0={};_0x2e26c0[_0x352d06['name']]={'$like':'%'+_0x4a65cd[_0x6f55('0x2e')][_0x6f55('0x39')]+'%'};return _0x2e26c0;}})});}_0xf265ae=_['merge']({},_0xf265ae,_0x4a65cd['options']);var _0x52b787={'where':_0xf265ae[_0x6f55('0x37')]};return db[_0x6f55('0x26')]['count'](_0x52b787)[_0x6f55('0x21')](function(_0x1cf26e){_0x2bedc9['count']=_0x1cf26e;if(_0x4a65cd[_0x6f55('0x2e')][_0x6f55('0x3b')]){_0xf265ae[_0x6f55('0x3c')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x6f55('0x3d')](_0xf265ae);})[_0x6f55('0x21')](function(_0x2eb265){_0x2bedc9[_0x6f55('0x3e')]=_0x2eb265;return _0x2bedc9;})[_0x6f55('0x21')](respondWithFilteredResult(_0x49ef8e,_0xf265ae))[_0x6f55('0x3f')](handleError(_0x49ef8e,null));};exports[_0x6f55('0x40')]=function(_0x1d2b59,_0x577074){var _0x520a8e={'raw':!![],'where':{'id':_0x1d2b59[_0x6f55('0x41')]['id']}},_0x4e15e7={};_0x4e15e7[_0x6f55('0x2b')]=_[_0x6f55('0x2d')](db['SmsTransferReport'][_0x6f55('0x27')]);_0x4e15e7[_0x6f55('0x2e')]=_[_0x6f55('0x2d')](_0x1d2b59[_0x6f55('0x2e')]);_0x4e15e7[_0x6f55('0x2f')]=_[_0x6f55('0x31')](_0x4e15e7['model'],_0x4e15e7[_0x6f55('0x2e')]);_0x520a8e[_0x6f55('0x30')]=_[_0x6f55('0x31')](_0x4e15e7[_0x6f55('0x2b')],qs[_0x6f55('0x32')](_0x1d2b59['query']['fields']));_0x520a8e[_0x6f55('0x30')]=_0x520a8e[_0x6f55('0x30')]['length']?_0x520a8e['attributes']:_0x4e15e7[_0x6f55('0x2b')];if(_0x1d2b59[_0x6f55('0x2e')][_0x6f55('0x3b')]){_0x520a8e[_0x6f55('0x3c')]=[{'all':!![]}];}_0x520a8e=_[_0x6f55('0x3a')]({},_0x520a8e,_0x1d2b59[_0x6f55('0x42')]);return db['SmsTransferReport'][_0x6f55('0x43')](_0x520a8e)[_0x6f55('0x21')](handleEntityNotFound(_0x577074,null))[_0x6f55('0x21')](respondWithResult(_0x577074,null))[_0x6f55('0x3f')](handleError(_0x577074,null));};exports[_0x6f55('0x44')]=function(_0x2d0fa9,_0x32cec1){return db[_0x6f55('0x26')][_0x6f55('0x44')](_0x2d0fa9[_0x6f55('0x45')],{})[_0x6f55('0x21')](respondWithResult(_0x32cec1,0xc9))[_0x6f55('0x3f')](handleError(_0x32cec1,null));};exports[_0x6f55('0x20')]=function(_0x966e57,_0x403168){if(_0x966e57[_0x6f55('0x45')]['id']){delete _0x966e57[_0x6f55('0x45')]['id'];}return db[_0x6f55('0x26')][_0x6f55('0x43')]({'where':{'id':_0x966e57[_0x6f55('0x41')]['id']}})['then'](handleEntityNotFound(_0x403168,null))['then'](saveUpdates(_0x966e57[_0x6f55('0x45')],null))[_0x6f55('0x21')](respondWithResult(_0x403168,null))[_0x6f55('0x3f')](handleError(_0x403168,null));};exports[_0x6f55('0x22')]=function(_0xb1926f,_0x47340d){return db[_0x6f55('0x26')][_0x6f55('0x43')]({'where':{'id':_0xb1926f[_0x6f55('0x41')]['id']}})['then'](handleEntityNotFound(_0x47340d,null))[_0x6f55('0x21')](removeEntity(_0x47340d,null))[_0x6f55('0x3f')](handleError(_0x47340d,null));};exports[_0x6f55('0x46')]=function(_0x59b2b4,_0x5a9e94){return db['SmsTransferReport'][_0x6f55('0x46')]()['then'](respondWithResult(_0x5a9e94,null))[_0x6f55('0x3f')](handleError(_0x5a9e94,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 7f89d5a..23b4aa2 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 _0xdcd9=['SmsTransferReport','report_sms_transfer','uniqueid','util','api','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define'];(function(_0x39242b,_0x34b49a){var _0x4403fc=function(_0x21aead){while(--_0x21aead){_0x39242b['push'](_0x39242b['shift']());}};_0x4403fc(++_0x34b49a);}(_0xdcd9,0xf5));var _0x9dcd=function(_0x435f08,_0xc91841){_0x435f08=_0x435f08-0x0;var _0x4e40ba=_0xdcd9[_0x435f08];return _0x4e40ba;};'use strict';var _=require('lodash');var util=require(_0x9dcd('0x0'));var logger=require('../../config/logger')(_0x9dcd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9dcd('0x2'));var fs=require('fs');var path=require(_0x9dcd('0x3'));var rimraf=require(_0x9dcd('0x4'));var config=require(_0x9dcd('0x5'));var attributes=require(_0x9dcd('0x6'));module['exports']=function(_0x5ae811,_0xd105d3){return _0x5ae811[_0x9dcd('0x7')](_0x9dcd('0x8'),attributes,{'tableName':_0x9dcd('0x9'),'paranoid':![],'indexes':[{'name':_0x9dcd('0xa'),'fields':[_0x9dcd('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1641=['path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x28aae2,_0xf06c69){var _0x5d0749=function(_0x3025c0){while(--_0x3025c0){_0x28aae2['push'](_0x28aae2['shift']());}};_0x5d0749(++_0xf06c69);}(_0x1641,0x153));var _0x1164=function(_0x307145,_0x68be7e){_0x307145=_0x307145-0x0;var _0x307b5f=_0x1641[_0x307145];return _0x307b5f;};'use strict';var _=require(_0x1164('0x0'));var util=require(_0x1164('0x1'));var logger=require(_0x1164('0x2'))('api');var moment=require(_0x1164('0x3'));var BPromise=require(_0x1164('0x4'));var rp=require(_0x1164('0x5'));var fs=require('fs');var path=require(_0x1164('0x6'));var rimraf=require(_0x1164('0x7'));var config=require(_0x1164('0x8'));var attributes=require(_0x1164('0x9'));module[_0x1164('0xa')]=function(_0x3ad2f9,_0x2b616c){return _0x3ad2f9[_0x1164('0xb')](_0x1164('0xc'),attributes,{'tableName':_0x1164('0xd'),'paranoid':![],'indexes':[{'name':_0x1164('0xe'),'fields':[_0x1164('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 0fa3d21..999fc3a 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 _0xb5bb=['result','catch','lodash','util','moment','randomstring','ioredis','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x44e2d5,_0x4419b7){var _0x2d6e20=function(_0x20007b){while(--_0x20007b){_0x44e2d5['push'](_0x44e2d5['shift']());}};_0x2d6e20(++_0x4419b7);}(_0xb5bb,0x1ba));var _0xbb5b=function(_0x19b3c9,_0xd6deb6){_0x19b3c9=_0x19b3c9-0x0;var _0x3bcfcc=_0xb5bb[_0x19b3c9];return _0x3bcfcc;};'use strict';var _=require(_0xbb5b('0x0'));var util=require(_0xbb5b('0x1'));var moment=require(_0xbb5b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbb5b('0x3'));var fs=require('fs');var Redis=require(_0xbb5b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb5b('0x5')][_0xbb5b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5b03cd,_0x1d8453,_0x10d8fb){return new BPromise(function(_0x31eaa6,_0x11cc7e){return client[_0xbb5b('0x7')](_0x5b03cd,_0x10d8fb)[_0xbb5b('0x8')](function(_0x1b90ec){logger[_0xbb5b('0x9')](_0xbb5b('0xa'),_0x1d8453,_0xbb5b('0xb'));logger[_0xbb5b('0xc')](_0xbb5b('0xd'),_0x1d8453,_0xbb5b('0xb'),JSON[_0xbb5b('0xe')](_0x1b90ec));if(_0x1b90ec[_0xbb5b('0xf')]){if(_0x1b90ec[_0xbb5b('0xf')][_0xbb5b('0x10')]===0x1f4){logger[_0xbb5b('0xf')](_0xbb5b('0xa'),_0x1d8453,_0x1b90ec[_0xbb5b('0xf')]['message']);return _0x11cc7e(_0x1b90ec[_0xbb5b('0xf')]['message']);}logger[_0xbb5b('0xf')](_0xbb5b('0xa'),_0x1d8453,_0x1b90ec[_0xbb5b('0xf')][_0xbb5b('0x11')]);return _0x31eaa6(_0x1b90ec['error'][_0xbb5b('0x11')]);}else{logger[_0xbb5b('0x9')](_0xbb5b('0xa'),_0x1d8453,_0xbb5b('0xb'));_0x31eaa6(_0x1b90ec[_0xbb5b('0x12')]['message']);}})[_0xbb5b('0x13')](function(_0x380044){logger[_0xbb5b('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x1d8453,_0x380044);_0x11cc7e(_0x380044);});});} \ No newline at end of file +var _0x63b6=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x43e0e0,_0x177ed){var _0x54efa5=function(_0x33bfb5){while(--_0x33bfb5){_0x43e0e0['push'](_0x43e0e0['shift']());}};_0x54efa5(++_0x177ed);}(_0x63b6,0x127));var _0x663b=function(_0x3c28aa,_0x4bba43){_0x3c28aa=_0x3c28aa-0x0;var _0x161a1f=_0x63b6[_0x3c28aa];return _0x161a1f;};'use strict';var _=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var moment=require(_0x663b('0x2'));var BPromise=require('bluebird');var rs=require(_0x663b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x663b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x663b('0x5'))(_0x663b('0x6'));var config=require(_0x663b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x663b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x210eb1,_0x53f5cf,_0x414dc2){return new BPromise(function(_0x2976ff,_0xf8f3ff){return client[_0x663b('0x9')](_0x210eb1,_0x414dc2)[_0x663b('0xa')](function(_0x1e1698){logger['info'](_0x663b('0xb'),_0x53f5cf,_0x663b('0xc'));logger[_0x663b('0xd')](_0x663b('0xe'),_0x53f5cf,_0x663b('0xc'),JSON[_0x663b('0xf')](_0x1e1698));if(_0x1e1698[_0x663b('0x10')]){if(_0x1e1698[_0x663b('0x10')][_0x663b('0x11')]===0x1f4){logger[_0x663b('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x53f5cf,_0x1e1698['error'][_0x663b('0x12')]);return _0xf8f3ff(_0x1e1698[_0x663b('0x10')][_0x663b('0x12')]);}logger[_0x663b('0x10')](_0x663b('0xb'),_0x53f5cf,_0x1e1698[_0x663b('0x10')]['message']);return _0x2976ff(_0x1e1698[_0x663b('0x10')][_0x663b('0x12')]);}else{logger[_0x663b('0x13')](_0x663b('0xb'),_0x53f5cf,_0x663b('0xc'));_0x2976ff(_0x1e1698[_0x663b('0x14')][_0x663b('0x12')]);}})[_0x663b('0x15')](function(_0x63443b){logger[_0x663b('0x10')](_0x663b('0xb'),_0x53f5cf,_0x63443b);_0xf8f3ff(_0x63443b);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f37f12b..8fe7ac4 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 _0x8573=['create','put','/:id','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','%s-%s%s','basename','extname','now','post'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8573,0x10b));var _0x3857=function(_0x1d894a,_0x44e2f1){_0x1d894a=_0x1d894a-0x0;var _0xa17a68=_0x8573[_0x1d894a];return _0xa17a68;};'use strict';var multer=require(_0x3857('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3857('0x1'));var express=require(_0x3857('0x2'));var router=express[_0x3857('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3857('0x4'));var interaction=require(_0x3857('0x5'));var config=require(_0x3857('0x6'));var controller=require(_0x3857('0x7'));router['get']('/',auth[_0x3857('0x8')](),controller[_0x3857('0x9')]);router[_0x3857('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3857('0xb')]);router[_0x3857('0xa')](_0x3857('0xc'),auth[_0x3857('0x8')](),controller[_0x3857('0xd')]);var upload=multer({'storage':multer[_0x3857('0xe')]({'destination':function(_0x5024d9,_0x12c6e3,_0x5bef90){_0x5bef90(null,path[_0x3857('0xf')](config['root'],_0x3857('0x10')));},'filename':function(_0x4c6046,_0x2b73a5,_0x1161fd){_0x2b73a5[_0x3857('0x11')]=_0x2b73a5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1161fd(null,util['format'](_0x3857('0x12'),path[_0x3857('0x13')](_0x2b73a5['originalname'],path[_0x3857('0x14')](_0x2b73a5['originalname'])),Date[_0x3857('0x15')](),path['extname'](_0x2b73a5[_0x3857('0x11')])));}})});router[_0x3857('0x16')]('/',upload['single']('file'),controller[_0x3857('0x17')]);router[_0x3857('0x18')](_0x3857('0x19'),auth[_0x3857('0x8')](),controller[_0x3857('0x1a')]);router[_0x3857('0x1b')](_0x3857('0x19'),auth[_0x3857('0x8')](),controller['delete']);module[_0x3857('0x1c')]=router; \ No newline at end of file +var _0xc666=['/:id/download','diskStorage','join','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0xd02c57,_0x5e3071){var _0x187b3c=function(_0x48ccf7){while(--_0x48ccf7){_0xd02c57['push'](_0xd02c57['shift']());}};_0x187b3c(++_0x5e3071);}(_0xc666,0xad));var _0x6c66=function(_0x366c6e,_0xa4cf5c){_0x366c6e=_0x366c6e-0x0;var _0x458cc6=_0xc666[_0x366c6e];return _0x458cc6;};'use strict';var multer=require(_0x6c66('0x0'));var util=require(_0x6c66('0x1'));var path=require('path');var timeout=require(_0x6c66('0x2'));var express=require(_0x6c66('0x3'));var router=express[_0x6c66('0x4')]();var fs_extra=require(_0x6c66('0x5'));var auth=require(_0x6c66('0x6'));var interaction=require(_0x6c66('0x7'));var config=require(_0x6c66('0x8'));var controller=require('./sound.controller');router['get']('/',auth[_0x6c66('0x9')](),controller[_0x6c66('0xa')]);router[_0x6c66('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x6c66('0xc')]);router[_0x6c66('0xb')](_0x6c66('0xd'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x6c66('0xe')]({'destination':function(_0x2f8ed3,_0x34cda4,_0x245629){_0x245629(null,path[_0x6c66('0xf')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x15d211,_0x39f666,_0x19b7d9){_0x39f666[_0x6c66('0x10')]=_0x39f666[_0x6c66('0x10')][_0x6c66('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x19b7d9(null,util[_0x6c66('0x12')](_0x6c66('0x13'),path[_0x6c66('0x14')](_0x39f666['originalname'],path[_0x6c66('0x15')](_0x39f666[_0x6c66('0x10')])),Date[_0x6c66('0x16')](),path[_0x6c66('0x15')](_0x39f666[_0x6c66('0x10')])));}})});router[_0x6c66('0x17')]('/',upload[_0x6c66('0x18')]('file'),controller[_0x6c66('0x19')]);router[_0x6c66('0x1a')](_0x6c66('0x1b'),auth[_0x6c66('0x9')](),controller[_0x6c66('0x1c')]);router[_0x6c66('0x1d')](_0x6c66('0x1b'),auth[_0x6c66('0x9')](),controller[_0x6c66('0x1d')]);module[_0x6c66('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 12c1657..f9dd212 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 _0x64c4=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING','name'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x64c4,0x11b));var _0x464c=function(_0x1ca15c,_0x371269){_0x1ca15c=_0x1ca15c-0x0;var _0x215752=_0x64c4[_0x1ca15c];return _0x215752;};'use strict';var Sequelize=require(_0x464c('0x0'));module[_0x464c('0x1')]={'name':{'type':Sequelize[_0x464c('0x2')],'unique':_0x464c('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x464c('0x2')]},'display_name':{'type':Sequelize[_0x464c('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x464c('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x464c('0x4')]},'original_sampleCount':{'type':Sequelize[_0x464c('0x5')]},'original_channelCount':{'type':Sequelize[_0x464c('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x464c('0x2')]},'converted_duration':{'type':Sequelize[_0x464c('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x464c('0x5')]},'converted_channelCount':{'type':Sequelize[_0x464c('0x6')]},'converted_bitRate':{'type':Sequelize[_0x464c('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4fed=['name','FLOAT','INTEGER','BIGINT','sequelize','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4fed,0x18a));var _0xd4fe=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x4fed[_0x403c20];return _0x2b271a;};'use strict';var Sequelize=require(_0xd4fe('0x0'));module['exports']={'name':{'type':Sequelize[_0xd4fe('0x1')],'unique':_0xd4fe('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xd4fe('0x1')]},'display_name':{'type':Sequelize[_0xd4fe('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xd4fe('0x1')]},'original_format':{'type':Sequelize[_0xd4fe('0x1')]},'original_duration':{'type':Sequelize[_0xd4fe('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xd4fe('0x4')]},'original_bitRate':{'type':Sequelize[_0xd4fe('0x5')]},'original_sampleRate':{'type':Sequelize[_0xd4fe('0x4')]},'converted_format':{'type':Sequelize[_0xd4fe('0x1')]},'converted_duration':{'type':Sequelize[_0xd4fe('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xd4fe('0x5')]},'converted_channelCount':{'type':Sequelize[_0xd4fe('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xd4fe('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index b772832..95f0122 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 _0x6ff1=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','Sounds','UserProfileResource','error','name','send','index','map','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','include','Sound','findAll','rows','show','params','keys','length','options','find','catch','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','file','extname','originalname','basename','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','rimraf'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x6ff1,0x7d));var _0x16ff=function(_0x1b44b7,_0x5c6d82){_0x1b44b7=_0x1b44b7-0x0;var _0x59e42e=_0x6ff1[_0x1b44b7];return _0x59e42e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16ff('0x0'));var zipdir=require(_0x16ff('0x1'));var jsonpatch=require(_0x16ff('0x2'));var rp=require(_0x16ff('0x3'));var moment=require(_0x16ff('0x4'));var BPromise=require(_0x16ff('0x5'));var Mustache=require(_0x16ff('0x6'));var util=require(_0x16ff('0x7'));var path=require('path');var sox=require(_0x16ff('0x8'));var csv=require(_0x16ff('0x9'));var ejs=require(_0x16ff('0xa'));var fs=require('fs');var fs_extra=require(_0x16ff('0xb'));var _=require(_0x16ff('0xc'));var squel=require(_0x16ff('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x16ff('0xe'));var toCsv=require('to-csv');var querystring=require(_0x16ff('0xf'));var Papa=require('papaparse');var Redis=require(_0x16ff('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x16ff('0x11'));var as=require(_0x16ff('0x12'));var hardwareService=require(_0x16ff('0x13'));var logger=require(_0x16ff('0x14'))(_0x16ff('0x15'));var utils=require(_0x16ff('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x16ff('0x17'))['db'];function respondWithStatusCode(_0x57d9e9,_0x216690){_0x216690=_0x216690||0xcc;return function(_0x111c3f){if(_0x111c3f){return _0x57d9e9[_0x16ff('0x18')](_0x216690);}return _0x57d9e9[_0x16ff('0x19')](_0x216690)[_0x16ff('0x1a')]();};}function respondWithResult(_0x261dea,_0x7f96c2){_0x7f96c2=_0x7f96c2||0xc8;return function(_0x42d76b){if(_0x42d76b){return _0x261dea['status'](_0x7f96c2)[_0x16ff('0x1b')](_0x42d76b);}};}function respondWithFilteredResult(_0x1e36c1,_0x58eec2){return function(_0x2762e8){if(_0x2762e8){var _0x1e3e19=typeof _0x58eec2[_0x16ff('0x1c')]===_0x16ff('0x1d')&&typeof _0x58eec2[_0x16ff('0x1e')]===_0x16ff('0x1d');var _0x4a5039=_0x2762e8[_0x16ff('0x1f')];var _0x41dd2e=_0x1e3e19?0x0:_0x58eec2[_0x16ff('0x1c')];var _0x3f8402=_0x1e3e19?_0x2762e8[_0x16ff('0x1f')]:_0x58eec2[_0x16ff('0x1c')]+_0x58eec2[_0x16ff('0x1e')];var _0x326fe3;if(_0x3f8402>=_0x4a5039){_0x3f8402=_0x4a5039;_0x326fe3=0xc8;}else{_0x326fe3=0xce;}_0x1e36c1[_0x16ff('0x19')](_0x326fe3);return _0x1e36c1['set'](_0x16ff('0x20'),_0x41dd2e+'-'+_0x3f8402+'/'+_0x4a5039)[_0x16ff('0x1b')](_0x2762e8);}return null;};}function patchUpdates(_0x17d943){return function(_0x4292fd){try{jsonpatch[_0x16ff('0x21')](_0x4292fd,_0x17d943,!![]);}catch(_0x2ec28e){return BPromise[_0x16ff('0x22')](_0x2ec28e);}return _0x4292fd[_0x16ff('0x23')]();};}function saveUpdates(_0x8f17ae,_0x495dea){return function(_0x2dd272){if(_0x2dd272){return _0x2dd272[_0x16ff('0x24')](_0x8f17ae)['then'](function(_0x44ba0e){return _0x44ba0e;});}return null;};}function removeEntity(_0x2d7bcf,_0x513320){return function(_0x2a7622){if(_0x2a7622){return _0x2a7622[_0x16ff('0x25')]()[_0x16ff('0x26')](function(){var _0x3aa502=_0x2a7622[_0x16ff('0x27')]({'plain':!![]});var _0x3dbaea=_0x16ff('0x28');return db[_0x16ff('0x29')]['destroy']({'where':{'type':_0x3dbaea,'resourceId':_0x3aa502['id']}})['then'](function(){return _0x2a7622;});})[_0x16ff('0x26')](function(){_0x2d7bcf[_0x16ff('0x19')](0xcc)[_0x16ff('0x1a')]();});}};}function handleEntityNotFound(_0x561928,_0x3b049c){return function(_0xc2bbc8){if(!_0xc2bbc8){_0x561928[_0x16ff('0x18')](0x194);}return _0xc2bbc8;};}function handleError(_0x55bf37,_0x3cf5ce){_0x3cf5ce=_0x3cf5ce||0x1f4;return function(_0x51dc10){logger[_0x16ff('0x2a')](_0x51dc10['stack']);if(_0x51dc10[_0x16ff('0x2b')]){delete _0x51dc10[_0x16ff('0x2b')];}_0x55bf37[_0x16ff('0x19')](_0x3cf5ce)[_0x16ff('0x2c')](_0x51dc10);};}exports[_0x16ff('0x2d')]=function(_0x43271c,_0x18d2b6){var _0x3d30a0={},_0xbd908f={},_0x4ba8d1={'count':0x0,'rows':[]};var _0x1ebc6a=_[_0x16ff('0x2e')](db['Sound']['rawAttributes'],function(_0x42cc2c){return{'name':_0x42cc2c[_0x16ff('0x2f')],'type':_0x42cc2c[_0x16ff('0x30')][_0x16ff('0x31')]};});_0xbd908f[_0x16ff('0x32')]=_[_0x16ff('0x2e')](_0x1ebc6a,_0x16ff('0x2b'));_0xbd908f[_0x16ff('0x33')]=_['keys'](_0x43271c[_0x16ff('0x33')]);_0xbd908f['filters']=_['intersection'](_0xbd908f['model'],_0xbd908f[_0x16ff('0x33')]);_0x3d30a0['attributes']=_[_0x16ff('0x34')](_0xbd908f[_0x16ff('0x32')],qs[_0x16ff('0x35')](_0x43271c[_0x16ff('0x33')][_0x16ff('0x35')]));_0x3d30a0[_0x16ff('0x36')]=_0x3d30a0[_0x16ff('0x36')]['length']?_0x3d30a0[_0x16ff('0x36')]:_0xbd908f['model'];if(!_0x43271c['query'][_0x16ff('0x37')]('nolimit')){_0x3d30a0[_0x16ff('0x1e')]=qs['limit'](_0x43271c['query'][_0x16ff('0x1e')]);_0x3d30a0[_0x16ff('0x1c')]=qs[_0x16ff('0x1c')](_0x43271c[_0x16ff('0x33')][_0x16ff('0x1c')]);}_0x3d30a0[_0x16ff('0x38')]=qs[_0x16ff('0x39')](_0x43271c['query'][_0x16ff('0x39')]);_0x3d30a0['where']=qs[_0x16ff('0x3a')](_['pick'](_0x43271c['query'],_0xbd908f['filters']),_0x1ebc6a);if(_0x43271c[_0x16ff('0x33')][_0x16ff('0x3b')]){_0x3d30a0[_0x16ff('0x3c')]=_[_0x16ff('0x3d')](_0x3d30a0[_0x16ff('0x3c')],{'$or':_[_0x16ff('0x2e')](_0x1ebc6a,function(_0xecd477){if(_0xecd477[_0x16ff('0x30')]!==_0x16ff('0x3e')){var _0x852dca={};_0x852dca[_0xecd477[_0x16ff('0x2b')]]={'$like':'%'+_0x43271c[_0x16ff('0x33')][_0x16ff('0x3b')]+'%'};return _0x852dca;}})});}_0x3d30a0=_[_0x16ff('0x3d')]({},_0x3d30a0,_0x43271c['options']);var _0x57da2c={'where':_0x3d30a0[_0x16ff('0x3c')]};return db['Sound'][_0x16ff('0x1f')](_0x57da2c)[_0x16ff('0x26')](function(_0x31e43c){_0x4ba8d1[_0x16ff('0x1f')]=_0x31e43c;if(_0x43271c['query'][_0x16ff('0x3f')]){_0x3d30a0[_0x16ff('0x40')]=[{'all':!![]}];}return db[_0x16ff('0x41')][_0x16ff('0x42')](_0x3d30a0);})[_0x16ff('0x26')](function(_0x52cbde){_0x4ba8d1[_0x16ff('0x43')]=_0x52cbde;return _0x4ba8d1;})[_0x16ff('0x26')](respondWithFilteredResult(_0x18d2b6,_0x3d30a0))['catch'](handleError(_0x18d2b6,null));};exports[_0x16ff('0x44')]=function(_0x4c1918,_0x1c6e0c){var _0x3cb562={'raw':!![],'where':{'id':_0x4c1918[_0x16ff('0x45')]['id']}},_0x5c17e5={};_0x5c17e5['model']=_[_0x16ff('0x46')](db['Sound']['rawAttributes']);_0x5c17e5[_0x16ff('0x33')]=_['keys'](_0x4c1918[_0x16ff('0x33')]);_0x5c17e5[_0x16ff('0x3a')]=_['intersection'](_0x5c17e5['model'],_0x5c17e5['query']);_0x3cb562['attributes']=_[_0x16ff('0x34')](_0x5c17e5[_0x16ff('0x32')],qs[_0x16ff('0x35')](_0x4c1918[_0x16ff('0x33')]['fields']));_0x3cb562['attributes']=_0x3cb562[_0x16ff('0x36')][_0x16ff('0x47')]?_0x3cb562['attributes']:_0x5c17e5['model'];if(_0x4c1918['query'][_0x16ff('0x3f')]){_0x3cb562[_0x16ff('0x40')]=[{'all':!![]}];}_0x3cb562=_[_0x16ff('0x3d')]({},_0x3cb562,_0x4c1918[_0x16ff('0x48')]);return db[_0x16ff('0x41')][_0x16ff('0x49')](_0x3cb562)[_0x16ff('0x26')](handleEntityNotFound(_0x1c6e0c,null))[_0x16ff('0x26')](respondWithResult(_0x1c6e0c,null))[_0x16ff('0x4a')](handleError(_0x1c6e0c,null));};exports[_0x16ff('0x4b')]=function(_0x149600,_0x47b030,_0xc3dcb2){return db['Sound'][_0x16ff('0x49')]({'where':{'id':_0x149600[_0x16ff('0x45')]['id']},'attributes':['name',_0x16ff('0x4c'),'converted_format'],'raw':!![]})[_0x16ff('0x26')](handleEntityNotFound(_0x47b030,null))[_0x16ff('0x26')](function(_0x2978be){if(_0x2978be){if(!fs[_0x16ff('0x4d')](path[_0x16ff('0x4e')](config[_0x16ff('0x4f')],_0x16ff('0x50'),_0x2978be['save_name']+'.'+_0x2978be[_0x16ff('0x51')]))){throw new db[(_0x16ff('0x52'))][(_0x16ff('0x53'))](_0x16ff('0x54'));}return _0x47b030[_0x16ff('0x4b')](path[_0x16ff('0x4e')](config['root'],_0x16ff('0x50'),util[_0x16ff('0x55')](_0x16ff('0x56'),_0x2978be['save_name'],_0x2978be[_0x16ff('0x51')])),util[_0x16ff('0x55')](_0x16ff('0x56'),_0x2978be[_0x16ff('0x2b')],_0x2978be[_0x16ff('0x51')]));}return null;})['catch'](handleError(_0x47b030,null));};exports[_0x16ff('0x57')]=function(_0x4dfa2b,_0xd9c041,_0x471902){var _0x405b2f={'name':path['basename'](_0x4dfa2b[_0x16ff('0x58')]['originalname'],path[_0x16ff('0x59')](_0x4dfa2b['file'][_0x16ff('0x5a')])),'save_name':path[_0x16ff('0x5b')](_0x4dfa2b[_0x16ff('0x58')][_0x16ff('0x5c')],path[_0x16ff('0x59')](_0x4dfa2b['file'][_0x16ff('0x5c')])),'original_format':path['extname'](_0x4dfa2b['file'][_0x16ff('0x5a')])[_0x16ff('0x5d')](0x1),'converted_format':'wav'};var _0x3a5b71=path[_0x16ff('0x4e')](config['root'],_0x16ff('0x5e'),_0x4dfa2b[_0x16ff('0x58')][_0x16ff('0x5c')]);var _0xb61404=path[_0x16ff('0x4e')](config[_0x16ff('0x4f')],_0x16ff('0x50'),util[_0x16ff('0x55')](_0x16ff('0x56'),path[_0x16ff('0x5b')](_0x4dfa2b[_0x16ff('0x58')]['filename'],path[_0x16ff('0x59')](_0x4dfa2b[_0x16ff('0x58')][_0x16ff('0x5c')])),_0x405b2f[_0x16ff('0x51')]));logger[_0x16ff('0x5f')](_0x16ff('0x60'),_0x3a5b71);logger[_0x16ff('0x5f')]('Sound\x20upload\x20destination:\x20%s',_0xb61404);try{fs[_0x16ff('0x61')](_0x3a5b71,parseInt(_0x16ff('0x62'),0x8));var _0x5b8fa5=sox[_0x16ff('0x63')](_0x3a5b71,_0xb61404,{'sampleRate':0x1f40,'format':_0x16ff('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5b8fa5['on'](_0x16ff('0x2a'),function(_0x17f54d){fs[_0x16ff('0x65')](_0x3a5b71);_0xd9c041[_0x16ff('0x19')](0x1f4)[_0x16ff('0x2c')](_0x17f54d);});_0x5b8fa5['on'](_0x16ff('0x66'),function(_0x5a02d9){_0x405b2f[_0x16ff('0x67')]=isNaN(_0x5a02d9[_0x16ff('0x68')])?null:_0x5a02d9[_0x16ff('0x68')]*0x3e8;_0x405b2f[_0x16ff('0x69')]=isNaN(_0x5a02d9[_0x16ff('0x6a')])?null:_0x5a02d9[_0x16ff('0x6a')];_0x405b2f['original_channelCount']=isNaN(_0x5a02d9[_0x16ff('0x6b')])?null:_0x5a02d9['channelCount'];_0x405b2f['original_bitRate']=isNaN(_0x5a02d9[_0x16ff('0x6c')])?null:_0x5a02d9['bitRate'];_0x405b2f[_0x16ff('0x6d')]=isNaN(_0x5a02d9[_0x16ff('0x6e')])?null:_0x5a02d9[_0x16ff('0x6e')];});_0x5b8fa5['on'](_0x16ff('0x6f'),function(_0x1cffa8){_0x405b2f[_0x16ff('0x70')]=isNaN(_0x1cffa8[_0x16ff('0x68')])?null:_0x1cffa8['duration']*0x3e8;_0x405b2f[_0x16ff('0x71')]=isNaN(_0x1cffa8[_0x16ff('0x6a')])?null:_0x1cffa8[_0x16ff('0x6a')];_0x405b2f[_0x16ff('0x72')]=isNaN(_0x1cffa8['channelCount'])?null:_0x1cffa8['channelCount'];_0x405b2f['converted_bitRate']=isNaN(_0x1cffa8[_0x16ff('0x6c')])?null:_0x1cffa8[_0x16ff('0x6c')];_0x405b2f[_0x16ff('0x73')]=isNaN(_0x1cffa8['sampleRate'])?null:_0x1cffa8[_0x16ff('0x6e')];});_0x5b8fa5['on'](_0x16ff('0x1a'),function(){fs['chmodSync'](_0xb61404,parseInt(_0x16ff('0x62'),0x8));return db['Sound'][_0x16ff('0x57')](_0x405b2f)[_0x16ff('0x26')](function(_0x5dbbdd){var _0x29c503={'role':_0x4dfa2b[_0x16ff('0x74')][_0x16ff('0x75')],'userProfileId':_0x4dfa2b[_0x16ff('0x74')][_0x16ff('0x76')]};if(!_0x29c503)throw new Error(_0x16ff('0x77'));if(_0x29c503[_0x16ff('0x75')]==='user'){var _0x3d246a=_0x5dbbdd[_0x16ff('0x27')]({'plain':!![]});return db[_0x16ff('0x78')]['find']({'where':{'name':'Sounds','userProfileId':_0x29c503[_0x16ff('0x76')]},'raw':!![]})[_0x16ff('0x26')](function(_0x107ef2){if(_0x107ef2&&_0x107ef2[_0x16ff('0x79')]===0x0){return db[_0x16ff('0x29')]['create']({'name':_0x3d246a[_0x16ff('0x2b')],'resourceId':_0x3d246a['id'],'type':_0x107ef2[_0x16ff('0x2b')],'sectionId':_0x107ef2['id']},{})[_0x16ff('0x26')](function(){return _0x5dbbdd;});}else{return _0x5dbbdd;}})[_0x16ff('0x4a')](function(_0x25746f){logger[_0x16ff('0x2a')](_0x16ff('0x7a'),_0x25746f);throw _0x25746f;});}return _0x5dbbdd;})[_0x16ff('0x26')](respondWithResult(_0xd9c041,null))['catch'](handleError(_0xd9c041,null));});_0x5b8fa5[_0x16ff('0x7b')]();}catch(_0x4a56be){_0xd9c041[_0x16ff('0x19')](0x1f4)[_0x16ff('0x2c')](_0x4a56be);}};exports[_0x16ff('0x24')]=function(_0xd409d3,_0x4e131d,_0x384ff3){return db[_0x16ff('0x41')][_0x16ff('0x49')]({'where':{'id':_0xd409d3[_0x16ff('0x45')]['id']}})[_0x16ff('0x26')](handleEntityNotFound(_0x4e131d,null))['then'](saveUpdates(_['pick'](_0xd409d3[_0x16ff('0x74')],[_0x16ff('0x2b'),_0x16ff('0x7c')]),null))[_0x16ff('0x26')](respondWithResult(_0x4e131d,null))[_0x16ff('0x4a')](handleError(_0x4e131d,null));};exports[_0x16ff('0x7d')]=function(_0x407dcc,_0x2b323b,_0x2f39ba){return db['Sound'][_0x16ff('0x49')]({'where':{'id':_0x407dcc[_0x16ff('0x45')]['id']}})[_0x16ff('0x26')](function(_0x2851d7){if(_0x2851d7){return _0x2851d7['destroy']();}})[_0x16ff('0x26')](function(_0x578d95){var _0x571325=path[_0x16ff('0x4e')](config[_0x16ff('0x4f')],_0x16ff('0x5e'),util[_0x16ff('0x55')](_0x16ff('0x56'),_0x578d95[_0x16ff('0x4c')],_0x578d95['original_format']));var _0x2249fd=path[_0x16ff('0x4e')](config[_0x16ff('0x4f')],_0x16ff('0x50'),util['format'](_0x16ff('0x56'),_0x578d95[_0x16ff('0x4c')],_0x578d95['converted_format']));fs[_0x16ff('0x65')](_0x571325);fs['unlinkSync'](_0x2249fd);return _0x578d95;})[_0x16ff('0x26')](function(_0x3f9e15){if(_0x3f9e15){return _0x2b323b[_0x16ff('0x19')](0xcc)[_0x16ff('0x1a')]();}})[_0x16ff('0x26')](handleEntityNotFound(_0x2b323b,null))[_0x16ff('0x4a')](handleError(_0x2b323b,null));}; \ No newline at end of file +var _0x2e2d=['converted_duration','duration','converted_sampleCount','converted_channelCount','converted_sampleRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Sounds','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','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','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sound\x20not\x20found','download','format','%s.%s','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest'];(function(_0x3447ec,_0x23a6a6){var _0x46cc55=function(_0x39392f){while(--_0x39392f){_0x3447ec['push'](_0x3447ec['shift']());}};_0x46cc55(++_0x23a6a6);}(_0x2e2d,0x195));var _0xd2e2=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x2e2d[_0x16d10f];return _0x50c823;};'use strict';var emlformat=require(_0xd2e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd2e2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd2e2('0x2'));var moment=require(_0xd2e2('0x3'));var BPromise=require(_0xd2e2('0x4'));var Mustache=require(_0xd2e2('0x5'));var util=require(_0xd2e2('0x6'));var path=require(_0xd2e2('0x7'));var sox=require(_0xd2e2('0x8'));var csv=require(_0xd2e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd2e2('0xa'));var _=require(_0xd2e2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd2e2('0xc'));var deskjs=require(_0xd2e2('0xd'));var toCsv=require(_0xd2e2('0x9'));var querystring=require('querystring');var Papa=require(_0xd2e2('0xe'));var Redis=require(_0xd2e2('0xf'));var authService=require(_0xd2e2('0x10'));var qs=require(_0xd2e2('0x11'));var as=require(_0xd2e2('0x12'));var hardwareService=require(_0xd2e2('0x13'));var logger=require(_0xd2e2('0x14'))(_0xd2e2('0x15'));var utils=require(_0xd2e2('0x16'));var config=require(_0xd2e2('0x17'));var licenseUtil=require(_0xd2e2('0x18'));var db=require(_0xd2e2('0x19'))['db'];function respondWithStatusCode(_0x2ce074,_0x448005){_0x448005=_0x448005||0xcc;return function(_0x597920){if(_0x597920){return _0x2ce074['sendStatus'](_0x448005);}return _0x2ce074[_0xd2e2('0x1a')](_0x448005)[_0xd2e2('0x1b')]();};}function respondWithResult(_0x1939a5,_0x45578b){_0x45578b=_0x45578b||0xc8;return function(_0x2c7db6){if(_0x2c7db6){return _0x1939a5[_0xd2e2('0x1a')](_0x45578b)[_0xd2e2('0x1c')](_0x2c7db6);}};}function respondWithFilteredResult(_0x4ada58,_0x2bec05){return function(_0x3a80bd){if(_0x3a80bd){var _0x1573a3=typeof _0x2bec05[_0xd2e2('0x1d')]===_0xd2e2('0x1e')&&typeof _0x2bec05[_0xd2e2('0x1f')]==='undefined';var _0x5ec444=_0x3a80bd[_0xd2e2('0x20')];var _0x51907e=_0x1573a3?0x0:_0x2bec05[_0xd2e2('0x1d')];var _0x28a022=_0x1573a3?_0x3a80bd['count']:_0x2bec05[_0xd2e2('0x1d')]+_0x2bec05[_0xd2e2('0x1f')];var _0x492152;if(_0x28a022>=_0x5ec444){_0x28a022=_0x5ec444;_0x492152=0xc8;}else{_0x492152=0xce;}_0x4ada58['status'](_0x492152);return _0x4ada58[_0xd2e2('0x21')](_0xd2e2('0x22'),_0x51907e+'-'+_0x28a022+'/'+_0x5ec444)['json'](_0x3a80bd);}return null;};}function patchUpdates(_0x1bea37){return function(_0x54a13d){try{jsonpatch['apply'](_0x54a13d,_0x1bea37,!![]);}catch(_0x658b6e){return BPromise[_0xd2e2('0x23')](_0x658b6e);}return _0x54a13d[_0xd2e2('0x24')]();};}function saveUpdates(_0x1382b8,_0x337811){return function(_0x4905e3){if(_0x4905e3){return _0x4905e3[_0xd2e2('0x25')](_0x1382b8)['then'](function(_0x153a23){return _0x153a23;});}return null;};}function removeEntity(_0x3e079a,_0x333b38){return function(_0x4f1a1f){if(_0x4f1a1f){return _0x4f1a1f[_0xd2e2('0x26')]()[_0xd2e2('0x27')](function(){var _0x374f9d=_0x4f1a1f[_0xd2e2('0x28')]({'plain':!![]});var _0xa7ea30='Sounds';return db[_0xd2e2('0x29')][_0xd2e2('0x26')]({'where':{'type':_0xa7ea30,'resourceId':_0x374f9d['id']}})[_0xd2e2('0x27')](function(){return _0x4f1a1f;});})['then'](function(){_0x3e079a[_0xd2e2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5334b7,_0x146952){return function(_0x4ef72c){if(!_0x4ef72c){_0x5334b7[_0xd2e2('0x2a')](0x194);}return _0x4ef72c;};}function handleError(_0x2ec606,_0x45af50){_0x45af50=_0x45af50||0x1f4;return function(_0x3fe97f){logger[_0xd2e2('0x2b')](_0x3fe97f[_0xd2e2('0x2c')]);if(_0x3fe97f[_0xd2e2('0x2d')]){delete _0x3fe97f['name'];}_0x2ec606[_0xd2e2('0x1a')](_0x45af50)[_0xd2e2('0x2e')](_0x3fe97f);};}exports[_0xd2e2('0x2f')]=function(_0x3333f0,_0xb79dfe){var _0x1894a3={},_0x587c50={},_0xf95aa5={'count':0x0,'rows':[]};var _0x3b249c=_[_0xd2e2('0x30')](db[_0xd2e2('0x31')][_0xd2e2('0x32')],function(_0x47ebd1){return{'name':_0x47ebd1[_0xd2e2('0x33')],'type':_0x47ebd1[_0xd2e2('0x34')][_0xd2e2('0x35')]};});_0x587c50['model']=_[_0xd2e2('0x30')](_0x3b249c,_0xd2e2('0x2d'));_0x587c50[_0xd2e2('0x36')]=_['keys'](_0x3333f0[_0xd2e2('0x36')]);_0x587c50[_0xd2e2('0x37')]=_[_0xd2e2('0x38')](_0x587c50[_0xd2e2('0x39')],_0x587c50[_0xd2e2('0x36')]);_0x1894a3[_0xd2e2('0x3a')]=_[_0xd2e2('0x38')](_0x587c50[_0xd2e2('0x39')],qs[_0xd2e2('0x3b')](_0x3333f0[_0xd2e2('0x36')][_0xd2e2('0x3b')]));_0x1894a3['attributes']=_0x1894a3[_0xd2e2('0x3a')]['length']?_0x1894a3[_0xd2e2('0x3a')]:_0x587c50[_0xd2e2('0x39')];if(!_0x3333f0[_0xd2e2('0x36')][_0xd2e2('0x3c')](_0xd2e2('0x3d'))){_0x1894a3['limit']=qs[_0xd2e2('0x1f')](_0x3333f0[_0xd2e2('0x36')]['limit']);_0x1894a3[_0xd2e2('0x1d')]=qs[_0xd2e2('0x1d')](_0x3333f0[_0xd2e2('0x36')]['offset']);}_0x1894a3['order']=qs[_0xd2e2('0x3e')](_0x3333f0[_0xd2e2('0x36')][_0xd2e2('0x3e')]);_0x1894a3['where']=qs[_0xd2e2('0x37')](_[_0xd2e2('0x3f')](_0x3333f0[_0xd2e2('0x36')],_0x587c50[_0xd2e2('0x37')]),_0x3b249c);if(_0x3333f0[_0xd2e2('0x36')][_0xd2e2('0x40')]){_0x1894a3[_0xd2e2('0x41')]=_['merge'](_0x1894a3['where'],{'$or':_[_0xd2e2('0x30')](_0x3b249c,function(_0x586b4a){if(_0x586b4a[_0xd2e2('0x34')]!=='VIRTUAL'){var _0x2c363e={};_0x2c363e[_0x586b4a[_0xd2e2('0x2d')]]={'$like':'%'+_0x3333f0[_0xd2e2('0x36')][_0xd2e2('0x40')]+'%'};return _0x2c363e;}})});}_0x1894a3=_[_0xd2e2('0x42')]({},_0x1894a3,_0x3333f0[_0xd2e2('0x43')]);var _0x35a989={'where':_0x1894a3[_0xd2e2('0x41')]};return db[_0xd2e2('0x31')]['count'](_0x35a989)[_0xd2e2('0x27')](function(_0x1cbae5){_0xf95aa5[_0xd2e2('0x20')]=_0x1cbae5;if(_0x3333f0[_0xd2e2('0x36')][_0xd2e2('0x44')]){_0x1894a3['include']=[{'all':!![]}];}return db[_0xd2e2('0x31')][_0xd2e2('0x45')](_0x1894a3);})['then'](function(_0x2561e7){_0xf95aa5[_0xd2e2('0x46')]=_0x2561e7;return _0xf95aa5;})[_0xd2e2('0x27')](respondWithFilteredResult(_0xb79dfe,_0x1894a3))[_0xd2e2('0x47')](handleError(_0xb79dfe,null));};exports[_0xd2e2('0x48')]=function(_0x5ec3b3,_0x40e148){var _0x2ec266={'raw':!![],'where':{'id':_0x5ec3b3[_0xd2e2('0x49')]['id']}},_0xbeca4c={};_0xbeca4c[_0xd2e2('0x39')]=_[_0xd2e2('0x4a')](db[_0xd2e2('0x31')][_0xd2e2('0x32')]);_0xbeca4c[_0xd2e2('0x36')]=_[_0xd2e2('0x4a')](_0x5ec3b3[_0xd2e2('0x36')]);_0xbeca4c['filters']=_[_0xd2e2('0x38')](_0xbeca4c['model'],_0xbeca4c[_0xd2e2('0x36')]);_0x2ec266[_0xd2e2('0x3a')]=_[_0xd2e2('0x38')](_0xbeca4c['model'],qs[_0xd2e2('0x3b')](_0x5ec3b3[_0xd2e2('0x36')][_0xd2e2('0x3b')]));_0x2ec266[_0xd2e2('0x3a')]=_0x2ec266['attributes']['length']?_0x2ec266[_0xd2e2('0x3a')]:_0xbeca4c['model'];if(_0x5ec3b3[_0xd2e2('0x36')][_0xd2e2('0x44')]){_0x2ec266[_0xd2e2('0x4b')]=[{'all':!![]}];}_0x2ec266=_[_0xd2e2('0x42')]({},_0x2ec266,_0x5ec3b3[_0xd2e2('0x43')]);return db['Sound'][_0xd2e2('0x4c')](_0x2ec266)['then'](handleEntityNotFound(_0x40e148,null))[_0xd2e2('0x27')](respondWithResult(_0x40e148,null))[_0xd2e2('0x47')](handleError(_0x40e148,null));};exports['download']=function(_0x20f2b5,_0x34a937,_0x3a641a){return db[_0xd2e2('0x31')]['find']({'where':{'id':_0x20f2b5[_0xd2e2('0x49')]['id']},'attributes':[_0xd2e2('0x2d'),_0xd2e2('0x4d'),_0xd2e2('0x4e')],'raw':!![]})[_0xd2e2('0x27')](handleEntityNotFound(_0x34a937,null))[_0xd2e2('0x27')](function(_0x30e82f){if(_0x30e82f){if(!fs[_0xd2e2('0x4f')](path[_0xd2e2('0x50')](config[_0xd2e2('0x51')],_0xd2e2('0x52'),_0x30e82f[_0xd2e2('0x4d')]+'.'+_0x30e82f['converted_format']))){throw new db['Sequelize']['ValidationError'](_0xd2e2('0x53'));}return _0x34a937[_0xd2e2('0x54')](path[_0xd2e2('0x50')](config[_0xd2e2('0x51')],_0xd2e2('0x52'),util[_0xd2e2('0x55')](_0xd2e2('0x56'),_0x30e82f[_0xd2e2('0x4d')],_0x30e82f[_0xd2e2('0x4e')])),util['format'](_0xd2e2('0x56'),_0x30e82f['name'],_0x30e82f[_0xd2e2('0x4e')]));}return null;})[_0xd2e2('0x47')](handleError(_0x34a937,null));};exports['create']=function(_0x117a36,_0x5f170e,_0x55a4a9){var _0x2cd8a0={'name':path[_0xd2e2('0x57')](_0x117a36[_0xd2e2('0x58')][_0xd2e2('0x59')],path[_0xd2e2('0x5a')](_0x117a36[_0xd2e2('0x58')][_0xd2e2('0x59')])),'save_name':path[_0xd2e2('0x57')](_0x117a36[_0xd2e2('0x58')][_0xd2e2('0x5b')],path['extname'](_0x117a36[_0xd2e2('0x58')][_0xd2e2('0x5b')])),'original_format':path[_0xd2e2('0x5a')](_0x117a36[_0xd2e2('0x58')][_0xd2e2('0x59')])[_0xd2e2('0x5c')](0x1),'converted_format':_0xd2e2('0x5d')};var _0x591b03=path['join'](config[_0xd2e2('0x51')],_0xd2e2('0x5e'),_0x117a36[_0xd2e2('0x58')]['filename']);var _0x317ef6=path[_0xd2e2('0x50')](config[_0xd2e2('0x51')],_0xd2e2('0x52'),util[_0xd2e2('0x55')](_0xd2e2('0x56'),path['basename'](_0x117a36[_0xd2e2('0x58')][_0xd2e2('0x5b')],path[_0xd2e2('0x5a')](_0x117a36[_0xd2e2('0x58')][_0xd2e2('0x5b')])),_0x2cd8a0[_0xd2e2('0x4e')]));logger[_0xd2e2('0x5f')](_0xd2e2('0x60'),_0x591b03);logger[_0xd2e2('0x5f')]('Sound\x20upload\x20destination:\x20%s',_0x317ef6);try{fs[_0xd2e2('0x61')](_0x591b03,parseInt(_0xd2e2('0x62'),0x8));var _0x284188=sox[_0xd2e2('0x63')](_0x591b03,_0x317ef6,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x284188['on']('error',function(_0x21a245){fs[_0xd2e2('0x64')](_0x591b03);_0x5f170e['status'](0x1f4)[_0xd2e2('0x2e')](_0x21a245);});_0x284188['on'](_0xd2e2('0x65'),function(_0x4f0918){_0x2cd8a0[_0xd2e2('0x66')]=isNaN(_0x4f0918['duration'])?null:_0x4f0918['duration']*0x3e8;_0x2cd8a0[_0xd2e2('0x67')]=isNaN(_0x4f0918[_0xd2e2('0x68')])?null:_0x4f0918[_0xd2e2('0x68')];_0x2cd8a0[_0xd2e2('0x69')]=isNaN(_0x4f0918[_0xd2e2('0x6a')])?null:_0x4f0918[_0xd2e2('0x6a')];_0x2cd8a0[_0xd2e2('0x6b')]=isNaN(_0x4f0918[_0xd2e2('0x6c')])?null:_0x4f0918['bitRate'];_0x2cd8a0['original_sampleRate']=isNaN(_0x4f0918[_0xd2e2('0x6d')])?null:_0x4f0918['sampleRate'];});_0x284188['on'](_0xd2e2('0x6e'),function(_0x156868){_0x2cd8a0[_0xd2e2('0x6f')]=isNaN(_0x156868['duration'])?null:_0x156868[_0xd2e2('0x70')]*0x3e8;_0x2cd8a0[_0xd2e2('0x71')]=isNaN(_0x156868[_0xd2e2('0x68')])?null:_0x156868[_0xd2e2('0x68')];_0x2cd8a0[_0xd2e2('0x72')]=isNaN(_0x156868['channelCount'])?null:_0x156868['channelCount'];_0x2cd8a0['converted_bitRate']=isNaN(_0x156868[_0xd2e2('0x6c')])?null:_0x156868[_0xd2e2('0x6c')];_0x2cd8a0[_0xd2e2('0x73')]=isNaN(_0x156868[_0xd2e2('0x6d')])?null:_0x156868[_0xd2e2('0x6d')];});_0x284188['on']('end',function(){fs[_0xd2e2('0x61')](_0x317ef6,parseInt('0777',0x8));return db[_0xd2e2('0x31')][_0xd2e2('0x74')](_0x2cd8a0)[_0xd2e2('0x27')](function(_0x9de572){var _0x58dcd2={'role':_0x117a36[_0xd2e2('0x75')]['role'],'userProfileId':_0x117a36['body'][_0xd2e2('0x76')]};if(!_0x58dcd2)throw new Error(_0xd2e2('0x77'));if(_0x58dcd2[_0xd2e2('0x78')]===_0xd2e2('0x79')){var _0x442a5b=_0x9de572[_0xd2e2('0x28')]({'plain':!![]});return db[_0xd2e2('0x7a')][_0xd2e2('0x4c')]({'where':{'name':_0xd2e2('0x7b'),'userProfileId':_0x58dcd2[_0xd2e2('0x76')]},'raw':!![]})['then'](function(_0x36d676){if(_0x36d676&&_0x36d676['autoAssociation']===0x0){return db[_0xd2e2('0x29')][_0xd2e2('0x74')]({'name':_0x442a5b[_0xd2e2('0x2d')],'resourceId':_0x442a5b['id'],'type':_0x36d676[_0xd2e2('0x2d')],'sectionId':_0x36d676['id']},{})['then'](function(){return _0x9de572;});}else{return _0x9de572;}})[_0xd2e2('0x47')](function(_0x2449d0){logger[_0xd2e2('0x2b')](_0xd2e2('0x7c'),_0x2449d0);throw _0x2449d0;});}return _0x9de572;})[_0xd2e2('0x27')](respondWithResult(_0x5f170e,null))[_0xd2e2('0x47')](handleError(_0x5f170e,null));});_0x284188[_0xd2e2('0x7d')]();}catch(_0x9aef73){_0x5f170e[_0xd2e2('0x1a')](0x1f4)[_0xd2e2('0x2e')](_0x9aef73);}};exports[_0xd2e2('0x25')]=function(_0x5a57c6,_0x3f9b99,_0x36f816){return db['Sound'][_0xd2e2('0x4c')]({'where':{'id':_0x5a57c6[_0xd2e2('0x49')]['id']}})[_0xd2e2('0x27')](handleEntityNotFound(_0x3f9b99,null))['then'](saveUpdates(_[_0xd2e2('0x3f')](_0x5a57c6[_0xd2e2('0x75')],[_0xd2e2('0x2d'),_0xd2e2('0x7e')]),null))[_0xd2e2('0x27')](respondWithResult(_0x3f9b99,null))[_0xd2e2('0x47')](handleError(_0x3f9b99,null));};exports[_0xd2e2('0x7f')]=function(_0x12b5e4,_0x5eb017,_0x36e2e7){return db[_0xd2e2('0x31')][_0xd2e2('0x4c')]({'where':{'id':_0x12b5e4[_0xd2e2('0x49')]['id']}})[_0xd2e2('0x27')](function(_0x1b8577){if(_0x1b8577){return _0x1b8577[_0xd2e2('0x26')]();}})[_0xd2e2('0x27')](function(_0x450d84){var _0x3aad28=path[_0xd2e2('0x50')](config[_0xd2e2('0x51')],'server/files/sounds/original',util['format'](_0xd2e2('0x56'),_0x450d84[_0xd2e2('0x4d')],_0x450d84[_0xd2e2('0x80')]));var _0x26fc0c=path[_0xd2e2('0x50')](config[_0xd2e2('0x51')],_0xd2e2('0x52'),util[_0xd2e2('0x55')](_0xd2e2('0x56'),_0x450d84['save_name'],_0x450d84[_0xd2e2('0x4e')]));fs[_0xd2e2('0x64')](_0x3aad28);fs[_0xd2e2('0x64')](_0x26fc0c);return _0x450d84;})[_0xd2e2('0x27')](function(_0x294a5a){if(_0x294a5a){return _0x5eb017[_0xd2e2('0x1a')](0xcc)[_0xd2e2('0x1b')]();}})[_0xd2e2('0x27')](handleEntityNotFound(_0x5eb017,null))[_0xd2e2('0x47')](handleError(_0x5eb017,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index c802472..e1b6aec 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 _0x74bf=['rimraf','./sound.attributes','exports','define','util','../../config/logger','api','moment','bluebird','path'];(function(_0x24e3bd,_0x2db5ab){var _0xd9eb3e=function(_0x51e50e){while(--_0x51e50e){_0x24e3bd['push'](_0x24e3bd['shift']());}};_0xd9eb3e(++_0x2db5ab);}(_0x74bf,0xfe));var _0xf74b=function(_0x555d9d,_0x4b3e48){_0x555d9d=_0x555d9d-0x0;var _0x4182b6=_0x74bf[_0x555d9d];return _0x4182b6;};'use strict';var _=require('lodash');var util=require(_0xf74b('0x0'));var logger=require(_0xf74b('0x1'))(_0xf74b('0x2'));var moment=require(_0xf74b('0x3'));var BPromise=require(_0xf74b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf74b('0x5'));var rimraf=require(_0xf74b('0x6'));var config=require('../../config/environment');var attributes=require(_0xf74b('0x7'));module[_0xf74b('0x8')]=function(_0x67fca5,_0xca644e){return _0x67fca5[_0xf74b('0x9')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x693e=['define','Sound','tools_sounds','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x693e,0xa8));var _0xe693=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x693e[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0xe693('0x0'));var logger=require(_0xe693('0x1'))(_0xe693('0x2'));var moment=require(_0xe693('0x3'));var BPromise=require('bluebird');var rp=require(_0xe693('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe693('0x5'));var config=require(_0xe693('0x6'));var attributes=require('./sound.attributes');module[_0xe693('0x7')]=function(_0x4860a3,_0x1b389b){return _0x4860a3[_0xe693('0x8')](_0xe693('0x9'),attributes,{'tableName':_0xe693('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 624159c..8670dff 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 _0x6879=['util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSound','find','options','raw','where','include','map','model','attributes','stringify','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6879,0x1df));var _0x9687=function(_0x568c61,_0x5aad09){_0x568c61=_0x568c61-0x0;var _0x477316=_0x6879[_0x568c61];return _0x477316;};'use strict';var _=require(_0x9687('0x0'));var util=require(_0x9687('0x1'));var moment=require(_0x9687('0x2'));var BPromise=require('bluebird');var rs=require(_0x9687('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9687('0x4'));var logger=require(_0x9687('0x5'))('rpc');var config=require(_0x9687('0x6'));var jayson=require(_0x9687('0x7'));var client=jayson['client'][_0x9687('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa3b124,_0x4b11c8,_0x4f69c8){return new BPromise(function(_0x293f20,_0x52c82d){return client['request'](_0xa3b124,_0x4f69c8)[_0x9687('0x9')](function(_0x2fefff){logger[_0x9687('0xa')](_0x9687('0xb'),_0x4b11c8,_0x9687('0xc'));logger[_0x9687('0xd')](_0x9687('0xe'),_0x4b11c8,'request\x20sent',JSON['stringify'](_0x2fefff));if(_0x2fefff[_0x9687('0xf')]){if(_0x2fefff[_0x9687('0xf')][_0x9687('0x10')]===0x1f4){logger[_0x9687('0xf')](_0x9687('0xb'),_0x4b11c8,_0x2fefff['error'][_0x9687('0x11')]);return _0x52c82d(_0x2fefff[_0x9687('0xf')][_0x9687('0x11')]);}logger[_0x9687('0xf')]('Sound,\x20%s,\x20%s',_0x4b11c8,_0x2fefff[_0x9687('0xf')]['message']);return _0x293f20(_0x2fefff['error'][_0x9687('0x11')]);}else{logger[_0x9687('0xa')](_0x9687('0xb'),_0x4b11c8,_0x9687('0xc'));_0x293f20(_0x2fefff[_0x9687('0x12')]['message']);}})[_0x9687('0x13')](function(_0xfd5ade){logger['error']('Sound,\x20%s,\x20%s',_0x4b11c8,_0xfd5ade);_0x52c82d(_0xfd5ade);});});}exports[_0x9687('0x14')]=function(_0x481179){var _0x3d46d3=this;return new Promise(function(_0xab3fed,_0x3a9ab9){return db['Sound'][_0x9687('0x15')]({'raw':_0x481179[_0x9687('0x16')]?_0x481179[_0x9687('0x16')][_0x9687('0x17')]===undefined?!![]:![]:!![],'where':_0x481179[_0x9687('0x16')]?_0x481179['options'][_0x9687('0x18')]||null:null,'attributes':_0x481179[_0x9687('0x16')]?_0x481179['options']['attributes']||null:null,'include':_0x481179['options']?_0x481179[_0x9687('0x16')][_0x9687('0x19')]?_[_0x9687('0x1a')](_0x481179[_0x9687('0x16')][_0x9687('0x19')],function(_0x36d183){return{'model':db[_0x36d183[_0x9687('0x1b')]],'as':_0x36d183['as'],'attributes':_0x36d183['attributes'],'include':_0x36d183[_0x9687('0x19')]?_[_0x9687('0x1a')](_0x36d183[_0x9687('0x19')],function(_0x75161e){return{'model':db[_0x75161e[_0x9687('0x1b')]],'as':_0x75161e['as'],'attributes':_0x75161e[_0x9687('0x1c')],'include':_0x75161e['include']?_[_0x9687('0x1a')](_0x75161e[_0x9687('0x19')],function(_0x29f6f5){return{'model':db[_0x29f6f5[_0x9687('0x1b')]],'as':_0x29f6f5['as'],'attributes':_0x29f6f5[_0x9687('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b5dfe){logger[_0x9687('0xa')]('ShowSound',_0x481179);logger['debug'](_0x9687('0x14'),_0x481179,JSON[_0x9687('0x1d')](_0x2b5dfe));_0xab3fed(_0x2b5dfe);})[_0x9687('0x13')](function(_0x4f7194){logger['error'](_0x9687('0x14'),_0x4f7194[_0x9687('0x11')],_0x481179);_0x3a9ab9(_0x3d46d3[_0x9687('0xf')](0x1f4,_0x4f7194[_0x9687('0x11')]));});});}; \ No newline at end of file +var _0xb8be=['request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0xb8be,0x10b));var _0xeb8b=function(_0x423097,_0x8a09f4){_0x423097=_0x423097-0x0;var _0x3a73f1=_0xb8be[_0x423097];return _0x3a73f1;};'use strict';var _=require(_0xeb8b('0x0'));var util=require(_0xeb8b('0x1'));var moment=require(_0xeb8b('0x2'));var BPromise=require(_0xeb8b('0x3'));var rs=require(_0xeb8b('0x4'));var fs=require('fs');var Redis=require(_0xeb8b('0x5'));var db=require(_0xeb8b('0x6'))['db'];var utils=require(_0xeb8b('0x7'));var logger=require(_0xeb8b('0x8'))(_0xeb8b('0x9'));var config=require('../../config/environment');var jayson=require(_0xeb8b('0xa'));var client=jayson[_0xeb8b('0xb')][_0xeb8b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c7227,_0x3959c0,_0x1359ec){return new BPromise(function(_0x248bc7,_0x959d99){return client[_0xeb8b('0xd')](_0x2c7227,_0x1359ec)[_0xeb8b('0xe')](function(_0x5369e9){logger[_0xeb8b('0xf')](_0xeb8b('0x10'),_0x3959c0,_0xeb8b('0x11'));logger[_0xeb8b('0x12')](_0xeb8b('0x13'),_0x3959c0,_0xeb8b('0x11'),JSON[_0xeb8b('0x14')](_0x5369e9));if(_0x5369e9['error']){if(_0x5369e9[_0xeb8b('0x15')][_0xeb8b('0x16')]===0x1f4){logger[_0xeb8b('0x15')](_0xeb8b('0x10'),_0x3959c0,_0x5369e9[_0xeb8b('0x15')][_0xeb8b('0x17')]);return _0x959d99(_0x5369e9['error'][_0xeb8b('0x17')]);}logger['error'](_0xeb8b('0x10'),_0x3959c0,_0x5369e9[_0xeb8b('0x15')][_0xeb8b('0x17')]);return _0x248bc7(_0x5369e9[_0xeb8b('0x15')]['message']);}else{logger[_0xeb8b('0xf')](_0xeb8b('0x10'),_0x3959c0,'request\x20sent');_0x248bc7(_0x5369e9[_0xeb8b('0x18')][_0xeb8b('0x17')]);}})[_0xeb8b('0x19')](function(_0x2cf006){logger[_0xeb8b('0x15')]('Sound,\x20%s,\x20%s',_0x3959c0,_0x2cf006);_0x959d99(_0x2cf006);});});}exports[_0xeb8b('0x1a')]=function(_0x4578f2){var _0x510c2b=this;return new Promise(function(_0x37ff25,_0x14141e){return db[_0xeb8b('0x1b')][_0xeb8b('0x1c')]({'raw':_0x4578f2['options']?_0x4578f2[_0xeb8b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4578f2[_0xeb8b('0x1d')]?_0x4578f2[_0xeb8b('0x1d')][_0xeb8b('0x1e')]||null:null,'attributes':_0x4578f2[_0xeb8b('0x1d')]?_0x4578f2[_0xeb8b('0x1d')][_0xeb8b('0x1f')]||null:null,'include':_0x4578f2[_0xeb8b('0x1d')]?_0x4578f2[_0xeb8b('0x1d')]['include']?_[_0xeb8b('0x20')](_0x4578f2[_0xeb8b('0x1d')][_0xeb8b('0x21')],function(_0x2c6b60){return{'model':db[_0x2c6b60[_0xeb8b('0x22')]],'as':_0x2c6b60['as'],'attributes':_0x2c6b60[_0xeb8b('0x1f')],'include':_0x2c6b60[_0xeb8b('0x21')]?_[_0xeb8b('0x20')](_0x2c6b60[_0xeb8b('0x21')],function(_0x354b5b){return{'model':db[_0x354b5b['model']],'as':_0x354b5b['as'],'attributes':_0x354b5b[_0xeb8b('0x1f')],'include':_0x354b5b[_0xeb8b('0x21')]?_[_0xeb8b('0x20')](_0x354b5b[_0xeb8b('0x21')],function(_0x3bc684){return{'model':db[_0x3bc684[_0xeb8b('0x22')]],'as':_0x3bc684['as'],'attributes':_0x3bc684[_0xeb8b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xeb8b('0xe')](function(_0x186e60){logger[_0xeb8b('0xf')](_0xeb8b('0x1a'),_0x4578f2);logger[_0xeb8b('0x12')]('ShowSound',_0x4578f2,JSON[_0xeb8b('0x14')](_0x186e60));_0x37ff25(_0x186e60);})[_0xeb8b('0x19')](function(_0x44e61b){logger[_0xeb8b('0x15')]('ShowSound',_0x44e61b[_0xeb8b('0x17')],_0x4578f2);_0x14141e(_0x510c2b[_0xeb8b('0x15')](0x1f4,_0x44e61b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index d8f5f66..8e578f8 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 _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x1522ea,_0xa18406){var _0x424e9b=function(_0x14a6f0){while(--_0x14a6f0){_0x1522ea['push'](_0x1522ea['shift']());}};_0x424e9b(++_0xa18406);}(_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('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x3b5c38,_0x2c7022){var _0x442ebd=function(_0x738ed7){while(--_0x738ed7){_0x3b5c38['push'](_0x3b5c38['shift']());}};_0x442ebd(++_0x2c7022);}(_0x2032,0xd9));var _0x2203=function(_0x3e33a8,_0x9d6515){_0x3e33a8=_0x3e33a8-0x0;var _0x4df241=_0x2032[_0x3e33a8];return _0x4df241;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 3640363..7129f01 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 _0xc254=['out','sequelize','exports','STRING','TEXT','medium','ENUM'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xc254,0x86));var _0x4c25=function(_0xee484f,_0x47a676){_0xee484f=_0xee484f-0x0;var _0x1a4b86=_0xc254[_0xee484f];return _0x1a4b86;};'use strict';var Sequelize=require(_0x4c25('0x0'));module[_0x4c25('0x1')]={'uniqueid':{'type':Sequelize[_0x4c25('0x2')]},'body':{'type':Sequelize[_0x4c25('0x3')](_0x4c25('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x4c25('0x5')]('in',_0x4c25('0x6')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x4c25('0x2')]},'providerResponse':{'type':Sequelize[_0x4c25('0x3')]}}; \ No newline at end of file +var _0x65b9=['STRING','TEXT','medium','ENUM','out','sequelize','exports'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x65b9,0x186));var _0x965b=function(_0x347b80,_0xba9b4c){_0x347b80=_0x347b80-0x0;var _0x5a024e=_0x65b9[_0x347b80];return _0x5a024e;};'use strict';var Sequelize=require(_0x965b('0x0'));module[_0x965b('0x1')]={'uniqueid':{'type':Sequelize[_0x965b('0x2')]},'body':{'type':Sequelize[_0x965b('0x3')](_0x965b('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x965b('0x5')]('in',_0x965b('0x6')),'defaultValue':_0x965b('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x965b('0x2')]},'providerResponse':{'type':Sequelize[_0x965b('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 8360268..35350fe 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 _0xb49b=['find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','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','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','SquareMessage','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','map','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll','merge'];(function(_0x233845,_0x22020a){var _0x585e35=function(_0x404f4b){while(--_0x404f4b){_0x233845['push'](_0x233845['shift']());}};_0x585e35(++_0x22020a);}(_0xb49b,0x1ba));var _0xbb49=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb49b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb49('0x0'));var zipdir=require(_0xbb49('0x1'));var jsonpatch=require(_0xbb49('0x2'));var rp=require(_0xbb49('0x3'));var moment=require(_0xbb49('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbb49('0x5'));var path=require(_0xbb49('0x6'));var sox=require(_0xbb49('0x7'));var csv=require(_0xbb49('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb49('0x9'));var _=require('lodash');var squel=require(_0xbb49('0xa'));var crypto=require(_0xbb49('0xb'));var jsforce=require(_0xbb49('0xc'));var deskjs=require(_0xbb49('0xd'));var toCsv=require(_0xbb49('0x8'));var querystring=require(_0xbb49('0xe'));var Papa=require(_0xbb49('0xf'));var Redis=require('ioredis');var authService=require(_0xbb49('0x10'));var qs=require(_0xbb49('0x11'));var as=require(_0xbb49('0x12'));var hardwareService=require(_0xbb49('0x13'));var logger=require(_0xbb49('0x14'))(_0xbb49('0x15'));var utils=require('../../config/utils');var config=require(_0xbb49('0x16'));var licenseUtil=require(_0xbb49('0x17'));var db=require(_0xbb49('0x18'))['db'];function respondWithStatusCode(_0x237a57,_0x55810b){_0x55810b=_0x55810b||0xcc;return function(_0x183fee){if(_0x183fee){return _0x237a57[_0xbb49('0x19')](_0x55810b);}return _0x237a57[_0xbb49('0x1a')](_0x55810b)['end']();};}function respondWithResult(_0x29a46f,_0x4fd5ba){_0x4fd5ba=_0x4fd5ba||0xc8;return function(_0x34a27d){if(_0x34a27d){return _0x29a46f['status'](_0x4fd5ba)[_0xbb49('0x1b')](_0x34a27d);}};}function respondWithFilteredResult(_0x133c9f,_0x51e77d){return function(_0x4e5a56){if(_0x4e5a56){var _0x210e4f=typeof _0x51e77d[_0xbb49('0x1c')]===_0xbb49('0x1d')&&typeof _0x51e77d[_0xbb49('0x1e')]===_0xbb49('0x1d');var _0x3c9d28=_0x4e5a56[_0xbb49('0x1f')];var _0x37818f=_0x210e4f?0x0:_0x51e77d[_0xbb49('0x1c')];var _0x5f49bf=_0x210e4f?_0x4e5a56[_0xbb49('0x1f')]:_0x51e77d[_0xbb49('0x1c')]+_0x51e77d[_0xbb49('0x1e')];var _0x332fdb;if(_0x5f49bf>=_0x3c9d28){_0x5f49bf=_0x3c9d28;_0x332fdb=0xc8;}else{_0x332fdb=0xce;}_0x133c9f[_0xbb49('0x1a')](_0x332fdb);return _0x133c9f[_0xbb49('0x20')](_0xbb49('0x21'),_0x37818f+'-'+_0x5f49bf+'/'+_0x3c9d28)[_0xbb49('0x1b')](_0x4e5a56);}return null;};}function patchUpdates(_0x12b712){return function(_0x2ad98c){try{jsonpatch[_0xbb49('0x22')](_0x2ad98c,_0x12b712,!![]);}catch(_0xd4f08){return BPromise[_0xbb49('0x23')](_0xd4f08);}return _0x2ad98c[_0xbb49('0x24')]();};}function saveUpdates(_0x3d4c2e,_0x5ef19e){return function(_0x46f7ee){if(_0x46f7ee){return _0x46f7ee[_0xbb49('0x25')](_0x3d4c2e)['then'](function(_0x553a21){return _0x553a21;});}return null;};}function removeEntity(_0xeb7b21,_0x4cbf5a){return function(_0x3bcb05){if(_0x3bcb05){return _0x3bcb05['destroy']()[_0xbb49('0x26')](function(){_0xeb7b21[_0xbb49('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x148b58,_0x38d4ff){return function(_0x4905bd){if(!_0x4905bd){_0x148b58['sendStatus'](0x194);}return _0x4905bd;};}function handleError(_0x5b32a8,_0x45fc06){_0x45fc06=_0x45fc06||0x1f4;return function(_0x408683){logger[_0xbb49('0x27')](_0x408683[_0xbb49('0x28')]);if(_0x408683[_0xbb49('0x29')]){delete _0x408683[_0xbb49('0x29')];}_0x5b32a8[_0xbb49('0x1a')](_0x45fc06)['send'](_0x408683);};}exports[_0xbb49('0x2a')]=function(_0x4fe21e,_0x5d9072){var _0x438a45={},_0x180104={},_0x4660b8={'count':0x0,'rows':[]};var _0x49349f=_['map'](db[_0xbb49('0x2b')][_0xbb49('0x2c')],function(_0x440909){return{'name':_0x440909['fieldName'],'type':_0x440909['type']['key']};});_0x180104[_0xbb49('0x2d')]=_['map'](_0x49349f,'name');_0x180104[_0xbb49('0x2e')]=_[_0xbb49('0x2f')](_0x4fe21e[_0xbb49('0x2e')]);_0x180104[_0xbb49('0x30')]=_[_0xbb49('0x31')](_0x180104[_0xbb49('0x2d')],_0x180104[_0xbb49('0x2e')]);_0x438a45['attributes']=_[_0xbb49('0x31')](_0x180104['model'],qs[_0xbb49('0x32')](_0x4fe21e['query'][_0xbb49('0x32')]));_0x438a45[_0xbb49('0x33')]=_0x438a45['attributes'][_0xbb49('0x34')]?_0x438a45['attributes']:_0x180104[_0xbb49('0x2d')];if(!_0x4fe21e[_0xbb49('0x2e')][_0xbb49('0x35')](_0xbb49('0x36'))){_0x438a45[_0xbb49('0x1e')]=qs[_0xbb49('0x1e')](_0x4fe21e['query'][_0xbb49('0x1e')]);_0x438a45[_0xbb49('0x1c')]=qs[_0xbb49('0x1c')](_0x4fe21e[_0xbb49('0x2e')]['offset']);}_0x438a45[_0xbb49('0x37')]=qs['sort'](_0x4fe21e[_0xbb49('0x2e')][_0xbb49('0x38')]);_0x438a45[_0xbb49('0x39')]=qs['filters'](_['pick'](_0x4fe21e['query'],_0x180104[_0xbb49('0x30')]),_0x49349f);if(_0x4fe21e[_0xbb49('0x2e')]['filter']){_0x438a45[_0xbb49('0x39')]=_['merge'](_0x438a45['where'],{'$or':_[_0xbb49('0x3a')](_0x49349f,function(_0x1cdd32){if(_0x1cdd32['type']!==_0xbb49('0x3b')){var _0x263855={};_0x263855[_0x1cdd32[_0xbb49('0x29')]]={'$like':'%'+_0x4fe21e[_0xbb49('0x2e')][_0xbb49('0x3c')]+'%'};return _0x263855;}})});}_0x438a45=_['merge']({},_0x438a45,_0x4fe21e[_0xbb49('0x3d')]);var _0x1c4fd1={'where':_0x438a45['where']};return db[_0xbb49('0x2b')][_0xbb49('0x1f')](_0x1c4fd1)['then'](function(_0x4aeb41){_0x4660b8[_0xbb49('0x1f')]=_0x4aeb41;if(_0x4fe21e[_0xbb49('0x2e')]['includeAll']){_0x438a45[_0xbb49('0x3e')]=[{'all':!![]}];}return db['SquareMessage'][_0xbb49('0x3f')](_0x438a45);})[_0xbb49('0x26')](function(_0x58e7b4){_0x4660b8[_0xbb49('0x40')]=_0x58e7b4;return _0x4660b8;})[_0xbb49('0x26')](respondWithFilteredResult(_0x5d9072,_0x438a45))[_0xbb49('0x41')](handleError(_0x5d9072,null));};exports['show']=function(_0x140a4d,_0x3fc6a5){var _0x28e504={'raw':!![],'where':{'id':_0x140a4d[_0xbb49('0x42')]['id']}},_0x5a5640={};_0x5a5640['model']=_[_0xbb49('0x2f')](db[_0xbb49('0x2b')][_0xbb49('0x2c')]);_0x5a5640[_0xbb49('0x2e')]=_['keys'](_0x140a4d[_0xbb49('0x2e')]);_0x5a5640['filters']=_['intersection'](_0x5a5640['model'],_0x5a5640['query']);_0x28e504[_0xbb49('0x33')]=_['intersection'](_0x5a5640[_0xbb49('0x2d')],qs['fields'](_0x140a4d[_0xbb49('0x2e')][_0xbb49('0x32')]));_0x28e504['attributes']=_0x28e504[_0xbb49('0x33')][_0xbb49('0x34')]?_0x28e504[_0xbb49('0x33')]:_0x5a5640[_0xbb49('0x2d')];if(_0x140a4d['query'][_0xbb49('0x43')]){_0x28e504[_0xbb49('0x3e')]=[{'all':!![]}];}_0x28e504=_[_0xbb49('0x44')]({},_0x28e504,_0x140a4d['options']);return db['SquareMessage'][_0xbb49('0x45')](_0x28e504)[_0xbb49('0x26')](handleEntityNotFound(_0x3fc6a5,null))[_0xbb49('0x26')](respondWithResult(_0x3fc6a5,null))['catch'](handleError(_0x3fc6a5,null));};exports['create']=function(_0x5a91bd,_0x1c4a69){return db[_0xbb49('0x2b')][_0xbb49('0x46')](_0x5a91bd[_0xbb49('0x47')],{})[_0xbb49('0x26')](respondWithResult(_0x1c4a69,0xc9))['catch'](handleError(_0x1c4a69,null));};exports[_0xbb49('0x25')]=function(_0x1adbd2,_0x37aee0){if(_0x1adbd2[_0xbb49('0x47')]['id']){delete _0x1adbd2['body']['id'];}return db[_0xbb49('0x2b')][_0xbb49('0x45')]({'where':{'id':_0x1adbd2['params']['id']}})[_0xbb49('0x26')](handleEntityNotFound(_0x37aee0,null))[_0xbb49('0x26')](saveUpdates(_0x1adbd2[_0xbb49('0x47')],null))[_0xbb49('0x26')](respondWithResult(_0x37aee0,null))[_0xbb49('0x41')](handleError(_0x37aee0,null));};exports[_0xbb49('0x48')]=function(_0x55a370,_0x410a34){return db[_0xbb49('0x2b')][_0xbb49('0x45')]({'where':{'id':_0x55a370[_0xbb49('0x42')]['id']}})['then'](handleEntityNotFound(_0x410a34,null))[_0xbb49('0x26')](removeEntity(_0x410a34,null))[_0xbb49('0x41')](handleError(_0x410a34,null));}; \ No newline at end of file +var _0xc2c4=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','options','include','findAll','rows','show','params','includeAll','find','create','catch','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0xc2c4,0x80));var _0x4c2c=function(_0x86280b,_0x4dd8af){_0x86280b=_0x86280b-0x0;var _0x1a1596=_0xc2c4[_0x86280b];return _0x1a1596;};'use strict';var emlformat=require(_0x4c2c('0x0'));var rimraf=require(_0x4c2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c2c('0x2'));var rp=require(_0x4c2c('0x3'));var moment=require(_0x4c2c('0x4'));var BPromise=require(_0x4c2c('0x5'));var Mustache=require(_0x4c2c('0x6'));var util=require(_0x4c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4c2c('0x8'));var ejs=require(_0x4c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x4c2c('0xa'));var _=require(_0x4c2c('0xb'));var squel=require(_0x4c2c('0xc'));var crypto=require(_0x4c2c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4c2c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4c2c('0xe'));var authService=require(_0x4c2c('0xf'));var qs=require(_0x4c2c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c2c('0x11'));var logger=require(_0x4c2c('0x12'))(_0x4c2c('0x13'));var utils=require(_0x4c2c('0x14'));var config=require(_0x4c2c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c2c('0x16'))['db'];function respondWithStatusCode(_0x39f26d,_0x49c29c){_0x49c29c=_0x49c29c||0xcc;return function(_0x17b0a5){if(_0x17b0a5){return _0x39f26d['sendStatus'](_0x49c29c);}return _0x39f26d['status'](_0x49c29c)[_0x4c2c('0x17')]();};}function respondWithResult(_0x5b8e7a,_0x5be1aa){_0x5be1aa=_0x5be1aa||0xc8;return function(_0x1f4113){if(_0x1f4113){return _0x5b8e7a[_0x4c2c('0x18')](_0x5be1aa)['json'](_0x1f4113);}};}function respondWithFilteredResult(_0x51e85d,_0x5f528e){return function(_0x3ac390){if(_0x3ac390){var _0x539ff4=typeof _0x5f528e[_0x4c2c('0x19')]===_0x4c2c('0x1a')&&typeof _0x5f528e[_0x4c2c('0x1b')]===_0x4c2c('0x1a');var _0x146efb=_0x3ac390[_0x4c2c('0x1c')];var _0x3b4d7e=_0x539ff4?0x0:_0x5f528e['offset'];var _0x324395=_0x539ff4?_0x3ac390[_0x4c2c('0x1c')]:_0x5f528e['offset']+_0x5f528e[_0x4c2c('0x1b')];var _0x2ed586;if(_0x324395>=_0x146efb){_0x324395=_0x146efb;_0x2ed586=0xc8;}else{_0x2ed586=0xce;}_0x51e85d[_0x4c2c('0x18')](_0x2ed586);return _0x51e85d[_0x4c2c('0x1d')]('Content-Range',_0x3b4d7e+'-'+_0x324395+'/'+_0x146efb)[_0x4c2c('0x1e')](_0x3ac390);}return null;};}function patchUpdates(_0x588f12){return function(_0x2e9fc0){try{jsonpatch[_0x4c2c('0x1f')](_0x2e9fc0,_0x588f12,!![]);}catch(_0xa6496f){return BPromise[_0x4c2c('0x20')](_0xa6496f);}return _0x2e9fc0[_0x4c2c('0x21')]();};}function saveUpdates(_0x5bcbd6,_0x1ea559){return function(_0x3e8cf8){if(_0x3e8cf8){return _0x3e8cf8[_0x4c2c('0x22')](_0x5bcbd6)[_0x4c2c('0x23')](function(_0x40b540){return _0x40b540;});}return null;};}function removeEntity(_0x5522ed,_0x3d8cf0){return function(_0x2e94ae){if(_0x2e94ae){return _0x2e94ae['destroy']()['then'](function(){_0x5522ed['status'](0xcc)[_0x4c2c('0x17')]();});}};}function handleEntityNotFound(_0x1d90c1,_0x101115){return function(_0x3e5d15){if(!_0x3e5d15){_0x1d90c1[_0x4c2c('0x24')](0x194);}return _0x3e5d15;};}function handleError(_0xa752c0,_0x3f8ea0){_0x3f8ea0=_0x3f8ea0||0x1f4;return function(_0x474244){logger[_0x4c2c('0x25')](_0x474244[_0x4c2c('0x26')]);if(_0x474244[_0x4c2c('0x27')]){delete _0x474244[_0x4c2c('0x27')];}_0xa752c0[_0x4c2c('0x18')](_0x3f8ea0)[_0x4c2c('0x28')](_0x474244);};}exports[_0x4c2c('0x29')]=function(_0x1f5664,_0x3ed6a9){var _0x4a1c93={},_0x5c0e66={},_0x16190d={'count':0x0,'rows':[]};var _0x4e59b0=_[_0x4c2c('0x2a')](db[_0x4c2c('0x2b')][_0x4c2c('0x2c')],function(_0x302aae){return{'name':_0x302aae[_0x4c2c('0x2d')],'type':_0x302aae[_0x4c2c('0x2e')][_0x4c2c('0x2f')]};});_0x5c0e66[_0x4c2c('0x30')]=_['map'](_0x4e59b0,'name');_0x5c0e66[_0x4c2c('0x31')]=_[_0x4c2c('0x32')](_0x1f5664[_0x4c2c('0x31')]);_0x5c0e66[_0x4c2c('0x33')]=_[_0x4c2c('0x34')](_0x5c0e66[_0x4c2c('0x30')],_0x5c0e66[_0x4c2c('0x31')]);_0x4a1c93[_0x4c2c('0x35')]=_[_0x4c2c('0x34')](_0x5c0e66['model'],qs[_0x4c2c('0x36')](_0x1f5664[_0x4c2c('0x31')][_0x4c2c('0x36')]));_0x4a1c93[_0x4c2c('0x35')]=_0x4a1c93['attributes'][_0x4c2c('0x37')]?_0x4a1c93[_0x4c2c('0x35')]:_0x5c0e66[_0x4c2c('0x30')];if(!_0x1f5664[_0x4c2c('0x31')]['hasOwnProperty']('nolimit')){_0x4a1c93[_0x4c2c('0x1b')]=qs['limit'](_0x1f5664[_0x4c2c('0x31')][_0x4c2c('0x1b')]);_0x4a1c93['offset']=qs[_0x4c2c('0x19')](_0x1f5664[_0x4c2c('0x31')][_0x4c2c('0x19')]);}_0x4a1c93[_0x4c2c('0x38')]=qs['sort'](_0x1f5664[_0x4c2c('0x31')][_0x4c2c('0x39')]);_0x4a1c93[_0x4c2c('0x3a')]=qs[_0x4c2c('0x33')](_['pick'](_0x1f5664['query'],_0x5c0e66[_0x4c2c('0x33')]),_0x4e59b0);if(_0x1f5664[_0x4c2c('0x31')][_0x4c2c('0x3b')]){_0x4a1c93[_0x4c2c('0x3a')]=_[_0x4c2c('0x3c')](_0x4a1c93[_0x4c2c('0x3a')],{'$or':_[_0x4c2c('0x2a')](_0x4e59b0,function(_0x107470){if(_0x107470[_0x4c2c('0x2e')]!=='VIRTUAL'){var _0x4952eb={};_0x4952eb[_0x107470['name']]={'$like':'%'+_0x1f5664['query'][_0x4c2c('0x3b')]+'%'};return _0x4952eb;}})});}_0x4a1c93=_[_0x4c2c('0x3c')]({},_0x4a1c93,_0x1f5664[_0x4c2c('0x3d')]);var _0x1dd894={'where':_0x4a1c93[_0x4c2c('0x3a')]};return db[_0x4c2c('0x2b')]['count'](_0x1dd894)[_0x4c2c('0x23')](function(_0x5edb58){_0x16190d[_0x4c2c('0x1c')]=_0x5edb58;if(_0x1f5664[_0x4c2c('0x31')]['includeAll']){_0x4a1c93[_0x4c2c('0x3e')]=[{'all':!![]}];}return db[_0x4c2c('0x2b')][_0x4c2c('0x3f')](_0x4a1c93);})[_0x4c2c('0x23')](function(_0x5c4037){_0x16190d[_0x4c2c('0x40')]=_0x5c4037;return _0x16190d;})[_0x4c2c('0x23')](respondWithFilteredResult(_0x3ed6a9,_0x4a1c93))['catch'](handleError(_0x3ed6a9,null));};exports[_0x4c2c('0x41')]=function(_0x1c46b1,_0x1269d7){var _0x77b175={'raw':!![],'where':{'id':_0x1c46b1[_0x4c2c('0x42')]['id']}},_0x4f807f={};_0x4f807f[_0x4c2c('0x30')]=_['keys'](db[_0x4c2c('0x2b')][_0x4c2c('0x2c')]);_0x4f807f[_0x4c2c('0x31')]=_[_0x4c2c('0x32')](_0x1c46b1[_0x4c2c('0x31')]);_0x4f807f[_0x4c2c('0x33')]=_['intersection'](_0x4f807f['model'],_0x4f807f[_0x4c2c('0x31')]);_0x77b175[_0x4c2c('0x35')]=_[_0x4c2c('0x34')](_0x4f807f[_0x4c2c('0x30')],qs[_0x4c2c('0x36')](_0x1c46b1[_0x4c2c('0x31')][_0x4c2c('0x36')]));_0x77b175[_0x4c2c('0x35')]=_0x77b175['attributes']['length']?_0x77b175['attributes']:_0x4f807f[_0x4c2c('0x30')];if(_0x1c46b1[_0x4c2c('0x31')][_0x4c2c('0x43')]){_0x77b175[_0x4c2c('0x3e')]=[{'all':!![]}];}_0x77b175=_[_0x4c2c('0x3c')]({},_0x77b175,_0x1c46b1[_0x4c2c('0x3d')]);return db[_0x4c2c('0x2b')][_0x4c2c('0x44')](_0x77b175)[_0x4c2c('0x23')](handleEntityNotFound(_0x1269d7,null))[_0x4c2c('0x23')](respondWithResult(_0x1269d7,null))['catch'](handleError(_0x1269d7,null));};exports[_0x4c2c('0x45')]=function(_0x473dc6,_0x1d4c53){return db[_0x4c2c('0x2b')][_0x4c2c('0x45')](_0x473dc6['body'],{})[_0x4c2c('0x23')](respondWithResult(_0x1d4c53,0xc9))[_0x4c2c('0x46')](handleError(_0x1d4c53,null));};exports['update']=function(_0x8c4794,_0x516671){if(_0x8c4794[_0x4c2c('0x47')]['id']){delete _0x8c4794[_0x4c2c('0x47')]['id'];}return db[_0x4c2c('0x2b')][_0x4c2c('0x44')]({'where':{'id':_0x8c4794[_0x4c2c('0x42')]['id']}})[_0x4c2c('0x23')](handleEntityNotFound(_0x516671,null))['then'](saveUpdates(_0x8c4794['body'],null))[_0x4c2c('0x23')](respondWithResult(_0x516671,null))[_0x4c2c('0x46')](handleError(_0x516671,null));};exports[_0x4c2c('0x48')]=function(_0x68ca37,_0x3843eb){return db[_0x4c2c('0x2b')][_0x4c2c('0x44')]({'where':{'id':_0x68ca37['params']['id']}})[_0x4c2c('0x23')](handleEntityNotFound(_0x3843eb,null))[_0x4c2c('0x23')](removeEntity(_0x3843eb,null))[_0x4c2c('0x46')](handleError(_0x3843eb,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 4f600b0..fdc7750 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 _0x7160=['request-promise','path','rimraf','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0x7160,0xc1));var _0x0716=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x7160[_0x279d37];return _0x530173;};'use strict';var _=require(_0x0716('0x0'));var util=require('util');var logger=require(_0x0716('0x1'))(_0x0716('0x2'));var moment=require(_0x0716('0x3'));var BPromise=require(_0x0716('0x4'));var rp=require(_0x0716('0x5'));var fs=require('fs');var path=require(_0x0716('0x6'));var rimraf=require(_0x0716('0x7'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module['exports']=function(_0x2c37af,_0x32efb5){return _0x2c37af[_0x0716('0x8')](_0x0716('0x9'),attributes,{'tableName':_0x0716('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4f6=['request-promise','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4f6,0x1c3));var _0x6c4f=function(_0x5f163c,_0x103edc){_0x5f163c=_0x5f163c-0x0;var _0x444827=_0xc4f6[_0x5f163c];return _0x444827;};'use strict';var _=require(_0x6c4f('0x0'));var util=require(_0x6c4f('0x1'));var logger=require(_0x6c4f('0x2'))('api');var moment=require(_0x6c4f('0x3'));var BPromise=require(_0x6c4f('0x4'));var rp=require(_0x6c4f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c4f('0x6'));var config=require(_0x6c4f('0x7'));var attributes=require(_0x6c4f('0x8'));module['exports']=function(_0x4496d,_0x4a5341){return _0x4496d[_0x6c4f('0x9')](_0x6c4f('0xa'),attributes,{'tableName':_0x6c4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 56229dc..1ceb4ef 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 _0x5f19=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','error','SquareMessage,\x20%s,\x20%s','message','result','catch','body','options','raw','CreateSquareMessage','debug','stringify','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f19,0x19a));var _0x95f1=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x5f19[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x95f1('0x0'));var BPromise=require(_0x95f1('0x1'));var rs=require(_0x95f1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95f1('0x3'))['db'];var utils=require(_0x95f1('0x4'));var logger=require(_0x95f1('0x5'))(_0x95f1('0x6'));var config=require(_0x95f1('0x7'));var jayson=require(_0x95f1('0x8'));var client=jayson[_0x95f1('0x9')][_0x95f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51f809,_0x1f0c72,_0x490649){return new BPromise(function(_0x440363,_0x4b91f2){return client['request'](_0x51f809,_0x490649)[_0x95f1('0xb')](function(_0x2d49cf){logger[_0x95f1('0xc')]('SquareMessage,\x20%s,\x20%s',_0x1f0c72,_0x95f1('0xd'));logger['debug'](_0x95f1('0xe'),_0x1f0c72,_0x95f1('0xd'),JSON['stringify'](_0x2d49cf));if(_0x2d49cf[_0x95f1('0xf')]){if(_0x2d49cf[_0x95f1('0xf')]['code']===0x1f4){logger[_0x95f1('0xf')](_0x95f1('0x10'),_0x1f0c72,_0x2d49cf['error'][_0x95f1('0x11')]);return _0x4b91f2(_0x2d49cf[_0x95f1('0xf')][_0x95f1('0x11')]);}logger[_0x95f1('0xf')]('SquareMessage,\x20%s,\x20%s',_0x1f0c72,_0x2d49cf[_0x95f1('0xf')][_0x95f1('0x11')]);return _0x440363(_0x2d49cf['error']['message']);}else{logger[_0x95f1('0xc')](_0x95f1('0x10'),_0x1f0c72,_0x95f1('0xd'));_0x440363(_0x2d49cf[_0x95f1('0x12')][_0x95f1('0x11')]);}})[_0x95f1('0x13')](function(_0x50f8d9){logger['error'](_0x95f1('0x10'),_0x1f0c72,_0x50f8d9);_0x4b91f2(_0x50f8d9);});});}exports['CreateSquareMessage']=function(_0x51eb7f){var _0x313756=this;return new Promise(function(_0x1e4f41,_0x22886c){return db['SquareMessage']['create'](_0x51eb7f[_0x95f1('0x14')],{'raw':_0x51eb7f[_0x95f1('0x15')]?_0x51eb7f[_0x95f1('0x15')][_0x95f1('0x16')]===undefined?!![]:![]:!![]})[_0x95f1('0xb')](function(_0x52a0c2){logger['info'](_0x95f1('0x17'),_0x51eb7f);logger[_0x95f1('0x18')]('CreateSquareMessage',_0x51eb7f,JSON[_0x95f1('0x19')](_0x52a0c2));_0x1e4f41(_0x52a0c2);})[_0x95f1('0x13')](function(_0x142931){logger['error']('CreateSquareMessage',_0x142931[_0x95f1('0x11')],_0x51eb7f);_0x22886c(_0x313756[_0x95f1('0xf')](0x1f4,_0x142931['message']));});});}; \ No newline at end of file +var _0x0a81=['SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SquareMessage','create','options','raw','then','CreateSquareMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x0a81,0x11e));var _0x10a8=function(_0xe6be75,_0x40db59){_0xe6be75=_0xe6be75-0x0;var _0x1a2b65=_0x0a81[_0xe6be75];return _0x1a2b65;};'use strict';var _=require(_0x10a8('0x0'));var util=require(_0x10a8('0x1'));var moment=require(_0x10a8('0x2'));var BPromise=require(_0x10a8('0x3'));var rs=require(_0x10a8('0x4'));var fs=require('fs');var Redis=require(_0x10a8('0x5'));var db=require(_0x10a8('0x6'))['db'];var utils=require(_0x10a8('0x7'));var logger=require(_0x10a8('0x8'))('rpc');var config=require(_0x10a8('0x9'));var jayson=require(_0x10a8('0xa'));var client=jayson[_0x10a8('0xb')][_0x10a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30c21e,_0x3bcea5,_0x4615a5){return new BPromise(function(_0x327a1d,_0x1d5936){return client[_0x10a8('0xd')](_0x30c21e,_0x4615a5)['then'](function(_0x305832){logger['info'](_0x10a8('0xe'),_0x3bcea5,_0x10a8('0xf'));logger['debug'](_0x10a8('0x10'),_0x3bcea5,'request\x20sent',JSON[_0x10a8('0x11')](_0x305832));if(_0x305832[_0x10a8('0x12')]){if(_0x305832[_0x10a8('0x12')][_0x10a8('0x13')]===0x1f4){logger['error'](_0x10a8('0xe'),_0x3bcea5,_0x305832[_0x10a8('0x12')][_0x10a8('0x14')]);return _0x1d5936(_0x305832['error']['message']);}logger[_0x10a8('0x12')]('SquareMessage,\x20%s,\x20%s',_0x3bcea5,_0x305832[_0x10a8('0x12')][_0x10a8('0x14')]);return _0x327a1d(_0x305832[_0x10a8('0x12')][_0x10a8('0x14')]);}else{logger[_0x10a8('0x15')](_0x10a8('0xe'),_0x3bcea5,_0x10a8('0xf'));_0x327a1d(_0x305832[_0x10a8('0x16')][_0x10a8('0x14')]);}})[_0x10a8('0x17')](function(_0x403f48){logger[_0x10a8('0x12')](_0x10a8('0xe'),_0x3bcea5,_0x403f48);_0x1d5936(_0x403f48);});});}exports['CreateSquareMessage']=function(_0x5c49e3){var _0x5ba6af=this;return new Promise(function(_0x2b66b4,_0x6b38fd){return db[_0x10a8('0x18')][_0x10a8('0x19')](_0x5c49e3['body'],{'raw':_0x5c49e3[_0x10a8('0x1a')]?_0x5c49e3['options'][_0x10a8('0x1b')]===undefined?!![]:![]:!![]})[_0x10a8('0x1c')](function(_0xc120cc){logger[_0x10a8('0x15')]('CreateSquareMessage',_0x5c49e3);logger['debug']('CreateSquareMessage',_0x5c49e3,JSON['stringify'](_0xc120cc));_0x2b66b4(_0xc120cc);})['catch'](function(_0x1b743b){logger[_0x10a8('0x12')](_0x10a8('0x1d'),_0x1b743b[_0x10a8('0x14')],_0x5c49e3);_0x6b38fd(_0x5ba6af[_0x10a8('0x12')](0x1f4,_0x1b743b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 2619dd4..8f632b2 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 _0x0378=['/:id/test','15s','test','post','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show'];(function(_0x41683c,_0x2d6c14){var _0x1b7826=function(_0x262a88){while(--_0x262a88){_0x41683c['push'](_0x41683c['shift']());}};_0x1b7826(++_0x2d6c14);}(_0x0378,0xbc));var _0x8037=function(_0x5aef24,_0x313a60){_0x5aef24=_0x5aef24-0x0;var _0x3bb965=_0x0378[_0x5aef24];return _0x3bb965;};'use strict';var multer=require(_0x8037('0x0'));var util=require(_0x8037('0x1'));var path=require(_0x8037('0x2'));var timeout=require(_0x8037('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8037('0x4'));var config=require(_0x8037('0x5'));var controller=require(_0x8037('0x6'));router[_0x8037('0x7')]('/',auth[_0x8037('0x8')](),controller[_0x8037('0x9')]);router[_0x8037('0x7')](_0x8037('0xa'),auth[_0x8037('0x8')](),controller[_0x8037('0xb')]);router['get'](_0x8037('0xc'),auth[_0x8037('0x8')](),timeout(_0x8037('0xd')),controller[_0x8037('0xe')]);router[_0x8037('0xf')]('/',auth[_0x8037('0x8')](),controller['create']);router['put'](_0x8037('0xa'),auth[_0x8037('0x8')](),controller[_0x8037('0x10')]);router[_0x8037('0x11')](_0x8037('0xa'),auth[_0x8037('0x8')](),controller[_0x8037('0x12')]);module[_0x8037('0x13')]=router; \ No newline at end of file +var _0x1fb7=['/:id','isAuthenticated','show','/:id/test','15s','test','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index'];(function(_0x13f5ac,_0x303066){var _0x163d97=function(_0x1c2c3e){while(--_0x1c2c3e){_0x13f5ac['push'](_0x13f5ac['shift']());}};_0x163d97(++_0x303066);}(_0x1fb7,0x11f));var _0x71fb=function(_0x3a14ac,_0x55403f){_0x3a14ac=_0x3a14ac-0x0;var _0x5e3bc3=_0x1fb7[_0x3a14ac];return _0x5e3bc3;};'use strict';var multer=require(_0x71fb('0x0'));var util=require(_0x71fb('0x1'));var path=require(_0x71fb('0x2'));var timeout=require(_0x71fb('0x3'));var express=require('express');var router=express[_0x71fb('0x4')]();var fs_extra=require(_0x71fb('0x5'));var auth=require(_0x71fb('0x6'));var interaction=require(_0x71fb('0x7'));var config=require(_0x71fb('0x8'));var controller=require(_0x71fb('0x9'));router[_0x71fb('0xa')]('/',auth['isAuthenticated'](),controller[_0x71fb('0xb')]);router['get'](_0x71fb('0xc'),auth[_0x71fb('0xd')](),controller[_0x71fb('0xe')]);router[_0x71fb('0xa')](_0x71fb('0xf'),auth[_0x71fb('0xd')](),timeout(_0x71fb('0x10')),controller[_0x71fb('0x11')]);router['post']('/',auth[_0x71fb('0xd')](),controller[_0x71fb('0x12')]);router[_0x71fb('0x13')](_0x71fb('0xc'),auth[_0x71fb('0xd')](),controller[_0x71fb('0x14')]);router['delete'](_0x71fb('0xc'),auth[_0x71fb('0xd')](),controller[_0x71fb('0x15')]);module[_0x71fb('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index bdb9a01..e1efc08 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 _0xec10=['exports','STRING','name','sequelize'];(function(_0x534c5a,_0x103a57){var _0x2e071a=function(_0x3a00ca){while(--_0x3a00ca){_0x534c5a['push'](_0x534c5a['shift']());}};_0x2e071a(++_0x103a57);}(_0xec10,0x15b));var _0x0ec1=function(_0x33e342,_0x126481){_0x33e342=_0x33e342-0x0;var _0x2f84dd=_0xec10[_0x33e342];return _0x2f84dd;};'use strict';var Sequelize=require(_0x0ec1('0x0'));module[_0x0ec1('0x1')]={'name':{'type':Sequelize[_0x0ec1('0x2')],'unique':_0x0ec1('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0ec1('0x2')]},'description':{'type':Sequelize[_0x0ec1('0x2')]}}; \ No newline at end of file +var _0xf72a=['STRING','name'];(function(_0x3792e6,_0x32bd91){var _0x441e44=function(_0x357478){while(--_0x357478){_0x3792e6['push'](_0x3792e6['shift']());}};_0x441e44(++_0x32bd91);}(_0xf72a,0x131));var _0xaf72=function(_0x584fb4,_0x409653){_0x584fb4=_0x584fb4-0x0;var _0x2609b9=_0xf72a[_0x584fb4];return _0x2609b9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xaf72('0x0'),'allowNull':![]},'dsn':{'type':Sequelize[_0xaf72('0x1')]},'description':{'type':Sequelize[_0xaf72('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 0f1a26b..a29a3ad 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 _0x8ee3=['send','map','SquareOdbc','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ODBC','find','userProfileId','update','test','odbc','dsn','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name'];(function(_0x33628a,_0x2df134){var _0x25d370=function(_0x5567fc){while(--_0x5567fc){_0x33628a['push'](_0x33628a['shift']());}};_0x25d370(++_0x2df134);}(_0x8ee3,0x7f));var _0x38ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ee3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x38ee('0x0'));var rimraf=require(_0x38ee('0x1'));var zipdir=require(_0x38ee('0x2'));var jsonpatch=require(_0x38ee('0x3'));var rp=require(_0x38ee('0x4'));var moment=require(_0x38ee('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x38ee('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x38ee('0x7'));var ejs=require(_0x38ee('0x8'));var fs=require('fs');var fs_extra=require(_0x38ee('0x9'));var _=require(_0x38ee('0xa'));var squel=require(_0x38ee('0xb'));var crypto=require(_0x38ee('0xc'));var jsforce=require(_0x38ee('0xd'));var deskjs=require(_0x38ee('0xe'));var toCsv=require(_0x38ee('0x7'));var querystring=require(_0x38ee('0xf'));var Papa=require(_0x38ee('0x10'));var Redis=require('ioredis');var authService=require(_0x38ee('0x11'));var qs=require(_0x38ee('0x12'));var as=require(_0x38ee('0x13'));var hardwareService=require(_0x38ee('0x14'));var logger=require(_0x38ee('0x15'))(_0x38ee('0x16'));var utils=require('../../config/utils');var config=require(_0x38ee('0x17'));var licenseUtil=require(_0x38ee('0x18'));var db=require(_0x38ee('0x19'))['db'];function respondWithStatusCode(_0x49d7a6,_0x258c42){_0x258c42=_0x258c42||0xcc;return function(_0x5eef08){if(_0x5eef08){return _0x49d7a6[_0x38ee('0x1a')](_0x258c42);}return _0x49d7a6['status'](_0x258c42)[_0x38ee('0x1b')]();};}function respondWithResult(_0x807641,_0x22e622){_0x22e622=_0x22e622||0xc8;return function(_0x399d34){if(_0x399d34){return _0x807641['status'](_0x22e622)['json'](_0x399d34);}};}function respondWithFilteredResult(_0x50e66f,_0x3a71df){return function(_0x37c33c){if(_0x37c33c){var _0x4fcaa9=typeof _0x3a71df[_0x38ee('0x1c')]===_0x38ee('0x1d')&&typeof _0x3a71df[_0x38ee('0x1e')]===_0x38ee('0x1d');var _0x206d93=_0x37c33c[_0x38ee('0x1f')];var _0x4e1549=_0x4fcaa9?0x0:_0x3a71df[_0x38ee('0x1c')];var _0xbd4416=_0x4fcaa9?_0x37c33c['count']:_0x3a71df['offset']+_0x3a71df[_0x38ee('0x1e')];var _0x35d379;if(_0xbd4416>=_0x206d93){_0xbd4416=_0x206d93;_0x35d379=0xc8;}else{_0x35d379=0xce;}_0x50e66f[_0x38ee('0x20')](_0x35d379);return _0x50e66f['set'](_0x38ee('0x21'),_0x4e1549+'-'+_0xbd4416+'/'+_0x206d93)['json'](_0x37c33c);}return null;};}function patchUpdates(_0x317b9d){return function(_0x30cd27){try{jsonpatch[_0x38ee('0x22')](_0x30cd27,_0x317b9d,!![]);}catch(_0x178cf8){return BPromise[_0x38ee('0x23')](_0x178cf8);}return _0x30cd27['save']();};}function saveUpdates(_0x85495e,_0x243bb8){return function(_0x476255){if(_0x476255){return _0x476255['update'](_0x85495e)[_0x38ee('0x24')](function(_0x5c14b7){return _0x5c14b7;});}return null;};}function removeEntity(_0x42f753,_0x43ff49){return function(_0x5730d1){if(_0x5730d1){return _0x5730d1[_0x38ee('0x25')]()[_0x38ee('0x24')](function(){var _0x1425a1=_0x5730d1[_0x38ee('0x26')]({'plain':!![]});var _0x4f51be='ODBC';return db[_0x38ee('0x27')]['destroy']({'where':{'type':_0x4f51be,'resourceId':_0x1425a1['id']}})[_0x38ee('0x24')](function(){return _0x5730d1;});})[_0x38ee('0x24')](function(){_0x42f753['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x956499,_0x4c7dd3){return function(_0x4c1fe4){if(!_0x4c1fe4){_0x956499[_0x38ee('0x1a')](0x194);}return _0x4c1fe4;};}function handleError(_0x40b625,_0x43863e){_0x43863e=_0x43863e||0x1f4;return function(_0x3d1607){logger[_0x38ee('0x28')](_0x3d1607[_0x38ee('0x29')]);if(_0x3d1607['name']){delete _0x3d1607[_0x38ee('0x2a')];}_0x40b625[_0x38ee('0x20')](_0x43863e)[_0x38ee('0x2b')](_0x3d1607);};}exports['index']=function(_0xed6019,_0x229c2b){var _0xe5023b={},_0x322fd8={},_0xeaf8cd={'count':0x0,'rows':[]};var _0x235d4e=_[_0x38ee('0x2c')](db[_0x38ee('0x2d')][_0x38ee('0x2e')],function(_0x1ec02e){return{'name':_0x1ec02e['fieldName'],'type':_0x1ec02e[_0x38ee('0x2f')][_0x38ee('0x30')]};});_0x322fd8[_0x38ee('0x31')]=_[_0x38ee('0x2c')](_0x235d4e,'name');_0x322fd8[_0x38ee('0x32')]=_['keys'](_0xed6019['query']);_0x322fd8[_0x38ee('0x33')]=_[_0x38ee('0x34')](_0x322fd8['model'],_0x322fd8[_0x38ee('0x32')]);_0xe5023b[_0x38ee('0x35')]=_[_0x38ee('0x34')](_0x322fd8[_0x38ee('0x31')],qs[_0x38ee('0x36')](_0xed6019[_0x38ee('0x32')][_0x38ee('0x36')]));_0xe5023b[_0x38ee('0x35')]=_0xe5023b[_0x38ee('0x35')][_0x38ee('0x37')]?_0xe5023b[_0x38ee('0x35')]:_0x322fd8[_0x38ee('0x31')];if(!_0xed6019['query'][_0x38ee('0x38')](_0x38ee('0x39'))){_0xe5023b['limit']=qs[_0x38ee('0x1e')](_0xed6019[_0x38ee('0x32')][_0x38ee('0x1e')]);_0xe5023b[_0x38ee('0x1c')]=qs[_0x38ee('0x1c')](_0xed6019[_0x38ee('0x32')]['offset']);}_0xe5023b[_0x38ee('0x3a')]=qs[_0x38ee('0x3b')](_0xed6019['query'][_0x38ee('0x3b')]);_0xe5023b[_0x38ee('0x3c')]=qs[_0x38ee('0x33')](_[_0x38ee('0x3d')](_0xed6019[_0x38ee('0x32')],_0x322fd8[_0x38ee('0x33')]),_0x235d4e);if(_0xed6019[_0x38ee('0x32')][_0x38ee('0x3e')]){_0xe5023b['where']=_[_0x38ee('0x3f')](_0xe5023b['where'],{'$or':_[_0x38ee('0x2c')](_0x235d4e,function(_0x149cda){if(_0x149cda[_0x38ee('0x2f')]!=='VIRTUAL'){var _0x25d734={};_0x25d734[_0x149cda['name']]={'$like':'%'+_0xed6019[_0x38ee('0x32')][_0x38ee('0x3e')]+'%'};return _0x25d734;}})});}_0xe5023b=_[_0x38ee('0x3f')]({},_0xe5023b,_0xed6019[_0x38ee('0x40')]);var _0x993276={'where':_0xe5023b[_0x38ee('0x3c')]};return db['SquareOdbc'][_0x38ee('0x1f')](_0x993276)[_0x38ee('0x24')](function(_0x16cd72){_0xeaf8cd[_0x38ee('0x1f')]=_0x16cd72;if(_0xed6019['query'][_0x38ee('0x41')]){_0xe5023b['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x38ee('0x42')](_0xe5023b);})[_0x38ee('0x24')](function(_0x3b14c0){_0xeaf8cd[_0x38ee('0x43')]=_0x3b14c0;return _0xeaf8cd;})[_0x38ee('0x24')](respondWithFilteredResult(_0x229c2b,_0xe5023b))[_0x38ee('0x44')](handleError(_0x229c2b,null));};exports[_0x38ee('0x45')]=function(_0xcb604,_0x1761ba){var _0x92c46d={'raw':!![],'where':{'id':_0xcb604[_0x38ee('0x46')]['id']}},_0x5d0208={};_0x5d0208['model']=_[_0x38ee('0x47')](db[_0x38ee('0x2d')]['rawAttributes']);_0x5d0208['query']=_[_0x38ee('0x47')](_0xcb604[_0x38ee('0x32')]);_0x5d0208[_0x38ee('0x33')]=_[_0x38ee('0x34')](_0x5d0208[_0x38ee('0x31')],_0x5d0208[_0x38ee('0x32')]);_0x92c46d['attributes']=_['intersection'](_0x5d0208['model'],qs[_0x38ee('0x36')](_0xcb604[_0x38ee('0x32')]['fields']));_0x92c46d[_0x38ee('0x35')]=_0x92c46d[_0x38ee('0x35')][_0x38ee('0x37')]?_0x92c46d[_0x38ee('0x35')]:_0x5d0208[_0x38ee('0x31')];if(_0xcb604[_0x38ee('0x32')]['includeAll']){_0x92c46d[_0x38ee('0x48')]=[{'all':!![]}];}_0x92c46d=_[_0x38ee('0x3f')]({},_0x92c46d,_0xcb604[_0x38ee('0x40')]);return db[_0x38ee('0x2d')]['find'](_0x92c46d)[_0x38ee('0x24')](handleEntityNotFound(_0x1761ba,null))[_0x38ee('0x24')](respondWithResult(_0x1761ba,null))[_0x38ee('0x44')](handleError(_0x1761ba,null));};exports['create']=function(_0x23d2aa,_0x25dc57){return db[_0x38ee('0x2d')][_0x38ee('0x49')](_0x23d2aa[_0x38ee('0x4a')],{})[_0x38ee('0x24')](function(_0x4e1765){var _0x1cb3ec=_0x23d2aa['user'][_0x38ee('0x26')]({'plain':!![]});if(!_0x1cb3ec)throw new Error(_0x38ee('0x4b'));if(_0x1cb3ec[_0x38ee('0x4c')]===_0x38ee('0x4d')){var _0x116a73=_0x4e1765[_0x38ee('0x26')]({'plain':!![]});var _0x2a667c=_0x38ee('0x4e');return db['UserProfileSection'][_0x38ee('0x4f')]({'where':{'name':_0x2a667c,'userProfileId':_0x1cb3ec[_0x38ee('0x50')]},'raw':!![]})[_0x38ee('0x24')](function(_0x2508cb){if(_0x2508cb&&_0x2508cb['autoAssociation']===0x0){return db[_0x38ee('0x27')][_0x38ee('0x49')]({'name':_0x116a73[_0x38ee('0x2a')],'resourceId':_0x116a73['id'],'type':_0x2508cb[_0x38ee('0x2a')],'sectionId':_0x2508cb['id']},{})[_0x38ee('0x24')](function(){return _0x4e1765;});}else{return _0x4e1765;}})['catch'](function(_0x4cbeab){logger[_0x38ee('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cbeab);throw _0x4cbeab;});}return _0x4e1765;})[_0x38ee('0x24')](respondWithResult(_0x25dc57,0xc9))[_0x38ee('0x44')](handleError(_0x25dc57,null));};exports[_0x38ee('0x51')]=function(_0x2faac1,_0x472a5f){if(_0x2faac1[_0x38ee('0x4a')]['id']){delete _0x2faac1[_0x38ee('0x4a')]['id'];}return db[_0x38ee('0x2d')]['find']({'where':{'id':_0x2faac1[_0x38ee('0x46')]['id']}})['then'](handleEntityNotFound(_0x472a5f,null))[_0x38ee('0x24')](saveUpdates(_0x2faac1[_0x38ee('0x4a')],null))[_0x38ee('0x24')](respondWithResult(_0x472a5f,null))['catch'](handleError(_0x472a5f,null));};exports['destroy']=function(_0x2a1b0e,_0x1d045b){return db['SquareOdbc']['find']({'where':{'id':_0x2a1b0e[_0x38ee('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d045b,null))[_0x38ee('0x24')](removeEntity(_0x1d045b,null))[_0x38ee('0x44')](handleError(_0x1d045b,null));};exports[_0x38ee('0x52')]=function(_0x1dd4e3,_0x1aff26,_0x34a361){var _0x12c668;return db[_0x38ee('0x2d')][_0x38ee('0x4f')]({'where':{'id':_0x1dd4e3['params']['id']},'attributes':['id','dsn']})[_0x38ee('0x24')](handleEntityNotFound(_0x1aff26,null))[_0x38ee('0x24')](function(_0x2ff283){if(_0x2ff283){var _0x40b1e9=require(_0x38ee('0x53'))();_0x40b1e9['openSync'](_0x2ff283[_0x38ee('0x54')]);_0x40b1e9['closeSync']();return _0x2ff283;}})[_0x38ee('0x24')](respondWithResult(_0x1aff26,null))[_0x38ee('0x44')](handleError(_0x1aff26,null));}; \ No newline at end of file +var _0x1bb3=['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','body','test','odbc','openSync','dsn','closeSync','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../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','get','ODBC','UserProfileResource','destroy','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0x1bb3,0x170));var _0x31bb=function(_0x2f5bd7,_0x3ff52a){_0x2f5bd7=_0x2f5bd7-0x0;var _0x137266=_0x1bb3[_0x2f5bd7];return _0x137266;};'use strict';var emlformat=require(_0x31bb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x31bb('0x1'));var rp=require('request-promise');var moment=require(_0x31bb('0x2'));var BPromise=require(_0x31bb('0x3'));var Mustache=require(_0x31bb('0x4'));var util=require(_0x31bb('0x5'));var path=require(_0x31bb('0x6'));var sox=require(_0x31bb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31bb('0x8'));var _=require('lodash');var squel=require(_0x31bb('0x9'));var crypto=require(_0x31bb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x31bb('0xb'));var toCsv=require(_0x31bb('0xc'));var querystring=require(_0x31bb('0xd'));var Papa=require(_0x31bb('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x31bb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31bb('0x10'));var logger=require(_0x31bb('0x11'))(_0x31bb('0x12'));var utils=require('../../config/utils');var config=require(_0x31bb('0x13'));var licenseUtil=require(_0x31bb('0x14'));var db=require(_0x31bb('0x15'))['db'];function respondWithStatusCode(_0x47f112,_0x5377f1){_0x5377f1=_0x5377f1||0xcc;return function(_0x23987a){if(_0x23987a){return _0x47f112[_0x31bb('0x16')](_0x5377f1);}return _0x47f112[_0x31bb('0x17')](_0x5377f1)[_0x31bb('0x18')]();};}function respondWithResult(_0x1d174b,_0x527657){_0x527657=_0x527657||0xc8;return function(_0x3776ed){if(_0x3776ed){return _0x1d174b[_0x31bb('0x17')](_0x527657)[_0x31bb('0x19')](_0x3776ed);}};}function respondWithFilteredResult(_0x56de72,_0x55a60b){return function(_0x305163){if(_0x305163){var _0x4e6967=typeof _0x55a60b[_0x31bb('0x1a')]===_0x31bb('0x1b')&&typeof _0x55a60b[_0x31bb('0x1c')]===_0x31bb('0x1b');var _0x3b07ff=_0x305163['count'];var _0x3036df=_0x4e6967?0x0:_0x55a60b[_0x31bb('0x1a')];var _0x28e220=_0x4e6967?_0x305163[_0x31bb('0x1d')]:_0x55a60b[_0x31bb('0x1a')]+_0x55a60b[_0x31bb('0x1c')];var _0x36551f;if(_0x28e220>=_0x3b07ff){_0x28e220=_0x3b07ff;_0x36551f=0xc8;}else{_0x36551f=0xce;}_0x56de72['status'](_0x36551f);return _0x56de72[_0x31bb('0x1e')](_0x31bb('0x1f'),_0x3036df+'-'+_0x28e220+'/'+_0x3b07ff)[_0x31bb('0x19')](_0x305163);}return null;};}function patchUpdates(_0x78d51a){return function(_0x390f21){try{jsonpatch[_0x31bb('0x20')](_0x390f21,_0x78d51a,!![]);}catch(_0x10e94e){return BPromise[_0x31bb('0x21')](_0x10e94e);}return _0x390f21[_0x31bb('0x22')]();};}function saveUpdates(_0x50e2c3,_0x1c8063){return function(_0x2ede1c){if(_0x2ede1c){return _0x2ede1c[_0x31bb('0x23')](_0x50e2c3)[_0x31bb('0x24')](function(_0x394525){return _0x394525;});}return null;};}function removeEntity(_0x524ac3,_0x543b11){return function(_0x247e1e){if(_0x247e1e){return _0x247e1e['destroy']()[_0x31bb('0x24')](function(){var _0x24e3c1=_0x247e1e[_0x31bb('0x25')]({'plain':!![]});var _0x6ef83f=_0x31bb('0x26');return db[_0x31bb('0x27')][_0x31bb('0x28')]({'where':{'type':_0x6ef83f,'resourceId':_0x24e3c1['id']}})[_0x31bb('0x24')](function(){return _0x247e1e;});})[_0x31bb('0x24')](function(){_0x524ac3['status'](0xcc)[_0x31bb('0x18')]();});}};}function handleEntityNotFound(_0x4651b7,_0x48c4f3){return function(_0x421f24){if(!_0x421f24){_0x4651b7[_0x31bb('0x16')](0x194);}return _0x421f24;};}function handleError(_0x1622e1,_0x3d9421){_0x3d9421=_0x3d9421||0x1f4;return function(_0x5a71f8){logger['error'](_0x5a71f8['stack']);if(_0x5a71f8[_0x31bb('0x29')]){delete _0x5a71f8[_0x31bb('0x29')];}_0x1622e1[_0x31bb('0x17')](_0x3d9421)[_0x31bb('0x2a')](_0x5a71f8);};}exports[_0x31bb('0x2b')]=function(_0x29b394,_0x40bd8f){var _0x5d4cc5={},_0x14b036={},_0x1c49ec={'count':0x0,'rows':[]};var _0x9791c5=_[_0x31bb('0x2c')](db[_0x31bb('0x2d')][_0x31bb('0x2e')],function(_0x3f2aaf){return{'name':_0x3f2aaf[_0x31bb('0x2f')],'type':_0x3f2aaf[_0x31bb('0x30')]['key']};});_0x14b036[_0x31bb('0x31')]=_[_0x31bb('0x2c')](_0x9791c5,'name');_0x14b036[_0x31bb('0x32')]=_[_0x31bb('0x33')](_0x29b394['query']);_0x14b036['filters']=_['intersection'](_0x14b036[_0x31bb('0x31')],_0x14b036[_0x31bb('0x32')]);_0x5d4cc5[_0x31bb('0x34')]=_[_0x31bb('0x35')](_0x14b036[_0x31bb('0x31')],qs[_0x31bb('0x36')](_0x29b394[_0x31bb('0x32')]['fields']));_0x5d4cc5[_0x31bb('0x34')]=_0x5d4cc5[_0x31bb('0x34')][_0x31bb('0x37')]?_0x5d4cc5[_0x31bb('0x34')]:_0x14b036['model'];if(!_0x29b394[_0x31bb('0x32')]['hasOwnProperty'](_0x31bb('0x38'))){_0x5d4cc5[_0x31bb('0x1c')]=qs[_0x31bb('0x1c')](_0x29b394[_0x31bb('0x32')]['limit']);_0x5d4cc5[_0x31bb('0x1a')]=qs[_0x31bb('0x1a')](_0x29b394[_0x31bb('0x32')]['offset']);}_0x5d4cc5[_0x31bb('0x39')]=qs[_0x31bb('0x3a')](_0x29b394[_0x31bb('0x32')]['sort']);_0x5d4cc5[_0x31bb('0x3b')]=qs[_0x31bb('0x3c')](_[_0x31bb('0x3d')](_0x29b394[_0x31bb('0x32')],_0x14b036[_0x31bb('0x3c')]),_0x9791c5);if(_0x29b394['query'][_0x31bb('0x3e')]){_0x5d4cc5['where']=_[_0x31bb('0x3f')](_0x5d4cc5[_0x31bb('0x3b')],{'$or':_[_0x31bb('0x2c')](_0x9791c5,function(_0x595754){if(_0x595754[_0x31bb('0x30')]!==_0x31bb('0x40')){var _0x208cbc={};_0x208cbc[_0x595754['name']]={'$like':'%'+_0x29b394[_0x31bb('0x32')]['filter']+'%'};return _0x208cbc;}})});}_0x5d4cc5=_[_0x31bb('0x3f')]({},_0x5d4cc5,_0x29b394[_0x31bb('0x41')]);var _0x495aab={'where':_0x5d4cc5[_0x31bb('0x3b')]};return db[_0x31bb('0x2d')]['count'](_0x495aab)[_0x31bb('0x24')](function(_0x5b766c){_0x1c49ec[_0x31bb('0x1d')]=_0x5b766c;if(_0x29b394[_0x31bb('0x32')]['includeAll']){_0x5d4cc5[_0x31bb('0x42')]=[{'all':!![]}];}return db['SquareOdbc'][_0x31bb('0x43')](_0x5d4cc5);})[_0x31bb('0x24')](function(_0x854953){_0x1c49ec[_0x31bb('0x44')]=_0x854953;return _0x1c49ec;})[_0x31bb('0x24')](respondWithFilteredResult(_0x40bd8f,_0x5d4cc5))[_0x31bb('0x45')](handleError(_0x40bd8f,null));};exports[_0x31bb('0x46')]=function(_0x254299,_0x326339){var _0x2f5d04={'raw':!![],'where':{'id':_0x254299[_0x31bb('0x47')]['id']}},_0x299616={};_0x299616[_0x31bb('0x31')]=_[_0x31bb('0x33')](db[_0x31bb('0x2d')][_0x31bb('0x2e')]);_0x299616['query']=_[_0x31bb('0x33')](_0x254299[_0x31bb('0x32')]);_0x299616[_0x31bb('0x3c')]=_['intersection'](_0x299616[_0x31bb('0x31')],_0x299616[_0x31bb('0x32')]);_0x2f5d04['attributes']=_[_0x31bb('0x35')](_0x299616[_0x31bb('0x31')],qs[_0x31bb('0x36')](_0x254299[_0x31bb('0x32')][_0x31bb('0x36')]));_0x2f5d04[_0x31bb('0x34')]=_0x2f5d04[_0x31bb('0x34')]['length']?_0x2f5d04[_0x31bb('0x34')]:_0x299616[_0x31bb('0x31')];if(_0x254299[_0x31bb('0x32')][_0x31bb('0x48')]){_0x2f5d04[_0x31bb('0x42')]=[{'all':!![]}];}_0x2f5d04=_['merge']({},_0x2f5d04,_0x254299['options']);return db[_0x31bb('0x2d')][_0x31bb('0x49')](_0x2f5d04)[_0x31bb('0x24')](handleEntityNotFound(_0x326339,null))['then'](respondWithResult(_0x326339,null))[_0x31bb('0x45')](handleError(_0x326339,null));};exports[_0x31bb('0x4a')]=function(_0x1ce8be,_0x3c8919){return db[_0x31bb('0x2d')][_0x31bb('0x4a')](_0x1ce8be['body'],{})[_0x31bb('0x24')](function(_0x2957c){var _0x517581=_0x1ce8be[_0x31bb('0x4b')]['get']({'plain':!![]});if(!_0x517581)throw new Error(_0x31bb('0x4c'));if(_0x517581[_0x31bb('0x4d')]===_0x31bb('0x4b')){var _0x4e2180=_0x2957c[_0x31bb('0x25')]({'plain':!![]});var _0x5bafc5=_0x31bb('0x26');return db[_0x31bb('0x4e')][_0x31bb('0x49')]({'where':{'name':_0x5bafc5,'userProfileId':_0x517581['userProfileId']},'raw':!![]})['then'](function(_0x333c7a){if(_0x333c7a&&_0x333c7a[_0x31bb('0x4f')]===0x0){return db[_0x31bb('0x27')][_0x31bb('0x4a')]({'name':_0x4e2180['name'],'resourceId':_0x4e2180['id'],'type':_0x333c7a[_0x31bb('0x29')],'sectionId':_0x333c7a['id']},{})[_0x31bb('0x24')](function(){return _0x2957c;});}else{return _0x2957c;}})[_0x31bb('0x45')](function(_0x1264e3){logger[_0x31bb('0x50')](_0x31bb('0x51'),_0x1264e3);throw _0x1264e3;});}return _0x2957c;})['then'](respondWithResult(_0x3c8919,0xc9))[_0x31bb('0x45')](handleError(_0x3c8919,null));};exports[_0x31bb('0x23')]=function(_0xab6c54,_0x68c1f8){if(_0xab6c54[_0x31bb('0x52')]['id']){delete _0xab6c54['body']['id'];}return db[_0x31bb('0x2d')][_0x31bb('0x49')]({'where':{'id':_0xab6c54['params']['id']}})[_0x31bb('0x24')](handleEntityNotFound(_0x68c1f8,null))[_0x31bb('0x24')](saveUpdates(_0xab6c54[_0x31bb('0x52')],null))[_0x31bb('0x24')](respondWithResult(_0x68c1f8,null))['catch'](handleError(_0x68c1f8,null));};exports[_0x31bb('0x28')]=function(_0x6c9759,_0x5b390b){return db[_0x31bb('0x2d')][_0x31bb('0x49')]({'where':{'id':_0x6c9759['params']['id']}})[_0x31bb('0x24')](handleEntityNotFound(_0x5b390b,null))[_0x31bb('0x24')](removeEntity(_0x5b390b,null))[_0x31bb('0x45')](handleError(_0x5b390b,null));};exports[_0x31bb('0x53')]=function(_0xbf0ca1,_0x300076,_0x6a725a){var _0xd50739;return db[_0x31bb('0x2d')][_0x31bb('0x49')]({'where':{'id':_0xbf0ca1[_0x31bb('0x47')]['id']},'attributes':['id','dsn']})[_0x31bb('0x24')](handleEntityNotFound(_0x300076,null))['then'](function(_0x3142b3){if(_0x3142b3){var _0x4a86ef=require(_0x31bb('0x54'))();_0x4a86ef[_0x31bb('0x55')](_0x3142b3[_0x31bb('0x56')]);_0x4a86ef[_0x31bb('0x57')]();return _0x3142b3;}})[_0x31bb('0x24')](respondWithResult(_0x300076,null))[_0x31bb('0x45')](handleError(_0x300076,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 420b8e4..59c36fc 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 _0xe225=['rimraf','define','SquareOdbc','square_odbc','util','../../config/logger','request-promise'];(function(_0x3162ec,_0x391377){var _0x56b740=function(_0x1daeca){while(--_0x1daeca){_0x3162ec['push'](_0x3162ec['shift']());}};_0x56b740(++_0x391377);}(_0xe225,0x1bd));var _0x5e22=function(_0x178b3d,_0x40dc46){_0x178b3d=_0x178b3d-0x0;var _0x1c05c1=_0xe225[_0x178b3d];return _0x1c05c1;};'use strict';var _=require('lodash');var util=require(_0x5e22('0x0'));var logger=require(_0x5e22('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5e22('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e22('0x3'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x45595c,_0x35248d){return _0x45595c[_0x5e22('0x4')](_0x5e22('0x5'),attributes,{'tableName':_0x5e22('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd4e=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','SquareOdbc','square_odbc'];(function(_0x13f89c,_0x635278){var _0xaad0b9=function(_0x3a3fab){while(--_0x3a3fab){_0x13f89c['push'](_0x13f89c['shift']());}};_0xaad0b9(++_0x635278);}(_0xfd4e,0x1b0));var _0xefd4=function(_0x1aaea7,_0x1baef9){_0x1aaea7=_0x1aaea7-0x0;var _0xd23d19=_0xfd4e[_0x1aaea7];return _0xd23d19;};'use strict';var _=require(_0xefd4('0x0'));var util=require(_0xefd4('0x1'));var logger=require('../../config/logger')(_0xefd4('0x2'));var moment=require(_0xefd4('0x3'));var BPromise=require(_0xefd4('0x4'));var rp=require(_0xefd4('0x5'));var fs=require('fs');var path=require(_0xefd4('0x6'));var rimraf=require(_0xefd4('0x7'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0xefd4('0x8')]=function(_0x285e3f,_0x308148){return _0x285e3f[_0xefd4('0x9')](_0xefd4('0xa'),attributes,{'tableName':_0xefd4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index d605ba8..c82e436 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 _0xa5b8=['rpc','../../config/environment','jayson/promise','client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','SquareOdbc','options','raw','attributes','include','map','model','ShowSquareOdbc','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xa5b8,0xbe));var _0x8a5b=function(_0x59a3eb,_0x363f01){_0x59a3eb=_0x59a3eb-0x0;var _0x2cf9f2=_0xa5b8[_0x59a3eb];return _0x2cf9f2;};'use strict';var _=require(_0x8a5b('0x0'));var util=require('util');var moment=require(_0x8a5b('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a5b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a5b('0x3'))['db'];var utils=require(_0x8a5b('0x4'));var logger=require(_0x8a5b('0x5'))(_0x8a5b('0x6'));var config=require(_0x8a5b('0x7'));var jayson=require(_0x8a5b('0x8'));var client=jayson[_0x8a5b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37dcfd,_0x1050fa,_0x2f503d){return new BPromise(function(_0x2d815c,_0xecec1){return client[_0x8a5b('0xa')](_0x37dcfd,_0x2f503d)[_0x8a5b('0xb')](function(_0x555e60){logger[_0x8a5b('0xc')](_0x8a5b('0xd'),_0x1050fa,_0x8a5b('0xe'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1050fa,_0x8a5b('0xe'),JSON['stringify'](_0x555e60));if(_0x555e60['error']){if(_0x555e60[_0x8a5b('0xf')][_0x8a5b('0x10')]===0x1f4){logger['error'](_0x8a5b('0xd'),_0x1050fa,_0x555e60[_0x8a5b('0xf')][_0x8a5b('0x11')]);return _0xecec1(_0x555e60[_0x8a5b('0xf')]['message']);}logger[_0x8a5b('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x1050fa,_0x555e60[_0x8a5b('0xf')][_0x8a5b('0x11')]);return _0x2d815c(_0x555e60[_0x8a5b('0xf')][_0x8a5b('0x11')]);}else{logger[_0x8a5b('0xc')](_0x8a5b('0xd'),_0x1050fa,_0x8a5b('0xe'));_0x2d815c(_0x555e60[_0x8a5b('0x12')][_0x8a5b('0x11')]);}})[_0x8a5b('0x13')](function(_0x2d5d15){logger['error'](_0x8a5b('0xd'),_0x1050fa,_0x2d5d15);_0xecec1(_0x2d5d15);});});}exports['ShowSquareOdbc']=function(_0x2ce11f){var _0x533b77=this;return new Promise(function(_0x51136c,_0x3d3e33){return db[_0x8a5b('0x14')]['find']({'raw':_0x2ce11f[_0x8a5b('0x15')]?_0x2ce11f[_0x8a5b('0x15')][_0x8a5b('0x16')]===undefined?!![]:![]:!![],'where':_0x2ce11f[_0x8a5b('0x15')]?_0x2ce11f['options']['where']||null:null,'attributes':_0x2ce11f[_0x8a5b('0x15')]?_0x2ce11f[_0x8a5b('0x15')][_0x8a5b('0x17')]||null:null,'include':_0x2ce11f['options']?_0x2ce11f[_0x8a5b('0x15')][_0x8a5b('0x18')]?_[_0x8a5b('0x19')](_0x2ce11f[_0x8a5b('0x15')][_0x8a5b('0x18')],function(_0x758216){return{'model':db[_0x758216[_0x8a5b('0x1a')]],'as':_0x758216['as'],'attributes':_0x758216['attributes'],'include':_0x758216[_0x8a5b('0x18')]?_['map'](_0x758216[_0x8a5b('0x18')],function(_0xf048cd){return{'model':db[_0xf048cd[_0x8a5b('0x1a')]],'as':_0xf048cd['as'],'attributes':_0xf048cd['attributes'],'include':_0xf048cd[_0x8a5b('0x18')]?_[_0x8a5b('0x19')](_0xf048cd[_0x8a5b('0x18')],function(_0x2b447c){return{'model':db[_0x2b447c[_0x8a5b('0x1a')]],'as':_0x2b447c['as'],'attributes':_0x2b447c[_0x8a5b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8a5b('0xb')](function(_0x33ffc4){logger[_0x8a5b('0xc')]('ShowSquareOdbc',_0x2ce11f);logger['debug']('ShowSquareOdbc',_0x2ce11f,JSON['stringify'](_0x33ffc4));_0x51136c(_0x33ffc4);})[_0x8a5b('0x13')](function(_0x67b55b){logger['error'](_0x8a5b('0x1b'),_0x67b55b[_0x8a5b('0x11')],_0x2ce11f);_0x3d3e33(_0x533b77[_0x8a5b('0xf')](0x1f4,_0x67b55b[_0x8a5b('0x11')]));});});}; \ No newline at end of file +var _0x3eec=['stringify','error','message','info','result','catch','ShowSquareOdbc','options','where','attributes','include','map','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x57ee58,_0x4b6015){var _0xcfa87d=function(_0x5a9b29){while(--_0x5a9b29){_0x57ee58['push'](_0x57ee58['shift']());}};_0xcfa87d(++_0x4b6015);}(_0x3eec,0x112));var _0xc3ee=function(_0x379981,_0xc96a12){_0x379981=_0x379981-0x0;var _0x17b967=_0x3eec[_0x379981];return _0x17b967;};'use strict';var _=require('lodash');var util=require(_0xc3ee('0x0'));var moment=require(_0xc3ee('0x1'));var BPromise=require(_0xc3ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x3'));var db=require(_0xc3ee('0x4'))['db'];var utils=require(_0xc3ee('0x5'));var logger=require(_0xc3ee('0x6'))('rpc');var config=require(_0xc3ee('0x7'));var jayson=require(_0xc3ee('0x8'));var client=jayson[_0xc3ee('0x9')][_0xc3ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19a16a,_0x15039e,_0x11e5cf){return new BPromise(function(_0x4c0e44,_0x592327){return client[_0xc3ee('0xb')](_0x19a16a,_0x11e5cf)[_0xc3ee('0xc')](function(_0x3e0fa4){logger['info'](_0xc3ee('0xd'),_0x15039e,_0xc3ee('0xe'));logger[_0xc3ee('0xf')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x15039e,'request\x20sent',JSON[_0xc3ee('0x10')](_0x3e0fa4));if(_0x3e0fa4[_0xc3ee('0x11')]){if(_0x3e0fa4['error']['code']===0x1f4){logger[_0xc3ee('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x15039e,_0x3e0fa4[_0xc3ee('0x11')][_0xc3ee('0x12')]);return _0x592327(_0x3e0fa4[_0xc3ee('0x11')][_0xc3ee('0x12')]);}logger[_0xc3ee('0x11')](_0xc3ee('0xd'),_0x15039e,_0x3e0fa4[_0xc3ee('0x11')][_0xc3ee('0x12')]);return _0x4c0e44(_0x3e0fa4[_0xc3ee('0x11')][_0xc3ee('0x12')]);}else{logger[_0xc3ee('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x15039e,_0xc3ee('0xe'));_0x4c0e44(_0x3e0fa4[_0xc3ee('0x14')]['message']);}})[_0xc3ee('0x15')](function(_0x4f3a63){logger[_0xc3ee('0x11')](_0xc3ee('0xd'),_0x15039e,_0x4f3a63);_0x592327(_0x4f3a63);});});}exports[_0xc3ee('0x16')]=function(_0x576bbf){var _0x611061=this;return new Promise(function(_0x442a18,_0x5bd1e0){return db['SquareOdbc']['find']({'raw':_0x576bbf['options']?_0x576bbf[_0xc3ee('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x576bbf[_0xc3ee('0x17')]?_0x576bbf[_0xc3ee('0x17')][_0xc3ee('0x18')]||null:null,'attributes':_0x576bbf[_0xc3ee('0x17')]?_0x576bbf[_0xc3ee('0x17')][_0xc3ee('0x19')]||null:null,'include':_0x576bbf[_0xc3ee('0x17')]?_0x576bbf[_0xc3ee('0x17')][_0xc3ee('0x1a')]?_[_0xc3ee('0x1b')](_0x576bbf['options'][_0xc3ee('0x1a')],function(_0x46aef8){return{'model':db[_0x46aef8[_0xc3ee('0x1c')]],'as':_0x46aef8['as'],'attributes':_0x46aef8[_0xc3ee('0x19')],'include':_0x46aef8[_0xc3ee('0x1a')]?_[_0xc3ee('0x1b')](_0x46aef8['include'],function(_0x4c1fc5){return{'model':db[_0x4c1fc5[_0xc3ee('0x1c')]],'as':_0x4c1fc5['as'],'attributes':_0x4c1fc5[_0xc3ee('0x19')],'include':_0x4c1fc5[_0xc3ee('0x1a')]?_[_0xc3ee('0x1b')](_0x4c1fc5[_0xc3ee('0x1a')],function(_0x52b0a8){return{'model':db[_0x52b0a8[_0xc3ee('0x1c')]],'as':_0x52b0a8['as'],'attributes':_0x52b0a8[_0xc3ee('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc3ee('0xc')](function(_0x102181){logger['info'](_0xc3ee('0x16'),_0x576bbf);logger[_0xc3ee('0xf')](_0xc3ee('0x16'),_0x576bbf,JSON[_0xc3ee('0x10')](_0x102181));_0x442a18(_0x102181);})[_0xc3ee('0x15')](function(_0x391857){logger[_0xc3ee('0x11')](_0xc3ee('0x16'),_0x391857['message'],_0x576bbf);_0x5bd1e0(_0x611061['error'](0x1f4,_0x391857[_0xc3ee('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 47df0e5..ad4b9d1 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 _0x1e24=['getUsers','post','create','/:id/users','addUsers','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x1e24,0x82));var _0x41e2=function(_0x1f6994,_0x2b4985){_0x1f6994=_0x1f6994-0x0;var _0x592e20=_0x1e24[_0x1f6994];return _0x592e20;};'use strict';var multer=require(_0x41e2('0x0'));var util=require(_0x41e2('0x1'));var path=require(_0x41e2('0x2'));var timeout=require(_0x41e2('0x3'));var express=require('express');var router=express[_0x41e2('0x4')]();var fs_extra=require(_0x41e2('0x5'));var auth=require(_0x41e2('0x6'));var interaction=require(_0x41e2('0x7'));var config=require('../../config/environment');var controller=require(_0x41e2('0x8'));router[_0x41e2('0x9')]('/',auth[_0x41e2('0xa')](),controller[_0x41e2('0xb')]);router[_0x41e2('0x9')](_0x41e2('0xc'),auth[_0x41e2('0xa')](),controller[_0x41e2('0xd')]);router[_0x41e2('0x9')]('/:id/users',auth[_0x41e2('0xa')](),controller[_0x41e2('0xe')]);router[_0x41e2('0xf')]('/',auth[_0x41e2('0xa')](),controller[_0x41e2('0x10')]);router[_0x41e2('0xf')](_0x41e2('0x11'),auth[_0x41e2('0xa')](),controller[_0x41e2('0x12')]);router['put'](_0x41e2('0xc'),auth['isAuthenticated'](),controller[_0x41e2('0x13')]);router[_0x41e2('0x14')](_0x41e2('0xc'),auth['isAuthenticated'](),controller[_0x41e2('0x15')]);router['delete'](_0x41e2('0x11'),auth['isAuthenticated'](),controller[_0x41e2('0x16')]);module[_0x41e2('0x17')]=router; \ No newline at end of file +var _0x2ed4=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/users','getUsers','post','create','addUsers','put','/:id','update','delete','removeUsers','exports'];(function(_0x243883,_0x2e220b){var _0x12738d=function(_0x82acd8){while(--_0x82acd8){_0x243883['push'](_0x243883['shift']());}};_0x12738d(++_0x2e220b);}(_0x2ed4,0xe6));var _0x42ed=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x2ed4[_0x277af0];return _0x43bd7c;};'use strict';var multer=require(_0x42ed('0x0'));var util=require(_0x42ed('0x1'));var path=require(_0x42ed('0x2'));var timeout=require(_0x42ed('0x3'));var express=require(_0x42ed('0x4'));var router=express[_0x42ed('0x5')]();var fs_extra=require(_0x42ed('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x42ed('0x7'));var config=require(_0x42ed('0x8'));var controller=require('./squareProject.controller');router['get']('/',auth[_0x42ed('0x9')](),controller['index']);router[_0x42ed('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x42ed('0xb')]);router['get'](_0x42ed('0xc'),auth[_0x42ed('0x9')](),controller[_0x42ed('0xd')]);router[_0x42ed('0xe')]('/',auth[_0x42ed('0x9')](),controller[_0x42ed('0xf')]);router[_0x42ed('0xe')](_0x42ed('0xc'),auth['isAuthenticated'](),controller[_0x42ed('0x10')]);router[_0x42ed('0x11')](_0x42ed('0x12'),auth[_0x42ed('0x9')](),controller[_0x42ed('0x13')]);router[_0x42ed('0x14')](_0x42ed('0x12'),auth['isAuthenticated'](),controller['destroy']);router[_0x42ed('0x14')]('/:id/users',auth[_0x42ed('0x9')](),controller[_0x42ed('0x15')]);module[_0x42ed('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index eacb26b..24e50b3 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 _0xd06f=['exports','STRING','long','getDataValue','preproduction','toString','utf8','BLOB','production','DATE','sequelize'];(function(_0x52b473,_0xcf55d3){var _0x95d38c=function(_0x92b672){while(--_0x92b672){_0x52b473['push'](_0x52b473['shift']());}};_0x95d38c(++_0xcf55d3);}(_0xd06f,0x15f));var _0xfd06=function(_0x101249,_0x53cf00){_0x101249=_0x101249-0x0;var _0x3fb014=_0xd06f[_0x101249];return _0x3fb014;};'use strict';var Sequelize=require(_0xfd06('0x0'));module[_0xfd06('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xfd06('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0xfd06('0x3')),'get':function(){if(this[_0xfd06('0x4')]('preproduction')){return this[_0xfd06('0x4')](_0xfd06('0x5'))[_0xfd06('0x6')](_0xfd06('0x7'));}}},'production':{'type':Sequelize[_0xfd06('0x8')](_0xfd06('0x3')),'get':function(){if(this[_0xfd06('0x4')](_0xfd06('0x9'))){return this[_0xfd06('0x4')](_0xfd06('0x9'))[_0xfd06('0x6')]('utf8');}}},'savedAt':{'type':Sequelize[_0xfd06('0xa')]},'publishedAt':{'type':Sequelize[_0xfd06('0xa')]}}; \ No newline at end of file +var _0xcf96=['toString','utf8','BLOB','production','DATE','sequelize','STRING','name','TEXT','long','getDataValue','preproduction'];(function(_0x41d02a,_0x355e19){var _0x4c3983=function(_0x4802a7){while(--_0x4802a7){_0x41d02a['push'](_0x41d02a['shift']());}};_0x4c3983(++_0x355e19);}(_0xcf96,0xf5));var _0x6cf9=function(_0x1258ac,_0x9f8430){_0x1258ac=_0x1258ac-0x0;var _0x5d71dc=_0xcf96[_0x1258ac];return _0x5d71dc;};'use strict';var Sequelize=require(_0x6cf9('0x0'));module['exports']={'name':{'type':Sequelize[_0x6cf9('0x1')],'unique':_0x6cf9('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x6cf9('0x1')]},'notes':{'type':Sequelize[_0x6cf9('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0x6cf9('0x4')),'get':function(){if(this[_0x6cf9('0x5')](_0x6cf9('0x6'))){return this[_0x6cf9('0x5')]('preproduction')[_0x6cf9('0x7')](_0x6cf9('0x8'));}}},'production':{'type':Sequelize[_0x6cf9('0x9')](_0x6cf9('0x4')),'get':function(){if(this[_0x6cf9('0x5')](_0x6cf9('0xa'))){return this[_0x6cf9('0x5')](_0x6cf9('0xa'))[_0x6cf9('0x7')]('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x6cf9('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ed596f2..8114832 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 _0xd943=['catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','pick','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','end','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','get','UserProfileResource','publish','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys'];(function(_0x2ff481,_0x3a653c){var _0x3844ec=function(_0xd27751){while(--_0xd27751){_0x2ff481['push'](_0x2ff481['shift']());}};_0x3844ec(++_0x3a653c);}(_0xd943,0x15d));var _0x3d94=function(_0x5319c3,_0x3fc19f){_0x5319c3=_0x5319c3-0x0;var _0x5c2905=_0xd943[_0x5319c3];return _0x5c2905;};'use strict';var _=require(_0x3d94('0x0'));var Redis=require(_0x3d94('0x1'));var qs=require(_0x3d94('0x2'));var logger=require(_0x3d94('0x3'))('api');var config=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];config[_0x3d94('0x6')]=_[_0x3d94('0x7')](config[_0x3d94('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d94('0x6')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x4d29e7,_0x20f4d1){_0x20f4d1=_0x20f4d1||0xcc;return function(_0x35d36a){if(_0x35d36a){return _0x4d29e7['sendStatus'](_0x20f4d1);}return _0x4d29e7['status'](_0x20f4d1)[_0x3d94('0x8')]();};}function respondWithResult(_0x27e381,_0x1cc58c){_0x1cc58c=_0x1cc58c||0xc8;return function(_0x5908a7){if(_0x5908a7){return _0x27e381[_0x3d94('0x9')](_0x1cc58c)['json'](_0x5908a7);}};}function respondWithFilteredResult(_0x39e2fa,_0x301536){return function(_0x5f5041){if(_0x5f5041){var _0x1897de=typeof _0x301536[_0x3d94('0xa')]===_0x3d94('0xb')&&typeof _0x301536[_0x3d94('0xc')]===_0x3d94('0xb');var _0x548b89=_0x5f5041[_0x3d94('0xd')];var _0x2e9af0=_0x1897de?0x0:_0x301536[_0x3d94('0xa')];var _0x4c167c=_0x1897de?_0x5f5041[_0x3d94('0xd')]:_0x301536[_0x3d94('0xa')]+_0x301536[_0x3d94('0xc')];var _0x5d9366;if(_0x4c167c>=_0x548b89){_0x4c167c=_0x548b89;_0x5d9366=0xc8;}else{_0x5d9366=0xce;}_0x39e2fa[_0x3d94('0x9')](_0x5d9366);return _0x39e2fa[_0x3d94('0xe')](_0x3d94('0xf'),_0x2e9af0+'-'+_0x4c167c+'/'+_0x548b89)[_0x3d94('0x10')](_0x5f5041);}return null;};}function saveUpdates(_0xaf939a){return function(_0xd8efaa){if(_0xd8efaa){return _0xd8efaa[_0x3d94('0x11')](_0xaf939a)[_0x3d94('0x12')](function(_0x540658){return _0x540658;});}return null;};}function removeEntity(_0x22676a){return function(_0x1a9315){if(_0x1a9315){return _0x1a9315[_0x3d94('0x13')]()[_0x3d94('0x12')](function(){var _0x4afc92=_0x1a9315[_0x3d94('0x14')]({'plain':!![]});var _0xef8b3='SquareProjects';return db[_0x3d94('0x15')]['destroy']({'where':{'type':_0xef8b3,'resourceId':_0x4afc92['id']}})[_0x3d94('0x12')](function(){return _0x1a9315;});})[_0x3d94('0x12')](function(){var _0x16a6d0=new Redis(config[_0x3d94('0x6')]);_0x16a6d0[_0x3d94('0x16')]('agi',JSON['stringify']({'id':_0x1a9315['id'],'deleted':!![]}));})[_0x3d94('0x12')](function(){_0x22676a[_0x3d94('0x9')](0xcc)[_0x3d94('0x8')]();});}};}function handleEntityNotFound(_0x4edee4){return function(_0x30af25){if(!_0x30af25){_0x4edee4[_0x3d94('0x17')](0x194);}return _0x30af25;};}function handleError(_0x123adc,_0x384f76){_0x384f76=_0x384f76||0x1f4;return function(_0x395133){logger[_0x3d94('0x18')](_0x395133[_0x3d94('0x19')]);if(_0x395133[_0x3d94('0x1a')]){delete _0x395133[_0x3d94('0x1a')];}_0x123adc[_0x3d94('0x9')](_0x384f76)[_0x3d94('0x1b')](_0x395133);};}exports[_0x3d94('0x1c')]=function(_0x292976,_0x3496c3){var _0x2945d2={},_0x5b3b31={},_0x123183={'count':0x0,'rows':[]};var _0x558fd2=_[_0x3d94('0x1d')](db[_0x3d94('0x1e')][_0x3d94('0x1f')],function(_0x439173){return{'name':_0x439173[_0x3d94('0x20')],'type':_0x439173[_0x3d94('0x21')][_0x3d94('0x22')]};});_0x5b3b31['model']=_['map'](_0x558fd2,_0x3d94('0x1a'));_0x5b3b31['query']=_['keys'](_0x292976[_0x3d94('0x23')]);_0x5b3b31['filters']=_[_0x3d94('0x24')](_0x5b3b31[_0x3d94('0x25')],_0x5b3b31[_0x3d94('0x23')]);_0x2945d2['attributes']=_[_0x3d94('0x24')](_0x5b3b31['model'],qs[_0x3d94('0x26')](_0x292976['query'][_0x3d94('0x26')]));_0x2945d2[_0x3d94('0x27')]=_0x2945d2[_0x3d94('0x27')][_0x3d94('0x28')]?_0x2945d2['attributes']:_0x5b3b31[_0x3d94('0x25')];if(!_0x292976['query'][_0x3d94('0x29')](_0x3d94('0x2a'))){_0x2945d2['limit']=qs['limit'](_0x292976[_0x3d94('0x23')][_0x3d94('0xc')]);_0x2945d2[_0x3d94('0xa')]=qs['offset'](_0x292976[_0x3d94('0x23')][_0x3d94('0xa')]);}_0x2945d2['order']=qs[_0x3d94('0x2b')](_0x292976[_0x3d94('0x23')][_0x3d94('0x2b')]);_0x2945d2[_0x3d94('0x2c')]=qs[_0x3d94('0x2d')](_['pick'](_0x292976[_0x3d94('0x23')],_0x5b3b31[_0x3d94('0x2d')]),_0x558fd2);if(_0x292976[_0x3d94('0x23')][_0x3d94('0x2e')]){_0x2945d2[_0x3d94('0x2c')]=_[_0x3d94('0x2f')](_0x2945d2['where'],{'$or':_['map'](_0x558fd2,function(_0xfe58eb){if(_0xfe58eb[_0x3d94('0x21')]!==_0x3d94('0x30')){var _0x438ba3={};_0x438ba3[_0xfe58eb[_0x3d94('0x1a')]]={'$like':'%'+_0x292976[_0x3d94('0x23')][_0x3d94('0x2e')]+'%'};return _0x438ba3;}})});}_0x2945d2=_[_0x3d94('0x2f')]({},_0x2945d2,_0x292976[_0x3d94('0x31')]);var _0x2235f9={'where':_0x2945d2['where']};return db[_0x3d94('0x1e')][_0x3d94('0xd')](_0x2235f9)[_0x3d94('0x12')](function(_0xcc289a){_0x123183['count']=_0xcc289a;if(_0x292976[_0x3d94('0x23')][_0x3d94('0x32')]){_0x2945d2[_0x3d94('0x33')]=[{'all':!![]}];}return db[_0x3d94('0x1e')][_0x3d94('0x34')](_0x2945d2);})['then'](function(_0x217e5e){_0x123183[_0x3d94('0x35')]=_0x217e5e;return _0x123183;})[_0x3d94('0x12')](respondWithFilteredResult(_0x3496c3,_0x2945d2))['catch'](handleError(_0x3496c3,null));};exports['show']=function(_0x4d8a8f,_0x47905e){var _0x3b3550={'raw':![],'where':{'id':_0x4d8a8f[_0x3d94('0x36')]['id']}},_0x22f52c={};_0x22f52c[_0x3d94('0x25')]=_[_0x3d94('0x37')](db[_0x3d94('0x1e')][_0x3d94('0x1f')]);_0x22f52c['query']=_['keys'](_0x4d8a8f[_0x3d94('0x23')]);_0x22f52c[_0x3d94('0x2d')]=_['intersection'](_0x22f52c[_0x3d94('0x25')],_0x22f52c['query']);_0x3b3550[_0x3d94('0x27')]=_[_0x3d94('0x24')](_0x22f52c[_0x3d94('0x25')],qs[_0x3d94('0x26')](_0x4d8a8f[_0x3d94('0x23')]['fields']));_0x3b3550[_0x3d94('0x27')]=_0x3b3550[_0x3d94('0x27')][_0x3d94('0x28')]?_0x3b3550['attributes']:_0x22f52c[_0x3d94('0x25')];if(_0x4d8a8f['query']['includeAll']){_0x3b3550[_0x3d94('0x33')]=[{'all':!![]}];}_0x3b3550=_[_0x3d94('0x2f')]({},_0x3b3550,_0x4d8a8f[_0x3d94('0x31')]);return db[_0x3d94('0x1e')]['find'](_0x3b3550)[_0x3d94('0x12')](handleEntityNotFound(_0x47905e,null))['then'](respondWithResult(_0x47905e,null))[_0x3d94('0x38')](handleError(_0x47905e,null));};exports[_0x3d94('0x39')]=function(_0x35c911,_0x15c8e7){return db[_0x3d94('0x1e')][_0x3d94('0x39')](_0x35c911[_0x3d94('0x3a')],{})['then'](function(_0x10a377){var _0x19dabb=_0x35c911['user']['get']({'plain':!![]});if(!_0x19dabb)throw new Error(_0x3d94('0x3b'));if(_0x19dabb[_0x3d94('0x3c')]==='user'){var _0x3c8571=_0x10a377[_0x3d94('0x14')]({'plain':!![]});var _0x16d505=_0x3d94('0x3d');return db[_0x3d94('0x3e')][_0x3d94('0x3f')]({'where':{'name':_0x16d505,'userProfileId':_0x19dabb[_0x3d94('0x40')]},'raw':!![]})[_0x3d94('0x12')](function(_0x60279f){if(_0x60279f&&_0x60279f[_0x3d94('0x41')]===0x0){return db[_0x3d94('0x15')][_0x3d94('0x39')]({'name':_0x3c8571[_0x3d94('0x1a')],'resourceId':_0x3c8571['id'],'type':_0x60279f[_0x3d94('0x1a')],'sectionId':_0x60279f['id']},{})[_0x3d94('0x12')](function(){return _0x10a377;});}else{return _0x10a377;}})['catch'](function(_0x44df82){logger[_0x3d94('0x18')](_0x3d94('0x42'),_0x44df82);throw _0x44df82;});}return _0x10a377;})[_0x3d94('0x12')](respondWithResult(_0x15c8e7,0xc9))[_0x3d94('0x38')](handleError(_0x15c8e7,null));};exports[_0x3d94('0x11')]=function(_0x129783,_0x33db0a){if(_0x129783[_0x3d94('0x3a')]['id']){delete _0x129783['body']['id'];}return db[_0x3d94('0x1e')]['find']({'where':{'id':_0x129783[_0x3d94('0x36')]['id']}})[_0x3d94('0x12')](handleEntityNotFound(_0x33db0a,null))['then'](saveUpdates(_0x129783[_0x3d94('0x3a')],null))['then'](function(_0x567751){if(!_0x567751)return;var _0x335247=_0x567751['get']({'plain':!![]});return _0x335247;})[_0x3d94('0x12')](function(_0x132e0b){var _0x5b6061=new Redis(config[_0x3d94('0x6')]);_0x5b6061['publish']('agi',JSON[_0x3d94('0x43')](_[_0x3d94('0x44')](_0x132e0b,['id',_0x3d94('0x1a'),_0x3d94('0x45')])));return _0x132e0b;})[_0x3d94('0x12')](respondWithResult(_0x33db0a,null))[_0x3d94('0x38')](handleError(_0x33db0a,null));};exports[_0x3d94('0x13')]=function(_0x2b1168,_0xae892){return db['SquareProject'][_0x3d94('0x3f')]({'where':{'id':_0x2b1168[_0x3d94('0x36')]['id']}})[_0x3d94('0x12')](handleEntityNotFound(_0xae892,null))[_0x3d94('0x12')](removeEntity(_0xae892,null))[_0x3d94('0x38')](handleError(_0xae892,null));};exports[_0x3d94('0x46')]=function(_0x39e9db,_0x126894){return db[_0x3d94('0x1e')][_0x3d94('0x3f')]({'where':{'id':_0x39e9db[_0x3d94('0x36')]['id']}})['then'](handleEntityNotFound(_0x126894,null))[_0x3d94('0x12')](function(_0x55580d){if(_0x55580d){return _0x55580d[_0x3d94('0x46')](_0x39e9db[_0x3d94('0x3a')][_0x3d94('0x47')],_[_0x3d94('0x48')](_0x39e9db[_0x3d94('0x3a')],[_0x3d94('0x47'),'id'])||{});}})[_0x3d94('0x12')](respondWithResult(_0x126894,null))[_0x3d94('0x38')](handleError(_0x126894,null));};exports[_0x3d94('0x49')]=function(_0x5da38c,_0x519ada){return db[_0x3d94('0x1e')]['find']({'where':{'id':_0x5da38c[_0x3d94('0x36')]['id']}})[_0x3d94('0x12')](handleEntityNotFound(_0x519ada,null))['then'](function(_0x211f0e){if(_0x211f0e){return _0x211f0e[_0x3d94('0x49')](_0x5da38c[_0x3d94('0x23')][_0x3d94('0x47')])[_0x3d94('0x12')](function(){if(_[_0x3d94('0x4a')](_0x5da38c[_0x3d94('0x23')]['ids'])){for(var _0x22dbf9=0x0;_0x22dbf9<_0x5da38c[_0x3d94('0x23')][_0x3d94('0x47')]['length'];_0x22dbf9+=0x1){socket[_0x3d94('0x4b')](_0x3d94('0x4c'),{'UserId':Number(_0x5da38c[_0x3d94('0x23')][_0x3d94('0x47')][_0x22dbf9]),'SquareProjectId':Number(_0x5da38c['params']['id'])});}}else{socket['emit'](_0x3d94('0x4c'),{'UserId':Number(_0x5da38c[_0x3d94('0x23')][_0x3d94('0x47')]),'SquareProjectId':Number(_0x5da38c[_0x3d94('0x36')]['id'])});}});}})['then'](respondWithStatusCode(_0x519ada,null))[_0x3d94('0x38')](handleError(_0x519ada,null));};exports[_0x3d94('0x4d')]=function(_0x49bfb0,_0x5ba865){var _0x250c87={};var _0x336e36={};var _0x4eee2b;var _0x3135f3;return db[_0x3d94('0x1e')][_0x3d94('0x4e')]({'where':{'id':_0x49bfb0['params']['id']}})[_0x3d94('0x12')](handleEntityNotFound(_0x5ba865,null))[_0x3d94('0x12')](function(_0x5c7aac){if(_0x5c7aac){_0x4eee2b=_0x5c7aac;_0x336e36['model']=_['keys'](db[_0x3d94('0x4f')][_0x3d94('0x1f')]);_0x336e36[_0x3d94('0x23')]=_[_0x3d94('0x37')](_0x49bfb0[_0x3d94('0x23')]);_0x336e36['filters']=_[_0x3d94('0x24')](_0x336e36[_0x3d94('0x25')],_0x336e36[_0x3d94('0x23')]);_0x250c87[_0x3d94('0x27')]=_[_0x3d94('0x24')](_0x336e36[_0x3d94('0x25')],qs['fields'](_0x49bfb0[_0x3d94('0x23')]['fields']));_0x250c87[_0x3d94('0x27')]=_0x250c87[_0x3d94('0x27')][_0x3d94('0x28')]?_0x250c87[_0x3d94('0x27')]:_0x336e36[_0x3d94('0x25')];_0x250c87[_0x3d94('0x50')]=qs['sort'](_0x49bfb0['query'][_0x3d94('0x2b')]);_0x250c87['where']=qs['filters'](_['pick'](_0x49bfb0[_0x3d94('0x23')],_0x336e36[_0x3d94('0x2d')]));if(_0x49bfb0[_0x3d94('0x23')][_0x3d94('0x2e')]){_0x250c87[_0x3d94('0x2c')]=_[_0x3d94('0x2f')](_0x250c87[_0x3d94('0x2c')],{'$or':_[_0x3d94('0x1d')](_0x250c87['attributes'],function(_0x22917e){var _0x5e55a4={};_0x5e55a4[_0x22917e]={'$like':'%'+_0x49bfb0[_0x3d94('0x23')][_0x3d94('0x2e')]+'%'};return _0x5e55a4;})});}_0x250c87=_[_0x3d94('0x2f')]({},_0x250c87,_0x49bfb0['options']);return _0x4eee2b['getUsers'](_0x250c87);}})['then'](function(_0x426ef5){if(_0x426ef5){_0x3135f3=_0x426ef5[_0x3d94('0x28')];if(!_0x49bfb0[_0x3d94('0x23')][_0x3d94('0x29')](_0x3d94('0x2a'))){_0x250c87['limit']=qs['limit'](_0x49bfb0[_0x3d94('0x23')][_0x3d94('0xc')]);_0x250c87[_0x3d94('0xa')]=qs['offset'](_0x49bfb0[_0x3d94('0x23')]['offset']);}return _0x4eee2b[_0x3d94('0x4d')](_0x250c87);}})[_0x3d94('0x12')](function(_0x15adf7){if(_0x15adf7){return _0x15adf7?{'count':_0x3135f3,'rows':_0x15adf7}:null;}})[_0x3d94('0x12')](respondWithResult(_0x5ba865,null))[_0x3d94('0x38')](handleError(_0x5ba865,null));}; \ No newline at end of file +var _0x5496=['end','status','json','offset','undefined','limit','count','update','then','SquareProjects','UserProfileResource','destroy','agi','stringify','error','stack','name','index','map','SquareProject','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','filter','options','includeAll','include','rows','catch','keys','find','create','body','user','role','get','UserProfileSection','userProfileId','autoAssociation','params','publish','pick','production','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','findOne','User','order','getUsers','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','./squareProject.socket','register','sendStatus'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x5496,0x175));var _0x6549=function(_0x15ba60,_0x295d5a){_0x15ba60=_0x15ba60-0x0;var _0x39c0f7=_0x5496[_0x15ba60];return _0x39c0f7;};'use strict';var _=require(_0x6549('0x0'));var Redis=require(_0x6549('0x1'));var qs=require(_0x6549('0x2'));var logger=require(_0x6549('0x3'))(_0x6549('0x4'));var config=require('../../config/environment');var db=require(_0x6549('0x5'))['db'];config['redis']=_[_0x6549('0x6')](config[_0x6549('0x7')],{'host':_0x6549('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6549('0x9'))[_0x6549('0xa')](socket);function respondWithStatusCode(_0x4fcffd,_0x1ca8fc){_0x1ca8fc=_0x1ca8fc||0xcc;return function(_0x3442c3){if(_0x3442c3){return _0x4fcffd[_0x6549('0xb')](_0x1ca8fc);}return _0x4fcffd['status'](_0x1ca8fc)[_0x6549('0xc')]();};}function respondWithResult(_0x35d008,_0x2ecce2){_0x2ecce2=_0x2ecce2||0xc8;return function(_0x135c2c){if(_0x135c2c){return _0x35d008[_0x6549('0xd')](_0x2ecce2)[_0x6549('0xe')](_0x135c2c);}};}function respondWithFilteredResult(_0x50fa35,_0x551133){return function(_0x1e27d4){if(_0x1e27d4){var _0xac828c=typeof _0x551133[_0x6549('0xf')]===_0x6549('0x10')&&typeof _0x551133[_0x6549('0x11')]==='undefined';var _0x4dfb06=_0x1e27d4[_0x6549('0x12')];var _0x39d78c=_0xac828c?0x0:_0x551133['offset'];var _0x200ff1=_0xac828c?_0x1e27d4[_0x6549('0x12')]:_0x551133[_0x6549('0xf')]+_0x551133[_0x6549('0x11')];var _0xc0e859;if(_0x200ff1>=_0x4dfb06){_0x200ff1=_0x4dfb06;_0xc0e859=0xc8;}else{_0xc0e859=0xce;}_0x50fa35[_0x6549('0xd')](_0xc0e859);return _0x50fa35['set']('Content-Range',_0x39d78c+'-'+_0x200ff1+'/'+_0x4dfb06)[_0x6549('0xe')](_0x1e27d4);}return null;};}function saveUpdates(_0x25da29){return function(_0x47a81a){if(_0x47a81a){return _0x47a81a[_0x6549('0x13')](_0x25da29)[_0x6549('0x14')](function(_0x4608fb){return _0x4608fb;});}return null;};}function removeEntity(_0x387e60){return function(_0xffc8b9){if(_0xffc8b9){return _0xffc8b9['destroy']()['then'](function(){var _0x26a212=_0xffc8b9['get']({'plain':!![]});var _0x56c15b=_0x6549('0x15');return db[_0x6549('0x16')][_0x6549('0x17')]({'where':{'type':_0x56c15b,'resourceId':_0x26a212['id']}})[_0x6549('0x14')](function(){return _0xffc8b9;});})[_0x6549('0x14')](function(){var _0x5ce3aa=new Redis(config[_0x6549('0x7')]);_0x5ce3aa['publish'](_0x6549('0x18'),JSON[_0x6549('0x19')]({'id':_0xffc8b9['id'],'deleted':!![]}));})[_0x6549('0x14')](function(){_0x387e60[_0x6549('0xd')](0xcc)[_0x6549('0xc')]();});}};}function handleEntityNotFound(_0x12d547){return function(_0x427b47){if(!_0x427b47){_0x12d547[_0x6549('0xb')](0x194);}return _0x427b47;};}function handleError(_0x2be467,_0x6ae00c){_0x6ae00c=_0x6ae00c||0x1f4;return function(_0x40d3f9){logger[_0x6549('0x1a')](_0x40d3f9[_0x6549('0x1b')]);if(_0x40d3f9['name']){delete _0x40d3f9[_0x6549('0x1c')];}_0x2be467[_0x6549('0xd')](_0x6ae00c)['send'](_0x40d3f9);};}exports[_0x6549('0x1d')]=function(_0x29f89e,_0x3768cb){var _0x583c7d={},_0x31a95={},_0xfb51a1={'count':0x0,'rows':[]};var _0x14de1f=_[_0x6549('0x1e')](db[_0x6549('0x1f')][_0x6549('0x20')],function(_0x2f58f7){return{'name':_0x2f58f7[_0x6549('0x21')],'type':_0x2f58f7['type'][_0x6549('0x22')]};});_0x31a95[_0x6549('0x23')]=_[_0x6549('0x1e')](_0x14de1f,'name');_0x31a95[_0x6549('0x24')]=_['keys'](_0x29f89e['query']);_0x31a95['filters']=_[_0x6549('0x25')](_0x31a95[_0x6549('0x23')],_0x31a95['query']);_0x583c7d[_0x6549('0x26')]=_[_0x6549('0x25')](_0x31a95[_0x6549('0x23')],qs[_0x6549('0x27')](_0x29f89e[_0x6549('0x24')][_0x6549('0x27')]));_0x583c7d[_0x6549('0x26')]=_0x583c7d['attributes'][_0x6549('0x28')]?_0x583c7d[_0x6549('0x26')]:_0x31a95[_0x6549('0x23')];if(!_0x29f89e[_0x6549('0x24')][_0x6549('0x29')](_0x6549('0x2a'))){_0x583c7d['limit']=qs[_0x6549('0x11')](_0x29f89e['query'][_0x6549('0x11')]);_0x583c7d['offset']=qs[_0x6549('0xf')](_0x29f89e[_0x6549('0x24')][_0x6549('0xf')]);}_0x583c7d['order']=qs[_0x6549('0x2b')](_0x29f89e[_0x6549('0x24')][_0x6549('0x2b')]);_0x583c7d[_0x6549('0x2c')]=qs['filters'](_['pick'](_0x29f89e['query'],_0x31a95[_0x6549('0x2d')]),_0x14de1f);if(_0x29f89e[_0x6549('0x24')]['filter']){_0x583c7d[_0x6549('0x2c')]=_[_0x6549('0x2e')](_0x583c7d[_0x6549('0x2c')],{'$or':_[_0x6549('0x1e')](_0x14de1f,function(_0x3741f5){if(_0x3741f5['type']!=='VIRTUAL'){var _0x1fcacf={};_0x1fcacf[_0x3741f5[_0x6549('0x1c')]]={'$like':'%'+_0x29f89e[_0x6549('0x24')][_0x6549('0x2f')]+'%'};return _0x1fcacf;}})});}_0x583c7d=_[_0x6549('0x2e')]({},_0x583c7d,_0x29f89e[_0x6549('0x30')]);var _0x1c6b46={'where':_0x583c7d[_0x6549('0x2c')]};return db[_0x6549('0x1f')][_0x6549('0x12')](_0x1c6b46)['then'](function(_0x3ecf9a){_0xfb51a1[_0x6549('0x12')]=_0x3ecf9a;if(_0x29f89e[_0x6549('0x24')][_0x6549('0x31')]){_0x583c7d[_0x6549('0x32')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x583c7d);})['then'](function(_0x22b919){_0xfb51a1[_0x6549('0x33')]=_0x22b919;return _0xfb51a1;})[_0x6549('0x14')](respondWithFilteredResult(_0x3768cb,_0x583c7d))[_0x6549('0x34')](handleError(_0x3768cb,null));};exports['show']=function(_0x56ce9f,_0x438f0b){var _0x1e719a={'raw':![],'where':{'id':_0x56ce9f['params']['id']}},_0x252d20={};_0x252d20[_0x6549('0x23')]=_['keys'](db[_0x6549('0x1f')][_0x6549('0x20')]);_0x252d20[_0x6549('0x24')]=_[_0x6549('0x35')](_0x56ce9f[_0x6549('0x24')]);_0x252d20[_0x6549('0x2d')]=_[_0x6549('0x25')](_0x252d20['model'],_0x252d20[_0x6549('0x24')]);_0x1e719a[_0x6549('0x26')]=_[_0x6549('0x25')](_0x252d20[_0x6549('0x23')],qs[_0x6549('0x27')](_0x56ce9f[_0x6549('0x24')][_0x6549('0x27')]));_0x1e719a[_0x6549('0x26')]=_0x1e719a[_0x6549('0x26')][_0x6549('0x28')]?_0x1e719a[_0x6549('0x26')]:_0x252d20[_0x6549('0x23')];if(_0x56ce9f[_0x6549('0x24')][_0x6549('0x31')]){_0x1e719a[_0x6549('0x32')]=[{'all':!![]}];}_0x1e719a=_[_0x6549('0x2e')]({},_0x1e719a,_0x56ce9f['options']);return db[_0x6549('0x1f')][_0x6549('0x36')](_0x1e719a)[_0x6549('0x14')](handleEntityNotFound(_0x438f0b,null))[_0x6549('0x14')](respondWithResult(_0x438f0b,null))['catch'](handleError(_0x438f0b,null));};exports[_0x6549('0x37')]=function(_0x483727,_0x14c90a){return db[_0x6549('0x1f')]['create'](_0x483727[_0x6549('0x38')],{})[_0x6549('0x14')](function(_0x44e608){var _0x18a751=_0x483727[_0x6549('0x39')]['get']({'plain':!![]});if(!_0x18a751)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18a751[_0x6549('0x3a')]===_0x6549('0x39')){var _0x41d675=_0x44e608[_0x6549('0x3b')]({'plain':!![]});var _0x1e562b='SquareProjects';return db[_0x6549('0x3c')][_0x6549('0x36')]({'where':{'name':_0x1e562b,'userProfileId':_0x18a751[_0x6549('0x3d')]},'raw':!![]})[_0x6549('0x14')](function(_0xa4c650){if(_0xa4c650&&_0xa4c650[_0x6549('0x3e')]===0x0){return db[_0x6549('0x16')][_0x6549('0x37')]({'name':_0x41d675['name'],'resourceId':_0x41d675['id'],'type':_0xa4c650[_0x6549('0x1c')],'sectionId':_0xa4c650['id']},{})['then'](function(){return _0x44e608;});}else{return _0x44e608;}})[_0x6549('0x34')](function(_0x1e09e1){logger[_0x6549('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e09e1);throw _0x1e09e1;});}return _0x44e608;})[_0x6549('0x14')](respondWithResult(_0x14c90a,0xc9))[_0x6549('0x34')](handleError(_0x14c90a,null));};exports[_0x6549('0x13')]=function(_0x5300c8,_0x19ac50){if(_0x5300c8[_0x6549('0x38')]['id']){delete _0x5300c8[_0x6549('0x38')]['id'];}return db[_0x6549('0x1f')][_0x6549('0x36')]({'where':{'id':_0x5300c8[_0x6549('0x3f')]['id']}})['then'](handleEntityNotFound(_0x19ac50,null))[_0x6549('0x14')](saveUpdates(_0x5300c8['body'],null))[_0x6549('0x14')](function(_0x9bad8f){if(!_0x9bad8f)return;var _0x1640aa=_0x9bad8f[_0x6549('0x3b')]({'plain':!![]});return _0x1640aa;})[_0x6549('0x14')](function(_0x21d2fb){var _0x292b52=new Redis(config[_0x6549('0x7')]);_0x292b52[_0x6549('0x40')](_0x6549('0x18'),JSON[_0x6549('0x19')](_[_0x6549('0x41')](_0x21d2fb,['id','name',_0x6549('0x42')])));return _0x21d2fb;})[_0x6549('0x14')](respondWithResult(_0x19ac50,null))[_0x6549('0x34')](handleError(_0x19ac50,null));};exports[_0x6549('0x17')]=function(_0x260097,_0x1ffa23){return db[_0x6549('0x1f')][_0x6549('0x36')]({'where':{'id':_0x260097['params']['id']}})[_0x6549('0x14')](handleEntityNotFound(_0x1ffa23,null))[_0x6549('0x14')](removeEntity(_0x1ffa23,null))[_0x6549('0x34')](handleError(_0x1ffa23,null));};exports[_0x6549('0x43')]=function(_0x2b0ba8,_0x8bbdf4){return db[_0x6549('0x1f')][_0x6549('0x36')]({'where':{'id':_0x2b0ba8['params']['id']}})[_0x6549('0x14')](handleEntityNotFound(_0x8bbdf4,null))[_0x6549('0x14')](function(_0x32b336){if(_0x32b336){return _0x32b336[_0x6549('0x43')](_0x2b0ba8[_0x6549('0x38')][_0x6549('0x44')],_['omit'](_0x2b0ba8[_0x6549('0x38')],[_0x6549('0x44'),'id'])||{});}})['then'](respondWithResult(_0x8bbdf4,null))[_0x6549('0x34')](handleError(_0x8bbdf4,null));};exports[_0x6549('0x45')]=function(_0x2efad1,_0x557b52){return db[_0x6549('0x1f')][_0x6549('0x36')]({'where':{'id':_0x2efad1['params']['id']}})[_0x6549('0x14')](handleEntityNotFound(_0x557b52,null))['then'](function(_0x3dc12c){if(_0x3dc12c){return _0x3dc12c['removeUsers'](_0x2efad1[_0x6549('0x24')][_0x6549('0x44')])[_0x6549('0x14')](function(){if(_[_0x6549('0x46')](_0x2efad1[_0x6549('0x24')][_0x6549('0x44')])){for(var _0x3b01d9=0x0;_0x3b01d9<_0x2efad1[_0x6549('0x24')][_0x6549('0x44')][_0x6549('0x28')];_0x3b01d9+=0x1){socket[_0x6549('0x47')](_0x6549('0x48'),{'UserId':Number(_0x2efad1[_0x6549('0x24')][_0x6549('0x44')][_0x3b01d9]),'SquareProjectId':Number(_0x2efad1['params']['id'])});}}else{socket[_0x6549('0x47')](_0x6549('0x48'),{'UserId':Number(_0x2efad1['query'][_0x6549('0x44')]),'SquareProjectId':Number(_0x2efad1[_0x6549('0x3f')]['id'])});}});}})[_0x6549('0x14')](respondWithStatusCode(_0x557b52,null))[_0x6549('0x34')](handleError(_0x557b52,null));};exports['getUsers']=function(_0x6ff64d,_0x28ff2e){var _0x19c9bd={};var _0x20e39b={};var _0x53d016;var _0x395039;return db['SquareProject'][_0x6549('0x49')]({'where':{'id':_0x6ff64d[_0x6549('0x3f')]['id']}})[_0x6549('0x14')](handleEntityNotFound(_0x28ff2e,null))[_0x6549('0x14')](function(_0x179dd7){if(_0x179dd7){_0x53d016=_0x179dd7;_0x20e39b[_0x6549('0x23')]=_[_0x6549('0x35')](db[_0x6549('0x4a')][_0x6549('0x20')]);_0x20e39b[_0x6549('0x24')]=_['keys'](_0x6ff64d[_0x6549('0x24')]);_0x20e39b[_0x6549('0x2d')]=_[_0x6549('0x25')](_0x20e39b[_0x6549('0x23')],_0x20e39b[_0x6549('0x24')]);_0x19c9bd[_0x6549('0x26')]=_['intersection'](_0x20e39b['model'],qs[_0x6549('0x27')](_0x6ff64d[_0x6549('0x24')][_0x6549('0x27')]));_0x19c9bd['attributes']=_0x19c9bd[_0x6549('0x26')][_0x6549('0x28')]?_0x19c9bd['attributes']:_0x20e39b[_0x6549('0x23')];_0x19c9bd[_0x6549('0x4b')]=qs[_0x6549('0x2b')](_0x6ff64d[_0x6549('0x24')][_0x6549('0x2b')]);_0x19c9bd[_0x6549('0x2c')]=qs[_0x6549('0x2d')](_[_0x6549('0x41')](_0x6ff64d['query'],_0x20e39b[_0x6549('0x2d')]));if(_0x6ff64d['query'][_0x6549('0x2f')]){_0x19c9bd[_0x6549('0x2c')]=_['merge'](_0x19c9bd[_0x6549('0x2c')],{'$or':_[_0x6549('0x1e')](_0x19c9bd[_0x6549('0x26')],function(_0x5f3873){var _0xaf4ef3={};_0xaf4ef3[_0x5f3873]={'$like':'%'+_0x6ff64d[_0x6549('0x24')][_0x6549('0x2f')]+'%'};return _0xaf4ef3;})});}_0x19c9bd=_[_0x6549('0x2e')]({},_0x19c9bd,_0x6ff64d[_0x6549('0x30')]);return _0x53d016[_0x6549('0x4c')](_0x19c9bd);}})['then'](function(_0x384237){if(_0x384237){_0x395039=_0x384237[_0x6549('0x28')];if(!_0x6ff64d[_0x6549('0x24')]['hasOwnProperty']('nolimit')){_0x19c9bd['limit']=qs[_0x6549('0x11')](_0x6ff64d[_0x6549('0x24')][_0x6549('0x11')]);_0x19c9bd['offset']=qs['offset'](_0x6ff64d[_0x6549('0x24')]['offset']);}return _0x53d016[_0x6549('0x4c')](_0x19c9bd);}})[_0x6549('0x14')](function(_0xcba9e1){if(_0xcba9e1){return _0xcba9e1?{'count':_0x395039,'rows':_0xcba9e1}:null;}})[_0x6549('0x14')](respondWithResult(_0x28ff2e,null))[_0x6549('0x34')](handleError(_0x28ff2e,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 8853393..547ad50 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 _0x102c=['SquareProject','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x31080a,_0x55b5cd){var _0x58d2fc=function(_0x446558){while(--_0x446558){_0x31080a['push'](_0x31080a['shift']());}};_0x58d2fc(++_0x55b5cd);}(_0x102c,0x7d));var _0xc102=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x102c[_0x2576d7];return _0x16a08c;};'use strict';var EventEmitter=require(_0xc102('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xc102('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xc102('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc102('0x3'),'afterDestroy':_0xc102('0x4')};function emitEvent(_0x5cf6ec){return function(_0x28de3a,_0x143c4e,_0x520b13){SquareProjectEvents[_0xc102('0x5')](_0x5cf6ec+':'+_0x28de3a['id'],_0x28de3a);SquareProjectEvents[_0xc102('0x5')](_0x5cf6ec,_0x28de3a);_0x520b13(null);};}for(var e in events){if(events[_0xc102('0x6')](e)){var event=events[e];SquareProject[_0xc102('0x7')](e,emitEvent(event));}}module[_0xc102('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xd297=['hook','exports','events','SquareProject','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd297,0x152));var _0x7d29=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd297[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0x7d29('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x7d29('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7d29('0x2'),'afterUpdate':'update','afterDestroy':_0x7d29('0x3')};function emitEvent(_0x4369b6){return function(_0x47c7a6,_0x24b8b4,_0x3a5f74){SquareProjectEvents[_0x7d29('0x4')](_0x4369b6+':'+_0x47c7a6['id'],_0x47c7a6);SquareProjectEvents[_0x7d29('0x4')](_0x4369b6,_0x47c7a6);_0x3a5f74(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x7d29('0x5')](e,emitEvent(event));}}module[_0x7d29('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 1d8ff75..64eb473 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 _0xbc60=['api','moment','bluebird','request-promise','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','util','../../config/logger'];(function(_0x25701b,_0x2a6976){var _0x3a8a2c=function(_0x1a5e78){while(--_0x1a5e78){_0x25701b['push'](_0x25701b['shift']());}};_0x3a8a2c(++_0x2a6976);}(_0xbc60,0x1d1));var _0x0bc6=function(_0xa608c,_0xbbebc){_0xa608c=_0xa608c-0x0;var _0x5a09d4=_0xbc60[_0xa608c];return _0x5a09d4;};'use strict';var _=require(_0x0bc6('0x0'));var util=require(_0x0bc6('0x1'));var logger=require(_0x0bc6('0x2'))(_0x0bc6('0x3'));var moment=require(_0x0bc6('0x4'));var BPromise=require(_0x0bc6('0x5'));var rp=require(_0x0bc6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0bc6('0x7'));var attributes=require(_0x0bc6('0x8'));module[_0x0bc6('0x9')]=function(_0x28e37b,_0x4c8628){return _0x28e37b[_0x0bc6('0xa')](_0x0bc6('0xb'),attributes,{'tableName':_0x0bc6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39da45,_0x4d904f,_0x1baf56){if(_0x39da45[_0x0bc6('0xd')]('preproduction')){_0x39da45[_0x0bc6('0xe')]=moment()[_0x0bc6('0xf')](_0x0bc6('0x10'));}if(_0x39da45[_0x0bc6('0xd')]('production')){_0x39da45[_0x0bc6('0x11')]=moment()['format'](_0x0bc6('0x10'));}_0x1baf56(null,_0x39da45);}}});}; \ No newline at end of file +var _0xb5d9=['exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xb5d9,0x100));var _0x9b5d=function(_0xb4d778,_0x3d75e5){_0xb4d778=_0xb4d778-0x0;var _0x2a28fa=_0xb5d9[_0xb4d778];return _0x2a28fa;};'use strict';var _=require(_0x9b5d('0x0'));var util=require(_0x9b5d('0x1'));var logger=require(_0x9b5d('0x2'))('api');var moment=require(_0x9b5d('0x3'));var BPromise=require(_0x9b5d('0x4'));var rp=require(_0x9b5d('0x5'));var fs=require('fs');var path=require(_0x9b5d('0x6'));var rimraf=require(_0x9b5d('0x7'));var config=require(_0x9b5d('0x8'));var attributes=require(_0x9b5d('0x9'));module[_0x9b5d('0xa')]=function(_0x4381b2,_0x54f581){return _0x4381b2[_0x9b5d('0xb')](_0x9b5d('0xc'),attributes,{'tableName':_0x9b5d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a74ce,_0x353ad0,_0x2d8033){if(_0x2a74ce[_0x9b5d('0xe')](_0x9b5d('0xf'))){_0x2a74ce[_0x9b5d('0x10')]=moment()[_0x9b5d('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2a74ce[_0x9b5d('0xe')]('production')){_0x2a74ce['publishedAt']=moment()[_0x9b5d('0x11')](_0x9b5d('0x12'));}_0x2d8033(null,_0x2a74ce);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 256048b..73db06c 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 _0xc6d7=['../../config/environment','socket.io-emitter','GetSquareProjects','SquareProject','options','raw','where','attributes','limit','include','map','model','then','info','catch','error','message','ShowSquareProject','find','debug','stringify','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2becfa,_0x5152a2){var _0x546efb=function(_0x8b6ce0){while(--_0x8b6ce0){_0x2becfa['push'](_0x2becfa['shift']());}};_0x546efb(++_0x5152a2);}(_0xc6d7,0xc4));var _0x7c6d=function(_0x3c09e2,_0x40aeec){_0x3c09e2=_0x3c09e2-0x0;var _0xe58e92=_0xc6d7[_0x3c09e2];return _0xe58e92;};'use strict';var _=require('lodash');var Redis=require(_0x7c6d('0x0'));var db=require(_0x7c6d('0x1'))['db'];var logger=require(_0x7c6d('0x2'))(_0x7c6d('0x3'));var config=require(_0x7c6d('0x4'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7c6d('0x5'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);exports[_0x7c6d('0x6')]=function(_0x27d3c1){var _0x3c61c9=this;return new Promise(function(_0x1dd48b,_0x333e03){return db[_0x7c6d('0x7')]['findAll']({'raw':_0x27d3c1[_0x7c6d('0x8')]?_0x27d3c1[_0x7c6d('0x8')][_0x7c6d('0x9')]===undefined?!![]:![]:!![],'where':_0x27d3c1[_0x7c6d('0x8')]?_0x27d3c1[_0x7c6d('0x8')][_0x7c6d('0xa')]||null:null,'attributes':_0x27d3c1[_0x7c6d('0x8')]?_0x27d3c1[_0x7c6d('0x8')][_0x7c6d('0xb')]||null:null,'limit':_0x27d3c1[_0x7c6d('0x8')]?_0x27d3c1[_0x7c6d('0x8')][_0x7c6d('0xc')]||null:null,'include':_0x27d3c1[_0x7c6d('0x8')]?_0x27d3c1[_0x7c6d('0x8')][_0x7c6d('0xd')]?_[_0x7c6d('0xe')](_0x27d3c1[_0x7c6d('0x8')][_0x7c6d('0xd')],function(_0x1c23c0){return{'model':db[_0x1c23c0[_0x7c6d('0xf')]],'as':_0x1c23c0['as'],'attributes':_0x1c23c0[_0x7c6d('0xb')],'include':_0x1c23c0[_0x7c6d('0xd')]?_[_0x7c6d('0xe')](_0x1c23c0['include'],function(_0x3c62ed){return{'model':db[_0x3c62ed['model']],'as':_0x3c62ed['as'],'attributes':_0x3c62ed[_0x7c6d('0xb')],'include':_0x3c62ed[_0x7c6d('0xd')]?_['map'](_0x3c62ed[_0x7c6d('0xd')],function(_0x5e9d53){return{'model':db[_0x5e9d53['model']],'as':_0x5e9d53['as'],'attributes':_0x5e9d53[_0x7c6d('0xb')]};}):[]};}):[]};}):[]:[]})[_0x7c6d('0x10')](function(_0x3a73f5){logger[_0x7c6d('0x11')](_0x7c6d('0x6'),_0x27d3c1);logger['debug'](_0x7c6d('0x6'),_0x27d3c1,JSON['stringify'](_0x3a73f5));_0x1dd48b(_0x3a73f5);})[_0x7c6d('0x12')](function(_0x4a78c8){logger[_0x7c6d('0x13')]('GetSquareProjects',_0x4a78c8[_0x7c6d('0x14')],_0x27d3c1);_0x333e03(_0x3c61c9[_0x7c6d('0x13')](0x1f4,_0x4a78c8[_0x7c6d('0x14')]));});});};exports[_0x7c6d('0x15')]=function(_0x109223){var _0x59d930=this;return new Promise(function(_0x45e016,_0x40e158){return db[_0x7c6d('0x7')][_0x7c6d('0x16')]({'raw':_0x109223[_0x7c6d('0x8')]?_0x109223[_0x7c6d('0x8')][_0x7c6d('0x9')]===undefined?!![]:![]:!![],'where':_0x109223[_0x7c6d('0x8')]?_0x109223[_0x7c6d('0x8')][_0x7c6d('0xa')]||null:null,'attributes':_0x109223[_0x7c6d('0x8')]?_0x109223['options'][_0x7c6d('0xb')]||null:null,'include':_0x109223['options']?_0x109223[_0x7c6d('0x8')]['include']?_[_0x7c6d('0xe')](_0x109223[_0x7c6d('0x8')]['include'],function(_0x2767c2){return{'model':db[_0x2767c2[_0x7c6d('0xf')]],'as':_0x2767c2['as'],'attributes':_0x2767c2[_0x7c6d('0xb')],'include':_0x2767c2[_0x7c6d('0xd')]?_[_0x7c6d('0xe')](_0x2767c2[_0x7c6d('0xd')],function(_0x3f6b4a){return{'model':db[_0x3f6b4a[_0x7c6d('0xf')]],'as':_0x3f6b4a['as'],'attributes':_0x3f6b4a[_0x7c6d('0xb')],'include':_0x3f6b4a[_0x7c6d('0xd')]?_['map'](_0x3f6b4a['include'],function(_0x4511cb){return{'model':db[_0x4511cb[_0x7c6d('0xf')]],'as':_0x4511cb['as'],'attributes':_0x4511cb[_0x7c6d('0xb')]};}):[]};}):[]};}):[]:[]})[_0x7c6d('0x10')](function(_0x57fcea){logger[_0x7c6d('0x11')](_0x7c6d('0x15'),_0x109223);logger[_0x7c6d('0x17')](_0x7c6d('0x15'),_0x109223,JSON[_0x7c6d('0x18')](_0x57fcea));_0x45e016(_0x57fcea);})['catch'](function(_0x54f233){logger[_0x7c6d('0x13')](_0x7c6d('0x15'),_0x54f233[_0x7c6d('0x14')],_0x109223);_0x40e158(_0x59d930[_0x7c6d('0x13')](0x1f4,_0x54f233[_0x7c6d('0x14')]));});});}; \ No newline at end of file +var _0x28af=['ioredis','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','raw','include','map','model','attributes','info','debug','stringify','catch','error','message','where','ShowSquareProject'];(function(_0x473016,_0xb1f7ec){var _0x351fbb=function(_0x5c4d6a){while(--_0x5c4d6a){_0x473016['push'](_0x473016['shift']());}};_0x351fbb(++_0xb1f7ec);}(_0x28af,0x145));var _0xf28a=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0x28af[_0x1c0991];return _0x5034de;};'use strict';var _=require('lodash');var Redis=require(_0xf28a('0x0'));var db=require('../../mysqldb')['db'];var logger=require(_0xf28a('0x1'))(_0xf28a('0x2'));var config=require('../../config/environment');config[_0xf28a('0x3')]=_[_0xf28a('0x4')](config['redis'],{'host':_0xf28a('0x5'),'port':0x18eb});var socket=require(_0xf28a('0x6'))(new Redis(config[_0xf28a('0x3')]));require(_0xf28a('0x7'))['register'](socket);exports[_0xf28a('0x8')]=function(_0x2da9d7){var _0x3777be=this;return new Promise(function(_0x2d01dc,_0x24a5ad){return db[_0xf28a('0x9')][_0xf28a('0xa')]({'raw':_0x2da9d7[_0xf28a('0xb')]?_0x2da9d7[_0xf28a('0xb')][_0xf28a('0xc')]===undefined?!![]:![]:!![],'where':_0x2da9d7[_0xf28a('0xb')]?_0x2da9d7[_0xf28a('0xb')]['where']||null:null,'attributes':_0x2da9d7['options']?_0x2da9d7['options']['attributes']||null:null,'limit':_0x2da9d7[_0xf28a('0xb')]?_0x2da9d7['options']['limit']||null:null,'include':_0x2da9d7[_0xf28a('0xb')]?_0x2da9d7['options'][_0xf28a('0xd')]?_[_0xf28a('0xe')](_0x2da9d7[_0xf28a('0xb')]['include'],function(_0x4e0468){return{'model':db[_0x4e0468['model']],'as':_0x4e0468['as'],'attributes':_0x4e0468['attributes'],'include':_0x4e0468[_0xf28a('0xd')]?_[_0xf28a('0xe')](_0x4e0468[_0xf28a('0xd')],function(_0x57a59b){return{'model':db[_0x57a59b[_0xf28a('0xf')]],'as':_0x57a59b['as'],'attributes':_0x57a59b[_0xf28a('0x10')],'include':_0x57a59b['include']?_[_0xf28a('0xe')](_0x57a59b['include'],function(_0x39b836){return{'model':db[_0x39b836[_0xf28a('0xf')]],'as':_0x39b836['as'],'attributes':_0x39b836[_0xf28a('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b6c29){logger[_0xf28a('0x11')]('GetSquareProjects',_0x2da9d7);logger[_0xf28a('0x12')](_0xf28a('0x8'),_0x2da9d7,JSON[_0xf28a('0x13')](_0x3b6c29));_0x2d01dc(_0x3b6c29);})[_0xf28a('0x14')](function(_0x4052f7){logger[_0xf28a('0x15')](_0xf28a('0x8'),_0x4052f7[_0xf28a('0x16')],_0x2da9d7);_0x24a5ad(_0x3777be[_0xf28a('0x15')](0x1f4,_0x4052f7[_0xf28a('0x16')]));});});};exports['ShowSquareProject']=function(_0x141489){var _0x43dbf7=this;return new Promise(function(_0x312be7,_0x5ad2fe){return db[_0xf28a('0x9')]['find']({'raw':_0x141489[_0xf28a('0xb')]?_0x141489[_0xf28a('0xb')][_0xf28a('0xc')]===undefined?!![]:![]:!![],'where':_0x141489['options']?_0x141489[_0xf28a('0xb')][_0xf28a('0x17')]||null:null,'attributes':_0x141489[_0xf28a('0xb')]?_0x141489['options'][_0xf28a('0x10')]||null:null,'include':_0x141489[_0xf28a('0xb')]?_0x141489[_0xf28a('0xb')][_0xf28a('0xd')]?_[_0xf28a('0xe')](_0x141489['options'][_0xf28a('0xd')],function(_0x4dd2ac){return{'model':db[_0x4dd2ac['model']],'as':_0x4dd2ac['as'],'attributes':_0x4dd2ac[_0xf28a('0x10')],'include':_0x4dd2ac['include']?_['map'](_0x4dd2ac[_0xf28a('0xd')],function(_0x5d81a8){return{'model':db[_0x5d81a8['model']],'as':_0x5d81a8['as'],'attributes':_0x5d81a8[_0xf28a('0x10')],'include':_0x5d81a8['include']?_[_0xf28a('0xe')](_0x5d81a8[_0xf28a('0xd')],function(_0x4b4dc5){return{'model':db[_0x4b4dc5[_0xf28a('0xf')]],'as':_0x4b4dc5['as'],'attributes':_0x4b4dc5[_0xf28a('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a317e){logger[_0xf28a('0x11')](_0xf28a('0x18'),_0x141489);logger['debug'](_0xf28a('0x18'),_0x141489,JSON[_0xf28a('0x13')](_0x2a317e));_0x312be7(_0x2a317e);})['catch'](function(_0x531d35){logger[_0xf28a('0x15')](_0xf28a('0x18'),_0x531d35[_0xf28a('0x16')],_0x141489);_0x5ad2fe(_0x43dbf7['error'](0x1f4,_0x531d35['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index a067505..14bc0bc 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 _0xb5d9=['remove','update','removeListener','register','length','./squareProject.events','save'];(function(_0x5c3434,_0x2900d6){var _0x10310a=function(_0x2ea2af){while(--_0x2ea2af){_0x5c3434['push'](_0x5c3434['shift']());}};_0x10310a(++_0x2900d6);}(_0xb5d9,0x124));var _0x9b5d=function(_0x29ec8c,_0x3dd828){_0x29ec8c=_0x29ec8c-0x0;var _0x4c5f03=_0xb5d9[_0x29ec8c];return _0x4c5f03;};'use strict';var SquareProjectEvents=require(_0x9b5d('0x0'));var events=[_0x9b5d('0x1'),_0x9b5d('0x2'),_0x9b5d('0x3')];function createListener(_0x4b2468,_0x23733f){return function(_0x124690){_0x23733f['emit'](_0x4b2468,_0x124690);};}function removeListener(_0x30727f,_0x3d6c04){return function(){SquareProjectEvents[_0x9b5d('0x4')](_0x30727f,_0x3d6c04);};}exports[_0x9b5d('0x5')]=function(_0x388782){for(var _0x1d5257=0x0,_0x40ea8e=events[_0x9b5d('0x6')];_0x1d5257<_0x40ea8e;_0x1d5257++){var _0x211b44=events[_0x1d5257];var _0x2ea48d=createListener('squareProject:'+_0x211b44,_0x388782);SquareProjectEvents['on'](_0x211b44,_0x2ea48d);}}; \ No newline at end of file +var _0x5346=['register','length','squareProject:','save','remove','update','emit','removeListener'];(function(_0x4f5407,_0x2303f8){var _0x2b3c95=function(_0x316e1a){while(--_0x316e1a){_0x4f5407['push'](_0x4f5407['shift']());}};_0x2b3c95(++_0x2303f8);}(_0x5346,0x1c3));var _0x6534=function(_0x59b298,_0xe13624){_0x59b298=_0x59b298-0x0;var _0x5756ac=_0x5346[_0x59b298];return _0x5756ac;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x6534('0x0'),_0x6534('0x1'),_0x6534('0x2')];function createListener(_0x5e6ba4,_0x124b93){return function(_0x13da88){_0x124b93[_0x6534('0x3')](_0x5e6ba4,_0x13da88);};}function removeListener(_0x5ad2f7,_0x422971){return function(){SquareProjectEvents[_0x6534('0x4')](_0x5ad2f7,_0x422971);};}exports[_0x6534('0x5')]=function(_0x108b69){for(var _0x501402=0x0,_0x509e45=events[_0x6534('0x6')];_0x501402<_0x509e45;_0x501402++){var _0x4e1ff9=events[_0x501402];var _0x20cfeb=createListener(_0x6534('0x7')+_0x4e1ff9,_0x108b69);SquareProjectEvents['on'](_0x4e1ff9,_0x20cfeb);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index ecf99fb..c541860 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x871497,_0x1f959e){var _0x92e9e3=function(_0x2e379b){while(--_0x2e379b){_0x871497['push'](_0x871497['shift']());}};_0x92e9e3(++_0x1f959e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0xf494=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3167d6,_0x31d587){var _0x5c5531=function(_0x511b30){while(--_0x511b30){_0x3167d6['push'](_0x3167d6['shift']());}};_0x5c5531(++_0x31d587);}(_0xf494,0x1c6));var _0x4f49=function(_0x12428d,_0x5dc7a8){_0x12428d=_0x12428d-0x0;var _0x5685c7=_0xf494[_0x12428d];return _0x5685c7;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);router['put'](_0x4f49('0x12'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x14')]);module[_0x4f49('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index c24dc36..53681e1 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 _0x31f0=['getDataValue','savePath','substring','sequelize','STRING','VIRTUAL'];(function(_0x3579d7,_0x1a5cc7){var _0x36e78b=function(_0x37e50e){while(--_0x37e50e){_0x3579d7['push'](_0x3579d7['shift']());}};_0x36e78b(++_0x1a5cc7);}(_0x31f0,0xb7));var _0x031f=function(_0x492524,_0x4817eb){_0x492524=_0x492524-0x0;var _0xa5d44e=_0x31f0[_0x492524];return _0xa5d44e;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x031f('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x031f('0x1')]},'context':{'type':Sequelize[_0x031f('0x1')]},'extension':{'type':Sequelize[_0x031f('0x1')]},'priority':{'type':Sequelize[_0x031f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x031f('0x1')]},'projectName':{'type':Sequelize[_0x031f('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x031f('0x2')],'get':function(){var _0x487e65='';var _0x365f59=this[_0x031f('0x3')](_0x031f('0x4'));if(_0x365f59){_0x487e65=_0x365f59[_0x031f('0x5')](_0x365f59['lastIndexOf']('.'));}return _0x487e65;}}}; \ No newline at end of file +var _0xbd51=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','STRING'];(function(_0x1f102d,_0x38971d){var _0x38c292=function(_0x59c555){while(--_0x59c555){_0x1f102d['push'](_0x1f102d['shift']());}};_0x38c292(++_0x38971d);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x559f30,_0x24c514){_0x559f30=_0x559f30-0x0;var _0x56e111=_0xbd51[_0x559f30];return _0x56e111;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1bd5('0x1')]},'callerid':{'type':Sequelize[_0x1bd5('0x1')]},'calleridname':{'type':Sequelize[_0x1bd5('0x1')]},'context':{'type':Sequelize[_0x1bd5('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x1bd5('0x1')]},'saveName':{'type':Sequelize[_0x1bd5('0x1')]},'filename':{'type':Sequelize[_0x1bd5('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1bd5('0x2')],'get':function(){var _0x30a385='';var _0x19077c=this[_0x1bd5('0x3')](_0x1bd5('0x4'));if(_0x19077c){_0x30a385=_0x19077c['substring'](_0x19077c[_0x1bd5('0x5')]('.'));}return _0x30a385;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index db14532..b7f76ef 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 _0x8263=['save','update','then','destroy','error','stack','name','send','SquareRecording','fieldName','type','key','map','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','rawAttributes','create','body','find','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../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','reject'];(function(_0x5e4ffa,_0x56154d){var _0x43a656=function(_0x507ed4){while(--_0x507ed4){_0x5e4ffa['push'](_0x5e4ffa['shift']());}};_0x43a656(++_0x56154d);}(_0x8263,0x10a));var _0x3826=function(_0x473311,_0x417ed5){_0x473311=_0x473311-0x0;var _0x1eb63d=_0x8263[_0x473311];return _0x1eb63d;};'use strict';var emlformat=require(_0x3826('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3826('0x1'));var jsonpatch=require(_0x3826('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3826('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3826('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3826('0x5'));var fs=require('fs');var fs_extra=require(_0x3826('0x6'));var _=require(_0x3826('0x7'));var squel=require(_0x3826('0x8'));var crypto=require(_0x3826('0x9'));var jsforce=require(_0x3826('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3826('0xb'));var querystring=require(_0x3826('0xc'));var Papa=require(_0x3826('0xd'));var Redis=require('ioredis');var authService=require(_0x3826('0xe'));var qs=require(_0x3826('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3826('0x10'));var logger=require(_0x3826('0x11'))(_0x3826('0x12'));var utils=require(_0x3826('0x13'));var config=require(_0x3826('0x14'));var licenseUtil=require(_0x3826('0x15'));var db=require(_0x3826('0x16'))['db'];function respondWithStatusCode(_0x33852a,_0x5e0733){_0x5e0733=_0x5e0733||0xcc;return function(_0x33d724){if(_0x33d724){return _0x33852a[_0x3826('0x17')](_0x5e0733);}return _0x33852a[_0x3826('0x18')](_0x5e0733)[_0x3826('0x19')]();};}function respondWithResult(_0x48d41c,_0x3146bc){_0x3146bc=_0x3146bc||0xc8;return function(_0x18bedd){if(_0x18bedd){return _0x48d41c['status'](_0x3146bc)[_0x3826('0x1a')](_0x18bedd);}};}function respondWithFilteredResult(_0x51ba3a,_0x2b2fca){return function(_0x3b28ca){if(_0x3b28ca){var _0x165616=typeof _0x2b2fca['offset']===_0x3826('0x1b')&&typeof _0x2b2fca[_0x3826('0x1c')]===_0x3826('0x1b');var _0x1f4a7a=_0x3b28ca[_0x3826('0x1d')];var _0x1c4d24=_0x165616?0x0:_0x2b2fca[_0x3826('0x1e')];var _0x46b47f=_0x165616?_0x3b28ca['count']:_0x2b2fca['offset']+_0x2b2fca['limit'];var _0x4bcc0c;if(_0x46b47f>=_0x1f4a7a){_0x46b47f=_0x1f4a7a;_0x4bcc0c=0xc8;}else{_0x4bcc0c=0xce;}_0x51ba3a[_0x3826('0x18')](_0x4bcc0c);return _0x51ba3a[_0x3826('0x1f')](_0x3826('0x20'),_0x1c4d24+'-'+_0x46b47f+'/'+_0x1f4a7a)[_0x3826('0x1a')](_0x3b28ca);}return null;};}function patchUpdates(_0x751dd){return function(_0x46f16c){try{jsonpatch['apply'](_0x46f16c,_0x751dd,!![]);}catch(_0x9f38cd){return BPromise[_0x3826('0x21')](_0x9f38cd);}return _0x46f16c[_0x3826('0x22')]();};}function saveUpdates(_0x4db6a9,_0x3b47e8){return function(_0x2db185){if(_0x2db185){return _0x2db185[_0x3826('0x23')](_0x4db6a9)[_0x3826('0x24')](function(_0x314a0f){return _0x314a0f;});}return null;};}function removeEntity(_0x39654a,_0x17fde5){return function(_0x1f573a){if(_0x1f573a){return _0x1f573a[_0x3826('0x25')]()['then'](function(){_0x39654a[_0x3826('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50dd96,_0x107dd7){return function(_0x44e8a2){if(!_0x44e8a2){_0x50dd96[_0x3826('0x17')](0x194);}return _0x44e8a2;};}function handleError(_0x41c495,_0x5c77ca){_0x5c77ca=_0x5c77ca||0x1f4;return function(_0x6fa294){logger[_0x3826('0x26')](_0x6fa294[_0x3826('0x27')]);if(_0x6fa294[_0x3826('0x28')]){delete _0x6fa294['name'];}_0x41c495[_0x3826('0x18')](_0x5c77ca)[_0x3826('0x29')](_0x6fa294);};}exports['index']=function(_0x53d806,_0x5b3324){var _0xec933f={},_0x35377f={},_0x46ed05={'count':0x0,'rows':[]};var _0x3e6d36=_['map'](db[_0x3826('0x2a')]['rawAttributes'],function(_0x2c9d25){return{'name':_0x2c9d25[_0x3826('0x2b')],'type':_0x2c9d25[_0x3826('0x2c')][_0x3826('0x2d')]};});_0x35377f['model']=_[_0x3826('0x2e')](_0x3e6d36,_0x3826('0x28'));_0x35377f[_0x3826('0x2f')]=_['keys'](_0x53d806[_0x3826('0x2f')]);_0x35377f['filters']=_[_0x3826('0x30')](_0x35377f['model'],_0x35377f[_0x3826('0x2f')]);_0xec933f[_0x3826('0x31')]=_[_0x3826('0x30')](_0x35377f[_0x3826('0x32')],qs[_0x3826('0x33')](_0x53d806[_0x3826('0x2f')][_0x3826('0x33')]));_0xec933f[_0x3826('0x31')]=_0xec933f[_0x3826('0x31')][_0x3826('0x34')]?_0xec933f[_0x3826('0x31')]:_0x35377f[_0x3826('0x32')];if(!_0x53d806[_0x3826('0x2f')][_0x3826('0x35')](_0x3826('0x36'))){_0xec933f[_0x3826('0x1c')]=qs[_0x3826('0x1c')](_0x53d806[_0x3826('0x2f')][_0x3826('0x1c')]);_0xec933f[_0x3826('0x1e')]=qs[_0x3826('0x1e')](_0x53d806['query']['offset']);}_0xec933f[_0x3826('0x37')]=qs[_0x3826('0x38')](_0x53d806[_0x3826('0x2f')][_0x3826('0x38')]);_0xec933f[_0x3826('0x39')]=qs[_0x3826('0x3a')](_[_0x3826('0x3b')](_0x53d806[_0x3826('0x2f')],_0x35377f[_0x3826('0x3a')]),_0x3e6d36);if(_0x53d806['query'][_0x3826('0x3c')]){_0xec933f[_0x3826('0x39')]=_[_0x3826('0x3d')](_0xec933f[_0x3826('0x39')],{'$or':_[_0x3826('0x2e')](_0x3e6d36,function(_0x3659b5){if(_0x3659b5[_0x3826('0x2c')]!==_0x3826('0x3e')){var _0x34f5c9={};_0x34f5c9[_0x3659b5[_0x3826('0x28')]]={'$like':'%'+_0x53d806['query'][_0x3826('0x3c')]+'%'};return _0x34f5c9;}})});}_0xec933f=_['merge']({},_0xec933f,_0x53d806[_0x3826('0x3f')]);var _0x451aff={'where':_0xec933f[_0x3826('0x39')]};return db[_0x3826('0x2a')][_0x3826('0x1d')](_0x451aff)[_0x3826('0x24')](function(_0x5f029c){_0x46ed05[_0x3826('0x1d')]=_0x5f029c;if(_0x53d806[_0x3826('0x2f')][_0x3826('0x40')]){_0xec933f[_0x3826('0x41')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0xec933f);})['then'](function(_0x927b89){_0x46ed05['rows']=_0x927b89;return _0x46ed05;})[_0x3826('0x24')](respondWithFilteredResult(_0x5b3324,_0xec933f))[_0x3826('0x42')](handleError(_0x5b3324,null));};exports[_0x3826('0x43')]=function(_0x5501c6,_0x329e05){var _0x4dccdd={'raw':!![],'where':{'id':_0x5501c6[_0x3826('0x44')]['id']}},_0x2f3fd4={};_0x2f3fd4[_0x3826('0x32')]=_[_0x3826('0x45')](db[_0x3826('0x2a')][_0x3826('0x46')]);_0x2f3fd4[_0x3826('0x2f')]=_[_0x3826('0x45')](_0x5501c6[_0x3826('0x2f')]);_0x2f3fd4[_0x3826('0x3a')]=_[_0x3826('0x30')](_0x2f3fd4[_0x3826('0x32')],_0x2f3fd4[_0x3826('0x2f')]);_0x4dccdd[_0x3826('0x31')]=_[_0x3826('0x30')](_0x2f3fd4['model'],qs[_0x3826('0x33')](_0x5501c6[_0x3826('0x2f')][_0x3826('0x33')]));_0x4dccdd[_0x3826('0x31')]=_0x4dccdd[_0x3826('0x31')]['length']?_0x4dccdd[_0x3826('0x31')]:_0x2f3fd4[_0x3826('0x32')];if(_0x5501c6[_0x3826('0x2f')][_0x3826('0x40')]){_0x4dccdd[_0x3826('0x41')]=[{'all':!![]}];}_0x4dccdd=_['merge']({},_0x4dccdd,_0x5501c6[_0x3826('0x3f')]);return db[_0x3826('0x2a')]['find'](_0x4dccdd)[_0x3826('0x24')](handleEntityNotFound(_0x329e05,null))[_0x3826('0x24')](respondWithResult(_0x329e05,null))[_0x3826('0x42')](handleError(_0x329e05,null));};exports[_0x3826('0x47')]=function(_0x450d74,_0x458e51){return db['SquareRecording'][_0x3826('0x47')](_0x450d74['body'],{})[_0x3826('0x24')](respondWithResult(_0x458e51,0xc9))[_0x3826('0x42')](handleError(_0x458e51,null));};exports[_0x3826('0x23')]=function(_0x1705a0,_0x2b79ed){if(_0x1705a0['body']['id']){delete _0x1705a0[_0x3826('0x48')]['id'];}return db[_0x3826('0x2a')][_0x3826('0x49')]({'where':{'id':_0x1705a0['params']['id']}})[_0x3826('0x24')](handleEntityNotFound(_0x2b79ed,null))[_0x3826('0x24')](saveUpdates(_0x1705a0[_0x3826('0x48')],null))[_0x3826('0x24')](respondWithResult(_0x2b79ed,null))[_0x3826('0x42')](handleError(_0x2b79ed,null));};exports[_0x3826('0x4a')]=function(_0x40c941,_0x172bb0,_0x464421){var _0x1b7e10=require(_0x3826('0x4b'));var _0x2f4ff9=![];var _0x284b97={};if(_0x40c941[_0x3826('0x2f')][_0x3826('0x2c')]&&_0x40c941['query'][_0x3826('0x2c')]===_0x3826('0x4c')){_0x284b97[_0x3826('0x4c')]=_0x40c941[_0x3826('0x44')]['id'];}else{_0x284b97['id']=_0x40c941[_0x3826('0x44')]['id'];}return db[_0x3826('0x2a')]['find']({'where':_0x284b97,'attributes':['id',_0x3826('0x4d'),_0x3826('0x4e')],'raw':!![]})[_0x3826('0x24')](handleEntityNotFound(_0x172bb0,null))[_0x3826('0x24')](function(_0x4f4c77){if(_0x4f4c77){var _0x2c835c=_0x4f4c77[_0x3826('0x4d')];var _0x11bf73=util[_0x3826('0x4f')](_0x3826('0x50'),_0x2c835c);if(fs['existsSync'](_0x11bf73)){_0x2f4ff9=!![];return _0x1b7e10[_0x3826('0x51')](_0x11bf73,_0x2c835c,config[_0x3826('0x52')][_0x3826('0x53')])[_0x3826('0x24')](function(){return _0x4f4c77;});}return _0x4f4c77;}})[_0x3826('0x24')](function(_0x5c0338){if(_0x5c0338){var _0x5925e3=_0x5c0338[_0x3826('0x4d')];if(!fs[_0x3826('0x54')](_0x5925e3)){throw new db[(_0x3826('0x55'))][(_0x3826('0x56'))]('SquareRecording\x20not\x20found');}if(_0x5c0338[_0x3826('0x4e')]){return _0x172bb0[_0x3826('0x4a')](_0x5925e3,_0x5c0338[_0x3826('0x4e')]+path[_0x3826('0x57')](_0x5925e3),function(){if(_0x2f4ff9){fs['unlink'](_0x5925e3);}});}else{return _0x172bb0[_0x3826('0x4a')](_0x5925e3,function(_0x504ca1){if(_0x2f4ff9){fs[_0x3826('0x58')](_0x5925e3);}});}}})['catch'](function(_0x4975d2){if(_0x4975d2[_0x3826('0x59')]===_0x3826('0x5a')){_0x172bb0[_0x3826('0x18')](0x194)[_0x3826('0x29')](_0x3826('0x5b'));}else{return handleError(_0x172bb0,null);}});};exports[_0x3826('0x25')]=function(_0x205afd,_0x3bd8de){return db[_0x3826('0x2a')][_0x3826('0x49')]({'where':{'id':_0x205afd['params']['id']}})[_0x3826('0x24')](function(_0x190757){if(_[_0x3826('0x5c')](_0x190757)){throw new ReferenceError(_0x3826('0x5d'));}return _0x190757;})[_0x3826('0x24')](function(_0x290aad){var _0x4322a9=_0x290aad['savePath'];logger['info'](_0x3826('0x5e'),_0x4322a9);if(!_[_0x3826('0x5c')](_0x290aad[_0x3826('0x4d')])&&fs['existsSync'](_0x4322a9)){logger[_0x3826('0x5f')](_0x3826('0x60')+_0x4322a9+_0x3826('0x61'));fs[_0x3826('0x62')](_0x4322a9);}_0x4322a9=_0x4322a9+_0x3826('0x63');if(!_[_0x3826('0x5c')](_0x290aad['savePath'])&&fs['existsSync'](_0x4322a9)){logger[_0x3826('0x5f')]('File:\x20\x22'+_0x4322a9+_0x3826('0x61'));fs[_0x3826('0x62')](_0x4322a9);}return _0x290aad;})[_0x3826('0x24')](function(_0xdd3cdd){if(!_0xdd3cdd)throw new InternalError();return _0xdd3cdd[_0x3826('0x25')]();})[_0x3826('0x24')](function(){_0x3bd8de[_0x3826('0x18')](0xcc)[_0x3826('0x19')]();})[_0x3826('0x42')](handleError(_0x3bd8de,null));}; \ No newline at end of file +var _0x4a5b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','SquareRecording','rows','catch','show','params','find','create','body','download','../../components/encryptor','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x4a5b,0x11a));var _0xb4a5=function(_0x27b1bf,_0x48ea52){_0x27b1bf=_0x27b1bf-0x0;var _0x185100=_0x4a5b[_0x27b1bf];return _0x185100;};'use strict';var emlformat=require(_0xb4a5('0x0'));var rimraf=require(_0xb4a5('0x1'));var zipdir=require(_0xb4a5('0x2'));var jsonpatch=require(_0xb4a5('0x3'));var rp=require(_0xb4a5('0x4'));var moment=require(_0xb4a5('0x5'));var BPromise=require(_0xb4a5('0x6'));var Mustache=require(_0xb4a5('0x7'));var util=require(_0xb4a5('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xb4a5('0x9'));var ejs=require(_0xb4a5('0xa'));var fs=require('fs');var fs_extra=require(_0xb4a5('0xb'));var _=require(_0xb4a5('0xc'));var squel=require(_0xb4a5('0xd'));var crypto=require(_0xb4a5('0xe'));var jsforce=require(_0xb4a5('0xf'));var deskjs=require(_0xb4a5('0x10'));var toCsv=require(_0xb4a5('0x9'));var querystring=require(_0xb4a5('0x11'));var Papa=require(_0xb4a5('0x12'));var Redis=require(_0xb4a5('0x13'));var authService=require(_0xb4a5('0x14'));var qs=require(_0xb4a5('0x15'));var as=require(_0xb4a5('0x16'));var hardwareService=require(_0xb4a5('0x17'));var logger=require(_0xb4a5('0x18'))(_0xb4a5('0x19'));var utils=require(_0xb4a5('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xb4a5('0x1b'));var db=require(_0xb4a5('0x1c'))['db'];function respondWithStatusCode(_0x4d63a3,_0x4e3af7){_0x4e3af7=_0x4e3af7||0xcc;return function(_0x332674){if(_0x332674){return _0x4d63a3[_0xb4a5('0x1d')](_0x4e3af7);}return _0x4d63a3[_0xb4a5('0x1e')](_0x4e3af7)[_0xb4a5('0x1f')]();};}function respondWithResult(_0x5edc6a,_0x4d4b56){_0x4d4b56=_0x4d4b56||0xc8;return function(_0x5b402){if(_0x5b402){return _0x5edc6a[_0xb4a5('0x1e')](_0x4d4b56)[_0xb4a5('0x20')](_0x5b402);}};}function respondWithFilteredResult(_0x519096,_0x4b1baa){return function(_0x33320a){if(_0x33320a){var _0x5b7dfe=typeof _0x4b1baa[_0xb4a5('0x21')]===_0xb4a5('0x22')&&typeof _0x4b1baa[_0xb4a5('0x23')]==='undefined';var _0x3afab=_0x33320a[_0xb4a5('0x24')];var _0x13b7dd=_0x5b7dfe?0x0:_0x4b1baa[_0xb4a5('0x21')];var _0x13e4dd=_0x5b7dfe?_0x33320a[_0xb4a5('0x24')]:_0x4b1baa[_0xb4a5('0x21')]+_0x4b1baa[_0xb4a5('0x23')];var _0x4b8f99;if(_0x13e4dd>=_0x3afab){_0x13e4dd=_0x3afab;_0x4b8f99=0xc8;}else{_0x4b8f99=0xce;}_0x519096[_0xb4a5('0x1e')](_0x4b8f99);return _0x519096[_0xb4a5('0x25')]('Content-Range',_0x13b7dd+'-'+_0x13e4dd+'/'+_0x3afab)[_0xb4a5('0x20')](_0x33320a);}return null;};}function patchUpdates(_0x23486d){return function(_0x19d820){try{jsonpatch['apply'](_0x19d820,_0x23486d,!![]);}catch(_0x219c63){return BPromise['reject'](_0x219c63);}return _0x19d820['save']();};}function saveUpdates(_0x3d08b8,_0x4bc2ed){return function(_0x227640){if(_0x227640){return _0x227640[_0xb4a5('0x26')](_0x3d08b8)[_0xb4a5('0x27')](function(_0xfd5831){return _0xfd5831;});}return null;};}function removeEntity(_0x2eb31e,_0x567a19){return function(_0x4e17f4){if(_0x4e17f4){return _0x4e17f4['destroy']()[_0xb4a5('0x27')](function(){_0x2eb31e[_0xb4a5('0x1e')](0xcc)[_0xb4a5('0x1f')]();});}};}function handleEntityNotFound(_0x46b8d1,_0x31042a){return function(_0x54cda8){if(!_0x54cda8){_0x46b8d1[_0xb4a5('0x1d')](0x194);}return _0x54cda8;};}function handleError(_0x387d90,_0x168694){_0x168694=_0x168694||0x1f4;return function(_0x7d58e2){logger[_0xb4a5('0x28')](_0x7d58e2[_0xb4a5('0x29')]);if(_0x7d58e2[_0xb4a5('0x2a')]){delete _0x7d58e2[_0xb4a5('0x2a')];}_0x387d90[_0xb4a5('0x1e')](_0x168694)['send'](_0x7d58e2);};}exports[_0xb4a5('0x2b')]=function(_0x279545,_0x22b51c){var _0x237352={},_0x5d5e72={},_0x3f0d2e={'count':0x0,'rows':[]};var _0x3894cc=_[_0xb4a5('0x2c')](db['SquareRecording'][_0xb4a5('0x2d')],function(_0x40eee3){return{'name':_0x40eee3[_0xb4a5('0x2e')],'type':_0x40eee3['type'][_0xb4a5('0x2f')]};});_0x5d5e72['model']=_[_0xb4a5('0x2c')](_0x3894cc,_0xb4a5('0x2a'));_0x5d5e72[_0xb4a5('0x30')]=_[_0xb4a5('0x31')](_0x279545[_0xb4a5('0x30')]);_0x5d5e72[_0xb4a5('0x32')]=_[_0xb4a5('0x33')](_0x5d5e72[_0xb4a5('0x34')],_0x5d5e72[_0xb4a5('0x30')]);_0x237352['attributes']=_[_0xb4a5('0x33')](_0x5d5e72[_0xb4a5('0x34')],qs[_0xb4a5('0x35')](_0x279545[_0xb4a5('0x30')][_0xb4a5('0x35')]));_0x237352[_0xb4a5('0x36')]=_0x237352[_0xb4a5('0x36')][_0xb4a5('0x37')]?_0x237352['attributes']:_0x5d5e72['model'];if(!_0x279545[_0xb4a5('0x30')][_0xb4a5('0x38')]('nolimit')){_0x237352[_0xb4a5('0x23')]=qs[_0xb4a5('0x23')](_0x279545['query'][_0xb4a5('0x23')]);_0x237352['offset']=qs['offset'](_0x279545[_0xb4a5('0x30')][_0xb4a5('0x21')]);}_0x237352[_0xb4a5('0x39')]=qs[_0xb4a5('0x3a')](_0x279545['query']['sort']);_0x237352['where']=qs[_0xb4a5('0x32')](_[_0xb4a5('0x3b')](_0x279545[_0xb4a5('0x30')],_0x5d5e72[_0xb4a5('0x32')]),_0x3894cc);if(_0x279545['query'][_0xb4a5('0x3c')]){_0x237352[_0xb4a5('0x3d')]=_[_0xb4a5('0x3e')](_0x237352[_0xb4a5('0x3d')],{'$or':_[_0xb4a5('0x2c')](_0x3894cc,function(_0x10137e){if(_0x10137e[_0xb4a5('0x3f')]!==_0xb4a5('0x40')){var _0x522256={};_0x522256[_0x10137e[_0xb4a5('0x2a')]]={'$like':'%'+_0x279545[_0xb4a5('0x30')][_0xb4a5('0x3c')]+'%'};return _0x522256;}})});}_0x237352=_[_0xb4a5('0x3e')]({},_0x237352,_0x279545[_0xb4a5('0x41')]);var _0x271e9c={'where':_0x237352[_0xb4a5('0x3d')]};return db['SquareRecording']['count'](_0x271e9c)[_0xb4a5('0x27')](function(_0x577098){_0x3f0d2e[_0xb4a5('0x24')]=_0x577098;if(_0x279545['query'][_0xb4a5('0x42')]){_0x237352[_0xb4a5('0x43')]=[{'all':!![]}];}return db[_0xb4a5('0x44')]['findAll'](_0x237352);})['then'](function(_0x433ed2){_0x3f0d2e[_0xb4a5('0x45')]=_0x433ed2;return _0x3f0d2e;})[_0xb4a5('0x27')](respondWithFilteredResult(_0x22b51c,_0x237352))[_0xb4a5('0x46')](handleError(_0x22b51c,null));};exports[_0xb4a5('0x47')]=function(_0x55b6aa,_0x3f302b){var _0xe2e1e2={'raw':!![],'where':{'id':_0x55b6aa[_0xb4a5('0x48')]['id']}},_0x3cbfab={};_0x3cbfab[_0xb4a5('0x34')]=_[_0xb4a5('0x31')](db[_0xb4a5('0x44')][_0xb4a5('0x2d')]);_0x3cbfab[_0xb4a5('0x30')]=_['keys'](_0x55b6aa[_0xb4a5('0x30')]);_0x3cbfab[_0xb4a5('0x32')]=_[_0xb4a5('0x33')](_0x3cbfab[_0xb4a5('0x34')],_0x3cbfab[_0xb4a5('0x30')]);_0xe2e1e2[_0xb4a5('0x36')]=_[_0xb4a5('0x33')](_0x3cbfab[_0xb4a5('0x34')],qs[_0xb4a5('0x35')](_0x55b6aa[_0xb4a5('0x30')]['fields']));_0xe2e1e2[_0xb4a5('0x36')]=_0xe2e1e2[_0xb4a5('0x36')][_0xb4a5('0x37')]?_0xe2e1e2[_0xb4a5('0x36')]:_0x3cbfab[_0xb4a5('0x34')];if(_0x55b6aa[_0xb4a5('0x30')][_0xb4a5('0x42')]){_0xe2e1e2[_0xb4a5('0x43')]=[{'all':!![]}];}_0xe2e1e2=_[_0xb4a5('0x3e')]({},_0xe2e1e2,_0x55b6aa[_0xb4a5('0x41')]);return db[_0xb4a5('0x44')][_0xb4a5('0x49')](_0xe2e1e2)['then'](handleEntityNotFound(_0x3f302b,null))[_0xb4a5('0x27')](respondWithResult(_0x3f302b,null))[_0xb4a5('0x46')](handleError(_0x3f302b,null));};exports[_0xb4a5('0x4a')]=function(_0xd7e1e9,_0xcc762d){return db['SquareRecording']['create'](_0xd7e1e9[_0xb4a5('0x4b')],{})[_0xb4a5('0x27')](respondWithResult(_0xcc762d,0xc9))['catch'](handleError(_0xcc762d,null));};exports[_0xb4a5('0x26')]=function(_0x43a387,_0xe517b1){if(_0x43a387[_0xb4a5('0x4b')]['id']){delete _0x43a387['body']['id'];}return db['SquareRecording'][_0xb4a5('0x49')]({'where':{'id':_0x43a387[_0xb4a5('0x48')]['id']}})[_0xb4a5('0x27')](handleEntityNotFound(_0xe517b1,null))[_0xb4a5('0x27')](saveUpdates(_0x43a387[_0xb4a5('0x4b')],null))[_0xb4a5('0x27')](respondWithResult(_0xe517b1,null))[_0xb4a5('0x46')](handleError(_0xe517b1,null));};exports[_0xb4a5('0x4c')]=function(_0x50946b,_0x2dda6e,_0x22b79a){var _0x5d575b=require(_0xb4a5('0x4d'));var _0x22d22f=![];var _0xa82828={};if(_0x50946b[_0xb4a5('0x30')][_0xb4a5('0x3f')]&&_0x50946b[_0xb4a5('0x30')][_0xb4a5('0x3f')]==='uniqueid'){_0xa82828['uniqueid']=_0x50946b['params']['id'];}else{_0xa82828['id']=_0x50946b['params']['id'];}return db[_0xb4a5('0x44')]['find']({'where':_0xa82828,'attributes':['id',_0xb4a5('0x4e'),'filename'],'raw':!![]})[_0xb4a5('0x27')](handleEntityNotFound(_0x2dda6e,null))[_0xb4a5('0x27')](function(_0xe6466c){if(_0xe6466c){var _0x4f53a2=_0xe6466c['savePath'];var _0x296bfb=util['format'](_0xb4a5('0x4f'),_0x4f53a2);if(fs[_0xb4a5('0x50')](_0x296bfb)){_0x22d22f=!![];return _0x5d575b[_0xb4a5('0x51')](_0x296bfb,_0x4f53a2,config[_0xb4a5('0x52')][_0xb4a5('0x53')])[_0xb4a5('0x27')](function(){return _0xe6466c;});}return _0xe6466c;}})['then'](function(_0x22c4bd){if(_0x22c4bd){var _0x49af28=_0x22c4bd[_0xb4a5('0x4e')];if(!fs[_0xb4a5('0x50')](_0x49af28)){throw new db[(_0xb4a5('0x54'))][(_0xb4a5('0x55'))](_0xb4a5('0x56'));}if(_0x22c4bd[_0xb4a5('0x57')]){return _0x2dda6e[_0xb4a5('0x4c')](_0x49af28,_0x22c4bd[_0xb4a5('0x57')]+path['extname'](_0x49af28),function(){if(_0x22d22f){fs[_0xb4a5('0x58')](_0x49af28);}});}else{return _0x2dda6e['download'](_0x49af28,function(_0x2f2e9e){if(_0x22d22f){fs[_0xb4a5('0x58')](_0x49af28);}});}}})[_0xb4a5('0x46')](function(_0x4c36e8){if(_0x4c36e8[_0xb4a5('0x59')]===_0xb4a5('0x56')){_0x2dda6e['status'](0x194)[_0xb4a5('0x5a')](_0xb4a5('0x5b'));}else{return handleError(_0x2dda6e,null);}});};exports['destroy']=function(_0x2e2bf5,_0x25bd4d){return db[_0xb4a5('0x44')][_0xb4a5('0x49')]({'where':{'id':_0x2e2bf5['params']['id']}})['then'](function(_0x11c9ac){if(_[_0xb4a5('0x5c')](_0x11c9ac)){throw new ReferenceError(_0xb4a5('0x5d'));}return _0x11c9ac;})[_0xb4a5('0x27')](function(_0x273c98){var _0x44fe3b=_0x273c98[_0xb4a5('0x4e')];logger[_0xb4a5('0x5e')](_0xb4a5('0x5f'),_0x44fe3b);if(!_[_0xb4a5('0x5c')](_0x273c98['savePath'])&&fs[_0xb4a5('0x50')](_0x44fe3b)){logger[_0xb4a5('0x5e')]('File:\x20\x22'+_0x44fe3b+_0xb4a5('0x60'));fs[_0xb4a5('0x61')](_0x44fe3b);}_0x44fe3b=_0x44fe3b+_0xb4a5('0x62');if(!_['isNil'](_0x273c98['savePath'])&&fs[_0xb4a5('0x50')](_0x44fe3b)){logger['info'](_0xb4a5('0x63')+_0x44fe3b+_0xb4a5('0x60'));fs[_0xb4a5('0x61')](_0x44fe3b);}return _0x273c98;})[_0xb4a5('0x27')](function(_0x347df5){if(!_0x347df5)throw new InternalError();return _0x347df5[_0xb4a5('0x64')]();})['then'](function(){_0x25bd4d['status'](0xcc)[_0xb4a5('0x1f')]();})[_0xb4a5('0x46')](handleError(_0x25bd4d,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 720de7e..9906458 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 _0x5078=['rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x5078,0x148));var _0x8507=function(_0x1cb2c5,_0x2589dc){_0x1cb2c5=_0x1cb2c5-0x0;var _0x1e373c=_0x5078[_0x1cb2c5];return _0x1e373c;};'use strict';var _=require(_0x8507('0x0'));var util=require(_0x8507('0x1'));var logger=require(_0x8507('0x2'))(_0x8507('0x3'));var moment=require(_0x8507('0x4'));var BPromise=require(_0x8507('0x5'));var rp=require(_0x8507('0x6'));var fs=require('fs');var path=require(_0x8507('0x7'));var rimraf=require(_0x8507('0x8'));var config=require(_0x8507('0x9'));var attributes=require(_0x8507('0xa'));module[_0x8507('0xb')]=function(_0x37519c,_0x5a359c){return _0x37519c[_0x8507('0xc')](_0x8507('0xd'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3f9=['SquareRecording','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0x252650,_0x59ae56){var _0x348e96=function(_0x10c47b){while(--_0x10c47b){_0x252650['push'](_0x252650['shift']());}};_0x348e96(++_0x59ae56);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x225bb5,_0xd426ca){_0x225bb5=_0x225bb5-0x0;var _0x24ed73=_0xb3f9[_0x225bb5];return _0x24ed73;};'use strict';var _=require(_0x9b3f('0x0'));var util=require(_0x9b3f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b3f('0x2'));var BPromise=require('bluebird');var rp=require(_0x9b3f('0x3'));var fs=require('fs');var path=require(_0x9b3f('0x4'));var rimraf=require(_0x9b3f('0x5'));var config=require(_0x9b3f('0x6'));var attributes=require(_0x9b3f('0x7'));module[_0x9b3f('0x8')]=function(_0x47dc65,_0x52889d){return _0x47dc65[_0x9b3f('0x9')](_0x9b3f('0xa'),attributes,{'tableName':'square_recordings','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 afc0f8b..4f78e2e 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 _0x1e9a=['code','message','catch','CreateSquareRecording','SquareRecording','create','body','options','then','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x52c3df,_0x5af86c){var _0x465728=function(_0x4abb5b){while(--_0x4abb5b){_0x52c3df['push'](_0x52c3df['shift']());}};_0x465728(++_0x5af86c);}(_0x1e9a,0x10d));var _0xa1e9=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x1e9a[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xa1e9('0x0'));var util=require('util');var moment=require(_0xa1e9('0x1'));var BPromise=require(_0xa1e9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1e9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa1e9('0x4'));var logger=require(_0xa1e9('0x5'))(_0xa1e9('0x6'));var config=require(_0xa1e9('0x7'));var jayson=require(_0xa1e9('0x8'));var client=jayson['client'][_0xa1e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43e45b,_0x22269d,_0x271751){return new BPromise(function(_0x581d77,_0x58b6e9){return client[_0xa1e9('0xa')](_0x43e45b,_0x271751)['then'](function(_0x1efd80){logger[_0xa1e9('0xb')](_0xa1e9('0xc'),_0x22269d,'request\x20sent');logger[_0xa1e9('0xd')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x22269d,_0xa1e9('0xe'),JSON[_0xa1e9('0xf')](_0x1efd80));if(_0x1efd80[_0xa1e9('0x10')]){if(_0x1efd80[_0xa1e9('0x10')][_0xa1e9('0x11')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x22269d,_0x1efd80[_0xa1e9('0x10')][_0xa1e9('0x12')]);return _0x58b6e9(_0x1efd80[_0xa1e9('0x10')][_0xa1e9('0x12')]);}logger['error'](_0xa1e9('0xc'),_0x22269d,_0x1efd80['error']['message']);return _0x581d77(_0x1efd80[_0xa1e9('0x10')][_0xa1e9('0x12')]);}else{logger[_0xa1e9('0xb')](_0xa1e9('0xc'),_0x22269d,_0xa1e9('0xe'));_0x581d77(_0x1efd80['result'][_0xa1e9('0x12')]);}})[_0xa1e9('0x13')](function(_0x110cb5){logger['error']('SquareRecording,\x20%s,\x20%s',_0x22269d,_0x110cb5);_0x58b6e9(_0x110cb5);});});}exports[_0xa1e9('0x14')]=function(_0x39764a){var _0x4dfbd0=this;return new Promise(function(_0x46280a,_0x2816a1){return db[_0xa1e9('0x15')][_0xa1e9('0x16')](_0x39764a[_0xa1e9('0x17')],{'raw':_0x39764a['options']?_0x39764a[_0xa1e9('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xa1e9('0x19')](function(_0x1c949e){logger['info'](_0xa1e9('0x14'),_0x39764a);logger['debug']('CreateSquareRecording',_0x39764a,JSON[_0xa1e9('0xf')](_0x1c949e));_0x46280a(_0x1c949e);})['catch'](function(_0x3d169f){logger[_0xa1e9('0x10')](_0xa1e9('0x14'),_0x3d169f[_0xa1e9('0x12')],_0x39764a);_0x2816a1(_0x4dfbd0['error'](0x1f4,_0x3d169f[_0xa1e9('0x12')]));});});}; \ No newline at end of file +var _0x506e=['raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','body','options'];(function(_0x523b92,_0x25d6b8){var _0x1a5e3b=function(_0x4e594e){while(--_0x4e594e){_0x523b92['push'](_0x523b92['shift']());}};_0x1a5e3b(++_0x25d6b8);}(_0x506e,0x17a));var _0xe506=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x506e[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xe506('0x0'));var util=require('util');var moment=require(_0xe506('0x1'));var BPromise=require(_0xe506('0x2'));var rs=require(_0xe506('0x3'));var fs=require('fs');var Redis=require(_0xe506('0x4'));var db=require(_0xe506('0x5'))['db'];var utils=require(_0xe506('0x6'));var logger=require(_0xe506('0x7'))(_0xe506('0x8'));var config=require(_0xe506('0x9'));var jayson=require(_0xe506('0xa'));var client=jayson[_0xe506('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2921bd,_0x1fecca,_0x22badd){return new BPromise(function(_0x2aac50,_0x1a0fa0){return client[_0xe506('0xc')](_0x2921bd,_0x22badd)[_0xe506('0xd')](function(_0x5a4b44){logger[_0xe506('0xe')]('SquareRecording,\x20%s,\x20%s',_0x1fecca,_0xe506('0xf'));logger[_0xe506('0x10')](_0xe506('0x11'),_0x1fecca,_0xe506('0xf'),JSON[_0xe506('0x12')](_0x5a4b44));if(_0x5a4b44[_0xe506('0x13')]){if(_0x5a4b44[_0xe506('0x13')]['code']===0x1f4){logger[_0xe506('0x13')](_0xe506('0x14'),_0x1fecca,_0x5a4b44[_0xe506('0x13')][_0xe506('0x15')]);return _0x1a0fa0(_0x5a4b44[_0xe506('0x13')]['message']);}logger[_0xe506('0x13')](_0xe506('0x14'),_0x1fecca,_0x5a4b44[_0xe506('0x13')][_0xe506('0x15')]);return _0x2aac50(_0x5a4b44['error'][_0xe506('0x15')]);}else{logger['info'](_0xe506('0x14'),_0x1fecca,_0xe506('0xf'));_0x2aac50(_0x5a4b44[_0xe506('0x16')][_0xe506('0x15')]);}})[_0xe506('0x17')](function(_0x4dce00){logger[_0xe506('0x13')]('SquareRecording,\x20%s,\x20%s',_0x1fecca,_0x4dce00);_0x1a0fa0(_0x4dce00);});});}exports[_0xe506('0x18')]=function(_0x1c1c8e){var _0x3f0bf3=this;return new Promise(function(_0xae8535,_0x46b3a9){return db[_0xe506('0x19')]['create'](_0x1c1c8e[_0xe506('0x1a')],{'raw':_0x1c1c8e[_0xe506('0x1b')]?_0x1c1c8e[_0xe506('0x1b')][_0xe506('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5312e2){logger[_0xe506('0xe')](_0xe506('0x18'),_0x1c1c8e);logger[_0xe506('0x10')](_0xe506('0x18'),_0x1c1c8e,JSON[_0xe506('0x12')](_0x5312e2));_0xae8535(_0x5312e2);})[_0xe506('0x17')](function(_0x518341){logger[_0xe506('0x13')]('CreateSquareRecording',_0x518341['message'],_0x1c1c8e);_0x46b3a9(_0x3f0bf3[_0xe506('0x13')](0x1f4,_0x518341['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 7003b3b..5943d40 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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x1abb0d,_0xcfeae9){var _0x26922b=function(_0x358d59){while(--_0x358d59){_0x1abb0d['push'](_0x1abb0d['shift']());}};_0x26922b(++_0xcfeae9);}(_0xe706,0xa3));var _0x6e70=function(_0x5abb9c,_0x32f2eb){_0x5abb9c=_0x5abb9c-0x0;var _0x33916e=_0xe706[_0x5abb9c];return _0x33916e;};'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('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 904bd97..3b4cf88 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 _0x1ddd=['sequelize','STRING','DATE','BOOLEAN'];(function(_0x3b348e,_0x858f31){var _0x32da63=function(_0x2344fa){while(--_0x2344fa){_0x3b348e['push'](_0x3b348e['shift']());}};_0x32da63(++_0x858f31);}(_0x1ddd,0x17c));var _0xd1dd=function(_0x3dfd99,_0x57c654){_0x3dfd99=_0x3dfd99-0x0;var _0x129b64=_0x1ddd[_0x3dfd99];return _0x129b64;};'use strict';var Sequelize=require(_0xd1dd('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xd1dd('0x1')]},'request':{'type':Sequelize[_0xd1dd('0x1')]},'channel':{'type':Sequelize[_0xd1dd('0x1')]},'language':{'type':Sequelize[_0xd1dd('0x1')]},'type':{'type':Sequelize[_0xd1dd('0x1')]},'uniqueid':{'type':Sequelize[_0xd1dd('0x1')]},'version':{'type':Sequelize[_0xd1dd('0x1')]},'callerid':{'type':Sequelize[_0xd1dd('0x1')]},'calleridname':{'type':Sequelize[_0xd1dd('0x1')]},'callingpres':{'type':Sequelize[_0xd1dd('0x1')]},'callingani2':{'type':Sequelize[_0xd1dd('0x1')]},'callington':{'type':Sequelize[_0xd1dd('0x1')]},'callingtns':{'type':Sequelize[_0xd1dd('0x1')]},'dnid':{'type':Sequelize[_0xd1dd('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd1dd('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd1dd('0x1')]},'threadid':{'type':Sequelize[_0xd1dd('0x1')]},'project_name':{'type':Sequelize[_0xd1dd('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd1dd('0x2')]},'bot':{'type':Sequelize[_0xd1dd('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x25a9=['BOOLEAN','exports','STRING','DATE'];(function(_0x161f03,_0x5d141b){var _0x2f396f=function(_0x2c1b7a){while(--_0x2c1b7a){_0x161f03['push'](_0x161f03['shift']());}};_0x2f396f(++_0x5d141b);}(_0x25a9,0xf1));var _0x925a=function(_0x16e1d5,_0x26b53b){_0x16e1d5=_0x16e1d5-0x0;var _0x534f2c=_0x25a9[_0x16e1d5];return _0x534f2c;};'use strict';var Sequelize=require('sequelize');module[_0x925a('0x0')]={'network':{'type':Sequelize[_0x925a('0x1')]},'network_script':{'type':Sequelize[_0x925a('0x1')]},'request':{'type':Sequelize[_0x925a('0x1')]},'channel':{'type':Sequelize[_0x925a('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x925a('0x1')]},'uniqueid':{'type':Sequelize[_0x925a('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x925a('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x925a('0x1')]},'callington':{'type':Sequelize[_0x925a('0x1')]},'callingtns':{'type':Sequelize[_0x925a('0x1')]},'dnid':{'type':Sequelize[_0x925a('0x1')]},'rdnis':{'type':Sequelize[_0x925a('0x1')]},'context':{'type':Sequelize[_0x925a('0x1')]},'extension':{'type':Sequelize[_0x925a('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x925a('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x925a('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x925a('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 d73647b..e12500f 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 _0xba36=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','offset','count','set','Content-Range','json','reject','update','destroy','error','stack','name','index','map','rawAttributes','fieldName','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','options','SquareReport','then','findAll','rows','catch','show','params','includeAll','include','create','body','find','describe','eml-format','rimraf'];(function(_0x4296b3,_0x58c241){var _0x146ad8=function(_0x2e5079){while(--_0x2e5079){_0x4296b3['push'](_0x4296b3['shift']());}};_0x146ad8(++_0x58c241);}(_0xba36,0x9a));var _0x6ba3=function(_0x11f4eb,_0x571183){_0x11f4eb=_0x11f4eb-0x0;var _0x4d9d23=_0xba36[_0x11f4eb];return _0x4d9d23;};'use strict';var emlformat=require(_0x6ba3('0x0'));var rimraf=require(_0x6ba3('0x1'));var zipdir=require(_0x6ba3('0x2'));var jsonpatch=require(_0x6ba3('0x3'));var rp=require(_0x6ba3('0x4'));var moment=require(_0x6ba3('0x5'));var BPromise=require(_0x6ba3('0x6'));var Mustache=require(_0x6ba3('0x7'));var util=require(_0x6ba3('0x8'));var path=require(_0x6ba3('0x9'));var sox=require(_0x6ba3('0xa'));var csv=require(_0x6ba3('0xb'));var ejs=require(_0x6ba3('0xc'));var fs=require('fs');var fs_extra=require(_0x6ba3('0xd'));var _=require(_0x6ba3('0xe'));var squel=require(_0x6ba3('0xf'));var crypto=require('crypto');var jsforce=require(_0x6ba3('0x10'));var deskjs=require(_0x6ba3('0x11'));var toCsv=require(_0x6ba3('0xb'));var querystring=require(_0x6ba3('0x12'));var Papa=require(_0x6ba3('0x13'));var Redis=require(_0x6ba3('0x14'));var authService=require(_0x6ba3('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x6ba3('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6ba3('0x17'));var utils=require(_0x6ba3('0x18'));var config=require(_0x6ba3('0x19'));var licenseUtil=require(_0x6ba3('0x1a'));var db=require(_0x6ba3('0x1b'))['db'];function respondWithStatusCode(_0x582325,_0x3a3009){_0x3a3009=_0x3a3009||0xcc;return function(_0x43efd8){if(_0x43efd8){return _0x582325['sendStatus'](_0x3a3009);}return _0x582325[_0x6ba3('0x1c')](_0x3a3009)[_0x6ba3('0x1d')]();};}function respondWithResult(_0x15c3a3,_0x5defa1){_0x5defa1=_0x5defa1||0xc8;return function(_0x5dc971){if(_0x5dc971){return _0x15c3a3[_0x6ba3('0x1c')](_0x5defa1)['json'](_0x5dc971);}};}function respondWithFilteredResult(_0x5e1f24,_0x20e55a){return function(_0x29a369){if(_0x29a369){var _0x94939b=typeof _0x20e55a['offset']===_0x6ba3('0x1e')&&typeof _0x20e55a[_0x6ba3('0x1f')]==='undefined';var _0x52de1a=_0x29a369['count'];var _0x48db2a=_0x94939b?0x0:_0x20e55a[_0x6ba3('0x20')];var _0x4547ca=_0x94939b?_0x29a369[_0x6ba3('0x21')]:_0x20e55a[_0x6ba3('0x20')]+_0x20e55a['limit'];var _0x2cc93c;if(_0x4547ca>=_0x52de1a){_0x4547ca=_0x52de1a;_0x2cc93c=0xc8;}else{_0x2cc93c=0xce;}_0x5e1f24[_0x6ba3('0x1c')](_0x2cc93c);return _0x5e1f24[_0x6ba3('0x22')](_0x6ba3('0x23'),_0x48db2a+'-'+_0x4547ca+'/'+_0x52de1a)[_0x6ba3('0x24')](_0x29a369);}return null;};}function patchUpdates(_0xd08d8f){return function(_0x263cfb){try{jsonpatch['apply'](_0x263cfb,_0xd08d8f,!![]);}catch(_0x4f17c9){return BPromise[_0x6ba3('0x25')](_0x4f17c9);}return _0x263cfb['save']();};}function saveUpdates(_0x454d4f,_0x2d4c6f){return function(_0x143024){if(_0x143024){return _0x143024[_0x6ba3('0x26')](_0x454d4f)['then'](function(_0x15e0a9){return _0x15e0a9;});}return null;};}function removeEntity(_0x534617,_0x4265c0){return function(_0x309a39){if(_0x309a39){return _0x309a39[_0x6ba3('0x27')]()['then'](function(){_0x534617['status'](0xcc)[_0x6ba3('0x1d')]();});}};}function handleEntityNotFound(_0x3ad055,_0x18212f){return function(_0x385b9d){if(!_0x385b9d){_0x3ad055['sendStatus'](0x194);}return _0x385b9d;};}function handleError(_0x3fa427,_0x2f2ddc){_0x2f2ddc=_0x2f2ddc||0x1f4;return function(_0x20c8b3){logger[_0x6ba3('0x28')](_0x20c8b3[_0x6ba3('0x29')]);if(_0x20c8b3[_0x6ba3('0x2a')]){delete _0x20c8b3['name'];}_0x3fa427['status'](_0x2f2ddc)['send'](_0x20c8b3);};}exports[_0x6ba3('0x2b')]=function(_0x1e229a,_0x2f4eca){var _0x344c39={},_0x276d62={},_0x15dfe5={'count':0x0,'rows':[]};var _0x5cb214=_[_0x6ba3('0x2c')](db['SquareReport'][_0x6ba3('0x2d')],function(_0x392a1f){return{'name':_0x392a1f[_0x6ba3('0x2e')],'type':_0x392a1f['type']['key']};});_0x276d62['model']=_[_0x6ba3('0x2c')](_0x5cb214,_0x6ba3('0x2a'));_0x276d62[_0x6ba3('0x2f')]=_[_0x6ba3('0x30')](_0x1e229a['query']);_0x276d62['filters']=_[_0x6ba3('0x31')](_0x276d62[_0x6ba3('0x32')],_0x276d62[_0x6ba3('0x2f')]);_0x344c39['attributes']=_[_0x6ba3('0x31')](_0x276d62['model'],qs['fields'](_0x1e229a[_0x6ba3('0x2f')][_0x6ba3('0x33')]));_0x344c39[_0x6ba3('0x34')]=_0x344c39[_0x6ba3('0x34')][_0x6ba3('0x35')]?_0x344c39[_0x6ba3('0x34')]:_0x276d62[_0x6ba3('0x32')];if(!_0x1e229a[_0x6ba3('0x2f')][_0x6ba3('0x36')](_0x6ba3('0x37'))){_0x344c39['limit']=qs[_0x6ba3('0x1f')](_0x1e229a[_0x6ba3('0x2f')][_0x6ba3('0x1f')]);_0x344c39[_0x6ba3('0x20')]=qs[_0x6ba3('0x20')](_0x1e229a[_0x6ba3('0x2f')][_0x6ba3('0x20')]);}_0x344c39[_0x6ba3('0x38')]=qs[_0x6ba3('0x39')](_0x1e229a[_0x6ba3('0x2f')][_0x6ba3('0x39')]);_0x344c39['where']=qs[_0x6ba3('0x3a')](_[_0x6ba3('0x3b')](_0x1e229a[_0x6ba3('0x2f')],_0x276d62[_0x6ba3('0x3a')]),_0x5cb214);if(_0x1e229a['query'][_0x6ba3('0x3c')]){_0x344c39['where']=_[_0x6ba3('0x3d')](_0x344c39[_0x6ba3('0x3e')],{'$or':_['map'](_0x5cb214,function(_0x3f09bc){if(_0x3f09bc[_0x6ba3('0x3f')]!=='VIRTUAL'){var _0x2da12e={};_0x2da12e[_0x3f09bc['name']]={'$like':'%'+_0x1e229a[_0x6ba3('0x2f')][_0x6ba3('0x3c')]+'%'};return _0x2da12e;}})});}_0x344c39=_[_0x6ba3('0x3d')]({},_0x344c39,_0x1e229a[_0x6ba3('0x40')]);var _0x199e32={'where':_0x344c39['where']};return db[_0x6ba3('0x41')][_0x6ba3('0x21')](_0x199e32)[_0x6ba3('0x42')](function(_0x38c4cd){_0x15dfe5[_0x6ba3('0x21')]=_0x38c4cd;if(_0x1e229a['query']['includeAll']){_0x344c39['include']=[{'all':!![]}];}return db['SquareReport'][_0x6ba3('0x43')](_0x344c39);})[_0x6ba3('0x42')](function(_0xf51008){_0x15dfe5[_0x6ba3('0x44')]=_0xf51008;return _0x15dfe5;})[_0x6ba3('0x42')](respondWithFilteredResult(_0x2f4eca,_0x344c39))[_0x6ba3('0x45')](handleError(_0x2f4eca,null));};exports[_0x6ba3('0x46')]=function(_0x509607,_0x358587){var _0x57efef={'raw':!![],'where':{'id':_0x509607[_0x6ba3('0x47')]['id']}},_0x25306e={};_0x25306e[_0x6ba3('0x32')]=_[_0x6ba3('0x30')](db[_0x6ba3('0x41')][_0x6ba3('0x2d')]);_0x25306e[_0x6ba3('0x2f')]=_[_0x6ba3('0x30')](_0x509607['query']);_0x25306e[_0x6ba3('0x3a')]=_[_0x6ba3('0x31')](_0x25306e[_0x6ba3('0x32')],_0x25306e[_0x6ba3('0x2f')]);_0x57efef[_0x6ba3('0x34')]=_[_0x6ba3('0x31')](_0x25306e[_0x6ba3('0x32')],qs[_0x6ba3('0x33')](_0x509607['query']['fields']));_0x57efef['attributes']=_0x57efef['attributes'][_0x6ba3('0x35')]?_0x57efef[_0x6ba3('0x34')]:_0x25306e['model'];if(_0x509607[_0x6ba3('0x2f')][_0x6ba3('0x48')]){_0x57efef[_0x6ba3('0x49')]=[{'all':!![]}];}_0x57efef=_[_0x6ba3('0x3d')]({},_0x57efef,_0x509607[_0x6ba3('0x40')]);return db[_0x6ba3('0x41')]['find'](_0x57efef)['then'](handleEntityNotFound(_0x358587,null))['then'](respondWithResult(_0x358587,null))[_0x6ba3('0x45')](handleError(_0x358587,null));};exports['create']=function(_0x1d9273,_0x5a4496){return db['SquareReport'][_0x6ba3('0x4a')](_0x1d9273[_0x6ba3('0x4b')],{})[_0x6ba3('0x42')](respondWithResult(_0x5a4496,0xc9))['catch'](handleError(_0x5a4496,null));};exports['update']=function(_0x53c553,_0x42e8d4){if(_0x53c553[_0x6ba3('0x4b')]['id']){delete _0x53c553[_0x6ba3('0x4b')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x53c553[_0x6ba3('0x47')]['id']}})['then'](handleEntityNotFound(_0x42e8d4,null))[_0x6ba3('0x42')](saveUpdates(_0x53c553[_0x6ba3('0x4b')],null))['then'](respondWithResult(_0x42e8d4,null))['catch'](handleError(_0x42e8d4,null));};exports['destroy']=function(_0x24f093,_0x327889){return db[_0x6ba3('0x41')][_0x6ba3('0x4c')]({'where':{'id':_0x24f093['params']['id']}})[_0x6ba3('0x42')](handleEntityNotFound(_0x327889,null))[_0x6ba3('0x42')](removeEntity(_0x327889,null))[_0x6ba3('0x45')](handleError(_0x327889,null));};exports[_0x6ba3('0x4d')]=function(_0x12e8bf,_0x13f02d){return db[_0x6ba3('0x41')][_0x6ba3('0x4d')]()[_0x6ba3('0x42')](respondWithResult(_0x13f02d,null))[_0x6ba3('0x45')](handleError(_0x13f02d,null));}; \ No newline at end of file +var _0x0fb3=['../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','error','send','index','SquareReport','rawAttributes','type','map','query','filters','model','fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','name','options','includeAll','findAll','rows','catch','show','params','intersection','include','merge','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3b3060,_0x1cfbe9){var _0x14d7af=function(_0x1fb59f){while(--_0x1fb59f){_0x3b3060['push'](_0x3b3060['shift']());}};_0x14d7af(++_0x1cfbe9);}(_0x0fb3,0x1d6));var _0x30fb=function(_0x35db34,_0x188dd2){_0x35db34=_0x35db34-0x0;var _0x246fed=_0x0fb3[_0x35db34];return _0x246fed;};'use strict';var emlformat=require(_0x30fb('0x0'));var rimraf=require(_0x30fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x30fb('0x2'));var rp=require(_0x30fb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x30fb('0x4'));var util=require(_0x30fb('0x5'));var path=require(_0x30fb('0x6'));var sox=require(_0x30fb('0x7'));var csv=require(_0x30fb('0x8'));var ejs=require(_0x30fb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30fb('0xa'));var squel=require(_0x30fb('0xb'));var crypto=require(_0x30fb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x30fb('0xd'));var toCsv=require(_0x30fb('0x8'));var querystring=require(_0x30fb('0xe'));var Papa=require(_0x30fb('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x30fb('0x10'));var as=require(_0x30fb('0x11'));var hardwareService=require(_0x30fb('0x12'));var logger=require(_0x30fb('0x13'))('api');var utils=require(_0x30fb('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x30fb('0x15'))['db'];function respondWithStatusCode(_0x217159,_0x9c342f){_0x9c342f=_0x9c342f||0xcc;return function(_0x5b5d29){if(_0x5b5d29){return _0x217159[_0x30fb('0x16')](_0x9c342f);}return _0x217159[_0x30fb('0x17')](_0x9c342f)[_0x30fb('0x18')]();};}function respondWithResult(_0x11ae8d,_0x35271d){_0x35271d=_0x35271d||0xc8;return function(_0x1e153c){if(_0x1e153c){return _0x11ae8d[_0x30fb('0x17')](_0x35271d)[_0x30fb('0x19')](_0x1e153c);}};}function respondWithFilteredResult(_0x4cc402,_0x82c52d){return function(_0x4716ff){if(_0x4716ff){var _0x488e4a=typeof _0x82c52d[_0x30fb('0x1a')]==='undefined'&&typeof _0x82c52d[_0x30fb('0x1b')]===_0x30fb('0x1c');var _0x10e220=_0x4716ff[_0x30fb('0x1d')];var _0x3427b6=_0x488e4a?0x0:_0x82c52d[_0x30fb('0x1a')];var _0x43263e=_0x488e4a?_0x4716ff[_0x30fb('0x1d')]:_0x82c52d[_0x30fb('0x1a')]+_0x82c52d['limit'];var _0x4abe85;if(_0x43263e>=_0x10e220){_0x43263e=_0x10e220;_0x4abe85=0xc8;}else{_0x4abe85=0xce;}_0x4cc402['status'](_0x4abe85);return _0x4cc402[_0x30fb('0x1e')](_0x30fb('0x1f'),_0x3427b6+'-'+_0x43263e+'/'+_0x10e220)[_0x30fb('0x19')](_0x4716ff);}return null;};}function patchUpdates(_0x26b2d9){return function(_0x309bec){try{jsonpatch['apply'](_0x309bec,_0x26b2d9,!![]);}catch(_0x40bed5){return BPromise[_0x30fb('0x20')](_0x40bed5);}return _0x309bec['save']();};}function saveUpdates(_0x111a77,_0x42fdc4){return function(_0x340ec2){if(_0x340ec2){return _0x340ec2[_0x30fb('0x21')](_0x111a77)[_0x30fb('0x22')](function(_0x4feea7){return _0x4feea7;});}return null;};}function removeEntity(_0x325fbd,_0x22ac90){return function(_0x2a115f){if(_0x2a115f){return _0x2a115f[_0x30fb('0x23')]()[_0x30fb('0x22')](function(){_0x325fbd[_0x30fb('0x17')](0xcc)[_0x30fb('0x18')]();});}};}function handleEntityNotFound(_0x1ae45c,_0x48fef3){return function(_0x12249c){if(!_0x12249c){_0x1ae45c['sendStatus'](0x194);}return _0x12249c;};}function handleError(_0x429289,_0x113ef8){_0x113ef8=_0x113ef8||0x1f4;return function(_0x1ddece){logger[_0x30fb('0x24')](_0x1ddece['stack']);if(_0x1ddece['name']){delete _0x1ddece['name'];}_0x429289[_0x30fb('0x17')](_0x113ef8)[_0x30fb('0x25')](_0x1ddece);};}exports[_0x30fb('0x26')]=function(_0x2bfd16,_0x5f5355){var _0xbf578={},_0x253b61={},_0x1d84a1={'count':0x0,'rows':[]};var _0x26b705=_['map'](db[_0x30fb('0x27')][_0x30fb('0x28')],function(_0x237737){return{'name':_0x237737['fieldName'],'type':_0x237737[_0x30fb('0x29')]['key']};});_0x253b61['model']=_[_0x30fb('0x2a')](_0x26b705,'name');_0x253b61[_0x30fb('0x2b')]=_['keys'](_0x2bfd16[_0x30fb('0x2b')]);_0x253b61[_0x30fb('0x2c')]=_['intersection'](_0x253b61[_0x30fb('0x2d')],_0x253b61[_0x30fb('0x2b')]);_0xbf578['attributes']=_['intersection'](_0x253b61[_0x30fb('0x2d')],qs[_0x30fb('0x2e')](_0x2bfd16['query']['fields']));_0xbf578['attributes']=_0xbf578[_0x30fb('0x2f')][_0x30fb('0x30')]?_0xbf578[_0x30fb('0x2f')]:_0x253b61[_0x30fb('0x2d')];if(!_0x2bfd16['query']['hasOwnProperty'](_0x30fb('0x31'))){_0xbf578[_0x30fb('0x1b')]=qs[_0x30fb('0x1b')](_0x2bfd16[_0x30fb('0x2b')]['limit']);_0xbf578['offset']=qs[_0x30fb('0x1a')](_0x2bfd16['query'][_0x30fb('0x1a')]);}_0xbf578[_0x30fb('0x32')]=qs[_0x30fb('0x33')](_0x2bfd16['query'][_0x30fb('0x33')]);_0xbf578[_0x30fb('0x34')]=qs[_0x30fb('0x2c')](_['pick'](_0x2bfd16[_0x30fb('0x2b')],_0x253b61[_0x30fb('0x2c')]),_0x26b705);if(_0x2bfd16['query'][_0x30fb('0x35')]){_0xbf578['where']=_['merge'](_0xbf578[_0x30fb('0x34')],{'$or':_['map'](_0x26b705,function(_0x566dbb){if(_0x566dbb['type']!==_0x30fb('0x36')){var _0x44203b={};_0x44203b[_0x566dbb[_0x30fb('0x37')]]={'$like':'%'+_0x2bfd16['query'][_0x30fb('0x35')]+'%'};return _0x44203b;}})});}_0xbf578=_['merge']({},_0xbf578,_0x2bfd16[_0x30fb('0x38')]);var _0x5195b9={'where':_0xbf578['where']};return db['SquareReport'][_0x30fb('0x1d')](_0x5195b9)['then'](function(_0x38d392){_0x1d84a1['count']=_0x38d392;if(_0x2bfd16[_0x30fb('0x2b')][_0x30fb('0x39')]){_0xbf578['include']=[{'all':!![]}];}return db[_0x30fb('0x27')][_0x30fb('0x3a')](_0xbf578);})['then'](function(_0x502a1f){_0x1d84a1[_0x30fb('0x3b')]=_0x502a1f;return _0x1d84a1;})[_0x30fb('0x22')](respondWithFilteredResult(_0x5f5355,_0xbf578))[_0x30fb('0x3c')](handleError(_0x5f5355,null));};exports[_0x30fb('0x3d')]=function(_0x3f9fec,_0x347878){var _0x58336b={'raw':!![],'where':{'id':_0x3f9fec[_0x30fb('0x3e')]['id']}},_0x5073d3={};_0x5073d3[_0x30fb('0x2d')]=_['keys'](db[_0x30fb('0x27')][_0x30fb('0x28')]);_0x5073d3[_0x30fb('0x2b')]=_['keys'](_0x3f9fec[_0x30fb('0x2b')]);_0x5073d3[_0x30fb('0x2c')]=_[_0x30fb('0x3f')](_0x5073d3[_0x30fb('0x2d')],_0x5073d3[_0x30fb('0x2b')]);_0x58336b['attributes']=_[_0x30fb('0x3f')](_0x5073d3[_0x30fb('0x2d')],qs['fields'](_0x3f9fec['query'][_0x30fb('0x2e')]));_0x58336b[_0x30fb('0x2f')]=_0x58336b[_0x30fb('0x2f')][_0x30fb('0x30')]?_0x58336b[_0x30fb('0x2f')]:_0x5073d3[_0x30fb('0x2d')];if(_0x3f9fec[_0x30fb('0x2b')][_0x30fb('0x39')]){_0x58336b[_0x30fb('0x40')]=[{'all':!![]}];}_0x58336b=_[_0x30fb('0x41')]({},_0x58336b,_0x3f9fec['options']);return db[_0x30fb('0x27')][_0x30fb('0x42')](_0x58336b)['then'](handleEntityNotFound(_0x347878,null))[_0x30fb('0x22')](respondWithResult(_0x347878,null))[_0x30fb('0x3c')](handleError(_0x347878,null));};exports[_0x30fb('0x43')]=function(_0x30638b,_0x4eac7a){return db['SquareReport'][_0x30fb('0x43')](_0x30638b['body'],{})[_0x30fb('0x22')](respondWithResult(_0x4eac7a,0xc9))['catch'](handleError(_0x4eac7a,null));};exports['update']=function(_0x4040ea,_0x11bbf){if(_0x4040ea[_0x30fb('0x44')]['id']){delete _0x4040ea[_0x30fb('0x44')]['id'];}return db[_0x30fb('0x27')][_0x30fb('0x42')]({'where':{'id':_0x4040ea[_0x30fb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x11bbf,null))['then'](saveUpdates(_0x4040ea['body'],null))[_0x30fb('0x22')](respondWithResult(_0x11bbf,null))['catch'](handleError(_0x11bbf,null));};exports['destroy']=function(_0x15763e,_0x39a34a){return db[_0x30fb('0x27')]['find']({'where':{'id':_0x15763e[_0x30fb('0x3e')]['id']}})[_0x30fb('0x22')](handleEntityNotFound(_0x39a34a,null))['then'](removeEntity(_0x39a34a,null))[_0x30fb('0x3c')](handleError(_0x39a34a,null));};exports[_0x30fb('0x45')]=function(_0x508f22,_0x2e0114){return db[_0x30fb('0x27')][_0x30fb('0x45')]()[_0x30fb('0x22')](respondWithResult(_0x2e0114,null))['catch'](handleError(_0x2e0114,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 1c2311a..0cb79ad 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 _0x47bd=['util','../../config/logger','api','moment','bluebird','request-promise','path','./squareReport.attributes','exports','SquareReport','uniqueid','project_name','lodash'];(function(_0x4908e3,_0x53cafc){var _0x4bc493=function(_0x5f3eea){while(--_0x5f3eea){_0x4908e3['push'](_0x4908e3['shift']());}};_0x4bc493(++_0x53cafc);}(_0x47bd,0x1ed));var _0xd47b=function(_0x2e0259,_0x29e334){_0x2e0259=_0x2e0259-0x0;var _0x10a8d=_0x47bd[_0x2e0259];return _0x10a8d;};'use strict';var _=require(_0xd47b('0x0'));var util=require(_0xd47b('0x1'));var logger=require(_0xd47b('0x2'))(_0xd47b('0x3'));var moment=require(_0xd47b('0x4'));var BPromise=require(_0xd47b('0x5'));var rp=require(_0xd47b('0x6'));var fs=require('fs');var path=require(_0xd47b('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd47b('0x8'));module[_0xd47b('0x9')]=function(_0x53f8d2,_0x4c6485){return _0x53f8d2['define'](_0xd47b('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xd47b('0xb'),_0xd47b('0xc')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x210b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x210b,0xcf));var _0xb210=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0x210b[_0x1385dc];return _0x2f6469;};'use strict';var _=require('lodash');var util=require(_0xb210('0x0'));var logger=require(_0xb210('0x1'))(_0xb210('0x2'));var moment=require(_0xb210('0x3'));var BPromise=require(_0xb210('0x4'));var rp=require(_0xb210('0x5'));var fs=require('fs');var path=require(_0xb210('0x6'));var rimraf=require(_0xb210('0x7'));var config=require(_0xb210('0x8'));var attributes=require('./squareReport.attributes');module[_0xb210('0x9')]=function(_0x4c50af,_0x2367bc){return _0x4c50af[_0xb210('0xa')](_0xb210('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xb210('0xc'),'fields':[_0xb210('0xd'),_0xb210('0xe')]},{'name':_0xb210('0xf'),'fields':[_0xb210('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 6834b7b..7b15ccb 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 _0x2318=['../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','options','UpdateSquareReport','update','raw','where','attributes','limit','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x32f26d,_0x2c0b5d){var _0x5d9ddc=function(_0x1f0e26){while(--_0x1f0e26){_0x32f26d['push'](_0x32f26d['shift']());}};_0x5d9ddc(++_0x2c0b5d);}(_0x2318,0x1c7));var _0x8231=function(_0x470b3a,_0x21f296){_0x470b3a=_0x470b3a-0x0;var _0x17088a=_0x2318[_0x470b3a];return _0x17088a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8231('0x0'));var rs=require(_0x8231('0x1'));var fs=require('fs');var Redis=require(_0x8231('0x2'));var db=require(_0x8231('0x3'))['db'];var utils=require(_0x8231('0x4'));var logger=require(_0x8231('0x5'))(_0x8231('0x6'));var config=require(_0x8231('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8231('0x8')][_0x8231('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9f6280,_0x4f2d4d,_0x399e8f){return new BPromise(function(_0x3507a3,_0x1a7ac9){return client[_0x8231('0xa')](_0x9f6280,_0x399e8f)[_0x8231('0xb')](function(_0x219379){logger[_0x8231('0xc')](_0x8231('0xd'),_0x4f2d4d,_0x8231('0xe'));logger[_0x8231('0xf')](_0x8231('0x10'),_0x4f2d4d,_0x8231('0xe'),JSON[_0x8231('0x11')](_0x219379));if(_0x219379[_0x8231('0x12')]){if(_0x219379[_0x8231('0x12')][_0x8231('0x13')]===0x1f4){logger['error'](_0x8231('0xd'),_0x4f2d4d,_0x219379[_0x8231('0x12')][_0x8231('0x14')]);return _0x1a7ac9(_0x219379['error'][_0x8231('0x14')]);}logger[_0x8231('0x12')](_0x8231('0xd'),_0x4f2d4d,_0x219379['error'][_0x8231('0x14')]);return _0x3507a3(_0x219379[_0x8231('0x12')][_0x8231('0x14')]);}else{logger[_0x8231('0xc')]('SquareReport,\x20%s,\x20%s',_0x4f2d4d,_0x8231('0xe'));_0x3507a3(_0x219379[_0x8231('0x15')]['message']);}})[_0x8231('0x16')](function(_0x1fb214){logger[_0x8231('0x12')](_0x8231('0xd'),_0x4f2d4d,_0x1fb214);_0x1a7ac9(_0x1fb214);});});}exports[_0x8231('0x17')]=function(_0x510f47){var _0x52d4b7=this;return new Promise(function(_0x3f5e07,_0x51c563){return db[_0x8231('0x18')][_0x8231('0x19')](_0x510f47['body'],{'raw':_0x510f47[_0x8231('0x1a')]?_0x510f47[_0x8231('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x8231('0xb')](function(_0xb678e7){logger['info'](_0x8231('0x17'),_0x510f47);logger[_0x8231('0xf')](_0x8231('0x17'),_0x510f47,JSON[_0x8231('0x11')](_0xb678e7));_0x3f5e07(_0xb678e7);})[_0x8231('0x16')](function(_0x305b24){logger[_0x8231('0x12')](_0x8231('0x17'),_0x305b24[_0x8231('0x14')],_0x510f47);_0x51c563(_0x52d4b7['error'](0x1f4,_0x305b24[_0x8231('0x14')]));});});};exports[_0x8231('0x1b')]=function(_0x2cf164){var _0x2998a8=this;return new Promise(function(_0x381f45,_0x19148e){return db['SquareReport'][_0x8231('0x1c')](_0x2cf164['body'],{'raw':_0x2cf164[_0x8231('0x1a')]?_0x2cf164[_0x8231('0x1a')][_0x8231('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cf164['options']?_0x2cf164[_0x8231('0x1a')][_0x8231('0x1e')]||null:null,'attributes':_0x2cf164[_0x8231('0x1a')]?_0x2cf164['options'][_0x8231('0x1f')]||null:null,'limit':_0x2cf164[_0x8231('0x1a')]?_0x2cf164['options'][_0x8231('0x20')]||null:null})[_0x8231('0xb')](function(_0x4f9a3c){logger['info'](_0x8231('0x1b'),_0x2cf164);logger[_0x8231('0xf')](_0x8231('0x1b'),_0x2cf164,JSON['stringify'](_0x4f9a3c));_0x381f45(_0x4f9a3c);})[_0x8231('0x16')](function(_0x1a2057){logger['error']('UpdateSquareReport',_0x1a2057[_0x8231('0x14')],_0x2cf164);_0x19148e(_0x2998a8[_0x8231('0x12')](0x1f4,_0x1a2057[_0x8231('0x14')]));});});}; \ No newline at end of file +var _0x544e=['SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareReport','SquareReport','body','options','raw','then','UpdateSquareReport','update','where','attributes','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x2c3a47,_0x170687){var _0x1c04de=function(_0x367deb){while(--_0x367deb){_0x2c3a47['push'](_0x2c3a47['shift']());}};_0x1c04de(++_0x170687);}(_0x544e,0x120));var _0xe544=function(_0x5c1d56,_0x5b0d29){_0x5c1d56=_0x5c1d56-0x0;var _0x2b00be=_0x544e[_0x5c1d56];return _0x2b00be;};'use strict';var _=require(_0xe544('0x0'));var util=require('util');var moment=require(_0xe544('0x1'));var BPromise=require('bluebird');var rs=require(_0xe544('0x2'));var fs=require('fs');var Redis=require(_0xe544('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe544('0x4'));var logger=require(_0xe544('0x5'))(_0xe544('0x6'));var config=require(_0xe544('0x7'));var jayson=require(_0xe544('0x8'));var client=jayson[_0xe544('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa7f181,_0x485b79,_0x1b32df){return new BPromise(function(_0x4da0d6,_0x3154bb){return client[_0xe544('0xa')](_0xa7f181,_0x1b32df)['then'](function(_0x54c58f){logger[_0xe544('0xb')](_0xe544('0xc'),_0x485b79,_0xe544('0xd'));logger[_0xe544('0xe')](_0xe544('0xf'),_0x485b79,_0xe544('0xd'),JSON[_0xe544('0x10')](_0x54c58f));if(_0x54c58f[_0xe544('0x11')]){if(_0x54c58f['error']['code']===0x1f4){logger[_0xe544('0x11')](_0xe544('0xc'),_0x485b79,_0x54c58f[_0xe544('0x11')]['message']);return _0x3154bb(_0x54c58f['error'][_0xe544('0x12')]);}logger['error'](_0xe544('0xc'),_0x485b79,_0x54c58f[_0xe544('0x11')][_0xe544('0x12')]);return _0x4da0d6(_0x54c58f[_0xe544('0x11')]['message']);}else{logger['info'](_0xe544('0xc'),_0x485b79,_0xe544('0xd'));_0x4da0d6(_0x54c58f['result'][_0xe544('0x12')]);}})[_0xe544('0x13')](function(_0x3a0128){logger[_0xe544('0x11')](_0xe544('0xc'),_0x485b79,_0x3a0128);_0x3154bb(_0x3a0128);});});}exports[_0xe544('0x14')]=function(_0x3ddbfa){var _0x41eb6a=this;return new Promise(function(_0x530357,_0x82c670){return db[_0xe544('0x15')]['create'](_0x3ddbfa[_0xe544('0x16')],{'raw':_0x3ddbfa['options']?_0x3ddbfa[_0xe544('0x17')][_0xe544('0x18')]===undefined?!![]:![]:!![]})[_0xe544('0x19')](function(_0x31c2f4){logger[_0xe544('0xb')](_0xe544('0x14'),_0x3ddbfa);logger[_0xe544('0xe')](_0xe544('0x14'),_0x3ddbfa,JSON[_0xe544('0x10')](_0x31c2f4));_0x530357(_0x31c2f4);})[_0xe544('0x13')](function(_0x165bcd){logger['error'](_0xe544('0x14'),_0x165bcd[_0xe544('0x12')],_0x3ddbfa);_0x82c670(_0x41eb6a['error'](0x1f4,_0x165bcd[_0xe544('0x12')]));});});};exports[_0xe544('0x1a')]=function(_0x152e42){var _0xc47aa7=this;return new Promise(function(_0x5c1198,_0x19ca83){return db[_0xe544('0x15')][_0xe544('0x1b')](_0x152e42[_0xe544('0x16')],{'raw':_0x152e42['options']?_0x152e42[_0xe544('0x17')][_0xe544('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x152e42[_0xe544('0x17')]?_0x152e42[_0xe544('0x17')][_0xe544('0x1c')]||null:null,'attributes':_0x152e42[_0xe544('0x17')]?_0x152e42[_0xe544('0x17')][_0xe544('0x1d')]||null:null,'limit':_0x152e42[_0xe544('0x17')]?_0x152e42[_0xe544('0x17')]['limit']||null:null})['then'](function(_0x3bd19e){logger[_0xe544('0xb')](_0xe544('0x1a'),_0x152e42);logger[_0xe544('0xe')](_0xe544('0x1a'),_0x152e42,JSON['stringify'](_0x3bd19e));_0x5c1198(_0x3bd19e);})['catch'](function(_0x28e43a){logger['error'](_0xe544('0x1a'),_0x28e43a[_0xe544('0x12')],_0x152e42);_0x19ca83(_0xc47aa7[_0xe544('0x11')](0x1f4,_0x28e43a[_0xe544('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 7f19585..251d2b6 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 _0x8497=['multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','describe','/:id','post','create','put','delete'];(function(_0x5334cc,_0x60099c){var _0x5b5f72=function(_0x3f7b2e){while(--_0x3f7b2e){_0x5334cc['push'](_0x5334cc['shift']());}};_0x5b5f72(++_0x60099c);}(_0x8497,0x1d1));var _0x7849=function(_0x103e00,_0xaf38d6){_0x103e00=_0x103e00-0x0;var _0x5eeeac=_0x8497[_0x103e00];return _0x5eeeac;};'use strict';var multer=require(_0x7849('0x0'));var util=require(_0x7849('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7849('0x2'));var auth=require(_0x7849('0x3'));var interaction=require(_0x7849('0x4'));var config=require(_0x7849('0x5'));var controller=require(_0x7849('0x6'));router[_0x7849('0x7')]('/',auth[_0x7849('0x8')](),controller['index']);router[_0x7849('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x7849('0x9')]);router[_0x7849('0x7')](_0x7849('0xa'),auth[_0x7849('0x8')](),controller['show']);router[_0x7849('0xb')]('/',auth[_0x7849('0x8')](),controller[_0x7849('0xc')]);router[_0x7849('0xd')](_0x7849('0xa'),auth[_0x7849('0x8')](),controller['update']);router[_0x7849('0xe')]('/:id',auth[_0x7849('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xebdc=['../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xebdc,0x80));var _0xcebd=function(_0x274d58,_0x248658){_0x274d58=_0x274d58-0x0;var _0xe2c5ad=_0xebdc[_0x274d58];return _0xe2c5ad;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcebd('0x0'));var timeout=require(_0xcebd('0x1'));var express=require(_0xcebd('0x2'));var router=express[_0xcebd('0x3')]();var fs_extra=require(_0xcebd('0x4'));var auth=require(_0xcebd('0x5'));var interaction=require(_0xcebd('0x6'));var config=require('../../config/environment');var controller=require(_0xcebd('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xcebd('0x8')](_0xcebd('0x9'),auth[_0xcebd('0xa')](),controller[_0xcebd('0xb')]);router[_0xcebd('0x8')](_0xcebd('0xc'),auth['isAuthenticated'](),controller[_0xcebd('0xd')]);router[_0xcebd('0xe')]('/',auth[_0xcebd('0xa')](),controller[_0xcebd('0xf')]);router[_0xcebd('0x10')](_0xcebd('0xc'),auth[_0xcebd('0xa')](),controller[_0xcebd('0x11')]);router['delete'](_0xcebd('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xcebd('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index db4b508..8442671 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 _0xffba=['STRING','sequelize'];(function(_0x2f26a8,_0x1716d8){var _0x17edd1=function(_0x14e090){while(--_0x14e090){_0x2f26a8['push'](_0x2f26a8['shift']());}};_0x17edd1(++_0x1716d8);}(_0xffba,0x1c3));var _0xaffb=function(_0x434a01,_0x17b4d2){_0x434a01=_0x434a01-0x0;var _0x186950=_0xffba[_0x434a01];return _0x186950;};'use strict';var Sequelize=require(_0xaffb('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xaffb('0x1')]},'application':{'type':Sequelize[_0xaffb('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaffb('0x1')]}}; \ No newline at end of file +var _0x01d5=['STRING','sequelize','exports'];(function(_0x12d26d,_0x11ac1f){var _0x448a42=function(_0x503c15){while(--_0x503c15){_0x12d26d['push'](_0x12d26d['shift']());}};_0x448a42(++_0x11ac1f);}(_0x01d5,0x10f));var _0x501d=function(_0x389fc3,_0x35ccd8){_0x389fc3=_0x389fc3-0x0;var _0x2236df=_0x01d5[_0x389fc3];return _0x2236df;};'use strict';var Sequelize=require(_0x501d('0x0'));module[_0x501d('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x501d('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x501d('0x2')]},'callerid':{'type':Sequelize[_0x501d('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 602f14d..22e631a 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 _0x70ff=['offset','set','Content-Range','apply','reject','update','then','destroy','error','name','send','SquareDetailsReport','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','intersection','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count'];(function(_0x30e65f,_0x45c2c8){var _0x38354c=function(_0x577a0d){while(--_0x577a0d){_0x30e65f['push'](_0x30e65f['shift']());}};_0x38354c(++_0x45c2c8);}(_0x70ff,0xaf));var _0xf70f=function(_0x3adc9f,_0x5d49d5){_0x3adc9f=_0x3adc9f-0x0;var _0x432a40=_0x70ff[_0x3adc9f];return _0x432a40;};'use strict';var emlformat=require(_0xf70f('0x0'));var rimraf=require(_0xf70f('0x1'));var zipdir=require(_0xf70f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf70f('0x3'));var moment=require('moment');var BPromise=require(_0xf70f('0x4'));var Mustache=require(_0xf70f('0x5'));var util=require(_0xf70f('0x6'));var path=require('path');var sox=require(_0xf70f('0x7'));var csv=require(_0xf70f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf70f('0x9'));var squel=require(_0xf70f('0xa'));var crypto=require('crypto');var jsforce=require(_0xf70f('0xb'));var deskjs=require(_0xf70f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf70f('0xd'));var Redis=require(_0xf70f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf70f('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xf70f('0x10'));var config=require(_0xf70f('0x11'));var licenseUtil=require(_0xf70f('0x12'));var db=require(_0xf70f('0x13'))['db'];function respondWithStatusCode(_0x45deaa,_0x556d8c){_0x556d8c=_0x556d8c||0xcc;return function(_0x1e1e30){if(_0x1e1e30){return _0x45deaa['sendStatus'](_0x556d8c);}return _0x45deaa[_0xf70f('0x14')](_0x556d8c)[_0xf70f('0x15')]();};}function respondWithResult(_0x305411,_0x41ff40){_0x41ff40=_0x41ff40||0xc8;return function(_0x2516f5){if(_0x2516f5){return _0x305411['status'](_0x41ff40)[_0xf70f('0x16')](_0x2516f5);}};}function respondWithFilteredResult(_0x68737a,_0x5ce469){return function(_0x1d4a96){if(_0x1d4a96){var _0x36821e=typeof _0x5ce469['offset']===_0xf70f('0x17')&&typeof _0x5ce469[_0xf70f('0x18')]===_0xf70f('0x17');var _0x24226c=_0x1d4a96[_0xf70f('0x19')];var _0x34e67d=_0x36821e?0x0:_0x5ce469['offset'];var _0x377c23=_0x36821e?_0x1d4a96[_0xf70f('0x19')]:_0x5ce469[_0xf70f('0x1a')]+_0x5ce469[_0xf70f('0x18')];var _0x12d6d4;if(_0x377c23>=_0x24226c){_0x377c23=_0x24226c;_0x12d6d4=0xc8;}else{_0x12d6d4=0xce;}_0x68737a['status'](_0x12d6d4);return _0x68737a[_0xf70f('0x1b')](_0xf70f('0x1c'),_0x34e67d+'-'+_0x377c23+'/'+_0x24226c)[_0xf70f('0x16')](_0x1d4a96);}return null;};}function patchUpdates(_0x38465e){return function(_0x2d8192){try{jsonpatch[_0xf70f('0x1d')](_0x2d8192,_0x38465e,!![]);}catch(_0x221b32){return BPromise[_0xf70f('0x1e')](_0x221b32);}return _0x2d8192['save']();};}function saveUpdates(_0x298b31,_0x2057a4){return function(_0xf88eeb){if(_0xf88eeb){return _0xf88eeb[_0xf70f('0x1f')](_0x298b31)[_0xf70f('0x20')](function(_0x1efc47){return _0x1efc47;});}return null;};}function removeEntity(_0x213fef,_0x5653d5){return function(_0x4f0566){if(_0x4f0566){return _0x4f0566[_0xf70f('0x21')]()[_0xf70f('0x20')](function(){_0x213fef[_0xf70f('0x14')](0xcc)[_0xf70f('0x15')]();});}};}function handleEntityNotFound(_0x2eff4d,_0x3017c3){return function(_0x59f9bc){if(!_0x59f9bc){_0x2eff4d['sendStatus'](0x194);}return _0x59f9bc;};}function handleError(_0x3f3db6,_0x5ba3ce){_0x5ba3ce=_0x5ba3ce||0x1f4;return function(_0x425672){logger[_0xf70f('0x22')](_0x425672['stack']);if(_0x425672['name']){delete _0x425672[_0xf70f('0x23')];}_0x3f3db6[_0xf70f('0x14')](_0x5ba3ce)[_0xf70f('0x24')](_0x425672);};}exports['index']=function(_0x5a223b,_0x1df606){var _0x5ee959={},_0x2c1d0a={},_0x944db4={'count':0x0,'rows':[]};var _0x552a1e=_['map'](db[_0xf70f('0x25')]['rawAttributes'],function(_0x313e1c){return{'name':_0x313e1c['fieldName'],'type':_0x313e1c[_0xf70f('0x26')][_0xf70f('0x27')]};});_0x2c1d0a[_0xf70f('0x28')]=_['map'](_0x552a1e,_0xf70f('0x23'));_0x2c1d0a[_0xf70f('0x29')]=_[_0xf70f('0x2a')](_0x5a223b[_0xf70f('0x29')]);_0x2c1d0a[_0xf70f('0x2b')]=_['intersection'](_0x2c1d0a[_0xf70f('0x28')],_0x2c1d0a[_0xf70f('0x29')]);_0x5ee959['attributes']=_['intersection'](_0x2c1d0a[_0xf70f('0x28')],qs[_0xf70f('0x2c')](_0x5a223b['query'][_0xf70f('0x2c')]));_0x5ee959[_0xf70f('0x2d')]=_0x5ee959[_0xf70f('0x2d')][_0xf70f('0x2e')]?_0x5ee959[_0xf70f('0x2d')]:_0x2c1d0a[_0xf70f('0x28')];if(!_0x5a223b[_0xf70f('0x29')][_0xf70f('0x2f')](_0xf70f('0x30'))){_0x5ee959[_0xf70f('0x18')]=qs[_0xf70f('0x18')](_0x5a223b[_0xf70f('0x29')]['limit']);_0x5ee959[_0xf70f('0x1a')]=qs['offset'](_0x5a223b['query']['offset']);}_0x5ee959[_0xf70f('0x31')]=qs[_0xf70f('0x32')](_0x5a223b[_0xf70f('0x29')]['sort']);_0x5ee959[_0xf70f('0x33')]=qs[_0xf70f('0x2b')](_[_0xf70f('0x34')](_0x5a223b[_0xf70f('0x29')],_0x2c1d0a[_0xf70f('0x2b')]),_0x552a1e);if(_0x5a223b[_0xf70f('0x29')][_0xf70f('0x35')]){_0x5ee959[_0xf70f('0x33')]=_[_0xf70f('0x36')](_0x5ee959[_0xf70f('0x33')],{'$or':_['map'](_0x552a1e,function(_0xe9a6cb){if(_0xe9a6cb['type']!==_0xf70f('0x37')){var _0x4d5a53={};_0x4d5a53[_0xe9a6cb[_0xf70f('0x23')]]={'$like':'%'+_0x5a223b[_0xf70f('0x29')][_0xf70f('0x35')]+'%'};return _0x4d5a53;}})});}_0x5ee959=_[_0xf70f('0x36')]({},_0x5ee959,_0x5a223b[_0xf70f('0x38')]);var _0x1f825d={'where':_0x5ee959[_0xf70f('0x33')]};return db[_0xf70f('0x25')][_0xf70f('0x19')](_0x1f825d)[_0xf70f('0x20')](function(_0x16425f){_0x944db4[_0xf70f('0x19')]=_0x16425f;if(_0x5a223b[_0xf70f('0x29')]['includeAll']){_0x5ee959[_0xf70f('0x39')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x5ee959);})[_0xf70f('0x20')](function(_0x5d4746){_0x944db4['rows']=_0x5d4746;return _0x944db4;})[_0xf70f('0x20')](respondWithFilteredResult(_0x1df606,_0x5ee959))[_0xf70f('0x3a')](handleError(_0x1df606,null));};exports[_0xf70f('0x3b')]=function(_0x194b3a,_0x44c422){var _0x1c39c2={'raw':!![],'where':{'id':_0x194b3a[_0xf70f('0x3c')]['id']}},_0x4986c7={};_0x4986c7['model']=_[_0xf70f('0x2a')](db[_0xf70f('0x25')]['rawAttributes']);_0x4986c7[_0xf70f('0x29')]=_[_0xf70f('0x2a')](_0x194b3a['query']);_0x4986c7['filters']=_[_0xf70f('0x3d')](_0x4986c7['model'],_0x4986c7['query']);_0x1c39c2[_0xf70f('0x2d')]=_[_0xf70f('0x3d')](_0x4986c7['model'],qs[_0xf70f('0x2c')](_0x194b3a['query']['fields']));_0x1c39c2['attributes']=_0x1c39c2[_0xf70f('0x2d')][_0xf70f('0x2e')]?_0x1c39c2[_0xf70f('0x2d')]:_0x4986c7['model'];if(_0x194b3a[_0xf70f('0x29')][_0xf70f('0x3e')]){_0x1c39c2[_0xf70f('0x39')]=[{'all':!![]}];}_0x1c39c2=_[_0xf70f('0x36')]({},_0x1c39c2,_0x194b3a['options']);return db[_0xf70f('0x25')][_0xf70f('0x3f')](_0x1c39c2)['then'](handleEntityNotFound(_0x44c422,null))['then'](respondWithResult(_0x44c422,null))[_0xf70f('0x3a')](handleError(_0x44c422,null));};exports[_0xf70f('0x40')]=function(_0x99140,_0x4105f1){return db[_0xf70f('0x25')][_0xf70f('0x40')](_0x99140['body'],{})[_0xf70f('0x20')](respondWithResult(_0x4105f1,0xc9))['catch'](handleError(_0x4105f1,null));};exports[_0xf70f('0x1f')]=function(_0x5d5863,_0x20575a){if(_0x5d5863[_0xf70f('0x41')]['id']){delete _0x5d5863[_0xf70f('0x41')]['id'];}return db[_0xf70f('0x25')][_0xf70f('0x3f')]({'where':{'id':_0x5d5863[_0xf70f('0x3c')]['id']}})['then'](handleEntityNotFound(_0x20575a,null))[_0xf70f('0x20')](saveUpdates(_0x5d5863[_0xf70f('0x41')],null))[_0xf70f('0x20')](respondWithResult(_0x20575a,null))[_0xf70f('0x3a')](handleError(_0x20575a,null));};exports[_0xf70f('0x21')]=function(_0x104209,_0x3db3aa){return db['SquareDetailsReport'][_0xf70f('0x3f')]({'where':{'id':_0x104209[_0xf70f('0x3c')]['id']}})[_0xf70f('0x20')](handleEntityNotFound(_0x3db3aa,null))[_0xf70f('0x20')](removeEntity(_0x3db3aa,null))['catch'](handleError(_0x3db3aa,null));};exports['describe']=function(_0x541c92,_0x11b5fd){return db[_0xf70f('0x25')][_0xf70f('0x42')]()[_0xf70f('0x20')](respondWithResult(_0x11b5fd,null))[_0xf70f('0x3a')](handleError(_0x11b5fd,null));}; \ No newline at end of file +var _0x2874=['params','rawAttributes','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','index','SquareDetailsReport','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show'];(function(_0xbfbef0,_0x218b21){var _0x3fdf6f=function(_0x468471){while(--_0x468471){_0xbfbef0['push'](_0xbfbef0['shift']());}};_0x3fdf6f(++_0x218b21);}(_0x2874,0xf8));var _0x4287=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0x2874[_0x5c468f];return _0x2136b0;};'use strict';var emlformat=require(_0x4287('0x0'));var rimraf=require(_0x4287('0x1'));var zipdir=require(_0x4287('0x2'));var jsonpatch=require(_0x4287('0x3'));var rp=require(_0x4287('0x4'));var moment=require(_0x4287('0x5'));var BPromise=require(_0x4287('0x6'));var Mustache=require(_0x4287('0x7'));var util=require('util');var path=require('path');var sox=require(_0x4287('0x8'));var csv=require(_0x4287('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4287('0xa'));var _=require(_0x4287('0xb'));var squel=require(_0x4287('0xc'));var crypto=require(_0x4287('0xd'));var jsforce=require(_0x4287('0xe'));var deskjs=require(_0x4287('0xf'));var toCsv=require(_0x4287('0x9'));var querystring=require(_0x4287('0x10'));var Papa=require('papaparse');var Redis=require(_0x4287('0x11'));var authService=require(_0x4287('0x12'));var qs=require(_0x4287('0x13'));var as=require(_0x4287('0x14'));var hardwareService=require(_0x4287('0x15'));var logger=require(_0x4287('0x16'))(_0x4287('0x17'));var utils=require(_0x4287('0x18'));var config=require(_0x4287('0x19'));var licenseUtil=require(_0x4287('0x1a'));var db=require(_0x4287('0x1b'))['db'];function respondWithStatusCode(_0x2ef5b2,_0x42a6d7){_0x42a6d7=_0x42a6d7||0xcc;return function(_0x401ccb){if(_0x401ccb){return _0x2ef5b2[_0x4287('0x1c')](_0x42a6d7);}return _0x2ef5b2['status'](_0x42a6d7)[_0x4287('0x1d')]();};}function respondWithResult(_0x3236d9,_0x54eeb9){_0x54eeb9=_0x54eeb9||0xc8;return function(_0x418c4c){if(_0x418c4c){return _0x3236d9[_0x4287('0x1e')](_0x54eeb9)[_0x4287('0x1f')](_0x418c4c);}};}function respondWithFilteredResult(_0x46947e,_0x517671){return function(_0x1f2378){if(_0x1f2378){var _0x49d33c=typeof _0x517671[_0x4287('0x20')]===_0x4287('0x21')&&typeof _0x517671[_0x4287('0x22')]===_0x4287('0x21');var _0x3fe322=_0x1f2378[_0x4287('0x23')];var _0x10f5a4=_0x49d33c?0x0:_0x517671[_0x4287('0x20')];var _0x4bda54=_0x49d33c?_0x1f2378[_0x4287('0x23')]:_0x517671['offset']+_0x517671[_0x4287('0x22')];var _0x489e6e;if(_0x4bda54>=_0x3fe322){_0x4bda54=_0x3fe322;_0x489e6e=0xc8;}else{_0x489e6e=0xce;}_0x46947e[_0x4287('0x1e')](_0x489e6e);return _0x46947e[_0x4287('0x24')]('Content-Range',_0x10f5a4+'-'+_0x4bda54+'/'+_0x3fe322)['json'](_0x1f2378);}return null;};}function patchUpdates(_0x3e2007){return function(_0x5133ec){try{jsonpatch[_0x4287('0x25')](_0x5133ec,_0x3e2007,!![]);}catch(_0x5d5f3b){return BPromise[_0x4287('0x26')](_0x5d5f3b);}return _0x5133ec[_0x4287('0x27')]();};}function saveUpdates(_0x43e96a,_0x35432a){return function(_0x51a215){if(_0x51a215){return _0x51a215['update'](_0x43e96a)['then'](function(_0x23efef){return _0x23efef;});}return null;};}function removeEntity(_0x59dce5,_0x1098c5){return function(_0x4c2765){if(_0x4c2765){return _0x4c2765['destroy']()[_0x4287('0x28')](function(){_0x59dce5['status'](0xcc)[_0x4287('0x1d')]();});}};}function handleEntityNotFound(_0x50368c,_0x22e50b){return function(_0x156131){if(!_0x156131){_0x50368c['sendStatus'](0x194);}return _0x156131;};}function handleError(_0x3e6761,_0x322991){_0x322991=_0x322991||0x1f4;return function(_0x28e419){logger[_0x4287('0x29')](_0x28e419[_0x4287('0x2a')]);if(_0x28e419['name']){delete _0x28e419[_0x4287('0x2b')];}_0x3e6761[_0x4287('0x1e')](_0x322991)['send'](_0x28e419);};}exports[_0x4287('0x2c')]=function(_0x434cb2,_0x180234){var _0x93efb1={},_0x5ef7aa={},_0x152113={'count':0x0,'rows':[]};var _0x492a26=_['map'](db[_0x4287('0x2d')]['rawAttributes'],function(_0x59c62b){return{'name':_0x59c62b[_0x4287('0x2e')],'type':_0x59c62b[_0x4287('0x2f')][_0x4287('0x30')]};});_0x5ef7aa[_0x4287('0x31')]=_[_0x4287('0x32')](_0x492a26,_0x4287('0x2b'));_0x5ef7aa[_0x4287('0x33')]=_[_0x4287('0x34')](_0x434cb2[_0x4287('0x33')]);_0x5ef7aa['filters']=_[_0x4287('0x35')](_0x5ef7aa[_0x4287('0x31')],_0x5ef7aa[_0x4287('0x33')]);_0x93efb1['attributes']=_[_0x4287('0x35')](_0x5ef7aa[_0x4287('0x31')],qs[_0x4287('0x36')](_0x434cb2['query'][_0x4287('0x36')]));_0x93efb1[_0x4287('0x37')]=_0x93efb1[_0x4287('0x37')]['length']?_0x93efb1[_0x4287('0x37')]:_0x5ef7aa['model'];if(!_0x434cb2['query'][_0x4287('0x38')](_0x4287('0x39'))){_0x93efb1[_0x4287('0x22')]=qs[_0x4287('0x22')](_0x434cb2[_0x4287('0x33')][_0x4287('0x22')]);_0x93efb1['offset']=qs[_0x4287('0x20')](_0x434cb2[_0x4287('0x33')][_0x4287('0x20')]);}_0x93efb1[_0x4287('0x3a')]=qs[_0x4287('0x3b')](_0x434cb2[_0x4287('0x33')]['sort']);_0x93efb1['where']=qs['filters'](_[_0x4287('0x3c')](_0x434cb2[_0x4287('0x33')],_0x5ef7aa[_0x4287('0x3d')]),_0x492a26);if(_0x434cb2['query'][_0x4287('0x3e')]){_0x93efb1[_0x4287('0x3f')]=_['merge'](_0x93efb1[_0x4287('0x3f')],{'$or':_[_0x4287('0x32')](_0x492a26,function(_0x3b838c){if(_0x3b838c[_0x4287('0x2f')]!==_0x4287('0x40')){var _0x15e456={};_0x15e456[_0x3b838c[_0x4287('0x2b')]]={'$like':'%'+_0x434cb2[_0x4287('0x33')][_0x4287('0x3e')]+'%'};return _0x15e456;}})});}_0x93efb1=_[_0x4287('0x41')]({},_0x93efb1,_0x434cb2['options']);var _0x19673e={'where':_0x93efb1[_0x4287('0x3f')]};return db[_0x4287('0x2d')][_0x4287('0x23')](_0x19673e)[_0x4287('0x28')](function(_0x5c57c6){_0x152113[_0x4287('0x23')]=_0x5c57c6;if(_0x434cb2[_0x4287('0x33')][_0x4287('0x42')]){_0x93efb1[_0x4287('0x43')]=[{'all':!![]}];}return db[_0x4287('0x2d')][_0x4287('0x44')](_0x93efb1);})['then'](function(_0xaacf05){_0x152113[_0x4287('0x45')]=_0xaacf05;return _0x152113;})['then'](respondWithFilteredResult(_0x180234,_0x93efb1))[_0x4287('0x46')](handleError(_0x180234,null));};exports[_0x4287('0x47')]=function(_0x5173bf,_0x5d5837){var _0x120c7c={'raw':!![],'where':{'id':_0x5173bf[_0x4287('0x48')]['id']}},_0x2b0e02={};_0x2b0e02[_0x4287('0x31')]=_['keys'](db['SquareDetailsReport'][_0x4287('0x49')]);_0x2b0e02[_0x4287('0x33')]=_[_0x4287('0x34')](_0x5173bf['query']);_0x2b0e02[_0x4287('0x3d')]=_[_0x4287('0x35')](_0x2b0e02[_0x4287('0x31')],_0x2b0e02[_0x4287('0x33')]);_0x120c7c[_0x4287('0x37')]=_[_0x4287('0x35')](_0x2b0e02[_0x4287('0x31')],qs[_0x4287('0x36')](_0x5173bf[_0x4287('0x33')][_0x4287('0x36')]));_0x120c7c['attributes']=_0x120c7c[_0x4287('0x37')]['length']?_0x120c7c[_0x4287('0x37')]:_0x2b0e02[_0x4287('0x31')];if(_0x5173bf[_0x4287('0x33')][_0x4287('0x42')]){_0x120c7c[_0x4287('0x43')]=[{'all':!![]}];}_0x120c7c=_[_0x4287('0x41')]({},_0x120c7c,_0x5173bf['options']);return db[_0x4287('0x2d')][_0x4287('0x4a')](_0x120c7c)[_0x4287('0x28')](handleEntityNotFound(_0x5d5837,null))['then'](respondWithResult(_0x5d5837,null))[_0x4287('0x46')](handleError(_0x5d5837,null));};exports[_0x4287('0x4b')]=function(_0x33ec22,_0x56f195){return db[_0x4287('0x2d')][_0x4287('0x4b')](_0x33ec22[_0x4287('0x4c')],{})[_0x4287('0x28')](respondWithResult(_0x56f195,0xc9))[_0x4287('0x46')](handleError(_0x56f195,null));};exports[_0x4287('0x4d')]=function(_0x218208,_0x480c2a){if(_0x218208['body']['id']){delete _0x218208[_0x4287('0x4c')]['id'];}return db[_0x4287('0x2d')][_0x4287('0x4a')]({'where':{'id':_0x218208[_0x4287('0x48')]['id']}})[_0x4287('0x28')](handleEntityNotFound(_0x480c2a,null))[_0x4287('0x28')](saveUpdates(_0x218208[_0x4287('0x4c')],null))['then'](respondWithResult(_0x480c2a,null))[_0x4287('0x46')](handleError(_0x480c2a,null));};exports[_0x4287('0x4e')]=function(_0x5799d1,_0x16bd7b){return db[_0x4287('0x2d')][_0x4287('0x4a')]({'where':{'id':_0x5799d1[_0x4287('0x48')]['id']}})[_0x4287('0x28')](handleEntityNotFound(_0x16bd7b,null))['then'](removeEntity(_0x16bd7b,null))[_0x4287('0x46')](handleError(_0x16bd7b,null));};exports[_0x4287('0x4f')]=function(_0x4b2aa5,_0x1d78b4){return db[_0x4287('0x2d')][_0x4287('0x4f')]()['then'](respondWithResult(_0x1d78b4,null))[_0x4287('0x46')](handleError(_0x1d78b4,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 1724c87..508643c 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 _0xcbb7=['lodash','util','../../config/logger','api','moment','request-promise','path','exports','define','SquareDetailsReport'];(function(_0x5c6f0a,_0x276493){var _0x5e5a09=function(_0x4989cb){while(--_0x4989cb){_0x5c6f0a['push'](_0x5c6f0a['shift']());}};_0x5e5a09(++_0x276493);}(_0xcbb7,0xe6));var _0x7cbb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xcbb7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7cbb('0x0'));var util=require(_0x7cbb('0x1'));var logger=require(_0x7cbb('0x2'))(_0x7cbb('0x3'));var moment=require(_0x7cbb('0x4'));var BPromise=require('bluebird');var rp=require(_0x7cbb('0x5'));var fs=require('fs');var path=require(_0x7cbb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x7cbb('0x7')]=function(_0x111f93,_0x1fdc3e){return _0x111f93[_0x7cbb('0x8')](_0x7cbb('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9418=['../../config/environment','./squareReportDetail.attributes','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd92b,_0x4d1139){var _0x5e1d23=function(_0x5d866f){while(--_0x5d866f){_0x3dd92b['push'](_0x3dd92b['shift']());}};_0x5e1d23(++_0x4d1139);}(_0x9418,0xdc));var _0x8941=function(_0x5016c9,_0x57cdf0){_0x5016c9=_0x5016c9-0x0;var _0x5371ee=_0x9418[_0x5016c9];return _0x5371ee;};'use strict';var _=require(_0x8941('0x0'));var util=require('util');var logger=require(_0x8941('0x1'))(_0x8941('0x2'));var moment=require(_0x8941('0x3'));var BPromise=require(_0x8941('0x4'));var rp=require(_0x8941('0x5'));var fs=require('fs');var path=require(_0x8941('0x6'));var rimraf=require(_0x8941('0x7'));var config=require(_0x8941('0x8'));var attributes=require(_0x8941('0x9'));module['exports']=function(_0x33aa87,_0x2be3c3){return _0x33aa87['define'](_0x8941('0xa'),attributes,{'tableName':_0x8941('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 1581728..300a4fd 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 _0x5c00=['create','body','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareDetailsReport'];(function(_0x403435,_0xcb4543){var _0x212dc8=function(_0x46bc0c){while(--_0x46bc0c){_0x403435['push'](_0x403435['shift']());}};_0x212dc8(++_0xcb4543);}(_0x5c00,0x17e));var _0x05c0=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x5c00[_0x4cc280];return _0x16ed24;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dc10,_0x5b9f09,_0x3a3b1b){return new BPromise(function(_0x34eb5f,_0x3ad5b7){return client['request'](_0x27dc10,_0x3a3b1b)[_0x05c0('0xb')](function(_0x32cdfa){logger[_0x05c0('0xc')](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));logger[_0x05c0('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5b9f09,'request\x20sent',JSON[_0x05c0('0x10')](_0x32cdfa));if(_0x32cdfa['error']){if(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x12')]===0x1f4){logger[_0x05c0('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x5b9f09,_0x32cdfa[_0x05c0('0x11')]['message']);return _0x3ad5b7(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);return _0x34eb5f(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}else{logger['info'](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));_0x34eb5f(_0x32cdfa[_0x05c0('0x14')][_0x05c0('0x13')]);}})[_0x05c0('0x15')](function(_0x40153e){logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x40153e);_0x3ad5b7(_0x40153e);});});}exports[_0x05c0('0x16')]=function(_0x521cbd){var _0x422401=this;return new Promise(function(_0x1230e5,_0x4613c0){return db['SquareDetailsReport'][_0x05c0('0x17')](_0x521cbd[_0x05c0('0x18')],{'raw':_0x521cbd[_0x05c0('0x19')]?_0x521cbd[_0x05c0('0x19')][_0x05c0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x407c1f){logger[_0x05c0('0xc')]('CreateSquareDetailsReport',_0x521cbd);logger['debug']('CreateSquareDetailsReport',_0x521cbd,JSON[_0x05c0('0x10')](_0x407c1f));_0x1230e5(_0x407c1f);})[_0x05c0('0x15')](function(_0x83f29){logger[_0x05c0('0x11')](_0x05c0('0x16'),_0x83f29[_0x05c0('0x13')],_0x521cbd);_0x4613c0(_0x422401[_0x05c0('0x11')](0x1f4,_0x83f29['message']));});});}; \ No newline at end of file +var _0x63a5=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','CreateSquareDetailsReport','lodash','util'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x63a5,0x18e));var _0x563a=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x63a5[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var moment=require(_0x563a('0x2'));var BPromise=require('bluebird');var rs=require(_0x563a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x563a('0x4'))['db'];var utils=require(_0x563a('0x5'));var logger=require(_0x563a('0x6'))(_0x563a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x563a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2662f7,_0x4f89b4,_0x4d71a0){return new BPromise(function(_0x543920,_0xff1f59){return client[_0x563a('0x9')](_0x2662f7,_0x4d71a0)[_0x563a('0xa')](function(_0x606235){logger[_0x563a('0xb')](_0x563a('0xc'),_0x4f89b4,_0x563a('0xd'));logger[_0x563a('0xe')](_0x563a('0xf'),_0x4f89b4,_0x563a('0xd'),JSON[_0x563a('0x10')](_0x606235));if(_0x606235[_0x563a('0x11')]){if(_0x606235[_0x563a('0x11')][_0x563a('0x12')]===0x1f4){logger['error'](_0x563a('0xc'),_0x4f89b4,_0x606235[_0x563a('0x11')][_0x563a('0x13')]);return _0xff1f59(_0x606235[_0x563a('0x11')][_0x563a('0x13')]);}logger[_0x563a('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x4f89b4,_0x606235[_0x563a('0x11')][_0x563a('0x13')]);return _0x543920(_0x606235[_0x563a('0x11')][_0x563a('0x13')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x4f89b4,_0x563a('0xd'));_0x543920(_0x606235[_0x563a('0x14')]['message']);}})[_0x563a('0x15')](function(_0x43fb16){logger[_0x563a('0x11')](_0x563a('0xc'),_0x4f89b4,_0x43fb16);_0xff1f59(_0x43fb16);});});}exports['CreateSquareDetailsReport']=function(_0x598693){var _0xe3d2bd=this;return new Promise(function(_0x422aaf,_0x54a3b4){return db['SquareDetailsReport']['create'](_0x598693['body'],{'raw':_0x598693['options']?_0x598693[_0x563a('0x16')][_0x563a('0x17')]===undefined?!![]:![]:!![]})[_0x563a('0xa')](function(_0x43b7a8){logger['info']('CreateSquareDetailsReport',_0x598693);logger[_0x563a('0xe')](_0x563a('0x18'),_0x598693,JSON[_0x563a('0x10')](_0x43b7a8));_0x422aaf(_0x43b7a8);})[_0x563a('0x15')](function(_0x1bf502){logger[_0x563a('0x11')](_0x563a('0x18'),_0x1bf502[_0x563a('0x13')],_0x598693);_0x54a3b4(_0xe3d2bd['error'](0x1f4,_0x1bf502[_0x563a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 187b020..879e9db 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 _0xcf8e=['exports','express','../../components/auth/service','get','index','/process/:pid/kill','isAuthenticated','killProcess'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xcf8e,0x71));var _0xecf8=function(_0x29db17,_0x5902f0){_0x29db17=_0x29db17-0x0;var _0x263c62=_0xcf8e[_0x29db17];return _0x263c62;};'use strict';var express=require(_0xecf8('0x0'));var router=express['Router']();var auth=require(_0xecf8('0x1'));var controller=require('./system.controller');router[_0xecf8('0x2')]('/',auth['isAuthenticated'](),controller[_0xecf8('0x3')]);router[_0xecf8('0x2')](_0xecf8('0x4'),auth[_0xecf8('0x5')](),controller[_0xecf8('0x6')]);module[_0xecf8('0x7')]=router; \ No newline at end of file +var _0x267b=['index','/process/:pid/kill','killProcess','exports','Router','../../components/auth/service','./system.controller','get'];(function(_0x2e01b4,_0x470d1d){var _0x21b858=function(_0x129683){while(--_0x129683){_0x2e01b4['push'](_0x2e01b4['shift']());}};_0x21b858(++_0x470d1d);}(_0x267b,0x174));var _0xb267=function(_0x16a9b1,_0x1ac25c){_0x16a9b1=_0x16a9b1-0x0;var _0x21d5fc=_0x267b[_0x16a9b1];return _0x21d5fc;};'use strict';var express=require('express');var router=express[_0xb267('0x0')]();var auth=require(_0xb267('0x1'));var controller=require(_0xb267('0x2'));router[_0xb267('0x3')]('/',auth['isAuthenticated'](),controller[_0xb267('0x4')]);router[_0xb267('0x3')](_0xb267('0x5'),auth['isAuthenticated'](),controller[_0xb267('0x6')]);module[_0xb267('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 867a633..8ec8b8f 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 _0x130d=['api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','systeminformation','child_process','exec','../../config/logger'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x130d,0x140));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var info=require(_0xd130('0x0'));var exec=require(_0xd130('0x1'))[_0xd130('0x2')];var logger=require(_0xd130('0x3'))(_0xd130('0x4'));var util=require(_0xd130('0x5'));var BPromise=require('bluebird');var _=require(_0xd130('0x6'));function handleError(_0x4a966a,_0x39348f,_0x6dbd90){_0x39348f=_0x39348f||0x1f4;return function(_0x1cfb8b){logger[_0xd130('0x7')](_0xd130('0x8'),_0x6dbd90,_0x39348f,util['inspect'](_0x1cfb8b,{'showHidden':![],'depth':null}));delete _0x1cfb8b[_0xd130('0x9')];_0x4a966a[_0xd130('0xa')](_0x39348f)[_0xd130('0xb')](_0x1cfb8b);};}exports['index']=function(_0x2ffc18,_0x6fd403){return info[_0xd130('0xc')]()[_0xd130('0xd')](function(_0x27bd0c){return _0x6fd403[_0xd130('0xa')](0xc8)[_0xd130('0xe')](_0x27bd0c);})[_0xd130('0xf')](function(_0x378e6c){return _0x6fd403[_0xd130('0xa')](0x1f4)[_0xd130('0xe')](_0x378e6c);});};exports[_0xd130('0x10')]=function(_0x33d14c,_0x30f766){var _0x3e16a5=[_0xd130('0x11')];return new BPromise(function(_0x9d3600,_0x49fbbc){return exec(util[_0xd130('0x12')](_0xd130('0x13'),_0x33d14c[_0xd130('0x14')][_0xd130('0x15')]),function(_0x2f1fd3,_0x4a47de,_0x15f458){if(_0x2f1fd3){return _0x49fbbc(_0x2f1fd3);}return _0x9d3600(_0x4a47de);});})['then'](function(_0x5e1ce7){var _0x2320ac=![];var _0x237e3b=_0x5e1ce7[_0xd130('0x16')](/\n/);for(var _0x3e34b8=0x0,_0x2e7f15=_0x3e16a5[_0xd130('0x17')];_0x3e34b8<_0x2e7f15,_0x2320ac===![];_0x3e34b8+=0x1){if(_0x5e1ce7[_0xd130('0x18')](_0x3e16a5[_0x3e34b8])>=0x0){_0x2320ac=!![];}}if(!_0x2320ac){throw new Error(util[_0xd130('0x12')](_0xd130('0x19'),_0x33d14c['params'][_0xd130('0x15')]));}process['kill'](_0x33d14c[_0xd130('0x14')][_0xd130('0x15')],_0xd130('0x1a'));return _0x30f766[_0xd130('0xa')](0xc8)[_0xd130('0xe')]({'message':util[_0xd130('0x12')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x33d14c[_0xd130('0x14')][_0xd130('0x15')])});})[_0xd130('0xf')](handleError(_0x30f766,null,_0xd130('0x10')));}; \ No newline at end of file +var _0x9a76=['SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','send','getAllData','json','catch','status','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','length','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x15a213,_0xfa5351){var _0x29741d=function(_0x1f1b36){while(--_0x1f1b36){_0x15a213['push'](_0x15a213['shift']());}};_0x29741d(++_0xfa5351);}(_0x9a76,0xfc));var _0x69a7=function(_0x40a51a,_0x22e981){_0x40a51a=_0x40a51a-0x0;var _0x466ece=_0x9a76[_0x40a51a];return _0x466ece;};'use strict';var info=require('systeminformation');var exec=require(_0x69a7('0x0'))[_0x69a7('0x1')];var logger=require(_0x69a7('0x2'))(_0x69a7('0x3'));var util=require(_0x69a7('0x4'));var BPromise=require(_0x69a7('0x5'));var _=require(_0x69a7('0x6'));function handleError(_0x379485,_0x36766e,_0x57f54f){_0x36766e=_0x36766e||0x1f4;return function(_0x1586e5){logger[_0x69a7('0x7')](_0x69a7('0x8'),_0x57f54f,_0x36766e,util['inspect'](_0x1586e5,{'showHidden':![],'depth':null}));delete _0x1586e5['name'];_0x379485['status'](_0x36766e)[_0x69a7('0x9')](_0x1586e5);};}exports['index']=function(_0x1812be,_0x3cda81){return info[_0x69a7('0xa')]()['then'](function(_0x410cac){return _0x3cda81['status'](0xc8)[_0x69a7('0xb')](_0x410cac);})[_0x69a7('0xc')](function(_0x22c6ce){return _0x3cda81[_0x69a7('0xd')](0x1f4)['json'](_0x22c6ce);});};exports[_0x69a7('0xe')]=function(_0x830c4e,_0x3b8450){var _0x2995fe=[_0x69a7('0xf')];return new BPromise(function(_0x1c48e9,_0xa3eb40){return exec(util[_0x69a7('0x10')](_0x69a7('0x11'),_0x830c4e[_0x69a7('0x12')][_0x69a7('0x13')]),function(_0x3152af,_0x482552,_0x50101c){if(_0x3152af){return _0xa3eb40(_0x3152af);}return _0x1c48e9(_0x482552);});})[_0x69a7('0x14')](function(_0x428129){var _0x29530a=![];var _0xa49ae8=_0x428129['split'](/\n/);for(var _0x2c1ead=0x0,_0xce78d0=_0x2995fe[_0x69a7('0x15')];_0x2c1ead<_0xce78d0,_0x29530a===![];_0x2c1ead+=0x1){if(_0x428129['indexOf'](_0x2995fe[_0x2c1ead])>=0x0){_0x29530a=!![];}}if(!_0x29530a){throw new Error(util[_0x69a7('0x10')](_0x69a7('0x16'),_0x830c4e['params'][_0x69a7('0x13')]));}process['kill'](_0x830c4e[_0x69a7('0x12')][_0x69a7('0x13')],_0x69a7('0x17'));return _0x3b8450[_0x69a7('0xd')](0xc8)[_0x69a7('0xb')]({'message':util[_0x69a7('0x10')](_0x69a7('0x18'),_0x830c4e['params'][_0x69a7('0x13')])});})[_0x69a7('0xc')](handleError(_0x3b8450,null,_0x69a7('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 5c7799d..fbfed27 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 _0x844d=['show','post','create','put','update','delete','destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id'];(function(_0xe3a46,_0x4f9273){var _0x5bb333=function(_0x2eedc5){while(--_0x2eedc5){_0xe3a46['push'](_0xe3a46['shift']());}};_0x5bb333(++_0x4f9273);}(_0x844d,0xec));var _0xd844=function(_0x31b350,_0x5be290){_0x31b350=_0x31b350-0x0;var _0x1870dc=_0x844d[_0x31b350];return _0x1870dc;};'use strict';var multer=require('multer');var util=require(_0xd844('0x0'));var path=require('path');var timeout=require(_0xd844('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd844('0x2'));var auth=require(_0xd844('0x3'));var interaction=require(_0xd844('0x4'));var config=require(_0xd844('0x5'));var controller=require(_0xd844('0x6'));router[_0xd844('0x7')]('/',auth[_0xd844('0x8')](),controller[_0xd844('0x9')]);router[_0xd844('0x7')](_0xd844('0xa'),auth[_0xd844('0x8')](),controller[_0xd844('0xb')]);router[_0xd844('0xc')]('/',auth[_0xd844('0x8')](),controller[_0xd844('0xd')]);router[_0xd844('0xe')](_0xd844('0xa'),auth[_0xd844('0x8')](),controller[_0xd844('0xf')]);router[_0xd844('0x10')]('/:id',auth[_0xd844('0x8')](),controller[_0xd844('0x11')]);module[_0xd844('0x12')]=router; \ No newline at end of file +var _0x06a2=['/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x06a2,0x1ac));var _0x206a=function(_0x3af8ce,_0xa1dc21){_0x3af8ce=_0x3af8ce-0x0;var _0x354395=_0x06a2[_0x3af8ce];return _0x354395;};'use strict';var multer=require(_0x206a('0x0'));var util=require(_0x206a('0x1'));var path=require('path');var timeout=require(_0x206a('0x2'));var express=require(_0x206a('0x3'));var router=express[_0x206a('0x4')]();var fs_extra=require(_0x206a('0x5'));var auth=require(_0x206a('0x6'));var interaction=require(_0x206a('0x7'));var config=require(_0x206a('0x8'));var controller=require(_0x206a('0x9'));router['get']('/',auth[_0x206a('0xa')](),controller[_0x206a('0xb')]);router[_0x206a('0xc')](_0x206a('0xd'),auth[_0x206a('0xa')](),controller[_0x206a('0xe')]);router[_0x206a('0xf')]('/',auth['isAuthenticated'](),controller[_0x206a('0x10')]);router[_0x206a('0x11')]('/:id',auth[_0x206a('0xa')](),controller[_0x206a('0x12')]);router['delete']('/:id',auth[_0x206a('0xa')](),controller[_0x206a('0x13')]);module[_0x206a('0x14')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index d3439dd..51bfe53 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 _0x6be1=['sequelize','exports','STRING'];(function(_0x192099,_0x38a593){var _0x3d6ccc=function(_0x541fff){while(--_0x541fff){_0x192099['push'](_0x192099['shift']());}};_0x3d6ccc(++_0x38a593);}(_0x6be1,0x12f));var _0x16be=function(_0x43aa4f,_0x27defa){_0x43aa4f=_0x43aa4f-0x0;var _0x134c5d=_0x6be1[_0x43aa4f];return _0x134c5d;};'use strict';var Sequelize=require(_0x16be('0x0'));module[_0x16be('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x16be('0x2')]}}; \ No newline at end of file +var _0xd3f5=['STRING','#0091EA','sequelize','exports','name'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0xd3f5,0x147));var _0x5d3f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd3f5[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x5d3f('0x0'));module[_0x5d3f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5d3f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5d3f('0x3')],'defaultValue':_0x5d3f('0x4')},'description':{'type':Sequelize[_0x5d3f('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 47afc17..f422a6b 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 _0x2356=['sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','moment','bluebird','path','ejs','fs-extra','lodash','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','undefined','limit','count','offset','json','reject','save','destroy','then','Tags','UserProfileResource','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order'];(function(_0x29d932,_0x97f2a7){var _0x5cd611=function(_0x33e548){while(--_0x33e548){_0x29d932['push'](_0x29d932['shift']());}};_0x5cd611(++_0x97f2a7);}(_0x2356,0x14f));var _0x6235=function(_0x4117,_0x46a6a7){_0x4117=_0x4117-0x0;var _0x2089f1=_0x2356[_0x4117];return _0x2089f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6235('0x0'));var zipdir=require(_0x6235('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6235('0x2'));var BPromise=require(_0x6235('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6235('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6235('0x5'));var fs=require('fs');var fs_extra=require(_0x6235('0x6'));var _=require(_0x6235('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6235('0x8'));var toCsv=require('to-csv');var querystring=require(_0x6235('0x9'));var Papa=require(_0x6235('0xa'));var Redis=require(_0x6235('0xb'));var authService=require(_0x6235('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6235('0xd'));var hardwareService=require(_0x6235('0xe'));var logger=require(_0x6235('0xf'))(_0x6235('0x10'));var utils=require(_0x6235('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6235('0x12'));var db=require(_0x6235('0x13'))['db'];function respondWithStatusCode(_0x1303e7,_0x6c422b){_0x6c422b=_0x6c422b||0xcc;return function(_0x48df2d){if(_0x48df2d){return _0x1303e7[_0x6235('0x14')](_0x6c422b);}return _0x1303e7[_0x6235('0x15')](_0x6c422b)['end']();};}function respondWithResult(_0x3f5b7d,_0x48e3a7){_0x48e3a7=_0x48e3a7||0xc8;return function(_0x35156f){if(_0x35156f){return _0x3f5b7d[_0x6235('0x15')](_0x48e3a7)['json'](_0x35156f);}};}function respondWithFilteredResult(_0x1cfd0b,_0x1f1c54){return function(_0x3f619b){if(_0x3f619b){var _0x3f32af=typeof _0x1f1c54['offset']===_0x6235('0x16')&&typeof _0x1f1c54[_0x6235('0x17')]===_0x6235('0x16');var _0x2e5a84=_0x3f619b[_0x6235('0x18')];var _0x2a3554=_0x3f32af?0x0:_0x1f1c54[_0x6235('0x19')];var _0x22f090=_0x3f32af?_0x3f619b[_0x6235('0x18')]:_0x1f1c54[_0x6235('0x19')]+_0x1f1c54['limit'];var _0x35103a;if(_0x22f090>=_0x2e5a84){_0x22f090=_0x2e5a84;_0x35103a=0xc8;}else{_0x35103a=0xce;}_0x1cfd0b[_0x6235('0x15')](_0x35103a);return _0x1cfd0b['set']('Content-Range',_0x2a3554+'-'+_0x22f090+'/'+_0x2e5a84)[_0x6235('0x1a')](_0x3f619b);}return null;};}function patchUpdates(_0x4f0aa2){return function(_0x5d3872){try{jsonpatch['apply'](_0x5d3872,_0x4f0aa2,!![]);}catch(_0x367207){return BPromise[_0x6235('0x1b')](_0x367207);}return _0x5d3872[_0x6235('0x1c')]();};}function saveUpdates(_0x1c60c7,_0x24c057){return function(_0x270c49){if(_0x270c49){return _0x270c49['update'](_0x1c60c7)['then'](function(_0x4663b3){return _0x4663b3;});}return null;};}function removeEntity(_0x5ac43d,_0x2189d0){return function(_0x1bed65){if(_0x1bed65){return _0x1bed65[_0x6235('0x1d')]()[_0x6235('0x1e')](function(){var _0x3eea59=_0x1bed65['get']({'plain':!![]});var _0x1e3d90=_0x6235('0x1f');return db[_0x6235('0x20')][_0x6235('0x1d')]({'where':{'type':_0x1e3d90,'resourceId':_0x3eea59['id']}})[_0x6235('0x1e')](function(){return _0x1bed65;});})['then'](function(){_0x5ac43d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f28f2,_0x5aa9fa){return function(_0x404e30){if(!_0x404e30){_0x4f28f2[_0x6235('0x14')](0x194);}return _0x404e30;};}function handleError(_0x20c633,_0x3e7cc8){_0x3e7cc8=_0x3e7cc8||0x1f4;return function(_0x2acc8c){logger['error'](_0x2acc8c['stack']);if(_0x2acc8c['name']){delete _0x2acc8c[_0x6235('0x21')];}_0x20c633['status'](_0x3e7cc8)[_0x6235('0x22')](_0x2acc8c);};}exports[_0x6235('0x23')]=function(_0x570d16,_0x37580b){var _0x3a9439={},_0x5bb691={},_0x3e3162={'count':0x0,'rows':[]};var _0x1dd384=_[_0x6235('0x24')](db[_0x6235('0x25')][_0x6235('0x26')],function(_0x452f60){return{'name':_0x452f60[_0x6235('0x27')],'type':_0x452f60[_0x6235('0x28')][_0x6235('0x29')]};});_0x5bb691[_0x6235('0x2a')]=_['map'](_0x1dd384,_0x6235('0x21'));_0x5bb691['query']=_['keys'](_0x570d16[_0x6235('0x2b')]);_0x5bb691['filters']=_['intersection'](_0x5bb691[_0x6235('0x2a')],_0x5bb691['query']);_0x3a9439['attributes']=_[_0x6235('0x2c')](_0x5bb691[_0x6235('0x2a')],qs[_0x6235('0x2d')](_0x570d16['query'][_0x6235('0x2d')]));_0x3a9439[_0x6235('0x2e')]=_0x3a9439[_0x6235('0x2e')]['length']?_0x3a9439[_0x6235('0x2e')]:_0x5bb691['model'];if(!_0x570d16[_0x6235('0x2b')][_0x6235('0x2f')](_0x6235('0x30'))){_0x3a9439[_0x6235('0x17')]=qs[_0x6235('0x17')](_0x570d16['query'][_0x6235('0x17')]);_0x3a9439['offset']=qs[_0x6235('0x19')](_0x570d16[_0x6235('0x2b')][_0x6235('0x19')]);}_0x3a9439[_0x6235('0x31')]=qs[_0x6235('0x32')](_0x570d16['query']['sort']);_0x3a9439[_0x6235('0x33')]=qs[_0x6235('0x34')](_[_0x6235('0x35')](_0x570d16[_0x6235('0x2b')],_0x5bb691[_0x6235('0x34')]),_0x1dd384);if(_0x570d16[_0x6235('0x2b')][_0x6235('0x36')]){_0x3a9439[_0x6235('0x33')]=_[_0x6235('0x37')](_0x3a9439[_0x6235('0x33')],{'$or':_['map'](_0x1dd384,function(_0x5529c1){if(_0x5529c1[_0x6235('0x28')]!=='VIRTUAL'){var _0x585744={};_0x585744[_0x5529c1[_0x6235('0x21')]]={'$like':'%'+_0x570d16[_0x6235('0x2b')][_0x6235('0x36')]+'%'};return _0x585744;}})});}_0x3a9439=_['merge']({},_0x3a9439,_0x570d16[_0x6235('0x38')]);var _0x535d80={'where':_0x3a9439[_0x6235('0x33')]};return db[_0x6235('0x25')][_0x6235('0x18')](_0x535d80)[_0x6235('0x1e')](function(_0x36abb1){_0x3e3162[_0x6235('0x18')]=_0x36abb1;if(_0x570d16[_0x6235('0x2b')][_0x6235('0x39')]){_0x3a9439['include']=[{'all':!![]}];}return db['Tag'][_0x6235('0x3a')](_0x3a9439);})['then'](function(_0x173c62){_0x3e3162[_0x6235('0x3b')]=_0x173c62;return _0x3e3162;})[_0x6235('0x1e')](respondWithFilteredResult(_0x37580b,_0x3a9439))[_0x6235('0x3c')](handleError(_0x37580b,null));};exports[_0x6235('0x3d')]=function(_0x38092e,_0x3c1ce7){var _0x4a5f6f={'raw':!![],'where':{'id':_0x38092e[_0x6235('0x3e')]['id']}},_0x3a99c4={};_0x3a99c4[_0x6235('0x2a')]=_['keys'](db[_0x6235('0x25')][_0x6235('0x26')]);_0x3a99c4[_0x6235('0x2b')]=_[_0x6235('0x3f')](_0x38092e[_0x6235('0x2b')]);_0x3a99c4[_0x6235('0x34')]=_[_0x6235('0x2c')](_0x3a99c4[_0x6235('0x2a')],_0x3a99c4['query']);_0x4a5f6f[_0x6235('0x2e')]=_[_0x6235('0x2c')](_0x3a99c4[_0x6235('0x2a')],qs['fields'](_0x38092e[_0x6235('0x2b')][_0x6235('0x2d')]));_0x4a5f6f[_0x6235('0x2e')]=_0x4a5f6f[_0x6235('0x2e')][_0x6235('0x40')]?_0x4a5f6f[_0x6235('0x2e')]:_0x3a99c4[_0x6235('0x2a')];if(_0x38092e[_0x6235('0x2b')][_0x6235('0x39')]){_0x4a5f6f['include']=[{'all':!![]}];}_0x4a5f6f=_[_0x6235('0x37')]({},_0x4a5f6f,_0x38092e['options']);return db[_0x6235('0x25')][_0x6235('0x41')](_0x4a5f6f)[_0x6235('0x1e')](handleEntityNotFound(_0x3c1ce7,null))['then'](respondWithResult(_0x3c1ce7,null))['catch'](handleError(_0x3c1ce7,null));};exports[_0x6235('0x42')]=function(_0x433263,_0x4468d4){return db[_0x6235('0x25')]['create'](_0x433263[_0x6235('0x43')],{})[_0x6235('0x1e')](function(_0x568aee){var _0x7e27cd=_0x433263['user'][_0x6235('0x44')]({'plain':!![]});if(!_0x7e27cd)throw new Error(_0x6235('0x45'));if(_0x7e27cd[_0x6235('0x46')]==='user'){var _0x2aa5f9=_0x568aee['get']({'plain':!![]});var _0x5b78db='Tags';return db[_0x6235('0x47')][_0x6235('0x41')]({'where':{'name':_0x5b78db,'userProfileId':_0x7e27cd[_0x6235('0x48')]},'raw':!![]})[_0x6235('0x1e')](function(_0x405e76){if(_0x405e76&&_0x405e76[_0x6235('0x49')]===0x0){return db[_0x6235('0x20')]['create']({'name':_0x2aa5f9[_0x6235('0x21')],'resourceId':_0x2aa5f9['id'],'type':_0x405e76[_0x6235('0x21')],'sectionId':_0x405e76['id']},{})[_0x6235('0x1e')](function(){return _0x568aee;});}else{return _0x568aee;}})[_0x6235('0x3c')](function(_0x589747){logger[_0x6235('0x4a')](_0x6235('0x4b'),_0x589747);throw _0x589747;});}return _0x568aee;})[_0x6235('0x1e')](respondWithResult(_0x4468d4,0xc9))['catch'](handleError(_0x4468d4,null));};exports[_0x6235('0x4c')]=function(_0x5c73ea,_0x4a4ad3){if(_0x5c73ea['body']['id']){delete _0x5c73ea[_0x6235('0x43')]['id'];}return db['Tag'][_0x6235('0x41')]({'where':{'id':_0x5c73ea[_0x6235('0x3e')]['id']}})[_0x6235('0x1e')](handleEntityNotFound(_0x4a4ad3,null))['then'](saveUpdates(_0x5c73ea[_0x6235('0x43')],null))['then'](respondWithResult(_0x4a4ad3,null))[_0x6235('0x3c')](handleError(_0x4a4ad3,null));};exports[_0x6235('0x1d')]=function(_0x3bc3ce,_0x457af6){return db[_0x6235('0x25')][_0x6235('0x41')]({'where':{'id':_0x3bc3ce[_0x6235('0x3e')]['id']}})[_0x6235('0x1e')](handleEntityNotFound(_0x457af6,null))['then'](removeEntity(_0x457af6,null))[_0x6235('0x3c')](handleError(_0x457af6,null));}; \ No newline at end of file +var _0xb332=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','send','index','map','Tag','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','options','count','include','findAll','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','UserProfileSection','find','body','destroy','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce'];(function(_0x336cbd,_0x5537f4){var _0x114e51=function(_0x5c68cb){while(--_0x5c68cb){_0x336cbd['push'](_0x336cbd['shift']());}};_0x114e51(++_0x5537f4);}(_0xb332,0xd9));var _0x2b33=function(_0xb7cb72,_0x19d391){_0xb7cb72=_0xb7cb72-0x0;var _0x4b7570=_0xb332[_0xb7cb72];return _0x4b7570;};'use strict';var emlformat=require(_0x2b33('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2b33('0x1'));var jsonpatch=require(_0x2b33('0x2'));var rp=require('request-promise');var moment=require(_0x2b33('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2b33('0x4'));var util=require('util');var path=require(_0x2b33('0x5'));var sox=require('sox');var csv=require(_0x2b33('0x6'));var ejs=require(_0x2b33('0x7'));var fs=require('fs');var fs_extra=require(_0x2b33('0x8'));var _=require(_0x2b33('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2b33('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2b33('0x6'));var querystring=require(_0x2b33('0xb'));var Papa=require(_0x2b33('0xc'));var Redis=require(_0x2b33('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2b33('0xe'));var as=require(_0x2b33('0xf'));var hardwareService=require(_0x2b33('0x10'));var logger=require(_0x2b33('0x11'))(_0x2b33('0x12'));var utils=require(_0x2b33('0x13'));var config=require(_0x2b33('0x14'));var licenseUtil=require(_0x2b33('0x15'));var db=require(_0x2b33('0x16'))['db'];function respondWithStatusCode(_0x3969cb,_0xca2248){_0xca2248=_0xca2248||0xcc;return function(_0x4df129){if(_0x4df129){return _0x3969cb[_0x2b33('0x17')](_0xca2248);}return _0x3969cb[_0x2b33('0x18')](_0xca2248)[_0x2b33('0x19')]();};}function respondWithResult(_0x4ef886,_0x173c75){_0x173c75=_0x173c75||0xc8;return function(_0x4d39db){if(_0x4d39db){return _0x4ef886[_0x2b33('0x18')](_0x173c75)[_0x2b33('0x1a')](_0x4d39db);}};}function respondWithFilteredResult(_0x233cd9,_0x57aea7){return function(_0x52693f){if(_0x52693f){var _0x1d8e75=typeof _0x57aea7[_0x2b33('0x1b')]===_0x2b33('0x1c')&&typeof _0x57aea7[_0x2b33('0x1d')]===_0x2b33('0x1c');var _0x4d69d0=_0x52693f['count'];var _0x59f0b6=_0x1d8e75?0x0:_0x57aea7[_0x2b33('0x1b')];var _0x4f10c4=_0x1d8e75?_0x52693f['count']:_0x57aea7[_0x2b33('0x1b')]+_0x57aea7[_0x2b33('0x1d')];var _0x205d8f;if(_0x4f10c4>=_0x4d69d0){_0x4f10c4=_0x4d69d0;_0x205d8f=0xc8;}else{_0x205d8f=0xce;}_0x233cd9['status'](_0x205d8f);return _0x233cd9[_0x2b33('0x1e')]('Content-Range',_0x59f0b6+'-'+_0x4f10c4+'/'+_0x4d69d0)[_0x2b33('0x1a')](_0x52693f);}return null;};}function patchUpdates(_0x2565be){return function(_0x8c8dc2){try{jsonpatch[_0x2b33('0x1f')](_0x8c8dc2,_0x2565be,!![]);}catch(_0x233ba6){return BPromise[_0x2b33('0x20')](_0x233ba6);}return _0x8c8dc2[_0x2b33('0x21')]();};}function saveUpdates(_0x4fb725,_0x23024c){return function(_0x1d9c98){if(_0x1d9c98){return _0x1d9c98[_0x2b33('0x22')](_0x4fb725)[_0x2b33('0x23')](function(_0x58998e){return _0x58998e;});}return null;};}function removeEntity(_0x1c27d4,_0x27f1b8){return function(_0x2605e6){if(_0x2605e6){return _0x2605e6['destroy']()[_0x2b33('0x23')](function(){var _0x1b9a48=_0x2605e6[_0x2b33('0x24')]({'plain':!![]});var _0x32b835='Tags';return db[_0x2b33('0x25')]['destroy']({'where':{'type':_0x32b835,'resourceId':_0x1b9a48['id']}})[_0x2b33('0x23')](function(){return _0x2605e6;});})['then'](function(){_0x1c27d4[_0x2b33('0x18')](0xcc)[_0x2b33('0x19')]();});}};}function handleEntityNotFound(_0x5d8d05,_0x195aa2){return function(_0x53c2ad){if(!_0x53c2ad){_0x5d8d05[_0x2b33('0x17')](0x194);}return _0x53c2ad;};}function handleError(_0x5b16a8,_0x315ebd){_0x315ebd=_0x315ebd||0x1f4;return function(_0xa109f4){logger[_0x2b33('0x26')](_0xa109f4[_0x2b33('0x27')]);if(_0xa109f4[_0x2b33('0x28')]){delete _0xa109f4[_0x2b33('0x28')];}_0x5b16a8[_0x2b33('0x18')](_0x315ebd)[_0x2b33('0x29')](_0xa109f4);};}exports[_0x2b33('0x2a')]=function(_0x203c43,_0x4cf72f){var _0x5b6527={},_0x106ea0={},_0x2a081c={'count':0x0,'rows':[]};var _0x3282bf=_[_0x2b33('0x2b')](db[_0x2b33('0x2c')]['rawAttributes'],function(_0x570765){return{'name':_0x570765[_0x2b33('0x2d')],'type':_0x570765[_0x2b33('0x2e')][_0x2b33('0x2f')]};});_0x106ea0[_0x2b33('0x30')]=_[_0x2b33('0x2b')](_0x3282bf,_0x2b33('0x28'));_0x106ea0['query']=_[_0x2b33('0x31')](_0x203c43['query']);_0x106ea0[_0x2b33('0x32')]=_[_0x2b33('0x33')](_0x106ea0[_0x2b33('0x30')],_0x106ea0[_0x2b33('0x34')]);_0x5b6527[_0x2b33('0x35')]=_[_0x2b33('0x33')](_0x106ea0[_0x2b33('0x30')],qs[_0x2b33('0x36')](_0x203c43[_0x2b33('0x34')][_0x2b33('0x36')]));_0x5b6527[_0x2b33('0x35')]=_0x5b6527[_0x2b33('0x35')][_0x2b33('0x37')]?_0x5b6527[_0x2b33('0x35')]:_0x106ea0[_0x2b33('0x30')];if(!_0x203c43[_0x2b33('0x34')]['hasOwnProperty']('nolimit')){_0x5b6527['limit']=qs[_0x2b33('0x1d')](_0x203c43[_0x2b33('0x34')][_0x2b33('0x1d')]);_0x5b6527[_0x2b33('0x1b')]=qs[_0x2b33('0x1b')](_0x203c43['query']['offset']);}_0x5b6527[_0x2b33('0x38')]=qs['sort'](_0x203c43[_0x2b33('0x34')][_0x2b33('0x39')]);_0x5b6527[_0x2b33('0x3a')]=qs[_0x2b33('0x32')](_[_0x2b33('0x3b')](_0x203c43[_0x2b33('0x34')],_0x106ea0[_0x2b33('0x32')]),_0x3282bf);if(_0x203c43[_0x2b33('0x34')][_0x2b33('0x3c')]){_0x5b6527[_0x2b33('0x3a')]=_['merge'](_0x5b6527[_0x2b33('0x3a')],{'$or':_[_0x2b33('0x2b')](_0x3282bf,function(_0x1f0160){if(_0x1f0160['type']!=='VIRTUAL'){var _0x3afaa5={};_0x3afaa5[_0x1f0160['name']]={'$like':'%'+_0x203c43[_0x2b33('0x34')][_0x2b33('0x3c')]+'%'};return _0x3afaa5;}})});}_0x5b6527=_['merge']({},_0x5b6527,_0x203c43[_0x2b33('0x3d')]);var _0x13874a={'where':_0x5b6527['where']};return db[_0x2b33('0x2c')][_0x2b33('0x3e')](_0x13874a)['then'](function(_0x2168b6){_0x2a081c[_0x2b33('0x3e')]=_0x2168b6;if(_0x203c43[_0x2b33('0x34')]['includeAll']){_0x5b6527[_0x2b33('0x3f')]=[{'all':!![]}];}return db[_0x2b33('0x2c')][_0x2b33('0x40')](_0x5b6527);})[_0x2b33('0x23')](function(_0x22ce0c){_0x2a081c['rows']=_0x22ce0c;return _0x2a081c;})[_0x2b33('0x23')](respondWithFilteredResult(_0x4cf72f,_0x5b6527))[_0x2b33('0x41')](handleError(_0x4cf72f,null));};exports[_0x2b33('0x42')]=function(_0x5ad3b2,_0x1fd4b2){var _0x2ac846={'raw':!![],'where':{'id':_0x5ad3b2[_0x2b33('0x43')]['id']}},_0x3c61d6={};_0x3c61d6['model']=_[_0x2b33('0x31')](db[_0x2b33('0x2c')]['rawAttributes']);_0x3c61d6['query']=_['keys'](_0x5ad3b2[_0x2b33('0x34')]);_0x3c61d6['filters']=_[_0x2b33('0x33')](_0x3c61d6[_0x2b33('0x30')],_0x3c61d6[_0x2b33('0x34')]);_0x2ac846[_0x2b33('0x35')]=_[_0x2b33('0x33')](_0x3c61d6[_0x2b33('0x30')],qs[_0x2b33('0x36')](_0x5ad3b2[_0x2b33('0x34')]['fields']));_0x2ac846[_0x2b33('0x35')]=_0x2ac846[_0x2b33('0x35')][_0x2b33('0x37')]?_0x2ac846[_0x2b33('0x35')]:_0x3c61d6[_0x2b33('0x30')];if(_0x5ad3b2[_0x2b33('0x34')]['includeAll']){_0x2ac846['include']=[{'all':!![]}];}_0x2ac846=_['merge']({},_0x2ac846,_0x5ad3b2['options']);return db[_0x2b33('0x2c')]['find'](_0x2ac846)[_0x2b33('0x23')](handleEntityNotFound(_0x1fd4b2,null))['then'](respondWithResult(_0x1fd4b2,null))['catch'](handleError(_0x1fd4b2,null));};exports[_0x2b33('0x44')]=function(_0xd15da9,_0x357724){return db['Tag'][_0x2b33('0x44')](_0xd15da9['body'],{})[_0x2b33('0x23')](function(_0x27d3b6){var _0x2a20a4=_0xd15da9[_0x2b33('0x45')][_0x2b33('0x24')]({'plain':!![]});if(!_0x2a20a4)throw new Error(_0x2b33('0x46'));if(_0x2a20a4['role']===_0x2b33('0x45')){var _0x27f766=_0x27d3b6[_0x2b33('0x24')]({'plain':!![]});var _0x4e8c21=_0x2b33('0x47');return db[_0x2b33('0x48')][_0x2b33('0x49')]({'where':{'name':_0x4e8c21,'userProfileId':_0x2a20a4['userProfileId']},'raw':!![]})[_0x2b33('0x23')](function(_0x4cffe9){if(_0x4cffe9&&_0x4cffe9['autoAssociation']===0x0){return db[_0x2b33('0x25')][_0x2b33('0x44')]({'name':_0x27f766[_0x2b33('0x28')],'resourceId':_0x27f766['id'],'type':_0x4cffe9[_0x2b33('0x28')],'sectionId':_0x4cffe9['id']},{})[_0x2b33('0x23')](function(){return _0x27d3b6;});}else{return _0x27d3b6;}})[_0x2b33('0x41')](function(_0x1982aa){logger[_0x2b33('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1982aa);throw _0x1982aa;});}return _0x27d3b6;})[_0x2b33('0x23')](respondWithResult(_0x357724,0xc9))[_0x2b33('0x41')](handleError(_0x357724,null));};exports['update']=function(_0x28e75b,_0x45a939){if(_0x28e75b['body']['id']){delete _0x28e75b[_0x2b33('0x4a')]['id'];}return db[_0x2b33('0x2c')][_0x2b33('0x49')]({'where':{'id':_0x28e75b[_0x2b33('0x43')]['id']}})['then'](handleEntityNotFound(_0x45a939,null))[_0x2b33('0x23')](saveUpdates(_0x28e75b[_0x2b33('0x4a')],null))['then'](respondWithResult(_0x45a939,null))[_0x2b33('0x41')](handleError(_0x45a939,null));};exports[_0x2b33('0x4b')]=function(_0x1ce316,_0x26e0ca){return db[_0x2b33('0x2c')][_0x2b33('0x49')]({'where':{'id':_0x1ce316[_0x2b33('0x43')]['id']}})['then'](handleEntityNotFound(_0x26e0ca,null))['then'](removeEntity(_0x26e0ca,null))[_0x2b33('0x41')](handleError(_0x26e0ca,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 195fc19..dafac5b 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 _0x53d0=['Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x394a2d,_0x460cf0){var _0x4a5274=function(_0xe94626){while(--_0xe94626){_0x394a2d['push'](_0x394a2d['shift']());}};_0x4a5274(++_0x460cf0);}(_0x53d0,0xaa));var _0x053d=function(_0x45026b,_0x2c2f11){_0x45026b=_0x45026b-0x0;var _0x808752=_0x53d0[_0x45026b];return _0x808752;};'use strict';var _=require(_0x053d('0x0'));var util=require(_0x053d('0x1'));var logger=require(_0x053d('0x2'))(_0x053d('0x3'));var moment=require(_0x053d('0x4'));var BPromise=require(_0x053d('0x5'));var rp=require(_0x053d('0x6'));var fs=require('fs');var path=require(_0x053d('0x7'));var rimraf=require(_0x053d('0x8'));var config=require(_0x053d('0x9'));var attributes=require('./tag.attributes');module[_0x053d('0xa')]=function(_0x2b6d05,_0x2e7cac){return _0x2b6d05[_0x053d('0xb')](_0x053d('0xc'),attributes,{'tableName':_0x053d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x237f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','lodash','util','../../config/logger','api'];(function(_0xea7af2,_0x15a598){var _0x30a923=function(_0x48dfb9){while(--_0x48dfb9){_0xea7af2['push'](_0xea7af2['shift']());}};_0x30a923(++_0x15a598);}(_0x237f,0x104));var _0xf237=function(_0x5660d5,_0x235c27){_0x5660d5=_0x5660d5-0x0;var _0x2a144d=_0x237f[_0x5660d5];return _0x2a144d;};'use strict';var _=require(_0xf237('0x0'));var util=require(_0xf237('0x1'));var logger=require(_0xf237('0x2'))(_0xf237('0x3'));var moment=require(_0xf237('0x4'));var BPromise=require(_0xf237('0x5'));var rp=require(_0xf237('0x6'));var fs=require('fs');var path=require(_0xf237('0x7'));var rimraf=require(_0xf237('0x8'));var config=require(_0xf237('0x9'));var attributes=require(_0xf237('0xa'));module['exports']=function(_0xc59512,_0x1a2917){return _0xc59512['define']('Tag',attributes,{'tableName':'tools_tags','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 734c22a..8b0395f 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 _0xca66=['http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x354159,_0x4d6ebf){var _0x21dc2e=function(_0x353cb9){while(--_0x353cb9){_0x354159['push'](_0x354159['shift']());}};_0x21dc2e(++_0x4d6ebf);}(_0xca66,0x8b));var _0x6ca6=function(_0x2d57cf,_0x5c0eab){_0x2d57cf=_0x2d57cf-0x0;var _0x3753bb=_0xca66[_0x2d57cf];return _0x3753bb;};'use strict';var _=require(_0x6ca6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ca6('0x1'));var rs=require(_0x6ca6('0x2'));var fs=require('fs');var Redis=require(_0x6ca6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ca6('0x4'));var logger=require('../../config/logger')(_0x6ca6('0x5'));var config=require('../../config/environment');var jayson=require(_0x6ca6('0x6'));var client=jayson[_0x6ca6('0x7')][_0x6ca6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44019c,_0x407e66,_0x27a210){return new BPromise(function(_0x27d280,_0x4f5651){return client[_0x6ca6('0x9')](_0x44019c,_0x27a210)[_0x6ca6('0xa')](function(_0x34b71b){logger[_0x6ca6('0xb')](_0x6ca6('0xc'),_0x407e66,_0x6ca6('0xd'));logger[_0x6ca6('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x407e66,_0x6ca6('0xd'),JSON[_0x6ca6('0xf')](_0x34b71b));if(_0x34b71b[_0x6ca6('0x10')]){if(_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x11')]===0x1f4){logger[_0x6ca6('0x10')]('Tag,\x20%s,\x20%s',_0x407e66,_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x12')]);return _0x4f5651(_0x34b71b['error'][_0x6ca6('0x12')]);}logger[_0x6ca6('0x10')](_0x6ca6('0xc'),_0x407e66,_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x12')]);return _0x27d280(_0x34b71b[_0x6ca6('0x10')]['message']);}else{logger['info']('Tag,\x20%s,\x20%s',_0x407e66,_0x6ca6('0xd'));_0x27d280(_0x34b71b[_0x6ca6('0x13')][_0x6ca6('0x12')]);}})[_0x6ca6('0x14')](function(_0x2c4a5c){logger[_0x6ca6('0x10')](_0x6ca6('0xc'),_0x407e66,_0x2c4a5c);_0x4f5651(_0x2c4a5c);});});} \ No newline at end of file +var _0x6c32=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x280d43,_0x2e7450){var _0x14446d=function(_0xf08837){while(--_0xf08837){_0x280d43['push'](_0x280d43['shift']());}};_0x14446d(++_0x2e7450);}(_0x6c32,0x6e));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var moment=require(_0x26c3('0x2'));var BPromise=require(_0x26c3('0x3'));var rs=require(_0x26c3('0x4'));var fs=require('fs');var Redis=require(_0x26c3('0x5'));var db=require(_0x26c3('0x6'))['db'];var utils=require(_0x26c3('0x7'));var logger=require(_0x26c3('0x8'))('rpc');var config=require(_0x26c3('0x9'));var jayson=require(_0x26c3('0xa'));var client=jayson[_0x26c3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x187b81,_0x5b3a5f,_0x3dde22){return new BPromise(function(_0x3ff8e7,_0x1a4c5b){return client[_0x26c3('0xc')](_0x187b81,_0x3dde22)[_0x26c3('0xd')](function(_0xda2203){logger[_0x26c3('0xe')](_0x26c3('0xf'),_0x5b3a5f,_0x26c3('0x10'));logger[_0x26c3('0x11')]('Tag,\x20%s,\x20%s,\x20%s',_0x5b3a5f,'request\x20sent',JSON['stringify'](_0xda2203));if(_0xda2203['error']){if(_0xda2203[_0x26c3('0x12')][_0x26c3('0x13')]===0x1f4){logger[_0x26c3('0x12')](_0x26c3('0xf'),_0x5b3a5f,_0xda2203['error']['message']);return _0x1a4c5b(_0xda2203[_0x26c3('0x12')][_0x26c3('0x14')]);}logger[_0x26c3('0x12')](_0x26c3('0xf'),_0x5b3a5f,_0xda2203[_0x26c3('0x12')]['message']);return _0x3ff8e7(_0xda2203['error'][_0x26c3('0x14')]);}else{logger[_0x26c3('0xe')]('Tag,\x20%s,\x20%s',_0x5b3a5f,'request\x20sent');_0x3ff8e7(_0xda2203[_0x26c3('0x15')]['message']);}})[_0x26c3('0x16')](function(_0x486486){logger['error'](_0x26c3('0xf'),_0x5b3a5f,_0x486486);_0x1a4c5b(_0x486486);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index b9896d6..8421761 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 4e4c323..839d80a 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 _0xb7e7=['STRING','sequelize'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xb7e7[_0x5d4607];return _0x5e4a86;};'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 _0xb10b=['name','sequelize','STRING'];(function(_0xb8694f,_0x4562aa){var _0x1aa78f=function(_0x57b9ad){while(--_0x57b9ad){_0xb8694f['push'](_0xb8694f['shift']());}};_0x1aa78f(++_0x4562aa);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a16aa,_0x46f661){_0x4a16aa=_0x4a16aa-0x0;var _0x4e9af4=_0xb10b[_0x4a16aa];return _0x4e9af4;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index be09ac0..39cdaf1 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 _0x0acb=['nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','findAll','rows','show','params','keys','length','include','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','body','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','send','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','rawAttributes','Queues','add','ids','remove','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','transaction','through','QueueId','TeamVoiceQueue','penalty','User','Queue','Queue:save','online','voicePause','interface','upsert','format','SIP/%s','all','TeamVoicePrefix','spread','Mail','removeAgents','emit','Queue:remove','UserVoiceQueueRt','hasOwnProperty','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','error','stack','name','index','map','Team','model','query','filters','intersection','attributes','fields'];(function(_0x4ccece,_0x263aff){var _0x3bdc72=function(_0x19c8c0){while(--_0x19c8c0){_0x4ccece['push'](_0x4ccece['shift']());}};_0x3bdc72(++_0x263aff);}(_0x0acb,0x1a4));var _0xb0ac=function(_0x4e6dd2,_0x39d548){_0x4e6dd2=_0x4e6dd2-0x0;var _0x47e7fe=_0x0acb[_0x4e6dd2];return _0x47e7fe;};'use strict';var emlformat=require(_0xb0ac('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb0ac('0x1'));var rp=require(_0xb0ac('0x2'));var moment=require(_0xb0ac('0x3'));var BPromise=require(_0xb0ac('0x4'));var Mustache=require(_0xb0ac('0x5'));var util=require('util');var path=require(_0xb0ac('0x6'));var sox=require(_0xb0ac('0x7'));var csv=require(_0xb0ac('0x8'));var ejs=require(_0xb0ac('0x9'));var fs=require('fs');var fs_extra=require(_0xb0ac('0xa'));var _=require(_0xb0ac('0xb'));var squel=require(_0xb0ac('0xc'));var crypto=require(_0xb0ac('0xd'));var jsforce=require(_0xb0ac('0xe'));var deskjs=require(_0xb0ac('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb0ac('0x10'));var Papa=require(_0xb0ac('0x11'));var Redis=require('ioredis');var authService=require(_0xb0ac('0x12'));var qs=require(_0xb0ac('0x13'));var as=require(_0xb0ac('0x14'));var hardwareService=require(_0xb0ac('0x15'));var logger=require(_0xb0ac('0x16'))(_0xb0ac('0x17'));var utils=require(_0xb0ac('0x18'));var config=require(_0xb0ac('0x19'));var licenseUtil=require(_0xb0ac('0x1a'));var db=require(_0xb0ac('0x1b'))['db'];config[_0xb0ac('0x1c')]=_[_0xb0ac('0x1d')](config[_0xb0ac('0x1c')],{'host':_0xb0ac('0x1e'),'port':0x18eb});var socket=require(_0xb0ac('0x1f'))(new Redis(config['redis']));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x53cb98,_0x27c776){_0x27c776=_0x27c776||0xcc;return function(_0x2fa706){if(_0x2fa706){return _0x53cb98[_0xb0ac('0x20')](_0x27c776);}return _0x53cb98[_0xb0ac('0x21')](_0x27c776)[_0xb0ac('0x22')]();};}function respondWithResult(_0x5c03c3,_0xc061ce){_0xc061ce=_0xc061ce||0xc8;return function(_0x4730ef){if(_0x4730ef){return _0x5c03c3[_0xb0ac('0x21')](_0xc061ce)[_0xb0ac('0x23')](_0x4730ef);}};}function respondWithFilteredResult(_0x363906,_0x40cb54){return function(_0x4e2fd1){if(_0x4e2fd1){var _0x211dd8=typeof _0x40cb54[_0xb0ac('0x24')]===_0xb0ac('0x25')&&typeof _0x40cb54[_0xb0ac('0x26')]===_0xb0ac('0x25');var _0x233b85=_0x4e2fd1['count'];var _0x65989c=_0x211dd8?0x0:_0x40cb54[_0xb0ac('0x24')];var _0xd43a2f=_0x211dd8?_0x4e2fd1['count']:_0x40cb54[_0xb0ac('0x24')]+_0x40cb54['limit'];var _0x1a3e8f;if(_0xd43a2f>=_0x233b85){_0xd43a2f=_0x233b85;_0x1a3e8f=0xc8;}else{_0x1a3e8f=0xce;}_0x363906[_0xb0ac('0x21')](_0x1a3e8f);return _0x363906[_0xb0ac('0x27')](_0xb0ac('0x28'),_0x65989c+'-'+_0xd43a2f+'/'+_0x233b85)['json'](_0x4e2fd1);}return null;};}function patchUpdates(_0x59649c){return function(_0xaed405){try{jsonpatch[_0xb0ac('0x29')](_0xaed405,_0x59649c,!![]);}catch(_0x2b3c67){return BPromise['reject'](_0x2b3c67);}return _0xaed405[_0xb0ac('0x2a')]();};}function saveUpdates(_0x557494,_0x44ddeb){return function(_0x5c6074){if(_0x5c6074){return _0x5c6074[_0xb0ac('0x2b')](_0x557494)[_0xb0ac('0x2c')](function(_0x558c1f){return _0x558c1f;});}return null;};}function handleEntityNotFound(_0x5d0c0f,_0x236055){return function(_0x1db3d4){if(!_0x1db3d4){_0x5d0c0f[_0xb0ac('0x20')](0x194);}return _0x1db3d4;};}function handleError(_0x2dcde7,_0x332dd0){_0x332dd0=_0x332dd0||0x1f4;return function(_0x2d66ed){logger[_0xb0ac('0x2d')](_0x2d66ed[_0xb0ac('0x2e')]);if(_0x2d66ed[_0xb0ac('0x2f')]){delete _0x2d66ed[_0xb0ac('0x2f')];}_0x2dcde7[_0xb0ac('0x21')](_0x332dd0)['send'](_0x2d66ed);};}exports[_0xb0ac('0x30')]=function(_0x5a418c,_0x1c478){var _0x585444={},_0x50ccf4={},_0x189556={'count':0x0,'rows':[]};var _0x1e0328=_[_0xb0ac('0x31')](db[_0xb0ac('0x32')]['rawAttributes'],function(_0x713019){return{'name':_0x713019['fieldName'],'type':_0x713019['type']['key']};});_0x50ccf4[_0xb0ac('0x33')]=_['map'](_0x1e0328,_0xb0ac('0x2f'));_0x50ccf4[_0xb0ac('0x34')]=_['keys'](_0x5a418c[_0xb0ac('0x34')]);_0x50ccf4[_0xb0ac('0x35')]=_[_0xb0ac('0x36')](_0x50ccf4[_0xb0ac('0x33')],_0x50ccf4[_0xb0ac('0x34')]);_0x585444[_0xb0ac('0x37')]=_['intersection'](_0x50ccf4[_0xb0ac('0x33')],qs[_0xb0ac('0x38')](_0x5a418c[_0xb0ac('0x34')]['fields']));_0x585444['attributes']=_0x585444[_0xb0ac('0x37')]['length']?_0x585444[_0xb0ac('0x37')]:_0x50ccf4[_0xb0ac('0x33')];if(!_0x5a418c['query']['hasOwnProperty'](_0xb0ac('0x39'))){_0x585444[_0xb0ac('0x26')]=qs['limit'](_0x5a418c[_0xb0ac('0x34')][_0xb0ac('0x26')]);_0x585444[_0xb0ac('0x24')]=qs['offset'](_0x5a418c[_0xb0ac('0x34')][_0xb0ac('0x24')]);}_0x585444[_0xb0ac('0x3a')]=qs[_0xb0ac('0x3b')](_0x5a418c[_0xb0ac('0x34')][_0xb0ac('0x3b')]);_0x585444[_0xb0ac('0x3c')]=qs[_0xb0ac('0x35')](_[_0xb0ac('0x3d')](_0x5a418c[_0xb0ac('0x34')],_0x50ccf4[_0xb0ac('0x35')]),_0x1e0328);if(_0x5a418c[_0xb0ac('0x34')][_0xb0ac('0x3e')]){_0x585444['where']=_[_0xb0ac('0x3f')](_0x585444[_0xb0ac('0x3c')],{'$or':_['map'](_0x1e0328,function(_0x58abaa){if(_0x58abaa[_0xb0ac('0x40')]!==_0xb0ac('0x41')){var _0x4464b5={};_0x4464b5[_0x58abaa[_0xb0ac('0x2f')]]={'$like':'%'+_0x5a418c[_0xb0ac('0x34')]['filter']+'%'};return _0x4464b5;}})});}_0x585444=_[_0xb0ac('0x3f')]({},_0x585444,_0x5a418c['options']);var _0x1bcdf9={'where':_0x585444[_0xb0ac('0x3c')]};return db[_0xb0ac('0x32')][_0xb0ac('0x42')](_0x1bcdf9)[_0xb0ac('0x2c')](function(_0x41a1c6){_0x189556[_0xb0ac('0x42')]=_0x41a1c6;if(_0x5a418c[_0xb0ac('0x34')][_0xb0ac('0x43')]){_0x585444['include']=[{'all':!![]}];}return db[_0xb0ac('0x32')][_0xb0ac('0x44')](_0x585444);})['then'](function(_0x6b169f){_0x189556[_0xb0ac('0x45')]=_0x6b169f;return _0x189556;})[_0xb0ac('0x2c')](respondWithFilteredResult(_0x1c478,_0x585444))['catch'](handleError(_0x1c478,null));};exports[_0xb0ac('0x46')]=function(_0xf79d01,_0x363d5){var _0x5595ae={'raw':![],'where':{'id':_0xf79d01[_0xb0ac('0x47')]['id']}},_0xfc845a={};_0xfc845a[_0xb0ac('0x33')]=_[_0xb0ac('0x48')](db[_0xb0ac('0x32')]['rawAttributes']);_0xfc845a[_0xb0ac('0x34')]=_[_0xb0ac('0x48')](_0xf79d01[_0xb0ac('0x34')]);_0xfc845a[_0xb0ac('0x35')]=_[_0xb0ac('0x36')](_0xfc845a[_0xb0ac('0x33')],_0xfc845a[_0xb0ac('0x34')]);_0x5595ae['attributes']=_[_0xb0ac('0x36')](_0xfc845a[_0xb0ac('0x33')],qs[_0xb0ac('0x38')](_0xf79d01['query'][_0xb0ac('0x38')]));_0x5595ae['attributes']=_0x5595ae[_0xb0ac('0x37')][_0xb0ac('0x49')]?_0x5595ae[_0xb0ac('0x37')]:_0xfc845a['model'];if(_0xf79d01[_0xb0ac('0x34')][_0xb0ac('0x43')]){_0x5595ae[_0xb0ac('0x4a')]=[{'all':!![]}];}_0x5595ae=_[_0xb0ac('0x3f')]({},_0x5595ae,_0xf79d01[_0xb0ac('0x4b')]);return db[_0xb0ac('0x32')]['find'](_0x5595ae)[_0xb0ac('0x2c')](handleEntityNotFound(_0x363d5,null))[_0xb0ac('0x2c')](respondWithResult(_0x363d5,null))['catch'](handleError(_0x363d5,null));};exports['create']=function(_0x59b772,_0x438f5d){return db[_0xb0ac('0x32')][_0xb0ac('0x4c')](_0x59b772['body'],{})['then'](function(_0x380b8b){var _0x33e6c0=_0x59b772[_0xb0ac('0x4d')][_0xb0ac('0x4e')]({'plain':!![]});if(!_0x33e6c0)throw new Error(_0xb0ac('0x4f'));if(_0x33e6c0['role']===_0xb0ac('0x4d')){var _0x192c21=_0x380b8b[_0xb0ac('0x4e')]({'plain':!![]});var _0x18744b=_0xb0ac('0x50');return db[_0xb0ac('0x51')][_0xb0ac('0x52')]({'where':{'name':_0x18744b,'userProfileId':_0x33e6c0[_0xb0ac('0x53')]},'raw':!![]})[_0xb0ac('0x2c')](function(_0x1cd352){if(_0x1cd352&&_0x1cd352[_0xb0ac('0x54')]===0x0){return db[_0xb0ac('0x55')][_0xb0ac('0x4c')]({'name':_0x192c21[_0xb0ac('0x2f')],'resourceId':_0x192c21['id'],'type':_0x1cd352['name'],'sectionId':_0x1cd352['id']},{})[_0xb0ac('0x2c')](function(){return _0x380b8b;});}else{return _0x380b8b;}})[_0xb0ac('0x56')](function(_0x296298){logger[_0xb0ac('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x296298);throw _0x296298;});}return _0x380b8b;})['then'](respondWithResult(_0x438f5d,0xc9))[_0xb0ac('0x56')](handleError(_0x438f5d,null));};exports[_0xb0ac('0x2b')]=function(_0x1c1db4,_0x50b6f9){if(_0x1c1db4[_0xb0ac('0x57')]['id']){delete _0x1c1db4[_0xb0ac('0x57')]['id'];}return db[_0xb0ac('0x32')][_0xb0ac('0x52')]({'where':{'id':_0x1c1db4[_0xb0ac('0x47')]['id']}})['then'](handleEntityNotFound(_0x50b6f9,null))['then'](saveUpdates(_0x1c1db4[_0xb0ac('0x57')],null))[_0xb0ac('0x2c')](respondWithResult(_0x50b6f9,null))[_0xb0ac('0x56')](handleError(_0x50b6f9,null));};exports[_0xb0ac('0x58')]=function(_0x20ae7d,_0x29a7a6){var _0xd25bc2=_0x20ae7d[_0xb0ac('0x47')]['id'];var _0x591ae8=[];return db[_0xb0ac('0x59')]['transaction'](function(_0x4742c7){var _0x2d1786=_0xb0ac('0x5a')+_0xd25bc2;return db[_0xb0ac('0x59')]['query'](_0x2d1786,{'type':db[_0xb0ac('0x5b')]['QueryTypes'][_0xb0ac('0x5c')],'raw':!![],'transaction':_0x4742c7})[_0xb0ac('0x2c')](function(_0x203016){_0x591ae8=_[_0xb0ac('0x31')](_0x203016,function(_0x204d1a){return Number(_0x204d1a[_0xb0ac('0x5d')]);});})[_0xb0ac('0x2c')](function(){var _0x560647='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0xd25bc2;return db['sequelize']['query'](_0x560647,{'type':db[_0xb0ac('0x5b')]['QueryTypes'][_0xb0ac('0x5c')],'raw':!![],'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(_0x165424){var _0x47640b=_[_0xb0ac('0x31')](_0x165424,function(_0x45613f){return Number(_0x45613f[_0xb0ac('0x5e')]);});return db[_0xb0ac('0x5f')][_0xb0ac('0x58')]({'where':{'UserId':{'$in':_0x591ae8},'VoiceQueueId':{'$in':_0x47640b}},'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(){var _0x177b11=_0xb0ac('0x60')+_0xd25bc2;return db[_0xb0ac('0x59')][_0xb0ac('0x34')](_0x177b11,{'type':db[_0xb0ac('0x5b')][_0xb0ac('0x61')]['SELECT'],'raw':!![],'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(_0x5505af){var _0x134b8c=_['map'](_0x5505af,function(_0x20d734){return Number(_0x20d734[_0xb0ac('0x62')]);});return db[_0xb0ac('0x63')][_0xb0ac('0x58')]({'where':{'UserId':{'$in':_0x591ae8},'MailQueueId':{'$in':_0x134b8c}},'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(){var _0x6498b4=_0xb0ac('0x64')+_0xd25bc2;return db[_0xb0ac('0x59')][_0xb0ac('0x34')](_0x6498b4,{'type':db[_0xb0ac('0x5b')][_0xb0ac('0x61')]['SELECT'],'raw':!![],'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(_0x45aae2){var _0x3461c4=_[_0xb0ac('0x31')](_0x45aae2,function(_0x5d0162){return Number(_0x5d0162[_0xb0ac('0x65')]);});return db[_0xb0ac('0x66')]['destroy']({'where':{'UserId':{'$in':_0x591ae8},'SmsQueueId':{'$in':_0x3461c4}},'transaction':_0x4742c7});})['then'](function(){var _0x1275ca='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0xd25bc2;return db[_0xb0ac('0x59')][_0xb0ac('0x34')](_0x1275ca,{'type':db[_0xb0ac('0x5b')][_0xb0ac('0x61')][_0xb0ac('0x5c')],'raw':!![],'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(_0x359dc2){var _0x420fcf=_[_0xb0ac('0x31')](_0x359dc2,function(_0x4c501c){return Number(_0x4c501c[_0xb0ac('0x67')]);});return db[_0xb0ac('0x68')][_0xb0ac('0x58')]({'where':{'UserId':{'$in':_0x591ae8},'ChatQueueId':{'$in':_0x420fcf}},'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(){var _0x415d5a=_0xb0ac('0x69')+_0xd25bc2;return db[_0xb0ac('0x59')][_0xb0ac('0x34')](_0x415d5a,{'type':db[_0xb0ac('0x5b')][_0xb0ac('0x61')][_0xb0ac('0x5c')],'raw':!![],'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(_0x39783e){var _0xe415be=_[_0xb0ac('0x31')](_0x39783e,function(_0x4ca720){return Number(_0x4ca720['FaxQueueId']);});return db[_0xb0ac('0x6a')][_0xb0ac('0x58')]({'where':{'UserId':{'$in':_0x591ae8},'FaxQueueId':{'$in':_0xe415be}},'transaction':_0x4742c7});})['then'](function(){var _0x4ec96c='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0xd25bc2;return db[_0xb0ac('0x59')][_0xb0ac('0x34')](_0x4ec96c,{'type':db[_0xb0ac('0x5b')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(_0x4fbfc0){var _0x5d9177=_[_0xb0ac('0x31')](_0x4fbfc0,function(_0x105904){return Number(_0x105904[_0xb0ac('0x6b')]);});return db[_0xb0ac('0x6c')][_0xb0ac('0x58')]({'where':{'UserId':{'$in':_0x591ae8},'OpenchannelQueueId':{'$in':_0x5d9177}},'transaction':_0x4742c7});})['then'](function(){var _0x1fdd8d=_0xb0ac('0x6d')+_0xd25bc2;return db[_0xb0ac('0x59')][_0xb0ac('0x34')](_0x1fdd8d,{'type':db[_0xb0ac('0x5b')][_0xb0ac('0x61')][_0xb0ac('0x5c')],'raw':!![],'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(_0x300023){var _0x3e6e69=_[_0xb0ac('0x31')](_0x300023,function(_0x4a079f){return Number(_0x4a079f[_0xb0ac('0x6e')]);});return db[_0xb0ac('0x6f')][_0xb0ac('0x58')]({'where':{'UserId':{'$in':_0x591ae8},'WhatsappQueueId':{'$in':_0x3e6e69}},'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0xd25bc2}});})[_0xb0ac('0x2c')](function(_0x4be13c){if(_0x4be13c===null){return;}return db[_0xb0ac('0x70')][_0xb0ac('0x58')]({'where':{'UserId':{'$in':_0x591ae8},'VoicePrefixId':_0x4be13c[_0xb0ac('0x71')]},'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(){return db['Team'][_0xb0ac('0x58')]({'where':{'id':_0xd25bc2},'cascade':!![],'transaction':_0x4742c7});})[_0xb0ac('0x2c')](function(_0x5979b0){if(_0x5979b0===0x0){_0x29a7a6[_0xb0ac('0x20')](0x194);}else{return db[_0xb0ac('0x55')]['destroy']({'where':{'type':'Teams','resourceId':_0xd25bc2},'cascade':!![],'transaction':_0x4742c7})[_0xb0ac('0x2c')](function(){_0x29a7a6[_0xb0ac('0x21')](0xcc)['end']();});}})[_0xb0ac('0x56')](function(_0x30e299){_0x29a7a6[_0xb0ac('0x21')](0x1f4)[_0xb0ac('0x72')](_0x30e299);});});};exports[_0xb0ac('0x73')]=function(_0x3d5f2a,_0x525568,_0x24ebbc){return db[_0xb0ac('0x32')][_0xb0ac('0x74')]({'where':{'id':_0x3d5f2a[_0xb0ac('0x47')]['id']}})[_0xb0ac('0x2c')](handleEntityNotFound(_0x525568,null))[_0xb0ac('0x2c')](function(_0x457310){if(!_0x3d5f2a['query'][_0xb0ac('0x75')]||!utils[_0xb0ac('0x76')](_0x3d5f2a['query'][_0xb0ac('0x75')])){throw new db[(_0xb0ac('0x5b'))][(_0xb0ac('0x77'))](_0xb0ac('0x78'));}var _0x264c1c={};var _0x4334e2={};_0x4334e2[_0xb0ac('0x33')]=_[_0xb0ac('0x48')](db[_[_0xb0ac('0x79')](_0x3d5f2a['query'][_0xb0ac('0x75')][_0xb0ac('0x7a')]())+'Queue'][_0xb0ac('0x7b')]);_0x4334e2[_0xb0ac('0x34')]=_[_0xb0ac('0x48')](_0x3d5f2a[_0xb0ac('0x34')]);_0x4334e2[_0xb0ac('0x35')]=_[_0xb0ac('0x36')](_0x4334e2['model'],_0x4334e2[_0xb0ac('0x34')]);_0x264c1c[_0xb0ac('0x37')]=_['intersection'](_0x4334e2['model'],qs['fields'](_0x3d5f2a[_0xb0ac('0x34')]['fields']));_0x264c1c[_0xb0ac('0x37')]=_0x264c1c[_0xb0ac('0x37')][_0xb0ac('0x49')]?_0x264c1c[_0xb0ac('0x37')]:_0x4334e2['model'];_0x264c1c[_0xb0ac('0x26')]=qs[_0xb0ac('0x26')](_0x3d5f2a[_0xb0ac('0x34')][_0xb0ac('0x26')]);_0x264c1c[_0xb0ac('0x24')]=qs[_0xb0ac('0x24')](_0x3d5f2a[_0xb0ac('0x34')][_0xb0ac('0x24')]);_0x264c1c[_0xb0ac('0x3a')]=qs[_0xb0ac('0x3b')](_0x3d5f2a[_0xb0ac('0x34')]['sort']);_0x264c1c[_0xb0ac('0x3c')]=qs[_0xb0ac('0x35')](_['pick'](_0x3d5f2a['query'],_0x4334e2['filters']));_0x264c1c=_[_0xb0ac('0x3f')]({},_0x264c1c,_0x3d5f2a[_0xb0ac('0x4b')]);return _0x457310['get'+_[_0xb0ac('0x79')](_0x3d5f2a[_0xb0ac('0x34')][_0xb0ac('0x75')][_0xb0ac('0x7a')]())+_0xb0ac('0x7c')](_0x264c1c);})[_0xb0ac('0x2c')](respondWithResult(_0x525568,null))[_0xb0ac('0x56')](handleError(_0x525568,null));};exports['addQueues']=function(_0xda0454,_0x3f3ed9,_0x2ebc99){return db[_0xb0ac('0x32')][_0xb0ac('0x74')]({'where':{'id':_0xda0454['params']['id']}})[_0xb0ac('0x2c')](function(_0x478f77){if(_0x478f77){if(!_0xda0454[_0xb0ac('0x57')][_0xb0ac('0x75')]||!utils['isValidChannel'](_0xda0454[_0xb0ac('0x57')][_0xb0ac('0x75')])){throw new db['Sequelize'][(_0xb0ac('0x77'))](_0xb0ac('0x78'));}return _0x478f77[_0xb0ac('0x7d')+_[_0xb0ac('0x79')](_0xda0454[_0xb0ac('0x57')]['channel'][_0xb0ac('0x7a')]())+_0xb0ac('0x7c')](_0xda0454[_0xb0ac('0x57')][_0xb0ac('0x7e')]);}return null;})['then'](handleEntityNotFound(_0x3f3ed9,null))[_0xb0ac('0x2c')](respondWithStatusCode(_0x3f3ed9,null))[_0xb0ac('0x56')](handleError(_0x3f3ed9,null));};exports['removeQueues']=function(_0x3af0dc,_0x541892,_0x31e27a){return db[_0xb0ac('0x32')][_0xb0ac('0x74')]({'where':{'id':_0x3af0dc[_0xb0ac('0x47')]['id']}})[_0xb0ac('0x2c')](function(_0x1be52d){if(_0x1be52d){if(!_0x3af0dc['query']['channel']||!utils[_0xb0ac('0x76')](_0x3af0dc[_0xb0ac('0x34')][_0xb0ac('0x75')])){throw new db[(_0xb0ac('0x5b'))]['ValidationError'](_0xb0ac('0x78'));}return _0x1be52d[_0xb0ac('0x7f')+_[_0xb0ac('0x79')](_0x3af0dc['query'][_0xb0ac('0x75')][_0xb0ac('0x7a')]())+_0xb0ac('0x7c')](_0x3af0dc[_0xb0ac('0x34')]['ids']);}return null;})['then'](handleEntityNotFound(_0x541892,null))[_0xb0ac('0x2c')](respondWithStatusCode(_0x541892,null))['catch'](handleError(_0x541892,null));};exports[_0xb0ac('0x80')]=function(_0x1a857b,_0x1d1bb5){var _0x4453d3=_[_0xb0ac('0x81')](_0x1a857b['body'][_0xb0ac('0x7e')])?_0x1a857b['body'][_0xb0ac('0x7e')]:[_0x1a857b[_0xb0ac('0x57')][_0xb0ac('0x7e')]];var _0x66abd9=_0x1a857b[_0xb0ac('0x47')]['id'];return db[_0xb0ac('0x32')][_0xb0ac('0x52')]({'where':{'id':_0x66abd9}})[_0xb0ac('0x2c')](handleEntityNotFound(_0x1d1bb5,null))[_0xb0ac('0x2c')](function(_0x43db39){if(_0x43db39){var _0x19fdc3=[_0xb0ac('0x82'),_0xb0ac('0x83'),'Mail',_0xb0ac('0x84'),_0xb0ac('0x85'),_0xb0ac('0x86'),_0xb0ac('0x87')];return db[_0xb0ac('0x59')][_0xb0ac('0x88')](function(_0x2574f3){var _0x30e6e5=_[_0xb0ac('0x31')](_0x19fdc3,function(_0x1fcdc7){var _0x39e039={'attributes':['id',_0xb0ac('0x2f')]};if(_0x1fcdc7===_0xb0ac('0x82')){_0x39e039[_0xb0ac('0x89')]={'attributes':['penalty']};}return _0x43db39[_0xb0ac('0x4e')+_0x1fcdc7+_0xb0ac('0x7c')](_0x39e039)[_0xb0ac('0x2c')](function(_0x4ef538){var _0x2892e7=_[_0xb0ac('0x31')](_0x4ef538,function(_0xd8b9cc){var _0xdcfd61=_['map'](_0x4453d3,function(_0x303307){var _0x438b8d={'where':{'UserId':_0x303307,[_0x1fcdc7+_0xb0ac('0x8a')]:_0xd8b9cc['id']},'transaction':_0x2574f3};if(_0x1fcdc7===_0xb0ac('0x82')){_0x438b8d[_0xb0ac('0x1d')]={'penalty':_0xd8b9cc[_0xb0ac('0x8b')][_0xb0ac('0x8c')]};}return db[_0xb0ac('0x8d')+_0x1fcdc7+_0xb0ac('0x8e')]['findOrCreate'](_0x438b8d)[_0xb0ac('0x2c')](function(){socket['emit'](_0xb0ac('0x4d')+_0x1fcdc7+_0xb0ac('0x8f'),{'UserId':_0x303307,[_0x1fcdc7+_0xb0ac('0x8a')]:_0xd8b9cc['id']});if(_0x1fcdc7!==_0xb0ac('0x82')){return;}return db[_0xb0ac('0x8d')]['findAll']({'where':{'id':_0x4453d3,'online':0x1},'attributes':['id','name',_0xb0ac('0x90'),_0xb0ac('0x91'),_0xb0ac('0x92')],'raw':!![]})[_0xb0ac('0x2c')](function(_0x5ab0ca){var _0x24eab6=_[_0xb0ac('0x31')](_0x5ab0ca,function(_0x1361cc){return db['UserVoiceQueueRt'][_0xb0ac('0x93')]({'membername':_0x1361cc['name'],'UserId':_0x1361cc['id'],'queue_name':_0xd8b9cc[_0xb0ac('0x2f')],'VoiceQueueId':_0xd8b9cc['id'],'interface':_['isNil'](_0x1361cc['interface'])?util[_0xb0ac('0x94')](_0xb0ac('0x95'),_0x1361cc[_0xb0ac('0x2f')]):_0x1361cc['interface'],'paused':_0x1361cc[_0xb0ac('0x91')]||![],'penalty':_0xd8b9cc[_0xb0ac('0x8b')][_0xb0ac('0x8c')]},{'transaction':_0x2574f3});});return Promise[_0xb0ac('0x96')](_0x24eab6);});});});return Promise[_0xb0ac('0x96')](_0xdcfd61);});return Promise[_0xb0ac('0x96')](_0x2892e7);})['then'](function(){return db[_0xb0ac('0x97')][_0xb0ac('0x74')]({'where':{'teamId':_0x66abd9}})[_0xb0ac('0x2c')](function(_0x877e4b){if(_0x877e4b){var _0x258867=_[_0xb0ac('0x31')](_0x4453d3,function(_0x49e0c9){db[_0xb0ac('0x70')][_0xb0ac('0x93')]({'UserId':_0x49e0c9,'VoicePrefixId':_0x877e4b[_0xb0ac('0x71')]});});return Promise['all'](_0x258867);}});});});return Promise['all'](_0x30e6e5)[_0xb0ac('0x2c')](function(){return _0x43db39['addAgents'](_0x4453d3,{'transaction':_0x2574f3})[_0xb0ac('0x98')](function(_0x4458ca){return _0x4458ca;});});});}})[_0xb0ac('0x2c')](respondWithResult(_0x1d1bb5,null))[_0xb0ac('0x56')](handleError(_0x1d1bb5,null));};exports['removeAgents']=function(_0x512586,_0x564764){var _0x4e2380=_[_0xb0ac('0x81')](_0x512586[_0xb0ac('0x34')][_0xb0ac('0x7e')])?_0x512586[_0xb0ac('0x34')][_0xb0ac('0x7e')]:[_0x512586[_0xb0ac('0x34')][_0xb0ac('0x7e')]];var _0x31cb12=_0x512586[_0xb0ac('0x47')]['id'];return db['Team'][_0xb0ac('0x52')]({'where':{'id':_0x31cb12}})['then'](handleEntityNotFound(_0x564764,null))[_0xb0ac('0x2c')](function(_0x4f2acc){if(_0x4f2acc){var _0x1e5a06=[_0xb0ac('0x82'),_0xb0ac('0x83'),_0xb0ac('0x99'),_0xb0ac('0x84'),_0xb0ac('0x85'),_0xb0ac('0x86'),'Whatsapp'];return db[_0xb0ac('0x59')]['transaction'](function(_0x1ebf7e){var _0x407ea2=_[_0xb0ac('0x31')](_0x1e5a06,function(_0x48bb30){var _0x1ddf50={'attributes':['id',_0xb0ac('0x2f')]};return _0x4f2acc[_0xb0ac('0x4e')+_0x48bb30+_0xb0ac('0x7c')](_0x1ddf50)[_0xb0ac('0x2c')](function(_0x52ea02){var _0x55cc80=_[_0xb0ac('0x31')](_0x52ea02,function(_0x17d787){return _0x17d787[_0xb0ac('0x9a')](_0x4e2380,{'transaction':_0x1ebf7e})['then'](function(){var _0x305a6f=_[_0xb0ac('0x31')](_0x4e2380,function(_0xbed1b6){socket[_0xb0ac('0x9b')](_0xb0ac('0x4d')+_0x48bb30+_0xb0ac('0x9c'),{'UserId':Number(_0xbed1b6),[_0x48bb30+_0xb0ac('0x8a')]:_0x17d787['id']});if(_0x48bb30!==_0xb0ac('0x82')){return;}return db[_0xb0ac('0x9d')][_0xb0ac('0x58')]({'where':{'VoiceQueueId':_0x17d787['id'],'UserId':_0xbed1b6},'transaction':_0x1ebf7e});});return Promise[_0xb0ac('0x96')](_0x305a6f);});});return Promise[_0xb0ac('0x96')](_0x55cc80);});});return Promise[_0xb0ac('0x96')](_0x407ea2)[_0xb0ac('0x2c')](function(){return _0x4f2acc[_0xb0ac('0x9a')](_0x4e2380,{'transaction':_0x1ebf7e});})[_0xb0ac('0x2c')](function(){return db['TeamVoicePrefix'][_0xb0ac('0x74')]({'where':{'teamId':_0x31cb12}})[_0xb0ac('0x2c')](function(_0x52059e){if(_0x52059e){var _0xa5eacb=_[_0xb0ac('0x31')](_0x4e2380,function(_0x56c37c){db[_0xb0ac('0x70')][_0xb0ac('0x58')]({'where':{'UserId':_0x56c37c,'VoicePrefixId':_0x52059e[_0xb0ac('0x71')]}});});return Promise[_0xb0ac('0x96')](_0xa5eacb);}});});});}})[_0xb0ac('0x2c')](respondWithStatusCode(_0x564764,null))[_0xb0ac('0x56')](handleError(_0x564764,null));};exports['getAgents']=function(_0x3348b9,_0x1de54d,_0x398d8a){var _0x172d2e={};var _0x1c5d16={};var _0x14b9a9;var _0x97c2eb;return db['Team'][_0xb0ac('0x74')]({'where':{'id':_0x3348b9[_0xb0ac('0x47')]['id']}})[_0xb0ac('0x2c')](handleEntityNotFound(_0x1de54d,null))[_0xb0ac('0x2c')](function(_0x4567b3){if(_0x4567b3){_0x14b9a9=_0x4567b3;_0x1c5d16[_0xb0ac('0x33')]=_[_0xb0ac('0x48')](db[_0xb0ac('0x8d')][_0xb0ac('0x7b')]);_0x1c5d16[_0xb0ac('0x34')]=_[_0xb0ac('0x48')](_0x3348b9[_0xb0ac('0x34')]);_0x1c5d16['filters']=_['intersection'](_0x1c5d16[_0xb0ac('0x33')],_0x1c5d16[_0xb0ac('0x34')]);_0x172d2e[_0xb0ac('0x37')]=_['intersection'](_0x1c5d16[_0xb0ac('0x33')],qs[_0xb0ac('0x38')](_0x3348b9[_0xb0ac('0x34')][_0xb0ac('0x38')]));_0x172d2e['attributes']=_0x172d2e[_0xb0ac('0x37')]['length']?_0x172d2e['attributes']:_0x1c5d16[_0xb0ac('0x33')];_0x172d2e[_0xb0ac('0x3a')]=qs[_0xb0ac('0x3b')](_0x3348b9['query'][_0xb0ac('0x3b')]);_0x172d2e[_0xb0ac('0x3c')]=qs[_0xb0ac('0x35')](_[_0xb0ac('0x3d')](_0x3348b9[_0xb0ac('0x34')],_0x1c5d16[_0xb0ac('0x35')]));if(_0x3348b9[_0xb0ac('0x34')][_0xb0ac('0x3e')]){_0x172d2e[_0xb0ac('0x3c')]=_['merge'](_0x172d2e['where'],{'$or':_[_0xb0ac('0x31')](_0x172d2e[_0xb0ac('0x37')],function(_0x56529b){var _0x2e88af={};_0x2e88af[_0x56529b]={'$like':'%'+_0x3348b9[_0xb0ac('0x34')][_0xb0ac('0x3e')]+'%'};return _0x2e88af;})});}_0x172d2e=_[_0xb0ac('0x3f')]({},_0x172d2e,_0x3348b9['options']);return _0x14b9a9['getAgents'](_0x172d2e);}})[_0xb0ac('0x2c')](function(_0x2104b0){if(_0x2104b0){_0x97c2eb=_0x2104b0[_0xb0ac('0x49')];if(!_0x3348b9[_0xb0ac('0x34')][_0xb0ac('0x9e')](_0xb0ac('0x39'))){_0x172d2e[_0xb0ac('0x26')]=qs['limit'](_0x3348b9[_0xb0ac('0x34')][_0xb0ac('0x26')]);_0x172d2e[_0xb0ac('0x24')]=qs['offset'](_0x3348b9[_0xb0ac('0x34')]['offset']);}return _0x14b9a9['getAgents'](_0x172d2e);}})[_0xb0ac('0x2c')](function(_0x5c77e8){if(_0x5c77e8){return _0x5c77e8?{'count':_0x97c2eb,'rows':_0x5c77e8}:null;}})[_0xb0ac('0x2c')](respondWithResult(_0x1de54d,null))[_0xb0ac('0x56')](handleError(_0x1de54d,null));}; \ No newline at end of file +var _0x636f=['error','stack','name','Team','rawAttributes','fieldName','type','model','map','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','include','findAll','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserChatQueue','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Teams','send','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','options','Queues','addQueues','body','add','ids','removeQueues','isValidChannel','addAgents','Voice','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','User','Queue','emit','Queue:save','online','voicePause','interface','upsert','isNil','format','SIP/%s','TeamVoiceQueue','all','spread','removeAgents','isArray','Chat','Queue:remove','UserVoiceQueueRt','getAgents','hasOwnProperty','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x636f,0x107));var _0xf636=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x636f[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf636('0x0'));var zipdir=require(_0xf636('0x1'));var jsonpatch=require(_0xf636('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf636('0x3'));var Mustache=require(_0xf636('0x4'));var util=require(_0xf636('0x5'));var path=require('path');var sox=require(_0xf636('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf636('0x7'));var _=require(_0xf636('0x8'));var squel=require(_0xf636('0x9'));var crypto=require(_0xf636('0xa'));var jsforce=require(_0xf636('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf636('0xc'));var querystring=require('querystring');var Papa=require(_0xf636('0xd'));var Redis=require(_0xf636('0xe'));var authService=require(_0xf636('0xf'));var qs=require(_0xf636('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf636('0x11'))(_0xf636('0x12'));var utils=require(_0xf636('0x13'));var config=require(_0xf636('0x14'));var licenseUtil=require(_0xf636('0x15'));var db=require(_0xf636('0x16'))['db'];config['redis']=_[_0xf636('0x17')](config['redis'],{'host':_0xf636('0x18'),'port':0x18eb});var socket=require(_0xf636('0x19'))(new Redis(config['redis']));require(_0xf636('0x1a'))[_0xf636('0x1b')](socket);function respondWithStatusCode(_0x564e47,_0x2ebd42){_0x2ebd42=_0x2ebd42||0xcc;return function(_0x7d4231){if(_0x7d4231){return _0x564e47[_0xf636('0x1c')](_0x2ebd42);}return _0x564e47[_0xf636('0x1d')](_0x2ebd42)[_0xf636('0x1e')]();};}function respondWithResult(_0x2e8071,_0x4ce366){_0x4ce366=_0x4ce366||0xc8;return function(_0x44cfbd){if(_0x44cfbd){return _0x2e8071[_0xf636('0x1d')](_0x4ce366)[_0xf636('0x1f')](_0x44cfbd);}};}function respondWithFilteredResult(_0x17d304,_0xd6a139){return function(_0x8e8ed2){if(_0x8e8ed2){var _0x3f63c9=typeof _0xd6a139[_0xf636('0x20')]===_0xf636('0x21')&&typeof _0xd6a139[_0xf636('0x22')]===_0xf636('0x21');var _0x221f7a=_0x8e8ed2['count'];var _0x5aeba0=_0x3f63c9?0x0:_0xd6a139[_0xf636('0x20')];var _0x3cfe1a=_0x3f63c9?_0x8e8ed2[_0xf636('0x23')]:_0xd6a139[_0xf636('0x20')]+_0xd6a139[_0xf636('0x22')];var _0x46397a;if(_0x3cfe1a>=_0x221f7a){_0x3cfe1a=_0x221f7a;_0x46397a=0xc8;}else{_0x46397a=0xce;}_0x17d304[_0xf636('0x1d')](_0x46397a);return _0x17d304[_0xf636('0x24')](_0xf636('0x25'),_0x5aeba0+'-'+_0x3cfe1a+'/'+_0x221f7a)['json'](_0x8e8ed2);}return null;};}function patchUpdates(_0x238af0){return function(_0x5ada8a){try{jsonpatch[_0xf636('0x26')](_0x5ada8a,_0x238af0,!![]);}catch(_0x389c58){return BPromise['reject'](_0x389c58);}return _0x5ada8a['save']();};}function saveUpdates(_0x42a73e,_0x20317d){return function(_0x52a855){if(_0x52a855){return _0x52a855[_0xf636('0x27')](_0x42a73e)[_0xf636('0x28')](function(_0x2c83c1){return _0x2c83c1;});}return null;};}function handleEntityNotFound(_0x876579,_0x5e8e44){return function(_0x36af28){if(!_0x36af28){_0x876579[_0xf636('0x1c')](0x194);}return _0x36af28;};}function handleError(_0x39809a,_0x414b84){_0x414b84=_0x414b84||0x1f4;return function(_0x5cdf0a){logger[_0xf636('0x29')](_0x5cdf0a[_0xf636('0x2a')]);if(_0x5cdf0a[_0xf636('0x2b')]){delete _0x5cdf0a[_0xf636('0x2b')];}_0x39809a[_0xf636('0x1d')](_0x414b84)['send'](_0x5cdf0a);};}exports['index']=function(_0x411a4,_0x2a11b9){var _0x418beb={},_0x26e078={},_0x336fa7={'count':0x0,'rows':[]};var _0x563c31=_['map'](db[_0xf636('0x2c')][_0xf636('0x2d')],function(_0x1ea654){return{'name':_0x1ea654[_0xf636('0x2e')],'type':_0x1ea654[_0xf636('0x2f')]['key']};});_0x26e078[_0xf636('0x30')]=_[_0xf636('0x31')](_0x563c31,'name');_0x26e078[_0xf636('0x32')]=_['keys'](_0x411a4[_0xf636('0x32')]);_0x26e078['filters']=_[_0xf636('0x33')](_0x26e078[_0xf636('0x30')],_0x26e078[_0xf636('0x32')]);_0x418beb['attributes']=_[_0xf636('0x33')](_0x26e078['model'],qs[_0xf636('0x34')](_0x411a4[_0xf636('0x32')][_0xf636('0x34')]));_0x418beb[_0xf636('0x35')]=_0x418beb[_0xf636('0x35')][_0xf636('0x36')]?_0x418beb['attributes']:_0x26e078[_0xf636('0x30')];if(!_0x411a4[_0xf636('0x32')]['hasOwnProperty'](_0xf636('0x37'))){_0x418beb['limit']=qs[_0xf636('0x22')](_0x411a4[_0xf636('0x32')]['limit']);_0x418beb[_0xf636('0x20')]=qs[_0xf636('0x20')](_0x411a4['query'][_0xf636('0x20')]);}_0x418beb[_0xf636('0x38')]=qs[_0xf636('0x39')](_0x411a4[_0xf636('0x32')][_0xf636('0x39')]);_0x418beb[_0xf636('0x3a')]=qs[_0xf636('0x3b')](_[_0xf636('0x3c')](_0x411a4[_0xf636('0x32')],_0x26e078[_0xf636('0x3b')]),_0x563c31);if(_0x411a4[_0xf636('0x32')][_0xf636('0x3d')]){_0x418beb['where']=_[_0xf636('0x3e')](_0x418beb[_0xf636('0x3a')],{'$or':_[_0xf636('0x31')](_0x563c31,function(_0x18e95d){if(_0x18e95d[_0xf636('0x2f')]!=='VIRTUAL'){var _0x5e5ca3={};_0x5e5ca3[_0x18e95d['name']]={'$like':'%'+_0x411a4[_0xf636('0x32')][_0xf636('0x3d')]+'%'};return _0x5e5ca3;}})});}_0x418beb=_[_0xf636('0x3e')]({},_0x418beb,_0x411a4['options']);var _0x2fafa2={'where':_0x418beb[_0xf636('0x3a')]};return db[_0xf636('0x2c')][_0xf636('0x23')](_0x2fafa2)[_0xf636('0x28')](function(_0x46f990){_0x336fa7[_0xf636('0x23')]=_0x46f990;if(_0x411a4[_0xf636('0x32')]['includeAll']){_0x418beb[_0xf636('0x3f')]=[{'all':!![]}];}return db[_0xf636('0x2c')][_0xf636('0x40')](_0x418beb);})['then'](function(_0x5e13d8){_0x336fa7['rows']=_0x5e13d8;return _0x336fa7;})[_0xf636('0x28')](respondWithFilteredResult(_0x2a11b9,_0x418beb))[_0xf636('0x41')](handleError(_0x2a11b9,null));};exports[_0xf636('0x42')]=function(_0x576892,_0x53155b){var _0x572d4b={'raw':![],'where':{'id':_0x576892[_0xf636('0x43')]['id']}},_0x55d43d={};_0x55d43d['model']=_[_0xf636('0x44')](db[_0xf636('0x2c')]['rawAttributes']);_0x55d43d[_0xf636('0x32')]=_['keys'](_0x576892[_0xf636('0x32')]);_0x55d43d[_0xf636('0x3b')]=_['intersection'](_0x55d43d[_0xf636('0x30')],_0x55d43d[_0xf636('0x32')]);_0x572d4b[_0xf636('0x35')]=_[_0xf636('0x33')](_0x55d43d[_0xf636('0x30')],qs[_0xf636('0x34')](_0x576892['query'][_0xf636('0x34')]));_0x572d4b['attributes']=_0x572d4b[_0xf636('0x35')][_0xf636('0x36')]?_0x572d4b[_0xf636('0x35')]:_0x55d43d[_0xf636('0x30')];if(_0x576892[_0xf636('0x32')]['includeAll']){_0x572d4b[_0xf636('0x3f')]=[{'all':!![]}];}_0x572d4b=_[_0xf636('0x3e')]({},_0x572d4b,_0x576892['options']);return db[_0xf636('0x2c')][_0xf636('0x45')](_0x572d4b)[_0xf636('0x28')](handleEntityNotFound(_0x53155b,null))[_0xf636('0x28')](respondWithResult(_0x53155b,null))[_0xf636('0x41')](handleError(_0x53155b,null));};exports[_0xf636('0x46')]=function(_0x46456f,_0x4d81c5){return db[_0xf636('0x2c')][_0xf636('0x46')](_0x46456f['body'],{})[_0xf636('0x28')](function(_0x235f8f){var _0x4ab6e1=_0x46456f[_0xf636('0x47')][_0xf636('0x48')]({'plain':!![]});if(!_0x4ab6e1)throw new Error(_0xf636('0x49'));if(_0x4ab6e1[_0xf636('0x4a')]==='user'){var _0x462370=_0x235f8f[_0xf636('0x48')]({'plain':!![]});var _0x63c0f3='Teams';return db[_0xf636('0x4b')]['find']({'where':{'name':_0x63c0f3,'userProfileId':_0x4ab6e1[_0xf636('0x4c')]},'raw':!![]})[_0xf636('0x28')](function(_0x1a6bd6){if(_0x1a6bd6&&_0x1a6bd6[_0xf636('0x4d')]===0x0){return db[_0xf636('0x4e')][_0xf636('0x46')]({'name':_0x462370[_0xf636('0x2b')],'resourceId':_0x462370['id'],'type':_0x1a6bd6[_0xf636('0x2b')],'sectionId':_0x1a6bd6['id']},{})[_0xf636('0x28')](function(){return _0x235f8f;});}else{return _0x235f8f;}})[_0xf636('0x41')](function(_0x1feaf7){logger[_0xf636('0x29')](_0xf636('0x4f'),_0x1feaf7);throw _0x1feaf7;});}return _0x235f8f;})['then'](respondWithResult(_0x4d81c5,0xc9))['catch'](handleError(_0x4d81c5,null));};exports[_0xf636('0x27')]=function(_0x383112,_0x5e6e29){if(_0x383112['body']['id']){delete _0x383112['body']['id'];}return db['Team'][_0xf636('0x45')]({'where':{'id':_0x383112['params']['id']}})[_0xf636('0x28')](handleEntityNotFound(_0x5e6e29,null))[_0xf636('0x28')](saveUpdates(_0x383112['body'],null))[_0xf636('0x28')](respondWithResult(_0x5e6e29,null))[_0xf636('0x41')](handleError(_0x5e6e29,null));};exports[_0xf636('0x50')]=function(_0x24746c,_0x2a9a59){var _0x436305=_0x24746c[_0xf636('0x43')]['id'];var _0x377583=[];return db[_0xf636('0x51')][_0xf636('0x52')](function(_0x369916){var _0x4400aa=_0xf636('0x53')+_0x436305;return db[_0xf636('0x51')][_0xf636('0x32')](_0x4400aa,{'type':db[_0xf636('0x54')][_0xf636('0x55')][_0xf636('0x56')],'raw':!![],'transaction':_0x369916})[_0xf636('0x28')](function(_0x24e155){_0x377583=_[_0xf636('0x31')](_0x24e155,function(_0x1db831){return Number(_0x1db831[_0xf636('0x57')]);});})[_0xf636('0x28')](function(){var _0x3935a5=_0xf636('0x58')+_0x436305;return db[_0xf636('0x51')]['query'](_0x3935a5,{'type':db[_0xf636('0x54')][_0xf636('0x55')][_0xf636('0x56')],'raw':!![],'transaction':_0x369916});})['then'](function(_0x52d95f){var _0x3ea0ab=_['map'](_0x52d95f,function(_0xb41842){return Number(_0xb41842['VoiceQueueId']);});return db[_0xf636('0x59')][_0xf636('0x50')]({'where':{'UserId':{'$in':_0x377583},'VoiceQueueId':{'$in':_0x3ea0ab}},'transaction':_0x369916});})[_0xf636('0x28')](function(){var _0x42ff7=_0xf636('0x5a')+_0x436305;return db['sequelize'][_0xf636('0x32')](_0x42ff7,{'type':db[_0xf636('0x54')][_0xf636('0x55')][_0xf636('0x56')],'raw':!![],'transaction':_0x369916});})['then'](function(_0x4a5712){var _0x35b3dd=_[_0xf636('0x31')](_0x4a5712,function(_0x5b12de){return Number(_0x5b12de[_0xf636('0x5b')]);});return db[_0xf636('0x5c')][_0xf636('0x50')]({'where':{'UserId':{'$in':_0x377583},'MailQueueId':{'$in':_0x35b3dd}},'transaction':_0x369916});})[_0xf636('0x28')](function(){var _0x99cf25='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x436305;return db[_0xf636('0x51')][_0xf636('0x32')](_0x99cf25,{'type':db[_0xf636('0x54')][_0xf636('0x55')][_0xf636('0x56')],'raw':!![],'transaction':_0x369916});})[_0xf636('0x28')](function(_0x4162df){var _0x1b5e0d=_[_0xf636('0x31')](_0x4162df,function(_0x185987){return Number(_0x185987[_0xf636('0x5d')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x377583},'SmsQueueId':{'$in':_0x1b5e0d}},'transaction':_0x369916});})[_0xf636('0x28')](function(){var _0x5af844='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x436305;return db[_0xf636('0x51')][_0xf636('0x32')](_0x5af844,{'type':db[_0xf636('0x54')][_0xf636('0x55')][_0xf636('0x56')],'raw':!![],'transaction':_0x369916});})['then'](function(_0x3bd219){var _0x18dc04=_[_0xf636('0x31')](_0x3bd219,function(_0x3957c1){return Number(_0x3957c1['ChatQueueId']);});return db[_0xf636('0x5e')][_0xf636('0x50')]({'where':{'UserId':{'$in':_0x377583},'ChatQueueId':{'$in':_0x18dc04}},'transaction':_0x369916});})[_0xf636('0x28')](function(){var _0x127d21='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x436305;return db[_0xf636('0x51')][_0xf636('0x32')](_0x127d21,{'type':db[_0xf636('0x54')]['QueryTypes'][_0xf636('0x56')],'raw':!![],'transaction':_0x369916});})['then'](function(_0x5db1fb){var _0x271943=_[_0xf636('0x31')](_0x5db1fb,function(_0x494ec9){return Number(_0x494ec9['FaxQueueId']);});return db[_0xf636('0x5f')][_0xf636('0x50')]({'where':{'UserId':{'$in':_0x377583},'FaxQueueId':{'$in':_0x271943}},'transaction':_0x369916});})[_0xf636('0x28')](function(){var _0x5310c4=_0xf636('0x60')+_0x436305;return db[_0xf636('0x51')]['query'](_0x5310c4,{'type':db['Sequelize'][_0xf636('0x55')]['SELECT'],'raw':!![],'transaction':_0x369916});})[_0xf636('0x28')](function(_0x153c52){var _0x474eb7=_[_0xf636('0x31')](_0x153c52,function(_0x520699){return Number(_0x520699[_0xf636('0x61')]);});return db['UserOpenchannelQueue'][_0xf636('0x50')]({'where':{'UserId':{'$in':_0x377583},'OpenchannelQueueId':{'$in':_0x474eb7}},'transaction':_0x369916});})[_0xf636('0x28')](function(){var _0x5ea71d=_0xf636('0x62')+_0x436305;return db[_0xf636('0x51')]['query'](_0x5ea71d,{'type':db[_0xf636('0x54')][_0xf636('0x55')][_0xf636('0x56')],'raw':!![],'transaction':_0x369916});})['then'](function(_0x510dc5){var _0x364703=_[_0xf636('0x31')](_0x510dc5,function(_0x4c170e){return Number(_0x4c170e[_0xf636('0x63')]);});return db[_0xf636('0x64')][_0xf636('0x50')]({'where':{'UserId':{'$in':_0x377583},'WhatsappQueueId':{'$in':_0x364703}},'transaction':_0x369916});})[_0xf636('0x28')](function(){return db[_0xf636('0x65')][_0xf636('0x45')]({'where':{'TeamId':_0x436305}});})[_0xf636('0x28')](function(_0x45b6c4){if(_0x45b6c4===null){return;}return db[_0xf636('0x66')][_0xf636('0x50')]({'where':{'UserId':{'$in':_0x377583},'VoicePrefixId':_0x45b6c4[_0xf636('0x67')]},'transaction':_0x369916});})[_0xf636('0x28')](function(){return db[_0xf636('0x2c')][_0xf636('0x50')]({'where':{'id':_0x436305},'cascade':!![],'transaction':_0x369916});})[_0xf636('0x28')](function(_0x2507f2){if(_0x2507f2===0x0){_0x2a9a59[_0xf636('0x1c')](0x194);}else{return db['UserProfileResource']['destroy']({'where':{'type':_0xf636('0x68'),'resourceId':_0x436305},'cascade':!![],'transaction':_0x369916})[_0xf636('0x28')](function(){_0x2a9a59[_0xf636('0x1d')](0xcc)[_0xf636('0x1e')]();});}})['catch'](function(_0x460edf){_0x2a9a59[_0xf636('0x1d')](0x1f4)[_0xf636('0x69')](_0x460edf);});});};exports[_0xf636('0x6a')]=function(_0x3b2d86,_0x26f203,_0x4703c6){return db[_0xf636('0x2c')][_0xf636('0x6b')]({'where':{'id':_0x3b2d86[_0xf636('0x43')]['id']}})['then'](handleEntityNotFound(_0x26f203,null))[_0xf636('0x28')](function(_0x2a378e){if(!_0x3b2d86[_0xf636('0x32')][_0xf636('0x6c')]||!utils['isValidChannel'](_0x3b2d86['query']['channel'])){throw new db[(_0xf636('0x54'))][(_0xf636('0x6d'))](_0xf636('0x6e'));}var _0x56380e={};var _0x370760={};_0x370760[_0xf636('0x30')]=_[_0xf636('0x44')](db[_[_0xf636('0x6f')](_0x3b2d86[_0xf636('0x32')][_0xf636('0x6c')][_0xf636('0x70')]())+'Queue']['rawAttributes']);_0x370760[_0xf636('0x32')]=_[_0xf636('0x44')](_0x3b2d86['query']);_0x370760[_0xf636('0x3b')]=_[_0xf636('0x33')](_0x370760[_0xf636('0x30')],_0x370760['query']);_0x56380e[_0xf636('0x35')]=_[_0xf636('0x33')](_0x370760[_0xf636('0x30')],qs[_0xf636('0x34')](_0x3b2d86[_0xf636('0x32')][_0xf636('0x34')]));_0x56380e['attributes']=_0x56380e['attributes'][_0xf636('0x36')]?_0x56380e[_0xf636('0x35')]:_0x370760[_0xf636('0x30')];_0x56380e[_0xf636('0x22')]=qs[_0xf636('0x22')](_0x3b2d86[_0xf636('0x32')][_0xf636('0x22')]);_0x56380e[_0xf636('0x20')]=qs['offset'](_0x3b2d86[_0xf636('0x32')][_0xf636('0x20')]);_0x56380e['order']=qs[_0xf636('0x39')](_0x3b2d86[_0xf636('0x32')][_0xf636('0x39')]);_0x56380e['where']=qs[_0xf636('0x3b')](_[_0xf636('0x3c')](_0x3b2d86['query'],_0x370760['filters']));_0x56380e=_[_0xf636('0x3e')]({},_0x56380e,_0x3b2d86[_0xf636('0x71')]);return _0x2a378e['get'+_[_0xf636('0x6f')](_0x3b2d86[_0xf636('0x32')][_0xf636('0x6c')][_0xf636('0x70')]())+_0xf636('0x72')](_0x56380e);})[_0xf636('0x28')](respondWithResult(_0x26f203,null))[_0xf636('0x41')](handleError(_0x26f203,null));};exports[_0xf636('0x73')]=function(_0x176da0,_0x2e5b68,_0x5424b0){return db[_0xf636('0x2c')][_0xf636('0x6b')]({'where':{'id':_0x176da0[_0xf636('0x43')]['id']}})[_0xf636('0x28')](function(_0x14906f){if(_0x14906f){if(!_0x176da0[_0xf636('0x74')][_0xf636('0x6c')]||!utils['isValidChannel'](_0x176da0[_0xf636('0x74')][_0xf636('0x6c')])){throw new db[(_0xf636('0x54'))][(_0xf636('0x6d'))](_0xf636('0x6e'));}return _0x14906f[_0xf636('0x75')+_[_0xf636('0x6f')](_0x176da0[_0xf636('0x74')][_0xf636('0x6c')]['toLowerCase']())+_0xf636('0x72')](_0x176da0[_0xf636('0x74')][_0xf636('0x76')]);}return null;})[_0xf636('0x28')](handleEntityNotFound(_0x2e5b68,null))[_0xf636('0x28')](respondWithStatusCode(_0x2e5b68,null))[_0xf636('0x41')](handleError(_0x2e5b68,null));};exports[_0xf636('0x77')]=function(_0x1f52e8,_0x18846f,_0x57e85b){return db[_0xf636('0x2c')][_0xf636('0x6b')]({'where':{'id':_0x1f52e8[_0xf636('0x43')]['id']}})['then'](function(_0x3b9858){if(_0x3b9858){if(!_0x1f52e8[_0xf636('0x32')]['channel']||!utils[_0xf636('0x78')](_0x1f52e8[_0xf636('0x32')][_0xf636('0x6c')])){throw new db[(_0xf636('0x54'))]['ValidationError']('Unknown\x20channel');}return _0x3b9858['remove'+_[_0xf636('0x6f')](_0x1f52e8['query'][_0xf636('0x6c')]['toLowerCase']())+_0xf636('0x72')](_0x1f52e8[_0xf636('0x32')]['ids']);}return null;})[_0xf636('0x28')](handleEntityNotFound(_0x18846f,null))['then'](respondWithStatusCode(_0x18846f,null))[_0xf636('0x41')](handleError(_0x18846f,null));};exports[_0xf636('0x79')]=function(_0x1a1e5b,_0x14f1fb){var _0x467027=_['isArray'](_0x1a1e5b['body'][_0xf636('0x76')])?_0x1a1e5b[_0xf636('0x74')][_0xf636('0x76')]:[_0x1a1e5b[_0xf636('0x74')][_0xf636('0x76')]];var _0x4fda1c=_0x1a1e5b[_0xf636('0x43')]['id'];return db[_0xf636('0x2c')]['find']({'where':{'id':_0x4fda1c}})[_0xf636('0x28')](handleEntityNotFound(_0x14f1fb,null))['then'](function(_0x5d41d5){if(_0x5d41d5){var _0x45c716=[_0xf636('0x7a'),'Chat',_0xf636('0x7b'),_0xf636('0x7c'),_0xf636('0x7d'),_0xf636('0x7e'),_0xf636('0x7f')];return db[_0xf636('0x51')]['transaction'](function(_0x1a9e29){var _0x33f073=_[_0xf636('0x31')](_0x45c716,function(_0x3af6f3){var _0x3b8f3a={'attributes':['id',_0xf636('0x2b')]};if(_0x3af6f3==='Voice'){_0x3b8f3a[_0xf636('0x80')]={'attributes':[_0xf636('0x81')]};}return _0x5d41d5[_0xf636('0x48')+_0x3af6f3+_0xf636('0x72')](_0x3b8f3a)[_0xf636('0x28')](function(_0x301902){var _0x677ecc=_[_0xf636('0x31')](_0x301902,function(_0x4e813a){var _0x146f6a=_[_0xf636('0x31')](_0x467027,function(_0x5c5532){var _0x4f9054={'where':{'UserId':_0x5c5532,[_0x3af6f3+_0xf636('0x82')]:_0x4e813a['id']},'transaction':_0x1a9e29};if(_0x3af6f3===_0xf636('0x7a')){_0x4f9054['defaults']={'penalty':_0x4e813a['TeamVoiceQueue']['penalty']};}return db[_0xf636('0x83')+_0x3af6f3+_0xf636('0x84')]['findOrCreate'](_0x4f9054)[_0xf636('0x28')](function(){socket[_0xf636('0x85')](_0xf636('0x47')+_0x3af6f3+_0xf636('0x86'),{'UserId':_0x5c5532,[_0x3af6f3+_0xf636('0x82')]:_0x4e813a['id']});if(_0x3af6f3!=='Voice'){return;}return db[_0xf636('0x83')][_0xf636('0x40')]({'where':{'id':_0x467027,'online':0x1},'attributes':['id',_0xf636('0x2b'),_0xf636('0x87'),_0xf636('0x88'),_0xf636('0x89')],'raw':!![]})['then'](function(_0x5d2a4b){var _0x4c1772=_[_0xf636('0x31')](_0x5d2a4b,function(_0x5e3bf0){return db['UserVoiceQueueRt'][_0xf636('0x8a')]({'membername':_0x5e3bf0['name'],'UserId':_0x5e3bf0['id'],'queue_name':_0x4e813a[_0xf636('0x2b')],'VoiceQueueId':_0x4e813a['id'],'interface':_[_0xf636('0x8b')](_0x5e3bf0[_0xf636('0x89')])?util[_0xf636('0x8c')](_0xf636('0x8d'),_0x5e3bf0[_0xf636('0x2b')]):_0x5e3bf0[_0xf636('0x89')],'paused':_0x5e3bf0[_0xf636('0x88')]||![],'penalty':_0x4e813a[_0xf636('0x8e')][_0xf636('0x81')]},{'transaction':_0x1a9e29});});return Promise[_0xf636('0x8f')](_0x4c1772);});});});return Promise[_0xf636('0x8f')](_0x146f6a);});return Promise[_0xf636('0x8f')](_0x677ecc);})['then'](function(){return db[_0xf636('0x65')][_0xf636('0x6b')]({'where':{'teamId':_0x4fda1c}})[_0xf636('0x28')](function(_0x24b561){if(_0x24b561){var _0x69503c=_['map'](_0x467027,function(_0x1f499d){db[_0xf636('0x66')][_0xf636('0x8a')]({'UserId':_0x1f499d,'VoicePrefixId':_0x24b561['VoicePrefixId']});});return Promise[_0xf636('0x8f')](_0x69503c);}});});});return Promise['all'](_0x33f073)['then'](function(){return _0x5d41d5['addAgents'](_0x467027,{'transaction':_0x1a9e29})[_0xf636('0x90')](function(_0x4c5f31){return _0x4c5f31;});});});}})[_0xf636('0x28')](respondWithResult(_0x14f1fb,null))[_0xf636('0x41')](handleError(_0x14f1fb,null));};exports[_0xf636('0x91')]=function(_0x59e23a,_0x4ad07e){var _0x237a9c=_[_0xf636('0x92')](_0x59e23a[_0xf636('0x32')][_0xf636('0x76')])?_0x59e23a[_0xf636('0x32')][_0xf636('0x76')]:[_0x59e23a[_0xf636('0x32')][_0xf636('0x76')]];var _0x4967d8=_0x59e23a[_0xf636('0x43')]['id'];return db[_0xf636('0x2c')]['find']({'where':{'id':_0x4967d8}})['then'](handleEntityNotFound(_0x4ad07e,null))['then'](function(_0x27febd){if(_0x27febd){var _0x45bff3=[_0xf636('0x7a'),_0xf636('0x93'),_0xf636('0x7b'),_0xf636('0x7c'),_0xf636('0x7d'),_0xf636('0x7e'),'Whatsapp'];return db[_0xf636('0x51')][_0xf636('0x52')](function(_0x1fcb55){var _0xaa26c6=_[_0xf636('0x31')](_0x45bff3,function(_0x19ac78){var _0x578486={'attributes':['id',_0xf636('0x2b')]};return _0x27febd['get'+_0x19ac78+'Queues'](_0x578486)[_0xf636('0x28')](function(_0x563f98){var _0xcd42e3=_[_0xf636('0x31')](_0x563f98,function(_0x98b289){return _0x98b289['removeAgents'](_0x237a9c,{'transaction':_0x1fcb55})[_0xf636('0x28')](function(){var _0x2e0f69=_['map'](_0x237a9c,function(_0x57f32b){socket['emit'](_0xf636('0x47')+_0x19ac78+_0xf636('0x94'),{'UserId':Number(_0x57f32b),[_0x19ac78+_0xf636('0x82')]:_0x98b289['id']});if(_0x19ac78!==_0xf636('0x7a')){return;}return db[_0xf636('0x95')][_0xf636('0x50')]({'where':{'VoiceQueueId':_0x98b289['id'],'UserId':_0x57f32b},'transaction':_0x1fcb55});});return Promise[_0xf636('0x8f')](_0x2e0f69);});});return Promise['all'](_0xcd42e3);});});return Promise[_0xf636('0x8f')](_0xaa26c6)[_0xf636('0x28')](function(){return _0x27febd[_0xf636('0x91')](_0x237a9c,{'transaction':_0x1fcb55});})[_0xf636('0x28')](function(){return db[_0xf636('0x65')][_0xf636('0x6b')]({'where':{'teamId':_0x4967d8}})['then'](function(_0x5e871a){if(_0x5e871a){var _0x5ace2f=_['map'](_0x237a9c,function(_0x197607){db[_0xf636('0x66')][_0xf636('0x50')]({'where':{'UserId':_0x197607,'VoicePrefixId':_0x5e871a['VoicePrefixId']}});});return Promise[_0xf636('0x8f')](_0x5ace2f);}});});});}})[_0xf636('0x28')](respondWithStatusCode(_0x4ad07e,null))['catch'](handleError(_0x4ad07e,null));};exports[_0xf636('0x96')]=function(_0x1b26de,_0x371bd5,_0x59dc01){var _0x3ba510={};var _0x25166c={};var _0x15ed8a;var _0x4cfbcb;return db[_0xf636('0x2c')][_0xf636('0x6b')]({'where':{'id':_0x1b26de[_0xf636('0x43')]['id']}})['then'](handleEntityNotFound(_0x371bd5,null))[_0xf636('0x28')](function(_0x1b9ef2){if(_0x1b9ef2){_0x15ed8a=_0x1b9ef2;_0x25166c[_0xf636('0x30')]=_[_0xf636('0x44')](db[_0xf636('0x83')]['rawAttributes']);_0x25166c[_0xf636('0x32')]=_[_0xf636('0x44')](_0x1b26de[_0xf636('0x32')]);_0x25166c[_0xf636('0x3b')]=_[_0xf636('0x33')](_0x25166c['model'],_0x25166c[_0xf636('0x32')]);_0x3ba510[_0xf636('0x35')]=_[_0xf636('0x33')](_0x25166c[_0xf636('0x30')],qs[_0xf636('0x34')](_0x1b26de[_0xf636('0x32')][_0xf636('0x34')]));_0x3ba510[_0xf636('0x35')]=_0x3ba510[_0xf636('0x35')][_0xf636('0x36')]?_0x3ba510[_0xf636('0x35')]:_0x25166c['model'];_0x3ba510['order']=qs[_0xf636('0x39')](_0x1b26de[_0xf636('0x32')]['sort']);_0x3ba510[_0xf636('0x3a')]=qs[_0xf636('0x3b')](_['pick'](_0x1b26de[_0xf636('0x32')],_0x25166c['filters']));if(_0x1b26de[_0xf636('0x32')][_0xf636('0x3d')]){_0x3ba510[_0xf636('0x3a')]=_[_0xf636('0x3e')](_0x3ba510['where'],{'$or':_[_0xf636('0x31')](_0x3ba510[_0xf636('0x35')],function(_0x4de7c0){var _0x307a47={};_0x307a47[_0x4de7c0]={'$like':'%'+_0x1b26de[_0xf636('0x32')][_0xf636('0x3d')]+'%'};return _0x307a47;})});}_0x3ba510=_[_0xf636('0x3e')]({},_0x3ba510,_0x1b26de[_0xf636('0x71')]);return _0x15ed8a[_0xf636('0x96')](_0x3ba510);}})[_0xf636('0x28')](function(_0x34853b){if(_0x34853b){_0x4cfbcb=_0x34853b['length'];if(!_0x1b26de[_0xf636('0x32')][_0xf636('0x97')]('nolimit')){_0x3ba510[_0xf636('0x22')]=qs[_0xf636('0x22')](_0x1b26de[_0xf636('0x32')][_0xf636('0x22')]);_0x3ba510[_0xf636('0x20')]=qs[_0xf636('0x20')](_0x1b26de[_0xf636('0x32')][_0xf636('0x20')]);}return _0x15ed8a[_0xf636('0x96')](_0x3ba510);}})[_0xf636('0x28')](function(_0x44af83){if(_0x44af83){return _0x44af83?{'count':_0x4cfbcb,'rows':_0x44af83}:null;}})[_0xf636('0x28')](respondWithResult(_0x371bd5,null))[_0xf636('0x41')](handleError(_0x371bd5,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 0a223c5..2dee3c6 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 _0x293b=['emit','hasOwnProperty','exports','events','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x293b,0x1d7));var _0xb293=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x293b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb293('0x0'));var Team=require(_0xb293('0x1'))['db'][_0xb293('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xb293('0x3')](0x0);var events={'afterCreate':_0xb293('0x4'),'afterUpdate':_0xb293('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a8ba9){return function(_0x4b31ef,_0x367d8c,_0x283b70){TeamEvents[_0xb293('0x6')](_0x2a8ba9+':'+_0x4b31ef['id'],_0x4b31ef);TeamEvents[_0xb293('0x6')](_0x2a8ba9,_0x4b31ef);_0x283b70(null);};}for(var e in events){if(events[_0xb293('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xb293('0x8')]=TeamEvents; \ No newline at end of file +var _0xf3bc=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','Team','setMaxListeners','save'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf3bc,0x9d));var _0xcf3b=function(_0x3b2b70,_0x5be559){_0x3b2b70=_0x3b2b70-0x0;var _0x1283e9=_0xf3bc[_0x3b2b70];return _0x1283e9;};'use strict';var EventEmitter=require(_0xcf3b('0x0'));var Team=require(_0xcf3b('0x1'))['db'][_0xcf3b('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xcf3b('0x3')](0x0);var events={'afterCreate':_0xcf3b('0x4'),'afterUpdate':'update','afterDestroy':_0xcf3b('0x5')};function emitEvent(_0x5b46be){return function(_0x29323c,_0x10c3fb,_0x34c7aa){TeamEvents['emit'](_0x5b46be+':'+_0x29323c['id'],_0x29323c);TeamEvents[_0xcf3b('0x6')](_0x5b46be,_0x29323c);_0x34c7aa(null);};}for(var e in events){if(events[_0xcf3b('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xcf3b('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 0c3513c..52de313 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 _0x8a00=['catch','exports','define','Team','teams','Chat','Openchannel','Sms','Voice','all','lodash','./team.attributes','then','map','channel'];(function(_0x12a5f1,_0x4adcb0){var _0x18ff06=function(_0x3e6265){while(--_0x3e6265){_0x12a5f1['push'](_0x12a5f1['shift']());}};_0x18ff06(++_0x4adcb0);}(_0x8a00,0x136));var _0x08a0=function(_0x2fc82f,_0x427af1){_0x2fc82f=_0x2fc82f-0x0;var _0x593bca=_0x8a00[_0x2fc82f];return _0x593bca;};'use strict';var _=require(_0x08a0('0x0'));var attributes=require(_0x08a0('0x1'));function getQueuesByChannel(_0x190068,_0xaebae8){var _0x2f2638='get'+_0xaebae8+'Queues';return _0x190068[_0x2f2638]()[_0x08a0('0x2')](function(_0x6998ce){return _[_0x08a0('0x3')](_0x6998ce,function(_0x3c3df9){_0x3c3df9['setDataValue'](_0x08a0('0x4'),_0xaebae8);return _0x3c3df9;});})[_0x08a0('0x5')](function(_0xdccab7){throw _0xdccab7;});}module[_0x08a0('0x6')]=function(_0x408f7f){return _0x408f7f[_0x08a0('0x7')](_0x08a0('0x8'),attributes,{'tableName':_0x08a0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x3f70a1=this;var _0x5edf50=[_0x08a0('0xa'),'Fax','Mail',_0x08a0('0xb'),_0x08a0('0xc'),_0x08a0('0xd'),'Whatsapp'];return Promise['resolve']()[_0x08a0('0x2')](function(){var _0x90be72=_[_0x08a0('0x3')](_0x5edf50,function(_0x437f5f){return getQueuesByChannel(_0x3f70a1,_0x437f5f);});return Promise[_0x08a0('0xe')](_0x90be72);})['catch'](function(_0x3fccf4){throw _0x3fccf4;});}}});}; \ No newline at end of file +var _0xc620=['Queues','then','map','setDataValue','channel','catch','exports','Team','Fax','Mail','Openchannel','Voice','Whatsapp','all','lodash','./team.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc620,0xfe));var _0x0c62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc620[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c62('0x0'));var attributes=require(_0x0c62('0x1'));function getQueuesByChannel(_0x2ff516,_0x12cc05){var _0x12c68a='get'+_0x12cc05+_0x0c62('0x2');return _0x2ff516[_0x12c68a]()[_0x0c62('0x3')](function(_0xfa8cd6){return _[_0x0c62('0x4')](_0xfa8cd6,function(_0x345109){_0x345109[_0x0c62('0x5')](_0x0c62('0x6'),_0x12cc05);return _0x345109;});})[_0x0c62('0x7')](function(_0x409657){throw _0x409657;});}module[_0x0c62('0x8')]=function(_0x5557f5){return _0x5557f5['define'](_0x0c62('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x528c0e=this;var _0x214568=['Chat',_0x0c62('0xa'),_0x0c62('0xb'),_0x0c62('0xc'),'Sms',_0x0c62('0xd'),_0x0c62('0xe')];return Promise['resolve']()[_0x0c62('0x3')](function(){var _0x376ca9=_[_0x0c62('0x4')](_0x214568,function(_0x412ba0){return getQueuesByChannel(_0x528c0e,_0x412ba0);});return Promise[_0x0c62('0xf')](_0x376ca9);})[_0x0c62('0x7')](function(_0x4cc216){throw _0x4cc216;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 5ef42ee..6bab791 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 _0x114d=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s'];(function(_0x5a6edc,_0x416959){var _0x236a79=function(_0x1dbc57){while(--_0x1dbc57){_0x5a6edc['push'](_0x5a6edc['shift']());}};_0x236a79(++_0x416959);}(_0x114d,0x8c));var _0xd114=function(_0x51d852,_0x80116b){_0x51d852=_0x51d852-0x0;var _0x5c7bf5=_0x114d[_0x51d852];return _0x5c7bf5;};'use strict';var _=require(_0xd114('0x0'));var util=require(_0xd114('0x1'));var moment=require(_0xd114('0x2'));var BPromise=require(_0xd114('0x3'));var rs=require(_0xd114('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd114('0x5'))['db'];var utils=require(_0xd114('0x6'));var logger=require(_0xd114('0x7'))(_0xd114('0x8'));var config=require(_0xd114('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd114('0xa')][_0xd114('0xb')]({'port':0x232a});config[_0xd114('0xc')]=_[_0xd114('0xd')](config[_0xd114('0xc')],{'host':_0xd114('0xe'),'port':0x18eb});var socket=require(_0xd114('0xf'))(new Redis(config[_0xd114('0xc')]));require(_0xd114('0x10'))['register'](socket);function respondWithRpcPromise(_0x5d4d39,_0xe6700f,_0x3597e1){return new BPromise(function(_0x591e7a,_0x10098b){return client['request'](_0x5d4d39,_0x3597e1)['then'](function(_0x5f58c1){logger[_0xd114('0x11')](_0xd114('0x12'),_0xe6700f,_0xd114('0x13'));logger[_0xd114('0x14')](_0xd114('0x15'),_0xe6700f,'request\x20sent',JSON['stringify'](_0x5f58c1));if(_0x5f58c1[_0xd114('0x16')]){if(_0x5f58c1[_0xd114('0x16')][_0xd114('0x17')]===0x1f4){logger[_0xd114('0x16')](_0xd114('0x12'),_0xe6700f,_0x5f58c1['error'][_0xd114('0x18')]);return _0x10098b(_0x5f58c1[_0xd114('0x16')][_0xd114('0x18')]);}logger['error'](_0xd114('0x12'),_0xe6700f,_0x5f58c1['error'][_0xd114('0x18')]);return _0x591e7a(_0x5f58c1['error'][_0xd114('0x18')]);}else{logger[_0xd114('0x11')](_0xd114('0x12'),_0xe6700f,'request\x20sent');_0x591e7a(_0x5f58c1[_0xd114('0x19')][_0xd114('0x18')]);}})[_0xd114('0x1a')](function(_0x3da7d7){logger['error']('Team,\x20%s,\x20%s',_0xe6700f,_0x3da7d7);_0x10098b(_0x3da7d7);});});} \ No newline at end of file +var _0x7e60=['request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','Team,\x20%s,\x20%s,\x20%s'];(function(_0x3e2399,_0x4cf65c){var _0x4e9ecf=function(_0x51af6d){while(--_0x51af6d){_0x3e2399['push'](_0x3e2399['shift']());}};_0x4e9ecf(++_0x4cf65c);}(_0x7e60,0x1f4));var _0x07e6=function(_0x4c7727,_0x4c3e6b){_0x4c7727=_0x4c7727-0x0;var _0x39f3e5=_0x7e60[_0x4c7727];return _0x39f3e5;};'use strict';var _=require('lodash');var util=require(_0x07e6('0x0'));var moment=require(_0x07e6('0x1'));var BPromise=require('bluebird');var rs=require(_0x07e6('0x2'));var fs=require('fs');var Redis=require(_0x07e6('0x3'));var db=require(_0x07e6('0x4'))['db'];var utils=require(_0x07e6('0x5'));var logger=require(_0x07e6('0x6'))('rpc');var config=require(_0x07e6('0x7'));var jayson=require(_0x07e6('0x8'));var client=jayson[_0x07e6('0x9')][_0x07e6('0xa')]({'port':0x232a});config[_0x07e6('0xb')]=_[_0x07e6('0xc')](config[_0x07e6('0xb')],{'host':_0x07e6('0xd'),'port':0x18eb});var socket=require(_0x07e6('0xe'))(new Redis(config[_0x07e6('0xb')]));require(_0x07e6('0xf'))[_0x07e6('0x10')](socket);function respondWithRpcPromise(_0x3bbb45,_0x57734f,_0x58b35e){return new BPromise(function(_0x134653,_0x40ad90){return client[_0x07e6('0x11')](_0x3bbb45,_0x58b35e)[_0x07e6('0x12')](function(_0x267e2a){logger[_0x07e6('0x13')](_0x07e6('0x14'),_0x57734f,'request\x20sent');logger['debug'](_0x07e6('0x15'),_0x57734f,_0x07e6('0x16'),JSON[_0x07e6('0x17')](_0x267e2a));if(_0x267e2a[_0x07e6('0x18')]){if(_0x267e2a[_0x07e6('0x18')][_0x07e6('0x19')]===0x1f4){logger[_0x07e6('0x18')]('Team,\x20%s,\x20%s',_0x57734f,_0x267e2a[_0x07e6('0x18')][_0x07e6('0x1a')]);return _0x40ad90(_0x267e2a[_0x07e6('0x18')]['message']);}logger[_0x07e6('0x18')](_0x07e6('0x14'),_0x57734f,_0x267e2a[_0x07e6('0x18')]['message']);return _0x134653(_0x267e2a['error'][_0x07e6('0x1a')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x57734f,_0x07e6('0x16'));_0x134653(_0x267e2a[_0x07e6('0x1b')]['message']);}})[_0x07e6('0x1c')](function(_0x4cc1a9){logger[_0x07e6('0x18')](_0x07e6('0x14'),_0x57734f,_0x4cc1a9);_0x40ad90(_0x4cc1a9);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index c560ff7..407eb0a 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 _0x8525=['length','save','register'];(function(_0x57c95d,_0x520097){var _0x55ad24=function(_0xe46447){while(--_0xe46447){_0x57c95d['push'](_0x57c95d['shift']());}};_0x55ad24(++_0x520097);}(_0x8525,0xc7));var _0x5852=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8525[_0x2c91e9];return _0x13f0ff;};'use strict';var TeamEvents=require('./team.events');var events=[_0x5852('0x0'),'remove','update'];function createListener(_0x259654,_0x1aa570){return function(_0x1e58e6){_0x1aa570['emit'](_0x259654,_0x1e58e6);};}function removeListener(_0x15328f,_0x34ddfe){return function(){TeamEvents['removeListener'](_0x15328f,_0x34ddfe);};}exports[_0x5852('0x1')]=function(_0x307b4d){for(var _0x47ea2b=0x0,_0x23aa8e=events[_0x5852('0x2')];_0x47ea2b<_0x23aa8e;_0x47ea2b++){var _0x58f94d=events[_0x47ea2b];var _0x6150d4=createListener('team:'+_0x58f94d,_0x307b4d);TeamEvents['on'](_0x58f94d,_0x6150d4);}}; \ No newline at end of file +var _0xc9be=['register','length','team:','./team.events','save','remove','update','emit','removeListener'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc9be,0x1aa));var _0xec9b=function(_0x5176b1,_0x150df0){_0x5176b1=_0x5176b1-0x0;var _0x71e0de=_0xc9be[_0x5176b1];return _0x71e0de;};'use strict';var TeamEvents=require(_0xec9b('0x0'));var events=[_0xec9b('0x1'),_0xec9b('0x2'),_0xec9b('0x3')];function createListener(_0x3911a8,_0x4c007d){return function(_0x2caf74){_0x4c007d[_0xec9b('0x4')](_0x3911a8,_0x2caf74);};}function removeListener(_0x31c8a6,_0x32ffc4){return function(){TeamEvents[_0xec9b('0x5')](_0x31c8a6,_0x32ffc4);};}exports[_0xec9b('0x6')]=function(_0x1c4b1c){for(var _0x5f33eb=0x0,_0x1d4a65=events[_0xec9b('0x7')];_0x5f33eb<_0x1d4a65;_0x5f33eb++){var _0x543d32=events[_0x5f33eb];var _0x2961c5=createListener(_0xec9b('0x8')+_0x543d32,_0x1c4b1c);TeamEvents['on'](_0x543d32,_0x2961c5);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index a23007b..3816a7c 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 _0x1317=['INTEGER','sequelize'];(function(_0x1b3a09,_0x20c774){var _0x357bb8=function(_0xd7c6d2){while(--_0xd7c6d2){_0x1b3a09['push'](_0x1b3a09['shift']());}};_0x357bb8(++_0x20c774);}(_0x1317,0xa3));var _0x7131=function(_0x231646,_0x5ef603){_0x231646=_0x231646-0x0;var _0x450975=_0x1317[_0x231646];return _0x450975;};'use strict';var Sequelize=require(_0x7131('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x7131('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x80d9=['exports','INTEGER','sequelize'];(function(_0x16e5bc,_0x4209bf){var _0x267b1b=function(_0x170b0f){while(--_0x170b0f){_0x16e5bc['push'](_0x16e5bc['shift']());}};_0x267b1b(++_0x4209bf);}(_0x80d9,0xb6));var _0x980d=function(_0x4913e9,_0x40ebc6){_0x4913e9=_0x4913e9-0x0;var _0x52eb7c=_0x80d9[_0x4913e9];return _0x52eb7c;};'use strict';var Sequelize=require(_0x980d('0x0'));module[_0x980d('0x1')]={'TeamId':{'type':Sequelize[_0x980d('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x980d('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index fc6ba2e..d267226 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 _0xdd6e=['request-promise','path','rimraf','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','bluebird'];(function(_0x19fda6,_0xc58040){var _0x5bde4d=function(_0x4bc167){while(--_0x4bc167){_0x19fda6['push'](_0x19fda6['shift']());}};_0x5bde4d(++_0xc58040);}(_0xdd6e,0xa5));var _0xedd6=function(_0x5a27c3,_0x4d6ce9){_0x5a27c3=_0x5a27c3-0x0;var _0x1fc620=_0xdd6e[_0x5a27c3];return _0x1fc620;};'use strict';var _=require(_0xedd6('0x0'));var util=require(_0xedd6('0x1'));var logger=require(_0xedd6('0x2'))(_0xedd6('0x3'));var moment=require('moment');var BPromise=require(_0xedd6('0x4'));var rp=require(_0xedd6('0x5'));var fs=require('fs');var path=require(_0xedd6('0x6'));var rimraf=require(_0xedd6('0x7'));var config=require('../../config/environment');var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x3430b2,_0x27b159){return _0x3430b2['define'](_0xedd6('0x8'),attributes,{'tableName':_0xedd6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9147=['./teamVoicePrefix.attributes','define','team_has_voice_prefixes','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4e554f,_0x3d5c9f){var _0x4978e0=function(_0x334e27){while(--_0x334e27){_0x4e554f['push'](_0x4e554f['shift']());}};_0x4978e0(++_0x3d5c9f);}(_0x9147,0x7b));var _0x7914=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x9147[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x7914('0x0'));var util=require(_0x7914('0x1'));var logger=require('../../config/logger')(_0x7914('0x2'));var moment=require('moment');var BPromise=require(_0x7914('0x3'));var rp=require(_0x7914('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7914('0x5'));var config=require(_0x7914('0x6'));var attributes=require(_0x7914('0x7'));module['exports']=function(_0x34c372,_0x4dd321){return _0x34c372[_0x7914('0x8')]('TeamVoicePrefix',attributes,{'tableName':_0x7914('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index ecc9695..e3398be 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x159b61,_0x3f405b){var _0x44766d=function(_0x23a7c6){while(--_0x23a7c6){_0x159b61['push'](_0x159b61['shift']());}};_0x44766d(++_0x3f405b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x9e5cfb,_0x5e1a0f){var _0x5a3140=function(_0x287290){while(--_0x287290){_0x9e5cfb['push'](_0x9e5cfb['shift']());}};_0x5a3140(++_0x5e1a0f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 25829ca..70db665 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 _0x3e84=['INTEGER','sequelize','exports'];(function(_0x3d9860,_0x1fcd9f){var _0xb0e2f4=function(_0x347cd0){while(--_0x347cd0){_0x3d9860['push'](_0x3d9860['shift']());}};_0xb0e2f4(++_0x1fcd9f);}(_0x3e84,0xaf));var _0x43e8=function(_0x4daaa1,_0x4a1bbd){_0x4daaa1=_0x4daaa1-0x0;var _0x37a1fd=_0x3e84[_0x4daaa1];return _0x37a1fd;};'use strict';var Sequelize=require(_0x43e8('0x0'));module[_0x43e8('0x1')]={'penalty':{'type':Sequelize[_0x43e8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8644=['INTEGER','sequelize','exports'];(function(_0x533efa,_0x4edcbf){var _0x2984bd=function(_0x3830e3){while(--_0x3830e3){_0x533efa['push'](_0x533efa['shift']());}};_0x2984bd(++_0x4edcbf);}(_0x8644,0x12a));var _0x4864=function(_0x3a3889,_0x7d9c8c){_0x3a3889=_0x3a3889-0x0;var _0x420935=_0x8644[_0x3a3889];return _0x420935;};'use strict';var Sequelize=require(_0x4864('0x0'));module[_0x4864('0x1')]={'penalty':{'type':Sequelize[_0x4864('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 06696da..4364b34 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 _0xfd28=['rimraf','./teamVoiceQueue.attributes','exports','define','util','../../config/logger','moment','request-promise','path'];(function(_0x5cff55,_0xaa0263){var _0xefb183=function(_0x1521f8){while(--_0x1521f8){_0x5cff55['push'](_0x5cff55['shift']());}};_0xefb183(++_0xaa0263);}(_0xfd28,0x148));var _0x8fd2=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xfd28[_0x28aea5];return _0x6a55f9;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var logger=require(_0x8fd2('0x1'))('api');var moment=require(_0x8fd2('0x2'));var BPromise=require('bluebird');var rp=require(_0x8fd2('0x3'));var fs=require('fs');var path=require(_0x8fd2('0x4'));var rimraf=require(_0x8fd2('0x5'));var config=require('../../config/environment');var attributes=require(_0x8fd2('0x6'));module[_0x8fd2('0x7')]=function(_0x2ee87e,_0x36178a){return _0x2ee87e[_0x8fd2('0x8')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32ef=['api','moment','bluebird','path','rimraf','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','lodash','util','../../config/logger'];(function(_0x12c280,_0x51dd07){var _0x3638d3=function(_0x53b273){while(--_0x53b273){_0x12c280['push'](_0x12c280['shift']());}};_0x3638d3(++_0x51dd07);}(_0x32ef,0xf9));var _0xf32e=function(_0x1efd37,_0x3c4162){_0x1efd37=_0x1efd37-0x0;var _0x5e7191=_0x32ef[_0x1efd37];return _0x5e7191;};'use strict';var _=require(_0xf32e('0x0'));var util=require(_0xf32e('0x1'));var logger=require(_0xf32e('0x2'))(_0xf32e('0x3'));var moment=require(_0xf32e('0x4'));var BPromise=require(_0xf32e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf32e('0x6'));var rimraf=require(_0xf32e('0x7'));var config=require('../../config/environment');var attributes=require(_0xf32e('0x8'));module[_0xf32e('0x9')]=function(_0x1a7d35,_0x1062c8){return _0x1a7d35[_0xf32e('0xa')](_0xf32e('0xb'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 966987e..11a951e 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 _0xcd16=['stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xcd16,0x13e));var _0x6cd1=function(_0x3c6b2c,_0x116d2a){_0x3c6b2c=_0x3c6b2c-0x0;var _0x2d1fa5=_0xcd16[_0x3c6b2c];return _0x2d1fa5;};'use strict';var _=require(_0x6cd1('0x0'));var util=require(_0x6cd1('0x1'));var moment=require(_0x6cd1('0x2'));var BPromise=require(_0x6cd1('0x3'));var rs=require(_0x6cd1('0x4'));var fs=require('fs');var Redis=require(_0x6cd1('0x5'));var db=require(_0x6cd1('0x6'))['db'];var utils=require(_0x6cd1('0x7'));var logger=require(_0x6cd1('0x8'))(_0x6cd1('0x9'));var config=require(_0x6cd1('0xa'));var jayson=require(_0x6cd1('0xb'));var client=jayson[_0x6cd1('0xc')][_0x6cd1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x34feab,_0xf63763,_0x184136){return new BPromise(function(_0xbcf2b6,_0x1eb0ea){return client['request'](_0x34feab,_0x184136)[_0x6cd1('0xe')](function(_0x3bc8ff){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0xf63763,_0x6cd1('0xf'));logger[_0x6cd1('0x10')](_0x6cd1('0x11'),_0xf63763,_0x6cd1('0xf'),JSON[_0x6cd1('0x12')](_0x3bc8ff));if(_0x3bc8ff['error']){if(_0x3bc8ff[_0x6cd1('0x13')][_0x6cd1('0x14')]===0x1f4){logger['error'](_0x6cd1('0x15'),_0xf63763,_0x3bc8ff[_0x6cd1('0x13')][_0x6cd1('0x16')]);return _0x1eb0ea(_0x3bc8ff['error'][_0x6cd1('0x16')]);}logger[_0x6cd1('0x13')](_0x6cd1('0x15'),_0xf63763,_0x3bc8ff[_0x6cd1('0x13')][_0x6cd1('0x16')]);return _0xbcf2b6(_0x3bc8ff[_0x6cd1('0x13')]['message']);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0xf63763,_0x6cd1('0xf'));_0xbcf2b6(_0x3bc8ff[_0x6cd1('0x17')][_0x6cd1('0x16')]);}})['catch'](function(_0x3936cc){logger[_0x6cd1('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0xf63763,_0x3936cc);_0x1eb0ea(_0x3936cc);});});} \ No newline at end of file +var _0x608c=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x207ebf,_0x42ad03){var _0x5195be=function(_0x2b0af5){while(--_0x2b0af5){_0x207ebf['push'](_0x207ebf['shift']());}};_0x5195be(++_0x42ad03);}(_0x608c,0x1a1));var _0xc608=function(_0x1bffb8,_0x48a178){_0x1bffb8=_0x1bffb8-0x0;var _0x24cd6e=_0x608c[_0x1bffb8];return _0x24cd6e;};'use strict';var _=require(_0xc608('0x0'));var util=require('util');var moment=require(_0xc608('0x1'));var BPromise=require(_0xc608('0x2'));var rs=require(_0xc608('0x3'));var fs=require('fs');var Redis=require(_0xc608('0x4'));var db=require(_0xc608('0x5'))['db'];var utils=require(_0xc608('0x6'));var logger=require(_0xc608('0x7'))(_0xc608('0x8'));var config=require(_0xc608('0x9'));var jayson=require(_0xc608('0xa'));var client=jayson[_0xc608('0xb')][_0xc608('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ff103,_0x589621,_0x320ff6){return new BPromise(function(_0x4d5568,_0x1f39dc){return client[_0xc608('0xd')](_0x4ff103,_0x320ff6)[_0xc608('0xe')](function(_0x10736a){logger[_0xc608('0xf')](_0xc608('0x10'),_0x589621,_0xc608('0x11'));logger[_0xc608('0x12')](_0xc608('0x13'),_0x589621,_0xc608('0x11'),JSON[_0xc608('0x14')](_0x10736a));if(_0x10736a[_0xc608('0x15')]){if(_0x10736a[_0xc608('0x15')]['code']===0x1f4){logger[_0xc608('0x15')](_0xc608('0x10'),_0x589621,_0x10736a[_0xc608('0x15')][_0xc608('0x16')]);return _0x1f39dc(_0x10736a[_0xc608('0x15')][_0xc608('0x16')]);}logger[_0xc608('0x15')]('TeamVoiceQueue,\x20%s,\x20%s',_0x589621,_0x10736a[_0xc608('0x15')][_0xc608('0x16')]);return _0x4d5568(_0x10736a['error'][_0xc608('0x16')]);}else{logger['info'](_0xc608('0x10'),_0x589621,_0xc608('0x11'));_0x4d5568(_0x10736a[_0xc608('0x17')]['message']);}})[_0xc608('0x18')](function(_0x405c3e){logger[_0xc608('0x15')]('TeamVoiceQueue,\x20%s,\x20%s',_0x589621,_0x405c3e);_0x1f39dc(_0x405c3e);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 95477f3..a634d06 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 _0x63a6=['/:id','post','isAuthenticated','create','update','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x63a6,0x1c7));var _0x663a=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0x63a6[_0x2f227c];return _0x5032bc;};'use strict';var multer=require('multer');var util=require(_0x663a('0x0'));var path=require(_0x663a('0x1'));var timeout=require('connect-timeout');var express=require(_0x663a('0x2'));var router=express[_0x663a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x663a('0x4'));var interaction=require(_0x663a('0x5'));var config=require(_0x663a('0x6'));var controller=require(_0x663a('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x663a('0x8')](_0x663a('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x663a('0xa')]('/',auth[_0x663a('0xb')](),controller[_0x663a('0xc')]);router['put']('/:id',auth[_0x663a('0xb')](),controller[_0x663a('0xd')]);router[_0x663a('0xe')](_0x663a('0x9'),auth[_0x663a('0xb')](),controller[_0x663a('0xf')]);module['exports']=router; \ No newline at end of file +var _0xaa56=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x50ce51,_0x3a6821){var _0x244cbb=function(_0x2e3487){while(--_0x2e3487){_0x50ce51['push'](_0x50ce51['shift']());}};_0x244cbb(++_0x3a6821);}(_0xaa56,0xc6));var _0x6aa5=function(_0x3c0e95,_0x8d1530){_0x3c0e95=_0x3c0e95-0x0;var _0x3ccd54=_0xaa56[_0x3c0e95];return _0x3ccd54;};'use strict';var multer=require('multer');var util=require(_0x6aa5('0x0'));var path=require(_0x6aa5('0x1'));var timeout=require(_0x6aa5('0x2'));var express=require('express');var router=express[_0x6aa5('0x3')]();var fs_extra=require(_0x6aa5('0x4'));var auth=require(_0x6aa5('0x5'));var interaction=require(_0x6aa5('0x6'));var config=require(_0x6aa5('0x7'));var controller=require('./template.controller');router[_0x6aa5('0x8')]('/',auth['isAuthenticated'](),controller[_0x6aa5('0x9')]);router[_0x6aa5('0x8')]('/:id',auth[_0x6aa5('0xa')](),controller[_0x6aa5('0xb')]);router[_0x6aa5('0xc')]('/',auth[_0x6aa5('0xa')](),controller[_0x6aa5('0xd')]);router[_0x6aa5('0xe')](_0x6aa5('0xf'),auth[_0x6aa5('0xa')](),controller[_0x6aa5('0x10')]);router[_0x6aa5('0x11')](_0x6aa5('0xf'),auth[_0x6aa5('0xa')](),controller[_0x6aa5('0x12')]);module[_0x6aa5('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 4eb039c..81f5c73 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 _0xd6e6=['exports','STRING','TEXT'];(function(_0x27fbff,_0xa6abac){var _0xd2b232=function(_0x3a91e8){while(--_0x3a91e8){_0x27fbff['push'](_0x27fbff['shift']());}};_0xd2b232(++_0xa6abac);}(_0xd6e6,0xcc));var _0x6d6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd6e6[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x6d6e('0x0')]={'name':{'type':Sequelize[_0x6d6e('0x1')]},'description':{'type':Sequelize[_0x6d6e('0x1')]},'html':{'type':Sequelize[_0x6d6e('0x2')]}}; \ No newline at end of file +var _0xd3fe=['STRING','TEXT','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3fe,0x18e));var _0xed3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xed3f('0x0'));module[_0xed3f('0x1')]={'name':{'type':Sequelize[_0xed3f('0x2')]},'description':{'type':Sequelize[_0xed3f('0x2')]},'html':{'type':Sequelize[_0xed3f('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 6fb0a49..04ffdf9 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 _0xb008=['crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','where','pick','VIRTUAL','filter','options','Template','includeAll','include','findAll','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel'];(function(_0x382f6a,_0x2b25ac){var _0x367fb1=function(_0x564b98){while(--_0x564b98){_0x382f6a['push'](_0x382f6a['shift']());}};_0x367fb1(++_0x2b25ac);}(_0xb008,0x170));var _0x8b00=function(_0x644dd,_0xfb2b00){_0x644dd=_0x644dd-0x0;var _0x4d88b3=_0xb008[_0x644dd];return _0x4d88b3;};'use strict';var emlformat=require(_0x8b00('0x0'));var rimraf=require(_0x8b00('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b00('0x2'));var rp=require(_0x8b00('0x3'));var moment=require(_0x8b00('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8b00('0x5'));var util=require(_0x8b00('0x6'));var path=require(_0x8b00('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8b00('0x8'));var fs=require('fs');var fs_extra=require(_0x8b00('0x9'));var _=require(_0x8b00('0xa'));var squel=require(_0x8b00('0xb'));var crypto=require(_0x8b00('0xc'));var jsforce=require(_0x8b00('0xd'));var deskjs=require(_0x8b00('0xe'));var toCsv=require(_0x8b00('0xf'));var querystring=require('querystring');var Papa=require(_0x8b00('0x10'));var Redis=require(_0x8b00('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8b00('0x12'));var as=require(_0x8b00('0x13'));var hardwareService=require(_0x8b00('0x14'));var logger=require('../../config/logger')(_0x8b00('0x15'));var utils=require(_0x8b00('0x16'));var config=require(_0x8b00('0x17'));var licenseUtil=require(_0x8b00('0x18'));var db=require(_0x8b00('0x19'))['db'];function respondWithStatusCode(_0x214a4c,_0xb7163d){_0xb7163d=_0xb7163d||0xcc;return function(_0x40e405){if(_0x40e405){return _0x214a4c['sendStatus'](_0xb7163d);}return _0x214a4c[_0x8b00('0x1a')](_0xb7163d)[_0x8b00('0x1b')]();};}function respondWithResult(_0x236ec4,_0x244864){_0x244864=_0x244864||0xc8;return function(_0x350dc9){if(_0x350dc9){return _0x236ec4[_0x8b00('0x1a')](_0x244864)['json'](_0x350dc9);}};}function respondWithFilteredResult(_0x2bd01b,_0x231e3f){return function(_0x3a09a6){if(_0x3a09a6){var _0x5233ca=typeof _0x231e3f[_0x8b00('0x1c')]==='undefined'&&typeof _0x231e3f[_0x8b00('0x1d')]===_0x8b00('0x1e');var _0x2bef4d=_0x3a09a6[_0x8b00('0x1f')];var _0x397e31=_0x5233ca?0x0:_0x231e3f['offset'];var _0xc25f6e=_0x5233ca?_0x3a09a6[_0x8b00('0x1f')]:_0x231e3f[_0x8b00('0x1c')]+_0x231e3f[_0x8b00('0x1d')];var _0x264ed2;if(_0xc25f6e>=_0x2bef4d){_0xc25f6e=_0x2bef4d;_0x264ed2=0xc8;}else{_0x264ed2=0xce;}_0x2bd01b['status'](_0x264ed2);return _0x2bd01b['set'](_0x8b00('0x20'),_0x397e31+'-'+_0xc25f6e+'/'+_0x2bef4d)['json'](_0x3a09a6);}return null;};}function patchUpdates(_0x3d9ba0){return function(_0x428ba1){try{jsonpatch[_0x8b00('0x21')](_0x428ba1,_0x3d9ba0,!![]);}catch(_0x3c4606){return BPromise[_0x8b00('0x22')](_0x3c4606);}return _0x428ba1['save']();};}function saveUpdates(_0x2480d7,_0x1e2cdf){return function(_0x1bab46){if(_0x1bab46){return _0x1bab46[_0x8b00('0x23')](_0x2480d7)[_0x8b00('0x24')](function(_0x51adad){return _0x51adad;});}return null;};}function removeEntity(_0x52af1f,_0x5a1d86){return function(_0x3dd4ad){if(_0x3dd4ad){return _0x3dd4ad['destroy']()[_0x8b00('0x24')](function(){var _0x34632a=_0x3dd4ad[_0x8b00('0x25')]({'plain':!![]});var _0x321748='Templates';return db[_0x8b00('0x26')][_0x8b00('0x27')]({'where':{'type':_0x321748,'resourceId':_0x34632a['id']}})[_0x8b00('0x24')](function(){return _0x3dd4ad;});})[_0x8b00('0x24')](function(){_0x52af1f[_0x8b00('0x1a')](0xcc)[_0x8b00('0x1b')]();});}};}function handleEntityNotFound(_0x1c5d02,_0x4ae54f){return function(_0x2d9772){if(!_0x2d9772){_0x1c5d02['sendStatus'](0x194);}return _0x2d9772;};}function handleError(_0x1c15fc,_0x297ee0){_0x297ee0=_0x297ee0||0x1f4;return function(_0x592424){logger['error'](_0x592424[_0x8b00('0x28')]);if(_0x592424[_0x8b00('0x29')]){delete _0x592424[_0x8b00('0x29')];}_0x1c15fc[_0x8b00('0x1a')](_0x297ee0)[_0x8b00('0x2a')](_0x592424);};}exports['index']=function(_0x3d6d4e,_0x1fe616){var _0x4d6026={},_0x3b5c54={},_0x21d09f={'count':0x0,'rows':[]};var _0x42c838=_[_0x8b00('0x2b')](db['Template'][_0x8b00('0x2c')],function(_0x1e66c4){return{'name':_0x1e66c4['fieldName'],'type':_0x1e66c4[_0x8b00('0x2d')][_0x8b00('0x2e')]};});_0x3b5c54[_0x8b00('0x2f')]=_[_0x8b00('0x2b')](_0x42c838,_0x8b00('0x29'));_0x3b5c54[_0x8b00('0x30')]=_[_0x8b00('0x31')](_0x3d6d4e[_0x8b00('0x30')]);_0x3b5c54[_0x8b00('0x32')]=_['intersection'](_0x3b5c54[_0x8b00('0x2f')],_0x3b5c54[_0x8b00('0x30')]);_0x4d6026[_0x8b00('0x33')]=_[_0x8b00('0x34')](_0x3b5c54['model'],qs[_0x8b00('0x35')](_0x3d6d4e[_0x8b00('0x30')][_0x8b00('0x35')]));_0x4d6026[_0x8b00('0x33')]=_0x4d6026[_0x8b00('0x33')][_0x8b00('0x36')]?_0x4d6026[_0x8b00('0x33')]:_0x3b5c54['model'];if(!_0x3d6d4e[_0x8b00('0x30')][_0x8b00('0x37')]('nolimit')){_0x4d6026[_0x8b00('0x1d')]=qs[_0x8b00('0x1d')](_0x3d6d4e[_0x8b00('0x30')][_0x8b00('0x1d')]);_0x4d6026[_0x8b00('0x1c')]=qs['offset'](_0x3d6d4e[_0x8b00('0x30')][_0x8b00('0x1c')]);}_0x4d6026['order']=qs['sort'](_0x3d6d4e[_0x8b00('0x30')]['sort']);_0x4d6026[_0x8b00('0x38')]=qs[_0x8b00('0x32')](_[_0x8b00('0x39')](_0x3d6d4e[_0x8b00('0x30')],_0x3b5c54[_0x8b00('0x32')]),_0x42c838);if(_0x3d6d4e[_0x8b00('0x30')]['filter']){_0x4d6026['where']=_['merge'](_0x4d6026[_0x8b00('0x38')],{'$or':_[_0x8b00('0x2b')](_0x42c838,function(_0x44d24b){if(_0x44d24b['type']!==_0x8b00('0x3a')){var _0x3643d0={};_0x3643d0[_0x44d24b[_0x8b00('0x29')]]={'$like':'%'+_0x3d6d4e[_0x8b00('0x30')][_0x8b00('0x3b')]+'%'};return _0x3643d0;}})});}_0x4d6026=_['merge']({},_0x4d6026,_0x3d6d4e[_0x8b00('0x3c')]);var _0x19b978={'where':_0x4d6026[_0x8b00('0x38')]};return db[_0x8b00('0x3d')]['count'](_0x19b978)['then'](function(_0x4a0293){_0x21d09f[_0x8b00('0x1f')]=_0x4a0293;if(_0x3d6d4e[_0x8b00('0x30')][_0x8b00('0x3e')]){_0x4d6026[_0x8b00('0x3f')]=[{'all':!![]}];}return db[_0x8b00('0x3d')][_0x8b00('0x40')](_0x4d6026);})[_0x8b00('0x24')](function(_0x356312){_0x21d09f['rows']=_0x356312;return _0x21d09f;})[_0x8b00('0x24')](respondWithFilteredResult(_0x1fe616,_0x4d6026))['catch'](handleError(_0x1fe616,null));};exports['show']=function(_0x527c13,_0x422ee0){var _0x1302ab={'raw':!![],'where':{'id':_0x527c13[_0x8b00('0x41')]['id']}},_0x56899b={};_0x56899b[_0x8b00('0x2f')]=_['keys'](db[_0x8b00('0x3d')]['rawAttributes']);_0x56899b[_0x8b00('0x30')]=_[_0x8b00('0x31')](_0x527c13[_0x8b00('0x30')]);_0x56899b[_0x8b00('0x32')]=_[_0x8b00('0x34')](_0x56899b[_0x8b00('0x2f')],_0x56899b['query']);_0x1302ab[_0x8b00('0x33')]=_[_0x8b00('0x34')](_0x56899b[_0x8b00('0x2f')],qs[_0x8b00('0x35')](_0x527c13['query'][_0x8b00('0x35')]));_0x1302ab[_0x8b00('0x33')]=_0x1302ab[_0x8b00('0x33')][_0x8b00('0x36')]?_0x1302ab[_0x8b00('0x33')]:_0x56899b[_0x8b00('0x2f')];if(_0x527c13[_0x8b00('0x30')][_0x8b00('0x3e')]){_0x1302ab[_0x8b00('0x3f')]=[{'all':!![]}];}_0x1302ab=_['merge']({},_0x1302ab,_0x527c13[_0x8b00('0x3c')]);return db[_0x8b00('0x3d')][_0x8b00('0x42')](_0x1302ab)[_0x8b00('0x24')](handleEntityNotFound(_0x422ee0,null))[_0x8b00('0x24')](respondWithResult(_0x422ee0,null))[_0x8b00('0x43')](handleError(_0x422ee0,null));};exports[_0x8b00('0x44')]=function(_0x5116fb,_0x22ae0e){return db['Template'][_0x8b00('0x44')](_0x5116fb[_0x8b00('0x45')],{})['then'](function(_0x4ca1f1){var _0x20a333=_0x5116fb['user'][_0x8b00('0x25')]({'plain':!![]});if(!_0x20a333)throw new Error(_0x8b00('0x46'));if(_0x20a333[_0x8b00('0x47')]===_0x8b00('0x48')){var _0x220eff=_0x4ca1f1[_0x8b00('0x25')]({'plain':!![]});var _0x20c385=_0x8b00('0x49');return db['UserProfileSection'][_0x8b00('0x42')]({'where':{'name':_0x20c385,'userProfileId':_0x20a333['userProfileId']},'raw':!![]})['then'](function(_0x52081f){if(_0x52081f&&_0x52081f[_0x8b00('0x4a')]===0x0){return db['UserProfileResource'][_0x8b00('0x44')]({'name':_0x220eff[_0x8b00('0x29')],'resourceId':_0x220eff['id'],'type':_0x52081f[_0x8b00('0x29')],'sectionId':_0x52081f['id']},{})[_0x8b00('0x24')](function(){return _0x4ca1f1;});}else{return _0x4ca1f1;}})[_0x8b00('0x43')](function(_0x646bc7){logger['error'](_0x8b00('0x4b'),_0x646bc7);throw _0x646bc7;});}return _0x4ca1f1;})[_0x8b00('0x24')](respondWithResult(_0x22ae0e,0xc9))[_0x8b00('0x43')](handleError(_0x22ae0e,null));};exports[_0x8b00('0x23')]=function(_0x2e7d22,_0x5b45d2){if(_0x2e7d22[_0x8b00('0x45')]['id']){delete _0x2e7d22[_0x8b00('0x45')]['id'];}return db['Template'][_0x8b00('0x42')]({'where':{'id':_0x2e7d22[_0x8b00('0x41')]['id']}})[_0x8b00('0x24')](handleEntityNotFound(_0x5b45d2,null))[_0x8b00('0x24')](saveUpdates(_0x2e7d22[_0x8b00('0x45')],null))[_0x8b00('0x24')](respondWithResult(_0x5b45d2,null))[_0x8b00('0x43')](handleError(_0x5b45d2,null));};exports[_0x8b00('0x27')]=function(_0x115684,_0x295c21){return db['Template'][_0x8b00('0x42')]({'where':{'id':_0x115684['params']['id']}})[_0x8b00('0x24')](handleEntityNotFound(_0x295c21,null))[_0x8b00('0x24')](removeEntity(_0x295c21,null))[_0x8b00('0x43')](handleError(_0x295c21,null));}; \ No newline at end of file +var _0x4d31=['save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','type','VIRTUAL','Template','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','status','undefined','limit','count','offset','set','json','apply','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d31,0x82));var _0x14d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4d31[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x14d3('0x0'));var rimraf=require(_0x14d3('0x1'));var zipdir=require(_0x14d3('0x2'));var jsonpatch=require(_0x14d3('0x3'));var rp=require(_0x14d3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x14d3('0x5'));var util=require(_0x14d3('0x6'));var path=require(_0x14d3('0x7'));var sox=require('sox');var csv=require(_0x14d3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x14d3('0x9'));var _=require(_0x14d3('0xa'));var squel=require(_0x14d3('0xb'));var crypto=require(_0x14d3('0xc'));var jsforce=require(_0x14d3('0xd'));var deskjs=require(_0x14d3('0xe'));var toCsv=require(_0x14d3('0x8'));var querystring=require('querystring');var Papa=require(_0x14d3('0xf'));var Redis=require(_0x14d3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14d3('0x11'));var logger=require(_0x14d3('0x12'))(_0x14d3('0x13'));var utils=require(_0x14d3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x14d3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23e999,_0x4cdb0e){_0x4cdb0e=_0x4cdb0e||0xcc;return function(_0x5a61a1){if(_0x5a61a1){return _0x23e999['sendStatus'](_0x4cdb0e);}return _0x23e999['status'](_0x4cdb0e)[_0x14d3('0x16')]();};}function respondWithResult(_0x5806c0,_0x5aa9c4){_0x5aa9c4=_0x5aa9c4||0xc8;return function(_0x356cac){if(_0x356cac){return _0x5806c0[_0x14d3('0x17')](_0x5aa9c4)['json'](_0x356cac);}};}function respondWithFilteredResult(_0x171798,_0x3788e5){return function(_0x35b72b){if(_0x35b72b){var _0xec9b3=typeof _0x3788e5['offset']===_0x14d3('0x18')&&typeof _0x3788e5[_0x14d3('0x19')]===_0x14d3('0x18');var _0x15e245=_0x35b72b[_0x14d3('0x1a')];var _0x18f28a=_0xec9b3?0x0:_0x3788e5[_0x14d3('0x1b')];var _0x54f787=_0xec9b3?_0x35b72b[_0x14d3('0x1a')]:_0x3788e5[_0x14d3('0x1b')]+_0x3788e5[_0x14d3('0x19')];var _0x2f08c7;if(_0x54f787>=_0x15e245){_0x54f787=_0x15e245;_0x2f08c7=0xc8;}else{_0x2f08c7=0xce;}_0x171798[_0x14d3('0x17')](_0x2f08c7);return _0x171798[_0x14d3('0x1c')]('Content-Range',_0x18f28a+'-'+_0x54f787+'/'+_0x15e245)[_0x14d3('0x1d')](_0x35b72b);}return null;};}function patchUpdates(_0x4f53c5){return function(_0x382c79){try{jsonpatch[_0x14d3('0x1e')](_0x382c79,_0x4f53c5,!![]);}catch(_0x4ae04c){return BPromise[_0x14d3('0x1f')](_0x4ae04c);}return _0x382c79[_0x14d3('0x20')]();};}function saveUpdates(_0x7a1a25,_0x2a92d0){return function(_0x35ff27){if(_0x35ff27){return _0x35ff27[_0x14d3('0x21')](_0x7a1a25)['then'](function(_0x26ae70){return _0x26ae70;});}return null;};}function removeEntity(_0x4d641a,_0x56a250){return function(_0x4adcc5){if(_0x4adcc5){return _0x4adcc5['destroy']()[_0x14d3('0x22')](function(){var _0x453afb=_0x4adcc5[_0x14d3('0x23')]({'plain':!![]});var _0x218a8c='Templates';return db[_0x14d3('0x24')][_0x14d3('0x25')]({'where':{'type':_0x218a8c,'resourceId':_0x453afb['id']}})[_0x14d3('0x22')](function(){return _0x4adcc5;});})['then'](function(){_0x4d641a[_0x14d3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x130289,_0x28f411){return function(_0x2d64bb){if(!_0x2d64bb){_0x130289[_0x14d3('0x26')](0x194);}return _0x2d64bb;};}function handleError(_0x13de1b,_0x5d0d29){_0x5d0d29=_0x5d0d29||0x1f4;return function(_0x6121e5){logger[_0x14d3('0x27')](_0x6121e5[_0x14d3('0x28')]);if(_0x6121e5[_0x14d3('0x29')]){delete _0x6121e5['name'];}_0x13de1b[_0x14d3('0x17')](_0x5d0d29)[_0x14d3('0x2a')](_0x6121e5);};}exports[_0x14d3('0x2b')]=function(_0x2745e7,_0x36f520){var _0x373b46={},_0x90e485={},_0xc95846={'count':0x0,'rows':[]};var _0x43293f=_[_0x14d3('0x2c')](db['Template']['rawAttributes'],function(_0x8b2359){return{'name':_0x8b2359['fieldName'],'type':_0x8b2359['type'][_0x14d3('0x2d')]};});_0x90e485['model']=_[_0x14d3('0x2c')](_0x43293f,_0x14d3('0x29'));_0x90e485[_0x14d3('0x2e')]=_[_0x14d3('0x2f')](_0x2745e7[_0x14d3('0x2e')]);_0x90e485[_0x14d3('0x30')]=_[_0x14d3('0x31')](_0x90e485[_0x14d3('0x32')],_0x90e485[_0x14d3('0x2e')]);_0x373b46[_0x14d3('0x33')]=_[_0x14d3('0x31')](_0x90e485[_0x14d3('0x32')],qs[_0x14d3('0x34')](_0x2745e7[_0x14d3('0x2e')][_0x14d3('0x34')]));_0x373b46['attributes']=_0x373b46['attributes'][_0x14d3('0x35')]?_0x373b46[_0x14d3('0x33')]:_0x90e485['model'];if(!_0x2745e7['query'][_0x14d3('0x36')](_0x14d3('0x37'))){_0x373b46[_0x14d3('0x19')]=qs['limit'](_0x2745e7[_0x14d3('0x2e')]['limit']);_0x373b46[_0x14d3('0x1b')]=qs[_0x14d3('0x1b')](_0x2745e7[_0x14d3('0x2e')][_0x14d3('0x1b')]);}_0x373b46[_0x14d3('0x38')]=qs['sort'](_0x2745e7[_0x14d3('0x2e')]['sort']);_0x373b46[_0x14d3('0x39')]=qs[_0x14d3('0x30')](_['pick'](_0x2745e7[_0x14d3('0x2e')],_0x90e485[_0x14d3('0x30')]),_0x43293f);if(_0x2745e7[_0x14d3('0x2e')]['filter']){_0x373b46['where']=_[_0x14d3('0x3a')](_0x373b46['where'],{'$or':_[_0x14d3('0x2c')](_0x43293f,function(_0x560dee){if(_0x560dee[_0x14d3('0x3b')]!==_0x14d3('0x3c')){var _0x1ac9f0={};_0x1ac9f0[_0x560dee[_0x14d3('0x29')]]={'$like':'%'+_0x2745e7[_0x14d3('0x2e')]['filter']+'%'};return _0x1ac9f0;}})});}_0x373b46=_['merge']({},_0x373b46,_0x2745e7['options']);var _0x327c82={'where':_0x373b46[_0x14d3('0x39')]};return db[_0x14d3('0x3d')][_0x14d3('0x1a')](_0x327c82)[_0x14d3('0x22')](function(_0x340b47){_0xc95846[_0x14d3('0x1a')]=_0x340b47;if(_0x2745e7['query'][_0x14d3('0x3e')]){_0x373b46[_0x14d3('0x3f')]=[{'all':!![]}];}return db['Template'][_0x14d3('0x40')](_0x373b46);})[_0x14d3('0x22')](function(_0x21704f){_0xc95846[_0x14d3('0x41')]=_0x21704f;return _0xc95846;})['then'](respondWithFilteredResult(_0x36f520,_0x373b46))[_0x14d3('0x42')](handleError(_0x36f520,null));};exports[_0x14d3('0x43')]=function(_0x2e0941,_0x4229c5){var _0x5c2453={'raw':!![],'where':{'id':_0x2e0941[_0x14d3('0x44')]['id']}},_0x27c210={};_0x27c210[_0x14d3('0x32')]=_[_0x14d3('0x2f')](db['Template'][_0x14d3('0x45')]);_0x27c210[_0x14d3('0x2e')]=_['keys'](_0x2e0941[_0x14d3('0x2e')]);_0x27c210[_0x14d3('0x30')]=_[_0x14d3('0x31')](_0x27c210[_0x14d3('0x32')],_0x27c210['query']);_0x5c2453['attributes']=_['intersection'](_0x27c210[_0x14d3('0x32')],qs[_0x14d3('0x34')](_0x2e0941[_0x14d3('0x2e')][_0x14d3('0x34')]));_0x5c2453[_0x14d3('0x33')]=_0x5c2453['attributes']['length']?_0x5c2453[_0x14d3('0x33')]:_0x27c210[_0x14d3('0x32')];if(_0x2e0941[_0x14d3('0x2e')]['includeAll']){_0x5c2453['include']=[{'all':!![]}];}_0x5c2453=_[_0x14d3('0x3a')]({},_0x5c2453,_0x2e0941[_0x14d3('0x46')]);return db[_0x14d3('0x3d')][_0x14d3('0x47')](_0x5c2453)[_0x14d3('0x22')](handleEntityNotFound(_0x4229c5,null))[_0x14d3('0x22')](respondWithResult(_0x4229c5,null))[_0x14d3('0x42')](handleError(_0x4229c5,null));};exports[_0x14d3('0x48')]=function(_0x5e9c4e,_0x5ef4f8){return db[_0x14d3('0x3d')][_0x14d3('0x48')](_0x5e9c4e[_0x14d3('0x49')],{})[_0x14d3('0x22')](function(_0x4e8917){var _0x9fd3eb=_0x5e9c4e['user'][_0x14d3('0x23')]({'plain':!![]});if(!_0x9fd3eb)throw new Error(_0x14d3('0x4a'));if(_0x9fd3eb[_0x14d3('0x4b')]==='user'){var _0x17e705=_0x4e8917[_0x14d3('0x23')]({'plain':!![]});var _0x4980cd=_0x14d3('0x4c');return db[_0x14d3('0x4d')][_0x14d3('0x47')]({'where':{'name':_0x4980cd,'userProfileId':_0x9fd3eb[_0x14d3('0x4e')]},'raw':!![]})['then'](function(_0x4378fd){if(_0x4378fd&&_0x4378fd[_0x14d3('0x4f')]===0x0){return db[_0x14d3('0x24')][_0x14d3('0x48')]({'name':_0x17e705[_0x14d3('0x29')],'resourceId':_0x17e705['id'],'type':_0x4378fd['name'],'sectionId':_0x4378fd['id']},{})[_0x14d3('0x22')](function(){return _0x4e8917;});}else{return _0x4e8917;}})[_0x14d3('0x42')](function(_0x16d7ba){logger[_0x14d3('0x27')](_0x14d3('0x50'),_0x16d7ba);throw _0x16d7ba;});}return _0x4e8917;})[_0x14d3('0x22')](respondWithResult(_0x5ef4f8,0xc9))[_0x14d3('0x42')](handleError(_0x5ef4f8,null));};exports['update']=function(_0x1193db,_0x2b8df3){if(_0x1193db['body']['id']){delete _0x1193db[_0x14d3('0x49')]['id'];}return db[_0x14d3('0x3d')][_0x14d3('0x47')]({'where':{'id':_0x1193db[_0x14d3('0x44')]['id']}})[_0x14d3('0x22')](handleEntityNotFound(_0x2b8df3,null))['then'](saveUpdates(_0x1193db['body'],null))[_0x14d3('0x22')](respondWithResult(_0x2b8df3,null))[_0x14d3('0x42')](handleError(_0x2b8df3,null));};exports['destroy']=function(_0x2b815c,_0x20e986){return db[_0x14d3('0x3d')][_0x14d3('0x47')]({'where':{'id':_0x2b815c['params']['id']}})[_0x14d3('0x22')](handleEntityNotFound(_0x20e986,null))[_0x14d3('0x22')](removeEntity(_0x20e986,null))['catch'](handleError(_0x20e986,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 51e8d75..503facf 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 _0x4c08=['exports','define','tools_templates','util','moment','request-promise','path','rimraf','./template.attributes'];(function(_0x457b72,_0xc4161){var _0x55c7ca=function(_0x140874){while(--_0x140874){_0x457b72['push'](_0x457b72['shift']());}};_0x55c7ca(++_0xc4161);}(_0x4c08,0x81));var _0x84c0=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4c08[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x84c0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x84c0('0x1'));var BPromise=require('bluebird');var rp=require(_0x84c0('0x2'));var fs=require('fs');var path=require(_0x84c0('0x3'));var rimraf=require(_0x84c0('0x4'));var config=require('../../config/environment');var attributes=require(_0x84c0('0x5'));module[_0x84c0('0x6')]=function(_0x5f06d6,_0x142adb){return _0x5f06d6[_0x84c0('0x7')]('Template',attributes,{'tableName':_0x84c0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2b2=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','Template','tools_templates'];(function(_0x5b8b0d,_0x58f554){var _0x18c961=function(_0x19e996){while(--_0x19e996){_0x5b8b0d['push'](_0x5b8b0d['shift']());}};_0x18c961(++_0x58f554);}(_0xe2b2,0x1ea));var _0x2e2b=function(_0x2d0d68,_0x11e7ab){_0x2d0d68=_0x2d0d68-0x0;var _0xb8b405=_0xe2b2[_0x2d0d68];return _0xb8b405;};'use strict';var _=require(_0x2e2b('0x0'));var util=require('util');var logger=require(_0x2e2b('0x1'))(_0x2e2b('0x2'));var moment=require(_0x2e2b('0x3'));var BPromise=require('bluebird');var rp=require(_0x2e2b('0x4'));var fs=require('fs');var path=require(_0x2e2b('0x5'));var rimraf=require(_0x2e2b('0x6'));var config=require(_0x2e2b('0x7'));var attributes=require('./template.attributes');module['exports']=function(_0x6ec0f4,_0x484910){return _0x6ec0f4['define'](_0x2e2b('0x8'),attributes,{'tableName':_0x2e2b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 8e6a567..9452ef8 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 _0xe6f8=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model','util','moment'];(function(_0x2415ce,_0x5414c5){var _0x126203=function(_0x21ff92){while(--_0x21ff92){_0x2415ce['push'](_0x2415ce['shift']());}};_0x126203(++_0x5414c5);}(_0xe6f8,0x153));var _0x8e6f=function(_0x1345de,_0x21bc1e){_0x1345de=_0x1345de-0x0;var _0x2f86d2=_0xe6f8[_0x1345de];return _0x2f86d2;};'use strict';var _=require('lodash');var util=require(_0x8e6f('0x0'));var moment=require(_0x8e6f('0x1'));var BPromise=require(_0x8e6f('0x2'));var rs=require(_0x8e6f('0x3'));var fs=require('fs');var Redis=require(_0x8e6f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e6f('0x5'));var logger=require(_0x8e6f('0x6'))(_0x8e6f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8e6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x134b46,_0x29795e,_0x32f8ff){return new BPromise(function(_0x242d0c,_0x5e7bbe){return client['request'](_0x134b46,_0x32f8ff)[_0x8e6f('0x9')](function(_0x387dda){logger[_0x8e6f('0xa')](_0x8e6f('0xb'),_0x29795e,_0x8e6f('0xc'));logger[_0x8e6f('0xd')](_0x8e6f('0xe'),_0x29795e,_0x8e6f('0xc'),JSON[_0x8e6f('0xf')](_0x387dda));if(_0x387dda[_0x8e6f('0x10')]){if(_0x387dda[_0x8e6f('0x10')][_0x8e6f('0x11')]===0x1f4){logger[_0x8e6f('0x10')](_0x8e6f('0xb'),_0x29795e,_0x387dda[_0x8e6f('0x10')][_0x8e6f('0x12')]);return _0x5e7bbe(_0x387dda['error']['message']);}logger[_0x8e6f('0x10')](_0x8e6f('0xb'),_0x29795e,_0x387dda[_0x8e6f('0x10')][_0x8e6f('0x12')]);return _0x242d0c(_0x387dda[_0x8e6f('0x10')][_0x8e6f('0x12')]);}else{logger[_0x8e6f('0xa')](_0x8e6f('0xb'),_0x29795e,_0x8e6f('0xc'));_0x242d0c(_0x387dda[_0x8e6f('0x13')][_0x8e6f('0x12')]);}})[_0x8e6f('0x14')](function(_0x42792e){logger[_0x8e6f('0x10')](_0x8e6f('0xb'),_0x29795e,_0x42792e);_0x5e7bbe(_0x42792e);});});}exports[_0x8e6f('0x15')]=function(_0x4fbcda){var _0x37f6f4=this;return new Promise(function(_0x43fc2f,_0x24ba26){return db['Template'][_0x8e6f('0x16')]({'raw':_0x4fbcda[_0x8e6f('0x17')]?_0x4fbcda['options'][_0x8e6f('0x18')]===undefined?!![]:![]:!![],'where':_0x4fbcda[_0x8e6f('0x17')]?_0x4fbcda[_0x8e6f('0x17')][_0x8e6f('0x19')]||null:null,'attributes':_0x4fbcda[_0x8e6f('0x17')]?_0x4fbcda[_0x8e6f('0x17')][_0x8e6f('0x1a')]||null:null,'limit':_0x4fbcda[_0x8e6f('0x17')]?_0x4fbcda[_0x8e6f('0x17')][_0x8e6f('0x1b')]||null:null,'include':_0x4fbcda[_0x8e6f('0x17')]?_0x4fbcda[_0x8e6f('0x17')][_0x8e6f('0x1c')]?_[_0x8e6f('0x1d')](_0x4fbcda[_0x8e6f('0x17')][_0x8e6f('0x1c')],function(_0x347adf){return{'model':db[_0x347adf[_0x8e6f('0x1e')]],'as':_0x347adf['as'],'attributes':_0x347adf[_0x8e6f('0x1a')],'include':_0x347adf['include']?_[_0x8e6f('0x1d')](_0x347adf[_0x8e6f('0x1c')],function(_0x130cc2){return{'model':db[_0x130cc2[_0x8e6f('0x1e')]],'as':_0x130cc2['as'],'attributes':_0x130cc2[_0x8e6f('0x1a')],'include':_0x130cc2['include']?_['map'](_0x130cc2[_0x8e6f('0x1c')],function(_0x3eebcc){return{'model':db[_0x3eebcc[_0x8e6f('0x1e')]],'as':_0x3eebcc['as'],'attributes':_0x3eebcc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bc100){logger['info'](_0x8e6f('0x15'),_0x4fbcda);logger[_0x8e6f('0xd')](_0x8e6f('0x15'),_0x4fbcda,JSON[_0x8e6f('0xf')](_0x4bc100));_0x43fc2f(_0x4bc100);})[_0x8e6f('0x14')](function(_0x31dd93){logger[_0x8e6f('0x10')](_0x8e6f('0x15'),_0x31dd93[_0x8e6f('0x12')],_0x4fbcda);_0x24ba26(_0x37f6f4['error'](0x1f4,_0x31dd93[_0x8e6f('0x12')]));});});}; \ No newline at end of file +var _0x2f91=['message','GetTemplate','options','where','attributes','limit','map','model','include','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Template,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x2d46dd,_0x36f527){var _0x599b27=function(_0x7454f8){while(--_0x7454f8){_0x2d46dd['push'](_0x2d46dd['shift']());}};_0x599b27(++_0x36f527);}(_0x2f91,0xdd));var _0x12f9=function(_0x3dfbd3,_0x1b5c44){_0x3dfbd3=_0x3dfbd3-0x0;var _0x142a33=_0x2f91[_0x3dfbd3];return _0x142a33;};'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(_0x12f9('0x5'));var db=require('../../mysqldb')['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['client'][_0x12f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17615f,_0x4ced59,_0x444e58){return new BPromise(function(_0x1b6b38,_0x289eff){return client[_0x12f9('0xb')](_0x17615f,_0x444e58)['then'](function(_0x6126e8){logger[_0x12f9('0xc')](_0x12f9('0xd'),_0x4ced59,'request\x20sent');logger[_0x12f9('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x4ced59,_0x12f9('0xf'),JSON[_0x12f9('0x10')](_0x6126e8));if(_0x6126e8[_0x12f9('0x11')]){if(_0x6126e8['error'][_0x12f9('0x12')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x4ced59,_0x6126e8[_0x12f9('0x11')][_0x12f9('0x13')]);return _0x289eff(_0x6126e8['error'][_0x12f9('0x13')]);}logger[_0x12f9('0x11')](_0x12f9('0xd'),_0x4ced59,_0x6126e8[_0x12f9('0x11')][_0x12f9('0x13')]);return _0x1b6b38(_0x6126e8[_0x12f9('0x11')]['message']);}else{logger[_0x12f9('0xc')](_0x12f9('0xd'),_0x4ced59,'request\x20sent');_0x1b6b38(_0x6126e8['result'][_0x12f9('0x13')]);}})['catch'](function(_0x320395){logger[_0x12f9('0x11')]('Template,\x20%s,\x20%s',_0x4ced59,_0x320395);_0x289eff(_0x320395);});});}exports[_0x12f9('0x14')]=function(_0x35ebe7){var _0x8b5495=this;return new Promise(function(_0x1f87a2,_0x1152b3){return db['Template']['findAll']({'raw':_0x35ebe7[_0x12f9('0x15')]?_0x35ebe7[_0x12f9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x35ebe7[_0x12f9('0x15')]?_0x35ebe7[_0x12f9('0x15')][_0x12f9('0x16')]||null:null,'attributes':_0x35ebe7[_0x12f9('0x15')]?_0x35ebe7[_0x12f9('0x15')][_0x12f9('0x17')]||null:null,'limit':_0x35ebe7[_0x12f9('0x15')]?_0x35ebe7['options'][_0x12f9('0x18')]||null:null,'include':_0x35ebe7['options']?_0x35ebe7[_0x12f9('0x15')]['include']?_[_0x12f9('0x19')](_0x35ebe7[_0x12f9('0x15')]['include'],function(_0x4942d8){return{'model':db[_0x4942d8[_0x12f9('0x1a')]],'as':_0x4942d8['as'],'attributes':_0x4942d8['attributes'],'include':_0x4942d8[_0x12f9('0x1b')]?_[_0x12f9('0x19')](_0x4942d8[_0x12f9('0x1b')],function(_0x46da9b){return{'model':db[_0x46da9b['model']],'as':_0x46da9b['as'],'attributes':_0x46da9b[_0x12f9('0x17')],'include':_0x46da9b[_0x12f9('0x1b')]?_[_0x12f9('0x19')](_0x46da9b[_0x12f9('0x1b')],function(_0x3ee680){return{'model':db[_0x3ee680[_0x12f9('0x1a')]],'as':_0x3ee680['as'],'attributes':_0x3ee680[_0x12f9('0x17')]};}):[]};}):[]};}):[]:[]})[_0x12f9('0x1c')](function(_0x18c2ad){logger[_0x12f9('0xc')](_0x12f9('0x14'),_0x35ebe7);logger['debug'](_0x12f9('0x14'),_0x35ebe7,JSON[_0x12f9('0x10')](_0x18c2ad));_0x1f87a2(_0x18c2ad);})[_0x12f9('0x1d')](function(_0x918618){logger[_0x12f9('0x11')](_0x12f9('0x14'),_0x918618[_0x12f9('0x13')],_0x35ebe7);_0x1152b3(_0x8b5495[_0x12f9('0x11')](0x1f4,_0x918618[_0x12f9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 9a627a9..9acfc2c 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 _0x784b=['/:id','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition','put'];(function(_0x1c3f4d,_0x81d1af){var _0x4dc788=function(_0x1de47f){while(--_0x1de47f){_0x1c3f4d['push'](_0x1c3f4d['shift']());}};_0x4dc788(++_0x81d1af);}(_0x784b,0x149));var _0xb784=function(_0x2fb845,_0x54c3ab){_0x2fb845=_0x2fb845-0x0;var _0x1756c9=_0x784b[_0x2fb845];return _0x1756c9;};'use strict';var multer=require(_0xb784('0x0'));var util=require(_0xb784('0x1'));var path=require('path');var timeout=require(_0xb784('0x2'));var express=require('express');var router=express[_0xb784('0x3')]();var fs_extra=require(_0xb784('0x4'));var auth=require(_0xb784('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb784('0x6'));var controller=require(_0xb784('0x7'));router[_0xb784('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb784('0x8')]('/:id',auth[_0xb784('0x9')](),controller[_0xb784('0xa')]);router[_0xb784('0x8')]('/:id/all_conditions',auth[_0xb784('0x9')](),controller[_0xb784('0xb')]);router['get'](_0xb784('0xc'),auth[_0xb784('0x9')](),controller[_0xb784('0xd')]);router[_0xb784('0x8')](_0xb784('0xe'),auth['isAuthenticated'](),controller[_0xb784('0xf')]);router['post']('/',auth[_0xb784('0x9')](),controller[_0xb784('0x10')]);router[_0xb784('0x11')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xb784('0x12')]);router[_0xb784('0x11')](_0xb784('0xc'),auth[_0xb784('0x9')](),controller[_0xb784('0x13')]);router[_0xb784('0x11')](_0xb784('0xe'),auth['isAuthenticated'](),controller['addAction']);router[_0xb784('0x14')](_0xb784('0x15'),auth[_0xb784('0x9')](),controller['update']);router[_0xb784('0x16')](_0xb784('0x15'),auth[_0xb784('0x9')](),controller[_0xb784('0x17')]);module[_0xb784('0x18')]=router; \ No newline at end of file +var _0xe896=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','show','get','/:id/all_conditions','/:id/actions','getActions','post','create','/:id/any_conditions','addAnyCondition','put','/:id','update','delete','exports','multer'];(function(_0x3cdc47,_0x425c19){var _0x4b2a4a=function(_0x326f90){while(--_0x326f90){_0x3cdc47['push'](_0x3cdc47['shift']());}};_0x4b2a4a(++_0x425c19);}(_0xe896,0x15f));var _0x6e89=function(_0x6b5627,_0x573e85){_0x6b5627=_0x6b5627-0x0;var _0x46d3db=_0xe896[_0x6b5627];return _0x46d3db;};'use strict';var multer=require(_0x6e89('0x0'));var util=require(_0x6e89('0x1'));var path=require(_0x6e89('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e89('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6e89('0x4'));var interaction=require(_0x6e89('0x5'));var config=require(_0x6e89('0x6'));var controller=require('./trigger.controller');router['get']('/',auth[_0x6e89('0x7')](),controller['index']);router['get']('/:id',auth[_0x6e89('0x7')](),controller[_0x6e89('0x8')]);router[_0x6e89('0x9')](_0x6e89('0xa'),auth[_0x6e89('0x7')](),controller['getAllConditions']);router['get']('/:id/any_conditions',auth[_0x6e89('0x7')](),controller['getAnyConditions']);router['get'](_0x6e89('0xb'),auth['isAuthenticated'](),controller[_0x6e89('0xc')]);router[_0x6e89('0xd')]('/',auth[_0x6e89('0x7')](),controller[_0x6e89('0xe')]);router[_0x6e89('0xd')](_0x6e89('0xa'),auth[_0x6e89('0x7')](),controller['addAllCondition']);router[_0x6e89('0xd')](_0x6e89('0xf'),auth[_0x6e89('0x7')](),controller[_0x6e89('0x10')]);router[_0x6e89('0xd')](_0x6e89('0xb'),auth['isAuthenticated'](),controller['addAction']);router[_0x6e89('0x11')](_0x6e89('0x12'),auth[_0x6e89('0x7')](),controller[_0x6e89('0x13')]);router[_0x6e89('0x14')](_0x6e89('0x12'),auth[_0x6e89('0x7')](),controller['destroy']);module[_0x6e89('0x15')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 4531142..2df9ce1 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 _0x0af1=['BOOLEAN','STRING'];(function(_0x7f602,_0x3e0c59){var _0x4eb738=function(_0xcc9cb7){while(--_0xcc9cb7){_0x7f602['push'](_0x7f602['shift']());}};_0x4eb738(++_0x3e0c59);}(_0x0af1,0x135));var _0x10af=function(_0x2eab0e,_0x5657e0){_0x2eab0e=_0x2eab0e-0x0;var _0x4b0757=_0x0af1[_0x2eab0e];return _0x4b0757;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x10af('0x0')]},'channel':{'type':Sequelize[_0x10af('0x0')]},'description':{'type':Sequelize[_0x10af('0x0')]},'status':{'type':Sequelize[_0x10af('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xc53a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x23e227,_0xe39c23){var _0x508c95=function(_0xf4bcc1){while(--_0xf4bcc1){_0x23e227['push'](_0x23e227['shift']());}};_0x508c95(++_0xe39c23);}(_0xc53a,0xd6));var _0xac53=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc53a[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xac53('0x0'));module[_0xac53('0x1')]={'name':{'type':Sequelize[_0xac53('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xac53('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 6bab1f1..34aced0 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 _0x2aa5=['count','set','Content-Range','apply','save','then','destroy','get','Triggers','error','name','index','map','Trigger','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset'];(function(_0x329670,_0x45a827){var _0x17e72b=function(_0x1c7258){while(--_0x1c7258){_0x329670['push'](_0x329670['shift']());}};_0x17e72b(++_0x45a827);}(_0x2aa5,0x9e));var _0x52aa=function(_0x4777e8,_0x3d512b){_0x4777e8=_0x4777e8-0x0;var _0x2c9aa4=_0x2aa5[_0x4777e8];return _0x2c9aa4;};'use strict';var emlformat=require(_0x52aa('0x0'));var rimraf=require(_0x52aa('0x1'));var zipdir=require(_0x52aa('0x2'));var jsonpatch=require(_0x52aa('0x3'));var rp=require(_0x52aa('0x4'));var moment=require(_0x52aa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x52aa('0x6'));var util=require(_0x52aa('0x7'));var path=require(_0x52aa('0x8'));var sox=require(_0x52aa('0x9'));var csv=require(_0x52aa('0xa'));var ejs=require(_0x52aa('0xb'));var fs=require('fs');var fs_extra=require(_0x52aa('0xc'));var _=require(_0x52aa('0xd'));var squel=require('squel');var crypto=require(_0x52aa('0xe'));var jsforce=require(_0x52aa('0xf'));var deskjs=require(_0x52aa('0x10'));var toCsv=require('to-csv');var querystring=require(_0x52aa('0x11'));var Papa=require('papaparse');var Redis=require(_0x52aa('0x12'));var authService=require(_0x52aa('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x52aa('0x14'));var hardwareService=require(_0x52aa('0x15'));var logger=require(_0x52aa('0x16'))('api');var utils=require(_0x52aa('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x52aa('0x18'))['db'];function respondWithStatusCode(_0xaea17,_0x10b853){_0x10b853=_0x10b853||0xcc;return function(_0x1513af){if(_0x1513af){return _0xaea17[_0x52aa('0x19')](_0x10b853);}return _0xaea17['status'](_0x10b853)[_0x52aa('0x1a')]();};}function respondWithResult(_0x447e38,_0x3bf658){_0x3bf658=_0x3bf658||0xc8;return function(_0x5ed0a3){if(_0x5ed0a3){return _0x447e38[_0x52aa('0x1b')](_0x3bf658)[_0x52aa('0x1c')](_0x5ed0a3);}};}function respondWithFilteredResult(_0x7d2bff,_0x2fb7a0){return function(_0x41d2bf){if(_0x41d2bf){var _0xce399c=typeof _0x2fb7a0['offset']===_0x52aa('0x1d')&&typeof _0x2fb7a0[_0x52aa('0x1e')]===_0x52aa('0x1d');var _0x1f3d09=_0x41d2bf['count'];var _0x504e50=_0xce399c?0x0:_0x2fb7a0[_0x52aa('0x1f')];var _0x39527b=_0xce399c?_0x41d2bf[_0x52aa('0x20')]:_0x2fb7a0[_0x52aa('0x1f')]+_0x2fb7a0[_0x52aa('0x1e')];var _0x5102df;if(_0x39527b>=_0x1f3d09){_0x39527b=_0x1f3d09;_0x5102df=0xc8;}else{_0x5102df=0xce;}_0x7d2bff[_0x52aa('0x1b')](_0x5102df);return _0x7d2bff[_0x52aa('0x21')](_0x52aa('0x22'),_0x504e50+'-'+_0x39527b+'/'+_0x1f3d09)[_0x52aa('0x1c')](_0x41d2bf);}return null;};}function patchUpdates(_0x2fc22c){return function(_0x160093){try{jsonpatch[_0x52aa('0x23')](_0x160093,_0x2fc22c,!![]);}catch(_0x216dd1){return BPromise['reject'](_0x216dd1);}return _0x160093[_0x52aa('0x24')]();};}function saveUpdates(_0x1ae9a4,_0x1f5a6a){return function(_0x4d722b){if(_0x4d722b){return _0x4d722b['update'](_0x1ae9a4)[_0x52aa('0x25')](function(_0x488c6b){return _0x488c6b;});}return null;};}function removeEntity(_0x4fa1b1,_0x2457ee){return function(_0x3cf432){if(_0x3cf432){return _0x3cf432[_0x52aa('0x26')]()[_0x52aa('0x25')](function(){var _0x57cd33=_0x3cf432[_0x52aa('0x27')]({'plain':!![]});var _0x4e918f=_0x52aa('0x28');return db['UserProfileResource'][_0x52aa('0x26')]({'where':{'type':_0x4e918f,'resourceId':_0x57cd33['id']}})['then'](function(){return _0x3cf432;});})[_0x52aa('0x25')](function(){_0x4fa1b1[_0x52aa('0x1b')](0xcc)[_0x52aa('0x1a')]();});}};}function handleEntityNotFound(_0x1e69d3,_0x3591a7){return function(_0x5dfd1a){if(!_0x5dfd1a){_0x1e69d3[_0x52aa('0x19')](0x194);}return _0x5dfd1a;};}function handleError(_0x3a4e69,_0x13e616){_0x13e616=_0x13e616||0x1f4;return function(_0x47d9c8){logger[_0x52aa('0x29')](_0x47d9c8['stack']);if(_0x47d9c8[_0x52aa('0x2a')]){delete _0x47d9c8['name'];}_0x3a4e69[_0x52aa('0x1b')](_0x13e616)['send'](_0x47d9c8);};}exports[_0x52aa('0x2b')]=function(_0x2da0c5,_0x1209fd){var _0x3f265d={},_0x245bbe={},_0x4ec688={'count':0x0,'rows':[]};var _0x58288a=_[_0x52aa('0x2c')](db[_0x52aa('0x2d')][_0x52aa('0x2e')],function(_0x4262cb){return{'name':_0x4262cb[_0x52aa('0x2f')],'type':_0x4262cb[_0x52aa('0x30')][_0x52aa('0x31')]};});_0x245bbe[_0x52aa('0x32')]=_[_0x52aa('0x2c')](_0x58288a,_0x52aa('0x2a'));_0x245bbe['query']=_[_0x52aa('0x33')](_0x2da0c5[_0x52aa('0x34')]);_0x245bbe[_0x52aa('0x35')]=_['intersection'](_0x245bbe['model'],_0x245bbe['query']);_0x3f265d[_0x52aa('0x36')]=_[_0x52aa('0x37')](_0x245bbe[_0x52aa('0x32')],qs[_0x52aa('0x38')](_0x2da0c5[_0x52aa('0x34')]['fields']));_0x3f265d[_0x52aa('0x36')]=_0x3f265d[_0x52aa('0x36')][_0x52aa('0x39')]?_0x3f265d[_0x52aa('0x36')]:_0x245bbe[_0x52aa('0x32')];if(!_0x2da0c5['query'][_0x52aa('0x3a')](_0x52aa('0x3b'))){_0x3f265d[_0x52aa('0x1e')]=qs[_0x52aa('0x1e')](_0x2da0c5['query'][_0x52aa('0x1e')]);_0x3f265d['offset']=qs[_0x52aa('0x1f')](_0x2da0c5['query'][_0x52aa('0x1f')]);}_0x3f265d[_0x52aa('0x3c')]=qs[_0x52aa('0x3d')](_0x2da0c5[_0x52aa('0x34')][_0x52aa('0x3d')]);_0x3f265d[_0x52aa('0x3e')]=qs[_0x52aa('0x35')](_[_0x52aa('0x3f')](_0x2da0c5[_0x52aa('0x34')],_0x245bbe[_0x52aa('0x35')]),_0x58288a);if(_0x2da0c5['query'][_0x52aa('0x40')]){_0x3f265d[_0x52aa('0x3e')]=_[_0x52aa('0x41')](_0x3f265d[_0x52aa('0x3e')],{'$or':_[_0x52aa('0x2c')](_0x58288a,function(_0x477e86){if(_0x477e86[_0x52aa('0x30')]!=='VIRTUAL'){var _0x40d216={};_0x40d216[_0x477e86[_0x52aa('0x2a')]]={'$like':'%'+_0x2da0c5[_0x52aa('0x34')][_0x52aa('0x40')]+'%'};return _0x40d216;}})});}_0x3f265d=_[_0x52aa('0x41')]({},_0x3f265d,_0x2da0c5[_0x52aa('0x42')]);var _0x4ead7b={'where':_0x3f265d[_0x52aa('0x3e')]};return db['Trigger'][_0x52aa('0x20')](_0x4ead7b)['then'](function(_0x36831b){_0x4ec688[_0x52aa('0x20')]=_0x36831b;if(_0x2da0c5['query'][_0x52aa('0x43')]){_0x3f265d['include']=[{'all':!![]}];}return db[_0x52aa('0x2d')][_0x52aa('0x44')](_0x3f265d);})[_0x52aa('0x25')](function(_0x3360f5){_0x4ec688[_0x52aa('0x45')]=_0x3360f5;return _0x4ec688;})[_0x52aa('0x25')](respondWithFilteredResult(_0x1209fd,_0x3f265d))[_0x52aa('0x46')](handleError(_0x1209fd,null));};exports[_0x52aa('0x47')]=function(_0x58ae92,_0x120fd7){var _0x520f7b={'raw':![],'where':{'id':_0x58ae92[_0x52aa('0x48')]['id']}},_0x301be6={};_0x301be6[_0x52aa('0x32')]=_[_0x52aa('0x33')](db[_0x52aa('0x2d')][_0x52aa('0x2e')]);_0x301be6[_0x52aa('0x34')]=_[_0x52aa('0x33')](_0x58ae92[_0x52aa('0x34')]);_0x301be6[_0x52aa('0x35')]=_[_0x52aa('0x37')](_0x301be6[_0x52aa('0x32')],_0x301be6[_0x52aa('0x34')]);_0x520f7b[_0x52aa('0x36')]=_['intersection'](_0x301be6[_0x52aa('0x32')],qs[_0x52aa('0x38')](_0x58ae92['query'][_0x52aa('0x38')]));_0x520f7b['attributes']=_0x520f7b[_0x52aa('0x36')][_0x52aa('0x39')]?_0x520f7b[_0x52aa('0x36')]:_0x301be6[_0x52aa('0x32')];if(_0x58ae92[_0x52aa('0x34')][_0x52aa('0x43')]){_0x520f7b[_0x52aa('0x49')]=[{'all':!![]}];}_0x520f7b=_[_0x52aa('0x41')]({},_0x520f7b,_0x58ae92[_0x52aa('0x42')]);return db[_0x52aa('0x2d')][_0x52aa('0x4a')](_0x520f7b)[_0x52aa('0x25')](handleEntityNotFound(_0x120fd7,null))[_0x52aa('0x25')](respondWithResult(_0x120fd7,null))[_0x52aa('0x46')](handleError(_0x120fd7,null));};exports[_0x52aa('0x4b')]=function(_0x53b32e,_0x191aec){return db[_0x52aa('0x2d')]['create'](_0x53b32e['body'],{})[_0x52aa('0x25')](function(_0x5be8c3){var _0x27beed=_0x53b32e[_0x52aa('0x4c')][_0x52aa('0x27')]({'plain':!![]});if(!_0x27beed)throw new Error(_0x52aa('0x4d'));if(_0x27beed['role']===_0x52aa('0x4c')){var _0x4a02c4=_0x5be8c3['get']({'plain':!![]});var _0x489ea6=_0x52aa('0x28');return db[_0x52aa('0x4e')][_0x52aa('0x4a')]({'where':{'name':_0x489ea6,'userProfileId':_0x27beed[_0x52aa('0x4f')]},'raw':!![]})[_0x52aa('0x25')](function(_0x1e78fe){if(_0x1e78fe&&_0x1e78fe[_0x52aa('0x50')]===0x0){return db[_0x52aa('0x51')][_0x52aa('0x4b')]({'name':_0x4a02c4[_0x52aa('0x2a')],'resourceId':_0x4a02c4['id'],'type':_0x1e78fe[_0x52aa('0x2a')],'sectionId':_0x1e78fe['id']},{})[_0x52aa('0x25')](function(){return _0x5be8c3;});}else{return _0x5be8c3;}})[_0x52aa('0x46')](function(_0x4d3c11){logger[_0x52aa('0x29')](_0x52aa('0x52'),_0x4d3c11);throw _0x4d3c11;});}return _0x5be8c3;})['then'](respondWithResult(_0x191aec,0xc9))[_0x52aa('0x46')](handleError(_0x191aec,null));};exports['update']=function(_0x439d53,_0x186efd){if(_0x439d53['body']['id']){delete _0x439d53['body']['id'];}return db[_0x52aa('0x2d')][_0x52aa('0x4a')]({'where':{'id':_0x439d53[_0x52aa('0x48')]['id']}})[_0x52aa('0x25')](handleEntityNotFound(_0x186efd,null))[_0x52aa('0x25')](saveUpdates(_0x439d53[_0x52aa('0x53')],null))[_0x52aa('0x25')](respondWithResult(_0x186efd,null))['catch'](handleError(_0x186efd,null));};exports[_0x52aa('0x26')]=function(_0x1f3ce4,_0x5e3880){return db[_0x52aa('0x2d')][_0x52aa('0x4a')]({'where':{'id':_0x1f3ce4[_0x52aa('0x48')]['id']}})[_0x52aa('0x25')](handleEntityNotFound(_0x5e3880,null))[_0x52aa('0x25')](removeEntity(_0x5e3880,null))[_0x52aa('0x46')](handleError(_0x5e3880,null));};exports[_0x52aa('0x54')]=function(_0x507e47,_0xd61bc2,_0x558dee){if(_0x507e47[_0x52aa('0x53')]['id']){delete _0x507e47[_0x52aa('0x53')]['id'];}return db['Trigger']['find']({'where':{'id':_0x507e47[_0x52aa('0x48')]['id']}})[_0x52aa('0x25')](handleEntityNotFound(_0xd61bc2,null))['then'](function(_0xc77451){if(_0xc77451){_0x507e47['body'][_0x52aa('0x55')]=_0xc77451['id'];return db[_0x52aa('0x56')][_0x52aa('0x4b')](_0x507e47[_0x52aa('0x53')]);}})[_0x52aa('0x25')](respondWithResult(_0xd61bc2,null))['catch'](handleError(_0xd61bc2,null));};exports[_0x52aa('0x57')]=function(_0x44fbf1,_0x18ad71,_0x35aab7){if(_0x44fbf1[_0x52aa('0x53')]['id']){delete _0x44fbf1[_0x52aa('0x53')]['id'];}return db[_0x52aa('0x2d')]['find']({'where':{'id':_0x44fbf1[_0x52aa('0x48')]['id']}})[_0x52aa('0x25')](handleEntityNotFound(_0x18ad71,null))['then'](function(_0xda64e8){if(_0xda64e8){_0x44fbf1['body']['TriggerAnyId']=_0xda64e8['id'];return db[_0x52aa('0x56')][_0x52aa('0x4b')](_0x44fbf1[_0x52aa('0x53')]);}})[_0x52aa('0x25')](respondWithResult(_0x18ad71,null))[_0x52aa('0x46')](handleError(_0x18ad71,null));};exports[_0x52aa('0x58')]=function(_0xd34d58,_0x5aadbb,_0x319775){var _0x290718={};var _0x54cf4b={};var _0x1ff2b6;var _0x244192;return db[_0x52aa('0x2d')][_0x52aa('0x59')]({'where':{'id':_0xd34d58[_0x52aa('0x48')]['id']}})[_0x52aa('0x25')](handleEntityNotFound(_0x5aadbb,null))[_0x52aa('0x25')](function(_0x468d4c){if(_0x468d4c){_0x1ff2b6=_0x468d4c;_0x54cf4b[_0x52aa('0x32')]=_[_0x52aa('0x33')](db[_0x52aa('0x56')][_0x52aa('0x2e')]);_0x54cf4b[_0x52aa('0x34')]=_[_0x52aa('0x33')](_0xd34d58['query']);_0x54cf4b[_0x52aa('0x35')]=_['intersection'](_0x54cf4b[_0x52aa('0x32')],_0x54cf4b[_0x52aa('0x34')]);_0x290718[_0x52aa('0x36')]=_['intersection'](_0x54cf4b['model'],qs[_0x52aa('0x38')](_0xd34d58[_0x52aa('0x34')][_0x52aa('0x38')]));_0x290718[_0x52aa('0x36')]=_0x290718[_0x52aa('0x36')][_0x52aa('0x39')]?_0x290718[_0x52aa('0x36')]:_0x54cf4b[_0x52aa('0x32')];_0x290718[_0x52aa('0x3c')]=qs[_0x52aa('0x3d')](_0xd34d58[_0x52aa('0x34')][_0x52aa('0x3d')]);_0x290718[_0x52aa('0x3e')]=qs[_0x52aa('0x35')](_[_0x52aa('0x3f')](_0xd34d58[_0x52aa('0x34')],_0x54cf4b[_0x52aa('0x35')]));if(_0xd34d58[_0x52aa('0x34')]['filter']){_0x290718[_0x52aa('0x3e')]=_[_0x52aa('0x41')](_0x290718[_0x52aa('0x3e')],{'$or':_['map'](_0x290718['attributes'],function(_0x5f5196){var _0x24a712={};_0x24a712[_0x5f5196]={'$like':'%'+_0xd34d58[_0x52aa('0x34')]['filter']+'%'};return _0x24a712;})});}_0x290718=_[_0x52aa('0x41')]({},_0x290718,_0xd34d58[_0x52aa('0x42')]);return _0x1ff2b6[_0x52aa('0x58')](_0x290718);}})[_0x52aa('0x25')](function(_0x66d8bd){if(_0x66d8bd){_0x244192=_0x66d8bd['length'];if(!_0xd34d58[_0x52aa('0x34')][_0x52aa('0x3a')](_0x52aa('0x3b'))){_0x290718[_0x52aa('0x1e')]=qs[_0x52aa('0x1e')](_0xd34d58['query'][_0x52aa('0x1e')]);_0x290718[_0x52aa('0x1f')]=qs[_0x52aa('0x1f')](_0xd34d58[_0x52aa('0x34')][_0x52aa('0x1f')]);}return _0x1ff2b6['getAllConditions'](_0x290718);}})[_0x52aa('0x25')](function(_0x4333aa){if(_0x4333aa){return _0x4333aa?{'count':_0x244192,'rows':_0x4333aa}:null;}})[_0x52aa('0x25')](respondWithResult(_0x5aadbb,null))['catch'](handleError(_0x5aadbb,null));};exports['getAnyConditions']=function(_0x2dc104,_0x18cadc,_0x411423){var _0x489beb={};var _0x5194ca={};var _0x322108;var _0x1114e2;return db[_0x52aa('0x2d')][_0x52aa('0x59')]({'where':{'id':_0x2dc104[_0x52aa('0x48')]['id']}})[_0x52aa('0x25')](handleEntityNotFound(_0x18cadc,null))['then'](function(_0x278475){if(_0x278475){_0x322108=_0x278475;_0x5194ca[_0x52aa('0x32')]=_[_0x52aa('0x33')](db[_0x52aa('0x56')][_0x52aa('0x2e')]);_0x5194ca[_0x52aa('0x34')]=_['keys'](_0x2dc104['query']);_0x5194ca[_0x52aa('0x35')]=_['intersection'](_0x5194ca[_0x52aa('0x32')],_0x5194ca['query']);_0x489beb[_0x52aa('0x36')]=_[_0x52aa('0x37')](_0x5194ca[_0x52aa('0x32')],qs['fields'](_0x2dc104[_0x52aa('0x34')][_0x52aa('0x38')]));_0x489beb[_0x52aa('0x36')]=_0x489beb[_0x52aa('0x36')][_0x52aa('0x39')]?_0x489beb[_0x52aa('0x36')]:_0x5194ca['model'];_0x489beb[_0x52aa('0x3c')]=qs[_0x52aa('0x3d')](_0x2dc104['query'][_0x52aa('0x3d')]);_0x489beb[_0x52aa('0x3e')]=qs[_0x52aa('0x35')](_[_0x52aa('0x3f')](_0x2dc104['query'],_0x5194ca[_0x52aa('0x35')]));if(_0x2dc104[_0x52aa('0x34')]['filter']){_0x489beb[_0x52aa('0x3e')]=_['merge'](_0x489beb['where'],{'$or':_['map'](_0x489beb['attributes'],function(_0x5f441a){var _0x42fdcf={};_0x42fdcf[_0x5f441a]={'$like':'%'+_0x2dc104[_0x52aa('0x34')][_0x52aa('0x40')]+'%'};return _0x42fdcf;})});}_0x489beb=_[_0x52aa('0x41')]({},_0x489beb,_0x2dc104['options']);return _0x322108[_0x52aa('0x5a')](_0x489beb);}})[_0x52aa('0x25')](function(_0x4f3f04){if(_0x4f3f04){_0x1114e2=_0x4f3f04[_0x52aa('0x39')];if(!_0x2dc104[_0x52aa('0x34')]['hasOwnProperty'](_0x52aa('0x3b'))){_0x489beb[_0x52aa('0x1e')]=qs[_0x52aa('0x1e')](_0x2dc104[_0x52aa('0x34')][_0x52aa('0x1e')]);_0x489beb[_0x52aa('0x1f')]=qs['offset'](_0x2dc104[_0x52aa('0x34')][_0x52aa('0x1f')]);}return _0x322108[_0x52aa('0x5a')](_0x489beb);}})[_0x52aa('0x25')](function(_0x3948e3){if(_0x3948e3){return _0x3948e3?{'count':_0x1114e2,'rows':_0x3948e3}:null;}})[_0x52aa('0x25')](respondWithResult(_0x18cadc,null))[_0x52aa('0x46')](handleError(_0x18cadc,null));};exports[_0x52aa('0x5b')]=function(_0x534bb9,_0x3c6293,_0x14f0bb){if(_0x534bb9[_0x52aa('0x53')]['id']){delete _0x534bb9[_0x52aa('0x53')]['id'];}return db[_0x52aa('0x2d')][_0x52aa('0x4a')]({'where':{'id':_0x534bb9[_0x52aa('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c6293,null))['then'](function(_0x5686cc){if(_0x5686cc){_0x534bb9[_0x52aa('0x53')][_0x52aa('0x5c')]=_0x5686cc['id'];return db[_0x52aa('0x5d')][_0x52aa('0x4b')](_0x534bb9[_0x52aa('0x53')]);}})['then'](respondWithResult(_0x3c6293,null))[_0x52aa('0x46')](handleError(_0x3c6293,null));};exports['getActions']=function(_0x5f0f8b,_0xb64366,_0x1c2766){var _0x2fb626={};var _0x384b84={};var _0xea4b87;var _0x5144b7;return db[_0x52aa('0x2d')][_0x52aa('0x59')]({'where':{'id':_0x5f0f8b[_0x52aa('0x48')]['id']}})['then'](handleEntityNotFound(_0xb64366,null))[_0x52aa('0x25')](function(_0x2cce56){if(_0x2cce56){_0xea4b87=_0x2cce56;_0x384b84[_0x52aa('0x32')]=_[_0x52aa('0x33')](db['Action']['rawAttributes']);_0x384b84[_0x52aa('0x34')]=_[_0x52aa('0x33')](_0x5f0f8b[_0x52aa('0x34')]);_0x384b84[_0x52aa('0x35')]=_[_0x52aa('0x37')](_0x384b84[_0x52aa('0x32')],_0x384b84[_0x52aa('0x34')]);_0x2fb626[_0x52aa('0x36')]=_[_0x52aa('0x37')](_0x384b84['model'],qs['fields'](_0x5f0f8b['query'][_0x52aa('0x38')]));_0x2fb626['attributes']=_0x2fb626[_0x52aa('0x36')][_0x52aa('0x39')]?_0x2fb626['attributes']:_0x384b84['model'];_0x2fb626[_0x52aa('0x3c')]=qs[_0x52aa('0x3d')](_0x5f0f8b['query'][_0x52aa('0x3d')]);_0x2fb626[_0x52aa('0x3e')]=qs[_0x52aa('0x35')](_[_0x52aa('0x3f')](_0x5f0f8b['query'],_0x384b84[_0x52aa('0x35')]));if(_0x5f0f8b[_0x52aa('0x34')][_0x52aa('0x40')]){_0x2fb626[_0x52aa('0x3e')]=_[_0x52aa('0x41')](_0x2fb626[_0x52aa('0x3e')],{'$or':_[_0x52aa('0x2c')](_0x2fb626[_0x52aa('0x36')],function(_0x2ee13e){var _0x1a5d77={};_0x1a5d77[_0x2ee13e]={'$like':'%'+_0x5f0f8b['query'][_0x52aa('0x40')]+'%'};return _0x1a5d77;})});}_0x2fb626=_[_0x52aa('0x41')]({},_0x2fb626,_0x5f0f8b[_0x52aa('0x42')]);return _0xea4b87[_0x52aa('0x5e')](_0x2fb626);}})[_0x52aa('0x25')](function(_0x2135ff){if(_0x2135ff){_0x5144b7=_0x2135ff[_0x52aa('0x39')];if(!_0x5f0f8b[_0x52aa('0x34')][_0x52aa('0x3a')](_0x52aa('0x3b'))){_0x2fb626[_0x52aa('0x1e')]=qs[_0x52aa('0x1e')](_0x5f0f8b[_0x52aa('0x34')][_0x52aa('0x1e')]);_0x2fb626[_0x52aa('0x1f')]=qs['offset'](_0x5f0f8b[_0x52aa('0x34')][_0x52aa('0x1f')]);}return _0xea4b87[_0x52aa('0x5e')](_0x2fb626);}})[_0x52aa('0x25')](function(_0x29cf17){if(_0x29cf17){return _0x29cf17?{'count':_0x5144b7,'rows':_0x29cf17}:null;}})[_0x52aa('0x25')](respondWithResult(_0xb64366,null))[_0x52aa('0x46')](handleError(_0xb64366,null));}; \ No newline at end of file +var _0xd777=['undefined','count','Content-Range','update','then','destroy','Triggers','UserProfileResource','error','name','map','Trigger','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','pick','filters','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','keys','order','filter','hasOwnProperty','getAnyConditions','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd777,0x92));var _0x7d77=function(_0x2508fd,_0xa8375b){_0x2508fd=_0x2508fd-0x0;var _0x3ce952=_0xd777[_0x2508fd];return _0x3ce952;};'use strict';var emlformat=require(_0x7d77('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d77('0x1'));var jsonpatch=require(_0x7d77('0x2'));var rp=require(_0x7d77('0x3'));var moment=require(_0x7d77('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d77('0x5'));var path=require(_0x7d77('0x6'));var sox=require(_0x7d77('0x7'));var csv=require(_0x7d77('0x8'));var ejs=require(_0x7d77('0x9'));var fs=require('fs');var fs_extra=require(_0x7d77('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7d77('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7d77('0xc'));var toCsv=require(_0x7d77('0x8'));var querystring=require('querystring');var Papa=require(_0x7d77('0xd'));var Redis=require(_0x7d77('0xe'));var authService=require(_0x7d77('0xf'));var qs=require(_0x7d77('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d77('0x11'));var logger=require(_0x7d77('0x12'))(_0x7d77('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d77('0x14'));var db=require(_0x7d77('0x15'))['db'];function respondWithStatusCode(_0x1e2641,_0x3a6358){_0x3a6358=_0x3a6358||0xcc;return function(_0x1a6d6d){if(_0x1a6d6d){return _0x1e2641[_0x7d77('0x16')](_0x3a6358);}return _0x1e2641[_0x7d77('0x17')](_0x3a6358)[_0x7d77('0x18')]();};}function respondWithResult(_0x48ba06,_0x5df7d){_0x5df7d=_0x5df7d||0xc8;return function(_0x43aadf){if(_0x43aadf){return _0x48ba06[_0x7d77('0x17')](_0x5df7d)[_0x7d77('0x19')](_0x43aadf);}};}function respondWithFilteredResult(_0x264b2e,_0x231e3b){return function(_0x244099){if(_0x244099){var _0x62b1f8=typeof _0x231e3b[_0x7d77('0x1a')]==='undefined'&&typeof _0x231e3b[_0x7d77('0x1b')]===_0x7d77('0x1c');var _0x122397=_0x244099[_0x7d77('0x1d')];var _0x5f1e71=_0x62b1f8?0x0:_0x231e3b[_0x7d77('0x1a')];var _0x2a4f9b=_0x62b1f8?_0x244099[_0x7d77('0x1d')]:_0x231e3b[_0x7d77('0x1a')]+_0x231e3b[_0x7d77('0x1b')];var _0x55b134;if(_0x2a4f9b>=_0x122397){_0x2a4f9b=_0x122397;_0x55b134=0xc8;}else{_0x55b134=0xce;}_0x264b2e[_0x7d77('0x17')](_0x55b134);return _0x264b2e['set'](_0x7d77('0x1e'),_0x5f1e71+'-'+_0x2a4f9b+'/'+_0x122397)[_0x7d77('0x19')](_0x244099);}return null;};}function patchUpdates(_0x42647d){return function(_0x4bce90){try{jsonpatch['apply'](_0x4bce90,_0x42647d,!![]);}catch(_0x36be54){return BPromise['reject'](_0x36be54);}return _0x4bce90['save']();};}function saveUpdates(_0x5cd5d2,_0x5ec261){return function(_0x53611a){if(_0x53611a){return _0x53611a[_0x7d77('0x1f')](_0x5cd5d2)[_0x7d77('0x20')](function(_0xe9717c){return _0xe9717c;});}return null;};}function removeEntity(_0x13172,_0x4dafe1){return function(_0x2a6aca){if(_0x2a6aca){return _0x2a6aca[_0x7d77('0x21')]()['then'](function(){var _0x2fdc12=_0x2a6aca['get']({'plain':!![]});var _0x1cb002=_0x7d77('0x22');return db[_0x7d77('0x23')][_0x7d77('0x21')]({'where':{'type':_0x1cb002,'resourceId':_0x2fdc12['id']}})['then'](function(){return _0x2a6aca;});})['then'](function(){_0x13172[_0x7d77('0x17')](0xcc)[_0x7d77('0x18')]();});}};}function handleEntityNotFound(_0x306992,_0x3b2c73){return function(_0x44e3d5){if(!_0x44e3d5){_0x306992[_0x7d77('0x16')](0x194);}return _0x44e3d5;};}function handleError(_0x3809a2,_0x4f0008){_0x4f0008=_0x4f0008||0x1f4;return function(_0x3a1a94){logger[_0x7d77('0x24')](_0x3a1a94['stack']);if(_0x3a1a94[_0x7d77('0x25')]){delete _0x3a1a94[_0x7d77('0x25')];}_0x3809a2[_0x7d77('0x17')](_0x4f0008)['send'](_0x3a1a94);};}exports['index']=function(_0x1878d6,_0x1cc0f1){var _0x5553bf={},_0x53e397={},_0x9aa664={'count':0x0,'rows':[]};var _0x1ee00c=_[_0x7d77('0x26')](db[_0x7d77('0x27')][_0x7d77('0x28')],function(_0x22c6ad){return{'name':_0x22c6ad[_0x7d77('0x29')],'type':_0x22c6ad[_0x7d77('0x2a')][_0x7d77('0x2b')]};});_0x53e397[_0x7d77('0x2c')]=_['map'](_0x1ee00c,_0x7d77('0x25'));_0x53e397[_0x7d77('0x2d')]=_['keys'](_0x1878d6[_0x7d77('0x2d')]);_0x53e397['filters']=_[_0x7d77('0x2e')](_0x53e397[_0x7d77('0x2c')],_0x53e397[_0x7d77('0x2d')]);_0x5553bf[_0x7d77('0x2f')]=_['intersection'](_0x53e397[_0x7d77('0x2c')],qs[_0x7d77('0x30')](_0x1878d6[_0x7d77('0x2d')]['fields']));_0x5553bf['attributes']=_0x5553bf[_0x7d77('0x2f')][_0x7d77('0x31')]?_0x5553bf[_0x7d77('0x2f')]:_0x53e397['model'];if(!_0x1878d6[_0x7d77('0x2d')]['hasOwnProperty'](_0x7d77('0x32'))){_0x5553bf[_0x7d77('0x1b')]=qs[_0x7d77('0x1b')](_0x1878d6[_0x7d77('0x2d')][_0x7d77('0x1b')]);_0x5553bf[_0x7d77('0x1a')]=qs[_0x7d77('0x1a')](_0x1878d6[_0x7d77('0x2d')][_0x7d77('0x1a')]);}_0x5553bf['order']=qs[_0x7d77('0x33')](_0x1878d6[_0x7d77('0x2d')][_0x7d77('0x33')]);_0x5553bf['where']=qs['filters'](_[_0x7d77('0x34')](_0x1878d6[_0x7d77('0x2d')],_0x53e397[_0x7d77('0x35')]),_0x1ee00c);if(_0x1878d6[_0x7d77('0x2d')]['filter']){_0x5553bf[_0x7d77('0x36')]=_['merge'](_0x5553bf['where'],{'$or':_[_0x7d77('0x26')](_0x1ee00c,function(_0x35129b){if(_0x35129b['type']!==_0x7d77('0x37')){var _0x2447ed={};_0x2447ed[_0x35129b[_0x7d77('0x25')]]={'$like':'%'+_0x1878d6[_0x7d77('0x2d')]['filter']+'%'};return _0x2447ed;}})});}_0x5553bf=_[_0x7d77('0x38')]({},_0x5553bf,_0x1878d6[_0x7d77('0x39')]);var _0x5d873={'where':_0x5553bf[_0x7d77('0x36')]};return db[_0x7d77('0x27')][_0x7d77('0x1d')](_0x5d873)[_0x7d77('0x20')](function(_0x5d9ca3){_0x9aa664[_0x7d77('0x1d')]=_0x5d9ca3;if(_0x1878d6['query'][_0x7d77('0x3a')]){_0x5553bf[_0x7d77('0x3b')]=[{'all':!![]}];}return db[_0x7d77('0x27')][_0x7d77('0x3c')](_0x5553bf);})[_0x7d77('0x20')](function(_0x2a8aa0){_0x9aa664['rows']=_0x2a8aa0;return _0x9aa664;})[_0x7d77('0x20')](respondWithFilteredResult(_0x1cc0f1,_0x5553bf))[_0x7d77('0x3d')](handleError(_0x1cc0f1,null));};exports[_0x7d77('0x3e')]=function(_0x4535ed,_0x3ac3ed){var _0x532e0f={'raw':![],'where':{'id':_0x4535ed[_0x7d77('0x3f')]['id']}},_0x41b99c={};_0x41b99c[_0x7d77('0x2c')]=_['keys'](db[_0x7d77('0x27')]['rawAttributes']);_0x41b99c[_0x7d77('0x2d')]=_['keys'](_0x4535ed[_0x7d77('0x2d')]);_0x41b99c['filters']=_[_0x7d77('0x2e')](_0x41b99c['model'],_0x41b99c[_0x7d77('0x2d')]);_0x532e0f[_0x7d77('0x2f')]=_[_0x7d77('0x2e')](_0x41b99c['model'],qs[_0x7d77('0x30')](_0x4535ed[_0x7d77('0x2d')][_0x7d77('0x30')]));_0x532e0f[_0x7d77('0x2f')]=_0x532e0f[_0x7d77('0x2f')][_0x7d77('0x31')]?_0x532e0f['attributes']:_0x41b99c['model'];if(_0x4535ed['query']['includeAll']){_0x532e0f[_0x7d77('0x3b')]=[{'all':!![]}];}_0x532e0f=_[_0x7d77('0x38')]({},_0x532e0f,_0x4535ed[_0x7d77('0x39')]);return db['Trigger'][_0x7d77('0x40')](_0x532e0f)[_0x7d77('0x20')](handleEntityNotFound(_0x3ac3ed,null))['then'](respondWithResult(_0x3ac3ed,null))['catch'](handleError(_0x3ac3ed,null));};exports['create']=function(_0x1c7a97,_0xc8a6ee){return db['Trigger'][_0x7d77('0x41')](_0x1c7a97[_0x7d77('0x42')],{})[_0x7d77('0x20')](function(_0x1b9433){var _0x4ec2dd=_0x1c7a97[_0x7d77('0x43')][_0x7d77('0x44')]({'plain':!![]});if(!_0x4ec2dd)throw new Error(_0x7d77('0x45'));if(_0x4ec2dd[_0x7d77('0x46')]==='user'){var _0x1a3d0c=_0x1b9433[_0x7d77('0x44')]({'plain':!![]});var _0x479844=_0x7d77('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x479844,'userProfileId':_0x4ec2dd[_0x7d77('0x47')]},'raw':!![]})[_0x7d77('0x20')](function(_0x4a0a60){if(_0x4a0a60&&_0x4a0a60['autoAssociation']===0x0){return db[_0x7d77('0x23')][_0x7d77('0x41')]({'name':_0x1a3d0c['name'],'resourceId':_0x1a3d0c['id'],'type':_0x4a0a60['name'],'sectionId':_0x4a0a60['id']},{})[_0x7d77('0x20')](function(){return _0x1b9433;});}else{return _0x1b9433;}})[_0x7d77('0x3d')](function(_0x211866){logger[_0x7d77('0x24')](_0x7d77('0x48'),_0x211866);throw _0x211866;});}return _0x1b9433;})[_0x7d77('0x20')](respondWithResult(_0xc8a6ee,0xc9))['catch'](handleError(_0xc8a6ee,null));};exports[_0x7d77('0x1f')]=function(_0x2ad464,_0x1ad4a2){if(_0x2ad464['body']['id']){delete _0x2ad464[_0x7d77('0x42')]['id'];}return db[_0x7d77('0x27')]['find']({'where':{'id':_0x2ad464[_0x7d77('0x3f')]['id']}})[_0x7d77('0x20')](handleEntityNotFound(_0x1ad4a2,null))[_0x7d77('0x20')](saveUpdates(_0x2ad464[_0x7d77('0x42')],null))[_0x7d77('0x20')](respondWithResult(_0x1ad4a2,null))[_0x7d77('0x3d')](handleError(_0x1ad4a2,null));};exports[_0x7d77('0x21')]=function(_0x17bf9e,_0x1bbf61){return db['Trigger'][_0x7d77('0x40')]({'where':{'id':_0x17bf9e[_0x7d77('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1bbf61,null))[_0x7d77('0x20')](removeEntity(_0x1bbf61,null))['catch'](handleError(_0x1bbf61,null));};exports[_0x7d77('0x49')]=function(_0x4f6dd5,_0x4a1013,_0x6f4c48){if(_0x4f6dd5[_0x7d77('0x42')]['id']){delete _0x4f6dd5[_0x7d77('0x42')]['id'];}return db[_0x7d77('0x27')][_0x7d77('0x40')]({'where':{'id':_0x4f6dd5[_0x7d77('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a1013,null))[_0x7d77('0x20')](function(_0x57f056){if(_0x57f056){_0x4f6dd5[_0x7d77('0x42')][_0x7d77('0x4a')]=_0x57f056['id'];return db[_0x7d77('0x4b')][_0x7d77('0x41')](_0x4f6dd5[_0x7d77('0x42')]);}})[_0x7d77('0x20')](respondWithResult(_0x4a1013,null))[_0x7d77('0x3d')](handleError(_0x4a1013,null));};exports['addAnyCondition']=function(_0x34b636,_0x24d522,_0x56a438){if(_0x34b636[_0x7d77('0x42')]['id']){delete _0x34b636[_0x7d77('0x42')]['id'];}return db[_0x7d77('0x27')][_0x7d77('0x40')]({'where':{'id':_0x34b636[_0x7d77('0x3f')]['id']}})[_0x7d77('0x20')](handleEntityNotFound(_0x24d522,null))[_0x7d77('0x20')](function(_0x1f6f4e){if(_0x1f6f4e){_0x34b636[_0x7d77('0x42')][_0x7d77('0x4c')]=_0x1f6f4e['id'];return db['Condition'][_0x7d77('0x41')](_0x34b636[_0x7d77('0x42')]);}})[_0x7d77('0x20')](respondWithResult(_0x24d522,null))[_0x7d77('0x3d')](handleError(_0x24d522,null));};exports[_0x7d77('0x4d')]=function(_0x49b6e2,_0x564af2,_0x160658){var _0x5b98c0={};var _0x3fff7c={};var _0x3c61de;var _0x79c4c7;return db[_0x7d77('0x27')][_0x7d77('0x4e')]({'where':{'id':_0x49b6e2[_0x7d77('0x3f')]['id']}})[_0x7d77('0x20')](handleEntityNotFound(_0x564af2,null))[_0x7d77('0x20')](function(_0x3e0728){if(_0x3e0728){_0x3c61de=_0x3e0728;_0x3fff7c[_0x7d77('0x2c')]=_['keys'](db[_0x7d77('0x4b')][_0x7d77('0x28')]);_0x3fff7c[_0x7d77('0x2d')]=_[_0x7d77('0x4f')](_0x49b6e2[_0x7d77('0x2d')]);_0x3fff7c['filters']=_[_0x7d77('0x2e')](_0x3fff7c[_0x7d77('0x2c')],_0x3fff7c[_0x7d77('0x2d')]);_0x5b98c0[_0x7d77('0x2f')]=_[_0x7d77('0x2e')](_0x3fff7c[_0x7d77('0x2c')],qs[_0x7d77('0x30')](_0x49b6e2[_0x7d77('0x2d')][_0x7d77('0x30')]));_0x5b98c0[_0x7d77('0x2f')]=_0x5b98c0[_0x7d77('0x2f')][_0x7d77('0x31')]?_0x5b98c0['attributes']:_0x3fff7c[_0x7d77('0x2c')];_0x5b98c0[_0x7d77('0x50')]=qs[_0x7d77('0x33')](_0x49b6e2['query'][_0x7d77('0x33')]);_0x5b98c0[_0x7d77('0x36')]=qs[_0x7d77('0x35')](_[_0x7d77('0x34')](_0x49b6e2[_0x7d77('0x2d')],_0x3fff7c['filters']));if(_0x49b6e2[_0x7d77('0x2d')][_0x7d77('0x51')]){_0x5b98c0[_0x7d77('0x36')]=_[_0x7d77('0x38')](_0x5b98c0['where'],{'$or':_[_0x7d77('0x26')](_0x5b98c0[_0x7d77('0x2f')],function(_0xe773f6){var _0x757f51={};_0x757f51[_0xe773f6]={'$like':'%'+_0x49b6e2[_0x7d77('0x2d')][_0x7d77('0x51')]+'%'};return _0x757f51;})});}_0x5b98c0=_[_0x7d77('0x38')]({},_0x5b98c0,_0x49b6e2['options']);return _0x3c61de[_0x7d77('0x4d')](_0x5b98c0);}})[_0x7d77('0x20')](function(_0x54b6e2){if(_0x54b6e2){_0x79c4c7=_0x54b6e2[_0x7d77('0x31')];if(!_0x49b6e2[_0x7d77('0x2d')][_0x7d77('0x52')](_0x7d77('0x32'))){_0x5b98c0['limit']=qs[_0x7d77('0x1b')](_0x49b6e2[_0x7d77('0x2d')][_0x7d77('0x1b')]);_0x5b98c0['offset']=qs[_0x7d77('0x1a')](_0x49b6e2[_0x7d77('0x2d')][_0x7d77('0x1a')]);}return _0x3c61de[_0x7d77('0x4d')](_0x5b98c0);}})[_0x7d77('0x20')](function(_0x3acf10){if(_0x3acf10){return _0x3acf10?{'count':_0x79c4c7,'rows':_0x3acf10}:null;}})[_0x7d77('0x20')](respondWithResult(_0x564af2,null))['catch'](handleError(_0x564af2,null));};exports[_0x7d77('0x53')]=function(_0xac6cc2,_0x13aac0,_0x1e52d1){var _0x5d3289={};var _0x5ecdeb={};var _0x3c7795;var _0x3f6458;return db[_0x7d77('0x27')][_0x7d77('0x4e')]({'where':{'id':_0xac6cc2[_0x7d77('0x3f')]['id']}})[_0x7d77('0x20')](handleEntityNotFound(_0x13aac0,null))[_0x7d77('0x20')](function(_0x53baf3){if(_0x53baf3){_0x3c7795=_0x53baf3;_0x5ecdeb['model']=_['keys'](db['Condition'][_0x7d77('0x28')]);_0x5ecdeb[_0x7d77('0x2d')]=_[_0x7d77('0x4f')](_0xac6cc2['query']);_0x5ecdeb[_0x7d77('0x35')]=_[_0x7d77('0x2e')](_0x5ecdeb[_0x7d77('0x2c')],_0x5ecdeb['query']);_0x5d3289[_0x7d77('0x2f')]=_[_0x7d77('0x2e')](_0x5ecdeb['model'],qs['fields'](_0xac6cc2[_0x7d77('0x2d')][_0x7d77('0x30')]));_0x5d3289['attributes']=_0x5d3289[_0x7d77('0x2f')][_0x7d77('0x31')]?_0x5d3289[_0x7d77('0x2f')]:_0x5ecdeb[_0x7d77('0x2c')];_0x5d3289[_0x7d77('0x50')]=qs[_0x7d77('0x33')](_0xac6cc2[_0x7d77('0x2d')][_0x7d77('0x33')]);_0x5d3289[_0x7d77('0x36')]=qs[_0x7d77('0x35')](_['pick'](_0xac6cc2[_0x7d77('0x2d')],_0x5ecdeb[_0x7d77('0x35')]));if(_0xac6cc2[_0x7d77('0x2d')][_0x7d77('0x51')]){_0x5d3289[_0x7d77('0x36')]=_['merge'](_0x5d3289[_0x7d77('0x36')],{'$or':_[_0x7d77('0x26')](_0x5d3289[_0x7d77('0x2f')],function(_0x1acb4c){var _0x11cfe1={};_0x11cfe1[_0x1acb4c]={'$like':'%'+_0xac6cc2[_0x7d77('0x2d')]['filter']+'%'};return _0x11cfe1;})});}_0x5d3289=_[_0x7d77('0x38')]({},_0x5d3289,_0xac6cc2[_0x7d77('0x39')]);return _0x3c7795[_0x7d77('0x53')](_0x5d3289);}})[_0x7d77('0x20')](function(_0x50f909){if(_0x50f909){_0x3f6458=_0x50f909[_0x7d77('0x31')];if(!_0xac6cc2[_0x7d77('0x2d')][_0x7d77('0x52')](_0x7d77('0x32'))){_0x5d3289['limit']=qs['limit'](_0xac6cc2[_0x7d77('0x2d')][_0x7d77('0x1b')]);_0x5d3289[_0x7d77('0x1a')]=qs[_0x7d77('0x1a')](_0xac6cc2[_0x7d77('0x2d')][_0x7d77('0x1a')]);}return _0x3c7795[_0x7d77('0x53')](_0x5d3289);}})['then'](function(_0x3a4e31){if(_0x3a4e31){return _0x3a4e31?{'count':_0x3f6458,'rows':_0x3a4e31}:null;}})['then'](respondWithResult(_0x13aac0,null))[_0x7d77('0x3d')](handleError(_0x13aac0,null));};exports['addAction']=function(_0x5a254f,_0x3beb15,_0x567a7e){if(_0x5a254f['body']['id']){delete _0x5a254f[_0x7d77('0x42')]['id'];}return db[_0x7d77('0x27')][_0x7d77('0x40')]({'where':{'id':_0x5a254f[_0x7d77('0x3f')]['id']}})[_0x7d77('0x20')](handleEntityNotFound(_0x3beb15,null))['then'](function(_0x233398){if(_0x233398){_0x5a254f[_0x7d77('0x42')][_0x7d77('0x54')]=_0x233398['id'];return db[_0x7d77('0x55')][_0x7d77('0x41')](_0x5a254f[_0x7d77('0x42')]);}})[_0x7d77('0x20')](respondWithResult(_0x3beb15,null))['catch'](handleError(_0x3beb15,null));};exports[_0x7d77('0x56')]=function(_0x2659ee,_0x20cfba,_0xe7d484){var _0x4fa1e2={};var _0x2e68bc={};var _0x3b36fd;var _0x4a3d91;return db[_0x7d77('0x27')]['findOne']({'where':{'id':_0x2659ee[_0x7d77('0x3f')]['id']}})[_0x7d77('0x20')](handleEntityNotFound(_0x20cfba,null))[_0x7d77('0x20')](function(_0x2ba4bb){if(_0x2ba4bb){_0x3b36fd=_0x2ba4bb;_0x2e68bc['model']=_['keys'](db['Action'][_0x7d77('0x28')]);_0x2e68bc[_0x7d77('0x2d')]=_['keys'](_0x2659ee[_0x7d77('0x2d')]);_0x2e68bc['filters']=_['intersection'](_0x2e68bc['model'],_0x2e68bc[_0x7d77('0x2d')]);_0x4fa1e2[_0x7d77('0x2f')]=_[_0x7d77('0x2e')](_0x2e68bc[_0x7d77('0x2c')],qs[_0x7d77('0x30')](_0x2659ee[_0x7d77('0x2d')][_0x7d77('0x30')]));_0x4fa1e2[_0x7d77('0x2f')]=_0x4fa1e2['attributes'][_0x7d77('0x31')]?_0x4fa1e2[_0x7d77('0x2f')]:_0x2e68bc['model'];_0x4fa1e2[_0x7d77('0x50')]=qs[_0x7d77('0x33')](_0x2659ee[_0x7d77('0x2d')][_0x7d77('0x33')]);_0x4fa1e2[_0x7d77('0x36')]=qs[_0x7d77('0x35')](_['pick'](_0x2659ee[_0x7d77('0x2d')],_0x2e68bc['filters']));if(_0x2659ee['query'][_0x7d77('0x51')]){_0x4fa1e2[_0x7d77('0x36')]=_['merge'](_0x4fa1e2[_0x7d77('0x36')],{'$or':_[_0x7d77('0x26')](_0x4fa1e2['attributes'],function(_0x2e7c82){var _0x24cb64={};_0x24cb64[_0x2e7c82]={'$like':'%'+_0x2659ee[_0x7d77('0x2d')][_0x7d77('0x51')]+'%'};return _0x24cb64;})});}_0x4fa1e2=_['merge']({},_0x4fa1e2,_0x2659ee[_0x7d77('0x39')]);return _0x3b36fd[_0x7d77('0x56')](_0x4fa1e2);}})[_0x7d77('0x20')](function(_0x30137e){if(_0x30137e){_0x4a3d91=_0x30137e[_0x7d77('0x31')];if(!_0x2659ee[_0x7d77('0x2d')]['hasOwnProperty'](_0x7d77('0x32'))){_0x4fa1e2[_0x7d77('0x1b')]=qs[_0x7d77('0x1b')](_0x2659ee['query'][_0x7d77('0x1b')]);_0x4fa1e2[_0x7d77('0x1a')]=qs[_0x7d77('0x1a')](_0x2659ee[_0x7d77('0x2d')][_0x7d77('0x1a')]);}return _0x3b36fd[_0x7d77('0x56')](_0x4fa1e2);}})['then'](function(_0x52be1e){if(_0x52be1e){return _0x52be1e?{'count':_0x4a3d91,'rows':_0x52be1e}:null;}})[_0x7d77('0x20')](respondWithResult(_0x20cfba,null))[_0x7d77('0x3d')](handleError(_0x20cfba,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 11c88cb..5113bc2 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 _0x6c96=['api','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger','lodash','../../config/logger'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x6c96,0x1c1));var _0x66c9=function(_0x56a7b5,_0x28c029){_0x56a7b5=_0x56a7b5-0x0;var _0x39a446=_0x6c96[_0x56a7b5];return _0x39a446;};'use strict';var _=require(_0x66c9('0x0'));var util=require('util');var logger=require(_0x66c9('0x1'))(_0x66c9('0x2'));var moment=require('moment');var BPromise=require(_0x66c9('0x3'));var rp=require(_0x66c9('0x4'));var fs=require('fs');var path=require(_0x66c9('0x5'));var rimraf=require(_0x66c9('0x6'));var config=require(_0x66c9('0x7'));var attributes=require(_0x66c9('0x8'));module[_0x66c9('0x9')]=function(_0x55b24d,_0x1c8b59){return _0x55b24d['define'](_0x66c9('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c4d=['api','bluebird','request-promise','path','rimraf','./trigger.attributes','define','Trigger','tools_triggers','util','../../config/logger'];(function(_0x1ba02d,_0x168483){var _0x1682e1=function(_0x465e10){while(--_0x465e10){_0x1ba02d['push'](_0x1ba02d['shift']());}};_0x1682e1(++_0x168483);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x5e56cc,_0x4f1c39){_0x5e56cc=_0x5e56cc-0x0;var _0x575e73=_0x1c4d[_0x5e56cc];return _0x575e73;};'use strict';var _=require('lodash');var util=require(_0xd1c4('0x0'));var logger=require(_0xd1c4('0x1'))(_0xd1c4('0x2'));var moment=require('moment');var BPromise=require(_0xd1c4('0x3'));var rp=require(_0xd1c4('0x4'));var fs=require('fs');var path=require(_0xd1c4('0x5'));var rimraf=require(_0xd1c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xd1c4('0x7'));module['exports']=function(_0x406eb6,_0x12e793){return _0x406eb6[_0xd1c4('0x8')](_0xd1c4('0x9'),attributes,{'tableName':_0xd1c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 2f2efe9..375e8bd 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 _0x29ea=['message','info','result','catch','GetTrigger','Trigger','options','raw','where','attributes','include','map','model','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xd8632b,_0x1c4870){var _0x203f68=function(_0x1afd5f){while(--_0x1afd5f){_0xd8632b['push'](_0xd8632b['shift']());}};_0x203f68(++_0x1c4870);}(_0x29ea,0x1e3));var _0xa29e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x29ea[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa29e('0x0'));var util=require(_0xa29e('0x1'));var moment=require(_0xa29e('0x2'));var BPromise=require(_0xa29e('0x3'));var rs=require(_0xa29e('0x4'));var fs=require('fs');var Redis=require(_0xa29e('0x5'));var db=require(_0xa29e('0x6'))['db'];var utils=require(_0xa29e('0x7'));var logger=require('../../config/logger')(_0xa29e('0x8'));var config=require(_0xa29e('0x9'));var jayson=require(_0xa29e('0xa'));var client=jayson[_0xa29e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x348cb8,_0xe8479f,_0x1249ed){return new BPromise(function(_0x706fd6,_0x195bcf){return client[_0xa29e('0xc')](_0x348cb8,_0x1249ed)[_0xa29e('0xd')](function(_0x4e9931){logger['info'](_0xa29e('0xe'),_0xe8479f,_0xa29e('0xf'));logger[_0xa29e('0x10')](_0xa29e('0x11'),_0xe8479f,'request\x20sent',JSON[_0xa29e('0x12')](_0x4e9931));if(_0x4e9931[_0xa29e('0x13')]){if(_0x4e9931[_0xa29e('0x13')][_0xa29e('0x14')]===0x1f4){logger[_0xa29e('0x13')]('Trigger,\x20%s,\x20%s',_0xe8479f,_0x4e9931[_0xa29e('0x13')]['message']);return _0x195bcf(_0x4e9931[_0xa29e('0x13')][_0xa29e('0x15')]);}logger[_0xa29e('0x13')](_0xa29e('0xe'),_0xe8479f,_0x4e9931[_0xa29e('0x13')][_0xa29e('0x15')]);return _0x706fd6(_0x4e9931['error'][_0xa29e('0x15')]);}else{logger[_0xa29e('0x16')](_0xa29e('0xe'),_0xe8479f,'request\x20sent');_0x706fd6(_0x4e9931[_0xa29e('0x17')][_0xa29e('0x15')]);}})[_0xa29e('0x18')](function(_0x1e7d44){logger[_0xa29e('0x13')](_0xa29e('0xe'),_0xe8479f,_0x1e7d44);_0x195bcf(_0x1e7d44);});});}exports[_0xa29e('0x19')]=function(_0x4c1244){var _0xa96d51=this;return new Promise(function(_0x416873,_0x111b62){return db[_0xa29e('0x1a')]['findAll']({'raw':_0x4c1244[_0xa29e('0x1b')]?_0x4c1244[_0xa29e('0x1b')][_0xa29e('0x1c')]===undefined?!![]:![]:!![],'where':_0x4c1244[_0xa29e('0x1b')]?_0x4c1244[_0xa29e('0x1b')][_0xa29e('0x1d')]||null:null,'attributes':_0x4c1244['options']?_0x4c1244[_0xa29e('0x1b')][_0xa29e('0x1e')]||null:null,'limit':_0x4c1244[_0xa29e('0x1b')]?_0x4c1244[_0xa29e('0x1b')]['limit']||null:null,'include':_0x4c1244[_0xa29e('0x1b')]?_0x4c1244[_0xa29e('0x1b')][_0xa29e('0x1f')]?_[_0xa29e('0x20')](_0x4c1244[_0xa29e('0x1b')][_0xa29e('0x1f')],function(_0x42ba3e){return{'model':db[_0x42ba3e[_0xa29e('0x21')]],'as':_0x42ba3e['as'],'attributes':_0x42ba3e[_0xa29e('0x1e')],'include':_0x42ba3e[_0xa29e('0x1f')]?_['map'](_0x42ba3e[_0xa29e('0x1f')],function(_0x5f5666){return{'model':db[_0x5f5666[_0xa29e('0x21')]],'as':_0x5f5666['as'],'attributes':_0x5f5666[_0xa29e('0x1e')],'include':_0x5f5666['include']?_['map'](_0x5f5666[_0xa29e('0x1f')],function(_0x59ffa1){return{'model':db[_0x59ffa1[_0xa29e('0x21')]],'as':_0x59ffa1['as'],'attributes':_0x59ffa1[_0xa29e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa29e('0xd')](function(_0x504ad6){logger[_0xa29e('0x16')]('GetTrigger',_0x4c1244);logger[_0xa29e('0x10')](_0xa29e('0x19'),_0x4c1244,JSON[_0xa29e('0x12')](_0x504ad6));_0x416873(_0x504ad6);})['catch'](function(_0x3ab69d){logger[_0xa29e('0x13')]('GetTrigger',_0x3ab69d[_0xa29e('0x15')],_0x4c1244);_0x111b62(_0xa96d51[_0xa29e('0x13')](0x1f4,_0x3ab69d['message']));});});};exports[_0xa29e('0x22')]=function(_0x3dd588){var _0x5d8b70=this;return new Promise(function(_0x5cdc6c,_0x79a52a){return db[_0xa29e('0x1a')][_0xa29e('0x23')]({'raw':_0x3dd588['options']?_0x3dd588[_0xa29e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3dd588[_0xa29e('0x1b')]?_0x3dd588[_0xa29e('0x1b')][_0xa29e('0x1d')]||null:null,'attributes':_0x3dd588['options']?_0x3dd588[_0xa29e('0x1b')]['attributes']||null:null,'include':_0x3dd588[_0xa29e('0x1b')]?_0x3dd588[_0xa29e('0x1b')][_0xa29e('0x1f')]?_[_0xa29e('0x20')](_0x3dd588['options'][_0xa29e('0x1f')],function(_0x199129){return{'model':db[_0x199129['model']],'as':_0x199129['as'],'attributes':_0x199129[_0xa29e('0x1e')],'include':_0x199129['include']?_[_0xa29e('0x20')](_0x199129[_0xa29e('0x1f')],function(_0x53ca30){return{'model':db[_0x53ca30[_0xa29e('0x21')]],'as':_0x53ca30['as'],'attributes':_0x53ca30['attributes'],'include':_0x53ca30[_0xa29e('0x1f')]?_[_0xa29e('0x20')](_0x53ca30[_0xa29e('0x1f')],function(_0x23f16c){return{'model':db[_0x23f16c[_0xa29e('0x21')]],'as':_0x23f16c['as'],'attributes':_0x23f16c[_0xa29e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47ba90){logger[_0xa29e('0x16')](_0xa29e('0x22'),_0x3dd588);logger[_0xa29e('0x10')](_0xa29e('0x22'),_0x3dd588,JSON[_0xa29e('0x12')](_0x47ba90));_0x5cdc6c(_0x47ba90);})[_0xa29e('0x18')](function(_0x555829){logger[_0xa29e('0x13')](_0xa29e('0x22'),_0x555829['message'],_0x3dd588);_0x79a52a(_0x5d8b70[_0xa29e('0x13')](0x1f4,_0x555829[_0xa29e('0x15')]));});});}; \ No newline at end of file +var _0x600c=['result','GetTrigger','Trigger','findAll','options','where','attributes','limit','include','map','model','debug','catch','ShowTrigger','find','raw','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','stringify','error','message','Trigger,\x20%s,\x20%s'];(function(_0x1ff347,_0x14f1d1){var _0x349ef7=function(_0x446f8f){while(--_0x446f8f){_0x1ff347['push'](_0x1ff347['shift']());}};_0x349ef7(++_0x14f1d1);}(_0x600c,0x127));var _0xc600=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x600c[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xc600('0x0'));var util=require(_0xc600('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc600('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc600('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xc600('0x4'));var jayson=require(_0xc600('0x5'));var client=jayson['client'][_0xc600('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x378bba,_0x4c4084,_0x494df9){return new BPromise(function(_0x312ff4,_0x30d493){return client[_0xc600('0x7')](_0x378bba,_0x494df9)[_0xc600('0x8')](function(_0x42da37){logger[_0xc600('0x9')]('Trigger,\x20%s,\x20%s',_0x4c4084,'request\x20sent');logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x4c4084,_0xc600('0xa'),JSON[_0xc600('0xb')](_0x42da37));if(_0x42da37['error']){if(_0x42da37[_0xc600('0xc')]['code']===0x1f4){logger[_0xc600('0xc')]('Trigger,\x20%s,\x20%s',_0x4c4084,_0x42da37[_0xc600('0xc')][_0xc600('0xd')]);return _0x30d493(_0x42da37[_0xc600('0xc')][_0xc600('0xd')]);}logger[_0xc600('0xc')](_0xc600('0xe'),_0x4c4084,_0x42da37[_0xc600('0xc')][_0xc600('0xd')]);return _0x312ff4(_0x42da37[_0xc600('0xc')][_0xc600('0xd')]);}else{logger[_0xc600('0x9')](_0xc600('0xe'),_0x4c4084,_0xc600('0xa'));_0x312ff4(_0x42da37[_0xc600('0xf')][_0xc600('0xd')]);}})['catch'](function(_0x510c0f){logger['error'](_0xc600('0xe'),_0x4c4084,_0x510c0f);_0x30d493(_0x510c0f);});});}exports[_0xc600('0x10')]=function(_0x2b32b0){var _0x4bbbff=this;return new Promise(function(_0x54e825,_0x4f1147){return db[_0xc600('0x11')][_0xc600('0x12')]({'raw':_0x2b32b0[_0xc600('0x13')]?_0x2b32b0['options']['raw']===undefined?!![]:![]:!![],'where':_0x2b32b0['options']?_0x2b32b0[_0xc600('0x13')][_0xc600('0x14')]||null:null,'attributes':_0x2b32b0[_0xc600('0x13')]?_0x2b32b0[_0xc600('0x13')][_0xc600('0x15')]||null:null,'limit':_0x2b32b0[_0xc600('0x13')]?_0x2b32b0[_0xc600('0x13')][_0xc600('0x16')]||null:null,'include':_0x2b32b0[_0xc600('0x13')]?_0x2b32b0[_0xc600('0x13')][_0xc600('0x17')]?_[_0xc600('0x18')](_0x2b32b0[_0xc600('0x13')][_0xc600('0x17')],function(_0x53fc14){return{'model':db[_0x53fc14[_0xc600('0x19')]],'as':_0x53fc14['as'],'attributes':_0x53fc14[_0xc600('0x15')],'include':_0x53fc14[_0xc600('0x17')]?_[_0xc600('0x18')](_0x53fc14[_0xc600('0x17')],function(_0x24f360){return{'model':db[_0x24f360[_0xc600('0x19')]],'as':_0x24f360['as'],'attributes':_0x24f360[_0xc600('0x15')],'include':_0x24f360[_0xc600('0x17')]?_['map'](_0x24f360[_0xc600('0x17')],function(_0x18fd26){return{'model':db[_0x18fd26[_0xc600('0x19')]],'as':_0x18fd26['as'],'attributes':_0x18fd26[_0xc600('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25a2b7){logger[_0xc600('0x9')]('GetTrigger',_0x2b32b0);logger[_0xc600('0x1a')](_0xc600('0x10'),_0x2b32b0,JSON[_0xc600('0xb')](_0x25a2b7));_0x54e825(_0x25a2b7);})[_0xc600('0x1b')](function(_0x16c64f){logger['error'](_0xc600('0x10'),_0x16c64f['message'],_0x2b32b0);_0x4f1147(_0x4bbbff[_0xc600('0xc')](0x1f4,_0x16c64f['message']));});});};exports[_0xc600('0x1c')]=function(_0x2bbd60){var _0x2a3b17=this;return new Promise(function(_0x1c2d33,_0x2b2325){return db[_0xc600('0x11')][_0xc600('0x1d')]({'raw':_0x2bbd60[_0xc600('0x13')]?_0x2bbd60[_0xc600('0x13')][_0xc600('0x1e')]===undefined?!![]:![]:!![],'where':_0x2bbd60[_0xc600('0x13')]?_0x2bbd60[_0xc600('0x13')][_0xc600('0x14')]||null:null,'attributes':_0x2bbd60[_0xc600('0x13')]?_0x2bbd60['options'][_0xc600('0x15')]||null:null,'include':_0x2bbd60['options']?_0x2bbd60[_0xc600('0x13')][_0xc600('0x17')]?_[_0xc600('0x18')](_0x2bbd60[_0xc600('0x13')][_0xc600('0x17')],function(_0x505a41){return{'model':db[_0x505a41[_0xc600('0x19')]],'as':_0x505a41['as'],'attributes':_0x505a41[_0xc600('0x15')],'include':_0x505a41['include']?_[_0xc600('0x18')](_0x505a41[_0xc600('0x17')],function(_0x5087db){return{'model':db[_0x5087db[_0xc600('0x19')]],'as':_0x5087db['as'],'attributes':_0x5087db[_0xc600('0x15')],'include':_0x5087db[_0xc600('0x17')]?_[_0xc600('0x18')](_0x5087db[_0xc600('0x17')],function(_0x53606e){return{'model':db[_0x53606e[_0xc600('0x19')]],'as':_0x53606e['as'],'attributes':_0x53606e[_0xc600('0x15')]};}):[]};}):[]};}):[]:[]})[_0xc600('0x8')](function(_0x3e6bca){logger[_0xc600('0x9')](_0xc600('0x1c'),_0x2bbd60);logger[_0xc600('0x1a')](_0xc600('0x1c'),_0x2bbd60,JSON[_0xc600('0xb')](_0x3e6bca));_0x1c2d33(_0x3e6bca);})[_0xc600('0x1b')](function(_0x1f5d69){logger['error'](_0xc600('0x1c'),_0x1f5d69[_0xc600('0xd')],_0x2bbd60);_0x2b2325(_0x2a3b17['error'](0x1f4,_0x1f5d69[_0xc600('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index fb9c34a..7148d20 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 _0x9f21=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','index','get','isAuthenticated','show','post','/:id','update','delete'];(function(_0x503ee3,_0xd9e0b2){var _0x158c61=function(_0x407aa6){while(--_0x407aa6){_0x503ee3['push'](_0x503ee3['shift']());}};_0x158c61(++_0xd9e0b2);}(_0x9f21,0x177));var _0x19f2=function(_0x2ab251,_0x41f7bb){_0x2ab251=_0x2ab251-0x0;var _0x4461c4=_0x9f21[_0x2ab251];return _0x4461c4;};'use strict';var multer=require(_0x19f2('0x0'));var util=require('util');var path=require(_0x19f2('0x1'));var timeout=require(_0x19f2('0x2'));var express=require('express');var router=express[_0x19f2('0x3')]();var fs_extra=require(_0x19f2('0x4'));var auth=require(_0x19f2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x19f2('0x6'));var controller=require(_0x19f2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x19f2('0x8')]);router[_0x19f2('0x9')]('/:id',auth[_0x19f2('0xa')](),controller[_0x19f2('0xb')]);router['post']('/:id/clone',auth[_0x19f2('0xa')](),controller['clone']);router[_0x19f2('0xc')]('/',auth[_0x19f2('0xa')](),controller['create']);router['put'](_0x19f2('0xd'),auth[_0x19f2('0xa')](),controller[_0x19f2('0xe')]);router[_0x19f2('0xf')]('/:id',auth[_0x19f2('0xa')](),controller['destroy']);module[_0x19f2('0x10')]=router; \ No newline at end of file +var _0xff63=['index','/:id','show','post','/:id/clone','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff63,0x1ab));var _0x3ff6=function(_0x28025d,_0x13fd3f){_0x28025d=_0x28025d-0x0;var _0x5c5447=_0xff63[_0x28025d];return _0x5c5447;};'use strict';var multer=require('multer');var util=require(_0x3ff6('0x0'));var path=require(_0x3ff6('0x1'));var timeout=require(_0x3ff6('0x2'));var express=require(_0x3ff6('0x3'));var router=express[_0x3ff6('0x4')]();var fs_extra=require(_0x3ff6('0x5'));var auth=require(_0x3ff6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3ff6('0x7'));var controller=require('./trunk.controller');router[_0x3ff6('0x8')]('/',auth[_0x3ff6('0x9')](),controller[_0x3ff6('0xa')]);router[_0x3ff6('0x8')](_0x3ff6('0xb'),auth[_0x3ff6('0x9')](),controller[_0x3ff6('0xc')]);router[_0x3ff6('0xd')](_0x3ff6('0xe'),auth['isAuthenticated'](),controller['clone']);router[_0x3ff6('0xd')]('/',auth[_0x3ff6('0x9')](),controller[_0x3ff6('0xf')]);router[_0x3ff6('0x10')](_0x3ff6('0xb'),auth['isAuthenticated'](),controller[_0x3ff6('0x11')]);router['delete'](_0x3ff6('0xb'),auth[_0x3ff6('0x9')](),controller['destroy']);module[_0x3ff6('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 e63d23d..453ad61 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 _0x4888=['ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','STRING','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','uas','pai','active','passive','dynamic','update,nonat','sequelize','exports','name'];(function(_0x3bfee5,_0x2b9999){var _0x174789=function(_0x2eb89a){while(--_0x2eb89a){_0x3bfee5['push'](_0x3bfee5['shift']());}};_0x174789(++_0x2b9999);}(_0x4888,0x8d));var _0x8488=function(_0x8955b3,_0x3af8b4){_0x8955b3=_0x8955b3-0x0;var _0x369673=_0x4888[_0x8955b3];return _0x369673;};'use strict';var Sequelize=require(_0x8488('0x0'));module[_0x8488('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8488('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x4'),_0x8488('0x5'),_0x8488('0x6')),'allowNull':![],'defaultValue':_0x8488('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8488('0x7')},'callingpres':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x8'),_0x8488('0x9'),_0x8488('0xa'),_0x8488('0xb'),'PROHIB_NOT_SCREENED',_0x8488('0xc'),_0x8488('0xd'),'PROHIB')},'deny':{'type':Sequelize[_0x8488('0xe')]},'permit':{'type':Sequelize[_0x8488('0xe')]},'secret':{'type':Sequelize[_0x8488('0xe')]},'md5secret':{'type':Sequelize[_0x8488('0xe')]},'remotesecret':{'type':Sequelize[_0x8488('0xe')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x8488('0xf'),'set':function(_0x173ba1){this[_0x8488('0x10')]('transport',_0x173ba1?_0x173ba1[_0x8488('0x11')](','):null);},'get':function(){return this[_0x8488('0x12')](_0x8488('0x13'))?this[_0x8488('0x12')](_0x8488('0x13'))[_0x8488('0x14')](','):null;},'comment':_0x8488('0x15')},'dtmfmode':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x16'),_0x8488('0x17'),'shortinfo','inband',_0x8488('0x18')),'defaultValue':_0x8488('0x16')},'directmedia':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no',_0x8488('0x1a'),'update',_0x8488('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8488('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8488('0xe')]},'directmediadeny':{'type':Sequelize[_0x8488('0xe')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x8488('0x1c'),'set':function(_0x2d05a7){this[_0x8488('0x10')](_0x8488('0x1d'),_0x2d05a7?_0x2d05a7[_0x8488('0x11')](','):null);},'get':function(){return this[_0x8488('0x12')](_0x8488('0x1d'))?this['getDataValue'](_0x8488('0x1d'))[_0x8488('0x14')](','):null;},'comment':_0x8488('0x1e')},'callgroup':{'type':Sequelize[_0x8488('0xe')]},'namedcallgroup':{'type':Sequelize[_0x8488('0xe')]},'pickupgroup':{'type':Sequelize[_0x8488('0xe')]},'namedpickupgroup':{'type':Sequelize[_0x8488('0xe')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8488('0xe')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8488('0xe')],'defaultValue':_0x8488('0x1f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8488('0x20'),'set':function(_0x44deb2){this[_0x8488('0x10')]('allow',_0x44deb2?_0x44deb2['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x8488('0x12')](_0x8488('0x21'))?this[_0x8488('0x12')](_0x8488('0x21'))[_0x8488('0x14')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no')},'insecure':{'type':Sequelize[_0x8488('0xe')],'defaultValue':'port,invite','set':function(_0x8eb5df){this[_0x8488('0x10')](_0x8488('0x22'),_0x8eb5df?_0x8eb5df['join'](','):null);},'get':function(){return this[_0x8488('0x12')](_0x8488('0x22'))?this[_0x8488('0x12')]('insecure')[_0x8488('0x14')](','):null;},'comment':_0x8488('0x23')},'trustrpid':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x8488('0x19'),'no',_0x8488('0x24'))},'promiscredir':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x8488('0x19'),'no')},'accountcode':{'type':Sequelize[_0x8488('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x8488('0x26')},'amaflags':{'type':Sequelize[_0x8488('0xe')]},'callcounter':{'type':Sequelize[_0x8488('0x3')]('yes','no'),'defaultValue':_0x8488('0x19')},'busylevel':{'type':Sequelize[_0x8488('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x8488('0xe')]},'template':{'type':Sequelize[_0x8488('0xe')]},'videosupport':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no',_0x8488('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8488('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no')},'mailbox':{'type':Sequelize[_0x8488('0xe')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x8488('0x28'),_0x8488('0x29'))},'session_expires':{'type':Sequelize[_0x8488('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x8488('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x8488('0x3')]('uac',_0x8488('0x2a')),'defaultValue':_0x8488('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x8488('0xe')]},'regexten':{'type':Sequelize[_0x8488('0xe')]},'fromdomain':{'type':Sequelize[_0x8488('0xe')]},'fromuser':{'type':Sequelize[_0x8488('0xe')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x8488('0x19')},'keepalive':{'type':Sequelize[_0x8488('0x25')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x8488('0xe')]},'rtptimeout':{'type':Sequelize[_0x8488('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x8488('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8488('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no',_0x8488('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8488('0xe')]},'callbackextension':{'type':Sequelize[_0x8488('0xe')]},'timert1':{'type':Sequelize[_0x8488('0x25')](0xb)},'timerb':{'type':Sequelize[_0x8488('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x8488('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x8488('0xe')]},'contactdeny':{'type':Sequelize[_0x8488('0xe')]},'contactacl':{'type':Sequelize[_0x8488('0xe')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x8488('0x25')](0xb)},'encryption':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x8488('0x19'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x8488('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x8488('0xe')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x8488('0xe')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x2c'),_0x8488('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x8488('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x8488('0xe')]},'call_limit':{'type':Sequelize[_0x8488('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x8488('0xe')]},'mohsuggest':{'type':Sequelize[_0x8488('0xe')]},'parkinglot':{'type':Sequelize[_0x8488('0xe')]},'description':{'type':Sequelize[_0x8488('0xe')]},'host':{'type':Sequelize[_0x8488('0xe')],'defaultValue':_0x8488('0x2e')},'canreinvite':{'type':Sequelize[_0x8488('0x3')](_0x8488('0x19'),'no',_0x8488('0x1a'),'update',_0x8488('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8488('0xe')]},'otherFields':{'type':Sequelize[_0x8488('0xe')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x8488('0xe')],'defaultValue':'no'}}; \ No newline at end of file +var _0x9058=['dynamic','update','update,nonat','sequelize','friend','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','pai','fingerprint','active','passive','actpass'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0x9058,0x184));var _0x8905=function(_0x56ea70,_0x1e14f8){_0x56ea70=_0x56ea70-0x0;var _0xd38986=_0x9058[_0x56ea70];return _0xd38986;};'use strict';var Sequelize=require(_0x8905('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x8905('0x1'),_0x8905('0x2'),_0x8905('0x3')),'allowNull':![],'defaultValue':_0x8905('0x1')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8905('0x4')},'callingpres':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x6'),_0x8905('0x7'),_0x8905('0x8'),_0x8905('0x9'),_0x8905('0xa'),_0x8905('0xb'),_0x8905('0xc'),_0x8905('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x8905('0xe')]},'secret':{'type':Sequelize[_0x8905('0xe')]},'md5secret':{'type':Sequelize[_0x8905('0xe')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x8905('0xf'),'set':function(_0x1b56ee){this[_0x8905('0x10')]('transport',_0x1b56ee?_0x1b56ee[_0x8905('0x11')](','):null);},'get':function(){return this[_0x8905('0x12')](_0x8905('0x13'))?this['getDataValue'](_0x8905('0x13'))[_0x8905('0x14')](','):null;},'comment':_0x8905('0x15')},'dtmfmode':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x16'),_0x8905('0x17'),_0x8905('0x18'),_0x8905('0x19'),_0x8905('0x1a')),'defaultValue':_0x8905('0x16')},'directmedia':{'type':Sequelize[_0x8905('0x5')]('yes','no',_0x8905('0x1b'),'update',_0x8905('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8905('0xe')]},'directmediadeny':{'type':Sequelize[_0x8905('0xe')]},'nat':{'type':Sequelize[_0x8905('0xe')],'defaultValue':_0x8905('0x1e'),'set':function(_0x2b91e7){this['setDataValue']('nat',_0x2b91e7?_0x2b91e7[_0x8905('0x11')](','):null);},'get':function(){return this[_0x8905('0x12')]('nat')?this['getDataValue'](_0x8905('0x1f'))[_0x8905('0x14')](','):null;},'comment':_0x8905('0x20')},'callgroup':{'type':Sequelize[_0x8905('0xe')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x8905('0xe')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8905('0xe')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8905('0xe')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x8905('0x21')},'allow':{'type':Sequelize[_0x8905('0xe')],'allowNull':![],'defaultValue':_0x8905('0x22'),'set':function(_0x8dc54e){this[_0x8905('0x10')]('allow',_0x8dc54e?_0x8dc54e[_0x8905('0x11')](';'):_0x8905('0x22'));},'get':function(){return this[_0x8905('0x12')](_0x8905('0x23'))?this[_0x8905('0x12')](_0x8905('0x23'))['split'](';'):null;},'comment':_0x8905('0x24')},'autoframing':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x1d3764){this['setDataValue'](_0x8905('0x25'),_0x1d3764?_0x1d3764['join'](','):null);},'get':function(){return this[_0x8905('0x12')](_0x8905('0x25'))?this[_0x8905('0x12')](_0x8905('0x25'))[_0x8905('0x14')](','):null;},'comment':_0x8905('0x26')},'trustrpid':{'type':Sequelize[_0x8905('0x5')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8905('0x5')]('yes','no',_0x8905('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0x8905('0x1d'),'no')},'useclientcode':{'type':Sequelize[_0x8905('0x5')]('yes','no')},'accountcode':{'type':Sequelize[_0x8905('0x28')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8905('0xe')],'defaultValue':_0x8905('0x29')},'amaflags':{'type':Sequelize[_0x8905('0xe')]},'callcounter':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no'),'defaultValue':_0x8905('0x1d')},'busylevel':{'type':Sequelize[_0x8905('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x8905('0x1d'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x8905('0x1d'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no')},'subscribecontext':{'type':Sequelize[_0x8905('0xe')]},'template':{'type':Sequelize[_0x8905('0xe')]},'videosupport':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no',_0x8905('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8905('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x8905('0xe')]},'session_timers':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x2b'),_0x8905('0x2c'),_0x8905('0x2d'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x8905('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x8905('0x5')]('uac',_0x8905('0x2e')),'defaultValue':_0x8905('0x2e')},'t38pt_usertpsource':{'type':Sequelize[_0x8905('0xe')]},'regexten':{'type':Sequelize[_0x8905('0xe')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x8905('0xe')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x8905('0xe')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x8905('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x8905('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8905('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no',_0x8905('0x2f')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8905('0xe')]},'callbackextension':{'type':Sequelize[_0x8905('0xe')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x8905('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0x8905('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0x8905('0xe')]},'contactdeny':{'type':Sequelize[_0x8905('0xe')]},'contactacl':{'type':Sequelize[_0x8905('0xe')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x8905('0xe')]},'maxforwards':{'type':Sequelize[_0x8905('0x28')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x8905('0x1d'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no')},'icesupport':{'type':Sequelize[_0x8905('0x5')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no')},'dtlsverify':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no',_0x8905('0x30'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x8905('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x8905('0xe')]},'dtlsprivatekey':{'type':Sequelize[_0x8905('0xe')]},'dtlscipher':{'type':Sequelize[_0x8905('0xe')]},'dtlscafile':{'type':Sequelize[_0x8905('0xe')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x31'),_0x8905('0x32'),_0x8905('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8905('0xe')]},'usereqphone':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8905('0xe')]},'recordofffeature':{'type':Sequelize[_0x8905('0xe')]},'call_limit':{'type':Sequelize[_0x8905('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no')},'subscribemwi':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no')},'vmexten':{'type':Sequelize[_0x8905('0xe')]},'mohinterpret':{'type':Sequelize[_0x8905('0xe')]},'mohsuggest':{'type':Sequelize[_0x8905('0xe')]},'parkinglot':{'type':Sequelize[_0x8905('0xe')]},'description':{'type':Sequelize[_0x8905('0xe')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x8905('0x34')},'canreinvite':{'type':Sequelize[_0x8905('0x5')](_0x8905('0x1d'),'no',_0x8905('0x1b'),_0x8905('0x35'),_0x8905('0x36')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8905('0xe')]},'otherFields':{'type':Sequelize[_0x8905('0xe')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x8905('0xe')],'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 aeaa39c..233aff2 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 _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x28c81b,_0x153e31){var _0x22fa3c=function(_0x6f5d34){while(--_0x6f5d34){_0x28c81b['push'](_0x28c81b['shift']());}};_0x22fa3c(++_0x153e31);}(_0xbec5,0xe5));var _0x5bec=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xbec5[_0x382e89];return _0x3a1318;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file +var _0xa41a=['server/files/templates/registry.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','destroy','get','UserProfileResource','end','name','send','map','Trunk','fieldName','type','key','query','intersection','model','attributes','fields','length','order','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','createdAt','updatedAt','body','create','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','Trunks','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload'];(function(_0x47a72d,_0x42f970){var _0x34a01e=function(_0x59f783){while(--_0x59f783){_0x47a72d['push'](_0x47a72d['shift']());}};_0x34a01e(++_0x42f970);}(_0xa41a,0x6b));var _0xaa41=function(_0x1d4034,_0x5ad320){_0x1d4034=_0x1d4034-0x0;var _0x1ab392=_0xa41a[_0x1d4034];return _0x1ab392;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xaa41('0x19'));var client=jayson['client'][_0xaa41('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12d9e6,_0x2f64bc,_0x889d44,_0x6f9ade){return new BPromise(function(_0x4eaf81,_0x1e9d7f){var _0x178170=_0x6f9ade||client;return _0x178170[_0xaa41('0x1b')](_0x12d9e6,_0x889d44)[_0xaa41('0x1c')](function(_0x2a6988){logger[_0xaa41('0x1d')](_0xaa41('0x1e'),_0x2f64bc,'request\x20sent');logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2f64bc,_0xaa41('0x21'),JSON[_0xaa41('0x22')](_0x2a6988));if(_0x2a6988[_0xaa41('0x23')]){if(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x24')]===0x1f4){logger[_0xaa41('0x23')](_0xaa41('0x1e'),_0x2f64bc,_0x2a6988['error']['message']);return _0x1e9d7f(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);}logger[_0xaa41('0x23')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);return _0x4eaf81(_0x2a6988['error']['message']);}else{logger[_0xaa41('0x1d')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0xaa41('0x21'));_0x4eaf81(_0x2a6988[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x1d623c){logger['error'](_0xaa41('0x1e'),_0x2f64bc,_0x1d623c);_0x1e9d7f(_0x1d623c);});});}function respondWithStatusCode(_0x43a85c,_0x448a21){_0x448a21=_0x448a21||0xcc;return function(_0x21f596){if(_0x21f596){return _0x43a85c[_0xaa41('0x28')](_0x448a21);}return _0x43a85c[_0xaa41('0x29')](_0x448a21)['end']();};}function respondWithResult(_0x5795f4,_0x16aec5){_0x16aec5=_0x16aec5||0xc8;return function(_0x527cac){if(_0x527cac){return _0x5795f4['status'](_0x16aec5)[_0xaa41('0x2a')](_0x527cac);}};}function respondWithFilteredResult(_0x59707f,_0x536bed){return function(_0x2d0ac0){if(_0x2d0ac0){var _0x9c8c21=typeof _0x536bed[_0xaa41('0x2b')]===_0xaa41('0x2c')&&typeof _0x536bed[_0xaa41('0x2d')]===_0xaa41('0x2c');var _0x57ef96=_0x2d0ac0[_0xaa41('0x2e')];var _0x1f0275=_0x9c8c21?0x0:_0x536bed[_0xaa41('0x2b')];var _0x9a16e3=_0x9c8c21?_0x2d0ac0[_0xaa41('0x2e')]:_0x536bed[_0xaa41('0x2b')]+_0x536bed[_0xaa41('0x2d')];var _0x104a95;if(_0x9a16e3>=_0x57ef96){_0x9a16e3=_0x57ef96;_0x104a95=0xc8;}else{_0x104a95=0xce;}_0x59707f['status'](_0x104a95);return _0x59707f[_0xaa41('0x2f')]('Content-Range',_0x1f0275+'-'+_0x9a16e3+'/'+_0x57ef96)['json'](_0x2d0ac0);}return null;};}function patchUpdates(_0x714537){return function(_0x1176bd){try{jsonpatch['apply'](_0x1176bd,_0x714537,!![]);}catch(_0x392b5d){return BPromise[_0xaa41('0x30')](_0x392b5d);}return _0x1176bd['save']();};}function saveUpdates(_0x5022fb,_0x5c25fb){return function(_0x1cf3da){if(_0x1cf3da){return _0x1cf3da[_0xaa41('0x31')](_0x5022fb)[_0xaa41('0x1c')](function(_0x38afc4){return _0x38afc4;});}return null;};}function removeEntity(_0x58f203,_0x289c4a){return function(_0x45c8fe){if(_0x45c8fe){return _0x45c8fe[_0xaa41('0x32')]()['then'](function(){var _0x387c55=_0x45c8fe[_0xaa41('0x33')]({'plain':!![]});var _0x321eb7='Trunks';return db[_0xaa41('0x34')][_0xaa41('0x32')]({'where':{'type':_0x321eb7,'resourceId':_0x387c55['id']}})['then'](function(){return _0x45c8fe;});})[_0xaa41('0x1c')](function(){_0x58f203[_0xaa41('0x29')](0xcc)[_0xaa41('0x35')]();});}};}function handleEntityNotFound(_0x5cec87,_0x22b272){return function(_0x48335f){if(!_0x48335f){_0x5cec87[_0xaa41('0x28')](0x194);}return _0x48335f;};}function handleError(_0x199b24,_0xf13742){_0xf13742=_0xf13742||0x1f4;return function(_0x49b77a){logger['error'](_0x49b77a['stack']);if(_0x49b77a[_0xaa41('0x36')]){delete _0x49b77a[_0xaa41('0x36')];}_0x199b24[_0xaa41('0x29')](_0xf13742)[_0xaa41('0x37')](_0x49b77a);};}exports['index']=function(_0x53a2e4,_0x267999){var _0x5673c={},_0x951e52={},_0x4e8d2e={'count':0x0,'rows':[]};var _0xba115a=_[_0xaa41('0x38')](db[_0xaa41('0x39')]['rawAttributes'],function(_0x3adc28){return{'name':_0x3adc28[_0xaa41('0x3a')],'type':_0x3adc28[_0xaa41('0x3b')][_0xaa41('0x3c')]};});_0x951e52['model']=_['map'](_0xba115a,_0xaa41('0x36'));_0x951e52[_0xaa41('0x3d')]=_['keys'](_0x53a2e4[_0xaa41('0x3d')]);_0x951e52['filters']=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],_0x951e52[_0xaa41('0x3d')]);_0x5673c[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x53a2e4[_0xaa41('0x3d')]['fields']));_0x5673c[_0xaa41('0x40')]=_0x5673c[_0xaa41('0x40')][_0xaa41('0x42')]?_0x5673c[_0xaa41('0x40')]:_0x951e52[_0xaa41('0x3f')];if(!_0x53a2e4[_0xaa41('0x3d')]['hasOwnProperty']('nolimit')){_0x5673c[_0xaa41('0x2d')]=qs['limit'](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2d')]);_0x5673c[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2b')]);}_0x5673c[_0xaa41('0x43')]=qs['sort'](_0x53a2e4[_0xaa41('0x3d')]['sort']);_0x5673c['where']=qs[_0xaa41('0x44')](_['pick'](_0x53a2e4['query'],_0x951e52['filters']),_0xba115a);if(_0x53a2e4[_0xaa41('0x3d')]['filter']){_0x5673c[_0xaa41('0x45')]=_[_0xaa41('0x46')](_0x5673c['where'],{'$or':_['map'](_0xba115a,function(_0xe58f5e){if(_0xe58f5e[_0xaa41('0x3b')]!==_0xaa41('0x47')){var _0x2af8ba={};_0x2af8ba[_0xe58f5e[_0xaa41('0x36')]]={'$like':'%'+_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x48')]+'%'};return _0x2af8ba;}})});}_0x5673c=_[_0xaa41('0x46')]({},_0x5673c,_0x53a2e4[_0xaa41('0x49')]);var _0x4e1ac4={'where':_0x5673c[_0xaa41('0x45')]};return db[_0xaa41('0x39')][_0xaa41('0x2e')](_0x4e1ac4)[_0xaa41('0x1c')](function(_0x206d86){_0x4e8d2e[_0xaa41('0x2e')]=_0x206d86;if(_0x53a2e4['query'][_0xaa41('0x4a')]){_0x5673c[_0xaa41('0x4b')]=[{'all':!![]}];}return db[_0xaa41('0x39')][_0xaa41('0x4c')](_0x5673c);})['then'](function(_0x23bc61){_0x4e8d2e['rows']=_0x23bc61;return _0x4e8d2e;})['then'](respondWithFilteredResult(_0x267999,_0x5673c))[_0xaa41('0x27')](handleError(_0x267999,null));};exports[_0xaa41('0x4d')]=function(_0x3e16ef,_0x4ca114){var _0xb4773b={'raw':![],'where':{'id':_0x3e16ef[_0xaa41('0x4e')]['id']}},_0x3e1a73={};_0x3e1a73['model']=_[_0xaa41('0x4f')](db[_0xaa41('0x39')][_0xaa41('0x50')]);_0x3e1a73[_0xaa41('0x3d')]=_[_0xaa41('0x4f')](_0x3e16ef[_0xaa41('0x3d')]);_0x3e1a73[_0xaa41('0x44')]=_[_0xaa41('0x3e')](_0x3e1a73['model'],_0x3e1a73[_0xaa41('0x3d')]);_0xb4773b['attributes']=_['intersection'](_0x3e1a73[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x41')]));_0xb4773b[_0xaa41('0x40')]=_0xb4773b[_0xaa41('0x40')][_0xaa41('0x42')]?_0xb4773b[_0xaa41('0x40')]:_0x3e1a73['model'];if(_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0xb4773b[_0xaa41('0x4b')]=[{'all':!![]}];}_0xb4773b=_['merge']({},_0xb4773b,_0x3e16ef[_0xaa41('0x49')]);return db[_0xaa41('0x39')]['find'](_0xb4773b)[_0xaa41('0x1c')](handleEntityNotFound(_0x4ca114,null))[_0xaa41('0x1c')](respondWithResult(_0x4ca114,null))[_0xaa41('0x27')](handleError(_0x4ca114,null));};exports['clone']=function(_0x2cf32c,_0xc8e626){var _0x4e3b13={'where':{'id':_0x2cf32c[_0xaa41('0x4e')]['id']}},_0x49789a={};_0x49789a[_0xaa41('0x3f')]=_[_0xaa41('0x4f')](db['Trunk'][_0xaa41('0x50')]);_0x4e3b13[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x49789a[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x2cf32c['query'][_0xaa41('0x41')]));_0x4e3b13['attributes']=_0x4e3b13['attributes'][_0xaa41('0x42')]?_0x4e3b13['attributes']:_0x49789a[_0xaa41('0x3f')];if(_0x2cf32c[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0x4e3b13['include']=[{'all':!![]}];}_0x4e3b13=_[_0xaa41('0x46')]({},_0x4e3b13,_0x2cf32c[_0xaa41('0x49')]);return db[_0xaa41('0x39')][_0xaa41('0x51')](_0x4e3b13)[_0xaa41('0x1c')](handleEntityNotFound(_0xc8e626,null))[_0xaa41('0x1c')](function(_0xc56018){if(_0xc56018){var _0x337059=_0xc56018[_0xaa41('0x33')]({'plain':!![]});_0x337059=qs['omit'](_0x337059,['id',_0xaa41('0x52'),_0xaa41('0x53')]);_0x2cf32c[_0xaa41('0x54')]=_['omit'](_0x2cf32c[_0xaa41('0x54')],['id',_0xaa41('0x52'),_0xaa41('0x53')]);return db[_0xaa41('0x39')][_0xaa41('0x55')](_[_0xaa41('0x46')](_0x337059,_0x2cf32c[_0xaa41('0x54')]),{'include':_0x2cf32c['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x540325){var _0x4ec357=_0x2cf32c['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x4ec357)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec357['role']===_0xaa41('0x56')){var _0x40a524=_0x540325[_0xaa41('0x33')]({'plain':!![]});var _0x312eee='Trunks';return db[_0xaa41('0x57')][_0xaa41('0x51')]({'where':{'name':_0x312eee,'userProfileId':_0x4ec357[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0xa71432){if(_0xa71432&&_0xa71432[_0xaa41('0x59')]===0x0){return db[_0xaa41('0x34')][_0xaa41('0x55')]({'name':_0x40a524[_0xaa41('0x36')],'resourceId':_0x40a524['id'],'type':_0xa71432['name'],'sectionId':_0xa71432['id']},{})[_0xaa41('0x1c')](function(){return _0x540325;});}else{return _0x540325;}})[_0xaa41('0x27')](function(_0x50170f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50170f);throw _0x50170f;});}return _0x540325;});}})[_0xaa41('0x1c')](respondWithResult(_0xc8e626,0xc9))['catch'](handleError(_0xc8e626,null));};exports[_0xaa41('0x55')]=function(_0x5c8028,_0x5423b6,_0x18d18b){var _0x4b1ec4;return db[_0xaa41('0x39')][_0xaa41('0x55')](_0x5c8028[_0xaa41('0x54')],{'raw':!![]})[_0xaa41('0x1c')](function(_0x5a2683){_0x4b1ec4=_0x5a2683;return db['Trunk'][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x4d6d0c){var _0x5954ba=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x5a385e=fs[_0xaa41('0x5a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x19ec63=ejs[_0xaa41('0x5f')](_0x5954ba,{'trunks':_0x4d6d0c||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x19ec63);if(_0x4b1ec4[_0xaa41('0x61')]){var _0x19ed68=ejs[_0xaa41('0x5f')](_0x5a385e,{'trunks':_0x4d6d0c||[]});fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x19ed68);}})[_0xaa41('0x1c')](function(){return respondWithRpcPromise('Reload',_0xaa41('0x55'),{'module':_0xaa41('0x64')});})[_0xaa41('0x1c')](function(){var _0x175ca9=_0x5c8028['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x175ca9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x175ca9[_0xaa41('0x65')]===_0xaa41('0x56')){var _0x2b9e68=_0x4b1ec4[_0xaa41('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xaa41('0x51')]({'where':{'name':_0xaa41('0x66'),'userProfileId':_0x175ca9[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0x59052d){if(_0x59052d&&_0x59052d[_0xaa41('0x59')]===0x0){return db['UserProfileResource'][_0xaa41('0x55')]({'name':_0x2b9e68[_0xaa41('0x36')],'resourceId':_0x2b9e68['id'],'type':_0x59052d['name'],'sectionId':_0x59052d['id']},{})[_0xaa41('0x1c')](function(){return _0x4b1ec4;});}else{return _0x4b1ec4;}})[_0xaa41('0x27')](function(_0x2ba160){logger[_0xaa41('0x23')](_0xaa41('0x67'),_0x2ba160);throw _0x2ba160;});}return _0x4b1ec4;})[_0xaa41('0x1c')](respondWithResult(_0x5423b6,0xc9))[_0xaa41('0x27')](handleError(_0x5423b6,null));};exports[_0xaa41('0x31')]=function(_0x33b5f4,_0x3d4f1e,_0x25a064){var _0x59a30b;return db[_0xaa41('0x39')][_0xaa41('0x51')]({'where':{'id':_0x33b5f4[_0xaa41('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d4f1e,null))['then'](saveUpdates(_0x33b5f4[_0xaa41('0x54')],null))[_0xaa41('0x1c')](function(_0x59fd6a){if(_0x59fd6a){_0x59a30b=_0x59fd6a;return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});}})['then'](function(_0x305050){if(_0x305050){var _0x3dd47e=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x1472be=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x44154f=ejs[_0xaa41('0x5f')](_0x3dd47e,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x44154f);var _0x404c38=ejs[_0xaa41('0x5f')](_0x1472be,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x63'),_0x404c38);return respondWithRpcPromise(_0xaa41('0x68'),'update',{'module':_0xaa41('0x64')});}return null;})['then'](function(_0x53faf4){if(_0x53faf4){return _0x59a30b;}})[_0xaa41('0x1c')](respondWithResult(_0x3d4f1e,null))[_0xaa41('0x27')](handleError(_0x3d4f1e,null));};exports['destroy']=function(_0x5a8cb0,_0x241e1a,_0x1726ec){var _0x3c189d;return db[_0xaa41('0x39')]['find']({'where':{'id':_0x5a8cb0[_0xaa41('0x4e')]['id']}})[_0xaa41('0x1c')](handleEntityNotFound(_0x241e1a,null))[_0xaa41('0x1c')](removeEntity(_0x241e1a,null))['then'](function(){return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x5697b6){var _0x183b36=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],_0xaa41('0x5d')),'utf8');var _0x399fbd=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config['root'],_0xaa41('0x69')),_0xaa41('0x5e'));var _0x1a2deb=ejs[_0xaa41('0x5f')](_0x183b36,{'trunks':_0x5697b6});var _0x38f5d0=ejs['render'](_0x399fbd,{'trunks':_0x5697b6});fs[_0xaa41('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1a2deb);fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x38f5d0);return respondWithRpcPromise(_0xaa41('0x68'),_0xaa41('0x32'),{'module':_0xaa41('0x64')});})[_0xaa41('0x27')](handleError(_0x241e1a,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 98db2d9..8f95f96 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 _0x2cc7=['util','api','moment','bluebird','request-promise','path','./trunk.attributes','exports','define','Trunk','tools_trunks'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2cc7,0xdc));var _0x72cc=function(_0x40bb8e,_0x29cc57){_0x40bb8e=_0x40bb8e-0x0;var _0x380c73=_0x2cc7[_0x40bb8e];return _0x380c73;};'use strict';var _=require('lodash');var util=require(_0x72cc('0x0'));var logger=require('../../config/logger')(_0x72cc('0x1'));var moment=require(_0x72cc('0x2'));var BPromise=require(_0x72cc('0x3'));var rp=require(_0x72cc('0x4'));var fs=require('fs');var path=require(_0x72cc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x72cc('0x6'));module[_0x72cc('0x7')]=function(_0x1c63e4,_0x38786){return _0x1c63e4[_0x72cc('0x8')](_0x72cc('0x9'),attributes,{'tableName':_0x72cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa70a=['./trunk.attributes','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x58788d,_0x88b74f){var _0x58ceba=function(_0x16a416){while(--_0x16a416){_0x58788d['push'](_0x58788d['shift']());}};_0x58ceba(++_0x88b74f);}(_0xa70a,0x1ed));var _0xaa70=function(_0x2da92f,_0x14f640){_0x2da92f=_0x2da92f-0x0;var _0x3eb5e3=_0xa70a[_0x2da92f];return _0x3eb5e3;};'use strict';var _=require(_0xaa70('0x0'));var util=require(_0xaa70('0x1'));var logger=require(_0xaa70('0x2'))(_0xaa70('0x3'));var moment=require(_0xaa70('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa70('0x5'));var config=require(_0xaa70('0x6'));var attributes=require(_0xaa70('0x7'));module['exports']=function(_0x37f3b3,_0x4e1bfa){return _0x37f3b3['define'](_0xaa70('0x8'),attributes,{'tableName':_0xaa70('0x9'),'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 f4935d6..0efcae4 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 _0x444a=['../../config/utils','rpc','jayson/promise','http','request','info','debug','request\x20sent','stringify','error','code','message','Trunk,\x20%s,\x20%s','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','model','then','find','ShowTrunk','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x265db0,_0x3302b3){var _0x3eeae2=function(_0x48211a){while(--_0x48211a){_0x265db0['push'](_0x265db0['shift']());}};_0x3eeae2(++_0x3302b3);}(_0x444a,0x170));var _0xa444=function(_0x5869f5,_0x176fd5){_0x5869f5=_0x5869f5-0x0;var _0x6beba1=_0x444a[_0x5869f5];return _0x6beba1;};'use strict';var _=require(_0xa444('0x0'));var util=require('util');var moment=require(_0xa444('0x1'));var BPromise=require(_0xa444('0x2'));var rs=require(_0xa444('0x3'));var fs=require('fs');var Redis=require(_0xa444('0x4'));var db=require(_0xa444('0x5'))['db'];var utils=require(_0xa444('0x6'));var logger=require('../../config/logger')(_0xa444('0x7'));var config=require('../../config/environment');var jayson=require(_0xa444('0x8'));var client=jayson['client'][_0xa444('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1782e4,_0x16c38d,_0x136a95){return new BPromise(function(_0x56b735,_0x22830f){return client[_0xa444('0xa')](_0x1782e4,_0x136a95)['then'](function(_0x1e4332){logger[_0xa444('0xb')]('Trunk,\x20%s,\x20%s',_0x16c38d,'request\x20sent');logger[_0xa444('0xc')]('Trunk,\x20%s,\x20%s,\x20%s',_0x16c38d,_0xa444('0xd'),JSON[_0xa444('0xe')](_0x1e4332));if(_0x1e4332[_0xa444('0xf')]){if(_0x1e4332[_0xa444('0xf')][_0xa444('0x10')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x16c38d,_0x1e4332[_0xa444('0xf')]['message']);return _0x22830f(_0x1e4332['error']['message']);}logger[_0xa444('0xf')]('Trunk,\x20%s,\x20%s',_0x16c38d,_0x1e4332[_0xa444('0xf')][_0xa444('0x11')]);return _0x56b735(_0x1e4332[_0xa444('0xf')][_0xa444('0x11')]);}else{logger[_0xa444('0xb')](_0xa444('0x12'),_0x16c38d,_0xa444('0xd'));_0x56b735(_0x1e4332[_0xa444('0x13')][_0xa444('0x11')]);}})[_0xa444('0x14')](function(_0x21ee23){logger[_0xa444('0xf')](_0xa444('0x12'),_0x16c38d,_0x21ee23);_0x22830f(_0x21ee23);});});}exports[_0xa444('0x15')]=function(_0x512d42){var _0x38d5bc=this;return new Promise(function(_0x341341,_0x3876ce){return db[_0xa444('0x16')][_0xa444('0x17')]({'raw':_0x512d42['options']?_0x512d42[_0xa444('0x18')][_0xa444('0x19')]===undefined?!![]:![]:!![],'where':_0x512d42[_0xa444('0x18')]?_0x512d42['options'][_0xa444('0x1a')]||null:null,'attributes':_0x512d42[_0xa444('0x18')]?_0x512d42[_0xa444('0x18')][_0xa444('0x1b')]||null:null,'limit':_0x512d42['options']?_0x512d42[_0xa444('0x18')]['limit']||null:null,'include':_0x512d42['options']?_0x512d42[_0xa444('0x18')][_0xa444('0x1c')]?_[_0xa444('0x1d')](_0x512d42['options'][_0xa444('0x1c')],function(_0x2a2570){return{'model':db[_0x2a2570[_0xa444('0x1e')]],'as':_0x2a2570['as'],'attributes':_0x2a2570[_0xa444('0x1b')],'include':_0x2a2570[_0xa444('0x1c')]?_['map'](_0x2a2570[_0xa444('0x1c')],function(_0x131fad){return{'model':db[_0x131fad['model']],'as':_0x131fad['as'],'attributes':_0x131fad[_0xa444('0x1b')],'include':_0x131fad[_0xa444('0x1c')]?_['map'](_0x131fad['include'],function(_0x2ccf7a){return{'model':db[_0x2ccf7a['model']],'as':_0x2ccf7a['as'],'attributes':_0x2ccf7a['attributes']};}):[]};}):[]};}):[]:[]})[_0xa444('0x1f')](function(_0x47690a){logger[_0xa444('0xb')](_0xa444('0x15'),_0x512d42);logger['debug'](_0xa444('0x15'),_0x512d42,JSON[_0xa444('0xe')](_0x47690a));_0x341341(_0x47690a);})[_0xa444('0x14')](function(_0x5bbf30){logger[_0xa444('0xf')](_0xa444('0x15'),_0x5bbf30[_0xa444('0x11')],_0x512d42);_0x3876ce(_0x38d5bc['error'](0x1f4,_0x5bbf30[_0xa444('0x11')]));});});};exports['ShowTrunk']=function(_0x2cff6b){var _0x152421=this;return new Promise(function(_0x56f824,_0x263b68){return db[_0xa444('0x16')][_0xa444('0x20')]({'raw':_0x2cff6b[_0xa444('0x18')]?_0x2cff6b[_0xa444('0x18')][_0xa444('0x19')]===undefined?!![]:![]:!![],'where':_0x2cff6b['options']?_0x2cff6b[_0xa444('0x18')][_0xa444('0x1a')]||null:null,'attributes':_0x2cff6b['options']?_0x2cff6b[_0xa444('0x18')][_0xa444('0x1b')]||null:null,'include':_0x2cff6b[_0xa444('0x18')]?_0x2cff6b[_0xa444('0x18')]['include']?_[_0xa444('0x1d')](_0x2cff6b[_0xa444('0x18')][_0xa444('0x1c')],function(_0x354de0){return{'model':db[_0x354de0[_0xa444('0x1e')]],'as':_0x354de0['as'],'attributes':_0x354de0[_0xa444('0x1b')],'include':_0x354de0[_0xa444('0x1c')]?_[_0xa444('0x1d')](_0x354de0[_0xa444('0x1c')],function(_0x4e450d){return{'model':db[_0x4e450d['model']],'as':_0x4e450d['as'],'attributes':_0x4e450d[_0xa444('0x1b')],'include':_0x4e450d[_0xa444('0x1c')]?_[_0xa444('0x1d')](_0x4e450d[_0xa444('0x1c')],function(_0x265a7d){return{'model':db[_0x265a7d[_0xa444('0x1e')]],'as':_0x265a7d['as'],'attributes':_0x265a7d[_0xa444('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa444('0x1f')](function(_0x2ad35f){logger[_0xa444('0xb')](_0xa444('0x21'),_0x2cff6b);logger[_0xa444('0xc')](_0xa444('0x21'),_0x2cff6b,JSON['stringify'](_0x2ad35f));_0x56f824(_0x2ad35f);})[_0xa444('0x14')](function(_0xac5b64){logger[_0xa444('0xf')](_0xa444('0x21'),_0xac5b64['message'],_0x2cff6b);_0x263b68(_0x152421[_0xa444('0xf')](0x1f4,_0xac5b64[_0xa444('0x11')]));});});}; \ No newline at end of file +var _0xaa67=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','debug','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','options','raw','where','attributes','limit','include','map','model','then','GetTrunk','ShowTrunk','Trunk','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa67,0x1be));var _0x7aa6=function(_0x285927,_0x23eadf){_0x285927=_0x285927-0x0;var _0x191931=_0xaa67[_0x285927];return _0x191931;};'use strict';var _=require(_0x7aa6('0x0'));var util=require('util');var moment=require(_0x7aa6('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7aa6('0x2'));var db=require(_0x7aa6('0x3'))['db'];var utils=require(_0x7aa6('0x4'));var logger=require(_0x7aa6('0x5'))(_0x7aa6('0x6'));var config=require(_0x7aa6('0x7'));var jayson=require(_0x7aa6('0x8'));var client=jayson['client'][_0x7aa6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41f8ac,_0x4865ca,_0x29b099){return new BPromise(function(_0x2970ff,_0x44604c){return client['request'](_0x41f8ac,_0x29b099)['then'](function(_0x2754f8){logger[_0x7aa6('0xa')]('Trunk,\x20%s,\x20%s',_0x4865ca,'request\x20sent');logger[_0x7aa6('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x4865ca,_0x7aa6('0xc'),JSON[_0x7aa6('0xd')](_0x2754f8));if(_0x2754f8[_0x7aa6('0xe')]){if(_0x2754f8[_0x7aa6('0xe')][_0x7aa6('0xf')]===0x1f4){logger[_0x7aa6('0xe')](_0x7aa6('0x10'),_0x4865ca,_0x2754f8[_0x7aa6('0xe')][_0x7aa6('0x11')]);return _0x44604c(_0x2754f8[_0x7aa6('0xe')][_0x7aa6('0x11')]);}logger['error'](_0x7aa6('0x10'),_0x4865ca,_0x2754f8['error']['message']);return _0x2970ff(_0x2754f8['error'][_0x7aa6('0x11')]);}else{logger[_0x7aa6('0xa')](_0x7aa6('0x10'),_0x4865ca,'request\x20sent');_0x2970ff(_0x2754f8[_0x7aa6('0x12')][_0x7aa6('0x11')]);}})[_0x7aa6('0x13')](function(_0x2bf607){logger[_0x7aa6('0xe')](_0x7aa6('0x10'),_0x4865ca,_0x2bf607);_0x44604c(_0x2bf607);});});}exports['GetTrunk']=function(_0x4429dd){var _0x526656=this;return new Promise(function(_0xfe5beb,_0xc6c0ca){return db['Trunk']['findAll']({'raw':_0x4429dd[_0x7aa6('0x14')]?_0x4429dd[_0x7aa6('0x14')][_0x7aa6('0x15')]===undefined?!![]:![]:!![],'where':_0x4429dd[_0x7aa6('0x14')]?_0x4429dd[_0x7aa6('0x14')][_0x7aa6('0x16')]||null:null,'attributes':_0x4429dd[_0x7aa6('0x14')]?_0x4429dd[_0x7aa6('0x14')][_0x7aa6('0x17')]||null:null,'limit':_0x4429dd[_0x7aa6('0x14')]?_0x4429dd[_0x7aa6('0x14')][_0x7aa6('0x18')]||null:null,'include':_0x4429dd[_0x7aa6('0x14')]?_0x4429dd[_0x7aa6('0x14')][_0x7aa6('0x19')]?_[_0x7aa6('0x1a')](_0x4429dd[_0x7aa6('0x14')][_0x7aa6('0x19')],function(_0x4d0f16){return{'model':db[_0x4d0f16[_0x7aa6('0x1b')]],'as':_0x4d0f16['as'],'attributes':_0x4d0f16[_0x7aa6('0x17')],'include':_0x4d0f16['include']?_[_0x7aa6('0x1a')](_0x4d0f16[_0x7aa6('0x19')],function(_0xae4708){return{'model':db[_0xae4708['model']],'as':_0xae4708['as'],'attributes':_0xae4708['attributes'],'include':_0xae4708[_0x7aa6('0x19')]?_[_0x7aa6('0x1a')](_0xae4708[_0x7aa6('0x19')],function(_0x2cfac3){return{'model':db[_0x2cfac3[_0x7aa6('0x1b')]],'as':_0x2cfac3['as'],'attributes':_0x2cfac3['attributes']};}):[]};}):[]};}):[]:[]})[_0x7aa6('0x1c')](function(_0x3b2485){logger['info'](_0x7aa6('0x1d'),_0x4429dd);logger[_0x7aa6('0xb')](_0x7aa6('0x1d'),_0x4429dd,JSON['stringify'](_0x3b2485));_0xfe5beb(_0x3b2485);})[_0x7aa6('0x13')](function(_0x5c1fc0){logger[_0x7aa6('0xe')]('GetTrunk',_0x5c1fc0[_0x7aa6('0x11')],_0x4429dd);_0xc6c0ca(_0x526656[_0x7aa6('0xe')](0x1f4,_0x5c1fc0['message']));});});};exports[_0x7aa6('0x1e')]=function(_0x40a204){var _0x40458f=this;return new Promise(function(_0x1e6f13,_0x1e5362){return db[_0x7aa6('0x1f')]['find']({'raw':_0x40a204[_0x7aa6('0x14')]?_0x40a204[_0x7aa6('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x40a204[_0x7aa6('0x14')]?_0x40a204[_0x7aa6('0x14')]['where']||null:null,'attributes':_0x40a204[_0x7aa6('0x14')]?_0x40a204[_0x7aa6('0x14')][_0x7aa6('0x17')]||null:null,'include':_0x40a204['options']?_0x40a204[_0x7aa6('0x14')][_0x7aa6('0x19')]?_[_0x7aa6('0x1a')](_0x40a204[_0x7aa6('0x14')][_0x7aa6('0x19')],function(_0x5eacfe){return{'model':db[_0x5eacfe[_0x7aa6('0x1b')]],'as':_0x5eacfe['as'],'attributes':_0x5eacfe[_0x7aa6('0x17')],'include':_0x5eacfe[_0x7aa6('0x19')]?_[_0x7aa6('0x1a')](_0x5eacfe[_0x7aa6('0x19')],function(_0xa92243){return{'model':db[_0xa92243['model']],'as':_0xa92243['as'],'attributes':_0xa92243[_0x7aa6('0x17')],'include':_0xa92243[_0x7aa6('0x19')]?_['map'](_0xa92243[_0x7aa6('0x19')],function(_0x1f8bdb){return{'model':db[_0x1f8bdb[_0x7aa6('0x1b')]],'as':_0x1f8bdb['as'],'attributes':_0x1f8bdb[_0x7aa6('0x17')]};}):[]};}):[]};}):[]:[]})[_0x7aa6('0x1c')](function(_0x3bc684){logger[_0x7aa6('0xa')](_0x7aa6('0x1e'),_0x40a204);logger['debug']('ShowTrunk',_0x40a204,JSON[_0x7aa6('0xd')](_0x3bc684));_0x1e6f13(_0x3bc684);})[_0x7aa6('0x13')](function(_0xd8bb0e){logger[_0x7aa6('0xe')](_0x7aa6('0x1e'),_0xd8bb0e[_0x7aa6('0x11')],_0x40a204);_0x1e5362(_0x40458f[_0x7aa6('0xe')](0x1f4,_0xd8bb0e[_0x7aa6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 30c61a0..6dd8706 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 _0x750c=['Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','exports'];(function(_0x263164,_0x2d206a){var _0x2668c0=function(_0x47f42d){while(--_0x47f42d){_0x263164['push'](_0x263164['shift']());}};_0x2668c0(++_0x2d206a);}(_0x750c,0x142));var _0xc750=function(_0x4bddd5,_0x5f33f2){_0x4bddd5=_0x4bddd5-0x0;var _0x5658b9=_0x750c[_0x4bddd5];return _0x5658b9;};'use strict';var express=require('express');var router=express[_0xc750('0x0')]();var auth=require(_0xc750('0x1'));var controller=require(_0xc750('0x2'));router[_0xc750('0x3')](_0xc750('0x4'),auth[_0xc750('0x5')](),controller['update']);module[_0xc750('0x6')]=router; \ No newline at end of file +var _0x0873=['/:id','isAuthenticated','exports','express','Router','../../components/auth/service','put'];(function(_0x2d982c,_0x6ed2a6){var _0x486b1d=function(_0x1da212){while(--_0x1da212){_0x2d982c['push'](_0x2d982c['shift']());}};_0x486b1d(++_0x6ed2a6);}(_0x0873,0x1bc));var _0x3087=function(_0x448e70,_0x59d829){_0x448e70=_0x448e70-0x0;var _0x29211d=_0x0873[_0x448e70];return _0x29211d;};'use strict';var express=require(_0x3087('0x0'));var router=express[_0x3087('0x1')]();var auth=require(_0x3087('0x2'));var controller=require('./user-setting.controller');router[_0x3087('0x3')](_0x3087('0x4'),auth[_0x3087('0x5')](),controller['update']);module[_0x3087('0x6')]=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 b2508e3..eca7e31 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 _0x76ef=['ENUM','error','BOOLEAN','TEXT','sequelize','warning','debug'];(function(_0x2b95ca,_0x3d1414){var _0x4ca211=function(_0x3b0a0e){while(--_0x3b0a0e){_0x2b95ca['push'](_0x2b95ca['shift']());}};_0x4ca211(++_0x3d1414);}(_0x76ef,0x177));var _0xf76e=function(_0x385918,_0x49a172){_0x385918=_0x385918-0x0;var _0x54fd1c=_0x76ef[_0x385918];return _0x54fd1c;};'use strict';var Sequelize=require(_0xf76e('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0xf76e('0x1'),'info',_0xf76e('0x2')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xf76e('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf76e('0x4'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf76e('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xf76e('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0x177c=['error','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','warning','info','debug','ENUM'];(function(_0xe7d07d,_0x52e4e3){var _0x229e46=function(_0x376839){while(--_0x376839){_0xe7d07d['push'](_0xe7d07d['shift']());}};_0x229e46(++_0x52e4e3);}(_0x177c,0x1ea));var _0xc177=function(_0x3be019,_0x37f761){_0x3be019=_0x3be019-0x0;var _0x39b9c0=_0x177c[_0x3be019];return _0x39b9c0;};'use strict';var Sequelize=require(_0xc177('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0xc177('0x1'),_0xc177('0x2'),_0xc177('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xc177('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xc177('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xc177('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xc177('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xc177('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xc177('0x9')],'unique':_0xc177('0xa')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 1e884ad..a94bfd5 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 _0x8664=['admin','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','localhost','status','update','then','sendStatus','name','send','role'];(function(_0x578300,_0x1f3103){var _0x1b2682=function(_0x3c3fa){while(--_0x3c3fa){_0x578300['push'](_0x578300['shift']());}};_0x1b2682(++_0x1f3103);}(_0x8664,0x11a));var _0x4866=function(_0x479c46,_0x1810a3){_0x479c46=_0x479c46-0x0;var _0x24c111=_0x8664[_0x479c46];return _0x24c111;};'use strict';var _=require(_0x4866('0x0'));var Redis=require(_0x4866('0x1'));var logger=require(_0x4866('0x2'))(_0x4866('0x3'));var config=require(_0x4866('0x4'));var db=require(_0x4866('0x5'))['db'];var socket=require(_0x4866('0x6'))(new Redis(config[_0x4866('0x7')]));require(_0x4866('0x8'))['register'](socket);config[_0x4866('0x7')]=_['defaults'](config[_0x4866('0x7')],{'host':_0x4866('0x9'),'port':0x18eb});function respondWithResult(_0x439f55,_0x10f7c1){_0x10f7c1=_0x10f7c1||0xc8;return function(_0x2b4bb0){if(_0x2b4bb0){return _0x439f55[_0x4866('0xa')](_0x10f7c1)['json'](_0x2b4bb0);}};}function saveUpdates(_0x4185f2){return function(_0x45aada){if(_0x45aada){return _0x45aada[_0x4866('0xb')](_0x4185f2)[_0x4866('0xc')](function(_0x20fc32){return _0x20fc32;});}return null;};}function handleEntityNotFound(_0x49fad5){return function(_0x35dab1){if(!_0x35dab1){_0x49fad5[_0x4866('0xd')](0x194);}return _0x35dab1;};}function handleError(_0x5f21ba,_0x253b1f){_0x253b1f=_0x253b1f||0x1f4;return function(_0x3d80c7){logger['error'](_0x3d80c7['stack']);if(_0x3d80c7['name']){delete _0x3d80c7[_0x4866('0xe')];}_0x5f21ba[_0x4866('0xa')](_0x253b1f)[_0x4866('0xf')](_0x3d80c7);};}exports[_0x4866('0xb')]=function(_0x3462dd,_0x36aa92){if(_0x3462dd['user'][_0x4866('0x10')]!==_0x4866('0x11'))throw new Error('Unauthorized');if(isNaN(Number(_0x3462dd[_0x4866('0x12')]['id'])))throw new Error(_0x4866('0x13'));return db[_0x4866('0x14')][_0x4866('0x15')]({'where':{'id':_0x3462dd[_0x4866('0x12')]['id']}})[_0x4866('0xc')](handleEntityNotFound(_0x36aa92,null))[_0x4866('0xc')](saveUpdates(_0x3462dd[_0x4866('0x16')],null))[_0x4866('0xc')](respondWithResult(_0x36aa92,null))['catch'](handleError(_0x36aa92,null));}; \ No newline at end of file +var _0x24cd=['localhost','status','json','then','sendStatus','stack','name','send','update','user','role','admin','params','Invalid\x20user\x20setting\x20id','find','catch','lodash','ioredis','api','../../mysqldb','socket.io-emitter','redis','register'];(function(_0x476f2f,_0x30dc16){var _0x213a4d=function(_0x4b1219){while(--_0x4b1219){_0x476f2f['push'](_0x476f2f['shift']());}};_0x213a4d(++_0x30dc16);}(_0x24cd,0x83));var _0xd24c=function(_0x1a2aac,_0x1e0e08){_0x1a2aac=_0x1a2aac-0x0;var _0x10a200=_0x24cd[_0x1a2aac];return _0x10a200;};'use strict';var _=require(_0xd24c('0x0'));var Redis=require(_0xd24c('0x1'));var logger=require('../../config/logger')(_0xd24c('0x2'));var config=require('../../config/environment');var db=require(_0xd24c('0x3'))['db'];var socket=require(_0xd24c('0x4'))(new Redis(config[_0xd24c('0x5')]));require('./user-setting.socket')[_0xd24c('0x6')](socket);config[_0xd24c('0x5')]=_['defaults'](config[_0xd24c('0x5')],{'host':_0xd24c('0x7'),'port':0x18eb});function respondWithResult(_0x2a432a,_0x95eb94){_0x95eb94=_0x95eb94||0xc8;return function(_0x3d4d20){if(_0x3d4d20){return _0x2a432a[_0xd24c('0x8')](_0x95eb94)[_0xd24c('0x9')](_0x3d4d20);}};}function saveUpdates(_0x316755){return function(_0x4bc6a2){if(_0x4bc6a2){return _0x4bc6a2['update'](_0x316755)[_0xd24c('0xa')](function(_0x42033c){return _0x42033c;});}return null;};}function handleEntityNotFound(_0x21b8d9){return function(_0x43ab46){if(!_0x43ab46){_0x21b8d9[_0xd24c('0xb')](0x194);}return _0x43ab46;};}function handleError(_0x1aa701,_0x1060a3){_0x1060a3=_0x1060a3||0x1f4;return function(_0x453907){logger['error'](_0x453907[_0xd24c('0xc')]);if(_0x453907[_0xd24c('0xd')]){delete _0x453907['name'];}_0x1aa701[_0xd24c('0x8')](_0x1060a3)[_0xd24c('0xe')](_0x453907);};}exports[_0xd24c('0xf')]=function(_0x85e141,_0x32d8b0){if(_0x85e141[_0xd24c('0x10')][_0xd24c('0x11')]!==_0xd24c('0x12'))throw new Error('Unauthorized');if(isNaN(Number(_0x85e141[_0xd24c('0x13')]['id'])))throw new Error(_0xd24c('0x14'));return db['UserSetting'][_0xd24c('0x15')]({'where':{'id':_0x85e141[_0xd24c('0x13')]['id']}})[_0xd24c('0xa')](handleEntityNotFound(_0x32d8b0,null))[_0xd24c('0xa')](saveUpdates(_0x85e141['body'],null))['then'](respondWithResult(_0x32d8b0,null))[_0xd24c('0x16')](handleError(_0x32d8b0,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 f5d0521..ef044b6 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 _0xdd98=['save','update','remove','events','../../mysqldb','UserSetting','setMaxListeners'];(function(_0x3ea0ff,_0x675db3){var _0x3e87b5=function(_0x5ef58d){while(--_0x5ef58d){_0x3ea0ff['push'](_0x3ea0ff['shift']());}};_0x3e87b5(++_0x675db3);}(_0xdd98,0xf1));var _0x8dd9=function(_0x17eba5,_0x434f32){_0x17eba5=_0x17eba5-0x0;var _0x1aa6f1=_0xdd98[_0x17eba5];return _0x1aa6f1;};'use strict';var EventEmitter=require(_0x8dd9('0x0'));var UserSetting=require(_0x8dd9('0x1'))['db'][_0x8dd9('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x8dd9('0x3')](0x0);var events={'afterCreate':_0x8dd9('0x4'),'afterUpdate':_0x8dd9('0x5'),'afterDestroy':_0x8dd9('0x6')};function emitEvent(_0x3926c1){return function(_0x19b411,_0x110a14,_0x527868){UserSettingEvents['emit'](_0x3926c1+':'+_0x19b411['id'],_0x19b411);UserSettingEvents['emit'](_0x3926c1,_0x19b411);_0x527868(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0x79f5=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x326612,_0x5da55f){var _0x15b38f=function(_0x6ab899){while(--_0x6ab899){_0x326612['push'](_0x326612['shift']());}};_0x15b38f(++_0x5da55f);}(_0x79f5,0xe5));var _0x579f=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x79f5[_0x4dbaad];return _0x226c72;};'use strict';var EventEmitter=require(_0x579f('0x0'));var UserSetting=require(_0x579f('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x579f('0x2')](0x0);var events={'afterCreate':_0x579f('0x3'),'afterUpdate':_0x579f('0x4'),'afterDestroy':_0x579f('0x5')};function emitEvent(_0x3a7a64){return function(_0x426359,_0x2dbe7a,_0x35cec9){UserSettingEvents[_0x579f('0x6')](_0x3a7a64+':'+_0x426359['id'],_0x426359);UserSettingEvents[_0x579f('0x6')](_0x3a7a64,_0x426359);_0x35cec9(null);};}for(var e in events){if(events[_0x579f('0x7')](e)){var event=events[e];UserSetting[_0x579f('0x8')](e,emitEvent(event));}}module[_0x579f('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 5350580..ec67908 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 _0x7df3=['define','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x7df3,0x1cc));var _0x37df=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7df3[_0x432682];return _0x463d05;};'use strict';var attributes=require(_0x37df('0x0'));module[_0x37df('0x1')]=function(_0x47f92e){return _0x47f92e[_0x37df('0x2')]('UserSetting',attributes,{'tableName':_0x37df('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x547435){if(!_0x547435[_0x37df('0x4')])_0x547435['clientSideLoggingEnabledSince']=null;else if(_0x547435[_0x37df('0x5')]===null)_0x547435[_0x37df('0x5')]=new Date();}}});}; \ No newline at end of file +var _0xbc9d=['./user-setting.attributes','exports','define','UserSetting','clientSideLoggingEnabledSince'];(function(_0x23b903,_0x29e6b4){var _0x17a698=function(_0x1dd008){while(--_0x1dd008){_0x23b903['push'](_0x23b903['shift']());}};_0x17a698(++_0x29e6b4);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x3deb2d,_0x240a2f){_0x3deb2d=_0x3deb2d-0x0;var _0x3ec231=_0xbc9d[_0x3deb2d];return _0x3ec231;};'use strict';var attributes=require(_0xdbc9('0x0'));module[_0xdbc9('0x1')]=function(_0x8aa82b){return _0x8aa82b[_0xdbc9('0x2')](_0xdbc9('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d8228){if(!_0x4d8228['clientSideLoggingEnabled'])_0x4d8228[_0xdbc9('0x4')]=null;else if(_0x4d8228[_0xdbc9('0x4')]===null)_0x4d8228[_0xdbc9('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 38ac2c7..898f566 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 _0x3216=['length','./user-setting.events','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register'];(function(_0x430ee2,_0x2c1368){var _0x2d2dfc=function(_0x193f8a){while(--_0x193f8a){_0x430ee2['push'](_0x430ee2['shift']());}};_0x2d2dfc(++_0x2c1368);}(_0x3216,0xf4));var _0x6321=function(_0x33564c,_0x161c60){_0x33564c=_0x33564c-0x0;var _0xf69d26=_0x3216[_0x33564c];return _0xf69d26;};'use strict';var UserSettingEvents=require(_0x6321('0x0'));var events=['save',_0x6321('0x1'),_0x6321('0x2')];function createListener(_0x1268a2,_0x2c3769){return function(_0x2c4dde){_0x2c3769[_0x6321('0x3')](_0x1268a2,_0x2c4dde);if(_0x1268a2===_0x6321('0x4')){_0x2c3769['emit'](_0x6321('0x5')+_0x2c4dde[_0x6321('0x6')],_0x2c4dde);}};}exports[_0x6321('0x7')]=function(_0x21d813){for(var _0x5c089b=0x0,_0x41e2bd=events[_0x6321('0x8')];_0x5c089b<_0x41e2bd;_0x5c089b++){var _0x23cf03=events[_0x5c089b];var _0x1dfe5c=createListener('user-setting:'+_0x23cf03,_0x21d813);UserSettingEvents['on'](_0x23cf03,_0x1dfe5c);}}; \ No newline at end of file +var _0x82c4=['save','remove','update','user-setting:update','emit','length','user-setting:','./user-setting.events'];(function(_0x4b5372,_0x119bb9){var _0x428b46=function(_0x274f96){while(--_0x274f96){_0x4b5372['push'](_0x4b5372['shift']());}};_0x428b46(++_0x119bb9);}(_0x82c4,0x19f));var _0x482c=function(_0x481f1d,_0x3c80c1){_0x481f1d=_0x481f1d-0x0;var _0x5e283=_0x82c4[_0x481f1d];return _0x5e283;};'use strict';var UserSettingEvents=require(_0x482c('0x0'));var events=[_0x482c('0x1'),_0x482c('0x2'),_0x482c('0x3')];function createListener(_0x565517,_0xca08c8){return function(_0x121363){_0xca08c8['emit'](_0x565517,_0x121363);if(_0x565517===_0x482c('0x4')){_0xca08c8[_0x482c('0x5')]('user-setting:update:user-'+_0x121363['UserId'],_0x121363);}};}exports['register']=function(_0x1920d8){for(var _0x33302c=0x0,_0x3b7a24=events[_0x482c('0x6')];_0x33302c<_0x3b7a24;_0x33302c++){var _0x4ef26f=events[_0x33302c];var _0xe5dc74=createListener(_0x482c('0x7')+_0x4ef26f,_0x1920d8);UserSettingEvents['on'](_0x4ef26f,_0xe5dc74);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index db22d03..57ee6d9 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 _0x9c2b=['root','server/files/images/','format','%s-%s','now','/:id/avatar','single','file','addAvatar','/:id/logout','logout','/:id/unpause','unpause','addTeams','addChatInteractions','addMailInteractions','/:id/fax_interactions','addSmsInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','/:id/mail_accounts','addOpenchannelAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id/password','changePassword','delete','removeQueues','removeTeams','/:id/chat_interactions','/:id/mail_interactions','removeFaxInteractions','/:id/sms_interactions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','/:id','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','getQueues','getVoiceQueuesRt','getGroups','getRecordings','/:id/screen_recordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','addContacts','create','post','/create_many','bulkCreate','addQueues','diskStorage'];(function(_0x85cfa1,_0xcfff0b){var _0x420781=function(_0x576585){while(--_0x576585){_0x85cfa1['push'](_0x85cfa1['shift']());}};_0x420781(++_0xcfff0b);}(_0x9c2b,0x9a));var _0xb9c2=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x9c2b[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0xb9c2('0x0'));var util=require(_0xb9c2('0x1'));var path=require(_0xb9c2('0x2'));var timeout=require('connect-timeout');var express=require(_0xb9c2('0x3'));var router=express[_0xb9c2('0x4')]();var fs_extra=require(_0xb9c2('0x5'));var auth=require(_0xb9c2('0x6'));var interaction=require(_0xb9c2('0x7'));var config=require(_0xb9c2('0x8'));var controller=require(_0xb9c2('0x9'));router[_0xb9c2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0xc')]);router['get'](_0xb9c2('0xd'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0xe')]);router[_0xb9c2('0xa')](_0xb9c2('0xf'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x10')]);router['get'](_0xb9c2('0x11'),auth[_0xb9c2('0xb')](),controller['show']);router[_0xb9c2('0xa')]('/:id/avatar',controller[_0xb9c2('0x12')]);router[_0xb9c2('0xa')](_0xb9c2('0x13'),auth[_0xb9c2('0xb')](),controller['getOpenTabs']);router[_0xb9c2('0xa')](_0xb9c2('0x14'),auth['isAuthenticated'](),controller['getContacts']);router[_0xb9c2('0xa')](_0xb9c2('0x15'),auth['isAuthenticated'](),controller[_0xb9c2('0x16')]);router[_0xb9c2('0xa')]('/:id/queues_rt',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x17')]);router[_0xb9c2('0xa')]('/:id/groups',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x18')]);router[_0xb9c2('0xa')]('/:id/recordings',auth['isAuthenticated'](),controller[_0xb9c2('0x19')]);router['get'](_0xb9c2('0x1a'),auth[_0xb9c2('0xb')](),controller['getScreenRecordings']);router[_0xb9c2('0xa')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0xb9c2('0x1b')]);router[_0xb9c2('0xa')](_0xb9c2('0x1c'),auth[_0xb9c2('0xb')](),controller['getOpenchannelInteractions']);router[_0xb9c2('0xa')](_0xb9c2('0x1d'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x1e')]);router['get'](_0xb9c2('0x1f'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x20')]);router['get'](_0xb9c2('0x21'),auth[_0xb9c2('0xb')](),controller['getFaxInteractions']);router[_0xb9c2('0xa')](_0xb9c2('0x22'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x23')]);router[_0xb9c2('0xa')](_0xb9c2('0x24'),auth[_0xb9c2('0xb')](),controller['getTeams']);router[_0xb9c2('0xa')](_0xb9c2('0x25'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x26')]);router[_0xb9c2('0xa')](_0xb9c2('0x27'),auth['isAuthenticated'](),controller[_0xb9c2('0x28')]);router['get']('/:id/prefixes',auth['isAuthenticated'](),controller[_0xb9c2('0x29')]);router['get']('/:id/fax_accounts',auth[_0xb9c2('0xb')](),controller['getFaxAccounts']);router[_0xb9c2('0xa')]('/:id/mail_accounts',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x2a')]);router['get'](_0xb9c2('0x2b'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x2c')]);router[_0xb9c2('0xa')](_0xb9c2('0x2d'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0xb9c2('0xa')](_0xb9c2('0x2e'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x2f')]);router[_0xb9c2('0xa')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0xb9c2('0x30')]);router[_0xb9c2('0xa')](_0xb9c2('0x31'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x32')]);router['get'](_0xb9c2('0x33'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x34')]);router['get'](_0xb9c2('0x35'),auth['isAuthenticated'](),controller[_0xb9c2('0x36')]);router['post'](_0xb9c2('0x14'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x37')]);router['post']('/',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x38')]);router[_0xb9c2('0x39')](_0xb9c2('0x3a'),auth['isAuthenticated'](),controller[_0xb9c2('0x3b')]);router[_0xb9c2('0x39')]('/:id/queues',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x3c')]);var upload=multer({'storage':multer[_0xb9c2('0x3d')]({'destination':function(_0x46ffd5,_0x5904ac,_0x3ba654){_0x3ba654(null,path['join'](config[_0xb9c2('0x3e')],_0xb9c2('0x3f')));},'filename':function(_0x5269d5,_0x38d8ab,_0x3a4357){_0x3a4357(null,util[_0xb9c2('0x40')](_0xb9c2('0x41'),Date[_0xb9c2('0x42')](),_0x38d8ab['originalname']));}})});router[_0xb9c2('0x39')](_0xb9c2('0x43'),upload[_0xb9c2('0x44')](_0xb9c2('0x45')),controller[_0xb9c2('0x46')]);router[_0xb9c2('0x39')]('/:id/login',auth['isAuthenticated'](),controller['login']);router[_0xb9c2('0x39')](_0xb9c2('0x47'),auth['isAuthenticated'](),controller[_0xb9c2('0x48')]);router[_0xb9c2('0x39')]('/:id/pause',auth[_0xb9c2('0xb')](),controller['pause']);router[_0xb9c2('0x39')](_0xb9c2('0x49'),auth['isAuthenticated'](),controller[_0xb9c2('0x4a')]);router[_0xb9c2('0x39')](_0xb9c2('0x24'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x4b')]);router[_0xb9c2('0x39')]('/:id/chat_interactions',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x4c')]);router['post']('/:id/mail_interactions',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x4d')]);router['post'](_0xb9c2('0x4e'),auth[_0xb9c2('0xb')](),controller['addFaxInteractions']);router[_0xb9c2('0x39')]('/:id/sms_interactions',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x4f')]);router[_0xb9c2('0x39')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0xb9c2('0x39')](_0xb9c2('0x50'),auth[_0xb9c2('0xb')](),controller['addWhatsappInteractions']);router[_0xb9c2('0x39')](_0xb9c2('0x51'),auth[_0xb9c2('0xb')](),controller['addFaxAccounts']);router[_0xb9c2('0x39')](_0xb9c2('0x52'),auth['isAuthenticated'](),controller['addMailAccounts']);router['post']('/:id/openchannel_accounts',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x53')]);router[_0xb9c2('0x39')](_0xb9c2('0x2d'),auth[_0xb9c2('0xb')](),controller['addSmsAccounts']);router[_0xb9c2('0x39')]('/:id/chat_websites',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x54')]);router['post'](_0xb9c2('0x55'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x56')]);router[_0xb9c2('0x39')](_0xb9c2('0x31'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x57')]);router['post'](_0xb9c2('0x35'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x58')]);router[_0xb9c2('0x59')](_0xb9c2('0x11'),auth[_0xb9c2('0xb')](),controller['update']);router[_0xb9c2('0x59')](_0xb9c2('0x5a'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x5b')]);router[_0xb9c2('0x5c')](_0xb9c2('0x15'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x5d')]);router['delete'](_0xb9c2('0x24'),auth['isAuthenticated'](),controller[_0xb9c2('0x5e')]);router[_0xb9c2('0x5c')]('/:id',auth[_0xb9c2('0xb')](),controller['destroy']);router[_0xb9c2('0x5c')](_0xb9c2('0x5f'),auth[_0xb9c2('0xb')](),controller['removeChatInteractions']);router['delete'](_0xb9c2('0x60'),auth[_0xb9c2('0xb')](),controller['removeMailInteractions']);router[_0xb9c2('0x5c')](_0xb9c2('0x4e'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x61')]);router[_0xb9c2('0x5c')](_0xb9c2('0x62'),auth[_0xb9c2('0xb')](),controller['removeSmsInteractions']);router[_0xb9c2('0x5c')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0xb9c2('0x5c')]('/:id/whatsapp_interactions',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x63')]);router[_0xb9c2('0x5c')](_0xb9c2('0x51'),auth[_0xb9c2('0xb')](),controller['removeFaxAccounts']);router[_0xb9c2('0x5c')](_0xb9c2('0x52'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x64')]);router[_0xb9c2('0x5c')](_0xb9c2('0x2b'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x65')]);router['delete']('/:id/sms_accounts',auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x66')]);router[_0xb9c2('0x5c')](_0xb9c2('0x2e'),auth['isAuthenticated'](),controller[_0xb9c2('0x67')]);router[_0xb9c2('0x5c')](_0xb9c2('0x55'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x68')]);router[_0xb9c2('0x5c')](_0xb9c2('0x31'),auth[_0xb9c2('0xb')](),controller[_0xb9c2('0x69')]);router[_0xb9c2('0x5c')](_0xb9c2('0x35'),auth['isAuthenticated'](),controller[_0xb9c2('0x6a')]);module[_0xb9c2('0x6b')]=router; \ No newline at end of file +var _0xb059=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./user.controller','isAuthenticated','index','get','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','root','now','originalname','single','addAvatar','login','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','/:id/square_projects','addSquareProjects','createApiKey','put','update','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','multer','util','path'];(function(_0x476545,_0x5c7a14){var _0x5148ba=function(_0x21b0a4){while(--_0x21b0a4){_0x476545['push'](_0x476545['shift']());}};_0x5148ba(++_0x5c7a14);}(_0xb059,0x14d));var _0x9b05=function(_0x425bdd,_0x187595){_0x425bdd=_0x425bdd-0x0;var _0x5d4548=_0xb059[_0x425bdd];return _0x5d4548;};'use strict';var multer=require(_0x9b05('0x0'));var util=require(_0x9b05('0x1'));var path=require(_0x9b05('0x2'));var timeout=require(_0x9b05('0x3'));var express=require(_0x9b05('0x4'));var router=express[_0x9b05('0x5')]();var fs_extra=require(_0x9b05('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9b05('0x7'));var config=require('../../config/environment');var controller=require(_0x9b05('0x8'));router['get']('/',auth[_0x9b05('0x9')](),controller[_0x9b05('0xa')]);router[_0x9b05('0xb')]('/describe',auth[_0x9b05('0x9')](),controller['describe']);router[_0x9b05('0xb')](_0x9b05('0xc'),auth[_0x9b05('0x9')](),controller[_0x9b05('0xd')]);router[_0x9b05('0xb')](_0x9b05('0xe'),auth['isAuthenticated'](),controller[_0x9b05('0xf')]);router[_0x9b05('0xb')](_0x9b05('0x10'),auth[_0x9b05('0x9')](),controller['show']);router[_0x9b05('0xb')](_0x9b05('0x11'),controller[_0x9b05('0x12')]);router[_0x9b05('0xb')](_0x9b05('0x13'),auth['isAuthenticated'](),controller[_0x9b05('0x14')]);router[_0x9b05('0xb')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x9b05('0x15')]);router['get'](_0x9b05('0x16'),auth['isAuthenticated'](),controller[_0x9b05('0x17')]);router[_0x9b05('0xb')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x9b05('0x18')]);router[_0x9b05('0xb')]('/:id/groups',auth[_0x9b05('0x9')](),controller[_0x9b05('0x19')]);router[_0x9b05('0xb')]('/:id/recordings',auth[_0x9b05('0x9')](),controller[_0x9b05('0x1a')]);router['get'](_0x9b05('0x1b'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x1c')]);router[_0x9b05('0xb')](_0x9b05('0x1d'),auth['isAuthenticated'](),controller[_0x9b05('0x1e')]);router['get']('/:id/openchannel/interactions',auth[_0x9b05('0x9')](),controller[_0x9b05('0x1f')]);router[_0x9b05('0xb')]('/:id/mail/interactions',auth[_0x9b05('0x9')](),controller['getMailInteractions']);router['get'](_0x9b05('0x20'),auth['isAuthenticated'](),controller[_0x9b05('0x21')]);router[_0x9b05('0xb')](_0x9b05('0x22'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x23')]);router[_0x9b05('0xb')](_0x9b05('0x24'),auth['isAuthenticated'](),controller[_0x9b05('0x25')]);router[_0x9b05('0xb')](_0x9b05('0x26'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x27')]);router[_0x9b05('0xb')](_0x9b05('0x28'),auth['isAuthenticated'](),controller['getLists']);router[_0x9b05('0xb')]('/:id/agents',auth['isAuthenticated'](),controller[_0x9b05('0x29')]);router[_0x9b05('0xb')](_0x9b05('0x2a'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x2b')]);router[_0x9b05('0xb')](_0x9b05('0x2c'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x2d')]);router[_0x9b05('0xb')](_0x9b05('0x2e'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x2f')]);router[_0x9b05('0xb')]('/:id/openchannel_accounts',auth[_0x9b05('0x9')](),controller[_0x9b05('0x30')]);router[_0x9b05('0xb')](_0x9b05('0x31'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x32')]);router['get'](_0x9b05('0x33'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x34')]);router[_0x9b05('0xb')](_0x9b05('0x35'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x36')]);router[_0x9b05('0xb')]('/:id/square_projects',auth[_0x9b05('0x9')](),controller[_0x9b05('0x37')]);router['get']('/:id/scheduled_calls',auth[_0x9b05('0x9')](),controller[_0x9b05('0x38')]);router[_0x9b05('0xb')](_0x9b05('0x39'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x3a')]);router[_0x9b05('0x3b')](_0x9b05('0x3c'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x3d')]);router[_0x9b05('0x3b')]('/',auth['isAuthenticated'](),controller[_0x9b05('0x3e')]);router[_0x9b05('0x3b')](_0x9b05('0x3f'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x40')]);router[_0x9b05('0x3b')]('/:id/queues',auth[_0x9b05('0x9')](),controller[_0x9b05('0x41')]);var upload=multer({'storage':multer[_0x9b05('0x42')]({'destination':function(_0x3f9886,_0x1303a0,_0x41afda){_0x41afda(null,path['join'](config[_0x9b05('0x43')],'server/files/images/'));},'filename':function(_0x32d0c7,_0x55ee35,_0x11d9ac){_0x11d9ac(null,util['format']('%s-%s',Date[_0x9b05('0x44')](),_0x55ee35[_0x9b05('0x45')]));}})});router[_0x9b05('0x3b')]('/:id/avatar',upload[_0x9b05('0x46')]('file'),controller[_0x9b05('0x47')]);router['post']('/:id/login',auth['isAuthenticated'](),controller[_0x9b05('0x48')]);router[_0x9b05('0x3b')]('/:id/logout',auth[_0x9b05('0x9')](),controller[_0x9b05('0x49')]);router['post'](_0x9b05('0x4a'),auth['isAuthenticated'](),controller[_0x9b05('0x4b')]);router[_0x9b05('0x3b')](_0x9b05('0x4c'),auth[_0x9b05('0x9')](),controller['unpause']);router[_0x9b05('0x3b')](_0x9b05('0x26'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x4d')]);router[_0x9b05('0x3b')](_0x9b05('0x4e'),auth['isAuthenticated'](),controller[_0x9b05('0x4f')]);router['post'](_0x9b05('0x50'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x51')]);router[_0x9b05('0x3b')]('/:id/fax_interactions',auth[_0x9b05('0x9')](),controller['addFaxInteractions']);router[_0x9b05('0x3b')](_0x9b05('0x52'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x53')]);router['post'](_0x9b05('0x54'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x55')]);router[_0x9b05('0x3b')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['addWhatsappInteractions']);router['post']('/:id/fax_accounts',auth[_0x9b05('0x9')](),controller[_0x9b05('0x56')]);router[_0x9b05('0x3b')](_0x9b05('0x2e'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x57')]);router[_0x9b05('0x3b')](_0x9b05('0x58'),auth['isAuthenticated'](),controller[_0x9b05('0x59')]);router[_0x9b05('0x3b')](_0x9b05('0x31'),auth[_0x9b05('0x9')](),controller['addSmsAccounts']);router['post']('/:id/chat_websites',auth[_0x9b05('0x9')](),controller[_0x9b05('0x5a')]);router[_0x9b05('0x3b')](_0x9b05('0x35'),auth['isAuthenticated'](),controller[_0x9b05('0x5b')]);router[_0x9b05('0x3b')](_0x9b05('0x5c'),auth['isAuthenticated'](),controller[_0x9b05('0x5d')]);router[_0x9b05('0x3b')](_0x9b05('0x39'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x5e')]);router[_0x9b05('0x5f')]('/:id',auth[_0x9b05('0x9')](),controller[_0x9b05('0x60')]);router[_0x9b05('0x5f')]('/:id/password',auth[_0x9b05('0x9')](),controller[_0x9b05('0x61')]);router[_0x9b05('0x62')]('/:id/queues',auth[_0x9b05('0x9')](),controller['removeQueues']);router['delete']('/:id/teams',auth[_0x9b05('0x9')](),controller[_0x9b05('0x63')]);router[_0x9b05('0x62')](_0x9b05('0x10'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x64')]);router[_0x9b05('0x62')]('/:id/chat_interactions',auth[_0x9b05('0x9')](),controller[_0x9b05('0x65')]);router[_0x9b05('0x62')](_0x9b05('0x50'),auth[_0x9b05('0x9')](),controller['removeMailInteractions']);router[_0x9b05('0x62')]('/:id/fax_interactions',auth[_0x9b05('0x9')](),controller['removeFaxInteractions']);router[_0x9b05('0x62')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x9b05('0x66')]);router[_0x9b05('0x62')](_0x9b05('0x54'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x67')]);router['delete'](_0x9b05('0x68'),auth['isAuthenticated'](),controller[_0x9b05('0x69')]);router[_0x9b05('0x62')](_0x9b05('0x2c'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x6a')]);router[_0x9b05('0x62')](_0x9b05('0x2e'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x6b')]);router[_0x9b05('0x62')](_0x9b05('0x58'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x6c')]);router['delete'](_0x9b05('0x31'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x6d')]);router['delete'](_0x9b05('0x33'),auth[_0x9b05('0x9')](),controller[_0x9b05('0x6e')]);router[_0x9b05('0x62')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x9b05('0x6f')]);router['delete'](_0x9b05('0x5c'),auth[_0x9b05('0x9')](),controller['removeSquareProjects']);router['delete'](_0x9b05('0x39'),auth[_0x9b05('0x9')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 668e93c..27dadb4 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0}}; \ No newline at end of file +var _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x59ff54,_0x5bd69b){var _0x51e8b7=function(_0x36f475){while(--_0x36f475){_0x59ff54['push'](_0x59ff54['shift']());}};_0x51e8b7(++_0x5bd69b);}(_0x70e0,0x17b));var _0x070e=function(_0x1c1258,_0x46680d){_0x1c1258=_0x1c1258-0x0;var _0x315236=_0x70e0[_0x1c1258];return _0x315236;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'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 5c5fcd5..876d20e 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 _0xb652=['getChannels','bulkCreate','DEFAULT\x20PAUSE','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','getTeams','addTeams','resolve','User\x20with\x20id\x20%s\x20not\x20found','transaction','getAssociatedQueues','flattenDeep','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','Queue:save','removeTeams','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','sequelize','removeAgent','VoicePrefixId','CmList','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$notLike','$iLike','$notILike','$any','firstName','lastName','Contact','dialActive','getApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','queues','teams','flatten','lower','col','toString','asc','substring','uniqBy','orderBy','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','busy','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','OpenTabs','util','path','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','socket.io-emitter','redis','register','localhost','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','update','then','emit','userNotification:recalc:','role','admin','Users','user','agent','telephone','filter','map','value','includes','name','UserProfileResource','destroy','status','stack','send','User','rawAttributes','fieldName','type','key','password','salt','getOptions','where','query','includeAll','include','userSetting','true','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','openchannel','whatsapp','all','show','params','model','differenceBy','keys','intersection','fields','merge','options','fax','mail','body','describe','find','addContacts','ids','omit','internal','Setting','findById','min_internal','isNil','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','mailbox','VoiceMail','fullname','permissions','101','102','113','110','105','106','107','108','100','111','114','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','Agents','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','changePassword','oldPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queues','spread','QueueId','VoiceQueue','get','voice','removeQueues','channel','remove','Queue:remove','userpic','getAvatar','join','server/files/images/logos/default_profile.png','download','root','getOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','CmContact','filters','order','sort','getContacts','hasOwnProperty','List','Tag','tag','nolimit','getQueues','pick','Unknown\x20role','Queue','getVoiceQueuesRt','UserVoiceQueueRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','SmsInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','login','phone','mobile','format','intrf','SIP/%s','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','LOGININPAUSE','MemberReport','concat','logout','pause','QueuePause','PAUSE'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0xb652,0x8a));var _0x2b65=function(_0x251492,_0x29661c){_0x251492=_0x251492-0x0;var _0x2eb432=_0xb652[_0x251492];return _0x2eb432;};'use strict';var moment=require('moment');var util=require(_0x2b65('0x0'));var path=require(_0x2b65('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2b65('0x2'));var jayson=require(_0x2b65('0x3'));var Redis=require('ioredis');var authService=require(_0x2b65('0x4'));var qs=require(_0x2b65('0x5'));var logger=require(_0x2b65('0x6'))(_0x2b65('0x7'));var utils=require(_0x2b65('0x8'));var config=require(_0x2b65('0x9'));var licenseUtil=require(_0x2b65('0xa'));var APIBadRequestError=require(_0x2b65('0xb'))[_0x2b65('0xc')];var APINotFoundError=require(_0x2b65('0xb'))[_0x2b65('0xd')];var APIHandleError=require(_0x2b65('0xb'))[_0x2b65('0xe')];var db=require('../../mysqldb')['db'];var socket=require(_0x2b65('0xf'))(new Redis(config[_0x2b65('0x10')]));require('./user.socket')[_0x2b65('0x11')](socket);config[_0x2b65('0x10')]=_['defaults'](config[_0x2b65('0x10')],{'host':_0x2b65('0x12'),'port':0x18eb});var amiClient=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x631f63,_0x415de5,_0x242fc5,_0x23e483){return new Promise(function(_0x182c9a,_0x352222){var _0x7f66fd=_0x23e483||amiClient;return _0x7f66fd[_0x2b65('0x13')](_0x631f63,_0x242fc5)['then'](function(_0x435043){logger[_0x2b65('0x14')](_0x2b65('0x15'),_0x415de5,_0x2b65('0x16'));logger[_0x2b65('0x17')](_0x2b65('0x18'),_0x415de5,_0x2b65('0x16'),JSON[_0x2b65('0x19')](_0x435043));if(_0x435043['error']){if(_0x435043[_0x2b65('0x1a')][_0x2b65('0x1b')]===0x1f4){logger[_0x2b65('0x1a')](_0x2b65('0x15'),_0x415de5,_0x435043[_0x2b65('0x1a')][_0x2b65('0x1c')]);return _0x352222(_0x435043[_0x2b65('0x1a')][_0x2b65('0x1c')]);}logger[_0x2b65('0x1a')](_0x2b65('0x15'),_0x415de5,_0x435043[_0x2b65('0x1a')]['message']);return _0x182c9a(_0x435043[_0x2b65('0x1a')][_0x2b65('0x1c')]);}else{logger[_0x2b65('0x14')](_0x2b65('0x15'),_0x415de5,_0x2b65('0x16'));_0x182c9a(_0x435043[_0x2b65('0x1d')][_0x2b65('0x1c')]);}})[_0x2b65('0x1e')](function(_0x630427){logger['error'](_0x2b65('0x15'),_0x415de5,_0x630427);_0x352222(_0x630427);});});}function respondWithStatusCode(_0x5a2eec,_0x588bd5){_0x588bd5=_0x588bd5||0xcc;return function(_0x344dcd){if(_0x344dcd){return _0x5a2eec[_0x2b65('0x1f')](_0x588bd5);}return _0x5a2eec['status'](_0x588bd5)[_0x2b65('0x20')]();};}function respondWithResult(_0x52ab92,_0x30ea4f){_0x30ea4f=_0x30ea4f||0xc8;return function(_0x598acb){if(_0x598acb){return _0x52ab92['status'](_0x30ea4f)[_0x2b65('0x21')](_0x598acb);}};}function respondWithFilteredResult(_0xe66994,_0x13e9f1){return function(_0xa3555a){if(_0xa3555a){var _0x1a87ee=typeof _0x13e9f1[_0x2b65('0x22')]===_0x2b65('0x23')&&typeof _0x13e9f1[_0x2b65('0x24')]===_0x2b65('0x23');var _0x33deda=_0xa3555a[_0x2b65('0x25')];var _0x9610cb=_0x1a87ee?0x0:_0x13e9f1[_0x2b65('0x22')];var _0x605cc4=_0x1a87ee?_0xa3555a[_0x2b65('0x25')]:_0x13e9f1[_0x2b65('0x22')]+_0x13e9f1[_0x2b65('0x24')];var _0x1b8df3;if(_0x605cc4>=_0x33deda){_0x605cc4=_0x33deda;_0x1b8df3=0xc8;}else{_0x1b8df3=0xce;}_0xe66994['status'](_0x1b8df3);return _0xe66994[_0x2b65('0x26')](_0x2b65('0x27'),_0x9610cb+'-'+_0x605cc4+'/'+_0x33deda)['json'](_0xa3555a);}return null;};}function saveUpdates(_0x5fdb9e){return function(_0x5c3e5e){if(_0x5c3e5e){return _0x5c3e5e[_0x2b65('0x28')](_0x5fdb9e)[_0x2b65('0x29')](function(_0x1346ad){socket[_0x2b65('0x2a')](_0x2b65('0x2b')+_0x1346ad['id'],{});return _0x1346ad;});}return null;};}function removeEntity(_0xb0be3b){return function(_0xdf06db){if(_0xdf06db){return _0xdf06db['destroy']()[_0x2b65('0x29')](function(){var _0x3ef654=_0xdf06db['get']({'plain':!![]});if(_0x3ef654[_0x2b65('0x2c')]===_0x2b65('0x2d'))return;var _0x370804=[{'name':_0x2b65('0x2e'),'value':_0x2b65('0x2f'),'ignore':!![]},{'name':'Agents','value':_0x2b65('0x30'),'ignore':![]},{'name':'Telephones','value':_0x2b65('0x31'),'ignore':![]}];var _0x44ceea=_(_0x370804)[_0x2b65('0x32')]('ignore')[_0x2b65('0x33')](_0x2b65('0x34'))[_0x2b65('0x34')]();if(_[_0x2b65('0x35')](_0x44ceea,_0x3ef654[_0x2b65('0x2c')])){return;}var _0x3de1b4=_['find'](_0x370804,[_0x2b65('0x34'),_0x3ef654['role']])[_0x2b65('0x36')];return db[_0x2b65('0x37')][_0x2b65('0x38')]({'where':{'type':_0x3de1b4,'resourceId':_0x3ef654['id']}})[_0x2b65('0x29')](function(){return _0xdf06db;});})[_0x2b65('0x29')](function(){_0xb0be3b[_0x2b65('0x39')](0xcc)[_0x2b65('0x20')]();});}};}function handleEntityNotFound(_0x283f37){return function(_0x1f2a48){if(!_0x1f2a48){_0x283f37['sendStatus'](0x194);}return _0x1f2a48;};}function handleError(_0x2045a7,_0x57df05){_0x57df05=_0x57df05||0x1f4;return function(_0x55091d){logger[_0x2b65('0x1a')](_0x55091d[_0x2b65('0x3a')]);if(_0x55091d['name']){delete _0x55091d[_0x2b65('0x36')];}_0x2045a7[_0x2b65('0x39')](_0x57df05)[_0x2b65('0x3b')](_0x55091d);};}exports['index']=function(_0x191867,_0x3e9469){var _0x11980d={},_0x587966={'count':0x0,'rows':[]};var _0x5c2b0c=_(db[_0x2b65('0x3c')][_0x2b65('0x3d')])[_0x2b65('0x33')](function(_0x10dc48){return{'name':_0x10dc48[_0x2b65('0x3e')],'type':_0x10dc48[_0x2b65('0x3f')][_0x2b65('0x40')]};})[_0x2b65('0x32')](function(_0x4d119f){return!_[_0x2b65('0x35')]([_0x2b65('0x41'),_0x2b65('0x42')],_0x4d119f[_0x2b65('0x36')]);})[_0x2b65('0x34')]();_0x11980d=qs[_0x2b65('0x43')](_0x5c2b0c,_0x191867);var _0x3e7e32={'where':_0x11980d[_0x2b65('0x44')]};return db[_0x2b65('0x3c')][_0x2b65('0x25')](_0x3e7e32)['then'](function(_0x3c4ae1){_0x587966[_0x2b65('0x25')]=_0x3c4ae1;if(_0x191867[_0x2b65('0x45')][_0x2b65('0x46')]){_0x11980d[_0x2b65('0x47')]=[{'all':!![]}];}if(_0x191867[_0x2b65('0x45')][_0x2b65('0x48')]===_0x2b65('0x49')){_0x11980d[_0x2b65('0x47')]=[{'model':db[_0x2b65('0x4a')],'as':_0x2b65('0x48')}];}if(!_[_0x2b65('0x35')](_0x11980d[_0x2b65('0x4b')],'id')){_0x11980d[_0x2b65('0x4b')][_0x2b65('0x4c')]('id');}return db[_0x2b65('0x3c')][_0x2b65('0x4d')](_0x11980d);})[_0x2b65('0x29')](function(_0x4c1cd7){_0x587966[_0x2b65('0x4e')]=_0x4c1cd7;if(_0x191867[_0x2b65('0x45')][_0x2b65('0x4f')]==='true'){var _0x473480=[];for(var _0x5883e7=0x0;_0x5883e7<_0x587966[_0x2b65('0x4e')][_0x2b65('0x50')];_0x5883e7++){_0x473480[_0x2b65('0x4c')](get_open_tabs(_0x2b65('0x51'),_0x587966['rows'][_0x5883e7][_0x2b65('0x52')]));_0x473480[_0x2b65('0x4c')](get_open_tabs(_0x2b65('0x53'),_0x587966[_0x2b65('0x4e')][_0x5883e7][_0x2b65('0x52')]));_0x473480['push'](get_open_tabs('fax',_0x587966[_0x2b65('0x4e')][_0x5883e7][_0x2b65('0x52')]));_0x473480[_0x2b65('0x4c')](get_open_tabs('mail',_0x587966[_0x2b65('0x4e')][_0x5883e7]['dataValues']));_0x473480[_0x2b65('0x4c')](get_open_tabs(_0x2b65('0x54'),_0x587966[_0x2b65('0x4e')][_0x5883e7][_0x2b65('0x52')]));_0x473480['push'](get_open_tabs(_0x2b65('0x55'),_0x587966[_0x2b65('0x4e')][_0x5883e7]['dataValues']));}return Promise[_0x2b65('0x56')](_0x473480)[_0x2b65('0x29')](function(){return _0x587966;});}else{return _0x587966;}})['then'](respondWithFilteredResult(_0x3e9469,_0x11980d))[_0x2b65('0x1e')](handleError(_0x3e9469,null));};exports[_0x2b65('0x57')]=function(_0x55992d,_0x27eb6b){var _0x546790={'raw':![],'where':{'id':_0x55992d[_0x2b65('0x58')]['id']}},_0x78bd2a={};_0x78bd2a[_0x2b65('0x59')]=_[_0x2b65('0x5a')](_[_0x2b65('0x5b')](db[_0x2b65('0x3c')][_0x2b65('0x3d')]),[_0x2b65('0x41'),_0x2b65('0x42')]);_0x78bd2a[_0x2b65('0x45')]=_[_0x2b65('0x5b')](_0x55992d[_0x2b65('0x45')]);_0x78bd2a['filters']=_[_0x2b65('0x5c')](_0x78bd2a[_0x2b65('0x59')],_0x78bd2a[_0x2b65('0x45')]);_0x546790[_0x2b65('0x4b')]=_[_0x2b65('0x5c')](_0x78bd2a['model'],qs['fields'](_0x55992d['query'][_0x2b65('0x5d')]));_0x546790[_0x2b65('0x4b')]=_0x546790[_0x2b65('0x4b')][_0x2b65('0x50')]?_0x546790['attributes']:_0x78bd2a['model'];if(_0x55992d['query'][_0x2b65('0x46')]){_0x546790['include']=[{'all':!![]}];}if(_0x55992d['query']['userSetting']===_0x2b65('0x49')){_0x546790[_0x2b65('0x47')]=[{'model':db[_0x2b65('0x4a')],'as':_0x2b65('0x48')}];}_0x546790=_[_0x2b65('0x5e')]({},_0x546790,_0x55992d[_0x2b65('0x5f')]);if(!_['includes'](_0x546790[_0x2b65('0x4b')],'id')){_0x546790[_0x2b65('0x4b')][_0x2b65('0x4c')]('id');}return db[_0x2b65('0x3c')]['find'](_0x546790)[_0x2b65('0x29')](handleEntityNotFound(_0x27eb6b,null))[_0x2b65('0x29')](function(_0x9f0878){var _0x1f62dc=[];values=_0x9f0878;if(_0x55992d[_0x2b65('0x45')][_0x2b65('0x4f')]==='true'){_0x1f62dc[_0x2b65('0x4c')](get_open_tabs(_0x2b65('0x51'),_0x9f0878[_0x2b65('0x52')]));_0x1f62dc[_0x2b65('0x4c')](get_open_tabs(_0x2b65('0x53'),_0x9f0878['dataValues']));_0x1f62dc['push'](get_open_tabs(_0x2b65('0x54'),_0x9f0878['dataValues']));_0x1f62dc['push'](get_open_tabs(_0x2b65('0x55'),_0x9f0878[_0x2b65('0x52')]));_0x1f62dc[_0x2b65('0x4c')](get_open_tabs(_0x2b65('0x60'),_0x9f0878[_0x2b65('0x52')]));_0x1f62dc[_0x2b65('0x4c')](get_open_tabs(_0x2b65('0x61'),_0x9f0878[_0x2b65('0x52')]));return Promise[_0x2b65('0x56')](_0x1f62dc);}else{return values;}})[_0x2b65('0x29')](function(){return values;})[_0x2b65('0x29')](respondWithResult(_0x27eb6b,null))[_0x2b65('0x1e')](handleError(_0x27eb6b,null));};exports['update']=function(_0x591ca0,_0x1e579d){if(_0x591ca0[_0x2b65('0x62')]['id']){delete _0x591ca0[_0x2b65('0x62')]['id'];}delete _0x591ca0['body'][_0x2b65('0x2c')];return db[_0x2b65('0x3c')]['find']({'where':{'id':_0x591ca0['params']['id']}})['then'](handleEntityNotFound(_0x1e579d,null))['then'](saveUpdates(_0x591ca0[_0x2b65('0x62')],null))[_0x2b65('0x29')](respondWithResult(_0x1e579d,null))[_0x2b65('0x1e')](handleError(_0x1e579d,null));};exports[_0x2b65('0x63')]=function(_0x50e96d,_0x20a911){return db[_0x2b65('0x3c')][_0x2b65('0x63')]()[_0x2b65('0x29')](respondWithResult(_0x20a911,null))[_0x2b65('0x1e')](handleError(_0x20a911,null));};exports['addContacts']=function(_0x404868,_0x37c6d6){return db[_0x2b65('0x3c')][_0x2b65('0x64')]({'where':{'id':_0x404868['params']['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x37c6d6,null))[_0x2b65('0x29')](function(_0x2d8d6b){if(_0x2d8d6b){return _0x2d8d6b[_0x2b65('0x65')](_0x404868[_0x2b65('0x62')][_0x2b65('0x66')],_[_0x2b65('0x67')](_0x404868[_0x2b65('0x62')],['ids','id'])||{});}})[_0x2b65('0x29')](respondWithResult(_0x37c6d6,null))[_0x2b65('0x1e')](handleError(_0x37c6d6,null));};function validateUser(_0x5217ac){return new Promise(function(_0xfb339f,_0x508c7d){if(_0x5217ac[_0x2b65('0x68')])return _0xfb339f(_0x5217ac);return db[_0x2b65('0x69')][_0x2b65('0x6a')](0x1)[_0x2b65('0x29')](function(_0x4ff3aa){if(_0x4ff3aa['securePassword'])authService['validatePasswordPattern'](_0x5217ac[_0x2b65('0x41')]);db[_0x2b65('0x3c')]['max']('internal')[_0x2b65('0x29')](function(_0x51a794){if(_['isNil'](_0x51a794)){_0x5217ac[_0x2b65('0x68')]=_0x4ff3aa[_0x2b65('0x6b')]||0x1;return;}if(_[_0x2b65('0x6c')](_0x4ff3aa[_0x2b65('0x6b')])||_0x4ff3aa[_0x2b65('0x6b')]===_0x51a794){_0x5217ac[_0x2b65('0x68')]=_0x51a794+0x1;return;}if(_0x4ff3aa[_0x2b65('0x6b')]>_0x51a794){_0x5217ac[_0x2b65('0x68')]=_0x4ff3aa[_0x2b65('0x6b')];return;}return db['sequelize'][_0x2b65('0x45')](_0x2b65('0x6d'),{'type':db['sequelize'][_0x2b65('0x6e')][_0x2b65('0x6f')]})['then'](function(_0x2c5659){if(_0x2c5659&&_0x2c5659[_0x2b65('0x50')]){for(var _0x490c73=0x0,_0x35e231=_0x2c5659[_0x2b65('0x50')];_0x490c73<_0x35e231&&_['isNil'](_0x5217ac[_0x2b65('0x68')]);_0x490c73++){if(_0x4ff3aa['min_internal']<=_0x2c5659[_0x490c73][_0x2b65('0x70')]){_0x5217ac[_0x2b65('0x68')]=_0x2c5659[_0x490c73][_0x2b65('0x70')];}else if(_0x4ff3aa[_0x2b65('0x6b')]>_0x2c5659[_0x490c73][_0x2b65('0x70')]&&_0x4ff3aa[_0x2b65('0x6b')]<=_0x2c5659[_0x490c73]['to']){_0x5217ac[_0x2b65('0x68')]=_0x4ff3aa[_0x2b65('0x6b')];}}}if(_[_0x2b65('0x6c')](_0x5217ac['internal'])){_0x5217ac[_0x2b65('0x68')]=_0x51a794+0x1;}return _0xfb339f(_0x5217ac);});});})[_0x2b65('0x1e')](function(_0x30e8b3){_0x508c7d(_0x30e8b3);});});}function updateUser(_0x38ff5e){return new Promise(function(_0x152be1,_0xefd334){try{if(_0x38ff5e[_0x2b65('0x71')]){_0x38ff5e[_0x2b65('0x72')]=_0x38ff5e['internal'];_0x38ff5e[_0x2b65('0x73')]={'mailbox':_0x38ff5e[_0x2b65('0x68')],'password':_0x38ff5e[_0x2b65('0x41')],'fullname':_0x38ff5e[_0x2b65('0x74')],'email':_0x38ff5e['email']};}if(_0x38ff5e[_0x2b65('0x2c')]===_0x2b65('0x30')){if(!_0x38ff5e['permissions'])_0x38ff5e[_0x2b65('0x75')]=[_0x2b65('0x76'),_0x2b65('0x77'),'103',_0x2b65('0x78'),_0x2b65('0x79'),'104',_0x2b65('0x7a'),_0x2b65('0x7b'),_0x2b65('0x7c'),_0x2b65('0x7d'),'109',_0x2b65('0x7e'),_0x2b65('0x7f'),_0x2b65('0x80'),_0x2b65('0x81')];}_0x152be1(_0x38ff5e);}catch(_0x50c2cf){_0xefd334(_0x50c2cf);}});}exports['create']=function(_0x1693e0,_0x2be589){if(_0x1693e0[_0x2b65('0x2f')]['role']===_0x2b65('0x30'))throw new Error(_0x2b65('0x82'));if(_0x1693e0[_0x2b65('0x62')][_0x2b65('0x2c')]===_0x2b65('0x2f')&&_0x1693e0[_0x2b65('0x2f')]['role']!==_0x2b65('0x2d')){throw new Error(_0x2b65('0x83'));}if(_0x1693e0[_0x2b65('0x62')][_0x2b65('0x2c')]==='admin'&&_0x1693e0['user']['role']!==_0x2b65('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x2b65('0x84')]([_0x1693e0[_0x2b65('0x62')]])[_0x2b65('0x29')](function(){return validateUser(_0x1693e0[_0x2b65('0x62')]);})[_0x2b65('0x29')](function(_0x1b4446){return updateUser(_0x1b4446)[_0x2b65('0x29')](function(_0x32b411){if(_0x32b411[_0x2b65('0x2c')]===_0x2b65('0x2d')){_0x32b411[_0x2b65('0x85')]=_0x1693e0['user'][_0x2b65('0x85')];delete _0x32b411[_0x2b65('0x86')];}return _0x32b411;});})[_0x2b65('0x29')](function(_0x22876a){return db['User'][_0x2b65('0x87')](_0x22876a,{'include':[{'model':db[_0x2b65('0x73')],'as':'VoiceMail'}]});})['then'](function(_0x1906ea){if(_0x1693e0['body']['role']===_0x2b65('0x2f'))return _0x1906ea;if(_0x1693e0[_0x2b65('0x2f')][_0x2b65('0x2c')]!=='user')return _0x1906ea;return db[_0x2b65('0x88')]['find']({'where':{'name':_0x1906ea['role']==='agent'?_0x2b65('0x89'):_0x2b65('0x8a'),'userProfileId':_0x1693e0[_0x2b65('0x2f')]['userProfileId']},'raw':!![]})[_0x2b65('0x29')](function(_0x17d283){if(!_0x17d283||_0x17d283[_0x2b65('0x8b')]!=0x0)return _0x1906ea;return db[_0x2b65('0x37')]['create']({'name':_0x1906ea[_0x2b65('0x36')],'resourceId':_0x1906ea['id'],'type':_0x17d283[_0x2b65('0x36')],'sectionId':_0x17d283['id']},{})[_0x2b65('0x29')](function(){return _0x1906ea;});})[_0x2b65('0x1e')](function(_0x19dd75){logger[_0x2b65('0x1a')](_0x2b65('0x8c'),_0x19dd75);throw _0x19dd75;});})[_0x2b65('0x29')](respondWithResult(_0x2be589,0xc9))['catch'](handleError(_0x2be589,null));};exports['bulkCreate']=function(_0x2ca033,_0x1521e1){var _0x5b80fc=_0x2ca033['body'];var _0x3399dd=[];if(_0x2ca033[_0x2b65('0x2f')][_0x2b65('0x2c')]===_0x2b65('0x30'))throw new Error('Unauthorized');if(_[_0x2b65('0x8d')](_0x5b80fc,['role',_0x2b65('0x2f')])&&_0x2ca033['user'][_0x2b65('0x2c')]!==_0x2b65('0x2d')){throw new Error(_0x2b65('0x83'));}if(_[_0x2b65('0x8d')](_0x5b80fc,['role',_0x2b65('0x2d')])&&_0x2ca033[_0x2b65('0x2f')]['role']!=='admin'){throw new Error(_0x2b65('0x8e'));}return licenseUtil[_0x2b65('0x84')](_0x5b80fc)[_0x2b65('0x29')](function(){return validateUser(_0x5b80fc[0x0]);})[_0x2b65('0x29')](function(){for(var _0x5f47ff=0x1;_0x5f47ff<_0x5b80fc[_0x2b65('0x50')];_0x5f47ff++){var _0x30b3f1=_0x5b80fc[_0x5f47ff-0x1]['internal'];if(!_0x5b80fc[_0x5f47ff][_0x2b65('0x68')])_0x5b80fc[_0x5f47ff]['internal']=_0x30b3f1+0x1;_0x3399dd[_0x2b65('0x4c')](validateUser(_0x5b80fc[_0x5f47ff]));}return Promise[_0x2b65('0x56')](_0x3399dd);})[_0x2b65('0x29')](function(){_0x3399dd=[];for(var _0x4ebe6f=0x0;_0x4ebe6f<_0x5b80fc[_0x2b65('0x50')];_0x4ebe6f++){_0x3399dd[_0x2b65('0x4c')](updateUser(_0x5b80fc[_0x4ebe6f]));}return Promise[_0x2b65('0x56')](_0x3399dd);})['then'](function(){_0x3399dd=_0x5b80fc[_0x2b65('0x33')](function(_0x3fb03a){return db['User'][_0x2b65('0x87')](_0x3fb03a,{'include':[{'model':db[_0x2b65('0x73')],'as':_0x2b65('0x73')}]})['then'](function(_0x18ef97){_0x3fb03a['id']=_0x18ef97['id'];return _0x3fb03a;});});return Promise[_0x2b65('0x56')](_0x3399dd);})[_0x2b65('0x29')](function(_0x48b224){if(_0x2ca033['body'][_0x2b65('0x2c')]===_0x2b65('0x2f'))return _0x48b224;if(_0x2ca033[_0x2b65('0x2f')][_0x2b65('0x2c')]!==_0x2b65('0x2f'))return _0x48b224;var _0x33a9f1=_['some'](_0x48b224,function(_0x5792b6){return _0x5792b6[_0x2b65('0x2c')]==='agent'||_0x5792b6[_0x2b65('0x2c')]===_0x2b65('0x31');});if(!_0x33a9f1)return _0x48b224;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x2ca033[_0x2b65('0x2f')][_0x2b65('0x86')]},'raw':!![]})[_0x2b65('0x29')](function(_0x294559){if(_[_0x2b65('0x8f')](_0x294559)||!_[_0x2b65('0x8d')](_0x294559,[_0x2b65('0x8b'),0x0]))return _0x48b224;_0x3399dd=[];var _0x1e1738=_(_0x294559)[_0x2b65('0x33')](function(_0x15ffd7){if(_0x15ffd7[_0x2b65('0x8b')]===0x1)return;return _0x15ffd7[_0x2b65('0x36')]===_0x2b65('0x89')?_0x2b65('0x30'):_0x2b65('0x31');})['compact']()[_0x2b65('0x34')]();for(var _0x45fe78=0x0;_0x45fe78<_0x48b224[_0x2b65('0x50')];_0x45fe78++){if(!_['includes'](_0x1e1738,_0x48b224[_0x45fe78]['role']))return;var _0x47368a=_0x48b224[_0x45fe78][_0x2b65('0x2c')]==='agent'?_0x2b65('0x89'):_0x2b65('0x8a');_0x3399dd[_0x2b65('0x4c')](db[_0x2b65('0x37')]['create']({'name':_0x48b224[_0x45fe78][_0x2b65('0x36')],'resourceId':_0x48b224[_0x45fe78]['id'],'type':_0x47368a,'sectionId':_[_0x2b65('0x64')](_0x294559,[_0x2b65('0x36'),_0x47368a])['id']},{}));}return Promise[_0x2b65('0x56')](_0x3399dd);});})[_0x2b65('0x29')](respondWithResult(_0x1521e1,0xc9))[_0x2b65('0x1e')](handleError(_0x1521e1,null));};exports[_0x2b65('0x90')]=function(_0x5aec71,_0x1f987d){if(_0x5aec71[_0x2b65('0x62')]['id']){delete _0x5aec71[_0x2b65('0x62')]['id'];}return db['User'][_0x2b65('0x64')]({'where':{'id':_0x5aec71['params']['id']}})[_0x2b65('0x29')](function(_0x362972){if(!_0x362972)return null;if(_0x362972['id']===_0x5aec71[_0x2b65('0x2f')]['id']){if(!_0x5aec71[_0x2b65('0x62')][_0x2b65('0x91')]||!_0x5aec71['body']['newPassword']){throw new db[(_0x2b65('0x92'))]['ValidationError'](_0x2b65('0x93'));}if(!_0x362972[_0x2b65('0x94')](_0x5aec71['body']['oldPassword'])){throw new db['Sequelize'][(_0x2b65('0x95'))](_0x2b65('0x96'));}if(_0x5aec71[_0x2b65('0x62')][_0x2b65('0x91')]===_0x5aec71[_0x2b65('0x62')][_0x2b65('0x97')]){throw new db[(_0x2b65('0x92'))][(_0x2b65('0x95'))](_0x2b65('0x98'));}}else if(_0x5aec71[_0x2b65('0x2f')][_0x2b65('0x2c')]==='admin'){if(!_0x5aec71[_0x2b65('0x62')]['newPassword']){throw new db[(_0x2b65('0x92'))][(_0x2b65('0x95'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x5aec71['user'][_0x2b65('0x2c')]===_0x2b65('0x2f')){if(!_0x5aec71[_0x2b65('0x62')][_0x2b65('0x97')]){throw new db[(_0x2b65('0x92'))]['ValidationError'](_0x2b65('0x99'));}if(_0x362972[_0x2b65('0x2c')]!==_0x2b65('0x30')){throw new db['Sequelize'][(_0x2b65('0x95'))](_0x2b65('0x82'));}}else{throw new db[(_0x2b65('0x92'))][(_0x2b65('0x95'))]('Unauthorized');}return _0x362972;})[_0x2b65('0x29')](handleEntityNotFound(_0x1f987d,null))['then'](function(_0x479dcd){return db[_0x2b65('0x69')][_0x2b65('0x9a')]({'attributes':['id','securePassword',_0x2b65('0x9b'),_0x2b65('0x9c')]})[_0x2b65('0x29')](function(_0xe46eb5){if(_0xe46eb5[_0x2b65('0x9d')])authService['validatePasswordPattern'](_0x5aec71['body'][_0x2b65('0x97')]);if(!_0xe46eb5['enforcePasswordHistory']||!_0x479dcd[_0x2b65('0x9e')])return _0x479dcd;authService[_0x2b65('0x9f')](_0x5aec71[_0x2b65('0x62')][_0x2b65('0x97')],_0x479dcd[_0x2b65('0x9e')],_0xe46eb5[_0x2b65('0x9c')]);return _0x479dcd;})['then'](saveUpdates({'password':_0x5aec71[_0x2b65('0x62')]['newPassword'],'passwordResetAt':_0x5aec71[_0x2b65('0x2f')]['id']==_0x5aec71['params']['id']?moment():null,'previousPasswords':authService[_0x2b65('0xa0')](_0x5aec71['body']['newPassword'],_0x479dcd['previousPasswords'])},null));})['then'](respondWithResult(_0x1f987d,null))['catch'](handleError(_0x1f987d,null));};exports[_0x2b65('0xa1')]=function(_0x1b6a11,_0x4d3dd9){var _0x5d3257=_0x1b6a11[_0x2b65('0x62')]['channel'];return db['User'][_0x2b65('0x64')]({'where':{'id':_0x1b6a11['params']['id']},'attributes':['id',_0x2b65('0x36'),_0x2b65('0x2c'),_0x2b65('0xa2'),_0x2b65('0xa3'),_0x2b65('0xa4'),_0x2b65('0xa5')]})[_0x2b65('0x29')](handleEntityNotFound(_0x4d3dd9,null))[_0x2b65('0x29')](function(_0x4e32dc){if(_0x4e32dc){if(!utils[_0x2b65('0xa6')](_0x5d3257)){throw new db[(_0x2b65('0x92'))][(_0x2b65('0x95'))](_0x2b65('0xa7'));}return _0x4e32dc['add'+_[_0x2b65('0xa8')](_0x5d3257[_0x2b65('0xa9')]())+_0x2b65('0xaa')](_0x1b6a11[_0x2b65('0x62')][_0x2b65('0x66')],{'penalty':_0x1b6a11[_0x2b65('0x62')]['penalty']||0x0})[_0x2b65('0xab')](function(_0x4d90b8){for(var _0xe1a76c=0x0;_0xe1a76c<_0x1b6a11[_0x2b65('0x62')][_0x2b65('0x66')][_0x2b65('0x50')];_0xe1a76c+=0x1){var _0x3ffe53={'UserId':Number(_0x1b6a11[_0x2b65('0x58')]['id'])};_0x3ffe53[_[_0x2b65('0xa8')](_0x5d3257[_0x2b65('0xa9')]())+_0x2b65('0xac')]=Number(_0x1b6a11[_0x2b65('0x62')][_0x2b65('0x66')][_0xe1a76c]);socket[_0x2b65('0x2a')](_0x2b65('0x2f')+_[_0x2b65('0xa8')](_0x5d3257['toLowerCase']())+'Queue:save',_0x3ffe53);}return _0x4d90b8;})[_0x2b65('0x29')](function(){if(_0x5d3257==='voice'){return db[_0x2b65('0xad')][_0x2b65('0x4d')]({'where':{'id':_0x1b6a11[_0x2b65('0x62')][_0x2b65('0x66')]||[]},'raw':!![],'attributes':['id',_0x2b65('0x36')]});}})[_0x2b65('0x29')](function(_0x41444f){var _0x374d34=_0x4e32dc[_0x2b65('0xae')]({'plain':!![]});var _0x5d800c=[];if(_0x5d3257===_0x2b65('0xaf')&&_0x374d34[_0x2b65('0x2c')]===_0x2b65('0x30')&&_0x374d34[_0x2b65('0xa2')]){for(let _0xdd4b92=0x0;_0xdd4b92<_0x41444f[_0x2b65('0x50')];_0xdd4b92+=0x1){_0x5d800c[_0x2b65('0x4c')]({'membername':_0x374d34[_0x2b65('0x36')],'UserId':_0x374d34['id'],'queue_name':_0x41444f[_0xdd4b92][_0x2b65('0x36')],'VoiceQueueId':_0x41444f[_0xdd4b92]['id'],'interface':_[_0x2b65('0x6c')](_0x374d34['interface'])?util['format']('SIP/%s',_0x374d34[_0x2b65('0x36')]):_0x374d34[_0x2b65('0xa5')],'paused':_0x374d34[_0x2b65('0xa4')]||![],'penalty':_0x1b6a11[_0x2b65('0x62')]['penalty']||0x0});}return Promise[_0x2b65('0x56')](_0x5d800c[_0x2b65('0x33')](function(_0x22e097){return db['UserVoiceQueueRt']['upsert'](_0x22e097);}));}return _0x4e32dc;});}})[_0x2b65('0x29')](respondWithStatusCode(_0x4d3dd9,null))['catch'](handleError(_0x4d3dd9,null));};exports[_0x2b65('0xb0')]=function(_0x4ae24b,_0x2ee5a7){var _0x4603fc,_0x30ed7e;return db[_0x2b65('0x3c')]['find']({'where':{'id':_0x4ae24b[_0x2b65('0x58')]['id']},'attributes':['id','name',_0x2b65('0x2c')]})[_0x2b65('0x29')](handleEntityNotFound(_0x2ee5a7,null))[_0x2b65('0x29')](function(_0x1eb3ab){if(_0x1eb3ab){_0x4603fc=_0x1eb3ab;if(!_0x4ae24b[_0x2b65('0x45')][_0x2b65('0xb1')]||!utils[_0x2b65('0xa6')](_0x4ae24b[_0x2b65('0x45')]['channel'])){throw new db[(_0x2b65('0x92'))][(_0x2b65('0x95'))](_0x2b65('0xa7'));}return _0x1eb3ab[_0x2b65('0xb2')+_[_0x2b65('0xa8')](_0x4ae24b['query'][_0x2b65('0xb1')]['toLowerCase']())+_0x2b65('0xaa')](_0x4ae24b[_0x2b65('0x45')][_0x2b65('0x66')]);}})[_0x2b65('0x29')](function(_0x15dc69){if(_['isArray'](_0x4ae24b[_0x2b65('0x45')][_0x2b65('0x66')])){for(var _0x3afb13=0x0;_0x3afb13<_0x4ae24b[_0x2b65('0x45')][_0x2b65('0x66')][_0x2b65('0x50')];_0x3afb13+=0x1){_0x30ed7e={'UserId':Number(_0x4ae24b[_0x2b65('0x58')]['id'])};_0x30ed7e[_[_0x2b65('0xa8')](_0x4ae24b['query'][_0x2b65('0xb1')][_0x2b65('0xa9')]())+_0x2b65('0xac')]=Number(_0x4ae24b['query'][_0x2b65('0x66')][_0x3afb13]);socket[_0x2b65('0x2a')](_0x2b65('0x2f')+_['capitalize'](_0x4ae24b['query'][_0x2b65('0xb1')]['toLowerCase']())+'Queue:remove',_0x30ed7e);}}else{_0x30ed7e={'UserId':Number(_0x4ae24b['params']['id'])};_0x30ed7e[_[_0x2b65('0xa8')](_0x4ae24b[_0x2b65('0x45')][_0x2b65('0xb1')][_0x2b65('0xa9')]())+_0x2b65('0xac')]=Number(_0x4ae24b[_0x2b65('0x45')][_0x2b65('0x66')]);socket[_0x2b65('0x2a')](_0x2b65('0x2f')+_[_0x2b65('0xa8')](_0x4ae24b[_0x2b65('0x45')][_0x2b65('0xb1')][_0x2b65('0xa9')]())+_0x2b65('0xb3'),_0x30ed7e);}return _0x15dc69;})[_0x2b65('0x29')](function(){if(_0x4ae24b[_0x2b65('0x45')][_0x2b65('0xb1')]===_0x2b65('0xaf')){return db['UserVoiceQueueRt'][_0x2b65('0x38')]({'where':{'UserId':_0x4ae24b['params']['id'],'VoiceQueueId':_0x4ae24b['query']['ids']},'individualHooks':!![]})['then'](function(){return _0x4603fc;});}return _0x4603fc;})[_0x2b65('0x29')](respondWithStatusCode(_0x2ee5a7,null))[_0x2b65('0x1e')](handleError(_0x2ee5a7,null));};exports['addAvatar']=function(_0x17b221,_0x227768){_0x17b221['body'][_0x2b65('0xb4')]=_0x17b221['file']['filename'];return db[_0x2b65('0x3c')][_0x2b65('0x64')]({'where':{'id':_0x17b221[_0x2b65('0x58')]['id']}})['then'](handleEntityNotFound(_0x227768,null))[_0x2b65('0x29')](saveUpdates(_0x17b221[_0x2b65('0x62')],null))['then'](respondWithResult(_0x227768,null))['catch'](handleError(_0x227768,null));};exports[_0x2b65('0xb5')]=function(_0x12b91a,_0x1ae375){var _0x1adc05=path[_0x2b65('0xb6')](config['root'],_0x2b65('0xb7'));return db['User'][_0x2b65('0x64')]({'where':{'id':_0x12b91a[_0x2b65('0x58')]['id']},'attributes':['id',_0x2b65('0xb4')],'raw':!![]})[_0x2b65('0x29')](handleEntityNotFound(_0x1ae375,null))[_0x2b65('0x29')](function(_0x4b4b90){if(_0x4b4b90){if(_['isNil'](_0x4b4b90[_0x2b65('0xb4')])){return _0x1ae375[_0x2b65('0xb8')](_0x1adc05);}else{if(!fs['existsSync'](path[_0x2b65('0xb6')](config[_0x2b65('0xb9')],'server/files/images/',_0x4b4b90[_0x2b65('0xb4')]))){return _0x1ae375['download'](_0x1adc05);}return _0x1ae375['download'](path[_0x2b65('0xb6')](config['root'],'server/files/images/',_0x4b4b90['userpic']));}}})[_0x2b65('0x1e')](handleError(_0x1ae375,null));};exports[_0x2b65('0xba')]=function(_0x5b95aa,_0x562e9f){return db['User']['find']({'where':{'id':_0x5b95aa[_0x2b65('0x58')]['id']},'attributes':['id']})[_0x2b65('0x29')](handleEntityNotFound(_0x562e9f,null))['then'](function(_0x36522a){var _0x45fa55=[];values=_0x36522a[_0x2b65('0x52')];_0x45fa55[_0x2b65('0x4c')](get_open_tabs('chat',_0x36522a[_0x2b65('0x52')]));_0x45fa55[_0x2b65('0x4c')](get_open_tabs(_0x2b65('0x53'),_0x36522a[_0x2b65('0x52')]));_0x45fa55['push'](get_open_tabs(_0x2b65('0x54'),_0x36522a[_0x2b65('0x52')]));_0x45fa55[_0x2b65('0x4c')](get_open_tabs(_0x2b65('0x55'),_0x36522a[_0x2b65('0x52')]));_0x45fa55[_0x2b65('0x4c')](get_open_tabs(_0x2b65('0x60'),_0x36522a[_0x2b65('0x52')]));_0x45fa55['push'](get_open_tabs(_0x2b65('0x61'),_0x36522a['dataValues']));return Promise['all'](_0x45fa55);})[_0x2b65('0x29')](function(_0x2c75fb){if(_0x2c75fb){var _0xb27a75=_[_0x2b65('0x33')](values['ChatOpenTabs'],function(_0x37be39){return{'channel':_0x2b65('0xbb'),'id':_0x37be39['id'],'createdAt':_0x37be39[_0x2b65('0xbc')]};});var _0x2022b5=_[_0x2b65('0x33')](values[_0x2b65('0xbd')],function(_0x131bb2){return{'channel':_0x2b65('0xbe'),'id':_0x131bb2['id'],'createdAt':_0x131bb2[_0x2b65('0xbc')]};});var _0x42d213=_['map'](values[_0x2b65('0xbf')],function(_0x256ed7){return{'channel':_0x2b65('0xc0'),'id':_0x256ed7['id'],'createdAt':_0x256ed7[_0x2b65('0xbc')]};});var _0x365f50=_[_0x2b65('0x33')](values['MailOpenTabs'],function(_0x4f356f){return{'channel':_0x2b65('0xc1'),'id':_0x4f356f['id'],'createdAt':_0x4f356f['createdAt']};});var _0xe16fa5=_['map'](values[_0x2b65('0xc2')],function(_0x4d08ea){return{'channel':_0x2b65('0xc3'),'id':_0x4d08ea['id'],'createdAt':_0x4d08ea[_0x2b65('0xbc')]};});var _0x2dd65f=_[_0x2b65('0x33')](values[_0x2b65('0xc4')],function(_0x586c51){return{'channel':'WHATSAPP','id':_0x586c51['id'],'createdAt':_0x586c51[_0x2b65('0xbc')]};});var _0x2b6fd0=_['concat'](_0xb27a75,_0x2022b5,_0x42d213,_0x365f50,_0xe16fa5,_0x2dd65f);var _0x18e0fd={'count':_0x2b6fd0[_0x2b65('0x50')],'rows':_0x2b6fd0};return _0x18e0fd;}else return null;})[_0x2b65('0x29')](respondWithResult(_0x562e9f,null))[_0x2b65('0x1e')](handleError(_0x562e9f,null));};exports['getContacts']=function(_0x307bf3,_0x3e8627){var _0x24debd={};var _0x2652d3={};var _0x546f4f;var _0x4298d4;return db[_0x2b65('0x3c')][_0x2b65('0x9a')]({'where':{'id':_0x307bf3[_0x2b65('0x58')]['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x3e8627,null))[_0x2b65('0x29')](function(_0xd703ce){if(_0xd703ce){_0x546f4f=_0xd703ce;_0x2652d3[_0x2b65('0x59')]=_[_0x2b65('0x5b')](db[_0x2b65('0xc5')][_0x2b65('0x3d')]);_0x2652d3[_0x2b65('0x45')]=_[_0x2b65('0x5b')](_0x307bf3[_0x2b65('0x45')]);_0x2652d3[_0x2b65('0xc6')]=_[_0x2b65('0x5c')](_0x2652d3[_0x2b65('0x59')],_0x2652d3[_0x2b65('0x45')]);_0x24debd[_0x2b65('0x4b')]=_['intersection'](_0x2652d3[_0x2b65('0x59')],qs[_0x2b65('0x5d')](_0x307bf3['query'][_0x2b65('0x5d')]));_0x24debd[_0x2b65('0x4b')]=_0x24debd['attributes'][_0x2b65('0x50')]?_0x24debd['attributes']:_0x2652d3[_0x2b65('0x59')];_0x24debd[_0x2b65('0xc7')]=qs[_0x2b65('0xc8')](_0x307bf3['query']['sort']);_0x24debd[_0x2b65('0x44')]=qs['filters'](_['pick'](_0x307bf3[_0x2b65('0x45')],_0x2652d3[_0x2b65('0xc6')]));if(_0x307bf3[_0x2b65('0x45')]['filter']){_0x24debd[_0x2b65('0x44')]=_[_0x2b65('0x5e')](_0x24debd[_0x2b65('0x44')],{'$or':_[_0x2b65('0x33')](_0x24debd[_0x2b65('0x4b')],function(_0x4f40fd){var _0x57b413={};_0x57b413[_0x4f40fd]={'$like':'%'+_0x307bf3['query']['filter']+'%'};return _0x57b413;})});}_0x24debd=_[_0x2b65('0x5e')]({},_0x24debd,_0x307bf3['options']);return _0x546f4f[_0x2b65('0xc9')](_0x24debd);}})['then'](function(_0x29f36c){if(_0x29f36c){_0x4298d4=_0x29f36c[_0x2b65('0x50')];if(_0x307bf3[_0x2b65('0x45')][_0x2b65('0xca')]('includeAll')){_0x24debd[_0x2b65('0x47')]=[{'model':db['CmList'],'as':_0x2b65('0xcb'),'required':![]},{'model':db[_0x2b65('0xcc')],'as':'Tags','attributes':['id',_0x2b65('0x36'),'color'],'where':_0x307bf3[_0x2b65('0x45')]['tag']?{'id':_0x307bf3['query'][_0x2b65('0xcd')]}:undefined,'required':_0x307bf3[_0x2b65('0x45')][_0x2b65('0xcd')]?!![]:![]}];}if(!_0x307bf3['query']['hasOwnProperty'](_0x2b65('0xce'))){_0x24debd['limit']=qs[_0x2b65('0x24')](_0x307bf3[_0x2b65('0x45')]['limit']);_0x24debd[_0x2b65('0x22')]=qs[_0x2b65('0x22')](_0x307bf3[_0x2b65('0x45')][_0x2b65('0x22')]);}return _0x546f4f[_0x2b65('0xc9')](_0x24debd);}})[_0x2b65('0x29')](function(_0x561fe0){if(_0x561fe0){return _0x561fe0?{'count':_0x4298d4,'rows':_0x561fe0}:null;}})[_0x2b65('0x29')](respondWithResult(_0x3e8627,null))['catch'](handleError(_0x3e8627,null));};exports[_0x2b65('0xcf')]=function(_0x14a9af,_0xcb419b){var _0x224ac7;var _0x46c5f9={};var _0x3f86e6;return db[_0x2b65('0x3c')][_0x2b65('0x9a')]({'where':{'id':_0x14a9af[_0x2b65('0x58')]['id']},'attributes':['id','name',_0x2b65('0x2c')]})[_0x2b65('0x29')](handleEntityNotFound(_0xcb419b,null))['then'](function(_0xc3f113){if(!utils[_0x2b65('0xa6')](_0x14a9af[_0x2b65('0x45')][_0x2b65('0xb1')])){throw new db[(_0x2b65('0x92'))][(_0x2b65('0x95'))](_0x2b65('0xa7'));}_0x224ac7=_0xc3f113;var _0x41bc2d={};_0x41bc2d[_0x2b65('0x59')]=_[_0x2b65('0x5b')](db[_[_0x2b65('0xa8')](_0x14a9af['query'][_0x2b65('0xb1')])+'Queue']['rawAttributes']);_0x41bc2d['query']=_[_0x2b65('0x5b')](_0x14a9af[_0x2b65('0x45')]);_0x41bc2d[_0x2b65('0xc6')]=_[_0x2b65('0x5c')](_0x41bc2d[_0x2b65('0x59')],_0x41bc2d[_0x2b65('0x45')]);_0x46c5f9[_0x2b65('0x4b')]=_[_0x2b65('0x5c')](_0x41bc2d[_0x2b65('0x59')],qs[_0x2b65('0x5d')](_0x14a9af['query'][_0x2b65('0x5d')]));_0x46c5f9['attributes']=_0x46c5f9[_0x2b65('0x4b')][_0x2b65('0x50')]?_0x46c5f9[_0x2b65('0x4b')]:_0x41bc2d[_0x2b65('0x59')];_0x46c5f9[_0x2b65('0xc7')]=qs[_0x2b65('0xc8')](_0x14a9af['query'][_0x2b65('0xc8')]);_0x46c5f9[_0x2b65('0x44')]=qs[_0x2b65('0xc6')](_[_0x2b65('0xd0')](_0x14a9af[_0x2b65('0x45')],_0x41bc2d['filters']));if(_0x14a9af[_0x2b65('0x45')][_0x2b65('0x32')]){_0x46c5f9[_0x2b65('0x44')]=_[_0x2b65('0x5e')](_0x46c5f9[_0x2b65('0x44')],{'$or':_['map'](_0x46c5f9['attributes'],function(_0x430e92){var _0x180c83={};_0x180c83[_0x430e92]={'$like':'%'+_0x14a9af[_0x2b65('0x45')][_0x2b65('0x32')]+'%'};return _0x180c83;})});}_0x46c5f9=_['merge']({},_0x46c5f9,_0x14a9af[_0x2b65('0x5f')]);switch(_0x224ac7[_0x2b65('0x2c')]){case _0x2b65('0x2d'):return db[_[_0x2b65('0xa8')](_0x14a9af[_0x2b65('0x45')][_0x2b65('0xb1')])+'Queue'][_0x2b65('0x4d')](_0x46c5f9);case _0x2b65('0x2f'):case'agent':return _0x224ac7[_0x2b65('0xae')+_[_0x2b65('0xa8')](_0x14a9af['query']['channel'])+_0x2b65('0xaa')](_0x46c5f9);default:throw new db['Sequelize'][(_0x2b65('0x95'))](_0x2b65('0xd1'));}})[_0x2b65('0x29')](function(_0x101136){_0x3f86e6=_0x101136[_0x2b65('0x50')];if(!_0x14a9af[_0x2b65('0x45')][_0x2b65('0xca')](_0x2b65('0xce'))){_0x46c5f9['limit']=qs['limit'](_0x14a9af[_0x2b65('0x45')]['limit']);_0x46c5f9['offset']=qs[_0x2b65('0x22')](_0x14a9af[_0x2b65('0x45')]['offset']);}switch(_0x224ac7['role']){case _0x2b65('0x2d'):return db[_['capitalize'](_0x14a9af[_0x2b65('0x45')][_0x2b65('0xb1')])+_0x2b65('0xd2')][_0x2b65('0x4d')](_0x46c5f9);case'user':case _0x2b65('0x30'):return _0x224ac7[_0x2b65('0xae')+_[_0x2b65('0xa8')](_0x14a9af[_0x2b65('0x45')][_0x2b65('0xb1')])+'Queues'](_0x46c5f9);}})[_0x2b65('0x29')](function(_0x5e2b10){return{'count':_0x3f86e6,'rows':_0x5e2b10};})[_0x2b65('0x29')](respondWithResult(_0xcb419b,null))[_0x2b65('0x1e')](handleError(_0xcb419b,null));};exports[_0x2b65('0xd3')]=function(_0x382377,_0x15259d){var _0xa291ba={};var _0x1b8b95={};var _0x129486;var _0x512347;return db[_0x2b65('0x3c')]['findOne']({'where':{'id':_0x382377['params']['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x15259d,null))['then'](function(_0x4c3a45){if(_0x4c3a45){_0x129486=_0x4c3a45;_0x1b8b95['model']=_[_0x2b65('0x5b')](db[_0x2b65('0xd4')][_0x2b65('0x3d')]);_0x1b8b95[_0x2b65('0x45')]=_[_0x2b65('0x5b')](_0x382377['query']);_0x1b8b95[_0x2b65('0xc6')]=_[_0x2b65('0x5c')](_0x1b8b95[_0x2b65('0x59')],_0x1b8b95[_0x2b65('0x45')]);_0xa291ba[_0x2b65('0x4b')]=_['intersection'](_0x1b8b95[_0x2b65('0x59')],qs[_0x2b65('0x5d')](_0x382377['query'][_0x2b65('0x5d')]));_0xa291ba[_0x2b65('0x4b')]=_0xa291ba[_0x2b65('0x4b')][_0x2b65('0x50')]?_0xa291ba[_0x2b65('0x4b')]:_0x1b8b95[_0x2b65('0x59')];_0xa291ba[_0x2b65('0xc7')]=qs['sort'](_0x382377[_0x2b65('0x45')][_0x2b65('0xc8')]);_0xa291ba[_0x2b65('0x44')]=qs[_0x2b65('0xc6')](_['pick'](_0x382377[_0x2b65('0x45')],_0x1b8b95['filters']));if(_0x382377[_0x2b65('0x45')]['filter']){_0xa291ba['where']=_[_0x2b65('0x5e')](_0xa291ba[_0x2b65('0x44')],{'$or':_[_0x2b65('0x33')](_0xa291ba[_0x2b65('0x4b')],function(_0x1b9c94){var _0x2e05aa={};_0x2e05aa[_0x1b9c94]={'$like':'%'+_0x382377['query'][_0x2b65('0x32')]+'%'};return _0x2e05aa;})});}_0xa291ba=_[_0x2b65('0x5e')]({},_0xa291ba,_0x382377[_0x2b65('0x5f')]);return _0x129486[_0x2b65('0xd3')](_0xa291ba);}})['then'](function(_0x174a22){if(_0x174a22){_0x512347=_0x174a22['length'];if(!_0x382377[_0x2b65('0x45')][_0x2b65('0xca')](_0x2b65('0xce'))){_0xa291ba[_0x2b65('0x24')]=qs[_0x2b65('0x24')](_0x382377['query']['limit']);_0xa291ba[_0x2b65('0x22')]=qs[_0x2b65('0x22')](_0x382377['query'][_0x2b65('0x22')]);}return _0x129486[_0x2b65('0xd3')](_0xa291ba);}})['then'](function(_0x49df67){if(_0x49df67){return _0x49df67?{'count':_0x512347,'rows':_0x49df67}:null;}})[_0x2b65('0x29')](respondWithResult(_0x15259d,null))[_0x2b65('0x1e')](handleError(_0x15259d,null));};exports[_0x2b65('0xd5')]=function(_0x2e706b,_0x4bd0a5){var _0x1fd6d2={};var _0x5af0ea={};var _0x58b086;var _0x26f4b6;return db[_0x2b65('0x3c')]['findOne']({'where':{'id':_0x2e706b[_0x2b65('0x58')]['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x4bd0a5,null))[_0x2b65('0x29')](function(_0x5a2cc8){if(_0x5a2cc8){_0x58b086=_0x5a2cc8;_0x5af0ea[_0x2b65('0x59')]=_[_0x2b65('0x5b')](db[_0x2b65('0xd6')][_0x2b65('0x3d')]);_0x5af0ea[_0x2b65('0x45')]=_[_0x2b65('0x5b')](_0x2e706b[_0x2b65('0x45')]);_0x5af0ea[_0x2b65('0xc6')]=_[_0x2b65('0x5c')](_0x5af0ea[_0x2b65('0x59')],_0x5af0ea['query']);_0x1fd6d2[_0x2b65('0x4b')]=_['intersection'](_0x5af0ea[_0x2b65('0x59')],qs[_0x2b65('0x5d')](_0x2e706b[_0x2b65('0x45')][_0x2b65('0x5d')]));_0x1fd6d2[_0x2b65('0x4b')]=_0x1fd6d2[_0x2b65('0x4b')][_0x2b65('0x50')]?_0x1fd6d2[_0x2b65('0x4b')]:_0x5af0ea['model'];_0x1fd6d2[_0x2b65('0xc7')]=qs[_0x2b65('0xc8')](_0x2e706b['query'][_0x2b65('0xc8')]);_0x1fd6d2[_0x2b65('0x44')]=qs[_0x2b65('0xc6')](_['pick'](_0x2e706b[_0x2b65('0x45')],_0x5af0ea[_0x2b65('0xc6')]));if(_0x2e706b[_0x2b65('0x45')][_0x2b65('0x32')]){_0x1fd6d2['where']=_['merge'](_0x1fd6d2[_0x2b65('0x44')],{'$or':_[_0x2b65('0x33')](_0x1fd6d2['attributes'],function(_0x56f7f9){var _0x5b9cb6={};_0x5b9cb6[_0x56f7f9]={'$like':'%'+_0x2e706b[_0x2b65('0x45')][_0x2b65('0x32')]+'%'};return _0x5b9cb6;})});}_0x1fd6d2=_[_0x2b65('0x5e')]({},_0x1fd6d2,_0x2e706b[_0x2b65('0x5f')]);return _0x58b086[_0x2b65('0xd5')](_0x1fd6d2);}})[_0x2b65('0x29')](function(_0x58e83a){if(_0x58e83a){_0x26f4b6=_0x58e83a['length'];if(!_0x2e706b['query'][_0x2b65('0xca')](_0x2b65('0xce'))){_0x1fd6d2['limit']=qs[_0x2b65('0x24')](_0x2e706b[_0x2b65('0x45')]['limit']);_0x1fd6d2[_0x2b65('0x22')]=qs['offset'](_0x2e706b['query']['offset']);}return _0x58b086['getGroups'](_0x1fd6d2);}})[_0x2b65('0x29')](function(_0x3500e9){if(_0x3500e9){return _0x3500e9?{'count':_0x26f4b6,'rows':_0x3500e9}:null;}})[_0x2b65('0x29')](respondWithResult(_0x4bd0a5,null))[_0x2b65('0x1e')](handleError(_0x4bd0a5,null));};exports[_0x2b65('0xd7')]=function(_0x7c372b,_0x2b431b){var _0x1ed822={'raw':!![],'where':{}};var _0x59bbd2={};var _0x42ec8a={'count':0x0,'rows':[]};return db['User'][_0x2b65('0x9a')]({'where':{'id':_0x7c372b['params']['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x2b431b,null))[_0x2b65('0x29')](function(_0x294076){if(_0x294076){_0x59bbd2[_0x2b65('0x59')]=_['keys'](db[_0x2b65('0xd8')]['rawAttributes']);_0x59bbd2['query']=_[_0x2b65('0x5b')](_0x7c372b[_0x2b65('0x45')]);_0x59bbd2[_0x2b65('0xc6')]=_[_0x2b65('0x5c')](_0x59bbd2['model'],_0x59bbd2[_0x2b65('0x45')]);_0x1ed822[_0x2b65('0x4b')]=_['intersection'](_0x59bbd2[_0x2b65('0x59')],qs['fields'](_0x7c372b[_0x2b65('0x45')][_0x2b65('0x5d')]));_0x1ed822[_0x2b65('0x4b')]=_0x1ed822[_0x2b65('0x4b')][_0x2b65('0x50')]?_0x1ed822[_0x2b65('0x4b')]:_0x59bbd2[_0x2b65('0x59')];if(!_0x7c372b[_0x2b65('0x45')][_0x2b65('0xca')]('nolimit')){_0x1ed822[_0x2b65('0x24')]=qs[_0x2b65('0x24')](_0x7c372b['query'][_0x2b65('0x24')]);_0x1ed822[_0x2b65('0x22')]=qs[_0x2b65('0x22')](_0x7c372b[_0x2b65('0x45')]['offset']);}_0x1ed822[_0x2b65('0xc7')]=qs[_0x2b65('0xc8')](_0x7c372b['query'][_0x2b65('0xc8')]);_0x1ed822[_0x2b65('0x44')]=qs[_0x2b65('0xc6')](_[_0x2b65('0xd0')](_0x7c372b[_0x2b65('0x45')],_0x59bbd2['filters']));_0x1ed822[_0x2b65('0x44')][_0x2b65('0xd9')]=_0x294076['id'];if(_0x7c372b[_0x2b65('0x45')][_0x2b65('0x32')]){_0x1ed822['where']=_[_0x2b65('0x5e')](_0x1ed822[_0x2b65('0x44')],{'$or':_[_0x2b65('0x33')](_0x1ed822['attributes'],function(_0x49b50f){var _0xb6b07b={};_0xb6b07b[_0x49b50f]={'$like':'%'+_0x7c372b[_0x2b65('0x45')][_0x2b65('0x32')]+'%'};return _0xb6b07b;})});}_0x1ed822=_['merge']({},_0x1ed822,_0x7c372b[_0x2b65('0x5f')]);return db[_0x2b65('0xd8')][_0x2b65('0x25')]({'where':_0x1ed822['where']})[_0x2b65('0x29')](function(_0x25ec13){_0x42ec8a['count']=_0x25ec13;if(_0x7c372b[_0x2b65('0x45')][_0x2b65('0x46')]){_0x1ed822[_0x2b65('0x47')]=[{'all':!![]}];}return db['VoiceRecording'][_0x2b65('0x4d')](_0x1ed822);})['then'](function(_0x56a007){_0x42ec8a[_0x2b65('0x4e')]=_0x56a007;return _0x42ec8a;});}})[_0x2b65('0x29')](respondWithFilteredResult(_0x2b431b,_0x1ed822))[_0x2b65('0x1e')](handleError(_0x2b431b,null));};exports['getScreenRecordings']=function(_0x1ac6c5,_0x3f47f3){var _0x23d930={'raw':!![],'where':{}};var _0x143067={};var _0x377921={'count':0x0,'rows':[]};return db['User'][_0x2b65('0x9a')]({'where':{'id':_0x1ac6c5[_0x2b65('0x58')]['id']}})['then'](handleEntityNotFound(_0x3f47f3,null))[_0x2b65('0x29')](function(_0x30e3d9){if(_0x30e3d9){_0x143067[_0x2b65('0x59')]=_[_0x2b65('0x5b')](db[_0x2b65('0xda')][_0x2b65('0x3d')]);_0x143067[_0x2b65('0x45')]=_[_0x2b65('0x5b')](_0x1ac6c5['query']);_0x143067[_0x2b65('0xc6')]=_['intersection'](_0x143067[_0x2b65('0x59')],_0x143067['query']);_0x23d930[_0x2b65('0x4b')]=_[_0x2b65('0x5c')](_0x143067[_0x2b65('0x59')],qs['fields'](_0x1ac6c5['query'][_0x2b65('0x5d')]));_0x23d930[_0x2b65('0x4b')]=_0x23d930['attributes'][_0x2b65('0x50')]?_0x23d930['attributes']:_0x143067[_0x2b65('0x59')];if(!_0x1ac6c5[_0x2b65('0x45')]['hasOwnProperty'](_0x2b65('0xce'))){_0x23d930['limit']=qs[_0x2b65('0x24')](_0x1ac6c5[_0x2b65('0x45')][_0x2b65('0x24')]);_0x23d930[_0x2b65('0x22')]=qs[_0x2b65('0x22')](_0x1ac6c5[_0x2b65('0x45')][_0x2b65('0x22')]);}_0x23d930[_0x2b65('0xc7')]=qs[_0x2b65('0xc8')](_0x1ac6c5[_0x2b65('0x45')][_0x2b65('0xc8')]);_0x23d930[_0x2b65('0x44')]=qs[_0x2b65('0xc6')](_['pick'](_0x1ac6c5[_0x2b65('0x45')],_0x143067[_0x2b65('0xc6')]));_0x23d930[_0x2b65('0x44')][_0x2b65('0xd9')]=_0x30e3d9['id'];if(_0x1ac6c5[_0x2b65('0x45')]['filter']){_0x23d930[_0x2b65('0x44')]=_[_0x2b65('0x5e')](_0x23d930['where'],{'$or':_[_0x2b65('0x33')](_0x23d930[_0x2b65('0x4b')],function(_0x58cce8){var _0x5ebe0c={};_0x5ebe0c[_0x58cce8]={'$like':'%'+_0x1ac6c5[_0x2b65('0x45')][_0x2b65('0x32')]+'%'};return _0x5ebe0c;})});}_0x23d930=_[_0x2b65('0x5e')]({},_0x23d930,_0x1ac6c5['options']);return db['ScreenRecording'][_0x2b65('0x25')]({'where':_0x23d930[_0x2b65('0x44')]})[_0x2b65('0x29')](function(_0x6bf8d7){_0x377921[_0x2b65('0x25')]=_0x6bf8d7;if(_0x1ac6c5[_0x2b65('0x45')][_0x2b65('0x46')]){_0x23d930[_0x2b65('0x47')]=[{'all':!![]}];}return db[_0x2b65('0xda')]['findAll'](_0x23d930);})['then'](function(_0x3ae249){_0x377921[_0x2b65('0x4e')]=_0x3ae249;return _0x377921;});}})[_0x2b65('0x29')](respondWithFilteredResult(_0x3f47f3,_0x23d930))[_0x2b65('0x1e')](handleError(_0x3f47f3,null));};exports['getChatInteractions']=function(_0xc1ace3,_0x4de03a){var _0x49d7bc={};var _0x441dc9={};var _0x44be34;var _0x2747ed;return db['User'][_0x2b65('0x9a')]({'where':{'id':_0xc1ace3['params']['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x4de03a,null))[_0x2b65('0x29')](function(_0x8c174c){if(_0x8c174c){_0x44be34=_0x8c174c;_0x441dc9[_0x2b65('0x59')]=_['keys'](db[_0x2b65('0xdb')][_0x2b65('0x3d')]);_0x441dc9[_0x2b65('0x45')]=_[_0x2b65('0x5b')](_0xc1ace3[_0x2b65('0x45')]);_0x441dc9[_0x2b65('0xc6')]=_['intersection'](_0x441dc9[_0x2b65('0x59')],_0x441dc9[_0x2b65('0x45')]);_0x49d7bc[_0x2b65('0x4b')]=_['intersection'](_0x441dc9[_0x2b65('0x59')],qs['fields'](_0xc1ace3[_0x2b65('0x45')][_0x2b65('0x5d')]));_0x49d7bc['attributes']=_0x49d7bc[_0x2b65('0x4b')][_0x2b65('0x50')]?_0x49d7bc['attributes']:_0x441dc9[_0x2b65('0x59')];_0x49d7bc[_0x2b65('0xc7')]=qs[_0x2b65('0xc8')](_0xc1ace3[_0x2b65('0x45')][_0x2b65('0xc8')]);_0x49d7bc[_0x2b65('0x44')]=qs[_0x2b65('0xc6')](_[_0x2b65('0xd0')](_0xc1ace3[_0x2b65('0x45')],_0x441dc9['filters']));if(_0xc1ace3[_0x2b65('0x45')][_0x2b65('0x32')]){_0x49d7bc[_0x2b65('0x44')]=_[_0x2b65('0x5e')](_0x49d7bc['where'],{'$or':_[_0x2b65('0x33')](_0x49d7bc[_0x2b65('0x4b')],function(_0xbfffd3){var _0x4156b9={};_0x4156b9[_0xbfffd3]={'$like':'%'+_0xc1ace3[_0x2b65('0x45')][_0x2b65('0x32')]+'%'};return _0x4156b9;})});}_0x49d7bc=_[_0x2b65('0x5e')]({},_0x49d7bc,_0xc1ace3['options']);return _0x44be34['getChatInteractions'](_0x49d7bc);}})[_0x2b65('0x29')](function(_0x4dde95){if(_0x4dde95){_0x2747ed=_0x4dde95[_0x2b65('0x50')];if(!_0xc1ace3[_0x2b65('0x45')][_0x2b65('0xca')](_0x2b65('0xce'))){_0x49d7bc[_0x2b65('0x24')]=qs[_0x2b65('0x24')](_0xc1ace3[_0x2b65('0x45')][_0x2b65('0x24')]);_0x49d7bc[_0x2b65('0x22')]=qs['offset'](_0xc1ace3['query'][_0x2b65('0x22')]);}return _0x44be34[_0x2b65('0xdc')](_0x49d7bc);}})[_0x2b65('0x29')](function(_0xffed77){if(_0xffed77){return _0xffed77?{'count':_0x2747ed,'rows':_0xffed77}:null;}})[_0x2b65('0x29')](respondWithResult(_0x4de03a,null))[_0x2b65('0x1e')](handleError(_0x4de03a,null));};exports[_0x2b65('0xdd')]=function(_0x1fe530,_0x5d14be){var _0x34fd50={};var _0x3fbd9b={};var _0x397050;var _0x332cb5;return db[_0x2b65('0x3c')]['findOne']({'where':{'id':_0x1fe530[_0x2b65('0x58')]['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x5d14be,null))['then'](function(_0x4867a7){if(_0x4867a7){_0x397050=_0x4867a7;_0x3fbd9b[_0x2b65('0x59')]=_[_0x2b65('0x5b')](db[_0x2b65('0xde')][_0x2b65('0x3d')]);_0x3fbd9b[_0x2b65('0x45')]=_[_0x2b65('0x5b')](_0x1fe530['query']);_0x3fbd9b[_0x2b65('0xc6')]=_[_0x2b65('0x5c')](_0x3fbd9b[_0x2b65('0x59')],_0x3fbd9b[_0x2b65('0x45')]);_0x34fd50[_0x2b65('0x4b')]=_[_0x2b65('0x5c')](_0x3fbd9b[_0x2b65('0x59')],qs[_0x2b65('0x5d')](_0x1fe530[_0x2b65('0x45')][_0x2b65('0x5d')]));_0x34fd50[_0x2b65('0x4b')]=_0x34fd50[_0x2b65('0x4b')][_0x2b65('0x50')]?_0x34fd50[_0x2b65('0x4b')]:_0x3fbd9b[_0x2b65('0x59')];_0x34fd50[_0x2b65('0xc7')]=qs[_0x2b65('0xc8')](_0x1fe530[_0x2b65('0x45')][_0x2b65('0xc8')]);_0x34fd50[_0x2b65('0x44')]=qs['filters'](_['pick'](_0x1fe530['query'],_0x3fbd9b[_0x2b65('0xc6')]));if(_0x1fe530[_0x2b65('0x45')][_0x2b65('0x32')]){_0x34fd50[_0x2b65('0x44')]=_[_0x2b65('0x5e')](_0x34fd50['where'],{'$or':_[_0x2b65('0x33')](_0x34fd50['attributes'],function(_0x2488c0){var _0x268b99={};_0x268b99[_0x2488c0]={'$like':'%'+_0x1fe530[_0x2b65('0x45')][_0x2b65('0x32')]+'%'};return _0x268b99;})});}_0x34fd50=_[_0x2b65('0x5e')]({},_0x34fd50,_0x1fe530[_0x2b65('0x5f')]);return _0x397050[_0x2b65('0xdd')](_0x34fd50);}})[_0x2b65('0x29')](function(_0xe4a318){if(_0xe4a318){_0x332cb5=_0xe4a318[_0x2b65('0x50')];if(!_0x1fe530['query']['hasOwnProperty'](_0x2b65('0xce'))){_0x34fd50['limit']=qs[_0x2b65('0x24')](_0x1fe530[_0x2b65('0x45')][_0x2b65('0x24')]);_0x34fd50[_0x2b65('0x22')]=qs[_0x2b65('0x22')](_0x1fe530[_0x2b65('0x45')][_0x2b65('0x22')]);}return _0x397050[_0x2b65('0xdd')](_0x34fd50);}})[_0x2b65('0x29')](function(_0x214a36){if(_0x214a36){return _0x214a36?{'count':_0x332cb5,'rows':_0x214a36}:null;}})['then'](respondWithResult(_0x5d14be,null))['catch'](handleError(_0x5d14be,null));};exports['getMailInteractions']=function(_0x2cfeca,_0x53fdac){var _0x50a73b={'raw':!![],'where':{}};var _0x3fa746={};var _0x392af7={'count':0x0,'rows':[]};return db[_0x2b65('0x3c')][_0x2b65('0x9a')]({'where':{'id':_0x2cfeca['params']['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x53fdac,null))[_0x2b65('0x29')](function(_0x117c0c){if(_0x117c0c){_0x3fa746['model']=_[_0x2b65('0x5b')](db[_0x2b65('0xdf')][_0x2b65('0x3d')]);_0x3fa746['query']=_[_0x2b65('0x5b')](_0x2cfeca[_0x2b65('0x45')]);_0x3fa746[_0x2b65('0xc6')]=_['intersection'](_0x3fa746[_0x2b65('0x59')],_0x3fa746[_0x2b65('0x45')]);_0x50a73b['attributes']=_[_0x2b65('0x5c')](_0x3fa746['model'],qs[_0x2b65('0x5d')](_0x2cfeca[_0x2b65('0x45')][_0x2b65('0x5d')]));_0x50a73b[_0x2b65('0x4b')]=_0x50a73b[_0x2b65('0x4b')][_0x2b65('0x50')]?_0x50a73b['attributes']:_0x3fa746[_0x2b65('0x59')];if(!_0x2cfeca[_0x2b65('0x45')][_0x2b65('0xca')](_0x2b65('0xce'))){_0x50a73b[_0x2b65('0x24')]=qs['limit'](_0x2cfeca[_0x2b65('0x45')][_0x2b65('0x24')]);_0x50a73b[_0x2b65('0x22')]=qs['offset'](_0x2cfeca[_0x2b65('0x45')][_0x2b65('0x22')]);}_0x50a73b[_0x2b65('0xc7')]=qs['sort'](_0x2cfeca[_0x2b65('0x45')]['sort']);_0x50a73b[_0x2b65('0x44')]=qs[_0x2b65('0xc6')](_[_0x2b65('0xd0')](_0x2cfeca[_0x2b65('0x45')],_0x3fa746['filters']));_0x50a73b[_0x2b65('0x44')][_0x2b65('0xd9')]=_0x117c0c['id'];if(_0x2cfeca[_0x2b65('0x45')][_0x2b65('0x32')]){_0x50a73b[_0x2b65('0x44')]=_[_0x2b65('0x5e')](_0x50a73b[_0x2b65('0x44')],{'$or':_[_0x2b65('0x33')](_0x50a73b[_0x2b65('0x4b')],function(_0x18631d){var _0x5aba1e={};_0x5aba1e[_0x18631d]={'$like':'%'+_0x2cfeca[_0x2b65('0x45')][_0x2b65('0x32')]+'%'};return _0x5aba1e;})});}_0x50a73b=_[_0x2b65('0x5e')]({},_0x50a73b,_0x2cfeca[_0x2b65('0x5f')]);return db['MailInteraction'][_0x2b65('0x25')]({'where':_0x50a73b['where']})[_0x2b65('0x29')](function(_0x486fd5){_0x392af7[_0x2b65('0x25')]=_0x486fd5;if(_0x2cfeca[_0x2b65('0x45')][_0x2b65('0x46')]){_0x50a73b['include']=[{'all':!![]}];}return db[_0x2b65('0xdf')][_0x2b65('0x4d')](_0x50a73b);})['then'](function(_0x1a88ca){_0x392af7[_0x2b65('0x4e')]=_0x1a88ca;return _0x392af7;});}})[_0x2b65('0x29')](respondWithFilteredResult(_0x53fdac,_0x50a73b))['catch'](handleError(_0x53fdac,null));};exports['getSmsInteractions']=function(_0x40e3c2,_0x1a5522){var _0x47fe13={};var _0x2858c0={};var _0x1b6f38;var _0x2e6901;return db[_0x2b65('0x3c')]['findOne']({'where':{'id':_0x40e3c2[_0x2b65('0x58')]['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x1a5522,null))[_0x2b65('0x29')](function(_0x5db76b){if(_0x5db76b){_0x1b6f38=_0x5db76b;_0x2858c0['model']=_[_0x2b65('0x5b')](db[_0x2b65('0xe0')]['rawAttributes']);_0x2858c0[_0x2b65('0x45')]=_[_0x2b65('0x5b')](_0x40e3c2[_0x2b65('0x45')]);_0x2858c0[_0x2b65('0xc6')]=_['intersection'](_0x2858c0[_0x2b65('0x59')],_0x2858c0[_0x2b65('0x45')]);_0x47fe13[_0x2b65('0x4b')]=_['intersection'](_0x2858c0[_0x2b65('0x59')],qs['fields'](_0x40e3c2['query']['fields']));_0x47fe13['attributes']=_0x47fe13[_0x2b65('0x4b')][_0x2b65('0x50')]?_0x47fe13[_0x2b65('0x4b')]:_0x2858c0['model'];_0x47fe13['order']=qs[_0x2b65('0xc8')](_0x40e3c2[_0x2b65('0x45')][_0x2b65('0xc8')]);_0x47fe13[_0x2b65('0x44')]=qs[_0x2b65('0xc6')](_[_0x2b65('0xd0')](_0x40e3c2['query'],_0x2858c0[_0x2b65('0xc6')]));if(_0x40e3c2['query'][_0x2b65('0x32')]){_0x47fe13['where']=_[_0x2b65('0x5e')](_0x47fe13[_0x2b65('0x44')],{'$or':_[_0x2b65('0x33')](_0x47fe13[_0x2b65('0x4b')],function(_0x26aa16){var _0x3c976b={};_0x3c976b[_0x26aa16]={'$like':'%'+_0x40e3c2[_0x2b65('0x45')][_0x2b65('0x32')]+'%'};return _0x3c976b;})});}_0x47fe13=_['merge']({},_0x47fe13,_0x40e3c2[_0x2b65('0x5f')]);return _0x1b6f38[_0x2b65('0xe1')](_0x47fe13);}})[_0x2b65('0x29')](function(_0xfe435c){if(_0xfe435c){_0x2e6901=_0xfe435c[_0x2b65('0x50')];if(!_0x40e3c2[_0x2b65('0x45')]['hasOwnProperty']('nolimit')){_0x47fe13[_0x2b65('0x24')]=qs[_0x2b65('0x24')](_0x40e3c2[_0x2b65('0x45')][_0x2b65('0x24')]);_0x47fe13[_0x2b65('0x22')]=qs[_0x2b65('0x22')](_0x40e3c2['query'][_0x2b65('0x22')]);}return _0x1b6f38[_0x2b65('0xe1')](_0x47fe13);}})[_0x2b65('0x29')](function(_0x35ccc8){if(_0x35ccc8){return _0x35ccc8?{'count':_0x2e6901,'rows':_0x35ccc8}:null;}})[_0x2b65('0x29')](respondWithResult(_0x1a5522,null))['catch'](handleError(_0x1a5522,null));};exports['getFaxInteractions']=function(_0x2f8529,_0x2de642){var _0x500c80={};var _0x44ba41={};var _0x56926d;var _0x183d21;return db[_0x2b65('0x3c')][_0x2b65('0x9a')]({'where':{'id':_0x2f8529['params']['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x2de642,null))[_0x2b65('0x29')](function(_0x2877c6){if(_0x2877c6){_0x56926d=_0x2877c6;_0x44ba41[_0x2b65('0x59')]=_[_0x2b65('0x5b')](db[_0x2b65('0xe2')][_0x2b65('0x3d')]);_0x44ba41[_0x2b65('0x45')]=_[_0x2b65('0x5b')](_0x2f8529[_0x2b65('0x45')]);_0x44ba41[_0x2b65('0xc6')]=_[_0x2b65('0x5c')](_0x44ba41[_0x2b65('0x59')],_0x44ba41['query']);_0x500c80[_0x2b65('0x4b')]=_['intersection'](_0x44ba41[_0x2b65('0x59')],qs[_0x2b65('0x5d')](_0x2f8529['query']['fields']));_0x500c80[_0x2b65('0x4b')]=_0x500c80[_0x2b65('0x4b')]['length']?_0x500c80[_0x2b65('0x4b')]:_0x44ba41[_0x2b65('0x59')];_0x500c80[_0x2b65('0xc7')]=qs['sort'](_0x2f8529[_0x2b65('0x45')][_0x2b65('0xc8')]);_0x500c80[_0x2b65('0x44')]=qs[_0x2b65('0xc6')](_[_0x2b65('0xd0')](_0x2f8529[_0x2b65('0x45')],_0x44ba41[_0x2b65('0xc6')]));if(_0x2f8529[_0x2b65('0x45')][_0x2b65('0x32')]){_0x500c80['where']=_[_0x2b65('0x5e')](_0x500c80[_0x2b65('0x44')],{'$or':_[_0x2b65('0x33')](_0x500c80[_0x2b65('0x4b')],function(_0x4e761a){var _0x779681={};_0x779681[_0x4e761a]={'$like':'%'+_0x2f8529['query'][_0x2b65('0x32')]+'%'};return _0x779681;})});}_0x500c80=_['merge']({},_0x500c80,_0x2f8529[_0x2b65('0x5f')]);return _0x56926d[_0x2b65('0xe3')](_0x500c80);}})['then'](function(_0xb7a73c){if(_0xb7a73c){_0x183d21=_0xb7a73c[_0x2b65('0x50')];if(!_0x2f8529[_0x2b65('0x45')][_0x2b65('0xca')](_0x2b65('0xce'))){_0x500c80[_0x2b65('0x24')]=qs[_0x2b65('0x24')](_0x2f8529[_0x2b65('0x45')][_0x2b65('0x24')]);_0x500c80['offset']=qs[_0x2b65('0x22')](_0x2f8529[_0x2b65('0x45')]['offset']);}return _0x56926d[_0x2b65('0xe3')](_0x500c80);}})[_0x2b65('0x29')](function(_0x291eb0){if(_0x291eb0){return _0x291eb0?{'count':_0x183d21,'rows':_0x291eb0}:null;}})[_0x2b65('0x29')](respondWithResult(_0x2de642,null))['catch'](handleError(_0x2de642,null));};exports[_0x2b65('0xe4')]=function(_0x490d3a,_0x1e2354){var _0x27e8fb={};var _0x20b827={};var _0x2751de;var _0x2829e3;return db[_0x2b65('0x3c')][_0x2b65('0x9a')]({'where':{'id':_0x490d3a[_0x2b65('0x58')]['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x1e2354,null))[_0x2b65('0x29')](function(_0x100402){if(_0x100402){_0x2751de=_0x100402;_0x20b827['model']=_[_0x2b65('0x5b')](db['WhatsappInteraction'][_0x2b65('0x3d')]);_0x20b827[_0x2b65('0x45')]=_[_0x2b65('0x5b')](_0x490d3a[_0x2b65('0x45')]);_0x20b827[_0x2b65('0xc6')]=_['intersection'](_0x20b827[_0x2b65('0x59')],_0x20b827[_0x2b65('0x45')]);_0x27e8fb[_0x2b65('0x4b')]=_[_0x2b65('0x5c')](_0x20b827['model'],qs[_0x2b65('0x5d')](_0x490d3a['query'][_0x2b65('0x5d')]));_0x27e8fb['attributes']=_0x27e8fb[_0x2b65('0x4b')][_0x2b65('0x50')]?_0x27e8fb[_0x2b65('0x4b')]:_0x20b827[_0x2b65('0x59')];_0x27e8fb[_0x2b65('0xc7')]=qs[_0x2b65('0xc8')](_0x490d3a[_0x2b65('0x45')]['sort']);_0x27e8fb[_0x2b65('0x44')]=qs[_0x2b65('0xc6')](_[_0x2b65('0xd0')](_0x490d3a[_0x2b65('0x45')],_0x20b827[_0x2b65('0xc6')]));if(_0x490d3a[_0x2b65('0x45')][_0x2b65('0x32')]){_0x27e8fb[_0x2b65('0x44')]=_[_0x2b65('0x5e')](_0x27e8fb['where'],{'$or':_[_0x2b65('0x33')](_0x27e8fb[_0x2b65('0x4b')],function(_0x190705){var _0x2d1bbf={};_0x2d1bbf[_0x190705]={'$like':'%'+_0x490d3a[_0x2b65('0x45')][_0x2b65('0x32')]+'%'};return _0x2d1bbf;})});}_0x27e8fb=_[_0x2b65('0x5e')]({},_0x27e8fb,_0x490d3a[_0x2b65('0x5f')]);return _0x2751de[_0x2b65('0xe4')](_0x27e8fb);}})[_0x2b65('0x29')](function(_0x1dde6f){if(_0x1dde6f){_0x2829e3=_0x1dde6f[_0x2b65('0x50')];if(!_0x490d3a[_0x2b65('0x45')][_0x2b65('0xca')]('nolimit')){_0x27e8fb[_0x2b65('0x24')]=qs[_0x2b65('0x24')](_0x490d3a['query'][_0x2b65('0x24')]);_0x27e8fb[_0x2b65('0x22')]=qs[_0x2b65('0x22')](_0x490d3a['query']['offset']);}return _0x2751de[_0x2b65('0xe4')](_0x27e8fb);}})[_0x2b65('0x29')](function(_0x3c74f0){if(_0x3c74f0){return _0x3c74f0?{'count':_0x2829e3,'rows':_0x3c74f0}:null;}})['then'](respondWithResult(_0x1e2354,null))[_0x2b65('0x1e')](handleError(_0x1e2354,null));};exports[_0x2b65('0xe5')]=function(_0x479aac,_0x1e67e6,_0x3fec49){var _0x412317;var _0x4dfa78;var _0x193f46;var _0x475802=!_[_0x2b65('0x6c')](_0x479aac['params']['id'])?_0x479aac[_0x2b65('0x58')]['id']:!_['isNil'](_0x479aac[_0x2b65('0x2f')]['id'])?_0x479aac[_0x2b65('0x2f')]['id']:null;return db[_0x2b65('0x3c')][_0x2b65('0x64')]({'where':{'id':_0x475802,'role':{'$or':[_0x2b65('0x2d'),_0x2b65('0x2f'),_0x2b65('0x30')]}},'attributes':['id',_0x2b65('0x36'),_0x2b65('0xe6'),_0x2b65('0xe7'),_0x2b65('0x2c'),'internal','loginInPause']})[_0x2b65('0x29')](function(_0x4f1af1){if(_0x4f1af1){if(_0x4f1af1[_0x2b65('0x2c')]==='agent'){_0x412317=_0x4f1af1;if(_0x479aac[_0x2b65('0x62')][_0x2b65('0xa5')]){_0x193f46=util[_0x2b65('0xe8')]('LOCAL/%s@from-sip/n',_0x412317[_0x479aac['body'][_0x2b65('0xa5')]]);}else if(_0x479aac[_0x2b65('0x62')][_0x2b65('0xe9')]){_0x193f46=util['format'](_0x2b65('0xea'),_0x479aac['body'][_0x2b65('0xe9')]);}else{_0x193f46=util[_0x2b65('0xe8')]('SIP/%s',_0x412317[_0x2b65('0x36')]);}socket['to'](util['format'](_0x2b65('0xeb'),_0x412317[_0x2b65('0x36')]))[_0x2b65('0x2a')](_0x2b65('0xec'),{'user':{'id':_0x412317['id'],'name':_0x412317[_0x2b65('0x36')]},'ip':_0x479aac['headers'][_0x2b65('0xed')]||_0x479aac[_0x2b65('0xee')][_0x2b65('0xef')]||_0x479aac[_0x2b65('0xf0')]['remoteAddress']||_0x479aac[_0x2b65('0xee')][_0x2b65('0xf0')]['remoteAddress']});return db[_0x2b65('0xd4')][_0x2b65('0x38')]({'where':{'membername':_0x412317['name']},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x2b65('0x95'))](_0x2b65('0xf1'));}})[_0x2b65('0x29')](function(){if(_0x412317){return _0x412317[_0x2b65('0xf2')]({'raw':!![]});}})[_0x2b65('0x29')](function(_0x3a94d5){if(_0x412317){if(_0x3a94d5){_0x4dfa78=_0x3a94d5;if(_0x4dfa78[_0x2b65('0x50')]){var _0x566691=_0x4dfa78[_0x2b65('0x33')](function(_0x1c9d30){var _0x48de53={'membername':_0x412317[_0x2b65('0x36')],'UserId':_0x412317['id'],'queue_name':_0x1c9d30[_0x2b65('0x36')],'VoiceQueueId':_0x1c9d30['id'],'interface':_0x193f46,'paused':_0x412317['loginInPause']||![],'penalty':_0x1c9d30[_0x2b65('0xf3')]||0x0};return db[_0x2b65('0xd4')][_0x2b65('0xf4')](_0x48de53);});return Promise[_0x2b65('0x56')](_0x566691);}}}})[_0x2b65('0x29')](function(){if(_0x412317){return db['MemberReport'][_0x2b65('0x4d')]({'where':{'membername':_0x412317[_0x2b65('0x36')],'exitAt':null}});}})[_0x2b65('0x29')](function(_0x28d6d4){if(_0x412317){var _0x5cc528=[];_0x28d6d4[_0x2b65('0xf5')](function(_0x5613bc){_0x5cc528[_0x2b65('0x4c')](_0x5613bc[_0x2b65('0x28')]({'exitAt':moment()[_0x2b65('0xe8')](_0x2b65('0xf6'))}));});return Promise[_0x2b65('0x56')](_0x5cc528);}})['then'](function(){if(_0x412317){var _0x3d0100=[];var _0x5caf9b=[];var _0x16d952=utils['getChannels']();var _0x4502ac={'membername':_0x412317[_0x2b65('0x36')],'interface':_0x193f46,'enterAt':moment()['format'](_0x2b65('0xf6')),'role':_0x412317[_0x2b65('0x2c')],'internal':_0x412317[_0x2b65('0x68')]};_0x16d952['forEach'](function(_0x25d2b2){_0x3d0100[_0x2b65('0x4c')](_[_0x2b65('0x5e')]({'channel':_0x25d2b2,'type':_0x2b65('0xf7'),'data1':_0x479aac[_0x2b65('0x62')]['device'],'data2':_0x193f46},_0x4502ac));if(_0x412317[_0x2b65('0xa3')]){_0x5caf9b[_0x2b65('0x4c')](_[_0x2b65('0x5e')]({'channel':_0x25d2b2,'type':'PAUSE','data1':_0x2b65('0xf8')},_0x4502ac));}});return db[_0x2b65('0xf9')]['bulkCreate'](_0x3d0100[_0x2b65('0xfa')](_0x5caf9b),{'individualHooks':!![]});}})['then'](function(){if(_0x412317){return _0x412317[_0x2b65('0x28')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x412317[_0x2b65('0xa3')]||![],'mailPause':_0x412317[_0x2b65('0xa3')]||![],'chatPause':_0x412317[_0x2b65('0xa3')]||![],'faxPause':_0x412317[_0x2b65('0xa3')]||![],'smsPause':_0x412317[_0x2b65('0xa3')]||![],'openchannelPause':_0x412317[_0x2b65('0xa3')]||![],'whatsappPause':_0x412317[_0x2b65('0xa3')]||![],'pauseType':_0x412317[_0x2b65('0xa3')]?_0x2b65('0xf8'):null,'interface':_0x193f46,'lastPauseAt':moment()[_0x2b65('0xe8')](_0x2b65('0xf6'))});}})[_0x2b65('0x29')](function(_0x11c5bc){if(_0x479aac['isMiddleware']){return _0x3fec49();}else{return Promise['resolve'](_0x11c5bc)['then'](respondWithResult(_0x1e67e6,null));}})['catch'](handleError(_0x1e67e6,null));};exports[_0x2b65('0xfb')]=function(_0x969b60,_0x5780f7){var _0x42d257;return db[_0x2b65('0x3c')][_0x2b65('0x64')]({'where':{'id':_0x969b60['params']['id'],'role':_0x2b65('0x30')},'attributes':['id','name',_0x2b65('0x2c')]})[_0x2b65('0x29')](handleEntityNotFound(_0x5780f7,null))[_0x2b65('0x29')](function(_0x201a5b){if(_0x201a5b){_0x42d257=_0x201a5b;return db[_0x2b65('0xd4')][_0x2b65('0x38')]({'where':{'membername':_0x42d257[_0x2b65('0x36')]},'individualHooks':!![]});}})[_0x2b65('0x29')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x42d257[_0x2b65('0x36')],'exitAt':null}});})[_0x2b65('0x29')](function(_0x8dbdda){var _0x5aa210=[];_0x8dbdda[_0x2b65('0xf5')](function(_0x5c216b){_0x5aa210['push'](_0x5c216b[_0x2b65('0x28')]({'exitAt':moment()[_0x2b65('0xe8')](_0x2b65('0xf6'))}));});return Promise[_0x2b65('0x56')](_0x5aa210);})[_0x2b65('0x29')](function(){return _0x42d257[_0x2b65('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x2b65('0x29')](respondWithResult(_0x5780f7,null))[_0x2b65('0x1e')](handleError(_0x5780f7,null));};exports[_0x2b65('0xfc')]=function(_0x416162,_0x21ad04){var _0x789354;return db[_0x2b65('0xd4')]['update']({'paused':0x1},{'where':{'UserId':_0x416162[_0x2b65('0x58')]['id']},'individualHooks':!![]})[_0x2b65('0x29')](function(){return db[_0x2b65('0x3c')][_0x2b65('0x64')]({'where':{'id':_0x416162['params']['id'],'role':_0x2b65('0x30')},'attributes':['id',_0x2b65('0x36'),_0x2b65('0x2c'),_0x2b65('0x68'),_0x2b65('0xa5'),_0x2b65('0xa2')]});})[_0x2b65('0x29')](handleEntityNotFound(_0x21ad04,null))['then'](function(_0x1bce1d){if(_0x1bce1d){_0x789354=_0x1bce1d;return respondWithRpcPromise(_0x2b65('0xfd'),_0x2b65('0xfc'),{'id':_0x789354['id'],'name':_0x789354['name'],'pause':!![]});}})[_0x2b65('0x29')](function(){if(_0x789354){return db[_0x2b65('0xf9')][_0x2b65('0x4d')]({'where':{'membername':_0x789354[_0x2b65('0x36')],'type':_0x2b65('0xfe'),'exitAt':null}});}})['then'](function(_0x82767f){if(_0x82767f[_0x2b65('0x50')]){var _0x5b9cbf=moment()[_0x2b65('0xe8')](_0x2b65('0xf6'));for(var _0x57acbe=0x0,_0x481df5=_0x82767f['length'];_0x57acbe<_0x481df5;_0x57acbe++){_0x82767f[_0x57acbe]['updateAttributes']({'exitAt':_0x5b9cbf});}}})[_0x2b65('0x29')](function(){var _0x46370f=[];var _0x3ef993=utils[_0x2b65('0xff')]();_0x3ef993['forEach'](function(_0xc2a820){_0x46370f[_0x2b65('0x4c')]({'channel':_0xc2a820,'membername':_0x789354[_0x2b65('0x36')],'interface':_[_0x2b65('0x6c')](_0x789354[_0x2b65('0xa5')])?util[_0x2b65('0xe8')](_0x2b65('0xea'),_0x789354['name']):_0x789354['interface'],'type':_0x2b65('0xfe'),'enterAt':moment()[_0x2b65('0xe8')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x416162[_0x2b65('0x62')][_0x2b65('0x3f')]||'DEFAULT\x20PAUSE','role':_0x789354[_0x2b65('0x2c')],'internal':_0x789354[_0x2b65('0x68')]});});return db[_0x2b65('0xf9')][_0x2b65('0x100')](_0x46370f,{'individualHooks':!![]});})[_0x2b65('0x29')](function(){return _0x789354[_0x2b65('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x416162[_0x2b65('0x62')][_0x2b65('0x3f')]||_0x2b65('0x101'),'lastPauseAt':moment()[_0x2b65('0xe8')](_0x2b65('0xf6'))});})[_0x2b65('0x29')](respondWithResult(_0x21ad04,null))[_0x2b65('0x1e')](handleError(_0x21ad04,null));};exports['unpause']=function(_0x144dbc,_0xedd2d0){if(_0x144dbc[_0x2b65('0x62')][_0x2b65('0xb1')]&&!utils[_0x2b65('0xa6')](_0x144dbc[_0x2b65('0x62')][_0x2b65('0xb1')])){throw new APIBadRequestError(util[_0x2b65('0xe8')](_0x2b65('0x102'),_0x144dbc[_0x2b65('0x62')][_0x2b65('0xb1')]));}return db[_0x2b65('0x3c')][_0x2b65('0x64')]({'where':{'id':_0x144dbc[_0x2b65('0x58')]['id']},'attributes':['id','name','role',_0x2b65('0x68'),'interface',_0x2b65('0xa2'),_0x2b65('0xa4'),_0x2b65('0x103'),_0x2b65('0x104'),_0x2b65('0x105'),_0x2b65('0x106'),_0x2b65('0x107'),_0x2b65('0x108'),'pauseType',_0x2b65('0x109')]})[_0x2b65('0x29')](function(_0x4cf12f){if(!_0x4cf12f){throw new APINotFoundError(util[_0x2b65('0xe8')]('User\x20with\x20id\x20%s\x20not\x20found',_0x144dbc[_0x2b65('0x58')]['id']));}return _0x4cf12f['unpause'](_0x144dbc[_0x2b65('0x62')][_0x2b65('0xb1')]);})[_0x2b65('0x29')](respondWithResult(_0xedd2d0,null))[_0x2b65('0x1e')](APIHandleError(_0xedd2d0));};exports[_0x2b65('0x10a')]=function(_0x408c0a,_0x372f57){var _0x399466={};var _0x3f7e19={};var _0x2f1aa0;var _0x55fc7e;return db[_0x2b65('0x3c')][_0x2b65('0x9a')]({'where':{'id':_0x408c0a[_0x2b65('0x58')]['id']}})['then'](handleEntityNotFound(_0x372f57,null))[_0x2b65('0x29')](function(_0x4229bb){if(_0x4229bb){_0x2f1aa0=_0x4229bb;_0x3f7e19[_0x2b65('0x59')]=_[_0x2b65('0x5b')](db['Team'][_0x2b65('0x3d')]);_0x3f7e19['query']=_[_0x2b65('0x5b')](_0x408c0a['query']);_0x3f7e19[_0x2b65('0xc6')]=_[_0x2b65('0x5c')](_0x3f7e19['model'],_0x3f7e19[_0x2b65('0x45')]);_0x399466['attributes']=_[_0x2b65('0x5c')](_0x3f7e19['model'],qs[_0x2b65('0x5d')](_0x408c0a[_0x2b65('0x45')][_0x2b65('0x5d')]));_0x399466[_0x2b65('0x4b')]=_0x399466[_0x2b65('0x4b')]['length']?_0x399466[_0x2b65('0x4b')]:_0x3f7e19['model'];_0x399466[_0x2b65('0xc7')]=qs[_0x2b65('0xc8')](_0x408c0a[_0x2b65('0x45')][_0x2b65('0xc8')]);_0x399466['where']=qs[_0x2b65('0xc6')](_[_0x2b65('0xd0')](_0x408c0a[_0x2b65('0x45')],_0x3f7e19[_0x2b65('0xc6')]));if(_0x408c0a[_0x2b65('0x45')]['filter']){_0x399466[_0x2b65('0x44')]=_[_0x2b65('0x5e')](_0x399466[_0x2b65('0x44')],{'$or':_['map'](_0x399466[_0x2b65('0x4b')],function(_0x3dcbd1){var _0x3d52ec={};_0x3d52ec[_0x3dcbd1]={'$like':'%'+_0x408c0a[_0x2b65('0x45')]['filter']+'%'};return _0x3d52ec;})});}_0x399466=_[_0x2b65('0x5e')]({},_0x399466,_0x408c0a['options']);return _0x2f1aa0[_0x2b65('0x10a')](_0x399466);}})[_0x2b65('0x29')](function(_0x1132db){if(_0x1132db){_0x55fc7e=_0x1132db[_0x2b65('0x50')];if(!_0x408c0a[_0x2b65('0x45')]['hasOwnProperty'](_0x2b65('0xce'))){_0x399466[_0x2b65('0x24')]=qs['limit'](_0x408c0a[_0x2b65('0x45')][_0x2b65('0x24')]);_0x399466[_0x2b65('0x22')]=qs[_0x2b65('0x22')](_0x408c0a[_0x2b65('0x45')][_0x2b65('0x22')]);}return _0x2f1aa0[_0x2b65('0x10a')](_0x399466);}})[_0x2b65('0x29')](function(_0x297320){if(_0x297320){return _0x297320?{'count':_0x55fc7e,'rows':_0x297320}:null;}})[_0x2b65('0x29')](respondWithResult(_0x372f57,null))[_0x2b65('0x1e')](handleError(_0x372f57,null));};exports[_0x2b65('0x10b')]=function(_0x21e79f,_0x50d13b){var _0x52688a=_0x21e79f['params']['id'];var _0x44efca=_0x21e79f['body']?_0x21e79f['body']['ids']:null;var _0x16144e=[];return Promise[_0x2b65('0x10c')]()[_0x2b65('0x29')](function(){if(!_0x44efca)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x2b65('0x29')](function(){return db[_0x2b65('0x3c')][_0x2b65('0x9a')]({'where':{'id':_0x52688a}});})[_0x2b65('0x29')](function(_0x3a97cf){if(!_0x3a97cf)throw new APINotFoundError(util[_0x2b65('0xe8')](_0x2b65('0x10d'),_0x21e79f[_0x2b65('0x58')]['id']));return db['sequelize'][_0x2b65('0x10e')](function(_0x11c136){return _0x3a97cf[_0x2b65('0x10b')](_0x44efca,{'transaction':_0x11c136})[_0x2b65('0x29')](function(){return db['Team'][_0x2b65('0x4d')]({'where':{'id':{'$in':_0x44efca}}});})[_0x2b65('0x29')](function(_0x9d7c1a){var _0x1ec570=_[_0x2b65('0x33')](_0x9d7c1a,function(_0x3c139c){return _0x3c139c[_0x2b65('0x10f')]();});return Promise['all'](_0x1ec570);})[_0x2b65('0x29')](function(_0x54d8d1){_0x16144e=_[_0x2b65('0x110')](_0x54d8d1);var _0x4537fa=_[_0x2b65('0x33')](_0x16144e,function(_0x24ec20){return _0x24ec20['addAgent'](_0x3a97cf['id'],{'transaction':_0x11c136});});return Promise[_0x2b65('0x56')](_0x4537fa);})['then'](function(){if(!_0x3a97cf['online'])return;var _0x1890fd=_[_0x2b65('0x32')](_0x16144e,function(_0x1e766f){return _0x1e766f[_0x2b65('0x111')](_0x2b65('0xb1'))===_0x2b65('0x112');});var _0x2f6604=_[_0x2b65('0x33')](_0x1890fd,function(_0x3f5e91){return db[_0x2b65('0xd4')][_0x2b65('0xf4')]({'membername':_0x3a97cf['name'],'UserId':_0x3a97cf['id'],'queue_name':_0x3f5e91[_0x2b65('0x36')],'VoiceQueueId':_0x3f5e91['id'],'interface':_[_0x2b65('0x6c')](_0x3a97cf[_0x2b65('0xa5')])?util[_0x2b65('0xe8')]('SIP/%s',_0x3a97cf['name']):_0x3a97cf['interface'],'paused':_0x3a97cf[_0x2b65('0xa4')]||![],'penalty':_0x3a97cf['penalty']},{'transaction':_0x11c136});});return Promise[_0x2b65('0x56')](_0x2f6604);})[_0x2b65('0x29')](function(){return db[_0x2b65('0x113')][_0x2b65('0x4d')]({'where':{'teamId':{'$in':_0x44efca}}});})['then'](function(_0x47fdbb){var _0x1b0433=_[_0x2b65('0x33')](_0x47fdbb,function(_0x5bcba0){return db[_0x2b65('0x114')]['create']({'UserId':_0x3a97cf['id'],'VoicePrefixId':_0x5bcba0['VoicePrefixId']},{'transaction':_0x11c136});});return Promise['all'](_0x1b0433);});});})[_0x2b65('0x29')](function(){for(var _0x1c4482=0x0;_0x1c4482<_0x16144e[_0x2b65('0x50')];_0x1c4482++){var _0x1e4a19=_0x16144e[_0x1c4482][_0x2b65('0x111')](_0x2b65('0xb1'));var _0x2dbb87=_0x1e4a19+_0x2b65('0xac');socket[_0x2b65('0x2a')](_0x2b65('0x2f')+_0x1e4a19+_0x2b65('0x115'),{'UserId':_0x52688a,['queueField']:_0x16144e[_0x1c4482]['id']});}})[_0x2b65('0x29')](respondWithStatusCode(_0x50d13b,null))[_0x2b65('0x1e')](APIHandleError(_0x50d13b));};exports[_0x2b65('0x116')]=function(_0x5a809e,_0x5c9007){var _0x516d01=_0x5a809e[_0x2b65('0x58')]['id'];var _0x524412=null;if(_0x5a809e[_0x2b65('0x45')][_0x2b65('0x66')]){_0x524412=_[_0x2b65('0x117')](_0x5a809e[_0x2b65('0x45')]['ids'])?_0x5a809e['query'][_0x2b65('0x66')]:[_0x5a809e[_0x2b65('0x45')]['ids']];}var _0x562e7e=[];return Promise[_0x2b65('0x10c')]()['then'](function(){if(!_0x524412)throw new APIBadRequestError(_0x2b65('0x118'));})[_0x2b65('0x29')](function(){return db['User'][_0x2b65('0x9a')]({'where':{'id':_0x516d01}});})['then'](function(_0x2c2b9d){if(!_0x2c2b9d)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x5a809e[_0x2b65('0x58')]['id']));return db[_0x2b65('0x119')][_0x2b65('0x10e')](function(_0x430edf){return _0x2c2b9d[_0x2b65('0x116')](_0x524412,{'transaction':_0x430edf})['then'](function(){return db['Team'][_0x2b65('0x4d')]({'where':{'id':{'$in':_0x524412}}});})[_0x2b65('0x29')](function(_0x1a7702){var _0x5dcbf2=_['map'](_0x1a7702,function(_0x3f7e4e){return _0x3f7e4e[_0x2b65('0x10f')]();});return Promise[_0x2b65('0x56')](_0x5dcbf2);})[_0x2b65('0x29')](function(_0x45d095){_0x562e7e=_['flattenDeep'](_0x45d095);var _0x51292d=_[_0x2b65('0x33')](_0x562e7e,function(_0x229beb){return _0x229beb[_0x2b65('0x11a')](_0x2c2b9d['id'],{'transaction':_0x430edf});});return Promise['all'](_0x51292d);})['then'](function(){if(!_0x2c2b9d['online'])return;var _0x58b801=_[_0x2b65('0x32')](_0x562e7e,function(_0x176497){return _0x176497[_0x2b65('0x111')](_0x2b65('0xb1'))===_0x2b65('0x112');});var _0x458ebd=_[_0x2b65('0x33')](_0x58b801,function(_0x1dd938){return db[_0x2b65('0xd4')][_0x2b65('0x38')]({'where':{'VoiceQueueId':_0x1dd938['id'],'UserId':_0x2c2b9d['id']},'transaction':_0x430edf});});return Promise[_0x2b65('0x56')](_0x458ebd);})[_0x2b65('0x29')](function(){return db[_0x2b65('0x113')][_0x2b65('0x4d')]({'where':{'teamId':{'$in':_0x524412}}});})[_0x2b65('0x29')](function(_0x530aa0){var _0x4176d7=_[_0x2b65('0x33')](_0x530aa0,function(_0x465ea2){return db[_0x2b65('0x114')][_0x2b65('0x38')]({'where':{'UserId':_0x2c2b9d['id'],'VoicePrefixId':_0x465ea2[_0x2b65('0x11b')]}},{'transaction':_0x430edf});});return Promise[_0x2b65('0x56')](_0x4176d7);});});})[_0x2b65('0x29')](function(){for(var _0x16d9fe=0x0;_0x16d9fe<_0x562e7e[_0x2b65('0x50')];_0x16d9fe++){var _0x51a2c7=_0x562e7e[_0x16d9fe][_0x2b65('0x111')](_0x2b65('0xb1'));var _0x4a913a=_0x51a2c7+'QueueId';socket[_0x2b65('0x2a')](_0x2b65('0x2f')+_0x51a2c7+'Queue:remove',{'UserId':_0x516d01,['queueField']:_0x562e7e[_0x16d9fe]['id']});}})[_0x2b65('0x29')](respondWithStatusCode(_0x5c9007,null))[_0x2b65('0x1e')](APIHandleError(_0x5c9007));};exports['getLists']=function(_0x34c351,_0x21adc8){var _0x174c9e={};var _0x496595={};var _0x4c8219;var _0x3d5799;return db[_0x2b65('0x3c')][_0x2b65('0x9a')]({'where':{'id':_0x34c351[_0x2b65('0x58')]['id']}})['then'](handleEntityNotFound(_0x21adc8,null))[_0x2b65('0x29')](function(_0x2275e6){if(_0x2275e6){_0x4c8219=_0x2275e6;_0x496595['model']=_[_0x2b65('0x5b')](db[_0x2b65('0x11c')]['rawAttributes']);_0x496595[_0x2b65('0x45')]=_[_0x2b65('0x5b')](_0x34c351[_0x2b65('0x45')]);_0x496595['filters']=_[_0x2b65('0x5c')](_0x496595[_0x2b65('0x59')],_0x496595[_0x2b65('0x45')]);_0x174c9e[_0x2b65('0x4b')]=_[_0x2b65('0x5c')](_0x496595[_0x2b65('0x59')],qs[_0x2b65('0x5d')](_0x34c351['query'][_0x2b65('0x5d')]));_0x174c9e[_0x2b65('0x4b')]=_0x174c9e['attributes']['length']?_0x174c9e['attributes']:_0x496595[_0x2b65('0x59')];_0x174c9e[_0x2b65('0xc7')]=qs['sort'](_0x34c351['query'][_0x2b65('0xc8')]);_0x174c9e['where']=qs[_0x2b65('0xc6')](_['pick'](_0x34c351[_0x2b65('0x45')],_0x496595[_0x2b65('0xc6')]));if(_0x34c351[_0x2b65('0x45')]['filter']){_0x174c9e[_0x2b65('0x44')]=_[_0x2b65('0x5e')](_0x174c9e[_0x2b65('0x44')],{'$or':_['map'](_0x174c9e[_0x2b65('0x4b')],function(_0x189b0d){var _0x3f2761={};_0x3f2761[_0x189b0d]={'$like':'%'+_0x34c351['query'][_0x2b65('0x32')]+'%'};return _0x3f2761;})});}_0x174c9e=_[_0x2b65('0x5e')]({},_0x174c9e,_0x34c351['options']);return _0x4c8219['getLists'](_0x174c9e);}})[_0x2b65('0x29')](function(_0x47cd78){if(_0x47cd78){_0x3d5799=_0x47cd78['length'];if(!_0x34c351[_0x2b65('0x45')][_0x2b65('0xca')](_0x2b65('0xce'))){_0x174c9e[_0x2b65('0x24')]=qs[_0x2b65('0x24')](_0x34c351[_0x2b65('0x45')][_0x2b65('0x24')]);_0x174c9e[_0x2b65('0x22')]=qs[_0x2b65('0x22')](_0x34c351[_0x2b65('0x45')]['offset']);}return _0x4c8219[_0x2b65('0x11d')](_0x174c9e);}})[_0x2b65('0x29')](function(_0x6e531e){if(_0x6e531e){return _0x6e531e?{'count':_0x3d5799,'rows':_0x6e531e}:null;}})[_0x2b65('0x29')](respondWithResult(_0x21adc8,null))[_0x2b65('0x1e')](handleError(_0x21adc8,null));};exports[_0x2b65('0x11e')]=function(_0x2ca6bb,_0x95d164){var _0x4b2565={};var _0x1948f1={};var _0x4a5fab;return db[_0x2b65('0x3c')]['findOne']({'where':{'id':_0x2ca6bb[_0x2b65('0x58')]['id']}})[_0x2b65('0x29')](handleEntityNotFound(_0x95d164,null))[_0x2b65('0x29')](function(_0x41feb0){if(_0x41feb0){_0x4a5fab=_0x41feb0;_0x1948f1['model']=_[_0x2b65('0x5b')](db[_0x2b65('0x3c')][_0x2b65('0x3d')]);_0x1948f1[_0x2b65('0x45')]=_['keys'](_0x2ca6bb['query']);_0x1948f1['filters']=_[_0x2b65('0x5c')](_0x1948f1[_0x2b65('0x59')],_0x1948f1['query']);_0x4b2565['attributes']=_[_0x2b65('0x5c')](_0x1948f1[_0x2b65('0x59')],qs[_0x2b65('0x5d')](_0x2ca6bb['query'][_0x2b65('0x5d')]));_0x4b2565[_0x2b65('0x4b')]=_0x4b2565['attributes'][_0x2b65('0x50')]?_0x4b2565[_0x2b65('0x4b')]:_0x1948f1['model'];_0x4b2565[_0x2b65('0xc7')]=qs[_0x2b65('0xc8')](_0x2ca6bb[_0x2b65('0x45')]['sort']);_0x4b2565[_0x2b65('0x44')]=qs[_0x2b65('0xc6')](_[_0x2b65('0xd0')](_0x2ca6bb['query'],_0x1948f1[_0x2b65('0xc6')]));if(_0x2ca6bb[_0x2b65('0x45')]['filter']){_0x4b2565[_0x2b65('0x44')]=_[_0x2b65('0x5e')](_0x4b2565[_0x2b65('0x44')],{'$or':_[_0x2b65('0x33')](_0x4b2565['attributes'],function(_0x3634a6){var _0x2d3e14={};_0x2d3e14[_0x3634a6]={'$like':'%'+_0x2ca6bb[_0x2b65('0x45')][_0x2b65('0x32')]+'%'};return _0x2d3e14;})});}_0x4b2565['model']=db[_0x2b65('0x3c')];_0x4b2565['as']=_0x2b65('0x89');_0x4b2565=_[_0x2b65('0x5e')]({},_0x4b2565,_0x2ca6bb[_0x2b65('0x5f')]);return _0x4a5fab[_0x2b65('0xf2')]({'include':[_0x4b2565]});}})['then'](function(_0x484583){if(_0x484583){var _0x160672={},_0x1fc300=[];for(var _0x65bd45=0x0;_0x65bd45<_0x484583[_0x2b65('0x50')];_0x65bd45+=0x1){for(var _0x432d71=0x0,_0xf760e6;_0x432d71<_0x484583[_0x65bd45][_0x2b65('0x89')]['length'];_0x432d71+=0x1){_0xf760e6=_0x484583[_0x65bd45][_0x2b65('0x89')][_0x432d71][_0x2b65('0xae')]({'plain':!![]});_0x160672[_0xf760e6['id']]=_0xf760e6;}}_0x160672=_['values'](_0x160672);for(var _0x1bcae5=qs[_0x2b65('0x22')](_0x2ca6bb[_0x2b65('0x45')][_0x2b65('0x22')]);_0x1bcae5<_0x160672[_0x2b65('0x50')]&&_0x1fc300[_0x2b65('0x50')]=_0x53aeb1){_0x22fbe2=_0x53aeb1;_0x28b8bd=0xc8;}else{_0x28b8bd=0xce;}_0x592052[_0x5eda('0x22')](_0x28b8bd);return _0x592052['set']('Content-Range',_0x921b83+'-'+_0x22fbe2+'/'+_0x53aeb1)[_0x5eda('0x24')](_0x224391);}return null;};}function saveUpdates(_0xba6c09){return function(_0x54e21c){if(_0x54e21c){return _0x54e21c[_0x5eda('0x29')](_0xba6c09)['then'](function(_0x4e9dd5){socket['emit'](_0x5eda('0x2a')+_0x4e9dd5['id'],{});return _0x4e9dd5;});}return null;};}function removeEntity(_0x33e1ea){return function(_0x17d212){if(_0x17d212){return _0x17d212[_0x5eda('0x2b')]()['then'](function(){var _0x5bc4a3=_0x17d212['get']({'plain':!![]});if(_0x5bc4a3[_0x5eda('0x2c')]==='admin')return;var _0x2581b3=[{'name':_0x5eda('0x2d'),'value':_0x5eda('0x2e'),'ignore':!![]},{'name':_0x5eda('0x2f'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0x5eda('0x30'),'ignore':![]}];var _0x1ad9d2=_(_0x2581b3)[_0x5eda('0x31')]('ignore')[_0x5eda('0x32')](_0x5eda('0x33'))[_0x5eda('0x33')]();if(_[_0x5eda('0x34')](_0x1ad9d2,_0x5bc4a3[_0x5eda('0x2c')])){return;}var _0x1b536f=_[_0x5eda('0x35')](_0x2581b3,[_0x5eda('0x33'),_0x5bc4a3[_0x5eda('0x2c')]])[_0x5eda('0x36')];return db[_0x5eda('0x37')][_0x5eda('0x2b')]({'where':{'type':_0x1b536f,'resourceId':_0x5bc4a3['id']}})['then'](function(){return _0x17d212;});})['then'](function(){_0x33e1ea[_0x5eda('0x22')](0xcc)[_0x5eda('0x23')]();});}};}function handleEntityNotFound(_0x3d0011){return function(_0x58ecf4){if(!_0x58ecf4){_0x3d0011['sendStatus'](0x194);}return _0x58ecf4;};}function handleError(_0x1e2141,_0x2c58c9){_0x2c58c9=_0x2c58c9||0x1f4;return function(_0x4cac47){logger[_0x5eda('0x1e')](_0x4cac47[_0x5eda('0x38')]);if(_0x4cac47['name']){delete _0x4cac47[_0x5eda('0x36')];}_0x1e2141[_0x5eda('0x22')](_0x2c58c9)[_0x5eda('0x39')](_0x4cac47);};}exports['index']=function(_0x29c1a8,_0x2b7b8e){var _0x2d4b2e={},_0x103233={'count':0x0,'rows':[]};var _0xbf957c=_(db[_0x5eda('0x3a')][_0x5eda('0x3b')])[_0x5eda('0x32')](function(_0x588beb){return{'name':_0x588beb[_0x5eda('0x3c')],'type':_0x588beb[_0x5eda('0x3d')][_0x5eda('0x3e')]};})['filter'](function(_0xf1bc3b){return!_[_0x5eda('0x34')]([_0x5eda('0x3f'),_0x5eda('0x40')],_0xf1bc3b[_0x5eda('0x36')]);})[_0x5eda('0x33')]();_0x2d4b2e=qs['getOptions'](_0xbf957c,_0x29c1a8);var _0xe5483={'where':_0x2d4b2e[_0x5eda('0x41')]};return db[_0x5eda('0x3a')][_0x5eda('0x28')](_0xe5483)[_0x5eda('0x42')](function(_0x9bdee9){_0x103233[_0x5eda('0x28')]=_0x9bdee9;if(_0x29c1a8[_0x5eda('0x43')]['includeAll']){_0x2d4b2e['include']=[{'all':!![]}];}if(_0x29c1a8[_0x5eda('0x43')]['userSetting']===_0x5eda('0x44')){_0x2d4b2e['include']=[{'model':db[_0x5eda('0x45')],'as':'userSetting'}];}if(!_[_0x5eda('0x34')](_0x2d4b2e[_0x5eda('0x46')],'id')){_0x2d4b2e[_0x5eda('0x46')]['push']('id');}return db[_0x5eda('0x3a')][_0x5eda('0x47')](_0x2d4b2e);})[_0x5eda('0x42')](function(_0x3408d5){_0x103233[_0x5eda('0x48')]=_0x3408d5;if(_0x29c1a8['query'][_0x5eda('0x49')]===_0x5eda('0x44')){var _0x5ecc11=[];for(var _0x665274=0x0;_0x665274<_0x103233[_0x5eda('0x48')]['length'];_0x665274++){_0x5ecc11[_0x5eda('0x4a')](get_open_tabs(_0x5eda('0x4b'),_0x103233['rows'][_0x665274][_0x5eda('0x4c')]));_0x5ecc11[_0x5eda('0x4a')](get_open_tabs('sms',_0x103233[_0x5eda('0x48')][_0x665274][_0x5eda('0x4c')]));_0x5ecc11[_0x5eda('0x4a')](get_open_tabs(_0x5eda('0x4d'),_0x103233[_0x5eda('0x48')][_0x665274]['dataValues']));_0x5ecc11[_0x5eda('0x4a')](get_open_tabs('mail',_0x103233[_0x5eda('0x48')][_0x665274][_0x5eda('0x4c')]));_0x5ecc11[_0x5eda('0x4a')](get_open_tabs(_0x5eda('0x4e'),_0x103233[_0x5eda('0x48')][_0x665274]['dataValues']));_0x5ecc11[_0x5eda('0x4a')](get_open_tabs(_0x5eda('0x4f'),_0x103233[_0x5eda('0x48')][_0x665274][_0x5eda('0x4c')]));}return Promise[_0x5eda('0x50')](_0x5ecc11)[_0x5eda('0x42')](function(){return _0x103233;});}else{return _0x103233;}})[_0x5eda('0x42')](respondWithFilteredResult(_0x2b7b8e,_0x2d4b2e))[_0x5eda('0x51')](handleError(_0x2b7b8e,null));};exports[_0x5eda('0x52')]=function(_0x1a0a6d,_0x45dea7){var _0x5a1b4c={'raw':![],'where':{'id':_0x1a0a6d[_0x5eda('0x53')]['id']}},_0x1127ce={};_0x1127ce[_0x5eda('0x54')]=_[_0x5eda('0x55')](_[_0x5eda('0x56')](db['User'][_0x5eda('0x3b')]),[_0x5eda('0x3f'),_0x5eda('0x40')]);_0x1127ce['query']=_[_0x5eda('0x56')](_0x1a0a6d[_0x5eda('0x43')]);_0x1127ce[_0x5eda('0x57')]=_[_0x5eda('0x58')](_0x1127ce[_0x5eda('0x54')],_0x1127ce[_0x5eda('0x43')]);_0x5a1b4c[_0x5eda('0x46')]=_[_0x5eda('0x58')](_0x1127ce[_0x5eda('0x54')],qs['fields'](_0x1a0a6d[_0x5eda('0x43')][_0x5eda('0x59')]));_0x5a1b4c[_0x5eda('0x46')]=_0x5a1b4c['attributes'][_0x5eda('0x5a')]?_0x5a1b4c[_0x5eda('0x46')]:_0x1127ce[_0x5eda('0x54')];if(_0x1a0a6d[_0x5eda('0x43')]['includeAll']){_0x5a1b4c[_0x5eda('0x5b')]=[{'all':!![]}];}if(_0x1a0a6d['query'][_0x5eda('0x5c')]===_0x5eda('0x44')){_0x5a1b4c[_0x5eda('0x5b')]=[{'model':db['UserSetting'],'as':_0x5eda('0x5c')}];}_0x5a1b4c=_[_0x5eda('0x5d')]({},_0x5a1b4c,_0x1a0a6d[_0x5eda('0x5e')]);if(!_[_0x5eda('0x34')](_0x5a1b4c[_0x5eda('0x46')],'id')){_0x5a1b4c[_0x5eda('0x46')][_0x5eda('0x4a')]('id');}return db[_0x5eda('0x3a')][_0x5eda('0x35')](_0x5a1b4c)[_0x5eda('0x42')](handleEntityNotFound(_0x45dea7,null))['then'](function(_0x3f4b75){var _0x28da7e=[];values=_0x3f4b75;if(_0x1a0a6d[_0x5eda('0x43')]['openTabs']===_0x5eda('0x44')){_0x28da7e[_0x5eda('0x4a')](get_open_tabs(_0x5eda('0x4b'),_0x3f4b75['dataValues']));_0x28da7e['push'](get_open_tabs(_0x5eda('0x5f'),_0x3f4b75[_0x5eda('0x4c')]));_0x28da7e[_0x5eda('0x4a')](get_open_tabs(_0x5eda('0x4e'),_0x3f4b75[_0x5eda('0x4c')]));_0x28da7e['push'](get_open_tabs(_0x5eda('0x4f'),_0x3f4b75['dataValues']));_0x28da7e[_0x5eda('0x4a')](get_open_tabs(_0x5eda('0x4d'),_0x3f4b75[_0x5eda('0x4c')]));_0x28da7e[_0x5eda('0x4a')](get_open_tabs('mail',_0x3f4b75[_0x5eda('0x4c')]));return Promise[_0x5eda('0x50')](_0x28da7e);}else{return values;}})['then'](function(){return values;})['then'](respondWithResult(_0x45dea7,null))['catch'](handleError(_0x45dea7,null));};exports[_0x5eda('0x29')]=function(_0x4c4a6a,_0x58f86e){if(_0x4c4a6a[_0x5eda('0x60')]['id']){delete _0x4c4a6a[_0x5eda('0x60')]['id'];}delete _0x4c4a6a['body'][_0x5eda('0x2c')];return db[_0x5eda('0x3a')][_0x5eda('0x35')]({'where':{'id':_0x4c4a6a[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x58f86e,null))['then'](saveUpdates(_0x4c4a6a['body'],null))[_0x5eda('0x42')](respondWithResult(_0x58f86e,null))[_0x5eda('0x51')](handleError(_0x58f86e,null));};exports['describe']=function(_0x4a340a,_0x491218){return db['User'][_0x5eda('0x61')]()[_0x5eda('0x42')](respondWithResult(_0x491218,null))[_0x5eda('0x51')](handleError(_0x491218,null));};exports[_0x5eda('0x62')]=function(_0x3fa80e,_0xb5360e){return db[_0x5eda('0x3a')][_0x5eda('0x35')]({'where':{'id':_0x3fa80e[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0xb5360e,null))[_0x5eda('0x42')](function(_0x5b8343){if(_0x5b8343){return _0x5b8343[_0x5eda('0x62')](_0x3fa80e['body'][_0x5eda('0x63')],_[_0x5eda('0x64')](_0x3fa80e[_0x5eda('0x60')],[_0x5eda('0x63'),'id'])||{});}})[_0x5eda('0x42')](respondWithResult(_0xb5360e,null))[_0x5eda('0x51')](handleError(_0xb5360e,null));};function validateUser(_0x3d3467){return new Promise(function(_0x289c9a,_0x8c3ec6){if(_0x3d3467['internal'])return _0x289c9a(_0x3d3467);return db[_0x5eda('0x65')][_0x5eda('0x66')](0x1)[_0x5eda('0x42')](function(_0x47e45d){if(_0x47e45d['securePassword'])authService[_0x5eda('0x67')](_0x3d3467[_0x5eda('0x3f')]);db[_0x5eda('0x3a')][_0x5eda('0x68')]('internal')[_0x5eda('0x42')](function(_0x59b714){if(_['isNil'](_0x59b714)){_0x3d3467[_0x5eda('0x69')]=_0x47e45d[_0x5eda('0x6a')]||0x1;return;}if(_[_0x5eda('0x6b')](_0x47e45d[_0x5eda('0x6a')])||_0x47e45d[_0x5eda('0x6a')]===_0x59b714){_0x3d3467[_0x5eda('0x69')]=_0x59b714+0x1;return;}if(_0x47e45d['min_internal']>_0x59b714){_0x3d3467[_0x5eda('0x69')]=_0x47e45d[_0x5eda('0x6a')];return;}return db['sequelize'][_0x5eda('0x43')](_0x5eda('0x6c'),{'type':db['sequelize'][_0x5eda('0x6d')][_0x5eda('0x6e')]})[_0x5eda('0x42')](function(_0x439031){if(_0x439031&&_0x439031['length']){for(var _0x2bec16=0x0,_0x5985aa=_0x439031[_0x5eda('0x5a')];_0x2bec16<_0x5985aa&&_[_0x5eda('0x6b')](_0x3d3467[_0x5eda('0x69')]);_0x2bec16++){if(_0x47e45d['min_internal']<=_0x439031[_0x2bec16][_0x5eda('0x6f')]){_0x3d3467[_0x5eda('0x69')]=_0x439031[_0x2bec16][_0x5eda('0x6f')];}else if(_0x47e45d[_0x5eda('0x6a')]>_0x439031[_0x2bec16]['from']&&_0x47e45d[_0x5eda('0x6a')]<=_0x439031[_0x2bec16]['to']){_0x3d3467['internal']=_0x47e45d[_0x5eda('0x6a')];}}}if(_[_0x5eda('0x6b')](_0x3d3467['internal'])){_0x3d3467[_0x5eda('0x69')]=_0x59b714+0x1;}return _0x289c9a(_0x3d3467);});});})[_0x5eda('0x51')](function(_0x80290d){_0x8c3ec6(_0x80290d);});});}function updateUser(_0x4369a2){return new Promise(function(_0x1d801b,_0x479725){try{if(_0x4369a2[_0x5eda('0x70')]){_0x4369a2[_0x5eda('0x71')]=_0x4369a2[_0x5eda('0x69')];_0x4369a2[_0x5eda('0x72')]={'mailbox':_0x4369a2['internal'],'password':_0x4369a2[_0x5eda('0x3f')],'fullname':_0x4369a2['fullname'],'email':_0x4369a2['email']};}if(_0x4369a2[_0x5eda('0x2c')]==='agent'){if(!_0x4369a2[_0x5eda('0x73')])_0x4369a2[_0x5eda('0x73')]=[_0x5eda('0x74'),_0x5eda('0x75'),_0x5eda('0x76'),'113',_0x5eda('0x77'),_0x5eda('0x78'),_0x5eda('0x79'),_0x5eda('0x7a'),_0x5eda('0x7b'),_0x5eda('0x7c'),_0x5eda('0x7d'),_0x5eda('0x7e'),_0x5eda('0x7f'),_0x5eda('0x80'),'115'];}_0x1d801b(_0x4369a2);}catch(_0x3608b3){_0x479725(_0x3608b3);}});}exports[_0x5eda('0x81')]=function(_0x1634e5,_0x1960ee){if(_0x1634e5[_0x5eda('0x2e')][_0x5eda('0x2c')]===_0x5eda('0x82'))throw new Error(_0x5eda('0x83'));if(_0x1634e5[_0x5eda('0x60')]['role']===_0x5eda('0x2e')&&_0x1634e5[_0x5eda('0x2e')][_0x5eda('0x2c')]!==_0x5eda('0x84')){throw new Error(_0x5eda('0x85'));}if(_0x1634e5[_0x5eda('0x60')][_0x5eda('0x2c')]===_0x5eda('0x84')&&_0x1634e5[_0x5eda('0x2e')][_0x5eda('0x2c')]!=='admin'){throw new Error(_0x5eda('0x86'));}return licenseUtil[_0x5eda('0x87')]([_0x1634e5['body']])[_0x5eda('0x42')](function(){return validateUser(_0x1634e5[_0x5eda('0x60')]);})[_0x5eda('0x42')](function(_0x3afd06){return updateUser(_0x3afd06)[_0x5eda('0x42')](function(_0x1cd809){if(_0x1cd809[_0x5eda('0x2c')]===_0x5eda('0x84')){_0x1cd809[_0x5eda('0x88')]=_0x1634e5[_0x5eda('0x2e')]['settingsEnabled'];delete _0x1cd809[_0x5eda('0x89')];}return _0x1cd809;});})['then'](function(_0x2fa81d){return db[_0x5eda('0x3a')][_0x5eda('0x81')](_0x2fa81d,{'include':[{'model':db['VoiceMail'],'as':_0x5eda('0x72')}]});})[_0x5eda('0x42')](function(_0x224720){if(_0x1634e5['body'][_0x5eda('0x2c')]===_0x5eda('0x2e'))return _0x224720;if(_0x1634e5[_0x5eda('0x2e')]['role']!==_0x5eda('0x2e'))return _0x224720;return db['UserProfileSection'][_0x5eda('0x35')]({'where':{'name':_0x224720[_0x5eda('0x2c')]===_0x5eda('0x82')?_0x5eda('0x2f'):_0x5eda('0x8a'),'userProfileId':_0x1634e5['user'][_0x5eda('0x89')]},'raw':!![]})[_0x5eda('0x42')](function(_0x43dd28){if(!_0x43dd28||_0x43dd28[_0x5eda('0x8b')]!=0x0)return _0x224720;return db[_0x5eda('0x37')]['create']({'name':_0x224720[_0x5eda('0x36')],'resourceId':_0x224720['id'],'type':_0x43dd28['name'],'sectionId':_0x43dd28['id']},{})[_0x5eda('0x42')](function(){return _0x224720;});})['catch'](function(_0x14e934){logger[_0x5eda('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14e934);throw _0x14e934;});})[_0x5eda('0x42')](respondWithResult(_0x1960ee,0xc9))[_0x5eda('0x51')](handleError(_0x1960ee,null));};exports[_0x5eda('0x8c')]=function(_0x5d9657,_0x37c182){var _0x20d2a5=_0x5d9657[_0x5eda('0x60')];var _0x3096b8=[];if(_0x5d9657[_0x5eda('0x2e')][_0x5eda('0x2c')]===_0x5eda('0x82'))throw new Error(_0x5eda('0x83'));if(_[_0x5eda('0x8d')](_0x20d2a5,[_0x5eda('0x2c'),_0x5eda('0x2e')])&&_0x5d9657[_0x5eda('0x2e')][_0x5eda('0x2c')]!==_0x5eda('0x84')){throw new Error(_0x5eda('0x85'));}if(_[_0x5eda('0x8d')](_0x20d2a5,['role','admin'])&&_0x5d9657[_0x5eda('0x2e')][_0x5eda('0x2c')]!==_0x5eda('0x84')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x20d2a5)[_0x5eda('0x42')](function(){return validateUser(_0x20d2a5[0x0]);})[_0x5eda('0x42')](function(){for(var _0x123d32=0x1;_0x123d32<_0x20d2a5[_0x5eda('0x5a')];_0x123d32++){var _0x4e01f1=_0x20d2a5[_0x123d32-0x1][_0x5eda('0x69')];if(!_0x20d2a5[_0x123d32][_0x5eda('0x69')])_0x20d2a5[_0x123d32][_0x5eda('0x69')]=_0x4e01f1+0x1;_0x3096b8[_0x5eda('0x4a')](validateUser(_0x20d2a5[_0x123d32]));}return Promise[_0x5eda('0x50')](_0x3096b8);})['then'](function(){_0x3096b8=[];for(var _0x55df2d=0x0;_0x55df2d<_0x20d2a5['length'];_0x55df2d++){_0x3096b8[_0x5eda('0x4a')](updateUser(_0x20d2a5[_0x55df2d]));}return Promise[_0x5eda('0x50')](_0x3096b8);})[_0x5eda('0x42')](function(){_0x3096b8=_0x20d2a5['map'](function(_0x54bcfa){return db[_0x5eda('0x3a')][_0x5eda('0x81')](_0x54bcfa,{'include':[{'model':db[_0x5eda('0x72')],'as':'VoiceMail'}]})[_0x5eda('0x42')](function(_0x185941){_0x54bcfa['id']=_0x185941['id'];return _0x54bcfa;});});return Promise[_0x5eda('0x50')](_0x3096b8);})['then'](function(_0x115179){if(_0x5d9657['body']['role']===_0x5eda('0x2e'))return _0x115179;if(_0x5d9657[_0x5eda('0x2e')][_0x5eda('0x2c')]!==_0x5eda('0x2e'))return _0x115179;var _0x30b8f4=_[_0x5eda('0x8d')](_0x115179,function(_0x2d6593){return _0x2d6593[_0x5eda('0x2c')]===_0x5eda('0x82')||_0x2d6593[_0x5eda('0x2c')]==='telephone';});if(!_0x30b8f4)return _0x115179;return db[_0x5eda('0x8e')][_0x5eda('0x47')]({'where':{'name':{'$or':['Agents',_0x5eda('0x8a')]},'userProfileId':_0x5d9657['user'][_0x5eda('0x89')]},'raw':!![]})[_0x5eda('0x42')](function(_0x4d7637){if(_['isEmpty'](_0x4d7637)||!_['some'](_0x4d7637,['autoAssociation',0x0]))return _0x115179;_0x3096b8=[];var _0x34b7a3=_(_0x4d7637)[_0x5eda('0x32')](function(_0x1d8e31){if(_0x1d8e31[_0x5eda('0x8b')]===0x1)return;return _0x1d8e31[_0x5eda('0x36')]==='Agents'?_0x5eda('0x82'):_0x5eda('0x30');})['compact']()['value']();for(var _0x1ba5c2=0x0;_0x1ba5c2<_0x115179[_0x5eda('0x5a')];_0x1ba5c2++){if(!_[_0x5eda('0x34')](_0x34b7a3,_0x115179[_0x1ba5c2][_0x5eda('0x2c')]))return;var _0x3fda39=_0x115179[_0x1ba5c2]['role']===_0x5eda('0x82')?_0x5eda('0x2f'):_0x5eda('0x8a');_0x3096b8[_0x5eda('0x4a')](db[_0x5eda('0x37')][_0x5eda('0x81')]({'name':_0x115179[_0x1ba5c2][_0x5eda('0x36')],'resourceId':_0x115179[_0x1ba5c2]['id'],'type':_0x3fda39,'sectionId':_[_0x5eda('0x35')](_0x4d7637,[_0x5eda('0x36'),_0x3fda39])['id']},{}));}return Promise[_0x5eda('0x50')](_0x3096b8);});})['then'](respondWithResult(_0x37c182,0xc9))['catch'](handleError(_0x37c182,null));};exports[_0x5eda('0x8f')]=function(_0x4b59cc,_0x2a186d){if(_0x4b59cc[_0x5eda('0x60')]['id']){delete _0x4b59cc[_0x5eda('0x60')]['id'];}return db[_0x5eda('0x3a')][_0x5eda('0x35')]({'where':{'id':_0x4b59cc['params']['id']}})[_0x5eda('0x42')](function(_0x2fea07){if(!_0x2fea07)return null;if(_0x2fea07['id']===_0x4b59cc[_0x5eda('0x2e')]['id']){if(!_0x4b59cc[_0x5eda('0x60')][_0x5eda('0x90')]||!_0x4b59cc[_0x5eda('0x60')][_0x5eda('0x91')]){throw new db['Sequelize'][(_0x5eda('0x92'))](_0x5eda('0x93'));}if(!_0x2fea07[_0x5eda('0x94')](_0x4b59cc[_0x5eda('0x60')]['oldPassword'])){throw new db['Sequelize'][(_0x5eda('0x92'))]('Wrong\x20credentials');}if(_0x4b59cc[_0x5eda('0x60')][_0x5eda('0x90')]===_0x4b59cc['body']['newPassword']){throw new db[(_0x5eda('0x95'))][(_0x5eda('0x92'))](_0x5eda('0x96'));}}else if(_0x4b59cc[_0x5eda('0x2e')][_0x5eda('0x2c')]===_0x5eda('0x84')){if(!_0x4b59cc[_0x5eda('0x60')][_0x5eda('0x91')]){throw new db['Sequelize'][(_0x5eda('0x92'))](_0x5eda('0x97'));}}else if(_0x4b59cc[_0x5eda('0x2e')][_0x5eda('0x2c')]===_0x5eda('0x2e')){if(!_0x4b59cc[_0x5eda('0x60')][_0x5eda('0x91')]){throw new db[(_0x5eda('0x95'))][(_0x5eda('0x92'))](_0x5eda('0x97'));}if(_0x2fea07[_0x5eda('0x2c')]!==_0x5eda('0x82')){throw new db[(_0x5eda('0x95'))][(_0x5eda('0x92'))](_0x5eda('0x83'));}}else{throw new db[(_0x5eda('0x95'))][(_0x5eda('0x92'))](_0x5eda('0x83'));}return _0x2fea07;})[_0x5eda('0x42')](handleEntityNotFound(_0x2a186d,null))[_0x5eda('0x42')](function(_0x114521){return db[_0x5eda('0x65')]['findOne']({'attributes':['id',_0x5eda('0x98'),_0x5eda('0x99'),_0x5eda('0x9a')]})['then'](function(_0x390bee){if(_0x390bee[_0x5eda('0x98')])authService[_0x5eda('0x67')](_0x4b59cc[_0x5eda('0x60')]['newPassword']);if(!_0x390bee[_0x5eda('0x99')]||!_0x114521[_0x5eda('0x9b')])return _0x114521;authService[_0x5eda('0x9c')](_0x4b59cc[_0x5eda('0x60')][_0x5eda('0x91')],_0x114521[_0x5eda('0x9b')],_0x390bee['passwordHistoryLimit']);return _0x114521;})[_0x5eda('0x42')](saveUpdates({'password':_0x4b59cc['body'][_0x5eda('0x91')],'passwordResetAt':_0x4b59cc['user']['id']==_0x4b59cc[_0x5eda('0x53')]['id']?moment():null,'previousPasswords':authService[_0x5eda('0x9d')](_0x4b59cc[_0x5eda('0x60')][_0x5eda('0x91')],_0x114521[_0x5eda('0x9b')])},null));})[_0x5eda('0x42')](respondWithResult(_0x2a186d,null))[_0x5eda('0x51')](handleError(_0x2a186d,null));};exports[_0x5eda('0x9e')]=function(_0x589461,_0x196aff){var _0x3e5cb8=_0x589461[_0x5eda('0x60')][_0x5eda('0x9f')];return db[_0x5eda('0x3a')][_0x5eda('0x35')]({'where':{'id':_0x589461[_0x5eda('0x53')]['id']},'attributes':['id',_0x5eda('0x36'),_0x5eda('0x2c'),'online',_0x5eda('0xa0'),_0x5eda('0xa1'),'interface']})[_0x5eda('0x42')](handleEntityNotFound(_0x196aff,null))[_0x5eda('0x42')](function(_0x13d477){if(_0x13d477){if(!utils[_0x5eda('0xa2')](_0x3e5cb8)){throw new db[(_0x5eda('0x95'))][(_0x5eda('0x92'))]('Unknown\x20channel');}return _0x13d477[_0x5eda('0xa3')+_[_0x5eda('0xa4')](_0x3e5cb8[_0x5eda('0xa5')]())+_0x5eda('0xa6')](_0x589461['body'][_0x5eda('0x63')],{'penalty':_0x589461['body'][_0x5eda('0xa7')]||0x0})[_0x5eda('0xa8')](function(_0x39ed31){for(var _0x38d497=0x0;_0x38d497<_0x589461[_0x5eda('0x60')][_0x5eda('0x63')][_0x5eda('0x5a')];_0x38d497+=0x1){var _0x4762f8={'UserId':Number(_0x589461['params']['id'])};_0x4762f8[_[_0x5eda('0xa4')](_0x3e5cb8[_0x5eda('0xa5')]())+'QueueId']=Number(_0x589461[_0x5eda('0x60')][_0x5eda('0x63')][_0x38d497]);socket[_0x5eda('0xa9')](_0x5eda('0x2e')+_['capitalize'](_0x3e5cb8[_0x5eda('0xa5')]())+_0x5eda('0xaa'),_0x4762f8);}return _0x39ed31;})[_0x5eda('0x42')](function(){if(_0x3e5cb8===_0x5eda('0xab')){return db[_0x5eda('0xac')][_0x5eda('0x47')]({'where':{'id':_0x589461['body'][_0x5eda('0x63')]||[]},'raw':!![],'attributes':['id',_0x5eda('0x36')]});}})[_0x5eda('0x42')](function(_0x2d84cd){var _0xa4be75=_0x13d477['get']({'plain':!![]});var _0x571990=[];if(_0x3e5cb8===_0x5eda('0xab')&&_0xa4be75[_0x5eda('0x2c')]==='agent'&&_0xa4be75[_0x5eda('0xad')]){for(let _0x6be34f=0x0;_0x6be34f<_0x2d84cd['length'];_0x6be34f+=0x1){_0x571990[_0x5eda('0x4a')]({'membername':_0xa4be75[_0x5eda('0x36')],'UserId':_0xa4be75['id'],'queue_name':_0x2d84cd[_0x6be34f][_0x5eda('0x36')],'VoiceQueueId':_0x2d84cd[_0x6be34f]['id'],'interface':_[_0x5eda('0x6b')](_0xa4be75[_0x5eda('0xae')])?util[_0x5eda('0xaf')](_0x5eda('0xb0'),_0xa4be75[_0x5eda('0x36')]):_0xa4be75[_0x5eda('0xae')],'paused':_0xa4be75['voicePause']||![],'penalty':_0x589461[_0x5eda('0x60')]['penalty']||0x0});}return Promise[_0x5eda('0x50')](_0x571990['map'](function(_0x1013e9){return db[_0x5eda('0xb1')]['upsert'](_0x1013e9);}));}return _0x13d477;});}})[_0x5eda('0x42')](respondWithStatusCode(_0x196aff,null))[_0x5eda('0x51')](handleError(_0x196aff,null));};exports[_0x5eda('0xb2')]=function(_0x556f44,_0x33a54e){var _0x7f8596,_0x770e1c;return db['User'][_0x5eda('0x35')]({'where':{'id':_0x556f44[_0x5eda('0x53')]['id']},'attributes':['id',_0x5eda('0x36'),'role']})[_0x5eda('0x42')](handleEntityNotFound(_0x33a54e,null))[_0x5eda('0x42')](function(_0x42def8){if(_0x42def8){_0x7f8596=_0x42def8;if(!_0x556f44[_0x5eda('0x43')][_0x5eda('0x9f')]||!utils[_0x5eda('0xa2')](_0x556f44[_0x5eda('0x43')][_0x5eda('0x9f')])){throw new db[(_0x5eda('0x95'))][(_0x5eda('0x92'))](_0x5eda('0xb3'));}return _0x42def8['remove'+_[_0x5eda('0xa4')](_0x556f44['query'][_0x5eda('0x9f')][_0x5eda('0xa5')]())+_0x5eda('0xa6')](_0x556f44[_0x5eda('0x43')][_0x5eda('0x63')]);}})[_0x5eda('0x42')](function(_0x5032b8){if(_['isArray'](_0x556f44['query'][_0x5eda('0x63')])){for(var _0x25bb35=0x0;_0x25bb35<_0x556f44[_0x5eda('0x43')][_0x5eda('0x63')]['length'];_0x25bb35+=0x1){_0x770e1c={'UserId':Number(_0x556f44['params']['id'])};_0x770e1c[_[_0x5eda('0xa4')](_0x556f44[_0x5eda('0x43')][_0x5eda('0x9f')]['toLowerCase']())+_0x5eda('0xb4')]=Number(_0x556f44['query'][_0x5eda('0x63')][_0x25bb35]);socket[_0x5eda('0xa9')]('user'+_['capitalize'](_0x556f44['query']['channel']['toLowerCase']())+'Queue:remove',_0x770e1c);}}else{_0x770e1c={'UserId':Number(_0x556f44[_0x5eda('0x53')]['id'])};_0x770e1c[_[_0x5eda('0xa4')](_0x556f44[_0x5eda('0x43')][_0x5eda('0x9f')]['toLowerCase']())+_0x5eda('0xb4')]=Number(_0x556f44[_0x5eda('0x43')]['ids']);socket[_0x5eda('0xa9')](_0x5eda('0x2e')+_[_0x5eda('0xa4')](_0x556f44['query'][_0x5eda('0x9f')][_0x5eda('0xa5')]())+_0x5eda('0xb5'),_0x770e1c);}return _0x5032b8;})[_0x5eda('0x42')](function(){if(_0x556f44[_0x5eda('0x43')]['channel']===_0x5eda('0xab')){return db['UserVoiceQueueRt'][_0x5eda('0x2b')]({'where':{'UserId':_0x556f44[_0x5eda('0x53')]['id'],'VoiceQueueId':_0x556f44[_0x5eda('0x43')][_0x5eda('0x63')]},'individualHooks':!![]})[_0x5eda('0x42')](function(){return _0x7f8596;});}return _0x7f8596;})[_0x5eda('0x42')](respondWithStatusCode(_0x33a54e,null))[_0x5eda('0x51')](handleError(_0x33a54e,null));};exports[_0x5eda('0xb6')]=function(_0x294143,_0x25bfa1){_0x294143[_0x5eda('0x60')][_0x5eda('0xb7')]=_0x294143[_0x5eda('0xb8')][_0x5eda('0xb9')];return db[_0x5eda('0x3a')][_0x5eda('0x35')]({'where':{'id':_0x294143[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x25bfa1,null))[_0x5eda('0x42')](saveUpdates(_0x294143[_0x5eda('0x60')],null))[_0x5eda('0x42')](respondWithResult(_0x25bfa1,null))[_0x5eda('0x51')](handleError(_0x25bfa1,null));};exports['getAvatar']=function(_0x3c1b4c,_0x454da7){var _0x405379=path['join'](config[_0x5eda('0xba')],_0x5eda('0xbb'));return db['User'][_0x5eda('0x35')]({'where':{'id':_0x3c1b4c[_0x5eda('0x53')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x454da7,null))[_0x5eda('0x42')](function(_0x246e5e){if(_0x246e5e){if(_[_0x5eda('0x6b')](_0x246e5e[_0x5eda('0xb7')])){return _0x454da7[_0x5eda('0xbc')](_0x405379);}else{if(!fs[_0x5eda('0xbd')](path[_0x5eda('0xbe')](config[_0x5eda('0xba')],_0x5eda('0xbf'),_0x246e5e['userpic']))){return _0x454da7['download'](_0x405379);}return _0x454da7[_0x5eda('0xbc')](path[_0x5eda('0xbe')](config[_0x5eda('0xba')],'server/files/images/',_0x246e5e[_0x5eda('0xb7')]));}}})[_0x5eda('0x51')](handleError(_0x454da7,null));};exports[_0x5eda('0xc0')]=function(_0x3e69b9,_0x4e2a8b){return db[_0x5eda('0x3a')][_0x5eda('0x35')]({'where':{'id':_0x3e69b9['params']['id']},'attributes':['id']})[_0x5eda('0x42')](handleEntityNotFound(_0x4e2a8b,null))['then'](function(_0x52a91b){var _0x3aafc3=[];values=_0x52a91b['dataValues'];_0x3aafc3['push'](get_open_tabs(_0x5eda('0x4b'),_0x52a91b[_0x5eda('0x4c')]));_0x3aafc3['push'](get_open_tabs(_0x5eda('0x5f'),_0x52a91b[_0x5eda('0x4c')]));_0x3aafc3[_0x5eda('0x4a')](get_open_tabs(_0x5eda('0x4e'),_0x52a91b[_0x5eda('0x4c')]));_0x3aafc3[_0x5eda('0x4a')](get_open_tabs(_0x5eda('0x4f'),_0x52a91b[_0x5eda('0x4c')]));_0x3aafc3[_0x5eda('0x4a')](get_open_tabs(_0x5eda('0x4d'),_0x52a91b[_0x5eda('0x4c')]));_0x3aafc3[_0x5eda('0x4a')](get_open_tabs(_0x5eda('0xc1'),_0x52a91b['dataValues']));return Promise[_0x5eda('0x50')](_0x3aafc3);})[_0x5eda('0x42')](function(_0x2885aa){if(_0x2885aa){var _0x336482=_[_0x5eda('0x32')](values[_0x5eda('0xc2')],function(_0x25e706){return{'channel':_0x5eda('0xc3'),'id':_0x25e706['id'],'createdAt':_0x25e706[_0x5eda('0xc4')]};});var _0x2e3838=_[_0x5eda('0x32')](values[_0x5eda('0xc5')],function(_0x2bead5){return{'channel':'FAX','id':_0x2bead5['id'],'createdAt':_0x2bead5[_0x5eda('0xc4')]};});var _0x289dc5=_[_0x5eda('0x32')](values[_0x5eda('0xc6')],function(_0x902ed5){return{'channel':_0x5eda('0xc7'),'id':_0x902ed5['id'],'createdAt':_0x902ed5['createdAt']};});var _0x5e8a0a=_['map'](values[_0x5eda('0xc8')],function(_0x517447){return{'channel':_0x5eda('0xc9'),'id':_0x517447['id'],'createdAt':_0x517447[_0x5eda('0xc4')]};});var _0x4b4254=_[_0x5eda('0x32')](values['SmsOpenTabs'],function(_0xda3d78){return{'channel':_0x5eda('0xca'),'id':_0xda3d78['id'],'createdAt':_0xda3d78[_0x5eda('0xc4')]};});var _0x7eb6f4=_['map'](values[_0x5eda('0xcb')],function(_0x1fc4a0){return{'channel':_0x5eda('0xcc'),'id':_0x1fc4a0['id'],'createdAt':_0x1fc4a0[_0x5eda('0xc4')]};});var _0x430b30=_['concat'](_0x336482,_0x2e3838,_0x289dc5,_0x5e8a0a,_0x4b4254,_0x7eb6f4);var _0x1de16a={'count':_0x430b30[_0x5eda('0x5a')],'rows':_0x430b30};return _0x1de16a;}else return null;})[_0x5eda('0x42')](respondWithResult(_0x4e2a8b,null))[_0x5eda('0x51')](handleError(_0x4e2a8b,null));};exports[_0x5eda('0xcd')]=function(_0x3c854e,_0x515cd6){var _0x4b2a76={};var _0x5106fe={};var _0x6d6dec;var _0x5b0ff3;return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x3c854e[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x515cd6,null))[_0x5eda('0x42')](function(_0x53dd42){if(_0x53dd42){_0x6d6dec=_0x53dd42;_0x5106fe[_0x5eda('0x54')]=_[_0x5eda('0x56')](db[_0x5eda('0xcf')]['rawAttributes']);_0x5106fe[_0x5eda('0x43')]=_[_0x5eda('0x56')](_0x3c854e[_0x5eda('0x43')]);_0x5106fe[_0x5eda('0x57')]=_['intersection'](_0x5106fe[_0x5eda('0x54')],_0x5106fe['query']);_0x4b2a76[_0x5eda('0x46')]=_['intersection'](_0x5106fe[_0x5eda('0x54')],qs[_0x5eda('0x59')](_0x3c854e[_0x5eda('0x43')]['fields']));_0x4b2a76['attributes']=_0x4b2a76[_0x5eda('0x46')][_0x5eda('0x5a')]?_0x4b2a76[_0x5eda('0x46')]:_0x5106fe[_0x5eda('0x54')];_0x4b2a76[_0x5eda('0xd0')]=qs[_0x5eda('0xd1')](_0x3c854e[_0x5eda('0x43')][_0x5eda('0xd1')]);_0x4b2a76[_0x5eda('0x41')]=qs[_0x5eda('0x57')](_['pick'](_0x3c854e[_0x5eda('0x43')],_0x5106fe[_0x5eda('0x57')]));if(_0x3c854e[_0x5eda('0x43')]['filter']){_0x4b2a76[_0x5eda('0x41')]=_[_0x5eda('0x5d')](_0x4b2a76['where'],{'$or':_[_0x5eda('0x32')](_0x4b2a76['attributes'],function(_0x275d9e){var _0x55fd04={};_0x55fd04[_0x275d9e]={'$like':'%'+_0x3c854e['query'][_0x5eda('0x31')]+'%'};return _0x55fd04;})});}_0x4b2a76=_[_0x5eda('0x5d')]({},_0x4b2a76,_0x3c854e['options']);return _0x6d6dec[_0x5eda('0xcd')](_0x4b2a76);}})[_0x5eda('0x42')](function(_0x3499d2){if(_0x3499d2){_0x5b0ff3=_0x3499d2[_0x5eda('0x5a')];if(_0x3c854e[_0x5eda('0x43')][_0x5eda('0xd2')](_0x5eda('0xd3'))){_0x4b2a76['include']=[{'model':db[_0x5eda('0xd4')],'as':_0x5eda('0xd5'),'required':![]},{'model':db[_0x5eda('0xd6')],'as':_0x5eda('0xd7'),'attributes':['id',_0x5eda('0x36'),'color'],'where':_0x3c854e['query'][_0x5eda('0xd8')]?{'id':_0x3c854e[_0x5eda('0x43')][_0x5eda('0xd8')]}:undefined,'required':_0x3c854e[_0x5eda('0x43')][_0x5eda('0xd8')]?!![]:![]}];}if(!_0x3c854e[_0x5eda('0x43')][_0x5eda('0xd2')]('nolimit')){_0x4b2a76[_0x5eda('0x27')]=qs['limit'](_0x3c854e['query'][_0x5eda('0x27')]);_0x4b2a76[_0x5eda('0x25')]=qs[_0x5eda('0x25')](_0x3c854e[_0x5eda('0x43')][_0x5eda('0x25')]);}return _0x6d6dec[_0x5eda('0xcd')](_0x4b2a76);}})[_0x5eda('0x42')](function(_0x3e1669){if(_0x3e1669){return _0x3e1669?{'count':_0x5b0ff3,'rows':_0x3e1669}:null;}})[_0x5eda('0x42')](respondWithResult(_0x515cd6,null))[_0x5eda('0x51')](handleError(_0x515cd6,null));};exports[_0x5eda('0xd9')]=function(_0x30ba77,_0x50685d){var _0x2b9eb2;var _0x1df13a={};var _0x1fb612;return db[_0x5eda('0x3a')]['findOne']({'where':{'id':_0x30ba77[_0x5eda('0x53')]['id']},'attributes':['id','name',_0x5eda('0x2c')]})[_0x5eda('0x42')](handleEntityNotFound(_0x50685d,null))['then'](function(_0x25260e){if(!utils[_0x5eda('0xa2')](_0x30ba77['query'][_0x5eda('0x9f')])){throw new db[(_0x5eda('0x95'))]['ValidationError'](_0x5eda('0xb3'));}_0x2b9eb2=_0x25260e;var _0x7e668={};_0x7e668['model']=_[_0x5eda('0x56')](db[_['capitalize'](_0x30ba77[_0x5eda('0x43')][_0x5eda('0x9f')])+_0x5eda('0xda')][_0x5eda('0x3b')]);_0x7e668['query']=_['keys'](_0x30ba77['query']);_0x7e668[_0x5eda('0x57')]=_[_0x5eda('0x58')](_0x7e668[_0x5eda('0x54')],_0x7e668['query']);_0x1df13a[_0x5eda('0x46')]=_[_0x5eda('0x58')](_0x7e668['model'],qs[_0x5eda('0x59')](_0x30ba77[_0x5eda('0x43')][_0x5eda('0x59')]));_0x1df13a[_0x5eda('0x46')]=_0x1df13a['attributes']['length']?_0x1df13a[_0x5eda('0x46')]:_0x7e668[_0x5eda('0x54')];_0x1df13a[_0x5eda('0xd0')]=qs[_0x5eda('0xd1')](_0x30ba77[_0x5eda('0x43')][_0x5eda('0xd1')]);_0x1df13a[_0x5eda('0x41')]=qs[_0x5eda('0x57')](_[_0x5eda('0xdb')](_0x30ba77[_0x5eda('0x43')],_0x7e668[_0x5eda('0x57')]));if(_0x30ba77[_0x5eda('0x43')][_0x5eda('0x31')]){_0x1df13a[_0x5eda('0x41')]=_['merge'](_0x1df13a[_0x5eda('0x41')],{'$or':_[_0x5eda('0x32')](_0x1df13a[_0x5eda('0x46')],function(_0xc0f0c3){var _0x383051={};_0x383051[_0xc0f0c3]={'$like':'%'+_0x30ba77[_0x5eda('0x43')]['filter']+'%'};return _0x383051;})});}_0x1df13a=_[_0x5eda('0x5d')]({},_0x1df13a,_0x30ba77[_0x5eda('0x5e')]);switch(_0x2b9eb2['role']){case _0x5eda('0x84'):return db[_[_0x5eda('0xa4')](_0x30ba77[_0x5eda('0x43')]['channel'])+_0x5eda('0xda')][_0x5eda('0x47')](_0x1df13a);case _0x5eda('0x2e'):case _0x5eda('0x82'):return _0x2b9eb2[_0x5eda('0xdc')+_['capitalize'](_0x30ba77[_0x5eda('0x43')][_0x5eda('0x9f')])+_0x5eda('0xa6')](_0x1df13a);default:throw new db[(_0x5eda('0x95'))][(_0x5eda('0x92'))](_0x5eda('0xdd'));}})[_0x5eda('0x42')](function(_0x2a2932){_0x1fb612=_0x2a2932[_0x5eda('0x5a')];if(!_0x30ba77[_0x5eda('0x43')][_0x5eda('0xd2')]('nolimit')){_0x1df13a['limit']=qs[_0x5eda('0x27')](_0x30ba77[_0x5eda('0x43')][_0x5eda('0x27')]);_0x1df13a[_0x5eda('0x25')]=qs[_0x5eda('0x25')](_0x30ba77[_0x5eda('0x43')][_0x5eda('0x25')]);}switch(_0x2b9eb2['role']){case _0x5eda('0x84'):return db[_[_0x5eda('0xa4')](_0x30ba77[_0x5eda('0x43')][_0x5eda('0x9f')])+_0x5eda('0xda')][_0x5eda('0x47')](_0x1df13a);case _0x5eda('0x2e'):case _0x5eda('0x82'):return _0x2b9eb2[_0x5eda('0xdc')+_[_0x5eda('0xa4')](_0x30ba77['query'][_0x5eda('0x9f')])+_0x5eda('0xa6')](_0x1df13a);}})[_0x5eda('0x42')](function(_0x10e596){return{'count':_0x1fb612,'rows':_0x10e596};})[_0x5eda('0x42')](respondWithResult(_0x50685d,null))[_0x5eda('0x51')](handleError(_0x50685d,null));};exports[_0x5eda('0xde')]=function(_0x18b32c,_0x59b7c6){var _0x4141c2={};var _0x189021={};var _0xcacb07;var _0x1ce80f;return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x18b32c['params']['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x59b7c6,null))[_0x5eda('0x42')](function(_0x15036e){if(_0x15036e){_0xcacb07=_0x15036e;_0x189021[_0x5eda('0x54')]=_[_0x5eda('0x56')](db['UserVoiceQueueRt'][_0x5eda('0x3b')]);_0x189021[_0x5eda('0x43')]=_[_0x5eda('0x56')](_0x18b32c[_0x5eda('0x43')]);_0x189021['filters']=_[_0x5eda('0x58')](_0x189021['model'],_0x189021[_0x5eda('0x43')]);_0x4141c2[_0x5eda('0x46')]=_[_0x5eda('0x58')](_0x189021[_0x5eda('0x54')],qs[_0x5eda('0x59')](_0x18b32c[_0x5eda('0x43')]['fields']));_0x4141c2['attributes']=_0x4141c2[_0x5eda('0x46')][_0x5eda('0x5a')]?_0x4141c2[_0x5eda('0x46')]:_0x189021[_0x5eda('0x54')];_0x4141c2[_0x5eda('0xd0')]=qs[_0x5eda('0xd1')](_0x18b32c['query']['sort']);_0x4141c2['where']=qs[_0x5eda('0x57')](_[_0x5eda('0xdb')](_0x18b32c[_0x5eda('0x43')],_0x189021[_0x5eda('0x57')]));if(_0x18b32c['query']['filter']){_0x4141c2[_0x5eda('0x41')]=_[_0x5eda('0x5d')](_0x4141c2[_0x5eda('0x41')],{'$or':_[_0x5eda('0x32')](_0x4141c2[_0x5eda('0x46')],function(_0x37b6d){var _0x129f33={};_0x129f33[_0x37b6d]={'$like':'%'+_0x18b32c[_0x5eda('0x43')][_0x5eda('0x31')]+'%'};return _0x129f33;})});}_0x4141c2=_[_0x5eda('0x5d')]({},_0x4141c2,_0x18b32c[_0x5eda('0x5e')]);return _0xcacb07[_0x5eda('0xde')](_0x4141c2);}})[_0x5eda('0x42')](function(_0x1c9a84){if(_0x1c9a84){_0x1ce80f=_0x1c9a84[_0x5eda('0x5a')];if(!_0x18b32c[_0x5eda('0x43')][_0x5eda('0xd2')](_0x5eda('0xdf'))){_0x4141c2[_0x5eda('0x27')]=qs['limit'](_0x18b32c[_0x5eda('0x43')][_0x5eda('0x27')]);_0x4141c2[_0x5eda('0x25')]=qs[_0x5eda('0x25')](_0x18b32c['query'][_0x5eda('0x25')]);}return _0xcacb07[_0x5eda('0xde')](_0x4141c2);}})[_0x5eda('0x42')](function(_0x2d4d23){if(_0x2d4d23){return _0x2d4d23?{'count':_0x1ce80f,'rows':_0x2d4d23}:null;}})[_0x5eda('0x42')](respondWithResult(_0x59b7c6,null))[_0x5eda('0x51')](handleError(_0x59b7c6,null));};exports[_0x5eda('0xe0')]=function(_0x51ed7f,_0x4e4515){var _0x3da085={};var _0x1f513b={};var _0x1e0a77;var _0x4a99bc;return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x51ed7f[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x4e4515,null))[_0x5eda('0x42')](function(_0x59f630){if(_0x59f630){_0x1e0a77=_0x59f630;_0x1f513b[_0x5eda('0x54')]=_['keys'](db['ChatGroup'][_0x5eda('0x3b')]);_0x1f513b['query']=_[_0x5eda('0x56')](_0x51ed7f[_0x5eda('0x43')]);_0x1f513b[_0x5eda('0x57')]=_[_0x5eda('0x58')](_0x1f513b[_0x5eda('0x54')],_0x1f513b[_0x5eda('0x43')]);_0x3da085['attributes']=_[_0x5eda('0x58')](_0x1f513b[_0x5eda('0x54')],qs[_0x5eda('0x59')](_0x51ed7f[_0x5eda('0x43')][_0x5eda('0x59')]));_0x3da085[_0x5eda('0x46')]=_0x3da085['attributes'][_0x5eda('0x5a')]?_0x3da085[_0x5eda('0x46')]:_0x1f513b['model'];_0x3da085[_0x5eda('0xd0')]=qs[_0x5eda('0xd1')](_0x51ed7f[_0x5eda('0x43')][_0x5eda('0xd1')]);_0x3da085['where']=qs[_0x5eda('0x57')](_[_0x5eda('0xdb')](_0x51ed7f[_0x5eda('0x43')],_0x1f513b[_0x5eda('0x57')]));if(_0x51ed7f[_0x5eda('0x43')][_0x5eda('0x31')]){_0x3da085[_0x5eda('0x41')]=_[_0x5eda('0x5d')](_0x3da085[_0x5eda('0x41')],{'$or':_[_0x5eda('0x32')](_0x3da085[_0x5eda('0x46')],function(_0x3c8454){var _0x26ae74={};_0x26ae74[_0x3c8454]={'$like':'%'+_0x51ed7f[_0x5eda('0x43')][_0x5eda('0x31')]+'%'};return _0x26ae74;})});}_0x3da085=_[_0x5eda('0x5d')]({},_0x3da085,_0x51ed7f[_0x5eda('0x5e')]);return _0x1e0a77['getGroups'](_0x3da085);}})[_0x5eda('0x42')](function(_0x581055){if(_0x581055){_0x4a99bc=_0x581055[_0x5eda('0x5a')];if(!_0x51ed7f[_0x5eda('0x43')][_0x5eda('0xd2')]('nolimit')){_0x3da085[_0x5eda('0x27')]=qs['limit'](_0x51ed7f[_0x5eda('0x43')]['limit']);_0x3da085[_0x5eda('0x25')]=qs[_0x5eda('0x25')](_0x51ed7f[_0x5eda('0x43')][_0x5eda('0x25')]);}return _0x1e0a77[_0x5eda('0xe0')](_0x3da085);}})['then'](function(_0x45bf6f){if(_0x45bf6f){return _0x45bf6f?{'count':_0x4a99bc,'rows':_0x45bf6f}:null;}})[_0x5eda('0x42')](respondWithResult(_0x4e4515,null))[_0x5eda('0x51')](handleError(_0x4e4515,null));};exports['getRecordings']=function(_0x24c673,_0x58dd14){var _0x18c603={'raw':!![],'where':{}};var _0x253a90={};var _0x113ecc={'count':0x0,'rows':[]};return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x24c673[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x58dd14,null))[_0x5eda('0x42')](function(_0x589163){if(_0x589163){_0x253a90[_0x5eda('0x54')]=_[_0x5eda('0x56')](db[_0x5eda('0xe1')][_0x5eda('0x3b')]);_0x253a90[_0x5eda('0x43')]=_[_0x5eda('0x56')](_0x24c673[_0x5eda('0x43')]);_0x253a90[_0x5eda('0x57')]=_['intersection'](_0x253a90[_0x5eda('0x54')],_0x253a90[_0x5eda('0x43')]);_0x18c603[_0x5eda('0x46')]=_[_0x5eda('0x58')](_0x253a90[_0x5eda('0x54')],qs[_0x5eda('0x59')](_0x24c673[_0x5eda('0x43')][_0x5eda('0x59')]));_0x18c603[_0x5eda('0x46')]=_0x18c603[_0x5eda('0x46')][_0x5eda('0x5a')]?_0x18c603[_0x5eda('0x46')]:_0x253a90[_0x5eda('0x54')];if(!_0x24c673['query'][_0x5eda('0xd2')](_0x5eda('0xdf'))){_0x18c603[_0x5eda('0x27')]=qs[_0x5eda('0x27')](_0x24c673[_0x5eda('0x43')][_0x5eda('0x27')]);_0x18c603[_0x5eda('0x25')]=qs[_0x5eda('0x25')](_0x24c673[_0x5eda('0x43')][_0x5eda('0x25')]);}_0x18c603[_0x5eda('0xd0')]=qs[_0x5eda('0xd1')](_0x24c673[_0x5eda('0x43')][_0x5eda('0xd1')]);_0x18c603[_0x5eda('0x41')]=qs[_0x5eda('0x57')](_[_0x5eda('0xdb')](_0x24c673[_0x5eda('0x43')],_0x253a90['filters']));_0x18c603[_0x5eda('0x41')][_0x5eda('0xe2')]=_0x589163['id'];if(_0x24c673[_0x5eda('0x43')][_0x5eda('0x31')]){_0x18c603['where']=_[_0x5eda('0x5d')](_0x18c603['where'],{'$or':_[_0x5eda('0x32')](_0x18c603[_0x5eda('0x46')],function(_0x3440f2){var _0x28a11e={};_0x28a11e[_0x3440f2]={'$like':'%'+_0x24c673[_0x5eda('0x43')][_0x5eda('0x31')]+'%'};return _0x28a11e;})});}_0x18c603=_['merge']({},_0x18c603,_0x24c673[_0x5eda('0x5e')]);return db[_0x5eda('0xe1')][_0x5eda('0x28')]({'where':_0x18c603['where']})[_0x5eda('0x42')](function(_0x2c170a){_0x113ecc[_0x5eda('0x28')]=_0x2c170a;if(_0x24c673[_0x5eda('0x43')]['includeAll']){_0x18c603['include']=[{'all':!![]}];}return db[_0x5eda('0xe1')][_0x5eda('0x47')](_0x18c603);})[_0x5eda('0x42')](function(_0x4f1381){_0x113ecc[_0x5eda('0x48')]=_0x4f1381;return _0x113ecc;});}})['then'](respondWithFilteredResult(_0x58dd14,_0x18c603))['catch'](handleError(_0x58dd14,null));};exports[_0x5eda('0xe3')]=function(_0x14f316,_0x552934){var _0x3dd002={'raw':!![],'where':{}};var _0x8279={};var _0x218db4={'count':0x0,'rows':[]};return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x14f316[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x552934,null))[_0x5eda('0x42')](function(_0x41d1b2){if(_0x41d1b2){_0x8279[_0x5eda('0x54')]=_[_0x5eda('0x56')](db['ScreenRecording']['rawAttributes']);_0x8279[_0x5eda('0x43')]=_[_0x5eda('0x56')](_0x14f316[_0x5eda('0x43')]);_0x8279['filters']=_[_0x5eda('0x58')](_0x8279[_0x5eda('0x54')],_0x8279['query']);_0x3dd002[_0x5eda('0x46')]=_[_0x5eda('0x58')](_0x8279[_0x5eda('0x54')],qs[_0x5eda('0x59')](_0x14f316[_0x5eda('0x43')][_0x5eda('0x59')]));_0x3dd002[_0x5eda('0x46')]=_0x3dd002[_0x5eda('0x46')][_0x5eda('0x5a')]?_0x3dd002[_0x5eda('0x46')]:_0x8279[_0x5eda('0x54')];if(!_0x14f316['query'][_0x5eda('0xd2')](_0x5eda('0xdf'))){_0x3dd002[_0x5eda('0x27')]=qs[_0x5eda('0x27')](_0x14f316[_0x5eda('0x43')][_0x5eda('0x27')]);_0x3dd002[_0x5eda('0x25')]=qs['offset'](_0x14f316['query'][_0x5eda('0x25')]);}_0x3dd002[_0x5eda('0xd0')]=qs[_0x5eda('0xd1')](_0x14f316[_0x5eda('0x43')][_0x5eda('0xd1')]);_0x3dd002['where']=qs['filters'](_['pick'](_0x14f316[_0x5eda('0x43')],_0x8279[_0x5eda('0x57')]));_0x3dd002[_0x5eda('0x41')][_0x5eda('0xe2')]=_0x41d1b2['id'];if(_0x14f316['query'][_0x5eda('0x31')]){_0x3dd002[_0x5eda('0x41')]=_['merge'](_0x3dd002['where'],{'$or':_[_0x5eda('0x32')](_0x3dd002['attributes'],function(_0x3ce71b){var _0x1ab14f={};_0x1ab14f[_0x3ce71b]={'$like':'%'+_0x14f316[_0x5eda('0x43')][_0x5eda('0x31')]+'%'};return _0x1ab14f;})});}_0x3dd002=_['merge']({},_0x3dd002,_0x14f316['options']);return db[_0x5eda('0xe4')][_0x5eda('0x28')]({'where':_0x3dd002[_0x5eda('0x41')]})[_0x5eda('0x42')](function(_0x3b42f3){_0x218db4[_0x5eda('0x28')]=_0x3b42f3;if(_0x14f316[_0x5eda('0x43')][_0x5eda('0xd3')]){_0x3dd002[_0x5eda('0x5b')]=[{'all':!![]}];}return db['ScreenRecording'][_0x5eda('0x47')](_0x3dd002);})[_0x5eda('0x42')](function(_0xf1ad94){_0x218db4[_0x5eda('0x48')]=_0xf1ad94;return _0x218db4;});}})[_0x5eda('0x42')](respondWithFilteredResult(_0x552934,_0x3dd002))['catch'](handleError(_0x552934,null));};exports[_0x5eda('0xe5')]=function(_0x2089c3,_0x4cf305){var _0x5565f1={};var _0x98267f={};var _0x35c24d;var _0x31afcb;return db[_0x5eda('0x3a')]['findOne']({'where':{'id':_0x2089c3[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x4cf305,null))[_0x5eda('0x42')](function(_0x4f0b7c){if(_0x4f0b7c){_0x35c24d=_0x4f0b7c;_0x98267f[_0x5eda('0x54')]=_['keys'](db[_0x5eda('0xe6')][_0x5eda('0x3b')]);_0x98267f[_0x5eda('0x43')]=_[_0x5eda('0x56')](_0x2089c3[_0x5eda('0x43')]);_0x98267f[_0x5eda('0x57')]=_[_0x5eda('0x58')](_0x98267f['model'],_0x98267f[_0x5eda('0x43')]);_0x5565f1[_0x5eda('0x46')]=_['intersection'](_0x98267f[_0x5eda('0x54')],qs['fields'](_0x2089c3[_0x5eda('0x43')][_0x5eda('0x59')]));_0x5565f1['attributes']=_0x5565f1[_0x5eda('0x46')]['length']?_0x5565f1[_0x5eda('0x46')]:_0x98267f[_0x5eda('0x54')];_0x5565f1[_0x5eda('0xd0')]=qs[_0x5eda('0xd1')](_0x2089c3[_0x5eda('0x43')][_0x5eda('0xd1')]);_0x5565f1[_0x5eda('0x41')]=qs[_0x5eda('0x57')](_['pick'](_0x2089c3[_0x5eda('0x43')],_0x98267f[_0x5eda('0x57')]));if(_0x2089c3[_0x5eda('0x43')][_0x5eda('0x31')]){_0x5565f1[_0x5eda('0x41')]=_[_0x5eda('0x5d')](_0x5565f1['where'],{'$or':_[_0x5eda('0x32')](_0x5565f1[_0x5eda('0x46')],function(_0x1c2c86){var _0x1b6034={};_0x1b6034[_0x1c2c86]={'$like':'%'+_0x2089c3[_0x5eda('0x43')][_0x5eda('0x31')]+'%'};return _0x1b6034;})});}_0x5565f1=_[_0x5eda('0x5d')]({},_0x5565f1,_0x2089c3[_0x5eda('0x5e')]);return _0x35c24d['getChatInteractions'](_0x5565f1);}})['then'](function(_0x15cc35){if(_0x15cc35){_0x31afcb=_0x15cc35[_0x5eda('0x5a')];if(!_0x2089c3[_0x5eda('0x43')]['hasOwnProperty'](_0x5eda('0xdf'))){_0x5565f1['limit']=qs[_0x5eda('0x27')](_0x2089c3['query'][_0x5eda('0x27')]);_0x5565f1[_0x5eda('0x25')]=qs['offset'](_0x2089c3[_0x5eda('0x43')][_0x5eda('0x25')]);}return _0x35c24d[_0x5eda('0xe5')](_0x5565f1);}})[_0x5eda('0x42')](function(_0x398b3b){if(_0x398b3b){return _0x398b3b?{'count':_0x31afcb,'rows':_0x398b3b}:null;}})[_0x5eda('0x42')](respondWithResult(_0x4cf305,null))[_0x5eda('0x51')](handleError(_0x4cf305,null));};exports[_0x5eda('0xe7')]=function(_0x4c584c,_0x4f155c){var _0x150a20={};var _0x23b539={};var _0x3104a3;var _0x2d3a5b;return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x4c584c[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x4f155c,null))['then'](function(_0x34c60e){if(_0x34c60e){_0x3104a3=_0x34c60e;_0x23b539['model']=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x23b539[_0x5eda('0x43')]=_['keys'](_0x4c584c[_0x5eda('0x43')]);_0x23b539[_0x5eda('0x57')]=_[_0x5eda('0x58')](_0x23b539[_0x5eda('0x54')],_0x23b539[_0x5eda('0x43')]);_0x150a20[_0x5eda('0x46')]=_[_0x5eda('0x58')](_0x23b539[_0x5eda('0x54')],qs[_0x5eda('0x59')](_0x4c584c[_0x5eda('0x43')][_0x5eda('0x59')]));_0x150a20[_0x5eda('0x46')]=_0x150a20[_0x5eda('0x46')][_0x5eda('0x5a')]?_0x150a20[_0x5eda('0x46')]:_0x23b539['model'];_0x150a20[_0x5eda('0xd0')]=qs[_0x5eda('0xd1')](_0x4c584c[_0x5eda('0x43')][_0x5eda('0xd1')]);_0x150a20[_0x5eda('0x41')]=qs[_0x5eda('0x57')](_[_0x5eda('0xdb')](_0x4c584c[_0x5eda('0x43')],_0x23b539[_0x5eda('0x57')]));if(_0x4c584c['query'][_0x5eda('0x31')]){_0x150a20['where']=_[_0x5eda('0x5d')](_0x150a20[_0x5eda('0x41')],{'$or':_[_0x5eda('0x32')](_0x150a20[_0x5eda('0x46')],function(_0x2185c2){var _0x34ceda={};_0x34ceda[_0x2185c2]={'$like':'%'+_0x4c584c[_0x5eda('0x43')]['filter']+'%'};return _0x34ceda;})});}_0x150a20=_[_0x5eda('0x5d')]({},_0x150a20,_0x4c584c[_0x5eda('0x5e')]);return _0x3104a3[_0x5eda('0xe7')](_0x150a20);}})[_0x5eda('0x42')](function(_0x5b96e6){if(_0x5b96e6){_0x2d3a5b=_0x5b96e6[_0x5eda('0x5a')];if(!_0x4c584c[_0x5eda('0x43')][_0x5eda('0xd2')](_0x5eda('0xdf'))){_0x150a20[_0x5eda('0x27')]=qs[_0x5eda('0x27')](_0x4c584c[_0x5eda('0x43')][_0x5eda('0x27')]);_0x150a20['offset']=qs[_0x5eda('0x25')](_0x4c584c['query'][_0x5eda('0x25')]);}return _0x3104a3[_0x5eda('0xe7')](_0x150a20);}})[_0x5eda('0x42')](function(_0x214ddd){if(_0x214ddd){return _0x214ddd?{'count':_0x2d3a5b,'rows':_0x214ddd}:null;}})[_0x5eda('0x42')](respondWithResult(_0x4f155c,null))['catch'](handleError(_0x4f155c,null));};exports[_0x5eda('0xe8')]=function(_0x533cb6,_0x381eec){var _0x41cbb9={'raw':!![],'where':{}};var _0x1028e2={};var _0x5215d2={'count':0x0,'rows':[]};return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x533cb6[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x381eec,null))[_0x5eda('0x42')](function(_0x309b2b){if(_0x309b2b){_0x1028e2['model']=_[_0x5eda('0x56')](db[_0x5eda('0xe9')][_0x5eda('0x3b')]);_0x1028e2[_0x5eda('0x43')]=_[_0x5eda('0x56')](_0x533cb6[_0x5eda('0x43')]);_0x1028e2['filters']=_[_0x5eda('0x58')](_0x1028e2[_0x5eda('0x54')],_0x1028e2['query']);_0x41cbb9[_0x5eda('0x46')]=_[_0x5eda('0x58')](_0x1028e2['model'],qs[_0x5eda('0x59')](_0x533cb6['query']['fields']));_0x41cbb9['attributes']=_0x41cbb9[_0x5eda('0x46')][_0x5eda('0x5a')]?_0x41cbb9[_0x5eda('0x46')]:_0x1028e2[_0x5eda('0x54')];if(!_0x533cb6[_0x5eda('0x43')]['hasOwnProperty'](_0x5eda('0xdf'))){_0x41cbb9[_0x5eda('0x27')]=qs['limit'](_0x533cb6[_0x5eda('0x43')][_0x5eda('0x27')]);_0x41cbb9[_0x5eda('0x25')]=qs[_0x5eda('0x25')](_0x533cb6[_0x5eda('0x43')]['offset']);}_0x41cbb9[_0x5eda('0xd0')]=qs[_0x5eda('0xd1')](_0x533cb6['query'][_0x5eda('0xd1')]);_0x41cbb9[_0x5eda('0x41')]=qs['filters'](_['pick'](_0x533cb6[_0x5eda('0x43')],_0x1028e2[_0x5eda('0x57')]));_0x41cbb9[_0x5eda('0x41')][_0x5eda('0xe2')]=_0x309b2b['id'];if(_0x533cb6[_0x5eda('0x43')][_0x5eda('0x31')]){_0x41cbb9['where']=_['merge'](_0x41cbb9[_0x5eda('0x41')],{'$or':_[_0x5eda('0x32')](_0x41cbb9[_0x5eda('0x46')],function(_0x1cbadb){var _0x34232a={};_0x34232a[_0x1cbadb]={'$like':'%'+_0x533cb6[_0x5eda('0x43')][_0x5eda('0x31')]+'%'};return _0x34232a;})});}_0x41cbb9=_[_0x5eda('0x5d')]({},_0x41cbb9,_0x533cb6[_0x5eda('0x5e')]);return db['MailInteraction']['count']({'where':_0x41cbb9['where']})[_0x5eda('0x42')](function(_0x2e32f7){_0x5215d2[_0x5eda('0x28')]=_0x2e32f7;if(_0x533cb6[_0x5eda('0x43')][_0x5eda('0xd3')]){_0x41cbb9['include']=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x41cbb9);})['then'](function(_0x22f457){_0x5215d2[_0x5eda('0x48')]=_0x22f457;return _0x5215d2;});}})[_0x5eda('0x42')](respondWithFilteredResult(_0x381eec,_0x41cbb9))[_0x5eda('0x51')](handleError(_0x381eec,null));};exports[_0x5eda('0xea')]=function(_0x1eed0b,_0x40177b){var _0x35d446={};var _0x541c16={};var _0x80bd23;var _0x49d9be;return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x1eed0b[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x40177b,null))[_0x5eda('0x42')](function(_0x5c4cd8){if(_0x5c4cd8){_0x80bd23=_0x5c4cd8;_0x541c16[_0x5eda('0x54')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x541c16[_0x5eda('0x43')]=_[_0x5eda('0x56')](_0x1eed0b[_0x5eda('0x43')]);_0x541c16[_0x5eda('0x57')]=_['intersection'](_0x541c16[_0x5eda('0x54')],_0x541c16[_0x5eda('0x43')]);_0x35d446[_0x5eda('0x46')]=_['intersection'](_0x541c16[_0x5eda('0x54')],qs[_0x5eda('0x59')](_0x1eed0b[_0x5eda('0x43')]['fields']));_0x35d446[_0x5eda('0x46')]=_0x35d446[_0x5eda('0x46')]['length']?_0x35d446[_0x5eda('0x46')]:_0x541c16[_0x5eda('0x54')];_0x35d446['order']=qs[_0x5eda('0xd1')](_0x1eed0b[_0x5eda('0x43')][_0x5eda('0xd1')]);_0x35d446[_0x5eda('0x41')]=qs[_0x5eda('0x57')](_[_0x5eda('0xdb')](_0x1eed0b['query'],_0x541c16[_0x5eda('0x57')]));if(_0x1eed0b[_0x5eda('0x43')][_0x5eda('0x31')]){_0x35d446['where']=_[_0x5eda('0x5d')](_0x35d446[_0x5eda('0x41')],{'$or':_[_0x5eda('0x32')](_0x35d446['attributes'],function(_0x3a8b7a){var _0x663f3c={};_0x663f3c[_0x3a8b7a]={'$like':'%'+_0x1eed0b['query'][_0x5eda('0x31')]+'%'};return _0x663f3c;})});}_0x35d446=_[_0x5eda('0x5d')]({},_0x35d446,_0x1eed0b[_0x5eda('0x5e')]);return _0x80bd23['getSmsInteractions'](_0x35d446);}})[_0x5eda('0x42')](function(_0x44c876){if(_0x44c876){_0x49d9be=_0x44c876[_0x5eda('0x5a')];if(!_0x1eed0b[_0x5eda('0x43')][_0x5eda('0xd2')](_0x5eda('0xdf'))){_0x35d446['limit']=qs[_0x5eda('0x27')](_0x1eed0b[_0x5eda('0x43')][_0x5eda('0x27')]);_0x35d446[_0x5eda('0x25')]=qs[_0x5eda('0x25')](_0x1eed0b[_0x5eda('0x43')][_0x5eda('0x25')]);}return _0x80bd23[_0x5eda('0xea')](_0x35d446);}})[_0x5eda('0x42')](function(_0x378062){if(_0x378062){return _0x378062?{'count':_0x49d9be,'rows':_0x378062}:null;}})[_0x5eda('0x42')](respondWithResult(_0x40177b,null))[_0x5eda('0x51')](handleError(_0x40177b,null));};exports[_0x5eda('0xeb')]=function(_0x39cde1,_0x53af93){var _0x1a4b63={};var _0x47c5df={};var _0x5d6241;var _0x10124a;return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x39cde1[_0x5eda('0x53')]['id']}})['then'](handleEntityNotFound(_0x53af93,null))[_0x5eda('0x42')](function(_0x3d3b6c){if(_0x3d3b6c){_0x5d6241=_0x3d3b6c;_0x47c5df[_0x5eda('0x54')]=_[_0x5eda('0x56')](db[_0x5eda('0xec')]['rawAttributes']);_0x47c5df[_0x5eda('0x43')]=_['keys'](_0x39cde1[_0x5eda('0x43')]);_0x47c5df[_0x5eda('0x57')]=_[_0x5eda('0x58')](_0x47c5df[_0x5eda('0x54')],_0x47c5df[_0x5eda('0x43')]);_0x1a4b63[_0x5eda('0x46')]=_['intersection'](_0x47c5df['model'],qs[_0x5eda('0x59')](_0x39cde1[_0x5eda('0x43')][_0x5eda('0x59')]));_0x1a4b63[_0x5eda('0x46')]=_0x1a4b63[_0x5eda('0x46')][_0x5eda('0x5a')]?_0x1a4b63['attributes']:_0x47c5df['model'];_0x1a4b63['order']=qs[_0x5eda('0xd1')](_0x39cde1[_0x5eda('0x43')]['sort']);_0x1a4b63['where']=qs['filters'](_[_0x5eda('0xdb')](_0x39cde1['query'],_0x47c5df[_0x5eda('0x57')]));if(_0x39cde1[_0x5eda('0x43')][_0x5eda('0x31')]){_0x1a4b63[_0x5eda('0x41')]=_[_0x5eda('0x5d')](_0x1a4b63[_0x5eda('0x41')],{'$or':_[_0x5eda('0x32')](_0x1a4b63['attributes'],function(_0x579239){var _0x324da3={};_0x324da3[_0x579239]={'$like':'%'+_0x39cde1[_0x5eda('0x43')][_0x5eda('0x31')]+'%'};return _0x324da3;})});}_0x1a4b63=_[_0x5eda('0x5d')]({},_0x1a4b63,_0x39cde1[_0x5eda('0x5e')]);return _0x5d6241[_0x5eda('0xeb')](_0x1a4b63);}})[_0x5eda('0x42')](function(_0x46dee4){if(_0x46dee4){_0x10124a=_0x46dee4['length'];if(!_0x39cde1['query'][_0x5eda('0xd2')](_0x5eda('0xdf'))){_0x1a4b63[_0x5eda('0x27')]=qs['limit'](_0x39cde1[_0x5eda('0x43')]['limit']);_0x1a4b63[_0x5eda('0x25')]=qs[_0x5eda('0x25')](_0x39cde1[_0x5eda('0x43')][_0x5eda('0x25')]);}return _0x5d6241[_0x5eda('0xeb')](_0x1a4b63);}})[_0x5eda('0x42')](function(_0x326610){if(_0x326610){return _0x326610?{'count':_0x10124a,'rows':_0x326610}:null;}})[_0x5eda('0x42')](respondWithResult(_0x53af93,null))['catch'](handleError(_0x53af93,null));};exports[_0x5eda('0xed')]=function(_0x36f29a,_0x356f57){var _0x546a34={};var _0x3b0769={};var _0x1b24e4;var _0x152d67;return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x36f29a[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x356f57,null))[_0x5eda('0x42')](function(_0x586a4a){if(_0x586a4a){_0x1b24e4=_0x586a4a;_0x3b0769['model']=_[_0x5eda('0x56')](db[_0x5eda('0xee')][_0x5eda('0x3b')]);_0x3b0769[_0x5eda('0x43')]=_['keys'](_0x36f29a[_0x5eda('0x43')]);_0x3b0769['filters']=_['intersection'](_0x3b0769[_0x5eda('0x54')],_0x3b0769['query']);_0x546a34['attributes']=_[_0x5eda('0x58')](_0x3b0769['model'],qs[_0x5eda('0x59')](_0x36f29a['query'][_0x5eda('0x59')]));_0x546a34['attributes']=_0x546a34['attributes'][_0x5eda('0x5a')]?_0x546a34[_0x5eda('0x46')]:_0x3b0769['model'];_0x546a34['order']=qs[_0x5eda('0xd1')](_0x36f29a[_0x5eda('0x43')][_0x5eda('0xd1')]);_0x546a34[_0x5eda('0x41')]=qs['filters'](_['pick'](_0x36f29a['query'],_0x3b0769[_0x5eda('0x57')]));if(_0x36f29a[_0x5eda('0x43')][_0x5eda('0x31')]){_0x546a34[_0x5eda('0x41')]=_[_0x5eda('0x5d')](_0x546a34[_0x5eda('0x41')],{'$or':_[_0x5eda('0x32')](_0x546a34[_0x5eda('0x46')],function(_0x421387){var _0x26e265={};_0x26e265[_0x421387]={'$like':'%'+_0x36f29a[_0x5eda('0x43')][_0x5eda('0x31')]+'%'};return _0x26e265;})});}_0x546a34=_[_0x5eda('0x5d')]({},_0x546a34,_0x36f29a[_0x5eda('0x5e')]);return _0x1b24e4[_0x5eda('0xed')](_0x546a34);}})[_0x5eda('0x42')](function(_0x33394b){if(_0x33394b){_0x152d67=_0x33394b[_0x5eda('0x5a')];if(!_0x36f29a[_0x5eda('0x43')][_0x5eda('0xd2')](_0x5eda('0xdf'))){_0x546a34['limit']=qs['limit'](_0x36f29a['query'][_0x5eda('0x27')]);_0x546a34[_0x5eda('0x25')]=qs[_0x5eda('0x25')](_0x36f29a['query'][_0x5eda('0x25')]);}return _0x1b24e4[_0x5eda('0xed')](_0x546a34);}})[_0x5eda('0x42')](function(_0x54602a){if(_0x54602a){return _0x54602a?{'count':_0x152d67,'rows':_0x54602a}:null;}})[_0x5eda('0x42')](respondWithResult(_0x356f57,null))['catch'](handleError(_0x356f57,null));};exports[_0x5eda('0xef')]=function(_0x29eaf7,_0xd24c0a,_0x5ecff9){var _0x3a057d;var _0x4a6501;var _0x5e69c4;var _0x30fd87=!_[_0x5eda('0x6b')](_0x29eaf7[_0x5eda('0x53')]['id'])?_0x29eaf7[_0x5eda('0x53')]['id']:!_[_0x5eda('0x6b')](_0x29eaf7[_0x5eda('0x2e')]['id'])?_0x29eaf7[_0x5eda('0x2e')]['id']:null;return db[_0x5eda('0x3a')][_0x5eda('0x35')]({'where':{'id':_0x30fd87,'role':{'$or':[_0x5eda('0x84'),_0x5eda('0x2e'),_0x5eda('0x82')]}},'attributes':['id',_0x5eda('0x36'),_0x5eda('0xf0'),'mobile',_0x5eda('0x2c'),_0x5eda('0x69'),_0x5eda('0xa0')]})[_0x5eda('0x42')](function(_0x572019){if(_0x572019){if(_0x572019[_0x5eda('0x2c')]===_0x5eda('0x82')){_0x3a057d=_0x572019;if(_0x29eaf7['body'][_0x5eda('0xae')]){_0x5e69c4=util[_0x5eda('0xaf')](_0x5eda('0xf1'),_0x3a057d[_0x29eaf7[_0x5eda('0x60')]['interface']]);}else if(_0x29eaf7[_0x5eda('0x60')][_0x5eda('0xf2')]){_0x5e69c4=util[_0x5eda('0xaf')]('SIP/%s',_0x29eaf7['body'][_0x5eda('0xf2')]);}else{_0x5e69c4=util[_0x5eda('0xaf')](_0x5eda('0xb0'),_0x3a057d['name']);}socket['to'](util[_0x5eda('0xaf')](_0x5eda('0xf3'),_0x3a057d[_0x5eda('0x36')]))[_0x5eda('0xa9')](_0x5eda('0xf4'),{'user':{'id':_0x3a057d['id'],'name':_0x3a057d[_0x5eda('0x36')]},'ip':_0x29eaf7[_0x5eda('0xf5')][_0x5eda('0xf6')]||_0x29eaf7['connection'][_0x5eda('0xf7')]||_0x29eaf7[_0x5eda('0xf8')][_0x5eda('0xf7')]||_0x29eaf7['connection'][_0x5eda('0xf8')]['remoteAddress']});return db[_0x5eda('0xb1')]['destroy']({'where':{'membername':_0x3a057d[_0x5eda('0x36')]},'individualHooks':!![]});}}else{throw new db[(_0x5eda('0x95'))]['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x3a057d){return _0x3a057d[_0x5eda('0xf9')]({'raw':!![]});}})['then'](function(_0x1aa338){if(_0x3a057d){if(_0x1aa338){_0x4a6501=_0x1aa338;if(_0x4a6501['length']){var _0x571b19=_0x4a6501['map'](function(_0x1fab69){var _0x16ec93={'membername':_0x3a057d[_0x5eda('0x36')],'UserId':_0x3a057d['id'],'queue_name':_0x1fab69[_0x5eda('0x36')],'VoiceQueueId':_0x1fab69['id'],'interface':_0x5e69c4,'paused':_0x3a057d[_0x5eda('0xa0')]||![],'penalty':_0x1fab69[_0x5eda('0xfa')]||0x0};return db[_0x5eda('0xb1')][_0x5eda('0xfb')](_0x16ec93);});return Promise[_0x5eda('0x50')](_0x571b19);}}}})['then'](function(){if(_0x3a057d){return db[_0x5eda('0xfc')][_0x5eda('0x47')]({'where':{'membername':_0x3a057d[_0x5eda('0x36')],'exitAt':null}});}})[_0x5eda('0x42')](function(_0xf3518){if(_0x3a057d){var _0x4b6eef=[];_0xf3518['forEach'](function(_0x1f77d2){_0x4b6eef[_0x5eda('0x4a')](_0x1f77d2[_0x5eda('0x29')]({'exitAt':moment()['format'](_0x5eda('0xfd'))}));});return Promise[_0x5eda('0x50')](_0x4b6eef);}})['then'](function(){if(_0x3a057d){var _0x424612=[];var _0x1ba1a4=[];var _0x1abe6a=utils[_0x5eda('0xfe')]();var _0x218b42={'membername':_0x3a057d[_0x5eda('0x36')],'interface':_0x5e69c4,'enterAt':moment()[_0x5eda('0xaf')](_0x5eda('0xfd')),'role':_0x3a057d[_0x5eda('0x2c')],'internal':_0x3a057d['internal']};_0x1abe6a['forEach'](function(_0x2310cd){_0x424612[_0x5eda('0x4a')](_['merge']({'channel':_0x2310cd,'type':_0x5eda('0xff'),'data1':_0x29eaf7[_0x5eda('0x60')][_0x5eda('0x100')],'data2':_0x5e69c4},_0x218b42));if(_0x3a057d[_0x5eda('0xa0')]){_0x1ba1a4[_0x5eda('0x4a')](_['merge']({'channel':_0x2310cd,'type':_0x5eda('0x101'),'data1':_0x5eda('0x102')},_0x218b42));}});return db['MemberReport'][_0x5eda('0x8c')](_0x424612['concat'](_0x1ba1a4),{'individualHooks':!![]});}})[_0x5eda('0x42')](function(){if(_0x3a057d){return _0x3a057d[_0x5eda('0x29')]({'online':!![],'lastLoginAt':moment()[_0x5eda('0xaf')](_0x5eda('0xfd')),'voicePause':_0x3a057d[_0x5eda('0xa0')]||![],'mailPause':_0x3a057d[_0x5eda('0xa0')]||![],'chatPause':_0x3a057d[_0x5eda('0xa0')]||![],'faxPause':_0x3a057d[_0x5eda('0xa0')]||![],'smsPause':_0x3a057d[_0x5eda('0xa0')]||![],'openchannelPause':_0x3a057d['loginInPause']||![],'whatsappPause':_0x3a057d[_0x5eda('0xa0')]||![],'pauseType':_0x3a057d[_0x5eda('0xa0')]?_0x5eda('0x102'):null,'interface':_0x5e69c4,'lastPauseAt':moment()[_0x5eda('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x5eda('0x42')](function(_0x3fa154){if(_0x29eaf7[_0x5eda('0x103')]){return _0x5ecff9();}else{return Promise[_0x5eda('0x104')](_0x3fa154)[_0x5eda('0x42')](respondWithResult(_0xd24c0a,null));}})[_0x5eda('0x51')](handleError(_0xd24c0a,null));};exports[_0x5eda('0x105')]=function(_0x241168,_0x5cbf50){var _0x2f4366;return db[_0x5eda('0x3a')][_0x5eda('0x35')]({'where':{'id':_0x241168['params']['id'],'role':_0x5eda('0x82')},'attributes':['id',_0x5eda('0x36'),_0x5eda('0x2c')]})[_0x5eda('0x42')](handleEntityNotFound(_0x5cbf50,null))['then'](function(_0xf14be0){if(_0xf14be0){_0x2f4366=_0xf14be0;return db[_0x5eda('0xb1')][_0x5eda('0x2b')]({'where':{'membername':_0x2f4366['name']},'individualHooks':!![]});}})['then'](function(){return db[_0x5eda('0xfc')]['findAll']({'where':{'membername':_0x2f4366[_0x5eda('0x36')],'exitAt':null}});})[_0x5eda('0x42')](function(_0x28c9d2){var _0x2efc91=[];_0x28c9d2['forEach'](function(_0x1bfa92){_0x2efc91['push'](_0x1bfa92[_0x5eda('0x29')]({'exitAt':moment()[_0x5eda('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x5eda('0x50')](_0x2efc91);})[_0x5eda('0x42')](function(){return _0x2f4366['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5eda('0x42')](respondWithResult(_0x5cbf50,null))[_0x5eda('0x51')](handleError(_0x5cbf50,null));};exports[_0x5eda('0x106')]=function(_0x556e28,_0x2575ea){var _0x2871db;return db[_0x5eda('0xb1')][_0x5eda('0x29')]({'paused':0x1},{'where':{'UserId':_0x556e28['params']['id']},'individualHooks':!![]})[_0x5eda('0x42')](function(){return db[_0x5eda('0x3a')]['find']({'where':{'id':_0x556e28[_0x5eda('0x53')]['id'],'role':_0x5eda('0x82')},'attributes':['id',_0x5eda('0x36'),_0x5eda('0x2c'),'internal','interface',_0x5eda('0xad')]});})[_0x5eda('0x42')](handleEntityNotFound(_0x2575ea,null))['then'](function(_0x46807f){if(_0x46807f){_0x2871db=_0x46807f;return respondWithRpcPromise(_0x5eda('0x107'),_0x5eda('0x106'),{'id':_0x2871db['id'],'name':_0x2871db[_0x5eda('0x36')],'pause':!![]});}})[_0x5eda('0x42')](function(){if(_0x2871db){return db[_0x5eda('0xfc')][_0x5eda('0x47')]({'where':{'membername':_0x2871db[_0x5eda('0x36')],'type':_0x5eda('0x101'),'exitAt':null}});}})['then'](function(_0x1b3489){if(_0x1b3489[_0x5eda('0x5a')]){var _0x167460=moment()[_0x5eda('0xaf')](_0x5eda('0xfd'));for(var _0x485ebc=0x0,_0x1ab9de=_0x1b3489[_0x5eda('0x5a')];_0x485ebc<_0x1ab9de;_0x485ebc++){_0x1b3489[_0x485ebc][_0x5eda('0x108')]({'exitAt':_0x167460});}}})[_0x5eda('0x42')](function(){var _0x401ae8=[];var _0x1ec7c0=utils[_0x5eda('0xfe')]();_0x1ec7c0['forEach'](function(_0x597dbf){_0x401ae8['push']({'channel':_0x597dbf,'membername':_0x2871db[_0x5eda('0x36')],'interface':_['isNil'](_0x2871db[_0x5eda('0xae')])?util[_0x5eda('0xaf')](_0x5eda('0xb0'),_0x2871db[_0x5eda('0x36')]):_0x2871db['interface'],'type':'PAUSE','enterAt':moment()[_0x5eda('0xaf')](_0x5eda('0xfd')),'data1':_0x556e28[_0x5eda('0x60')][_0x5eda('0x3d')]||_0x5eda('0x109'),'role':_0x2871db[_0x5eda('0x2c')],'internal':_0x2871db[_0x5eda('0x69')]});});return db[_0x5eda('0xfc')][_0x5eda('0x8c')](_0x401ae8,{'individualHooks':!![]});})[_0x5eda('0x42')](function(){return _0x2871db[_0x5eda('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x556e28[_0x5eda('0x60')][_0x5eda('0x3d')]||_0x5eda('0x109'),'lastPauseAt':moment()[_0x5eda('0xaf')](_0x5eda('0xfd'))});})[_0x5eda('0x42')](respondWithResult(_0x2575ea,null))[_0x5eda('0x51')](handleError(_0x2575ea,null));};exports[_0x5eda('0x10a')]=function(_0x5a735e,_0x200da1){if(_0x5a735e[_0x5eda('0x60')]['channel']&&!utils['isValidChannel'](_0x5a735e[_0x5eda('0x60')][_0x5eda('0x9f')])){throw new APIBadRequestError(util[_0x5eda('0xaf')](_0x5eda('0x10b'),_0x5a735e[_0x5eda('0x60')][_0x5eda('0x9f')]));}return db[_0x5eda('0x3a')][_0x5eda('0x35')]({'where':{'id':_0x5a735e[_0x5eda('0x53')]['id']},'attributes':['id',_0x5eda('0x36'),'role',_0x5eda('0x69'),_0x5eda('0xae'),_0x5eda('0xad'),_0x5eda('0xa1'),_0x5eda('0x10c'),_0x5eda('0x10d'),_0x5eda('0x10e'),_0x5eda('0x10f'),_0x5eda('0x110'),'whatsappPause',_0x5eda('0x111'),_0x5eda('0x112')]})[_0x5eda('0x42')](function(_0x1be4b2){if(!_0x1be4b2){throw new APINotFoundError(util[_0x5eda('0xaf')](_0x5eda('0x113'),_0x5a735e[_0x5eda('0x53')]['id']));}return _0x1be4b2[_0x5eda('0x10a')](_0x5a735e[_0x5eda('0x60')][_0x5eda('0x9f')]);})[_0x5eda('0x42')](respondWithResult(_0x200da1,null))[_0x5eda('0x51')](APIHandleError(_0x200da1));};exports['getTeams']=function(_0x1ea866,_0x575838){var _0x3aebb8={};var _0x49ff0d={};var _0x25ac7c;var _0x469e4b;return db[_0x5eda('0x3a')]['findOne']({'where':{'id':_0x1ea866[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x575838,null))[_0x5eda('0x42')](function(_0x452163){if(_0x452163){_0x25ac7c=_0x452163;_0x49ff0d[_0x5eda('0x54')]=_[_0x5eda('0x56')](db[_0x5eda('0x114')]['rawAttributes']);_0x49ff0d[_0x5eda('0x43')]=_[_0x5eda('0x56')](_0x1ea866[_0x5eda('0x43')]);_0x49ff0d[_0x5eda('0x57')]=_[_0x5eda('0x58')](_0x49ff0d[_0x5eda('0x54')],_0x49ff0d['query']);_0x3aebb8[_0x5eda('0x46')]=_[_0x5eda('0x58')](_0x49ff0d[_0x5eda('0x54')],qs[_0x5eda('0x59')](_0x1ea866[_0x5eda('0x43')][_0x5eda('0x59')]));_0x3aebb8['attributes']=_0x3aebb8[_0x5eda('0x46')][_0x5eda('0x5a')]?_0x3aebb8[_0x5eda('0x46')]:_0x49ff0d['model'];_0x3aebb8[_0x5eda('0xd0')]=qs['sort'](_0x1ea866[_0x5eda('0x43')][_0x5eda('0xd1')]);_0x3aebb8['where']=qs[_0x5eda('0x57')](_[_0x5eda('0xdb')](_0x1ea866['query'],_0x49ff0d[_0x5eda('0x57')]));if(_0x1ea866[_0x5eda('0x43')][_0x5eda('0x31')]){_0x3aebb8['where']=_[_0x5eda('0x5d')](_0x3aebb8[_0x5eda('0x41')],{'$or':_['map'](_0x3aebb8['attributes'],function(_0x35e678){var _0x20266e={};_0x20266e[_0x35e678]={'$like':'%'+_0x1ea866[_0x5eda('0x43')][_0x5eda('0x31')]+'%'};return _0x20266e;})});}_0x3aebb8=_[_0x5eda('0x5d')]({},_0x3aebb8,_0x1ea866[_0x5eda('0x5e')]);return _0x25ac7c[_0x5eda('0x115')](_0x3aebb8);}})['then'](function(_0x4384e2){if(_0x4384e2){_0x469e4b=_0x4384e2[_0x5eda('0x5a')];if(!_0x1ea866['query']['hasOwnProperty'](_0x5eda('0xdf'))){_0x3aebb8[_0x5eda('0x27')]=qs[_0x5eda('0x27')](_0x1ea866['query']['limit']);_0x3aebb8[_0x5eda('0x25')]=qs[_0x5eda('0x25')](_0x1ea866['query'][_0x5eda('0x25')]);}return _0x25ac7c['getTeams'](_0x3aebb8);}})['then'](function(_0x3ffa49){if(_0x3ffa49){return _0x3ffa49?{'count':_0x469e4b,'rows':_0x3ffa49}:null;}})[_0x5eda('0x42')](respondWithResult(_0x575838,null))[_0x5eda('0x51')](handleError(_0x575838,null));};exports['addTeams']=function(_0xfced7,_0xb5a093){var _0xba4923=_0xfced7[_0x5eda('0x53')]['id'];var _0x365537=_0xfced7[_0x5eda('0x60')]?_0xfced7[_0x5eda('0x60')][_0x5eda('0x63')]:null;var _0x140591=[];return Promise[_0x5eda('0x104')]()[_0x5eda('0x42')](function(){if(!_0x365537)throw new APIBadRequestError(_0x5eda('0x116'));})[_0x5eda('0x42')](function(){return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0xba4923}});})[_0x5eda('0x42')](function(_0x57bf96){if(!_0x57bf96)throw new APINotFoundError(util[_0x5eda('0xaf')](_0x5eda('0x113'),_0xfced7['params']['id']));return db[_0x5eda('0x117')][_0x5eda('0x118')](function(_0x447274){return _0x57bf96[_0x5eda('0x119')](_0x365537,{'transaction':_0x447274})['then'](function(){return db['Team'][_0x5eda('0x47')]({'where':{'id':{'$in':_0x365537}}});})[_0x5eda('0x42')](function(_0xadd6d2){var _0x1ed7d4=_['map'](_0xadd6d2,function(_0x3c0ead){return _0x3c0ead[_0x5eda('0x11a')]();});return Promise[_0x5eda('0x50')](_0x1ed7d4);})[_0x5eda('0x42')](function(_0x2994e6){_0x140591=_[_0x5eda('0x11b')](_0x2994e6);var _0x52248f=_[_0x5eda('0x32')](_0x140591,function(_0x13a3fb){return _0x13a3fb[_0x5eda('0x11c')](_0x57bf96['id'],{'transaction':_0x447274});});return Promise['all'](_0x52248f);})[_0x5eda('0x42')](function(){if(!_0x57bf96['online'])return;var _0x48915d=_[_0x5eda('0x31')](_0x140591,function(_0x298c2e){return _0x298c2e['getDataValue']('channel')===_0x5eda('0x11d');});var _0x2c432c=_[_0x5eda('0x32')](_0x48915d,function(_0xa9f5fc){return db['UserVoiceQueueRt'][_0x5eda('0xfb')]({'membername':_0x57bf96['name'],'UserId':_0x57bf96['id'],'queue_name':_0xa9f5fc[_0x5eda('0x36')],'VoiceQueueId':_0xa9f5fc['id'],'interface':_[_0x5eda('0x6b')](_0x57bf96['interface'])?util['format'](_0x5eda('0xb0'),_0x57bf96['name']):_0x57bf96[_0x5eda('0xae')],'paused':_0x57bf96['voicePause']||![],'penalty':_0x57bf96['penalty']},{'transaction':_0x447274});});return Promise[_0x5eda('0x50')](_0x2c432c);})[_0x5eda('0x42')](function(){return db[_0x5eda('0x11e')][_0x5eda('0x47')]({'where':{'teamId':{'$in':_0x365537}}});})[_0x5eda('0x42')](function(_0x5ee586){var _0x2ff7c9=_[_0x5eda('0x32')](_0x5ee586,function(_0x5214da){return db[_0x5eda('0x11f')]['create']({'UserId':_0x57bf96['id'],'VoicePrefixId':_0x5214da[_0x5eda('0x120')]},{'transaction':_0x447274});});return Promise[_0x5eda('0x50')](_0x2ff7c9);});});})['then'](function(){for(var _0x14fd58=0x0;_0x14fd58<_0x140591['length'];_0x14fd58++){var _0x1c6b4a=_0x140591[_0x14fd58]['getDataValue']('channel');var _0x5a7943=_0x1c6b4a+_0x5eda('0xb4');socket[_0x5eda('0xa9')]('user'+_0x1c6b4a+_0x5eda('0xaa'),{'UserId':_0xba4923,['queueField']:_0x140591[_0x14fd58]['id']});}})['then'](respondWithStatusCode(_0xb5a093,null))[_0x5eda('0x51')](APIHandleError(_0xb5a093));};exports['removeTeams']=function(_0x159d13,_0x1b3cf6){var _0x3cd6f7=_0x159d13['params']['id'];var _0x446989=null;if(_0x159d13['query'][_0x5eda('0x63')]){_0x446989=_['isArray'](_0x159d13[_0x5eda('0x43')]['ids'])?_0x159d13[_0x5eda('0x43')][_0x5eda('0x63')]:[_0x159d13[_0x5eda('0x43')][_0x5eda('0x63')]];}var _0x38a427=[];return Promise['resolve']()[_0x5eda('0x42')](function(){if(!_0x446989)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x5eda('0x42')](function(){return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x3cd6f7}});})[_0x5eda('0x42')](function(_0xd3af7f){if(!_0xd3af7f)throw new APINotFoundError(util[_0x5eda('0xaf')](_0x5eda('0x113'),_0x159d13[_0x5eda('0x53')]['id']));return db[_0x5eda('0x117')][_0x5eda('0x118')](function(_0x180509){return _0xd3af7f[_0x5eda('0x121')](_0x446989,{'transaction':_0x180509})['then'](function(){return db[_0x5eda('0x114')][_0x5eda('0x47')]({'where':{'id':{'$in':_0x446989}}});})[_0x5eda('0x42')](function(_0x2f7a21){var _0x2d8def=_[_0x5eda('0x32')](_0x2f7a21,function(_0x4a4efd){return _0x4a4efd['getAssociatedQueues']();});return Promise[_0x5eda('0x50')](_0x2d8def);})['then'](function(_0x21456c){_0x38a427=_[_0x5eda('0x11b')](_0x21456c);var _0x370066=_[_0x5eda('0x32')](_0x38a427,function(_0x299a31){return _0x299a31[_0x5eda('0x122')](_0xd3af7f['id'],{'transaction':_0x180509});});return Promise['all'](_0x370066);})[_0x5eda('0x42')](function(){if(!_0xd3af7f[_0x5eda('0xad')])return;var _0x2520bd=_[_0x5eda('0x31')](_0x38a427,function(_0x4a809d){return _0x4a809d[_0x5eda('0x123')](_0x5eda('0x9f'))===_0x5eda('0x11d');});var _0x3fa694=_[_0x5eda('0x32')](_0x2520bd,function(_0x5b3539){return db[_0x5eda('0xb1')]['destroy']({'where':{'VoiceQueueId':_0x5b3539['id'],'UserId':_0xd3af7f['id']},'transaction':_0x180509});});return Promise[_0x5eda('0x50')](_0x3fa694);})[_0x5eda('0x42')](function(){return db[_0x5eda('0x11e')][_0x5eda('0x47')]({'where':{'teamId':{'$in':_0x446989}}});})[_0x5eda('0x42')](function(_0x5637ca){var _0x7fc895=_['map'](_0x5637ca,function(_0x23acd3){return db[_0x5eda('0x11f')][_0x5eda('0x2b')]({'where':{'UserId':_0xd3af7f['id'],'VoicePrefixId':_0x23acd3[_0x5eda('0x120')]}},{'transaction':_0x180509});});return Promise['all'](_0x7fc895);});});})[_0x5eda('0x42')](function(){for(var _0x109bda=0x0;_0x109bda<_0x38a427[_0x5eda('0x5a')];_0x109bda++){var _0x4b7df6=_0x38a427[_0x109bda][_0x5eda('0x123')]('channel');var _0x2601b3=_0x4b7df6+_0x5eda('0xb4');socket['emit']('user'+_0x4b7df6+_0x5eda('0xb5'),{'UserId':_0x3cd6f7,['queueField']:_0x38a427[_0x109bda]['id']});}})[_0x5eda('0x42')](respondWithStatusCode(_0x1b3cf6,null))[_0x5eda('0x51')](APIHandleError(_0x1b3cf6));};exports['getLists']=function(_0x47d4ef,_0x342f5b){var _0x484f18={};var _0x4335fd={};var _0x41fb83;var _0x2ca776;return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x47d4ef[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x342f5b,null))[_0x5eda('0x42')](function(_0x18d129){if(_0x18d129){_0x41fb83=_0x18d129;_0x4335fd[_0x5eda('0x54')]=_['keys'](db[_0x5eda('0xd4')]['rawAttributes']);_0x4335fd[_0x5eda('0x43')]=_[_0x5eda('0x56')](_0x47d4ef[_0x5eda('0x43')]);_0x4335fd['filters']=_[_0x5eda('0x58')](_0x4335fd['model'],_0x4335fd[_0x5eda('0x43')]);_0x484f18['attributes']=_[_0x5eda('0x58')](_0x4335fd[_0x5eda('0x54')],qs['fields'](_0x47d4ef['query']['fields']));_0x484f18['attributes']=_0x484f18[_0x5eda('0x46')][_0x5eda('0x5a')]?_0x484f18[_0x5eda('0x46')]:_0x4335fd[_0x5eda('0x54')];_0x484f18[_0x5eda('0xd0')]=qs[_0x5eda('0xd1')](_0x47d4ef['query'][_0x5eda('0xd1')]);_0x484f18[_0x5eda('0x41')]=qs['filters'](_[_0x5eda('0xdb')](_0x47d4ef['query'],_0x4335fd[_0x5eda('0x57')]));if(_0x47d4ef['query'][_0x5eda('0x31')]){_0x484f18[_0x5eda('0x41')]=_[_0x5eda('0x5d')](_0x484f18['where'],{'$or':_[_0x5eda('0x32')](_0x484f18[_0x5eda('0x46')],function(_0x295a7c){var _0x365799={};_0x365799[_0x295a7c]={'$like':'%'+_0x47d4ef['query']['filter']+'%'};return _0x365799;})});}_0x484f18=_['merge']({},_0x484f18,_0x47d4ef[_0x5eda('0x5e')]);return _0x41fb83[_0x5eda('0x124')](_0x484f18);}})[_0x5eda('0x42')](function(_0x52df41){if(_0x52df41){_0x2ca776=_0x52df41['length'];if(!_0x47d4ef[_0x5eda('0x43')][_0x5eda('0xd2')](_0x5eda('0xdf'))){_0x484f18[_0x5eda('0x27')]=qs[_0x5eda('0x27')](_0x47d4ef[_0x5eda('0x43')][_0x5eda('0x27')]);_0x484f18[_0x5eda('0x25')]=qs['offset'](_0x47d4ef[_0x5eda('0x43')][_0x5eda('0x25')]);}return _0x41fb83[_0x5eda('0x124')](_0x484f18);}})[_0x5eda('0x42')](function(_0x32b106){if(_0x32b106){return _0x32b106?{'count':_0x2ca776,'rows':_0x32b106}:null;}})[_0x5eda('0x42')](respondWithResult(_0x342f5b,null))[_0x5eda('0x51')](handleError(_0x342f5b,null));};exports[_0x5eda('0x125')]=function(_0x3ffd1d,_0x241525){var _0x1ee0c7={};var _0x29c61f={};var _0x11f52c;return db[_0x5eda('0x3a')][_0x5eda('0xce')]({'where':{'id':_0x3ffd1d[_0x5eda('0x53')]['id']}})[_0x5eda('0x42')](handleEntityNotFound(_0x241525,null))[_0x5eda('0x42')](function(_0x4a8937){if(_0x4a8937){_0x11f52c=_0x4a8937;_0x29c61f[_0x5eda('0x54')]=_[_0x5eda('0x56')](db[_0x5eda('0x3a')]['rawAttributes']);_0x29c61f[_0x5eda('0x43')]=_[_0x5eda('0x56')](_0x3ffd1d[_0x5eda('0x43')]);_0x29c61f[_0x5eda('0x57')]=_['intersection'](_0x29c61f['model'],_0x29c61f[_0x5eda('0x43')]);_0x1ee0c7[_0x5eda('0x46')]=_['intersection'](_0x29c61f['model'],qs[_0x5eda('0x59')](_0x3ffd1d['query'][_0x5eda('0x59')]));_0x1ee0c7[_0x5eda('0x46')]=_0x1ee0c7[_0x5eda('0x46')][_0x5eda('0x5a')]?_0x1ee0c7[_0x5eda('0x46')]:_0x29c61f[_0x5eda('0x54')];_0x1ee0c7['order']=qs['sort'](_0x3ffd1d['query'][_0x5eda('0xd1')]);_0x1ee0c7['where']=qs[_0x5eda('0x57')](_[_0x5eda('0xdb')](_0x3ffd1d['query'],_0x29c61f['filters']));if(_0x3ffd1d['query']['filter']){_0x1ee0c7['where']=_[_0x5eda('0x5d')](_0x1ee0c7['where'],{'$or':_[_0x5eda('0x32')](_0x1ee0c7[_0x5eda('0x46')],function(_0x50c98d){var _0x75990e={};_0x75990e[_0x50c98d]={'$like':'%'+_0x3ffd1d[_0x5eda('0x43')]['filter']+'%'};return _0x75990e;})});}_0x1ee0c7['model']=db[_0x5eda('0x3a')];_0x1ee0c7['as']=_0x5eda('0x2f');_0x1ee0c7=_[_0x5eda('0x5d')]({},_0x1ee0c7,_0x3ffd1d[_0x5eda('0x5e')]);return _0x11f52c[_0x5eda('0xf9')]({'include':[_0x1ee0c7]});}})[_0x5eda('0x42')](function(_0x197d48){if(_0x197d48){var _0x5444e1={},_0x400b66=[];for(var _0x3d657b=0x0;_0x3d657b<_0x197d48[_0x5eda('0x5a')];_0x3d657b+=0x1){for(var _0x44419b=0x0,_0x3f4277;_0x44419b<_0x197d48[_0x3d657b][_0x5eda('0x2f')][_0x5eda('0x5a')];_0x44419b+=0x1){_0x3f4277=_0x197d48[_0x3d657b][_0x5eda('0x2f')][_0x44419b][_0x5eda('0xdc')]({'plain':!![]});_0x5444e1[_0x3f4277['id']]=_0x3f4277;}}_0x5444e1=_[_0x5eda('0x126')](_0x5444e1);for(var _0x2ee70b=qs[_0x5eda('0x25')](_0x3ffd1d[_0x5eda('0x43')][_0x5eda('0x25')]);_0x2ee70b<_0x5444e1[_0x5eda('0x5a')]&&_0x400b66[_0x5eda('0x5a')]=_0x56b810[_0x1f3e('0x4a')]){throw new Error(_0x1f3e('0x4b'));}})[_0x1f3e('0x16')](function(){if(_0x36d6f9){return db[_0x1f3e('0x25')]['destroy']({'where':{'membername':_0x36d6f9[_0x1f3e('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x36d6f9){return _0x36d6f9[_0x1f3e('0x4c')]({'raw':!![]});}})[_0x1f3e('0x16')](function(_0x328870){if(_0x36d6f9){if(_0x328870){var _0x2d1f55=[];_0x59b7e8=_0x328870;if(_0x59b7e8[_0x1f3e('0x29')]){for(var _0x592dd7=0x0;_0x592dd7<_0x59b7e8['length'];_0x592dd7++){_0x2d1f55[_0x1f3e('0x2d')](db[_0x1f3e('0x25')][_0x1f3e('0x4d')]({'membername':_0x36d6f9[_0x1f3e('0x21')],'UserId':_0x36d6f9['id'],'queue_name':_0x59b7e8[_0x592dd7][_0x1f3e('0x21')],'VoiceQueueId':_0x59b7e8[_0x592dd7]['id'],'interface':_0x23073f,'paused':_0x36d6f9['loginInPause']||![],'penalty':_0x59b7e8[_0x592dd7][_0x1f3e('0x4e')]||0x0}));}return BPromise[_0x1f3e('0x43')](_0x2d1f55);}}}})['then'](function(){if(_0x36d6f9){return db[_0x1f3e('0x27')][_0x1f3e('0xd')]({'where':{'membername':_0x36d6f9['name'],'exitAt':null}});}})['then'](function(_0x130f93){if(_0x36d6f9){if(_0x130f93&&_0x130f93['length']){var _0x41d199=[];_0x130f93['forEach'](function(_0x288328){_0x41d199[_0x1f3e('0x2d')](_0x288328['update']({'exitAt':moment()[_0x1f3e('0x2a')](_0x1f3e('0x33'))}));});return BPromise[_0x1f3e('0x43')](_0x41d199);}}})[_0x1f3e('0x16')](function(){if(_0x36d6f9){var _0x23bacb=[];var _0xc2454c=[];var _0x3f113c=utils['getChannels']();var _0x254dc6={'membername':_0x36d6f9['name'],'interface':_0x23073f,'enterAt':moment()[_0x1f3e('0x2a')](_0x1f3e('0x33')),'role':_0x36d6f9[_0x1f3e('0x22')],'internal':_0x36d6f9[_0x1f3e('0x23')]};_0x3f113c['forEach'](function(_0x12d1a7){_0x23bacb[_0x1f3e('0x2d')](_[_0x1f3e('0x4f')]({'channel':_0x12d1a7,'type':_0x1f3e('0x50'),'data1':_0x1f3e('0x51'),'data2':_0x23073f},_0x254dc6));if(_0x36d6f9[_0x1f3e('0x47')]){_0xc2454c[_0x1f3e('0x2d')](_[_0x1f3e('0x4f')]({'channel':_0x12d1a7,'type':_0x1f3e('0x28'),'data1':_0x1f3e('0x52')},_0x254dc6));}});return db[_0x1f3e('0x27')]['bulkCreate'](_0x23bacb[_0x1f3e('0x53')](_0xc2454c),{'individualHooks':!![]});}})[_0x1f3e('0x16')](function(){if(_0x36d6f9){return _0x36d6f9[_0x1f3e('0x26')]({'online':!![],'lastLoginAt':moment()[_0x1f3e('0x2a')](_0x1f3e('0x33')),'voicePause':_0x36d6f9[_0x1f3e('0x47')]||![],'mailPause':_0x36d6f9[_0x1f3e('0x47')]||![],'chatPause':_0x36d6f9['loginInPause']||![],'faxPause':_0x36d6f9['loginInPause']||![],'smsPause':_0x36d6f9['loginInPause']||![],'openchannelPause':_0x36d6f9[_0x1f3e('0x47')]||![],'pauseType':_0x36d6f9['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x1f3e('0x33')),'interface':_0x23073f});}})[_0x1f3e('0x16')](function(_0x3e4f50){_0x52e77c(_0x3e4f50);})['catch'](function(_0x2202be){_0x200462(_0x67c0d9[_0x1f3e('0x1a')](0x1f4,_0x2202be['message']));});});}; \ No newline at end of file +var _0x2cf1=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','localhost','redis','./user.socket','register','GetUser','findAll','options','where','attributes','limit','include','map','model','then','debug','stringify','error','message','ShowUser','User','raw','info','catch','PauseUser','find','name','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','interface','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','isValidChannel','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','internal','online','voicePause','chatPause','faxPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','params','system','LogoutUser','all','role','mobile','phone','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','util','moment'];(function(_0x29661b,_0x41d5c8){var _0x38cf0b=function(_0x5d627b){while(--_0x5d627b){_0x29661b['push'](_0x29661b['shift']());}};_0x38cf0b(++_0x41d5c8);}(_0x2cf1,0x1b6));var _0x12cf=function(_0x1f2c2a,_0x268d76){_0x1f2c2a=_0x1f2c2a-0x0;var _0x36fbed=_0x2cf1[_0x1f2c2a];return _0x36fbed;};'use strict';var _=require('lodash');var util=require(_0x12cf('0x0'));var moment=require(_0x12cf('0x1'));var BPromise=require(_0x12cf('0x2'));var Redis=require(_0x12cf('0x3'));var db=require(_0x12cf('0x4'))['db'];var utils=require(_0x12cf('0x5'));var logger=require('../../config/logger')(_0x12cf('0x6'));var config=require(_0x12cf('0x7'));config['redis']=_['defaults'](config['redis'],{'host':_0x12cf('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12cf('0x9')]));require(_0x12cf('0xa'))[_0x12cf('0xb')](socket);exports[_0x12cf('0xc')]=function(_0x992a86){var _0x37e285=this;return new Promise(function(_0x2efdde,_0x504380){return db['User'][_0x12cf('0xd')]({'raw':_0x992a86[_0x12cf('0xe')]?_0x992a86[_0x12cf('0xe')]['raw']===undefined?!![]:![]:!![],'where':_0x992a86[_0x12cf('0xe')]?_0x992a86[_0x12cf('0xe')][_0x12cf('0xf')]||null:null,'attributes':_0x992a86[_0x12cf('0xe')]?_0x992a86['options'][_0x12cf('0x10')]||null:null,'limit':_0x992a86['options']?_0x992a86[_0x12cf('0xe')][_0x12cf('0x11')]||null:null,'include':_0x992a86['options']?_0x992a86[_0x12cf('0xe')][_0x12cf('0x12')]?_[_0x12cf('0x13')](_0x992a86[_0x12cf('0xe')][_0x12cf('0x12')],function(_0x3aaff4){return{'model':db[_0x3aaff4[_0x12cf('0x14')]],'as':_0x3aaff4['as'],'attributes':_0x3aaff4[_0x12cf('0x10')],'include':_0x3aaff4['include']?_['map'](_0x3aaff4[_0x12cf('0x12')],function(_0x5e4f92){return{'model':db[_0x5e4f92['model']],'as':_0x5e4f92['as'],'attributes':_0x5e4f92['attributes'],'include':_0x5e4f92['include']?_['map'](_0x5e4f92[_0x12cf('0x12')],function(_0x28e8a9){return{'model':db[_0x28e8a9[_0x12cf('0x14')]],'as':_0x28e8a9['as'],'attributes':_0x28e8a9[_0x12cf('0x10')]};}):[]};}):[]};}):[]:[]})[_0x12cf('0x15')](function(_0x4210be){logger['info']('GetUser',_0x992a86);logger[_0x12cf('0x16')]('GetUser',_0x992a86,JSON[_0x12cf('0x17')](_0x4210be));_0x2efdde(_0x4210be);})['catch'](function(_0x5aff29){logger[_0x12cf('0x18')](_0x12cf('0xc'),_0x5aff29[_0x12cf('0x19')],_0x992a86);_0x504380(_0x37e285[_0x12cf('0x18')](0x1f4,_0x5aff29[_0x12cf('0x19')]));});});};exports[_0x12cf('0x1a')]=function(_0x38c05a){var _0xa9b0fe=this;return new Promise(function(_0x12f3cc,_0x3c2993){return db[_0x12cf('0x1b')]['find']({'raw':_0x38c05a[_0x12cf('0xe')]?_0x38c05a[_0x12cf('0xe')][_0x12cf('0x1c')]===undefined?!![]:![]:!![],'where':_0x38c05a[_0x12cf('0xe')]?_0x38c05a['options'][_0x12cf('0xf')]||null:null,'attributes':_0x38c05a[_0x12cf('0xe')]?_0x38c05a['options'][_0x12cf('0x10')]||null:null,'include':_0x38c05a['options']?_0x38c05a[_0x12cf('0xe')][_0x12cf('0x12')]?_[_0x12cf('0x13')](_0x38c05a[_0x12cf('0xe')][_0x12cf('0x12')],function(_0x485bc1){return{'model':db[_0x485bc1[_0x12cf('0x14')]],'as':_0x485bc1['as'],'attributes':_0x485bc1[_0x12cf('0x10')],'include':_0x485bc1[_0x12cf('0x12')]?_[_0x12cf('0x13')](_0x485bc1[_0x12cf('0x12')],function(_0x56586e){return{'model':db[_0x56586e[_0x12cf('0x14')]],'as':_0x56586e['as'],'attributes':_0x56586e[_0x12cf('0x10')],'include':_0x56586e[_0x12cf('0x12')]?_[_0x12cf('0x13')](_0x56586e[_0x12cf('0x12')],function(_0x1e9996){return{'model':db[_0x1e9996[_0x12cf('0x14')]],'as':_0x1e9996['as'],'attributes':_0x1e9996[_0x12cf('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a3667){logger[_0x12cf('0x1d')](_0x12cf('0x1a'),_0x38c05a);logger[_0x12cf('0x16')](_0x12cf('0x1a'),_0x38c05a,JSON[_0x12cf('0x17')](_0x5a3667));_0x12f3cc(_0x5a3667);})[_0x12cf('0x1e')](function(_0x1ea53c){logger[_0x12cf('0x18')]('ShowUser',_0x1ea53c[_0x12cf('0x19')],_0x38c05a);_0x3c2993(_0xa9b0fe[_0x12cf('0x18')](0x1f4,_0x1ea53c[_0x12cf('0x19')]));});});};exports[_0x12cf('0x1f')]=function(_0x562961){var _0x1a69d7=this;return new Promise(function(_0x13449c,_0x556bd5){var _0x3ee019;return db[_0x12cf('0x1b')][_0x12cf('0x20')]({'where':_0x562961[_0x12cf('0xe')][_0x12cf('0xf')]||{},'attributes':['id',_0x12cf('0x21'),'role','internal','interface']})[_0x12cf('0x15')](function(_0x2195de){if(_0x2195de){_0x3ee019=_0x2195de;return db[_0x12cf('0x22')][_0x12cf('0x23')]({'paused':0x1},{'where':{'UserId':_0x3ee019['id']},'individualHooks':!![]});}})['then'](function(){if(_0x3ee019){return db[_0x12cf('0x24')][_0x12cf('0xd')]({'where':{'membername':_0x3ee019[_0x12cf('0x21')],'type':_0x12cf('0x25'),'exitAt':null}});}})[_0x12cf('0x15')](function(_0x5609b9){if(_0x3ee019){if(_0x5609b9&&_0x5609b9[_0x12cf('0x26')]){var _0x14703a=moment()[_0x12cf('0x27')](_0x12cf('0x28'));for(var _0x48b4c8=0x0,_0x3f4f8b=_0x5609b9['length'];_0x48b4c8<_0x3f4f8b;_0x48b4c8++){_0x5609b9[_0x48b4c8][_0x12cf('0x29')]({'exitAt':_0x14703a});}}}})[_0x12cf('0x15')](function(){if(_0x3ee019){var _0x1be410=[];var _0x5977a9=utils[_0x12cf('0x2a')]();_0x5977a9[_0x12cf('0x2b')](function(_0x3c02e9){_0x1be410[_0x12cf('0x2c')]({'channel':_0x3c02e9,'membername':_0x3ee019[_0x12cf('0x21')],'interface':_[_0x12cf('0x2d')](_0x3ee019[_0x12cf('0x2e')])?util[_0x12cf('0x27')](_0x12cf('0x2f'),_0x3ee019[_0x12cf('0x21')]):_0x3ee019[_0x12cf('0x2e')],'type':_0x12cf('0x25'),'enterAt':moment()[_0x12cf('0x27')](_0x12cf('0x28')),'data1':_0x562961[_0x12cf('0x30')][_0x12cf('0x31')]||_0x12cf('0x32'),'role':_0x3ee019['role'],'internal':_0x3ee019['internal'],'uniqueid':_0x562961['body'][_0x12cf('0x33')]||null});});return db[_0x12cf('0x24')][_0x12cf('0x34')](_0x1be410,{'individualHooks':!![]});}})['then'](function(){if(_0x3ee019){return _0x3ee019[_0x12cf('0x23')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x562961[_0x12cf('0x30')]['type']||_0x12cf('0x32'),'lastPauseAt':moment()[_0x12cf('0x27')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x12cf('0x15')](function(_0x3c8313){_0x13449c(_0x3c8313);})[_0x12cf('0x1e')](function(_0x37207e){_0x556bd5(_0x1a69d7[_0x12cf('0x18')](0x1f4,_0x37207e['message']));});});};exports[_0x12cf('0x35')]=function(_0x2912f0){var _0xc107ec=this;return new Promise(function(_0x143724,_0xe7425a){if(_0x2912f0[_0x12cf('0x30')]['channel']&&!utils[_0x12cf('0x36')](_0x2912f0[_0x12cf('0x30')][_0x12cf('0x37')])){throw new Error(util[_0x12cf('0x27')](_0x12cf('0x38'),_0x2912f0[_0x12cf('0x30')][_0x12cf('0x37')]));}return db[_0x12cf('0x1b')][_0x12cf('0x39')]({'where':_0x2912f0['options'][_0x12cf('0xf')]||{},'attributes':['id','name','role',_0x12cf('0x3a'),_0x12cf('0x2e'),_0x12cf('0x3b'),_0x12cf('0x3c'),'mailPause',_0x12cf('0x3d'),_0x12cf('0x3e'),'openchannelPause',_0x12cf('0x3f'),_0x12cf('0x40'),_0x12cf('0x41'),_0x12cf('0x42')]})[_0x12cf('0x15')](function(_0x58b159){if(!_0x58b159){throw new Error(util[_0x12cf('0x27')](_0x12cf('0x43'),_0x2912f0[_0x12cf('0x44')]['id']));}return _0x58b159['unpause'](_0x2912f0['body'][_0x12cf('0x37')],_0x12cf('0x45'));})[_0x12cf('0x15')](function(_0x52406e){_0x143724(_0x52406e);})[_0x12cf('0x1e')](function(_0x4181e1){_0xe7425a(_0xc107ec['error'](0x1f4,_0x4181e1[_0x12cf('0x19')]));});});};exports[_0x12cf('0x46')]=function(_0x4b5552){var _0x3d007b=this;return new Promise(function(_0x5a7af3,_0x2922fe){var _0x358a8c;return db[_0x12cf('0x1b')]['findOne']({'where':_0x4b5552[_0x12cf('0xe')]['where']||{},'attributes':['id',_0x12cf('0x21')]})[_0x12cf('0x15')](function(_0x515014){if(_0x515014){_0x358a8c=_0x515014;return db[_0x12cf('0x22')]['destroy']({'where':{'membername':_0x358a8c[_0x12cf('0x21')]},'individualHooks':!![]});}})[_0x12cf('0x15')](function(){if(_0x358a8c){return db['MemberReport'][_0x12cf('0xd')]({'where':{'membername':_0x358a8c[_0x12cf('0x21')],'exitAt':null}});}})['then'](function(_0x51da21){if(_0x358a8c){if(_0x51da21&&_0x51da21[_0x12cf('0x26')]){var _0x54505f=[];_0x51da21[_0x12cf('0x2b')](function(_0x2da6a6){_0x54505f[_0x12cf('0x2c')](_0x2da6a6[_0x12cf('0x23')]({'exitAt':moment()[_0x12cf('0x27')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x12cf('0x47')](_0x54505f);}}})[_0x12cf('0x15')](function(){if(_0x358a8c){return _0x358a8c[_0x12cf('0x23')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x12cf('0x15')](function(_0x596bbe){_0x5a7af3(_0x596bbe);})['catch'](function(_0x51fbc4){_0x2922fe(_0x3d007b[_0x12cf('0x18')](0x1f4,_0x51fbc4['message']));});});};exports['LoginUser']=function(_0x4e9926){var _0x40bbb1=this;return new Promise(function(_0x4521c9,_0x348288){var _0x4fc8c9;var _0x53b779;var _0x184d1e;var _0x3a0d28;return db[_0x12cf('0x1b')][_0x12cf('0x39')]({'where':_0x4e9926[_0x12cf('0xe')][_0x12cf('0xf')]||{},'attributes':['id',_0x12cf('0x21'),_0x12cf('0x48'),_0x12cf('0x49'),_0x12cf('0x4a'),_0x12cf('0x3a'),'loginInPause',_0x12cf('0x2e')]})[_0x12cf('0x15')](function(_0x5852b5){if(_0x5852b5){_0x4fc8c9=_0x5852b5;_0x3a0d28=_0x4e9926[_0x12cf('0x30')][_0x12cf('0x2e')]?_0x4e9926['body'][_0x12cf('0x2e')]:util[_0x12cf('0x27')](_0x12cf('0x2f'),_0x4fc8c9[_0x12cf('0x21')]);return db[_0x12cf('0x1b')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4fc8c9['id']}}});}})[_0x12cf('0x15')](function(_0x17ba7b){if(_0x17ba7b){_0x184d1e=_0x17ba7b;return require(_0x12cf('0x4b'))[_0x12cf('0x4c')]();}})['then'](function(_0x5bf51e){if(_0x5bf51e&&_0x5bf51e['agents']&&_0x184d1e>=_0x5bf51e[_0x12cf('0x4d')]){throw new Error(_0x12cf('0x4e'));}})[_0x12cf('0x15')](function(){if(_0x4fc8c9){return db[_0x12cf('0x22')][_0x12cf('0x4f')]({'where':{'membername':_0x4fc8c9['name']},'individualHooks':!![]});}})[_0x12cf('0x15')](function(){if(_0x4fc8c9){return _0x4fc8c9[_0x12cf('0x50')]({'raw':!![]});}})['then'](function(_0x3bf682){if(_0x4fc8c9){if(_0x3bf682){var _0x3d4379=[];_0x53b779=_0x3bf682;if(_0x53b779[_0x12cf('0x26')]){for(var _0x2a053b=0x0;_0x2a053b<_0x53b779[_0x12cf('0x26')];_0x2a053b++){_0x3d4379[_0x12cf('0x2c')](db[_0x12cf('0x22')][_0x12cf('0x51')]({'membername':_0x4fc8c9[_0x12cf('0x21')],'UserId':_0x4fc8c9['id'],'queue_name':_0x53b779[_0x2a053b][_0x12cf('0x21')],'VoiceQueueId':_0x53b779[_0x2a053b]['id'],'interface':_0x3a0d28,'paused':_0x4fc8c9[_0x12cf('0x52')]||![],'penalty':_0x53b779[_0x2a053b][_0x12cf('0x53')]||0x0}));}return BPromise[_0x12cf('0x47')](_0x3d4379);}}}})['then'](function(){if(_0x4fc8c9){return db[_0x12cf('0x24')][_0x12cf('0xd')]({'where':{'membername':_0x4fc8c9[_0x12cf('0x21')],'exitAt':null}});}})[_0x12cf('0x15')](function(_0x4472fb){if(_0x4fc8c9){if(_0x4472fb&&_0x4472fb[_0x12cf('0x26')]){var _0x1d524a=[];_0x4472fb[_0x12cf('0x2b')](function(_0x3c2f83){_0x1d524a[_0x12cf('0x2c')](_0x3c2f83[_0x12cf('0x23')]({'exitAt':moment()[_0x12cf('0x27')](_0x12cf('0x28'))}));});return BPromise[_0x12cf('0x47')](_0x1d524a);}}})['then'](function(){if(_0x4fc8c9){var _0x258bc8=[];var _0x3026dc=[];var _0x5ac72b=utils[_0x12cf('0x2a')]();var _0x372419={'membername':_0x4fc8c9[_0x12cf('0x21')],'interface':_0x3a0d28,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4fc8c9[_0x12cf('0x48')],'internal':_0x4fc8c9[_0x12cf('0x3a')]};_0x5ac72b[_0x12cf('0x2b')](function(_0xe5b834){_0x258bc8['push'](_[_0x12cf('0x54')]({'channel':_0xe5b834,'type':_0x12cf('0x55'),'data1':_0x12cf('0x56'),'data2':_0x3a0d28},_0x372419));if(_0x4fc8c9['loginInPause']){_0x3026dc[_0x12cf('0x2c')](_[_0x12cf('0x54')]({'channel':_0xe5b834,'type':_0x12cf('0x25'),'data1':_0x12cf('0x57')},_0x372419));}});return db[_0x12cf('0x24')][_0x12cf('0x34')](_0x258bc8['concat'](_0x3026dc),{'individualHooks':!![]});}})['then'](function(){if(_0x4fc8c9){return _0x4fc8c9[_0x12cf('0x23')]({'online':!![],'lastLoginAt':moment()['format'](_0x12cf('0x28')),'voicePause':_0x4fc8c9[_0x12cf('0x52')]||![],'mailPause':_0x4fc8c9[_0x12cf('0x52')]||![],'chatPause':_0x4fc8c9[_0x12cf('0x52')]||![],'faxPause':_0x4fc8c9[_0x12cf('0x52')]||![],'smsPause':_0x4fc8c9[_0x12cf('0x52')]||![],'openchannelPause':_0x4fc8c9[_0x12cf('0x52')]||![],'pauseType':_0x4fc8c9['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x12cf('0x27')](_0x12cf('0x28')),'interface':_0x3a0d28});}})[_0x12cf('0x15')](function(_0x1a8a68){_0x4521c9(_0x1a8a68);})[_0x12cf('0x1e')](function(_0xaf6d72){_0x348288(_0x40bbb1['error'](0x1f4,_0xaf6d72[_0x12cf('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index cc5b352..417701a 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 _0x8f59=['save','emit','removeListener','register','length'];(function(_0x16b334,_0x58bd7f){var _0x54aff2=function(_0x366b0e){while(--_0x366b0e){_0x16b334['push'](_0x16b334['shift']());}};_0x54aff2(++_0x58bd7f);}(_0x8f59,0x64));var _0x98f5=function(_0xb30a60,_0x19580f){_0xb30a60=_0xb30a60-0x0;var _0x381a7b=_0x8f59[_0xb30a60];return _0x381a7b;};'use strict';var UserEvents=require('./user.events');var events=[_0x98f5('0x0'),'remove','update'];function createListener(_0x5a2ebf,_0x44c800){return function(_0xbee469){_0x44c800[_0x98f5('0x1')](_0x5a2ebf,_0xbee469);};}function removeListener(_0x463226,_0x3e8b6d){return function(){UserEvents[_0x98f5('0x2')](_0x463226,_0x3e8b6d);};}exports[_0x98f5('0x3')]=function(_0x1d95d7){for(var _0x2a158d=0x0,_0x59bf57=events[_0x98f5('0x4')];_0x2a158d<_0x59bf57;_0x2a158d++){var _0xdc0600=events[_0x2a158d];var _0x45d9d0=createListener('user:'+_0xdc0600,_0x1d95d7);UserEvents['on'](_0xdc0600,_0x45d9d0);}}; \ No newline at end of file +var _0x62c8=['removeListener','register','length','user:','./user.events','save','update'];(function(_0x208f39,_0x552e59){var _0x24fbf9=function(_0x496e8e){while(--_0x496e8e){_0x208f39['push'](_0x208f39['shift']());}};_0x24fbf9(++_0x552e59);}(_0x62c8,0x1a1));var _0x862c=function(_0x1bbea5,_0x55cde2){_0x1bbea5=_0x1bbea5-0x0;var _0x3d0c19=_0x62c8[_0x1bbea5];return _0x3d0c19;};'use strict';var UserEvents=require(_0x862c('0x0'));var events=[_0x862c('0x1'),'remove',_0x862c('0x2')];function createListener(_0x5b2935,_0x19c069){return function(_0x1ec2a7){_0x19c069['emit'](_0x5b2935,_0x1ec2a7);};}function removeListener(_0x5d6cbd,_0xfd24f8){return function(){UserEvents[_0x862c('0x3')](_0x5d6cbd,_0xfd24f8);};}exports[_0x862c('0x4')]=function(_0x2debe7){for(var _0xfbc6c8=0x0,_0x499eea=events[_0x862c('0x5')];_0xfbc6c8<_0x499eea;_0xfbc6c8++){var _0x5ba3d9=events[_0xfbc6c8];var _0x48d1f6=createListener(_0x862c('0x6')+_0x5ba3d9,_0x2debe7);UserEvents['on'](_0x5ba3d9,_0x48d1f6);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 4c4c428..fcf880e 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2f73ee,_0x5124f5){var _0x466ad8=function(_0x433f63){while(--_0x433f63){_0x2f73ee['push'](_0x2f73ee['shift']());}};_0x466ad8(++_0x5124f5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1c0261,_0xbe62af){var _0x1f81d0=function(_0xd4ea57){while(--_0xd4ea57){_0x1c0261['push'](_0x1c0261['shift']());}};_0x1f81d0(++_0xbe62af);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 10ba7c8..d863e63 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 _0xdf8e=['INTEGER','sequelize'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0xdf8e,0xcd));var _0xedf8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xdf8e[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xedf8('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xedf8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb8ba=['INTEGER','sequelize','exports'];(function(_0x4078f9,_0x175021){var _0x5222da=function(_0x295867){while(--_0x295867){_0x4078f9['push'](_0x4078f9['shift']());}};_0x5222da(++_0x175021);}(_0xb8ba,0x6d));var _0xab8b=function(_0x28d6f2,_0x5505d2){_0x28d6f2=_0x28d6f2-0x0;var _0x1f80df=_0xb8ba[_0x28d6f2];return _0x1f80df;};'use strict';var Sequelize=require(_0xab8b('0x0'));module[_0xab8b('0x1')]={'penalty':{'type':Sequelize[_0xab8b('0x2')],'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 689c9f1..8b61a7c 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 _0xfc78=['define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird','path','exports'];(function(_0x4bcd6c,_0x580c15){var _0x410127=function(_0x5d6b38){while(--_0x5d6b38){_0x4bcd6c['push'](_0x4bcd6c['shift']());}};_0x410127(++_0x580c15);}(_0xfc78,0xfd));var _0x8fc7=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0xfc78[_0x585d81];return _0x1aca0d;};'use strict';var _=require(_0x8fc7('0x0'));var util=require('util');var logger=require(_0x8fc7('0x1'))(_0x8fc7('0x2'));var moment=require(_0x8fc7('0x3'));var BPromise=require(_0x8fc7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fc7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0x8fc7('0x6')]=function(_0x33a025,_0x2e5e89){return _0x33a025[_0x8fc7('0x7')](_0x8fc7('0x8'),attributes,{'tableName':_0x8fc7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x279e=['../../config/environment','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dcd98,_0x3fbec0){var _0x14bcb6=function(_0x553294){while(--_0x553294){_0x3dcd98['push'](_0x3dcd98['shift']());}};_0x14bcb6(++_0x3fbec0);}(_0x279e,0xa0));var _0xe279=function(_0x4b95da,_0x4fe5a2){_0x4b95da=_0x4b95da-0x0;var _0x202b58=_0x279e[_0x4b95da];return _0x202b58;};'use strict';var _=require(_0xe279('0x0'));var util=require(_0xe279('0x1'));var logger=require(_0xe279('0x2'))(_0xe279('0x3'));var moment=require(_0xe279('0x4'));var BPromise=require(_0xe279('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe279('0x6'));var rimraf=require(_0xe279('0x7'));var config=require(_0xe279('0x8'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x531a0a,_0x1f31c3){return _0x531a0a[_0xe279('0x9')](_0xe279('0xa'),attributes,{'tableName':_0xe279('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index d66c7d6..e03d68e 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 _0xcba4=['lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x2ea90e,_0x32f182){var _0x1dede4=function(_0x427ef5){while(--_0x427ef5){_0x2ea90e['push'](_0x2ea90e['shift']());}};_0x1dede4(++_0x32f182);}(_0xcba4,0x1cc));var _0x4cba=function(_0xb958ca,_0x5e3cc0){_0xb958ca=_0xb958ca-0x0;var _0x50c74b=_0xcba4[_0xb958ca];return _0x50c74b;};'use strict';var _=require(_0x4cba('0x0'));var util=require(_0x4cba('0x1'));var moment=require(_0x4cba('0x2'));var BPromise=require(_0x4cba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4cba('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4cba('0x5'));var config=require(_0x4cba('0x6'));var jayson=require(_0x4cba('0x7'));var client=jayson['client'][_0x4cba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x349a1e,_0xa8d6c7,_0x2b38de){return new BPromise(function(_0x96c02a,_0x424552){return client[_0x4cba('0x9')](_0x349a1e,_0x2b38de)[_0x4cba('0xa')](function(_0x472095){logger[_0x4cba('0xb')](_0x4cba('0xc'),_0xa8d6c7,_0x4cba('0xd'));logger[_0x4cba('0xe')](_0x4cba('0xf'),_0xa8d6c7,_0x4cba('0xd'),JSON['stringify'](_0x472095));if(_0x472095[_0x4cba('0x10')]){if(_0x472095['error'][_0x4cba('0x11')]===0x1f4){logger['error'](_0x4cba('0xc'),_0xa8d6c7,_0x472095[_0x4cba('0x10')][_0x4cba('0x12')]);return _0x424552(_0x472095[_0x4cba('0x10')][_0x4cba('0x12')]);}logger[_0x4cba('0x10')]('UserChatQueue,\x20%s,\x20%s',_0xa8d6c7,_0x472095[_0x4cba('0x10')][_0x4cba('0x12')]);return _0x96c02a(_0x472095['error'][_0x4cba('0x12')]);}else{logger['info'](_0x4cba('0xc'),_0xa8d6c7,_0x4cba('0xd'));_0x96c02a(_0x472095['result'][_0x4cba('0x12')]);}})[_0x4cba('0x13')](function(_0x351f43){logger[_0x4cba('0x10')](_0x4cba('0xc'),_0xa8d6c7,_0x351f43);_0x424552(_0x351f43);});});} \ No newline at end of file +var _0x679b=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x52e95e,_0x2db1ff){var _0x4f52a2=function(_0x3a4db3){while(--_0x3a4db3){_0x52e95e['push'](_0x52e95e['shift']());}};_0x4f52a2(++_0x2db1ff);}(_0x679b,0x1c9));var _0xb679=function(_0x2c7d89,_0x3ace80){_0x2c7d89=_0x2c7d89-0x0;var _0x4438ed=_0x679b[_0x2c7d89];return _0x4438ed;};'use strict';var _=require(_0xb679('0x0'));var util=require(_0xb679('0x1'));var moment=require(_0xb679('0x2'));var BPromise=require('bluebird');var rs=require(_0xb679('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb679('0x4'));var logger=require(_0xb679('0x5'))(_0xb679('0x6'));var config=require(_0xb679('0x7'));var jayson=require(_0xb679('0x8'));var client=jayson[_0xb679('0x9')][_0xb679('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1da464,_0x159df8,_0x539148){return new BPromise(function(_0xea9845,_0x309d10){return client[_0xb679('0xb')](_0x1da464,_0x539148)[_0xb679('0xc')](function(_0x17b5fe){logger[_0xb679('0xd')](_0xb679('0xe'),_0x159df8,'request\x20sent');logger[_0xb679('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x159df8,_0xb679('0x10'),JSON[_0xb679('0x11')](_0x17b5fe));if(_0x17b5fe['error']){if(_0x17b5fe[_0xb679('0x12')][_0xb679('0x13')]===0x1f4){logger[_0xb679('0x12')](_0xb679('0xe'),_0x159df8,_0x17b5fe[_0xb679('0x12')][_0xb679('0x14')]);return _0x309d10(_0x17b5fe[_0xb679('0x12')][_0xb679('0x14')]);}logger[_0xb679('0x12')](_0xb679('0xe'),_0x159df8,_0x17b5fe[_0xb679('0x12')][_0xb679('0x14')]);return _0xea9845(_0x17b5fe[_0xb679('0x12')][_0xb679('0x14')]);}else{logger[_0xb679('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x159df8,'request\x20sent');_0xea9845(_0x17b5fe[_0xb679('0x15')][_0xb679('0x14')]);}})[_0xb679('0x16')](function(_0x2dedd5){logger[_0xb679('0x12')](_0xb679('0xe'),_0x159df8,_0x2dedd5);_0x309d10(_0x2dedd5);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 7ea19f8..bcce8f8 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(_0x335f55,_0x5f3085){var _0x204016=function(_0x445316){while(--_0x445316){_0x335f55['push'](_0x335f55['shift']());}};_0x204016(++_0x5f3085);}(_0x70e0,0x17b));var _0x070e=function(_0x842d0a,_0x54ae2d){_0x842d0a=_0x842d0a-0x0;var _0x4c6ff8=_0x70e0[_0x842d0a];return _0x4c6ff8;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x47a385,_0x5d8781){var _0x31abb9=function(_0x210f7a){while(--_0x210f7a){_0x47a385['push'](_0x47a385['shift']());}};_0x31abb9(++_0x5d8781);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 9d408b9..63269dd 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 _0xf9e3=['STRING','sequelize','exports','INTEGER'];(function(_0x4366c2,_0x257ccd){var _0x532888=function(_0x388efb){while(--_0x388efb){_0x4366c2['push'](_0x4366c2['shift']());}};_0x532888(++_0x257ccd);}(_0xf9e3,0xad));var _0x3f9e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xf9e3[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x3f9e('0x0'));module[_0x3f9e('0x1')]={'penalty':{'type':Sequelize[_0x3f9e('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3f9e('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x3f9e('0x3')]}}; \ No newline at end of file +var _0x3446=['sequelize','exports','STRING'];(function(_0x29fe77,_0x59699b){var _0x4e998f=function(_0x2048f1){while(--_0x2048f1){_0x29fe77['push'](_0x29fe77['shift']());}};_0x4e998f(++_0x59699b);}(_0x3446,0x177));var _0x6344=function(_0x2e145a,_0x179afd){_0x2e145a=_0x2e145a-0x0;var _0x23d5ea=_0x3446[_0x2e145a];return _0x23d5ea;};'use strict';var Sequelize=require(_0x6344('0x0'));module[_0x6344('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x6344('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 5b154cb..0b88987 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 _0x4fc6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','util'];(function(_0x531e48,_0x4bb96b){var _0x202971=function(_0x403bf5){while(--_0x403bf5){_0x531e48['push'](_0x531e48['shift']());}};_0x202971(++_0x4bb96b);}(_0x4fc6,0x11d));var _0x64fc=function(_0x5c36bd,_0x17b0a5){_0x5c36bd=_0x5c36bd-0x0;var _0x7bf0c6=_0x4fc6[_0x5c36bd];return _0x7bf0c6;};'use strict';var _=require('lodash');var util=require(_0x64fc('0x0'));var logger=require(_0x64fc('0x1'))(_0x64fc('0x2'));var moment=require(_0x64fc('0x3'));var BPromise=require(_0x64fc('0x4'));var rp=require(_0x64fc('0x5'));var fs=require('fs');var path=require(_0x64fc('0x6'));var rimraf=require(_0x64fc('0x7'));var config=require('../../config/environment');var attributes=require(_0x64fc('0x8'));module[_0x64fc('0x9')]=function(_0x21bc26,_0x374540){return _0x21bc26[_0x64fc('0xa')](_0x64fc('0xb'),attributes,{'tableName':_0x64fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab34=['define','UserFaxQueue','user_has_fax_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports'];(function(_0x4bc821,_0x4b0e8f){var _0x3f914e=function(_0x3dfb28){while(--_0x3dfb28){_0x4bc821['push'](_0x4bc821['shift']());}};_0x3f914e(++_0x4b0e8f);}(_0xab34,0x12e));var _0x4ab3=function(_0x52437f,_0x581166){_0x52437f=_0x52437f-0x0;var _0x8b859=_0xab34[_0x52437f];return _0x8b859;};'use strict';var _=require(_0x4ab3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4ab3('0x1'));var moment=require(_0x4ab3('0x2'));var BPromise=require(_0x4ab3('0x3'));var rp=require(_0x4ab3('0x4'));var fs=require('fs');var path=require(_0x4ab3('0x5'));var rimraf=require(_0x4ab3('0x6'));var config=require(_0x4ab3('0x7'));var attributes=require(_0x4ab3('0x8'));module[_0x4ab3('0x9')]=function(_0x1eae52,_0x32e129){return _0x1eae52[_0x4ab3('0xa')](_0x4ab3('0xb'),attributes,{'tableName':_0x4ab3('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 c50cd25..c57f9e3 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 _0x20d4=['then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x20d4,0x13a));var _0x420d=function(_0x17a02b,_0x1f427e){_0x17a02b=_0x17a02b-0x0;var _0x418107=_0x20d4[_0x17a02b];return _0x418107;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x420d('0x0'));var BPromise=require('bluebird');var rs=require(_0x420d('0x1'));var fs=require('fs');var Redis=require(_0x420d('0x2'));var db=require(_0x420d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x420d('0x4'))(_0x420d('0x5'));var config=require(_0x420d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x420d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x455f6c,_0x381d95,_0x11d506){return new BPromise(function(_0x3fb151,_0x3b1c82){return client[_0x420d('0x8')](_0x455f6c,_0x11d506)[_0x420d('0x9')](function(_0x250ff0){logger[_0x420d('0xa')](_0x420d('0xb'),_0x381d95,_0x420d('0xc'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x381d95,_0x420d('0xc'),JSON[_0x420d('0xd')](_0x250ff0));if(_0x250ff0[_0x420d('0xe')]){if(_0x250ff0[_0x420d('0xe')][_0x420d('0xf')]===0x1f4){logger[_0x420d('0xe')](_0x420d('0xb'),_0x381d95,_0x250ff0[_0x420d('0xe')][_0x420d('0x10')]);return _0x3b1c82(_0x250ff0[_0x420d('0xe')][_0x420d('0x10')]);}logger[_0x420d('0xe')](_0x420d('0xb'),_0x381d95,_0x250ff0['error'][_0x420d('0x10')]);return _0x3fb151(_0x250ff0['error'][_0x420d('0x10')]);}else{logger[_0x420d('0xa')](_0x420d('0xb'),_0x381d95,_0x420d('0xc'));_0x3fb151(_0x250ff0[_0x420d('0x11')][_0x420d('0x10')]);}})[_0x420d('0x12')](function(_0x5760d4){logger[_0x420d('0xe')](_0x420d('0xb'),_0x381d95,_0x5760d4);_0x3b1c82(_0x5760d4);});});} \ No newline at end of file +var _0xde58=['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','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x41707c,_0x65e3ef){var _0x66865a=function(_0x53655a){while(--_0x53655a){_0x41707c['push'](_0x41707c['shift']());}};_0x66865a(++_0x65e3ef);}(_0xde58,0xa7));var _0x8de5=function(_0x3e04c4,_0x48101b){_0x3e04c4=_0x3e04c4-0x0;var _0x543e0f=_0xde58[_0x3e04c4];return _0x543e0f;};'use strict';var _=require(_0x8de5('0x0'));var util=require(_0x8de5('0x1'));var moment=require(_0x8de5('0x2'));var BPromise=require(_0x8de5('0x3'));var rs=require(_0x8de5('0x4'));var fs=require('fs');var Redis=require(_0x8de5('0x5'));var db=require(_0x8de5('0x6'))['db'];var utils=require(_0x8de5('0x7'));var logger=require(_0x8de5('0x8'))(_0x8de5('0x9'));var config=require(_0x8de5('0xa'));var jayson=require(_0x8de5('0xb'));var client=jayson[_0x8de5('0xc')][_0x8de5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5d219b,_0x1bafa0,_0x101f72){return new BPromise(function(_0x10b576,_0x5c239a){return client[_0x8de5('0xe')](_0x5d219b,_0x101f72)[_0x8de5('0xf')](function(_0x33e277){logger[_0x8de5('0x10')](_0x8de5('0x11'),_0x1bafa0,_0x8de5('0x12'));logger[_0x8de5('0x13')](_0x8de5('0x14'),_0x1bafa0,'request\x20sent',JSON[_0x8de5('0x15')](_0x33e277));if(_0x33e277['error']){if(_0x33e277[_0x8de5('0x16')][_0x8de5('0x17')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x1bafa0,_0x33e277[_0x8de5('0x16')]['message']);return _0x5c239a(_0x33e277[_0x8de5('0x16')][_0x8de5('0x18')]);}logger[_0x8de5('0x16')](_0x8de5('0x11'),_0x1bafa0,_0x33e277[_0x8de5('0x16')]['message']);return _0x10b576(_0x33e277[_0x8de5('0x16')]['message']);}else{logger[_0x8de5('0x10')](_0x8de5('0x11'),_0x1bafa0,_0x8de5('0x12'));_0x10b576(_0x33e277[_0x8de5('0x19')][_0x8de5('0x18')]);}})[_0x8de5('0x1a')](function(_0x1e050c){logger[_0x8de5('0x16')](_0x8de5('0x11'),_0x1bafa0,_0x1e050c);_0x5c239a(_0x1e050c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index fb6da98..6c605b8 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x12a66f,_0x30e98d){var _0x36a7d9=function(_0x235039){while(--_0x235039){_0x12a66f['push'](_0x12a66f['shift']());}};_0x36a7d9(++_0x30e98d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3d0c5d,_0x32c242){var _0x16f62=function(_0x4b623a){while(--_0x4b623a){_0x3d0c5d['push'](_0x3d0c5d['shift']());}};_0x16f62(++_0x32c242);}(_0xe706,0xa3));var _0x6e70=function(_0xcb785d,_0x29e22d){_0xcb785d=_0xcb785d-0x0;var _0x6e8faf=_0xe706[_0xcb785d];return _0x6e8faf;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index c890a6a..f569fab 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 _0xee3a=['sequelize','exports','INTEGER'];(function(_0x239d32,_0x1b0a16){var _0x550a57=function(_0x2098f0){while(--_0x2098f0){_0x239d32['push'](_0x239d32['shift']());}};_0x550a57(++_0x1b0a16);}(_0xee3a,0x1ad));var _0xaee3=function(_0x417f51,_0x557c6c){_0x417f51=_0x417f51-0x0;var _0x4f66e5=_0xee3a[_0x417f51];return _0x4f66e5;};'use strict';var Sequelize=require(_0xaee3('0x0'));module[_0xaee3('0x1')]={'penalty':{'type':Sequelize[_0xaee3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x53ea=['INTEGER','sequelize'];(function(_0x5bae6c,_0x4ce398){var _0x386724=function(_0x2d82e7){while(--_0x2d82e7){_0x5bae6c['push'](_0x5bae6c['shift']());}};_0x386724(++_0x4ce398);}(_0x53ea,0x10d));var _0xa53e=function(_0x25c194,_0x36f320){_0x25c194=_0x25c194-0x0;var _0x112355=_0x53ea[_0x25c194];return _0x112355;};'use strict';var Sequelize=require(_0xa53e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa53e('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 929fe68..585667f 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 _0x25f7=['UserMailQueue','user_has_mail_queues','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','define'];(function(_0x4cb867,_0x1f764f){var _0x364c50=function(_0x15593a){while(--_0x15593a){_0x4cb867['push'](_0x4cb867['shift']());}};_0x364c50(++_0x1f764f);}(_0x25f7,0x9c));var _0x725f=function(_0x55bd6f,_0x2a1dce){_0x55bd6f=_0x55bd6f-0x0;var _0x5a1a3a=_0x25f7[_0x55bd6f];return _0x5a1a3a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x725f('0x0'))(_0x725f('0x1'));var moment=require('moment');var BPromise=require(_0x725f('0x2'));var rp=require(_0x725f('0x3'));var fs=require('fs');var path=require(_0x725f('0x4'));var rimraf=require(_0x725f('0x5'));var config=require(_0x725f('0x6'));var attributes=require(_0x725f('0x7'));module['exports']=function(_0x2da6cf,_0x1af25f){return _0x2da6cf[_0x725f('0x8')](_0x725f('0x9'),attributes,{'tableName':_0x725f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddae=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','user_has_mail_queues','lodash'];(function(_0x288688,_0x615a19){var _0x3e0df8=function(_0x17961d){while(--_0x17961d){_0x288688['push'](_0x288688['shift']());}};_0x3e0df8(++_0x615a19);}(_0xddae,0xba));var _0xedda=function(_0xe43c8,_0x3bcf87){_0xe43c8=_0xe43c8-0x0;var _0x3a0e47=_0xddae[_0xe43c8];return _0x3a0e47;};'use strict';var _=require(_0xedda('0x0'));var util=require(_0xedda('0x1'));var logger=require(_0xedda('0x2'))(_0xedda('0x3'));var moment=require(_0xedda('0x4'));var BPromise=require(_0xedda('0x5'));var rp=require(_0xedda('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xedda('0x7'));var attributes=require('./userMailQueue.attributes');module[_0xedda('0x8')]=function(_0x304d60,_0x2cff64){return _0x304d60[_0xedda('0x9')]('UserMailQueue',attributes,{'tableName':_0xedda('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 7bf2183..b59f982 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xeb1811,_0x1350be){var _0x47ebeb=function(_0x130ffd){while(--_0x130ffd){_0xeb1811['push'](_0xeb1811['shift']());}};_0x47ebeb(++_0x1350be);}(_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 moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2e224e,_0x54f068){var _0x57e386=function(_0x23c2ac){while(--_0x23c2ac){_0x2e224e['push'](_0x2e224e['shift']());}};_0x57e386(++_0x54f068);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x437d7f,_0x1feb46){_0x437d7f=_0x437d7f-0x0;var _0x31058c=_0x7fbe[_0x437d7f];return _0x31058c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 5fa8779..9d8d358 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 _0x4b8b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','util','connect-timeout','express','Router'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x4b8b,0x174));var _0xb4b8=function(_0x2331f8,_0x446a3a){_0x2331f8=_0x2331f8-0x0;var _0x244773=_0x4b8b[_0x2331f8];return _0x244773;};'use strict';var multer=require(_0xb4b8('0x0'));var util=require(_0xb4b8('0x1'));var path=require('path');var timeout=require(_0xb4b8('0x2'));var express=require(_0xb4b8('0x3'));var router=express[_0xb4b8('0x4')]();var fs_extra=require(_0xb4b8('0x5'));var auth=require(_0xb4b8('0x6'));var interaction=require(_0xb4b8('0x7'));var config=require(_0xb4b8('0x8'));var controller=require(_0xb4b8('0x9'));router[_0xb4b8('0xa')]('/',auth[_0xb4b8('0xb')](),controller['sendUserNotification']);module[_0xb4b8('0xc')]=router; \ No newline at end of file +var _0x26ce=['isAuthenticated','sendUserNotification','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','post'];(function(_0x582f8d,_0x1a62bb){var _0x526cbf=function(_0x3e5099){while(--_0x3e5099){_0x582f8d['push'](_0x582f8d['shift']());}};_0x526cbf(++_0x1a62bb);}(_0x26ce,0x10b));var _0xe26c=function(_0x2bf3ef,_0x1f97a8){_0x2bf3ef=_0x2bf3ef-0x0;var _0x2315ce=_0x26ce[_0x2bf3ef];return _0x2315ce;};'use strict';var multer=require(_0xe26c('0x0'));var util=require('util');var path=require(_0xe26c('0x1'));var timeout=require(_0xe26c('0x2'));var express=require(_0xe26c('0x3'));var router=express['Router']();var fs_extra=require(_0xe26c('0x4'));var auth=require(_0xe26c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe26c('0x6'));var controller=require(_0xe26c('0x7'));router[_0xe26c('0x8')]('/',auth[_0xe26c('0x9')](),controller[_0xe26c('0xa')]);module[_0xe26c('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 7e674e0..1fccec4 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 _0x9136=['STRING','BOOLEAN','exports'];(function(_0x4b38ad,_0x6c9152){var _0x5f6270=function(_0x53eb8a){while(--_0x53eb8a){_0x4b38ad['push'](_0x4b38ad['shift']());}};_0x5f6270(++_0x6c9152);}(_0x9136,0xa4));var _0x6913=function(_0x4783dc,_0x13b6ce){_0x4783dc=_0x4783dc-0x0;var _0x3f7598=_0x9136[_0x4783dc];return _0x3f7598;};'use strict';var Sequelize=require('sequelize');module[_0x6913('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x6913('0x1')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x6913('0x1')]},'beep':{'type':Sequelize[_0x6913('0x2')]}}; \ No newline at end of file +var _0xacb1=['STRING','sequelize','exports','TEXT'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xacb1,0x165));var _0x1acb=function(_0x2adb36,_0x3b4afb){_0x2adb36=_0x2adb36-0x0;var _0x31bfbb=_0xacb1[_0x2adb36];return _0x31bfbb;};'use strict';var Sequelize=require(_0x1acb('0x0'));module[_0x1acb('0x1')]={'body':{'type':Sequelize[_0x1acb('0x2')]},'senderName':{'type':Sequelize[_0x1acb('0x3')]},'recipientsId':{'type':Sequelize[_0x1acb('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index f72ca72..fd85752 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 _0x16d2=['recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','User','replace','queue','Queue','push','all','getAgents','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','faxqueue','whatsappqueue','team','user','some','includes','toLowerCase','senderName','fullname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16d2,0x18d));var _0x216d=function(_0x3f610f,_0x37b88d){_0x3f610f=_0x3f610f-0x0;var _0xe60ea3=_0x16d2[_0x3f610f];return _0xe60ea3;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x216d('0x3'));var moment=require(_0x216d('0x4'));var BPromise=require(_0x216d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x216d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x216d('0x7'));var fs=require('fs');var fs_extra=require(_0x216d('0x8'));var _=require(_0x216d('0x9'));var squel=require(_0x216d('0xa'));var crypto=require('crypto');var jsforce=require(_0x216d('0xb'));var deskjs=require(_0x216d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x216d('0xd'));var Papa=require(_0x216d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x216d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x216d('0x10'))(_0x216d('0x11'));var utils=require(_0x216d('0x12'));var config=require(_0x216d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x216d('0x14'))['db'];config[_0x216d('0x15')]=_['defaults'](config[_0x216d('0x15')],{'host':_0x216d('0x16'),'port':0x18eb});var socket=require(_0x216d('0x17'))(new Redis(config[_0x216d('0x15')]));require('./userNotification.socket')[_0x216d('0x18')](socket);function respondWithStatusCode(_0x12a549,_0x3b1656){_0x3b1656=_0x3b1656||0xcc;return function(_0x370576){if(_0x370576){return _0x12a549[_0x216d('0x19')](_0x3b1656);}return _0x12a549[_0x216d('0x1a')](_0x3b1656)[_0x216d('0x1b')]();};}function respondWithResult(_0x2715ad,_0x4f0cc8){_0x4f0cc8=_0x4f0cc8||0xc8;return function(_0xefc46a){if(_0xefc46a){return _0x2715ad[_0x216d('0x1a')](_0x4f0cc8)[_0x216d('0x1c')](_0xefc46a);}};}function respondWithFilteredResult(_0x5744a6,_0xe9b9b9){return function(_0x3a43f1){if(_0x3a43f1){var _0x42cfd1=typeof _0xe9b9b9[_0x216d('0x1d')]===_0x216d('0x1e')&&typeof _0xe9b9b9[_0x216d('0x1f')]===_0x216d('0x1e');var _0x54c988=_0x3a43f1[_0x216d('0x20')];var _0x5e9b18=_0x42cfd1?0x0:_0xe9b9b9[_0x216d('0x1d')];var _0x3c4c6f=_0x42cfd1?_0x3a43f1['count']:_0xe9b9b9['offset']+_0xe9b9b9['limit'];var _0x5646d2;if(_0x3c4c6f>=_0x54c988){_0x3c4c6f=_0x54c988;_0x5646d2=0xc8;}else{_0x5646d2=0xce;}_0x5744a6[_0x216d('0x1a')](_0x5646d2);return _0x5744a6[_0x216d('0x21')]('Content-Range',_0x5e9b18+'-'+_0x3c4c6f+'/'+_0x54c988)[_0x216d('0x1c')](_0x3a43f1);}return null;};}function patchUpdates(_0x4c3aa2){return function(_0x4a4c12){try{jsonpatch[_0x216d('0x22')](_0x4a4c12,_0x4c3aa2,!![]);}catch(_0x49124f){return BPromise[_0x216d('0x23')](_0x49124f);}return _0x4a4c12['save']();};}function saveUpdates(_0x525fbf,_0x55bf2d){return function(_0x44cb79){if(_0x44cb79){return _0x44cb79[_0x216d('0x24')](_0x525fbf)[_0x216d('0x25')](function(_0x296e89){return _0x296e89;});}return null;};}function removeEntity(_0x1f079d,_0x148327){return function(_0x9f10f5){if(_0x9f10f5){return _0x9f10f5[_0x216d('0x26')]()[_0x216d('0x25')](function(){_0x1f079d[_0x216d('0x1a')](0xcc)[_0x216d('0x1b')]();});}};}function handleEntityNotFound(_0x8d50ec,_0x4f3173){return function(_0x4ba77e){if(!_0x4ba77e){_0x8d50ec['sendStatus'](0x194);}return _0x4ba77e;};}function handleError(_0x445781,_0x4f2944){_0x4f2944=_0x4f2944||0x1f4;return function(_0x49389c){logger[_0x216d('0x27')](_0x49389c['stack']);if(_0x49389c[_0x216d('0x28')]){delete _0x49389c[_0x216d('0x28')];}_0x445781[_0x216d('0x1a')](_0x4f2944)[_0x216d('0x29')](_0x49389c);};}exports[_0x216d('0x2a')]=function(_0x4d6e21,_0x2d168b,_0x3fc997){if(!_0x4d6e21[_0x216d('0x2b')][_0x216d('0x2c')](_0x216d('0x2d'))&&!_0x4d6e21[_0x216d('0x2b')][_0x216d('0x2c')](_0x216d('0x2e'))){throw new db[(_0x216d('0x2f'))]['ValidationError'](_0x216d('0x30'));}else{if(_0x4d6e21[_0x216d('0x2b')][_0x216d('0x2c')](_0x216d('0x2e'))&&!_0x4d6e21[_0x216d('0x2b')][_0x216d('0x2c')](_0x216d('0x31'))){throw new db['Sequelize'][(_0x216d('0x32'))](_0x216d('0x33'));}if(!_0x4d6e21['body'][_0x216d('0x2c')](_0x216d('0x34'))){throw new db[(_0x216d('0x2f'))]['ValidationError'](_0x216d('0x35'));}else{try{var _0x1b74ac=JSON['parse'](_0x4d6e21['body']['recipients']);}catch(_0x7a3a55){logger[_0x216d('0x27')](_0x7a3a55);throw new db[(_0x216d('0x2f'))][(_0x216d('0x32'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x491c16=['chatqueue',_0x216d('0x36'),'mailqueue','openchannelqueue','smsqueue','voicequeue',_0x216d('0x37'),_0x216d('0x38'),_0x216d('0x39')];if(_[_0x216d('0x3a')](_0x1b74ac,function(_0x2f7c17){return!_[_0x216d('0x3b')](_0x491c16,_0x2f7c17['model'][_0x216d('0x3c')]());})){throw new db['Sequelize'][(_0x216d('0x32'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x371950={};_0x371950[_0x216d('0x3d')]=_0x4d6e21[_0x216d('0x2b')][_0x216d('0x2c')]('senderName')?_0x4d6e21[_0x216d('0x2b')][_0x216d('0x3d')]:_0x4d6e21[_0x216d('0x39')][_0x216d('0x3e')];_0x371950[_0x216d('0x3f')]=_[_0x216d('0x40')](_0x4d6e21[_0x216d('0x2b')][_0x216d('0x3f')])?null:_0x4d6e21['body'][_0x216d('0x3f')];_0x371950[_0x216d('0x41')]=_0x4d6e21['body'][_0x216d('0x41')]||![];_0x371950[_0x216d('0x42')]=_0x4d6e21['user']['id'];return getContent(_0x4d6e21[_0x216d('0x2b')])['then'](function(_0x26dd99){_0x371950['body']=_0x26dd99;return getRecipients(_0x1b74ac);})['then'](function(_0x3da8d5){_0x371950[_0x216d('0x43')]=_[_0x216d('0x44')](_0x3da8d5)[_0x216d('0x45')](',');return db[_0x216d('0x46')]['transaction'](function(_0x41c6cd){return db['UserNotification'][_0x216d('0x47')](_0x371950,{'raw':!![],'transaction':_0x41c6cd})[_0x216d('0x25')](function(_0x18fdb0){var _0x1e4cec={'sender':_0x371950[_0x216d('0x3d')],'description':_0x371950['recipientsDescription'],'content':_0x371950[_0x216d('0x2b')],'beep':_0x371950[_0x216d('0x41')]};_0x3da8d5[_0x216d('0x48')](function(_0x3b3abc){_0x1e4cec[_0x216d('0x49')]=_0x3b3abc;socket[_0x216d('0x4a')](_0x216d('0x4b'),_0x1e4cec);});return _0x18fdb0;});});})[_0x216d('0x25')](respondWithResult(_0x2d168b,0xc9))[_0x216d('0x4c')](handleError(_0x2d168b,null));};function getContent(_0x2f8050){return new BPromise(function(_0x1e0084,_0x5b7334){if(_0x2f8050[_0x216d('0x2d')]){_0x1e0084(_0x2f8050[_0x216d('0x2d')]);return;}return db[_0x216d('0x4d')][_0x216d('0x4e')]({'attributes':[_0x216d('0x4f')],'where':{'id':_0x2f8050[_0x216d('0x2e')]},'raw':!![]})[_0x216d('0x25')](function(_0x124206){if(!_0x124206)throw new db[(_0x216d('0x2f'))][(_0x216d('0x32'))](_0x216d('0x50'));var _0x7d8f9b=Mustache[_0x216d('0x51')](_0x124206['html'],_0x2f8050[_0x216d('0x31')]);_0x1e0084(_0x7d8f9b);})[_0x216d('0x4c')](function(_0x49968c){_0x5b7334(_0x49968c);});});}function getRecipients(_0x3e4aac){return new BPromise(function(_0x2567b7,_0x4dcafe){var _0x29cc5d=[];var _0x3cfc86=[];_0x3e4aac['forEach'](function(_0x386209){var _0x26bcc6=_[_0x216d('0x52')](_0x386209[_0x216d('0x53')][_0x216d('0x3c')]());if(_0x26bcc6===_0x216d('0x54')){_0x29cc5d=_['union'](_0x29cc5d,_0x386209['ids']);}else{if(_[_0x216d('0x3b')](_0x26bcc6,'queue'))_0x26bcc6=_0x26bcc6[_0x216d('0x55')](_0x216d('0x56'),_0x216d('0x57'));_0x386209['ids']['forEach'](function(_0x1e53ca){_0x3cfc86[_0x216d('0x58')](getAgents(_0x26bcc6,_0x1e53ca));});}});return BPromise[_0x216d('0x59')](_0x3cfc86)[_0x216d('0x25')](function(_0x1c9c7b){_0x29cc5d=_['union'](_0x29cc5d,_['flatten'](_0x1c9c7b));_0x2567b7(_0x29cc5d);})[_0x216d('0x4c')](function(_0x1b1acb){_0x4dcafe(_0x1b1acb);});});}function getAgents(_0x58aa61,_0x16ba47){return new BPromise(function(_0x27bbec,_0x37cb76){return db[_0x58aa61][_0x216d('0x4e')]({'where':{'id':_0x16ba47}})[_0x216d('0x25')](function(_0x408854){return _0x408854[_0x216d('0x5a')]({'attributes':['id'],'raw':!![]})[_0x216d('0x25')](function(_0x16add6){var _0x1171c7=_[_0x216d('0x5b')](_0x16add6,'id');_0x27bbec(_0x1171c7);});})[_0x216d('0x4c')](function(_0x4df6c9){_0x37cb76(_0x4df6c9);});});} \ No newline at end of file +var _0xa8f3=['Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','sortBy','join','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','ids','queue','Queue','push','all','union','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError'];(function(_0x57784b,_0x49a858){var _0x4505fa=function(_0x14f13c){while(--_0x14f13c){_0x57784b['push'](_0x57784b['shift']());}};_0x4505fa(++_0x49a858);}(_0xa8f3,0x1d9));var _0x3a8f=function(_0x430768,_0x4362e8){_0x430768=_0x430768-0x0;var _0x1b36a4=_0xa8f3[_0x430768];return _0x1b36a4;};'use strict';var emlformat=require(_0x3a8f('0x0'));var rimraf=require(_0x3a8f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a8f('0x2'));var rp=require(_0x3a8f('0x3'));var moment=require(_0x3a8f('0x4'));var BPromise=require(_0x3a8f('0x5'));var Mustache=require(_0x3a8f('0x6'));var util=require(_0x3a8f('0x7'));var path=require(_0x3a8f('0x8'));var sox=require(_0x3a8f('0x9'));var csv=require(_0x3a8f('0xa'));var ejs=require(_0x3a8f('0xb'));var fs=require('fs');var fs_extra=require(_0x3a8f('0xc'));var _=require(_0x3a8f('0xd'));var squel=require(_0x3a8f('0xe'));var crypto=require(_0x3a8f('0xf'));var jsforce=require(_0x3a8f('0x10'));var deskjs=require(_0x3a8f('0x11'));var toCsv=require(_0x3a8f('0xa'));var querystring=require(_0x3a8f('0x12'));var Papa=require(_0x3a8f('0x13'));var Redis=require('ioredis');var authService=require(_0x3a8f('0x14'));var qs=require(_0x3a8f('0x15'));var as=require(_0x3a8f('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a8f('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3a8f('0x18'));var db=require(_0x3a8f('0x19'))['db'];config[_0x3a8f('0x1a')]=_[_0x3a8f('0x1b')](config[_0x3a8f('0x1a')],{'host':_0x3a8f('0x1c'),'port':0x18eb});var socket=require(_0x3a8f('0x1d'))(new Redis(config[_0x3a8f('0x1a')]));require(_0x3a8f('0x1e'))[_0x3a8f('0x1f')](socket);function respondWithStatusCode(_0x14d32a,_0x3a0aba){_0x3a0aba=_0x3a0aba||0xcc;return function(_0x443d24){if(_0x443d24){return _0x14d32a[_0x3a8f('0x20')](_0x3a0aba);}return _0x14d32a[_0x3a8f('0x21')](_0x3a0aba)['end']();};}function respondWithResult(_0x23ba11,_0x85d3b2){_0x85d3b2=_0x85d3b2||0xc8;return function(_0x5bf653){if(_0x5bf653){return _0x23ba11[_0x3a8f('0x21')](_0x85d3b2)['json'](_0x5bf653);}};}function respondWithFilteredResult(_0x28ccd0,_0x4b03bc){return function(_0x208e32){if(_0x208e32){var _0x515bfd=typeof _0x4b03bc[_0x3a8f('0x22')]==='undefined'&&typeof _0x4b03bc[_0x3a8f('0x23')]===_0x3a8f('0x24');var _0x4db707=_0x208e32['count'];var _0x185e87=_0x515bfd?0x0:_0x4b03bc[_0x3a8f('0x22')];var _0x1b30ea=_0x515bfd?_0x208e32[_0x3a8f('0x25')]:_0x4b03bc['offset']+_0x4b03bc['limit'];var _0x1d1357;if(_0x1b30ea>=_0x4db707){_0x1b30ea=_0x4db707;_0x1d1357=0xc8;}else{_0x1d1357=0xce;}_0x28ccd0[_0x3a8f('0x21')](_0x1d1357);return _0x28ccd0[_0x3a8f('0x26')](_0x3a8f('0x27'),_0x185e87+'-'+_0x1b30ea+'/'+_0x4db707)[_0x3a8f('0x28')](_0x208e32);}return null;};}function patchUpdates(_0x258036){return function(_0x131544){try{jsonpatch[_0x3a8f('0x29')](_0x131544,_0x258036,!![]);}catch(_0x594839){return BPromise[_0x3a8f('0x2a')](_0x594839);}return _0x131544[_0x3a8f('0x2b')]();};}function saveUpdates(_0x342009,_0x2c3948){return function(_0x362114){if(_0x362114){return _0x362114[_0x3a8f('0x2c')](_0x342009)[_0x3a8f('0x2d')](function(_0x2b3f26){return _0x2b3f26;});}return null;};}function removeEntity(_0x3f34d0,_0x13c4c1){return function(_0x216e8d){if(_0x216e8d){return _0x216e8d[_0x3a8f('0x2e')]()[_0x3a8f('0x2d')](function(){_0x3f34d0[_0x3a8f('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x133e6c,_0x3fe857){return function(_0x370e34){if(!_0x370e34){_0x133e6c['sendStatus'](0x194);}return _0x370e34;};}function handleError(_0x52d8c1,_0x41df5c){_0x41df5c=_0x41df5c||0x1f4;return function(_0x246a4e){logger[_0x3a8f('0x2f')](_0x246a4e[_0x3a8f('0x30')]);if(_0x246a4e[_0x3a8f('0x31')]){delete _0x246a4e[_0x3a8f('0x31')];}_0x52d8c1['status'](_0x41df5c)['send'](_0x246a4e);};}exports[_0x3a8f('0x32')]=function(_0x39be72,_0x5dfabc,_0x42b3c6){if(!_0x39be72[_0x3a8f('0x33')][_0x3a8f('0x34')](_0x3a8f('0x35'))&&!_0x39be72[_0x3a8f('0x33')][_0x3a8f('0x34')](_0x3a8f('0x36'))){throw new db[(_0x3a8f('0x37'))][(_0x3a8f('0x38'))](_0x3a8f('0x39'));}else{if(_0x39be72['body'][_0x3a8f('0x34')](_0x3a8f('0x36'))&&!_0x39be72[_0x3a8f('0x33')][_0x3a8f('0x34')](_0x3a8f('0x3a'))){throw new db[(_0x3a8f('0x37'))][(_0x3a8f('0x38'))](_0x3a8f('0x3b'));}if(!_0x39be72[_0x3a8f('0x33')][_0x3a8f('0x34')](_0x3a8f('0x3c'))){throw new db['Sequelize']['ValidationError'](_0x3a8f('0x3d'));}else{try{var _0x448a1f=JSON[_0x3a8f('0x3e')](_0x39be72[_0x3a8f('0x33')][_0x3a8f('0x3c')]);}catch(_0x93fa83){logger['error'](_0x93fa83);throw new db[(_0x3a8f('0x37'))]['ValidationError'](_0x3a8f('0x3f'));}var _0x310a29=[_0x3a8f('0x40'),_0x3a8f('0x41'),_0x3a8f('0x42'),_0x3a8f('0x43'),_0x3a8f('0x44'),_0x3a8f('0x45'),_0x3a8f('0x46'),_0x3a8f('0x47'),_0x3a8f('0x48')];if(_[_0x3a8f('0x49')](_0x448a1f,function(_0x412b25){return!_[_0x3a8f('0x4a')](_0x310a29,_0x412b25[_0x3a8f('0x4b')][_0x3a8f('0x4c')]());})){throw new db[(_0x3a8f('0x37'))][(_0x3a8f('0x38'))](_0x3a8f('0x4d'));}}}var _0x29081c={};_0x29081c[_0x3a8f('0x4e')]=_0x39be72[_0x3a8f('0x33')][_0x3a8f('0x34')](_0x3a8f('0x4e'))?_0x39be72[_0x3a8f('0x33')][_0x3a8f('0x4e')]:_0x39be72[_0x3a8f('0x48')][_0x3a8f('0x4f')];_0x29081c[_0x3a8f('0x50')]=_['isEmpty'](_0x39be72['body'][_0x3a8f('0x50')])?null:_0x39be72[_0x3a8f('0x33')][_0x3a8f('0x50')];_0x29081c[_0x3a8f('0x51')]=_0x39be72[_0x3a8f('0x33')]['beep']||![];_0x29081c[_0x3a8f('0x52')]=_0x39be72[_0x3a8f('0x48')]['id'];return getContent(_0x39be72['body'])[_0x3a8f('0x2d')](function(_0x17307b){_0x29081c['body']=_0x17307b;return getRecipients(_0x448a1f);})[_0x3a8f('0x2d')](function(_0x298bec){_0x29081c['recipientsId']=_[_0x3a8f('0x53')](_0x298bec)[_0x3a8f('0x54')](',');return db['sequelize'][_0x3a8f('0x55')](function(_0x302f4b){return db[_0x3a8f('0x56')][_0x3a8f('0x57')](_0x29081c,{'raw':!![],'transaction':_0x302f4b})['then'](function(_0x19f2c0){var _0x3f0df7={'sender':_0x29081c['senderName'],'description':_0x29081c['recipientsDescription'],'content':_0x29081c['body'],'beep':_0x29081c[_0x3a8f('0x51')]};_0x298bec[_0x3a8f('0x58')](function(_0x47c33b){_0x3f0df7[_0x3a8f('0x59')]=_0x47c33b;socket[_0x3a8f('0x5a')](_0x3a8f('0x5b'),_0x3f0df7);});return _0x19f2c0;});});})[_0x3a8f('0x2d')](respondWithResult(_0x5dfabc,0xc9))[_0x3a8f('0x5c')](handleError(_0x5dfabc,null));};function getContent(_0x3031ab){return new BPromise(function(_0x32e0a7,_0x1d5e5d){if(_0x3031ab['text']){_0x32e0a7(_0x3031ab[_0x3a8f('0x35')]);return;}return db['Template'][_0x3a8f('0x5d')]({'attributes':[_0x3a8f('0x5e')],'where':{'id':_0x3031ab[_0x3a8f('0x36')]},'raw':!![]})[_0x3a8f('0x2d')](function(_0x4933fb){if(!_0x4933fb)throw new db[(_0x3a8f('0x37'))]['ValidationError'](_0x3a8f('0x5f'));var _0x2f067c=Mustache[_0x3a8f('0x60')](_0x4933fb[_0x3a8f('0x5e')],_0x3031ab[_0x3a8f('0x3a')]);_0x32e0a7(_0x2f067c);})[_0x3a8f('0x5c')](function(_0x233ab5){_0x1d5e5d(_0x233ab5);});});}function getRecipients(_0x5db30d){return new BPromise(function(_0x3e9d65,_0x2aed61){var _0x1743d5=[];var _0x5e9bee=[];_0x5db30d[_0x3a8f('0x58')](function(_0x55f0ab){var _0x456940=_[_0x3a8f('0x61')](_0x55f0ab[_0x3a8f('0x4b')]['toLowerCase']());if(_0x456940===_0x3a8f('0x62')){_0x1743d5=_['union'](_0x1743d5,_0x55f0ab[_0x3a8f('0x63')]);}else{if(_[_0x3a8f('0x4a')](_0x456940,_0x3a8f('0x64')))_0x456940=_0x456940['replace'](_0x3a8f('0x64'),_0x3a8f('0x65'));_0x55f0ab[_0x3a8f('0x63')][_0x3a8f('0x58')](function(_0x5aaf05){_0x5e9bee[_0x3a8f('0x66')](getAgents(_0x456940,_0x5aaf05));});}});return BPromise[_0x3a8f('0x67')](_0x5e9bee)['then'](function(_0x5bd8b7){_0x1743d5=_[_0x3a8f('0x68')](_0x1743d5,_['flatten'](_0x5bd8b7));_0x3e9d65(_0x1743d5);})[_0x3a8f('0x5c')](function(_0x34b57e){_0x2aed61(_0x34b57e);});});}function getAgents(_0x7c15b2,_0x5d7985){return new BPromise(function(_0x41e453,_0x2ff46e){return db[_0x7c15b2][_0x3a8f('0x5d')]({'where':{'id':_0x5d7985}})[_0x3a8f('0x2d')](function(_0x32eead){return _0x32eead[_0x3a8f('0x69')]({'attributes':['id'],'raw':!![]})[_0x3a8f('0x2d')](function(_0x576ae9){var _0x56d24f=_['map'](_0x576ae9,'id');_0x41e453(_0x56d24f);});})[_0x3a8f('0x5c')](function(_0x1a9dd3){_0x2ff46e(_0x1a9dd3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index bd6421e..8324d6f 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 _0xf78e=['hasOwnProperty','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit'];(function(_0x325c2c,_0x4c20c6){var _0x41fcf7=function(_0xbfb7c4){while(--_0xbfb7c4){_0x325c2c['push'](_0x325c2c['shift']());}};_0x41fcf7(++_0x4c20c6);}(_0xf78e,0xbf));var _0xef78=function(_0x538896,_0x2c894c){_0x538896=_0x538896-0x0;var _0xaea97=_0xf78e[_0x538896];return _0xaea97;};'use strict';var EventEmitter=require(_0xef78('0x0'));var UserNotification=require(_0xef78('0x1'))['db'][_0xef78('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xef78('0x3')](0x0);var events={'afterCreate':_0xef78('0x4'),'afterUpdate':_0xef78('0x5'),'afterDestroy':'remove'};function emitEvent(_0x26b8e4){return function(_0x3e39e5,_0x35a88f,_0x5e2459){UserNotificationEvents[_0xef78('0x6')](_0x26b8e4+':'+_0x3e39e5['id'],_0x3e39e5);UserNotificationEvents['emit'](_0x26b8e4,_0x3e39e5);_0x5e2459(null);};}for(var e in events){if(events[_0xef78('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xef78('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x92f9=['events','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x388941,_0xefe17){var _0x5eaea2=function(_0x47f862){while(--_0x47f862){_0x388941['push'](_0x388941['shift']());}};_0x5eaea2(++_0xefe17);}(_0x92f9,0xbd));var _0x992f=function(_0x1162f9,_0x35f87c){_0x1162f9=_0x1162f9-0x0;var _0x75257c=_0x92f9[_0x1162f9];return _0x75257c;};'use strict';var EventEmitter=require(_0x992f('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x992f('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x992f('0x2')](0x0);var events={'afterCreate':_0x992f('0x3'),'afterUpdate':_0x992f('0x4'),'afterDestroy':_0x992f('0x5')};function emitEvent(_0x4fac09){return function(_0x50689e,_0x379c6f,_0x2d0ea8){UserNotificationEvents[_0x992f('0x6')](_0x4fac09+':'+_0x50689e['id'],_0x50689e);UserNotificationEvents[_0x992f('0x6')](_0x4fac09,_0x50689e);_0x2d0ea8(null);};}for(var e in events){if(events[_0x992f('0x7')](e)){var event=events[e];UserNotification[_0x992f('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 6d025ae..38f8e87 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 _0x571d=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4_unicode_ci'];(function(_0x178dce,_0x1b2a0a){var _0x507e7f=function(_0x40844b){while(--_0x40844b){_0x178dce['push'](_0x178dce['shift']());}};_0x507e7f(++_0x1b2a0a);}(_0x571d,0x68));var _0xd571=function(_0x359c68,_0x11789f){_0x359c68=_0x359c68-0x0;var _0x43d220=_0x571d[_0x359c68];return _0x43d220;};'use strict';var _=require(_0xd571('0x0'));var util=require(_0xd571('0x1'));var logger=require(_0xd571('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd571('0x3'));var rp=require(_0xd571('0x4'));var fs=require('fs');var path=require(_0xd571('0x5'));var rimraf=require(_0xd571('0x6'));var config=require(_0xd571('0x7'));var attributes=require(_0xd571('0x8'));module['exports']=function(_0x40929e,_0x44bda2){return _0x40929e[_0xd571('0x9')](_0xd571('0xa'),attributes,{'tableName':_0xd571('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd571('0xc')});}; \ No newline at end of file +var _0x2b88=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4'];(function(_0x2dd090,_0x308103){var _0x40c9e4=function(_0x3627a4){while(--_0x3627a4){_0x2dd090['push'](_0x2dd090['shift']());}};_0x40c9e4(++_0x308103);}(_0x2b88,0xc1));var _0x82b8=function(_0x74f73,_0x2acc98){_0x74f73=_0x74f73-0x0;var _0x3827c2=_0x2b88[_0x74f73];return _0x3827c2;};'use strict';var _=require(_0x82b8('0x0'));var util=require(_0x82b8('0x1'));var logger=require(_0x82b8('0x2'))(_0x82b8('0x3'));var moment=require(_0x82b8('0x4'));var BPromise=require(_0x82b8('0x5'));var rp=require(_0x82b8('0x6'));var fs=require('fs');var path=require(_0x82b8('0x7'));var rimraf=require('rimraf');var config=require(_0x82b8('0x8'));var attributes=require(_0x82b8('0x9'));module[_0x82b8('0xa')]=function(_0x173fe1,_0x1d9b33){return _0x173fe1[_0x82b8('0xb')](_0x82b8('0xc'),attributes,{'tableName':_0x82b8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x82b8('0xe'),'collate':_0x82b8('0xf')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index ded44aa..2bc3201 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 _0x544c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','socket.io-emitter','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment'];(function(_0x224cfa,_0x44bcf3){var _0x29b51c=function(_0x1d8c66){while(--_0x1d8c66){_0x224cfa['push'](_0x224cfa['shift']());}};_0x29b51c(++_0x44bcf3);}(_0x544c,0x186));var _0xc544=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x544c[_0x7d62cb];return _0x3a6266;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc544('0x0'));var BPromise=require(_0xc544('0x1'));var rs=require(_0xc544('0x2'));var fs=require('fs');var Redis=require(_0xc544('0x3'));var db=require(_0xc544('0x4'))['db'];var utils=require(_0xc544('0x5'));var logger=require(_0xc544('0x6'))('rpc');var config=require(_0xc544('0x7'));var jayson=require(_0xc544('0x8'));var client=jayson[_0xc544('0x9')]['http']({'port':0x232a});config[_0xc544('0xa')]=_['defaults'](config[_0xc544('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc544('0xb'))(new Redis(config[_0xc544('0xa')]));require('./userNotification.socket')[_0xc544('0xc')](socket);function respondWithRpcPromise(_0x12e7d4,_0x4e1508,_0xf55f2a){return new BPromise(function(_0x4f8d4d,_0x5b6106){return client['request'](_0x12e7d4,_0xf55f2a)[_0xc544('0xd')](function(_0x495c75){logger[_0xc544('0xe')](_0xc544('0xf'),_0x4e1508,_0xc544('0x10'));logger[_0xc544('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x4e1508,_0xc544('0x10'),JSON[_0xc544('0x12')](_0x495c75));if(_0x495c75[_0xc544('0x13')]){if(_0x495c75[_0xc544('0x13')][_0xc544('0x14')]===0x1f4){logger[_0xc544('0x13')](_0xc544('0xf'),_0x4e1508,_0x495c75['error'][_0xc544('0x15')]);return _0x5b6106(_0x495c75[_0xc544('0x13')]['message']);}logger[_0xc544('0x13')](_0xc544('0xf'),_0x4e1508,_0x495c75[_0xc544('0x13')][_0xc544('0x15')]);return _0x4f8d4d(_0x495c75[_0xc544('0x13')][_0xc544('0x15')]);}else{logger[_0xc544('0xe')](_0xc544('0xf'),_0x4e1508,_0xc544('0x10'));_0x4f8d4d(_0x495c75[_0xc544('0x16')][_0xc544('0x15')]);}})['catch'](function(_0x701091){logger[_0xc544('0x13')](_0xc544('0xf'),_0x4e1508,_0x701091);_0x5b6106(_0x701091);});});} \ No newline at end of file +var _0x1a0b=['client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5217b0,_0x3b2525){var _0x536b60=function(_0x5a1785){while(--_0x5a1785){_0x5217b0['push'](_0x5217b0['shift']());}};_0x536b60(++_0x3b2525);}(_0x1a0b,0xf2));var _0xb1a0=function(_0x25f933,_0x1b65c1){_0x25f933=_0x25f933-0x0;var _0x4b1573=_0x1a0b[_0x25f933];return _0x4b1573;};'use strict';var _=require(_0xb1a0('0x0'));var util=require(_0xb1a0('0x1'));var moment=require(_0xb1a0('0x2'));var BPromise=require(_0xb1a0('0x3'));var rs=require(_0xb1a0('0x4'));var fs=require('fs');var Redis=require(_0xb1a0('0x5'));var db=require(_0xb1a0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb1a0('0x7'))('rpc');var config=require(_0xb1a0('0x8'));var jayson=require(_0xb1a0('0x9'));var client=jayson[_0xb1a0('0xa')]['http']({'port':0x232a});config[_0xb1a0('0xb')]=_[_0xb1a0('0xc')](config[_0xb1a0('0xb')],{'host':_0xb1a0('0xd'),'port':0x18eb});var socket=require(_0xb1a0('0xe'))(new Redis(config[_0xb1a0('0xb')]));require(_0xb1a0('0xf'))[_0xb1a0('0x10')](socket);function respondWithRpcPromise(_0x31c198,_0x2dac78,_0x3a5c18){return new BPromise(function(_0xc9826f,_0x445c11){return client[_0xb1a0('0x11')](_0x31c198,_0x3a5c18)['then'](function(_0x1941f1){logger[_0xb1a0('0x12')](_0xb1a0('0x13'),_0x2dac78,_0xb1a0('0x14'));logger[_0xb1a0('0x15')](_0xb1a0('0x16'),_0x2dac78,_0xb1a0('0x14'),JSON[_0xb1a0('0x17')](_0x1941f1));if(_0x1941f1[_0xb1a0('0x18')]){if(_0x1941f1[_0xb1a0('0x18')][_0xb1a0('0x19')]===0x1f4){logger[_0xb1a0('0x18')]('UserNotification,\x20%s,\x20%s',_0x2dac78,_0x1941f1[_0xb1a0('0x18')][_0xb1a0('0x1a')]);return _0x445c11(_0x1941f1['error'][_0xb1a0('0x1a')]);}logger[_0xb1a0('0x18')]('UserNotification,\x20%s,\x20%s',_0x2dac78,_0x1941f1[_0xb1a0('0x18')][_0xb1a0('0x1a')]);return _0xc9826f(_0x1941f1[_0xb1a0('0x18')][_0xb1a0('0x1a')]);}else{logger['info'](_0xb1a0('0x13'),_0x2dac78,_0xb1a0('0x14'));_0xc9826f(_0x1941f1[_0xb1a0('0x1b')][_0xb1a0('0x1a')]);}})['catch'](function(_0x236089){logger[_0xb1a0('0x18')](_0xb1a0('0x13'),_0x2dac78,_0x236089);_0x445c11(_0x236089);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 3f34083..8ab0897 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 _0xc22b=['length','./userNotification.events','save','remove','update','emit'];(function(_0x4ef739,_0x174946){var _0xaf70bc=function(_0x405551){while(--_0x405551){_0x4ef739['push'](_0x4ef739['shift']());}};_0xaf70bc(++_0x174946);}(_0xc22b,0x12d));var _0xbc22=function(_0x1c0f8b,_0x8c821d){_0x1c0f8b=_0x1c0f8b-0x0;var _0x3fb800=_0xc22b[_0x1c0f8b];return _0x3fb800;};'use strict';var UserNotificationEvents=require(_0xbc22('0x0'));var events=[_0xbc22('0x1'),_0xbc22('0x2'),_0xbc22('0x3')];function createListener(_0x4256da,_0x238be5){return function(_0x1d1ea1){_0x238be5[_0xbc22('0x4')](_0x4256da,_0x1d1ea1);};}function removeListener(_0x48ed72,_0x2dca22){return function(){UserNotificationEvents['removeListener'](_0x48ed72,_0x2dca22);};}exports['register']=function(_0x5f3706){for(var _0x43cdba=0x0,_0x2ee101=events[_0xbc22('0x5')];_0x43cdba<_0x2ee101;_0x43cdba++){var _0x189e9a=events[_0x43cdba];var _0x100572=createListener('userNotification:'+_0x189e9a,_0x5f3706);UserNotificationEvents['on'](_0x189e9a,_0x100572);}}; \ No newline at end of file +var _0xab8a=['userNotification:','./userNotification.events','remove','update','emit','register','length'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xab8a,0x94));var _0xaab8=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xab8a[_0x616290];return _0x453879;};'use strict';var UserNotificationEvents=require(_0xaab8('0x0'));var events=['save',_0xaab8('0x1'),_0xaab8('0x2')];function createListener(_0x3d46d7,_0x185f87){return function(_0x6fcc76){_0x185f87[_0xaab8('0x3')](_0x3d46d7,_0x6fcc76);};}function removeListener(_0xa8aae,_0x17f489){return function(){UserNotificationEvents['removeListener'](_0xa8aae,_0x17f489);};}exports[_0xaab8('0x4')]=function(_0x5b384){for(var _0x301ba8=0x0,_0x4c6a88=events[_0xaab8('0x5')];_0x301ba8<_0x4c6a88;_0x301ba8++){var _0x344880=events[_0x301ba8];var _0x16cbd0=createListener(_0xaab8('0x6')+_0x344880,_0x5b384);UserNotificationEvents['on'](_0x344880,_0x16cbd0);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 518e65a..02344dd 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5cb6cd,_0x18ea7c){var _0x1e8995=function(_0x155182){while(--_0x155182){_0x5cb6cd['push'](_0x5cb6cd['shift']());}};_0x1e8995(++_0x18ea7c);}(_0x70e0,0x17b));var _0x070e=function(_0x1034fb,_0x571675){_0x1034fb=_0x1034fb-0x0;var _0x359d9f=_0x70e0[_0x1034fb];return _0x359d9f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1c904f,_0x105771){var _0x4c171e=function(_0x1305ff){while(--_0x1305ff){_0x1c904f['push'](_0x1c904f['shift']());}};_0x4c171e(++_0x105771);}(_0x70e0,0x17b));var _0x070e=function(_0xfff482,_0x23f2cb){_0xfff482=_0xfff482-0x0;var _0xa2304a=_0x70e0[_0xfff482];return _0xa2304a;};'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 88c1145..18659c2 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 _0xbd48=['exports','INTEGER'];(function(_0x435a63,_0x3b7984){var _0x13cc36=function(_0x3d36d1){while(--_0x3d36d1){_0x435a63['push'](_0x435a63['shift']());}};_0x13cc36(++_0x3b7984);}(_0xbd48,0xf2));var _0x8bd4=function(_0x76488b,_0x2d1bed){_0x76488b=_0x76488b-0x0;var _0x526a8c=_0xbd48[_0x76488b];return _0x526a8c;};'use strict';var Sequelize=require('sequelize');module[_0x8bd4('0x0')]={'penalty':{'type':Sequelize[_0x8bd4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7604=['sequelize','exports','INTEGER'];(function(_0x121a97,_0x4c4c4a){var _0x7f379=function(_0xc16e69){while(--_0xc16e69){_0x121a97['push'](_0x121a97['shift']());}};_0x7f379(++_0x4c4c4a);}(_0x7604,0xd2));var _0x4760=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7604[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x4760('0x0'));module[_0x4760('0x1')]={'penalty':{'type':Sequelize[_0x4760('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 1411923..8a1217e 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 _0xb560=['bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x49cfc7,_0x3a8634){var _0x108050=function(_0x2245dc){while(--_0x2245dc){_0x49cfc7['push'](_0x49cfc7['shift']());}};_0x108050(++_0x3a8634);}(_0xb560,0xcc));var _0x0b56=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xb560[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x0b56('0x0'));var util=require(_0x0b56('0x1'));var logger=require(_0x0b56('0x2'))(_0x0b56('0x3'));var moment=require('moment');var BPromise=require(_0x0b56('0x4'));var rp=require(_0x0b56('0x5'));var fs=require('fs');var path=require(_0x0b56('0x6'));var rimraf=require(_0x0b56('0x7'));var config=require(_0x0b56('0x8'));var attributes=require(_0x0b56('0x9'));module[_0x0b56('0xa')]=function(_0x23d480,_0x2f2a9b){return _0x23d480[_0x0b56('0xb')]('UserOpenchannelQueue',attributes,{'tableName':_0x0b56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80e5=['define','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x414901,_0x20ee6a){var _0x2cae72=function(_0x1f13bc){while(--_0x1f13bc){_0x414901['push'](_0x414901['shift']());}};_0x2cae72(++_0x20ee6a);}(_0x80e5,0x152));var _0x580e=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0x80e5[_0x5beda8];return _0x2aa042;};'use strict';var _=require(_0x580e('0x0'));var util=require(_0x580e('0x1'));var logger=require(_0x580e('0x2'))(_0x580e('0x3'));var moment=require(_0x580e('0x4'));var BPromise=require(_0x580e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x580e('0x6'));var rimraf=require('rimraf');var config=require(_0x580e('0x7'));var attributes=require(_0x580e('0x8'));module[_0x580e('0x9')]=function(_0x3b4af6,_0x4ce085){return _0x3b4af6[_0x580e('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0x580e('0xb'),'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 4f9bc9f..16bdfe1 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 _0xeeb9=['../../config/logger','../../config/environment','jayson/promise','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeeb9,0xde));var _0x9eeb=function(_0x684b12,_0x36babe){_0x684b12=_0x684b12-0x0;var _0x1f897c=_0xeeb9[_0x684b12];return _0x1f897c;};'use strict';var _=require(_0x9eeb('0x0'));var util=require(_0x9eeb('0x1'));var moment=require(_0x9eeb('0x2'));var BPromise=require(_0x9eeb('0x3'));var rs=require(_0x9eeb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9eeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9eeb('0x6'))('rpc');var config=require(_0x9eeb('0x7'));var jayson=require(_0x9eeb('0x8'));var client=jayson['client'][_0x9eeb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ce192,_0x46d666,_0x26d278){return new BPromise(function(_0x4e9440,_0x4c922b){return client['request'](_0x3ce192,_0x26d278)[_0x9eeb('0xa')](function(_0x589c56){logger[_0x9eeb('0xb')](_0x9eeb('0xc'),_0x46d666,_0x9eeb('0xd'));logger[_0x9eeb('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x46d666,_0x9eeb('0xd'),JSON[_0x9eeb('0xf')](_0x589c56));if(_0x589c56['error']){if(_0x589c56[_0x9eeb('0x10')]['code']===0x1f4){logger[_0x9eeb('0x10')](_0x9eeb('0xc'),_0x46d666,_0x589c56[_0x9eeb('0x10')][_0x9eeb('0x11')]);return _0x4c922b(_0x589c56['error'][_0x9eeb('0x11')]);}logger[_0x9eeb('0x10')](_0x9eeb('0xc'),_0x46d666,_0x589c56['error'][_0x9eeb('0x11')]);return _0x4e9440(_0x589c56['error']['message']);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x46d666,_0x9eeb('0xd'));_0x4e9440(_0x589c56[_0x9eeb('0x12')][_0x9eeb('0x11')]);}})['catch'](function(_0xf38281){logger[_0x9eeb('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x46d666,_0xf38281);_0x4c922b(_0xf38281);});});} \ No newline at end of file +var _0x48f7=['UserOpenchannelQueue,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0x48f7,0xdf));var _0x748f=function(_0x4089b2,_0x1bb8f9){_0x4089b2=_0x4089b2-0x0;var _0x3a415e=_0x48f7[_0x4089b2];return _0x3a415e;};'use strict';var _=require('lodash');var util=require(_0x748f('0x0'));var moment=require(_0x748f('0x1'));var BPromise=require(_0x748f('0x2'));var rs=require(_0x748f('0x3'));var fs=require('fs');var Redis=require(_0x748f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x748f('0x5'));var logger=require(_0x748f('0x6'))(_0x748f('0x7'));var config=require(_0x748f('0x8'));var jayson=require(_0x748f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b2f03,_0x3c6421,_0x408e89){return new BPromise(function(_0x3102e2,_0x47a2de){return client[_0x748f('0xa')](_0x4b2f03,_0x408e89)[_0x748f('0xb')](function(_0x179951){logger[_0x748f('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x3c6421,_0x748f('0xd'));logger[_0x748f('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x3c6421,'request\x20sent',JSON[_0x748f('0xf')](_0x179951));if(_0x179951[_0x748f('0x10')]){if(_0x179951['error'][_0x748f('0x11')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x3c6421,_0x179951[_0x748f('0x10')][_0x748f('0x12')]);return _0x47a2de(_0x179951[_0x748f('0x10')]['message']);}logger[_0x748f('0x10')](_0x748f('0x13'),_0x3c6421,_0x179951[_0x748f('0x10')]['message']);return _0x3102e2(_0x179951['error'][_0x748f('0x12')]);}else{logger[_0x748f('0xc')](_0x748f('0x13'),_0x3c6421,_0x748f('0xd'));_0x3102e2(_0x179951[_0x748f('0x14')][_0x748f('0x12')]);}})[_0x748f('0x15')](function(_0x29bd2c){logger[_0x748f('0x10')](_0x748f('0x13'),_0x3c6421,_0x29bd2c);_0x47a2de(_0x29bd2c);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 15a88a2..34b2503 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 _0x195e=['clone','addSections','put','delete','destroy','removeSections','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','/describe','isAuthenticated','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x195e,0x1db));var _0xe195=function(_0x440754,_0x5e4d20){_0x440754=_0x440754-0x0;var _0x1b716e=_0x195e[_0x440754];return _0x1b716e;};'use strict';var multer=require(_0xe195('0x0'));var util=require(_0xe195('0x1'));var path=require(_0xe195('0x2'));var timeout=require(_0xe195('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe195('0x4'));var interaction=require(_0xe195('0x5'));var config=require('../../config/environment');var controller=require(_0xe195('0x6'));router[_0xe195('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe195('0x7')](_0xe195('0x8'),auth[_0xe195('0x9')](),controller['describe']);router[_0xe195('0x7')](_0xe195('0xa'),auth[_0xe195('0x9')](),controller[_0xe195('0xb')]);router['get'](_0xe195('0xc'),auth[_0xe195('0x9')](),controller[_0xe195('0xd')]);router[_0xe195('0x7')](_0xe195('0xe'),auth['isAuthenticated'](),controller[_0xe195('0xf')]);router[_0xe195('0x10')]('/',auth[_0xe195('0x9')](),controller[_0xe195('0x11')]);router[_0xe195('0x10')](_0xe195('0x12'),auth[_0xe195('0x9')](),controller[_0xe195('0x13')]);router[_0xe195('0x10')](_0xe195('0xc'),auth[_0xe195('0x9')](),controller[_0xe195('0x14')]);router[_0xe195('0x10')](_0xe195('0xe'),auth[_0xe195('0x9')](),controller['addResources']);router[_0xe195('0x15')]('/:id',auth[_0xe195('0x9')](),controller['update']);router[_0xe195('0x16')](_0xe195('0xa'),auth[_0xe195('0x9')](),controller[_0xe195('0x17')]);router[_0xe195('0x16')](_0xe195('0xc'),auth[_0xe195('0x9')](),controller[_0xe195('0x18')]);router[_0xe195('0x16')]('/:id/resources',auth[_0xe195('0x9')](),controller['removeResources']);module[_0xe195('0x19')]=router; \ No newline at end of file +var _0x9ab5=['/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','update','destroy','removeSections','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x16f4cd,_0x125cb3){var _0x3bb8fa=function(_0x30d406){while(--_0x30d406){_0x16f4cd['push'](_0x16f4cd['shift']());}};_0x3bb8fa(++_0x125cb3);}(_0x9ab5,0xe1));var _0x59ab=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9ab5[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x59ab('0x0'));var util=require(_0x59ab('0x1'));var path=require(_0x59ab('0x2'));var timeout=require('connect-timeout');var express=require(_0x59ab('0x3'));var router=express[_0x59ab('0x4')]();var fs_extra=require(_0x59ab('0x5'));var auth=require(_0x59ab('0x6'));var interaction=require(_0x59ab('0x7'));var config=require(_0x59ab('0x8'));var controller=require('./userProfile.controller');router[_0x59ab('0x9')]('/',auth[_0x59ab('0xa')](),controller[_0x59ab('0xb')]);router[_0x59ab('0x9')](_0x59ab('0xc'),auth[_0x59ab('0xa')](),controller[_0x59ab('0xd')]);router[_0x59ab('0x9')](_0x59ab('0xe'),auth[_0x59ab('0xa')](),controller['show']);router['get'](_0x59ab('0xf'),auth['isAuthenticated'](),controller[_0x59ab('0x10')]);router[_0x59ab('0x9')](_0x59ab('0x11'),auth[_0x59ab('0xa')](),controller[_0x59ab('0x12')]);router[_0x59ab('0x13')]('/',auth['isAuthenticated'](),controller[_0x59ab('0x14')]);router[_0x59ab('0x13')](_0x59ab('0x15'),auth[_0x59ab('0xa')](),controller[_0x59ab('0x16')]);router['post'](_0x59ab('0xf'),auth[_0x59ab('0xa')](),controller[_0x59ab('0x17')]);router[_0x59ab('0x13')](_0x59ab('0x11'),auth['isAuthenticated'](),controller[_0x59ab('0x18')]);router['put']('/:id',auth[_0x59ab('0xa')](),controller[_0x59ab('0x19')]);router['delete'](_0x59ab('0xe'),auth['isAuthenticated'](),controller[_0x59ab('0x1a')]);router['delete']('/:id/sections',auth[_0x59ab('0xa')](),controller[_0x59ab('0x1b')]);router[_0x59ab('0x1c')](_0x59ab('0x11'),auth['isAuthenticated'](),controller['removeResources']);module[_0x59ab('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 873b0b0..96d2f00 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 _0x7bcd=['crudPermissions','join','getDataValue','BOOLEAN','sequelize','exports','name','STRING','setDataValue'];(function(_0x58f1ef,_0x4cf4d5){var _0x2ef772=function(_0x3b04ab){while(--_0x3b04ab){_0x58f1ef['push'](_0x58f1ef['shift']());}};_0x2ef772(++_0x4cf4d5);}(_0x7bcd,0x187));var _0xd7bc=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x7bcd[_0x152678];return _0x311a9;};'use strict';var Sequelize=require(_0xd7bc('0x0'));module[_0xd7bc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd7bc('0x2')},'crudPermissions':{'type':Sequelize[_0xd7bc('0x3')],'set':function(_0x57719f){this[_0xd7bc('0x4')](_0xd7bc('0x5'),_0x57719f?_0x57719f[_0xd7bc('0x6')](''):[]);},'get':function(){return this[_0xd7bc('0x7')](_0xd7bc('0x5'))?this[_0xd7bc('0x7')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd7bc('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd7bc('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd7bc('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd7bc('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd7bc('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd7bc('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6c8c=['setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x1c1b8c,_0x4c253d){var _0x1ee4c4=function(_0xb9bff5){while(--_0xb9bff5){_0x1c1b8c['push'](_0x1c1b8c['shift']());}};_0x1ee4c4(++_0x4c253d);}(_0x6c8c,0x100));var _0xc6c8=function(_0xd6beef,_0x16ebe3){_0xd6beef=_0xd6beef-0x0;var _0x37b299=_0x6c8c[_0xd6beef];return _0x37b299;};'use strict';var Sequelize=require(_0xc6c8('0x0'));module[_0xc6c8('0x1')]={'name':{'type':Sequelize[_0xc6c8('0x2')],'allowNull':![],'unique':_0xc6c8('0x3')},'crudPermissions':{'type':Sequelize[_0xc6c8('0x2')],'set':function(_0x1d099b){this[_0xc6c8('0x4')]('crudPermissions',_0x1d099b?_0x1d099b[_0xc6c8('0x5')](''):[]);},'get':function(){return this[_0xc6c8('0x6')]('crudPermissions')?this[_0xc6c8('0x6')](_0xc6c8('0x7'))[_0xc6c8('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc6c8('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xc6c8('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xc6c8('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xc6c8('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc6c8('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xc6c8('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc6c8('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 1b129ad..481412f 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 _0xa413=['keys','rawAttributes','create','body','clone','includeAll','find','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','ids','getSections','includes','isEmpty','subsections','enabled','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','UserProfile','count','then','include','rows','catch','params'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa413,0x1e5));var _0x3a41=function(_0x417acc,_0x1221f2){_0x417acc=_0x417acc-0x0;var _0x2e3cb9=_0xa413[_0x417acc];return _0x2e3cb9;};'use strict';var emlformat=require(_0x3a41('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a41('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a41('0x2'));var moment=require(_0x3a41('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3a41('0x4'));var path=require(_0x3a41('0x5'));var sox=require(_0x3a41('0x6'));var csv=require(_0x3a41('0x7'));var ejs=require(_0x3a41('0x8'));var fs=require('fs');var fs_extra=require(_0x3a41('0x9'));var _=require(_0x3a41('0xa'));var squel=require(_0x3a41('0xb'));var crypto=require(_0x3a41('0xc'));var jsforce=require(_0x3a41('0xd'));var deskjs=require(_0x3a41('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3a41('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3a41('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a41('0x11'));var logger=require('../../config/logger')(_0x3a41('0x12'));var utils=require(_0x3a41('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3a41('0x14'));var db=require(_0x3a41('0x15'))['db'];config[_0x3a41('0x16')]=_[_0x3a41('0x17')](config[_0x3a41('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x3a41('0x18'))(new Redis(config[_0x3a41('0x16')]));require(_0x3a41('0x19'))[_0x3a41('0x1a')](socket);function respondWithStatusCode(_0x35f693,_0x2aba07){_0x2aba07=_0x2aba07||0xcc;return function(_0x1fc976){if(_0x1fc976){return _0x35f693[_0x3a41('0x1b')](_0x2aba07);}return _0x35f693[_0x3a41('0x1c')](_0x2aba07)[_0x3a41('0x1d')]();};}function respondWithResult(_0xbb7877,_0x4e7e87){_0x4e7e87=_0x4e7e87||0xc8;return function(_0x317407){if(_0x317407){return _0xbb7877[_0x3a41('0x1c')](_0x4e7e87)['json'](_0x317407);}};}function respondWithFilteredResult(_0x515a03,_0xa564ed){return function(_0x3c4267){if(_0x3c4267){var _0x271344=typeof _0xa564ed[_0x3a41('0x1e')]===_0x3a41('0x1f')&&typeof _0xa564ed[_0x3a41('0x20')]===_0x3a41('0x1f');var _0x232b8d=_0x3c4267['count'];var _0x5c2652=_0x271344?0x0:_0xa564ed[_0x3a41('0x1e')];var _0x37a5bb=_0x271344?_0x3c4267['count']:_0xa564ed['offset']+_0xa564ed['limit'];var _0x8629b5;if(_0x37a5bb>=_0x232b8d){_0x37a5bb=_0x232b8d;_0x8629b5=0xc8;}else{_0x8629b5=0xce;}_0x515a03[_0x3a41('0x1c')](_0x8629b5);return _0x515a03[_0x3a41('0x21')](_0x3a41('0x22'),_0x5c2652+'-'+_0x37a5bb+'/'+_0x232b8d)['json'](_0x3c4267);}return null;};}function patchUpdates(_0x5caa79){return function(_0x313569){try{jsonpatch[_0x3a41('0x23')](_0x313569,_0x5caa79,!![]);}catch(_0x4905de){return BPromise[_0x3a41('0x24')](_0x4905de);}return _0x313569[_0x3a41('0x25')]();};}function saveUpdates(_0x17dcf5,_0x52fede){return function(_0xe9472b){if(_0xe9472b){return _0xe9472b[_0x3a41('0x26')](_0x17dcf5)['then'](function(_0x15e91c){return _0x15e91c;});}return null;};}function removeEntity(_0x2a1354,_0x4240a8){return function(_0x2d5f59){if(_0x2d5f59){return _0x2d5f59[_0x3a41('0x27')]()['then'](function(){_0x2a1354[_0x3a41('0x1c')](0xcc)[_0x3a41('0x1d')]();});}};}function handleEntityNotFound(_0x56e559,_0x358d8e){return function(_0x5dfbee){if(!_0x5dfbee){_0x56e559[_0x3a41('0x1b')](0x194);}return _0x5dfbee;};}function handleError(_0x566d35,_0x201507){_0x201507=_0x201507||0x1f4;return function(_0x5be3cd){logger[_0x3a41('0x28')](_0x5be3cd[_0x3a41('0x29')]);if(_0x5be3cd[_0x3a41('0x2a')]){delete _0x5be3cd[_0x3a41('0x2a')];}_0x566d35[_0x3a41('0x1c')](_0x201507)[_0x3a41('0x2b')](_0x5be3cd);};}exports[_0x3a41('0x2c')]=function(_0x1206fb,_0xeb5219){var _0x3772ce={},_0x12b166={},_0x443fdf={'count':0x0,'rows':[]};var _0x435380=_[_0x3a41('0x2d')](db['UserProfile']['rawAttributes'],function(_0x5be457){return{'name':_0x5be457['fieldName'],'type':_0x5be457[_0x3a41('0x2e')][_0x3a41('0x2f')]};});_0x12b166[_0x3a41('0x30')]=_[_0x3a41('0x2d')](_0x435380,_0x3a41('0x2a'));_0x12b166['query']=_['keys'](_0x1206fb['query']);_0x12b166[_0x3a41('0x31')]=_[_0x3a41('0x32')](_0x12b166['model'],_0x12b166[_0x3a41('0x33')]);_0x3772ce[_0x3a41('0x34')]=_[_0x3a41('0x32')](_0x12b166[_0x3a41('0x30')],qs[_0x3a41('0x35')](_0x1206fb[_0x3a41('0x33')][_0x3a41('0x35')]));_0x3772ce[_0x3a41('0x34')]=_0x3772ce[_0x3a41('0x34')][_0x3a41('0x36')]?_0x3772ce[_0x3a41('0x34')]:_0x12b166[_0x3a41('0x30')];if(!_0x1206fb[_0x3a41('0x33')][_0x3a41('0x37')](_0x3a41('0x38'))){_0x3772ce['limit']=qs['limit'](_0x1206fb[_0x3a41('0x33')][_0x3a41('0x20')]);_0x3772ce['offset']=qs[_0x3a41('0x1e')](_0x1206fb['query']['offset']);}_0x3772ce['order']=qs[_0x3a41('0x39')](_0x1206fb[_0x3a41('0x33')]['sort']);_0x3772ce[_0x3a41('0x3a')]=qs[_0x3a41('0x31')](_['pick'](_0x1206fb[_0x3a41('0x33')],_0x12b166[_0x3a41('0x31')]),_0x435380);if(_0x1206fb['query'][_0x3a41('0x3b')]){_0x3772ce['where']=_['merge'](_0x3772ce['where'],{'$or':_[_0x3a41('0x2d')](_0x435380,function(_0x45e17d){if(_0x45e17d['type']!==_0x3a41('0x3c')){var _0x1cff1c={};_0x1cff1c[_0x45e17d[_0x3a41('0x2a')]]={'$like':'%'+_0x1206fb[_0x3a41('0x33')][_0x3a41('0x3b')]+'%'};return _0x1cff1c;}})});}_0x3772ce=_[_0x3a41('0x3d')]({},_0x3772ce,_0x1206fb[_0x3a41('0x3e')]);var _0x349345={'where':_0x3772ce[_0x3a41('0x3a')]};return db[_0x3a41('0x3f')][_0x3a41('0x40')](_0x349345)[_0x3a41('0x41')](function(_0x5115b8){_0x443fdf['count']=_0x5115b8;if(_0x1206fb['query']['includeAll']){_0x3772ce[_0x3a41('0x42')]=[{'all':!![]}];}return db[_0x3a41('0x3f')]['findAll'](_0x3772ce);})[_0x3a41('0x41')](function(_0x4c6659){_0x443fdf[_0x3a41('0x43')]=_0x4c6659;return _0x443fdf;})[_0x3a41('0x41')](respondWithFilteredResult(_0xeb5219,_0x3772ce))[_0x3a41('0x44')](handleError(_0xeb5219,null));};exports['show']=function(_0x2e6a3a,_0x1f2e28){var _0x382dfd={'raw':![],'where':{'id':_0x2e6a3a[_0x3a41('0x45')]['id']}},_0x48c94c={};_0x48c94c[_0x3a41('0x30')]=_[_0x3a41('0x46')](db[_0x3a41('0x3f')][_0x3a41('0x47')]);_0x48c94c[_0x3a41('0x33')]=_[_0x3a41('0x46')](_0x2e6a3a['query']);_0x48c94c[_0x3a41('0x31')]=_[_0x3a41('0x32')](_0x48c94c[_0x3a41('0x30')],_0x48c94c[_0x3a41('0x33')]);_0x382dfd['attributes']=_[_0x3a41('0x32')](_0x48c94c[_0x3a41('0x30')],qs['fields'](_0x2e6a3a[_0x3a41('0x33')][_0x3a41('0x35')]));_0x382dfd[_0x3a41('0x34')]=_0x382dfd[_0x3a41('0x34')][_0x3a41('0x36')]?_0x382dfd['attributes']:_0x48c94c[_0x3a41('0x30')];if(_0x2e6a3a['query']['includeAll']){_0x382dfd[_0x3a41('0x42')]=[{'all':!![]}];}_0x382dfd=_[_0x3a41('0x3d')]({},_0x382dfd,_0x2e6a3a[_0x3a41('0x3e')]);return db[_0x3a41('0x3f')]['find'](_0x382dfd)['then'](handleEntityNotFound(_0x1f2e28,null))['then'](respondWithResult(_0x1f2e28,null))[_0x3a41('0x44')](handleError(_0x1f2e28,null));};exports[_0x3a41('0x48')]=function(_0xde1297,_0x3069db){return db[_0x3a41('0x3f')][_0x3a41('0x48')](_0xde1297[_0x3a41('0x49')],{})[_0x3a41('0x41')](respondWithResult(_0x3069db,0xc9))[_0x3a41('0x44')](handleError(_0x3069db,null));};exports[_0x3a41('0x4a')]=function(_0x14d70b,_0x13da9a){var _0x2ef003={'where':{'id':_0x14d70b['params']['id']}},_0x19aa48={};_0x19aa48[_0x3a41('0x30')]=_['keys'](db[_0x3a41('0x3f')]['rawAttributes']);_0x2ef003[_0x3a41('0x34')]=_['intersection'](_0x19aa48[_0x3a41('0x30')],qs[_0x3a41('0x35')](_0x14d70b[_0x3a41('0x33')][_0x3a41('0x35')]));_0x2ef003['attributes']=_0x2ef003[_0x3a41('0x34')]['length']?_0x2ef003[_0x3a41('0x34')]:_0x19aa48[_0x3a41('0x30')];if(_0x14d70b[_0x3a41('0x33')][_0x3a41('0x4b')]){_0x2ef003[_0x3a41('0x42')]=[{'all':!![]}];}_0x2ef003=_[_0x3a41('0x3d')]({},_0x2ef003,_0x14d70b[_0x3a41('0x3e')]);return db[_0x3a41('0x3f')][_0x3a41('0x4c')](_0x2ef003)['then'](handleEntityNotFound(_0x13da9a,null))[_0x3a41('0x41')](function(_0x59ae4f){if(_0x59ae4f){var _0x570253=_0x59ae4f[_0x3a41('0x4d')]({'plain':!![]});_0x570253=qs[_0x3a41('0x4e')](_0x570253,['id','createdAt',_0x3a41('0x4f'),_0x3a41('0x50')]);_0x14d70b[_0x3a41('0x49')]=_['omit'](_0x14d70b[_0x3a41('0x49')],['id',_0x3a41('0x51'),_0x3a41('0x4f')]);return db[_0x3a41('0x52')][_0x3a41('0x53')](function(_0x3fd80a){return db[_0x3a41('0x3f')][_0x3a41('0x48')](_[_0x3a41('0x3d')](_0x570253,_0x14d70b[_0x3a41('0x49')]),{'include':_0x14d70b['query'][_0x3a41('0x4b')]?[{'all':!![]}]:undefined,'transaction':_0x3fd80a})[_0x3a41('0x41')](function(_0x462294){var _0x2854f9=_0x462294[_0x3a41('0x4d')]({'plain':!![]});return db[_0x3a41('0x54')][_0x3a41('0x55')]({'where':{'userProfileId':_0x14d70b[_0x3a41('0x45')]['id']},'raw':!![]})[_0x3a41('0x41')](function(_0x4c6d0f){if(_0x4c6d0f){return BPromise[_0x3a41('0x56')](_0x4c6d0f,function(_0x4d8f94){return new BPromise(function(_0x2e8b34,_0x489038){if(_0x4d8f94[_0x3a41('0x57')]===null||_0x4d8f94[_0x3a41('0x57')]===0x1)_0x2e8b34(null);return db[_0x3a41('0x58')][_0x3a41('0x55')]({'where':{'sectionId':_0x4d8f94['id']},'raw':!![]})[_0x3a41('0x41')](function(_0x13e116){var _0x973a72=_[_0x3a41('0x2d')](_0x13e116,function(_0x1a5890){return qs[_0x3a41('0x4e')](_0x1a5890,['id','createdAt',_0x3a41('0x4f'),_0x3a41('0x59')]);});_0x2e8b34(_0x973a72);})['catch'](function(_0x452ce1){_0x489038(_0x452ce1);});})[_0x3a41('0x41')](function(_0x378465){var _0x2576a8=qs[_0x3a41('0x4e')](_0x4d8f94,['id',_0x3a41('0x51'),'updatedAt']);_0x2576a8[_0x3a41('0x5a')]=_0x2854f9['id'];if(_0x378465)_0x2576a8[_0x3a41('0x5b')]=_0x378465;return _0x2576a8;})[_0x3a41('0x41')](function(_0x1ec7f5){return db[_0x3a41('0x54')][_0x3a41('0x48')](_0x1ec7f5,{'include':[{'model':db[_0x3a41('0x58')],'as':_0x3a41('0x5b')}],'raw':!![],'transaction':_0x3fd80a});});})['then'](function(){return _0x2854f9;});}});});});}})['then'](respondWithResult(_0x13da9a,0xc9))[_0x3a41('0x44')](handleError(_0x13da9a,null));};exports[_0x3a41('0x26')]=function(_0x488b53,_0x4b0a10){if(_0x488b53[_0x3a41('0x49')]['id']){delete _0x488b53[_0x3a41('0x49')]['id'];}return db[_0x3a41('0x3f')][_0x3a41('0x4c')]({'where':{'id':_0x488b53['params']['id']}})['then'](handleEntityNotFound(_0x4b0a10,null))[_0x3a41('0x41')](saveUpdates(_0x488b53[_0x3a41('0x49')],null))[_0x3a41('0x41')](respondWithResult(_0x4b0a10,null))[_0x3a41('0x44')](handleError(_0x4b0a10,null));};exports[_0x3a41('0x27')]=function(_0x412b7d,_0x4adab2){return db[_0x3a41('0x3f')]['find']({'where':{'id':_0x412b7d[_0x3a41('0x45')]['id']}})[_0x3a41('0x41')](handleEntityNotFound(_0x4adab2,null))[_0x3a41('0x41')](removeEntity(_0x4adab2,null))[_0x3a41('0x44')](handleError(_0x4adab2,null));};exports[_0x3a41('0x5c')]=function(_0x4c24c8,_0x41e4d1){return db['UserProfile'][_0x3a41('0x5c')]()[_0x3a41('0x41')](respondWithResult(_0x41e4d1,null))[_0x3a41('0x44')](handleError(_0x41e4d1,null));};exports[_0x3a41('0x5d')]=function(_0x2861f5,_0x266e52){var _0x2b497d=_0x2861f5[_0x3a41('0x49')];return db[_0x3a41('0x3f')]['find']({'where':{'id':_0x2861f5['params']['id']}})[_0x3a41('0x41')](handleEntityNotFound(_0x266e52,null))[_0x3a41('0x41')](function(_0x1ccf46){if(_0x1ccf46){return db[_0x3a41('0x52')][_0x3a41('0x53')](function(_0x50915b){return db['UserProfileSection'][_0x3a41('0x27')]({'where':{'userProfileId':_0x2861f5['params']['id'],'sectionId':_[_0x3a41('0x2d')](_0x2b497d,function(_0x5c24fb){return _0x5c24fb[_0x3a41('0x59')];})},'transaction':_0x50915b})[_0x3a41('0x41')](function(){var _0xa1cece=_['map'](_0x2b497d,function(_0x10ebf7){_0x10ebf7[_0x3a41('0x5a')]=_0x2861f5[_0x3a41('0x45')]['id'];return _0x10ebf7;});var _0x5527d0=[];return BPromise[_0x3a41('0x56')](_0xa1cece,function(_0x52050c){return db[_0x3a41('0x54')][_0x3a41('0x48')](_0x52050c,{'include':[{'model':db['UserProfileResource'],'as':_0x3a41('0x5b')}],'raw':!![],'transaction':_0x50915b})[_0x3a41('0x41')](function(_0x2a1e24){_0x5527d0[_0x3a41('0x5e')](_0x2a1e24[_0x3a41('0x4d')]({'plain':!![]}));});})[_0x3a41('0x41')](function(){return _0x5527d0;});});});}})['then'](function(_0x9a7372){return _0x9a7372;})['then'](respondWithResult(_0x266e52,null))[_0x3a41('0x44')](handleError(_0x266e52,null));};exports['removeSections']=function(_0x1f96f9,_0x7354f4){var _0x4efa91;return db[_0x3a41('0x3f')]['find']({'where':{'id':_0x1f96f9[_0x3a41('0x45')]['id']},'attributes':['id',_0x3a41('0x2a')]})['then'](handleEntityNotFound(_0x7354f4,null))[_0x3a41('0x41')](function(_0x3af766){if(_0x3af766){_0x4efa91=_0x3af766;return db[_0x3a41('0x54')][_0x3a41('0x27')]({'where':{'userProfileId':_0x1f96f9[_0x3a41('0x45')]['id'],'sectionId':_0x1f96f9['query'][_0x3a41('0x5f')]}});}})[_0x3a41('0x41')](function(){return _0x4efa91;})[_0x3a41('0x41')](respondWithStatusCode(_0x7354f4,null))[_0x3a41('0x44')](handleError(_0x7354f4,null));};exports[_0x3a41('0x60')]=function(_0x59970e,_0x1a21fc){var _0x53d5e3=[];var _0x24569d=[];return db[_0x3a41('0x54')][_0x3a41('0x55')]({'where':{'userProfileId':_0x59970e[_0x3a41('0x45')]['id']},'raw':!![]})[_0x3a41('0x41')](function(_0x2f8c7c){_0x53d5e3=_['filter'](_0x2f8c7c,function(_0x2e7bcc){return _0x2e7bcc['enabled']===0x1||_[_0x3a41('0x61')]([0x3eb,0x709],_0x2e7bcc[_0x3a41('0x59')]);});if(!_[_0x3a41('0x62')](_0x53d5e3)){return _['map'](_0x53d5e3,function(_0x5dd3d5){return _0x5dd3d5[_0x3a41('0x59')];});}else{return;}})[_0x3a41('0x41')](function(_0x43f355){if(_0x43f355)_0x24569d=_0x43f355;if(_[_0x3a41('0x61')](_0x24569d,0x64)){var _0x5353e0=_['find'](_0x53d5e3,{'sectionId':0x64});return hasDefaultDashboard(_0x5353e0)['then'](function(_0x40d572){return _[_0x3a41('0x2d')](_0x53d5e3,function(_0x3f3d63){if(_0x3f3d63['sectionId']===0x64){_0x3f3d63[_0x3a41('0x63')]=_0x40d572;}return _0x3f3d63;});});}else{return;}})[_0x3a41('0x41')](function(_0xb2d40f){if(_0xb2d40f)_0x53d5e3=_0xb2d40f;if(_[_0x3a41('0x61')](_0x24569d,0x3eb)){var _0x1b02fd=_[_0x3a41('0x4c')](_0x53d5e3,{'sectionId':0x3eb});return getCustomDashboards(_0x1b02fd)[_0x3a41('0x41')](function(_0x27bdc3){return _['map'](_0x53d5e3,function(_0x123807){if(_0x1b02fd[_0x3a41('0x64')]){if(_0x123807[_0x3a41('0x59')]===0x3eb){_0x123807[_0x3a41('0x63')]=_0x27bdc3;}}else{if(_0x123807[_0x3a41('0x59')]===0x64){_0x123807[_0x3a41('0x63')]=_0x27bdc3;}}return _0x123807;});});}else{return;}})['then'](function(_0x4ac390){if(_0x4ac390)_0x53d5e3=_0x4ac390;if(_['includes'](_0x24569d,0x709)){var _0x4e9013=_['find'](_0x53d5e3,{'sectionId':0x709});return getPlugins(_0x4e9013)[_0x3a41('0x41')](function(_0x47c7ac){if(_0x4e9013[_0x3a41('0x64')]){return _['map'](_0x53d5e3,function(_0x552f83){if(_0x552f83[_0x3a41('0x59')]===0x709){_0x552f83[_0x3a41('0x63')]=_0x47c7ac;}return _0x552f83;});}else{var _0xf60a22={'sectionId':0x76c,'enabled':0x1,'subsections':_0x47c7ac};var _0x400b14=_[_0x3a41('0x2d')](_0x53d5e3);_0x400b14['push'](_0xf60a22);return _0x400b14;}});}else{return;}})['then'](function(_0x454ca1){if(_0x454ca1)_0x53d5e3=_0x454ca1;return _[_0x3a41('0x3b')](_0x53d5e3,['enabled',0x1]);})['then'](respondWithResult(_0x1a21fc,null))[_0x3a41('0x44')](handleError(_0x1a21fc,null));};function hasDefaultDashboard(_0xfc8187){var _0x2cc203=[0x65];return new BPromise(function(_0x32dbf9,_0x2c404f){try{if(_0xfc8187[_0x3a41('0x57')]){_0x32dbf9(_0x2cc203);}else{return db[_0x3a41('0x58')]['findOne']({'where':{'sectionId':_0xfc8187['id']},'raw':!![]})[_0x3a41('0x41')](function(_0x3e8250){_0x3e8250?_0x32dbf9(_0x2cc203):_0x32dbf9();});}}catch(_0x31ae94){_0x2c404f(_0x31ae94);}});}function getCustomDashboards(_0x38007e){var _0x35eeb2=[];return new BPromise(function(_0x5aeddd,_0x4ed492){try{if(_0x38007e[_0x3a41('0x57')]){return db[_0x3a41('0x65')][_0x3a41('0x55')]({'raw':!![]})[_0x3a41('0x41')](function(_0x5812dd){_0x5812dd[_0x3a41('0x66')](function(_0x1b65d6){_0x35eeb2['push'](_0x1b65d6['id']+0x1869f);});_0x5aeddd(_0x35eeb2);});}else{return db[_0x3a41('0x58')]['findAll']({'where':{'sectionId':_0x38007e['id']},'raw':!![]})['then'](function(_0x26c5df){_0x26c5df['forEach'](function(_0x30a7e5){_0x35eeb2[_0x3a41('0x5e')](_0x30a7e5[_0x3a41('0x67')]+0x1869f);});_0x5aeddd(_0x35eeb2);});}}catch(_0x8b4fcf){_0x4ed492(_0x8b4fcf);}});}function getPlugins(_0x3b6975){var _0x2be7d0=[];return new BPromise(function(_0x88a00e,_0x1e99bf){try{if(_0x3b6975[_0x3a41('0x57')]){return db[_0x3a41('0x68')][_0x3a41('0x55')]({'raw':!![]})[_0x3a41('0x41')](function(_0xef3198){_0xef3198['forEach'](function(_0x9bb7c8){_0x2be7d0[_0x3a41('0x5e')](_0x9bb7c8['id']+0x15b38);});_0x88a00e(_0x2be7d0);});}else{return db[_0x3a41('0x58')]['findAll']({'where':{'sectionId':_0x3b6975['id']},'raw':!![]})['then'](function(_0x5c2193){_0x5c2193[_0x3a41('0x66')](function(_0x48e06d){_0x2be7d0['push'](_0x48e06d[_0x3a41('0x67')]+0x15b38);});_0x88a00e(_0x2be7d0);});}}catch(_0x211203){_0x1e99bf(_0x211203);}});}exports[_0x3a41('0x69')]=function(_0x28a4e2,_0x48444f){return db['UserProfile']['find']({'where':{'id':_0x28a4e2[_0x3a41('0x45')]['id']}})[_0x3a41('0x41')](handleEntityNotFound(_0x48444f,null))[_0x3a41('0x41')](function(_0x4c1ebd){if(_0x4c1ebd){return db[_0x3a41('0x52')][_0x3a41('0x53')](function(_0x50ea76){return db[_0x3a41('0x54')]['findAll']({'where':{'userProfileId':_0x28a4e2[_0x3a41('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0x3a41('0x41')](function(_0x5632ad){if(_0x5632ad){return db[_0x3a41('0x54')]['destroy']({'where':{'userProfileId':_0x28a4e2[_0x3a41('0x45')]['id'],'id':_['map'](_0x5632ad,function(_0x60c2fe){return _0x60c2fe['id'];})},'transaction':_0x50ea76});}})[_0x3a41('0x41')](function(_0x3d53fe){var _0x3faf84=_[_0x3a41('0x2d')](_0x28a4e2['body'],function(_0x4ee912){_0x4ee912[_0x3a41('0x5a')]=_0x28a4e2[_0x3a41('0x45')]['id'];return _0x4ee912;});return db['UserProfileSection']['bulkCreate'](_0x3faf84,{'raw':!![],'transaction':_0x50ea76});})[_0x3a41('0x41')](function(_0x3ee89d){var _0x44a3b7=_['filter'](_[_0x3a41('0x2d')](_0x3ee89d,function(_0x183846){return _0x183846['get']({'plain':!![]});}),{'includeAll':![]});if(_0x44a3b7){return db[_0x3a41('0x54')]['findAll']({'where':{'userProfileId':_0x28a4e2['params']['id'],'sectionId':_['map'](_0x44a3b7,function(_0x36f24c){return _0x36f24c[_0x3a41('0x59')];})},'attributes':['id',_0x3a41('0x59')],'raw':!![]})[_0x3a41('0x41')](function(_0x48cec2){var _0x3f75a1=_[_0x3a41('0x2d')](_0x28a4e2[_0x3a41('0x49')],function(_0x178d80){_0x178d80[_0x3a41('0x5a')]=_0x28a4e2[_0x3a41('0x45')]['id'];return _0x178d80;});return db['UserProfileResource'][_0x3a41('0x6a')](_0x3f75a1,{'raw':!![],'transaction':_0x50ea76});});}})[_0x3a41('0x44')](handleError(_0x48444f,null));});}})['then'](function(_0x113b81){var _0x1b44db=_[_0x3a41('0x2d')](_0x113b81,function(_0x50d397){return _0x50d397[_0x3a41('0x4d')]({'plain':!![]});});})[_0x3a41('0x41')](respondWithResult(_0x48444f,null))[_0x3a41('0x44')](handleError(_0x48444f,null));};exports[_0x3a41('0x6b')]=function(_0x16739e,_0x108778,_0x24cb2c){return db[_0x3a41('0x3f')][_0x3a41('0x4c')]({'where':{'id':_0x16739e['params']['id']}})[_0x3a41('0x41')](handleEntityNotFound(_0x108778,null))[_0x3a41('0x41')](function(_0x20d19a){if(_0x20d19a){return _0x20d19a[_0x3a41('0x6b')](_0x16739e['query'][_0x3a41('0x5f')]);}})[_0x3a41('0x41')](respondWithStatusCode(_0x108778,null))[_0x3a41('0x44')](handleError(_0x108778,null));};exports[_0x3a41('0x6c')]=function(_0x125552,_0x1e44c8){var _0x49d68a={};if(!_0x125552[_0x3a41('0x33')]['section'])throw new Error(_0x3a41('0x6d'));if(!_0x125552[_0x3a41('0x33')]['hasOwnProperty'](_0x3a41('0x38'))){_0x49d68a[_0x3a41('0x20')]=qs[_0x3a41('0x20')](_0x125552['query'][_0x3a41('0x20')]);_0x49d68a[_0x3a41('0x1e')]=qs[_0x3a41('0x1e')](_0x125552[_0x3a41('0x33')][_0x3a41('0x1e')]);}return db[_0x3a41('0x3f')][_0x3a41('0x4c')]({'where':{'id':_0x125552['params']['id']}})[_0x3a41('0x41')](function(_0x1a3108){if(!_0x1a3108)throw new Error(_0x3a41('0x6e')+_0x125552[_0x3a41('0x45')]['id']);return db[_0x3a41('0x3f')][_0x3a41('0x6c')](_0x125552);})[_0x3a41('0x41')](respondWithFilteredResult(_0x1e44c8,_0x49d68a))['catch'](handleError(_0x1e44c8,null));}; \ No newline at end of file +var _0x1e8c=['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','./userProfile.socket','register','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','create','body','clone','length','options','find','get','omit','createdAt','sequelize','autoAssociation','UserProfileResource','sectionId','updatedAt','userProfileId','Resources','UserProfileSection','describe','transaction','each','removeSections','ids','getSections','enabled','isEmpty','subsections','includes','findOne','Dashboard','forEach','push','resourceId','removeResources','section','Missing\x20section\x20parameter','getResources','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2de358,_0x517497){var _0x540e15=function(_0x16b820){while(--_0x16b820){_0x2de358['push'](_0x2de358['shift']());}};_0x540e15(++_0x517497);}(_0x1e8c,0xd3));var _0xc1e8=function(_0x1f91f1,_0xdbc1a1){_0x1f91f1=_0x1f91f1-0x0;var _0x1df196=_0x1e8c[_0x1f91f1];return _0x1df196;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1e8('0x0'));var zipdir=require(_0xc1e8('0x1'));var jsonpatch=require(_0xc1e8('0x2'));var rp=require(_0xc1e8('0x3'));var moment=require(_0xc1e8('0x4'));var BPromise=require(_0xc1e8('0x5'));var Mustache=require('mustache');var util=require(_0xc1e8('0x6'));var path=require(_0xc1e8('0x7'));var sox=require(_0xc1e8('0x8'));var csv=require(_0xc1e8('0x9'));var ejs=require(_0xc1e8('0xa'));var fs=require('fs');var fs_extra=require(_0xc1e8('0xb'));var _=require('lodash');var squel=require(_0xc1e8('0xc'));var crypto=require(_0xc1e8('0xd'));var jsforce=require(_0xc1e8('0xe'));var deskjs=require(_0xc1e8('0xf'));var toCsv=require(_0xc1e8('0x9'));var querystring=require(_0xc1e8('0x10'));var Papa=require(_0xc1e8('0x11'));var Redis=require(_0xc1e8('0x12'));var authService=require(_0xc1e8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc1e8('0x14'));var hardwareService=require(_0xc1e8('0x15'));var logger=require(_0xc1e8('0x16'))(_0xc1e8('0x17'));var utils=require(_0xc1e8('0x18'));var config=require(_0xc1e8('0x19'));var licenseUtil=require(_0xc1e8('0x1a'));var db=require(_0xc1e8('0x1b'))['db'];config['redis']=_[_0xc1e8('0x1c')](config[_0xc1e8('0x1d')],{'host':_0xc1e8('0x1e'),'port':0x18eb});var socket=require(_0xc1e8('0x1f'))(new Redis(config[_0xc1e8('0x1d')]));require(_0xc1e8('0x20'))[_0xc1e8('0x21')](socket);function respondWithStatusCode(_0x4e9151,_0x1391b9){_0x1391b9=_0x1391b9||0xcc;return function(_0x32ddac){if(_0x32ddac){return _0x4e9151['sendStatus'](_0x1391b9);}return _0x4e9151['status'](_0x1391b9)[_0xc1e8('0x22')]();};}function respondWithResult(_0x3e0325,_0x41717a){_0x41717a=_0x41717a||0xc8;return function(_0x25a13d){if(_0x25a13d){return _0x3e0325[_0xc1e8('0x23')](_0x41717a)['json'](_0x25a13d);}};}function respondWithFilteredResult(_0x126d90,_0x1e51eb){return function(_0x408a64){if(_0x408a64){var _0x5dcb16=typeof _0x1e51eb[_0xc1e8('0x24')]===_0xc1e8('0x25')&&typeof _0x1e51eb[_0xc1e8('0x26')]===_0xc1e8('0x25');var _0x5be572=_0x408a64['count'];var _0x2c2402=_0x5dcb16?0x0:_0x1e51eb['offset'];var _0x489f3c=_0x5dcb16?_0x408a64[_0xc1e8('0x27')]:_0x1e51eb[_0xc1e8('0x24')]+_0x1e51eb[_0xc1e8('0x26')];var _0x9e29dd;if(_0x489f3c>=_0x5be572){_0x489f3c=_0x5be572;_0x9e29dd=0xc8;}else{_0x9e29dd=0xce;}_0x126d90[_0xc1e8('0x23')](_0x9e29dd);return _0x126d90[_0xc1e8('0x28')](_0xc1e8('0x29'),_0x2c2402+'-'+_0x489f3c+'/'+_0x5be572)[_0xc1e8('0x2a')](_0x408a64);}return null;};}function patchUpdates(_0x38c366){return function(_0x473841){try{jsonpatch[_0xc1e8('0x2b')](_0x473841,_0x38c366,!![]);}catch(_0x3e8e99){return BPromise[_0xc1e8('0x2c')](_0x3e8e99);}return _0x473841['save']();};}function saveUpdates(_0x3d37e3,_0x2293e7){return function(_0x204392){if(_0x204392){return _0x204392[_0xc1e8('0x2d')](_0x3d37e3)[_0xc1e8('0x2e')](function(_0x462e13){return _0x462e13;});}return null;};}function removeEntity(_0x2d1ad8,_0x53d25e){return function(_0x10af8c){if(_0x10af8c){return _0x10af8c[_0xc1e8('0x2f')]()['then'](function(){_0x2d1ad8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x323132,_0x116682){return function(_0x22d248){if(!_0x22d248){_0x323132['sendStatus'](0x194);}return _0x22d248;};}function handleError(_0x225d35,_0x286186){_0x286186=_0x286186||0x1f4;return function(_0xea3934){logger['error'](_0xea3934['stack']);if(_0xea3934[_0xc1e8('0x30')]){delete _0xea3934['name'];}_0x225d35[_0xc1e8('0x23')](_0x286186)[_0xc1e8('0x31')](_0xea3934);};}exports['index']=function(_0x53e14f,_0x23a4d8){var _0x463fd8={},_0x5c5c92={},_0x5c0316={'count':0x0,'rows':[]};var _0x3a2fc2=_[_0xc1e8('0x32')](db[_0xc1e8('0x33')][_0xc1e8('0x34')],function(_0x7b41ee){return{'name':_0x7b41ee[_0xc1e8('0x35')],'type':_0x7b41ee[_0xc1e8('0x36')][_0xc1e8('0x37')]};});_0x5c5c92[_0xc1e8('0x38')]=_[_0xc1e8('0x32')](_0x3a2fc2,_0xc1e8('0x30'));_0x5c5c92[_0xc1e8('0x39')]=_[_0xc1e8('0x3a')](_0x53e14f['query']);_0x5c5c92[_0xc1e8('0x3b')]=_[_0xc1e8('0x3c')](_0x5c5c92['model'],_0x5c5c92['query']);_0x463fd8[_0xc1e8('0x3d')]=_['intersection'](_0x5c5c92[_0xc1e8('0x38')],qs[_0xc1e8('0x3e')](_0x53e14f[_0xc1e8('0x39')]['fields']));_0x463fd8['attributes']=_0x463fd8[_0xc1e8('0x3d')]['length']?_0x463fd8[_0xc1e8('0x3d')]:_0x5c5c92['model'];if(!_0x53e14f['query'][_0xc1e8('0x3f')](_0xc1e8('0x40'))){_0x463fd8[_0xc1e8('0x26')]=qs[_0xc1e8('0x26')](_0x53e14f[_0xc1e8('0x39')]['limit']);_0x463fd8['offset']=qs[_0xc1e8('0x24')](_0x53e14f['query'][_0xc1e8('0x24')]);}_0x463fd8[_0xc1e8('0x41')]=qs[_0xc1e8('0x42')](_0x53e14f[_0xc1e8('0x39')]['sort']);_0x463fd8['where']=qs['filters'](_[_0xc1e8('0x43')](_0x53e14f[_0xc1e8('0x39')],_0x5c5c92[_0xc1e8('0x3b')]),_0x3a2fc2);if(_0x53e14f[_0xc1e8('0x39')][_0xc1e8('0x44')]){_0x463fd8[_0xc1e8('0x45')]=_['merge'](_0x463fd8['where'],{'$or':_['map'](_0x3a2fc2,function(_0x2af685){if(_0x2af685['type']!=='VIRTUAL'){var _0x44f730={};_0x44f730[_0x2af685[_0xc1e8('0x30')]]={'$like':'%'+_0x53e14f[_0xc1e8('0x39')][_0xc1e8('0x44')]+'%'};return _0x44f730;}})});}_0x463fd8=_[_0xc1e8('0x46')]({},_0x463fd8,_0x53e14f['options']);var _0x21a301={'where':_0x463fd8['where']};return db[_0xc1e8('0x33')][_0xc1e8('0x27')](_0x21a301)[_0xc1e8('0x2e')](function(_0x347e8e){_0x5c0316[_0xc1e8('0x27')]=_0x347e8e;if(_0x53e14f[_0xc1e8('0x39')][_0xc1e8('0x47')]){_0x463fd8[_0xc1e8('0x48')]=[{'all':!![]}];}return db[_0xc1e8('0x33')][_0xc1e8('0x49')](_0x463fd8);})['then'](function(_0x16172b){_0x5c0316[_0xc1e8('0x4a')]=_0x16172b;return _0x5c0316;})[_0xc1e8('0x2e')](respondWithFilteredResult(_0x23a4d8,_0x463fd8))[_0xc1e8('0x4b')](handleError(_0x23a4d8,null));};exports[_0xc1e8('0x4c')]=function(_0x593878,_0x470299){var _0x1477c3={'raw':![],'where':{'id':_0x593878[_0xc1e8('0x4d')]['id']}},_0x73c98b={};_0x73c98b['model']=_[_0xc1e8('0x3a')](db[_0xc1e8('0x33')][_0xc1e8('0x34')]);_0x73c98b[_0xc1e8('0x39')]=_['keys'](_0x593878[_0xc1e8('0x39')]);_0x73c98b[_0xc1e8('0x3b')]=_[_0xc1e8('0x3c')](_0x73c98b['model'],_0x73c98b[_0xc1e8('0x39')]);_0x1477c3[_0xc1e8('0x3d')]=_[_0xc1e8('0x3c')](_0x73c98b['model'],qs[_0xc1e8('0x3e')](_0x593878[_0xc1e8('0x39')]['fields']));_0x1477c3[_0xc1e8('0x3d')]=_0x1477c3[_0xc1e8('0x3d')]['length']?_0x1477c3[_0xc1e8('0x3d')]:_0x73c98b[_0xc1e8('0x38')];if(_0x593878[_0xc1e8('0x39')][_0xc1e8('0x47')]){_0x1477c3[_0xc1e8('0x48')]=[{'all':!![]}];}_0x1477c3=_[_0xc1e8('0x46')]({},_0x1477c3,_0x593878['options']);return db['UserProfile']['find'](_0x1477c3)['then'](handleEntityNotFound(_0x470299,null))[_0xc1e8('0x2e')](respondWithResult(_0x470299,null))['catch'](handleError(_0x470299,null));};exports[_0xc1e8('0x4e')]=function(_0x18c9b0,_0x2e79a3){return db['UserProfile']['create'](_0x18c9b0[_0xc1e8('0x4f')],{})[_0xc1e8('0x2e')](respondWithResult(_0x2e79a3,0xc9))[_0xc1e8('0x4b')](handleError(_0x2e79a3,null));};exports[_0xc1e8('0x50')]=function(_0x374ac8,_0x1b1a94){var _0x1f393c={'where':{'id':_0x374ac8['params']['id']}},_0x273e51={};_0x273e51['model']=_[_0xc1e8('0x3a')](db['UserProfile'][_0xc1e8('0x34')]);_0x1f393c[_0xc1e8('0x3d')]=_[_0xc1e8('0x3c')](_0x273e51['model'],qs[_0xc1e8('0x3e')](_0x374ac8[_0xc1e8('0x39')][_0xc1e8('0x3e')]));_0x1f393c['attributes']=_0x1f393c['attributes'][_0xc1e8('0x51')]?_0x1f393c[_0xc1e8('0x3d')]:_0x273e51[_0xc1e8('0x38')];if(_0x374ac8[_0xc1e8('0x39')][_0xc1e8('0x47')]){_0x1f393c['include']=[{'all':!![]}];}_0x1f393c=_[_0xc1e8('0x46')]({},_0x1f393c,_0x374ac8[_0xc1e8('0x52')]);return db[_0xc1e8('0x33')][_0xc1e8('0x53')](_0x1f393c)[_0xc1e8('0x2e')](handleEntityNotFound(_0x1b1a94,null))[_0xc1e8('0x2e')](function(_0x179844){if(_0x179844){var _0x2072b4=_0x179844[_0xc1e8('0x54')]({'plain':!![]});_0x2072b4=qs[_0xc1e8('0x55')](_0x2072b4,['id',_0xc1e8('0x56'),'updatedAt','crudPermissions']);_0x374ac8['body']=_[_0xc1e8('0x55')](_0x374ac8[_0xc1e8('0x4f')],['id',_0xc1e8('0x56'),'updatedAt']);return db[_0xc1e8('0x57')]['transaction'](function(_0x371343){return db[_0xc1e8('0x33')][_0xc1e8('0x4e')](_[_0xc1e8('0x46')](_0x2072b4,_0x374ac8['body']),{'include':_0x374ac8[_0xc1e8('0x39')][_0xc1e8('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x371343})[_0xc1e8('0x2e')](function(_0x3dbf75){var _0xe0e993=_0x3dbf75[_0xc1e8('0x54')]({'plain':!![]});return db['UserProfileSection'][_0xc1e8('0x49')]({'where':{'userProfileId':_0x374ac8[_0xc1e8('0x4d')]['id']},'raw':!![]})[_0xc1e8('0x2e')](function(_0x4c04a4){if(_0x4c04a4){return BPromise['each'](_0x4c04a4,function(_0x1a9bae){return new BPromise(function(_0x37fe61,_0x19a215){if(_0x1a9bae[_0xc1e8('0x58')]===null||_0x1a9bae[_0xc1e8('0x58')]===0x1)_0x37fe61(null);return db[_0xc1e8('0x59')]['findAll']({'where':{'sectionId':_0x1a9bae['id']},'raw':!![]})['then'](function(_0x2c1784){var _0x3f4b9=_['map'](_0x2c1784,function(_0x2c3169){return qs[_0xc1e8('0x55')](_0x2c3169,['id',_0xc1e8('0x56'),'updatedAt',_0xc1e8('0x5a')]);});_0x37fe61(_0x3f4b9);})['catch'](function(_0x36dbe1){_0x19a215(_0x36dbe1);});})[_0xc1e8('0x2e')](function(_0x29d256){var _0x237e87=qs['omit'](_0x1a9bae,['id','createdAt',_0xc1e8('0x5b')]);_0x237e87[_0xc1e8('0x5c')]=_0xe0e993['id'];if(_0x29d256)_0x237e87[_0xc1e8('0x5d')]=_0x29d256;return _0x237e87;})[_0xc1e8('0x2e')](function(_0x325b98){return db[_0xc1e8('0x5e')][_0xc1e8('0x4e')](_0x325b98,{'include':[{'model':db['UserProfileResource'],'as':_0xc1e8('0x5d')}],'raw':!![],'transaction':_0x371343});});})[_0xc1e8('0x2e')](function(){return _0xe0e993;});}});});});}})[_0xc1e8('0x2e')](respondWithResult(_0x1b1a94,0xc9))[_0xc1e8('0x4b')](handleError(_0x1b1a94,null));};exports[_0xc1e8('0x2d')]=function(_0xe84750,_0x2f1eef){if(_0xe84750['body']['id']){delete _0xe84750[_0xc1e8('0x4f')]['id'];}return db['UserProfile'][_0xc1e8('0x53')]({'where':{'id':_0xe84750['params']['id']}})[_0xc1e8('0x2e')](handleEntityNotFound(_0x2f1eef,null))[_0xc1e8('0x2e')](saveUpdates(_0xe84750['body'],null))[_0xc1e8('0x2e')](respondWithResult(_0x2f1eef,null))[_0xc1e8('0x4b')](handleError(_0x2f1eef,null));};exports[_0xc1e8('0x2f')]=function(_0x26fabc,_0x2b6e92){return db['UserProfile'][_0xc1e8('0x53')]({'where':{'id':_0x26fabc[_0xc1e8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2b6e92,null))[_0xc1e8('0x2e')](removeEntity(_0x2b6e92,null))[_0xc1e8('0x4b')](handleError(_0x2b6e92,null));};exports[_0xc1e8('0x5f')]=function(_0x252d46,_0x48fa35){return db[_0xc1e8('0x33')]['describe']()[_0xc1e8('0x2e')](respondWithResult(_0x48fa35,null))[_0xc1e8('0x4b')](handleError(_0x48fa35,null));};exports['addSections']=function(_0x26be17,_0x5c6acb){var _0x24744f=_0x26be17['body'];return db[_0xc1e8('0x33')][_0xc1e8('0x53')]({'where':{'id':_0x26be17[_0xc1e8('0x4d')]['id']}})[_0xc1e8('0x2e')](handleEntityNotFound(_0x5c6acb,null))[_0xc1e8('0x2e')](function(_0x3d9804){if(_0x3d9804){return db[_0xc1e8('0x57')][_0xc1e8('0x60')](function(_0xf7c017){return db[_0xc1e8('0x5e')][_0xc1e8('0x2f')]({'where':{'userProfileId':_0x26be17[_0xc1e8('0x4d')]['id'],'sectionId':_['map'](_0x24744f,function(_0x490108){return _0x490108[_0xc1e8('0x5a')];})},'transaction':_0xf7c017})['then'](function(){var _0x5f28ff=_['map'](_0x24744f,function(_0x362ac2){_0x362ac2[_0xc1e8('0x5c')]=_0x26be17[_0xc1e8('0x4d')]['id'];return _0x362ac2;});var _0x3b3e83=[];return BPromise[_0xc1e8('0x61')](_0x5f28ff,function(_0x90facd){return db[_0xc1e8('0x5e')][_0xc1e8('0x4e')](_0x90facd,{'include':[{'model':db[_0xc1e8('0x59')],'as':'Resources'}],'raw':!![],'transaction':_0xf7c017})['then'](function(_0x2ee18e){_0x3b3e83['push'](_0x2ee18e[_0xc1e8('0x54')]({'plain':!![]}));});})[_0xc1e8('0x2e')](function(){return _0x3b3e83;});});});}})[_0xc1e8('0x2e')](function(_0x271406){return _0x271406;})['then'](respondWithResult(_0x5c6acb,null))[_0xc1e8('0x4b')](handleError(_0x5c6acb,null));};exports[_0xc1e8('0x62')]=function(_0x2b18f7,_0x3fc1ca){var _0x236db8;return db['UserProfile'][_0xc1e8('0x53')]({'where':{'id':_0x2b18f7['params']['id']},'attributes':['id',_0xc1e8('0x30')]})[_0xc1e8('0x2e')](handleEntityNotFound(_0x3fc1ca,null))[_0xc1e8('0x2e')](function(_0x46aecd){if(_0x46aecd){_0x236db8=_0x46aecd;return db[_0xc1e8('0x5e')][_0xc1e8('0x2f')]({'where':{'userProfileId':_0x2b18f7['params']['id'],'sectionId':_0x2b18f7[_0xc1e8('0x39')][_0xc1e8('0x63')]}});}})['then'](function(){return _0x236db8;})[_0xc1e8('0x2e')](respondWithStatusCode(_0x3fc1ca,null))[_0xc1e8('0x4b')](handleError(_0x3fc1ca,null));};exports[_0xc1e8('0x64')]=function(_0x142b44,_0x18a89d){var _0x285316=[];var _0x5794ee=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x142b44[_0xc1e8('0x4d')]['id']},'raw':!![]})[_0xc1e8('0x2e')](function(_0x534fef){_0x285316=_[_0xc1e8('0x44')](_0x534fef,function(_0x506f36){return _0x506f36[_0xc1e8('0x65')]===0x1||_['includes']([0x3eb,0x709],_0x506f36[_0xc1e8('0x5a')]);});if(!_[_0xc1e8('0x66')](_0x285316)){return _['map'](_0x285316,function(_0x21241f){return _0x21241f[_0xc1e8('0x5a')];});}else{return;}})[_0xc1e8('0x2e')](function(_0x29f812){if(_0x29f812)_0x5794ee=_0x29f812;if(_['includes'](_0x5794ee,0x64)){var _0x1597dc=_[_0xc1e8('0x53')](_0x285316,{'sectionId':0x64});return hasDefaultDashboard(_0x1597dc)[_0xc1e8('0x2e')](function(_0x1054f5){return _[_0xc1e8('0x32')](_0x285316,function(_0xc203c8){if(_0xc203c8[_0xc1e8('0x5a')]===0x64){_0xc203c8[_0xc1e8('0x67')]=_0x1054f5;}return _0xc203c8;});});}else{return;}})[_0xc1e8('0x2e')](function(_0x1d93d){if(_0x1d93d)_0x285316=_0x1d93d;if(_[_0xc1e8('0x68')](_0x5794ee,0x3eb)){var _0x4c06d=_[_0xc1e8('0x53')](_0x285316,{'sectionId':0x3eb});return getCustomDashboards(_0x4c06d)[_0xc1e8('0x2e')](function(_0x149a35){return _[_0xc1e8('0x32')](_0x285316,function(_0xf266ea){if(_0x4c06d[_0xc1e8('0x65')]){if(_0xf266ea[_0xc1e8('0x5a')]===0x3eb){_0xf266ea[_0xc1e8('0x67')]=_0x149a35;}}else{if(_0xf266ea[_0xc1e8('0x5a')]===0x64){_0xf266ea[_0xc1e8('0x67')]=_0x149a35;}}return _0xf266ea;});});}else{return;}})[_0xc1e8('0x2e')](function(_0x4e9adc){if(_0x4e9adc)_0x285316=_0x4e9adc;if(_[_0xc1e8('0x68')](_0x5794ee,0x709)){var _0x1ff17b=_[_0xc1e8('0x53')](_0x285316,{'sectionId':0x709});return getPlugins(_0x1ff17b)['then'](function(_0x50fcda){if(_0x1ff17b[_0xc1e8('0x65')]){return _[_0xc1e8('0x32')](_0x285316,function(_0xc51033){if(_0xc51033[_0xc1e8('0x5a')]===0x709){_0xc51033[_0xc1e8('0x67')]=_0x50fcda;}return _0xc51033;});}else{var _0x41be9c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x50fcda};var _0x6f9023=_['map'](_0x285316);_0x6f9023['push'](_0x41be9c);return _0x6f9023;}});}else{return;}})[_0xc1e8('0x2e')](function(_0x1f94bf){if(_0x1f94bf)_0x285316=_0x1f94bf;return _[_0xc1e8('0x44')](_0x285316,[_0xc1e8('0x65'),0x1]);})['then'](respondWithResult(_0x18a89d,null))[_0xc1e8('0x4b')](handleError(_0x18a89d,null));};function hasDefaultDashboard(_0x241917){var _0x331def=[0x65];return new BPromise(function(_0x16a5ad,_0x2a627e){try{if(_0x241917[_0xc1e8('0x58')]){_0x16a5ad(_0x331def);}else{return db[_0xc1e8('0x59')][_0xc1e8('0x69')]({'where':{'sectionId':_0x241917['id']},'raw':!![]})[_0xc1e8('0x2e')](function(_0x2a727d){_0x2a727d?_0x16a5ad(_0x331def):_0x16a5ad();});}}catch(_0x3d3dc6){_0x2a627e(_0x3d3dc6);}});}function getCustomDashboards(_0x239f5b){var _0x4243a9=[];return new BPromise(function(_0x161864,_0x4c3474){try{if(_0x239f5b['autoAssociation']){return db[_0xc1e8('0x6a')][_0xc1e8('0x49')]({'raw':!![]})[_0xc1e8('0x2e')](function(_0x342e11){_0x342e11[_0xc1e8('0x6b')](function(_0x58eeb7){_0x4243a9[_0xc1e8('0x6c')](_0x58eeb7['id']+0x1869f);});_0x161864(_0x4243a9);});}else{return db[_0xc1e8('0x59')][_0xc1e8('0x49')]({'where':{'sectionId':_0x239f5b['id']},'raw':!![]})['then'](function(_0x481c4d){_0x481c4d[_0xc1e8('0x6b')](function(_0x38599d){_0x4243a9[_0xc1e8('0x6c')](_0x38599d[_0xc1e8('0x6d')]+0x1869f);});_0x161864(_0x4243a9);});}}catch(_0x14ad2a){_0x4c3474(_0x14ad2a);}});}function getPlugins(_0x320241){var _0x33e33=[];return new BPromise(function(_0x5e470b,_0x2e619d){try{if(_0x320241['autoAssociation']){return db['Plugin'][_0xc1e8('0x49')]({'raw':!![]})['then'](function(_0x49da63){_0x49da63['forEach'](function(_0x23927c){_0x33e33[_0xc1e8('0x6c')](_0x23927c['id']+0x15b38);});_0x5e470b(_0x33e33);});}else{return db[_0xc1e8('0x59')]['findAll']({'where':{'sectionId':_0x320241['id']},'raw':!![]})['then'](function(_0x317fb2){_0x317fb2[_0xc1e8('0x6b')](function(_0x3783c7){_0x33e33[_0xc1e8('0x6c')](_0x3783c7[_0xc1e8('0x6d')]+0x15b38);});_0x5e470b(_0x33e33);});}}catch(_0x3f61ee){_0x2e619d(_0x3f61ee);}});}exports['addResources']=function(_0x45075f,_0x367a9d){return db[_0xc1e8('0x33')][_0xc1e8('0x53')]({'where':{'id':_0x45075f[_0xc1e8('0x4d')]['id']}})[_0xc1e8('0x2e')](handleEntityNotFound(_0x367a9d,null))['then'](function(_0x126066){if(_0x126066){return db[_0xc1e8('0x57')]['transaction'](function(_0x726044){return db[_0xc1e8('0x5e')][_0xc1e8('0x49')]({'where':{'userProfileId':_0x45075f[_0xc1e8('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0xc1e8('0x2e')](function(_0x5a1e94){if(_0x5a1e94){return db['UserProfileSection'][_0xc1e8('0x2f')]({'where':{'userProfileId':_0x45075f[_0xc1e8('0x4d')]['id'],'id':_['map'](_0x5a1e94,function(_0x5978f1){return _0x5978f1['id'];})},'transaction':_0x726044});}})['then'](function(_0x2e7c53){var _0x4dead4=_[_0xc1e8('0x32')](_0x45075f[_0xc1e8('0x4f')],function(_0x1f40ac){_0x1f40ac['userProfileId']=_0x45075f[_0xc1e8('0x4d')]['id'];return _0x1f40ac;});return db[_0xc1e8('0x5e')]['bulkCreate'](_0x4dead4,{'raw':!![],'transaction':_0x726044});})[_0xc1e8('0x2e')](function(_0x1c815a){var _0x47a6e0=_[_0xc1e8('0x44')](_[_0xc1e8('0x32')](_0x1c815a,function(_0x1ed503){return _0x1ed503[_0xc1e8('0x54')]({'plain':!![]});}),{'includeAll':![]});if(_0x47a6e0){return db[_0xc1e8('0x5e')]['findAll']({'where':{'userProfileId':_0x45075f[_0xc1e8('0x4d')]['id'],'sectionId':_[_0xc1e8('0x32')](_0x47a6e0,function(_0x1c5c36){return _0x1c5c36[_0xc1e8('0x5a')];})},'attributes':['id',_0xc1e8('0x5a')],'raw':!![]})['then'](function(_0x4d79f7){var _0x490879=_[_0xc1e8('0x32')](_0x45075f[_0xc1e8('0x4f')],function(_0x563e5b){_0x563e5b['userProfileId']=_0x45075f['params']['id'];return _0x563e5b;});return db['UserProfileResource']['bulkCreate'](_0x490879,{'raw':!![],'transaction':_0x726044});});}})[_0xc1e8('0x4b')](handleError(_0x367a9d,null));});}})[_0xc1e8('0x2e')](function(_0x5a0f3e){var _0x993ee6=_[_0xc1e8('0x32')](_0x5a0f3e,function(_0x587a9b){return _0x587a9b[_0xc1e8('0x54')]({'plain':!![]});});})['then'](respondWithResult(_0x367a9d,null))[_0xc1e8('0x4b')](handleError(_0x367a9d,null));};exports[_0xc1e8('0x6e')]=function(_0xcebd9e,_0x261e2e,_0x217b4e){return db[_0xc1e8('0x33')][_0xc1e8('0x53')]({'where':{'id':_0xcebd9e['params']['id']}})[_0xc1e8('0x2e')](handleEntityNotFound(_0x261e2e,null))[_0xc1e8('0x2e')](function(_0x42331f){if(_0x42331f){return _0x42331f[_0xc1e8('0x6e')](_0xcebd9e[_0xc1e8('0x39')][_0xc1e8('0x63')]);}})[_0xc1e8('0x2e')](respondWithStatusCode(_0x261e2e,null))[_0xc1e8('0x4b')](handleError(_0x261e2e,null));};exports['getResources']=function(_0x2f8bd9,_0xffc08c){var _0x87dbf0={};if(!_0x2f8bd9[_0xc1e8('0x39')][_0xc1e8('0x6f')])throw new Error(_0xc1e8('0x70'));if(!_0x2f8bd9[_0xc1e8('0x39')][_0xc1e8('0x3f')](_0xc1e8('0x40'))){_0x87dbf0['limit']=qs[_0xc1e8('0x26')](_0x2f8bd9[_0xc1e8('0x39')]['limit']);_0x87dbf0[_0xc1e8('0x24')]=qs['offset'](_0x2f8bd9['query'][_0xc1e8('0x24')]);}return db[_0xc1e8('0x33')][_0xc1e8('0x53')]({'where':{'id':_0x2f8bd9[_0xc1e8('0x4d')]['id']}})[_0xc1e8('0x2e')](function(_0x36987d){if(!_0x36987d)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x2f8bd9[_0xc1e8('0x4d')]['id']);return db[_0xc1e8('0x33')][_0xc1e8('0x71')](_0x2f8bd9);})[_0xc1e8('0x2e')](respondWithFilteredResult(_0xffc08c,_0x87dbf0))[_0xc1e8('0x4b')](handleError(_0xffc08c,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index bcbba83..e1c170e 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 _0x2ef3=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','UserProfile'];(function(_0x709665,_0x2596cb){var _0x31ef83=function(_0xc0bcd9){while(--_0xc0bcd9){_0x709665['push'](_0x709665['shift']());}};_0x31ef83(++_0x2596cb);}(_0x2ef3,0xba));var _0x32ef=function(_0x2b60de,_0x58b53c){_0x2b60de=_0x2b60de-0x0;var _0xe7416d=_0x2ef3[_0x2b60de];return _0xe7416d;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var UserProfile=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x32ef('0x3')](0x0);var events={'afterCreate':_0x32ef('0x4'),'afterUpdate':_0x32ef('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38f865){return function(_0x38b7f3,_0x524ab6,_0x402857){UserProfileEvents[_0x32ef('0x6')](_0x38f865+':'+_0x38b7f3['id'],_0x38b7f3);UserProfileEvents['emit'](_0x38f865,_0x38b7f3);_0x402857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x32ef('0x7')](e,emitEvent(event));}}module[_0x32ef('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xe3da=['../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x151e7e,_0x86e05){var _0x5001cf=function(_0x5f2178){while(--_0x5f2178){_0x151e7e['push'](_0x151e7e['shift']());}};_0x5001cf(++_0x86e05);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xae3d('0x0'));var UserProfile=require(_0xae3d('0x1'))['db'][_0xae3d('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xae3d('0x3')](0x0);var events={'afterCreate':_0xae3d('0x4'),'afterUpdate':_0xae3d('0x5'),'afterDestroy':_0xae3d('0x6')};function emitEvent(_0x17952f){return function(_0xb2dfd3,_0x22bacf,_0x1b9397){UserProfileEvents[_0xae3d('0x7')](_0x17952f+':'+_0xb2dfd3['id'],_0xb2dfd3);UserProfileEvents[_0xae3d('0x7')](_0x17952f,_0xb2dfd3);_0x1b9397(null);};}for(var e in events){if(events[_0xae3d('0x8')](e)){var event=events[e];UserProfile[_0xae3d('0x9')](e,emitEvent(event));}}module[_0xae3d('0xa')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index d020074..707e350 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 _0xaad0=['SquareProject','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','contacts','parentSections','Lists','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','agent','telephone','VoiceQueue','type','inbound','QueueCampaigns','queue','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappAccount','teams','voicequeues','queuecampaigns','VoiceQueues','agents','telephones','Telephones','zendeskaccounts','ZendeskAccount','freshdeskaccounts','sugarcrmaccounts','DeskAccount','zohoaccounts','vtigeraccounts','CannedAnswer','dispositions','customdashboards','Dashboard','pauses','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','all','ignore','union','autoAssociation','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','filters','merge','key','VIRTUAL','AnalyticExtractedReport','foreignKey','forEach','options','includeAll','include','DefaultReports','custom','count','ids','customSorting','order','extraQueryConditions','CmContact','Tags','color','tag','ThroughTags','rows','true','chat','dataValues','sms','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','filter','field','value','then','associatedResources','map','model','findAll','name','catch','resolve','resourceId','toLowerCase','childModel'];(function(_0x3054af,_0x125a01){var _0x5a5483=function(_0x545a39){while(--_0x545a39){_0x3054af['push'](_0x3054af['shift']());}};_0x5a5483(++_0x125a01);}(_0xaad0,0x15a));var _0x0aad=function(_0x147ab3,_0x487355){_0x147ab3=_0x147ab3-0x0;var _0x510108=_0xaad0[_0x147ab3];return _0x510108;};'use strict';var _=require(_0x0aad('0x0'));var attributes=require(_0x0aad('0x1'));var qs=require(_0x0aad('0x2'));var squel=require('squel');module[_0x0aad('0x3')]=function(_0x43fb98){var _0x282fb1=_0x43fb98['models'];function _0x11a89f(_0x1c2d3a,_0x2589e9){return new Promise(function(_0x18c8fd,_0x88ccf7){if(!_0x2589e9)return _0x18c8fd(null);var _0x111aba=_0x2589e9[_0x0aad('0x4')]?{[_0x2589e9[_0x0aad('0x4')][_0x0aad('0x5')]]:_0x2589e9[_0x0aad('0x4')][_0x0aad('0x6')]}:undefined;return _0x282fb1[_0x1c2d3a]['findAll']({'where':_0x111aba,'raw':!![]})[_0x0aad('0x7')](function(_0x1ac534){_0x2589e9[_0x0aad('0x8')]=_[_0x0aad('0x9')](_0x1ac534,'id');_0x18c8fd(_0x2589e9);})['catch'](function(_0x209940){_0x88ccf7(_0x209940);});});}function _0x3951c4(_0xdc7211,_0x20247c){return new Promise(function(_0xedf1fe,_0x5dc1e7){var _0x32dc87=_0xdc7211[_0x0aad('0x4')]?{[_0xdc7211[_0x0aad('0x4')]['field']]:_0xdc7211[_0x0aad('0x4')][_0x0aad('0x6')]}:undefined;return _0x282fb1[_0xdc7211[_0x0aad('0xa')]][_0x0aad('0xb')]({'where':_0x32dc87,'raw':!![]})[_0x0aad('0x7')](function(_0x16948d){_0x20247c['associatedResources']=_[_0x0aad('0x9')](_0x16948d,function(_0x566c7e){return _0x566c7e[_0x0aad('0xc')];});_0xedf1fe(_0x20247c);})[_0x0aad('0xd')](function(_0x6e6314){_0x5dc1e7(_0x6e6314);});});}function _0x43e7c1(_0x45eafc,_0x4bafe3,_0x1be170){if(!_0x4bafe3)return Promise[_0x0aad('0xe')](null);return new Promise(function(_0x2c771b,_0x372e35){return _0x282fb1['UserProfileResource'][_0x0aad('0xb')]({'where':{'sectionId':_0x4bafe3['id']},'raw':!![]})['then'](function(_0x35ee3c){if(_0x45eafc[_0x0aad('0x5')]&&_0x45eafc[_0x0aad('0x5')]!=='id'){_0x4bafe3[_0x0aad('0x8')]=_[_0x0aad('0x9')](_0x35ee3c,function(_0x11c655){return _0x11c655[_0x45eafc[_0x0aad('0x5')]];});}else{if(_0x1be170==='AnalyticExtractedReport'){_0x4bafe3[_0x0aad('0x8')]=_[_0x0aad('0x9')](_0x35ee3c,function(_0x79cc9){return{'id':_0x79cc9[_0x0aad('0xf')],'type':_0x79cc9['type']};});}else{_0x4bafe3[_0x0aad('0x8')]=_[_0x0aad('0x9')](_0x35ee3c,function(_0x375334){return _0x375334[_0x0aad('0xf')];});}}_0x2c771b(_0x4bafe3);})[_0x0aad('0xd')](function(_0x5d0786){_0x372e35(_0x5d0786);});});}function _0x5658f6(_0x5a87d6,_0x3f602c){var _0xb60ee7={'parentSections':[]};switch(_0x5a87d6[_0x0aad('0x10')]()){case'squareprojects':_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x12');break;case'odbc':_0xb60ee7['childModel']='SquareOdbc';break;case _0x0aad('0x13'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x14');_0xb60ee7['parentSections']=[{'name':_0x0aad('0x15'),'field':_0x0aad('0xc'),'foreignKey':_0x0aad('0x16')}];break;case'projects':_0xb60ee7['childModel']=_0x0aad('0x17');break;case _0x0aad('0x18'):_0xb60ee7[_0x0aad('0x11')]='CmContact';_0xb60ee7[_0x0aad('0x19')]=[{'name':_0x0aad('0x1a'),'field':'id','foreignKey':'ListId'}];break;case _0x0aad('0x1b'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x1c');break;case _0x0aad('0x1d'):_0xb60ee7[_0x0aad('0x11')]='CmCompany';break;case _0x0aad('0x1e'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x1f');break;case _0x0aad('0x20'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x21');break;case _0x0aad('0x22'):_0xb60ee7['childModel']=_0x0aad('0x23');break;case _0x0aad('0x24'):_0xb60ee7['childModel']=_0x0aad('0x25');break;case _0x0aad('0x26'):_0xb60ee7['childModel']=_0x0aad('0x27');break;case'inboundroutes':case _0x0aad('0x28'):case'outboundroutes':_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x29');break;case'contexts':_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x2a');break;case _0x0aad('0x2b'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x2c');break;case _0x0aad('0x2d'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x2e');_0xb60ee7[_0x0aad('0x19')]=[{'name':_0x0aad('0x2f'),'field':'name','foreignKey':'membername','model':_0x0aad('0x30'),'filter':{'field':_0x0aad('0x31'),'value':[_0x0aad('0x32')]}},{'name':'Telephones','field':'name','foreignKey':'membername','model':_0x0aad('0x30'),'filter':{'field':_0x0aad('0x31'),'value':[_0x0aad('0x33')]}},{'name':'VoiceQueues','field':_0x0aad('0xc'),'foreignKey':'queue','model':_0x0aad('0x34'),'filter':{'field':_0x0aad('0x35'),'value':[_0x0aad('0x36')]}},{'name':_0x0aad('0x37'),'field':_0x0aad('0xc'),'foreignKey':_0x0aad('0x38'),'model':_0x0aad('0x34'),'filter':{'field':_0x0aad('0x35'),'value':['outbound']}}];break;case _0x0aad('0x39'):_0xb60ee7['childModel']=_0x0aad('0x3a');break;case _0x0aad('0x3b'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x3c');break;case _0x0aad('0x3d'):_0xb60ee7[_0x0aad('0x11')]='VoicePrefix';break;case'ivrcampaigns':_0xb60ee7['childModel']=_0x0aad('0x3e');break;case _0x0aad('0x3f'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x40');break;case _0x0aad('0x41'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x42');break;case _0x0aad('0x43'):_0xb60ee7['childModel']=_0x0aad('0x44');break;case _0x0aad('0x45'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x46');break;case _0x0aad('0x47'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x48');break;case _0x0aad('0x49'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x4a');break;case _0x0aad('0x4b'):_0xb60ee7[_0x0aad('0x11')]='SmsAccount';break;case _0x0aad('0x4c'):_0xb60ee7[_0x0aad('0x11')]='WhatsappQueue';break;case'whatsappaccounts':_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x4d');break;case _0x0aad('0x4e'):_0xb60ee7['childModel']='Team';break;case _0x0aad('0x4f'):case _0x0aad('0x50'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x34');if(_0x3f602c){_0xb60ee7['parentSections']=[{'name':_0x0aad('0x51')},{'name':_0x0aad('0x37')}];}break;case'users':case _0x0aad('0x52'):case _0x0aad('0x53'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x30');if(_0x3f602c){_0xb60ee7['parentSections']=[{'name':'Users','filter':{'field':_0x0aad('0x31'),'value':['admin','user']},'ignore':!![]},{'name':_0x0aad('0x2f')},{'name':_0x0aad('0x54')}];}break;case _0x0aad('0x55'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x56');break;case'salesforceaccounts':_0xb60ee7[_0x0aad('0x11')]='SalesforceAccount';break;case _0x0aad('0x57'):_0xb60ee7[_0x0aad('0x11')]='FreshdeskAccount';break;case _0x0aad('0x58'):_0xb60ee7[_0x0aad('0x11')]='SugarcrmAccount';break;case'deskaccounts':_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x59');break;case _0x0aad('0x5a'):_0xb60ee7[_0x0aad('0x11')]='ZohoAccount';break;case _0x0aad('0x5b'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x30');break;case'cannedanswers':_0xb60ee7['childModel']=_0x0aad('0x5c');break;case _0x0aad('0x5d'):_0xb60ee7[_0x0aad('0x11')]='Disposition';break;case _0x0aad('0x5e'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x5f');break;case'intervals':_0xb60ee7['childModel']='Interval';break;case _0x0aad('0x60'):_0xb60ee7[_0x0aad('0x11')]='Pause';break;case _0x0aad('0x61'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x62');break;case'sounds':_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x63');break;case _0x0aad('0x64'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x65');break;case _0x0aad('0x66'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x67');break;case _0x0aad('0x68'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x69');break;case _0x0aad('0x6a'):_0xb60ee7['childModel']=_0x0aad('0x6b');break;case _0x0aad('0x6c'):_0xb60ee7['childModel']=_0x0aad('0x6d');break;case _0x0aad('0x6e'):_0xb60ee7[_0x0aad('0x11')]='Plugin';break;case _0x0aad('0x6f'):_0xb60ee7['childModel']='AnalyticExtractedReport';_0xb60ee7['parentSections']=[{'name':_0x0aad('0x70'),'field':'id','foreignKey':_0x0aad('0x71')}];break;case _0x0aad('0x72'):_0xb60ee7[_0x0aad('0x11')]=_0x0aad('0x73');break;}return _0xb60ee7;}function _0x4ff1c4(_0x3b9849,_0x265ce8){var _0x11363d=_0x3b9849['charAt'](0x0)[_0x0aad('0x74')]()+_0x3b9849['slice'](0x1);var _0x485ae1={'type':_0x282fb1[_0x0aad('0x75')][_0x0aad('0x76')][_0x0aad('0x77')],'raw':!![]};return new Promise(function(_0x3aebb8,_0x9cc582){var _0x283271=squel[_0x0aad('0x78')]()['field'](_0x0aad('0x79')+_0x11363d+_0x0aad('0x7a'),'id')[_0x0aad('0x5')]('ui.createdAt')['from'](_0x0aad('0x7b')+_0x3b9849+_0x0aad('0x7c'),'ui')[_0x0aad('0x7d')](_0x0aad('0x7e'),_0x265ce8['id']);return _0x282fb1[_0x0aad('0x7f')][_0x0aad('0x80')](_0x283271['toString'](),_0x485ae1)['then'](function(_0x2eb4bd){_0x265ce8[_0x11363d+_0x0aad('0x81')]=_0x2eb4bd;_0x3aebb8(_0x2eb4bd);})['catch'](function(_0x12c781){_0x9cc582(_0x12c781);});});}return _0x43fb98[_0x0aad('0x82')](_0x0aad('0x83'),attributes,{'tableName':_0x0aad('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4bd9b3){var _0x597cc1={'raw':_0x4bd9b3[_0x0aad('0x80')]['raw'],'where':{}};var _0x31221e={};var _0x23d38c={'count':0x0,'rows':[]};var _0x1af856=_0x4bd9b3['query'][_0x0aad('0x85')];var _0x46f89a=_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0x86')]||![];var _0x2c8d8a=_0x5658f6(_0x1af856,_0x46f89a);if(!_0x2c8d8a['childModel'])throw new Error(_0x0aad('0x87')+_0x1af856+'\x27');var _0x521fe9=[{'name':_0x1af856}];if(!_[_0x0aad('0x88')](_0x2c8d8a['parentSections']))_0x521fe9=_0x2c8d8a[_0x0aad('0x19')];var _0xb3d3cc=[];for(var _0x4c5ed4=0x0;_0x4c5ed4<_0x521fe9[_0x0aad('0x89')];_0x4c5ed4++){_0xb3d3cc[_0x0aad('0x8a')](_0x282fb1['UserProfileSection'][_0x0aad('0x8b')]({'where':{'userProfileId':_0x4bd9b3['params']['id'],'name':_0x521fe9[_0x4c5ed4][_0x0aad('0xc')]},'raw':!![]}));}return Promise[_0x0aad('0x8c')](_0xb3d3cc)[_0x0aad('0x7')](function(_0x34fde4){var _0x164b88=_[_0x0aad('0x4')](_0x34fde4,function(_0x4b3ec1){return _0x4b3ec1?_0x4b3ec1:undefined;});var _0x53901b=_[_0x0aad('0x4')](_0x521fe9,[_0x0aad('0x8d'),!![]]);var _0x3daa26=_[_0x0aad('0x88')](_0x164b88)&&_['isEmpty'](_0x53901b)?null:_[_0x0aad('0x8e')](_0x53901b,_0x164b88);if(!_0x3daa26)return null;var _0x3cf213=[];for(var _0x133c56=0x0;_0x133c56<_0x3daa26['length'];_0x133c56++){var _0x4f81dc=_['find'](_0x521fe9,function(_0x3f3af7){return _0x3daa26[_0x133c56]?_0x3f3af7[_0x0aad('0xc')]===_0x3daa26[_0x133c56][_0x0aad('0xc')]:null;});if(_0x4f81dc){if(_0x3daa26[_0x133c56]['ignore']){_0x3cf213[_0x0aad('0x8a')](_0x11a89f(_0x2c8d8a[_0x0aad('0x11')],_0x3daa26[_0x133c56]));}else{if(!_0x3daa26[_0x133c56][_0x0aad('0x8f')]){_0x3cf213['push'](_0x43e7c1(_0x4f81dc,_0x3daa26[_0x133c56],_0x2c8d8a[_0x0aad('0x11')]));}else{if(_0x4f81dc[_0x0aad('0xa')]){_0x3cf213[_0x0aad('0x8a')](_0x3951c4(_0x4f81dc,_0x3daa26[_0x133c56]));}}}}}return Promise[_0x0aad('0x8c')](_0x3cf213);})[_0x0aad('0x7')](function(_0x243d9f){var _0x4ffa20=_0x243d9f;var _0x761dfd=null;if(_0x4ffa20){_0x761dfd=_0x4ffa20['length']===0x1?_0x4ffa20[0x0]:null;}if(!_0x761dfd&&!_0x4ffa20)return _0x23d38c;var _0x1deab8=_0x282fb1[_0x2c8d8a[_0x0aad('0x11')]]['rawAttributes'];_0x31221e['model']=_[_0x0aad('0x90')](_0x1deab8);_0x31221e[_0x0aad('0x80')]=_[_0x0aad('0x90')](_0x4bd9b3[_0x0aad('0x80')]);_0x31221e['filters']=_[_0x0aad('0x91')](_0x31221e['model'],_0x31221e['query']);_0x597cc1[_0x0aad('0x92')]=_[_0x0aad('0x91')](_0x31221e[_0x0aad('0xa')],qs[_0x0aad('0x93')](_0x4bd9b3['query'][_0x0aad('0x93')]));_0x597cc1[_0x0aad('0x92')]=_0x597cc1['attributes']['length']?_0x597cc1[_0x0aad('0x92')]:_0x31221e[_0x0aad('0xa')];if(!_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0x94')](_0x0aad('0x95'))){_0x597cc1[_0x0aad('0x96')]=qs[_0x0aad('0x96')](_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0x96')]);_0x597cc1['offset']=qs['offset'](_0x4bd9b3['query']['offset']);}_0x597cc1['order']=qs[_0x0aad('0x97')](_0x4bd9b3['query'][_0x0aad('0x97')]);_0x597cc1[_0x0aad('0x7d')]=qs['filters'](_[_0x0aad('0x98')](_0x4bd9b3[_0x0aad('0x80')],_0x31221e[_0x0aad('0x99')]));if(_0x4bd9b3[_0x0aad('0x80')]['filter']){_0x597cc1[_0x0aad('0x7d')]=_[_0x0aad('0x9a')](_0x597cc1[_0x0aad('0x7d')],{'$or':_[_0x0aad('0x9')](_0x1deab8,function(_0x575254){if(_0x575254[_0x0aad('0x35')][_0x0aad('0x9b')]!==_0x0aad('0x9c')){var _0x3ea5b6={};_0x3ea5b6[_0x575254[_0x0aad('0x5')]]={'$like':'%'+_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0x4')]+'%'};return _0x3ea5b6;}})});}var _0x5142e4=[];var _0x24e2ac=null;var _0x3e994f={};if(_0x761dfd){_0x24e2ac=_[_0x0aad('0x8b')](_0x521fe9,['name',_0x761dfd[_0x0aad('0xc')]]);if(_0x24e2ac[_0x0aad('0x5')]){_0x3e994f={};if(_0x2c8d8a[_0x0aad('0x11')]===_0x0aad('0x9d')){_0x3e994f[_0x24e2ac[_0x0aad('0x9e')]]=_[_0x0aad('0x9')](_0x761dfd[_0x0aad('0x8')],'id');}else{_0x3e994f[_0x24e2ac[_0x0aad('0x9e')]]=_0x761dfd[_0x0aad('0x8')];}_0x5142e4[_0x0aad('0x8a')](_0x3e994f);}else{_0x597cc1['where']['id']=_0x761dfd[_0x0aad('0x8')];}}else{for(var _0x1a5824=0x0;_0x1a5824<_0x4ffa20['length'];_0x1a5824++){_0x24e2ac=_[_0x0aad('0x8b')](_0x521fe9,['name',_0x4ffa20[_0x1a5824][_0x0aad('0xc')]]);if(_0x24e2ac[_0x0aad('0x5')]){_0x3e994f={};_0x3e994f[_0x24e2ac[_0x0aad('0x9e')]]=_0x4ffa20[_0x1a5824][_0x0aad('0x8')];_0x5142e4[_0x0aad('0x8a')](_0x3e994f);}else{if(!_0x597cc1[_0x0aad('0x7d')]['id'])_0x597cc1[_0x0aad('0x7d')]['id']=[];_0x4ffa20[_0x1a5824][_0x0aad('0x8')][_0x0aad('0x9f')](function(_0x3ba4c7){_0x597cc1[_0x0aad('0x7d')]['id']['push'](_0x3ba4c7);});}}}if(!_[_0x0aad('0x88')](_0x5142e4)){_0x597cc1['where']=_[_0x0aad('0x9a')](_0x597cc1[_0x0aad('0x7d')],{'$and':{'$or':_0x5142e4}});}_0x597cc1=_['merge']({},_0x597cc1,_0x4bd9b3[_0x0aad('0xa0')]);if(_0x761dfd&&!_0x761dfd['autoAssociation']&&_0x2c8d8a[_0x0aad('0x11')]===_0x0aad('0x9d')){if(_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0xa1')]){_0x597cc1[_0x0aad('0xa2')]=[{'all':!![]}];}return _0x282fb1[_0x2c8d8a[_0x0aad('0x11')]][_0x0aad('0xb')](_0x597cc1)['then'](function(_0x1781f9){var _0x3d82fe=[];_0x1781f9[_0x0aad('0x9f')](function(_0x376352){var _0x2daa77;switch(_0x376352['reportType']){case'default':_0x2daa77=_[_0x0aad('0x8b')](_0x761dfd['associatedResources'],function(_0x367e80){return _0x367e80['id']===_0x376352[_0x0aad('0x71')]&&_0x367e80['type']===_0x0aad('0xa3');});break;case _0x0aad('0xa4'):_0x2daa77=_['find'](_0x761dfd[_0x0aad('0x8')],function(_0x21659d){return _0x21659d['id']===_0x376352[_0x0aad('0x71')]&&_0x21659d[_0x0aad('0x35')]==='CustomReports';});break;}if(_0x2daa77)_0x3d82fe['push'](_0x376352);});_0x23d38c[_0x0aad('0xa5')]=_0x3d82fe[_0x0aad('0x89')];_0x23d38c['rows']=_0x3d82fe;return _0x23d38c;});}else{if(!_[_0x0aad('0x88')](_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0xa6')])){_0x597cc1[_0x0aad('0x7d')]['id']=_0x597cc1[_0x0aad('0x7d')]['id']?_[_0x0aad('0x91')](_0x597cc1[_0x0aad('0x7d')]['id'],_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0xa6')]):_0x4bd9b3[_0x0aad('0x80')]['ids'];if(_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0xa7')]){_0x597cc1[_0x0aad('0xa8')]=_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0xa7')];}}if(_0x4bd9b3['query'][_0x0aad('0xa9')]){_0x597cc1['where']=_['merge'](_0x597cc1[_0x0aad('0x7d')],{'$and':_0x4bd9b3[_0x0aad('0x80')]['extraQueryConditions']});}return _0x282fb1[_0x2c8d8a['childModel']][_0x0aad('0xa5')]({'where':_0x597cc1[_0x0aad('0x7d')]})[_0x0aad('0x7')](function(_0x21c47f){_0x23d38c[_0x0aad('0xa5')]=_0x21c47f;if(_0x4bd9b3['query'][_0x0aad('0xa1')]){if(_0x2c8d8a[_0x0aad('0x11')]===_0x0aad('0xaa')){_0x597cc1['include']=[{'model':_0x282fb1[_0x0aad('0x65')],'as':_0x0aad('0xab'),'attributes':['id',_0x0aad('0xc'),_0x0aad('0xac')],'required':_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0xad')]?!![]:![]},{'model':_0x282fb1[_0x0aad('0x65')],'as':_0x0aad('0xae'),'attributes':['id','name',_0x0aad('0xac')],'through':_0x4bd9b3[_0x0aad('0x80')]['tag']?{'attributes':[],'where':{'TagId':_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0xad')]||undefined}}:{},'required':_0x4bd9b3[_0x0aad('0x80')][_0x0aad('0xad')]?!![]:![]}];}else{_0x597cc1[_0x0aad('0xa2')]=[{'all':!![]}];}}return _0x282fb1[_0x2c8d8a['childModel']][_0x0aad('0xb')](_0x597cc1);})[_0x0aad('0x7')](function(_0x5db1af){_0x23d38c[_0x0aad('0xaf')]=_0x5db1af;if(_0x1af856==='Agents'&&_0x4bd9b3[_0x0aad('0x80')]['openTabs']===_0x0aad('0xb0')){var _0x24f858=[];for(var _0x57596a=0x0;_0x57596a<_0x23d38c[_0x0aad('0xaf')][_0x0aad('0x89')];_0x57596a++){_0x24f858['push'](_0x4ff1c4(_0x0aad('0xb1'),_0x23d38c[_0x0aad('0xaf')][_0x57596a][_0x0aad('0xb2')]));_0x24f858['push'](_0x4ff1c4(_0x0aad('0xb3'),_0x23d38c[_0x0aad('0xaf')][_0x57596a][_0x0aad('0xb2')]));_0x24f858['push'](_0x4ff1c4('fax',_0x23d38c[_0x0aad('0xaf')][_0x57596a][_0x0aad('0xb2')]));_0x24f858[_0x0aad('0x8a')](_0x4ff1c4(_0x0aad('0xb4'),_0x23d38c[_0x0aad('0xaf')][_0x57596a]['dataValues']));_0x24f858[_0x0aad('0x8a')](_0x4ff1c4('openchannel',_0x23d38c['rows'][_0x57596a]['dataValues']));_0x24f858[_0x0aad('0x8a')](_0x4ff1c4(_0x0aad('0xb5'),_0x23d38c[_0x0aad('0xaf')][_0x57596a][_0x0aad('0xb2')]));}return Promise[_0x0aad('0x8c')](_0x24f858)[_0x0aad('0x7')](function(){return _0x23d38c;});}return _0x23d38c;});}});}}});}; \ No newline at end of file +var _0xac30=['membername','role','agent','Telephones','User','telephone','VoiceQueues','VoiceQueue','type','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','OpenTabs','define','UserProfile','user_profiles','raw','query','section','isEmpty','push','find','params','ignore','union','length','autoAssociation','rawAttributes','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','CmContact','Tags','color','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','all','./userProfile.attributes','squel','exports','models','filter','field','value','then','associatedResources','map','catch','model','findAll','name','resolve','AnalyticExtractedReport','resourceId','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','Lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','voicerecordings','Agents'];(function(_0x293640,_0x47dc53){var _0x433573=function(_0x294910){while(--_0x294910){_0x293640['push'](_0x293640['shift']());}};_0x433573(++_0x47dc53);}(_0xac30,0x162));var _0x0ac3=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xac30[_0x2f1762];return _0x8ab21;};'use strict';var _=require('lodash');var attributes=require(_0x0ac3('0x0'));var qs=require('../../components/parsers/qs');var squel=require(_0x0ac3('0x1'));module[_0x0ac3('0x2')]=function(_0x34a280){var _0x32b745=_0x34a280[_0x0ac3('0x3')];function _0x5793c1(_0x1a5173,_0x33d2f4){return new Promise(function(_0x352336,_0x360724){if(!_0x33d2f4)return _0x352336(null);var _0x18dee4=_0x33d2f4['filter']?{[_0x33d2f4[_0x0ac3('0x4')][_0x0ac3('0x5')]]:_0x33d2f4[_0x0ac3('0x4')][_0x0ac3('0x6')]}:undefined;return _0x32b745[_0x1a5173]['findAll']({'where':_0x18dee4,'raw':!![]})[_0x0ac3('0x7')](function(_0x37042a){_0x33d2f4[_0x0ac3('0x8')]=_[_0x0ac3('0x9')](_0x37042a,'id');_0x352336(_0x33d2f4);})[_0x0ac3('0xa')](function(_0x4f9a2b){_0x360724(_0x4f9a2b);});});}function _0x1ec188(_0x411bed,_0x5d9705){return new Promise(function(_0x4875aa,_0xb35b4e){var _0xaeba43=_0x411bed[_0x0ac3('0x4')]?{[_0x411bed['filter'][_0x0ac3('0x5')]]:_0x411bed[_0x0ac3('0x4')][_0x0ac3('0x6')]}:undefined;return _0x32b745[_0x411bed[_0x0ac3('0xb')]][_0x0ac3('0xc')]({'where':_0xaeba43,'raw':!![]})[_0x0ac3('0x7')](function(_0x31e1a4){_0x5d9705['associatedResources']=_[_0x0ac3('0x9')](_0x31e1a4,function(_0x12514a){return _0x12514a[_0x0ac3('0xd')];});_0x4875aa(_0x5d9705);})['catch'](function(_0x5d0732){_0xb35b4e(_0x5d0732);});});}function _0x248a95(_0x60198c,_0x56a8c8,_0x4ef90d){if(!_0x56a8c8)return Promise[_0x0ac3('0xe')](null);return new Promise(function(_0x2be0ca,_0x242378){return _0x32b745['UserProfileResource'][_0x0ac3('0xc')]({'where':{'sectionId':_0x56a8c8['id']},'raw':!![]})[_0x0ac3('0x7')](function(_0x523113){if(_0x60198c[_0x0ac3('0x5')]&&_0x60198c[_0x0ac3('0x5')]!=='id'){_0x56a8c8[_0x0ac3('0x8')]=_[_0x0ac3('0x9')](_0x523113,function(_0x5e13e9){return _0x5e13e9[_0x60198c[_0x0ac3('0x5')]];});}else{if(_0x4ef90d===_0x0ac3('0xf')){_0x56a8c8[_0x0ac3('0x8')]=_['map'](_0x523113,function(_0x2f0b90){return{'id':_0x2f0b90['resourceId'],'type':_0x2f0b90['type']};});}else{_0x56a8c8[_0x0ac3('0x8')]=_[_0x0ac3('0x9')](_0x523113,function(_0x47f048){return _0x47f048[_0x0ac3('0x10')];});}}_0x2be0ca(_0x56a8c8);})[_0x0ac3('0xa')](function(_0x5d9019){_0x242378(_0x5d9019);});});}function _0x211414(_0x1f8542,_0xdc5b8b){var _0x1aba6d={'parentSections':[]};switch(_0x1f8542['toLowerCase']()){case'squareprojects':_0x1aba6d['childModel']=_0x0ac3('0x11');break;case _0x0ac3('0x12'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x14');break;case _0x0ac3('0x15'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x16');_0x1aba6d[_0x0ac3('0x17')]=[{'name':_0x0ac3('0x18'),'field':_0x0ac3('0xd'),'foreignKey':_0x0ac3('0x19')}];break;case'projects':_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x1a');break;case'contacts':_0x1aba6d[_0x0ac3('0x13')]='CmContact';_0x1aba6d[_0x0ac3('0x17')]=[{'name':_0x0ac3('0x1b'),'field':'id','foreignKey':'ListId'}];break;case'lists':_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x1c');break;case _0x0ac3('0x1d'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x1e');break;case _0x0ac3('0x1f'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x20');break;case'chatqueues':_0x1aba6d['childModel']=_0x0ac3('0x21');break;case'chatwebsites':_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x22');break;case _0x0ac3('0x23'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x24');break;case _0x0ac3('0x25'):_0x1aba6d['childModel']=_0x0ac3('0x26');break;case'inboundroutes':case _0x0ac3('0x27'):case _0x0ac3('0x28'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x29');break;case _0x0ac3('0x2a'):_0x1aba6d[_0x0ac3('0x13')]='VoiceContext';break;case _0x0ac3('0x2b'):_0x1aba6d[_0x0ac3('0x13')]='VoiceMail';break;case _0x0ac3('0x2c'):_0x1aba6d[_0x0ac3('0x13')]='VoiceRecording';_0x1aba6d[_0x0ac3('0x17')]=[{'name':_0x0ac3('0x2d'),'field':'name','foreignKey':_0x0ac3('0x2e'),'model':'User','filter':{'field':_0x0ac3('0x2f'),'value':[_0x0ac3('0x30')]}},{'name':_0x0ac3('0x31'),'field':'name','foreignKey':_0x0ac3('0x2e'),'model':_0x0ac3('0x32'),'filter':{'field':_0x0ac3('0x2f'),'value':[_0x0ac3('0x33')]}},{'name':_0x0ac3('0x34'),'field':_0x0ac3('0xd'),'foreignKey':'queue','model':_0x0ac3('0x35'),'filter':{'field':_0x0ac3('0x36'),'value':[_0x0ac3('0x37')]}},{'name':_0x0ac3('0x38'),'field':_0x0ac3('0xd'),'foreignKey':_0x0ac3('0x39'),'model':_0x0ac3('0x35'),'filter':{'field':'type','value':[_0x0ac3('0x3a')]}}];break;case _0x0ac3('0x3b'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x3c');break;case'chanspies':_0x1aba6d[_0x0ac3('0x13')]='VoiceChanSpy';break;case _0x0ac3('0x3d'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x3e');break;case _0x0ac3('0x3f'):_0x1aba6d['childModel']=_0x0ac3('0x40');break;case _0x0ac3('0x41'):_0x1aba6d['childModel']=_0x0ac3('0x42');break;case'mailaccounts':_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x43');break;case _0x0ac3('0x44'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x45');break;case _0x0ac3('0x46'):_0x1aba6d['childModel']=_0x0ac3('0x47');break;case'openchannelaccounts':_0x1aba6d['childModel']=_0x0ac3('0x48');break;case'smsqueues':_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x49');break;case _0x0ac3('0x4a'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x4b');break;case _0x0ac3('0x4c'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x4d');break;case _0x0ac3('0x4e'):_0x1aba6d[_0x0ac3('0x13')]='WhatsappAccount';break;case _0x0ac3('0x4f'):_0x1aba6d['childModel']=_0x0ac3('0x50');break;case _0x0ac3('0x51'):case _0x0ac3('0x52'):_0x1aba6d[_0x0ac3('0x13')]='VoiceQueue';if(_0xdc5b8b){_0x1aba6d[_0x0ac3('0x17')]=[{'name':'VoiceQueues'},{'name':_0x0ac3('0x38')}];}break;case _0x0ac3('0x53'):case _0x0ac3('0x54'):case _0x0ac3('0x55'):_0x1aba6d['childModel']=_0x0ac3('0x32');if(_0xdc5b8b){_0x1aba6d[_0x0ac3('0x17')]=[{'name':_0x0ac3('0x56'),'filter':{'field':'role','value':[_0x0ac3('0x57'),_0x0ac3('0x58')]},'ignore':!![]},{'name':_0x0ac3('0x2d')},{'name':'Telephones'}];}break;case _0x0ac3('0x59'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x5a');break;case _0x0ac3('0x5b'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x5c');break;case _0x0ac3('0x5d'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x5e');break;case _0x0ac3('0x5f'):_0x1aba6d[_0x0ac3('0x13')]='SugarcrmAccount';break;case _0x0ac3('0x60'):_0x1aba6d['childModel']='DeskAccount';break;case _0x0ac3('0x61'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x62');break;case _0x0ac3('0x63'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x32');break;case _0x0ac3('0x64'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x65');break;case _0x0ac3('0x66'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x67');break;case _0x0ac3('0x68'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x69');break;case _0x0ac3('0x6a'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x6b');break;case _0x0ac3('0x6c'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x6d');break;case'scheduler':_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x6e');break;case'sounds':_0x1aba6d['childModel']=_0x0ac3('0x6f');break;case _0x0ac3('0x70'):_0x1aba6d['childModel']=_0x0ac3('0x71');break;case _0x0ac3('0x72'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x73');break;case _0x0ac3('0x74'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x75');break;case _0x0ac3('0x76'):_0x1aba6d['childModel']=_0x0ac3('0x77');break;case _0x0ac3('0x78'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x79');break;case _0x0ac3('0x7a'):_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x7b');break;case _0x0ac3('0x7c'):_0x1aba6d[_0x0ac3('0x13')]='AnalyticExtractedReport';_0x1aba6d[_0x0ac3('0x17')]=[{'name':_0x0ac3('0x7d'),'field':'id','foreignKey':_0x0ac3('0x7e')}];break;case'metrics':_0x1aba6d[_0x0ac3('0x13')]=_0x0ac3('0x7f');break;}return _0x1aba6d;}function _0x3ff60d(_0x5d4f93,_0x5b67a6){var _0x304e55=_0x5d4f93[_0x0ac3('0x80')](0x0)[_0x0ac3('0x81')]()+_0x5d4f93['slice'](0x1);var _0x26b2a7={'type':_0x32b745[_0x0ac3('0x82')][_0x0ac3('0x83')][_0x0ac3('0x84')],'raw':!![]};return new Promise(function(_0x12d938,_0x1a9b8d){var _0xe5c97f=squel[_0x0ac3('0x85')]()[_0x0ac3('0x5')](_0x0ac3('0x86')+_0x304e55+_0x0ac3('0x87'),'id')[_0x0ac3('0x5')](_0x0ac3('0x88'))[_0x0ac3('0x89')](_0x0ac3('0x8a')+_0x5d4f93+_0x0ac3('0x8b'),'ui')[_0x0ac3('0x8c')](_0x0ac3('0x8d'),_0x5b67a6['id']);return _0x32b745['sequelize']['query'](_0xe5c97f['toString'](),_0x26b2a7)[_0x0ac3('0x7')](function(_0x1b70cc){_0x5b67a6[_0x304e55+_0x0ac3('0x8e')]=_0x1b70cc;_0x12d938(_0x1b70cc);})[_0x0ac3('0xa')](function(_0x22effa){_0x1a9b8d(_0x22effa);});});}return _0x34a280[_0x0ac3('0x8f')](_0x0ac3('0x90'),attributes,{'tableName':_0x0ac3('0x91'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x37aa77){var _0x3d7840={'raw':_0x37aa77['query'][_0x0ac3('0x92')],'where':{}};var _0x4aaa8d={};var _0x48a03e={'count':0x0,'rows':[]};var _0x39bb10=_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0x94')];var _0x3cce2c=_0x37aa77[_0x0ac3('0x93')]['mergeResources']||![];var _0x1fcc8e=_0x211414(_0x39bb10,_0x3cce2c);if(!_0x1fcc8e[_0x0ac3('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x39bb10+'\x27');var _0x11f8db=[{'name':_0x39bb10}];if(!_[_0x0ac3('0x95')](_0x1fcc8e[_0x0ac3('0x17')]))_0x11f8db=_0x1fcc8e[_0x0ac3('0x17')];var _0x2347a2=[];for(var _0x1f942b=0x0;_0x1f942b<_0x11f8db['length'];_0x1f942b++){_0x2347a2[_0x0ac3('0x96')](_0x32b745['UserProfileSection'][_0x0ac3('0x97')]({'where':{'userProfileId':_0x37aa77[_0x0ac3('0x98')]['id'],'name':_0x11f8db[_0x1f942b][_0x0ac3('0xd')]},'raw':!![]}));}return Promise['all'](_0x2347a2)['then'](function(_0x36390f){var _0x10e141=_['filter'](_0x36390f,function(_0x2746fe){return _0x2746fe?_0x2746fe:undefined;});var _0x126dc1=_['filter'](_0x11f8db,[_0x0ac3('0x99'),!![]]);var _0x235175=_[_0x0ac3('0x95')](_0x10e141)&&_[_0x0ac3('0x95')](_0x126dc1)?null:_[_0x0ac3('0x9a')](_0x126dc1,_0x10e141);if(!_0x235175)return null;var _0xa9e456=[];for(var _0xf8a10a=0x0;_0xf8a10a<_0x235175[_0x0ac3('0x9b')];_0xf8a10a++){var _0x1bffc0=_[_0x0ac3('0x97')](_0x11f8db,function(_0xa35c7a){return _0x235175[_0xf8a10a]?_0xa35c7a[_0x0ac3('0xd')]===_0x235175[_0xf8a10a][_0x0ac3('0xd')]:null;});if(_0x1bffc0){if(_0x235175[_0xf8a10a]['ignore']){_0xa9e456[_0x0ac3('0x96')](_0x5793c1(_0x1fcc8e[_0x0ac3('0x13')],_0x235175[_0xf8a10a]));}else{if(!_0x235175[_0xf8a10a][_0x0ac3('0x9c')]){_0xa9e456[_0x0ac3('0x96')](_0x248a95(_0x1bffc0,_0x235175[_0xf8a10a],_0x1fcc8e[_0x0ac3('0x13')]));}else{if(_0x1bffc0[_0x0ac3('0xb')]){_0xa9e456[_0x0ac3('0x96')](_0x1ec188(_0x1bffc0,_0x235175[_0xf8a10a]));}}}}}return Promise['all'](_0xa9e456);})[_0x0ac3('0x7')](function(_0x3ef0af){var _0x2fcc20=_0x3ef0af;var _0x49c5eb=null;if(_0x2fcc20){_0x49c5eb=_0x2fcc20[_0x0ac3('0x9b')]===0x1?_0x2fcc20[0x0]:null;}if(!_0x49c5eb&&!_0x2fcc20)return _0x48a03e;var _0x3327c9=_0x32b745[_0x1fcc8e['childModel']][_0x0ac3('0x9d')];_0x4aaa8d[_0x0ac3('0xb')]=_[_0x0ac3('0x9e')](_0x3327c9);_0x4aaa8d[_0x0ac3('0x93')]=_['keys'](_0x37aa77[_0x0ac3('0x93')]);_0x4aaa8d['filters']=_['intersection'](_0x4aaa8d[_0x0ac3('0xb')],_0x4aaa8d[_0x0ac3('0x93')]);_0x3d7840['attributes']=_[_0x0ac3('0x9f')](_0x4aaa8d[_0x0ac3('0xb')],qs[_0x0ac3('0xa0')](_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xa0')]));_0x3d7840[_0x0ac3('0xa1')]=_0x3d7840[_0x0ac3('0xa1')][_0x0ac3('0x9b')]?_0x3d7840[_0x0ac3('0xa1')]:_0x4aaa8d['model'];if(!_0x37aa77['query'][_0x0ac3('0xa2')](_0x0ac3('0xa3'))){_0x3d7840['limit']=qs['limit'](_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xa4')]);_0x3d7840[_0x0ac3('0xa5')]=qs[_0x0ac3('0xa5')](_0x37aa77['query'][_0x0ac3('0xa5')]);}_0x3d7840[_0x0ac3('0xa6')]=qs[_0x0ac3('0xa7')](_0x37aa77[_0x0ac3('0x93')]['sort']);_0x3d7840['where']=qs[_0x0ac3('0xa8')](_[_0x0ac3('0xa9')](_0x37aa77[_0x0ac3('0x93')],_0x4aaa8d['filters']));if(_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0x4')]){_0x3d7840[_0x0ac3('0x8c')]=_[_0x0ac3('0xaa')](_0x3d7840[_0x0ac3('0x8c')],{'$or':_['map'](_0x3327c9,function(_0x39c722){if(_0x39c722[_0x0ac3('0x36')][_0x0ac3('0xab')]!==_0x0ac3('0xac')){var _0x4701b0={};_0x4701b0[_0x39c722['field']]={'$like':'%'+_0x37aa77['query']['filter']+'%'};return _0x4701b0;}})});}var _0x4069d9=[];var _0x393b89=null;var _0x26298b={};if(_0x49c5eb){_0x393b89=_[_0x0ac3('0x97')](_0x11f8db,[_0x0ac3('0xd'),_0x49c5eb['name']]);if(_0x393b89[_0x0ac3('0x5')]){_0x26298b={};if(_0x1fcc8e[_0x0ac3('0x13')]===_0x0ac3('0xf')){_0x26298b[_0x393b89[_0x0ac3('0xad')]]=_['map'](_0x49c5eb['associatedResources'],'id');}else{_0x26298b[_0x393b89[_0x0ac3('0xad')]]=_0x49c5eb[_0x0ac3('0x8')];}_0x4069d9['push'](_0x26298b);}else{_0x3d7840[_0x0ac3('0x8c')]['id']=_0x49c5eb[_0x0ac3('0x8')];}}else{for(var _0x3cabd6=0x0;_0x3cabd6<_0x2fcc20[_0x0ac3('0x9b')];_0x3cabd6++){_0x393b89=_[_0x0ac3('0x97')](_0x11f8db,[_0x0ac3('0xd'),_0x2fcc20[_0x3cabd6][_0x0ac3('0xd')]]);if(_0x393b89['field']){_0x26298b={};_0x26298b[_0x393b89[_0x0ac3('0xad')]]=_0x2fcc20[_0x3cabd6][_0x0ac3('0x8')];_0x4069d9[_0x0ac3('0x96')](_0x26298b);}else{if(!_0x3d7840[_0x0ac3('0x8c')]['id'])_0x3d7840[_0x0ac3('0x8c')]['id']=[];_0x2fcc20[_0x3cabd6][_0x0ac3('0x8')][_0x0ac3('0xae')](function(_0x50425a){_0x3d7840['where']['id']['push'](_0x50425a);});}}}if(!_[_0x0ac3('0x95')](_0x4069d9)){_0x3d7840[_0x0ac3('0x8c')]=_['merge'](_0x3d7840['where'],{'$and':{'$or':_0x4069d9}});}_0x3d7840=_[_0x0ac3('0xaa')]({},_0x3d7840,_0x37aa77['options']);if(_0x49c5eb&&!_0x49c5eb[_0x0ac3('0x9c')]&&_0x1fcc8e[_0x0ac3('0x13')]===_0x0ac3('0xf')){if(_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xaf')]){_0x3d7840[_0x0ac3('0xb0')]=[{'all':!![]}];}return _0x32b745[_0x1fcc8e[_0x0ac3('0x13')]]['findAll'](_0x3d7840)['then'](function(_0x718550){var _0x4c1129=[];_0x718550[_0x0ac3('0xae')](function(_0x55aabe){var _0x346f03;switch(_0x55aabe[_0x0ac3('0xb1')]){case _0x0ac3('0xb2'):_0x346f03=_[_0x0ac3('0x97')](_0x49c5eb['associatedResources'],function(_0x14920d){return _0x14920d['id']===_0x55aabe[_0x0ac3('0x7e')]&&_0x14920d[_0x0ac3('0x36')]===_0x0ac3('0xb3');});break;case _0x0ac3('0xb4'):_0x346f03=_['find'](_0x49c5eb[_0x0ac3('0x8')],function(_0x3ed0de){return _0x3ed0de['id']===_0x55aabe[_0x0ac3('0x7e')]&&_0x3ed0de[_0x0ac3('0x36')]===_0x0ac3('0xb5');});break;}if(_0x346f03)_0x4c1129[_0x0ac3('0x96')](_0x55aabe);});_0x48a03e[_0x0ac3('0xb6')]=_0x4c1129[_0x0ac3('0x9b')];_0x48a03e[_0x0ac3('0xb7')]=_0x4c1129;return _0x48a03e;});}else{if(!_[_0x0ac3('0x95')](_0x37aa77['query'][_0x0ac3('0xb8')])){_0x3d7840[_0x0ac3('0x8c')]['id']=_0x3d7840['where']['id']?_['intersection'](_0x3d7840[_0x0ac3('0x8c')]['id'],_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xb8')]):_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xb8')];if(_0x37aa77['query'][_0x0ac3('0xb9')]){_0x3d7840[_0x0ac3('0xa6')]=_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xb9')];}}if(_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xba')]){_0x3d7840[_0x0ac3('0x8c')]=_[_0x0ac3('0xaa')](_0x3d7840[_0x0ac3('0x8c')],{'$and':_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xba')]});}return _0x32b745[_0x1fcc8e[_0x0ac3('0x13')]][_0x0ac3('0xb6')]({'where':_0x3d7840[_0x0ac3('0x8c')]})[_0x0ac3('0x7')](function(_0x1e00b2){_0x48a03e[_0x0ac3('0xb6')]=_0x1e00b2;if(_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xaf')]){if(_0x1fcc8e[_0x0ac3('0x13')]===_0x0ac3('0xbb')){_0x3d7840['include']=[{'model':_0x32b745[_0x0ac3('0x71')],'as':_0x0ac3('0xbc'),'attributes':['id','name',_0x0ac3('0xbd')],'required':_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xbe')]?!![]:![]},{'model':_0x32b745[_0x0ac3('0x71')],'as':'ThroughTags','attributes':['id',_0x0ac3('0xd'),_0x0ac3('0xbd')],'through':_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xbe')]?{'attributes':[],'where':{'TagId':_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xbe')]||undefined}}:{},'required':_0x37aa77[_0x0ac3('0x93')]['tag']?!![]:![]}];}else{_0x3d7840['include']=[{'all':!![]}];}}return _0x32b745[_0x1fcc8e[_0x0ac3('0x13')]]['findAll'](_0x3d7840);})[_0x0ac3('0x7')](function(_0x4c6c32){_0x48a03e[_0x0ac3('0xb7')]=_0x4c6c32;if(_0x39bb10===_0x0ac3('0x2d')&&_0x37aa77[_0x0ac3('0x93')][_0x0ac3('0xbf')]===_0x0ac3('0xc0')){var _0x2a3c42=[];for(var _0x7e9ce8=0x0;_0x7e9ce8<_0x48a03e[_0x0ac3('0xb7')]['length'];_0x7e9ce8++){_0x2a3c42[_0x0ac3('0x96')](_0x3ff60d(_0x0ac3('0xc1'),_0x48a03e[_0x0ac3('0xb7')][_0x7e9ce8][_0x0ac3('0xc2')]));_0x2a3c42[_0x0ac3('0x96')](_0x3ff60d(_0x0ac3('0xc3'),_0x48a03e['rows'][_0x7e9ce8][_0x0ac3('0xc2')]));_0x2a3c42['push'](_0x3ff60d(_0x0ac3('0xc4'),_0x48a03e['rows'][_0x7e9ce8][_0x0ac3('0xc2')]));_0x2a3c42[_0x0ac3('0x96')](_0x3ff60d(_0x0ac3('0xc5'),_0x48a03e[_0x0ac3('0xb7')][_0x7e9ce8][_0x0ac3('0xc2')]));_0x2a3c42['push'](_0x3ff60d(_0x0ac3('0xc6'),_0x48a03e['rows'][_0x7e9ce8][_0x0ac3('0xc2')]));_0x2a3c42[_0x0ac3('0x96')](_0x3ff60d('whatsapp',_0x48a03e[_0x0ac3('0xb7')][_0x7e9ce8]['dataValues']));}return Promise[_0x0ac3('0xc7')](_0x2a3c42)[_0x0ac3('0x7')](function(){return _0x48a03e;});}return _0x48a03e;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 214d097..d633f5f 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 _0x8ace=['UserProfile,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x5c524e,_0x4f07dc){var _0x49ffd1=function(_0x153467){while(--_0x153467){_0x5c524e['push'](_0x5c524e['shift']());}};_0x49ffd1(++_0x4f07dc);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x47c0a5,_0x21fb53){_0x47c0a5=_0x47c0a5-0x0;var _0x50878c=_0x8ace[_0x47c0a5];return _0x50878c;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var BPromise=require(_0xe8ac('0x3'));var rs=require(_0xe8ac('0x4'));var fs=require('fs');var Redis=require(_0xe8ac('0x5'));var db=require(_0xe8ac('0x6'))['db'];var utils=require(_0xe8ac('0x7'));var logger=require(_0xe8ac('0x8'))(_0xe8ac('0x9'));var config=require(_0xe8ac('0xa'));var jayson=require(_0xe8ac('0xb'));var client=jayson[_0xe8ac('0xc')][_0xe8ac('0xd')]({'port':0x232a});config['redis']=_[_0xe8ac('0xe')](config[_0xe8ac('0xf')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe8ac('0xf')]));require('./userProfile.socket')[_0xe8ac('0x10')](socket);function respondWithRpcPromise(_0x271fdb,_0x19d9c8,_0x4778d7){return new BPromise(function(_0xa18ae1,_0x277ed8){return client['request'](_0x271fdb,_0x4778d7)[_0xe8ac('0x11')](function(_0x2e3b25){logger[_0xe8ac('0x12')]('UserProfile,\x20%s,\x20%s',_0x19d9c8,_0xe8ac('0x13'));logger[_0xe8ac('0x14')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x19d9c8,_0xe8ac('0x13'),JSON[_0xe8ac('0x15')](_0x2e3b25));if(_0x2e3b25[_0xe8ac('0x16')]){if(_0x2e3b25[_0xe8ac('0x16')][_0xe8ac('0x17')]===0x1f4){logger[_0xe8ac('0x16')](_0xe8ac('0x18'),_0x19d9c8,_0x2e3b25[_0xe8ac('0x16')][_0xe8ac('0x19')]);return _0x277ed8(_0x2e3b25[_0xe8ac('0x16')]['message']);}logger[_0xe8ac('0x16')](_0xe8ac('0x18'),_0x19d9c8,_0x2e3b25['error'][_0xe8ac('0x19')]);return _0xa18ae1(_0x2e3b25[_0xe8ac('0x16')][_0xe8ac('0x19')]);}else{logger[_0xe8ac('0x12')](_0xe8ac('0x18'),_0x19d9c8,_0xe8ac('0x13'));_0xa18ae1(_0x2e3b25['result']['message']);}})['catch'](function(_0x18cf29){logger[_0xe8ac('0x16')]('UserProfile,\x20%s,\x20%s',_0x19d9c8,_0x18cf29);_0x277ed8(_0x18cf29);});});} \ No newline at end of file +var _0x539d=['catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x23a9cc,_0x461f4a){var _0x3570d6=function(_0x50037a){while(--_0x50037a){_0x23a9cc['push'](_0x23a9cc['shift']());}};_0x3570d6(++_0x461f4a);}(_0x539d,0x17b));var _0xd539=function(_0x22f5ea,_0x3a6a30){_0x22f5ea=_0x22f5ea-0x0;var _0xe5955=_0x539d[_0x22f5ea];return _0xe5955;};'use strict';var _=require(_0xd539('0x0'));var util=require('util');var moment=require(_0xd539('0x1'));var BPromise=require(_0xd539('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd539('0x3'))['db'];var utils=require(_0xd539('0x4'));var logger=require(_0xd539('0x5'))(_0xd539('0x6'));var config=require(_0xd539('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd539('0x8')][_0xd539('0x9')]({'port':0x232a});config[_0xd539('0xa')]=_[_0xd539('0xb')](config[_0xd539('0xa')],{'host':_0xd539('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd539('0xa')]));require(_0xd539('0xd'))[_0xd539('0xe')](socket);function respondWithRpcPromise(_0x9470a2,_0x566b14,_0x586ce8){return new BPromise(function(_0x3f0805,_0x36027a){return client[_0xd539('0xf')](_0x9470a2,_0x586ce8)[_0xd539('0x10')](function(_0x424b1a){logger[_0xd539('0x11')](_0xd539('0x12'),_0x566b14,_0xd539('0x13'));logger['debug'](_0xd539('0x14'),_0x566b14,_0xd539('0x13'),JSON[_0xd539('0x15')](_0x424b1a));if(_0x424b1a[_0xd539('0x16')]){if(_0x424b1a[_0xd539('0x16')][_0xd539('0x17')]===0x1f4){logger['error'](_0xd539('0x12'),_0x566b14,_0x424b1a[_0xd539('0x16')][_0xd539('0x18')]);return _0x36027a(_0x424b1a[_0xd539('0x16')][_0xd539('0x18')]);}logger[_0xd539('0x16')](_0xd539('0x12'),_0x566b14,_0x424b1a[_0xd539('0x16')][_0xd539('0x18')]);return _0x3f0805(_0x424b1a[_0xd539('0x16')][_0xd539('0x18')]);}else{logger['info'](_0xd539('0x12'),_0x566b14,_0xd539('0x13'));_0x3f0805(_0x424b1a[_0xd539('0x19')][_0xd539('0x18')]);}})[_0xd539('0x1a')](function(_0x20e5af){logger[_0xd539('0x16')](_0xd539('0x12'),_0x566b14,_0x20e5af);_0x36027a(_0x20e5af);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index c46abdc..d1133c8 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 _0x0680=['removeListener','length','userProfile:','./userProfile.events','remove','update'];(function(_0x252328,_0x4c22f0){var _0xaa85b7=function(_0x2623d0){while(--_0x2623d0){_0x252328['push'](_0x252328['shift']());}};_0xaa85b7(++_0x4c22f0);}(_0x0680,0x1a7));var _0x0068=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0680[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0x0068('0x0'));var events=['save',_0x0068('0x1'),_0x0068('0x2')];function createListener(_0x4e5ee6,_0x44b4f5){return function(_0x5da6ff){_0x44b4f5['emit'](_0x4e5ee6,_0x5da6ff);};}function removeListener(_0x3a47e5,_0x4e529a){return function(){UserProfileEvents[_0x0068('0x3')](_0x3a47e5,_0x4e529a);};}exports['register']=function(_0x2627f0){for(var _0x2e20f1=0x0,_0xc10472=events[_0x0068('0x4')];_0x2e20f1<_0xc10472;_0x2e20f1++){var _0xd08e86=events[_0x2e20f1];var _0x2df409=createListener(_0x0068('0x5')+_0xd08e86,_0x2627f0);UserProfileEvents['on'](_0xd08e86,_0x2df409);}}; \ No newline at end of file +var _0xf164=['removeListener','register','length','./userProfile.events','save','remove','update','emit'];(function(_0x3569a9,_0x3a4766){var _0x420727=function(_0x34f23a){while(--_0x34f23a){_0x3569a9['push'](_0x3569a9['shift']());}};_0x420727(++_0x3a4766);}(_0xf164,0x153));var _0x4f16=function(_0xeb6bb1,_0xc83c4c){_0xeb6bb1=_0xeb6bb1-0x0;var _0x387e00=_0xf164[_0xeb6bb1];return _0x387e00;};'use strict';var UserProfileEvents=require(_0x4f16('0x0'));var events=[_0x4f16('0x1'),_0x4f16('0x2'),_0x4f16('0x3')];function createListener(_0x209434,_0x687675){return function(_0xdb3e8e){_0x687675[_0x4f16('0x4')](_0x209434,_0xdb3e8e);};}function removeListener(_0x30b3bc,_0x267088){return function(){UserProfileEvents[_0x4f16('0x5')](_0x30b3bc,_0x267088);};}exports[_0x4f16('0x6')]=function(_0x1524d7){for(var _0x30496d=0x0,_0x9d7722=events[_0x4f16('0x7')];_0x30496d<_0x9d7722;_0x30496d++){var _0x44f690=events[_0x30496d];var _0x47549b=createListener('userProfile:'+_0x44f690,_0x1524d7);UserProfileEvents['on'](_0x44f690,_0x47549b);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 63f1b18..01c8c19 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 _0xfb89=['/describe','isAuthenticated','describe','/:id','show','post','create','delete','destroy','exports','path','express','Router','fs-extra','../../config/environment','./userProfileResource.controller','get','index'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0xfb89,0x196));var _0x9fb8=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0xfb89[_0x3d78d7];return _0x4b6784;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9fb8('0x0'));var timeout=require('connect-timeout');var express=require(_0x9fb8('0x1'));var router=express[_0x9fb8('0x2')]();var fs_extra=require(_0x9fb8('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9fb8('0x4'));var controller=require(_0x9fb8('0x5'));router[_0x9fb8('0x6')]('/',auth['isAuthenticated'](),controller[_0x9fb8('0x7')]);router[_0x9fb8('0x6')](_0x9fb8('0x8'),auth[_0x9fb8('0x9')](),controller[_0x9fb8('0xa')]);router['get'](_0x9fb8('0xb'),auth[_0x9fb8('0x9')](),controller[_0x9fb8('0xc')]);router[_0x9fb8('0xd')]('/',auth['isAuthenticated'](),controller[_0x9fb8('0xe')]);router['put'](_0x9fb8('0xb'),auth[_0x9fb8('0x9')](),controller['update']);router[_0x9fb8('0xf')](_0x9fb8('0xb'),auth['isAuthenticated'](),controller[_0x9fb8('0x10')]);module[_0x9fb8('0x11')]=router; \ No newline at end of file +var _0x8e35=['Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x4e164e,_0x1d0660){var _0xf25cb7=function(_0xe9cf36){while(--_0xe9cf36){_0x4e164e['push'](_0x4e164e['shift']());}};_0xf25cb7(++_0x1d0660);}(_0x8e35,0x1f0));var _0x58e3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8e35[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x58e3('0x0'));var util=require(_0x58e3('0x1'));var path=require(_0x58e3('0x2'));var timeout=require(_0x58e3('0x3'));var express=require('express');var router=express[_0x58e3('0x4')]();var fs_extra=require(_0x58e3('0x5'));var auth=require(_0x58e3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x58e3('0x7'));var controller=require(_0x58e3('0x8'));router[_0x58e3('0x9')]('/',auth[_0x58e3('0xa')](),controller[_0x58e3('0xb')]);router[_0x58e3('0x9')](_0x58e3('0xc'),auth[_0x58e3('0xa')](),controller['describe']);router[_0x58e3('0x9')]('/:id',auth[_0x58e3('0xa')](),controller['show']);router[_0x58e3('0xd')]('/',auth['isAuthenticated'](),controller[_0x58e3('0xe')]);router[_0x58e3('0xf')](_0x58e3('0x10'),auth[_0x58e3('0xa')](),controller[_0x58e3('0x11')]);router[_0x58e3('0x12')](_0x58e3('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x58e3('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index d531608..eeebee0 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 _0x5fa0=['sequelize','exports','STRING','INTEGER'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5fa0,0xd0));var _0x05fa=function(_0x413ef6,_0x3fd0a5){_0x413ef6=_0x413ef6-0x0;var _0x436563=_0x5fa0[_0x413ef6];return _0x436563;};'use strict';var Sequelize=require(_0x05fa('0x0'));module[_0x05fa('0x1')]={'name':{'type':Sequelize[_0x05fa('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x05fa('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x05fa('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x46e2=['STRING','sequelize','exports','INTEGER'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x46e2,0x13d));var _0x246e=function(_0x10e448,_0x339ae5){_0x10e448=_0x10e448-0x0;var _0x431d02=_0x46e2[_0x10e448];return _0x431d02;};'use strict';var Sequelize=require(_0x246e('0x0'));module[_0x246e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x246e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x246e('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 9ed80bb..e47ba61 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 _0xc6ac=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','UserProfileResource','rawAttributes','fieldName','type','key','map','query','keys'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4ac4b7,_0x8828e5){_0x4ac4b7=_0x4ac4b7-0x0;var _0x459b7d=_0xc6ac[_0x4ac4b7];return _0x459b7d;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['UserProfileResource'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));};exports[_0xcc6a('0x4f')]=function(_0x34531d,_0x14f5e5){return db[_0xcc6a('0x2d')]['describe']()['then'](respondWithResult(_0x14f5e5,null))[_0xcc6a('0x4b')](handleError(_0x14f5e5,null));}; \ No newline at end of file +var _0xc1c6=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','UserProfileResource','rawAttributes','type','key','model','query'];(function(_0x570053,_0x29220c){var _0x4d932c=function(_0x2aa95c){while(--_0x2aa95c){_0x570053['push'](_0x570053['shift']());}};_0x4d932c(++_0x29220c);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2cdfde,_0x441d63){_0x2cdfde=_0x2cdfde-0x0;var _0x4b30d1=_0xc1c6[_0x2cdfde];return _0x4b30d1;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['UserProfileResource']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['UserProfileResource'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['UserProfileResource'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['UserProfileResource']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));};exports[_0x6c1c('0x49')]=function(_0x2450ab,_0x5489ac){return db['UserProfileResource'][_0x6c1c('0x49')]()[_0x6c1c('0x25')](respondWithResult(_0x5489ac,null))['catch'](handleError(_0x5489ac,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 1740fe2..4308ed0 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 _0xf32b=['bluebird','request-promise','path','rimraf','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger'];(function(_0x18a119,_0x18857e){var _0x46fd77=function(_0x52e22f){while(--_0x52e22f){_0x18a119['push'](_0x18a119['shift']());}};_0x46fd77(++_0x18857e);}(_0xf32b,0x11e));var _0xbf32=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xf32b[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0xbf32('0x0'));var logger=require(_0xbf32('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbf32('0x2'));var rp=require(_0xbf32('0x3'));var fs=require('fs');var path=require(_0xbf32('0x4'));var rimraf=require(_0xbf32('0x5'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0xbf32('0x6')]=function(_0x28f8e1,_0x1d3486){return _0x28f8e1['define'](_0xbf32('0x7'),attributes,{'tableName':_0xbf32('0x8'),'paranoid':![],'indexes':[{'name':_0xbf32('0x9'),'fields':[_0xbf32('0xa'),_0xbf32('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb491=['path','rimraf','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','../../config/logger','api','bluebird'];(function(_0x50fbfc,_0x1874db){var _0x8ba69b=function(_0x2666ca){while(--_0x2666ca){_0x50fbfc['push'](_0x50fbfc['shift']());}};_0x8ba69b(++_0x1874db);}(_0xb491,0x19f));var _0x1b49=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0xb491[_0xd13a88];return _0x1c993c;};'use strict';var _=require(_0x1b49('0x0'));var util=require(_0x1b49('0x1'));var logger=require(_0x1b49('0x2'))(_0x1b49('0x3'));var moment=require('moment');var BPromise=require(_0x1b49('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b49('0x5'));var rimraf=require(_0x1b49('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x5a449e,_0x4cbddc){return _0x5a449e[_0x1b49('0x7')](_0x1b49('0x8'),attributes,{'tableName':_0x1b49('0x9'),'paranoid':![],'indexes':[{'name':_0x1b49('0xa'),'fields':['resourceId',_0x1b49('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 5fdbe2f..108a482 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 _0x8301=['result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message'];(function(_0x282daf,_0x3a4e7e){var _0x15f129=function(_0x5c604e){while(--_0x5c604e){_0x282daf['push'](_0x282daf['shift']());}};_0x15f129(++_0x3a4e7e);}(_0x8301,0x169));var _0x1830=function(_0x166953,_0x214d3a){_0x166953=_0x166953-0x0;var _0x4a8baf=_0x8301[_0x166953];return _0x4a8baf;};'use strict';var _=require('lodash');var util=require(_0x1830('0x0'));var moment=require(_0x1830('0x1'));var BPromise=require('bluebird');var rs=require(_0x1830('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1830('0x3'))['db'];var utils=require(_0x1830('0x4'));var logger=require(_0x1830('0x5'))('rpc');var config=require(_0x1830('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1830('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3ed5e1,_0x4e79ab,_0x103ddd){return new BPromise(function(_0x27452a,_0x27664c){return client[_0x1830('0x8')](_0x3ed5e1,_0x103ddd)[_0x1830('0x9')](function(_0x396094){logger[_0x1830('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x4e79ab,'request\x20sent');logger[_0x1830('0xb')](_0x1830('0xc'),_0x4e79ab,_0x1830('0xd'),JSON[_0x1830('0xe')](_0x396094));if(_0x396094[_0x1830('0xf')]){if(_0x396094['error'][_0x1830('0x10')]===0x1f4){logger['error'](_0x1830('0x11'),_0x4e79ab,_0x396094[_0x1830('0xf')][_0x1830('0x12')]);return _0x27664c(_0x396094[_0x1830('0xf')]['message']);}logger[_0x1830('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x4e79ab,_0x396094[_0x1830('0xf')][_0x1830('0x12')]);return _0x27452a(_0x396094[_0x1830('0xf')][_0x1830('0x12')]);}else{logger['info'](_0x1830('0x11'),_0x4e79ab,_0x1830('0xd'));_0x27452a(_0x396094[_0x1830('0x13')][_0x1830('0x12')]);}})['catch'](function(_0xf1e928){logger[_0x1830('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x4e79ab,_0xf1e928);_0x27664c(_0xf1e928);});});} \ No newline at end of file +var _0xe323=['request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x57fa63,_0x2c17f5){var _0x1c5770=function(_0x4c732e){while(--_0x4c732e){_0x57fa63['push'](_0x57fa63['shift']());}};_0x1c5770(++_0x2c17f5);}(_0xe323,0x110));var _0x3e32=function(_0x20e169,_0x3736c2){_0x20e169=_0x20e169-0x0;var _0x26b13e=_0xe323[_0x20e169];return _0x26b13e;};'use strict';var _=require(_0x3e32('0x0'));var util=require(_0x3e32('0x1'));var moment=require(_0x3e32('0x2'));var BPromise=require(_0x3e32('0x3'));var rs=require(_0x3e32('0x4'));var fs=require('fs');var Redis=require(_0x3e32('0x5'));var db=require(_0x3e32('0x6'))['db'];var utils=require(_0x3e32('0x7'));var logger=require(_0x3e32('0x8'))(_0x3e32('0x9'));var config=require(_0x3e32('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3e32('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34df92,_0x5c504c,_0x3d78ba){return new BPromise(function(_0x260b6f,_0x3977e0){return client['request'](_0x34df92,_0x3d78ba)['then'](function(_0x443993){logger[_0x3e32('0xc')](_0x3e32('0xd'),_0x5c504c,_0x3e32('0xe'));logger[_0x3e32('0xf')](_0x3e32('0x10'),_0x5c504c,_0x3e32('0xe'),JSON[_0x3e32('0x11')](_0x443993));if(_0x443993[_0x3e32('0x12')]){if(_0x443993[_0x3e32('0x12')][_0x3e32('0x13')]===0x1f4){logger[_0x3e32('0x12')](_0x3e32('0xd'),_0x5c504c,_0x443993[_0x3e32('0x12')][_0x3e32('0x14')]);return _0x3977e0(_0x443993[_0x3e32('0x12')][_0x3e32('0x14')]);}logger[_0x3e32('0x12')](_0x3e32('0xd'),_0x5c504c,_0x443993[_0x3e32('0x12')][_0x3e32('0x14')]);return _0x260b6f(_0x443993[_0x3e32('0x12')]['message']);}else{logger[_0x3e32('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x5c504c,'request\x20sent');_0x260b6f(_0x443993[_0x3e32('0x15')][_0x3e32('0x14')]);}})['catch'](function(_0x3b7914){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x5c504c,_0x3b7914);_0x3977e0(_0x3b7914);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 059a4d1..e537541 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 _0xbec6=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x8aefe0,_0x2fe240){var _0x23c98d=function(_0x34f848){while(--_0x34f848){_0x8aefe0['push'](_0x8aefe0['shift']());}};_0x23c98d(++_0x2fe240);}(_0xbec6,0x196));var _0x6bec=function(_0x23e859,_0x419ccc){_0x23e859=_0x23e859-0x0;var _0xe4964=_0xbec6[_0x23e859];return _0xe4964;};'use strict';var multer=require(_0x6bec('0x0'));var util=require(_0x6bec('0x1'));var path=require(_0x6bec('0x2'));var timeout=require(_0x6bec('0x3'));var express=require(_0x6bec('0x4'));var router=express[_0x6bec('0x5')]();var fs_extra=require(_0x6bec('0x6'));var auth=require(_0x6bec('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6bec('0x8'));var controller=require(_0x6bec('0x9'));router[_0x6bec('0xa')]('/',auth[_0x6bec('0xb')](),controller[_0x6bec('0xc')]);router[_0x6bec('0xa')](_0x6bec('0xd'),auth[_0x6bec('0xb')](),controller[_0x6bec('0xe')]);router['get'](_0x6bec('0xf'),auth[_0x6bec('0xb')](),controller[_0x6bec('0x10')]);router[_0x6bec('0x11')]('/',auth[_0x6bec('0xb')](),controller[_0x6bec('0x12')]);router[_0x6bec('0x13')](_0x6bec('0xf'),auth[_0x6bec('0xb')](),controller[_0x6bec('0x14')]);router[_0x6bec('0x15')]('/:id',auth[_0x6bec('0xb')](),controller[_0x6bec('0x16')]);module[_0x6bec('0x17')]=router; \ No newline at end of file +var _0xabe4=['post','create','put','delete','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x138975,_0x319d77){var _0x2ff39a=function(_0x2a1a21){while(--_0x2a1a21){_0x138975['push'](_0x138975['shift']());}};_0x2ff39a(++_0x319d77);}(_0xabe4,0x83));var _0x4abe=function(_0x20210e,_0x1603f6){_0x20210e=_0x20210e-0x0;var _0x439c00=_0xabe4[_0x20210e];return _0x439c00;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4abe('0x0'));var express=require(_0x4abe('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4abe('0x2'));var interaction=require(_0x4abe('0x3'));var config=require(_0x4abe('0x4'));var controller=require('./userProfileSection.controller');router[_0x4abe('0x5')]('/',auth[_0x4abe('0x6')](),controller[_0x4abe('0x7')]);router[_0x4abe('0x5')]('/describe',auth[_0x4abe('0x6')](),controller['describe']);router[_0x4abe('0x5')](_0x4abe('0x8'),auth[_0x4abe('0x6')](),controller['show']);router[_0x4abe('0x9')]('/',auth[_0x4abe('0x6')](),controller[_0x4abe('0xa')]);router[_0x4abe('0xb')](_0x4abe('0x8'),auth[_0x4abe('0x6')](),controller['update']);router[_0x4abe('0xc')]('/:id',auth[_0x4abe('0x6')](),controller['destroy']);module[_0x4abe('0xd')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 6e9073a..9843fb5 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 _0x6324=['STRING','BOOLEAN','setDataValue','join','getDataValue','crudPermissions','split','sequelize','exports'];(function(_0x249614,_0x14408d){var _0x57999c=function(_0x50bd9f){while(--_0x50bd9f){_0x249614['push'](_0x249614['shift']());}};_0x57999c(++_0x14408d);}(_0x6324,0x142));var _0x4632=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x6324[_0x11a55c];return _0x26c390;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'name':{'type':Sequelize[_0x4632('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x4632('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x4632('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4632('0x2')],'set':function(_0x54c200){this[_0x4632('0x4')]('crudPermissions',_0x54c200?_0x54c200[_0x4632('0x5')](''):[]);},'get':function(){return this[_0x4632('0x6')](_0x4632('0x7'))?this[_0x4632('0x6')]('crudPermissions')[_0x4632('0x8')](''):[];}}}; \ No newline at end of file +var _0xe605=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','INTEGER'];(function(_0x46d745,_0x2c6080){var _0x2bcfee=function(_0x226632){while(--_0x226632){_0x46d745['push'](_0x46d745['shift']());}};_0x2bcfee(++_0x2c6080);}(_0xe605,0x92));var _0x5e60=function(_0x1f6692,_0x4cf691){_0x1f6692=_0x1f6692-0x0;var _0x37c1bb=_0xe605[_0x1f6692];return _0x37c1bb;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x5e60('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x5e60('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x5e60('0x2')],'set':function(_0xfe1f64){this[_0x5e60('0x5')](_0x5e60('0x6'),_0xfe1f64?_0xfe1f64[_0x5e60('0x7')](''):[]);},'get':function(){return this[_0x5e60('0x8')](_0x5e60('0x6'))?this[_0x5e60('0x8')]('crudPermissions')[_0x5e60('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index de1b853..39f5318 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 _0xb979=['rows','catch','params','keys','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','UserProfileSection','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include'];(function(_0x590096,_0xa578da){var _0x53e9e=function(_0x3fd2b8){while(--_0x3fd2b8){_0x590096['push'](_0x590096['shift']());}};_0x53e9e(++_0xa578da);}(_0xb979,0xee));var _0x9b97=function(_0x31a5cb,_0xaf1a9d){_0x31a5cb=_0x31a5cb-0x0;var _0x328eb4=_0xb979[_0x31a5cb];return _0x328eb4;};'use strict';var emlformat=require(_0x9b97('0x0'));var rimraf=require(_0x9b97('0x1'));var zipdir=require(_0x9b97('0x2'));var jsonpatch=require(_0x9b97('0x3'));var rp=require(_0x9b97('0x4'));var moment=require('moment');var BPromise=require(_0x9b97('0x5'));var Mustache=require(_0x9b97('0x6'));var util=require(_0x9b97('0x7'));var path=require(_0x9b97('0x8'));var sox=require(_0x9b97('0x9'));var csv=require(_0x9b97('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b97('0xb'));var _=require(_0x9b97('0xc'));var squel=require(_0x9b97('0xd'));var crypto=require(_0x9b97('0xe'));var jsforce=require(_0x9b97('0xf'));var deskjs=require(_0x9b97('0x10'));var toCsv=require(_0x9b97('0xa'));var querystring=require(_0x9b97('0x11'));var Papa=require(_0x9b97('0x12'));var Redis=require(_0x9b97('0x13'));var authService=require(_0x9b97('0x14'));var qs=require(_0x9b97('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b97('0x16'));var logger=require('../../config/logger')(_0x9b97('0x17'));var utils=require(_0x9b97('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9b97('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e8f7e,_0x1b17ee){_0x1b17ee=_0x1b17ee||0xcc;return function(_0x122e28){if(_0x122e28){return _0x3e8f7e[_0x9b97('0x1a')](_0x1b17ee);}return _0x3e8f7e[_0x9b97('0x1b')](_0x1b17ee)[_0x9b97('0x1c')]();};}function respondWithResult(_0x1bc9a8,_0x231d26){_0x231d26=_0x231d26||0xc8;return function(_0x56f7af){if(_0x56f7af){return _0x1bc9a8[_0x9b97('0x1b')](_0x231d26)[_0x9b97('0x1d')](_0x56f7af);}};}function respondWithFilteredResult(_0x1a1264,_0x59c88c){return function(_0x25636a){if(_0x25636a){var _0x2d5cd5=typeof _0x59c88c[_0x9b97('0x1e')]===_0x9b97('0x1f')&&typeof _0x59c88c['limit']===_0x9b97('0x1f');var _0x1f6bc6=_0x25636a[_0x9b97('0x20')];var _0x3a3721=_0x2d5cd5?0x0:_0x59c88c[_0x9b97('0x1e')];var _0x22157d=_0x2d5cd5?_0x25636a['count']:_0x59c88c['offset']+_0x59c88c['limit'];var _0x11a3ef;if(_0x22157d>=_0x1f6bc6){_0x22157d=_0x1f6bc6;_0x11a3ef=0xc8;}else{_0x11a3ef=0xce;}_0x1a1264['status'](_0x11a3ef);return _0x1a1264['set'](_0x9b97('0x21'),_0x3a3721+'-'+_0x22157d+'/'+_0x1f6bc6)[_0x9b97('0x1d')](_0x25636a);}return null;};}function patchUpdates(_0x315ad7){return function(_0x25a660){try{jsonpatch[_0x9b97('0x22')](_0x25a660,_0x315ad7,!![]);}catch(_0xd4086b){return BPromise['reject'](_0xd4086b);}return _0x25a660[_0x9b97('0x23')]();};}function saveUpdates(_0x1bc97a,_0x45c553){return function(_0x4bcc30){if(_0x4bcc30){return _0x4bcc30[_0x9b97('0x24')](_0x1bc97a)[_0x9b97('0x25')](function(_0xcd6c7c){return _0xcd6c7c;});}return null;};}function removeEntity(_0x37f412,_0x3a3eab){return function(_0x5bdf38){if(_0x5bdf38){return _0x5bdf38['destroy']()[_0x9b97('0x25')](function(){_0x37f412[_0x9b97('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x289767,_0x7ebc24){return function(_0x4a09c3){if(!_0x4a09c3){_0x289767[_0x9b97('0x1a')](0x194);}return _0x4a09c3;};}function handleError(_0x1e354c,_0xa829d6){_0xa829d6=_0xa829d6||0x1f4;return function(_0x2789b1){logger[_0x9b97('0x26')](_0x2789b1[_0x9b97('0x27')]);if(_0x2789b1['name']){delete _0x2789b1[_0x9b97('0x28')];}_0x1e354c[_0x9b97('0x1b')](_0xa829d6)[_0x9b97('0x29')](_0x2789b1);};}exports[_0x9b97('0x2a')]=function(_0xccb63a,_0x2ebf93){var _0x433066={},_0x3dae71={},_0x1db09c={'count':0x0,'rows':[]};var _0x3b85eb=_[_0x9b97('0x2b')](db[_0x9b97('0x2c')]['rawAttributes'],function(_0x43f127){return{'name':_0x43f127['fieldName'],'type':_0x43f127[_0x9b97('0x2d')][_0x9b97('0x2e')]};});_0x3dae71['model']=_[_0x9b97('0x2b')](_0x3b85eb,'name');_0x3dae71[_0x9b97('0x2f')]=_['keys'](_0xccb63a['query']);_0x3dae71['filters']=_[_0x9b97('0x30')](_0x3dae71[_0x9b97('0x31')],_0x3dae71[_0x9b97('0x2f')]);_0x433066[_0x9b97('0x32')]=_[_0x9b97('0x30')](_0x3dae71[_0x9b97('0x31')],qs[_0x9b97('0x33')](_0xccb63a[_0x9b97('0x2f')][_0x9b97('0x33')]));_0x433066['attributes']=_0x433066[_0x9b97('0x32')][_0x9b97('0x34')]?_0x433066['attributes']:_0x3dae71[_0x9b97('0x31')];if(!_0xccb63a['query'][_0x9b97('0x35')](_0x9b97('0x36'))){_0x433066[_0x9b97('0x37')]=qs[_0x9b97('0x37')](_0xccb63a[_0x9b97('0x2f')][_0x9b97('0x37')]);_0x433066[_0x9b97('0x1e')]=qs['offset'](_0xccb63a[_0x9b97('0x2f')][_0x9b97('0x1e')]);}_0x433066['order']=qs[_0x9b97('0x38')](_0xccb63a[_0x9b97('0x2f')]['sort']);_0x433066[_0x9b97('0x39')]=qs[_0x9b97('0x3a')](_[_0x9b97('0x3b')](_0xccb63a[_0x9b97('0x2f')],_0x3dae71[_0x9b97('0x3a')]),_0x3b85eb);if(_0xccb63a['query'][_0x9b97('0x3c')]){_0x433066[_0x9b97('0x39')]=_['merge'](_0x433066[_0x9b97('0x39')],{'$or':_[_0x9b97('0x2b')](_0x3b85eb,function(_0x534bf8){if(_0x534bf8[_0x9b97('0x2d')]!==_0x9b97('0x3d')){var _0x5cc1c2={};_0x5cc1c2[_0x534bf8['name']]={'$like':'%'+_0xccb63a['query'][_0x9b97('0x3c')]+'%'};return _0x5cc1c2;}})});}_0x433066=_[_0x9b97('0x3e')]({},_0x433066,_0xccb63a[_0x9b97('0x3f')]);var _0x5e6d5e={'where':_0x433066['where']};return db[_0x9b97('0x2c')]['count'](_0x5e6d5e)[_0x9b97('0x25')](function(_0x10d1db){_0x1db09c[_0x9b97('0x20')]=_0x10d1db;if(_0xccb63a[_0x9b97('0x2f')][_0x9b97('0x40')]){_0x433066[_0x9b97('0x41')]=[{'all':!![]}];}return db[_0x9b97('0x2c')]['findAll'](_0x433066);})[_0x9b97('0x25')](function(_0x26ddfb){_0x1db09c[_0x9b97('0x42')]=_0x26ddfb;return _0x1db09c;})[_0x9b97('0x25')](respondWithFilteredResult(_0x2ebf93,_0x433066))[_0x9b97('0x43')](handleError(_0x2ebf93,null));};exports['show']=function(_0x249de7,_0x3f4108){var _0x4760bb={'raw':![],'where':{'id':_0x249de7[_0x9b97('0x44')]['id']}},_0x3727ff={};_0x3727ff[_0x9b97('0x31')]=_[_0x9b97('0x45')](db['UserProfileSection'][_0x9b97('0x46')]);_0x3727ff[_0x9b97('0x2f')]=_[_0x9b97('0x45')](_0x249de7[_0x9b97('0x2f')]);_0x3727ff[_0x9b97('0x3a')]=_[_0x9b97('0x30')](_0x3727ff[_0x9b97('0x31')],_0x3727ff[_0x9b97('0x2f')]);_0x4760bb[_0x9b97('0x32')]=_[_0x9b97('0x30')](_0x3727ff[_0x9b97('0x31')],qs[_0x9b97('0x33')](_0x249de7['query'][_0x9b97('0x33')]));_0x4760bb[_0x9b97('0x32')]=_0x4760bb['attributes'][_0x9b97('0x34')]?_0x4760bb[_0x9b97('0x32')]:_0x3727ff[_0x9b97('0x31')];if(_0x249de7[_0x9b97('0x2f')][_0x9b97('0x40')]){_0x4760bb[_0x9b97('0x41')]=[{'all':!![]}];}_0x4760bb=_[_0x9b97('0x3e')]({},_0x4760bb,_0x249de7[_0x9b97('0x3f')]);return db[_0x9b97('0x2c')][_0x9b97('0x47')](_0x4760bb)['then'](handleEntityNotFound(_0x3f4108,null))[_0x9b97('0x25')](respondWithResult(_0x3f4108,null))['catch'](handleError(_0x3f4108,null));};exports['create']=function(_0x5c5501,_0x501b07){return db[_0x9b97('0x2c')][_0x9b97('0x48')](_0x5c5501['body'],{})[_0x9b97('0x25')](respondWithResult(_0x501b07,0xc9))[_0x9b97('0x43')](handleError(_0x501b07,null));};exports['update']=function(_0x3c1d25,_0x3a05a1){if(_0x3c1d25[_0x9b97('0x49')]['id']){delete _0x3c1d25[_0x9b97('0x49')]['id'];}return db['UserProfileSection'][_0x9b97('0x47')]({'where':{'id':_0x3c1d25[_0x9b97('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a05a1,null))[_0x9b97('0x25')](saveUpdates(_0x3c1d25[_0x9b97('0x49')],null))[_0x9b97('0x25')](respondWithResult(_0x3a05a1,null))['catch'](handleError(_0x3a05a1,null));};exports[_0x9b97('0x4a')]=function(_0x37f446,_0x588f75){return db[_0x9b97('0x2c')][_0x9b97('0x47')]({'where':{'id':_0x37f446[_0x9b97('0x44')]['id']}})[_0x9b97('0x25')](handleEntityNotFound(_0x588f75,null))[_0x9b97('0x25')](removeEntity(_0x588f75,null))[_0x9b97('0x43')](handleError(_0x588f75,null));};exports[_0x9b97('0x4b')]=function(_0x406f7f,_0x12cbd1){return db[_0x9b97('0x2c')]['describe']()[_0x9b97('0x25')](respondWithResult(_0x12cbd1,null))['catch'](handleError(_0x12cbd1,null));}; \ No newline at end of file +var _0x53fe=['length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','map','UserProfileSection','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes'];(function(_0x4dcd96,_0x4d789c){var _0xac77d9=function(_0xc085){while(--_0xc085){_0x4dcd96['push'](_0x4dcd96['shift']());}};_0xac77d9(++_0x4d789c);}(_0x53fe,0x1c1));var _0xe53f=function(_0x3756cd,_0x458af2){_0x3756cd=_0x3756cd-0x0;var _0x4d423a=_0x53fe[_0x3756cd];return _0x4d423a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe53f('0x0'));var zipdir=require(_0xe53f('0x1'));var jsonpatch=require(_0xe53f('0x2'));var rp=require('request-promise');var moment=require(_0xe53f('0x3'));var BPromise=require(_0xe53f('0x4'));var Mustache=require('mustache');var util=require(_0xe53f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xe53f('0x6'));var ejs=require(_0xe53f('0x7'));var fs=require('fs');var fs_extra=require(_0xe53f('0x8'));var _=require(_0xe53f('0x9'));var squel=require(_0xe53f('0xa'));var crypto=require(_0xe53f('0xb'));var jsforce=require(_0xe53f('0xc'));var deskjs=require(_0xe53f('0xd'));var toCsv=require(_0xe53f('0x6'));var querystring=require(_0xe53f('0xe'));var Papa=require('papaparse');var Redis=require(_0xe53f('0xf'));var authService=require(_0xe53f('0x10'));var qs=require(_0xe53f('0x11'));var as=require(_0xe53f('0x12'));var hardwareService=require(_0xe53f('0x13'));var logger=require(_0xe53f('0x14'))('api');var utils=require(_0xe53f('0x15'));var config=require(_0xe53f('0x16'));var licenseUtil=require(_0xe53f('0x17'));var db=require(_0xe53f('0x18'))['db'];function respondWithStatusCode(_0x2f2dff,_0x31c19f){_0x31c19f=_0x31c19f||0xcc;return function(_0x5a2e86){if(_0x5a2e86){return _0x2f2dff[_0xe53f('0x19')](_0x31c19f);}return _0x2f2dff['status'](_0x31c19f)[_0xe53f('0x1a')]();};}function respondWithResult(_0x1a36de,_0x5ccf74){_0x5ccf74=_0x5ccf74||0xc8;return function(_0x36d80c){if(_0x36d80c){return _0x1a36de[_0xe53f('0x1b')](_0x5ccf74)[_0xe53f('0x1c')](_0x36d80c);}};}function respondWithFilteredResult(_0x5dc1e0,_0x437598){return function(_0x2a9d0a){if(_0x2a9d0a){var _0x18f336=typeof _0x437598[_0xe53f('0x1d')]===_0xe53f('0x1e')&&typeof _0x437598['limit']===_0xe53f('0x1e');var _0x4b4dbe=_0x2a9d0a[_0xe53f('0x1f')];var _0x3a3a1f=_0x18f336?0x0:_0x437598['offset'];var _0x274780=_0x18f336?_0x2a9d0a[_0xe53f('0x1f')]:_0x437598[_0xe53f('0x1d')]+_0x437598[_0xe53f('0x20')];var _0x21c070;if(_0x274780>=_0x4b4dbe){_0x274780=_0x4b4dbe;_0x21c070=0xc8;}else{_0x21c070=0xce;}_0x5dc1e0['status'](_0x21c070);return _0x5dc1e0[_0xe53f('0x21')](_0xe53f('0x22'),_0x3a3a1f+'-'+_0x274780+'/'+_0x4b4dbe)[_0xe53f('0x1c')](_0x2a9d0a);}return null;};}function patchUpdates(_0xa0b11a){return function(_0x763335){try{jsonpatch[_0xe53f('0x23')](_0x763335,_0xa0b11a,!![]);}catch(_0x5266e6){return BPromise['reject'](_0x5266e6);}return _0x763335['save']();};}function saveUpdates(_0x541d06,_0x2c0168){return function(_0x4c6bf2){if(_0x4c6bf2){return _0x4c6bf2[_0xe53f('0x24')](_0x541d06)[_0xe53f('0x25')](function(_0x3a34a6){return _0x3a34a6;});}return null;};}function removeEntity(_0x132d56,_0x11e725){return function(_0x21ace3){if(_0x21ace3){return _0x21ace3[_0xe53f('0x26')]()[_0xe53f('0x25')](function(){_0x132d56['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x977773,_0x1f5880){return function(_0x32ed2f){if(!_0x32ed2f){_0x977773[_0xe53f('0x19')](0x194);}return _0x32ed2f;};}function handleError(_0x44d9b2,_0x601cde){_0x601cde=_0x601cde||0x1f4;return function(_0x4bec8f){logger[_0xe53f('0x27')](_0x4bec8f[_0xe53f('0x28')]);if(_0x4bec8f['name']){delete _0x4bec8f[_0xe53f('0x29')];}_0x44d9b2[_0xe53f('0x1b')](_0x601cde)[_0xe53f('0x2a')](_0x4bec8f);};}exports['index']=function(_0x5d6691,_0x44e978){var _0x2441c1={},_0x3bac35={},_0xbb8b4={'count':0x0,'rows':[]};var _0x5a10ab=_[_0xe53f('0x2b')](db[_0xe53f('0x2c')]['rawAttributes'],function(_0x2ec50e){return{'name':_0x2ec50e[_0xe53f('0x2d')],'type':_0x2ec50e[_0xe53f('0x2e')][_0xe53f('0x2f')]};});_0x3bac35['model']=_['map'](_0x5a10ab,_0xe53f('0x29'));_0x3bac35[_0xe53f('0x30')]=_[_0xe53f('0x31')](_0x5d6691[_0xe53f('0x30')]);_0x3bac35[_0xe53f('0x32')]=_[_0xe53f('0x33')](_0x3bac35['model'],_0x3bac35['query']);_0x2441c1['attributes']=_[_0xe53f('0x33')](_0x3bac35[_0xe53f('0x34')],qs[_0xe53f('0x35')](_0x5d6691[_0xe53f('0x30')][_0xe53f('0x35')]));_0x2441c1['attributes']=_0x2441c1[_0xe53f('0x36')][_0xe53f('0x37')]?_0x2441c1[_0xe53f('0x36')]:_0x3bac35[_0xe53f('0x34')];if(!_0x5d6691['query']['hasOwnProperty']('nolimit')){_0x2441c1['limit']=qs['limit'](_0x5d6691[_0xe53f('0x30')][_0xe53f('0x20')]);_0x2441c1[_0xe53f('0x1d')]=qs[_0xe53f('0x1d')](_0x5d6691[_0xe53f('0x30')][_0xe53f('0x1d')]);}_0x2441c1[_0xe53f('0x38')]=qs[_0xe53f('0x39')](_0x5d6691[_0xe53f('0x30')][_0xe53f('0x39')]);_0x2441c1[_0xe53f('0x3a')]=qs[_0xe53f('0x32')](_['pick'](_0x5d6691[_0xe53f('0x30')],_0x3bac35[_0xe53f('0x32')]),_0x5a10ab);if(_0x5d6691[_0xe53f('0x30')][_0xe53f('0x3b')]){_0x2441c1[_0xe53f('0x3a')]=_[_0xe53f('0x3c')](_0x2441c1[_0xe53f('0x3a')],{'$or':_[_0xe53f('0x2b')](_0x5a10ab,function(_0xaa6b44){if(_0xaa6b44[_0xe53f('0x2e')]!==_0xe53f('0x3d')){var _0x4c3a52={};_0x4c3a52[_0xaa6b44[_0xe53f('0x29')]]={'$like':'%'+_0x5d6691[_0xe53f('0x30')][_0xe53f('0x3b')]+'%'};return _0x4c3a52;}})});}_0x2441c1=_[_0xe53f('0x3c')]({},_0x2441c1,_0x5d6691[_0xe53f('0x3e')]);var _0x234885={'where':_0x2441c1[_0xe53f('0x3a')]};return db[_0xe53f('0x2c')][_0xe53f('0x1f')](_0x234885)[_0xe53f('0x25')](function(_0x20acea){_0xbb8b4[_0xe53f('0x1f')]=_0x20acea;if(_0x5d6691['query'][_0xe53f('0x3f')]){_0x2441c1[_0xe53f('0x40')]=[{'all':!![]}];}return db[_0xe53f('0x2c')][_0xe53f('0x41')](_0x2441c1);})[_0xe53f('0x25')](function(_0x16b4b9){_0xbb8b4[_0xe53f('0x42')]=_0x16b4b9;return _0xbb8b4;})['then'](respondWithFilteredResult(_0x44e978,_0x2441c1))[_0xe53f('0x43')](handleError(_0x44e978,null));};exports['show']=function(_0xab483e,_0x1cd5ba){var _0x368578={'raw':![],'where':{'id':_0xab483e[_0xe53f('0x44')]['id']}},_0x52bbe9={};_0x52bbe9[_0xe53f('0x34')]=_[_0xe53f('0x31')](db[_0xe53f('0x2c')][_0xe53f('0x45')]);_0x52bbe9['query']=_[_0xe53f('0x31')](_0xab483e['query']);_0x52bbe9[_0xe53f('0x32')]=_['intersection'](_0x52bbe9[_0xe53f('0x34')],_0x52bbe9['query']);_0x368578['attributes']=_[_0xe53f('0x33')](_0x52bbe9[_0xe53f('0x34')],qs[_0xe53f('0x35')](_0xab483e[_0xe53f('0x30')][_0xe53f('0x35')]));_0x368578[_0xe53f('0x36')]=_0x368578['attributes'][_0xe53f('0x37')]?_0x368578[_0xe53f('0x36')]:_0x52bbe9[_0xe53f('0x34')];if(_0xab483e[_0xe53f('0x30')]['includeAll']){_0x368578[_0xe53f('0x40')]=[{'all':!![]}];}_0x368578=_[_0xe53f('0x3c')]({},_0x368578,_0xab483e[_0xe53f('0x3e')]);return db[_0xe53f('0x2c')][_0xe53f('0x46')](_0x368578)[_0xe53f('0x25')](handleEntityNotFound(_0x1cd5ba,null))[_0xe53f('0x25')](respondWithResult(_0x1cd5ba,null))['catch'](handleError(_0x1cd5ba,null));};exports['create']=function(_0x5a521e,_0x552208){return db[_0xe53f('0x2c')]['create'](_0x5a521e[_0xe53f('0x47')],{})[_0xe53f('0x25')](respondWithResult(_0x552208,0xc9))['catch'](handleError(_0x552208,null));};exports[_0xe53f('0x24')]=function(_0x54f118,_0x1c2003){if(_0x54f118[_0xe53f('0x47')]['id']){delete _0x54f118[_0xe53f('0x47')]['id'];}return db['UserProfileSection'][_0xe53f('0x46')]({'where':{'id':_0x54f118[_0xe53f('0x44')]['id']}})[_0xe53f('0x25')](handleEntityNotFound(_0x1c2003,null))['then'](saveUpdates(_0x54f118['body'],null))[_0xe53f('0x25')](respondWithResult(_0x1c2003,null))[_0xe53f('0x43')](handleError(_0x1c2003,null));};exports['destroy']=function(_0x35f5a8,_0x794a70){return db['UserProfileSection'][_0xe53f('0x46')]({'where':{'id':_0x35f5a8['params']['id']}})['then'](handleEntityNotFound(_0x794a70,null))[_0xe53f('0x25')](removeEntity(_0x794a70,null))[_0xe53f('0x43')](handleError(_0x794a70,null));};exports['describe']=function(_0x2fa165,_0x5d5778){return db[_0xe53f('0x2c')]['describe']()[_0xe53f('0x25')](respondWithResult(_0x5d5778,null))[_0xe53f('0x43')](handleError(_0x5d5778,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index e38b30c..992c5ea 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 _0xb7e7=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define'];(function(_0x54080a,_0x443d2f){var _0x60a4d3=function(_0xe7413b){while(--_0xe7413b){_0x54080a['push'](_0x54080a['shift']());}};_0x60a4d3(++_0x443d2f);}(_0xb7e7,0x109));var _0x7b7e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xb7e7[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x7b7e('0x0'));var util=require(_0x7b7e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b7e('0x2'));var rimraf=require(_0x7b7e('0x3'));var config=require(_0x7b7e('0x4'));var attributes=require(_0x7b7e('0x5'));module[_0x7b7e('0x6')]=function(_0x4552ee,_0x168afb){return _0x4552ee[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':_0x7b7e('0x9'),'paranoid':![],'indexes':[{'name':_0x7b7e('0xa'),'fields':[_0x7b7e('0xb'),_0x7b7e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ab9=['rimraf','./userProfileSection.attributes','exports','user_profile_has_sections','compositeIndex','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x15af3a,_0x533393){var _0x346d4=function(_0x49e954){while(--_0x49e954){_0x15af3a['push'](_0x15af3a['shift']());}};_0x346d4(++_0x533393);}(_0x4ab9,0x88));var _0x94ab=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4ab9[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x94ab('0x0'));var util=require(_0x94ab('0x1'));var logger=require(_0x94ab('0x2'))(_0x94ab('0x3'));var moment=require('moment');var BPromise=require(_0x94ab('0x4'));var rp=require(_0x94ab('0x5'));var fs=require('fs');var path=require(_0x94ab('0x6'));var rimraf=require(_0x94ab('0x7'));var config=require('../../config/environment');var attributes=require(_0x94ab('0x8'));module[_0x94ab('0x9')]=function(_0x716397,_0x47f07b){return _0x716397['define']('UserProfileSection',attributes,{'tableName':_0x94ab('0xa'),'paranoid':![],'indexes':[{'name':_0x94ab('0xb'),'fields':[_0x94ab('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index b63cd4b..5b3c221 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 _0x8cb5=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4349f9,_0xa0cd6d){var _0xd8f535=function(_0x42bc6e){while(--_0x42bc6e){_0x4349f9['push'](_0x4349f9['shift']());}};_0xd8f535(++_0xa0cd6d);}(_0x8cb5,0x19f));var _0x58cb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8cb5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x58cb('0x0'));var util=require(_0x58cb('0x1'));var moment=require(_0x58cb('0x2'));var BPromise=require(_0x58cb('0x3'));var rs=require(_0x58cb('0x4'));var fs=require('fs');var Redis=require(_0x58cb('0x5'));var db=require(_0x58cb('0x6'))['db'];var utils=require(_0x58cb('0x7'));var logger=require('../../config/logger')(_0x58cb('0x8'));var config=require(_0x58cb('0x9'));var jayson=require(_0x58cb('0xa'));var client=jayson[_0x58cb('0xb')][_0x58cb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x395817,_0x25f834,_0x5bf342){return new BPromise(function(_0x5f1000,_0x2cda8f){return client[_0x58cb('0xd')](_0x395817,_0x5bf342)['then'](function(_0x160a19){logger[_0x58cb('0xe')](_0x58cb('0xf'),_0x25f834,_0x58cb('0x10'));logger[_0x58cb('0x11')](_0x58cb('0x12'),_0x25f834,'request\x20sent',JSON[_0x58cb('0x13')](_0x160a19));if(_0x160a19[_0x58cb('0x14')]){if(_0x160a19['error'][_0x58cb('0x15')]===0x1f4){logger[_0x58cb('0x14')](_0x58cb('0xf'),_0x25f834,_0x160a19[_0x58cb('0x14')][_0x58cb('0x16')]);return _0x2cda8f(_0x160a19[_0x58cb('0x14')][_0x58cb('0x16')]);}logger[_0x58cb('0x14')](_0x58cb('0xf'),_0x25f834,_0x160a19[_0x58cb('0x14')]['message']);return _0x5f1000(_0x160a19[_0x58cb('0x14')]['message']);}else{logger[_0x58cb('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x25f834,_0x58cb('0x10'));_0x5f1000(_0x160a19['result']['message']);}})['catch'](function(_0x2bbb0f){logger[_0x58cb('0x14')](_0x58cb('0xf'),_0x25f834,_0x2bbb0f);_0x2cda8f(_0x2bbb0f);});});} \ No newline at end of file +var _0x12c5=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','error','code','result','message','catch'];(function(_0x49aa7d,_0x5d46d8){var _0xdd0d26=function(_0x159df7){while(--_0x159df7){_0x49aa7d['push'](_0x49aa7d['shift']());}};_0xdd0d26(++_0x5d46d8);}(_0x12c5,0xbe));var _0x512c=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x12c5[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0x512c('0x0'));var moment=require(_0x512c('0x1'));var BPromise=require(_0x512c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x512c('0x3'));var db=require(_0x512c('0x4'))['db'];var utils=require(_0x512c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x512c('0x6'));var client=jayson[_0x512c('0x7')][_0x512c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbf6786,_0x243b24,_0xaa28b2){return new BPromise(function(_0x70da08,_0x5c5804){return client['request'](_0xbf6786,_0xaa28b2)[_0x512c('0x9')](function(_0x1201a5){logger[_0x512c('0xa')](_0x512c('0xb'),_0x243b24,_0x512c('0xc'));logger[_0x512c('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x243b24,'request\x20sent',JSON['stringify'](_0x1201a5));if(_0x1201a5[_0x512c('0xe')]){if(_0x1201a5['error'][_0x512c('0xf')]===0x1f4){logger[_0x512c('0xe')](_0x512c('0xb'),_0x243b24,_0x1201a5[_0x512c('0xe')]['message']);return _0x5c5804(_0x1201a5[_0x512c('0xe')]['message']);}logger[_0x512c('0xe')](_0x512c('0xb'),_0x243b24,_0x1201a5['error']['message']);return _0x70da08(_0x1201a5[_0x512c('0xe')]['message']);}else{logger[_0x512c('0xa')](_0x512c('0xb'),_0x243b24,_0x512c('0xc'));_0x70da08(_0x1201a5[_0x512c('0x10')][_0x512c('0x11')]);}})[_0x512c('0x12')](function(_0x1eaabd){logger[_0x512c('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x243b24,_0x1eaabd);_0x5c5804(_0x1eaabd);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 6969018..2464c62 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2c40bf,_0x5ce37a){var _0x31ab19=function(_0x56303){while(--_0x56303){_0x2c40bf['push'](_0x2c40bf['shift']());}};_0x31ab19(++_0x5ce37a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4490a9,_0x1d4898){var _0x52288a=function(_0x44d3bf){while(--_0x44d3bf){_0x4490a9['push'](_0x4490a9['shift']());}};_0x52288a(++_0x1d4898);}(_0xe706,0xa3));var _0x6e70=function(_0x46df63,_0x5cbc34){_0x46df63=_0x46df63-0x0;var _0x236616=_0xe706[_0x46df63];return _0x236616;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 236edd5..4c4c184 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 _0x63b1=['sequelize','exports','INTEGER'];(function(_0x2a0453,_0x7736d){var _0x2585af=function(_0xb183c1){while(--_0xb183c1){_0x2a0453['push'](_0x2a0453['shift']());}};_0x2585af(++_0x7736d);}(_0x63b1,0x96));var _0x163b=function(_0x1b8f21,_0x46d1a7){_0x1b8f21=_0x1b8f21-0x0;var _0x35734c=_0x63b1[_0x1b8f21];return _0x35734c;};'use strict';var Sequelize=require(_0x163b('0x0'));module[_0x163b('0x1')]={'penalty':{'type':Sequelize[_0x163b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe1da=['INTEGER'];(function(_0x16eb81,_0x25e808){var _0x5a8b46=function(_0x454b9d){while(--_0x454b9d){_0x16eb81['push'](_0x16eb81['shift']());}};_0x5a8b46(++_0x25e808);}(_0xe1da,0x8e));var _0xae1d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe1da[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xae1d('0x0')],'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 0ba4d57..e2e9b4b 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 _0xc1c6=['moment','request-promise','path','rimraf','exports','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger'];(function(_0x5116a5,_0x135a62){var _0x43b40d=function(_0x5f2b9e){while(--_0x5f2b9e){_0x5116a5['push'](_0x5116a5['shift']());}};_0x43b40d(++_0x135a62);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x465769,_0x356643){_0x465769=_0x465769-0x0;var _0xd4992d=_0xc1c6[_0x465769];return _0xd4992d;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0x6c1c('0x7')]=function(_0x524a6b,_0x50c1bb){return _0x524a6b['define'](_0x6c1c('0x8'),attributes,{'tableName':_0x6c1c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57ca=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x199ee6,_0x5f1bff){var _0x19c498=function(_0x3ad656){while(--_0x3ad656){_0x199ee6['push'](_0x199ee6['shift']());}};_0x19c498(++_0x5f1bff);}(_0x57ca,0x108));var _0xa57c=function(_0x3eb2e5,_0x2e8968){_0x3eb2e5=_0x3eb2e5-0x0;var _0xb44cd4=_0x57ca[_0x3eb2e5];return _0xb44cd4;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index dc717d5..a8f1e7d 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 _0x111e=['UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','info','request\x20sent','debug'];(function(_0x561049,_0x330926){var _0x52f109=function(_0x1a5d24){while(--_0x1a5d24){_0x561049['push'](_0x561049['shift']());}};_0x52f109(++_0x330926);}(_0x111e,0x197));var _0xe111=function(_0x110389,_0xaecc24){_0x110389=_0x110389-0x0;var _0x1250bc=_0x111e[_0x110389];return _0x1250bc;};'use strict';var _=require('lodash');var util=require(_0xe111('0x0'));var moment=require(_0xe111('0x1'));var BPromise=require(_0xe111('0x2'));var rs=require(_0xe111('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe111('0x4'))['db'];var utils=require(_0xe111('0x5'));var logger=require('../../config/logger')(_0xe111('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe111('0x7')][_0xe111('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47371e,_0x13aea0,_0x44710d){return new BPromise(function(_0x55ee7b,_0xb86f76){return client[_0xe111('0x9')](_0x47371e,_0x44710d)['then'](function(_0xe268d4){logger[_0xe111('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x13aea0,_0xe111('0xb'));logger[_0xe111('0xc')](_0xe111('0xd'),_0x13aea0,_0xe111('0xb'),JSON[_0xe111('0xe')](_0xe268d4));if(_0xe268d4['error']){if(_0xe268d4[_0xe111('0xf')][_0xe111('0x10')]===0x1f4){logger[_0xe111('0xf')](_0xe111('0x11'),_0x13aea0,_0xe268d4['error'][_0xe111('0x12')]);return _0xb86f76(_0xe268d4[_0xe111('0xf')][_0xe111('0x12')]);}logger[_0xe111('0xf')](_0xe111('0x11'),_0x13aea0,_0xe268d4[_0xe111('0xf')][_0xe111('0x12')]);return _0x55ee7b(_0xe268d4[_0xe111('0xf')]['message']);}else{logger['info'](_0xe111('0x11'),_0x13aea0,_0xe111('0xb'));_0x55ee7b(_0xe268d4[_0xe111('0x13')]['message']);}})['catch'](function(_0x26abb3){logger['error'](_0xe111('0x11'),_0x13aea0,_0x26abb3);_0xb86f76(_0x26abb3);});});} \ No newline at end of file +var _0xc412=['../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserSmsQueue,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1d1e51,_0xeba0bb){var _0x329526=function(_0x4c4996){while(--_0x4c4996){_0x1d1e51['push'](_0x1d1e51['shift']());}};_0x329526(++_0xeba0bb);}(_0xc412,0x86));var _0x2c41=function(_0x9f3ef4,_0x4f4f2c){_0x9f3ef4=_0x9f3ef4-0x0;var _0x542d39=_0xc412[_0x9f3ef4];return _0x542d39;};'use strict';var _=require(_0x2c41('0x0'));var util=require('util');var moment=require(_0x2c41('0x1'));var BPromise=require(_0x2c41('0x2'));var rs=require(_0x2c41('0x3'));var fs=require('fs');var Redis=require(_0x2c41('0x4'));var db=require(_0x2c41('0x5'))['db'];var utils=require(_0x2c41('0x6'));var logger=require(_0x2c41('0x7'))(_0x2c41('0x8'));var config=require(_0x2c41('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x448ae1,_0x7d7fdb,_0x539b3f){return new BPromise(function(_0x3dbb1f,_0x5c4d05){return client[_0x2c41('0xa')](_0x448ae1,_0x539b3f)[_0x2c41('0xb')](function(_0xb17998){logger[_0x2c41('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x7d7fdb,'request\x20sent');logger[_0x2c41('0xd')](_0x2c41('0xe'),_0x7d7fdb,'request\x20sent',JSON[_0x2c41('0xf')](_0xb17998));if(_0xb17998[_0x2c41('0x10')]){if(_0xb17998['error']['code']===0x1f4){logger[_0x2c41('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x7d7fdb,_0xb17998[_0x2c41('0x10')]['message']);return _0x5c4d05(_0xb17998['error'][_0x2c41('0x11')]);}logger['error'](_0x2c41('0x12'),_0x7d7fdb,_0xb17998[_0x2c41('0x10')][_0x2c41('0x11')]);return _0x3dbb1f(_0xb17998[_0x2c41('0x10')]['message']);}else{logger[_0x2c41('0xc')](_0x2c41('0x12'),_0x7d7fdb,'request\x20sent');_0x3dbb1f(_0xb17998[_0x2c41('0x13')]['message']);}})['catch'](function(_0x455161){logger[_0x2c41('0x10')](_0x2c41('0x12'),_0x7d7fdb,_0x455161);_0x5c4d05(_0x455161);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 3e8fe3e..dc4a60c 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 _0x29ed=['INTEGER'];(function(_0x279cfd,_0x2622fa){var _0x302053=function(_0x369e04){while(--_0x369e04){_0x279cfd['push'](_0x279cfd['shift']());}};_0x302053(++_0x2622fa);}(_0x29ed,0x19a));var _0xd29e=function(_0x2d81b5,_0x50a8a9){_0x2d81b5=_0x2d81b5-0x0;var _0x27b3c4=_0x29ed[_0x2d81b5];return _0x27b3c4;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xd29e('0x0')]}}; \ No newline at end of file +var _0x8484=['INTEGER','sequelize','exports'];(function(_0x729846,_0x5070d4){var _0x1af816=function(_0x52f4af){while(--_0x52f4af){_0x729846['push'](_0x729846['shift']());}};_0x1af816(++_0x5070d4);}(_0x8484,0x133));var _0x4848=function(_0x10425a,_0xfc52f){_0x10425a=_0x10425a-0x0;var _0x212487=_0x8484[_0x10425a];return _0x212487;};'use strict';var Sequelize=require(_0x4848('0x0'));module[_0x4848('0x1')]={'UserId':{'type':Sequelize[_0x4848('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x4848('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 15999a8..7b23ddc 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(_0x8dcccf,_0x39aef0){var _0x34440d=function(_0x5ccbc8){while(--_0x5ccbc8){_0x8dcccf['push'](_0x8dcccf['shift']());}};_0x34440d(++_0x39aef0);}(_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(_0x127c2c,_0x58bd63){var _0x16be19=function(_0x127097){while(--_0x127097){_0x127c2c['push'](_0x127c2c['shift']());}};_0x16be19(++_0x58bd63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 1a3032f..a24d7ed 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x490c1a,_0x2bfa23){var _0x21822f=function(_0x335784){while(--_0x335784){_0x490c1a['push'](_0x490c1a['shift']());}};_0x21822f(++_0x2bfa23);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x275efd,_0x21d254){var _0x5c1658=function(_0x315c20){while(--_0x315c20){_0x275efd['push'](_0x275efd['shift']());}};_0x5c1658(++_0x21d254);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0xcb91[_0x54b283];return _0x2462b3;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index c27bc7a..cb4bdbd 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 _0xbd19=['sequelize','exports','INTEGER'];(function(_0x506d1c,_0x5136fd){var _0x387d7b=function(_0x4ff693){while(--_0x4ff693){_0x506d1c['push'](_0x506d1c['shift']());}};_0x387d7b(++_0x5136fd);}(_0xbd19,0x9c));var _0x9bd1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbd19[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9bd1('0x0'));module[_0x9bd1('0x1')]={'penalty':{'type':Sequelize[_0x9bd1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfc26=['INTEGER','sequelize'];(function(_0x47e6ef,_0x5edfc2){var _0x4edd69=function(_0x51d70d){while(--_0x51d70d){_0x47e6ef['push'](_0x47e6ef['shift']());}};_0x4edd69(++_0x5edfc2);}(_0xfc26,0x115));var _0x6fc2=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xfc26[_0x40a825];return _0x273a54;};'use strict';var Sequelize=require(_0x6fc2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6fc2('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 0800092..da68c68 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 _0x6c18=['UserVoiceQueue','user_has_voice_queues','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','define'];(function(_0x5ceaa5,_0x7150be){var _0x578994=function(_0x35d3ad){while(--_0x35d3ad){_0x5ceaa5['push'](_0x5ceaa5['shift']());}};_0x578994(++_0x7150be);}(_0x6c18,0x1a6));var _0x86c1=function(_0x4ca137,_0x18072d){_0x4ca137=_0x4ca137-0x0;var _0x430477=_0x6c18[_0x4ca137];return _0x430477;};'use strict';var _=require('lodash');var util=require(_0x86c1('0x0'));var logger=require(_0x86c1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x86c1('0x2'));var rp=require(_0x86c1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86c1('0x4'));var config=require(_0x86c1('0x5'));var attributes=require(_0x86c1('0x6'));module['exports']=function(_0x3bd87c,_0x412c8d){return _0x3bd87c[_0x86c1('0x7')](_0x86c1('0x8'),attributes,{'tableName':_0x86c1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf036=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xe75d24,_0x54f93b){var _0x4d2587=function(_0x1e5fc9){while(--_0x1e5fc9){_0xe75d24['push'](_0xe75d24['shift']());}};_0x4d2587(++_0x54f93b);}(_0xf036,0x122));var _0x6f03=function(_0xb595d5,_0x4128c0){_0xb595d5=_0xb595d5-0x0;var _0x466fb5=_0xf036[_0xb595d5];return _0x466fb5;};'use strict';var _=require(_0x6f03('0x0'));var util=require(_0x6f03('0x1'));var logger=require(_0x6f03('0x2'))(_0x6f03('0x3'));var moment=require(_0x6f03('0x4'));var BPromise=require(_0x6f03('0x5'));var rp=require(_0x6f03('0x6'));var fs=require('fs');var path=require(_0x6f03('0x7'));var rimraf=require(_0x6f03('0x8'));var config=require(_0x6f03('0x9'));var attributes=require(_0x6f03('0xa'));module[_0x6f03('0xb')]=function(_0x113455,_0x366ae7){return _0x113455[_0x6f03('0xc')](_0x6f03('0xd'),attributes,{'tableName':_0x6f03('0xe'),'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 ed5f29e..beac97e 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 _0xaa8b=['client','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5cbd7b,_0x207439){var _0x3fdfb8=function(_0x4eb12e){while(--_0x4eb12e){_0x5cbd7b['push'](_0x5cbd7b['shift']());}};_0x3fdfb8(++_0x207439);}(_0xaa8b,0x1f2));var _0xbaa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa8b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbaa8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbaa8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbaa8('0x2'));var db=require(_0xbaa8('0x3'))['db'];var utils=require(_0xbaa8('0x4'));var logger=require('../../config/logger')(_0xbaa8('0x5'));var config=require(_0xbaa8('0x6'));var jayson=require(_0xbaa8('0x7'));var client=jayson[_0xbaa8('0x8')][_0xbaa8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fa1c7,_0x5c995d,_0x574ac3){return new BPromise(function(_0x2a85a4,_0x15ad10){return client[_0xbaa8('0xa')](_0x3fa1c7,_0x574ac3)[_0xbaa8('0xb')](function(_0x538ef2){logger[_0xbaa8('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x5c995d,_0xbaa8('0xd'));logger[_0xbaa8('0xe')](_0xbaa8('0xf'),_0x5c995d,_0xbaa8('0xd'),JSON[_0xbaa8('0x10')](_0x538ef2));if(_0x538ef2[_0xbaa8('0x11')]){if(_0x538ef2['error'][_0xbaa8('0x12')]===0x1f4){logger[_0xbaa8('0x11')](_0xbaa8('0x13'),_0x5c995d,_0x538ef2['error'][_0xbaa8('0x14')]);return _0x15ad10(_0x538ef2[_0xbaa8('0x11')]['message']);}logger[_0xbaa8('0x11')](_0xbaa8('0x13'),_0x5c995d,_0x538ef2['error']['message']);return _0x2a85a4(_0x538ef2[_0xbaa8('0x11')][_0xbaa8('0x14')]);}else{logger[_0xbaa8('0xc')](_0xbaa8('0x13'),_0x5c995d,_0xbaa8('0xd'));_0x2a85a4(_0x538ef2[_0xbaa8('0x15')][_0xbaa8('0x14')]);}})[_0xbaa8('0x16')](function(_0x34ba9f){logger[_0xbaa8('0x11')](_0xbaa8('0x13'),_0x5c995d,_0x34ba9f);_0x15ad10(_0x34ba9f);});});} \ No newline at end of file +var _0x6f14=['http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4a66fc,_0x2da159){var _0x5d74cb=function(_0x1c2008){while(--_0x1c2008){_0x4a66fc['push'](_0x4a66fc['shift']());}};_0x5d74cb(++_0x2da159);}(_0x6f14,0xae));var _0x46f1=function(_0x1ae139,_0x529c60){_0x1ae139=_0x1ae139-0x0;var _0x5e0de7=_0x6f14[_0x1ae139];return _0x5e0de7;};'use strict';var _=require(_0x46f1('0x0'));var util=require(_0x46f1('0x1'));var moment=require(_0x46f1('0x2'));var BPromise=require(_0x46f1('0x3'));var rs=require(_0x46f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46f1('0x5'))['db'];var utils=require(_0x46f1('0x6'));var logger=require(_0x46f1('0x7'))(_0x46f1('0x8'));var config=require(_0x46f1('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x46f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52b8bf,_0x309de0,_0x4a5c83){return new BPromise(function(_0x15fcec,_0x3b878c){return client[_0x46f1('0xb')](_0x52b8bf,_0x4a5c83)[_0x46f1('0xc')](function(_0x2fa921){logger[_0x46f1('0xd')](_0x46f1('0xe'),_0x309de0,_0x46f1('0xf'));logger[_0x46f1('0x10')](_0x46f1('0x11'),_0x309de0,_0x46f1('0xf'),JSON[_0x46f1('0x12')](_0x2fa921));if(_0x2fa921[_0x46f1('0x13')]){if(_0x2fa921['error']['code']===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x309de0,_0x2fa921[_0x46f1('0x13')][_0x46f1('0x14')]);return _0x3b878c(_0x2fa921[_0x46f1('0x13')][_0x46f1('0x14')]);}logger[_0x46f1('0x13')](_0x46f1('0xe'),_0x309de0,_0x2fa921[_0x46f1('0x13')][_0x46f1('0x14')]);return _0x15fcec(_0x2fa921[_0x46f1('0x13')][_0x46f1('0x14')]);}else{logger[_0x46f1('0xd')](_0x46f1('0xe'),_0x309de0,_0x46f1('0xf'));_0x15fcec(_0x2fa921[_0x46f1('0x15')][_0x46f1('0x14')]);}})[_0x46f1('0x16')](function(_0x41a6a1){logger[_0x46f1('0x13')](_0x46f1('0xe'),_0x309de0,_0x41a6a1);_0x3b878c(_0x41a6a1);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index e021ec3..d263c48 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3596c7,_0x52a437){var _0x509708=function(_0x2eb328){while(--_0x2eb328){_0x3596c7['push'](_0x3596c7['shift']());}};_0x509708(++_0x52a437);}(_0x70e0,0x17b));var _0x070e=function(_0x19435b,_0x14795b){_0x19435b=_0x19435b-0x0;var _0x36b284=_0x70e0[_0x19435b];return _0x36b284;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x342a51,_0x328b38){var _0x460932=function(_0x140d2f){while(--_0x140d2f){_0x342a51['push'](_0x342a51['shift']());}};_0x460932(++_0x328b38);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0xcb91[_0x5678b5];return _0x4c09a5;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 38df396..271c3fc 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 _0x7bdb=['INTEGER','STRING','queue_interface','Required\x20by\x20Asterisk'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x7bdb,0x11f));var _0xb7bd=function(_0x93f2d,_0x56e902){_0x93f2d=_0x93f2d-0x0;var _0x1ce7dd=_0x7bdb[_0x93f2d];return _0x1ce7dd;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb7bd('0x0')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xb7bd('0x0')},'UserId':{'type':Sequelize[_0xb7bd('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xb7bd('0x0')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xb7bd('0x2')],'allowNull':![],'unique':_0xb7bd('0x3'),'comment':_0xb7bd('0x0')},'penalty':{'type':Sequelize[_0xb7bd('0x1')](0xb),'defaultValue':0x0,'comment':_0xb7bd('0x0')},'paused':{'type':Sequelize[_0xb7bd('0x1')](0xb),'defaultValue':0x0,'comment':_0xb7bd('0x0')}}; \ No newline at end of file +var _0x7f05=['INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize','exports'];(function(_0x524021,_0x25d5ea){var _0x269c3e=function(_0x2418a5){while(--_0x2418a5){_0x524021['push'](_0x524021['shift']());}};_0x269c3e(++_0x25d5ea);}(_0x7f05,0xdc));var _0x57f0=function(_0x150e35,_0x456970){_0x150e35=_0x150e35-0x0;var _0xee8378=_0x7f05[_0x150e35];return _0xee8378;};'use strict';var Sequelize=require(_0x57f0('0x0'));module[_0x57f0('0x1')]={'uniqueid':{'type':Sequelize[_0x57f0('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x57f0('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x57f0('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x57f0('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x57f0('0x4')},'VoiceQueueId':{'type':Sequelize[_0x57f0('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x57f0('0x5'),'comment':_0x57f0('0x4')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x57f0('0x4')},'paused':{'type':Sequelize[_0x57f0('0x2')](0xb),'defaultValue':0x0,'comment':_0x57f0('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index b2b28f0..7112012 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 _0xdaec=['save','update','remove','emit','hasOwnProperty','../../mysqldb','UserVoiceQueueRt'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xdaec,0x140));var _0xcdae=function(_0x2ec7f2,_0xe24da3){_0x2ec7f2=_0x2ec7f2-0x0;var _0x29de00=_0xdaec[_0x2ec7f2];return _0x29de00;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xcdae('0x0'))['db'][_0xcdae('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcdae('0x2'),'afterUpdate':_0xcdae('0x3'),'afterDestroy':_0xcdae('0x4')};function emitEvent(_0x20dc7a){return function(_0x132eab,_0x35011f,_0x3c835e){UserVoiceQueueRtEvents[_0xcdae('0x5')](_0x20dc7a+':'+_0x132eab['id'],_0x132eab);UserVoiceQueueRtEvents[_0xcdae('0x5')](_0x20dc7a,_0x132eab);_0x3c835e(null);};}for(var e in events){if(events[_0xcdae('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x72ba=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x123092,_0x4655bc){var _0x2816cc=function(_0x106014){while(--_0x106014){_0x123092['push'](_0x123092['shift']());}};_0x2816cc(++_0x4655bc);}(_0x72ba,0xc7));var _0xa72b=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x72ba[_0x5c2c7c];return _0xea7ffe;};'use strict';var EventEmitter=require(_0xa72b('0x0'));var UserVoiceQueueRt=require(_0xa72b('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa72b('0x2')](0x0);var events={'afterCreate':_0xa72b('0x3'),'afterUpdate':_0xa72b('0x4'),'afterDestroy':_0xa72b('0x5')};function emitEvent(_0x414481){return function(_0x41eb82,_0x2cb488,_0x439818){UserVoiceQueueRtEvents['emit'](_0x414481+':'+_0x41eb82['id'],_0x41eb82);UserVoiceQueueRtEvents[_0xa72b('0x6')](_0x414481,_0x41eb82);_0x439818(null);};}for(var e in events){if(events[_0xa72b('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xa72b('0x8')](e,emitEvent(event));}}module[_0xa72b('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index f9fffae..d27a43d 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 _0x2608=['request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','bluebird'];(function(_0x55d2da,_0x3067c6){var _0x21f2f7=function(_0x481fd5){while(--_0x481fd5){_0x55d2da['push'](_0x55d2da['shift']());}};_0x21f2f7(++_0x3067c6);}(_0x2608,0x1a1));var _0x8260=function(_0x262b2c,_0x2c9cbe){_0x262b2c=_0x262b2c-0x0;var _0x3e65da=_0x2608[_0x262b2c];return _0x3e65da;};'use strict';var _=require(_0x8260('0x0'));var util=require('util');var logger=require(_0x8260('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8260('0x2'));var rp=require(_0x8260('0x3'));var fs=require('fs');var path=require(_0x8260('0x4'));var rimraf=require(_0x8260('0x5'));var config=require(_0x8260('0x6'));var attributes=require(_0x8260('0x7'));module['exports']=function(_0x35f0fc,_0x3bbcdc){return _0x35f0fc['define'](_0x8260('0x8'),attributes,{'tableName':_0x8260('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61d4=['api','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x11ddab,_0x101b93){var _0x407465=function(_0x20e453){while(--_0x20e453){_0x11ddab['push'](_0x11ddab['shift']());}};_0x407465(++_0x101b93);}(_0x61d4,0x194));var _0x461d=function(_0xb46ba,_0x2e2cc1){_0xb46ba=_0xb46ba-0x0;var _0x3b76a8=_0x61d4[_0xb46ba];return _0x3b76a8;};'use strict';var _=require(_0x461d('0x0'));var util=require(_0x461d('0x1'));var logger=require(_0x461d('0x2'))(_0x461d('0x3'));var moment=require('moment');var BPromise=require(_0x461d('0x4'));var rp=require(_0x461d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x461d('0x6'));var config=require(_0x461d('0x7'));var attributes=require(_0x461d('0x8'));module['exports']=function(_0x5086fc,_0x1c1ef9){return _0x5086fc['define'](_0x461d('0x9'),attributes,{'tableName':_0x461d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 21378c0..11de09a 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 _0x36df=['register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','findAll','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket'];(function(_0x25d2fb,_0x18a774){var _0x1ded53=function(_0x4c0715){while(--_0x4c0715){_0x25d2fb['push'](_0x25d2fb['shift']());}};_0x1ded53(++_0x18a774);}(_0x36df,0x11f));var _0xf36d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x36df[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xf36d('0x0'));var util=require(_0xf36d('0x1'));var moment=require('moment');var BPromise=require(_0xf36d('0x2'));var rs=require(_0xf36d('0x3'));var fs=require('fs');var Redis=require(_0xf36d('0x4'));var db=require(_0xf36d('0x5'))['db'];var utils=require(_0xf36d('0x6'));var logger=require(_0xf36d('0x7'))(_0xf36d('0x8'));var config=require('../../config/environment');var jayson=require(_0xf36d('0x9'));var client=jayson[_0xf36d('0xa')][_0xf36d('0xb')]({'port':0x232a});config[_0xf36d('0xc')]=_[_0xf36d('0xd')](config[_0xf36d('0xc')],{'host':_0xf36d('0xe'),'port':0x18eb});var socket=require(_0xf36d('0xf'))(new Redis(config[_0xf36d('0xc')]));require(_0xf36d('0x10'))[_0xf36d('0x11')](socket);function respondWithRpcPromise(_0x3779cf,_0x1ee279,_0x2b9d97){return new BPromise(function(_0x5bd1ea,_0x222c7c){return client['request'](_0x3779cf,_0x2b9d97)[_0xf36d('0x12')](function(_0x4f433d){logger[_0xf36d('0x13')](_0xf36d('0x14'),_0x1ee279,'request\x20sent');logger[_0xf36d('0x15')](_0xf36d('0x16'),_0x1ee279,_0xf36d('0x17'),JSON[_0xf36d('0x18')](_0x4f433d));if(_0x4f433d[_0xf36d('0x19')]){if(_0x4f433d[_0xf36d('0x19')][_0xf36d('0x1a')]===0x1f4){logger[_0xf36d('0x19')](_0xf36d('0x14'),_0x1ee279,_0x4f433d[_0xf36d('0x19')][_0xf36d('0x1b')]);return _0x222c7c(_0x4f433d[_0xf36d('0x19')][_0xf36d('0x1b')]);}logger[_0xf36d('0x19')](_0xf36d('0x14'),_0x1ee279,_0x4f433d[_0xf36d('0x19')]['message']);return _0x5bd1ea(_0x4f433d[_0xf36d('0x19')][_0xf36d('0x1b')]);}else{logger['info'](_0xf36d('0x14'),_0x1ee279,_0xf36d('0x17'));_0x5bd1ea(_0x4f433d[_0xf36d('0x1c')]['message']);}})['catch'](function(_0x1286e0){logger['error'](_0xf36d('0x14'),_0x1ee279,_0x1286e0);_0x222c7c(_0x1286e0);});});}exports['GetVoiceQueueRtPauses']=function(_0x493663){var _0x1a2297=this;return new Promise(function(_0x1fce4b,_0x588ba0){return db['UserVoiceQueueRt'][_0xf36d('0x1d')]({'raw':_0x493663[_0xf36d('0x1e')]?_0x493663[_0xf36d('0x1e')][_0xf36d('0x1f')]===undefined?!![]:![]:!![],'where':_0x493663['options']?_0x493663[_0xf36d('0x1e')]['where']||null:null,'attributes':[[db[_0xf36d('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf36d('0x20')][_0xf36d('0x21')](_0xf36d('0x22')))),_0xf36d('0x23')]]})['then'](function(_0x5591b7){logger[_0xf36d('0x13')](_0xf36d('0x24'),_0x493663);logger[_0xf36d('0x15')](_0xf36d('0x24'),_0x493663,JSON[_0xf36d('0x18')](_0x5591b7));_0x1fce4b(_0x5591b7);})[_0xf36d('0x25')](function(_0x2d1523){logger['error']('GetVoiceQueueRtPauses',_0x2d1523[_0xf36d('0x1b')],_0x493663);_0x588ba0(_0x1a2297[_0xf36d('0x19')](0x1f4,_0x2d1523[_0xf36d('0x1b')]));});});}; \ No newline at end of file +var _0xa613=['result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x353637,_0x4c3526){var _0x4d2503=function(_0x414ba){while(--_0x414ba){_0x353637['push'](_0x353637['shift']());}};_0x4d2503(++_0x4c3526);}(_0xa613,0x107));var _0x3a61=function(_0x1443be,_0x31b17d){_0x1443be=_0x1443be-0x0;var _0x38823d=_0xa613[_0x1443be];return _0x38823d;};'use strict';var _=require(_0x3a61('0x0'));var util=require(_0x3a61('0x1'));var moment=require(_0x3a61('0x2'));var BPromise=require(_0x3a61('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a61('0x4'));var db=require(_0x3a61('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a61('0x6'));var config=require('../../config/environment');var jayson=require(_0x3a61('0x7'));var client=jayson[_0x3a61('0x8')][_0x3a61('0x9')]({'port':0x232a});config[_0x3a61('0xa')]=_['defaults'](config[_0x3a61('0xa')],{'host':_0x3a61('0xb'),'port':0x18eb});var socket=require(_0x3a61('0xc'))(new Redis(config['redis']));require(_0x3a61('0xd'))[_0x3a61('0xe')](socket);function respondWithRpcPromise(_0x52f7dc,_0x5d31e2,_0x4dce69){return new BPromise(function(_0x57556f,_0x1ac814){return client['request'](_0x52f7dc,_0x4dce69)[_0x3a61('0xf')](function(_0x5cdab4){logger[_0x3a61('0x10')](_0x3a61('0x11'),_0x5d31e2,'request\x20sent');logger[_0x3a61('0x12')](_0x3a61('0x13'),_0x5d31e2,'request\x20sent',JSON[_0x3a61('0x14')](_0x5cdab4));if(_0x5cdab4[_0x3a61('0x15')]){if(_0x5cdab4[_0x3a61('0x15')][_0x3a61('0x16')]===0x1f4){logger[_0x3a61('0x15')](_0x3a61('0x11'),_0x5d31e2,_0x5cdab4['error'][_0x3a61('0x17')]);return _0x1ac814(_0x5cdab4['error'][_0x3a61('0x17')]);}logger[_0x3a61('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5d31e2,_0x5cdab4[_0x3a61('0x15')]['message']);return _0x57556f(_0x5cdab4['error']['message']);}else{logger[_0x3a61('0x10')](_0x3a61('0x11'),_0x5d31e2,_0x3a61('0x18'));_0x57556f(_0x5cdab4[_0x3a61('0x19')][_0x3a61('0x17')]);}})[_0x3a61('0x1a')](function(_0x48c852){logger['error'](_0x3a61('0x11'),_0x5d31e2,_0x48c852);_0x1ac814(_0x48c852);});});}exports[_0x3a61('0x1b')]=function(_0x57c325){var _0x4a9d0c=this;return new Promise(function(_0x599f15,_0x37237f){return db['UserVoiceQueueRt'][_0x3a61('0x1c')]({'raw':_0x57c325['options']?_0x57c325[_0x3a61('0x1d')][_0x3a61('0x1e')]===undefined?!![]:![]:!![],'where':_0x57c325['options']?_0x57c325['options'][_0x3a61('0x1f')]||null:null,'attributes':[[db[_0x3a61('0x20')]['fn'](_0x3a61('0x21'),db[_0x3a61('0x20')]['fn']('IF',db[_0x3a61('0x20')]['literal'](_0x3a61('0x22')))),_0x3a61('0x23')]]})['then'](function(_0x22fead){logger['info'](_0x3a61('0x1b'),_0x57c325);logger['debug'](_0x3a61('0x1b'),_0x57c325,JSON[_0x3a61('0x14')](_0x22fead));_0x599f15(_0x22fead);})['catch'](function(_0x17ff92){logger[_0x3a61('0x15')]('GetVoiceQueueRtPauses',_0x17ff92['message'],_0x57c325);_0x37237f(_0x4a9d0c[_0x3a61('0x15')](0x1f4,_0x17ff92[_0x3a61('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 84a3553..1f2776a 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 _0xff22=['./userVoiceQueueRt.events','save','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x413138,_0xc67337){var _0x2980e5=function(_0x494b5f){while(--_0x494b5f){_0x413138['push'](_0x413138['shift']());}};_0x2980e5(++_0xc67337);}(_0xff22,0x1a0));var _0x2ff2=function(_0x184edf,_0x21e0a6){_0x184edf=_0x184edf-0x0;var _0x1278e1=_0xff22[_0x184edf];return _0x1278e1;};'use strict';var UserVoiceQueueRtEvents=require(_0x2ff2('0x0'));var events=[_0x2ff2('0x1'),'remove',_0x2ff2('0x2')];function createListener(_0x41445f,_0x2e0010){return function(_0x2425fd){_0x2e0010[_0x2ff2('0x3')](_0x41445f,_0x2425fd);};}function removeListener(_0x2caf71,_0x173f7c){return function(){UserVoiceQueueRtEvents[_0x2ff2('0x4')](_0x2caf71,_0x173f7c);};}exports[_0x2ff2('0x5')]=function(_0x47906b){for(var _0x21f303=0x0,_0x1b155f=events[_0x2ff2('0x6')];_0x21f303<_0x1b155f;_0x21f303++){var _0x21249c=events[_0x21f303];var _0x147214=createListener(_0x2ff2('0x7')+_0x21249c,_0x47906b);UserVoiceQueueRtEvents['on'](_0x21249c,_0x147214);}}; \ No newline at end of file +var _0x2428=['length','save','remove','update','emit','removeListener','register'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x2428,0xd3));var _0x8242=function(_0x18106e,_0x1625d7){_0x18106e=_0x18106e-0x0;var _0x234b90=_0x2428[_0x18106e];return _0x234b90;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x8242('0x0'),_0x8242('0x1'),_0x8242('0x2')];function createListener(_0x3f0f24,_0x9528a2){return function(_0x3fea1d){_0x9528a2[_0x8242('0x3')](_0x3f0f24,_0x3fea1d);};}function removeListener(_0x29feea,_0x1ee0d4){return function(){UserVoiceQueueRtEvents[_0x8242('0x4')](_0x29feea,_0x1ee0d4);};}exports[_0x8242('0x5')]=function(_0x484baa){for(var _0x38153d=0x0,_0x11da5f=events[_0x8242('0x6')];_0x38153d<_0x11da5f;_0x38153d++){var _0x3712f3=events[_0x38153d];var _0x1501e8=createListener('userVoiceQueueRt:'+_0x3712f3,_0x484baa);UserVoiceQueueRtEvents['on'](_0x3712f3,_0x1501e8);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index dc63fee..3cdba84 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x13e8ac,_0x25c0c0){var _0xc77ea6=function(_0x757bd0){while(--_0x757bd0){_0x13e8ac['push'](_0x13e8ac['shift']());}};_0xc77ea6(++_0x25c0c0);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'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(_0x47c758,_0x10a261){var _0xe0b1e0=function(_0x33bef5){while(--_0x33bef5){_0x47c758['push'](_0x47c758['shift']());}};_0xe0b1e0(++_0x10a261);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 238d209..458340a 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 _0x3c5e=['INTEGER','sequelize','exports'];(function(_0xddc6df,_0x3d6834){var _0x3e58e0=function(_0x4c3fb6){while(--_0x4c3fb6){_0xddc6df['push'](_0xddc6df['shift']());}};_0x3e58e0(++_0x3d6834);}(_0x3c5e,0x145));var _0xe3c5=function(_0x3188c4,_0x241aa4){_0x3188c4=_0x3188c4-0x0;var _0x4863f6=_0x3c5e[_0x3188c4];return _0x4863f6;};'use strict';var Sequelize=require(_0xe3c5('0x0'));module[_0xe3c5('0x1')]={'penalty':{'type':Sequelize[_0xe3c5('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x13ac=['INTEGER','sequelize','exports'];(function(_0x5532e1,_0x388cd1){var _0x276bb5=function(_0xa6bded){while(--_0xa6bded){_0x5532e1['push'](_0x5532e1['shift']());}};_0x276bb5(++_0x388cd1);}(_0x13ac,0x139));var _0xc13a=function(_0x52e994,_0x380589){_0x52e994=_0x52e994-0x0;var _0x3076f1=_0x13ac[_0x52e994];return _0x3076f1;};'use strict';var Sequelize=require(_0xc13a('0x0'));module[_0xc13a('0x1')]={'penalty':{'type':Sequelize[_0xc13a('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 4abd513..2027e82 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 _0x6ba5=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x5678c2,_0xd8cb89){var _0x263105=function(_0x4bb4e9){while(--_0x4bb4e9){_0x5678c2['push'](_0x5678c2['shift']());}};_0x263105(++_0xd8cb89);}(_0x6ba5,0x12e));var _0x56ba=function(_0x234995,_0x48c007){_0x234995=_0x234995-0x0;var _0x5115f0=_0x6ba5[_0x234995];return _0x5115f0;};'use strict';var _=require(_0x56ba('0x0'));var util=require(_0x56ba('0x1'));var logger=require(_0x56ba('0x2'))(_0x56ba('0x3'));var moment=require(_0x56ba('0x4'));var BPromise=require('bluebird');var rp=require(_0x56ba('0x5'));var fs=require('fs');var path=require(_0x56ba('0x6'));var rimraf=require(_0x56ba('0x7'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x56ba('0x8')]=function(_0x1eace5,_0x33feaf){return _0x1eace5[_0x56ba('0x9')](_0x56ba('0xa'),attributes,{'tableName':_0x56ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x907c=['exports','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x160758,_0x205c5b){var _0x1770b8=function(_0xfe01f3){while(--_0xfe01f3){_0x160758['push'](_0x160758['shift']());}};_0x1770b8(++_0x205c5b);}(_0x907c,0x1dd));var _0xc907=function(_0x2b18b9,_0x32d67f){_0x2b18b9=_0x2b18b9-0x0;var _0x1dcbfe=_0x907c[_0x2b18b9];return _0x1dcbfe;};'use strict';var _=require('lodash');var util=require(_0xc907('0x0'));var logger=require(_0xc907('0x1'))(_0xc907('0x2'));var moment=require('moment');var BPromise=require(_0xc907('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc907('0x4'));var rimraf=require(_0xc907('0x5'));var config=require(_0xc907('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0xc907('0x7')]=function(_0x42d6c6,_0x17dec7){return _0x42d6c6[_0xc907('0x8')](_0xc907('0x9'),attributes,{'tableName':_0xc907('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index b50c970..05e678f 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 _0x07ef=['message','info','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0xca510d,_0xfbb185){var _0x1ec591=function(_0x5d4650){while(--_0x5d4650){_0xca510d['push'](_0xca510d['shift']());}};_0x1ec591(++_0xfbb185);}(_0x07ef,0x1e2));var _0xf07e=function(_0xefb33e,_0x11bbb5){_0xefb33e=_0xefb33e-0x0;var _0x529db6=_0x07ef[_0xefb33e];return _0x529db6;};'use strict';var _=require('lodash');var util=require(_0xf07e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf07e('0x1'));var fs=require('fs');var Redis=require(_0xf07e('0x2'));var db=require(_0xf07e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf07e('0x4'))(_0xf07e('0x5'));var config=require(_0xf07e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf07e('0x7')][_0xf07e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1940f2,_0x26c0ab,_0x587ad6){return new BPromise(function(_0x28b619,_0x1cbb06){return client['request'](_0x1940f2,_0x587ad6)[_0xf07e('0x9')](function(_0x5cd501){logger['info'](_0xf07e('0xa'),_0x26c0ab,_0xf07e('0xb'));logger['debug'](_0xf07e('0xc'),_0x26c0ab,_0xf07e('0xb'),JSON['stringify'](_0x5cd501));if(_0x5cd501[_0xf07e('0xd')]){if(_0x5cd501[_0xf07e('0xd')]['code']===0x1f4){logger[_0xf07e('0xd')](_0xf07e('0xa'),_0x26c0ab,_0x5cd501[_0xf07e('0xd')][_0xf07e('0xe')]);return _0x1cbb06(_0x5cd501['error']['message']);}logger[_0xf07e('0xd')](_0xf07e('0xa'),_0x26c0ab,_0x5cd501[_0xf07e('0xd')][_0xf07e('0xe')]);return _0x28b619(_0x5cd501[_0xf07e('0xd')]['message']);}else{logger[_0xf07e('0xf')](_0xf07e('0xa'),_0x26c0ab,_0xf07e('0xb'));_0x28b619(_0x5cd501['result'][_0xf07e('0xe')]);}})['catch'](function(_0x1a3e76){logger[_0xf07e('0xd')](_0xf07e('0xa'),_0x26c0ab,_0x1a3e76);_0x1cbb06(_0x1a3e76);});});} \ No newline at end of file +var _0xb486=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','UserWhatsappQueue,\x20%s,\x20%s','result','catch'];(function(_0x5b6bfa,_0x4371e9){var _0xa886d0=function(_0x59d316){while(--_0x59d316){_0x5b6bfa['push'](_0x5b6bfa['shift']());}};_0xa886d0(++_0x4371e9);}(_0xb486,0x1ba));var _0x6b48=function(_0x769cb2,_0x270e0f){_0x769cb2=_0x769cb2-0x0;var _0x3e1aa1=_0xb486[_0x769cb2];return _0x3e1aa1;};'use strict';var _=require(_0x6b48('0x0'));var util=require(_0x6b48('0x1'));var moment=require(_0x6b48('0x2'));var BPromise=require(_0x6b48('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b48('0x4'));var db=require(_0x6b48('0x5'))['db'];var utils=require(_0x6b48('0x6'));var logger=require(_0x6b48('0x7'))(_0x6b48('0x8'));var config=require(_0x6b48('0x9'));var jayson=require(_0x6b48('0xa'));var client=jayson[_0x6b48('0xb')][_0x6b48('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c6a03,_0x421ffb,_0x2b8f72){return new BPromise(function(_0x5bbf5e,_0x33ee88){return client[_0x6b48('0xd')](_0x2c6a03,_0x2b8f72)[_0x6b48('0xe')](function(_0x5eb933){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x421ffb,_0x6b48('0xf'));logger[_0x6b48('0x10')](_0x6b48('0x11'),_0x421ffb,_0x6b48('0xf'),JSON[_0x6b48('0x12')](_0x5eb933));if(_0x5eb933['error']){if(_0x5eb933['error'][_0x6b48('0x13')]===0x1f4){logger[_0x6b48('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x421ffb,_0x5eb933[_0x6b48('0x14')][_0x6b48('0x15')]);return _0x33ee88(_0x5eb933[_0x6b48('0x14')][_0x6b48('0x15')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x421ffb,_0x5eb933[_0x6b48('0x14')][_0x6b48('0x15')]);return _0x5bbf5e(_0x5eb933[_0x6b48('0x14')][_0x6b48('0x15')]);}else{logger[_0x6b48('0x16')](_0x6b48('0x17'),_0x421ffb,_0x6b48('0xf'));_0x5bbf5e(_0x5eb933[_0x6b48('0x18')][_0x6b48('0x15')]);}})[_0x6b48('0x19')](function(_0x3ed9d3){logger[_0x6b48('0x14')](_0x6b48('0x17'),_0x421ffb,_0x3ed9d3);_0x33ee88(_0x3ed9d3);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 8a40f0b..e13c731 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 _0x238f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3dc383,_0x129655){var _0x3f975b=function(_0x3d3d7c){while(--_0x3d3d7c){_0x3dc383['push'](_0x3dc383['shift']());}};_0x3f975b(++_0x129655);}(_0x238f,0xa5));var _0xf238=function(_0x5ae678,_0x13aa79){_0x5ae678=_0x5ae678-0x0;var _0xeedeb2=_0x238f[_0x5ae678];return _0xeedeb2;};'use strict';var multer=require(_0xf238('0x0'));var util=require(_0xf238('0x1'));var path=require(_0xf238('0x2'));var timeout=require('connect-timeout');var express=require(_0xf238('0x3'));var router=express[_0xf238('0x4')]();var fs_extra=require(_0xf238('0x5'));var auth=require(_0xf238('0x6'));var interaction=require(_0xf238('0x7'));var config=require(_0xf238('0x8'));var controller=require('./variable.controller');router[_0xf238('0x9')]('/',auth[_0xf238('0xa')](),controller['index']);router['get'](_0xf238('0xb'),auth['isAuthenticated'](),controller[_0xf238('0xc')]);router[_0xf238('0xd')]('/',auth[_0xf238('0xa')](),controller[_0xf238('0xe')]);router['put'](_0xf238('0xb'),auth['isAuthenticated'](),controller[_0xf238('0xf')]);router[_0xf238('0x10')](_0xf238('0xb'),auth[_0xf238('0xa')](),controller[_0xf238('0x11')]);module[_0xf238('0x12')]=router; \ No newline at end of file +var _0xa261=['./variable.controller','get','isAuthenticated','index','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2573f7,_0x1200bc){var _0x57740d=function(_0x4ecf47){while(--_0x4ecf47){_0x2573f7['push'](_0x2573f7['shift']());}};_0x57740d(++_0x1200bc);}(_0xa261,0x1a3));var _0x1a26=function(_0x3ae1e0,_0x2b5874){_0x3ae1e0=_0x3ae1e0-0x0;var _0x2bd3f3=_0xa261[_0x3ae1e0];return _0x2bd3f3;};'use strict';var multer=require(_0x1a26('0x0'));var util=require('util');var path=require(_0x1a26('0x1'));var timeout=require(_0x1a26('0x2'));var express=require(_0x1a26('0x3'));var router=express[_0x1a26('0x4')]();var fs_extra=require(_0x1a26('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a26('0x6'));router[_0x1a26('0x7')]('/',auth[_0x1a26('0x8')](),controller[_0x1a26('0x9')]);router[_0x1a26('0x7')]('/:id',auth[_0x1a26('0x8')](),controller['show']);router[_0x1a26('0xa')]('/',auth[_0x1a26('0x8')](),controller[_0x1a26('0xb')]);router['put'](_0x1a26('0xc'),auth[_0x1a26('0x8')](),controller[_0x1a26('0xd')]);router[_0x1a26('0xe')](_0x1a26('0xc'),auth['isAuthenticated'](),controller[_0x1a26('0xf')]);module[_0x1a26('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 e5a9128..84e70fb 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 _0x1a54=['name','STRING','exports'];(function(_0x11764d,_0x395963){var _0x21a7ea=function(_0x561899){while(--_0x561899){_0x11764d['push'](_0x11764d['shift']());}};_0x21a7ea(++_0x395963);}(_0x1a54,0x14f));var _0x41a5=function(_0x54f529,_0x53a131){_0x54f529=_0x54f529-0x0;var _0x1d8a68=_0x1a54[_0x54f529];return _0x1d8a68;};'use strict';var Sequelize=require('sequelize');module[_0x41a5('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x41a5('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x41a5('0x2')]}}; \ No newline at end of file +var _0x32f6=['name','STRING'];(function(_0x5565b0,_0xa01b80){var _0x13a7f9=function(_0x5b9181){while(--_0x5b9181){_0x5565b0['push'](_0x5565b0['shift']());}};_0x13a7f9(++_0xa01b80);}(_0x32f6,0xbd));var _0x632f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x32f6[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x632f('0x0')],'unique':_0x632f('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 6594f1d..16fccc3 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 _0x5e84=['catch','show','params','rawAttributes','find','create','user','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','Variables','UserProfileResource','error','stack','name','index','map','Variable','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows'];(function(_0x3c2c98,_0x12ba31){var _0x2c7e78=function(_0x52d368){while(--_0x52d368){_0x3c2c98['push'](_0x3c2c98['shift']());}};_0x2c7e78(++_0x12ba31);}(_0x5e84,0xb1));var _0x45e8=function(_0x23315f,_0x87e322){_0x23315f=_0x23315f-0x0;var _0x18707e=_0x5e84[_0x23315f];return _0x18707e;};'use strict';var emlformat=require(_0x45e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45e8('0x1'));var jsonpatch=require(_0x45e8('0x2'));var rp=require(_0x45e8('0x3'));var moment=require(_0x45e8('0x4'));var BPromise=require(_0x45e8('0x5'));var Mustache=require(_0x45e8('0x6'));var util=require('util');var path=require(_0x45e8('0x7'));var sox=require(_0x45e8('0x8'));var csv=require(_0x45e8('0x9'));var ejs=require(_0x45e8('0xa'));var fs=require('fs');var fs_extra=require(_0x45e8('0xb'));var _=require('lodash');var squel=require(_0x45e8('0xc'));var crypto=require(_0x45e8('0xd'));var jsforce=require(_0x45e8('0xe'));var deskjs=require(_0x45e8('0xf'));var toCsv=require(_0x45e8('0x9'));var querystring=require(_0x45e8('0x10'));var Papa=require('papaparse');var Redis=require(_0x45e8('0x11'));var authService=require(_0x45e8('0x12'));var qs=require(_0x45e8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45e8('0x14'));var logger=require(_0x45e8('0x15'))(_0x45e8('0x16'));var utils=require(_0x45e8('0x17'));var config=require(_0x45e8('0x18'));var licenseUtil=require(_0x45e8('0x19'));var db=require(_0x45e8('0x1a'))['db'];function respondWithStatusCode(_0x5beb2c,_0x473814){_0x473814=_0x473814||0xcc;return function(_0x59e50c){if(_0x59e50c){return _0x5beb2c[_0x45e8('0x1b')](_0x473814);}return _0x5beb2c[_0x45e8('0x1c')](_0x473814)[_0x45e8('0x1d')]();};}function respondWithResult(_0x2aa4f2,_0x5b53a3){_0x5b53a3=_0x5b53a3||0xc8;return function(_0x499fe2){if(_0x499fe2){return _0x2aa4f2['status'](_0x5b53a3)[_0x45e8('0x1e')](_0x499fe2);}};}function respondWithFilteredResult(_0x4e4f0c,_0x4c2400){return function(_0x49cdf1){if(_0x49cdf1){var _0x4df91c=typeof _0x4c2400[_0x45e8('0x1f')]===_0x45e8('0x20')&&typeof _0x4c2400[_0x45e8('0x21')]==='undefined';var _0x5c9647=_0x49cdf1[_0x45e8('0x22')];var _0x2e8eff=_0x4df91c?0x0:_0x4c2400['offset'];var _0x58b9db=_0x4df91c?_0x49cdf1[_0x45e8('0x22')]:_0x4c2400[_0x45e8('0x1f')]+_0x4c2400[_0x45e8('0x21')];var _0x1dbd9d;if(_0x58b9db>=_0x5c9647){_0x58b9db=_0x5c9647;_0x1dbd9d=0xc8;}else{_0x1dbd9d=0xce;}_0x4e4f0c[_0x45e8('0x1c')](_0x1dbd9d);return _0x4e4f0c['set']('Content-Range',_0x2e8eff+'-'+_0x58b9db+'/'+_0x5c9647)[_0x45e8('0x1e')](_0x49cdf1);}return null;};}function patchUpdates(_0x1df092){return function(_0x42bc58){try{jsonpatch[_0x45e8('0x23')](_0x42bc58,_0x1df092,!![]);}catch(_0x9c9140){return BPromise[_0x45e8('0x24')](_0x9c9140);}return _0x42bc58['save']();};}function saveUpdates(_0x113823,_0x3484f5){return function(_0x31dbf7){if(_0x31dbf7){return _0x31dbf7[_0x45e8('0x25')](_0x113823)[_0x45e8('0x26')](function(_0x5ca7f4){return _0x5ca7f4;});}return null;};}function removeEntity(_0x238f32,_0x245976){return function(_0x5969e1){if(_0x5969e1){return _0x5969e1[_0x45e8('0x27')]()[_0x45e8('0x26')](function(){var _0x105a40=_0x5969e1['get']({'plain':!![]});var _0x3a7228=_0x45e8('0x28');return db[_0x45e8('0x29')][_0x45e8('0x27')]({'where':{'type':_0x3a7228,'resourceId':_0x105a40['id']}})[_0x45e8('0x26')](function(){return _0x5969e1;});})[_0x45e8('0x26')](function(){_0x238f32[_0x45e8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de524,_0x4b96d2){return function(_0x22a127){if(!_0x22a127){_0x3de524[_0x45e8('0x1b')](0x194);}return _0x22a127;};}function handleError(_0x2e2ba,_0xe02bf4){_0xe02bf4=_0xe02bf4||0x1f4;return function(_0x484931){logger[_0x45e8('0x2a')](_0x484931[_0x45e8('0x2b')]);if(_0x484931[_0x45e8('0x2c')]){delete _0x484931[_0x45e8('0x2c')];}_0x2e2ba['status'](_0xe02bf4)['send'](_0x484931);};}exports[_0x45e8('0x2d')]=function(_0x38ae49,_0x73e555){var _0x235fca={},_0x3517b1={},_0x38ea53={'count':0x0,'rows':[]};var _0x4144db=_[_0x45e8('0x2e')](db[_0x45e8('0x2f')]['rawAttributes'],function(_0x2576fd){return{'name':_0x2576fd[_0x45e8('0x30')],'type':_0x2576fd[_0x45e8('0x31')][_0x45e8('0x32')]};});_0x3517b1['model']=_[_0x45e8('0x2e')](_0x4144db,_0x45e8('0x2c'));_0x3517b1[_0x45e8('0x33')]=_[_0x45e8('0x34')](_0x38ae49[_0x45e8('0x33')]);_0x3517b1[_0x45e8('0x35')]=_[_0x45e8('0x36')](_0x3517b1[_0x45e8('0x37')],_0x3517b1[_0x45e8('0x33')]);_0x235fca[_0x45e8('0x38')]=_[_0x45e8('0x36')](_0x3517b1[_0x45e8('0x37')],qs['fields'](_0x38ae49['query'][_0x45e8('0x39')]));_0x235fca[_0x45e8('0x38')]=_0x235fca['attributes'][_0x45e8('0x3a')]?_0x235fca['attributes']:_0x3517b1[_0x45e8('0x37')];if(!_0x38ae49['query'][_0x45e8('0x3b')](_0x45e8('0x3c'))){_0x235fca[_0x45e8('0x21')]=qs['limit'](_0x38ae49[_0x45e8('0x33')][_0x45e8('0x21')]);_0x235fca[_0x45e8('0x1f')]=qs['offset'](_0x38ae49[_0x45e8('0x33')][_0x45e8('0x1f')]);}_0x235fca[_0x45e8('0x3d')]=qs[_0x45e8('0x3e')](_0x38ae49['query'][_0x45e8('0x3e')]);_0x235fca['where']=qs[_0x45e8('0x35')](_[_0x45e8('0x3f')](_0x38ae49[_0x45e8('0x33')],_0x3517b1[_0x45e8('0x35')]),_0x4144db);if(_0x38ae49[_0x45e8('0x33')][_0x45e8('0x40')]){_0x235fca[_0x45e8('0x41')]=_['merge'](_0x235fca['where'],{'$or':_[_0x45e8('0x2e')](_0x4144db,function(_0x1dfa0b){if(_0x1dfa0b[_0x45e8('0x31')]!=='VIRTUAL'){var _0x2956c4={};_0x2956c4[_0x1dfa0b[_0x45e8('0x2c')]]={'$like':'%'+_0x38ae49[_0x45e8('0x33')][_0x45e8('0x40')]+'%'};return _0x2956c4;}})});}_0x235fca=_[_0x45e8('0x42')]({},_0x235fca,_0x38ae49[_0x45e8('0x43')]);var _0x1f82d6={'where':_0x235fca['where']};return db[_0x45e8('0x2f')]['count'](_0x1f82d6)[_0x45e8('0x26')](function(_0x337c96){_0x38ea53[_0x45e8('0x22')]=_0x337c96;if(_0x38ae49[_0x45e8('0x33')][_0x45e8('0x44')]){_0x235fca[_0x45e8('0x45')]=[{'all':!![]}];}return db[_0x45e8('0x2f')][_0x45e8('0x46')](_0x235fca);})[_0x45e8('0x26')](function(_0x230924){_0x38ea53[_0x45e8('0x47')]=_0x230924;return _0x38ea53;})[_0x45e8('0x26')](respondWithFilteredResult(_0x73e555,_0x235fca))[_0x45e8('0x48')](handleError(_0x73e555,null));};exports[_0x45e8('0x49')]=function(_0x358269,_0x45b0c4){var _0x57432c={'raw':!![],'where':{'id':_0x358269[_0x45e8('0x4a')]['id']}},_0x190eed={};_0x190eed['model']=_[_0x45e8('0x34')](db[_0x45e8('0x2f')][_0x45e8('0x4b')]);_0x190eed[_0x45e8('0x33')]=_[_0x45e8('0x34')](_0x358269[_0x45e8('0x33')]);_0x190eed['filters']=_[_0x45e8('0x36')](_0x190eed[_0x45e8('0x37')],_0x190eed[_0x45e8('0x33')]);_0x57432c[_0x45e8('0x38')]=_['intersection'](_0x190eed[_0x45e8('0x37')],qs[_0x45e8('0x39')](_0x358269['query']['fields']));_0x57432c['attributes']=_0x57432c[_0x45e8('0x38')]['length']?_0x57432c[_0x45e8('0x38')]:_0x190eed['model'];if(_0x358269[_0x45e8('0x33')][_0x45e8('0x44')]){_0x57432c[_0x45e8('0x45')]=[{'all':!![]}];}_0x57432c=_[_0x45e8('0x42')]({},_0x57432c,_0x358269[_0x45e8('0x43')]);return db[_0x45e8('0x2f')][_0x45e8('0x4c')](_0x57432c)[_0x45e8('0x26')](handleEntityNotFound(_0x45b0c4,null))[_0x45e8('0x26')](respondWithResult(_0x45b0c4,null))['catch'](handleError(_0x45b0c4,null));};exports[_0x45e8('0x4d')]=function(_0x62fe3,_0x52e0f8){return db[_0x45e8('0x2f')]['create'](_0x62fe3['body'],{})['then'](function(_0x2b5845){var _0x10dcdb=_0x62fe3[_0x45e8('0x4e')][_0x45e8('0x4f')]({'plain':!![]});if(!_0x10dcdb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10dcdb['role']===_0x45e8('0x4e')){var _0x4e6840=_0x2b5845[_0x45e8('0x4f')]({'plain':!![]});var _0x3fcb12='Variables';return db['UserProfileSection'][_0x45e8('0x4c')]({'where':{'name':_0x3fcb12,'userProfileId':_0x10dcdb['userProfileId']},'raw':!![]})['then'](function(_0x32d985){if(_0x32d985&&_0x32d985[_0x45e8('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x4e6840['name'],'resourceId':_0x4e6840['id'],'type':_0x32d985[_0x45e8('0x2c')],'sectionId':_0x32d985['id']},{})[_0x45e8('0x26')](function(){return _0x2b5845;});}else{return _0x2b5845;}})[_0x45e8('0x48')](function(_0x1b64da){logger['error'](_0x45e8('0x51'),_0x1b64da);throw _0x1b64da;});}return _0x2b5845;})[_0x45e8('0x26')](respondWithResult(_0x52e0f8,0xc9))[_0x45e8('0x48')](handleError(_0x52e0f8,null));};exports['update']=function(_0x26c9ef,_0x316185){if(_0x26c9ef['body']['id']){delete _0x26c9ef[_0x45e8('0x52')]['id'];}return db[_0x45e8('0x2f')]['find']({'where':{'id':_0x26c9ef[_0x45e8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x316185,null))[_0x45e8('0x26')](saveUpdates(_0x26c9ef['body'],null))[_0x45e8('0x26')](respondWithResult(_0x316185,null))[_0x45e8('0x48')](handleError(_0x316185,null));};exports['destroy']=function(_0x14e276,_0xe1ee6e){return db[_0x45e8('0x2f')]['find']({'where':{'id':_0x14e276[_0x45e8('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe1ee6e,null))['then'](removeEntity(_0xe1ee6e,null))[_0x45e8('0x48')](handleError(_0xe1ee6e,null));}; \ No newline at end of file +var _0xad41=['attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','name','send','map','Variable','key','model','query','keys','filters','intersection'];(function(_0x559a55,_0x32229b){var _0x412190=function(_0xe08a9e){while(--_0xe08a9e){_0x559a55['push'](_0x559a55['shift']());}};_0x412190(++_0x32229b);}(_0xad41,0x6f));var _0x1ad4=function(_0x48cac8,_0x150d03){_0x48cac8=_0x48cac8-0x0;var _0x539232=_0xad41[_0x48cac8];return _0x539232;};'use strict';var emlformat=require(_0x1ad4('0x0'));var rimraf=require(_0x1ad4('0x1'));var zipdir=require(_0x1ad4('0x2'));var jsonpatch=require(_0x1ad4('0x3'));var rp=require(_0x1ad4('0x4'));var moment=require(_0x1ad4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1ad4('0x6'));var util=require(_0x1ad4('0x7'));var path=require(_0x1ad4('0x8'));var sox=require('sox');var csv=require(_0x1ad4('0x9'));var ejs=require(_0x1ad4('0xa'));var fs=require('fs');var fs_extra=require(_0x1ad4('0xb'));var _=require('lodash');var squel=require(_0x1ad4('0xc'));var crypto=require('crypto');var jsforce=require(_0x1ad4('0xd'));var deskjs=require(_0x1ad4('0xe'));var toCsv=require(_0x1ad4('0x9'));var querystring=require(_0x1ad4('0xf'));var Papa=require('papaparse');var Redis=require(_0x1ad4('0x10'));var authService=require(_0x1ad4('0x11'));var qs=require(_0x1ad4('0x12'));var as=require(_0x1ad4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1ad4('0x14'));var utils=require(_0x1ad4('0x15'));var config=require(_0x1ad4('0x16'));var licenseUtil=require(_0x1ad4('0x17'));var db=require(_0x1ad4('0x18'))['db'];function respondWithStatusCode(_0x1da7f4,_0x2892e5){_0x2892e5=_0x2892e5||0xcc;return function(_0x312a12){if(_0x312a12){return _0x1da7f4[_0x1ad4('0x19')](_0x2892e5);}return _0x1da7f4[_0x1ad4('0x1a')](_0x2892e5)[_0x1ad4('0x1b')]();};}function respondWithResult(_0xc30c14,_0x7d312a){_0x7d312a=_0x7d312a||0xc8;return function(_0x56ef85){if(_0x56ef85){return _0xc30c14[_0x1ad4('0x1a')](_0x7d312a)[_0x1ad4('0x1c')](_0x56ef85);}};}function respondWithFilteredResult(_0x1118f3,_0x16ad59){return function(_0x343be7){if(_0x343be7){var _0x2b8ae7=typeof _0x16ad59[_0x1ad4('0x1d')]===_0x1ad4('0x1e')&&typeof _0x16ad59[_0x1ad4('0x1f')]===_0x1ad4('0x1e');var _0x5333ab=_0x343be7['count'];var _0x42eff5=_0x2b8ae7?0x0:_0x16ad59[_0x1ad4('0x1d')];var _0x3eeef4=_0x2b8ae7?_0x343be7[_0x1ad4('0x20')]:_0x16ad59[_0x1ad4('0x1d')]+_0x16ad59[_0x1ad4('0x1f')];var _0x4e4ac3;if(_0x3eeef4>=_0x5333ab){_0x3eeef4=_0x5333ab;_0x4e4ac3=0xc8;}else{_0x4e4ac3=0xce;}_0x1118f3['status'](_0x4e4ac3);return _0x1118f3[_0x1ad4('0x21')](_0x1ad4('0x22'),_0x42eff5+'-'+_0x3eeef4+'/'+_0x5333ab)[_0x1ad4('0x1c')](_0x343be7);}return null;};}function patchUpdates(_0x1bc32f){return function(_0x285816){try{jsonpatch[_0x1ad4('0x23')](_0x285816,_0x1bc32f,!![]);}catch(_0x375c03){return BPromise[_0x1ad4('0x24')](_0x375c03);}return _0x285816[_0x1ad4('0x25')]();};}function saveUpdates(_0x253f73,_0x2c4d9f){return function(_0x3df336){if(_0x3df336){return _0x3df336[_0x1ad4('0x26')](_0x253f73)[_0x1ad4('0x27')](function(_0x1c17d2){return _0x1c17d2;});}return null;};}function removeEntity(_0x153b11,_0xc1eee9){return function(_0x21a0a5){if(_0x21a0a5){return _0x21a0a5[_0x1ad4('0x28')]()[_0x1ad4('0x27')](function(){var _0x565b5e=_0x21a0a5[_0x1ad4('0x29')]({'plain':!![]});var _0x207925=_0x1ad4('0x2a');return db['UserProfileResource'][_0x1ad4('0x28')]({'where':{'type':_0x207925,'resourceId':_0x565b5e['id']}})['then'](function(){return _0x21a0a5;});})['then'](function(){_0x153b11[_0x1ad4('0x1a')](0xcc)[_0x1ad4('0x1b')]();});}};}function handleEntityNotFound(_0x296e4e,_0x996ca9){return function(_0x50a92b){if(!_0x50a92b){_0x296e4e[_0x1ad4('0x19')](0x194);}return _0x50a92b;};}function handleError(_0x58d511,_0x56a574){_0x56a574=_0x56a574||0x1f4;return function(_0x39b0b6){logger['error'](_0x39b0b6['stack']);if(_0x39b0b6['name']){delete _0x39b0b6[_0x1ad4('0x2b')];}_0x58d511[_0x1ad4('0x1a')](_0x56a574)[_0x1ad4('0x2c')](_0x39b0b6);};}exports['index']=function(_0x489cab,_0x4c9bbb){var _0x2cbf32={},_0x360877={},_0x5768bd={'count':0x0,'rows':[]};var _0x1f811b=_[_0x1ad4('0x2d')](db[_0x1ad4('0x2e')]['rawAttributes'],function(_0x1f5a0d){return{'name':_0x1f5a0d['fieldName'],'type':_0x1f5a0d['type'][_0x1ad4('0x2f')]};});_0x360877[_0x1ad4('0x30')]=_['map'](_0x1f811b,_0x1ad4('0x2b'));_0x360877[_0x1ad4('0x31')]=_[_0x1ad4('0x32')](_0x489cab[_0x1ad4('0x31')]);_0x360877[_0x1ad4('0x33')]=_[_0x1ad4('0x34')](_0x360877['model'],_0x360877[_0x1ad4('0x31')]);_0x2cbf32[_0x1ad4('0x35')]=_[_0x1ad4('0x34')](_0x360877[_0x1ad4('0x30')],qs[_0x1ad4('0x36')](_0x489cab[_0x1ad4('0x31')][_0x1ad4('0x36')]));_0x2cbf32['attributes']=_0x2cbf32['attributes'][_0x1ad4('0x37')]?_0x2cbf32['attributes']:_0x360877['model'];if(!_0x489cab[_0x1ad4('0x31')]['hasOwnProperty'](_0x1ad4('0x38'))){_0x2cbf32['limit']=qs[_0x1ad4('0x1f')](_0x489cab['query']['limit']);_0x2cbf32[_0x1ad4('0x1d')]=qs[_0x1ad4('0x1d')](_0x489cab['query'][_0x1ad4('0x1d')]);}_0x2cbf32[_0x1ad4('0x39')]=qs[_0x1ad4('0x3a')](_0x489cab[_0x1ad4('0x31')][_0x1ad4('0x3a')]);_0x2cbf32[_0x1ad4('0x3b')]=qs[_0x1ad4('0x33')](_[_0x1ad4('0x3c')](_0x489cab[_0x1ad4('0x31')],_0x360877[_0x1ad4('0x33')]),_0x1f811b);if(_0x489cab[_0x1ad4('0x31')][_0x1ad4('0x3d')]){_0x2cbf32['where']=_[_0x1ad4('0x3e')](_0x2cbf32[_0x1ad4('0x3b')],{'$or':_['map'](_0x1f811b,function(_0xcb5823){if(_0xcb5823[_0x1ad4('0x3f')]!==_0x1ad4('0x40')){var _0x520318={};_0x520318[_0xcb5823['name']]={'$like':'%'+_0x489cab['query'][_0x1ad4('0x3d')]+'%'};return _0x520318;}})});}_0x2cbf32=_['merge']({},_0x2cbf32,_0x489cab[_0x1ad4('0x41')]);var _0x4b58ca={'where':_0x2cbf32[_0x1ad4('0x3b')]};return db[_0x1ad4('0x2e')][_0x1ad4('0x20')](_0x4b58ca)['then'](function(_0x203a95){_0x5768bd[_0x1ad4('0x20')]=_0x203a95;if(_0x489cab[_0x1ad4('0x31')][_0x1ad4('0x42')]){_0x2cbf32['include']=[{'all':!![]}];}return db[_0x1ad4('0x2e')][_0x1ad4('0x43')](_0x2cbf32);})[_0x1ad4('0x27')](function(_0xbdb104){_0x5768bd[_0x1ad4('0x44')]=_0xbdb104;return _0x5768bd;})[_0x1ad4('0x27')](respondWithFilteredResult(_0x4c9bbb,_0x2cbf32))[_0x1ad4('0x45')](handleError(_0x4c9bbb,null));};exports['show']=function(_0x34623e,_0x428a25){var _0x2c2fb8={'raw':!![],'where':{'id':_0x34623e[_0x1ad4('0x46')]['id']}},_0x2b5dae={};_0x2b5dae[_0x1ad4('0x30')]=_[_0x1ad4('0x32')](db['Variable']['rawAttributes']);_0x2b5dae[_0x1ad4('0x31')]=_[_0x1ad4('0x32')](_0x34623e[_0x1ad4('0x31')]);_0x2b5dae['filters']=_[_0x1ad4('0x34')](_0x2b5dae[_0x1ad4('0x30')],_0x2b5dae[_0x1ad4('0x31')]);_0x2c2fb8[_0x1ad4('0x35')]=_[_0x1ad4('0x34')](_0x2b5dae[_0x1ad4('0x30')],qs['fields'](_0x34623e[_0x1ad4('0x31')][_0x1ad4('0x36')]));_0x2c2fb8[_0x1ad4('0x35')]=_0x2c2fb8[_0x1ad4('0x35')][_0x1ad4('0x37')]?_0x2c2fb8[_0x1ad4('0x35')]:_0x2b5dae[_0x1ad4('0x30')];if(_0x34623e[_0x1ad4('0x31')][_0x1ad4('0x42')]){_0x2c2fb8[_0x1ad4('0x47')]=[{'all':!![]}];}_0x2c2fb8=_[_0x1ad4('0x3e')]({},_0x2c2fb8,_0x34623e['options']);return db['Variable'][_0x1ad4('0x48')](_0x2c2fb8)['then'](handleEntityNotFound(_0x428a25,null))[_0x1ad4('0x27')](respondWithResult(_0x428a25,null))[_0x1ad4('0x45')](handleError(_0x428a25,null));};exports[_0x1ad4('0x49')]=function(_0xce1548,_0x32cbde){return db['Variable'][_0x1ad4('0x49')](_0xce1548[_0x1ad4('0x4a')],{})[_0x1ad4('0x27')](function(_0x1c2df4){var _0x14aeca=_0xce1548[_0x1ad4('0x4b')]['get']({'plain':!![]});if(!_0x14aeca)throw new Error(_0x1ad4('0x4c'));if(_0x14aeca[_0x1ad4('0x4d')]===_0x1ad4('0x4b')){var _0x29c0b3=_0x1c2df4['get']({'plain':!![]});var _0x4c56f5=_0x1ad4('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x4c56f5,'userProfileId':_0x14aeca['userProfileId']},'raw':!![]})[_0x1ad4('0x27')](function(_0x38bbf1){if(_0x38bbf1&&_0x38bbf1[_0x1ad4('0x4e')]===0x0){return db[_0x1ad4('0x4f')][_0x1ad4('0x49')]({'name':_0x29c0b3[_0x1ad4('0x2b')],'resourceId':_0x29c0b3['id'],'type':_0x38bbf1[_0x1ad4('0x2b')],'sectionId':_0x38bbf1['id']},{})[_0x1ad4('0x27')](function(){return _0x1c2df4;});}else{return _0x1c2df4;}})['catch'](function(_0x3130db){logger[_0x1ad4('0x50')](_0x1ad4('0x51'),_0x3130db);throw _0x3130db;});}return _0x1c2df4;})[_0x1ad4('0x27')](respondWithResult(_0x32cbde,0xc9))[_0x1ad4('0x45')](handleError(_0x32cbde,null));};exports[_0x1ad4('0x26')]=function(_0x37048d,_0x3ddb88){if(_0x37048d[_0x1ad4('0x4a')]['id']){delete _0x37048d[_0x1ad4('0x4a')]['id'];}return db[_0x1ad4('0x2e')][_0x1ad4('0x48')]({'where':{'id':_0x37048d[_0x1ad4('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ddb88,null))[_0x1ad4('0x27')](saveUpdates(_0x37048d[_0x1ad4('0x4a')],null))[_0x1ad4('0x27')](respondWithResult(_0x3ddb88,null))['catch'](handleError(_0x3ddb88,null));};exports['destroy']=function(_0x4304d5,_0x30eb21){return db[_0x1ad4('0x2e')][_0x1ad4('0x48')]({'where':{'id':_0x4304d5[_0x1ad4('0x46')]['id']}})['then'](handleEntityNotFound(_0x30eb21,null))[_0x1ad4('0x27')](removeEntity(_0x30eb21,null))[_0x1ad4('0x45')](handleError(_0x30eb21,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 5a45ee6..596b1f7 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 _0xa19f=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./variable.attributes','define','tools_variables'];(function(_0x37974f,_0x44878f){var _0x34388e=function(_0xf9cf2e){while(--_0xf9cf2e){_0x37974f['push'](_0x37974f['shift']());}};_0x34388e(++_0x44878f);}(_0xa19f,0x197));var _0xfa19=function(_0x5b3c99,_0x35d3b3){_0x5b3c99=_0x5b3c99-0x0;var _0x4977dd=_0xa19f[_0x5b3c99];return _0x4977dd;};'use strict';var _=require(_0xfa19('0x0'));var util=require(_0xfa19('0x1'));var logger=require(_0xfa19('0x2'))(_0xfa19('0x3'));var moment=require(_0xfa19('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa19('0x5'));var rimraf=require(_0xfa19('0x6'));var config=require(_0xfa19('0x7'));var attributes=require(_0xfa19('0x8'));module['exports']=function(_0x4fbfe8,_0x2ab047){return _0x4fbfe8[_0xfa19('0x9')]('Variable',attributes,{'tableName':_0xfa19('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4275=['tools_variables','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./variable.attributes','exports','define'];(function(_0x47cd7b,_0x5630af){var _0x3e6dbf=function(_0x2c28e1){while(--_0x2c28e1){_0x47cd7b['push'](_0x47cd7b['shift']());}};_0x3e6dbf(++_0x5630af);}(_0x4275,0xa9));var _0x5427=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4275[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x5427('0x0'));var logger=require(_0x5427('0x1'))(_0x5427('0x2'));var moment=require(_0x5427('0x3'));var BPromise=require(_0x5427('0x4'));var rp=require(_0x5427('0x5'));var fs=require('fs');var path=require(_0x5427('0x6'));var rimraf=require(_0x5427('0x7'));var config=require('../../config/environment');var attributes=require(_0x5427('0x8'));module[_0x5427('0x9')]=function(_0x381091,_0x224cb5){return _0x381091[_0x5427('0xa')]('Variable',attributes,{'tableName':_0x5427('0xb'),'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 2590916..b921e7d 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 _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3fbf3d,_0x3a80f4){var _0x2ff7a8=function(_0x285f94){while(--_0x285f94){_0x3fbf3d['push'](_0x3fbf3d['shift']());}};_0x2ff7a8(++_0x3a80f4);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2821be,_0x1720f3){_0x2821be=_0x2821be-0x0;var _0x576b85=_0x8ef6[_0x2821be];return _0x576b85;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file +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(_0x26c315,_0x28ce5f){var _0xe17686=function(_0x3af042){while(--_0x3af042){_0x26c315['push'](_0x26c315['shift']());}};_0xe17686(++_0x28ce5f);}(_0x7217,0x19e));var _0x7721=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x7217[_0x3ce3c];return _0x55a2c9;};'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 diff --git a/server/api/version/index.js b/server/api/version/index.js index 2011465..dcba046 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 _0x7c5e=['./version.controller','index','get','/fetch','isAuthenticated','/reset','canUpdate','reset','/restart','/migrations','exports','Router','../../components/auth/service'];(function(_0x4d1771,_0x334fdd){var _0x45570b=function(_0x2dc3cd){while(--_0x2dc3cd){_0x4d1771['push'](_0x4d1771['shift']());}};_0x45570b(++_0x334fdd);}(_0x7c5e,0x191));var _0xe7c5=function(_0x30f09c,_0x49cd03){_0x30f09c=_0x30f09c-0x0;var _0x1beefc=_0x7c5e[_0x30f09c];return _0x1beefc;};'use strict';var express=require('express');var router=express[_0xe7c5('0x0')]();var auth=require(_0xe7c5('0x1'));var controller=require(_0xe7c5('0x2'));router['get']('/',controller[_0xe7c5('0x3')]);router[_0xe7c5('0x4')](_0xe7c5('0x5'),auth[_0xe7c5('0x6')](),auth['canUpdate'](),controller['fetch']);router['get'](_0xe7c5('0x7'),auth[_0xe7c5('0x6')](),auth[_0xe7c5('0x8')](),controller[_0xe7c5('0x9')]);router[_0xe7c5('0x4')]('/pull',auth['isAuthenticated'](),auth[_0xe7c5('0x8')](),controller['pull']);router[_0xe7c5('0x4')](_0xe7c5('0xa'),auth[_0xe7c5('0x6')](),controller['restart']);router[_0xe7c5('0x4')](_0xe7c5('0xb'),controller['migrations']);module[_0xe7c5('0xc')]=router; \ No newline at end of file +var _0x6330=['index','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','pull','/restart','restart','migrations','exports','express','Router','../../components/auth/service','./version.controller','get'];(function(_0x35febf,_0x3196d2){var _0x1d0b48=function(_0xbdae17){while(--_0xbdae17){_0x35febf['push'](_0x35febf['shift']());}};_0x1d0b48(++_0x3196d2);}(_0x6330,0x182));var _0x0633=function(_0x496a45,_0x2de9b2){_0x496a45=_0x496a45-0x0;var _0x5a381f=_0x6330[_0x496a45];return _0x5a381f;};'use strict';var express=require(_0x0633('0x0'));var router=express[_0x0633('0x1')]();var auth=require(_0x0633('0x2'));var controller=require(_0x0633('0x3'));router[_0x0633('0x4')]('/',controller[_0x0633('0x5')]);router[_0x0633('0x4')]('/fetch',auth[_0x0633('0x6')](),auth['canUpdate'](),controller[_0x0633('0x7')]);router[_0x0633('0x4')](_0x0633('0x8'),auth[_0x0633('0x6')](),auth[_0x0633('0x9')](),controller[_0x0633('0xa')]);router[_0x0633('0x4')](_0x0633('0xb'),auth[_0x0633('0x6')](),auth[_0x0633('0x9')](),controller[_0x0633('0xc')]);router[_0x0633('0x4')](_0x0633('0xd'),auth['isAuthenticated'](),controller[_0x0633('0xe')]);router[_0x0633('0x4')]('/migrations',controller[_0x0633('0xf')]);module[_0x0633('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 5d5e3e0..e1c843f 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 _0x21e0=['git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','root','length','replace','.js','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','exports','query','latest','fetch','2.0.0','status','json','master','error','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','info'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x21e0,0x1ef));var _0x021e=function(_0x5acc49,_0xacbf40){_0x5acc49=_0x5acc49-0x0;var _0x14ba34=_0x21e0[_0x5acc49];return _0x14ba34;};'use strict';var Umzug=require(_0x021e('0x0'));var path=require(_0x021e('0x1'));var fs=require('fs');var _=require(_0x021e('0x2'));var pkginfo=require(_0x021e('0x3'))(module,_0x021e('0x4'));var compareVersions=require(_0x021e('0x5'));var exec=require('child_process')[_0x021e('0x6')];var db=require(_0x021e('0x7'))['db'];var config=require(_0x021e('0x8'));var pm2=require(_0x021e('0x9'));var logger=require('../../config/logger')(_0x021e('0xa'));var git=require(_0x021e('0xb'))(config['root']);exports['index']=function(_0x16c010,_0x4bef10){var _0x3717f6={'current':module[_0x021e('0xc')][_0x021e('0x4')],'phonebar':0x2};if(_0x16c010[_0x021e('0xd')]&&_0x16c010[_0x021e('0xd')][_0x021e('0xe')]){return git[_0x021e('0xf')]()['tags'](function(_0x10e257,_0x1ba1ec){_0x3717f6['latest']=(_0x10e257?module['exports'][_0x021e('0x4')]:_0x1ba1ec[_0x021e('0xe')])||_0x021e('0x10');return _0x4bef10[_0x021e('0x11')](0xc8)[_0x021e('0x12')](_0x3717f6);});}else{return _0x4bef10[_0x021e('0x11')](0xc8)[_0x021e('0x12')](_0x3717f6);}};exports['fetch']=function(_0x1cce41,_0x358eeb){return git[_0x021e('0xf')](['origin',_0x021e('0x13')],function(_0x1e142a){if(_0x1e142a){logger[_0x021e('0x14')](_0x1e142a);return _0x358eeb['status'](0x1f4)['json'](_0x1e142a);}logger['info']('git\x20fetch');return _0x358eeb[_0x021e('0x11')](0xc8)[_0x021e('0x12')]({'output':_0x021e('0x15')});});};exports[_0x021e('0x16')]=function(_0x527951,_0x78367a){return git[_0x021e('0x16')](['--hard',_0x021e('0x17')],function(_0x7db055){if(_0x7db055){logger[_0x021e('0x14')](_0x7db055);return _0x78367a['status'](0x1f4)['json'](_0x7db055);}logger[_0x021e('0x18')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x78367a[_0x021e('0x11')](0xc8)[_0x021e('0x12')]({'output':_0x021e('0x19')});});};exports[_0x021e('0x1a')]=function(_0x244996,_0x6742e0){exec(_0x021e('0x1b'),function(_0x570fe9,_0x5aea12,_0x132d1e){logger[_0x021e('0x18')](_0x5aea12);logger[_0x021e('0x18')](_0x132d1e);if(_0x570fe9){logger[_0x021e('0x14')](_0x570fe9);return _0x6742e0['status'](0x1f4)[_0x021e('0x12')](_0x570fe9);}return _0x6742e0[_0x021e('0x11')](0xc8)[_0x021e('0x12')]({'output':_0x5aea12});});};exports[_0x021e('0x1c')]=function(_0x2d31d3,_0x808331){return pm2[_0x021e('0x1c')](_0x021e('0x1d'))['then'](function(_0x2db4d3){logger[_0x021e('0x18')](_0x021e('0x1e'),_0x2db4d3);return _0x808331[_0x021e('0x11')](0xc8)[_0x021e('0x12')]({'output':_0x021e('0x1f')});})['catch'](function(_0x323ad3){logger[_0x021e('0x14')](_0x323ad3);return _0x808331[_0x021e('0x11')](0x1f4)[_0x021e('0x12')](_0x323ad3);});};exports[_0x021e('0x20')]=function(_0xb600ff,_0x39a172){var _0x235ec9=fs[_0x021e('0x21')](path[_0x021e('0x22')](config[_0x021e('0x23')],'server',_0x021e('0x20')));var _0x3e52d9=[];for(var _0x1eccbd=0x0;_0x1eccbd<_0x235ec9[_0x021e('0x24')];_0x1eccbd++){var _0x130811=_0x235ec9[_0x1eccbd][_0x021e('0x25')](_0x021e('0x26'),'');if(compareVersions(module[_0x021e('0xc')][_0x021e('0x4')],_0x130811)===-0x1){_0x3e52d9['push'](_0x130811);}}if(_0x3e52d9[_0x021e('0x24')]){var _0x4c056c=_0x3e52d9[_0x021e('0x27')](compareVersions);var _0x3a9900=new Umzug({'storage':_0x021e('0x28'),'storageOptions':{'model':db[_0x021e('0x29')],'modelName':_0x021e('0x29'),'columnName':_0x021e('0x4')},'migrations':{'params':[db[_0x021e('0x28')][_0x021e('0x2a')](),db['sequelize'][_0x021e('0x2b')],function(){throw new Error(_0x021e('0x2c'));}],'path':path[_0x021e('0x22')](config['root'],_0x021e('0x2d'),'migrations'),'pattern':/\.js$/}});_0x3a9900['up']({'migrations':_['map'](_0x4c056c,function(_0x20c5e0){return _0x20c5e0+_0x021e('0x26');})})['then'](function(){return _0x39a172[_0x021e('0x11')](0xc8)['json']({'output':_0x021e('0x2e')+module['exports'][_0x021e('0x4')]+_0x021e('0x2f')+_[_0x021e('0x30')](_0x4c056c),'migrations':_[_0x021e('0x22')](_0x4c056c)});})[_0x021e('0x31')](function(_0x2e312e){if(_0x2e312e instanceof db[_0x021e('0x28')][_0x021e('0x32')]){return _0x39a172['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x39a172[_0x021e('0x11')](0x1f4)[_0x021e('0x12')](_0x2e312e);}});}else{return _0x39a172['status'](0xc8)['json']({'output':_0x021e('0x33')});}}; \ No newline at end of file +var _0x7bec=['map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','query','latest','fetch','tags','2.0.0','status','json','master','info','git\x20fetch','--hard','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.'];(function(_0x4932ec,_0x5d16ee){var _0x286bc7=function(_0x27c73a){while(--_0x27c73a){_0x4932ec['push'](_0x4932ec['shift']());}};_0x286bc7(++_0x5d16ee);}(_0x7bec,0xd9));var _0xc7be=function(_0x46adcd,_0x15c37b){_0x46adcd=_0x46adcd-0x0;var _0x2f9454=_0x7bec[_0x46adcd];return _0x2f9454;};'use strict';var Umzug=require(_0xc7be('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xc7be('0x1'));var pkginfo=require(_0xc7be('0x2'))(module,_0xc7be('0x3'));var compareVersions=require(_0xc7be('0x4'));var exec=require('child_process')[_0xc7be('0x5')];var db=require(_0xc7be('0x6'))['db'];var config=require(_0xc7be('0x7'));var pm2=require(_0xc7be('0x8'));var logger=require(_0xc7be('0x9'))(_0xc7be('0xa'));var git=require(_0xc7be('0xb'))(config[_0xc7be('0xc')]);exports['index']=function(_0x2e75ff,_0x296fee){var _0xd188c5={'current':module[_0xc7be('0xd')][_0xc7be('0x3')],'phonebar':0x2};if(_0x2e75ff[_0xc7be('0xe')]&&_0x2e75ff['query'][_0xc7be('0xf')]){return git[_0xc7be('0x10')]()[_0xc7be('0x11')](function(_0xfbb5bd,_0x4598a0){_0xd188c5[_0xc7be('0xf')]=(_0xfbb5bd?module['exports'][_0xc7be('0x3')]:_0x4598a0[_0xc7be('0xf')])||_0xc7be('0x12');return _0x296fee[_0xc7be('0x13')](0xc8)[_0xc7be('0x14')](_0xd188c5);});}else{return _0x296fee['status'](0xc8)[_0xc7be('0x14')](_0xd188c5);}};exports['fetch']=function(_0x7567d6,_0x7f021){return git['fetch'](['origin',_0xc7be('0x15')],function(_0x586531){if(_0x586531){logger['error'](_0x586531);return _0x7f021[_0xc7be('0x13')](0x1f4)['json'](_0x586531);}logger[_0xc7be('0x16')](_0xc7be('0x17'));return _0x7f021[_0xc7be('0x13')](0xc8)[_0xc7be('0x14')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x462109,_0x57eff9){return git['reset']([_0xc7be('0x18'),'FETCH_HEAD'],function(_0x55c7af){if(_0x55c7af){logger[_0xc7be('0x19')](_0x55c7af);return _0x57eff9[_0xc7be('0x13')](0x1f4)['json'](_0x55c7af);}logger[_0xc7be('0x16')](_0xc7be('0x1a'));return _0x57eff9[_0xc7be('0x13')](0xc8)[_0xc7be('0x14')]({'output':_0xc7be('0x1b')});});};exports[_0xc7be('0x1c')]=function(_0x3a57f2,_0x425e95){exec(_0xc7be('0x1d'),function(_0x6669f8,_0x23f597,_0x3917d5){logger[_0xc7be('0x16')](_0x23f597);logger[_0xc7be('0x16')](_0x3917d5);if(_0x6669f8){logger[_0xc7be('0x19')](_0x6669f8);return _0x425e95[_0xc7be('0x13')](0x1f4)[_0xc7be('0x14')](_0x6669f8);}return _0x425e95[_0xc7be('0x13')](0xc8)[_0xc7be('0x14')]({'output':_0x23f597});});};exports[_0xc7be('0x1e')]=function(_0x47599f,_0x338395){return pm2[_0xc7be('0x1e')](_0xc7be('0x1f'))[_0xc7be('0x20')](function(_0x3998a9){logger[_0xc7be('0x16')](_0xc7be('0x21'),_0x3998a9);return _0x338395['status'](0xc8)['json']({'output':_0xc7be('0x22')});})[_0xc7be('0x23')](function(_0x1037b7){logger[_0xc7be('0x19')](_0x1037b7);return _0x338395[_0xc7be('0x13')](0x1f4)['json'](_0x1037b7);});};exports[_0xc7be('0x24')]=function(_0x4c9f07,_0x5c59f4){var _0x2b4d32=fs[_0xc7be('0x25')](path[_0xc7be('0x26')](config[_0xc7be('0xc')],_0xc7be('0x27'),_0xc7be('0x24')));var _0x580654=[];for(var _0x2ce6b6=0x0;_0x2ce6b6<_0x2b4d32[_0xc7be('0x28')];_0x2ce6b6++){var _0xe33916=_0x2b4d32[_0x2ce6b6][_0xc7be('0x29')](_0xc7be('0x2a'),'');if(compareVersions(module[_0xc7be('0xd')]['version'],_0xe33916)===-0x1){_0x580654[_0xc7be('0x2b')](_0xe33916);}}if(_0x580654[_0xc7be('0x28')]){var _0xd39ed3=_0x580654[_0xc7be('0x2c')](compareVersions);var _0xd41f0e=new Umzug({'storage':_0xc7be('0x2d'),'storageOptions':{'model':db[_0xc7be('0x2e')],'modelName':_0xc7be('0x2e'),'columnName':_0xc7be('0x3')},'migrations':{'params':[db[_0xc7be('0x2d')]['getQueryInterface'](),db[_0xc7be('0x2d')]['constructor'],function(){throw new Error(_0xc7be('0x2f'));}],'path':path[_0xc7be('0x26')](config['root'],'server',_0xc7be('0x24')),'pattern':/\.js$/}});_0xd41f0e['up']({'migrations':_[_0xc7be('0x30')](_0xd39ed3,function(_0x35fd32){return _0x35fd32+'.js';})})[_0xc7be('0x20')](function(){return _0x5c59f4['status'](0xc8)['json']({'output':_0xc7be('0x31')+module[_0xc7be('0xd')][_0xc7be('0x3')]+_0xc7be('0x32')+_['last'](_0xd39ed3),'migrations':_[_0xc7be('0x26')](_0xd39ed3)});})['catch'](function(_0x11af99){if(_0x11af99 instanceof db[_0xc7be('0x2d')][_0xc7be('0x33')]){return _0x5c59f4[_0xc7be('0x13')](0xc8)[_0xc7be('0x14')]({'output':_0xc7be('0x34')});}else{return _0x5c59f4[_0xc7be('0x13')](0x1f4)[_0xc7be('0x14')](_0x11af99);}});}else{return _0x5c59f4[_0xc7be('0x13')](0xc8)[_0xc7be('0x14')]({'output':_0xc7be('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 96ae8e3..bdc8bad 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 _0xdf97=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x13f058,_0x258115){var _0x24d3b0=function(_0x5e80fc){while(--_0x5e80fc){_0x13f058['push'](_0x13f058['shift']());}};_0x24d3b0(++_0x258115);}(_0xdf97,0xfb));var _0x7df9=function(_0x4d5a38,_0x4bf584){_0x4d5a38=_0x4d5a38-0x0;var _0x35ebf2=_0xdf97[_0x4d5a38];return _0x35ebf2;};'use strict';var multer=require(_0x7df9('0x0'));var util=require('util');var path=require(_0x7df9('0x1'));var timeout=require(_0x7df9('0x2'));var express=require(_0x7df9('0x3'));var router=express[_0x7df9('0x4')]();var fs_extra=require(_0x7df9('0x5'));var auth=require(_0x7df9('0x6'));var interaction=require(_0x7df9('0x7'));var config=require('../../config/environment');var controller=require(_0x7df9('0x8'));router[_0x7df9('0x9')]('/',auth[_0x7df9('0xa')](),controller[_0x7df9('0xb')]);router[_0x7df9('0x9')](_0x7df9('0xc'),auth[_0x7df9('0xa')](),controller[_0x7df9('0xd')]);router[_0x7df9('0x9')](_0x7df9('0xe'),auth[_0x7df9('0xa')](),controller[_0x7df9('0xf')]);router[_0x7df9('0x10')]('/',auth['isAuthenticated'](),controller[_0x7df9('0x11')]);router[_0x7df9('0x12')](_0x7df9('0xe'),auth[_0x7df9('0xa')](),controller[_0x7df9('0x13')]);router[_0x7df9('0x14')](_0x7df9('0xe'),auth[_0x7df9('0xa')](),controller[_0x7df9('0x15')]);module[_0x7df9('0x16')]=router; \ No newline at end of file +var _0xc158=['index','get','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated'];(function(_0x52121d,_0x1d1704){var _0x448627=function(_0x495bf0){while(--_0x495bf0){_0x52121d['push'](_0x52121d['shift']());}};_0x448627(++_0x1d1704);}(_0xc158,0x187));var _0x8c15=function(_0x338dd7,_0x1a4ffa){_0x338dd7=_0x338dd7-0x0;var _0x1f5cdf=_0xc158[_0x338dd7];return _0x1f5cdf;};'use strict';var multer=require(_0x8c15('0x0'));var util=require('util');var path=require(_0x8c15('0x1'));var timeout=require('connect-timeout');var express=require(_0x8c15('0x2'));var router=express[_0x8c15('0x3')]();var fs_extra=require(_0x8c15('0x4'));var auth=require(_0x8c15('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8c15('0x6'));var controller=require(_0x8c15('0x7'));router['get']('/',auth[_0x8c15('0x8')](),controller[_0x8c15('0x9')]);router[_0x8c15('0xa')](_0x8c15('0xb'),auth[_0x8c15('0x8')](),controller[_0x8c15('0xc')]);router[_0x8c15('0xa')](_0x8c15('0xd'),auth[_0x8c15('0x8')](),controller[_0x8c15('0xe')]);router['post']('/',auth[_0x8c15('0x8')](),controller[_0x8c15('0xf')]);router[_0x8c15('0x10')](_0x8c15('0xd'),auth[_0x8c15('0x8')](),controller[_0x8c15('0x11')]);router['delete'](_0x8c15('0xd'),auth[_0x8c15('0x8')](),controller[_0x8c15('0x12')]);module[_0x8c15('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 0005c2a..a81b9ca 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 _0x777d=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x21a33e,_0x3d5a0f){var _0x5622d1=function(_0x463d7c){while(--_0x463d7c){_0x21a33e['push'](_0x21a33e['shift']());}};_0x5622d1(++_0x3d5a0f);}(_0x777d,0xe9));var _0xd777=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x777d[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require('sequelize');module[_0xd777('0x0')]={'type':{'type':Sequelize[_0xd777('0x1')]},'uniqueid':{'type':Sequelize[_0xd777('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd777('0x1')]},'queue':{'type':Sequelize[_0xd777('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xd777('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xd777('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xd777('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd777('0x3')]},'agentacw':{'type':Sequelize[_0xd777('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd777('0x3')]},'reason':{'type':Sequelize[_0xd777('0x1')]},'lastevent':{'type':Sequelize[_0xd777('0x1')]},'channel':{'type':Sequelize[_0xd777('0x1')]},'channelstate':{'type':Sequelize[_0xd777('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd777('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd777('0x1')]},'connectedlinename':{'type':Sequelize[_0xd777('0x1')]},'language':{'type':Sequelize[_0xd777('0x1')]},'accountcode':{'type':Sequelize[_0xd777('0x1')]},'context':{'type':Sequelize[_0xd777('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd777('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd777('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd777('0x1')]},'destcalleridname':{'type':Sequelize[_0xd777('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd777('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd777('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xd777('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xd777('0x1')]},'destpriority':{'type':Sequelize[_0xd777('0x1')]},'destuniqueid':{'type':Sequelize[_0xd777('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd777('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd777('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd777('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd777('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xd777('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x531a=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x475064,_0x499b4c){var _0x1c97b0=function(_0x3b3e5b){while(--_0x3b3e5b){_0x475064['push'](_0x475064['shift']());}};_0x1c97b0(++_0x499b4c);}(_0x531a,0x100));var _0xa531=function(_0x1846b8,_0x5e9fd2){_0x1846b8=_0x1846b8-0x0;var _0x5d29ea=_0x531a[_0x1846b8];return _0x5d29ea;};'use strict';var Sequelize=require(_0xa531('0x0'));module[_0xa531('0x1')]={'type':{'type':Sequelize[_0xa531('0x2')]},'uniqueid':{'type':Sequelize[_0xa531('0x2')]},'calleridnum':{'type':Sequelize[_0xa531('0x2')]},'calleridname':{'type':Sequelize[_0xa531('0x2')]},'queue':{'type':Sequelize[_0xa531('0x2')]},'interface':{'type':Sequelize[_0xa531('0x2')]},'membername':{'type':Sequelize[_0xa531('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa531('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xa531('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xa531('0x3')]},'holdtime':{'type':Sequelize[_0xa531('0x4')]},'agentcomplete':{'type':Sequelize[_0xa531('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xa531('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xa531('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xa531('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa531('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xa531('0x2')]},'channel':{'type':Sequelize[_0xa531('0x2')]},'channelstate':{'type':Sequelize[_0xa531('0x4')]},'channelstatedesc':{'type':Sequelize[_0xa531('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa531('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa531('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa531('0x2')]},'exten':{'type':Sequelize[_0xa531('0x2')]},'priority':{'type':Sequelize[_0xa531('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa531('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xa531('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xa531('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xa531('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xa531('0x2')]},'destaccountcode':{'type':Sequelize[_0xa531('0x2')]},'destcontext':{'type':Sequelize[_0xa531('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xa531('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xa531('0x2')]},'transfer':{'type':Sequelize[_0xa531('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa531('0x2')],'comment':_0xa531('0x6')},'transferexten':{'type':Sequelize[_0xa531('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xa531('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 7c2df25..cfc42b9 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(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 c8f2150..1e298ed 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 _0x31f0=['report_agent','uniqueid','destuniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voiceAgentReport.attributes','define'];(function(_0x33db89,_0x53a578){var _0x42aa66=function(_0x3067b3){while(--_0x3067b3){_0x33db89['push'](_0x33db89['shift']());}};_0x42aa66(++_0x53a578);}(_0x31f0,0xb7));var _0x031f=function(_0x1f7cc3,_0x3de3df){_0x1f7cc3=_0x1f7cc3-0x0;var _0xd3f7c5=_0x31f0[_0x1f7cc3];return _0xd3f7c5;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[{'fields':[_0x031f('0xa'),_0x031f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa6bb=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xa6bb,0x12c));var _0xba6b=function(_0x4c17a6,_0x4d3652){_0x4c17a6=_0x4c17a6-0x0;var _0x13fc22=_0xa6bb[_0x4c17a6];return _0x13fc22;};'use strict';var _=require('lodash');var util=require(_0xba6b('0x0'));var logger=require(_0xba6b('0x1'))(_0xba6b('0x2'));var moment=require(_0xba6b('0x3'));var BPromise=require(_0xba6b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xba6b('0x5'));var config=require(_0xba6b('0x6'));var attributes=require(_0xba6b('0x7'));module[_0xba6b('0x8')]=function(_0x517d10,_0x4cc381){return _0x517d10[_0xba6b('0x9')](_0xba6b('0xa'),attributes,{'tableName':_0xba6b('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 7d2992a..431a09d 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 _0x8647=['where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','raw','UpdateVoiceAgentReport','update','options'];(function(_0x201efd,_0x561cd2){var _0x328cdb=function(_0x539b7c){while(--_0x539b7c){_0x201efd['push'](_0x201efd['shift']());}};_0x328cdb(++_0x561cd2);}(_0x8647,0xf8));var _0x7864=function(_0x24a2ce,_0x170647){_0x24a2ce=_0x24a2ce-0x0;var _0x53a02a=_0x8647[_0x24a2ce];return _0x53a02a;};'use strict';var _=require(_0x7864('0x0'));var util=require(_0x7864('0x1'));var moment=require(_0x7864('0x2'));var BPromise=require(_0x7864('0x3'));var rs=require(_0x7864('0x4'));var fs=require('fs');var Redis=require(_0x7864('0x5'));var db=require(_0x7864('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7864('0x7'))('rpc');var config=require(_0x7864('0x8'));var jayson=require(_0x7864('0x9'));var client=jayson[_0x7864('0xa')][_0x7864('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x826980,_0x1ed55a,_0x241f99){return new BPromise(function(_0x193cfb,_0x1544ec){return client['request'](_0x826980,_0x241f99)[_0x7864('0xc')](function(_0x1a1b31){logger[_0x7864('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x1ed55a,_0x7864('0xe'));logger[_0x7864('0xf')](_0x7864('0x10'),_0x1ed55a,'request\x20sent',JSON[_0x7864('0x11')](_0x1a1b31));if(_0x1a1b31[_0x7864('0x12')]){if(_0x1a1b31[_0x7864('0x12')][_0x7864('0x13')]===0x1f4){logger[_0x7864('0x12')](_0x7864('0x14'),_0x1ed55a,_0x1a1b31[_0x7864('0x12')]['message']);return _0x1544ec(_0x1a1b31['error'][_0x7864('0x15')]);}logger[_0x7864('0x12')](_0x7864('0x14'),_0x1ed55a,_0x1a1b31[_0x7864('0x12')]['message']);return _0x193cfb(_0x1a1b31[_0x7864('0x12')][_0x7864('0x15')]);}else{logger[_0x7864('0xd')](_0x7864('0x14'),_0x1ed55a,'request\x20sent');_0x193cfb(_0x1a1b31[_0x7864('0x16')][_0x7864('0x15')]);}})[_0x7864('0x17')](function(_0x358ed1){logger[_0x7864('0x12')](_0x7864('0x14'),_0x1ed55a,_0x358ed1);_0x1544ec(_0x358ed1);});});}exports[_0x7864('0x18')]=function(_0x535085){var _0x21a074=this;return new Promise(function(_0x537d57,_0x59f1c6){return db[_0x7864('0x19')][_0x7864('0x1a')](_0x535085[_0x7864('0x1b')],{'raw':_0x535085['options']?_0x535085['options'][_0x7864('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x7a858d){logger[_0x7864('0xd')](_0x7864('0x18'),_0x535085);logger[_0x7864('0xf')](_0x7864('0x18'),_0x535085,JSON['stringify'](_0x7a858d));_0x537d57(_0x7a858d);})[_0x7864('0x17')](function(_0x14f41a){logger['error'](_0x7864('0x18'),_0x14f41a[_0x7864('0x15')],_0x535085);_0x59f1c6(_0x21a074[_0x7864('0x12')](0x1f4,_0x14f41a[_0x7864('0x15')]));});});};exports[_0x7864('0x1d')]=function(_0x35ad44){var _0x598a9f=this;return new Promise(function(_0xb4190e,_0x34540e){return db['VoiceAgentReport'][_0x7864('0x1e')](_0x35ad44[_0x7864('0x1b')],{'raw':_0x35ad44[_0x7864('0x1f')]?_0x35ad44[_0x7864('0x1f')][_0x7864('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35ad44[_0x7864('0x1f')]?_0x35ad44[_0x7864('0x1f')][_0x7864('0x20')]||null:null,'attributes':_0x35ad44[_0x7864('0x1f')]?_0x35ad44[_0x7864('0x1f')][_0x7864('0x21')]||null:null,'limit':_0x35ad44[_0x7864('0x1f')]?_0x35ad44['options'][_0x7864('0x22')]||null:null})['then'](function(_0x367b97){logger[_0x7864('0xd')](_0x7864('0x1d'),_0x35ad44);logger[_0x7864('0xf')]('UpdateVoiceAgentReport',_0x35ad44,JSON['stringify'](_0x367b97));_0xb4190e(_0x367b97);})[_0x7864('0x17')](function(_0x408fae){logger[_0x7864('0x12')](_0x7864('0x1d'),_0x408fae[_0x7864('0x15')],_0x35ad44);_0x34540e(_0x598a9f[_0x7864('0x12')](0x1f4,_0x408fae['message']));});});}; \ No newline at end of file +var _0xce52=['raw','attributes','limit','UpdateVoiceAgentReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options'];(function(_0x350343,_0x256f69){var _0x9afc1c=function(_0x47ab32){while(--_0x47ab32){_0x350343['push'](_0x350343['shift']());}};_0x9afc1c(++_0x256f69);}(_0xce52,0x1a8));var _0x2ce5=function(_0x5d89b1,_0x22e52c){_0x5d89b1=_0x5d89b1-0x0;var _0x4e0add=_0xce52[_0x5d89b1];return _0x4e0add;};'use strict';var _=require('lodash');var util=require(_0x2ce5('0x0'));var moment=require('moment');var BPromise=require(_0x2ce5('0x1'));var rs=require(_0x2ce5('0x2'));var fs=require('fs');var Redis=require(_0x2ce5('0x3'));var db=require(_0x2ce5('0x4'))['db'];var utils=require(_0x2ce5('0x5'));var logger=require(_0x2ce5('0x6'))(_0x2ce5('0x7'));var config=require(_0x2ce5('0x8'));var jayson=require(_0x2ce5('0x9'));var client=jayson['client'][_0x2ce5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a79f1,_0x4ec972,_0x138f3a){return new BPromise(function(_0x48b517,_0x5aaed7){return client['request'](_0x5a79f1,_0x138f3a)[_0x2ce5('0xb')](function(_0x1824bd){logger[_0x2ce5('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x4ec972,'request\x20sent');logger['debug'](_0x2ce5('0xd'),_0x4ec972,_0x2ce5('0xe'),JSON[_0x2ce5('0xf')](_0x1824bd));if(_0x1824bd[_0x2ce5('0x10')]){if(_0x1824bd[_0x2ce5('0x10')][_0x2ce5('0x11')]===0x1f4){logger['error'](_0x2ce5('0x12'),_0x4ec972,_0x1824bd[_0x2ce5('0x10')]['message']);return _0x5aaed7(_0x1824bd['error'][_0x2ce5('0x13')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x4ec972,_0x1824bd[_0x2ce5('0x10')][_0x2ce5('0x13')]);return _0x48b517(_0x1824bd[_0x2ce5('0x10')][_0x2ce5('0x13')]);}else{logger[_0x2ce5('0xc')](_0x2ce5('0x12'),_0x4ec972,_0x2ce5('0xe'));_0x48b517(_0x1824bd['result'][_0x2ce5('0x13')]);}})[_0x2ce5('0x14')](function(_0x8a0aa0){logger[_0x2ce5('0x10')](_0x2ce5('0x12'),_0x4ec972,_0x8a0aa0);_0x5aaed7(_0x8a0aa0);});});}exports[_0x2ce5('0x15')]=function(_0x4b6c85){var _0x39b794=this;return new Promise(function(_0x8e7c46,_0x191f09){return db[_0x2ce5('0x16')][_0x2ce5('0x17')](_0x4b6c85[_0x2ce5('0x18')],{'raw':_0x4b6c85[_0x2ce5('0x19')]?_0x4b6c85[_0x2ce5('0x19')][_0x2ce5('0x1a')]===undefined?!![]:![]:!![]})[_0x2ce5('0xb')](function(_0x1c121a){logger[_0x2ce5('0xc')](_0x2ce5('0x15'),_0x4b6c85);logger['debug'](_0x2ce5('0x15'),_0x4b6c85,JSON['stringify'](_0x1c121a));_0x8e7c46(_0x1c121a);})['catch'](function(_0x148a46){logger[_0x2ce5('0x10')](_0x2ce5('0x15'),_0x148a46['message'],_0x4b6c85);_0x191f09(_0x39b794['error'](0x1f4,_0x148a46['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x44422b){var _0x2ce2af=this;return new Promise(function(_0x48f3b8,_0x58fdbc){return db[_0x2ce5('0x16')]['update'](_0x44422b[_0x2ce5('0x18')],{'raw':_0x44422b[_0x2ce5('0x19')]?_0x44422b[_0x2ce5('0x19')][_0x2ce5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44422b['options']?_0x44422b[_0x2ce5('0x19')]['where']||null:null,'attributes':_0x44422b[_0x2ce5('0x19')]?_0x44422b[_0x2ce5('0x19')][_0x2ce5('0x1b')]||null:null,'limit':_0x44422b[_0x2ce5('0x19')]?_0x44422b[_0x2ce5('0x19')][_0x2ce5('0x1c')]||null:null})[_0x2ce5('0xb')](function(_0xcde06b){logger[_0x2ce5('0xc')](_0x2ce5('0x1d'),_0x44422b);logger['debug']('UpdateVoiceAgentReport',_0x44422b,JSON['stringify'](_0xcde06b));_0x48f3b8(_0xcde06b);})[_0x2ce5('0x14')](function(_0x5f5740){logger[_0x2ce5('0x10')]('UpdateVoiceAgentReport',_0x5f5740[_0x2ce5('0x13')],_0x44422b);_0x58fdbc(_0x2ce2af[_0x2ce5('0x10')](0x1f4,_0x5f5740[_0x2ce5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 2dd772f..666e241 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 _0x7da7=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x361bb4,_0x411189){var _0x3e88c3=function(_0x263662){while(--_0x263662){_0x361bb4['push'](_0x361bb4['shift']());}};_0x3e88c3(++_0x411189);}(_0x7da7,0x10d));var _0x77da=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x7da7[_0x119280];return _0x481797;};'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('./voiceCallReport.controller');router[_0x77da('0x7')]('/',auth[_0x77da('0x8')](),controller['index']);router[_0x77da('0x7')]('/describe',auth[_0x77da('0x8')](),controller[_0x77da('0x9')]);router[_0x77da('0x7')](_0x77da('0xa'),auth[_0x77da('0x8')](),controller['show']);router[_0x77da('0xb')]('/',auth[_0x77da('0x8')](),controller[_0x77da('0xc')]);router['put'](_0x77da('0xa'),auth[_0x77da('0x8')](),controller[_0x77da('0xd')]);router[_0x77da('0xe')]('/:id',auth[_0x77da('0x8')](),controller[_0x77da('0xf')]);module[_0x77da('0x10')]=router; \ No newline at end of file +var _0xc949=['show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x68a9d4,_0x4dcea0){var _0x1ab9d9=function(_0x14436f){while(--_0x14436f){_0x68a9d4['push'](_0x68a9d4['shift']());}};_0x1ab9d9(++_0x4dcea0);}(_0xc949,0x181));var _0x9c94=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xc949[_0x1ddedd];return _0xa3e1ac;};'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('0xf')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0x10')]);router['put'](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x11')]);router[_0x9c94('0x12')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x13')]);module[_0x9c94('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 019e19d..d31e454 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 _0x8481=['STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize'];(function(_0x251750,_0x15266f){var _0x396d3e=function(_0x536ec6){while(--_0x536ec6){_0x251750['push'](_0x251750['shift']());}};_0x396d3e(++_0x15266f);}(_0x8481,0x1c7));var _0x1848=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x8481[_0x389832];return _0x59429e;};'use strict';var Sequelize=require(_0x1848('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1848('0x1')]},'type':{'type':Sequelize[_0x1848('0x2')](_0x1848('0x3'),_0x1848('0x4'),_0x1848('0x5'),_0x1848('0x6'),_0x1848('0x7'),_0x1848('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1848('0x1')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1848('0x1')]},'destinationchannel':{'type':Sequelize[_0x1848('0x1')]},'lastapplication':{'type':Sequelize[_0x1848('0x1')]},'lastdata':{'type':Sequelize[_0x1848('0x9')]},'starttime':{'type':Sequelize[_0x1848('0xa')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x1848('0xa')]},'endtime':{'type':Sequelize[_0x1848('0xa')]},'duration':{'type':Sequelize[_0x1848('0xb')]},'billableseconds':{'type':Sequelize[_0x1848('0xb')]},'mohtime':{'type':Sequelize[_0x1848('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1848('0x1')]},'amaflags':{'type':Sequelize[_0x1848('0x1')]},'userfield':{'type':Sequelize[_0x1848('0x1')]},'userDisposition':{'type':Sequelize[_0x1848('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x1848('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1848('0x1')]},'prefix':{'type':Sequelize[_0x1848('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc4e9=['sequelize','exports','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','STRING','TEXT','DATE','INTEGER'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xc4e9,0x144));var _0x9c4e=function(_0x568f96,_0x32d489){_0x568f96=_0x568f96-0x0;var _0x5a053a=_0xc4e9[_0x568f96];return _0x5a053a;};'use strict';var Sequelize=require(_0x9c4e('0x0'));module[_0x9c4e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9c4e('0x2')](_0x9c4e('0x3'),_0x9c4e('0x4'),_0x9c4e('0x5'),_0x9c4e('0x6'),_0x9c4e('0x7'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9c4e('0x8')]},'source':{'type':Sequelize[_0x9c4e('0x8')]},'destination':{'type':Sequelize[_0x9c4e('0x8')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9c4e('0x8')]},'channel':{'type':Sequelize[_0x9c4e('0x8')]},'destinationchannel':{'type':Sequelize[_0x9c4e('0x8')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x9c4e('0x9')]},'starttime':{'type':Sequelize[_0x9c4e('0xa')]},'systemanswertime':{'type':Sequelize[_0x9c4e('0xa')]},'answertime':{'type':Sequelize[_0x9c4e('0xa')]},'endtime':{'type':Sequelize[_0x9c4e('0xa')]},'duration':{'type':Sequelize[_0x9c4e('0xb')]},'billableseconds':{'type':Sequelize[_0x9c4e('0xb')]},'mohtime':{'type':Sequelize[_0x9c4e('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9c4e('0x8')]},'amaflags':{'type':Sequelize[_0x9c4e('0x8')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x9c4e('0x8')]},'userSecondDisposition':{'type':Sequelize[_0x9c4e('0x8')]},'userThirdDisposition':{'type':Sequelize[_0x9c4e('0x8')]},'note':{'type':Sequelize[_0x9c4e('0x8')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x9c4e('0xb')]},'sipcallid':{'type':Sequelize[_0x9c4e('0x8')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 7013d97..d74202b 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x39ce70,_0x2d77de){_0x39ce70=_0x39ce70-0x0;var _0x3f82b5=_0x2032[_0x39ce70];return _0x3f82b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file +var _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(_0x313bb5,_0x2e83d8){var _0x10b5cf=function(_0x4c8565){while(--_0x4c8565){_0x313bb5['push'](_0x313bb5['shift']());}};_0x10b5cf(++_0x2e83d8);}(_0xdb28,0x106));var _0x8db2=function(_0xb0e21e,_0x264bd4){_0xb0e21e=_0xb0e21e-0x0;var _0x672824=_0xdb28[_0xb0e21e];return _0x672824;};'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 9a0e2a8..5eecc2a 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 _0xf3f8=['report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x5f17af,_0x3cbae4){var _0x4bfbfe=function(_0x2dd3c7){while(--_0x2dd3c7){_0x5f17af['push'](_0x5f17af['shift']());}};_0x4bfbfe(++_0x3cbae4);}(_0xf3f8,0x1ee));var _0x8f3f=function(_0x53efff,_0x4a3b49){_0x53efff=_0x53efff-0x0;var _0x14d1bd=_0xf3f8[_0x53efff];return _0x14d1bd;};'use strict';var _=require('lodash');var util=require(_0x8f3f('0x0'));var logger=require(_0x8f3f('0x1'))(_0x8f3f('0x2'));var moment=require(_0x8f3f('0x3'));var BPromise=require(_0x8f3f('0x4'));var rp=require(_0x8f3f('0x5'));var fs=require('fs');var path=require(_0x8f3f('0x6'));var rimraf=require('rimraf');var config=require(_0x8f3f('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x8f3f('0x8')]=function(_0x22e9d3,_0x9e40c4){return _0x22e9d3[_0x8f3f('0x9')]('VoiceCallReport',attributes,{'tableName':_0x8f3f('0xa'),'paranoid':![],'indexes':[{'fields':[_0x8f3f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbfb0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','define','report_call','uniqueid','lodash','../../config/logger'];(function(_0x4c3d10,_0x4d2c9b){var _0x26d72e=function(_0x135463){while(--_0x135463){_0x4c3d10['push'](_0x4c3d10['shift']());}};_0x26d72e(++_0x4d2c9b);}(_0xbfb0,0x166));var _0x0bfb=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0xbfb0[_0x460150];return _0x340677;};'use strict';var _=require(_0x0bfb('0x0'));var util=require('util');var logger=require(_0x0bfb('0x1'))('api');var moment=require(_0x0bfb('0x2'));var BPromise=require(_0x0bfb('0x3'));var rp=require(_0x0bfb('0x4'));var fs=require('fs');var path=require(_0x0bfb('0x5'));var rimraf=require(_0x0bfb('0x6'));var config=require(_0x0bfb('0x7'));var attributes=require(_0x0bfb('0x8'));module['exports']=function(_0x29feb3,_0x7a9cdb){return _0x29feb3[_0x0bfb('0x9')]('VoiceCallReport',attributes,{'tableName':_0x0bfb('0xa'),'paranoid':![],'indexes':[{'fields':[_0x0bfb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 85d262b..bfe773e 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 _0x15a3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','options','where','attributes','limit','include','model','then','CreateVoiceCallReport','VoiceCallReport','create','body','stringify','UpdateVoiceCallReport','update'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x15a3,0x1e1));var _0x315a=function(_0x4f096e,_0x30d3c3){_0x4f096e=_0x4f096e-0x0;var _0x4a33ce=_0x15a3[_0x4f096e];return _0x4a33ce;};'use strict';var _=require(_0x315a('0x0'));var util=require(_0x315a('0x1'));var moment=require(_0x315a('0x2'));var BPromise=require(_0x315a('0x3'));var rs=require(_0x315a('0x4'));var fs=require('fs');var Redis=require(_0x315a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x315a('0x6'));var logger=require(_0x315a('0x7'))(_0x315a('0x8'));var config=require('../../config/environment');var jayson=require(_0x315a('0x9'));var client=jayson['client'][_0x315a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f7596,_0x1e52ca,_0x20f104){return new BPromise(function(_0x52f9ab,_0x21459b){return client[_0x315a('0xb')](_0x2f7596,_0x20f104)['then'](function(_0x3a4b25){logger[_0x315a('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x1e52ca,_0x315a('0xd'));logger[_0x315a('0xe')](_0x315a('0xf'),_0x1e52ca,_0x315a('0xd'),JSON['stringify'](_0x3a4b25));if(_0x3a4b25[_0x315a('0x10')]){if(_0x3a4b25[_0x315a('0x10')][_0x315a('0x11')]===0x1f4){logger[_0x315a('0x10')](_0x315a('0x12'),_0x1e52ca,_0x3a4b25[_0x315a('0x10')][_0x315a('0x13')]);return _0x21459b(_0x3a4b25[_0x315a('0x10')]['message']);}logger[_0x315a('0x10')](_0x315a('0x12'),_0x1e52ca,_0x3a4b25['error'][_0x315a('0x13')]);return _0x52f9ab(_0x3a4b25[_0x315a('0x10')][_0x315a('0x13')]);}else{logger[_0x315a('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x1e52ca,_0x315a('0xd'));_0x52f9ab(_0x3a4b25[_0x315a('0x14')][_0x315a('0x13')]);}})[_0x315a('0x15')](function(_0x5737fb){logger[_0x315a('0x10')](_0x315a('0x12'),_0x1e52ca,_0x5737fb);_0x21459b(_0x5737fb);});});}exports[_0x315a('0x16')]=function(_0x3cabf3){var _0x52428e=this;return new Promise(function(_0xb54132,_0x2d272e){return db['VoiceCallReport']['findAll']({'raw':_0x3cabf3[_0x315a('0x17')]?_0x3cabf3[_0x315a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cabf3[_0x315a('0x17')]?_0x3cabf3[_0x315a('0x17')][_0x315a('0x18')]||null:null,'attributes':_0x3cabf3['options']?_0x3cabf3[_0x315a('0x17')][_0x315a('0x19')]||null:null,'limit':_0x3cabf3[_0x315a('0x17')]?_0x3cabf3[_0x315a('0x17')][_0x315a('0x1a')]||null:null,'include':_0x3cabf3[_0x315a('0x17')]?_0x3cabf3[_0x315a('0x17')]['include']?_['map'](_0x3cabf3['options'][_0x315a('0x1b')],function(_0x2de16f){return{'model':db[_0x2de16f[_0x315a('0x1c')]],'as':_0x2de16f['as'],'attributes':_0x2de16f[_0x315a('0x19')],'include':_0x2de16f[_0x315a('0x1b')]?_['map'](_0x2de16f[_0x315a('0x1b')],function(_0x317436){return{'model':db[_0x317436[_0x315a('0x1c')]],'as':_0x317436['as'],'attributes':_0x317436[_0x315a('0x19')],'include':_0x317436[_0x315a('0x1b')]?_['map'](_0x317436['include'],function(_0x3d56a8){return{'model':db[_0x3d56a8[_0x315a('0x1c')]],'as':_0x3d56a8['as'],'attributes':_0x3d56a8['attributes']};}):[]};}):[]};}):[]:[]})[_0x315a('0x1d')](function(_0x551b34){logger[_0x315a('0xc')](_0x315a('0x16'),_0x3cabf3);logger[_0x315a('0xe')](_0x315a('0x16'),_0x3cabf3,JSON['stringify'](_0x551b34));_0xb54132(_0x551b34);})['catch'](function(_0x1cd76a){logger['error']('GetVoiceCallReport',_0x1cd76a['message'],_0x3cabf3);_0x2d272e(_0x52428e[_0x315a('0x10')](0x1f4,_0x1cd76a['message']));});});};exports[_0x315a('0x1e')]=function(_0x203556){var _0x393bba=this;return new Promise(function(_0x598e65,_0x10227b){return db[_0x315a('0x1f')][_0x315a('0x20')](_0x203556[_0x315a('0x21')],{'raw':_0x203556[_0x315a('0x17')]?_0x203556[_0x315a('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x315a('0x1d')](function(_0xd1ac76){logger[_0x315a('0xc')](_0x315a('0x1e'),_0x203556);logger[_0x315a('0xe')]('CreateVoiceCallReport',_0x203556,JSON[_0x315a('0x22')](_0xd1ac76));_0x598e65(_0xd1ac76);})[_0x315a('0x15')](function(_0x4d5606){logger[_0x315a('0x10')](_0x315a('0x1e'),_0x4d5606[_0x315a('0x13')],_0x203556);_0x10227b(_0x393bba['error'](0x1f4,_0x4d5606[_0x315a('0x13')]));});});};exports[_0x315a('0x23')]=function(_0x5be921){var _0x4c776a=this;return new Promise(function(_0x46e64b,_0x4d93f1){return db[_0x315a('0x1f')][_0x315a('0x24')](_0x5be921[_0x315a('0x21')],{'raw':_0x5be921[_0x315a('0x17')]?_0x5be921[_0x315a('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5be921['options']?_0x5be921[_0x315a('0x17')]['where']||null:null,'attributes':_0x5be921[_0x315a('0x17')]?_0x5be921['options'][_0x315a('0x19')]||null:null,'limit':_0x5be921['options']?_0x5be921[_0x315a('0x17')]['limit']||null:null})['then'](function(_0x5e9165){logger['info'](_0x315a('0x23'),_0x5be921);logger['debug']('UpdateVoiceCallReport',_0x5be921,JSON[_0x315a('0x22')](_0x5e9165));_0x46e64b(_0x5e9165);})['catch'](function(_0x2450c0){logger[_0x315a('0x10')](_0x315a('0x23'),_0x2450c0[_0x315a('0x13')],_0x5be921);_0x4d93f1(_0x4c776a[_0x315a('0x10')](0x1f4,_0x2450c0[_0x315a('0x13')]));});});}; \ No newline at end of file +var _0x78e4=['error','code','message','result','catch','VoiceCallReport','findAll','options','raw','limit','include','map','model','attributes','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x32c358,_0x413b6b){var _0x47c7a7=function(_0x423124){while(--_0x423124){_0x32c358['push'](_0x32c358['shift']());}};_0x47c7a7(++_0x413b6b);}(_0x78e4,0x191));var _0x478e=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x78e4[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x478e('0x0'));var util=require('util');var moment=require(_0x478e('0x1'));var BPromise=require('bluebird');var rs=require(_0x478e('0x2'));var fs=require('fs');var Redis=require(_0x478e('0x3'));var db=require(_0x478e('0x4'))['db'];var utils=require(_0x478e('0x5'));var logger=require(_0x478e('0x6'))(_0x478e('0x7'));var config=require(_0x478e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x478e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11bd43,_0x3416c5,_0x372bc6){return new BPromise(function(_0x278098,_0x52ecf2){return client[_0x478e('0xa')](_0x11bd43,_0x372bc6)[_0x478e('0xb')](function(_0x3dbc90){logger[_0x478e('0xc')](_0x478e('0xd'),_0x3416c5,'request\x20sent');logger[_0x478e('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x3416c5,_0x478e('0xf'),JSON[_0x478e('0x10')](_0x3dbc90));if(_0x3dbc90[_0x478e('0x11')]){if(_0x3dbc90[_0x478e('0x11')][_0x478e('0x12')]===0x1f4){logger['error'](_0x478e('0xd'),_0x3416c5,_0x3dbc90[_0x478e('0x11')]['message']);return _0x52ecf2(_0x3dbc90[_0x478e('0x11')][_0x478e('0x13')]);}logger[_0x478e('0x11')](_0x478e('0xd'),_0x3416c5,_0x3dbc90[_0x478e('0x11')][_0x478e('0x13')]);return _0x278098(_0x3dbc90[_0x478e('0x11')][_0x478e('0x13')]);}else{logger[_0x478e('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x3416c5,'request\x20sent');_0x278098(_0x3dbc90[_0x478e('0x14')][_0x478e('0x13')]);}})[_0x478e('0x15')](function(_0x4fd6f0){logger['error'](_0x478e('0xd'),_0x3416c5,_0x4fd6f0);_0x52ecf2(_0x4fd6f0);});});}exports['GetVoiceCallReport']=function(_0x14f10a){var _0x337858=this;return new Promise(function(_0x54318b,_0x54f7b4){return db[_0x478e('0x16')][_0x478e('0x17')]({'raw':_0x14f10a[_0x478e('0x18')]?_0x14f10a[_0x478e('0x18')][_0x478e('0x19')]===undefined?!![]:![]:!![],'where':_0x14f10a[_0x478e('0x18')]?_0x14f10a[_0x478e('0x18')]['where']||null:null,'attributes':_0x14f10a['options']?_0x14f10a['options']['attributes']||null:null,'limit':_0x14f10a[_0x478e('0x18')]?_0x14f10a[_0x478e('0x18')][_0x478e('0x1a')]||null:null,'include':_0x14f10a['options']?_0x14f10a[_0x478e('0x18')][_0x478e('0x1b')]?_[_0x478e('0x1c')](_0x14f10a[_0x478e('0x18')][_0x478e('0x1b')],function(_0x1d4e26){return{'model':db[_0x1d4e26[_0x478e('0x1d')]],'as':_0x1d4e26['as'],'attributes':_0x1d4e26[_0x478e('0x1e')],'include':_0x1d4e26[_0x478e('0x1b')]?_[_0x478e('0x1c')](_0x1d4e26[_0x478e('0x1b')],function(_0x49d228){return{'model':db[_0x49d228[_0x478e('0x1d')]],'as':_0x49d228['as'],'attributes':_0x49d228[_0x478e('0x1e')],'include':_0x49d228[_0x478e('0x1b')]?_['map'](_0x49d228[_0x478e('0x1b')],function(_0x2ee176){return{'model':db[_0x2ee176['model']],'as':_0x2ee176['as'],'attributes':_0x2ee176[_0x478e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49c7df){logger[_0x478e('0xc')]('GetVoiceCallReport',_0x14f10a);logger[_0x478e('0xe')](_0x478e('0x1f'),_0x14f10a,JSON['stringify'](_0x49c7df));_0x54318b(_0x49c7df);})[_0x478e('0x15')](function(_0x39f645){logger[_0x478e('0x11')](_0x478e('0x1f'),_0x39f645['message'],_0x14f10a);_0x54f7b4(_0x337858['error'](0x1f4,_0x39f645[_0x478e('0x13')]));});});};exports[_0x478e('0x20')]=function(_0xb39ae4){var _0x3453a3=this;return new Promise(function(_0x11d24a,_0x211a1f){return db[_0x478e('0x16')][_0x478e('0x21')](_0xb39ae4[_0x478e('0x22')],{'raw':_0xb39ae4[_0x478e('0x18')]?_0xb39ae4[_0x478e('0x18')][_0x478e('0x19')]===undefined?!![]:![]:!![]})[_0x478e('0xb')](function(_0x1b7a23){logger['info'](_0x478e('0x20'),_0xb39ae4);logger[_0x478e('0xe')](_0x478e('0x20'),_0xb39ae4,JSON[_0x478e('0x10')](_0x1b7a23));_0x11d24a(_0x1b7a23);})['catch'](function(_0x5eb0e4){logger[_0x478e('0x11')](_0x478e('0x20'),_0x5eb0e4[_0x478e('0x13')],_0xb39ae4);_0x211a1f(_0x3453a3[_0x478e('0x11')](0x1f4,_0x5eb0e4[_0x478e('0x13')]));});});};exports[_0x478e('0x23')]=function(_0x132750){var _0x49e170=this;return new Promise(function(_0x9e5256,_0x49f098){return db[_0x478e('0x16')][_0x478e('0x24')](_0x132750['body'],{'raw':_0x132750[_0x478e('0x18')]?_0x132750[_0x478e('0x18')][_0x478e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x132750[_0x478e('0x18')]?_0x132750[_0x478e('0x18')][_0x478e('0x25')]||null:null,'attributes':_0x132750[_0x478e('0x18')]?_0x132750['options'][_0x478e('0x1e')]||null:null,'limit':_0x132750[_0x478e('0x18')]?_0x132750[_0x478e('0x18')]['limit']||null:null})[_0x478e('0xb')](function(_0x463d72){logger[_0x478e('0xc')](_0x478e('0x23'),_0x132750);logger[_0x478e('0xe')](_0x478e('0x23'),_0x132750,JSON['stringify'](_0x463d72));_0x9e5256(_0x463d72);})[_0x478e('0x15')](function(_0x57072b){logger[_0x478e('0x11')]('UpdateVoiceCallReport',_0x57072b[_0x478e('0x13')],_0x132750);_0x49f098(_0x49e170[_0x478e('0x11')](0x1f4,_0x57072b[_0x478e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 164bf50..9dff892 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 _0x587a=['isAuthenticated','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x91ed5c,_0xdb6b34){var _0x2387d8=function(_0x1a9d15){while(--_0x1a9d15){_0x91ed5c['push'](_0x91ed5c['shift']());}};_0x2387d8(++_0xdb6b34);}(_0x587a,0x86));var _0xa587=function(_0x1a15f9,_0x124b61){_0x1a15f9=_0x1a15f9-0x0;var _0x59b4d1=_0x587a[_0x1a15f9];return _0x59b4d1;};'use strict';var multer=require('multer');var util=require(_0xa587('0x0'));var path=require(_0xa587('0x1'));var timeout=require(_0xa587('0x2'));var express=require(_0xa587('0x3'));var router=express[_0xa587('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa587('0x5'));var config=require(_0xa587('0x6'));var controller=require('./voiceChanSpy.controller');router[_0xa587('0x7')]('/',auth['isAuthenticated'](),controller[_0xa587('0x8')]);router[_0xa587('0x7')](_0xa587('0x9'),auth[_0xa587('0xa')](),controller[_0xa587('0xb')]);router[_0xa587('0xc')]('/',auth[_0xa587('0xa')](),controller[_0xa587('0xd')]);router['put'](_0xa587('0x9'),auth[_0xa587('0xa')](),controller[_0xa587('0xe')]);router[_0xa587('0xf')](_0xa587('0x9'),auth['isAuthenticated'](),controller[_0xa587('0x10')]);module[_0xa587('0x11')]=router; \ No newline at end of file +var _0xc9f2=['isAuthenticated','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','show'];(function(_0x23ca3a,_0xe44c43){var _0x5c1aab=function(_0x29bcdd){while(--_0x29bcdd){_0x23ca3a['push'](_0x23ca3a['shift']());}};_0x5c1aab(++_0xe44c43);}(_0xc9f2,0x1ce));var _0x2c9f=function(_0x107b16,_0x402aa4){_0x107b16=_0x107b16-0x0;var _0x45fcfe=_0xc9f2[_0x107b16];return _0x45fcfe;};'use strict';var multer=require(_0x2c9f('0x0'));var util=require(_0x2c9f('0x1'));var path=require(_0x2c9f('0x2'));var timeout=require(_0x2c9f('0x3'));var express=require(_0x2c9f('0x4'));var router=express['Router']();var fs_extra=require(_0x2c9f('0x5'));var auth=require(_0x2c9f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2c9f('0x7'));var controller=require(_0x2c9f('0x8'));router[_0x2c9f('0x9')]('/',auth['isAuthenticated'](),controller[_0x2c9f('0xa')]);router[_0x2c9f('0x9')](_0x2c9f('0xb'),auth['isAuthenticated'](),controller[_0x2c9f('0xc')]);router['post']('/',auth[_0x2c9f('0xd')](),controller[_0x2c9f('0xe')]);router[_0x2c9f('0xf')](_0x2c9f('0xb'),auth['isAuthenticated'](),controller[_0x2c9f('0x10')]);router['delete'](_0x2c9f('0xb'),auth[_0x2c9f('0xd')](),controller[_0x2c9f('0x11')]);module[_0x2c9f('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 51b7d8c..3155065 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 _0x1c71=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue','split'];(function(_0x28ade3,_0x3849b9){var _0x20ca87=function(_0x47515f){while(--_0x47515f){_0x28ade3['push'](_0x28ade3['shift']());}};_0x20ca87(++_0x3849b9);}(_0x1c71,0x1a5));var _0x11c7=function(_0x2097de,_0x109ecf){_0x2097de=_0x2097de-0x0;var _0x320d51=_0x1c71[_0x2097de];return _0x320d51;};'use strict';var Sequelize=require(_0x11c7('0x0'));module[_0x11c7('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x11c7('0x2')],'unique':_0x11c7('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x45b6a1){this[_0x11c7('0x4')](_0x11c7('0x5'),_0x45b6a1?_0x45b6a1[_0x11c7('0x6')](''):[]);},'get':function(){return this[_0x11c7('0x7')](_0x11c7('0x5'))?this[_0x11c7('0x7')](_0x11c7('0x5'))[_0x11c7('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x11c7('0x2')]},'record':{'type':Sequelize[_0x11c7('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x11c7('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x022e=['setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x460612,_0x169287){var _0x26c658=function(_0x3d28bf){while(--_0x3d28bf){_0x460612['push'](_0x460612['shift']());}};_0x26c658(++_0x169287);}(_0x022e,0xba));var _0xe022=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x022e[_0x2fc012];return _0x2891f9;};'use strict';var Sequelize=require(_0xe022('0x0'));module[_0xe022('0x1')]={'name':{'type':Sequelize[_0xe022('0x2')]},'prefix':{'type':Sequelize[_0xe022('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xe022('0x2')],'set':function(_0x4fa5dd){this[_0xe022('0x3')](_0xe022('0x4'),_0x4fa5dd?_0x4fa5dd[_0xe022('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xe022('0x4'))?this[_0xe022('0x6')]('options')[_0xe022('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xe022('0x2')]},'record':{'type':Sequelize[_0xe022('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe022('0x2')]},'description':{'type':Sequelize[_0xe022('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 682d3ae..f167e8f 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 _0x652b=['pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','then','get','ChanSpies','UserProfileResource','destroy','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x330550,_0x5d9249){var _0x3b5fc8=function(_0x1543be){while(--_0x1543be){_0x330550['push'](_0x330550['shift']());}};_0x3b5fc8(++_0x5d9249);}(_0x652b,0x68));var _0xb652=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x652b[_0x2aee2f];return _0x19337f;};'use strict';var emlformat=require(_0xb652('0x0'));var rimraf=require(_0xb652('0x1'));var zipdir=require(_0xb652('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb652('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb652('0x4'));var util=require(_0xb652('0x5'));var path=require(_0xb652('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb652('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb652('0x8'));var crypto=require('crypto');var jsforce=require(_0xb652('0x9'));var deskjs=require(_0xb652('0xa'));var toCsv=require(_0xb652('0xb'));var querystring=require(_0xb652('0xc'));var Papa=require(_0xb652('0xd'));var Redis=require(_0xb652('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb652('0xf'));var hardwareService=require(_0xb652('0x10'));var logger=require(_0xb652('0x11'))(_0xb652('0x12'));var utils=require('../../config/utils');var config=require(_0xb652('0x13'));var licenseUtil=require(_0xb652('0x14'));var db=require(_0xb652('0x15'))['db'];function respondWithStatusCode(_0x54c2e2,_0x1c182c){_0x1c182c=_0x1c182c||0xcc;return function(_0x813e0c){if(_0x813e0c){return _0x54c2e2['sendStatus'](_0x1c182c);}return _0x54c2e2['status'](_0x1c182c)['end']();};}function respondWithResult(_0x4921a0,_0x21ce7f){_0x21ce7f=_0x21ce7f||0xc8;return function(_0x4dda37){if(_0x4dda37){return _0x4921a0[_0xb652('0x16')](_0x21ce7f)[_0xb652('0x17')](_0x4dda37);}};}function respondWithFilteredResult(_0x16fbac,_0x50889e){return function(_0x1d6f1c){if(_0x1d6f1c){var _0x3621a4=typeof _0x50889e[_0xb652('0x18')]===_0xb652('0x19')&&typeof _0x50889e['limit']===_0xb652('0x19');var _0x289911=_0x1d6f1c[_0xb652('0x1a')];var _0x3bf3b0=_0x3621a4?0x0:_0x50889e['offset'];var _0x94d0b3=_0x3621a4?_0x1d6f1c['count']:_0x50889e[_0xb652('0x18')]+_0x50889e[_0xb652('0x1b')];var _0x22288e;if(_0x94d0b3>=_0x289911){_0x94d0b3=_0x289911;_0x22288e=0xc8;}else{_0x22288e=0xce;}_0x16fbac[_0xb652('0x16')](_0x22288e);return _0x16fbac['set'](_0xb652('0x1c'),_0x3bf3b0+'-'+_0x94d0b3+'/'+_0x289911)[_0xb652('0x17')](_0x1d6f1c);}return null;};}function patchUpdates(_0x3fc43e){return function(_0x169f41){try{jsonpatch[_0xb652('0x1d')](_0x169f41,_0x3fc43e,!![]);}catch(_0x3fb365){return BPromise['reject'](_0x3fb365);}return _0x169f41['save']();};}function saveUpdates(_0x71465c,_0x39a4e3){return function(_0x49a2b2){if(_0x49a2b2){return _0x49a2b2['update'](_0x71465c)[_0xb652('0x1e')](function(_0x48ae93){return _0x48ae93;});}return null;};}function removeEntity(_0x1884a0,_0x3756fb){return function(_0x52d51f){if(_0x52d51f){return _0x52d51f['destroy']()[_0xb652('0x1e')](function(){var _0xd6bbf9=_0x52d51f[_0xb652('0x1f')]({'plain':!![]});var _0x432a86=_0xb652('0x20');return db[_0xb652('0x21')][_0xb652('0x22')]({'where':{'type':_0x432a86,'resourceId':_0xd6bbf9['id']}})[_0xb652('0x1e')](function(){return _0x52d51f;});})['then'](function(){_0x1884a0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f169a,_0x51b969){return function(_0x1ba14b){if(!_0x1ba14b){_0x1f169a['sendStatus'](0x194);}return _0x1ba14b;};}function handleError(_0x44c51,_0x133a14){_0x133a14=_0x133a14||0x1f4;return function(_0x3b74eb){logger[_0xb652('0x23')](_0x3b74eb[_0xb652('0x24')]);if(_0x3b74eb['name']){delete _0x3b74eb[_0xb652('0x25')];}_0x44c51['status'](_0x133a14)[_0xb652('0x26')](_0x3b74eb);};}exports['index']=function(_0x19310c,_0x23e529){var _0x2f6c22={},_0x39de0d={},_0x33f6fc={'count':0x0,'rows':[]};var _0x1aafdf=_[_0xb652('0x27')](db[_0xb652('0x28')][_0xb652('0x29')],function(_0x2f93f4){return{'name':_0x2f93f4[_0xb652('0x2a')],'type':_0x2f93f4['type'][_0xb652('0x2b')]};});_0x39de0d[_0xb652('0x2c')]=_[_0xb652('0x27')](_0x1aafdf,_0xb652('0x25'));_0x39de0d[_0xb652('0x2d')]=_[_0xb652('0x2e')](_0x19310c['query']);_0x39de0d[_0xb652('0x2f')]=_[_0xb652('0x30')](_0x39de0d[_0xb652('0x2c')],_0x39de0d[_0xb652('0x2d')]);_0x2f6c22[_0xb652('0x31')]=_[_0xb652('0x30')](_0x39de0d[_0xb652('0x2c')],qs[_0xb652('0x32')](_0x19310c[_0xb652('0x2d')][_0xb652('0x32')]));_0x2f6c22['attributes']=_0x2f6c22[_0xb652('0x31')]['length']?_0x2f6c22['attributes']:_0x39de0d['model'];if(!_0x19310c[_0xb652('0x2d')][_0xb652('0x33')](_0xb652('0x34'))){_0x2f6c22['limit']=qs[_0xb652('0x1b')](_0x19310c['query'][_0xb652('0x1b')]);_0x2f6c22['offset']=qs[_0xb652('0x18')](_0x19310c['query'][_0xb652('0x18')]);}_0x2f6c22[_0xb652('0x35')]=qs[_0xb652('0x36')](_0x19310c[_0xb652('0x2d')]['sort']);_0x2f6c22[_0xb652('0x37')]=qs[_0xb652('0x2f')](_[_0xb652('0x38')](_0x19310c[_0xb652('0x2d')],_0x39de0d['filters']),_0x1aafdf);if(_0x19310c[_0xb652('0x2d')][_0xb652('0x39')]){_0x2f6c22['where']=_[_0xb652('0x3a')](_0x2f6c22['where'],{'$or':_['map'](_0x1aafdf,function(_0x3b70a8){if(_0x3b70a8[_0xb652('0x3b')]!==_0xb652('0x3c')){var _0x521739={};_0x521739[_0x3b70a8[_0xb652('0x25')]]={'$like':'%'+_0x19310c[_0xb652('0x2d')][_0xb652('0x39')]+'%'};return _0x521739;}})});}_0x2f6c22=_[_0xb652('0x3a')]({},_0x2f6c22,_0x19310c[_0xb652('0x3d')]);var _0x2223c9={'where':_0x2f6c22[_0xb652('0x37')]};return db[_0xb652('0x28')][_0xb652('0x1a')](_0x2223c9)[_0xb652('0x1e')](function(_0x501cb7){_0x33f6fc['count']=_0x501cb7;if(_0x19310c[_0xb652('0x2d')]['includeAll']){_0x2f6c22[_0xb652('0x3e')]=[{'all':!![]}];}return db[_0xb652('0x28')][_0xb652('0x3f')](_0x2f6c22);})[_0xb652('0x1e')](function(_0x190c7){_0x33f6fc[_0xb652('0x40')]=_0x190c7;return _0x33f6fc;})['then'](respondWithFilteredResult(_0x23e529,_0x2f6c22))['catch'](handleError(_0x23e529,null));};exports[_0xb652('0x41')]=function(_0x115dc2,_0x47664e){var _0x410d93={'raw':![],'where':{'id':_0x115dc2[_0xb652('0x42')]['id']}},_0x4ef02d={};_0x4ef02d[_0xb652('0x2c')]=_[_0xb652('0x2e')](db[_0xb652('0x28')][_0xb652('0x29')]);_0x4ef02d[_0xb652('0x2d')]=_[_0xb652('0x2e')](_0x115dc2[_0xb652('0x2d')]);_0x4ef02d[_0xb652('0x2f')]=_[_0xb652('0x30')](_0x4ef02d[_0xb652('0x2c')],_0x4ef02d[_0xb652('0x2d')]);_0x410d93[_0xb652('0x31')]=_[_0xb652('0x30')](_0x4ef02d['model'],qs['fields'](_0x115dc2[_0xb652('0x2d')][_0xb652('0x32')]));_0x410d93[_0xb652('0x31')]=_0x410d93['attributes'][_0xb652('0x43')]?_0x410d93['attributes']:_0x4ef02d[_0xb652('0x2c')];if(_0x115dc2[_0xb652('0x2d')][_0xb652('0x44')]){_0x410d93[_0xb652('0x3e')]=[{'all':!![]}];}_0x410d93=_[_0xb652('0x3a')]({},_0x410d93,_0x115dc2[_0xb652('0x3d')]);return db[_0xb652('0x28')][_0xb652('0x45')](_0x410d93)[_0xb652('0x1e')](handleEntityNotFound(_0x47664e,null))['then'](respondWithResult(_0x47664e,null))[_0xb652('0x46')](handleError(_0x47664e,null));};exports[_0xb652('0x47')]=function(_0x5a4d6c,_0x33eb79){return db['VoiceChanSpy'][_0xb652('0x47')](_0x5a4d6c[_0xb652('0x48')],{})[_0xb652('0x1e')](function(_0x52dbe0){var _0x21d093=_0x5a4d6c[_0xb652('0x49')][_0xb652('0x1f')]({'plain':!![]});if(!_0x21d093)throw new Error(_0xb652('0x4a'));if(_0x21d093[_0xb652('0x4b')]===_0xb652('0x49')){var _0x3e067c=_0x52dbe0[_0xb652('0x1f')]({'plain':!![]});var _0x5ece86='ChanSpies';return db[_0xb652('0x4c')][_0xb652('0x45')]({'where':{'name':_0x5ece86,'userProfileId':_0x21d093['userProfileId']},'raw':!![]})['then'](function(_0x58b1a5){if(_0x58b1a5&&_0x58b1a5[_0xb652('0x4d')]===0x0){return db[_0xb652('0x21')][_0xb652('0x47')]({'name':_0x3e067c[_0xb652('0x25')],'resourceId':_0x3e067c['id'],'type':_0x58b1a5['name'],'sectionId':_0x58b1a5['id']},{})['then'](function(){return _0x52dbe0;});}else{return _0x52dbe0;}})['catch'](function(_0x2934cc){logger[_0xb652('0x23')](_0xb652('0x4e'),_0x2934cc);throw _0x2934cc;});}return _0x52dbe0;})['then'](respondWithResult(_0x33eb79,0xc9))[_0xb652('0x46')](handleError(_0x33eb79,null));};exports[_0xb652('0x4f')]=function(_0x52c191,_0x552f3c){if(_0x52c191[_0xb652('0x48')]['id']){delete _0x52c191[_0xb652('0x48')]['id'];}return db[_0xb652('0x28')][_0xb652('0x45')]({'where':{'id':_0x52c191[_0xb652('0x42')]['id']}})[_0xb652('0x1e')](handleEntityNotFound(_0x552f3c,null))[_0xb652('0x1e')](saveUpdates(_0x52c191[_0xb652('0x48')],null))[_0xb652('0x1e')](respondWithResult(_0x552f3c,null))[_0xb652('0x46')](handleError(_0x552f3c,null));};exports[_0xb652('0x22')]=function(_0x56151e,_0x5bd504){return db['VoiceChanSpy'][_0xb652('0x45')]({'where':{'id':_0x56151e[_0xb652('0x42')]['id']}})[_0xb652('0x1e')](handleEntityNotFound(_0x5bd504,null))[_0xb652('0x1e')](removeEntity(_0x5bd504,null))[_0xb652('0x46')](handleError(_0x5bd504,null));}; \ No newline at end of file +var _0x32c0=['model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','options','include','findAll','catch','params','intersection','length','includeAll','merge','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','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','key'];(function(_0x5f4f2d,_0xfa6b47){var _0x568668=function(_0x1fa812){while(--_0x1fa812){_0x5f4f2d['push'](_0x5f4f2d['shift']());}};_0x568668(++_0xfa6b47);}(_0x32c0,0x1f3));var _0x032c=function(_0x2b510c,_0x2cf95a){_0x2b510c=_0x2b510c-0x0;var _0x2ac258=_0x32c0[_0x2b510c];return _0x2ac258;};'use strict';var emlformat=require(_0x032c('0x0'));var rimraf=require(_0x032c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x032c('0x2'));var rp=require(_0x032c('0x3'));var moment=require('moment');var BPromise=require(_0x032c('0x4'));var Mustache=require(_0x032c('0x5'));var util=require(_0x032c('0x6'));var path=require(_0x032c('0x7'));var sox=require('sox');var csv=require(_0x032c('0x8'));var ejs=require(_0x032c('0x9'));var fs=require('fs');var fs_extra=require(_0x032c('0xa'));var _=require(_0x032c('0xb'));var squel=require('squel');var crypto=require(_0x032c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x032c('0xd'));var toCsv=require(_0x032c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x032c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x032c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x032c('0x10'));var logger=require(_0x032c('0x11'))(_0x032c('0x12'));var utils=require(_0x032c('0x13'));var config=require(_0x032c('0x14'));var licenseUtil=require(_0x032c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25af77,_0xc88e78){_0xc88e78=_0xc88e78||0xcc;return function(_0x364605){if(_0x364605){return _0x25af77[_0x032c('0x16')](_0xc88e78);}return _0x25af77['status'](_0xc88e78)[_0x032c('0x17')]();};}function respondWithResult(_0x2650d6,_0x1ec9d8){_0x1ec9d8=_0x1ec9d8||0xc8;return function(_0x216984){if(_0x216984){return _0x2650d6[_0x032c('0x18')](_0x1ec9d8)[_0x032c('0x19')](_0x216984);}};}function respondWithFilteredResult(_0x51266f,_0xb678d5){return function(_0x15ddb8){if(_0x15ddb8){var _0x3ebda8=typeof _0xb678d5[_0x032c('0x1a')]===_0x032c('0x1b')&&typeof _0xb678d5[_0x032c('0x1c')]==='undefined';var _0x1444bb=_0x15ddb8[_0x032c('0x1d')];var _0x4435ad=_0x3ebda8?0x0:_0xb678d5[_0x032c('0x1a')];var _0x2b2693=_0x3ebda8?_0x15ddb8[_0x032c('0x1d')]:_0xb678d5[_0x032c('0x1a')]+_0xb678d5[_0x032c('0x1c')];var _0x3a6f71;if(_0x2b2693>=_0x1444bb){_0x2b2693=_0x1444bb;_0x3a6f71=0xc8;}else{_0x3a6f71=0xce;}_0x51266f[_0x032c('0x18')](_0x3a6f71);return _0x51266f[_0x032c('0x1e')](_0x032c('0x1f'),_0x4435ad+'-'+_0x2b2693+'/'+_0x1444bb)[_0x032c('0x19')](_0x15ddb8);}return null;};}function patchUpdates(_0x515409){return function(_0x8a8f30){try{jsonpatch['apply'](_0x8a8f30,_0x515409,!![]);}catch(_0x5341e6){return BPromise['reject'](_0x5341e6);}return _0x8a8f30['save']();};}function saveUpdates(_0x2a24f7,_0x4c0c4b){return function(_0x2ce758){if(_0x2ce758){return _0x2ce758[_0x032c('0x20')](_0x2a24f7)[_0x032c('0x21')](function(_0x51ad8c){return _0x51ad8c;});}return null;};}function removeEntity(_0x135612,_0x16d40f){return function(_0x28ae24){if(_0x28ae24){return _0x28ae24[_0x032c('0x22')]()[_0x032c('0x21')](function(){var _0x54a46=_0x28ae24[_0x032c('0x23')]({'plain':!![]});var _0x58894b=_0x032c('0x24');return db[_0x032c('0x25')][_0x032c('0x22')]({'where':{'type':_0x58894b,'resourceId':_0x54a46['id']}})['then'](function(){return _0x28ae24;});})[_0x032c('0x21')](function(){_0x135612[_0x032c('0x18')](0xcc)[_0x032c('0x17')]();});}};}function handleEntityNotFound(_0x12e3df,_0x58de77){return function(_0x37a292){if(!_0x37a292){_0x12e3df[_0x032c('0x16')](0x194);}return _0x37a292;};}function handleError(_0x1a38e1,_0x3403b3){_0x3403b3=_0x3403b3||0x1f4;return function(_0x51d679){logger[_0x032c('0x26')](_0x51d679[_0x032c('0x27')]);if(_0x51d679[_0x032c('0x28')]){delete _0x51d679[_0x032c('0x28')];}_0x1a38e1[_0x032c('0x18')](_0x3403b3)[_0x032c('0x29')](_0x51d679);};}exports[_0x032c('0x2a')]=function(_0x5a2297,_0x50a3f8){var _0x3e99b1={},_0x5d0503={},_0x6f72ba={'count':0x0,'rows':[]};var _0x3bb5e3=_['map'](db[_0x032c('0x2b')][_0x032c('0x2c')],function(_0x3488f1){return{'name':_0x3488f1[_0x032c('0x2d')],'type':_0x3488f1['type'][_0x032c('0x2e')]};});_0x5d0503[_0x032c('0x2f')]=_['map'](_0x3bb5e3,_0x032c('0x28'));_0x5d0503[_0x032c('0x30')]=_[_0x032c('0x31')](_0x5a2297[_0x032c('0x30')]);_0x5d0503[_0x032c('0x32')]=_['intersection'](_0x5d0503[_0x032c('0x2f')],_0x5d0503['query']);_0x3e99b1[_0x032c('0x33')]=_['intersection'](_0x5d0503[_0x032c('0x2f')],qs[_0x032c('0x34')](_0x5a2297[_0x032c('0x30')][_0x032c('0x34')]));_0x3e99b1[_0x032c('0x33')]=_0x3e99b1[_0x032c('0x33')]['length']?_0x3e99b1[_0x032c('0x33')]:_0x5d0503[_0x032c('0x2f')];if(!_0x5a2297['query'][_0x032c('0x35')](_0x032c('0x36'))){_0x3e99b1[_0x032c('0x1c')]=qs['limit'](_0x5a2297[_0x032c('0x30')][_0x032c('0x1c')]);_0x3e99b1[_0x032c('0x1a')]=qs[_0x032c('0x1a')](_0x5a2297[_0x032c('0x30')][_0x032c('0x1a')]);}_0x3e99b1[_0x032c('0x37')]=qs['sort'](_0x5a2297[_0x032c('0x30')][_0x032c('0x38')]);_0x3e99b1[_0x032c('0x39')]=qs[_0x032c('0x32')](_[_0x032c('0x3a')](_0x5a2297[_0x032c('0x30')],_0x5d0503[_0x032c('0x32')]),_0x3bb5e3);if(_0x5a2297[_0x032c('0x30')]['filter']){_0x3e99b1[_0x032c('0x39')]=_['merge'](_0x3e99b1[_0x032c('0x39')],{'$or':_['map'](_0x3bb5e3,function(_0x5f1881){if(_0x5f1881[_0x032c('0x3b')]!==_0x032c('0x3c')){var _0x5ef439={};_0x5ef439[_0x5f1881['name']]={'$like':'%'+_0x5a2297[_0x032c('0x30')]['filter']+'%'};return _0x5ef439;}})});}_0x3e99b1=_['merge']({},_0x3e99b1,_0x5a2297[_0x032c('0x3d')]);var _0x6a9676={'where':_0x3e99b1[_0x032c('0x39')]};return db[_0x032c('0x2b')][_0x032c('0x1d')](_0x6a9676)[_0x032c('0x21')](function(_0x49b83a){_0x6f72ba[_0x032c('0x1d')]=_0x49b83a;if(_0x5a2297['query']['includeAll']){_0x3e99b1[_0x032c('0x3e')]=[{'all':!![]}];}return db[_0x032c('0x2b')][_0x032c('0x3f')](_0x3e99b1);})[_0x032c('0x21')](function(_0x47360a){_0x6f72ba['rows']=_0x47360a;return _0x6f72ba;})['then'](respondWithFilteredResult(_0x50a3f8,_0x3e99b1))[_0x032c('0x40')](handleError(_0x50a3f8,null));};exports['show']=function(_0x3ed5c9,_0x43ba20){var _0x3f3891={'raw':![],'where':{'id':_0x3ed5c9[_0x032c('0x41')]['id']}},_0x2e2df8={};_0x2e2df8[_0x032c('0x2f')]=_[_0x032c('0x31')](db[_0x032c('0x2b')][_0x032c('0x2c')]);_0x2e2df8['query']=_[_0x032c('0x31')](_0x3ed5c9['query']);_0x2e2df8['filters']=_[_0x032c('0x42')](_0x2e2df8[_0x032c('0x2f')],_0x2e2df8[_0x032c('0x30')]);_0x3f3891[_0x032c('0x33')]=_[_0x032c('0x42')](_0x2e2df8['model'],qs['fields'](_0x3ed5c9['query'][_0x032c('0x34')]));_0x3f3891['attributes']=_0x3f3891[_0x032c('0x33')][_0x032c('0x43')]?_0x3f3891['attributes']:_0x2e2df8[_0x032c('0x2f')];if(_0x3ed5c9[_0x032c('0x30')][_0x032c('0x44')]){_0x3f3891[_0x032c('0x3e')]=[{'all':!![]}];}_0x3f3891=_[_0x032c('0x45')]({},_0x3f3891,_0x3ed5c9[_0x032c('0x3d')]);return db[_0x032c('0x2b')][_0x032c('0x46')](_0x3f3891)[_0x032c('0x21')](handleEntityNotFound(_0x43ba20,null))['then'](respondWithResult(_0x43ba20,null))[_0x032c('0x40')](handleError(_0x43ba20,null));};exports['create']=function(_0x367638,_0x13f1a7){return db[_0x032c('0x2b')][_0x032c('0x47')](_0x367638[_0x032c('0x48')],{})[_0x032c('0x21')](function(_0x1eed24){var _0x110a5f=_0x367638[_0x032c('0x49')]['get']({'plain':!![]});if(!_0x110a5f)throw new Error(_0x032c('0x4a'));if(_0x110a5f['role']===_0x032c('0x49')){var _0x2f1032=_0x1eed24['get']({'plain':!![]});var _0x3fd7dc=_0x032c('0x24');return db['UserProfileSection'][_0x032c('0x46')]({'where':{'name':_0x3fd7dc,'userProfileId':_0x110a5f[_0x032c('0x4b')]},'raw':!![]})[_0x032c('0x21')](function(_0x4ff7f7){if(_0x4ff7f7&&_0x4ff7f7[_0x032c('0x4c')]===0x0){return db[_0x032c('0x25')][_0x032c('0x47')]({'name':_0x2f1032[_0x032c('0x28')],'resourceId':_0x2f1032['id'],'type':_0x4ff7f7[_0x032c('0x28')],'sectionId':_0x4ff7f7['id']},{})[_0x032c('0x21')](function(){return _0x1eed24;});}else{return _0x1eed24;}})[_0x032c('0x40')](function(_0x3d6749){logger[_0x032c('0x26')](_0x032c('0x4d'),_0x3d6749);throw _0x3d6749;});}return _0x1eed24;})['then'](respondWithResult(_0x13f1a7,0xc9))[_0x032c('0x40')](handleError(_0x13f1a7,null));};exports[_0x032c('0x20')]=function(_0x28bb7c,_0x100d0b){if(_0x28bb7c[_0x032c('0x48')]['id']){delete _0x28bb7c[_0x032c('0x48')]['id'];}return db[_0x032c('0x2b')][_0x032c('0x46')]({'where':{'id':_0x28bb7c['params']['id']}})[_0x032c('0x21')](handleEntityNotFound(_0x100d0b,null))[_0x032c('0x21')](saveUpdates(_0x28bb7c[_0x032c('0x48')],null))[_0x032c('0x21')](respondWithResult(_0x100d0b,null))[_0x032c('0x40')](handleError(_0x100d0b,null));};exports['destroy']=function(_0x3ca559,_0x157324){return db[_0x032c('0x2b')][_0x032c('0x46')]({'where':{'id':_0x3ca559[_0x032c('0x41')]['id']}})[_0x032c('0x21')](handleEntityNotFound(_0x157324,null))[_0x032c('0x21')](removeEntity(_0x157324,null))[_0x032c('0x40')](handleError(_0x157324,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index bb4813a..b02adec 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 _0xa6ea=['CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','catch','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','%s%s','prefix','push','merge','Set','format'];(function(_0x18c79f,_0x21e952){var _0x3f09b4=function(_0x2bbcd6){while(--_0x2bbcd6){_0x18c79f['push'](_0x18c79f['shift']());}};_0x3f09b4(++_0x21e952);}(_0xa6ea,0x125));var _0xaa6e=function(_0x4fa6bc,_0x1bc6a4){_0x4fa6bc=_0x4fa6bc-0x0;var _0x356b77=_0xa6ea[_0x4fa6bc];return _0x356b77;};'use strict';var _=require(_0xaa6e('0x0'));var util=require(_0xaa6e('0x1'));var BPromise=require(_0xaa6e('0x2'));var attributes=require(_0xaa6e('0x3'));var getUserApplications=function(_0x43b6d3,_0x344040,_0x452854){var _0x22c93=0x1;var _0x1f1156=[];var _0x1cb100={'context':_0x344040[_0xaa6e('0x4')]||'from-sip','exten':util['format'](_0xaa6e('0x5'),_0x43b6d3[_0xaa6e('0x6')],_0x452854),'type':'system','isApp':![],'ChanSpyId':_0x43b6d3['id'],'UserId':_0x344040['id']};_0x1f1156[_0xaa6e('0x7')](_[_0xaa6e('0x8')]({'app':_0xaa6e('0x9'),'appdata':util[_0xaa6e('0xa')](_0xaa6e('0xb'),'chanspy'),'priority':_0x22c93++},_0x1cb100));if(_0x43b6d3[_0xaa6e('0xc')]){_0x1f1156['push'](_['merge']({'app':_0xaa6e('0xd'),'appdata':util[_0xaa6e('0xa')](_0xaa6e('0xe'),_0x43b6d3[_0xaa6e('0xf')]),'priority':_0x22c93++},_0x1cb100));}if(_0x43b6d3[_0xaa6e('0x10')]){_0x1f1156['push'](_['merge']({'app':'Authenticate','appdata':_0x43b6d3[_0xaa6e('0x11')],'priority':_0x22c93++},_0x1cb100));}_0x1f1156['push'](_[_0xaa6e('0x8')]({'app':'ChanSpy','appdata':util[_0xaa6e('0xa')](_0xaa6e('0x12'),_0x344040[_0xaa6e('0x13')],_0x43b6d3[_0xaa6e('0x14')]?_0x43b6d3[_0xaa6e('0x14')][_0xaa6e('0x15')](''):''),'priority':_0x22c93++},_0x1cb100));if(_0x43b6d3[_0xaa6e('0xc')]){_0x1f1156[_0xaa6e('0x7')](_[_0xaa6e('0x8')]({'app':_0xaa6e('0x16'),'priority':_0x22c93++},_0x1cb100));}return _0x1f1156;};var getChanSpyApplications=function(_0x4da5ee,_0x485e5b){var _0x48bfda=[];for(var _0x180791=0x0,_0x311b66=0x1;_0x180791<_0x485e5b[_0xaa6e('0x17')];_0x180791++,_0x311b66=0x1){_0x48bfda=_0x48bfda[_0xaa6e('0x18')](getUserApplications(_0x4da5ee,_0x485e5b[_0x180791],_0x485e5b[_0x180791]['internal']));if(_0x485e5b[_0x180791][_0xaa6e('0x19')]!=_0x485e5b[_0x180791][_0xaa6e('0x13')]){_0x48bfda=_0x48bfda['concat'](getUserApplications(_0x4da5ee,_0x485e5b[_0x180791],_0x485e5b[_0x180791][_0xaa6e('0x13')]));}}return _0x48bfda;};var getChanSpyPromise=function(_0x42975b,_0x4e3a27){return new BPromise(function(_0x17ad2f,_0x4b1322){return _0x42975b[_0xaa6e('0x1a')][_0xaa6e('0x1b')]({'attributes':['id',_0xaa6e('0x13'),_0xaa6e('0x19')],'where':{'role':_0xaa6e('0x1c'),'chanspy':!![]},'raw':!![]})[_0xaa6e('0x1d')](function(_0x5a6ba4){if(_0x5a6ba4){return _0x17ad2f(getChanSpyApplications(_0x4e3a27,_0x5a6ba4));}return _0x17ad2f([]);})['catch'](function(_0x352be8){_0x4b1322(_0x352be8);});});};module['exports']=function(_0x523851,_0x4895d8){var _0x3707ad=_0x523851[_0xaa6e('0x1e')];return _0x523851[_0xaa6e('0x1f')](_0xaa6e('0x20'),attributes,{'tableName':_0xaa6e('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35db03,_0x5e5fb2,_0x4758a3){return getChanSpyPromise(_0x3707ad,_0x35db03)['then'](function(_0x7a34c5){if(_0x7a34c5&&_0x7a34c5[_0xaa6e('0x17')]){return _0x3707ad[_0xaa6e('0x22')]['bulkCreate'](_0x7a34c5);}})[_0xaa6e('0x1d')](function(){_0x4758a3();})[_0xaa6e('0x23')](function(_0x5e73d9){_0x4758a3(_0x5e73d9);});},'afterUpdate':function(_0x41d978,_0x185a82,_0x30b231){return _0x3707ad[_0xaa6e('0x22')]['destroy']({'where':{'ChanSpyId':_0x41d978['id']}})[_0xaa6e('0x1d')](function(){return getChanSpyPromise(_0x3707ad,_0x41d978);})[_0xaa6e('0x1d')](function(_0x1146b8){if(_0x1146b8&&_0x1146b8[_0xaa6e('0x17')]){return _0x3707ad[_0xaa6e('0x22')][_0xaa6e('0x24')](_0x1146b8);}})['then'](function(){_0x30b231();})[_0xaa6e('0x23')](function(_0x34369d){_0x30b231(_0x34369d);});},'afterDestroy':function(_0x389c44,_0x1ad734,_0x1a24e3){return _0x3707ad[_0xaa6e('0x22')][_0xaa6e('0x25')]({'where':{'ChanSpyId':_0x389c44['id']}})[_0xaa6e('0x1d')](function(){_0x1a24e3();})['catch'](function(_0xcf812e){_0x1a24e3(_0xcf812e);});}}});}; \ No newline at end of file +var _0x77d5=['bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','MixMonitor','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','record','length','concat','internal','User','findAll','catch','exports','models','voice_chanspy','VoiceExtension','bulkCreate','destroy','then','lodash'];(function(_0x5a43cd,_0x55dfff){var _0x9e2199=function(_0x4153a3){while(--_0x4153a3){_0x5a43cd['push'](_0x5a43cd['shift']());}};_0x9e2199(++_0x55dfff);}(_0x77d5,0x18b));var _0x577d=function(_0x558cff,_0x26a26d){_0x558cff=_0x558cff-0x0;var _0xe1a57e=_0x77d5[_0x558cff];return _0xe1a57e;};'use strict';var _=require(_0x577d('0x0'));var util=require('util');var BPromise=require(_0x577d('0x1'));var attributes=require(_0x577d('0x2'));var getUserApplications=function(_0x24958f,_0x2bf8da,_0x151b64){var _0x386255=0x1;var _0x3841a8=[];var _0x2da490={'context':_0x2bf8da[_0x577d('0x3')]||'from-sip','exten':util[_0x577d('0x4')](_0x577d('0x5'),_0x24958f[_0x577d('0x6')],_0x151b64),'type':_0x577d('0x7'),'isApp':![],'ChanSpyId':_0x24958f['id'],'UserId':_0x2bf8da['id']};_0x3841a8[_0x577d('0x8')](_[_0x577d('0x9')]({'app':_0x577d('0xa'),'appdata':util['format'](_0x577d('0xb'),_0x577d('0xc')),'priority':_0x386255++},_0x2da490));if(_0x24958f['record']){_0x3841a8['push'](_[_0x577d('0x9')]({'app':_0x577d('0xd'),'appdata':util[_0x577d('0x4')]('${UNIQUEID}.%s,a',_0x24958f[_0x577d('0xe')]),'priority':_0x386255++},_0x2da490));}if(_0x24958f[_0x577d('0xf')]){_0x3841a8[_0x577d('0x8')](_[_0x577d('0x9')]({'app':_0x577d('0x10'),'appdata':_0x24958f[_0x577d('0x11')],'priority':_0x386255++},_0x2da490));}_0x3841a8[_0x577d('0x8')](_[_0x577d('0x9')]({'app':_0x577d('0x12'),'appdata':util[_0x577d('0x4')](_0x577d('0x13'),_0x2bf8da[_0x577d('0x14')],_0x24958f[_0x577d('0x15')]?_0x24958f[_0x577d('0x15')]['join'](''):''),'priority':_0x386255++},_0x2da490));if(_0x24958f[_0x577d('0x16')]){_0x3841a8[_0x577d('0x8')](_['merge']({'app':'StopMixMonitor','priority':_0x386255++},_0x2da490));}return _0x3841a8;};var getChanSpyApplications=function(_0x339b60,_0x15f401){var _0x4d23d0=[];for(var _0x6dc968=0x0,_0xd1af58=0x1;_0x6dc968<_0x15f401[_0x577d('0x17')];_0x6dc968++,_0xd1af58=0x1){_0x4d23d0=_0x4d23d0[_0x577d('0x18')](getUserApplications(_0x339b60,_0x15f401[_0x6dc968],_0x15f401[_0x6dc968][_0x577d('0x19')]));if(_0x15f401[_0x6dc968][_0x577d('0x19')]!=_0x15f401[_0x6dc968][_0x577d('0x14')]){_0x4d23d0=_0x4d23d0[_0x577d('0x18')](getUserApplications(_0x339b60,_0x15f401[_0x6dc968],_0x15f401[_0x6dc968]['name']));}}return _0x4d23d0;};var getChanSpyPromise=function(_0x4f16bc,_0x3e2b8f){return new BPromise(function(_0x380995,_0x56594e){return _0x4f16bc[_0x577d('0x1a')][_0x577d('0x1b')]({'attributes':['id',_0x577d('0x14'),_0x577d('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0xf211e3){if(_0xf211e3){return _0x380995(getChanSpyApplications(_0x3e2b8f,_0xf211e3));}return _0x380995([]);})[_0x577d('0x1c')](function(_0x2bf4ab){_0x56594e(_0x2bf4ab);});});};module[_0x577d('0x1d')]=function(_0x358f0b,_0x45e57f){var _0x2bcdb3=_0x358f0b[_0x577d('0x1e')];return _0x358f0b['define']('VoiceChanSpy',attributes,{'tableName':_0x577d('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2de7ed,_0x3afb8e,_0x243cd6){return getChanSpyPromise(_0x2bcdb3,_0x2de7ed)['then'](function(_0x364852){if(_0x364852&&_0x364852[_0x577d('0x17')]){return _0x2bcdb3[_0x577d('0x20')][_0x577d('0x21')](_0x364852);}})['then'](function(){_0x243cd6();})[_0x577d('0x1c')](function(_0x3b632b){_0x243cd6(_0x3b632b);});},'afterUpdate':function(_0x8af50d,_0x2a85d5,_0xcbc068){return _0x2bcdb3[_0x577d('0x20')][_0x577d('0x22')]({'where':{'ChanSpyId':_0x8af50d['id']}})[_0x577d('0x23')](function(){return getChanSpyPromise(_0x2bcdb3,_0x8af50d);})[_0x577d('0x23')](function(_0x470a2a){if(_0x470a2a&&_0x470a2a[_0x577d('0x17')]){return _0x2bcdb3[_0x577d('0x20')][_0x577d('0x21')](_0x470a2a);}})['then'](function(){_0xcbc068();})[_0x577d('0x1c')](function(_0x339e9f){_0xcbc068(_0x339e9f);});},'afterDestroy':function(_0x2a86b9,_0x1a389a,_0x3fd176){return _0x2bcdb3[_0x577d('0x20')][_0x577d('0x22')]({'where':{'ChanSpyId':_0x2a86b9['id']}})['then'](function(){_0x3fd176();})[_0x577d('0x1c')](function(_0x42b3b4){_0x3fd176(_0x42b3b4);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index d8badea..0a4e113 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 _0x0565=['client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','code','message','error','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2e13b0,_0x25aef4){var _0x4aee94=function(_0x15b99f){while(--_0x15b99f){_0x2e13b0['push'](_0x2e13b0['shift']());}};_0x4aee94(++_0x25aef4);}(_0x0565,0xf2));var _0x5056=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x0565[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22afb7,_0x4b8280,_0x52b01f){return new BPromise(function(_0x38f74,_0x223c92){return client[_0x5056('0xd')](_0x22afb7,_0x52b01f)[_0x5056('0xe')](function(_0x2144a9){logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));logger['debug'](_0x5056('0x12'),_0x4b8280,_0x5056('0x11'),JSON[_0x5056('0x13')](_0x2144a9));if(_0x2144a9['error']){if(_0x2144a9['error'][_0x5056('0x14')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x223c92(_0x2144a9['error'][_0x5056('0x15')]);}logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x38f74(_0x2144a9[_0x5056('0x16')][_0x5056('0x15')]);}else{logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));_0x38f74(_0x2144a9['result'][_0x5056('0x15')]);}})['catch'](function(_0x43db77){logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x43db77);_0x223c92(_0x43db77);});});} \ No newline at end of file +var _0x4e81=['VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3c2747,_0x7b7104){var _0x336ac6=function(_0x166d16){while(--_0x166d16){_0x3c2747['push'](_0x3c2747['shift']());}};_0x336ac6(++_0x7b7104);}(_0x4e81,0x1bc));var _0x14e8=function(_0x146be0,_0x39a85e){_0x146be0=_0x146be0-0x0;var _0x1bcc25=_0x4e81[_0x146be0];return _0x1bcc25;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e73d2,_0x449fa3,_0x21f860){return new BPromise(function(_0x3c1b93,_0x11ec3b){return client[_0x14e8('0x9')](_0x3e73d2,_0x21f860)[_0x14e8('0xa')](function(_0x1d8402){logger[_0x14e8('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x449fa3,_0x14e8('0xc'));logger[_0x14e8('0xd')](_0x14e8('0xe'),_0x449fa3,_0x14e8('0xc'),JSON[_0x14e8('0xf')](_0x1d8402));if(_0x1d8402[_0x14e8('0x10')]){if(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x11')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x11ec3b(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x13')]);}logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x3c1b93(_0x1d8402['error'][_0x14e8('0x13')]);}else{logger[_0x14e8('0xb')](_0x14e8('0x12'),_0x449fa3,_0x14e8('0xc'));_0x3c1b93(_0x1d8402['result'][_0x14e8('0x13')]);}})[_0x14e8('0x14')](function(_0x30581){logger[_0x14e8('0x10')](_0x14e8('0x12'),_0x449fa3,_0x30581);_0x11ec3b(_0x30581);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 6770a13..686a6f8 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 _0xdb04=['destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0xdb04,0xad));var _0x4db0=function(_0x2ea1dc,_0x3d8c64){_0x2ea1dc=_0x2ea1dc-0x0;var _0x10b5b5=_0xdb04[_0x2ea1dc];return _0x10b5b5;};'use strict';var multer=require(_0x4db0('0x0'));var util=require(_0x4db0('0x1'));var path=require('path');var timeout=require(_0x4db0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4db0('0x3'));var auth=require(_0x4db0('0x4'));var interaction=require(_0x4db0('0x5'));var config=require(_0x4db0('0x6'));var controller=require(_0x4db0('0x7'));router['get']('/',auth[_0x4db0('0x8')](),controller[_0x4db0('0x9')]);router['get'](_0x4db0('0xa'),auth[_0x4db0('0x8')](),controller[_0x4db0('0xb')]);router[_0x4db0('0xc')]('/',auth[_0x4db0('0x8')](),controller[_0x4db0('0xd')]);router[_0x4db0('0xe')]('/:id',auth[_0x4db0('0x8')](),controller[_0x4db0('0xf')]);router[_0x4db0('0x10')](_0x4db0('0xa'),auth['isAuthenticated'](),controller[_0x4db0('0x11')]);module[_0x4db0('0x12')]=router; \ No newline at end of file +var _0x642f=['../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x15f5e2,_0x22e281){var _0x423502=function(_0x35395d){while(--_0x35395d){_0x15f5e2['push'](_0x15f5e2['shift']());}};_0x423502(++_0x22e281);}(_0x642f,0xcb));var _0xf642=function(_0x385304,_0x691db2){_0x385304=_0x385304-0x0;var _0x3cf71a=_0x642f[_0x385304];return _0x3cf71a;};'use strict';var multer=require(_0xf642('0x0'));var util=require(_0xf642('0x1'));var path=require('path');var timeout=require(_0xf642('0x2'));var express=require('express');var router=express[_0xf642('0x3')]();var fs_extra=require(_0xf642('0x4'));var auth=require(_0xf642('0x5'));var interaction=require(_0xf642('0x6'));var config=require('../../config/environment');var controller=require(_0xf642('0x7'));router[_0xf642('0x8')]('/',auth[_0xf642('0x9')](),controller[_0xf642('0xa')]);router[_0xf642('0x8')](_0xf642('0xb'),auth[_0xf642('0x9')](),controller[_0xf642('0xc')]);router[_0xf642('0xd')]('/',auth[_0xf642('0x9')](),controller[_0xf642('0xe')]);router[_0xf642('0xf')](_0xf642('0xb'),auth[_0xf642('0x9')](),controller[_0xf642('0x10')]);router[_0xf642('0x11')]('/:id',auth[_0xf642('0x9')](),controller['destroy']);module[_0xf642('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 8f6be4a..93dfa58 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 _0x293b=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x258697,_0x34573b){var _0x49176b=function(_0xec793f){while(--_0xec793f){_0x258697['push'](_0x258697['shift']());}};_0x49176b(++_0x34573b);}(_0x293b,0xce));var _0xb293=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x293b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb293('0x0'));module[_0xb293('0x1')]={'name':{'type':Sequelize[_0xb293('0x2')],'unique':_0xb293('0x3')},'description':{'type':Sequelize[_0xb293('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xb293('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc4bf=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xc4bf,0x18f));var _0xfc4b=function(_0x312ff8,_0x5d7167){_0x312ff8=_0x312ff8-0x0;var _0x4e144b=_0xc4bf[_0x312ff8];return _0x4e144b;};'use strict';var Sequelize=require(_0xfc4b('0x0'));module[_0xfc4b('0x1')]={'name':{'type':Sequelize[_0xfc4b('0x2')],'unique':_0xfc4b('0x3')},'description':{'type':Sequelize[_0xfc4b('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xfc4b('0x4')],'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 5630281..9c9c5ad 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 _0x480c=['keys','rawAttributes','create','body','findAll','readFileSync','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','find','join','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Contexts','UserProfileResource','end','stack','name','send','index','map','VoiceContext','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','params'];(function(_0x5ebece,_0x2972b7){var _0x4ea07e=function(_0x4ab287){while(--_0x4ab287){_0x5ebece['push'](_0x5ebece['shift']());}};_0x4ea07e(++_0x2972b7);}(_0x480c,0x144));var _0xc480=function(_0x380107,_0x466912){_0x380107=_0x380107-0x0;var _0x274618=_0x480c[_0x380107];return _0x274618;};'use strict';var emlformat=require(_0xc480('0x0'));var rimraf=require(_0xc480('0x1'));var zipdir=require(_0xc480('0x2'));var jsonpatch=require(_0xc480('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc480('0x4'));var Mustache=require(_0xc480('0x5'));var util=require(_0xc480('0x6'));var path=require(_0xc480('0x7'));var sox=require('sox');var csv=require(_0xc480('0x8'));var ejs=require(_0xc480('0x9'));var fs=require('fs');var fs_extra=require(_0xc480('0xa'));var _=require('lodash');var squel=require(_0xc480('0xb'));var crypto=require(_0xc480('0xc'));var jsforce=require(_0xc480('0xd'));var deskjs=require(_0xc480('0xe'));var toCsv=require(_0xc480('0x8'));var querystring=require('querystring');var Papa=require(_0xc480('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc480('0x10'));var as=require(_0xc480('0x11'));var hardwareService=require(_0xc480('0x12'));var logger=require(_0xc480('0x13'))('api');var utils=require(_0xc480('0x14'));var config=require(_0xc480('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc480('0x16'))['db'];var jayson=require(_0xc480('0x17'));var client=jayson[_0xc480('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x340b07,_0x2dfd9c,_0x1aafde,_0x81c0ea){return new BPromise(function(_0x33c280,_0x3ba716){var _0x1cba8a=_0x81c0ea||client;return _0x1cba8a[_0xc480('0x19')](_0x340b07,_0x1aafde)['then'](function(_0x5463d9){logger[_0xc480('0x1a')](_0xc480('0x1b'),_0x2dfd9c,_0xc480('0x1c'));logger[_0xc480('0x1d')](_0xc480('0x1e'),_0x2dfd9c,'request\x20sent',JSON[_0xc480('0x1f')](_0x5463d9));if(_0x5463d9[_0xc480('0x20')]){if(_0x5463d9['error'][_0xc480('0x21')]===0x1f4){logger['error'](_0xc480('0x1b'),_0x2dfd9c,_0x5463d9[_0xc480('0x20')]['message']);return _0x3ba716(_0x5463d9[_0xc480('0x20')][_0xc480('0x22')]);}logger['error'](_0xc480('0x1b'),_0x2dfd9c,_0x5463d9[_0xc480('0x20')][_0xc480('0x22')]);return _0x33c280(_0x5463d9[_0xc480('0x20')]['message']);}else{logger[_0xc480('0x1a')](_0xc480('0x1b'),_0x2dfd9c,_0xc480('0x1c'));_0x33c280(_0x5463d9['result']['message']);}})[_0xc480('0x23')](function(_0x4735c1){logger[_0xc480('0x20')](_0xc480('0x1b'),_0x2dfd9c,_0x4735c1);_0x3ba716(_0x4735c1);});});}function respondWithStatusCode(_0x1c4a3d,_0x189b30){_0x189b30=_0x189b30||0xcc;return function(_0x3bc748){if(_0x3bc748){return _0x1c4a3d[_0xc480('0x24')](_0x189b30);}return _0x1c4a3d[_0xc480('0x25')](_0x189b30)['end']();};}function respondWithResult(_0x506b55,_0x4b08f1){_0x4b08f1=_0x4b08f1||0xc8;return function(_0x5a8352){if(_0x5a8352){return _0x506b55[_0xc480('0x25')](_0x4b08f1)[_0xc480('0x26')](_0x5a8352);}};}function respondWithFilteredResult(_0x5d4f9f,_0x178fe5){return function(_0x3f8912){if(_0x3f8912){var _0x4a76c7=typeof _0x178fe5[_0xc480('0x27')]===_0xc480('0x28')&&typeof _0x178fe5[_0xc480('0x29')]==='undefined';var _0x4b157a=_0x3f8912[_0xc480('0x2a')];var _0x112c66=_0x4a76c7?0x0:_0x178fe5[_0xc480('0x27')];var _0x8ac02d=_0x4a76c7?_0x3f8912[_0xc480('0x2a')]:_0x178fe5[_0xc480('0x27')]+_0x178fe5[_0xc480('0x29')];var _0x225490;if(_0x8ac02d>=_0x4b157a){_0x8ac02d=_0x4b157a;_0x225490=0xc8;}else{_0x225490=0xce;}_0x5d4f9f[_0xc480('0x25')](_0x225490);return _0x5d4f9f[_0xc480('0x2b')](_0xc480('0x2c'),_0x112c66+'-'+_0x8ac02d+'/'+_0x4b157a)[_0xc480('0x26')](_0x3f8912);}return null;};}function patchUpdates(_0x177cf1){return function(_0x35b3f9){try{jsonpatch[_0xc480('0x2d')](_0x35b3f9,_0x177cf1,!![]);}catch(_0x2b6fb2){return BPromise[_0xc480('0x2e')](_0x2b6fb2);}return _0x35b3f9[_0xc480('0x2f')]();};}function saveUpdates(_0x597b75,_0x5e6ade){return function(_0x3687ab){if(_0x3687ab){return _0x3687ab[_0xc480('0x30')](_0x597b75)['then'](function(_0x5b1101){return _0x5b1101;});}return null;};}function removeEntity(_0x145c25,_0x52178d){return function(_0x2f03a7){if(_0x2f03a7){return _0x2f03a7[_0xc480('0x31')]()[_0xc480('0x32')](function(){var _0x45b648=_0x2f03a7[_0xc480('0x33')]({'plain':!![]});var _0x294653=_0xc480('0x34');return db[_0xc480('0x35')]['destroy']({'where':{'type':_0x294653,'resourceId':_0x45b648['id']}})['then'](function(){return _0x2f03a7;});})[_0xc480('0x32')](function(){_0x145c25['status'](0xcc)[_0xc480('0x36')]();});}};}function handleEntityNotFound(_0x22cb17,_0xf78c07){return function(_0x253b48){if(!_0x253b48){_0x22cb17[_0xc480('0x24')](0x194);}return _0x253b48;};}function handleError(_0x33f7a7,_0x202e45){_0x202e45=_0x202e45||0x1f4;return function(_0x552a16){logger[_0xc480('0x20')](_0x552a16[_0xc480('0x37')]);if(_0x552a16[_0xc480('0x38')]){delete _0x552a16['name'];}_0x33f7a7['status'](_0x202e45)[_0xc480('0x39')](_0x552a16);};}exports[_0xc480('0x3a')]=function(_0x166a78,_0xe3551b){var _0x57b822={},_0xf257e6={},_0x246eec={'count':0x0,'rows':[]};var _0x35669a=_[_0xc480('0x3b')](db[_0xc480('0x3c')]['rawAttributes'],function(_0x3c5641){return{'name':_0x3c5641[_0xc480('0x3d')],'type':_0x3c5641[_0xc480('0x3e')]['key']};});_0xf257e6[_0xc480('0x3f')]=_[_0xc480('0x3b')](_0x35669a,_0xc480('0x38'));_0xf257e6[_0xc480('0x40')]=_['keys'](_0x166a78['query']);_0xf257e6[_0xc480('0x41')]=_[_0xc480('0x42')](_0xf257e6['model'],_0xf257e6['query']);_0x57b822[_0xc480('0x43')]=_['intersection'](_0xf257e6[_0xc480('0x3f')],qs[_0xc480('0x44')](_0x166a78['query'][_0xc480('0x44')]));_0x57b822[_0xc480('0x43')]=_0x57b822['attributes']['length']?_0x57b822['attributes']:_0xf257e6['model'];if(!_0x166a78[_0xc480('0x40')][_0xc480('0x45')]('nolimit')){_0x57b822['limit']=qs[_0xc480('0x29')](_0x166a78[_0xc480('0x40')]['limit']);_0x57b822['offset']=qs[_0xc480('0x27')](_0x166a78[_0xc480('0x40')]['offset']);}_0x57b822['order']=qs[_0xc480('0x46')](_0x166a78[_0xc480('0x40')]['sort']);_0x57b822[_0xc480('0x47')]=qs[_0xc480('0x41')](_[_0xc480('0x48')](_0x166a78[_0xc480('0x40')],_0xf257e6[_0xc480('0x41')]),_0x35669a);if(_0x166a78[_0xc480('0x40')][_0xc480('0x49')]){_0x57b822[_0xc480('0x47')]=_['merge'](_0x57b822[_0xc480('0x47')],{'$or':_['map'](_0x35669a,function(_0x4a00de){if(_0x4a00de[_0xc480('0x3e')]!==_0xc480('0x4a')){var _0x672ff0={};_0x672ff0[_0x4a00de[_0xc480('0x38')]]={'$like':'%'+_0x166a78['query'][_0xc480('0x49')]+'%'};return _0x672ff0;}})});}_0x57b822=_[_0xc480('0x4b')]({},_0x57b822,_0x166a78[_0xc480('0x4c')]);var _0x23ab45={'where':_0x57b822[_0xc480('0x47')]};return db[_0xc480('0x3c')][_0xc480('0x2a')](_0x23ab45)[_0xc480('0x32')](function(_0xa6ec9b){_0x246eec[_0xc480('0x2a')]=_0xa6ec9b;if(_0x166a78[_0xc480('0x40')][_0xc480('0x4d')]){_0x57b822[_0xc480('0x4e')]=[{'all':!![]}];}return db[_0xc480('0x3c')]['findAll'](_0x57b822);})[_0xc480('0x32')](function(_0x422652){_0x246eec['rows']=_0x422652;return _0x246eec;})[_0xc480('0x32')](respondWithFilteredResult(_0xe3551b,_0x57b822))[_0xc480('0x23')](handleError(_0xe3551b,null));};exports['show']=function(_0x12673e,_0xc5d277){var _0x52a452={'raw':![],'where':{'id':_0x12673e[_0xc480('0x4f')]['id']}},_0x2f44bc={};_0x2f44bc[_0xc480('0x3f')]=_[_0xc480('0x50')](db[_0xc480('0x3c')][_0xc480('0x51')]);_0x2f44bc[_0xc480('0x40')]=_[_0xc480('0x50')](_0x12673e[_0xc480('0x40')]);_0x2f44bc[_0xc480('0x41')]=_['intersection'](_0x2f44bc[_0xc480('0x3f')],_0x2f44bc[_0xc480('0x40')]);_0x52a452[_0xc480('0x43')]=_[_0xc480('0x42')](_0x2f44bc[_0xc480('0x3f')],qs[_0xc480('0x44')](_0x12673e['query'][_0xc480('0x44')]));_0x52a452[_0xc480('0x43')]=_0x52a452[_0xc480('0x43')]['length']?_0x52a452[_0xc480('0x43')]:_0x2f44bc['model'];if(_0x12673e[_0xc480('0x40')]['includeAll']){_0x52a452[_0xc480('0x4e')]=[{'all':!![]}];}_0x52a452=_[_0xc480('0x4b')]({},_0x52a452,_0x12673e[_0xc480('0x4c')]);return db[_0xc480('0x3c')]['find'](_0x52a452)[_0xc480('0x32')](handleEntityNotFound(_0xc5d277,null))[_0xc480('0x32')](respondWithResult(_0xc5d277,null))[_0xc480('0x23')](handleError(_0xc5d277,null));};exports['create']=function(_0x5d945d,_0x499386,_0x45aa9f){var _0x615174;return db[_0xc480('0x3c')][_0xc480('0x52')](_0x5d945d[_0xc480('0x53')],{'raw':!![]})['then'](function(_0x39b250){_0x615174=_0x39b250;return db[_0xc480('0x3c')][_0xc480('0x54')]({'raw':!![]});})['then'](function(_0x10165a){var _0x3de5ab=fs[_0xc480('0x55')](path['join'](config[_0xc480('0x56')],_0xc480('0x57')),_0xc480('0x58'));var _0xf6c4c8=ejs[_0xc480('0x59')](_0x3de5ab,{'contexts':_0x10165a||[]});fs[_0xc480('0x5a')](_0xc480('0x5b'),_0xf6c4c8);})[_0xc480('0x32')](function(){return respondWithRpcPromise(_0xc480('0x5c'),_0xc480('0x52'),{'module':_0xc480('0x5d')});})['then'](function(){var _0x55a165=_0x5d945d[_0xc480('0x5e')][_0xc480('0x33')]({'plain':!![]});if(!_0x55a165)throw new Error(_0xc480('0x5f'));if(_0x55a165[_0xc480('0x60')]===_0xc480('0x5e')){var _0x3906f3=_0x615174['get']({'plain':!![]});return db[_0xc480('0x61')]['find']({'where':{'name':_0xc480('0x34'),'userProfileId':_0x55a165['userProfileId']},'raw':!![]})[_0xc480('0x32')](function(_0x51db51){if(_0x51db51&&_0x51db51[_0xc480('0x62')]===0x0){return db[_0xc480('0x35')][_0xc480('0x52')]({'name':_0x3906f3[_0xc480('0x38')],'resourceId':_0x3906f3['id'],'type':_0x51db51[_0xc480('0x38')],'sectionId':_0x51db51['id']},{})[_0xc480('0x32')](function(){return _0x615174;});}else{return _0x615174;}})[_0xc480('0x23')](function(_0x3c164b){logger[_0xc480('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c164b);throw _0x3c164b;});}return _0x615174;})[_0xc480('0x32')](respondWithResult(_0x499386,0xc9))[_0xc480('0x23')](handleError(_0x499386,null));};exports[_0xc480('0x30')]=function(_0x403a1a,_0x39a208,_0x22f728){var _0x446afb;return db['VoiceContext'][_0xc480('0x63')]({'where':{'id':_0x403a1a['params']['id']}})[_0xc480('0x32')](handleEntityNotFound(_0x39a208,null))[_0xc480('0x32')](saveUpdates(_0x403a1a['body'],null))[_0xc480('0x32')](function(_0x1b427f){if(_0x1b427f){_0x446afb=_0x1b427f;return db['VoiceContext'][_0xc480('0x54')]({'raw':!![]});}})[_0xc480('0x32')](function(_0x5a8b21){var _0x37f5b7=fs['readFileSync'](path[_0xc480('0x64')](config[_0xc480('0x56')],_0xc480('0x57')),'utf8');var _0x4c7672=ejs[_0xc480('0x59')](_0x37f5b7,{'contexts':_0x5a8b21||[]});fs[_0xc480('0x5a')](_0xc480('0x5b'),_0x4c7672);})['then'](function(){return respondWithRpcPromise('Reload',_0xc480('0x30'),{'module':_0xc480('0x5d')});})[_0xc480('0x32')](function(){return _0x446afb;})['then'](respondWithResult(_0x39a208,null))[_0xc480('0x23')](handleError(_0x39a208,null));};exports[_0xc480('0x31')]=function(_0x5efa65,_0x34c0d7,_0x1c1022){var _0x567dc1;return db[_0xc480('0x3c')][_0xc480('0x63')]({'where':{'id':_0x5efa65[_0xc480('0x4f')]['id']}})[_0xc480('0x32')](handleEntityNotFound(_0x34c0d7,null))[_0xc480('0x32')](removeEntity(_0x34c0d7,null))[_0xc480('0x32')](function(){return db[_0xc480('0x3c')][_0xc480('0x54')]({'raw':!![]});})[_0xc480('0x32')](function(_0x32c680){var _0x2a67b2=fs[_0xc480('0x55')](path[_0xc480('0x64')](config[_0xc480('0x56')],_0xc480('0x57')),_0xc480('0x58'));var _0x2ebc40=ejs[_0xc480('0x59')](_0x2a67b2,{'contexts':_0x32c680});fs[_0xc480('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2ebc40);return respondWithRpcPromise('Reload',_0xc480('0x31'),{'module':'chan_sip.so'});})[_0xc480('0x23')](handleError(_0x34c0d7,null));}; \ No newline at end of file +var _0x6833=['stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceContext','include','findAll','show','params','create','body','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Contexts','userProfileId','autoAssociation','UserProfileResource','utf8','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x6833,0x9c));var _0x3683=function(_0x52c719,_0x5461ac){_0x52c719=_0x52c719-0x0;var _0x29bc6e=_0x6833[_0x52c719];return _0x29bc6e;};'use strict';var emlformat=require(_0x3683('0x0'));var rimraf=require(_0x3683('0x1'));var zipdir=require(_0x3683('0x2'));var jsonpatch=require(_0x3683('0x3'));var rp=require(_0x3683('0x4'));var moment=require(_0x3683('0x5'));var BPromise=require(_0x3683('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3683('0x7'));var sox=require(_0x3683('0x8'));var csv=require(_0x3683('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3683('0xa'));var _=require(_0x3683('0xb'));var squel=require('squel');var crypto=require(_0x3683('0xc'));var jsforce=require(_0x3683('0xd'));var deskjs=require(_0x3683('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3683('0xf'));var Papa=require(_0x3683('0x10'));var Redis=require(_0x3683('0x11'));var authService=require(_0x3683('0x12'));var qs=require(_0x3683('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3683('0x14'));var logger=require(_0x3683('0x15'))(_0x3683('0x16'));var utils=require(_0x3683('0x17'));var config=require(_0x3683('0x18'));var licenseUtil=require(_0x3683('0x19'));var db=require(_0x3683('0x1a'))['db'];var jayson=require(_0x3683('0x1b'));var client=jayson[_0x3683('0x1c')][_0x3683('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xbe2da,_0xd61bba,_0x480f7e,_0x2cc2ba){return new BPromise(function(_0x168480,_0x2df854){var _0x2ecd83=_0x2cc2ba||client;return _0x2ecd83[_0x3683('0x1e')](_0xbe2da,_0x480f7e)[_0x3683('0x1f')](function(_0x5eefc3){logger[_0x3683('0x20')]('VoiceContext,\x20%s,\x20%s',_0xd61bba,_0x3683('0x21'));logger['debug'](_0x3683('0x22'),_0xd61bba,'request\x20sent',JSON[_0x3683('0x23')](_0x5eefc3));if(_0x5eefc3[_0x3683('0x24')]){if(_0x5eefc3[_0x3683('0x24')]['code']===0x1f4){logger[_0x3683('0x24')](_0x3683('0x25'),_0xd61bba,_0x5eefc3[_0x3683('0x24')]['message']);return _0x2df854(_0x5eefc3[_0x3683('0x24')][_0x3683('0x26')]);}logger[_0x3683('0x24')](_0x3683('0x25'),_0xd61bba,_0x5eefc3[_0x3683('0x24')][_0x3683('0x26')]);return _0x168480(_0x5eefc3[_0x3683('0x24')][_0x3683('0x26')]);}else{logger[_0x3683('0x20')]('VoiceContext,\x20%s,\x20%s',_0xd61bba,_0x3683('0x21'));_0x168480(_0x5eefc3[_0x3683('0x27')][_0x3683('0x26')]);}})[_0x3683('0x28')](function(_0xd70124){logger[_0x3683('0x24')](_0x3683('0x25'),_0xd61bba,_0xd70124);_0x2df854(_0xd70124);});});}function respondWithStatusCode(_0x1c005e,_0x5471a8){_0x5471a8=_0x5471a8||0xcc;return function(_0x573180){if(_0x573180){return _0x1c005e[_0x3683('0x29')](_0x5471a8);}return _0x1c005e[_0x3683('0x2a')](_0x5471a8)[_0x3683('0x2b')]();};}function respondWithResult(_0xbc4d97,_0x5bd448){_0x5bd448=_0x5bd448||0xc8;return function(_0x5a3320){if(_0x5a3320){return _0xbc4d97['status'](_0x5bd448)[_0x3683('0x2c')](_0x5a3320);}};}function respondWithFilteredResult(_0x3eaa82,_0x42fd28){return function(_0x46fce0){if(_0x46fce0){var _0x21f6d5=typeof _0x42fd28[_0x3683('0x2d')]===_0x3683('0x2e')&&typeof _0x42fd28[_0x3683('0x2f')]===_0x3683('0x2e');var _0x967a8d=_0x46fce0['count'];var _0x429ec4=_0x21f6d5?0x0:_0x42fd28[_0x3683('0x2d')];var _0x56f5ce=_0x21f6d5?_0x46fce0[_0x3683('0x30')]:_0x42fd28[_0x3683('0x2d')]+_0x42fd28[_0x3683('0x2f')];var _0x55c428;if(_0x56f5ce>=_0x967a8d){_0x56f5ce=_0x967a8d;_0x55c428=0xc8;}else{_0x55c428=0xce;}_0x3eaa82[_0x3683('0x2a')](_0x55c428);return _0x3eaa82[_0x3683('0x31')](_0x3683('0x32'),_0x429ec4+'-'+_0x56f5ce+'/'+_0x967a8d)[_0x3683('0x2c')](_0x46fce0);}return null;};}function patchUpdates(_0x3422a5){return function(_0x147628){try{jsonpatch['apply'](_0x147628,_0x3422a5,!![]);}catch(_0x4d2945){return BPromise[_0x3683('0x33')](_0x4d2945);}return _0x147628[_0x3683('0x34')]();};}function saveUpdates(_0x52bc69,_0x3f58e9){return function(_0x59e922){if(_0x59e922){return _0x59e922[_0x3683('0x35')](_0x52bc69)[_0x3683('0x1f')](function(_0x5e461a){return _0x5e461a;});}return null;};}function removeEntity(_0x1630ed,_0x8d12f){return function(_0x327574){if(_0x327574){return _0x327574[_0x3683('0x36')]()[_0x3683('0x1f')](function(){var _0x53a564=_0x327574[_0x3683('0x37')]({'plain':!![]});var _0x8710b7='Contexts';return db['UserProfileResource'][_0x3683('0x36')]({'where':{'type':_0x8710b7,'resourceId':_0x53a564['id']}})[_0x3683('0x1f')](function(){return _0x327574;});})[_0x3683('0x1f')](function(){_0x1630ed[_0x3683('0x2a')](0xcc)[_0x3683('0x2b')]();});}};}function handleEntityNotFound(_0x1a1284,_0x353be9){return function(_0xaf2b14){if(!_0xaf2b14){_0x1a1284['sendStatus'](0x194);}return _0xaf2b14;};}function handleError(_0xf30eae,_0x26ae2f){_0x26ae2f=_0x26ae2f||0x1f4;return function(_0x486821){logger[_0x3683('0x24')](_0x486821[_0x3683('0x38')]);if(_0x486821[_0x3683('0x39')]){delete _0x486821[_0x3683('0x39')];}_0xf30eae[_0x3683('0x2a')](_0x26ae2f)['send'](_0x486821);};}exports[_0x3683('0x3a')]=function(_0x358c15,_0x7e1171){var _0x2a22a5={},_0x355be1={},_0xaa703c={'count':0x0,'rows':[]};var _0x49b0cd=_[_0x3683('0x3b')](db['VoiceContext'][_0x3683('0x3c')],function(_0x1cc37c){return{'name':_0x1cc37c['fieldName'],'type':_0x1cc37c[_0x3683('0x3d')][_0x3683('0x3e')]};});_0x355be1[_0x3683('0x3f')]=_[_0x3683('0x3b')](_0x49b0cd,_0x3683('0x39'));_0x355be1[_0x3683('0x40')]=_[_0x3683('0x41')](_0x358c15[_0x3683('0x40')]);_0x355be1[_0x3683('0x42')]=_[_0x3683('0x43')](_0x355be1[_0x3683('0x3f')],_0x355be1[_0x3683('0x40')]);_0x2a22a5['attributes']=_[_0x3683('0x43')](_0x355be1[_0x3683('0x3f')],qs[_0x3683('0x44')](_0x358c15['query']['fields']));_0x2a22a5[_0x3683('0x45')]=_0x2a22a5[_0x3683('0x45')][_0x3683('0x46')]?_0x2a22a5[_0x3683('0x45')]:_0x355be1[_0x3683('0x3f')];if(!_0x358c15[_0x3683('0x40')]['hasOwnProperty'](_0x3683('0x47'))){_0x2a22a5[_0x3683('0x2f')]=qs[_0x3683('0x2f')](_0x358c15['query'][_0x3683('0x2f')]);_0x2a22a5[_0x3683('0x2d')]=qs['offset'](_0x358c15[_0x3683('0x40')][_0x3683('0x2d')]);}_0x2a22a5[_0x3683('0x48')]=qs[_0x3683('0x49')](_0x358c15['query'][_0x3683('0x49')]);_0x2a22a5['where']=qs[_0x3683('0x42')](_[_0x3683('0x4a')](_0x358c15[_0x3683('0x40')],_0x355be1[_0x3683('0x42')]),_0x49b0cd);if(_0x358c15[_0x3683('0x40')][_0x3683('0x4b')]){_0x2a22a5[_0x3683('0x4c')]=_[_0x3683('0x4d')](_0x2a22a5[_0x3683('0x4c')],{'$or':_[_0x3683('0x3b')](_0x49b0cd,function(_0x1f37ef){if(_0x1f37ef[_0x3683('0x3d')]!==_0x3683('0x4e')){var _0x55fe4b={};_0x55fe4b[_0x1f37ef[_0x3683('0x39')]]={'$like':'%'+_0x358c15[_0x3683('0x40')][_0x3683('0x4b')]+'%'};return _0x55fe4b;}})});}_0x2a22a5=_[_0x3683('0x4d')]({},_0x2a22a5,_0x358c15[_0x3683('0x4f')]);var _0x59cf97={'where':_0x2a22a5['where']};return db[_0x3683('0x50')][_0x3683('0x30')](_0x59cf97)['then'](function(_0x2b58b9){_0xaa703c[_0x3683('0x30')]=_0x2b58b9;if(_0x358c15['query']['includeAll']){_0x2a22a5[_0x3683('0x51')]=[{'all':!![]}];}return db['VoiceContext'][_0x3683('0x52')](_0x2a22a5);})[_0x3683('0x1f')](function(_0x20b2c0){_0xaa703c['rows']=_0x20b2c0;return _0xaa703c;})[_0x3683('0x1f')](respondWithFilteredResult(_0x7e1171,_0x2a22a5))['catch'](handleError(_0x7e1171,null));};exports[_0x3683('0x53')]=function(_0x1e3028,_0x5bcec4){var _0xf574eb={'raw':![],'where':{'id':_0x1e3028[_0x3683('0x54')]['id']}},_0x787465={};_0x787465[_0x3683('0x3f')]=_[_0x3683('0x41')](db[_0x3683('0x50')]['rawAttributes']);_0x787465[_0x3683('0x40')]=_['keys'](_0x1e3028[_0x3683('0x40')]);_0x787465[_0x3683('0x42')]=_[_0x3683('0x43')](_0x787465['model'],_0x787465[_0x3683('0x40')]);_0xf574eb[_0x3683('0x45')]=_[_0x3683('0x43')](_0x787465[_0x3683('0x3f')],qs[_0x3683('0x44')](_0x1e3028['query'][_0x3683('0x44')]));_0xf574eb['attributes']=_0xf574eb[_0x3683('0x45')][_0x3683('0x46')]?_0xf574eb[_0x3683('0x45')]:_0x787465[_0x3683('0x3f')];if(_0x1e3028[_0x3683('0x40')]['includeAll']){_0xf574eb[_0x3683('0x51')]=[{'all':!![]}];}_0xf574eb=_['merge']({},_0xf574eb,_0x1e3028[_0x3683('0x4f')]);return db[_0x3683('0x50')]['find'](_0xf574eb)[_0x3683('0x1f')](handleEntityNotFound(_0x5bcec4,null))[_0x3683('0x1f')](respondWithResult(_0x5bcec4,null))[_0x3683('0x28')](handleError(_0x5bcec4,null));};exports['create']=function(_0x4304b3,_0x272d86,_0x182b82){var _0x41a59f;return db[_0x3683('0x50')][_0x3683('0x55')](_0x4304b3[_0x3683('0x56')],{'raw':!![]})[_0x3683('0x1f')](function(_0x59f6a8){_0x41a59f=_0x59f6a8;return db['VoiceContext'][_0x3683('0x52')]({'raw':!![]});})['then'](function(_0x51ea08){var _0x18eeaf=fs[_0x3683('0x57')](path[_0x3683('0x58')](config[_0x3683('0x59')],_0x3683('0x5a')),'utf8');var _0x563de4=ejs[_0x3683('0x5b')](_0x18eeaf,{'contexts':_0x51ea08||[]});fs[_0x3683('0x5c')](_0x3683('0x5d'),_0x563de4);})[_0x3683('0x1f')](function(){return respondWithRpcPromise(_0x3683('0x5e'),'create',{'module':_0x3683('0x5f')});})[_0x3683('0x1f')](function(){var _0x211b16=_0x4304b3[_0x3683('0x60')][_0x3683('0x37')]({'plain':!![]});if(!_0x211b16)throw new Error(_0x3683('0x61'));if(_0x211b16[_0x3683('0x62')]===_0x3683('0x60')){var _0x514402=_0x41a59f[_0x3683('0x37')]({'plain':!![]});return db[_0x3683('0x63')][_0x3683('0x64')]({'where':{'name':_0x3683('0x65'),'userProfileId':_0x211b16[_0x3683('0x66')]},'raw':!![]})[_0x3683('0x1f')](function(_0x3d6dbc){if(_0x3d6dbc&&_0x3d6dbc[_0x3683('0x67')]===0x0){return db[_0x3683('0x68')][_0x3683('0x55')]({'name':_0x514402[_0x3683('0x39')],'resourceId':_0x514402['id'],'type':_0x3d6dbc['name'],'sectionId':_0x3d6dbc['id']},{})[_0x3683('0x1f')](function(){return _0x41a59f;});}else{return _0x41a59f;}})[_0x3683('0x28')](function(_0x5a18b5){logger[_0x3683('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a18b5);throw _0x5a18b5;});}return _0x41a59f;})[_0x3683('0x1f')](respondWithResult(_0x272d86,0xc9))['catch'](handleError(_0x272d86,null));};exports[_0x3683('0x35')]=function(_0x518ac8,_0x27f22f,_0x23eb90){var _0x57eed4;return db['VoiceContext']['find']({'where':{'id':_0x518ac8[_0x3683('0x54')]['id']}})[_0x3683('0x1f')](handleEntityNotFound(_0x27f22f,null))[_0x3683('0x1f')](saveUpdates(_0x518ac8[_0x3683('0x56')],null))['then'](function(_0x2c8a53){if(_0x2c8a53){_0x57eed4=_0x2c8a53;return db[_0x3683('0x50')][_0x3683('0x52')]({'raw':!![]});}})[_0x3683('0x1f')](function(_0x91326f){var _0x1d06e6=fs[_0x3683('0x57')](path[_0x3683('0x58')](config[_0x3683('0x59')],_0x3683('0x5a')),'utf8');var _0x586972=ejs[_0x3683('0x5b')](_0x1d06e6,{'contexts':_0x91326f||[]});fs[_0x3683('0x5c')](_0x3683('0x5d'),_0x586972);})[_0x3683('0x1f')](function(){return respondWithRpcPromise(_0x3683('0x5e'),_0x3683('0x35'),{'module':_0x3683('0x5f')});})[_0x3683('0x1f')](function(){return _0x57eed4;})[_0x3683('0x1f')](respondWithResult(_0x27f22f,null))[_0x3683('0x28')](handleError(_0x27f22f,null));};exports['destroy']=function(_0x138040,_0x1df6f8,_0x3cf9f2){var _0x5a6008;return db[_0x3683('0x50')][_0x3683('0x64')]({'where':{'id':_0x138040[_0x3683('0x54')]['id']}})[_0x3683('0x1f')](handleEntityNotFound(_0x1df6f8,null))['then'](removeEntity(_0x1df6f8,null))[_0x3683('0x1f')](function(){return db[_0x3683('0x50')][_0x3683('0x52')]({'raw':!![]});})['then'](function(_0x8d49ac){var _0x22b2f5=fs[_0x3683('0x57')](path[_0x3683('0x58')](config[_0x3683('0x59')],_0x3683('0x5a')),_0x3683('0x69'));var _0x42701a=ejs[_0x3683('0x5b')](_0x22b2f5,{'contexts':_0x8d49ac});fs[_0x3683('0x5c')](_0x3683('0x5d'),_0x42701a);return respondWithRpcPromise(_0x3683('0x5e'),'destroy',{'module':_0x3683('0x5f')});})[_0x3683('0x28')](handleError(_0x1df6f8,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 79408f5..ca9dee5 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 _0xb821=['exports','define','VoiceContext','voice_contexts','lodash','util','moment','request-promise','rimraf','../../config/environment'];(function(_0x4e585d,_0x592a23){var _0x2c4e50=function(_0x5120e3){while(--_0x5120e3){_0x4e585d['push'](_0x4e585d['shift']());}};_0x2c4e50(++_0x592a23);}(_0xb821,0x1ee));var _0x1b82=function(_0x59f1a3,_0x49d63a){_0x59f1a3=_0x59f1a3-0x0;var _0x29bea8=_0xb821[_0x59f1a3];return _0x29bea8;};'use strict';var _=require(_0x1b82('0x0'));var util=require(_0x1b82('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var rp=require(_0x1b82('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var attributes=require('./voiceContext.attributes');module[_0x1b82('0x6')]=function(_0x180525,_0x2c9fb3){return _0x180525[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x463e=['define','VoiceContext','voice_contexts','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x463e,0x87));var _0xe463=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x463e[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xe463('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe463('0x1'));var moment=require(_0xe463('0x2'));var BPromise=require(_0xe463('0x3'));var rp=require(_0xe463('0x4'));var fs=require('fs');var path=require(_0xe463('0x5'));var rimraf=require(_0xe463('0x6'));var config=require(_0xe463('0x7'));var attributes=require(_0xe463('0x8'));module['exports']=function(_0x22effd,_0x1d5a99){return _0x22effd[_0xe463('0x9')](_0xe463('0xa'),attributes,{'tableName':_0xe463('0xb'),'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 1ac9647..23570b0 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 _0x1794=['jayson/promise','client','http','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0xd204b0,_0x4c7d1d){var _0xfc8310=function(_0x4f4b5a){while(--_0x4f4b5a){_0xd204b0['push'](_0xd204b0['shift']());}};_0xfc8310(++_0x4c7d1d);}(_0x1794,0x19d));var _0x4179=function(_0x1570b3,_0x3bd104){_0x1570b3=_0x1570b3-0x0;var _0x4fd185=_0x1794[_0x1570b3];return _0x4fd185;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4179('0x0'));var BPromise=require(_0x4179('0x1'));var rs=require(_0x4179('0x2'));var fs=require('fs');var Redis=require(_0x4179('0x3'));var db=require(_0x4179('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4179('0x5'));var config=require(_0x4179('0x6'));var jayson=require(_0x4179('0x7'));var client=jayson[_0x4179('0x8')][_0x4179('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x840dda,_0xcfdd0b,_0x24f3ff){return new BPromise(function(_0x45d2c9,_0x3fdaff){return client['request'](_0x840dda,_0x24f3ff)[_0x4179('0xa')](function(_0x1e52a6){logger[_0x4179('0xb')]('VoiceContext,\x20%s,\x20%s',_0xcfdd0b,_0x4179('0xc'));logger['debug'](_0x4179('0xd'),_0xcfdd0b,'request\x20sent',JSON[_0x4179('0xe')](_0x1e52a6));if(_0x1e52a6['error']){if(_0x1e52a6[_0x4179('0xf')][_0x4179('0x10')]===0x1f4){logger[_0x4179('0xf')]('VoiceContext,\x20%s,\x20%s',_0xcfdd0b,_0x1e52a6[_0x4179('0xf')]['message']);return _0x3fdaff(_0x1e52a6[_0x4179('0xf')][_0x4179('0x11')]);}logger['error'](_0x4179('0x12'),_0xcfdd0b,_0x1e52a6[_0x4179('0xf')]['message']);return _0x45d2c9(_0x1e52a6[_0x4179('0xf')][_0x4179('0x11')]);}else{logger[_0x4179('0xb')](_0x4179('0x12'),_0xcfdd0b,_0x4179('0xc'));_0x45d2c9(_0x1e52a6[_0x4179('0x13')][_0x4179('0x11')]);}})[_0x4179('0x14')](function(_0x2b82d0){logger[_0x4179('0xf')](_0x4179('0x12'),_0xcfdd0b,_0x2b82d0);_0x3fdaff(_0x2b82d0);});});} \ No newline at end of file +var _0xc64b=['../../config/environment','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x24001f,_0x3e494b){var _0x2554b8=function(_0x59caae){while(--_0x59caae){_0x24001f['push'](_0x24001f['shift']());}};_0x2554b8(++_0x3e494b);}(_0xc64b,0xaf));var _0xbc64=function(_0x11dcf0,_0x4eb137){_0x11dcf0=_0x11dcf0-0x0;var _0x4f9831=_0xc64b[_0x11dcf0];return _0x4f9831;};'use strict';var _=require(_0xbc64('0x0'));var util=require(_0xbc64('0x1'));var moment=require(_0xbc64('0x2'));var BPromise=require(_0xbc64('0x3'));var rs=require(_0xbc64('0x4'));var fs=require('fs');var Redis=require(_0xbc64('0x5'));var db=require(_0xbc64('0x6'))['db'];var utils=require(_0xbc64('0x7'));var logger=require(_0xbc64('0x8'))('rpc');var config=require(_0xbc64('0x9'));var jayson=require(_0xbc64('0xa'));var client=jayson['client'][_0xbc64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33af86,_0x4f0be7,_0x13d02f){return new BPromise(function(_0x3e7323,_0x4b9149){return client[_0xbc64('0xc')](_0x33af86,_0x13d02f)[_0xbc64('0xd')](function(_0x4904a5){logger[_0xbc64('0xe')](_0xbc64('0xf'),_0x4f0be7,_0xbc64('0x10'));logger[_0xbc64('0x11')](_0xbc64('0x12'),_0x4f0be7,_0xbc64('0x10'),JSON[_0xbc64('0x13')](_0x4904a5));if(_0x4904a5[_0xbc64('0x14')]){if(_0x4904a5[_0xbc64('0x14')]['code']===0x1f4){logger[_0xbc64('0x14')](_0xbc64('0xf'),_0x4f0be7,_0x4904a5[_0xbc64('0x14')][_0xbc64('0x15')]);return _0x4b9149(_0x4904a5[_0xbc64('0x14')][_0xbc64('0x15')]);}logger[_0xbc64('0x14')](_0xbc64('0xf'),_0x4f0be7,_0x4904a5[_0xbc64('0x14')][_0xbc64('0x15')]);return _0x3e7323(_0x4904a5[_0xbc64('0x14')][_0xbc64('0x15')]);}else{logger[_0xbc64('0xe')](_0xbc64('0xf'),_0x4f0be7,_0xbc64('0x10'));_0x3e7323(_0x4904a5['result'][_0xbc64('0x15')]);}})[_0xbc64('0x16')](function(_0x1362a2){logger[_0xbc64('0x14')](_0xbc64('0xf'),_0x4f0be7,_0x1362a2);_0x4b9149(_0x1362a2);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 7a036d4..f1caaed 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 _0xb311=['./voiceDialReport.controller','get','isAuthenticated','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xca3269,_0x374910){var _0x3b015c=function(_0x287ed5){while(--_0x287ed5){_0xca3269['push'](_0xca3269['shift']());}};_0x3b015c(++_0x374910);}(_0xb311,0xad));var _0x1b31=function(_0x1ea436,_0x1fca2d){_0x1ea436=_0x1ea436-0x0;var _0x51734c=_0xb311[_0x1ea436];return _0x51734c;};'use strict';var multer=require(_0x1b31('0x0'));var util=require(_0x1b31('0x1'));var path=require(_0x1b31('0x2'));var timeout=require(_0x1b31('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1b31('0x4'));var auth=require(_0x1b31('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1b31('0x6'));var controller=require(_0x1b31('0x7'));router[_0x1b31('0x8')]('/',auth[_0x1b31('0x9')](),controller['index']);router[_0x1b31('0x8')](_0x1b31('0xa'),auth[_0x1b31('0x9')](),controller[_0x1b31('0xb')]);router[_0x1b31('0x8')]('/:id',auth[_0x1b31('0x9')](),controller[_0x1b31('0xc')]);router[_0x1b31('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1b31('0xe')](_0x1b31('0xf'),auth['isAuthenticated'](),controller[_0x1b31('0x10')]);router[_0x1b31('0x11')](_0x1b31('0xf'),auth['isAuthenticated'](),controller[_0x1b31('0x12')]);module[_0x1b31('0x13')]=router; \ No newline at end of file +var _0x0971=['post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0971,0xc3));var _0x1097=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x0971[_0x1fa759];return _0x2da9f4;};'use strict';var multer=require(_0x1097('0x0'));var util=require(_0x1097('0x1'));var path=require(_0x1097('0x2'));var timeout=require(_0x1097('0x3'));var express=require(_0x1097('0x4'));var router=express[_0x1097('0x5')]();var fs_extra=require(_0x1097('0x6'));var auth=require(_0x1097('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1097('0x8'));router[_0x1097('0x9')]('/',auth[_0x1097('0xa')](),controller[_0x1097('0xb')]);router[_0x1097('0x9')](_0x1097('0xc'),auth[_0x1097('0xa')](),controller['describe']);router[_0x1097('0x9')](_0x1097('0xd'),auth['isAuthenticated'](),controller[_0x1097('0xe')]);router[_0x1097('0xf')]('/',auth[_0x1097('0xa')](),controller['create']);router[_0x1097('0x10')]('/:id',auth[_0x1097('0xa')](),controller[_0x1097('0x11')]);router[_0x1097('0x12')](_0x1097('0xd'),auth[_0x1097('0xa')](),controller[_0x1097('0x13')]);module[_0x1097('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 6832e01..527af7e 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 _0x6aa7=['called,connect,complete','sequelize','STRING','INTEGER','DATE'];(function(_0xf29f2e,_0x342e41){var _0x24e9d6=function(_0x14146f){while(--_0x14146f){_0xf29f2e['push'](_0xf29f2e['shift']());}};_0x24e9d6(++_0x342e41);}(_0x6aa7,0x178));var _0x76aa=function(_0x5241ca,_0x3c5806){_0x5241ca=_0x5241ca-0x0;var _0x28122a=_0x6aa7[_0x5241ca];return _0x28122a;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x76aa('0x1')]},'channel':{'type':Sequelize[_0x76aa('0x1')]},'channelstate':{'type':Sequelize[_0x76aa('0x2')]},'channelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76aa('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x2')]},'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'linkedid':{'type':Sequelize[_0x76aa('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x76aa('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'destlanguage':{'type':Sequelize[_0x76aa('0x1')]},'destaccountcode':{'type':Sequelize[_0x76aa('0x1')]},'destcontext':{'type':Sequelize[_0x76aa('0x1')]},'destexten':{'type':Sequelize[_0x76aa('0x1')]},'destpriority':{'type':Sequelize[_0x76aa('0x2')]},'destuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'destlinkedid':{'type':Sequelize[_0x76aa('0x1')]},'dialstring':{'type':Sequelize[_0x76aa('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x76aa('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x76aa('0x3')]},'lastevent':{'type':Sequelize[_0x76aa('0x1')],'comment':_0x76aa('0x4')},'routeId':{'type':Sequelize[_0x76aa('0x2')]},'duration':{'type':Sequelize[_0x76aa('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x53bf29,_0x1d05f1){var _0xd7eecd=function(_0x21a44c){while(--_0x21a44c){_0x53bf29['push'](_0x53bf29['shift']());}};_0xd7eecd(++_0x1d05f1);}(_0x81bd,0x7c));var _0xd81b=function(_0x5c9967,_0x59304e){_0x5c9967=_0x5c9967-0x0;var _0x319e8c=_0x81bd[_0x5c9967];return _0x319e8c;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 360eb95..1d195d4 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 _0xe833=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceDialReport','include','rows','show','rawAttributes','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0xe833,0x146));var _0x3e83=function(_0x17d758,_0x22fa90){_0x17d758=_0x17d758-0x0;var _0x27b498=_0xe833[_0x17d758];return _0x27b498;};'use strict';var emlformat=require(_0x3e83('0x0'));var rimraf=require(_0x3e83('0x1'));var zipdir=require(_0x3e83('0x2'));var jsonpatch=require(_0x3e83('0x3'));var rp=require(_0x3e83('0x4'));var moment=require('moment');var BPromise=require(_0x3e83('0x5'));var Mustache=require(_0x3e83('0x6'));var util=require(_0x3e83('0x7'));var path=require(_0x3e83('0x8'));var sox=require(_0x3e83('0x9'));var csv=require(_0x3e83('0xa'));var ejs=require(_0x3e83('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e83('0xc'));var squel=require(_0x3e83('0xd'));var crypto=require(_0x3e83('0xe'));var jsforce=require(_0x3e83('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3e83('0x10'));var Papa=require('papaparse');var Redis=require(_0x3e83('0x11'));var authService=require(_0x3e83('0x12'));var qs=require(_0x3e83('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e83('0x14'));var logger=require('../../config/logger')(_0x3e83('0x15'));var utils=require(_0x3e83('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3e83('0x17'));var db=require(_0x3e83('0x18'))['db'];function respondWithStatusCode(_0x3b63e1,_0x3875dd){_0x3875dd=_0x3875dd||0xcc;return function(_0x1b6376){if(_0x1b6376){return _0x3b63e1[_0x3e83('0x19')](_0x3875dd);}return _0x3b63e1[_0x3e83('0x1a')](_0x3875dd)['end']();};}function respondWithResult(_0x4f5029,_0x309309){_0x309309=_0x309309||0xc8;return function(_0x40ba80){if(_0x40ba80){return _0x4f5029['status'](_0x309309)['json'](_0x40ba80);}};}function respondWithFilteredResult(_0x2c8bb1,_0x499b9c){return function(_0x3aa15a){if(_0x3aa15a){var _0x5d23fc=typeof _0x499b9c[_0x3e83('0x1b')]==='undefined'&&typeof _0x499b9c[_0x3e83('0x1c')]===_0x3e83('0x1d');var _0x49ccbf=_0x3aa15a[_0x3e83('0x1e')];var _0x1d5fff=_0x5d23fc?0x0:_0x499b9c[_0x3e83('0x1b')];var _0x548492=_0x5d23fc?_0x3aa15a[_0x3e83('0x1e')]:_0x499b9c[_0x3e83('0x1b')]+_0x499b9c['limit'];var _0x591919;if(_0x548492>=_0x49ccbf){_0x548492=_0x49ccbf;_0x591919=0xc8;}else{_0x591919=0xce;}_0x2c8bb1[_0x3e83('0x1a')](_0x591919);return _0x2c8bb1[_0x3e83('0x1f')](_0x3e83('0x20'),_0x1d5fff+'-'+_0x548492+'/'+_0x49ccbf)[_0x3e83('0x21')](_0x3aa15a);}return null;};}function patchUpdates(_0x4113f5){return function(_0x437356){try{jsonpatch[_0x3e83('0x22')](_0x437356,_0x4113f5,!![]);}catch(_0x3ca2cb){return BPromise[_0x3e83('0x23')](_0x3ca2cb);}return _0x437356[_0x3e83('0x24')]();};}function saveUpdates(_0x375d8c,_0x617496){return function(_0x3526d0){if(_0x3526d0){return _0x3526d0[_0x3e83('0x25')](_0x375d8c)[_0x3e83('0x26')](function(_0x1c5f07){return _0x1c5f07;});}return null;};}function removeEntity(_0x4670fa,_0x12db4b){return function(_0x15ed84){if(_0x15ed84){return _0x15ed84[_0x3e83('0x27')]()[_0x3e83('0x26')](function(){_0x4670fa[_0x3e83('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a42a5,_0x5d2044){return function(_0x3000fb){if(!_0x3000fb){_0x4a42a5[_0x3e83('0x19')](0x194);}return _0x3000fb;};}function handleError(_0x16d178,_0x2e4a40){_0x2e4a40=_0x2e4a40||0x1f4;return function(_0x21f5a9){logger[_0x3e83('0x28')](_0x21f5a9['stack']);if(_0x21f5a9[_0x3e83('0x29')]){delete _0x21f5a9[_0x3e83('0x29')];}_0x16d178[_0x3e83('0x1a')](_0x2e4a40)[_0x3e83('0x2a')](_0x21f5a9);};}exports[_0x3e83('0x2b')]=function(_0x5d846f,_0x4130a5){var _0x5ca801={},_0xc009d5={},_0x3025b5={'count':0x0,'rows':[]};var _0x2eab31=_[_0x3e83('0x2c')](db['VoiceDialReport']['rawAttributes'],function(_0x6983e5){return{'name':_0x6983e5['fieldName'],'type':_0x6983e5[_0x3e83('0x2d')][_0x3e83('0x2e')]};});_0xc009d5[_0x3e83('0x2f')]=_[_0x3e83('0x2c')](_0x2eab31,_0x3e83('0x29'));_0xc009d5[_0x3e83('0x30')]=_[_0x3e83('0x31')](_0x5d846f['query']);_0xc009d5[_0x3e83('0x32')]=_[_0x3e83('0x33')](_0xc009d5['model'],_0xc009d5[_0x3e83('0x30')]);_0x5ca801[_0x3e83('0x34')]=_[_0x3e83('0x33')](_0xc009d5['model'],qs['fields'](_0x5d846f[_0x3e83('0x30')][_0x3e83('0x35')]));_0x5ca801[_0x3e83('0x34')]=_0x5ca801[_0x3e83('0x34')][_0x3e83('0x36')]?_0x5ca801[_0x3e83('0x34')]:_0xc009d5[_0x3e83('0x2f')];if(!_0x5d846f['query'][_0x3e83('0x37')](_0x3e83('0x38'))){_0x5ca801[_0x3e83('0x1c')]=qs[_0x3e83('0x1c')](_0x5d846f['query'][_0x3e83('0x1c')]);_0x5ca801[_0x3e83('0x1b')]=qs[_0x3e83('0x1b')](_0x5d846f[_0x3e83('0x30')]['offset']);}_0x5ca801[_0x3e83('0x39')]=qs[_0x3e83('0x3a')](_0x5d846f[_0x3e83('0x30')][_0x3e83('0x3a')]);_0x5ca801[_0x3e83('0x3b')]=qs[_0x3e83('0x32')](_[_0x3e83('0x3c')](_0x5d846f[_0x3e83('0x30')],_0xc009d5[_0x3e83('0x32')]),_0x2eab31);if(_0x5d846f['query'][_0x3e83('0x3d')]){_0x5ca801[_0x3e83('0x3b')]=_[_0x3e83('0x3e')](_0x5ca801['where'],{'$or':_[_0x3e83('0x2c')](_0x2eab31,function(_0x495d8c){if(_0x495d8c['type']!==_0x3e83('0x3f')){var _0x2ec7fc={};_0x2ec7fc[_0x495d8c[_0x3e83('0x29')]]={'$like':'%'+_0x5d846f[_0x3e83('0x30')][_0x3e83('0x3d')]+'%'};return _0x2ec7fc;}})});}_0x5ca801=_[_0x3e83('0x3e')]({},_0x5ca801,_0x5d846f[_0x3e83('0x40')]);var _0x59eb4f={'where':_0x5ca801[_0x3e83('0x3b')]};return db[_0x3e83('0x41')][_0x3e83('0x1e')](_0x59eb4f)['then'](function(_0x3f58ca){_0x3025b5[_0x3e83('0x1e')]=_0x3f58ca;if(_0x5d846f['query']['includeAll']){_0x5ca801[_0x3e83('0x42')]=[{'all':!![]}];}return db[_0x3e83('0x41')]['findAll'](_0x5ca801);})['then'](function(_0x4796b8){_0x3025b5[_0x3e83('0x43')]=_0x4796b8;return _0x3025b5;})[_0x3e83('0x26')](respondWithFilteredResult(_0x4130a5,_0x5ca801))['catch'](handleError(_0x4130a5,null));};exports[_0x3e83('0x44')]=function(_0x53929f,_0x50387d){var _0x4d71f4={'raw':!![],'where':{'id':_0x53929f['params']['id']}},_0x55c026={};_0x55c026['model']=_[_0x3e83('0x31')](db[_0x3e83('0x41')][_0x3e83('0x45')]);_0x55c026[_0x3e83('0x30')]=_[_0x3e83('0x31')](_0x53929f[_0x3e83('0x30')]);_0x55c026[_0x3e83('0x32')]=_[_0x3e83('0x33')](_0x55c026['model'],_0x55c026['query']);_0x4d71f4[_0x3e83('0x34')]=_[_0x3e83('0x33')](_0x55c026['model'],qs['fields'](_0x53929f[_0x3e83('0x30')][_0x3e83('0x35')]));_0x4d71f4[_0x3e83('0x34')]=_0x4d71f4['attributes']['length']?_0x4d71f4[_0x3e83('0x34')]:_0x55c026[_0x3e83('0x2f')];if(_0x53929f[_0x3e83('0x30')]['includeAll']){_0x4d71f4['include']=[{'all':!![]}];}_0x4d71f4=_['merge']({},_0x4d71f4,_0x53929f[_0x3e83('0x40')]);return db['VoiceDialReport'][_0x3e83('0x46')](_0x4d71f4)[_0x3e83('0x26')](handleEntityNotFound(_0x50387d,null))[_0x3e83('0x26')](respondWithResult(_0x50387d,null))['catch'](handleError(_0x50387d,null));};exports[_0x3e83('0x47')]=function(_0x4580a4,_0x214eb3){return db['VoiceDialReport'][_0x3e83('0x47')](_0x4580a4[_0x3e83('0x48')],{})[_0x3e83('0x26')](respondWithResult(_0x214eb3,0xc9))[_0x3e83('0x49')](handleError(_0x214eb3,null));};exports[_0x3e83('0x25')]=function(_0x33963d,_0x5f11f8){if(_0x33963d[_0x3e83('0x48')]['id']){delete _0x33963d['body']['id'];}return db['VoiceDialReport'][_0x3e83('0x46')]({'where':{'id':_0x33963d['params']['id']}})[_0x3e83('0x26')](handleEntityNotFound(_0x5f11f8,null))[_0x3e83('0x26')](saveUpdates(_0x33963d[_0x3e83('0x48')],null))['then'](respondWithResult(_0x5f11f8,null))['catch'](handleError(_0x5f11f8,null));};exports['destroy']=function(_0xb514be,_0x35de90){return db[_0x3e83('0x41')][_0x3e83('0x46')]({'where':{'id':_0xb514be[_0x3e83('0x4a')]['id']}})[_0x3e83('0x26')](handleEntityNotFound(_0x35de90,null))[_0x3e83('0x26')](removeEntity(_0x35de90,null))['catch'](handleError(_0x35de90,null));};exports[_0x3e83('0x4b')]=function(_0x1d96e1,_0x3423d1){return db[_0x3e83('0x41')][_0x3e83('0x4b')]()[_0x3e83('0x26')](respondWithResult(_0x3423d1,null))[_0x3e83('0x49')](handleError(_0x3423d1,null));}; \ No newline at end of file +var _0x5b82=['filters','filter','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x5b82,0xfb));var _0x25b8=function(_0xdee10d,_0x57d73d){_0xdee10d=_0xdee10d-0x0;var _0x55c181=_0x5b82[_0xdee10d];return _0x55c181;};'use strict';var emlformat=require(_0x25b8('0x0'));var rimraf=require(_0x25b8('0x1'));var zipdir=require(_0x25b8('0x2'));var jsonpatch=require(_0x25b8('0x3'));var rp=require(_0x25b8('0x4'));var moment=require(_0x25b8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x25b8('0x6'));var util=require(_0x25b8('0x7'));var path=require(_0x25b8('0x8'));var sox=require(_0x25b8('0x9'));var csv=require(_0x25b8('0xa'));var ejs=require(_0x25b8('0xb'));var fs=require('fs');var fs_extra=require(_0x25b8('0xc'));var _=require(_0x25b8('0xd'));var squel=require(_0x25b8('0xe'));var crypto=require(_0x25b8('0xf'));var jsforce=require(_0x25b8('0x10'));var deskjs=require(_0x25b8('0x11'));var toCsv=require(_0x25b8('0xa'));var querystring=require('querystring');var Papa=require(_0x25b8('0x12'));var Redis=require(_0x25b8('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x25b8('0x14'));var as=require(_0x25b8('0x15'));var hardwareService=require(_0x25b8('0x16'));var logger=require(_0x25b8('0x17'))(_0x25b8('0x18'));var utils=require(_0x25b8('0x19'));var config=require(_0x25b8('0x1a'));var licenseUtil=require(_0x25b8('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x558a62,_0x572944){_0x572944=_0x572944||0xcc;return function(_0x2cd6f9){if(_0x2cd6f9){return _0x558a62[_0x25b8('0x1c')](_0x572944);}return _0x558a62[_0x25b8('0x1d')](_0x572944)['end']();};}function respondWithResult(_0x4b74ff,_0x10366d){_0x10366d=_0x10366d||0xc8;return function(_0x371631){if(_0x371631){return _0x4b74ff[_0x25b8('0x1d')](_0x10366d)['json'](_0x371631);}};}function respondWithFilteredResult(_0x476480,_0x30f61d){return function(_0x1c9373){if(_0x1c9373){var _0x423ffd=typeof _0x30f61d['offset']===_0x25b8('0x1e')&&typeof _0x30f61d['limit']==='undefined';var _0x46cc3b=_0x1c9373[_0x25b8('0x1f')];var _0x27efda=_0x423ffd?0x0:_0x30f61d['offset'];var _0xc08651=_0x423ffd?_0x1c9373['count']:_0x30f61d[_0x25b8('0x20')]+_0x30f61d['limit'];var _0x52b068;if(_0xc08651>=_0x46cc3b){_0xc08651=_0x46cc3b;_0x52b068=0xc8;}else{_0x52b068=0xce;}_0x476480['status'](_0x52b068);return _0x476480[_0x25b8('0x21')](_0x25b8('0x22'),_0x27efda+'-'+_0xc08651+'/'+_0x46cc3b)[_0x25b8('0x23')](_0x1c9373);}return null;};}function patchUpdates(_0x15d49c){return function(_0x2d3a2f){try{jsonpatch[_0x25b8('0x24')](_0x2d3a2f,_0x15d49c,!![]);}catch(_0x361c12){return BPromise[_0x25b8('0x25')](_0x361c12);}return _0x2d3a2f['save']();};}function saveUpdates(_0x23b96a,_0x553d71){return function(_0x5c46e4){if(_0x5c46e4){return _0x5c46e4[_0x25b8('0x26')](_0x23b96a)[_0x25b8('0x27')](function(_0x3f8239){return _0x3f8239;});}return null;};}function removeEntity(_0x1f865f,_0x1afce2){return function(_0x31aae8){if(_0x31aae8){return _0x31aae8[_0x25b8('0x28')]()[_0x25b8('0x27')](function(){_0x1f865f[_0x25b8('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21de19,_0x532cc2){return function(_0x1bad44){if(!_0x1bad44){_0x21de19[_0x25b8('0x1c')](0x194);}return _0x1bad44;};}function handleError(_0x54fd5e,_0xef06b5){_0xef06b5=_0xef06b5||0x1f4;return function(_0x420f9c){logger[_0x25b8('0x29')](_0x420f9c[_0x25b8('0x2a')]);if(_0x420f9c[_0x25b8('0x2b')]){delete _0x420f9c[_0x25b8('0x2b')];}_0x54fd5e['status'](_0xef06b5)[_0x25b8('0x2c')](_0x420f9c);};}exports[_0x25b8('0x2d')]=function(_0x565bd8,_0x591660){var _0x23f687={},_0xa2f9aa={},_0x5d2aaf={'count':0x0,'rows':[]};var _0x4842c2=_[_0x25b8('0x2e')](db[_0x25b8('0x2f')][_0x25b8('0x30')],function(_0x4faff2){return{'name':_0x4faff2[_0x25b8('0x31')],'type':_0x4faff2[_0x25b8('0x32')][_0x25b8('0x33')]};});_0xa2f9aa[_0x25b8('0x34')]=_['map'](_0x4842c2,_0x25b8('0x2b'));_0xa2f9aa[_0x25b8('0x35')]=_[_0x25b8('0x36')](_0x565bd8[_0x25b8('0x35')]);_0xa2f9aa['filters']=_[_0x25b8('0x37')](_0xa2f9aa['model'],_0xa2f9aa[_0x25b8('0x35')]);_0x23f687['attributes']=_['intersection'](_0xa2f9aa[_0x25b8('0x34')],qs[_0x25b8('0x38')](_0x565bd8[_0x25b8('0x35')][_0x25b8('0x38')]));_0x23f687['attributes']=_0x23f687[_0x25b8('0x39')][_0x25b8('0x3a')]?_0x23f687[_0x25b8('0x39')]:_0xa2f9aa[_0x25b8('0x34')];if(!_0x565bd8[_0x25b8('0x35')][_0x25b8('0x3b')](_0x25b8('0x3c'))){_0x23f687[_0x25b8('0x3d')]=qs[_0x25b8('0x3d')](_0x565bd8[_0x25b8('0x35')][_0x25b8('0x3d')]);_0x23f687[_0x25b8('0x20')]=qs[_0x25b8('0x20')](_0x565bd8['query'][_0x25b8('0x20')]);}_0x23f687[_0x25b8('0x3e')]=qs[_0x25b8('0x3f')](_0x565bd8[_0x25b8('0x35')][_0x25b8('0x3f')]);_0x23f687[_0x25b8('0x40')]=qs[_0x25b8('0x41')](_['pick'](_0x565bd8['query'],_0xa2f9aa[_0x25b8('0x41')]),_0x4842c2);if(_0x565bd8[_0x25b8('0x35')][_0x25b8('0x42')]){_0x23f687[_0x25b8('0x40')]=_[_0x25b8('0x43')](_0x23f687[_0x25b8('0x40')],{'$or':_[_0x25b8('0x2e')](_0x4842c2,function(_0x3c4b7a){if(_0x3c4b7a[_0x25b8('0x32')]!=='VIRTUAL'){var _0x590941={};_0x590941[_0x3c4b7a[_0x25b8('0x2b')]]={'$like':'%'+_0x565bd8['query'][_0x25b8('0x42')]+'%'};return _0x590941;}})});}_0x23f687=_[_0x25b8('0x43')]({},_0x23f687,_0x565bd8[_0x25b8('0x44')]);var _0x47e1d8={'where':_0x23f687[_0x25b8('0x40')]};return db['VoiceDialReport'][_0x25b8('0x1f')](_0x47e1d8)[_0x25b8('0x27')](function(_0x53401e){_0x5d2aaf[_0x25b8('0x1f')]=_0x53401e;if(_0x565bd8[_0x25b8('0x35')][_0x25b8('0x45')]){_0x23f687[_0x25b8('0x46')]=[{'all':!![]}];}return db[_0x25b8('0x2f')][_0x25b8('0x47')](_0x23f687);})[_0x25b8('0x27')](function(_0x308182){_0x5d2aaf['rows']=_0x308182;return _0x5d2aaf;})[_0x25b8('0x27')](respondWithFilteredResult(_0x591660,_0x23f687))['catch'](handleError(_0x591660,null));};exports[_0x25b8('0x48')]=function(_0x2d7b9d,_0x11f200){var _0x1efd9d={'raw':!![],'where':{'id':_0x2d7b9d[_0x25b8('0x49')]['id']}},_0x46f804={};_0x46f804['model']=_[_0x25b8('0x36')](db[_0x25b8('0x2f')]['rawAttributes']);_0x46f804[_0x25b8('0x35')]=_[_0x25b8('0x36')](_0x2d7b9d[_0x25b8('0x35')]);_0x46f804[_0x25b8('0x41')]=_['intersection'](_0x46f804[_0x25b8('0x34')],_0x46f804[_0x25b8('0x35')]);_0x1efd9d[_0x25b8('0x39')]=_['intersection'](_0x46f804[_0x25b8('0x34')],qs[_0x25b8('0x38')](_0x2d7b9d['query'][_0x25b8('0x38')]));_0x1efd9d['attributes']=_0x1efd9d[_0x25b8('0x39')][_0x25b8('0x3a')]?_0x1efd9d[_0x25b8('0x39')]:_0x46f804[_0x25b8('0x34')];if(_0x2d7b9d[_0x25b8('0x35')][_0x25b8('0x45')]){_0x1efd9d[_0x25b8('0x46')]=[{'all':!![]}];}_0x1efd9d=_[_0x25b8('0x43')]({},_0x1efd9d,_0x2d7b9d['options']);return db[_0x25b8('0x2f')][_0x25b8('0x4a')](_0x1efd9d)[_0x25b8('0x27')](handleEntityNotFound(_0x11f200,null))[_0x25b8('0x27')](respondWithResult(_0x11f200,null))[_0x25b8('0x4b')](handleError(_0x11f200,null));};exports[_0x25b8('0x4c')]=function(_0x3f264e,_0x1c5fa6){return db['VoiceDialReport']['create'](_0x3f264e[_0x25b8('0x4d')],{})[_0x25b8('0x27')](respondWithResult(_0x1c5fa6,0xc9))['catch'](handleError(_0x1c5fa6,null));};exports[_0x25b8('0x26')]=function(_0x3cbeba,_0x584df7){if(_0x3cbeba[_0x25b8('0x4d')]['id']){delete _0x3cbeba[_0x25b8('0x4d')]['id'];}return db[_0x25b8('0x2f')][_0x25b8('0x4a')]({'where':{'id':_0x3cbeba[_0x25b8('0x49')]['id']}})['then'](handleEntityNotFound(_0x584df7,null))[_0x25b8('0x27')](saveUpdates(_0x3cbeba[_0x25b8('0x4d')],null))[_0x25b8('0x27')](respondWithResult(_0x584df7,null))[_0x25b8('0x4b')](handleError(_0x584df7,null));};exports[_0x25b8('0x28')]=function(_0x4d7087,_0x12f5b8){return db[_0x25b8('0x2f')][_0x25b8('0x4a')]({'where':{'id':_0x4d7087[_0x25b8('0x49')]['id']}})[_0x25b8('0x27')](handleEntityNotFound(_0x12f5b8,null))[_0x25b8('0x27')](removeEntity(_0x12f5b8,null))[_0x25b8('0x4b')](handleError(_0x12f5b8,null));};exports['describe']=function(_0x451d9e,_0x4feb31){return db[_0x25b8('0x2f')][_0x25b8('0x4e')]()[_0x25b8('0x27')](respondWithResult(_0x4feb31,null))[_0x25b8('0x4b')](handleError(_0x4feb31,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 157879d..2917f42 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 _0x4422=['./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','api','bluebird','request-promise','../../config/environment'];(function(_0x1cbbe1,_0x3369f1){var _0x550004=function(_0x204258){while(--_0x204258){_0x1cbbe1['push'](_0x1cbbe1['shift']());}};_0x550004(++_0x3369f1);}(_0x4422,0xab));var _0x2442=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4422[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x2442('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2442('0x1'));var moment=require('moment');var BPromise=require(_0x2442('0x2'));var rp=require(_0x2442('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2442('0x4'));var attributes=require(_0x2442('0x5'));module[_0x2442('0x6')]=function(_0x264e31,_0x5dc81d){return _0x264e31[_0x2442('0x7')](_0x2442('0x8'),attributes,{'tableName':_0x2442('0x9'),'paranoid':![],'indexes':[{'fields':[_0x2442('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc49f=['define','VoiceDialReport','report_dial','uniqueid','lodash','api','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0xb4a818,_0x31c56a){var _0x439fbd=function(_0x4ba228){while(--_0x4ba228){_0xb4a818['push'](_0xb4a818['shift']());}};_0x439fbd(++_0x31c56a);}(_0xc49f,0x1c0));var _0xfc49=function(_0xbfb4db,_0x33785b){_0xbfb4db=_0xbfb4db-0x0;var _0x52a78d=_0xc49f[_0xbfb4db];return _0x52a78d;};'use strict';var _=require(_0xfc49('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfc49('0x1'));var moment=require('moment');var BPromise=require(_0xfc49('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc49('0x3'));var rimraf=require(_0xfc49('0x4'));var config=require(_0xfc49('0x5'));var attributes=require(_0xfc49('0x6'));module[_0xfc49('0x7')]=function(_0xbeceb4,_0x311442){return _0xbeceb4[_0xfc49('0x8')](_0xfc49('0x9'),attributes,{'tableName':_0xfc49('0xa'),'paranoid':![],'indexes':[{'fields':[_0xfc49('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index ca4dcc8..c7d10b5 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 _0x6636=['options','then','stringify','UpdateVoiceDialReport','VoiceDialReport','update','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceDialReport','body'];(function(_0x3351be,_0x19195d){var _0x59174f=function(_0x10e8a8){while(--_0x10e8a8){_0x3351be['push'](_0x3351be['shift']());}};_0x59174f(++_0x19195d);}(_0x6636,0x17c));var _0x6663=function(_0x75a971,_0x42462c){_0x75a971=_0x75a971-0x0;var _0x28d4c8=_0x6636[_0x75a971];return _0x28d4c8;};'use strict';var _=require(_0x6663('0x0'));var util=require(_0x6663('0x1'));var moment=require(_0x6663('0x2'));var BPromise=require(_0x6663('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6663('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6663('0x5'))('rpc');var config=require(_0x6663('0x6'));var jayson=require(_0x6663('0x7'));var client=jayson[_0x6663('0x8')][_0x6663('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x298075,_0x3571af,_0x1b449b){return new BPromise(function(_0x17e4e5,_0x4e439c){return client[_0x6663('0xa')](_0x298075,_0x1b449b)['then'](function(_0x5450ec){logger[_0x6663('0xb')](_0x6663('0xc'),_0x3571af,_0x6663('0xd'));logger[_0x6663('0xe')](_0x6663('0xf'),_0x3571af,_0x6663('0xd'),JSON['stringify'](_0x5450ec));if(_0x5450ec[_0x6663('0x10')]){if(_0x5450ec[_0x6663('0x10')][_0x6663('0x11')]===0x1f4){logger[_0x6663('0x10')](_0x6663('0xc'),_0x3571af,_0x5450ec['error'][_0x6663('0x12')]);return _0x4e439c(_0x5450ec[_0x6663('0x10')][_0x6663('0x12')]);}logger[_0x6663('0x10')](_0x6663('0xc'),_0x3571af,_0x5450ec['error'][_0x6663('0x12')]);return _0x17e4e5(_0x5450ec[_0x6663('0x10')][_0x6663('0x12')]);}else{logger[_0x6663('0xb')](_0x6663('0xc'),_0x3571af,'request\x20sent');_0x17e4e5(_0x5450ec[_0x6663('0x13')][_0x6663('0x12')]);}})[_0x6663('0x14')](function(_0x27f1b6){logger[_0x6663('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x3571af,_0x27f1b6);_0x4e439c(_0x27f1b6);});});}exports[_0x6663('0x15')]=function(_0xba1b89){var _0x4e77eb=this;return new Promise(function(_0x1e49c8,_0x1c4302){return db['VoiceDialReport']['create'](_0xba1b89[_0x6663('0x16')],{'raw':_0xba1b89[_0x6663('0x17')]?_0xba1b89[_0x6663('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x6663('0x18')](function(_0xf58c97){logger[_0x6663('0xb')](_0x6663('0x15'),_0xba1b89);logger[_0x6663('0xe')]('CreateVoiceDialReport',_0xba1b89,JSON[_0x6663('0x19')](_0xf58c97));_0x1e49c8(_0xf58c97);})[_0x6663('0x14')](function(_0x23979f){logger[_0x6663('0x10')](_0x6663('0x15'),_0x23979f[_0x6663('0x12')],_0xba1b89);_0x1c4302(_0x4e77eb['error'](0x1f4,_0x23979f[_0x6663('0x12')]));});});};exports[_0x6663('0x1a')]=function(_0x25b512){var _0x294ee8=this;return new Promise(function(_0x33d2fc,_0x3a26d9){return db[_0x6663('0x1b')][_0x6663('0x1c')](_0x25b512[_0x6663('0x16')],{'raw':_0x25b512[_0x6663('0x17')]?_0x25b512[_0x6663('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25b512[_0x6663('0x17')]?_0x25b512['options']['where']||null:null,'attributes':_0x25b512[_0x6663('0x17')]?_0x25b512[_0x6663('0x17')][_0x6663('0x1d')]||null:null,'limit':_0x25b512['options']?_0x25b512[_0x6663('0x17')][_0x6663('0x1e')]||null:null})['then'](function(_0x1abffd){logger[_0x6663('0xb')](_0x6663('0x1a'),_0x25b512);logger[_0x6663('0xe')](_0x6663('0x1a'),_0x25b512,JSON[_0x6663('0x19')](_0x1abffd));_0x33d2fc(_0x1abffd);})[_0x6663('0x14')](function(_0x44489f){logger[_0x6663('0x10')]('UpdateVoiceDialReport',_0x44489f['message'],_0x25b512);_0x3a26d9(_0x294ee8['error'](0x1f4,_0x44489f[_0x6663('0x12')]));});});}; \ No newline at end of file +var _0xff7a=['stringify','error','VoiceDialReport,\x20%s,\x20%s','message','request\x20sent','catch','CreateVoiceDialReport','VoiceDialReport','create','options','UpdateVoiceDialReport','update','body','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s'];(function(_0x5d456c,_0x792da4){var _0x1e5e3d=function(_0x50f7b3){while(--_0x50f7b3){_0x5d456c['push'](_0x5d456c['shift']());}};_0x1e5e3d(++_0x792da4);}(_0xff7a,0x6d));var _0xaff7=function(_0x42f4fb,_0x4bce38){_0x42f4fb=_0x42f4fb-0x0;var _0x19f2d5=_0xff7a[_0x42f4fb];return _0x19f2d5;};'use strict';var _=require(_0xaff7('0x0'));var util=require(_0xaff7('0x1'));var moment=require(_0xaff7('0x2'));var BPromise=require(_0xaff7('0x3'));var rs=require(_0xaff7('0x4'));var fs=require('fs');var Redis=require(_0xaff7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaff7('0x6'));var logger=require('../../config/logger')(_0xaff7('0x7'));var config=require('../../config/environment');var jayson=require(_0xaff7('0x8'));var client=jayson['client'][_0xaff7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f694a,_0x460a08,_0x1f4042){return new BPromise(function(_0x25be7b,_0x403a62){return client[_0xaff7('0xa')](_0x2f694a,_0x1f4042)[_0xaff7('0xb')](function(_0x43ea17){logger[_0xaff7('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x460a08,'request\x20sent');logger[_0xaff7('0xd')](_0xaff7('0xe'),_0x460a08,'request\x20sent',JSON[_0xaff7('0xf')](_0x43ea17));if(_0x43ea17[_0xaff7('0x10')]){if(_0x43ea17[_0xaff7('0x10')]['code']===0x1f4){logger[_0xaff7('0x10')](_0xaff7('0x11'),_0x460a08,_0x43ea17[_0xaff7('0x10')][_0xaff7('0x12')]);return _0x403a62(_0x43ea17[_0xaff7('0x10')][_0xaff7('0x12')]);}logger[_0xaff7('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x460a08,_0x43ea17[_0xaff7('0x10')][_0xaff7('0x12')]);return _0x25be7b(_0x43ea17['error'][_0xaff7('0x12')]);}else{logger[_0xaff7('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x460a08,_0xaff7('0x13'));_0x25be7b(_0x43ea17['result']['message']);}})[_0xaff7('0x14')](function(_0x56d3da){logger[_0xaff7('0x10')](_0xaff7('0x11'),_0x460a08,_0x56d3da);_0x403a62(_0x56d3da);});});}exports[_0xaff7('0x15')]=function(_0x5bc83b){var _0x598d1c=this;return new Promise(function(_0x35dd99,_0x35000c){return db[_0xaff7('0x16')][_0xaff7('0x17')](_0x5bc83b['body'],{'raw':_0x5bc83b['options']?_0x5bc83b[_0xaff7('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x352368){logger[_0xaff7('0xc')]('CreateVoiceDialReport',_0x5bc83b);logger[_0xaff7('0xd')](_0xaff7('0x15'),_0x5bc83b,JSON[_0xaff7('0xf')](_0x352368));_0x35dd99(_0x352368);})[_0xaff7('0x14')](function(_0x419ee9){logger[_0xaff7('0x10')]('CreateVoiceDialReport',_0x419ee9[_0xaff7('0x12')],_0x5bc83b);_0x35000c(_0x598d1c[_0xaff7('0x10')](0x1f4,_0x419ee9[_0xaff7('0x12')]));});});};exports[_0xaff7('0x19')]=function(_0x29d56c){var _0x4cdb36=this;return new Promise(function(_0xc0308b,_0x16f60b){return db[_0xaff7('0x16')][_0xaff7('0x1a')](_0x29d56c[_0xaff7('0x1b')],{'raw':_0x29d56c[_0xaff7('0x18')]?_0x29d56c[_0xaff7('0x18')][_0xaff7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29d56c[_0xaff7('0x18')]?_0x29d56c['options'][_0xaff7('0x1d')]||null:null,'attributes':_0x29d56c[_0xaff7('0x18')]?_0x29d56c['options'][_0xaff7('0x1e')]||null:null,'limit':_0x29d56c['options']?_0x29d56c[_0xaff7('0x18')]['limit']||null:null})[_0xaff7('0xb')](function(_0x18fd38){logger['info'](_0xaff7('0x19'),_0x29d56c);logger['debug'](_0xaff7('0x19'),_0x29d56c,JSON[_0xaff7('0xf')](_0x18fd38));_0xc0308b(_0x18fd38);})[_0xaff7('0x14')](function(_0x4f31d5){logger[_0xaff7('0x10')](_0xaff7('0x19'),_0x4f31d5['message'],_0x29d56c);_0x16f60b(_0x4cdb36['error'](0x1f4,_0x4f31d5[_0xaff7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index dd7683c..d9c1615 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 _0xb318=['update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','create','addApplications','put','/:id'];(function(_0x475481,_0x635dfb){var _0x223ef0=function(_0x26009f){while(--_0x26009f){_0x475481['push'](_0x475481['shift']());}};_0x223ef0(++_0x635dfb);}(_0xb318,0xdb));var _0x8b31=function(_0x26a710,_0x3b111b){_0x26a710=_0x26a710-0x0;var _0x47b2a5=_0xb318[_0x26a710];return _0x47b2a5;};'use strict';var multer=require('multer');var util=require(_0x8b31('0x0'));var path=require(_0x8b31('0x1'));var timeout=require(_0x8b31('0x2'));var express=require('express');var router=express[_0x8b31('0x3')]();var fs_extra=require(_0x8b31('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8b31('0x5'));var config=require(_0x8b31('0x6'));var controller=require(_0x8b31('0x7'));router[_0x8b31('0x8')]('/',auth[_0x8b31('0x9')](),controller[_0x8b31('0xa')]);router['get']('/:id',auth[_0x8b31('0x9')](),controller['show']);router['post']('/',auth[_0x8b31('0x9')](),controller[_0x8b31('0xb')]);router['post']('/:id/applications',auth[_0x8b31('0x9')](),controller[_0x8b31('0xc')]);router[_0x8b31('0xd')](_0x8b31('0xe'),auth[_0x8b31('0x9')](),controller[_0x8b31('0xf')]);router[_0x8b31('0x10')](_0x8b31('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x8b31('0x11')]=router; \ No newline at end of file +var _0x32dc=['isAuthenticated','index','/:id','show','post','create','/:id/applications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get'];(function(_0x452985,_0x1ca4af){var _0x115294=function(_0x38a74d){while(--_0x38a74d){_0x452985['push'](_0x452985['shift']());}};_0x115294(++_0x1ca4af);}(_0x32dc,0xd2));var _0xc32d=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x32dc[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xc32d('0x0'));var util=require(_0xc32d('0x1'));var path=require(_0xc32d('0x2'));var timeout=require(_0xc32d('0x3'));var express=require(_0xc32d('0x4'));var router=express['Router']();var fs_extra=require(_0xc32d('0x5'));var auth=require(_0xc32d('0x6'));var interaction=require(_0xc32d('0x7'));var config=require('../../config/environment');var controller=require(_0xc32d('0x8'));router[_0xc32d('0x9')]('/',auth[_0xc32d('0xa')](),controller[_0xc32d('0xb')]);router['get'](_0xc32d('0xc'),auth[_0xc32d('0xa')](),controller[_0xc32d('0xd')]);router[_0xc32d('0xe')]('/',auth[_0xc32d('0xa')](),controller[_0xc32d('0xf')]);router['post'](_0xc32d('0x10'),auth[_0xc32d('0xa')](),controller['addApplications']);router[_0xc32d('0x11')](_0xc32d('0xc'),auth[_0xc32d('0xa')](),controller[_0xc32d('0x12')]);router[_0xc32d('0x13')]('/:id',auth[_0xc32d('0xa')](),controller[_0xc32d('0x14')]);module[_0xc32d('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index eb84c07..154c02e 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 _0xb404=['system','any','INTEGER','BOOLEAN','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','internal','inbound-fax'];(function(_0x280c2e,_0x335764){var _0x249a00=function(_0x387feb){while(--_0x387feb){_0x280c2e['push'](_0x280c2e['shift']());}};_0x249a00(++_0x335764);}(_0xb404,0x110));var _0x4b40=function(_0x34bccf,_0xd0b449){_0x34bccf=_0x34bccf-0x0;var _0x2aab28=_0xb404[_0x34bccf];return _0x2aab28;};'use strict';var Sequelize=require(_0x4b40('0x0'));module[_0x4b40('0x1')]={'context':{'type':Sequelize[_0x4b40('0x2')],'allowNull':![],'unique':_0x4b40('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4b40('0x2')],'allowNull':![],'unique':_0x4b40('0x3')},'priority':{'type':Sequelize[_0x4b40('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x4b40('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4b40('0x2')],'allowNull':![],'defaultValue':_0x4b40('0x4')},'appdata':{'type':Sequelize[_0x4b40('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4b40('0x5')]('inbound','outbound',_0x4b40('0x6'),_0x4b40('0x7'),'outbound-fax',_0x4b40('0x8'),_0x4b40('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x4b40('0x2')]},'interval':{'type':Sequelize[_0x4b40('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x4b40('0xa')]},'isApp':{'type':Sequelize[_0x4b40('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4b40('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4b40('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x4b40('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4b40('0xa')]},'recordingFormat':{'type':Sequelize[_0x4b40('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x4b40('0xb')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x45764c){return this[_0x4b40('0xc')](_0x4b40('0xd'));}},'alias':{'type':Sequelize[_0x4b40('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xd485=['wav','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN'];(function(_0x5e4731,_0x3926ff){var _0x4724cc=function(_0x268f02){while(--_0x268f02){_0x5e4731['push'](_0x5e4731['shift']());}};_0x4724cc(++_0x3926ff);}(_0xd485,0x73));var _0x5d48=function(_0x420065,_0x567bc7){_0x420065=_0x420065-0x0;var _0x252168=_0xd485[_0x420065];return _0x252168;};'use strict';var Sequelize=require(_0x5d48('0x0'));module['exports']={'context':{'type':Sequelize[_0x5d48('0x1')],'allowNull':![],'unique':_0x5d48('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5d48('0x1')],'allowNull':![],'unique':_0x5d48('0x2')},'priority':{'type':Sequelize[_0x5d48('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x5d48('0x1')],'allowNull':![],'defaultValue':_0x5d48('0x3')},'appdata':{'type':Sequelize[_0x5d48('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x5d48('0x4'),_0x5d48('0x5'),_0x5d48('0x6'),_0x5d48('0x7'),_0x5d48('0x8'),_0x5d48('0x9'),_0x5d48('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5d48('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x5d48('0xb')]},'isApp':{'type':Sequelize[_0x5d48('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x5d48('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x5d48('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x5d48('0xb')]},'recordingFormat':{'type':Sequelize[_0x5d48('0x1')],'defaultValue':_0x5d48('0xd')},'answer':{'type':Sequelize[_0x5d48('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x18a3b1){return this[_0x5d48('0xe')](_0x5d48('0xf'));}},'alias':{'type':Sequelize[_0x5d48('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 dd9ff9e..112db00 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 _0xafaf=['finally','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','./voiceExtension.socket','register','end','json','offset','count','limit','status','set','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','type','find','UserProfileResource','sendStatus','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','update','context','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)'];(function(_0x154772,_0x475b37){var _0x141e61=function(_0x3ba34c){while(--_0x3ba34c){_0x154772['push'](_0x154772['shift']());}};_0x141e61(++_0x475b37);}(_0xafaf,0x115));var _0xfafa=function(_0x7a373c,_0x3820cf){_0x7a373c=_0x7a373c-0x0;var _0x52bb37=_0xafaf[_0x7a373c];return _0x52bb37;};'use strict';var _=require(_0xfafa('0x0'));var Redis=require('ioredis');var qs=require(_0xfafa('0x1'));var logger=require(_0xfafa('0x2'))(_0xfafa('0x3'));var config=require('../../config/environment');var db=require(_0xfafa('0x4'))['db'];config['redis']=_[_0xfafa('0x5')](config[_0xfafa('0x6')],{'host':_0xfafa('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfafa('0x8'))[_0xfafa('0x9')](socket);function respondWithStatusCode(_0x3049d2,_0x455d6c){_0x455d6c=_0x455d6c||0xcc;return function(_0x155131){if(_0x155131){return _0x3049d2['sendStatus'](_0x455d6c);}return _0x3049d2['status'](_0x455d6c)[_0xfafa('0xa')]();};}function respondWithResult(_0x218e47,_0x29e5d6){_0x29e5d6=_0x29e5d6||0xc8;return function(_0x17dfd5){if(_0x17dfd5){return _0x218e47['status'](_0x29e5d6)[_0xfafa('0xb')](_0x17dfd5);}};}function respondWithFilteredResult(_0x24e715,_0xeea9b3){return function(_0x1eae9c){if(_0x1eae9c){var _0x41d4e7=typeof _0xeea9b3[_0xfafa('0xc')]==='undefined'&&typeof _0xeea9b3['limit']==='undefined';var _0x17f516=_0x1eae9c[_0xfafa('0xd')];var _0x1fb9a2=_0x41d4e7?0x0:_0xeea9b3['offset'];var _0x29e58f=_0x41d4e7?_0x1eae9c[_0xfafa('0xd')]:_0xeea9b3[_0xfafa('0xc')]+_0xeea9b3[_0xfafa('0xe')];var _0x5abaf5;if(_0x29e58f>=_0x17f516){_0x29e58f=_0x17f516;_0x5abaf5=0xc8;}else{_0x5abaf5=0xce;}_0x24e715[_0xfafa('0xf')](_0x5abaf5);return _0x24e715[_0xfafa('0x10')]('Content-Range',_0x1fb9a2+'-'+_0x29e58f+'/'+_0x17f516)[_0xfafa('0xb')](_0x1eae9c);}return null;};}function removeEntity(_0x1a8b75){return function(_0x451a1e){if(_0x451a1e){return _0x451a1e[_0xfafa('0x11')]()[_0xfafa('0x12')](function(){var _0x364929=_0x451a1e[_0xfafa('0x13')]({'plain':!![]});var _0x35d92e=[{'name':_0xfafa('0x14'),'value':'inbound','ignore':![]},{'name':_0xfafa('0x15'),'value':_0xfafa('0x16'),'ignore':![]},{'name':_0xfafa('0x17'),'value':_0xfafa('0x18'),'ignore':![]}];var _0x329f80=_(_0x35d92e)[_0xfafa('0x19')]('ignore')[_0xfafa('0x1a')]('value')[_0xfafa('0x1b')]();if(_['includes'](_0x329f80,_0x364929[_0xfafa('0x1c')])){return;}var _0xebff49=_[_0xfafa('0x1d')](_0x35d92e,[_0xfafa('0x1b'),_0x364929[_0xfafa('0x1c')]])['name'];return db[_0xfafa('0x1e')][_0xfafa('0x11')]({'where':{'type':_0xebff49,'resourceId':_0x364929['id']}})[_0xfafa('0x12')](function(){return _0x451a1e;});})['then'](function(){_0x1a8b75[_0xfafa('0xf')](0xcc)[_0xfafa('0xa')]();});}};}function handleEntityNotFound(_0x14c3d3){return function(_0x263058){if(!_0x263058){_0x14c3d3[_0xfafa('0x1f')](0x194);}return _0x263058;};}function handleError(_0x70da81,_0x24bd8e){_0x24bd8e=_0x24bd8e||0x1f4;return function(_0x43a60c){logger['error'](_0x43a60c[_0xfafa('0x20')]);if(_0x43a60c[_0xfafa('0x21')]){delete _0x43a60c[_0xfafa('0x21')];}_0x70da81[_0xfafa('0xf')](_0x24bd8e)[_0xfafa('0x22')](_0x43a60c);};}exports[_0xfafa('0x23')]=function(_0x487acb,_0x4b9815){var _0x31576a={},_0x3892fb={},_0x46ac11={'count':0x0,'rows':[]};var _0x5bfc24=_[_0xfafa('0x1a')](db[_0xfafa('0x24')][_0xfafa('0x25')],function(_0x3295d7){return{'name':_0x3295d7[_0xfafa('0x26')],'type':_0x3295d7[_0xfafa('0x1c')][_0xfafa('0x27')]};});_0x3892fb[_0xfafa('0x28')]=_[_0xfafa('0x1a')](_0x5bfc24,_0xfafa('0x21'));_0x3892fb[_0xfafa('0x29')]=_['keys'](_0x487acb['query']);_0x3892fb[_0xfafa('0x2a')]=_[_0xfafa('0x2b')](_0x3892fb[_0xfafa('0x28')],_0x3892fb[_0xfafa('0x29')]);_0x31576a['attributes']=_[_0xfafa('0x2b')](_0x3892fb[_0xfafa('0x28')],qs[_0xfafa('0x2c')](_0x487acb[_0xfafa('0x29')][_0xfafa('0x2c')]));_0x31576a[_0xfafa('0x2d')]=_0x31576a['attributes'][_0xfafa('0x2e')]?_0x31576a[_0xfafa('0x2d')]:_0x3892fb['model'];if(!_0x487acb[_0xfafa('0x29')]['hasOwnProperty'](_0xfafa('0x2f'))){_0x31576a[_0xfafa('0xe')]=qs['limit'](_0x487acb[_0xfafa('0x29')][_0xfafa('0xe')]);_0x31576a['offset']=qs['offset'](_0x487acb['query'][_0xfafa('0xc')]);}_0x31576a[_0xfafa('0x30')]=qs['sort'](_0x487acb[_0xfafa('0x29')][_0xfafa('0x31')]);_0x31576a[_0xfafa('0x32')]=qs[_0xfafa('0x2a')](_[_0xfafa('0x33')](_0x487acb[_0xfafa('0x29')],_0x3892fb[_0xfafa('0x2a')]),_0x5bfc24);if(_0x487acb[_0xfafa('0x29')][_0xfafa('0x19')]){_0x31576a[_0xfafa('0x32')]=_['merge'](_0x31576a[_0xfafa('0x32')],{'$or':_[_0xfafa('0x1a')](_0x5bfc24,function(_0x5e19f5){if(_0x5e19f5[_0xfafa('0x1c')]!==_0xfafa('0x34')){var _0x4aa4c1={};_0x4aa4c1[_0x5e19f5[_0xfafa('0x21')]]={'$like':'%'+_0x487acb[_0xfafa('0x29')][_0xfafa('0x19')]+'%'};return _0x4aa4c1;}})});}_0x31576a=_[_0xfafa('0x35')]({},_0x31576a,_0x487acb[_0xfafa('0x36')]);var _0xe16e5b={'where':_0x31576a[_0xfafa('0x32')]};return db[_0xfafa('0x24')][_0xfafa('0xd')](_0xe16e5b)[_0xfafa('0x12')](function(_0x585091){_0x46ac11[_0xfafa('0xd')]=_0x585091;if(_0x487acb[_0xfafa('0x29')][_0xfafa('0x37')]){_0x31576a[_0xfafa('0x38')]=[{'all':!![]}];}return db[_0xfafa('0x24')][_0xfafa('0x39')](_0x31576a);})['then'](function(_0x42984f){_0x46ac11[_0xfafa('0x3a')]=_0x42984f;return _0x46ac11;})[_0xfafa('0x12')](respondWithFilteredResult(_0x4b9815,_0x31576a))['catch'](handleError(_0x4b9815,null));};exports[_0xfafa('0x3b')]=function(_0x536b8a,_0x2c7de0){var _0x1e138e={'raw':![],'where':{'id':_0x536b8a[_0xfafa('0x3c')]['id']}},_0x53db27={};_0x53db27[_0xfafa('0x28')]=_[_0xfafa('0x3d')](db['VoiceExtension']['rawAttributes']);_0x53db27['query']=_[_0xfafa('0x3d')](_0x536b8a[_0xfafa('0x29')]);_0x53db27['filters']=_[_0xfafa('0x2b')](_0x53db27['model'],_0x53db27[_0xfafa('0x29')]);_0x1e138e[_0xfafa('0x2d')]=_[_0xfafa('0x2b')](_0x53db27[_0xfafa('0x28')],qs['fields'](_0x536b8a[_0xfafa('0x29')]['fields']));_0x1e138e[_0xfafa('0x2d')]=_0x1e138e[_0xfafa('0x2d')]['length']?_0x1e138e[_0xfafa('0x2d')]:_0x53db27[_0xfafa('0x28')];if(_0x536b8a[_0xfafa('0x29')][_0xfafa('0x37')]){_0x1e138e[_0xfafa('0x38')]=[{'all':!![]}];}_0x1e138e=_[_0xfafa('0x35')]({},_0x1e138e,_0x536b8a[_0xfafa('0x36')]);return db[_0xfafa('0x24')][_0xfafa('0x1d')](_0x1e138e)['then'](handleEntityNotFound(_0x2c7de0,null))[_0xfafa('0x12')](respondWithResult(_0x2c7de0,null))[_0xfafa('0x3e')](handleError(_0x2c7de0,null));};exports[_0xfafa('0x11')]=function(_0x288cc2,_0x2fe99e){return db[_0xfafa('0x24')][_0xfafa('0x1d')]({'where':{'id':_0x288cc2[_0xfafa('0x3c')]['id']}})[_0xfafa('0x12')](handleEntityNotFound(_0x2fe99e,null))[_0xfafa('0x12')](removeEntity(_0x2fe99e,null))[_0xfafa('0x3e')](handleError(_0x2fe99e,null));};exports[_0xfafa('0x3f')]=function(_0x23cadb,_0x27138f){if(_0x23cadb[_0xfafa('0x40')][_0xfafa('0x1c')]===_0xfafa('0x16')&&!_[_0xfafa('0x41')](_0x23cadb[_0xfafa('0x40')][_0xfafa('0x42')],'_')){_0x23cadb['body']['exten']='_'[_0xfafa('0x43')](_0x23cadb[_0xfafa('0x40')][_0xfafa('0x42')]);}return db[_0xfafa('0x24')][_0xfafa('0x3f')](_0x23cadb[_0xfafa('0x40')],{'raw':![]})[_0xfafa('0x12')](function(_0x12fa57){var _0x10d35e=_0x23cadb[_0xfafa('0x44')]['get']({'plain':!![]});if(!_0x10d35e)throw new Error(_0xfafa('0x45'));if(_0x10d35e[_0xfafa('0x46')]===_0xfafa('0x44')){var _0x19f0fb=_0x12fa57[_0xfafa('0x13')]({'plain':!![]});var _0x3ee9ca=[{'name':_0xfafa('0x14'),'value':'inbound'},{'name':'OutboundRoutes','value':_0xfafa('0x16')},{'name':_0xfafa('0x17'),'value':_0xfafa('0x18')}];var _0x172f41=_[_0xfafa('0x1d')](_0x3ee9ca,[_0xfafa('0x1b'),_0x19f0fb[_0xfafa('0x1c')]])['name'];return db[_0xfafa('0x47')][_0xfafa('0x1d')]({'where':{'name':_0x172f41,'userProfileId':_0x10d35e[_0xfafa('0x48')]},'raw':!![]})['then'](function(_0x2043c8){if(_0x2043c8&&_0x2043c8[_0xfafa('0x49')]===0x0){return db[_0xfafa('0x1e')][_0xfafa('0x3f')]({'name':_0x19f0fb[_0xfafa('0x21')],'resourceId':_0x19f0fb['id'],'type':_0x2043c8[_0xfafa('0x21')],'sectionId':_0x2043c8['id']},{})['then'](function(){return _0x12fa57;});}else{return _0x12fa57;}})[_0xfafa('0x3e')](function(_0x50a601){logger[_0xfafa('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50a601);throw _0x50a601;});}return _0x12fa57;})[_0xfafa('0x12')](respondWithResult(_0x27138f,0xc9))[_0xfafa('0x3e')](handleError(_0x27138f,null));};exports[_0xfafa('0x4b')]=function(_0x54643d,_0x38480d){if(_0x54643d[_0xfafa('0x40')]['id']){delete _0x54643d[_0xfafa('0x40')]['id'];}return db['VoiceExtension'][_0xfafa('0x1d')]({'where':{'id':_0x54643d[_0xfafa('0x3c')]['id']}})[_0xfafa('0x12')](handleEntityNotFound(_0x38480d,null))[_0xfafa('0x12')](function(_0x174baf){if(_0x174baf){return db[_0xfafa('0x24')][_0xfafa('0x4b')](_[_0xfafa('0x33')](_0x54643d['body'],[_0xfafa('0x42'),_0xfafa('0x4c'),'description',_0xfafa('0x4d'),_0xfafa('0x4e'),_0xfafa('0x4f'),'alias']),{'where':{'context':_0x174baf[_0xfafa('0x4c')],'exten':_0x174baf['exten']},'individualHooks':!![]})['then'](function(_0xdad157){return _0xdad157;});}return null;})[_0xfafa('0x12')](respondWithStatusCode(_0x38480d,null))[_0xfafa('0x3e')](handleError(_0x38480d,null));};exports[_0xfafa('0x50')]=function(_0x3699d1,_0x429602){var _0x145004=_0x3699d1[_0xfafa('0x3c')]['id'];var _0x48414e=_0x3699d1[_0xfafa('0x40')];var _0x231203=0xc8;var _0x580f0c=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xfafa('0x51')][_0xfafa('0x52')][_0xfafa('0x53')][_0xfafa('0x54')]},function(_0x50f828){return db['VoiceExtension'][_0xfafa('0x55')]({'where':{'id':_0x145004},'transaction':_0x50f828})['then'](function(_0x5cf2b0){if(_0x5cf2b0){return db[_0xfafa('0x24')]['destroy']({'where':{'VoiceExtensionId':_0x145004},'transaction':_0x50f828})['then'](function(){var _0x34da5b=_[_0xfafa('0x1a')](_0x48414e,function(_0x2dcf68){_0x2dcf68[_0xfafa('0x56')]=_0x145004;_0x2dcf68[_0xfafa('0x57')]=!![];return _0x2dcf68;});return _0x5cf2b0['createRouting'](_0x34da5b);})[_0xfafa('0x12')](function(_0x53573f){return db['VoiceExtension'][_0xfafa('0x58')](_0x53573f,{'transaction':_0x50f828});});}else{_0x231203=0x194;_0x580f0c=[];}});})[_0xfafa('0x12')](function(){if(_0x231203!==0x194){return db['VoiceExtension'][_0xfafa('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x145004},'order':_0xfafa('0x5a')})[_0xfafa('0x12')](function(_0x353a3a){_0x580f0c=_0x353a3a;});}})[_0xfafa('0x3e')](function(_0x11522e){_0x231203=0x1f4;logger[_0xfafa('0x4a')](_0x11522e['stack']);if(_0x11522e[_0xfafa('0x21')]){delete _0x11522e[_0xfafa('0x21')];}_0x580f0c=_0x11522e;})[_0xfafa('0x5b')](function(){if(_0x580f0c===null){_0x429602[_0xfafa('0x1f')](_0x231203);}else{if(_0x231203===0x1f4){_0x429602[_0xfafa('0xf')](_0x231203)[_0xfafa('0x22')](_0x580f0c);}else{_0x429602[_0xfafa('0xf')](_0x231203)[_0xfafa('0xb')](_0x580f0c);}}});}; \ No newline at end of file +var _0xbe71=['outbound','startsWith','exten','concat','user','role','UserProfileSection','autoAssociation','update','pick','context','cutdigits','mandatoryDisposition','sequelize','transaction','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','error','stack','send','VoiceExtension','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','VIRTUAL','merge','options','includeAll','catch','show','params','include','create','body'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0xbe71,0x1b9));var _0x1be7=function(_0x4249d0,_0x460973){_0x4249d0=_0x4249d0-0x0;var _0x5021cd=_0xbe71[_0x4249d0];return _0x5021cd;};'use strict';var _=require('lodash');var Redis=require(_0x1be7('0x0'));var qs=require(_0x1be7('0x1'));var logger=require(_0x1be7('0x2'))(_0x1be7('0x3'));var config=require(_0x1be7('0x4'));var db=require('../../mysqldb')['db'];config[_0x1be7('0x5')]=_[_0x1be7('0x6')](config[_0x1be7('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x1be7('0x7'))(new Redis(config[_0x1be7('0x5')]));require(_0x1be7('0x8'))[_0x1be7('0x9')](socket);function respondWithStatusCode(_0x50ede5,_0x40d5b1){_0x40d5b1=_0x40d5b1||0xcc;return function(_0x9702f1){if(_0x9702f1){return _0x50ede5[_0x1be7('0xa')](_0x40d5b1);}return _0x50ede5['status'](_0x40d5b1)[_0x1be7('0xb')]();};}function respondWithResult(_0x5187c3,_0x1585a1){_0x1585a1=_0x1585a1||0xc8;return function(_0x305440){if(_0x305440){return _0x5187c3[_0x1be7('0xc')](_0x1585a1)[_0x1be7('0xd')](_0x305440);}};}function respondWithFilteredResult(_0x287472,_0x7885fb){return function(_0xca6bc2){if(_0xca6bc2){var _0x294606=typeof _0x7885fb[_0x1be7('0xe')]===_0x1be7('0xf')&&typeof _0x7885fb[_0x1be7('0x10')]==='undefined';var _0x4cc8fe=_0xca6bc2[_0x1be7('0x11')];var _0x385338=_0x294606?0x0:_0x7885fb['offset'];var _0x53ed19=_0x294606?_0xca6bc2['count']:_0x7885fb[_0x1be7('0xe')]+_0x7885fb['limit'];var _0x5e2ef7;if(_0x53ed19>=_0x4cc8fe){_0x53ed19=_0x4cc8fe;_0x5e2ef7=0xc8;}else{_0x5e2ef7=0xce;}_0x287472[_0x1be7('0xc')](_0x5e2ef7);return _0x287472['set'](_0x1be7('0x12'),_0x385338+'-'+_0x53ed19+'/'+_0x4cc8fe)[_0x1be7('0xd')](_0xca6bc2);}return null;};}function removeEntity(_0x5147fd){return function(_0x29b339){if(_0x29b339){return _0x29b339[_0x1be7('0x13')]()[_0x1be7('0x14')](function(){var _0x28367e=_0x29b339[_0x1be7('0x15')]({'plain':!![]});var _0x2bd30e=[{'name':_0x1be7('0x16'),'value':_0x1be7('0x17'),'ignore':![]},{'name':_0x1be7('0x18'),'value':'outbound','ignore':![]},{'name':_0x1be7('0x19'),'value':_0x1be7('0x1a'),'ignore':![]}];var _0x4847fa=_(_0x2bd30e)[_0x1be7('0x1b')]('ignore')[_0x1be7('0x1c')](_0x1be7('0x1d'))[_0x1be7('0x1d')]();if(_[_0x1be7('0x1e')](_0x4847fa,_0x28367e[_0x1be7('0x1f')])){return;}var _0x59bb6d=_[_0x1be7('0x20')](_0x2bd30e,[_0x1be7('0x1d'),_0x28367e['type']])[_0x1be7('0x21')];return db[_0x1be7('0x22')][_0x1be7('0x13')]({'where':{'type':_0x59bb6d,'resourceId':_0x28367e['id']}})['then'](function(){return _0x29b339;});})[_0x1be7('0x14')](function(){_0x5147fd[_0x1be7('0xc')](0xcc)[_0x1be7('0xb')]();});}};}function handleEntityNotFound(_0x744c95){return function(_0x17bc04){if(!_0x17bc04){_0x744c95[_0x1be7('0xa')](0x194);}return _0x17bc04;};}function handleError(_0x41f3ee,_0x7ea76a){_0x7ea76a=_0x7ea76a||0x1f4;return function(_0x201343){logger[_0x1be7('0x23')](_0x201343[_0x1be7('0x24')]);if(_0x201343[_0x1be7('0x21')]){delete _0x201343['name'];}_0x41f3ee['status'](_0x7ea76a)[_0x1be7('0x25')](_0x201343);};}exports['index']=function(_0x4581bc,_0x2a9321){var _0x31a046={},_0x2ab62c={},_0x214c9a={'count':0x0,'rows':[]};var _0x93fb65=_[_0x1be7('0x1c')](db[_0x1be7('0x26')][_0x1be7('0x27')],function(_0x3857ec){return{'name':_0x3857ec['fieldName'],'type':_0x3857ec[_0x1be7('0x1f')][_0x1be7('0x28')]};});_0x2ab62c[_0x1be7('0x29')]=_[_0x1be7('0x1c')](_0x93fb65,'name');_0x2ab62c[_0x1be7('0x2a')]=_[_0x1be7('0x2b')](_0x4581bc['query']);_0x2ab62c['filters']=_['intersection'](_0x2ab62c[_0x1be7('0x29')],_0x2ab62c['query']);_0x31a046[_0x1be7('0x2c')]=_[_0x1be7('0x2d')](_0x2ab62c[_0x1be7('0x29')],qs['fields'](_0x4581bc['query'][_0x1be7('0x2e')]));_0x31a046['attributes']=_0x31a046[_0x1be7('0x2c')][_0x1be7('0x2f')]?_0x31a046[_0x1be7('0x2c')]:_0x2ab62c[_0x1be7('0x29')];if(!_0x4581bc['query']['hasOwnProperty'](_0x1be7('0x30'))){_0x31a046[_0x1be7('0x10')]=qs[_0x1be7('0x10')](_0x4581bc['query']['limit']);_0x31a046[_0x1be7('0xe')]=qs['offset'](_0x4581bc[_0x1be7('0x2a')][_0x1be7('0xe')]);}_0x31a046[_0x1be7('0x31')]=qs[_0x1be7('0x32')](_0x4581bc['query'][_0x1be7('0x32')]);_0x31a046[_0x1be7('0x33')]=qs[_0x1be7('0x34')](_['pick'](_0x4581bc[_0x1be7('0x2a')],_0x2ab62c[_0x1be7('0x34')]),_0x93fb65);if(_0x4581bc[_0x1be7('0x2a')][_0x1be7('0x1b')]){_0x31a046['where']=_['merge'](_0x31a046[_0x1be7('0x33')],{'$or':_[_0x1be7('0x1c')](_0x93fb65,function(_0x2ba340){if(_0x2ba340['type']!==_0x1be7('0x35')){var _0x2f26ba={};_0x2f26ba[_0x2ba340['name']]={'$like':'%'+_0x4581bc['query'][_0x1be7('0x1b')]+'%'};return _0x2f26ba;}})});}_0x31a046=_[_0x1be7('0x36')]({},_0x31a046,_0x4581bc[_0x1be7('0x37')]);var _0x547dc1={'where':_0x31a046[_0x1be7('0x33')]};return db[_0x1be7('0x26')][_0x1be7('0x11')](_0x547dc1)['then'](function(_0x2412c9){_0x214c9a['count']=_0x2412c9;if(_0x4581bc[_0x1be7('0x2a')][_0x1be7('0x38')]){_0x31a046['include']=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x31a046);})['then'](function(_0x3a5136){_0x214c9a['rows']=_0x3a5136;return _0x214c9a;})[_0x1be7('0x14')](respondWithFilteredResult(_0x2a9321,_0x31a046))[_0x1be7('0x39')](handleError(_0x2a9321,null));};exports[_0x1be7('0x3a')]=function(_0x2cc54a,_0xdffffd){var _0x5220d7={'raw':![],'where':{'id':_0x2cc54a[_0x1be7('0x3b')]['id']}},_0x175ab7={};_0x175ab7[_0x1be7('0x29')]=_[_0x1be7('0x2b')](db[_0x1be7('0x26')]['rawAttributes']);_0x175ab7[_0x1be7('0x2a')]=_[_0x1be7('0x2b')](_0x2cc54a[_0x1be7('0x2a')]);_0x175ab7[_0x1be7('0x34')]=_[_0x1be7('0x2d')](_0x175ab7[_0x1be7('0x29')],_0x175ab7[_0x1be7('0x2a')]);_0x5220d7[_0x1be7('0x2c')]=_[_0x1be7('0x2d')](_0x175ab7[_0x1be7('0x29')],qs[_0x1be7('0x2e')](_0x2cc54a['query']['fields']));_0x5220d7[_0x1be7('0x2c')]=_0x5220d7[_0x1be7('0x2c')]['length']?_0x5220d7[_0x1be7('0x2c')]:_0x175ab7[_0x1be7('0x29')];if(_0x2cc54a[_0x1be7('0x2a')][_0x1be7('0x38')]){_0x5220d7[_0x1be7('0x3c')]=[{'all':!![]}];}_0x5220d7=_['merge']({},_0x5220d7,_0x2cc54a[_0x1be7('0x37')]);return db[_0x1be7('0x26')][_0x1be7('0x20')](_0x5220d7)[_0x1be7('0x14')](handleEntityNotFound(_0xdffffd,null))['then'](respondWithResult(_0xdffffd,null))['catch'](handleError(_0xdffffd,null));};exports[_0x1be7('0x13')]=function(_0x4ba4ac,_0x2036e8){return db[_0x1be7('0x26')][_0x1be7('0x20')]({'where':{'id':_0x4ba4ac[_0x1be7('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2036e8,null))[_0x1be7('0x14')](removeEntity(_0x2036e8,null))[_0x1be7('0x39')](handleError(_0x2036e8,null));};exports[_0x1be7('0x3d')]=function(_0x1c0717,_0x4f4794){if(_0x1c0717[_0x1be7('0x3e')][_0x1be7('0x1f')]===_0x1be7('0x3f')&&!_[_0x1be7('0x40')](_0x1c0717['body'][_0x1be7('0x41')],'_')){_0x1c0717[_0x1be7('0x3e')][_0x1be7('0x41')]='_'[_0x1be7('0x42')](_0x1c0717['body'][_0x1be7('0x41')]);}return db['VoiceExtension']['create'](_0x1c0717[_0x1be7('0x3e')],{'raw':![]})[_0x1be7('0x14')](function(_0x2122ce){var _0x1048a3=_0x1c0717[_0x1be7('0x43')]['get']({'plain':!![]});if(!_0x1048a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1048a3[_0x1be7('0x44')]===_0x1be7('0x43')){var _0x52c90d=_0x2122ce[_0x1be7('0x15')]({'plain':!![]});var _0x3ccfd7=[{'name':_0x1be7('0x16'),'value':_0x1be7('0x17')},{'name':'OutboundRoutes','value':_0x1be7('0x3f')},{'name':_0x1be7('0x19'),'value':_0x1be7('0x1a')}];var _0x189f47=_[_0x1be7('0x20')](_0x3ccfd7,[_0x1be7('0x1d'),_0x52c90d[_0x1be7('0x1f')]])[_0x1be7('0x21')];return db[_0x1be7('0x45')]['find']({'where':{'name':_0x189f47,'userProfileId':_0x1048a3['userProfileId']},'raw':!![]})[_0x1be7('0x14')](function(_0x575e10){if(_0x575e10&&_0x575e10[_0x1be7('0x46')]===0x0){return db['UserProfileResource'][_0x1be7('0x3d')]({'name':_0x52c90d[_0x1be7('0x21')],'resourceId':_0x52c90d['id'],'type':_0x575e10[_0x1be7('0x21')],'sectionId':_0x575e10['id']},{})['then'](function(){return _0x2122ce;});}else{return _0x2122ce;}})[_0x1be7('0x39')](function(_0x7b3168){logger[_0x1be7('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7b3168);throw _0x7b3168;});}return _0x2122ce;})[_0x1be7('0x14')](respondWithResult(_0x4f4794,0xc9))['catch'](handleError(_0x4f4794,null));};exports[_0x1be7('0x47')]=function(_0x271144,_0x3e8250){if(_0x271144[_0x1be7('0x3e')]['id']){delete _0x271144['body']['id'];}return db[_0x1be7('0x26')][_0x1be7('0x20')]({'where':{'id':_0x271144[_0x1be7('0x3b')]['id']}})[_0x1be7('0x14')](handleEntityNotFound(_0x3e8250,null))[_0x1be7('0x14')](function(_0x251a18){if(_0x251a18){return db[_0x1be7('0x26')][_0x1be7('0x47')](_[_0x1be7('0x48')](_0x271144[_0x1be7('0x3e')],['exten',_0x1be7('0x49'),'description','recordingFormat',_0x1be7('0x4a'),_0x1be7('0x4b'),'alias']),{'where':{'context':_0x251a18[_0x1be7('0x49')],'exten':_0x251a18['exten']},'individualHooks':!![]})[_0x1be7('0x14')](function(_0x35dacf){return _0x35dacf;});}return null;})[_0x1be7('0x14')](respondWithStatusCode(_0x3e8250,null))[_0x1be7('0x39')](handleError(_0x3e8250,null));};exports['addApplications']=function(_0x2a610b,_0x5608a5){var _0x1e17b8=_0x2a610b[_0x1be7('0x3b')]['id'];var _0x18ad22=_0x2a610b[_0x1be7('0x3e')];var _0x426838=0xc8;var _0x531c5a=null;return db[_0x1be7('0x4c')][_0x1be7('0x4d')]({'isolationLevel':db[_0x1be7('0x4c')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x2e380b){return db[_0x1be7('0x26')]['findOne']({'where':{'id':_0x1e17b8},'transaction':_0x2e380b})[_0x1be7('0x14')](function(_0x5aba37){if(_0x5aba37){return db['VoiceExtension'][_0x1be7('0x13')]({'where':{'VoiceExtensionId':_0x1e17b8},'transaction':_0x2e380b})['then'](function(){var _0xcee793=_['map'](_0x18ad22,function(_0x15d2d7){_0x15d2d7[_0x1be7('0x4e')]=_0x1e17b8;_0x15d2d7[_0x1be7('0x4f')]=!![];return _0x15d2d7;});return _0x5aba37[_0x1be7('0x50')](_0xcee793);})[_0x1be7('0x14')](function(_0x409a24){return db[_0x1be7('0x26')]['bulkCreate'](_0x409a24,{'transaction':_0x2e380b});});}else{_0x426838=0x194;_0x531c5a=[];}});})[_0x1be7('0x14')](function(){if(_0x426838!==0x194){return db[_0x1be7('0x26')][_0x1be7('0x51')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1e17b8},'order':_0x1be7('0x52')})['then'](function(_0x56ee69){_0x531c5a=_0x56ee69;});}})['catch'](function(_0xcba6e0){_0x426838=0x1f4;logger[_0x1be7('0x23')](_0xcba6e0[_0x1be7('0x24')]);if(_0xcba6e0[_0x1be7('0x21')]){delete _0xcba6e0[_0x1be7('0x21')];}_0x531c5a=_0xcba6e0;})[_0x1be7('0x53')](function(){if(_0x531c5a===null){_0x5608a5[_0x1be7('0xa')](_0x426838);}else{if(_0x426838===0x1f4){_0x5608a5['status'](_0x426838)['send'](_0x531c5a);}else{_0x5608a5[_0x1be7('0xc')](_0x426838)[_0x1be7('0xd')](_0x531c5a);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 028af03..7114bad 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 _0x5e71=['hook','events','../../mysqldb','VoiceExtension','setMaxListeners','emit'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x5e71,0xbb));var _0x15e7=function(_0x26ee55,_0x4a14ae){_0x26ee55=_0x26ee55-0x0;var _0x4710fe=_0x5e71[_0x26ee55];return _0x4710fe;};'use strict';var EventEmitter=require(_0x15e7('0x0'));var VoiceExtension=require(_0x15e7('0x1'))['db'][_0x15e7('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x15e7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1cd935){return function(_0x103265,_0x53aa76,_0x48c19c){VoiceExtensionEvents[_0x15e7('0x4')](_0x1cd935+':'+_0x103265['id'],_0x103265);VoiceExtensionEvents[_0x15e7('0x4')](_0x1cd935,_0x103265);_0x48c19c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x15e7('0x5')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x2252=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x2252,0x6e));var _0x2225=function(_0x1fba08,_0x1cca5d){_0x1fba08=_0x1fba08-0x0;var _0x550de3=_0x2252[_0x1fba08];return _0x550de3;};'use strict';var EventEmitter=require(_0x2225('0x0'));var VoiceExtension=require(_0x2225('0x1'))['db'][_0x2225('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2225('0x3')](0x0);var events={'afterCreate':_0x2225('0x4'),'afterUpdate':_0x2225('0x5'),'afterDestroy':_0x2225('0x6')};function emitEvent(_0x2f8bf3){return function(_0x5c4dc4,_0x106c6a,_0x3f3642){VoiceExtensionEvents[_0x2225('0x7')](_0x2f8bf3+':'+_0x5c4dc4['id'],_0x5c4dc4);VoiceExtensionEvents['emit'](_0x2f8bf3,_0x5c4dc4);_0x3f3642(null);};}for(var e in events){if(events[_0x2225('0x8')](e)){var event=events[e];VoiceExtension[_0x2225('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 8a5e986..41ce60a 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 _0x323b=['hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','trunk','options','split','length','name','phone','param','prefix','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','then','intervals','filter','IntervalId','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','get','Hangup','lodash','exports','type','Set','CDR(type)=','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','context','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid='];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x323b,0x1ad));var _0xb323=function(_0x2c8f25,_0x2a1494){_0x2c8f25=_0x2c8f25-0x0;var _0x4d5da4=_0x323b[_0x2c8f25];return _0x4d5da4;};'use strict';var _=require(_0xb323('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xb323('0x1')]=function(_0x3fbfb2){var _0x2e5af9=_0x3fbfb2['models'];function _0x3d7150(_0x4532c7){var _0x3bcab5=0x2;var _0x2132bd=[{'type':_0x4532c7[_0xb323('0x2')],'app':_0xb323('0x3'),'appdata':_0xb323('0x4')+_0x4532c7[_0xb323('0x2')],'context':_0x4532c7['context'],'exten':_0x4532c7['exten'],'priority':_0x3bcab5++,'VoiceExtensionId':_0x4532c7['id']},{'type':_0x4532c7[_0xb323('0x2')],'app':_0x4532c7[_0xb323('0x5')]?_0xb323('0x3'):_0xb323('0x6'),'appdata':_0x4532c7['alias']?_0xb323('0x7')+_0x4532c7[_0xb323('0x5')]:_0xb323('0x8'),'context':_0x4532c7['context'],'exten':_0x4532c7[_0xb323('0x9')],'priority':_0x3bcab5++,'VoiceExtensionId':_0x4532c7['id']}];if(_0x4532c7[_0xb323('0x2')]===_0xb323('0xa')){_0x2132bd[_0xb323('0xb')]({'type':_0xb323('0xa'),'app':'Set','appdata':_0xb323('0xc')+_0x4532c7['id'],'context':_0x4532c7[_0xb323('0xd')],'exten':_0x4532c7[_0xb323('0x9')],'priority':_0x3bcab5++,'VoiceExtensionId':_0x4532c7['id']});}_0x2132bd[_0xb323('0xb')]({'type':_0x4532c7['type'],'app':_0xb323('0x3'),'appdata':_0xb323('0xe'),'context':_0x4532c7[_0xb323('0xd')],'exten':_0x4532c7[_0xb323('0x9')],'priority':_0x3bcab5++,'VoiceExtensionId':_0x4532c7['id']},{'type':_0x4532c7[_0xb323('0x2')],'app':_0xb323('0x3'),'appdata':_0xb323('0xf'),'context':_0x4532c7[_0xb323('0xd')],'exten':_0x4532c7[_0xb323('0x9')],'priority':_0x3bcab5++,'VoiceExtensionId':_0x4532c7['id']},{'type':_0x4532c7['type'],'app':_0xb323('0x3'),'appdata':_0xb323('0x10'),'context':_0x4532c7[_0xb323('0xd')],'exten':_0x4532c7[_0xb323('0x9')],'priority':_0x3bcab5++,'VoiceExtensionId':_0x4532c7['id']});return _0x2132bd;}function _0x4a813b(_0xc8209){var _0x3bc40f=0x2;var _0x5a6810=[{'type':_0xb323('0x11'),'app':_0xb323('0x3'),'appdata':_0xb323('0x12'),'context':_0xc8209[_0xb323('0xd')],'exten':_0xc8209[_0xb323('0x9')],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']},{'type':'outbound','app':_0xc8209[_0xb323('0x5')]?_0xb323('0x3'):_0xb323('0x6'),'appdata':_0xc8209['alias']?_0xb323('0x7')+_0xc8209['alias']:_0xb323('0x8'),'context':_0xc8209[_0xb323('0xd')],'exten':_0xc8209[_0xb323('0x9')],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']},{'type':_0xb323('0x11'),'app':_0xb323('0x3'),'appdata':'CDR(destination)='+(_0xc8209['cutdigits']?_0xb323('0x13')+_0xc8209[_0xb323('0x14')]+'}':_0xb323('0x15')),'context':_0xc8209['context'],'exten':_0xc8209[_0xb323('0x9')],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']},{'type':_0xb323('0x11'),'app':_0xb323('0x3'),'appdata':_0xb323('0xc')+_0xc8209['id'],'context':_0xc8209[_0xb323('0xd')],'exten':_0xc8209['exten'],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']},{'type':_0xb323('0x11'),'app':'ExecIf','appdata':_0xb323('0x16')+(_0x3bc40f+0x2)+_0xb323('0x17')+(_0x3bc40f+0x1)+')','context':_0xc8209['context'],'exten':_0xc8209['exten'],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']},{'type':'outbound','app':_0xb323('0x3'),'appdata':_0xc8209[_0xb323('0x14')]?_0xb323('0x18')+_0xc8209[_0xb323('0x14')]+'}':_0xb323('0x19'),'context':_0xc8209[_0xb323('0xd')],'exten':_0xc8209[_0xb323('0x9')],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']},{'type':_0xb323('0x11'),'app':_0xb323('0x3'),'appdata':_0xb323('0xe'),'context':_0xc8209[_0xb323('0xd')],'exten':_0xc8209[_0xb323('0x9')],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']},{'type':'outbound','app':'Set','appdata':_0xb323('0xf'),'context':_0xc8209['context'],'exten':_0xc8209[_0xb323('0x9')],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']},{'type':_0xb323('0x11'),'app':'Set','appdata':_0xb323('0x10'),'context':_0xc8209[_0xb323('0xd')],'exten':_0xc8209['exten'],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']},{'type':_0xb323('0x11'),'app':'Set','appdata':_0xb323('0x1a')+_0xc8209['id'],'context':_0xc8209[_0xb323('0xd')],'exten':_0xc8209[_0xb323('0x9')],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']}];if(_0xc8209[_0xb323('0x1b')](_0xb323('0x1c'))&&_0xc8209[_0xb323('0x1c')]!==_0xb323('0x1d')){_0x5a6810[_0xb323('0xb')]({'type':_0xb323('0x11'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xc8209[_0xb323('0xd')],'exten':_0xc8209[_0xb323('0x9')],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']},{'type':_0xb323('0x11'),'app':_0xb323('0x3'),'appdata':_0xb323('0x1e')+_0xc8209[_0xb323('0x1c')]||'wav','context':_0xc8209['context'],'exten':_0xc8209[_0xb323('0x9')],'priority':_0x3bc40f++,'VoiceExtensionId':_0xc8209['id']});}return _0x5a6810;}function _0x3dcdc6(_0x429322,_0x4668c9){var _0x31e9ac=[{'name':_0xb323('0x1f'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xb323('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x434727={};var _0x46e747=_0x4668c9[_0xb323('0x21')](',');var _0x1b8616=[];for(var _0x24eab9=0x0;_0x24eab9<_0x31e9ac[_0xb323('0x22')];_0x24eab9++){switch(_0x31e9ac[_0x24eab9][_0xb323('0x23')]){case _0xb323('0x1f'):_0x434727[_0xb323('0x1f')]=_0x46e747[_0x31e9ac[_0x24eab9]['param']][_0xb323('0x21')]('/')[0x1];_0x434727[_0xb323('0x24')]=_0x46e747[_0x31e9ac[_0x24eab9][_0xb323('0x25')]][_0xb323('0x21')]('/')[0x2];_0x434727['prefix']=_0x434727[_0xb323('0x24')]?_0x434727['phone'][_0xb323('0x21')]('$')[0x0]:undefined;_0x434727['phone']=_0x429322['cutdigits']?(_0x434727[_0xb323('0x26')]||'')+'${EXTEN:'+_0x429322[_0xb323('0x14')]+'}':(_0x434727[_0xb323('0x26')]||'')+_0xb323('0x15');_0x1b8616[_0x31e9ac[_0x24eab9][_0xb323('0x25')]]=[_0xb323('0x27'),_0x434727[_0xb323('0x1f')],_0x434727[_0xb323('0x24')]][_0xb323('0x28')]('/');break;case _0xb323('0x20'):_0x434727[_0xb323('0x20')]=_0x46e747[_0x31e9ac[_0x24eab9][_0xb323('0x25')]];if(_0x429322[_0xb323('0x1c')]!=='none'){if(_0x434727[_0xb323('0x20')]['indexOf'](_0xb323('0x29'))<0x0){_0x434727['options']+='U(xcally-mixmonitor-context)';}}else{_0x434727['options']=_0x434727[_0xb323('0x20')][_0xb323('0x2a')]('U(xcally-mixmonitor-context)','');}_0x1b8616[_0x31e9ac[_0x24eab9][_0xb323('0x25')]]=_0x434727[_0xb323('0x20')];break;default:_0x1b8616[_0x31e9ac[_0x24eab9][_0xb323('0x25')]]=_0x46e747[_0x31e9ac[_0x24eab9][_0xb323('0x25')]];}}return _0x1b8616['join'](',');}function _0xbdcd4c(_0x241e61,_0x4024ff,_0x459080){return new Promise(function(_0x576f8a,_0x1ff505){var _0x13007c=[];if(_[_0xb323('0x2b')](_0x4024ff))return _0x576f8a(_0x13007c);_0x2e5af9[_0xb323('0x2c')]['findAll']({'attributes':['id',_0xb323('0x2d'),'IntervalId'],'raw':!![]})[_0xb323('0x2e')](function(_0x1db180){for(var _0x497449=0x0,_0x43c3d0=0x0;_0x497449<_0x4024ff[_0xb323('0x22')];_0x497449++,_0x43c3d0=0x0){var _0x345f28=_0x4024ff[_0x497449];var _0x484509=[];var _0x3e05c5=[];delete _0x345f28['id'];if(_0x345f28[_0xb323('0x2d')]!=='*,*,*,*'){_0x345f28['intervals']=[_0x345f28[_0xb323('0x2d')]];}else{_0x345f28[_0xb323('0x2f')]=_0x345f28['IntervalId']?_['map'](_[_0xb323('0x30')](_0x1db180,{'IntervalId':_0x345f28[_0xb323('0x31')]}),_0xb323('0x2d')):[];}_0x345f28[_0xb323('0xd')]=_0x241e61[_0xb323('0xd')];_0x345f28[_0xb323('0x9')]=_0x241e61[_0xb323('0x9')];if(_0x345f28[_0xb323('0x2')])_0x345f28['type']=_0x345f28[_0xb323('0x2')][_0xb323('0x32')]();if(_0x241e61['type']===_0xb323('0x11')){if(_0x345f28[_0xb323('0x1b')](_0xb323('0x33'))&&_0x345f28['tag']&&_0x345f28['tag']!=='--'){_0x484509[_0xb323('0xb')]({'type':_0x345f28[_0xb323('0x2')][_0xb323('0x32')](),'app':_0xb323('0x3'),'appdata':_0xb323('0x34')+_0x345f28[_0xb323('0x33')],'context':_0x241e61[_0xb323('0xd')],'exten':_0x241e61[_0xb323('0x9')],'priority':_0x345f28[_0xb323('0x2f')][_0xb323('0x22')]+_0x459080+_0x43c3d0++,'VoiceExtensionId':_0x241e61['id']});}_0x484509[_0xb323('0xb')]({'type':_0x345f28[_0xb323('0x2')][_0xb323('0x32')](),'app':_0xb323('0x35'),'appdata':_0xb323('0x36')+(_0x345f28[_0xb323('0x37')]?_0xb323('0x38')+_0x345f28['callerID']+')':_0xb323('0x39')),'context':_0x241e61[_0xb323('0xd')],'exten':_0x241e61[_0xb323('0x9')],'priority':_0x345f28[_0xb323('0x2f')][_0xb323('0x22')]+_0x459080+_0x43c3d0++,'VoiceExtensionId':_0x241e61['id']});}else{if(_0x345f28['hasOwnProperty'](_0xb323('0x3a'))){if([_0xb323('0x3b'),_0xb323('0x3c')][_0xb323('0x3d')](_0x345f28['app'][_0xb323('0x32')]())&&_0x345f28[_0xb323('0x3e')]!=='custom'){if(_0x345f28['answer']){_0x484509[_0xb323('0xb')]({'type':_0x345f28[_0xb323('0x2')][_0xb323('0x32')](),'app':_0xb323('0x35'),'appdata':_0xb323('0x3f'),'context':_0x241e61[_0xb323('0xd')],'exten':_0x241e61[_0xb323('0x9')],'priority':_0x345f28[_0xb323('0x2f')][_0xb323('0x22')]+_0x459080+_0x43c3d0++,'VoiceExtensionId':_0x241e61['id']});_0x484509[_0xb323('0xb')]({'type':_0x345f28['type'][_0xb323('0x32')](),'app':_0xb323('0x3'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x241e61[_0xb323('0xd')],'exten':_0x241e61[_0xb323('0x9')],'priority':_0x345f28[_0xb323('0x2f')]['length']+_0x459080+_0x43c3d0++,'VoiceExtensionId':_0x241e61['id']});}else{_0x484509['push']({'type':_0x345f28[_0xb323('0x2')]['toLowerCase'](),'app':_0xb323('0x35'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x241e61[_0xb323('0xd')],'exten':_0x241e61[_0xb323('0x9')],'priority':_0x345f28[_0xb323('0x2f')][_0xb323('0x22')]+_0x459080+_0x43c3d0++,'VoiceExtensionId':_0x241e61['id']});_0x484509['push']({'type':_0x345f28['type'][_0xb323('0x32')](),'app':_0xb323('0x3'),'appdata':_0xb323('0x40'),'context':_0x241e61[_0xb323('0xd')],'exten':_0x241e61[_0xb323('0x9')],'priority':_0x345f28[_0xb323('0x2f')][_0xb323('0x22')]+_0x459080+_0x43c3d0++,'VoiceExtensionId':_0x241e61['id']});}}}}for(var _0x4abe86=0x0;_0x4abe86<_0x345f28[_0xb323('0x2f')][_0xb323('0x22')];_0x4abe86++){var _0x443d59=_0x459080+_0x345f28['intervals']['length'];var _0x558a19=_0x4abe86===_0x345f28[_0xb323('0x2f')]['length']-0x1?_0x459080+_0x484509[_0xb323('0x22')]+_0x3e05c5['length']+0x2:_0x459080+_0x4abe86+0x1;_0x484509['splice'](_0x4abe86,0x0,{'type':_0x241e61[_0xb323('0x2')],'app':_0xb323('0x41'),'appdata':_0x345f28['intervals'][_0x4abe86]+'?'+_0x241e61[_0xb323('0xd')]+_0xb323('0x42')+_0x443d59+':'+_0x241e61['context']+_0xb323('0x42')+_0x558a19,'exten':_0x241e61[_0xb323('0x9')],'context':_0x241e61['context'],'priority':_0x459080+_0x4abe86,'VoiceExtensionId':_0x241e61['id']});}if(_0x345f28['appType']===_0xb323('0x43'))_0x345f28[_0xb323('0x44')]=_0x3dcdc6(_0x241e61,_0x345f28[_0xb323('0x44')]);_0x345f28[_0xb323('0x45')]=_0x484509[_0xb323('0x22')]?_[_0xb323('0x46')](_0x484509)['priority']+0x1:_0x459080;_0x13007c=_[_0xb323('0x47')](_0x13007c,_0x484509,[_0x345f28],_0x3e05c5);_0x459080=_[_0xb323('0x46')](_0x13007c)['priority']+0x1;}return _0x576f8a(_0x13007c);})[_0xb323('0x48')](function(_0xf3675e){_0x1ff505(_0xf3675e);});});}return _0x3fbfb2[_0xb323('0x49')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x14c443){var _0x3a49ad=this[_0xb323('0x4a')]({'plain':!![]});var _0x283950=_0x3a49ad[_0xb323('0x2')]===_0xb323('0x11')?_0x4a813b(_0x3a49ad):_0x3d7150(_0x3a49ad);return _0xbdcd4c(_0x3a49ad,_0x14c443,_[_0xb323('0x46')](_0x283950)[_0xb323('0x45')]+0x1)[_0xb323('0x2e')](function(_0x55a637){var _0x3dcf97=_[_0xb323('0x47')](_0x283950,_0x55a637);_0x3dcf97[_0xb323('0xb')]({'type':_0x3a49ad[_0xb323('0x2')],'app':_0xb323('0x4b'),'exten':_0x3a49ad[_0xb323('0x9')],'context':_0x3a49ad[_0xb323('0xd')],'priority':_[_0xb323('0x46')](_0x3dcf97)[_0xb323('0x45')]+0x1,'VoiceExtensionId':_0x3a49ad['id']});return _0x3dcf97;});}}});}; \ No newline at end of file +var _0xe314=['wav','trunk','timeout','split','length','name','phone','param','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','*,*,*,*','intervals','interval','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','get','./voiceExtension.attributes','exports','models','type','context','exten','alias','Set','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x48921e,_0x37c6f1){var _0xebc1ef=function(_0x2fdad7){while(--_0x2fdad7){_0x48921e['push'](_0x48921e['shift']());}};_0xebc1ef(++_0x37c6f1);}(_0xe314,0x7c));var _0x4e31=function(_0xba2d2e,_0x145e38){_0xba2d2e=_0xba2d2e-0x0;var _0x4d52f0=_0xe314[_0xba2d2e];return _0x4d52f0;};'use strict';var _=require('lodash');var attributes=require(_0x4e31('0x0'));module[_0x4e31('0x1')]=function(_0x2ee0be){var _0xc8a121=_0x2ee0be[_0x4e31('0x2')];function _0x21e52f(_0x37c1b1){var _0x13b7fa=0x2;var _0x63cecc=[{'type':_0x37c1b1[_0x4e31('0x3')],'app':'Set','appdata':'CDR(type)='+_0x37c1b1[_0x4e31('0x3')],'context':_0x37c1b1[_0x4e31('0x4')],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']},{'type':_0x37c1b1[_0x4e31('0x3')],'app':_0x37c1b1[_0x4e31('0x6')]?_0x4e31('0x7'):'NoOp','appdata':_0x37c1b1[_0x4e31('0x6')]?_0x4e31('0x8')+_0x37c1b1[_0x4e31('0x6')]:_0x4e31('0x9'),'context':_0x37c1b1['context'],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']}];if(_0x37c1b1[_0x4e31('0x3')]===_0x4e31('0xa')){_0x63cecc[_0x4e31('0xb')]({'type':_0x4e31('0xa'),'app':_0x4e31('0x7'),'appdata':_0x4e31('0xc')+_0x37c1b1['id'],'context':_0x37c1b1[_0x4e31('0x4')],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']});}_0x63cecc[_0x4e31('0xb')]({'type':_0x37c1b1[_0x4e31('0x3')],'app':_0x4e31('0x7'),'appdata':_0x4e31('0xd'),'context':_0x37c1b1[_0x4e31('0x4')],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']},{'type':_0x37c1b1[_0x4e31('0x3')],'app':_0x4e31('0x7'),'appdata':_0x4e31('0xe'),'context':_0x37c1b1['context'],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']},{'type':_0x37c1b1[_0x4e31('0x3')],'app':'Set','appdata':_0x4e31('0xf'),'context':_0x37c1b1[_0x4e31('0x4')],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']});return _0x63cecc;}function _0x56cfc7(_0x3f9244){var _0x14a367=0x2;var _0x37e9e1=[{'type':'outbound','app':_0x4e31('0x7'),'appdata':_0x4e31('0x10'),'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244['exten'],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x3f9244[_0x4e31('0x6')]?'Set':'NoOp','appdata':_0x3f9244[_0x4e31('0x6')]?_0x4e31('0x8')+_0x3f9244[_0x4e31('0x6')]:_0x4e31('0x9'),'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':'Set','appdata':_0x4e31('0x12')+(_0x3f9244[_0x4e31('0x13')]?_0x4e31('0x14')+_0x3f9244['cutdigits']+'}':_0x4e31('0x15')),'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':'CDR(routeid)='+_0x3f9244['id'],'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':'ExecIf','appdata':_0x4e31('0x16')+(_0x14a367+0x2)+_0x4e31('0x17')+(_0x14a367+0x1)+')','context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':_0x3f9244[_0x4e31('0x13')]?_0x4e31('0x18')+_0x3f9244[_0x4e31('0x13')]+'}':_0x4e31('0x19'),'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244['exten'],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':'outbound','app':_0x4e31('0x7'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':'outbound','app':_0x4e31('0x7'),'appdata':_0x4e31('0xf'),'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':_0x4e31('0x1a')+_0x3f9244['id'],'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']}];if(_0x3f9244[_0x4e31('0x1b')]('recordingFormat')&&_0x3f9244[_0x4e31('0x1c')]!==_0x4e31('0x1d')){_0x37e9e1['push']({'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':_0x4e31('0x1e'),'context':_0x3f9244['context'],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':_0x4e31('0x1f')+_0x3f9244['recordingFormat']||_0x4e31('0x20'),'context':_0x3f9244['context'],'exten':_0x3f9244['exten'],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']});}return _0x37e9e1;}function _0xf511d6(_0x3557b7,_0x5c2dcb){var _0x4d82cc=[{'name':_0x4e31('0x21'),'param':0x0},{'name':_0x4e31('0x22'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x1896c0={};var _0x1910d4=_0x5c2dcb[_0x4e31('0x23')](',');var _0x34f11f=[];for(var _0x516281=0x0;_0x516281<_0x4d82cc[_0x4e31('0x24')];_0x516281++){switch(_0x4d82cc[_0x516281][_0x4e31('0x25')]){case _0x4e31('0x21'):_0x1896c0['trunk']=_0x1910d4[_0x4d82cc[_0x516281]['param']][_0x4e31('0x23')]('/')[0x1];_0x1896c0[_0x4e31('0x26')]=_0x1910d4[_0x4d82cc[_0x516281][_0x4e31('0x27')]][_0x4e31('0x23')]('/')[0x2];_0x1896c0[_0x4e31('0x28')]=_0x1896c0[_0x4e31('0x26')]?_0x1896c0[_0x4e31('0x26')][_0x4e31('0x23')]('$')[0x0]:undefined;_0x1896c0[_0x4e31('0x26')]=_0x3557b7[_0x4e31('0x13')]?(_0x1896c0[_0x4e31('0x28')]||'')+_0x4e31('0x14')+_0x3557b7['cutdigits']+'}':(_0x1896c0[_0x4e31('0x28')]||'')+'${EXTEN}';_0x34f11f[_0x4d82cc[_0x516281][_0x4e31('0x27')]]=[_0x4e31('0x29'),_0x1896c0[_0x4e31('0x21')],_0x1896c0['phone']][_0x4e31('0x2a')]('/');break;case _0x4e31('0x2b'):_0x1896c0[_0x4e31('0x2b')]=_0x1910d4[_0x4d82cc[_0x516281][_0x4e31('0x27')]];if(_0x3557b7[_0x4e31('0x1c')]!=='none'){if(_0x1896c0[_0x4e31('0x2b')][_0x4e31('0x2c')](_0x4e31('0x2d'))<0x0){_0x1896c0['options']+=_0x4e31('0x2d');}}else{_0x1896c0[_0x4e31('0x2b')]=_0x1896c0['options'][_0x4e31('0x2e')](_0x4e31('0x2d'),'');}_0x34f11f[_0x4d82cc[_0x516281]['param']]=_0x1896c0['options'];break;default:_0x34f11f[_0x4d82cc[_0x516281][_0x4e31('0x27')]]=_0x1910d4[_0x4d82cc[_0x516281]['param']];}}return _0x34f11f['join'](',');}function _0xde6c49(_0x42b980,_0x4619ee,_0x3a5fa4){return new Promise(function(_0x57794d,_0x31fd13){var _0x4f9934=[];if(_[_0x4e31('0x2f')](_0x4619ee))return _0x57794d(_0x4f9934);_0xc8a121[_0x4e31('0x30')][_0x4e31('0x31')]({'attributes':['id','interval',_0x4e31('0x32')],'raw':!![]})['then'](function(_0x1f98e8){for(var _0x178a8f=0x0,_0x58c236=0x0;_0x178a8f<_0x4619ee[_0x4e31('0x24')];_0x178a8f++,_0x58c236=0x0){var _0x1aac8a=_0x4619ee[_0x178a8f];var _0x4a73e7=[];var _0x1211a5=[];delete _0x1aac8a['id'];if(_0x1aac8a['interval']!==_0x4e31('0x33')){_0x1aac8a[_0x4e31('0x34')]=[_0x1aac8a[_0x4e31('0x35')]];}else{_0x1aac8a[_0x4e31('0x34')]=_0x1aac8a['IntervalId']?_['map'](_[_0x4e31('0x36')](_0x1f98e8,{'IntervalId':_0x1aac8a[_0x4e31('0x32')]}),'interval'):[];}_0x1aac8a[_0x4e31('0x4')]=_0x42b980[_0x4e31('0x4')];_0x1aac8a['exten']=_0x42b980[_0x4e31('0x5')];if(_0x1aac8a[_0x4e31('0x3')])_0x1aac8a[_0x4e31('0x3')]=_0x1aac8a['type'][_0x4e31('0x37')]();if(_0x42b980['type']===_0x4e31('0x11')){if(_0x1aac8a[_0x4e31('0x1b')](_0x4e31('0x38'))&&_0x1aac8a['tag']&&_0x1aac8a[_0x4e31('0x38')]!=='--'){_0x4a73e7[_0x4e31('0xb')]({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':_0x4e31('0x7'),'appdata':_0x4e31('0x39')+_0x1aac8a[_0x4e31('0x38')],'context':_0x42b980[_0x4e31('0x4')],'exten':_0x42b980[_0x4e31('0x5')],'priority':_0x1aac8a['intervals'][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});}_0x4a73e7['push']({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':_0x4e31('0x3a'),'appdata':_0x4e31('0x3b')+(_0x1aac8a['callerID']?_0x4e31('0x3c')+_0x1aac8a['callerID']+')':_0x4e31('0x3d')),'context':_0x42b980['context'],'exten':_0x42b980['exten'],'priority':_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});}else{if(_0x1aac8a[_0x4e31('0x1b')](_0x4e31('0x3e'))){if([_0x4e31('0x3f'),_0x4e31('0x40')][_0x4e31('0x41')](_0x1aac8a[_0x4e31('0x42')][_0x4e31('0x37')]())&&_0x1aac8a[_0x4e31('0x43')]!==_0x4e31('0x44')){if(_0x1aac8a[_0x4e31('0x3e')]){_0x4a73e7[_0x4e31('0xb')]({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':_0x4e31('0x3a'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x42b980['context'],'exten':_0x42b980[_0x4e31('0x5')],'priority':_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});_0x4a73e7['push']({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':'Set','appdata':_0x4e31('0x45'),'context':_0x42b980[_0x4e31('0x4')],'exten':_0x42b980[_0x4e31('0x5')],'priority':_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});}else{_0x4a73e7[_0x4e31('0xb')]({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x42b980[_0x4e31('0x4')],'exten':_0x42b980[_0x4e31('0x5')],'priority':_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});_0x4a73e7[_0x4e31('0xb')]({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':_0x4e31('0x7'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x42b980[_0x4e31('0x4')],'exten':_0x42b980[_0x4e31('0x5')],'priority':_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});}}}}for(var _0x505a02=0x0;_0x505a02<_0x1aac8a[_0x4e31('0x34')]['length'];_0x505a02++){var _0x6b536=_0x3a5fa4+_0x1aac8a[_0x4e31('0x34')]['length'];var _0x4b5682=_0x505a02===_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]-0x1?_0x3a5fa4+_0x4a73e7[_0x4e31('0x24')]+_0x1211a5['length']+0x2:_0x3a5fa4+_0x505a02+0x1;_0x4a73e7['splice'](_0x505a02,0x0,{'type':_0x42b980[_0x4e31('0x3')],'app':'GotoIfTime','appdata':_0x1aac8a[_0x4e31('0x34')][_0x505a02]+'?'+_0x42b980['context']+',${EXTEN},'+_0x6b536+':'+_0x42b980['context']+_0x4e31('0x46')+_0x4b5682,'exten':_0x42b980['exten'],'context':_0x42b980[_0x4e31('0x4')],'priority':_0x3a5fa4+_0x505a02,'VoiceExtensionId':_0x42b980['id']});}if(_0x1aac8a['appType']===_0x4e31('0x47'))_0x1aac8a[_0x4e31('0x48')]=_0xf511d6(_0x42b980,_0x1aac8a['appdata']);_0x1aac8a[_0x4e31('0x49')]=_0x4a73e7['length']?_[_0x4e31('0x4a')](_0x4a73e7)['priority']+0x1:_0x3a5fa4;_0x4f9934=_[_0x4e31('0x4b')](_0x4f9934,_0x4a73e7,[_0x1aac8a],_0x1211a5);_0x3a5fa4=_[_0x4e31('0x4a')](_0x4f9934)[_0x4e31('0x49')]+0x1;}return _0x57794d(_0x4f9934);})[_0x4e31('0x4c')](function(_0x1818ce){_0x31fd13(_0x1818ce);});});}return _0x2ee0be['define']('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xdd72cd){var _0x13a690=this[_0x4e31('0x4d')]({'plain':!![]});var _0x25735e=_0x13a690[_0x4e31('0x3')]===_0x4e31('0x11')?_0x56cfc7(_0x13a690):_0x21e52f(_0x13a690);return _0xde6c49(_0x13a690,_0xdd72cd,_[_0x4e31('0x4a')](_0x25735e)[_0x4e31('0x49')]+0x1)['then'](function(_0x51bf79){var _0x57e542=_[_0x4e31('0x4b')](_0x25735e,_0x51bf79);_0x57e542[_0x4e31('0xb')]({'type':_0x13a690[_0x4e31('0x3')],'app':'Hangup','exten':_0x13a690[_0x4e31('0x5')],'context':_0x13a690[_0x4e31('0x4')],'priority':_[_0x4e31('0x4a')](_0x57e542)['priority']+0x1,'VoiceExtensionId':_0x13a690['id']});return _0x57e542;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index c9b172b..4ec1118 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 _0x6c65=['map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./voiceExtension.socket','register','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','VoiceExtension,\x20%s,\x20%s','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include'];(function(_0x2f7456,_0x4821b2){var _0x54b268=function(_0x1e498c){while(--_0x1e498c){_0x2f7456['push'](_0x2f7456['shift']());}};_0x54b268(++_0x4821b2);}(_0x6c65,0x78));var _0x56c6=function(_0x3ee47b,_0x33c0fb){_0x3ee47b=_0x3ee47b-0x0;var _0x28bb08=_0x6c65[_0x3ee47b];return _0x28bb08;};'use strict';var _=require(_0x56c6('0x0'));var util=require(_0x56c6('0x1'));var moment=require(_0x56c6('0x2'));var BPromise=require(_0x56c6('0x3'));var rs=require(_0x56c6('0x4'));var fs=require('fs');var Redis=require(_0x56c6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x56c6('0x6'));var logger=require(_0x56c6('0x7'))(_0x56c6('0x8'));var config=require(_0x56c6('0x9'));var jayson=require(_0x56c6('0xa'));var client=jayson['client'][_0x56c6('0xb')]({'port':0x232a});config[_0x56c6('0xc')]=_[_0x56c6('0xd')](config[_0x56c6('0xc')],{'host':_0x56c6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56c6('0xc')]));require(_0x56c6('0xf'))[_0x56c6('0x10')](socket);function respondWithRpcPromise(_0x48354f,_0x3786de,_0x30a2f2){return new BPromise(function(_0x34a0e9,_0x229ca9){return client[_0x56c6('0x11')](_0x48354f,_0x30a2f2)[_0x56c6('0x12')](function(_0x5dce6b){logger[_0x56c6('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x3786de,'request\x20sent');logger[_0x56c6('0x14')](_0x56c6('0x15'),_0x3786de,_0x56c6('0x16'),JSON[_0x56c6('0x17')](_0x5dce6b));if(_0x5dce6b['error']){if(_0x5dce6b[_0x56c6('0x18')]['code']===0x1f4){logger[_0x56c6('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x3786de,_0x5dce6b[_0x56c6('0x18')]['message']);return _0x229ca9(_0x5dce6b['error'][_0x56c6('0x19')]);}logger['error'](_0x56c6('0x1a'),_0x3786de,_0x5dce6b['error'][_0x56c6('0x19')]);return _0x34a0e9(_0x5dce6b['error'][_0x56c6('0x19')]);}else{logger['info'](_0x56c6('0x1a'),_0x3786de,'request\x20sent');_0x34a0e9(_0x5dce6b[_0x56c6('0x1b')][_0x56c6('0x19')]);}})['catch'](function(_0x219dca){logger[_0x56c6('0x18')](_0x56c6('0x1a'),_0x3786de,_0x219dca);_0x229ca9(_0x219dca);});});}exports[_0x56c6('0x1c')]=function(_0x5c9e9a){var _0x4ed561=this;return new Promise(function(_0x46de48,_0x413ca7){return db[_0x56c6('0x1d')][_0x56c6('0x1e')]({'raw':_0x5c9e9a['options']?_0x5c9e9a[_0x56c6('0x1f')][_0x56c6('0x20')]===undefined?!![]:![]:!![],'where':_0x5c9e9a['options']?_0x5c9e9a[_0x56c6('0x1f')]['where']||null:null,'attributes':_0x5c9e9a['options']?_0x5c9e9a[_0x56c6('0x1f')][_0x56c6('0x21')]||null:null,'limit':_0x5c9e9a[_0x56c6('0x1f')]?_0x5c9e9a['options'][_0x56c6('0x22')]||null:null,'include':_0x5c9e9a[_0x56c6('0x1f')]?_0x5c9e9a[_0x56c6('0x1f')][_0x56c6('0x23')]?_[_0x56c6('0x24')](_0x5c9e9a[_0x56c6('0x1f')]['include'],function(_0x4be5df){return{'model':db[_0x4be5df[_0x56c6('0x25')]],'as':_0x4be5df['as'],'attributes':_0x4be5df[_0x56c6('0x21')],'include':_0x4be5df['include']?_[_0x56c6('0x24')](_0x4be5df['include'],function(_0x2e6b1a){return{'model':db[_0x2e6b1a['model']],'as':_0x2e6b1a['as'],'attributes':_0x2e6b1a[_0x56c6('0x21')],'include':_0x2e6b1a['include']?_[_0x56c6('0x24')](_0x2e6b1a[_0x56c6('0x23')],function(_0x24fb02){return{'model':db[_0x24fb02[_0x56c6('0x25')]],'as':_0x24fb02['as'],'attributes':_0x24fb02[_0x56c6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x56c6('0x12')](function(_0x14094b){logger[_0x56c6('0x13')](_0x56c6('0x1c'),_0x5c9e9a);logger[_0x56c6('0x14')](_0x56c6('0x1c'),_0x5c9e9a,JSON['stringify'](_0x14094b));_0x46de48(_0x14094b);})[_0x56c6('0x26')](function(_0x22a98e){logger['error']('GetVoiceExtension',_0x22a98e[_0x56c6('0x19')],_0x5c9e9a);_0x413ca7(_0x4ed561['error'](0x1f4,_0x22a98e[_0x56c6('0x19')]));});});}; \ No newline at end of file +var _0xb242=['defaults','localhost','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','findAll','options','raw','where','limit','include','model','attributes','GetVoiceExtension','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis'];(function(_0x9c5057,_0x20e48e){var _0x1f7c91=function(_0x18079d){while(--_0x18079d){_0x9c5057['push'](_0x9c5057['shift']());}};_0x1f7c91(++_0x20e48e);}(_0xb242,0x1f3));var _0x2b24=function(_0x14363e,_0x4f0e0d){_0x14363e=_0x14363e-0x0;var _0x17c56d=_0xb242[_0x14363e];return _0x17c56d;};'use strict';var _=require('lodash');var util=require(_0x2b24('0x0'));var moment=require(_0x2b24('0x1'));var BPromise=require(_0x2b24('0x2'));var rs=require(_0x2b24('0x3'));var fs=require('fs');var Redis=require(_0x2b24('0x4'));var db=require(_0x2b24('0x5'))['db'];var utils=require(_0x2b24('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2b24('0x7'));var jayson=require(_0x2b24('0x8'));var client=jayson['client'][_0x2b24('0x9')]({'port':0x232a});config[_0x2b24('0xa')]=_[_0x2b24('0xb')](config['redis'],{'host':_0x2b24('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b24('0xa')]));require(_0x2b24('0xd'))['register'](socket);function respondWithRpcPromise(_0x280030,_0x56dd79,_0x24efd2){return new BPromise(function(_0x12a5cb,_0x5e219d){return client['request'](_0x280030,_0x24efd2)[_0x2b24('0xe')](function(_0x4ab047){logger[_0x2b24('0xf')](_0x2b24('0x10'),_0x56dd79,_0x2b24('0x11'));logger[_0x2b24('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x56dd79,'request\x20sent',JSON[_0x2b24('0x13')](_0x4ab047));if(_0x4ab047[_0x2b24('0x14')]){if(_0x4ab047[_0x2b24('0x14')][_0x2b24('0x15')]===0x1f4){logger[_0x2b24('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x56dd79,_0x4ab047[_0x2b24('0x14')][_0x2b24('0x16')]);return _0x5e219d(_0x4ab047['error'][_0x2b24('0x16')]);}logger[_0x2b24('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x56dd79,_0x4ab047[_0x2b24('0x14')][_0x2b24('0x16')]);return _0x12a5cb(_0x4ab047[_0x2b24('0x14')][_0x2b24('0x16')]);}else{logger['info'](_0x2b24('0x10'),_0x56dd79,_0x2b24('0x11'));_0x12a5cb(_0x4ab047[_0x2b24('0x17')]['message']);}})[_0x2b24('0x18')](function(_0xa45843){logger[_0x2b24('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x56dd79,_0xa45843);_0x5e219d(_0xa45843);});});}exports['GetVoiceExtension']=function(_0x30f993){var _0x271827=this;return new Promise(function(_0xb6e4f8,_0x357596){return db['VoiceExtension'][_0x2b24('0x19')]({'raw':_0x30f993[_0x2b24('0x1a')]?_0x30f993[_0x2b24('0x1a')][_0x2b24('0x1b')]===undefined?!![]:![]:!![],'where':_0x30f993['options']?_0x30f993['options'][_0x2b24('0x1c')]||null:null,'attributes':_0x30f993['options']?_0x30f993['options']['attributes']||null:null,'limit':_0x30f993['options']?_0x30f993[_0x2b24('0x1a')][_0x2b24('0x1d')]||null:null,'include':_0x30f993[_0x2b24('0x1a')]?_0x30f993[_0x2b24('0x1a')]['include']?_['map'](_0x30f993['options'][_0x2b24('0x1e')],function(_0x20801c){return{'model':db[_0x20801c[_0x2b24('0x1f')]],'as':_0x20801c['as'],'attributes':_0x20801c[_0x2b24('0x20')],'include':_0x20801c['include']?_['map'](_0x20801c[_0x2b24('0x1e')],function(_0x3bd10a){return{'model':db[_0x3bd10a['model']],'as':_0x3bd10a['as'],'attributes':_0x3bd10a['attributes'],'include':_0x3bd10a[_0x2b24('0x1e')]?_['map'](_0x3bd10a['include'],function(_0x2a9a05){return{'model':db[_0x2a9a05[_0x2b24('0x1f')]],'as':_0x2a9a05['as'],'attributes':_0x2a9a05[_0x2b24('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2b24('0xe')](function(_0x4e6991){logger[_0x2b24('0xf')]('GetVoiceExtension',_0x30f993);logger[_0x2b24('0x12')](_0x2b24('0x21'),_0x30f993,JSON[_0x2b24('0x13')](_0x4e6991));_0xb6e4f8(_0x4e6991);})[_0x2b24('0x18')](function(_0x316253){logger[_0x2b24('0x14')](_0x2b24('0x21'),_0x316253[_0x2b24('0x16')],_0x30f993);_0x357596(_0x271827[_0x2b24('0x14')](0x1f4,_0x316253[_0x2b24('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index b2da92a..a959f18 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 _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x814b,0x1a2));var _0xb814=function(_0x2fffff,_0x415518){_0x2fffff=_0x2fffff-0x0;var _0x4f2a2c=_0x814b[_0x2fffff];return _0x4f2a2c;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file +var _0x7fbe=['length','voiceExtension:','remove','update','emit','removeListener','register'];(function(_0x1cffd6,_0x5e9b47){var _0xc013df=function(_0x2c06eb){while(--_0x2c06eb){_0x1cffd6['push'](_0x1cffd6['shift']());}};_0xc013df(++_0x5e9b47);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xe1b12b,_0x241bd1){_0xe1b12b=_0xe1b12b-0x0;var _0x1b697a=_0x7fbe[_0xe1b12b];return _0x1b697a;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save',_0xe7fb('0x0'),_0xe7fb('0x1')];function createListener(_0x294c21,_0x1703d5){return function(_0x517d3a){_0x1703d5[_0xe7fb('0x2')](_0x294c21,_0x517d3a);};}function removeListener(_0x11d2c4,_0x4524ff){return function(){VoiceExtensionEvents[_0xe7fb('0x3')](_0x11d2c4,_0x4524ff);};}exports[_0xe7fb('0x4')]=function(_0x290172){for(var _0x12d1b0=0x0,_0x24cd67=events[_0xe7fb('0x5')];_0x12d1b0<_0x24cd67;_0x12d1b0++){var _0x5ad75b=events[_0x12d1b0];var _0x213ebc=createListener(_0xe7fb('0x6')+_0x5ad75b,_0x290172);VoiceExtensionEvents['on'](_0x5ad75b,_0x213ebc);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 366f10a..ba37a32 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 _0x1893=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create','put','update'];(function(_0x277b05,_0x2dc697){var _0x5bc781=function(_0x911c51){while(--_0x911c51){_0x277b05['push'](_0x277b05['shift']());}};_0x5bc781(++_0x2dc697);}(_0x1893,0xa2));var _0x3189=function(_0xd1f854,_0x532346){_0xd1f854=_0xd1f854-0x0;var _0x548294=_0x1893[_0xd1f854];return _0x548294;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3189('0x0'));var timeout=require(_0x3189('0x1'));var express=require(_0x3189('0x2'));var router=express[_0x3189('0x3')]();var fs_extra=require(_0x3189('0x4'));var auth=require(_0x3189('0x5'));var interaction=require(_0x3189('0x6'));var config=require('../../config/environment');var controller=require(_0x3189('0x7'));router[_0x3189('0x8')]('/',auth[_0x3189('0x9')](),controller[_0x3189('0xa')]);router[_0x3189('0x8')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0xc')]);router['get'](_0x3189('0xd'),auth['isAuthenticated'](),controller[_0x3189('0xe')]);router['post']('/',auth[_0x3189('0x9')](),controller[_0x3189('0xf')]);router[_0x3189('0x10')](_0x3189('0xb'),auth['isAuthenticated'](),controller[_0x3189('0x11')]);router[_0x3189('0x12')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4819=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','/:id','show','get','/:id/messages','getMessages','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x8069bf,_0x4d9863){var _0x19b24c=function(_0x5cbb61){while(--_0x5cbb61){_0x8069bf['push'](_0x8069bf['shift']());}};_0x19b24c(++_0x4d9863);}(_0x4819,0xcd));var _0x9481=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x4819[_0x2283dc];return _0x16db90;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get']('/',auth[_0x9481('0xa')](),controller['index']);router['get'](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0xc')]);router[_0x9481('0xd')](_0x9481('0xe'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['post']('/',auth[_0x9481('0xa')](),controller['create']);router[_0x9481('0x10')](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0x11')]);router[_0x9481('0x12')](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0x13')]);module[_0x9481('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index f1c92b9..88be537 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 _0x6105=['sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6105,0x1c2));var _0x5610=function(_0x156c95,_0x1760cf){_0x156c95=_0x156c95-0x0;var _0x1a8cf5=_0x6105[_0x156c95];return _0x1a8cf5;};'use strict';var Sequelize=require(_0x5610('0x0'));module[_0x5610('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x5610('0x2')],'defaultValue':_0x5610('0x3'),'unique':_0x5610('0x4')},'mailbox':{'type':Sequelize[_0x5610('0x2')],'defaultValue':'','allowNull':![],'unique':_0x5610('0x4')},'password':{'type':Sequelize[_0x5610('0x2')]},'fullname':{'type':Sequelize[_0x5610('0x2')]},'email':{'type':Sequelize[_0x5610('0x2')],'validate':{'isEmail':!![]},'set':function(_0x3fe877){this[_0x5610('0x5')](_0x5610('0x6'),typeof _0x3fe877===_0x5610('0x7')&&_0x3fe877[_0x5610('0x8')]()?_0x3fe877[_0x5610('0x8')]():null);}},'pager':{'type':Sequelize[_0x5610('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0x5610('0x9')](_0x5610('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x5610('0x9')](_0x5610('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x5610('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x5610('0x9')](_0x5610('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x5610('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x5610('0x9')](_0x5610('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x5610('0x9')](_0x5610('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x5610('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x5610('0x9')](_0x5610('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5610('0x9')](_0x5610('0xa'),'no'),'defaultValue':_0x5610('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x5610('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5610('0x9')](_0x5610('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x5610('0x9')]('yes','no'),'defaultValue':_0x5610('0xa'),'allowNull':![]},'stamp':{'type':_0x5610('0xb')},'emailsubject':{'type':Sequelize[_0x5610('0x2')]},'emailbody':{'type':Sequelize[_0x5610('0x2')]},'maxsecs':{'type':Sequelize[_0x5610('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5610('0xd')],'get':function(){return this[_0x5610('0xe')](_0x5610('0xf'))+_0x5610('0x10')+this[_0x5610('0xe')](_0x5610('0x11'));}}}; \ No newline at end of file +var _0xb6f6=['central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb6f6,0x1c3));var _0x6b6f=function(_0x230cc8,_0x5c598d){_0x230cc8=_0x230cc8-0x0;var _0x33824a=_0xb6f6[_0x230cc8];return _0x33824a;};'use strict';var Sequelize=require('sequelize');module[_0x6b6f('0x0')]={'customer_id':{'type':Sequelize[_0x6b6f('0x1')]},'context':{'type':Sequelize[_0x6b6f('0x1')],'defaultValue':_0x6b6f('0x2'),'unique':_0x6b6f('0x3')},'mailbox':{'type':Sequelize[_0x6b6f('0x1')],'defaultValue':'','allowNull':![],'unique':_0x6b6f('0x3')},'password':{'type':Sequelize[_0x6b6f('0x1')]},'fullname':{'type':Sequelize[_0x6b6f('0x1')]},'email':{'type':Sequelize[_0x6b6f('0x1')],'validate':{'isEmail':!![]},'set':function(_0x5a40c7){this[_0x6b6f('0x4')](_0x6b6f('0x5'),typeof _0x5a40c7===_0x6b6f('0x6')&&_0x5a40c7[_0x6b6f('0x7')]()?_0x5a40c7[_0x6b6f('0x7')]():null);}},'pager':{'type':Sequelize[_0x6b6f('0x1')]},'tz':{'type':Sequelize[_0x6b6f('0x1')],'defaultValue':_0x6b6f('0x8')},'attach':{'type':Sequelize[_0x6b6f('0x9')](_0x6b6f('0xa'),'no'),'defaultValue':_0x6b6f('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x6b6f('0x9')](_0x6b6f('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x6b6f('0x1')]},'callback':{'type':Sequelize[_0x6b6f('0x1')]},'review':{'type':Sequelize['ENUM'](_0x6b6f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6b6f('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x6b6f('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6b6f('0x9')](_0x6b6f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x6b6f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x6b6f('0xa'),'no'),'defaultValue':_0x6b6f('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x6b6f('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6b6f('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x6b6f('0x9')](_0x6b6f('0xa'),'no'),'defaultValue':_0x6b6f('0xa'),'allowNull':![]},'stamp':{'type':_0x6b6f('0xb')},'emailsubject':{'type':Sequelize[_0x6b6f('0x1')]},'emailbody':{'type':Sequelize[_0x6b6f('0x1')]},'maxsecs':{'type':Sequelize[_0x6b6f('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6b6f('0xd')],'get':function(){return this[_0x6b6f('0xe')](_0x6b6f('0xf'))+'\x20-\x20'+this[_0x6b6f('0xe')](_0x6b6f('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 00a7900..8d87663 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 _0xeb74=['VoiceMail','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','sendStatus','error','stack','name','send','map'];(function(_0x3b2bd4,_0x3e69b7){var _0x2cb81c=function(_0x38f299){while(--_0x38f299){_0x3b2bd4['push'](_0x3b2bd4['shift']());}};_0x2cb81c(++_0x3e69b7);}(_0xeb74,0xe3));var _0x4eb7=function(_0x3bfb11,_0x4ed96c){_0x3bfb11=_0x3bfb11-0x0;var _0x2291ce=_0xeb74[_0x3bfb11];return _0x2291ce;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){var _0x2e8de8=_0x4de2d9[_0x4eb7('0x27')]({'plain':!![]});var _0x3e0da2=_0x4eb7('0x28');return db[_0x4eb7('0x29')][_0x4eb7('0x26')]({'where':{'type':_0x3e0da2,'resourceId':_0x2e8de8['id']}})[_0x4eb7('0x25')](function(){return _0x4de2d9;});})[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x2a')]();});}};}function handleEntityNotFound(_0x2d1773,_0x1b56a8){return function(_0x433794){if(!_0x433794){_0x2d1773[_0x4eb7('0x2b')](0x194);}return _0x433794;};}function handleError(_0x2be00c,_0x41e515){_0x41e515=_0x41e515||0x1f4;return function(_0x33a2c1){logger[_0x4eb7('0x2c')](_0x33a2c1[_0x4eb7('0x2d')]);if(_0x33a2c1[_0x4eb7('0x2e')]){delete _0x33a2c1[_0x4eb7('0x2e')];}_0x2be00c['status'](_0x41e515)[_0x4eb7('0x2f')](_0x33a2c1);};}exports['index']=function(_0x446872,_0x13f71a){var _0xc5aa21={},_0x1fe298={},_0x468195={'count':0x0,'rows':[]};var _0x1cec8e=_[_0x4eb7('0x30')](db[_0x4eb7('0x31')][_0x4eb7('0x32')],function(_0x4f8879){return{'name':_0x4f8879[_0x4eb7('0x33')],'type':_0x4f8879['type'][_0x4eb7('0x34')]};});_0x1fe298[_0x4eb7('0x35')]=_['map'](_0x1cec8e,'name');_0x1fe298[_0x4eb7('0x36')]=_[_0x4eb7('0x37')](_0x446872[_0x4eb7('0x36')]);_0x1fe298[_0x4eb7('0x38')]=_['intersection'](_0x1fe298[_0x4eb7('0x35')],_0x1fe298[_0x4eb7('0x36')]);_0xc5aa21[_0x4eb7('0x39')]=_[_0x4eb7('0x3a')](_0x1fe298[_0x4eb7('0x35')],qs['fields'](_0x446872[_0x4eb7('0x36')][_0x4eb7('0x3b')]));_0xc5aa21[_0x4eb7('0x39')]=_0xc5aa21['attributes'][_0x4eb7('0x3c')]?_0xc5aa21[_0x4eb7('0x39')]:_0x1fe298[_0x4eb7('0x35')];if(!_0x446872['query'][_0x4eb7('0x3d')]('nolimit')){_0xc5aa21[_0x4eb7('0x1d')]=qs[_0x4eb7('0x1d')](_0x446872[_0x4eb7('0x36')][_0x4eb7('0x1d')]);_0xc5aa21['offset']=qs[_0x4eb7('0x1b')](_0x446872[_0x4eb7('0x36')][_0x4eb7('0x1b')]);}_0xc5aa21[_0x4eb7('0x3e')]=qs['sort'](_0x446872['query']['sort']);_0xc5aa21[_0x4eb7('0x3f')]=qs[_0x4eb7('0x38')](_[_0x4eb7('0x40')](_0x446872[_0x4eb7('0x36')],_0x1fe298[_0x4eb7('0x38')]),_0x1cec8e);if(_0x446872[_0x4eb7('0x36')][_0x4eb7('0x41')]){_0xc5aa21[_0x4eb7('0x3f')]=_[_0x4eb7('0x42')](_0xc5aa21[_0x4eb7('0x3f')],{'$or':_['map'](_0x1cec8e,function(_0x5d0e51){if(_0x5d0e51[_0x4eb7('0x43')]!==_0x4eb7('0x44')){var _0x4597c8={};_0x4597c8[_0x5d0e51[_0x4eb7('0x2e')]]={'$like':'%'+_0x446872[_0x4eb7('0x36')][_0x4eb7('0x41')]+'%'};return _0x4597c8;}})});}_0xc5aa21=_[_0x4eb7('0x42')]({},_0xc5aa21,_0x446872[_0x4eb7('0x45')]);var _0x3a31ce={'where':_0xc5aa21[_0x4eb7('0x3f')]};return db[_0x4eb7('0x31')][_0x4eb7('0x1e')](_0x3a31ce)[_0x4eb7('0x25')](function(_0x38af1f){_0x468195[_0x4eb7('0x1e')]=_0x38af1f;if(_0x446872[_0x4eb7('0x36')][_0x4eb7('0x46')]){_0xc5aa21[_0x4eb7('0x47')]=[{'all':!![]}];}return db[_0x4eb7('0x31')]['findAll'](_0xc5aa21);})[_0x4eb7('0x25')](function(_0x2df542){_0x468195[_0x4eb7('0x48')]=_0x2df542;return _0x468195;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x13f71a,_0xc5aa21))[_0x4eb7('0x49')](handleError(_0x13f71a,null));};exports[_0x4eb7('0x4a')]=function(_0x3cd9e5,_0x10fac2){var _0x3d6b0b={'raw':!![],'where':{'id':_0x3cd9e5[_0x4eb7('0x4b')]['id']}},_0x4969eb={};_0x4969eb['model']=_[_0x4eb7('0x37')](db[_0x4eb7('0x31')][_0x4eb7('0x32')]);_0x4969eb['query']=_[_0x4eb7('0x37')](_0x3cd9e5[_0x4eb7('0x36')]);_0x4969eb[_0x4eb7('0x38')]=_[_0x4eb7('0x3a')](_0x4969eb['model'],_0x4969eb[_0x4eb7('0x36')]);_0x3d6b0b['attributes']=_[_0x4eb7('0x3a')](_0x4969eb[_0x4eb7('0x35')],qs[_0x4eb7('0x3b')](_0x3cd9e5[_0x4eb7('0x36')][_0x4eb7('0x3b')]));_0x3d6b0b['attributes']=_0x3d6b0b['attributes'][_0x4eb7('0x3c')]?_0x3d6b0b[_0x4eb7('0x39')]:_0x4969eb[_0x4eb7('0x35')];if(_0x3cd9e5[_0x4eb7('0x36')][_0x4eb7('0x46')]){_0x3d6b0b['include']=[{'all':!![]}];}_0x3d6b0b=_[_0x4eb7('0x42')]({},_0x3d6b0b,_0x3cd9e5[_0x4eb7('0x45')]);return db['VoiceMail'][_0x4eb7('0x4c')](_0x3d6b0b)[_0x4eb7('0x25')](handleEntityNotFound(_0x10fac2,null))['then'](respondWithResult(_0x10fac2,null))[_0x4eb7('0x49')](handleError(_0x10fac2,null));};exports[_0x4eb7('0x4d')]=function(_0x3c8049,_0x5774d5){return db[_0x4eb7('0x31')]['create'](_0x3c8049['body'],{})[_0x4eb7('0x25')](function(_0x312e9b){var _0x32d7d6=_0x3c8049[_0x4eb7('0x4e')][_0x4eb7('0x27')]({'plain':!![]});if(!_0x32d7d6)throw new Error(_0x4eb7('0x4f'));if(_0x32d7d6[_0x4eb7('0x50')]===_0x4eb7('0x4e')){var _0x2913c5=_0x312e9b[_0x4eb7('0x27')]({'plain':!![]});var _0x42a1d9=_0x4eb7('0x28');return db[_0x4eb7('0x51')][_0x4eb7('0x4c')]({'where':{'name':_0x42a1d9,'userProfileId':_0x32d7d6[_0x4eb7('0x52')]},'raw':!![]})[_0x4eb7('0x25')](function(_0x327f1e){if(_0x327f1e&&_0x327f1e[_0x4eb7('0x53')]===0x0){return db[_0x4eb7('0x29')][_0x4eb7('0x4d')]({'name':_0x2913c5['name'],'resourceId':_0x2913c5['id'],'type':_0x327f1e[_0x4eb7('0x2e')],'sectionId':_0x327f1e['id']},{})['then'](function(){return _0x312e9b;});}else{return _0x312e9b;}})['catch'](function(_0x3f3a5f){logger[_0x4eb7('0x2c')](_0x4eb7('0x54'),_0x3f3a5f);throw _0x3f3a5f;});}return _0x312e9b;})[_0x4eb7('0x25')](respondWithResult(_0x5774d5,0xc9))[_0x4eb7('0x49')](handleError(_0x5774d5,null));};exports['update']=function(_0x4e3163,_0x2e5d28){if(_0x4e3163['body']['id']){delete _0x4e3163[_0x4eb7('0x55')]['id'];}return db[_0x4eb7('0x31')][_0x4eb7('0x4c')]({'where':{'id':_0x4e3163[_0x4eb7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2e5d28,null))[_0x4eb7('0x25')](saveUpdates(_0x4e3163[_0x4eb7('0x55')],null))[_0x4eb7('0x25')](respondWithResult(_0x2e5d28,null))[_0x4eb7('0x49')](handleError(_0x2e5d28,null));};exports['destroy']=function(_0x961de5,_0x340ffb){return db['VoiceMail'][_0x4eb7('0x4c')]({'where':{'id':_0x961de5[_0x4eb7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x340ffb,null))[_0x4eb7('0x25')](removeEntity(_0x340ffb,null))['catch'](handleError(_0x340ffb,null));};exports[_0x4eb7('0x56')]=function(_0x5be4ad,_0x13847e,_0x456fe7){return db[_0x4eb7('0x31')][_0x4eb7('0x57')]({'where':{'id':_0x5be4ad[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x13847e,null))['then'](function(_0x4a4fc5){var _0x1b8514;var _0x1b4afe={},_0x24d33d={};_0x24d33d[_0x4eb7('0x35')]=_['keys'](db[_0x4eb7('0x58')][_0x4eb7('0x32')]);_0x24d33d['query']=_[_0x4eb7('0x37')](_0x5be4ad[_0x4eb7('0x36')]);_0x24d33d[_0x4eb7('0x38')]=_[_0x4eb7('0x3a')](_0x24d33d[_0x4eb7('0x35')],_0x24d33d[_0x4eb7('0x36')]);_0x1b4afe[_0x4eb7('0x39')]=_['intersection'](_0x24d33d['model'],qs[_0x4eb7('0x3b')](_0x5be4ad['query'][_0x4eb7('0x3b')]));_0x1b4afe['attributes']=_0x1b4afe[_0x4eb7('0x39')]['length']?_0x1b4afe['attributes']:_0x24d33d[_0x4eb7('0x35')];if(!_0x5be4ad[_0x4eb7('0x36')]['hasOwnProperty'](_0x4eb7('0x59'))){_0x1b4afe['limit']=qs[_0x4eb7('0x1d')](_0x5be4ad[_0x4eb7('0x36')]['limit']);_0x1b4afe[_0x4eb7('0x1b')]=qs[_0x4eb7('0x1b')](_0x5be4ad['query']['offset']);}_0x1b4afe['order']=qs['sort'](_0x5be4ad[_0x4eb7('0x36')]['sort']);_0x1b4afe[_0x4eb7('0x3f')]=qs[_0x4eb7('0x38')](_['pick'](_0x5be4ad[_0x4eb7('0x36')],_0x24d33d[_0x4eb7('0x38')]));if(_0x5be4ad[_0x4eb7('0x36')][_0x4eb7('0x41')]){_0x1b4afe[_0x4eb7('0x3f')]=_[_0x4eb7('0x42')](_0x1b4afe['where'],{'$or':_['map'](_0x1b4afe['attributes'],function(_0x58d2c1){var _0x1775c4={};_0x1775c4[_0x58d2c1]={'$like':'%'+_0x5be4ad[_0x4eb7('0x36')][_0x4eb7('0x41')]+'%'};return _0x1775c4;})});}_0x1b4afe[_0x4eb7('0x3f')]=_['merge'](_0x1b4afe['where'],{'mailboxuser':_0x4a4fc5[_0x4eb7('0x5a')]});_0x1b4afe=_[_0x4eb7('0x42')]({},_0x1b4afe,_0x5be4ad[_0x4eb7('0x45')]);return db[_0x4eb7('0x58')][_0x4eb7('0x5b')](_0x1b4afe)['then'](respondWithFilteredResult(_0x13847e,_0x1b4afe));})[_0x4eb7('0x49')](handleError(_0x13847e,null));}; \ No newline at end of file +var _0x39cb=['filter','merge','options','VoiceMail','includeAll','include','findAll','rows','params','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','then','Voicemails','UserProfileResource','destroy','end','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x39cb,0x1bd));var _0xb39c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x39cb[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb39c('0x0'));var zipdir=require(_0xb39c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb39c('0x2'));var moment=require(_0xb39c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb39c('0x4'));var util=require(_0xb39c('0x5'));var path=require(_0xb39c('0x6'));var sox=require(_0xb39c('0x7'));var csv=require(_0xb39c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb39c('0x9'));var _=require(_0xb39c('0xa'));var squel=require(_0xb39c('0xb'));var crypto=require(_0xb39c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb39c('0x8'));var querystring=require(_0xb39c('0xd'));var Papa=require(_0xb39c('0xe'));var Redis=require(_0xb39c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb39c('0x10'));var logger=require(_0xb39c('0x11'))(_0xb39c('0x12'));var utils=require(_0xb39c('0x13'));var config=require(_0xb39c('0x14'));var licenseUtil=require(_0xb39c('0x15'));var db=require(_0xb39c('0x16'))['db'];function respondWithStatusCode(_0x18d12e,_0x51ff24){_0x51ff24=_0x51ff24||0xcc;return function(_0x31e07e){if(_0x31e07e){return _0x18d12e[_0xb39c('0x17')](_0x51ff24);}return _0x18d12e[_0xb39c('0x18')](_0x51ff24)['end']();};}function respondWithResult(_0xf4662a,_0x40a6d3){_0x40a6d3=_0x40a6d3||0xc8;return function(_0x42a203){if(_0x42a203){return _0xf4662a[_0xb39c('0x18')](_0x40a6d3)[_0xb39c('0x19')](_0x42a203);}};}function respondWithFilteredResult(_0x27c22a,_0x8e9181){return function(_0x5277ce){if(_0x5277ce){var _0x316c9b=typeof _0x8e9181[_0xb39c('0x1a')]===_0xb39c('0x1b')&&typeof _0x8e9181[_0xb39c('0x1c')]===_0xb39c('0x1b');var _0x3b7fad=_0x5277ce[_0xb39c('0x1d')];var _0x4e02cf=_0x316c9b?0x0:_0x8e9181[_0xb39c('0x1a')];var _0x2eeae6=_0x316c9b?_0x5277ce['count']:_0x8e9181[_0xb39c('0x1a')]+_0x8e9181[_0xb39c('0x1c')];var _0x28bbe1;if(_0x2eeae6>=_0x3b7fad){_0x2eeae6=_0x3b7fad;_0x28bbe1=0xc8;}else{_0x28bbe1=0xce;}_0x27c22a[_0xb39c('0x18')](_0x28bbe1);return _0x27c22a['set'](_0xb39c('0x1e'),_0x4e02cf+'-'+_0x2eeae6+'/'+_0x3b7fad)[_0xb39c('0x19')](_0x5277ce);}return null;};}function patchUpdates(_0x5e4a0b){return function(_0x2d8e93){try{jsonpatch[_0xb39c('0x1f')](_0x2d8e93,_0x5e4a0b,!![]);}catch(_0x1d3e2d){return BPromise['reject'](_0x1d3e2d);}return _0x2d8e93['save']();};}function saveUpdates(_0x2789fd,_0x1a5b9d){return function(_0x3c8dfd){if(_0x3c8dfd){return _0x3c8dfd['update'](_0x2789fd)[_0xb39c('0x20')](function(_0x438207){return _0x438207;});}return null;};}function removeEntity(_0x1bb895,_0x16f3b0){return function(_0x3b03ed){if(_0x3b03ed){return _0x3b03ed['destroy']()[_0xb39c('0x20')](function(){var _0xbeab7e=_0x3b03ed['get']({'plain':!![]});var _0x1fd145=_0xb39c('0x21');return db[_0xb39c('0x22')][_0xb39c('0x23')]({'where':{'type':_0x1fd145,'resourceId':_0xbeab7e['id']}})[_0xb39c('0x20')](function(){return _0x3b03ed;});})['then'](function(){_0x1bb895[_0xb39c('0x18')](0xcc)[_0xb39c('0x24')]();});}};}function handleEntityNotFound(_0x132769,_0x4c06fa){return function(_0x41fff2){if(!_0x41fff2){_0x132769[_0xb39c('0x17')](0x194);}return _0x41fff2;};}function handleError(_0x52eb5e,_0x3d08e1){_0x3d08e1=_0x3d08e1||0x1f4;return function(_0x4b4458){logger[_0xb39c('0x25')](_0x4b4458['stack']);if(_0x4b4458[_0xb39c('0x26')]){delete _0x4b4458[_0xb39c('0x26')];}_0x52eb5e['status'](_0x3d08e1)[_0xb39c('0x27')](_0x4b4458);};}exports['index']=function(_0x8e2d7,_0x2d2743){var _0x309697={},_0x7339b4={},_0x17eb7b={'count':0x0,'rows':[]};var _0x52e642=_[_0xb39c('0x28')](db['VoiceMail'][_0xb39c('0x29')],function(_0x48a888){return{'name':_0x48a888[_0xb39c('0x2a')],'type':_0x48a888[_0xb39c('0x2b')][_0xb39c('0x2c')]};});_0x7339b4[_0xb39c('0x2d')]=_['map'](_0x52e642,'name');_0x7339b4[_0xb39c('0x2e')]=_[_0xb39c('0x2f')](_0x8e2d7['query']);_0x7339b4[_0xb39c('0x30')]=_[_0xb39c('0x31')](_0x7339b4[_0xb39c('0x2d')],_0x7339b4[_0xb39c('0x2e')]);_0x309697[_0xb39c('0x32')]=_[_0xb39c('0x31')](_0x7339b4[_0xb39c('0x2d')],qs[_0xb39c('0x33')](_0x8e2d7[_0xb39c('0x2e')][_0xb39c('0x33')]));_0x309697[_0xb39c('0x32')]=_0x309697[_0xb39c('0x32')][_0xb39c('0x34')]?_0x309697[_0xb39c('0x32')]:_0x7339b4[_0xb39c('0x2d')];if(!_0x8e2d7[_0xb39c('0x2e')][_0xb39c('0x35')](_0xb39c('0x36'))){_0x309697[_0xb39c('0x1c')]=qs['limit'](_0x8e2d7[_0xb39c('0x2e')][_0xb39c('0x1c')]);_0x309697['offset']=qs['offset'](_0x8e2d7['query'][_0xb39c('0x1a')]);}_0x309697[_0xb39c('0x37')]=qs[_0xb39c('0x38')](_0x8e2d7['query'][_0xb39c('0x38')]);_0x309697[_0xb39c('0x39')]=qs[_0xb39c('0x30')](_[_0xb39c('0x3a')](_0x8e2d7[_0xb39c('0x2e')],_0x7339b4['filters']),_0x52e642);if(_0x8e2d7[_0xb39c('0x2e')][_0xb39c('0x3b')]){_0x309697['where']=_[_0xb39c('0x3c')](_0x309697['where'],{'$or':_[_0xb39c('0x28')](_0x52e642,function(_0xc6e494){if(_0xc6e494[_0xb39c('0x2b')]!=='VIRTUAL'){var _0x406fc6={};_0x406fc6[_0xc6e494[_0xb39c('0x26')]]={'$like':'%'+_0x8e2d7[_0xb39c('0x2e')][_0xb39c('0x3b')]+'%'};return _0x406fc6;}})});}_0x309697=_[_0xb39c('0x3c')]({},_0x309697,_0x8e2d7[_0xb39c('0x3d')]);var _0x17ed52={'where':_0x309697[_0xb39c('0x39')]};return db[_0xb39c('0x3e')][_0xb39c('0x1d')](_0x17ed52)[_0xb39c('0x20')](function(_0xd1136f){_0x17eb7b['count']=_0xd1136f;if(_0x8e2d7[_0xb39c('0x2e')][_0xb39c('0x3f')]){_0x309697[_0xb39c('0x40')]=[{'all':!![]}];}return db[_0xb39c('0x3e')][_0xb39c('0x41')](_0x309697);})[_0xb39c('0x20')](function(_0x1db549){_0x17eb7b[_0xb39c('0x42')]=_0x1db549;return _0x17eb7b;})[_0xb39c('0x20')](respondWithFilteredResult(_0x2d2743,_0x309697))['catch'](handleError(_0x2d2743,null));};exports['show']=function(_0x2f88c9,_0x36d948){var _0x496da9={'raw':!![],'where':{'id':_0x2f88c9[_0xb39c('0x43')]['id']}},_0x4bc2be={};_0x4bc2be['model']=_[_0xb39c('0x2f')](db[_0xb39c('0x3e')][_0xb39c('0x29')]);_0x4bc2be[_0xb39c('0x2e')]=_[_0xb39c('0x2f')](_0x2f88c9['query']);_0x4bc2be[_0xb39c('0x30')]=_[_0xb39c('0x31')](_0x4bc2be['model'],_0x4bc2be['query']);_0x496da9[_0xb39c('0x32')]=_['intersection'](_0x4bc2be['model'],qs[_0xb39c('0x33')](_0x2f88c9[_0xb39c('0x2e')][_0xb39c('0x33')]));_0x496da9[_0xb39c('0x32')]=_0x496da9[_0xb39c('0x32')][_0xb39c('0x34')]?_0x496da9[_0xb39c('0x32')]:_0x4bc2be[_0xb39c('0x2d')];if(_0x2f88c9[_0xb39c('0x2e')][_0xb39c('0x3f')]){_0x496da9['include']=[{'all':!![]}];}_0x496da9=_[_0xb39c('0x3c')]({},_0x496da9,_0x2f88c9[_0xb39c('0x3d')]);return db[_0xb39c('0x3e')][_0xb39c('0x44')](_0x496da9)[_0xb39c('0x20')](handleEntityNotFound(_0x36d948,null))[_0xb39c('0x20')](respondWithResult(_0x36d948,null))[_0xb39c('0x45')](handleError(_0x36d948,null));};exports[_0xb39c('0x46')]=function(_0x38bc36,_0x1ae2cb){return db[_0xb39c('0x3e')][_0xb39c('0x46')](_0x38bc36[_0xb39c('0x47')],{})[_0xb39c('0x20')](function(_0x17ad13){var _0x44b825=_0x38bc36['user'][_0xb39c('0x48')]({'plain':!![]});if(!_0x44b825)throw new Error(_0xb39c('0x49'));if(_0x44b825[_0xb39c('0x4a')]===_0xb39c('0x4b')){var _0xa50077=_0x17ad13[_0xb39c('0x48')]({'plain':!![]});var _0xd4f368=_0xb39c('0x21');return db['UserProfileSection']['find']({'where':{'name':_0xd4f368,'userProfileId':_0x44b825[_0xb39c('0x4c')]},'raw':!![]})[_0xb39c('0x20')](function(_0x5a7e75){if(_0x5a7e75&&_0x5a7e75['autoAssociation']===0x0){return db[_0xb39c('0x22')][_0xb39c('0x46')]({'name':_0xa50077['name'],'resourceId':_0xa50077['id'],'type':_0x5a7e75[_0xb39c('0x26')],'sectionId':_0x5a7e75['id']},{})['then'](function(){return _0x17ad13;});}else{return _0x17ad13;}})['catch'](function(_0x2d88dd){logger['error'](_0xb39c('0x4d'),_0x2d88dd);throw _0x2d88dd;});}return _0x17ad13;})[_0xb39c('0x20')](respondWithResult(_0x1ae2cb,0xc9))[_0xb39c('0x45')](handleError(_0x1ae2cb,null));};exports[_0xb39c('0x4e')]=function(_0x2f2944,_0x97f170){if(_0x2f2944['body']['id']){delete _0x2f2944[_0xb39c('0x47')]['id'];}return db[_0xb39c('0x3e')][_0xb39c('0x44')]({'where':{'id':_0x2f2944[_0xb39c('0x43')]['id']}})[_0xb39c('0x20')](handleEntityNotFound(_0x97f170,null))['then'](saveUpdates(_0x2f2944[_0xb39c('0x47')],null))['then'](respondWithResult(_0x97f170,null))[_0xb39c('0x45')](handleError(_0x97f170,null));};exports[_0xb39c('0x23')]=function(_0x131cb2,_0x9e4e89){return db[_0xb39c('0x3e')][_0xb39c('0x44')]({'where':{'id':_0x131cb2[_0xb39c('0x43')]['id']}})[_0xb39c('0x20')](handleEntityNotFound(_0x9e4e89,null))[_0xb39c('0x20')](removeEntity(_0x9e4e89,null))[_0xb39c('0x45')](handleError(_0x9e4e89,null));};exports[_0xb39c('0x4f')]=function(_0x260fbf,_0x2620ee,_0x33c0c6){return db[_0xb39c('0x3e')][_0xb39c('0x50')]({'where':{'id':_0x260fbf[_0xb39c('0x43')]['id']}})[_0xb39c('0x20')](handleEntityNotFound(_0x2620ee,null))[_0xb39c('0x20')](function(_0x49f118){var _0x57f2f4;var _0x1e9893={},_0x15534c={};_0x15534c['model']=_[_0xb39c('0x2f')](db[_0xb39c('0x51')]['rawAttributes']);_0x15534c[_0xb39c('0x2e')]=_[_0xb39c('0x2f')](_0x260fbf[_0xb39c('0x2e')]);_0x15534c[_0xb39c('0x30')]=_[_0xb39c('0x31')](_0x15534c[_0xb39c('0x2d')],_0x15534c['query']);_0x1e9893[_0xb39c('0x32')]=_[_0xb39c('0x31')](_0x15534c[_0xb39c('0x2d')],qs[_0xb39c('0x33')](_0x260fbf[_0xb39c('0x2e')][_0xb39c('0x33')]));_0x1e9893[_0xb39c('0x32')]=_0x1e9893['attributes'][_0xb39c('0x34')]?_0x1e9893[_0xb39c('0x32')]:_0x15534c[_0xb39c('0x2d')];if(!_0x260fbf[_0xb39c('0x2e')][_0xb39c('0x35')]('nolimit')){_0x1e9893['limit']=qs[_0xb39c('0x1c')](_0x260fbf[_0xb39c('0x2e')][_0xb39c('0x1c')]);_0x1e9893['offset']=qs[_0xb39c('0x1a')](_0x260fbf['query'][_0xb39c('0x1a')]);}_0x1e9893['order']=qs[_0xb39c('0x38')](_0x260fbf[_0xb39c('0x2e')][_0xb39c('0x38')]);_0x1e9893['where']=qs[_0xb39c('0x30')](_[_0xb39c('0x3a')](_0x260fbf[_0xb39c('0x2e')],_0x15534c[_0xb39c('0x30')]));if(_0x260fbf[_0xb39c('0x2e')][_0xb39c('0x3b')]){_0x1e9893[_0xb39c('0x39')]=_[_0xb39c('0x3c')](_0x1e9893[_0xb39c('0x39')],{'$or':_[_0xb39c('0x28')](_0x1e9893[_0xb39c('0x32')],function(_0x227152){var _0x3fb267={};_0x3fb267[_0x227152]={'$like':'%'+_0x260fbf[_0xb39c('0x2e')][_0xb39c('0x3b')]+'%'};return _0x3fb267;})});}_0x1e9893[_0xb39c('0x39')]=_[_0xb39c('0x3c')](_0x1e9893['where'],{'mailboxuser':_0x49f118[_0xb39c('0x52')]});_0x1e9893=_[_0xb39c('0x3c')]({},_0x1e9893,_0x260fbf[_0xb39c('0x3d')]);return db['VoiceMailMessage'][_0xb39c('0x53')](_0x1e9893)['then'](respondWithFilteredResult(_0x2620ee,_0x1e9893));})['catch'](handleError(_0x2620ee,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index ca163ed..8fdbf8c 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 _0x3ea0=['exports','define','voice_voicemail','mailbox_context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4a0cf0,_0x5e4f8a){var _0x4ff021=function(_0x8bb792){while(--_0x8bb792){_0x4a0cf0['push'](_0x4a0cf0['shift']());}};_0x4ff021(++_0x5e4f8a);}(_0x3ea0,0x115));var _0x03ea=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x3ea0[_0x243217];return _0x478029;};'use strict';var _=require(_0x03ea('0x0'));var util=require(_0x03ea('0x1'));var logger=require(_0x03ea('0x2'))(_0x03ea('0x3'));var moment=require(_0x03ea('0x4'));var BPromise=require(_0x03ea('0x5'));var rp=require(_0x03ea('0x6'));var fs=require('fs');var path=require(_0x03ea('0x7'));var rimraf=require('rimraf');var config=require(_0x03ea('0x8'));var attributes=require('./voiceMail.attributes');module[_0x03ea('0x9')]=function(_0x19666c,_0x2826db){return _0x19666c[_0x03ea('0xa')]('VoiceMail',attributes,{'tableName':_0x03ea('0xb'),'paranoid':![],'indexes':[{'name':_0x03ea('0xc'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd324=['VoiceMail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd324,0x1be));var _0x4d32=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0xd324[_0xf4666e];return _0x1853f1;};'use strict';var _=require(_0x4d32('0x0'));var util=require(_0x4d32('0x1'));var logger=require(_0x4d32('0x2'))(_0x4d32('0x3'));var moment=require(_0x4d32('0x4'));var BPromise=require(_0x4d32('0x5'));var rp=require(_0x4d32('0x6'));var fs=require('fs');var path=require(_0x4d32('0x7'));var rimraf=require(_0x4d32('0x8'));var config=require(_0x4d32('0x9'));var attributes=require(_0x4d32('0xa'));module[_0x4d32('0xb')]=function(_0x2d672c,_0x117689){return _0x2d672c[_0x4d32('0xc')](_0x4d32('0xd'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x4d32('0xe'),'fields':[_0x4d32('0xf'),_0x4d32('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 1d66617..d744ef9 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 _0xf811=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4ae0e7,_0x2968b9){var _0x52b0fd=function(_0x3eb1cc){while(--_0x3eb1cc){_0x4ae0e7['push'](_0x4ae0e7['shift']());}};_0x52b0fd(++_0x2968b9);}(_0xf811,0xea));var _0x1f81=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xf811[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var moment=require(_0x1f81('0x2'));var BPromise=require(_0x1f81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f81('0x4'));var db=require(_0x1f81('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f81('0x6'))(_0x1f81('0x7'));var config=require(_0x1f81('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1f81('0x9')][_0x1f81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b5d53,_0x38fc19,_0x5a093f){return new BPromise(function(_0x185296,_0x2a9c41){return client[_0x1f81('0xb')](_0x5b5d53,_0x5a093f)['then'](function(_0x9e98af){logger[_0x1f81('0xc')](_0x1f81('0xd'),_0x38fc19,_0x1f81('0xe'));logger[_0x1f81('0xf')](_0x1f81('0x10'),_0x38fc19,_0x1f81('0xe'),JSON[_0x1f81('0x11')](_0x9e98af));if(_0x9e98af[_0x1f81('0x12')]){if(_0x9e98af[_0x1f81('0x12')][_0x1f81('0x13')]===0x1f4){logger[_0x1f81('0x12')](_0x1f81('0xd'),_0x38fc19,_0x9e98af[_0x1f81('0x12')][_0x1f81('0x14')]);return _0x2a9c41(_0x9e98af[_0x1f81('0x12')][_0x1f81('0x14')]);}logger['error'](_0x1f81('0xd'),_0x38fc19,_0x9e98af[_0x1f81('0x12')]['message']);return _0x185296(_0x9e98af[_0x1f81('0x12')][_0x1f81('0x14')]);}else{logger[_0x1f81('0xc')](_0x1f81('0xd'),_0x38fc19,_0x1f81('0xe'));_0x185296(_0x9e98af[_0x1f81('0x15')]['message']);}})[_0x1f81('0x16')](function(_0x3a028c){logger[_0x1f81('0x12')](_0x1f81('0xd'),_0x38fc19,_0x3a028c);_0x2a9c41(_0x3a028c);});});} \ No newline at end of file +var _0x205f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x4e545f,_0x387310){var _0x31b2ba=function(_0x3b476e){while(--_0x3b476e){_0x4e545f['push'](_0x4e545f['shift']());}};_0x31b2ba(++_0x387310);}(_0x205f,0xbc));var _0xf205=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0x205f[_0x304b67];return _0x493afb;};'use strict';var _=require(_0xf205('0x0'));var util=require(_0xf205('0x1'));var moment=require(_0xf205('0x2'));var BPromise=require(_0xf205('0x3'));var rs=require(_0xf205('0x4'));var fs=require('fs');var Redis=require(_0xf205('0x5'));var db=require(_0xf205('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf205('0x7'));var config=require(_0xf205('0x8'));var jayson=require(_0xf205('0x9'));var client=jayson[_0xf205('0xa')][_0xf205('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54641b,_0x133aa1,_0x4f2504){return new BPromise(function(_0x2d1f6a,_0x3511ef){return client[_0xf205('0xc')](_0x54641b,_0x4f2504)['then'](function(_0x571e05){logger[_0xf205('0xd')](_0xf205('0xe'),_0x133aa1,_0xf205('0xf'));logger['debug'](_0xf205('0x10'),_0x133aa1,'request\x20sent',JSON['stringify'](_0x571e05));if(_0x571e05[_0xf205('0x11')]){if(_0x571e05[_0xf205('0x11')]['code']===0x1f4){logger[_0xf205('0x11')](_0xf205('0xe'),_0x133aa1,_0x571e05[_0xf205('0x11')]['message']);return _0x3511ef(_0x571e05['error'][_0xf205('0x12')]);}logger[_0xf205('0x11')](_0xf205('0xe'),_0x133aa1,_0x571e05[_0xf205('0x11')][_0xf205('0x12')]);return _0x2d1f6a(_0x571e05[_0xf205('0x11')][_0xf205('0x12')]);}else{logger[_0xf205('0xd')](_0xf205('0xe'),_0x133aa1,_0xf205('0xf'));_0x2d1f6a(_0x571e05[_0xf205('0x13')][_0xf205('0x12')]);}})[_0xf205('0x14')](function(_0x48d69f){logger[_0xf205('0x11')]('VoiceMail,\x20%s,\x20%s',_0x133aa1,_0x48d69f);_0x3511ef(_0x48d69f);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 09bfb1d..17a1734 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 _0x8582=['download','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0xebc7,_0x2f089b){var _0x18219e=function(_0x2955c6){while(--_0x2955c6){_0xebc7['push'](_0xebc7['shift']());}};_0x18219e(++_0x2f089b);}(_0x8582,0x104));var _0x2858=function(_0x1661eb,_0x4f45d1){_0x1661eb=_0x1661eb-0x0;var _0x38d61c=_0x8582[_0x1661eb];return _0x38d61c;};'use strict';var multer=require(_0x2858('0x0'));var util=require(_0x2858('0x1'));var path=require(_0x2858('0x2'));var timeout=require(_0x2858('0x3'));var express=require(_0x2858('0x4'));var router=express['Router']();var fs_extra=require(_0x2858('0x5'));var auth=require(_0x2858('0x6'));var interaction=require(_0x2858('0x7'));var config=require(_0x2858('0x8'));var controller=require(_0x2858('0x9'));router[_0x2858('0xa')]('/',auth[_0x2858('0xb')](),controller[_0x2858('0xc')]);router[_0x2858('0xa')](_0x2858('0xd'),auth[_0x2858('0xb')](),controller[_0x2858('0xe')]);router[_0x2858('0xa')](_0x2858('0xf'),auth['isAuthenticated'](),controller[_0x2858('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2858('0x11')]);router[_0x2858('0x12')](_0x2858('0xd'),auth['isAuthenticated'](),controller[_0x2858('0x13')]);router[_0x2858('0x14')](_0x2858('0xd'),auth['isAuthenticated'](),controller[_0x2858('0x15')]);module[_0x2858('0x16')]=router; \ No newline at end of file +var _0xeeb9=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','index','get','/:id','isAuthenticated','/:id/download','download','post','put','update','delete','destroy'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0xeeb9,0xe8));var _0x9eeb=function(_0x7bda05,_0x5b9194){_0x7bda05=_0x7bda05-0x0;var _0x30136b=_0xeeb9[_0x7bda05];return _0x30136b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9eeb('0x0'));var timeout=require(_0x9eeb('0x1'));var express=require(_0x9eeb('0x2'));var router=express[_0x9eeb('0x3')]();var fs_extra=require(_0x9eeb('0x4'));var auth=require(_0x9eeb('0x5'));var interaction=require(_0x9eeb('0x6'));var config=require(_0x9eeb('0x7'));var controller=require(_0x9eeb('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9eeb('0x9')]);router[_0x9eeb('0xa')](_0x9eeb('0xb'),auth[_0x9eeb('0xc')](),controller['show']);router[_0x9eeb('0xa')](_0x9eeb('0xd'),auth[_0x9eeb('0xc')](),controller[_0x9eeb('0xe')]);router[_0x9eeb('0xf')]('/',auth[_0x9eeb('0xc')](),controller['create']);router[_0x9eeb('0x10')](_0x9eeb('0xb'),auth[_0x9eeb('0xc')](),controller[_0x9eeb('0x11')]);router[_0x9eeb('0x12')](_0x9eeb('0xb'),auth['isAuthenticated'](),controller[_0x9eeb('0x13')]);module[_0x9eeb('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 9a89626..057d472 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 _0x7887=['STRING','BLOB','long','TIMESTAMP','literal','sequelize','exports','VIRTUAL'];(function(_0x3d5b75,_0x179ff7){var _0x2fa864=function(_0x6101ce){while(--_0x6101ce){_0x3d5b75['push'](_0x3d5b75['shift']());}};_0x2fa864(++_0x179ff7);}(_0x7887,0x75));var _0x7788=function(_0x45f078,_0x1c877f){_0x45f078=_0x45f078-0x0;var _0x4728b7=_0x7887[_0x45f078];return _0x4728b7;};'use strict';var Sequelize=require(_0x7788('0x0'));module[_0x7788('0x1')]={'name':{'type':Sequelize[_0x7788('0x2')],'get':function(_0x5f5628){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x7788('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x7788('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x7788('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x7788('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x7788('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x7788('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x7788('0x4')](_0x7788('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x7788('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x7788('0x3')],'defaultValue':''},'stamp':{'type':_0x7788('0x6'),'defaultValue':Sequelize[_0x7788('0x7')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x782b=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB'];(function(_0x51aa33,_0x495c){var _0x2093cd=function(_0x24518c){while(--_0x24518c){_0x51aa33['push'](_0x51aa33['shift']());}};_0x2093cd(++_0x495c);}(_0x782b,0xbf));var _0xb782=function(_0x291e3e,_0x5728cf){_0x291e3e=_0x291e3e-0x0;var _0xf4b415=_0x782b[_0x291e3e];return _0xf4b415;};'use strict';var Sequelize=require(_0xb782('0x0'));module[_0xb782('0x1')]={'name':{'type':Sequelize[_0xb782('0x2')],'get':function(_0x105624){return this[_0xb782('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xb782('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xb782('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb782('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb782('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb782('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xb782('0x6')](_0xb782('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb782('0x5')],'defaultValue':''},'stamp':{'type':_0xb782('0x8'),'defaultValue':Sequelize[_0xb782('0x9')](_0xb782('0xa'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index e6c2b7d..1cab0f4 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 _0x38b1=['then','error','stack','name','send','index','map','fieldName','type','model','differenceBy','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','rows','catch','show','params','keys','VoiceMailMessage','rawAttributes','includeAll','include','find','create','body','destroy','download','recording','msg_id','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x38b1,0x125));var _0x138b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x38b1[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x138b('0x0'));var rimraf=require(_0x138b('0x1'));var zipdir=require(_0x138b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x138b('0x3'));var Mustache=require(_0x138b('0x4'));var util=require(_0x138b('0x5'));var path=require(_0x138b('0x6'));var sox=require(_0x138b('0x7'));var csv=require(_0x138b('0x8'));var ejs=require(_0x138b('0x9'));var fs=require('fs');var fs_extra=require(_0x138b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x138b('0xb'));var jsforce=require(_0x138b('0xc'));var deskjs=require(_0x138b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x138b('0xe'));var Papa=require(_0x138b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x138b('0x10'));var as=require(_0x138b('0x11'));var hardwareService=require(_0x138b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x138b('0x13'));var config=require(_0x138b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x138b('0x15'))['db'];function respondWithStatusCode(_0x2eb20e,_0xfcefae){_0xfcefae=_0xfcefae||0xcc;return function(_0x3e40cb){if(_0x3e40cb){return _0x2eb20e[_0x138b('0x16')](_0xfcefae);}return _0x2eb20e[_0x138b('0x17')](_0xfcefae)[_0x138b('0x18')]();};}function respondWithResult(_0xc4dacc,_0x4236e4){_0x4236e4=_0x4236e4||0xc8;return function(_0x11b486){if(_0x11b486){return _0xc4dacc[_0x138b('0x17')](_0x4236e4)[_0x138b('0x19')](_0x11b486);}};}function respondWithFilteredResult(_0x578e15,_0x209643){return function(_0x3bb16a){if(_0x3bb16a){var _0x24b461=typeof _0x209643['offset']==='undefined'&&typeof _0x209643[_0x138b('0x1a')]===_0x138b('0x1b');var _0x5e8920=_0x3bb16a[_0x138b('0x1c')];var _0x449389=_0x24b461?0x0:_0x209643['offset'];var _0x4abe29=_0x24b461?_0x3bb16a[_0x138b('0x1c')]:_0x209643[_0x138b('0x1d')]+_0x209643[_0x138b('0x1a')];var _0x5c6359;if(_0x4abe29>=_0x5e8920){_0x4abe29=_0x5e8920;_0x5c6359=0xc8;}else{_0x5c6359=0xce;}_0x578e15[_0x138b('0x17')](_0x5c6359);return _0x578e15[_0x138b('0x1e')](_0x138b('0x1f'),_0x449389+'-'+_0x4abe29+'/'+_0x5e8920)[_0x138b('0x19')](_0x3bb16a);}return null;};}function patchUpdates(_0x4bd084){return function(_0x246407){try{jsonpatch[_0x138b('0x20')](_0x246407,_0x4bd084,!![]);}catch(_0x59dfec){return BPromise['reject'](_0x59dfec);}return _0x246407[_0x138b('0x21')]();};}function saveUpdates(_0x3ceafb,_0x4f0ca2){return function(_0x74929e){if(_0x74929e){return _0x74929e[_0x138b('0x22')](_0x3ceafb)['then'](function(_0x3a42e4){return _0x3a42e4;});}return null;};}function removeEntity(_0x5cd272,_0x49a702){return function(_0x2d9cd6){if(_0x2d9cd6){return _0x2d9cd6['destroy']()[_0x138b('0x23')](function(){_0x5cd272['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4985f4,_0x2875aa){return function(_0x125217){if(!_0x125217){_0x4985f4[_0x138b('0x16')](0x194);}return _0x125217;};}function handleError(_0x325621,_0x49502a){_0x49502a=_0x49502a||0x1f4;return function(_0x38fef0){logger[_0x138b('0x24')](_0x38fef0[_0x138b('0x25')]);if(_0x38fef0['name']){delete _0x38fef0[_0x138b('0x26')];}_0x325621[_0x138b('0x17')](_0x49502a)[_0x138b('0x27')](_0x38fef0);};}exports[_0x138b('0x28')]=function(_0x13d4c4,_0x28c835){var _0x3ef302={},_0x5211b1={},_0x17761a={'count':0x0,'rows':[]};var _0x42bfe9=_[_0x138b('0x29')](db['VoiceMailMessage']['rawAttributes'],function(_0x3032e3){return{'name':_0x3032e3[_0x138b('0x2a')],'type':_0x3032e3[_0x138b('0x2b')]['key']};});_0x5211b1[_0x138b('0x2c')]=_[_0x138b('0x2d')](_[_0x138b('0x29')](_0x42bfe9,'name'),['name']);_0x5211b1[_0x138b('0x2e')]=_['keys'](_0x13d4c4['query']);_0x5211b1[_0x138b('0x2f')]=_[_0x138b('0x30')](_0x5211b1[_0x138b('0x2c')],_0x5211b1[_0x138b('0x2e')]);_0x3ef302['attributes']=_[_0x138b('0x30')](_0x5211b1[_0x138b('0x2c')],qs['fields'](_0x13d4c4[_0x138b('0x2e')][_0x138b('0x31')]));_0x3ef302[_0x138b('0x32')]=_0x3ef302['attributes'][_0x138b('0x33')]?_0x3ef302['attributes']:_0x5211b1[_0x138b('0x2c')];if(!_0x13d4c4[_0x138b('0x2e')][_0x138b('0x34')](_0x138b('0x35'))){_0x3ef302[_0x138b('0x1a')]=qs['limit'](_0x13d4c4['query']['limit']);_0x3ef302[_0x138b('0x1d')]=qs[_0x138b('0x1d')](_0x13d4c4[_0x138b('0x2e')][_0x138b('0x1d')]);}_0x3ef302['order']=qs[_0x138b('0x36')](_0x13d4c4[_0x138b('0x2e')][_0x138b('0x36')]);_0x3ef302[_0x138b('0x37')]=qs[_0x138b('0x2f')](_[_0x138b('0x38')](_0x13d4c4[_0x138b('0x2e')],_0x5211b1[_0x138b('0x2f')]),_0x42bfe9);if(_0x13d4c4[_0x138b('0x2e')]['filter']){_0x3ef302['where']=_[_0x138b('0x39')](_0x3ef302[_0x138b('0x37')],{'$or':_[_0x138b('0x29')](_0x42bfe9,function(_0x3a260f){if(_0x3a260f[_0x138b('0x2b')]!=='VIRTUAL'){var _0xd80e72={};_0xd80e72[_0x3a260f[_0x138b('0x26')]]={'$like':'%'+_0x13d4c4[_0x138b('0x2e')][_0x138b('0x3a')]+'%'};return _0xd80e72;}})});}_0x3ef302=_[_0x138b('0x39')]({},_0x3ef302,_0x13d4c4[_0x138b('0x3b')]);var _0xb6f292={'where':_0x3ef302[_0x138b('0x37')]};return db['VoiceMailMessage'][_0x138b('0x1c')](_0xb6f292)['then'](function(_0x33374e){_0x17761a[_0x138b('0x1c')]=_0x33374e;if(_0x13d4c4[_0x138b('0x2e')]['includeAll']){_0x3ef302['include']=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x3ef302);})['then'](function(_0x76b6a2){_0x17761a[_0x138b('0x3c')]=_0x76b6a2;return _0x17761a;})['then'](respondWithFilteredResult(_0x28c835,_0x3ef302))[_0x138b('0x3d')](handleError(_0x28c835,null));};exports[_0x138b('0x3e')]=function(_0x433a28,_0x583b5d){var _0x631176={'raw':!![],'where':{'id':_0x433a28[_0x138b('0x3f')]['id']}},_0x1ee6b9={};_0x1ee6b9[_0x138b('0x2c')]=_[_0x138b('0x40')](db[_0x138b('0x41')][_0x138b('0x42')]);_0x1ee6b9['query']=_['keys'](_0x433a28['query']);_0x1ee6b9['filters']=_['intersection'](_0x1ee6b9['model'],_0x1ee6b9[_0x138b('0x2e')]);_0x631176[_0x138b('0x32')]=_[_0x138b('0x30')](_0x1ee6b9['model'],qs[_0x138b('0x31')](_0x433a28['query'][_0x138b('0x31')]));_0x631176['attributes']=_0x631176[_0x138b('0x32')][_0x138b('0x33')]?_0x631176[_0x138b('0x32')]:_0x1ee6b9[_0x138b('0x2c')];if(_0x433a28[_0x138b('0x2e')][_0x138b('0x43')]){_0x631176[_0x138b('0x44')]=[{'all':!![]}];}_0x631176=_[_0x138b('0x39')]({},_0x631176,_0x433a28['options']);return db['VoiceMailMessage'][_0x138b('0x45')](_0x631176)['then'](handleEntityNotFound(_0x583b5d,null))[_0x138b('0x23')](respondWithResult(_0x583b5d,null))['catch'](handleError(_0x583b5d,null));};exports[_0x138b('0x46')]=function(_0xdae3a8,_0x2847fe){return db[_0x138b('0x41')][_0x138b('0x46')](_0xdae3a8[_0x138b('0x47')],{})[_0x138b('0x23')](respondWithResult(_0x2847fe,0xc9))[_0x138b('0x3d')](handleError(_0x2847fe,null));};exports[_0x138b('0x22')]=function(_0x41ca9f,_0x1df555){if(_0x41ca9f[_0x138b('0x47')]['id']){delete _0x41ca9f[_0x138b('0x47')]['id'];}return db[_0x138b('0x41')][_0x138b('0x45')]({'where':{'id':_0x41ca9f[_0x138b('0x3f')]['id']}})[_0x138b('0x23')](handleEntityNotFound(_0x1df555,null))[_0x138b('0x23')](saveUpdates(_0x41ca9f['body'],null))[_0x138b('0x23')](respondWithResult(_0x1df555,null))[_0x138b('0x3d')](handleError(_0x1df555,null));};exports[_0x138b('0x48')]=function(_0x4dcee7,_0x41a493){return db['VoiceMailMessage'][_0x138b('0x45')]({'where':{'id':_0x4dcee7[_0x138b('0x3f')]['id']}})[_0x138b('0x23')](handleEntityNotFound(_0x41a493,null))[_0x138b('0x23')](removeEntity(_0x41a493,null))[_0x138b('0x3d')](handleError(_0x41a493,null));};exports[_0x138b('0x49')]=function(_0x107660,_0x3c24e2,_0x36c221){return db[_0x138b('0x41')][_0x138b('0x45')]({'where':{'id':_0x107660['params']['id']},'attributes':['id',_0x138b('0x4a'),_0x138b('0x4b')]})[_0x138b('0x23')](handleEntityNotFound(_0x3c24e2,null))[_0x138b('0x23')](function(_0x519902){if(_0x519902){if(!_0x519902['recording']){throw new db['Sequelize'][(_0x138b('0x4c'))]('VoiceMailMessage\x20not\x20found');}var _0xf69d0e={'Content-Type':_0x138b('0x4d'),'Content-Disposition':_0x138b('0x4e')};if(_0x519902[_0x138b('0x4b')]){_0xf69d0e[_0x138b('0x4f')]=_0x138b('0x50')+_0x519902[_0x138b('0x4b')]+_0x138b('0x51');}_0x3c24e2['set'](_0xf69d0e);return _0x3c24e2[_0x138b('0x27')](new Buffer(_0x519902[_0x138b('0x4a')]));}})[_0x138b('0x3d')](handleError(_0x3c24e2,null));}; \ No newline at end of file +var _0x62e5=['order','sort','where','merge','VIRTUAL','filter','includeAll','include','VoiceMailMessage','options','catch','create','body','find','params','download','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','send','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x62e5,0x165));var _0x562e=function(_0x2aea02,_0x553a02){_0x2aea02=_0x2aea02-0x0;var _0x1a7c91=_0x62e5[_0x2aea02];return _0x1a7c91;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x562e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x562e('0x1'));var BPromise=require(_0x562e('0x2'));var Mustache=require(_0x562e('0x3'));var util=require(_0x562e('0x4'));var path=require(_0x562e('0x5'));var sox=require(_0x562e('0x6'));var csv=require(_0x562e('0x7'));var ejs=require(_0x562e('0x8'));var fs=require('fs');var fs_extra=require(_0x562e('0x9'));var _=require(_0x562e('0xa'));var squel=require(_0x562e('0xb'));var crypto=require(_0x562e('0xc'));var jsforce=require(_0x562e('0xd'));var deskjs=require(_0x562e('0xe'));var toCsv=require(_0x562e('0x7'));var querystring=require(_0x562e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x562e('0x10'));var qs=require(_0x562e('0x11'));var as=require(_0x562e('0x12'));var hardwareService=require(_0x562e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x562e('0x14'));var config=require(_0x562e('0x15'));var licenseUtil=require(_0x562e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e7c7e,_0x3cd697){_0x3cd697=_0x3cd697||0xcc;return function(_0x354759){if(_0x354759){return _0x5e7c7e[_0x562e('0x17')](_0x3cd697);}return _0x5e7c7e[_0x562e('0x18')](_0x3cd697)[_0x562e('0x19')]();};}function respondWithResult(_0x29ef2f,_0x276ddd){_0x276ddd=_0x276ddd||0xc8;return function(_0x518e42){if(_0x518e42){return _0x29ef2f[_0x562e('0x18')](_0x276ddd)[_0x562e('0x1a')](_0x518e42);}};}function respondWithFilteredResult(_0x7b5b3c,_0x42dd58){return function(_0x48fb68){if(_0x48fb68){var _0x2addab=typeof _0x42dd58[_0x562e('0x1b')]===_0x562e('0x1c')&&typeof _0x42dd58[_0x562e('0x1d')]===_0x562e('0x1c');var _0x12d038=_0x48fb68[_0x562e('0x1e')];var _0x2c68eb=_0x2addab?0x0:_0x42dd58[_0x562e('0x1b')];var _0x4109b8=_0x2addab?_0x48fb68[_0x562e('0x1e')]:_0x42dd58[_0x562e('0x1b')]+_0x42dd58[_0x562e('0x1d')];var _0x5db906;if(_0x4109b8>=_0x12d038){_0x4109b8=_0x12d038;_0x5db906=0xc8;}else{_0x5db906=0xce;}_0x7b5b3c[_0x562e('0x18')](_0x5db906);return _0x7b5b3c[_0x562e('0x1f')](_0x562e('0x20'),_0x2c68eb+'-'+_0x4109b8+'/'+_0x12d038)[_0x562e('0x1a')](_0x48fb68);}return null;};}function patchUpdates(_0x5b0d7a){return function(_0x4e9a5a){try{jsonpatch[_0x562e('0x21')](_0x4e9a5a,_0x5b0d7a,!![]);}catch(_0x22f4b9){return BPromise[_0x562e('0x22')](_0x22f4b9);}return _0x4e9a5a[_0x562e('0x23')]();};}function saveUpdates(_0x391d15,_0x1d01a0){return function(_0xa32d33){if(_0xa32d33){return _0xa32d33[_0x562e('0x24')](_0x391d15)[_0x562e('0x25')](function(_0xae3d32){return _0xae3d32;});}return null;};}function removeEntity(_0x9895bf,_0x41b5d3){return function(_0x42053a){if(_0x42053a){return _0x42053a[_0x562e('0x26')]()[_0x562e('0x25')](function(){_0x9895bf[_0x562e('0x18')](0xcc)[_0x562e('0x19')]();});}};}function handleEntityNotFound(_0x40f91f,_0x236225){return function(_0x295995){if(!_0x295995){_0x40f91f['sendStatus'](0x194);}return _0x295995;};}function handleError(_0x510164,_0x43eca4){_0x43eca4=_0x43eca4||0x1f4;return function(_0x17a4d6){logger[_0x562e('0x27')](_0x17a4d6[_0x562e('0x28')]);if(_0x17a4d6[_0x562e('0x29')]){delete _0x17a4d6[_0x562e('0x29')];}_0x510164[_0x562e('0x18')](_0x43eca4)['send'](_0x17a4d6);};}exports['index']=function(_0x5a1b33,_0x5e17f0){var _0x162d07={},_0x253f08={},_0x198a42={'count':0x0,'rows':[]};var _0x352e2a=_['map'](db['VoiceMailMessage'][_0x562e('0x2a')],function(_0xf8125){return{'name':_0xf8125[_0x562e('0x2b')],'type':_0xf8125[_0x562e('0x2c')][_0x562e('0x2d')]};});_0x253f08[_0x562e('0x2e')]=_[_0x562e('0x2f')](_[_0x562e('0x30')](_0x352e2a,_0x562e('0x29')),[_0x562e('0x29')]);_0x253f08[_0x562e('0x31')]=_[_0x562e('0x32')](_0x5a1b33[_0x562e('0x31')]);_0x253f08[_0x562e('0x33')]=_[_0x562e('0x34')](_0x253f08[_0x562e('0x2e')],_0x253f08['query']);_0x162d07[_0x562e('0x35')]=_['intersection'](_0x253f08[_0x562e('0x2e')],qs[_0x562e('0x36')](_0x5a1b33['query'][_0x562e('0x36')]));_0x162d07['attributes']=_0x162d07[_0x562e('0x35')][_0x562e('0x37')]?_0x162d07['attributes']:_0x253f08['model'];if(!_0x5a1b33['query'][_0x562e('0x38')](_0x562e('0x39'))){_0x162d07['limit']=qs[_0x562e('0x1d')](_0x5a1b33[_0x562e('0x31')]['limit']);_0x162d07['offset']=qs[_0x562e('0x1b')](_0x5a1b33[_0x562e('0x31')][_0x562e('0x1b')]);}_0x162d07[_0x562e('0x3a')]=qs[_0x562e('0x3b')](_0x5a1b33[_0x562e('0x31')][_0x562e('0x3b')]);_0x162d07[_0x562e('0x3c')]=qs[_0x562e('0x33')](_['pick'](_0x5a1b33[_0x562e('0x31')],_0x253f08['filters']),_0x352e2a);if(_0x5a1b33[_0x562e('0x31')]['filter']){_0x162d07[_0x562e('0x3c')]=_[_0x562e('0x3d')](_0x162d07['where'],{'$or':_[_0x562e('0x30')](_0x352e2a,function(_0x48301e){if(_0x48301e['type']!==_0x562e('0x3e')){var _0x339237={};_0x339237[_0x48301e[_0x562e('0x29')]]={'$like':'%'+_0x5a1b33['query'][_0x562e('0x3f')]+'%'};return _0x339237;}})});}_0x162d07=_[_0x562e('0x3d')]({},_0x162d07,_0x5a1b33['options']);var _0x5ae0af={'where':_0x162d07['where']};return db['VoiceMailMessage'][_0x562e('0x1e')](_0x5ae0af)['then'](function(_0x2f77dc){_0x198a42[_0x562e('0x1e')]=_0x2f77dc;if(_0x5a1b33[_0x562e('0x31')][_0x562e('0x40')]){_0x162d07[_0x562e('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x162d07);})[_0x562e('0x25')](function(_0xd59dd9){_0x198a42['rows']=_0xd59dd9;return _0x198a42;})['then'](respondWithFilteredResult(_0x5e17f0,_0x162d07))['catch'](handleError(_0x5e17f0,null));};exports['show']=function(_0x41f6c6,_0x131017){var _0x12a3dd={'raw':!![],'where':{'id':_0x41f6c6['params']['id']}},_0x864d79={};_0x864d79[_0x562e('0x2e')]=_['keys'](db[_0x562e('0x42')]['rawAttributes']);_0x864d79[_0x562e('0x31')]=_['keys'](_0x41f6c6[_0x562e('0x31')]);_0x864d79['filters']=_['intersection'](_0x864d79[_0x562e('0x2e')],_0x864d79['query']);_0x12a3dd['attributes']=_[_0x562e('0x34')](_0x864d79['model'],qs['fields'](_0x41f6c6['query'][_0x562e('0x36')]));_0x12a3dd[_0x562e('0x35')]=_0x12a3dd[_0x562e('0x35')][_0x562e('0x37')]?_0x12a3dd[_0x562e('0x35')]:_0x864d79[_0x562e('0x2e')];if(_0x41f6c6[_0x562e('0x31')][_0x562e('0x40')]){_0x12a3dd[_0x562e('0x41')]=[{'all':!![]}];}_0x12a3dd=_[_0x562e('0x3d')]({},_0x12a3dd,_0x41f6c6[_0x562e('0x43')]);return db[_0x562e('0x42')]['find'](_0x12a3dd)[_0x562e('0x25')](handleEntityNotFound(_0x131017,null))[_0x562e('0x25')](respondWithResult(_0x131017,null))[_0x562e('0x44')](handleError(_0x131017,null));};exports[_0x562e('0x45')]=function(_0x345b55,_0x7fcad9){return db[_0x562e('0x42')][_0x562e('0x45')](_0x345b55['body'],{})['then'](respondWithResult(_0x7fcad9,0xc9))['catch'](handleError(_0x7fcad9,null));};exports[_0x562e('0x24')]=function(_0x20e742,_0x1266e4){if(_0x20e742['body']['id']){delete _0x20e742[_0x562e('0x46')]['id'];}return db[_0x562e('0x42')][_0x562e('0x47')]({'where':{'id':_0x20e742[_0x562e('0x48')]['id']}})['then'](handleEntityNotFound(_0x1266e4,null))[_0x562e('0x25')](saveUpdates(_0x20e742[_0x562e('0x46')],null))[_0x562e('0x25')](respondWithResult(_0x1266e4,null))['catch'](handleError(_0x1266e4,null));};exports[_0x562e('0x26')]=function(_0x1a00a0,_0x5434d4){return db['VoiceMailMessage'][_0x562e('0x47')]({'where':{'id':_0x1a00a0[_0x562e('0x48')]['id']}})['then'](handleEntityNotFound(_0x5434d4,null))[_0x562e('0x25')](removeEntity(_0x5434d4,null))[_0x562e('0x44')](handleError(_0x5434d4,null));};exports[_0x562e('0x49')]=function(_0x1774af,_0x330f7d,_0x2f8a0d){return db[_0x562e('0x42')][_0x562e('0x47')]({'where':{'id':_0x1774af[_0x562e('0x48')]['id']},'attributes':['id',_0x562e('0x4a'),_0x562e('0x4b')]})[_0x562e('0x25')](handleEntityNotFound(_0x330f7d,null))['then'](function(_0x29bb91){if(_0x29bb91){if(!_0x29bb91[_0x562e('0x4a')]){throw new db[(_0x562e('0x4c'))][(_0x562e('0x4d'))]('VoiceMailMessage\x20not\x20found');}var _0x542576={'Content-Type':_0x562e('0x4e'),'Content-Disposition':_0x562e('0x4f')};if(_0x29bb91[_0x562e('0x4b')]){_0x542576['Content-Disposition']=_0x562e('0x50')+_0x29bb91[_0x562e('0x4b')]+_0x562e('0x51');}_0x330f7d[_0x562e('0x1f')](_0x542576);return _0x330f7d[_0x562e('0x52')](new Buffer(_0x29bb91['recording']));}})['catch'](handleError(_0x330f7d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 3f2bcde..e19a402 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 _0x039c=['request-promise','rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment'];(function(_0xe1cfe1,_0x186630){var _0xc7e89f=function(_0x2d603e){while(--_0x2d603e){_0xe1cfe1['push'](_0xe1cfe1['shift']());}};_0xc7e89f(++_0x186630);}(_0x039c,0x167));var _0xc039=function(_0x2bdc09,_0x2ed262){_0x2bdc09=_0x2bdc09-0x0;var _0x390d80=_0x039c[_0x2bdc09];return _0x390d80;};'use strict';var _=require(_0xc039('0x0'));var util=require(_0xc039('0x1'));var logger=require(_0xc039('0x2'))(_0xc039('0x3'));var moment=require(_0xc039('0x4'));var BPromise=require('bluebird');var rp=require(_0xc039('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc039('0x6'));var config=require(_0xc039('0x7'));var attributes=require('./voiceMailMessage.attributes');module[_0xc039('0x8')]=function(_0x245573,_0x1bad60){return _0x245573[_0xc039('0x9')](_0xc039('0xa'),attributes,{'tableName':_0xc039('0xb'),'paranoid':![],'indexes':[{'name':_0xc039('0xc'),'fields':[_0xc039('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x8527=['bluebird','request-promise','rimraf','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api','moment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8527,0x9c));var _0x7852=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0x8527[_0x55ef8b];return _0x359c84;};'use strict';var _=require('lodash');var util=require(_0x7852('0x0'));var logger=require(_0x7852('0x1'))(_0x7852('0x2'));var moment=require(_0x7852('0x3'));var BPromise=require(_0x7852('0x4'));var rp=require(_0x7852('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7852('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x1ac88f,_0x168db6){return _0x1ac88f['define'](_0x7852('0x7'),attributes,{'tableName':_0x7852('0x8'),'paranoid':![],'indexes':[{'name':_0x7852('0x9'),'fields':[_0x7852('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index cb9ea0d..4c89e5d 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 _0x06e1=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x470725,_0x1bdde0){var _0x1d454c=function(_0x4ca087){while(--_0x4ca087){_0x470725['push'](_0x470725['shift']());}};_0x1d454c(++_0x1bdde0);}(_0x06e1,0x14c));var _0x106e=function(_0x4f49ac,_0x22c659){_0x4f49ac=_0x4f49ac-0x0;var _0x25bb95=_0x06e1[_0x4f49ac];return _0x25bb95;};'use strict';var _=require(_0x106e('0x0'));var util=require(_0x106e('0x1'));var moment=require(_0x106e('0x2'));var BPromise=require('bluebird');var rs=require(_0x106e('0x3'));var fs=require('fs');var Redis=require(_0x106e('0x4'));var db=require(_0x106e('0x5'))['db'];var utils=require(_0x106e('0x6'));var logger=require('../../config/logger')(_0x106e('0x7'));var config=require(_0x106e('0x8'));var jayson=require(_0x106e('0x9'));var client=jayson['client'][_0x106e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1af518,_0x563407,_0x4cbede){return new BPromise(function(_0x17edff,_0x14d3b1){return client[_0x106e('0xb')](_0x1af518,_0x4cbede)[_0x106e('0xc')](function(_0x328b8a){logger[_0x106e('0xd')](_0x106e('0xe'),_0x563407,'request\x20sent');logger[_0x106e('0xf')](_0x106e('0x10'),_0x563407,_0x106e('0x11'),JSON[_0x106e('0x12')](_0x328b8a));if(_0x328b8a['error']){if(_0x328b8a[_0x106e('0x13')][_0x106e('0x14')]===0x1f4){logger['error'](_0x106e('0xe'),_0x563407,_0x328b8a[_0x106e('0x13')][_0x106e('0x15')]);return _0x14d3b1(_0x328b8a[_0x106e('0x13')][_0x106e('0x15')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x563407,_0x328b8a[_0x106e('0x13')][_0x106e('0x15')]);return _0x17edff(_0x328b8a[_0x106e('0x13')]['message']);}else{logger[_0x106e('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x563407,_0x106e('0x11'));_0x17edff(_0x328b8a[_0x106e('0x16')][_0x106e('0x15')]);}})[_0x106e('0x17')](function(_0x73f3a6){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x563407,_0x73f3a6);_0x14d3b1(_0x73f3a6);});});} \ No newline at end of file +var _0x4652=['VoiceMailMessage,\x20%s,\x20%s','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','stringify','code','error','message'];(function(_0x1f3c56,_0x598757){var _0x569524=function(_0x345301){while(--_0x345301){_0x1f3c56['push'](_0x1f3c56['shift']());}};_0x569524(++_0x598757);}(_0x4652,0x17c));var _0x2465=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4652[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x2465('0x0'));var moment=require(_0x2465('0x1'));var BPromise=require(_0x2465('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2465('0x3'));var db=require(_0x2465('0x4'))['db'];var utils=require(_0x2465('0x5'));var logger=require(_0x2465('0x6'))(_0x2465('0x7'));var config=require(_0x2465('0x8'));var jayson=require(_0x2465('0x9'));var client=jayson['client'][_0x2465('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x128fc9,_0x1bd775,_0x57b6d9){return new BPromise(function(_0xa28336,_0x20ebd6){return client[_0x2465('0xb')](_0x128fc9,_0x57b6d9)[_0x2465('0xc')](function(_0x47f5e3){logger[_0x2465('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x1bd775,_0x2465('0xe'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1bd775,_0x2465('0xe'),JSON[_0x2465('0xf')](_0x47f5e3));if(_0x47f5e3['error']){if(_0x47f5e3['error'][_0x2465('0x10')]===0x1f4){logger[_0x2465('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x1bd775,_0x47f5e3[_0x2465('0x11')][_0x2465('0x12')]);return _0x20ebd6(_0x47f5e3[_0x2465('0x11')][_0x2465('0x12')]);}logger[_0x2465('0x11')](_0x2465('0x13'),_0x1bd775,_0x47f5e3[_0x2465('0x11')][_0x2465('0x12')]);return _0xa28336(_0x47f5e3[_0x2465('0x11')]['message']);}else{logger[_0x2465('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x1bd775,_0x2465('0xe'));_0xa28336(_0x47f5e3[_0x2465('0x14')][_0x2465('0x12')]);}})['catch'](function(_0x3b00ca){logger[_0x2465('0x11')](_0x2465('0x13'),_0x1bd775,_0x3b00ca);_0x20ebd6(_0x3b00ca);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index b3edec7..98beedc 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 _0xe383=['../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','getSounds','post','/:id/sounds','addSound','put','/:id','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x377088,_0x2a3fec){var _0x5674a6=function(_0x3eaff6){while(--_0x3eaff6){_0x377088['push'](_0x377088['shift']());}};_0x5674a6(++_0x2a3fec);}(_0xe383,0x17b));var _0x3e38=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xe383[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require('multer');var util=require(_0x3e38('0x0'));var path=require('path');var timeout=require(_0x3e38('0x1'));var express=require('express');var router=express[_0x3e38('0x2')]();var fs_extra=require(_0x3e38('0x3'));var auth=require(_0x3e38('0x4'));var interaction=require(_0x3e38('0x5'));var config=require(_0x3e38('0x6'));var controller=require(_0x3e38('0x7'));router[_0x3e38('0x8')]('/',auth[_0x3e38('0x9')](),controller[_0x3e38('0xa')]);router[_0x3e38('0x8')]('/:id',auth[_0x3e38('0x9')](),controller[_0x3e38('0xb')]);router[_0x3e38('0x8')]('/:id/sounds',auth[_0x3e38('0x9')](),controller[_0x3e38('0xc')]);router[_0x3e38('0xd')]('/',auth[_0x3e38('0x9')](),controller['create']);router[_0x3e38('0xd')](_0x3e38('0xe'),auth[_0x3e38('0x9')](),controller[_0x3e38('0xf')]);router[_0x3e38('0x10')](_0x3e38('0x11'),auth[_0x3e38('0x9')](),controller[_0x3e38('0x12')]);router['delete']('/:id',auth[_0x3e38('0x9')](),controller[_0x3e38('0x13')]);router[_0x3e38('0x14')](_0x3e38('0x15'),auth[_0x3e38('0x9')](),controller[_0x3e38('0x16')]);module[_0x3e38('0x17')]=router; \ No newline at end of file +var _0x87d1=['index','/:id','isAuthenticated','/:id/sounds','getSounds','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x123d3d,_0x114ea5){var _0x5707bf=function(_0x9e1a39){while(--_0x9e1a39){_0x123d3d['push'](_0x123d3d['shift']());}};_0x5707bf(++_0x114ea5);}(_0x87d1,0xf1));var _0x187d=function(_0x2c7350,_0x35a5a1){_0x2c7350=_0x2c7350-0x0;var _0x2e7dd6=_0x87d1[_0x2c7350];return _0x2e7dd6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x187d('0x0'));var express=require(_0x187d('0x1'));var router=express[_0x187d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x187d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x187d('0x4'));var controller=require('./voiceMusicOnHold.controller');router[_0x187d('0x5')]('/',auth['isAuthenticated'](),controller[_0x187d('0x6')]);router[_0x187d('0x5')](_0x187d('0x7'),auth[_0x187d('0x8')](),controller['show']);router[_0x187d('0x5')](_0x187d('0x9'),auth[_0x187d('0x8')](),controller[_0x187d('0xa')]);router['post']('/',auth[_0x187d('0x8')](),controller['create']);router[_0x187d('0xb')](_0x187d('0x9'),auth[_0x187d('0x8')](),controller[_0x187d('0xc')]);router[_0x187d('0xd')](_0x187d('0x7'),auth[_0x187d('0x8')](),controller[_0x187d('0xe')]);router[_0x187d('0xf')]('/:id',auth[_0x187d('0x8')](),controller[_0x187d('0x10')]);router[_0x187d('0xf')](_0x187d('0x11'),auth[_0x187d('0x8')](),controller['removeSound']);module[_0x187d('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c0e86cb..b65ba34 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 _0x57b0=['name','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x376f18,_0x58c69c){var _0x4cc104=function(_0x4be1d5){while(--_0x4be1d5){_0x376f18['push'](_0x376f18['shift']());}};_0x4cc104(++_0x58c69c);}(_0x57b0,0xda));var _0x057b=function(_0x3856e0,_0x8f4e3){_0x3856e0=_0x3856e0-0x0;var _0x2d188=_0x57b0[_0x3856e0];return _0x2d188;};'use strict';var Sequelize=require(_0x057b('0x0'));module[_0x057b('0x1')]={'name':{'type':Sequelize[_0x057b('0x2')],'allowNull':![],'unique':_0x057b('0x3')},'mode':{'type':Sequelize['ENUM'](_0x057b('0x4'),_0x057b('0x5'),_0x057b('0x6'),_0x057b('0x7'),_0x057b('0x8'),_0x057b('0x9')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x057b('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x057b('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x057b('0x2')],'allowNull':!![],'defaultValue':_0x057b('0xa')},'format':{'type':Sequelize[_0x057b('0x2')],'allowNull':!![]},'stamp':{'type':_0x057b('0xb')},'defaultEntry':{'type':Sequelize[_0x057b('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x627b=['STRING','custom','files','mp3nb','quietmp3nb','mp3','alpha','BOOLEAN','sequelize'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x627b,0x1e5));var _0xb627=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x627b[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require(_0xb627('0x0'));module['exports']={'name':{'type':Sequelize[_0xb627('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0xb627('0x2'),_0xb627('0x3'),_0xb627('0x4'),_0xb627('0x5'),'quietmp3',_0xb627('0x6')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xb627('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb627('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb627('0x1')],'allowNull':!![],'defaultValue':_0xb627('0x7')},'format':{'type':Sequelize[_0xb627('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xb627('0x8')],'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 58865d1..a37137c 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 _0xd3b4=['then','name','index','VoiceMusicOnHold','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','create','transaction','mode','root','files','mkdirSync','directory','user','get','role','UserProfileSection','userProfileId','sequelize','readdirSync','forEach','unlinkSync','join','rmdirSync','ValidationError','message','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','symlinkSync','removeSound','id2','Sequelize','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','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','limit','count','offset','apply','reject','save','update','destroy','UserProfileResource'];(function(_0x2af462,_0xba428e){var _0x37cb1e=function(_0x3d4183){while(--_0x3d4183){_0x2af462['push'](_0x2af462['shift']());}};_0x37cb1e(++_0xba428e);}(_0xd3b4,0x123));var _0x4d3b=function(_0x5a760c,_0x2a4e39){_0x5a760c=_0x5a760c-0x0;var _0x5930a5=_0xd3b4[_0x5a760c];return _0x5930a5;};'use strict';var emlformat=require(_0x4d3b('0x0'));var rimraf=require(_0x4d3b('0x1'));var zipdir=require(_0x4d3b('0x2'));var jsonpatch=require(_0x4d3b('0x3'));var rp=require(_0x4d3b('0x4'));var moment=require(_0x4d3b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4d3b('0x6'));var path=require('path');var sox=require(_0x4d3b('0x7'));var csv=require('to-csv');var ejs=require(_0x4d3b('0x8'));var fs=require('fs');var fs_extra=require(_0x4d3b('0x9'));var _=require(_0x4d3b('0xa'));var squel=require(_0x4d3b('0xb'));var crypto=require(_0x4d3b('0xc'));var jsforce=require(_0x4d3b('0xd'));var deskjs=require(_0x4d3b('0xe'));var toCsv=require(_0x4d3b('0xf'));var querystring=require(_0x4d3b('0x10'));var Papa=require(_0x4d3b('0x11'));var Redis=require(_0x4d3b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4d3b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d3b('0x14'));var logger=require(_0x4d3b('0x15'))(_0x4d3b('0x16'));var utils=require('../../config/utils');var config=require(_0x4d3b('0x17'));var licenseUtil=require(_0x4d3b('0x18'));var db=require(_0x4d3b('0x19'))['db'];function respondWithStatusCode(_0x56478d,_0x489b05){_0x489b05=_0x489b05||0xcc;return function(_0x4cec69){if(_0x4cec69){return _0x56478d[_0x4d3b('0x1a')](_0x489b05);}return _0x56478d[_0x4d3b('0x1b')](_0x489b05)[_0x4d3b('0x1c')]();};}function respondWithResult(_0x2c4b4f,_0x3b880b){_0x3b880b=_0x3b880b||0xc8;return function(_0x2166ad){if(_0x2166ad){return _0x2c4b4f[_0x4d3b('0x1b')](_0x3b880b)[_0x4d3b('0x1d')](_0x2166ad);}};}function respondWithFilteredResult(_0x377734,_0x311364){return function(_0x3d771c){if(_0x3d771c){var _0x20bbd3=typeof _0x311364['offset']==='undefined'&&typeof _0x311364[_0x4d3b('0x1e')]==='undefined';var _0x5b8aef=_0x3d771c[_0x4d3b('0x1f')];var _0x2553be=_0x20bbd3?0x0:_0x311364[_0x4d3b('0x20')];var _0x5e5501=_0x20bbd3?_0x3d771c['count']:_0x311364[_0x4d3b('0x20')]+_0x311364[_0x4d3b('0x1e')];var _0x49e4ba;if(_0x5e5501>=_0x5b8aef){_0x5e5501=_0x5b8aef;_0x49e4ba=0xc8;}else{_0x49e4ba=0xce;}_0x377734[_0x4d3b('0x1b')](_0x49e4ba);return _0x377734['set']('Content-Range',_0x2553be+'-'+_0x5e5501+'/'+_0x5b8aef)['json'](_0x3d771c);}return null;};}function patchUpdates(_0x30d18c){return function(_0xf8c7f8){try{jsonpatch[_0x4d3b('0x21')](_0xf8c7f8,_0x30d18c,!![]);}catch(_0xfc7598){return BPromise[_0x4d3b('0x22')](_0xfc7598);}return _0xf8c7f8[_0x4d3b('0x23')]();};}function saveUpdates(_0x4ca9f7,_0x2f9e1a){return function(_0x5bad86){if(_0x5bad86){return _0x5bad86[_0x4d3b('0x24')](_0x4ca9f7)['then'](function(_0x484c36){return _0x484c36;});}return null;};}function removeEntity(_0xe7be0c,_0x2ebeb4){return function(_0x2190a3){if(_0x2190a3){return _0x2190a3[_0x4d3b('0x25')]()['then'](function(){var _0x992f1c=_0x2190a3['get']({'plain':!![]});var _0x821eb2='MusicOnHolds';return db[_0x4d3b('0x26')]['destroy']({'where':{'type':_0x821eb2,'resourceId':_0x992f1c['id']}})[_0x4d3b('0x27')](function(){return _0x2190a3;});})[_0x4d3b('0x27')](function(){_0xe7be0c['status'](0xcc)[_0x4d3b('0x1c')]();});}};}function handleEntityNotFound(_0x13d647,_0x22d156){return function(_0x3bd657){if(!_0x3bd657){_0x13d647['sendStatus'](0x194);}return _0x3bd657;};}function handleError(_0x4ee191,_0x5641bf){_0x5641bf=_0x5641bf||0x1f4;return function(_0x50feae){logger['error'](_0x50feae['stack']);if(_0x50feae[_0x4d3b('0x28')]){delete _0x50feae[_0x4d3b('0x28')];}_0x4ee191['status'](_0x5641bf)['send'](_0x50feae);};}exports[_0x4d3b('0x29')]=function(_0x246571,_0x2989b6){var _0x117b36={},_0x507cb7={},_0x527468={'count':0x0,'rows':[]};var _0x108096=_['map'](db[_0x4d3b('0x2a')][_0x4d3b('0x2b')],function(_0xac6d40){return{'name':_0xac6d40[_0x4d3b('0x2c')],'type':_0xac6d40['type'][_0x4d3b('0x2d')]};});_0x507cb7[_0x4d3b('0x2e')]=_[_0x4d3b('0x2f')](_0x108096,_0x4d3b('0x28'));_0x507cb7[_0x4d3b('0x30')]=_[_0x4d3b('0x31')](_0x246571[_0x4d3b('0x30')]);_0x507cb7['filters']=_[_0x4d3b('0x32')](_0x507cb7[_0x4d3b('0x2e')],_0x507cb7[_0x4d3b('0x30')]);_0x117b36[_0x4d3b('0x33')]=_[_0x4d3b('0x32')](_0x507cb7['model'],qs['fields'](_0x246571['query'][_0x4d3b('0x34')]));_0x117b36[_0x4d3b('0x33')]=_0x117b36[_0x4d3b('0x33')][_0x4d3b('0x35')]?_0x117b36['attributes']:_0x507cb7['model'];if(!_0x246571[_0x4d3b('0x30')][_0x4d3b('0x36')](_0x4d3b('0x37'))){_0x117b36[_0x4d3b('0x1e')]=qs[_0x4d3b('0x1e')](_0x246571['query'][_0x4d3b('0x1e')]);_0x117b36['offset']=qs[_0x4d3b('0x20')](_0x246571[_0x4d3b('0x30')][_0x4d3b('0x20')]);}_0x117b36[_0x4d3b('0x38')]=qs['sort'](_0x246571['query'][_0x4d3b('0x39')]);delete _0x246571[_0x4d3b('0x30')][_0x4d3b('0x39')];_0x117b36[_0x4d3b('0x3a')]=qs[_0x4d3b('0x3b')](_[_0x4d3b('0x3c')](_0x246571[_0x4d3b('0x30')],_0x507cb7[_0x4d3b('0x3b')]),_0x108096);if(_0x246571[_0x4d3b('0x30')][_0x4d3b('0x3d')]){_0x117b36[_0x4d3b('0x3a')]=_[_0x4d3b('0x3e')](_0x117b36[_0x4d3b('0x3a')],{'$or':_[_0x4d3b('0x2f')](_0x108096,function(_0x276139){if(_0x276139[_0x4d3b('0x3f')]!==_0x4d3b('0x40')){var _0x277561={};_0x277561[_0x276139[_0x4d3b('0x28')]]={'$like':'%'+_0x246571[_0x4d3b('0x30')][_0x4d3b('0x3d')]+'%'};return _0x277561;}})});}_0x117b36=_[_0x4d3b('0x3e')]({},_0x117b36,_0x246571[_0x4d3b('0x41')]);var _0x2572f0={'where':_0x117b36[_0x4d3b('0x3a')]};return db['VoiceMusicOnHold']['count'](_0x2572f0)['then'](function(_0x5d9ba3){_0x527468[_0x4d3b('0x1f')]=_0x5d9ba3;if(_0x246571[_0x4d3b('0x30')][_0x4d3b('0x42')]){_0x117b36[_0x4d3b('0x43')]=[{'all':!![]}];}return db[_0x4d3b('0x2a')][_0x4d3b('0x44')](_0x117b36);})[_0x4d3b('0x27')](function(_0x2c3468){_0x527468['rows']=_0x2c3468;return _0x527468;})[_0x4d3b('0x27')](respondWithFilteredResult(_0x2989b6,_0x117b36))['catch'](handleError(_0x2989b6,null));};exports[_0x4d3b('0x45')]=function(_0x4016c,_0x3c76ee){var _0x58d43b={'raw':![],'where':{'id':_0x4016c[_0x4d3b('0x46')]['id']}},_0x34c332={};_0x34c332['model']=_['keys'](db[_0x4d3b('0x2a')][_0x4d3b('0x2b')]);_0x34c332[_0x4d3b('0x30')]=_['keys'](_0x4016c[_0x4d3b('0x30')]);_0x34c332[_0x4d3b('0x3b')]=_[_0x4d3b('0x32')](_0x34c332[_0x4d3b('0x2e')],_0x34c332[_0x4d3b('0x30')]);_0x58d43b['attributes']=_[_0x4d3b('0x32')](_0x34c332[_0x4d3b('0x2e')],qs[_0x4d3b('0x34')](_0x4016c[_0x4d3b('0x30')][_0x4d3b('0x34')]));_0x58d43b[_0x4d3b('0x33')]=_0x58d43b[_0x4d3b('0x33')][_0x4d3b('0x35')]?_0x58d43b[_0x4d3b('0x33')]:_0x34c332[_0x4d3b('0x2e')];if(_0x4016c[_0x4d3b('0x30')][_0x4d3b('0x42')]){_0x58d43b[_0x4d3b('0x43')]=[{'all':!![]}];}_0x58d43b=_[_0x4d3b('0x3e')]({},_0x58d43b,_0x4016c[_0x4d3b('0x41')]);return db[_0x4d3b('0x2a')][_0x4d3b('0x47')](_0x58d43b)[_0x4d3b('0x27')](handleEntityNotFound(_0x3c76ee,null))[_0x4d3b('0x27')](respondWithResult(_0x3c76ee,null))[_0x4d3b('0x48')](handleError(_0x3c76ee,null));};exports['update']=function(_0x54a978,_0x4590cd){if(_0x54a978[_0x4d3b('0x49')]['id']){delete _0x54a978[_0x4d3b('0x49')]['id'];}return db[_0x4d3b('0x2a')][_0x4d3b('0x47')]({'where':{'id':_0x54a978[_0x4d3b('0x46')]['id']}})[_0x4d3b('0x27')](handleEntityNotFound(_0x4590cd,null))[_0x4d3b('0x27')](saveUpdates(_0x54a978[_0x4d3b('0x49')],null))[_0x4d3b('0x27')](respondWithResult(_0x4590cd,null))[_0x4d3b('0x48')](handleError(_0x4590cd,null));};exports[_0x4d3b('0x4a')]=function(_0x4c01ff,_0x9f9879,_0x5d0842){return db['sequelize'][_0x4d3b('0x4b')](function(_0x20fd26){if(_0x4c01ff[_0x4d3b('0x49')][_0x4d3b('0x4c')]==='files'){_0x4c01ff[_0x4d3b('0x49')]['directory']=path['join'](config[_0x4d3b('0x4d')],'server/files/moh',_0x4c01ff[_0x4d3b('0x49')][_0x4d3b('0x28')]);}return db[_0x4d3b('0x2a')][_0x4d3b('0x4a')](_0x4c01ff['body'],{'transaction':_0x20fd26})[_0x4d3b('0x27')](function(_0x23dcf7){if(_0x4c01ff['body']['mode']===_0x4d3b('0x4e')){fs[_0x4d3b('0x4f')](_0x23dcf7[_0x4d3b('0x50')],parseInt('0777',0x8));}var _0x3dddf3=_0x4c01ff[_0x4d3b('0x51')][_0x4d3b('0x52')]({'plain':!![]});if(!_0x3dddf3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3dddf3[_0x4d3b('0x53')]===_0x4d3b('0x51')){var _0x275519=_0x23dcf7[_0x4d3b('0x52')]({'plain':!![]});return db[_0x4d3b('0x54')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x3dddf3[_0x4d3b('0x55')]},'raw':!![]})['then'](function(_0x157d5a){if(_0x157d5a&&_0x157d5a['autoAssociation']===0x0){return db[_0x4d3b('0x26')][_0x4d3b('0x4a')]({'name':_0x275519[_0x4d3b('0x28')],'resourceId':_0x275519['id'],'type':_0x157d5a[_0x4d3b('0x28')],'sectionId':_0x157d5a['id']},{})[_0x4d3b('0x27')](function(){return _0x23dcf7;});}else{return _0x23dcf7;}})['catch'](function(_0x163fae){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x163fae);});}return _0x23dcf7;});})['then'](respondWithResult(_0x9f9879,0xc9))[_0x4d3b('0x48')](handleError(_0x9f9879,null));};exports[_0x4d3b('0x25')]=function(_0x161b26,_0x40a510,_0x3c7c3d){var _0x4ff38b;return db[_0x4d3b('0x2a')][_0x4d3b('0x47')]({'where':{'id':_0x161b26[_0x4d3b('0x46')]['id']}})['then'](function(_0x50629d){if(_0x50629d){return db[_0x4d3b('0x56')][_0x4d3b('0x4b')](function(_0x7fc676){return _0x50629d[_0x4d3b('0x25')]({'transaction':_0x7fc676,'raw':!![]})[_0x4d3b('0x27')](function(_0x20cbb2){if(_0x20cbb2[_0x4d3b('0x50')]){fs[_0x4d3b('0x57')](_0x20cbb2['directory'])[_0x4d3b('0x58')](function(_0xba3f9e){fs[_0x4d3b('0x59')](path[_0x4d3b('0x5a')](_0x20cbb2[_0x4d3b('0x50')],_0xba3f9e));});fs[_0x4d3b('0x5b')](_0x20cbb2[_0x4d3b('0x50')]);}return _0x20cbb2;});})[_0x4d3b('0x48')](function(_0x22aac6){throw new db['Sequelize'][(_0x4d3b('0x5c'))](_0x22aac6[_0x4d3b('0x5d')]);});}})[_0x4d3b('0x27')](handleEntityNotFound(_0x40a510,null))[_0x4d3b('0x27')](removeEntity(_0x40a510,null))[_0x4d3b('0x48')](handleError(_0x40a510,null));};exports['addSound']=function(_0x5528e0,_0x4ac6a7,_0x2a2f94){return db[_0x4d3b('0x56')][_0x4d3b('0x4b')](function(_0x115bb0){var _0x207040;return db[_0x4d3b('0x2a')][_0x4d3b('0x47')]({'where':{'id':_0x5528e0[_0x4d3b('0x46')]['id']}})['then'](function(_0x27f605){if(_0x27f605){_0x207040=_0x27f605;return _0x27f605['addSound'](_0x5528e0['body']['id'],{'transaction':_0x115bb0});}})['then'](function(_0x19e72f){if(_0x19e72f){return db[_0x4d3b('0x5e')][_0x4d3b('0x5f')]({'where':{'id':_0x5528e0[_0x4d3b('0x49')]['id']},'attributes':['id',_0x4d3b('0x28'),_0x4d3b('0x60'),_0x4d3b('0x61'),_0x4d3b('0x62')],'raw':!![]});}})['then'](function(_0x2475fd){if(_0x2475fd){var _0xbe1059=path[_0x4d3b('0x5a')](config['root'],_0x4d3b('0x63'),util[_0x4d3b('0x64')](_0x4d3b('0x65'),path[_0x4d3b('0x66')](_0x2475fd['save_name'],path[_0x4d3b('0x67')](_0x2475fd[_0x4d3b('0x60')])),_0x2475fd[_0x4d3b('0x61')]));var _0xda91aa=path[_0x4d3b('0x5a')](config[_0x4d3b('0x4d')],_0x4d3b('0x68'),_0x207040['name'],util[_0x4d3b('0x64')](_0x4d3b('0x65'),_0x2475fd[_0x4d3b('0x28')],_0x2475fd[_0x4d3b('0x61')]));fs[_0x4d3b('0x69')](_0xbe1059,_0xda91aa);return _0x2475fd;}})[_0x4d3b('0x48')](function(_0x209be4){throw new db['Sequelize']['ValidationError'](_0x209be4[_0x4d3b('0x5d')]);});})[_0x4d3b('0x27')](handleEntityNotFound(_0x4ac6a7,null))['then'](respondWithResult(_0x4ac6a7,0xc9))['catch'](handleError(_0x4ac6a7,null));};exports[_0x4d3b('0x6a')]=function(_0x26fafe,_0x2c6f9d,_0x12daf5){return db[_0x4d3b('0x56')][_0x4d3b('0x4b')](function(_0x4265be){var _0x167b54;return db[_0x4d3b('0x2a')]['findOne']({'where':{'id':_0x26fafe['params']['id']}})['then'](handleEntityNotFound(_0x2c6f9d,null))[_0x4d3b('0x27')](function(_0x305249){if(_0x305249){_0x167b54=_0x305249;return _0x305249[_0x4d3b('0x6a')](_0x26fafe['params'][_0x4d3b('0x6b')]);}})[_0x4d3b('0x27')](function(_0xcde06d){if(_0xcde06d){return db[_0x4d3b('0x5e')][_0x4d3b('0x5f')]({'where':{'id':_0x26fafe[_0x4d3b('0x46')][_0x4d3b('0x6b')]},'attributes':['id',_0x4d3b('0x28'),'save_name',_0x4d3b('0x61'),_0x4d3b('0x62')],'raw':!![]});}})['then'](function(_0x57d516){if(_0x57d516){fs[_0x4d3b('0x59')](path[_0x4d3b('0x5a')](_0x167b54[_0x4d3b('0x50')],util[_0x4d3b('0x64')](_0x4d3b('0x65'),_0x57d516[_0x4d3b('0x28')],_0x57d516[_0x4d3b('0x61')])));return _0x57d516;}})[_0x4d3b('0x48')](function(_0x7a0ace){throw new db[(_0x4d3b('0x6c'))][(_0x4d3b('0x5c'))](_0x7a0ace[_0x4d3b('0x5d')]);});})[_0x4d3b('0x27')](handleEntityNotFound(_0x2c6f9d,null))[_0x4d3b('0x27')](respondWithStatusCode(_0x2c6f9d,0xcc))[_0x4d3b('0x48')](handleError(_0x2c6f9d,null));};exports[_0x4d3b('0x6d')]=function(_0x207e28,_0x506ecd,_0x2b5c3f){var _0x46a818={};var _0x4c3537={};var _0xf04551;var _0x17ee64;return db['VoiceMusicOnHold'][_0x4d3b('0x5f')]({'where':{'id':_0x207e28[_0x4d3b('0x46')]['id']}})['then'](handleEntityNotFound(_0x506ecd,null))[_0x4d3b('0x27')](function(_0x65d76b){if(_0x65d76b){_0xf04551=_0x65d76b;_0x4c3537[_0x4d3b('0x2e')]=_[_0x4d3b('0x31')](db['Sound'][_0x4d3b('0x2b')]);_0x4c3537[_0x4d3b('0x30')]=_[_0x4d3b('0x31')](_0x207e28['query']);_0x4c3537['filters']=_[_0x4d3b('0x32')](_0x4c3537[_0x4d3b('0x2e')],_0x4c3537[_0x4d3b('0x30')]);_0x46a818['attributes']=_[_0x4d3b('0x32')](_0x4c3537[_0x4d3b('0x2e')],qs[_0x4d3b('0x34')](_0x207e28[_0x4d3b('0x30')][_0x4d3b('0x34')]));_0x46a818['attributes']=_0x46a818[_0x4d3b('0x33')][_0x4d3b('0x35')]?_0x46a818['attributes']:_0x4c3537[_0x4d3b('0x2e')];_0x46a818['order']=qs[_0x4d3b('0x39')](_0x207e28['query'][_0x4d3b('0x39')]);_0x46a818[_0x4d3b('0x3a')]=qs[_0x4d3b('0x3b')](_[_0x4d3b('0x3c')](_0x207e28[_0x4d3b('0x30')],_0x4c3537[_0x4d3b('0x3b')]));if(_0x207e28[_0x4d3b('0x30')]['filter']){_0x46a818[_0x4d3b('0x3a')]=_['merge'](_0x46a818['where'],{'$or':_['map'](_0x46a818[_0x4d3b('0x33')],function(_0x2108cb){var _0x419b20={};_0x419b20[_0x2108cb]={'$like':'%'+_0x207e28['query']['filter']+'%'};return _0x419b20;})});}_0x46a818=_['merge']({},_0x46a818,_0x207e28['options']);return _0xf04551[_0x4d3b('0x6d')](_0x46a818);}})[_0x4d3b('0x27')](function(_0x42b74f){if(_0x42b74f){_0x17ee64=_0x42b74f[_0x4d3b('0x35')];if(!_0x207e28[_0x4d3b('0x30')][_0x4d3b('0x36')](_0x4d3b('0x37'))){_0x46a818[_0x4d3b('0x1e')]=qs['limit'](_0x207e28[_0x4d3b('0x30')]['limit']);_0x46a818['offset']=qs[_0x4d3b('0x20')](_0x207e28[_0x4d3b('0x30')][_0x4d3b('0x20')]);}return _0xf04551['getSounds'](_0x46a818);}})[_0x4d3b('0x27')](function(_0x4ba34d){if(_0x4ba34d){return _0x4ba34d?{'count':_0x17ee64,'rows':_0x4ba34d}:null;}})[_0x4d3b('0x27')](respondWithResult(_0x506ecd,null))[_0x4d3b('0x48')](handleError(_0x506ecd,null));}; \ No newline at end of file +var _0x5287=['catch','show','params','include','merge','find','body','create','transaction','mode','files','directory','join','server/files/moh','mkdirSync','user','MusicOnHolds','userProfileId','autoAssociation','sequelize','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','root','server/files/sounds/converted','%s.%s','extname','format','symlinkSync','removeSound','id2','createdAt','unlinkSync','getSounds','nolimit','fast-json-patch','moment','bluebird','path','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','key','keys','query','intersection','fields','attributes','length','model','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll'];(function(_0x55a5ec,_0x29c916){var _0xb91c65=function(_0x267c0f){while(--_0x267c0f){_0x55a5ec['push'](_0x55a5ec['shift']());}};_0xb91c65(++_0x29c916);}(_0x5287,0x16c));var _0x7528=function(_0x3890e4,_0x328538){_0x3890e4=_0x3890e4-0x0;var _0xaf2458=_0x5287[_0x3890e4];return _0xaf2458;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7528('0x0'));var rp=require('request-promise');var moment=require(_0x7528('0x1'));var BPromise=require(_0x7528('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7528('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7528('0x4'));var _=require(_0x7528('0x5'));var squel=require(_0x7528('0x6'));var crypto=require(_0x7528('0x7'));var jsforce=require(_0x7528('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7528('0x9'));var Papa=require(_0x7528('0xa'));var Redis=require('ioredis');var authService=require(_0x7528('0xb'));var qs=require(_0x7528('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7528('0xd'));var logger=require(_0x7528('0xe'))('api');var utils=require('../../config/utils');var config=require(_0x7528('0xf'));var licenseUtil=require(_0x7528('0x10'));var db=require(_0x7528('0x11'))['db'];function respondWithStatusCode(_0x574bb5,_0x56b420){_0x56b420=_0x56b420||0xcc;return function(_0x2e9c68){if(_0x2e9c68){return _0x574bb5[_0x7528('0x12')](_0x56b420);}return _0x574bb5[_0x7528('0x13')](_0x56b420)[_0x7528('0x14')]();};}function respondWithResult(_0x2f7d5b,_0xc8581e){_0xc8581e=_0xc8581e||0xc8;return function(_0x3545bd){if(_0x3545bd){return _0x2f7d5b[_0x7528('0x13')](_0xc8581e)[_0x7528('0x15')](_0x3545bd);}};}function respondWithFilteredResult(_0x542ff7,_0x4cccb6){return function(_0x32bbce){if(_0x32bbce){var _0x59a2dd=typeof _0x4cccb6[_0x7528('0x16')]===_0x7528('0x17')&&typeof _0x4cccb6[_0x7528('0x18')]==='undefined';var _0x33f635=_0x32bbce[_0x7528('0x19')];var _0x28d533=_0x59a2dd?0x0:_0x4cccb6[_0x7528('0x16')];var _0x5d8475=_0x59a2dd?_0x32bbce[_0x7528('0x19')]:_0x4cccb6[_0x7528('0x16')]+_0x4cccb6[_0x7528('0x18')];var _0x23de02;if(_0x5d8475>=_0x33f635){_0x5d8475=_0x33f635;_0x23de02=0xc8;}else{_0x23de02=0xce;}_0x542ff7['status'](_0x23de02);return _0x542ff7[_0x7528('0x1a')](_0x7528('0x1b'),_0x28d533+'-'+_0x5d8475+'/'+_0x33f635)[_0x7528('0x15')](_0x32bbce);}return null;};}function patchUpdates(_0x5219c5){return function(_0x494e79){try{jsonpatch[_0x7528('0x1c')](_0x494e79,_0x5219c5,!![]);}catch(_0x5b7025){return BPromise[_0x7528('0x1d')](_0x5b7025);}return _0x494e79[_0x7528('0x1e')]();};}function saveUpdates(_0x20123e,_0x1e7fa8){return function(_0x32c866){if(_0x32c866){return _0x32c866[_0x7528('0x1f')](_0x20123e)[_0x7528('0x20')](function(_0x2d470e){return _0x2d470e;});}return null;};}function removeEntity(_0x101d05,_0x51cdfc){return function(_0x1aeb30){if(_0x1aeb30){return _0x1aeb30[_0x7528('0x21')]()[_0x7528('0x20')](function(){var _0x971fdc=_0x1aeb30[_0x7528('0x22')]({'plain':!![]});var _0x1ffee7='MusicOnHolds';return db[_0x7528('0x23')]['destroy']({'where':{'type':_0x1ffee7,'resourceId':_0x971fdc['id']}})[_0x7528('0x20')](function(){return _0x1aeb30;});})[_0x7528('0x20')](function(){_0x101d05['status'](0xcc)[_0x7528('0x14')]();});}};}function handleEntityNotFound(_0xee4d61,_0x559eec){return function(_0x2f05ac){if(!_0x2f05ac){_0xee4d61[_0x7528('0x12')](0x194);}return _0x2f05ac;};}function handleError(_0x3f9285,_0x52b712){_0x52b712=_0x52b712||0x1f4;return function(_0xef4f34){logger[_0x7528('0x24')](_0xef4f34[_0x7528('0x25')]);if(_0xef4f34[_0x7528('0x26')]){delete _0xef4f34[_0x7528('0x26')];}_0x3f9285[_0x7528('0x13')](_0x52b712)[_0x7528('0x27')](_0xef4f34);};}exports[_0x7528('0x28')]=function(_0x59021f,_0x48eaa6){var _0x479892={},_0x170747={},_0x3532fe={'count':0x0,'rows':[]};var _0x3b8b17=_[_0x7528('0x29')](db[_0x7528('0x2a')][_0x7528('0x2b')],function(_0x950081){return{'name':_0x950081['fieldName'],'type':_0x950081[_0x7528('0x2c')][_0x7528('0x2d')]};});_0x170747['model']=_[_0x7528('0x29')](_0x3b8b17,'name');_0x170747['query']=_[_0x7528('0x2e')](_0x59021f[_0x7528('0x2f')]);_0x170747['filters']=_['intersection'](_0x170747['model'],_0x170747[_0x7528('0x2f')]);_0x479892['attributes']=_[_0x7528('0x30')](_0x170747['model'],qs[_0x7528('0x31')](_0x59021f[_0x7528('0x2f')]['fields']));_0x479892['attributes']=_0x479892[_0x7528('0x32')][_0x7528('0x33')]?_0x479892[_0x7528('0x32')]:_0x170747[_0x7528('0x34')];if(!_0x59021f['query'][_0x7528('0x35')]('nolimit')){_0x479892[_0x7528('0x18')]=qs['limit'](_0x59021f[_0x7528('0x2f')][_0x7528('0x18')]);_0x479892[_0x7528('0x16')]=qs[_0x7528('0x16')](_0x59021f[_0x7528('0x2f')][_0x7528('0x16')]);}_0x479892[_0x7528('0x36')]=qs[_0x7528('0x37')](_0x59021f[_0x7528('0x2f')]['sort']);delete _0x59021f[_0x7528('0x2f')][_0x7528('0x37')];_0x479892[_0x7528('0x38')]=qs[_0x7528('0x39')](_[_0x7528('0x3a')](_0x59021f[_0x7528('0x2f')],_0x170747[_0x7528('0x39')]),_0x3b8b17);if(_0x59021f[_0x7528('0x2f')][_0x7528('0x3b')]){_0x479892[_0x7528('0x38')]=_['merge'](_0x479892[_0x7528('0x38')],{'$or':_[_0x7528('0x29')](_0x3b8b17,function(_0x108a55){if(_0x108a55['type']!==_0x7528('0x3c')){var _0x303d6e={};_0x303d6e[_0x108a55[_0x7528('0x26')]]={'$like':'%'+_0x59021f[_0x7528('0x2f')][_0x7528('0x3b')]+'%'};return _0x303d6e;}})});}_0x479892=_['merge']({},_0x479892,_0x59021f[_0x7528('0x3d')]);var _0xa3b6f8={'where':_0x479892[_0x7528('0x38')]};return db['VoiceMusicOnHold'][_0x7528('0x19')](_0xa3b6f8)[_0x7528('0x20')](function(_0x3189be){_0x3532fe[_0x7528('0x19')]=_0x3189be;if(_0x59021f['query'][_0x7528('0x3e')]){_0x479892['include']=[{'all':!![]}];}return db[_0x7528('0x2a')][_0x7528('0x3f')](_0x479892);})[_0x7528('0x20')](function(_0x1ab764){_0x3532fe['rows']=_0x1ab764;return _0x3532fe;})[_0x7528('0x20')](respondWithFilteredResult(_0x48eaa6,_0x479892))[_0x7528('0x40')](handleError(_0x48eaa6,null));};exports[_0x7528('0x41')]=function(_0x518355,_0x5be0bf){var _0x49af18={'raw':![],'where':{'id':_0x518355[_0x7528('0x42')]['id']}},_0x1908bb={};_0x1908bb[_0x7528('0x34')]=_[_0x7528('0x2e')](db[_0x7528('0x2a')]['rawAttributes']);_0x1908bb[_0x7528('0x2f')]=_['keys'](_0x518355[_0x7528('0x2f')]);_0x1908bb[_0x7528('0x39')]=_[_0x7528('0x30')](_0x1908bb[_0x7528('0x34')],_0x1908bb[_0x7528('0x2f')]);_0x49af18[_0x7528('0x32')]=_[_0x7528('0x30')](_0x1908bb[_0x7528('0x34')],qs[_0x7528('0x31')](_0x518355[_0x7528('0x2f')]['fields']));_0x49af18[_0x7528('0x32')]=_0x49af18['attributes'][_0x7528('0x33')]?_0x49af18['attributes']:_0x1908bb['model'];if(_0x518355[_0x7528('0x2f')]['includeAll']){_0x49af18[_0x7528('0x43')]=[{'all':!![]}];}_0x49af18=_[_0x7528('0x44')]({},_0x49af18,_0x518355[_0x7528('0x3d')]);return db[_0x7528('0x2a')][_0x7528('0x45')](_0x49af18)[_0x7528('0x20')](handleEntityNotFound(_0x5be0bf,null))['then'](respondWithResult(_0x5be0bf,null))[_0x7528('0x40')](handleError(_0x5be0bf,null));};exports[_0x7528('0x1f')]=function(_0x7e53a1,_0x4d1f20){if(_0x7e53a1[_0x7528('0x46')]['id']){delete _0x7e53a1[_0x7528('0x46')]['id'];}return db[_0x7528('0x2a')]['find']({'where':{'id':_0x7e53a1[_0x7528('0x42')]['id']}})[_0x7528('0x20')](handleEntityNotFound(_0x4d1f20,null))[_0x7528('0x20')](saveUpdates(_0x7e53a1[_0x7528('0x46')],null))[_0x7528('0x20')](respondWithResult(_0x4d1f20,null))[_0x7528('0x40')](handleError(_0x4d1f20,null));};exports[_0x7528('0x47')]=function(_0x813cb3,_0xcdca70,_0x11203a){return db['sequelize'][_0x7528('0x48')](function(_0x17f4c9){if(_0x813cb3[_0x7528('0x46')][_0x7528('0x49')]===_0x7528('0x4a')){_0x813cb3[_0x7528('0x46')][_0x7528('0x4b')]=path[_0x7528('0x4c')](config['root'],_0x7528('0x4d'),_0x813cb3[_0x7528('0x46')][_0x7528('0x26')]);}return db['VoiceMusicOnHold'][_0x7528('0x47')](_0x813cb3[_0x7528('0x46')],{'transaction':_0x17f4c9})['then'](function(_0x5d480e){if(_0x813cb3[_0x7528('0x46')][_0x7528('0x49')]===_0x7528('0x4a')){fs[_0x7528('0x4e')](_0x5d480e['directory'],parseInt('0777',0x8));}var _0x4c6a27=_0x813cb3[_0x7528('0x4f')][_0x7528('0x22')]({'plain':!![]});if(!_0x4c6a27)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c6a27['role']==='user'){var _0x841f62=_0x5d480e[_0x7528('0x22')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x7528('0x50'),'userProfileId':_0x4c6a27[_0x7528('0x51')]},'raw':!![]})[_0x7528('0x20')](function(_0x301c20){if(_0x301c20&&_0x301c20[_0x7528('0x52')]===0x0){return db['UserProfileResource'][_0x7528('0x47')]({'name':_0x841f62[_0x7528('0x26')],'resourceId':_0x841f62['id'],'type':_0x301c20['name'],'sectionId':_0x301c20['id']},{})[_0x7528('0x20')](function(){return _0x5d480e;});}else{return _0x5d480e;}})[_0x7528('0x40')](function(_0xeaf819){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xeaf819);});}return _0x5d480e;});})[_0x7528('0x20')](respondWithResult(_0xcdca70,0xc9))['catch'](handleError(_0xcdca70,null));};exports[_0x7528('0x21')]=function(_0x56798c,_0x558f74,_0x35de77){var _0x353289;return db[_0x7528('0x2a')][_0x7528('0x45')]({'where':{'id':_0x56798c[_0x7528('0x42')]['id']}})['then'](function(_0x17afef){if(_0x17afef){return db[_0x7528('0x53')][_0x7528('0x48')](function(_0x108c01){return _0x17afef[_0x7528('0x21')]({'transaction':_0x108c01,'raw':!![]})[_0x7528('0x20')](function(_0x55f36c){if(_0x55f36c[_0x7528('0x4b')]){fs[_0x7528('0x54')](_0x55f36c[_0x7528('0x4b')])[_0x7528('0x55')](function(_0x4e3513){fs['unlinkSync'](path[_0x7528('0x4c')](_0x55f36c[_0x7528('0x4b')],_0x4e3513));});fs[_0x7528('0x56')](_0x55f36c[_0x7528('0x4b')]);}return _0x55f36c;});})[_0x7528('0x40')](function(_0x5dcaa0){throw new db[(_0x7528('0x57'))][(_0x7528('0x58'))](_0x5dcaa0[_0x7528('0x59')]);});}})[_0x7528('0x20')](handleEntityNotFound(_0x558f74,null))[_0x7528('0x20')](removeEntity(_0x558f74,null))[_0x7528('0x40')](handleError(_0x558f74,null));};exports[_0x7528('0x5a')]=function(_0x11d494,_0x2cb08e,_0x17a42e){return db[_0x7528('0x53')][_0x7528('0x48')](function(_0x4e7848){var _0x4cd0ab;return db[_0x7528('0x2a')][_0x7528('0x45')]({'where':{'id':_0x11d494[_0x7528('0x42')]['id']}})[_0x7528('0x20')](function(_0xb7347e){if(_0xb7347e){_0x4cd0ab=_0xb7347e;return _0xb7347e['addSound'](_0x11d494[_0x7528('0x46')]['id'],{'transaction':_0x4e7848});}})[_0x7528('0x20')](function(_0x4644e5){if(_0x4644e5){return db[_0x7528('0x5b')][_0x7528('0x5c')]({'where':{'id':_0x11d494[_0x7528('0x46')]['id']},'attributes':['id','name',_0x7528('0x5d'),_0x7528('0x5e'),'createdAt'],'raw':!![]});}})[_0x7528('0x20')](function(_0x47c470){if(_0x47c470){var _0x3c5d66=path[_0x7528('0x4c')](config[_0x7528('0x5f')],_0x7528('0x60'),util['format'](_0x7528('0x61'),path['basename'](_0x47c470['save_name'],path[_0x7528('0x62')](_0x47c470[_0x7528('0x5d')])),_0x47c470[_0x7528('0x5e')]));var _0xe2434a=path['join'](config[_0x7528('0x5f')],'server/files/moh',_0x4cd0ab[_0x7528('0x26')],util[_0x7528('0x63')](_0x7528('0x61'),_0x47c470[_0x7528('0x26')],_0x47c470['converted_format']));fs[_0x7528('0x64')](_0x3c5d66,_0xe2434a);return _0x47c470;}})[_0x7528('0x40')](function(_0x2fa79f){throw new db['Sequelize'][(_0x7528('0x58'))](_0x2fa79f['message']);});})[_0x7528('0x20')](handleEntityNotFound(_0x2cb08e,null))['then'](respondWithResult(_0x2cb08e,0xc9))[_0x7528('0x40')](handleError(_0x2cb08e,null));};exports['removeSound']=function(_0x28fb91,_0x32e57f,_0x33a6b3){return db[_0x7528('0x53')][_0x7528('0x48')](function(_0x2a9ca8){var _0x4d9841;return db['VoiceMusicOnHold'][_0x7528('0x5c')]({'where':{'id':_0x28fb91['params']['id']}})[_0x7528('0x20')](handleEntityNotFound(_0x32e57f,null))[_0x7528('0x20')](function(_0x2efd60){if(_0x2efd60){_0x4d9841=_0x2efd60;return _0x2efd60[_0x7528('0x65')](_0x28fb91[_0x7528('0x42')][_0x7528('0x66')]);}})[_0x7528('0x20')](function(_0x447c46){if(_0x447c46){return db[_0x7528('0x5b')]['findOne']({'where':{'id':_0x28fb91[_0x7528('0x42')][_0x7528('0x66')]},'attributes':['id','name',_0x7528('0x5d'),_0x7528('0x5e'),_0x7528('0x67')],'raw':!![]});}})['then'](function(_0x4cf868){if(_0x4cf868){fs[_0x7528('0x68')](path[_0x7528('0x4c')](_0x4d9841[_0x7528('0x4b')],util['format'](_0x7528('0x61'),_0x4cf868['name'],_0x4cf868['converted_format'])));return _0x4cf868;}})['catch'](function(_0x4c1648){throw new db[(_0x7528('0x57'))]['ValidationError'](_0x4c1648[_0x7528('0x59')]);});})[_0x7528('0x20')](handleEntityNotFound(_0x32e57f,null))[_0x7528('0x20')](respondWithStatusCode(_0x32e57f,0xcc))['catch'](handleError(_0x32e57f,null));};exports[_0x7528('0x69')]=function(_0x20c54e,_0x26c238,_0xb0e797){var _0x405c7a={};var _0x4c9733={};var _0xa3830c;var _0x418f0e;return db[_0x7528('0x2a')][_0x7528('0x5c')]({'where':{'id':_0x20c54e[_0x7528('0x42')]['id']}})[_0x7528('0x20')](handleEntityNotFound(_0x26c238,null))[_0x7528('0x20')](function(_0x3f8f88){if(_0x3f8f88){_0xa3830c=_0x3f8f88;_0x4c9733['model']=_[_0x7528('0x2e')](db[_0x7528('0x5b')][_0x7528('0x2b')]);_0x4c9733[_0x7528('0x2f')]=_[_0x7528('0x2e')](_0x20c54e[_0x7528('0x2f')]);_0x4c9733[_0x7528('0x39')]=_[_0x7528('0x30')](_0x4c9733[_0x7528('0x34')],_0x4c9733[_0x7528('0x2f')]);_0x405c7a[_0x7528('0x32')]=_[_0x7528('0x30')](_0x4c9733['model'],qs[_0x7528('0x31')](_0x20c54e[_0x7528('0x2f')][_0x7528('0x31')]));_0x405c7a[_0x7528('0x32')]=_0x405c7a[_0x7528('0x32')]['length']?_0x405c7a[_0x7528('0x32')]:_0x4c9733['model'];_0x405c7a[_0x7528('0x36')]=qs[_0x7528('0x37')](_0x20c54e['query']['sort']);_0x405c7a[_0x7528('0x38')]=qs[_0x7528('0x39')](_[_0x7528('0x3a')](_0x20c54e['query'],_0x4c9733['filters']));if(_0x20c54e['query']['filter']){_0x405c7a['where']=_[_0x7528('0x44')](_0x405c7a['where'],{'$or':_[_0x7528('0x29')](_0x405c7a[_0x7528('0x32')],function(_0x43a868){var _0xdf436a={};_0xdf436a[_0x43a868]={'$like':'%'+_0x20c54e[_0x7528('0x2f')]['filter']+'%'};return _0xdf436a;})});}_0x405c7a=_[_0x7528('0x44')]({},_0x405c7a,_0x20c54e[_0x7528('0x3d')]);return _0xa3830c[_0x7528('0x69')](_0x405c7a);}})[_0x7528('0x20')](function(_0x2d97d8){if(_0x2d97d8){_0x418f0e=_0x2d97d8[_0x7528('0x33')];if(!_0x20c54e['query'][_0x7528('0x35')](_0x7528('0x6a'))){_0x405c7a[_0x7528('0x18')]=qs[_0x7528('0x18')](_0x20c54e[_0x7528('0x2f')][_0x7528('0x18')]);_0x405c7a[_0x7528('0x16')]=qs[_0x7528('0x16')](_0x20c54e['query'][_0x7528('0x16')]);}return _0xa3830c[_0x7528('0x69')](_0x405c7a);}})[_0x7528('0x20')](function(_0x300270){if(_0x300270){return _0x300270?{'count':_0x418f0e,'rows':_0x300270}:null;}})['then'](respondWithResult(_0x26c238,null))[_0x7528('0x40')](handleError(_0x26c238,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 297a808..d0c7c3b 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 _0x31c9=['voice_musiconhold','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold'];(function(_0x2acd63,_0x1a3436){var _0x58dfdb=function(_0x4775aa){while(--_0x4775aa){_0x2acd63['push'](_0x2acd63['shift']());}};_0x58dfdb(++_0x1a3436);}(_0x31c9,0x105));var _0x931c=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x31c9[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x931c('0x0'));var util=require(_0x931c('0x1'));var logger=require('../../config/logger')(_0x931c('0x2'));var moment=require(_0x931c('0x3'));var BPromise=require(_0x931c('0x4'));var rp=require(_0x931c('0x5'));var fs=require('fs');var path=require(_0x931c('0x6'));var rimraf=require(_0x931c('0x7'));var config=require(_0x931c('0x8'));var attributes=require(_0x931c('0x9'));module['exports']=function(_0x351ccf,_0x47c716){return _0x351ccf[_0x931c('0xa')](_0x931c('0xb'),attributes,{'tableName':_0x931c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8991=['request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8991,0x1a0));var _0x1899=function(_0x138676,_0x27a8d5){_0x138676=_0x138676-0x0;var _0xf72f74=_0x8991[_0x138676];return _0xf72f74;};'use strict';var _=require(_0x1899('0x0'));var util=require(_0x1899('0x1'));var logger=require(_0x1899('0x2'))('api');var moment=require(_0x1899('0x3'));var BPromise=require('bluebird');var rp=require(_0x1899('0x4'));var fs=require('fs');var path=require(_0x1899('0x5'));var rimraf=require('rimraf');var config=require(_0x1899('0x6'));var attributes=require(_0x1899('0x7'));module[_0x1899('0x8')]=function(_0x316c05,_0x535a7d){return _0x316c05[_0x1899('0x9')](_0x1899('0xa'),attributes,{'tableName':_0x1899('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 15f16c6..1f13df9 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x51d051,_0x54ac65){var _0x4be970=function(_0x5dfd22){while(--_0x5dfd22){_0x51d051['push'](_0x51d051['shift']());}};_0x4be970(++_0x54ac65);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3b4b1d,_0x15029e){_0x3b4b1d=_0x3b4b1d-0x0;var _0x488c36=_0xcb91[_0x3b4b1d];return _0x488c36;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x14548d,_0x3691dd){var _0x4f1cea=function(_0x402c58){while(--_0x402c58){_0x14548d['push'](_0x14548d['shift']());}};_0x4f1cea(++_0x3691dd);}(_0xedd9,0xfc));var _0x9edd=function(_0x22cc82,_0x461848){_0x22cc82=_0x22cc82-0x0;var _0x1bd337=_0xedd9[_0x22cc82];return _0x1bd337;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 8ecc55e..7c146d0 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 _0x35f9=['/:id/teams','create','post','addAgents','addTeams','/:id','update','delete','destroy','removeAgents','removeTeams','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','/:id/users','getAgents'];(function(_0x29e7f4,_0x32788c){var _0x464410=function(_0xa1343){while(--_0xa1343){_0x29e7f4['push'](_0x29e7f4['shift']());}};_0x464410(++_0x32788c);}(_0x35f9,0x1df));var _0x935f=function(_0x5d586c,_0x55c001){_0x5d586c=_0x5d586c-0x0;var _0x12b0e4=_0x35f9[_0x5d586c];return _0x12b0e4;};'use strict';var multer=require(_0x935f('0x0'));var util=require(_0x935f('0x1'));var path=require(_0x935f('0x2'));var timeout=require(_0x935f('0x3'));var express=require('express');var router=express[_0x935f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x935f('0x5'));var config=require(_0x935f('0x6'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x935f('0x7')](),controller[_0x935f('0x8')]);router[_0x935f('0x9')](_0x935f('0xa'),auth[_0x935f('0x7')](),controller[_0x935f('0xb')]);router[_0x935f('0x9')]('/:id',auth[_0x935f('0x7')](),controller[_0x935f('0xc')]);router[_0x935f('0x9')](_0x935f('0xd'),auth[_0x935f('0x7')](),controller[_0x935f('0xe')]);router[_0x935f('0x9')](_0x935f('0xf'),auth[_0x935f('0x7')](),controller['getTeams']);router['post']('/',auth[_0x935f('0x7')](),controller[_0x935f('0x10')]);router[_0x935f('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0x935f('0x12')]);router[_0x935f('0x11')]('/:id/teams',auth['isAuthenticated'](),controller[_0x935f('0x13')]);router['put'](_0x935f('0x14'),auth[_0x935f('0x7')](),controller[_0x935f('0x15')]);router[_0x935f('0x16')](_0x935f('0x14'),auth[_0x935f('0x7')](),controller[_0x935f('0x17')]);router[_0x935f('0x16')]('/:id/users',auth[_0x935f('0x7')](),controller[_0x935f('0x18')]);router['delete'](_0x935f('0xf'),auth[_0x935f('0x7')](),controller[_0x935f('0x19')]);module['exports']=router; \ No newline at end of file +var _0x2159=['../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','/:id/users','getAgents','/:id/teams','post','addAgents','addTeams','put','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x44d727,_0x19b4bf){var _0x190474=function(_0x5b589f){while(--_0x5b589f){_0x44d727['push'](_0x44d727['shift']());}};_0x190474(++_0x19b4bf);}(_0x2159,0x17f));var _0x9215=function(_0x31c647,_0x3a64bb){_0x31c647=_0x31c647-0x0;var _0x20f942=_0x2159[_0x31c647];return _0x20f942;};'use strict';var multer=require(_0x9215('0x0'));var util=require(_0x9215('0x1'));var path=require(_0x9215('0x2'));var timeout=require(_0x9215('0x3'));var express=require('express');var router=express[_0x9215('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9215('0x5'));var interaction=require(_0x9215('0x6'));var config=require(_0x9215('0x7'));var controller=require(_0x9215('0x8'));router[_0x9215('0x9')]('/',auth[_0x9215('0xa')](),controller[_0x9215('0xb')]);router[_0x9215('0x9')]('/describe',auth[_0x9215('0xa')](),controller[_0x9215('0xc')]);router[_0x9215('0x9')](_0x9215('0xd'),auth[_0x9215('0xa')](),controller['show']);router[_0x9215('0x9')](_0x9215('0xe'),auth[_0x9215('0xa')](),controller[_0x9215('0xf')]);router['get'](_0x9215('0x10'),auth[_0x9215('0xa')](),controller['getTeams']);router[_0x9215('0x11')]('/',auth[_0x9215('0xa')](),controller['create']);router[_0x9215('0x11')](_0x9215('0xe'),auth['isAuthenticated'](),controller[_0x9215('0x12')]);router['post'](_0x9215('0x10'),auth['isAuthenticated'](),controller[_0x9215('0x13')]);router[_0x9215('0x14')](_0x9215('0xd'),auth[_0x9215('0xa')](),controller['update']);router[_0x9215('0x15')](_0x9215('0xd'),auth['isAuthenticated'](),controller[_0x9215('0x16')]);router[_0x9215('0x15')](_0x9215('0xe'),auth[_0x9215('0xa')](),controller[_0x9215('0x17')]);router[_0x9215('0x15')](_0x9215('0x10'),auth['isAuthenticated'](),controller[_0x9215('0x18')]);module[_0x9215('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 0349c1e..fb944ac 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 _0x3cbd=['name','VIRTUAL','system-','getDataValue','sequelize','STRING'];(function(_0x1c9b44,_0x18fc9e){var _0x5e2227=function(_0x77e6cb){while(--_0x77e6cb){_0x1c9b44['push'](_0x1c9b44['shift']());}};_0x5e2227(++_0x18fc9e);}(_0x3cbd,0x1ea));var _0xd3cb=function(_0x4ca160,_0x14886c){_0x4ca160=_0x4ca160-0x0;var _0x303ae9=_0x3cbd[_0x4ca160];return _0x303ae9;};'use strict';var Sequelize=require(_0xd3cb('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3cb('0x1')],'allowNull':![],'unique':_0xd3cb('0x2')},'prefix':{'type':Sequelize[_0xd3cb('0x3')],'get':function(_0x18cac0){return _0xd3cb('0x4')+this[_0xd3cb('0x5')](_0xd3cb('0x2'))+'-';}},'description':{'type':Sequelize[_0xd3cb('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x377a=['sequelize','exports','STRING','name','VIRTUAL','getDataValue'];(function(_0x5b5ef8,_0x1c7def){var _0x22f409=function(_0xc83681){while(--_0xc83681){_0x5b5ef8['push'](_0x5b5ef8['shift']());}};_0x22f409(++_0x1c7def);}(_0x377a,0xb4));var _0xa377=function(_0x5a9b6c,_0x30ccd0){_0x5a9b6c=_0x5a9b6c-0x0;var _0x72bed=_0x377a[_0x5a9b6c];return _0x72bed;};'use strict';var Sequelize=require(_0xa377('0x0'));module[_0xa377('0x1')]={'name':{'type':Sequelize[_0xa377('0x2')],'allowNull':![],'unique':_0xa377('0x3')},'prefix':{'type':Sequelize[_0xa377('0x4')],'get':function(_0x2927aa){return'system-'+this[_0xa377('0x5')](_0xa377('0x3'))+'-';}},'description':{'type':Sequelize[_0xa377('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'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 e6d462e..25ec760 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 _0x1eba=['UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','compact','removeTeams','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/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','stack','name','send','index','map','VoicePrefix','fieldName','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','options','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','voicePause','flatMap','Agents','addTeams','each'];(function(_0x5de143,_0x2c37e3){var _0x3a21b3=function(_0x330a70){while(--_0x330a70){_0x5de143['push'](_0x5de143['shift']());}};_0x3a21b3(++_0x2c37e3);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0x1eba[_0x39772f];return _0xc9edbf;};'use strict';var emlformat=require(_0xa1eb('0x0'));var rimraf=require(_0xa1eb('0x1'));var zipdir=require(_0xa1eb('0x2'));var jsonpatch=require(_0xa1eb('0x3'));var rp=require(_0xa1eb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1eb('0x5'));var util=require(_0xa1eb('0x6'));var path=require(_0xa1eb('0x7'));var sox=require(_0xa1eb('0x8'));var csv=require(_0xa1eb('0x9'));var ejs=require(_0xa1eb('0xa'));var fs=require('fs');var fs_extra=require(_0xa1eb('0xb'));var _=require(_0xa1eb('0xc'));var squel=require(_0xa1eb('0xd'));var crypto=require(_0xa1eb('0xe'));var jsforce=require(_0xa1eb('0xf'));var deskjs=require(_0xa1eb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1eb('0x11'));var Papa=require('papaparse');var Redis=require(_0xa1eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa1eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1eb('0x14'));var logger=require('../../config/logger')(_0xa1eb('0x15'));var utils=require(_0xa1eb('0x16'));var config=require(_0xa1eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa1eb('0x18'))['db'];config[_0xa1eb('0x19')]=_['defaults'](config[_0xa1eb('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1eb('0x19')]));require('./voicePrefix.socket')[_0xa1eb('0x1a')](socket);function respondWithStatusCode(_0x2178e2,_0x14e048){_0x14e048=_0x14e048||0xcc;return function(_0x2877cb){if(_0x2877cb){return _0x2178e2[_0xa1eb('0x1b')](_0x14e048);}return _0x2178e2[_0xa1eb('0x1c')](_0x14e048)[_0xa1eb('0x1d')]();};}function respondWithResult(_0x45d6dd,_0x211e42){_0x211e42=_0x211e42||0xc8;return function(_0x4aa527){if(_0x4aa527){return _0x45d6dd[_0xa1eb('0x1c')](_0x211e42)['json'](_0x4aa527);}};}function respondWithFilteredResult(_0x1401ef,_0x3dafcd){return function(_0x33c4e3){if(_0x33c4e3){var _0x1a5d2c=typeof _0x3dafcd['offset']===_0xa1eb('0x1e')&&typeof _0x3dafcd[_0xa1eb('0x1f')]===_0xa1eb('0x1e');var _0xcf45c1=_0x33c4e3[_0xa1eb('0x20')];var _0x3b8607=_0x1a5d2c?0x0:_0x3dafcd[_0xa1eb('0x21')];var _0x166f7f=_0x1a5d2c?_0x33c4e3['count']:_0x3dafcd[_0xa1eb('0x21')]+_0x3dafcd['limit'];var _0x2258d1;if(_0x166f7f>=_0xcf45c1){_0x166f7f=_0xcf45c1;_0x2258d1=0xc8;}else{_0x2258d1=0xce;}_0x1401ef[_0xa1eb('0x1c')](_0x2258d1);return _0x1401ef[_0xa1eb('0x22')](_0xa1eb('0x23'),_0x3b8607+'-'+_0x166f7f+'/'+_0xcf45c1)['json'](_0x33c4e3);}return null;};}function patchUpdates(_0x539634){return function(_0x168221){try{jsonpatch[_0xa1eb('0x24')](_0x168221,_0x539634,!![]);}catch(_0x5b0903){return BPromise[_0xa1eb('0x25')](_0x5b0903);}return _0x168221[_0xa1eb('0x26')]();};}function saveUpdates(_0x258d3a,_0xa6b20c){return function(_0x23b49e){if(_0x23b49e){return _0x23b49e[_0xa1eb('0x27')](_0x258d3a)[_0xa1eb('0x28')](function(_0x364b1c){return _0x364b1c;});}return null;};}function removeEntity(_0xd7bb88,_0x352796){return function(_0xb77fd6){if(_0xb77fd6){return _0xb77fd6[_0xa1eb('0x29')]()['then'](function(){var _0x7c617e=_0xb77fd6[_0xa1eb('0x2a')]({'plain':!![]});var _0x491f37=_0xa1eb('0x2b');return db['UserProfileResource'][_0xa1eb('0x29')]({'where':{'type':_0x491f37,'resourceId':_0x7c617e['id']}})[_0xa1eb('0x28')](function(){return _0xb77fd6;});})['then'](function(){_0xd7bb88[_0xa1eb('0x1c')](0xcc)[_0xa1eb('0x1d')]();});}};}function handleEntityNotFound(_0x136835,_0x4f64bb){return function(_0x12cf56){if(!_0x12cf56){_0x136835[_0xa1eb('0x1b')](0x194);}return _0x12cf56;};}function handleError(_0x55f5cc,_0x273a42){_0x273a42=_0x273a42||0x1f4;return function(_0xb27bf9){logger[_0xa1eb('0x2c')](_0xb27bf9[_0xa1eb('0x2d')]);if(_0xb27bf9[_0xa1eb('0x2e')]){delete _0xb27bf9['name'];}_0x55f5cc[_0xa1eb('0x1c')](_0x273a42)[_0xa1eb('0x2f')](_0xb27bf9);};}exports[_0xa1eb('0x30')]=function(_0x2ae21d,_0x383e26){var _0xcd9efd={},_0x1d5b64={},_0xcfda64={'count':0x0,'rows':[]};var _0x254727=_[_0xa1eb('0x31')](db[_0xa1eb('0x32')]['rawAttributes'],function(_0x563b11){return{'name':_0x563b11[_0xa1eb('0x33')],'type':_0x563b11[_0xa1eb('0x34')][_0xa1eb('0x35')]};});_0x1d5b64[_0xa1eb('0x36')]=_[_0xa1eb('0x31')](_0x254727,'name');_0x1d5b64['query']=_[_0xa1eb('0x37')](_0x2ae21d[_0xa1eb('0x38')]);_0x1d5b64['filters']=_['intersection'](_0x1d5b64[_0xa1eb('0x36')],_0x1d5b64['query']);_0xcd9efd[_0xa1eb('0x39')]=_['intersection'](_0x1d5b64[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x2ae21d[_0xa1eb('0x38')]['fields']));_0xcd9efd[_0xa1eb('0x39')]=_0xcd9efd[_0xa1eb('0x39')][_0xa1eb('0x3b')]?_0xcd9efd['attributes']:_0x1d5b64[_0xa1eb('0x36')];if(!_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x3c')](_0xa1eb('0x3d'))){_0xcd9efd[_0xa1eb('0x1f')]=qs['limit'](_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x1f')]);_0xcd9efd[_0xa1eb('0x21')]=qs[_0xa1eb('0x21')](_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x21')]);}_0xcd9efd[_0xa1eb('0x3e')]=qs[_0xa1eb('0x3f')](_0x2ae21d['query'][_0xa1eb('0x3f')]);_0xcd9efd[_0xa1eb('0x40')]=qs[_0xa1eb('0x41')](_[_0xa1eb('0x42')](_0x2ae21d[_0xa1eb('0x38')],_0x1d5b64['filters']),_0x254727);if(_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x43')]){_0xcd9efd[_0xa1eb('0x40')]=_['merge'](_0xcd9efd[_0xa1eb('0x40')],{'$or':_[_0xa1eb('0x31')](_0x254727,function(_0x2ae6d8){if(_0x2ae6d8[_0xa1eb('0x34')]!==_0xa1eb('0x44')){var _0x1e5b3b={};_0x1e5b3b[_0x2ae6d8[_0xa1eb('0x2e')]]={'$like':'%'+_0x2ae21d['query'][_0xa1eb('0x43')]+'%'};return _0x1e5b3b;}})});}_0xcd9efd=_[_0xa1eb('0x45')]({},_0xcd9efd,_0x2ae21d['options']);var _0xf6c04b={'where':_0xcd9efd['where']};return db[_0xa1eb('0x32')][_0xa1eb('0x20')](_0xf6c04b)[_0xa1eb('0x28')](function(_0x361675){_0xcfda64[_0xa1eb('0x20')]=_0x361675;if(_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x46')]){_0xcd9efd[_0xa1eb('0x47')]=[{'all':!![]}];}return db[_0xa1eb('0x32')][_0xa1eb('0x48')](_0xcd9efd);})[_0xa1eb('0x28')](function(_0x3c4690){_0xcfda64[_0xa1eb('0x49')]=_0x3c4690;return _0xcfda64;})[_0xa1eb('0x28')](respondWithFilteredResult(_0x383e26,_0xcd9efd))[_0xa1eb('0x4a')](handleError(_0x383e26,null));};exports[_0xa1eb('0x4b')]=function(_0x4e068d,_0x10f983){var _0x4fd053={'raw':![],'where':{'id':_0x4e068d[_0xa1eb('0x4c')]['id']}},_0x3edc6b={};_0x3edc6b['model']=_['keys'](db[_0xa1eb('0x32')][_0xa1eb('0x4d')]);_0x3edc6b[_0xa1eb('0x38')]=_['keys'](_0x4e068d[_0xa1eb('0x38')]);_0x3edc6b[_0xa1eb('0x41')]=_[_0xa1eb('0x4e')](_0x3edc6b[_0xa1eb('0x36')],_0x3edc6b[_0xa1eb('0x38')]);_0x4fd053[_0xa1eb('0x39')]=_[_0xa1eb('0x4e')](_0x3edc6b[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x4e068d[_0xa1eb('0x38')][_0xa1eb('0x3a')]));_0x4fd053[_0xa1eb('0x39')]=_0x4fd053[_0xa1eb('0x39')][_0xa1eb('0x3b')]?_0x4fd053['attributes']:_0x3edc6b[_0xa1eb('0x36')];if(_0x4e068d[_0xa1eb('0x38')][_0xa1eb('0x46')]){_0x4fd053[_0xa1eb('0x47')]=[{'all':!![]}];}_0x4fd053=_[_0xa1eb('0x45')]({},_0x4fd053,_0x4e068d[_0xa1eb('0x4f')]);return db[_0xa1eb('0x32')]['find'](_0x4fd053)[_0xa1eb('0x28')](handleEntityNotFound(_0x10f983,null))[_0xa1eb('0x28')](respondWithResult(_0x10f983,null))[_0xa1eb('0x4a')](handleError(_0x10f983,null));};exports[_0xa1eb('0x29')]=function(_0x8975a1,_0x1302f6){return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x8975a1[_0xa1eb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1302f6,null))[_0xa1eb('0x28')](removeEntity(_0x1302f6,null))['catch'](handleError(_0x1302f6,null));};exports[_0xa1eb('0x51')]=function(_0x495c01,_0x1a815e){return db[_0xa1eb('0x32')][_0xa1eb('0x51')]()['then'](respondWithResult(_0x1a815e,null))[_0xa1eb('0x4a')](handleError(_0x1a815e,null));};exports[_0xa1eb('0x52')]=function(_0x549c95,_0x10d6d5){var _0x2926e7;return db[_0xa1eb('0x53')][_0xa1eb('0x54')](function(_0x11cc84){return db[_0xa1eb('0x32')][_0xa1eb('0x52')](_0x549c95[_0xa1eb('0x55')],{'transaction':_0x11cc84})[_0xa1eb('0x28')](function(_0x3d9a41){_0x2926e7=_0x3d9a41[_0xa1eb('0x2a')]({'plain':!![]});return db[_0xa1eb('0x56')][_0xa1eb('0x50')]({'where':{'id':_0x2926e7[_0xa1eb('0x57')]},'raw':!![]})[_0xa1eb('0x28')](function(_0x2ba6c0){return createVoicePrefixExtensions(_0x2926e7,_0x2ba6c0,_0x11cc84);});});})[_0xa1eb('0x28')](function(){var _0x589186=_0x549c95[_0xa1eb('0x58')][_0xa1eb('0x2a')]({'plain':!![]});if(!_0x589186)throw new Error(_0xa1eb('0x59'));if(_0x589186[_0xa1eb('0x5a')]===_0xa1eb('0x58')){var _0x1f5da6=_0x2926e7;return db['UserProfileSection'][_0xa1eb('0x50')]({'where':{'name':_0xa1eb('0x2b'),'userProfileId':_0x589186[_0xa1eb('0x5b')]},'raw':!![]})[_0xa1eb('0x28')](function(_0xa46d79){if(_0xa46d79&&_0xa46d79[_0xa1eb('0x5c')]===0x0){return db[_0xa1eb('0x5d')]['create']({'name':_0x1f5da6[_0xa1eb('0x2e')],'resourceId':_0x1f5da6['id'],'type':_0xa46d79[_0xa1eb('0x2e')],'sectionId':_0xa46d79['id']},{})[_0xa1eb('0x28')](function(){return _0x2926e7;});}else{return _0x2926e7;}})[_0xa1eb('0x4a')](function(_0x4c30ad){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c30ad);throw _0x4c30ad;});}return _0x2926e7;})['then'](respondWithResult(_0x10d6d5,null))[_0xa1eb('0x4a')](handleError(_0x10d6d5,null));};function Extension(_0x1e1e5d,_0x591907,_0x4643f3,_0x3e2d2f){this[_0xa1eb('0x5e')]=_0xa1eb('0x5f');this['exten']=_0x1e1e5d;this['app']=_0x4643f3;this[_0xa1eb('0x34')]=_0xa1eb('0x60');this[_0xa1eb('0x61')]=_0xa1eb('0x62');this[_0xa1eb('0x63')]=_0x591907;this[_0xa1eb('0x64')]=_0x3e2d2f;}function createVoicePrefixExtensions(_0x51580f,_0x532dfa,_0x43f223){return new BPromise(function(_0x5afc3e,_0x3ea940){var _0x57172d=new Extension(formatPrefixName(_0x51580f[_0xa1eb('0x65')]),0x1,_0xa1eb('0x66'),'Voice\x20Prefix');_0x57172d[_0xa1eb('0x67')]=_0x51580f['id'];return db[_0xa1eb('0x56')]['create'](_0x57172d,{'transaction':_0x43f223})[_0xa1eb('0x28')](function(_0x17feb5){var _0x3b97c7=_0x17feb5['get']({'plain':!![]});var _0x9799d3=_[_0xa1eb('0x31')](addVoicePrefixExtensions(_0x51580f,_0x532dfa),function(_0x4af59a){_0x4af59a[_0xa1eb('0x57')]=_0x3b97c7['id'];_0x4af59a[_0xa1eb('0x67')]=_0x51580f['id'];return _0x4af59a;});return db[_0xa1eb('0x56')]['bulkCreate'](_0x9799d3,{'transaction':_0x43f223})[_0xa1eb('0x28')](function(_0x5aa916){if(!_0x5aa916){return _0x3ea940(_0xa1eb('0x68'));}else{return _0x5afc3e(_0x5aa916);}})[_0xa1eb('0x4a')](function(_0x40eae0){return _0x3ea940(_0x40eae0);});});;});};function addVoicePrefixExtensions(_0x331a80,_0x2df867){var _0x48f49d=[];var _0x2aba03=formatPrefixName(_0x331a80[_0xa1eb('0x65')]);_0x48f49d[_0xa1eb('0x69')](new Extension(_0x2aba03,0x2,'Set',_0xa1eb('0x6a')+_0x331a80['name']));if(_0x331a80['callerIdAll']){_0x48f49d['push'](new Extension(_0x2aba03,0x3,'Set',_0xa1eb('0x6b')+_0x331a80[_0xa1eb('0x6c')]));}else{_0x48f49d[_0xa1eb('0x69')](new Extension(_0x2aba03,0x3,_0xa1eb('0x66'),_0xa1eb('0x6d')));}_0x48f49d[_0xa1eb('0x69')](new Extension(_0x2aba03,0x4,_0xa1eb('0x6e'),_0x2df867[_0xa1eb('0x5e')]+','+_0xa1eb('0x6f')+(0x8+_0x331a80[_0xa1eb('0x2e')]['length'])+'}'+','+0x1));return _0x48f49d;}function formatPrefixName(_0x79bee8){var _0x1d1c91='_';for(var _0x46207c=0x0;_0x46207c<_0x79bee8[_0xa1eb('0x3b')];_0x46207c++){if(_0x79bee8[_0xa1eb('0x70')](_0x46207c)=='-'){_0x1d1c91+=_0x79bee8[_0xa1eb('0x70')](_0x46207c);}else{_0x1d1c91+='['+_0x79bee8['charAt'](_0x46207c)+']';}}_0x1d1c91+='.';return _0x1d1c91;}exports[_0xa1eb('0x27')]=function(_0x2b6996,_0x16c5a3,_0x58147f){var _0x1434a1=_0x2b6996[_0xa1eb('0x55')];_0x1434a1[_0xa1eb('0x65')]=_0xa1eb('0x71')+_0x1434a1[_0xa1eb('0x2e')]+'-';return db['sequelize'][_0xa1eb('0x54')](function(_0x50eff6){return db[_0xa1eb('0x32')]['update'](_0x1434a1,{'where':{'id':_0x1434a1['id']},'transaction':_0x50eff6})[_0xa1eb('0x28')](function(){return db[_0xa1eb('0x56')][_0xa1eb('0x29')]({'where':{'VoicePrefixId':_0x1434a1['id']},'transaction':_0x50eff6})[_0xa1eb('0x28')](function(){return db['VoiceExtension'][_0xa1eb('0x50')]({'where':{'id':_0x1434a1[_0xa1eb('0x57')]},'raw':!![]})[_0xa1eb('0x28')](function(_0x293f74){return createVoicePrefixExtensions(_0x1434a1,_0x293f74,_0x50eff6);});});});})['then'](function(){return db[_0xa1eb('0x32')][_0xa1eb('0x72')](_0x1434a1['id']);})[_0xa1eb('0x28')](respondWithResult(_0x16c5a3,null))[_0xa1eb('0x4a')](handleError(_0x16c5a3,null));};exports[_0xa1eb('0x73')]=function(_0x22a7cb,_0x389e44,_0x471633){return db[_0xa1eb('0x32')]['find']({'where':{'id':_0x22a7cb['params']['id']}})['then'](handleEntityNotFound(_0x389e44,null))[_0xa1eb('0x28')](function(_0x5b7785){if(_0x5b7785){return _0x5b7785[_0xa1eb('0x73')](_0x22a7cb[_0xa1eb('0x55')]['ids'],_['omit'](_0x22a7cb[_0xa1eb('0x55')],[_0xa1eb('0x74'),'id'])||{})[_0xa1eb('0x75')](function(_0x6027f7){for(var _0x470489=0x0;_0x470489<_0x22a7cb['body']['ids'][_0xa1eb('0x3b')];_0x470489+=0x1){socket[_0xa1eb('0x76')](_0xa1eb('0x77'),{'UserId':Number(_0x22a7cb[_0xa1eb('0x55')]['ids'][_0x470489]),'VoicePrefixId':Number(_0x22a7cb[_0xa1eb('0x4c')]['id'])});}return _0x6027f7;});}})[_0xa1eb('0x28')](respondWithResult(_0x389e44,null))[_0xa1eb('0x4a')](handleError(_0x389e44,null));};exports[_0xa1eb('0x78')]=function(_0x3863ce,_0x37d8c4,_0x3fd52a){return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x3863ce[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](handleEntityNotFound(_0x37d8c4,null))['then'](function(_0x21d884){if(_0x21d884){return _0x21d884[_0xa1eb('0x78')](_0x3863ce[_0xa1eb('0x38')][_0xa1eb('0x74')])[_0xa1eb('0x28')](function(){if(_[_0xa1eb('0x79')](_0x3863ce['query'][_0xa1eb('0x74')])){for(var _0x36a94f=0x0;_0x36a94f<_0x3863ce[_0xa1eb('0x38')][_0xa1eb('0x74')]['length'];_0x36a94f+=0x1){socket['emit'](_0xa1eb('0x7a'),{'UserId':Number(_0x3863ce['query'][_0xa1eb('0x74')][_0x36a94f]),'VoicePrefixId':Number(_0x3863ce[_0xa1eb('0x4c')]['id'])});}}else{socket['emit'](_0xa1eb('0x7a'),{'UserId':Number(_0x3863ce[_0xa1eb('0x38')]['ids']),'VoicePrefixId':Number(_0x3863ce[_0xa1eb('0x4c')]['id'])});}});}})[_0xa1eb('0x28')](respondWithStatusCode(_0x37d8c4,null))[_0xa1eb('0x4a')](handleError(_0x37d8c4,null));};exports[_0xa1eb('0x7b')]=function(_0x3d9034,_0x20cf70,_0x824123){var _0x2ce2e1={};var _0x3d32da={};var _0x64943f;var _0x3b4851;return db['VoicePrefix'][_0xa1eb('0x7c')]({'where':{'id':_0x3d9034[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](handleEntityNotFound(_0x20cf70,null))[_0xa1eb('0x28')](function(_0x49e563){if(_0x49e563){_0x64943f=_0x49e563;_0x3d32da[_0xa1eb('0x36')]=_[_0xa1eb('0x37')](db[_0xa1eb('0x7d')]['rawAttributes']);_0x3d32da[_0xa1eb('0x38')]=_[_0xa1eb('0x37')](_0x3d9034[_0xa1eb('0x38')]);_0x3d32da['filters']=_[_0xa1eb('0x4e')](_0x3d32da['model'],_0x3d32da[_0xa1eb('0x38')]);_0x2ce2e1[_0xa1eb('0x39')]=_[_0xa1eb('0x4e')](_0x3d32da[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x3a')]));_0x2ce2e1[_0xa1eb('0x39')]=_0x2ce2e1['attributes'][_0xa1eb('0x3b')]?_0x2ce2e1[_0xa1eb('0x39')]:_0x3d32da[_0xa1eb('0x36')];_0x2ce2e1[_0xa1eb('0x3e')]=qs[_0xa1eb('0x3f')](_0x3d9034['query'][_0xa1eb('0x3f')]);_0x2ce2e1[_0xa1eb('0x40')]=qs['filters'](_[_0xa1eb('0x42')](_0x3d9034['query'],_0x3d32da['filters']));if(_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x43')]){_0x2ce2e1['where']=_[_0xa1eb('0x45')](_0x2ce2e1[_0xa1eb('0x40')],{'$or':_['map'](_0x2ce2e1[_0xa1eb('0x39')],function(_0x2c49d1){var _0x4d2598={};_0x4d2598[_0x2c49d1]={'$like':'%'+_0x3d9034['query'][_0xa1eb('0x43')]+'%'};return _0x4d2598;})});}_0x2ce2e1=_['merge']({},_0x2ce2e1,_0x3d9034[_0xa1eb('0x4f')]);return _0x64943f[_0xa1eb('0x7b')](_0x2ce2e1);}})[_0xa1eb('0x28')](function(_0x316a75){if(_0x316a75){_0x3b4851=_0x316a75[_0xa1eb('0x3b')];if(!_0x3d9034[_0xa1eb('0x38')]['hasOwnProperty'](_0xa1eb('0x3d'))){_0x2ce2e1['limit']=qs[_0xa1eb('0x1f')](_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x1f')]);_0x2ce2e1[_0xa1eb('0x21')]=qs[_0xa1eb('0x21')](_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x21')]);}return _0x64943f['getAgents'](_0x2ce2e1);}})[_0xa1eb('0x28')](function(_0x4effc0){if(_0x4effc0){return _0x4effc0?{'count':_0x3b4851,'rows':_0x4effc0}:null;}})['then'](respondWithResult(_0x20cf70,null))[_0xa1eb('0x4a')](handleError(_0x20cf70,null));};exports[_0xa1eb('0x7e')]=function(_0x456ddb,_0x559d58,_0x14eff1){var _0x717fbf={};var _0x5ef8c1={};var _0x2dd909;var _0x58d694;return db[_0xa1eb('0x32')]['findOne']({'where':{'id':_0x456ddb[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](handleEntityNotFound(_0x559d58,null))['then'](function(_0x52c3d6){if(_0x52c3d6){_0x2dd909=_0x52c3d6;_0x5ef8c1[_0xa1eb('0x36')]=_[_0xa1eb('0x37')](db[_0xa1eb('0x7f')][_0xa1eb('0x4d')]);_0x5ef8c1[_0xa1eb('0x38')]=_[_0xa1eb('0x37')](_0x456ddb[_0xa1eb('0x38')]);_0x5ef8c1[_0xa1eb('0x41')]=_[_0xa1eb('0x4e')](_0x5ef8c1[_0xa1eb('0x36')],_0x5ef8c1[_0xa1eb('0x38')]);_0x717fbf[_0xa1eb('0x39')]=_[_0xa1eb('0x4e')](_0x5ef8c1[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x456ddb['query'][_0xa1eb('0x3a')]));_0x717fbf[_0xa1eb('0x39')]=_0x717fbf['attributes'][_0xa1eb('0x3b')]?_0x717fbf['attributes']:_0x5ef8c1[_0xa1eb('0x36')];_0x717fbf[_0xa1eb('0x3e')]=qs[_0xa1eb('0x3f')](_0x456ddb['query'][_0xa1eb('0x3f')]);_0x717fbf[_0xa1eb('0x40')]=qs[_0xa1eb('0x41')](_[_0xa1eb('0x42')](_0x456ddb['query'],_0x5ef8c1[_0xa1eb('0x41')]));if(_0x456ddb['query'][_0xa1eb('0x43')]){_0x717fbf[_0xa1eb('0x40')]=_[_0xa1eb('0x45')](_0x717fbf[_0xa1eb('0x40')],{'$or':_[_0xa1eb('0x31')](_0x717fbf[_0xa1eb('0x39')],function(_0xc27d40){var _0x1e3d9c={};_0x1e3d9c[_0xc27d40]={'$like':'%'+_0x456ddb['query'][_0xa1eb('0x43')]+'%'};return _0x1e3d9c;})});}_0x717fbf=_[_0xa1eb('0x45')]({},_0x717fbf,_0x456ddb[_0xa1eb('0x4f')]);return _0x2dd909[_0xa1eb('0x7e')](_0x717fbf);}})[_0xa1eb('0x28')](function(_0x322728){if(_0x322728){_0x58d694=_0x322728[_0xa1eb('0x3b')];if(!_0x456ddb[_0xa1eb('0x38')][_0xa1eb('0x3c')](_0xa1eb('0x3d'))){_0x717fbf[_0xa1eb('0x1f')]=qs[_0xa1eb('0x1f')](_0x456ddb[_0xa1eb('0x38')][_0xa1eb('0x1f')]);_0x717fbf['offset']=qs[_0xa1eb('0x21')](_0x456ddb[_0xa1eb('0x38')]['offset']);}return _0x2dd909['getTeams'](_0x717fbf);}})[_0xa1eb('0x28')](function(_0x106dd9){if(_0x106dd9){return _0x106dd9?{'count':_0x58d694,'rows':_0x106dd9}:null;}})[_0xa1eb('0x28')](respondWithResult(_0x559d58,null))[_0xa1eb('0x4a')](handleError(_0x559d58,null));};exports['addTeams']=function(_0x402acb,_0x49441f,_0x3ad4ca){var _0x2151a8=_0x402acb[_0xa1eb('0x55')][_0xa1eb('0x74')];var _0x33a90e;return db[_0xa1eb('0x7f')][_0xa1eb('0x48')]({'where':{'id':_0x2151a8},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online',_0xa1eb('0x80'),'interface'],'raw':!![]}]})[_0xa1eb('0x28')](function(_0x2c97f8){if(_0x2c97f8){_0x33a90e=_0x2c97f8;var _0x1c1a59=_[_0xa1eb('0x81')](_0x2c97f8,function(_0x438746){var _0x16528e=_0x438746[_0xa1eb('0x2a')]({'plain':!![]});return _0x16528e[_0xa1eb('0x82')];});return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x402acb[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](function(_0x3d9f66){return db[_0xa1eb('0x53')][_0xa1eb('0x54')](function(_0x562666){return _0x3d9f66[_0xa1eb('0x83')](_0x2151a8,{'transaction':_0x562666})['then'](function(){return BPromise[_0xa1eb('0x84')](_0x33a90e,function(_0x230a07){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x230a07['id'],'VoicePrefixId':_0x402acb[_0xa1eb('0x4c')]['id']},{'transaction':_0x562666});});})[_0xa1eb('0x28')](function(){return BPromise[_0xa1eb('0x84')](_0x1c1a59,function(_0x38451d){return db[_0xa1eb('0x85')][_0xa1eb('0x86')]({'where':{'UserId':_0x38451d['id'],'VoicePrefixId':_0x402acb['params']['id']},'transaction':_0x562666});});})[_0xa1eb('0x28')](function(){_0x1c1a59[_0xa1eb('0x87')](function(_0x11d0ab){socket[_0xa1eb('0x76')](_0xa1eb('0x77'),{'UserId':_0x11d0ab['id'],'VoicePrefixId':_0x3d9f66['id']});});});});});}})[_0xa1eb('0x28')](respondWithStatusCode(_0x49441f,null))[_0xa1eb('0x4a')](handleError(_0x49441f,null));};exports['removeTeams']=function(_0x37e2d5,_0x1cfec1,_0x4d9d0b){return db['Team'][_0xa1eb('0x48')]({'where':{'id':_0x37e2d5['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa1eb('0x7d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa1eb('0x28')](handleEntityNotFound(_0x1cfec1,null))[_0xa1eb('0x28')](function(_0x5b8b32){var _0xe47df5=_[_0xa1eb('0x31')](_0x5b8b32,'id');var _0x382643=[];var _0x89e33c=[];var _0x4f535b=squel[_0xa1eb('0x88')]();_0x4f535b[_0xa1eb('0x89')](_0xa1eb('0x8a'))[_0xa1eb('0x8b')](_0xa1eb('0x8c'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa1eb('0x40')](_0xa1eb('0x8d'),_0x37e2d5[_0xa1eb('0x4c')]['id']);for(var _0x3da094=0x0;_0x3da094<_0x5b8b32[_0xa1eb('0x3b')];_0x3da094+=0x1){let _0x41e608=_0x5b8b32[_0x3da094];for(var _0x934746=0x0;_0x934746<_0x41e608[_0xa1eb('0x82')][_0xa1eb('0x3b')];_0x934746+=0x1){let _0x34e1ae=_0x41e608[_0xa1eb('0x82')][_0x934746];var _0x368e4e=_0x4f535b[_0xa1eb('0x8e')]();_0x368e4e[_0xa1eb('0x40')](_0xa1eb('0x8f'),_0x34e1ae['id']);_0x89e33c[_0xa1eb('0x69')](db[_0xa1eb('0x53')]['query'](_0x368e4e[_0xa1eb('0x90')](),{'type':db[_0xa1eb('0x53')]['QueryTypes'][_0xa1eb('0x91')]})[_0xa1eb('0x28')](function(_0x155a90){if(_0x155a90[_0xa1eb('0x3b')]===0x1){return _0x34e1ae['id'];}else{var _0x1d018a=_['every'](_['map'](_0x155a90,_0xa1eb('0x92')),function(_0x4ab784){return _[_0xa1eb('0x93')](_0xe47df5,_0x4ab784);});if(_0x1d018a){return _0x34e1ae['id'];}}}));}}return BPromise[_0xa1eb('0x94')](_0x89e33c)['then'](function(_0x4e3121){_0x382643=_(_0x382643)['union'](_0x4e3121)[_0xa1eb('0x95')]()['value']();return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x37e2d5[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](function(_0x29ecae){return db[_0xa1eb('0x53')][_0xa1eb('0x54')](function(_0x5a0dd4){return _0x29ecae[_0xa1eb('0x96')](_0x37e2d5[_0xa1eb('0x38')][_0xa1eb('0x74')],{'transaction':_0x5a0dd4})['then'](function(){if(!_['isEmpty'](_0x382643)){return _0x29ecae[_0xa1eb('0x78')](_0x382643,{'transaction':_0x5a0dd4});}})[_0xa1eb('0x28')](function(){_0x382643[_0xa1eb('0x87')](function(_0x42720b){socket[_0xa1eb('0x76')]('userVoicePrefix:remove',{'UserId':_0x42720b,'VoicePrefixId':_0x29ecae['id']});});});});});});})[_0xa1eb('0x28')](respondWithStatusCode(_0x1cfec1,null))['catch'](handleError(_0x1cfec1,null));}; \ No newline at end of file +var _0x0abf=['show','params','rawAttributes','length','merge','find','sequelize','transaction','body','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoicePrefixes','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','type','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','VoiceExtensionId','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','goto','charAt','update','system-','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','getTeams','Team','Agents','voicePause','flatMap','addTeams','each','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','VoicePrefix','fieldName','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x2584e5,_0x1f60d4){var _0x3ab81e=function(_0x84a204){while(--_0x84a204){_0x2584e5['push'](_0x2584e5['shift']());}};_0x3ab81e(++_0x1f60d4);}(_0x0abf,0xe8));var _0xf0ab=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0abf[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0ab('0x11'));var logger=require('../../config/logger')(_0xf0ab('0x12'));var utils=require(_0xf0ab('0x13'));var config=require(_0xf0ab('0x14'));var licenseUtil=require(_0xf0ab('0x15'));var db=require(_0xf0ab('0x16'))['db'];config[_0xf0ab('0x17')]=_[_0xf0ab('0x18')](config['redis'],{'host':_0xf0ab('0x19'),'port':0x18eb});var socket=require(_0xf0ab('0x1a'))(new Redis(config[_0xf0ab('0x17')]));require(_0xf0ab('0x1b'))[_0xf0ab('0x1c')](socket);function respondWithStatusCode(_0x36cabe,_0x3d7129){_0x3d7129=_0x3d7129||0xcc;return function(_0x1fb4e5){if(_0x1fb4e5){return _0x36cabe[_0xf0ab('0x1d')](_0x3d7129);}return _0x36cabe[_0xf0ab('0x1e')](_0x3d7129)[_0xf0ab('0x1f')]();};}function respondWithResult(_0x221bac,_0x200cf5){_0x200cf5=_0x200cf5||0xc8;return function(_0x2f4618){if(_0x2f4618){return _0x221bac[_0xf0ab('0x1e')](_0x200cf5)['json'](_0x2f4618);}};}function respondWithFilteredResult(_0x457465,_0x9e3b47){return function(_0x1803f0){if(_0x1803f0){var _0x1ffeb5=typeof _0x9e3b47[_0xf0ab('0x20')]===_0xf0ab('0x21')&&typeof _0x9e3b47[_0xf0ab('0x22')]===_0xf0ab('0x21');var _0x1713d6=_0x1803f0[_0xf0ab('0x23')];var _0x715579=_0x1ffeb5?0x0:_0x9e3b47[_0xf0ab('0x20')];var _0xf43bc4=_0x1ffeb5?_0x1803f0[_0xf0ab('0x23')]:_0x9e3b47[_0xf0ab('0x20')]+_0x9e3b47[_0xf0ab('0x22')];var _0x537673;if(_0xf43bc4>=_0x1713d6){_0xf43bc4=_0x1713d6;_0x537673=0xc8;}else{_0x537673=0xce;}_0x457465[_0xf0ab('0x1e')](_0x537673);return _0x457465[_0xf0ab('0x24')](_0xf0ab('0x25'),_0x715579+'-'+_0xf43bc4+'/'+_0x1713d6)[_0xf0ab('0x26')](_0x1803f0);}return null;};}function patchUpdates(_0x3bf6a1){return function(_0x374531){try{jsonpatch[_0xf0ab('0x27')](_0x374531,_0x3bf6a1,!![]);}catch(_0x20140b){return BPromise[_0xf0ab('0x28')](_0x20140b);}return _0x374531[_0xf0ab('0x29')]();};}function saveUpdates(_0x43119f,_0x5645b2){return function(_0x585841){if(_0x585841){return _0x585841['update'](_0x43119f)[_0xf0ab('0x2a')](function(_0x4f0caf){return _0x4f0caf;});}return null;};}function removeEntity(_0x3eca32,_0x16b979){return function(_0x51ac90){if(_0x51ac90){return _0x51ac90[_0xf0ab('0x2b')]()[_0xf0ab('0x2a')](function(){var _0x10bf5f=_0x51ac90[_0xf0ab('0x2c')]({'plain':!![]});var _0x7d4ff9='VoicePrefixes';return db[_0xf0ab('0x2d')]['destroy']({'where':{'type':_0x7d4ff9,'resourceId':_0x10bf5f['id']}})['then'](function(){return _0x51ac90;});})[_0xf0ab('0x2a')](function(){_0x3eca32[_0xf0ab('0x1e')](0xcc)[_0xf0ab('0x1f')]();});}};}function handleEntityNotFound(_0x445160,_0x43476c){return function(_0x174052){if(!_0x174052){_0x445160[_0xf0ab('0x1d')](0x194);}return _0x174052;};}function handleError(_0x14da9c,_0x76a3f3){_0x76a3f3=_0x76a3f3||0x1f4;return function(_0x2f0fcd){logger[_0xf0ab('0x2e')](_0x2f0fcd[_0xf0ab('0x2f')]);if(_0x2f0fcd['name']){delete _0x2f0fcd[_0xf0ab('0x30')];}_0x14da9c[_0xf0ab('0x1e')](_0x76a3f3)['send'](_0x2f0fcd);};}exports['index']=function(_0x1eff91,_0x1dc84e){var _0x43e500={},_0x4dd5b7={},_0x58efce={'count':0x0,'rows':[]};var _0x3ef37c=_['map'](db[_0xf0ab('0x31')]['rawAttributes'],function(_0x3f66fa){return{'name':_0x3f66fa[_0xf0ab('0x32')],'type':_0x3f66fa['type']['key']};});_0x4dd5b7[_0xf0ab('0x33')]=_[_0xf0ab('0x34')](_0x3ef37c,_0xf0ab('0x30'));_0x4dd5b7[_0xf0ab('0x35')]=_[_0xf0ab('0x36')](_0x1eff91[_0xf0ab('0x35')]);_0x4dd5b7[_0xf0ab('0x37')]=_[_0xf0ab('0x38')](_0x4dd5b7[_0xf0ab('0x33')],_0x4dd5b7[_0xf0ab('0x35')]);_0x43e500[_0xf0ab('0x39')]=_[_0xf0ab('0x38')](_0x4dd5b7[_0xf0ab('0x33')],qs[_0xf0ab('0x3a')](_0x1eff91['query'][_0xf0ab('0x3a')]));_0x43e500[_0xf0ab('0x39')]=_0x43e500[_0xf0ab('0x39')]['length']?_0x43e500[_0xf0ab('0x39')]:_0x4dd5b7[_0xf0ab('0x33')];if(!_0x1eff91[_0xf0ab('0x35')]['hasOwnProperty'](_0xf0ab('0x3b'))){_0x43e500['limit']=qs[_0xf0ab('0x22')](_0x1eff91['query'][_0xf0ab('0x22')]);_0x43e500[_0xf0ab('0x20')]=qs[_0xf0ab('0x20')](_0x1eff91[_0xf0ab('0x35')][_0xf0ab('0x20')]);}_0x43e500[_0xf0ab('0x3c')]=qs['sort'](_0x1eff91[_0xf0ab('0x35')][_0xf0ab('0x3d')]);_0x43e500['where']=qs[_0xf0ab('0x37')](_[_0xf0ab('0x3e')](_0x1eff91[_0xf0ab('0x35')],_0x4dd5b7[_0xf0ab('0x37')]),_0x3ef37c);if(_0x1eff91[_0xf0ab('0x35')][_0xf0ab('0x3f')]){_0x43e500[_0xf0ab('0x40')]=_['merge'](_0x43e500[_0xf0ab('0x40')],{'$or':_[_0xf0ab('0x34')](_0x3ef37c,function(_0x7c4629){if(_0x7c4629['type']!==_0xf0ab('0x41')){var _0x234315={};_0x234315[_0x7c4629[_0xf0ab('0x30')]]={'$like':'%'+_0x1eff91[_0xf0ab('0x35')][_0xf0ab('0x3f')]+'%'};return _0x234315;}})});}_0x43e500=_['merge']({},_0x43e500,_0x1eff91[_0xf0ab('0x42')]);var _0x39a212={'where':_0x43e500[_0xf0ab('0x40')]};return db[_0xf0ab('0x31')][_0xf0ab('0x23')](_0x39a212)[_0xf0ab('0x2a')](function(_0x45849c){_0x58efce[_0xf0ab('0x23')]=_0x45849c;if(_0x1eff91[_0xf0ab('0x35')][_0xf0ab('0x43')]){_0x43e500[_0xf0ab('0x44')]=[{'all':!![]}];}return db[_0xf0ab('0x31')][_0xf0ab('0x45')](_0x43e500);})['then'](function(_0x4c4ab9){_0x58efce[_0xf0ab('0x46')]=_0x4c4ab9;return _0x58efce;})['then'](respondWithFilteredResult(_0x1dc84e,_0x43e500))[_0xf0ab('0x47')](handleError(_0x1dc84e,null));};exports[_0xf0ab('0x48')]=function(_0x4bbdf6,_0x8c2d2c){var _0x17ac48={'raw':![],'where':{'id':_0x4bbdf6[_0xf0ab('0x49')]['id']}},_0x591d37={};_0x591d37[_0xf0ab('0x33')]=_[_0xf0ab('0x36')](db[_0xf0ab('0x31')][_0xf0ab('0x4a')]);_0x591d37[_0xf0ab('0x35')]=_[_0xf0ab('0x36')](_0x4bbdf6[_0xf0ab('0x35')]);_0x591d37[_0xf0ab('0x37')]=_[_0xf0ab('0x38')](_0x591d37[_0xf0ab('0x33')],_0x591d37[_0xf0ab('0x35')]);_0x17ac48[_0xf0ab('0x39')]=_[_0xf0ab('0x38')](_0x591d37['model'],qs['fields'](_0x4bbdf6[_0xf0ab('0x35')]['fields']));_0x17ac48['attributes']=_0x17ac48['attributes'][_0xf0ab('0x4b')]?_0x17ac48[_0xf0ab('0x39')]:_0x591d37[_0xf0ab('0x33')];if(_0x4bbdf6[_0xf0ab('0x35')][_0xf0ab('0x43')]){_0x17ac48[_0xf0ab('0x44')]=[{'all':!![]}];}_0x17ac48=_[_0xf0ab('0x4c')]({},_0x17ac48,_0x4bbdf6[_0xf0ab('0x42')]);return db[_0xf0ab('0x31')][_0xf0ab('0x4d')](_0x17ac48)[_0xf0ab('0x2a')](handleEntityNotFound(_0x8c2d2c,null))[_0xf0ab('0x2a')](respondWithResult(_0x8c2d2c,null))['catch'](handleError(_0x8c2d2c,null));};exports[_0xf0ab('0x2b')]=function(_0x41065c,_0x43abde){return db[_0xf0ab('0x31')][_0xf0ab('0x4d')]({'where':{'id':_0x41065c[_0xf0ab('0x49')]['id']}})[_0xf0ab('0x2a')](handleEntityNotFound(_0x43abde,null))[_0xf0ab('0x2a')](removeEntity(_0x43abde,null))['catch'](handleError(_0x43abde,null));};exports['describe']=function(_0x51b4a9,_0xc73871){return db[_0xf0ab('0x31')]['describe']()[_0xf0ab('0x2a')](respondWithResult(_0xc73871,null))[_0xf0ab('0x47')](handleError(_0xc73871,null));};exports['create']=function(_0x1a9981,_0x53d6a4){var _0x1352ac;return db[_0xf0ab('0x4e')][_0xf0ab('0x4f')](function(_0x33112b){return db[_0xf0ab('0x31')]['create'](_0x1a9981[_0xf0ab('0x50')],{'transaction':_0x33112b})['then'](function(_0x229184){_0x1352ac=_0x229184['get']({'plain':!![]});return db[_0xf0ab('0x51')]['find']({'where':{'id':_0x1352ac['VoiceExtensionId']},'raw':!![]})[_0xf0ab('0x2a')](function(_0x58ac39){return createVoicePrefixExtensions(_0x1352ac,_0x58ac39,_0x33112b);});});})[_0xf0ab('0x2a')](function(){var _0x54efed=_0x1a9981[_0xf0ab('0x52')]['get']({'plain':!![]});if(!_0x54efed)throw new Error(_0xf0ab('0x53'));if(_0x54efed[_0xf0ab('0x54')]===_0xf0ab('0x52')){var _0x57f9dd=_0x1352ac;return db['UserProfileSection']['find']({'where':{'name':_0xf0ab('0x55'),'userProfileId':_0x54efed[_0xf0ab('0x56')]},'raw':!![]})['then'](function(_0x511e23){if(_0x511e23&&_0x511e23[_0xf0ab('0x57')]===0x0){return db[_0xf0ab('0x2d')][_0xf0ab('0x58')]({'name':_0x57f9dd[_0xf0ab('0x30')],'resourceId':_0x57f9dd['id'],'type':_0x511e23[_0xf0ab('0x30')],'sectionId':_0x511e23['id']},{})[_0xf0ab('0x2a')](function(){return _0x1352ac;});}else{return _0x1352ac;}})[_0xf0ab('0x47')](function(_0x3bc749){logger[_0xf0ab('0x2e')](_0xf0ab('0x59'),_0x3bc749);throw _0x3bc749;});}return _0x1352ac;})[_0xf0ab('0x2a')](respondWithResult(_0x53d6a4,null))['catch'](handleError(_0x53d6a4,null));};function Extension(_0x41ed17,_0x5b24e3,_0x185b3c,_0x61d3db){this[_0xf0ab('0x5a')]=_0xf0ab('0x5b');this[_0xf0ab('0x5c')]=_0x41ed17;this[_0xf0ab('0x5d')]=_0x185b3c;this[_0xf0ab('0x5e')]=_0xf0ab('0x5f');this[_0xf0ab('0x60')]=_0xf0ab('0x61');this['priority']=_0x5b24e3;this[_0xf0ab('0x62')]=_0x61d3db;}function createVoicePrefixExtensions(_0x2266f3,_0x4062b7,_0x1d4a72){return new BPromise(function(_0x2232eb,_0x314a26){var _0x2a906e=new Extension(formatPrefixName(_0x2266f3[_0xf0ab('0x63')]),0x1,_0xf0ab('0x64'),'Voice\x20Prefix');_0x2a906e['VoicePrefixId']=_0x2266f3['id'];return db[_0xf0ab('0x51')][_0xf0ab('0x58')](_0x2a906e,{'transaction':_0x1d4a72})[_0xf0ab('0x2a')](function(_0x52058a){var _0x3f6c02=_0x52058a[_0xf0ab('0x2c')]({'plain':!![]});var _0xd61dcf=_['map'](addVoicePrefixExtensions(_0x2266f3,_0x4062b7),function(_0x2c1a44){_0x2c1a44[_0xf0ab('0x65')]=_0x3f6c02['id'];_0x2c1a44[_0xf0ab('0x66')]=_0x2266f3['id'];return _0x2c1a44;});return db[_0xf0ab('0x51')][_0xf0ab('0x67')](_0xd61dcf,{'transaction':_0x1d4a72})['then'](function(_0x3f0e11){if(!_0x3f0e11){return _0x314a26(_0xf0ab('0x68'));}else{return _0x2232eb(_0x3f0e11);}})[_0xf0ab('0x47')](function(_0x4531ae){return _0x314a26(_0x4531ae);});});;});};function addVoicePrefixExtensions(_0x14cd6f,_0x3ba915){var _0xe3fc19=[];var _0x2b0b89=formatPrefixName(_0x14cd6f[_0xf0ab('0x63')]);_0xe3fc19[_0xf0ab('0x69')](new Extension(_0x2b0b89,0x2,_0xf0ab('0x6a'),_0xf0ab('0x6b')+_0x14cd6f[_0xf0ab('0x30')]));if(_0x14cd6f['callerIdAll']){_0xe3fc19['push'](new Extension(_0x2b0b89,0x3,_0xf0ab('0x6a'),_0xf0ab('0x6c')+_0x14cd6f[_0xf0ab('0x6d')]));}else{_0xe3fc19['push'](new Extension(_0x2b0b89,0x3,_0xf0ab('0x64'),'No\x20callerid\x20available'));}_0xe3fc19[_0xf0ab('0x69')](new Extension(_0x2b0b89,0x4,_0xf0ab('0x6e'),_0x3ba915[_0xf0ab('0x5a')]+','+'${EXTEN:'+(0x8+_0x14cd6f[_0xf0ab('0x30')]['length'])+'}'+','+0x1));return _0xe3fc19;}function formatPrefixName(_0x5dbeac){var _0x43f9c0='_';for(var _0x461c7a=0x0;_0x461c7a<_0x5dbeac[_0xf0ab('0x4b')];_0x461c7a++){if(_0x5dbeac['charAt'](_0x461c7a)=='-'){_0x43f9c0+=_0x5dbeac[_0xf0ab('0x6f')](_0x461c7a);}else{_0x43f9c0+='['+_0x5dbeac[_0xf0ab('0x6f')](_0x461c7a)+']';}}_0x43f9c0+='.';return _0x43f9c0;}exports[_0xf0ab('0x70')]=function(_0x122c41,_0x5b6923,_0x50137a){var _0x5398e2=_0x122c41[_0xf0ab('0x50')];_0x5398e2[_0xf0ab('0x63')]=_0xf0ab('0x71')+_0x5398e2[_0xf0ab('0x30')]+'-';return db[_0xf0ab('0x4e')][_0xf0ab('0x4f')](function(_0x3a5205){return db[_0xf0ab('0x31')][_0xf0ab('0x70')](_0x5398e2,{'where':{'id':_0x5398e2['id']},'transaction':_0x3a5205})[_0xf0ab('0x2a')](function(){return db[_0xf0ab('0x51')]['destroy']({'where':{'VoicePrefixId':_0x5398e2['id']},'transaction':_0x3a5205})[_0xf0ab('0x2a')](function(){return db[_0xf0ab('0x51')][_0xf0ab('0x4d')]({'where':{'id':_0x5398e2[_0xf0ab('0x65')]},'raw':!![]})[_0xf0ab('0x2a')](function(_0x2d9797){return createVoicePrefixExtensions(_0x5398e2,_0x2d9797,_0x3a5205);});});});})[_0xf0ab('0x2a')](function(){return db[_0xf0ab('0x31')]['findById'](_0x5398e2['id']);})[_0xf0ab('0x2a')](respondWithResult(_0x5b6923,null))[_0xf0ab('0x47')](handleError(_0x5b6923,null));};exports['addAgents']=function(_0x515e2f,_0x4b1a28,_0x331433){return db[_0xf0ab('0x31')][_0xf0ab('0x4d')]({'where':{'id':_0x515e2f[_0xf0ab('0x49')]['id']}})[_0xf0ab('0x2a')](handleEntityNotFound(_0x4b1a28,null))[_0xf0ab('0x2a')](function(_0x4d011e){if(_0x4d011e){return _0x4d011e[_0xf0ab('0x72')](_0x515e2f['body'][_0xf0ab('0x73')],_['omit'](_0x515e2f[_0xf0ab('0x50')],['ids','id'])||{})[_0xf0ab('0x74')](function(_0x4ffd8d){for(var _0x58ca28=0x0;_0x58ca28<_0x515e2f[_0xf0ab('0x50')][_0xf0ab('0x73')][_0xf0ab('0x4b')];_0x58ca28+=0x1){socket[_0xf0ab('0x75')](_0xf0ab('0x76'),{'UserId':Number(_0x515e2f[_0xf0ab('0x50')][_0xf0ab('0x73')][_0x58ca28]),'VoicePrefixId':Number(_0x515e2f[_0xf0ab('0x49')]['id'])});}return _0x4ffd8d;});}})[_0xf0ab('0x2a')](respondWithResult(_0x4b1a28,null))[_0xf0ab('0x47')](handleError(_0x4b1a28,null));};exports[_0xf0ab('0x77')]=function(_0x31f464,_0x228688,_0x59d215){return db[_0xf0ab('0x31')][_0xf0ab('0x4d')]({'where':{'id':_0x31f464[_0xf0ab('0x49')]['id']}})[_0xf0ab('0x2a')](handleEntityNotFound(_0x228688,null))[_0xf0ab('0x2a')](function(_0x3aafc4){if(_0x3aafc4){return _0x3aafc4[_0xf0ab('0x77')](_0x31f464[_0xf0ab('0x35')][_0xf0ab('0x73')])[_0xf0ab('0x2a')](function(){if(_[_0xf0ab('0x78')](_0x31f464[_0xf0ab('0x35')]['ids'])){for(var _0x38249b=0x0;_0x38249b<_0x31f464[_0xf0ab('0x35')][_0xf0ab('0x73')][_0xf0ab('0x4b')];_0x38249b+=0x1){socket['emit'](_0xf0ab('0x79'),{'UserId':Number(_0x31f464[_0xf0ab('0x35')][_0xf0ab('0x73')][_0x38249b]),'VoicePrefixId':Number(_0x31f464[_0xf0ab('0x49')]['id'])});}}else{socket[_0xf0ab('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x31f464[_0xf0ab('0x35')][_0xf0ab('0x73')]),'VoicePrefixId':Number(_0x31f464['params']['id'])});}});}})[_0xf0ab('0x2a')](respondWithStatusCode(_0x228688,null))['catch'](handleError(_0x228688,null));};exports[_0xf0ab('0x7a')]=function(_0x277cec,_0x597a3d,_0x104542){var _0x148a72={};var _0x4c62cb={};var _0x4c5e63;var _0x2cffac;return db['VoicePrefix'][_0xf0ab('0x7b')]({'where':{'id':_0x277cec[_0xf0ab('0x49')]['id']}})['then'](handleEntityNotFound(_0x597a3d,null))['then'](function(_0x50c52c){if(_0x50c52c){_0x4c5e63=_0x50c52c;_0x4c62cb[_0xf0ab('0x33')]=_[_0xf0ab('0x36')](db[_0xf0ab('0x7c')][_0xf0ab('0x4a')]);_0x4c62cb['query']=_[_0xf0ab('0x36')](_0x277cec[_0xf0ab('0x35')]);_0x4c62cb[_0xf0ab('0x37')]=_[_0xf0ab('0x38')](_0x4c62cb[_0xf0ab('0x33')],_0x4c62cb['query']);_0x148a72['attributes']=_[_0xf0ab('0x38')](_0x4c62cb[_0xf0ab('0x33')],qs['fields'](_0x277cec['query'][_0xf0ab('0x3a')]));_0x148a72[_0xf0ab('0x39')]=_0x148a72[_0xf0ab('0x39')][_0xf0ab('0x4b')]?_0x148a72[_0xf0ab('0x39')]:_0x4c62cb[_0xf0ab('0x33')];_0x148a72[_0xf0ab('0x3c')]=qs[_0xf0ab('0x3d')](_0x277cec[_0xf0ab('0x35')][_0xf0ab('0x3d')]);_0x148a72[_0xf0ab('0x40')]=qs['filters'](_['pick'](_0x277cec[_0xf0ab('0x35')],_0x4c62cb['filters']));if(_0x277cec[_0xf0ab('0x35')][_0xf0ab('0x3f')]){_0x148a72[_0xf0ab('0x40')]=_[_0xf0ab('0x4c')](_0x148a72['where'],{'$or':_[_0xf0ab('0x34')](_0x148a72[_0xf0ab('0x39')],function(_0x22923d){var _0xde9d9a={};_0xde9d9a[_0x22923d]={'$like':'%'+_0x277cec[_0xf0ab('0x35')][_0xf0ab('0x3f')]+'%'};return _0xde9d9a;})});}_0x148a72=_[_0xf0ab('0x4c')]({},_0x148a72,_0x277cec[_0xf0ab('0x42')]);return _0x4c5e63[_0xf0ab('0x7a')](_0x148a72);}})[_0xf0ab('0x2a')](function(_0x8671e7){if(_0x8671e7){_0x2cffac=_0x8671e7[_0xf0ab('0x4b')];if(!_0x277cec[_0xf0ab('0x35')][_0xf0ab('0x7d')]('nolimit')){_0x148a72[_0xf0ab('0x22')]=qs[_0xf0ab('0x22')](_0x277cec[_0xf0ab('0x35')][_0xf0ab('0x22')]);_0x148a72[_0xf0ab('0x20')]=qs[_0xf0ab('0x20')](_0x277cec[_0xf0ab('0x35')]['offset']);}return _0x4c5e63['getAgents'](_0x148a72);}})[_0xf0ab('0x2a')](function(_0x200a20){if(_0x200a20){return _0x200a20?{'count':_0x2cffac,'rows':_0x200a20}:null;}})[_0xf0ab('0x2a')](respondWithResult(_0x597a3d,null))['catch'](handleError(_0x597a3d,null));};exports[_0xf0ab('0x7e')]=function(_0x405b34,_0x2dc1d5,_0x1a717e){var _0x334718={};var _0x543638={};var _0x4a91dc;var _0x2a3dd3;return db['VoicePrefix'][_0xf0ab('0x7b')]({'where':{'id':_0x405b34[_0xf0ab('0x49')]['id']}})['then'](handleEntityNotFound(_0x2dc1d5,null))[_0xf0ab('0x2a')](function(_0x223090){if(_0x223090){_0x4a91dc=_0x223090;_0x543638[_0xf0ab('0x33')]=_[_0xf0ab('0x36')](db[_0xf0ab('0x7f')]['rawAttributes']);_0x543638[_0xf0ab('0x35')]=_[_0xf0ab('0x36')](_0x405b34[_0xf0ab('0x35')]);_0x543638[_0xf0ab('0x37')]=_[_0xf0ab('0x38')](_0x543638['model'],_0x543638[_0xf0ab('0x35')]);_0x334718[_0xf0ab('0x39')]=_[_0xf0ab('0x38')](_0x543638[_0xf0ab('0x33')],qs[_0xf0ab('0x3a')](_0x405b34['query'][_0xf0ab('0x3a')]));_0x334718[_0xf0ab('0x39')]=_0x334718[_0xf0ab('0x39')]['length']?_0x334718[_0xf0ab('0x39')]:_0x543638['model'];_0x334718[_0xf0ab('0x3c')]=qs[_0xf0ab('0x3d')](_0x405b34[_0xf0ab('0x35')][_0xf0ab('0x3d')]);_0x334718['where']=qs[_0xf0ab('0x37')](_['pick'](_0x405b34['query'],_0x543638[_0xf0ab('0x37')]));if(_0x405b34['query']['filter']){_0x334718[_0xf0ab('0x40')]=_[_0xf0ab('0x4c')](_0x334718['where'],{'$or':_['map'](_0x334718['attributes'],function(_0x4ca025){var _0x3cba0d={};_0x3cba0d[_0x4ca025]={'$like':'%'+_0x405b34[_0xf0ab('0x35')][_0xf0ab('0x3f')]+'%'};return _0x3cba0d;})});}_0x334718=_[_0xf0ab('0x4c')]({},_0x334718,_0x405b34[_0xf0ab('0x42')]);return _0x4a91dc['getTeams'](_0x334718);}})[_0xf0ab('0x2a')](function(_0x2dd8c0){if(_0x2dd8c0){_0x2a3dd3=_0x2dd8c0[_0xf0ab('0x4b')];if(!_0x405b34[_0xf0ab('0x35')][_0xf0ab('0x7d')](_0xf0ab('0x3b'))){_0x334718[_0xf0ab('0x22')]=qs['limit'](_0x405b34[_0xf0ab('0x35')][_0xf0ab('0x22')]);_0x334718[_0xf0ab('0x20')]=qs[_0xf0ab('0x20')](_0x405b34[_0xf0ab('0x35')][_0xf0ab('0x20')]);}return _0x4a91dc['getTeams'](_0x334718);}})[_0xf0ab('0x2a')](function(_0x45a3f3){if(_0x45a3f3){return _0x45a3f3?{'count':_0x2a3dd3,'rows':_0x45a3f3}:null;}})[_0xf0ab('0x2a')](respondWithResult(_0x2dc1d5,null))[_0xf0ab('0x47')](handleError(_0x2dc1d5,null));};exports['addTeams']=function(_0x426419,_0x395bf6,_0x5b7744){var _0x4a0a43=_0x426419[_0xf0ab('0x50')][_0xf0ab('0x73')];var _0x89b176;return db[_0xf0ab('0x7f')][_0xf0ab('0x45')]({'where':{'id':_0x4a0a43},'attributes':['id'],'include':[{'model':db[_0xf0ab('0x7c')],'as':_0xf0ab('0x80'),'attributes':['id',_0xf0ab('0x30'),'online',_0xf0ab('0x81'),'interface'],'raw':!![]}]})['then'](function(_0x2e7aff){if(_0x2e7aff){_0x89b176=_0x2e7aff;var _0x1e9aab=_[_0xf0ab('0x82')](_0x2e7aff,function(_0x3c799f){var _0x409295=_0x3c799f[_0xf0ab('0x2c')]({'plain':!![]});return _0x409295[_0xf0ab('0x80')];});return db[_0xf0ab('0x31')]['find']({'where':{'id':_0x426419[_0xf0ab('0x49')]['id']}})[_0xf0ab('0x2a')](function(_0x202014){return db[_0xf0ab('0x4e')][_0xf0ab('0x4f')](function(_0x42cb5f){return _0x202014[_0xf0ab('0x83')](_0x4a0a43,{'transaction':_0x42cb5f})[_0xf0ab('0x2a')](function(){return BPromise[_0xf0ab('0x84')](_0x89b176,function(_0x1c77e4){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x1c77e4['id'],'VoicePrefixId':_0x426419['params']['id']},{'transaction':_0x42cb5f});});})[_0xf0ab('0x2a')](function(){return BPromise['each'](_0x1e9aab,function(_0x562b44){return db[_0xf0ab('0x85')][_0xf0ab('0x86')]({'where':{'UserId':_0x562b44['id'],'VoicePrefixId':_0x426419[_0xf0ab('0x49')]['id']},'transaction':_0x42cb5f});});})[_0xf0ab('0x2a')](function(){_0x1e9aab[_0xf0ab('0x87')](function(_0x55a296){socket[_0xf0ab('0x75')](_0xf0ab('0x76'),{'UserId':_0x55a296['id'],'VoicePrefixId':_0x202014['id']});});});});});}})[_0xf0ab('0x2a')](respondWithStatusCode(_0x395bf6,null))[_0xf0ab('0x47')](handleError(_0x395bf6,null));};exports[_0xf0ab('0x88')]=function(_0x1c7ced,_0x3130ea,_0x44d791){return db['Team'][_0xf0ab('0x45')]({'where':{'id':_0x1c7ced['query'][_0xf0ab('0x73')]},'attributes':['id'],'include':[{'model':db[_0xf0ab('0x7c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf0ab('0x2a')](handleEntityNotFound(_0x3130ea,null))[_0xf0ab('0x2a')](function(_0x485eb3){var _0x42a8c4=_[_0xf0ab('0x34')](_0x485eb3,'id');var _0x2286b1=[];var _0x1f2efa=[];var _0x1d12fb=squel[_0xf0ab('0x89')]();_0x1d12fb['field'](_0xf0ab('0x8a'))[_0xf0ab('0x8b')]('team_has_voice_prefixes','tq')[_0xf0ab('0x8c')](_0xf0ab('0x8d'),'ut',_0xf0ab('0x8e'))[_0xf0ab('0x40')]('VoicePrefixId\x20=\x20?',_0x1c7ced['params']['id']);for(var _0x7c7c3b=0x0;_0x7c7c3b<_0x485eb3[_0xf0ab('0x4b')];_0x7c7c3b+=0x1){let _0x550b8c=_0x485eb3[_0x7c7c3b];for(var _0x2f957b=0x0;_0x2f957b<_0x550b8c[_0xf0ab('0x80')][_0xf0ab('0x4b')];_0x2f957b+=0x1){let _0x169831=_0x550b8c[_0xf0ab('0x80')][_0x2f957b];var _0x21283a=_0x1d12fb['clone']();_0x21283a[_0xf0ab('0x40')]('ut.UserId\x20=\x20?',_0x169831['id']);_0x1f2efa[_0xf0ab('0x69')](db[_0xf0ab('0x4e')][_0xf0ab('0x35')](_0x21283a['toString'](),{'type':db[_0xf0ab('0x4e')][_0xf0ab('0x8f')][_0xf0ab('0x90')]})[_0xf0ab('0x2a')](function(_0x3b4538){if(_0x3b4538[_0xf0ab('0x4b')]===0x1){return _0x169831['id'];}else{var _0x31689f=_[_0xf0ab('0x91')](_[_0xf0ab('0x34')](_0x3b4538,'TeamId'),function(_0x4ca354){return _[_0xf0ab('0x92')](_0x42a8c4,_0x4ca354);});if(_0x31689f){return _0x169831['id'];}}}));}}return BPromise[_0xf0ab('0x93')](_0x1f2efa)[_0xf0ab('0x2a')](function(_0x3ece93){_0x2286b1=_(_0x2286b1)[_0xf0ab('0x94')](_0x3ece93)[_0xf0ab('0x95')]()[_0xf0ab('0x96')]();return db[_0xf0ab('0x31')][_0xf0ab('0x4d')]({'where':{'id':_0x1c7ced[_0xf0ab('0x49')]['id']}})['then'](function(_0x1ad0f1){return db[_0xf0ab('0x4e')][_0xf0ab('0x4f')](function(_0x45080a){return _0x1ad0f1[_0xf0ab('0x88')](_0x1c7ced[_0xf0ab('0x35')]['ids'],{'transaction':_0x45080a})[_0xf0ab('0x2a')](function(){if(!_[_0xf0ab('0x97')](_0x2286b1)){return _0x1ad0f1[_0xf0ab('0x77')](_0x2286b1,{'transaction':_0x45080a});}})['then'](function(){_0x2286b1[_0xf0ab('0x87')](function(_0x53f38b){socket['emit'](_0xf0ab('0x79'),{'UserId':_0x53f38b,'VoicePrefixId':_0x1ad0f1['id']});});});});});});})[_0xf0ab('0x2a')](respondWithStatusCode(_0x3130ea,null))[_0xf0ab('0x47')](handleError(_0x3130ea,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 61f0b47..e5a7012 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 _0x29f8=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove','emit'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x29f8,0x107));var _0x829f=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x29f8[_0x3de8a4];return _0x4635cf;};'use strict';var EventEmitter=require(_0x829f('0x0'));var VoicePrefix=require(_0x829f('0x1'))['db'][_0x829f('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x829f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x829f('0x4'),'afterDestroy':_0x829f('0x5')};function emitEvent(_0x486bb4){return function(_0x1ef470,_0xf11e6a,_0x50dac6){VoicePrefixEvents['emit'](_0x486bb4+':'+_0x1ef470['id'],_0x1ef470);VoicePrefixEvents[_0x829f('0x6')](_0x486bb4,_0x1ef470);_0x50dac6(null);};}for(var e in events){if(events[_0x829f('0x7')](e)){var event=events[e];VoicePrefix[_0x829f('0x8')](e,emitEvent(event));}}module[_0x829f('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0xb619=['save','update','emit','hasOwnProperty','hook','exports','events','VoicePrefix','setMaxListeners'];(function(_0x27d947,_0x793290){var _0x232459=function(_0x575cf8){while(--_0x575cf8){_0x27d947['push'](_0x27d947['shift']());}};_0x232459(++_0x793290);}(_0xb619,0x138));var _0x9b61=function(_0x4aee04,_0x117aa2){_0x4aee04=_0x4aee04-0x0;var _0x30471d=_0xb619[_0x4aee04];return _0x30471d;};'use strict';var EventEmitter=require(_0x9b61('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x9b61('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9b61('0x2')](0x0);var events={'afterCreate':_0x9b61('0x3'),'afterUpdate':_0x9b61('0x4'),'afterDestroy':'remove'};function emitEvent(_0x571163){return function(_0x2018ee,_0x34691d,_0x596ae8){VoicePrefixEvents[_0x9b61('0x5')](_0x571163+':'+_0x2018ee['id'],_0x2018ee);VoicePrefixEvents['emit'](_0x571163,_0x2018ee);_0x596ae8(null);};}for(var e in events){if(events[_0x9b61('0x6')](e)){var event=events[e];VoicePrefix[_0x9b61('0x7')](e,emitEvent(event));}}module[_0x9b61('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 30f8d5f..a5756fd 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 _0x607c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','util','api'];(function(_0x2e71ba,_0x4e04f4){var _0x4715d4=function(_0x33c8be){while(--_0x33c8be){_0x2e71ba['push'](_0x2e71ba['shift']());}};_0x4715d4(++_0x4e04f4);}(_0x607c,0xce));var _0xc607=function(_0x5c2a3c,_0x161e7c){_0x5c2a3c=_0x5c2a3c-0x0;var _0x92aa68=_0x607c[_0x5c2a3c];return _0x92aa68;};'use strict';var _=require('lodash');var util=require(_0xc607('0x0'));var logger=require('../../config/logger')(_0xc607('0x1'));var moment=require(_0xc607('0x2'));var BPromise=require(_0xc607('0x3'));var rp=require(_0xc607('0x4'));var fs=require('fs');var path=require(_0xc607('0x5'));var rimraf=require(_0xc607('0x6'));var config=require(_0xc607('0x7'));var attributes=require(_0xc607('0x8'));module[_0xc607('0x9')]=function(_0x3038ac,_0x1fd567){return _0x3038ac[_0xc607('0xa')](_0xc607('0xb'),attributes,{'tableName':_0xc607('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd36=['path','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdd36,0x85));var _0x6dd3=function(_0x49b651,_0xa5942){_0x49b651=_0x49b651-0x0;var _0x1e6324=_0xdd36[_0x49b651];return _0x1e6324;};'use strict';var _=require(_0x6dd3('0x0'));var util=require(_0x6dd3('0x1'));var logger=require(_0x6dd3('0x2'))(_0x6dd3('0x3'));var moment=require(_0x6dd3('0x4'));var BPromise=require(_0x6dd3('0x5'));var rp=require(_0x6dd3('0x6'));var fs=require('fs');var path=require(_0x6dd3('0x7'));var rimraf=require('rimraf');var config=require(_0x6dd3('0x8'));var attributes=require(_0x6dd3('0x9'));module[_0x6dd3('0xa')]=function(_0x6ed58b,_0x7ef6e7){return _0x6ed58b[_0x6dd3('0xb')](_0x6dd3('0xc'),attributes,{'tableName':_0x6dd3('0xd'),'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 6f750c8..36d034b 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 _0x9f0e=['../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','then','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x3ce35f,_0x45f92e){var _0xd2f6e6=function(_0x4d5692){while(--_0x4d5692){_0x3ce35f['push'](_0x3ce35f['shift']());}};_0xd2f6e6(++_0x45f92e);}(_0x9f0e,0x116));var _0xe9f0=function(_0x41c2f2,_0x2ebb15){_0x41c2f2=_0x41c2f2-0x0;var _0x8ce8de=_0x9f0e[_0x41c2f2];return _0x8ce8de;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xe9f0('0xa')]=_[_0xe9f0('0xb')](config[_0xe9f0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config[_0xe9f0('0xa')]));require(_0xe9f0('0xd'))[_0xe9f0('0xe')](socket);function respondWithRpcPromise(_0xa523c0,_0x240932,_0x807322){return new BPromise(function(_0x3724f4,_0x6acfb){return client['request'](_0xa523c0,_0x807322)[_0xe9f0('0xf')](function(_0x329ecd){logger[_0xe9f0('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x240932,_0xe9f0('0x11'));logger['debug'](_0xe9f0('0x12'),_0x240932,_0xe9f0('0x11'),JSON[_0xe9f0('0x13')](_0x329ecd));if(_0x329ecd[_0xe9f0('0x14')]){if(_0x329ecd['error'][_0xe9f0('0x15')]===0x1f4){logger['error'](_0xe9f0('0x16'),_0x240932,_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);return _0x6acfb(_0x329ecd['error'][_0xe9f0('0x17')]);}logger[_0xe9f0('0x14')](_0xe9f0('0x16'),_0x240932,_0x329ecd['error'][_0xe9f0('0x17')]);return _0x3724f4(_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);}else{logger[_0xe9f0('0x10')](_0xe9f0('0x16'),_0x240932,_0xe9f0('0x11'));_0x3724f4(_0x329ecd[_0xe9f0('0x18')]['message']);}})[_0xe9f0('0x19')](function(_0x19e090){logger[_0xe9f0('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x240932,_0x19e090);_0x6acfb(_0x19e090);});});} \ No newline at end of file +var _0xf03a=['client','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xf03a,0x1a0));var _0xaf03=function(_0x17d793,_0x19cd1d){_0x17d793=_0x17d793-0x0;var _0x53a666=_0xf03a[_0x17d793];return _0x53a666;};'use strict';var _=require('lodash');var util=require(_0xaf03('0x0'));var moment=require(_0xaf03('0x1'));var BPromise=require(_0xaf03('0x2'));var rs=require(_0xaf03('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf03('0x4'))['db'];var utils=require(_0xaf03('0x5'));var logger=require('../../config/logger')(_0xaf03('0x6'));var config=require(_0xaf03('0x7'));var jayson=require(_0xaf03('0x8'));var client=jayson[_0xaf03('0x9')]['http']({'port':0x232a});config[_0xaf03('0xa')]=_['defaults'](config[_0xaf03('0xa')],{'host':_0xaf03('0xb'),'port':0x18eb});var socket=require(_0xaf03('0xc'))(new Redis(config[_0xaf03('0xa')]));require(_0xaf03('0xd'))[_0xaf03('0xe')](socket);function respondWithRpcPromise(_0x52d7fe,_0x1f3a5c,_0x12e1a1){return new BPromise(function(_0x4766d1,_0x33803e){return client[_0xaf03('0xf')](_0x52d7fe,_0x12e1a1)['then'](function(_0x1bc5a0){logger[_0xaf03('0x10')](_0xaf03('0x11'),_0x1f3a5c,_0xaf03('0x12'));logger[_0xaf03('0x13')](_0xaf03('0x14'),_0x1f3a5c,_0xaf03('0x12'),JSON['stringify'](_0x1bc5a0));if(_0x1bc5a0['error']){if(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x16')]===0x1f4){logger[_0xaf03('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x1f3a5c,_0x1bc5a0['error'][_0xaf03('0x17')]);return _0x33803e(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x17')]);}logger[_0xaf03('0x15')](_0xaf03('0x11'),_0x1f3a5c,_0x1bc5a0[_0xaf03('0x15')]['message']);return _0x4766d1(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x17')]);}else{logger[_0xaf03('0x10')](_0xaf03('0x11'),_0x1f3a5c,_0xaf03('0x12'));_0x4766d1(_0x1bc5a0[_0xaf03('0x18')]['message']);}})['catch'](function(_0x1e3508){logger[_0xaf03('0x15')](_0xaf03('0x11'),_0x1f3a5c,_0x1e3508);_0x33803e(_0x1e3508);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index fae0032..c4a1a03 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 _0x37dc=['save','remove','update','emit','length','voicePrefix:','./voicePrefix.events'];(function(_0x563cb2,_0x3733b1){var _0x3de22a=function(_0x3d597a){while(--_0x3d597a){_0x563cb2['push'](_0x563cb2['shift']());}};_0x3de22a(++_0x3733b1);}(_0x37dc,0x1e9));var _0xc37d=function(_0x4a6478,_0x2efb39){_0x4a6478=_0x4a6478-0x0;var _0x38742d=_0x37dc[_0x4a6478];return _0x38742d;};'use strict';var VoicePrefixEvents=require(_0xc37d('0x0'));var events=[_0xc37d('0x1'),_0xc37d('0x2'),_0xc37d('0x3')];function createListener(_0x4cfb8b,_0x3f4a3e){return function(_0x551d27){_0x3f4a3e[_0xc37d('0x4')](_0x4cfb8b,_0x551d27);};}function removeListener(_0x52c6ae,_0x5ecb1f){return function(){VoicePrefixEvents['removeListener'](_0x52c6ae,_0x5ecb1f);};}exports['register']=function(_0x33c9db){for(var _0xa63f50=0x0,_0x11fe31=events[_0xc37d('0x5')];_0xa63f50<_0x11fe31;_0xa63f50++){var _0x1d6e8b=events[_0xa63f50];var _0x2076b3=createListener(_0xc37d('0x6')+_0x1d6e8b,_0x33c9db);VoicePrefixEvents['on'](_0x1d6e8b,_0x2076b3);}}; \ No newline at end of file +var _0x2e54=['register','length','./voicePrefix.events','update','emit'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2e54,0x1dd));var _0x42e5=function(_0x2844d5,_0x56745f){_0x2844d5=_0x2844d5-0x0;var _0x56aaa5=_0x2e54[_0x2844d5];return _0x56aaa5;};'use strict';var VoicePrefixEvents=require(_0x42e5('0x0'));var events=['save','remove',_0x42e5('0x1')];function createListener(_0x23f008,_0x3cf9bd){return function(_0x1c62bb){_0x3cf9bd[_0x42e5('0x2')](_0x23f008,_0x1c62bb);};}function removeListener(_0x153440,_0x42736b){return function(){VoicePrefixEvents['removeListener'](_0x153440,_0x42736b);};}exports[_0x42e5('0x3')]=function(_0x455f48){for(var _0x38cb1b=0x0,_0x4bed10=events[_0x42e5('0x4')];_0x38cb1b<_0x4bed10;_0x38cb1b++){var _0x56be20=events[_0x38cb1b];var _0x335b92=createListener('voicePrefix:'+_0x56be20,_0x455f48);VoicePrefixEvents['on'](_0x56be20,_0x335b92);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index fd00c86..02a093f 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 _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(_0x310165,_0x3c4072){var _0x429267=function(_0x530e7f){while(--_0x530e7f){_0x310165['push'](_0x310165['shift']());}};_0x429267(++_0x3c4072);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 +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(_0x484e05,_0x2ff536){var _0xab5c42=function(_0x2db3a8){while(--_0x2db3a8){_0x484e05['push'](_0x484e05['shift']());}};_0xab5c42(++_0x2ff536);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 456e6e9..62870ab 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 _0x08e3=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','ENUM','inbound','outbound','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','type','booked','roundrobin','progressive','predictive','power','INTEGER','yes','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','tTxX','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x2ed371,_0x9cd062){var _0x5edd01=function(_0xe364aa){while(--_0xe364aa){_0x2ed371['push'](_0x2ed371['shift']());}};_0x5edd01(++_0x9cd062);}(_0x08e3,0x1a0));var _0x308e=function(_0x4e394a,_0x41a2ea){_0x4e394a=_0x4e394a-0x0;var _0x63baaf=_0x08e3[_0x4e394a];return _0x63baaf;};'use strict';var Sequelize=require(_0x308e('0x0'));module[_0x308e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x3'),_0x308e('0x4')),'allowNull':![],'defaultValue':_0x308e('0x3')},'musiconhold':{'type':Sequelize[_0x308e('0x5')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x308e('0x5')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x308e('0x6'),_0x308e('0x7'),_0x308e('0x8'),_0x308e('0x9'),_0x308e('0xa'),'linear',_0x308e('0xb'),'rrordered'),'allowNull':![],'defaultValue':_0x308e('0x6'),'set':function(_0x1d6b30){this[_0x308e('0xc')](_0x308e('0xd'),_0x1d6b30?_0x1d6b30:_0x308e('0xa'));},'get':function(){var _0x525890=this[_0x308e('0xe')](_0x308e('0xf'));var _0x22815c=this[_0x308e('0xe')]('dialMethod');var _0x3ea7af=this[_0x308e('0xe')](_0x308e('0xd'));if(_0x525890===_0x308e('0x3')){return _0x3ea7af;}if(_0x22815c===_0x308e('0x10')&&_0x3ea7af===_0x308e('0xa')||_0x22815c===_0x308e('0x10')&&_0x3ea7af===_0x308e('0x11')){return _0x3ea7af;}if(_0x22815c===_0x308e('0x12')||_0x22815c===_0x308e('0x13')||_0x22815c===_0x308e('0x14')){return _0x3ea7af;}return null;}},'servicelevel':{'type':Sequelize[_0x308e('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x308e('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x308e('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x308e('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x308e('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x308e('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x16'),'no'),'defaultValue':_0x308e('0x16')},'autopause':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x308e('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x308e('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x308e('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x308e('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x308e('0x2')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x308e('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x308e('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x308e('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x308e('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x308e('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x308e('0x16')},'announce_holdtime':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x16'),'no',_0x308e('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x308e('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x16'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x308e('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x308e('0x5')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x308e('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x308e('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x308e('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x308e('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x308e('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x308e('0x5')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x308e('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x308e('0x5')]},'queue_less_than':{'type':Sequelize[_0x308e('0x5')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x1a055c){this[_0x308e('0xc')](_0x308e('0x18'),_0x1a055c?_0x1a055c[_0x308e('0x19')](','):[]);},'get':function(){return this[_0x308e('0xe')]('periodic_announce')?this['getDataValue']('periodic_announce')[_0x308e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x308e('0x5')],'defaultValue':'yes','set':function(_0x5653a6){this[_0x308e('0xc')](_0x308e('0x1b'),_0x5653a6?_0x5653a6[_0x308e('0x19')](','):undefined);},'get':function(){return this[_0x308e('0xe')](_0x308e('0x1b'))?this['getDataValue'](_0x308e('0x1b'))[_0x308e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x308e('0x5')],'defaultValue':'no','set':function(_0xcf0e50){this[_0x308e('0xc')](_0x308e('0x1c'),_0xcf0e50?_0xcf0e50[_0x308e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x308e('0x1c'))?this[_0x308e('0xe')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x308e('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x308e('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x308e('0x5')]},'description':{'type':Sequelize[_0x308e('0x5')]},'acw':{'type':Sequelize[_0x308e('0x1d')],'defaultValue':0x0,'set':function(_0x51ff32){this['setDataValue']('acw',_0x51ff32);if(_0x51ff32){if(this[_0x308e('0xe')](_0x308e('0x1e'))<0x2){this[_0x308e('0xc')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x308e('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x308e('0x12'),_0x308e('0x14'),_0x308e('0x13'),_0x308e('0x10')),'defaultValue':_0x308e('0x12'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x308e('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x308e('0x1f')},'dialLimitQueue':{'type':Sequelize[_0x308e('0x15')](0x4)[_0x308e('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x308e('0x21')},'dialPowerLevel':{'type':Sequelize[_0x308e('0x22')](0x2)[_0x308e('0x20')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x308e('0x23')},'dialPredictiveOptimization':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x24'),_0x308e('0x25')),'defaultValue':_0x308e('0x25'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x308e('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x308e('0x15')](0x3)[_0x308e('0x20')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x308e('0x15')](0x3)[_0x308e('0x20')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x308e('0x26'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x308e('0x15')](0x3)[_0x308e('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x308e('0x27')},'dialQueueProject':{'type':Sequelize[_0x308e('0x5')],'comment':_0x308e('0x28')},'dialCongestionMaxRetry':{'type':Sequelize[_0x308e('0x15')](0x3)[_0x308e('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x308e('0x29')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x308e('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x308e('0x15')](0x3)[_0x308e('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x308e('0x2a')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x308e('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x308e('0x2b')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x308e('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x308e('0x2c')},'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['INTEGER'](0x3)[_0x308e('0x20')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x308e('0x2d')},'dialTimezone':{'type':Sequelize[_0x308e('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x308e('0x5')],'defaultValue':_0x308e('0x2e')},'dialPrefix':{'type':Sequelize[_0x308e('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x2f'),_0x308e('0x30'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x308e('0x31')},'dialAMDInitialSilence':{'type':Sequelize[_0x308e('0x15')](0x9)[_0x308e('0x20')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x308e('0x15')](0x9)[_0x308e('0x20')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x308e('0x32')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x308e('0x15')](0x9)[_0x308e('0x20')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x308e('0x33')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x308e('0x15')](0x9)[_0x308e('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x308e('0x15')](0x9)[_0x308e('0x20')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x308e('0x15')](0x9)[_0x308e('0x20')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x308e('0x34')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x308e('0x20')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x308e('0x35')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x308e('0x15')](0x5)[_0x308e('0x20')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x308e('0x36')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x308e('0x15')](0x9)[_0x308e('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x308e('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x308e('0x1d')],'defaultValue':0x0,'comment':_0x308e('0x37')},'dialOrderByScheduledAt':{'type':Sequelize[_0x308e('0x2')](_0x308e('0x38'),_0x308e('0x39')),'defaultValue':_0x308e('0x38')},'dialQueueProject2':{'type':Sequelize[_0x308e('0x5')],'comment':_0x308e('0x28')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x308e('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x308e('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x308e('0x15')](0x3)[_0x308e('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x308e('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x308e('0x3a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x308e('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x308e('0x3b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x308e('0x15')](0x5)[_0x308e('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x308e('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x308e('0x3c')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x308e('0x3d')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x308e('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x308e('0x3e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x308e('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x308e('0x3f')},'dialMachineMaxRetry':{'type':Sequelize[_0x308e('0x15')](0x3)[_0x308e('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x308e('0x40')},'dialMachineRetryFrequency':{'type':Sequelize[_0x308e('0x15')](0x5)[_0x308e('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x308e('0x41')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x308e('0x15')](0x3)[_0x308e('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x308e('0x42')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x308e('0x15')](0x5)[_0x308e('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x308e('0x43')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x308e('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x308e('0x1d')],'defaultValue':![],'comment':_0x308e('0x44'),'set':function(_0x233c6a){if(!_0x233c6a)this[_0x308e('0xc')]('mandatoryDispositionPauseId',null);this[_0x308e('0xc')]('mandatoryDisposition',_0x233c6a);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x308e('0x15')](0x3)[_0x308e('0x20')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x308e('0x15')](0x3)[_0x308e('0x20')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x308e('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x308e('0x15')](0x3)[_0x308e('0x20')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x308e('0x1d')],'defaultValue':![]}}; \ No newline at end of file +var _0xc811=['linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','booked','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','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)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','name','ENUM','inbound','STRING','default','ringall','leastrecent','fewestcalls','rrmemory'];(function(_0x18c44d,_0x33976d){var _0x71abcf=function(_0x43072b){while(--_0x43072b){_0x18c44d['push'](_0x18c44d['shift']());}};_0x71abcf(++_0x33976d);}(_0xc811,0x13e));var _0x1c81=function(_0x506db6,_0x6ffd56){_0x506db6=_0x506db6-0x0;var _0x141eaf=_0xc811[_0x506db6];return _0x141eaf;};'use strict';var Sequelize=require(_0x1c81('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1c81('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1c81('0x2')](_0x1c81('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x1c81('0x3')},'musiconhold':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':_0x1c81('0x5')},'announce':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':''},'strategy':{'type':Sequelize[_0x1c81('0x2')]('rr',_0x1c81('0x6'),_0x1c81('0x7'),_0x1c81('0x8'),'random',_0x1c81('0x9'),_0x1c81('0xa'),_0x1c81('0xb'),_0x1c81('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x3d4c14){this[_0x1c81('0xd')](_0x1c81('0xe'),_0x3d4c14?_0x3d4c14:_0x1c81('0x9'));},'get':function(){var _0x45731e=this[_0x1c81('0xf')](_0x1c81('0x10'));var _0x5b8376=this[_0x1c81('0xf')]('dialMethod');var _0x21016c=this[_0x1c81('0xf')](_0x1c81('0xe'));if(_0x45731e===_0x1c81('0x3')){return _0x21016c;}if(_0x5b8376==='booked'&&_0x21016c===_0x1c81('0x9')||_0x5b8376===_0x1c81('0x11')&&_0x21016c==='roundrobin'){return _0x21016c;}if(_0x5b8376==='progressive'||_0x5b8376===_0x1c81('0x12')||_0x5b8376===_0x1c81('0x13')){return _0x21016c;}return null;}},'servicelevel':{'type':Sequelize[_0x1c81('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1c81('0x14')](0xb)},'timeout':{'type':Sequelize[_0x1c81('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1c81('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1c81('0x4')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1c81('0x2')](_0x1c81('0x15'),'no'),'defaultValue':_0x1c81('0x15')},'autopause':{'type':Sequelize[_0x1c81('0x2')](_0x1c81('0x15'),'no',_0x1c81('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1c81('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1c81('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1c81('0x2')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x1c81('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1c81('0x2')](_0x1c81('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x1c81('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x1c81('0x2')](_0x1c81('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1c81('0x2')](_0x1c81('0x15'),'no'),'defaultValue':_0x1c81('0x15')},'announce_holdtime':{'type':Sequelize[_0x1c81('0x2')]('yes','no',_0x1c81('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1c81('0x2')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x1c81('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1c81('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1c81('0x4')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x1c81('0x4')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x1c81('0x4')]},'queue_less_than':{'type':Sequelize[_0x1c81('0x4')]},'periodic_announce':{'type':Sequelize[_0x1c81('0x18')],'set':function(_0x177c90){this[_0x1c81('0xd')](_0x1c81('0x19'),_0x177c90?_0x177c90['join'](','):[]);},'get':function(){return this[_0x1c81('0xf')](_0x1c81('0x19'))?this[_0x1c81('0xf')]('periodic_announce')[_0x1c81('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':_0x1c81('0x15'),'set':function(_0x1913e3){this['setDataValue'](_0x1c81('0x1b'),_0x1913e3?_0x1913e3[_0x1c81('0x1c')](','):undefined);},'get':function(){return this[_0x1c81('0xf')]('joinempty')?this[_0x1c81('0xf')](_0x1c81('0x1b'))[_0x1c81('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':'no','set':function(_0x3eabe2){this[_0x1c81('0xd')](_0x1c81('0x1d'),_0x3eabe2?_0x3eabe2[_0x1c81('0x1c')](','):undefined);},'get':function(){return this[_0x1c81('0xf')](_0x1c81('0x1d'))?this[_0x1c81('0xf')](_0x1c81('0x1d'))[_0x1c81('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1c81('0x2')](_0x1c81('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1c81('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x1c81('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x1c81('0x4')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x35b89b){this[_0x1c81('0xd')](_0x1c81('0x1e'),_0x35b89b);if(_0x35b89b){if(this[_0x1c81('0xf')](_0x1c81('0x1f'))<0x2){this[_0x1c81('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1c81('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1c81('0x20')],'defaultValue':0x0,'comment':_0x1c81('0x21')},'dialMethod':{'type':Sequelize[_0x1c81('0x2')]('preview',_0x1c81('0x22'),_0x1c81('0x13'),_0x1c81('0x12'),_0x1c81('0x11')),'defaultValue':_0x1c81('0x22'),'comment':_0x1c81('0x23')},'dialLimitChannel':{'type':Sequelize[_0x1c81('0x14')](0x4)[_0x1c81('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1c81('0x25')},'dialLimitQueue':{'type':Sequelize[_0x1c81('0x14')](0x4)[_0x1c81('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1c81('0x26')},'dialPowerLevel':{'type':Sequelize[_0x1c81('0x27')](0x2)[_0x1c81('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x1c81('0x2')](_0x1c81('0x28'),_0x1c81('0x29')),'defaultValue':_0x1c81('0x29'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x1c81('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1c81('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1c81('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1c81('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1c81('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c81('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':_0x1c81('0x2c'),'comment':_0x1c81('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c81('0x2e')},'dialQueueProject':{'type':Sequelize[_0x1c81('0x4')],'comment':_0x1c81('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1c81('0x14')](0x3)[_0x1c81('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c81('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1c81('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c81('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x1c81('0x14')](0x3)[_0x1c81('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c81('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1c81('0x14')](0x5)[_0x1c81('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c81('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c81('0x24')],'defaultValue':0x3,'comment':_0x1c81('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1c81('0x14')](0x5)[_0x1c81('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c81('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c81('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1c81('0x36')},'dialTimezone':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1c81('0x37')},'dialPrefix':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1c81('0x38'),_0x1c81('0x39'),_0x1c81('0x3a')),'defaultValue':_0x1c81('0x38')},'dialAMDActive':{'type':Sequelize[_0x1c81('0x20')],'defaultValue':0x0,'comment':_0x1c81('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x1c81('0x14')](0x9)[_0x1c81('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1c81('0x3c')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1c81('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1c81('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1c81('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1c81('0x14')](0x9)[_0x1c81('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1c81('0x3f')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1c81('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1c81('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1c81('0x14')](0x9)[_0x1c81('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1c81('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1c81('0x14')](0x5)[_0x1c81('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1c81('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1c81('0x14')](0x9)[_0x1c81('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x1c81('0x14')](0x5)[_0x1c81('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1c81('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x1c81('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1c81('0x44'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x1c81('0x4')],'comment':_0x1c81('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1c81('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x1c81('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1c81('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1c81('0x45')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1c81('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c81('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c81('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1c81('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c81('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0x1c81('0x14')](0x3)[_0x1c81('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c81('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x1c81('0x14')](0x5)[_0x1c81('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c81('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c81('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c81('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1c81('0x14')](0x5)[_0x1c81('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c81('0x4b')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c81('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c81('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1c81('0x14')](0x5)[_0x1c81('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1c81('0x14')](0x3)[_0x1c81('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c81('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1c81('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c81('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1c81('0x14')],'allowNull':!![],'comment':_0x1c81('0x4f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1c81('0x50'),'set':function(_0x27afa4){if(!_0x27afa4)this[_0x1c81('0xd')](_0x1c81('0x51'),null);this[_0x1c81('0xd')]('mandatoryDisposition',_0x27afa4);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1c81('0x14')](0x3)[_0x1c81('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x1c81('0x14')](0x3)[_0x1c81('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x1c81('0x14')](0x3)[_0x1c81('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x1c81('0x20')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 4e4b765..4114ae6 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 _0xb76d=['interface','format','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','all','union','compact','transaction','removeTeams','userVoiceQueue:remove','addAgents','omit','spread','User','isEmpty','push','SIP/%s','removeAgents','isArray','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','phone','scheduledAt','ListId','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','onlyIfOpen','into','fromQuery','COALESCE(phone,\x27\x27)','cm_hopper','ListId\x20=\x20?','sequelize','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','includes','type','find','name','UserProfileResource','sendStatus','stack','send','index','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','VoiceQueue','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','outbound','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','getHoppers','findOne','CmHopper','hasOwnProperty','order','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','pick','Team','getTeams','teams','Agents','online','voicePause','flatMap','forEach','penalty','addTeams','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil'];(function(_0x58f051,_0xd6b70a){var _0x4d8577=function(_0x3d86b5){while(--_0x3d86b5){_0x58f051['push'](_0x58f051['shift']());}};_0x4d8577(++_0xd6b70a);}(_0xb76d,0x119));var _0xdb76=function(_0x2e5c09,_0x53d762){_0x2e5c09=_0x2e5c09-0x0;var _0x32b0b6=_0xb76d[_0x2e5c09];return _0x32b0b6;};'use strict';var emlformat=require(_0xdb76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb76('0x1'));var jsonpatch=require(_0xdb76('0x2'));var rp=require(_0xdb76('0x3'));var moment=require('moment');var BPromise=require(_0xdb76('0x4'));var Mustache=require(_0xdb76('0x5'));var util=require(_0xdb76('0x6'));var path=require(_0xdb76('0x7'));var sox=require(_0xdb76('0x8'));var csv=require(_0xdb76('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb76('0xa'));var _=require(_0xdb76('0xb'));var squel=require(_0xdb76('0xc'));var crypto=require(_0xdb76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdb76('0xe'));var toCsv=require(_0xdb76('0x9'));var querystring=require('querystring');var Papa=require(_0xdb76('0xf'));var Redis=require(_0xdb76('0x10'));var authService=require(_0xdb76('0x11'));var qs=require(_0xdb76('0x12'));var as=require(_0xdb76('0x13'));var hardwareService=require(_0xdb76('0x14'));var logger=require(_0xdb76('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xdb76('0x16'));var licenseUtil=require(_0xdb76('0x17'));var db=require(_0xdb76('0x18'))['db'];config['redis']=_['defaults'](config[_0xdb76('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb76('0x1a'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0xdb76('0x1b')](socket);function respondWithStatusCode(_0x28d3a5,_0x1196fb){_0x1196fb=_0x1196fb||0xcc;return function(_0x8d2de2){if(_0x8d2de2){return _0x28d3a5['sendStatus'](_0x1196fb);}return _0x28d3a5[_0xdb76('0x1c')](_0x1196fb)[_0xdb76('0x1d')]();};}function respondWithResult(_0x5a1017,_0x385416){_0x385416=_0x385416||0xc8;return function(_0x1a61cf){if(_0x1a61cf){return _0x5a1017[_0xdb76('0x1c')](_0x385416)[_0xdb76('0x1e')](_0x1a61cf);}};}function respondWithFilteredResult(_0x388fb0,_0x1e3c5e){return function(_0x557649){if(_0x557649){var _0x175567=typeof _0x1e3c5e[_0xdb76('0x1f')]===_0xdb76('0x20')&&typeof _0x1e3c5e['limit']===_0xdb76('0x20');var _0xf06f1c=_0x557649[_0xdb76('0x21')];var _0x5921d4=_0x175567?0x0:_0x1e3c5e[_0xdb76('0x1f')];var _0x3984e2=_0x175567?_0x557649[_0xdb76('0x21')]:_0x1e3c5e[_0xdb76('0x1f')]+_0x1e3c5e[_0xdb76('0x22')];var _0xa574d4;if(_0x3984e2>=_0xf06f1c){_0x3984e2=_0xf06f1c;_0xa574d4=0xc8;}else{_0xa574d4=0xce;}_0x388fb0[_0xdb76('0x1c')](_0xa574d4);return _0x388fb0[_0xdb76('0x23')](_0xdb76('0x24'),_0x5921d4+'-'+_0x3984e2+'/'+_0xf06f1c)[_0xdb76('0x1e')](_0x557649);}return null;};}function patchUpdates(_0x3718e1){return function(_0x1b1f71){try{jsonpatch[_0xdb76('0x25')](_0x1b1f71,_0x3718e1,!![]);}catch(_0x560433){return BPromise[_0xdb76('0x26')](_0x560433);}return _0x1b1f71['save']();};}function saveUpdates(_0x12f479,_0x2290ed){return function(_0x4504eb){if(_0x4504eb){return _0x4504eb[_0xdb76('0x27')](_0x12f479)[_0xdb76('0x28')](function(_0x25d904){return _0x25d904;});}return null;};}function removeEntity(_0xec9e4b,_0x168dc4){return function(_0x3de9ad){if(_0x3de9ad){return _0x3de9ad[_0xdb76('0x29')]()[_0xdb76('0x28')](function(){var _0x51f919=_0x3de9ad[_0xdb76('0x2a')]({'plain':!![]});var _0x57549a=[{'name':_0xdb76('0x2b'),'value':_0xdb76('0x2c'),'ignore':![]},{'name':_0xdb76('0x2d'),'value':'outbound','ignore':![]}];var _0x5960cb=_(_0x57549a)[_0xdb76('0x2e')](_0xdb76('0x2f'))[_0xdb76('0x30')]('value')[_0xdb76('0x31')]();if(_[_0xdb76('0x32')](_0x5960cb,_0x51f919[_0xdb76('0x33')])){return;}var _0xff569e=_[_0xdb76('0x34')](_0x57549a,[_0xdb76('0x31'),_0x51f919[_0xdb76('0x33')]])[_0xdb76('0x35')];return db[_0xdb76('0x36')][_0xdb76('0x29')]({'where':{'type':_0xff569e,'resourceId':_0x51f919['id']}})['then'](function(){return _0x3de9ad;});})[_0xdb76('0x28')](function(){_0xec9e4b[_0xdb76('0x1c')](0xcc)[_0xdb76('0x1d')]();});}};}function handleEntityNotFound(_0xfcf102,_0x597b6d){return function(_0x49be73){if(!_0x49be73){_0xfcf102[_0xdb76('0x37')](0x194);}return _0x49be73;};}function handleError(_0xf59cbb,_0xf51430){_0xf51430=_0xf51430||0x1f4;return function(_0x590a4e){logger['error'](_0x590a4e[_0xdb76('0x38')]);if(_0x590a4e['name']){delete _0x590a4e['name'];}_0xf59cbb[_0xdb76('0x1c')](_0xf51430)[_0xdb76('0x39')](_0x590a4e);};}exports[_0xdb76('0x3a')]=function(_0x72967c,_0x172d5d){var _0x47aed9={},_0x55f172={},_0x289a55={'count':0x0,'rows':[]};var _0x3c938a=_[_0xdb76('0x30')](db['VoiceQueue']['rawAttributes'],function(_0x1e7659){return{'name':_0x1e7659[_0xdb76('0x3b')],'type':_0x1e7659[_0xdb76('0x33')][_0xdb76('0x3c')]};});_0x55f172[_0xdb76('0x3d')]=_[_0xdb76('0x30')](_0x3c938a,_0xdb76('0x35'));_0x55f172[_0xdb76('0x3e')]=_[_0xdb76('0x3f')](_0x72967c['query']);_0x55f172[_0xdb76('0x40')]=_[_0xdb76('0x41')](_0x55f172['model'],_0x55f172[_0xdb76('0x3e')]);_0x47aed9[_0xdb76('0x42')]=_[_0xdb76('0x41')](_0x55f172[_0xdb76('0x3d')],qs[_0xdb76('0x43')](_0x72967c[_0xdb76('0x3e')][_0xdb76('0x43')]));_0x47aed9['attributes']=_0x47aed9['attributes'][_0xdb76('0x44')]?_0x47aed9[_0xdb76('0x42')]:_0x55f172['model'];if(!_0x72967c[_0xdb76('0x3e')]['hasOwnProperty'](_0xdb76('0x45'))){_0x47aed9[_0xdb76('0x22')]=qs['limit'](_0x72967c[_0xdb76('0x3e')][_0xdb76('0x22')]);_0x47aed9[_0xdb76('0x1f')]=qs[_0xdb76('0x1f')](_0x72967c[_0xdb76('0x3e')][_0xdb76('0x1f')]);}_0x47aed9['order']=qs['sort'](_0x72967c['query'][_0xdb76('0x46')]);_0x47aed9[_0xdb76('0x47')]=qs[_0xdb76('0x40')](_['pick'](_0x72967c['query'],_0x55f172[_0xdb76('0x40')]),_0x3c938a);if(_0x72967c['query']['filter']){_0x47aed9['where']=_[_0xdb76('0x48')](_0x47aed9[_0xdb76('0x47')],{'$or':_[_0xdb76('0x30')](_0x3c938a,function(_0x154db8){if(_0x154db8['type']!==_0xdb76('0x49')){var _0x46cc59={};_0x46cc59[_0x154db8[_0xdb76('0x35')]]={'$like':'%'+_0x72967c['query']['filter']+'%'};return _0x46cc59;}})});}_0x47aed9=_[_0xdb76('0x48')]({},_0x47aed9,_0x72967c[_0xdb76('0x4a')]);var _0xb8f54c={'where':_0x47aed9['where']};return db['VoiceQueue'][_0xdb76('0x21')](_0xb8f54c)[_0xdb76('0x28')](function(_0x1eedf4){_0x289a55[_0xdb76('0x21')]=_0x1eedf4;if(_0x72967c[_0xdb76('0x3e')][_0xdb76('0x4b')]){_0x47aed9[_0xdb76('0x4c')]=[{'all':!![]}];}return db['VoiceQueue'][_0xdb76('0x4d')](_0x47aed9);})['then'](function(_0x3f43a0){_0x289a55[_0xdb76('0x4e')]=_0x3f43a0;return _0x289a55;})[_0xdb76('0x28')](respondWithFilteredResult(_0x172d5d,_0x47aed9))['catch'](handleError(_0x172d5d,null));};exports[_0xdb76('0x4f')]=function(_0x32d89f,_0x5bdd94){var _0x57472a={'raw':![],'where':{'id':_0x32d89f[_0xdb76('0x50')]['id']}},_0x244f46={};_0x244f46[_0xdb76('0x3d')]=_['keys'](db[_0xdb76('0x51')][_0xdb76('0x52')]);_0x244f46[_0xdb76('0x3e')]=_['keys'](_0x32d89f[_0xdb76('0x3e')]);_0x244f46[_0xdb76('0x40')]=_[_0xdb76('0x41')](_0x244f46[_0xdb76('0x3d')],_0x244f46[_0xdb76('0x3e')]);_0x57472a['attributes']=_[_0xdb76('0x41')](_0x244f46[_0xdb76('0x3d')],qs[_0xdb76('0x43')](_0x32d89f[_0xdb76('0x3e')][_0xdb76('0x43')]));_0x57472a['attributes']=_0x57472a[_0xdb76('0x42')][_0xdb76('0x44')]?_0x57472a[_0xdb76('0x42')]:_0x244f46[_0xdb76('0x3d')];if(_0x32d89f[_0xdb76('0x3e')][_0xdb76('0x4b')]){_0x57472a['include']=[{'all':!![]}];}_0x57472a=_[_0xdb76('0x48')]({},_0x57472a,_0x32d89f[_0xdb76('0x4a')]);return db[_0xdb76('0x51')][_0xdb76('0x34')](_0x57472a)[_0xdb76('0x28')](handleEntityNotFound(_0x5bdd94,null))[_0xdb76('0x28')](respondWithResult(_0x5bdd94,null))[_0xdb76('0x53')](handleError(_0x5bdd94,null));};exports[_0xdb76('0x54')]=function(_0x12b66d,_0x32a9ec){return db[_0xdb76('0x51')][_0xdb76('0x54')](_0x12b66d[_0xdb76('0x55')],{})['then'](function(_0x1a6854){var _0x267c0f=_0x12b66d[_0xdb76('0x56')]['get']({'plain':!![]});if(!_0x267c0f)throw new Error(_0xdb76('0x57'));if(_0x267c0f['role']==='user'){var _0x5c75ca=_0x1a6854[_0xdb76('0x2a')]({'plain':!![]});var _0x5a9935=[{'name':_0xdb76('0x2b'),'value':_0xdb76('0x2c')},{'name':'QueueCampaigns','value':_0xdb76('0x58')}];var _0x4df8b5=_[_0xdb76('0x34')](_0x5a9935,[_0xdb76('0x31'),_0x5c75ca[_0xdb76('0x33')]])[_0xdb76('0x35')];return db[_0xdb76('0x59')]['find']({'where':{'name':_0x4df8b5,'userProfileId':_0x267c0f[_0xdb76('0x5a')]},'raw':!![]})[_0xdb76('0x28')](function(_0x43ad22){if(_0x43ad22&&_0x43ad22[_0xdb76('0x5b')]===0x0){return db['UserProfileResource'][_0xdb76('0x54')]({'name':_0x5c75ca[_0xdb76('0x35')],'resourceId':_0x5c75ca['id'],'type':_0x43ad22['name'],'sectionId':_0x43ad22['id']},{})[_0xdb76('0x28')](function(){return _0x1a6854;});}else{return _0x1a6854;}})[_0xdb76('0x53')](function(_0x850a9a){logger[_0xdb76('0x5c')](_0xdb76('0x5d'),_0x850a9a);throw _0x850a9a;});}return _0x1a6854;})[_0xdb76('0x28')](respondWithResult(_0x32a9ec,0xc9))['catch'](handleError(_0x32a9ec,null));};exports[_0xdb76('0x5e')]=function(_0x5550f4,_0x11a321){var _0x2cb44a={'where':{'id':_0x5550f4[_0xdb76('0x50')]['id']}},_0x5a05f8={};_0x5a05f8['model']=_[_0xdb76('0x3f')](db[_0xdb76('0x51')][_0xdb76('0x52')]);_0x2cb44a[_0xdb76('0x42')]=_[_0xdb76('0x41')](_0x5a05f8[_0xdb76('0x3d')],qs['fields'](_0x5550f4[_0xdb76('0x3e')]['fields']));_0x2cb44a[_0xdb76('0x42')]=_0x2cb44a[_0xdb76('0x42')][_0xdb76('0x44')]?_0x2cb44a[_0xdb76('0x42')]:_0x5a05f8[_0xdb76('0x3d')];if(_0x5550f4[_0xdb76('0x3e')]['includeAll']){_0x2cb44a[_0xdb76('0x4c')]=[{'all':!![]}];}_0x2cb44a=_['merge']({},_0x2cb44a,_0x5550f4['options']);return db[_0xdb76('0x51')][_0xdb76('0x34')](_0x2cb44a)[_0xdb76('0x28')](handleEntityNotFound(_0x11a321,null))[_0xdb76('0x28')](function(_0x11c037){if(_0x11c037){var _0xc22fe5=_0x11c037[_0xdb76('0x2a')]({'plain':!![]});_0xc22fe5=qs['omit'](_0xc22fe5,['id',_0xdb76('0x5f'),'updatedAt']);_0x5550f4[_0xdb76('0x55')]=_['omit'](_0x5550f4[_0xdb76('0x55')],['id',_0xdb76('0x5f'),_0xdb76('0x60')]);return db['VoiceQueue'][_0xdb76('0x54')](_[_0xdb76('0x48')](_0xc22fe5,_0x5550f4['body']),{'include':_0x5550f4[_0xdb76('0x3e')][_0xdb76('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x424c85){var _0x5460f3=_0x5550f4[_0xdb76('0x56')][_0xdb76('0x2a')]({'plain':!![]});if(!_0x5460f3)throw new Error(_0xdb76('0x57'));if(_0x5460f3['role']===_0xdb76('0x56')){var _0x3aa400=_0x424c85['get']({'plain':!![]});var _0x22af07=[{'name':_0xdb76('0x2b'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x3ccb95=_[_0xdb76('0x34')](_0x22af07,['value',_0x3aa400['type']])['name'];return db['UserProfileSection'][_0xdb76('0x34')]({'where':{'name':_0x3ccb95,'userProfileId':_0x5460f3[_0xdb76('0x5a')]},'raw':!![]})['then'](function(_0x383356){if(_0x383356&&_0x383356[_0xdb76('0x5b')]===0x0){return db[_0xdb76('0x36')][_0xdb76('0x54')]({'name':_0x3aa400[_0xdb76('0x35')],'resourceId':_0x3aa400['id'],'type':_0x383356['name'],'sectionId':_0x383356['id']},{})[_0xdb76('0x28')](function(){return _0x424c85;});}else{return _0x424c85;}})[_0xdb76('0x53')](function(_0x4139b5){logger[_0xdb76('0x5c')](_0xdb76('0x5d'),_0x4139b5);throw _0x4139b5;});}return _0x424c85;});}})['then'](respondWithResult(_0x11a321,0xc9))[_0xdb76('0x53')](handleError(_0x11a321,null));};exports['update']=function(_0x8c64a2,_0x175d6a){if(_0x8c64a2[_0xdb76('0x55')]['id']){delete _0x8c64a2[_0xdb76('0x55')]['id'];}return db['VoiceQueue'][_0xdb76('0x34')]({'where':{'id':_0x8c64a2[_0xdb76('0x50')]['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x175d6a,null))[_0xdb76('0x28')](saveUpdates(_0x8c64a2[_0xdb76('0x55')],null))[_0xdb76('0x28')](respondWithResult(_0x175d6a,null))[_0xdb76('0x53')](handleError(_0x175d6a,null));};exports[_0xdb76('0x29')]=function(_0x2681d3,_0x51cf98){return db[_0xdb76('0x51')][_0xdb76('0x34')]({'where':{'id':_0x2681d3['params']['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x51cf98,null))['then'](removeEntity(_0x51cf98,null))[_0xdb76('0x53')](handleError(_0x51cf98,null));};exports[_0xdb76('0x61')]=function(_0xc82fce,_0x2a472b,_0xc72e8b){var _0x242f3b={'raw':![],'where':{}};var _0x5541c7={};var _0x5dfdf0={'count':0x0,'rows':[]};return db[_0xdb76('0x51')][_0xdb76('0x62')]({'where':{'id':_0xc82fce[_0xdb76('0x50')]['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x2a472b,null))[_0xdb76('0x28')](function(_0x2e07da){if(_0x2e07da){_0x5541c7['model']=_['keys'](db[_0xdb76('0x63')][_0xdb76('0x52')]);_0x5541c7[_0xdb76('0x3e')]=_[_0xdb76('0x3f')](_0xc82fce[_0xdb76('0x3e')]);_0x5541c7[_0xdb76('0x40')]=_[_0xdb76('0x41')](_0x5541c7[_0xdb76('0x3d')],_0x5541c7[_0xdb76('0x3e')]);_0x242f3b[_0xdb76('0x42')]=_['intersection'](_0x5541c7['model'],qs[_0xdb76('0x43')](_0xc82fce[_0xdb76('0x3e')]['fields']));_0x242f3b[_0xdb76('0x42')]=_0x242f3b[_0xdb76('0x42')]['length']?_0x242f3b['attributes']:_0x5541c7[_0xdb76('0x3d')];if(!_0xc82fce[_0xdb76('0x3e')][_0xdb76('0x64')](_0xdb76('0x45'))){_0x242f3b[_0xdb76('0x22')]=qs[_0xdb76('0x22')](_0xc82fce['query'][_0xdb76('0x22')]);_0x242f3b[_0xdb76('0x1f')]=qs['offset'](_0xc82fce[_0xdb76('0x3e')][_0xdb76('0x1f')]);}_0x242f3b[_0xdb76('0x65')]=qs[_0xdb76('0x46')](_0xc82fce[_0xdb76('0x3e')][_0xdb76('0x46')]);_0x242f3b[_0xdb76('0x47')]=qs[_0xdb76('0x40')](_['pick'](_0xc82fce[_0xdb76('0x3e')],_0x5541c7['filters']));_0x242f3b[_0xdb76('0x47')][_0xdb76('0x66')]=_0x2e07da['id'];if(_0xc82fce[_0xdb76('0x3e')][_0xdb76('0x2e')]){_0x242f3b[_0xdb76('0x47')]=_[_0xdb76('0x48')](_0x242f3b[_0xdb76('0x47')],{'$or':_['map'](_0x242f3b[_0xdb76('0x42')],function(_0x3d1b0d){var _0x1ed65d={};_0x1ed65d[_0x3d1b0d]={'$like':'%'+_0xc82fce[_0xdb76('0x3e')][_0xdb76('0x2e')]+'%'};return _0x1ed65d;})});}_0x242f3b=_[_0xdb76('0x48')]({},_0x242f3b,_0xc82fce['options']);return db[_0xdb76('0x63')][_0xdb76('0x21')]({'where':_0x242f3b[_0xdb76('0x47')]})[_0xdb76('0x28')](function(_0x2d3259){_0x5dfdf0[_0xdb76('0x21')]=_0x2d3259;if(_0xc82fce[_0xdb76('0x3e')][_0xdb76('0x4b')]){_0x242f3b[_0xdb76('0x4c')]=[{'all':!![]}];}return db[_0xdb76('0x63')][_0xdb76('0x4d')](_0x242f3b);})[_0xdb76('0x28')](function(_0x5498b3){_0x5dfdf0[_0xdb76('0x4e')]=_0x5498b3;return _0x5dfdf0;});}})['then'](respondWithFilteredResult(_0x2a472b,_0x242f3b))[_0xdb76('0x53')](handleError(_0x2a472b,null));};exports[_0xdb76('0x67')]=function(_0x319abf,_0x536fb8,_0x3f0b6d){var _0x2247fe={'raw':!![],'where':{}};var _0x33edeb={};var _0x4738b9={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xdb76('0x62')]({'where':{'id':_0x319abf['params']['id']}})['then'](handleEntityNotFound(_0x536fb8,null))[_0xdb76('0x28')](function(_0x3bf837){if(_0x3bf837){_0x33edeb[_0xdb76('0x3d')]=_[_0xdb76('0x3f')](db['CmHopperHistory'][_0xdb76('0x52')]);_0x33edeb['query']=_['keys'](_0x319abf[_0xdb76('0x3e')]);_0x33edeb[_0xdb76('0x40')]=_['intersection'](_0x33edeb[_0xdb76('0x3d')],_0x33edeb[_0xdb76('0x3e')]);_0x2247fe['attributes']=_[_0xdb76('0x41')](_0x33edeb[_0xdb76('0x3d')],qs[_0xdb76('0x43')](_0x319abf[_0xdb76('0x3e')][_0xdb76('0x43')]));_0x2247fe['attributes']=_0x2247fe[_0xdb76('0x42')][_0xdb76('0x44')]?_0x2247fe[_0xdb76('0x42')]:_0x33edeb['model'];if(!_0x319abf[_0xdb76('0x3e')][_0xdb76('0x64')](_0xdb76('0x45'))){_0x2247fe[_0xdb76('0x22')]=qs['limit'](_0x319abf['query'][_0xdb76('0x22')]);_0x2247fe['offset']=qs[_0xdb76('0x1f')](_0x319abf[_0xdb76('0x3e')][_0xdb76('0x1f')]);}_0x2247fe[_0xdb76('0x65')]=qs[_0xdb76('0x46')](_0x319abf[_0xdb76('0x3e')][_0xdb76('0x46')]);_0x2247fe[_0xdb76('0x47')]=qs['filters'](_['pick'](_0x319abf[_0xdb76('0x3e')],_0x33edeb['filters']));_0x2247fe[_0xdb76('0x47')]['VoiceQueueId']=_0x3bf837['id'];if(_0x319abf[_0xdb76('0x3e')][_0xdb76('0x2e')]){_0x2247fe[_0xdb76('0x47')]=_[_0xdb76('0x48')](_0x2247fe['where'],{'$or':_['map'](_0x2247fe['attributes'],function(_0x1f555b){var _0x50a409={};_0x50a409[_0x1f555b]={'$like':'%'+_0x319abf[_0xdb76('0x3e')]['filter']+'%'};return _0x50a409;})});}_0x2247fe=_[_0xdb76('0x48')]({},_0x2247fe,_0x319abf[_0xdb76('0x4a')]);return db[_0xdb76('0x68')][_0xdb76('0x21')]({'where':_0x2247fe[_0xdb76('0x47')]})[_0xdb76('0x28')](function(_0x4bd36f){_0x4738b9['count']=_0x4bd36f;if(_0x319abf['query'][_0xdb76('0x4b')]){_0x2247fe[_0xdb76('0x4c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xdb76('0x4d')](_0x2247fe);})['then'](function(_0x3d4cc8){_0x4738b9[_0xdb76('0x4e')]=_0x3d4cc8;return _0x4738b9;});}})[_0xdb76('0x28')](respondWithFilteredResult(_0x536fb8,_0x2247fe))[_0xdb76('0x53')](handleError(_0x536fb8,null));};exports[_0xdb76('0x69')]=function(_0x4b4aad,_0x591a2b,_0x429e97){var _0x475c16={'raw':!![],'where':{}};var _0x164175={};var _0x1ad4c0={'count':0x0,'rows':[]};return db[_0xdb76('0x51')][_0xdb76('0x62')]({'where':{'id':_0x4b4aad['params']['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x591a2b,null))['then'](function(_0x16853b){if(_0x16853b){_0x164175['model']=_[_0xdb76('0x3f')](db[_0xdb76('0x6a')][_0xdb76('0x52')]);_0x164175[_0xdb76('0x3e')]=_['keys'](_0x4b4aad[_0xdb76('0x3e')]);_0x164175[_0xdb76('0x40')]=_[_0xdb76('0x41')](_0x164175[_0xdb76('0x3d')],_0x164175[_0xdb76('0x3e')]);_0x475c16[_0xdb76('0x42')]=_[_0xdb76('0x41')](_0x164175['model'],qs[_0xdb76('0x43')](_0x4b4aad[_0xdb76('0x3e')][_0xdb76('0x43')]));_0x475c16[_0xdb76('0x42')]=_0x475c16[_0xdb76('0x42')][_0xdb76('0x44')]?_0x475c16[_0xdb76('0x42')]:_0x164175[_0xdb76('0x3d')];if(!_0x4b4aad['query'][_0xdb76('0x64')]('nolimit')){_0x475c16[_0xdb76('0x22')]=qs[_0xdb76('0x22')](_0x4b4aad[_0xdb76('0x3e')][_0xdb76('0x22')]);_0x475c16[_0xdb76('0x1f')]=qs[_0xdb76('0x1f')](_0x4b4aad['query'][_0xdb76('0x1f')]);}_0x475c16['order']=qs[_0xdb76('0x46')](_0x4b4aad[_0xdb76('0x3e')][_0xdb76('0x46')]);_0x475c16[_0xdb76('0x47')]=qs[_0xdb76('0x40')](_['pick'](_0x4b4aad[_0xdb76('0x3e')],_0x164175[_0xdb76('0x40')]));_0x475c16[_0xdb76('0x47')][_0xdb76('0x66')]=_0x16853b['id'];if(_0x4b4aad[_0xdb76('0x3e')]['filter']){_0x475c16[_0xdb76('0x47')]=_[_0xdb76('0x48')](_0x475c16[_0xdb76('0x47')],{'$or':_[_0xdb76('0x30')](_0x475c16[_0xdb76('0x42')],function(_0x3df4dc){var _0x45735a={};_0x45735a[_0x3df4dc]={'$like':'%'+_0x4b4aad[_0xdb76('0x3e')]['filter']+'%'};return _0x45735a;})});}_0x475c16=_['merge']({},_0x475c16,_0x4b4aad['options']);return db['CmHopperFinal'][_0xdb76('0x21')]({'where':_0x475c16[_0xdb76('0x47')]})[_0xdb76('0x28')](function(_0x5e0e15){_0x1ad4c0[_0xdb76('0x21')]=_0x5e0e15;if(_0x4b4aad['query'][_0xdb76('0x4b')]){_0x475c16[_0xdb76('0x4c')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xdb76('0x4d')](_0x475c16);})[_0xdb76('0x28')](function(_0x5414ca){_0x1ad4c0[_0xdb76('0x4e')]=_0x5414ca;return _0x1ad4c0;});}})[_0xdb76('0x28')](respondWithFilteredResult(_0x591a2b,_0x475c16))[_0xdb76('0x53')](handleError(_0x591a2b,null));};exports[_0xdb76('0x6b')]=function(_0x3ed8bd,_0x4b70f1,_0x3d9025){var _0x1f6f22={'raw':!![],'where':{}};var _0x202ba4={};var _0x112ccd={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xdb76('0x62')]({'where':{'id':_0x3ed8bd[_0xdb76('0x50')]['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x4b70f1,null))[_0xdb76('0x28')](function(_0x5f387a){if(_0x5f387a){_0x202ba4[_0xdb76('0x3d')]=_[_0xdb76('0x3f')](db[_0xdb76('0x6c')][_0xdb76('0x52')]);_0x202ba4[_0xdb76('0x3e')]=_[_0xdb76('0x3f')](_0x3ed8bd['query']);_0x202ba4['filters']=_[_0xdb76('0x41')](_0x202ba4[_0xdb76('0x3d')],_0x202ba4[_0xdb76('0x3e')]);_0x1f6f22[_0xdb76('0x42')]=_[_0xdb76('0x41')](_0x202ba4[_0xdb76('0x3d')],qs[_0xdb76('0x43')](_0x3ed8bd[_0xdb76('0x3e')][_0xdb76('0x43')]));_0x1f6f22['attributes']=_0x1f6f22[_0xdb76('0x42')]['length']?_0x1f6f22['attributes']:_0x202ba4[_0xdb76('0x3d')];if(!_0x3ed8bd[_0xdb76('0x3e')]['hasOwnProperty'](_0xdb76('0x45'))){_0x1f6f22[_0xdb76('0x22')]=qs['limit'](_0x3ed8bd['query'][_0xdb76('0x22')]);_0x1f6f22['offset']=qs['offset'](_0x3ed8bd[_0xdb76('0x3e')][_0xdb76('0x1f')]);}_0x1f6f22['order']=qs['sort'](_0x3ed8bd[_0xdb76('0x3e')]['sort']);_0x1f6f22['where']=qs[_0xdb76('0x40')](_[_0xdb76('0x6d')](_0x3ed8bd[_0xdb76('0x3e')],_0x202ba4[_0xdb76('0x40')]));_0x1f6f22[_0xdb76('0x47')][_0xdb76('0x66')]=_0x5f387a['id'];if(_0x3ed8bd[_0xdb76('0x3e')][_0xdb76('0x2e')]){_0x1f6f22[_0xdb76('0x47')]=_[_0xdb76('0x48')](_0x1f6f22[_0xdb76('0x47')],{'$or':_[_0xdb76('0x30')](_0x1f6f22[_0xdb76('0x42')],function(_0x221aef){var _0x3b3a23={};_0x3b3a23[_0x221aef]={'$like':'%'+_0x3ed8bd[_0xdb76('0x3e')][_0xdb76('0x2e')]+'%'};return _0x3b3a23;})});}_0x1f6f22=_[_0xdb76('0x48')]({},_0x1f6f22,_0x3ed8bd[_0xdb76('0x4a')]);return db[_0xdb76('0x6c')]['count']({'where':_0x1f6f22['where']})[_0xdb76('0x28')](function(_0x3427fc){_0x112ccd['count']=_0x3427fc;if(_0x3ed8bd['query'][_0xdb76('0x4b')]){_0x1f6f22['include']=[{'all':!![]}];}return db[_0xdb76('0x6c')][_0xdb76('0x4d')](_0x1f6f22);})['then'](function(_0xbd3b6d){_0x112ccd[_0xdb76('0x4e')]=_0xbd3b6d;return _0x112ccd;});}})[_0xdb76('0x28')](respondWithFilteredResult(_0x4b70f1,_0x1f6f22))[_0xdb76('0x53')](handleError(_0x4b70f1,null));};exports['getTeams']=function(_0x413280,_0x314912,_0x51f2a3){var _0x45630e={};var _0x294211={};var _0x378014;var _0x2963f6;return db[_0xdb76('0x51')][_0xdb76('0x62')]({'where':{'id':_0x413280[_0xdb76('0x50')]['id']}})['then'](handleEntityNotFound(_0x314912,null))['then'](function(_0x1f8a8e){if(_0x1f8a8e){_0x378014=_0x1f8a8e;_0x294211[_0xdb76('0x3d')]=_[_0xdb76('0x3f')](db[_0xdb76('0x6e')][_0xdb76('0x52')]);_0x294211['query']=_[_0xdb76('0x3f')](_0x413280['query']);_0x294211[_0xdb76('0x40')]=_[_0xdb76('0x41')](_0x294211['model'],_0x294211['query']);_0x45630e['attributes']=_[_0xdb76('0x41')](_0x294211[_0xdb76('0x3d')],qs[_0xdb76('0x43')](_0x413280[_0xdb76('0x3e')][_0xdb76('0x43')]));_0x45630e[_0xdb76('0x42')]=_0x45630e['attributes'][_0xdb76('0x44')]?_0x45630e[_0xdb76('0x42')]:_0x294211[_0xdb76('0x3d')];_0x45630e[_0xdb76('0x65')]=qs[_0xdb76('0x46')](_0x413280[_0xdb76('0x3e')]['sort']);_0x45630e[_0xdb76('0x47')]=qs[_0xdb76('0x40')](_['pick'](_0x413280[_0xdb76('0x3e')],_0x294211[_0xdb76('0x40')]));if(_0x413280[_0xdb76('0x3e')][_0xdb76('0x2e')]){_0x45630e[_0xdb76('0x47')]=_['merge'](_0x45630e[_0xdb76('0x47')],{'$or':_[_0xdb76('0x30')](_0x45630e['attributes'],function(_0x29c123){var _0x24b035={};_0x24b035[_0x29c123]={'$like':'%'+_0x413280[_0xdb76('0x3e')]['filter']+'%'};return _0x24b035;})});}_0x45630e=_[_0xdb76('0x48')]({},_0x45630e,_0x413280[_0xdb76('0x4a')]);return _0x378014['getTeams'](_0x45630e);}})[_0xdb76('0x28')](function(_0x28cebf){if(_0x28cebf){_0x2963f6=_0x28cebf[_0xdb76('0x44')];if(!_0x413280['query'][_0xdb76('0x64')]('nolimit')){_0x45630e[_0xdb76('0x22')]=qs['limit'](_0x413280[_0xdb76('0x3e')]['limit']);_0x45630e['offset']=qs['offset'](_0x413280[_0xdb76('0x3e')][_0xdb76('0x1f')]);}return _0x378014[_0xdb76('0x6f')](_0x45630e);}})[_0xdb76('0x28')](function(_0x2f75f2){if(_0x2f75f2){return _0x2f75f2?{'count':_0x2963f6,'rows':_0x2f75f2}:null;}})[_0xdb76('0x28')](respondWithResult(_0x314912,null))[_0xdb76('0x53')](handleError(_0x314912,null));};exports['addTeams']=function(_0x40f08d,_0x1d3e42,_0x4d603c){var _0x955f2f=_0x40f08d[_0xdb76('0x55')][_0xdb76('0x70')];var _0x4c14f1=_[_0xdb76('0x30')](_0x955f2f,'id');return db[_0xdb76('0x6e')][_0xdb76('0x4d')]({'where':{'id':_0x4c14f1},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdb76('0x71'),'attributes':['id',_0xdb76('0x35'),_0xdb76('0x72'),_0xdb76('0x73'),'interface'],'raw':!![]}]})[_0xdb76('0x28')](function(_0x689af7){if(_0x689af7){var _0x21247f=_[_0xdb76('0x74')](_0x689af7,function(_0x40af52){var _0x26f9bf=_0x40af52['get']({'plain':!![]});_0x26f9bf[_0xdb76('0x71')][_0xdb76('0x75')](function(_0x2d9dc9){_0x2d9dc9['penalty']=_[_0xdb76('0x34')](_0x955f2f,{'id':_0x26f9bf['id']})[_0xdb76('0x76')];});return _0x26f9bf[_0xdb76('0x71')];});return db[_0xdb76('0x51')]['find']({'where':{'id':_0x40f08d[_0xdb76('0x50')]['id']}})['then'](function(_0x2b7f96){return db['sequelize']['transaction'](function(_0x256ca0){return _0x2b7f96[_0xdb76('0x77')](_0x4c14f1,{'transaction':_0x256ca0})[_0xdb76('0x28')](function(){return BPromise['each'](_0x955f2f,function(_0x8e89ef){return db[_0xdb76('0x78')][_0xdb76('0x79')]({'TeamId':_0x8e89ef['id'],'VoiceQueueId':_0x40f08d[_0xdb76('0x50')]['id'],'penalty':_0x8e89ef['penalty']},{'transaction':_0x256ca0});});})[_0xdb76('0x28')](function(){return BPromise[_0xdb76('0x7a')](_0x21247f,function(_0x2801a9){return db[_0xdb76('0x7b')][_0xdb76('0x7c')]({'where':{'UserId':_0x2801a9['id'],'VoiceQueueId':_0x40f08d[_0xdb76('0x50')]['id']},'defaults':{'penalty':_0x2801a9['penalty']},'transaction':_0x256ca0});});})['then'](function(){return BPromise[_0xdb76('0x7a')](_[_0xdb76('0x2e')](_0x21247f,{'online':!![]}),function(_0x41f113){return db[_0xdb76('0x7d')][_0xdb76('0x79')]({'membername':_0x41f113[_0xdb76('0x35')],'UserId':_0x41f113['id'],'queue_name':_0x2b7f96[_0xdb76('0x35')],'VoiceQueueId':_0x2b7f96['id'],'interface':_[_0xdb76('0x7e')](_0x41f113[_0xdb76('0x7f')])?util[_0xdb76('0x80')]('SIP/%s',_0x41f113[_0xdb76('0x35')]):_0x41f113[_0xdb76('0x7f')],'paused':_0x41f113[_0xdb76('0x73')]||![],'penalty':_0x41f113[_0xdb76('0x76')]},{'transaction':_0x256ca0});});})[_0xdb76('0x28')](function(){_0x21247f[_0xdb76('0x75')](function(_0xdd9d47){socket[_0xdb76('0x81')](_0xdb76('0x82'),{'UserId':_0xdd9d47['id'],'VoiceQueueId':_0x2b7f96['id']});});});});});}})[_0xdb76('0x28')](respondWithStatusCode(_0x1d3e42,null))[_0xdb76('0x53')](handleError(_0x1d3e42,null));};exports['removeTeams']=function(_0x12c50f,_0x4cf9e4,_0x185cb9){return db[_0xdb76('0x6e')][_0xdb76('0x4d')]({'where':{'id':_0x12c50f[_0xdb76('0x3e')][_0xdb76('0x83')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdb76('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4cf9e4,null))[_0xdb76('0x28')](function(_0x5e86b0){var _0x23fafd=_[_0xdb76('0x30')](_0x5e86b0,'id');var _0x3b587d=[];var _0x1d766c=[];var _0x32b21e=squel[_0xdb76('0x84')]();_0x32b21e[_0xdb76('0x85')](_0xdb76('0x86'))[_0xdb76('0x87')](_0xdb76('0x88'),'tq')[_0xdb76('0x89')](_0xdb76('0x8a'),'ut',_0xdb76('0x8b'))['where'](_0xdb76('0x8c'),_0x12c50f['params']['id']);for(var _0x344c3c=0x0;_0x344c3c<_0x5e86b0[_0xdb76('0x44')];_0x344c3c+=0x1){let _0x1cec7b=_0x5e86b0[_0x344c3c];for(var _0x525249=0x0;_0x525249<_0x1cec7b[_0xdb76('0x71')]['length'];_0x525249+=0x1){let _0x31f18f=_0x1cec7b[_0xdb76('0x71')][_0x525249];var _0x8a88e8=_0x32b21e[_0xdb76('0x5e')]();_0x8a88e8['where'](_0xdb76('0x8d'),_0x31f18f['id']);_0x1d766c['push'](db['sequelize'][_0xdb76('0x3e')](_0x8a88e8[_0xdb76('0x8e')](),{'type':db['sequelize'][_0xdb76('0x8f')][_0xdb76('0x90')]})[_0xdb76('0x28')](function(_0x2bb0f0){if(_0x2bb0f0[_0xdb76('0x44')]===0x1){return _0x31f18f['id'];}else{var _0x99ce1a=_[_0xdb76('0x91')](_['map'](_0x2bb0f0,'TeamId'),function(_0x292c2b){return _[_0xdb76('0x32')](_0x23fafd,_0x292c2b);});if(_0x99ce1a){return _0x31f18f['id'];}}}));}}return BPromise[_0xdb76('0x92')](_0x1d766c)[_0xdb76('0x28')](function(_0x5e9fe7){_0x3b587d=_(_0x3b587d)[_0xdb76('0x93')](_0x5e9fe7)[_0xdb76('0x94')]()[_0xdb76('0x31')]();return db[_0xdb76('0x51')][_0xdb76('0x34')]({'where':{'id':_0x12c50f['params']['id']}})[_0xdb76('0x28')](function(_0x796b45){return db['sequelize'][_0xdb76('0x95')](function(_0x2d22db){return _0x796b45[_0xdb76('0x96')](_0x12c50f[_0xdb76('0x3e')][_0xdb76('0x83')],{'transaction':_0x2d22db})['then'](function(){if(!_['isEmpty'](_0x3b587d)){return _0x796b45['removeAgents'](_0x3b587d,{'transaction':_0x2d22db})[_0xdb76('0x28')](function(){return db[_0xdb76('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x12c50f['params']['id'],'UserId':_0x3b587d},'transaction':_0x2d22db});});}})[_0xdb76('0x28')](function(){_0x3b587d[_0xdb76('0x75')](function(_0xa74ad8){socket[_0xdb76('0x81')](_0xdb76('0x97'),{'UserId':_0xa74ad8,'VoiceQueueId':_0x796b45['id']});});});});});});})[_0xdb76('0x28')](respondWithStatusCode(_0x4cf9e4,null))['catch'](handleError(_0x4cf9e4,null));};exports[_0xdb76('0x98')]=function(_0x30d725,_0x5a49e7,_0x2dc95d){var _0x45f0c5,_0xa187ee;return db[_0xdb76('0x51')]['find']({'where':{'id':_0x30d725['params']['id']}})['then'](handleEntityNotFound(_0x5a49e7,null))[_0xdb76('0x28')](function(_0xa5e32c){if(_0xa5e32c){_0xa187ee=_0xa5e32c;return _0xa5e32c['addAgents'](_0x30d725[_0xdb76('0x55')][_0xdb76('0x83')],_[_0xdb76('0x99')](_0x30d725['body'],['ids','id'])||{})[_0xdb76('0x9a')](function(_0x3d1f23){for(var _0x456eef=0x0;_0x456eef<_0x30d725['body'][_0xdb76('0x83')][_0xdb76('0x44')];_0x456eef+=0x1){socket[_0xdb76('0x81')](_0xdb76('0x82'),{'UserId':Number(_0x30d725[_0xdb76('0x55')][_0xdb76('0x83')][_0x456eef]),'VoiceQueueId':Number(_0x30d725['params']['id'])});}return _0x3d1f23;});}})[_0xdb76('0x28')](function(_0x33d1b0){_0x45f0c5=_0x33d1b0||[];if(_0xa187ee){return db[_0xdb76('0x9b')][_0xdb76('0x4d')]({'where':{'id':_0x30d725[_0xdb76('0x55')]['ids']},'attributes':['id',_0xdb76('0x35'),_0xdb76('0x72'),'voicePause',_0xdb76('0x7f')],'raw':!![]});}})[_0xdb76('0x28')](function(_0x50a921){if(!_[_0xdb76('0x9c')](_0x50a921)){var _0x9bdd3=[];for(var _0x294f4=0x0;_0x294f4<_0x50a921[_0xdb76('0x44')];_0x294f4++){if(_0x50a921[_0x294f4][_0xdb76('0x72')]){_0x9bdd3[_0xdb76('0x9d')](db[_0xdb76('0x7d')][_0xdb76('0x79')]({'membername':_0x50a921[_0x294f4]['name'],'UserId':_0x50a921[_0x294f4]['id'],'queue_name':_0xa187ee['name'],'VoiceQueueId':_0xa187ee['id'],'interface':_[_0xdb76('0x7e')](_0x50a921[_0x294f4]['interface'])?util[_0xdb76('0x80')](_0xdb76('0x9e'),_0x50a921[_0x294f4]['name']):_0x50a921[_0x294f4][_0xdb76('0x7f')],'paused':_0x50a921[_0x294f4][_0xdb76('0x73')]||![],'penalty':_0x30d725[_0xdb76('0x55')][_0xdb76('0x76')]||0x0}));}}return BPromise[_0xdb76('0x92')](_0x9bdd3);}})[_0xdb76('0x28')](function(){return _0x45f0c5;})[_0xdb76('0x28')](respondWithResult(_0x5a49e7,null))[_0xdb76('0x53')](handleError(_0x5a49e7,null));};exports['removeAgents']=function(_0x32814c,_0x36a31f,_0x31945e){return db[_0xdb76('0x51')]['find']({'where':{'id':_0x32814c[_0xdb76('0x50')]['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x36a31f,null))[_0xdb76('0x28')](function(_0x4c3077){if(_0x4c3077){return _0x4c3077[_0xdb76('0x9f')](_0x32814c[_0xdb76('0x3e')]['ids'])[_0xdb76('0x28')](function(){if(_[_0xdb76('0xa0')](_0x32814c[_0xdb76('0x3e')][_0xdb76('0x83')])){for(var _0x54ce9d=0x0;_0x54ce9d<_0x32814c[_0xdb76('0x3e')]['ids'][_0xdb76('0x44')];_0x54ce9d+=0x1){socket[_0xdb76('0x81')](_0xdb76('0x97'),{'UserId':Number(_0x32814c[_0xdb76('0x3e')][_0xdb76('0x83')][_0x54ce9d]),'VoiceQueueId':Number(_0x32814c[_0xdb76('0x50')]['id'])});}}else{socket[_0xdb76('0x81')](_0xdb76('0x97'),{'UserId':Number(_0x32814c[_0xdb76('0x3e')][_0xdb76('0x83')]),'VoiceQueueId':Number(_0x32814c[_0xdb76('0x50')]['id'])});}});}})['then'](function(_0x46e994){return db[_0xdb76('0x7d')][_0xdb76('0x29')]({'where':{'VoiceQueueId':_0x32814c[_0xdb76('0x50')]['id'],'UserId':_0x32814c[_0xdb76('0x3e')][_0xdb76('0x83')]}})['then'](function(){return _0x46e994;});})[_0xdb76('0x28')](respondWithStatusCode(_0x36a31f,null))[_0xdb76('0x53')](handleError(_0x36a31f,null));};exports[_0xdb76('0xa1')]=function(_0x446779,_0x4cda20,_0x5f1292){var _0x274d27={};var _0x45f126={};var _0xa0a184;var _0x26822a;return db[_0xdb76('0x51')][_0xdb76('0x62')]({'where':{'id':_0x446779[_0xdb76('0x50')]['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x4cda20,null))[_0xdb76('0x28')](function(_0x27283e){if(_0x27283e){_0xa0a184=_0x27283e;_0x45f126[_0xdb76('0x3d')]=_[_0xdb76('0x3f')](db[_0xdb76('0x9b')][_0xdb76('0x52')]);_0x45f126['query']=_[_0xdb76('0x3f')](_0x446779['query']);_0x45f126[_0xdb76('0x40')]=_[_0xdb76('0x41')](_0x45f126[_0xdb76('0x3d')],_0x45f126['query']);_0x274d27[_0xdb76('0x42')]=_['intersection'](_0x45f126[_0xdb76('0x3d')],qs[_0xdb76('0x43')](_0x446779['query'][_0xdb76('0x43')]));_0x274d27['attributes']=_0x274d27[_0xdb76('0x42')][_0xdb76('0x44')]?_0x274d27[_0xdb76('0x42')]:_0x45f126[_0xdb76('0x3d')];_0x274d27[_0xdb76('0x65')]=qs[_0xdb76('0x46')](_0x446779['query'][_0xdb76('0x46')]);_0x274d27[_0xdb76('0x47')]=qs[_0xdb76('0x40')](_[_0xdb76('0x6d')](_0x446779['query'],_0x45f126[_0xdb76('0x40')]));if(_0x446779['query']['filter']){_0x274d27[_0xdb76('0x47')]=_['merge'](_0x274d27['where'],{'$or':_[_0xdb76('0x30')](_0x274d27['attributes'],function(_0x46743c){var _0x144840={};_0x144840[_0x46743c]={'$like':'%'+_0x446779[_0xdb76('0x3e')]['filter']+'%'};return _0x144840;})});}_0x274d27=_[_0xdb76('0x48')]({},_0x274d27,_0x446779[_0xdb76('0x4a')]);return _0xa0a184[_0xdb76('0xa1')](_0x274d27);}})[_0xdb76('0x28')](function(_0x29a09d){if(_0x29a09d){_0x26822a=_0x29a09d[_0xdb76('0x44')];if(!_0x446779[_0xdb76('0x3e')][_0xdb76('0x64')]('nolimit')){_0x274d27[_0xdb76('0x22')]=qs['limit'](_0x446779[_0xdb76('0x3e')][_0xdb76('0x22')]);_0x274d27['offset']=qs['offset'](_0x446779[_0xdb76('0x3e')][_0xdb76('0x1f')]);}return _0xa0a184[_0xdb76('0xa1')](_0x274d27);}})[_0xdb76('0x28')](function(_0x3ec57f){if(_0x3ec57f){return _0x3ec57f?{'count':_0x26822a,'rows':_0x3ec57f}:null;}})['then'](respondWithResult(_0x4cda20,null))['catch'](handleError(_0x4cda20,null));};exports[_0xdb76('0xa2')]=function(_0x1107d1,_0x4690c2,_0x4bad25){var _0x21f21a={};var _0x399f79={};var _0x400cde;var _0x241861;return db[_0xdb76('0x51')][_0xdb76('0x62')]({'where':{'id':_0x1107d1[_0xdb76('0x50')]['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x4690c2,null))[_0xdb76('0x28')](function(_0x1eebc8){if(_0x1eebc8){_0x400cde=_0x1eebc8;_0x399f79[_0xdb76('0x3d')]=_[_0xdb76('0x3f')](db[_0xdb76('0x7d')][_0xdb76('0x52')]);_0x399f79[_0xdb76('0x3e')]=_[_0xdb76('0x3f')](_0x1107d1[_0xdb76('0x3e')]);_0x399f79['filters']=_[_0xdb76('0x41')](_0x399f79[_0xdb76('0x3d')],_0x399f79[_0xdb76('0x3e')]);_0x21f21a[_0xdb76('0x42')]=_[_0xdb76('0x41')](_0x399f79[_0xdb76('0x3d')],qs[_0xdb76('0x43')](_0x1107d1['query'][_0xdb76('0x43')]));_0x21f21a[_0xdb76('0x42')]=_0x21f21a[_0xdb76('0x42')][_0xdb76('0x44')]?_0x21f21a[_0xdb76('0x42')]:_0x399f79[_0xdb76('0x3d')];_0x21f21a[_0xdb76('0x65')]=qs[_0xdb76('0x46')](_0x1107d1[_0xdb76('0x3e')][_0xdb76('0x46')]);_0x21f21a[_0xdb76('0x47')]=qs[_0xdb76('0x40')](_[_0xdb76('0x6d')](_0x1107d1[_0xdb76('0x3e')],_0x399f79[_0xdb76('0x40')]));if(_0x1107d1[_0xdb76('0x3e')][_0xdb76('0x2e')]){_0x21f21a[_0xdb76('0x47')]=_[_0xdb76('0x48')](_0x21f21a['where'],{'$or':_[_0xdb76('0x30')](_0x21f21a[_0xdb76('0x42')],function(_0x3d5419){var _0x3c42d3={};_0x3c42d3[_0x3d5419]={'$like':'%'+_0x1107d1[_0xdb76('0x3e')][_0xdb76('0x2e')]+'%'};return _0x3c42d3;})});}_0x21f21a=_['merge']({},_0x21f21a,_0x1107d1[_0xdb76('0x4a')]);return _0x400cde[_0xdb76('0xa2')](_0x21f21a);}})[_0xdb76('0x28')](function(_0x180620){if(_0x180620){_0x241861=_0x180620[_0xdb76('0x44')];if(!_0x1107d1['query'][_0xdb76('0x64')](_0xdb76('0x45'))){_0x21f21a['limit']=qs[_0xdb76('0x22')](_0x1107d1[_0xdb76('0x3e')][_0xdb76('0x22')]);_0x21f21a[_0xdb76('0x1f')]=qs[_0xdb76('0x1f')](_0x1107d1[_0xdb76('0x3e')][_0xdb76('0x1f')]);}return _0x400cde[_0xdb76('0xa2')](_0x21f21a);}})[_0xdb76('0x28')](function(_0x1dc52f){return _0x1dc52f?{'count':_0x241861,'rows':_0x1dc52f}:null;})['then'](respondWithResult(_0x4690c2,null))[_0xdb76('0x53')](handleError(_0x4690c2,null));};exports[_0xdb76('0xa3')]=function(_0x2b1a2a,_0x408b06,_0x596672){var _0x59ad39={};var _0x3f2366={};var _0x5b8186;var _0x3553c6;return db['VoiceQueue'][_0xdb76('0x62')]({'where':{'id':_0x2b1a2a[_0xdb76('0x50')]['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x408b06,null))[_0xdb76('0x28')](function(_0xc0cc5){if(_0xc0cc5){_0x5b8186=_0xc0cc5;_0x3f2366[_0xdb76('0x3d')]=_[_0xdb76('0x3f')](db['CmList'][_0xdb76('0x52')]);_0x3f2366[_0xdb76('0x3e')]=_[_0xdb76('0x3f')](_0x2b1a2a['query']);_0x3f2366['filters']=_[_0xdb76('0x41')](_0x3f2366[_0xdb76('0x3d')],_0x3f2366[_0xdb76('0x3e')]);_0x59ad39[_0xdb76('0x42')]=_[_0xdb76('0x41')](_0x3f2366['model'],qs[_0xdb76('0x43')](_0x2b1a2a['query']['fields']));_0x59ad39['attributes']=_0x59ad39['attributes'][_0xdb76('0x44')]?_0x59ad39['attributes']:_0x3f2366[_0xdb76('0x3d')];_0x59ad39['order']=qs[_0xdb76('0x46')](_0x2b1a2a[_0xdb76('0x3e')][_0xdb76('0x46')]);_0x59ad39[_0xdb76('0x47')]=qs['filters'](_['pick'](_0x2b1a2a[_0xdb76('0x3e')],_0x3f2366['filters']));if(_0x2b1a2a[_0xdb76('0x3e')]['filter']){_0x59ad39[_0xdb76('0x47')]=_[_0xdb76('0x48')](_0x59ad39[_0xdb76('0x47')],{'$or':_['map'](_0x59ad39['attributes'],function(_0x244ce4){var _0x5eb366={};_0x5eb366[_0x244ce4]={'$like':'%'+_0x2b1a2a[_0xdb76('0x3e')]['filter']+'%'};return _0x5eb366;})});}_0x59ad39=_[_0xdb76('0x48')]({},_0x59ad39,_0x2b1a2a[_0xdb76('0x4a')]);return _0x5b8186[_0xdb76('0xa3')](_0x59ad39);}})[_0xdb76('0x28')](function(_0x2ac591){if(_0x2ac591){_0x3553c6=_0x2ac591[_0xdb76('0x44')];if(!_0x2b1a2a['query'][_0xdb76('0x64')](_0xdb76('0x45'))){_0x59ad39['limit']=qs[_0xdb76('0x22')](_0x2b1a2a[_0xdb76('0x3e')][_0xdb76('0x22')]);_0x59ad39['offset']=qs['offset'](_0x2b1a2a[_0xdb76('0x3e')][_0xdb76('0x1f')]);}return _0x5b8186['getLists'](_0x59ad39);}})[_0xdb76('0x28')](function(_0x34bbab){if(_0x34bbab){return _0x34bbab?{'count':_0x3553c6,'rows':_0x34bbab}:null;}})[_0xdb76('0x28')](respondWithResult(_0x408b06,null))['catch'](handleError(_0x408b06,null));};exports[_0xdb76('0xa4')]=function(_0x151511,_0x513e91,_0x428d30){var _0x361a92=moment()['format'](_0xdb76('0xa5'));var _0x82b380,_0x18c2fa;return db['VoiceQueue'][_0xdb76('0x34')]({'where':{'id':_0x151511['params']['id']}})['then'](handleEntityNotFound(_0x513e91,null))[_0xdb76('0x28')](function(_0x221908){if(_0x221908){_0x18c2fa=_0x221908;return _0x221908[_0xdb76('0xa4')](_0x151511[_0xdb76('0x55')][_0xdb76('0x83')],_[_0xdb76('0x99')](_0x151511['body'],[_0xdb76('0x83'),'id'])||{});}return null;})[_0xdb76('0x9a')](function(_0x53cf02){var _0x1b7e52;_0x82b380=_0x53cf02||[];var _0x2a0b00=[];if(_0x53cf02){for(var _0x3ec03b=0x0;_0x3ec03b<_0x53cf02[_0xdb76('0x44')];_0x3ec03b+=0x1){var _0xa9ff9=_0x53cf02[_0x3ec03b][_0xdb76('0x2a')]({'plain':!![]});_0x18c2fa['dialCheckDuplicateType']=_0x151511[_0xdb76('0x55')][_0xdb76('0xa6')]?_0x151511[_0xdb76('0x55')][_0xdb76('0xa6')]:_0x18c2fa[_0xdb76('0xa6')];switch(_0x18c2fa[_0xdb76('0xa6')]){case _0xdb76('0xa7'):_0x1b7e52=squel[_0xdb76('0xa8')]()['into']('cm_hopper')['fromQuery']([_0xdb76('0xa9'),_0xdb76('0xaa'),'ContactId',_0xdb76('0xab'),_0xdb76('0x66'),_0xdb76('0x5f'),_0xdb76('0x60')],squel['select']()[_0xdb76('0x85')](_0xdb76('0xa9'),_0xdb76('0xa9'))[_0xdb76('0x85')]('\x27'+_0x361a92+'\x27','scheduledAt')[_0xdb76('0x85')]('id',_0xdb76('0xac'))[_0xdb76('0x85')](_0xa9ff9[_0xdb76('0xad')][_0xdb76('0x8e')](),_0xdb76('0xab'))[_0xdb76('0x85')](_0x151511[_0xdb76('0x50')]['id'][_0xdb76('0x8e')](),_0xdb76('0x66'))[_0xdb76('0x85')]('\x27'+_0x361a92+'\x27',_0xdb76('0x5f'))[_0xdb76('0x85')]('\x27'+_0x361a92+'\x27',_0xdb76('0x60'))[_0xdb76('0x87')](_0xdb76('0xae'))[_0xdb76('0x47')](_0xdb76('0xaf'))[_0xdb76('0x47')]('ListId\x20=\x20?',_0xa9ff9[_0xdb76('0xad')]['toString']())[_0xdb76('0x47')](_0xdb76('0xb0'))[_0xdb76('0x47')](_0xdb76('0xb1'),squel[_0xdb76('0x84')]()[_0xdb76('0x85')]('COALESCE(calleridnum,\x27\x27)')[_0xdb76('0x87')](_0xdb76('0xb2'))[_0xdb76('0x47')](_0xdb76('0x8c'),_0x151511[_0xdb76('0x50')]['id'][_0xdb76('0x8e')]()))[_0xdb76('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0xdb76('0x84')]()['field']('COALESCE(phone,\x27\x27)')[_0xdb76('0x87')]('cm_hopper')[_0xdb76('0x47')](_0xdb76('0x8c'),_0x151511[_0xdb76('0x50')]['id'][_0xdb76('0x8e')]())))[_0xdb76('0x8e')]();break;case _0xdb76('0xb3'):_0x1b7e52=squel[_0xdb76('0xa8')]()[_0xdb76('0xb4')]('cm_hopper')[_0xdb76('0xb5')]([_0xdb76('0xa9'),_0xdb76('0xaa'),_0xdb76('0xac'),_0xdb76('0xab'),'VoiceQueueId',_0xdb76('0x5f'),_0xdb76('0x60')],squel[_0xdb76('0x84')]()['field'](_0xdb76('0xa9'),_0xdb76('0xa9'))[_0xdb76('0x85')]('\x27'+_0x361a92+'\x27','scheduledAt')[_0xdb76('0x85')]('id',_0xdb76('0xac'))[_0xdb76('0x85')](_0xa9ff9[_0xdb76('0xad')][_0xdb76('0x8e')](),_0xdb76('0xab'))[_0xdb76('0x85')](_0x151511[_0xdb76('0x50')]['id'][_0xdb76('0x8e')](),_0xdb76('0x66'))[_0xdb76('0x85')]('\x27'+_0x361a92+'\x27',_0xdb76('0x5f'))[_0xdb76('0x85')]('\x27'+_0x361a92+'\x27','updatedAt')[_0xdb76('0x87')](_0xdb76('0xae'))[_0xdb76('0x47')]('deletedAt\x20IS\x20NULL')[_0xdb76('0x47')]('ListId\x20=\x20?',_0xa9ff9[_0xdb76('0xad')][_0xdb76('0x8e')]())[_0xdb76('0x47')](_0xdb76('0xb0'))[_0xdb76('0x47')](_0xdb76('0xb1'),squel[_0xdb76('0x84')]()['field'](_0xdb76('0xb6'))[_0xdb76('0x87')](_0xdb76('0xb7'))[_0xdb76('0x47')](_0xdb76('0x8c'),_0x151511[_0xdb76('0x50')]['id'][_0xdb76('0x8e')]())))[_0xdb76('0x8e')]();break;default:_0x1b7e52=squel[_0xdb76('0xa8')]()['into'](_0xdb76('0xb7'))['fromQuery']([_0xdb76('0xa9'),_0xdb76('0xaa'),'ContactId',_0xdb76('0xab'),'VoiceQueueId',_0xdb76('0x5f'),_0xdb76('0x60')],squel[_0xdb76('0x84')]()['field'](_0xdb76('0xa9'),'phone')[_0xdb76('0x85')]('\x27'+_0x361a92+'\x27',_0xdb76('0xaa'))[_0xdb76('0x85')]('id',_0xdb76('0xac'))['field'](_0xa9ff9['CmListId'][_0xdb76('0x8e')](),'ListId')['field'](_0x151511[_0xdb76('0x50')]['id'][_0xdb76('0x8e')](),_0xdb76('0x66'))[_0xdb76('0x85')]('\x27'+_0x361a92+'\x27','createdAt')[_0xdb76('0x85')]('\x27'+_0x361a92+'\x27',_0xdb76('0x60'))[_0xdb76('0x87')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xdb76('0x47')](_0xdb76('0xb8'),_0xa9ff9[_0xdb76('0xad')][_0xdb76('0x8e')]())[_0xdb76('0x47')](_0xdb76('0xb0')))[_0xdb76('0x8e')]();}_0x2a0b00[_0xdb76('0x9d')](db[_0xdb76('0xb9')][_0xdb76('0x3e')](_0x1b7e52));}return BPromise['all'](_0x2a0b00);}})[_0xdb76('0x28')](function(){var _0x467ead=[];var _0x30609d=squel[_0xdb76('0xa8')]()[_0xdb76('0xb4')](_0xdb76('0xba'))['fromQuery']([_0xdb76('0xbb'),_0xdb76('0xa9'),_0xdb76('0xbc'),_0xdb76('0x5f'),_0xdb76('0x60')],squel['select']()[_0xdb76('0x85')](_0xdb76('0xbd'))[_0xdb76('0x85')](_0xdb76('0xbe'))['field'](_0xdb76('0xbf'))[_0xdb76('0x85')]('\x27'+_0x361a92+'\x27','createdAt')[_0xdb76('0x85')]('\x27'+_0x361a92+'\x27',_0xdb76('0x60'))[_0xdb76('0x87')](_0xdb76('0xc0'),'ci')[_0xdb76('0x89')](_0xdb76('0xb7'),'h',_0xdb76('0xc1'))['where'](_0xdb76('0xc2'),_0x361a92)['where'](_0xdb76('0xc3'),_0xdb76('0xc4')))[_0xdb76('0x8e')]();_0x467ead[_0xdb76('0x9d')](db[_0xdb76('0xb9')][_0xdb76('0x3e')](_0x30609d));return BPromise['all'](_0x467ead);})[_0xdb76('0x28')](function(){return _0x82b380;})[_0xdb76('0x28')](respondWithResult(_0x513e91,null))['catch'](handleError(_0x513e91,null));};exports['removeLists']=function(_0x314278,_0x5eccf0,_0x49605e){return db[_0xdb76('0x51')][_0xdb76('0x34')]({'where':{'id':_0x314278['params']['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x5eccf0,null))[_0xdb76('0x28')](function(_0x22ae58){if(_0x22ae58){return _0x22ae58[_0xdb76('0xc5')](_0x314278[_0xdb76('0x3e')]['ids']);}})[_0xdb76('0x28')](function(_0x59d1cf){if(_0x59d1cf){return db['CmHopper'][_0xdb76('0x29')]({'where':{'ListId':_0x314278['query']['ids'],'VoiceQueueId':_0x314278['params']['id']}})[_0xdb76('0x28')](function(){return _0x59d1cf;});}})[_0xdb76('0x28')](respondWithStatusCode(_0x5eccf0,null))['catch'](handleError(_0x5eccf0,null));};exports[_0xdb76('0xc6')]=function(_0x398956,_0x425176,_0x5c8e31){var _0x40d45c={};var _0x1d2c1c={};var _0x5e2cfe;var _0xddbe30;return db[_0xdb76('0x51')][_0xdb76('0x62')]({'where':{'id':_0x398956[_0xdb76('0x50')]['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x425176,null))[_0xdb76('0x28')](function(_0xeaccc6){if(_0xeaccc6){_0x5e2cfe=_0xeaccc6;_0x1d2c1c[_0xdb76('0x3d')]=_[_0xdb76('0x3f')](db[_0xdb76('0xc7')][_0xdb76('0x52')]);_0x1d2c1c['query']=_['keys'](_0x398956[_0xdb76('0x3e')]);_0x1d2c1c['filters']=_['intersection'](_0x1d2c1c[_0xdb76('0x3d')],_0x1d2c1c[_0xdb76('0x3e')]);_0x40d45c[_0xdb76('0x42')]=_[_0xdb76('0x41')](_0x1d2c1c[_0xdb76('0x3d')],qs[_0xdb76('0x43')](_0x398956[_0xdb76('0x3e')][_0xdb76('0x43')]));_0x40d45c['attributes']=_0x40d45c[_0xdb76('0x42')][_0xdb76('0x44')]?_0x40d45c[_0xdb76('0x42')]:_0x1d2c1c[_0xdb76('0x3d')];_0x40d45c['order']=qs['sort'](_0x398956[_0xdb76('0x3e')]['sort']);_0x40d45c[_0xdb76('0x47')]=qs[_0xdb76('0x40')](_[_0xdb76('0x6d')](_0x398956[_0xdb76('0x3e')],_0x1d2c1c['filters']));if(_0x398956['query'][_0xdb76('0x2e')]){_0x40d45c[_0xdb76('0x47')]=_[_0xdb76('0x48')](_0x40d45c['where'],{'$or':_[_0xdb76('0x30')](_0x40d45c[_0xdb76('0x42')],function(_0x225781){var _0x3ab8f0={};_0x3ab8f0[_0x225781]={'$like':'%'+_0x398956[_0xdb76('0x3e')][_0xdb76('0x2e')]+'%'};return _0x3ab8f0;})});}_0x40d45c=_[_0xdb76('0x48')]({},_0x40d45c,_0x398956[_0xdb76('0x4a')]);return _0x5e2cfe[_0xdb76('0xc6')](_0x40d45c);}})[_0xdb76('0x28')](function(_0x24cfe8){if(_0x24cfe8){_0xddbe30=_0x24cfe8[_0xdb76('0x44')];if(!_0x398956[_0xdb76('0x3e')][_0xdb76('0x64')]('nolimit')){_0x40d45c['limit']=qs[_0xdb76('0x22')](_0x398956[_0xdb76('0x3e')][_0xdb76('0x22')]);_0x40d45c[_0xdb76('0x1f')]=qs[_0xdb76('0x1f')](_0x398956[_0xdb76('0x3e')][_0xdb76('0x1f')]);}return _0x5e2cfe[_0xdb76('0xc6')](_0x40d45c);}})['then'](function(_0x2ed408){if(_0x2ed408){return _0x2ed408?{'count':_0xddbe30,'rows':_0x2ed408}:null;}})['then'](respondWithResult(_0x425176,null))[_0xdb76('0x53')](handleError(_0x425176,null));};exports[_0xdb76('0xc8')]=function(_0x12a9c1,_0x40ae05,_0x1bd515){var _0xb8c3e6,_0x16f699;return db[_0xdb76('0x51')][_0xdb76('0x34')]({'where':{'id':_0x12a9c1[_0xdb76('0x50')]['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x40ae05,null))[_0xdb76('0x28')](function(_0x306f62){if(_0x306f62){_0x16f699=_0x306f62;return _0x306f62[_0xdb76('0xc8')](_0x12a9c1[_0xdb76('0x55')][_0xdb76('0x83')],_['omit'](_0x12a9c1['body'],[_0xdb76('0x83'),'id'])||{});}return null;})[_0xdb76('0x9a')](function(_0x7d2f5c){var _0x40c372;_0xb8c3e6=_0x7d2f5c||[];var _0x6677d2=[];if(_0x7d2f5c){for(var _0x39745e=0x0;_0x39745e<_0x7d2f5c['length'];_0x39745e+=0x1){var _0x3b329d=_0x7d2f5c[_0x39745e]['get']({'plain':!![]});_0x40c372=squel[_0xdb76('0xa8')]()[_0xdb76('0xb4')](_0xdb76('0xc9'))[_0xdb76('0xb5')]([_0xdb76('0xa9'),'ContactId',_0xdb76('0xab'),_0xdb76('0x66'),_0xdb76('0x5f'),_0xdb76('0x60')],squel[_0xdb76('0x84')]()[_0xdb76('0x85')](_0xdb76('0xa9'),'phone')[_0xdb76('0x85')]('id',_0xdb76('0xac'))['field'](_0x3b329d[_0xdb76('0xad')][_0xdb76('0x8e')](),_0xdb76('0xab'))[_0xdb76('0x85')](_0x12a9c1[_0xdb76('0x50')]['id'][_0xdb76('0x8e')](),_0xdb76('0x66'))[_0xdb76('0x85')](_0xdb76('0xca'),'createdAt')['field'](_0xdb76('0xca'),_0xdb76('0x60'))[_0xdb76('0x87')](_0xdb76('0xae'))[_0xdb76('0x47')]('deletedAt\x20IS\x20NULL')[_0xdb76('0x47')](_0xdb76('0xb8'),_0x3b329d['CmListId'][_0xdb76('0x8e')]())[_0xdb76('0x47')]('phone\x20IS\x20NOT\x20NULL'))[_0xdb76('0x8e')]();_0x6677d2[_0xdb76('0x9d')](db[_0xdb76('0xb9')][_0xdb76('0x3e')](_0x40c372));}return BPromise[_0xdb76('0x92')](_0x6677d2);}})[_0xdb76('0x28')](function(){return _0xb8c3e6;})[_0xdb76('0x28')](respondWithResult(_0x40ae05,null))[_0xdb76('0x53')](handleError(_0x40ae05,null));};exports['removeBlackLists']=function(_0x73ee7f,_0x107fa8,_0x56a1c3){return db['VoiceQueue'][_0xdb76('0x34')]({'where':{'id':_0x73ee7f[_0xdb76('0x50')]['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x107fa8,null))[_0xdb76('0x28')](function(_0x25f26b){if(_0x25f26b){return _0x25f26b[_0xdb76('0xcb')](_0x73ee7f['query']['ids']);}})[_0xdb76('0x28')](function(_0x45024d){if(_0x45024d){return db[_0xdb76('0x6c')][_0xdb76('0x29')]({'where':{'ListId':_0x73ee7f[_0xdb76('0x3e')]['ids'],'VoiceQueueId':_0x73ee7f[_0xdb76('0x50')]['id']}})[_0xdb76('0x28')](function(){return _0x45024d;});}})[_0xdb76('0x28')](respondWithStatusCode(_0x107fa8,null))[_0xdb76('0x53')](handleError(_0x107fa8,null));}; \ No newline at end of file +var _0xb7ac=['zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','inbound','QueueCampaigns','outbound','filter','map','value','find','type','name','sendStatus','error','send','index','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','includeAll','include','VoiceQueue','findAll','catch','show','params','length','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','order','VoiceQueueId','CmHopperHistory','pick','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','User','online','flatMap','Agents','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','isNil','interface','SIP/%s','emit','userVoiceQueue:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','union','removeTeams','ids','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','voicePause','upsert','isArray','getAgents','getMembers','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','into','cm_hopper','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','insert','fromQuery','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xb7ac,0x18a));var _0xcb7a=function(_0x580be5,_0x4f4d22){_0x580be5=_0x580be5-0x0;var _0x35cf86=_0xb7ac[_0x580be5];return _0x35cf86;};'use strict';var emlformat=require(_0xcb7a('0x0'));var rimraf=require(_0xcb7a('0x1'));var zipdir=require(_0xcb7a('0x2'));var jsonpatch=require(_0xcb7a('0x3'));var rp=require(_0xcb7a('0x4'));var moment=require('moment');var BPromise=require(_0xcb7a('0x5'));var Mustache=require('mustache');var util=require(_0xcb7a('0x6'));var path=require(_0xcb7a('0x7'));var sox=require('sox');var csv=require(_0xcb7a('0x8'));var ejs=require(_0xcb7a('0x9'));var fs=require('fs');var fs_extra=require(_0xcb7a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcb7a('0xb'));var jsforce=require(_0xcb7a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcb7a('0x8'));var querystring=require(_0xcb7a('0xd'));var Papa=require(_0xcb7a('0xe'));var Redis=require(_0xcb7a('0xf'));var authService=require(_0xcb7a('0x10'));var qs=require(_0xcb7a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb7a('0x12'));var logger=require(_0xcb7a('0x13'))(_0xcb7a('0x14'));var utils=require('../../config/utils');var config=require(_0xcb7a('0x15'));var licenseUtil=require(_0xcb7a('0x16'));var db=require('../../mysqldb')['db'];config[_0xcb7a('0x17')]=_[_0xcb7a('0x18')](config[_0xcb7a('0x17')],{'host':_0xcb7a('0x19'),'port':0x18eb});var socket=require(_0xcb7a('0x1a'))(new Redis(config[_0xcb7a('0x17')]));require(_0xcb7a('0x1b'))[_0xcb7a('0x1c')](socket);function respondWithStatusCode(_0x1669ed,_0x578f9c){_0x578f9c=_0x578f9c||0xcc;return function(_0x45ed80){if(_0x45ed80){return _0x1669ed['sendStatus'](_0x578f9c);}return _0x1669ed[_0xcb7a('0x1d')](_0x578f9c)[_0xcb7a('0x1e')]();};}function respondWithResult(_0x7f1071,_0x37ea19){_0x37ea19=_0x37ea19||0xc8;return function(_0x53721a){if(_0x53721a){return _0x7f1071[_0xcb7a('0x1d')](_0x37ea19)[_0xcb7a('0x1f')](_0x53721a);}};}function respondWithFilteredResult(_0x28d09d,_0x2cac76){return function(_0x118dde){if(_0x118dde){var _0x28be52=typeof _0x2cac76[_0xcb7a('0x20')]==='undefined'&&typeof _0x2cac76[_0xcb7a('0x21')]===_0xcb7a('0x22');var _0x1c6630=_0x118dde[_0xcb7a('0x23')];var _0x5dedbc=_0x28be52?0x0:_0x2cac76['offset'];var _0x5a2230=_0x28be52?_0x118dde[_0xcb7a('0x23')]:_0x2cac76['offset']+_0x2cac76[_0xcb7a('0x21')];var _0x112d6e;if(_0x5a2230>=_0x1c6630){_0x5a2230=_0x1c6630;_0x112d6e=0xc8;}else{_0x112d6e=0xce;}_0x28d09d[_0xcb7a('0x1d')](_0x112d6e);return _0x28d09d[_0xcb7a('0x24')](_0xcb7a('0x25'),_0x5dedbc+'-'+_0x5a2230+'/'+_0x1c6630)[_0xcb7a('0x1f')](_0x118dde);}return null;};}function patchUpdates(_0x18da58){return function(_0x3a3d87){try{jsonpatch[_0xcb7a('0x26')](_0x3a3d87,_0x18da58,!![]);}catch(_0x120bbc){return BPromise[_0xcb7a('0x27')](_0x120bbc);}return _0x3a3d87['save']();};}function saveUpdates(_0x5c9191,_0x4aabe1){return function(_0x202731){if(_0x202731){return _0x202731[_0xcb7a('0x28')](_0x5c9191)[_0xcb7a('0x29')](function(_0x28682a){return _0x28682a;});}return null;};}function removeEntity(_0x4830ff,_0x527ae8){return function(_0xe20b78){if(_0xe20b78){return _0xe20b78[_0xcb7a('0x2a')]()[_0xcb7a('0x29')](function(){var _0x558c42=_0xe20b78[_0xcb7a('0x2b')]({'plain':!![]});var _0x2fef04=[{'name':'VoiceQueues','value':_0xcb7a('0x2c'),'ignore':![]},{'name':_0xcb7a('0x2d'),'value':_0xcb7a('0x2e'),'ignore':![]}];var _0x36e2dd=_(_0x2fef04)[_0xcb7a('0x2f')]('ignore')[_0xcb7a('0x30')]('value')[_0xcb7a('0x31')]();if(_['includes'](_0x36e2dd,_0x558c42['type'])){return;}var _0x35469c=_[_0xcb7a('0x32')](_0x2fef04,[_0xcb7a('0x31'),_0x558c42[_0xcb7a('0x33')]])[_0xcb7a('0x34')];return db['UserProfileResource'][_0xcb7a('0x2a')]({'where':{'type':_0x35469c,'resourceId':_0x558c42['id']}})[_0xcb7a('0x29')](function(){return _0xe20b78;});})[_0xcb7a('0x29')](function(){_0x4830ff[_0xcb7a('0x1d')](0xcc)[_0xcb7a('0x1e')]();});}};}function handleEntityNotFound(_0x3c2091,_0x15c249){return function(_0x22f478){if(!_0x22f478){_0x3c2091[_0xcb7a('0x35')](0x194);}return _0x22f478;};}function handleError(_0x272920,_0x199be8){_0x199be8=_0x199be8||0x1f4;return function(_0x1062a4){logger[_0xcb7a('0x36')](_0x1062a4['stack']);if(_0x1062a4[_0xcb7a('0x34')]){delete _0x1062a4['name'];}_0x272920[_0xcb7a('0x1d')](_0x199be8)[_0xcb7a('0x37')](_0x1062a4);};}exports[_0xcb7a('0x38')]=function(_0x212cbf,_0x52557e){var _0x2132e4={},_0x5de97f={},_0xa2a3d5={'count':0x0,'rows':[]};var _0x3c333f=_[_0xcb7a('0x30')](db['VoiceQueue'][_0xcb7a('0x39')],function(_0x231331){return{'name':_0x231331['fieldName'],'type':_0x231331[_0xcb7a('0x33')][_0xcb7a('0x3a')]};});_0x5de97f[_0xcb7a('0x3b')]=_[_0xcb7a('0x30')](_0x3c333f,'name');_0x5de97f[_0xcb7a('0x3c')]=_[_0xcb7a('0x3d')](_0x212cbf[_0xcb7a('0x3c')]);_0x5de97f['filters']=_[_0xcb7a('0x3e')](_0x5de97f[_0xcb7a('0x3b')],_0x5de97f[_0xcb7a('0x3c')]);_0x2132e4[_0xcb7a('0x3f')]=_[_0xcb7a('0x3e')](_0x5de97f[_0xcb7a('0x3b')],qs['fields'](_0x212cbf[_0xcb7a('0x3c')][_0xcb7a('0x40')]));_0x2132e4[_0xcb7a('0x3f')]=_0x2132e4[_0xcb7a('0x3f')]['length']?_0x2132e4[_0xcb7a('0x3f')]:_0x5de97f[_0xcb7a('0x3b')];if(!_0x212cbf[_0xcb7a('0x3c')][_0xcb7a('0x41')](_0xcb7a('0x42'))){_0x2132e4[_0xcb7a('0x21')]=qs[_0xcb7a('0x21')](_0x212cbf[_0xcb7a('0x3c')][_0xcb7a('0x21')]);_0x2132e4[_0xcb7a('0x20')]=qs[_0xcb7a('0x20')](_0x212cbf['query']['offset']);}_0x2132e4['order']=qs[_0xcb7a('0x43')](_0x212cbf['query'][_0xcb7a('0x43')]);_0x2132e4[_0xcb7a('0x44')]=qs[_0xcb7a('0x45')](_['pick'](_0x212cbf[_0xcb7a('0x3c')],_0x5de97f[_0xcb7a('0x45')]),_0x3c333f);if(_0x212cbf[_0xcb7a('0x3c')][_0xcb7a('0x2f')]){_0x2132e4['where']=_[_0xcb7a('0x46')](_0x2132e4[_0xcb7a('0x44')],{'$or':_[_0xcb7a('0x30')](_0x3c333f,function(_0x2fcbd5){if(_0x2fcbd5['type']!==_0xcb7a('0x47')){var _0x217a85={};_0x217a85[_0x2fcbd5['name']]={'$like':'%'+_0x212cbf[_0xcb7a('0x3c')]['filter']+'%'};return _0x217a85;}})});}_0x2132e4=_[_0xcb7a('0x46')]({},_0x2132e4,_0x212cbf['options']);var _0x3559c5={'where':_0x2132e4['where']};return db['VoiceQueue'][_0xcb7a('0x23')](_0x3559c5)[_0xcb7a('0x29')](function(_0x26df99){_0xa2a3d5['count']=_0x26df99;if(_0x212cbf[_0xcb7a('0x3c')][_0xcb7a('0x48')]){_0x2132e4[_0xcb7a('0x49')]=[{'all':!![]}];}return db[_0xcb7a('0x4a')][_0xcb7a('0x4b')](_0x2132e4);})['then'](function(_0x14af47){_0xa2a3d5['rows']=_0x14af47;return _0xa2a3d5;})[_0xcb7a('0x29')](respondWithFilteredResult(_0x52557e,_0x2132e4))[_0xcb7a('0x4c')](handleError(_0x52557e,null));};exports[_0xcb7a('0x4d')]=function(_0x2559fa,_0xb710f3){var _0x446cd2={'raw':![],'where':{'id':_0x2559fa[_0xcb7a('0x4e')]['id']}},_0x3bbb96={};_0x3bbb96[_0xcb7a('0x3b')]=_[_0xcb7a('0x3d')](db[_0xcb7a('0x4a')][_0xcb7a('0x39')]);_0x3bbb96[_0xcb7a('0x3c')]=_[_0xcb7a('0x3d')](_0x2559fa[_0xcb7a('0x3c')]);_0x3bbb96[_0xcb7a('0x45')]=_['intersection'](_0x3bbb96[_0xcb7a('0x3b')],_0x3bbb96[_0xcb7a('0x3c')]);_0x446cd2[_0xcb7a('0x3f')]=_[_0xcb7a('0x3e')](_0x3bbb96[_0xcb7a('0x3b')],qs[_0xcb7a('0x40')](_0x2559fa[_0xcb7a('0x3c')]['fields']));_0x446cd2[_0xcb7a('0x3f')]=_0x446cd2[_0xcb7a('0x3f')][_0xcb7a('0x4f')]?_0x446cd2[_0xcb7a('0x3f')]:_0x3bbb96[_0xcb7a('0x3b')];if(_0x2559fa[_0xcb7a('0x3c')][_0xcb7a('0x48')]){_0x446cd2[_0xcb7a('0x49')]=[{'all':!![]}];}_0x446cd2=_[_0xcb7a('0x46')]({},_0x446cd2,_0x2559fa[_0xcb7a('0x50')]);return db[_0xcb7a('0x4a')][_0xcb7a('0x32')](_0x446cd2)[_0xcb7a('0x29')](handleEntityNotFound(_0xb710f3,null))[_0xcb7a('0x29')](respondWithResult(_0xb710f3,null))['catch'](handleError(_0xb710f3,null));};exports[_0xcb7a('0x51')]=function(_0x31d4e3,_0x5cd951){return db[_0xcb7a('0x4a')]['create'](_0x31d4e3[_0xcb7a('0x52')],{})[_0xcb7a('0x29')](function(_0x583ccf){var _0x566024=_0x31d4e3['user'][_0xcb7a('0x2b')]({'plain':!![]});if(!_0x566024)throw new Error(_0xcb7a('0x53'));if(_0x566024[_0xcb7a('0x54')]===_0xcb7a('0x55')){var _0x593e64=_0x583ccf[_0xcb7a('0x2b')]({'plain':!![]});var _0x122d9b=[{'name':_0xcb7a('0x56'),'value':_0xcb7a('0x2c')},{'name':_0xcb7a('0x2d'),'value':_0xcb7a('0x2e')}];var _0x2ae80c=_['find'](_0x122d9b,[_0xcb7a('0x31'),_0x593e64['type']])[_0xcb7a('0x34')];return db[_0xcb7a('0x57')]['find']({'where':{'name':_0x2ae80c,'userProfileId':_0x566024[_0xcb7a('0x58')]},'raw':!![]})[_0xcb7a('0x29')](function(_0x329787){if(_0x329787&&_0x329787[_0xcb7a('0x59')]===0x0){return db[_0xcb7a('0x5a')][_0xcb7a('0x51')]({'name':_0x593e64['name'],'resourceId':_0x593e64['id'],'type':_0x329787['name'],'sectionId':_0x329787['id']},{})[_0xcb7a('0x29')](function(){return _0x583ccf;});}else{return _0x583ccf;}})['catch'](function(_0x4fb2ea){logger[_0xcb7a('0x36')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fb2ea);throw _0x4fb2ea;});}return _0x583ccf;})[_0xcb7a('0x29')](respondWithResult(_0x5cd951,0xc9))['catch'](handleError(_0x5cd951,null));};exports[_0xcb7a('0x5b')]=function(_0x25f14e,_0x19b885){var _0x45ef43={'where':{'id':_0x25f14e[_0xcb7a('0x4e')]['id']}},_0x47543e={};_0x47543e[_0xcb7a('0x3b')]=_[_0xcb7a('0x3d')](db[_0xcb7a('0x4a')][_0xcb7a('0x39')]);_0x45ef43['attributes']=_['intersection'](_0x47543e[_0xcb7a('0x3b')],qs['fields'](_0x25f14e[_0xcb7a('0x3c')]['fields']));_0x45ef43[_0xcb7a('0x3f')]=_0x45ef43[_0xcb7a('0x3f')][_0xcb7a('0x4f')]?_0x45ef43[_0xcb7a('0x3f')]:_0x47543e[_0xcb7a('0x3b')];if(_0x25f14e['query'][_0xcb7a('0x48')]){_0x45ef43['include']=[{'all':!![]}];}_0x45ef43=_[_0xcb7a('0x46')]({},_0x45ef43,_0x25f14e[_0xcb7a('0x50')]);return db[_0xcb7a('0x4a')][_0xcb7a('0x32')](_0x45ef43)['then'](handleEntityNotFound(_0x19b885,null))[_0xcb7a('0x29')](function(_0x57633a){if(_0x57633a){var _0x1379c7=_0x57633a['get']({'plain':!![]});_0x1379c7=qs[_0xcb7a('0x5c')](_0x1379c7,['id',_0xcb7a('0x5d'),'updatedAt']);_0x25f14e[_0xcb7a('0x52')]=_[_0xcb7a('0x5c')](_0x25f14e[_0xcb7a('0x52')],['id',_0xcb7a('0x5d'),_0xcb7a('0x5e')]);return db['VoiceQueue'][_0xcb7a('0x51')](_[_0xcb7a('0x46')](_0x1379c7,_0x25f14e[_0xcb7a('0x52')]),{'include':_0x25f14e[_0xcb7a('0x3c')][_0xcb7a('0x48')]?[{'all':!![]}]:undefined})[_0xcb7a('0x29')](function(_0x5a0a3d){var _0x5534c1=_0x25f14e['user']['get']({'plain':!![]});if(!_0x5534c1)throw new Error(_0xcb7a('0x53'));if(_0x5534c1['role']==='user'){var _0x250515=_0x5a0a3d[_0xcb7a('0x2b')]({'plain':!![]});var _0x414ff1=[{'name':'VoiceQueues','value':_0xcb7a('0x2c')},{'name':'QueueCampaigns','value':_0xcb7a('0x2e')}];var _0x4bfa87=_['find'](_0x414ff1,[_0xcb7a('0x31'),_0x250515['type']])['name'];return db['UserProfileSection'][_0xcb7a('0x32')]({'where':{'name':_0x4bfa87,'userProfileId':_0x5534c1['userProfileId']},'raw':!![]})[_0xcb7a('0x29')](function(_0x54b8d4){if(_0x54b8d4&&_0x54b8d4[_0xcb7a('0x59')]===0x0){return db['UserProfileResource'][_0xcb7a('0x51')]({'name':_0x250515[_0xcb7a('0x34')],'resourceId':_0x250515['id'],'type':_0x54b8d4[_0xcb7a('0x34')],'sectionId':_0x54b8d4['id']},{})[_0xcb7a('0x29')](function(){return _0x5a0a3d;});}else{return _0x5a0a3d;}})[_0xcb7a('0x4c')](function(_0x16c6e5){logger[_0xcb7a('0x36')](_0xcb7a('0x5f'),_0x16c6e5);throw _0x16c6e5;});}return _0x5a0a3d;});}})[_0xcb7a('0x29')](respondWithResult(_0x19b885,0xc9))[_0xcb7a('0x4c')](handleError(_0x19b885,null));};exports[_0xcb7a('0x28')]=function(_0x22dcf5,_0x4f5c05){if(_0x22dcf5[_0xcb7a('0x52')]['id']){delete _0x22dcf5['body']['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x22dcf5[_0xcb7a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f5c05,null))[_0xcb7a('0x29')](saveUpdates(_0x22dcf5[_0xcb7a('0x52')],null))['then'](respondWithResult(_0x4f5c05,null))[_0xcb7a('0x4c')](handleError(_0x4f5c05,null));};exports[_0xcb7a('0x2a')]=function(_0xc71289,_0x4241fc){return db[_0xcb7a('0x4a')]['find']({'where':{'id':_0xc71289[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x4241fc,null))[_0xcb7a('0x29')](removeEntity(_0x4241fc,null))[_0xcb7a('0x4c')](handleError(_0x4241fc,null));};exports[_0xcb7a('0x60')]=function(_0x2a318f,_0x236fc0,_0x4f1cdf){var _0x3c2dee={'raw':![],'where':{}};var _0x3968c9={};var _0x910a81={'count':0x0,'rows':[]};return db[_0xcb7a('0x4a')][_0xcb7a('0x61')]({'where':{'id':_0x2a318f['params']['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x236fc0,null))[_0xcb7a('0x29')](function(_0x5e1a71){if(_0x5e1a71){_0x3968c9[_0xcb7a('0x3b')]=_[_0xcb7a('0x3d')](db[_0xcb7a('0x62')][_0xcb7a('0x39')]);_0x3968c9[_0xcb7a('0x3c')]=_[_0xcb7a('0x3d')](_0x2a318f[_0xcb7a('0x3c')]);_0x3968c9['filters']=_['intersection'](_0x3968c9[_0xcb7a('0x3b')],_0x3968c9[_0xcb7a('0x3c')]);_0x3c2dee[_0xcb7a('0x3f')]=_['intersection'](_0x3968c9[_0xcb7a('0x3b')],qs[_0xcb7a('0x40')](_0x2a318f[_0xcb7a('0x3c')][_0xcb7a('0x40')]));_0x3c2dee[_0xcb7a('0x3f')]=_0x3c2dee['attributes'][_0xcb7a('0x4f')]?_0x3c2dee['attributes']:_0x3968c9[_0xcb7a('0x3b')];if(!_0x2a318f[_0xcb7a('0x3c')]['hasOwnProperty'](_0xcb7a('0x42'))){_0x3c2dee['limit']=qs['limit'](_0x2a318f['query'][_0xcb7a('0x21')]);_0x3c2dee[_0xcb7a('0x20')]=qs[_0xcb7a('0x20')](_0x2a318f[_0xcb7a('0x3c')][_0xcb7a('0x20')]);}_0x3c2dee[_0xcb7a('0x63')]=qs[_0xcb7a('0x43')](_0x2a318f[_0xcb7a('0x3c')][_0xcb7a('0x43')]);_0x3c2dee[_0xcb7a('0x44')]=qs['filters'](_['pick'](_0x2a318f[_0xcb7a('0x3c')],_0x3968c9[_0xcb7a('0x45')]));_0x3c2dee[_0xcb7a('0x44')][_0xcb7a('0x64')]=_0x5e1a71['id'];if(_0x2a318f[_0xcb7a('0x3c')][_0xcb7a('0x2f')]){_0x3c2dee[_0xcb7a('0x44')]=_[_0xcb7a('0x46')](_0x3c2dee[_0xcb7a('0x44')],{'$or':_['map'](_0x3c2dee[_0xcb7a('0x3f')],function(_0xd97cda){var _0x475b2e={};_0x475b2e[_0xd97cda]={'$like':'%'+_0x2a318f[_0xcb7a('0x3c')]['filter']+'%'};return _0x475b2e;})});}_0x3c2dee=_[_0xcb7a('0x46')]({},_0x3c2dee,_0x2a318f[_0xcb7a('0x50')]);return db[_0xcb7a('0x62')][_0xcb7a('0x23')]({'where':_0x3c2dee[_0xcb7a('0x44')]})[_0xcb7a('0x29')](function(_0x51aadd){_0x910a81['count']=_0x51aadd;if(_0x2a318f[_0xcb7a('0x3c')][_0xcb7a('0x48')]){_0x3c2dee['include']=[{'all':!![]}];}return db[_0xcb7a('0x62')]['findAll'](_0x3c2dee);})[_0xcb7a('0x29')](function(_0x243e30){_0x910a81['rows']=_0x243e30;return _0x910a81;});}})[_0xcb7a('0x29')](respondWithFilteredResult(_0x236fc0,_0x3c2dee))[_0xcb7a('0x4c')](handleError(_0x236fc0,null));};exports['getHopperHistories']=function(_0x2788e2,_0x371ae8,_0x5479df){var _0x169c1d={'raw':!![],'where':{}};var _0x186eff={};var _0x5a21ca={'count':0x0,'rows':[]};return db[_0xcb7a('0x4a')][_0xcb7a('0x61')]({'where':{'id':_0x2788e2[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x371ae8,null))[_0xcb7a('0x29')](function(_0xae0209){if(_0xae0209){_0x186eff[_0xcb7a('0x3b')]=_[_0xcb7a('0x3d')](db[_0xcb7a('0x65')][_0xcb7a('0x39')]);_0x186eff['query']=_[_0xcb7a('0x3d')](_0x2788e2[_0xcb7a('0x3c')]);_0x186eff['filters']=_[_0xcb7a('0x3e')](_0x186eff['model'],_0x186eff[_0xcb7a('0x3c')]);_0x169c1d['attributes']=_[_0xcb7a('0x3e')](_0x186eff[_0xcb7a('0x3b')],qs[_0xcb7a('0x40')](_0x2788e2[_0xcb7a('0x3c')][_0xcb7a('0x40')]));_0x169c1d[_0xcb7a('0x3f')]=_0x169c1d[_0xcb7a('0x3f')][_0xcb7a('0x4f')]?_0x169c1d[_0xcb7a('0x3f')]:_0x186eff[_0xcb7a('0x3b')];if(!_0x2788e2['query'][_0xcb7a('0x41')](_0xcb7a('0x42'))){_0x169c1d[_0xcb7a('0x21')]=qs[_0xcb7a('0x21')](_0x2788e2[_0xcb7a('0x3c')][_0xcb7a('0x21')]);_0x169c1d[_0xcb7a('0x20')]=qs[_0xcb7a('0x20')](_0x2788e2[_0xcb7a('0x3c')][_0xcb7a('0x20')]);}_0x169c1d['order']=qs['sort'](_0x2788e2[_0xcb7a('0x3c')]['sort']);_0x169c1d['where']=qs[_0xcb7a('0x45')](_[_0xcb7a('0x66')](_0x2788e2[_0xcb7a('0x3c')],_0x186eff['filters']));_0x169c1d[_0xcb7a('0x44')][_0xcb7a('0x64')]=_0xae0209['id'];if(_0x2788e2[_0xcb7a('0x3c')][_0xcb7a('0x2f')]){_0x169c1d[_0xcb7a('0x44')]=_['merge'](_0x169c1d[_0xcb7a('0x44')],{'$or':_[_0xcb7a('0x30')](_0x169c1d[_0xcb7a('0x3f')],function(_0x5bd9df){var _0x257c0d={};_0x257c0d[_0x5bd9df]={'$like':'%'+_0x2788e2['query']['filter']+'%'};return _0x257c0d;})});}_0x169c1d=_[_0xcb7a('0x46')]({},_0x169c1d,_0x2788e2[_0xcb7a('0x50')]);return db[_0xcb7a('0x65')][_0xcb7a('0x23')]({'where':_0x169c1d['where']})['then'](function(_0x432283){_0x5a21ca[_0xcb7a('0x23')]=_0x432283;if(_0x2788e2[_0xcb7a('0x3c')][_0xcb7a('0x48')]){_0x169c1d['include']=[{'all':!![]}];}return db[_0xcb7a('0x65')][_0xcb7a('0x4b')](_0x169c1d);})[_0xcb7a('0x29')](function(_0x1d2208){_0x5a21ca[_0xcb7a('0x67')]=_0x1d2208;return _0x5a21ca;});}})[_0xcb7a('0x29')](respondWithFilteredResult(_0x371ae8,_0x169c1d))[_0xcb7a('0x4c')](handleError(_0x371ae8,null));};exports[_0xcb7a('0x68')]=function(_0x1288a8,_0x13ed50,_0xa5ad9e){var _0x2644f2={'raw':!![],'where':{}};var _0x1351ab={};var _0x50578d={'count':0x0,'rows':[]};return db[_0xcb7a('0x4a')][_0xcb7a('0x61')]({'where':{'id':_0x1288a8[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x13ed50,null))[_0xcb7a('0x29')](function(_0x3cd049){if(_0x3cd049){_0x1351ab[_0xcb7a('0x3b')]=_[_0xcb7a('0x3d')](db['CmHopperFinal'][_0xcb7a('0x39')]);_0x1351ab[_0xcb7a('0x3c')]=_[_0xcb7a('0x3d')](_0x1288a8['query']);_0x1351ab[_0xcb7a('0x45')]=_[_0xcb7a('0x3e')](_0x1351ab[_0xcb7a('0x3b')],_0x1351ab[_0xcb7a('0x3c')]);_0x2644f2[_0xcb7a('0x3f')]=_['intersection'](_0x1351ab[_0xcb7a('0x3b')],qs[_0xcb7a('0x40')](_0x1288a8[_0xcb7a('0x3c')][_0xcb7a('0x40')]));_0x2644f2[_0xcb7a('0x3f')]=_0x2644f2[_0xcb7a('0x3f')][_0xcb7a('0x4f')]?_0x2644f2[_0xcb7a('0x3f')]:_0x1351ab[_0xcb7a('0x3b')];if(!_0x1288a8[_0xcb7a('0x3c')]['hasOwnProperty'](_0xcb7a('0x42'))){_0x2644f2[_0xcb7a('0x21')]=qs['limit'](_0x1288a8['query'][_0xcb7a('0x21')]);_0x2644f2[_0xcb7a('0x20')]=qs[_0xcb7a('0x20')](_0x1288a8[_0xcb7a('0x3c')][_0xcb7a('0x20')]);}_0x2644f2[_0xcb7a('0x63')]=qs[_0xcb7a('0x43')](_0x1288a8[_0xcb7a('0x3c')]['sort']);_0x2644f2[_0xcb7a('0x44')]=qs['filters'](_[_0xcb7a('0x66')](_0x1288a8['query'],_0x1351ab[_0xcb7a('0x45')]));_0x2644f2[_0xcb7a('0x44')][_0xcb7a('0x64')]=_0x3cd049['id'];if(_0x1288a8[_0xcb7a('0x3c')][_0xcb7a('0x2f')]){_0x2644f2[_0xcb7a('0x44')]=_[_0xcb7a('0x46')](_0x2644f2['where'],{'$or':_[_0xcb7a('0x30')](_0x2644f2[_0xcb7a('0x3f')],function(_0x185525){var _0x256258={};_0x256258[_0x185525]={'$like':'%'+_0x1288a8['query'][_0xcb7a('0x2f')]+'%'};return _0x256258;})});}_0x2644f2=_[_0xcb7a('0x46')]({},_0x2644f2,_0x1288a8['options']);return db[_0xcb7a('0x69')][_0xcb7a('0x23')]({'where':_0x2644f2[_0xcb7a('0x44')]})[_0xcb7a('0x29')](function(_0x1727c1){_0x50578d[_0xcb7a('0x23')]=_0x1727c1;if(_0x1288a8[_0xcb7a('0x3c')][_0xcb7a('0x48')]){_0x2644f2[_0xcb7a('0x49')]=[{'all':!![]}];}return db[_0xcb7a('0x69')]['findAll'](_0x2644f2);})[_0xcb7a('0x29')](function(_0x45c360){_0x50578d['rows']=_0x45c360;return _0x50578d;});}})[_0xcb7a('0x29')](respondWithFilteredResult(_0x13ed50,_0x2644f2))[_0xcb7a('0x4c')](handleError(_0x13ed50,null));};exports[_0xcb7a('0x6a')]=function(_0x18b35d,_0x4ca432,_0x4cbf40){var _0x480e2e={'raw':!![],'where':{}};var _0x30cc08={};var _0x387a24={'count':0x0,'rows':[]};return db[_0xcb7a('0x4a')][_0xcb7a('0x61')]({'where':{'id':_0x18b35d[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x4ca432,null))[_0xcb7a('0x29')](function(_0x2aab34){if(_0x2aab34){_0x30cc08['model']=_[_0xcb7a('0x3d')](db['CmHopperBlack']['rawAttributes']);_0x30cc08[_0xcb7a('0x3c')]=_[_0xcb7a('0x3d')](_0x18b35d[_0xcb7a('0x3c')]);_0x30cc08[_0xcb7a('0x45')]=_[_0xcb7a('0x3e')](_0x30cc08[_0xcb7a('0x3b')],_0x30cc08[_0xcb7a('0x3c')]);_0x480e2e[_0xcb7a('0x3f')]=_[_0xcb7a('0x3e')](_0x30cc08[_0xcb7a('0x3b')],qs[_0xcb7a('0x40')](_0x18b35d['query'][_0xcb7a('0x40')]));_0x480e2e[_0xcb7a('0x3f')]=_0x480e2e[_0xcb7a('0x3f')][_0xcb7a('0x4f')]?_0x480e2e[_0xcb7a('0x3f')]:_0x30cc08[_0xcb7a('0x3b')];if(!_0x18b35d[_0xcb7a('0x3c')][_0xcb7a('0x41')]('nolimit')){_0x480e2e['limit']=qs[_0xcb7a('0x21')](_0x18b35d[_0xcb7a('0x3c')][_0xcb7a('0x21')]);_0x480e2e[_0xcb7a('0x20')]=qs['offset'](_0x18b35d[_0xcb7a('0x3c')][_0xcb7a('0x20')]);}_0x480e2e['order']=qs[_0xcb7a('0x43')](_0x18b35d[_0xcb7a('0x3c')][_0xcb7a('0x43')]);_0x480e2e['where']=qs[_0xcb7a('0x45')](_[_0xcb7a('0x66')](_0x18b35d[_0xcb7a('0x3c')],_0x30cc08['filters']));_0x480e2e[_0xcb7a('0x44')]['VoiceQueueId']=_0x2aab34['id'];if(_0x18b35d['query'][_0xcb7a('0x2f')]){_0x480e2e[_0xcb7a('0x44')]=_['merge'](_0x480e2e[_0xcb7a('0x44')],{'$or':_[_0xcb7a('0x30')](_0x480e2e[_0xcb7a('0x3f')],function(_0x1c647d){var _0x403f38={};_0x403f38[_0x1c647d]={'$like':'%'+_0x18b35d[_0xcb7a('0x3c')][_0xcb7a('0x2f')]+'%'};return _0x403f38;})});}_0x480e2e=_[_0xcb7a('0x46')]({},_0x480e2e,_0x18b35d[_0xcb7a('0x50')]);return db[_0xcb7a('0x6b')][_0xcb7a('0x23')]({'where':_0x480e2e['where']})['then'](function(_0x2c4175){_0x387a24[_0xcb7a('0x23')]=_0x2c4175;if(_0x18b35d[_0xcb7a('0x3c')][_0xcb7a('0x48')]){_0x480e2e[_0xcb7a('0x49')]=[{'all':!![]}];}return db[_0xcb7a('0x6b')]['findAll'](_0x480e2e);})[_0xcb7a('0x29')](function(_0x517b7a){_0x387a24[_0xcb7a('0x67')]=_0x517b7a;return _0x387a24;});}})[_0xcb7a('0x29')](respondWithFilteredResult(_0x4ca432,_0x480e2e))['catch'](handleError(_0x4ca432,null));};exports[_0xcb7a('0x6c')]=function(_0xd100a5,_0x294cdd,_0x202606){var _0x287bfa={};var _0x37b83f={};var _0x5c383b;var _0x478aa3;return db['VoiceQueue'][_0xcb7a('0x61')]({'where':{'id':_0xd100a5[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x294cdd,null))[_0xcb7a('0x29')](function(_0x1ea9d6){if(_0x1ea9d6){_0x5c383b=_0x1ea9d6;_0x37b83f[_0xcb7a('0x3b')]=_[_0xcb7a('0x3d')](db['Team']['rawAttributes']);_0x37b83f['query']=_[_0xcb7a('0x3d')](_0xd100a5[_0xcb7a('0x3c')]);_0x37b83f['filters']=_[_0xcb7a('0x3e')](_0x37b83f[_0xcb7a('0x3b')],_0x37b83f['query']);_0x287bfa['attributes']=_['intersection'](_0x37b83f[_0xcb7a('0x3b')],qs['fields'](_0xd100a5[_0xcb7a('0x3c')][_0xcb7a('0x40')]));_0x287bfa['attributes']=_0x287bfa['attributes'][_0xcb7a('0x4f')]?_0x287bfa[_0xcb7a('0x3f')]:_0x37b83f['model'];_0x287bfa['order']=qs['sort'](_0xd100a5[_0xcb7a('0x3c')][_0xcb7a('0x43')]);_0x287bfa[_0xcb7a('0x44')]=qs['filters'](_['pick'](_0xd100a5[_0xcb7a('0x3c')],_0x37b83f[_0xcb7a('0x45')]));if(_0xd100a5[_0xcb7a('0x3c')][_0xcb7a('0x2f')]){_0x287bfa[_0xcb7a('0x44')]=_[_0xcb7a('0x46')](_0x287bfa[_0xcb7a('0x44')],{'$or':_[_0xcb7a('0x30')](_0x287bfa['attributes'],function(_0x1f2367){var _0x1207ef={};_0x1207ef[_0x1f2367]={'$like':'%'+_0xd100a5[_0xcb7a('0x3c')][_0xcb7a('0x2f')]+'%'};return _0x1207ef;})});}_0x287bfa=_[_0xcb7a('0x46')]({},_0x287bfa,_0xd100a5['options']);return _0x5c383b[_0xcb7a('0x6c')](_0x287bfa);}})[_0xcb7a('0x29')](function(_0x2ff049){if(_0x2ff049){_0x478aa3=_0x2ff049[_0xcb7a('0x4f')];if(!_0xd100a5[_0xcb7a('0x3c')]['hasOwnProperty']('nolimit')){_0x287bfa[_0xcb7a('0x21')]=qs[_0xcb7a('0x21')](_0xd100a5[_0xcb7a('0x3c')]['limit']);_0x287bfa['offset']=qs[_0xcb7a('0x20')](_0xd100a5['query']['offset']);}return _0x5c383b[_0xcb7a('0x6c')](_0x287bfa);}})['then'](function(_0x88b8f6){if(_0x88b8f6){return _0x88b8f6?{'count':_0x478aa3,'rows':_0x88b8f6}:null;}})[_0xcb7a('0x29')](respondWithResult(_0x294cdd,null))['catch'](handleError(_0x294cdd,null));};exports[_0xcb7a('0x6d')]=function(_0x3da851,_0x126f0b,_0x1e980c){var _0x39505a=_0x3da851[_0xcb7a('0x52')]['teams'];var _0x1ffaa3=_[_0xcb7a('0x30')](_0x39505a,'id');return db[_0xcb7a('0x6e')][_0xcb7a('0x4b')]({'where':{'id':_0x1ffaa3},'attributes':['id'],'include':[{'model':db[_0xcb7a('0x6f')],'as':'Agents','attributes':['id',_0xcb7a('0x34'),_0xcb7a('0x70'),'voicePause','interface'],'raw':!![]}]})[_0xcb7a('0x29')](function(_0x53daff){if(_0x53daff){var _0x111413=_[_0xcb7a('0x71')](_0x53daff,function(_0x33d551){var _0x113efb=_0x33d551[_0xcb7a('0x2b')]({'plain':!![]});_0x113efb[_0xcb7a('0x72')][_0xcb7a('0x73')](function(_0x551972){_0x551972[_0xcb7a('0x74')]=_[_0xcb7a('0x32')](_0x39505a,{'id':_0x113efb['id']})[_0xcb7a('0x74')];});return _0x113efb[_0xcb7a('0x72')];});return db[_0xcb7a('0x4a')]['find']({'where':{'id':_0x3da851[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](function(_0xcc01c6){return db[_0xcb7a('0x75')][_0xcb7a('0x76')](function(_0x2fc6cd){return _0xcc01c6[_0xcb7a('0x6d')](_0x1ffaa3,{'transaction':_0x2fc6cd})['then'](function(){return BPromise[_0xcb7a('0x77')](_0x39505a,function(_0x8445c1){return db[_0xcb7a('0x78')]['upsert']({'TeamId':_0x8445c1['id'],'VoiceQueueId':_0x3da851[_0xcb7a('0x4e')]['id'],'penalty':_0x8445c1[_0xcb7a('0x74')]},{'transaction':_0x2fc6cd});});})[_0xcb7a('0x29')](function(){return BPromise['each'](_0x111413,function(_0x2eaf42){return db[_0xcb7a('0x79')][_0xcb7a('0x7a')]({'where':{'UserId':_0x2eaf42['id'],'VoiceQueueId':_0x3da851[_0xcb7a('0x4e')]['id']},'defaults':{'penalty':_0x2eaf42['penalty']},'transaction':_0x2fc6cd});});})[_0xcb7a('0x29')](function(){return BPromise[_0xcb7a('0x77')](_[_0xcb7a('0x2f')](_0x111413,{'online':!![]}),function(_0x5ccbd8){return db['UserVoiceQueueRt']['upsert']({'membername':_0x5ccbd8[_0xcb7a('0x34')],'UserId':_0x5ccbd8['id'],'queue_name':_0xcc01c6[_0xcb7a('0x34')],'VoiceQueueId':_0xcc01c6['id'],'interface':_[_0xcb7a('0x7b')](_0x5ccbd8[_0xcb7a('0x7c')])?util['format'](_0xcb7a('0x7d'),_0x5ccbd8[_0xcb7a('0x34')]):_0x5ccbd8[_0xcb7a('0x7c')],'paused':_0x5ccbd8['voicePause']||![],'penalty':_0x5ccbd8[_0xcb7a('0x74')]},{'transaction':_0x2fc6cd});});})[_0xcb7a('0x29')](function(){_0x111413['forEach'](function(_0x385f53){socket[_0xcb7a('0x7e')](_0xcb7a('0x7f'),{'UserId':_0x385f53['id'],'VoiceQueueId':_0xcc01c6['id']});});});});});}})[_0xcb7a('0x29')](respondWithStatusCode(_0x126f0b,null))['catch'](handleError(_0x126f0b,null));};exports['removeTeams']=function(_0x172959,_0x2ab8fc,_0x4e24b1){return db[_0xcb7a('0x6e')][_0xcb7a('0x4b')]({'where':{'id':_0x172959[_0xcb7a('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0xcb7a('0x6f')],'as':_0xcb7a('0x72'),'attributes':['id'],'raw':!![]}]})[_0xcb7a('0x29')](handleEntityNotFound(_0x2ab8fc,null))[_0xcb7a('0x29')](function(_0x5b149e){var _0x3cd153=_[_0xcb7a('0x30')](_0x5b149e,'id');var _0xa2c3f3=[];var _0x47b44a=[];var _0x347773=squel[_0xcb7a('0x80')]();_0x347773[_0xcb7a('0x81')](_0xcb7a('0x82'))[_0xcb7a('0x83')]('team_has_voice_queues','tq')[_0xcb7a('0x84')](_0xcb7a('0x85'),'ut',_0xcb7a('0x86'))[_0xcb7a('0x44')](_0xcb7a('0x87'),_0x172959['params']['id']);for(var _0x4c1f82=0x0;_0x4c1f82<_0x5b149e[_0xcb7a('0x4f')];_0x4c1f82+=0x1){let _0x2eeded=_0x5b149e[_0x4c1f82];for(var _0x227fa2=0x0;_0x227fa2<_0x2eeded['Agents'][_0xcb7a('0x4f')];_0x227fa2+=0x1){let _0x237aed=_0x2eeded[_0xcb7a('0x72')][_0x227fa2];var _0x4c8024=_0x347773[_0xcb7a('0x5b')]();_0x4c8024[_0xcb7a('0x44')](_0xcb7a('0x88'),_0x237aed['id']);_0x47b44a[_0xcb7a('0x89')](db[_0xcb7a('0x75')][_0xcb7a('0x3c')](_0x4c8024[_0xcb7a('0x8a')](),{'type':db['sequelize'][_0xcb7a('0x8b')][_0xcb7a('0x8c')]})[_0xcb7a('0x29')](function(_0x42ef2c){if(_0x42ef2c[_0xcb7a('0x4f')]===0x1){return _0x237aed['id'];}else{var _0x2f981f=_['every'](_[_0xcb7a('0x30')](_0x42ef2c,_0xcb7a('0x8d')),function(_0x120c21){return _['includes'](_0x3cd153,_0x120c21);});if(_0x2f981f){return _0x237aed['id'];}}}));}}return BPromise[_0xcb7a('0x8e')](_0x47b44a)[_0xcb7a('0x29')](function(_0x392082){_0xa2c3f3=_(_0xa2c3f3)[_0xcb7a('0x8f')](_0x392082)['compact']()[_0xcb7a('0x31')]();return db[_0xcb7a('0x4a')][_0xcb7a('0x32')]({'where':{'id':_0x172959['params']['id']}})[_0xcb7a('0x29')](function(_0x495e66){return db[_0xcb7a('0x75')]['transaction'](function(_0x45b686){return _0x495e66[_0xcb7a('0x90')](_0x172959[_0xcb7a('0x3c')][_0xcb7a('0x91')],{'transaction':_0x45b686})[_0xcb7a('0x29')](function(){if(!_[_0xcb7a('0x92')](_0xa2c3f3)){return _0x495e66[_0xcb7a('0x93')](_0xa2c3f3,{'transaction':_0x45b686})['then'](function(){return db[_0xcb7a('0x94')][_0xcb7a('0x2a')]({'where':{'VoiceQueueId':_0x172959['params']['id'],'UserId':_0xa2c3f3},'transaction':_0x45b686});});}})['then'](function(){_0xa2c3f3[_0xcb7a('0x73')](function(_0xd2ac7){socket[_0xcb7a('0x7e')](_0xcb7a('0x95'),{'UserId':_0xd2ac7,'VoiceQueueId':_0x495e66['id']});});});});});});})[_0xcb7a('0x29')](respondWithStatusCode(_0x2ab8fc,null))[_0xcb7a('0x4c')](handleError(_0x2ab8fc,null));};exports['addAgents']=function(_0x109c00,_0x419711,_0x4a0f47){var _0x286b6e,_0x565642;return db['VoiceQueue']['find']({'where':{'id':_0x109c00[_0xcb7a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x419711,null))['then'](function(_0x3c7e08){if(_0x3c7e08){_0x565642=_0x3c7e08;return _0x3c7e08[_0xcb7a('0x96')](_0x109c00['body'][_0xcb7a('0x91')],_['omit'](_0x109c00['body'],['ids','id'])||{})[_0xcb7a('0x97')](function(_0x3c9b95){for(var _0x2dfc77=0x0;_0x2dfc77<_0x109c00[_0xcb7a('0x52')]['ids'][_0xcb7a('0x4f')];_0x2dfc77+=0x1){socket[_0xcb7a('0x7e')](_0xcb7a('0x7f'),{'UserId':Number(_0x109c00[_0xcb7a('0x52')][_0xcb7a('0x91')][_0x2dfc77]),'VoiceQueueId':Number(_0x109c00[_0xcb7a('0x4e')]['id'])});}return _0x3c9b95;});}})[_0xcb7a('0x29')](function(_0x23d652){_0x286b6e=_0x23d652||[];if(_0x565642){return db[_0xcb7a('0x6f')][_0xcb7a('0x4b')]({'where':{'id':_0x109c00['body'][_0xcb7a('0x91')]},'attributes':['id',_0xcb7a('0x34'),'online',_0xcb7a('0x98'),_0xcb7a('0x7c')],'raw':!![]});}})[_0xcb7a('0x29')](function(_0x291e8c){if(!_[_0xcb7a('0x92')](_0x291e8c)){var _0x535e0a=[];for(var _0x23e2de=0x0;_0x23e2de<_0x291e8c[_0xcb7a('0x4f')];_0x23e2de++){if(_0x291e8c[_0x23e2de][_0xcb7a('0x70')]){_0x535e0a[_0xcb7a('0x89')](db[_0xcb7a('0x94')][_0xcb7a('0x99')]({'membername':_0x291e8c[_0x23e2de][_0xcb7a('0x34')],'UserId':_0x291e8c[_0x23e2de]['id'],'queue_name':_0x565642[_0xcb7a('0x34')],'VoiceQueueId':_0x565642['id'],'interface':_['isNil'](_0x291e8c[_0x23e2de][_0xcb7a('0x7c')])?util['format'](_0xcb7a('0x7d'),_0x291e8c[_0x23e2de][_0xcb7a('0x34')]):_0x291e8c[_0x23e2de][_0xcb7a('0x7c')],'paused':_0x291e8c[_0x23e2de]['voicePause']||![],'penalty':_0x109c00[_0xcb7a('0x52')][_0xcb7a('0x74')]||0x0}));}}return BPromise[_0xcb7a('0x8e')](_0x535e0a);}})[_0xcb7a('0x29')](function(){return _0x286b6e;})[_0xcb7a('0x29')](respondWithResult(_0x419711,null))[_0xcb7a('0x4c')](handleError(_0x419711,null));};exports[_0xcb7a('0x93')]=function(_0x54b4c5,_0x37b2a1,_0x510841){return db['VoiceQueue']['find']({'where':{'id':_0x54b4c5[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x37b2a1,null))[_0xcb7a('0x29')](function(_0xde3fca){if(_0xde3fca){return _0xde3fca[_0xcb7a('0x93')](_0x54b4c5[_0xcb7a('0x3c')][_0xcb7a('0x91')])['then'](function(){if(_[_0xcb7a('0x9a')](_0x54b4c5[_0xcb7a('0x3c')][_0xcb7a('0x91')])){for(var _0x1e50d4=0x0;_0x1e50d4<_0x54b4c5[_0xcb7a('0x3c')][_0xcb7a('0x91')][_0xcb7a('0x4f')];_0x1e50d4+=0x1){socket[_0xcb7a('0x7e')]('userVoiceQueue:remove',{'UserId':Number(_0x54b4c5[_0xcb7a('0x3c')][_0xcb7a('0x91')][_0x1e50d4]),'VoiceQueueId':Number(_0x54b4c5[_0xcb7a('0x4e')]['id'])});}}else{socket[_0xcb7a('0x7e')](_0xcb7a('0x95'),{'UserId':Number(_0x54b4c5[_0xcb7a('0x3c')][_0xcb7a('0x91')]),'VoiceQueueId':Number(_0x54b4c5[_0xcb7a('0x4e')]['id'])});}});}})[_0xcb7a('0x29')](function(_0x38b478){return db[_0xcb7a('0x94')]['destroy']({'where':{'VoiceQueueId':_0x54b4c5[_0xcb7a('0x4e')]['id'],'UserId':_0x54b4c5[_0xcb7a('0x3c')][_0xcb7a('0x91')]}})[_0xcb7a('0x29')](function(){return _0x38b478;});})[_0xcb7a('0x29')](respondWithStatusCode(_0x37b2a1,null))['catch'](handleError(_0x37b2a1,null));};exports['getAgents']=function(_0x28cf0a,_0x5064a5,_0x459dd5){var _0x4c56fc={};var _0x406ba9={};var _0x1cd8be;var _0x2ced45;return db['VoiceQueue'][_0xcb7a('0x61')]({'where':{'id':_0x28cf0a[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x5064a5,null))['then'](function(_0x28fdae){if(_0x28fdae){_0x1cd8be=_0x28fdae;_0x406ba9['model']=_[_0xcb7a('0x3d')](db[_0xcb7a('0x6f')]['rawAttributes']);_0x406ba9[_0xcb7a('0x3c')]=_[_0xcb7a('0x3d')](_0x28cf0a[_0xcb7a('0x3c')]);_0x406ba9['filters']=_[_0xcb7a('0x3e')](_0x406ba9[_0xcb7a('0x3b')],_0x406ba9[_0xcb7a('0x3c')]);_0x4c56fc['attributes']=_['intersection'](_0x406ba9[_0xcb7a('0x3b')],qs['fields'](_0x28cf0a[_0xcb7a('0x3c')][_0xcb7a('0x40')]));_0x4c56fc['attributes']=_0x4c56fc['attributes']['length']?_0x4c56fc[_0xcb7a('0x3f')]:_0x406ba9[_0xcb7a('0x3b')];_0x4c56fc[_0xcb7a('0x63')]=qs[_0xcb7a('0x43')](_0x28cf0a[_0xcb7a('0x3c')][_0xcb7a('0x43')]);_0x4c56fc[_0xcb7a('0x44')]=qs['filters'](_[_0xcb7a('0x66')](_0x28cf0a['query'],_0x406ba9[_0xcb7a('0x45')]));if(_0x28cf0a[_0xcb7a('0x3c')][_0xcb7a('0x2f')]){_0x4c56fc[_0xcb7a('0x44')]=_[_0xcb7a('0x46')](_0x4c56fc[_0xcb7a('0x44')],{'$or':_[_0xcb7a('0x30')](_0x4c56fc[_0xcb7a('0x3f')],function(_0x438dec){var _0x2b9679={};_0x2b9679[_0x438dec]={'$like':'%'+_0x28cf0a[_0xcb7a('0x3c')]['filter']+'%'};return _0x2b9679;})});}_0x4c56fc=_[_0xcb7a('0x46')]({},_0x4c56fc,_0x28cf0a[_0xcb7a('0x50')]);return _0x1cd8be['getAgents'](_0x4c56fc);}})[_0xcb7a('0x29')](function(_0x355b65){if(_0x355b65){_0x2ced45=_0x355b65[_0xcb7a('0x4f')];if(!_0x28cf0a[_0xcb7a('0x3c')][_0xcb7a('0x41')](_0xcb7a('0x42'))){_0x4c56fc[_0xcb7a('0x21')]=qs['limit'](_0x28cf0a[_0xcb7a('0x3c')][_0xcb7a('0x21')]);_0x4c56fc['offset']=qs[_0xcb7a('0x20')](_0x28cf0a[_0xcb7a('0x3c')]['offset']);}return _0x1cd8be[_0xcb7a('0x9b')](_0x4c56fc);}})['then'](function(_0x55ff10){if(_0x55ff10){return _0x55ff10?{'count':_0x2ced45,'rows':_0x55ff10}:null;}})[_0xcb7a('0x29')](respondWithResult(_0x5064a5,null))['catch'](handleError(_0x5064a5,null));};exports[_0xcb7a('0x9c')]=function(_0x9ed938,_0x31a0e4,_0x2bb3f5){var _0x1c3963={};var _0x4f19c1={};var _0x57d654;var _0xbbc7a1;return db[_0xcb7a('0x4a')]['findOne']({'where':{'id':_0x9ed938['params']['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x31a0e4,null))[_0xcb7a('0x29')](function(_0x3b298d){if(_0x3b298d){_0x57d654=_0x3b298d;_0x4f19c1[_0xcb7a('0x3b')]=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x4f19c1[_0xcb7a('0x3c')]=_[_0xcb7a('0x3d')](_0x9ed938[_0xcb7a('0x3c')]);_0x4f19c1[_0xcb7a('0x45')]=_[_0xcb7a('0x3e')](_0x4f19c1[_0xcb7a('0x3b')],_0x4f19c1[_0xcb7a('0x3c')]);_0x1c3963[_0xcb7a('0x3f')]=_[_0xcb7a('0x3e')](_0x4f19c1['model'],qs[_0xcb7a('0x40')](_0x9ed938['query'][_0xcb7a('0x40')]));_0x1c3963['attributes']=_0x1c3963['attributes'][_0xcb7a('0x4f')]?_0x1c3963[_0xcb7a('0x3f')]:_0x4f19c1[_0xcb7a('0x3b')];_0x1c3963[_0xcb7a('0x63')]=qs[_0xcb7a('0x43')](_0x9ed938[_0xcb7a('0x3c')]['sort']);_0x1c3963[_0xcb7a('0x44')]=qs['filters'](_[_0xcb7a('0x66')](_0x9ed938[_0xcb7a('0x3c')],_0x4f19c1[_0xcb7a('0x45')]));if(_0x9ed938[_0xcb7a('0x3c')][_0xcb7a('0x2f')]){_0x1c3963['where']=_['merge'](_0x1c3963['where'],{'$or':_[_0xcb7a('0x30')](_0x1c3963[_0xcb7a('0x3f')],function(_0x9b1de3){var _0x590ccf={};_0x590ccf[_0x9b1de3]={'$like':'%'+_0x9ed938[_0xcb7a('0x3c')][_0xcb7a('0x2f')]+'%'};return _0x590ccf;})});}_0x1c3963=_[_0xcb7a('0x46')]({},_0x1c3963,_0x9ed938['options']);return _0x57d654[_0xcb7a('0x9c')](_0x1c3963);}})['then'](function(_0xb3de32){if(_0xb3de32){_0xbbc7a1=_0xb3de32['length'];if(!_0x9ed938[_0xcb7a('0x3c')][_0xcb7a('0x41')](_0xcb7a('0x42'))){_0x1c3963[_0xcb7a('0x21')]=qs[_0xcb7a('0x21')](_0x9ed938[_0xcb7a('0x3c')][_0xcb7a('0x21')]);_0x1c3963['offset']=qs['offset'](_0x9ed938[_0xcb7a('0x3c')]['offset']);}return _0x57d654[_0xcb7a('0x9c')](_0x1c3963);}})[_0xcb7a('0x29')](function(_0x3a26a5){return _0x3a26a5?{'count':_0xbbc7a1,'rows':_0x3a26a5}:null;})[_0xcb7a('0x29')](respondWithResult(_0x31a0e4,null))[_0xcb7a('0x4c')](handleError(_0x31a0e4,null));};exports[_0xcb7a('0x9d')]=function(_0x2e7ea4,_0x31da92,_0x5767f5){var _0x1f3e2d={};var _0x427a8d={};var _0x4a04b6;var _0x58def0;return db[_0xcb7a('0x4a')][_0xcb7a('0x61')]({'where':{'id':_0x2e7ea4[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x31da92,null))[_0xcb7a('0x29')](function(_0x4b3628){if(_0x4b3628){_0x4a04b6=_0x4b3628;_0x427a8d['model']=_['keys'](db[_0xcb7a('0x9e')][_0xcb7a('0x39')]);_0x427a8d[_0xcb7a('0x3c')]=_[_0xcb7a('0x3d')](_0x2e7ea4['query']);_0x427a8d[_0xcb7a('0x45')]=_[_0xcb7a('0x3e')](_0x427a8d[_0xcb7a('0x3b')],_0x427a8d[_0xcb7a('0x3c')]);_0x1f3e2d[_0xcb7a('0x3f')]=_[_0xcb7a('0x3e')](_0x427a8d[_0xcb7a('0x3b')],qs[_0xcb7a('0x40')](_0x2e7ea4[_0xcb7a('0x3c')]['fields']));_0x1f3e2d[_0xcb7a('0x3f')]=_0x1f3e2d[_0xcb7a('0x3f')][_0xcb7a('0x4f')]?_0x1f3e2d[_0xcb7a('0x3f')]:_0x427a8d['model'];_0x1f3e2d[_0xcb7a('0x63')]=qs[_0xcb7a('0x43')](_0x2e7ea4[_0xcb7a('0x3c')]['sort']);_0x1f3e2d['where']=qs[_0xcb7a('0x45')](_[_0xcb7a('0x66')](_0x2e7ea4[_0xcb7a('0x3c')],_0x427a8d[_0xcb7a('0x45')]));if(_0x2e7ea4['query'][_0xcb7a('0x2f')]){_0x1f3e2d[_0xcb7a('0x44')]=_['merge'](_0x1f3e2d[_0xcb7a('0x44')],{'$or':_[_0xcb7a('0x30')](_0x1f3e2d[_0xcb7a('0x3f')],function(_0x571578){var _0x1d6078={};_0x1d6078[_0x571578]={'$like':'%'+_0x2e7ea4['query']['filter']+'%'};return _0x1d6078;})});}_0x1f3e2d=_[_0xcb7a('0x46')]({},_0x1f3e2d,_0x2e7ea4[_0xcb7a('0x50')]);return _0x4a04b6[_0xcb7a('0x9d')](_0x1f3e2d);}})[_0xcb7a('0x29')](function(_0x41a23b){if(_0x41a23b){_0x58def0=_0x41a23b['length'];if(!_0x2e7ea4[_0xcb7a('0x3c')][_0xcb7a('0x41')](_0xcb7a('0x42'))){_0x1f3e2d[_0xcb7a('0x21')]=qs[_0xcb7a('0x21')](_0x2e7ea4[_0xcb7a('0x3c')][_0xcb7a('0x21')]);_0x1f3e2d[_0xcb7a('0x20')]=qs['offset'](_0x2e7ea4[_0xcb7a('0x3c')][_0xcb7a('0x20')]);}return _0x4a04b6[_0xcb7a('0x9d')](_0x1f3e2d);}})[_0xcb7a('0x29')](function(_0x4d97f4){if(_0x4d97f4){return _0x4d97f4?{'count':_0x58def0,'rows':_0x4d97f4}:null;}})[_0xcb7a('0x29')](respondWithResult(_0x31da92,null))[_0xcb7a('0x4c')](handleError(_0x31da92,null));};exports['addLists']=function(_0x12fea5,_0x44a707,_0x3e95c9){var _0x41780b=moment()[_0xcb7a('0x9f')](_0xcb7a('0xa0'));var _0x3ba45a,_0x39d90f;return db[_0xcb7a('0x4a')][_0xcb7a('0x32')]({'where':{'id':_0x12fea5['params']['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x44a707,null))[_0xcb7a('0x29')](function(_0x2cbc67){if(_0x2cbc67){_0x39d90f=_0x2cbc67;return _0x2cbc67[_0xcb7a('0xa1')](_0x12fea5[_0xcb7a('0x52')][_0xcb7a('0x91')],_['omit'](_0x12fea5[_0xcb7a('0x52')],[_0xcb7a('0x91'),'id'])||{});}return null;})[_0xcb7a('0x97')](function(_0x41e4c5){var _0x52cf04;_0x3ba45a=_0x41e4c5||[];var _0x2a42c8=[];if(_0x41e4c5){for(var _0xdbe4bb=0x0;_0xdbe4bb<_0x41e4c5[_0xcb7a('0x4f')];_0xdbe4bb+=0x1){var _0x559c07=_0x41e4c5[_0xdbe4bb][_0xcb7a('0x2b')]({'plain':!![]});_0x39d90f['dialCheckDuplicateType']=_0x12fea5[_0xcb7a('0x52')][_0xcb7a('0xa2')]?_0x12fea5['body']['dialCheckDuplicateType']:_0x39d90f[_0xcb7a('0xa2')];switch(_0x39d90f[_0xcb7a('0xa2')]){case _0xcb7a('0xa3'):_0x52cf04=squel['insert']()[_0xcb7a('0xa4')](_0xcb7a('0xa5'))['fromQuery'](['phone',_0xcb7a('0xa6'),_0xcb7a('0xa7'),_0xcb7a('0xa8'),_0xcb7a('0x64'),'createdAt','updatedAt'],squel[_0xcb7a('0x80')]()[_0xcb7a('0x81')](_0xcb7a('0xa9'),_0xcb7a('0xa9'))[_0xcb7a('0x81')]('\x27'+_0x41780b+'\x27',_0xcb7a('0xa6'))[_0xcb7a('0x81')]('id',_0xcb7a('0xa7'))[_0xcb7a('0x81')](_0x559c07[_0xcb7a('0xaa')][_0xcb7a('0x8a')](),_0xcb7a('0xa8'))[_0xcb7a('0x81')](_0x12fea5[_0xcb7a('0x4e')]['id'][_0xcb7a('0x8a')](),_0xcb7a('0x64'))['field']('\x27'+_0x41780b+'\x27',_0xcb7a('0x5d'))[_0xcb7a('0x81')]('\x27'+_0x41780b+'\x27',_0xcb7a('0x5e'))[_0xcb7a('0x83')](_0xcb7a('0xab'))['where'](_0xcb7a('0xac'))[_0xcb7a('0x44')]('ListId\x20=\x20?',_0x559c07[_0xcb7a('0xaa')][_0xcb7a('0x8a')]())[_0xcb7a('0x44')](_0xcb7a('0xad'))[_0xcb7a('0x44')](_0xcb7a('0xae'),squel[_0xcb7a('0x80')]()['field'](_0xcb7a('0xaf'))[_0xcb7a('0x83')](_0xcb7a('0xb0'))[_0xcb7a('0x44')](_0xcb7a('0x87'),_0x12fea5['params']['id'][_0xcb7a('0x8a')]()))[_0xcb7a('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xcb7a('0x81')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xcb7a('0x44')]('VoiceQueueId\x20=\x20?',_0x12fea5[_0xcb7a('0x4e')]['id'][_0xcb7a('0x8a')]())))['toString']();break;case _0xcb7a('0xb1'):_0x52cf04=squel[_0xcb7a('0xb2')]()[_0xcb7a('0xa4')]('cm_hopper')[_0xcb7a('0xb3')]([_0xcb7a('0xa9'),_0xcb7a('0xa6'),_0xcb7a('0xa7'),_0xcb7a('0xa8'),_0xcb7a('0x64'),_0xcb7a('0x5d'),'updatedAt'],squel['select']()[_0xcb7a('0x81')](_0xcb7a('0xa9'),_0xcb7a('0xa9'))[_0xcb7a('0x81')]('\x27'+_0x41780b+'\x27',_0xcb7a('0xa6'))['field']('id','ContactId')['field'](_0x559c07['CmListId']['toString'](),_0xcb7a('0xa8'))[_0xcb7a('0x81')](_0x12fea5[_0xcb7a('0x4e')]['id']['toString'](),_0xcb7a('0x64'))['field']('\x27'+_0x41780b+'\x27',_0xcb7a('0x5d'))[_0xcb7a('0x81')]('\x27'+_0x41780b+'\x27',_0xcb7a('0x5e'))[_0xcb7a('0x83')](_0xcb7a('0xab'))[_0xcb7a('0x44')](_0xcb7a('0xac'))[_0xcb7a('0x44')](_0xcb7a('0xb4'),_0x559c07[_0xcb7a('0xaa')]['toString']())['where'](_0xcb7a('0xad'))[_0xcb7a('0x44')](_0xcb7a('0xae'),squel[_0xcb7a('0x80')]()[_0xcb7a('0x81')](_0xcb7a('0xb5'))[_0xcb7a('0x83')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x12fea5[_0xcb7a('0x4e')]['id'][_0xcb7a('0x8a')]())))[_0xcb7a('0x8a')]();break;default:_0x52cf04=squel['insert']()[_0xcb7a('0xa4')]('cm_hopper')[_0xcb7a('0xb3')]([_0xcb7a('0xa9'),_0xcb7a('0xa6'),'ContactId',_0xcb7a('0xa8'),_0xcb7a('0x64'),'createdAt',_0xcb7a('0x5e')],squel[_0xcb7a('0x80')]()[_0xcb7a('0x81')](_0xcb7a('0xa9'),_0xcb7a('0xa9'))[_0xcb7a('0x81')]('\x27'+_0x41780b+'\x27','scheduledAt')[_0xcb7a('0x81')]('id',_0xcb7a('0xa7'))['field'](_0x559c07[_0xcb7a('0xaa')][_0xcb7a('0x8a')](),_0xcb7a('0xa8'))[_0xcb7a('0x81')](_0x12fea5[_0xcb7a('0x4e')]['id'][_0xcb7a('0x8a')](),'VoiceQueueId')[_0xcb7a('0x81')]('\x27'+_0x41780b+'\x27',_0xcb7a('0x5d'))[_0xcb7a('0x81')]('\x27'+_0x41780b+'\x27',_0xcb7a('0x5e'))[_0xcb7a('0x83')](_0xcb7a('0xab'))[_0xcb7a('0x44')](_0xcb7a('0xac'))['where'](_0xcb7a('0xb4'),_0x559c07[_0xcb7a('0xaa')]['toString']())['where'](_0xcb7a('0xad')))['toString']();}_0x2a42c8[_0xcb7a('0x89')](db[_0xcb7a('0x75')][_0xcb7a('0x3c')](_0x52cf04));}return BPromise['all'](_0x2a42c8);}})[_0xcb7a('0x29')](function(){var _0x522860=[];var _0x50dd4a=squel[_0xcb7a('0xb2')]()['into'](_0xcb7a('0xb6'))['fromQuery']([_0xcb7a('0xb7'),_0xcb7a('0xa9'),_0xcb7a('0xb8'),_0xcb7a('0x5d'),'updatedAt'],squel[_0xcb7a('0x80')]()[_0xcb7a('0x81')](_0xcb7a('0xb9'))[_0xcb7a('0x81')](_0xcb7a('0xba'))[_0xcb7a('0x81')](_0xcb7a('0xbb'))[_0xcb7a('0x81')]('\x27'+_0x41780b+'\x27',_0xcb7a('0x5d'))[_0xcb7a('0x81')]('\x27'+_0x41780b+'\x27','updatedAt')[_0xcb7a('0x83')](_0xcb7a('0xbc'),'ci')['join'](_0xcb7a('0xa5'),'h',_0xcb7a('0xbd'))[_0xcb7a('0x44')](_0xcb7a('0xbe'),_0x41780b)[_0xcb7a('0x44')]('ci.ItemClass=?',_0xcb7a('0xbf')))[_0xcb7a('0x8a')]();_0x522860[_0xcb7a('0x89')](db[_0xcb7a('0x75')][_0xcb7a('0x3c')](_0x50dd4a));return BPromise[_0xcb7a('0x8e')](_0x522860);})['then'](function(){return _0x3ba45a;})[_0xcb7a('0x29')](respondWithResult(_0x44a707,null))[_0xcb7a('0x4c')](handleError(_0x44a707,null));};exports[_0xcb7a('0xc0')]=function(_0x3e4447,_0x3916a8,_0x132619){return db[_0xcb7a('0x4a')][_0xcb7a('0x32')]({'where':{'id':_0x3e4447[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x3916a8,null))[_0xcb7a('0x29')](function(_0x296756){if(_0x296756){return _0x296756[_0xcb7a('0xc0')](_0x3e4447['query']['ids']);}})[_0xcb7a('0x29')](function(_0x22fef0){if(_0x22fef0){return db[_0xcb7a('0x62')][_0xcb7a('0x2a')]({'where':{'ListId':_0x3e4447[_0xcb7a('0x3c')][_0xcb7a('0x91')],'VoiceQueueId':_0x3e4447[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](function(){return _0x22fef0;});}})[_0xcb7a('0x29')](respondWithStatusCode(_0x3916a8,null))[_0xcb7a('0x4c')](handleError(_0x3916a8,null));};exports[_0xcb7a('0xc1')]=function(_0x56d7e1,_0x1c8c72,_0x519bf3){var _0xa0ad1b={};var _0x31440b={};var _0x127dd1;var _0x51c365;return db[_0xcb7a('0x4a')][_0xcb7a('0x61')]({'where':{'id':_0x56d7e1[_0xcb7a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1c8c72,null))[_0xcb7a('0x29')](function(_0x59a21a){if(_0x59a21a){_0x127dd1=_0x59a21a;_0x31440b[_0xcb7a('0x3b')]=_[_0xcb7a('0x3d')](db[_0xcb7a('0x9e')][_0xcb7a('0x39')]);_0x31440b['query']=_['keys'](_0x56d7e1[_0xcb7a('0x3c')]);_0x31440b[_0xcb7a('0x45')]=_[_0xcb7a('0x3e')](_0x31440b[_0xcb7a('0x3b')],_0x31440b[_0xcb7a('0x3c')]);_0xa0ad1b['attributes']=_['intersection'](_0x31440b[_0xcb7a('0x3b')],qs[_0xcb7a('0x40')](_0x56d7e1[_0xcb7a('0x3c')]['fields']));_0xa0ad1b[_0xcb7a('0x3f')]=_0xa0ad1b[_0xcb7a('0x3f')][_0xcb7a('0x4f')]?_0xa0ad1b[_0xcb7a('0x3f')]:_0x31440b[_0xcb7a('0x3b')];_0xa0ad1b[_0xcb7a('0x63')]=qs[_0xcb7a('0x43')](_0x56d7e1[_0xcb7a('0x3c')][_0xcb7a('0x43')]);_0xa0ad1b[_0xcb7a('0x44')]=qs[_0xcb7a('0x45')](_['pick'](_0x56d7e1[_0xcb7a('0x3c')],_0x31440b[_0xcb7a('0x45')]));if(_0x56d7e1[_0xcb7a('0x3c')]['filter']){_0xa0ad1b[_0xcb7a('0x44')]=_[_0xcb7a('0x46')](_0xa0ad1b[_0xcb7a('0x44')],{'$or':_[_0xcb7a('0x30')](_0xa0ad1b[_0xcb7a('0x3f')],function(_0x2674ef){var _0x536088={};_0x536088[_0x2674ef]={'$like':'%'+_0x56d7e1['query'][_0xcb7a('0x2f')]+'%'};return _0x536088;})});}_0xa0ad1b=_[_0xcb7a('0x46')]({},_0xa0ad1b,_0x56d7e1[_0xcb7a('0x50')]);return _0x127dd1[_0xcb7a('0xc1')](_0xa0ad1b);}})[_0xcb7a('0x29')](function(_0xb45299){if(_0xb45299){_0x51c365=_0xb45299['length'];if(!_0x56d7e1[_0xcb7a('0x3c')][_0xcb7a('0x41')](_0xcb7a('0x42'))){_0xa0ad1b[_0xcb7a('0x21')]=qs[_0xcb7a('0x21')](_0x56d7e1[_0xcb7a('0x3c')][_0xcb7a('0x21')]);_0xa0ad1b[_0xcb7a('0x20')]=qs['offset'](_0x56d7e1[_0xcb7a('0x3c')][_0xcb7a('0x20')]);}return _0x127dd1[_0xcb7a('0xc1')](_0xa0ad1b);}})[_0xcb7a('0x29')](function(_0xed932d){if(_0xed932d){return _0xed932d?{'count':_0x51c365,'rows':_0xed932d}:null;}})[_0xcb7a('0x29')](respondWithResult(_0x1c8c72,null))[_0xcb7a('0x4c')](handleError(_0x1c8c72,null));};exports[_0xcb7a('0xc2')]=function(_0x18d8c7,_0x81bf6a,_0x4a69f3){var _0xf06518,_0x599cf2;return db['VoiceQueue'][_0xcb7a('0x32')]({'where':{'id':_0x18d8c7[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x81bf6a,null))['then'](function(_0x56479c){if(_0x56479c){_0x599cf2=_0x56479c;return _0x56479c[_0xcb7a('0xc2')](_0x18d8c7[_0xcb7a('0x52')][_0xcb7a('0x91')],_['omit'](_0x18d8c7[_0xcb7a('0x52')],[_0xcb7a('0x91'),'id'])||{});}return null;})['spread'](function(_0xf9a2c5){var _0x1ca932;_0xf06518=_0xf9a2c5||[];var _0x4eddb0=[];if(_0xf9a2c5){for(var _0x4d8dbf=0x0;_0x4d8dbf<_0xf9a2c5['length'];_0x4d8dbf+=0x1){var _0x54ecdb=_0xf9a2c5[_0x4d8dbf][_0xcb7a('0x2b')]({'plain':!![]});_0x1ca932=squel[_0xcb7a('0xb2')]()['into'](_0xcb7a('0xc3'))[_0xcb7a('0xb3')]([_0xcb7a('0xa9'),_0xcb7a('0xa7'),_0xcb7a('0xa8'),_0xcb7a('0x64'),'createdAt',_0xcb7a('0x5e')],squel[_0xcb7a('0x80')]()['field'](_0xcb7a('0xa9'),'phone')[_0xcb7a('0x81')]('id',_0xcb7a('0xa7'))[_0xcb7a('0x81')](_0x54ecdb[_0xcb7a('0xaa')]['toString'](),'ListId')[_0xcb7a('0x81')](_0x18d8c7[_0xcb7a('0x4e')]['id'][_0xcb7a('0x8a')](),_0xcb7a('0x64'))[_0xcb7a('0x81')](_0xcb7a('0xc4'),_0xcb7a('0x5d'))[_0xcb7a('0x81')]('NOW()',_0xcb7a('0x5e'))[_0xcb7a('0x83')](_0xcb7a('0xab'))['where'](_0xcb7a('0xac'))[_0xcb7a('0x44')](_0xcb7a('0xb4'),_0x54ecdb[_0xcb7a('0xaa')][_0xcb7a('0x8a')]())[_0xcb7a('0x44')](_0xcb7a('0xad')))[_0xcb7a('0x8a')]();_0x4eddb0[_0xcb7a('0x89')](db[_0xcb7a('0x75')][_0xcb7a('0x3c')](_0x1ca932));}return BPromise[_0xcb7a('0x8e')](_0x4eddb0);}})[_0xcb7a('0x29')](function(){return _0xf06518;})[_0xcb7a('0x29')](respondWithResult(_0x81bf6a,null))[_0xcb7a('0x4c')](handleError(_0x81bf6a,null));};exports[_0xcb7a('0xc5')]=function(_0x2f93fc,_0x5835a6,_0x55d10a){return db[_0xcb7a('0x4a')][_0xcb7a('0x32')]({'where':{'id':_0x2f93fc[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](handleEntityNotFound(_0x5835a6,null))[_0xcb7a('0x29')](function(_0x205e2a){if(_0x205e2a){return _0x205e2a[_0xcb7a('0xc5')](_0x2f93fc[_0xcb7a('0x3c')][_0xcb7a('0x91')]);}})['then'](function(_0xc06ab0){if(_0xc06ab0){return db[_0xcb7a('0x6b')][_0xcb7a('0x2a')]({'where':{'ListId':_0x2f93fc[_0xcb7a('0x3c')][_0xcb7a('0x91')],'VoiceQueueId':_0x2f93fc[_0xcb7a('0x4e')]['id']}})[_0xcb7a('0x29')](function(){return _0xc06ab0;});}})[_0xcb7a('0x29')](respondWithStatusCode(_0x5835a6,null))[_0xcb7a('0x4c')](handleError(_0x5835a6,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 988c781..6ff0bf0 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 _0xc044=['emit','exports','../../mysqldb','VoiceQueue','save','update','remove'];(function(_0x544a09,_0xf199f7){var _0x2f9f77=function(_0x12147d){while(--_0x12147d){_0x544a09['push'](_0x544a09['shift']());}};_0x2f9f77(++_0xf199f7);}(_0xc044,0x105));var _0x4c04=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xc044[_0x484e36];return _0xafc85d;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x4c04('0x0'))['db'][_0x4c04('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c04('0x2'),'afterUpdate':_0x4c04('0x3'),'afterDestroy':_0x4c04('0x4')};function emitEvent(_0x1dbf2c){return function(_0x48aca8,_0x4fa7a5,_0x45e3fb){VoiceQueueEvents['emit'](_0x1dbf2c+':'+_0x48aca8['id'],_0x48aca8);VoiceQueueEvents[_0x4c04('0x5')](_0x1dbf2c,_0x48aca8);_0x45e3fb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x4c04('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0x757c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x3ba753,_0x2f3216){var _0x2f469a=function(_0x3c0c23){while(--_0x3c0c23){_0x3ba753['push'](_0x3ba753['shift']());}};_0x2f469a(++_0x2f3216);}(_0x757c,0xd9));var _0xc757=function(_0x5b7c02,_0x1bfc25){_0x5b7c02=_0x5b7c02-0x0;var _0x26a736=_0x757c[_0x5b7c02];return _0x26a736;};'use strict';var EventEmitter=require(_0xc757('0x0'));var VoiceQueue=require(_0xc757('0x1'))['db'][_0xc757('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc757('0x3')](0x0);var events={'afterCreate':_0xc757('0x4'),'afterUpdate':_0xc757('0x5'),'afterDestroy':_0xc757('0x6')};function emitEvent(_0x3b526c){return function(_0x32b863,_0x43c235,_0x5b9a0f){VoiceQueueEvents[_0xc757('0x7')](_0x3b526c+':'+_0x32b863['id'],_0x32b863);VoiceQueueEvents['emit'](_0x3b526c,_0x32b863);_0x5b9a0f(null);};}for(var e in events){if(events[_0xc757('0x8')](e)){var event=events[e];VoiceQueue[_0xc757('0x9')](e,emitEvent(event));}}module[_0xc757('0xa')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 11a26e8..a5e13ba 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x54282d,_0x297437){var _0x36bfe2=function(_0x5b88b3){while(--_0x5b88b3){_0x54282d['push'](_0x54282d['shift']());}};_0x36bfe2(++_0x297437);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x3e74,0x175));var _0x43e7=function(_0xdd1940,_0x236f73){_0xdd1940=_0xdd1940-0x0;var _0x3511fa=_0x3e74[_0xdd1940];return _0x3511fa;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'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 b2ba754..3eb8097 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 _0xcdfa=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','model','map','catch','ShowVoiceQueue','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdfa,0x118));var _0xacdf=function(_0xc20c04,_0x2ef23e){_0xc20c04=_0xc20c04-0x0;var _0xdce3f1=_0xcdfa[_0xc20c04];return _0xdce3f1;};'use strict';var _=require(_0xacdf('0x0'));var util=require(_0xacdf('0x1'));var moment=require(_0xacdf('0x2'));var BPromise=require(_0xacdf('0x3'));var rs=require(_0xacdf('0x4'));var fs=require('fs');var Redis=require(_0xacdf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xacdf('0x6'));var logger=require(_0xacdf('0x7'))(_0xacdf('0x8'));var config=require(_0xacdf('0x9'));var jayson=require(_0xacdf('0xa'));var client=jayson['client'][_0xacdf('0xb')]({'port':0x232a});config[_0xacdf('0xc')]=_[_0xacdf('0xd')](config[_0xacdf('0xc')],{'host':_0xacdf('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacdf('0xc')]));require(_0xacdf('0xf'))[_0xacdf('0x10')](socket);function respondWithRpcPromise(_0x423e86,_0x2e61e7,_0x53d14b){return new BPromise(function(_0x29cda2,_0x4612ab){return client['request'](_0x423e86,_0x53d14b)[_0xacdf('0x11')](function(_0x26d7d5){logger[_0xacdf('0x12')](_0xacdf('0x13'),_0x2e61e7,'request\x20sent');logger[_0xacdf('0x14')](_0xacdf('0x15'),_0x2e61e7,_0xacdf('0x16'),JSON[_0xacdf('0x17')](_0x26d7d5));if(_0x26d7d5[_0xacdf('0x18')]){if(_0x26d7d5[_0xacdf('0x18')][_0xacdf('0x19')]===0x1f4){logger[_0xacdf('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x2e61e7,_0x26d7d5[_0xacdf('0x18')][_0xacdf('0x1a')]);return _0x4612ab(_0x26d7d5[_0xacdf('0x18')][_0xacdf('0x1a')]);}logger[_0xacdf('0x18')](_0xacdf('0x13'),_0x2e61e7,_0x26d7d5[_0xacdf('0x18')]['message']);return _0x29cda2(_0x26d7d5[_0xacdf('0x18')][_0xacdf('0x1a')]);}else{logger[_0xacdf('0x12')](_0xacdf('0x13'),_0x2e61e7,_0xacdf('0x16'));_0x29cda2(_0x26d7d5['result'][_0xacdf('0x1a')]);}})['catch'](function(_0x53265e){logger[_0xacdf('0x18')](_0xacdf('0x13'),_0x2e61e7,_0x53265e);_0x4612ab(_0x53265e);});});}exports[_0xacdf('0x1b')]=function(_0x243ac4){var _0x51aa2f=this;return new Promise(function(_0x203b13,_0x59246d){return db[_0xacdf('0x1c')]['findAll']({'raw':_0x243ac4[_0xacdf('0x1d')]?_0x243ac4[_0xacdf('0x1d')][_0xacdf('0x1e')]===undefined?!![]:![]:!![],'where':_0x243ac4['options']?_0x243ac4[_0xacdf('0x1d')][_0xacdf('0x1f')]||null:null,'attributes':_0x243ac4[_0xacdf('0x1d')]?_0x243ac4['options'][_0xacdf('0x20')]||null:null,'limit':_0x243ac4['options']?_0x243ac4[_0xacdf('0x1d')][_0xacdf('0x21')]||null:null,'include':_0x243ac4[_0xacdf('0x1d')]?_0x243ac4['options']['include']?_['map'](_0x243ac4[_0xacdf('0x1d')][_0xacdf('0x22')],function(_0x48400b){return{'model':db[_0x48400b[_0xacdf('0x23')]],'as':_0x48400b['as'],'attributes':_0x48400b[_0xacdf('0x20')],'include':_0x48400b[_0xacdf('0x22')]?_[_0xacdf('0x24')](_0x48400b[_0xacdf('0x22')],function(_0x459b95){return{'model':db[_0x459b95['model']],'as':_0x459b95['as'],'attributes':_0x459b95[_0xacdf('0x20')],'include':_0x459b95['include']?_[_0xacdf('0x24')](_0x459b95['include'],function(_0x204def){return{'model':db[_0x204def[_0xacdf('0x23')]],'as':_0x204def['as'],'attributes':_0x204def['attributes']};}):[]};}):[]};}):[]:[]})[_0xacdf('0x11')](function(_0x3971f5){logger[_0xacdf('0x12')](_0xacdf('0x1b'),_0x243ac4);logger[_0xacdf('0x14')](_0xacdf('0x1b'),_0x243ac4,JSON['stringify'](_0x3971f5));_0x203b13(_0x3971f5);})[_0xacdf('0x25')](function(_0x2e4eb6){logger[_0xacdf('0x18')](_0xacdf('0x1b'),_0x2e4eb6['message'],_0x243ac4);_0x59246d(_0x51aa2f[_0xacdf('0x18')](0x1f4,_0x2e4eb6['message']));});});};exports[_0xacdf('0x26')]=function(_0x5ee36d){var _0x5b4116=this;return new Promise(function(_0x6ebc5c,_0x4511b5){return db['VoiceQueue'][_0xacdf('0x27')]({'raw':_0x5ee36d[_0xacdf('0x1d')]?_0x5ee36d[_0xacdf('0x1d')][_0xacdf('0x1e')]===undefined?!![]:![]:!![],'where':_0x5ee36d[_0xacdf('0x1d')]?_0x5ee36d[_0xacdf('0x1d')][_0xacdf('0x1f')]||null:null,'attributes':_0x5ee36d['options']?_0x5ee36d[_0xacdf('0x1d')][_0xacdf('0x20')]||null:null,'include':_0x5ee36d[_0xacdf('0x1d')]?_0x5ee36d[_0xacdf('0x1d')][_0xacdf('0x22')]?_[_0xacdf('0x24')](_0x5ee36d[_0xacdf('0x1d')]['include'],function(_0x19c23f){return{'model':db[_0x19c23f[_0xacdf('0x23')]],'as':_0x19c23f['as'],'attributes':_0x19c23f[_0xacdf('0x20')],'include':_0x19c23f[_0xacdf('0x22')]?_[_0xacdf('0x24')](_0x19c23f[_0xacdf('0x22')],function(_0x4ad0d3){return{'model':db[_0x4ad0d3['model']],'as':_0x4ad0d3['as'],'attributes':_0x4ad0d3['attributes'],'include':_0x4ad0d3['include']?_[_0xacdf('0x24')](_0x4ad0d3[_0xacdf('0x22')],function(_0x10645e){return{'model':db[_0x10645e['model']],'as':_0x10645e['as'],'attributes':_0x10645e[_0xacdf('0x20')]};}):[]};}):[]};}):[]:[]})[_0xacdf('0x11')](function(_0x16da1c){logger[_0xacdf('0x12')](_0xacdf('0x26'),_0x5ee36d);logger[_0xacdf('0x14')]('ShowVoiceQueue',_0x5ee36d,JSON[_0xacdf('0x17')](_0x16da1c));_0x6ebc5c(_0x16da1c);})[_0xacdf('0x25')](function(_0x56f6ae){logger[_0xacdf('0x18')](_0xacdf('0x26'),_0x56f6ae[_0xacdf('0x1a')],_0x5ee36d);_0x4511b5(_0x5b4116['error'](0x1f4,_0x56f6ae['message']));});});}; \ No newline at end of file +var _0x7c19=['localhost','./voiceQueue.socket','register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','catch','options','raw','where','attributes','limit','model','include','map','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x328c2c,_0x5ad047){var _0x3f7d83=function(_0xa7d8ad){while(--_0xa7d8ad){_0x328c2c['push'](_0x328c2c['shift']());}};_0x3f7d83(++_0x5ad047);}(_0x7c19,0x65));var _0x97c1=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x7c19[_0x556bb1];return _0x45455f;};'use strict';var _=require(_0x97c1('0x0'));var util=require('util');var moment=require(_0x97c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97c1('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x97c1('0x4'));var config=require(_0x97c1('0x5'));var jayson=require(_0x97c1('0x6'));var client=jayson[_0x97c1('0x7')][_0x97c1('0x8')]({'port':0x232a});config[_0x97c1('0x9')]=_['defaults'](config['redis'],{'host':_0x97c1('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x97c1('0x9')]));require(_0x97c1('0xb'))[_0x97c1('0xc')](socket);function respondWithRpcPromise(_0x3995e2,_0x30b221,_0x184566){return new BPromise(function(_0x186cb2,_0x799b0c){return client[_0x97c1('0xd')](_0x3995e2,_0x184566)[_0x97c1('0xe')](function(_0x475373){logger[_0x97c1('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x30b221,_0x97c1('0x10'));logger[_0x97c1('0x11')](_0x97c1('0x12'),_0x30b221,_0x97c1('0x10'),JSON[_0x97c1('0x13')](_0x475373));if(_0x475373[_0x97c1('0x14')]){if(_0x475373[_0x97c1('0x14')][_0x97c1('0x15')]===0x1f4){logger['error'](_0x97c1('0x16'),_0x30b221,_0x475373['error']['message']);return _0x799b0c(_0x475373[_0x97c1('0x14')][_0x97c1('0x17')]);}logger[_0x97c1('0x14')](_0x97c1('0x16'),_0x30b221,_0x475373['error']['message']);return _0x186cb2(_0x475373[_0x97c1('0x14')][_0x97c1('0x17')]);}else{logger['info'](_0x97c1('0x16'),_0x30b221,_0x97c1('0x10'));_0x186cb2(_0x475373['result'][_0x97c1('0x17')]);}})[_0x97c1('0x18')](function(_0x291d09){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x30b221,_0x291d09);_0x799b0c(_0x291d09);});});}exports['GetVoiceQueue']=function(_0x41acf9){var _0x2ee754=this;return new Promise(function(_0x1c2bb6,_0x112043){return db['VoiceQueue']['findAll']({'raw':_0x41acf9[_0x97c1('0x19')]?_0x41acf9['options'][_0x97c1('0x1a')]===undefined?!![]:![]:!![],'where':_0x41acf9[_0x97c1('0x19')]?_0x41acf9[_0x97c1('0x19')][_0x97c1('0x1b')]||null:null,'attributes':_0x41acf9[_0x97c1('0x19')]?_0x41acf9[_0x97c1('0x19')][_0x97c1('0x1c')]||null:null,'limit':_0x41acf9[_0x97c1('0x19')]?_0x41acf9[_0x97c1('0x19')][_0x97c1('0x1d')]||null:null,'include':_0x41acf9[_0x97c1('0x19')]?_0x41acf9[_0x97c1('0x19')]['include']?_['map'](_0x41acf9['options']['include'],function(_0x567360){return{'model':db[_0x567360[_0x97c1('0x1e')]],'as':_0x567360['as'],'attributes':_0x567360[_0x97c1('0x1c')],'include':_0x567360[_0x97c1('0x1f')]?_['map'](_0x567360['include'],function(_0x2570d1){return{'model':db[_0x2570d1[_0x97c1('0x1e')]],'as':_0x2570d1['as'],'attributes':_0x2570d1[_0x97c1('0x1c')],'include':_0x2570d1[_0x97c1('0x1f')]?_[_0x97c1('0x20')](_0x2570d1[_0x97c1('0x1f')],function(_0xf8f216){return{'model':db[_0xf8f216[_0x97c1('0x1e')]],'as':_0xf8f216['as'],'attributes':_0xf8f216[_0x97c1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x97c1('0xe')](function(_0x2341a4){logger[_0x97c1('0xf')](_0x97c1('0x21'),_0x41acf9);logger[_0x97c1('0x11')](_0x97c1('0x21'),_0x41acf9,JSON[_0x97c1('0x13')](_0x2341a4));_0x1c2bb6(_0x2341a4);})[_0x97c1('0x18')](function(_0x1c6069){logger[_0x97c1('0x14')](_0x97c1('0x21'),_0x1c6069['message'],_0x41acf9);_0x112043(_0x2ee754[_0x97c1('0x14')](0x1f4,_0x1c6069[_0x97c1('0x17')]));});});};exports[_0x97c1('0x22')]=function(_0x444834){var _0x309ae5=this;return new Promise(function(_0x570caf,_0x2e8493){return db[_0x97c1('0x23')][_0x97c1('0x24')]({'raw':_0x444834[_0x97c1('0x19')]?_0x444834[_0x97c1('0x19')][_0x97c1('0x1a')]===undefined?!![]:![]:!![],'where':_0x444834[_0x97c1('0x19')]?_0x444834[_0x97c1('0x19')][_0x97c1('0x1b')]||null:null,'attributes':_0x444834[_0x97c1('0x19')]?_0x444834[_0x97c1('0x19')][_0x97c1('0x1c')]||null:null,'include':_0x444834[_0x97c1('0x19')]?_0x444834[_0x97c1('0x19')][_0x97c1('0x1f')]?_[_0x97c1('0x20')](_0x444834[_0x97c1('0x19')]['include'],function(_0x5709ef){return{'model':db[_0x5709ef[_0x97c1('0x1e')]],'as':_0x5709ef['as'],'attributes':_0x5709ef[_0x97c1('0x1c')],'include':_0x5709ef[_0x97c1('0x1f')]?_[_0x97c1('0x20')](_0x5709ef[_0x97c1('0x1f')],function(_0x3c6cd2){return{'model':db[_0x3c6cd2['model']],'as':_0x3c6cd2['as'],'attributes':_0x3c6cd2[_0x97c1('0x1c')],'include':_0x3c6cd2[_0x97c1('0x1f')]?_[_0x97c1('0x20')](_0x3c6cd2['include'],function(_0x509135){return{'model':db[_0x509135[_0x97c1('0x1e')]],'as':_0x509135['as'],'attributes':_0x509135[_0x97c1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x97c1('0xe')](function(_0x1d2b87){logger[_0x97c1('0xf')]('ShowVoiceQueue',_0x444834);logger[_0x97c1('0x11')](_0x97c1('0x22'),_0x444834,JSON[_0x97c1('0x13')](_0x1d2b87));_0x570caf(_0x1d2b87);})[_0x97c1('0x18')](function(_0x5150c4){logger['error'](_0x97c1('0x22'),_0x5150c4[_0x97c1('0x17')],_0x444834);_0x2e8493(_0x309ae5[_0x97c1('0x14')](0x1f4,_0x5150c4[_0x97c1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 459a435..fa55286 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 _0xaa75=['update','removeListener','voiceQueue:','./voiceQueue.events','save'];(function(_0x2a5b44,_0x19c87f){var _0x1aa74f=function(_0x5ad5ff){while(--_0x5ad5ff){_0x2a5b44['push'](_0x2a5b44['shift']());}};_0x1aa74f(++_0x19c87f);}(_0xaa75,0x18e));var _0x5aa7=function(_0x4f95b5,_0x3d88a1){_0x4f95b5=_0x4f95b5-0x0;var _0x2b14aa=_0xaa75[_0x4f95b5];return _0x2b14aa;};'use strict';var VoiceQueueEvents=require(_0x5aa7('0x0'));var events=[_0x5aa7('0x1'),'remove',_0x5aa7('0x2')];function createListener(_0x816c8,_0x54e3df){return function(_0x3150c7){_0x54e3df['emit'](_0x816c8,_0x3150c7);};}function removeListener(_0x30dac1,_0x45f2e8){return function(){VoiceQueueEvents[_0x5aa7('0x3')](_0x30dac1,_0x45f2e8);};}exports['register']=function(_0x34accb){for(var _0x4606f3=0x0,_0x1d652f=events['length'];_0x4606f3<_0x1d652f;_0x4606f3++){var _0x3ab70c=events[_0x4606f3];var _0x27aae7=createListener(_0x5aa7('0x4')+_0x3ab70c,_0x34accb);VoiceQueueEvents['on'](_0x3ab70c,_0x27aae7);}}; \ No newline at end of file +var _0x1142=['register','length','voiceQueue:','./voiceQueue.events','save','remove','emit','removeListener'];(function(_0x1da811,_0x2e30db){var _0x53858b=function(_0x4e70ce){while(--_0x4e70ce){_0x1da811['push'](_0x1da811['shift']());}};_0x53858b(++_0x2e30db);}(_0x1142,0x73));var _0x2114=function(_0x1e3a4c,_0x3562e6){_0x1e3a4c=_0x1e3a4c-0x0;var _0x163028=_0x1142[_0x1e3a4c];return _0x163028;};'use strict';var VoiceQueueEvents=require(_0x2114('0x0'));var events=[_0x2114('0x1'),_0x2114('0x2'),'update'];function createListener(_0x559b6b,_0x48c452){return function(_0x189119){_0x48c452[_0x2114('0x3')](_0x559b6b,_0x189119);};}function removeListener(_0xaf3f00,_0x2ab642){return function(){VoiceQueueEvents[_0x2114('0x4')](_0xaf3f00,_0x2ab642);};}exports[_0x2114('0x5')]=function(_0x14efd2){for(var _0x5af666=0x0,_0x2c8810=events[_0x2114('0x6')];_0x5af666<_0x2c8810;_0x5af666++){var _0x2130e2=events[_0x5af666];var _0x282686=createListener(_0x2114('0x7')+_0x2130e2,_0x14efd2);VoiceQueueEvents['on'](_0x2130e2,_0x282686);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 1b40daa..6057983 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 _0x3ab6=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','post','put','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1eb698,_0x1dd3e3){var _0x42e0d0=function(_0x4cfcbc){while(--_0x4cfcbc){_0x1eb698['push'](_0x1eb698['shift']());}};_0x42e0d0(++_0x1dd3e3);}(_0x3ab6,0xa2));var _0x63ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ab6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x63ab('0x0'));var util=require(_0x63ab('0x1'));var path=require(_0x63ab('0x2'));var timeout=require(_0x63ab('0x3'));var express=require(_0x63ab('0x4'));var router=express[_0x63ab('0x5')]();var fs_extra=require(_0x63ab('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x63ab('0x7'));var config=require(_0x63ab('0x8'));var controller=require('./voiceQueueReport.controller');router[_0x63ab('0x9')]('/',auth[_0x63ab('0xa')](),controller[_0x63ab('0xb')]);router[_0x63ab('0x9')](_0x63ab('0xc'),auth[_0x63ab('0xa')](),controller[_0x63ab('0xd')]);router[_0x63ab('0x9')](_0x63ab('0xe'),auth[_0x63ab('0xa')](),controller[_0x63ab('0xf')]);router[_0x63ab('0x9')](_0x63ab('0x10'),auth[_0x63ab('0xa')](),controller['show']);router[_0x63ab('0x11')]('/',auth[_0x63ab('0xa')](),controller['create']);router[_0x63ab('0x12')]('/:id',auth[_0x63ab('0xa')](),controller[_0x63ab('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x63ab('0x14')]=router; \ No newline at end of file +var _0x7624=['/describe','describe','getVoiceQueuesReport','/:id','show','update','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceQueueReport.controller','get','isAuthenticated','index'];(function(_0x1f864e,_0x5c4ef7){var _0x2895bf=function(_0x3e654e){while(--_0x3e654e){_0x1f864e['push'](_0x1f864e['shift']());}};_0x2895bf(++_0x5c4ef7);}(_0x7624,0x1e7));var _0x4762=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7624[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4762('0x0'));var express=require(_0x4762('0x1'));var router=express[_0x4762('0x2')]();var fs_extra=require(_0x4762('0x3'));var auth=require(_0x4762('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4762('0x5'));router[_0x4762('0x6')]('/',auth[_0x4762('0x7')](),controller[_0x4762('0x8')]);router[_0x4762('0x6')](_0x4762('0x9'),auth[_0x4762('0x7')](),controller[_0x4762('0xa')]);router[_0x4762('0x6')]('/index',auth[_0x4762('0x7')](),controller[_0x4762('0xb')]);router['get'](_0x4762('0xc'),auth[_0x4762('0x7')](),controller[_0x4762('0xd')]);router['post']('/',auth[_0x4762('0x7')](),controller['create']);router['put'](_0x4762('0xc'),auth[_0x4762('0x7')](),controller[_0x4762('0xe')]);router['delete'](_0x4762('0xc'),auth[_0x4762('0x7')](),controller['destroy']);module[_0x4762('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 7937a93..34429ed 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 _0x7448=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x11d3af,_0x219920){var _0x5cf035=function(_0x138d0f){while(--_0x138d0f){_0x11d3af['push'](_0x11d3af['shift']());}};_0x5cf035(++_0x219920);}(_0x7448,0x1e3));var _0x8744=function(_0x3ccc5f,_0x17ba72){_0x3ccc5f=_0x3ccc5f-0x0;var _0x15de37=_0x7448[_0x3ccc5f];return _0x15de37;};'use strict';var Sequelize=require(_0x8744('0x0'));var moment=require(_0x8744('0x1'));module['exports']={'type':{'type':Sequelize[_0x8744('0x2')]},'uniqueid':{'type':Sequelize[_0x8744('0x2')]},'calleridnum':{'type':Sequelize[_0x8744('0x2')]},'calleridname':{'type':Sequelize[_0x8744('0x2')]},'queue':{'type':Sequelize[_0x8744('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x8744('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x621041){var _0x8d5ff1=moment(_0x621041);var _0x1bda8c=moment(this[_0x8744('0x4')](_0x8744('0x5')))[_0x8744('0x6')](_0x8744('0x7'));var _0x3e066e=_0x8d5ff1[_0x8744('0x8')](_0x1bda8c,'seconds');this[_0x8744('0x9')](_0x8744('0xa'),_0x621041);this[_0x8744('0x9')](_0x8744('0xb'),_0x3e066e||null);}},'position':{'type':Sequelize[_0x8744('0xc')]},'count':{'type':Sequelize[_0x8744('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x8744('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8744('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x8744('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8744('0x3')]},'queuecallerexit':{'type':Sequelize[_0x8744('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x8744('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x8744('0xc')]},'channel':{'type':Sequelize[_0x8744('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8744('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8744('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8744('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8744('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8744('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8744('0x2')],'comment':_0x8744('0xe')},'transferexten':{'type':Sequelize[_0x8744('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x8744('0x2')]},'secondDisposition':{'type':Sequelize[_0x8744('0x2')]},'thirdDisposition':{'type':Sequelize[_0x8744('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x8744('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x384f=['diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3c66e5,_0xab5ea3){var _0x678a=function(_0xd43f50){while(--_0xd43f50){_0x3c66e5['push'](_0x3c66e5['shift']());}};_0x678a(++_0xab5ea3);}(_0x384f,0xbc));var _0xf384=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x384f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf384('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf384('0x1')]},'calleridnum':{'type':Sequelize[_0xf384('0x1')]},'calleridname':{'type':Sequelize[_0xf384('0x1')]},'queue':{'type':Sequelize[_0xf384('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0xf384('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0xf384('0x2')],'set':function(_0x3657fd){var _0xf23b4f=moment(_0x3657fd);var _0x2edb98=moment(this[_0xf384('0x3')](_0xf384('0x4')))[_0xf384('0x5')](_0xf384('0x6'));var _0x5f46ef=_0xf23b4f[_0xf384('0x7')](_0x2edb98,_0xf384('0x8'));this[_0xf384('0x9')]('queuecallerleaveAt',_0x3657fd);this[_0xf384('0x9')](_0xf384('0xa'),_0x5f46ef||null);}},'position':{'type':Sequelize[_0xf384('0xb')]},'count':{'type':Sequelize[_0xf384('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xf384('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xf384('0x2')]},'queuecallercomplete':{'type':Sequelize[_0xf384('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xf384('0x2')]},'queuecallerexit':{'type':Sequelize[_0xf384('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xf384('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0xf384('0x1')],'comment':_0xf384('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xf384('0x1')]},'connectedlinenum':{'type':Sequelize[_0xf384('0x1')]},'connectedlinename':{'type':Sequelize[_0xf384('0x1')]},'accountcode':{'type':Sequelize[_0xf384('0x1')]},'context':{'type':Sequelize[_0xf384('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf384('0x1')]},'holdtime':{'type':Sequelize[_0xf384('0xb')]},'mohtime':{'type':Sequelize[_0xf384('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xf384('0x1')]},'transfer':{'type':Sequelize[_0xf384('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf384('0x1')],'comment':_0xf384('0xe')},'transferexten':{'type':Sequelize[_0xf384('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xf384('0x1')]},'secondDisposition':{'type':Sequelize[_0xf384('0x1')]},'thirdDisposition':{'type':Sequelize[_0xf384('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xf384('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 640f021..ddcad67 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 _0x28ee=['apply','reject','save','update','then','error','name','send','index','map','VoiceQueueReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','destroy','describe','rawAttributes','nolimit','getVoiceQueuesReport','fast-json-patch','request-promise','moment','bluebird','util','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','../../config/license/util','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','end','status','count','limit','Content-Range','json'];(function(_0x12a86f,_0x26527f){var _0x352c8a=function(_0x5c9df8){while(--_0x5c9df8){_0x12a86f['push'](_0x12a86f['shift']());}};_0x352c8a(++_0x26527f);}(_0x28ee,0xc7));var _0xe28e=function(_0x24fc2c,_0x47b500){_0x24fc2c=_0x24fc2c-0x0;var _0x483de4=_0x28ee[_0x24fc2c];return _0x483de4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe28e('0x0'));var rp=require(_0xe28e('0x1'));var moment=require(_0xe28e('0x2'));var BPromise=require(_0xe28e('0x3'));var Mustache=require('mustache');var util=require(_0xe28e('0x4'));var path=require('path');var sox=require(_0xe28e('0x5'));var csv=require(_0xe28e('0x6'));var ejs=require(_0xe28e('0x7'));var fs=require('fs');var fs_extra=require(_0xe28e('0x8'));var _=require(_0xe28e('0x9'));var squel=require(_0xe28e('0xa'));var crypto=require('crypto');var jsforce=require(_0xe28e('0xb'));var deskjs=require(_0xe28e('0xc'));var toCsv=require(_0xe28e('0x6'));var querystring=require(_0xe28e('0xd'));var Papa=require(_0xe28e('0xe'));var Redis=require(_0xe28e('0xf'));var authService=require(_0xe28e('0x10'));var qs=require(_0xe28e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe28e('0x12'));var logger=require(_0xe28e('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe28e('0x14'));var db=require('../../mysqldb')['db'];config[_0xe28e('0x15')]=_[_0xe28e('0x16')](config[_0xe28e('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xe28e('0x17'))(new Redis(config[_0xe28e('0x15')]));require(_0xe28e('0x18'))[_0xe28e('0x19')](socket);function respondWithStatusCode(_0x13f03e,_0x2f1b60){_0x2f1b60=_0x2f1b60||0xcc;return function(_0x33d911){if(_0x33d911){return _0x13f03e['sendStatus'](_0x2f1b60);}return _0x13f03e['status'](_0x2f1b60)[_0xe28e('0x1a')]();};}function respondWithResult(_0x36597c,_0x49db16){_0x49db16=_0x49db16||0xc8;return function(_0x1f7885){if(_0x1f7885){return _0x36597c[_0xe28e('0x1b')](_0x49db16)['json'](_0x1f7885);}};}function respondWithFilteredResult(_0x113bd0,_0x4aa100){return function(_0x4159dd){if(_0x4159dd){var _0x1e86ff=typeof _0x4aa100['offset']==='undefined'&&typeof _0x4aa100['limit']==='undefined';var _0x288734=_0x4159dd[_0xe28e('0x1c')];var _0x84f01e=_0x1e86ff?0x0:_0x4aa100['offset'];var _0x469e6a=_0x1e86ff?_0x4159dd['count']:_0x4aa100['offset']+_0x4aa100[_0xe28e('0x1d')];var _0x518979;if(_0x469e6a>=_0x288734){_0x469e6a=_0x288734;_0x518979=0xc8;}else{_0x518979=0xce;}_0x113bd0[_0xe28e('0x1b')](_0x518979);return _0x113bd0['set'](_0xe28e('0x1e'),_0x84f01e+'-'+_0x469e6a+'/'+_0x288734)[_0xe28e('0x1f')](_0x4159dd);}return null;};}function patchUpdates(_0x34454d){return function(_0x1f338f){try{jsonpatch[_0xe28e('0x20')](_0x1f338f,_0x34454d,!![]);}catch(_0xec8826){return BPromise[_0xe28e('0x21')](_0xec8826);}return _0x1f338f[_0xe28e('0x22')]();};}function saveUpdates(_0x1fac33,_0xce387){return function(_0x14ec98){if(_0x14ec98){return _0x14ec98[_0xe28e('0x23')](_0x1fac33)[_0xe28e('0x24')](function(_0x1e82e8){return _0x1e82e8;});}return null;};}function removeEntity(_0x4bf59f,_0x52248b){return function(_0x561588){if(_0x561588){return _0x561588['destroy']()[_0xe28e('0x24')](function(){_0x4bf59f[_0xe28e('0x1b')](0xcc)[_0xe28e('0x1a')]();});}};}function handleEntityNotFound(_0x22865a,_0x176fe9){return function(_0x8f872b){if(!_0x8f872b){_0x22865a['sendStatus'](0x194);}return _0x8f872b;};}function handleError(_0xbae6e9,_0x30e7fa){_0x30e7fa=_0x30e7fa||0x1f4;return function(_0x553108){logger[_0xe28e('0x25')](_0x553108['stack']);if(_0x553108[_0xe28e('0x26')]){delete _0x553108[_0xe28e('0x26')];}_0xbae6e9[_0xe28e('0x1b')](_0x30e7fa)[_0xe28e('0x27')](_0x553108);};}exports[_0xe28e('0x28')]=function(_0x349bc5,_0x22ee73){var _0x460ab2={},_0x2f227a={},_0x1235f={'count':0x0,'rows':[]};var _0x4d7bd9=_[_0xe28e('0x29')](db[_0xe28e('0x2a')]['rawAttributes'],function(_0x257492){return{'name':_0x257492[_0xe28e('0x2b')],'type':_0x257492['type'][_0xe28e('0x2c')]};});_0x2f227a[_0xe28e('0x2d')]=_[_0xe28e('0x29')](_0x4d7bd9,_0xe28e('0x26'));_0x2f227a[_0xe28e('0x2e')]=_[_0xe28e('0x2f')](_0x349bc5[_0xe28e('0x2e')]);_0x2f227a[_0xe28e('0x30')]=_[_0xe28e('0x31')](_0x2f227a[_0xe28e('0x2d')],_0x2f227a[_0xe28e('0x2e')]);_0x460ab2[_0xe28e('0x32')]=_['intersection'](_0x2f227a[_0xe28e('0x2d')],qs[_0xe28e('0x33')](_0x349bc5['query'][_0xe28e('0x33')]));_0x460ab2[_0xe28e('0x32')]=_0x460ab2[_0xe28e('0x32')][_0xe28e('0x34')]?_0x460ab2['attributes']:_0x2f227a[_0xe28e('0x2d')];if(!_0x349bc5[_0xe28e('0x2e')][_0xe28e('0x35')]('nolimit')){_0x460ab2[_0xe28e('0x1d')]=qs[_0xe28e('0x1d')](_0x349bc5[_0xe28e('0x2e')][_0xe28e('0x1d')]);_0x460ab2[_0xe28e('0x36')]=qs[_0xe28e('0x36')](_0x349bc5[_0xe28e('0x2e')][_0xe28e('0x36')]);}_0x460ab2[_0xe28e('0x37')]=qs[_0xe28e('0x38')](_0x349bc5[_0xe28e('0x2e')][_0xe28e('0x38')]);_0x460ab2[_0xe28e('0x39')]=qs['filters'](_[_0xe28e('0x3a')](_0x349bc5['query'],_0x2f227a[_0xe28e('0x30')]),_0x4d7bd9);if(_0x349bc5[_0xe28e('0x2e')][_0xe28e('0x3b')]){_0x460ab2['where']=_['merge'](_0x460ab2[_0xe28e('0x39')],{'$or':_[_0xe28e('0x29')](_0x4d7bd9,function(_0xd1d4ac){if(_0xd1d4ac['type']!=='VIRTUAL'){var _0x38bed2={};_0x38bed2[_0xd1d4ac[_0xe28e('0x26')]]={'$like':'%'+_0x349bc5['query'][_0xe28e('0x3b')]+'%'};return _0x38bed2;}})});}_0x460ab2=_[_0xe28e('0x3c')]({},_0x460ab2,_0x349bc5['options']);var _0x2af6c0={'where':_0x460ab2[_0xe28e('0x39')]};return db[_0xe28e('0x2a')]['count'](_0x2af6c0)[_0xe28e('0x24')](function(_0x49b870){_0x1235f[_0xe28e('0x1c')]=_0x49b870;if(_0x349bc5[_0xe28e('0x2e')][_0xe28e('0x3d')]){_0x460ab2[_0xe28e('0x3e')]=[{'all':!![]}];}return db[_0xe28e('0x2a')][_0xe28e('0x3f')](_0x460ab2);})[_0xe28e('0x24')](function(_0x3b08ee){_0x1235f[_0xe28e('0x40')]=_0x3b08ee;return _0x1235f;})[_0xe28e('0x24')](respondWithFilteredResult(_0x22ee73,_0x460ab2))[_0xe28e('0x41')](handleError(_0x22ee73,null));};exports[_0xe28e('0x42')]=function(_0x55c16d,_0x50860f){var _0x39f925={'raw':![],'where':{'id':_0x55c16d[_0xe28e('0x43')]['id']}},_0x40053e={};_0x40053e[_0xe28e('0x2d')]=_[_0xe28e('0x2f')](db[_0xe28e('0x2a')]['rawAttributes']);_0x40053e[_0xe28e('0x2e')]=_[_0xe28e('0x2f')](_0x55c16d[_0xe28e('0x2e')]);_0x40053e['filters']=_['intersection'](_0x40053e[_0xe28e('0x2d')],_0x40053e[_0xe28e('0x2e')]);_0x39f925['attributes']=_[_0xe28e('0x31')](_0x40053e['model'],qs[_0xe28e('0x33')](_0x55c16d[_0xe28e('0x2e')]['fields']));_0x39f925[_0xe28e('0x32')]=_0x39f925['attributes'][_0xe28e('0x34')]?_0x39f925[_0xe28e('0x32')]:_0x40053e['model'];if(_0x55c16d['query'][_0xe28e('0x3d')]){_0x39f925[_0xe28e('0x3e')]=[{'all':!![]}];}_0x39f925=_[_0xe28e('0x3c')]({},_0x39f925,_0x55c16d[_0xe28e('0x44')]);return db[_0xe28e('0x2a')]['find'](_0x39f925)[_0xe28e('0x24')](handleEntityNotFound(_0x50860f,null))[_0xe28e('0x24')](respondWithResult(_0x50860f,null))[_0xe28e('0x41')](handleError(_0x50860f,null));};exports['create']=function(_0x347a9c,_0x10187f){return db[_0xe28e('0x2a')][_0xe28e('0x45')](_0x347a9c[_0xe28e('0x46')],{})[_0xe28e('0x24')](respondWithResult(_0x10187f,0xc9))['catch'](handleError(_0x10187f,null));};exports[_0xe28e('0x23')]=function(_0x3928c0,_0x97918){if(_0x3928c0[_0xe28e('0x46')]['id']){delete _0x3928c0[_0xe28e('0x46')]['id'];}return db[_0xe28e('0x2a')][_0xe28e('0x47')]({'where':{'id':_0x3928c0['params']['id']}})[_0xe28e('0x24')](handleEntityNotFound(_0x97918,null))['then'](saveUpdates(_0x3928c0[_0xe28e('0x46')],null))[_0xe28e('0x24')](respondWithResult(_0x97918,null))[_0xe28e('0x41')](handleError(_0x97918,null));};exports[_0xe28e('0x48')]=function(_0x502c26,_0x298bd2){return db['VoiceQueueReport'][_0xe28e('0x47')]({'where':{'id':_0x502c26[_0xe28e('0x43')]['id']}})[_0xe28e('0x24')](handleEntityNotFound(_0x298bd2,null))[_0xe28e('0x24')](removeEntity(_0x298bd2,null))[_0xe28e('0x41')](handleError(_0x298bd2,null));};exports['describe']=function(_0x3f7303,_0x3a4d28){return db[_0xe28e('0x2a')][_0xe28e('0x49')]()['then'](respondWithResult(_0x3a4d28,null))[_0xe28e('0x41')](handleError(_0x3a4d28,null));};exports['getVoiceQueuesReport']=function(_0x11bbe2,_0x235c4d){var _0x1cba8f={},_0x5aeb4e={},_0x42f855={'count':0x0,'rows':[]};_0x5aeb4e[_0xe28e('0x2d')]=_[_0xe28e('0x2f')](db[_0xe28e('0x2a')][_0xe28e('0x4a')]);_0x5aeb4e[_0xe28e('0x2e')]=_[_0xe28e('0x2f')](_0x11bbe2['query']);_0x5aeb4e[_0xe28e('0x30')]=_['intersection'](_0x5aeb4e[_0xe28e('0x2d')],_0x5aeb4e[_0xe28e('0x2e')]);_0x1cba8f[_0xe28e('0x32')]=_[_0xe28e('0x31')](_0x5aeb4e[_0xe28e('0x2d')],qs[_0xe28e('0x33')](_0x11bbe2[_0xe28e('0x2e')]['fields']));_0x1cba8f['attributes']=_0x1cba8f[_0xe28e('0x32')][_0xe28e('0x34')]?_0x1cba8f[_0xe28e('0x32')]:_0x5aeb4e[_0xe28e('0x2d')];if(!_0x11bbe2[_0xe28e('0x2e')][_0xe28e('0x35')](_0xe28e('0x4b'))){_0x1cba8f['limit']=qs['limit'](_0x11bbe2[_0xe28e('0x2e')]['limit']);_0x1cba8f[_0xe28e('0x36')]=qs[_0xe28e('0x36')](_0x11bbe2[_0xe28e('0x2e')][_0xe28e('0x36')]);}_0x1cba8f[_0xe28e('0x37')]=qs['sort'](_0x11bbe2['query']['sort']);_0x1cba8f['where']=qs[_0xe28e('0x30')](_[_0xe28e('0x3a')](_0x11bbe2[_0xe28e('0x2e')],_0x5aeb4e[_0xe28e('0x30')]));if(_0x11bbe2[_0xe28e('0x2e')][_0xe28e('0x3b')]){_0x1cba8f[_0xe28e('0x39')]=_[_0xe28e('0x3c')](_0x1cba8f['where'],{'$or':_['map'](_0x1cba8f[_0xe28e('0x32')],function(_0x5b1159){var _0x5d2086={};_0x5d2086[_0x5b1159]={'$like':'%'+_0x11bbe2[_0xe28e('0x2e')][_0xe28e('0x3b')]+'%'};return _0x5d2086;})});}_0x1cba8f=_[_0xe28e('0x3c')]({},_0x1cba8f,_0x11bbe2['options']);var _0x28739c={'where':_0x1cba8f['where']};return db[_0xe28e('0x2a')]['count'](_0x28739c)[_0xe28e('0x24')](function(_0x9518c3){_0x42f855['count']=_0x9518c3;if(_0x11bbe2[_0xe28e('0x2e')]['includeAll']){_0x1cba8f[_0xe28e('0x3e')]=[{'all':!![]}];}return db[_0xe28e('0x2a')]['findAll'](_0x1cba8f);})['then'](function(_0x29d97f){_0x42f855[_0xe28e('0x40')]=_0x29d97f;return _0x42f855;})[_0xe28e('0x24')](respondWithFilteredResult(_0x235c4d,_0x1cba8f,_0xe28e('0x4c')))[_0xe28e('0x41')](handleError(_0x235c4d,null,_0xe28e('0x4c')));}; \ No newline at end of file +var _0x8699=['find','create','body','catch','describe','order','sort','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','sendStatus','error','stack','name','map','VoiceQueueReport','fieldName','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','merge','type','VIRTUAL','filter','options','include','show','params','rawAttributes','includeAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8699,0x102));var _0x9869=function(_0x1614aa,_0x15f8c6){_0x1614aa=_0x1614aa-0x0;var _0x11e4bf=_0x8699[_0x1614aa];return _0x11e4bf;};'use strict';var emlformat=require(_0x9869('0x0'));var rimraf=require(_0x9869('0x1'));var zipdir=require(_0x9869('0x2'));var jsonpatch=require(_0x9869('0x3'));var rp=require(_0x9869('0x4'));var moment=require(_0x9869('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9869('0x6'));var path=require(_0x9869('0x7'));var sox=require('sox');var csv=require(_0x9869('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9869('0x9'));var _=require(_0x9869('0xa'));var squel=require(_0x9869('0xb'));var crypto=require(_0x9869('0xc'));var jsforce=require(_0x9869('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9869('0x8'));var querystring=require(_0x9869('0xe'));var Papa=require(_0x9869('0xf'));var Redis=require(_0x9869('0x10'));var authService=require(_0x9869('0x11'));var qs=require(_0x9869('0x12'));var as=require(_0x9869('0x13'));var hardwareService=require(_0x9869('0x14'));var logger=require(_0x9869('0x15'))('api');var utils=require(_0x9869('0x16'));var config=require(_0x9869('0x17'));var licenseUtil=require(_0x9869('0x18'));var db=require(_0x9869('0x19'))['db'];config[_0x9869('0x1a')]=_['defaults'](config[_0x9869('0x1a')],{'host':_0x9869('0x1b'),'port':0x18eb});var socket=require(_0x9869('0x1c'))(new Redis(config[_0x9869('0x1a')]));require(_0x9869('0x1d'))[_0x9869('0x1e')](socket);function respondWithStatusCode(_0x11f081,_0x36f004){_0x36f004=_0x36f004||0xcc;return function(_0x1f2dca){if(_0x1f2dca){return _0x11f081['sendStatus'](_0x36f004);}return _0x11f081['status'](_0x36f004)[_0x9869('0x1f')]();};}function respondWithResult(_0x5adc17,_0x27abf3){_0x27abf3=_0x27abf3||0xc8;return function(_0x2e45ba){if(_0x2e45ba){return _0x5adc17[_0x9869('0x20')](_0x27abf3)[_0x9869('0x21')](_0x2e45ba);}};}function respondWithFilteredResult(_0x314acb,_0x1b4fb7){return function(_0x325307){if(_0x325307){var _0x45aeaf=typeof _0x1b4fb7[_0x9869('0x22')]===_0x9869('0x23')&&typeof _0x1b4fb7['limit']===_0x9869('0x23');var _0x3680ec=_0x325307[_0x9869('0x24')];var _0x2c70e3=_0x45aeaf?0x0:_0x1b4fb7[_0x9869('0x22')];var _0x4e931d=_0x45aeaf?_0x325307['count']:_0x1b4fb7[_0x9869('0x22')]+_0x1b4fb7[_0x9869('0x25')];var _0x5abdb2;if(_0x4e931d>=_0x3680ec){_0x4e931d=_0x3680ec;_0x5abdb2=0xc8;}else{_0x5abdb2=0xce;}_0x314acb[_0x9869('0x20')](_0x5abdb2);return _0x314acb[_0x9869('0x26')]('Content-Range',_0x2c70e3+'-'+_0x4e931d+'/'+_0x3680ec)['json'](_0x325307);}return null;};}function patchUpdates(_0x4ddd84){return function(_0x3f7b52){try{jsonpatch[_0x9869('0x27')](_0x3f7b52,_0x4ddd84,!![]);}catch(_0x200f25){return BPromise['reject'](_0x200f25);}return _0x3f7b52[_0x9869('0x28')]();};}function saveUpdates(_0x308cd9,_0x18b848){return function(_0x428ca6){if(_0x428ca6){return _0x428ca6[_0x9869('0x29')](_0x308cd9)[_0x9869('0x2a')](function(_0x27ba29){return _0x27ba29;});}return null;};}function removeEntity(_0x28fa4f,_0x19a5f7){return function(_0xebe87a){if(_0xebe87a){return _0xebe87a[_0x9869('0x2b')]()[_0x9869('0x2a')](function(){_0x28fa4f[_0x9869('0x20')](0xcc)[_0x9869('0x1f')]();});}};}function handleEntityNotFound(_0x17bc1d,_0x3af627){return function(_0x2fdd73){if(!_0x2fdd73){_0x17bc1d[_0x9869('0x2c')](0x194);}return _0x2fdd73;};}function handleError(_0x5d4fac,_0x4f834e){_0x4f834e=_0x4f834e||0x1f4;return function(_0xe8b577){logger[_0x9869('0x2d')](_0xe8b577[_0x9869('0x2e')]);if(_0xe8b577[_0x9869('0x2f')]){delete _0xe8b577[_0x9869('0x2f')];}_0x5d4fac['status'](_0x4f834e)['send'](_0xe8b577);};}exports['index']=function(_0x502ee7,_0x34e42d){var _0x233fc2={},_0x30ac9a={},_0x9ca38={'count':0x0,'rows':[]};var _0x5cbe11=_[_0x9869('0x30')](db[_0x9869('0x31')]['rawAttributes'],function(_0x3a0104){return{'name':_0x3a0104[_0x9869('0x32')],'type':_0x3a0104['type'][_0x9869('0x33')]};});_0x30ac9a['model']=_['map'](_0x5cbe11,_0x9869('0x2f'));_0x30ac9a['query']=_[_0x9869('0x34')](_0x502ee7[_0x9869('0x35')]);_0x30ac9a[_0x9869('0x36')]=_['intersection'](_0x30ac9a[_0x9869('0x37')],_0x30ac9a['query']);_0x233fc2['attributes']=_[_0x9869('0x38')](_0x30ac9a[_0x9869('0x37')],qs['fields'](_0x502ee7[_0x9869('0x35')][_0x9869('0x39')]));_0x233fc2['attributes']=_0x233fc2[_0x9869('0x3a')][_0x9869('0x3b')]?_0x233fc2[_0x9869('0x3a')]:_0x30ac9a['model'];if(!_0x502ee7['query'][_0x9869('0x3c')](_0x9869('0x3d'))){_0x233fc2[_0x9869('0x25')]=qs['limit'](_0x502ee7['query'][_0x9869('0x25')]);_0x233fc2[_0x9869('0x22')]=qs[_0x9869('0x22')](_0x502ee7['query']['offset']);}_0x233fc2['order']=qs['sort'](_0x502ee7[_0x9869('0x35')]['sort']);_0x233fc2[_0x9869('0x3e')]=qs['filters'](_[_0x9869('0x3f')](_0x502ee7[_0x9869('0x35')],_0x30ac9a[_0x9869('0x36')]),_0x5cbe11);if(_0x502ee7[_0x9869('0x35')]['filter']){_0x233fc2['where']=_[_0x9869('0x40')](_0x233fc2['where'],{'$or':_[_0x9869('0x30')](_0x5cbe11,function(_0x355491){if(_0x355491[_0x9869('0x41')]!==_0x9869('0x42')){var _0x5b6b2c={};_0x5b6b2c[_0x355491[_0x9869('0x2f')]]={'$like':'%'+_0x502ee7[_0x9869('0x35')][_0x9869('0x43')]+'%'};return _0x5b6b2c;}})});}_0x233fc2=_['merge']({},_0x233fc2,_0x502ee7[_0x9869('0x44')]);var _0x4c9f71={'where':_0x233fc2[_0x9869('0x3e')]};return db[_0x9869('0x31')][_0x9869('0x24')](_0x4c9f71)[_0x9869('0x2a')](function(_0xfe4db7){_0x9ca38[_0x9869('0x24')]=_0xfe4db7;if(_0x502ee7['query']['includeAll']){_0x233fc2[_0x9869('0x45')]=[{'all':!![]}];}return db[_0x9869('0x31')]['findAll'](_0x233fc2);})[_0x9869('0x2a')](function(_0x48c242){_0x9ca38['rows']=_0x48c242;return _0x9ca38;})[_0x9869('0x2a')](respondWithFilteredResult(_0x34e42d,_0x233fc2))['catch'](handleError(_0x34e42d,null));};exports[_0x9869('0x46')]=function(_0xdfc018,_0x464dcf){var _0x1d8283={'raw':![],'where':{'id':_0xdfc018[_0x9869('0x47')]['id']}},_0x10bc88={};_0x10bc88['model']=_['keys'](db['VoiceQueueReport'][_0x9869('0x48')]);_0x10bc88[_0x9869('0x35')]=_[_0x9869('0x34')](_0xdfc018[_0x9869('0x35')]);_0x10bc88[_0x9869('0x36')]=_[_0x9869('0x38')](_0x10bc88[_0x9869('0x37')],_0x10bc88[_0x9869('0x35')]);_0x1d8283[_0x9869('0x3a')]=_[_0x9869('0x38')](_0x10bc88['model'],qs['fields'](_0xdfc018['query'][_0x9869('0x39')]));_0x1d8283[_0x9869('0x3a')]=_0x1d8283[_0x9869('0x3a')]['length']?_0x1d8283[_0x9869('0x3a')]:_0x10bc88[_0x9869('0x37')];if(_0xdfc018[_0x9869('0x35')][_0x9869('0x49')]){_0x1d8283['include']=[{'all':!![]}];}_0x1d8283=_['merge']({},_0x1d8283,_0xdfc018['options']);return db[_0x9869('0x31')][_0x9869('0x4a')](_0x1d8283)[_0x9869('0x2a')](handleEntityNotFound(_0x464dcf,null))['then'](respondWithResult(_0x464dcf,null))['catch'](handleError(_0x464dcf,null));};exports[_0x9869('0x4b')]=function(_0x41e5c7,_0x4db351){return db[_0x9869('0x31')]['create'](_0x41e5c7[_0x9869('0x4c')],{})[_0x9869('0x2a')](respondWithResult(_0x4db351,0xc9))['catch'](handleError(_0x4db351,null));};exports['update']=function(_0x265d5b,_0x377fb9){if(_0x265d5b[_0x9869('0x4c')]['id']){delete _0x265d5b[_0x9869('0x4c')]['id'];}return db[_0x9869('0x31')]['find']({'where':{'id':_0x265d5b[_0x9869('0x47')]['id']}})[_0x9869('0x2a')](handleEntityNotFound(_0x377fb9,null))['then'](saveUpdates(_0x265d5b[_0x9869('0x4c')],null))[_0x9869('0x2a')](respondWithResult(_0x377fb9,null))[_0x9869('0x4d')](handleError(_0x377fb9,null));};exports[_0x9869('0x2b')]=function(_0x49e40d,_0x468203){return db[_0x9869('0x31')][_0x9869('0x4a')]({'where':{'id':_0x49e40d[_0x9869('0x47')]['id']}})[_0x9869('0x2a')](handleEntityNotFound(_0x468203,null))[_0x9869('0x2a')](removeEntity(_0x468203,null))[_0x9869('0x4d')](handleError(_0x468203,null));};exports[_0x9869('0x4e')]=function(_0x5ef67e,_0x1cf5a5){return db['VoiceQueueReport'][_0x9869('0x4e')]()[_0x9869('0x2a')](respondWithResult(_0x1cf5a5,null))[_0x9869('0x4d')](handleError(_0x1cf5a5,null));};exports['getVoiceQueuesReport']=function(_0x14b000,_0x55741c){var _0x27aaba={},_0x26e709={},_0x32334b={'count':0x0,'rows':[]};_0x26e709[_0x9869('0x37')]=_[_0x9869('0x34')](db[_0x9869('0x31')]['rawAttributes']);_0x26e709[_0x9869('0x35')]=_[_0x9869('0x34')](_0x14b000[_0x9869('0x35')]);_0x26e709['filters']=_[_0x9869('0x38')](_0x26e709[_0x9869('0x37')],_0x26e709[_0x9869('0x35')]);_0x27aaba['attributes']=_['intersection'](_0x26e709[_0x9869('0x37')],qs[_0x9869('0x39')](_0x14b000[_0x9869('0x35')][_0x9869('0x39')]));_0x27aaba[_0x9869('0x3a')]=_0x27aaba[_0x9869('0x3a')][_0x9869('0x3b')]?_0x27aaba[_0x9869('0x3a')]:_0x26e709[_0x9869('0x37')];if(!_0x14b000[_0x9869('0x35')]['hasOwnProperty'](_0x9869('0x3d'))){_0x27aaba[_0x9869('0x25')]=qs[_0x9869('0x25')](_0x14b000[_0x9869('0x35')][_0x9869('0x25')]);_0x27aaba[_0x9869('0x22')]=qs['offset'](_0x14b000[_0x9869('0x35')][_0x9869('0x22')]);}_0x27aaba[_0x9869('0x4f')]=qs[_0x9869('0x50')](_0x14b000['query'][_0x9869('0x50')]);_0x27aaba[_0x9869('0x3e')]=qs[_0x9869('0x36')](_['pick'](_0x14b000[_0x9869('0x35')],_0x26e709[_0x9869('0x36')]));if(_0x14b000[_0x9869('0x35')][_0x9869('0x43')]){_0x27aaba[_0x9869('0x3e')]=_[_0x9869('0x40')](_0x27aaba[_0x9869('0x3e')],{'$or':_[_0x9869('0x30')](_0x27aaba[_0x9869('0x3a')],function(_0x58c1b4){var _0x1c4a61={};_0x1c4a61[_0x58c1b4]={'$like':'%'+_0x14b000[_0x9869('0x35')][_0x9869('0x43')]+'%'};return _0x1c4a61;})});}_0x27aaba=_[_0x9869('0x40')]({},_0x27aaba,_0x14b000[_0x9869('0x44')]);var _0x3de37f={'where':_0x27aaba[_0x9869('0x3e')]};return db[_0x9869('0x31')]['count'](_0x3de37f)[_0x9869('0x2a')](function(_0x21de99){_0x32334b[_0x9869('0x24')]=_0x21de99;if(_0x14b000[_0x9869('0x35')][_0x9869('0x49')]){_0x27aaba[_0x9869('0x45')]=[{'all':!![]}];}return db[_0x9869('0x31')][_0x9869('0x51')](_0x27aaba);})[_0x9869('0x2a')](function(_0x56e76b){_0x32334b['rows']=_0x56e76b;return _0x32334b;})[_0x9869('0x2a')](respondWithFilteredResult(_0x55741c,_0x27aaba,_0x9869('0x52')))[_0x9869('0x4d')](handleError(_0x55741c,null,_0x9869('0x52')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index cbd9497..090d3d9 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 _0xeb3f=['remove','hasOwnProperty','hook','../../mysqldb','VoiceQueueReport','save','update'];(function(_0x53c33c,_0x27223d){var _0x277750=function(_0x3446fb){while(--_0x3446fb){_0x53c33c['push'](_0x53c33c['shift']());}};_0x277750(++_0x27223d);}(_0xeb3f,0x7a));var _0xfeb3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xeb3f[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xfeb3('0x0'))['db'][_0xfeb3('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfeb3('0x2'),'afterUpdate':_0xfeb3('0x3'),'afterDestroy':_0xfeb3('0x4')};function emitEvent(_0x1ebae1){return function(_0x1cd1e1,_0x137e09,_0xe17d8){VoiceQueueReportEvents['emit'](_0x1ebae1+':'+_0x1cd1e1['id'],_0x1cd1e1);VoiceQueueReportEvents['emit'](_0x1ebae1,_0x1cd1e1);_0xe17d8(null);};}for(var e in events){if(events[_0xfeb3('0x5')](e)){var event=events[e];VoiceQueueReport[_0xfeb3('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xf0e5=['hook','exports','events','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x222e27,_0x52e835){var _0xc79276=function(_0x3e4649){while(--_0x3e4649){_0x222e27['push'](_0x222e27['shift']());}};_0xc79276(++_0x52e835);}(_0xf0e5,0x1c9));var _0x5f0e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xf0e5[_0xefd519];return _0x4bb882;};'use strict';var EventEmitter=require(_0x5f0e('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5f0e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5f0e('0x2')};function emitEvent(_0x215fce){return function(_0x1d75a4,_0x5c79b0,_0x426e65){VoiceQueueReportEvents[_0x5f0e('0x3')](_0x215fce+':'+_0x1d75a4['id'],_0x1d75a4);VoiceQueueReportEvents[_0x5f0e('0x3')](_0x215fce,_0x1d75a4);_0x426e65(null);};}for(var e in events){if(events[_0x5f0e('0x4')](e)){var event=events[e];VoiceQueueReport[_0x5f0e('0x5')](e,emitEvent(event));}}module[_0x5f0e('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 801ee64..93ddd99 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 _0xf1b6=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','calleridnum'];(function(_0xcceb4e,_0x16b9cd){var _0x458bda=function(_0x2efa9c){while(--_0x2efa9c){_0xcceb4e['push'](_0xcceb4e['shift']());}};_0x458bda(++_0x16b9cd);}(_0xf1b6,0xff));var _0x6f1b=function(_0x5b3082,_0x55315b){_0x5b3082=_0x5b3082-0x0;var _0x5c376f=_0xf1b6[_0x5b3082];return _0x5c376f;};'use strict';var _=require(_0x6f1b('0x0'));var util=require(_0x6f1b('0x1'));var logger=require(_0x6f1b('0x2'))(_0x6f1b('0x3'));var moment=require(_0x6f1b('0x4'));var BPromise=require(_0x6f1b('0x5'));var rp=require(_0x6f1b('0x6'));var fs=require('fs');var path=require(_0x6f1b('0x7'));var rimraf=require(_0x6f1b('0x8'));var config=require(_0x6f1b('0x9'));var attributes=require(_0x6f1b('0xa'));module[_0x6f1b('0xb')]=function(_0x5993c8,_0x2a9c75){return _0x5993c8[_0x6f1b('0xc')](_0x6f1b('0xd'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x6f1b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4359=['calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid'];(function(_0x4e667a,_0x4c9819){var _0x4411f8=function(_0x422c43){while(--_0x422c43){_0x4e667a['push'](_0x4e667a['shift']());}};_0x4411f8(++_0x4c9819);}(_0x4359,0x155));var _0x9435=function(_0xc3db32,_0x489bce){_0xc3db32=_0xc3db32-0x0;var _0x4e67bf=_0x4359[_0xc3db32];return _0x4e67bf;};'use strict';var _=require(_0x9435('0x0'));var util=require(_0x9435('0x1'));var logger=require(_0x9435('0x2'))(_0x9435('0x3'));var moment=require(_0x9435('0x4'));var BPromise=require(_0x9435('0x5'));var rp=require(_0x9435('0x6'));var fs=require('fs');var path=require(_0x9435('0x7'));var rimraf=require(_0x9435('0x8'));var config=require(_0x9435('0x9'));var attributes=require(_0x9435('0xa'));module[_0x9435('0xb')]=function(_0x596218,_0x31f419){return _0x596218[_0x9435('0xc')](_0x9435('0xd'),attributes,{'tableName':_0x9435('0xe'),'paranoid':![],'indexes':[{'fields':[_0x9435('0xf')]},{'fields':[_0x9435('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index fa33857..1474926 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 _0xb1f4=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','GetVoiceQueueReport','VoiceQueueReport','options','where','limit','include','map','model','attributes','create','body','raw','CreateVoiceQueueReport','catch','update','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xb1f4,0x1a8));var _0x4b1f=function(_0x3a991c,_0x1dd8ec){_0x3a991c=_0x3a991c-0x0;var _0x4bf65c=_0xb1f4[_0x3a991c];return _0x4bf65c;};'use strict';var _=require(_0x4b1f('0x0'));var util=require(_0x4b1f('0x1'));var moment=require(_0x4b1f('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b1f('0x3'));var fs=require('fs');var Redis=require(_0x4b1f('0x4'));var db=require(_0x4b1f('0x5'))['db'];var utils=require(_0x4b1f('0x6'));var logger=require('../../config/logger')(_0x4b1f('0x7'));var config=require(_0x4b1f('0x8'));var jayson=require(_0x4b1f('0x9'));var client=jayson[_0x4b1f('0xa')][_0x4b1f('0xb')]({'port':0x232a});config[_0x4b1f('0xc')]=_[_0x4b1f('0xd')](config[_0x4b1f('0xc')],{'host':_0x4b1f('0xe'),'port':0x18eb});var socket=require(_0x4b1f('0xf'))(new Redis(config['redis']));require(_0x4b1f('0x10'))['register'](socket);function respondWithRpcPromise(_0x1a2d20,_0x20d51,_0x5c6f98){return new BPromise(function(_0x7875b2,_0x443707){return client[_0x4b1f('0x11')](_0x1a2d20,_0x5c6f98)[_0x4b1f('0x12')](function(_0x1e0233){logger[_0x4b1f('0x13')](_0x4b1f('0x14'),_0x20d51,'request\x20sent');logger[_0x4b1f('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x20d51,_0x4b1f('0x16'),JSON[_0x4b1f('0x17')](_0x1e0233));if(_0x1e0233[_0x4b1f('0x18')]){if(_0x1e0233[_0x4b1f('0x18')][_0x4b1f('0x19')]===0x1f4){logger[_0x4b1f('0x18')](_0x4b1f('0x14'),_0x20d51,_0x1e0233['error'][_0x4b1f('0x1a')]);return _0x443707(_0x1e0233['error'][_0x4b1f('0x1a')]);}logger[_0x4b1f('0x18')](_0x4b1f('0x14'),_0x20d51,_0x1e0233[_0x4b1f('0x18')][_0x4b1f('0x1a')]);return _0x7875b2(_0x1e0233[_0x4b1f('0x18')][_0x4b1f('0x1a')]);}else{logger[_0x4b1f('0x13')](_0x4b1f('0x14'),_0x20d51,_0x4b1f('0x16'));_0x7875b2(_0x1e0233['result']['message']);}})['catch'](function(_0x4a89a5){logger[_0x4b1f('0x18')](_0x4b1f('0x14'),_0x20d51,_0x4a89a5);_0x443707(_0x4a89a5);});});}exports[_0x4b1f('0x1b')]=function(_0x3f28fa){var _0x191e20=this;return new Promise(function(_0x2d8101,_0x468040){return db[_0x4b1f('0x1c')]['findAll']({'raw':_0x3f28fa[_0x4b1f('0x1d')]?_0x3f28fa['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f28fa[_0x4b1f('0x1d')]?_0x3f28fa[_0x4b1f('0x1d')][_0x4b1f('0x1e')]||null:null,'attributes':_0x3f28fa[_0x4b1f('0x1d')]?_0x3f28fa['options']['attributes']||null:null,'limit':_0x3f28fa[_0x4b1f('0x1d')]?_0x3f28fa['options'][_0x4b1f('0x1f')]||null:null,'include':_0x3f28fa['options']?_0x3f28fa['options'][_0x4b1f('0x20')]?_[_0x4b1f('0x21')](_0x3f28fa[_0x4b1f('0x1d')][_0x4b1f('0x20')],function(_0x1be198){return{'model':db[_0x1be198[_0x4b1f('0x22')]],'as':_0x1be198['as'],'attributes':_0x1be198[_0x4b1f('0x23')],'include':_0x1be198[_0x4b1f('0x20')]?_[_0x4b1f('0x21')](_0x1be198[_0x4b1f('0x20')],function(_0x4ec5e2){return{'model':db[_0x4ec5e2[_0x4b1f('0x22')]],'as':_0x4ec5e2['as'],'attributes':_0x4ec5e2[_0x4b1f('0x23')],'include':_0x4ec5e2['include']?_[_0x4b1f('0x21')](_0x4ec5e2[_0x4b1f('0x20')],function(_0x526988){return{'model':db[_0x526988[_0x4b1f('0x22')]],'as':_0x526988['as'],'attributes':_0x526988[_0x4b1f('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12d116){logger[_0x4b1f('0x13')](_0x4b1f('0x1b'),_0x3f28fa);logger['debug'](_0x4b1f('0x1b'),_0x3f28fa,JSON[_0x4b1f('0x17')](_0x12d116));_0x2d8101(_0x12d116);})['catch'](function(_0x412515){logger[_0x4b1f('0x18')]('GetVoiceQueueReport',_0x412515[_0x4b1f('0x1a')],_0x3f28fa);_0x468040(_0x191e20[_0x4b1f('0x18')](0x1f4,_0x412515[_0x4b1f('0x1a')]));});});};exports['CreateVoiceQueueReport']=function(_0x27e0d9){var _0x15c6d7=this;return new Promise(function(_0x5a6a57,_0x375d82){return db[_0x4b1f('0x1c')][_0x4b1f('0x24')](_0x27e0d9[_0x4b1f('0x25')],{'raw':_0x27e0d9[_0x4b1f('0x1d')]?_0x27e0d9[_0x4b1f('0x1d')][_0x4b1f('0x26')]===undefined?!![]:![]:!![]})['then'](function(_0x32f25b){logger[_0x4b1f('0x13')](_0x4b1f('0x27'),_0x27e0d9);logger[_0x4b1f('0x15')](_0x4b1f('0x27'),_0x27e0d9,JSON['stringify'](_0x32f25b));_0x5a6a57(_0x32f25b);})[_0x4b1f('0x28')](function(_0xb10b80){logger[_0x4b1f('0x18')](_0x4b1f('0x27'),_0xb10b80['message'],_0x27e0d9);_0x375d82(_0x15c6d7['error'](0x1f4,_0xb10b80[_0x4b1f('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x146a08){var _0x291673=this;return new Promise(function(_0x6f8a8,_0x5329ad){return db[_0x4b1f('0x1c')][_0x4b1f('0x29')](_0x146a08[_0x4b1f('0x25')],{'raw':_0x146a08['options']?_0x146a08[_0x4b1f('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x146a08['options']?_0x146a08[_0x4b1f('0x1d')][_0x4b1f('0x1e')]||null:null,'attributes':_0x146a08[_0x4b1f('0x1d')]?_0x146a08[_0x4b1f('0x1d')][_0x4b1f('0x23')]||null:null,'limit':_0x146a08[_0x4b1f('0x1d')]?_0x146a08['options'][_0x4b1f('0x1f')]||null:null})[_0x4b1f('0x12')](function(_0xcffdfc){logger[_0x4b1f('0x13')](_0x4b1f('0x2a'),_0x146a08);logger['debug'](_0x4b1f('0x2a'),_0x146a08,JSON['stringify'](_0xcffdfc));_0x6f8a8(_0xcffdfc);})['catch'](function(_0x535024){logger['error'](_0x4b1f('0x2a'),_0x535024[_0x4b1f('0x1a')],_0x146a08);_0x5329ad(_0x291673[_0x4b1f('0x18')](0x1f4,_0x535024[_0x4b1f('0x1a')]));});});}; \ No newline at end of file +var _0xa2f4=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','findAll','options','raw','attributes','limit','include','model','map','then','debug','CreateVoiceQueueReport','VoiceQueueReport','body','where','UpdateVoiceQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x414b44,_0x3b95a0){var _0x32fa6b=function(_0x109d96){while(--_0x109d96){_0x414b44['push'](_0x414b44['shift']());}};_0x32fa6b(++_0x3b95a0);}(_0xa2f4,0x130));var _0x4a2f=function(_0x46e1b3,_0x3567d1){_0x46e1b3=_0x46e1b3-0x0;var _0x2cc460=_0xa2f4[_0x46e1b3];return _0x2cc460;};'use strict';var _=require(_0x4a2f('0x0'));var util=require(_0x4a2f('0x1'));var moment=require('moment');var BPromise=require(_0x4a2f('0x2'));var rs=require(_0x4a2f('0x3'));var fs=require('fs');var Redis=require(_0x4a2f('0x4'));var db=require(_0x4a2f('0x5'))['db'];var utils=require(_0x4a2f('0x6'));var logger=require(_0x4a2f('0x7'))('rpc');var config=require(_0x4a2f('0x8'));var jayson=require(_0x4a2f('0x9'));var client=jayson[_0x4a2f('0xa')][_0x4a2f('0xb')]({'port':0x232a});config[_0x4a2f('0xc')]=_[_0x4a2f('0xd')](config['redis'],{'host':_0x4a2f('0xe'),'port':0x18eb});var socket=require(_0x4a2f('0xf'))(new Redis(config[_0x4a2f('0xc')]));require(_0x4a2f('0x10'))[_0x4a2f('0x11')](socket);function respondWithRpcPromise(_0x4cc517,_0x5da30f,_0x1b0e2c){return new BPromise(function(_0xc8aa64,_0x37ee9f){return client[_0x4a2f('0x12')](_0x4cc517,_0x1b0e2c)['then'](function(_0x5cee67){logger[_0x4a2f('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x5da30f,'request\x20sent');logger['debug'](_0x4a2f('0x14'),_0x5da30f,_0x4a2f('0x15'),JSON[_0x4a2f('0x16')](_0x5cee67));if(_0x5cee67['error']){if(_0x5cee67[_0x4a2f('0x17')][_0x4a2f('0x18')]===0x1f4){logger[_0x4a2f('0x17')](_0x4a2f('0x19'),_0x5da30f,_0x5cee67[_0x4a2f('0x17')][_0x4a2f('0x1a')]);return _0x37ee9f(_0x5cee67[_0x4a2f('0x17')][_0x4a2f('0x1a')]);}logger[_0x4a2f('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x5da30f,_0x5cee67['error'][_0x4a2f('0x1a')]);return _0xc8aa64(_0x5cee67[_0x4a2f('0x17')][_0x4a2f('0x1a')]);}else{logger[_0x4a2f('0x13')](_0x4a2f('0x19'),_0x5da30f,'request\x20sent');_0xc8aa64(_0x5cee67[_0x4a2f('0x1b')][_0x4a2f('0x1a')]);}})[_0x4a2f('0x1c')](function(_0x562ada){logger[_0x4a2f('0x17')](_0x4a2f('0x19'),_0x5da30f,_0x562ada);_0x37ee9f(_0x562ada);});});}exports[_0x4a2f('0x1d')]=function(_0x4a572d){var _0x2367d=this;return new Promise(function(_0xd601b2,_0x4d761a){return db['VoiceQueueReport'][_0x4a2f('0x1e')]({'raw':_0x4a572d[_0x4a2f('0x1f')]?_0x4a572d['options'][_0x4a2f('0x20')]===undefined?!![]:![]:!![],'where':_0x4a572d[_0x4a2f('0x1f')]?_0x4a572d[_0x4a2f('0x1f')]['where']||null:null,'attributes':_0x4a572d[_0x4a2f('0x1f')]?_0x4a572d[_0x4a2f('0x1f')][_0x4a2f('0x21')]||null:null,'limit':_0x4a572d['options']?_0x4a572d[_0x4a2f('0x1f')][_0x4a2f('0x22')]||null:null,'include':_0x4a572d[_0x4a2f('0x1f')]?_0x4a572d['options'][_0x4a2f('0x23')]?_['map'](_0x4a572d[_0x4a2f('0x1f')][_0x4a2f('0x23')],function(_0x3ff882){return{'model':db[_0x3ff882[_0x4a2f('0x24')]],'as':_0x3ff882['as'],'attributes':_0x3ff882[_0x4a2f('0x21')],'include':_0x3ff882[_0x4a2f('0x23')]?_[_0x4a2f('0x25')](_0x3ff882[_0x4a2f('0x23')],function(_0x217511){return{'model':db[_0x217511[_0x4a2f('0x24')]],'as':_0x217511['as'],'attributes':_0x217511[_0x4a2f('0x21')],'include':_0x217511[_0x4a2f('0x23')]?_[_0x4a2f('0x25')](_0x217511[_0x4a2f('0x23')],function(_0x481c71){return{'model':db[_0x481c71[_0x4a2f('0x24')]],'as':_0x481c71['as'],'attributes':_0x481c71['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a2f('0x26')](function(_0xaca41b){logger[_0x4a2f('0x13')](_0x4a2f('0x1d'),_0x4a572d);logger[_0x4a2f('0x27')](_0x4a2f('0x1d'),_0x4a572d,JSON[_0x4a2f('0x16')](_0xaca41b));_0xd601b2(_0xaca41b);})['catch'](function(_0x49e15c){logger[_0x4a2f('0x17')](_0x4a2f('0x1d'),_0x49e15c[_0x4a2f('0x1a')],_0x4a572d);_0x4d761a(_0x2367d[_0x4a2f('0x17')](0x1f4,_0x49e15c['message']));});});};exports[_0x4a2f('0x28')]=function(_0x55d993){var _0x11d917=this;return new Promise(function(_0x4ab937,_0x42956b){return db[_0x4a2f('0x29')]['create'](_0x55d993[_0x4a2f('0x2a')],{'raw':_0x55d993[_0x4a2f('0x1f')]?_0x55d993[_0x4a2f('0x1f')][_0x4a2f('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x142290){logger[_0x4a2f('0x13')]('CreateVoiceQueueReport',_0x55d993);logger[_0x4a2f('0x27')](_0x4a2f('0x28'),_0x55d993,JSON['stringify'](_0x142290));_0x4ab937(_0x142290);})[_0x4a2f('0x1c')](function(_0x8aecd0){logger[_0x4a2f('0x17')](_0x4a2f('0x28'),_0x8aecd0[_0x4a2f('0x1a')],_0x55d993);_0x42956b(_0x11d917[_0x4a2f('0x17')](0x1f4,_0x8aecd0[_0x4a2f('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x10d28e){var _0x25bc4b=this;return new Promise(function(_0x28ad48,_0x4621f3){return db[_0x4a2f('0x29')]['update'](_0x10d28e[_0x4a2f('0x2a')],{'raw':_0x10d28e[_0x4a2f('0x1f')]?_0x10d28e[_0x4a2f('0x1f')][_0x4a2f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10d28e[_0x4a2f('0x1f')]?_0x10d28e[_0x4a2f('0x1f')][_0x4a2f('0x2b')]||null:null,'attributes':_0x10d28e[_0x4a2f('0x1f')]?_0x10d28e[_0x4a2f('0x1f')][_0x4a2f('0x21')]||null:null,'limit':_0x10d28e[_0x4a2f('0x1f')]?_0x10d28e[_0x4a2f('0x1f')][_0x4a2f('0x22')]||null:null})['then'](function(_0x2eea87){logger[_0x4a2f('0x13')](_0x4a2f('0x2c'),_0x10d28e);logger[_0x4a2f('0x27')](_0x4a2f('0x2c'),_0x10d28e,JSON[_0x4a2f('0x16')](_0x2eea87));_0x28ad48(_0x2eea87);})[_0x4a2f('0x1c')](function(_0x46646a){logger[_0x4a2f('0x17')](_0x4a2f('0x2c'),_0x46646a[_0x4a2f('0x1a')],_0x10d28e);_0x4621f3(_0x25bc4b[_0x4a2f('0x17')](0x1f4,_0x46646a[_0x4a2f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e8416a5..1f294f3 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 _0x36bb=['remove','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x1ecedd,_0x4be55f){var _0x3da52c=function(_0x488b0f){while(--_0x488b0f){_0x1ecedd['push'](_0x1ecedd['shift']());}};_0x3da52c(++_0x4be55f);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueReportEvents=require(_0xb36b('0x0'));var events=[_0xb36b('0x1'),_0xb36b('0x2'),'update'];function createListener(_0x1d6c2e,_0xa54c6){return function(_0x9267f4){_0xa54c6[_0xb36b('0x3')](_0x1d6c2e,_0x9267f4);};}function removeListener(_0x311671,_0x3d57d7){return function(){VoiceQueueReportEvents[_0xb36b('0x4')](_0x311671,_0x3d57d7);};}exports[_0xb36b('0x5')]=function(_0x439ccc){for(var _0x418837=0x0,_0x181f45=events[_0xb36b('0x6')];_0x418837<_0x181f45;_0x418837++){var _0x229483=events[_0x418837];var _0x30e907=createListener(_0xb36b('0x7')+_0x229483,_0x439ccc);VoiceQueueReportEvents['on'](_0x229483,_0x30e907);}}; \ No newline at end of file +var _0x3248=['remove','update','removeListener','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x3248,0x1b0));var _0x8324=function(_0x1fcee6,_0x473438){_0x1fcee6=_0x1fcee6-0x0;var _0x446d62=_0x3248[_0x1fcee6];return _0x446d62;};'use strict';var VoiceQueueReportEvents=require(_0x8324('0x0'));var events=[_0x8324('0x1'),_0x8324('0x2'),_0x8324('0x3')];function createListener(_0x9b580,_0x23b671){return function(_0x3ab598){_0x23b671['emit'](_0x9b580,_0x3ab598);};}function removeListener(_0x4c565b,_0x2e46f3){return function(){VoiceQueueReportEvents[_0x8324('0x4')](_0x4c565b,_0x2e46f3);};}exports['register']=function(_0x18edd2){for(var _0x283f5f=0x0,_0x446423=events[_0x8324('0x5')];_0x283f5f<_0x446423;_0x283f5f++){var _0x215c15=events[_0x283f5f];var _0x5d5f01=createListener(_0x8324('0x6')+_0x215c15,_0x18edd2);VoiceQueueReportEvents['on'](_0x215c15,_0x5d5f01);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 01cd4f7..81bf244 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 _0x819a=['Router','../../components/auth/service','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post','create','put','multer','util','path','connect-timeout','express'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x819a,0x16b));var _0xa819=function(_0x5d0725,_0x1ae8ad){_0x5d0725=_0x5d0725-0x0;var _0x157c30=_0x819a[_0x5d0725];return _0x157c30;};'use strict';var multer=require(_0xa819('0x0'));var util=require(_0xa819('0x1'));var path=require(_0xa819('0x2'));var timeout=require(_0xa819('0x3'));var express=require(_0xa819('0x4'));var router=express[_0xa819('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa819('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa819('0x7'));router[_0xa819('0x8')]('/',auth['isAuthenticated'](),controller[_0xa819('0x9')]);router[_0xa819('0x8')](_0xa819('0xa'),auth[_0xa819('0xb')](),controller[_0xa819('0xc')]);router[_0xa819('0xd')]('/',auth[_0xa819('0xb')](),controller[_0xa819('0xe')]);router[_0xa819('0xf')](_0xa819('0xa'),auth[_0xa819('0xb')](),controller['update']);router['delete'](_0xa819('0xa'),auth[_0xa819('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1145=['post','create','delete','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id'];(function(_0x19188e,_0x855be7){var _0x28c619=function(_0x532805){while(--_0x532805){_0x19188e['push'](_0x19188e['shift']());}};_0x28c619(++_0x855be7);}(_0x1145,0xc7));var _0x5114=function(_0x5ec19d,_0x54bef2){_0x5ec19d=_0x5ec19d-0x0;var _0x760f10=_0x1145[_0x5ec19d];return _0x760f10;};'use strict';var multer=require(_0x5114('0x0'));var util=require(_0x5114('0x1'));var path=require(_0x5114('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5114('0x3'));var interaction=require(_0x5114('0x4'));var config=require(_0x5114('0x5'));var controller=require(_0x5114('0x6'));router[_0x5114('0x7')]('/',auth[_0x5114('0x8')](),controller[_0x5114('0x9')]);router[_0x5114('0x7')](_0x5114('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x5114('0xb')]('/',auth['isAuthenticated'](),controller[_0x5114('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5114('0xd')](_0x5114('0xa'),auth[_0x5114('0x8')](),controller['destroy']);module[_0x5114('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 8310d46..a97d88d 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 _0x3a91=['STRING','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0x3a91,0x1bc));var _0x13a9=function(_0x1e2690,_0x3c570a){_0x1e2690=_0x1e2690-0x0;var _0x537b8d=_0x3a91[_0x1e2690];return _0x537b8d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x13a9('0x0')]},'callid':{'type':Sequelize[_0x13a9('0x0')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x13a9('0x0')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x13a9('0x0')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x13a9('0x0')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x13a9('0x0')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x13a9('0x0')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x13a9('0x0')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x13a9('0x0')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x13a9('0x0')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()['format'](_0x13a9('0x1'))}}; \ No newline at end of file +var _0x4dc4=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0x4862a5,_0x36315d){var _0x42e9c1=function(_0x41289c){while(--_0x41289c){_0x4862a5['push'](_0x4862a5['shift']());}};_0x42e9c1(++_0x36315d);}(_0x4dc4,0xee));var _0x44dc=function(_0x525df8,_0x4bf80c){_0x525df8=_0x525df8-0x0;var _0x2405a2=_0x4dc4[_0x525df8];return _0x2405a2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x44dc('0x0'));module[_0x44dc('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x44dc('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x44dc('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x44dc('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x44dc('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x44dc('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x44dc('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x44dc('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x44dc('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x44dc('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x44dc('0x3')],'allowNull':![],'defaultValue':moment()[_0x44dc('0x4')](_0x44dc('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a65fded..8087a0e 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 _0x16cd=['send','index','map','VoiceQueuesLog','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','eml-format','rimraf','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x16cd,0xb9));var _0xd16c=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x16cd[_0x2ca2d0];return _0x521c23;};'use strict';var emlformat=require(_0xd16c('0x0'));var rimraf=require(_0xd16c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd16c('0x2'));var moment=require(_0xd16c('0x3'));var BPromise=require(_0xd16c('0x4'));var Mustache=require(_0xd16c('0x5'));var util=require(_0xd16c('0x6'));var path=require(_0xd16c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd16c('0x8'));var fs=require('fs');var fs_extra=require(_0xd16c('0x9'));var _=require(_0xd16c('0xa'));var squel=require(_0xd16c('0xb'));var crypto=require('crypto');var jsforce=require(_0xd16c('0xc'));var deskjs=require(_0xd16c('0xd'));var toCsv=require(_0xd16c('0xe'));var querystring=require('querystring');var Papa=require(_0xd16c('0xf'));var Redis=require('ioredis');var authService=require(_0xd16c('0x10'));var qs=require(_0xd16c('0x11'));var as=require(_0xd16c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd16c('0x13'))(_0xd16c('0x14'));var utils=require(_0xd16c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd16c('0x16'));var db=require(_0xd16c('0x17'))['db'];function respondWithStatusCode(_0x190263,_0x61c1e5){_0x61c1e5=_0x61c1e5||0xcc;return function(_0x2a6582){if(_0x2a6582){return _0x190263['sendStatus'](_0x61c1e5);}return _0x190263[_0xd16c('0x18')](_0x61c1e5)['end']();};}function respondWithResult(_0x256703,_0x577e68){_0x577e68=_0x577e68||0xc8;return function(_0x19a5f2){if(_0x19a5f2){return _0x256703[_0xd16c('0x18')](_0x577e68)[_0xd16c('0x19')](_0x19a5f2);}};}function respondWithFilteredResult(_0xd2154e,_0x183855){return function(_0x10e422){if(_0x10e422){var _0x261474=typeof _0x183855[_0xd16c('0x1a')]==='undefined'&&typeof _0x183855['limit']===_0xd16c('0x1b');var _0x16ae08=_0x10e422[_0xd16c('0x1c')];var _0xbab9a7=_0x261474?0x0:_0x183855[_0xd16c('0x1a')];var _0x49b9e5=_0x261474?_0x10e422['count']:_0x183855[_0xd16c('0x1a')]+_0x183855['limit'];var _0x1d89c3;if(_0x49b9e5>=_0x16ae08){_0x49b9e5=_0x16ae08;_0x1d89c3=0xc8;}else{_0x1d89c3=0xce;}_0xd2154e['status'](_0x1d89c3);return _0xd2154e['set']('Content-Range',_0xbab9a7+'-'+_0x49b9e5+'/'+_0x16ae08)['json'](_0x10e422);}return null;};}function patchUpdates(_0x149850){return function(_0x409b7b){try{jsonpatch[_0xd16c('0x1d')](_0x409b7b,_0x149850,!![]);}catch(_0x5b34b8){return BPromise[_0xd16c('0x1e')](_0x5b34b8);}return _0x409b7b[_0xd16c('0x1f')]();};}function saveUpdates(_0x41e66c,_0x4518b2){return function(_0x2c0cf7){if(_0x2c0cf7){return _0x2c0cf7[_0xd16c('0x20')](_0x41e66c)[_0xd16c('0x21')](function(_0x35a9f8){return _0x35a9f8;});}return null;};}function removeEntity(_0x4217b1,_0x458450){return function(_0x3ecd57){if(_0x3ecd57){return _0x3ecd57[_0xd16c('0x22')]()[_0xd16c('0x21')](function(){_0x4217b1['status'](0xcc)[_0xd16c('0x23')]();});}};}function handleEntityNotFound(_0x5d71c7,_0x530084){return function(_0xfc0639){if(!_0xfc0639){_0x5d71c7[_0xd16c('0x24')](0x194);}return _0xfc0639;};}function handleError(_0x4c00d9,_0x28685f){_0x28685f=_0x28685f||0x1f4;return function(_0x129c79){logger[_0xd16c('0x25')](_0x129c79[_0xd16c('0x26')]);if(_0x129c79[_0xd16c('0x27')]){delete _0x129c79[_0xd16c('0x27')];}_0x4c00d9[_0xd16c('0x18')](_0x28685f)[_0xd16c('0x28')](_0x129c79);};}exports[_0xd16c('0x29')]=function(_0x31351b,_0x598224){var _0x989a80={},_0x4258d8={},_0x3f2135={'count':0x0,'rows':[]};var _0xcd8c40=_[_0xd16c('0x2a')](db[_0xd16c('0x2b')][_0xd16c('0x2c')],function(_0x3df302){return{'name':_0x3df302[_0xd16c('0x2d')],'type':_0x3df302['type']['key']};});_0x4258d8[_0xd16c('0x2e')]=_[_0xd16c('0x2a')](_0xcd8c40,_0xd16c('0x27'));_0x4258d8[_0xd16c('0x2f')]=_[_0xd16c('0x30')](_0x31351b[_0xd16c('0x2f')]);_0x4258d8[_0xd16c('0x31')]=_[_0xd16c('0x32')](_0x4258d8['model'],_0x4258d8[_0xd16c('0x2f')]);_0x989a80['attributes']=_[_0xd16c('0x32')](_0x4258d8[_0xd16c('0x2e')],qs[_0xd16c('0x33')](_0x31351b[_0xd16c('0x2f')][_0xd16c('0x33')]));_0x989a80[_0xd16c('0x34')]=_0x989a80[_0xd16c('0x34')]['length']?_0x989a80[_0xd16c('0x34')]:_0x4258d8['model'];if(!_0x31351b[_0xd16c('0x2f')]['hasOwnProperty'](_0xd16c('0x35'))){_0x989a80[_0xd16c('0x36')]=qs[_0xd16c('0x36')](_0x31351b[_0xd16c('0x2f')][_0xd16c('0x36')]);_0x989a80[_0xd16c('0x1a')]=qs[_0xd16c('0x1a')](_0x31351b['query'][_0xd16c('0x1a')]);}_0x989a80[_0xd16c('0x37')]=qs['sort'](_0x31351b[_0xd16c('0x2f')][_0xd16c('0x38')]);_0x989a80[_0xd16c('0x39')]=qs[_0xd16c('0x31')](_[_0xd16c('0x3a')](_0x31351b[_0xd16c('0x2f')],_0x4258d8[_0xd16c('0x31')]),_0xcd8c40);if(_0x31351b['query'][_0xd16c('0x3b')]){_0x989a80['where']=_[_0xd16c('0x3c')](_0x989a80['where'],{'$or':_['map'](_0xcd8c40,function(_0x3c101e){if(_0x3c101e[_0xd16c('0x3d')]!==_0xd16c('0x3e')){var _0xbb406a={};_0xbb406a[_0x3c101e[_0xd16c('0x27')]]={'$like':'%'+_0x31351b['query'][_0xd16c('0x3b')]+'%'};return _0xbb406a;}})});}_0x989a80=_[_0xd16c('0x3c')]({},_0x989a80,_0x31351b['options']);var _0x1721be={'where':_0x989a80[_0xd16c('0x39')]};return db['VoiceQueuesLog'][_0xd16c('0x1c')](_0x1721be)['then'](function(_0x45cf2b){_0x3f2135[_0xd16c('0x1c')]=_0x45cf2b;if(_0x31351b['query'][_0xd16c('0x3f')]){_0x989a80['include']=[{'all':!![]}];}return db[_0xd16c('0x2b')][_0xd16c('0x40')](_0x989a80);})[_0xd16c('0x21')](function(_0x2d3586){_0x3f2135[_0xd16c('0x41')]=_0x2d3586;return _0x3f2135;})[_0xd16c('0x21')](respondWithFilteredResult(_0x598224,_0x989a80))[_0xd16c('0x42')](handleError(_0x598224,null));};exports[_0xd16c('0x43')]=function(_0x23c12a,_0x22dbbf){var _0x4f5f9a={'raw':!![],'where':{'id':_0x23c12a[_0xd16c('0x44')]['id']}},_0x9c5ca7={};_0x9c5ca7[_0xd16c('0x2e')]=_[_0xd16c('0x30')](db[_0xd16c('0x2b')][_0xd16c('0x2c')]);_0x9c5ca7['query']=_['keys'](_0x23c12a[_0xd16c('0x2f')]);_0x9c5ca7[_0xd16c('0x31')]=_[_0xd16c('0x32')](_0x9c5ca7[_0xd16c('0x2e')],_0x9c5ca7[_0xd16c('0x2f')]);_0x4f5f9a[_0xd16c('0x34')]=_[_0xd16c('0x32')](_0x9c5ca7[_0xd16c('0x2e')],qs[_0xd16c('0x33')](_0x23c12a[_0xd16c('0x2f')][_0xd16c('0x33')]));_0x4f5f9a['attributes']=_0x4f5f9a[_0xd16c('0x34')][_0xd16c('0x45')]?_0x4f5f9a[_0xd16c('0x34')]:_0x9c5ca7[_0xd16c('0x2e')];if(_0x23c12a[_0xd16c('0x2f')][_0xd16c('0x3f')]){_0x4f5f9a[_0xd16c('0x46')]=[{'all':!![]}];}_0x4f5f9a=_[_0xd16c('0x3c')]({},_0x4f5f9a,_0x23c12a[_0xd16c('0x47')]);return db[_0xd16c('0x2b')][_0xd16c('0x48')](_0x4f5f9a)['then'](handleEntityNotFound(_0x22dbbf,null))[_0xd16c('0x21')](respondWithResult(_0x22dbbf,null))[_0xd16c('0x42')](handleError(_0x22dbbf,null));};exports['create']=function(_0x3e0108,_0x12627a){return db[_0xd16c('0x2b')][_0xd16c('0x49')](_0x3e0108['body'],{})[_0xd16c('0x21')](respondWithResult(_0x12627a,0xc9))['catch'](handleError(_0x12627a,null));};exports[_0xd16c('0x20')]=function(_0x9eb1d2,_0x30d6e9){if(_0x9eb1d2['body']['id']){delete _0x9eb1d2[_0xd16c('0x4a')]['id'];}return db[_0xd16c('0x2b')][_0xd16c('0x48')]({'where':{'id':_0x9eb1d2[_0xd16c('0x44')]['id']}})[_0xd16c('0x21')](handleEntityNotFound(_0x30d6e9,null))[_0xd16c('0x21')](saveUpdates(_0x9eb1d2['body'],null))[_0xd16c('0x21')](respondWithResult(_0x30d6e9,null))[_0xd16c('0x42')](handleError(_0x30d6e9,null));};exports[_0xd16c('0x22')]=function(_0x3f5382,_0x471c1f){return db[_0xd16c('0x2b')][_0xd16c('0x48')]({'where':{'id':_0x3f5382['params']['id']}})[_0xd16c('0x21')](handleEntityNotFound(_0x471c1f,null))[_0xd16c('0x21')](removeEntity(_0x471c1f,null))['catch'](handleError(_0x471c1f,null));}; \ No newline at end of file +var _0x7f8a=['query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','VoiceQueuesLog','includeAll','include','findAll','rows','params','length','catch','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','key'];(function(_0x6f858b,_0x3c0c0a){var _0x4e3327=function(_0x4917bf){while(--_0x4917bf){_0x6f858b['push'](_0x6f858b['shift']());}};_0x4e3327(++_0x3c0c0a);}(_0x7f8a,0x1a3));var _0xa7f8=function(_0x207eff,_0xe33d7b){_0x207eff=_0x207eff-0x0;var _0x1be38a=_0x7f8a[_0x207eff];return _0x1be38a;};'use strict';var emlformat=require(_0xa7f8('0x0'));var rimraf=require(_0xa7f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa7f8('0x2'));var rp=require(_0xa7f8('0x3'));var moment=require(_0xa7f8('0x4'));var BPromise=require(_0xa7f8('0x5'));var Mustache=require('mustache');var util=require(_0xa7f8('0x6'));var path=require(_0xa7f8('0x7'));var sox=require('sox');var csv=require(_0xa7f8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa7f8('0x9'));var _=require(_0xa7f8('0xa'));var squel=require('squel');var crypto=require(_0xa7f8('0xb'));var jsforce=require(_0xa7f8('0xc'));var deskjs=require(_0xa7f8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa7f8('0xe'));var Papa=require(_0xa7f8('0xf'));var Redis=require(_0xa7f8('0x10'));var authService=require(_0xa7f8('0x11'));var qs=require(_0xa7f8('0x12'));var as=require(_0xa7f8('0x13'));var hardwareService=require(_0xa7f8('0x14'));var logger=require(_0xa7f8('0x15'))(_0xa7f8('0x16'));var utils=require(_0xa7f8('0x17'));var config=require(_0xa7f8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7f8('0x19'))['db'];function respondWithStatusCode(_0xbcfd2d,_0x71ddef){_0x71ddef=_0x71ddef||0xcc;return function(_0x46522e){if(_0x46522e){return _0xbcfd2d[_0xa7f8('0x1a')](_0x71ddef);}return _0xbcfd2d['status'](_0x71ddef)[_0xa7f8('0x1b')]();};}function respondWithResult(_0x44c463,_0x30aa8c){_0x30aa8c=_0x30aa8c||0xc8;return function(_0x13f265){if(_0x13f265){return _0x44c463[_0xa7f8('0x1c')](_0x30aa8c)[_0xa7f8('0x1d')](_0x13f265);}};}function respondWithFilteredResult(_0x28f0b2,_0x502686){return function(_0x562b73){if(_0x562b73){var _0x3eb97b=typeof _0x502686[_0xa7f8('0x1e')]===_0xa7f8('0x1f')&&typeof _0x502686[_0xa7f8('0x20')]===_0xa7f8('0x1f');var _0x7a2ecc=_0x562b73[_0xa7f8('0x21')];var _0x529c6c=_0x3eb97b?0x0:_0x502686[_0xa7f8('0x1e')];var _0x74c42c=_0x3eb97b?_0x562b73['count']:_0x502686['offset']+_0x502686['limit'];var _0x47a227;if(_0x74c42c>=_0x7a2ecc){_0x74c42c=_0x7a2ecc;_0x47a227=0xc8;}else{_0x47a227=0xce;}_0x28f0b2['status'](_0x47a227);return _0x28f0b2[_0xa7f8('0x22')](_0xa7f8('0x23'),_0x529c6c+'-'+_0x74c42c+'/'+_0x7a2ecc)[_0xa7f8('0x1d')](_0x562b73);}return null;};}function patchUpdates(_0x9b17a9){return function(_0x2851e9){try{jsonpatch[_0xa7f8('0x24')](_0x2851e9,_0x9b17a9,!![]);}catch(_0x354199){return BPromise[_0xa7f8('0x25')](_0x354199);}return _0x2851e9[_0xa7f8('0x26')]();};}function saveUpdates(_0x2f4431,_0x491acb){return function(_0x20978b){if(_0x20978b){return _0x20978b[_0xa7f8('0x27')](_0x2f4431)[_0xa7f8('0x28')](function(_0x4e0161){return _0x4e0161;});}return null;};}function removeEntity(_0x25e9dc,_0x47599c){return function(_0xcb61c5){if(_0xcb61c5){return _0xcb61c5['destroy']()[_0xa7f8('0x28')](function(){_0x25e9dc[_0xa7f8('0x1c')](0xcc)[_0xa7f8('0x1b')]();});}};}function handleEntityNotFound(_0x169c7c,_0x20e5c5){return function(_0x5ae25c){if(!_0x5ae25c){_0x169c7c[_0xa7f8('0x1a')](0x194);}return _0x5ae25c;};}function handleError(_0x5e2e03,_0x4774cd){_0x4774cd=_0x4774cd||0x1f4;return function(_0x4c8fd7){logger[_0xa7f8('0x29')](_0x4c8fd7[_0xa7f8('0x2a')]);if(_0x4c8fd7[_0xa7f8('0x2b')]){delete _0x4c8fd7[_0xa7f8('0x2b')];}_0x5e2e03['status'](_0x4774cd)[_0xa7f8('0x2c')](_0x4c8fd7);};}exports['index']=function(_0x274e9f,_0x3ecf8a){var _0x5627a4={},_0x1c8d78={},_0x358402={'count':0x0,'rows':[]};var _0x4429ff=_[_0xa7f8('0x2d')](db['VoiceQueuesLog'][_0xa7f8('0x2e')],function(_0xb428c){return{'name':_0xb428c[_0xa7f8('0x2f')],'type':_0xb428c['type'][_0xa7f8('0x30')]};});_0x1c8d78['model']=_[_0xa7f8('0x2d')](_0x4429ff,_0xa7f8('0x2b'));_0x1c8d78[_0xa7f8('0x31')]=_[_0xa7f8('0x32')](_0x274e9f['query']);_0x1c8d78['filters']=_[_0xa7f8('0x33')](_0x1c8d78['model'],_0x1c8d78[_0xa7f8('0x31')]);_0x5627a4[_0xa7f8('0x34')]=_[_0xa7f8('0x33')](_0x1c8d78[_0xa7f8('0x35')],qs[_0xa7f8('0x36')](_0x274e9f['query'][_0xa7f8('0x36')]));_0x5627a4[_0xa7f8('0x34')]=_0x5627a4[_0xa7f8('0x34')]['length']?_0x5627a4[_0xa7f8('0x34')]:_0x1c8d78[_0xa7f8('0x35')];if(!_0x274e9f[_0xa7f8('0x31')][_0xa7f8('0x37')](_0xa7f8('0x38'))){_0x5627a4['limit']=qs[_0xa7f8('0x20')](_0x274e9f['query'][_0xa7f8('0x20')]);_0x5627a4[_0xa7f8('0x1e')]=qs[_0xa7f8('0x1e')](_0x274e9f[_0xa7f8('0x31')][_0xa7f8('0x1e')]);}_0x5627a4[_0xa7f8('0x39')]=qs[_0xa7f8('0x3a')](_0x274e9f['query'][_0xa7f8('0x3a')]);_0x5627a4[_0xa7f8('0x3b')]=qs[_0xa7f8('0x3c')](_[_0xa7f8('0x3d')](_0x274e9f[_0xa7f8('0x31')],_0x1c8d78['filters']),_0x4429ff);if(_0x274e9f[_0xa7f8('0x31')][_0xa7f8('0x3e')]){_0x5627a4[_0xa7f8('0x3b')]=_['merge'](_0x5627a4[_0xa7f8('0x3b')],{'$or':_[_0xa7f8('0x2d')](_0x4429ff,function(_0x5a1a72){if(_0x5a1a72['type']!==_0xa7f8('0x3f')){var _0x3c8ac9={};_0x3c8ac9[_0x5a1a72[_0xa7f8('0x2b')]]={'$like':'%'+_0x274e9f[_0xa7f8('0x31')][_0xa7f8('0x3e')]+'%'};return _0x3c8ac9;}})});}_0x5627a4=_[_0xa7f8('0x40')]({},_0x5627a4,_0x274e9f[_0xa7f8('0x41')]);var _0x5ef060={'where':_0x5627a4[_0xa7f8('0x3b')]};return db[_0xa7f8('0x42')][_0xa7f8('0x21')](_0x5ef060)[_0xa7f8('0x28')](function(_0x2c4a29){_0x358402[_0xa7f8('0x21')]=_0x2c4a29;if(_0x274e9f['query'][_0xa7f8('0x43')]){_0x5627a4[_0xa7f8('0x44')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xa7f8('0x45')](_0x5627a4);})[_0xa7f8('0x28')](function(_0x5d0513){_0x358402[_0xa7f8('0x46')]=_0x5d0513;return _0x358402;})[_0xa7f8('0x28')](respondWithFilteredResult(_0x3ecf8a,_0x5627a4))['catch'](handleError(_0x3ecf8a,null));};exports['show']=function(_0x24ca6d,_0x3dcc3d){var _0xc6a54f={'raw':!![],'where':{'id':_0x24ca6d[_0xa7f8('0x47')]['id']}},_0x492b79={};_0x492b79['model']=_[_0xa7f8('0x32')](db[_0xa7f8('0x42')]['rawAttributes']);_0x492b79['query']=_[_0xa7f8('0x32')](_0x24ca6d[_0xa7f8('0x31')]);_0x492b79['filters']=_[_0xa7f8('0x33')](_0x492b79[_0xa7f8('0x35')],_0x492b79[_0xa7f8('0x31')]);_0xc6a54f[_0xa7f8('0x34')]=_[_0xa7f8('0x33')](_0x492b79[_0xa7f8('0x35')],qs[_0xa7f8('0x36')](_0x24ca6d[_0xa7f8('0x31')][_0xa7f8('0x36')]));_0xc6a54f[_0xa7f8('0x34')]=_0xc6a54f[_0xa7f8('0x34')][_0xa7f8('0x48')]?_0xc6a54f[_0xa7f8('0x34')]:_0x492b79['model'];if(_0x24ca6d['query'][_0xa7f8('0x43')]){_0xc6a54f[_0xa7f8('0x44')]=[{'all':!![]}];}_0xc6a54f=_[_0xa7f8('0x40')]({},_0xc6a54f,_0x24ca6d[_0xa7f8('0x41')]);return db['VoiceQueuesLog']['find'](_0xc6a54f)['then'](handleEntityNotFound(_0x3dcc3d,null))[_0xa7f8('0x28')](respondWithResult(_0x3dcc3d,null))[_0xa7f8('0x49')](handleError(_0x3dcc3d,null));};exports[_0xa7f8('0x4a')]=function(_0x223bf1,_0x114440){return db[_0xa7f8('0x42')][_0xa7f8('0x4a')](_0x223bf1[_0xa7f8('0x4b')],{})[_0xa7f8('0x28')](respondWithResult(_0x114440,0xc9))[_0xa7f8('0x49')](handleError(_0x114440,null));};exports[_0xa7f8('0x27')]=function(_0x3e9201,_0x204dc5){if(_0x3e9201['body']['id']){delete _0x3e9201[_0xa7f8('0x4b')]['id'];}return db[_0xa7f8('0x42')][_0xa7f8('0x4c')]({'where':{'id':_0x3e9201[_0xa7f8('0x47')]['id']}})['then'](handleEntityNotFound(_0x204dc5,null))[_0xa7f8('0x28')](saveUpdates(_0x3e9201[_0xa7f8('0x4b')],null))['then'](respondWithResult(_0x204dc5,null))[_0xa7f8('0x49')](handleError(_0x204dc5,null));};exports[_0xa7f8('0x4d')]=function(_0x23d1cf,_0x14df3d){return db[_0xa7f8('0x42')][_0xa7f8('0x4c')]({'where':{'id':_0x23d1cf[_0xa7f8('0x47')]['id']}})[_0xa7f8('0x28')](handleEntityNotFound(_0x14df3d,null))[_0xa7f8('0x28')](removeEntity(_0x14df3d,null))[_0xa7f8('0x49')](handleError(_0x14df3d,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 4c3bb64..c5e9c26 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 _0x20ef=['rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3570e2,_0x37c18f){var _0xab9614=function(_0x1bc1db){while(--_0x1bc1db){_0x3570e2['push'](_0x3570e2['shift']());}};_0xab9614(++_0x37c18f);}(_0x20ef,0xe6));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf20e('0x0'));var util=require(_0xf20e('0x1'));var logger=require(_0xf20e('0x2'))(_0xf20e('0x3'));var moment=require(_0xf20e('0x4'));var BPromise=require(_0xf20e('0x5'));var rp=require(_0xf20e('0x6'));var fs=require('fs');var path=require(_0xf20e('0x7'));var rimraf=require(_0xf20e('0x8'));var config=require(_0xf20e('0x9'));var attributes=require(_0xf20e('0xa'));module[_0xf20e('0xb')]=function(_0x40bc26,_0x27b0b2){return _0x40bc26[_0xf20e('0xc')](_0xf20e('0xd'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xf20e('0xe'),'fields':[_0xf20e('0xf'),_0xf20e('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x13c0=['dtm','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','event'];(function(_0x34933a,_0x327378){var _0x36abb4=function(_0x2d6814){while(--_0x2d6814){_0x34933a['push'](_0x34933a['shift']());}};_0x36abb4(++_0x327378);}(_0x13c0,0x79));var _0x013c=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x13c0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var logger=require(_0x013c('0x2'))(_0x013c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x013c('0x4'));var rimraf=require(_0x013c('0x5'));var config=require(_0x013c('0x6'));var attributes=require(_0x013c('0x7'));module[_0x013c('0x8')]=function(_0x12d78e,_0x1142f4){return _0x12d78e[_0x013c('0x9')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x013c('0xa'),_0x013c('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 27e7701..39f69d8 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 _0xd863=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2f7fd9,_0x284e9a){var _0x49429c=function(_0x2118f2){while(--_0x2118f2){_0x2f7fd9['push'](_0x2f7fd9['shift']());}};_0x49429c(++_0x284e9a);}(_0xd863,0x1c7));var _0x3d86=function(_0xfbdbf4,_0x515364){_0xfbdbf4=_0xfbdbf4-0x0;var _0x289602=_0xd863[_0xfbdbf4];return _0x289602;};'use strict';var _=require(_0x3d86('0x0'));var util=require(_0x3d86('0x1'));var moment=require(_0x3d86('0x2'));var BPromise=require(_0x3d86('0x3'));var rs=require(_0x3d86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d86('0x5'))['db'];var utils=require(_0x3d86('0x6'));var logger=require(_0x3d86('0x7'))(_0x3d86('0x8'));var config=require('../../config/environment');var jayson=require(_0x3d86('0x9'));var client=jayson[_0x3d86('0xa')][_0x3d86('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12584e,_0xcf9338,_0x7d3735){return new BPromise(function(_0x8e98f7,_0x295596){return client[_0x3d86('0xc')](_0x12584e,_0x7d3735)[_0x3d86('0xd')](function(_0x16bebe){logger[_0x3d86('0xe')](_0x3d86('0xf'),_0xcf9338,_0x3d86('0x10'));logger[_0x3d86('0x11')](_0x3d86('0x12'),_0xcf9338,'request\x20sent',JSON[_0x3d86('0x13')](_0x16bebe));if(_0x16bebe[_0x3d86('0x14')]){if(_0x16bebe['error'][_0x3d86('0x15')]===0x1f4){logger[_0x3d86('0x14')](_0x3d86('0xf'),_0xcf9338,_0x16bebe[_0x3d86('0x14')][_0x3d86('0x16')]);return _0x295596(_0x16bebe['error'][_0x3d86('0x16')]);}logger[_0x3d86('0x14')](_0x3d86('0xf'),_0xcf9338,_0x16bebe[_0x3d86('0x14')]['message']);return _0x8e98f7(_0x16bebe[_0x3d86('0x14')][_0x3d86('0x16')]);}else{logger[_0x3d86('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0xcf9338,'request\x20sent');_0x8e98f7(_0x16bebe[_0x3d86('0x17')][_0x3d86('0x16')]);}})[_0x3d86('0x18')](function(_0x19505e){logger['error'](_0x3d86('0xf'),_0xcf9338,_0x19505e);_0x295596(_0x19505e);});});} \ No newline at end of file +var _0xc524=['stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xc524,0x1bf));var _0x4c52=function(_0xc4d528,_0x15c7d9){_0xc4d528=_0xc4d528-0x0;var _0x29084b=_0xc524[_0xc4d528];return _0x29084b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4c52('0x0'));var BPromise=require(_0x4c52('0x1'));var rs=require(_0x4c52('0x2'));var fs=require('fs');var Redis=require(_0x4c52('0x3'));var db=require(_0x4c52('0x4'))['db'];var utils=require(_0x4c52('0x5'));var logger=require(_0x4c52('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4c52('0x7'));var client=jayson[_0x4c52('0x8')][_0x4c52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4756e3,_0x5378d3,_0x4ea85e){return new BPromise(function(_0x39591b,_0x212216){return client['request'](_0x4756e3,_0x4ea85e)[_0x4c52('0xa')](function(_0x231cda){logger['info'](_0x4c52('0xb'),_0x5378d3,_0x4c52('0xc'));logger[_0x4c52('0xd')](_0x4c52('0xe'),_0x5378d3,_0x4c52('0xc'),JSON[_0x4c52('0xf')](_0x231cda));if(_0x231cda[_0x4c52('0x10')]){if(_0x231cda[_0x4c52('0x10')][_0x4c52('0x11')]===0x1f4){logger['error'](_0x4c52('0xb'),_0x5378d3,_0x231cda[_0x4c52('0x10')][_0x4c52('0x12')]);return _0x212216(_0x231cda['error']['message']);}logger[_0x4c52('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5378d3,_0x231cda[_0x4c52('0x10')][_0x4c52('0x12')]);return _0x39591b(_0x231cda['error'][_0x4c52('0x12')]);}else{logger[_0x4c52('0x13')](_0x4c52('0xb'),_0x5378d3,_0x4c52('0xc'));_0x39591b(_0x231cda[_0x4c52('0x14')][_0x4c52('0x12')]);}})[_0x4c52('0x15')](function(_0x1dabe0){logger[_0x4c52('0x10')](_0x4c52('0xb'),_0x5378d3,_0x1dabe0);_0x212216(_0x1dabe0);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 8d4e607..a1c2763 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 _0x5876=['isAuthenticated','index','/describe','describe','get','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','create','post','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','./voiceRecording.controller'];(function(_0x4fde41,_0x5a70dd){var _0x1d5bf8=function(_0xf4dcf){while(--_0xf4dcf){_0x4fde41['push'](_0x4fde41['shift']());}};_0x1d5bf8(++_0x5a70dd);}(_0x5876,0x8a));var _0x6587=function(_0x75caa,_0x390e63){_0x75caa=_0x75caa-0x0;var _0x8c7804=_0x5876[_0x75caa];return _0x8c7804;};'use strict';var multer=require('multer');var util=require(_0x6587('0x0'));var path=require(_0x6587('0x1'));var timeout=require(_0x6587('0x2'));var express=require(_0x6587('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6587('0x4'));var config=require('../../config/environment');var controller=require(_0x6587('0x5'));router['get']('/',auth[_0x6587('0x6')](),controller[_0x6587('0x7')]);router['get'](_0x6587('0x8'),auth['isAuthenticated'](),controller[_0x6587('0x9')]);router[_0x6587('0xa')](_0x6587('0xb'),auth[_0x6587('0x6')](),controller[_0x6587('0xc')]);router[_0x6587('0xa')](_0x6587('0xd'),auth[_0x6587('0x6')](),controller[_0x6587('0xe')]);router[_0x6587('0xa')](_0x6587('0xf'),controller['downloads']);router['get'](_0x6587('0x10'),auth['isAuthenticated'](),controller[_0x6587('0x11')]);router['post']('/',auth[_0x6587('0x6')](),controller[_0x6587('0x12')]);router[_0x6587('0x13')]('/:id/transcribe',auth[_0x6587('0x6')](),controller['runTranscribe']);router['put']('/:id',auth[_0x6587('0x6')](),controller[_0x6587('0x14')]);router[_0x6587('0x15')](_0x6587('0xb'),auth['isAuthenticated'](),controller[_0x6587('0x16')]);module[_0x6587('0x17')]=router; \ No newline at end of file +var _0xf1c0=['put','update','delete','destroy','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0xf1c0,0x68));var _0x0f1c=function(_0xa87e9d,_0xe27b78){_0xa87e9d=_0xa87e9d-0x0;var _0x3a7190=_0xf1c0[_0xa87e9d];return _0x3a7190;};'use strict';var multer=require(_0x0f1c('0x0'));var util=require('util');var path=require(_0x0f1c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0f1c('0x2'));var auth=require(_0x0f1c('0x3'));var interaction=require(_0x0f1c('0x4'));var config=require(_0x0f1c('0x5'));var controller=require('./voiceRecording.controller');router[_0x0f1c('0x6')]('/',auth['isAuthenticated'](),controller[_0x0f1c('0x7')]);router[_0x0f1c('0x6')](_0x0f1c('0x8'),auth['isAuthenticated'](),controller[_0x0f1c('0x9')]);router[_0x0f1c('0x6')](_0x0f1c('0xa'),auth[_0x0f1c('0xb')](),controller[_0x0f1c('0xc')]);router[_0x0f1c('0x6')](_0x0f1c('0xd'),auth[_0x0f1c('0xb')](),controller[_0x0f1c('0xe')]);router[_0x0f1c('0x6')](_0x0f1c('0xf'),controller['downloads']);router[_0x0f1c('0x6')](_0x0f1c('0x10'),auth['isAuthenticated'](),controller[_0x0f1c('0x11')]);router[_0x0f1c('0x12')]('/',auth['isAuthenticated'](),controller[_0x0f1c('0x13')]);router[_0x0f1c('0x12')](_0x0f1c('0x10'),auth[_0x0f1c('0xb')](),controller[_0x0f1c('0x14')]);router[_0x0f1c('0x15')](_0x0f1c('0xa'),auth[_0x0f1c('0xb')](),controller[_0x0f1c('0x16')]);router[_0x0f1c('0x17')](_0x0f1c('0xa'),auth['isAuthenticated'](),controller[_0x0f1c('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 29bb033..9b64d73 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(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 aba0330..ce252fd 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 _0x74fa=['runTranscribe','Voice\x20Recording\x20not\x20found','findOne','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','filename','extname','unlink','message','Not\x20found','downloads','sequelize','col','token','$and','push','Sequelize','ValidationError','VoiceRecording\x20not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','TranscriptionJobStatus'];(function(_0x5b2528,_0x2e49ad){var _0x68c0dc=function(_0x53b30d){while(--_0x53b30d){_0x5b2528['push'](_0x5b2528['shift']());}};_0x68c0dc(++_0x2e49ad);}(_0x74fa,0x1e8));var _0xa74f=function(_0xc219c9,_0x31bf85){_0xc219c9=_0xc219c9-0x0;var _0x2b4c4d=_0x74fa[_0xc219c9];return _0x2b4c4d;};'use strict';var emlformat=require(_0xa74f('0x0'));var rimraf=require(_0xa74f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa74f('0x2'));var moment=require('moment');var BPromise=require(_0xa74f('0x3'));var Mustache=require(_0xa74f('0x4'));var util=require(_0xa74f('0x5'));var path=require(_0xa74f('0x6'));var sox=require(_0xa74f('0x7'));var csv=require(_0xa74f('0x8'));var ejs=require(_0xa74f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa74f('0xa'));var squel=require(_0xa74f('0xb'));var crypto=require(_0xa74f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa74f('0xd'));var toCsv=require(_0xa74f('0x8'));var querystring=require(_0xa74f('0xe'));var Papa=require(_0xa74f('0xf'));var AWS=require(_0xa74f('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xa74f('0x11'));var authService=require(_0xa74f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa74f('0x13'));var hardwareService=require(_0xa74f('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xa74f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa74f('0x16'));var db=require(_0xa74f('0x17'))['db'];function respondWithStatusCode(_0x3ceb0a,_0x4d5051){_0x4d5051=_0x4d5051||0xcc;return function(_0x5659b4){if(_0x5659b4){return _0x3ceb0a['sendStatus'](_0x4d5051);}return _0x3ceb0a[_0xa74f('0x18')](_0x4d5051)[_0xa74f('0x19')]();};}function respondWithResult(_0x4a7188,_0x6436f3){_0x6436f3=_0x6436f3||0xc8;return function(_0x4b91ec){if(_0x4b91ec){return _0x4a7188[_0xa74f('0x18')](_0x6436f3)[_0xa74f('0x1a')](_0x4b91ec);}};}function respondWithFilteredResult(_0x196d50,_0x2ca253){return function(_0x5778c2){if(_0x5778c2){var _0x51a572=typeof _0x2ca253[_0xa74f('0x1b')]===_0xa74f('0x1c')&&typeof _0x2ca253[_0xa74f('0x1d')]===_0xa74f('0x1c');var _0x2caa91=_0x5778c2[_0xa74f('0x1e')];var _0x5db42b=_0x51a572?0x0:_0x2ca253[_0xa74f('0x1b')];var _0x3467a0=_0x51a572?_0x5778c2[_0xa74f('0x1e')]:_0x2ca253[_0xa74f('0x1b')]+_0x2ca253[_0xa74f('0x1d')];var _0x48f300;if(_0x3467a0>=_0x2caa91){_0x3467a0=_0x2caa91;_0x48f300=0xc8;}else{_0x48f300=0xce;}_0x196d50[_0xa74f('0x18')](_0x48f300);return _0x196d50['set']('Content-Range',_0x5db42b+'-'+_0x3467a0+'/'+_0x2caa91)[_0xa74f('0x1a')](_0x5778c2);}return null;};}function patchUpdates(_0x1ce9c5){return function(_0x2c9284){try{jsonpatch[_0xa74f('0x1f')](_0x2c9284,_0x1ce9c5,!![]);}catch(_0x1519fe){return BPromise[_0xa74f('0x20')](_0x1519fe);}return _0x2c9284[_0xa74f('0x21')]();};}function saveUpdates(_0x47fa66,_0x43261f){return function(_0x2344fe){if(_0x2344fe){return _0x2344fe[_0xa74f('0x22')](_0x47fa66)['then'](function(_0x542b73){return _0x542b73;});}return null;};}function removeEntity(_0x1531e3,_0x4e4aa0){return function(_0x5734cb){if(_0x5734cb){return _0x5734cb[_0xa74f('0x23')]()[_0xa74f('0x24')](function(){_0x1531e3[_0xa74f('0x18')](0xcc)[_0xa74f('0x19')]();});}};}function handleEntityNotFound(_0x34c8d1,_0x3d0198){return function(_0x172007){if(!_0x172007){_0x34c8d1[_0xa74f('0x25')](0x194);}return _0x172007;};}function handleError(_0x9d56f,_0x2a17f3){_0x2a17f3=_0x2a17f3||0x1f4;return function(_0x28d149){logger[_0xa74f('0x26')](_0x28d149[_0xa74f('0x27')]);if(_0x28d149['name']){delete _0x28d149[_0xa74f('0x28')];}_0x9d56f[_0xa74f('0x18')](_0x2a17f3)[_0xa74f('0x29')](_0x28d149);};}exports[_0xa74f('0x2a')]=function(_0x365c0b,_0x43a9a4){var _0x43e7de={},_0xfd6504={},_0xbeac25={'count':0x0,'rows':[]};var _0x2e804c=_['map'](db[_0xa74f('0x2b')][_0xa74f('0x2c')],function(_0x5e54f9){return{'name':_0x5e54f9[_0xa74f('0x2d')],'type':_0x5e54f9[_0xa74f('0x2e')][_0xa74f('0x2f')]};});_0xfd6504[_0xa74f('0x30')]=_[_0xa74f('0x31')](_['map'](_0x2e804c,'name'),[_0xa74f('0x32')]);_0xfd6504[_0xa74f('0x33')]=_['keys'](_0x365c0b['query']);_0xfd6504[_0xa74f('0x34')]=_[_0xa74f('0x35')](_0xfd6504['model'],_0xfd6504[_0xa74f('0x33')]);_0x43e7de[_0xa74f('0x36')]=_[_0xa74f('0x35')](_0xfd6504[_0xa74f('0x30')],qs[_0xa74f('0x37')](_0x365c0b[_0xa74f('0x33')]['fields']));_0x43e7de[_0xa74f('0x36')]=_0x43e7de[_0xa74f('0x36')]['length']?_0x43e7de[_0xa74f('0x36')]:_0xfd6504[_0xa74f('0x30')];if(!_0x365c0b['query'][_0xa74f('0x38')](_0xa74f('0x39'))){_0x43e7de[_0xa74f('0x1d')]=qs[_0xa74f('0x1d')](_0x365c0b[_0xa74f('0x33')][_0xa74f('0x1d')]);_0x43e7de[_0xa74f('0x1b')]=qs[_0xa74f('0x1b')](_0x365c0b[_0xa74f('0x33')][_0xa74f('0x1b')]);}_0x43e7de[_0xa74f('0x3a')]=qs[_0xa74f('0x3b')](_0x365c0b['query'][_0xa74f('0x3b')]);_0x43e7de[_0xa74f('0x3c')]=qs[_0xa74f('0x34')](_[_0xa74f('0x3d')](_0x365c0b[_0xa74f('0x33')],_0xfd6504[_0xa74f('0x34')]),_0x2e804c);if(_0x365c0b[_0xa74f('0x33')][_0xa74f('0x3e')]){_0x43e7de[_0xa74f('0x3c')]=_[_0xa74f('0x3f')](_0x43e7de[_0xa74f('0x3c')],{'$or':_[_0xa74f('0x40')](_0x2e804c,function(_0x298849){if(_0x298849['type']!==_0xa74f('0x41')){var _0x43ff23={};_0x43ff23[_0x298849['name']]={'$like':'%'+_0x365c0b[_0xa74f('0x33')]['filter']+'%'};return _0x43ff23;}})});}_0x43e7de=_['merge']({},_0x43e7de,_0x365c0b['options']);var _0x1102f4={'where':_0x43e7de['where']};return db['VoiceRecording'][_0xa74f('0x1e')](_0x1102f4)['then'](function(_0x1e4b43){_0xbeac25[_0xa74f('0x1e')]=_0x1e4b43;if(_0x365c0b[_0xa74f('0x33')][_0xa74f('0x42')]){_0x43e7de[_0xa74f('0x43')]=[{'all':!![]}];}return db[_0xa74f('0x2b')][_0xa74f('0x44')](_0x43e7de);})['then'](function(_0x2ed121){_0xbeac25[_0xa74f('0x45')]=_0x2ed121;return _0xbeac25;})[_0xa74f('0x24')](respondWithFilteredResult(_0x43a9a4,_0x43e7de))[_0xa74f('0x46')](handleError(_0x43a9a4,null));};exports['show']=function(_0x51bc3d,_0x6dac80){var _0x457710={'raw':![],'where':{'id':_0x51bc3d[_0xa74f('0x47')]['id']}},_0x1c4483={};_0x1c4483[_0xa74f('0x30')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x1c4483[_0xa74f('0x33')]=_[_0xa74f('0x48')](_0x51bc3d[_0xa74f('0x33')]);_0x1c4483[_0xa74f('0x34')]=_[_0xa74f('0x35')](_0x1c4483[_0xa74f('0x30')],_0x1c4483['query']);_0x457710['attributes']=_[_0xa74f('0x35')](_0x1c4483[_0xa74f('0x30')],qs['fields'](_0x51bc3d['query'][_0xa74f('0x37')]));_0x457710[_0xa74f('0x36')]=_0x457710[_0xa74f('0x36')]['length']?_0x457710[_0xa74f('0x36')]:_0x1c4483[_0xa74f('0x30')];if(_0x51bc3d[_0xa74f('0x33')][_0xa74f('0x42')]){_0x457710[_0xa74f('0x43')]=[{'all':!![]}];}_0x457710=_['merge']({},_0x457710,_0x51bc3d['options']);return db[_0xa74f('0x2b')][_0xa74f('0x49')](_0x457710)['then'](handleEntityNotFound(_0x6dac80,null))[_0xa74f('0x24')](respondWithResult(_0x6dac80,null))['catch'](handleError(_0x6dac80,null));};exports[_0xa74f('0x4a')]=function(_0x2d09ce,_0xee5f67){return db[_0xa74f('0x2b')]['create'](_0x2d09ce[_0xa74f('0x4b')],{})[_0xa74f('0x24')](respondWithResult(_0xee5f67,0xc9))[_0xa74f('0x46')](handleError(_0xee5f67,null));};exports[_0xa74f('0x22')]=function(_0x3b3257,_0x390f13){if(_0x3b3257[_0xa74f('0x4b')]['id']){delete _0x3b3257['body']['id'];}return db[_0xa74f('0x2b')][_0xa74f('0x49')]({'where':{'id':_0x3b3257[_0xa74f('0x47')]['id']}})[_0xa74f('0x24')](handleEntityNotFound(_0x390f13,null))[_0xa74f('0x24')](saveUpdates(_0x3b3257['body'],null))['then'](respondWithResult(_0x390f13,null))[_0xa74f('0x46')](handleError(_0x390f13,null));};exports[_0xa74f('0x4c')]=function(_0x408b80,_0x2634fa){return db[_0xa74f('0x2b')]['describe']()['then'](respondWithResult(_0x2634fa,null))[_0xa74f('0x46')](handleError(_0x2634fa,null));};exports[_0xa74f('0x4d')]=function(_0x2af956,_0x73093e,_0x240b83){var _0x2dfbdc=require(_0xa74f('0x4e'));var _0x4c7e64=![];var _0x246893={};if(_0x2af956[_0xa74f('0x33')][_0xa74f('0x2e')]&&_0x2af956[_0xa74f('0x33')][_0xa74f('0x2e')]===_0xa74f('0x4f')){_0x246893[_0xa74f('0x4f')]=_0x2af956[_0xa74f('0x47')]['id'];}else{_0x246893['id']=_0x2af956[_0xa74f('0x47')]['id'];}return db[_0xa74f('0x2b')][_0xa74f('0x49')]({'where':_0x246893,'attributes':['id',_0xa74f('0x50')],'raw':!![]})[_0xa74f('0x24')](handleEntityNotFound(_0x73093e,null))[_0xa74f('0x24')](function(_0x21f727){if(_0x21f727){var _0x53ee63=_0x21f727[_0xa74f('0x50')];var _0x369597=util[_0xa74f('0x32')](_0xa74f('0x51'),_0x53ee63);if(fs[_0xa74f('0x52')](_0x369597)){_0x4c7e64=!![];return _0x2dfbdc[_0xa74f('0x53')](_0x369597,_0x53ee63,config[_0xa74f('0x54')][_0xa74f('0x55')])[_0xa74f('0x24')](function(){return _0x21f727;});}return _0x21f727;}})[_0xa74f('0x24')](function(_0x4dfc80){if(_0x4dfc80){var _0x21f8f0=_0x4dfc80[_0xa74f('0x50')];if(!fs[_0xa74f('0x52')](_0x21f8f0)){throw new db['Sequelize']['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x4dfc80[_0xa74f('0x56')]){return _0x73093e[_0xa74f('0x4d')](_0x21f8f0,_0x4dfc80[_0xa74f('0x56')]+path[_0xa74f('0x57')](_0x21f8f0),function(){if(_0x4c7e64){fs[_0xa74f('0x58')](_0x21f8f0);}});}else{return _0x73093e[_0xa74f('0x4d')](_0x21f8f0,function(_0x7f0ac8){if(_0x4c7e64){fs[_0xa74f('0x58')](_0x21f8f0);}});}}})[_0xa74f('0x46')](function(_0x2786bc){if(_0x2786bc[_0xa74f('0x59')]==='VoiceRecording\x20not\x20found'){_0x73093e[_0xa74f('0x18')](0x194)[_0xa74f('0x29')](_0xa74f('0x5a'));}else{return handleError(_0x73093e,null);}});};exports[_0xa74f('0x5b')]=function(_0x198567,_0x1319db,_0x1561d2){var _0x4695cc=require(_0xa74f('0x4e'));var _0x4e1896=![];var _0x4eff48={'$and':[db[_0xa74f('0x5c')][_0xa74f('0x3c')](db[_0xa74f('0x5c')]['fn']('MD5',db[_0xa74f('0x5c')][_0xa74f('0x5d')]('uniqueid')),_0x198567[_0xa74f('0x33')][_0xa74f('0x5e')])]};if(_0x198567[_0xa74f('0x33')][_0xa74f('0x2e')]&&_0x198567[_0xa74f('0x33')][_0xa74f('0x2e')]==='uniqueid'){_0x4eff48[_0xa74f('0x5f')][_0xa74f('0x60')]({'uniqueid':_0x198567[_0xa74f('0x47')]['id']});}else{_0x4eff48[_0xa74f('0x5f')]['push']({'id':_0x198567[_0xa74f('0x47')]['id']});}return db['VoiceRecording'][_0xa74f('0x49')]({'where':_0x4eff48,'attributes':['id',_0xa74f('0x50')],'raw':!![]})[_0xa74f('0x24')](handleEntityNotFound(_0x1319db,null))['then'](function(_0x367dac){if(_0x367dac){var _0x10e228=util[_0xa74f('0x32')](_0xa74f('0x51'),_0x367dac[_0xa74f('0x50')]);if(fs[_0xa74f('0x52')](_0x10e228)){_0x4e1896=!![];return _0x4695cc[_0xa74f('0x53')](_0x10e228,_0x367dac[_0xa74f('0x50')],config[_0xa74f('0x54')][_0xa74f('0x55')])[_0xa74f('0x24')](function(){return _0x367dac;});}return _0x367dac;}})['then'](function(_0x3481fb){if(_0x3481fb){if(!fs[_0xa74f('0x52')](_0x3481fb['value'])){throw new db[(_0xa74f('0x61'))][(_0xa74f('0x62'))](_0xa74f('0x63'));}if(_0x3481fb[_0xa74f('0x56')]){return _0x1319db['download'](_0x3481fb[_0xa74f('0x50')],_0x3481fb[_0xa74f('0x56')]+path[_0xa74f('0x57')](_0x3481fb[_0xa74f('0x50')]),function(){if(_0x4e1896){fs[_0xa74f('0x58')](_0x3481fb[_0xa74f('0x50')]);}});}else{return _0x1319db[_0xa74f('0x4d')](_0x3481fb[_0xa74f('0x50')],function(_0x39a0d7){if(_0x4e1896){fs[_0xa74f('0x58')](_0x3481fb[_0xa74f('0x50')]);}});}}})[_0xa74f('0x46')](handleError(_0x1319db,null));};exports[_0xa74f('0x23')]=function(_0x12fc2e,_0x321eec){return db[_0xa74f('0x2b')][_0xa74f('0x49')]({'where':{'id':_0x12fc2e[_0xa74f('0x47')]['id']}})[_0xa74f('0x24')](function(_0x94cfc5){if(_['isNil'](_0x94cfc5)){throw new ReferenceError(_0xa74f('0x64'));}return _0x94cfc5;})[_0xa74f('0x24')](function(_0x111ec4){var _0x5947d5=_0x111ec4['value'];logger[_0xa74f('0x65')](_0xa74f('0x66'),_0x5947d5);if(!_[_0xa74f('0x67')](_0x111ec4[_0xa74f('0x50')])&&fs[_0xa74f('0x52')](_0x5947d5)){logger[_0xa74f('0x65')](_0xa74f('0x68')+_0x5947d5+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa74f('0x69')](_0x5947d5);}_0x5947d5=_0x5947d5+_0xa74f('0x6a');if(!_[_0xa74f('0x67')](_0x111ec4[_0xa74f('0x50')])&&fs[_0xa74f('0x52')](_0x5947d5)){logger[_0xa74f('0x65')](_0xa74f('0x68')+_0x5947d5+_0xa74f('0x6b'));fs['unlinkSync'](_0x5947d5);}return _0x111ec4;})[_0xa74f('0x24')](function(_0x5894aa){if(!_0x5894aa)throw new InternalError();return _0x5894aa[_0xa74f('0x23')]();})[_0xa74f('0x24')](function(){_0x321eec[_0xa74f('0x18')](0xcc)[_0xa74f('0x19')]();})[_0xa74f('0x46')](handleError(_0x321eec,null));};function getBucketslist(_0xcda5b1,_0x204d2b,_0x1d2d04){return new Promise(function(_0x2886f3,_0x3129cf){var _0x5d1015=new AWS['S3']({'accessKeyId':_0x204d2b,'secretAccessKey':_0xcda5b1,'region':_0x1d2d04});_0x5d1015[_0xa74f('0x6c')]({},function(_0x2f72a5,_0x3dc043){if(_0x2f72a5){return _0x3129cf(_0x2f72a5);}else{return _0x2886f3(_0x3dc043);}});});}function createBucket(_0x5f3df0,_0x2ae3b0,_0x3e2b51,_0x347283){return new Promise(function(_0x3a9ee1,_0x8914dc){var _0x1102fb=new AWS['S3']({'accessKeyId':_0x2ae3b0,'secretAccessKey':_0x5f3df0,'region':_0x3e2b51});_0x1102fb[_0xa74f('0x6d')]({'Bucket':_0x347283},function(_0x1f16ed,_0x53ab50){if(_0x1f16ed){return _0x8914dc(_0x1f16ed);}else{return _0x3a9ee1(_0x53ab50);}});});}function uploadFile(_0x2af117,_0xcefe15,_0x14e5c6,_0x182aa8,_0x577672,_0x45c702){return new Promise(function(_0x250bfd,_0x38107a){var _0x4cda7b=new AWS['S3']({'accessKeyId':_0xcefe15,'secretAccessKey':_0x2af117,'region':_0x14e5c6});_0x4cda7b[_0xa74f('0x6e')]({'Bucket':_0x182aa8,'Key':_0x577672,'Body':_0x45c702},function(_0x192656,_0x5ef1e9){if(_0x192656){return _0x38107a(_0x192656);}else{return _0x250bfd(_0x5ef1e9);}});});}function startTranscribe(_0x3c1e23,_0x3f510b,_0x52831b,_0x4b869f,_0x1bb349,_0x29050f){return new Promise(function(_0xda47a8,_0x3368c1){var _0x5e3ab1=new AWS['TranscribeService']({'accessKeyId':_0x3f510b,'secretAccessKey':_0x3c1e23,'region':_0x52831b});_0x5e3ab1[_0xa74f('0x6f')]({'TranscriptionJobName':_0x4b869f,'LanguageCode':_0x1bb349,'Media':{'MediaFileUri':_0x29050f}},function(_0x2f88e1,_0x2cdc5e){if(_0x2f88e1){return _0x3368c1(_0x2f88e1);}else{return _0xda47a8(_0x2cdc5e);}});});}function transcribe(_0x5b5876,_0x179ce7,_0x58261a,_0x572fe5,_0x57f553,_0x165a31,_0x2acca0){return new Promise(function(_0x8c4551,_0x49eb2b){var _0x3af359={};logger[_0xa74f('0x65')](util[_0xa74f('0x32')](_0xa74f('0x70'),_0x5b5876,_0x57f553));return uploadFile(_0x179ce7,_0x58261a,_0x572fe5,_0x57f553,path[_0xa74f('0x71')](_0x165a31),fs[_0xa74f('0x72')](_0x165a31))['then'](function(_0x135640){logger[_0xa74f('0x65')](util[_0xa74f('0x32')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x5b5876,_0x57f553,_0x135640['Location']));_0x3af359[_0xa74f('0x73')]=_0x135640[_0xa74f('0x74')];_0x3af359[_0xa74f('0x75')]=_0x135640[_0xa74f('0x76')];logger[_0xa74f('0x65')](util[_0xa74f('0x32')](_0xa74f('0x77'),_0x5b5876));return startTranscribe(_0x179ce7,_0x58261a,_0x572fe5,uuidv4(),_0x2acca0,_0x135640[_0xa74f('0x76')]);})['then'](function(_0x43abe4){logger[_0xa74f('0x65')](util[_0xa74f('0x32')](_0xa74f('0x78'),_0x5b5876,_0x43abe4[_0xa74f('0x79')][_0xa74f('0x7a')]));_0x3af359['transcribeName']=_0x43abe4[_0xa74f('0x79')]['TranscriptionJobName'];_0x3af359['transcribeStatus']=_0x43abe4[_0xa74f('0x79')][_0xa74f('0x7b')];return _0x8c4551(_0x3af359);})['catch'](function(_0x2f57f4){return _0x49eb2b(_0x2f57f4);});});}exports[_0xa74f('0x7c')]=function(_0x597a34,_0x3508b7,_0x48ddcb){var _0x3edb3c;var _0x31c5ae;var _0x11d9d0;var _0x188b1c=require(_0xa74f('0x4e'));return db[_0xa74f('0x2b')]['findOne']({'where':{'id':_0x597a34[_0xa74f('0x47')]['id']}})[_0xa74f('0x24')](function(_0x163513){if(_0x163513){var _0x411304=util[_0xa74f('0x32')](_0xa74f('0x51'),_0x163513[_0xa74f('0x50')]);if(fs['existsSync'](_0x411304)){cypher=!![];return _0x188b1c[_0xa74f('0x53')](_0x411304,_0x163513['value'],config[_0xa74f('0x54')]['recording'])[_0xa74f('0x24')](function(){return _0x163513;});}return _0x163513;}})[_0xa74f('0x24')](function(_0x4852d4){if(!_0x4852d4){throw new db[(_0xa74f('0x61'))][(_0xa74f('0x62'))](_0xa74f('0x7d'));}_0x31c5ae=_0x4852d4;return db['Setting'][_0xa74f('0x7e')]({'where':{'id':0x1}});})[_0xa74f('0x24')](handleEntityNotFound(_0x3508b7,null))[_0xa74f('0x24')](function(_0x371014){if(_0x371014){_0x3edb3c=_0x371014;if(!_0x3edb3c[_0xa74f('0x7f')]||!_0x3edb3c[_0xa74f('0x80')]||!_0x3edb3c['transcribeRegion']||!_0x3edb3c['language']||!_0x3edb3c[_0xa74f('0x73')]){throw new db[(_0xa74f('0x61'))][(_0xa74f('0x62'))](_0xa74f('0x81'));}if(_0x597a34[_0xa74f('0x4b')][_0xa74f('0x82')]&&(!_0x3edb3c[_0xa74f('0x83')]||!_0x3edb3c['sentimentAccountId']||!_0x3edb3c[_0xa74f('0x84')]||!_0x3edb3c['language']||!_0x3edb3c[_0xa74f('0x73')])){throw new db[(_0xa74f('0x61'))][(_0xa74f('0x62'))](_0xa74f('0x85'));}return db['CloudProvider'][_0xa74f('0x7e')]({'where':{'id':_0x3edb3c[_0xa74f('0x80')]}});}})['then'](function(_0x418eb4){if(!_0x418eb4){throw new db[(_0xa74f('0x61'))][(_0xa74f('0x62'))](_0xa74f('0x86'));}if(!_0x418eb4[_0xa74f('0x87')]||!_0x418eb4[_0xa74f('0x88')]){throw new db[(_0xa74f('0x61'))][(_0xa74f('0x62'))](_0xa74f('0x89'));}_0x11d9d0=_0x418eb4;return getBucketslist(_0x11d9d0[_0xa74f('0x87')],_0x11d9d0[_0xa74f('0x88')],_0x3edb3c[_0xa74f('0x8a')]);})[_0xa74f('0x24')](function(_0x350f44){if(_0x350f44&&_0x350f44[_0xa74f('0x8b')]){var _0x9ed0d=_[_0xa74f('0x49')](_0x350f44[_0xa74f('0x8b')],function(_0x11a6dc){return _0x11a6dc[_0xa74f('0x8c')]===_0x3edb3c[_0xa74f('0x73')];});if(!_0x9ed0d){logger['info'](util['format'](_0xa74f('0x8d'),_0x597a34[_0xa74f('0x47')]['id'],_0x3edb3c['bucket']));return createBucket(_0x11d9d0[_0xa74f('0x87')],_0x11d9d0['data2'],_0x3edb3c['transcribeRegion'],_0x3edb3c[_0xa74f('0x73')]);}logger['info'](util[_0xa74f('0x32')](_0xa74f('0x8e'),_0x597a34['params']['id'],_0x3edb3c['bucket']));return;}})['then'](function(_0x313d54){if(_0x31c5ae[_0xa74f('0x8f')]==='NEW'){return transcribe(_0x597a34[_0xa74f('0x47')]['id'],_0x11d9d0[_0xa74f('0x87')],_0x11d9d0[_0xa74f('0x88')],_0x3edb3c['transcribeRegion'],_0x3edb3c[_0xa74f('0x73')],_0x31c5ae[_0xa74f('0x50')],_0x3edb3c[_0xa74f('0x90')]);}else{logger[_0xa74f('0x65')](util[_0xa74f('0x32')](_0xa74f('0x91'),_0x597a34[_0xa74f('0x47')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xa74f('0x24')](function(_0x685832){if(_0x685832){_0x685832['tempSentiment']=_0x597a34[_0xa74f('0x4b')][_0xa74f('0x82')];return _0x31c5ae['updateAttributes'](_0x685832);}})[_0xa74f('0x24')](respondWithResult(_0x3508b7,null))[_0xa74f('0x46')](handleError(_0x3508b7,null));};function writeFile(_0x3a3036,_0x283cc5){return new Promise(function(_0x2ab35e,_0x5145f1){fs[_0xa74f('0x92')](_0x283cc5,_0x3a3036,function(_0x31c832,_0x44c083){if(_0x31c832){return _0x5145f1(_0x31c832);}else{return _0x2ab35e(_0x44c083);}});});}exports[_0xa74f('0x93')]=function(_0x48223c,_0x574aa6,_0x57081){return db[_0xa74f('0x2b')][_0xa74f('0x7e')]({'where':{'id':_0x48223c[_0xa74f('0x47')]['id']}})[_0xa74f('0x24')](handleEntityNotFound(_0x574aa6))[_0xa74f('0x24')](function(_0xed6530){if(_0xed6530&&_0xed6530['fileText']){var _0x2a4724=_0xed6530[_0xa74f('0x94')];var _0x19e188=config[_0xa74f('0x95')]+_0xa74f('0x96')+_0xed6530['id']+_0xa74f('0x97');if(fs[_0xa74f('0x52')](_0x19e188)){return _0x19e188;}return writeFile(_0x2a4724,_0x19e188)[_0xa74f('0x24')](function(){return _0x19e188;});}else{throw new db['Sequelize']['ValidationError'](_0xa74f('0x98'));}})[_0xa74f('0x24')](function(_0x3c0e8b){return _0x574aa6['download'](_0x3c0e8b);})[_0xa74f('0x46')](handleError(_0x574aa6));}; \ No newline at end of file +var _0x42be=['create','body','describe','catch','../../components/encryptor','uniqueid','value','%s.cypher','secrets','recording','existsSync','Sequelize','filename','download','extname','unlink','message','VoiceRecording\x20not\x20found','downloads','sequelize','col','token','$and','decryptFile','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','createBucket','upload','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','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','include','findAll','rows','params','options','find'];(function(_0x37da3e,_0x57b99d){var _0x551a7e=function(_0x37cfec){while(--_0x37cfec){_0x37da3e['push'](_0x37da3e['shift']());}};_0x551a7e(++_0x57b99d);}(_0x42be,0x188));var _0xe42b=function(_0x6ec192,_0x280867){_0x6ec192=_0x6ec192-0x0;var _0x2c21d7=_0x42be[_0x6ec192];return _0x2c21d7;};'use strict';var emlformat=require(_0xe42b('0x0'));var rimraf=require(_0xe42b('0x1'));var zipdir=require(_0xe42b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe42b('0x3'));var BPromise=require(_0xe42b('0x4'));var Mustache=require(_0xe42b('0x5'));var util=require(_0xe42b('0x6'));var path=require(_0xe42b('0x7'));var sox=require(_0xe42b('0x8'));var csv=require('to-csv');var ejs=require(_0xe42b('0x9'));var fs=require('fs');var fs_extra=require(_0xe42b('0xa'));var _=require(_0xe42b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe42b('0xc'));var deskjs=require(_0xe42b('0xd'));var toCsv=require(_0xe42b('0xe'));var querystring=require(_0xe42b('0xf'));var Papa=require(_0xe42b('0x10'));var AWS=require(_0xe42b('0x11'));var uuidv4=require(_0xe42b('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe42b('0x13'));var as=require(_0xe42b('0x14'));var hardwareService=require(_0xe42b('0x15'));var logger=require(_0xe42b('0x16'))('api');var utils=require(_0xe42b('0x17'));var config=require(_0xe42b('0x18'));var licenseUtil=require(_0xe42b('0x19'));var db=require(_0xe42b('0x1a'))['db'];function respondWithStatusCode(_0xe1a8b1,_0x52aad6){_0x52aad6=_0x52aad6||0xcc;return function(_0x9a15f5){if(_0x9a15f5){return _0xe1a8b1['sendStatus'](_0x52aad6);}return _0xe1a8b1[_0xe42b('0x1b')](_0x52aad6)[_0xe42b('0x1c')]();};}function respondWithResult(_0xc148f1,_0x447d9b){_0x447d9b=_0x447d9b||0xc8;return function(_0xe43ec8){if(_0xe43ec8){return _0xc148f1[_0xe42b('0x1b')](_0x447d9b)[_0xe42b('0x1d')](_0xe43ec8);}};}function respondWithFilteredResult(_0x4b50ff,_0x3de01c){return function(_0x301eed){if(_0x301eed){var _0x3ee60f=typeof _0x3de01c['offset']===_0xe42b('0x1e')&&typeof _0x3de01c[_0xe42b('0x1f')]==='undefined';var _0x2fd698=_0x301eed[_0xe42b('0x20')];var _0x12509d=_0x3ee60f?0x0:_0x3de01c[_0xe42b('0x21')];var _0xb2808c=_0x3ee60f?_0x301eed['count']:_0x3de01c['offset']+_0x3de01c[_0xe42b('0x1f')];var _0x182ee6;if(_0xb2808c>=_0x2fd698){_0xb2808c=_0x2fd698;_0x182ee6=0xc8;}else{_0x182ee6=0xce;}_0x4b50ff[_0xe42b('0x1b')](_0x182ee6);return _0x4b50ff[_0xe42b('0x22')](_0xe42b('0x23'),_0x12509d+'-'+_0xb2808c+'/'+_0x2fd698)['json'](_0x301eed);}return null;};}function patchUpdates(_0x691416){return function(_0x2f56af){try{jsonpatch[_0xe42b('0x24')](_0x2f56af,_0x691416,!![]);}catch(_0x581c0b){return BPromise[_0xe42b('0x25')](_0x581c0b);}return _0x2f56af[_0xe42b('0x26')]();};}function saveUpdates(_0x251fcb,_0x4eff7a){return function(_0x298c7c){if(_0x298c7c){return _0x298c7c[_0xe42b('0x27')](_0x251fcb)[_0xe42b('0x28')](function(_0x229566){return _0x229566;});}return null;};}function removeEntity(_0x25e124,_0x44cab6){return function(_0x261533){if(_0x261533){return _0x261533[_0xe42b('0x29')]()[_0xe42b('0x28')](function(){_0x25e124[_0xe42b('0x1b')](0xcc)[_0xe42b('0x1c')]();});}};}function handleEntityNotFound(_0x3bb61e,_0x128816){return function(_0x1877ff){if(!_0x1877ff){_0x3bb61e[_0xe42b('0x2a')](0x194);}return _0x1877ff;};}function handleError(_0x4c3db0,_0x21879a){_0x21879a=_0x21879a||0x1f4;return function(_0xd849f8){logger['error'](_0xd849f8[_0xe42b('0x2b')]);if(_0xd849f8['name']){delete _0xd849f8[_0xe42b('0x2c')];}_0x4c3db0['status'](_0x21879a)[_0xe42b('0x2d')](_0xd849f8);};}exports['index']=function(_0x3c4907,_0x2a8e6b){var _0x1ab6a3={},_0x58e360={},_0x2b3dd1={'count':0x0,'rows':[]};var _0x2e0ef7=_[_0xe42b('0x2e')](db[_0xe42b('0x2f')][_0xe42b('0x30')],function(_0x123f86){return{'name':_0x123f86[_0xe42b('0x31')],'type':_0x123f86[_0xe42b('0x32')][_0xe42b('0x33')]};});_0x58e360[_0xe42b('0x34')]=_[_0xe42b('0x35')](_[_0xe42b('0x2e')](_0x2e0ef7,'name'),[_0xe42b('0x36')]);_0x58e360[_0xe42b('0x37')]=_[_0xe42b('0x38')](_0x3c4907[_0xe42b('0x37')]);_0x58e360['filters']=_[_0xe42b('0x39')](_0x58e360[_0xe42b('0x34')],_0x58e360[_0xe42b('0x37')]);_0x1ab6a3[_0xe42b('0x3a')]=_['intersection'](_0x58e360[_0xe42b('0x34')],qs[_0xe42b('0x3b')](_0x3c4907[_0xe42b('0x37')]['fields']));_0x1ab6a3[_0xe42b('0x3a')]=_0x1ab6a3['attributes'][_0xe42b('0x3c')]?_0x1ab6a3[_0xe42b('0x3a')]:_0x58e360[_0xe42b('0x34')];if(!_0x3c4907[_0xe42b('0x37')][_0xe42b('0x3d')](_0xe42b('0x3e'))){_0x1ab6a3[_0xe42b('0x1f')]=qs[_0xe42b('0x1f')](_0x3c4907['query'][_0xe42b('0x1f')]);_0x1ab6a3[_0xe42b('0x21')]=qs[_0xe42b('0x21')](_0x3c4907[_0xe42b('0x37')][_0xe42b('0x21')]);}_0x1ab6a3[_0xe42b('0x3f')]=qs[_0xe42b('0x40')](_0x3c4907[_0xe42b('0x37')][_0xe42b('0x40')]);_0x1ab6a3[_0xe42b('0x41')]=qs[_0xe42b('0x42')](_[_0xe42b('0x43')](_0x3c4907[_0xe42b('0x37')],_0x58e360[_0xe42b('0x42')]),_0x2e0ef7);if(_0x3c4907[_0xe42b('0x37')][_0xe42b('0x44')]){_0x1ab6a3[_0xe42b('0x41')]=_[_0xe42b('0x45')](_0x1ab6a3[_0xe42b('0x41')],{'$or':_['map'](_0x2e0ef7,function(_0x574a79){if(_0x574a79[_0xe42b('0x32')]!=='VIRTUAL'){var _0x13d3da={};_0x13d3da[_0x574a79[_0xe42b('0x2c')]]={'$like':'%'+_0x3c4907[_0xe42b('0x37')][_0xe42b('0x44')]+'%'};return _0x13d3da;}})});}_0x1ab6a3=_[_0xe42b('0x45')]({},_0x1ab6a3,_0x3c4907['options']);var _0x107384={'where':_0x1ab6a3[_0xe42b('0x41')]};return db['VoiceRecording'][_0xe42b('0x20')](_0x107384)['then'](function(_0x5b6072){_0x2b3dd1[_0xe42b('0x20')]=_0x5b6072;if(_0x3c4907[_0xe42b('0x37')]['includeAll']){_0x1ab6a3[_0xe42b('0x46')]=[{'all':!![]}];}return db[_0xe42b('0x2f')][_0xe42b('0x47')](_0x1ab6a3);})[_0xe42b('0x28')](function(_0x251687){_0x2b3dd1[_0xe42b('0x48')]=_0x251687;return _0x2b3dd1;})[_0xe42b('0x28')](respondWithFilteredResult(_0x2a8e6b,_0x1ab6a3))['catch'](handleError(_0x2a8e6b,null));};exports['show']=function(_0x56d49a,_0x14a1ac){var _0x1920dd={'raw':![],'where':{'id':_0x56d49a[_0xe42b('0x49')]['id']}},_0x42d8cb={};_0x42d8cb[_0xe42b('0x34')]=_[_0xe42b('0x38')](db[_0xe42b('0x2f')][_0xe42b('0x30')]);_0x42d8cb['query']=_[_0xe42b('0x38')](_0x56d49a[_0xe42b('0x37')]);_0x42d8cb[_0xe42b('0x42')]=_[_0xe42b('0x39')](_0x42d8cb[_0xe42b('0x34')],_0x42d8cb[_0xe42b('0x37')]);_0x1920dd[_0xe42b('0x3a')]=_[_0xe42b('0x39')](_0x42d8cb['model'],qs['fields'](_0x56d49a['query'][_0xe42b('0x3b')]));_0x1920dd['attributes']=_0x1920dd[_0xe42b('0x3a')][_0xe42b('0x3c')]?_0x1920dd[_0xe42b('0x3a')]:_0x42d8cb[_0xe42b('0x34')];if(_0x56d49a[_0xe42b('0x37')]['includeAll']){_0x1920dd[_0xe42b('0x46')]=[{'all':!![]}];}_0x1920dd=_['merge']({},_0x1920dd,_0x56d49a[_0xe42b('0x4a')]);return db[_0xe42b('0x2f')][_0xe42b('0x4b')](_0x1920dd)[_0xe42b('0x28')](handleEntityNotFound(_0x14a1ac,null))[_0xe42b('0x28')](respondWithResult(_0x14a1ac,null))['catch'](handleError(_0x14a1ac,null));};exports[_0xe42b('0x4c')]=function(_0x2eb3b7,_0x2a28aa){return db['VoiceRecording']['create'](_0x2eb3b7[_0xe42b('0x4d')],{})[_0xe42b('0x28')](respondWithResult(_0x2a28aa,0xc9))['catch'](handleError(_0x2a28aa,null));};exports[_0xe42b('0x27')]=function(_0x270332,_0x330f35){if(_0x270332[_0xe42b('0x4d')]['id']){delete _0x270332[_0xe42b('0x4d')]['id'];}return db[_0xe42b('0x2f')]['find']({'where':{'id':_0x270332['params']['id']}})[_0xe42b('0x28')](handleEntityNotFound(_0x330f35,null))['then'](saveUpdates(_0x270332[_0xe42b('0x4d')],null))['then'](respondWithResult(_0x330f35,null))['catch'](handleError(_0x330f35,null));};exports['describe']=function(_0xf134df,_0x4bf52c){return db[_0xe42b('0x2f')][_0xe42b('0x4e')]()[_0xe42b('0x28')](respondWithResult(_0x4bf52c,null))[_0xe42b('0x4f')](handleError(_0x4bf52c,null));};exports['download']=function(_0x5b21ee,_0x47b023,_0x3c45b0){var _0x105937=require(_0xe42b('0x50'));var _0xd54e6a=![];var _0x7f6146={};if(_0x5b21ee[_0xe42b('0x37')][_0xe42b('0x32')]&&_0x5b21ee[_0xe42b('0x37')][_0xe42b('0x32')]===_0xe42b('0x51')){_0x7f6146[_0xe42b('0x51')]=_0x5b21ee[_0xe42b('0x49')]['id'];}else{_0x7f6146['id']=_0x5b21ee[_0xe42b('0x49')]['id'];}return db[_0xe42b('0x2f')][_0xe42b('0x4b')]({'where':_0x7f6146,'attributes':['id','value'],'raw':!![]})[_0xe42b('0x28')](handleEntityNotFound(_0x47b023,null))[_0xe42b('0x28')](function(_0x48f56b){if(_0x48f56b){var _0x5c8143=_0x48f56b[_0xe42b('0x52')];var _0x48064e=util[_0xe42b('0x36')](_0xe42b('0x53'),_0x5c8143);if(fs['existsSync'](_0x48064e)){_0xd54e6a=!![];return _0x105937['decryptFile'](_0x48064e,_0x5c8143,config[_0xe42b('0x54')][_0xe42b('0x55')])[_0xe42b('0x28')](function(){return _0x48f56b;});}return _0x48f56b;}})['then'](function(_0x2401a2){if(_0x2401a2){var _0x5e8781=_0x2401a2[_0xe42b('0x52')];if(!fs[_0xe42b('0x56')](_0x5e8781)){throw new db[(_0xe42b('0x57'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x2401a2[_0xe42b('0x58')]){return _0x47b023[_0xe42b('0x59')](_0x5e8781,_0x2401a2[_0xe42b('0x58')]+path[_0xe42b('0x5a')](_0x5e8781),function(){if(_0xd54e6a){fs[_0xe42b('0x5b')](_0x5e8781);}});}else{return _0x47b023[_0xe42b('0x59')](_0x5e8781,function(_0x3e269b){if(_0xd54e6a){fs[_0xe42b('0x5b')](_0x5e8781);}});}}})['catch'](function(_0xbb51b3){if(_0xbb51b3[_0xe42b('0x5c')]===_0xe42b('0x5d')){_0x47b023[_0xe42b('0x1b')](0x194)[_0xe42b('0x2d')]('Not\x20found');}else{return handleError(_0x47b023,null);}});};exports[_0xe42b('0x5e')]=function(_0x2f1f44,_0x30d720,_0x48dd18){var _0x51e1b8=require('../../components/encryptor');var _0x22e2d2=![];var _0xa869c6={'$and':[db['sequelize'][_0xe42b('0x41')](db[_0xe42b('0x5f')]['fn']('MD5',db[_0xe42b('0x5f')][_0xe42b('0x60')](_0xe42b('0x51'))),_0x2f1f44[_0xe42b('0x37')][_0xe42b('0x61')])]};if(_0x2f1f44[_0xe42b('0x37')][_0xe42b('0x32')]&&_0x2f1f44[_0xe42b('0x37')][_0xe42b('0x32')]===_0xe42b('0x51')){_0xa869c6[_0xe42b('0x62')]['push']({'uniqueid':_0x2f1f44[_0xe42b('0x49')]['id']});}else{_0xa869c6[_0xe42b('0x62')]['push']({'id':_0x2f1f44['params']['id']});}return db['VoiceRecording']['find']({'where':_0xa869c6,'attributes':['id',_0xe42b('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x30d720,null))[_0xe42b('0x28')](function(_0x3819da){if(_0x3819da){var _0x19bcb7=util[_0xe42b('0x36')](_0xe42b('0x53'),_0x3819da[_0xe42b('0x52')]);if(fs[_0xe42b('0x56')](_0x19bcb7)){_0x22e2d2=!![];return _0x51e1b8[_0xe42b('0x63')](_0x19bcb7,_0x3819da[_0xe42b('0x52')],config[_0xe42b('0x54')][_0xe42b('0x55')])[_0xe42b('0x28')](function(){return _0x3819da;});}return _0x3819da;}})[_0xe42b('0x28')](function(_0x38f053){if(_0x38f053){if(!fs['existsSync'](_0x38f053[_0xe42b('0x52')])){throw new db[(_0xe42b('0x57'))][(_0xe42b('0x64'))](_0xe42b('0x5d'));}if(_0x38f053[_0xe42b('0x58')]){return _0x30d720['download'](_0x38f053[_0xe42b('0x52')],_0x38f053['filename']+path['extname'](_0x38f053[_0xe42b('0x52')]),function(){if(_0x22e2d2){fs[_0xe42b('0x5b')](_0x38f053['value']);}});}else{return _0x30d720[_0xe42b('0x59')](_0x38f053['value'],function(_0x473ccd){if(_0x22e2d2){fs[_0xe42b('0x5b')](_0x38f053[_0xe42b('0x52')]);}});}}})['catch'](handleError(_0x30d720,null));};exports[_0xe42b('0x29')]=function(_0x537567,_0x380e68){return db[_0xe42b('0x2f')][_0xe42b('0x4b')]({'where':{'id':_0x537567[_0xe42b('0x49')]['id']}})[_0xe42b('0x28')](function(_0x495cda){if(_[_0xe42b('0x65')](_0x495cda)){throw new ReferenceError(_0xe42b('0x66'));}return _0x495cda;})[_0xe42b('0x28')](function(_0x2780e8){var _0x10e6e3=_0x2780e8[_0xe42b('0x52')];logger[_0xe42b('0x67')](_0xe42b('0x68'),_0x10e6e3);if(!_[_0xe42b('0x65')](_0x2780e8[_0xe42b('0x52')])&&fs[_0xe42b('0x56')](_0x10e6e3)){logger[_0xe42b('0x67')](_0xe42b('0x69')+_0x10e6e3+_0xe42b('0x6a'));fs[_0xe42b('0x6b')](_0x10e6e3);}_0x10e6e3=_0x10e6e3+_0xe42b('0x6c');if(!_[_0xe42b('0x65')](_0x2780e8[_0xe42b('0x52')])&&fs[_0xe42b('0x56')](_0x10e6e3)){logger[_0xe42b('0x67')](_0xe42b('0x69')+_0x10e6e3+_0xe42b('0x6a'));fs[_0xe42b('0x6b')](_0x10e6e3);}return _0x2780e8;})[_0xe42b('0x28')](function(_0x328375){if(!_0x328375)throw new InternalError();return _0x328375['destroy']();})[_0xe42b('0x28')](function(){_0x380e68[_0xe42b('0x1b')](0xcc)[_0xe42b('0x1c')]();})['catch'](handleError(_0x380e68,null));};function getBucketslist(_0x11bf84,_0x1d962d,_0x5e9c68){return new Promise(function(_0x3322ff,_0x18dc69){var _0x57a8b0=new AWS['S3']({'accessKeyId':_0x1d962d,'secretAccessKey':_0x11bf84,'region':_0x5e9c68});_0x57a8b0['listBuckets']({},function(_0x5c32ae,_0x483be8){if(_0x5c32ae){return _0x18dc69(_0x5c32ae);}else{return _0x3322ff(_0x483be8);}});});}function createBucket(_0x12158a,_0xb20bef,_0x95989c,_0x2cd90f){return new Promise(function(_0x347385,_0x4131fe){var _0x24f9cb=new AWS['S3']({'accessKeyId':_0xb20bef,'secretAccessKey':_0x12158a,'region':_0x95989c});_0x24f9cb[_0xe42b('0x6d')]({'Bucket':_0x2cd90f},function(_0xe99ba,_0x160e77){if(_0xe99ba){return _0x4131fe(_0xe99ba);}else{return _0x347385(_0x160e77);}});});}function uploadFile(_0x1c0a82,_0x4954a6,_0x456437,_0x3a87f8,_0xc88b9e,_0x1a636c){return new Promise(function(_0x595a17,_0x56b038){var _0x42eed2=new AWS['S3']({'accessKeyId':_0x4954a6,'secretAccessKey':_0x1c0a82,'region':_0x456437});_0x42eed2[_0xe42b('0x6e')]({'Bucket':_0x3a87f8,'Key':_0xc88b9e,'Body':_0x1a636c},function(_0x5f3771,_0x237613){if(_0x5f3771){return _0x56b038(_0x5f3771);}else{return _0x595a17(_0x237613);}});});}function startTranscribe(_0x1d9e92,_0x6abc9,_0x2a7c22,_0x1f9000,_0x51a743,_0x291b9a){return new Promise(function(_0x1f9aba,_0x5b14e3){var _0x9b139b=new AWS[(_0xe42b('0x6f'))]({'accessKeyId':_0x6abc9,'secretAccessKey':_0x1d9e92,'region':_0x2a7c22});_0x9b139b[_0xe42b('0x70')]({'TranscriptionJobName':_0x1f9000,'LanguageCode':_0x51a743,'Media':{'MediaFileUri':_0x291b9a}},function(_0x2cfb6e,_0x330689){if(_0x2cfb6e){return _0x5b14e3(_0x2cfb6e);}else{return _0x1f9aba(_0x330689);}});});}function transcribe(_0x450a15,_0x1bf63b,_0x25bfb3,_0xdd7cd9,_0xbb7225,_0x252805,_0x3c3aa5){return new Promise(function(_0x2bb817,_0x5a482e){var _0x2f0061={};logger[_0xe42b('0x67')](util[_0xe42b('0x36')](_0xe42b('0x71'),_0x450a15,_0xbb7225));return uploadFile(_0x1bf63b,_0x25bfb3,_0xdd7cd9,_0xbb7225,path[_0xe42b('0x72')](_0x252805),fs[_0xe42b('0x73')](_0x252805))[_0xe42b('0x28')](function(_0x2b5283){logger[_0xe42b('0x67')](util[_0xe42b('0x36')](_0xe42b('0x74'),_0x450a15,_0xbb7225,_0x2b5283['Location']));_0x2f0061[_0xe42b('0x75')]=_0x2b5283[_0xe42b('0x76')];_0x2f0061[_0xe42b('0x77')]=_0x2b5283[_0xe42b('0x78')];logger[_0xe42b('0x67')](util[_0xe42b('0x36')](_0xe42b('0x79'),_0x450a15));return startTranscribe(_0x1bf63b,_0x25bfb3,_0xdd7cd9,uuidv4(),_0x3c3aa5,_0x2b5283[_0xe42b('0x78')]);})[_0xe42b('0x28')](function(_0x31b44e){logger[_0xe42b('0x67')](util[_0xe42b('0x36')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x450a15,_0x31b44e['TranscriptionJob'][_0xe42b('0x7a')]));_0x2f0061[_0xe42b('0x7b')]=_0x31b44e[_0xe42b('0x7c')][_0xe42b('0x7a')];_0x2f0061[_0xe42b('0x7d')]=_0x31b44e['TranscriptionJob'][_0xe42b('0x7e')];return _0x2bb817(_0x2f0061);})['catch'](function(_0x4eda90){return _0x5a482e(_0x4eda90);});});}exports[_0xe42b('0x7f')]=function(_0x3e0de0,_0x3fd1b4,_0x280201){var _0x7315a2;var _0x44a845;var _0x4755a0;var _0x6f98b=require(_0xe42b('0x50'));return db[_0xe42b('0x2f')][_0xe42b('0x80')]({'where':{'id':_0x3e0de0[_0xe42b('0x49')]['id']}})[_0xe42b('0x28')](function(_0xa3a538){if(_0xa3a538){var _0x31bb0a=util[_0xe42b('0x36')]('%s.cypher',_0xa3a538['value']);if(fs[_0xe42b('0x56')](_0x31bb0a)){cypher=!![];return _0x6f98b[_0xe42b('0x63')](_0x31bb0a,_0xa3a538[_0xe42b('0x52')],config[_0xe42b('0x54')][_0xe42b('0x55')])['then'](function(){return _0xa3a538;});}return _0xa3a538;}})[_0xe42b('0x28')](function(_0x588e40){if(!_0x588e40){throw new db[(_0xe42b('0x57'))]['ValidationError'](_0xe42b('0x81'));}_0x44a845=_0x588e40;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0xe42b('0x28')](handleEntityNotFound(_0x3fd1b4,null))[_0xe42b('0x28')](function(_0x3ce2fb){if(_0x3ce2fb){_0x7315a2=_0x3ce2fb;if(!_0x7315a2[_0xe42b('0x82')]||!_0x7315a2[_0xe42b('0x83')]||!_0x7315a2[_0xe42b('0x84')]||!_0x7315a2[_0xe42b('0x85')]||!_0x7315a2[_0xe42b('0x75')]){throw new db[(_0xe42b('0x57'))]['ValidationError'](_0xe42b('0x86'));}if(_0x3e0de0['body'][_0xe42b('0x87')]&&(!_0x7315a2[_0xe42b('0x88')]||!_0x7315a2[_0xe42b('0x89')]||!_0x7315a2[_0xe42b('0x8a')]||!_0x7315a2[_0xe42b('0x85')]||!_0x7315a2[_0xe42b('0x75')])){throw new db[(_0xe42b('0x57'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xe42b('0x8b')][_0xe42b('0x80')]({'where':{'id':_0x7315a2['transcribeAccountId']}});}})[_0xe42b('0x28')](function(_0x854ad9){if(!_0x854ad9){throw new db[(_0xe42b('0x57'))][(_0xe42b('0x64'))](_0xe42b('0x8c'));}if(!_0x854ad9[_0xe42b('0x8d')]||!_0x854ad9['data2']){throw new db['Sequelize'][(_0xe42b('0x64'))](_0xe42b('0x8e'));}_0x4755a0=_0x854ad9;return getBucketslist(_0x4755a0['data1'],_0x4755a0[_0xe42b('0x8f')],_0x7315a2[_0xe42b('0x84')]);})['then'](function(_0x498372){if(_0x498372&&_0x498372[_0xe42b('0x90')]){var _0x18700c=_[_0xe42b('0x4b')](_0x498372[_0xe42b('0x90')],function(_0x2308c1){return _0x2308c1[_0xe42b('0x91')]===_0x7315a2[_0xe42b('0x75')];});if(!_0x18700c){logger[_0xe42b('0x67')](util[_0xe42b('0x36')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x3e0de0['params']['id'],_0x7315a2[_0xe42b('0x75')]));return createBucket(_0x4755a0['data1'],_0x4755a0[_0xe42b('0x8f')],_0x7315a2[_0xe42b('0x84')],_0x7315a2[_0xe42b('0x75')]);}logger[_0xe42b('0x67')](util['format'](_0xe42b('0x92'),_0x3e0de0[_0xe42b('0x49')]['id'],_0x7315a2['bucket']));return;}})['then'](function(_0x3519db){if(_0x44a845[_0xe42b('0x7d')]===_0xe42b('0x93')){return transcribe(_0x3e0de0[_0xe42b('0x49')]['id'],_0x4755a0[_0xe42b('0x8d')],_0x4755a0[_0xe42b('0x8f')],_0x7315a2[_0xe42b('0x84')],_0x7315a2[_0xe42b('0x75')],_0x44a845['value'],_0x7315a2['language']);}else{logger[_0xe42b('0x67')](util[_0xe42b('0x36')](_0xe42b('0x94'),_0x3e0de0[_0xe42b('0x49')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x1d9f0e){if(_0x1d9f0e){_0x1d9f0e[_0xe42b('0x95')]=_0x3e0de0[_0xe42b('0x4d')][_0xe42b('0x87')];return _0x44a845[_0xe42b('0x96')](_0x1d9f0e);}})[_0xe42b('0x28')](respondWithResult(_0x3fd1b4,null))[_0xe42b('0x4f')](handleError(_0x3fd1b4,null));};function writeFile(_0x2c6868,_0x1e8391){return new Promise(function(_0x1031a1,_0x1b2f00){fs['writeFile'](_0x1e8391,_0x2c6868,function(_0x1a03f,_0x14de88){if(_0x1a03f){return _0x1b2f00(_0x1a03f);}else{return _0x1031a1(_0x14de88);}});});}exports[_0xe42b('0x97')]=function(_0x588225,_0x17fc4f,_0x4b1778){return db[_0xe42b('0x2f')][_0xe42b('0x80')]({'where':{'id':_0x588225['params']['id']}})[_0xe42b('0x28')](handleEntityNotFound(_0x17fc4f))[_0xe42b('0x28')](function(_0x152dc0){if(_0x152dc0&&_0x152dc0[_0xe42b('0x98')]){var _0x4b17a6=_0x152dc0[_0xe42b('0x98')];var _0x18f005=config[_0xe42b('0x99')]+_0xe42b('0x9a')+_0x152dc0['id']+'.txt';if(fs['existsSync'](_0x18f005)){return _0x18f005;}return writeFile(_0x4b17a6,_0x18f005)['then'](function(){return _0x18f005;});}else{throw new db['Sequelize'][(_0xe42b('0x64'))](_0xe42b('0x9b'));}})['then'](function(_0x3eed4d){return _0x17fc4f[_0xe42b('0x59')](_0x3eed4d);})[_0xe42b('0x4f')](handleError(_0x17fc4f));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 8bfd50b..2ca6bde 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 _0x0a9a=['voice_recordings','uniqueid','transcribeStatus','exports','define','VoiceRecording'];(function(_0x39bca3,_0x504fc4){var _0x22361c=function(_0x3c7d32){while(--_0x3c7d32){_0x39bca3['push'](_0x39bca3['shift']());}};_0x22361c(++_0x504fc4);}(_0x0a9a,0x183));var _0xa0a9=function(_0x3dac4c,_0x2dd710){_0x3dac4c=_0x3dac4c-0x0;var _0x3cafd7=_0x0a9a[_0x3dac4c];return _0x3cafd7;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0xa0a9('0x0')]=function(_0x51baa8,_0x3b1a40){return _0x51baa8[_0xa0a9('0x1')](_0xa0a9('0x2'),attributes,{'tableName':_0xa0a9('0x3'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa0a9('0x4')]},{'name':_0xa0a9('0x5'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x84e1=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording'];(function(_0x117fad,_0x39e4e2){var _0x529e78=function(_0x41e223){while(--_0x41e223){_0x117fad['push'](_0x117fad['shift']());}};_0x529e78(++_0x39e4e2);}(_0x84e1,0x1dc));var _0x184e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x84e1[_0xdea41a];return _0x15d0d8;};'use strict';var attributes=require(_0x184e('0x0'));module[_0x184e('0x1')]=function(_0x1cb42b,_0x1e7e1f){return _0x1cb42b[_0x184e('0x2')](_0x184e('0x3'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x184e('0x4'),'fields':[_0x184e('0x4')]},{'name':_0x184e('0x5'),'fields':[_0x184e('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 2711e10..d37df06 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 _0xfcbb=['VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','attributes','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','encryptFile','recording','unlink','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x275941,_0x946408){_0x275941=_0x275941-0x0;var _0x27ecd9=_0xfcbb[_0x275941];return _0x27ecd9;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')](_0xba1d6['body'],{'raw':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['where']||null:null,'attributes':_0xba1d6['options']?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1a')]||null:null,'limit':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1b')]||null:null})['then'](function(_0x365d6c){logger[_0xbfcb('0xb')](_0xbfcb('0x16'),_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x365d6c));_0x3404aa(_0x365d6c);})[_0xbfcb('0x15')](function(_0x14e43c){logger[_0xbfcb('0x10')](_0xbfcb('0x16'),_0x14e43c[_0xbfcb('0x13')],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x14e43c[_0xbfcb('0x13')]));});});};exports[_0xbfcb('0x1c')]=function(_0x3e954d){var _0x2a1272=this;return new Promise(function(_0x5cd703,_0x3465f5){var _0x2881f8=require('../../components/encryptor');var _0x64a69;return db[_0xbfcb('0x1d')][_0xbfcb('0x1e')]({'attributes':['id',_0xbfcb('0x1f')],'where':{'id':0x1},'raw':!![]})[_0xbfcb('0xa')](function(_0x3542e9){_0x64a69=_0x3542e9;return db[_0xbfcb('0x17')][_0xbfcb('0x20')](_0x3e954d[_0xbfcb('0x21')]);})[_0xbfcb('0xa')](function(_0x59719b){if(_0x64a69[_0xbfcb('0x1f')]&&fs[_0xbfcb('0x22')](_0x59719b[_0xbfcb('0x23')])){var _0x43de3c=util[_0xbfcb('0x24')](_0xbfcb('0x25'),_0x59719b[_0xbfcb('0x23')]);return _0x2881f8[_0xbfcb('0x26')](_0x59719b[_0xbfcb('0x23')],_0x43de3c,config['secrets'][_0xbfcb('0x27')])[_0xbfcb('0xa')](function(){fs[_0xbfcb('0x28')](_0x59719b[_0xbfcb('0x23')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x59719b;});}return _0x59719b;})[_0xbfcb('0xa')](function(_0x35925b){logger[_0xbfcb('0xb')](_0xbfcb('0x1c'),_0x3e954d);logger[_0xbfcb('0xd')](_0xbfcb('0x1c'),_0x3e954d,JSON[_0xbfcb('0xf')](_0x35925b));_0x5cd703(_0x35925b);})['catch'](function(_0x504d81){logger['error'](_0xbfcb('0x1c'),_0x504d81['message'],_0x3e954d);_0x3465f5(_0x2a1272[_0xbfcb('0x10')](0x1f4,_0x504d81[_0xbfcb('0x13')]));});});}; \ No newline at end of file +var _0xe5af=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','raw','options','where','limit','debug','../../components/encryptor','Setting','create','existsSync','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xe5af,0x9c));var _0xfe5a=function(_0x2836b4,_0x3f1ce3){_0x2836b4=_0x2836b4-0x0;var _0x345d95=_0xe5af[_0x2836b4];return _0x345d95;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe5a('0x2'));var fs=require('fs');var Redis=require(_0xfe5a('0x3'));var db=require(_0xfe5a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe5a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe5a('0x6'));var client=jayson[_0xfe5a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eea2e,_0x356c69,_0x106492){return new BPromise(function(_0xfb4357,_0x3e683c){return client['request'](_0x5eea2e,_0x106492)[_0xfe5a('0x8')](function(_0x5a48ff){logger['info'](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));logger['debug'](_0xfe5a('0xb'),_0x356c69,_0xfe5a('0xa'),JSON[_0xfe5a('0xc')](_0x5a48ff));if(_0x5a48ff[_0xfe5a('0xd')]){if(_0x5a48ff[_0xfe5a('0xd')]['code']===0x1f4){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0x3e683c(_0x5a48ff[_0xfe5a('0xd')]['message']);}logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0xfb4357(_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));_0xfb4357(_0x5a48ff[_0xfe5a('0x10')][_0xfe5a('0xe')]);}})[_0xfe5a('0x11')](function(_0x22afa7){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x22afa7);_0x3e683c(_0x22afa7);});});}exports[_0xfe5a('0x12')]=function(_0x5bf597){var _0x20620b=this;return new Promise(function(_0x456707,_0x54d5fb){return db[_0xfe5a('0x13')][_0xfe5a('0x14')](_0x5bf597[_0xfe5a('0x15')],{'raw':_0x5bf597['options']?_0x5bf597['options'][_0xfe5a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bf597[_0xfe5a('0x17')]?_0x5bf597[_0xfe5a('0x17')][_0xfe5a('0x18')]||null:null,'attributes':_0x5bf597[_0xfe5a('0x17')]?_0x5bf597[_0xfe5a('0x17')]['attributes']||null:null,'limit':_0x5bf597[_0xfe5a('0x17')]?_0x5bf597['options'][_0xfe5a('0x19')]||null:null})[_0xfe5a('0x8')](function(_0x1fbde5){logger['info']('UpdateVoiceRecording',_0x5bf597);logger[_0xfe5a('0x1a')](_0xfe5a('0x12'),_0x5bf597,JSON['stringify'](_0x1fbde5));_0x456707(_0x1fbde5);})[_0xfe5a('0x11')](function(_0x26f744){logger['error'](_0xfe5a('0x12'),_0x26f744[_0xfe5a('0xe')],_0x5bf597);_0x54d5fb(_0x20620b[_0xfe5a('0xd')](0x1f4,_0x26f744[_0xfe5a('0xe')]));});});};exports['CreateVoiceRecording']=function(_0x42136e){var _0x2f5d04=this;return new Promise(function(_0x24481f,_0x1cd531){var _0x36bf20=require(_0xfe5a('0x1b'));var _0xdbf1e0;return db[_0xfe5a('0x1c')]['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xfe5a('0x8')](function(_0x485f9d){_0xdbf1e0=_0x485f9d;return db[_0xfe5a('0x13')][_0xfe5a('0x1d')](_0x42136e[_0xfe5a('0x15')]);})['then'](function(_0x48a061){if(_0xdbf1e0['callRecordingEncryption']&&fs[_0xfe5a('0x1e')](_0x48a061['value'])){var _0x51d1f4=util['format'](_0xfe5a('0x1f'),_0x48a061[_0xfe5a('0x20')]);return _0x36bf20[_0xfe5a('0x21')](_0x48a061[_0xfe5a('0x20')],_0x51d1f4,config[_0xfe5a('0x22')][_0xfe5a('0x23')])[_0xfe5a('0x8')](function(){fs[_0xfe5a('0x24')](_0x48a061[_0xfe5a('0x20')]);logger[_0xfe5a('0xf')](_0xfe5a('0x25'));return _0x48a061;});}return _0x48a061;})['then'](function(_0x1f0c86){logger[_0xfe5a('0xf')]('CreateVoiceRecording',_0x42136e);logger[_0xfe5a('0x1a')](_0xfe5a('0x26'),_0x42136e,JSON[_0xfe5a('0xc')](_0x1f0c86));_0x24481f(_0x1f0c86);})[_0xfe5a('0x11')](function(_0xe5a992){logger['error']('CreateVoiceRecording',_0xe5a992[_0xfe5a('0xe')],_0x42136e);_0x1cd531(_0x2f5d04['error'](0x1f4,_0xe5a992[_0xfe5a('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 8a5adbb..dccfbc1 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 _0x07c3=['isAuthenticated','index','describe','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout','Router','../../config/environment','get'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x07c3,0x18a));var _0x307c=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0x07c3[_0x32c012];return _0x48562e;};'use strict';var multer=require('multer');var util=require(_0x307c('0x0'));var path=require(_0x307c('0x1'));var timeout=require(_0x307c('0x2'));var express=require('express');var router=express[_0x307c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x307c('0x4'));var controller=require('./voiceTransferReport.controller');router[_0x307c('0x5')]('/',auth[_0x307c('0x6')](),controller[_0x307c('0x7')]);router[_0x307c('0x5')]('/describe',auth[_0x307c('0x6')](),controller[_0x307c('0x8')]);router[_0x307c('0x5')](_0x307c('0x9'),auth[_0x307c('0x6')](),controller[_0x307c('0xa')]);router[_0x307c('0xb')]('/',auth[_0x307c('0x6')](),controller['create']);router['put'](_0x307c('0x9'),auth[_0x307c('0x6')](),controller[_0x307c('0xc')]);router[_0x307c('0xd')](_0x307c('0x9'),auth[_0x307c('0x6')](),controller[_0x307c('0xe')]);module[_0x307c('0xf')]=router; \ No newline at end of file +var _0xfb9a=['../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfb9a,0x187));var _0xafb9=function(_0xe7841f,_0x2344b0){_0xe7841f=_0xe7841f-0x0;var _0x84c558=_0xfb9a[_0xe7841f];return _0x84c558;};'use strict';var multer=require(_0xafb9('0x0'));var util=require('util');var path=require(_0xafb9('0x1'));var timeout=require(_0xafb9('0x2'));var express=require(_0xafb9('0x3'));var router=express[_0xafb9('0x4')]();var fs_extra=require(_0xafb9('0x5'));var auth=require(_0xafb9('0x6'));var interaction=require(_0xafb9('0x7'));var config=require(_0xafb9('0x8'));var controller=require(_0xafb9('0x9'));router[_0xafb9('0xa')]('/',auth[_0xafb9('0xb')](),controller[_0xafb9('0xc')]);router[_0xafb9('0xa')](_0xafb9('0xd'),auth[_0xafb9('0xb')](),controller['describe']);router[_0xafb9('0xa')](_0xafb9('0xe'),auth[_0xafb9('0xb')](),controller['show']);router['post']('/',auth[_0xafb9('0xb')](),controller[_0xafb9('0xf')]);router[_0xafb9('0x10')](_0xafb9('0xe'),auth[_0xafb9('0xb')](),controller[_0xafb9('0x11')]);router[_0xafb9('0x12')](_0xafb9('0xe'),auth[_0xafb9('0xb')](),controller[_0xafb9('0x13')]);module[_0xafb9('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index ade9432..ee32cec 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 _0x49d5=['moment','exports','blind','STRING','Yes'];(function(_0x4fb930,_0x4141c4){var _0x59adc4=function(_0x540aef){while(--_0x540aef){_0x4fb930['push'](_0x4fb930['shift']());}};_0x59adc4(++_0x4141c4);}(_0x49d5,0xd2));var _0x549d=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x49d5[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x549d('0x0'));module[_0x549d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x549d('0x2'),'attended')},'result':{'type':Sequelize[_0x549d('0x3')]},'transfererchannel':{'type':Sequelize[_0x549d('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x549d('0x3')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x549d('0x3')]},'transfererexten':{'type':Sequelize[_0x549d('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x549d('0x3')]},'transfereechannel':{'type':Sequelize[_0x549d('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x549d('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x549d('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x549d('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x549d('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x549d('0x3')]},'isexternal':{'type':Sequelize['ENUM'](_0x549d('0x4'),'No')},'context':{'type':Sequelize[_0x549d('0x3')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6641=['Yes','moment','exports','blind','attended','STRING'];(function(_0xd6dade,_0x4b7a6a){var _0xf25500=function(_0x5ae278){while(--_0x5ae278){_0xd6dade['push'](_0xd6dade['shift']());}};_0xf25500(++_0x4b7a6a);}(_0x6641,0x103));var _0x1664=function(_0x2896e5,_0x362e5f){_0x2896e5=_0x2896e5-0x0;var _0x43210d=_0x6641[_0x2896e5];return _0x43210d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1664('0x0'));module[_0x1664('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1664('0x2'),_0x1664('0x3'))},'result':{'type':Sequelize[_0x1664('0x4')]},'transfererchannel':{'type':Sequelize[_0x1664('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x1664('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x1664('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x1664('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x1664('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x1664('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x1664('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1664('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x1664('0x4')]},'transfereecontext':{'type':Sequelize[_0x1664('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x1664('0x5'),'No')},'context':{'type':Sequelize[_0x1664('0x4')]},'extension':{'type':Sequelize[_0x1664('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 337eb30..51ac6a2 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 _0xb4b4=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','query','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','options','includeAll','rows','catch','params','keys','length','create','body','update','find','destroy','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x11a4d2,_0x1e61af){var _0x55423b=function(_0x57c7cc){while(--_0x57c7cc){_0x11a4d2['push'](_0x11a4d2['shift']());}};_0x55423b(++_0x1e61af);}(_0xb4b4,0x1ad));var _0x4b4b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xb4b4[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0x4b4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b4b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b4b('0x2'));var moment=require('moment');var BPromise=require(_0x4b4b('0x3'));var Mustache=require(_0x4b4b('0x4'));var util=require(_0x4b4b('0x5'));var path=require(_0x4b4b('0x6'));var sox=require(_0x4b4b('0x7'));var csv=require(_0x4b4b('0x8'));var ejs=require(_0x4b4b('0x9'));var fs=require('fs');var fs_extra=require(_0x4b4b('0xa'));var _=require('lodash');var squel=require(_0x4b4b('0xb'));var crypto=require(_0x4b4b('0xc'));var jsforce=require(_0x4b4b('0xd'));var deskjs=require(_0x4b4b('0xe'));var toCsv=require(_0x4b4b('0x8'));var querystring=require(_0x4b4b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4b4b('0x10'));var qs=require(_0x4b4b('0x11'));var as=require(_0x4b4b('0x12'));var hardwareService=require(_0x4b4b('0x13'));var logger=require(_0x4b4b('0x14'))(_0x4b4b('0x15'));var utils=require(_0x4b4b('0x16'));var config=require(_0x4b4b('0x17'));var licenseUtil=require(_0x4b4b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x413448,_0x14fbb1){_0x14fbb1=_0x14fbb1||0xcc;return function(_0xdfef45){if(_0xdfef45){return _0x413448[_0x4b4b('0x19')](_0x14fbb1);}return _0x413448['status'](_0x14fbb1)[_0x4b4b('0x1a')]();};}function respondWithResult(_0x246ae6,_0xd8f387){_0xd8f387=_0xd8f387||0xc8;return function(_0x10d3dd){if(_0x10d3dd){return _0x246ae6[_0x4b4b('0x1b')](_0xd8f387)[_0x4b4b('0x1c')](_0x10d3dd);}};}function respondWithFilteredResult(_0x579f65,_0x4163c5){return function(_0x1bbac7){if(_0x1bbac7){var _0x49492c=typeof _0x4163c5[_0x4b4b('0x1d')]===_0x4b4b('0x1e')&&typeof _0x4163c5[_0x4b4b('0x1f')]==='undefined';var _0x1a945f=_0x1bbac7[_0x4b4b('0x20')];var _0x7889df=_0x49492c?0x0:_0x4163c5[_0x4b4b('0x1d')];var _0x32a298=_0x49492c?_0x1bbac7[_0x4b4b('0x20')]:_0x4163c5[_0x4b4b('0x1d')]+_0x4163c5[_0x4b4b('0x1f')];var _0x51be69;if(_0x32a298>=_0x1a945f){_0x32a298=_0x1a945f;_0x51be69=0xc8;}else{_0x51be69=0xce;}_0x579f65[_0x4b4b('0x1b')](_0x51be69);return _0x579f65[_0x4b4b('0x21')](_0x4b4b('0x22'),_0x7889df+'-'+_0x32a298+'/'+_0x1a945f)[_0x4b4b('0x1c')](_0x1bbac7);}return null;};}function patchUpdates(_0x58ed5e){return function(_0x1a0181){try{jsonpatch['apply'](_0x1a0181,_0x58ed5e,!![]);}catch(_0x1c7c54){return BPromise[_0x4b4b('0x23')](_0x1c7c54);}return _0x1a0181[_0x4b4b('0x24')]();};}function saveUpdates(_0x271618,_0x51e2bb){return function(_0x3dc5b4){if(_0x3dc5b4){return _0x3dc5b4['update'](_0x271618)[_0x4b4b('0x25')](function(_0x4c2b2){return _0x4c2b2;});}return null;};}function removeEntity(_0x33b7cc,_0x3db182){return function(_0x553791){if(_0x553791){return _0x553791['destroy']()['then'](function(){_0x33b7cc[_0x4b4b('0x1b')](0xcc)[_0x4b4b('0x1a')]();});}};}function handleEntityNotFound(_0x57a168,_0x5482fd){return function(_0x3711d9){if(!_0x3711d9){_0x57a168[_0x4b4b('0x19')](0x194);}return _0x3711d9;};}function handleError(_0x9a41b4,_0x5e4f1e){_0x5e4f1e=_0x5e4f1e||0x1f4;return function(_0x54cbb7){logger[_0x4b4b('0x26')](_0x54cbb7[_0x4b4b('0x27')]);if(_0x54cbb7[_0x4b4b('0x28')]){delete _0x54cbb7[_0x4b4b('0x28')];}_0x9a41b4[_0x4b4b('0x1b')](_0x5e4f1e)[_0x4b4b('0x29')](_0x54cbb7);};}exports[_0x4b4b('0x2a')]=function(_0x3cf8eb,_0x4803cd){var _0x20c16c={},_0x57c8c3={},_0x3f4160={'count':0x0,'rows':[]};var _0x21cd1e=_[_0x4b4b('0x2b')](db[_0x4b4b('0x2c')][_0x4b4b('0x2d')],function(_0x40b19c){return{'name':_0x40b19c[_0x4b4b('0x2e')],'type':_0x40b19c['type']['key']};});_0x57c8c3['model']=_[_0x4b4b('0x2b')](_0x21cd1e,_0x4b4b('0x28'));_0x57c8c3['query']=_['keys'](_0x3cf8eb[_0x4b4b('0x2f')]);_0x57c8c3[_0x4b4b('0x30')]=_[_0x4b4b('0x31')](_0x57c8c3['model'],_0x57c8c3['query']);_0x20c16c['attributes']=_[_0x4b4b('0x31')](_0x57c8c3['model'],qs[_0x4b4b('0x32')](_0x3cf8eb[_0x4b4b('0x2f')][_0x4b4b('0x32')]));_0x20c16c[_0x4b4b('0x33')]=_0x20c16c[_0x4b4b('0x33')]['length']?_0x20c16c[_0x4b4b('0x33')]:_0x57c8c3[_0x4b4b('0x34')];if(!_0x3cf8eb['query'][_0x4b4b('0x35')](_0x4b4b('0x36'))){_0x20c16c[_0x4b4b('0x1f')]=qs[_0x4b4b('0x1f')](_0x3cf8eb[_0x4b4b('0x2f')][_0x4b4b('0x1f')]);_0x20c16c[_0x4b4b('0x1d')]=qs['offset'](_0x3cf8eb[_0x4b4b('0x2f')][_0x4b4b('0x1d')]);}_0x20c16c[_0x4b4b('0x37')]=qs['sort'](_0x3cf8eb[_0x4b4b('0x2f')]['sort']);_0x20c16c[_0x4b4b('0x38')]=qs[_0x4b4b('0x30')](_[_0x4b4b('0x39')](_0x3cf8eb[_0x4b4b('0x2f')],_0x57c8c3[_0x4b4b('0x30')]),_0x21cd1e);if(_0x3cf8eb[_0x4b4b('0x2f')][_0x4b4b('0x3a')]){_0x20c16c['where']=_[_0x4b4b('0x3b')](_0x20c16c[_0x4b4b('0x38')],{'$or':_[_0x4b4b('0x2b')](_0x21cd1e,function(_0x4bccfb){if(_0x4bccfb[_0x4b4b('0x3c')]!=='VIRTUAL'){var _0x126fc6={};_0x126fc6[_0x4bccfb[_0x4b4b('0x28')]]={'$like':'%'+_0x3cf8eb[_0x4b4b('0x2f')]['filter']+'%'};return _0x126fc6;}})});}_0x20c16c=_[_0x4b4b('0x3b')]({},_0x20c16c,_0x3cf8eb[_0x4b4b('0x3d')]);var _0x1dcfb6={'where':_0x20c16c[_0x4b4b('0x38')]};return db[_0x4b4b('0x2c')][_0x4b4b('0x20')](_0x1dcfb6)[_0x4b4b('0x25')](function(_0x28135b){_0x3f4160[_0x4b4b('0x20')]=_0x28135b;if(_0x3cf8eb[_0x4b4b('0x2f')][_0x4b4b('0x3e')]){_0x20c16c['include']=[{'all':!![]}];}return db[_0x4b4b('0x2c')]['findAll'](_0x20c16c);})[_0x4b4b('0x25')](function(_0xfad7d7){_0x3f4160[_0x4b4b('0x3f')]=_0xfad7d7;return _0x3f4160;})[_0x4b4b('0x25')](respondWithFilteredResult(_0x4803cd,_0x20c16c))[_0x4b4b('0x40')](handleError(_0x4803cd,null));};exports['show']=function(_0x27849c,_0x5c1e2c){var _0x1b1dd5={'raw':!![],'where':{'id':_0x27849c[_0x4b4b('0x41')]['id']}},_0x5e1cb4={};_0x5e1cb4['model']=_['keys'](db[_0x4b4b('0x2c')][_0x4b4b('0x2d')]);_0x5e1cb4[_0x4b4b('0x2f')]=_[_0x4b4b('0x42')](_0x27849c[_0x4b4b('0x2f')]);_0x5e1cb4[_0x4b4b('0x30')]=_['intersection'](_0x5e1cb4[_0x4b4b('0x34')],_0x5e1cb4[_0x4b4b('0x2f')]);_0x1b1dd5[_0x4b4b('0x33')]=_[_0x4b4b('0x31')](_0x5e1cb4[_0x4b4b('0x34')],qs['fields'](_0x27849c[_0x4b4b('0x2f')][_0x4b4b('0x32')]));_0x1b1dd5[_0x4b4b('0x33')]=_0x1b1dd5[_0x4b4b('0x33')][_0x4b4b('0x43')]?_0x1b1dd5[_0x4b4b('0x33')]:_0x5e1cb4[_0x4b4b('0x34')];if(_0x27849c[_0x4b4b('0x2f')][_0x4b4b('0x3e')]){_0x1b1dd5['include']=[{'all':!![]}];}_0x1b1dd5=_['merge']({},_0x1b1dd5,_0x27849c[_0x4b4b('0x3d')]);return db[_0x4b4b('0x2c')]['find'](_0x1b1dd5)[_0x4b4b('0x25')](handleEntityNotFound(_0x5c1e2c,null))[_0x4b4b('0x25')](respondWithResult(_0x5c1e2c,null))[_0x4b4b('0x40')](handleError(_0x5c1e2c,null));};exports[_0x4b4b('0x44')]=function(_0x4a2e61,_0x43e5a4){return db[_0x4b4b('0x2c')]['create'](_0x4a2e61[_0x4b4b('0x45')],{})['then'](respondWithResult(_0x43e5a4,0xc9))[_0x4b4b('0x40')](handleError(_0x43e5a4,null));};exports[_0x4b4b('0x46')]=function(_0x21f66c,_0x2f3754){if(_0x21f66c[_0x4b4b('0x45')]['id']){delete _0x21f66c[_0x4b4b('0x45')]['id'];}return db[_0x4b4b('0x2c')][_0x4b4b('0x47')]({'where':{'id':_0x21f66c[_0x4b4b('0x41')]['id']}})[_0x4b4b('0x25')](handleEntityNotFound(_0x2f3754,null))[_0x4b4b('0x25')](saveUpdates(_0x21f66c[_0x4b4b('0x45')],null))['then'](respondWithResult(_0x2f3754,null))[_0x4b4b('0x40')](handleError(_0x2f3754,null));};exports[_0x4b4b('0x48')]=function(_0xbd7575,_0x2b7aa3){return db[_0x4b4b('0x2c')]['find']({'where':{'id':_0xbd7575['params']['id']}})['then'](handleEntityNotFound(_0x2b7aa3,null))['then'](removeEntity(_0x2b7aa3,null))[_0x4b4b('0x40')](handleError(_0x2b7aa3,null));};exports['describe']=function(_0x169b55,_0x2f05e4){return db[_0x4b4b('0x2c')]['describe']()[_0x4b4b('0x25')](respondWithResult(_0x2f05e4,null))[_0x4b4b('0x40')](handleError(_0x2f05e4,null));}; \ No newline at end of file +var _0xcfef=['filter','merge','VIRTUAL','options','where','VoiceTransferReport','includeAll','findAll','rows','show','params','create','catch','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xcfef,0x1ea));var _0xfcfe=function(_0x53b345,_0x53df63){_0x53b345=_0x53b345-0x0;var _0x78892c=_0xcfef[_0x53b345];return _0x78892c;};'use strict';var emlformat=require(_0xfcfe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfcfe('0x1'));var jsonpatch=require(_0xfcfe('0x2'));var rp=require('request-promise');var moment=require(_0xfcfe('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfcfe('0x4'));var util=require(_0xfcfe('0x5'));var path=require(_0xfcfe('0x6'));var sox=require(_0xfcfe('0x7'));var csv=require('to-csv');var ejs=require(_0xfcfe('0x8'));var fs=require('fs');var fs_extra=require(_0xfcfe('0x9'));var _=require(_0xfcfe('0xa'));var squel=require(_0xfcfe('0xb'));var crypto=require(_0xfcfe('0xc'));var jsforce=require(_0xfcfe('0xd'));var deskjs=require(_0xfcfe('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfcfe('0xf'));var Papa=require(_0xfcfe('0x10'));var Redis=require('ioredis');var authService=require(_0xfcfe('0x11'));var qs=require(_0xfcfe('0x12'));var as=require(_0xfcfe('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfcfe('0x14'));var utils=require(_0xfcfe('0x15'));var config=require(_0xfcfe('0x16'));var licenseUtil=require(_0xfcfe('0x17'));var db=require(_0xfcfe('0x18'))['db'];function respondWithStatusCode(_0x18abdd,_0x19e2a3){_0x19e2a3=_0x19e2a3||0xcc;return function(_0x19c3e3){if(_0x19c3e3){return _0x18abdd['sendStatus'](_0x19e2a3);}return _0x18abdd['status'](_0x19e2a3)[_0xfcfe('0x19')]();};}function respondWithResult(_0xdaf741,_0x42dd64){_0x42dd64=_0x42dd64||0xc8;return function(_0x60b0ba){if(_0x60b0ba){return _0xdaf741[_0xfcfe('0x1a')](_0x42dd64)[_0xfcfe('0x1b')](_0x60b0ba);}};}function respondWithFilteredResult(_0xfec954,_0x453849){return function(_0x552e1f){if(_0x552e1f){var _0x2eb5ec=typeof _0x453849[_0xfcfe('0x1c')]===_0xfcfe('0x1d')&&typeof _0x453849[_0xfcfe('0x1e')]==='undefined';var _0x4d8b8a=_0x552e1f[_0xfcfe('0x1f')];var _0x3b9e6e=_0x2eb5ec?0x0:_0x453849[_0xfcfe('0x1c')];var _0x5efacc=_0x2eb5ec?_0x552e1f[_0xfcfe('0x1f')]:_0x453849[_0xfcfe('0x1c')]+_0x453849[_0xfcfe('0x1e')];var _0x32bedc;if(_0x5efacc>=_0x4d8b8a){_0x5efacc=_0x4d8b8a;_0x32bedc=0xc8;}else{_0x32bedc=0xce;}_0xfec954[_0xfcfe('0x1a')](_0x32bedc);return _0xfec954[_0xfcfe('0x20')](_0xfcfe('0x21'),_0x3b9e6e+'-'+_0x5efacc+'/'+_0x4d8b8a)[_0xfcfe('0x1b')](_0x552e1f);}return null;};}function patchUpdates(_0x24fe4f){return function(_0x45768e){try{jsonpatch[_0xfcfe('0x22')](_0x45768e,_0x24fe4f,!![]);}catch(_0x15e89e){return BPromise[_0xfcfe('0x23')](_0x15e89e);}return _0x45768e[_0xfcfe('0x24')]();};}function saveUpdates(_0x50d094,_0x1acdb0){return function(_0x39de80){if(_0x39de80){return _0x39de80[_0xfcfe('0x25')](_0x50d094)[_0xfcfe('0x26')](function(_0x2bd310){return _0x2bd310;});}return null;};}function removeEntity(_0x19bb23,_0x1b7bdd){return function(_0xd940ec){if(_0xd940ec){return _0xd940ec[_0xfcfe('0x27')]()[_0xfcfe('0x26')](function(){_0x19bb23[_0xfcfe('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44f458,_0x2c8c3e){return function(_0x10cf22){if(!_0x10cf22){_0x44f458[_0xfcfe('0x28')](0x194);}return _0x10cf22;};}function handleError(_0x23ee49,_0x471f21){_0x471f21=_0x471f21||0x1f4;return function(_0x13ab27){logger['error'](_0x13ab27[_0xfcfe('0x29')]);if(_0x13ab27[_0xfcfe('0x2a')]){delete _0x13ab27[_0xfcfe('0x2a')];}_0x23ee49[_0xfcfe('0x1a')](_0x471f21)[_0xfcfe('0x2b')](_0x13ab27);};}exports[_0xfcfe('0x2c')]=function(_0x28eaa3,_0x3c0d9d){var _0x2b4b63={},_0x5cb097={},_0x494467={'count':0x0,'rows':[]};var _0x571190=_[_0xfcfe('0x2d')](db['VoiceTransferReport'][_0xfcfe('0x2e')],function(_0x4adeb1){return{'name':_0x4adeb1[_0xfcfe('0x2f')],'type':_0x4adeb1[_0xfcfe('0x30')][_0xfcfe('0x31')]};});_0x5cb097[_0xfcfe('0x32')]=_[_0xfcfe('0x2d')](_0x571190,_0xfcfe('0x2a'));_0x5cb097['query']=_[_0xfcfe('0x33')](_0x28eaa3[_0xfcfe('0x34')]);_0x5cb097[_0xfcfe('0x35')]=_[_0xfcfe('0x36')](_0x5cb097[_0xfcfe('0x32')],_0x5cb097[_0xfcfe('0x34')]);_0x2b4b63['attributes']=_[_0xfcfe('0x36')](_0x5cb097['model'],qs[_0xfcfe('0x37')](_0x28eaa3[_0xfcfe('0x34')][_0xfcfe('0x37')]));_0x2b4b63['attributes']=_0x2b4b63[_0xfcfe('0x38')][_0xfcfe('0x39')]?_0x2b4b63[_0xfcfe('0x38')]:_0x5cb097[_0xfcfe('0x32')];if(!_0x28eaa3[_0xfcfe('0x34')][_0xfcfe('0x3a')](_0xfcfe('0x3b'))){_0x2b4b63[_0xfcfe('0x1e')]=qs[_0xfcfe('0x1e')](_0x28eaa3['query'][_0xfcfe('0x1e')]);_0x2b4b63[_0xfcfe('0x1c')]=qs[_0xfcfe('0x1c')](_0x28eaa3[_0xfcfe('0x34')][_0xfcfe('0x1c')]);}_0x2b4b63[_0xfcfe('0x3c')]=qs[_0xfcfe('0x3d')](_0x28eaa3['query']['sort']);_0x2b4b63['where']=qs[_0xfcfe('0x35')](_[_0xfcfe('0x3e')](_0x28eaa3['query'],_0x5cb097[_0xfcfe('0x35')]),_0x571190);if(_0x28eaa3[_0xfcfe('0x34')][_0xfcfe('0x3f')]){_0x2b4b63['where']=_[_0xfcfe('0x40')](_0x2b4b63['where'],{'$or':_[_0xfcfe('0x2d')](_0x571190,function(_0x57d52f){if(_0x57d52f['type']!==_0xfcfe('0x41')){var _0x56ac87={};_0x56ac87[_0x57d52f[_0xfcfe('0x2a')]]={'$like':'%'+_0x28eaa3[_0xfcfe('0x34')][_0xfcfe('0x3f')]+'%'};return _0x56ac87;}})});}_0x2b4b63=_[_0xfcfe('0x40')]({},_0x2b4b63,_0x28eaa3[_0xfcfe('0x42')]);var _0x32a364={'where':_0x2b4b63[_0xfcfe('0x43')]};return db[_0xfcfe('0x44')]['count'](_0x32a364)[_0xfcfe('0x26')](function(_0x398353){_0x494467[_0xfcfe('0x1f')]=_0x398353;if(_0x28eaa3[_0xfcfe('0x34')][_0xfcfe('0x45')]){_0x2b4b63['include']=[{'all':!![]}];}return db[_0xfcfe('0x44')][_0xfcfe('0x46')](_0x2b4b63);})[_0xfcfe('0x26')](function(_0x53ba36){_0x494467[_0xfcfe('0x47')]=_0x53ba36;return _0x494467;})['then'](respondWithFilteredResult(_0x3c0d9d,_0x2b4b63))['catch'](handleError(_0x3c0d9d,null));};exports[_0xfcfe('0x48')]=function(_0x7c327f,_0x2708ab){var _0x16f9aa={'raw':!![],'where':{'id':_0x7c327f[_0xfcfe('0x49')]['id']}},_0x4ca039={};_0x4ca039['model']=_[_0xfcfe('0x33')](db[_0xfcfe('0x44')]['rawAttributes']);_0x4ca039[_0xfcfe('0x34')]=_[_0xfcfe('0x33')](_0x7c327f[_0xfcfe('0x34')]);_0x4ca039[_0xfcfe('0x35')]=_[_0xfcfe('0x36')](_0x4ca039[_0xfcfe('0x32')],_0x4ca039[_0xfcfe('0x34')]);_0x16f9aa[_0xfcfe('0x38')]=_[_0xfcfe('0x36')](_0x4ca039[_0xfcfe('0x32')],qs['fields'](_0x7c327f[_0xfcfe('0x34')]['fields']));_0x16f9aa[_0xfcfe('0x38')]=_0x16f9aa[_0xfcfe('0x38')][_0xfcfe('0x39')]?_0x16f9aa[_0xfcfe('0x38')]:_0x4ca039[_0xfcfe('0x32')];if(_0x7c327f[_0xfcfe('0x34')][_0xfcfe('0x45')]){_0x16f9aa['include']=[{'all':!![]}];}_0x16f9aa=_[_0xfcfe('0x40')]({},_0x16f9aa,_0x7c327f['options']);return db['VoiceTransferReport']['find'](_0x16f9aa)[_0xfcfe('0x26')](handleEntityNotFound(_0x2708ab,null))[_0xfcfe('0x26')](respondWithResult(_0x2708ab,null))['catch'](handleError(_0x2708ab,null));};exports[_0xfcfe('0x4a')]=function(_0x417c82,_0x5e4446){return db[_0xfcfe('0x44')]['create'](_0x417c82['body'],{})[_0xfcfe('0x26')](respondWithResult(_0x5e4446,0xc9))[_0xfcfe('0x4b')](handleError(_0x5e4446,null));};exports['update']=function(_0x13878b,_0xaec6a3){if(_0x13878b['body']['id']){delete _0x13878b[_0xfcfe('0x4c')]['id'];}return db['VoiceTransferReport'][_0xfcfe('0x4d')]({'where':{'id':_0x13878b['params']['id']}})['then'](handleEntityNotFound(_0xaec6a3,null))['then'](saveUpdates(_0x13878b[_0xfcfe('0x4c')],null))[_0xfcfe('0x26')](respondWithResult(_0xaec6a3,null))[_0xfcfe('0x4b')](handleError(_0xaec6a3,null));};exports['destroy']=function(_0x5c878c,_0x497f3d){return db[_0xfcfe('0x44')]['find']({'where':{'id':_0x5c878c[_0xfcfe('0x49')]['id']}})[_0xfcfe('0x26')](handleEntityNotFound(_0x497f3d,null))[_0xfcfe('0x26')](removeEntity(_0x497f3d,null))[_0xfcfe('0x4b')](handleError(_0x497f3d,null));};exports[_0xfcfe('0x4e')]=function(_0x5c139a,_0x3157dd){return db[_0xfcfe('0x44')][_0xfcfe('0x4e')]()['then'](respondWithResult(_0x3157dd,null))['catch'](handleError(_0x3157dd,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index a06ccce..c11271d 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 _0x6517=['define','report_call_transfer','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceTransferReport.attributes','exports'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x6517,0x1be));var _0x7651=function(_0x402869,_0x3e04f7){_0x402869=_0x402869-0x0;var _0x3859a7=_0x6517[_0x402869];return _0x3859a7;};'use strict';var _=require(_0x7651('0x0'));var util=require(_0x7651('0x1'));var logger=require(_0x7651('0x2'))(_0x7651('0x3'));var moment=require(_0x7651('0x4'));var BPromise=require('bluebird');var rp=require(_0x7651('0x5'));var fs=require('fs');var path=require(_0x7651('0x6'));var rimraf=require(_0x7651('0x7'));var config=require('../../config/environment');var attributes=require(_0x7651('0x8'));module[_0x7651('0x9')]=function(_0x127480,_0x1f20eb){return _0x127480[_0x7651('0xa')]('VoiceTransferReport',attributes,{'tableName':_0x7651('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72ba=['api','moment','bluebird','request-promise','path','VoiceTransferReport','report_call_transfer','util'];(function(_0x22613c,_0x19673c){var _0x321820=function(_0x483635){while(--_0x483635){_0x22613c['push'](_0x22613c['shift']());}};_0x321820(++_0x19673c);}(_0x72ba,0x14f));var _0xa72b=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x72ba[_0x44268d];return _0x4be92d;};'use strict';var _=require('lodash');var util=require(_0xa72b('0x0'));var logger=require('../../config/logger')(_0xa72b('0x1'));var moment=require(_0xa72b('0x2'));var BPromise=require(_0xa72b('0x3'));var rp=require(_0xa72b('0x4'));var fs=require('fs');var path=require(_0xa72b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x307301,_0x1d1d1c){return _0x307301['define'](_0xa72b('0x6'),attributes,{'tableName':_0xa72b('0x7'),'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 67f687d..2d91d47 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 _0x2b49=['rpc','../../config/environment','jayson/promise','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create','body','options','raw','info','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5baab9,_0x43b8e6){var _0x2524c3=function(_0x25e16f){while(--_0x25e16f){_0x5baab9['push'](_0x5baab9['shift']());}};_0x2524c3(++_0x43b8e6);}(_0x2b49,0xb2));var _0x92b4=function(_0x3b2634,_0x56e81f){_0x3b2634=_0x3b2634-0x0;var _0x388dc8=_0x2b49[_0x3b2634];return _0x388dc8;};'use strict';var _=require('lodash');var util=require(_0x92b4('0x0'));var moment=require(_0x92b4('0x1'));var BPromise=require(_0x92b4('0x2'));var rs=require(_0x92b4('0x3'));var fs=require('fs');var Redis=require(_0x92b4('0x4'));var db=require(_0x92b4('0x5'))['db'];var utils=require(_0x92b4('0x6'));var logger=require(_0x92b4('0x7'))(_0x92b4('0x8'));var config=require(_0x92b4('0x9'));var jayson=require(_0x92b4('0xa'));var client=jayson['client'][_0x92b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x569618,_0x4e36c8,_0x163352){return new BPromise(function(_0x13c4ad,_0x9ceebd){return client[_0x92b4('0xc')](_0x569618,_0x163352)[_0x92b4('0xd')](function(_0x8c1bc3){logger['info'](_0x92b4('0xe'),_0x4e36c8,_0x92b4('0xf'));logger[_0x92b4('0x10')](_0x92b4('0x11'),_0x4e36c8,'request\x20sent',JSON[_0x92b4('0x12')](_0x8c1bc3));if(_0x8c1bc3[_0x92b4('0x13')]){if(_0x8c1bc3['error'][_0x92b4('0x14')]===0x1f4){logger[_0x92b4('0x13')](_0x92b4('0xe'),_0x4e36c8,_0x8c1bc3[_0x92b4('0x13')][_0x92b4('0x15')]);return _0x9ceebd(_0x8c1bc3[_0x92b4('0x13')][_0x92b4('0x15')]);}logger[_0x92b4('0x13')](_0x92b4('0xe'),_0x4e36c8,_0x8c1bc3[_0x92b4('0x13')]['message']);return _0x13c4ad(_0x8c1bc3[_0x92b4('0x13')][_0x92b4('0x15')]);}else{logger['info'](_0x92b4('0xe'),_0x4e36c8,_0x92b4('0xf'));_0x13c4ad(_0x8c1bc3[_0x92b4('0x16')]['message']);}})[_0x92b4('0x17')](function(_0x8bf14){logger[_0x92b4('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x4e36c8,_0x8bf14);_0x9ceebd(_0x8bf14);});});}exports['CreateVoiceTransferReport']=function(_0x1960d3){var _0x418c0b=this;return new Promise(function(_0x5e444c,_0xa6885){return db[_0x92b4('0x18')][_0x92b4('0x19')](_0x1960d3[_0x92b4('0x1a')],{'raw':_0x1960d3[_0x92b4('0x1b')]?_0x1960d3[_0x92b4('0x1b')][_0x92b4('0x1c')]===undefined?!![]:![]:!![]})[_0x92b4('0xd')](function(_0x4ff783){logger[_0x92b4('0x1d')](_0x92b4('0x1e'),_0x1960d3);logger[_0x92b4('0x10')](_0x92b4('0x1e'),_0x1960d3,JSON['stringify'](_0x4ff783));_0x5e444c(_0x4ff783);})['catch'](function(_0x32d632){logger['error'](_0x92b4('0x1e'),_0x32d632['message'],_0x1960d3);_0xa6885(_0x418c0b[_0x92b4('0x13')](0x1f4,_0x32d632['message']));});});}; \ No newline at end of file +var _0xa302=['message','catch','VoiceTransferReport','create','options','then','CreateVoiceTransferReport','debug','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa302,0x13d));var _0x2a30=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa302[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x2a30('0x0'));var moment=require(_0x2a30('0x1'));var BPromise=require(_0x2a30('0x2'));var rs=require(_0x2a30('0x3'));var fs=require('fs');var Redis=require(_0x2a30('0x4'));var db=require(_0x2a30('0x5'))['db'];var utils=require(_0x2a30('0x6'));var logger=require(_0x2a30('0x7'))(_0x2a30('0x8'));var config=require(_0x2a30('0x9'));var jayson=require(_0x2a30('0xa'));var client=jayson['client'][_0x2a30('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47523d,_0x341bd3,_0x22ebbb){return new BPromise(function(_0x13ce34,_0x4c49a3){return client[_0x2a30('0xc')](_0x47523d,_0x22ebbb)['then'](function(_0x5205dc){logger[_0x2a30('0xd')](_0x2a30('0xe'),_0x341bd3,_0x2a30('0xf'));logger['debug'](_0x2a30('0x10'),_0x341bd3,_0x2a30('0xf'),JSON['stringify'](_0x5205dc));if(_0x5205dc[_0x2a30('0x11')]){if(_0x5205dc['error'][_0x2a30('0x12')]===0x1f4){logger[_0x2a30('0x11')](_0x2a30('0xe'),_0x341bd3,_0x5205dc['error']['message']);return _0x4c49a3(_0x5205dc['error'][_0x2a30('0x13')]);}logger[_0x2a30('0x11')](_0x2a30('0xe'),_0x341bd3,_0x5205dc[_0x2a30('0x11')][_0x2a30('0x13')]);return _0x13ce34(_0x5205dc[_0x2a30('0x11')][_0x2a30('0x13')]);}else{logger['info'](_0x2a30('0xe'),_0x341bd3,'request\x20sent');_0x13ce34(_0x5205dc['result'][_0x2a30('0x13')]);}})[_0x2a30('0x14')](function(_0x133a35){logger[_0x2a30('0x11')](_0x2a30('0xe'),_0x341bd3,_0x133a35);_0x4c49a3(_0x133a35);});});}exports['CreateVoiceTransferReport']=function(_0x4892f0){var _0x4ed6e0=this;return new Promise(function(_0x49ccd5,_0x1080cb){return db[_0x2a30('0x15')][_0x2a30('0x16')](_0x4892f0['body'],{'raw':_0x4892f0['options']?_0x4892f0[_0x2a30('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x2a30('0x18')](function(_0x408a91){logger['info'](_0x2a30('0x19'),_0x4892f0);logger[_0x2a30('0x1a')](_0x2a30('0x19'),_0x4892f0,JSON[_0x2a30('0x1b')](_0x408a91));_0x49ccd5(_0x408a91);})[_0x2a30('0x14')](function(_0x3d13fb){logger[_0x2a30('0x11')]('CreateVoiceTransferReport',_0x3d13fb[_0x2a30('0x13')],_0x4892f0);_0x1080cb(_0x4ed6e0[_0x2a30('0x11')](0x1f4,_0x3d13fb[_0x2a30('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 8a7291d..ce88582 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 _0x6f0d=['isAuthenticated','isWebrtcLicence','originate','/hangup','/answer','/hold','hold','unhold','calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller','post'];(function(_0x21f105,_0x3b7ad3){var _0xa9ab49=function(_0x43c9ca){while(--_0x43c9ca){_0x21f105['push'](_0x21f105['shift']());}};_0xa9ab49(++_0x3b7ad3);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xc5322b,_0x367fd6){_0xc5322b=_0xc5322b-0x0;var _0x267793=_0x6f0d[_0xc5322b];return _0x267793;};'use strict';var express=require('express');var router=express[_0xd6f0('0x0')]();var auth=require(_0xd6f0('0x1'));var controller=require(_0xd6f0('0x2'));router[_0xd6f0('0x3')]('/originate',auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0x6')]);router[_0xd6f0('0x3')](_0xd6f0('0x7'),auth['isAuthenticated'](),auth[_0xd6f0('0x5')](),controller['hangup']);router[_0xd6f0('0x3')](_0xd6f0('0x8'),auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller['answer']);router['post'](_0xd6f0('0x9'),auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xa')]);router[_0xd6f0('0x3')]('/unhold',auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xb')]);router[_0xd6f0('0x3')]('/calls',auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xc')]);router[_0xd6f0('0x3')](_0xd6f0('0xd'),auth[_0xd6f0('0x4')](),auth[_0xd6f0('0x5')](),controller[_0xd6f0('0xe')]);module[_0xd6f0('0xf')]=router; \ No newline at end of file +var _0xbec5=['exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup','/answer','answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer'];(function(_0x18f82a,_0x3080a5){var _0x70e301=function(_0x425a1f){while(--_0x425a1f){_0x18f82a['push'](_0x18f82a['shift']());}};_0x70e301(++_0x3080a5);}(_0xbec5,0xe5));var _0x5bec=function(_0x36b400,_0x277ec5){_0x36b400=_0x36b400-0x0;var _0x4d47bf=_0xbec5[_0x36b400];return _0x4d47bf;};'use strict';var express=require(_0x5bec('0x0'));var router=express[_0x5bec('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5bec('0x2'));router[_0x5bec('0x3')](_0x5bec('0x4'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller['originate']);router[_0x5bec('0x3')](_0x5bec('0x7'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0x8')]);router[_0x5bec('0x3')](_0x5bec('0x9'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xa')]);router[_0x5bec('0x3')](_0x5bec('0xb'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller['hold']);router[_0x5bec('0x3')](_0x5bec('0xc'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0xd')]);router[_0x5bec('0x3')](_0x5bec('0xe'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xf')]);router['post'](_0x5bec('0x10'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0x11')]);module[_0x5bec('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 84631d1..7ecc8c9 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 _0x407f=['\x20not\x20found!','originate','originate\x20fired:','body','length','userId','callNumber','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','json','sessionId','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId\x20'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x407f,0xc2));var _0xf407=function(_0x2fe3d6,_0x3c7af0){_0x2fe3d6=_0x2fe3d6-0x0;var _0x1c3055=_0x407f[_0x2fe3d6];return _0x1c3055;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0xf407('0x0'));var util=require(_0xf407('0x1'));var BPromise=require(_0xf407('0x2'));var jayson=require(_0xf407('0x3'));var amiClient=jayson[_0xf407('0x4')][_0xf407('0x5')]({'port':0x232a});var logger=require(_0xf407('0x6'))(_0xf407('0x7'));var Redis=require(_0xf407('0x8'));config[_0xf407('0x9')]=_[_0xf407('0xa')](config[_0xf407('0x9')],{'host':_0xf407('0xb'),'port':0x18eb});var io=require(_0xf407('0xc'))(new Redis(config[_0xf407('0x9')]));var Schema=require(_0xf407('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf407('0xe')]},'callNumber':{'type':_0xf407('0xf'),'required':[!![],_0xf407('0x10')]},'callerId':{'type':_0xf407('0xf')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf407('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf407('0x11'),'required':[!![],_0xf407('0xe')]},'sessionId':{'type':_0xf407('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf407('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf407('0xf'),'required':[!![],_0xf407('0x12')]},'transferNumber':{'type':_0xf407('0xf'),'required':[!![],_0xf407('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0xf407('0x11'),'required':[!![],_0xf407('0xe')]},'sessionId':{'type':_0xf407('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf407('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf407('0x11'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xf407('0x11'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x48fd5d,_0x768926,_0x331782){logger[_0xf407('0x14')](_0x48fd5d,_0x768926,JSON[_0xf407('0x15')](_0x331782));io['to'](_0x48fd5d)[_0xf407('0x16')](_0x768926,_0x331782);}function handleError(_0x71f512){return function(_0x4ddbe6){console[_0xf407('0x17')]('handleError:',_0x4ddbe6,_0x4ddbe6 instanceof RangeError);logger[_0xf407('0x18')](_0x4ddbe6[_0xf407('0x19')]);if(_0x4ddbe6 instanceof RangeError){if(_0x4ddbe6[_0xf407('0x1a')]){delete _0x4ddbe6[_0xf407('0x1a')];}_0x71f512[_0xf407('0x1b')](0x194)[_0xf407('0x1c')](_0x4ddbe6);}else{if(_0x4ddbe6['name']){delete _0x4ddbe6[_0xf407('0x1a')];}_0x71f512[_0xf407('0x1b')](0x1f4)[_0xf407('0x1c')](_0x4ddbe6);}};}function checkError(){return function(_0x1354a4){if(!_0x1354a4){throw new RangeError('NotFound');}return _0x1354a4;};}function respondWithRpcPromise(_0x4716c3,_0x5de6fb){return new BPromise(function(_0x23659c,_0xa6f11e){var _0x5f32bb=amiClient;return _0x5f32bb['request'](_0x4716c3,_0x5de6fb)[_0xf407('0x1d')](function(_0x100e6e){if(_0x100e6e[_0xf407('0x18')]){if(_0x100e6e[_0xf407('0x18')][_0xf407('0x1e')]===0x1f4){return _0xa6f11e(_0x100e6e[_0xf407('0x18')][_0xf407('0x1f')]);}return _0x23659c(_0x100e6e['error'][_0xf407('0x1f')]);}else{_0x23659c(_0x100e6e[_0xf407('0x20')]);}})[_0xf407('0x21')](function(_0x50897a){_0xa6f11e(_0x50897a);});});}function getAgent(_0x1b6050){return db[_0xf407('0x22')][_0xf407('0x23')]({'where':{'id':_0x1b6050,'role':_0xf407('0x24')}})[_0xf407('0x1d')](checkError());}function getAgentCheckSession(_0x187c93,_0x524b34){return new BPromise(function(_0x3953c5,_0x5ec8dc){var _0x4fc4df=respondWithRpcPromise(_0xf407('0x25'));var _0x115dce=getAgent(_0x187c93);Promise[_0xf407('0x26')]([_0x4fc4df,_0x115dce])[_0xf407('0x1d')](function(_0x1c5335){var _0x249028=_0x1c5335[0x0];var _0x4c49b7=_0x1c5335[0x1];var _0x25b820=_[_0xf407('0x27')](_0x249028[_0xf407('0x28')],function(_0x89915b){return _0x89915b[_0xf407('0x29')]==_0x4c49b7['id']&&_0x89915b['sessionId']==_0x524b34;});if(_0x25b820['length']==0x1){_0x3953c5(_0x4c49b7);}else{_0x5ec8dc(new RangeError(_0xf407('0x2a')+_0x524b34+_0xf407('0x2b')));}});});}exports[_0xf407('0x2c')]=function(_0x50c461,_0x153287){logger[_0xf407('0x14')](_0xf407('0x2d'),_0x50c461['body']);var _0x377c83=originateValidation['validate'](_0x50c461[_0xf407('0x2e')]);if(_0x377c83[_0xf407('0x2f')]>0x0){return _0x153287['status'](0x190)['json'](_0x377c83);}var _0x5ee381=_0x50c461[_0xf407('0x2e')][_0xf407('0x30')];var _0x57bbe4=_0x50c461[_0xf407('0x2e')][_0xf407('0x31')];var _0xef81ca=_0x50c461[_0xf407('0x2e')]['callerId'];var _0x478d81=_0x50c461[_0xf407('0x2e')][_0xf407('0x32')];return getAgent(_0x5ee381)[_0xf407('0x1d')](function(_0x38d7e1){logger[_0xf407('0x14')](_0xf407('0x33'),_0x38d7e1[_0xf407('0x1a')]);emit(util[_0xf407('0x34')](_0xf407('0x35'),_0x38d7e1[_0xf407('0x1a')]),'webbar:originate',{'callNumber':_0x57bbe4,'callerId':_0xef81ca,'callbackUrl':_0x478d81});return _0x153287[_0xf407('0x1b')](0xc8)['json']({'error':![],'message':_0xf407('0x36')});})[_0xf407('0x21')](handleError(_0x153287));};exports[_0xf407('0x37')]=function(_0x3f2916,_0x59fc8a){logger['info'](_0xf407('0x38'),_0x3f2916[_0xf407('0x2e')]);var _0x307272=hangupValidation[_0xf407('0xd')](_0x3f2916['body']);if(_0x307272[_0xf407('0x2f')]>0x0){return _0x59fc8a[_0xf407('0x1b')](0x190)[_0xf407('0x39')](_0x307272);}var _0x577b07=_0x3f2916['body'][_0xf407('0x30')];var _0x5e6833=_0x3f2916['body'][_0xf407('0x3a')];return getAgent(_0x577b07)[_0xf407('0x1d')](function(_0x4890ae){logger[_0xf407('0x14')](_0xf407('0x33'),_0x4890ae[_0xf407('0x1a')]);emit(util[_0xf407('0x34')](_0xf407('0x35'),_0x4890ae['name']),_0xf407('0x3b'),{'sessionId':_0x5e6833});return _0x59fc8a['status'](0xc8)['json']({'error':![],'message':_0xf407('0x3c')});})[_0xf407('0x21')](handleError(_0x59fc8a));};exports['answer']=function(_0x225a1f,_0x44b01a){logger[_0xf407('0x14')](_0xf407('0x3d'),_0x225a1f[_0xf407('0x2e')]);var _0xaa954d=answerValidation[_0xf407('0xd')](_0x225a1f[_0xf407('0x2e')]);if(_0xaa954d['length']>0x0){return _0x44b01a[_0xf407('0x1b')](0x190)['json'](_0xaa954d);}var _0x2def2e=_0x225a1f['body'][_0xf407('0x30')];var _0x56ea2b=_0x225a1f[_0xf407('0x2e')][_0xf407('0x3a')];return getAgent(_0x2def2e)[_0xf407('0x1d')](function(_0x2069fe){logger[_0xf407('0x14')](_0xf407('0x33'),_0x2069fe[_0xf407('0x1a')]);emit(util['format'](_0xf407('0x35'),_0x2069fe[_0xf407('0x1a')]),_0xf407('0x3e'),{'sessionId':_0x56ea2b});return _0x44b01a[_0xf407('0x1b')](0xc8)[_0xf407('0x39')]({'error':![],'message':_0xf407('0x3f')});})['catch'](handleError(_0x44b01a));};exports[_0xf407('0x40')]=function(_0x1e74aa,_0x19951d){logger[_0xf407('0x14')](_0xf407('0x41'),_0x1e74aa[_0xf407('0x2e')]);var _0x4c6da7=holdValidation[_0xf407('0xd')](_0x1e74aa[_0xf407('0x2e')]);if(_0x4c6da7[_0xf407('0x2f')]>0x0){return _0x19951d['status'](0x190)[_0xf407('0x39')](_0x4c6da7);}var _0x49cf34=_0x1e74aa[_0xf407('0x2e')][_0xf407('0x30')];var _0x44bd4e=_0x1e74aa[_0xf407('0x2e')]['sessionId'];return getAgent(_0x49cf34)[_0xf407('0x1d')](function(_0x3b6c44){logger[_0xf407('0x14')]('entityFound:',_0x3b6c44['name']);emit(util[_0xf407('0x34')](_0xf407('0x35'),_0x3b6c44[_0xf407('0x1a')]),'webbar:hold',{'sessionId':_0x44bd4e});return _0x19951d[_0xf407('0x1b')](0xc8)[_0xf407('0x39')]({'error':![],'message':_0xf407('0x42')});})[_0xf407('0x21')](handleError(_0x19951d));};exports['unhold']=function(_0x1282df,_0x3d3c9d){logger['info'](_0xf407('0x43'),_0x1282df[_0xf407('0x2e')]);var _0x274a87=unholdValidation['validate'](_0x1282df[_0xf407('0x2e')]);if(_0x274a87[_0xf407('0x2f')]>0x0){return _0x3d3c9d[_0xf407('0x1b')](0x190)[_0xf407('0x39')](_0x274a87);}var _0x4d03c2=_0x1282df[_0xf407('0x2e')][_0xf407('0x30')];var _0x5b69d2=_0x1282df[_0xf407('0x2e')]['sessionId'];return getAgent(_0x4d03c2)[_0xf407('0x1d')](function(_0x3ba368){logger['info'](_0xf407('0x33'),_0x3ba368[_0xf407('0x1a')]);emit(util['format'](_0xf407('0x35'),_0x3ba368['name']),'webbar:unhold',{'sessionId':_0x5b69d2});return _0x3d3c9d[_0xf407('0x1b')](0xc8)[_0xf407('0x39')]({'error':![],'message':_0xf407('0x44')});})[_0xf407('0x21')](handleError(_0x3d3c9d));};exports[_0xf407('0x45')]=function(_0x1376b9,_0x48b4d2){logger['info'](_0xf407('0x46'),_0x48b4d2[_0xf407('0x2e')]);var _0x417bdd=callsValidation[_0xf407('0xd')](_0x1376b9[_0xf407('0x2e')]);if(_0x417bdd[_0xf407('0x2f')]>0x0){return _0x48b4d2['status'](0x190)[_0xf407('0x39')](_0x417bdd);}var _0x27f280=_0x1376b9[_0xf407('0x2e')][_0xf407('0x30')];var _0x274499=respondWithRpcPromise(_0xf407('0x25'));var _0x4cd90d=getAgent(_0x27f280);return Promise[_0xf407('0x26')]([_0x274499,_0x4cd90d])[_0xf407('0x1d')](function(_0x4f5ca7){var _0x5647bf=_0x4f5ca7[0x0];var _0xa365b5=_0x4f5ca7[0x1];var _0x26037b=_[_0xf407('0x27')](_0x5647bf[_0xf407('0x28')],function(_0x27467a){return _0x27467a[_0xf407('0x29')]==_0xa365b5['id'];});return _0x48b4d2[_0xf407('0x1b')](0xc8)['json']({'count':_0x26037b['length'],'rows':_0x26037b});})[_0xf407('0x21')](handleError(_0x48b4d2));};exports[_0xf407('0x47')]=function(_0x2ce443,_0x1ba338){logger[_0xf407('0x14')](_0xf407('0x48'),_0x2ce443[_0xf407('0x2e')]);var _0x538a06=conferenceValidation[_0xf407('0xd')](_0x2ce443[_0xf407('0x2e')]);if(_0x538a06['length']>0x0){return _0x1ba338[_0xf407('0x1b')](0x190)[_0xf407('0x39')](_0x538a06);}var _0x99666a=_0x2ce443[_0xf407('0x2e')][_0xf407('0x30')];return getAgent(_0x99666a)[_0xf407('0x1d')](function(_0x4379a9){logger[_0xf407('0x14')](_0xf407('0x33'),_0x4379a9[_0xf407('0x1a')]);emit(util['format'](_0xf407('0x35'),_0x4379a9[_0xf407('0x1a')]),_0xf407('0x49'));return _0x1ba338[_0xf407('0x1b')](0xc8)['json']({'error':![],'message':_0xf407('0x4a')});})[_0xf407('0x21')](handleError(_0x1ba338));};exports['transfer']=function(_0x5f3452,_0x1b34d4){logger[_0xf407('0x14')](_0xf407('0x4b'),_0x5f3452[_0xf407('0x2e')]);var _0x3d9ce4=transferValidation[_0xf407('0xd')](_0x5f3452[_0xf407('0x2e')]);if(_0x3d9ce4[_0xf407('0x2f')]>0x0){return _0x1b34d4[_0xf407('0x1b')](0x190)[_0xf407('0x39')](_0x3d9ce4);}var _0x3db3bd=_0x5f3452[_0xf407('0x2e')][_0xf407('0x30')];var _0x27b142=_0x5f3452['body']['sessionId'];var _0x8dc40d=_0x5f3452[_0xf407('0x2e')][_0xf407('0x4c')];return getAgent(_0x3db3bd)[_0xf407('0x1d')](function(_0x2d273a){logger['info']('entityFound:',_0x2d273a['name']);emit(util[_0xf407('0x34')](_0xf407('0x35'),_0x2d273a[_0xf407('0x1a')]),_0xf407('0x4d'),{'sessionId':_0x27b142,'transferNumber':_0x8dc40d});return _0x1b34d4[_0xf407('0x1b')](0xc8)[_0xf407('0x39')]({'error':![],'message':_0xf407('0x4e')});})['catch'](handleError(_0x1b34d4));}; \ No newline at end of file +var _0xf3cd=['webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','VoiceChannels','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','client','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','User','findOne','all','filter','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','json'];(function(_0x486f0b,_0x19a9b7){var _0x12ccaf=function(_0x4ba198){while(--_0x4ba198){_0x486f0b['push'](_0x486f0b['shift']());}};_0x12ccaf(++_0x19a9b7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xc6cd9,_0x24938f){_0xc6cd9=_0xc6cd9-0x0;var _0x39ca4b=_0xf3cd[_0xc6cd9];return _0x39ca4b;};'use strict';var path=require(_0xdf3c('0x0'));var fs=require('fs');var _=require(_0xdf3c('0x1'));var db=require(_0xdf3c('0x2'))['db'];var config=require(_0xdf3c('0x3'));var util=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0xdf3c('0x6')][_0xdf3c('0x7')]({'port':0x232a});var logger=require(_0xdf3c('0x8'))('webbarapi');var Redis=require(_0xdf3c('0x9'));config[_0xdf3c('0xa')]=_[_0xdf3c('0xb')](config[_0xdf3c('0xa')],{'host':_0xdf3c('0xc'),'port':0x18eb});var io=require(_0xdf3c('0xd'))(new Redis(config['redis']));var Schema=require(_0xdf3c('0xe'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xdf3c('0xf'),'required':[!![],_0xdf3c('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xdf3c('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],_0xdf3c('0x12')]},'sessionId':{'type':_0xdf3c('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],_0xdf3c('0x12')]},'sessionId':{'type':_0xdf3c('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xdf3c('0xf'),'required':[!![],_0xdf3c('0x13')]},'transferNumber':{'type':_0xdf3c('0xf'),'required':[!![],_0xdf3c('0x14')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xdf3c('0x12')]},'sessionId':{'type':_0xdf3c('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xdf3c('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],_0xdf3c('0x12')]}});var conferenceValidation=new Schema({'userId':{'type':_0xdf3c('0x11'),'required':[!![],_0xdf3c('0x12')]}});function emit(_0x1a7a5a,_0x305ea5,_0x92008b){logger[_0xdf3c('0x15')](_0x1a7a5a,_0x305ea5,JSON[_0xdf3c('0x16')](_0x92008b));io['to'](_0x1a7a5a)['emit'](_0x305ea5,_0x92008b);}function handleError(_0x13b0e6){return function(_0x465e7d){console[_0xdf3c('0x17')](_0xdf3c('0x18'),_0x465e7d,_0x465e7d instanceof RangeError);logger[_0xdf3c('0x19')](_0x465e7d[_0xdf3c('0x1a')]);if(_0x465e7d instanceof RangeError){if(_0x465e7d[_0xdf3c('0x1b')]){delete _0x465e7d[_0xdf3c('0x1b')];}_0x13b0e6[_0xdf3c('0x1c')](0x194)[_0xdf3c('0x1d')](_0x465e7d);}else{if(_0x465e7d[_0xdf3c('0x1b')]){delete _0x465e7d[_0xdf3c('0x1b')];}_0x13b0e6[_0xdf3c('0x1c')](0x1f4)['send'](_0x465e7d);}};}function checkError(){return function(_0x4d620f){if(!_0x4d620f){throw new RangeError(_0xdf3c('0x1e'));}return _0x4d620f;};}function respondWithRpcPromise(_0x583ce4,_0x15776c){return new BPromise(function(_0x40e7ec,_0x36552e){var _0x38b319=amiClient;return _0x38b319[_0xdf3c('0x1f')](_0x583ce4,_0x15776c)[_0xdf3c('0x20')](function(_0x50d8ca){if(_0x50d8ca[_0xdf3c('0x19')]){if(_0x50d8ca[_0xdf3c('0x19')][_0xdf3c('0x21')]===0x1f4){return _0x36552e(_0x50d8ca[_0xdf3c('0x19')][_0xdf3c('0x22')]);}return _0x40e7ec(_0x50d8ca[_0xdf3c('0x19')][_0xdf3c('0x22')]);}else{_0x40e7ec(_0x50d8ca[_0xdf3c('0x23')]);}})[_0xdf3c('0x24')](function(_0x1adee4){_0x36552e(_0x1adee4);});});}function getAgent(_0x4c076c){return db[_0xdf3c('0x25')][_0xdf3c('0x26')]({'where':{'id':_0x4c076c,'role':'agent'}})[_0xdf3c('0x20')](checkError());}function getAgentCheckSession(_0x59659e,_0x4eaced){return new BPromise(function(_0x508be9,_0x14aac9){var _0x186bba=respondWithRpcPromise('VoiceChannels');var _0x5c3b5a=getAgent(_0x59659e);Promise[_0xdf3c('0x27')]([_0x186bba,_0x5c3b5a])[_0xdf3c('0x20')](function(_0xd3cfcb){var _0x1ccdd4=_0xd3cfcb[0x0];var _0x5c98a2=_0xd3cfcb[0x1];var _0x43ce06=_[_0xdf3c('0x28')](_0x1ccdd4['rows'],function(_0x51e0a4){return _0x51e0a4[_0xdf3c('0x29')]==_0x5c98a2['id']&&_0x51e0a4[_0xdf3c('0x2a')]==_0x4eaced;});if(_0x43ce06[_0xdf3c('0x2b')]==0x1){_0x508be9(_0x5c98a2);}else{_0x14aac9(new RangeError('sessionId\x20'+_0x4eaced+_0xdf3c('0x2c')));}});});}exports[_0xdf3c('0x2d')]=function(_0x21e7b8,_0x10099e){logger['info'](_0xdf3c('0x2e'),_0x21e7b8[_0xdf3c('0x2f')]);var _0x522e5f=originateValidation[_0xdf3c('0xe')](_0x21e7b8[_0xdf3c('0x2f')]);if(_0x522e5f[_0xdf3c('0x2b')]>0x0){return _0x10099e[_0xdf3c('0x1c')](0x190)['json'](_0x522e5f);}var _0x33632f=_0x21e7b8[_0xdf3c('0x2f')][_0xdf3c('0x30')];var _0x3b9ce8=_0x21e7b8['body'][_0xdf3c('0x31')];var _0x3e7a4b=_0x21e7b8['body']['callerId'];var _0x12cc19=_0x21e7b8['body'][_0xdf3c('0x32')];return getAgent(_0x33632f)['then'](function(_0x57faba){logger['info'](_0xdf3c('0x33'),_0x57faba[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x57faba['name']),'webbar:originate',{'callNumber':_0x3b9ce8,'callerId':_0x3e7a4b,'callbackUrl':_0x12cc19});return _0x10099e[_0xdf3c('0x1c')](0xc8)['json']({'error':![],'message':_0xdf3c('0x36')});})[_0xdf3c('0x24')](handleError(_0x10099e));};exports[_0xdf3c('0x37')]=function(_0xcdd731,_0x1004e9){logger[_0xdf3c('0x15')](_0xdf3c('0x38'),_0xcdd731[_0xdf3c('0x2f')]);var _0x398c76=hangupValidation['validate'](_0xcdd731[_0xdf3c('0x2f')]);if(_0x398c76['length']>0x0){return _0x1004e9['status'](0x190)[_0xdf3c('0x39')](_0x398c76);}var _0x47f760=_0xcdd731[_0xdf3c('0x2f')]['userId'];var _0x2a94c3=_0xcdd731[_0xdf3c('0x2f')][_0xdf3c('0x2a')];return getAgent(_0x47f760)[_0xdf3c('0x20')](function(_0x3098cb){logger[_0xdf3c('0x15')](_0xdf3c('0x33'),_0x3098cb[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x3098cb[_0xdf3c('0x1b')]),_0xdf3c('0x3a'),{'sessionId':_0x2a94c3});return _0x1004e9['status'](0xc8)['json']({'error':![],'message':_0xdf3c('0x3b')});})['catch'](handleError(_0x1004e9));};exports[_0xdf3c('0x3c')]=function(_0x14d8e1,_0x46194d){logger[_0xdf3c('0x15')]('answer\x20fired:',_0x14d8e1['body']);var _0x335c1b=answerValidation[_0xdf3c('0xe')](_0x14d8e1[_0xdf3c('0x2f')]);if(_0x335c1b['length']>0x0){return _0x46194d[_0xdf3c('0x1c')](0x190)[_0xdf3c('0x39')](_0x335c1b);}var _0x6fc3b6=_0x14d8e1[_0xdf3c('0x2f')]['userId'];var _0x127685=_0x14d8e1[_0xdf3c('0x2f')][_0xdf3c('0x2a')];return getAgent(_0x6fc3b6)[_0xdf3c('0x20')](function(_0x2f52c5){logger['info'](_0xdf3c('0x33'),_0x2f52c5[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x2f52c5[_0xdf3c('0x1b')]),_0xdf3c('0x3d'),{'sessionId':_0x127685});return _0x46194d['status'](0xc8)['json']({'error':![],'message':_0xdf3c('0x3e')});})[_0xdf3c('0x24')](handleError(_0x46194d));};exports['hold']=function(_0x5c9885,_0x269723){logger[_0xdf3c('0x15')](_0xdf3c('0x3f'),_0x5c9885[_0xdf3c('0x2f')]);var _0xaae4bc=holdValidation[_0xdf3c('0xe')](_0x5c9885[_0xdf3c('0x2f')]);if(_0xaae4bc[_0xdf3c('0x2b')]>0x0){return _0x269723[_0xdf3c('0x1c')](0x190)['json'](_0xaae4bc);}var _0x129c2a=_0x5c9885[_0xdf3c('0x2f')][_0xdf3c('0x30')];var _0xe760dd=_0x5c9885[_0xdf3c('0x2f')][_0xdf3c('0x2a')];return getAgent(_0x129c2a)[_0xdf3c('0x20')](function(_0x553f70){logger[_0xdf3c('0x15')]('entityFound:',_0x553f70[_0xdf3c('0x1b')]);emit(util['format'](_0xdf3c('0x35'),_0x553f70[_0xdf3c('0x1b')]),_0xdf3c('0x40'),{'sessionId':_0xe760dd});return _0x269723[_0xdf3c('0x1c')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x269723));};exports[_0xdf3c('0x41')]=function(_0x5f5726,_0x31c600){logger[_0xdf3c('0x15')](_0xdf3c('0x42'),_0x5f5726[_0xdf3c('0x2f')]);var _0x3b17d9=unholdValidation['validate'](_0x5f5726['body']);if(_0x3b17d9[_0xdf3c('0x2b')]>0x0){return _0x31c600[_0xdf3c('0x1c')](0x190)['json'](_0x3b17d9);}var _0x3b215d=_0x5f5726[_0xdf3c('0x2f')][_0xdf3c('0x30')];var _0x3fda0a=_0x5f5726[_0xdf3c('0x2f')][_0xdf3c('0x2a')];return getAgent(_0x3b215d)[_0xdf3c('0x20')](function(_0x492396){logger['info'](_0xdf3c('0x33'),_0x492396[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x492396[_0xdf3c('0x1b')]),_0xdf3c('0x43'),{'sessionId':_0x3fda0a});return _0x31c600[_0xdf3c('0x1c')](0xc8)[_0xdf3c('0x39')]({'error':![],'message':_0xdf3c('0x44')});})[_0xdf3c('0x24')](handleError(_0x31c600));};exports[_0xdf3c('0x45')]=function(_0x4cb28f,_0x1eebcf){logger['info']('calls\x20fired:',_0x1eebcf['body']);var _0x58fcbf=callsValidation['validate'](_0x4cb28f[_0xdf3c('0x2f')]);if(_0x58fcbf[_0xdf3c('0x2b')]>0x0){return _0x1eebcf['status'](0x190)[_0xdf3c('0x39')](_0x58fcbf);}var _0x32427e=_0x4cb28f['body'][_0xdf3c('0x30')];var _0x28f935=respondWithRpcPromise(_0xdf3c('0x46'));var _0x1389e0=getAgent(_0x32427e);return Promise[_0xdf3c('0x27')]([_0x28f935,_0x1389e0])[_0xdf3c('0x20')](function(_0xb54629){var _0xdc859=_0xb54629[0x0];var _0x42efa2=_0xb54629[0x1];var _0xa05518=_[_0xdf3c('0x28')](_0xdc859['rows'],function(_0x1ed898){return _0x1ed898[_0xdf3c('0x29')]==_0x42efa2['id'];});return _0x1eebcf[_0xdf3c('0x1c')](0xc8)['json']({'count':_0xa05518[_0xdf3c('0x2b')],'rows':_0xa05518});})[_0xdf3c('0x24')](handleError(_0x1eebcf));};exports[_0xdf3c('0x47')]=function(_0x552264,_0x1effdb){logger[_0xdf3c('0x15')]('conference\x20fired:',_0x552264[_0xdf3c('0x2f')]);var _0x4f8fd6=conferenceValidation[_0xdf3c('0xe')](_0x552264[_0xdf3c('0x2f')]);if(_0x4f8fd6[_0xdf3c('0x2b')]>0x0){return _0x1effdb[_0xdf3c('0x1c')](0x190)[_0xdf3c('0x39')](_0x4f8fd6);}var _0x30e6e1=_0x552264[_0xdf3c('0x2f')][_0xdf3c('0x30')];return getAgent(_0x30e6e1)[_0xdf3c('0x20')](function(_0x330730){logger[_0xdf3c('0x15')](_0xdf3c('0x33'),_0x330730[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x330730[_0xdf3c('0x1b')]),_0xdf3c('0x48'));return _0x1effdb['status'](0xc8)['json']({'error':![],'message':_0xdf3c('0x49')});})[_0xdf3c('0x24')](handleError(_0x1effdb));};exports[_0xdf3c('0x4a')]=function(_0x596282,_0x164e0a){logger['info']('transfer\x20fired:',_0x596282[_0xdf3c('0x2f')]);var _0x399db6=transferValidation[_0xdf3c('0xe')](_0x596282[_0xdf3c('0x2f')]);if(_0x399db6[_0xdf3c('0x2b')]>0x0){return _0x164e0a[_0xdf3c('0x1c')](0x190)[_0xdf3c('0x39')](_0x399db6);}var _0x3ec03a=_0x596282[_0xdf3c('0x2f')][_0xdf3c('0x30')];var _0x1cce9a=_0x596282[_0xdf3c('0x2f')][_0xdf3c('0x2a')];var _0x4be79a=_0x596282[_0xdf3c('0x2f')][_0xdf3c('0x4b')];return getAgent(_0x3ec03a)[_0xdf3c('0x20')](function(_0x16d6ea){logger[_0xdf3c('0x15')]('entityFound:',_0x16d6ea[_0xdf3c('0x1b')]);emit(util[_0xdf3c('0x34')](_0xdf3c('0x35'),_0x16d6ea[_0xdf3c('0x1b')]),_0xdf3c('0x4c'),{'sessionId':_0x1cce9a,'transferNumber':_0x4be79a});return _0x164e0a[_0xdf3c('0x1c')](0xc8)[_0xdf3c('0x39')]({'error':![],'message':_0xdf3c('0x4d')});})[_0xdf3c('0x24')](handleError(_0x164e0a));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index b7b2049..5c00215 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 _0x0b0e=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAgents','notify','put','update','delete','removeDispositions'];(function(_0x538293,_0x216bba){var _0x58f938=function(_0x5b6f90){while(--_0x5b6f90){_0x538293['push'](_0x538293['shift']());}};_0x58f938(++_0x216bba);}(_0x0b0e,0x187));var _0xe0b0=function(_0x151d64,_0x360f73){_0x151d64=_0x151d64-0x0;var _0x409cfd=_0x0b0e[_0x151d64];return _0x409cfd;};'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')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x9')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x11')]);router[_0xe0b0('0x9')](_0xe0b0('0x12'),auth[_0xe0b0('0xa')](),controller['getApplications']);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x15')]);router['post'](_0xe0b0('0x16'),auth[_0xe0b0('0xa')](),controller['addAnswer']);router[_0xe0b0('0x13')]('/:id/users',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x17')]);router['post']('/:id/applications',auth[_0xe0b0('0xa')](),controller['addApplications']);router['post']('/:id/notify',controller[_0xe0b0('0x18')]);router['post']('/:id/send',auth[_0xe0b0('0xa')](),controller['send']);router[_0xe0b0('0x19')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1a')]);router[_0xe0b0('0x1b')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['destroy']);router['delete'](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0x1c')]);router[_0xe0b0('0x1b')]('/:id/canned_answers',auth[_0xe0b0('0xa')](),controller['removeAnswers']);router[_0xe0b0('0x1b')]('/:id/users',auth[_0xe0b0('0xa')](),controller['removeAgents']);module[_0xe0b0('0x1d')]=router; \ No newline at end of file +var _0x4888=['/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','getApplications','addDisposition','post','addAnswer','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','update','delete','destroy','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4888,0x198));var _0x8488=function(_0x64c6e3,_0x3b5371){_0x64c6e3=_0x64c6e3-0x0;var _0x69c52f=_0x4888[_0x64c6e3];return _0x69c52f;};'use strict';var multer=require('multer');var util=require(_0x8488('0x0'));var path=require(_0x8488('0x1'));var timeout=require(_0x8488('0x2'));var express=require(_0x8488('0x3'));var router=express[_0x8488('0x4')]();var fs_extra=require(_0x8488('0x5'));var auth=require(_0x8488('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8488('0x7'));var controller=require(_0x8488('0x8'));router[_0x8488('0x9')]('/',auth[_0x8488('0xa')](),controller[_0x8488('0xb')]);router[_0x8488('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller['show']);router[_0x8488('0x9')](_0x8488('0xd'),auth[_0x8488('0xa')](),controller[_0x8488('0xe')]);router['get'](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x10')]);router[_0x8488('0x9')](_0x8488('0x11'),auth['isAuthenticated'](),controller[_0x8488('0x12')]);router[_0x8488('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8488('0x13')]);router['post']('/',auth[_0x8488('0xa')](),controller['create']);router['post'](_0x8488('0xd'),auth[_0x8488('0xa')](),controller[_0x8488('0x14')]);router[_0x8488('0x15')](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x16')]);router['post'](_0x8488('0x11'),auth[_0x8488('0xa')](),controller[_0x8488('0x17')]);router[_0x8488('0x15')](_0x8488('0x18'),auth[_0x8488('0xa')](),controller[_0x8488('0x19')]);router[_0x8488('0x15')](_0x8488('0x1a'),controller[_0x8488('0x1b')]);router[_0x8488('0x15')](_0x8488('0x1c'),auth[_0x8488('0xa')](),controller['send']);router['put'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller[_0x8488('0x1d')]);router[_0x8488('0x1e')](_0x8488('0xc'),auth[_0x8488('0xa')](),controller[_0x8488('0x1f')]);router[_0x8488('0x1e')](_0x8488('0xd'),auth['isAuthenticated'](),controller[_0x8488('0x20')]);router[_0x8488('0x1e')](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x21')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x8488('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index e8e2769..6a57bb7 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 _0x4010=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0xe75ceb,_0x1dd61a){var _0x139f98=function(_0x6379d3){while(--_0x6379d3){_0xe75ceb['push'](_0xe75ceb['shift']());}};_0x139f98(++_0x1dd61a);}(_0x4010,0x157));var _0x0401=function(_0x790d5f,_0x5ec088){_0x790d5f=_0x790d5f-0x0;var _0x11f1e2=_0x4010[_0x790d5f];return _0x11f1e2;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0401('0x0'));module[_0x0401('0x1')]={'name':{'type':Sequelize[_0x0401('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x0401('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x0401('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x0401('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0401('0x3')](_0x0401('0x4'),'sinch')},'accountSid':{'type':Sequelize[_0x0401('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x0401('0x5')],'defaultValue':function(){return _0x0401('0x6');}},'notificationSound':{'type':Sequelize[_0x0401('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0401('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0401('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0401('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0401('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0401('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0401('0x7')],'defaultValue':![],'comment':_0x0401('0x9'),'set':function(_0x20762e){if(!_0x20762e){this[_0x0401('0xa')](_0x0401('0xb'),null);}this['setDataValue'](_0x0401('0xc'),_0x20762e);}},'description':{'type':Sequelize[_0x0401('0x2')]}}; \ No newline at end of file +var _0x54f6=['generate','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING'];(function(_0x46541b,_0x54beca){var _0x241eeb=function(_0x1e68bc){while(--_0x1e68bc){_0x46541b['push'](_0x46541b['shift']());}};_0x241eeb(++_0x54beca);}(_0x54f6,0x1dc));var _0x654f=function(_0x4d14e6,_0xb85299){_0x4d14e6=_0x4d14e6-0x0;var _0x29b727=_0x54f6[_0x4d14e6];return _0x29b727;};'use strict';var Sequelize=require(_0x654f('0x0'));var rs=require(_0x654f('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x654f('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x654f('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x654f('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x654f('0x3')],'defaultValue':function(){return rs[_0x654f('0x4')]();}},'phone':{'type':Sequelize[_0x654f('0x3')]},'type':{'type':Sequelize['ENUM'](_0x654f('0x5'),_0x654f('0x6'))},'accountSid':{'type':Sequelize[_0x654f('0x3')]},'baseUrl':{'type':Sequelize[_0x654f('0x3')]},'authToken':{'type':Sequelize[_0x654f('0x3')]},'notificationTemplate':{'type':Sequelize[_0x654f('0x7')],'defaultValue':function(){return _0x654f('0x8');}},'notificationSound':{'type':Sequelize[_0x654f('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x654f('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x654f('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x654f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x654f('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x654f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x654f('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x654f('0xc'),'set':function(_0x3d45c1){if(!_0x3d45c1){this[_0x654f('0xd')](_0x654f('0xe'),null);}this[_0x654f('0xd')](_0x654f('0xf'),_0x3d45c1);}},'description':{'type':Sequelize[_0x654f('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 19f7a4e..0135884 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 _0x93e9=['close','unmanaged','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','to\x20is\x20mandatory','List','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','destroy','get','WhatsappAccounts','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','show','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','params','WhatsappAccountId','create','getDispositions','Disposition','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','findOne','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','addApplications','sequelize','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','notify','whatsapp','account','sinch','statuses','read','WhatsappMessage','timestamp','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','Body','messageId','from','notifications','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','DESC','Contacts','contact','WhatsappInteraction','interaction','created','applications','push'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x93e9,0x18e));var _0x993e=function(_0x5aa8e0,_0x1e552c){_0x5aa8e0=_0x5aa8e0-0x0;var _0x4f4060=_0x93e9[_0x5aa8e0];return _0x4f4060;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require('mustache');var util=require(_0x993e('0x7'));var path=require(_0x993e('0x8'));var sox=require(_0x993e('0x9'));var csv=require(_0x993e('0xa'));var ejs=require(_0x993e('0xb'));var fs=require('fs');var fs_extra=require(_0x993e('0xc'));var _=require('lodash');var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require(_0x993e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x993e('0xa'));var querystring=require(_0x993e('0x10'));var Papa=require('papaparse');var Redis=require(_0x993e('0x11'));var authService=require(_0x993e('0x12'));var qs=require(_0x993e('0x13'));var as=require(_0x993e('0x14'));var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))(_0x993e('0x17'));var utils=require(_0x993e('0x18'));var config=require(_0x993e('0x19'));var licenseUtil=require(_0x993e('0x1a'));var db=require(_0x993e('0x1b'))['db'];config[_0x993e('0x1c')]=_[_0x993e('0x1d')](config[_0x993e('0x1c')],{'host':_0x993e('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x993e('0x1c')]));require(_0x993e('0x1f'))[_0x993e('0x20')](socket);var jayson=require(_0x993e('0x21'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1766f7,_0xbddf5c,_0x467458,_0x3d1d14){return new BPromise(function(_0x19855f,_0x2c7edb){var _0x29a16e=_0x3d1d14||client;return _0x29a16e['request'](_0x1766f7,_0x467458)[_0x993e('0x22')](function(_0x32eb1d){logger[_0x993e('0x23')](_0x993e('0x24'),_0xbddf5c,_0x993e('0x25'));logger[_0x993e('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xbddf5c,'request\x20sent',JSON[_0x993e('0x27')](_0x32eb1d));if(_0x32eb1d['error']){if(_0x32eb1d[_0x993e('0x28')][_0x993e('0x29')]===0x1f4){logger[_0x993e('0x28')](_0x993e('0x24'),_0xbddf5c,_0x32eb1d[_0x993e('0x28')]['message']);return _0x2c7edb(_0x32eb1d[_0x993e('0x28')][_0x993e('0x2a')]);}logger[_0x993e('0x28')](_0x993e('0x24'),_0xbddf5c,_0x32eb1d[_0x993e('0x28')]['message']);return _0x19855f(_0x32eb1d[_0x993e('0x28')][_0x993e('0x2a')]);}else{logger[_0x993e('0x23')](_0x993e('0x24'),_0xbddf5c,'request\x20sent');_0x19855f(_0x32eb1d[_0x993e('0x2b')]['message']);}})[_0x993e('0x2c')](function(_0x2f3718){logger['error'](_0x993e('0x24'),_0xbddf5c,_0x2f3718);_0x2c7edb(_0x2f3718);});});}function respondWithStatusCode(_0x59cfdf,_0x505705){_0x505705=_0x505705||0xcc;return function(_0xd33fb0){if(_0xd33fb0){return _0x59cfdf[_0x993e('0x2d')](_0x505705);}return _0x59cfdf[_0x993e('0x2e')](_0x505705)[_0x993e('0x2f')]();};}function respondWithResult(_0x31e10e,_0x19cd3d){_0x19cd3d=_0x19cd3d||0xc8;return function(_0x4ae572){if(_0x4ae572){return _0x31e10e[_0x993e('0x2e')](_0x19cd3d)[_0x993e('0x30')](_0x4ae572);}};}function respondWithFilteredResult(_0x1d2037,_0xcaa9d9){return function(_0xbf7e97){if(_0xbf7e97){var _0x16289c=typeof _0xcaa9d9[_0x993e('0x31')]==='undefined'&&typeof _0xcaa9d9[_0x993e('0x32')]===_0x993e('0x33');var _0x493717=_0xbf7e97[_0x993e('0x34')];var _0x5da21f=_0x16289c?0x0:_0xcaa9d9[_0x993e('0x31')];var _0x5f2030=_0x16289c?_0xbf7e97[_0x993e('0x34')]:_0xcaa9d9[_0x993e('0x31')]+_0xcaa9d9[_0x993e('0x32')];var _0x3107d5;if(_0x5f2030>=_0x493717){_0x5f2030=_0x493717;_0x3107d5=0xc8;}else{_0x3107d5=0xce;}_0x1d2037[_0x993e('0x2e')](_0x3107d5);return _0x1d2037['set'](_0x993e('0x35'),_0x5da21f+'-'+_0x5f2030+'/'+_0x493717)['json'](_0xbf7e97);}return null;};}function patchUpdates(_0x5a69b7){return function(_0x4f2d58){try{jsonpatch[_0x993e('0x36')](_0x4f2d58,_0x5a69b7,!![]);}catch(_0xb06ec1){return BPromise['reject'](_0xb06ec1);}return _0x4f2d58[_0x993e('0x37')]();};}function saveUpdates(_0x23cf5c,_0xdb8d18){return function(_0x372031){if(_0x372031){return _0x372031[_0x993e('0x38')](_0x23cf5c)[_0x993e('0x22')](function(_0x55480d){return _0x55480d;});}return null;};}function removeEntity(_0x1a639a,_0x542d30){return function(_0x5048c7){if(_0x5048c7){return _0x5048c7[_0x993e('0x39')]()[_0x993e('0x22')](function(){var _0x118cb5=_0x5048c7[_0x993e('0x3a')]({'plain':!![]});var _0x50655d=_0x993e('0x3b');return db['UserProfileResource'][_0x993e('0x39')]({'where':{'type':_0x50655d,'resourceId':_0x118cb5['id']}})[_0x993e('0x22')](function(){return _0x5048c7;});})[_0x993e('0x22')](function(){_0x1a639a[_0x993e('0x2e')](0xcc)[_0x993e('0x2f')]();});}};}function handleEntityNotFound(_0x5252d2,_0x527976){return function(_0x3ce164){if(!_0x3ce164){_0x5252d2[_0x993e('0x2d')](0x194);}return _0x3ce164;};}function handleError(_0xcaad02,_0x5509e4){_0x5509e4=_0x5509e4||0x1f4;return function(_0xf48a76){logger[_0x993e('0x28')](_0xf48a76['stack']);if(_0xf48a76['name']){delete _0xf48a76[_0x993e('0x3c')];}_0xcaad02['status'](_0x5509e4)[_0x993e('0x3d')](_0xf48a76);};}exports[_0x993e('0x3e')]=function(_0x13e42b,_0x507f93){var _0x162072={'include':[{'model':db[_0x993e('0x3f')],'as':_0x993e('0x40')}]},_0x44ccf7={},_0x1cf49e={'count':0x0,'rows':[]};var _0x102ce2=_['map'](db[_0x993e('0x41')][_0x993e('0x42')],function(_0x18b727){return{'name':_0x18b727['fieldName'],'type':_0x18b727[_0x993e('0x43')][_0x993e('0x44')]};});_0x44ccf7[_0x993e('0x45')]=_['map'](_0x102ce2,'name');_0x44ccf7['query']=_[_0x993e('0x46')](_0x13e42b[_0x993e('0x47')]);_0x44ccf7[_0x993e('0x48')]=_[_0x993e('0x49')](_0x44ccf7[_0x993e('0x45')],_0x44ccf7[_0x993e('0x47')]);_0x162072['attributes']=_[_0x993e('0x49')](_0x44ccf7['model'],qs['fields'](_0x13e42b[_0x993e('0x47')][_0x993e('0x4a')]));_0x162072[_0x993e('0x4b')]=_0x162072['attributes']['length']?_0x162072[_0x993e('0x4b')]:_0x44ccf7['model'];if(!_0x13e42b[_0x993e('0x47')][_0x993e('0x4c')](_0x993e('0x4d'))){_0x162072[_0x993e('0x32')]=qs[_0x993e('0x32')](_0x13e42b[_0x993e('0x47')][_0x993e('0x32')]);_0x162072[_0x993e('0x31')]=qs[_0x993e('0x31')](_0x13e42b[_0x993e('0x47')][_0x993e('0x31')]);}_0x162072[_0x993e('0x4e')]=qs[_0x993e('0x4f')](_0x13e42b[_0x993e('0x47')][_0x993e('0x4f')]);_0x162072[_0x993e('0x50')]=qs['filters'](_['pick'](_0x13e42b[_0x993e('0x47')],_0x44ccf7[_0x993e('0x48')]),_0x102ce2);if(_0x13e42b[_0x993e('0x47')]['filter']){_0x162072['where']=_[_0x993e('0x51')](_0x162072['where'],{'$or':_[_0x993e('0x52')](_0x102ce2,function(_0x319edb){if(_0x319edb[_0x993e('0x43')]!==_0x993e('0x53')){var _0x4d5b82={};_0x4d5b82[_0x319edb['name']]={'$like':'%'+_0x13e42b[_0x993e('0x47')][_0x993e('0x54')]+'%'};return _0x4d5b82;}})});}_0x162072=_['merge']({},_0x162072,_0x13e42b[_0x993e('0x55')]);var _0x1c6913={'where':_0x162072[_0x993e('0x50')]};return db['WhatsappAccount'][_0x993e('0x34')](_0x1c6913)[_0x993e('0x22')](function(_0x1bac6c){_0x1cf49e[_0x993e('0x34')]=_0x1bac6c;if(_0x13e42b['query'][_0x993e('0x56')]){_0x162072[_0x993e('0x57')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x993e('0x58')](_0x162072);})['then'](function(_0x3cc521){_0x1cf49e['rows']=_0x3cc521;return _0x1cf49e;})[_0x993e('0x22')](respondWithFilteredResult(_0x507f93,_0x162072))[_0x993e('0x2c')](handleError(_0x507f93,null));};exports[_0x993e('0x59')]=function(_0x5577c4,_0x18cdbc){var _0x33f6ac={'raw':![],'where':{'id':_0x5577c4['params']['id']},'include':[{'model':db[_0x993e('0x3f')],'as':_0x993e('0x40')}]},_0x23c63e={};_0x23c63e[_0x993e('0x45')]=_[_0x993e('0x46')](db[_0x993e('0x41')][_0x993e('0x42')]);_0x23c63e[_0x993e('0x47')]=_[_0x993e('0x46')](_0x5577c4[_0x993e('0x47')]);_0x23c63e[_0x993e('0x48')]=_[_0x993e('0x49')](_0x23c63e[_0x993e('0x45')],_0x23c63e[_0x993e('0x47')]);_0x33f6ac[_0x993e('0x4b')]=_[_0x993e('0x49')](_0x23c63e['model'],qs[_0x993e('0x4a')](_0x5577c4[_0x993e('0x47')][_0x993e('0x4a')]));_0x33f6ac[_0x993e('0x4b')]=_0x33f6ac['attributes'][_0x993e('0x5a')]?_0x33f6ac[_0x993e('0x4b')]:_0x23c63e[_0x993e('0x45')];if(_0x5577c4['query'][_0x993e('0x56')]){_0x33f6ac[_0x993e('0x57')]=[{'all':!![]}];}_0x33f6ac=_['merge']({},_0x33f6ac,_0x5577c4['options']);return db[_0x993e('0x41')][_0x993e('0x5b')](_0x33f6ac)[_0x993e('0x22')](handleEntityNotFound(_0x18cdbc,null))[_0x993e('0x22')](respondWithResult(_0x18cdbc,null))['catch'](handleError(_0x18cdbc,null));};exports['create']=function(_0x16ab27,_0x1dfd97){return db[_0x993e('0x41')]['create'](_0x16ab27[_0x993e('0x5c')],{})[_0x993e('0x22')](function(_0x155d35){var _0x214553=_0x16ab27[_0x993e('0x5d')][_0x993e('0x3a')]({'plain':!![]});if(!_0x214553)throw new Error(_0x993e('0x5e'));if(_0x214553['role']===_0x993e('0x5d')){var _0x1cd729=_0x155d35[_0x993e('0x3a')]({'plain':!![]});var _0x5f03df='WhatsappAccounts';return db[_0x993e('0x5f')][_0x993e('0x5b')]({'where':{'name':_0x5f03df,'userProfileId':_0x214553[_0x993e('0x60')]},'raw':!![]})['then'](function(_0x2de193){if(_0x2de193&&_0x2de193['autoAssociation']===0x0){return db[_0x993e('0x61')]['create']({'name':_0x1cd729[_0x993e('0x3c')],'resourceId':_0x1cd729['id'],'type':_0x2de193[_0x993e('0x3c')],'sectionId':_0x2de193['id']},{})[_0x993e('0x22')](function(){return _0x155d35;});}else{return _0x155d35;}})[_0x993e('0x2c')](function(_0x3954df){logger[_0x993e('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3954df);throw _0x3954df;});}return _0x155d35;})['then'](respondWithResult(_0x1dfd97,0xc9))[_0x993e('0x2c')](handleError(_0x1dfd97,null));};exports[_0x993e('0x38')]=function(_0x554ee3,_0x4faf43){if(_0x554ee3['body']['id']){delete _0x554ee3[_0x993e('0x5c')]['id'];}return db[_0x993e('0x41')][_0x993e('0x5b')]({'where':{'id':_0x554ee3[_0x993e('0x62')]['id']},'include':[{'model':db[_0x993e('0x3f')],'as':_0x993e('0x40')}]})[_0x993e('0x22')](handleEntityNotFound(_0x4faf43,null))[_0x993e('0x22')](saveUpdates(_0x554ee3[_0x993e('0x5c')],null))[_0x993e('0x22')](respondWithResult(_0x4faf43,null))[_0x993e('0x2c')](handleError(_0x4faf43,null));};exports[_0x993e('0x39')]=function(_0x15b726,_0x1785a1){return db['WhatsappAccount'][_0x993e('0x5b')]({'where':{'id':_0x15b726['params']['id']}})[_0x993e('0x22')](handleEntityNotFound(_0x1785a1,null))['then'](removeEntity(_0x1785a1,null))[_0x993e('0x2c')](handleError(_0x1785a1,null));};exports['describe']=function(_0x2a5ad9,_0x1ca576){return db[_0x993e('0x41')]['describe']()[_0x993e('0x22')](respondWithResult(_0x1ca576,null))[_0x993e('0x2c')](handleError(_0x1ca576,null));};exports['addDisposition']=function(_0x2c60a2,_0x1a86ee,_0x50fdba){if(_0x2c60a2[_0x993e('0x5c')]['id']){delete _0x2c60a2[_0x993e('0x5c')]['id'];}return db[_0x993e('0x41')][_0x993e('0x5b')]({'where':{'id':_0x2c60a2['params']['id']}})[_0x993e('0x22')](handleEntityNotFound(_0x1a86ee,null))[_0x993e('0x22')](function(_0x3a014e){if(_0x3a014e){_0x2c60a2['body'][_0x993e('0x63')]=_0x3a014e['id'];return db['Disposition'][_0x993e('0x64')](_0x2c60a2[_0x993e('0x5c')]);}})['then'](respondWithResult(_0x1a86ee,null))[_0x993e('0x2c')](handleError(_0x1a86ee,null));};exports[_0x993e('0x65')]=function(_0x52525c,_0x32b3ec,_0xf43677){var _0x27ad6d={'raw':![],'where':{}};var _0x5ae3e2={};var _0x7daa36={'count':0x0,'rows':[]};return db[_0x993e('0x41')]['findOne']({'where':{'id':_0x52525c['params']['id']}})['then'](handleEntityNotFound(_0x32b3ec,null))[_0x993e('0x22')](function(_0x98ba62){if(_0x98ba62){_0x5ae3e2[_0x993e('0x45')]=_[_0x993e('0x46')](db[_0x993e('0x66')]['rawAttributes']);_0x5ae3e2[_0x993e('0x47')]=_[_0x993e('0x46')](_0x52525c[_0x993e('0x47')]);_0x5ae3e2[_0x993e('0x48')]=_[_0x993e('0x49')](_0x5ae3e2['model'],_0x5ae3e2[_0x993e('0x47')]);_0x27ad6d['attributes']=_[_0x993e('0x49')](_0x5ae3e2[_0x993e('0x45')],qs[_0x993e('0x4a')](_0x52525c[_0x993e('0x47')][_0x993e('0x4a')]));_0x27ad6d['attributes']=_0x27ad6d[_0x993e('0x4b')][_0x993e('0x5a')]?_0x27ad6d[_0x993e('0x4b')]:_0x5ae3e2[_0x993e('0x45')];if(!_0x52525c[_0x993e('0x47')][_0x993e('0x4c')]('nolimit')){_0x27ad6d['limit']=qs[_0x993e('0x32')](_0x52525c[_0x993e('0x47')]['limit']);_0x27ad6d['offset']=qs['offset'](_0x52525c[_0x993e('0x47')][_0x993e('0x31')]);}_0x27ad6d[_0x993e('0x4e')]=qs[_0x993e('0x4f')](_0x52525c[_0x993e('0x47')]['sort']);_0x27ad6d[_0x993e('0x50')]=qs[_0x993e('0x48')](_[_0x993e('0x67')](_0x52525c['query'],_0x5ae3e2['filters']));_0x27ad6d[_0x993e('0x50')]['WhatsappAccountId']=_0x98ba62['id'];if(_0x52525c[_0x993e('0x47')]['filter']){_0x27ad6d[_0x993e('0x50')]=_[_0x993e('0x51')](_0x27ad6d[_0x993e('0x50')],{'$or':_['map'](_0x27ad6d[_0x993e('0x4b')],function(_0x1bd1ab){var _0x279f01={};_0x279f01[_0x1bd1ab]={'$like':'%'+_0x52525c['query'][_0x993e('0x54')]+'%'};return _0x279f01;})});}_0x27ad6d=_['merge']({},_0x27ad6d,_0x52525c['options']);return db['Disposition'][_0x993e('0x34')]({'where':_0x27ad6d[_0x993e('0x50')]})[_0x993e('0x22')](function(_0x38a202){_0x7daa36[_0x993e('0x34')]=_0x38a202;if(_0x52525c['query'][_0x993e('0x56')]){_0x27ad6d['include']=[{'all':!![]}];}return db[_0x993e('0x66')][_0x993e('0x58')](_0x27ad6d);})[_0x993e('0x22')](function(_0x38f055){_0x7daa36[_0x993e('0x68')]=_0x38f055;return _0x7daa36;});}})[_0x993e('0x22')](respondWithFilteredResult(_0x32b3ec,_0x27ad6d))[_0x993e('0x2c')](handleError(_0x32b3ec,null));};exports[_0x993e('0x69')]=function(_0x127cec,_0x501209,_0x5c0dc1){return db['WhatsappAccount'][_0x993e('0x5b')]({'where':{'id':_0x127cec['params']['id']}})['then'](handleEntityNotFound(_0x501209,null))[_0x993e('0x22')](function(_0x2fd6a1){if(_0x2fd6a1){return _0x2fd6a1[_0x993e('0x69')](_0x127cec[_0x993e('0x47')][_0x993e('0x6a')]);}})[_0x993e('0x22')](respondWithStatusCode(_0x501209,null))[_0x993e('0x2c')](handleError(_0x501209,null));};exports[_0x993e('0x6b')]=function(_0x45ebbe,_0x30580d,_0xed585){if(_0x45ebbe['body']['id']){delete _0x45ebbe['body']['id'];}return db[_0x993e('0x41')][_0x993e('0x5b')]({'where':{'id':_0x45ebbe['params']['id']}})[_0x993e('0x22')](handleEntityNotFound(_0x30580d,null))[_0x993e('0x22')](function(_0x3e86a4){if(_0x3e86a4){_0x45ebbe[_0x993e('0x5c')][_0x993e('0x63')]=_0x3e86a4['id'];return db[_0x993e('0x6c')][_0x993e('0x64')](_0x45ebbe[_0x993e('0x5c')]);}})['then'](respondWithResult(_0x30580d,null))['catch'](handleError(_0x30580d,null));};exports['getAnswers']=function(_0x243f98,_0x298e6f,_0x36f7ce){var _0x4a315e={'raw':![],'where':{}};var _0x13cbb9={};var _0x395493={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x993e('0x6d')]({'where':{'id':_0x243f98[_0x993e('0x62')]['id']}})['then'](handleEntityNotFound(_0x298e6f,null))[_0x993e('0x22')](function(_0x3da7ff){if(_0x3da7ff){_0x13cbb9['model']=_[_0x993e('0x46')](db[_0x993e('0x6c')][_0x993e('0x42')]);_0x13cbb9['query']=_[_0x993e('0x46')](_0x243f98[_0x993e('0x47')]);_0x13cbb9[_0x993e('0x48')]=_[_0x993e('0x49')](_0x13cbb9[_0x993e('0x45')],_0x13cbb9[_0x993e('0x47')]);_0x4a315e[_0x993e('0x4b')]=_['intersection'](_0x13cbb9[_0x993e('0x45')],qs[_0x993e('0x4a')](_0x243f98['query']['fields']));_0x4a315e[_0x993e('0x4b')]=_0x4a315e[_0x993e('0x4b')][_0x993e('0x5a')]?_0x4a315e[_0x993e('0x4b')]:_0x13cbb9[_0x993e('0x45')];if(!_0x243f98['query'][_0x993e('0x4c')](_0x993e('0x4d'))){_0x4a315e[_0x993e('0x32')]=qs[_0x993e('0x32')](_0x243f98[_0x993e('0x47')]['limit']);_0x4a315e[_0x993e('0x31')]=qs[_0x993e('0x31')](_0x243f98[_0x993e('0x47')][_0x993e('0x31')]);}_0x4a315e['order']=qs['sort'](_0x243f98[_0x993e('0x47')]['sort']);_0x4a315e[_0x993e('0x50')]=qs[_0x993e('0x48')](_[_0x993e('0x67')](_0x243f98['query'],_0x13cbb9[_0x993e('0x48')]));_0x4a315e['where']['WhatsappAccountId']=_0x3da7ff['id'];if(_0x243f98[_0x993e('0x47')][_0x993e('0x54')]){_0x4a315e['where']=_[_0x993e('0x51')](_0x4a315e['where'],{'$or':_[_0x993e('0x52')](_0x4a315e[_0x993e('0x4b')],function(_0x1756f0){var _0x52ba89={};_0x52ba89[_0x1756f0]={'$like':'%'+_0x243f98[_0x993e('0x47')]['filter']+'%'};return _0x52ba89;})});}_0x4a315e=_[_0x993e('0x51')]({},_0x4a315e,_0x243f98[_0x993e('0x55')]);return db['CannedAnswer'][_0x993e('0x34')]({'where':_0x4a315e['where']})['then'](function(_0x4df5ea){_0x395493['count']=_0x4df5ea;if(_0x243f98[_0x993e('0x47')][_0x993e('0x56')]){_0x4a315e['include']=[{'all':!![]}];}return db[_0x993e('0x6c')][_0x993e('0x58')](_0x4a315e);})[_0x993e('0x22')](function(_0x2dd71a){_0x395493['rows']=_0x2dd71a;return _0x395493;});}})[_0x993e('0x22')](respondWithFilteredResult(_0x298e6f,_0x4a315e))[_0x993e('0x2c')](handleError(_0x298e6f,null));};exports['removeAnswers']=function(_0x5999b8,_0xf56237,_0x32ac5e){return db[_0x993e('0x41')][_0x993e('0x5b')]({'where':{'id':_0x5999b8[_0x993e('0x62')]['id']}})[_0x993e('0x22')](handleEntityNotFound(_0xf56237,null))['then'](function(_0x35e9bd){if(_0x35e9bd){return _0x35e9bd['removeAnswers'](_0x5999b8[_0x993e('0x47')]['ids']);}})['then'](respondWithStatusCode(_0xf56237,null))[_0x993e('0x2c')](handleError(_0xf56237,null));};exports[_0x993e('0x6e')]=function(_0x4794f5,_0x2eaa53,_0x192b45){return db[_0x993e('0x41')][_0x993e('0x5b')]({'where':{'id':_0x4794f5[_0x993e('0x62')]['id']}})['then'](handleEntityNotFound(_0x2eaa53,null))['then'](function(_0x3c60a1){if(_0x3c60a1){return _0x3c60a1[_0x993e('0x6e')](_0x4794f5[_0x993e('0x5c')]['ids'],_[_0x993e('0x6f')](_0x4794f5['body'],['ids','id'])||{})[_0x993e('0x70')](function(_0x318bf8){for(var _0x27e812=0x0;_0x27e812<_0x4794f5[_0x993e('0x5c')][_0x993e('0x6a')]['length'];_0x27e812+=0x1){socket['emit'](_0x993e('0x71'),{'UserId':Number(_0x4794f5[_0x993e('0x5c')][_0x993e('0x6a')][_0x27e812]),'WhatsappAccountId':Number(_0x4794f5['params']['id'])});}return _0x318bf8;});}})[_0x993e('0x22')](respondWithResult(_0x2eaa53,null))[_0x993e('0x2c')](handleError(_0x2eaa53,null));};exports[_0x993e('0x72')]=function(_0xea86c,_0x160c3d,_0x5c95f7){return db['WhatsappAccount']['find']({'where':{'id':_0xea86c[_0x993e('0x62')]['id']}})['then'](handleEntityNotFound(_0x160c3d,null))[_0x993e('0x22')](function(_0x4579dd){if(_0x4579dd){return _0x4579dd[_0x993e('0x72')](_0xea86c[_0x993e('0x47')][_0x993e('0x6a')])[_0x993e('0x22')](function(){if(_[_0x993e('0x73')](_0xea86c[_0x993e('0x47')][_0x993e('0x6a')])){for(var _0x50f25c=0x0;_0x50f25c<_0xea86c['query']['ids']['length'];_0x50f25c+=0x1){socket[_0x993e('0x74')](_0x993e('0x75'),{'UserId':Number(_0xea86c[_0x993e('0x47')][_0x993e('0x6a')][_0x50f25c]),'WhatsappAccountId':Number(_0xea86c[_0x993e('0x62')]['id'])});}}else{socket[_0x993e('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0xea86c[_0x993e('0x47')][_0x993e('0x6a')]),'WhatsappAccountId':Number(_0xea86c[_0x993e('0x62')]['id'])});}});}})[_0x993e('0x22')](respondWithStatusCode(_0x160c3d,null))[_0x993e('0x2c')](handleError(_0x160c3d,null));};exports['getAgents']=function(_0x255962,_0x6647e7,_0x2211fe){var _0xbc1377={};var _0xce380e={};var _0x27092f;var _0x136004;return db[_0x993e('0x41')][_0x993e('0x6d')]({'where':{'id':_0x255962[_0x993e('0x62')]['id']}})[_0x993e('0x22')](handleEntityNotFound(_0x6647e7,null))[_0x993e('0x22')](function(_0x2eb61d){if(_0x2eb61d){_0x27092f=_0x2eb61d;_0xce380e['model']=_[_0x993e('0x46')](db['User'][_0x993e('0x42')]);_0xce380e[_0x993e('0x47')]=_[_0x993e('0x46')](_0x255962[_0x993e('0x47')]);_0xce380e['filters']=_[_0x993e('0x49')](_0xce380e[_0x993e('0x45')],_0xce380e[_0x993e('0x47')]);_0xbc1377[_0x993e('0x4b')]=_[_0x993e('0x49')](_0xce380e[_0x993e('0x45')],qs['fields'](_0x255962[_0x993e('0x47')][_0x993e('0x4a')]));_0xbc1377[_0x993e('0x4b')]=_0xbc1377[_0x993e('0x4b')]['length']?_0xbc1377['attributes']:_0xce380e['model'];_0xbc1377['order']=qs['sort'](_0x255962[_0x993e('0x47')]['sort']);_0xbc1377[_0x993e('0x50')]=qs[_0x993e('0x48')](_[_0x993e('0x67')](_0x255962[_0x993e('0x47')],_0xce380e[_0x993e('0x48')]));if(_0x255962['query'][_0x993e('0x54')]){_0xbc1377[_0x993e('0x50')]=_[_0x993e('0x51')](_0xbc1377[_0x993e('0x50')],{'$or':_[_0x993e('0x52')](_0xbc1377[_0x993e('0x4b')],function(_0x4ef1de){var _0x2d795b={};_0x2d795b[_0x4ef1de]={'$like':'%'+_0x255962[_0x993e('0x47')][_0x993e('0x54')]+'%'};return _0x2d795b;})});}_0xbc1377=_['merge']({},_0xbc1377,_0x255962[_0x993e('0x55')]);return _0x27092f[_0x993e('0x76')](_0xbc1377);}})['then'](function(_0x383b7a){if(_0x383b7a){_0x136004=_0x383b7a['length'];if(!_0x255962[_0x993e('0x47')][_0x993e('0x4c')](_0x993e('0x4d'))){_0xbc1377[_0x993e('0x32')]=qs[_0x993e('0x32')](_0x255962[_0x993e('0x47')][_0x993e('0x32')]);_0xbc1377[_0x993e('0x31')]=qs[_0x993e('0x31')](_0x255962['query'][_0x993e('0x31')]);}return _0x27092f[_0x993e('0x76')](_0xbc1377);}})[_0x993e('0x22')](function(_0x1331a2){if(_0x1331a2){return _0x1331a2?{'count':_0x136004,'rows':_0x1331a2}:null;}})[_0x993e('0x22')](respondWithResult(_0x6647e7,null))[_0x993e('0x2c')](handleError(_0x6647e7,null));};exports[_0x993e('0x77')]=function(_0xdecf9a,_0x2d6fb3){var _0x214f53=_0xdecf9a['params']['id'];var _0x5f2413=_0xdecf9a[_0x993e('0x5c')];var _0x3f75f3=0xc8;var _0x30bdc7=null;return db[_0x993e('0x78')]['transaction']({'isolationLevel':db[_0x993e('0x78')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x3b68c8){return db['WhatsappAccount'][_0x993e('0x6d')]({'where':{'id':_0x214f53},'transaction':_0x3b68c8})[_0x993e('0x22')](function(_0x459b3a){if(_0x459b3a){return db[_0x993e('0x79')][_0x993e('0x39')]({'where':{'WhatsappAccountId':_0x214f53},'transaction':_0x3b68c8})['then'](function(){var _0xc8b1c1=_[_0x993e('0x52')](_0x5f2413,function(_0x1199b5){_0x1199b5[_0x993e('0x63')]=_0x214f53;return _0x1199b5;});return db['WhatsappApplication'][_0x993e('0x7a')](_0xc8b1c1,{'transaction':_0x3b68c8});});}else{_0x3f75f3=0x194;_0x30bdc7=[];}});})[_0x993e('0x22')](function(){if(_0x3f75f3!==0x194){return db[_0x993e('0x79')][_0x993e('0x7b')]({'where':{'WhatsappAccountId':_0x214f53},'order':_0x993e('0x7c')})[_0x993e('0x22')](function(_0x3273ad){_0x30bdc7=_0x3273ad;});}})[_0x993e('0x2c')](function(_0x224369){_0x3f75f3=0x1f4;logger[_0x993e('0x28')](_0x224369[_0x993e('0x7d')]);if(_0x224369[_0x993e('0x3c')]){delete _0x224369[_0x993e('0x3c')];}_0x30bdc7=_0x224369;})[_0x993e('0x7e')](function(){if(_0x30bdc7===null){_0x2d6fb3[_0x993e('0x2d')](_0x3f75f3);}else{if(_0x3f75f3===0x1f4){_0x2d6fb3[_0x993e('0x2e')](_0x3f75f3)[_0x993e('0x3d')](_0x30bdc7);}else{_0x2d6fb3[_0x993e('0x2e')](_0x3f75f3)[_0x993e('0x30')](_0x30bdc7);}}});};exports['getApplications']=function(_0x1528c5,_0x3a4bc1,_0x44a75e){var _0x56383={};var _0x3f6a51={};var _0x2ed450;var _0x32eb20;return db[_0x993e('0x41')][_0x993e('0x6d')]({'where':{'id':_0x1528c5[_0x993e('0x62')]['id']}})[_0x993e('0x22')](handleEntityNotFound(_0x3a4bc1,null))[_0x993e('0x22')](function(_0x46c977){if(_0x46c977){_0x2ed450=_0x46c977;_0x3f6a51[_0x993e('0x45')]=_[_0x993e('0x46')](db['WhatsappApplication'][_0x993e('0x42')]);_0x3f6a51['query']=_[_0x993e('0x46')](_0x1528c5[_0x993e('0x47')]);_0x3f6a51['filters']=_[_0x993e('0x49')](_0x3f6a51[_0x993e('0x45')],_0x3f6a51[_0x993e('0x47')]);_0x56383[_0x993e('0x4b')]=_[_0x993e('0x49')](_0x3f6a51[_0x993e('0x45')],qs[_0x993e('0x4a')](_0x1528c5['query'][_0x993e('0x4a')]));_0x56383['attributes']=_0x56383['attributes'][_0x993e('0x5a')]?_0x56383[_0x993e('0x4b')]:_0x3f6a51[_0x993e('0x45')];_0x56383[_0x993e('0x4e')]=qs[_0x993e('0x4f')](_0x1528c5['query'][_0x993e('0x4f')]);_0x56383['where']=qs['filters'](_[_0x993e('0x67')](_0x1528c5[_0x993e('0x47')],_0x3f6a51['filters']));if(_0x1528c5['query'][_0x993e('0x54')]){_0x56383[_0x993e('0x50')]=_[_0x993e('0x51')](_0x56383[_0x993e('0x50')],{'$or':_['map'](_0x56383['attributes'],function(_0x365d44){var _0x535005={};_0x535005[_0x365d44]={'$like':'%'+_0x1528c5['query'][_0x993e('0x54')]+'%'};return _0x535005;})});}_0x56383=_[_0x993e('0x51')]({},_0x56383,_0x1528c5[_0x993e('0x55')]);return _0x2ed450[_0x993e('0x7f')](_0x56383);}})[_0x993e('0x22')](function(_0x6d1b75){if(_0x6d1b75){_0x32eb20=_0x6d1b75[_0x993e('0x5a')];if(!_0x1528c5['query'][_0x993e('0x4c')]('nolimit')){_0x56383[_0x993e('0x32')]=qs[_0x993e('0x32')](_0x1528c5[_0x993e('0x47')]['limit']);_0x56383[_0x993e('0x31')]=qs['offset'](_0x1528c5['query'][_0x993e('0x31')]);}return _0x2ed450['getApplications'](_0x56383);}})[_0x993e('0x22')](function(_0x2acf4c){if(_0x2acf4c){return _0x2acf4c?{'count':_0x32eb20,'rows':_0x2acf4c}:null;}})[_0x993e('0x22')](respondWithResult(_0x3a4bc1,null))[_0x993e('0x2c')](handleError(_0x3a4bc1,null));};exports[_0x993e('0x80')]=function(_0xdea10c,_0x592de4,_0x6a9cbf){var _0x934f17={'channel':_0x993e('0x81')};var _0x21e517=[];var _0x581e97=[];var _0xec429e={};return db[_0x993e('0x41')][_0x993e('0x5b')]({'where':{'id':_0xdea10c[_0x993e('0x62')]['id']},'include':[{'model':db[_0x993e('0x79')],'as':'Applications'}]})[_0x993e('0x22')](handleEntityNotFound(_0x592de4,null))[_0x993e('0x22')](function(_0x17a2fa){_0x934f17[_0x993e('0x82')]=_0x17a2fa;if(_0x934f17[_0x993e('0x82')]&&_0x934f17[_0x993e('0x82')][_0x993e('0x43')]===_0x993e('0x83')&&_0xdea10c[_0x993e('0x5c')][_0x993e('0x84')]){if(_0xdea10c[_0x993e('0x5c')]['statuses'][_0x993e('0x5a')]===0x0)return;if(_0xdea10c[_0x993e('0x5c')][_0x993e('0x84')][0x0]['state']!==_0x993e('0x85'))return;return db[_0x993e('0x86')]['update']({'read':!![],'readAt':_0xdea10c[_0x993e('0x5c')][_0x993e('0x84')][0x0][_0x993e('0x87')]},{'where':{'messageId':_0xdea10c['body'][_0x993e('0x84')][0x0]['message_id']},'individualHooks':!![]})[_0x993e('0x22')](function(_0xf4b220){return _0x592de4[_0x993e('0x2e')](0xc8)[_0x993e('0x30')](_0xf4b220);});}_0x934f17['applications']=_[_0x993e('0x88')](_0x17a2fa[_0x993e('0x89')],['priority'],[_0x993e('0x8a')]);if(_0x934f17[_0x993e('0x82')][_0x993e('0x89')]){delete _0x934f17[_0x993e('0x82')][_0x993e('0x89')];}return db[_0x993e('0x8b')]['describe']()[_0x993e('0x22')](function(_0x8fc293){if(!_0x8fc293){throw new db[(_0x993e('0x8c'))][(_0x993e('0x8d'))](_0x993e('0x8e'));}_0x21e517=_[_0x993e('0x8f')](_[_0x993e('0x46')](_0x8fc293),['createdAt',_0x993e('0x90')]);_0x581e97=_[_0x993e('0x8f')](_[_0x993e('0x46')](_0x8fc293),[_0x993e('0x91'),'updatedAt',_0x993e('0x92'),_0x993e('0x93')]);_0x934f17[_0x993e('0x5c')]={'mapKey':_0x993e('0x94')};if(_0x934f17['account']&&_0x934f17[_0x993e('0x82')][_0x993e('0x43')]===_0x993e('0x95')){_0x934f17[_0x993e('0x5c')]['from']=_0xdea10c['body'][_0x993e('0x96')][_0x993e('0x97')](_0x993e('0x98'),'');_0x934f17[_0x993e('0x5c')]['body']=_0xdea10c[_0x993e('0x5c')][_0x993e('0x99')];_0x934f17[_0x993e('0x5c')][_0x993e('0x9a')]=_0xdea10c['body']['MessageSid'];}if(_0x934f17[_0x993e('0x82')]&&_0x934f17['account'][_0x993e('0x43')]==='sinch'){_0x934f17[_0x993e('0x5c')][_0x993e('0x9b')]=_0xdea10c['body'][_0x993e('0x9c')][0x0]['from'];_0x934f17['body'][_0x993e('0x5c')]=_0xdea10c[_0x993e('0x5c')]['notifications'][0x0][_0x993e('0x2a')][_0x993e('0x5c')];_0x934f17[_0x993e('0x5c')][_0x993e('0x9a')]=_0xdea10c[_0x993e('0x5c')][_0x993e('0x9c')][0x0][_0x993e('0x9d')];}if(_0x934f17[_0x993e('0x5c')]['id']){delete _0x934f17[_0x993e('0x5c')]['id'];}if(_[_0x993e('0x9e')](_0x934f17[_0x993e('0x5c')][_0x993e('0x9b')])){throw new db[(_0x993e('0x8c'))][(_0x993e('0x8d'))](_0x993e('0x9f'));}if(_[_0x993e('0x9e')](_0x934f17[_0x993e('0x5c')][_0x993e('0x5c')])||_0x934f17['body'][_0x993e('0x5c')]===''){throw new db['Sequelize'][(_0x993e('0x8d'))](_0x993e('0xa0'));}if(_[_0x993e('0x9e')](_0x934f17[_0x993e('0x5c')][_0x993e('0xa1')])){throw new db[(_0x993e('0x8c'))][(_0x993e('0x8d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x581e97);}if(!_[_0x993e('0xa2')](_0x581e97,_0x934f17[_0x993e('0x5c')]['mapKey'])){throw new db[(_0x993e('0x8c'))][(_0x993e('0x8d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x581e97);}_0xec429e[_0x934f17[_0x993e('0x5c')][_0x993e('0xa1')]]=_0x934f17['body']['from'];return db[_0x993e('0xa3')][_0x993e('0x5b')]({'where':{'id':_0x934f17[_0x993e('0x82')][_0x993e('0x93')]},'include':[{'model':db[_0x993e('0x8b')],'as':'Contacts','where':_0xec429e,'limit':0x1,'order':[[_0x993e('0x90'),_0x993e('0xa4')]]}]});})['then'](handleEntityNotFound(_0x592de4,null))[_0x993e('0x22')](function(_0x2f2c65){if(_0x2f2c65){_0x934f17['list']=_['omit'](_0x2f2c65,[_0x993e('0xa5')]);if(_0x2f2c65['Contacts'][_0x993e('0x5a')]){return _0x2f2c65[_0x993e('0xa5')][0x0];}var _0x4d9075=_[_0x993e('0x1d')](_0x934f17[_0x993e('0x5c')],{'firstName':_0x934f17['body'][_0x993e('0x9b')],'ListId':_0x2f2c65['id']});_0x4d9075[_0x934f17['body']['mapKey']]=_0x934f17[_0x993e('0x5c')][_0x993e('0x9b')];return db[_0x993e('0x8b')][_0x993e('0x64')](_0x4d9075,{'fields':_0x21e517,'raw':!![]});}})[_0x993e('0x22')](handleEntityNotFound(_0x592de4,null))[_0x993e('0x22')](function(_0x182f77){if(_0x182f77){_0x934f17[_0x993e('0xa6')]=_0x182f77;var _0x158aa4={'ContactId':_0x182f77['id'],'phone':_0x934f17['body']['from'],'WhatsappAccountId':_0xdea10c[_0x993e('0x62')]['id']};var _0x4390e3={'ContactId':_0x182f77['id'],'WhatsappAccountId':_0xdea10c[_0x993e('0x62')]['id'],'closed':![]};return db[_0x993e('0xa7')]['find']({'where':_0x4390e3})[_0x993e('0x22')](function(_0xa3cd0d){if(_0xa3cd0d){return[_0xa3cd0d,![]];}return db[_0x993e('0xa7')][_0x993e('0x64')](_0x158aa4)['then'](function(_0x517a6d){return[_0x517a6d,!![]];});});}})[_0x993e('0x70')](function(_0x377059,_0x226e3b){_0x934f17['interaction']=_0x377059[_0x993e('0x3a')]({'plain':!![]});_0x934f17[_0x993e('0xa8')][_0x993e('0xa9')]=![];if(_0x226e3b){if(_0x934f17[_0x993e('0x82')]['autoclose']){_0x934f17[_0x993e('0xaa')][_0x993e('0xab')]({'id':0x0,'priority':_0x934f17[_0x993e('0xaa')][_0x993e('0x5a')]+0x1,'app':_0x993e('0xac'),'appdata':_0x993e('0xad'),'interval':'*,*,*,*'});}_0x934f17[_0x993e('0xa8')][_0x993e('0xa9')]=!![];}return db[_0x993e('0x86')][_0x993e('0x64')]({'phone':_0x934f17['body'][_0x993e('0x9b')],'messageId':_0x934f17[_0x993e('0x5c')][_0x993e('0x9a')],'body':_0x934f17['body'][_0x993e('0x5c')],'WhatsappAccountId':_0xdea10c[_0x993e('0x62')]['id'],'WhatsappInteractionId':_0x377059['id'],'direction':'in','ContactId':_0x377059['ContactId'],'AttachmentId':_0x934f17['body'][_0x993e('0xae')]});})[_0x993e('0x22')](function(_0x8e566a){_0x934f17['message']=_0x8e566a;if(_0x934f17['interaction']['UserId']){return db['User']['find']({'attributes':['id',_0x993e('0x3c')],'where':{'id':_0x934f17[_0x993e('0xa8')][_0x993e('0xaf')]}})['then'](function(_0x11bdfa){if(_0x11bdfa){_0x934f17[_0x993e('0xaa')]['unshift']({'id':0x0,'priority':0x0,'app':_0x993e('0xb0'),'appdata':_0x11bdfa['name']+','+(_0x934f17['account'][_0x993e('0xb1')]||0xa),'interval':_0x993e('0xb2')});}return respondWithRpcPromise(_0x993e('0xb3'),_0x993e('0xb4'),_0x934f17);});}return respondWithRpcPromise('Start',_0x993e('0xb4'),_0x934f17);})['then'](function(_0xfee77e){if(_0xfee77e){var _0x1b704e=0xc8;var _0x3f7926=_0x993e('0xb5');logger[_0x993e('0x23')](_0x993e('0xb6'),_0x3f7926,_0x1b704e,'entity\x20found');logger[_0x993e('0x26')](_0x993e('0xb7'),_0x3f7926,_0x1b704e,'entity\x20found',JSON[_0x993e('0x27')](_0xfee77e));if(_0x934f17[_0x993e('0x82')][_0x993e('0x43')]==='twilio'){return _0x592de4['status'](_0x1b704e)['set'](_0x993e('0xb8'),'text/xml')[_0x993e('0x3d')](_0x993e('0xb9'));}else{return _0x592de4[_0x993e('0x2e')](_0x1b704e)[_0x993e('0x30')](_0xfee77e);}}});})[_0x993e('0x2c')](handleError(_0x592de4,null));};exports[_0x993e('0x3d')]=function(_0x2c9f2b,_0x436fd9,_0x22c2bb){var _0x1006d0,_0x4978a6,_0x852558;if(_[_0x993e('0x9e')](_0x2c9f2b[_0x993e('0x5c')][_0x993e('0x5c')])||_0x2c9f2b['body'][_0x993e('0x5c')]===''){throw new db[(_0x993e('0x8c'))][(_0x993e('0x8d'))](_0x993e('0xa0'));}if(_[_0x993e('0x9e')](_0x2c9f2b[_0x993e('0x5c')]['to'])){throw new db[(_0x993e('0x8c'))][(_0x993e('0x8d'))](_0x993e('0xba'));}_0x1006d0=_0x2c9f2b[_0x993e('0x5c')]['to'];return db[_0x993e('0x41')]['find']({'where':{'id':_0x2c9f2b['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x993e('0x8b')],'as':'Contacts','where':{'mobile':_0x1006d0},'limit':0x1,'order':[[_0x993e('0x90'),_0x993e('0xa4')]]}]}]})['then'](handleEntityNotFound(_0x436fd9,null))[_0x993e('0x22')](function(_0x3abd8b){if(_0x3abd8b&&_0x3abd8b['List']){_0x4978a6=_0x3abd8b[_0x993e('0x3a')]({'plain':!![]});if(_0x4978a6[_0x993e('0xbb')]&&_0x4978a6[_0x993e('0xbb')]['Contacts']['length']){return _0x4978a6[_0x993e('0xbb')][_0x993e('0xa5')][0x0];}return db['CmContact'][_0x993e('0x64')](_['defaults'](_0x2c9f2b[_0x993e('0x5c')],{'firstName':_0x1006d0,'mobile':_0x1006d0,'phone':_0x1006d0,'ListId':_0x4978a6[_0x993e('0x93')]}));}})[_0x993e('0x22')](handleEntityNotFound(_0x436fd9,null))[_0x993e('0x22')](function(_0x4727b1){if(_0x4727b1){_0x852558=_0x4727b1;return db['WhatsappInteraction'][_0x993e('0x5b')]({'where':{'ContactId':_0x852558['id'],'closed':![],'WhatsappAccountId':_0x4978a6['id']}})[_0x993e('0x22')](function(_0x17cd23){if(_0x17cd23){return[_0x17cd23,![]];}return db['WhatsappInteraction'][_0x993e('0x64')]({'UserId':_0x2c9f2b['user']['id'],'ContactId':_0x852558['id'],'WhatsappAccountId':_0x4978a6['id'],'phone':_0x1006d0,'firstMsgDirection':'out','Messages':[_[_0x993e('0x51')](_0x2c9f2b[_0x993e('0x5c')],{'read':![],'body':_0x2c9f2b[_0x993e('0x5c')]['body'],'phone':_0x1006d0,'WhatsappAccountId':_0x4978a6['id'],'UserId':_0x2c9f2b['user']['id'],'ContactId':_0x852558['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x993e('0xbc')}]})['then'](function(_0x52b4fc){return[_0x52b4fc,!![]];});});}})['spread'](function(_0x31be52,_0xd48148){if(_0xd48148){return _0x31be52;}return db[_0x993e('0x86')][_0x993e('0x64')](_[_0x993e('0x51')](_0x2c9f2b[_0x993e('0x5c')],{'read':![],'body':_0x2c9f2b[_0x993e('0x5c')][_0x993e('0x5c')],'phone':_0x1006d0,'WhatsappAccountId':_0x4978a6['id'],'WhatsappInteractionId':_0x31be52['id'],'UserId':_0x2c9f2b['user']['id'],'ContactId':_0x852558['id']}))[_0x993e('0x22')](function(_0x2e80d2){_0x31be52[_0x993e('0xbd')][_0x993e('0xbc')]=[];_0x31be52[_0x993e('0xbd')]['Messages'][_0x993e('0xab')](_0x2e80d2[_0x993e('0xbd')]);return _0x31be52;});})['then'](respondWithResult(_0x436fd9,null))[_0x993e('0x2c')](handleError(_0x436fd9,null));}; \ No newline at end of file +var _0x0c89=['ListId','mobile','twilio','from','replace','whatsapp:','messageId','MessageSid','notifications','isNil','Sequelize','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','CmContact','WhatsappInteraction','interaction','created','autoclose','unmanaged','*,*,*,*','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','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','./whatsappAccount.socket','register','jayson/promise','http','request','then','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','error','message','info','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','WhatsappAccounts','stack','name','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','query','keys','fields','attributes','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','include','catch','show','params','rawAttributes','intersection','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','autoAssociation','UserProfileResource','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','findAll','addAnswer','CannedAnswer','hasOwnProperty','rows','removeAnswers','ids','omit','spread','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','finally','send','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','update','timestamp','message_id','applications','orderBy','priority','asc','ValidationError','no\x20available\x20attributes','updatedAt','difference','CompanyId'];(function(_0xf416c1,_0x237b85){var _0xdf8811=function(_0x52d75d){while(--_0x52d75d){_0xf416c1['push'](_0xf416c1['shift']());}};_0xdf8811(++_0x237b85);}(_0x0c89,0x1b7));var _0x90c8=function(_0x1e1d92,_0x39b294){_0x1e1d92=_0x1e1d92-0x0;var _0x5d51a5=_0x0c89[_0x1e1d92];return _0x5d51a5;};'use strict';var emlformat=require(_0x90c8('0x0'));var rimraf=require(_0x90c8('0x1'));var zipdir=require(_0x90c8('0x2'));var jsonpatch=require(_0x90c8('0x3'));var rp=require(_0x90c8('0x4'));var moment=require(_0x90c8('0x5'));var BPromise=require(_0x90c8('0x6'));var Mustache=require(_0x90c8('0x7'));var util=require(_0x90c8('0x8'));var path=require(_0x90c8('0x9'));var sox=require(_0x90c8('0xa'));var csv=require(_0x90c8('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90c8('0xc'));var _=require('lodash');var squel=require(_0x90c8('0xd'));var crypto=require(_0x90c8('0xe'));var jsforce=require(_0x90c8('0xf'));var deskjs=require(_0x90c8('0x10'));var toCsv=require(_0x90c8('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x90c8('0x11'));var authService=require(_0x90c8('0x12'));var qs=require(_0x90c8('0x13'));var as=require(_0x90c8('0x14'));var hardwareService=require(_0x90c8('0x15'));var logger=require(_0x90c8('0x16'))(_0x90c8('0x17'));var utils=require(_0x90c8('0x18'));var config=require(_0x90c8('0x19'));var licenseUtil=require(_0x90c8('0x1a'));var db=require(_0x90c8('0x1b'))['db'];config['redis']=_[_0x90c8('0x1c')](config[_0x90c8('0x1d')],{'host':_0x90c8('0x1e'),'port':0x18eb});var socket=require(_0x90c8('0x1f'))(new Redis(config[_0x90c8('0x1d')]));require(_0x90c8('0x20'))[_0x90c8('0x21')](socket);var jayson=require(_0x90c8('0x22'));var client=jayson['client'][_0x90c8('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x27498b,_0x537b9e,_0x17b604,_0x7b247f){return new BPromise(function(_0x4736aa,_0x41a922){var _0x30daf2=_0x7b247f||client;return _0x30daf2[_0x90c8('0x24')](_0x27498b,_0x17b604)[_0x90c8('0x25')](function(_0x2195a6){logger['info'](_0x90c8('0x26'),_0x537b9e,'request\x20sent');logger[_0x90c8('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x537b9e,_0x90c8('0x28'),JSON['stringify'](_0x2195a6));if(_0x2195a6[_0x90c8('0x29')]){if(_0x2195a6[_0x90c8('0x29')]['code']===0x1f4){logger[_0x90c8('0x29')]('WhatsappAccount,\x20%s,\x20%s',_0x537b9e,_0x2195a6['error'][_0x90c8('0x2a')]);return _0x41a922(_0x2195a6[_0x90c8('0x29')][_0x90c8('0x2a')]);}logger[_0x90c8('0x29')](_0x90c8('0x26'),_0x537b9e,_0x2195a6[_0x90c8('0x29')]['message']);return _0x4736aa(_0x2195a6[_0x90c8('0x29')]['message']);}else{logger[_0x90c8('0x2b')](_0x90c8('0x26'),_0x537b9e,_0x90c8('0x28'));_0x4736aa(_0x2195a6['result']['message']);}})['catch'](function(_0x1bba09){logger[_0x90c8('0x29')](_0x90c8('0x26'),_0x537b9e,_0x1bba09);_0x41a922(_0x1bba09);});});}function respondWithStatusCode(_0x5146cf,_0x5744d7){_0x5744d7=_0x5744d7||0xcc;return function(_0x11eb18){if(_0x11eb18){return _0x5146cf[_0x90c8('0x2c')](_0x5744d7);}return _0x5146cf['status'](_0x5744d7)[_0x90c8('0x2d')]();};}function respondWithResult(_0x3675d5,_0x2c14a9){_0x2c14a9=_0x2c14a9||0xc8;return function(_0x5db47b){if(_0x5db47b){return _0x3675d5[_0x90c8('0x2e')](_0x2c14a9)[_0x90c8('0x2f')](_0x5db47b);}};}function respondWithFilteredResult(_0x306677,_0x18b561){return function(_0x25014a){if(_0x25014a){var _0x9a2012=typeof _0x18b561[_0x90c8('0x30')]===_0x90c8('0x31')&&typeof _0x18b561[_0x90c8('0x32')]===_0x90c8('0x31');var _0x942dcb=_0x25014a[_0x90c8('0x33')];var _0x156815=_0x9a2012?0x0:_0x18b561['offset'];var _0x201524=_0x9a2012?_0x25014a[_0x90c8('0x33')]:_0x18b561[_0x90c8('0x30')]+_0x18b561[_0x90c8('0x32')];var _0x463ba4;if(_0x201524>=_0x942dcb){_0x201524=_0x942dcb;_0x463ba4=0xc8;}else{_0x463ba4=0xce;}_0x306677[_0x90c8('0x2e')](_0x463ba4);return _0x306677[_0x90c8('0x34')]('Content-Range',_0x156815+'-'+_0x201524+'/'+_0x942dcb)[_0x90c8('0x2f')](_0x25014a);}return null;};}function patchUpdates(_0x53b70c){return function(_0x14274e){try{jsonpatch[_0x90c8('0x35')](_0x14274e,_0x53b70c,!![]);}catch(_0x22469d){return BPromise[_0x90c8('0x36')](_0x22469d);}return _0x14274e[_0x90c8('0x37')]();};}function saveUpdates(_0x5e3aa8,_0x3d5c6a){return function(_0x126169){if(_0x126169){return _0x126169['update'](_0x5e3aa8)[_0x90c8('0x25')](function(_0x39a090){return _0x39a090;});}return null;};}function removeEntity(_0x5b6acc,_0x578729){return function(_0x59e0d5){if(_0x59e0d5){return _0x59e0d5[_0x90c8('0x38')]()[_0x90c8('0x25')](function(){var _0x58702c=_0x59e0d5['get']({'plain':!![]});var _0x1d54a9=_0x90c8('0x39');return db['UserProfileResource'][_0x90c8('0x38')]({'where':{'type':_0x1d54a9,'resourceId':_0x58702c['id']}})[_0x90c8('0x25')](function(){return _0x59e0d5;});})[_0x90c8('0x25')](function(){_0x5b6acc[_0x90c8('0x2e')](0xcc)[_0x90c8('0x2d')]();});}};}function handleEntityNotFound(_0x589b16,_0x569535){return function(_0x170dd9){if(!_0x170dd9){_0x589b16[_0x90c8('0x2c')](0x194);}return _0x170dd9;};}function handleError(_0xcf7bff,_0x4f855b){_0x4f855b=_0x4f855b||0x1f4;return function(_0x538f73){logger[_0x90c8('0x29')](_0x538f73[_0x90c8('0x3a')]);if(_0x538f73['name']){delete _0x538f73[_0x90c8('0x3b')];}_0xcf7bff[_0x90c8('0x2e')](_0x4f855b)['send'](_0x538f73);};}exports['index']=function(_0x2eb471,_0x53f043){var _0x303c32={'include':[{'model':db[_0x90c8('0x3c')],'as':_0x90c8('0x3d')}]},_0x484c09={},_0x20f495={'count':0x0,'rows':[]};var _0x2827b7=_[_0x90c8('0x3e')](db[_0x90c8('0x3f')]['rawAttributes'],function(_0xe6aee9){return{'name':_0xe6aee9[_0x90c8('0x40')],'type':_0xe6aee9[_0x90c8('0x41')][_0x90c8('0x42')]};});_0x484c09[_0x90c8('0x43')]=_[_0x90c8('0x3e')](_0x2827b7,_0x90c8('0x3b'));_0x484c09[_0x90c8('0x44')]=_[_0x90c8('0x45')](_0x2eb471[_0x90c8('0x44')]);_0x484c09['filters']=_['intersection'](_0x484c09['model'],_0x484c09[_0x90c8('0x44')]);_0x303c32['attributes']=_['intersection'](_0x484c09[_0x90c8('0x43')],qs[_0x90c8('0x46')](_0x2eb471[_0x90c8('0x44')][_0x90c8('0x46')]));_0x303c32['attributes']=_0x303c32['attributes']['length']?_0x303c32[_0x90c8('0x47')]:_0x484c09[_0x90c8('0x43')];if(!_0x2eb471[_0x90c8('0x44')]['hasOwnProperty'](_0x90c8('0x48'))){_0x303c32[_0x90c8('0x32')]=qs['limit'](_0x2eb471[_0x90c8('0x44')]['limit']);_0x303c32[_0x90c8('0x30')]=qs[_0x90c8('0x30')](_0x2eb471[_0x90c8('0x44')]['offset']);}_0x303c32[_0x90c8('0x49')]=qs[_0x90c8('0x4a')](_0x2eb471['query']['sort']);_0x303c32['where']=qs[_0x90c8('0x4b')](_[_0x90c8('0x4c')](_0x2eb471[_0x90c8('0x44')],_0x484c09['filters']),_0x2827b7);if(_0x2eb471[_0x90c8('0x44')]['filter']){_0x303c32[_0x90c8('0x4d')]=_['merge'](_0x303c32['where'],{'$or':_[_0x90c8('0x3e')](_0x2827b7,function(_0x33e953){if(_0x33e953[_0x90c8('0x41')]!==_0x90c8('0x4e')){var _0x20b7d1={};_0x20b7d1[_0x33e953[_0x90c8('0x3b')]]={'$like':'%'+_0x2eb471[_0x90c8('0x44')][_0x90c8('0x4f')]+'%'};return _0x20b7d1;}})});}_0x303c32=_[_0x90c8('0x50')]({},_0x303c32,_0x2eb471[_0x90c8('0x51')]);var _0x4235f2={'where':_0x303c32['where']};return db['WhatsappAccount'][_0x90c8('0x33')](_0x4235f2)[_0x90c8('0x25')](function(_0xf7cf0c){_0x20f495[_0x90c8('0x33')]=_0xf7cf0c;if(_0x2eb471[_0x90c8('0x44')][_0x90c8('0x52')]){_0x303c32[_0x90c8('0x53')]=[{'all':!![]}];}return db[_0x90c8('0x3f')]['findAll'](_0x303c32);})['then'](function(_0xd974fc){_0x20f495['rows']=_0xd974fc;return _0x20f495;})[_0x90c8('0x25')](respondWithFilteredResult(_0x53f043,_0x303c32))[_0x90c8('0x54')](handleError(_0x53f043,null));};exports[_0x90c8('0x55')]=function(_0x172e34,_0x4a92ee){var _0x4ff9b6={'raw':![],'where':{'id':_0x172e34[_0x90c8('0x56')]['id']},'include':[{'model':db[_0x90c8('0x3c')],'as':_0x90c8('0x3d')}]},_0x2c88e1={};_0x2c88e1['model']=_[_0x90c8('0x45')](db[_0x90c8('0x3f')][_0x90c8('0x57')]);_0x2c88e1[_0x90c8('0x44')]=_[_0x90c8('0x45')](_0x172e34[_0x90c8('0x44')]);_0x2c88e1['filters']=_[_0x90c8('0x58')](_0x2c88e1['model'],_0x2c88e1[_0x90c8('0x44')]);_0x4ff9b6[_0x90c8('0x47')]=_[_0x90c8('0x58')](_0x2c88e1[_0x90c8('0x43')],qs[_0x90c8('0x46')](_0x172e34['query'][_0x90c8('0x46')]));_0x4ff9b6[_0x90c8('0x47')]=_0x4ff9b6['attributes'][_0x90c8('0x59')]?_0x4ff9b6[_0x90c8('0x47')]:_0x2c88e1['model'];if(_0x172e34[_0x90c8('0x44')][_0x90c8('0x52')]){_0x4ff9b6[_0x90c8('0x53')]=[{'all':!![]}];}_0x4ff9b6=_[_0x90c8('0x50')]({},_0x4ff9b6,_0x172e34['options']);return db['WhatsappAccount']['find'](_0x4ff9b6)[_0x90c8('0x25')](handleEntityNotFound(_0x4a92ee,null))[_0x90c8('0x25')](respondWithResult(_0x4a92ee,null))[_0x90c8('0x54')](handleError(_0x4a92ee,null));};exports[_0x90c8('0x5a')]=function(_0x2ba35b,_0x2ec05d){return db[_0x90c8('0x3f')][_0x90c8('0x5a')](_0x2ba35b[_0x90c8('0x5b')],{})[_0x90c8('0x25')](function(_0x50bce3){var _0x16835e=_0x2ba35b[_0x90c8('0x5c')]['get']({'plain':!![]});if(!_0x16835e)throw new Error(_0x90c8('0x5d'));if(_0x16835e['role']===_0x90c8('0x5c')){var _0x2c7c60=_0x50bce3[_0x90c8('0x5e')]({'plain':!![]});var _0x4749d1=_0x90c8('0x39');return db[_0x90c8('0x5f')][_0x90c8('0x60')]({'where':{'name':_0x4749d1,'userProfileId':_0x16835e['userProfileId']},'raw':!![]})[_0x90c8('0x25')](function(_0x4a3b3b){if(_0x4a3b3b&&_0x4a3b3b[_0x90c8('0x61')]===0x0){return db[_0x90c8('0x62')][_0x90c8('0x5a')]({'name':_0x2c7c60[_0x90c8('0x3b')],'resourceId':_0x2c7c60['id'],'type':_0x4a3b3b['name'],'sectionId':_0x4a3b3b['id']},{})['then'](function(){return _0x50bce3;});}else{return _0x50bce3;}})[_0x90c8('0x54')](function(_0x46e8e7){logger[_0x90c8('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46e8e7);throw _0x46e8e7;});}return _0x50bce3;})[_0x90c8('0x25')](respondWithResult(_0x2ec05d,0xc9))[_0x90c8('0x54')](handleError(_0x2ec05d,null));};exports['update']=function(_0x1f7bb7,_0x2393bb){if(_0x1f7bb7[_0x90c8('0x5b')]['id']){delete _0x1f7bb7[_0x90c8('0x5b')]['id'];}return db[_0x90c8('0x3f')][_0x90c8('0x60')]({'where':{'id':_0x1f7bb7[_0x90c8('0x56')]['id']},'include':[{'model':db[_0x90c8('0x3c')],'as':_0x90c8('0x3d')}]})[_0x90c8('0x25')](handleEntityNotFound(_0x2393bb,null))[_0x90c8('0x25')](saveUpdates(_0x1f7bb7[_0x90c8('0x5b')],null))[_0x90c8('0x25')](respondWithResult(_0x2393bb,null))[_0x90c8('0x54')](handleError(_0x2393bb,null));};exports['destroy']=function(_0x107068,_0x4d4c86){return db['WhatsappAccount'][_0x90c8('0x60')]({'where':{'id':_0x107068[_0x90c8('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d4c86,null))[_0x90c8('0x25')](removeEntity(_0x4d4c86,null))[_0x90c8('0x54')](handleError(_0x4d4c86,null));};exports['describe']=function(_0x1ad7c0,_0x4ffd10){return db[_0x90c8('0x3f')]['describe']()['then'](respondWithResult(_0x4ffd10,null))[_0x90c8('0x54')](handleError(_0x4ffd10,null));};exports[_0x90c8('0x63')]=function(_0x124aa2,_0xcf54fe,_0x288c94){if(_0x124aa2[_0x90c8('0x5b')]['id']){delete _0x124aa2[_0x90c8('0x5b')]['id'];}return db[_0x90c8('0x3f')][_0x90c8('0x60')]({'where':{'id':_0x124aa2[_0x90c8('0x56')]['id']}})[_0x90c8('0x25')](handleEntityNotFound(_0xcf54fe,null))['then'](function(_0x4d495e){if(_0x4d495e){_0x124aa2[_0x90c8('0x5b')][_0x90c8('0x64')]=_0x4d495e['id'];return db['Disposition'][_0x90c8('0x5a')](_0x124aa2[_0x90c8('0x5b')]);}})[_0x90c8('0x25')](respondWithResult(_0xcf54fe,null))[_0x90c8('0x54')](handleError(_0xcf54fe,null));};exports[_0x90c8('0x65')]=function(_0x122359,_0x58eff5,_0x19e9cc){var _0x57c236={'raw':![],'where':{}};var _0x24ad22={};var _0x20bf5f={'count':0x0,'rows':[]};return db[_0x90c8('0x3f')][_0x90c8('0x66')]({'where':{'id':_0x122359[_0x90c8('0x56')]['id']}})['then'](handleEntityNotFound(_0x58eff5,null))['then'](function(_0x240bf1){if(_0x240bf1){_0x24ad22[_0x90c8('0x43')]=_[_0x90c8('0x45')](db[_0x90c8('0x67')][_0x90c8('0x57')]);_0x24ad22[_0x90c8('0x44')]=_[_0x90c8('0x45')](_0x122359[_0x90c8('0x44')]);_0x24ad22[_0x90c8('0x4b')]=_[_0x90c8('0x58')](_0x24ad22[_0x90c8('0x43')],_0x24ad22[_0x90c8('0x44')]);_0x57c236[_0x90c8('0x47')]=_[_0x90c8('0x58')](_0x24ad22[_0x90c8('0x43')],qs[_0x90c8('0x46')](_0x122359['query']['fields']));_0x57c236[_0x90c8('0x47')]=_0x57c236[_0x90c8('0x47')][_0x90c8('0x59')]?_0x57c236[_0x90c8('0x47')]:_0x24ad22[_0x90c8('0x43')];if(!_0x122359[_0x90c8('0x44')]['hasOwnProperty'](_0x90c8('0x48'))){_0x57c236[_0x90c8('0x32')]=qs[_0x90c8('0x32')](_0x122359['query'][_0x90c8('0x32')]);_0x57c236[_0x90c8('0x30')]=qs[_0x90c8('0x30')](_0x122359['query'][_0x90c8('0x30')]);}_0x57c236[_0x90c8('0x49')]=qs[_0x90c8('0x4a')](_0x122359['query'][_0x90c8('0x4a')]);_0x57c236[_0x90c8('0x4d')]=qs['filters'](_[_0x90c8('0x4c')](_0x122359[_0x90c8('0x44')],_0x24ad22['filters']));_0x57c236[_0x90c8('0x4d')][_0x90c8('0x64')]=_0x240bf1['id'];if(_0x122359[_0x90c8('0x44')][_0x90c8('0x4f')]){_0x57c236['where']=_[_0x90c8('0x50')](_0x57c236[_0x90c8('0x4d')],{'$or':_['map'](_0x57c236[_0x90c8('0x47')],function(_0x272c9d){var _0x35a101={};_0x35a101[_0x272c9d]={'$like':'%'+_0x122359[_0x90c8('0x44')][_0x90c8('0x4f')]+'%'};return _0x35a101;})});}_0x57c236=_[_0x90c8('0x50')]({},_0x57c236,_0x122359[_0x90c8('0x51')]);return db[_0x90c8('0x67')][_0x90c8('0x33')]({'where':_0x57c236['where']})[_0x90c8('0x25')](function(_0x3d40e1){_0x20bf5f[_0x90c8('0x33')]=_0x3d40e1;if(_0x122359[_0x90c8('0x44')][_0x90c8('0x52')]){_0x57c236[_0x90c8('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x90c8('0x68')](_0x57c236);})[_0x90c8('0x25')](function(_0x453cfd){_0x20bf5f['rows']=_0x453cfd;return _0x20bf5f;});}})[_0x90c8('0x25')](respondWithFilteredResult(_0x58eff5,_0x57c236))[_0x90c8('0x54')](handleError(_0x58eff5,null));};exports['removeDispositions']=function(_0x5b1511,_0x5dd264,_0x1253d4){return db[_0x90c8('0x3f')]['find']({'where':{'id':_0x5b1511[_0x90c8('0x56')]['id']}})[_0x90c8('0x25')](handleEntityNotFound(_0x5dd264,null))[_0x90c8('0x25')](function(_0x2ead41){if(_0x2ead41){return _0x2ead41['removeDispositions'](_0x5b1511[_0x90c8('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x5dd264,null))[_0x90c8('0x54')](handleError(_0x5dd264,null));};exports[_0x90c8('0x69')]=function(_0x16f9f9,_0x47c439,_0x1246bf){if(_0x16f9f9[_0x90c8('0x5b')]['id']){delete _0x16f9f9[_0x90c8('0x5b')]['id'];}return db[_0x90c8('0x3f')][_0x90c8('0x60')]({'where':{'id':_0x16f9f9['params']['id']}})[_0x90c8('0x25')](handleEntityNotFound(_0x47c439,null))['then'](function(_0x568bd7){if(_0x568bd7){_0x16f9f9['body'][_0x90c8('0x64')]=_0x568bd7['id'];return db[_0x90c8('0x6a')][_0x90c8('0x5a')](_0x16f9f9['body']);}})[_0x90c8('0x25')](respondWithResult(_0x47c439,null))['catch'](handleError(_0x47c439,null));};exports['getAnswers']=function(_0x184882,_0x4ea50e,_0x158e29){var _0x2ad199={'raw':![],'where':{}};var _0x5c3680={};var _0x445820={'count':0x0,'rows':[]};return db[_0x90c8('0x3f')][_0x90c8('0x66')]({'where':{'id':_0x184882['params']['id']}})[_0x90c8('0x25')](handleEntityNotFound(_0x4ea50e,null))[_0x90c8('0x25')](function(_0xd2aad){if(_0xd2aad){_0x5c3680[_0x90c8('0x43')]=_[_0x90c8('0x45')](db[_0x90c8('0x6a')]['rawAttributes']);_0x5c3680['query']=_[_0x90c8('0x45')](_0x184882['query']);_0x5c3680['filters']=_[_0x90c8('0x58')](_0x5c3680[_0x90c8('0x43')],_0x5c3680[_0x90c8('0x44')]);_0x2ad199['attributes']=_[_0x90c8('0x58')](_0x5c3680['model'],qs[_0x90c8('0x46')](_0x184882[_0x90c8('0x44')][_0x90c8('0x46')]));_0x2ad199['attributes']=_0x2ad199[_0x90c8('0x47')][_0x90c8('0x59')]?_0x2ad199['attributes']:_0x5c3680[_0x90c8('0x43')];if(!_0x184882['query'][_0x90c8('0x6b')](_0x90c8('0x48'))){_0x2ad199[_0x90c8('0x32')]=qs[_0x90c8('0x32')](_0x184882[_0x90c8('0x44')][_0x90c8('0x32')]);_0x2ad199['offset']=qs['offset'](_0x184882[_0x90c8('0x44')][_0x90c8('0x30')]);}_0x2ad199[_0x90c8('0x49')]=qs[_0x90c8('0x4a')](_0x184882[_0x90c8('0x44')][_0x90c8('0x4a')]);_0x2ad199[_0x90c8('0x4d')]=qs['filters'](_[_0x90c8('0x4c')](_0x184882['query'],_0x5c3680[_0x90c8('0x4b')]));_0x2ad199[_0x90c8('0x4d')][_0x90c8('0x64')]=_0xd2aad['id'];if(_0x184882[_0x90c8('0x44')][_0x90c8('0x4f')]){_0x2ad199['where']=_[_0x90c8('0x50')](_0x2ad199[_0x90c8('0x4d')],{'$or':_['map'](_0x2ad199[_0x90c8('0x47')],function(_0x477cd1){var _0x5dca08={};_0x5dca08[_0x477cd1]={'$like':'%'+_0x184882['query'][_0x90c8('0x4f')]+'%'};return _0x5dca08;})});}_0x2ad199=_[_0x90c8('0x50')]({},_0x2ad199,_0x184882[_0x90c8('0x51')]);return db[_0x90c8('0x6a')][_0x90c8('0x33')]({'where':_0x2ad199['where']})[_0x90c8('0x25')](function(_0x1a25a3){_0x445820[_0x90c8('0x33')]=_0x1a25a3;if(_0x184882['query'][_0x90c8('0x52')]){_0x2ad199[_0x90c8('0x53')]=[{'all':!![]}];}return db[_0x90c8('0x6a')][_0x90c8('0x68')](_0x2ad199);})['then'](function(_0x4a7405){_0x445820[_0x90c8('0x6c')]=_0x4a7405;return _0x445820;});}})[_0x90c8('0x25')](respondWithFilteredResult(_0x4ea50e,_0x2ad199))[_0x90c8('0x54')](handleError(_0x4ea50e,null));};exports[_0x90c8('0x6d')]=function(_0x463ba8,_0x30c923,_0xa15c3f){return db[_0x90c8('0x3f')][_0x90c8('0x60')]({'where':{'id':_0x463ba8[_0x90c8('0x56')]['id']}})[_0x90c8('0x25')](handleEntityNotFound(_0x30c923,null))['then'](function(_0x26f908){if(_0x26f908){return _0x26f908[_0x90c8('0x6d')](_0x463ba8[_0x90c8('0x44')][_0x90c8('0x6e')]);}})['then'](respondWithStatusCode(_0x30c923,null))[_0x90c8('0x54')](handleError(_0x30c923,null));};exports['addAgents']=function(_0x18def7,_0x4b9ffb,_0x16bcdd){return db['WhatsappAccount'][_0x90c8('0x60')]({'where':{'id':_0x18def7[_0x90c8('0x56')]['id']}})[_0x90c8('0x25')](handleEntityNotFound(_0x4b9ffb,null))['then'](function(_0x3888b2){if(_0x3888b2){return _0x3888b2['addAgents'](_0x18def7['body'][_0x90c8('0x6e')],_[_0x90c8('0x6f')](_0x18def7[_0x90c8('0x5b')],[_0x90c8('0x6e'),'id'])||{})[_0x90c8('0x70')](function(_0x3b6f28){for(var _0x25b0f3=0x0;_0x25b0f3<_0x18def7['body'][_0x90c8('0x6e')][_0x90c8('0x59')];_0x25b0f3+=0x1){socket['emit'](_0x90c8('0x71'),{'UserId':Number(_0x18def7[_0x90c8('0x5b')][_0x90c8('0x6e')][_0x25b0f3]),'WhatsappAccountId':Number(_0x18def7[_0x90c8('0x56')]['id'])});}return _0x3b6f28;});}})[_0x90c8('0x25')](respondWithResult(_0x4b9ffb,null))[_0x90c8('0x54')](handleError(_0x4b9ffb,null));};exports[_0x90c8('0x72')]=function(_0x3f0a6c,_0xf750c8,_0x20dadf){return db[_0x90c8('0x3f')][_0x90c8('0x60')]({'where':{'id':_0x3f0a6c[_0x90c8('0x56')]['id']}})['then'](handleEntityNotFound(_0xf750c8,null))[_0x90c8('0x25')](function(_0x4d0ef2){if(_0x4d0ef2){return _0x4d0ef2['removeAgents'](_0x3f0a6c['query'][_0x90c8('0x6e')])[_0x90c8('0x25')](function(){if(_['isArray'](_0x3f0a6c[_0x90c8('0x44')][_0x90c8('0x6e')])){for(var _0x2e196b=0x0;_0x2e196b<_0x3f0a6c[_0x90c8('0x44')][_0x90c8('0x6e')][_0x90c8('0x59')];_0x2e196b+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x3f0a6c[_0x90c8('0x44')][_0x90c8('0x6e')][_0x2e196b]),'WhatsappAccountId':Number(_0x3f0a6c['params']['id'])});}}else{socket['emit'](_0x90c8('0x73'),{'UserId':Number(_0x3f0a6c[_0x90c8('0x44')][_0x90c8('0x6e')]),'WhatsappAccountId':Number(_0x3f0a6c[_0x90c8('0x56')]['id'])});}});}})[_0x90c8('0x25')](respondWithStatusCode(_0xf750c8,null))[_0x90c8('0x54')](handleError(_0xf750c8,null));};exports[_0x90c8('0x74')]=function(_0x5305fe,_0x4dc74d,_0x5436c0){var _0x36c8ba={};var _0x31f803={};var _0x56a00d;var _0x1fda38;return db[_0x90c8('0x3f')][_0x90c8('0x66')]({'where':{'id':_0x5305fe[_0x90c8('0x56')]['id']}})['then'](handleEntityNotFound(_0x4dc74d,null))[_0x90c8('0x25')](function(_0x51e2a0){if(_0x51e2a0){_0x56a00d=_0x51e2a0;_0x31f803[_0x90c8('0x43')]=_['keys'](db[_0x90c8('0x75')][_0x90c8('0x57')]);_0x31f803[_0x90c8('0x44')]=_[_0x90c8('0x45')](_0x5305fe['query']);_0x31f803[_0x90c8('0x4b')]=_[_0x90c8('0x58')](_0x31f803[_0x90c8('0x43')],_0x31f803[_0x90c8('0x44')]);_0x36c8ba['attributes']=_['intersection'](_0x31f803[_0x90c8('0x43')],qs[_0x90c8('0x46')](_0x5305fe[_0x90c8('0x44')][_0x90c8('0x46')]));_0x36c8ba['attributes']=_0x36c8ba[_0x90c8('0x47')]['length']?_0x36c8ba[_0x90c8('0x47')]:_0x31f803['model'];_0x36c8ba[_0x90c8('0x49')]=qs['sort'](_0x5305fe['query'][_0x90c8('0x4a')]);_0x36c8ba['where']=qs[_0x90c8('0x4b')](_[_0x90c8('0x4c')](_0x5305fe[_0x90c8('0x44')],_0x31f803['filters']));if(_0x5305fe[_0x90c8('0x44')][_0x90c8('0x4f')]){_0x36c8ba[_0x90c8('0x4d')]=_[_0x90c8('0x50')](_0x36c8ba[_0x90c8('0x4d')],{'$or':_[_0x90c8('0x3e')](_0x36c8ba[_0x90c8('0x47')],function(_0x17fc62){var _0x2da1b3={};_0x2da1b3[_0x17fc62]={'$like':'%'+_0x5305fe[_0x90c8('0x44')][_0x90c8('0x4f')]+'%'};return _0x2da1b3;})});}_0x36c8ba=_['merge']({},_0x36c8ba,_0x5305fe[_0x90c8('0x51')]);return _0x56a00d[_0x90c8('0x74')](_0x36c8ba);}})['then'](function(_0x50f53d){if(_0x50f53d){_0x1fda38=_0x50f53d[_0x90c8('0x59')];if(!_0x5305fe['query']['hasOwnProperty'](_0x90c8('0x48'))){_0x36c8ba[_0x90c8('0x32')]=qs['limit'](_0x5305fe[_0x90c8('0x44')][_0x90c8('0x32')]);_0x36c8ba[_0x90c8('0x30')]=qs['offset'](_0x5305fe[_0x90c8('0x44')]['offset']);}return _0x56a00d['getAgents'](_0x36c8ba);}})[_0x90c8('0x25')](function(_0x149a79){if(_0x149a79){return _0x149a79?{'count':_0x1fda38,'rows':_0x149a79}:null;}})[_0x90c8('0x25')](respondWithResult(_0x4dc74d,null))[_0x90c8('0x54')](handleError(_0x4dc74d,null));};exports[_0x90c8('0x76')]=function(_0x26d310,_0x577949){var _0xcc020c=_0x26d310[_0x90c8('0x56')]['id'];var _0xd2b8cc=_0x26d310[_0x90c8('0x5b')];var _0x203377=0xc8;var _0x3b142d=null;return db[_0x90c8('0x77')][_0x90c8('0x78')]({'isolationLevel':db[_0x90c8('0x77')][_0x90c8('0x79')][_0x90c8('0x7a')][_0x90c8('0x7b')]},function(_0x5b82b1){return db[_0x90c8('0x3f')][_0x90c8('0x66')]({'where':{'id':_0xcc020c},'transaction':_0x5b82b1})[_0x90c8('0x25')](function(_0x191461){if(_0x191461){return db[_0x90c8('0x7c')][_0x90c8('0x38')]({'where':{'WhatsappAccountId':_0xcc020c},'transaction':_0x5b82b1})['then'](function(){var _0x89a8e2=_['map'](_0xd2b8cc,function(_0x5267cd){_0x5267cd['WhatsappAccountId']=_0xcc020c;return _0x5267cd;});return db[_0x90c8('0x7c')]['bulkCreate'](_0x89a8e2,{'transaction':_0x5b82b1});});}else{_0x203377=0x194;_0x3b142d=[];}});})[_0x90c8('0x25')](function(){if(_0x203377!==0x194){return db[_0x90c8('0x7c')][_0x90c8('0x7d')]({'where':{'WhatsappAccountId':_0xcc020c},'order':'priority'})[_0x90c8('0x25')](function(_0x490c8a){_0x3b142d=_0x490c8a;});}})[_0x90c8('0x54')](function(_0x26b911){_0x203377=0x1f4;logger[_0x90c8('0x29')](_0x26b911[_0x90c8('0x3a')]);if(_0x26b911['name']){delete _0x26b911[_0x90c8('0x3b')];}_0x3b142d=_0x26b911;})[_0x90c8('0x7e')](function(){if(_0x3b142d===null){_0x577949[_0x90c8('0x2c')](_0x203377);}else{if(_0x203377===0x1f4){_0x577949[_0x90c8('0x2e')](_0x203377)[_0x90c8('0x7f')](_0x3b142d);}else{_0x577949[_0x90c8('0x2e')](_0x203377)[_0x90c8('0x2f')](_0x3b142d);}}});};exports[_0x90c8('0x80')]=function(_0x2ff637,_0x25582f,_0x1a3242){var _0x3dad48={};var _0x4c8989={};var _0xf98af9;var _0x20f776;return db[_0x90c8('0x3f')][_0x90c8('0x66')]({'where':{'id':_0x2ff637['params']['id']}})[_0x90c8('0x25')](handleEntityNotFound(_0x25582f,null))[_0x90c8('0x25')](function(_0x4ce541){if(_0x4ce541){_0xf98af9=_0x4ce541;_0x4c8989[_0x90c8('0x43')]=_[_0x90c8('0x45')](db['WhatsappApplication']['rawAttributes']);_0x4c8989[_0x90c8('0x44')]=_[_0x90c8('0x45')](_0x2ff637['query']);_0x4c8989[_0x90c8('0x4b')]=_[_0x90c8('0x58')](_0x4c8989[_0x90c8('0x43')],_0x4c8989[_0x90c8('0x44')]);_0x3dad48[_0x90c8('0x47')]=_[_0x90c8('0x58')](_0x4c8989[_0x90c8('0x43')],qs['fields'](_0x2ff637['query']['fields']));_0x3dad48[_0x90c8('0x47')]=_0x3dad48[_0x90c8('0x47')][_0x90c8('0x59')]?_0x3dad48[_0x90c8('0x47')]:_0x4c8989[_0x90c8('0x43')];_0x3dad48[_0x90c8('0x49')]=qs['sort'](_0x2ff637[_0x90c8('0x44')]['sort']);_0x3dad48[_0x90c8('0x4d')]=qs[_0x90c8('0x4b')](_[_0x90c8('0x4c')](_0x2ff637['query'],_0x4c8989['filters']));if(_0x2ff637[_0x90c8('0x44')][_0x90c8('0x4f')]){_0x3dad48[_0x90c8('0x4d')]=_[_0x90c8('0x50')](_0x3dad48[_0x90c8('0x4d')],{'$or':_[_0x90c8('0x3e')](_0x3dad48['attributes'],function(_0x3a9f40){var _0x16d539={};_0x16d539[_0x3a9f40]={'$like':'%'+_0x2ff637[_0x90c8('0x44')][_0x90c8('0x4f')]+'%'};return _0x16d539;})});}_0x3dad48=_[_0x90c8('0x50')]({},_0x3dad48,_0x2ff637[_0x90c8('0x51')]);return _0xf98af9[_0x90c8('0x80')](_0x3dad48);}})[_0x90c8('0x25')](function(_0x228a8c){if(_0x228a8c){_0x20f776=_0x228a8c['length'];if(!_0x2ff637[_0x90c8('0x44')]['hasOwnProperty'](_0x90c8('0x48'))){_0x3dad48['limit']=qs['limit'](_0x2ff637[_0x90c8('0x44')][_0x90c8('0x32')]);_0x3dad48['offset']=qs['offset'](_0x2ff637[_0x90c8('0x44')]['offset']);}return _0xf98af9[_0x90c8('0x80')](_0x3dad48);}})[_0x90c8('0x25')](function(_0x4171b1){if(_0x4171b1){return _0x4171b1?{'count':_0x20f776,'rows':_0x4171b1}:null;}})[_0x90c8('0x25')](respondWithResult(_0x25582f,null))[_0x90c8('0x54')](handleError(_0x25582f,null));};exports['notify']=function(_0x179a34,_0x5f3fe9,_0x2f0d97){var _0x562ba8={'channel':_0x90c8('0x81')};var _0x434777=[];var _0x1f6a98=[];var _0x23ec9b={};return db[_0x90c8('0x3f')][_0x90c8('0x60')]({'where':{'id':_0x179a34['params']['id']},'include':[{'model':db[_0x90c8('0x7c')],'as':_0x90c8('0x82')}]})[_0x90c8('0x25')](handleEntityNotFound(_0x5f3fe9,null))['then'](function(_0xacc79e){_0x562ba8[_0x90c8('0x83')]=_0xacc79e;if(_0x562ba8['account']&&_0x562ba8[_0x90c8('0x83')][_0x90c8('0x41')]===_0x90c8('0x84')&&_0x179a34[_0x90c8('0x5b')][_0x90c8('0x85')]){if(_0x179a34[_0x90c8('0x5b')][_0x90c8('0x85')][_0x90c8('0x59')]===0x0)return;if(_0x179a34[_0x90c8('0x5b')]['statuses'][0x0][_0x90c8('0x86')]!==_0x90c8('0x87'))return;return db[_0x90c8('0x88')][_0x90c8('0x89')]({'read':!![],'readAt':_0x179a34['body'][_0x90c8('0x85')][0x0][_0x90c8('0x8a')]},{'where':{'messageId':_0x179a34[_0x90c8('0x5b')][_0x90c8('0x85')][0x0][_0x90c8('0x8b')]},'individualHooks':!![]})['then'](function(_0x14833f){return _0x5f3fe9[_0x90c8('0x2e')](0xc8)[_0x90c8('0x2f')](_0x14833f);});}_0x562ba8[_0x90c8('0x8c')]=_[_0x90c8('0x8d')](_0xacc79e[_0x90c8('0x82')],[_0x90c8('0x8e')],[_0x90c8('0x8f')]);if(_0x562ba8[_0x90c8('0x83')][_0x90c8('0x82')]){delete _0x562ba8[_0x90c8('0x83')]['Applications'];}return db['CmContact']['describe']()[_0x90c8('0x25')](function(_0x4941e6){if(!_0x4941e6){throw new db['Sequelize'][(_0x90c8('0x90'))](_0x90c8('0x91'));}_0x434777=_['difference'](_[_0x90c8('0x45')](_0x4941e6),['createdAt',_0x90c8('0x92')]);_0x1f6a98=_[_0x90c8('0x93')](_[_0x90c8('0x45')](_0x4941e6),['createdAt','updatedAt',_0x90c8('0x94'),_0x90c8('0x95')]);_0x562ba8[_0x90c8('0x5b')]={'mapKey':_0x90c8('0x96')};if(_0x562ba8[_0x90c8('0x83')]&&_0x562ba8[_0x90c8('0x83')][_0x90c8('0x41')]===_0x90c8('0x97')){_0x562ba8[_0x90c8('0x5b')][_0x90c8('0x98')]=_0x179a34[_0x90c8('0x5b')]['From'][_0x90c8('0x99')](_0x90c8('0x9a'),'');_0x562ba8[_0x90c8('0x5b')]['body']=_0x179a34[_0x90c8('0x5b')]['Body'];_0x562ba8['body'][_0x90c8('0x9b')]=_0x179a34[_0x90c8('0x5b')][_0x90c8('0x9c')];}if(_0x562ba8[_0x90c8('0x83')]&&_0x562ba8[_0x90c8('0x83')][_0x90c8('0x41')]===_0x90c8('0x84')){_0x562ba8[_0x90c8('0x5b')][_0x90c8('0x98')]=_0x179a34[_0x90c8('0x5b')][_0x90c8('0x9d')][0x0]['from'];_0x562ba8['body'][_0x90c8('0x5b')]=_0x179a34[_0x90c8('0x5b')][_0x90c8('0x9d')][0x0][_0x90c8('0x2a')][_0x90c8('0x5b')];_0x562ba8[_0x90c8('0x5b')][_0x90c8('0x9b')]=_0x179a34[_0x90c8('0x5b')][_0x90c8('0x9d')][0x0][_0x90c8('0x8b')];}if(_0x562ba8[_0x90c8('0x5b')]['id']){delete _0x562ba8[_0x90c8('0x5b')]['id'];}if(_[_0x90c8('0x9e')](_0x562ba8[_0x90c8('0x5b')][_0x90c8('0x98')])){throw new db[(_0x90c8('0x9f'))][(_0x90c8('0x90'))](_0x90c8('0xa0'));}if(_[_0x90c8('0x9e')](_0x562ba8[_0x90c8('0x5b')][_0x90c8('0x5b')])||_0x562ba8[_0x90c8('0x5b')]['body']===''){throw new db['Sequelize'][(_0x90c8('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x90c8('0x9e')](_0x562ba8[_0x90c8('0x5b')][_0x90c8('0xa1')])){throw new db[(_0x90c8('0x9f'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f6a98);}if(!_[_0x90c8('0xa2')](_0x1f6a98,_0x562ba8['body'][_0x90c8('0xa1')])){throw new db[(_0x90c8('0x9f'))]['ValidationError'](_0x90c8('0xa3')+_0x1f6a98);}_0x23ec9b[_0x562ba8[_0x90c8('0x5b')]['mapKey']]=_0x562ba8[_0x90c8('0x5b')]['from'];return db[_0x90c8('0xa4')][_0x90c8('0x60')]({'where':{'id':_0x562ba8['account'][_0x90c8('0x95')]},'include':[{'model':db['CmContact'],'as':_0x90c8('0xa5'),'where':_0x23ec9b,'limit':0x1,'order':[[_0x90c8('0x92'),'DESC']]}]});})['then'](handleEntityNotFound(_0x5f3fe9,null))[_0x90c8('0x25')](function(_0x3fcb38){if(_0x3fcb38){_0x562ba8['list']=_[_0x90c8('0x6f')](_0x3fcb38,['Contacts']);if(_0x3fcb38[_0x90c8('0xa5')][_0x90c8('0x59')]){return _0x3fcb38['Contacts'][0x0];}var _0x42d5fe=_[_0x90c8('0x1c')](_0x562ba8[_0x90c8('0x5b')],{'firstName':_0x562ba8[_0x90c8('0x5b')][_0x90c8('0x98')],'ListId':_0x3fcb38['id']});_0x42d5fe[_0x562ba8[_0x90c8('0x5b')][_0x90c8('0xa1')]]=_0x562ba8[_0x90c8('0x5b')][_0x90c8('0x98')];return db[_0x90c8('0xa6')][_0x90c8('0x5a')](_0x42d5fe,{'fields':_0x434777,'raw':!![]});}})['then'](handleEntityNotFound(_0x5f3fe9,null))['then'](function(_0x2657d2){if(_0x2657d2){_0x562ba8['contact']=_0x2657d2;var _0x487069={'ContactId':_0x2657d2['id'],'phone':_0x562ba8[_0x90c8('0x5b')]['from'],'WhatsappAccountId':_0x179a34['params']['id']};var _0x255d70={'ContactId':_0x2657d2['id'],'WhatsappAccountId':_0x179a34[_0x90c8('0x56')]['id'],'closed':![]};return db[_0x90c8('0xa7')][_0x90c8('0x60')]({'where':_0x255d70})[_0x90c8('0x25')](function(_0x6d237b){if(_0x6d237b){return[_0x6d237b,![]];}return db['WhatsappInteraction'][_0x90c8('0x5a')](_0x487069)[_0x90c8('0x25')](function(_0x2819d5){return[_0x2819d5,!![]];});});}})['spread'](function(_0x5a344e,_0x5aeaae){_0x562ba8[_0x90c8('0xa8')]=_0x5a344e['get']({'plain':!![]});_0x562ba8[_0x90c8('0xa8')][_0x90c8('0xa9')]=![];if(_0x5aeaae){if(_0x562ba8[_0x90c8('0x83')][_0x90c8('0xaa')]){_0x562ba8[_0x90c8('0x8c')]['push']({'id':0x0,'priority':_0x562ba8[_0x90c8('0x8c')][_0x90c8('0x59')]+0x1,'app':'close','appdata':_0x90c8('0xab'),'interval':_0x90c8('0xac')});}_0x562ba8[_0x90c8('0xa8')]['created']=!![];}return db[_0x90c8('0x88')][_0x90c8('0x5a')]({'phone':_0x562ba8[_0x90c8('0x5b')][_0x90c8('0x98')],'messageId':_0x562ba8[_0x90c8('0x5b')][_0x90c8('0x9b')],'body':_0x562ba8[_0x90c8('0x5b')][_0x90c8('0x5b')],'WhatsappAccountId':_0x179a34[_0x90c8('0x56')]['id'],'WhatsappInteractionId':_0x5a344e['id'],'direction':'in','ContactId':_0x5a344e[_0x90c8('0xad')],'AttachmentId':_0x562ba8[_0x90c8('0x5b')]['AttachmentId']});})['then'](function(_0xbb57c8){_0x562ba8[_0x90c8('0x2a')]=_0xbb57c8;if(_0x562ba8[_0x90c8('0xa8')][_0x90c8('0xae')]){return db[_0x90c8('0x75')][_0x90c8('0x60')]({'attributes':['id',_0x90c8('0x3b')],'where':{'id':_0x562ba8[_0x90c8('0xa8')][_0x90c8('0xae')]}})[_0x90c8('0x25')](function(_0x290603){if(_0x290603){_0x562ba8[_0x90c8('0x8c')][_0x90c8('0xaf')]({'id':0x0,'priority':0x0,'app':_0x90c8('0xb0'),'appdata':_0x290603['name']+','+(_0x562ba8['account'][_0x90c8('0xb1')]||0xa),'interval':_0x90c8('0xac')});}return respondWithRpcPromise('Start',_0x90c8('0xb2'),_0x562ba8);});}return respondWithRpcPromise(_0x90c8('0xb3'),_0x90c8('0xb2'),_0x562ba8);})['then'](function(_0x1a3116){if(_0x1a3116){var _0x2703dc=0xc8;var _0x3f30af=_0x90c8('0xb4');logger[_0x90c8('0x2b')](_0x90c8('0xb5'),_0x3f30af,_0x2703dc,_0x90c8('0xb6'));logger[_0x90c8('0x27')](_0x90c8('0xb7'),_0x3f30af,_0x2703dc,'entity\x20found',JSON[_0x90c8('0xb8')](_0x1a3116));if(_0x562ba8[_0x90c8('0x83')][_0x90c8('0x41')]==='twilio'){return _0x5f3fe9['status'](_0x2703dc)[_0x90c8('0x34')](_0x90c8('0xb9'),_0x90c8('0xba'))['send'](_0x90c8('0xbb'));}else{return _0x5f3fe9[_0x90c8('0x2e')](_0x2703dc)['json'](_0x1a3116);}}});})[_0x90c8('0x54')](handleError(_0x5f3fe9,null));};exports[_0x90c8('0x7f')]=function(_0x26b002,_0x354327,_0x15c40c){var _0x401589,_0x5729ed,_0x2d0428;if(_[_0x90c8('0x9e')](_0x26b002[_0x90c8('0x5b')][_0x90c8('0x5b')])||_0x26b002[_0x90c8('0x5b')][_0x90c8('0x5b')]===''){throw new db[(_0x90c8('0x9f'))][(_0x90c8('0x90'))](_0x90c8('0xbc'));}if(_[_0x90c8('0x9e')](_0x26b002['body']['to'])){throw new db[(_0x90c8('0x9f'))][(_0x90c8('0x90'))](_0x90c8('0xbd'));}_0x401589=_0x26b002[_0x90c8('0x5b')]['to'];return db[_0x90c8('0x3f')][_0x90c8('0x60')]({'where':{'id':_0x26b002[_0x90c8('0x56')]['id']},'include':[{'model':db[_0x90c8('0xa4')],'as':_0x90c8('0xbe'),'include':[{'model':db['CmContact'],'as':_0x90c8('0xa5'),'where':{'mobile':_0x401589},'limit':0x1,'order':[[_0x90c8('0x92'),_0x90c8('0xbf')]]}]}]})['then'](handleEntityNotFound(_0x354327,null))[_0x90c8('0x25')](function(_0x3db569){if(_0x3db569&&_0x3db569[_0x90c8('0xbe')]){_0x5729ed=_0x3db569[_0x90c8('0x5e')]({'plain':!![]});if(_0x5729ed[_0x90c8('0xbe')]&&_0x5729ed[_0x90c8('0xbe')]['Contacts'][_0x90c8('0x59')]){return _0x5729ed[_0x90c8('0xbe')][_0x90c8('0xa5')][0x0];}return db[_0x90c8('0xa6')]['create'](_[_0x90c8('0x1c')](_0x26b002['body'],{'firstName':_0x401589,'mobile':_0x401589,'phone':_0x401589,'ListId':_0x5729ed[_0x90c8('0x95')]}));}})['then'](handleEntityNotFound(_0x354327,null))['then'](function(_0x35a036){if(_0x35a036){_0x2d0428=_0x35a036;return db[_0x90c8('0xa7')]['find']({'where':{'ContactId':_0x2d0428['id'],'closed':![],'WhatsappAccountId':_0x5729ed['id']}})[_0x90c8('0x25')](function(_0x2856d4){if(_0x2856d4){return[_0x2856d4,![]];}return db[_0x90c8('0xa7')][_0x90c8('0x5a')]({'UserId':_0x26b002['user']['id'],'ContactId':_0x2d0428['id'],'WhatsappAccountId':_0x5729ed['id'],'phone':_0x401589,'firstMsgDirection':_0x90c8('0xc0'),'Messages':[_['merge'](_0x26b002[_0x90c8('0x5b')],{'read':![],'body':_0x26b002['body']['body'],'phone':_0x401589,'WhatsappAccountId':_0x5729ed['id'],'UserId':_0x26b002[_0x90c8('0x5c')]['id'],'ContactId':_0x2d0428['id']})]},{'include':[{'model':db[_0x90c8('0x88')],'as':_0x90c8('0xc1')}]})[_0x90c8('0x25')](function(_0x11bf41){return[_0x11bf41,!![]];});});}})[_0x90c8('0x70')](function(_0x3ae82a,_0xd67f23){if(_0xd67f23){return _0x3ae82a;}return db[_0x90c8('0x88')]['create'](_[_0x90c8('0x50')](_0x26b002['body'],{'read':![],'body':_0x26b002[_0x90c8('0x5b')][_0x90c8('0x5b')],'phone':_0x401589,'WhatsappAccountId':_0x5729ed['id'],'WhatsappInteractionId':_0x3ae82a['id'],'UserId':_0x26b002[_0x90c8('0x5c')]['id'],'ContactId':_0x2d0428['id']}))[_0x90c8('0x25')](function(_0x3eec19){_0x3ae82a[_0x90c8('0xc2')][_0x90c8('0xc1')]=[];_0x3ae82a[_0x90c8('0xc2')][_0x90c8('0xc1')][_0x90c8('0xc3')](_0x3eec19['dataValues']);return _0x3ae82a;});})[_0x90c8('0x25')](respondWithResult(_0x354327,null))['catch'](handleError(_0x354327,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index d70e752..2db5d75 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 _0xb79c=['hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x23b040,_0x2808e5){var _0x28164e=function(_0x2d4d2f){while(--_0x2d4d2f){_0x23b040['push'](_0x23b040['shift']());}};_0x28164e(++_0x2808e5);}(_0xb79c,0x157));var _0xcb79=function(_0x5c8590,_0x46ac8d){_0x5c8590=_0x5c8590-0x0;var _0x6ee069=_0xb79c[_0x5c8590];return _0x6ee069;};'use strict';var EventEmitter=require(_0xcb79('0x0'));var WhatsappAccount=require(_0xcb79('0x1'))['db'][_0xcb79('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xcb79('0x3')](0x0);var events={'afterCreate':_0xcb79('0x4'),'afterUpdate':_0xcb79('0x5'),'afterDestroy':'remove'};function emitEvent(_0x21b332){return function(_0x3d2086,_0x23f549,_0x3a952a){WhatsappAccountEvents['emit'](_0x21b332+':'+_0x3d2086['id'],_0x3d2086);WhatsappAccountEvents[_0xcb79('0x6')](_0x21b332,_0x3d2086);_0x3a952a(null);};}for(var e in events){if(events[_0xcb79('0x7')](e)){var event=events[e];WhatsappAccount[_0xcb79('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xe4dd=['exports','events','WhatsappAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x1342cf,_0x33fa6b){var _0x11c8a5=function(_0x391c11){while(--_0x391c11){_0x1342cf['push'](_0x1342cf['shift']());}};_0x11c8a5(++_0x33fa6b);}(_0xe4dd,0x121));var _0xde4d=function(_0x37a9d7,_0x2b6fde){_0x37a9d7=_0x37a9d7-0x0;var _0x1343d3=_0xe4dd[_0x37a9d7];return _0x1343d3;};'use strict';var EventEmitter=require(_0xde4d('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xde4d('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xde4d('0x2')](0x0);var events={'afterCreate':_0xde4d('0x3'),'afterUpdate':_0xde4d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1cc291){return function(_0x40506b,_0x110aaa,_0x419103){WhatsappAccountEvents[_0xde4d('0x5')](_0x1cc291+':'+_0x40506b['id'],_0x40506b);WhatsappAccountEvents[_0xde4d('0x5')](_0x1cc291,_0x40506b);_0x419103(null);};}for(var e in events){if(events[_0xde4d('0x6')](e)){var event=events[e];WhatsappAccount[_0xde4d('0x7')](e,emitEvent(event));}}module[_0xde4d('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index f289b8e..97de9d6 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 _0xb10c=['bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappAccount','whatsapp_accounts','util','../../config/logger','api'];(function(_0x535a31,_0x13ed3c){var _0x499f20=function(_0x212809){while(--_0x212809){_0x535a31['push'](_0x535a31['shift']());}};_0x499f20(++_0x13ed3c);}(_0xb10c,0xef));var _0xcb10=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xb10c[_0x75f869];return _0x10af8b;};'use strict';var _=require('lodash');var util=require(_0xcb10('0x0'));var logger=require(_0xcb10('0x1'))(_0xcb10('0x2'));var moment=require('moment');var BPromise=require(_0xcb10('0x3'));var rp=require(_0xcb10('0x4'));var fs=require('fs');var path=require(_0xcb10('0x5'));var rimraf=require(_0xcb10('0x6'));var config=require(_0xcb10('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0xcb10('0x8')]=function(_0x84da10,_0x13c624){return _0x84da10['define'](_0xcb10('0x9'),attributes,{'tableName':_0xcb10('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x497d=['rimraf','../../config/environment','define','WhatsappAccount','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x382217,_0x17fc58){var _0x56e4a9=function(_0x548947){while(--_0x548947){_0x382217['push'](_0x382217['shift']());}};_0x56e4a9(++_0x17fc58);}(_0x497d,0x1b1));var _0xd497=function(_0x1df14f,_0x3027fd){_0x1df14f=_0x1df14f-0x0;var _0x4c7904=_0x497d[_0x1df14f];return _0x4c7904;};'use strict';var _=require(_0xd497('0x0'));var util=require(_0xd497('0x1'));var logger=require(_0xd497('0x2'))(_0xd497('0x3'));var moment=require(_0xd497('0x4'));var BPromise=require(_0xd497('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd497('0x6'));var rimraf=require(_0xd497('0x7'));var config=require(_0xd497('0x8'));var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x12109e,_0x23c3c9){return _0x12109e[_0xd497('0x9')](_0xd497('0xa'),attributes,{'tableName':'whatsapp_accounts','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 a40d5ed..a632c85 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 _0x1ec4=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','model','map','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x1ec4,0xb9));var _0x41ec=function(_0x487bf4,_0x3e2115){_0x487bf4=_0x487bf4-0x0;var _0x5def57=_0x1ec4[_0x487bf4];return _0x5def57;};'use strict';var _=require('lodash');var util=require(_0x41ec('0x0'));var moment=require(_0x41ec('0x1'));var BPromise=require(_0x41ec('0x2'));var rs=require(_0x41ec('0x3'));var fs=require('fs');var Redis=require(_0x41ec('0x4'));var db=require(_0x41ec('0x5'))['db'];var utils=require(_0x41ec('0x6'));var logger=require(_0x41ec('0x7'))(_0x41ec('0x8'));var config=require(_0x41ec('0x9'));var jayson=require(_0x41ec('0xa'));var client=jayson[_0x41ec('0xb')][_0x41ec('0xc')]({'port':0x232a});config[_0x41ec('0xd')]=_[_0x41ec('0xe')](config[_0x41ec('0xd')],{'host':_0x41ec('0xf'),'port':0x18eb});var socket=require(_0x41ec('0x10'))(new Redis(config[_0x41ec('0xd')]));require(_0x41ec('0x11'))['register'](socket);function respondWithRpcPromise(_0x19ddad,_0x428910,_0x585910){return new BPromise(function(_0x411779,_0x2d9d51){return client['request'](_0x19ddad,_0x585910)[_0x41ec('0x12')](function(_0x136609){logger[_0x41ec('0x13')](_0x41ec('0x14'),_0x428910,'request\x20sent');logger[_0x41ec('0x15')](_0x41ec('0x16'),_0x428910,_0x41ec('0x17'),JSON[_0x41ec('0x18')](_0x136609));if(_0x136609[_0x41ec('0x19')]){if(_0x136609[_0x41ec('0x19')]['code']===0x1f4){logger[_0x41ec('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x428910,_0x136609[_0x41ec('0x19')][_0x41ec('0x1a')]);return _0x2d9d51(_0x136609[_0x41ec('0x19')]['message']);}logger['error'](_0x41ec('0x14'),_0x428910,_0x136609[_0x41ec('0x19')]['message']);return _0x411779(_0x136609[_0x41ec('0x19')][_0x41ec('0x1a')]);}else{logger[_0x41ec('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x428910,_0x41ec('0x17'));_0x411779(_0x136609[_0x41ec('0x1b')][_0x41ec('0x1a')]);}})[_0x41ec('0x1c')](function(_0x21e4fc){logger['error'](_0x41ec('0x14'),_0x428910,_0x21e4fc);_0x2d9d51(_0x21e4fc);});});}exports[_0x41ec('0x1d')]=function(_0x4120a7){var _0x23c19b=this;return new Promise(function(_0x385bcd,_0x11d4e3){return db[_0x41ec('0x1e')][_0x41ec('0x1f')]({'raw':_0x4120a7[_0x41ec('0x20')]?_0x4120a7['options'][_0x41ec('0x21')]===undefined?!![]:![]:!![],'where':_0x4120a7[_0x41ec('0x20')]?_0x4120a7['options'][_0x41ec('0x22')]||null:null,'attributes':_0x4120a7[_0x41ec('0x20')]?_0x4120a7[_0x41ec('0x20')][_0x41ec('0x23')]||null:null,'include':_0x4120a7['options']?_0x4120a7[_0x41ec('0x20')][_0x41ec('0x24')]?_['map'](_0x4120a7[_0x41ec('0x20')][_0x41ec('0x24')],function(_0x27dd9c){return{'model':db[_0x27dd9c[_0x41ec('0x25')]],'as':_0x27dd9c['as'],'attributes':_0x27dd9c[_0x41ec('0x23')],'include':_0x27dd9c[_0x41ec('0x24')]?_[_0x41ec('0x26')](_0x27dd9c[_0x41ec('0x24')],function(_0xa1b404){return{'model':db[_0xa1b404[_0x41ec('0x25')]],'as':_0xa1b404['as'],'attributes':_0xa1b404['attributes'],'include':_0xa1b404[_0x41ec('0x24')]?_[_0x41ec('0x26')](_0xa1b404[_0x41ec('0x24')],function(_0xf6211e){return{'model':db[_0xf6211e[_0x41ec('0x25')]],'as':_0xf6211e['as'],'attributes':_0xf6211e['attributes']};}):[]};}):[]};}):[]:[]})[_0x41ec('0x12')](function(_0x36dc9e){logger[_0x41ec('0x13')](_0x41ec('0x1d'),_0x4120a7);logger[_0x41ec('0x15')](_0x41ec('0x1d'),_0x4120a7,JSON[_0x41ec('0x18')](_0x36dc9e));_0x385bcd(_0x36dc9e);})['catch'](function(_0x47712d){logger[_0x41ec('0x19')](_0x41ec('0x1d'),_0x47712d['message'],_0x4120a7);_0x11d4e3(_0x23c19b[_0x41ec('0x19')](0x1f4,_0x47712d[_0x41ec('0x1a')]));});});}; \ No newline at end of file +var _0xd0ce=['../../mysqldb','../../config/utils','../../config/logger','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','ShowWhatsappAccount','find','options','include','map','model','attributes','debug','util','moment','bluebird','randomstring','ioredis'];(function(_0x11ee3c,_0x51803c){var _0x10488e=function(_0x2e1eed){while(--_0x2e1eed){_0x11ee3c['push'](_0x11ee3c['shift']());}};_0x10488e(++_0x51803c);}(_0xd0ce,0x166));var _0xed0c=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0xd0ce[_0x3932eb];return _0x5316e5;};'use strict';var _=require('lodash');var util=require(_0xed0c('0x0'));var moment=require(_0xed0c('0x1'));var BPromise=require(_0xed0c('0x2'));var rs=require(_0xed0c('0x3'));var fs=require('fs');var Redis=require(_0xed0c('0x4'));var db=require(_0xed0c('0x5'))['db'];var utils=require(_0xed0c('0x6'));var logger=require(_0xed0c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xed0c('0x8')][_0xed0c('0x9')]({'port':0x232a});config['redis']=_[_0xed0c('0xa')](config[_0xed0c('0xb')],{'host':_0xed0c('0xc'),'port':0x18eb});var socket=require(_0xed0c('0xd'))(new Redis(config[_0xed0c('0xb')]));require('./whatsappAccount.socket')[_0xed0c('0xe')](socket);function respondWithRpcPromise(_0x675dac,_0x50a151,_0x1d7291){return new BPromise(function(_0x1db44a,_0x465e9a){return client['request'](_0x675dac,_0x1d7291)[_0xed0c('0xf')](function(_0x8654f2){logger[_0xed0c('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x50a151,_0xed0c('0x11'));logger['debug'](_0xed0c('0x12'),_0x50a151,_0xed0c('0x11'),JSON[_0xed0c('0x13')](_0x8654f2));if(_0x8654f2[_0xed0c('0x14')]){if(_0x8654f2[_0xed0c('0x14')][_0xed0c('0x15')]===0x1f4){logger[_0xed0c('0x14')](_0xed0c('0x16'),_0x50a151,_0x8654f2[_0xed0c('0x14')][_0xed0c('0x17')]);return _0x465e9a(_0x8654f2['error']['message']);}logger[_0xed0c('0x14')](_0xed0c('0x16'),_0x50a151,_0x8654f2[_0xed0c('0x14')]['message']);return _0x1db44a(_0x8654f2[_0xed0c('0x14')]['message']);}else{logger[_0xed0c('0x10')](_0xed0c('0x16'),_0x50a151,_0xed0c('0x11'));_0x1db44a(_0x8654f2['result'][_0xed0c('0x17')]);}})[_0xed0c('0x18')](function(_0x406263){logger[_0xed0c('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x50a151,_0x406263);_0x465e9a(_0x406263);});});}exports[_0xed0c('0x19')]=function(_0x204827){var _0x44fe40=this;return new Promise(function(_0x183319,_0x3fc13d){return db['WhatsappAccount'][_0xed0c('0x1a')]({'raw':_0x204827[_0xed0c('0x1b')]?_0x204827['options']['raw']===undefined?!![]:![]:!![],'where':_0x204827[_0xed0c('0x1b')]?_0x204827['options']['where']||null:null,'attributes':_0x204827['options']?_0x204827[_0xed0c('0x1b')]['attributes']||null:null,'include':_0x204827[_0xed0c('0x1b')]?_0x204827[_0xed0c('0x1b')][_0xed0c('0x1c')]?_[_0xed0c('0x1d')](_0x204827[_0xed0c('0x1b')][_0xed0c('0x1c')],function(_0x2d8f23){return{'model':db[_0x2d8f23[_0xed0c('0x1e')]],'as':_0x2d8f23['as'],'attributes':_0x2d8f23[_0xed0c('0x1f')],'include':_0x2d8f23[_0xed0c('0x1c')]?_['map'](_0x2d8f23[_0xed0c('0x1c')],function(_0x5379bf){return{'model':db[_0x5379bf[_0xed0c('0x1e')]],'as':_0x5379bf['as'],'attributes':_0x5379bf[_0xed0c('0x1f')],'include':_0x5379bf['include']?_[_0xed0c('0x1d')](_0x5379bf['include'],function(_0x4e0011){return{'model':db[_0x4e0011[_0xed0c('0x1e')]],'as':_0x4e0011['as'],'attributes':_0x4e0011[_0xed0c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xed0c('0xf')](function(_0x142156){logger[_0xed0c('0x10')](_0xed0c('0x19'),_0x204827);logger[_0xed0c('0x20')](_0xed0c('0x19'),_0x204827,JSON['stringify'](_0x142156));_0x183319(_0x142156);})[_0xed0c('0x18')](function(_0x95b535){logger[_0xed0c('0x14')](_0xed0c('0x19'),_0x95b535[_0xed0c('0x17')],_0x204827);_0x3fc13d(_0x44fe40[_0xed0c('0x14')](0x1f4,_0x95b535['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index fa8f187..e8cdaf1 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 _0x200b=['save','remove','update','emit','removeListener','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x3d9d35,_0x1f9ac3){var _0x4bf685=function(_0x156c96){while(--_0x156c96){_0x3d9d35['push'](_0x3d9d35['shift']());}};_0x4bf685(++_0x1f9ac3);}(_0x200b,0x107));var _0xb200=function(_0x5f0f89,_0x1fc5cc){_0x5f0f89=_0x5f0f89-0x0;var _0x541945=_0x200b[_0x5f0f89];return _0x541945;};'use strict';var WhatsappAccountEvents=require(_0xb200('0x0'));var events=[_0xb200('0x1'),_0xb200('0x2'),_0xb200('0x3')];function createListener(_0x222b7a,_0x266964){return function(_0x41b453){_0x266964[_0xb200('0x4')](_0x222b7a,_0x41b453);};}function removeListener(_0x554a18,_0x4afccf){return function(){WhatsappAccountEvents[_0xb200('0x5')](_0x554a18,_0x4afccf);};}exports[_0xb200('0x6')]=function(_0x168d5c){for(var _0x4cb58d=0x0,_0x3e035a=events['length'];_0x4cb58d<_0x3e035a;_0x4cb58d++){var _0x7ba1cf=events[_0x4cb58d];var _0x4e16c8=createListener(_0xb200('0x7')+_0x7ba1cf,_0x168d5c);WhatsappAccountEvents['on'](_0x7ba1cf,_0x4e16c8);}}; \ No newline at end of file +var _0x943b=['remove','emit','removeListener','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x14b643,_0x3be2f6){var _0x2281cd=function(_0x2da3d2){while(--_0x2da3d2){_0x14b643['push'](_0x14b643['shift']());}};_0x2281cd(++_0x3be2f6);}(_0x943b,0x1f1));var _0xb943=function(_0xe1882f,_0x3a4bd1){_0xe1882f=_0xe1882f-0x0;var _0x3a3d2b=_0x943b[_0xe1882f];return _0x3a3d2b;};'use strict';var WhatsappAccountEvents=require(_0xb943('0x0'));var events=['save',_0xb943('0x1'),'update'];function createListener(_0x35ebc4,_0x5dea96){return function(_0x368446){_0x5dea96[_0xb943('0x2')](_0x35ebc4,_0x368446);};}function removeListener(_0x33a210,_0x45b002){return function(){WhatsappAccountEvents[_0xb943('0x3')](_0x33a210,_0x45b002);};}exports[_0xb943('0x4')]=function(_0x3dc962){for(var _0x36c64c=0x0,_0x2f1b72=events['length'];_0x36c64c<_0x2f1b72;_0x36c64c++){var _0x6ffffc=events[_0x36c64c];var _0xe66313=createListener(_0xb943('0x5')+_0x6ffffc,_0x3dc962);WhatsappAccountEvents['on'](_0x6ffffc,_0xe66313);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index a8bc04c..302a56b 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 _0xf874=['post','create','/:id','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','get','show'];(function(_0x188576,_0x2ecc9b){var _0x5dbe50=function(_0x45ad78){while(--_0x45ad78){_0x188576['push'](_0x188576['shift']());}};_0x5dbe50(++_0x2ecc9b);}(_0xf874,0x145));var _0x4f87=function(_0x443b92,_0x5542ed){_0x443b92=_0x443b92-0x0;var _0x33548a=_0xf874[_0x443b92];return _0x33548a;};'use strict';var multer=require(_0x4f87('0x0'));var util=require('util');var path=require(_0x4f87('0x1'));var timeout=require('connect-timeout');var express=require(_0x4f87('0x2'));var router=express[_0x4f87('0x3')]();var fs_extra=require(_0x4f87('0x4'));var auth=require(_0x4f87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4f87('0x6'));var controller=require(_0x4f87('0x7'));router['get']('/',auth[_0x4f87('0x8')](),controller['index']);router[_0x4f87('0x9')]('/:id',auth[_0x4f87('0x8')](),controller[_0x4f87('0xa')]);router[_0x4f87('0xb')]('/',auth[_0x4f87('0x8')](),controller[_0x4f87('0xc')]);router['put'](_0x4f87('0xd'),auth[_0x4f87('0x8')](),controller[_0x4f87('0xe')]);router['delete'](_0x4f87('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x4f87('0xf')]=router; \ No newline at end of file +var _0x4281=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/:id','create','put','delete','destroy','exports','multer'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x4281,0x1df));var _0x1428=function(_0x512973,_0x564e8b){_0x512973=_0x512973-0x0;var _0x32f2e1=_0x4281[_0x512973];return _0x32f2e1;};'use strict';var multer=require(_0x1428('0x0'));var util=require(_0x1428('0x1'));var path=require(_0x1428('0x2'));var timeout=require(_0x1428('0x3'));var express=require('express');var router=express[_0x1428('0x4')]();var fs_extra=require(_0x1428('0x5'));var auth=require(_0x1428('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x1428('0x7')](),controller['index']);router[_0x1428('0x8')](_0x1428('0x9'),auth[_0x1428('0x7')](),controller['show']);router['post']('/',auth[_0x1428('0x7')](),controller[_0x1428('0xa')]);router[_0x1428('0xb')](_0x1428('0x9'),auth[_0x1428('0x7')](),controller['update']);router[_0x1428('0xc')](_0x1428('0x9'),auth[_0x1428('0x7')](),controller[_0x1428('0xd')]);module[_0x1428('0xe')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index a2a474a..3477ece 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 _0xdcac=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x2a6596,_0x8eb727){var _0x5778bb=function(_0x3a99bb){while(--_0x3a99bb){_0x2a6596['push'](_0x2a6596['shift']());}};_0x5778bb(++_0x8eb727);}(_0xdcac,0x87));var _0xcdca=function(_0x30ffb7,_0x54bba5){_0x30ffb7=_0x30ffb7-0x0;var _0x5ade5e=_0xdcac[_0x30ffb7];return _0x5ade5e;};'use strict';var Sequelize=require(_0xcdca('0x0'));module['exports']={'priority':{'type':Sequelize[_0xcdca('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xcdca('0x2')],'allowNull':![],'defaultValue':_0xcdca('0x3')},'appdata':{'type':Sequelize[_0xcdca('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcdca('0x2')],'defaultValue':_0xcdca('0x5')}}; \ No newline at end of file +var _0xf94c=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x1c288b,_0x377b72){var _0x5d9225=function(_0x3c1a9e){while(--_0x3c1a9e){_0x1c288b['push'](_0x1c288b['shift']());}};_0x5d9225(++_0x377b72);}(_0xf94c,0xa6));var _0xcf94=function(_0x59b34c,_0x1873c4){_0x59b34c=_0x59b34c-0x0;var _0x29201d=_0xf94c[_0x59b34c];return _0x29201d;};'use strict';var Sequelize=require(_0xcf94('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcf94('0x1')],'allowNull':![],'defaultValue':_0xcf94('0x2')},'appdata':{'type':Sequelize[_0xcf94('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcf94('0x1')],'defaultValue':_0xcf94('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 44177c1..1830230 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 _0x2432=['save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','type','query','filters','intersection','attributes','fields','model','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','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','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x1aa13f,_0x28553e){var _0x1ee1c4=function(_0x1b9cb9){while(--_0x1b9cb9){_0x1aa13f['push'](_0x1aa13f['shift']());}};_0x1ee1c4(++_0x28553e);}(_0x2432,0x7a));var _0x2243=function(_0x3d996c,_0x3b2d83){_0x3d996c=_0x3d996c-0x0;var _0x5b84a8=_0x2432[_0x3d996c];return _0x5b84a8;};'use strict';var emlformat=require(_0x2243('0x0'));var rimraf=require(_0x2243('0x1'));var zipdir=require(_0x2243('0x2'));var jsonpatch=require(_0x2243('0x3'));var rp=require('request-promise');var moment=require(_0x2243('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2243('0x5'));var util=require(_0x2243('0x6'));var path=require(_0x2243('0x7'));var sox=require(_0x2243('0x8'));var csv=require(_0x2243('0x9'));var ejs=require(_0x2243('0xa'));var fs=require('fs');var fs_extra=require(_0x2243('0xb'));var _=require(_0x2243('0xc'));var squel=require(_0x2243('0xd'));var crypto=require('crypto');var jsforce=require(_0x2243('0xe'));var deskjs=require(_0x2243('0xf'));var toCsv=require(_0x2243('0x9'));var querystring=require(_0x2243('0x10'));var Papa=require(_0x2243('0x11'));var Redis=require(_0x2243('0x12'));var authService=require(_0x2243('0x13'));var qs=require(_0x2243('0x14'));var as=require(_0x2243('0x15'));var hardwareService=require(_0x2243('0x16'));var logger=require(_0x2243('0x17'))(_0x2243('0x18'));var utils=require(_0x2243('0x19'));var config=require(_0x2243('0x1a'));var licenseUtil=require(_0x2243('0x1b'));var db=require(_0x2243('0x1c'))['db'];function respondWithStatusCode(_0x4b5ec5,_0x214433){_0x214433=_0x214433||0xcc;return function(_0x13c2a2){if(_0x13c2a2){return _0x4b5ec5[_0x2243('0x1d')](_0x214433);}return _0x4b5ec5[_0x2243('0x1e')](_0x214433)['end']();};}function respondWithResult(_0x436262,_0x496e30){_0x496e30=_0x496e30||0xc8;return function(_0x328104){if(_0x328104){return _0x436262['status'](_0x496e30)[_0x2243('0x1f')](_0x328104);}};}function respondWithFilteredResult(_0x6da2e2,_0x20e2cf){return function(_0x3388bc){if(_0x3388bc){var _0x4ebd4a=typeof _0x20e2cf['offset']===_0x2243('0x20')&&typeof _0x20e2cf[_0x2243('0x21')]===_0x2243('0x20');var _0xaac77c=_0x3388bc[_0x2243('0x22')];var _0x2595f0=_0x4ebd4a?0x0:_0x20e2cf[_0x2243('0x23')];var _0x3c8bb9=_0x4ebd4a?_0x3388bc[_0x2243('0x22')]:_0x20e2cf[_0x2243('0x23')]+_0x20e2cf[_0x2243('0x21')];var _0x4a1dc2;if(_0x3c8bb9>=_0xaac77c){_0x3c8bb9=_0xaac77c;_0x4a1dc2=0xc8;}else{_0x4a1dc2=0xce;}_0x6da2e2[_0x2243('0x1e')](_0x4a1dc2);return _0x6da2e2[_0x2243('0x24')](_0x2243('0x25'),_0x2595f0+'-'+_0x3c8bb9+'/'+_0xaac77c)['json'](_0x3388bc);}return null;};}function patchUpdates(_0x7818cf){return function(_0x14ed4f){try{jsonpatch[_0x2243('0x26')](_0x14ed4f,_0x7818cf,!![]);}catch(_0x17b976){return BPromise[_0x2243('0x27')](_0x17b976);}return _0x14ed4f[_0x2243('0x28')]();};}function saveUpdates(_0x518bfe,_0x45d4b7){return function(_0x36b1d4){if(_0x36b1d4){return _0x36b1d4[_0x2243('0x29')](_0x518bfe)[_0x2243('0x2a')](function(_0x28c6c4){return _0x28c6c4;});}return null;};}function removeEntity(_0x3424fc,_0x54d51d){return function(_0x3e64c9){if(_0x3e64c9){return _0x3e64c9[_0x2243('0x2b')]()[_0x2243('0x2a')](function(){_0x3424fc[_0x2243('0x1e')](0xcc)[_0x2243('0x2c')]();});}};}function handleEntityNotFound(_0x522d82,_0xedbc67){return function(_0x4d5935){if(!_0x4d5935){_0x522d82['sendStatus'](0x194);}return _0x4d5935;};}function handleError(_0xada872,_0x1153c4){_0x1153c4=_0x1153c4||0x1f4;return function(_0x4b0e0f){logger[_0x2243('0x2d')](_0x4b0e0f[_0x2243('0x2e')]);if(_0x4b0e0f['name']){delete _0x4b0e0f[_0x2243('0x2f')];}_0xada872[_0x2243('0x1e')](_0x1153c4)[_0x2243('0x30')](_0x4b0e0f);};}exports[_0x2243('0x31')]=function(_0x4e3acf,_0x21b3e0){var _0x2ad941={},_0x39d436={},_0x2d523a={'count':0x0,'rows':[]};var _0x8525d7=_[_0x2243('0x32')](db[_0x2243('0x33')][_0x2243('0x34')],function(_0x20f3a3){return{'name':_0x20f3a3['fieldName'],'type':_0x20f3a3[_0x2243('0x35')]['key']};});_0x39d436['model']=_[_0x2243('0x32')](_0x8525d7,_0x2243('0x2f'));_0x39d436[_0x2243('0x36')]=_['keys'](_0x4e3acf[_0x2243('0x36')]);_0x39d436[_0x2243('0x37')]=_[_0x2243('0x38')](_0x39d436['model'],_0x39d436[_0x2243('0x36')]);_0x2ad941[_0x2243('0x39')]=_[_0x2243('0x38')](_0x39d436['model'],qs['fields'](_0x4e3acf[_0x2243('0x36')][_0x2243('0x3a')]));_0x2ad941[_0x2243('0x39')]=_0x2ad941[_0x2243('0x39')]['length']?_0x2ad941[_0x2243('0x39')]:_0x39d436[_0x2243('0x3b')];if(!_0x4e3acf[_0x2243('0x36')]['hasOwnProperty'](_0x2243('0x3c'))){_0x2ad941[_0x2243('0x21')]=qs[_0x2243('0x21')](_0x4e3acf[_0x2243('0x36')]['limit']);_0x2ad941[_0x2243('0x23')]=qs[_0x2243('0x23')](_0x4e3acf[_0x2243('0x36')][_0x2243('0x23')]);}_0x2ad941[_0x2243('0x3d')]=qs['sort'](_0x4e3acf[_0x2243('0x36')][_0x2243('0x3e')]);_0x2ad941[_0x2243('0x3f')]=qs[_0x2243('0x37')](_[_0x2243('0x40')](_0x4e3acf[_0x2243('0x36')],_0x39d436[_0x2243('0x37')]),_0x8525d7);if(_0x4e3acf[_0x2243('0x36')][_0x2243('0x41')]){_0x2ad941[_0x2243('0x3f')]=_['merge'](_0x2ad941[_0x2243('0x3f')],{'$or':_['map'](_0x8525d7,function(_0x27ccba){if(_0x27ccba[_0x2243('0x35')]!==_0x2243('0x42')){var _0x49482a={};_0x49482a[_0x27ccba['name']]={'$like':'%'+_0x4e3acf[_0x2243('0x36')][_0x2243('0x41')]+'%'};return _0x49482a;}})});}_0x2ad941=_[_0x2243('0x43')]({},_0x2ad941,_0x4e3acf[_0x2243('0x44')]);var _0x21240b={'where':_0x2ad941[_0x2243('0x3f')]};return db[_0x2243('0x33')][_0x2243('0x22')](_0x21240b)[_0x2243('0x2a')](function(_0x34063f){_0x2d523a[_0x2243('0x22')]=_0x34063f;if(_0x4e3acf['query'][_0x2243('0x45')]){_0x2ad941[_0x2243('0x46')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x2243('0x47')](_0x2ad941);})['then'](function(_0x4063ab){_0x2d523a[_0x2243('0x48')]=_0x4063ab;return _0x2d523a;})[_0x2243('0x2a')](respondWithFilteredResult(_0x21b3e0,_0x2ad941))[_0x2243('0x49')](handleError(_0x21b3e0,null));};exports[_0x2243('0x4a')]=function(_0xba54cc,_0x5a8b94){var _0x3d39ce={'raw':!![],'where':{'id':_0xba54cc[_0x2243('0x4b')]['id']}},_0xa2872c={};_0xa2872c[_0x2243('0x3b')]=_[_0x2243('0x4c')](db[_0x2243('0x33')]['rawAttributes']);_0xa2872c[_0x2243('0x36')]=_[_0x2243('0x4c')](_0xba54cc[_0x2243('0x36')]);_0xa2872c[_0x2243('0x37')]=_['intersection'](_0xa2872c[_0x2243('0x3b')],_0xa2872c['query']);_0x3d39ce[_0x2243('0x39')]=_[_0x2243('0x38')](_0xa2872c['model'],qs['fields'](_0xba54cc['query']['fields']));_0x3d39ce[_0x2243('0x39')]=_0x3d39ce['attributes'][_0x2243('0x4d')]?_0x3d39ce[_0x2243('0x39')]:_0xa2872c[_0x2243('0x3b')];if(_0xba54cc[_0x2243('0x36')][_0x2243('0x45')]){_0x3d39ce[_0x2243('0x46')]=[{'all':!![]}];}_0x3d39ce=_[_0x2243('0x43')]({},_0x3d39ce,_0xba54cc['options']);return db[_0x2243('0x33')][_0x2243('0x4e')](_0x3d39ce)[_0x2243('0x2a')](handleEntityNotFound(_0x5a8b94,null))['then'](respondWithResult(_0x5a8b94,null))[_0x2243('0x49')](handleError(_0x5a8b94,null));};exports[_0x2243('0x4f')]=function(_0x3f0b79,_0x409e44){return db[_0x2243('0x33')][_0x2243('0x4f')](_0x3f0b79[_0x2243('0x50')],{})[_0x2243('0x2a')](respondWithResult(_0x409e44,0xc9))[_0x2243('0x49')](handleError(_0x409e44,null));};exports[_0x2243('0x29')]=function(_0x4150a8,_0x490fb2){if(_0x4150a8[_0x2243('0x50')]['id']){delete _0x4150a8['body']['id'];}return db[_0x2243('0x33')]['find']({'where':{'id':_0x4150a8[_0x2243('0x4b')]['id']}})[_0x2243('0x2a')](handleEntityNotFound(_0x490fb2,null))['then'](saveUpdates(_0x4150a8['body'],null))[_0x2243('0x2a')](respondWithResult(_0x490fb2,null))[_0x2243('0x49')](handleError(_0x490fb2,null));};exports[_0x2243('0x2b')]=function(_0x5e06b2,_0x25a25a){return db[_0x2243('0x33')]['find']({'where':{'id':_0x5e06b2[_0x2243('0x4b')]['id']}})['then'](handleEntityNotFound(_0x25a25a,null))[_0x2243('0x2a')](removeEntity(_0x25a25a,null))['catch'](handleError(_0x25a25a,null));}; \ No newline at end of file +var _0x5ed9=['save','update','then','destroy','sendStatus','stack','name','send','index','WhatsappApplication','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','filter','where','merge','map','type','options','includeAll','include','findAll','catch','show','params','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject'];(function(_0x43c877,_0x35e75e){var _0x448887=function(_0x317bc1){while(--_0x317bc1){_0x43c877['push'](_0x43c877['shift']());}};_0x448887(++_0x35e75e);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5ed9[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0x95ed('0x0'));var rimraf=require(_0x95ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95ed('0x2'));var rp=require(_0x95ed('0x3'));var moment=require(_0x95ed('0x4'));var BPromise=require(_0x95ed('0x5'));var Mustache=require('mustache');var util=require(_0x95ed('0x6'));var path=require(_0x95ed('0x7'));var sox=require(_0x95ed('0x8'));var csv=require('to-csv');var ejs=require(_0x95ed('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95ed('0xa'));var squel=require(_0x95ed('0xb'));var crypto=require(_0x95ed('0xc'));var jsforce=require(_0x95ed('0xd'));var deskjs=require(_0x95ed('0xe'));var toCsv=require(_0x95ed('0xf'));var querystring=require('querystring');var Papa=require(_0x95ed('0x10'));var Redis=require(_0x95ed('0x11'));var authService=require(_0x95ed('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x95ed('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x95ed('0x14'))(_0x95ed('0x15'));var utils=require(_0x95ed('0x16'));var config=require(_0x95ed('0x17'));var licenseUtil=require(_0x95ed('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e4571,_0x3da05b){_0x3da05b=_0x3da05b||0xcc;return function(_0x4236c1){if(_0x4236c1){return _0x5e4571['sendStatus'](_0x3da05b);}return _0x5e4571['status'](_0x3da05b)[_0x95ed('0x19')]();};}function respondWithResult(_0x11671d,_0x22211f){_0x22211f=_0x22211f||0xc8;return function(_0x3ebfda){if(_0x3ebfda){return _0x11671d['status'](_0x22211f)[_0x95ed('0x1a')](_0x3ebfda);}};}function respondWithFilteredResult(_0xd3fe73,_0x477b8f){return function(_0x597a04){if(_0x597a04){var _0x5fc6b5=typeof _0x477b8f['offset']===_0x95ed('0x1b')&&typeof _0x477b8f['limit']==='undefined';var _0x47f841=_0x597a04[_0x95ed('0x1c')];var _0x58fb9e=_0x5fc6b5?0x0:_0x477b8f[_0x95ed('0x1d')];var _0x1bc47c=_0x5fc6b5?_0x597a04['count']:_0x477b8f[_0x95ed('0x1d')]+_0x477b8f[_0x95ed('0x1e')];var _0x4432c9;if(_0x1bc47c>=_0x47f841){_0x1bc47c=_0x47f841;_0x4432c9=0xc8;}else{_0x4432c9=0xce;}_0xd3fe73[_0x95ed('0x1f')](_0x4432c9);return _0xd3fe73[_0x95ed('0x20')](_0x95ed('0x21'),_0x58fb9e+'-'+_0x1bc47c+'/'+_0x47f841)[_0x95ed('0x1a')](_0x597a04);}return null;};}function patchUpdates(_0x3e05cf){return function(_0x10823b){try{jsonpatch[_0x95ed('0x22')](_0x10823b,_0x3e05cf,!![]);}catch(_0x5887e3){return BPromise[_0x95ed('0x23')](_0x5887e3);}return _0x10823b[_0x95ed('0x24')]();};}function saveUpdates(_0x4e8a5d,_0x5d5afe){return function(_0x54c5ae){if(_0x54c5ae){return _0x54c5ae[_0x95ed('0x25')](_0x4e8a5d)[_0x95ed('0x26')](function(_0x31384c){return _0x31384c;});}return null;};}function removeEntity(_0x61d85e,_0x2c0824){return function(_0x19b664){if(_0x19b664){return _0x19b664[_0x95ed('0x27')]()[_0x95ed('0x26')](function(){_0x61d85e[_0x95ed('0x1f')](0xcc)[_0x95ed('0x19')]();});}};}function handleEntityNotFound(_0x3b298f,_0x413be3){return function(_0x461a50){if(!_0x461a50){_0x3b298f[_0x95ed('0x28')](0x194);}return _0x461a50;};}function handleError(_0x51ca8b,_0x2da24f){_0x2da24f=_0x2da24f||0x1f4;return function(_0x518dbd){logger['error'](_0x518dbd[_0x95ed('0x29')]);if(_0x518dbd[_0x95ed('0x2a')]){delete _0x518dbd[_0x95ed('0x2a')];}_0x51ca8b[_0x95ed('0x1f')](_0x2da24f)[_0x95ed('0x2b')](_0x518dbd);};}exports[_0x95ed('0x2c')]=function(_0x88e102,_0x190620){var _0x39330d={},_0x3f3ed9={},_0x105af5={'count':0x0,'rows':[]};var _0x3a8841=_['map'](db[_0x95ed('0x2d')][_0x95ed('0x2e')],function(_0x53b1f4){return{'name':_0x53b1f4[_0x95ed('0x2f')],'type':_0x53b1f4['type']['key']};});_0x3f3ed9['model']=_['map'](_0x3a8841,'name');_0x3f3ed9[_0x95ed('0x30')]=_[_0x95ed('0x31')](_0x88e102[_0x95ed('0x30')]);_0x3f3ed9[_0x95ed('0x32')]=_[_0x95ed('0x33')](_0x3f3ed9[_0x95ed('0x34')],_0x3f3ed9[_0x95ed('0x30')]);_0x39330d['attributes']=_[_0x95ed('0x33')](_0x3f3ed9[_0x95ed('0x34')],qs[_0x95ed('0x35')](_0x88e102['query']['fields']));_0x39330d[_0x95ed('0x36')]=_0x39330d['attributes']['length']?_0x39330d['attributes']:_0x3f3ed9['model'];if(!_0x88e102[_0x95ed('0x30')]['hasOwnProperty'](_0x95ed('0x37'))){_0x39330d[_0x95ed('0x1e')]=qs['limit'](_0x88e102['query']['limit']);_0x39330d['offset']=qs['offset'](_0x88e102[_0x95ed('0x30')][_0x95ed('0x1d')]);}_0x39330d[_0x95ed('0x38')]=qs[_0x95ed('0x39')](_0x88e102[_0x95ed('0x30')][_0x95ed('0x39')]);_0x39330d['where']=qs[_0x95ed('0x32')](_[_0x95ed('0x3a')](_0x88e102[_0x95ed('0x30')],_0x3f3ed9['filters']),_0x3a8841);if(_0x88e102[_0x95ed('0x30')][_0x95ed('0x3b')]){_0x39330d[_0x95ed('0x3c')]=_[_0x95ed('0x3d')](_0x39330d[_0x95ed('0x3c')],{'$or':_[_0x95ed('0x3e')](_0x3a8841,function(_0x40e968){if(_0x40e968[_0x95ed('0x3f')]!=='VIRTUAL'){var _0x53ddbe={};_0x53ddbe[_0x40e968['name']]={'$like':'%'+_0x88e102[_0x95ed('0x30')][_0x95ed('0x3b')]+'%'};return _0x53ddbe;}})});}_0x39330d=_[_0x95ed('0x3d')]({},_0x39330d,_0x88e102[_0x95ed('0x40')]);var _0x2c0ea8={'where':_0x39330d[_0x95ed('0x3c')]};return db['WhatsappApplication'][_0x95ed('0x1c')](_0x2c0ea8)[_0x95ed('0x26')](function(_0x477eb6){_0x105af5['count']=_0x477eb6;if(_0x88e102['query'][_0x95ed('0x41')]){_0x39330d[_0x95ed('0x42')]=[{'all':!![]}];}return db[_0x95ed('0x2d')][_0x95ed('0x43')](_0x39330d);})[_0x95ed('0x26')](function(_0x5c4c54){_0x105af5['rows']=_0x5c4c54;return _0x105af5;})[_0x95ed('0x26')](respondWithFilteredResult(_0x190620,_0x39330d))[_0x95ed('0x44')](handleError(_0x190620,null));};exports[_0x95ed('0x45')]=function(_0x3c8b7c,_0x4f91ed){var _0x6746ce={'raw':!![],'where':{'id':_0x3c8b7c[_0x95ed('0x46')]['id']}},_0x537c2b={};_0x537c2b[_0x95ed('0x34')]=_[_0x95ed('0x31')](db['WhatsappApplication'][_0x95ed('0x2e')]);_0x537c2b[_0x95ed('0x30')]=_[_0x95ed('0x31')](_0x3c8b7c['query']);_0x537c2b['filters']=_[_0x95ed('0x33')](_0x537c2b['model'],_0x537c2b[_0x95ed('0x30')]);_0x6746ce['attributes']=_[_0x95ed('0x33')](_0x537c2b[_0x95ed('0x34')],qs[_0x95ed('0x35')](_0x3c8b7c[_0x95ed('0x30')][_0x95ed('0x35')]));_0x6746ce['attributes']=_0x6746ce[_0x95ed('0x36')][_0x95ed('0x47')]?_0x6746ce[_0x95ed('0x36')]:_0x537c2b['model'];if(_0x3c8b7c[_0x95ed('0x30')]['includeAll']){_0x6746ce[_0x95ed('0x42')]=[{'all':!![]}];}_0x6746ce=_[_0x95ed('0x3d')]({},_0x6746ce,_0x3c8b7c['options']);return db[_0x95ed('0x2d')][_0x95ed('0x48')](_0x6746ce)['then'](handleEntityNotFound(_0x4f91ed,null))['then'](respondWithResult(_0x4f91ed,null))[_0x95ed('0x44')](handleError(_0x4f91ed,null));};exports['create']=function(_0x257a23,_0x5288e6){return db[_0x95ed('0x2d')][_0x95ed('0x49')](_0x257a23[_0x95ed('0x4a')],{})[_0x95ed('0x26')](respondWithResult(_0x5288e6,0xc9))[_0x95ed('0x44')](handleError(_0x5288e6,null));};exports['update']=function(_0x373f2b,_0x2d0849){if(_0x373f2b[_0x95ed('0x4a')]['id']){delete _0x373f2b[_0x95ed('0x4a')]['id'];}return db[_0x95ed('0x2d')][_0x95ed('0x48')]({'where':{'id':_0x373f2b[_0x95ed('0x46')]['id']}})[_0x95ed('0x26')](handleEntityNotFound(_0x2d0849,null))[_0x95ed('0x26')](saveUpdates(_0x373f2b[_0x95ed('0x4a')],null))[_0x95ed('0x26')](respondWithResult(_0x2d0849,null))[_0x95ed('0x44')](handleError(_0x2d0849,null));};exports[_0x95ed('0x27')]=function(_0x4dc496,_0x29cb03){return db[_0x95ed('0x2d')]['find']({'where':{'id':_0x4dc496[_0x95ed('0x46')]['id']}})['then'](handleEntityNotFound(_0x29cb03,null))[_0x95ed('0x26')](removeEntity(_0x29cb03,null))[_0x95ed('0x44')](handleError(_0x29cb03,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 0cda73b..253d12f 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 _0x0689=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define'];(function(_0x2ca943,_0xf6acf3){var _0xe04b9=function(_0x24d934){while(--_0x24d934){_0x2ca943['push'](_0x2ca943['shift']());}};_0xe04b9(++_0xf6acf3);}(_0x0689,0x161));var _0x9068=function(_0x52e341,_0x26abb9){_0x52e341=_0x52e341-0x0;var _0x1dc553=_0x0689[_0x52e341];return _0x1dc553;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var logger=require('../../config/logger')(_0x9068('0x1'));var moment=require(_0x9068('0x2'));var BPromise=require(_0x9068('0x3'));var rp=require(_0x9068('0x4'));var fs=require('fs');var path=require(_0x9068('0x5'));var rimraf=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var attributes=require(_0x9068('0x8'));module[_0x9068('0x9')]=function(_0x287846,_0x5ce5a7){return _0x287846[_0x9068('0xa')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9068('0xb'),'collate':_0x9068('0xc')});}; \ No newline at end of file +var _0x0eec=['WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xe04541,_0x22fa83){var _0x46b271=function(_0x7b4497){while(--_0x7b4497){_0xe04541['push'](_0xe04541['shift']());}};_0x46b271(++_0x22fa83);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc0ee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc0ee('0x1'));var moment=require(_0xc0ee('0x2'));var BPromise=require(_0xc0ee('0x3'));var rp=require(_0xc0ee('0x4'));var fs=require('fs');var path=require(_0xc0ee('0x5'));var rimraf=require(_0xc0ee('0x6'));var config=require(_0xc0ee('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0xc0ee('0x8')]=function(_0x4db3d6,_0x218797){return _0x4db3d6[_0xc0ee('0x9')](_0xc0ee('0xa'),attributes,{'tableName':_0xc0ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc0ee('0xc'),'collate':_0xc0ee('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 835dd90..772408e 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 _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x8957d,_0x1a2301){var _0x33f12f=function(_0x56c100){while(--_0x56c100){_0x8957d['push'](_0x8957d['shift']());}};_0x33f12f(++_0x1a2301);}(_0x5fd1,0x155));var _0x15fd=function(_0x497770,_0x3da973){_0x497770=_0x497770-0x0;var _0x43e275=_0x5fd1[_0x497770];return _0x43e275;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file +var _0x207c=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x161bed,_0x195970){var _0xbb9dcb=function(_0x14184a){while(--_0x14184a){_0x161bed['push'](_0x161bed['shift']());}};_0xbb9dcb(++_0x195970);}(_0x207c,0x1e8));var _0xc207=function(_0x372433,_0xb55d02){_0x372433=_0x372433-0x0;var _0x375ac3=_0x207c[_0x372433];return _0x375ac3;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x314561,_0x3395e4,_0x59ff6f){return new BPromise(function(_0x25cb97,_0xad159b){return client[_0xc207('0x9')](_0x314561,_0x59ff6f)['then'](function(_0xffae6c){logger[_0xc207('0xa')](_0xc207('0xb'),_0x3395e4,_0xc207('0xc'));logger[_0xc207('0xd')](_0xc207('0xe'),_0x3395e4,'request\x20sent',JSON['stringify'](_0xffae6c));if(_0xffae6c['error']){if(_0xffae6c[_0xc207('0xf')]['code']===0x1f4){logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0xad159b(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0x25cb97(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}else{logger[_0xc207('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x3395e4,'request\x20sent');_0x25cb97(_0xffae6c['result'][_0xc207('0x10')]);}})[_0xc207('0x11')](function(_0x3d9c7b){logger[_0xc207('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x3395e4,_0x3d9c7b);_0xad159b(_0x3d9c7b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 2873248..c5dec00 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 _0xa899=['/:id/messages','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','delete','whatsappinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','getMessages','/:id/download','download','post'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa899,0x155));var _0x9a89=function(_0x4b5813,_0x5769de){_0x4b5813=_0x4b5813-0x0;var _0x423465=_0xa899[_0x4b5813];return _0x423465;};'use strict';var multer=require(_0x9a89('0x0'));var util=require(_0x9a89('0x1'));var path=require(_0x9a89('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a89('0x3'));var router=express[_0x9a89('0x4')]();var fs_extra=require(_0x9a89('0x5'));var auth=require(_0x9a89('0x6'));var interaction=require(_0x9a89('0x7'));var config=require(_0x9a89('0x8'));var controller=require(_0x9a89('0x9'));router[_0x9a89('0xa')]('/',auth[_0x9a89('0xb')](),controller[_0x9a89('0xc')]);router[_0x9a89('0xa')](_0x9a89('0xd'),auth[_0x9a89('0xb')](),controller['describe']);router['get'](_0x9a89('0xe'),auth[_0x9a89('0xb')](),controller['show']);router[_0x9a89('0xa')]('/:id/messages',auth[_0x9a89('0xb')](),controller[_0x9a89('0xf')]);router[_0x9a89('0xa')](_0x9a89('0x10'),auth[_0x9a89('0xb')](),controller[_0x9a89('0x11')]);router[_0x9a89('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9a89('0x12')](_0x9a89('0x13'),auth[_0x9a89('0xb')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x9a89('0xb')](),interaction[_0x9a89('0x14')]('whatsapp',_0x9a89('0x15')),controller[_0x9a89('0x16')]);router[_0x9a89('0x17')](_0x9a89('0xe'),auth['isAuthenticated'](),interaction[_0x9a89('0x14')](_0x9a89('0x18'),'whatsappinteraction:update'),controller['update']);router[_0x9a89('0x19')]('/:id',auth[_0x9a89('0xb')](),interaction[_0x9a89('0x14')]('whatsapp',_0x9a89('0x1a')),controller['destroy']);router[_0x9a89('0x19')](_0x9a89('0x1b'),auth['isAuthenticated'](),controller[_0x9a89('0x1c')]);module[_0x9a89('0x1d')]=router; \ No newline at end of file +var _0xc6ac=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','exports','multer','util','path'];(function(_0x5a4762,_0x53adbe){var _0x389259=function(_0x180253){while(--_0x180253){_0x5a4762['push'](_0x5a4762['shift']());}};_0x389259(++_0x53adbe);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x343409,_0x534016){_0x343409=_0x343409-0x0;var _0x5863ac=_0xc6ac[_0x343409];return _0x5863ac;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0x16')]('/',auth[_0xcc6a('0xc')](),controller['create']);router['post'](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x17')]);router['post']('/:id/tags',auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1a')),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x1c')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0xcc6a('0x1d')]);router[_0xcc6a('0x1e')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1f')),controller[_0xcc6a('0x20')]);router[_0xcc6a('0x1e')](_0xcc6a('0x21'),auth[_0xcc6a('0xc')](),controller['removeTags']);module[_0xcc6a('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 9cd07fc..3fb685f 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 _0x5b20=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x19cc52,_0x5d135e){var _0x430dce=function(_0x29fc08){while(--_0x29fc08){_0x19cc52['push'](_0x19cc52['shift']());}};_0x430dce(++_0x5d135e);}(_0x5b20,0x86));var _0x05b2=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5b20[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x05b2('0x0'));var moment=require(_0x05b2('0x1'));module[_0x05b2('0x2')]={'closed':{'type':Sequelize[_0x05b2('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x05b2('0x4')]},'disposition':{'type':Sequelize[_0x05b2('0x5')]},'secondDisposition':{'type':Sequelize[_0x05b2('0x5')]},'thirdDisposition':{'type':Sequelize[_0x05b2('0x5')]},'note':{'type':Sequelize[_0x05b2('0x5')]},'phone':{'type':Sequelize[_0x05b2('0x5')]},'read1stAt':{'type':Sequelize[_0x05b2('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x05b2('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x05b2('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x05b2('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x05b2('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xec46=['STRING','DATE','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x4cb65e,_0x2d06c3){var _0x40537b=function(_0x4a731e){while(--_0x4a731e){_0x4cb65e['push'](_0x4cb65e['shift']());}};_0x40537b(++_0x2d06c3);}(_0xec46,0x19c));var _0x6ec4=function(_0x91ae2,_0x43bbf5){_0x91ae2=_0x91ae2-0x0;var _0x9c07da=_0xec46[_0x91ae2];return _0x9c07da;};'use strict';var Sequelize=require(_0x6ec4('0x0'));var moment=require(_0x6ec4('0x1'));module[_0x6ec4('0x2')]={'closed':{'type':Sequelize[_0x6ec4('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6ec4('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6ec4('0x4')]},'note':{'type':Sequelize[_0x6ec4('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x6ec4('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x6ec4('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6ec4('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6ec4('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6ec4('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index c0b7532..f3a9f16 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 _0x24f2=['User','fullname','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','WhatsappAccount','Account','Owner','Whatsapp','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','createReadStream','out','value','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','end','json','undefined','limit','offset','count','status','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','fieldName','type','key','getOptions','findAll','query','user','catch','show','params','model','WhatsappInteraction','rawAttributes','keys','filters','intersection','attributes','fields','includeAll','merge','create','body','find','describe','addMessage','ids','getMessages','findOne','WhatsappMessage','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','map','$gte','split','options','include','rows','addTags','setTags','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','root','server','files','join','attachments','push'];(function(_0x291b01,_0x5a459e){var _0x2c67c6=function(_0x313308){while(--_0x313308){_0x291b01['push'](_0x291b01['shift']());}};_0x2c67c6(++_0x5a459e);}(_0x24f2,0x190));var _0x224f=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x24f2[_0x3b90ab];return _0x206e92;};'use strict';var rimraf=require(_0x224f('0x0'));var zipdir=require(_0x224f('0x1'));var moment=require(_0x224f('0x2'));var BPromise=require(_0x224f('0x3'));var util=require(_0x224f('0x4'));var path=require(_0x224f('0x5'));var ejs=require(_0x224f('0x6'));var fs=require('fs');var _=require(_0x224f('0x7'));var Redis=require(_0x224f('0x8'));var interaction=require(_0x224f('0x9'));var qs=require(_0x224f('0xa'));var pdf=require(_0x224f('0xb'));var logger=require(_0x224f('0xc'))('api');var config=require(_0x224f('0xd'));var db=require(_0x224f('0xe'))['db'];config[_0x224f('0xf')]=_[_0x224f('0x10')](config[_0x224f('0xf')],{'host':_0x224f('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x224f('0xf')]));require(_0x224f('0x12'))[_0x224f('0x13')](socket);function respondWithStatusCode(_0x24606f,_0x36f6ea){_0x36f6ea=_0x36f6ea||0xcc;return function(_0x646fd4){if(_0x646fd4){return _0x24606f['sendStatus'](_0x36f6ea);}return _0x24606f['status'](_0x36f6ea)[_0x224f('0x14')]();};}function respondWithResult(_0x34bde3,_0x30a710){_0x30a710=_0x30a710||0xc8;return function(_0x3e4320){if(_0x3e4320){return _0x34bde3['status'](_0x30a710)[_0x224f('0x15')](_0x3e4320);}};}function respondWithFilteredResult(_0xb1a8a1,_0x5654db){return function(_0x24c916){if(_0x24c916){var _0x5b4b1e=typeof _0x5654db['offset']===_0x224f('0x16')&&typeof _0x5654db[_0x224f('0x17')]===_0x224f('0x16');var _0xa6d797=_0x24c916['count'];var _0x4f498b=_0x5b4b1e?0x0:_0x5654db[_0x224f('0x18')];var _0x5ab157=_0x5b4b1e?_0x24c916[_0x224f('0x19')]:_0x5654db[_0x224f('0x18')]+_0x5654db['limit'];var _0x4aef40;if(_0x5ab157>=_0xa6d797){_0x5ab157=_0xa6d797;_0x4aef40=0xc8;}else{_0x4aef40=0xce;}_0xb1a8a1[_0x224f('0x1a')](_0x4aef40);return _0xb1a8a1[_0x224f('0x1b')](_0x224f('0x1c'),_0x4f498b+'-'+_0x5ab157+'/'+_0xa6d797)[_0x224f('0x15')](_0x24c916);}return null;};}function saveUpdates(_0x38a3e6){return function(_0x6a1ebd){if(_0x6a1ebd){return _0x6a1ebd[_0x224f('0x1d')](_0x38a3e6)['then'](function(_0x275c4a){return _0x275c4a;});}return null;};}function removeEntity(_0x5f5c3c){return function(_0x379b4b){if(_0x379b4b){return _0x379b4b['destroy']()[_0x224f('0x1e')](function(){_0x5f5c3c[_0x224f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe5c48){return function(_0x3e4cbb){if(!_0x3e4cbb){_0xe5c48[_0x224f('0x1f')](0x194);}return _0x3e4cbb;};}function handleError(_0x2791d3,_0x37aa56){_0x37aa56=_0x37aa56||0x1f4;return function(_0x43152c){logger[_0x224f('0x20')](_0x43152c[_0x224f('0x21')]);if(_0x43152c[_0x224f('0x22')]){delete _0x43152c['name'];}_0x2791d3[_0x224f('0x1a')](_0x37aa56)[_0x224f('0x23')](_0x43152c);};}exports[_0x224f('0x24')]=function(_0x36343c,_0xa87d32){var _0x21a034={};var _0x18d6be=_['map'](db['WhatsappInteraction']['rawAttributes'],function(_0x24e437){return{'name':_0x24e437[_0x224f('0x25')],'type':_0x24e437[_0x224f('0x26')][_0x224f('0x27')]};});_0x21a034=qs[_0x224f('0x28')](_0x18d6be,_0x36343c);return interaction[_0x224f('0x29')]('whatsapp',_0x36343c[_0x224f('0x2a')],_0x36343c[_0x224f('0x2b')],_0x21a034,_0x18d6be)[_0x224f('0x1e')](respondWithFilteredResult(_0xa87d32,_0x21a034))[_0x224f('0x2c')](handleError(_0xa87d32,null));};exports[_0x224f('0x2d')]=function(_0x2ddbb8,_0x5a384e){var _0x36bc40={'raw':![],'where':{'id':_0x2ddbb8[_0x224f('0x2e')]['id']}},_0x1e8f1c={};_0x1e8f1c[_0x224f('0x2f')]=_['keys'](db[_0x224f('0x30')][_0x224f('0x31')]);_0x1e8f1c[_0x224f('0x2a')]=_[_0x224f('0x32')](_0x2ddbb8[_0x224f('0x2a')]);_0x1e8f1c[_0x224f('0x33')]=_[_0x224f('0x34')](_0x1e8f1c['model'],_0x1e8f1c[_0x224f('0x2a')]);_0x36bc40[_0x224f('0x35')]=_[_0x224f('0x34')](_0x1e8f1c[_0x224f('0x2f')],qs[_0x224f('0x36')](_0x2ddbb8[_0x224f('0x2a')][_0x224f('0x36')]));_0x36bc40[_0x224f('0x35')]=_0x36bc40[_0x224f('0x35')]['length']?_0x36bc40[_0x224f('0x35')]:_0x1e8f1c['model'];if(_0x2ddbb8[_0x224f('0x2a')][_0x224f('0x37')]){_0x36bc40['include']=[{'all':!![]}];}_0x36bc40=_[_0x224f('0x38')]({},_0x36bc40,_0x2ddbb8['options']);return db[_0x224f('0x30')]['find'](_0x36bc40)[_0x224f('0x1e')](handleEntityNotFound(_0x5a384e,null))[_0x224f('0x1e')](respondWithResult(_0x5a384e,null))[_0x224f('0x2c')](handleError(_0x5a384e,null));};exports[_0x224f('0x39')]=function(_0x524848,_0x4b519d){return db[_0x224f('0x30')][_0x224f('0x39')](_0x524848[_0x224f('0x3a')],{})[_0x224f('0x1e')](respondWithResult(_0x4b519d,0xc9))[_0x224f('0x2c')](handleError(_0x4b519d,null));};exports[_0x224f('0x1d')]=function(_0x135bb7,_0x193b99){if(_0x135bb7[_0x224f('0x3a')]['id']){delete _0x135bb7[_0x224f('0x3a')]['id'];}return db[_0x224f('0x30')][_0x224f('0x3b')]({'where':{'id':_0x135bb7[_0x224f('0x2e')]['id']}})['then'](handleEntityNotFound(_0x193b99,null))['then'](saveUpdates(_0x135bb7[_0x224f('0x3a')],null))[_0x224f('0x1e')](respondWithResult(_0x193b99,null))[_0x224f('0x2c')](handleError(_0x193b99,null));};exports['destroy']=function(_0x1c1c0b,_0x48a7ce){return db[_0x224f('0x30')][_0x224f('0x3b')]({'where':{'id':_0x1c1c0b[_0x224f('0x2e')]['id']}})[_0x224f('0x1e')](handleEntityNotFound(_0x48a7ce,null))[_0x224f('0x1e')](removeEntity(_0x48a7ce,null))['catch'](handleError(_0x48a7ce,null));};exports['describe']=function(_0x322e78,_0x18a2b0){return db[_0x224f('0x30')][_0x224f('0x3c')]()[_0x224f('0x1e')](respondWithResult(_0x18a2b0,null))[_0x224f('0x2c')](handleError(_0x18a2b0,null));};exports['addMessage']=function(_0x40e63e,_0x28dd77){return db['WhatsappMessage'][_0x224f('0x3b')]({'where':{'id':_0x40e63e[_0x224f('0x2e')]['id']}})[_0x224f('0x1e')](handleEntityNotFound(_0x28dd77,null))[_0x224f('0x1e')](function(_0x65591c){if(_0x65591c){return _0x65591c[_0x224f('0x3d')](_0x40e63e[_0x224f('0x3a')][_0x224f('0x3e')],_['omit'](_0x40e63e['body'],[_0x224f('0x3e'),'id'])||{});}})[_0x224f('0x1e')](respondWithResult(_0x28dd77,null))['catch'](handleError(_0x28dd77,null));};exports[_0x224f('0x3f')]=function(_0x171aa7,_0x195c04){var _0xf3ef9a={'raw':![],'where':{}};var _0x20f2e2={};var _0x58cc97={'count':0x0,'rows':[]};return db[_0x224f('0x30')][_0x224f('0x40')]({'where':{'id':_0x171aa7[_0x224f('0x2e')]['id']}})[_0x224f('0x1e')](handleEntityNotFound(_0x195c04,null))[_0x224f('0x1e')](function(_0xd1bf5c){if(_0xd1bf5c){_0x20f2e2[_0x224f('0x2f')]=_[_0x224f('0x32')](db[_0x224f('0x41')]['rawAttributes']);_0x20f2e2[_0x224f('0x2a')]=_['keys'](_0x171aa7[_0x224f('0x2a')]);_0x20f2e2[_0x224f('0x33')]=_[_0x224f('0x34')](_0x20f2e2['model'],_0x20f2e2[_0x224f('0x2a')]);_0xf3ef9a[_0x224f('0x35')]=_[_0x224f('0x34')](_0x20f2e2['model'],qs[_0x224f('0x36')](_0x171aa7[_0x224f('0x2a')][_0x224f('0x36')]));_0xf3ef9a[_0x224f('0x35')]=_0xf3ef9a[_0x224f('0x35')]['length']?_0xf3ef9a[_0x224f('0x35')]:_0x20f2e2[_0x224f('0x2f')];if(!_0x171aa7[_0x224f('0x2a')][_0x224f('0x42')](_0x224f('0x43'))){_0xf3ef9a[_0x224f('0x17')]=qs[_0x224f('0x17')](_0x171aa7['query'][_0x224f('0x17')]);_0xf3ef9a[_0x224f('0x18')]=qs[_0x224f('0x18')](_0x171aa7[_0x224f('0x2a')]['offset']);}_0xf3ef9a[_0x224f('0x44')]=qs[_0x224f('0x45')](_0x171aa7[_0x224f('0x2a')]['sort']);_0xf3ef9a[_0x224f('0x46')]=qs[_0x224f('0x33')](_[_0x224f('0x47')](_0x171aa7[_0x224f('0x2a')],_0x20f2e2[_0x224f('0x33')]));_0xf3ef9a[_0x224f('0x46')][_0x224f('0x48')]=_0xd1bf5c['id'];if(_0x171aa7[_0x224f('0x2a')][_0x224f('0x49')]){_0xf3ef9a[_0x224f('0x46')]=_[_0x224f('0x38')](_0xf3ef9a[_0x224f('0x46')],{'$or':_[_0x224f('0x4a')](_0xf3ef9a['attributes'],function(_0x4c390b){var _0x47ecab={};_0x47ecab[_0x4c390b]={'$like':'%'+_0x171aa7[_0x224f('0x2a')][_0x224f('0x49')]+'%'};return _0x47ecab;})});}if(_0x171aa7['query'][_0x224f('0x4b')]){var _0x39f337=_0x171aa7['query'][_0x224f('0x4b')][_0x224f('0x4c')](',');var _0x190ce8={};_0x190ce8[_0x39f337[0x0]]={'$gte':moment(_0x39f337[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xf3ef9a['where']=_[_0x224f('0x38')](_0xf3ef9a['where'],_0x190ce8);}_0xf3ef9a=_[_0x224f('0x38')]({},_0xf3ef9a,_0x171aa7[_0x224f('0x4d')]);return db[_0x224f('0x41')][_0x224f('0x19')]({'where':_0xf3ef9a['where']})[_0x224f('0x1e')](function(_0x3621bd){_0x58cc97[_0x224f('0x19')]=_0x3621bd;if(_0x171aa7[_0x224f('0x2a')]['includeAll']){_0xf3ef9a[_0x224f('0x4e')]=[{'all':!![]}];}return db[_0x224f('0x41')][_0x224f('0x29')](_0xf3ef9a);})[_0x224f('0x1e')](function(_0x4aabbc){_0x58cc97[_0x224f('0x4f')]=_0x4aabbc;return _0x58cc97;});}})[_0x224f('0x1e')](respondWithFilteredResult(_0x195c04,_0xf3ef9a))[_0x224f('0x2c')](handleError(_0x195c04,null));};exports[_0x224f('0x50')]=function(_0x3eb2f1,_0x2e99b8){return db[_0x224f('0x30')]['find']({'where':{'id':_0x3eb2f1['params']['id']}})[_0x224f('0x1e')](handleEntityNotFound(_0x2e99b8,null))[_0x224f('0x1e')](function(_0x2b3ff4){if(_0x2b3ff4){return _0x2b3ff4[_0x224f('0x51')](_0x3eb2f1[_0x224f('0x3a')][_0x224f('0x3e')],_['omit'](_0x3eb2f1[_0x224f('0x3a')],[_0x224f('0x3e'),'id'])||{})[_0x224f('0x52')](function(){return db[_0x224f('0x53')][_0x224f('0x29')]({'attributes':['id',_0x224f('0x22'),'color'],'where':{'id':_0x3eb2f1[_0x224f('0x3a')][_0x224f('0x3e')]}});})[_0x224f('0x1e')](function(_0x507580){socket[_0x224f('0x54')](_0x224f('0x55'),{'id':Number(_0x3eb2f1['params']['id']),'tags':_0x507580||[]});return{'id':Number(_0x3eb2f1[_0x224f('0x2e')]['id']),'tags':_0x507580||[]};});}})[_0x224f('0x1e')](respondWithResult(_0x2e99b8,null))[_0x224f('0x2c')](handleError(_0x2e99b8,null));};exports[_0x224f('0x56')]=function(_0x207b60,_0x124bc4){return db[_0x224f('0x30')][_0x224f('0x3b')]({'where':{'id':_0x207b60[_0x224f('0x2e')]['id']}})['then'](handleEntityNotFound(_0x124bc4,null))[_0x224f('0x1e')](function(_0x1968ca){if(_0x1968ca){return _0x1968ca[_0x224f('0x56')](_0x207b60['query'][_0x224f('0x3e')]);}})['then'](respondWithStatusCode(_0x124bc4,null))[_0x224f('0x2c')](handleError(_0x124bc4,null));};exports[_0x224f('0x57')]=function(_0x25fffb,_0x1b203f){var _0x40e45b=moment()[_0x224f('0x58')]()[_0x224f('0x59')]();var _0x487d09=path['join'](config[_0x224f('0x5a')],_0x224f('0x5b'),_0x224f('0x5c'),'tmp');var _0x4c7103=path[_0x224f('0x5d')](config[_0x224f('0x5a')],_0x224f('0x5b'),'files',_0x224f('0x5e'));var _0x511d3f=path[_0x224f('0x5d')](_0x487d09,_0x40e45b);var _0x4fde6b=util['format']('transcript-%d-%s.zip',_0x25fffb[_0x224f('0x2e')]['id'],_0x40e45b);var _0xeb1779=path['join'](_0x487d09,_0x4fde6b);var _0x1508b0=[];_0x1508b0[_0x224f('0x5f')]({'model':db[_0x224f('0x60')],'as':_0x224f('0x60'),'attributes':['id',_0x224f('0x61')],'raw':!![]});_0x1508b0[_0x224f('0x5f')]({'model':db['CmContact'],'as':_0x224f('0x62'),'attributes':['id',_0x224f('0x63'),_0x224f('0x64')],'raw':!![]});if(_0x25fffb['query'][_0x224f('0x5e')]){_0x1508b0[_0x224f('0x5f')]({'model':db[_0x224f('0x65')],'as':_0x224f('0x65'),'raw':!![]});}var _0x3f13e0=[{'model':db[_0x224f('0x41')],'as':_0x224f('0x66'),'attributes':['id',_0x224f('0x3a'),_0x224f('0x67'),'direction',_0x224f('0x68'),'read'],'include':_0x1508b0}];_0x3f13e0['push']({'model':db[_0x224f('0x69')],'as':_0x224f('0x6a'),'attributes':['id','name']});_0x3f13e0[_0x224f('0x5f')]({'model':db[_0x224f('0x60')],'as':_0x224f('0x6b'),'attributes':['id','fullname']});return db['WhatsappInteraction']['find']({'where':{'id':_0x25fffb['params']['id']},'include':_0x3f13e0})[_0x224f('0x1e')](handleEntityNotFound(_0x1b203f,null))['then'](function(_0x55f7ee){if(_0x55f7ee){var _0x4ef058=_0x55f7ee['get']({'plain':!![]});fs['mkdirSync'](_0x511d3f);var _0x27bc93={'channel':_0x224f('0x6c'),'account':_0x4ef058[_0x224f('0x6a')][_0x224f('0x22')],'agent':_0x4ef058[_0x224f('0x6b')]?_0x4ef058[_0x224f('0x6b')][_0x224f('0x61')]:'N.A.','createdAt':moment(_0x4ef058['createdAt'])[_0x224f('0x6d')](_0x224f('0x6e'))[_0x224f('0x59')](),'closedAt':_0x4ef058[_0x224f('0x6f')]?moment(_0x4ef058[_0x224f('0x70')])[_0x224f('0x6d')](_0x224f('0x6e'))['toString']():'','disposition':_0x4ef058[_0x224f('0x71')],'messages':_(_0x4ef058[_0x224f('0x66')])[_0x224f('0x49')]({'secret':![]})[_0x224f('0x4a')](function(_0x3a5898){if(_0x3a5898[_0x224f('0x65')]){var _0x5ede81=path[_0x224f('0x5d')](_0x4c7103,_0x3a5898[_0x224f('0x65')][_0x224f('0x72')]);if(fs['existsSync'](_0x5ede81)){fs[_0x224f('0x73')](_0x5ede81)['pipe'](fs['createWriteStream'](path['join'](_0x511d3f,_0x3a5898[_0x224f('0x65')]['basename'])));}}return{'date':moment(_0x3a5898[_0x224f('0x67')])[_0x224f('0x6d')](_0x224f('0x6e'))[_0x224f('0x59')](),'sender':_0x3a5898['direction']===_0x224f('0x74')?_0x3a5898['User']?_0x3a5898[_0x224f('0x60')][_0x224f('0x61')]:'System':_0x3a5898[_0x224f('0x62')][_0x224f('0x63')]+(_0x3a5898[_0x224f('0x62')][_0x224f('0x64')]?'\x20'+_0x3a5898['Contact']['lastName']:''),'body':_0x3a5898[_0x224f('0x65')]?_0x3a5898['Attachment'][_0x224f('0x72')]:_0x3a5898[_0x224f('0x3a')],'direction':_0x3a5898['direction']===_0x224f('0x74')?'A':'C','secret':_0x3a5898['secret'],'read':_0x3a5898['read'],'attachment':_0x3a5898['Attachment']};})[_0x224f('0x75')]()};return ejs[_0x224f('0x76')](path[_0x224f('0x5d')](config[_0x224f('0x5a')],_0x224f('0x5b'),'views',_0x224f('0x77')),{'interaction':_0x27bc93})[_0x224f('0x1e')](function(_0x15e529){var _0x1f8fe7=path['join'](_0x511d3f,_0x224f('0x78')+_0x4ef058['id']+'-'+_0x40e45b+'.pdf');var _0x1729b7={'path':_0x1f8fe7,'channel':_0x224f('0x6c'),'interactionId':_0x4ef058['id']};return pdf[_0x224f('0x79')](_0x15e529,_0x1729b7);})[_0x224f('0x1e')](function(){return new BPromise(function(_0x538b47,_0x4d0bad){zipdir(_0x511d3f,{'saveTo':_0xeb1779},function(_0x13955b,_0x1e072e){if(_0x13955b)return _0x4d0bad(_0x13955b);return _0x538b47(_0x1e072e);});})['then'](function(){return new BPromise(function(_0x3d4f0b,_0x2edf8e){rimraf(_0x511d3f,function(_0x2d6ad5){if(_0x2d6ad5)_0x2edf8e(_0x2d6ad5);return _0x3d4f0b();});});})[_0x224f('0x1e')](function(){return _0x1b203f[_0x224f('0x57')](_0xeb1779,_0x4fde6b,function(_0x515ef9){if(_0x515ef9){console['log'](_0x224f('0x7a'),_0x515ef9);}else{fs[_0x224f('0x7b')](_0xeb1779);}});});});}else{return _0x1b203f[_0x224f('0x1f')](0xc8);}})[_0x224f('0x2c')](handleError(_0x1b203f,null));}; \ No newline at end of file +var _0x2265=['direction','value','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','error','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName','query','then','catch','show','params','keys','filters','model','attributes','intersection','fields','length','options','find','create','body','describe','addMessage','WhatsappMessage','ids','omit','findOne','hasOwnProperty','order','sort','pick','where','WhatsappInteractionId','filter','merge','map','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','rows','addTags','spread','Tag','color','whatsappInteractionTags:save','removeTags','download','toString','join','server','files','root','attachments','transcript-%d-%s.zip','push','User','fullname','Contact','Attachment','Messages','secret','read','WhatsappAccount','Account','get','mkdirSync','Owner','N.A.','createdAt','format','closed','disposition','basename','existsSync','pipe','createWriteStream','out','firstName'];(function(_0x4bfa37,_0x59fc09){var _0x38ae3e=function(_0x504528){while(--_0x504528){_0x4bfa37['push'](_0x4bfa37['shift']());}};_0x38ae3e(++_0x59fc09);}(_0x2265,0xfa));var _0x5226=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x2265[_0x122096];return _0x3d1966;};'use strict';var rimraf=require(_0x5226('0x0'));var zipdir=require(_0x5226('0x1'));var moment=require(_0x5226('0x2'));var BPromise=require(_0x5226('0x3'));var util=require(_0x5226('0x4'));var path=require(_0x5226('0x5'));var ejs=require(_0x5226('0x6'));var fs=require('fs');var _=require(_0x5226('0x7'));var Redis=require(_0x5226('0x8'));var interaction=require(_0x5226('0x9'));var qs=require(_0x5226('0xa'));var pdf=require(_0x5226('0xb'));var logger=require(_0x5226('0xc'))(_0x5226('0xd'));var config=require(_0x5226('0xe'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x5226('0xf')],{'host':_0x5226('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5226('0xf')]));require(_0x5226('0x11'))[_0x5226('0x12')](socket);function respondWithStatusCode(_0x357812,_0x46fe07){_0x46fe07=_0x46fe07||0xcc;return function(_0x1cc4e0){if(_0x1cc4e0){return _0x357812[_0x5226('0x13')](_0x46fe07);}return _0x357812[_0x5226('0x14')](_0x46fe07)[_0x5226('0x15')]();};}function respondWithResult(_0x5be99e,_0x426d9e){_0x426d9e=_0x426d9e||0xc8;return function(_0x19c300){if(_0x19c300){return _0x5be99e[_0x5226('0x14')](_0x426d9e)['json'](_0x19c300);}};}function respondWithFilteredResult(_0xeed0c5,_0x5bb852){return function(_0x548a93){if(_0x548a93){var _0x46cfae=typeof _0x5bb852[_0x5226('0x16')]===_0x5226('0x17')&&typeof _0x5bb852[_0x5226('0x18')]===_0x5226('0x17');var _0xcbf98c=_0x548a93[_0x5226('0x19')];var _0x112b17=_0x46cfae?0x0:_0x5bb852[_0x5226('0x16')];var _0x5c5bfc=_0x46cfae?_0x548a93[_0x5226('0x19')]:_0x5bb852[_0x5226('0x16')]+_0x5bb852[_0x5226('0x18')];var _0x5e93b5;if(_0x5c5bfc>=_0xcbf98c){_0x5c5bfc=_0xcbf98c;_0x5e93b5=0xc8;}else{_0x5e93b5=0xce;}_0xeed0c5['status'](_0x5e93b5);return _0xeed0c5[_0x5226('0x1a')](_0x5226('0x1b'),_0x112b17+'-'+_0x5c5bfc+'/'+_0xcbf98c)[_0x5226('0x1c')](_0x548a93);}return null;};}function saveUpdates(_0x363d2a){return function(_0x496b83){if(_0x496b83){return _0x496b83['update'](_0x363d2a)['then'](function(_0x5b4244){return _0x5b4244;});}return null;};}function removeEntity(_0x53e905){return function(_0x48c3c3){if(_0x48c3c3){return _0x48c3c3[_0x5226('0x1d')]()['then'](function(){_0x53e905[_0x5226('0x14')](0xcc)[_0x5226('0x15')]();});}};}function handleEntityNotFound(_0x4378e5){return function(_0x312427){if(!_0x312427){_0x4378e5[_0x5226('0x13')](0x194);}return _0x312427;};}function handleError(_0x1bd036,_0x11e546){_0x11e546=_0x11e546||0x1f4;return function(_0x4b0e3e){logger[_0x5226('0x1e')](_0x4b0e3e[_0x5226('0x1f')]);if(_0x4b0e3e[_0x5226('0x20')]){delete _0x4b0e3e['name'];}_0x1bd036[_0x5226('0x14')](_0x11e546)[_0x5226('0x21')](_0x4b0e3e);};}exports[_0x5226('0x22')]=function(_0x317d91,_0x478c55){var _0x4656a1={};var _0x4a7f47=_['map'](db[_0x5226('0x23')][_0x5226('0x24')],function(_0x60b45c){return{'name':_0x60b45c[_0x5226('0x25')],'type':_0x60b45c['type']['key']};});_0x4656a1=qs['getOptions'](_0x4a7f47,_0x317d91);return interaction['findAll']('whatsapp',_0x317d91[_0x5226('0x26')],_0x317d91['user'],_0x4656a1,_0x4a7f47)[_0x5226('0x27')](respondWithFilteredResult(_0x478c55,_0x4656a1))[_0x5226('0x28')](handleError(_0x478c55,null));};exports[_0x5226('0x29')]=function(_0x4a2981,_0x5dba3e){var _0x333f81={'raw':![],'where':{'id':_0x4a2981[_0x5226('0x2a')]['id']}},_0x636bab={};_0x636bab['model']=_[_0x5226('0x2b')](db[_0x5226('0x23')][_0x5226('0x24')]);_0x636bab[_0x5226('0x26')]=_[_0x5226('0x2b')](_0x4a2981[_0x5226('0x26')]);_0x636bab[_0x5226('0x2c')]=_['intersection'](_0x636bab[_0x5226('0x2d')],_0x636bab[_0x5226('0x26')]);_0x333f81[_0x5226('0x2e')]=_[_0x5226('0x2f')](_0x636bab[_0x5226('0x2d')],qs['fields'](_0x4a2981[_0x5226('0x26')][_0x5226('0x30')]));_0x333f81[_0x5226('0x2e')]=_0x333f81[_0x5226('0x2e')][_0x5226('0x31')]?_0x333f81[_0x5226('0x2e')]:_0x636bab[_0x5226('0x2d')];if(_0x4a2981[_0x5226('0x26')]['includeAll']){_0x333f81['include']=[{'all':!![]}];}_0x333f81=_['merge']({},_0x333f81,_0x4a2981[_0x5226('0x32')]);return db[_0x5226('0x23')][_0x5226('0x33')](_0x333f81)[_0x5226('0x27')](handleEntityNotFound(_0x5dba3e,null))[_0x5226('0x27')](respondWithResult(_0x5dba3e,null))[_0x5226('0x28')](handleError(_0x5dba3e,null));};exports[_0x5226('0x34')]=function(_0x4d9ba3,_0x2a0f5e){return db[_0x5226('0x23')][_0x5226('0x34')](_0x4d9ba3[_0x5226('0x35')],{})[_0x5226('0x27')](respondWithResult(_0x2a0f5e,0xc9))['catch'](handleError(_0x2a0f5e,null));};exports['update']=function(_0x11411f,_0x4e5aef){if(_0x11411f[_0x5226('0x35')]['id']){delete _0x11411f[_0x5226('0x35')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x11411f['params']['id']}})[_0x5226('0x27')](handleEntityNotFound(_0x4e5aef,null))[_0x5226('0x27')](saveUpdates(_0x11411f['body'],null))[_0x5226('0x27')](respondWithResult(_0x4e5aef,null))[_0x5226('0x28')](handleError(_0x4e5aef,null));};exports[_0x5226('0x1d')]=function(_0x585c76,_0x56b285){return db[_0x5226('0x23')]['find']({'where':{'id':_0x585c76[_0x5226('0x2a')]['id']}})[_0x5226('0x27')](handleEntityNotFound(_0x56b285,null))[_0x5226('0x27')](removeEntity(_0x56b285,null))[_0x5226('0x28')](handleError(_0x56b285,null));};exports[_0x5226('0x36')]=function(_0x534e0c,_0x341643){return db[_0x5226('0x23')][_0x5226('0x36')]()[_0x5226('0x27')](respondWithResult(_0x341643,null))[_0x5226('0x28')](handleError(_0x341643,null));};exports[_0x5226('0x37')]=function(_0x5cc4d8,_0x5336b5){return db[_0x5226('0x38')][_0x5226('0x33')]({'where':{'id':_0x5cc4d8[_0x5226('0x2a')]['id']}})[_0x5226('0x27')](handleEntityNotFound(_0x5336b5,null))['then'](function(_0x4f2b0a){if(_0x4f2b0a){return _0x4f2b0a[_0x5226('0x37')](_0x5cc4d8['body'][_0x5226('0x39')],_[_0x5226('0x3a')](_0x5cc4d8[_0x5226('0x35')],[_0x5226('0x39'),'id'])||{});}})[_0x5226('0x27')](respondWithResult(_0x5336b5,null))['catch'](handleError(_0x5336b5,null));};exports['getMessages']=function(_0x2ce391,_0x55d2ab){var _0x32474f={'raw':![],'where':{}};var _0x4c6ac9={};var _0x5d71d6={'count':0x0,'rows':[]};return db[_0x5226('0x23')][_0x5226('0x3b')]({'where':{'id':_0x2ce391[_0x5226('0x2a')]['id']}})[_0x5226('0x27')](handleEntityNotFound(_0x55d2ab,null))['then'](function(_0x2b4d10){if(_0x2b4d10){_0x4c6ac9[_0x5226('0x2d')]=_[_0x5226('0x2b')](db[_0x5226('0x38')]['rawAttributes']);_0x4c6ac9[_0x5226('0x26')]=_[_0x5226('0x2b')](_0x2ce391[_0x5226('0x26')]);_0x4c6ac9[_0x5226('0x2c')]=_[_0x5226('0x2f')](_0x4c6ac9['model'],_0x4c6ac9[_0x5226('0x26')]);_0x32474f[_0x5226('0x2e')]=_[_0x5226('0x2f')](_0x4c6ac9[_0x5226('0x2d')],qs[_0x5226('0x30')](_0x2ce391[_0x5226('0x26')][_0x5226('0x30')]));_0x32474f['attributes']=_0x32474f['attributes'][_0x5226('0x31')]?_0x32474f[_0x5226('0x2e')]:_0x4c6ac9[_0x5226('0x2d')];if(!_0x2ce391[_0x5226('0x26')][_0x5226('0x3c')]('nolimit')){_0x32474f[_0x5226('0x18')]=qs[_0x5226('0x18')](_0x2ce391[_0x5226('0x26')][_0x5226('0x18')]);_0x32474f[_0x5226('0x16')]=qs['offset'](_0x2ce391[_0x5226('0x26')][_0x5226('0x16')]);}_0x32474f[_0x5226('0x3d')]=qs[_0x5226('0x3e')](_0x2ce391[_0x5226('0x26')]['sort']);_0x32474f['where']=qs[_0x5226('0x2c')](_[_0x5226('0x3f')](_0x2ce391['query'],_0x4c6ac9[_0x5226('0x2c')]));_0x32474f[_0x5226('0x40')][_0x5226('0x41')]=_0x2b4d10['id'];if(_0x2ce391['query'][_0x5226('0x42')]){_0x32474f['where']=_[_0x5226('0x43')](_0x32474f[_0x5226('0x40')],{'$or':_[_0x5226('0x44')](_0x32474f[_0x5226('0x2e')],function(_0x2e8650){var _0x7af7a0={};_0x7af7a0[_0x2e8650]={'$like':'%'+_0x2ce391[_0x5226('0x26')][_0x5226('0x42')]+'%'};return _0x7af7a0;})});}if(_0x2ce391[_0x5226('0x26')][_0x5226('0x45')]){var _0x1768fc=_0x2ce391['query'][_0x5226('0x45')]['split'](',');var _0x1e3cd9={};_0x1e3cd9[_0x1768fc[0x0]]={'$gte':moment(_0x1768fc[0x1])['format'](_0x5226('0x46'))};_0x32474f[_0x5226('0x40')]=_[_0x5226('0x43')](_0x32474f['where'],_0x1e3cd9);}_0x32474f=_[_0x5226('0x43')]({},_0x32474f,_0x2ce391['options']);return db[_0x5226('0x38')][_0x5226('0x19')]({'where':_0x32474f[_0x5226('0x40')]})[_0x5226('0x27')](function(_0x70564b){_0x5d71d6['count']=_0x70564b;if(_0x2ce391['query'][_0x5226('0x47')]){_0x32474f[_0x5226('0x48')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x5226('0x49')](_0x32474f);})['then'](function(_0x2a46a7){_0x5d71d6[_0x5226('0x4a')]=_0x2a46a7;return _0x5d71d6;});}})['then'](respondWithFilteredResult(_0x55d2ab,_0x32474f))[_0x5226('0x28')](handleError(_0x55d2ab,null));};exports[_0x5226('0x4b')]=function(_0x3684c6,_0x13539b){return db[_0x5226('0x23')][_0x5226('0x33')]({'where':{'id':_0x3684c6[_0x5226('0x2a')]['id']}})['then'](handleEntityNotFound(_0x13539b,null))['then'](function(_0x41c74e){if(_0x41c74e){return _0x41c74e['setTags'](_0x3684c6[_0x5226('0x35')][_0x5226('0x39')],_[_0x5226('0x3a')](_0x3684c6[_0x5226('0x35')],[_0x5226('0x39'),'id'])||{})[_0x5226('0x4c')](function(){return db[_0x5226('0x4d')]['findAll']({'attributes':['id',_0x5226('0x20'),_0x5226('0x4e')],'where':{'id':_0x3684c6['body'][_0x5226('0x39')]}});})['then'](function(_0x10eeb8){socket['emit'](_0x5226('0x4f'),{'id':Number(_0x3684c6['params']['id']),'tags':_0x10eeb8||[]});return{'id':Number(_0x3684c6[_0x5226('0x2a')]['id']),'tags':_0x10eeb8||[]};});}})['then'](respondWithResult(_0x13539b,null))[_0x5226('0x28')](handleError(_0x13539b,null));};exports[_0x5226('0x50')]=function(_0x54d851,_0x1de7de){return db[_0x5226('0x23')][_0x5226('0x33')]({'where':{'id':_0x54d851[_0x5226('0x2a')]['id']}})[_0x5226('0x27')](handleEntityNotFound(_0x1de7de,null))[_0x5226('0x27')](function(_0x404e4c){if(_0x404e4c){return _0x404e4c[_0x5226('0x50')](_0x54d851[_0x5226('0x26')]['ids']);}})[_0x5226('0x27')](respondWithStatusCode(_0x1de7de,null))['catch'](handleError(_0x1de7de,null));};exports[_0x5226('0x51')]=function(_0x248374,_0x5a3c79){var _0x4985f8=moment()['unix']()[_0x5226('0x52')]();var _0x186b5f=path[_0x5226('0x53')](config['root'],_0x5226('0x54'),_0x5226('0x55'),'tmp');var _0x39c8f1=path[_0x5226('0x53')](config[_0x5226('0x56')],_0x5226('0x54'),_0x5226('0x55'),_0x5226('0x57'));var _0x29e1c7=path[_0x5226('0x53')](_0x186b5f,_0x4985f8);var _0x528e13=util['format'](_0x5226('0x58'),_0x248374[_0x5226('0x2a')]['id'],_0x4985f8);var _0x5069de=path[_0x5226('0x53')](_0x186b5f,_0x528e13);var _0x1a42ef=[];_0x1a42ef[_0x5226('0x59')]({'model':db['User'],'as':_0x5226('0x5a'),'attributes':['id',_0x5226('0x5b')],'raw':!![]});_0x1a42ef[_0x5226('0x59')]({'model':db['CmContact'],'as':_0x5226('0x5c'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x248374['query'][_0x5226('0x57')]){_0x1a42ef[_0x5226('0x59')]({'model':db[_0x5226('0x5d')],'as':_0x5226('0x5d'),'raw':!![]});}var _0x20de6b=[{'model':db[_0x5226('0x38')],'as':_0x5226('0x5e'),'attributes':['id','body','createdAt','direction',_0x5226('0x5f'),_0x5226('0x60')],'include':_0x1a42ef}];_0x20de6b['push']({'model':db[_0x5226('0x61')],'as':_0x5226('0x62'),'attributes':['id','name']});_0x20de6b[_0x5226('0x59')]({'model':db[_0x5226('0x5a')],'as':'Owner','attributes':['id',_0x5226('0x5b')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x248374[_0x5226('0x2a')]['id']},'include':_0x20de6b})[_0x5226('0x27')](handleEntityNotFound(_0x5a3c79,null))[_0x5226('0x27')](function(_0x26a904){if(_0x26a904){var _0x408721=_0x26a904[_0x5226('0x63')]({'plain':!![]});fs[_0x5226('0x64')](_0x29e1c7);var _0x44add0={'channel':'Whatsapp','account':_0x408721[_0x5226('0x62')][_0x5226('0x20')],'agent':_0x408721[_0x5226('0x65')]?_0x408721['Owner'][_0x5226('0x5b')]:_0x5226('0x66'),'createdAt':moment(_0x408721[_0x5226('0x67')])[_0x5226('0x68')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5226('0x52')](),'closedAt':_0x408721[_0x5226('0x69')]?moment(_0x408721['closedAt'])['format'](_0x5226('0x46'))[_0x5226('0x52')]():'','disposition':_0x408721[_0x5226('0x6a')],'messages':_(_0x408721[_0x5226('0x5e')])[_0x5226('0x42')]({'secret':![]})[_0x5226('0x44')](function(_0x1a353f){if(_0x1a353f[_0x5226('0x5d')]){var _0x24d646=path['join'](_0x39c8f1,_0x1a353f['Attachment'][_0x5226('0x6b')]);if(fs[_0x5226('0x6c')](_0x24d646)){fs['createReadStream'](_0x24d646)[_0x5226('0x6d')](fs[_0x5226('0x6e')](path[_0x5226('0x53')](_0x29e1c7,_0x1a353f[_0x5226('0x5d')][_0x5226('0x6b')])));}}return{'date':moment(_0x1a353f[_0x5226('0x67')])['format'](_0x5226('0x46'))[_0x5226('0x52')](),'sender':_0x1a353f['direction']===_0x5226('0x6f')?_0x1a353f[_0x5226('0x5a')]?_0x1a353f['User'][_0x5226('0x5b')]:'System':_0x1a353f[_0x5226('0x5c')][_0x5226('0x70')]+(_0x1a353f['Contact']['lastName']?'\x20'+_0x1a353f[_0x5226('0x5c')]['lastName']:''),'body':_0x1a353f[_0x5226('0x5d')]?_0x1a353f[_0x5226('0x5d')][_0x5226('0x6b')]:_0x1a353f['body'],'direction':_0x1a353f[_0x5226('0x71')]===_0x5226('0x6f')?'A':'C','secret':_0x1a353f['secret'],'read':_0x1a353f['read'],'attachment':_0x1a353f[_0x5226('0x5d')]};})[_0x5226('0x72')]()};return ejs[_0x5226('0x73')](path['join'](config[_0x5226('0x56')],_0x5226('0x54'),'views',_0x5226('0x74')),{'interaction':_0x44add0})['then'](function(_0x5d49e1){var _0x1c35fc=path[_0x5226('0x53')](_0x29e1c7,'transcript-'+_0x408721['id']+'-'+_0x4985f8+_0x5226('0x75'));var _0x4083e7={'path':_0x1c35fc,'channel':'Whatsapp','interactionId':_0x408721['id']};return pdf[_0x5226('0x76')](_0x5d49e1,_0x4083e7);})[_0x5226('0x27')](function(){return new BPromise(function(_0x32786e,_0x455be7){zipdir(_0x29e1c7,{'saveTo':_0x5069de},function(_0x45b930,_0x2be3b4){if(_0x45b930)return _0x455be7(_0x45b930);return _0x32786e(_0x2be3b4);});})[_0x5226('0x27')](function(){return new BPromise(function(_0x1c7f20,_0x1dc2e5){rimraf(_0x29e1c7,function(_0x5abece){if(_0x5abece)_0x1dc2e5(_0x5abece);return _0x1c7f20();});});})[_0x5226('0x27')](function(){return _0x5a3c79[_0x5226('0x51')](_0x5069de,_0x528e13,function(_0x5ed7bc){if(_0x5ed7bc){console[_0x5226('0x77')](_0x5226('0x78'),_0x5ed7bc);}else{fs['unlinkSync'](_0x5069de);}});});});}else{return _0x5a3c79['sendStatus'](0xc8);}})[_0x5226('0x28')](handleError(_0x5a3c79,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index d4aa556..9dad493 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 _0xda3f=['setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappInteraction','save','remove'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xda3f,0xec));var _0xfda3=function(_0x4a72d8,_0x5ee2b5){_0x4a72d8=_0x4a72d8-0x0;var _0x41860d=_0xda3f[_0x4a72d8];return _0x41860d;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xfda3('0x0'))['db'][_0xfda3('0x1')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfda3('0x2'),'afterUpdate':'update','afterDestroy':_0xfda3('0x3')};function emitEvent(_0x22187d){return function(_0x516500,_0x42bd74,_0x43a010){_0x516500['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x316792){_0x516500[_0xfda3('0x4')](_0xfda3('0x5'),_0x316792[_0xfda3('0x6')](function(_0x7bb490){return{'id':_0x7bb490['id']};}));return WhatsappMessage[_0xfda3('0x7')]({'where':{'WhatsappInteractionId':_0x516500['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfda3('0x8')](function(_0x1b1ea6){_0x516500[_0xfda3('0x4')](_0xfda3('0x9'),_0x1b1ea6[_0xfda3('0xa')]);WhatsappInteractionEvents[_0xfda3('0xb')](_0x22187d+':'+_0x516500['id'],_0x516500);WhatsappInteractionEvents['emit'](_0x22187d,_0x516500);_0x43a010(null);})[_0xfda3('0xc')](_0x43a010(null));};}for(var e in events){if(events[_0xfda3('0xd')](e)){var event=events[e];WhatsappInteraction[_0xfda3('0xe')](e,emitEvent(event));}}module[_0xfda3('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xe600=['setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','then'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0xe600,0x159));var _0x0e60=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe600[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x0e60('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x0e60('0x0'))['db'][_0x0e60('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x0e60('0x2')](0x0);var events={'afterCreate':_0x0e60('0x3'),'afterUpdate':_0x0e60('0x4'),'afterDestroy':_0x0e60('0x5')};function emitEvent(_0x1838bf){return function(_0x1ca309,_0xc730ea,_0x2f9c33){_0x1ca309['getUsers']({'attributes':['id'],'raw':!![]})[_0x0e60('0x6')](function(_0x497a61){_0x1ca309[_0x0e60('0x7')](_0x0e60('0x8'),_0x497a61['map'](function(_0x3577c5){return{'id':_0x3577c5['id']};}));return WhatsappMessage[_0x0e60('0x9')]({'where':{'WhatsappInteractionId':_0x1ca309['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0e60('0x6')](function(_0x420063){_0x1ca309[_0x0e60('0x7')](_0x0e60('0xa'),_0x420063['length']);WhatsappInteractionEvents[_0x0e60('0xb')](_0x1838bf+':'+_0x1ca309['id'],_0x1ca309);WhatsappInteractionEvents[_0x0e60('0xb')](_0x1838bf,_0x1ca309);_0x2f9c33(null);})[_0x0e60('0xc')](_0x2f9c33(null));};}for(var e in events){if(events[_0x0e60('0xd')](e)){var event=events[e];WhatsappInteraction[_0x0e60('0xe')](e,emitEvent(event));}}module[_0x0e60('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index df6d493..41076f8 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 _0x0377=['changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappInteraction'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0377,0x1cf));var _0x7037=function(_0x5b5a1b,_0x1516ae){_0x5b5a1b=_0x5b5a1b-0x0;var _0x508207=_0x0377[_0x5b5a1b];return _0x508207;};'use strict';var _=require(_0x7037('0x0'));var util=require(_0x7037('0x1'));var logger=require(_0x7037('0x2'))(_0x7037('0x3'));var moment=require(_0x7037('0x4'));var BPromise=require(_0x7037('0x5'));var rp=require(_0x7037('0x6'));var fs=require('fs');var path=require(_0x7037('0x7'));var rimraf=require(_0x7037('0x8'));var config=require(_0x7037('0x9'));var attributes=require('./whatsappInteraction.attributes');module[_0x7037('0xa')]=function(_0x574f4e,_0x2e98f5){return _0x574f4e[_0x7037('0xb')](_0x7037('0xc'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f7cf2,_0x5edc20,_0x23cafd){if(_0x4f7cf2[_0x7037('0xd')](_0x7037('0xe'))){_0x4f7cf2[_0x7037('0xf')]=moment()[_0x7037('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x23cafd(null,_0x4f7cf2);}}});}; \ No newline at end of file +var _0x3bb7=['whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0x3bb7,0x157));var _0x73bb=function(_0x1f6835,_0xff3520){_0x1f6835=_0x1f6835-0x0;var _0x10aee2=_0x3bb7[_0x1f6835];return _0x10aee2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x73bb('0x0'))(_0x73bb('0x1'));var moment=require('moment');var BPromise=require(_0x73bb('0x2'));var rp=require(_0x73bb('0x3'));var fs=require('fs');var path=require(_0x73bb('0x4'));var rimraf=require('rimraf');var config=require(_0x73bb('0x5'));var attributes=require(_0x73bb('0x6'));module['exports']=function(_0x374e58,_0x1e7e8b){return _0x374e58['define'](_0x73bb('0x7'),attributes,{'tableName':_0x73bb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2bfe65,_0x23c1f7,_0x1574d4){if(_0x2bfe65[_0x73bb('0x9')](_0x73bb('0xa'))){_0x2bfe65['closedAt']=moment()[_0x73bb('0xb')](_0x73bb('0xc'));}_0x1574d4(null,_0x2bfe65);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index bf1ed6d..abe00e0 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 _0xdfff=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','raw','where','limit','AddTagsToWhatsappInteraction','addTags','ids','body','spread','AddTags','lodash','util','bluebird'];(function(_0x27d1e3,_0x3a8748){var _0x2c8095=function(_0x52206a){while(--_0x52206a){_0x27d1e3['push'](_0x27d1e3['shift']());}};_0x2c8095(++_0x3a8748);}(_0xdfff,0x115));var _0xfdff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdfff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfdff('0x0'));var util=require(_0xfdff('0x1'));var moment=require('moment');var BPromise=require(_0xfdff('0x2'));var rs=require(_0xfdff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfdff('0x4'))['db'];var utils=require(_0xfdff('0x5'));var logger=require(_0xfdff('0x6'))(_0xfdff('0x7'));var config=require('../../config/environment');var jayson=require(_0xfdff('0x8'));var client=jayson[_0xfdff('0x9')][_0xfdff('0xa')]({'port':0x232a});config['redis']=_[_0xfdff('0xb')](config[_0xfdff('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdff('0xd'))(new Redis(config['redis']));require(_0xfdff('0xe'))[_0xfdff('0xf')](socket);function respondWithRpcPromise(_0x467e97,_0x35021a,_0xcadb84){return new BPromise(function(_0x33d58c,_0x308e4d){return client[_0xfdff('0x10')](_0x467e97,_0xcadb84)[_0xfdff('0x11')](function(_0x54813d){logger[_0xfdff('0x12')](_0xfdff('0x13'),_0x35021a,_0xfdff('0x14'));logger[_0xfdff('0x15')](_0xfdff('0x16'),_0x35021a,'request\x20sent',JSON[_0xfdff('0x17')](_0x54813d));if(_0x54813d[_0xfdff('0x18')]){if(_0x54813d[_0xfdff('0x18')][_0xfdff('0x19')]===0x1f4){logger['error'](_0xfdff('0x13'),_0x35021a,_0x54813d[_0xfdff('0x18')][_0xfdff('0x1a')]);return _0x308e4d(_0x54813d[_0xfdff('0x18')][_0xfdff('0x1a')]);}logger[_0xfdff('0x18')](_0xfdff('0x13'),_0x35021a,_0x54813d['error'][_0xfdff('0x1a')]);return _0x33d58c(_0x54813d['error'][_0xfdff('0x1a')]);}else{logger[_0xfdff('0x12')](_0xfdff('0x13'),_0x35021a,_0xfdff('0x14'));_0x33d58c(_0x54813d['result']['message']);}})[_0xfdff('0x1b')](function(_0x779c4e){logger['error'](_0xfdff('0x13'),_0x35021a,_0x779c4e);_0x308e4d(_0x779c4e);});});}exports[_0xfdff('0x1c')]=function(_0x5b93ae){var _0xbbb6d5=this;return new Promise(function(_0xc80455,_0x47ceee){return db[_0xfdff('0x1d')]['update'](_0x5b93ae['body'],{'raw':_0x5b93ae['options']?_0x5b93ae[_0xfdff('0x1e')][_0xfdff('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b93ae[_0xfdff('0x1e')]?_0x5b93ae[_0xfdff('0x1e')][_0xfdff('0x20')]||null:null,'attributes':_0x5b93ae['options']?_0x5b93ae['options']['attributes']||null:null,'limit':_0x5b93ae[_0xfdff('0x1e')]?_0x5b93ae[_0xfdff('0x1e')][_0xfdff('0x21')]||null:null})[_0xfdff('0x11')](function(_0x3edfb0){logger['info'](_0xfdff('0x1c'),_0x5b93ae);logger['debug'](_0xfdff('0x1c'),_0x5b93ae,JSON[_0xfdff('0x17')](_0x3edfb0));_0xc80455(_0x3edfb0);})[_0xfdff('0x1b')](function(_0x30b4cf){logger[_0xfdff('0x18')]('UpdateWhatsappInteraction',_0x30b4cf[_0xfdff('0x1a')],_0x5b93ae);_0x47ceee(_0xbbb6d5[_0xfdff('0x18')](0x1f4,_0x30b4cf[_0xfdff('0x1a')]));});});};exports[_0xfdff('0x22')]=function(_0x4de01c){return new Promise(function(_0x1726ee,_0x3c7b6f){return db[_0xfdff('0x1d')]['find']({'where':_0x4de01c[_0xfdff('0x1e')]?_0x4de01c[_0xfdff('0x1e')][_0xfdff('0x20')]||null:null})[_0xfdff('0x11')](function(_0x37fab1){if(_0x37fab1){return _0x37fab1[_0xfdff('0x23')](_0x4de01c['body'][_0xfdff('0x24')],_['omit'](_0x4de01c[_0xfdff('0x25')],[_0xfdff('0x24'),'id'])||{});}})[_0xfdff('0x26')](function(_0xf216b5){logger[_0xfdff('0x12')](_0xfdff('0x27'),_0x4de01c);logger[_0xfdff('0x15')](_0xfdff('0x27'),_0x4de01c,JSON['stringify'](_0xf216b5));_0x1726ee(_0xf216b5);})[_0xfdff('0x1b')](function(_0x21420f){logger[_0xfdff('0x18')](_0xfdff('0x27'),_0x21420f[_0xfdff('0x1a')],_0x4de01c);_0x3c7b6f(_this[_0xfdff('0x18')](0x1f4,_0x21420f['message']));});});}; \ No newline at end of file +var _0x3459=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','WhatsappInteraction,\x20%s,\x20%s','UpdateWhatsappInteraction','update','body','options','raw','attributes','AddTagsToWhatsappInteraction','WhatsappInteraction','where','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3ce4a5,_0x50bc4b){var _0x3f5809=function(_0x2f5b78){while(--_0x2f5b78){_0x3ce4a5['push'](_0x3ce4a5['shift']());}};_0x3f5809(++_0x50bc4b);}(_0x3459,0x147));var _0x9345=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3459[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x9345('0x0'));var util=require(_0x9345('0x1'));var moment=require('moment');var BPromise=require(_0x9345('0x2'));var rs=require(_0x9345('0x3'));var fs=require('fs');var Redis=require(_0x9345('0x4'));var db=require(_0x9345('0x5'))['db'];var utils=require(_0x9345('0x6'));var logger=require('../../config/logger')(_0x9345('0x7'));var config=require(_0x9345('0x8'));var jayson=require(_0x9345('0x9'));var client=jayson[_0x9345('0xa')][_0x9345('0xb')]({'port':0x232a});config[_0x9345('0xc')]=_[_0x9345('0xd')](config['redis'],{'host':_0x9345('0xe'),'port':0x18eb});var socket=require(_0x9345('0xf'))(new Redis(config[_0x9345('0xc')]));require(_0x9345('0x10'))[_0x9345('0x11')](socket);function respondWithRpcPromise(_0x4f27f5,_0xda994d,_0x5e2c6d){return new BPromise(function(_0x353c9e,_0x41c9d8){return client[_0x9345('0x12')](_0x4f27f5,_0x5e2c6d)[_0x9345('0x13')](function(_0x772811){logger[_0x9345('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0xda994d,_0x9345('0x15'));logger[_0x9345('0x16')](_0x9345('0x17'),_0xda994d,_0x9345('0x15'),JSON[_0x9345('0x18')](_0x772811));if(_0x772811[_0x9345('0x19')]){if(_0x772811[_0x9345('0x19')]['code']===0x1f4){logger[_0x9345('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0xda994d,_0x772811[_0x9345('0x19')][_0x9345('0x1a')]);return _0x41c9d8(_0x772811[_0x9345('0x19')]['message']);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0xda994d,_0x772811[_0x9345('0x19')][_0x9345('0x1a')]);return _0x353c9e(_0x772811[_0x9345('0x19')]['message']);}else{logger[_0x9345('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0xda994d,'request\x20sent');_0x353c9e(_0x772811['result'][_0x9345('0x1a')]);}})[_0x9345('0x1b')](function(_0x1ca2c7){logger['error'](_0x9345('0x1c'),_0xda994d,_0x1ca2c7);_0x41c9d8(_0x1ca2c7);});});}exports[_0x9345('0x1d')]=function(_0x366a83){var _0x3e6df6=this;return new Promise(function(_0x274e90,_0x368b29){return db['WhatsappInteraction'][_0x9345('0x1e')](_0x366a83[_0x9345('0x1f')],{'raw':_0x366a83[_0x9345('0x20')]?_0x366a83[_0x9345('0x20')][_0x9345('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x366a83[_0x9345('0x20')]?_0x366a83[_0x9345('0x20')]['where']||null:null,'attributes':_0x366a83[_0x9345('0x20')]?_0x366a83[_0x9345('0x20')][_0x9345('0x22')]||null:null,'limit':_0x366a83['options']?_0x366a83[_0x9345('0x20')]['limit']||null:null})[_0x9345('0x13')](function(_0x9db29a){logger[_0x9345('0x14')](_0x9345('0x1d'),_0x366a83);logger[_0x9345('0x16')](_0x9345('0x1d'),_0x366a83,JSON[_0x9345('0x18')](_0x9db29a));_0x274e90(_0x9db29a);})[_0x9345('0x1b')](function(_0x40ffef){logger[_0x9345('0x19')](_0x9345('0x1d'),_0x40ffef['message'],_0x366a83);_0x368b29(_0x3e6df6['error'](0x1f4,_0x40ffef[_0x9345('0x1a')]));});});};exports[_0x9345('0x23')]=function(_0x41b11f){return new Promise(function(_0x272162,_0x360417){return db[_0x9345('0x24')]['find']({'where':_0x41b11f[_0x9345('0x20')]?_0x41b11f[_0x9345('0x20')][_0x9345('0x25')]||null:null})[_0x9345('0x13')](function(_0x4aaa7f){if(_0x4aaa7f){return _0x4aaa7f[_0x9345('0x26')](_0x41b11f[_0x9345('0x1f')][_0x9345('0x27')],_[_0x9345('0x28')](_0x41b11f[_0x9345('0x1f')],[_0x9345('0x27'),'id'])||{});}})['spread'](function(_0x37a086){logger['info'](_0x9345('0x29'),_0x41b11f);logger[_0x9345('0x16')](_0x9345('0x29'),_0x41b11f,JSON[_0x9345('0x18')](_0x37a086));_0x272162(_0x37a086);})[_0x9345('0x1b')](function(_0x421e33){logger['error'](_0x9345('0x29'),_0x421e33[_0x9345('0x1a')],_0x41b11f);_0x360417(_this[_0x9345('0x19')](0x1f4,_0x421e33['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index df7a7d7..cfb416a 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 _0xa315=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','emit','removeListener'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa315,0x1e6));var _0x5a31=function(_0x574617,_0x42eccc){_0x574617=_0x574617-0x0;var _0x29de90=_0xa315[_0x574617];return _0x29de90;};'use strict';var WhatsappInteractionEvents=require(_0x5a31('0x0'));var events=[_0x5a31('0x1'),'remove','update'];function createListener(_0x279014,_0x45d99b){return function(_0x32f410){_0x45d99b[_0x5a31('0x2')](_0x279014,_0x32f410);};}function removeListener(_0xb82033,_0xea09f8){return function(){WhatsappInteractionEvents[_0x5a31('0x3')](_0xb82033,_0xea09f8);};}exports[_0x5a31('0x4')]=function(_0x4dd034){for(var _0x2835f5=0x0,_0x1e473c=events[_0x5a31('0x5')];_0x2835f5<_0x1e473c;_0x2835f5++){var _0x4270ed=events[_0x2835f5];var _0x39fc61=createListener(_0x5a31('0x6')+_0x4270ed,_0x4dd034);WhatsappInteractionEvents['on'](_0x4270ed,_0x39fc61);}}; \ No newline at end of file +var _0xd12b=['register','length','whatsappInteraction:','./whatsappInteraction.events','remove','update','emit','removeListener'];(function(_0x28ec2f,_0x4b3c5d){var _0x16e0fa=function(_0x40d7a7){while(--_0x40d7a7){_0x28ec2f['push'](_0x28ec2f['shift']());}};_0x16e0fa(++_0x4b3c5d);}(_0xd12b,0x83));var _0xbd12=function(_0x537c37,_0x536e74){_0x537c37=_0x537c37-0x0;var _0x241f84=_0xd12b[_0x537c37];return _0x241f84;};'use strict';var WhatsappInteractionEvents=require(_0xbd12('0x0'));var events=['save',_0xbd12('0x1'),_0xbd12('0x2')];function createListener(_0x24429c,_0x3d3fcd){return function(_0xb9811e){_0x3d3fcd[_0xbd12('0x3')](_0x24429c,_0xb9811e);};}function removeListener(_0x30eb03,_0x31246f){return function(){WhatsappInteractionEvents[_0xbd12('0x4')](_0x30eb03,_0x31246f);};}exports[_0xbd12('0x5')]=function(_0x2fb720){for(var _0x270100=0x0,_0x231cdd=events[_0xbd12('0x6')];_0x270100<_0x231cdd;_0x270100++){var _0x4a7523=events[_0x270100];var _0x5811f3=createListener(_0xbd12('0x7')+_0x4a7523,_0x2fb720);WhatsappInteractionEvents['on'](_0x4a7523,_0x5811f3);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 9a2bc0a..4489b23 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 _0x245c=['exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','create','/:id/status','status','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x245c,0x11f));var _0xc245=function(_0x5eefdf,_0x174e80){_0x5eefdf=_0x5eefdf-0x0;var _0x4d4e86=_0x245c[_0x5eefdf];return _0x4d4e86;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc245('0x0'));var router=express[_0xc245('0x1')]();var fs_extra=require(_0xc245('0x2'));var auth=require(_0xc245('0x3'));var interaction=require(_0xc245('0x4'));var config=require(_0xc245('0x5'));var controller=require(_0xc245('0x6'));router[_0xc245('0x7')]('/',auth[_0xc245('0x8')](),controller['index']);router['get'](_0xc245('0x9'),auth[_0xc245('0x8')](),controller[_0xc245('0xa')]);router[_0xc245('0x7')]('/:id',auth[_0xc245('0x8')](),controller[_0xc245('0xb')]);router[_0xc245('0xc')]('/',auth[_0xc245('0x8')](),interaction[_0xc245('0xd')]('whatsapp','whatsappmessage:create'),controller[_0xc245('0xe')]);router['post'](_0xc245('0xf'),controller[_0xc245('0x10')]);router[_0xc245('0x11')](_0xc245('0x12'),auth[_0xc245('0x8')](),controller['update']);router['put'](_0xc245('0x13'),auth[_0xc245('0x8')](),controller[_0xc245('0x14')]);router[_0xc245('0x11')](_0xc245('0x15'),auth[_0xc245('0x8')](),controller[_0xc245('0x16')]);router[_0xc245('0x17')]('/:id',auth[_0xc245('0x8')](),controller[_0xc245('0x18')]);module[_0xc245('0x19')]=router; \ No newline at end of file +var _0x5d96=['Router','../../components/auth/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','update','accept','/:id/reject','delete','exports','multer','connect-timeout','express'];(function(_0x2bdc20,_0x9de9a3){var _0x48ff68=function(_0x54c1b3){while(--_0x54c1b3){_0x2bdc20['push'](_0x2bdc20['shift']());}};_0x48ff68(++_0x9de9a3);}(_0x5d96,0x14d));var _0x65d9=function(_0x298eb7,_0x39cd4d){_0x298eb7=_0x298eb7-0x0;var _0x53b5f1=_0x5d96[_0x298eb7];return _0x53b5f1;};'use strict';var multer=require(_0x65d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x65d9('0x1'));var express=require(_0x65d9('0x2'));var router=express[_0x65d9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x65d9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x65d9('0x5'));var controller=require(_0x65d9('0x6'));router['get']('/',auth[_0x65d9('0x7')](),controller[_0x65d9('0x8')]);router['get']('/describe',auth[_0x65d9('0x7')](),controller['describe']);router[_0x65d9('0x9')](_0x65d9('0xa'),auth['isAuthenticated'](),controller[_0x65d9('0xb')]);router[_0x65d9('0xc')]('/',auth[_0x65d9('0x7')](),interaction[_0x65d9('0xd')](_0x65d9('0xe'),_0x65d9('0xf')),controller[_0x65d9('0x10')]);router[_0x65d9('0xc')](_0x65d9('0x11'),controller['status']);router[_0x65d9('0x12')](_0x65d9('0xa'),auth[_0x65d9('0x7')](),controller[_0x65d9('0x13')]);router['put']('/:id/accept',auth[_0x65d9('0x7')](),controller[_0x65d9('0x14')]);router[_0x65d9('0x12')](_0x65d9('0x15'),auth[_0x65d9('0x7')](),controller['reject']);router[_0x65d9('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x65d9('0x17')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 0557bd2..001b2b8 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 _0x6ef0=['exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0x6ef0,0x100));var _0x06ef=function(_0x458a30,_0x43e5be){_0x458a30=_0x458a30-0x0;var _0x43d60c=_0x6ef0[_0x458a30];return _0x43d60c;};'use strict';var Sequelize=require('sequelize');module[_0x06ef('0x0')]={'body':{'type':Sequelize['TEXT'](_0x06ef('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x06ef('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x06ef('0x3')]('in',_0x06ef('0x4')),'defaultValue':_0x06ef('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x06ef('0x5')]},'secret':{'type':Sequelize[_0x06ef('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x06ef('0x6')]},'providerResponse':{'type':Sequelize[_0x06ef('0x7')]}}; \ No newline at end of file +var _0x6b09=['ENUM','out','STRING','sequelize','TEXT','medium'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6b09,0xe1));var _0x96b0=function(_0x163f58,_0x1c8ae4){_0x163f58=_0x163f58-0x0;var _0x472ed9=_0x6b09[_0x163f58];return _0x472ed9;};'use strict';var Sequelize=require(_0x96b0('0x0'));module['exports']={'body':{'type':Sequelize[_0x96b0('0x1')](_0x96b0('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x96b0('0x3')]('in',_0x96b0('0x4')),'defaultValue':_0x96b0('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x96b0('0x5')](0xbe)},'phone':{'type':Sequelize[_0x96b0('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x96b0('0x5')]},'providerResponse':{'type':Sequelize[_0x96b0('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 7e605f4..4a5bcd9 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 _0x796a=['jayson/promise','http','client','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','status','end','undefined','limit','count','offset','reject','save','destroy','then','sendStatus','stack','name','send','map','WhatsappMessage','rawAttributes','model','keys','query','intersection','fields','attributes','length','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','find','create','body','update','describe','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','contact','fullname','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x796a,0x182));var _0xa796=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x796a[_0x149a9b];return _0x2c2bf6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa796('0x0'));var zipdir=require(_0xa796('0x1'));var jsonpatch=require(_0xa796('0x2'));var rp=require(_0xa796('0x3'));var moment=require(_0xa796('0x4'));var BPromise=require(_0xa796('0x5'));var Mustache=require(_0xa796('0x6'));var util=require(_0xa796('0x7'));var path=require(_0xa796('0x8'));var sox=require(_0xa796('0x9'));var csv=require(_0xa796('0xa'));var ejs=require(_0xa796('0xb'));var fs=require('fs');var fs_extra=require(_0xa796('0xc'));var _=require(_0xa796('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa796('0xe'));var toCsv=require(_0xa796('0xa'));var querystring=require(_0xa796('0xf'));var Papa=require(_0xa796('0x10'));var Redis=require(_0xa796('0x11'));var authService=require(_0xa796('0x12'));var qs=require(_0xa796('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa796('0x14'))(_0xa796('0x15'));var utils=require(_0xa796('0x16'));var config=require(_0xa796('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa796('0x18'))['db'];config[_0xa796('0x19')]=_[_0xa796('0x1a')](config['redis'],{'host':_0xa796('0x1b'),'port':0x18eb});var socket=require(_0xa796('0x1c'))(new Redis(config['redis']));require(_0xa796('0x1d'))[_0xa796('0x1e')](socket);var jayson=require(_0xa796('0x1f'));var client=jayson['client'][_0xa796('0x20')]({'port':0x232c});var client9002=jayson[_0xa796('0x21')][_0xa796('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x14c9c8,_0x2d360c,_0x174e39,_0x43e5c2){return new BPromise(function(_0x3c5be4,_0x28463d){var _0x567187=_0x43e5c2||client;return _0x567187['request'](_0x14c9c8,_0x174e39)['then'](function(_0x22b7aa){logger['info'](_0xa796('0x22'),_0x2d360c,'request\x20sent');logger[_0xa796('0x23')](_0xa796('0x24'),_0x2d360c,_0xa796('0x25'),JSON['stringify'](_0x22b7aa));if(_0x22b7aa[_0xa796('0x26')]){if(_0x22b7aa[_0xa796('0x26')][_0xa796('0x27')]===0x1f4){logger[_0xa796('0x26')](_0xa796('0x22'),_0x2d360c,_0x22b7aa[_0xa796('0x26')][_0xa796('0x28')]);return _0x28463d(_0x22b7aa[_0xa796('0x26')]['message']);}logger['error'](_0xa796('0x22'),_0x2d360c,_0x22b7aa[_0xa796('0x26')][_0xa796('0x28')]);return _0x3c5be4(_0x22b7aa[_0xa796('0x26')][_0xa796('0x28')]);}else{logger[_0xa796('0x29')](_0xa796('0x22'),_0x2d360c,_0xa796('0x25'));_0x3c5be4(_0x22b7aa[_0xa796('0x2a')][_0xa796('0x28')]);}})[_0xa796('0x2b')](function(_0x170ee5){logger[_0xa796('0x26')](_0xa796('0x22'),_0x2d360c,_0x170ee5);_0x28463d(_0x170ee5);});});}function respondWithStatusCode(_0x5271c4,_0x4b3e72){_0x4b3e72=_0x4b3e72||0xcc;return function(_0x3d08c9){if(_0x3d08c9){return _0x5271c4['sendStatus'](_0x4b3e72);}return _0x5271c4[_0xa796('0x2c')](_0x4b3e72)[_0xa796('0x2d')]();};}function respondWithResult(_0x2e2549,_0x97e1b3){_0x97e1b3=_0x97e1b3||0xc8;return function(_0xa73bec){if(_0xa73bec){return _0x2e2549[_0xa796('0x2c')](_0x97e1b3)['json'](_0xa73bec);}};}function respondWithFilteredResult(_0x205567,_0xe74cbc){return function(_0x2e6c10){if(_0x2e6c10){var _0x617e8d=typeof _0xe74cbc['offset']===_0xa796('0x2e')&&typeof _0xe74cbc[_0xa796('0x2f')]===_0xa796('0x2e');var _0x454ab8=_0x2e6c10[_0xa796('0x30')];var _0x3ed646=_0x617e8d?0x0:_0xe74cbc['offset'];var _0x24a1f8=_0x617e8d?_0x2e6c10[_0xa796('0x30')]:_0xe74cbc[_0xa796('0x31')]+_0xe74cbc[_0xa796('0x2f')];var _0x23b979;if(_0x24a1f8>=_0x454ab8){_0x24a1f8=_0x454ab8;_0x23b979=0xc8;}else{_0x23b979=0xce;}_0x205567['status'](_0x23b979);return _0x205567['set']('Content-Range',_0x3ed646+'-'+_0x24a1f8+'/'+_0x454ab8)['json'](_0x2e6c10);}return null;};}function patchUpdates(_0x28787c){return function(_0x5265be){try{jsonpatch['apply'](_0x5265be,_0x28787c,!![]);}catch(_0x316cbc){return BPromise[_0xa796('0x32')](_0x316cbc);}return _0x5265be[_0xa796('0x33')]();};}function saveUpdates(_0xe98e0a,_0x542a83){return function(_0x3b77ed){if(_0x3b77ed){return _0x3b77ed['update'](_0xe98e0a)['then'](function(_0x51d94e){return _0x51d94e;});}return null;};}function removeEntity(_0x1e5bc1,_0x512eeb){return function(_0x3db50b){if(_0x3db50b){return _0x3db50b[_0xa796('0x34')]()[_0xa796('0x35')](function(){_0x1e5bc1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b1803,_0x270867){return function(_0x201e50){if(!_0x201e50){_0x1b1803[_0xa796('0x36')](0x194);}return _0x201e50;};}function handleError(_0x550a33,_0x4b39a1){_0x4b39a1=_0x4b39a1||0x1f4;return function(_0x274d02){logger[_0xa796('0x26')](_0x274d02[_0xa796('0x37')]);if(_0x274d02[_0xa796('0x38')]){delete _0x274d02[_0xa796('0x38')];}_0x550a33[_0xa796('0x2c')](_0x4b39a1)[_0xa796('0x39')](_0x274d02);};}exports['index']=function(_0x165d6f,_0x2d960f){var _0x5a004d={},_0x1072ce={},_0x415e5a={'count':0x0,'rows':[]};var _0x30c729=_[_0xa796('0x3a')](db[_0xa796('0x3b')][_0xa796('0x3c')],function(_0x4a1afa){return{'name':_0x4a1afa['fieldName'],'type':_0x4a1afa['type']['key']};});_0x1072ce[_0xa796('0x3d')]=_[_0xa796('0x3a')](_0x30c729,'name');_0x1072ce['query']=_[_0xa796('0x3e')](_0x165d6f[_0xa796('0x3f')]);_0x1072ce['filters']=_['intersection'](_0x1072ce[_0xa796('0x3d')],_0x1072ce['query']);_0x5a004d['attributes']=_[_0xa796('0x40')](_0x1072ce['model'],qs[_0xa796('0x41')](_0x165d6f[_0xa796('0x3f')]['fields']));_0x5a004d[_0xa796('0x42')]=_0x5a004d['attributes'][_0xa796('0x43')]?_0x5a004d[_0xa796('0x42')]:_0x1072ce[_0xa796('0x3d')];if(!_0x165d6f[_0xa796('0x3f')]['hasOwnProperty']('nolimit')){_0x5a004d[_0xa796('0x2f')]=qs[_0xa796('0x2f')](_0x165d6f[_0xa796('0x3f')][_0xa796('0x2f')]);_0x5a004d[_0xa796('0x31')]=qs[_0xa796('0x31')](_0x165d6f[_0xa796('0x3f')][_0xa796('0x31')]);}_0x5a004d[_0xa796('0x44')]=qs['sort'](_0x165d6f[_0xa796('0x3f')][_0xa796('0x45')]);_0x5a004d['where']=qs[_0xa796('0x46')](_[_0xa796('0x47')](_0x165d6f['query'],_0x1072ce['filters']),_0x30c729);if(_0x165d6f[_0xa796('0x3f')][_0xa796('0x48')]){_0x5a004d['where']=_[_0xa796('0x49')](_0x5a004d['where'],{'$or':_['map'](_0x30c729,function(_0x1f7ac9){if(_0x1f7ac9['type']!==_0xa796('0x4a')){var _0x50ba5d={};_0x50ba5d[_0x1f7ac9[_0xa796('0x38')]]={'$like':'%'+_0x165d6f[_0xa796('0x3f')][_0xa796('0x48')]+'%'};return _0x50ba5d;}})});}_0x5a004d=_['merge']({},_0x5a004d,_0x165d6f[_0xa796('0x4b')]);var _0x35037b={'where':_0x5a004d[_0xa796('0x4c')]};return db[_0xa796('0x3b')][_0xa796('0x30')](_0x35037b)[_0xa796('0x35')](function(_0x2b62ab){_0x415e5a[_0xa796('0x30')]=_0x2b62ab;if(_0x165d6f[_0xa796('0x3f')][_0xa796('0x4d')]){_0x5a004d[_0xa796('0x4e')]=[{'all':!![]}];}return db[_0xa796('0x3b')][_0xa796('0x4f')](_0x5a004d);})['then'](function(_0x182f72){_0x415e5a[_0xa796('0x50')]=_0x182f72;return _0x415e5a;})['then'](respondWithFilteredResult(_0x2d960f,_0x5a004d))['catch'](handleError(_0x2d960f,null));};exports[_0xa796('0x51')]=function(_0x21157c,_0x2b588c){var _0x86f055={'raw':!![],'where':{'id':_0x21157c[_0xa796('0x52')]['id']}},_0x590295={};_0x590295[_0xa796('0x3d')]=_[_0xa796('0x3e')](db[_0xa796('0x3b')][_0xa796('0x3c')]);_0x590295['query']=_[_0xa796('0x3e')](_0x21157c[_0xa796('0x3f')]);_0x590295[_0xa796('0x46')]=_[_0xa796('0x40')](_0x590295[_0xa796('0x3d')],_0x590295[_0xa796('0x3f')]);_0x86f055['attributes']=_['intersection'](_0x590295['model'],qs['fields'](_0x21157c[_0xa796('0x3f')]['fields']));_0x86f055['attributes']=_0x86f055[_0xa796('0x42')]['length']?_0x86f055[_0xa796('0x42')]:_0x590295[_0xa796('0x3d')];if(_0x21157c[_0xa796('0x3f')][_0xa796('0x4d')]){_0x86f055['include']=[{'all':!![]}];}_0x86f055=_[_0xa796('0x49')]({},_0x86f055,_0x21157c[_0xa796('0x4b')]);return db[_0xa796('0x3b')][_0xa796('0x53')](_0x86f055)[_0xa796('0x35')](handleEntityNotFound(_0x2b588c,null))[_0xa796('0x35')](respondWithResult(_0x2b588c,null))[_0xa796('0x2b')](handleError(_0x2b588c,null));};exports[_0xa796('0x54')]=function(_0x346c7b,_0x17b0e9){return db[_0xa796('0x3b')]['create'](_0x346c7b[_0xa796('0x55')],{})[_0xa796('0x35')](respondWithResult(_0x17b0e9,0xc9))[_0xa796('0x2b')](handleError(_0x17b0e9,null));};exports[_0xa796('0x56')]=function(_0x585a12,_0x3d7147){if(_0x585a12[_0xa796('0x55')]['id']){delete _0x585a12[_0xa796('0x55')]['id'];}return db['WhatsappMessage'][_0xa796('0x53')]({'where':{'id':_0x585a12[_0xa796('0x52')]['id']}})[_0xa796('0x35')](handleEntityNotFound(_0x3d7147,null))[_0xa796('0x35')](saveUpdates(_0x585a12[_0xa796('0x55')],null))[_0xa796('0x35')](respondWithResult(_0x3d7147,null))['catch'](handleError(_0x3d7147,null));};exports[_0xa796('0x34')]=function(_0x32858b,_0x32c2c2){return db[_0xa796('0x3b')][_0xa796('0x53')]({'where':{'id':_0x32858b[_0xa796('0x52')]['id']}})[_0xa796('0x35')](handleEntityNotFound(_0x32c2c2,null))[_0xa796('0x35')](removeEntity(_0x32c2c2,null))[_0xa796('0x2b')](handleError(_0x32c2c2,null));};exports['describe']=function(_0x159a5b,_0x2f6c53){return db[_0xa796('0x3b')][_0xa796('0x57')]()[_0xa796('0x35')](respondWithResult(_0x2f6c53,null))[_0xa796('0x2b')](handleError(_0x2f6c53,null));};var interaction_log=require('../../config/logger')(_0xa796('0x58'));exports[_0xa796('0x59')]=function(_0x47104f,_0x5b9729,_0x28c1c0){var _0x233bb6={'agent':{},'channel':_0xa796('0x5a')};if(_0x47104f[_0xa796('0x55')]['id']){delete _0x47104f['body']['id'];}_0x47104f['body'][_0xa796('0x5b')]=!![];_0x47104f[_0xa796('0x55')]['readAt']=moment()[_0xa796('0x5c')](_0xa796('0x5d'));_0x47104f[_0xa796('0x55')][_0xa796('0x5e')]=_0x47104f[_0xa796('0x55')][_0xa796('0x5e')]||_0x47104f['user']['id'];_0x233bb6[_0xa796('0x5f')]['id']=_0x47104f[_0xa796('0x55')][_0xa796('0x5e')];return db[_0xa796('0x3b')][_0xa796('0x53')]({'where':{'id':_0x47104f['params']['id'],'UserId':null}})[_0xa796('0x35')](handleEntityNotFound(_0x5b9729,null))[_0xa796('0x35')](saveUpdates(_0x47104f[_0xa796('0x55')],null))[_0xa796('0x35')](function(_0x15a291){if(_0x15a291){_0x233bb6['message']=_0x15a291[_0xa796('0x60')]({'plain':!![]});return db['WhatsappInteraction'][_0xa796('0x53')]({'where':{'id':_0x15a291['WhatsappInteractionId']}});}return null;})[_0xa796('0x35')](handleEntityNotFound(_0x5b9729,null))[_0xa796('0x35')](function(_0x4747db){if(_0x4747db){return _0x4747db['update']({'UserId':_0x47104f[_0xa796('0x55')][_0xa796('0x5e')],'read1stAt':_[_0xa796('0x61')](_0x4747db[_0xa796('0x62')])?moment()[_0xa796('0x5c')](_0xa796('0x5d')):undefined});}return null;})[_0xa796('0x35')](function(_0x4ab929){if(_0x4ab929){_0x233bb6['interaction']=_0x4ab929['get']({'plain':!![]});interaction_log[_0xa796('0x29')](_0xa796('0x63'),_0x47104f[_0xa796('0x64')]['id'],_0x47104f[_0xa796('0x64')][_0xa796('0x38')],_0x47104f[_0xa796('0x64')][_0xa796('0x65')],_0x233bb6[_0xa796('0x66')]['id'],_0x47104f[_0xa796('0x55')]?JSON[_0xa796('0x67')](_0x47104f[_0xa796('0x55')]):'null');return respondWithRpcPromise(_0xa796('0x68'),_0xa796('0x69'),_0x233bb6);}return null;})['then'](function(_0x75a169){var _0x30f460='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x75a169['message']['ContactId'];return db[_0xa796('0x6a')][_0xa796('0x3f')](_0x30f460,{'type':db[_0xa796('0x6b')][_0xa796('0x6c')][_0xa796('0x6d')],'raw':!![]})[_0xa796('0x35')](function(_0x2ca319){return _0x2ca319;});})[_0xa796('0x35')](function(_0x57bdeb){if(_0x57bdeb){_0x233bb6[_0xa796('0x28')]['contact']=_0x57bdeb[0x0];if(!_0x47104f[_0xa796('0x55')][_0xa796('0x5e')])return;return db[_0xa796('0x6e')][_0xa796('0x53')]({'where':{'id':_0x47104f[_0xa796('0x55')][_0xa796('0x5e')],'role':_0xa796('0x5f')},'attributes':['id',_0xa796('0x38'),'fullname',_0xa796('0x6f'),_0xa796('0x70')],'raw':!![]});}return null;})[_0xa796('0x35')](function(_0x342469){if(!_0x342469)return null;_0x233bb6[_0xa796('0x28')][_0xa796('0x5f')]=_0x342469;return _0x233bb6;})[_0xa796('0x35')](function(_0x3baf25){if(_0x3baf25){if(_0x47104f[_0xa796('0x55')][_0xa796('0x71')]){_0x233bb6[_0xa796('0x28')][_0xa796('0x72')]=util['format'](_0xa796('0x73'),_0x47104f['user']['name']);_0x233bb6[_0xa796('0x28')]['channel']=_0x233bb6['channel'];_0x233bb6[_0xa796('0x28')][_0xa796('0x74')]=_0x233bb6[_0xa796('0x75')];_0x233bb6[_0xa796('0x28')][_0xa796('0x76')]='accept';return respondWithRpcPromise('EventManager',_0xa796('0x77'),{'event':'acceptmessage','message':_0x233bb6['message']},client9002)[_0xa796('0x35')](function(){return _0x233bb6;});}return _0x233bb6;}return null;})[_0xa796('0x35')](respondWithResult(_0x5b9729,null))['catch'](handleError(_0x5b9729,null));};var interaction_log=require(_0xa796('0x14'))(_0xa796('0x58'));exports[_0xa796('0x32')]=function(_0x2c6697,_0x9724a5,_0x242617){var _0x2b4399={'agent':{},'channel':_0xa796('0x5a')};if(_0x2c6697['body']['id']){delete _0x2c6697['body']['id'];}_0x2c6697[_0xa796('0x55')][_0xa796('0x5e')]=_0x2c6697[_0xa796('0x55')][_0xa796('0x5e')]||_0x2c6697[_0xa796('0x64')]['id'];_0x2b4399[_0xa796('0x5f')]['id']=_0x2c6697[_0xa796('0x55')][_0xa796('0x5e')];return db[_0xa796('0x3b')]['find']({'where':{'id':_0x2c6697['params']['id'],'UserId':null}})[_0xa796('0x35')](handleEntityNotFound(_0x9724a5,null))[_0xa796('0x35')](function(_0x542a45){if(_0x542a45){_0x2b4399[_0xa796('0x28')]=_0x542a45[_0xa796('0x60')]({'plain':!![]});return db[_0xa796('0x78')][_0xa796('0x53')]({'where':{'id':_0x542a45['WhatsappInteractionId']}});}return null;})[_0xa796('0x35')](handleEntityNotFound(_0x9724a5,null))[_0xa796('0x35')](function(_0x422587){if(_0x422587){_0x2b4399[_0xa796('0x66')]=_0x422587[_0xa796('0x60')]({'plain':!![]});interaction_log[_0xa796('0x29')](_0xa796('0x79'),_0x2c6697[_0xa796('0x64')]['id'],_0x2c6697['user'][_0xa796('0x38')],_0x2c6697['user'][_0xa796('0x65')],_0x2b4399[_0xa796('0x66')]['id'],_0x2c6697[_0xa796('0x55')]?JSON[_0xa796('0x67')](_0x2c6697[_0xa796('0x55')]):_0xa796('0x7a'));return respondWithRpcPromise(_0xa796('0x7b'),_0xa796('0x7c'),_0x2b4399);}return null;})['then'](function(_0xdc660f){var _0x4ae771='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xdc660f['message'][_0xa796('0x7d')];return db[_0xa796('0x6a')][_0xa796('0x3f')](_0x4ae771,{'type':db[_0xa796('0x6b')][_0xa796('0x6c')]['SELECT'],'raw':!![]})[_0xa796('0x35')](function(_0x30cc85){return _0x30cc85;});})[_0xa796('0x35')](function(_0x491fa2){if(_0x491fa2){_0x2b4399[_0xa796('0x28')][_0xa796('0x7e')]=_0x491fa2[0x0];if(!_0x2c6697[_0xa796('0x55')][_0xa796('0x5e')])return;return db[_0xa796('0x6e')][_0xa796('0x53')]({'where':{'id':_0x2c6697[_0xa796('0x55')]['UserId'],'role':_0xa796('0x5f')},'attributes':['id','name',_0xa796('0x7f'),_0xa796('0x6f'),_0xa796('0x70')],'raw':!![]});}return null;})[_0xa796('0x35')](function(_0x4691b5){if(!_0x4691b5)return null;_0x2b4399[_0xa796('0x28')][_0xa796('0x5f')]=_0x4691b5;return _0x2b4399;})['then'](function(_0x333705){if(_0x333705){_0x333705[_0xa796('0x28')][_0xa796('0x72')]=util[_0xa796('0x5c')](_0xa796('0x73'),_0x2c6697[_0xa796('0x64')][_0xa796('0x38')]);_0x333705['message'][_0xa796('0x75')]=_0x2b4399['channel'];_0x333705[_0xa796('0x28')]['motionChannel']=_0x2b4399[_0xa796('0x75')];_0x333705[_0xa796('0x28')][_0xa796('0x76')]=_0xa796('0x32');respondWithRpcPromise(_0xa796('0x77'),_0xa796('0x77'),{'event':_0xa796('0x80'),'message':_0x333705[_0xa796('0x28')]},client9002);return _0x2b4399;}return null;})[_0xa796('0x35')](respondWithResult(_0x9724a5,null))[_0xa796('0x2b')](handleError(_0x9724a5,null));};exports[_0xa796('0x2c')]=function(_0x5c343e,_0x1572e4,_0x4d2267){if(_0x5c343e[_0xa796('0x55')]['id']){delete _0x5c343e['body']['id'];}var _0x66f38a;return db[_0xa796('0x3b')][_0xa796('0x53')]({'where':{'id':_0x5c343e[_0xa796('0x52')]['id']}})[_0xa796('0x35')](handleEntityNotFound(_0x1572e4,null))[_0xa796('0x35')](function(_0x30a95f){if(_0x30a95f){_0x66f38a=_0x30a95f;return db[_0xa796('0x81')][_0xa796('0x53')]({'where':{'id':_0x30a95f['WhatsappAccountId']}});}})[_0xa796('0x35')](handleEntityNotFound(_0x1572e4,null))[_0xa796('0x35')](function(_0x42dfaf){if(_0x42dfaf){logger[_0xa796('0x23')](_0xa796('0x82'),_0xa796('0x2c'),_0xa796('0x83'),_0x42dfaf[_0xa796('0x84')],util[_0xa796('0x85')](_0x5c343e[_0xa796('0x55')],{'showHidden':![],'depth':null}));switch(_0x42dfaf[_0xa796('0x84')]){case _0xa796('0x86'):if(_0x5c343e[_0xa796('0x55')]['MessageSid']&&_0x5c343e[_0xa796('0x55')][_0xa796('0x87')]===_0x66f38a[_0xa796('0x88')]&&_0x5c343e[_0xa796('0x55')]['MessageStatus']&&_0x5c343e[_0xa796('0x55')][_0xa796('0x89')]===_0xa796('0x5b')){return _0x66f38a['update']({'read':!![]});}else{logger[_0xa796('0x26')](_0xa796('0x8a'),_0xa796('0x2c'),'twilio',util[_0xa796('0x85')](_0x5c343e['body'],{'showHidden':![],'depth':null}));}break;}return _0x66f38a;}})[_0xa796('0x35')](respondWithResult(_0x1572e4,null))[_0xa796('0x2b')](handleError(_0x1572e4,null));}; \ No newline at end of file +var _0x3034=['request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','sendStatus','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','status','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','ContactId','sequelize','SELECT','fullname','email','internal','manual','interface','format','channel','motionChannel','event','accept','EventManager','acceptmessage','whatsapp-interactions','whatsapp','get','WhatsappInteractionId','role','RejectMessage','rejectMessage','Sequelize','QueryTypes','User','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','twilio','rimraf','zip-dir','request-promise','moment','bluebird','util','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','client'];(function(_0x199f8f,_0xecc1a0){var _0x68e633=function(_0x38f3e7){while(--_0x38f3e7){_0x199f8f['push'](_0x199f8f['shift']());}};_0x68e633(++_0xecc1a0);}(_0x3034,0xe7));var _0x4303=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3034[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4303('0x0'));var zipdir=require(_0x4303('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4303('0x2'));var moment=require(_0x4303('0x3'));var BPromise=require(_0x4303('0x4'));var Mustache=require('mustache');var util=require(_0x4303('0x5'));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(_0x4303('0x6'));var _=require('lodash');var squel=require(_0x4303('0x7'));var crypto=require('crypto');var jsforce=require(_0x4303('0x8'));var deskjs=require(_0x4303('0x9'));var toCsv=require(_0x4303('0xa'));var querystring=require('querystring');var Papa=require(_0x4303('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4303('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4303('0xd'))(_0x4303('0xe'));var utils=require(_0x4303('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x4303('0x10'));var db=require(_0x4303('0x11'))['db'];config['redis']=_[_0x4303('0x12')](config[_0x4303('0x13')],{'host':_0x4303('0x14'),'port':0x18eb});var socket=require(_0x4303('0x15'))(new Redis(config['redis']));require(_0x4303('0x16'))[_0x4303('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4303('0x18')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x461dfb,_0x135749,_0x27262b,_0x5e6d06){return new BPromise(function(_0x400acf,_0x1cd9ef){var _0x5c1032=_0x5e6d06||client;return _0x5c1032[_0x4303('0x19')](_0x461dfb,_0x27262b)[_0x4303('0x1a')](function(_0x23b522){logger['info'](_0x4303('0x1b'),_0x135749,_0x4303('0x1c'));logger[_0x4303('0x1d')](_0x4303('0x1e'),_0x135749,'request\x20sent',JSON[_0x4303('0x1f')](_0x23b522));if(_0x23b522[_0x4303('0x20')]){if(_0x23b522['error']['code']===0x1f4){logger[_0x4303('0x20')](_0x4303('0x1b'),_0x135749,_0x23b522[_0x4303('0x20')][_0x4303('0x21')]);return _0x1cd9ef(_0x23b522[_0x4303('0x20')][_0x4303('0x21')]);}logger[_0x4303('0x20')](_0x4303('0x1b'),_0x135749,_0x23b522[_0x4303('0x20')][_0x4303('0x21')]);return _0x400acf(_0x23b522[_0x4303('0x20')][_0x4303('0x21')]);}else{logger[_0x4303('0x22')](_0x4303('0x1b'),_0x135749,_0x4303('0x1c'));_0x400acf(_0x23b522['result'][_0x4303('0x21')]);}})['catch'](function(_0x408af5){logger[_0x4303('0x20')](_0x4303('0x1b'),_0x135749,_0x408af5);_0x1cd9ef(_0x408af5);});});}function respondWithStatusCode(_0x5695a9,_0x244291){_0x244291=_0x244291||0xcc;return function(_0x544477){if(_0x544477){return _0x5695a9[_0x4303('0x23')](_0x244291);}return _0x5695a9['status'](_0x244291)[_0x4303('0x24')]();};}function respondWithResult(_0x14eaf1,_0x255a63){_0x255a63=_0x255a63||0xc8;return function(_0x2eb307){if(_0x2eb307){return _0x14eaf1['status'](_0x255a63)[_0x4303('0x25')](_0x2eb307);}};}function respondWithFilteredResult(_0x57aea7,_0x62045d){return function(_0x362715){if(_0x362715){var _0x323ace=typeof _0x62045d[_0x4303('0x26')]==='undefined'&&typeof _0x62045d[_0x4303('0x27')]===_0x4303('0x28');var _0x39e791=_0x362715[_0x4303('0x29')];var _0x4bc1a6=_0x323ace?0x0:_0x62045d[_0x4303('0x26')];var _0x32e982=_0x323ace?_0x362715['count']:_0x62045d[_0x4303('0x26')]+_0x62045d[_0x4303('0x27')];var _0x4e780c;if(_0x32e982>=_0x39e791){_0x32e982=_0x39e791;_0x4e780c=0xc8;}else{_0x4e780c=0xce;}_0x57aea7['status'](_0x4e780c);return _0x57aea7['set'](_0x4303('0x2a'),_0x4bc1a6+'-'+_0x32e982+'/'+_0x39e791)[_0x4303('0x25')](_0x362715);}return null;};}function patchUpdates(_0x154cdb){return function(_0x3fb9b4){try{jsonpatch[_0x4303('0x2b')](_0x3fb9b4,_0x154cdb,!![]);}catch(_0x438228){return BPromise[_0x4303('0x2c')](_0x438228);}return _0x3fb9b4[_0x4303('0x2d')]();};}function saveUpdates(_0x2b97de,_0x1800ae){return function(_0x429cb2){if(_0x429cb2){return _0x429cb2[_0x4303('0x2e')](_0x2b97de)[_0x4303('0x1a')](function(_0x4e1c32){return _0x4e1c32;});}return null;};}function removeEntity(_0x23776f,_0x390547){return function(_0x3a9144){if(_0x3a9144){return _0x3a9144['destroy']()[_0x4303('0x1a')](function(){_0x23776f[_0x4303('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x336d53,_0x3fe9b4){return function(_0x38bd10){if(!_0x38bd10){_0x336d53[_0x4303('0x23')](0x194);}return _0x38bd10;};}function handleError(_0x3d841a,_0x429728){_0x429728=_0x429728||0x1f4;return function(_0x1285ec){logger[_0x4303('0x20')](_0x1285ec[_0x4303('0x30')]);if(_0x1285ec[_0x4303('0x31')]){delete _0x1285ec['name'];}_0x3d841a[_0x4303('0x2f')](_0x429728)[_0x4303('0x32')](_0x1285ec);};}exports[_0x4303('0x33')]=function(_0x45c736,_0x168788){var _0x4f5066={},_0x4d6d95={},_0x538bb0={'count':0x0,'rows':[]};var _0x2c24ce=_[_0x4303('0x34')](db[_0x4303('0x35')][_0x4303('0x36')],function(_0x306e69){return{'name':_0x306e69['fieldName'],'type':_0x306e69[_0x4303('0x37')][_0x4303('0x38')]};});_0x4d6d95[_0x4303('0x39')]=_[_0x4303('0x34')](_0x2c24ce,_0x4303('0x31'));_0x4d6d95[_0x4303('0x3a')]=_[_0x4303('0x3b')](_0x45c736[_0x4303('0x3a')]);_0x4d6d95[_0x4303('0x3c')]=_[_0x4303('0x3d')](_0x4d6d95[_0x4303('0x39')],_0x4d6d95[_0x4303('0x3a')]);_0x4f5066[_0x4303('0x3e')]=_[_0x4303('0x3d')](_0x4d6d95[_0x4303('0x39')],qs[_0x4303('0x3f')](_0x45c736[_0x4303('0x3a')][_0x4303('0x3f')]));_0x4f5066[_0x4303('0x3e')]=_0x4f5066[_0x4303('0x3e')][_0x4303('0x40')]?_0x4f5066[_0x4303('0x3e')]:_0x4d6d95['model'];if(!_0x45c736[_0x4303('0x3a')]['hasOwnProperty'](_0x4303('0x41'))){_0x4f5066[_0x4303('0x27')]=qs[_0x4303('0x27')](_0x45c736[_0x4303('0x3a')][_0x4303('0x27')]);_0x4f5066['offset']=qs['offset'](_0x45c736[_0x4303('0x3a')]['offset']);}_0x4f5066['order']=qs['sort'](_0x45c736[_0x4303('0x3a')]['sort']);_0x4f5066[_0x4303('0x42')]=qs[_0x4303('0x3c')](_[_0x4303('0x43')](_0x45c736[_0x4303('0x3a')],_0x4d6d95[_0x4303('0x3c')]),_0x2c24ce);if(_0x45c736['query'][_0x4303('0x44')]){_0x4f5066[_0x4303('0x42')]=_[_0x4303('0x45')](_0x4f5066['where'],{'$or':_[_0x4303('0x34')](_0x2c24ce,function(_0x5d3166){if(_0x5d3166[_0x4303('0x37')]!==_0x4303('0x46')){var _0x88659c={};_0x88659c[_0x5d3166[_0x4303('0x31')]]={'$like':'%'+_0x45c736[_0x4303('0x3a')]['filter']+'%'};return _0x88659c;}})});}_0x4f5066=_[_0x4303('0x45')]({},_0x4f5066,_0x45c736[_0x4303('0x47')]);var _0x403e23={'where':_0x4f5066[_0x4303('0x42')]};return db[_0x4303('0x35')][_0x4303('0x29')](_0x403e23)[_0x4303('0x1a')](function(_0x532cfa){_0x538bb0[_0x4303('0x29')]=_0x532cfa;if(_0x45c736['query'][_0x4303('0x48')]){_0x4f5066[_0x4303('0x49')]=[{'all':!![]}];}return db[_0x4303('0x35')][_0x4303('0x4a')](_0x4f5066);})[_0x4303('0x1a')](function(_0x5962cb){_0x538bb0[_0x4303('0x4b')]=_0x5962cb;return _0x538bb0;})[_0x4303('0x1a')](respondWithFilteredResult(_0x168788,_0x4f5066))[_0x4303('0x4c')](handleError(_0x168788,null));};exports['show']=function(_0x17633c,_0x5536d6){var _0x14588f={'raw':!![],'where':{'id':_0x17633c[_0x4303('0x4d')]['id']}},_0x5da549={};_0x5da549[_0x4303('0x39')]=_[_0x4303('0x3b')](db[_0x4303('0x35')][_0x4303('0x36')]);_0x5da549[_0x4303('0x3a')]=_['keys'](_0x17633c[_0x4303('0x3a')]);_0x5da549[_0x4303('0x3c')]=_[_0x4303('0x3d')](_0x5da549[_0x4303('0x39')],_0x5da549['query']);_0x14588f[_0x4303('0x3e')]=_['intersection'](_0x5da549[_0x4303('0x39')],qs['fields'](_0x17633c[_0x4303('0x3a')][_0x4303('0x3f')]));_0x14588f[_0x4303('0x3e')]=_0x14588f[_0x4303('0x3e')][_0x4303('0x40')]?_0x14588f['attributes']:_0x5da549[_0x4303('0x39')];if(_0x17633c[_0x4303('0x3a')][_0x4303('0x48')]){_0x14588f[_0x4303('0x49')]=[{'all':!![]}];}_0x14588f=_[_0x4303('0x45')]({},_0x14588f,_0x17633c[_0x4303('0x47')]);return db[_0x4303('0x35')][_0x4303('0x4e')](_0x14588f)[_0x4303('0x1a')](handleEntityNotFound(_0x5536d6,null))[_0x4303('0x1a')](respondWithResult(_0x5536d6,null))[_0x4303('0x4c')](handleError(_0x5536d6,null));};exports[_0x4303('0x4f')]=function(_0x40215b,_0x4c9132){return db['WhatsappMessage'][_0x4303('0x4f')](_0x40215b[_0x4303('0x50')],{})['then'](respondWithResult(_0x4c9132,0xc9))[_0x4303('0x4c')](handleError(_0x4c9132,null));};exports[_0x4303('0x2e')]=function(_0x1e0185,_0x218dc0){if(_0x1e0185[_0x4303('0x50')]['id']){delete _0x1e0185[_0x4303('0x50')]['id'];}return db[_0x4303('0x35')]['find']({'where':{'id':_0x1e0185[_0x4303('0x4d')]['id']}})[_0x4303('0x1a')](handleEntityNotFound(_0x218dc0,null))[_0x4303('0x1a')](saveUpdates(_0x1e0185['body'],null))[_0x4303('0x1a')](respondWithResult(_0x218dc0,null))[_0x4303('0x4c')](handleError(_0x218dc0,null));};exports[_0x4303('0x51')]=function(_0x527b09,_0x4b5bb3){return db[_0x4303('0x35')][_0x4303('0x4e')]({'where':{'id':_0x527b09[_0x4303('0x4d')]['id']}})[_0x4303('0x1a')](handleEntityNotFound(_0x4b5bb3,null))['then'](removeEntity(_0x4b5bb3,null))[_0x4303('0x4c')](handleError(_0x4b5bb3,null));};exports[_0x4303('0x52')]=function(_0xa6ff25,_0x5bd3bb){return db['WhatsappMessage'][_0x4303('0x52')]()[_0x4303('0x1a')](respondWithResult(_0x5bd3bb,null))[_0x4303('0x4c')](handleError(_0x5bd3bb,null));};var interaction_log=require(_0x4303('0xd'))('whatsapp-interactions');exports['accept']=function(_0x2f7a0f,_0x1f6d58,_0x556bc4){var _0x50ab71={'agent':{},'channel':'whatsapp'};if(_0x2f7a0f[_0x4303('0x50')]['id']){delete _0x2f7a0f[_0x4303('0x50')]['id'];}_0x2f7a0f['body'][_0x4303('0x53')]=!![];_0x2f7a0f[_0x4303('0x50')][_0x4303('0x54')]=moment()['format'](_0x4303('0x55'));_0x2f7a0f[_0x4303('0x50')][_0x4303('0x56')]=_0x2f7a0f[_0x4303('0x50')][_0x4303('0x56')]||_0x2f7a0f[_0x4303('0x57')]['id'];_0x50ab71[_0x4303('0x58')]['id']=_0x2f7a0f[_0x4303('0x50')][_0x4303('0x56')];return db['WhatsappMessage'][_0x4303('0x4e')]({'where':{'id':_0x2f7a0f[_0x4303('0x4d')]['id'],'UserId':null}})[_0x4303('0x1a')](handleEntityNotFound(_0x1f6d58,null))[_0x4303('0x1a')](saveUpdates(_0x2f7a0f['body'],null))[_0x4303('0x1a')](function(_0x4b5c65){if(_0x4b5c65){_0x50ab71[_0x4303('0x21')]=_0x4b5c65['get']({'plain':!![]});return db['WhatsappInteraction'][_0x4303('0x4e')]({'where':{'id':_0x4b5c65['WhatsappInteractionId']}});}return null;})[_0x4303('0x1a')](handleEntityNotFound(_0x1f6d58,null))['then'](function(_0x3fad19){if(_0x3fad19){return _0x3fad19[_0x4303('0x2e')]({'UserId':_0x2f7a0f[_0x4303('0x50')][_0x4303('0x56')],'read1stAt':_[_0x4303('0x59')](_0x3fad19[_0x4303('0x5a')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x15da3b){if(_0x15da3b){_0x50ab71[_0x4303('0x5b')]=_0x15da3b['get']({'plain':!![]});interaction_log['info'](_0x4303('0x5c'),_0x2f7a0f[_0x4303('0x57')]['id'],_0x2f7a0f[_0x4303('0x57')][_0x4303('0x31')],_0x2f7a0f[_0x4303('0x57')]['role'],_0x50ab71[_0x4303('0x5b')]['id'],_0x2f7a0f['body']?JSON[_0x4303('0x1f')](_0x2f7a0f[_0x4303('0x50')]):_0x4303('0x5d'));return respondWithRpcPromise(_0x4303('0x5e'),'acceptMessage',_0x50ab71);}return null;})['then'](function(_0x4b05fd){var _0x45de02='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b05fd[_0x4303('0x21')][_0x4303('0x5f')];return db[_0x4303('0x60')]['query'](_0x45de02,{'type':db['Sequelize']['QueryTypes'][_0x4303('0x61')],'raw':!![]})[_0x4303('0x1a')](function(_0x1ff848){return _0x1ff848;});})['then'](function(_0x122933){if(_0x122933){_0x50ab71[_0x4303('0x21')]['contact']=_0x122933[0x0];if(!_0x2f7a0f[_0x4303('0x50')][_0x4303('0x56')])return;return db['User']['find']({'where':{'id':_0x2f7a0f['body'][_0x4303('0x56')],'role':_0x4303('0x58')},'attributes':['id',_0x4303('0x31'),_0x4303('0x62'),_0x4303('0x63'),_0x4303('0x64')],'raw':!![]});}return null;})['then'](function(_0x4bdb77){if(!_0x4bdb77)return null;_0x50ab71[_0x4303('0x21')][_0x4303('0x58')]=_0x4bdb77;return _0x50ab71;})['then'](function(_0x5e6d8a){if(_0x5e6d8a){if(_0x2f7a0f[_0x4303('0x50')][_0x4303('0x65')]){_0x50ab71[_0x4303('0x21')][_0x4303('0x66')]=util[_0x4303('0x67')]('SIP/%s',_0x2f7a0f[_0x4303('0x57')][_0x4303('0x31')]);_0x50ab71[_0x4303('0x21')]['channel']=_0x50ab71[_0x4303('0x68')];_0x50ab71[_0x4303('0x21')][_0x4303('0x69')]=_0x50ab71[_0x4303('0x68')];_0x50ab71[_0x4303('0x21')][_0x4303('0x6a')]=_0x4303('0x6b');return respondWithRpcPromise(_0x4303('0x6c'),'EventManager',{'event':_0x4303('0x6d'),'message':_0x50ab71['message']},client9002)[_0x4303('0x1a')](function(){return _0x50ab71;});}return _0x50ab71;}return null;})[_0x4303('0x1a')](respondWithResult(_0x1f6d58,null))[_0x4303('0x4c')](handleError(_0x1f6d58,null));};var interaction_log=require(_0x4303('0xd'))(_0x4303('0x6e'));exports['reject']=function(_0x389555,_0x3c996f,_0x173251){var _0xc35a04={'agent':{},'channel':_0x4303('0x6f')};if(_0x389555[_0x4303('0x50')]['id']){delete _0x389555[_0x4303('0x50')]['id'];}_0x389555[_0x4303('0x50')][_0x4303('0x56')]=_0x389555[_0x4303('0x50')][_0x4303('0x56')]||_0x389555['user']['id'];_0xc35a04[_0x4303('0x58')]['id']=_0x389555[_0x4303('0x50')][_0x4303('0x56')];return db['WhatsappMessage']['find']({'where':{'id':_0x389555[_0x4303('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c996f,null))['then'](function(_0x2da9cc){if(_0x2da9cc){_0xc35a04['message']=_0x2da9cc[_0x4303('0x70')]({'plain':!![]});return db['WhatsappInteraction'][_0x4303('0x4e')]({'where':{'id':_0x2da9cc[_0x4303('0x71')]}});}return null;})['then'](handleEntityNotFound(_0x3c996f,null))[_0x4303('0x1a')](function(_0x305e44){if(_0x305e44){_0xc35a04['interaction']=_0x305e44['get']({'plain':!![]});interaction_log[_0x4303('0x22')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x389555[_0x4303('0x57')]['id'],_0x389555['user'][_0x4303('0x31')],_0x389555[_0x4303('0x57')][_0x4303('0x72')],_0xc35a04['interaction']['id'],_0x389555['body']?JSON['stringify'](_0x389555[_0x4303('0x50')]):_0x4303('0x5d'));return respondWithRpcPromise(_0x4303('0x73'),_0x4303('0x74'),_0xc35a04);}return null;})[_0x4303('0x1a')](function(_0x46fac8){var _0x3c3768='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x46fac8[_0x4303('0x21')][_0x4303('0x5f')];return db[_0x4303('0x60')]['query'](_0x3c3768,{'type':db[_0x4303('0x75')][_0x4303('0x76')][_0x4303('0x61')],'raw':!![]})[_0x4303('0x1a')](function(_0x3d8943){return _0x3d8943;});})[_0x4303('0x1a')](function(_0x1cd482){if(_0x1cd482){_0xc35a04[_0x4303('0x21')]['contact']=_0x1cd482[0x0];if(!_0x389555[_0x4303('0x50')][_0x4303('0x56')])return;return db[_0x4303('0x77')][_0x4303('0x4e')]({'where':{'id':_0x389555[_0x4303('0x50')][_0x4303('0x56')],'role':_0x4303('0x58')},'attributes':['id','name','fullname',_0x4303('0x63'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3f0b76){if(!_0x3f0b76)return null;_0xc35a04['message'][_0x4303('0x58')]=_0x3f0b76;return _0xc35a04;})['then'](function(_0x4ef0f1){if(_0x4ef0f1){_0x4ef0f1[_0x4303('0x21')][_0x4303('0x66')]=util[_0x4303('0x67')]('SIP/%s',_0x389555[_0x4303('0x57')]['name']);_0x4ef0f1[_0x4303('0x21')]['channel']=_0xc35a04[_0x4303('0x68')];_0x4ef0f1['message'][_0x4303('0x69')]=_0xc35a04[_0x4303('0x68')];_0x4ef0f1[_0x4303('0x21')]['event']=_0x4303('0x2c');respondWithRpcPromise(_0x4303('0x6c'),_0x4303('0x6c'),{'event':'rejectmessage','message':_0x4ef0f1['message']},client9002);return _0xc35a04;}return null;})[_0x4303('0x1a')](respondWithResult(_0x3c996f,null))['catch'](handleError(_0x3c996f,null));};exports[_0x4303('0x2f')]=function(_0x15d757,_0x26bf43,_0x1f347b){if(_0x15d757['body']['id']){delete _0x15d757[_0x4303('0x50')]['id'];}var _0x1ad89b;return db[_0x4303('0x35')][_0x4303('0x4e')]({'where':{'id':_0x15d757[_0x4303('0x4d')]['id']}})[_0x4303('0x1a')](handleEntityNotFound(_0x26bf43,null))[_0x4303('0x1a')](function(_0xd265b7){if(_0xd265b7){_0x1ad89b=_0xd265b7;return db[_0x4303('0x78')][_0x4303('0x4e')]({'where':{'id':_0xd265b7[_0x4303('0x79')]}});}})[_0x4303('0x1a')](handleEntityNotFound(_0x26bf43,null))[_0x4303('0x1a')](function(_0x3f8de0){if(_0x3f8de0){logger[_0x4303('0x1d')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x4303('0x2f'),_0x4303('0x7a'),_0x3f8de0[_0x4303('0x37')],util[_0x4303('0x7b')](_0x15d757[_0x4303('0x50')],{'showHidden':![],'depth':null}));switch(_0x3f8de0[_0x4303('0x37')]){case'twilio':if(_0x15d757[_0x4303('0x50')][_0x4303('0x7c')]&&_0x15d757[_0x4303('0x50')]['MessageSid']===_0x1ad89b[_0x4303('0x7d')]&&_0x15d757['body'][_0x4303('0x7e')]&&_0x15d757[_0x4303('0x50')][_0x4303('0x7e')]===_0x4303('0x53')){return _0x1ad89b[_0x4303('0x2e')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4303('0x2f'),_0x4303('0x7f'),util[_0x4303('0x7b')](_0x15d757[_0x4303('0x50')],{'showHidden':![],'depth':null}));}break;}return _0x1ad89b;}})['then'](respondWithResult(_0x26bf43,null))[_0x4303('0x4c')](handleError(_0x26bf43,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 9e980b0..1508fc3 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 _0x9e6b=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0xbbf102,_0xda3621){var _0x4c76b3=function(_0x399f08){while(--_0x399f08){_0xbbf102['push'](_0xbbf102['shift']());}};_0x4c76b3(++_0xda3621);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9e6b[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0xb9e6('0x0'));var WhatsappMessage=require(_0xb9e6('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb9e6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb9e6('0x3')};function emitEvent(_0x6fcb00){return function(_0xb74c07,_0x214661,_0x47fc84){WhatsappMessageEvents[_0xb9e6('0x4')](_0x6fcb00+':'+_0xb74c07['id'],_0xb74c07);WhatsappMessageEvents[_0xb9e6('0x4')](_0x6fcb00,_0xb74c07);_0x47fc84(null);};}for(var e in events){if(events[_0xb9e6('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xb9e6('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x777d=['emit','hook','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove'];(function(_0x529778,_0x7b56fd){var _0x1805d4=function(_0x5d7d3d){while(--_0x5d7d3d){_0x529778['push'](_0x529778['shift']());}};_0x1805d4(++_0x7b56fd);}(_0x777d,0xe9));var _0xd777=function(_0x24f326,_0x616a7){_0x24f326=_0x24f326-0x0;var _0x488e2d=_0x777d[_0x24f326];return _0x488e2d;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xd777('0x0'))['db'][_0xd777('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd777('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd777('0x3'),'afterDestroy':_0xd777('0x4')};function emitEvent(_0x54bbb5){return function(_0x5e0f79,_0x514817,_0x40b685){WhatsappMessageEvents['emit'](_0x54bbb5+':'+_0x5e0f79['id'],_0x5e0f79);WhatsappMessageEvents[_0xd777('0x5')](_0x54bbb5,_0x5e0f79);_0x40b685(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xd777('0x6')](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 bcbc2f3..1990286 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 _0x7e9f=['/api/whatsapp/messages/','token','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','sinch','/messages/','POST','Bearer\x20','application/json','statuses','message_id','update','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','node-fetch','path','rimraf','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','WhatsappInteraction','findOne','WhatsappInteractionId','then','createdAt','catch','error','secret','WhatsappAccount','find','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote'];(function(_0x653a8d,_0xa1bdce){var _0x382aef=function(_0x3b4255){while(--_0x3b4255){_0x653a8d['push'](_0x653a8d['shift']());}};_0x382aef(++_0xa1bdce);}(_0x7e9f,0xf2));var _0xf7e9=function(_0x2e5565,_0x2c9f5d){_0x2e5565=_0x2e5565-0x0;var _0x21d715=_0x7e9f[_0x2e5565];return _0x21d715;};'use strict';var _=require('lodash');var util=require(_0xf7e9('0x0'));var logger=require('../../config/logger')(_0xf7e9('0x1'));var moment=require(_0xf7e9('0x2'));var BPromise=require(_0xf7e9('0x3'));var rp=require('request-promise');var fetch=require(_0xf7e9('0x4'));var fs=require('fs');var path=require(_0xf7e9('0x5'));var rimraf=require(_0xf7e9('0x6'));var config=require('../../config/environment');var attributes=require(_0xf7e9('0x7'));module['exports']=function(_0x2c04cb,_0x3ce790){return _0x2c04cb[_0xf7e9('0x8')](_0xf7e9('0x9'),attributes,{'tableName':_0xf7e9('0xa'),'paranoid':![],'indexes':[{'name':_0xf7e9('0xb'),'fields':[_0xf7e9('0xb')]},{'name':_0xf7e9('0xc'),'fields':[_0xf7e9('0xd')],'type':_0xf7e9('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x27a18b,_0x18beaf,_0xc8a1d4){var _0x5155b0=_0x2c04cb[_0xf7e9('0xf')];var _0x3b5953=_0x27a18b[_0xf7e9('0x10')]({'plain':!![]});if(_0x3b5953[_0xf7e9('0x11')][_0xf7e9('0x12')]()==='in'||_0x3b5953[_0xf7e9('0x11')][_0xf7e9('0x12')]()===_0xf7e9('0x13')&&!_0x3b5953['secret']&&!_['isNil'](_0x3b5953['UserId'])){_0x5155b0[_0xf7e9('0x14')][_0xf7e9('0x15')]({'where':{'id':_0x3b5953[_0xf7e9('0x16')]}})[_0xf7e9('0x17')](function(_0x4b4ec4){if(_0x4b4ec4){_0x4b4ec4['update']({'lastMsgAt':_0x3b5953[_0xf7e9('0x18')],'lastMsgDirection':_0x3b5953['direction'][_0xf7e9('0x12')]()});}})[_0xf7e9('0x19')](function(_0x1e9168){console[_0xf7e9('0x1a')](_0x1e9168);});}if(_0x3b5953['direction']==='out'&&!_0x3b5953[_0xf7e9('0x1b')]){var _0x1ff518;_0x5155b0[_0xf7e9('0x1c')][_0xf7e9('0x1d')]({'where':{'id':_0x3b5953['WhatsappAccountId']},'raw':!![]})[_0xf7e9('0x17')](function(_0x28c45f){_0x1ff518=_0x28c45f;if(_0x1ff518&&_0x1ff518[_0xf7e9('0x1e')]){switch(_0x1ff518[_0xf7e9('0x1e')]){case _0xf7e9('0x1f'):var _0x229c1d=require('twilio');if(_0x1ff518[_0xf7e9('0x20')]&&_0x1ff518[_0xf7e9('0x21')]&&_0x1ff518[_0xf7e9('0x22')]){var _0x4ae2de=new _0x229c1d(_0x1ff518[_0xf7e9('0x20')],_0x1ff518[_0xf7e9('0x21')]);_0x4ae2de['messages'][_0xf7e9('0x23')]({'body':_0x3b5953['body'],'to':'whatsapp:'+_0x3b5953[_0xf7e9('0x22')],'from':_0xf7e9('0x24')+_0x1ff518[_0xf7e9('0x22')],'statusCallback':_0x1ff518[_0xf7e9('0x25')]+_0xf7e9('0x26')+_0x3b5953['id']+'/status?token='+_0x1ff518[_0xf7e9('0x27')]})[_0xf7e9('0x17')](function(_0x282fd0){if(_0x282fd0['sid']){return _0x27a18b['update']({'messageId':_0x282fd0['sid']});}})[_0xf7e9('0x19')](function(_0x5a3638){logger[_0xf7e9('0x1a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xf7e9('0x28'),_0xf7e9('0x1f'),util[_0xf7e9('0x29')](_0x5a3638,{'showHidden':![],'depth':null}));});}else{logger[_0xf7e9('0x1a')](_0xf7e9('0x2a'),_0xf7e9('0x28'),_0xf7e9('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xf7e9('0x2b'):var _0x2410c5=_0x1ff518[_0xf7e9('0x20')];var _0x1b7ffc=_0x1ff518['authToken'];var _0x537bd7=_0x1ff518['baseUrl']+'/whatsapp/v1/'+_0x2410c5+_0xf7e9('0x2c');var _0x239dec={'to':[_0x3b5953[_0xf7e9('0x22')]],'message':{'type':'text','text':_0x3b5953[_0xf7e9('0xd')]}};var _0x383402={'method':_0xf7e9('0x2d'),'uri':_0x537bd7,'headers':{'Authorization':_0xf7e9('0x2e')+_0x1b7ffc,'Content-Type':_0xf7e9('0x2f')},'body':_0x239dec,'json':!![]};rp(_0x383402)[_0xf7e9('0x17')](function(_0x2c92bb){if(_0x2c92bb[_0xf7e9('0x30')][0x0][_0xf7e9('0x31')]){return _0x27a18b[_0xf7e9('0x32')]({'messageId':_0x2c92bb[_0xf7e9('0x30')][0x0][_0xf7e9('0x31')]});}})[_0xf7e9('0x19')](function(_0x5133ba){logger[_0xf7e9('0x33')](_0xf7e9('0x34'),_0x5133ba);});break;}}})[_0xf7e9('0x35')](function(){_0xc8a1d4();});}else{_0xc8a1d4();}}},'charset':_0xf7e9('0x36'),'collate':_0xf7e9('0x37')});}; \ No newline at end of file +var _0xcdf8=['afterCreate','inspect','sinch','baseUrl','/messages/','text','message_id','err','WhatsappMessage,\x20%s','lodash','util','api','moment','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','get','toLowerCase','direction','secret','isNil','UserId','findOne','update','createdAt','catch','WhatsappAccount','find','then','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4c8ee2,_0x44d9fb){var _0x385bad=function(_0x395922){while(--_0x395922){_0x4c8ee2['push'](_0x4c8ee2['shift']());}};_0x385bad(++_0x44d9fb);}(_0xcdf8,0x6f));var _0x8cdf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdf8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8cdf('0x0'));var util=require(_0x8cdf('0x1'));var logger=require('../../config/logger')(_0x8cdf('0x2'));var moment=require(_0x8cdf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0x8cdf('0x4'));var fs=require('fs');var path=require(_0x8cdf('0x5'));var rimraf=require(_0x8cdf('0x6'));var config=require(_0x8cdf('0x7'));var attributes=require(_0x8cdf('0x8'));module[_0x8cdf('0x9')]=function(_0x6e558,_0x24b68e){return _0x6e558[_0x8cdf('0xa')](_0x8cdf('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x8cdf('0xc')]},{'name':_0x8cdf('0xd'),'fields':[_0x8cdf('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x191629,_0x59c6df,_0x10353f){var _0x3423b5=_0x6e558['models'];var _0x5f45be=_0x191629[_0x8cdf('0xf')]({'plain':!![]});if(_0x5f45be['direction'][_0x8cdf('0x10')]()==='in'||_0x5f45be[_0x8cdf('0x11')][_0x8cdf('0x10')]()==='out'&&!_0x5f45be[_0x8cdf('0x12')]&&!_[_0x8cdf('0x13')](_0x5f45be[_0x8cdf('0x14')])){_0x3423b5['WhatsappInteraction'][_0x8cdf('0x15')]({'where':{'id':_0x5f45be['WhatsappInteractionId']}})['then'](function(_0xfed8b5){if(_0xfed8b5){_0xfed8b5[_0x8cdf('0x16')]({'lastMsgAt':_0x5f45be[_0x8cdf('0x17')],'lastMsgDirection':_0x5f45be[_0x8cdf('0x11')][_0x8cdf('0x10')]()});}})[_0x8cdf('0x18')](function(_0x4f66a0){console['error'](_0x4f66a0);});}if(_0x5f45be['direction']==='out'&&!_0x5f45be[_0x8cdf('0x12')]){var _0x2c38ab;_0x3423b5[_0x8cdf('0x19')][_0x8cdf('0x1a')]({'where':{'id':_0x5f45be['WhatsappAccountId']},'raw':!![]})[_0x8cdf('0x1b')](function(_0x17e0be){_0x2c38ab=_0x17e0be;if(_0x2c38ab&&_0x2c38ab['type']){switch(_0x2c38ab['type']){case'twilio':var _0x10481e=require(_0x8cdf('0x1c'));if(_0x2c38ab[_0x8cdf('0x1d')]&&_0x2c38ab[_0x8cdf('0x1e')]&&_0x2c38ab[_0x8cdf('0x1f')]){var _0x43d3f8=new _0x10481e(_0x2c38ab[_0x8cdf('0x1d')],_0x2c38ab[_0x8cdf('0x1e')]);_0x43d3f8[_0x8cdf('0x20')][_0x8cdf('0x21')]({'body':_0x5f45be[_0x8cdf('0xe')],'to':_0x8cdf('0x22')+_0x5f45be[_0x8cdf('0x1f')],'from':'whatsapp:'+_0x2c38ab[_0x8cdf('0x1f')],'statusCallback':_0x2c38ab[_0x8cdf('0x23')]+_0x8cdf('0x24')+_0x5f45be['id']+_0x8cdf('0x25')+_0x2c38ab[_0x8cdf('0x26')]})[_0x8cdf('0x1b')](function(_0x58764d){if(_0x58764d['sid']){return _0x191629[_0x8cdf('0x16')]({'messageId':_0x58764d[_0x8cdf('0x27')]});}})[_0x8cdf('0x18')](function(_0x2bd062){logger[_0x8cdf('0x28')](_0x8cdf('0x29'),_0x8cdf('0x2a'),_0x8cdf('0x1c'),util[_0x8cdf('0x2b')](_0x2bd062,{'showHidden':![],'depth':null}));});}else{logger[_0x8cdf('0x28')](_0x8cdf('0x29'),_0x8cdf('0x2a'),_0x8cdf('0x1c'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x8cdf('0x2c'):var _0x5c44c5=_0x2c38ab[_0x8cdf('0x1d')];var _0x4e93b1=_0x2c38ab[_0x8cdf('0x1e')];var _0x18da40=_0x2c38ab[_0x8cdf('0x2d')]+'/whatsapp/v1/'+_0x5c44c5+_0x8cdf('0x2e');var _0x122cef={'to':[_0x5f45be['phone']],'message':{'type':_0x8cdf('0x2f'),'text':_0x5f45be[_0x8cdf('0xe')]}};var _0x4ca4d8={'method':'POST','uri':_0x18da40,'headers':{'Authorization':'Bearer\x20'+_0x4e93b1,'Content-Type':'application/json'},'body':_0x122cef,'json':!![]};rp(_0x4ca4d8)[_0x8cdf('0x1b')](function(_0x455b13){if(_0x455b13['statuses'][0x0][_0x8cdf('0x30')]){return _0x191629['update']({'messageId':_0x455b13['statuses'][0x0][_0x8cdf('0x30')]});}})[_0x8cdf('0x18')](function(_0x1ee48c){logger[_0x8cdf('0x31')](_0x8cdf('0x32'),_0x1ee48c);});break;}}})['finally'](function(){_0x10353f();});}else{_0x10353f();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 1864621..8a4192c 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 _0x19b1=['result','catch','CreateWhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message'];(function(_0x14b016,_0xe3c9e9){var _0xd0c207=function(_0x36fa9a){while(--_0x36fa9a){_0x14b016['push'](_0x14b016['shift']());}};_0xd0c207(++_0xe3c9e9);}(_0x19b1,0x147));var _0x119b=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0x19b1[_0x6dd5c];return _0x5a87fa;};'use strict';var _=require(_0x119b('0x0'));var util=require(_0x119b('0x1'));var moment=require(_0x119b('0x2'));var BPromise=require(_0x119b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x119b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x119b('0x5'))(_0x119b('0x6'));var config=require('../../config/environment');var jayson=require(_0x119b('0x7'));var client=jayson[_0x119b('0x8')][_0x119b('0x9')]({'port':0x232a});config[_0x119b('0xa')]=_[_0x119b('0xb')](config['redis'],{'host':_0x119b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x119b('0xa')]));require('./whatsappMessage.socket')[_0x119b('0xd')](socket);function respondWithRpcPromise(_0x5d4c66,_0x56bfec,_0x5afc47){return new BPromise(function(_0x8972bd,_0x355d99){return client[_0x119b('0xe')](_0x5d4c66,_0x5afc47)[_0x119b('0xf')](function(_0x24aaa2){logger[_0x119b('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x56bfec,'request\x20sent');logger[_0x119b('0x11')](_0x119b('0x12'),_0x56bfec,_0x119b('0x13'),JSON[_0x119b('0x14')](_0x24aaa2));if(_0x24aaa2[_0x119b('0x15')]){if(_0x24aaa2[_0x119b('0x15')][_0x119b('0x16')]===0x1f4){logger[_0x119b('0x15')](_0x119b('0x17'),_0x56bfec,_0x24aaa2[_0x119b('0x15')][_0x119b('0x18')]);return _0x355d99(_0x24aaa2[_0x119b('0x15')][_0x119b('0x18')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x56bfec,_0x24aaa2['error']['message']);return _0x8972bd(_0x24aaa2['error'][_0x119b('0x18')]);}else{logger[_0x119b('0x10')](_0x119b('0x17'),_0x56bfec,'request\x20sent');_0x8972bd(_0x24aaa2[_0x119b('0x19')]['message']);}})[_0x119b('0x1a')](function(_0x2fdd4c){logger['error'](_0x119b('0x17'),_0x56bfec,_0x2fdd4c);_0x355d99(_0x2fdd4c);});});}exports[_0x119b('0x1b')]=function(_0x2629a9){var _0x43b17d=this;return new Promise(function(_0x43ad10,_0x22b488){return db['WhatsappMessage'][_0x119b('0x1c')](_0x2629a9[_0x119b('0x1d')],{'raw':_0x2629a9['options']?_0x2629a9[_0x119b('0x1e')][_0x119b('0x1f')]===undefined?!![]:![]:!![]})[_0x119b('0xf')](function(_0x4c6b29){logger[_0x119b('0x10')](_0x119b('0x1b'),_0x2629a9);logger[_0x119b('0x11')](_0x119b('0x1b'),_0x2629a9,JSON['stringify'](_0x4c6b29));_0x43ad10(_0x4c6b29);})[_0x119b('0x1a')](function(_0x3ab8){logger[_0x119b('0x15')]('CreateWhatsappMessage',_0x3ab8[_0x119b('0x18')],_0x2629a9);_0x22b488(_0x43b17d[_0x119b('0x15')](0x1f4,_0x3ab8[_0x119b('0x18')]));});});}; \ No newline at end of file +var _0x6ae0=['result','CreateWhatsappMessage','WhatsappMessage','body','options','raw','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x6ae0,0x104));var _0x06ae=function(_0x315b6c,_0x3ceb35){_0x315b6c=_0x315b6c-0x0;var _0x32f27e=_0x6ae0[_0x315b6c];return _0x32f27e;};'use strict';var _=require(_0x06ae('0x0'));var util=require('util');var moment=require(_0x06ae('0x1'));var BPromise=require(_0x06ae('0x2'));var rs=require(_0x06ae('0x3'));var fs=require('fs');var Redis=require(_0x06ae('0x4'));var db=require(_0x06ae('0x5'))['db'];var utils=require(_0x06ae('0x6'));var logger=require(_0x06ae('0x7'))(_0x06ae('0x8'));var config=require(_0x06ae('0x9'));var jayson=require(_0x06ae('0xa'));var client=jayson[_0x06ae('0xb')][_0x06ae('0xc')]({'port':0x232a});config[_0x06ae('0xd')]=_[_0x06ae('0xe')](config[_0x06ae('0xd')],{'host':_0x06ae('0xf'),'port':0x18eb});var socket=require(_0x06ae('0x10'))(new Redis(config[_0x06ae('0xd')]));require(_0x06ae('0x11'))['register'](socket);function respondWithRpcPromise(_0x2ef378,_0xba32b1,_0x5aa7d6){return new BPromise(function(_0x420315,_0x27d032){return client[_0x06ae('0x12')](_0x2ef378,_0x5aa7d6)['then'](function(_0x1be323){logger[_0x06ae('0x13')](_0x06ae('0x14'),_0xba32b1,'request\x20sent');logger[_0x06ae('0x15')](_0x06ae('0x16'),_0xba32b1,_0x06ae('0x17'),JSON[_0x06ae('0x18')](_0x1be323));if(_0x1be323[_0x06ae('0x19')]){if(_0x1be323['error'][_0x06ae('0x1a')]===0x1f4){logger[_0x06ae('0x19')](_0x06ae('0x14'),_0xba32b1,_0x1be323['error'][_0x06ae('0x1b')]);return _0x27d032(_0x1be323[_0x06ae('0x19')][_0x06ae('0x1b')]);}logger['error'](_0x06ae('0x14'),_0xba32b1,_0x1be323['error']['message']);return _0x420315(_0x1be323[_0x06ae('0x19')]['message']);}else{logger[_0x06ae('0x13')](_0x06ae('0x14'),_0xba32b1,_0x06ae('0x17'));_0x420315(_0x1be323[_0x06ae('0x1c')]['message']);}})['catch'](function(_0x133cc0){logger[_0x06ae('0x19')](_0x06ae('0x14'),_0xba32b1,_0x133cc0);_0x27d032(_0x133cc0);});});}exports[_0x06ae('0x1d')]=function(_0xce81be){var _0x56063e=this;return new Promise(function(_0x5af998,_0x131f40){return db[_0x06ae('0x1e')]['create'](_0xce81be[_0x06ae('0x1f')],{'raw':_0xce81be[_0x06ae('0x20')]?_0xce81be[_0x06ae('0x20')][_0x06ae('0x21')]===undefined?!![]:![]:!![]})[_0x06ae('0x22')](function(_0x570720){logger[_0x06ae('0x13')]('CreateWhatsappMessage',_0xce81be);logger[_0x06ae('0x15')]('CreateWhatsappMessage',_0xce81be,JSON[_0x06ae('0x18')](_0x570720));_0x5af998(_0x570720);})[_0x06ae('0x23')](function(_0x5372c3){logger[_0x06ae('0x19')](_0x06ae('0x1d'),_0x5372c3[_0x06ae('0x1b')],_0xce81be);_0x131f40(_0x56063e[_0x06ae('0x19')](0x1f4,_0x5372c3[_0x06ae('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 6e8824e..5f33e83 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 _0x4ebe=['remove','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0x3a4869,_0x28774b){var _0x46c84d=function(_0x2f9615){while(--_0x2f9615){_0x3a4869['push'](_0x3a4869['shift']());}};_0x46c84d(++_0x28774b);}(_0x4ebe,0xe0));var _0xe4eb=function(_0x5b34d5,_0x2ca536){_0x5b34d5=_0x5b34d5-0x0;var _0x5c76a2=_0x4ebe[_0x5b34d5];return _0x5c76a2;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0xe4eb('0x0'),_0xe4eb('0x1')];function createListener(_0x1f825e,_0x556468){return function(_0xb8826){_0x556468[_0xe4eb('0x2')](_0x1f825e,_0xb8826);};}function removeListener(_0x25968d,_0x3990b3){return function(){WhatsappMessageEvents[_0xe4eb('0x3')](_0x25968d,_0x3990b3);};}exports[_0xe4eb('0x4')]=function(_0x1ce988){for(var _0x7deb4=0x0,_0x5c1c8b=events[_0xe4eb('0x5')];_0x7deb4<_0x5c1c8b;_0x7deb4++){var _0x44c09b=events[_0x7deb4];var _0x1739a7=createListener(_0xe4eb('0x6')+_0x44c09b,_0x1ce988);WhatsappMessageEvents['on'](_0x44c09b,_0x1739a7);}}; \ No newline at end of file +var _0xdf27=['removeListener','register','whatsappMessage:','./whatsappMessage.events','remove','emit'];(function(_0x3ef888,_0x2a01f3){var _0x14d858=function(_0x41b436){while(--_0x41b436){_0x3ef888['push'](_0x3ef888['shift']());}};_0x14d858(++_0x2a01f3);}(_0xdf27,0x1e9));var _0x7df2=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdf27[_0x5b644e];return _0x49c6bf;};'use strict';var WhatsappMessageEvents=require(_0x7df2('0x0'));var events=['save',_0x7df2('0x1'),'update'];function createListener(_0x1c2d3e,_0x53352e){return function(_0xeb1940){_0x53352e[_0x7df2('0x2')](_0x1c2d3e,_0xeb1940);};}function removeListener(_0x159c24,_0x11073c){return function(){WhatsappMessageEvents[_0x7df2('0x3')](_0x159c24,_0x11073c);};}exports[_0x7df2('0x4')]=function(_0x6a1dbb){for(var _0x2a5419=0x0,_0x4d6d16=events['length'];_0x2a5419<_0x4d6d16;_0x2a5419++){var _0xf03641=events[_0x2a5419];var _0x17b09b=createListener(_0x7df2('0x5')+_0xf03641,_0x6a1dbb);WhatsappMessageEvents['on'](_0xf03641,_0x17b09b);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index b3238ce..dfb0e73 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 _0x3216=['/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','/:id/members','getMembers'];(function(_0x8fea8e,_0x40b8ce){var _0x146991=function(_0x49eb62){while(--_0x49eb62){_0x8fea8e['push'](_0x8fea8e['shift']());}};_0x146991(++_0x40b8ce);}(_0x3216,0xf6));var _0x6321=function(_0x17ab23,_0x43c1e4){_0x17ab23=_0x17ab23-0x0;var _0x8176f5=_0x3216[_0x17ab23];return _0x8176f5;};'use strict';var multer=require(_0x6321('0x0'));var util=require(_0x6321('0x1'));var path=require(_0x6321('0x2'));var timeout=require('connect-timeout');var express=require(_0x6321('0x3'));var router=express[_0x6321('0x4')]();var fs_extra=require(_0x6321('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6321('0x6'));var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0x6321('0x7')](),controller[_0x6321('0x8')]);router['get'](_0x6321('0x9'),auth['isAuthenticated'](),controller[_0x6321('0xa')]);router[_0x6321('0xb')](_0x6321('0xc'),auth[_0x6321('0x7')](),controller['show']);router[_0x6321('0xb')](_0x6321('0xd'),auth['isAuthenticated'](),controller[_0x6321('0xe')]);router[_0x6321('0xb')](_0x6321('0xf'),auth[_0x6321('0x7')](),controller[_0x6321('0x10')]);router[_0x6321('0xb')](_0x6321('0x11'),auth['isAuthenticated'](),controller[_0x6321('0x12')]);router[_0x6321('0x13')]('/',auth[_0x6321('0x7')](),controller[_0x6321('0x14')]);router['post'](_0x6321('0xf'),auth[_0x6321('0x7')](),controller[_0x6321('0x15')]);router[_0x6321('0x13')](_0x6321('0x11'),auth[_0x6321('0x7')](),controller[_0x6321('0x16')]);router[_0x6321('0x17')](_0x6321('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x6321('0x18')](_0x6321('0xc'),auth[_0x6321('0x7')](),controller[_0x6321('0x19')]);router[_0x6321('0x18')]('/:id/teams',auth[_0x6321('0x7')](),controller[_0x6321('0x1a')]);router[_0x6321('0x18')](_0x6321('0x11'),auth[_0x6321('0x7')](),controller[_0x6321('0x1b')]);module[_0x6321('0x1c')]=router; \ No newline at end of file +var _0x2e57=['getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','/:id','delete','destroy','removeTeams','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members'];(function(_0x16192f,_0x5d0191){var _0x559b5b=function(_0x12f33b){while(--_0x12f33b){_0x16192f['push'](_0x16192f['shift']());}};_0x559b5b(++_0x5d0191);}(_0x2e57,0x8d));var _0x72e5=function(_0x10f24d,_0xbb2035){_0x10f24d=_0x10f24d-0x0;var _0x44370c=_0x2e57[_0x10f24d];return _0x44370c;};'use strict';var multer=require(_0x72e5('0x0'));var util=require(_0x72e5('0x1'));var path=require(_0x72e5('0x2'));var timeout=require(_0x72e5('0x3'));var express=require('express');var router=express[_0x72e5('0x4')]();var fs_extra=require(_0x72e5('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x72e5('0x6'));var controller=require(_0x72e5('0x7'));router[_0x72e5('0x8')]('/',auth[_0x72e5('0x9')](),controller[_0x72e5('0xa')]);router[_0x72e5('0x8')](_0x72e5('0xb'),auth[_0x72e5('0x9')](),controller[_0x72e5('0xc')]);router[_0x72e5('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x72e5('0xd')]);router['get'](_0x72e5('0xe'),auth[_0x72e5('0x9')](),controller['getMembers']);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x72e5('0xf')]);router[_0x72e5('0x8')](_0x72e5('0x10'),auth['isAuthenticated'](),controller[_0x72e5('0x11')]);router[_0x72e5('0x12')]('/',auth[_0x72e5('0x9')](),controller[_0x72e5('0x13')]);router[_0x72e5('0x12')](_0x72e5('0x14'),auth[_0x72e5('0x9')](),controller['addTeams']);router['post'](_0x72e5('0x10'),auth['isAuthenticated'](),controller[_0x72e5('0x15')]);router['put'](_0x72e5('0x16'),auth[_0x72e5('0x9')](),controller['update']);router[_0x72e5('0x17')](_0x72e5('0x16'),auth[_0x72e5('0x9')](),controller[_0x72e5('0x18')]);router[_0x72e5('0x17')](_0x72e5('0x14'),auth['isAuthenticated'](),controller[_0x72e5('0x19')]);router['delete'](_0x72e5('0x10'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 243fe24..ca145bd 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 _0x93e7=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x93e7,0x9e));var _0x793e=function(_0x5ec453,_0x30b0ba){_0x5ec453=_0x5ec453-0x0;var _0x25548f=_0x93e7[_0x5ec453];return _0x25548f;};'use strict';var Sequelize=require(_0x793e('0x0'));module['exports']={'name':{'type':Sequelize[_0x793e('0x1')],'unique':_0x793e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x793e('0x3')](_0x793e('0x4'),_0x793e('0x5'),_0x793e('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2bdb=['ENUM','rrmemory','roundrobin','sequelize','STRING','INTEGER'];(function(_0x1174b6,_0x1e979e){var _0x146822=function(_0x502040){while(--_0x502040){_0x1174b6['push'](_0x1174b6['shift']());}};_0x146822(++_0x1e979e);}(_0x2bdb,0x105));var _0xb2bd=function(_0x43db66,_0x240ae8){_0x43db66=_0x43db66-0x0;var _0x164edd=_0x2bdb[_0x43db66];return _0x164edd;};'use strict';var Sequelize=require(_0xb2bd('0x0'));module['exports']={'name':{'type':Sequelize[_0xb2bd('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb2bd('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb2bd('0x3')](_0xb2bd('0x4'),'beepall',_0xb2bd('0x5'))},'description':{'type':Sequelize[_0xb2bd('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 7cb634a..443dde8 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 _0xd2c9=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','fields','sort','pick','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','ids','Team','User','Agents','voicePause','flatMap','sequelize','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','WhatsappQueues','UserProfileResource','destroy','error','stack','index','map','WhatsappQueue','fieldName','key','model','name','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','user','get'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xd2c9,0x151));var _0x9d2c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2c9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9d2c('0x0'));var rimraf=require(_0x9d2c('0x1'));var zipdir=require(_0x9d2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9d2c('0x3'));var BPromise=require(_0x9d2c('0x4'));var Mustache=require('mustache');var util=require(_0x9d2c('0x5'));var path=require(_0x9d2c('0x6'));var sox=require(_0x9d2c('0x7'));var csv=require('to-csv');var ejs=require(_0x9d2c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d2c('0x9'));var squel=require(_0x9d2c('0xa'));var crypto=require(_0x9d2c('0xb'));var jsforce=require(_0x9d2c('0xc'));var deskjs=require(_0x9d2c('0xd'));var toCsv=require(_0x9d2c('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9d2c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9d2c('0x10'));var as=require(_0x9d2c('0x11'));var hardwareService=require(_0x9d2c('0x12'));var logger=require(_0x9d2c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9d2c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d2c('0x15'))['db'];config[_0x9d2c('0x16')]=_[_0x9d2c('0x17')](config[_0x9d2c('0x16')],{'host':_0x9d2c('0x18'),'port':0x18eb});var socket=require(_0x9d2c('0x19'))(new Redis(config[_0x9d2c('0x16')]));require(_0x9d2c('0x1a'))[_0x9d2c('0x1b')](socket);function respondWithStatusCode(_0x3b2507,_0x39790c){_0x39790c=_0x39790c||0xcc;return function(_0x59d63c){if(_0x59d63c){return _0x3b2507[_0x9d2c('0x1c')](_0x39790c);}return _0x3b2507[_0x9d2c('0x1d')](_0x39790c)[_0x9d2c('0x1e')]();};}function respondWithResult(_0x445ea3,_0x2564bb){_0x2564bb=_0x2564bb||0xc8;return function(_0x10dcb5){if(_0x10dcb5){return _0x445ea3[_0x9d2c('0x1d')](_0x2564bb)[_0x9d2c('0x1f')](_0x10dcb5);}};}function respondWithFilteredResult(_0x54924a,_0x89c2de){return function(_0x26782d){if(_0x26782d){var _0x52d09e=typeof _0x89c2de['offset']==='undefined'&&typeof _0x89c2de['limit']===_0x9d2c('0x20');var _0x55f2d6=_0x26782d[_0x9d2c('0x21')];var _0x2c531f=_0x52d09e?0x0:_0x89c2de[_0x9d2c('0x22')];var _0x3972ca=_0x52d09e?_0x26782d['count']:_0x89c2de[_0x9d2c('0x22')]+_0x89c2de[_0x9d2c('0x23')];var _0x62867f;if(_0x3972ca>=_0x55f2d6){_0x3972ca=_0x55f2d6;_0x62867f=0xc8;}else{_0x62867f=0xce;}_0x54924a[_0x9d2c('0x1d')](_0x62867f);return _0x54924a[_0x9d2c('0x24')](_0x9d2c('0x25'),_0x2c531f+'-'+_0x3972ca+'/'+_0x55f2d6)[_0x9d2c('0x1f')](_0x26782d);}return null;};}function patchUpdates(_0x2f044c){return function(_0x431fba){try{jsonpatch[_0x9d2c('0x26')](_0x431fba,_0x2f044c,!![]);}catch(_0x323c9e){return BPromise[_0x9d2c('0x27')](_0x323c9e);}return _0x431fba[_0x9d2c('0x28')]();};}function saveUpdates(_0x4fc0f3,_0x2c5982){return function(_0x23d3ce){if(_0x23d3ce){return _0x23d3ce[_0x9d2c('0x29')](_0x4fc0f3)[_0x9d2c('0x2a')](function(_0x5164c5){return _0x5164c5;});}return null;};}function removeEntity(_0xaaad89,_0x29347e){return function(_0x2057cf){if(_0x2057cf){return _0x2057cf['destroy']()['then'](function(){var _0xd825e5=_0x2057cf['get']({'plain':!![]});var _0x9c7e9b=_0x9d2c('0x2b');return db[_0x9d2c('0x2c')][_0x9d2c('0x2d')]({'where':{'type':_0x9c7e9b,'resourceId':_0xd825e5['id']}})['then'](function(){return _0x2057cf;});})[_0x9d2c('0x2a')](function(){_0xaaad89[_0x9d2c('0x1d')](0xcc)[_0x9d2c('0x1e')]();});}};}function handleEntityNotFound(_0x42e760,_0xee38a0){return function(_0x1fac1b){if(!_0x1fac1b){_0x42e760['sendStatus'](0x194);}return _0x1fac1b;};}function handleError(_0x11df9b,_0x5b3510){_0x5b3510=_0x5b3510||0x1f4;return function(_0x990325){logger[_0x9d2c('0x2e')](_0x990325[_0x9d2c('0x2f')]);if(_0x990325['name']){delete _0x990325['name'];}_0x11df9b['status'](_0x5b3510)['send'](_0x990325);};}exports[_0x9d2c('0x30')]=function(_0x1858e4,_0x4d720b){var _0x513f51={},_0x2a473b={},_0x26f4d5={'count':0x0,'rows':[]};var _0xdd2b73=_[_0x9d2c('0x31')](db[_0x9d2c('0x32')]['rawAttributes'],function(_0x4ac6d5){return{'name':_0x4ac6d5[_0x9d2c('0x33')],'type':_0x4ac6d5['type'][_0x9d2c('0x34')]};});_0x2a473b[_0x9d2c('0x35')]=_[_0x9d2c('0x31')](_0xdd2b73,_0x9d2c('0x36'));_0x2a473b[_0x9d2c('0x37')]=_[_0x9d2c('0x38')](_0x1858e4[_0x9d2c('0x37')]);_0x2a473b[_0x9d2c('0x39')]=_[_0x9d2c('0x3a')](_0x2a473b[_0x9d2c('0x35')],_0x2a473b['query']);_0x513f51[_0x9d2c('0x3b')]=_[_0x9d2c('0x3a')](_0x2a473b[_0x9d2c('0x35')],qs['fields'](_0x1858e4['query']['fields']));_0x513f51[_0x9d2c('0x3b')]=_0x513f51[_0x9d2c('0x3b')]['length']?_0x513f51[_0x9d2c('0x3b')]:_0x2a473b[_0x9d2c('0x35')];if(!_0x1858e4['query'][_0x9d2c('0x3c')](_0x9d2c('0x3d'))){_0x513f51[_0x9d2c('0x23')]=qs[_0x9d2c('0x23')](_0x1858e4[_0x9d2c('0x37')]['limit']);_0x513f51[_0x9d2c('0x22')]=qs[_0x9d2c('0x22')](_0x1858e4[_0x9d2c('0x37')]['offset']);}_0x513f51[_0x9d2c('0x3e')]=qs['sort'](_0x1858e4[_0x9d2c('0x37')]['sort']);_0x513f51[_0x9d2c('0x3f')]=qs[_0x9d2c('0x39')](_['pick'](_0x1858e4[_0x9d2c('0x37')],_0x2a473b[_0x9d2c('0x39')]),_0xdd2b73);if(_0x1858e4['query'][_0x9d2c('0x40')]){_0x513f51['where']=_[_0x9d2c('0x41')](_0x513f51[_0x9d2c('0x3f')],{'$or':_[_0x9d2c('0x31')](_0xdd2b73,function(_0x1513da){if(_0x1513da[_0x9d2c('0x42')]!==_0x9d2c('0x43')){var _0x5f1a72={};_0x5f1a72[_0x1513da[_0x9d2c('0x36')]]={'$like':'%'+_0x1858e4[_0x9d2c('0x37')][_0x9d2c('0x40')]+'%'};return _0x5f1a72;}})});}_0x513f51=_[_0x9d2c('0x41')]({},_0x513f51,_0x1858e4[_0x9d2c('0x44')]);var _0x218483={'where':_0x513f51[_0x9d2c('0x3f')]};return db[_0x9d2c('0x32')]['count'](_0x218483)[_0x9d2c('0x2a')](function(_0x4c1eb3){_0x26f4d5[_0x9d2c('0x21')]=_0x4c1eb3;if(_0x1858e4[_0x9d2c('0x37')][_0x9d2c('0x45')]){_0x513f51[_0x9d2c('0x46')]=[{'all':!![]}];}return db[_0x9d2c('0x32')][_0x9d2c('0x47')](_0x513f51);})[_0x9d2c('0x2a')](function(_0x2bf6ca){_0x26f4d5[_0x9d2c('0x48')]=_0x2bf6ca;return _0x26f4d5;})['then'](respondWithFilteredResult(_0x4d720b,_0x513f51))[_0x9d2c('0x49')](handleError(_0x4d720b,null));};exports[_0x9d2c('0x4a')]=function(_0x1e20cd,_0x27c6f7){var _0x1db4c4={'raw':!![],'where':{'id':_0x1e20cd[_0x9d2c('0x4b')]['id']}},_0x14a4c1={};_0x14a4c1[_0x9d2c('0x35')]=_['keys'](db[_0x9d2c('0x32')][_0x9d2c('0x4c')]);_0x14a4c1[_0x9d2c('0x37')]=_[_0x9d2c('0x38')](_0x1e20cd[_0x9d2c('0x37')]);_0x14a4c1['filters']=_[_0x9d2c('0x3a')](_0x14a4c1[_0x9d2c('0x35')],_0x14a4c1[_0x9d2c('0x37')]);_0x1db4c4[_0x9d2c('0x3b')]=_[_0x9d2c('0x3a')](_0x14a4c1['model'],qs['fields'](_0x1e20cd['query']['fields']));_0x1db4c4['attributes']=_0x1db4c4[_0x9d2c('0x3b')][_0x9d2c('0x4d')]?_0x1db4c4[_0x9d2c('0x3b')]:_0x14a4c1[_0x9d2c('0x35')];if(_0x1e20cd[_0x9d2c('0x37')][_0x9d2c('0x45')]){_0x1db4c4[_0x9d2c('0x46')]=[{'all':!![]}];}_0x1db4c4=_[_0x9d2c('0x41')]({},_0x1db4c4,_0x1e20cd[_0x9d2c('0x44')]);return db[_0x9d2c('0x32')][_0x9d2c('0x4e')](_0x1db4c4)[_0x9d2c('0x2a')](handleEntityNotFound(_0x27c6f7,null))[_0x9d2c('0x2a')](respondWithResult(_0x27c6f7,null))[_0x9d2c('0x49')](handleError(_0x27c6f7,null));};exports[_0x9d2c('0x4f')]=function(_0x4d5801,_0xcfdc6b){return db[_0x9d2c('0x32')][_0x9d2c('0x4f')](_0x4d5801[_0x9d2c('0x50')],{})['then'](function(_0x2a8d86){var _0x3e26c1=_0x4d5801[_0x9d2c('0x51')][_0x9d2c('0x52')]({'plain':!![]});if(!_0x3e26c1)throw new Error(_0x9d2c('0x53'));if(_0x3e26c1[_0x9d2c('0x54')]===_0x9d2c('0x51')){var _0x443449=_0x2a8d86[_0x9d2c('0x52')]({'plain':!![]});var _0xee77bb=_0x9d2c('0x2b');return db['UserProfileSection'][_0x9d2c('0x4e')]({'where':{'name':_0xee77bb,'userProfileId':_0x3e26c1[_0x9d2c('0x55')]},'raw':!![]})[_0x9d2c('0x2a')](function(_0x313f37){if(_0x313f37&&_0x313f37['autoAssociation']===0x0){return db[_0x9d2c('0x2c')][_0x9d2c('0x4f')]({'name':_0x443449[_0x9d2c('0x36')],'resourceId':_0x443449['id'],'type':_0x313f37[_0x9d2c('0x36')],'sectionId':_0x313f37['id']},{})[_0x9d2c('0x2a')](function(){return _0x2a8d86;});}else{return _0x2a8d86;}})[_0x9d2c('0x49')](function(_0x52caff){logger[_0x9d2c('0x2e')](_0x9d2c('0x56'),_0x52caff);throw _0x52caff;});}return _0x2a8d86;})[_0x9d2c('0x2a')](respondWithResult(_0xcfdc6b,0xc9))['catch'](handleError(_0xcfdc6b,null));};exports[_0x9d2c('0x29')]=function(_0x3457fc,_0x347e38){if(_0x3457fc[_0x9d2c('0x50')]['id']){delete _0x3457fc[_0x9d2c('0x50')]['id'];}return db[_0x9d2c('0x32')]['find']({'where':{'id':_0x3457fc[_0x9d2c('0x4b')]['id']}})[_0x9d2c('0x2a')](handleEntityNotFound(_0x347e38,null))['then'](saveUpdates(_0x3457fc[_0x9d2c('0x50')],null))[_0x9d2c('0x2a')](respondWithResult(_0x347e38,null))[_0x9d2c('0x49')](handleError(_0x347e38,null));};exports[_0x9d2c('0x2d')]=function(_0x2d64c8,_0x38bc91){return db[_0x9d2c('0x32')][_0x9d2c('0x4e')]({'where':{'id':_0x2d64c8[_0x9d2c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38bc91,null))[_0x9d2c('0x2a')](removeEntity(_0x38bc91,null))[_0x9d2c('0x49')](handleError(_0x38bc91,null));};exports['describe']=function(_0x328136,_0x586315){return db[_0x9d2c('0x32')][_0x9d2c('0x57')]()[_0x9d2c('0x2a')](respondWithResult(_0x586315,null))[_0x9d2c('0x49')](handleError(_0x586315,null));};exports[_0x9d2c('0x58')]=function(_0x231e77,_0x5aa278,_0x9eea67){var _0x52ebca={'raw':!![],'where':{}},_0x2add86={},_0x16b438;return db['WhatsappQueue'][_0x9d2c('0x59')]({'where':{'id':_0x231e77[_0x9d2c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5aa278,null))['then'](function(_0x408f4a){if(_0x408f4a){_0x16b438=_0x408f4a[_0x9d2c('0x52')]({'plain':!![]});_0x2add86[_0x9d2c('0x35')]=_[_0x9d2c('0x38')](db[_0x9d2c('0x5a')][_0x9d2c('0x4c')]);_0x2add86[_0x9d2c('0x37')]=_[_0x9d2c('0x38')](_0x231e77['query']);_0x2add86[_0x9d2c('0x39')]=_['intersection'](_0x2add86[_0x9d2c('0x35')],_0x2add86[_0x9d2c('0x37')]);_0x52ebca['attributes']=_[_0x9d2c('0x3a')](_0x2add86[_0x9d2c('0x35')],qs['fields'](_0x231e77[_0x9d2c('0x37')][_0x9d2c('0x5b')]));_0x52ebca[_0x9d2c('0x3b')]=_0x52ebca[_0x9d2c('0x3b')][_0x9d2c('0x4d')]?_0x52ebca['attributes']:_0x2add86[_0x9d2c('0x35')];if(!_0x231e77[_0x9d2c('0x37')][_0x9d2c('0x3c')](_0x9d2c('0x3d'))){_0x52ebca[_0x9d2c('0x23')]=qs['limit'](_0x231e77[_0x9d2c('0x37')][_0x9d2c('0x23')]);_0x52ebca[_0x9d2c('0x22')]=qs['offset'](_0x231e77[_0x9d2c('0x37')]['offset']);}_0x52ebca['order']=qs[_0x9d2c('0x5c')](_0x231e77[_0x9d2c('0x37')][_0x9d2c('0x5c')]);_0x52ebca[_0x9d2c('0x3f')]=qs[_0x9d2c('0x39')](_[_0x9d2c('0x5d')](_0x231e77[_0x9d2c('0x37')],_0x2add86[_0x9d2c('0x39')]));_0x52ebca[_0x9d2c('0x3f')][_0x9d2c('0x5e')]=_0x408f4a['id'];if(_0x231e77[_0x9d2c('0x37')][_0x9d2c('0x40')]){_0x52ebca[_0x9d2c('0x3f')]=_[_0x9d2c('0x41')](_0x52ebca[_0x9d2c('0x3f')],{'$or':_[_0x9d2c('0x31')](_0x52ebca['attributes'],function(_0x307197){var _0x22362c={};_0x22362c[_0x307197]={'$like':'%'+_0x231e77[_0x9d2c('0x37')]['filter']+'%'};return _0x22362c;})});}_0x52ebca=_[_0x9d2c('0x41')]({},_0x52ebca,_0x231e77['options']);return db[_0x9d2c('0x5a')][_0x9d2c('0x47')](_0x52ebca);}})[_0x9d2c('0x2a')](function(_0x214e16){if(_0x214e16){return db['User'][_0x9d2c('0x5f')]({'where':{'id':_['map'](_0x214e16,_0x9d2c('0x60')),'role':_0x9d2c('0x61')},'attributes':['id',_0x9d2c('0x36'),_0x9d2c('0x62'),_0x9d2c('0x63'),_0x9d2c('0x64')]});}})[_0x9d2c('0x2a')](function(_0xd3ead2){if(_0xd3ead2){return{'count':_0xd3ead2[_0x9d2c('0x21')],'rows':_['map'](_0xd3ead2[_0x9d2c('0x48')],function(_0xef013d){return{'membername':_0xef013d[_0x9d2c('0x36')],'UserId':_0xef013d['id'],'queue_name':_0x16b438[_0x9d2c('0x36')],'WhatsappQueueId':_0x16b438['id'],'interface':util[_0x9d2c('0x65')]('%s/%s',_0x9d2c('0x66'),_0xef013d['name']),'penalty':0x0,'paused':_0xef013d['whatsappPause'],'createdAt':_0xef013d[_0x9d2c('0x64')],'updatedAt':_0xef013d[_0x9d2c('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9d2c('0x2a')](respondWithFilteredResult(_0x5aa278,_0x52ebca))[_0x9d2c('0x49')](handleError(_0x5aa278,null));};exports[_0x9d2c('0x67')]=function(_0x22227b,_0x2ddaef,_0x5613c7){var _0x4ccca6={};var _0x3ac59a={};var _0x46fae8;var _0x1e29f3;return db[_0x9d2c('0x32')][_0x9d2c('0x59')]({'where':{'id':_0x22227b['params']['id']}})[_0x9d2c('0x2a')](handleEntityNotFound(_0x2ddaef,null))[_0x9d2c('0x2a')](function(_0x52db39){if(_0x52db39){_0x46fae8=_0x52db39;_0x3ac59a[_0x9d2c('0x35')]=_[_0x9d2c('0x38')](db['Team'][_0x9d2c('0x4c')]);_0x3ac59a[_0x9d2c('0x37')]=_[_0x9d2c('0x38')](_0x22227b[_0x9d2c('0x37')]);_0x3ac59a[_0x9d2c('0x39')]=_[_0x9d2c('0x3a')](_0x3ac59a[_0x9d2c('0x35')],_0x3ac59a[_0x9d2c('0x37')]);_0x4ccca6[_0x9d2c('0x3b')]=_[_0x9d2c('0x3a')](_0x3ac59a[_0x9d2c('0x35')],qs[_0x9d2c('0x5b')](_0x22227b[_0x9d2c('0x37')][_0x9d2c('0x5b')]));_0x4ccca6[_0x9d2c('0x3b')]=_0x4ccca6['attributes'][_0x9d2c('0x4d')]?_0x4ccca6[_0x9d2c('0x3b')]:_0x3ac59a[_0x9d2c('0x35')];_0x4ccca6[_0x9d2c('0x3e')]=qs[_0x9d2c('0x5c')](_0x22227b['query']['sort']);_0x4ccca6['where']=qs[_0x9d2c('0x39')](_['pick'](_0x22227b[_0x9d2c('0x37')],_0x3ac59a['filters']));if(_0x22227b['query'][_0x9d2c('0x40')]){_0x4ccca6['where']=_[_0x9d2c('0x41')](_0x4ccca6[_0x9d2c('0x3f')],{'$or':_[_0x9d2c('0x31')](_0x4ccca6[_0x9d2c('0x3b')],function(_0x4f7287){var _0x3f7602={};_0x3f7602[_0x4f7287]={'$like':'%'+_0x22227b[_0x9d2c('0x37')]['filter']+'%'};return _0x3f7602;})});}_0x4ccca6=_[_0x9d2c('0x41')]({},_0x4ccca6,_0x22227b[_0x9d2c('0x44')]);return _0x46fae8['getTeams'](_0x4ccca6);}})[_0x9d2c('0x2a')](function(_0x5b4f87){if(_0x5b4f87){_0x1e29f3=_0x5b4f87[_0x9d2c('0x4d')];if(!_0x22227b['query'][_0x9d2c('0x3c')]('nolimit')){_0x4ccca6['limit']=qs[_0x9d2c('0x23')](_0x22227b['query'][_0x9d2c('0x23')]);_0x4ccca6[_0x9d2c('0x22')]=qs[_0x9d2c('0x22')](_0x22227b[_0x9d2c('0x37')][_0x9d2c('0x22')]);}return _0x46fae8['getTeams'](_0x4ccca6);}})[_0x9d2c('0x2a')](function(_0x212955){if(_0x212955){return _0x212955?{'count':_0x1e29f3,'rows':_0x212955}:null;}})['then'](respondWithResult(_0x2ddaef,null))['catch'](handleError(_0x2ddaef,null));};exports['addTeams']=function(_0x1c3719,_0x216942,_0x3a1d06){var _0x3d88b6=_0x1c3719[_0x9d2c('0x50')][_0x9d2c('0x68')];return db[_0x9d2c('0x69')][_0x9d2c('0x47')]({'where':{'id':_0x3d88b6},'attributes':['id'],'include':[{'model':db[_0x9d2c('0x6a')],'as':_0x9d2c('0x6b'),'attributes':['id',_0x9d2c('0x36'),'online',_0x9d2c('0x6c'),'interface'],'raw':!![]}]})['then'](function(_0x1b4454){if(_0x1b4454){var _0x6c1845=_[_0x9d2c('0x6d')](_0x1b4454,function(_0x489887){var _0x3d572b=_0x489887[_0x9d2c('0x52')]({'plain':!![]});return _0x3d572b[_0x9d2c('0x6b')];});return db[_0x9d2c('0x32')]['find']({'where':{'id':_0x1c3719['params']['id']}})[_0x9d2c('0x2a')](function(_0x5cdd41){return db[_0x9d2c('0x6e')]['transaction'](function(_0x32ad31){return _0x5cdd41['addTeams'](_0x3d88b6,{'transaction':_0x32ad31})[_0x9d2c('0x2a')](function(){return BPromise['each'](_0x6c1845,function(_0x3cc14d){return db['UserWhatsappQueue'][_0x9d2c('0x6f')]({'where':{'UserId':_0x3cc14d['id'],'WhatsappQueueId':_0x1c3719[_0x9d2c('0x4b')]['id']},'transaction':_0x32ad31});});})[_0x9d2c('0x2a')](function(){_0x6c1845[_0x9d2c('0x70')](function(_0x7cbd8b){socket[_0x9d2c('0x71')](_0x9d2c('0x72'),{'UserId':_0x7cbd8b['id'],'WhatsappQueueId':_0x5cdd41['id']});});});});});}})[_0x9d2c('0x2a')](respondWithStatusCode(_0x216942,null))['catch'](handleError(_0x216942,null));};exports[_0x9d2c('0x73')]=function(_0x2610e8,_0x43a6f6,_0x43d043){return db[_0x9d2c('0x69')]['findAll']({'where':{'id':_0x2610e8[_0x9d2c('0x37')][_0x9d2c('0x68')]},'attributes':['id'],'include':[{'model':db[_0x9d2c('0x6a')],'as':_0x9d2c('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x43a6f6,null))['then'](function(_0x41ed4f){var _0x50619f=_['map'](_0x41ed4f,'id');var _0x3b7080=[];var _0x3a4306=[];var _0x117e90=squel[_0x9d2c('0x74')]();_0x117e90[_0x9d2c('0x75')](_0x9d2c('0x76'))[_0x9d2c('0x77')](_0x9d2c('0x78'),'tq')['join'](_0x9d2c('0x79'),'ut',_0x9d2c('0x7a'))[_0x9d2c('0x3f')](_0x9d2c('0x7b'),_0x2610e8[_0x9d2c('0x4b')]['id']);for(var _0x128ad7=0x0;_0x128ad7<_0x41ed4f[_0x9d2c('0x4d')];_0x128ad7+=0x1){let _0x1a7ef2=_0x41ed4f[_0x128ad7];for(var _0x5a585f=0x0;_0x5a585f<_0x1a7ef2[_0x9d2c('0x6b')][_0x9d2c('0x4d')];_0x5a585f+=0x1){let _0x493d70=_0x1a7ef2[_0x9d2c('0x6b')][_0x5a585f];var _0x4fc7a4=_0x117e90[_0x9d2c('0x7c')]();_0x4fc7a4['where'](_0x9d2c('0x7d'),_0x493d70['id']);_0x3a4306['push'](db[_0x9d2c('0x6e')][_0x9d2c('0x37')](_0x4fc7a4['toString'](),{'type':db[_0x9d2c('0x6e')][_0x9d2c('0x7e')][_0x9d2c('0x7f')]})[_0x9d2c('0x2a')](function(_0x351cb9){if(_0x351cb9[_0x9d2c('0x4d')]===0x1){return _0x493d70['id'];}else{var _0x2b0a9a=_['every'](_[_0x9d2c('0x31')](_0x351cb9,_0x9d2c('0x80')),function(_0x4a83e9){return _[_0x9d2c('0x81')](_0x50619f,_0x4a83e9);});if(_0x2b0a9a){return _0x493d70['id'];}}}));}}return BPromise[_0x9d2c('0x82')](_0x3a4306)[_0x9d2c('0x2a')](function(_0x1d5859){_0x3b7080=_(_0x3b7080)[_0x9d2c('0x83')](_0x1d5859)['compact']()[_0x9d2c('0x84')]();return db['WhatsappQueue'][_0x9d2c('0x4e')]({'where':{'id':_0x2610e8[_0x9d2c('0x4b')]['id']}})[_0x9d2c('0x2a')](function(_0x304c73){return db[_0x9d2c('0x6e')][_0x9d2c('0x85')](function(_0x3afb19){return _0x304c73[_0x9d2c('0x73')](_0x2610e8[_0x9d2c('0x37')][_0x9d2c('0x68')],{'transaction':_0x3afb19})[_0x9d2c('0x2a')](function(){if(!_[_0x9d2c('0x86')](_0x3b7080)){return _0x304c73[_0x9d2c('0x87')](_0x3b7080,{'transaction':_0x3afb19});}})[_0x9d2c('0x2a')](function(){_0x3b7080[_0x9d2c('0x70')](function(_0x5c1c56){socket[_0x9d2c('0x71')](_0x9d2c('0x88'),{'UserId':_0x5c1c56,'WhatsappQueueId':_0x304c73['id']});});});});});});})[_0x9d2c('0x2a')](respondWithStatusCode(_0x43a6f6,null))[_0x9d2c('0x49')](handleError(_0x43a6f6,null));};exports[_0x9d2c('0x89')]=function(_0x585208,_0x5d987c,_0x1b5ddf){return db[_0x9d2c('0x32')][_0x9d2c('0x4e')]({'where':{'id':_0x585208[_0x9d2c('0x4b')]['id']}})[_0x9d2c('0x2a')](handleEntityNotFound(_0x5d987c,null))[_0x9d2c('0x2a')](function(_0x113c1d){if(_0x113c1d){return _0x113c1d[_0x9d2c('0x89')](_0x585208[_0x9d2c('0x50')][_0x9d2c('0x68')],_['omit'](_0x585208[_0x9d2c('0x50')],[_0x9d2c('0x68'),'id'])||{})[_0x9d2c('0x8a')](function(_0x4eb9e5){for(var _0x2209d3=0x0;_0x2209d3<_0x585208[_0x9d2c('0x50')][_0x9d2c('0x68')][_0x9d2c('0x4d')];_0x2209d3+=0x1){socket[_0x9d2c('0x71')]('userWhatsappQueue:save',{'UserId':Number(_0x585208[_0x9d2c('0x50')][_0x9d2c('0x68')][_0x2209d3]),'WhatsappQueueId':Number(_0x585208[_0x9d2c('0x4b')]['id'])});}return _0x4eb9e5;});}})[_0x9d2c('0x2a')](respondWithResult(_0x5d987c,null))[_0x9d2c('0x49')](handleError(_0x5d987c,null));};exports[_0x9d2c('0x87')]=function(_0xe384b2,_0x45c8ae,_0x59d602){return db[_0x9d2c('0x32')][_0x9d2c('0x4e')]({'where':{'id':_0xe384b2[_0x9d2c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45c8ae,null))[_0x9d2c('0x2a')](function(_0x17c21b){if(_0x17c21b){return _0x17c21b['removeAgents'](_0xe384b2[_0x9d2c('0x37')][_0x9d2c('0x68')])[_0x9d2c('0x2a')](function(){if(_['isArray'](_0xe384b2[_0x9d2c('0x37')]['ids'])){for(var _0x2012ce=0x0;_0x2012ce<_0xe384b2[_0x9d2c('0x37')]['ids']['length'];_0x2012ce+=0x1){socket['emit'](_0x9d2c('0x88'),{'UserId':Number(_0xe384b2['query'][_0x9d2c('0x68')][_0x2012ce]),'WhatsappQueueId':Number(_0xe384b2[_0x9d2c('0x4b')]['id'])});}}else{socket[_0x9d2c('0x71')]('userWhatsappQueue:remove',{'UserId':Number(_0xe384b2[_0x9d2c('0x37')][_0x9d2c('0x68')]),'WhatsappQueueId':Number(_0xe384b2[_0x9d2c('0x4b')]['id'])});}});}})[_0x9d2c('0x2a')](respondWithStatusCode(_0x45c8ae,null))['catch'](handleError(_0x45c8ae,null));};exports['getAgents']=function(_0x283e80,_0xe4b1f6,_0x195b28){var _0x58faf4={};var _0x2bc47f={};var _0x1f8bc1;var _0x4e69ec;return db[_0x9d2c('0x32')]['findOne']({'where':{'id':_0x283e80[_0x9d2c('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe4b1f6,null))[_0x9d2c('0x2a')](function(_0x11c1d9){if(_0x11c1d9){_0x1f8bc1=_0x11c1d9;_0x2bc47f[_0x9d2c('0x35')]=_['keys'](db['User']['rawAttributes']);_0x2bc47f[_0x9d2c('0x37')]=_[_0x9d2c('0x38')](_0x283e80[_0x9d2c('0x37')]);_0x2bc47f['filters']=_[_0x9d2c('0x3a')](_0x2bc47f[_0x9d2c('0x35')],_0x2bc47f[_0x9d2c('0x37')]);_0x58faf4[_0x9d2c('0x3b')]=_['intersection'](_0x2bc47f[_0x9d2c('0x35')],qs[_0x9d2c('0x5b')](_0x283e80[_0x9d2c('0x37')][_0x9d2c('0x5b')]));_0x58faf4['attributes']=_0x58faf4['attributes'][_0x9d2c('0x4d')]?_0x58faf4[_0x9d2c('0x3b')]:_0x2bc47f[_0x9d2c('0x35')];_0x58faf4[_0x9d2c('0x3e')]=qs[_0x9d2c('0x5c')](_0x283e80[_0x9d2c('0x37')][_0x9d2c('0x5c')]);_0x58faf4[_0x9d2c('0x3f')]=qs[_0x9d2c('0x39')](_[_0x9d2c('0x5d')](_0x283e80[_0x9d2c('0x37')],_0x2bc47f[_0x9d2c('0x39')]));if(_0x283e80[_0x9d2c('0x37')][_0x9d2c('0x40')]){_0x58faf4[_0x9d2c('0x3f')]=_[_0x9d2c('0x41')](_0x58faf4[_0x9d2c('0x3f')],{'$or':_[_0x9d2c('0x31')](_0x58faf4[_0x9d2c('0x3b')],function(_0x40ff60){var _0x44eadc={};_0x44eadc[_0x40ff60]={'$like':'%'+_0x283e80[_0x9d2c('0x37')][_0x9d2c('0x40')]+'%'};return _0x44eadc;})});}_0x58faf4=_[_0x9d2c('0x41')]({},_0x58faf4,_0x283e80[_0x9d2c('0x44')]);return _0x1f8bc1[_0x9d2c('0x8b')](_0x58faf4);}})[_0x9d2c('0x2a')](function(_0x3f1ecc){if(_0x3f1ecc){_0x4e69ec=_0x3f1ecc[_0x9d2c('0x4d')];if(!_0x283e80[_0x9d2c('0x37')][_0x9d2c('0x3c')](_0x9d2c('0x3d'))){_0x58faf4['limit']=qs[_0x9d2c('0x23')](_0x283e80[_0x9d2c('0x37')][_0x9d2c('0x23')]);_0x58faf4[_0x9d2c('0x22')]=qs[_0x9d2c('0x22')](_0x283e80[_0x9d2c('0x37')]['offset']);}return _0x1f8bc1[_0x9d2c('0x8b')](_0x58faf4);}})[_0x9d2c('0x2a')](function(_0x7a9a44){if(_0x7a9a44){return _0x7a9a44?{'count':_0x4e69ec,'rows':_0x7a9a44}:null;}})[_0x9d2c('0x2a')](respondWithResult(_0xe4b1f6,null))[_0x9d2c('0x49')](handleError(_0xe4b1f6,null));}; \ No newline at end of file +var _0x6501=['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','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','SIP','Team','pick','getTeams','nolimit','addTeams','ids','findAll','User','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','Agents','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','all','compact','value','transaction','removeAgents','userWhatsappQueue:remove','addAgents','omit','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','defaults','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','filter','merge','where','VIRTUAL','options','WhatsappQueue','includeAll','catch','show','include'];(function(_0x408e38,_0x23cda8){var _0x426b0e=function(_0x8f2898){while(--_0x8f2898){_0x408e38['push'](_0x408e38['shift']());}};_0x426b0e(++_0x23cda8);}(_0x6501,0x1e4));var _0x1650=function(_0x3bcba6,_0x4590c6){_0x3bcba6=_0x3bcba6-0x0;var _0x193211=_0x6501[_0x3bcba6];return _0x193211;};'use strict';var emlformat=require(_0x1650('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1650('0x1'));var jsonpatch=require(_0x1650('0x2'));var rp=require('request-promise');var moment=require(_0x1650('0x3'));var BPromise=require(_0x1650('0x4'));var Mustache=require('mustache');var util=require(_0x1650('0x5'));var path=require(_0x1650('0x6'));var sox=require(_0x1650('0x7'));var csv=require('to-csv');var ejs=require(_0x1650('0x8'));var fs=require('fs');var fs_extra=require(_0x1650('0x9'));var _=require(_0x1650('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1650('0xb'));var toCsv=require(_0x1650('0xc'));var querystring=require(_0x1650('0xd'));var Papa=require(_0x1650('0xe'));var Redis=require('ioredis');var authService=require(_0x1650('0xf'));var qs=require(_0x1650('0x10'));var as=require(_0x1650('0x11'));var hardwareService=require(_0x1650('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1650('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x1650('0x14')](config[_0x1650('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x1650('0x16'))(new Redis(config['redis']));require(_0x1650('0x17'))[_0x1650('0x18')](socket);function respondWithStatusCode(_0x84c5ac,_0x384729){_0x384729=_0x384729||0xcc;return function(_0x2aad42){if(_0x2aad42){return _0x84c5ac[_0x1650('0x19')](_0x384729);}return _0x84c5ac[_0x1650('0x1a')](_0x384729)[_0x1650('0x1b')]();};}function respondWithResult(_0x2cfedb,_0xc14b0b){_0xc14b0b=_0xc14b0b||0xc8;return function(_0xbb69a9){if(_0xbb69a9){return _0x2cfedb['status'](_0xc14b0b)[_0x1650('0x1c')](_0xbb69a9);}};}function respondWithFilteredResult(_0x2793b7,_0x2c676b){return function(_0x5b8705){if(_0x5b8705){var _0x4ead7d=typeof _0x2c676b[_0x1650('0x1d')]===_0x1650('0x1e')&&typeof _0x2c676b[_0x1650('0x1f')]===_0x1650('0x1e');var _0x126001=_0x5b8705[_0x1650('0x20')];var _0x171b16=_0x4ead7d?0x0:_0x2c676b['offset'];var _0x445b8e=_0x4ead7d?_0x5b8705['count']:_0x2c676b['offset']+_0x2c676b['limit'];var _0x1e74db;if(_0x445b8e>=_0x126001){_0x445b8e=_0x126001;_0x1e74db=0xc8;}else{_0x1e74db=0xce;}_0x2793b7[_0x1650('0x1a')](_0x1e74db);return _0x2793b7[_0x1650('0x21')](_0x1650('0x22'),_0x171b16+'-'+_0x445b8e+'/'+_0x126001)[_0x1650('0x1c')](_0x5b8705);}return null;};}function patchUpdates(_0x5bd2e4){return function(_0x486547){try{jsonpatch[_0x1650('0x23')](_0x486547,_0x5bd2e4,!![]);}catch(_0x21244f){return BPromise[_0x1650('0x24')](_0x21244f);}return _0x486547[_0x1650('0x25')]();};}function saveUpdates(_0x9ff677,_0x49f730){return function(_0x1e12d1){if(_0x1e12d1){return _0x1e12d1[_0x1650('0x26')](_0x9ff677)[_0x1650('0x27')](function(_0x292623){return _0x292623;});}return null;};}function removeEntity(_0x53c7b4,_0x33ca75){return function(_0x16ce96){if(_0x16ce96){return _0x16ce96[_0x1650('0x28')]()['then'](function(){var _0xc8ad8f=_0x16ce96[_0x1650('0x29')]({'plain':!![]});var _0x2b7cbd=_0x1650('0x2a');return db[_0x1650('0x2b')][_0x1650('0x28')]({'where':{'type':_0x2b7cbd,'resourceId':_0xc8ad8f['id']}})[_0x1650('0x27')](function(){return _0x16ce96;});})[_0x1650('0x27')](function(){_0x53c7b4[_0x1650('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xad846,_0x3966fd){return function(_0x2c1d2f){if(!_0x2c1d2f){_0xad846['sendStatus'](0x194);}return _0x2c1d2f;};}function handleError(_0x44a0dd,_0x36ae19){_0x36ae19=_0x36ae19||0x1f4;return function(_0x4de8bc){logger[_0x1650('0x2c')](_0x4de8bc[_0x1650('0x2d')]);if(_0x4de8bc[_0x1650('0x2e')]){delete _0x4de8bc[_0x1650('0x2e')];}_0x44a0dd[_0x1650('0x1a')](_0x36ae19)[_0x1650('0x2f')](_0x4de8bc);};}exports[_0x1650('0x30')]=function(_0x13a15f,_0x1e2129){var _0x29bc7f={},_0x3f7dc9={},_0x43e3cb={'count':0x0,'rows':[]};var _0x3c23f0=_[_0x1650('0x31')](db['WhatsappQueue'][_0x1650('0x32')],function(_0x43d640){return{'name':_0x43d640['fieldName'],'type':_0x43d640[_0x1650('0x33')]['key']};});_0x3f7dc9[_0x1650('0x34')]=_[_0x1650('0x31')](_0x3c23f0,_0x1650('0x2e'));_0x3f7dc9['query']=_[_0x1650('0x35')](_0x13a15f[_0x1650('0x36')]);_0x3f7dc9[_0x1650('0x37')]=_[_0x1650('0x38')](_0x3f7dc9[_0x1650('0x34')],_0x3f7dc9[_0x1650('0x36')]);_0x29bc7f[_0x1650('0x39')]=_['intersection'](_0x3f7dc9[_0x1650('0x34')],qs[_0x1650('0x3a')](_0x13a15f[_0x1650('0x36')][_0x1650('0x3a')]));_0x29bc7f['attributes']=_0x29bc7f['attributes'][_0x1650('0x3b')]?_0x29bc7f['attributes']:_0x3f7dc9[_0x1650('0x34')];if(!_0x13a15f['query']['hasOwnProperty']('nolimit')){_0x29bc7f['limit']=qs['limit'](_0x13a15f[_0x1650('0x36')][_0x1650('0x1f')]);_0x29bc7f[_0x1650('0x1d')]=qs[_0x1650('0x1d')](_0x13a15f[_0x1650('0x36')][_0x1650('0x1d')]);}_0x29bc7f[_0x1650('0x3c')]=qs[_0x1650('0x3d')](_0x13a15f[_0x1650('0x36')][_0x1650('0x3d')]);_0x29bc7f['where']=qs[_0x1650('0x37')](_['pick'](_0x13a15f[_0x1650('0x36')],_0x3f7dc9[_0x1650('0x37')]),_0x3c23f0);if(_0x13a15f[_0x1650('0x36')][_0x1650('0x3e')]){_0x29bc7f['where']=_[_0x1650('0x3f')](_0x29bc7f[_0x1650('0x40')],{'$or':_[_0x1650('0x31')](_0x3c23f0,function(_0x2d4c49){if(_0x2d4c49[_0x1650('0x33')]!==_0x1650('0x41')){var _0x295ff1={};_0x295ff1[_0x2d4c49['name']]={'$like':'%'+_0x13a15f[_0x1650('0x36')]['filter']+'%'};return _0x295ff1;}})});}_0x29bc7f=_['merge']({},_0x29bc7f,_0x13a15f[_0x1650('0x42')]);var _0x2f93ff={'where':_0x29bc7f[_0x1650('0x40')]};return db[_0x1650('0x43')]['count'](_0x2f93ff)['then'](function(_0xc4fbf3){_0x43e3cb['count']=_0xc4fbf3;if(_0x13a15f['query'][_0x1650('0x44')]){_0x29bc7f['include']=[{'all':!![]}];}return db[_0x1650('0x43')]['findAll'](_0x29bc7f);})[_0x1650('0x27')](function(_0x920927){_0x43e3cb['rows']=_0x920927;return _0x43e3cb;})[_0x1650('0x27')](respondWithFilteredResult(_0x1e2129,_0x29bc7f))[_0x1650('0x45')](handleError(_0x1e2129,null));};exports[_0x1650('0x46')]=function(_0x407606,_0x41f5ef){var _0x5c8ddd={'raw':!![],'where':{'id':_0x407606['params']['id']}},_0x1f1e51={};_0x1f1e51[_0x1650('0x34')]=_['keys'](db[_0x1650('0x43')][_0x1650('0x32')]);_0x1f1e51['query']=_[_0x1650('0x35')](_0x407606[_0x1650('0x36')]);_0x1f1e51[_0x1650('0x37')]=_[_0x1650('0x38')](_0x1f1e51[_0x1650('0x34')],_0x1f1e51[_0x1650('0x36')]);_0x5c8ddd[_0x1650('0x39')]=_[_0x1650('0x38')](_0x1f1e51['model'],qs[_0x1650('0x3a')](_0x407606[_0x1650('0x36')][_0x1650('0x3a')]));_0x5c8ddd[_0x1650('0x39')]=_0x5c8ddd[_0x1650('0x39')][_0x1650('0x3b')]?_0x5c8ddd[_0x1650('0x39')]:_0x1f1e51[_0x1650('0x34')];if(_0x407606[_0x1650('0x36')][_0x1650('0x44')]){_0x5c8ddd[_0x1650('0x47')]=[{'all':!![]}];}_0x5c8ddd=_['merge']({},_0x5c8ddd,_0x407606['options']);return db[_0x1650('0x43')][_0x1650('0x48')](_0x5c8ddd)['then'](handleEntityNotFound(_0x41f5ef,null))[_0x1650('0x27')](respondWithResult(_0x41f5ef,null))[_0x1650('0x45')](handleError(_0x41f5ef,null));};exports[_0x1650('0x49')]=function(_0x42d34c,_0x118838){return db[_0x1650('0x43')][_0x1650('0x49')](_0x42d34c[_0x1650('0x4a')],{})[_0x1650('0x27')](function(_0x29803e){var _0xb86de6=_0x42d34c[_0x1650('0x4b')][_0x1650('0x29')]({'plain':!![]});if(!_0xb86de6)throw new Error(_0x1650('0x4c'));if(_0xb86de6[_0x1650('0x4d')]===_0x1650('0x4b')){var _0x48dd42=_0x29803e['get']({'plain':!![]});var _0x578e72=_0x1650('0x2a');return db[_0x1650('0x4e')][_0x1650('0x48')]({'where':{'name':_0x578e72,'userProfileId':_0xb86de6[_0x1650('0x4f')]},'raw':!![]})[_0x1650('0x27')](function(_0x40d22d){if(_0x40d22d&&_0x40d22d[_0x1650('0x50')]===0x0){return db[_0x1650('0x2b')][_0x1650('0x49')]({'name':_0x48dd42['name'],'resourceId':_0x48dd42['id'],'type':_0x40d22d[_0x1650('0x2e')],'sectionId':_0x40d22d['id']},{})[_0x1650('0x27')](function(){return _0x29803e;});}else{return _0x29803e;}})[_0x1650('0x45')](function(_0x2ba5b4){logger[_0x1650('0x2c')](_0x1650('0x51'),_0x2ba5b4);throw _0x2ba5b4;});}return _0x29803e;})['then'](respondWithResult(_0x118838,0xc9))[_0x1650('0x45')](handleError(_0x118838,null));};exports[_0x1650('0x26')]=function(_0x1ae6a8,_0x494e85){if(_0x1ae6a8['body']['id']){delete _0x1ae6a8[_0x1650('0x4a')]['id'];}return db[_0x1650('0x43')]['find']({'where':{'id':_0x1ae6a8[_0x1650('0x52')]['id']}})[_0x1650('0x27')](handleEntityNotFound(_0x494e85,null))['then'](saveUpdates(_0x1ae6a8[_0x1650('0x4a')],null))['then'](respondWithResult(_0x494e85,null))[_0x1650('0x45')](handleError(_0x494e85,null));};exports[_0x1650('0x28')]=function(_0x355a32,_0x5bfa48){return db[_0x1650('0x43')]['find']({'where':{'id':_0x355a32['params']['id']}})[_0x1650('0x27')](handleEntityNotFound(_0x5bfa48,null))[_0x1650('0x27')](removeEntity(_0x5bfa48,null))[_0x1650('0x45')](handleError(_0x5bfa48,null));};exports[_0x1650('0x53')]=function(_0x5ad2e0,_0x1a4069){return db[_0x1650('0x43')]['describe']()['then'](respondWithResult(_0x1a4069,null))[_0x1650('0x45')](handleError(_0x1a4069,null));};exports[_0x1650('0x54')]=function(_0x1a693f,_0x77f47,_0xe5404a){var _0x304ad0={'raw':!![],'where':{}},_0x38a290={},_0x1d5e1b;return db[_0x1650('0x43')][_0x1650('0x55')]({'where':{'id':_0x1a693f[_0x1650('0x52')]['id']}})[_0x1650('0x27')](handleEntityNotFound(_0x77f47,null))[_0x1650('0x27')](function(_0x3cbcdd){if(_0x3cbcdd){_0x1d5e1b=_0x3cbcdd[_0x1650('0x29')]({'plain':!![]});_0x38a290[_0x1650('0x34')]=_['keys'](db[_0x1650('0x56')][_0x1650('0x32')]);_0x38a290[_0x1650('0x36')]=_[_0x1650('0x35')](_0x1a693f[_0x1650('0x36')]);_0x38a290[_0x1650('0x37')]=_[_0x1650('0x38')](_0x38a290[_0x1650('0x34')],_0x38a290['query']);_0x304ad0[_0x1650('0x39')]=_[_0x1650('0x38')](_0x38a290['model'],qs[_0x1650('0x3a')](_0x1a693f['query']['fields']));_0x304ad0[_0x1650('0x39')]=_0x304ad0['attributes'][_0x1650('0x3b')]?_0x304ad0['attributes']:_0x38a290['model'];if(!_0x1a693f[_0x1650('0x36')][_0x1650('0x57')]('nolimit')){_0x304ad0[_0x1650('0x1f')]=qs[_0x1650('0x1f')](_0x1a693f['query'][_0x1650('0x1f')]);_0x304ad0[_0x1650('0x1d')]=qs[_0x1650('0x1d')](_0x1a693f[_0x1650('0x36')][_0x1650('0x1d')]);}_0x304ad0['order']=qs[_0x1650('0x3d')](_0x1a693f[_0x1650('0x36')]['sort']);_0x304ad0[_0x1650('0x40')]=qs[_0x1650('0x37')](_['pick'](_0x1a693f[_0x1650('0x36')],_0x38a290['filters']));_0x304ad0[_0x1650('0x40')][_0x1650('0x58')]=_0x3cbcdd['id'];if(_0x1a693f[_0x1650('0x36')][_0x1650('0x3e')]){_0x304ad0[_0x1650('0x40')]=_['merge'](_0x304ad0[_0x1650('0x40')],{'$or':_[_0x1650('0x31')](_0x304ad0[_0x1650('0x39')],function(_0x15c86c){var _0x3593b7={};_0x3593b7[_0x15c86c]={'$like':'%'+_0x1a693f[_0x1650('0x36')][_0x1650('0x3e')]+'%'};return _0x3593b7;})});}_0x304ad0=_['merge']({},_0x304ad0,_0x1a693f[_0x1650('0x42')]);return db[_0x1650('0x56')]['findAll'](_0x304ad0);}})[_0x1650('0x27')](function(_0x47c8e8){if(_0x47c8e8){return db['User'][_0x1650('0x59')]({'where':{'id':_[_0x1650('0x31')](_0x47c8e8,_0x1650('0x5a')),'role':'agent'},'attributes':['id',_0x1650('0x2e'),_0x1650('0x5b'),_0x1650('0x5c'),_0x1650('0x5d')]});}})[_0x1650('0x27')](function(_0x58d87e){if(_0x58d87e){return{'count':_0x58d87e[_0x1650('0x20')],'rows':_['map'](_0x58d87e[_0x1650('0x5e')],function(_0x4c68b3){return{'membername':_0x4c68b3[_0x1650('0x2e')],'UserId':_0x4c68b3['id'],'queue_name':_0x1d5e1b['name'],'WhatsappQueueId':_0x1d5e1b['id'],'interface':util[_0x1650('0x5f')](_0x1650('0x60'),_0x1650('0x61'),_0x4c68b3[_0x1650('0x2e')]),'penalty':0x0,'paused':_0x4c68b3['whatsappPause'],'createdAt':_0x4c68b3[_0x1650('0x5d')],'updatedAt':_0x4c68b3[_0x1650('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1650('0x27')](respondWithFilteredResult(_0x77f47,_0x304ad0))['catch'](handleError(_0x77f47,null));};exports['getTeams']=function(_0x1d5cea,_0x65dda4,_0x19713f){var _0x527829={};var _0x1d5edd={};var _0x3b1601;var _0x245935;return db['WhatsappQueue'][_0x1650('0x55')]({'where':{'id':_0x1d5cea[_0x1650('0x52')]['id']}})['then'](handleEntityNotFound(_0x65dda4,null))[_0x1650('0x27')](function(_0x366188){if(_0x366188){_0x3b1601=_0x366188;_0x1d5edd[_0x1650('0x34')]=_[_0x1650('0x35')](db[_0x1650('0x62')][_0x1650('0x32')]);_0x1d5edd['query']=_[_0x1650('0x35')](_0x1d5cea[_0x1650('0x36')]);_0x1d5edd[_0x1650('0x37')]=_[_0x1650('0x38')](_0x1d5edd['model'],_0x1d5edd['query']);_0x527829[_0x1650('0x39')]=_[_0x1650('0x38')](_0x1d5edd[_0x1650('0x34')],qs[_0x1650('0x3a')](_0x1d5cea[_0x1650('0x36')][_0x1650('0x3a')]));_0x527829['attributes']=_0x527829['attributes'][_0x1650('0x3b')]?_0x527829[_0x1650('0x39')]:_0x1d5edd[_0x1650('0x34')];_0x527829['order']=qs[_0x1650('0x3d')](_0x1d5cea[_0x1650('0x36')]['sort']);_0x527829['where']=qs[_0x1650('0x37')](_[_0x1650('0x63')](_0x1d5cea[_0x1650('0x36')],_0x1d5edd[_0x1650('0x37')]));if(_0x1d5cea[_0x1650('0x36')][_0x1650('0x3e')]){_0x527829[_0x1650('0x40')]=_[_0x1650('0x3f')](_0x527829[_0x1650('0x40')],{'$or':_[_0x1650('0x31')](_0x527829['attributes'],function(_0x24241b){var _0x45328d={};_0x45328d[_0x24241b]={'$like':'%'+_0x1d5cea[_0x1650('0x36')]['filter']+'%'};return _0x45328d;})});}_0x527829=_[_0x1650('0x3f')]({},_0x527829,_0x1d5cea['options']);return _0x3b1601[_0x1650('0x64')](_0x527829);}})[_0x1650('0x27')](function(_0x3ba5fc){if(_0x3ba5fc){_0x245935=_0x3ba5fc['length'];if(!_0x1d5cea[_0x1650('0x36')][_0x1650('0x57')](_0x1650('0x65'))){_0x527829[_0x1650('0x1f')]=qs[_0x1650('0x1f')](_0x1d5cea[_0x1650('0x36')]['limit']);_0x527829[_0x1650('0x1d')]=qs[_0x1650('0x1d')](_0x1d5cea['query'][_0x1650('0x1d')]);}return _0x3b1601[_0x1650('0x64')](_0x527829);}})[_0x1650('0x27')](function(_0x2fc5b0){if(_0x2fc5b0){return _0x2fc5b0?{'count':_0x245935,'rows':_0x2fc5b0}:null;}})[_0x1650('0x27')](respondWithResult(_0x65dda4,null))[_0x1650('0x45')](handleError(_0x65dda4,null));};exports[_0x1650('0x66')]=function(_0x281476,_0x4f47e7,_0x3bb42b){var _0x1bc8ea=_0x281476[_0x1650('0x4a')][_0x1650('0x67')];return db[_0x1650('0x62')][_0x1650('0x68')]({'where':{'id':_0x1bc8ea},'attributes':['id'],'include':[{'model':db[_0x1650('0x69')],'as':'Agents','attributes':['id',_0x1650('0x2e'),'online',_0x1650('0x6a'),_0x1650('0x6b')],'raw':!![]}]})[_0x1650('0x27')](function(_0x2f67b6){if(_0x2f67b6){var _0x53604f=_[_0x1650('0x6c')](_0x2f67b6,function(_0x4b251c){var _0x479ebc=_0x4b251c[_0x1650('0x29')]({'plain':!![]});return _0x479ebc['Agents'];});return db['WhatsappQueue'][_0x1650('0x48')]({'where':{'id':_0x281476[_0x1650('0x52')]['id']}})[_0x1650('0x27')](function(_0x3907d8){return db[_0x1650('0x6d')]['transaction'](function(_0x2d5324){return _0x3907d8[_0x1650('0x66')](_0x1bc8ea,{'transaction':_0x2d5324})[_0x1650('0x27')](function(){return BPromise[_0x1650('0x6e')](_0x53604f,function(_0x177b75){return db[_0x1650('0x56')][_0x1650('0x6f')]({'where':{'UserId':_0x177b75['id'],'WhatsappQueueId':_0x281476[_0x1650('0x52')]['id']},'transaction':_0x2d5324});});})['then'](function(){_0x53604f[_0x1650('0x70')](function(_0x112acf){socket[_0x1650('0x71')](_0x1650('0x72'),{'UserId':_0x112acf['id'],'WhatsappQueueId':_0x3907d8['id']});});});});});}})[_0x1650('0x27')](respondWithStatusCode(_0x4f47e7,null))[_0x1650('0x45')](handleError(_0x4f47e7,null));};exports[_0x1650('0x73')]=function(_0xe37937,_0x2f6986,_0x9b7c1d){return db['Team']['findAll']({'where':{'id':_0xe37937[_0x1650('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1650('0x69')],'as':_0x1650('0x74'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2f6986,null))[_0x1650('0x27')](function(_0xacb874){var _0x4c6223=_['map'](_0xacb874,'id');var _0x2495aa=[];var _0x498817=[];var _0x2a0214=squel['select']();_0x2a0214[_0x1650('0x75')]('tq.TeamId')['from'](_0x1650('0x76'),'tq')[_0x1650('0x77')](_0x1650('0x78'),'ut',_0x1650('0x79'))[_0x1650('0x40')](_0x1650('0x7a'),_0xe37937[_0x1650('0x52')]['id']);for(var _0x4a1c84=0x0;_0x4a1c84<_0xacb874[_0x1650('0x3b')];_0x4a1c84+=0x1){let _0xbce51c=_0xacb874[_0x4a1c84];for(var _0x249631=0x0;_0x249631<_0xbce51c[_0x1650('0x74')][_0x1650('0x3b')];_0x249631+=0x1){let _0x4ccce9=_0xbce51c[_0x1650('0x74')][_0x249631];var _0x242030=_0x2a0214[_0x1650('0x7b')]();_0x242030[_0x1650('0x40')](_0x1650('0x7c'),_0x4ccce9['id']);_0x498817[_0x1650('0x7d')](db['sequelize'][_0x1650('0x36')](_0x242030[_0x1650('0x7e')](),{'type':db['sequelize'][_0x1650('0x7f')]['SELECT']})[_0x1650('0x27')](function(_0x33e87b){if(_0x33e87b['length']===0x1){return _0x4ccce9['id'];}else{var _0x49463e=_['every'](_['map'](_0x33e87b,_0x1650('0x80')),function(_0x1e765d){return _[_0x1650('0x81')](_0x4c6223,_0x1e765d);});if(_0x49463e){return _0x4ccce9['id'];}}}));}}return BPromise[_0x1650('0x82')](_0x498817)['then'](function(_0x991186){_0x2495aa=_(_0x2495aa)['union'](_0x991186)[_0x1650('0x83')]()[_0x1650('0x84')]();return db['WhatsappQueue'][_0x1650('0x48')]({'where':{'id':_0xe37937[_0x1650('0x52')]['id']}})[_0x1650('0x27')](function(_0x3b11cf){return db[_0x1650('0x6d')][_0x1650('0x85')](function(_0x378985){return _0x3b11cf['removeTeams'](_0xe37937[_0x1650('0x36')][_0x1650('0x67')],{'transaction':_0x378985})[_0x1650('0x27')](function(){if(!_['isEmpty'](_0x2495aa)){return _0x3b11cf[_0x1650('0x86')](_0x2495aa,{'transaction':_0x378985});}})['then'](function(){_0x2495aa[_0x1650('0x70')](function(_0x5b1e3b){socket[_0x1650('0x71')](_0x1650('0x87'),{'UserId':_0x5b1e3b,'WhatsappQueueId':_0x3b11cf['id']});});});});});});})[_0x1650('0x27')](respondWithStatusCode(_0x2f6986,null))[_0x1650('0x45')](handleError(_0x2f6986,null));};exports[_0x1650('0x88')]=function(_0x211266,_0x3ca354,_0x4524c6){return db[_0x1650('0x43')][_0x1650('0x48')]({'where':{'id':_0x211266[_0x1650('0x52')]['id']}})['then'](handleEntityNotFound(_0x3ca354,null))['then'](function(_0x1bd5de){if(_0x1bd5de){return _0x1bd5de[_0x1650('0x88')](_0x211266[_0x1650('0x4a')][_0x1650('0x67')],_[_0x1650('0x89')](_0x211266[_0x1650('0x4a')],[_0x1650('0x67'),'id'])||{})['spread'](function(_0x30936d){for(var _0x1b9860=0x0;_0x1b9860<_0x211266[_0x1650('0x4a')]['ids'][_0x1650('0x3b')];_0x1b9860+=0x1){socket[_0x1650('0x71')](_0x1650('0x72'),{'UserId':Number(_0x211266['body']['ids'][_0x1b9860]),'WhatsappQueueId':Number(_0x211266['params']['id'])});}return _0x30936d;});}})['then'](respondWithResult(_0x3ca354,null))['catch'](handleError(_0x3ca354,null));};exports[_0x1650('0x86')]=function(_0x463cae,_0x53bec3,_0x34f5fd){return db[_0x1650('0x43')][_0x1650('0x48')]({'where':{'id':_0x463cae['params']['id']}})[_0x1650('0x27')](handleEntityNotFound(_0x53bec3,null))[_0x1650('0x27')](function(_0x3ced73){if(_0x3ced73){return _0x3ced73[_0x1650('0x86')](_0x463cae['query'][_0x1650('0x67')])['then'](function(){if(_['isArray'](_0x463cae['query'][_0x1650('0x67')])){for(var _0xfa6778=0x0;_0xfa6778<_0x463cae[_0x1650('0x36')][_0x1650('0x67')][_0x1650('0x3b')];_0xfa6778+=0x1){socket['emit'](_0x1650('0x87'),{'UserId':Number(_0x463cae[_0x1650('0x36')][_0x1650('0x67')][_0xfa6778]),'WhatsappQueueId':Number(_0x463cae[_0x1650('0x52')]['id'])});}}else{socket[_0x1650('0x71')]('userWhatsappQueue:remove',{'UserId':Number(_0x463cae['query'][_0x1650('0x67')]),'WhatsappQueueId':Number(_0x463cae[_0x1650('0x52')]['id'])});}});}})[_0x1650('0x27')](respondWithStatusCode(_0x53bec3,null))[_0x1650('0x45')](handleError(_0x53bec3,null));};exports[_0x1650('0x8a')]=function(_0x56f4af,_0x134db8,_0x54f253){var _0x4c8d1b={};var _0x325f2f={};var _0x54c7b4;var _0x2da115;return db['WhatsappQueue']['findOne']({'where':{'id':_0x56f4af['params']['id']}})[_0x1650('0x27')](handleEntityNotFound(_0x134db8,null))[_0x1650('0x27')](function(_0x1857e4){if(_0x1857e4){_0x54c7b4=_0x1857e4;_0x325f2f[_0x1650('0x34')]=_[_0x1650('0x35')](db[_0x1650('0x69')][_0x1650('0x32')]);_0x325f2f[_0x1650('0x36')]=_['keys'](_0x56f4af[_0x1650('0x36')]);_0x325f2f['filters']=_['intersection'](_0x325f2f[_0x1650('0x34')],_0x325f2f['query']);_0x4c8d1b[_0x1650('0x39')]=_[_0x1650('0x38')](_0x325f2f[_0x1650('0x34')],qs[_0x1650('0x3a')](_0x56f4af[_0x1650('0x36')][_0x1650('0x3a')]));_0x4c8d1b[_0x1650('0x39')]=_0x4c8d1b[_0x1650('0x39')][_0x1650('0x3b')]?_0x4c8d1b[_0x1650('0x39')]:_0x325f2f[_0x1650('0x34')];_0x4c8d1b[_0x1650('0x3c')]=qs['sort'](_0x56f4af[_0x1650('0x36')][_0x1650('0x3d')]);_0x4c8d1b['where']=qs[_0x1650('0x37')](_['pick'](_0x56f4af[_0x1650('0x36')],_0x325f2f[_0x1650('0x37')]));if(_0x56f4af[_0x1650('0x36')][_0x1650('0x3e')]){_0x4c8d1b['where']=_[_0x1650('0x3f')](_0x4c8d1b[_0x1650('0x40')],{'$or':_['map'](_0x4c8d1b[_0x1650('0x39')],function(_0x2e964e){var _0x9f0e32={};_0x9f0e32[_0x2e964e]={'$like':'%'+_0x56f4af['query'][_0x1650('0x3e')]+'%'};return _0x9f0e32;})});}_0x4c8d1b=_['merge']({},_0x4c8d1b,_0x56f4af['options']);return _0x54c7b4[_0x1650('0x8a')](_0x4c8d1b);}})[_0x1650('0x27')](function(_0x596c34){if(_0x596c34){_0x2da115=_0x596c34['length'];if(!_0x56f4af[_0x1650('0x36')]['hasOwnProperty'](_0x1650('0x65'))){_0x4c8d1b[_0x1650('0x1f')]=qs['limit'](_0x56f4af[_0x1650('0x36')]['limit']);_0x4c8d1b[_0x1650('0x1d')]=qs[_0x1650('0x1d')](_0x56f4af[_0x1650('0x36')]['offset']);}return _0x54c7b4['getAgents'](_0x4c8d1b);}})[_0x1650('0x27')](function(_0x5b2b0d){if(_0x5b2b0d){return _0x5b2b0d?{'count':_0x2da115,'rows':_0x5b2b0d}:null;}})['then'](respondWithResult(_0x134db8,null))[_0x1650('0x45')](handleError(_0x134db8,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index fdaf5a9..91c7745 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 _0x8b3f=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x360c09,_0x2e997a){var _0x1c84bf=function(_0x1ea752){while(--_0x1ea752){_0x360c09['push'](_0x360c09['shift']());}};_0x1c84bf(++_0x2e997a);}(_0x8b3f,0x1a5));var _0xf8b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b3f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf8b3('0x0'));var WhatsappQueue=require(_0xf8b3('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf8b3('0x2')](0x0);var events={'afterCreate':_0xf8b3('0x3'),'afterUpdate':_0xf8b3('0x4'),'afterDestroy':_0xf8b3('0x5')};function emitEvent(_0x3104d9){return function(_0x4bbdda,_0x1c576c,_0x496f98){WhatsappQueueEvents['emit'](_0x3104d9+':'+_0x4bbdda['id'],_0x4bbdda);WhatsappQueueEvents[_0xf8b3('0x6')](_0x3104d9,_0x4bbdda);_0x496f98(null);};}for(var e in events){if(events[_0xf8b3('0x7')](e)){var event=events[e];WhatsappQueue[_0xf8b3('0x8')](e,emitEvent(event));}}module[_0xf8b3('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0xd75e=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit'];(function(_0x1f4966,_0x44eb73){var _0x5686fc=function(_0x3286cc){while(--_0x3286cc){_0x1f4966['push'](_0x1f4966['shift']());}};_0x5686fc(++_0x44eb73);}(_0xd75e,0x179));var _0xed75=function(_0x555e5c,_0x2b61ff){_0x555e5c=_0x555e5c-0x0;var _0x219bc8=_0xd75e[_0x555e5c];return _0x219bc8;};'use strict';var EventEmitter=require(_0xed75('0x0'));var WhatsappQueue=require(_0xed75('0x1'))['db'][_0xed75('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xed75('0x3')](0x0);var events={'afterCreate':_0xed75('0x4'),'afterUpdate':_0xed75('0x5'),'afterDestroy':_0xed75('0x6')};function emitEvent(_0x2895d4){return function(_0x7e66b6,_0x228441,_0x43bd66){WhatsappQueueEvents[_0xed75('0x7')](_0x2895d4+':'+_0x7e66b6['id'],_0x7e66b6);WhatsappQueueEvents[_0xed75('0x7')](_0x2895d4,_0x7e66b6);_0x43bd66(null);};}for(var e in events){if(events[_0xed75('0x8')](e)){var event=events[e];WhatsappQueue[_0xed75('0x9')](e,emitEvent(event));}}module[_0xed75('0xa')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index a01469d..0e6393d 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 _0x6015=['whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','WhatsappQueue'];(function(_0x5620c1,_0x18a353){var _0x91169c=function(_0x4121c4){while(--_0x4121c4){_0x5620c1['push'](_0x5620c1['shift']());}};_0x91169c(++_0x18a353);}(_0x6015,0x64));var _0x5601=function(_0x56978d,_0xcd24a2){_0x56978d=_0x56978d-0x0;var _0x342c18=_0x6015[_0x56978d];return _0x342c18;};'use strict';var _=require(_0x5601('0x0'));var util=require(_0x5601('0x1'));var logger=require('../../config/logger')(_0x5601('0x2'));var moment=require(_0x5601('0x3'));var BPromise=require(_0x5601('0x4'));var rp=require(_0x5601('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5601('0x6'));var config=require(_0x5601('0x7'));var attributes=require(_0x5601('0x8'));module['exports']=function(_0x2409c6,_0x5a7407){return _0x2409c6['define'](_0x5601('0x9'),attributes,{'tableName':_0x5601('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb100=['request-promise','path','rimraf','../../config/environment','exports','WhatsappQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x761b6d,_0x7c7fa8){var _0x3a1639=function(_0x33b90a){while(--_0x33b90a){_0x761b6d['push'](_0x761b6d['shift']());}};_0x3a1639(++_0x7c7fa8);}(_0xb100,0xc6));var _0x0b10=function(_0x5c6ceb,_0x4ed099){_0x5c6ceb=_0x5c6ceb-0x0;var _0x28821b=_0xb100[_0x5c6ceb];return _0x28821b;};'use strict';var _=require(_0x0b10('0x0'));var util=require(_0x0b10('0x1'));var logger=require(_0x0b10('0x2'))(_0x0b10('0x3'));var moment=require(_0x0b10('0x4'));var BPromise=require(_0x0b10('0x5'));var rp=require(_0x0b10('0x6'));var fs=require('fs');var path=require(_0x0b10('0x7'));var rimraf=require(_0x0b10('0x8'));var config=require(_0x0b10('0x9'));var attributes=require('./whatsappQueue.attributes');module[_0x0b10('0xa')]=function(_0x1d0669,_0x22c6c1){return _0x1d0669['define'](_0x0b10('0xb'),attributes,{'tableName':'whatsapp_queues','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 6fee6a6..d5bc45e 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 _0xafb7=['request\x20sent','debug','stringify','code','error','WhatsappQueue,\x20%s,\x20%s','message','result','options','raw','where','attributes','limit','include','map','model','GetWhatsappQueue','catch','ShowWhatsappQueue','WhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','then','info'];(function(_0x5d6392,_0x271a01){var _0x5808ab=function(_0x1851a6){while(--_0x1851a6){_0x5d6392['push'](_0x5d6392['shift']());}};_0x5808ab(++_0x271a01);}(_0xafb7,0x154));var _0x7afb=function(_0x309846,_0x4f3353){_0x309846=_0x309846-0x0;var _0x3d9af6=_0xafb7[_0x309846];return _0x3d9af6;};'use strict';var _=require(_0x7afb('0x0'));var util=require(_0x7afb('0x1'));var moment=require(_0x7afb('0x2'));var BPromise=require(_0x7afb('0x3'));var rs=require(_0x7afb('0x4'));var fs=require('fs');var Redis=require(_0x7afb('0x5'));var db=require(_0x7afb('0x6'))['db'];var utils=require(_0x7afb('0x7'));var logger=require('../../config/logger')(_0x7afb('0x8'));var config=require(_0x7afb('0x9'));var jayson=require(_0x7afb('0xa'));var client=jayson[_0x7afb('0xb')]['http']({'port':0x232a});config['redis']=_[_0x7afb('0xc')](config['redis'],{'host':_0x7afb('0xd'),'port':0x18eb});var socket=require(_0x7afb('0xe'))(new Redis(config[_0x7afb('0xf')]));require(_0x7afb('0x10'))[_0x7afb('0x11')](socket);function respondWithRpcPromise(_0x466dd4,_0x15f016,_0x196eef){return new BPromise(function(_0x32230a,_0x5ecf6b){return client['request'](_0x466dd4,_0x196eef)[_0x7afb('0x12')](function(_0x2f461){logger[_0x7afb('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x15f016,_0x7afb('0x14'));logger[_0x7afb('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x15f016,_0x7afb('0x14'),JSON[_0x7afb('0x16')](_0x2f461));if(_0x2f461['error']){if(_0x2f461['error'][_0x7afb('0x17')]===0x1f4){logger[_0x7afb('0x18')](_0x7afb('0x19'),_0x15f016,_0x2f461[_0x7afb('0x18')]['message']);return _0x5ecf6b(_0x2f461[_0x7afb('0x18')][_0x7afb('0x1a')]);}logger['error'](_0x7afb('0x19'),_0x15f016,_0x2f461[_0x7afb('0x18')][_0x7afb('0x1a')]);return _0x32230a(_0x2f461['error'][_0x7afb('0x1a')]);}else{logger['info'](_0x7afb('0x19'),_0x15f016,'request\x20sent');_0x32230a(_0x2f461[_0x7afb('0x1b')]['message']);}})['catch'](function(_0x534163){logger[_0x7afb('0x18')](_0x7afb('0x19'),_0x15f016,_0x534163);_0x5ecf6b(_0x534163);});});}exports['GetWhatsappQueue']=function(_0x5ea6d5){var _0x5f2265=this;return new Promise(function(_0x5f50a5,_0x37fd27){return db['WhatsappQueue']['findAll']({'raw':_0x5ea6d5['options']?_0x5ea6d5[_0x7afb('0x1c')][_0x7afb('0x1d')]===undefined?!![]:![]:!![],'where':_0x5ea6d5['options']?_0x5ea6d5[_0x7afb('0x1c')][_0x7afb('0x1e')]||null:null,'attributes':_0x5ea6d5['options']?_0x5ea6d5[_0x7afb('0x1c')][_0x7afb('0x1f')]||null:null,'limit':_0x5ea6d5[_0x7afb('0x1c')]?_0x5ea6d5['options'][_0x7afb('0x20')]||null:null,'include':_0x5ea6d5[_0x7afb('0x1c')]?_0x5ea6d5[_0x7afb('0x1c')][_0x7afb('0x21')]?_[_0x7afb('0x22')](_0x5ea6d5['options'][_0x7afb('0x21')],function(_0x1b7bcb){return{'model':db[_0x1b7bcb[_0x7afb('0x23')]],'as':_0x1b7bcb['as'],'attributes':_0x1b7bcb[_0x7afb('0x1f')],'include':_0x1b7bcb['include']?_[_0x7afb('0x22')](_0x1b7bcb[_0x7afb('0x21')],function(_0x3e4aa7){return{'model':db[_0x3e4aa7['model']],'as':_0x3e4aa7['as'],'attributes':_0x3e4aa7[_0x7afb('0x1f')],'include':_0x3e4aa7['include']?_[_0x7afb('0x22')](_0x3e4aa7[_0x7afb('0x21')],function(_0x5ab44a){return{'model':db[_0x5ab44a[_0x7afb('0x23')]],'as':_0x5ab44a['as'],'attributes':_0x5ab44a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7afb('0x12')](function(_0x3ed258){logger[_0x7afb('0x13')](_0x7afb('0x24'),_0x5ea6d5);logger['debug'](_0x7afb('0x24'),_0x5ea6d5,JSON[_0x7afb('0x16')](_0x3ed258));_0x5f50a5(_0x3ed258);})[_0x7afb('0x25')](function(_0x22dfd5){logger[_0x7afb('0x18')](_0x7afb('0x24'),_0x22dfd5[_0x7afb('0x1a')],_0x5ea6d5);_0x37fd27(_0x5f2265[_0x7afb('0x18')](0x1f4,_0x22dfd5[_0x7afb('0x1a')]));});});};exports[_0x7afb('0x26')]=function(_0x27b80d){var _0x33c71d=this;return new Promise(function(_0x4b64b3,_0x33ae4c){return db[_0x7afb('0x27')]['find']({'raw':_0x27b80d[_0x7afb('0x1c')]?_0x27b80d[_0x7afb('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x27b80d[_0x7afb('0x1c')]?_0x27b80d[_0x7afb('0x1c')][_0x7afb('0x1e')]||null:null,'attributes':_0x27b80d[_0x7afb('0x1c')]?_0x27b80d['options'][_0x7afb('0x1f')]||null:null,'include':_0x27b80d[_0x7afb('0x1c')]?_0x27b80d['options'][_0x7afb('0x21')]?_[_0x7afb('0x22')](_0x27b80d[_0x7afb('0x1c')][_0x7afb('0x21')],function(_0x485c7c){return{'model':db[_0x485c7c[_0x7afb('0x23')]],'as':_0x485c7c['as'],'attributes':_0x485c7c['attributes'],'include':_0x485c7c[_0x7afb('0x21')]?_[_0x7afb('0x22')](_0x485c7c[_0x7afb('0x21')],function(_0x55afaa){return{'model':db[_0x55afaa[_0x7afb('0x23')]],'as':_0x55afaa['as'],'attributes':_0x55afaa[_0x7afb('0x1f')],'include':_0x55afaa[_0x7afb('0x21')]?_[_0x7afb('0x22')](_0x55afaa[_0x7afb('0x21')],function(_0x56a034){return{'model':db[_0x56a034[_0x7afb('0x23')]],'as':_0x56a034['as'],'attributes':_0x56a034[_0x7afb('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7afb('0x12')](function(_0x35fbad){logger[_0x7afb('0x13')](_0x7afb('0x26'),_0x27b80d);logger[_0x7afb('0x15')](_0x7afb('0x26'),_0x27b80d,JSON[_0x7afb('0x16')](_0x35fbad));_0x4b64b3(_0x35fbad);})['catch'](function(_0x832bf6){logger['error'](_0x7afb('0x26'),_0x832bf6[_0x7afb('0x1a')],_0x27b80d);_0x33ae4c(_0x33c71d[_0x7afb('0x18')](0x1f4,_0x832bf6[_0x7afb('0x1a')]));});});}; \ No newline at end of file +var _0x3953=['where','attributes','limit','include','map','model','then','debug','catch','ShowWhatsappQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueue,\x20%s,\x20%s','message','info','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw'];(function(_0x131142,_0x15e4a3){var _0x3814d9=function(_0x4f19cb){while(--_0x4f19cb){_0x131142['push'](_0x131142['shift']());}};_0x3814d9(++_0x15e4a3);}(_0x3953,0x131));var _0x3395=function(_0x1d14e8,_0x54bbf6){_0x1d14e8=_0x1d14e8-0x0;var _0x162d52=_0x3953[_0x1d14e8];return _0x162d52;};'use strict';var _=require(_0x3395('0x0'));var util=require(_0x3395('0x1'));var moment=require('moment');var BPromise=require(_0x3395('0x2'));var rs=require(_0x3395('0x3'));var fs=require('fs');var Redis=require(_0x3395('0x4'));var db=require(_0x3395('0x5'))['db'];var utils=require(_0x3395('0x6'));var logger=require(_0x3395('0x7'))('rpc');var config=require(_0x3395('0x8'));var jayson=require(_0x3395('0x9'));var client=jayson[_0x3395('0xa')][_0x3395('0xb')]({'port':0x232a});config[_0x3395('0xc')]=_[_0x3395('0xd')](config[_0x3395('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3395('0xe'))(new Redis(config[_0x3395('0xc')]));require(_0x3395('0xf'))[_0x3395('0x10')](socket);function respondWithRpcPromise(_0x1819a1,_0x5af995,_0x276160){return new BPromise(function(_0x272e0e,_0x3b88dc){return client[_0x3395('0x11')](_0x1819a1,_0x276160)['then'](function(_0x56e7ac){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x5af995,_0x3395('0x12'));logger['debug'](_0x3395('0x13'),_0x5af995,_0x3395('0x12'),JSON[_0x3395('0x14')](_0x56e7ac));if(_0x56e7ac[_0x3395('0x15')]){if(_0x56e7ac[_0x3395('0x15')]['code']===0x1f4){logger['error'](_0x3395('0x16'),_0x5af995,_0x56e7ac['error'][_0x3395('0x17')]);return _0x3b88dc(_0x56e7ac[_0x3395('0x15')][_0x3395('0x17')]);}logger[_0x3395('0x15')](_0x3395('0x16'),_0x5af995,_0x56e7ac['error'][_0x3395('0x17')]);return _0x272e0e(_0x56e7ac[_0x3395('0x15')][_0x3395('0x17')]);}else{logger[_0x3395('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x5af995,'request\x20sent');_0x272e0e(_0x56e7ac[_0x3395('0x19')][_0x3395('0x17')]);}})['catch'](function(_0x518bb8){logger[_0x3395('0x15')](_0x3395('0x16'),_0x5af995,_0x518bb8);_0x3b88dc(_0x518bb8);});});}exports[_0x3395('0x1a')]=function(_0x7e254f){var _0x23408a=this;return new Promise(function(_0x3bd7f9,_0x19dde2){return db[_0x3395('0x1b')][_0x3395('0x1c')]({'raw':_0x7e254f[_0x3395('0x1d')]?_0x7e254f['options'][_0x3395('0x1e')]===undefined?!![]:![]:!![],'where':_0x7e254f[_0x3395('0x1d')]?_0x7e254f[_0x3395('0x1d')][_0x3395('0x1f')]||null:null,'attributes':_0x7e254f[_0x3395('0x1d')]?_0x7e254f[_0x3395('0x1d')][_0x3395('0x20')]||null:null,'limit':_0x7e254f[_0x3395('0x1d')]?_0x7e254f['options'][_0x3395('0x21')]||null:null,'include':_0x7e254f[_0x3395('0x1d')]?_0x7e254f['options'][_0x3395('0x22')]?_[_0x3395('0x23')](_0x7e254f[_0x3395('0x1d')][_0x3395('0x22')],function(_0x50596b){return{'model':db[_0x50596b[_0x3395('0x24')]],'as':_0x50596b['as'],'attributes':_0x50596b[_0x3395('0x20')],'include':_0x50596b['include']?_[_0x3395('0x23')](_0x50596b['include'],function(_0x38f0b8){return{'model':db[_0x38f0b8[_0x3395('0x24')]],'as':_0x38f0b8['as'],'attributes':_0x38f0b8[_0x3395('0x20')],'include':_0x38f0b8[_0x3395('0x22')]?_['map'](_0x38f0b8[_0x3395('0x22')],function(_0x5afef7){return{'model':db[_0x5afef7[_0x3395('0x24')]],'as':_0x5afef7['as'],'attributes':_0x5afef7[_0x3395('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3395('0x25')](function(_0x602586){logger[_0x3395('0x18')](_0x3395('0x1a'),_0x7e254f);logger[_0x3395('0x26')](_0x3395('0x1a'),_0x7e254f,JSON[_0x3395('0x14')](_0x602586));_0x3bd7f9(_0x602586);})[_0x3395('0x27')](function(_0x551369){logger[_0x3395('0x15')](_0x3395('0x1a'),_0x551369[_0x3395('0x17')],_0x7e254f);_0x19dde2(_0x23408a['error'](0x1f4,_0x551369[_0x3395('0x17')]));});});};exports[_0x3395('0x28')]=function(_0x419f8c){var _0x5183fa=this;return new Promise(function(_0x4535ef,_0x38eb83){return db[_0x3395('0x1b')][_0x3395('0x29')]({'raw':_0x419f8c[_0x3395('0x1d')]?_0x419f8c[_0x3395('0x1d')][_0x3395('0x1e')]===undefined?!![]:![]:!![],'where':_0x419f8c[_0x3395('0x1d')]?_0x419f8c['options'][_0x3395('0x1f')]||null:null,'attributes':_0x419f8c[_0x3395('0x1d')]?_0x419f8c[_0x3395('0x1d')][_0x3395('0x20')]||null:null,'include':_0x419f8c[_0x3395('0x1d')]?_0x419f8c[_0x3395('0x1d')][_0x3395('0x22')]?_[_0x3395('0x23')](_0x419f8c[_0x3395('0x1d')][_0x3395('0x22')],function(_0x1bd147){return{'model':db[_0x1bd147[_0x3395('0x24')]],'as':_0x1bd147['as'],'attributes':_0x1bd147['attributes'],'include':_0x1bd147[_0x3395('0x22')]?_[_0x3395('0x23')](_0x1bd147[_0x3395('0x22')],function(_0x1e143c){return{'model':db[_0x1e143c[_0x3395('0x24')]],'as':_0x1e143c['as'],'attributes':_0x1e143c['attributes'],'include':_0x1e143c['include']?_[_0x3395('0x23')](_0x1e143c[_0x3395('0x22')],function(_0x286662){return{'model':db[_0x286662[_0x3395('0x24')]],'as':_0x286662['as'],'attributes':_0x286662['attributes']};}):[]};}):[]};}):[]:[]})[_0x3395('0x25')](function(_0x319403){logger[_0x3395('0x18')](_0x3395('0x28'),_0x419f8c);logger[_0x3395('0x26')](_0x3395('0x28'),_0x419f8c,JSON[_0x3395('0x14')](_0x319403));_0x4535ef(_0x319403);})['catch'](function(_0x1ccf63){logger[_0x3395('0x15')](_0x3395('0x28'),_0x1ccf63['message'],_0x419f8c);_0x38eb83(_0x5183fa[_0x3395('0x15')](0x1f4,_0x1ccf63[_0x3395('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index ec9290a..98bcd50 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 _0xcaed=['save','remove','emit','removeListener','length'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xcaed,0x159));var _0xdcae=function(_0x51c53f,_0x5abaa1){_0x51c53f=_0x51c53f-0x0;var _0x2d22f6=_0xcaed[_0x51c53f];return _0x2d22f6;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xdcae('0x0'),_0xdcae('0x1'),'update'];function createListener(_0x4e1b44,_0x390585){return function(_0x2985ad){_0x390585[_0xdcae('0x2')](_0x4e1b44,_0x2985ad);};}function removeListener(_0x2bc95f,_0x1b64ab){return function(){WhatsappQueueEvents[_0xdcae('0x3')](_0x2bc95f,_0x1b64ab);};}exports['register']=function(_0x128789){for(var _0x4da2cb=0x0,_0x29a645=events[_0xdcae('0x4')];_0x4da2cb<_0x29a645;_0x4da2cb++){var _0x3e303c=events[_0x4da2cb];var _0x3a5bd7=createListener('whatsappQueue:'+_0x3e303c,_0x128789);WhatsappQueueEvents['on'](_0x3e303c,_0x3a5bd7);}}; \ No newline at end of file +var _0x2d1f=['./whatsappQueue.events','save','remove','update','emit','removeListener','register','length','whatsappQueue:'];(function(_0x5407a1,_0x2252db){var _0x5ee31e=function(_0x3877f5){while(--_0x3877f5){_0x5407a1['push'](_0x5407a1['shift']());}};_0x5ee31e(++_0x2252db);}(_0x2d1f,0x183));var _0xf2d1=function(_0x72353e,_0x5760e3){_0x72353e=_0x72353e-0x0;var _0x6b6a6d=_0x2d1f[_0x72353e];return _0x6b6a6d;};'use strict';var WhatsappQueueEvents=require(_0xf2d1('0x0'));var events=[_0xf2d1('0x1'),_0xf2d1('0x2'),_0xf2d1('0x3')];function createListener(_0x565b22,_0x5bdc0e){return function(_0x103e14){_0x5bdc0e[_0xf2d1('0x4')](_0x565b22,_0x103e14);};}function removeListener(_0x4f4e35,_0x3528d5){return function(){WhatsappQueueEvents[_0xf2d1('0x5')](_0x4f4e35,_0x3528d5);};}exports[_0xf2d1('0x6')]=function(_0x1a4599){for(var _0x58623f=0x0,_0x3979ed=events[_0xf2d1('0x7')];_0x58623f<_0x3979ed;_0x58623f++){var _0x278170=events[_0x58623f];var _0x4fb467=createListener(_0xf2d1('0x8')+_0x278170,_0x1a4599);WhatsappQueueEvents['on'](_0x278170,_0x4fb467);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index f40fe3e..741b45c 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 _0x0a05=['post','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1c90fb,_0x5366c6){var _0x4b53db=function(_0x2f476a){while(--_0x2f476a){_0x1c90fb['push'](_0x1c90fb['shift']());}};_0x4b53db(++_0x5366c6);}(_0x0a05,0xa4));var _0x50a0=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x0a05[_0x1e3c16];return _0x47a0c9;};'use strict';var multer=require(_0x50a0('0x0'));var util=require(_0x50a0('0x1'));var path=require(_0x50a0('0x2'));var timeout=require('connect-timeout');var express=require(_0x50a0('0x3'));var router=express[_0x50a0('0x4')]();var fs_extra=require(_0x50a0('0x5'));var auth=require(_0x50a0('0x6'));var interaction=require(_0x50a0('0x7'));var config=require('../../config/environment');var controller=require(_0x50a0('0x8'));router[_0x50a0('0x9')]('/',auth[_0x50a0('0xa')](),controller[_0x50a0('0xb')]);router['get'](_0x50a0('0xc'),auth[_0x50a0('0xa')](),controller[_0x50a0('0xd')]);router[_0x50a0('0x9')](_0x50a0('0xe'),auth[_0x50a0('0xa')](),controller[_0x50a0('0xf')]);router[_0x50a0('0x10')]('/',auth[_0x50a0('0xa')](),controller['create']);router[_0x50a0('0x11')](_0x50a0('0xe'),auth[_0x50a0('0xa')](),controller['update']);router[_0x50a0('0x12')](_0x50a0('0xe'),auth[_0x50a0('0xa')](),controller[_0x50a0('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7dd1=['/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x7dd1,0x16f));var _0x17dd=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x7dd1[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require(_0x17dd('0x0'));var util=require('util');var path=require(_0x17dd('0x1'));var timeout=require('connect-timeout');var express=require(_0x17dd('0x2'));var router=express[_0x17dd('0x3')]();var fs_extra=require(_0x17dd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x17dd('0x5'));var config=require(_0x17dd('0x6'));var controller=require(_0x17dd('0x7'));router[_0x17dd('0x8')]('/',auth[_0x17dd('0x9')](),controller[_0x17dd('0xa')]);router[_0x17dd('0x8')](_0x17dd('0xb'),auth[_0x17dd('0x9')](),controller['describe']);router[_0x17dd('0x8')](_0x17dd('0xc'),auth[_0x17dd('0x9')](),controller[_0x17dd('0xd')]);router[_0x17dd('0xe')]('/',auth[_0x17dd('0x9')](),controller[_0x17dd('0xf')]);router[_0x17dd('0x10')](_0x17dd('0xc'),auth[_0x17dd('0x9')](),controller[_0x17dd('0x11')]);router[_0x17dd('0x12')](_0x17dd('0xc'),auth[_0x17dd('0x9')](),controller[_0x17dd('0x13')]);module[_0x17dd('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 83dcd69..ca87472 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2c0534,_0x2b5af6){var _0x35834a=function(_0x3a9e8c){while(--_0x3a9e8c){_0x2c0534['push'](_0x2c0534['shift']());}};_0x35834a(++_0x2b5af6);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2f4a21,_0x2fcdd1){var _0x41a39c=function(_0x2f41b8){while(--_0x2f41b8){_0x2f4a21['push'](_0x2f4a21['shift']());}};_0x41a39c(++_0x2fcdd1);}(_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')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 3711577..6a7e8dc 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 _0x0fd9=['includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options'];(function(_0x233db0,_0x394006){var _0x44c8a7=function(_0x515665){while(--_0x515665){_0x233db0['push'](_0x233db0['shift']());}};_0x44c8a7(++_0x394006);}(_0x0fd9,0xa3));var _0x90fd=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x0fd9[_0x622035];return _0x326cf2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90fd('0x0'));var zipdir=require(_0x90fd('0x1'));var jsonpatch=require(_0x90fd('0x2'));var rp=require(_0x90fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90fd('0x4'));var util=require(_0x90fd('0x5'));var path=require(_0x90fd('0x6'));var sox=require(_0x90fd('0x7'));var csv=require(_0x90fd('0x8'));var ejs=require(_0x90fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x8'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x90fd('0x15'));var db=require(_0x90fd('0x16'))['db'];function respondWithStatusCode(_0x4e8b99,_0x1439ed){_0x1439ed=_0x1439ed||0xcc;return function(_0x37a0f8){if(_0x37a0f8){return _0x4e8b99[_0x90fd('0x17')](_0x1439ed);}return _0x4e8b99['status'](_0x1439ed)[_0x90fd('0x18')]();};}function respondWithResult(_0x48e701,_0x1cae40){_0x1cae40=_0x1cae40||0xc8;return function(_0xb402d9){if(_0xb402d9){return _0x48e701[_0x90fd('0x19')](_0x1cae40)[_0x90fd('0x1a')](_0xb402d9);}};}function respondWithFilteredResult(_0x3c5da8,_0x442a19){return function(_0x296a64){if(_0x296a64){var _0x4eb953=typeof _0x442a19['offset']===_0x90fd('0x1b')&&typeof _0x442a19[_0x90fd('0x1c')]==='undefined';var _0x130489=_0x296a64[_0x90fd('0x1d')];var _0x1fcc87=_0x4eb953?0x0:_0x442a19['offset'];var _0x3f9c76=_0x4eb953?_0x296a64[_0x90fd('0x1d')]:_0x442a19[_0x90fd('0x1e')]+_0x442a19[_0x90fd('0x1c')];var _0x251957;if(_0x3f9c76>=_0x130489){_0x3f9c76=_0x130489;_0x251957=0xc8;}else{_0x251957=0xce;}_0x3c5da8[_0x90fd('0x19')](_0x251957);return _0x3c5da8[_0x90fd('0x1f')](_0x90fd('0x20'),_0x1fcc87+'-'+_0x3f9c76+'/'+_0x130489)[_0x90fd('0x1a')](_0x296a64);}return null;};}function patchUpdates(_0x90197e){return function(_0x19e79b){try{jsonpatch[_0x90fd('0x21')](_0x19e79b,_0x90197e,!![]);}catch(_0x1fb31a){return BPromise[_0x90fd('0x22')](_0x1fb31a);}return _0x19e79b[_0x90fd('0x23')]();};}function saveUpdates(_0x493c26,_0x35ce4e){return function(_0xc4e4e2){if(_0xc4e4e2){return _0xc4e4e2[_0x90fd('0x24')](_0x493c26)[_0x90fd('0x25')](function(_0x411a6a){return _0x411a6a;});}return null;};}function removeEntity(_0x3ad6c6,_0x30f67e){return function(_0x300262){if(_0x300262){return _0x300262['destroy']()[_0x90fd('0x25')](function(){_0x3ad6c6['status'](0xcc)[_0x90fd('0x18')]();});}};}function handleEntityNotFound(_0x18d5b3,_0x2ffea2){return function(_0x31667c){if(!_0x31667c){_0x18d5b3[_0x90fd('0x17')](0x194);}return _0x31667c;};}function handleError(_0x4c962f,_0x35c38d){_0x35c38d=_0x35c38d||0x1f4;return function(_0xe333f0){logger[_0x90fd('0x26')](_0xe333f0[_0x90fd('0x27')]);if(_0xe333f0[_0x90fd('0x28')]){delete _0xe333f0[_0x90fd('0x28')];}_0x4c962f['status'](_0x35c38d)['send'](_0xe333f0);};}exports[_0x90fd('0x29')]=function(_0x170cfb,_0x2924e9){var _0x404971={},_0x397aaf={},_0x59b3e8={'count':0x0,'rows':[]};var _0x4f69e7=_[_0x90fd('0x2a')](db[_0x90fd('0x2b')][_0x90fd('0x2c')],function(_0x3a0102){return{'name':_0x3a0102['fieldName'],'type':_0x3a0102['type'][_0x90fd('0x2d')]};});_0x397aaf[_0x90fd('0x2e')]=_[_0x90fd('0x2a')](_0x4f69e7,_0x90fd('0x28'));_0x397aaf['query']=_[_0x90fd('0x2f')](_0x170cfb[_0x90fd('0x30')]);_0x397aaf[_0x90fd('0x31')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],_0x397aaf[_0x90fd('0x30')]);_0x404971[_0x90fd('0x33')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x34')]));_0x404971[_0x90fd('0x33')]=_0x404971[_0x90fd('0x33')][_0x90fd('0x35')]?_0x404971[_0x90fd('0x33')]:_0x397aaf['model'];if(!_0x170cfb[_0x90fd('0x30')][_0x90fd('0x36')](_0x90fd('0x37'))){_0x404971[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1c')]);_0x404971[_0x90fd('0x1e')]=qs[_0x90fd('0x1e')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1e')]);}_0x404971[_0x90fd('0x38')]=qs[_0x90fd('0x39')](_0x170cfb['query'][_0x90fd('0x39')]);_0x404971[_0x90fd('0x3a')]=qs[_0x90fd('0x31')](_[_0x90fd('0x3b')](_0x170cfb['query'],_0x397aaf[_0x90fd('0x31')]),_0x4f69e7);if(_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]){_0x404971['where']=_['merge'](_0x404971[_0x90fd('0x3a')],{'$or':_[_0x90fd('0x2a')](_0x4f69e7,function(_0x377319){if(_0x377319[_0x90fd('0x3d')]!==_0x90fd('0x3e')){var _0x254200={};_0x254200[_0x377319[_0x90fd('0x28')]]={'$like':'%'+_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]+'%'};return _0x254200;}})});}_0x404971=_[_0x90fd('0x3f')]({},_0x404971,_0x170cfb[_0x90fd('0x40')]);var _0x43c84c={'where':_0x404971[_0x90fd('0x3a')]};return db[_0x90fd('0x2b')][_0x90fd('0x1d')](_0x43c84c)[_0x90fd('0x25')](function(_0x2717ca){_0x59b3e8[_0x90fd('0x1d')]=_0x2717ca;if(_0x170cfb['query'][_0x90fd('0x41')]){_0x404971[_0x90fd('0x42')]=[{'all':!![]}];}return db[_0x90fd('0x2b')]['findAll'](_0x404971);})['then'](function(_0x47b8c8){_0x59b3e8[_0x90fd('0x43')]=_0x47b8c8;return _0x59b3e8;})[_0x90fd('0x25')](respondWithFilteredResult(_0x2924e9,_0x404971))[_0x90fd('0x44')](handleError(_0x2924e9,null));};exports[_0x90fd('0x45')]=function(_0x1361d9,_0x311c7e){var _0x363365={'raw':!![],'where':{'id':_0x1361d9[_0x90fd('0x46')]['id']}},_0x733d4d={};_0x733d4d[_0x90fd('0x2e')]=_[_0x90fd('0x2f')](db[_0x90fd('0x2b')][_0x90fd('0x2c')]);_0x733d4d[_0x90fd('0x30')]=_[_0x90fd('0x2f')](_0x1361d9['query']);_0x733d4d['filters']=_[_0x90fd('0x32')](_0x733d4d[_0x90fd('0x2e')],_0x733d4d[_0x90fd('0x30')]);_0x363365['attributes']=_['intersection'](_0x733d4d[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x1361d9['query']['fields']));_0x363365[_0x90fd('0x33')]=_0x363365[_0x90fd('0x33')]['length']?_0x363365['attributes']:_0x733d4d[_0x90fd('0x2e')];if(_0x1361d9[_0x90fd('0x30')][_0x90fd('0x41')]){_0x363365['include']=[{'all':!![]}];}_0x363365=_[_0x90fd('0x3f')]({},_0x363365,_0x1361d9[_0x90fd('0x40')]);return db['WhatsappQueueReport']['find'](_0x363365)['then'](handleEntityNotFound(_0x311c7e,null))[_0x90fd('0x25')](respondWithResult(_0x311c7e,null))[_0x90fd('0x44')](handleError(_0x311c7e,null));};exports['create']=function(_0x2d42b3,_0x2b73f7){return db[_0x90fd('0x2b')][_0x90fd('0x47')](_0x2d42b3[_0x90fd('0x48')],{})['then'](respondWithResult(_0x2b73f7,0xc9))['catch'](handleError(_0x2b73f7,null));};exports[_0x90fd('0x24')]=function(_0x326e4d,_0x125874){if(_0x326e4d[_0x90fd('0x48')]['id']){delete _0x326e4d[_0x90fd('0x48')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x49')]({'where':{'id':_0x326e4d[_0x90fd('0x46')]['id']}})[_0x90fd('0x25')](handleEntityNotFound(_0x125874,null))[_0x90fd('0x25')](saveUpdates(_0x326e4d['body'],null))[_0x90fd('0x25')](respondWithResult(_0x125874,null))[_0x90fd('0x44')](handleError(_0x125874,null));};exports[_0x90fd('0x4a')]=function(_0x38021b,_0x4b47bc){return db['WhatsappQueueReport'][_0x90fd('0x49')]({'where':{'id':_0x38021b['params']['id']}})['then'](handleEntityNotFound(_0x4b47bc,null))[_0x90fd('0x25')](removeEntity(_0x4b47bc,null))[_0x90fd('0x44')](handleError(_0x4b47bc,null));};exports[_0x90fd('0x4b')]=function(_0xb8a2af,_0x13c428){return db[_0x90fd('0x2b')][_0x90fd('0x4b')]()['then'](respondWithResult(_0x13c428,null))['catch'](handleError(_0x13c428,null));}; \ No newline at end of file +var _0x1c7c=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','name','index','map','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x1c7c,0x164));var _0xc1c7=function(_0x486f57,_0xef3656){_0x486f57=_0x486f57-0x0;var _0x26b436=_0x1c7c[_0x486f57];return _0x26b436;};'use strict';var emlformat=require(_0xc1c7('0x0'));var rimraf=require(_0xc1c7('0x1'));var zipdir=require(_0xc1c7('0x2'));var jsonpatch=require(_0xc1c7('0x3'));var rp=require('request-promise');var moment=require(_0xc1c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1c7('0x5'));var util=require(_0xc1c7('0x6'));var path=require(_0xc1c7('0x7'));var sox=require(_0xc1c7('0x8'));var csv=require(_0xc1c7('0x9'));var ejs=require(_0xc1c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc1c7('0xb'));var _=require(_0xc1c7('0xc'));var squel=require(_0xc1c7('0xd'));var crypto=require(_0xc1c7('0xe'));var jsforce=require(_0xc1c7('0xf'));var deskjs=require(_0xc1c7('0x10'));var toCsv=require(_0xc1c7('0x9'));var querystring=require(_0xc1c7('0x11'));var Papa=require(_0xc1c7('0x12'));var Redis=require(_0xc1c7('0x13'));var authService=require(_0xc1c7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc1c7('0x15'));var hardwareService=require(_0xc1c7('0x16'));var logger=require('../../config/logger')(_0xc1c7('0x17'));var utils=require(_0xc1c7('0x18'));var config=require(_0xc1c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1c7('0x1a'))['db'];function respondWithStatusCode(_0x44bf88,_0x376cab){_0x376cab=_0x376cab||0xcc;return function(_0x35feaa){if(_0x35feaa){return _0x44bf88[_0xc1c7('0x1b')](_0x376cab);}return _0x44bf88[_0xc1c7('0x1c')](_0x376cab)[_0xc1c7('0x1d')]();};}function respondWithResult(_0x1b57ab,_0xdfc7d9){_0xdfc7d9=_0xdfc7d9||0xc8;return function(_0x1b6905){if(_0x1b6905){return _0x1b57ab[_0xc1c7('0x1c')](_0xdfc7d9)[_0xc1c7('0x1e')](_0x1b6905);}};}function respondWithFilteredResult(_0x49576d,_0x3e1f0e){return function(_0x335600){if(_0x335600){var _0x21911c=typeof _0x3e1f0e['offset']===_0xc1c7('0x1f')&&typeof _0x3e1f0e[_0xc1c7('0x20')]===_0xc1c7('0x1f');var _0x39ac54=_0x335600[_0xc1c7('0x21')];var _0xb42702=_0x21911c?0x0:_0x3e1f0e[_0xc1c7('0x22')];var _0x2e93e5=_0x21911c?_0x335600['count']:_0x3e1f0e[_0xc1c7('0x22')]+_0x3e1f0e[_0xc1c7('0x20')];var _0x3ec66a;if(_0x2e93e5>=_0x39ac54){_0x2e93e5=_0x39ac54;_0x3ec66a=0xc8;}else{_0x3ec66a=0xce;}_0x49576d[_0xc1c7('0x1c')](_0x3ec66a);return _0x49576d['set'](_0xc1c7('0x23'),_0xb42702+'-'+_0x2e93e5+'/'+_0x39ac54)['json'](_0x335600);}return null;};}function patchUpdates(_0x5e7e4a){return function(_0x195c5f){try{jsonpatch['apply'](_0x195c5f,_0x5e7e4a,!![]);}catch(_0x5846f0){return BPromise[_0xc1c7('0x24')](_0x5846f0);}return _0x195c5f[_0xc1c7('0x25')]();};}function saveUpdates(_0x2f1b87,_0x4c6b34){return function(_0x813853){if(_0x813853){return _0x813853[_0xc1c7('0x26')](_0x2f1b87)[_0xc1c7('0x27')](function(_0x31a0e0){return _0x31a0e0;});}return null;};}function removeEntity(_0x2e64c4,_0x3a2483){return function(_0x3180fd){if(_0x3180fd){return _0x3180fd[_0xc1c7('0x28')]()[_0xc1c7('0x27')](function(){_0x2e64c4[_0xc1c7('0x1c')](0xcc)[_0xc1c7('0x1d')]();});}};}function handleEntityNotFound(_0x363fbc,_0x33aac7){return function(_0x260a3f){if(!_0x260a3f){_0x363fbc[_0xc1c7('0x1b')](0x194);}return _0x260a3f;};}function handleError(_0x21563a,_0x5edb34){_0x5edb34=_0x5edb34||0x1f4;return function(_0xf0ab9c){logger[_0xc1c7('0x29')](_0xf0ab9c['stack']);if(_0xf0ab9c['name']){delete _0xf0ab9c[_0xc1c7('0x2a')];}_0x21563a['status'](_0x5edb34)['send'](_0xf0ab9c);};}exports[_0xc1c7('0x2b')]=function(_0x1b873c,_0x46d045){var _0x243450={},_0x461360={},_0x4adb81={'count':0x0,'rows':[]};var _0x574e1c=_[_0xc1c7('0x2c')](db[_0xc1c7('0x2d')][_0xc1c7('0x2e')],function(_0x3a786f){return{'name':_0x3a786f[_0xc1c7('0x2f')],'type':_0x3a786f['type']['key']};});_0x461360[_0xc1c7('0x30')]=_[_0xc1c7('0x2c')](_0x574e1c,'name');_0x461360[_0xc1c7('0x31')]=_[_0xc1c7('0x32')](_0x1b873c[_0xc1c7('0x31')]);_0x461360[_0xc1c7('0x33')]=_[_0xc1c7('0x34')](_0x461360[_0xc1c7('0x30')],_0x461360[_0xc1c7('0x31')]);_0x243450['attributes']=_[_0xc1c7('0x34')](_0x461360[_0xc1c7('0x30')],qs[_0xc1c7('0x35')](_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x35')]));_0x243450[_0xc1c7('0x36')]=_0x243450[_0xc1c7('0x36')][_0xc1c7('0x37')]?_0x243450[_0xc1c7('0x36')]:_0x461360['model'];if(!_0x1b873c['query'][_0xc1c7('0x38')](_0xc1c7('0x39'))){_0x243450[_0xc1c7('0x20')]=qs[_0xc1c7('0x20')](_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x20')]);_0x243450[_0xc1c7('0x22')]=qs[_0xc1c7('0x22')](_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x22')]);}_0x243450[_0xc1c7('0x3a')]=qs[_0xc1c7('0x3b')](_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x3b')]);_0x243450[_0xc1c7('0x3c')]=qs[_0xc1c7('0x33')](_[_0xc1c7('0x3d')](_0x1b873c[_0xc1c7('0x31')],_0x461360[_0xc1c7('0x33')]),_0x574e1c);if(_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x3e')]){_0x243450['where']=_['merge'](_0x243450['where'],{'$or':_[_0xc1c7('0x2c')](_0x574e1c,function(_0x4f4312){if(_0x4f4312['type']!==_0xc1c7('0x3f')){var _0x24ceb4={};_0x24ceb4[_0x4f4312[_0xc1c7('0x2a')]]={'$like':'%'+_0x1b873c[_0xc1c7('0x31')]['filter']+'%'};return _0x24ceb4;}})});}_0x243450=_[_0xc1c7('0x40')]({},_0x243450,_0x1b873c[_0xc1c7('0x41')]);var _0x32e9fd={'where':_0x243450[_0xc1c7('0x3c')]};return db[_0xc1c7('0x2d')][_0xc1c7('0x21')](_0x32e9fd)[_0xc1c7('0x27')](function(_0x26343d){_0x4adb81[_0xc1c7('0x21')]=_0x26343d;if(_0x1b873c[_0xc1c7('0x31')][_0xc1c7('0x42')]){_0x243450[_0xc1c7('0x43')]=[{'all':!![]}];}return db[_0xc1c7('0x2d')]['findAll'](_0x243450);})[_0xc1c7('0x27')](function(_0x412520){_0x4adb81['rows']=_0x412520;return _0x4adb81;})[_0xc1c7('0x27')](respondWithFilteredResult(_0x46d045,_0x243450))[_0xc1c7('0x44')](handleError(_0x46d045,null));};exports[_0xc1c7('0x45')]=function(_0x7131b1,_0x46a1b5){var _0x2c09de={'raw':!![],'where':{'id':_0x7131b1[_0xc1c7('0x46')]['id']}},_0xd5e06a={};_0xd5e06a[_0xc1c7('0x30')]=_[_0xc1c7('0x32')](db['WhatsappQueueReport'][_0xc1c7('0x2e')]);_0xd5e06a[_0xc1c7('0x31')]=_['keys'](_0x7131b1['query']);_0xd5e06a[_0xc1c7('0x33')]=_[_0xc1c7('0x34')](_0xd5e06a[_0xc1c7('0x30')],_0xd5e06a[_0xc1c7('0x31')]);_0x2c09de[_0xc1c7('0x36')]=_['intersection'](_0xd5e06a[_0xc1c7('0x30')],qs[_0xc1c7('0x35')](_0x7131b1['query']['fields']));_0x2c09de['attributes']=_0x2c09de[_0xc1c7('0x36')][_0xc1c7('0x37')]?_0x2c09de[_0xc1c7('0x36')]:_0xd5e06a['model'];if(_0x7131b1[_0xc1c7('0x31')][_0xc1c7('0x42')]){_0x2c09de['include']=[{'all':!![]}];}_0x2c09de=_[_0xc1c7('0x40')]({},_0x2c09de,_0x7131b1[_0xc1c7('0x41')]);return db[_0xc1c7('0x2d')][_0xc1c7('0x47')](_0x2c09de)[_0xc1c7('0x27')](handleEntityNotFound(_0x46a1b5,null))[_0xc1c7('0x27')](respondWithResult(_0x46a1b5,null))[_0xc1c7('0x44')](handleError(_0x46a1b5,null));};exports[_0xc1c7('0x48')]=function(_0x35141f,_0x3ec5de){return db[_0xc1c7('0x2d')][_0xc1c7('0x48')](_0x35141f[_0xc1c7('0x49')],{})[_0xc1c7('0x27')](respondWithResult(_0x3ec5de,0xc9))[_0xc1c7('0x44')](handleError(_0x3ec5de,null));};exports[_0xc1c7('0x26')]=function(_0x2967b7,_0x1addc8){if(_0x2967b7['body']['id']){delete _0x2967b7[_0xc1c7('0x49')]['id'];}return db['WhatsappQueueReport'][_0xc1c7('0x47')]({'where':{'id':_0x2967b7[_0xc1c7('0x46')]['id']}})[_0xc1c7('0x27')](handleEntityNotFound(_0x1addc8,null))['then'](saveUpdates(_0x2967b7[_0xc1c7('0x49')],null))[_0xc1c7('0x27')](respondWithResult(_0x1addc8,null))['catch'](handleError(_0x1addc8,null));};exports['destroy']=function(_0x5c96cc,_0x302185){return db[_0xc1c7('0x2d')]['find']({'where':{'id':_0x5c96cc[_0xc1c7('0x46')]['id']}})[_0xc1c7('0x27')](handleEntityNotFound(_0x302185,null))[_0xc1c7('0x27')](removeEntity(_0x302185,null))[_0xc1c7('0x44')](handleError(_0x302185,null));};exports[_0xc1c7('0x4a')]=function(_0x13569a,_0x4cad6a){return db[_0xc1c7('0x2d')]['describe']()[_0xc1c7('0x27')](respondWithResult(_0x4cad6a,null))[_0xc1c7('0x44')](handleError(_0x4cad6a,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index a5d56a3..1eef1e1 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 _0x7a21=['path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','report_whatsapp_queue','uniqueid','lodash','api','bluebird','request-promise'];(function(_0x2ee70f,_0x49223c){var _0x33e1a3=function(_0x5ce18a){while(--_0x5ce18a){_0x2ee70f['push'](_0x2ee70f['shift']());}};_0x33e1a3(++_0x49223c);}(_0x7a21,0x1ca));var _0x17a2=function(_0x30e4ce,_0x433da0){_0x30e4ce=_0x30e4ce-0x0;var _0x4498bd=_0x7a21[_0x30e4ce];return _0x4498bd;};'use strict';var _=require(_0x17a2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x17a2('0x1'));var moment=require('moment');var BPromise=require(_0x17a2('0x2'));var rp=require(_0x17a2('0x3'));var fs=require('fs');var path=require(_0x17a2('0x4'));var rimraf=require(_0x17a2('0x5'));var config=require(_0x17a2('0x6'));var attributes=require(_0x17a2('0x7'));module[_0x17a2('0x8')]=function(_0x158bc4,_0x44dd64){return _0x158bc4['define']('WhatsappQueueReport',attributes,{'tableName':_0x17a2('0x9'),'paranoid':![],'indexes':[{'name':_0x17a2('0xa'),'fields':[_0x17a2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb87f=['./whatsappQueueReport.attributes','define','report_whatsapp_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0xa72345,_0x1fd304){var _0xbc82fb=function(_0xb1594f){while(--_0xb1594f){_0xa72345['push'](_0xa72345['shift']());}};_0xbc82fb(++_0x1fd304);}(_0xb87f,0x112));var _0xfb87=function(_0x4e5333,_0x3f8eb6){_0x4e5333=_0x4e5333-0x0;var _0x4f4e2e=_0xb87f[_0x4e5333];return _0x4f4e2e;};'use strict';var _=require('lodash');var util=require(_0xfb87('0x0'));var logger=require(_0xfb87('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfb87('0x2'));var fs=require('fs');var path=require(_0xfb87('0x3'));var rimraf=require(_0xfb87('0x4'));var config=require(_0xfb87('0x5'));var attributes=require(_0xfb87('0x6'));module['exports']=function(_0x213af3,_0x2d91e6){return _0x213af3[_0xfb87('0x7')]('WhatsappQueueReport',attributes,{'tableName':_0xfb87('0x8'),'paranoid':![],'indexes':[{'name':_0xfb87('0x9'),'fields':[_0xfb87('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 3457649..0adf639 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 _0xc8f8=['WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','create','body','options','raw','debug','UpdateWhatsappQueueReport','update','where','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x41530b,_0x254c58){var _0x8cfb0d=function(_0x382204){while(--_0x382204){_0x41530b['push'](_0x41530b['shift']());}};_0x8cfb0d(++_0x254c58);}(_0xc8f8,0xf7));var _0x8c8f=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xc8f8[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0x8c8f('0x0'));var util=require('util');var moment=require(_0x8c8f('0x1'));var BPromise=require(_0x8c8f('0x2'));var rs=require(_0x8c8f('0x3'));var fs=require('fs');var Redis=require(_0x8c8f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c8f('0x5'));var logger=require(_0x8c8f('0x6'))(_0x8c8f('0x7'));var config=require(_0x8c8f('0x8'));var jayson=require(_0x8c8f('0x9'));var client=jayson[_0x8c8f('0xa')][_0x8c8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5697d3,_0x87d6ba,_0x436c2f){return new BPromise(function(_0x40a346,_0x1fd75b){return client[_0x8c8f('0xc')](_0x5697d3,_0x436c2f)[_0x8c8f('0xd')](function(_0x469f6a){logger[_0x8c8f('0xe')](_0x8c8f('0xf'),_0x87d6ba,_0x8c8f('0x10'));logger['debug'](_0x8c8f('0x11'),_0x87d6ba,'request\x20sent',JSON[_0x8c8f('0x12')](_0x469f6a));if(_0x469f6a['error']){if(_0x469f6a[_0x8c8f('0x13')][_0x8c8f('0x14')]===0x1f4){logger[_0x8c8f('0x13')](_0x8c8f('0xf'),_0x87d6ba,_0x469f6a[_0x8c8f('0x13')][_0x8c8f('0x15')]);return _0x1fd75b(_0x469f6a['error']['message']);}logger[_0x8c8f('0x13')](_0x8c8f('0xf'),_0x87d6ba,_0x469f6a[_0x8c8f('0x13')]['message']);return _0x40a346(_0x469f6a[_0x8c8f('0x13')][_0x8c8f('0x15')]);}else{logger[_0x8c8f('0xe')](_0x8c8f('0xf'),_0x87d6ba,'request\x20sent');_0x40a346(_0x469f6a[_0x8c8f('0x16')]['message']);}})[_0x8c8f('0x17')](function(_0x3a1c1e){logger[_0x8c8f('0x13')](_0x8c8f('0xf'),_0x87d6ba,_0x3a1c1e);_0x1fd75b(_0x3a1c1e);});});}exports[_0x8c8f('0x18')]=function(_0x2120ae){var _0x10836c=this;return new Promise(function(_0x3ecd6c,_0x565b50){return db['WhatsappQueueReport'][_0x8c8f('0x19')](_0x2120ae[_0x8c8f('0x1a')],{'raw':_0x2120ae[_0x8c8f('0x1b')]?_0x2120ae[_0x8c8f('0x1b')][_0x8c8f('0x1c')]===undefined?!![]:![]:!![]})[_0x8c8f('0xd')](function(_0xc8379c){logger[_0x8c8f('0xe')](_0x8c8f('0x18'),_0x2120ae);logger[_0x8c8f('0x1d')]('CreateWhatsappQueueReport',_0x2120ae,JSON[_0x8c8f('0x12')](_0xc8379c));_0x3ecd6c(_0xc8379c);})[_0x8c8f('0x17')](function(_0xa4289b){logger[_0x8c8f('0x13')]('CreateWhatsappQueueReport',_0xa4289b['message'],_0x2120ae);_0x565b50(_0x10836c[_0x8c8f('0x13')](0x1f4,_0xa4289b[_0x8c8f('0x15')]));});});};exports[_0x8c8f('0x1e')]=function(_0x5f4bde){var _0x2a4e3f=this;return new Promise(function(_0x44ddd0,_0x5844d6){return db['WhatsappQueueReport'][_0x8c8f('0x1f')](_0x5f4bde[_0x8c8f('0x1a')],{'raw':_0x5f4bde[_0x8c8f('0x1b')]?_0x5f4bde[_0x8c8f('0x1b')][_0x8c8f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f4bde['options']?_0x5f4bde[_0x8c8f('0x1b')][_0x8c8f('0x20')]||null:null,'attributes':_0x5f4bde[_0x8c8f('0x1b')]?_0x5f4bde['options']['attributes']||null:null,'limit':_0x5f4bde[_0x8c8f('0x1b')]?_0x5f4bde[_0x8c8f('0x1b')]['limit']||null:null})['then'](function(_0x1d24a6){logger[_0x8c8f('0xe')]('UpdateWhatsappQueueReport',_0x5f4bde);logger[_0x8c8f('0x1d')](_0x8c8f('0x1e'),_0x5f4bde,JSON[_0x8c8f('0x12')](_0x1d24a6));_0x44ddd0(_0x1d24a6);})[_0x8c8f('0x17')](function(_0x789c4){logger[_0x8c8f('0x13')](_0x8c8f('0x1e'),_0x789c4[_0x8c8f('0x15')],_0x5f4bde);_0x5844d6(_0x2a4e3f[_0x8c8f('0x13')](0x1f4,_0x789c4[_0x8c8f('0x15')]));});});}; \ No newline at end of file +var _0x2300=['error','code','message','info','CreateWhatsappQueueReport','options','raw','catch','UpdateWhatsappQueueReport','WhatsappQueueReport','update','body','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0x2300,0x181));var _0x0230=function(_0xe70d58,_0x17fbf1){_0xe70d58=_0xe70d58-0x0;var _0x44845d=_0x2300[_0xe70d58];return _0x44845d;};'use strict';var _=require(_0x0230('0x0'));var util=require(_0x0230('0x1'));var moment=require(_0x0230('0x2'));var BPromise=require('bluebird');var rs=require(_0x0230('0x3'));var fs=require('fs');var Redis=require(_0x0230('0x4'));var db=require(_0x0230('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0230('0x6'))(_0x0230('0x7'));var config=require('../../config/environment');var jayson=require(_0x0230('0x8'));var client=jayson[_0x0230('0x9')][_0x0230('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x263117,_0x3d69f1,_0x30ca04){return new BPromise(function(_0x4f3238,_0xa48472){return client[_0x0230('0xb')](_0x263117,_0x30ca04)[_0x0230('0xc')](function(_0x532633){logger['info'](_0x0230('0xd'),_0x3d69f1,_0x0230('0xe'));logger[_0x0230('0xf')](_0x0230('0x10'),_0x3d69f1,_0x0230('0xe'),JSON[_0x0230('0x11')](_0x532633));if(_0x532633[_0x0230('0x12')]){if(_0x532633['error'][_0x0230('0x13')]===0x1f4){logger['error'](_0x0230('0xd'),_0x3d69f1,_0x532633[_0x0230('0x12')]['message']);return _0xa48472(_0x532633[_0x0230('0x12')][_0x0230('0x14')]);}logger[_0x0230('0x12')](_0x0230('0xd'),_0x3d69f1,_0x532633['error'][_0x0230('0x14')]);return _0x4f3238(_0x532633['error'][_0x0230('0x14')]);}else{logger[_0x0230('0x15')](_0x0230('0xd'),_0x3d69f1,_0x0230('0xe'));_0x4f3238(_0x532633['result']['message']);}})['catch'](function(_0x2b321d){logger[_0x0230('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3d69f1,_0x2b321d);_0xa48472(_0x2b321d);});});}exports[_0x0230('0x16')]=function(_0x11f992){var _0xd8d0c9=this;return new Promise(function(_0x5afaf1,_0x5cd53f){return db['WhatsappQueueReport']['create'](_0x11f992['body'],{'raw':_0x11f992[_0x0230('0x17')]?_0x11f992[_0x0230('0x17')][_0x0230('0x18')]===undefined?!![]:![]:!![]})[_0x0230('0xc')](function(_0x49c8ed){logger[_0x0230('0x15')](_0x0230('0x16'),_0x11f992);logger[_0x0230('0xf')](_0x0230('0x16'),_0x11f992,JSON[_0x0230('0x11')](_0x49c8ed));_0x5afaf1(_0x49c8ed);})[_0x0230('0x19')](function(_0x591599){logger[_0x0230('0x12')](_0x0230('0x16'),_0x591599[_0x0230('0x14')],_0x11f992);_0x5cd53f(_0xd8d0c9[_0x0230('0x12')](0x1f4,_0x591599[_0x0230('0x14')]));});});};exports[_0x0230('0x1a')]=function(_0x4f897a){var _0x38a183=this;return new Promise(function(_0x218a9b,_0x27ce65){return db[_0x0230('0x1b')][_0x0230('0x1c')](_0x4f897a[_0x0230('0x1d')],{'raw':_0x4f897a[_0x0230('0x17')]?_0x4f897a[_0x0230('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f897a[_0x0230('0x17')]?_0x4f897a[_0x0230('0x17')]['where']||null:null,'attributes':_0x4f897a[_0x0230('0x17')]?_0x4f897a[_0x0230('0x17')]['attributes']||null:null,'limit':_0x4f897a['options']?_0x4f897a[_0x0230('0x17')][_0x0230('0x1e')]||null:null})[_0x0230('0xc')](function(_0x4c9908){logger[_0x0230('0x15')](_0x0230('0x1a'),_0x4f897a);logger[_0x0230('0xf')](_0x0230('0x1a'),_0x4f897a,JSON[_0x0230('0x11')](_0x4c9908));_0x218a9b(_0x4c9908);})['catch'](function(_0x3356d7){logger[_0x0230('0x12')]('UpdateWhatsappQueueReport',_0x3356d7['message'],_0x4f897a);_0x27ce65(_0x38a183[_0x0230('0x12')](0x1f4,_0x3356d7['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 15619f2..09f0c5d 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 _0x4c61=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4c61,0x1cc));var _0x14c6=function(_0x532389,_0x481ed8){_0x532389=_0x532389-0x0;var _0x2aa547=_0x4c61[_0x532389];return _0x2aa547;};'use strict';var multer=require(_0x14c6('0x0'));var util=require(_0x14c6('0x1'));var path=require(_0x14c6('0x2'));var timeout=require(_0x14c6('0x3'));var express=require('express');var router=express[_0x14c6('0x4')]();var fs_extra=require(_0x14c6('0x5'));var auth=require(_0x14c6('0x6'));var interaction=require(_0x14c6('0x7'));var config=require('../../config/environment');var controller=require(_0x14c6('0x8'));router[_0x14c6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x14c6('0xa'),auth[_0x14c6('0xb')](),controller[_0x14c6('0xc')]);router[_0x14c6('0x9')](_0x14c6('0xd'),auth[_0x14c6('0xb')](),controller['show']);router[_0x14c6('0xe')]('/',auth[_0x14c6('0xb')](),controller[_0x14c6('0xf')]);router[_0x14c6('0x10')]('/:id',auth[_0x14c6('0xb')](),controller[_0x14c6('0x11')]);router[_0x14c6('0x12')](_0x14c6('0xd'),auth['isAuthenticated'](),controller[_0x14c6('0x13')]);module[_0x14c6('0x14')]=router; \ No newline at end of file +var _0xfd50=['post','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5120be,_0x57e8de){var _0xd044c6=function(_0x2553e8){while(--_0x2553e8){_0x5120be['push'](_0x5120be['shift']());}};_0xd044c6(++_0x57e8de);}(_0xfd50,0x82));var _0x0fd5=function(_0x2a7b8e,_0x50ffce){_0x2a7b8e=_0x2a7b8e-0x0;var _0x29b5c8=_0xfd50[_0x2a7b8e];return _0x29b5c8;};'use strict';var multer=require(_0x0fd5('0x0'));var util=require(_0x0fd5('0x1'));var path=require(_0x0fd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0fd5('0x3'));var router=express[_0x0fd5('0x4')]();var fs_extra=require(_0x0fd5('0x5'));var auth=require(_0x0fd5('0x6'));var interaction=require(_0x0fd5('0x7'));var config=require(_0x0fd5('0x8'));var controller=require(_0x0fd5('0x9'));router[_0x0fd5('0xa')]('/',auth[_0x0fd5('0xb')](),controller[_0x0fd5('0xc')]);router[_0x0fd5('0xa')](_0x0fd5('0xd'),auth[_0x0fd5('0xb')](),controller[_0x0fd5('0xe')]);router['get'](_0x0fd5('0xf'),auth[_0x0fd5('0xb')](),controller[_0x0fd5('0x10')]);router[_0x0fd5('0x11')]('/',auth[_0x0fd5('0xb')](),controller['create']);router['put'](_0x0fd5('0xf'),auth[_0x0fd5('0xb')](),controller[_0x0fd5('0x12')]);router[_0x0fd5('0x13')]('/:id',auth[_0x0fd5('0xb')](),controller[_0x0fd5('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 72736cb..75f8723 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 _0x3276=['DATE','sequelize','ENUM','account','agent','queue'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x3276,0xc7));var _0x6327=function(_0x32939a,_0x5cfe95){_0x32939a=_0x32939a-0x0;var _0x28ab33=_0x3276[_0x32939a];return _0x28ab33;};'use strict';var Sequelize=require(_0x6327('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6327('0x1')](_0x6327('0x2'),_0x6327('0x3'),_0x6327('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x6327('0x5')]}}; \ No newline at end of file +var _0x8b35=['sequelize','exports','STRING','ENUM','account','queue','DATE'];(function(_0x17a8b0,_0x20ac87){var _0x589069=function(_0x5d4f00){while(--_0x5d4f00){_0x17a8b0['push'](_0x17a8b0['shift']());}};_0x589069(++_0x20ac87);}(_0x8b35,0x17a));var _0x58b3=function(_0x12214f,_0x39d48c){_0x12214f=_0x12214f-0x0;var _0x2f2fa3=_0x8b35[_0x12214f];return _0x2f2fa3;};'use strict';var Sequelize=require(_0x58b3('0x0'));module[_0x58b3('0x1')]={'uniqueid':{'type':Sequelize[_0x58b3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x58b3('0x3')](_0x58b3('0x4'),'agent',_0x58b3('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x58b3('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index d40b302..1bedb8a 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 _0x4aab=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','params','length','options','catch','create','body','find','destroy','describe','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4aab,0xcd));var _0xb4aa=function(_0x26a2d0,_0x3c9e53){_0x26a2d0=_0x26a2d0-0x0;var _0x7b71a0=_0x4aab[_0x26a2d0];return _0x7b71a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb4aa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb4aa('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb4aa('0x2'));var Mustache=require(_0xb4aa('0x3'));var util=require(_0xb4aa('0x4'));var path=require('path');var sox=require(_0xb4aa('0x5'));var csv=require(_0xb4aa('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4aa('0x7'));var _=require(_0xb4aa('0x8'));var squel=require('squel');var crypto=require(_0xb4aa('0x9'));var jsforce=require(_0xb4aa('0xa'));var deskjs=require(_0xb4aa('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb4aa('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb4aa('0xd'));var as=require(_0xb4aa('0xe'));var hardwareService=require(_0xb4aa('0xf'));var logger=require(_0xb4aa('0x10'))('api');var utils=require(_0xb4aa('0x11'));var config=require(_0xb4aa('0x12'));var licenseUtil=require(_0xb4aa('0x13'));var db=require(_0xb4aa('0x14'))['db'];function respondWithStatusCode(_0x5f4c18,_0xf9998b){_0xf9998b=_0xf9998b||0xcc;return function(_0x751117){if(_0x751117){return _0x5f4c18[_0xb4aa('0x15')](_0xf9998b);}return _0x5f4c18[_0xb4aa('0x16')](_0xf9998b)[_0xb4aa('0x17')]();};}function respondWithResult(_0x2bf318,_0x145b37){_0x145b37=_0x145b37||0xc8;return function(_0x2977ec){if(_0x2977ec){return _0x2bf318[_0xb4aa('0x16')](_0x145b37)[_0xb4aa('0x18')](_0x2977ec);}};}function respondWithFilteredResult(_0x518dd0,_0x322c48){return function(_0xa85895){if(_0xa85895){var _0x3d11be=typeof _0x322c48[_0xb4aa('0x19')]===_0xb4aa('0x1a')&&typeof _0x322c48[_0xb4aa('0x1b')]===_0xb4aa('0x1a');var _0x1ce735=_0xa85895[_0xb4aa('0x1c')];var _0x5a0aac=_0x3d11be?0x0:_0x322c48[_0xb4aa('0x19')];var _0x72ef32=_0x3d11be?_0xa85895[_0xb4aa('0x1c')]:_0x322c48[_0xb4aa('0x19')]+_0x322c48['limit'];var _0x21e881;if(_0x72ef32>=_0x1ce735){_0x72ef32=_0x1ce735;_0x21e881=0xc8;}else{_0x21e881=0xce;}_0x518dd0[_0xb4aa('0x16')](_0x21e881);return _0x518dd0[_0xb4aa('0x1d')](_0xb4aa('0x1e'),_0x5a0aac+'-'+_0x72ef32+'/'+_0x1ce735)[_0xb4aa('0x18')](_0xa85895);}return null;};}function patchUpdates(_0x510dc6){return function(_0x175d46){try{jsonpatch[_0xb4aa('0x1f')](_0x175d46,_0x510dc6,!![]);}catch(_0x1e5e80){return BPromise[_0xb4aa('0x20')](_0x1e5e80);}return _0x175d46[_0xb4aa('0x21')]();};}function saveUpdates(_0x4f2415,_0x185ad5){return function(_0x4274ba){if(_0x4274ba){return _0x4274ba[_0xb4aa('0x22')](_0x4f2415)[_0xb4aa('0x23')](function(_0x2407d5){return _0x2407d5;});}return null;};}function removeEntity(_0xabb9b4,_0xbef346){return function(_0x4c63c2){if(_0x4c63c2){return _0x4c63c2['destroy']()['then'](function(){_0xabb9b4[_0xb4aa('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1320f6,_0x927fef){return function(_0x591fde){if(!_0x591fde){_0x1320f6[_0xb4aa('0x15')](0x194);}return _0x591fde;};}function handleError(_0x1ca55a,_0x1eed4d){_0x1eed4d=_0x1eed4d||0x1f4;return function(_0x3cf2ee){logger[_0xb4aa('0x24')](_0x3cf2ee['stack']);if(_0x3cf2ee[_0xb4aa('0x25')]){delete _0x3cf2ee[_0xb4aa('0x25')];}_0x1ca55a[_0xb4aa('0x16')](_0x1eed4d)[_0xb4aa('0x26')](_0x3cf2ee);};}exports[_0xb4aa('0x27')]=function(_0x2feed8,_0x47349e){var _0x580893={},_0x6c6fdf={},_0x1d5bfd={'count':0x0,'rows':[]};var _0x44db57=_[_0xb4aa('0x28')](db[_0xb4aa('0x29')][_0xb4aa('0x2a')],function(_0x314233){return{'name':_0x314233[_0xb4aa('0x2b')],'type':_0x314233[_0xb4aa('0x2c')][_0xb4aa('0x2d')]};});_0x6c6fdf['model']=_[_0xb4aa('0x28')](_0x44db57,_0xb4aa('0x25'));_0x6c6fdf[_0xb4aa('0x2e')]=_[_0xb4aa('0x2f')](_0x2feed8[_0xb4aa('0x2e')]);_0x6c6fdf[_0xb4aa('0x30')]=_[_0xb4aa('0x31')](_0x6c6fdf['model'],_0x6c6fdf[_0xb4aa('0x2e')]);_0x580893[_0xb4aa('0x32')]=_[_0xb4aa('0x31')](_0x6c6fdf[_0xb4aa('0x33')],qs[_0xb4aa('0x34')](_0x2feed8[_0xb4aa('0x2e')][_0xb4aa('0x34')]));_0x580893[_0xb4aa('0x32')]=_0x580893[_0xb4aa('0x32')]['length']?_0x580893[_0xb4aa('0x32')]:_0x6c6fdf[_0xb4aa('0x33')];if(!_0x2feed8[_0xb4aa('0x2e')][_0xb4aa('0x35')](_0xb4aa('0x36'))){_0x580893[_0xb4aa('0x1b')]=qs['limit'](_0x2feed8[_0xb4aa('0x2e')]['limit']);_0x580893[_0xb4aa('0x19')]=qs['offset'](_0x2feed8[_0xb4aa('0x2e')]['offset']);}_0x580893[_0xb4aa('0x37')]=qs[_0xb4aa('0x38')](_0x2feed8[_0xb4aa('0x2e')]['sort']);_0x580893[_0xb4aa('0x39')]=qs['filters'](_[_0xb4aa('0x3a')](_0x2feed8[_0xb4aa('0x2e')],_0x6c6fdf['filters']),_0x44db57);if(_0x2feed8[_0xb4aa('0x2e')]['filter']){_0x580893[_0xb4aa('0x39')]=_[_0xb4aa('0x3b')](_0x580893[_0xb4aa('0x39')],{'$or':_[_0xb4aa('0x28')](_0x44db57,function(_0x33479c){if(_0x33479c['type']!==_0xb4aa('0x3c')){var _0x539510={};_0x539510[_0x33479c[_0xb4aa('0x25')]]={'$like':'%'+_0x2feed8[_0xb4aa('0x2e')]['filter']+'%'};return _0x539510;}})});}_0x580893=_[_0xb4aa('0x3b')]({},_0x580893,_0x2feed8['options']);var _0x2ae207={'where':_0x580893[_0xb4aa('0x39')]};return db['WhatsappTransferReport']['count'](_0x2ae207)['then'](function(_0x372acd){_0x1d5bfd[_0xb4aa('0x1c')]=_0x372acd;if(_0x2feed8[_0xb4aa('0x2e')][_0xb4aa('0x3d')]){_0x580893[_0xb4aa('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xb4aa('0x3f')](_0x580893);})['then'](function(_0x363cd2){_0x1d5bfd['rows']=_0x363cd2;return _0x1d5bfd;})[_0xb4aa('0x23')](respondWithFilteredResult(_0x47349e,_0x580893))['catch'](handleError(_0x47349e,null));};exports['show']=function(_0x424ab8,_0x50ecb1){var _0x82319d={'raw':!![],'where':{'id':_0x424ab8[_0xb4aa('0x40')]['id']}},_0x5bffec={};_0x5bffec[_0xb4aa('0x33')]=_[_0xb4aa('0x2f')](db[_0xb4aa('0x29')]['rawAttributes']);_0x5bffec[_0xb4aa('0x2e')]=_[_0xb4aa('0x2f')](_0x424ab8[_0xb4aa('0x2e')]);_0x5bffec[_0xb4aa('0x30')]=_[_0xb4aa('0x31')](_0x5bffec['model'],_0x5bffec[_0xb4aa('0x2e')]);_0x82319d[_0xb4aa('0x32')]=_[_0xb4aa('0x31')](_0x5bffec['model'],qs[_0xb4aa('0x34')](_0x424ab8[_0xb4aa('0x2e')][_0xb4aa('0x34')]));_0x82319d[_0xb4aa('0x32')]=_0x82319d[_0xb4aa('0x32')][_0xb4aa('0x41')]?_0x82319d[_0xb4aa('0x32')]:_0x5bffec['model'];if(_0x424ab8[_0xb4aa('0x2e')][_0xb4aa('0x3d')]){_0x82319d['include']=[{'all':!![]}];}_0x82319d=_[_0xb4aa('0x3b')]({},_0x82319d,_0x424ab8[_0xb4aa('0x42')]);return db[_0xb4aa('0x29')]['find'](_0x82319d)[_0xb4aa('0x23')](handleEntityNotFound(_0x50ecb1,null))['then'](respondWithResult(_0x50ecb1,null))[_0xb4aa('0x43')](handleError(_0x50ecb1,null));};exports[_0xb4aa('0x44')]=function(_0x183530,_0x5238ec){return db['WhatsappTransferReport'][_0xb4aa('0x44')](_0x183530[_0xb4aa('0x45')],{})[_0xb4aa('0x23')](respondWithResult(_0x5238ec,0xc9))[_0xb4aa('0x43')](handleError(_0x5238ec,null));};exports[_0xb4aa('0x22')]=function(_0x4ff093,_0x1209e2){if(_0x4ff093[_0xb4aa('0x45')]['id']){delete _0x4ff093[_0xb4aa('0x45')]['id'];}return db[_0xb4aa('0x29')][_0xb4aa('0x46')]({'where':{'id':_0x4ff093[_0xb4aa('0x40')]['id']}})['then'](handleEntityNotFound(_0x1209e2,null))['then'](saveUpdates(_0x4ff093['body'],null))['then'](respondWithResult(_0x1209e2,null))[_0xb4aa('0x43')](handleError(_0x1209e2,null));};exports[_0xb4aa('0x47')]=function(_0x25099b,_0x39e633){return db['WhatsappTransferReport'][_0xb4aa('0x46')]({'where':{'id':_0x25099b[_0xb4aa('0x40')]['id']}})[_0xb4aa('0x23')](handleEntityNotFound(_0x39e633,null))[_0xb4aa('0x23')](removeEntity(_0x39e633,null))[_0xb4aa('0x43')](handleError(_0x39e633,null));};exports[_0xb4aa('0x48')]=function(_0x242140,_0x16355f){return db[_0xb4aa('0x29')][_0xb4aa('0x48')]()[_0xb4aa('0x23')](respondWithResult(_0x16355f,null))[_0xb4aa('0x43')](handleError(_0x16355f,null));}; \ No newline at end of file +var _0x8101=['error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x8101,0xc0));var _0x1810=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x8101[_0x149a9b];return _0x2c2bf6;};'use strict';var emlformat=require(_0x1810('0x0'));var rimraf=require(_0x1810('0x1'));var zipdir=require(_0x1810('0x2'));var jsonpatch=require(_0x1810('0x3'));var rp=require(_0x1810('0x4'));var moment=require(_0x1810('0x5'));var BPromise=require(_0x1810('0x6'));var Mustache=require(_0x1810('0x7'));var util=require(_0x1810('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x1810('0x9'));var ejs=require(_0x1810('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1810('0xb'));var squel=require(_0x1810('0xc'));var crypto=require(_0x1810('0xd'));var jsforce=require(_0x1810('0xe'));var deskjs=require(_0x1810('0xf'));var toCsv=require(_0x1810('0x9'));var querystring=require(_0x1810('0x10'));var Papa=require(_0x1810('0x11'));var Redis=require(_0x1810('0x12'));var authService=require(_0x1810('0x13'));var qs=require(_0x1810('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1810('0x15'));var logger=require(_0x1810('0x16'))('api');var utils=require(_0x1810('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1810('0x18'))['db'];function respondWithStatusCode(_0x40e2cf,_0x2f24d7){_0x2f24d7=_0x2f24d7||0xcc;return function(_0x2e6d8f){if(_0x2e6d8f){return _0x40e2cf[_0x1810('0x19')](_0x2f24d7);}return _0x40e2cf[_0x1810('0x1a')](_0x2f24d7)['end']();};}function respondWithResult(_0xee7c55,_0x21157b){_0x21157b=_0x21157b||0xc8;return function(_0x507d0d){if(_0x507d0d){return _0xee7c55['status'](_0x21157b)[_0x1810('0x1b')](_0x507d0d);}};}function respondWithFilteredResult(_0x49d637,_0x187dca){return function(_0xbdebf5){if(_0xbdebf5){var _0x282e1c=typeof _0x187dca[_0x1810('0x1c')]===_0x1810('0x1d')&&typeof _0x187dca[_0x1810('0x1e')]===_0x1810('0x1d');var _0x58cf24=_0xbdebf5['count'];var _0x4a458d=_0x282e1c?0x0:_0x187dca[_0x1810('0x1c')];var _0x50ac76=_0x282e1c?_0xbdebf5[_0x1810('0x1f')]:_0x187dca[_0x1810('0x1c')]+_0x187dca[_0x1810('0x1e')];var _0x27c51b;if(_0x50ac76>=_0x58cf24){_0x50ac76=_0x58cf24;_0x27c51b=0xc8;}else{_0x27c51b=0xce;}_0x49d637['status'](_0x27c51b);return _0x49d637[_0x1810('0x20')]('Content-Range',_0x4a458d+'-'+_0x50ac76+'/'+_0x58cf24)[_0x1810('0x1b')](_0xbdebf5);}return null;};}function patchUpdates(_0x116ea0){return function(_0x4fd3e3){try{jsonpatch[_0x1810('0x21')](_0x4fd3e3,_0x116ea0,!![]);}catch(_0x42672f){return BPromise[_0x1810('0x22')](_0x42672f);}return _0x4fd3e3[_0x1810('0x23')]();};}function saveUpdates(_0xe66600,_0x907ad5){return function(_0x5c49bc){if(_0x5c49bc){return _0x5c49bc[_0x1810('0x24')](_0xe66600)[_0x1810('0x25')](function(_0x254062){return _0x254062;});}return null;};}function removeEntity(_0x77b5ed,_0x53ca63){return function(_0x1f37c3){if(_0x1f37c3){return _0x1f37c3['destroy']()['then'](function(){_0x77b5ed[_0x1810('0x1a')](0xcc)[_0x1810('0x26')]();});}};}function handleEntityNotFound(_0x1b7d46,_0x23704c){return function(_0x2b6da6){if(!_0x2b6da6){_0x1b7d46['sendStatus'](0x194);}return _0x2b6da6;};}function handleError(_0x2d4b7c,_0x264c94){_0x264c94=_0x264c94||0x1f4;return function(_0x986db3){logger[_0x1810('0x27')](_0x986db3['stack']);if(_0x986db3['name']){delete _0x986db3[_0x1810('0x28')];}_0x2d4b7c[_0x1810('0x1a')](_0x264c94)[_0x1810('0x29')](_0x986db3);};}exports[_0x1810('0x2a')]=function(_0x2d387a,_0xbac7da){var _0x3b7e73={},_0x3e122b={},_0xfbc80c={'count':0x0,'rows':[]};var _0x33c51a=_[_0x1810('0x2b')](db[_0x1810('0x2c')][_0x1810('0x2d')],function(_0x53aeac){return{'name':_0x53aeac[_0x1810('0x2e')],'type':_0x53aeac[_0x1810('0x2f')][_0x1810('0x30')]};});_0x3e122b[_0x1810('0x31')]=_[_0x1810('0x2b')](_0x33c51a,_0x1810('0x28'));_0x3e122b['query']=_[_0x1810('0x32')](_0x2d387a[_0x1810('0x33')]);_0x3e122b[_0x1810('0x34')]=_[_0x1810('0x35')](_0x3e122b[_0x1810('0x31')],_0x3e122b['query']);_0x3b7e73[_0x1810('0x36')]=_[_0x1810('0x35')](_0x3e122b[_0x1810('0x31')],qs['fields'](_0x2d387a[_0x1810('0x33')][_0x1810('0x37')]));_0x3b7e73[_0x1810('0x36')]=_0x3b7e73[_0x1810('0x36')][_0x1810('0x38')]?_0x3b7e73[_0x1810('0x36')]:_0x3e122b[_0x1810('0x31')];if(!_0x2d387a[_0x1810('0x33')][_0x1810('0x39')](_0x1810('0x3a'))){_0x3b7e73[_0x1810('0x1e')]=qs[_0x1810('0x1e')](_0x2d387a[_0x1810('0x33')][_0x1810('0x1e')]);_0x3b7e73[_0x1810('0x1c')]=qs['offset'](_0x2d387a[_0x1810('0x33')]['offset']);}_0x3b7e73['order']=qs[_0x1810('0x3b')](_0x2d387a[_0x1810('0x33')]['sort']);_0x3b7e73[_0x1810('0x3c')]=qs[_0x1810('0x34')](_[_0x1810('0x3d')](_0x2d387a[_0x1810('0x33')],_0x3e122b[_0x1810('0x34')]),_0x33c51a);if(_0x2d387a[_0x1810('0x33')][_0x1810('0x3e')]){_0x3b7e73['where']=_[_0x1810('0x3f')](_0x3b7e73[_0x1810('0x3c')],{'$or':_['map'](_0x33c51a,function(_0x560419){if(_0x560419[_0x1810('0x2f')]!=='VIRTUAL'){var _0x24e174={};_0x24e174[_0x560419[_0x1810('0x28')]]={'$like':'%'+_0x2d387a[_0x1810('0x33')][_0x1810('0x3e')]+'%'};return _0x24e174;}})});}_0x3b7e73=_[_0x1810('0x3f')]({},_0x3b7e73,_0x2d387a[_0x1810('0x40')]);var _0x457ef9={'where':_0x3b7e73[_0x1810('0x3c')]};return db[_0x1810('0x2c')]['count'](_0x457ef9)[_0x1810('0x25')](function(_0x5be047){_0xfbc80c[_0x1810('0x1f')]=_0x5be047;if(_0x2d387a[_0x1810('0x33')][_0x1810('0x41')]){_0x3b7e73[_0x1810('0x42')]=[{'all':!![]}];}return db[_0x1810('0x2c')][_0x1810('0x43')](_0x3b7e73);})[_0x1810('0x25')](function(_0x2cd6b0){_0xfbc80c[_0x1810('0x44')]=_0x2cd6b0;return _0xfbc80c;})[_0x1810('0x25')](respondWithFilteredResult(_0xbac7da,_0x3b7e73))['catch'](handleError(_0xbac7da,null));};exports[_0x1810('0x45')]=function(_0x1ab18d,_0x276b89){var _0x5b9b6f={'raw':!![],'where':{'id':_0x1ab18d[_0x1810('0x46')]['id']}},_0x368a37={};_0x368a37[_0x1810('0x31')]=_[_0x1810('0x32')](db[_0x1810('0x2c')][_0x1810('0x2d')]);_0x368a37['query']=_[_0x1810('0x32')](_0x1ab18d[_0x1810('0x33')]);_0x368a37[_0x1810('0x34')]=_[_0x1810('0x35')](_0x368a37[_0x1810('0x31')],_0x368a37['query']);_0x5b9b6f[_0x1810('0x36')]=_[_0x1810('0x35')](_0x368a37[_0x1810('0x31')],qs[_0x1810('0x37')](_0x1ab18d[_0x1810('0x33')][_0x1810('0x37')]));_0x5b9b6f[_0x1810('0x36')]=_0x5b9b6f[_0x1810('0x36')][_0x1810('0x38')]?_0x5b9b6f[_0x1810('0x36')]:_0x368a37[_0x1810('0x31')];if(_0x1ab18d['query'][_0x1810('0x41')]){_0x5b9b6f['include']=[{'all':!![]}];}_0x5b9b6f=_[_0x1810('0x3f')]({},_0x5b9b6f,_0x1ab18d['options']);return db[_0x1810('0x2c')][_0x1810('0x47')](_0x5b9b6f)[_0x1810('0x25')](handleEntityNotFound(_0x276b89,null))[_0x1810('0x25')](respondWithResult(_0x276b89,null))[_0x1810('0x48')](handleError(_0x276b89,null));};exports[_0x1810('0x49')]=function(_0x40b011,_0xd1854d){return db[_0x1810('0x2c')][_0x1810('0x49')](_0x40b011[_0x1810('0x4a')],{})[_0x1810('0x25')](respondWithResult(_0xd1854d,0xc9))['catch'](handleError(_0xd1854d,null));};exports['update']=function(_0xd2d5a2,_0x4a3104){if(_0xd2d5a2[_0x1810('0x4a')]['id']){delete _0xd2d5a2[_0x1810('0x4a')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0xd2d5a2[_0x1810('0x46')]['id']}})[_0x1810('0x25')](handleEntityNotFound(_0x4a3104,null))[_0x1810('0x25')](saveUpdates(_0xd2d5a2[_0x1810('0x4a')],null))[_0x1810('0x25')](respondWithResult(_0x4a3104,null))['catch'](handleError(_0x4a3104,null));};exports[_0x1810('0x4b')]=function(_0x3cb026,_0x23e76e){return db[_0x1810('0x2c')][_0x1810('0x47')]({'where':{'id':_0x3cb026[_0x1810('0x46')]['id']}})[_0x1810('0x25')](handleEntityNotFound(_0x23e76e,null))[_0x1810('0x25')](removeEntity(_0x23e76e,null))[_0x1810('0x48')](handleError(_0x23e76e,null));};exports[_0x1810('0x4c')]=function(_0x3e7915,_0x4cc0e6){return db[_0x1810('0x2c')][_0x1810('0x4c')]()[_0x1810('0x25')](respondWithResult(_0x4cc0e6,null))[_0x1810('0x48')](handleError(_0x4cc0e6,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index cc4040d..ec255b4 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 _0x24de=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x24de,0xa8));var _0xe24d=function(_0x107fe9,_0x13b029){_0x107fe9=_0x107fe9-0x0;var _0x1bcaa9=_0x24de[_0x107fe9];return _0x1bcaa9;};'use strict';var _=require(_0xe24d('0x0'));var util=require(_0xe24d('0x1'));var logger=require(_0xe24d('0x2'))(_0xe24d('0x3'));var moment=require(_0xe24d('0x4'));var BPromise=require(_0xe24d('0x5'));var rp=require(_0xe24d('0x6'));var fs=require('fs');var path=require(_0xe24d('0x7'));var rimraf=require(_0xe24d('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0xe24d('0x9')]=function(_0x4f937d,_0x5efafa){return _0x4f937d['define'](_0xe24d('0xa'),attributes,{'tableName':_0xe24d('0xb'),'paranoid':![],'indexes':[{'name':_0xe24d('0xc'),'fields':[_0xe24d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfebc=['moment','request-promise','path','./whatsappTransferReport.attributes','exports','define','uniqueid','util','../../config/logger','api'];(function(_0x20005f,_0x3992de){var _0x182ec0=function(_0x174d68){while(--_0x174d68){_0x20005f['push'](_0x20005f['shift']());}};_0x182ec0(++_0x3992de);}(_0xfebc,0xf7));var _0xcfeb=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0xfebc[_0x2341c6];return _0x54c34d;};'use strict';var _=require('lodash');var util=require(_0xcfeb('0x0'));var logger=require(_0xcfeb('0x1'))(_0xcfeb('0x2'));var moment=require(_0xcfeb('0x3'));var BPromise=require('bluebird');var rp=require(_0xcfeb('0x4'));var fs=require('fs');var path=require(_0xcfeb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcfeb('0x6'));module[_0xcfeb('0x7')]=function(_0x531a00,_0x571269){return _0x531a00[_0xcfeb('0x8')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xcfeb('0x9'),'fields':[_0xcfeb('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 1cf1828..7181a75 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 _0x0d0e=['catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappTransferReport,\x20%s,\x20%s','result'];(function(_0x22266d,_0x504bcf){var _0x208d55=function(_0x34a70f){while(--_0x34a70f){_0x22266d['push'](_0x22266d['shift']());}};_0x208d55(++_0x504bcf);}(_0x0d0e,0x17b));var _0xe0d0=function(_0x43e401,_0x18e39d){_0x43e401=_0x43e401-0x0;var _0x2390d4=_0x0d0e[_0x43e401];return _0x2390d4;};'use strict';var _=require(_0xe0d0('0x0'));var util=require('util');var moment=require(_0xe0d0('0x1'));var BPromise=require(_0xe0d0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0d0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0d0('0x4'))(_0xe0d0('0x5'));var config=require('../../config/environment');var jayson=require(_0xe0d0('0x6'));var client=jayson[_0xe0d0('0x7')][_0xe0d0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5bb248,_0x4863bb,_0xcf55f4){return new BPromise(function(_0x1019d5,_0x4d35d2){return client[_0xe0d0('0x9')](_0x5bb248,_0xcf55f4)[_0xe0d0('0xa')](function(_0x439bac){logger[_0xe0d0('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4863bb,_0xe0d0('0xc'));logger[_0xe0d0('0xd')](_0xe0d0('0xe'),_0x4863bb,_0xe0d0('0xc'),JSON[_0xe0d0('0xf')](_0x439bac));if(_0x439bac[_0xe0d0('0x10')]){if(_0x439bac['error']['code']===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x4863bb,_0x439bac[_0xe0d0('0x10')]['message']);return _0x4d35d2(_0x439bac['error'][_0xe0d0('0x11')]);}logger[_0xe0d0('0x10')](_0xe0d0('0x12'),_0x4863bb,_0x439bac['error'][_0xe0d0('0x11')]);return _0x1019d5(_0x439bac['error'][_0xe0d0('0x11')]);}else{logger[_0xe0d0('0xb')](_0xe0d0('0x12'),_0x4863bb,_0xe0d0('0xc'));_0x1019d5(_0x439bac[_0xe0d0('0x13')][_0xe0d0('0x11')]);}})[_0xe0d0('0x14')](function(_0x20a888){logger['error'](_0xe0d0('0x12'),_0x4863bb,_0x20a888);_0x4d35d2(_0x20a888);});});} \ No newline at end of file +var _0x6e7a=['../../config/environment','jayson/promise','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0x6e7a,0xe9));var _0xa6e7=function(_0x546ca4,_0x2f0016){_0x546ca4=_0x546ca4-0x0;var _0x47e1bd=_0x6e7a[_0x546ca4];return _0x47e1bd;};'use strict';var _=require(_0xa6e7('0x0'));var util=require(_0xa6e7('0x1'));var moment=require(_0xa6e7('0x2'));var BPromise=require(_0xa6e7('0x3'));var rs=require(_0xa6e7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6e7('0x5'))['db'];var utils=require(_0xa6e7('0x6'));var logger=require(_0xa6e7('0x7'))(_0xa6e7('0x8'));var config=require(_0xa6e7('0x9'));var jayson=require(_0xa6e7('0xa'));var client=jayson[_0xa6e7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x279095,_0x1584f1,_0x4e1467){return new BPromise(function(_0x4f85a9,_0x2b4305){return client[_0xa6e7('0xc')](_0x279095,_0x4e1467)[_0xa6e7('0xd')](function(_0xaae2b1){logger[_0xa6e7('0xe')](_0xa6e7('0xf'),_0x1584f1,_0xa6e7('0x10'));logger['debug'](_0xa6e7('0x11'),_0x1584f1,_0xa6e7('0x10'),JSON['stringify'](_0xaae2b1));if(_0xaae2b1[_0xa6e7('0x12')]){if(_0xaae2b1[_0xa6e7('0x12')]['code']===0x1f4){logger[_0xa6e7('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1584f1,_0xaae2b1['error']['message']);return _0x2b4305(_0xaae2b1[_0xa6e7('0x12')][_0xa6e7('0x13')]);}logger[_0xa6e7('0x12')](_0xa6e7('0xf'),_0x1584f1,_0xaae2b1[_0xa6e7('0x12')][_0xa6e7('0x13')]);return _0x4f85a9(_0xaae2b1[_0xa6e7('0x12')]['message']);}else{logger[_0xa6e7('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1584f1,_0xa6e7('0x10'));_0x4f85a9(_0xaae2b1[_0xa6e7('0x14')]['message']);}})[_0xa6e7('0x15')](function(_0x486cd5){logger[_0xa6e7('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1584f1,_0x486cd5);_0x2b4305(_0x486cd5);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 97cae80..386ae0b 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe75a=['filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','map','online','join','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','then','default','start','info'];(function(_0xe32d2c,_0xeccc40){var _0x4e5245=function(_0x1d73d2){while(--_0x1d73d2){_0xe32d2c['push'](_0xe32d2c['shift']());}};_0x4e5245(++_0xeccc40);}(_0xe75a,0x1de));var _0xae75=function(_0x4ce1b9,_0x397a4b){_0x4ce1b9=_0x4ce1b9-0x0;var _0x2bb15d=_0xe75a[_0x4ce1b9];return _0x2bb15d;};'use strict';var _=require(_0xae75('0x0'));var db=require(_0xae75('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xae75('0x2'));var rpc=require(_0xae75('0x3'));var config=require(_0xae75('0x4'));var logger=require(_0xae75('0x5'))(_0xae75('0x6'));var pm2=require(_0xae75('0x7'));var pm2Config=require(_0xae75('0x8'));var schedule=require(_0xae75('0x9'));var chat=require(_0xae75('0xa'));var whatsapp=require(_0xae75('0xb'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0xae75('0xc'));function main(){return db['sequelize']['sync']()[_0xae75('0xd')](function(){if(config['seedDB']){return seedDb['default']();}})['then'](function(){return checkLicense[_0xae75('0xe')]();})['then'](function(){return rpc['listen']();})[_0xae75('0xd')](function(_0x3f6ae2){logger['info'](_0x3f6ae2);return chat[_0xae75('0xf')]();})[_0xae75('0xd')](function(){return whatsapp['start']();})[_0xae75('0xd')](function(){return schedule[_0xae75('0xf')]();})[_0xae75('0xd')](function(){return transcribe['start']();})[_0xae75('0xd')](function(){return provider[_0xae75('0xf')]();})[_0xae75('0xd')](function(_0x105487){logger[_0xae75('0x10')](_0x105487);return pm2[_0xae75('0xf')](pm2Config);})[_0xae75('0xd')](function(_0x99fdc8){var _0xa268ec=_0x99fdc8[_0xae75('0x11')](function(_0x5dcc10){return typeof _0x5dcc10[_0xae75('0x12')]===_0xae75('0x13')&&_0x5dcc10[_0xae75('0x12')]>=0x0;});if(_0xa268ec[_0xae75('0x14')]>0x0){throw new Error(_0xa268ec[_0xae75('0x14')]+_0xae75('0x15')+_['map'](_0xa268ec,function(_0x52f683){return'\x22'+_0x52f683[_0xae75('0x16')][_0xae75('0x17')]+'\x22';}));}logger[_0xae75('0x10')]('Online\x20apps:',_[_0xae75('0x18')](_[_0xae75('0x11')](_0x99fdc8,{'status':_0xae75('0x19')}),_0xae75('0x17'))[_0xae75('0x1a')]());logger[_0xae75('0x10')]('Offline\x20apps:',_[_0xae75('0x18')](_[_0xae75('0x11')](_0x99fdc8,function(_0x3c82bc){return _0x3c82bc[_0xae75('0x1b')]!==_0xae75('0x19');}),_0xae75('0x17'))[_0xae75('0x1a')]()||_0xae75('0x1c'));console[_0xae75('0x1d')]('App\x20Ready!');})[_0xae75('0x1e')](function(_0x24e207){console[_0xae75('0x1d')](_0xae75('0x1f'),_0x24e207);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x24e207);process[_0xae75('0x20')](0x1);});}main(); \ No newline at end of file +var _0x5a93=['length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','filter','online','join','Offline\x20apps:','status','name','None','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/license','./rpc','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','exitCode','number'];(function(_0x5928fb,_0x283806){var _0x4d2415=function(_0x4a5af9){while(--_0x4a5af9){_0x5928fb['push'](_0x5928fb['shift']());}};_0x4d2415(++_0x283806);}(_0x5a93,0xf6));var _0x35a9=function(_0x19b72c,_0x122a4f){_0x19b72c=_0x19b72c-0x0;var _0x3b3ea0=_0x5a93[_0x19b72c];return _0x3b3ea0;};'use strict';var _=require('lodash');var db=require(_0x35a9('0x0'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x35a9('0x1'));var rpc=require(_0x35a9('0x2'));var config=require('./config/environment');var logger=require('./config/logger')(_0x35a9('0x3'));var pm2=require(_0x35a9('0x4'));var pm2Config=require(_0x35a9('0x5'));var schedule=require('./config/schedule');var chat=require(_0x35a9('0x6'));var whatsapp=require(_0x35a9('0x7'));var transcribe=require(_0x35a9('0x8'));var provider=require(_0x35a9('0x9'));function main(){return db[_0x35a9('0xa')][_0x35a9('0xb')]()[_0x35a9('0xc')](function(){if(config[_0x35a9('0xd')]){return seedDb[_0x35a9('0xe')]();}})[_0x35a9('0xc')](function(){return checkLicense[_0x35a9('0xe')]();})[_0x35a9('0xc')](function(){return rpc[_0x35a9('0xf')]();})[_0x35a9('0xc')](function(_0xeca85e){logger[_0x35a9('0x10')](_0xeca85e);return chat[_0x35a9('0x11')]();})['then'](function(){return whatsapp[_0x35a9('0x11')]();})[_0x35a9('0xc')](function(){return schedule[_0x35a9('0x11')]();})[_0x35a9('0xc')](function(){return transcribe['start']();})[_0x35a9('0xc')](function(){return provider[_0x35a9('0x11')]();})[_0x35a9('0xc')](function(_0x13e025){logger['info'](_0x13e025);return pm2[_0x35a9('0x11')](pm2Config);})[_0x35a9('0xc')](function(_0x76f27c){var _0x2d27f6=_0x76f27c['filter'](function(_0xb4c847){return typeof _0xb4c847[_0x35a9('0x12')]===_0x35a9('0x13')&&_0xb4c847['exitCode']>=0x0;});if(_0x2d27f6[_0x35a9('0x14')]>0x0){throw new Error(_0x2d27f6[_0x35a9('0x14')]+_0x35a9('0x15')+_[_0x35a9('0x16')](_0x2d27f6,function(_0x2a4786){return'\x22'+_0x2a4786[_0x35a9('0x17')]['name']+'\x22';}));}logger[_0x35a9('0x10')](_0x35a9('0x18'),_[_0x35a9('0x16')](_[_0x35a9('0x19')](_0x76f27c,{'status':_0x35a9('0x1a')}),'name')[_0x35a9('0x1b')]());logger['info'](_0x35a9('0x1c'),_[_0x35a9('0x16')](_[_0x35a9('0x19')](_0x76f27c,function(_0x2905a2){return _0x2905a2[_0x35a9('0x1d')]!==_0x35a9('0x1a');}),_0x35a9('0x1e'))[_0x35a9('0x1b')]()||_0x35a9('0x1f'));console['log'](_0x35a9('0x20'));})[_0x35a9('0x21')](function(_0x493294){console['log'](_0x35a9('0x22'),_0x493294);logger[_0x35a9('0x23')](_0x35a9('0x24'),_0x493294);process[_0x35a9('0x25')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 4e532bf..f4a8a45 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 _0x3e74=['util','moment','session','role','fullname','name','internal','userpic','voicePause','chatPause','faxPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','then','disposition','unmanaged','json','Forbidden.','headers','authorization','startsWith','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyNonce','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','join','promisify','secret','secrets','payload','options','randomBytes','toString','floor','now','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','express-jwt','basic-auth','crypto','bluebird'];(function(_0x436851,_0x28449a){var _0x1d310c=function(_0x5e228f){while(--_0x5e228f){_0x436851['push'](_0x436851['shift']());}};_0x1d310c(++_0x28449a);}(_0x3e74,0x175));var _0x43e7=function(_0x411a52,_0x24de01){_0x411a52=_0x411a52-0x0;var _0x539154=_0x3e74[_0x411a52];return _0x539154;};'use strict';var db=require(_0x43e7('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x43e7('0x1'));var licenseUtil=require(_0x43e7('0x2'));var encryptor=require(_0x43e7('0x3'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x43e7('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x43e7('0x5'));var crypto=require(_0x43e7('0x6'));var BPromise=require(_0x43e7('0x7'));var util=require(_0x43e7('0x8'));var moment=require(_0x43e7('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0x43e7('0xa')]});var userAttributes=['id',_0x43e7('0xb'),_0x43e7('0xc'),_0x43e7('0xd'),_0x43e7('0xe'),'email',_0x43e7('0xf'),'permissions','md5secret',_0x43e7('0x10'),_0x43e7('0x11'),'mailPause',_0x43e7('0x12'),'smsPause',_0x43e7('0x13'),_0x43e7('0x14'),'showWebBar',_0x43e7('0x15'),_0x43e7('0x16'),_0x43e7('0x17'),_0x43e7('0x18'),'passwordResetAt','alias',_0x43e7('0x19'),_0x43e7('0x1a'),_0x43e7('0x1b'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x43e7('0x1c'),_0x43e7('0x1d'),_0x43e7('0x1e'),_0x43e7('0x1f'),'phoneBarRemoteControlPort','hotdesk',_0x43e7('0x20'),_0x43e7('0x21'),_0x43e7('0x22'),'settingsEnabled','wssPort',_0x43e7('0x23'),_0x43e7('0x24'),_0x43e7('0x25'),_0x43e7('0x26'),_0x43e7('0x27'),_0x43e7('0x28'),_0x43e7('0x29'),_0x43e7('0x2a'),_0x43e7('0x2b'),_0x43e7('0x2c'),_0x43e7('0x2d'),_0x43e7('0x2e'),'openchannelAutoanswerDelay',_0x43e7('0x2f'),_0x43e7('0x30'),'whatsappAutoanswer',_0x43e7('0x31')];exports[_0x43e7('0x32')]=function(){return this[_0x43e7('0x33')](!![])[_0x43e7('0x34')](function(_0x4077fb,_0x2f4cb4,_0x54a9e7){if(_0x4077fb[_0x43e7('0x35')]){_0x54a9e7();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x4077fb[_0x43e7('0x36')]['id']},'attributes':['id',_0x43e7('0x37'),'disposition'],'raw':!![]})[_0x43e7('0x38')](function(_0x4ca5cf){if(_0x4ca5cf&&_0x4ca5cf[_0x43e7('0x37')]){return _0x2f4cb4['status'](_0x4ca5cf[_0x43e7('0x39')]===_0x43e7('0x3a')?0x195:0x193)[_0x43e7('0x3b')]({'message':_0x4ca5cf[_0x43e7('0x39')]==='unmanaged'?'Unmanaged.':_0x43e7('0x3c')});}else{_0x54a9e7();}})['catch'](function(_0x2dd5f){_0x54a9e7(_0x2dd5f);});}});};exports[_0x43e7('0x33')]=function isAuthenticated(_0x3565cf){return compose()[_0x43e7('0x34')](function(_0x5087d7,_0x33a1a5,_0x4690a6){var _0x45b675;if(_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')]){if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')],_0x43e7('0x40'))){var _0x35dbcd=basicAuth(_0x5087d7);db[_0x43e7('0x41')][_0x43e7('0x42')]({'where':{'name':_0x35dbcd[_0x43e7('0xd')]}})[_0x43e7('0x38')](function(_0x4bdb17){if(!_0x4bdb17||!_0x4bdb17[_0x43e7('0x43')](_0x35dbcd[_0x43e7('0x44')])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x46')});}_0x5087d7['user']={'id':_0x4bdb17['id']};_0x4690a6();})[_0x43e7('0x47')](function(_0x49b83d){_0x4690a6(_0x49b83d);});}else if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')]['authorization'],'Bearer')){validateJwt(_0x5087d7,_0x33a1a5,_0x4690a6);}else{if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5['status'](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x48')});}}}else if(_0x5087d7[_0x43e7('0x49')][_0x43e7('0x4a')]){try{var _0x108313={'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5087d7['query']['apikey'],_0x108313)['then'](function(_0x4e8e86){return db['User']['find']({'where':{'id':_0x4e8e86[_0x43e7('0x4c')]}})['then'](function(_0x2b4bfd){_0x45b675=_0x2b4bfd;return db[_0x43e7('0x4d')][_0x43e7('0x4e')]({'where':{'id':0x1},'attributes':[_0x43e7('0x4f'),_0x43e7('0x50')],'raw':!![]});})[_0x43e7('0x38')](function(_0x101d45){if(!_0x45b675||!_['isEqual'](_0x45b675['apiKeyNonce'],_0x4e8e86['nonce'])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x51')});}if(_0x45b675[_0x43e7('0x52')]){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}if(_0x45b675[_0x43e7('0x54')]){if(_0x101d45['blockDuration']>0x0){if(moment(_0x45b675[_0x43e7('0x55')])[_0x43e7('0x56')](_0x101d45['blockDuration'],_0x43e7('0x57'))>moment()){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}else{return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}_0x5087d7[_0x43e7('0x35')]={'id':_0x45b675['id']};_0x4690a6();});})['catch'](function(){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});});}catch(_0x44b6ae){_0x4690a6(_0x44b6ae);}}else if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':'Unknown\x20authorization\x20format'});}})[_0x43e7('0x34')](function(_0x4227c4,_0x575439,_0x3628e0){if(_0x4227c4['user']){db[_0x43e7('0x41')]['find']({'where':{'id':_0x4227c4[_0x43e7('0x35')]['id']},'attributes':userAttributes})[_0x43e7('0x38')](function(_0x3a5807){if(!_0x3a5807){return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x4227c4[_0x43e7('0x35')]=_0x3a5807;_0x3628e0();})[_0x43e7('0x47')](function(_0xe979b5){_0x3628e0(_0xe979b5);});}else if(_0x3565cf){_0x3628e0();}else{return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x43e7('0x34')](function(_0x57f5d0,_0x2ab022,_0x4b3a59){return licenseUtil['getLicense']()[_0x43e7('0x38')](function(_0x5ee1c5){if(_0x5ee1c5[_0x43e7('0x58')]){_0x4b3a59();}else{return _0x2ab022[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x59')});}})['catch'](function(_0x91f1e4){_0x4b3a59(_0x91f1e4);});});};exports[_0x43e7('0x5a')]=function isWebrtcLicence(){return compose()[_0x43e7('0x34')](function(_0x1fd277,_0x296dc8,_0x1efe59){return licenseUtil['getLicense']()['then'](function(_0x3bc9de){if(_0x3bc9de[_0x43e7('0x5b')]){_0x1efe59();}else{return _0x296dc8[_0x43e7('0x45')](0x193)['json']({'message':'Forbidden'});}})['catch'](function(_0x292ded){_0x1efe59(_0x292ded);});});};exports[_0x43e7('0x5c')]=function(_0x52b098,_0x351ca2,_0x47686e){_0x52b098[_0x43e7('0x5c')]=!![];return _0x47686e();};exports['signToken']=function signToken(_0x593155){return signJwt(_0x593155);};exports['setTokenCookie']=function(_0x4de644,_0x214e7e){if(!_0x4de644[_0x43e7('0x35')]){return _0x214e7e['status'](0x194)[_0x43e7('0x3b')]({'message':_0x43e7('0x5d')});}var _0x426bcb={'payload':{'id':_0x4de644[_0x43e7('0x35')]['id'],'role':_0x4de644['user'][_0x43e7('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x426bcb)['then'](function(_0x4bebd4){_0x214e7e[_0x43e7('0x5e')](_0x43e7('0x5f'),_0x4bebd4);_0x214e7e[_0x43e7('0x60')](_0x43e7('0x61'));})[_0x43e7('0x47')](function(_0x2351cf){return _0x214e7e[_0x43e7('0x45')](0x1f4)[_0x43e7('0x62')](_0x2351cf);});};exports[_0x43e7('0x63')]=function(_0x2b5515){if(_['isNil'](_0x2b5515[_0x43e7('0x64')])||_[_0x43e7('0x65')](_0x2b5515['apiKeyIat'])){return null;}else{return createJwt(_0x2b5515);}};exports[_0x43e7('0x66')]=function(_0x4e6f6d){_0x4e6f6d[_0x43e7('0x64')]=generateNonce();_0x4e6f6d[_0x43e7('0x67')]=generateIssuedAt();return createJwt(_0x4e6f6d);};exports[_0x43e7('0x68')]=function(_0x1f561f,_0xfe13fa){var _0x5e5556=_0x1f561f['query'][_0x43e7('0x4a')];if(_0x5e5556){var _0x2ab7ee={'nonce':_0xfe13fa[_0x43e7('0x64')],'iat':_0xfe13fa[_0x43e7('0x67')],'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf[_0x43e7('0x4b')]()};return verifyJwt(_0x5e5556,_0x2ab7ee)[_0x43e7('0x38')](function(){return generateApiKey(_0xfe13fa);});}else{throw{'message':_0x43e7('0x69')};}};exports[_0x43e7('0x6a')]=function(_0x24e758){var _0x312306=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x312306['test'](_0x24e758))throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x43e7('0x6d')]=function(_0x220bf2,_0x2d0052,_0x558d54){var _0x5d63c6=encryptor[_0x43e7('0x6e')](_0x2d0052)[_0x43e7('0x6f')](',');for(var _0x4ebdde=0x0;_0x4ebdde<_0x558d54;_0x4ebdde++){if(!_0x5d63c6[_0x4ebdde])break;if(_0x220bf2[_0x43e7('0x70')]()===_0x5d63c6[_0x4ebdde]['toLowerCase']()){var _0x49a6ce=util[_0x43e7('0x71')](_0x43e7('0x72'),_0x558d54);if(_0x558d54===0x1){_0x49a6ce=_0x43e7('0x73');}throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))](_0x49a6ce);}}return;};exports['updatePasswordsHistory']=function(_0xc3976,_0xdb9fbe){var _0x4d89bd=_0xdb9fbe?encryptor[_0x43e7('0x6e')](_0xdb9fbe)[_0x43e7('0x6f')](','):[];if(_0x4d89bd[_0x43e7('0x74')]===0x5){_0x4d89bd['splice'](-0x1,0x1);}_0x4d89bd['unshift'](_0xc3976);return encryptor['encryptString'](_0x4d89bd[_0x43e7('0x75')](','));};function signJwt(_0x4058ce){var _0x323cf7=BPromise[_0x43e7('0x76')](jwt['sign'],{'context':jwt});var _0x5a50fc=_0x4058ce[_0x43e7('0x77')]||config[_0x43e7('0x78')][_0x43e7('0xa')];return new BPromise(function(_0x5dd349,_0x5ea0db){_0x323cf7(_0x4058ce[_0x43e7('0x79')],_0x5a50fc,_0x4058ce[_0x43e7('0x7a')])[_0x43e7('0x38')](function(_0x2a194d){_0x5dd349(_0x2a194d);})[_0x43e7('0x47')](function(_0xd41e79){_0x5ea0db(_0xd41e79);});});}function verifyJwt(_0x4665db,_0x46748f,_0x406155){var _0x381208=BPromise[_0x43e7('0x76')](jwt['verify'],{'context':jwt});var _0x5f3824=_0x406155||config[_0x43e7('0x78')]['session'];return new BPromise(function(_0x501616,_0x50edb2){_0x381208(_0x4665db,_0x5f3824,_0x46748f)[_0x43e7('0x38')](function(_0xe666b0){_0x501616(_0xe666b0);})['catch'](function(_0xfe5a8d){_0x50edb2(_0xfe5a8d);});});}function generateNonce(){return crypto[_0x43e7('0x7b')](0x10)[_0x43e7('0x7c')]('hex');}function generateIssuedAt(){return Math[_0x43e7('0x7d')](Date[_0x43e7('0x7e')]()/0x3e8)[_0x43e7('0x7c')]();}function createJwt(_0xc9723){var _0x2f43d7={'payload':{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723[_0x43e7('0x64')]},'options':{'algorithm':'HS512','subject':_0xc9723['id'][_0x43e7('0x7c')](),'issuer':hardwareConf[_0x43e7('0x4b')](),'audience':hardwareConf[_0x43e7('0x4b')]()}};return signJwt(_0x2f43d7)['then'](function(_0x56b06d){return{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723['apiKeyNonce'],'token':_0x56b06d};});} \ No newline at end of file +var _0x34e8=['validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','promisify','sign','secret','secrets','payload','options','verify','toString','hex','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','user','ChatInteraction','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','Basic','User','find','pass','status','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','getUuid','then','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','minutes','User\x20not\x20found.','canUpdate','use','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'];(function(_0x50485f,_0x51f711){var _0xab9088=function(_0x351250){while(--_0x351250){_0x50485f['push'](_0x50485f['shift']());}};_0xab9088(++_0x51f711);}(_0x34e8,0x12c));var _0x834e=function(_0x394ab8,_0x2c217a){_0x394ab8=_0x394ab8-0x0;var _0x29c9e7=_0x34e8[_0x394ab8];return _0x29c9e7;};'use strict';var db=require(_0x834e('0x0'))['db'];var config=require(_0x834e('0x1'));var hardwareConf=require(_0x834e('0x2'));var licenseUtil=require(_0x834e('0x3'));var encryptor=require('../encryptor');var _=require(_0x834e('0x4'));var jwt=require(_0x834e('0x5'));var expressJwt=require(_0x834e('0x6'));var compose=require(_0x834e('0x7'));var basicAuth=require(_0x834e('0x8'));var crypto=require(_0x834e('0x9'));var BPromise=require(_0x834e('0xa'));var util=require('util');var moment=require(_0x834e('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x834e('0xc')]});var userAttributes=['id',_0x834e('0xd'),_0x834e('0xe'),_0x834e('0xf'),_0x834e('0x10'),_0x834e('0x11'),_0x834e('0x12'),_0x834e('0x13'),_0x834e('0x14'),_0x834e('0x15'),_0x834e('0x16'),_0x834e('0x17'),_0x834e('0x18'),_0x834e('0x19'),_0x834e('0x1a'),_0x834e('0x1b'),_0x834e('0x1c'),'lastLoginAt',_0x834e('0x1d'),_0x834e('0x1e'),'allowmessenger',_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),'phoneBarDnd',_0x834e('0x23'),_0x834e('0x24'),'phoneBarEnableSettings',_0x834e('0x25'),'phoneBarPrefixRequired',_0x834e('0x26'),_0x834e('0x27'),'hotdesk',_0x834e('0x28'),_0x834e('0x29'),_0x834e('0x2a'),'settingsEnabled',_0x834e('0x2b'),_0x834e('0x2c'),_0x834e('0x2d'),_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30'),_0x834e('0x31'),'chatAutoanswerDelay',_0x834e('0x32'),_0x834e('0x33'),_0x834e('0x34'),_0x834e('0x35'),'openchannelAutoanswer',_0x834e('0x36'),_0x834e('0x37'),'faxAutoanswerDelay',_0x834e('0x38'),_0x834e('0x39')];exports[_0x834e('0x3a')]=function(){return this['isAuthenticated'](!![])['use'](function(_0x231619,_0x34563b,_0x589dde){if(_0x231619[_0x834e('0x3b')]){_0x589dde();}else{return db[_0x834e('0x3c')]['findOne']({'where':{'id':_0x231619[_0x834e('0x3d')]['id']},'attributes':['id',_0x834e('0x3e'),_0x834e('0x3f')],'raw':!![]})['then'](function(_0x24fcf7){if(_0x24fcf7&&_0x24fcf7[_0x834e('0x3e')]){return _0x34563b['status'](_0x24fcf7['disposition']===_0x834e('0x40')?0x195:0x193)['json']({'message':_0x24fcf7[_0x834e('0x3f')]===_0x834e('0x40')?_0x834e('0x41'):_0x834e('0x42')});}else{_0x589dde();}})[_0x834e('0x43')](function(_0x130cc5){_0x589dde(_0x130cc5);});}});};exports['isAuthenticated']=function isAuthenticated(_0x510780){return compose()['use'](function(_0x58c1d7,_0x2c7a8d,_0x567cea){var _0x106d6a;if(_0x58c1d7['headers'][_0x834e('0x44')]){if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],_0x834e('0x47'))){var _0x390119=basicAuth(_0x58c1d7);db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'name':_0x390119[_0x834e('0xf')]}})['then'](function(_0xef9ec2){if(!_0xef9ec2||!_0xef9ec2['authenticate'](_0x390119[_0x834e('0x4a')])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x4d')});}_0x58c1d7[_0x834e('0x3b')]={'id':_0xef9ec2['id']};_0x567cea();})[_0x834e('0x43')](function(_0x4696a1){_0x567cea(_0x4696a1);});}else if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],'Bearer')){validateJwt(_0x58c1d7,_0x2c7a8d,_0x567cea);}else{if(_0x510780){_0x567cea();}else{return _0x2c7a8d[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}}}else if(_0x58c1d7[_0x834e('0x4f')]['apikey']){try{var _0x3f88ad={'audience':hardwareConf[_0x834e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x58c1d7['query']['apikey'],_0x3f88ad)[_0x834e('0x51')](function(_0x41bf4d){return db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x41bf4d[_0x834e('0x52')]}})[_0x834e('0x51')](function(_0x4c2ef6){_0x106d6a=_0x4c2ef6;return db[_0x834e('0x53')]['findOne']({'where':{'id':0x1},'attributes':[_0x834e('0x54'),_0x834e('0x55')],'raw':!![]});})['then'](function(_0x18ac3b){if(!_0x106d6a||!_[_0x834e('0x56')](_0x106d6a['apiKeyNonce'],_0x41bf4d['nonce'])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x57')});}if(_0x106d6a[_0x834e('0x58')]){return _0x2c7a8d[_0x834e('0x4b')](0x191)['json']({'message':_0x834e('0x59')});}if(_0x106d6a['blocked']){if(_0x18ac3b['blockDuration']>0x0){if(moment(_0x106d6a[_0x834e('0x5a')])['add'](_0x18ac3b[_0x834e('0x55')],_0x834e('0x5b'))>moment()){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}else{return _0x2c7a8d['status'](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}_0x58c1d7[_0x834e('0x3b')]={'id':_0x106d6a['id']};_0x567cea();});})['catch'](function(){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1e3e71){_0x567cea(_0x1e3e71);}}else if(_0x510780){_0x567cea();}else{return _0x2c7a8d['status'](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}})['use'](function(_0x4a6942,_0x22ea21,_0x16969b){if(_0x4a6942[_0x834e('0x3b')]){db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x4a6942[_0x834e('0x3b')]['id']},'attributes':userAttributes})[_0x834e('0x51')](function(_0x4a3381){if(!_0x4a3381){return _0x22ea21[_0x834e('0x4b')](0x194)['json']({'message':_0x834e('0x5c')});}_0x4a6942['user']=_0x4a3381;_0x16969b();})[_0x834e('0x43')](function(_0x5a5807){_0x16969b(_0x5a5807);});}else if(_0x510780){_0x16969b();}else{return _0x22ea21[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x834e('0x5d')]=function canUpdate(){return compose()[_0x834e('0x5e')](function(_0xa880cb,_0xd55cc3,_0x252ea0){return licenseUtil[_0x834e('0x5f')]()[_0x834e('0x51')](function(_0x3ccd8e){if(_0x3ccd8e[_0x834e('0x60')]){_0x252ea0();}else{return _0xd55cc3[_0x834e('0x4b')](0x193)['json']({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0x47a8a9){_0x252ea0(_0x47a8a9);});});};exports[_0x834e('0x62')]=function isWebrtcLicence(){return compose()[_0x834e('0x5e')](function(_0x25b035,_0x2112d5,_0x19b5ef){return licenseUtil[_0x834e('0x5f')]()['then'](function(_0x59c855){if(_0x59c855[_0x834e('0x63')]){_0x19b5ef();}else{return _0x2112d5[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0xd1d83b){_0x19b5ef(_0xd1d83b);});});};exports[_0x834e('0x64')]=function(_0x43f599,_0x1419eb,_0x390c45){_0x43f599[_0x834e('0x64')]=!![];return _0x390c45();};exports[_0x834e('0x65')]=function signToken(_0x1a28f6){return signJwt(_0x1a28f6);};exports[_0x834e('0x66')]=function(_0x2aa072,_0x1a3855){if(!_0x2aa072[_0x834e('0x3b')]){return _0x1a3855[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':_0x834e('0x67')});}var _0x4cfacd={'payload':{'id':_0x2aa072[_0x834e('0x3b')]['id'],'role':_0x2aa072[_0x834e('0x3b')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4cfacd)[_0x834e('0x51')](function(_0x3b0988){_0x1a3855['cookie'](_0x834e('0x68'),_0x3b0988);_0x1a3855[_0x834e('0x69')](_0x834e('0x6a'));})[_0x834e('0x43')](function(_0x4288e4){return _0x1a3855[_0x834e('0x4b')](0x1f4)[_0x834e('0x6b')](_0x4288e4);});};exports['retrieveApiKey']=function(_0x1ad7fe){if(_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6d')])||_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6e')])){return null;}else{return createJwt(_0x1ad7fe);}};exports[_0x834e('0x6f')]=function(_0x344b51){_0x344b51[_0x834e('0x6d')]=generateNonce();_0x344b51['apiKeyIat']=generateIssuedAt();return createJwt(_0x344b51);};exports[_0x834e('0x70')]=function(_0x4dc104,_0x2f4bde){var _0x53a9ee=_0x4dc104[_0x834e('0x4f')]['apikey'];if(_0x53a9ee){var _0x527eef={'nonce':_0x2f4bde[_0x834e('0x6d')],'iat':_0x2f4bde[_0x834e('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x53a9ee,_0x527eef)[_0x834e('0x51')](function(){return generateApiKey(_0x2f4bde);});}else{throw{'message':_0x834e('0x71')};}};exports[_0x834e('0x72')]=function(_0x387365){var _0x21c417=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x21c417[_0x834e('0x73')](_0x387365))throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x834e('0x76')]=function(_0x3c70bf,_0x5d5ac2,_0x281342){var _0x4e2b22=encryptor[_0x834e('0x77')](_0x5d5ac2)[_0x834e('0x78')](',');for(var _0x5160c4=0x0;_0x5160c4<_0x281342;_0x5160c4++){if(!_0x4e2b22[_0x5160c4])break;if(_0x3c70bf[_0x834e('0x79')]()===_0x4e2b22[_0x5160c4][_0x834e('0x79')]()){var _0x2de29a=util[_0x834e('0x7a')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x281342);if(_0x281342===0x1){_0x2de29a=_0x834e('0x7b');}throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))](_0x2de29a);}}return;};exports['updatePasswordsHistory']=function(_0x246b8e,_0x1fcae9){var _0x3a7683=_0x1fcae9?encryptor[_0x834e('0x77')](_0x1fcae9)[_0x834e('0x78')](','):[];if(_0x3a7683[_0x834e('0x7c')]===0x5){_0x3a7683[_0x834e('0x7d')](-0x1,0x1);}_0x3a7683[_0x834e('0x7e')](_0x246b8e);return encryptor[_0x834e('0x7f')](_0x3a7683[_0x834e('0x80')](','));};function signJwt(_0x1e4310){var _0x1dfa95=BPromise[_0x834e('0x81')](jwt[_0x834e('0x82')],{'context':jwt});var _0x460a7a=_0x1e4310[_0x834e('0x83')]||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x193a15,_0x3e3467){_0x1dfa95(_0x1e4310[_0x834e('0x85')],_0x460a7a,_0x1e4310[_0x834e('0x86')])['then'](function(_0x2145cf){_0x193a15(_0x2145cf);})[_0x834e('0x43')](function(_0x45bcc2){_0x3e3467(_0x45bcc2);});});}function verifyJwt(_0x36cc14,_0x4ca099,_0x30faa8){var _0x5a9c70=BPromise['promisify'](jwt[_0x834e('0x87')],{'context':jwt});var _0x2b1ec7=_0x30faa8||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x216105,_0x3821ad){_0x5a9c70(_0x36cc14,_0x2b1ec7,_0x4ca099)[_0x834e('0x51')](function(_0xe5c8f6){_0x216105(_0xe5c8f6);})['catch'](function(_0xdef8c4){_0x3821ad(_0xdef8c4);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x834e('0x88')](_0x834e('0x89'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x834e('0x88')]();}function createJwt(_0x82f2a7){var _0x363cc2={'payload':{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')]},'options':{'algorithm':'HS512','subject':_0x82f2a7['id'][_0x834e('0x88')](),'issuer':hardwareConf[_0x834e('0x50')](),'audience':hardwareConf[_0x834e('0x50')]()}};return signJwt(_0x363cc2)[_0x834e('0x51')](function(_0x3181af){return{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')],'token':_0x3181af};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index e9787b2..d218dfb 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['findOne','slice','fieldType','keys','type','./sql-utils','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','tags','checkListsRestrictions','ids','tag','countFilteredContacts','count','clause','rows','catch','describe','startsWith','cf_','map','CmCustomField'];(function(_0xf65eb3,_0x1e68ce){var _0x5a4024=function(_0x2962fc){while(--_0x2962fc){_0xf65eb3['push'](_0xf65eb3['shift']());}};_0x5a4024(++_0x1e68ce);}(_0x757a,0xde));var _0xa757=function(_0x16f50d,_0x3986c6){_0x16f50d=_0x16f50d-0x0;var _0x5c6bb3=_0x757a[_0x16f50d];return _0x5c6bb3;};'use strict';var _=require('lodash');var sqlUtils=require(_0xa757('0x0'));var db=require(_0xa757('0x1'))['db'];exports['findAll']=function(_0x5c03c3,_0x5709ed,_0x32be3b,_0x1721c6){var _0x1c2932={'count':0x0,'rows':[]};var _0x453d07=sqlUtils[_0xa757('0x2')](_0x5709ed,_0x5c03c3);if(_0x453d07){return Promise[_0xa757('0x3')](_0x1c2932);}var _0x5edca8=sqlUtils[_0xa757('0x4')]();var _0x4343b6={};var _0x53be0e=![];var _0x2930fa=![];return Promise[_0xa757('0x3')]()[_0xa757('0x5')](function(){if(_0x5c03c3[_0xa757('0x6')]){return sqlUtils[_0xa757('0x7')](_0x5c03c3['search'],_0x1721c6);}else{return sqlUtils[_0xa757('0x8')](_0x5c03c3,_0x1721c6);}})[_0xa757('0x5')](function(_0x32f0ec){_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xa')]);_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xb')]);_0x5edca8['where'](_0x32f0ec['filter']);_0x5edca8['where'](_0x32f0ec['user']['clause']);_0x4343b6=_0x32f0ec[_0xa757('0xc')];_0x2930fa=_0x32f0ec['user']['skip'];return sqlUtils[_0xa757('0xd')](_0x5709ed,_0x5c03c3,_0x2930fa);})['then'](function(_0x481508){_0x5edca8[_0xa757('0x9')](_0x481508);var _0x1b670e=_0x5c03c3[_0xa757('0x6')]?_0x4343b6[_0xa757('0xe')]:_0x5c03c3[_0xa757('0xf')];_0x53be0e=_0x1b670e?!![]:![];return sqlUtils[_0xa757('0x10')](_0x5edca8,_0x1b670e);})[_0xa757('0x5')](function(_0x2f7947){_0x1c2932[_0xa757('0x11')]=_0x2f7947;if(_0x1c2932[_0xa757('0x11')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x5edca8,_0x5c03c3[_0xa757('0xb')],_0x32be3b,_0x53be0e,_0x4343b6[_0xa757('0x12')],_0x2930fa);})[_0xa757('0x5')](function(_0x4d9f58){if(!_0x4d9f58){return[];}return sqlUtils['getFilteredContacts'](_0x4d9f58,_0x5c03c3,_0x32be3b);})[_0xa757('0x5')](function(_0x468d45){_0x1c2932[_0xa757('0x13')]=_0x468d45;return _0x1c2932;})[_0xa757('0x14')](function(_0x27f4ba){throw _0x27f4ba;});};exports[_0xa757('0x15')]=function(){var _0x4bd137={};var _0x58954=[];return db['CmContact'][_0xa757('0x15')]()[_0xa757('0x5')](function(_0x14014c){_0x4bd137=_0x14014c;var _0x2c9ec6=Object['keys'](_0x4bd137)['filter'](function(_0x40ec48){return _[_0xa757('0x16')](_0x40ec48,_0xa757('0x17'))?_0x40ec48:undefined;});var _0x8d121f=_0x2c9ec6[_0xa757('0x18')](function(_0x40562f){return db[_0xa757('0x19')][_0xa757('0x1a')]({'where':{'id':_0x40562f[_0xa757('0x1b')](0x3)},'raw':!![]});});return Promise['all'](_0x8d121f);})[_0xa757('0x5')](function(_0x59e9d4){for(var _0x422e9e=0x0;_0x422e9e<_0x59e9d4['length'];_0x422e9e++){if(_0x59e9d4[_0x422e9e]){var _0x40551d=_0xa757('0x17')+_0x59e9d4[_0x422e9e]['id'];_0x4bd137[_0x40551d][_0xa757('0x1c')]=_0x59e9d4[_0x422e9e]['type'];}}_0x58954=_[_0xa757('0x18')](Object[_0xa757('0x1d')](_0x4bd137),function(_0x471e84){return{'name':_0x471e84,'type':_0x4bd137[_0x471e84][_0xa757('0x1e')]};});return _0x58954;})['catch'](function(_0x449a7d){throw _0x449a7d;});}; \ No newline at end of file +var _0x2032=['map','findOne','slice','all','length','fieldType','type','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','where','user','ids','tag','countFilteredContacts','count','buildContactsQuery','clause','getFilteredContacts','rows','describe','CmContact','filter','startsWith','cf_'];(function(_0x63341a,_0x3f53da){var _0x3c42ae=function(_0xebf143){while(--_0xebf143){_0x63341a['push'](_0x63341a['shift']());}};_0x3c42ae(++_0x3f53da);}(_0x2032,0xd9));var _0x2203=function(_0x3961b3,_0x2444ab){_0x3961b3=_0x3961b3-0x0;var _0x5bb356=_0x2032[_0x3961b3];return _0x5bb356;};'use strict';var _=require('lodash');var sqlUtils=require(_0x2203('0x0'));var db=require(_0x2203('0x1'))['db'];exports[_0x2203('0x2')]=function(_0x4c28da,_0x486390,_0x228a29,_0x4b4c7f){var _0x46c49a={'count':0x0,'rows':[]};var _0x880dcd=sqlUtils[_0x2203('0x3')](_0x486390,_0x4c28da);if(_0x880dcd){return Promise[_0x2203('0x4')](_0x46c49a);}var _0x3f7ba1=sqlUtils[_0x2203('0x5')]();var _0x2e0f63={};var _0x2676aa=![];var _0x18c4d6=![];return Promise[_0x2203('0x4')]()[_0x2203('0x6')](function(){if(_0x4c28da['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x4c28da[_0x2203('0x7')],_0x4b4c7f);}else{return sqlUtils['parseQueryParameters'](_0x4c28da,_0x4b4c7f);}})[_0x2203('0x6')](function(_0x2972f3){_0x3f7ba1[_0x2203('0x8')](_0x2972f3['default']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['fields']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['filter']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3[_0x2203('0x9')]['clause']);_0x2e0f63=_0x2972f3['tags'];_0x18c4d6=_0x2972f3['user']['skip'];return sqlUtils['checkListsRestrictions'](_0x486390,_0x4c28da,_0x18c4d6);})[_0x2203('0x6')](function(_0x538b30){_0x3f7ba1['where'](_0x538b30);var _0x21a3af=_0x4c28da[_0x2203('0x7')]?_0x2e0f63[_0x2203('0xa')]:_0x4c28da[_0x2203('0xb')];_0x2676aa=_0x21a3af?!![]:![];return sqlUtils[_0x2203('0xc')](_0x3f7ba1,_0x21a3af);})[_0x2203('0x6')](function(_0x2c36e6){_0x46c49a[_0x2203('0xd')]=_0x2c36e6;if(_0x46c49a[_0x2203('0xd')]===0x0){return;}return sqlUtils[_0x2203('0xe')](_0x3f7ba1,_0x4c28da['fields'],_0x228a29,_0x2676aa,_0x2e0f63[_0x2203('0xf')],_0x18c4d6);})[_0x2203('0x6')](function(_0x4893ff){if(!_0x4893ff){return[];}return sqlUtils[_0x2203('0x10')](_0x4893ff,_0x4c28da,_0x228a29);})[_0x2203('0x6')](function(_0x4aeb9f){_0x46c49a[_0x2203('0x11')]=_0x4aeb9f;return _0x46c49a;})['catch'](function(_0x2904ba){throw _0x2904ba;});};exports[_0x2203('0x12')]=function(){var _0x3c8c34={};var _0x3b4034=[];return db[_0x2203('0x13')][_0x2203('0x12')]()['then'](function(_0x13d3f7){_0x3c8c34=_0x13d3f7;var _0x50822b=Object['keys'](_0x3c8c34)[_0x2203('0x14')](function(_0x496d82){return _[_0x2203('0x15')](_0x496d82,_0x2203('0x16'))?_0x496d82:undefined;});var _0x5d4c4e=_0x50822b[_0x2203('0x17')](function(_0x5e29cd){return db['CmCustomField'][_0x2203('0x18')]({'where':{'id':_0x5e29cd[_0x2203('0x19')](0x3)},'raw':!![]});});return Promise[_0x2203('0x1a')](_0x5d4c4e);})[_0x2203('0x6')](function(_0x1244f4){for(var _0x3114ef=0x0;_0x3114ef<_0x1244f4[_0x2203('0x1b')];_0x3114ef++){if(_0x1244f4[_0x3114ef]){var _0x250349='cf_'+_0x1244f4[_0x3114ef]['id'];_0x3c8c34[_0x250349][_0x2203('0x1c')]=_0x1244f4[_0x3114ef][_0x2203('0x1d')];}}_0x3b4034=_[_0x2203('0x17')](Object['keys'](_0x3c8c34),function(_0xb2071b){return{'name':_0xb2071b,'type':_0x3c8c34[_0xb2071b][_0x2203('0x1d')]};});return _0x3b4034;})['catch'](function(_0xd6e109){throw _0xd6e109;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 32b3d1a..8e0a0c3 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 _0xe80c=['concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','then','fields','tag','clause','filter','resolve','search','c.ListId\x20IS\x20NULL','group','c.id','limit','offset','subqry.id','order','DESC','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','push','clone','getSelectedTags','isEmpty','t.id\x20IN\x20?','COUNT(*)','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','ListId','autocomplete','true','from','where','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','lastName','mobile','email','deletedAt','TagIds','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','default','value','start','end','Tag','map','tags','ids','User','user','and','uc.UserId\x20=\x20?','skip','some','name','compact','Contact','c.ListId\x20IN\x20?'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe80c,0x1c2));var _0xce80=function(_0x39fd76,_0x29b123){_0x39fd76=_0x39fd76-0x0;var _0x19625e=_0xe80c[_0x39fd76];return _0x19625e;};'use strict';var _=require('lodash');var squel=require(_0xce80('0x0'));var as=require(_0xce80('0x1'));var qs=require(_0xce80('0x2'));var utils=require(_0xce80('0x3'));var db=require(_0xce80('0x4'))['db'];function skipContactsQuery(_0x589448,_0x40be3f){var _0xd0d912=![];if(_0x589448[_0xce80('0x5')]===_0xce80('0x6')&&!_0x40be3f['search']&&!_0x40be3f[_0xce80('0x7')]&&_0x40be3f[_0xce80('0x8')]!==_0xce80('0x9')){_0xd0d912=!![];}return _0xd0d912;}function getContactsSubquery(){return squel['select']()[_0xce80('0xa')]('cm_contacts','c')[_0xce80('0xb')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x61e161,_0x3331d6){var _0x51f349=_0x3331d6?'c':'subqry';_0x61e161[_0xce80('0xc')](_0xce80('0xd'),'uc',_0xce80('0xe')+_0x51f349+_0xce80('0xf'))[_0xce80('0xc')](_0xce80('0x10'),'ct',_0xce80('0x11')+_0x51f349+_0xce80('0xf'))['left_join'](_0xce80('0x12'),'t',_0xce80('0x13'));return _0x61e161;}function addFieldsToQuery(_0x12d8c7,_0x5d7d94,_0x5d70a3,_0x3ab0e2,_0x1903ec){var _0x15f870=_0x1903ec?'c':_0xce80('0x14');if(!_0x5d7d94){_0x5d7d94=['id','firstName',_0xce80('0x15'),'phone',_0xce80('0x16'),'fax',_0xce80('0x17'),_0xce80('0x7'),'CompanyId','createdAt','updatedAt',_0xce80('0x18'),_0xce80('0x19')];}var _0x148d57=_0x5d70a3&&_0x1903ec||!_0x5d70a3&&!_0x1903ec;if(_0x3ab0e2){_0x148d57=_0x3ab0e2&&_0x1903ec||!_0x3ab0e2&&!_0x1903ec;}_0x5d7d94[_0xce80('0x1a')](function(_0x4375b7){if(_0x4375b7==='TagIds'){if(_0x148d57){_0x12d8c7[_0xce80('0x1b')](_0xce80('0x1c'),_0x4375b7);}else if(_0x5d70a3||_0x3ab0e2){_0x12d8c7['field'](_0x15f870+'.'+_0x4375b7);}}else{_0x12d8c7['field'](_0x15f870+'.'+_0x4375b7);}});return _0x12d8c7;}function getSqlClauses(){var _0x59825b={'default':squel[_0xce80('0x1d')](),'fields':squel[_0xce80('0x1d')](),'filter':squel[_0xce80('0x1d')](),'tags':{'clause':squel[_0xce80('0x1d')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x59825b;}function parseTagParameter(_0x259a0b){var _0x10ba3d=squel[_0xce80('0x1d')]();if(_0x259a0b){var _0x5315eb=utils['getSelectedTags'](_0x259a0b);_0x5315eb[_0xce80('0x1a')](function(_0x49fbc8){_0x10ba3d['or'](_0xce80('0x1e'),'%,'+_0x49fbc8+',%');});}return _0x10ba3d;}function parseSearchFilter(_0x348d2d){var _0x2c5d01=squel[_0xce80('0x1d')]();if(_0x348d2d){var _0x4fc91c=_0x348d2d[_0xce80('0x1f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x4fc91c[_0xce80('0x20')]('\x20')[_0xce80('0x21')]>0x1){_0x2c5d01['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4fc91c),null);}else{if(qs[_0xce80('0x22')](_0x4fc91c)){_0x2c5d01['or']('c.id\x20LIKE\x20?',_0x4fc91c+'%');_0x2c5d01['or'](_0xce80('0x23'),_0x4fc91c+'%');_0x2c5d01['or'](_0xce80('0x24'),_0x4fc91c+'%');_0x2c5d01['or'](_0xce80('0x25'),_0x4fc91c+'%');}else if(qs[_0xce80('0x26')](_0x4fc91c)){_0x2c5d01['or']('c.email\x20LIKE\x20?',_0x4fc91c+'%');}else{_0x2c5d01['or'](_0xce80('0x27'),'%'+_0x4fc91c+'%');_0x2c5d01['or'](_0xce80('0x28'),'%'+_0x4fc91c+'%');_0x2c5d01['or'](_0xce80('0x29'),'%'+_0x4fc91c+'%');}}}return _0x2c5d01;}function parseAdvancedSearchFilter(_0x3d7c49,_0x2e19da){var _0x4792fe=getSqlClauses();var _0x4d8796=as[_0xce80('0x2a')](_0x3d7c49);var _0x51b5bf=_0x4d8796[_0xce80('0x2b')];for(var _0x43ffb6=0x0;_0x43ffb6<_0x4d8796[_0xce80('0x2c')][_0xce80('0x21')];_0x43ffb6++){var _0x279931=_0x4d8796[_0xce80('0x2c')][_0x43ffb6];var _0x3b8b30='c';var _0x50da6e=_[_0xce80('0x2d')](_0x2e19da,['name',_0x279931['field']]);if(_0x50da6e){if(_0x279931[_0xce80('0x1b')]===_0xce80('0x2e')||_0x50da6e[_0xce80('0x2f')]===_0xce80('0x30')){_0x279931[_0xce80('0x31')]=_0xce80('0x32');}var _0x2fe975=as[_0xce80('0x33')](_0x3b8b30,_0x50da6e['type'],_0x279931);_0x4792fe[_0xce80('0x34')][_0x51b5bf](_0x2fe975['text'],_0x2fe975[_0xce80('0x35')][_0xce80('0x36')],_0x2fe975[_0xce80('0x35')][_0xce80('0x37')]);}else{if(_0x279931[_0xce80('0x1b')]===_0xce80('0x38')){var _0x52fdfd=_0x279931[_0xce80('0x35')][_0xce80('0x20')](',')[_0xce80('0x39')](function(_0x322e00){return Number(_0x322e00);});var _0xa1fa1=parseTagParameter(_0x52fdfd);_0x4792fe[_0xce80('0x3a')]['clause']['and'](_0xa1fa1);_0x4792fe[_0xce80('0x3a')][_0xce80('0x3b')]=_0x52fdfd;}else if(_0x279931[_0xce80('0x1b')]===_0xce80('0x3c')){_0x4792fe[_0xce80('0x3d')]['clause'][_0xce80('0x3e')](_0xce80('0x3f'),_0x279931[_0xce80('0x35')]);_0x4792fe[_0xce80('0x3d')][_0xce80('0x40')]=!![];}}}return _0x4792fe;}function parseModelFields(_0x3f76f6,_0x1acc00){var _0x1a934d=squel[_0xce80('0x1d')]();var _0x45e175=_(_0x3f76f6)['keys']()[_0xce80('0x39')](function(_0x48939f){return _[_0xce80('0x41')](_0x1acc00,[_0xce80('0x42'),_0x48939f])?_0x48939f:undefined;})[_0xce80('0x43')]()[_0xce80('0x35')]();if(_0x3f76f6[_0xce80('0x44')]){_0x45e175['push'](_0xce80('0x44'));}if(_0x45e175[_0xce80('0x21')]>0x0){_0x45e175[_0xce80('0x1a')](function(_0x53715e){if(_0x53715e===_0xce80('0x7')){_0x1a934d['and'](_0xce80('0x45'),[][_0xce80('0x46')](_0x3f76f6[_0x53715e]));}else if(_0x53715e===_0xce80('0x44')){var _0x48a169='%'+_0x3f76f6[_0x53715e]+'%';_0x1a934d[_0xce80('0x3e')](_0xce80('0x47'),_0x48a169);}else{_0x1a934d['and']('c.'+_0x53715e+_0xce80('0x48'),_0x3f76f6[_0x53715e]);}});}return _0x1a934d;}function parseQueryParameters(_0x3226a4,_0xa4c7f){var _0x12bb2c=getSqlClauses();return Promise['resolve']()[_0xce80('0x49')](function(){return parseModelFields(_0x3226a4,_0xa4c7f);})['then'](function(_0x281f37){_0x12bb2c[_0xce80('0x4a')][_0xce80('0x3e')](_0x281f37);return parseTagParameter(_0x3226a4[_0xce80('0x4b')]);})[_0xce80('0x49')](function(_0x5ecae9){_0x12bb2c[_0xce80('0x3a')][_0xce80('0x4c')][_0xce80('0x3e')](_0x5ecae9);return parseSearchFilter(_0x3226a4['filter']);})[_0xce80('0x49')](function(_0x1a2bf2){_0x12bb2c[_0xce80('0x4d')]=_0x1a2bf2;return _0x12bb2c;});}function checkListsRestrictions(_0x53f643,_0x35801b,_0x38b98b){var _0x6e07b8=squel['expr']();return Promise[_0xce80('0x4e')]()['then'](function(){if(_0x35801b[_0xce80('0x4f')]&&_0x53f643[_0xce80('0x5')]===_0xce80('0x6')&&!_0x38b98b){return _0x53f643['getLists']({'attributes':['id'],'raw':!![]});}})[_0xce80('0x49')](function(_0x1f489b){if(_0x1f489b){if(_0x1f489b[_0xce80('0x21')]===0x0){_0x6e07b8['and'](_0xce80('0x50'));}else{_0x6e07b8['and']('c.ListId\x20IN\x20?',_[_0xce80('0x39')](_0x1f489b,'id'));}}})[_0xce80('0x49')](function(){return _0x6e07b8;});}function buildContactsQuery(_0x42a4be,_0x4115ea,_0x9a6331,_0x11a20a,_0x1ac360,_0x281e4a){if(_0x4115ea){_0x4115ea=_0x9a6331['attributes'];}_0x42a4be=addFieldsToQuery(_0x42a4be,_0x4115ea,_0x11a20a,_0x281e4a,!![]);var _0x217fa4=squel['select']();_0x217fa4=addFieldsToQuery(_0x217fa4,_0x4115ea,_0x11a20a,_0x281e4a,![]);if(_0x11a20a||_0x281e4a){_0x42a4be=applyJoinClauses(_0x42a4be,!![]);_0x42a4be[_0xce80('0x51')](_0xce80('0x52'));if(_0x9a6331[_0xce80('0x53')]){_0x217fa4[_0xce80('0x53')](_0x9a6331[_0xce80('0x53')]);}if(_0x9a6331[_0xce80('0x54')]){_0x217fa4['offset'](_0x9a6331[_0xce80('0x54')]);}}else{_0x217fa4=applyJoinClauses(_0x217fa4,![]);_0x217fa4['group'](_0xce80('0x55'));if(_0x9a6331['limit']){_0x42a4be['limit'](_0x9a6331[_0xce80('0x53')]);}if(_0x9a6331[_0xce80('0x54')]){_0x42a4be[_0xce80('0x54')](_0x9a6331[_0xce80('0x54')]);}}_0x217fa4['having'](_0x1ac360);if(_0x9a6331[_0xce80('0x56')]){_0x9a6331[_0xce80('0x56')]['forEach'](function(_0x300901){_0x42a4be[_0xce80('0x56')]('c.'+_0x300901[0x0],_0x300901[0x1]===_0xce80('0x57')?![]:!![]);_0x217fa4[_0xce80('0x56')]('subqry.'+_0x300901[0x0],_0x300901[0x1]==='DESC'?![]:!![]);});}_0x217fa4['from'](_0x42a4be,_0xce80('0x14'));return _0x217fa4;}function getFilteredContacts(_0x2bd460){var _0x2735e9=[];return db['Tag']['findAll']({'attributes':['id',_0xce80('0x42'),'color'],'raw':!![]})[_0xce80('0x49')](function(_0x2d874d){_0x2735e9=_[_0xce80('0x58')](_0x2d874d,'id');var _0x21ed4e={'type':db[_0xce80('0x59')][_0xce80('0x5a')][_0xce80('0x5b')],'model':db[_0xce80('0x5c')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xce80('0x5d')][_0xce80('0x5e')](_0x2bd460[_0xce80('0x5f')](),_0x21ed4e);})['then'](function(_0x1ed43c){_0x1ed43c[_0xce80('0x1a')](function(_0x258681){if(_0x258681[_0xce80('0x19')]){_0x258681['Tags']=[];_0x258681[_0xce80('0x19')]['split'](',')[_0xce80('0x1a')](function(_0x1cc190){_0x258681[_0xce80('0x60')][_0xce80('0x61')](_0x2735e9[_0x1cc190]);});}delete _0x258681[_0xce80('0x19')];});return _0x1ed43c;});}function countFilteredContacts(_0xdef8ab,_0x3c5915){var _0x6487b8=_0xdef8ab[_0xce80('0x62')]();_0x6487b8[_0xce80('0x1b')]('COUNT(*)');_0x6487b8=applyJoinClauses(_0x6487b8,!![]);_0xdef8ab[_0xce80('0x51')](_0xce80('0x52'));var _0x120cac=utils[_0xce80('0x63')](_0x3c5915);if(!_[_0xce80('0x64')](_0x120cac)){_0x6487b8[_0xce80('0xb')](_0xce80('0x65'),_0x120cac);}var _0x10e445={'type':db[_0xce80('0x59')][_0xce80('0x5a')][_0xce80('0x5b')],'raw':!![]};return db[_0xce80('0x5d')][_0xce80('0x5e')](_0x6487b8[_0xce80('0x5f')](),_0x10e445)['then'](function(_0x2384b6){return _0x2384b6[0x0][_0xce80('0x66')];});}module[_0xce80('0x67')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xc2e8=['SELECT','sequelize','query','toString','TagIds','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','../interaction/utils','agent','search','ListId','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','conditions','find','name','fieldType','datetime','DATE','buildExpression','type','default','text','value','start','end','Tag','split','map','clause','and','tags','ids','uc.UserId\x20=\x20?','user','skip','keys','some','compact','Contact','push','c.ListId\x20IN\x20?','\x20=\x20?','resolve','then','fields','tag','filter','role','getLists','c.ListId\x20IS\x20NULL','attributes','select','group','c.id','limit','offset','having','order','DESC','subqry.','from','findAll','color','keyBy','Sequelize','QueryTypes'];(function(_0x350110,_0x3f80e2){var _0x25d364=function(_0x4e5267){while(--_0x4e5267){_0x350110['push'](_0x350110['shift']());}};_0x25d364(++_0x3f80e2);}(_0xc2e8,0x70));var _0x8c2e=function(_0x1ed404,_0x12fc77){_0x1ed404=_0x1ed404-0x0;var _0x56c61e=_0xc2e8[_0x1ed404];return _0x56c61e;};'use strict';var _=require(_0x8c2e('0x0'));var squel=require(_0x8c2e('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var utils=require(_0x8c2e('0x2'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x8e4f3e,_0x3c074b){var _0x39060a=![];if(_0x8e4f3e['role']===_0x8c2e('0x3')&&!_0x3c074b[_0x8c2e('0x4')]&&!_0x3c074b[_0x8c2e('0x5')]&&_0x3c074b['autocomplete']!=='true'){_0x39060a=!![];}return _0x39060a;}function getContactsSubquery(){return squel['select']()['from']('cm_contacts','c')[_0x8c2e('0x6')](_0x8c2e('0x7'));}function applyJoinClauses(_0x16a291,_0x331e6d){var _0x41771b=_0x331e6d?'c':_0x8c2e('0x8');_0x16a291[_0x8c2e('0x9')](_0x8c2e('0xa'),'uc','uc.CmContactId\x20=\x20'+_0x41771b+_0x8c2e('0xb'))[_0x8c2e('0x9')](_0x8c2e('0xc'),'ct','ct.CmContactId\x20=\x20'+_0x41771b+'.id')['left_join'](_0x8c2e('0xd'),'t',_0x8c2e('0xe'));return _0x16a291;}function addFieldsToQuery(_0x2952f4,_0x3e6f17,_0x2cba3e,_0x68d352,_0x26abe0){var _0x4f9398=_0x26abe0?'c':'subqry';if(!_0x3e6f17){_0x3e6f17=['id',_0x8c2e('0xf'),_0x8c2e('0x10'),_0x8c2e('0x11'),_0x8c2e('0x12'),_0x8c2e('0x13'),_0x8c2e('0x14'),'ListId',_0x8c2e('0x15'),_0x8c2e('0x16'),_0x8c2e('0x17'),_0x8c2e('0x18'),'TagIds'];}var _0x944b34=_0x2cba3e&&_0x26abe0||!_0x2cba3e&&!_0x26abe0;if(_0x68d352){_0x944b34=_0x68d352&&_0x26abe0||!_0x68d352&&!_0x26abe0;}_0x3e6f17[_0x8c2e('0x19')](function(_0x2e2e46){if(_0x2e2e46==='TagIds'){if(_0x944b34){_0x2952f4['field'](_0x8c2e('0x1a'),_0x2e2e46);}else if(_0x2cba3e||_0x68d352){_0x2952f4['field'](_0x4f9398+'.'+_0x2e2e46);}}else{_0x2952f4[_0x8c2e('0x1b')](_0x4f9398+'.'+_0x2e2e46);}});return _0x2952f4;}function getSqlClauses(){var _0xa02a92={'default':squel['expr'](),'fields':squel[_0x8c2e('0x1c')](),'filter':squel[_0x8c2e('0x1c')](),'tags':{'clause':squel[_0x8c2e('0x1c')](),'ids':null},'user':{'clause':squel[_0x8c2e('0x1c')](),'skip':![]}};return _0xa02a92;}function parseTagParameter(_0x107f13){var _0x5641e1=squel[_0x8c2e('0x1c')]();if(_0x107f13){var _0x5baf2e=utils['getSelectedTags'](_0x107f13);_0x5baf2e[_0x8c2e('0x19')](function(_0x29e755){_0x5641e1['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29e755+',%');});}return _0x5641e1;}function parseSearchFilter(_0x556e83){var _0xfc60d2=squel['expr']();if(_0x556e83){var _0x350cc5=_0x556e83[_0x8c2e('0x1d')]('\x5c','\x5c\x5c')[_0x8c2e('0x1d')](/'/g,'\x27\x27');if(_0x350cc5['split']('\x20')[_0x8c2e('0x1e')]>0x1){_0xfc60d2['or'](_0x8c2e('0x1f'),qs[_0x8c2e('0x20')](_0x350cc5),null);}else{if(qs[_0x8c2e('0x21')](_0x350cc5)){_0xfc60d2['or']('c.id\x20LIKE\x20?',_0x350cc5+'%');_0xfc60d2['or'](_0x8c2e('0x22'),_0x350cc5+'%');_0xfc60d2['or']('c.mobile\x20LIKE\x20?',_0x350cc5+'%');_0xfc60d2['or']('c.fax\x20LIKE\x20?',_0x350cc5+'%');}else if(qs[_0x8c2e('0x23')](_0x350cc5)){_0xfc60d2['or'](_0x8c2e('0x24'),_0x350cc5+'%');}else{_0xfc60d2['or']('c.firstName\x20LIKE\x20?','%'+_0x350cc5+'%');_0xfc60d2['or']('c.lastName\x20LIKE\x20?','%'+_0x350cc5+'%');_0xfc60d2['or'](_0x8c2e('0x24'),'%'+_0x350cc5+'%');}}}return _0xfc60d2;}function parseAdvancedSearchFilter(_0x2021e4,_0x4220ba){var _0x46a69f=getSqlClauses();var _0xf9b0d4=as[_0x8c2e('0x25')](_0x2021e4);var _0x39a9bc=_0xf9b0d4['sqlOperator'];for(var _0x5e123b=0x0;_0x5e123b<_0xf9b0d4['conditions'][_0x8c2e('0x1e')];_0x5e123b++){var _0x2f2b6b=_0xf9b0d4[_0x8c2e('0x26')][_0x5e123b];var _0x534315='c';var _0x89de37=_[_0x8c2e('0x27')](_0x4220ba,[_0x8c2e('0x28'),_0x2f2b6b[_0x8c2e('0x1b')]]);if(_0x89de37){if(_0x2f2b6b[_0x8c2e('0x1b')]==='dateOfBirth'||_0x89de37[_0x8c2e('0x29')]===_0x8c2e('0x2a')){_0x2f2b6b['castTo']=_0x8c2e('0x2b');}var _0x419b56=as[_0x8c2e('0x2c')](_0x534315,_0x89de37[_0x8c2e('0x2d')],_0x2f2b6b);_0x46a69f[_0x8c2e('0x2e')][_0x39a9bc](_0x419b56[_0x8c2e('0x2f')],_0x419b56[_0x8c2e('0x30')][_0x8c2e('0x31')],_0x419b56['value'][_0x8c2e('0x32')]);}else{if(_0x2f2b6b[_0x8c2e('0x1b')]===_0x8c2e('0x33')){var _0xb10810=_0x2f2b6b[_0x8c2e('0x30')][_0x8c2e('0x34')](',')[_0x8c2e('0x35')](function(_0x233a91){return Number(_0x233a91);});var _0x29f476=parseTagParameter(_0xb10810);_0x46a69f['tags'][_0x8c2e('0x36')][_0x8c2e('0x37')](_0x29f476);_0x46a69f[_0x8c2e('0x38')][_0x8c2e('0x39')]=_0xb10810;}else if(_0x2f2b6b[_0x8c2e('0x1b')]==='User'){_0x46a69f['user'][_0x8c2e('0x36')][_0x8c2e('0x37')](_0x8c2e('0x3a'),_0x2f2b6b[_0x8c2e('0x30')]);_0x46a69f[_0x8c2e('0x3b')][_0x8c2e('0x3c')]=!![];}}}return _0x46a69f;}function parseModelFields(_0x3877a9,_0x4cb58f){var _0x5d37d5=squel[_0x8c2e('0x1c')]();var _0x1aaa5b=_(_0x3877a9)[_0x8c2e('0x3d')]()[_0x8c2e('0x35')](function(_0x2123bd){return _[_0x8c2e('0x3e')](_0x4cb58f,[_0x8c2e('0x28'),_0x2123bd])?_0x2123bd:undefined;})[_0x8c2e('0x3f')]()['value']();if(_0x3877a9[_0x8c2e('0x40')]){_0x1aaa5b[_0x8c2e('0x41')](_0x8c2e('0x40'));}if(_0x1aaa5b['length']>0x0){_0x1aaa5b[_0x8c2e('0x19')](function(_0x5ce170){if(_0x5ce170===_0x8c2e('0x5')){_0x5d37d5[_0x8c2e('0x37')](_0x8c2e('0x42'),[]['concat'](_0x3877a9[_0x5ce170]));}else if(_0x5ce170==='Contact'){var _0x708c1b='%'+_0x3877a9[_0x5ce170]+'%';_0x5d37d5[_0x8c2e('0x37')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x708c1b);}else{_0x5d37d5[_0x8c2e('0x37')]('c.'+_0x5ce170+_0x8c2e('0x43'),_0x3877a9[_0x5ce170]);}});}return _0x5d37d5;}function parseQueryParameters(_0x4ee960,_0x2795f4){var _0x501490=getSqlClauses();return Promise[_0x8c2e('0x44')]()[_0x8c2e('0x45')](function(){return parseModelFields(_0x4ee960,_0x2795f4);})[_0x8c2e('0x45')](function(_0x1a00d0){_0x501490[_0x8c2e('0x46')]['and'](_0x1a00d0);return parseTagParameter(_0x4ee960[_0x8c2e('0x47')]);})[_0x8c2e('0x45')](function(_0x42bd71){_0x501490[_0x8c2e('0x38')]['clause']['and'](_0x42bd71);return parseSearchFilter(_0x4ee960[_0x8c2e('0x48')]);})[_0x8c2e('0x45')](function(_0x3495a3){_0x501490[_0x8c2e('0x48')]=_0x3495a3;return _0x501490;});}function checkListsRestrictions(_0xe7077c,_0x13e09d,_0x5a1ff8){var _0x31cfed=squel['expr']();return Promise[_0x8c2e('0x44')]()[_0x8c2e('0x45')](function(){if(_0x13e09d[_0x8c2e('0x4')]&&_0xe7077c[_0x8c2e('0x49')]===_0x8c2e('0x3')&&!_0x5a1ff8){return _0xe7077c[_0x8c2e('0x4a')]({'attributes':['id'],'raw':!![]});}})[_0x8c2e('0x45')](function(_0x3554b2){if(_0x3554b2){if(_0x3554b2[_0x8c2e('0x1e')]===0x0){_0x31cfed[_0x8c2e('0x37')](_0x8c2e('0x4b'));}else{_0x31cfed['and'](_0x8c2e('0x42'),_[_0x8c2e('0x35')](_0x3554b2,'id'));}}})[_0x8c2e('0x45')](function(){return _0x31cfed;});}function buildContactsQuery(_0x486717,_0x252e08,_0x449c6b,_0x1d46dc,_0x7d8cc0,_0x2de03d){if(_0x252e08){_0x252e08=_0x449c6b[_0x8c2e('0x4c')];}_0x486717=addFieldsToQuery(_0x486717,_0x252e08,_0x1d46dc,_0x2de03d,!![]);var _0x2cd691=squel[_0x8c2e('0x4d')]();_0x2cd691=addFieldsToQuery(_0x2cd691,_0x252e08,_0x1d46dc,_0x2de03d,![]);if(_0x1d46dc||_0x2de03d){_0x486717=applyJoinClauses(_0x486717,!![]);_0x486717[_0x8c2e('0x4e')](_0x8c2e('0x4f'));if(_0x449c6b[_0x8c2e('0x50')]){_0x2cd691[_0x8c2e('0x50')](_0x449c6b['limit']);}if(_0x449c6b['offset']){_0x2cd691[_0x8c2e('0x51')](_0x449c6b[_0x8c2e('0x51')]);}}else{_0x2cd691=applyJoinClauses(_0x2cd691,![]);_0x2cd691['group']('subqry.id');if(_0x449c6b['limit']){_0x486717['limit'](_0x449c6b[_0x8c2e('0x50')]);}if(_0x449c6b[_0x8c2e('0x51')]){_0x486717[_0x8c2e('0x51')](_0x449c6b[_0x8c2e('0x51')]);}}_0x2cd691[_0x8c2e('0x52')](_0x7d8cc0);if(_0x449c6b[_0x8c2e('0x53')]){_0x449c6b[_0x8c2e('0x53')][_0x8c2e('0x19')](function(_0x3f8443){_0x486717[_0x8c2e('0x53')]('c.'+_0x3f8443[0x0],_0x3f8443[0x1]===_0x8c2e('0x54')?![]:!![]);_0x2cd691[_0x8c2e('0x53')](_0x8c2e('0x55')+_0x3f8443[0x0],_0x3f8443[0x1]==='DESC'?![]:!![]);});}_0x2cd691[_0x8c2e('0x56')](_0x486717,_0x8c2e('0x8'));return _0x2cd691;}function getFilteredContacts(_0x49c00){var _0x32380f=[];return db['Tag'][_0x8c2e('0x57')]({'attributes':['id',_0x8c2e('0x28'),_0x8c2e('0x58')],'raw':!![]})[_0x8c2e('0x45')](function(_0x335280){_0x32380f=_[_0x8c2e('0x59')](_0x335280,'id');var _0xc202f9={'type':db[_0x8c2e('0x5a')][_0x8c2e('0x5b')][_0x8c2e('0x5c')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x8c2e('0x5d')][_0x8c2e('0x5e')](_0x49c00[_0x8c2e('0x5f')](),_0xc202f9);})[_0x8c2e('0x45')](function(_0x532190){_0x532190[_0x8c2e('0x19')](function(_0x492215){if(_0x492215[_0x8c2e('0x60')]){_0x492215['Tags']=[];_0x492215[_0x8c2e('0x60')]['split'](',')[_0x8c2e('0x19')](function(_0x4beb4a){_0x492215[_0x8c2e('0x61')][_0x8c2e('0x41')](_0x32380f[_0x4beb4a]);});}delete _0x492215['TagIds'];});return _0x532190;});}function countFilteredContacts(_0x4562a5,_0x1618ad){var _0x14baf0=_0x4562a5['clone']();_0x14baf0[_0x8c2e('0x1b')](_0x8c2e('0x62'));_0x14baf0=applyJoinClauses(_0x14baf0,!![]);_0x4562a5['group'](_0x8c2e('0x4f'));var _0x5a9088=utils['getSelectedTags'](_0x1618ad);if(!_[_0x8c2e('0x63')](_0x5a9088)){_0x14baf0[_0x8c2e('0x6')](_0x8c2e('0x64'),_0x5a9088);}var _0x101877={'type':db[_0x8c2e('0x5a')][_0x8c2e('0x5b')][_0x8c2e('0x5c')],'raw':!![]};return db[_0x8c2e('0x5d')][_0x8c2e('0x5e')](_0x14baf0[_0x8c2e('0x5f')](),_0x101877)[_0x8c2e('0x45')](function(_0x5b5408){return _0x5b5408[0x0]['COUNT(*)'];});}module[_0x8c2e('0x65')]={'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 e549329..ec45f7d 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 _0x67d4=['getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','write','end','final','binary','close','decryptFile','createDecipher','unlink','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','app','secrets','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:'];(function(_0x226757,_0x46ba16){var _0x4f301f=function(_0x2dd018){while(--_0x2dd018){_0x226757['push'](_0x226757['shift']());}};_0x4f301f(++_0x46ba16);}(_0x67d4,0x1ad));var _0x467d=function(_0x47f2d2,_0x3598d8){_0x47f2d2=_0x47f2d2-0x0;var _0x29a845=_0x67d4[_0x47f2d2];return _0x29a845;};'use strict';var crypto=require(_0x467d('0x0'));var fs=require('fs');var BPromise=require(_0x467d('0x1'));var _=require(_0x467d('0x2'));var config=require(_0x467d('0x3'));var logger=require('../../config/logger')(_0x467d('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x467d('0x5')][_0x467d('0x6')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x467d('0x7')};if(config[_0x467d('0x8')]&&config[_0x467d('0x8')][_0x467d('0x9')]){var isSupported=isAlgorithmSupported(config[_0x467d('0x8')][_0x467d('0x9')]);if(isSupported){fileOptions[_0x467d('0x9')]=config[_0x467d('0x8')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x467d('0xa')](',\x20');logger[_0x467d('0xb')](config['encrypt']['algorithm'],_0x467d('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1f3a39){return AES_SUPPORTED_RX['test'](_0x1f3a39);}function getSupportedCiphers(){return crypto[_0x467d('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0xdf0e86){return getSupportedCiphers()[_0x467d('0xe')](_0xdf0e86)>-0x1;}function combineOptions(_0x2fdbbb){var _0x4577fa={};for(var _0x2577be in fileOptions){if(fileOptions[_0x467d('0xf')](_0x2577be)){_0x4577fa[_0x2577be]=fileOptions[_0x2577be];}}if(_0x2fdbbb){for(var _0x40bbb5 in _0x2fdbbb){if(_0x2fdbbb[_0x467d('0xf')](_0x40bbb5)){_0x4577fa[_0x40bbb5]=_0x2fdbbb[_0x40bbb5];}}}return _0x4577fa;}exports[_0x467d('0x10')]=function(_0x14fcc2,_0x1163f3,_0x82f91a,_0x41f3c2){return new BPromise(function(_0x1a4ba3,_0x397b58){_0x41f3c2=combineOptions(_0x41f3c2);var _0x25e231=new Buffer(_0x82f91a);var _0x47cf28=fs[_0x467d('0x11')](_0x14fcc2);var _0x1cc3d0=fs[_0x467d('0x12')](_0x1163f3);var _0x37c33a=crypto[_0x467d('0x13')](_0x41f3c2[_0x467d('0x9')],_0x25e231);_0x47cf28['on'](_0x467d('0x14'),function(_0x773847){var _0x2763d1=new Buffer(_0x37c33a[_0x467d('0x15')](_0x773847),'binary');_0x1cc3d0[_0x467d('0x16')](_0x2763d1);});_0x47cf28['on'](_0x467d('0x17'),function(){try{var _0x2d67a1=new Buffer(_0x37c33a[_0x467d('0x18')]('binary'),_0x467d('0x19'));_0x1cc3d0[_0x467d('0x16')](_0x2d67a1);_0x1cc3d0[_0x467d('0x17')]();_0x1cc3d0['on'](_0x467d('0x1a'),function(){return _0x1a4ba3(_0x1163f3);});}catch(_0x39f8e4){fs['unlink'](_0x1163f3);return _0x397b58(_0x39f8e4);}});});};exports[_0x467d('0x1b')]=function(_0x4f3843,_0x5e6579,_0x1dea1b,_0x35ae5c){return new BPromise(function(_0xf84346,_0x34e674){_0x35ae5c=combineOptions(_0x35ae5c);var _0x2c79cd=new Buffer(_0x1dea1b);var _0x3c844a=fs['createReadStream'](_0x4f3843);var _0xadcb90=fs['createWriteStream'](_0x5e6579);var _0x102df3=crypto[_0x467d('0x1c')](_0x35ae5c[_0x467d('0x9')],_0x2c79cd);_0x3c844a['on'](_0x467d('0x14'),function(_0x1eb4e2){var _0x141ef7=new Buffer(_0x102df3[_0x467d('0x15')](_0x1eb4e2),_0x467d('0x19'));_0xadcb90[_0x467d('0x16')](_0x141ef7);});_0x3c844a['on'](_0x467d('0x17'),function(){try{var _0x2e11a5=new Buffer(_0x102df3['final']('binary'),_0x467d('0x19'));_0xadcb90[_0x467d('0x16')](_0x2e11a5);_0xadcb90[_0x467d('0x17')]();_0xadcb90['on'](_0x467d('0x1a'),function(){return _0xf84346(_0x5e6579);});}catch(_0x498ae9){fs[_0x467d('0x1d')](_0x5e6579);return _0x34e674(_0x498ae9);}});});};exports['encryptString']=function(_0x2054e3,_0x368cd2,_0x5f549e){var _0x8d2e24=_0x5f549e||stringOptions[_0x467d('0x9')];var _0x373eee=_0x368cd2||stringOptions[_0x467d('0x1e')];var _0x4ead1f=crypto[_0x467d('0x13')](_0x8d2e24,_0x373eee);var _0xdf9442=_0x4ead1f['update'](_0x2054e3,_0x467d('0x1f'),_0x467d('0x20'));_0xdf9442+=_0x4ead1f['final']('base64');return _0xdf9442;};exports[_0x467d('0x21')]=function(_0x4d720b,_0x285228,_0x1bb3c0){var _0xc345d5=_0x1bb3c0||stringOptions[_0x467d('0x9')];var _0x54bef8=_0x285228||stringOptions[_0x467d('0x1e')];var _0x1fe953=crypto[_0x467d('0x1c')](_0xc345d5,_0x54bef8);var _0x2c47ba=_0x1fe953['update'](_0x4d720b,_0x467d('0x20'),_0x467d('0x1f'));_0x2c47ba+=_0x1fe953[_0x467d('0x18')](_0x467d('0x1f'));return _0x2c47ba;}; \ No newline at end of file +var _0x14b6=['lodash','../../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','indexOf','hasOwnProperty','encryptFile','createWriteStream','data','update','binary','end','final','write','close','unlink','decryptFile','createReadStream','encryptString','secret','createCipher','base64','createDecipher','utf8','crypto'];(function(_0x3b198f,_0x3bbce3){var _0xf8afb=function(_0x1acbd6){while(--_0x1acbd6){_0x3b198f['push'](_0x3b198f['shift']());}};_0xf8afb(++_0x3bbce3);}(_0x14b6,0x11f));var _0x614b=function(_0x2bb121,_0xb11dc1){_0x2bb121=_0x2bb121-0x0;var _0x10ec2a=_0x14b6[_0x2bb121];return _0x10ec2a;};'use strict';var crypto=require(_0x614b('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x614b('0x1'));var config=require(_0x614b('0x2'));var logger=require(_0x614b('0x3'))(_0x614b('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x614b('0x5')][_0x614b('0x6')],'algorithm':_0x614b('0x7')};const fileOptions={'algorithm':_0x614b('0x8')};if(config[_0x614b('0x9')]&&config[_0x614b('0x9')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x614b('0xa')]=config[_0x614b('0x9')][_0x614b('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x614b('0xb')](',\x20');logger[_0x614b('0xc')](config[_0x614b('0x9')]['algorithm'],_0x614b('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x3a2a30){return AES_SUPPORTED_RX[_0x614b('0xe')](_0x3a2a30);}function getSupportedCiphers(){return crypto[_0x614b('0xf')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x17ead5){return getSupportedCiphers()[_0x614b('0x10')](_0x17ead5)>-0x1;}function combineOptions(_0x213a56){var _0x3df9b8={};for(var _0xcbb4dd in fileOptions){if(fileOptions[_0x614b('0x11')](_0xcbb4dd)){_0x3df9b8[_0xcbb4dd]=fileOptions[_0xcbb4dd];}}if(_0x213a56){for(var _0x2c8a09 in _0x213a56){if(_0x213a56['hasOwnProperty'](_0x2c8a09)){_0x3df9b8[_0x2c8a09]=_0x213a56[_0x2c8a09];}}}return _0x3df9b8;}exports[_0x614b('0x12')]=function(_0x249b6c,_0xd81147,_0x5a1b93,_0x2af132){return new BPromise(function(_0x38abbd,_0x110be4){_0x2af132=combineOptions(_0x2af132);var _0x117885=new Buffer(_0x5a1b93);var _0xa880ce=fs['createReadStream'](_0x249b6c);var _0x30e14a=fs[_0x614b('0x13')](_0xd81147);var _0x21e278=crypto['createCipher'](_0x2af132['algorithm'],_0x117885);_0xa880ce['on'](_0x614b('0x14'),function(_0xe94329){var _0x13a2c6=new Buffer(_0x21e278[_0x614b('0x15')](_0xe94329),_0x614b('0x16'));_0x30e14a['write'](_0x13a2c6);});_0xa880ce['on'](_0x614b('0x17'),function(){try{var _0x10b1f7=new Buffer(_0x21e278[_0x614b('0x18')](_0x614b('0x16')),_0x614b('0x16'));_0x30e14a[_0x614b('0x19')](_0x10b1f7);_0x30e14a[_0x614b('0x17')]();_0x30e14a['on'](_0x614b('0x1a'),function(){return _0x38abbd(_0xd81147);});}catch(_0x6f7040){fs[_0x614b('0x1b')](_0xd81147);return _0x110be4(_0x6f7040);}});});};exports[_0x614b('0x1c')]=function(_0x11b7b6,_0x3349ba,_0x4c6506,_0x212667){return new BPromise(function(_0x5a1287,_0x49101f){_0x212667=combineOptions(_0x212667);var _0x36bef2=new Buffer(_0x4c6506);var _0x4c56a4=fs[_0x614b('0x1d')](_0x11b7b6);var _0x85ebfc=fs[_0x614b('0x13')](_0x3349ba);var _0x54af54=crypto['createDecipher'](_0x212667[_0x614b('0xa')],_0x36bef2);_0x4c56a4['on']('data',function(_0x28e544){var _0x1ca0db=new Buffer(_0x54af54[_0x614b('0x15')](_0x28e544),_0x614b('0x16'));_0x85ebfc[_0x614b('0x19')](_0x1ca0db);});_0x4c56a4['on']('end',function(){try{var _0xcbc22a=new Buffer(_0x54af54[_0x614b('0x18')](_0x614b('0x16')),'binary');_0x85ebfc[_0x614b('0x19')](_0xcbc22a);_0x85ebfc[_0x614b('0x17')]();_0x85ebfc['on'](_0x614b('0x1a'),function(){return _0x5a1287(_0x3349ba);});}catch(_0x8bc25a){fs['unlink'](_0x3349ba);return _0x49101f(_0x8bc25a);}});});};exports[_0x614b('0x1e')]=function(_0x2225f1,_0x5198a8,_0x22ff93){var _0x1e5eda=_0x22ff93||stringOptions['algorithm'];var _0x5c8728=_0x5198a8||stringOptions[_0x614b('0x1f')];var _0x570c2b=crypto[_0x614b('0x20')](_0x1e5eda,_0x5c8728);var _0x1bbee2=_0x570c2b[_0x614b('0x15')](_0x2225f1,'utf8',_0x614b('0x21'));_0x1bbee2+=_0x570c2b[_0x614b('0x18')](_0x614b('0x21'));return _0x1bbee2;};exports['decryptString']=function(_0x24db3d,_0x13aa54,_0x1121a5){var _0x32a614=_0x1121a5||stringOptions[_0x614b('0xa')];var _0x16d6c7=_0x13aa54||stringOptions[_0x614b('0x1f')];var _0x10124d=crypto[_0x614b('0x22')](_0x32a614,_0x16d6c7);var _0x1863b2=_0x10124d['update'](_0x24db3d,_0x614b('0x21'),_0x614b('0x23'));_0x1863b2+=_0x10124d[_0x614b('0x18')](_0x614b('0x23'));return _0x1863b2;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 633a712..5fe0123 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 _0x25d2=['range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','length','existsSync','join','mkdirSync','%s%d.%s','%s.%s','csv','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty'];(function(_0x15c69d,_0x3d94ec){var _0x4cad83=function(_0x1caa16){while(--_0x1caa16){_0x15c69d['push'](_0x15c69d['shift']());}};_0x4cad83(++_0x3d94ec);}(_0x25d2,0x1d5));var _0x225d=function(_0x1323b9,_0x12fa1a){_0x1323b9=_0x1323b9-0x0;var _0x587cf0=_0x25d2[_0x1323b9];return _0x587cf0;};'use strict';var util=require(_0x225d('0x0'));var path=require(_0x225d('0x1'));var _=require(_0x225d('0x2'));var csv=require(_0x225d('0x3'));var fs=require('fs');var BPromise=require(_0x225d('0x4'));var zipdir=require(_0x225d('0x5'));var rimraf=require(_0x225d('0x6'));var db=require(_0x225d('0x7'))['db'];var dbH=require(_0x225d('0x7'))[_0x225d('0x8')];var logger=require(_0x225d('0x9'))(_0x225d('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x225d('0xb')][0x3];var PATH=process[_0x225d('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x383818,_0x201391){var _0x2ab4b1={'status':_0x383818};var _0x8da964={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x201391){_0x2ab4b1[_0x225d('0xc')]=_0x201391;}return db[_0x225d('0xd')][_0x225d('0xe')](_0x2ab4b1,_0x8da964);}function main(){var _0x404b15=0x1388;var _0x429817;logger[_0x225d('0xf')](util[_0x225d('0x10')](_0x225d('0x11'),EXTRACTED_REPORT_ID,_0x225d('0x12')));return db[_0x225d('0x13')][_0x225d('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x225d('0x15'),_0x225d('0x16')]})[_0x225d('0x17')](function(_0x15aaf5){if(_0x15aaf5){_0x429817=_0x15aaf5;_0x404b15=_0x429817[_0x225d('0x16')]||0x1388;}})[_0x225d('0x17')](function(){return dbH[_0x225d('0x18')][_0x225d('0x19')](util[_0x225d('0x10')](_0x225d('0x1a'),QUERY),{'type':dbH[_0x225d('0x18')][_0x225d('0x1b')][_0x225d('0x1c')]});})[_0x225d('0x17')](function(_0x4cadb2){if(!_0x4cadb2[0x0][_0x225d('0x1d')]){return analyticExtractedReport(_0x225d('0x1e'));}var _0x4cea81=[];var _0x5bf0e5=0x0;if(_0x429817[_0x225d('0x15')]){if(_0x4cadb2&&_0x4cadb2['length']){var _0x1dece0=_[_0x225d('0x1f')](_0x4cadb2[0x0]['num']/_0x404b15);var _0x4ea832=Number[_0x225d('0x20')](_0x4cadb2[0x0][_0x225d('0x1d')]/_0x404b15)?_0x4cadb2[0x0][_0x225d('0x1d')]%_0x404b15:0x0;_0x1dece0[_0x225d('0x21')](function(_0x336daa){if(_0x336daa>0x0){_0x5bf0e5+=_0x404b15;}_0x4cea81['push'](dbH[_0x225d('0x18')][_0x225d('0x19')](util[_0x225d('0x10')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x404b15,_0x5bf0e5),{'type':dbH[_0x225d('0x18')][_0x225d('0x1b')][_0x225d('0x1c')]}));});if(_0x4ea832>0x0){_0x5bf0e5+=_0x404b15;_0x4cea81[_0x225d('0x22')](dbH[_0x225d('0x18')][_0x225d('0x19')](util[_0x225d('0x10')](_0x225d('0x23'),QUERY,_0x4ea832,_0x5bf0e5),{'type':dbH[_0x225d('0x18')][_0x225d('0x1b')][_0x225d('0x1c')]}));}}}else{_0x4cea81['push'](dbH[_0x225d('0x18')][_0x225d('0x19')](QUERY,{'type':dbH['sequelize'][_0x225d('0x1b')][_0x225d('0x1c')]}));}var _0x1570b9=path[_0x225d('0x24')](PATH);var _0xf4ee27=path['basename'](PATH,_0x225d('0x25'));var _0x575d5b=_0x429817[_0x225d('0x15')]&&_0x4cea81[_0x225d('0x26')]>0x1;var _0x1a7ed4=[];if(!fs[_0x225d('0x27')](path[_0x225d('0x28')](_0x1570b9,_0xf4ee27))&&_0x575d5b){fs[_0x225d('0x29')](path[_0x225d('0x28')](_0x1570b9,_0xf4ee27));}return BPromise['each'](_0x4cea81,function(_0x55fb58){_0x1a7ed4['push'](_0x55fb58);})[_0x225d('0x17')](function(){for(var _0x15d394=0x0;_0x15d394<_0x1a7ed4[_0x225d('0x26')];_0x15d394+=0x1){var _0x537b1a;var _0x1c2f54=_0x1a7ed4[_0x15d394];if(_0x575d5b){_0x537b1a=path[_0x225d('0x28')](_0x1570b9,_0xf4ee27,util[_0x225d('0x10')](_0x225d('0x2a'),_0xf4ee27,_0x15d394,'csv'));}else{_0x537b1a=path[_0x225d('0x28')](_0x1570b9,util[_0x225d('0x10')](_0x225d('0x2b'),_0xf4ee27,_0x225d('0x2c')));}fs['writeFileSync'](_0x537b1a,csv(_0x1c2f54));}})[_0x225d('0x17')](function(){if(_0x575d5b){return new Promise(function(_0x43ff96){zipdir(path[_0x225d('0x28')](_0x1570b9,_0xf4ee27),{'saveTo':path[_0x225d('0x28')](_0x1570b9,util[_0x225d('0x10')](_0x225d('0x2b'),_0xf4ee27,_0x225d('0x2d')))},function(_0x5d8097,_0x3809f4){rimraf(path['join'](_0x1570b9,_0xf4ee27),function(){});_0x43ff96(_0x225d('0x2e'));});});}})['then'](function(){logger[_0x225d('0xf')](util[_0x225d('0x10')](_0x225d('0x2f'),EXTRACTED_REPORT_ID,_0x225d('0x12')));return analyticExtractedReport(_0x225d('0x30'),_0x575d5b?util[_0x225d('0x10')](_0x225d('0x2b'),_0xf4ee27,_0x575d5b?_0x225d('0x2d'):_0x225d('0x2c')):null);});})['catch'](function(_0x5408f8){logger[_0x225d('0xf')](util[_0x225d('0x10')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x225d('0x12')),util['inspect'](_0x5408f8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x225d('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xcff1=['join','%s%d.%s','csv','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','basename','length','existsSync','mkdirSync'];(function(_0x292688,_0x4ed5d4){var _0x12f117=function(_0x528959){while(--_0x528959){_0x292688['push'](_0x292688['shift']());}};_0x12f117(++_0x4ed5d4);}(_0xcff1,0x162));var _0x1cff=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xcff1[_0x5f1391];return _0x50ebe3;};'use strict';var util=require(_0x1cff('0x0'));var path=require(_0x1cff('0x1'));var _=require(_0x1cff('0x2'));var csv=require(_0x1cff('0x3'));var fs=require('fs');var BPromise=require(_0x1cff('0x4'));var zipdir=require(_0x1cff('0x5'));var rimraf=require(_0x1cff('0x6'));var db=require(_0x1cff('0x7'))['db'];var dbH=require('../../mysqldb')[_0x1cff('0x8')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x1cff('0x9')][0x2]);var QUERY=process[_0x1cff('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x42f1e1,_0x4aef5e){var _0xe470b5={'status':_0x42f1e1};var _0xd32338={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4aef5e){_0xe470b5[_0x1cff('0xa')]=_0x4aef5e;}return db[_0x1cff('0xb')][_0x1cff('0xc')](_0xe470b5,_0xd32338);}function main(){var _0x118e23=0x1388;var _0x4db26b;logger[_0x1cff('0xd')](util['format'](_0x1cff('0xe'),EXTRACTED_REPORT_ID,_0x1cff('0xf')));return db[_0x1cff('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1cff('0x11'),_0x1cff('0x12')]})[_0x1cff('0x13')](function(_0xb1ca19){if(_0xb1ca19){_0x4db26b=_0xb1ca19;_0x118e23=_0x4db26b['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x1cff('0x14')][_0x1cff('0x15')](util[_0x1cff('0x16')](_0x1cff('0x17'),QUERY),{'type':dbH['sequelize'][_0x1cff('0x18')]['SELECT']});})[_0x1cff('0x13')](function(_0x25ff8b){if(!_0x25ff8b[0x0][_0x1cff('0x19')]){return analyticExtractedReport(_0x1cff('0x1a'));}var _0x5806ae=[];var _0x38188f=0x0;if(_0x4db26b[_0x1cff('0x11')]){if(_0x25ff8b&&_0x25ff8b['length']){var _0x1f6e5d=_[_0x1cff('0x1b')](_0x25ff8b[0x0]['num']/_0x118e23);var _0x24bbfb=Number[_0x1cff('0x1c')](_0x25ff8b[0x0]['num']/_0x118e23)?_0x25ff8b[0x0][_0x1cff('0x19')]%_0x118e23:0x0;_0x1f6e5d[_0x1cff('0x1d')](function(_0x184505){if(_0x184505>0x0){_0x38188f+=_0x118e23;}_0x5806ae['push'](dbH[_0x1cff('0x14')]['query'](util[_0x1cff('0x16')](_0x1cff('0x1e'),QUERY,_0x118e23,_0x38188f),{'type':dbH['sequelize'][_0x1cff('0x18')][_0x1cff('0x1f')]}));});if(_0x24bbfb>0x0){_0x38188f+=_0x118e23;_0x5806ae[_0x1cff('0x20')](dbH[_0x1cff('0x14')][_0x1cff('0x15')](util[_0x1cff('0x16')](_0x1cff('0x1e'),QUERY,_0x24bbfb,_0x38188f),{'type':dbH[_0x1cff('0x14')]['QueryTypes'][_0x1cff('0x1f')]}));}}}else{_0x5806ae['push'](dbH[_0x1cff('0x14')]['query'](QUERY,{'type':dbH['sequelize'][_0x1cff('0x18')][_0x1cff('0x1f')]}));}var _0x334619=path[_0x1cff('0x21')](PATH);var _0x2e604a=path[_0x1cff('0x22')](PATH,'.csv');var _0x3cd885=_0x4db26b[_0x1cff('0x11')]&&_0x5806ae[_0x1cff('0x23')]>0x1;var _0x5e745d=[];if(!fs[_0x1cff('0x24')](path['join'](_0x334619,_0x2e604a))&&_0x3cd885){fs[_0x1cff('0x25')](path[_0x1cff('0x26')](_0x334619,_0x2e604a));}return BPromise['each'](_0x5806ae,function(_0x694286){_0x5e745d['push'](_0x694286);})[_0x1cff('0x13')](function(){for(var _0x3361f2=0x0;_0x3361f2<_0x5e745d[_0x1cff('0x23')];_0x3361f2+=0x1){var _0x428085;var _0x450c77=_0x5e745d[_0x3361f2];if(_0x3cd885){_0x428085=path['join'](_0x334619,_0x2e604a,util[_0x1cff('0x16')](_0x1cff('0x27'),_0x2e604a,_0x3361f2,_0x1cff('0x28')));}else{_0x428085=path[_0x1cff('0x26')](_0x334619,util[_0x1cff('0x16')](_0x1cff('0x29'),_0x2e604a,_0x1cff('0x28')));}fs['writeFileSync'](_0x428085,csv(_0x450c77));}})[_0x1cff('0x13')](function(){if(_0x3cd885){return new Promise(function(_0x452776){zipdir(path[_0x1cff('0x26')](_0x334619,_0x2e604a),{'saveTo':path[_0x1cff('0x26')](_0x334619,util['format'](_0x1cff('0x29'),_0x2e604a,'zip'))},function(_0x374585,_0x3440fc){rimraf(path[_0x1cff('0x26')](_0x334619,_0x2e604a),function(){});_0x452776(_0x1cff('0x2a'));});});}})['then'](function(){logger[_0x1cff('0xd')](util[_0x1cff('0x16')](_0x1cff('0x2b'),EXTRACTED_REPORT_ID,_0x1cff('0xf')));return analyticExtractedReport('Completed',_0x3cd885?util['format']('%s.%s',_0x2e604a,_0x3cd885?_0x1cff('0x2c'):_0x1cff('0x28')):null);});})[_0x1cff('0x2d')](function(_0x26061e){logger[_0x1cff('0xd')](util[_0x1cff('0x16')](_0x1cff('0x2e'),EXTRACTED_REPORT_ID,'CSV'),util[_0x1cff('0x2f')](_0x26061e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1cff('0x30'));})['finally'](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 251cff2..159607f 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 _0xd0ca=['findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','length','auto','body','push','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','before','margin','landscape','\x20/\x20','footer','Arial','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','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'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xd0ca,0xcd));var _0xad0c=function(_0x535f4e,_0x53ec09){_0x535f4e=_0x535f4e-0x0;var _0x31a577=_0xd0ca[_0x535f4e];return _0x31a577;};'use strict';var _=require(_0xad0c('0x0'));var fs=require('fs');var util=require(_0xad0c('0x1'));var path=require(_0xad0c('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xad0c('0x3'));var PdfPrinter=require(_0xad0c('0x4'));var zipdir=require(_0xad0c('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0xad0c('0x6'))[_0xad0c('0x7')];var window=new JSDOM('')[_0xad0c('0x8')];var BPromise=require(_0xad0c('0x9'));var db=require(_0xad0c('0xa'))['db'];var dbH=require(_0xad0c('0xa'))[_0xad0c('0xb')];var logger=require(_0xad0c('0xc'))(_0xad0c('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xad0c('0xe')][0x2]);var QUERY=process[_0xad0c('0xe')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xad0c('0xe')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x259f99,_0x5f0634){var _0x58f54f={'status':_0x259f99};var _0x20a163={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5f0634){_0x58f54f[_0xad0c('0xf')]=_0x5f0634;}return db[_0xad0c('0x10')][_0xad0c('0x11')](_0x58f54f,_0x20a163);}function getHeaders(_0x2cec8b){return _[_0xad0c('0x12')](_0x2cec8b,function(_0x527745){return{'text':_0x527745,'style':_0xad0c('0x13')};});}function getRows(_0x41e564,_0x3cb987){return _[_0xad0c('0x12')](_0x3cb987,function(_0x3a826b){return _(_0x3a826b)[_0xad0c('0x14')](_0x41e564)[_0xad0c('0x12')](function(_0x4b37fd){return _0x4b37fd?_[_0xad0c('0x15')](_0x4b37fd):'';})[_0xad0c('0x16')]();});}function createTable(_0x36da10,_0x3a5343){var _0x4be8d9={'widths':_['fill'](Array(_0x36da10[_0xad0c('0x17')]),0x91),'heights':function(_0x2a5e71){return _0x2a5e71===0x0?_0xad0c('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x18780e=getHeaders(_0x36da10);_0x4be8d9[_0xad0c('0x19')][_0xad0c('0x1a')](_0x18780e);var _0x591e6e=getRows(_0x36da10,_0x3a5343);_0x4be8d9[_0xad0c('0x19')]=_0x4be8d9['body']['concat'](_0x591e6e);return _0x4be8d9;}function createTables(_0x39dd9e){var _0x541191=[];var _0x2ee903=_['chunk'](Object[_0xad0c('0x1b')](_0x39dd9e[0x0]),0x5);_0x2ee903[_0xad0c('0x1c')](function(_0x1c75a4){_0x541191['push'](createTable(_0x1c75a4,_0x39dd9e));});return _0x541191;}function getPDFDocDefinition(_0x4b255c){var _0x51f9b6=util[_0xad0c('0x1d')](_0xad0c('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xad0c('0x1f')])[_0xad0c('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0xad0c('0x20')])[_0xad0c('0x1d')](FORMAT));var _0x38287a=[];for(var _0x3ae6f2=0x0;_0x3ae6f2<_0x4b255c[_0xad0c('0x17')];_0x3ae6f2++){var _0x928409=[];if(_0x3ae6f2===0x0){_0x928409[_0xad0c('0x1a')]({'text':_0x51f9b6,'style':_0xad0c('0x21')});}var _0x4d88bb={'table':_0x4b255c[_0x3ae6f2]};if(_0x3ae6f2>0x0){_0x4d88bb['pageBreak']=_0xad0c('0x22');_0x4d88bb[_0xad0c('0x23')]=[0x0,0x46,0x0,0x0];}_0x928409[_0xad0c('0x1a')](_0x4d88bb);_0x38287a[_0xad0c('0x1a')](_0x928409);}return{'pageSize':'A4','pageOrientation':_0xad0c('0x24'),'content':_0x38287a,'footer':function(_0x2f9389,_0x5c150a){return{'text':_0x2f9389[_0xad0c('0x15')]()+_0xad0c('0x25')+_0x5c150a,'style':_0xad0c('0x26')};},'defaultStyle':{'font':_0xad0c('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4d92d4){var _0x2244cb=0x1388;var _0xb1b344;if(!_0x4d92d4[0x0][_0xad0c('0x28')]){return analyticExtractedReport(_0xad0c('0x29'));}return db[_0xad0c('0x2a')][_0xad0c('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xad0c('0x2c')]})[_0xad0c('0x2d')](function(_0x40ecd3){if(_0x40ecd3){_0xb1b344=_0x40ecd3;_0x2244cb=_0xb1b344[_0xad0c('0x2c')]||0x3e8;}})['then'](function(){var _0x567494=[];var _0xe3b86d=0x0;if(_0xb1b344[_0xad0c('0x2e')]){if(_0x4d92d4&&_0x4d92d4[_0xad0c('0x17')]){var _0x5bd35e=_[_0xad0c('0x2f')](_0x4d92d4[0x0][_0xad0c('0x28')]/_0x2244cb);var _0x2b62bd=Number[_0xad0c('0x30')](_0x4d92d4[0x0][_0xad0c('0x28')]/_0x2244cb)?_0x4d92d4[0x0][_0xad0c('0x28')]%_0x2244cb:0x0;_0x5bd35e['forEach'](function(_0x16b232){if(_0x16b232>0x0){_0xe3b86d+=_0x2244cb;}_0x567494[_0xad0c('0x1a')](dbH[_0xad0c('0x31')][_0xad0c('0x32')](util[_0xad0c('0x1d')](_0xad0c('0x33'),QUERY,_0x2244cb,_0xe3b86d),{'type':dbH['sequelize'][_0xad0c('0x34')][_0xad0c('0x35')]}));});if(_0x2b62bd>0x0){_0xe3b86d+=_0x2244cb;_0x567494['push'](dbH[_0xad0c('0x31')][_0xad0c('0x32')](util[_0xad0c('0x1d')](_0xad0c('0x33'),QUERY,_0x2b62bd,_0xe3b86d),{'type':dbH[_0xad0c('0x31')][_0xad0c('0x34')][_0xad0c('0x35')]}));}}}else{_0x567494['push'](dbH[_0xad0c('0x31')][_0xad0c('0x32')](QUERY,{'type':dbH[_0xad0c('0x31')][_0xad0c('0x34')][_0xad0c('0x35')]}));}var _0x26b9c8=path[_0xad0c('0x36')](PATH);var _0x4623e8=path[_0xad0c('0x37')](PATH,_0xad0c('0x38'));var _0x20db7d=_0xb1b344[_0xad0c('0x2e')]&&_0x567494['length']>0x1;var _0x1eb9e1=[];if(!fs[_0xad0c('0x39')](path[_0xad0c('0x3a')](_0x26b9c8,_0x4623e8))&&_0x20db7d){fs[_0xad0c('0x3b')](path[_0xad0c('0x3a')](_0x26b9c8,_0x4623e8));}return BPromise[_0xad0c('0x3c')](_0x567494,function(_0x830d70){_0x1eb9e1[_0xad0c('0x1a')](_0x830d70);})['then'](function(){var _0x5a796c=[];for(var _0x3b86ef=0x0;_0x3b86ef<_0x1eb9e1['length'];_0x3b86ef+=0x1){var _0x60ae46=_0x1eb9e1[_0x3b86ef];var _0xc57428=createTables(_[_0xad0c('0x3d')](_0x60ae46));var _0x52b9b4;var _0x8625a2=getPDFDocDefinition(_0xc57428);var _0x43dcf7=getPDFPrinter();var _0x4e5f33=_0x43dcf7[_0xad0c('0x3e')](_0x8625a2);if(_0x20db7d){_0x52b9b4=path['join'](_0x26b9c8,_0x4623e8,util[_0xad0c('0x1d')](_0xad0c('0x3f'),_0x4623e8,_0x3b86ef,_0xad0c('0x40')));}else{_0x52b9b4=path[_0xad0c('0x3a')](_0x26b9c8,util[_0xad0c('0x1d')](_0xad0c('0x41'),_0x4623e8,'pdf'));}_0x5a796c[_0xad0c('0x1a')](writePDFDocument(_0x4e5f33,_0x52b9b4));}return Promise[_0xad0c('0x42')](_0x5a796c);})[_0xad0c('0x2d')](function(){if(_0x20db7d){return new Promise(function(_0xdb0578){zipdir(path['join'](_0x26b9c8,_0x4623e8),{'saveTo':path[_0xad0c('0x3a')](_0x26b9c8,util[_0xad0c('0x1d')](_0xad0c('0x41'),_0x4623e8,_0xad0c('0x43')))},function(){rimraf(path['join'](_0x26b9c8,_0x4623e8),function(){});_0xdb0578(_0xad0c('0x44'));});});}})[_0xad0c('0x2d')](function(){if(!_0x20db7d)return;rimraf(path[_0xad0c('0x3a')](_0x26b9c8,_0x4623e8),function(){});})[_0xad0c('0x2d')](function(){logger[_0xad0c('0x45')](util[_0xad0c('0x1d')](_0xad0c('0x46'),EXTRACTED_REPORT_ID,_0xad0c('0x47')));return analyticExtractedReport(_0xad0c('0x48'),_0x20db7d?util['format']('%s.%s',_0x4623e8,_0x20db7d?_0xad0c('0x43'):_0xad0c('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xad0c('0x45')](util[_0xad0c('0x1d')](_0xad0c('0x49'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xad0c('0x10')][_0xad0c('0x4a')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x30b06c){EXTRACTED_REPORT=_0x30b06c;return dbH[_0xad0c('0x31')][_0xad0c('0x32')](util[_0xad0c('0x1d')](_0xad0c('0x4b'),QUERY),{'type':dbH['sequelize'][_0xad0c('0x34')][_0xad0c('0x35')]});})[_0xad0c('0x2d')](extractReport)['catch'](function(_0x3dcfb1){logger[_0xad0c('0x45')](util[_0xad0c('0x1d')](_0xad0c('0x4c'),EXTRACTED_REPORT_ID,_0xad0c('0x47')),util[_0xad0c('0x4d')](_0x3dcfb1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xad0c('0x4e'));})[_0xad0c('0x4f')](function(){process[_0xad0c('0x50')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4e7a85=new PdfPrinter({'Arial':{'normal':__dirname+_0xad0c('0x51'),'bold':__dirname+_0xad0c('0x52'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x4e7a85;}function getPDFDocDefinitionFromHTML(_0x315ae8,_0x228200){var _0x9dd9b=util[_0xad0c('0x1d')](_0xad0c('0x53'),_0x228200[_0xad0c('0x54')],_0x228200[_0xad0c('0x55')]);var _0x1e5865=moment()[_0xad0c('0x1d')](_0xad0c('0x56'))[_0xad0c('0x15')]();var _0x232db5=htmlToPdfmake(_0x315ae8,{'window':window,'tableAutoSize':!![]});return{'content':[_0x232db5],'defaultStyle':{'font':_0xad0c('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xad0c('0x57'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xad0c('0x21')}];},'footer':function(_0x407918,_0x410b6e){return[{'text':util[_0xad0c('0x1d')](_0xad0c('0x58'),_0x9dd9b,_0x407918,_0x410b6e,_0x1e5865),'style':'footer'}];}};}function writePDFDocument(_0x34f21a,_0x323e76){return new Promise(function(_0x2cc3f1,_0x312fa0){var _0xbc6d51=_0x34f21a[_0xad0c('0x59')](fs[_0xad0c('0x5a')](_0x323e76));_0xbc6d51['on'](_0xad0c('0x5b'),function(){_0x2cc3f1('finish');});_0xbc6d51['on'](_0xad0c('0x5c'),function(_0x3fcd90){_0x312fa0(_0x3fcd90);});_0x34f21a['end']();});}exports['createPdfFromHTML']=function(_0x322b73,_0x3a0812){var _0x535025=getPDFPrinter();var _0x28d065=getPDFDocDefinitionFromHTML(_0x322b73,_0x3a0812);var _0x6fd94a=_0x535025[_0xad0c('0x3e')](_0x28d065);return writePDFDocument(_0x6fd94a,_0x3a0812[_0xad0c('0x2')])['catch'](function(_0x1f3c95){throw _0x1f3c95;});}; \ No newline at end of file +var _0x1aa4=['end','createPdfFromHTML','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','tableHeader','map','toString','fill','length','body','concat','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Setting','find','split','splitSizePdf','then','isInteger','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip\x20finished','info','PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x1aa4,0xb2));var _0x41aa=function(_0x512f08,_0x37d948){_0x512f08=_0x512f08-0x0;var _0x2c7e15=_0x1aa4[_0x512f08];return _0x2c7e15;};'use strict';var _=require(_0x41aa('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x41aa('0x1'));var moment=require(_0x41aa('0x2'));var htmlToPdfmake=require(_0x41aa('0x3'));var PdfPrinter=require(_0x41aa('0x4'));var zipdir=require(_0x41aa('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x41aa('0x6'))[_0x41aa('0x7')];var window=new JSDOM('')[_0x41aa('0x8')];var BPromise=require(_0x41aa('0x9'));var db=require(_0x41aa('0xa'))['db'];var dbH=require('../../mysqldb')[_0x41aa('0xb')];var logger=require('../../config/logger')(_0x41aa('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x41aa('0xd')][0x2]);var QUERY=process[_0x41aa('0xd')][0x3];var PATH=process[_0x41aa('0xd')][0x4];var NAME=process[_0x41aa('0xd')][0x5];var FORMAT=_0x41aa('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1795a1,_0x5723ac){var _0x1f5eb3={'status':_0x1795a1};var _0x1d1efe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5723ac){_0x1f5eb3['savename']=_0x5723ac;}return db[_0x41aa('0xf')][_0x41aa('0x10')](_0x1f5eb3,_0x1d1efe);}function getHeaders(_0x57b76f){return _['map'](_0x57b76f,function(_0x314941){return{'text':_0x314941,'style':_0x41aa('0x11')};});}function getRows(_0x2f29cd,_0x1ac0cc){return _['map'](_0x1ac0cc,function(_0x4ed603){return _(_0x4ed603)['pick'](_0x2f29cd)[_0x41aa('0x12')](function(_0x30b842){return _0x30b842?_[_0x41aa('0x13')](_0x30b842):'';})['value']();});}function createTable(_0x2bdb9d,_0x25de09){var _0x57fd38={'widths':_[_0x41aa('0x14')](Array(_0x2bdb9d[_0x41aa('0x15')]),0x91),'heights':function(_0x12737f){return _0x12737f===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3aee13=getHeaders(_0x2bdb9d);_0x57fd38[_0x41aa('0x16')]['push'](_0x3aee13);var _0x5dca75=getRows(_0x2bdb9d,_0x25de09);_0x57fd38[_0x41aa('0x16')]=_0x57fd38[_0x41aa('0x16')][_0x41aa('0x17')](_0x5dca75);return _0x57fd38;}function createTables(_0x148b38){var _0x1caf55=[];var _0x49c028=_['chunk'](Object[_0x41aa('0x18')](_0x148b38[0x0]),0x5);_0x49c028[_0x41aa('0x19')](function(_0x295d80){_0x1caf55[_0x41aa('0x1a')](createTable(_0x295d80,_0x148b38));});return _0x1caf55;}function getPDFDocDefinition(_0x432e98){var _0x244c00=util[_0x41aa('0x1b')](_0x41aa('0x1c'),NAME,EXTRACTED_REPORT[_0x41aa('0x1d')],moment(EXTRACTED_REPORT['startDate'])[_0x41aa('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x41aa('0x1e')])[_0x41aa('0x1b')](FORMAT));var _0xdfc6e8=[];for(var _0x353388=0x0;_0x353388<_0x432e98['length'];_0x353388++){var _0x3038f4=[];if(_0x353388===0x0){_0x3038f4['push']({'text':_0x244c00,'style':'header'});}var _0x4bcf32={'table':_0x432e98[_0x353388]};if(_0x353388>0x0){_0x4bcf32['pageBreak']=_0x41aa('0x1f');_0x4bcf32[_0x41aa('0x20')]=[0x0,0x46,0x0,0x0];}_0x3038f4[_0x41aa('0x1a')](_0x4bcf32);_0xdfc6e8[_0x41aa('0x1a')](_0x3038f4);}return{'pageSize':'A4','pageOrientation':_0x41aa('0x21'),'content':_0xdfc6e8,'footer':function(_0x43e5ce,_0x49e562){return{'text':_0x43e5ce[_0x41aa('0x13')]()+_0x41aa('0x22')+_0x49e562,'style':_0x41aa('0x23')};},'defaultStyle':{'font':_0x41aa('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x41aa('0x25')},'footer':{'alignment':_0x41aa('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x22599f){var _0x11aa7d=0x1388;var _0xe8c7fb;if(!_0x22599f[0x0][_0x41aa('0x27')]){return analyticExtractedReport('Empty');}return db[_0x41aa('0x28')][_0x41aa('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x41aa('0x2a'),_0x41aa('0x2b')]})[_0x41aa('0x2c')](function(_0xa8b6b8){if(_0xa8b6b8){_0xe8c7fb=_0xa8b6b8;_0x11aa7d=_0xe8c7fb[_0x41aa('0x2b')]||0x3e8;}})[_0x41aa('0x2c')](function(){var _0x57f3a6=[];var _0x3ffd69=0x0;if(_0xe8c7fb[_0x41aa('0x2a')]){if(_0x22599f&&_0x22599f['length']){var _0x57cd12=_['range'](_0x22599f[0x0][_0x41aa('0x27')]/_0x11aa7d);var _0x594730=Number[_0x41aa('0x2d')](_0x22599f[0x0][_0x41aa('0x27')]/_0x11aa7d)?_0x22599f[0x0][_0x41aa('0x27')]%_0x11aa7d:0x0;_0x57cd12['forEach'](function(_0x2f375c){if(_0x2f375c>0x0){_0x3ffd69+=_0x11aa7d;}_0x57f3a6['push'](dbH[_0x41aa('0x2e')][_0x41aa('0x2f')](util[_0x41aa('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x11aa7d,_0x3ffd69),{'type':dbH[_0x41aa('0x2e')][_0x41aa('0x30')][_0x41aa('0x31')]}));});if(_0x594730>0x0){_0x3ffd69+=_0x11aa7d;_0x57f3a6[_0x41aa('0x1a')](dbH[_0x41aa('0x2e')][_0x41aa('0x2f')](util[_0x41aa('0x1b')](_0x41aa('0x32'),QUERY,_0x594730,_0x3ffd69),{'type':dbH['sequelize'][_0x41aa('0x30')]['SELECT']}));}}}else{_0x57f3a6['push'](dbH[_0x41aa('0x2e')][_0x41aa('0x2f')](QUERY,{'type':dbH['sequelize'][_0x41aa('0x30')][_0x41aa('0x31')]}));}var _0x431205=path[_0x41aa('0x33')](PATH);var _0x5c0504=path[_0x41aa('0x34')](PATH,_0x41aa('0x35'));var _0x39e445=_0xe8c7fb[_0x41aa('0x2a')]&&_0x57f3a6[_0x41aa('0x15')]>0x1;var _0x34b995=[];if(!fs[_0x41aa('0x36')](path[_0x41aa('0x37')](_0x431205,_0x5c0504))&&_0x39e445){fs['mkdirSync'](path['join'](_0x431205,_0x5c0504));}return BPromise[_0x41aa('0x38')](_0x57f3a6,function(_0x48adeb){_0x34b995[_0x41aa('0x1a')](_0x48adeb);})['then'](function(){var _0x122329=[];for(var _0x1c97d8=0x0;_0x1c97d8<_0x34b995[_0x41aa('0x15')];_0x1c97d8+=0x1){var _0x58dcf1=_0x34b995[_0x1c97d8];var _0x2f90ce=createTables(_[_0x41aa('0x39')](_0x58dcf1));var _0x2ea2b2;var _0x3ec0b5=getPDFDocDefinition(_0x2f90ce);var _0x57f5b6=getPDFPrinter();var _0x6cd3e8=_0x57f5b6[_0x41aa('0x3a')](_0x3ec0b5);if(_0x39e445){_0x2ea2b2=path['join'](_0x431205,_0x5c0504,util['format'](_0x41aa('0x3b'),_0x5c0504,_0x1c97d8,_0x41aa('0x3c')));}else{_0x2ea2b2=path[_0x41aa('0x37')](_0x431205,util[_0x41aa('0x1b')](_0x41aa('0x3d'),_0x5c0504,_0x41aa('0x3c')));}_0x122329['push'](writePDFDocument(_0x6cd3e8,_0x2ea2b2));}return Promise[_0x41aa('0x3e')](_0x122329);})[_0x41aa('0x2c')](function(){if(_0x39e445){return new Promise(function(_0x4026e1){zipdir(path[_0x41aa('0x37')](_0x431205,_0x5c0504),{'saveTo':path[_0x41aa('0x37')](_0x431205,util[_0x41aa('0x1b')]('%s.%s',_0x5c0504,'zip'))},function(){rimraf(path['join'](_0x431205,_0x5c0504),function(){});_0x4026e1(_0x41aa('0x3f'));});});}})[_0x41aa('0x2c')](function(){if(!_0x39e445)return;rimraf(path[_0x41aa('0x37')](_0x431205,_0x5c0504),function(){});})['then'](function(){logger[_0x41aa('0x40')](util[_0x41aa('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x41aa('0x41')));return analyticExtractedReport(_0x41aa('0x42'),_0x39e445?util[_0x41aa('0x1b')](_0x41aa('0x3d'),_0x5c0504,_0x39e445?'zip':_0x41aa('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x41aa('0x40')](util[_0x41aa('0x1b')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x41aa('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x41aa('0x2c')](function(_0x352712){EXTRACTED_REPORT=_0x352712;return dbH[_0x41aa('0x2e')]['query'](util['format'](_0x41aa('0x44'),QUERY),{'type':dbH[_0x41aa('0x2e')]['QueryTypes'][_0x41aa('0x31')]});})[_0x41aa('0x2c')](extractReport)[_0x41aa('0x45')](function(_0x46f6c2){logger[_0x41aa('0x40')](util[_0x41aa('0x1b')](_0x41aa('0x46'),EXTRACTED_REPORT_ID,'PDF'),util[_0x41aa('0x47')](_0x46f6c2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x41aa('0x48'));})['finally'](function(){process[_0x41aa('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1af96b=new PdfPrinter({'Arial':{'normal':__dirname+_0x41aa('0x4a'),'bold':__dirname+_0x41aa('0x4b'),'italics':__dirname+_0x41aa('0x4c'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x1af96b;}function getPDFDocDefinitionFromHTML(_0x11fa14,_0x19c543){var _0x24e438=util['format'](_0x41aa('0x4d'),_0x19c543[_0x41aa('0x4e')],_0x19c543[_0x41aa('0x4f')]);var _0x25e6ea=moment()[_0x41aa('0x1b')](_0x41aa('0x50'))[_0x41aa('0x13')]();var _0x21ed14=htmlToPdfmake(_0x11fa14,{'window':window,'tableAutoSize':!![]});return{'content':[_0x21ed14],'defaultStyle':{'font':_0x41aa('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x41aa('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x41aa('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x41aa('0x51')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x305058,_0x50c351){return[{'text':util['format'](_0x41aa('0x52'),_0x24e438,_0x305058,_0x50c351,_0x25e6ea),'style':'footer'}];}};}function writePDFDocument(_0x1aa507,_0x27f82e){return new Promise(function(_0x5780c0,_0xbda84){var _0x52060e=_0x1aa507['pipe'](fs[_0x41aa('0x53')](_0x27f82e));_0x52060e['on'](_0x41aa('0x54'),function(){_0x5780c0(_0x41aa('0x54'));});_0x52060e['on'](_0x41aa('0x55'),function(_0x1360ac){_0xbda84(_0x1360ac);});_0x1aa507[_0x41aa('0x56')]();});}exports[_0x41aa('0x57')]=function(_0x3d3651,_0x3b00d3){var _0x2d5e53=getPDFPrinter();var _0x4d6aed=getPDFDocDefinitionFromHTML(_0x3d3651,_0x3b00d3);var _0x20d42c=_0x2d5e53['createPdfKitDocument'](_0x4d6aed);return writePDFDocument(_0x20d42c,_0x3b00d3[_0x41aa('0x1')])[_0x41aa('0x45')](function(_0x1006c6){throw _0x1006c6;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index eb5621d..200dbc8 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 _0xd552=['json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','XLSX','find','splitSizeXlsx','then','sequelize','QueryTypes','SELECT','num','length','range','isInteger','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','split','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','xlsx','inspect','Failed','finally','exit','util','path','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd552,0x185));var _0x2d55=function(_0x12709a,_0x4eff5c){_0x12709a=_0x12709a-0x0;var _0x5a500d=_0xd552[_0x12709a];return _0x5a500d;};'use strict';var util=require(_0x2d55('0x0'));var path=require(_0x2d55('0x1'));var _=require(_0x2d55('0x2'));var fs=require('fs');var json2xls=require(_0x2d55('0x3'));var BPromise=require(_0x2d55('0x4'));var zipdir=require(_0x2d55('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x2d55('0x6'))[_0x2d55('0x7')];var logger=require(_0x2d55('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x2d55('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x2d55('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x26d1ba,_0x31ac0a){var _0x331217={'status':_0x26d1ba};var _0x2ca138={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x31ac0a){_0x331217[_0x2d55('0xa')]=_0x31ac0a;}return db[_0x2d55('0xb')]['update'](_0x331217,_0x2ca138);}function main(){var _0x371524=0x1388;var _0x5847b5;logger[_0x2d55('0xc')](util[_0x2d55('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2d55('0xe')));return db['Setting'][_0x2d55('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x2d55('0x10')]})['then'](function(_0x274352){if(_0x274352){_0x5847b5=_0x274352;_0x371524=_0x5847b5[_0x2d55('0x10')]||0x1388;}})[_0x2d55('0x11')](function(){return dbH[_0x2d55('0x12')]['query'](util[_0x2d55('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x2d55('0x12')][_0x2d55('0x13')][_0x2d55('0x14')]});})[_0x2d55('0x11')](function(_0x41402f){if(!_0x41402f[0x0][_0x2d55('0x15')]){return analyticExtractedReport('Empty');}var _0x22ff9a=[];var _0x148f78=0x0;if(_0x5847b5['split']){if(_0x41402f&&_0x41402f[_0x2d55('0x16')]){var _0x29c93f=_[_0x2d55('0x17')](_0x41402f[0x0][_0x2d55('0x15')]/_0x371524);var _0x5a5563=Number[_0x2d55('0x18')](_0x41402f[0x0][_0x2d55('0x15')]/_0x371524)?_0x41402f[0x0][_0x2d55('0x15')]%_0x371524:0x0;_0x29c93f['forEach'](function(_0x4afb49){if(_0x4afb49>0x0){_0x148f78+=_0x371524;}_0x22ff9a[_0x2d55('0x19')](dbH[_0x2d55('0x12')][_0x2d55('0x1a')](util[_0x2d55('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x371524,_0x148f78),{'type':dbH[_0x2d55('0x12')][_0x2d55('0x13')][_0x2d55('0x14')]}));});if(_0x5a5563>0x0){_0x148f78+=_0x371524;_0x22ff9a[_0x2d55('0x19')](dbH['sequelize']['query'](util['format'](_0x2d55('0x1b'),QUERY,_0x5a5563,_0x148f78),{'type':dbH[_0x2d55('0x12')][_0x2d55('0x13')][_0x2d55('0x14')]}));}}}else{_0x22ff9a['push'](dbH[_0x2d55('0x12')][_0x2d55('0x1a')](QUERY,{'type':dbH[_0x2d55('0x12')][_0x2d55('0x13')][_0x2d55('0x14')]}));}var _0x12223e=path[_0x2d55('0x1c')](PATH);var _0x3d51d2=path[_0x2d55('0x1d')](PATH,_0x2d55('0x1e'));var _0x5a545d=_0x5847b5[_0x2d55('0x1f')]&&_0x22ff9a[_0x2d55('0x16')]>0x1;var _0x1bcc48=[];if(!fs[_0x2d55('0x20')](path[_0x2d55('0x21')](_0x12223e,_0x3d51d2))&&_0x5a545d){fs[_0x2d55('0x22')](path[_0x2d55('0x21')](_0x12223e,_0x3d51d2));}return BPromise[_0x2d55('0x23')](_0x22ff9a,function(_0x11ffab){_0x1bcc48['push'](_0x11ffab);})[_0x2d55('0x11')](function(){for(var _0x2e0b12=0x0;_0x2e0b12<_0x1bcc48[_0x2d55('0x16')];_0x2e0b12+=0x1){var _0xa2885b;var _0x546779=_0x1bcc48[_0x2e0b12];if(_0x5a545d){_0xa2885b=path[_0x2d55('0x21')](_0x12223e,_0x3d51d2,util[_0x2d55('0xd')](_0x2d55('0x24'),_0x3d51d2,_0x2e0b12,'xlsx'));}else{_0xa2885b=path[_0x2d55('0x21')](_0x12223e,util[_0x2d55('0xd')](_0x2d55('0x25'),_0x3d51d2,'xlsx'));}fs[_0x2d55('0x26')](_0xa2885b,json2xls(_0x546779),_0x2d55('0x27'));}})[_0x2d55('0x11')](function(){if(_0x5a545d){return new Promise(function(_0x2755a4){zipdir(path['join'](_0x12223e,_0x3d51d2),{'saveTo':path[_0x2d55('0x21')](_0x12223e,util[_0x2d55('0xd')]('%s.%s',_0x3d51d2,'zip'))},function(_0x520173,_0x2bb124){rimraf(path[_0x2d55('0x21')](_0x12223e,_0x3d51d2),function(){});_0x2755a4(_0x2d55('0x28'));});});}})[_0x2d55('0x11')](function(){logger['info'](util[_0x2d55('0xd')](_0x2d55('0x29'),EXTRACTED_REPORT_ID,_0x2d55('0xe')));return analyticExtractedReport(_0x2d55('0x2a'),_0x5a545d?util[_0x2d55('0xd')](_0x2d55('0x25'),_0x3d51d2,_0x5a545d?_0x2d55('0x2b'):_0x2d55('0x2c')):null);});})['catch'](function(_0x523326){logger[_0x2d55('0xc')](util[_0x2d55('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0x2d55('0x2d')](_0x523326,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2d55('0x2e'));})[_0x2d55('0x2f')](function(){process[_0x2d55('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x5d4e=['bluebird','rimraf','dbH','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','split','length','range','num','isInteger','forEach','query','SELECT','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','mkdirSync','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','util','lodash','json2xls'];(function(_0x39ae21,_0x1ffcde){var _0x47d8f2=function(_0x2d6729){while(--_0x2d6729){_0x39ae21['push'](_0x39ae21['shift']());}};_0x47d8f2(++_0x1ffcde);}(_0x5d4e,0x90));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xe5d4('0x0'));var path=require('path');var _=require(_0xe5d4('0x1'));var fs=require('fs');var json2xls=require(_0xe5d4('0x2'));var BPromise=require(_0xe5d4('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xe5d4('0x4'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xe5d4('0x5')];var logger=require('../../config/logger')(_0xe5d4('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xe5d4('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x521dde,_0x359fd5){var _0x15e22d={'status':_0x521dde};var _0x12edda={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x359fd5){_0x15e22d[_0xe5d4('0x8')]=_0x359fd5;}return db['AnalyticExtractedReport'][_0xe5d4('0x9')](_0x15e22d,_0x12edda);}function main(){var _0x2f0684=0x1388;var _0x308d3e;logger[_0xe5d4('0xa')](util[_0xe5d4('0xb')](_0xe5d4('0xc'),EXTRACTED_REPORT_ID,_0xe5d4('0xd')));return db[_0xe5d4('0xe')][_0xe5d4('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xe5d4('0x10')]})[_0xe5d4('0x11')](function(_0x56da18){if(_0x56da18){_0x308d3e=_0x56da18;_0x2f0684=_0x308d3e[_0xe5d4('0x10')]||0x1388;}})[_0xe5d4('0x11')](function(){return dbH[_0xe5d4('0x12')]['query'](util['format'](_0xe5d4('0x13'),QUERY),{'type':dbH[_0xe5d4('0x12')][_0xe5d4('0x14')]['SELECT']});})[_0xe5d4('0x11')](function(_0x36f29a){if(!_0x36f29a[0x0]['num']){return analyticExtractedReport(_0xe5d4('0x15'));}var _0x514b80=[];var _0x562e3d=0x0;if(_0x308d3e[_0xe5d4('0x16')]){if(_0x36f29a&&_0x36f29a[_0xe5d4('0x17')]){var _0x4a11d9=_[_0xe5d4('0x18')](_0x36f29a[0x0][_0xe5d4('0x19')]/_0x2f0684);var _0x3d7430=Number[_0xe5d4('0x1a')](_0x36f29a[0x0][_0xe5d4('0x19')]/_0x2f0684)?_0x36f29a[0x0]['num']%_0x2f0684:0x0;_0x4a11d9[_0xe5d4('0x1b')](function(_0x4c06ac){if(_0x4c06ac>0x0){_0x562e3d+=_0x2f0684;}_0x514b80['push'](dbH[_0xe5d4('0x12')][_0xe5d4('0x1c')](util[_0xe5d4('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2f0684,_0x562e3d),{'type':dbH['sequelize'][_0xe5d4('0x14')][_0xe5d4('0x1d')]}));});if(_0x3d7430>0x0){_0x562e3d+=_0x2f0684;_0x514b80[_0xe5d4('0x1e')](dbH[_0xe5d4('0x12')]['query'](util['format'](_0xe5d4('0x1f'),QUERY,_0x3d7430,_0x562e3d),{'type':dbH[_0xe5d4('0x12')]['QueryTypes'][_0xe5d4('0x1d')]}));}}}else{_0x514b80[_0xe5d4('0x1e')](dbH[_0xe5d4('0x12')][_0xe5d4('0x1c')](QUERY,{'type':dbH['sequelize'][_0xe5d4('0x14')][_0xe5d4('0x1d')]}));}var _0x180ed0=path['dirname'](PATH);var _0x3d7a07=path[_0xe5d4('0x20')](PATH,_0xe5d4('0x21'));var _0x4e523a=_0x308d3e[_0xe5d4('0x16')]&&_0x514b80[_0xe5d4('0x17')]>0x1;var _0x110ba4=[];if(!fs[_0xe5d4('0x22')](path[_0xe5d4('0x23')](_0x180ed0,_0x3d7a07))&&_0x4e523a){fs[_0xe5d4('0x24')](path[_0xe5d4('0x23')](_0x180ed0,_0x3d7a07));}return BPromise['each'](_0x514b80,function(_0x26025c){_0x110ba4[_0xe5d4('0x1e')](_0x26025c);})[_0xe5d4('0x11')](function(){for(var _0x56da71=0x0;_0x56da71<_0x110ba4[_0xe5d4('0x17')];_0x56da71+=0x1){var _0x3a1a91;var _0x2ed8b0=_0x110ba4[_0x56da71];if(_0x4e523a){_0x3a1a91=path['join'](_0x180ed0,_0x3d7a07,util[_0xe5d4('0xb')](_0xe5d4('0x25'),_0x3d7a07,_0x56da71,'xlsx'));}else{_0x3a1a91=path[_0xe5d4('0x23')](_0x180ed0,util['format'](_0xe5d4('0x26'),_0x3d7a07,_0xe5d4('0x27')));}fs[_0xe5d4('0x28')](_0x3a1a91,json2xls(_0x2ed8b0),_0xe5d4('0x29'));}})[_0xe5d4('0x11')](function(){if(_0x4e523a){return new Promise(function(_0x38c3a5){zipdir(path[_0xe5d4('0x23')](_0x180ed0,_0x3d7a07),{'saveTo':path[_0xe5d4('0x23')](_0x180ed0,util[_0xe5d4('0xb')](_0xe5d4('0x26'),_0x3d7a07,_0xe5d4('0x2a')))},function(_0x680fd9,_0x5422cd){rimraf(path['join'](_0x180ed0,_0x3d7a07),function(){});_0x38c3a5(_0xe5d4('0x2b'));});});}})[_0xe5d4('0x11')](function(){logger[_0xe5d4('0xa')](util['format'](_0xe5d4('0x2c'),EXTRACTED_REPORT_ID,_0xe5d4('0xd')));return analyticExtractedReport(_0xe5d4('0x2d'),_0x4e523a?util[_0xe5d4('0xb')](_0xe5d4('0x26'),_0x3d7a07,_0x4e523a?_0xe5d4('0x2a'):_0xe5d4('0x27')):null);});})[_0xe5d4('0x2e')](function(_0x25f1fa){logger[_0xe5d4('0xa')](util[_0xe5d4('0xb')](_0xe5d4('0x2f'),EXTRACTED_REPORT_ID,_0xe5d4('0xd')),util['inspect'](_0x25f1fa,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xe5d4('0x30')](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 ad9515c..4f73b3e 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 _0x0a3a=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','updatedAt','interval','IntervalId','hasOwnProperty','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','Interval','then','intervals','VoiceExtension','findAll','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extensions','extension','find','push','type','format','VoiceExtensionId','inbound','Set','CDR(routeid)=','context','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none'];(function(_0x3b7a88,_0x283056){var _0x403e37=function(_0x17d68f){while(--_0x17d68f){_0x3b7a88['push'](_0x3b7a88['shift']());}};_0x403e37(++_0x283056);}(_0x0a3a,0xf2));var _0xa0a3=function(_0xcd9ec8,_0x27699f){_0xcd9ec8=_0xcd9ec8-0x0;var _0x5aa31b=_0x0a3a[_0xcd9ec8];return _0x5aa31b;};'use strict';var _=require(_0xa0a3('0x0'));var util=require(_0xa0a3('0x1'));function rewrite(_0x5409ee,_0x23dce9){var _0x3b2d83=this;return _0x5409ee[_0xa0a3('0x2')][_0xa0a3('0x3')]['findAll']({'raw':!![]})[_0xa0a3('0x4')](function(_0x34e0ea){_0x3b2d83[_0xa0a3('0x5')]=_0x34e0ea;return _0x5409ee[_0xa0a3('0x2')][_0xa0a3('0x6')][_0xa0a3('0x7')]({'where':{'IntervalId':_0x23dce9['IntervalId']},'raw':!![]});})[_0xa0a3('0x4')](function(_0x3bb4dc){return _0x5409ee[_0xa0a3('0x2')][_0xa0a3('0x6')][_0xa0a3('0x7')]({'where':{'exten':{'$in':_[_0xa0a3('0x8')](_['map'](_0x3bb4dc,_0xa0a3('0x9')))}},'order':[{'raw':_0xa0a3('0xa')}],'raw':!![]});})['then'](function(_0x412967){var _0x2c2213=_[_0xa0a3('0xb')](_0x412967,{'priority':'1'});var _0x345898=_[_0xa0a3('0xb')](_0x412967,{'isApp':0x1});var _0x2319f5=_[_0xa0a3('0xc')](_0x345898,_0xa0a3('0x9'));var _0x1ac88f=[_0xa0a3('0xd'),'playback'];var _0x38e3d3=[];var _0x47d5b3=[];for(var _0x305b58 in _0x2319f5){if(_0x2319f5['hasOwnProperty'](_0x305b58)){_0x3b2d83[_0xa0a3('0xe')]=0x2;_0x3b2d83[_0xa0a3('0xf')]=[];_0x3b2d83[_0xa0a3('0x10')]=_[_0xa0a3('0x11')](_0x2c2213,{'exten':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x9')]});_0x3b2d83[_0xa0a3('0xf')][_0xa0a3('0x12')]({'type':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')],'app':'Set','appdata':util[_0xa0a3('0x14')]('CDR(type)=%s',_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')]),'context':_0x2319f5[_0x305b58][0x0]['context'],'exten':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x9')],'priority':_0x3b2d83[_0xa0a3('0xe')]++,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]});if(_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')]===_0xa0a3('0x16')){_0x3b2d83[_0xa0a3('0xf')]['push']({'type':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')],'app':_0xa0a3('0x17'),'appdata':_0xa0a3('0x18')+_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')],'context':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x19')],'exten':_0x2319f5[_0x305b58][0x0]['exten'],'priority':_0x3b2d83[_0xa0a3('0xe')]++,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]});}else if(_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')]==='outbound'){if(_0x3b2d83[_0xa0a3('0x10')]){_0x3b2d83[_0xa0a3('0xf')]['push']({'type':_0x2319f5[_0x305b58][0x0]['type'],'app':'Set','appdata':_0xa0a3('0x1a')+(_0x3b2d83['extension'][_0xa0a3('0x1b')]?_0xa0a3('0x1c')+_0x3b2d83[_0xa0a3('0x10')][_0xa0a3('0x1b')]+'}':_0xa0a3('0x1d')),'context':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x19')],'exten':_0x2319f5[_0x305b58][0x0]['exten'],'priority':_0x3b2d83['priority']++,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]});}_0x3b2d83[_0xa0a3('0xf')]['push']({'type':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')],'app':_0xa0a3('0x17'),'appdata':_0xa0a3('0x18')+_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')],'context':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x19')],'exten':_0x2319f5[_0x305b58][0x0]['exten'],'priority':_0x3b2d83[_0xa0a3('0xe')]++,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]});var _0x2a200e=_0x3b2d83[_0xa0a3('0xe')]++;_0x3b2d83[_0xa0a3('0xf')][_0xa0a3('0x12')]({'type':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')],'app':_0xa0a3('0x1e'),'appdata':_0xa0a3('0x1f')+(_0x2a200e+0x2)+_0xa0a3('0x20')+(_0x2a200e+0x1)+')','context':_0x2319f5[_0x305b58][0x0]['context'],'exten':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x9')],'priority':_0x2a200e,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]});if(_0x3b2d83[_0xa0a3('0x10')]){_0x3b2d83['extensions'][_0xa0a3('0x12')]({'type':_0x2319f5[_0x305b58][0x0]['type'],'app':_0xa0a3('0x17'),'appdata':_0x3b2d83['extension']['cutdigits']?_0xa0a3('0x21')+_0x3b2d83[_0xa0a3('0x10')][_0xa0a3('0x1b')]+'}':_0xa0a3('0x22'),'context':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x19')],'exten':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x9')],'priority':_0x3b2d83[_0xa0a3('0xe')]++,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0]['VoiceExtensionId']});}_0x3b2d83[_0xa0a3('0xf')][_0xa0a3('0x12')]({'type':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')],'app':'Set','appdata':_0xa0a3('0x23')+_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')],'context':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x19')],'exten':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x9')],'priority':_0x3b2d83[_0xa0a3('0xe')]++,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]});if(_0x3b2d83[_0xa0a3('0x10')]&&_0x3b2d83[_0xa0a3('0x10')]['hasOwnProperty'](_0xa0a3('0x24'))&&_0x3b2d83[_0xa0a3('0x10')][_0xa0a3('0x24')]!==_0xa0a3('0x25')){_0x3b2d83[_0xa0a3('0xf')]['push']({'type':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')],'app':_0xa0a3('0x17'),'appdata':_0xa0a3('0x26'),'context':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x19')],'exten':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x9')],'priority':_0x3b2d83[_0xa0a3('0xe')]++,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]});_0x3b2d83['extensions'][_0xa0a3('0x12')]({'type':_0x2319f5[_0x305b58][0x0]['type'],'app':_0xa0a3('0x17'),'appdata':_0xa0a3('0x27')+_0x3b2d83[_0xa0a3('0x10')][_0xa0a3('0x24')]||'wav','context':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x19')],'exten':_0x2319f5[_0x305b58][0x0]['exten'],'priority':_0x3b2d83[_0xa0a3('0xe')]++,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]});}}_0x3b2d83['extensions'][_0xa0a3('0x12')]({'type':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')],'app':_0xa0a3('0x17'),'appdata':_0xa0a3('0x28'),'context':_0x2319f5[_0x305b58][0x0]['context'],'exten':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x9')],'priority':_0x3b2d83[_0xa0a3('0xe')]++,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0]['VoiceExtensionId']});_0x3b2d83['extensions'][_0xa0a3('0x12')]({'type':_0x2319f5[_0x305b58][0x0]['type'],'app':_0xa0a3('0x17'),'appdata':_0xa0a3('0x29'),'context':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x19')],'exten':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x9')],'priority':_0x3b2d83[_0xa0a3('0xe')]++,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0]['VoiceExtensionId']});_0x3b2d83[_0xa0a3('0xf')]['push']({'type':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x2319f5[_0x305b58][0x0]['context'],'exten':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x9')],'priority':_0x3b2d83[_0xa0a3('0xe')]++,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]});for(var _0x1b187d=0x0,_0x43a38c=0x0;_0x1b187d<_0x2319f5[_0x305b58][_0xa0a3('0x2a')];_0x1b187d+=0x1,_0x43a38c=0x0){var _0x26ec18=_0x2319f5[_0x305b58][_0x1b187d];if(_0x26ec18[_0xa0a3('0x13')]){_0x26ec18['type']=_0x26ec18[_0xa0a3('0x13')][_0xa0a3('0x2b')]();}var _0x358488=[];var _0x5d0e69=[];delete _0x26ec18['id'];delete _0x26ec18['createdAt'];delete _0x26ec18[_0xa0a3('0x2c')];var _0x2da162=_0x26ec18['interval']!=='*,*,*,*'?[_0x26ec18[_0xa0a3('0x2d')]]:_0x26ec18[_0xa0a3('0x2e')]?_['map'](_[_0xa0a3('0xb')](_0x3b2d83[_0xa0a3('0x5')],{'IntervalId':_0x26ec18[_0xa0a3('0x2e')]}),_0xa0a3('0x2d')):[];if(_0x26ec18[_0xa0a3('0x2f')](_0xa0a3('0x30'))){if(_0x26ec18['tag']&&_0x26ec18['tag']!=='--'){_0x358488[_0xa0a3('0x12')]({'type':_0x26ec18[_0xa0a3('0x13')],'app':_0xa0a3('0x17'),'appdata':'CDR(tag)='+_0x26ec18[_0xa0a3('0x30')],'context':_0x26ec18[_0xa0a3('0x19')],'exten':_0x26ec18['exten'],'priority':_0x2da162[_0xa0a3('0x2a')]+_0x3b2d83[_0xa0a3('0xe')]+_0x43a38c++,'VoiceExtensionId':_0x26ec18[_0xa0a3('0x15')]});}}if(_0x26ec18[_0xa0a3('0x13')]==='outbound'&&_0x26ec18[_0xa0a3('0x2f')](_0xa0a3('0x31'))){if(_0x26ec18['callerID']){_0x358488[_0xa0a3('0x12')]({'type':_0x26ec18[_0xa0a3('0x13')],'app':_0xa0a3('0x1e'),'appdata':_0xa0a3('0x32')+_0x26ec18[_0xa0a3('0x31')]+')','context':_0x26ec18[_0xa0a3('0x19')],'exten':_0x26ec18[_0xa0a3('0x9')],'priority':_0x2da162[_0xa0a3('0x2a')]+_0x3b2d83[_0xa0a3('0xe')]+_0x43a38c++,'VoiceExtensionId':_0x26ec18[_0xa0a3('0x15')]});}else{_0x358488[_0xa0a3('0x12')]({'type':_0x26ec18[_0xa0a3('0x13')],'app':'ExecIf','appdata':_0xa0a3('0x33'),'context':_0x26ec18[_0xa0a3('0x19')],'exten':_0x26ec18['exten'],'priority':_0x2da162[_0xa0a3('0x2a')]+_0x3b2d83['priority']+_0x43a38c++,'VoiceExtensionId':_0x26ec18[_0xa0a3('0x15')]});}}if(_0x26ec18[_0xa0a3('0x2f')](_0xa0a3('0x34'))){if(_0x1ac88f['indexOf'](_0x26ec18[_0xa0a3('0x35')][_0xa0a3('0x2b')]())>=0x0&&_0x26ec18['appType']!==_0xa0a3('0x36')){if(_0x26ec18['answer']){_0x358488[_0xa0a3('0x12')]({'type':_0x26ec18[_0xa0a3('0x13')],'app':_0xa0a3('0x1e'),'appdata':_0xa0a3('0x37'),'context':_0x26ec18['context'],'exten':_0x26ec18[_0xa0a3('0x9')],'priority':_0x2da162[_0xa0a3('0x2a')]+_0x3b2d83['priority']+_0x43a38c++,'VoiceExtensionId':_0x26ec18['VoiceExtensionId']});_0x358488[_0xa0a3('0x12')]({'type':_0x26ec18[_0xa0a3('0x13')],'app':_0xa0a3('0x17'),'appdata':_0xa0a3('0x38'),'context':_0x26ec18[_0xa0a3('0x19')],'exten':_0x26ec18[_0xa0a3('0x9')],'priority':_0x2da162[_0xa0a3('0x2a')]+_0x3b2d83[_0xa0a3('0xe')]+_0x43a38c++,'VoiceExtensionId':_0x26ec18['VoiceExtensionId']});}else{_0x358488['push']({'type':_0x26ec18[_0xa0a3('0x13')],'app':_0xa0a3('0x1e'),'appdata':_0xa0a3('0x39'),'context':_0x26ec18[_0xa0a3('0x19')],'exten':_0x26ec18['exten'],'priority':_0x2da162[_0xa0a3('0x2a')]+_0x3b2d83[_0xa0a3('0xe')]+_0x43a38c++,'VoiceExtensionId':_0x26ec18['VoiceExtensionId']});_0x358488[_0xa0a3('0x12')]({'type':_0x26ec18[_0xa0a3('0x13')],'app':_0xa0a3('0x17'),'appdata':_0xa0a3('0x3a'),'context':_0x26ec18[_0xa0a3('0x19')],'exten':_0x26ec18['exten'],'priority':_0x2da162['length']+_0x3b2d83[_0xa0a3('0xe')]+_0x43a38c++,'VoiceExtensionId':_0x26ec18[_0xa0a3('0x15')]});}}}for(var _0x2217ab=0x0;_0x2217ab<_0x2da162[_0xa0a3('0x2a')];_0x2217ab+=0x1){var _0x3b2657=_0x3b2d83[_0xa0a3('0xe')]+_0x2da162[_0xa0a3('0x2a')];var _0x4ceb47=_0x2217ab===_0x2da162[_0xa0a3('0x2a')]-0x1?_0x3b2d83[_0xa0a3('0xe')]+_0x358488['length']+_0x5d0e69[_0xa0a3('0x2a')]+0x2:_0x3b2d83[_0xa0a3('0xe')]+_0x2217ab+0x1;_0x358488[_0xa0a3('0x3b')](_0x2217ab,0x0,{'type':_0x26ec18['type'],'app':_0xa0a3('0x3c'),'appdata':_0x2da162[_0x2217ab]+'?'+_0x26ec18['context']+_0xa0a3('0x3d')+_0x3b2657+':'+_0x26ec18[_0xa0a3('0x19')]+_0xa0a3('0x3d')+_0x4ceb47,'exten':_0x26ec18[_0xa0a3('0x9')],'context':_0x26ec18['context'],'priority':_0x3b2d83[_0xa0a3('0xe')]+_0x2217ab,'VoiceExtensionId':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]});}_0x26ec18[_0xa0a3('0xe')]=_0x358488[_0xa0a3('0x2a')]?_[_0xa0a3('0x3e')](_0x358488)[_0xa0a3('0xe')]+0x1:_0x3b2d83[_0xa0a3('0xe')];_0x3b2d83[_0xa0a3('0xe')]=(_0x5d0e69['length']?_['last'](_0x5d0e69)[_0xa0a3('0xe')]:_0x26ec18[_0xa0a3('0xe')])+0x1;_0x3b2d83['extensions']=_[_0xa0a3('0x3f')](_0x3b2d83[_0xa0a3('0xf')],_0x358488,[_0x26ec18],_0x5d0e69);}_0x3b2d83['extensions'][_0xa0a3('0x12')]({'type':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x13')],'app':'Hangup','exten':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x9')],'context':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x19')],'priority':_0x3b2d83[_0xa0a3('0xe')],'VoiceExtensionId':_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]});_0x38e3d3['push'](_0x2319f5[_0x305b58][0x0][_0xa0a3('0x15')]);_0x47d5b3=_[_0xa0a3('0x3f')](_0x47d5b3,_0x3b2d83['extensions']);}}return _0x5409ee[_0xa0a3('0x40')](function(_0x531af6){return _0x5409ee[_0xa0a3('0x2')]['VoiceExtension'][_0xa0a3('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x38e3d3}},'transaction':_0x531af6})[_0xa0a3('0x4')](function(_0x537daf){return _0x5409ee[_0xa0a3('0x2')][_0xa0a3('0x6')]['bulkCreate'](_[_0xa0a3('0x42')](_0x47d5b3,'priority'),{'transaction':_0x531af6});});});})[_0xa0a3('0x43')](function(_0x321e60){console[_0xa0a3('0x44')](_0x321e60);});}exports[_0xa0a3('0x45')]=rewrite; \ No newline at end of file +var _0x052c=['interval','intervals','tag','CDR(tag)=','callerID','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','bulkCreate','sortBy','catch','rewrite','lodash','util','findAll','then','models','VoiceExtension','IntervalId','map','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','format','type','context','VoiceExtensionId','Set','CDR(routeid)=','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','toLowerCase','createdAt','updatedAt'];(function(_0x69f527,_0x166fd7){var _0x32e1f3=function(_0x4dea88){while(--_0x4dea88){_0x69f527['push'](_0x69f527['shift']());}};_0x32e1f3(++_0x166fd7);}(_0x052c,0x160));var _0xc052=function(_0x4bbe05,_0x5d3c8e){_0x4bbe05=_0x4bbe05-0x0;var _0x248360=_0x052c[_0x4bbe05];return _0x248360;};'use strict';var _=require(_0xc052('0x0'));var util=require(_0xc052('0x1'));function rewrite(_0x3849d9,_0x3fff77){var _0x596309=this;return _0x3849d9['models']['Interval'][_0xc052('0x2')]({'raw':!![]})[_0xc052('0x3')](function(_0x490c8f){_0x596309['intervals']=_0x490c8f;return _0x3849d9[_0xc052('0x4')][_0xc052('0x5')]['findAll']({'where':{'IntervalId':_0x3fff77[_0xc052('0x6')]},'raw':!![]});})[_0xc052('0x3')](function(_0x437248){return _0x3849d9[_0xc052('0x4')][_0xc052('0x5')][_0xc052('0x2')]({'where':{'exten':{'$in':_['uniq'](_[_0xc052('0x7')](_0x437248,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xc052('0x3')](function(_0x3643e3){var _0x28d61d=_[_0xc052('0x8')](_0x3643e3,{'priority':'1'});var _0x198935=_[_0xc052('0x8')](_0x3643e3,{'isApp':0x1});var _0x48a34b=_[_0xc052('0x9')](_0x198935,_0xc052('0xa'));var _0x7b5e4b=[_0xc052('0xb'),_0xc052('0xc')];var _0x11a138=[];var _0x518a1a=[];for(var _0xc50a60 in _0x48a34b){if(_0x48a34b[_0xc052('0xd')](_0xc50a60)){_0x596309[_0xc052('0xe')]=0x2;_0x596309[_0xc052('0xf')]=[];_0x596309[_0xc052('0x10')]=_[_0xc052('0x11')](_0x28d61d,{'exten':_0x48a34b[_0xc50a60][0x0]['exten']});_0x596309[_0xc052('0xf')][_0xc052('0x12')]({'type':_0x48a34b[_0xc50a60][0x0]['type'],'app':'Set','appdata':util[_0xc052('0x13')]('CDR(type)=%s',_0x48a34b[_0xc50a60][0x0][_0xc052('0x14')]),'context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0][_0xc052('0xa')],'priority':_0x596309[_0xc052('0xe')]++,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]});if(_0x48a34b[_0xc50a60][0x0]['type']==='inbound'){_0x596309[_0xc052('0xf')][_0xc052('0x12')]({'type':_0x48a34b[_0xc50a60][0x0]['type'],'app':_0xc052('0x17'),'appdata':_0xc052('0x18')+_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')],'context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0]['exten'],'priority':_0x596309[_0xc052('0xe')]++,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]});}else if(_0x48a34b[_0xc50a60][0x0][_0xc052('0x14')]===_0xc052('0x19')){if(_0x596309[_0xc052('0x10')]){_0x596309[_0xc052('0xf')][_0xc052('0x12')]({'type':_0x48a34b[_0xc50a60][0x0][_0xc052('0x14')],'app':_0xc052('0x17'),'appdata':_0xc052('0x1a')+(_0x596309['extension']['cutdigits']?_0xc052('0x1b')+_0x596309[_0xc052('0x10')][_0xc052('0x1c')]+'}':_0xc052('0x1d')),'context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0]['exten'],'priority':_0x596309['priority']++,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]});}_0x596309[_0xc052('0xf')][_0xc052('0x12')]({'type':_0x48a34b[_0xc50a60][0x0]['type'],'app':_0xc052('0x17'),'appdata':'CDR(routeid)='+_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')],'context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0][_0xc052('0xa')],'priority':_0x596309[_0xc052('0xe')]++,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]});var _0x2a427c=_0x596309['priority']++;_0x596309[_0xc052('0xf')][_0xc052('0x12')]({'type':_0x48a34b[_0xc50a60][0x0]['type'],'app':_0xc052('0x1e'),'appdata':_0xc052('0x1f')+(_0x2a427c+0x2)+_0xc052('0x20')+(_0x2a427c+0x1)+')','context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0]['exten'],'priority':_0x2a427c,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]});if(_0x596309['extension']){_0x596309[_0xc052('0xf')][_0xc052('0x12')]({'type':_0x48a34b[_0xc50a60][0x0][_0xc052('0x14')],'app':_0xc052('0x17'),'appdata':_0x596309[_0xc052('0x10')][_0xc052('0x1c')]?_0xc052('0x21')+_0x596309[_0xc052('0x10')][_0xc052('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0]['exten'],'priority':_0x596309[_0xc052('0xe')]++,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]});}_0x596309[_0xc052('0xf')][_0xc052('0x12')]({'type':_0x48a34b[_0xc50a60][0x0][_0xc052('0x14')],'app':_0xc052('0x17'),'appdata':_0xc052('0x22')+_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')],'context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0][_0xc052('0xa')],'priority':_0x596309[_0xc052('0xe')]++,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0]['VoiceExtensionId']});if(_0x596309[_0xc052('0x10')]&&_0x596309[_0xc052('0x10')][_0xc052('0xd')](_0xc052('0x23'))&&_0x596309[_0xc052('0x10')][_0xc052('0x23')]!=='none'){_0x596309['extensions']['push']({'type':_0x48a34b[_0xc50a60][0x0][_0xc052('0x14')],'app':_0xc052('0x17'),'appdata':_0xc052('0x24'),'context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0][_0xc052('0xa')],'priority':_0x596309[_0xc052('0xe')]++,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]});_0x596309[_0xc052('0xf')][_0xc052('0x12')]({'type':_0x48a34b[_0xc50a60][0x0][_0xc052('0x14')],'app':_0xc052('0x17'),'appdata':_0xc052('0x25')+_0x596309['extension'][_0xc052('0x23')]||_0xc052('0x26'),'context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0][_0xc052('0xa')],'priority':_0x596309[_0xc052('0xe')]++,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]});}}_0x596309[_0xc052('0xf')][_0xc052('0x12')]({'type':_0x48a34b[_0xc50a60][0x0][_0xc052('0x14')],'app':_0xc052('0x17'),'appdata':_0xc052('0x27'),'context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0]['exten'],'priority':_0x596309[_0xc052('0xe')]++,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]});_0x596309[_0xc052('0xf')][_0xc052('0x12')]({'type':_0x48a34b[_0xc50a60][0x0][_0xc052('0x14')],'app':_0xc052('0x17'),'appdata':_0xc052('0x28'),'context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0]['exten'],'priority':_0x596309['priority']++,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0]['VoiceExtensionId']});_0x596309[_0xc052('0xf')][_0xc052('0x12')]({'type':_0x48a34b[_0xc50a60][0x0][_0xc052('0x14')],'app':_0xc052('0x17'),'appdata':'MONITOR_OPTIONS=ab','context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'exten':_0x48a34b[_0xc50a60][0x0]['exten'],'priority':_0x596309['priority']++,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0]['VoiceExtensionId']});for(var _0x8a51a6=0x0,_0x242350=0x0;_0x8a51a6<_0x48a34b[_0xc50a60]['length'];_0x8a51a6+=0x1,_0x242350=0x0){var _0x482ff0=_0x48a34b[_0xc50a60][_0x8a51a6];if(_0x482ff0[_0xc052('0x14')]){_0x482ff0[_0xc052('0x14')]=_0x482ff0[_0xc052('0x14')][_0xc052('0x29')]();}var _0x17a678=[];var _0xa83d9c=[];delete _0x482ff0['id'];delete _0x482ff0[_0xc052('0x2a')];delete _0x482ff0[_0xc052('0x2b')];var _0x337956=_0x482ff0[_0xc052('0x2c')]!=='*,*,*,*'?[_0x482ff0['interval']]:_0x482ff0[_0xc052('0x6')]?_[_0xc052('0x7')](_[_0xc052('0x8')](_0x596309[_0xc052('0x2d')],{'IntervalId':_0x482ff0[_0xc052('0x6')]}),_0xc052('0x2c')):[];if(_0x482ff0[_0xc052('0xd')](_0xc052('0x2e'))){if(_0x482ff0[_0xc052('0x2e')]&&_0x482ff0[_0xc052('0x2e')]!=='--'){_0x17a678['push']({'type':_0x482ff0[_0xc052('0x14')],'app':_0xc052('0x17'),'appdata':_0xc052('0x2f')+_0x482ff0['tag'],'context':_0x482ff0[_0xc052('0x15')],'exten':_0x482ff0[_0xc052('0xa')],'priority':_0x337956['length']+_0x596309['priority']+_0x242350++,'VoiceExtensionId':_0x482ff0[_0xc052('0x16')]});}}if(_0x482ff0[_0xc052('0x14')]===_0xc052('0x19')&&_0x482ff0[_0xc052('0xd')](_0xc052('0x30'))){if(_0x482ff0[_0xc052('0x30')]){_0x17a678[_0xc052('0x12')]({'type':_0x482ff0[_0xc052('0x14')],'app':_0xc052('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x482ff0[_0xc052('0x30')]+')','context':_0x482ff0['context'],'exten':_0x482ff0[_0xc052('0xa')],'priority':_0x337956[_0xc052('0x31')]+_0x596309['priority']+_0x242350++,'VoiceExtensionId':_0x482ff0['VoiceExtensionId']});}else{_0x17a678[_0xc052('0x12')]({'type':_0x482ff0[_0xc052('0x14')],'app':'ExecIf','appdata':_0xc052('0x32'),'context':_0x482ff0[_0xc052('0x15')],'exten':_0x482ff0[_0xc052('0xa')],'priority':_0x337956[_0xc052('0x31')]+_0x596309[_0xc052('0xe')]+_0x242350++,'VoiceExtensionId':_0x482ff0['VoiceExtensionId']});}}if(_0x482ff0[_0xc052('0xd')]('answer')){if(_0x7b5e4b['indexOf'](_0x482ff0[_0xc052('0x33')][_0xc052('0x29')]())>=0x0&&_0x482ff0[_0xc052('0x34')]!==_0xc052('0x35')){if(_0x482ff0['answer']){_0x17a678['push']({'type':_0x482ff0[_0xc052('0x14')],'app':'ExecIf','appdata':_0xc052('0x36'),'context':_0x482ff0[_0xc052('0x15')],'exten':_0x482ff0[_0xc052('0xa')],'priority':_0x337956[_0xc052('0x31')]+_0x596309[_0xc052('0xe')]+_0x242350++,'VoiceExtensionId':_0x482ff0[_0xc052('0x16')]});_0x17a678[_0xc052('0x12')]({'type':_0x482ff0['type'],'app':_0xc052('0x17'),'appdata':_0xc052('0x37'),'context':_0x482ff0[_0xc052('0x15')],'exten':_0x482ff0['exten'],'priority':_0x337956[_0xc052('0x31')]+_0x596309[_0xc052('0xe')]+_0x242350++,'VoiceExtensionId':_0x482ff0['VoiceExtensionId']});}else{_0x17a678[_0xc052('0x12')]({'type':_0x482ff0[_0xc052('0x14')],'app':_0xc052('0x1e'),'appdata':_0xc052('0x38'),'context':_0x482ff0['context'],'exten':_0x482ff0[_0xc052('0xa')],'priority':_0x337956[_0xc052('0x31')]+_0x596309[_0xc052('0xe')]+_0x242350++,'VoiceExtensionId':_0x482ff0[_0xc052('0x16')]});_0x17a678[_0xc052('0x12')]({'type':_0x482ff0['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x482ff0['context'],'exten':_0x482ff0[_0xc052('0xa')],'priority':_0x337956['length']+_0x596309[_0xc052('0xe')]+_0x242350++,'VoiceExtensionId':_0x482ff0[_0xc052('0x16')]});}}}for(var _0x3c7a8e=0x0;_0x3c7a8e<_0x337956[_0xc052('0x31')];_0x3c7a8e+=0x1){var _0x377633=_0x596309['priority']+_0x337956[_0xc052('0x31')];var _0x53ff57=_0x3c7a8e===_0x337956[_0xc052('0x31')]-0x1?_0x596309[_0xc052('0xe')]+_0x17a678[_0xc052('0x31')]+_0xa83d9c[_0xc052('0x31')]+0x2:_0x596309[_0xc052('0xe')]+_0x3c7a8e+0x1;_0x17a678[_0xc052('0x39')](_0x3c7a8e,0x0,{'type':_0x482ff0[_0xc052('0x14')],'app':_0xc052('0x3a'),'appdata':_0x337956[_0x3c7a8e]+'?'+_0x482ff0[_0xc052('0x15')]+',${EXTEN},'+_0x377633+':'+_0x482ff0['context']+_0xc052('0x3b')+_0x53ff57,'exten':_0x482ff0['exten'],'context':_0x482ff0['context'],'priority':_0x596309['priority']+_0x3c7a8e,'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]});}_0x482ff0[_0xc052('0xe')]=_0x17a678[_0xc052('0x31')]?_[_0xc052('0x3c')](_0x17a678)[_0xc052('0xe')]+0x1:_0x596309[_0xc052('0xe')];_0x596309['priority']=(_0xa83d9c[_0xc052('0x31')]?_[_0xc052('0x3c')](_0xa83d9c)[_0xc052('0xe')]:_0x482ff0['priority'])+0x1;_0x596309[_0xc052('0xf')]=_[_0xc052('0x3d')](_0x596309[_0xc052('0xf')],_0x17a678,[_0x482ff0],_0xa83d9c);}_0x596309[_0xc052('0xf')]['push']({'type':_0x48a34b[_0xc50a60][0x0][_0xc052('0x14')],'app':'Hangup','exten':_0x48a34b[_0xc50a60][0x0][_0xc052('0xa')],'context':_0x48a34b[_0xc50a60][0x0][_0xc052('0x15')],'priority':_0x596309[_0xc052('0xe')],'VoiceExtensionId':_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]});_0x11a138['push'](_0x48a34b[_0xc50a60][0x0][_0xc052('0x16')]);_0x518a1a=_[_0xc052('0x3d')](_0x518a1a,_0x596309[_0xc052('0xf')]);}}return _0x3849d9['transaction'](function(_0x3ab33c){return _0x3849d9[_0xc052('0x4')][_0xc052('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x11a138}},'transaction':_0x3ab33c})[_0xc052('0x3')](function(_0x528647){return _0x3849d9['models']['VoiceExtension'][_0xc052('0x3e')](_[_0xc052('0x3f')](_0x518a1a,_0xc052('0xe')),{'transaction':_0x3ab33c});});});})[_0xc052('0x40')](function(_0x1876ef){console['error'](_0x1876ef);});}exports[_0xc052('0x41')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index cb321c3..78de9ef 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 _0x3559=['always','push','query','VoiceQueueId','onlyIfOpen','sequelize','findAll','BlackLists','all','Campaign','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','error','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','updatedAt','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','fromQuery','cm_hopper_black','VoiceQueue','outbound','CmList','Lists','get','dialCheckDuplicateType'];(function(_0x2a09a5,_0x4f8769){var _0x61a7b7=function(_0x3f4d3f){while(--_0x3f4d3f){_0x2a09a5['push'](_0x2a09a5['shift']());}};_0x61a7b7(++_0x4f8769);}(_0x3559,0x1db));var _0x9355=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3559[_0x4565bf];return _0x5610ba;};'use strict';var BPromise=require(_0x9355('0x0'));var util=require(_0x9355('0x1'));var _=require(_0x9355('0x2'));var fs=require('fs');var squel=require(_0x9355('0x3'));var Papa=require(_0x9355('0x4'));var Redis=require('ioredis');var db=require(_0x9355('0x5'))['db'];var config=require(_0x9355('0x6'));var logger=require(_0x9355('0x7'))(_0x9355('0x8'));config[_0x9355('0x9')]=_[_0x9355('0xa')](config[_0x9355('0x9')],{'host':_0x9355('0xb'),'port':0x18eb});var socket=require(_0x9355('0xc'))(new Redis(config[_0x9355('0x9')]));require(_0x9355('0xd'))[_0x9355('0xe')](socket);try{if(!process[_0x9355('0xf')][0x2]||process['argv'][0x2]===_0x9355('0x10')||process['argv'][0x2]===_0x9355('0x11')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x9355('0xf')][0x2];if(!process[_0x9355('0xf')][0x3]||process['argv'][0x3]===_0x9355('0x10')||process[_0x9355('0xf')][0x3]==='null'||!process['argv'][0x4]||process[_0x9355('0xf')][0x4]===_0x9355('0x10')||process[_0x9355('0xf')][0x4]==='null'){throw new Error(_0x9355('0x12'));}var FIELDS=_[_0x9355('0x13')](process['argv'][0x3][_0x9355('0x14')](','),process[_0x9355('0xf')][0x4]['split'](','));if(!process['argv'][0x5]||process[_0x9355('0xf')][0x5]==='undefined'||process[_0x9355('0xf')][0x5]===_0x9355('0x11')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x9355('0xf')][0x5];var COMPANYID=process[_0x9355('0xf')][0x6]&&process['argv'][0x6]!==_0x9355('0x10')&&process[_0x9355('0xf')][0x6]!==_0x9355('0x11')?process[_0x9355('0xf')][0x6]:null;var DUPLICATES=process[_0x9355('0xf')][0x7]&&process[_0x9355('0xf')][0x7]!=='undefined'&&process[_0x9355('0xf')][0x7]!==_0x9355('0x11')?process[_0x9355('0xf')][0x7]:null;if(!process[_0x9355('0xf')][0x8]||process[_0x9355('0xf')][0x8]===_0x9355('0x10')||process[_0x9355('0xf')][0x8]===_0x9355('0x11')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4b30de){logger[_0x9355('0x15')](_0x4b30de);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(_0x43035d,_0x407dd4,_0x4c98ea,_0x1e2bd5){var _0x56b03a={'message':_0x407dd4};_0x56b03a[_0x43035d]=!![];if(_0x4c98ea){_0x56b03a['contact']=_0x4c98ea;}if(_0x1e2bd5){_0x56b03a[_0x9355('0x16')]=_0x1e2bd5;}return _0x56b03a;}function isEmail(_0x1069b2){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))*$/[_0x9355('0x17')](_0x1069b2);}function checkRow(_0xa2e8c1,_0x5e4a88,_0x217758){return new BPromise(function(_0x9031ef,_0x49f7a4){if(_['isNil'](_0xa2e8c1)){return _0x49f7a4(handleCheckRowError(_0x9355('0x15'),_0x9355('0x18'),null,_0x217758));}if(_0xa2e8c1['errors']&&_0xa2e8c1['errors'][_0x9355('0x19')]){var _0x1d62dd=_[_0x9355('0x1a')](_0xa2e8c1[_0x9355('0x1b')],'message')[_0x9355('0x1c')](';');return _0x49f7a4(handleCheckRowError(_0x9355('0x15'),_0x1d62dd,null,_0x217758));}var _0x22b626={};for(var _0x3ecae7 in FIELDS){if(FIELDS[_0x9355('0x1d')](_0x3ecae7)&&FIELDS[_0x3ecae7]){_0x22b626[_0x3ecae7]=_0xa2e8c1[_0x9355('0x1e')][0x0][FIELDS[_0x3ecae7]]||_0xa2e8c1[_0x9355('0x1e')][0x0]['\ufeff'+FIELDS[_0x3ecae7]];}}if(!_0x22b626[_0x9355('0x1f')]){return _0x49f7a4(handleCheckRowError(_0x9355('0x15'),_0x9355('0x20'),null,_0x217758));}if(!_0x22b626[_0x9355('0x21')]){return _0x49f7a4(handleCheckRowError(_0x9355('0x15'),'phone\x20not\x20specified!',null,_0x217758));}if(_0x22b626[_0x9355('0x22')]){var _0x4b44b7=moment(_0x22b626[_0x9355('0x22')],_0x9355('0x23'));if(!_0x4b44b7[_0x9355('0x24')]()){return _0x49f7a4(handleCheckRowError(_0x9355('0x15'),_0x9355('0x25'),null,_0x217758));}}if(_0x22b626[_0x9355('0x26')]){if(!isEmail(_0x22b626['email'])){return _0x49f7a4(handleCheckRowError(_0x9355('0x15'),_0x9355('0x27'),null,_0x217758));}}_0x22b626[_0x9355('0x28')]=LISTID;_0x22b626['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x9355('0x19')]&&_0x5e4a88){var _0x71c66e={};for(var _0x7b13c5=0x0,_0x2b8bba=DUPLICATES['length'];_0x7b13c5<_0x2b8bba;_0x7b13c5+=0x1){_0x71c66e[DUPLICATES[_0x7b13c5]]=_0x22b626[DUPLICATES[_0x7b13c5]];}var _0x1ebc25=_[_0x9355('0x29')](_0x5e4a88,_0x71c66e);if(_0x1ebc25){return _0x49f7a4(handleCheckRowError(_0x9355('0x2a'),_0x9355('0x2b'),_0x1ebc25,_0x217758));}}return db[_0x9355('0x2c')][_0x9355('0x2d')](_0x22b626,{'raw':!![],'hooks':![],'fields':_[_0x9355('0x2e')](_0x22b626)})[_0x9355('0x2f')](function(_0x1f0154){if(DUPLICATES&&DUPLICATES[_0x9355('0x19')]&&_0x5e4a88){_0x5e4a88['push'](_['pick'](_0x22b626,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1f0154['id'];return _0x9031ef();})[_0x9355('0x30')](function(_0x3c8dee){return _0x49f7a4(handleCheckRowError(_0x9355('0x15'),_0x9355('0x31')+(_0x3c8dee[_0x9355('0x32')]||JSON[_0x9355('0x33')](_0x3c8dee)),null,_0x217758));});});}function checkHopper(){function _0xc43845(){return function(_0x421453){logger[_0x9355('0x15')](_0x9355('0x34'),_0x9355('0x35'),util[_0x9355('0x36')](_0x421453,{'showHidden':![],'depth':null}));};}var _0x2fc492=function(_0x4f5eb2,_0x589692){var _0x2edb72=squel[_0x9355('0x37')]()[_0x9355('0x38')](_0x9355('0x39'))['fromQuery']([_0x9355('0x21'),_0x9355('0x3a'),_0x9355('0x3b'),_0x9355('0x28'),_0x589692,_0x9355('0x3c'),'updatedAt'],squel[_0x9355('0x3d')]()[_0x9355('0x3e')](_0x9355('0x21'),_0x9355('0x21'))[_0x9355('0x3e')](_0x9355('0x3f'),_0x9355('0x3a'))['field']('id',_0x9355('0x3b'))['field'](LISTID[_0x9355('0x40')](),_0x9355('0x28'))[_0x9355('0x3e')](_0x4f5eb2['id'][_0x9355('0x40')](),_0x589692)[_0x9355('0x3e')](_0x9355('0x3f'),_0x9355('0x3c'))[_0x9355('0x3e')](_0x9355('0x3f'),_0x9355('0x41'))[_0x9355('0x42')](_0x9355('0x43'))[_0x9355('0x44')]('deletedAt\x20IS\x20NULL')[_0x9355('0x44')](_0x9355('0x45'),LISTID['toString']())[_0x9355('0x44')](_0x9355('0x46'))[_0x9355('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9355('0x3d')]()[_0x9355('0x3e')]('phone')['from'](_0x9355('0x39'))[_0x9355('0x44')](_0x589692+_0x9355('0x47'),_0x4f5eb2['id'][_0x9355('0x40')]())))[_0x9355('0x40')]();return _0x2edb72;};var _0x28fa19=function(_0x2f4e92,_0x4e3dfb){var _0x11127e=squel[_0x9355('0x37')]()['into'](_0x9355('0x39'))['fromQuery']([_0x9355('0x21'),_0x9355('0x3a'),_0x9355('0x3b'),_0x9355('0x28'),_0x4e3dfb,_0x9355('0x3c'),'updatedAt'],squel[_0x9355('0x3d')]()['field'](_0x9355('0x21'),_0x9355('0x21'))[_0x9355('0x3e')](_0x9355('0x3f'),'scheduledAt')[_0x9355('0x3e')]('id',_0x9355('0x3b'))[_0x9355('0x3e')](LISTID[_0x9355('0x40')](),_0x9355('0x28'))[_0x9355('0x3e')](_0x2f4e92['id'][_0x9355('0x40')](),_0x4e3dfb)[_0x9355('0x3e')](_0x9355('0x3f'),'createdAt')[_0x9355('0x3e')](_0x9355('0x3f'),_0x9355('0x41'))[_0x9355('0x42')](_0x9355('0x43'))[_0x9355('0x44')](_0x9355('0x48'))[_0x9355('0x44')]('ListId\x20=\x20?',LISTID[_0x9355('0x40')]())[_0x9355('0x44')](_0x9355('0x49'),squel[_0x9355('0x4a')](hopperContacts))['where'](_0x9355('0x46'))[_0x9355('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9355('0x3d')]()[_0x9355('0x3e')](_0x9355('0x4b'))[_0x9355('0x42')](_0x9355('0x4c'))[_0x9355('0x44')](_0x4e3dfb+_0x9355('0x47'),_0x2f4e92['id'][_0x9355('0x40')]()))[_0x9355('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9355('0x3d')]()['field']('phone')[_0x9355('0x42')]('cm_hopper')['where'](_0x4e3dfb+_0x9355('0x47'),_0x2f4e92['id']['toString']())))[_0x9355('0x40')]();return _0x11127e;};function _0x22ab63(_0x3847cd,_0x48d86b){var _0x4ab4e3=squel[_0x9355('0x37')]()[_0x9355('0x38')](_0x9355('0x39'))[_0x9355('0x4d')]([_0x9355('0x21'),'scheduledAt',_0x9355('0x3b'),'ListId',_0x48d86b,'createdAt',_0x9355('0x41')],squel['select']()[_0x9355('0x3e')]('phone',_0x9355('0x21'))[_0x9355('0x3e')]('NOW()',_0x9355('0x3a'))[_0x9355('0x3e')]('id','ContactId')[_0x9355('0x3e')](LISTID['toString'](),_0x9355('0x28'))[_0x9355('0x3e')](_0x3847cd['id'][_0x9355('0x40')](),_0x48d86b)['field']('NOW()',_0x9355('0x3c'))['field'](_0x9355('0x3f'),'updatedAt')[_0x9355('0x42')](_0x9355('0x43'))[_0x9355('0x44')](_0x9355('0x48'))[_0x9355('0x44')](_0x9355('0x45'),LISTID['toString']())['where'](_0x9355('0x49'),squel[_0x9355('0x4a')](hopperContacts))[_0x9355('0x44')](_0x9355('0x46')))[_0x9355('0x40')]();return _0x4ab4e3;}function _0x4179a4(_0x42a110,_0x538ae0){var _0x20500c=squel[_0x9355('0x37')]()[_0x9355('0x38')](_0x9355('0x4e'))[_0x9355('0x4d')]([_0x9355('0x21'),_0x9355('0x3b'),_0x9355('0x28'),_0x538ae0,_0x9355('0x3c'),_0x9355('0x41')],squel[_0x9355('0x3d')]()['field'](_0x9355('0x21'),'phone')['field']('id','ContactId')['field'](LISTID[_0x9355('0x40')](),'ListId')[_0x9355('0x3e')](_0x42a110['id'][_0x9355('0x40')](),_0x538ae0)[_0x9355('0x3e')](_0x9355('0x3f'),_0x9355('0x3c'))[_0x9355('0x3e')](_0x9355('0x3f'),_0x9355('0x41'))[_0x9355('0x42')](_0x9355('0x43'))[_0x9355('0x44')](_0x9355('0x48'))[_0x9355('0x44')](_0x9355('0x45'),LISTID[_0x9355('0x40')]())[_0x9355('0x44')](_0x9355('0x49'),squel[_0x9355('0x4a')](hopperContacts))[_0x9355('0x44')](_0x9355('0x46')))[_0x9355('0x40')]();return _0x20500c;}return db[_0x9355('0x4f')]['findAll']({'where':{'type':_0x9355('0x50')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x9355('0x51')],'as':_0x9355('0x52'),'where':{'id':LISTID}}]})[_0x9355('0x2f')](function(_0x4fe8d8){var _0x35cfcd=[];if(_0x4fe8d8){var _0x486c14;for(var _0x56a8b1=0x0,_0x31a152;_0x56a8b1<_0x4fe8d8[_0x9355('0x19')];_0x56a8b1+=0x1){_0x31a152=_0x4fe8d8[_0x56a8b1][_0x9355('0x53')]({'plain':!![]});switch(_0x31a152[_0x9355('0x54')]){case _0x9355('0x55'):_0x35cfcd[_0x9355('0x56')](db['sequelize'][_0x9355('0x57')](_0x28fa19(_0x31a152,_0x9355('0x58')))[_0x9355('0x2f')](function(){})[_0x9355('0x30')](_0xc43845()));break;case _0x9355('0x59'):_0x35cfcd['push'](db[_0x9355('0x5a')][_0x9355('0x57')](_0x2fc492(_0x31a152,'VoiceQueueId'))[_0x9355('0x2f')](function(){})[_0x9355('0x30')](_0xc43845()));break;default:_0x35cfcd[_0x9355('0x56')](db[_0x9355('0x5a')][_0x9355('0x57')](_0x22ab63(_0x31a152,_0x9355('0x58')))['then'](function(){})[_0x9355('0x30')](_0xc43845()));}}}return _0x35cfcd;})['all']()[_0x9355('0x2f')](function(){return db['VoiceQueue'][_0x9355('0x5b')]({'where':{'type':_0x9355('0x50')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x9355('0x5c'),'where':{'id':LISTID}}]})[_0x9355('0x2f')](function(_0x572987){var _0x34ab30=[];if(_0x572987){var _0x4a5f0a;for(var _0x36d2a0=0x0,_0x16d7ce;_0x36d2a0<_0x572987[_0x9355('0x19')];_0x36d2a0+=0x1){_0x16d7ce=_0x572987[_0x36d2a0]['get']({'plain':!![]});_0x34ab30[_0x9355('0x56')](db[_0x9355('0x5a')][_0x9355('0x57')](_0x4179a4(_0x16d7ce,_0x9355('0x58')))[_0x9355('0x2f')](function(){})[_0x9355('0x30')](_0xc43845()));}}return _0x34ab30;})[_0x9355('0x5d')]();})[_0x9355('0x2f')](function(){return db[_0x9355('0x5e')][_0x9355('0x5b')]({'attributes':['id',_0x9355('0x54')],'include':[{'model':db[_0x9355('0x51')],'as':_0x9355('0x52'),'where':{'id':LISTID}}]})[_0x9355('0x2f')](function(_0x40f1ed){var _0x32761c=[];if(_0x40f1ed){for(var _0xcbfde5=0x0,_0x4dcfcd;_0xcbfde5<_0x40f1ed[_0x9355('0x19')];_0xcbfde5+=0x1){_0x4dcfcd=_0x40f1ed[_0xcbfde5][_0x9355('0x53')]({'plain':!![]});switch(_0x4dcfcd['dialCheckDuplicateType']){case _0x9355('0x55'):_0x32761c[_0x9355('0x56')](db[_0x9355('0x5a')]['query'](_0x28fa19(_0x4dcfcd,_0x9355('0x5f')))[_0x9355('0x2f')](function(){})['catch'](_0xc43845()));break;case _0x9355('0x59'):_0x32761c[_0x9355('0x56')](db[_0x9355('0x5a')][_0x9355('0x57')](_0x2fc492(_0x4dcfcd,_0x9355('0x5f')))[_0x9355('0x2f')](function(){})[_0x9355('0x30')](_0xc43845()));break;default:_0x32761c['push'](db[_0x9355('0x5a')][_0x9355('0x57')](_0x22ab63(_0x4dcfcd,_0x9355('0x5f')))[_0x9355('0x2f')](function(){})[_0x9355('0x30')](_0xc43845()));}}}return _0x32761c;})[_0x9355('0x5d')]();})[_0x9355('0x2f')](function(){return db[_0x9355('0x5e')][_0x9355('0x5b')]({'attributes':['id'],'include':[{'model':db[_0x9355('0x51')],'as':_0x9355('0x5c'),'where':{'id':LISTID}}]})[_0x9355('0x2f')](function(_0x2521e6){var _0x71b586=[];if(_0x2521e6){for(var _0x5d1c39=0x0,_0x55d7c7;_0x5d1c39<_0x2521e6[_0x9355('0x19')];_0x5d1c39+=0x1){_0x55d7c7=_0x2521e6[_0x5d1c39]['get']({'plain':!![]});_0x71b586[_0x9355('0x56')](db[_0x9355('0x5a')]['query'](_0x4179a4(_0x55d7c7,_0x9355('0x5f')))[_0x9355('0x2f')](function(){})[_0x9355('0x30')](_0xc43845()));}}return _0x71b586;})['all']();})[_0x9355('0x30')](function(_0x1dc95d){logger[_0x9355('0x15')]('cmContact,\x20%s,\x20%s',_0x9355('0x60'),_0x1dc95d[_0x9355('0x32')]);});}var processPromises=function(_0x54d2e0){return BPromise['all'](promises)[_0x9355('0x2f')](function(_0x2ac96a){})[_0x9355('0x30')](function(_0x115879){logger[_0x9355('0x15')](_0x9355('0x61'),JSON[_0x9355('0x33')](_0x115879));})[_0x9355('0x62')](function(){socket[_0x9355('0x63')](_0x9355('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x54d2e0){return _0x54d2e0[_0x9355('0x65')]();}});};var endCsv=function(){return BPromise[_0x9355('0x66')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x9355('0x2f')](function(){socket[_0x9355('0x63')](_0x9355('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x9355('0x67')](FILEPATH);}catch(_0x3406c4){logger[_0x9355('0x15')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x9355('0x33')](_0x3406c4));}finally{process[_0x9355('0x68')](0x0);}});};process['on'](_0x9355('0x69'),function(){logger[_0x9355('0x6a')](_0x9355('0x6b'));endCsv();});function main(){return BPromise[_0x9355('0x66')]()[_0x9355('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9355('0x14')](',');return db['CmContact'][_0x9355('0x5b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x9355('0x2f')](function(_0x45dd7d){var _0x1e0ec2=fs[_0x9355('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x9355('0x6d')](_0x1e0ec2,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3094cd,_0x40e8da){total+=0x1;var _0x24c6bf=total;promises[_0x9355('0x56')](checkRow(_0x3094cd,_0x45dd7d,_0x24c6bf)[_0x9355('0x2f')](function(){success+=0x1;})[_0x9355('0x30')](function(_0x543f5f){if(_0x543f5f[_0x9355('0x15')]){errors+=0x1;delete _0x543f5f['error'];}else if(_0x543f5f[_0x9355('0x2a')]){duplicates+=0x1;delete _0x543f5f['duplicate'];}rows[_0x9355('0x56')](_0x543f5f);}));if(total%0xc8===0x0){_0x40e8da['pause']();return processPromises(_0x40e8da);}},'complete':function(){return processPromises()[_0x9355('0x2f')](function(){logger['info'](_0x9355('0x6e'));endCsv();});},'error':function(_0x278d1f,_0x16a152){logger[_0x9355('0x6a')](_0x9355('0x6f'),JSON[_0x9355('0x33')](_0x278d1f));endCsv();}});})[_0x9355('0x30')](function(_0x43395e){logger[_0x9355('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x9355('0x33')](_0x43395e));});}main(); \ No newline at end of file +var _0xc852=['phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','insert','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','findAll','outbound','CmList','dialCheckDuplicateType','always','query','VoiceQueueId','sequelize','all','BlackLists','Lists','CampaignId','Campaign','get','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','createdAt','select','field','NOW()','ContactId','toString','ListId','updatedAt','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL'];(function(_0x24b73c,_0xbdae9){var _0x329897=function(_0x426cc9){while(--_0x426cc9){_0x24b73c['push'](_0x24b73c['shift']());}};_0x329897(++_0xbdae9);}(_0xc852,0x106));var _0x2c85=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc852[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require('bluebird');var util=require(_0x2c85('0x0'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x2c85('0x1'));var Redis=require('ioredis');var db=require(_0x2c85('0x2'))['db'];var config=require(_0x2c85('0x3'));var logger=require(_0x2c85('0x4'))(_0x2c85('0x5'));config[_0x2c85('0x6')]=_['defaults'](config[_0x2c85('0x6')],{'host':_0x2c85('0x7'),'port':0x18eb});var socket=require(_0x2c85('0x8'))(new Redis(config[_0x2c85('0x6')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x2c85('0x9')][0x2]||process[_0x2c85('0x9')][0x2]===_0x2c85('0xa')||process[_0x2c85('0x9')][0x2]==='null'){throw new Error(_0x2c85('0xb'));}var FILEPATH=process[_0x2c85('0x9')][0x2];if(!process[_0x2c85('0x9')][0x3]||process[_0x2c85('0x9')][0x3]===_0x2c85('0xa')||process[_0x2c85('0x9')][0x3]==='null'||!process[_0x2c85('0x9')][0x4]||process[_0x2c85('0x9')][0x4]===_0x2c85('0xa')||process[_0x2c85('0x9')][0x4]===_0x2c85('0xc')){throw new Error(_0x2c85('0xd'));}var FIELDS=_[_0x2c85('0xe')](process[_0x2c85('0x9')][0x3][_0x2c85('0xf')](','),process[_0x2c85('0x9')][0x4][_0x2c85('0xf')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x2c85('0xa')||process[_0x2c85('0x9')][0x5]===_0x2c85('0xc')){throw new Error(_0x2c85('0x10'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x2c85('0x9')][0x6]&&process[_0x2c85('0x9')][0x6]!==_0x2c85('0xa')&&process[_0x2c85('0x9')][0x6]!==_0x2c85('0xc')?process[_0x2c85('0x9')][0x6]:null;var DUPLICATES=process[_0x2c85('0x9')][0x7]&&process[_0x2c85('0x9')][0x7]!==_0x2c85('0xa')&&process[_0x2c85('0x9')][0x7]!==_0x2c85('0xc')?process[_0x2c85('0x9')][0x7]:null;if(!process[_0x2c85('0x9')][0x8]||process[_0x2c85('0x9')][0x8]==='undefined'||process[_0x2c85('0x9')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x2c85('0x9')][0x8];}catch(_0x1d16f2){logger[_0x2c85('0x11')](_0x1d16f2);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(_0x5b6f23,_0x433cc2,_0x3a5196,_0x367043){var _0x4aa36f={'message':_0x433cc2};_0x4aa36f[_0x5b6f23]=!![];if(_0x3a5196){_0x4aa36f[_0x2c85('0x12')]=_0x3a5196;}if(_0x367043){_0x4aa36f[_0x2c85('0x13')]=_0x367043;}return _0x4aa36f;}function isEmail(_0x30fe47){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))*$/[_0x2c85('0x14')](_0x30fe47);}function checkRow(_0x30b456,_0x1bc87a,_0x68044d){return new BPromise(function(_0x432ada,_0x3161bc){if(_[_0x2c85('0x15')](_0x30b456)){return _0x3161bc(handleCheckRowError(_0x2c85('0x11'),_0x2c85('0x16'),null,_0x68044d));}if(_0x30b456[_0x2c85('0x17')]&&_0x30b456[_0x2c85('0x17')][_0x2c85('0x18')]){var _0x3635b9=_[_0x2c85('0x19')](_0x30b456['errors'],_0x2c85('0x1a'))[_0x2c85('0x1b')](';');return _0x3161bc(handleCheckRowError(_0x2c85('0x11'),_0x3635b9,null,_0x68044d));}var _0x162cef={};for(var _0x2ef97c in FIELDS){if(FIELDS[_0x2c85('0x1c')](_0x2ef97c)&&FIELDS[_0x2ef97c]){_0x162cef[_0x2ef97c]=_0x30b456['data'][0x0][FIELDS[_0x2ef97c]]||_0x30b456['data'][0x0]['\ufeff'+FIELDS[_0x2ef97c]];}}if(!_0x162cef[_0x2c85('0x1d')]){return _0x3161bc(handleCheckRowError(_0x2c85('0x11'),_0x2c85('0x1e'),null,_0x68044d));}if(!_0x162cef[_0x2c85('0x1f')]){return _0x3161bc(handleCheckRowError(_0x2c85('0x11'),_0x2c85('0x20'),null,_0x68044d));}if(_0x162cef[_0x2c85('0x21')]){var _0x45ea01=moment(_0x162cef['birthDate'],_0x2c85('0x22'));if(!_0x45ea01[_0x2c85('0x23')]()){return _0x3161bc(handleCheckRowError(_0x2c85('0x11'),_0x2c85('0x24'),null,_0x68044d));}}if(_0x162cef['email']){if(!isEmail(_0x162cef['email'])){return _0x3161bc(handleCheckRowError(_0x2c85('0x11'),_0x2c85('0x25'),null,_0x68044d));}}_0x162cef['ListId']=LISTID;_0x162cef[_0x2c85('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x2c85('0x18')]&&_0x1bc87a){var _0x2cb2c9={};for(var _0x3eb8bf=0x0,_0xb0f0af=DUPLICATES[_0x2c85('0x18')];_0x3eb8bf<_0xb0f0af;_0x3eb8bf+=0x1){_0x2cb2c9[DUPLICATES[_0x3eb8bf]]=_0x162cef[DUPLICATES[_0x3eb8bf]];}var _0x560473=_[_0x2c85('0x27')](_0x1bc87a,_0x2cb2c9);if(_0x560473){return _0x3161bc(handleCheckRowError(_0x2c85('0x28'),_0x2c85('0x29'),_0x560473,_0x68044d));}}return db['CmContact'][_0x2c85('0x2a')](_0x162cef,{'raw':!![],'hooks':![],'fields':_[_0x2c85('0x2b')](_0x162cef)})[_0x2c85('0x2c')](function(_0x5889c3){if(DUPLICATES&&DUPLICATES['length']&&_0x1bc87a){_0x1bc87a[_0x2c85('0x2d')](_['pick'](_0x162cef,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5889c3['id'];return _0x432ada();})[_0x2c85('0x2e')](function(_0x1b7710){return _0x3161bc(handleCheckRowError('error',_0x2c85('0x2f')+(_0x1b7710[_0x2c85('0x1a')]||JSON[_0x2c85('0x30')](_0x1b7710)),null,_0x68044d));});});}function checkHopper(){function _0x88acad(){return function(_0x11fdea){logger[_0x2c85('0x11')]('cmContact',_0x2c85('0x31'),util[_0x2c85('0x32')](_0x11fdea,{'showHidden':![],'depth':null}));};}var _0x1cda9c=function(_0x358d1a,_0x48062){var _0x44bc2f=squel['insert']()[_0x2c85('0x33')](_0x2c85('0x34'))[_0x2c85('0x35')](['phone',_0x2c85('0x36'),'ContactId','ListId',_0x48062,_0x2c85('0x37'),'updatedAt'],squel[_0x2c85('0x38')]()[_0x2c85('0x39')](_0x2c85('0x1f'),'phone')[_0x2c85('0x39')](_0x2c85('0x3a'),_0x2c85('0x36'))[_0x2c85('0x39')]('id',_0x2c85('0x3b'))[_0x2c85('0x39')](LISTID[_0x2c85('0x3c')](),_0x2c85('0x3d'))[_0x2c85('0x39')](_0x358d1a['id'][_0x2c85('0x3c')](),_0x48062)[_0x2c85('0x39')](_0x2c85('0x3a'),_0x2c85('0x37'))[_0x2c85('0x39')](_0x2c85('0x3a'),_0x2c85('0x3e'))['from'](_0x2c85('0x3f'))['where'](_0x2c85('0x40'))[_0x2c85('0x41')](_0x2c85('0x42'),LISTID[_0x2c85('0x3c')]())['where'](_0x2c85('0x43'))[_0x2c85('0x41')](_0x2c85('0x44'),squel[_0x2c85('0x38')]()[_0x2c85('0x39')](_0x2c85('0x1f'))[_0x2c85('0x45')](_0x2c85('0x34'))[_0x2c85('0x41')](_0x48062+_0x2c85('0x46'),_0x358d1a['id']['toString']())))[_0x2c85('0x3c')]();return _0x44bc2f;};var _0x3fdbef=function(_0x1d1327,_0x277ad9){var _0x3535bd=squel[_0x2c85('0x47')]()[_0x2c85('0x33')](_0x2c85('0x34'))[_0x2c85('0x35')]([_0x2c85('0x1f'),_0x2c85('0x36'),_0x2c85('0x3b'),'ListId',_0x277ad9,_0x2c85('0x37'),'updatedAt'],squel['select']()[_0x2c85('0x39')](_0x2c85('0x1f'),'phone')[_0x2c85('0x39')]('NOW()',_0x2c85('0x36'))[_0x2c85('0x39')]('id','ContactId')[_0x2c85('0x39')](LISTID[_0x2c85('0x3c')](),_0x2c85('0x3d'))[_0x2c85('0x39')](_0x1d1327['id']['toString'](),_0x277ad9)[_0x2c85('0x39')]('NOW()','createdAt')['field']('NOW()',_0x2c85('0x3e'))['from'](_0x2c85('0x3f'))[_0x2c85('0x41')](_0x2c85('0x40'))[_0x2c85('0x41')](_0x2c85('0x42'),LISTID[_0x2c85('0x3c')]())[_0x2c85('0x41')](_0x2c85('0x48'),squel[_0x2c85('0x49')](hopperContacts))['where'](_0x2c85('0x43'))[_0x2c85('0x41')](_0x2c85('0x44'),squel[_0x2c85('0x38')]()[_0x2c85('0x39')](_0x2c85('0x4a'))[_0x2c85('0x45')](_0x2c85('0x4b'))[_0x2c85('0x41')](_0x277ad9+'\x20=\x20?',_0x1d1327['id'][_0x2c85('0x3c')]()))[_0x2c85('0x41')](_0x2c85('0x44'),squel['select']()[_0x2c85('0x39')]('phone')[_0x2c85('0x45')]('cm_hopper')[_0x2c85('0x41')](_0x277ad9+'\x20=\x20?',_0x1d1327['id'][_0x2c85('0x3c')]())))[_0x2c85('0x3c')]();return _0x3535bd;};function _0x404f6a(_0x384ec3,_0x53e8ab){var _0x4d8c2e=squel[_0x2c85('0x47')]()[_0x2c85('0x33')](_0x2c85('0x34'))['fromQuery']([_0x2c85('0x1f'),_0x2c85('0x36'),_0x2c85('0x3b'),'ListId',_0x53e8ab,_0x2c85('0x37'),_0x2c85('0x3e')],squel['select']()[_0x2c85('0x39')](_0x2c85('0x1f'),_0x2c85('0x1f'))[_0x2c85('0x39')](_0x2c85('0x3a'),_0x2c85('0x36'))[_0x2c85('0x39')]('id',_0x2c85('0x3b'))['field'](LISTID[_0x2c85('0x3c')](),'ListId')[_0x2c85('0x39')](_0x384ec3['id']['toString'](),_0x53e8ab)['field'](_0x2c85('0x3a'),_0x2c85('0x37'))[_0x2c85('0x39')](_0x2c85('0x3a'),'updatedAt')['from'](_0x2c85('0x3f'))['where'](_0x2c85('0x40'))[_0x2c85('0x41')](_0x2c85('0x42'),LISTID[_0x2c85('0x3c')]())[_0x2c85('0x41')](_0x2c85('0x48'),squel[_0x2c85('0x49')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x4d8c2e;}function _0x113e5e(_0x152d8e,_0x5ecf30){var _0x239e05=squel[_0x2c85('0x47')]()[_0x2c85('0x33')](_0x2c85('0x4c'))['fromQuery']([_0x2c85('0x1f'),_0x2c85('0x3b'),_0x2c85('0x3d'),_0x5ecf30,'createdAt',_0x2c85('0x3e')],squel[_0x2c85('0x38')]()[_0x2c85('0x39')]('phone',_0x2c85('0x1f'))[_0x2c85('0x39')]('id',_0x2c85('0x3b'))['field'](LISTID[_0x2c85('0x3c')](),_0x2c85('0x3d'))['field'](_0x152d8e['id'][_0x2c85('0x3c')](),_0x5ecf30)[_0x2c85('0x39')](_0x2c85('0x3a'),_0x2c85('0x37'))[_0x2c85('0x39')](_0x2c85('0x3a'),_0x2c85('0x3e'))[_0x2c85('0x45')](_0x2c85('0x3f'))[_0x2c85('0x41')](_0x2c85('0x40'))[_0x2c85('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where'](_0x2c85('0x48'),squel['str'](hopperContacts))['where'](_0x2c85('0x43')))[_0x2c85('0x3c')]();return _0x239e05;}return db['VoiceQueue'][_0x2c85('0x4d')]({'where':{'type':_0x2c85('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x2c85('0x4f')],'as':'Lists','where':{'id':LISTID}}]})[_0x2c85('0x2c')](function(_0x2ee2b1){var _0x95a7d6=[];if(_0x2ee2b1){var _0x4f1f92;for(var _0x3abb48=0x0,_0x2c3ffb;_0x3abb48<_0x2ee2b1['length'];_0x3abb48+=0x1){_0x2c3ffb=_0x2ee2b1[_0x3abb48]['get']({'plain':!![]});switch(_0x2c3ffb[_0x2c85('0x50')]){case _0x2c85('0x51'):_0x95a7d6['push'](db['sequelize'][_0x2c85('0x52')](_0x3fdbef(_0x2c3ffb,_0x2c85('0x53')))[_0x2c85('0x2c')](function(){})[_0x2c85('0x2e')](_0x88acad()));break;case'onlyIfOpen':_0x95a7d6[_0x2c85('0x2d')](db[_0x2c85('0x54')]['query'](_0x1cda9c(_0x2c3ffb,_0x2c85('0x53')))['then'](function(){})['catch'](_0x88acad()));break;default:_0x95a7d6[_0x2c85('0x2d')](db[_0x2c85('0x54')]['query'](_0x404f6a(_0x2c3ffb,_0x2c85('0x53')))[_0x2c85('0x2c')](function(){})[_0x2c85('0x2e')](_0x88acad()));}}}return _0x95a7d6;})[_0x2c85('0x55')]()[_0x2c85('0x2c')](function(){return db['VoiceQueue'][_0x2c85('0x4d')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x2c85('0x4f')],'as':_0x2c85('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x184b3b){var _0x26d486=[];if(_0x184b3b){var _0x3dedea;for(var _0x20fb85=0x0,_0x4b6ccf;_0x20fb85<_0x184b3b[_0x2c85('0x18')];_0x20fb85+=0x1){_0x4b6ccf=_0x184b3b[_0x20fb85]['get']({'plain':!![]});_0x26d486['push'](db[_0x2c85('0x54')][_0x2c85('0x52')](_0x113e5e(_0x4b6ccf,_0x2c85('0x53')))['then'](function(){})['catch'](_0x88acad()));}}return _0x26d486;})[_0x2c85('0x55')]();})['then'](function(){return db['Campaign'][_0x2c85('0x4d')]({'attributes':['id',_0x2c85('0x50')],'include':[{'model':db[_0x2c85('0x4f')],'as':_0x2c85('0x57'),'where':{'id':LISTID}}]})[_0x2c85('0x2c')](function(_0x264b4d){var _0x338f6a=[];if(_0x264b4d){for(var _0x2e22d8=0x0,_0x4192a9;_0x2e22d8<_0x264b4d[_0x2c85('0x18')];_0x2e22d8+=0x1){_0x4192a9=_0x264b4d[_0x2e22d8]['get']({'plain':!![]});switch(_0x4192a9[_0x2c85('0x50')]){case'always':_0x338f6a[_0x2c85('0x2d')](db[_0x2c85('0x54')][_0x2c85('0x52')](_0x3fdbef(_0x4192a9,'CampaignId'))[_0x2c85('0x2c')](function(){})[_0x2c85('0x2e')](_0x88acad()));break;case'onlyIfOpen':_0x338f6a[_0x2c85('0x2d')](db[_0x2c85('0x54')][_0x2c85('0x52')](_0x1cda9c(_0x4192a9,_0x2c85('0x58')))[_0x2c85('0x2c')](function(){})['catch'](_0x88acad()));break;default:_0x338f6a[_0x2c85('0x2d')](db['sequelize'][_0x2c85('0x52')](_0x404f6a(_0x4192a9,_0x2c85('0x58')))[_0x2c85('0x2c')](function(){})[_0x2c85('0x2e')](_0x88acad()));}}}return _0x338f6a;})[_0x2c85('0x55')]();})[_0x2c85('0x2c')](function(){return db[_0x2c85('0x59')][_0x2c85('0x4d')]({'attributes':['id'],'include':[{'model':db[_0x2c85('0x4f')],'as':_0x2c85('0x56'),'where':{'id':LISTID}}]})[_0x2c85('0x2c')](function(_0x428d5b){var _0x14cf18=[];if(_0x428d5b){for(var _0x42647f=0x0,_0x405a3b;_0x42647f<_0x428d5b[_0x2c85('0x18')];_0x42647f+=0x1){_0x405a3b=_0x428d5b[_0x42647f][_0x2c85('0x5a')]({'plain':!![]});_0x14cf18['push'](db[_0x2c85('0x54')][_0x2c85('0x52')](_0x113e5e(_0x405a3b,_0x2c85('0x58')))[_0x2c85('0x2c')](function(){})[_0x2c85('0x2e')](_0x88acad()));}}return _0x14cf18;})[_0x2c85('0x55')]();})['catch'](function(_0x23d6b7){logger[_0x2c85('0x11')](_0x2c85('0x5b'),_0x2c85('0x5c'),_0x23d6b7[_0x2c85('0x1a')]);});}var processPromises=function(_0x212dc1){return BPromise[_0x2c85('0x55')](promises)[_0x2c85('0x2c')](function(_0x23d33f){})['catch'](function(_0xa107ed){logger[_0x2c85('0x11')](_0x2c85('0x5d'),JSON[_0x2c85('0x30')](_0xa107ed));})[_0x2c85('0x5e')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x212dc1){return _0x212dc1[_0x2c85('0x5f')]();}});};var endCsv=function(){return BPromise[_0x2c85('0x60')]()[_0x2c85('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0x2c85('0x2c')](function(){socket['emit'](_0x2c85('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x2c85('0x62')](FILEPATH);}catch(_0x37bdfc){logger[_0x2c85('0x11')](_0x2c85('0x63'),JSON[_0x2c85('0x30')](_0x37bdfc));}finally{process[_0x2c85('0x64')](0x0);}});};process['on'](_0x2c85('0x65'),function(){logger[_0x2c85('0x66')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x2c85('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x2c85('0xf')](',');return db[_0x2c85('0x67')][_0x2c85('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x2c85('0x2c')](function(_0x169b42){var _0x4d058c=fs[_0x2c85('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x2c85('0x69')](_0x4d058c,{'header':!![],'skipEmptyLines':!![],'step':function(_0x31a544,_0x4082c7){total+=0x1;var _0x4dd14c=total;promises[_0x2c85('0x2d')](checkRow(_0x31a544,_0x169b42,_0x4dd14c)[_0x2c85('0x2c')](function(){success+=0x1;})[_0x2c85('0x2e')](function(_0x56a0f9){if(_0x56a0f9[_0x2c85('0x11')]){errors+=0x1;delete _0x56a0f9[_0x2c85('0x11')];}else if(_0x56a0f9['duplicate']){duplicates+=0x1;delete _0x56a0f9[_0x2c85('0x28')];}rows[_0x2c85('0x2d')](_0x56a0f9);}));if(total%0xc8===0x0){_0x4082c7[_0x2c85('0x6a')]();return processPromises(_0x4082c7);}},'complete':function(){return processPromises()[_0x2c85('0x2c')](function(){logger['info'](_0x2c85('0x6b'));endCsv();});},'error':function(_0x298f63,_0x4afba7){logger[_0x2c85('0x66')](_0x2c85('0x6c'),JSON[_0x2c85('0x30')](_0x298f63));endCsv();}});})[_0x2c85('0x2e')](function(_0x58dbff){logger[_0x2c85('0x11')](_0x2c85('0x6d'),JSON[_0x2c85('0x30')](_0x58dbff));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index f4ff902..16fc275 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 _0xdbd8=['isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','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','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','then','length','AdditionalPhones','split','push','all','isNil','filter','CmContactHasItem','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','ContactId','ListId','updatedAt','priority','UserId','recallme','select','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','createdAt','fields','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','insert','scheduledat','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','error','message','errors','code','query','catch','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','sequelize','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','utcOffset','set','offset','dialTimezone','spread','info','main','stringify','send','binding','clone','root','server/files/tmp','.csv','ContactItemType','findAll','name','_description','header','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN'];(function(_0xaa9db,_0x24372e){var _0x4499c2=function(_0x40b2b8){while(--_0x40b2b8){_0xaa9db['push'](_0xaa9db['shift']());}};_0x4499c2(++_0x24372e);}(_0xdbd8,0x1a3));var _0x8dbd=function(_0x5e1b77,_0x3dc77e){_0x5e1b77=_0x5e1b77-0x0;var _0x237365=_0xdbd8[_0x5e1b77];return _0x237365;};'use strict';var fs=require('fs');var path=require(_0x8dbd('0x0'));var _=require(_0x8dbd('0x1'));var Papa=require(_0x8dbd('0x2'));var util=require('util');var BPromise=require(_0x8dbd('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x8dbd('0x4'));var db=require(_0x8dbd('0x5'))['db'];var config=require('../../../config/environment');var shared=require(_0x8dbd('0x6'));var logger=require(_0x8dbd('0x7'))(_0x8dbd('0x8'));config['redis']=_['defaults'](config[_0x8dbd('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dbd('0xa'))(new Redis(config[_0x8dbd('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x8dbd('0xb')](_0x8dbd('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x8dbd('0xc'));function isEmail(_0x5ae80a){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))*$/[_0x8dbd('0xd')](_0x5ae80a);}function selectNotIn(_0x1bc98f,_0x7f1da1,_0x593cce,_0x4cbb14,_0x3a8475){return squel['select']()[_0x8dbd('0xe')](_0x8dbd('0xf'))[_0x8dbd('0x10')](_0x4cbb14)[_0x8dbd('0x11')](_0x7f1da1,null,_0x7f1da1+_0x8dbd('0x12')+_0x4cbb14+'.'+_0x593cce)['where'](_0x4cbb14+'.'+_0x593cce+_0x8dbd('0x13')+_0x1bc98f+'.'+_0x593cce)[_0x8dbd('0x14')](_0x7f1da1+_0x8dbd('0x15')+_0x3a8475[_0x8dbd('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x50d06b,_0x39ed66){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x8dbd('0x16')](function(_0x48254f){if(_0x48254f!==null){var _0x2a72b2=[];for(var _0x1ee373=0x0;_0x1ee373<_0x48254f[_0x8dbd('0x17')];_0x1ee373++){var _0x154854=_0x48254f[_0x1ee373];_0x2a72b2['push'](insertAdditionalPhones(_0x154854));}}Promise['all'](_0x2a72b2)[_0x8dbd('0x16')](function(){_0x50d06b({'val':0x1});});});});}function insertAdditionalPhones(_0x5bd944){return new Promise(function(_0x57e181,_0x2285ee){var _0x5d3fff=_0x5bd944[_0x8dbd('0x18')];var _0x7611c3=_0x5d3fff[_0x8dbd('0x19')](';');var _0x5243c4=[];orderBy=0x0;for(var _0x256c6e=0x0;_0x256c6e<_0x7611c3[_0x8dbd('0x17')];_0x256c6e++){_0x5243c4[_0x8dbd('0x1a')](splitAdditionalPhone(_0x5bd944['id'],_0x7611c3[_0x256c6e]));}Promise[_0x8dbd('0x1b')](_0x5243c4)[_0x8dbd('0x16')](function(){_0x57e181({'val':_0x7611c3['length']});});});}function splitAdditionalPhone(_0x14fd5f,_0x5bf074){return new Promise(function(_0x559ddc,_0x5d05a7){var _0x4fb41f=_0x5bf074['split'](':');var _0x23e455=_0x4fb41f[0x0];var _0x33b0f8=_0x4fb41f[0x1];if(!_[_0x8dbd('0x1c')](_0x33b0f8)){var _0x5c86c9=_0x33b0f8[_0x8dbd('0x19')]('|');var _0x4ebe9e=[];for(var _0x17e9c2=0x0;_0x17e9c2<_0x5c86c9[_0x8dbd('0x17')];_0x17e9c2++){if(_0x5c86c9[_0x17e9c2]!==''){var _0x18a589=_[_0x8dbd('0x1d')](promisesAdditionalPhones,{'contactId':_0x14fd5f,'phone':_0x5c86c9[_0x17e9c2]});if(_0x18a589[_0x8dbd('0x17')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x14fd5f,'contactTypeId':_0x23e455,'phone':_0x5c86c9[_0x17e9c2],'orderBy':orderBy});}}}_0x559ddc({'ok':0x1});}else _0x559ddc({'res':0x0});});}function createAdditionalPhone(_0x44655f,_0x59dd56,_0x171e70,_0x43fae0){var _0x3b5d9f='';var _0xc2f569='';var _0x58bdfa=_0x171e70[_0x8dbd('0x19')]('§');_0x3b5d9f=_0x58bdfa[0x0];if(_0x58bdfa['length']==0x2)_0xc2f569=_0x58bdfa[0x1];return new Promise(function(_0x1fd2cf,_0xd245e4){return db[_0x8dbd('0x1e')]['findOne']({'where':{'CmContactId':_0x44655f,'item':_0x3b5d9f}})[_0x8dbd('0x16')](function(_0x19b81a){if(_0x19b81a){return db[_0x8dbd('0x1e')][_0x8dbd('0x1f')]({'ItemTypeId':_0x59dd56,'description':_0xc2f569,'OrderBy':_0x43fae0},{'where':{'CmContactId':_0x44655f,'item':_0x3b5d9f}})['then'](function(_0x50d92b){_0x1fd2cf({'res':'updated'});});}else{return db['CmContactHasItem'][_0x8dbd('0x20')]({'CmContactId':_0x44655f,'item':_0x3b5d9f,'description':_0xc2f569,'ItemTypeId':_0x59dd56,'OrderBy':_0x43fae0,'ItemClass':_0x8dbd('0x21')})[_0x8dbd('0x16')](function(_0x5bf2ae){_0x1fd2cf({'res':_0x8dbd('0x22')});});}});});}function insertCmHopper(_0x275b91,_0x58431a,_0x1fa818,_0x3cc51a,_0x5a633d){var _0x27d9b1=[_0x8dbd('0x23'),_0x8dbd('0x24'),_0x8dbd('0x25'),'cm_contacts.ListId',_0x58431a+'.'+_0x3cc51a,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x8dbd('0x26'),_0x8dbd('0x27'),'\x22'+_0x5a633d+'\x22'];return squel['insert']()[_0x8dbd('0x28')](_0x8dbd('0x29'))[_0x8dbd('0x2a')]([_0x8dbd('0xf'),'scheduledat',_0x8dbd('0x2b'),_0x8dbd('0x2c'),_0x3cc51a,'createdAt',_0x8dbd('0x2d'),_0x8dbd('0x2e'),_0x8dbd('0x2f'),_0x8dbd('0x30')],squel[_0x8dbd('0x31')]()['fields'](_0x27d9b1)[_0x8dbd('0x10')](_0x58431a)[_0x8dbd('0x11')](_0x8dbd('0x32'),null,_0x8dbd('0x33')+_0x58431a+_0x8dbd('0x34'))[_0x8dbd('0x11')](_0x1fa818,null,_0x1fa818+_0x8dbd('0x12')+_0x58431a+'.'+_0x3cc51a)[_0x8dbd('0x14')](_0x58431a+_0x8dbd('0x35'),_0x275b91)[_0x8dbd('0x14')](_0x8dbd('0x36'),NOW)[_0x8dbd('0x14')](_0x8dbd('0x37'),selectNotIn(_0x58431a,_0x1fa818,_0x3cc51a,'cm_hopper',[_0x8dbd('0x38'),_0x8dbd('0x39')]))[_0x8dbd('0x14')](_0x8dbd('0x37'),selectNotIn(_0x58431a,_0x1fa818,_0x3cc51a,'cm_hopper',[_0x8dbd('0x38')])))[_0x8dbd('0x3a')]();}function insertCmHopperBlack(_0x52e64f,_0xc5aef3,_0x5d94cc,_0x30b8b5){var _0x1fa31c=[_0x8dbd('0x23'),'cm_contacts.id',_0x8dbd('0x3b'),_0xc5aef3+'.'+_0x30b8b5,_0x8dbd('0x3c'),_0x8dbd('0x3d')];return squel['insert']()[_0x8dbd('0x28')](_0x8dbd('0x3e'))['fromQuery']([_0x8dbd('0xf'),_0x8dbd('0x2b'),_0x8dbd('0x2c'),_0x30b8b5,_0x8dbd('0x3f'),_0x8dbd('0x2d')],squel[_0x8dbd('0x31')]()[_0x8dbd('0x40')](_0x1fa31c)[_0x8dbd('0x10')](_0xc5aef3)['join']('cm_contacts',null,_0x8dbd('0x33')+_0xc5aef3+_0x8dbd('0x34'))[_0x8dbd('0x11')](_0x5d94cc,null,_0x5d94cc+_0x8dbd('0x12')+_0xc5aef3+'.'+_0x30b8b5)[_0x8dbd('0x14')](_0xc5aef3+'.CmListId\x20=\x20?',_0x52e64f)['where'](_0x8dbd('0x36'),NOW)[_0x8dbd('0x14')](_0x8dbd('0x37'),squel[_0x8dbd('0x31')]()[_0x8dbd('0xe')](_0x8dbd('0xf'))[_0x8dbd('0x10')](_0x8dbd('0x3e'))[_0x8dbd('0x14')](_0x8dbd('0x41'),_0x52e64f)[_0x8dbd('0x14')](_0x30b8b5+_0x8dbd('0x13')+_0xc5aef3+'.'+_0x30b8b5)))[_0x8dbd('0x3a')]();}function insertTzCmHopper(_0x167593,_0x1c2fa9,_0x249faf,_0xd6215e,_0x229736,_0x39a6d4){var _0x2aca23=[_0x8dbd('0x23'),_0x8dbd('0x42')+_0x39a6d4+'.offset-cm_contacts.utcOffset\x20minute)',_0x8dbd('0x25'),_0x8dbd('0x3b'),_0x1c2fa9+'.'+_0xd6215e,_0x8dbd('0x3c'),_0x8dbd('0x3d'),_0x8dbd('0x26'),_0x8dbd('0x27'),'\x22'+_0x229736+'\x22'];var _0x64db4d=squel[_0x8dbd('0x43')]()[_0x8dbd('0x28')](_0x8dbd('0x29'))[_0x8dbd('0x2a')](['phone',_0x8dbd('0x44'),_0x8dbd('0x2b'),_0x8dbd('0x2c'),_0xd6215e,'createdAt',_0x8dbd('0x2d'),'priority',_0x8dbd('0x2f'),_0x8dbd('0x30')],squel[_0x8dbd('0x31')]()[_0x8dbd('0x40')](_0x2aca23)[_0x8dbd('0x10')](_0x1c2fa9)[_0x8dbd('0x11')](_0x8dbd('0x32'),null,'cm_contacts.ListId\x20=\x20'+_0x1c2fa9+_0x8dbd('0x34'))[_0x8dbd('0x11')](_0x249faf,null,_0x249faf+_0x8dbd('0x12')+_0x1c2fa9+'.'+_0xd6215e)[_0x8dbd('0x11')](_0x39a6d4,null,_0x39a6d4+_0x8dbd('0x12')+_0x1c2fa9+'.'+_0xd6215e)[_0x8dbd('0x14')](_0x1c2fa9+_0x8dbd('0x35'),_0x167593)[_0x8dbd('0x14')](_0x8dbd('0x36'),NOW)[_0x8dbd('0x14')](_0x8dbd('0x37'),selectNotIn(_0x1c2fa9,_0x249faf,_0xd6215e,'cm_hopper',['\x22always\x22',_0x8dbd('0x39')]))[_0x8dbd('0x14')](_0x8dbd('0x37'),selectNotIn(_0x1c2fa9,_0x249faf,_0xd6215e,_0x8dbd('0x29'),[_0x8dbd('0x38')])))[_0x8dbd('0x3a')]();return _0x64db4d;}function insertTzCmHopperBlack(_0x5c90d4,_0x47b2e2,_0x38cdec,_0x480648){var _0x29c61d=['cm_contacts.phone',_0x8dbd('0x25'),_0x8dbd('0x3b'),_0x47b2e2+'.'+_0x480648,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0x8dbd('0x28')](_0x8dbd('0x3e'))[_0x8dbd('0x2a')]([_0x8dbd('0xf'),_0x8dbd('0x2b'),'ListId',_0x480648,_0x8dbd('0x3f'),_0x8dbd('0x2d')],squel[_0x8dbd('0x31')]()['fields'](_0x29c61d)['from'](_0x47b2e2)[_0x8dbd('0x11')](_0x8dbd('0x32'),null,_0x8dbd('0x33')+_0x47b2e2+_0x8dbd('0x34'))['join'](_0x38cdec,null,_0x38cdec+_0x8dbd('0x12')+_0x47b2e2+'.'+_0x480648)[_0x8dbd('0x14')](_0x47b2e2+_0x8dbd('0x35'),_0x5c90d4)[_0x8dbd('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x8dbd('0x31')]()[_0x8dbd('0xe')](_0x8dbd('0xf'))[_0x8dbd('0x10')]('cm_hopper_black')[_0x8dbd('0x14')](_0x8dbd('0x41'),_0x5c90d4)[_0x8dbd('0x14')](_0x480648+'\x20=\x20'+_0x47b2e2+'.'+_0x480648)))['toString']();}function insertCmHopperAdditionalPhones(_0x38a13d){var _0x4b06f8=['cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0x8dbd('0x45'),_0x8dbd('0x46')];return squel[_0x8dbd('0x43')]()[_0x8dbd('0x28')](_0x8dbd('0x47'))['fromQuery']([_0x8dbd('0x48'),'phone',_0x8dbd('0x49'),_0x8dbd('0x3f'),_0x8dbd('0x2d')],squel[_0x8dbd('0x31')]()[_0x8dbd('0x40')](_0x4b06f8)[_0x8dbd('0x10')](_0x8dbd('0x29'))[_0x8dbd('0x11')]('cm_contacts',null,_0x8dbd('0x4a'))[_0x8dbd('0x11')](_0x8dbd('0x4b'),null,_0x8dbd('0x4c'))[_0x8dbd('0x14')]('cm_hopper.ListId\x20=\x20?',_0x38a13d)['where'](_0x8dbd('0x36'),NOW))[_0x8dbd('0x3a')]();}function insertCmContact(_0x314a4d,_0x54dc3e,_0x1580b4,_0x1c6188){var _0x40ec18=_['concat'](_[_0x8dbd('0x4d')](_0x1c6188),[_0x8dbd('0x2c'),'CompanyId',_0x8dbd('0x3f'),_0x8dbd('0x2d')]);return squel[_0x8dbd('0x43')]()[_0x8dbd('0x28')](_0x8dbd('0x32'))[_0x8dbd('0x2a')](_0x40ec18,squel['select']()[_0x8dbd('0x40')](_0x40ec18)['from'](_0x54dc3e)[_0x8dbd('0x14')]('('+_0x1580b4[_0x8dbd('0x11')](',')+_0x8dbd('0x4e'),squel[_0x8dbd('0x31')]()['fields'](_0x1580b4)[_0x8dbd('0x10')]('cm_contacts')[_0x8dbd('0x14')](_0x8dbd('0x41'),_0x314a4d)[_0x8dbd('0x14')](_0x8dbd('0x4f')))[_0x8dbd('0x14')]('id\x20IN\x20?',squel[_0x8dbd('0x31')]()[_0x8dbd('0xe')](_0x8dbd('0x50'),_0x8dbd('0x51'))[_0x8dbd('0x10')](_0x54dc3e)[_0x8dbd('0x52')](_0x1580b4[_0x8dbd('0x11')](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x3ae09d){logger[_0x8dbd('0x53')](_0x3ae09d[_0x8dbd('0x54')]);process['exit'](0x1);}function handleError(_0x569a1b,_0x49bb5a){stats[_0x8dbd('0x55')][_0x8dbd('0x1a')]({'name':_0x49bb5a[_0x8dbd('0x56')],'message':_0x49bb5a['message'],'row':_0x569a1b});}function handleQuery(_0x2d9368){logger['info'](_0x2d9368);return db['sequelize'][_0x8dbd('0x57')](_0x2d9368)['spread'](function(_0x5ecde1){results[_0x8dbd('0x1a')](_0x5ecde1);})[_0x8dbd('0x58')](function(_0x511fef){logger[_0x8dbd('0x53')](_0x511fef['message']);});}function updateTzCampaigns(_0x11bdc5){return new Promise(function(_0x1e0906,_0x216099){var _0x16bf95=squel['select']()[_0x8dbd('0x40')](['campaigns.id',_0x8dbd('0x59')])[_0x8dbd('0x10')](_0x8dbd('0x5a'))[_0x8dbd('0x11')](_0x8dbd('0x5b'),null,_0x8dbd('0x5c'))[_0x8dbd('0x14')]('campaigns_has_cm_lists.CmListId='+_0x11bdc5);db[_0x8dbd('0x5d')]['query'](_0x16bf95[_0x8dbd('0x3a')]())['spread'](function(_0x2b9153){var _0x1aa8d6=[];for(var _0x56355b=0x0;_0x56355b<_0x2b9153[_0x8dbd('0x17')];_0x56355b++){_0x1aa8d6['push'](getTimezoneData(_0x2b9153[_0x56355b],tmp_campaigns));}BPromise[_0x8dbd('0x1b')](_0x1aa8d6)[_0x8dbd('0x16')](function(){_0x1e0906({'val':0x1});});})['catch'](function(_0x491bed){logger[_0x8dbd('0x53')](_0x491bed['message']);_0x1e0906({'val':0x0});});});}function updateTzVoiceQueues(_0x445389){return new Promise(function(_0x3c7d73,_0x495ee1){var _0x1b4ed5=squel[_0x8dbd('0x31')]()[_0x8dbd('0x40')](['voice_queues.id',_0x8dbd('0x5e')])[_0x8dbd('0x10')](_0x8dbd('0x5f'))[_0x8dbd('0x11')]('voice_queues_has_cm_lists',null,_0x8dbd('0x60'))[_0x8dbd('0x14')](_0x8dbd('0x61')+_0x445389);db[_0x8dbd('0x5d')]['query'](_0x1b4ed5[_0x8dbd('0x3a')]())['spread'](function(_0x33dcb5){var _0x3c3f58=[];for(var _0x29056f=0x0;_0x29056f<_0x33dcb5[_0x8dbd('0x17')];_0x29056f++){_0x3c3f58[_0x8dbd('0x1a')](getTimezoneData(_0x33dcb5[_0x29056f],tmp_voice_queues));}BPromise[_0x8dbd('0x1b')](_0x3c3f58)['then'](function(){_0x3c7d73({'val':0x1});});})[_0x8dbd('0x58')](function(_0x26bf83){logger[_0x8dbd('0x53')](_0x26bf83['message']);_0x3c7d73({'val':0x0});});});}function getTimezoneData(_0x1da1f6,_0x2f4eb9){return new Promise(function(_0x44d403,_0x2f51dd){var _0xc18312=shared[_0x8dbd('0x62')];var _0x36d034=_0xc18312[_0x1da1f6['dialTimezone']];if(_[_0x8dbd('0x1c')](_0x36d034)){_0x44d403({'ret':0x1});}else{var _0x3a9577=_0x36d034[_0x8dbd('0x63')];var _0x56dae8=squel['insert']()[_0x8dbd('0x28')](_0x2f4eb9)[_0x8dbd('0x64')]('id',_0x1da1f6['id'])['set'](_0x8dbd('0x65'),_0x3a9577)[_0x8dbd('0x64')]('dialTimezone',_0x1da1f6[_0x8dbd('0x66')])['toString']();return db['sequelize'][_0x8dbd('0x57')](_0x56dae8)[_0x8dbd('0x67')](function(_0x4a73cb){_0x44d403({'ret':0x1});})[_0x8dbd('0x58')](function(_0x4be838){logger[_0x8dbd('0x53')](_0x4be838['message']);_0x2f51dd({'ret':0x1});});}});}function handleTZQuery(_0x4869b5){logger[_0x8dbd('0x68')](_0x4869b5);return db[_0x8dbd('0x5d')][_0x8dbd('0x57')](_0x4869b5)[_0x8dbd('0x67')](function(_0x5b2714){})[_0x8dbd('0x58')](function(_0x4073f4){logger[_0x8dbd('0x53')](_0x4073f4[_0x8dbd('0x54')]);});}function main(_0x586a1d,_0x9f15e,_0x262b7c,_0x22ee26){logger[_0x8dbd('0x68')](_0x8dbd('0x69'),_0x586a1d,JSON[_0x8dbd('0x6a')](_0x9f15e));process[_0x8dbd('0x6b')]('start');var _0x1b3a8b=_0x9f15e[_0x8dbd('0x6c')];var _0x246dc0=_[_0x8dbd('0x6d')](_0x1b3a8b);var _0x4d7b56=_0x9f15e['socket_timestamp'];var _0x4a9762=path[_0x8dbd('0x11')](config[_0x8dbd('0x6e')],_0x8dbd('0x6f'),_0x4d7b56+_0x8dbd('0x70'));hasTZ=_[_0x8dbd('0x4d')](_0x1b3a8b)['includes'](_0x8dbd('0x66'));var _0x23ca95=_[_0x8dbd('0x4d')](_0x1b3a8b)[_0x8dbd('0x11')]();logger['info']('header',_0x23ca95);db[_0x8dbd('0x71')][_0x8dbd('0x72')]({'raw':!![],'attributes':['id','name']})[_0x8dbd('0x16')](function(_0x5269b0){for(var _0x36d1f2=0x0;_0x36d1f2<_0x5269b0[_0x8dbd('0x17')];_0x36d1f2++){if(_0x5269b0[_0x36d1f2][_0x8dbd('0x73')]in _0x1b3a8b){contactItemTypes[_0x8dbd('0x1a')](_0x5269b0[_0x36d1f2]);delete _0x246dc0[_0x5269b0[_0x36d1f2]['name']];hasAdditionalPhones=!![];}for(var _0x3a916b in _0x1b3a8b){if(_0x5269b0[_0x36d1f2]['name']+_0x8dbd('0x74')===_0x3a916b){phoneDescriptions[_0x8dbd('0x1a')]({'itemTypeId':_0x5269b0[_0x36d1f2]['id'],'description':_0x3a916b});delete _0x246dc0[_0x3a916b];}}}if(hasAdditionalPhones)_0x246dc0[_0x8dbd('0x18')]='';var _0x3df19a=_['keys'](_0x246dc0)['join']();logger[_0x8dbd('0x68')](_0x8dbd('0x75'),_0x3df19a);fs[_0x8dbd('0x76')](_0x4a9762,_0x3df19a+'\x0a');Papa[_0x8dbd('0x77')](fs[_0x8dbd('0x78')](_0x586a1d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3b5b98,_0x2f0fe0){try{for(var _0x1ac936=0x0,_0x59163b=[];_0x1ac936<_0x3b5b98[_0x8dbd('0x79')]['length'];_0x1ac936++){stats[_0x8dbd('0x7a')]+=0x1;if(_0x3b5b98['errors'][_0x1ac936]){handleError(_0x3b5b98[_0x8dbd('0x79')][_0x1ac936],_0x3b5b98['errors'][_0x1ac936]);}else{var _0x2fdc5f=[];var _0x1a5901=[];var _0x3acbbd={};for(var _0x3549f1 in _0x1b3a8b){let _0x21c483=contactItemTypes[_0x8dbd('0x7b')](_0x41e14b=>_0x41e14b[_0x8dbd('0x73')]===_0x3549f1);let _0x23d8a3=contactItemTypes[_0x8dbd('0x7b')](_0x347ed7=>_0x347ed7['name']+'_description'===_0x3549f1);if(_[_0x8dbd('0x1c')](_0x21c483)&&_[_0x8dbd('0x1c')](_0x23d8a3)){if(_0x1b3a8b[_0x8dbd('0x7c')](_0x3549f1)){if(_0x3b5b98[_0x8dbd('0x79')][_0x1ac936][_0x1b3a8b[_0x3549f1]]){var _0x2d6875=_[_0x8dbd('0x7d')](_0x3b5b98[_0x8dbd('0x79')][_0x1ac936][_0x1b3a8b[_0x3549f1]][_0x8dbd('0x7e')](/"/g,'\x27'));switch(_0x3549f1){case'scheduledat':var _0x54149b=moment(_0x2d6875,_0x8dbd('0xc'),!![]);if(_0x54149b[_0x8dbd('0x7f')]()){_0x59163b[_0x8dbd('0x1a')]('\x22'+_0x2d6875+'\x22');}else{_0x2fdc5f[_0x8dbd('0x1a')](_0x8dbd('0x80'));}break;case _0x8dbd('0x2e'):var _0x11e9c7=parseInt(_0x2d6875);_0x2d6875=_[_0x8dbd('0x81')](_0x11e9c7)||_0x11e9c7<0x0||_0x11e9c7>0x4?_0x22ee26?0x3:0x2:_0x11e9c7;_0x59163b[_0x8dbd('0x1a')]('\x22'+_0x2d6875+'\x22');break;case _0x8dbd('0x2f'):var _0x3a153d=parseInt(_0x2d6875);if(_[_0x8dbd('0x82')](_0x3a153d)&&_['includes'](_0x262b7c,_0x3a153d)){_0x59163b['push']('\x22'+_0x3a153d+'\x22');}else{_0x2fdc5f[_0x8dbd('0x1a')](_0x8dbd('0x83'));}break;case _0x8dbd('0x84'):if(isEmail(_0x2d6875)){_0x59163b[_0x8dbd('0x1a')]('\x22'+_0x2d6875+'\x22');}else{_0x2fdc5f['push'](_0x8dbd('0x85'));}break;case _0x8dbd('0x86'):var _0x5a68d6=moment(_0x2d6875,_0x8dbd('0x87'),!![]);if(_0x5a68d6[_0x8dbd('0x7f')]()){_0x59163b['push']('\x22'+_0x2d6875+'\x22');}else{_0x2fdc5f['push'](_0x8dbd('0x88'));}break;case _0x8dbd('0x66'):var _0x48680e=shared[_0x8dbd('0x62')];var _0x579dd6=_0x48680e[_0x2d6875];if(!_[_0x8dbd('0x1c')](_0x579dd6)){var _0x2c3ad8=_0x579dd6[_0x8dbd('0x63')];_0x59163b[_0x8dbd('0x1a')]('\x22'+_0x2d6875+'\x22');_0x59163b[_0x8dbd('0x1a')]('\x22'+_0x2c3ad8+'\x22');}break;default:_0x59163b['push']('\x22'+_0x2d6875+'\x22');}}else{switch(_0x3549f1){case _0x8dbd('0x89'):case'phone':_0x2fdc5f['push'](_0x3549f1+_0x8dbd('0x8a'));break;default:_0x59163b['push']('\x22\x22');}}}}else{var _0x2af4b4='';if(!_[_0x8dbd('0x1c')](_0x21c483)){if(!_0x3acbbd[_0x8dbd('0x7c')](_0x21c483['id'])){if(!_[_0x8dbd('0x1c')](_0x3b5b98['data'][_0x1ac936][_0x1b3a8b[_0x3549f1]])){var _0x2d6875=_['trim'](_0x3b5b98['data'][_0x1ac936][_0x1b3a8b[_0x3549f1]][_0x8dbd('0x7e')](/"/g,'\x27'));var _0x1a2c9f=phoneDescriptions['find'](_0x1ba543=>_0x1ba543['itemTypeId']===_0x21c483['id']);if(!_[_0x8dbd('0x1c')](_0x1a2c9f)){var _0x60d59b=_[_0x8dbd('0x7d')](_0x3b5b98['data'][_0x1ac936][_0x1b3a8b[_0x1a2c9f['description']]][_0x8dbd('0x7e')](/"/g,'\x27'));if(!_[_0x8dbd('0x1c')](_0x60d59b))_0x2d6875=_0x2d6875+'§'+_0x60d59b;}if(_0x2af4b4=='')_0x2af4b4=_0x2d6875;else _0x2af4b4+='|'+_0x2d6875;}_0x1a5901[_0x8dbd('0x1a')](_0x21c483['id']+':'+_0x2af4b4);_0x3acbbd[_0x21c483['id']]=0x1;}}}}if(hasAdditionalPhones){_0x59163b[_0x8dbd('0x1a')]('\x22'+_0x1a5901[_0x8dbd('0x11')](';')+'\x22');}if(_0x2fdc5f[_0x8dbd('0x17')]){handleError(_0x3b5b98[_0x8dbd('0x79')][_0x1ac936],{'code':_0x8dbd('0x8b'),'message':_0x2fdc5f[_0x8dbd('0x11')]()});}else{fs[_0x8dbd('0x8c')](_0x4a9762,_0x59163b[_0x8dbd('0x11')]()+'\x0a');}_0x59163b=[];}if(!(stats[_0x8dbd('0x7a')]%0xc8)){socket[_0x8dbd('0x8d')]('contact:import:'+_0x4d7b56,stats);stats[_0x8dbd('0x55')]=[];}}if(stopped){logger[_0x8dbd('0x68')](_0x8dbd('0x8e'));_0x2f0fe0[_0x8dbd('0x8f')]();}}catch(_0x235ff4){handleError(_0x3b5b98[_0x8dbd('0x79')][_0x1ac936],{'code':_0x8dbd('0x90'),'message':_0x235ff4[_0x8dbd('0x54')]});logger[_0x8dbd('0x53')](_0x8dbd('0x91'),_0x235ff4[_0x8dbd('0x54')]);}},'complete':function(){try{var _0x890ea4=[];var _0x4310bd=[];var _0x279508='cm_contacts';if(_0x9f15e[_0x8dbd('0x92')]&&_0x9f15e['duplicates']['length']){_0x279508=_0x8dbd('0x93')+_0x4d7b56;_0x890ea4['push'](_0x8dbd('0x94')+_0x279508+_0x8dbd('0x95'));}tmp_campaigns=_0x8dbd('0x96')+_0x4d7b56;tmp_voice_queues='voice_queues_'+_0x4d7b56;_0x4310bd[_0x8dbd('0x1a')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x8dbd('0x97'));_0x4310bd[_0x8dbd('0x1a')](_0x8dbd('0x94')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x8dbd('0x98')](_0x4310bd,handleTZQuery)[_0x8dbd('0x16')](function(_0x45a81e){updateTzCampaigns(_0x9f15e['ListId'])[_0x8dbd('0x16')](function(_0x256476){updateTzVoiceQueues(_0x9f15e[_0x8dbd('0x2c')])[_0x8dbd('0x16')](function(_0x5920a0){if(hasTZ)_0x3df19a=_0x3df19a['replace']('dialTimezone',_0x8dbd('0x99'));var _0x5a4b79=util[_0x8dbd('0xb')](_0x8dbd('0x9a'),_0x4a9762,_0x279508,_0x3df19a,_0x9f15e[_0x8dbd('0x2c')],_0x9f15e[_0x8dbd('0x9b')]||null,NOW,NOW);if(_[_0x8dbd('0x1c')](_0x1b3a8b[_0x8dbd('0x44')])){_0x5a4b79+=_0x8dbd('0x9c');}_0x890ea4[_0x8dbd('0x1a')](_0x5a4b79);if(_0x9f15e[_0x8dbd('0x92')]&&_0x9f15e[_0x8dbd('0x92')][_0x8dbd('0x17')]){_0x890ea4['push'](insertCmContact(_0x9f15e['ListId'],_0x279508,_0x9f15e['duplicates'],_0x1b3a8b));_0x890ea4['push'](_0x8dbd('0x9d')+_0x279508+';');}BPromise[_0x8dbd('0x98')](_0x890ea4,handleQuery)[_0x8dbd('0x16')](function(_0x4ace2a){BPromise[_0x8dbd('0x1b')]([handleAdditionalPhones()])['then'](function(){_0x890ea4=[];for(var _0x3bd81c=0x0;_0x3bd81c\x20\x20','existsSync','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','localhost','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','CmContact','findAll','then','length','push','all','split','isNil','filter','findOne','CmContactHasItem','update','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id'];(function(_0x3d6296,_0x6ae247){var _0x179a84=function(_0xf96af){while(--_0xf96af){_0x3d6296['push'](_0x3d6296['shift']());}};_0x179a84(++_0x6ae247);}(_0x3c9f,0x148));var _0xf3c9=function(_0x5fce86,_0x2f09a8){_0x5fce86=_0x5fce86-0x0;var _0x43c92b=_0x3c9f[_0x5fce86];return _0x43c92b;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xf3c9('0x0'));var Papa=require(_0xf3c9('0x1'));var util=require(_0xf3c9('0x2'));var BPromise=require(_0xf3c9('0x3'));var moment=require(_0xf3c9('0x4'));var squel=require(_0xf3c9('0x5'));var Redis=require(_0xf3c9('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0xf3c9('0x7'));var shared=require(_0xf3c9('0x8'));var logger=require(_0xf3c9('0x9'))(_0xf3c9('0xa'));config['redis']=_[_0xf3c9('0xb')](config['redis'],{'host':_0xf3c9('0xc'),'port':0x18eb});var socket=require(_0xf3c9('0xd'))(new Redis(config[_0xf3c9('0xe')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xf3c9('0xf')](_0xf3c9('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xf3c9('0xf')](_0xf3c9('0x10'));function isEmail(_0x57f568){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x57f568);}function selectNotIn(_0xf4a849,_0x2100bf,_0x4e08b7,_0x34e8e6,_0x3fc90c){return squel[_0xf3c9('0x11')]()['field'](_0xf3c9('0x12'))[_0xf3c9('0x13')](_0x34e8e6)[_0xf3c9('0x14')](_0x2100bf,null,_0x2100bf+_0xf3c9('0x15')+_0x34e8e6+'.'+_0x4e08b7)[_0xf3c9('0x16')](_0x34e8e6+'.'+_0x4e08b7+_0xf3c9('0x17')+_0xf4a849+'.'+_0x4e08b7)['where'](_0x2100bf+'.dialCheckDuplicateType\x20IN\x20('+_0x3fc90c[_0xf3c9('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4a98ea,_0x4164b4){promisesAdditionalPhones=[];return db[_0xf3c9('0x18')][_0xf3c9('0x19')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xf3c9('0x1a')](function(_0x5b2dcc){if(_0x5b2dcc!==null){var _0x227d1b=[];for(var _0x207bff=0x0;_0x207bff<_0x5b2dcc[_0xf3c9('0x1b')];_0x207bff++){var _0x2a0974=_0x5b2dcc[_0x207bff];_0x227d1b[_0xf3c9('0x1c')](insertAdditionalPhones(_0x2a0974));}}Promise[_0xf3c9('0x1d')](_0x227d1b)['then'](function(){_0x4a98ea({'val':0x1});});});});}function insertAdditionalPhones(_0x871c75){return new Promise(function(_0x1452c8,_0x15921f){var _0x434d91=_0x871c75['AdditionalPhones'];var _0x4b4d50=_0x434d91[_0xf3c9('0x1e')](';');var _0x54e7ec=[];orderBy=0x0;for(var _0x1b9c78=0x0;_0x1b9c78<_0x4b4d50[_0xf3c9('0x1b')];_0x1b9c78++){_0x54e7ec['push'](splitAdditionalPhone(_0x871c75['id'],_0x4b4d50[_0x1b9c78]));}Promise['all'](_0x54e7ec)[_0xf3c9('0x1a')](function(){_0x1452c8({'val':_0x4b4d50[_0xf3c9('0x1b')]});});});}function splitAdditionalPhone(_0x1a97bc,_0x4cd4f9){return new Promise(function(_0xdedff,_0x4a706c){var _0x29e2e4=_0x4cd4f9['split'](':');var _0x508864=_0x29e2e4[0x0];var _0x4e55dd=_0x29e2e4[0x1];if(!_[_0xf3c9('0x1f')](_0x4e55dd)){var _0x16cd3b=_0x4e55dd['split']('|');var _0x3b42c3=[];for(var _0x18b49f=0x0;_0x18b49f<_0x16cd3b[_0xf3c9('0x1b')];_0x18b49f++){if(_0x16cd3b[_0x18b49f]!==''){var _0x3a1eec=_[_0xf3c9('0x20')](promisesAdditionalPhones,{'contactId':_0x1a97bc,'phone':_0x16cd3b[_0x18b49f]});if(_0x3a1eec['length']==0x0){orderBy++;promisesAdditionalPhones[_0xf3c9('0x1c')]({'contactId':_0x1a97bc,'contactTypeId':_0x508864,'phone':_0x16cd3b[_0x18b49f],'orderBy':orderBy});}}}_0xdedff({'ok':0x1});}else _0xdedff({'res':0x0});});}function createAdditionalPhone(_0x542f60,_0x189718,_0x1ffb15,_0xad8afb){var _0x2aa3cd='';var _0x324122='';var _0xcc4cbd=_0x1ffb15[_0xf3c9('0x1e')]('§');_0x2aa3cd=_0xcc4cbd[0x0];if(_0xcc4cbd['length']==0x2)_0x324122=_0xcc4cbd[0x1];return new Promise(function(_0xd7a817,_0x2666d7){return db['CmContactHasItem'][_0xf3c9('0x21')]({'where':{'CmContactId':_0x542f60,'item':_0x2aa3cd}})['then'](function(_0xea6a98){if(_0xea6a98){return db[_0xf3c9('0x22')][_0xf3c9('0x23')]({'ItemTypeId':_0x189718,'description':_0x324122,'OrderBy':_0xad8afb},{'where':{'CmContactId':_0x542f60,'item':_0x2aa3cd}})['then'](function(_0x2ccdbd){_0xd7a817({'res':_0xf3c9('0x24')});});}else{return db[_0xf3c9('0x22')][_0xf3c9('0x25')]({'CmContactId':_0x542f60,'item':_0x2aa3cd,'description':_0x324122,'ItemTypeId':_0x189718,'OrderBy':_0xad8afb,'ItemClass':'PHONE'})[_0xf3c9('0x1a')](function(_0x283c68){_0xd7a817({'res':_0xf3c9('0x26')});});}});});}function insertCmHopper(_0x5912ab,_0x13d42f,_0x53df7b,_0x491f96,_0x52d3b7){var _0x5773e3=[_0xf3c9('0x27'),_0xf3c9('0x28'),_0xf3c9('0x29'),_0xf3c9('0x2a'),_0x13d42f+'.'+_0x491f96,_0xf3c9('0x2b'),'cm_contacts.updatedAt',_0xf3c9('0x2c'),_0xf3c9('0x2d'),'\x22'+_0x52d3b7+'\x22'];return squel['insert']()['into'](_0xf3c9('0x2e'))[_0xf3c9('0x2f')]([_0xf3c9('0x12'),'scheduledat',_0xf3c9('0x30'),_0xf3c9('0x31'),_0x491f96,_0xf3c9('0x32'),_0xf3c9('0x33'),'priority',_0xf3c9('0x34'),'recallme'],squel[_0xf3c9('0x11')]()['fields'](_0x5773e3)[_0xf3c9('0x13')](_0x13d42f)[_0xf3c9('0x14')]('cm_contacts',null,_0xf3c9('0x35')+_0x13d42f+_0xf3c9('0x36'))['join'](_0x53df7b,null,_0x53df7b+_0xf3c9('0x15')+_0x13d42f+'.'+_0x491f96)[_0xf3c9('0x16')](_0x13d42f+'.CmListId\x20=\x20?',_0x5912ab)[_0xf3c9('0x16')](_0xf3c9('0x37'),NOW)[_0xf3c9('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x13d42f,_0x53df7b,_0x491f96,_0xf3c9('0x2e'),[_0xf3c9('0x38'),'\x22onlyIfOpen\x22']))['where'](_0xf3c9('0x39'),selectNotIn(_0x13d42f,_0x53df7b,_0x491f96,'cm_hopper',[_0xf3c9('0x38')])))['toString']();}function insertCmHopperBlack(_0x5d53a1,_0x26a407,_0x547058,_0x4a3a4e){var _0x4a8c36=['cm_contacts.phone','cm_contacts.id',_0xf3c9('0x2a'),_0x26a407+'.'+_0x4a3a4e,_0xf3c9('0x2b'),_0xf3c9('0x3a')];return squel['insert']()[_0xf3c9('0x3b')](_0xf3c9('0x3c'))['fromQuery'](['phone',_0xf3c9('0x30'),_0xf3c9('0x31'),_0x4a3a4e,_0xf3c9('0x32'),_0xf3c9('0x33')],squel[_0xf3c9('0x11')]()[_0xf3c9('0x3d')](_0x4a8c36)['from'](_0x26a407)['join'](_0xf3c9('0x3e'),null,_0xf3c9('0x35')+_0x26a407+'.CmListId')[_0xf3c9('0x14')](_0x547058,null,_0x547058+_0xf3c9('0x15')+_0x26a407+'.'+_0x4a3a4e)['where'](_0x26a407+'.CmListId\x20=\x20?',_0x5d53a1)[_0xf3c9('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xf3c9('0x16')](_0xf3c9('0x39'),squel[_0xf3c9('0x11')]()['field'](_0xf3c9('0x12'))[_0xf3c9('0x13')](_0xf3c9('0x3c'))[_0xf3c9('0x16')](_0xf3c9('0x3f'),_0x5d53a1)['where'](_0x4a3a4e+_0xf3c9('0x17')+_0x26a407+'.'+_0x4a3a4e)))[_0xf3c9('0x40')]();}function insertTzCmHopper(_0x31071e,_0x170f81,_0x49a7c9,_0x37008c,_0x15ed11,_0x1274ae){var _0x19f01b=[_0xf3c9('0x27'),_0xf3c9('0x41')+_0x1274ae+'.offset-cm_contacts.utcOffset\x20minute)',_0xf3c9('0x29'),_0xf3c9('0x2a'),_0x170f81+'.'+_0x37008c,'cm_contacts.createdAt',_0xf3c9('0x3a'),'cm_contacts.priority',_0xf3c9('0x2d'),'\x22'+_0x15ed11+'\x22'];var _0x57bfb0=squel[_0xf3c9('0x42')]()[_0xf3c9('0x3b')]('cm_hopper')[_0xf3c9('0x2f')]([_0xf3c9('0x12'),_0xf3c9('0x43'),_0xf3c9('0x30'),_0xf3c9('0x31'),_0x37008c,_0xf3c9('0x32'),_0xf3c9('0x33'),'priority','UserId',_0xf3c9('0x44')],squel[_0xf3c9('0x11')]()[_0xf3c9('0x3d')](_0x19f01b)[_0xf3c9('0x13')](_0x170f81)[_0xf3c9('0x14')](_0xf3c9('0x3e'),null,_0xf3c9('0x35')+_0x170f81+_0xf3c9('0x36'))[_0xf3c9('0x14')](_0x49a7c9,null,_0x49a7c9+_0xf3c9('0x15')+_0x170f81+'.'+_0x37008c)[_0xf3c9('0x14')](_0x1274ae,null,_0x1274ae+_0xf3c9('0x15')+_0x170f81+'.'+_0x37008c)[_0xf3c9('0x16')](_0x170f81+_0xf3c9('0x45'),_0x31071e)['where'](_0xf3c9('0x37'),NOW)[_0xf3c9('0x16')](_0xf3c9('0x39'),selectNotIn(_0x170f81,_0x49a7c9,_0x37008c,'cm_hopper',[_0xf3c9('0x38'),_0xf3c9('0x46')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x170f81,_0x49a7c9,_0x37008c,_0xf3c9('0x2e'),['\x22always\x22'])))[_0xf3c9('0x40')]();return _0x57bfb0;}function insertTzCmHopperBlack(_0x1688c4,_0x1af130,_0x563b27,_0x2f3efd){var _0x4c1b73=[_0xf3c9('0x27'),'cm_contacts.id','cm_contacts.ListId',_0x1af130+'.'+_0x2f3efd,_0xf3c9('0x2b'),_0xf3c9('0x3a')];return squel[_0xf3c9('0x42')]()[_0xf3c9('0x3b')](_0xf3c9('0x3c'))['fromQuery']([_0xf3c9('0x12'),_0xf3c9('0x30'),_0xf3c9('0x31'),_0x2f3efd,_0xf3c9('0x32'),_0xf3c9('0x33')],squel[_0xf3c9('0x11')]()[_0xf3c9('0x3d')](_0x4c1b73)[_0xf3c9('0x13')](_0x1af130)[_0xf3c9('0x14')](_0xf3c9('0x3e'),null,_0xf3c9('0x35')+_0x1af130+_0xf3c9('0x36'))['join'](_0x563b27,null,_0x563b27+_0xf3c9('0x15')+_0x1af130+'.'+_0x2f3efd)[_0xf3c9('0x16')](_0x1af130+_0xf3c9('0x45'),_0x1688c4)[_0xf3c9('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xf3c9('0x16')](_0xf3c9('0x39'),squel[_0xf3c9('0x11')]()[_0xf3c9('0x47')]('phone')['from'](_0xf3c9('0x3c'))[_0xf3c9('0x16')](_0xf3c9('0x3f'),_0x1688c4)[_0xf3c9('0x16')](_0x2f3efd+_0xf3c9('0x17')+_0x1af130+'.'+_0x2f3efd)))[_0xf3c9('0x40')]();}function insertCmHopperAdditionalPhones(_0x70012e){var _0x30f74e=[_0xf3c9('0x48'),_0xf3c9('0x49'),_0xf3c9('0x4a'),_0xf3c9('0x4b'),_0xf3c9('0x4c')];return squel['insert']()[_0xf3c9('0x3b')](_0xf3c9('0x4d'))['fromQuery']([_0xf3c9('0x4e'),_0xf3c9('0x12'),_0xf3c9('0x4f'),_0xf3c9('0x32'),_0xf3c9('0x33')],squel[_0xf3c9('0x11')]()[_0xf3c9('0x3d')](_0x30f74e)[_0xf3c9('0x13')](_0xf3c9('0x2e'))[_0xf3c9('0x14')](_0xf3c9('0x3e'),null,_0xf3c9('0x50'))[_0xf3c9('0x14')]('cm_contact_has_items',null,_0xf3c9('0x51'))[_0xf3c9('0x16')]('cm_hopper.ListId\x20=\x20?',_0x70012e)['where'](_0xf3c9('0x37'),NOW))[_0xf3c9('0x40')]();}function insertCmContact(_0x4774bc,_0x511a8c,_0x275990,_0x1c0a74){var _0x4ccd94=_[_0xf3c9('0x52')](_['keys'](_0x1c0a74),[_0xf3c9('0x31'),_0xf3c9('0x53'),_0xf3c9('0x32'),_0xf3c9('0x33')]);return squel['insert']()[_0xf3c9('0x3b')](_0xf3c9('0x3e'))[_0xf3c9('0x2f')](_0x4ccd94,squel['select']()['fields'](_0x4ccd94)[_0xf3c9('0x13')](_0x511a8c)[_0xf3c9('0x16')]('('+_0x275990[_0xf3c9('0x14')](',')+_0xf3c9('0x54'),squel['select']()['fields'](_0x275990)[_0xf3c9('0x13')](_0xf3c9('0x3e'))['where'](_0xf3c9('0x3f'),_0x4774bc)[_0xf3c9('0x16')]('deletedAt\x20IS\x20NULL'))['where'](_0xf3c9('0x55'),squel[_0xf3c9('0x11')]()[_0xf3c9('0x47')](_0xf3c9('0x56'),_0xf3c9('0x57'))[_0xf3c9('0x13')](_0x511a8c)[_0xf3c9('0x58')](_0x275990['join'](','))))['toString']();}function handleStop(){logger[_0xf3c9('0x59')](_0xf3c9('0x5a'));stopped=!![];}function handleUncaughtException(_0x458c6b){logger[_0xf3c9('0x5b')](_0x458c6b[_0xf3c9('0x5c')]);process['exit'](0x1);}function handleError(_0x415885,_0x381c45){stats[_0xf3c9('0x5d')]['push']({'name':_0x381c45[_0xf3c9('0x5e')],'message':_0x381c45[_0xf3c9('0x5c')],'row':_0x415885});}function handleQuery(_0x3c5bf4){logger[_0xf3c9('0x59')](_0x3c5bf4);return db['sequelize'][_0xf3c9('0x5f')](_0x3c5bf4)['spread'](function(_0x25b28a){results['push'](_0x25b28a);})[_0xf3c9('0x60')](function(_0xf9fa0f){logger[_0xf3c9('0x5b')](_0xf9fa0f[_0xf3c9('0x5c')]);});}function updateTzCampaigns(_0xfb4cc9){return new Promise(function(_0x5b8aee,_0x5bffde){var _0x300bfc=squel['select']()[_0xf3c9('0x3d')]([_0xf3c9('0x61'),'campaigns.dialTimezone'])[_0xf3c9('0x13')]('campaigns')['join'](_0xf3c9('0x62'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0xf3c9('0x63')+_0xfb4cc9);db[_0xf3c9('0x64')]['query'](_0x300bfc[_0xf3c9('0x40')]())[_0xf3c9('0x65')](function(_0x512a7f){var _0x1fd705=[];for(var _0x371934=0x0;_0x371934<_0x512a7f['length'];_0x371934++){_0x1fd705[_0xf3c9('0x1c')](getTimezoneData(_0x512a7f[_0x371934],tmp_campaigns));}BPromise['all'](_0x1fd705)['then'](function(){_0x5b8aee({'val':0x1});});})['catch'](function(_0x576619){logger[_0xf3c9('0x5b')](_0x576619[_0xf3c9('0x5c')]);_0x5b8aee({'val':0x0});});});}function updateTzVoiceQueues(_0x406aaa){return new Promise(function(_0x36fc04,_0x2cc7aa){var _0x10b2c4=squel['select']()['fields'](['voice_queues.id',_0xf3c9('0x66')])[_0xf3c9('0x13')]('voice_queues')[_0xf3c9('0x14')](_0xf3c9('0x67'),null,_0xf3c9('0x68'))[_0xf3c9('0x16')](_0xf3c9('0x69')+_0x406aaa);db['sequelize'][_0xf3c9('0x5f')](_0x10b2c4['toString']())[_0xf3c9('0x65')](function(_0x4dc359){var _0x81562d=[];for(var _0xc56817=0x0;_0xc56817<_0x4dc359['length'];_0xc56817++){_0x81562d['push'](getTimezoneData(_0x4dc359[_0xc56817],tmp_voice_queues));}BPromise[_0xf3c9('0x1d')](_0x81562d)['then'](function(){_0x36fc04({'val':0x1});});})[_0xf3c9('0x60')](function(_0x442aa0){logger[_0xf3c9('0x5b')](_0x442aa0[_0xf3c9('0x5c')]);_0x36fc04({'val':0x0});});});}function getTimezoneData(_0x3547c0,_0x3e8206){return new Promise(function(_0x484110,_0x3c7215){var _0x188851=shared[_0xf3c9('0x6a')];var _0x531a0b=_0x188851[_0x3547c0[_0xf3c9('0x6b')]];if(_[_0xf3c9('0x1f')](_0x531a0b)){_0x484110({'ret':0x1});}else{var _0x18a715=_0x531a0b[_0xf3c9('0x6c')];var _0x3c005e=squel[_0xf3c9('0x42')]()[_0xf3c9('0x3b')](_0x3e8206)[_0xf3c9('0x6d')]('id',_0x3547c0['id'])[_0xf3c9('0x6d')](_0xf3c9('0x6e'),_0x18a715)[_0xf3c9('0x6d')](_0xf3c9('0x6b'),_0x3547c0[_0xf3c9('0x6b')])[_0xf3c9('0x40')]();return db[_0xf3c9('0x64')][_0xf3c9('0x5f')](_0x3c005e)[_0xf3c9('0x65')](function(_0x23f402){_0x484110({'ret':0x1});})[_0xf3c9('0x60')](function(_0x34c78d){logger['error'](_0x34c78d[_0xf3c9('0x5c')]);_0x3c7215({'ret':0x1});});}});}function handleTZQuery(_0x441183){logger['info'](_0x441183);return db[_0xf3c9('0x64')]['query'](_0x441183)[_0xf3c9('0x65')](function(_0x306b57){})[_0xf3c9('0x60')](function(_0x582437){logger[_0xf3c9('0x5b')](_0x582437['message']);});}function main(_0x564a6b,_0x4edd5e,_0x817daa,_0x1dd195){logger[_0xf3c9('0x59')]('main',_0x564a6b,JSON[_0xf3c9('0x6f')](_0x4edd5e));process[_0xf3c9('0x70')](_0xf3c9('0x71'));var _0x328c5e=_0x4edd5e[_0xf3c9('0x72')];var _0x99b8a5=_[_0xf3c9('0x73')](_0x328c5e);var _0x57229e=_0x4edd5e[_0xf3c9('0x74')];var _0x2444e6=path[_0xf3c9('0x14')](config[_0xf3c9('0x75')],'server/files/tmp',_0x57229e+'.csv');hasTZ=_[_0xf3c9('0x76')](_0x328c5e)[_0xf3c9('0x77')](_0xf3c9('0x6b'));var _0x4770a8=_[_0xf3c9('0x76')](_0x328c5e)['join']();logger[_0xf3c9('0x59')](_0xf3c9('0x78'),_0x4770a8);db[_0xf3c9('0x79')][_0xf3c9('0x19')]({'raw':!![],'attributes':['id',_0xf3c9('0x7a')]})[_0xf3c9('0x1a')](function(_0x5a93d0){for(var _0x42e301=0x0;_0x42e301<_0x5a93d0['length'];_0x42e301++){if(_0x5a93d0[_0x42e301][_0xf3c9('0x7a')]in _0x328c5e){contactItemTypes[_0xf3c9('0x1c')](_0x5a93d0[_0x42e301]);delete _0x99b8a5[_0x5a93d0[_0x42e301][_0xf3c9('0x7a')]];hasAdditionalPhones=!![];}for(var _0x19dabd in _0x328c5e){if(_0x5a93d0[_0x42e301][_0xf3c9('0x7a')]+_0xf3c9('0x7b')===_0x19dabd){phoneDescriptions[_0xf3c9('0x1c')]({'itemTypeId':_0x5a93d0[_0x42e301]['id'],'description':_0x19dabd});delete _0x99b8a5[_0x19dabd];}}}if(hasAdditionalPhones)_0x99b8a5[_0xf3c9('0x7c')]='';var _0x6c9021=_[_0xf3c9('0x76')](_0x99b8a5)[_0xf3c9('0x14')]();logger[_0xf3c9('0x59')](_0xf3c9('0x78'),_0x6c9021);fs[_0xf3c9('0x7d')](_0x2444e6,_0x6c9021+'\x0a');Papa[_0xf3c9('0x7e')](fs[_0xf3c9('0x7f')](_0x564a6b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4e599c,_0x1a8c89){try{for(var _0x4f9b48=0x0,_0x2e4ba2=[];_0x4f9b48<_0x4e599c[_0xf3c9('0x80')]['length'];_0x4f9b48++){stats[_0xf3c9('0x81')]+=0x1;if(_0x4e599c[_0xf3c9('0x5d')][_0x4f9b48]){handleError(_0x4e599c[_0xf3c9('0x80')][_0x4f9b48],_0x4e599c['errors'][_0x4f9b48]);}else{var _0x436b72=[];var _0x297d7c=[];var _0xd2d2b3={};for(var _0x22f607 in _0x328c5e){let _0x566ec0=contactItemTypes[_0xf3c9('0x82')](_0x56cadb=>_0x56cadb[_0xf3c9('0x7a')]===_0x22f607);let _0x2a6a18=contactItemTypes['find'](_0x17873e=>_0x17873e['name']+_0xf3c9('0x7b')===_0x22f607);if(_[_0xf3c9('0x1f')](_0x566ec0)&&_[_0xf3c9('0x1f')](_0x2a6a18)){if(_0x328c5e['hasOwnProperty'](_0x22f607)){if(_0x4e599c[_0xf3c9('0x80')][_0x4f9b48][_0x328c5e[_0x22f607]]){var _0x19d59b=_[_0xf3c9('0x83')](_0x4e599c[_0xf3c9('0x80')][_0x4f9b48][_0x328c5e[_0x22f607]][_0xf3c9('0x84')](/"/g,'\x27'));switch(_0x22f607){case _0xf3c9('0x43'):var _0x88533d=moment(_0x19d59b,_0xf3c9('0x10'),!![]);if(_0x88533d['isValid']()){_0x2e4ba2[_0xf3c9('0x1c')]('\x22'+_0x19d59b+'\x22');}else{_0x436b72[_0xf3c9('0x1c')](_0xf3c9('0x85'));}break;case _0xf3c9('0x86'):var _0xbe62da=parseInt(_0x19d59b);_0x19d59b=_[_0xf3c9('0x87')](_0xbe62da)||_0xbe62da<0x0||_0xbe62da>0x4?_0x1dd195?0x3:0x2:_0xbe62da;_0x2e4ba2['push']('\x22'+_0x19d59b+'\x22');break;case'UserId':var _0x41093a=parseInt(_0x19d59b);if(_['isNumber'](_0x41093a)&&_[_0xf3c9('0x77')](_0x817daa,_0x41093a)){_0x2e4ba2[_0xf3c9('0x1c')]('\x22'+_0x41093a+'\x22');}else{_0x436b72[_0xf3c9('0x1c')](_0xf3c9('0x88'));}break;case _0xf3c9('0x89'):if(isEmail(_0x19d59b)){_0x2e4ba2[_0xf3c9('0x1c')]('\x22'+_0x19d59b+'\x22');}else{_0x436b72[_0xf3c9('0x1c')](_0xf3c9('0x8a'));}break;case'dateOfBirth':var _0x51914f=moment(_0x19d59b,'YYYY-MM-DD',!![]);if(_0x51914f[_0xf3c9('0x8b')]()){_0x2e4ba2[_0xf3c9('0x1c')]('\x22'+_0x19d59b+'\x22');}else{_0x436b72['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0x4553ba=shared[_0xf3c9('0x6a')];var _0x3e50b1=_0x4553ba[_0x19d59b];if(!_[_0xf3c9('0x1f')](_0x3e50b1)){var _0x5594c9=_0x3e50b1[_0xf3c9('0x6c')];_0x2e4ba2[_0xf3c9('0x1c')]('\x22'+_0x19d59b+'\x22');_0x2e4ba2[_0xf3c9('0x1c')]('\x22'+_0x5594c9+'\x22');}break;default:_0x2e4ba2[_0xf3c9('0x1c')]('\x22'+_0x19d59b+'\x22');}}else{switch(_0x22f607){case _0xf3c9('0x8c'):case _0xf3c9('0x12'):_0x436b72[_0xf3c9('0x1c')](_0x22f607+_0xf3c9('0x8d'));break;default:_0x2e4ba2[_0xf3c9('0x1c')]('\x22\x22');}}}}else{var _0x49be1f='';if(!_[_0xf3c9('0x1f')](_0x566ec0)){if(!_0xd2d2b3['hasOwnProperty'](_0x566ec0['id'])){if(!_[_0xf3c9('0x1f')](_0x4e599c[_0xf3c9('0x80')][_0x4f9b48][_0x328c5e[_0x22f607]])){var _0x19d59b=_[_0xf3c9('0x83')](_0x4e599c[_0xf3c9('0x80')][_0x4f9b48][_0x328c5e[_0x22f607]]['replace'](/"/g,'\x27'));var _0x1de32e=phoneDescriptions[_0xf3c9('0x82')](_0x413993=>_0x413993['itemTypeId']===_0x566ec0['id']);if(!_[_0xf3c9('0x1f')](_0x1de32e)){var _0x3cc70a=_[_0xf3c9('0x83')](_0x4e599c['data'][_0x4f9b48][_0x328c5e[_0x1de32e['description']]][_0xf3c9('0x84')](/"/g,'\x27'));if(!_[_0xf3c9('0x1f')](_0x3cc70a))_0x19d59b=_0x19d59b+'§'+_0x3cc70a;}if(_0x49be1f=='')_0x49be1f=_0x19d59b;else _0x49be1f+='|'+_0x19d59b;}_0x297d7c[_0xf3c9('0x1c')](_0x566ec0['id']+':'+_0x49be1f);_0xd2d2b3[_0x566ec0['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2e4ba2[_0xf3c9('0x1c')]('\x22'+_0x297d7c[_0xf3c9('0x14')](';')+'\x22');}if(_0x436b72[_0xf3c9('0x1b')]){handleError(_0x4e599c[_0xf3c9('0x80')][_0x4f9b48],{'code':_0xf3c9('0x8e'),'message':_0x436b72[_0xf3c9('0x14')]()});}else{fs[_0xf3c9('0x8f')](_0x2444e6,_0x2e4ba2[_0xf3c9('0x14')]()+'\x0a');}_0x2e4ba2=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x57229e,stats);stats[_0xf3c9('0x5d')]=[];}}if(stopped){logger['info'](_0xf3c9('0x90'));_0x1a8c89[_0xf3c9('0x91')]();}}catch(_0x13c4ae){handleError(_0x4e599c['data'][_0x4f9b48],{'code':_0xf3c9('0x92'),'message':_0x13c4ae[_0xf3c9('0x5c')]});logger[_0xf3c9('0x5b')](_0xf3c9('0x93'),_0x13c4ae[_0xf3c9('0x5c')]);}},'complete':function(){try{var _0x2664dc=[];var _0x38bc38=[];var _0x2244a0=_0xf3c9('0x3e');if(_0x4edd5e[_0xf3c9('0x94')]&&_0x4edd5e[_0xf3c9('0x94')]['length']){_0x2244a0=_0xf3c9('0x95')+_0x57229e;_0x2664dc['push'](_0xf3c9('0x96')+_0x2244a0+_0xf3c9('0x97'));}tmp_campaigns=_0xf3c9('0x98')+_0x57229e;tmp_voice_queues=_0xf3c9('0x99')+_0x57229e;_0x38bc38[_0xf3c9('0x1c')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xf3c9('0x9a'));_0x38bc38[_0xf3c9('0x1c')](_0xf3c9('0x96')+tmp_voice_queues+_0xf3c9('0x9a'));BPromise[_0xf3c9('0x9b')](_0x38bc38,handleTZQuery)[_0xf3c9('0x1a')](function(_0x484d8c){updateTzCampaigns(_0x4edd5e[_0xf3c9('0x31')])[_0xf3c9('0x1a')](function(_0x5d3271){updateTzVoiceQueues(_0x4edd5e['ListId'])['then'](function(_0x24ec54){if(hasTZ)_0x6c9021=_0x6c9021['replace'](_0xf3c9('0x6b'),_0xf3c9('0x9c'));var _0x35359c=util['format'](_0xf3c9('0x9d'),_0x2444e6,_0x2244a0,_0x6c9021,_0x4edd5e[_0xf3c9('0x31')],_0x4edd5e[_0xf3c9('0x53')]||null,NOW,NOW);if(_[_0xf3c9('0x1f')](_0x328c5e[_0xf3c9('0x43')])){_0x35359c+=_0xf3c9('0x9e');}_0x2664dc['push'](_0x35359c);if(_0x4edd5e[_0xf3c9('0x94')]&&_0x4edd5e[_0xf3c9('0x94')]['length']){_0x2664dc[_0xf3c9('0x1c')](insertCmContact(_0x4edd5e[_0xf3c9('0x31')],_0x2244a0,_0x4edd5e[_0xf3c9('0x94')],_0x328c5e));_0x2664dc[_0xf3c9('0x1c')](_0xf3c9('0x9f')+_0x2244a0+';');}BPromise[_0xf3c9('0x9b')](_0x2664dc,handleQuery)[_0xf3c9('0x1a')](function(_0x1d2525){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x2664dc=[];for(var _0x2bf121=0x0;_0x2bf121\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','format','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','length'];(function(_0x2ae59b,_0x471d76){var _0x588c30=function(_0x36330c){while(--_0x36330c){_0x2ae59b['push'](_0x2ae59b['shift']());}};_0x588c30(++_0x471d76);}(_0x4178,0x7f));var _0x8417=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x4178[_0x199572];return _0x13cfa3;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x8417('0x0'));var Papa=require(_0x8417('0x1'));var util=require(_0x8417('0x2'));var BPromise=require('bluebird');var moment=require(_0x8417('0x3'));var squel=require(_0x8417('0x4'));var Redis=require(_0x8417('0x5'));var db=require(_0x8417('0x6'))['db'];var config=require(_0x8417('0x7'));var logger=require(_0x8417('0x8'))(_0x8417('0x9'));config[_0x8417('0xa')]=_[_0x8417('0xb')](config[_0x8417('0xa')],{'host':_0x8417('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8417('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x8417('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x8417('0xe')+moment()[_0x8417('0xd')](_0x8417('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x11ff9f){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))*$/[_0x8417('0x10')](_0x11ff9f);}function selectNotIn(_0x203798,_0x425d08,_0x4f6501,_0x40d2d8,_0x7f4178){return squel[_0x8417('0x11')]()[_0x8417('0x12')]('phone')[_0x8417('0x13')](_0x40d2d8)[_0x8417('0x14')](_0x425d08,null,_0x425d08+_0x8417('0x15')+_0x40d2d8+'.'+_0x4f6501)[_0x8417('0x16')](_0x40d2d8+'.'+_0x4f6501+_0x8417('0x17')+_0x203798+'.'+_0x4f6501)['where'](_0x425d08+_0x8417('0x18')+_0x7f4178[_0x8417('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4651c2,_0x1d659b){promisesAdditionalPhones=[];promisesContact=[];return db[_0x8417('0x19')][_0x8417('0x1a')](_0x8417('0x1b')+tempTableName)['spread'](function(_0x44315d){if(_0x44315d!==null){var _0x210b92=[];for(var _0x5b4a07=0x0;_0x5b4a07<_0x44315d[_0x8417('0x1c')];_0x5b4a07++){var _0x1c890d=_0x44315d[_0x5b4a07];if(!_[_0x8417('0x1d')](_0x1c890d['phone'])){if(!_[_0x8417('0x1d')](_0x1c890d[_0x8417('0x1e')]))_0x210b92[_0x8417('0x1f')](insertAdditionalPhones(_0x1c890d));promisesContact[_0x8417('0x1f')]({'contact':_0x1c890d});}}}Promise['all'](_0x210b92)[_0x8417('0x20')](function(){_0x4651c2({'val':0x1});});})['catch'](function(_0x25e4fa){logger['error'](_0x25e4fa[_0x8417('0x21')]);});});}function insertAdditionalPhones(_0x513fe0){return new Promise(function(_0x26f510,_0x5a09dc){var _0x88d985=_0x513fe0[_0x8417('0x1e')];if(_['isNil'](_0x88d985))_0x5a09dc({'val':0x0});else{var _0x53dcb6=_0x88d985[_0x8417('0x22')](';');var _0x1fdc40=[];orderBy=0x0;for(var _0x3c8699=0x0;_0x3c8699<_0x53dcb6[_0x8417('0x1c')];_0x3c8699++){_0x1fdc40[_0x8417('0x1f')](splitAdditionalPhone(_0x513fe0['id'],_0x53dcb6[_0x3c8699]));}Promise['all'](_0x1fdc40)['then'](function(){_0x26f510({'val':_0x53dcb6[_0x8417('0x1c')]});});}});}function splitAdditionalPhone(_0xa544c1,_0x10abdd){return new Promise(function(_0x3361d0,_0x1bdd27){var _0x5468ae=_0x10abdd[_0x8417('0x22')](':');var _0x215170=_0x5468ae[0x0];var _0x24fd46=_0x5468ae[0x1];if(_0x24fd46!==''){var _0x2ffa17=_0x24fd46[_0x8417('0x22')]('|');var _0x4f493f=[];for(var _0x384a55=0x0;_0x384a55<_0x2ffa17[_0x8417('0x1c')];_0x384a55++){if(_0x2ffa17[_0x384a55]!==''){var _0x4abc0a=_[_0x8417('0x23')](promisesAdditionalPhones,{'contactId':_0xa544c1,'phone':_0x2ffa17[_0x384a55]});if(_0x4abc0a[_0x8417('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x8417('0x1f')]({'contactId':_0xa544c1,'contactTypeId':_0x215170,'phone':_0x2ffa17[_0x384a55],'orderBy':orderBy});}}}_0x3361d0({'ok':0x1});}else _0x3361d0({'res':0x0});});}function createAdditionalPhone(_0x484a19,_0x3d7a71,_0x46d5ab,_0x4efcf4){var _0xc385f='';var _0x301ad2='';var _0x1896cb=_0x46d5ab[_0x8417('0x22')]('§');_0xc385f=_0x1896cb[0x0];if(_0x1896cb['length']==0x2)_0x301ad2=_0x1896cb[0x1];return new Promise(function(_0x5ef851,_0x2d5f12){return db[_0x8417('0x24')][_0x8417('0x25')]({'where':{'CmContactId':_0x484a19,'item':_0xc385f}})['then'](function(_0x227766){if(_0x227766){return db[_0x8417('0x24')][_0x8417('0x26')]({'ItemTypeId':_0x3d7a71,'description':_0x301ad2,'OrderBy':_0x4efcf4},{'where':{'CmContactId':_0x484a19,'item':_0xc385f}})[_0x8417('0x20')](function(_0x2d996f){_0x5ef851({'res':_0x8417('0x27')});});}else{return db[_0x8417('0x24')]['create']({'CmContactId':_0x484a19,'item':_0xc385f,'ItemTypeId':_0x3d7a71,'description':_0x301ad2,'OrderBy':_0x4efcf4,'ItemClass':_0x8417('0x28')})[_0x8417('0x20')](function(_0x2547a8){_0x5ef851({'res':_0x8417('0x29')});});}});});}function updateContact(_0x5a4fa8){return new Promise(function(_0x14fe2e,_0x240195){var _0x133b8d=_0x5a4fa8['id'];delete _0x5a4fa8['id'];return db[_0x8417('0x2a')][_0x8417('0x26')](_0x5a4fa8,{'where':{'id':_0x133b8d}})[_0x8417('0x20')](function(_0xd9b5ce){updatedRows+=0x1;return db[_0x8417('0x2b')][_0x8417('0x26')]({'phone':_0x5a4fa8[_0x8417('0x2c')]},{'where':{'ContactId':_0x133b8d}})[_0x8417('0x20')](function(_0x308640){_0x14fe2e({'ret':'OK'});});});});}function insertCmHopper(_0x232676,_0x4129fc,_0x3d2273,_0x4994c3,_0x1ccf1b){var _0x348c0e=[_0x8417('0x2d'),_0x8417('0x2e'),_0x8417('0x2f'),_0x8417('0x30'),_0x4129fc+'.'+_0x4994c3,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0x8417('0x31'),'\x22'+_0x1ccf1b+'\x22'];return squel[_0x8417('0x32')]()[_0x8417('0x33')]('cm_hopper')[_0x8417('0x34')]([_0x8417('0x2c'),_0x8417('0x35'),'ContactId',_0x8417('0x36'),_0x4994c3,'createdAt',_0x8417('0x37'),_0x8417('0x38'),_0x8417('0x39'),_0x8417('0x3a')],squel[_0x8417('0x11')]()[_0x8417('0x3b')](_0x348c0e)[_0x8417('0x13')](_0x4129fc)[_0x8417('0x14')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x4129fc+_0x8417('0x3c'))[_0x8417('0x14')](_0x3d2273,null,_0x3d2273+_0x8417('0x15')+_0x4129fc+'.'+_0x4994c3)[_0x8417('0x16')](_0x4129fc+_0x8417('0x3d'),_0x232676)[_0x8417('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x8417('0x3e'),selectNotIn(_0x4129fc,_0x3d2273,_0x4994c3,_0x8417('0x3f'),['\x22always\x22',_0x8417('0x40')]))[_0x8417('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4129fc,_0x3d2273,_0x4994c3,'cm_hopper',[_0x8417('0x41')])))[_0x8417('0x42')]();}function insertCmHopperBlack(_0x3e5fad,_0x292d0c,_0x50fed0,_0x427363){var _0xdd61b5=[_0x8417('0x2d'),_0x8417('0x2f'),'cm_contacts.ListId',_0x292d0c+'.'+_0x427363,'cm_contacts.createdAt',_0x8417('0x43')];return squel['insert']()['into'](_0x8417('0x44'))[_0x8417('0x34')]([_0x8417('0x2c'),_0x8417('0x45'),_0x8417('0x36'),_0x427363,'createdAt',_0x8417('0x37')],squel['select']()[_0x8417('0x3b')](_0xdd61b5)[_0x8417('0x13')](_0x292d0c)['join']('cm_contacts',null,_0x8417('0x46')+_0x292d0c+_0x8417('0x3c'))[_0x8417('0x14')](_0x50fed0,null,_0x50fed0+'.id\x20=\x20'+_0x292d0c+'.'+_0x427363)[_0x8417('0x16')](_0x292d0c+_0x8417('0x3d'),_0x3e5fad)[_0x8417('0x16')](_0x8417('0x47'),NOW)['where'](_0x8417('0x3e'),squel[_0x8417('0x11')]()[_0x8417('0x12')](_0x8417('0x2c'))[_0x8417('0x13')]('cm_hopper_black')[_0x8417('0x16')]('ListId\x20=\x20?',_0x3e5fad)['where'](_0x427363+'\x20=\x20?',_0x292d0c+'.'+_0x427363)))['toString']();}function insertCmHopperAdditionalPhones(_0xecad5e){var _0x69185e=['cm_hopper.id',_0x8417('0x48'),'cm_contact_has_items.OrderBy',_0x8417('0x49'),_0x8417('0x4a')];return squel[_0x8417('0x32')]()[_0x8417('0x33')](_0x8417('0x4b'))[_0x8417('0x34')]([_0x8417('0x4c'),'phone',_0x8417('0x4d'),_0x8417('0x4e'),_0x8417('0x37')],squel[_0x8417('0x11')]()[_0x8417('0x3b')](_0x69185e)[_0x8417('0x13')](_0x8417('0x3f'))[_0x8417('0x14')]('cm_contacts',null,_0x8417('0x4f'))['join']('cm_contact_has_items',null,_0x8417('0x50'))['where'](_0x8417('0x51'),_0xecad5e)[_0x8417('0x16')](_0x8417('0x47'),NOW))['toString']();}function insertCmContact(_0x18f119,_0x3828b4,_0x1b201b,_0x49deee){var _0x63dfe8=_['concat'](_[_0x8417('0x52')](_0x49deee),[_0x8417('0x36'),_0x8417('0x53'),_0x8417('0x4e'),_0x8417('0x37')]);return squel['insert']()['into'](_0x8417('0x54'))['fromQuery'](_0x63dfe8,squel[_0x8417('0x11')]()[_0x8417('0x3b')](_0x63dfe8)[_0x8417('0x13')](_0x3828b4)[_0x8417('0x16')]('('+_0x1b201b[_0x8417('0x14')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x8417('0x3b')](_0x1b201b)['from'](_0x8417('0x54'))[_0x8417('0x16')](_0x8417('0x55'),_0x18f119))['where']('id\x20IN\x20?',squel[_0x8417('0x11')]()[_0x8417('0x12')]('MIN(id)',_0x8417('0x56'))['from'](_0x3828b4)['group'](_0x1b201b[_0x8417('0x14')](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x750d9a){logger[_0x8417('0x57')](_0x750d9a[_0x8417('0x21')]);process[_0x8417('0x58')](0x1);}function handleError(_0x53130f,_0x3d4796){stats[_0x8417('0x59')][_0x8417('0x1f')]({'name':_0x3d4796[_0x8417('0x5a')],'message':_0x3d4796[_0x8417('0x21')],'row':_0x53130f});}function handleQuery(_0x207410){logger[_0x8417('0x5b')](_0x207410);return db[_0x8417('0x19')][_0x8417('0x1a')](_0x207410)[_0x8417('0x5c')](function(_0x5a5b6f){results['push'](_0x5a5b6f);})[_0x8417('0x5d')](function(_0x113228){logger['error'](_0x113228[_0x8417('0x21')]);});}function main(_0x487ecc,_0x3b633f,_0xdf1e0d,_0x1157bd){logger[_0x8417('0x5b')](_0x8417('0x5e'),_0x487ecc,JSON['stringify'](_0x3b633f));process[_0x8417('0x5f')](_0x8417('0x60'));var _0x4ef103=_0x3b633f[_0x8417('0x61')];var _0x377d8a=_['clone'](_0x4ef103);var _0x13c451=_0x3b633f[_0x8417('0x62')];var _0x8ef012=path[_0x8417('0x14')](config[_0x8417('0x63')],'server/files/tmp',_0x13c451+_0x8417('0x64'));logger[_0x8417('0x5b')](_0x8417('0x65'),_0x3b633f);db[_0x8417('0x66')][_0x8417('0x67')]({'raw':!![],'attributes':['id',_0x8417('0x68')]})[_0x8417('0x20')](function(_0x122535){for(var _0x37a71e=0x0;_0x37a71e<_0x122535[_0x8417('0x1c')];_0x37a71e++){if(_0x122535[_0x37a71e][_0x8417('0x68')]in _0x4ef103){contactItemTypes['push'](_0x122535[_0x37a71e]);delete _0x377d8a[_0x122535[_0x37a71e][_0x8417('0x68')]];hasAdditionalPhones=!![];}for(var _0x5bb1cd in _0x4ef103){if(_0x122535[_0x37a71e]['name']+_0x8417('0x69')===_0x5bb1cd){phoneDescriptions[_0x8417('0x1f')]({'itemTypeId':_0x122535[_0x37a71e]['id'],'description':_0x5bb1cd});delete _0x377d8a[_0x5bb1cd];}}}if(hasAdditionalPhones)_0x377d8a['AdditionalPhones']='';var _0x2fb773=_[_0x8417('0x52')](_0x377d8a)[_0x8417('0x14')]();logger['info'](_0x8417('0x6a'),_0x2fb773);fs[_0x8417('0x6b')](_0x8ef012,_0x2fb773+'\x0a');Papa['parse'](fs[_0x8417('0x6c')](_0x487ecc),{'header':!![],'skipEmptyLines':!![],'step':function(_0x272fe9,_0x353308){try{for(var _0x328166=0x0,_0x52fe7c=[];_0x328166<_0x272fe9['data'][_0x8417('0x1c')];_0x328166++){stats[_0x8417('0x6d')]+=0x1;if(_0x272fe9['errors'][_0x328166]){handleError(_0x272fe9[_0x8417('0x6e')][_0x328166],_0x272fe9[_0x8417('0x59')][_0x328166]);}else{var _0x2991a8=[];var _0x587b20=[];var _0x54e0f8={};for(var _0x9c8c86 in _0x4ef103){let _0xe4c3cd=contactItemTypes[_0x8417('0x6f')](_0x500792=>_0x500792['name']===_0x9c8c86);let _0x128151=contactItemTypes[_0x8417('0x6f')](_0x2b86ca=>_0x2b86ca[_0x8417('0x68')]+_0x8417('0x69')===_0x9c8c86);if(_['isNil'](_0xe4c3cd)&&_['isNil'](_0x128151)){if(_0x4ef103['hasOwnProperty'](_0x9c8c86)){if(_0x272fe9[_0x8417('0x6e')][_0x328166][_0x4ef103[_0x9c8c86]]){var _0x34703a=_[_0x8417('0x70')](_0x272fe9['data'][_0x328166][_0x4ef103[_0x9c8c86]]['replace'](/"/g,'\x27'));switch(_0x9c8c86){case _0x8417('0x35'):var _0xd07b96=moment(_0x34703a,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xd07b96['isValid']()){_0x52fe7c[_0x8417('0x1f')]('\x22'+_0x34703a+'\x22');}else{_0x2991a8[_0x8417('0x1f')](_0x8417('0x71'));}break;case'priority':var _0x1f8a7e=parseInt(_0x34703a);_0x34703a=_[_0x8417('0x72')](_0x1f8a7e)||_0x1f8a7e<0x0||_0x1f8a7e>0x4?_0x1157bd?0x3:0x2:_0x1f8a7e;_0x52fe7c['push']('\x22'+_0x34703a+'\x22');break;case _0x8417('0x39'):var _0xe6d25d=parseInt(_0x34703a);if(_[_0x8417('0x73')](_0xe6d25d)&&_[_0x8417('0x74')](_0xdf1e0d,_0xe6d25d)){_0x52fe7c[_0x8417('0x1f')]('\x22'+_0xe6d25d+'\x22');}else{_0x2991a8['push'](_0x8417('0x75'));}break;case'email':if(isEmail(_0x34703a)){_0x52fe7c[_0x8417('0x1f')]('\x22'+_0x34703a+'\x22');}else{_0x2991a8[_0x8417('0x1f')](_0x8417('0x76'));}break;case _0x8417('0x77'):var _0x13d09d=moment(_0x34703a,_0x8417('0x78'),!![]);if(_0x13d09d[_0x8417('0x79')]()){_0x52fe7c[_0x8417('0x1f')]('\x22'+_0x34703a+'\x22');}else{_0x2991a8[_0x8417('0x1f')](_0x8417('0x7a'));}break;default:_0x52fe7c[_0x8417('0x1f')]('\x22'+_0x34703a+'\x22');}}else{switch(_0x9c8c86){case _0x8417('0x7b'):case'phone':_0x2991a8[_0x8417('0x1f')](_0x9c8c86+'\x20not\x20specified');break;default:_0x52fe7c[_0x8417('0x1f')]('\x22\x22');}}}}else{var _0x815de='';if(!_['isNil'](_0xe4c3cd)){if(!_0x54e0f8[_0x8417('0x7c')](_0xe4c3cd['id'])){for(var _0x425b34=0x0;_0x425b34<_0x4ef103[_0x9c8c86]['length'];_0x425b34++){var _0x34703a=_[_0x8417('0x70')](_0x272fe9[_0x8417('0x6e')][_0x328166][_0x4ef103[_0x9c8c86][_0x425b34]]['replace'](/"/g,'\x27'));var _0x31147e=phoneDescriptions[_0x8417('0x6f')](_0x3047df=>_0x3047df['itemTypeId']===_0xe4c3cd['id']);if(!_['isNil'](_0x31147e)){var _0x2eaa0f=_['trim'](_0x272fe9[_0x8417('0x6e')][_0x328166][_0x4ef103[_0x31147e['description']][0x0]][_0x8417('0x7d')](/"/g,'\x27'));if(!_[_0x8417('0x1d')](_0x2eaa0f))_0x34703a=_0x34703a+'§'+_0x2eaa0f;}if(_0x815de=='')_0x815de=_0x34703a;else _0x815de+='|'+_0x34703a;}_0x587b20[_0x8417('0x1f')](_0xe4c3cd['id']+':'+_0x815de);_0x54e0f8[_0xe4c3cd['id']]=0x1;}}}}if(hasAdditionalPhones){_0x52fe7c[_0x8417('0x1f')]('\x22'+_0x587b20[_0x8417('0x14')](';')+'\x22');}if(_0x2991a8[_0x8417('0x1c')]){handleError(_0x272fe9['data'][_0x328166],{'code':_0x8417('0x7e'),'message':_0x2991a8['join']()});}else{fs[_0x8417('0x7f')](_0x8ef012,_0x52fe7c[_0x8417('0x14')]()+'\x0a');}_0x52fe7c=[];}if(!(stats[_0x8417('0x6d')]%0xc8)){socket[_0x8417('0x80')](_0x8417('0x81')+_0x13c451,stats);stats[_0x8417('0x59')]=[];}}if(stopped){logger[_0x8417('0x5b')]('Abort\x20parser');_0x353308[_0x8417('0x82')]();}}catch(_0x4424c4){handleError(_0x272fe9[_0x8417('0x6e')][_0x328166],{'code':'SystemError','message':_0x4424c4[_0x8417('0x21')]});logger['error'](_0x8417('0x83'),_0x4424c4['message']);}},'complete':function(){try{var _0x37b6ac=[];var _0x20638f=tempTableName;_0x37b6ac[_0x8417('0x1f')]('CREATE\x20TABLE\x20'+_0x20638f+_0x8417('0x84'));logger[_0x8417('0x5b')]('CIS\x20len',contactItemTypes[_0x8417('0x1c')]);var _0x3cff7a=util[_0x8417('0xd')](_0x8417('0x85'),_0x8ef012,_0x20638f,_0x2fb773,_0x3b633f[_0x8417('0x36')],_0x3b633f[_0x8417('0x53')]||null,NOW,NOW);if(_[_0x8417('0x1d')](_0x4ef103[_0x8417('0x35')])){_0x3cff7a+=_0x8417('0x86');}_0x37b6ac[_0x8417('0x1f')](_0x3cff7a);BPromise['each'](_0x37b6ac,handleQuery)['then'](function(_0x461206){BPromise[_0x8417('0x87')]([handleAdditionalPhones()])['then'](function(){_0x37b6ac=[];for(var _0x3e3926=0x0;_0x3e3926\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','UserId','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','filter','CmContactHasItem','findOne','update','updated','PHONE','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','insert','cm_hopper_black','ListId','createdAt','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','MIN(id)','group','info','Received\x20SIGINT','code','query','stringify','send','start','binding','clone','socket_timestamp','root','.csv','body','findAll','name','_description','header','writeFileSync','parse','createReadStream','data','rows','errors','find','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','hasOwnProperty','itemTypeId','description','SystemRow','appendFileSync','contact:import:','Abort\x20parser','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','CompanyId',',\x20scheduledAt\x20=\x20NOW()','each','contact'];(function(_0x26413a,_0xf989d2){var _0x3c0e28=function(_0x277a2d){while(--_0x277a2d){_0x26413a['push'](_0x26413a['shift']());}};_0x3c0e28(++_0xf989d2);}(_0x62ff,0x1e5));var _0xf62f=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x62ff[_0x5a95fa];return _0x1a61b8;};'use strict';var fs=require('fs');var path=require(_0xf62f('0x0'));var _=require(_0xf62f('0x1'));var Papa=require('papaparse');var util=require(_0xf62f('0x2'));var BPromise=require(_0xf62f('0x3'));var moment=require(_0xf62f('0x4'));var squel=require(_0xf62f('0x5'));var Redis=require(_0xf62f('0x6'));var db=require(_0xf62f('0x7'))['db'];var config=require(_0xf62f('0x8'));var logger=require('../../../config/logger')(_0xf62f('0x9'));config[_0xf62f('0xa')]=_[_0xf62f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf62f('0xc'))(new Redis(config[_0xf62f('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xf62f('0xd')](_0xf62f('0xe'));var tempTableName=_0xf62f('0xf')+moment()[_0xf62f('0xd')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x1ca783){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x1ca783);}function selectNotIn(_0x6e5ead,_0x226349,_0x50a059,_0x50dc55,_0x3da720){return squel[_0xf62f('0x10')]()[_0xf62f('0x11')](_0xf62f('0x12'))[_0xf62f('0x13')](_0x50dc55)[_0xf62f('0x14')](_0x226349,null,_0x226349+_0xf62f('0x15')+_0x50dc55+'.'+_0x50a059)[_0xf62f('0x16')](_0x50dc55+'.'+_0x50a059+_0xf62f('0x17')+_0x6e5ead+'.'+_0x50a059)['where'](_0x226349+_0xf62f('0x18')+_0x3da720[_0xf62f('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x172faf,_0x16f57b){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize']['query']('select\x20*\x20from\x20'+tempTableName)[_0xf62f('0x19')](function(_0x5cd973){if(_0x5cd973!==null){var _0x1badba=[];for(var _0x1b8a4c=0x0;_0x1b8a4c<_0x5cd973[_0xf62f('0x1a')];_0x1b8a4c++){var _0x3fd1d1=_0x5cd973[_0x1b8a4c];if(!_['isNil'](_0x3fd1d1['phone'])){if(!_[_0xf62f('0x1b')](_0x3fd1d1[_0xf62f('0x1c')]))_0x1badba['push'](insertAdditionalPhones(_0x3fd1d1));promisesContact[_0xf62f('0x1d')]({'contact':_0x3fd1d1});}}}Promise[_0xf62f('0x1e')](_0x1badba)[_0xf62f('0x1f')](function(){_0x172faf({'val':0x1});});})[_0xf62f('0x20')](function(_0xc83206){logger[_0xf62f('0x21')](_0xc83206[_0xf62f('0x22')]);});});}function insertAdditionalPhones(_0x6e3326){return new Promise(function(_0x2f8a91,_0x1266f6){var _0x2f1e12=_0x6e3326['AdditionalPhones'];if(_['isNil'](_0x2f1e12))_0x1266f6({'val':0x0});else{var _0x5f5a31=_0x2f1e12[_0xf62f('0x23')](';');var _0x2b6387=[];orderBy=0x0;for(var _0x5791a7=0x0;_0x5791a7<_0x5f5a31[_0xf62f('0x1a')];_0x5791a7++){_0x2b6387[_0xf62f('0x1d')](splitAdditionalPhone(_0x6e3326['id'],_0x5f5a31[_0x5791a7]));}Promise[_0xf62f('0x1e')](_0x2b6387)[_0xf62f('0x1f')](function(){_0x2f8a91({'val':_0x5f5a31['length']});});}});}function splitAdditionalPhone(_0x193d6f,_0x483ac4){return new Promise(function(_0x5f224f,_0x3c35d1){var _0x539b7f=_0x483ac4['split'](':');var _0x319097=_0x539b7f[0x0];var _0x1fa792=_0x539b7f[0x1];if(_0x1fa792!==''){var _0x4c9624=_0x1fa792['split']('|');var _0x47bddb=[];for(var _0x2e1f26=0x0;_0x2e1f26<_0x4c9624['length'];_0x2e1f26++){if(_0x4c9624[_0x2e1f26]!==''){var _0x3c8d64=_[_0xf62f('0x24')](promisesAdditionalPhones,{'contactId':_0x193d6f,'phone':_0x4c9624[_0x2e1f26]});if(_0x3c8d64[_0xf62f('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0xf62f('0x1d')]({'contactId':_0x193d6f,'contactTypeId':_0x319097,'phone':_0x4c9624[_0x2e1f26],'orderBy':orderBy});}}}_0x5f224f({'ok':0x1});}else _0x5f224f({'res':0x0});});}function createAdditionalPhone(_0x17a8fe,_0x26f68a,_0x23dec6,_0x3b241f){var _0x31c28b='';var _0x37da66='';var _0x1b2f33=_0x23dec6[_0xf62f('0x23')]('§');_0x31c28b=_0x1b2f33[0x0];if(_0x1b2f33[_0xf62f('0x1a')]==0x2)_0x37da66=_0x1b2f33[0x1];return new Promise(function(_0x477d58,_0x503aa5){return db[_0xf62f('0x25')][_0xf62f('0x26')]({'where':{'CmContactId':_0x17a8fe,'item':_0x31c28b}})[_0xf62f('0x1f')](function(_0x317a7a){if(_0x317a7a){return db['CmContactHasItem'][_0xf62f('0x27')]({'ItemTypeId':_0x26f68a,'description':_0x37da66,'OrderBy':_0x3b241f},{'where':{'CmContactId':_0x17a8fe,'item':_0x31c28b}})[_0xf62f('0x1f')](function(_0x250f64){_0x477d58({'res':_0xf62f('0x28')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x17a8fe,'item':_0x31c28b,'ItemTypeId':_0x26f68a,'description':_0x37da66,'OrderBy':_0x3b241f,'ItemClass':_0xf62f('0x29')})[_0xf62f('0x1f')](function(_0x1ea72c){_0x477d58({'res':'inserted'});});}});});}function updateContact(_0x4cf228){return new Promise(function(_0x9c9b79,_0x2dc4a3){var _0x2c1bb3=_0x4cf228['id'];delete _0x4cf228['id'];return db['CmContact']['update'](_0x4cf228,{'where':{'id':_0x2c1bb3}})[_0xf62f('0x1f')](function(_0x29757b){updatedRows+=0x1;return db['CmHopper'][_0xf62f('0x27')]({'phone':_0x4cf228[_0xf62f('0x12')]},{'where':{'ContactId':_0x2c1bb3}})[_0xf62f('0x1f')](function(_0x1b89bf){_0x9c9b79({'ret':'OK'});});});});}function insertCmHopper(_0x33af9b,_0x1a98d7,_0x4ed9ee,_0xb2d47b,_0x1451c0){var _0x3ff524=[_0xf62f('0x2a'),'cm_contacts.scheduledat',_0xf62f('0x2b'),_0xf62f('0x2c'),_0x1a98d7+'.'+_0xb2d47b,_0xf62f('0x2d'),_0xf62f('0x2e'),_0xf62f('0x2f'),_0xf62f('0x30'),'\x22'+_0x1451c0+'\x22'];return squel['insert']()[_0xf62f('0x31')](_0xf62f('0x32'))[_0xf62f('0x33')]([_0xf62f('0x12'),_0xf62f('0x34'),_0xf62f('0x35'),'ListId',_0xb2d47b,'createdAt',_0xf62f('0x36'),_0xf62f('0x37'),'UserId',_0xf62f('0x38')],squel[_0xf62f('0x10')]()[_0xf62f('0x39')](_0x3ff524)[_0xf62f('0x13')](_0x1a98d7)[_0xf62f('0x14')](_0xf62f('0x3a'),null,_0xf62f('0x3b')+_0x1a98d7+_0xf62f('0x3c'))[_0xf62f('0x14')](_0x4ed9ee,null,_0x4ed9ee+'.id\x20=\x20'+_0x1a98d7+'.'+_0xb2d47b)['where'](_0x1a98d7+_0xf62f('0x3d'),_0x33af9b)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xf62f('0x16')](_0xf62f('0x3e'),selectNotIn(_0x1a98d7,_0x4ed9ee,_0xb2d47b,_0xf62f('0x32'),[_0xf62f('0x3f'),_0xf62f('0x40')]))['where'](_0xf62f('0x3e'),selectNotIn(_0x1a98d7,_0x4ed9ee,_0xb2d47b,_0xf62f('0x32'),['\x22always\x22'])))[_0xf62f('0x41')]();}function insertCmHopperBlack(_0x506a41,_0x17cad6,_0x16ca96,_0x4d7057){var _0x388181=[_0xf62f('0x2a'),_0xf62f('0x2b'),_0xf62f('0x2c'),_0x17cad6+'.'+_0x4d7057,_0xf62f('0x2d'),'cm_contacts.updatedAt'];return squel[_0xf62f('0x42')]()[_0xf62f('0x31')](_0xf62f('0x43'))['fromQuery']([_0xf62f('0x12'),_0xf62f('0x35'),_0xf62f('0x44'),_0x4d7057,_0xf62f('0x45'),_0xf62f('0x36')],squel['select']()[_0xf62f('0x39')](_0x388181)[_0xf62f('0x13')](_0x17cad6)[_0xf62f('0x14')](_0xf62f('0x3a'),null,_0xf62f('0x3b')+_0x17cad6+_0xf62f('0x3c'))[_0xf62f('0x14')](_0x16ca96,null,_0x16ca96+'.id\x20=\x20'+_0x17cad6+'.'+_0x4d7057)[_0xf62f('0x16')](_0x17cad6+_0xf62f('0x3d'),_0x506a41)[_0xf62f('0x16')](_0xf62f('0x46'),NOW)[_0xf62f('0x16')](_0xf62f('0x3e'),squel['select']()[_0xf62f('0x11')](_0xf62f('0x12'))[_0xf62f('0x13')](_0xf62f('0x43'))[_0xf62f('0x16')](_0xf62f('0x47'),_0x506a41)[_0xf62f('0x16')](_0x4d7057+_0xf62f('0x48'),_0x17cad6+'.'+_0x4d7057)))[_0xf62f('0x41')]();}function insertCmHopperAdditionalPhones(_0xc2283a){var _0xa6d049=['cm_hopper.id',_0xf62f('0x49'),_0xf62f('0x4a'),_0xf62f('0x4b'),_0xf62f('0x4c')];return squel[_0xf62f('0x42')]()[_0xf62f('0x31')]('cm_hopper_additional_phones')[_0xf62f('0x33')]([_0xf62f('0x4d'),_0xf62f('0x12'),_0xf62f('0x4e'),_0xf62f('0x45'),_0xf62f('0x36')],squel['select']()[_0xf62f('0x39')](_0xa6d049)[_0xf62f('0x13')](_0xf62f('0x32'))['join'](_0xf62f('0x3a'),null,_0xf62f('0x4f'))[_0xf62f('0x14')]('cm_contact_has_items',null,_0xf62f('0x50'))['where'](_0xf62f('0x51'),_0xc2283a)[_0xf62f('0x16')](_0xf62f('0x46'),NOW))[_0xf62f('0x41')]();}function insertCmContact(_0x394112,_0x310ec9,_0x2a6526,_0x5acedc){var _0x45308f=_[_0xf62f('0x52')](_[_0xf62f('0x53')](_0x5acedc),[_0xf62f('0x44'),'CompanyId',_0xf62f('0x45'),'updatedAt']);return squel[_0xf62f('0x42')]()[_0xf62f('0x31')](_0xf62f('0x3a'))['fromQuery'](_0x45308f,squel[_0xf62f('0x10')]()[_0xf62f('0x39')](_0x45308f)[_0xf62f('0x13')](_0x310ec9)[_0xf62f('0x16')]('('+_0x2a6526['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xf62f('0x10')]()[_0xf62f('0x39')](_0x2a6526)[_0xf62f('0x13')](_0xf62f('0x3a'))[_0xf62f('0x16')](_0xf62f('0x47'),_0x394112))[_0xf62f('0x16')]('id\x20IN\x20?',squel[_0xf62f('0x10')]()[_0xf62f('0x11')](_0xf62f('0x54'),'min_id')[_0xf62f('0x13')](_0x310ec9)[_0xf62f('0x55')](_0x2a6526[_0xf62f('0x14')](','))))[_0xf62f('0x41')]();}function handleStop(){logger[_0xf62f('0x56')](_0xf62f('0x57'));stopped=!![];}function handleUncaughtException(_0x547b0f){logger[_0xf62f('0x21')](_0x547b0f['message']);process['exit'](0x1);}function handleError(_0x413fa6,_0x460b98){stats['errors'][_0xf62f('0x1d')]({'name':_0x460b98[_0xf62f('0x58')],'message':_0x460b98[_0xf62f('0x22')],'row':_0x413fa6});}function handleQuery(_0x977f5c){logger[_0xf62f('0x56')](_0x977f5c);return db['sequelize'][_0xf62f('0x59')](_0x977f5c)[_0xf62f('0x19')](function(_0x32c9e9){results[_0xf62f('0x1d')](_0x32c9e9);})['catch'](function(_0x4c0787){logger[_0xf62f('0x21')](_0x4c0787[_0xf62f('0x22')]);});}function main(_0x471a2f,_0x1c2a66,_0x10b458,_0x4fdc7b){logger[_0xf62f('0x56')]('main',_0x471a2f,JSON[_0xf62f('0x5a')](_0x1c2a66));process[_0xf62f('0x5b')](_0xf62f('0x5c'));var _0xb13268=_0x1c2a66[_0xf62f('0x5d')];var _0x3c6361=_[_0xf62f('0x5e')](_0xb13268);var _0x51f536=_0x1c2a66[_0xf62f('0x5f')];var _0x57982b=path[_0xf62f('0x14')](config[_0xf62f('0x60')],'server/files/tmp',_0x51f536+_0xf62f('0x61'));logger[_0xf62f('0x56')](_0xf62f('0x62'),_0x1c2a66);db['ContactItemType'][_0xf62f('0x63')]({'raw':!![],'attributes':['id','name']})['then'](function(_0x3cb850){for(var _0x5ba5be=0x0;_0x5ba5be<_0x3cb850[_0xf62f('0x1a')];_0x5ba5be++){if(_0x3cb850[_0x5ba5be]['name']in _0xb13268){contactItemTypes[_0xf62f('0x1d')](_0x3cb850[_0x5ba5be]);delete _0x3c6361[_0x3cb850[_0x5ba5be][_0xf62f('0x64')]];hasAdditionalPhones=!![];}for(var _0x3d4280 in _0xb13268){if(_0x3cb850[_0x5ba5be]['name']+_0xf62f('0x65')===_0x3d4280){phoneDescriptions[_0xf62f('0x1d')]({'itemTypeId':_0x3cb850[_0x5ba5be]['id'],'description':_0x3d4280});delete _0x3c6361[_0x3d4280];}}}if(hasAdditionalPhones)_0x3c6361['AdditionalPhones']='';var _0xdd5d6a=_[_0xf62f('0x53')](_0x3c6361)[_0xf62f('0x14')]();logger[_0xf62f('0x56')](_0xf62f('0x66'),_0xdd5d6a);fs[_0xf62f('0x67')](_0x57982b,_0xdd5d6a+'\x0a');Papa[_0xf62f('0x68')](fs[_0xf62f('0x69')](_0x471a2f),{'header':!![],'skipEmptyLines':!![],'step':function(_0xb54ff0,_0x3a2b5c){try{for(var _0x3bf07d=0x0,_0x1d870e=[];_0x3bf07d<_0xb54ff0[_0xf62f('0x6a')]['length'];_0x3bf07d++){stats[_0xf62f('0x6b')]+=0x1;if(_0xb54ff0[_0xf62f('0x6c')][_0x3bf07d]){handleError(_0xb54ff0[_0xf62f('0x6a')][_0x3bf07d],_0xb54ff0[_0xf62f('0x6c')][_0x3bf07d]);}else{var _0x5d62f9=[];var _0x4c9a2a=[];var _0xde414f={};for(var _0x4b59c6 in _0xb13268){let _0x121aca=contactItemTypes[_0xf62f('0x6d')](_0x370d31=>_0x370d31[_0xf62f('0x64')]===_0x4b59c6);let _0x4a140c=contactItemTypes[_0xf62f('0x6d')](_0x36c648=>_0x36c648['name']+_0xf62f('0x65')===_0x4b59c6);if(_['isNil'](_0x121aca)&&_['isNil'](_0x4a140c)){if(_0xb13268['hasOwnProperty'](_0x4b59c6)){if(_0xb54ff0[_0xf62f('0x6a')][_0x3bf07d][_0xb13268[_0x4b59c6]]){var _0x4b5a1d=_[_0xf62f('0x6e')](_0xb54ff0['data'][_0x3bf07d][_0xb13268[_0x4b59c6]][_0xf62f('0x6f')](/"/g,'\x27'));switch(_0x4b59c6){case _0xf62f('0x34'):var _0x4a18fe=moment(_0x4b5a1d,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4a18fe['isValid']()){_0x1d870e[_0xf62f('0x1d')]('\x22'+_0x4b5a1d+'\x22');}else{_0x5d62f9[_0xf62f('0x1d')](_0xf62f('0x70'));}break;case _0xf62f('0x37'):var _0x4348c0=parseInt(_0x4b5a1d);_0x4b5a1d=_['isNaN'](_0x4348c0)||_0x4348c0<0x0||_0x4348c0>0x4?_0x4fdc7b?0x3:0x2:_0x4348c0;_0x1d870e['push']('\x22'+_0x4b5a1d+'\x22');break;case'UserId':var _0x357172=parseInt(_0x4b5a1d);if(_[_0xf62f('0x71')](_0x357172)&&_['includes'](_0x10b458,_0x357172)){_0x1d870e[_0xf62f('0x1d')]('\x22'+_0x357172+'\x22');}else{_0x5d62f9[_0xf62f('0x1d')]('agent\x20not\x20exists');}break;case _0xf62f('0x72'):if(isEmail(_0x4b5a1d)){_0x1d870e['push']('\x22'+_0x4b5a1d+'\x22');}else{_0x5d62f9[_0xf62f('0x1d')](_0xf62f('0x73'));}break;case _0xf62f('0x74'):var _0x52e2e9=moment(_0x4b5a1d,_0xf62f('0x75'),!![]);if(_0x52e2e9[_0xf62f('0x76')]()){_0x1d870e[_0xf62f('0x1d')]('\x22'+_0x4b5a1d+'\x22');}else{_0x5d62f9[_0xf62f('0x1d')](_0xf62f('0x77'));}break;default:_0x1d870e['push']('\x22'+_0x4b5a1d+'\x22');}}else{switch(_0x4b59c6){case'firstName':case _0xf62f('0x12'):_0x5d62f9['push'](_0x4b59c6+'\x20not\x20specified');break;default:_0x1d870e[_0xf62f('0x1d')]('\x22\x22');}}}}else{var _0x17ed3f='';if(!_[_0xf62f('0x1b')](_0x121aca)){if(!_0xde414f[_0xf62f('0x78')](_0x121aca['id'])){for(var _0x2a383b=0x0;_0x2a383b<_0xb13268[_0x4b59c6][_0xf62f('0x1a')];_0x2a383b++){var _0x4b5a1d=_[_0xf62f('0x6e')](_0xb54ff0[_0xf62f('0x6a')][_0x3bf07d][_0xb13268[_0x4b59c6][_0x2a383b]][_0xf62f('0x6f')](/"/g,'\x27'));var _0x301a06=phoneDescriptions['find'](_0x566f10=>_0x566f10[_0xf62f('0x79')]===_0x121aca['id']);if(!_['isNil'](_0x301a06)){var _0x3c20ef=_[_0xf62f('0x6e')](_0xb54ff0['data'][_0x3bf07d][_0xb13268[_0x301a06[_0xf62f('0x7a')]][0x0]][_0xf62f('0x6f')](/"/g,'\x27'));if(!_['isNil'](_0x3c20ef))_0x4b5a1d=_0x4b5a1d+'§'+_0x3c20ef;}if(_0x17ed3f=='')_0x17ed3f=_0x4b5a1d;else _0x17ed3f+='|'+_0x4b5a1d;}_0x4c9a2a[_0xf62f('0x1d')](_0x121aca['id']+':'+_0x17ed3f);_0xde414f[_0x121aca['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1d870e[_0xf62f('0x1d')]('\x22'+_0x4c9a2a[_0xf62f('0x14')](';')+'\x22');}if(_0x5d62f9['length']){handleError(_0xb54ff0[_0xf62f('0x6a')][_0x3bf07d],{'code':_0xf62f('0x7b'),'message':_0x5d62f9[_0xf62f('0x14')]()});}else{fs[_0xf62f('0x7c')](_0x57982b,_0x1d870e['join']()+'\x0a');}_0x1d870e=[];}if(!(stats[_0xf62f('0x6b')]%0xc8)){socket['emit'](_0xf62f('0x7d')+_0x51f536,stats);stats[_0xf62f('0x6c')]=[];}}if(stopped){logger['info'](_0xf62f('0x7e'));_0x3a2b5c['abort']();}}catch(_0x528cf6){handleError(_0xb54ff0[_0xf62f('0x6a')][_0x3bf07d],{'code':'SystemError','message':_0x528cf6['message']});logger[_0xf62f('0x21')]('step',_0x528cf6[_0xf62f('0x22')]);}},'complete':function(){try{var _0xc30009=[];var _0x106b15=tempTableName;_0xc30009['push'](_0xf62f('0x7f')+_0x106b15+_0xf62f('0x80'));logger[_0xf62f('0x56')](_0xf62f('0x81'),contactItemTypes[_0xf62f('0x1a')]);var _0x294528=util['format'](_0xf62f('0x82'),_0x57982b,_0x106b15,_0xdd5d6a,_0x1c2a66[_0xf62f('0x44')],_0x1c2a66[_0xf62f('0x83')]||null,NOW,NOW);if(_['isNil'](_0xb13268[_0xf62f('0x34')])){_0x294528+=_0xf62f('0x84');}_0xc30009[_0xf62f('0x1d')](_0x294528);BPromise[_0xf62f('0x85')](_0xc30009,handleQuery)[_0xf62f('0x1f')](function(_0x1b8f1c){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0xc30009=[];for(var _0x5863ff=0x0;_0x5863ff\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.closedAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*'];(function(_0x8edde1,_0x32eab5){var _0x599002=function(_0x1433a5){while(--_0x1433a5){_0x8edde1['push'](_0x8edde1['shift']());}};_0x599002(++_0x32eab5);}(_0x0a12,0xb8));var _0x20a1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0a12[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var squel=require(_0x20a1('0x0'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0x20a1('0x1')];var utils=require('./utils');var db=require(_0x20a1('0x2'))['db'];function skipInteractionsQuery(_0x2079d8,_0x2cd34f,_0x3cb1c2){var _0x2b223d=![];var _0x2e0ad3=utils[_0x20a1('0x3')](_0x2079d8);if(_0x2cd34f['role']==='agent'&&!_0x3cb1c2[_0x20a1('0x4')]&&!_0x3cb1c2[_0x2e0ad3]){_0x2b223d=!![];}return _0x2b223d;}function getTagsQuery(){return squel['select']()['field']('id')[_0x20a1('0x5')](_0x20a1('0x6'))[_0x20a1('0x5')](_0x20a1('0x7'))[_0x20a1('0x8')](_0x20a1('0x9'));}function getUsersQuery(_0x58e21c,_0x5029df){var _0x3552e4=utils[_0x20a1('0xa')](_0x58e21c);var _0x39d4d2=_0x20a1('0xb')+_0x58e21c+_0x20a1('0xc');var _0x169a36=squel['select']()[_0x20a1('0x5')](_0x20a1('0xd'))[_0x20a1('0x5')](_0x20a1('0xe'))[_0x20a1('0x5')](_0x20a1('0xf')+_0x3552e4)[_0x20a1('0x8')](_0x39d4d2,'ui')[_0x20a1('0x10')](_0x20a1('0x11'),'u',_0x20a1('0x12'));if(_0x5029df[_0x20a1('0x13')]>0x0){_0x169a36[_0x20a1('0x14')](_0x20a1('0xf')+_0x3552e4+_0x20a1('0x15'),_['map'](_0x5029df,'id'));}return _0x169a36;}function getInteractionsQuery(_0x50d618){var _0x5b26af=utils['getInteractionsTables'](_0x50d618);var _0x5925d4=utils['getAccountFK'](_0x50d618);var _0x5c00a6=utils['getInteractionFK'](_0x50d618);return squel['select']()[_0x20a1('0x8')](_0x5b26af[_0x20a1('0x16')],'i')[_0x20a1('0x10')](_0x20a1('0x17'),'c',_0x20a1('0x18'))[_0x20a1('0x10')]('users','o','o.id\x20=\x20i.UserId')[_0x20a1('0x10')](_0x5b26af[_0x20a1('0x19')],'a',_0x20a1('0x1a')+_0x5925d4)['left_join'](_0x5b26af['messages'],'me',_0x20a1('0x1b')+_0x5c00a6+_0x20a1('0x1c'))[_0x20a1('0x10')](_0x5b26af[_0x20a1('0x1d')],'it','it.'+_0x5c00a6+'\x20=\x20i.id')['left_join']('tools_tags','t',_0x20a1('0x1e'));}function getSqlClauses(){var _0x2f81a8={'body':squel[_0x20a1('0x1f')](),'contact':squel['expr'](),'default':squel[_0x20a1('0x1f')](),'fields':squel['expr'](),'filter':squel[_0x20a1('0x1f')](),'read':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel['expr']()};return _0x2f81a8;}function parseTagParameter(_0x52a35c){var _0x566a9f=squel[_0x20a1('0x1f')]();if(_0x52a35c){var _0x181468=utils[_0x20a1('0x20')](_0x52a35c);_0x181468[_0x20a1('0x21')](function(_0x3927b2){_0x566a9f['or'](_0x20a1('0x22'),'%,'+_0x3927b2+',%');});}return _0x566a9f;}function parseReadParameter(_0x5a1352){var _0x3697f8='';if(_0x5a1352){_0x3697f8=_0x20a1('0x23');if(_0x5a1352==='1'){_0x3697f8=_0x3697f8[_0x20a1('0x24')](_0x20a1('0x25'),'=');}else{_0x3697f8=_0x3697f8['replace'](_0x20a1('0x25'),'>');}}return _0x3697f8;}function parseSearchFilter(_0x5a7c8b,_0x4148a0){var _0x2c8ec6=squel[_0x20a1('0x1f')]();if(_0x4148a0){var _0x1cdc2c=_0x4148a0[_0x20a1('0x24')]('\x5c','\x5c\x5c')[_0x20a1('0x24')](/'/g,'\x27\x27');if(qs[_0x20a1('0x26')](_0x1cdc2c)){_0x2c8ec6['or'](_0x20a1('0x27'),_0x1cdc2c+'%');if([_0x20a1('0x28'),_0x20a1('0x29')]['includes'](_0x5a7c8b)){_0x2c8ec6['or'](_0x20a1('0x2a'),_0x1cdc2c+'%');}else if(_0x5a7c8b==='fax'){_0x2c8ec6['or']('i.fax\x20LIKE\x20?',_0x1cdc2c+'%');}else if(_0x5a7c8b===_0x20a1('0x2b')){_0x2c8ec6['or'](_0x20a1('0x2c'),_0x1cdc2c+'%');}}else if(_0x5a7c8b===_0x20a1('0x2d')&&qs[_0x20a1('0x2e')](_0x1cdc2c)){_0x2c8ec6['or']('c.email\x20LIKE\x20?',_0x1cdc2c+'%');}else{if(_0x5a7c8b===_0x20a1('0x2d')){_0x2c8ec6['or'](_0x20a1('0x2f'),qs[_0x20a1('0x30')](_0x1cdc2c))['or'](_0x20a1('0x31'),qs['getFullTextValue'](_0x1cdc2c));}else{if(_0x5a7c8b!==_0x20a1('0x32')){_0x2c8ec6['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1cdc2c));}_0x2c8ec6['or'](_0x20a1('0x33'),_0x1cdc2c+'%');}}}return _0x2c8ec6;}function parseAdvancedSearchFilter(_0x7e9cd7,_0x3e3d8f){var _0x1a425f=getSqlClauses();var _0x5375f1=as[_0x20a1('0x34')](_0x7e9cd7);var _0x16f100=_0x5375f1['sqlOperator'];for(var _0x2c6b45=0x0;_0x2c6b45<_0x5375f1[_0x20a1('0x35')][_0x20a1('0x13')];_0x2c6b45++){var _0x4d04be=_0x5375f1['conditions'][_0x2c6b45];var _0x267f8b='i';var _0x15881e=_[_0x20a1('0x36')](_0x3e3d8f,[_0x20a1('0x6'),_0x4d04be[_0x20a1('0x5')]]);if(_0x15881e){var _0x310ec9=as[_0x20a1('0x37')](_0x267f8b,_0x15881e[_0x20a1('0x38')],_0x4d04be);_0x1a425f['default'][_0x16f100](_0x310ec9[_0x20a1('0x39')],_0x310ec9[_0x20a1('0x3a')][_0x20a1('0x3b')],_0x310ec9[_0x20a1('0x3a')][_0x20a1('0x3c')]);}else{switch(_0x4d04be['field']){case _0x20a1('0x3d'):var _0x541705=parseReadParameter(_0x4d04be[_0x20a1('0x3a')]);_0x1a425f[_0x20a1('0x3e')]['and'](_0x541705);break;case _0x20a1('0x3f'):if(_0x4d04be['operator']===_0x20a1('0x40')){if(_0x4d04be['value']['split']('\x20')[_0x20a1('0x13')]>0x1){_0x1a425f[_0x20a1('0x41')][_0x16f100](_0x20a1('0x42'),qs[_0x20a1('0x30')](_0x4d04be['value']),null);}else{var _0x404e9d='%'+_0x4d04be[_0x20a1('0x3a')]+'%';_0x1a425f['contact'][_0x16f100](_0x20a1('0x43'),_0x404e9d,_0x404e9d,_0x404e9d);}}else{_0x15881e=_[_0x20a1('0x36')](_0x3e3d8f,[_0x20a1('0x6'),_0x20a1('0x44')]);_0x4d04be[_0x20a1('0x5')]='ContactId';_0x310ec9=as[_0x20a1('0x37')](_0x267f8b,_0x15881e[_0x20a1('0x38')],_0x4d04be);_0x1a425f[_0x20a1('0x41')][_0x16f100](_0x310ec9['text'],_0x310ec9[_0x20a1('0x3a')][_0x20a1('0x3b')],_0x310ec9['value'][_0x20a1('0x3c')]);}break;case'Tag':var _0x49a429=_0x4d04be['value']['split'](',')[_0x20a1('0x45')](function(_0x29968a){return Number(_0x29968a);});var _0x5c0297=parseTagParameter(_0x49a429);_0x1a425f['tags']['clause'][_0x20a1('0x46')](_0x5c0297);_0x1a425f[_0x20a1('0x47')][_0x20a1('0x48')]=_0x49a429;break;case'User':if(_0x4d04be[_0x20a1('0x49')]===_0x20a1('0x40')){_0x1a425f[_0x20a1('0x4a')][_0x16f100](_0x20a1('0x4b'),'%'+_0x4d04be[_0x20a1('0x3a')]+'%',null);}else{_0x15881e=_['find'](_0x3e3d8f,['name','UserId']);_0x4d04be[_0x20a1('0x5')]=_0x20a1('0x4c');_0x310ec9=as['buildExpression'](_0x267f8b,_0x15881e[_0x20a1('0x38')],_0x4d04be);_0x1a425f[_0x20a1('0x4a')][_0x16f100](_0x310ec9[_0x20a1('0x39')],_0x310ec9['value'][_0x20a1('0x3b')],_0x310ec9['value'][_0x20a1('0x3c')]);}break;case _0x20a1('0x4d'):case'plainBody':_0x310ec9=as[_0x20a1('0x37')]('me',null,_0x4d04be);_0x1a425f[_0x20a1('0x4d')][_0x16f100](_0x310ec9['text'],_0x310ec9[_0x20a1('0x3a')][_0x20a1('0x3b')],_0x310ec9['value'][_0x20a1('0x3c')]);break;}}}return _0x1a425f;}function parseModelFields(_0x85cbfd,_0xa74b57,_0x590461){var _0xccf70=utils[_0x20a1('0x3')](_0x85cbfd);var _0xa5644d=squel['expr']();var _0x1d605c=_(_0xa74b57)['keys']()[_0x20a1('0x45')](function(_0x3a6ed9){return _[_0x20a1('0x4e')](_0x590461,[_0x20a1('0x6'),_0x3a6ed9])?_0x3a6ed9:undefined;})[_0x20a1('0x4f')]()[_0x20a1('0x3a')]();if(_0x1d605c[_0x20a1('0x13')]>0x0){_0x1d605c['forEach'](function(_0x454aa9){if(_0x454aa9===_0xccf70){_0xa5644d[_0x20a1('0x46')]('i.'+_0xccf70+'\x20IN\x20?',[][_0x20a1('0x50')](_0xa74b57[_0x454aa9]));}else if(_0x454aa9==='createdAt'){var _0x455ccd=JSON[_0x20a1('0x51')](_0xa74b57[_0x454aa9])['$gte'];var _0xd01088=JSON[_0x20a1('0x51')](_0xa74b57[_0x454aa9])[_0x20a1('0x52')];_0xa5644d[_0x20a1('0x46')](_0x20a1('0x53'),_0x455ccd,_0xd01088);}else{if(_0xa74b57[_0x454aa9]===_0x20a1('0x54')){_0xa5644d[_0x20a1('0x46')]('i.'+_0x454aa9+_0x20a1('0x55'));}else{_0xa5644d[_0x20a1('0x46')]('i.'+_0x454aa9+'\x20=\x20?',_0xa74b57[_0x454aa9]);}}});}return _0xa5644d;}function parseQueryParameters(_0xd4cd57,_0x24c197,_0xaf6d48){var _0x2a34de=getSqlClauses();return Promise['resolve']()[_0x20a1('0x56')](function(){return parseModelFields(_0xd4cd57,_0x24c197,_0xaf6d48);})[_0x20a1('0x56')](function(_0x4ed066){_0x2a34de[_0x20a1('0x57')]['and'](_0x4ed066);return parseReadParameter(_0x24c197[_0x20a1('0x3e')]);})[_0x20a1('0x56')](function(_0x4188b7){_0x2a34de[_0x20a1('0x3e')][_0x20a1('0x46')](_0x4188b7);return parseTagParameter(_0x24c197[_0x20a1('0x58')]);})[_0x20a1('0x56')](function(_0x94b8f8){_0x2a34de[_0x20a1('0x47')][_0x20a1('0x59')][_0x20a1('0x46')](_0x94b8f8);return parseSearchFilter(_0xd4cd57,_0x24c197['filter']);})[_0x20a1('0x56')](function(_0x4a12ac){_0x2a34de[_0x20a1('0x5a')]=_0x4a12ac;return _0x2a34de;});}function checkAccountsRestrictions(_0x5cf3b4,_0xa40071,_0xe3f196){var _0x2a73cc=utils[_0x20a1('0x3')](_0x5cf3b4);var _0x2fb198=_0x20a1('0x5b')+_[_0x20a1('0x5c')](_0x5cf3b4)+(_0x5cf3b4==='chat'?_0x20a1('0x5d'):_0x20a1('0x5e'));var _0x58c482=squel[_0x20a1('0x1f')]();return Promise[_0x20a1('0x5f')]()[_0x20a1('0x56')](function(){if(_0xe3f196[_0x20a1('0x4')]&&_0xa40071[_0x20a1('0x60')]===_0x20a1('0x61')){return _0xa40071[_0x2fb198]({'attributes':['id'],'raw':!![]});}})[_0x20a1('0x56')](function(_0x421022){if(_0x421022){if(_0x421022[_0x20a1('0x13')]===0x0){_0x58c482['and']('i.'+_0x2a73cc+_0x20a1('0x55'));}else{_0x58c482['and']('i.'+_0x2a73cc+_0x20a1('0x15'),_[_0x20a1('0x45')](_0x421022,'id'));}}else if(!_0xe3f196[_0x2a73cc]){_0x58c482[_0x20a1('0x46')]('i.'+_0x2a73cc+_0x20a1('0x62'));}})['then'](function(){return _0x58c482;});}function getClosedOrderClause(_0x1f0d2d,_0x379f5f){var _0x3363a8='';var _0x1aa0fa=[_0x20a1('0x63'),_0x20a1('0x64'),_0x20a1('0x65')];if(_0x1f0d2d===_0x20a1('0x2d')){_0x1aa0fa[_0x20a1('0x66')]('i.substatus');}if(_0x379f5f[_0x20a1('0x67')]==='0'&&_0x1f0d2d===_0x20a1('0x2d')){_0x3363a8=_0x20a1('0x68');}else{if(_0x379f5f[_0x20a1('0x67')]==='1'){_0x1aa0fa['shift']();}_0x3363a8='CONCAT_WS(\x27\x27,\x20'+_0x1aa0fa[_0x20a1('0x69')](',\x20')+')';}return _0x3363a8;}function getFilteredInteractions(_0x2956f5,_0x4941bb,_0x44123d,_0x1689f9){var _0x134b56=utils[_0x20a1('0xa')](_0x2956f5);var _0x19e57d=_['capitalize'](_0x2956f5)+'Interaction';var _0x221b0a=[];var _0x3de7fb=getTagsQuery();var _0x46c865={'type':db['Sequelize'][_0x20a1('0x6a')][_0x20a1('0x6b')],'raw':!![]};var _0x1e8abe=[];var _0x1f1a93=[];return db[_0x20a1('0x6c')]['query'](_0x3de7fb[_0x20a1('0x6d')](),_0x46c865)['then'](function(_0x4dbcf6){_0x221b0a=_[_0x20a1('0x6e')](_0x4dbcf6,'id');_0x46c865=_[_0x20a1('0x6f')](_0x46c865,{'model':db[_0x19e57d],'mapToModel':!![],'nest':!![]});if(_0x44123d['fields']){_0x1689f9[_0x20a1('0x70')][_0x20a1('0x21')](function(_0x37d6c8){_0x4941bb['field']('i.'+_0x37d6c8);});}else{_0x4941bb['field'](_0x20a1('0x71'),'unreadMessages');_0x4941bb[_0x20a1('0x5')](_0x20a1('0x72'),_0x20a1('0x73'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x74'),'Account.mandatoryDisposition');if(_0x2956f5===_0x20a1('0x2d')){_0x4941bb['field'](_0x20a1('0x75'),_0x20a1('0x76'));_0x4941bb['field'](_0x20a1('0x77'),_0x20a1('0x78'));_0x4941bb['field'](_0x20a1('0x79'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x7a'));_0x4941bb['field'](_0x20a1('0x7b'));_0x4941bb[_0x20a1('0x5')]('i.closed');_0x4941bb[_0x20a1('0x5')](_0x20a1('0x7c'));_0x4941bb[_0x20a1('0x5')]('i.attach');_0x4941bb[_0x20a1('0x5')]('i.lastMsgAt');_0x4941bb[_0x20a1('0x5')](_0x20a1('0x7d'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x7e'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x65'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x64'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x63'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x68'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x7f'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x80'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x81'));_0x4941bb['field'](_0x20a1('0x82'));}else if(_0x2956f5===_0x20a1('0x2b')){_0x4941bb['field'](_0x20a1('0x83'),_0x20a1('0x78'));}else{_0x4941bb['field'](_0x20a1('0x84'),'contactName');}if(_0x2956f5!==_0x20a1('0x2d')){_0x4941bb[_0x20a1('0x5')](_0x20a1('0x85'));}_0x4941bb[_0x20a1('0x5')](_0x20a1('0x86'),_0x20a1('0x87'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x88'),_0x20a1('0x89'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x8a'),_0x20a1('0x8b'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x8c'),_0x20a1('0x8d'));_0x4941bb[_0x20a1('0x5')](_0x20a1('0x8e'),_0x20a1('0x8f'));_0x4941bb['field']('c.fax',_0x20a1('0x90'));_0x4941bb[_0x20a1('0x5')]('o.fullname',_0x20a1('0x91'));_0x4941bb['field'](_0x20a1('0x92'),_0x20a1('0x93'));_0x4941bb[_0x20a1('0x5')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1689f9[_0x20a1('0x94')]){_0x4941bb[_0x20a1('0x94')](_0x1689f9[_0x20a1('0x94')]);}if(_0x1689f9[_0x20a1('0x95')]){_0x4941bb[_0x20a1('0x95')](_0x1689f9['offset']);}return db['sequelize'][_0x20a1('0x96')](_0x4941bb[_0x20a1('0x6d')](),_0x46c865);})[_0x20a1('0x56')](function(_0xdbd35d){_0x1e8abe=_0xdbd35d;var _0xb1d08d=getUsersQuery(_0x2956f5,_0x1e8abe);return db[_0x20a1('0x6c')][_0x20a1('0x96')](_0xb1d08d[_0x20a1('0x6d')](),_0x46c865);})[_0x20a1('0x56')](function(_0x5e1a15){_0x1f1a93=_['groupBy'](_0x5e1a15,_0x134b56);if(_0x2956f5===_0x20a1('0x2d')){return db[_0x20a1('0x97')]['findOne']({'attributes':[_0x20a1('0x98')],'raw':!![]});}})[_0x20a1('0x56')](function(_0x6ffdfc){var _0x270e71=_0x6ffdfc?_0x6ffdfc[_0x20a1('0x98')]:undefined;var _0x54e219=_0x1e8abe[_0x20a1('0x45')](function(_0x119ae1){return updateInteraction(_0x119ae1,_0x221b0a,_0x1f1a93,_0x270e71);});return Promise[_0x20a1('0x99')](_0x54e219);});}function countFilteredInteractions(_0x46dddc,_0x58fb3b){var _0x2b29ca=_0x46dddc[_0x20a1('0x9a')]();_0x2b29ca[_0x20a1('0x5')](_0x20a1('0x9b'));_0x2b29ca[_0x20a1('0x5')](_0x20a1('0x71'),_0x20a1('0x3d'));var _0x18d82a=utils[_0x20a1('0x20')](_0x58fb3b);if(!_[_0x20a1('0x9c')](_0x18d82a)){_0x2b29ca[_0x20a1('0x14')](_0x20a1('0x9d'),_0x18d82a);}var _0x569da7={'type':db['Sequelize'][_0x20a1('0x6a')]['SELECT'],'raw':!![]};return db[_0x20a1('0x6c')]['query'](_0x2b29ca['toString'](),_0x569da7);}module[_0x20a1('0x9e')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xb469=['from','user_has_','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','getInteractionsTables','getAccountFK','cm_contacts','accounts','a.id\x20=\x20i.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','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?','isEmail','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','conditions','find','buildExpression','type','default','text','value','start','end','read','and','operator','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Tag','map','tags','clause','ids','User','$substring','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','body','some','compact','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','then','tag','filter','get','capitalize','chat','Accounts','resolve','search','agent','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','getInteractionFK','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','keyBy','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','contactName','i.id','i.createdAt','i.closedAt','i.lastMsgAt','i.subject','i.to','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','toString','groupBy','Setting','findOne','enableEmailPreview','all','clone','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','role','select','field','name'];(function(_0x24942b,_0x4310e2){var _0x335545=function(_0x1dd0ea){while(--_0x1dd0ea){_0x24942b['push'](_0x24942b['shift']());}};_0x335545(++_0x4310e2);}(_0xb469,0x13b));var _0x9b46=function(_0x180064,_0x10b167){_0x180064=_0x180064-0x0;var _0x5e06d5=_0xb469[_0x180064];return _0x5e06d5;};'use strict';var _=require(_0x9b46('0x0'));var squel=require(_0x9b46('0x1'));var as=require(_0x9b46('0x2'));var qs=require(_0x9b46('0x3'));var updateInteraction=require(_0x9b46('0x4'))[_0x9b46('0x5')];var utils=require(_0x9b46('0x6'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x31f853,_0x45322f,_0x538fc4){var _0x368923=![];var _0x405d1c=utils['getAccountFK'](_0x31f853);if(_0x45322f[_0x9b46('0x7')]==='agent'&&!_0x538fc4['search']&&!_0x538fc4[_0x405d1c]){_0x368923=!![];}return _0x368923;}function getTagsQuery(){return squel[_0x9b46('0x8')]()['field']('id')[_0x9b46('0x9')](_0x9b46('0xa'))[_0x9b46('0x9')]('color')[_0x9b46('0xb')]('tools_tags');}function getUsersQuery(_0x431e56,_0x568d9a){var _0x2c29a7=utils['getInteractionFK'](_0x431e56);var _0x672157=_0x9b46('0xc')+_0x431e56+'_interactions';var _0x360974=squel[_0x9b46('0x8')]()['field'](_0x9b46('0xd'))[_0x9b46('0x9')](_0x9b46('0xe'))[_0x9b46('0x9')](_0x9b46('0xf')+_0x2c29a7)[_0x9b46('0xb')](_0x672157,'ui')[_0x9b46('0x10')](_0x9b46('0x11'),'u',_0x9b46('0x12'));if(_0x568d9a[_0x9b46('0x13')]>0x0){_0x360974[_0x9b46('0x14')](_0x9b46('0xf')+_0x2c29a7+_0x9b46('0x15'),_['map'](_0x568d9a,'id'));}return _0x360974;}function getInteractionsQuery(_0x4a9568){var _0x52c1b8=utils[_0x9b46('0x16')](_0x4a9568);var _0x5a380c=utils[_0x9b46('0x17')](_0x4a9568);var _0x5c5cc9=utils['getInteractionFK'](_0x4a9568);return squel[_0x9b46('0x8')]()['from'](_0x52c1b8['interactions'],'i')[_0x9b46('0x10')](_0x9b46('0x18'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x9b46('0x10')](_0x9b46('0x11'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x52c1b8[_0x9b46('0x19')],'a',_0x9b46('0x1a')+_0x5a380c)[_0x9b46('0x10')](_0x52c1b8['messages'],'me','me.'+_0x5c5cc9+_0x9b46('0x1b'))['left_join'](_0x52c1b8[_0x9b46('0x1c')],'it',_0x9b46('0x1d')+_0x5c5cc9+'\x20=\x20i.id')[_0x9b46('0x10')]('tools_tags','t',_0x9b46('0x1e'));}function getSqlClauses(){var _0x2b6f72={'body':squel['expr'](),'contact':squel[_0x9b46('0x1f')](),'default':squel[_0x9b46('0x1f')](),'fields':squel[_0x9b46('0x1f')](),'filter':squel[_0x9b46('0x1f')](),'read':squel[_0x9b46('0x1f')](),'tags':{'clause':squel[_0x9b46('0x1f')](),'ids':null},'user':squel[_0x9b46('0x1f')]()};return _0x2b6f72;}function parseTagParameter(_0x5dc377){var _0xdd756c=squel[_0x9b46('0x1f')]();if(_0x5dc377){var _0x478105=utils[_0x9b46('0x20')](_0x5dc377);_0x478105[_0x9b46('0x21')](function(_0x2a79a5){_0xdd756c['or'](_0x9b46('0x22'),'%,'+_0x2a79a5+',%');});}return _0xdd756c;}function parseReadParameter(_0x50fb4a){var _0x3bf5b9='';if(_0x50fb4a){_0x3bf5b9=_0x9b46('0x23');if(_0x50fb4a==='1'){_0x3bf5b9=_0x3bf5b9[_0x9b46('0x24')](_0x9b46('0x25'),'=');}else{_0x3bf5b9=_0x3bf5b9[_0x9b46('0x24')](_0x9b46('0x25'),'>');}}return _0x3bf5b9;}function parseSearchFilter(_0xc062ec,_0x17ba3d){var _0x163359=squel[_0x9b46('0x1f')]();if(_0x17ba3d){var _0x2e1c51=_0x17ba3d['replace']('\x5c','\x5c\x5c')[_0x9b46('0x24')](/'/g,'\x27\x27');if(qs[_0x9b46('0x26')](_0x2e1c51)){_0x163359['or'](_0x9b46('0x27'),_0x2e1c51+'%');if([_0x9b46('0x28'),_0x9b46('0x29')][_0x9b46('0x2a')](_0xc062ec)){_0x163359['or'](_0x9b46('0x2b'),_0x2e1c51+'%');}else if(_0xc062ec===_0x9b46('0x2c')){_0x163359['or'](_0x9b46('0x2d'),_0x2e1c51+'%');}else if(_0xc062ec===_0x9b46('0x2e')){_0x163359['or'](_0x9b46('0x2f'),_0x2e1c51+'%');}}else if(_0xc062ec==='mail'&&qs[_0x9b46('0x30')](_0x2e1c51)){_0x163359['or']('c.email\x20LIKE\x20?',_0x2e1c51+'%');}else{if(_0xc062ec===_0x9b46('0x31')){_0x163359['or'](_0x9b46('0x32'),qs[_0x9b46('0x33')](_0x2e1c51))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9b46('0x33')](_0x2e1c51));}else{if(_0xc062ec!==_0x9b46('0x2c')){_0x163359['or'](_0x9b46('0x34'),qs[_0x9b46('0x33')](_0x2e1c51));}_0x163359['or'](_0x9b46('0x35'),_0x2e1c51+'%');}}}return _0x163359;}function parseAdvancedSearchFilter(_0x5cb73f,_0x4e3ee1){var _0x12eaf0=getSqlClauses();var _0x33f3f7=as[_0x9b46('0x36')](_0x5cb73f);var _0x3d93d5=_0x33f3f7['sqlOperator'];for(var _0x44327d=0x0;_0x44327d<_0x33f3f7['conditions'][_0x9b46('0x13')];_0x44327d++){var _0x105b21=_0x33f3f7[_0x9b46('0x37')][_0x44327d];var _0x1ccba9='i';var _0x5645f2=_[_0x9b46('0x38')](_0x4e3ee1,['name',_0x105b21[_0x9b46('0x9')]]);if(_0x5645f2){var _0x2da43f=as[_0x9b46('0x39')](_0x1ccba9,_0x5645f2[_0x9b46('0x3a')],_0x105b21);_0x12eaf0[_0x9b46('0x3b')][_0x3d93d5](_0x2da43f[_0x9b46('0x3c')],_0x2da43f[_0x9b46('0x3d')][_0x9b46('0x3e')],_0x2da43f[_0x9b46('0x3d')][_0x9b46('0x3f')]);}else{switch(_0x105b21[_0x9b46('0x9')]){case'unreadMessages':var _0x175249=parseReadParameter(_0x105b21['value']);_0x12eaf0[_0x9b46('0x40')][_0x9b46('0x41')](_0x175249);break;case'Contact':if(_0x105b21[_0x9b46('0x42')]==='$substring'){if(_0x105b21[_0x9b46('0x3d')]['split']('\x20')[_0x9b46('0x13')]>0x1){_0x12eaf0[_0x9b46('0x43')][_0x3d93d5](_0x9b46('0x44'),qs[_0x9b46('0x33')](_0x105b21[_0x9b46('0x3d')]),null);}else{var _0x4eb816='%'+_0x105b21['value']+'%';_0x12eaf0[_0x9b46('0x43')][_0x3d93d5]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4eb816,_0x4eb816,_0x4eb816);}}else{_0x5645f2=_['find'](_0x4e3ee1,['name','ContactId']);_0x105b21[_0x9b46('0x9')]='ContactId';_0x2da43f=as[_0x9b46('0x39')](_0x1ccba9,_0x5645f2['type'],_0x105b21);_0x12eaf0[_0x9b46('0x43')][_0x3d93d5](_0x2da43f[_0x9b46('0x3c')],_0x2da43f[_0x9b46('0x3d')][_0x9b46('0x3e')],_0x2da43f[_0x9b46('0x3d')][_0x9b46('0x3f')]);}break;case _0x9b46('0x45'):var _0x318455=_0x105b21[_0x9b46('0x3d')]['split'](',')[_0x9b46('0x46')](function(_0xe7d0fc){return Number(_0xe7d0fc);});var _0x46cc6a=parseTagParameter(_0x318455);_0x12eaf0[_0x9b46('0x47')][_0x9b46('0x48')][_0x9b46('0x41')](_0x46cc6a);_0x12eaf0[_0x9b46('0x47')][_0x9b46('0x49')]=_0x318455;break;case _0x9b46('0x4a'):if(_0x105b21[_0x9b46('0x42')]===_0x9b46('0x4b')){_0x12eaf0[_0x9b46('0x4c')][_0x3d93d5](_0x9b46('0x4d'),'%'+_0x105b21[_0x9b46('0x3d')]+'%',null);}else{_0x5645f2=_['find'](_0x4e3ee1,['name',_0x9b46('0x4e')]);_0x105b21[_0x9b46('0x9')]=_0x9b46('0x4e');_0x2da43f=as['buildExpression'](_0x1ccba9,_0x5645f2['type'],_0x105b21);_0x12eaf0[_0x9b46('0x4c')][_0x3d93d5](_0x2da43f[_0x9b46('0x3c')],_0x2da43f[_0x9b46('0x3d')][_0x9b46('0x3e')],_0x2da43f[_0x9b46('0x3d')][_0x9b46('0x3f')]);}break;case'body':case _0x9b46('0x4f'):_0x2da43f=as[_0x9b46('0x39')]('me',null,_0x105b21);_0x12eaf0[_0x9b46('0x50')][_0x3d93d5](_0x2da43f['text'],_0x2da43f[_0x9b46('0x3d')]['start'],_0x2da43f[_0x9b46('0x3d')][_0x9b46('0x3f')]);break;}}}return _0x12eaf0;}function parseModelFields(_0x16e6d8,_0x566bad,_0x194979){var _0xdb4247=utils[_0x9b46('0x17')](_0x16e6d8);var _0x239643=squel[_0x9b46('0x1f')]();var _0x373ffd=_(_0x566bad)['keys']()[_0x9b46('0x46')](function(_0x15ab7d){return _[_0x9b46('0x51')](_0x194979,[_0x9b46('0xa'),_0x15ab7d])?_0x15ab7d:undefined;})[_0x9b46('0x52')]()[_0x9b46('0x3d')]();if(_0x373ffd['length']>0x0){_0x373ffd[_0x9b46('0x21')](function(_0x53ef2a){if(_0x53ef2a===_0xdb4247){_0x239643[_0x9b46('0x41')]('i.'+_0xdb4247+_0x9b46('0x15'),[][_0x9b46('0x53')](_0x566bad[_0x53ef2a]));}else if(_0x53ef2a===_0x9b46('0x54')){var _0x33a2ea=JSON['parse'](_0x566bad[_0x53ef2a])[_0x9b46('0x55')];var _0x1c7e5d=JSON[_0x9b46('0x56')](_0x566bad[_0x53ef2a])[_0x9b46('0x57')];_0x239643[_0x9b46('0x41')](_0x9b46('0x58'),_0x33a2ea,_0x1c7e5d);}else{if(_0x566bad[_0x53ef2a]===_0x9b46('0x59')){_0x239643[_0x9b46('0x41')]('i.'+_0x53ef2a+_0x9b46('0x5a'));}else{_0x239643[_0x9b46('0x41')]('i.'+_0x53ef2a+_0x9b46('0x5b'),_0x566bad[_0x53ef2a]);}}});}return _0x239643;}function parseQueryParameters(_0x4d473f,_0x551a64,_0x496006){var _0x7a092b=getSqlClauses();return Promise['resolve']()[_0x9b46('0x5c')](function(){return parseModelFields(_0x4d473f,_0x551a64,_0x496006);})['then'](function(_0x1a4ffd){_0x7a092b['fields'][_0x9b46('0x41')](_0x1a4ffd);return parseReadParameter(_0x551a64[_0x9b46('0x40')]);})[_0x9b46('0x5c')](function(_0x52463b){_0x7a092b[_0x9b46('0x40')]['and'](_0x52463b);return parseTagParameter(_0x551a64[_0x9b46('0x5d')]);})[_0x9b46('0x5c')](function(_0x2c77d2){_0x7a092b[_0x9b46('0x47')][_0x9b46('0x48')]['and'](_0x2c77d2);return parseSearchFilter(_0x4d473f,_0x551a64['filter']);})[_0x9b46('0x5c')](function(_0x86d818){_0x7a092b[_0x9b46('0x5e')]=_0x86d818;return _0x7a092b;});}function checkAccountsRestrictions(_0x414a22,_0x976f08,_0x164167){var _0x1647da=utils[_0x9b46('0x17')](_0x414a22);var _0x4e7804=_0x9b46('0x5f')+_[_0x9b46('0x60')](_0x414a22)+(_0x414a22===_0x9b46('0x61')?'Websites':_0x9b46('0x62'));var _0x145200=squel[_0x9b46('0x1f')]();return Promise[_0x9b46('0x63')]()[_0x9b46('0x5c')](function(){if(_0x164167[_0x9b46('0x64')]&&_0x976f08['role']===_0x9b46('0x65')){return _0x976f08[_0x4e7804]({'attributes':['id'],'raw':!![]});}})[_0x9b46('0x5c')](function(_0x279530){if(_0x279530){if(_0x279530[_0x9b46('0x13')]===0x0){_0x145200[_0x9b46('0x41')]('i.'+_0x1647da+_0x9b46('0x5a'));}else{_0x145200['and']('i.'+_0x1647da+_0x9b46('0x15'),_['map'](_0x279530,'id'));}}else if(!_0x164167[_0x1647da]){_0x145200[_0x9b46('0x41')]('i.'+_0x1647da+'\x20IS\x20NOT\x20NULL');}})[_0x9b46('0x5c')](function(){return _0x145200;});}function getClosedOrderClause(_0x3a7708,_0x4bf20a){var _0x171ad2='';var _0x1cc2f3=[_0x9b46('0x66'),_0x9b46('0x67'),_0x9b46('0x68')];if(_0x3a7708==='mail'){_0x1cc2f3[_0x9b46('0x69')](_0x9b46('0x6a'));}if(_0x4bf20a['closed']==='0'&&_0x3a7708==='mail'){_0x171ad2=_0x9b46('0x6a');}else{if(_0x4bf20a[_0x9b46('0x6b')]==='1'){_0x1cc2f3[_0x9b46('0x6c')]();}_0x171ad2=_0x9b46('0x6d')+_0x1cc2f3[_0x9b46('0x6e')](',\x20')+')';}return _0x171ad2;}function getFilteredInteractions(_0x1a6516,_0x149c79,_0x19aa34,_0x58c952){var _0x5e9948=utils[_0x9b46('0x6f')](_0x1a6516);var _0x3485ad=_['capitalize'](_0x1a6516)+_0x9b46('0x70');var _0x4b46ed=[];var _0x33d1ab=getTagsQuery();var _0x501544={'type':db[_0x9b46('0x71')][_0x9b46('0x72')][_0x9b46('0x73')],'raw':!![]};var _0x4e75ad=[];var _0x271ae8=[];return db[_0x9b46('0x74')][_0x9b46('0x75')](_0x33d1ab['toString'](),_0x501544)[_0x9b46('0x5c')](function(_0x1d545c){_0x4b46ed=_[_0x9b46('0x76')](_0x1d545c,'id');_0x501544=_[_0x9b46('0x77')](_0x501544,{'model':db[_0x3485ad],'mapToModel':!![],'nest':!![]});if(_0x19aa34[_0x9b46('0x78')]){_0x58c952['attributes']['forEach'](function(_0x5386ef){_0x149c79['field']('i.'+_0x5386ef);});}else{_0x149c79['field'](_0x9b46('0x79'),_0x9b46('0x7a'));_0x149c79[_0x9b46('0x9')](_0x9b46('0x7b'),_0x9b46('0x7c'));_0x149c79[_0x9b46('0x9')](_0x9b46('0x7d'),_0x9b46('0x7e'));if(_0x1a6516==='mail'){_0x149c79[_0x9b46('0x9')](_0x9b46('0x7f'),'Account.email');_0x149c79[_0x9b46('0x9')]('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',_0x9b46('0x80'));_0x149c79[_0x9b46('0x9')](_0x9b46('0x81'));_0x149c79[_0x9b46('0x9')](_0x9b46('0x82'));_0x149c79['field']('i.updatedAt');_0x149c79[_0x9b46('0x9')]('i.closed');_0x149c79[_0x9b46('0x9')](_0x9b46('0x83'));_0x149c79['field']('i.attach');_0x149c79['field'](_0x9b46('0x84'));_0x149c79['field']('i.lastMsgDirection');_0x149c79[_0x9b46('0x9')](_0x9b46('0x85'));_0x149c79[_0x9b46('0x9')](_0x9b46('0x68'));_0x149c79['field'](_0x9b46('0x67'));_0x149c79[_0x9b46('0x9')](_0x9b46('0x66'));_0x149c79['field']('i.substatus');_0x149c79[_0x9b46('0x9')](_0x9b46('0x86'));_0x149c79[_0x9b46('0x9')]('i.ContactId');_0x149c79[_0x9b46('0x9')](_0x9b46('0x87'));_0x149c79['field'](_0x9b46('0x88'));}else if(_0x1a6516===_0x9b46('0x2e')){_0x149c79[_0x9b46('0x9')](_0x9b46('0x89'),'contactName');}else{_0x149c79['field'](_0x9b46('0x8a'),'contactName');}if(_0x1a6516!==_0x9b46('0x31')){_0x149c79[_0x9b46('0x9')]('i.*');}_0x149c79['field']('c.firstName',_0x9b46('0x8b'));_0x149c79['field'](_0x9b46('0x8c'),_0x9b46('0x8d'));_0x149c79[_0x9b46('0x9')](_0x9b46('0x8e'),'Contact.email');_0x149c79[_0x9b46('0x9')](_0x9b46('0x8f'),_0x9b46('0x90'));_0x149c79[_0x9b46('0x9')](_0x9b46('0x91'),'Contact.mobile');_0x149c79[_0x9b46('0x9')]('c.fax',_0x9b46('0x92'));_0x149c79[_0x9b46('0x9')]('o.fullname',_0x9b46('0x93'));_0x149c79[_0x9b46('0x9')](_0x9b46('0x94'),_0x9b46('0x95'));_0x149c79['field'](_0x9b46('0x96'),'TagIds');}if(_0x58c952[_0x9b46('0x97')]){_0x149c79[_0x9b46('0x97')](_0x58c952[_0x9b46('0x97')]);}if(_0x58c952['offset']){_0x149c79[_0x9b46('0x98')](_0x58c952[_0x9b46('0x98')]);}return db[_0x9b46('0x74')][_0x9b46('0x75')](_0x149c79['toString'](),_0x501544);})[_0x9b46('0x5c')](function(_0x4f5fe6){_0x4e75ad=_0x4f5fe6;var _0x420d61=getUsersQuery(_0x1a6516,_0x4e75ad);return db[_0x9b46('0x74')][_0x9b46('0x75')](_0x420d61[_0x9b46('0x99')](),_0x501544);})[_0x9b46('0x5c')](function(_0x406e47){_0x271ae8=_[_0x9b46('0x9a')](_0x406e47,_0x5e9948);if(_0x1a6516==='mail'){return db[_0x9b46('0x9b')][_0x9b46('0x9c')]({'attributes':[_0x9b46('0x9d')],'raw':!![]});}})[_0x9b46('0x5c')](function(_0xa93d86){var _0x148b43=_0xa93d86?_0xa93d86[_0x9b46('0x9d')]:undefined;var _0x142d81=_0x4e75ad[_0x9b46('0x46')](function(_0x190b24){return updateInteraction(_0x190b24,_0x4b46ed,_0x271ae8,_0x148b43);});return Promise[_0x9b46('0x9e')](_0x142d81);});}function countFilteredInteractions(_0xb026d9,_0x35e108){var _0x189cb9=_0xb026d9[_0x9b46('0x9f')]();_0x189cb9[_0x9b46('0x9')]('COUNT(*)');_0x189cb9['field'](_0x9b46('0x79'),_0x9b46('0x7a'));var _0xe8f4a4=utils[_0x9b46('0x20')](_0x35e108);if(!_[_0x9b46('0xa0')](_0xe8f4a4)){_0x189cb9[_0x9b46('0x14')](_0x9b46('0xa1'),_0xe8f4a4);}var _0x6e11dc={'type':db[_0x9b46('0x71')][_0x9b46('0x72')][_0x9b46('0x73')],'raw':!![]};return db[_0x9b46('0x74')]['query'](_0x189cb9['toString'](),_0x6e11dc);}module[_0x9b46('0xa2')]={'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 0656bd3..35c1894 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 _0x0329=['plainBody','-id','lastMsgText','catch','then','Users','Tags','TagIds','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','MailMessage','findOne','out'];(function(_0x15d4a4,_0x115dc2){var _0x37d4e1=function(_0x53e607){while(--_0x53e607){_0x15d4a4['push'](_0x15d4a4['shift']());}};_0x37d4e1(++_0x115dc2);}(_0x0329,0x14c));var _0x9032=function(_0x46a55e,_0xe095bf){_0x46a55e=_0x46a55e-0x0;var _0x2648a8=_0x0329[_0x46a55e];return _0x2648a8;};'use strict';var _=require(_0x9032('0x0'));var db=require(_0x9032('0x1'))['db'];function getInteractionUsers(_0x469a79,_0x51c8a1){return new Promise(function(_0x38fd4f,_0x365133){try{var _0x4c849f=[];if(_0x51c8a1[_0x469a79]){_0x4c849f=_0x51c8a1[_0x469a79][_0x9032('0x2')](function(_0x1fd973){return{'id':_0x1fd973['id'],'fullname':_0x1fd973[_0x9032('0x3')]};});}return _0x38fd4f(_0x4c849f);}catch(_0x31b250){_0x365133(_0x31b250);}});}function getInteractionTags(_0xc37fe9,_0x3510a6){var _0x44e57d=[];if(_0xc37fe9){_0xc37fe9[_0x9032('0x4')](',')[_0x9032('0x5')](function(_0x2b0395){_0x44e57d[_0x9032('0x6')](_0x3510a6[_0x2b0395]);});}return _0x44e57d;}function updateWaitingCounter(_0x5d4781){if(_0x5d4781[_0x9032('0x7')]){_0x5d4781[_0x9032('0x7')]-=0x1;}}function updateInteractionCounters(_0x208a04){_0x208a04[_0x9032('0x7')]=0x0;_0x208a04[_0x9032('0x8')]=0x0;_0x208a04[_0x9032('0x9')]=0x0;_0x208a04[_0x9032('0xa')]=0x0;_0x208a04[_0x9032('0xb')]=0x0;_0x208a04[_0x9032('0xc')]=0x0;if(_0x208a04[_0x9032('0xd')]){if(_0x208a04[_0x9032('0xe')]==='abandoned'){_0x208a04[_0x9032('0xb')]+=0x1;updateWaitingCounter(_0x208a04);}if(_0x208a04[_0x9032('0xf')]){_0x208a04[_0x9032('0x9')]+=0x1;if(_0x208a04[_0x9032('0x8')]){_0x208a04[_0x9032('0x8')]-=0x1;}}else{if(_0x208a04['disposition']){_0x208a04[_0x9032('0xa')]+=0x1;updateWaitingCounter(_0x208a04);}}}else{if(!_0x208a04[_0x9032('0xf')]){_0x208a04[_0x9032('0x7')]+=0x1;}if(_0x208a04[_0x9032('0xf')]){_0x208a04[_0x9032('0x8')]+=0x1;updateWaitingCounter(_0x208a04);}}_0x208a04[_0x9032('0xc')]+=0x1;return _0x208a04;}function getLastMessageText(_0x5e4c2a){return db[_0x9032('0x10')][_0x9032('0x11')]({'where':{'$and':[{'MailInteractionId':_0x5e4c2a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9032('0x12')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9032('0x13')],'order':_0x9032('0x14'),'raw':!![]})['then'](function(_0x4ed196){if(_0x4ed196&&_0x4ed196[_0x9032('0x13')]){_0x5e4c2a[_0x9032('0x15')]=_['trimStart'](_0x4ed196[_0x9032('0x13')]);}return _0x5e4c2a;})[_0x9032('0x16')](function(_0x261e57){throw _0x261e57;});}exports['updateInteraction']=function(_0x140895,_0x3c5e28,_0x1fa3fb,_0x31d86e){return new Promise(function(_0x5076f4,_0x3da5bd){return getInteractionUsers(_0x140895['id'],_0x1fa3fb)[_0x9032('0x17')](function(_0xde1e91){_0x140895[_0x9032('0x18')]=_0xde1e91;return getInteractionTags(_0x140895['TagIds'],_0x3c5e28);})[_0x9032('0x17')](function(_0x142d3c){_0x140895[_0x9032('0x19')]=_0x142d3c;delete _0x140895[_0x9032('0x1a')];return updateInteractionCounters(_0x140895);})[_0x9032('0x17')](function(_0x823f91){if(_0x31d86e){return getLastMessageText(_0x823f91);}else{return _0x823f91;}})[_0x9032('0x17')](function(_0x166f83){_0x5076f4(_0x166f83);})[_0x9032('0x16')](function(_0x2ef4cb){_0x3da5bd(_0x2ef4cb);});});}; \ No newline at end of file +var _0x0599=['closed','disposition','UserId','total','MailMessage','out','plainBody','-id','then','trimStart','catch','updateInteraction','Users','TagIds','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','unmanaged','abandoned'];(function(_0x526ef5,_0x22b2e8){var _0x5a5f56=function(_0x47afc6){while(--_0x47afc6){_0x526ef5['push'](_0x526ef5['shift']());}};_0x5a5f56(++_0x22b2e8);}(_0x0599,0x176));var _0x9059=function(_0x5d05bc,_0x1be017){_0x5d05bc=_0x5d05bc-0x0;var _0x3bf69c=_0x0599[_0x5d05bc];return _0x3bf69c;};'use strict';var _=require('lodash');var db=require(_0x9059('0x0'))['db'];function getInteractionUsers(_0x4a1cb6,_0x25244c){return new Promise(function(_0x3d2446,_0x47be71){try{var _0x3191a0=[];if(_0x25244c[_0x4a1cb6]){_0x3191a0=_0x25244c[_0x4a1cb6][_0x9059('0x1')](function(_0x46a369){return{'id':_0x46a369['id'],'fullname':_0x46a369[_0x9059('0x2')]};});}return _0x3d2446(_0x3191a0);}catch(_0x117918){_0x47be71(_0x117918);}});}function getInteractionTags(_0x304347,_0x320b78){var _0x2fb0d9=[];if(_0x304347){_0x304347[_0x9059('0x3')](',')[_0x9059('0x4')](function(_0x5b02bb){_0x2fb0d9[_0x9059('0x5')](_0x320b78[_0x5b02bb]);});}return _0x2fb0d9;}function updateWaitingCounter(_0x518e4a){if(_0x518e4a[_0x9059('0x6')]){_0x518e4a[_0x9059('0x6')]-=0x1;}}function updateInteractionCounters(_0x4207dc){_0x4207dc[_0x9059('0x6')]=0x0;_0x4207dc[_0x9059('0x7')]=0x0;_0x4207dc['answered']=0x0;_0x4207dc[_0x9059('0x8')]=0x0;_0x4207dc[_0x9059('0x9')]=0x0;_0x4207dc['total']=0x0;if(_0x4207dc[_0x9059('0xa')]){if(_0x4207dc[_0x9059('0xb')]===_0x9059('0x9')){_0x4207dc[_0x9059('0x9')]+=0x1;updateWaitingCounter(_0x4207dc);}if(_0x4207dc[_0x9059('0xc')]){_0x4207dc['answered']+=0x1;if(_0x4207dc[_0x9059('0x7')]){_0x4207dc[_0x9059('0x7')]-=0x1;}}else{if(_0x4207dc[_0x9059('0xb')]){_0x4207dc[_0x9059('0x8')]+=0x1;updateWaitingCounter(_0x4207dc);}}}else{if(!_0x4207dc[_0x9059('0xc')]){_0x4207dc[_0x9059('0x6')]+=0x1;}if(_0x4207dc['UserId']){_0x4207dc['talking']+=0x1;updateWaitingCounter(_0x4207dc);}}_0x4207dc[_0x9059('0xd')]+=0x1;return _0x4207dc;}function getLastMessageText(_0x16ab52){return db[_0x9059('0xe')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x16ab52['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9059('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9059('0x10')],'order':_0x9059('0x11'),'raw':!![]})[_0x9059('0x12')](function(_0x2ff568){if(_0x2ff568&&_0x2ff568[_0x9059('0x10')]){_0x16ab52['lastMsgText']=_[_0x9059('0x13')](_0x2ff568['plainBody']);}return _0x16ab52;})[_0x9059('0x14')](function(_0x340ade){throw _0x340ade;});}exports[_0x9059('0x15')]=function(_0x5d5f50,_0x150d18,_0x202148,_0x573bef){return new Promise(function(_0x5b19b2,_0x10269){return getInteractionUsers(_0x5d5f50['id'],_0x202148)[_0x9059('0x12')](function(_0x5d2582){_0x5d5f50[_0x9059('0x16')]=_0x5d2582;return getInteractionTags(_0x5d5f50[_0x9059('0x17')],_0x150d18);})['then'](function(_0xdc5e1d){_0x5d5f50['Tags']=_0xdc5e1d;delete _0x5d5f50[_0x9059('0x17')];return updateInteractionCounters(_0x5d5f50);})['then'](function(_0x153025){if(_0x573bef){return getLastMessageText(_0x153025);}else{return _0x153025;}})[_0x9059('0x12')](function(_0x2ea7ab){_0x5b19b2(_0x2ea7ab);})[_0x9059('0x14')](function(_0xadde5f){_0x10269(_0xadde5f);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index adcbe51..8438954 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 _0x79e3=['lodash','../../mysqldb','openchannel-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','chat','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','update','info','exports'];(function(_0x2db4e2,_0xa301cf){var _0x13962a=function(_0x589f3e){while(--_0x589f3e){_0x2db4e2['push'](_0x2db4e2['shift']());}};_0x13962a(++_0xa301cf);}(_0x79e3,0x105));var _0x379e=function(_0xba2e8f,_0x50f012){_0xba2e8f=_0xba2e8f-0x0;var _0x2b5657=_0x79e3[_0xba2e8f];return _0x2b5657;};'use strict';var _=require(_0x379e('0x0'));var db=require(_0x379e('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x379e('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x379e('0x3'))('fax-interactions'),'sms':require(_0x379e('0x3'))(_0x379e('0x4')),'chat':require(_0x379e('0x3'))(_0x379e('0x5')),'whatsapp':require('../../config/logger')(_0x379e('0x6'))};function getAccountFK(_0x29deac){return _['capitalize'](_0x29deac)+(_0x29deac===_0x379e('0x7')?'Website':_0x379e('0x8'))+'Id';}function getInteractionFK(_0x39791d){return _['capitalize'](_0x39791d)+_0x379e('0x9');}function getInteractionId(_0x1fa107,_0x28f293,_0x4e8f51){if(_0x1fa107&&_0x1fa107[_[_0x379e('0xa')](_0x4e8f51)+_0x379e('0x9')]){return _0x1fa107[_[_0x379e('0xa')](_0x4e8f51)+_0x379e('0x9')];}else if(_0x1fa107&&_0x1fa107['id']){return _0x1fa107['id'];}else if(_0x28f293&&_0x28f293['id']){return _0x28f293['id'];}else{return _0x379e('0xb');}}function getInteractionsTables(_0x11a797){return{'accounts':_0x11a797+'_'+(_0x11a797===_0x379e('0x7')?_0x379e('0xc'):_0x379e('0xd')),'interactions':_0x11a797+_0x379e('0xe'),'interactionsTags':_0x11a797+'_interaction_has_tags','messages':_0x11a797+_0x379e('0xf'),'userInteractions':_0x379e('0x10')+_0x11a797+_0x379e('0xe')};}function getSelectedTags(_0x2e4f01){var _0x56ae25=[];if(_0x2e4f01){_0x56ae25=Array[_0x379e('0x11')](_0x2e4f01)?_0x2e4f01:[_0x2e4f01];}return _0x56ae25;}function log(_0x233d23,_0x37209e,_0x4dd2ee,_0x228bcf,_0x40b6db,_0x4d6444){loggers[_0x40b6db['toLowerCase']()][_0x233d23](_0x379e('0x12'),_0x4d6444[_0x379e('0x13')](),_0x37209e?_0x37209e['id']:null,_0x37209e?_0x37209e[_0x379e('0x14')]:null,_0x37209e?_0x37209e['role']:null,getInteractionId(_0x4dd2ee,_0x228bcf,_0x40b6db),_0x4dd2ee?JSON[_0x379e('0x15')](_0x4dd2ee):_0x379e('0x16'));}function updateUser(_0xd2e564,_0x5bc92c,_0xe52e3e,_0x1fbc1f,_0x1c1154){db[_[_0x379e('0xa')](_0x1fbc1f)+_0x379e('0x17')][_0x379e('0x18')]({'where':{'id':getInteractionId(_0x5bc92c,_0xe52e3e,_0x1fbc1f)}})[_0x379e('0x19')](function(_0xde1ce9){if(_0xde1ce9){return _0xde1ce9[_0x379e('0x1a')]({'UserId':_0xd2e564?_0xd2e564['id']:null});}})[_0x379e('0x19')](function(_0x4de8f3){if(_0x4de8f3){log(_0x379e('0x1b'),_0xd2e564,_0x5bc92c,_0xe52e3e,_0x1fbc1f,_0x1c1154);}})['catch'](function(){log('error',_0xd2e564,_0x5bc92c,_0xe52e3e,_0x1fbc1f,_0x1c1154);});}module[_0x379e('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x0da5=['toUpperCase','stringify','null','Interaction','update','then','info','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Account','InteractionId','upperFirst','accounts','_messages','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x381f8d,_0x5e3ac0){var _0x5adf2c=function(_0x31e34f){while(--_0x31e34f){_0x381f8d['push'](_0x381f8d['shift']());}};_0x5adf2c(++_0x5e3ac0);}(_0x0da5,0x153));var _0x50da=function(_0x1c2db6,_0x1ed579){_0x1c2db6=_0x1c2db6-0x0;var _0x4d6e79=_0x0da5[_0x1c2db6];return _0x4d6e79;};'use strict';var _=require(_0x50da('0x0'));var db=require(_0x50da('0x1'))['db'];var loggers={'openchannel':require(_0x50da('0x2'))(_0x50da('0x3')),'mail':require('../../config/logger')(_0x50da('0x4')),'fax':require('../../config/logger')(_0x50da('0x5')),'sms':require('../../config/logger')(_0x50da('0x6')),'chat':require('../../config/logger')(_0x50da('0x7')),'whatsapp':require(_0x50da('0x2'))(_0x50da('0x8'))};function getAccountFK(_0x316b53){return _[_0x50da('0x9')](_0x316b53)+(_0x316b53===_0x50da('0xa')?'Website':_0x50da('0xb'))+'Id';}function getInteractionFK(_0xe60e63){return _['capitalize'](_0xe60e63)+_0x50da('0xc');}function getInteractionId(_0x1df385,_0x269e15,_0x33281d){if(_0x1df385&&_0x1df385[_['upperFirst'](_0x33281d)+'InteractionId']){return _0x1df385[_[_0x50da('0xd')](_0x33281d)+_0x50da('0xc')];}else if(_0x1df385&&_0x1df385['id']){return _0x1df385['id'];}else if(_0x269e15&&_0x269e15['id']){return _0x269e15['id'];}else{return'unknown';}}function getInteractionsTables(_0x2141a4){return{'accounts':_0x2141a4+'_'+(_0x2141a4===_0x50da('0xa')?'websites':_0x50da('0xe')),'interactions':_0x2141a4+'_interactions','interactionsTags':_0x2141a4+'_interaction_has_tags','messages':_0x2141a4+_0x50da('0xf'),'userInteractions':_0x50da('0x10')+_0x2141a4+_0x50da('0x11')};}function getSelectedTags(_0x4a381e){var _0x12e875=[];if(_0x4a381e){_0x12e875=Array[_0x50da('0x12')](_0x4a381e)?_0x4a381e:[_0x4a381e];}return _0x12e875;}function log(_0x5b0d55,_0x36351e,_0x20c5b7,_0x2951f1,_0x2e1e54,_0x25e086){loggers[_0x2e1e54[_0x50da('0x13')]()][_0x5b0d55](_0x50da('0x14'),_0x25e086[_0x50da('0x15')](),_0x36351e?_0x36351e['id']:null,_0x36351e?_0x36351e['name']:null,_0x36351e?_0x36351e['role']:null,getInteractionId(_0x20c5b7,_0x2951f1,_0x2e1e54),_0x20c5b7?JSON[_0x50da('0x16')](_0x20c5b7):_0x50da('0x17'));}function updateUser(_0x1f0d57,_0x197fba,_0x5f441a,_0x984f65,_0x5180b5){db[_['upperFirst'](_0x984f65)+_0x50da('0x18')]['findOne']({'where':{'id':getInteractionId(_0x197fba,_0x5f441a,_0x984f65)}})['then'](function(_0x4c9200){if(_0x4c9200){return _0x4c9200[_0x50da('0x19')]({'UserId':_0x1f0d57?_0x1f0d57['id']:null});}})[_0x50da('0x1a')](function(_0x5a2f2e){if(_0x5a2f2e){log(_0x50da('0x1b'),_0x1f0d57,_0x197fba,_0x5f441a,_0x984f65,_0x5180b5);}})['catch'](function(){log(_0x50da('0x1c'),_0x1f0d57,_0x197fba,_0x5f441a,_0x984f65,_0x5180b5);});}module[_0x50da('0x1d')]={'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 867ec88..7906a24 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 _0x6404=['catch','users','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','%s:%s:%s','utf8','use','License','findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x58dcec,_0x38db58){var _0x2a87e1=function(_0x15a0e3){while(--_0x15a0e3){_0x58dcec['push'](_0x58dcec['shift']());}};_0x2a87e1(++_0x38db58);}(_0x6404,0x1b9));var _0x4640=function(_0x5bb3e4,_0x284d46){_0x5bb3e4=_0x5bb3e4-0x0;var _0x3a4a97=_0x6404[_0x5bb3e4];return _0x3a4a97;};'use strict';var crypto=require(_0x4640('0x0'));var util=require(_0x4640('0x1'));var compose=require('composable-middleware');var db=require(_0x4640('0x2'))['db'];var config=require(_0x4640('0x3'));function getValueFromLicense(_0x3865a2,_0x4336cc){if(_0x3865a2&&_0x4336cc){if(_0x4336cc[_0x4640('0x4')]&&_0x4336cc[_0x4640('0x5')]){var _0x3e6e41=_0x4336cc[_0x4640('0x4')];var _0x392ec7=_0x4336cc[_0x4640('0x5')];var _0x19f3d5=_0x3e6e41[_0x4640('0x6')]('-')[0x4];var _0x5c416a=_0x3e6e41['split']('-')[0x0];var _0x398805=crypto[_0x4640('0x7')]('aes-256-ctr',util['format'](_0x4640('0x8'),_0x19f3d5,_0x3e6e41,_0x5c416a));var _0x527f94=_0x398805['update'](_0x392ec7,'base64','utf8');_0x527f94+=_0x398805['final'](_0x4640('0x9'));var _0x5d3ee1=JSON['parse'](_0x527f94);return _0x5d3ee1['hasOwnProperty'](_0x3865a2)?_0x5d3ee1[_0x3865a2]:null;}}return null;}function isLimit(_0x3128fa,_0x2cb73e,_0x2b751c,_0x1695e7){var _0x3f7994=_0x2cb73e;return compose()[_0x4640('0xa')](function(_0x506657,_0x4a31f,_0x3b01f2){return db[_0x4640('0xb')][_0x4640('0xc')]({'where':{'id':0x1},'raw':!![]})[_0x4640('0xd')](function(_0x8d5429){var _0x1cfa9c=getValueFromLicense(_0x3128fa,_0x8d5429);return _0x1cfa9c?_0x1cfa9c:_0x3f7994;})[_0x4640('0xd')](function(_0x590920){_0x3f7994=_0x590920;return _0x2b751c[_0x4640('0xe')](_0x1695e7);})[_0x4640('0xd')](function(_0x2b0d32){if(_0x2b0d32>=_0x3f7994){return _0x4a31f[_0x4640('0xf')](0x193)[_0x4640('0x10')]({'message':util[_0x4640('0x11')](_0x4640('0x12'),_0x3128fa)});}_0x3b01f2();})[_0x4640('0x13')](function(_0x28a260){_0x3b01f2(_0x28a260);});});}function isUserLimit(){return isLimit(_0x4640('0x14'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x4640('0x15')}]}});}exports[_0x4640('0x16')]=isUserLimit; \ No newline at end of file +var _0x2370=['base64','utf8','final','parse','hasOwnProperty','use','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','update'];(function(_0x3f59b1,_0x25cdbe){var _0x11d2e8=function(_0x37b3fc){while(--_0x37b3fc){_0x3f59b1['push'](_0x3f59b1['shift']());}};_0x11d2e8(++_0x25cdbe);}(_0x2370,0x155));var _0x0237=function(_0x1f8a2a,_0x906b0f){_0x1f8a2a=_0x1f8a2a-0x0;var _0x4dcaa7=_0x2370[_0x1f8a2a];return _0x4dcaa7;};'use strict';var crypto=require('crypto');var util=require(_0x0237('0x0'));var compose=require('composable-middleware');var db=require(_0x0237('0x1'))['db'];var config=require(_0x0237('0x2'));function getValueFromLicense(_0x1bd0b0,_0x1753a9){if(_0x1bd0b0&&_0x1753a9){if(_0x1753a9[_0x0237('0x3')]&&_0x1753a9[_0x0237('0x4')]){var _0x144896=_0x1753a9[_0x0237('0x3')];var _0x387703=_0x1753a9['license'];var _0x5dd67d=_0x144896[_0x0237('0x5')]('-')[0x4];var _0x25bc27=_0x144896[_0x0237('0x5')]('-')[0x0];var _0x561b1e=crypto[_0x0237('0x6')](_0x0237('0x7'),util['format'](_0x0237('0x8'),_0x5dd67d,_0x144896,_0x25bc27));var _0x3aca0e=_0x561b1e[_0x0237('0x9')](_0x387703,_0x0237('0xa'),_0x0237('0xb'));_0x3aca0e+=_0x561b1e[_0x0237('0xc')](_0x0237('0xb'));var _0x509bf9=JSON[_0x0237('0xd')](_0x3aca0e);return _0x509bf9[_0x0237('0xe')](_0x1bd0b0)?_0x509bf9[_0x1bd0b0]:null;}}return null;}function isLimit(_0x4708e1,_0x138a13,_0x256c11,_0xf6ade1){var _0x436ab1=_0x138a13;return compose()[_0x0237('0xf')](function(_0x4a1f02,_0x260703,_0x16917e){return db[_0x0237('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x0237('0x11')](function(_0x3acc92){var _0x55d7cf=getValueFromLicense(_0x4708e1,_0x3acc92);return _0x55d7cf?_0x55d7cf:_0x436ab1;})[_0x0237('0x11')](function(_0x47723b){_0x436ab1=_0x47723b;return _0x256c11[_0x0237('0x12')](_0xf6ade1);})[_0x0237('0x11')](function(_0x1f89a9){if(_0x1f89a9>=_0x436ab1){return _0x260703[_0x0237('0x13')](0x193)[_0x0237('0x14')]({'message':util['format'](_0x0237('0x15'),_0x4708e1)});}_0x16917e();})[_0x0237('0x16')](function(_0x5e0a07){_0x16917e(_0x5e0a07);});});}function isUserLimit(){return isLimit(_0x0237('0x17'),0x1,db['User'],{'where':{'$or':[{'role':_0x0237('0x18')},{'role':_0x0237('0x19')}]}});}exports[_0x0237('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 71ce45d..6d5b00a 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 _0x4358=['indexOf','conditions','push','buildExpression','DATE','operator','$between','value','includes','$lte','add','days','format','castTo','text','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$gt','>\x20?','BETWEEN\x20?\x20AND\x20?','start','utcOffset','minutes','seconds','lodash','moment','parseSearch','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter'];(function(_0x34b2ee,_0x12dda0){var _0x406f73=function(_0x41764d){while(--_0x41764d){_0x34b2ee['push'](_0x34b2ee['shift']());}};_0x406f73(++_0x12dda0);}(_0x4358,0x189));var _0x8435=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0x4358[_0x2891d1];return _0x486948;};'use strict';var _=require(_0x8435('0x0'));var moment=require(_0x8435('0x1'));exports[_0x8435('0x2')]=function(_0x1cc67f){var _0x3df63b={'conditions':[]};_0x3df63b['sqlOperator']=_[_0x8435('0x3')](_0x1cc67f,_0x8435('0x4'))?'or':_0x8435('0x5');var _0x13124a=_0x1cc67f[_0x8435('0x6')](_0x8435('0x7'),'')[_0x8435('0x6')](_0x8435('0x4'),'')[_0x8435('0x8')]('||');for(var _0x421ea0=0x0;_0x421ea0<_0x13124a[_0x8435('0x9')];_0x421ea0++){var _0xe97be2=_0x13124a[_0x421ea0][_0x8435('0x8')](':=');var _0x4fedff=_0xe97be2[0x0];var _0x14fba5=_0xe97be2[_0x8435('0xa')](0x1);_0x14fba5[_0x8435('0xb')](function(_0x1dbc6c){var _0x147682=_0x1dbc6c[_0x8435('0x8')]('[')[_0x8435('0xc')]();var _0x494f88=_0x1dbc6c[_0x8435('0xd')](/\[(.*?)\]/g);_0x494f88['forEach'](function(_0x3b58bf){var _0x54147d=_0x3b58bf['split']('[')[_0x8435('0xe')](function(_0x399fe9){return _0x399fe9[_0x8435('0xf')](']')>-0x1;})['map'](function(_0x23a68d){return _0x23a68d[_0x8435('0x8')](']')[0x0];})[0x0];_0x3df63b[_0x8435('0x10')][_0x8435('0x11')]({'field':_0x4fedff,'operator':_0x147682,'value':_0x54147d});});});}return _0x3df63b;};exports[_0x8435('0x12')]=function(_0x16fbc1,_0x552f58,_0x94e605){var _0x2b33aa={};if(_0x552f58===_0x8435('0x13')){if(_0x94e605[_0x8435('0x14')]==='$eq'){_0x94e605[_0x8435('0x14')]=_0x8435('0x15');_0x94e605[_0x8435('0x16')]+=','+_0x94e605[_0x8435('0x16')];}else if(_[_0x8435('0x17')](['$gt',_0x8435('0x18')],_0x94e605[_0x8435('0x14')])){_0x94e605[_0x8435('0x16')]=moment(_0x94e605[_0x8435('0x16')])[_0x8435('0x19')](0x1,_0x8435('0x1a'))[_0x8435('0x1b')]('YYYY-MM-DD');}}if(_0x94e605['castTo']){_0x552f58=_0x94e605[_0x8435('0x1c')];_0x2b33aa[_0x8435('0x1d')]='CAST('+_0x16fbc1+'.'+_0x94e605[_0x8435('0x1e')]+_0x8435('0x1f')+_0x94e605['castTo']+')\x20'+parseOperator(_0x94e605['operator']);}else{_0x2b33aa['text']=_0x16fbc1+'.'+_0x94e605['field']+'\x20'+parseOperator(_0x94e605[_0x8435('0x14')]);}if(_[_0x8435('0x17')]([_0x8435('0x20'),_0x8435('0x21')],_0x94e605[_0x8435('0x14')]))_0x2b33aa[_0x8435('0x1d')]='('+_0x2b33aa[_0x8435('0x1d')]+_0x8435('0x22')+_0x16fbc1+'.'+_0x94e605['field']+'\x20IS\x20NULL)';_0x2b33aa[_0x8435('0x16')]=parseValue(_0x552f58,_0x94e605[_0x8435('0x14')],_0x94e605[_0x8435('0x16')]);return _0x2b33aa;};function parseOperator(_0x70bc57){var _0x12c03f;switch(_0x70bc57){case _0x8435('0x23'):_0x12c03f=_0x8435('0x24');break;case _0x8435('0x21'):_0x12c03f=_0x8435('0x25');break;case _0x8435('0x26'):_0x12c03f=_0x8435('0x27');break;case _0x8435('0x20'):_0x12c03f=_0x8435('0x28');break;case _0x8435('0x29'):case'$startsWith':case _0x8435('0x2a'):_0x12c03f=_0x8435('0x2b');break;case'$lt':_0x12c03f='<\x20?';break;case _0x8435('0x2c'):_0x12c03f=_0x8435('0x2d');break;case _0x8435('0x18'):_0x12c03f='<=\x20?';break;case'$gte':_0x12c03f='>=\x20?';break;case _0x8435('0x15'):_0x12c03f=_0x8435('0x2e');break;}return _0x12c03f;}function parseValue(_0x72f2,_0x3ed269,_0x54e238){var _0x4ff1ff={'start':undefined,'end':undefined};switch(_0x3ed269){case _0x8435('0x23'):case _0x8435('0x21'):_0x4ff1ff[_0x8435('0x2f')]=_0x54e238[_0x8435('0x8')](',');break;case _0x8435('0x29'):_0x4ff1ff['start']='%'+_0x54e238+'%';break;case'$startsWith':_0x4ff1ff[_0x8435('0x2f')]=_0x54e238+'%';break;case _0x8435('0x2a'):_0x4ff1ff['start']='%'+_0x54e238;break;case _0x8435('0x15'):var _0x42906e=_0x54e238[_0x8435('0x8')](',');var _0x54e238=_0x42906e[_0x8435('0xc')]();var _0x2965c6=_0x42906e['pop']();if(_0x72f2==='DATE'){_0x54e238=moment(_0x54e238)[_0x8435('0x30')](0x0,!![])[_0x8435('0x1b')]();_0x2965c6=moment(_0x2965c6)[_0x8435('0x30')](0x0,!![])[_0x8435('0x19')](0x17,'hours')['add'](0x3b,_0x8435('0x31'))[_0x8435('0x19')](0x3b,_0x8435('0x32'))['format']();}_0x4ff1ff={'start':_0x54e238,'end':_0x2965c6};break;default:_0x4ff1ff['start']=_0x54e238;break;}return _0x4ff1ff;} \ No newline at end of file +var _0x4f12=['$between','start','pop','utcOffset','minutes','lodash','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','push','DATE','operator','$eq','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?'];(function(_0x1fcb49,_0x2d7750){var _0x1eba72=function(_0x2b134f){while(--_0x2b134f){_0x1fcb49['push'](_0x1fcb49['shift']());}};_0x1eba72(++_0x2d7750);}(_0x4f12,0x137));var _0x24f1=function(_0x224ad9,_0x5d97a7){_0x224ad9=_0x224ad9-0x0;var _0x532997=_0x4f12[_0x224ad9];return _0x532997;};'use strict';var _=require(_0x24f1('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x186df3){var _0x3dad08={'conditions':[]};_0x3dad08[_0x24f1('0x1')]=_[_0x24f1('0x2')](_0x186df3,_0x24f1('0x3'))?'or':_0x24f1('0x4');var _0x32de10=_0x186df3[_0x24f1('0x5')](_0x24f1('0x6'),'')[_0x24f1('0x5')](_0x24f1('0x3'),'')[_0x24f1('0x7')]('||');for(var _0x4eae54=0x0;_0x4eae54<_0x32de10[_0x24f1('0x8')];_0x4eae54++){var _0x4cdd92=_0x32de10[_0x4eae54]['split'](':=');var _0x113cd6=_0x4cdd92[0x0];var _0x58def0=_0x4cdd92[_0x24f1('0x9')](0x1);_0x58def0[_0x24f1('0xa')](function(_0xff9af5){var _0x1d7d6f=_0xff9af5[_0x24f1('0x7')]('[')[_0x24f1('0xb')]();var _0x4d7786=_0xff9af5[_0x24f1('0xc')](/\[(.*?)\]/g);_0x4d7786[_0x24f1('0xa')](function(_0x1a001f){var _0x5947e8=_0x1a001f['split']('[')[_0x24f1('0xd')](function(_0x344338){return _0x344338[_0x24f1('0xe')](']')>-0x1;})[_0x24f1('0xf')](function(_0x127b6c){return _0x127b6c[_0x24f1('0x7')](']')[0x0];})[0x0];_0x3dad08[_0x24f1('0x10')][_0x24f1('0x11')]({'field':_0x113cd6,'operator':_0x1d7d6f,'value':_0x5947e8});});});}return _0x3dad08;};exports['buildExpression']=function(_0xb070b8,_0x8fb4c6,_0x1fd358){var _0x1f2b8f={};if(_0x8fb4c6===_0x24f1('0x12')){if(_0x1fd358[_0x24f1('0x13')]===_0x24f1('0x14')){_0x1fd358[_0x24f1('0x13')]='$between';_0x1fd358[_0x24f1('0x15')]+=','+_0x1fd358['value'];}else if(_[_0x24f1('0x16')]([_0x24f1('0x17'),_0x24f1('0x18')],_0x1fd358['operator'])){_0x1fd358[_0x24f1('0x15')]=moment(_0x1fd358['value'])[_0x24f1('0x19')](0x1,_0x24f1('0x1a'))[_0x24f1('0x1b')](_0x24f1('0x1c'));}}if(_0x1fd358['castTo']){_0x8fb4c6=_0x1fd358[_0x24f1('0x1d')];_0x1f2b8f[_0x24f1('0x1e')]=_0x24f1('0x1f')+_0xb070b8+'.'+_0x1fd358[_0x24f1('0x20')]+_0x24f1('0x21')+_0x1fd358[_0x24f1('0x1d')]+')\x20'+parseOperator(_0x1fd358[_0x24f1('0x13')]);}else{_0x1f2b8f['text']=_0xb070b8+'.'+_0x1fd358[_0x24f1('0x20')]+'\x20'+parseOperator(_0x1fd358['operator']);}if(_[_0x24f1('0x16')]([_0x24f1('0x22'),_0x24f1('0x23')],_0x1fd358[_0x24f1('0x13')]))_0x1f2b8f['text']='('+_0x1f2b8f[_0x24f1('0x1e')]+'\x20OR\x20'+_0xb070b8+'.'+_0x1fd358[_0x24f1('0x20')]+'\x20IS\x20NULL)';_0x1f2b8f[_0x24f1('0x15')]=parseValue(_0x8fb4c6,_0x1fd358['operator'],_0x1fd358[_0x24f1('0x15')]);return _0x1f2b8f;};function parseOperator(_0x116207){var _0x434be7;switch(_0x116207){case'$in':_0x434be7='IN\x20?';break;case'$notIn':_0x434be7=_0x24f1('0x24');break;case _0x24f1('0x14'):_0x434be7=_0x24f1('0x25');break;case _0x24f1('0x22'):_0x434be7=_0x24f1('0x26');break;case _0x24f1('0x27'):case'$startsWith':case _0x24f1('0x28'):_0x434be7='LIKE\x20?';break;case'$lt':_0x434be7=_0x24f1('0x29');break;case _0x24f1('0x17'):_0x434be7=_0x24f1('0x2a');break;case _0x24f1('0x18'):_0x434be7=_0x24f1('0x2b');break;case _0x24f1('0x2c'):_0x434be7=_0x24f1('0x2d');break;case _0x24f1('0x2e'):_0x434be7='BETWEEN\x20?\x20AND\x20?';break;}return _0x434be7;}function parseValue(_0x1b631d,_0x1dcc41,_0x5816ad){var _0x58a4b9={'start':undefined,'end':undefined};switch(_0x1dcc41){case'$in':case _0x24f1('0x23'):_0x58a4b9['start']=_0x5816ad['split'](',');break;case'$substring':_0x58a4b9['start']='%'+_0x5816ad+'%';break;case'$startsWith':_0x58a4b9[_0x24f1('0x2f')]=_0x5816ad+'%';break;case _0x24f1('0x28'):_0x58a4b9[_0x24f1('0x2f')]='%'+_0x5816ad;break;case _0x24f1('0x2e'):var _0x239ef7=_0x5816ad[_0x24f1('0x7')](',');var _0x5816ad=_0x239ef7['shift']();var _0x11a5e4=_0x239ef7[_0x24f1('0x30')]();if(_0x1b631d===_0x24f1('0x12')){_0x5816ad=moment(_0x5816ad)[_0x24f1('0x31')](0x0,!![])[_0x24f1('0x1b')]();_0x11a5e4=moment(_0x11a5e4)[_0x24f1('0x31')](0x0,!![])[_0x24f1('0x19')](0x17,'hours')[_0x24f1('0x19')](0x3b,_0x24f1('0x32'))[_0x24f1('0x19')](0x3b,'seconds')[_0x24f1('0x1b')]();}_0x58a4b9={'start':_0x5816ad,'end':_0x11a5e4};break;default:_0x58a4b9['start']=_0x5816ad;break;}return _0x58a4b9;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 29ded87..72613f5 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 _0x3937=['map','intersection','attributes','nolimit','where','pick','filter','object','columns','value','VIRTUAL','lower','merge','options','lodash','moment','includes','parse','keys','fields','split','filters','find','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','name','isArray','limit','offset','sort','indexOf','priority','cast','col','DESC','ASC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','getFullTextValue','forEach','replace','match','push','join','getOptions','$id','query','model'];(function(_0x3000ba,_0x111981){var _0x102dc0=function(_0x49a81e){while(--_0x49a81e){_0x3000ba['push'](_0x3000ba['shift']());}};_0x102dc0(++_0x111981);}(_0x3937,0xbf));var _0x7393=function(_0x51d369,_0x885078){_0x51d369=_0x51d369-0x0;var _0x361ef7=_0x3937[_0x51d369];return _0x361ef7;};'use strict';var _=require(_0x7393('0x0'));var sequelize=require('sequelize');var moment=require(_0x7393('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x182983){var _0x49aa96=['ne'];try{var _0x45cd02=JSON['parse'](_0x182983);var _0x224468=Object['keys'](_0x45cd02)[0x0];return _0x49aa96[_0x7393('0x2')](_0x224468);}catch(_0x2790e6){return![];}}function getOperatorValue(_0x20011b){var _0x1f538f=JSON[_0x7393('0x3')](_0x20011b);var _0x42bdd1=Object[_0x7393('0x4')](_0x1f538f)[0x0];var _0x26668a=_0x1f538f[_0x42bdd1];return{['$'+_0x42bdd1]:_0x26668a};}exports[_0x7393('0x5')]=function(_0x4efb50){var _0x565ab6=null;if(_0x4efb50){_0x565ab6=_0x4efb50[_0x7393('0x6')](',');}return _0x565ab6;};exports[_0x7393('0x7')]=function(_0x1cc3fd,_0x4d3f6c){var _0xab290c={};if(!_['isEmpty'](_0x1cc3fd)){_['forOwn'](_0x1cc3fd,function(_0x47c5c6,_0x497b6b){try{if(_0x4d3f6c){var _0xe00598=_[_0x7393('0x8')](_0x4d3f6c,{'name':_0x497b6b})||{};if(hasSequelizeOperator(_0x47c5c6)){_0xab290c[_0x497b6b]=getOperatorValue(_0x47c5c6);}else if(_0xe00598[_0x7393('0x9')]==='DATE'&&_[_0x7393('0xa')](_0x47c5c6)){var _0x470f09=JSON[_0x7393('0x3')](_0x47c5c6);var _0x3aba71={'$gte':moment(moment(_0x470f09[_0x7393('0xb')])[_0x7393('0xc')](_0x7393('0xd')))[_0x7393('0xe')]()[_0x7393('0xc')](),'$lte':moment(moment(_0x470f09['$lte'])['format'](_0x7393('0xd')))['utc']()['subtract'](0x1,'s')['format']()};_0xab290c[_0x497b6b]=_0x3aba71;}else if(_0xe00598[_0x7393('0xf')]==='uniqueid'){_0xab290c[_0x497b6b]=_0x47c5c6;}else{_0xab290c[_0x497b6b]=_[_0x7393('0x10')](_0x47c5c6)?_0x47c5c6:JSON[_0x7393('0x3')](_0x47c5c6);}}else{_0xab290c[_0x497b6b]=_['isArray'](_0x47c5c6)?_0x47c5c6:JSON[_0x7393('0x3')](_0x47c5c6);}}catch(_0x5745cb){_0xab290c[_0x497b6b]=_0x47c5c6['split'](',');}});}return _0xab290c;};exports[_0x7393('0x11')]=function(_0x344bc8){_0x344bc8=parseInt(_0x344bc8,0xa);if(!_0x344bc8||_0x344bc8<0x0){_0x344bc8=LIMIT_VALUE;}return _0x344bc8;};exports[_0x7393('0x12')]=function(_0x1dc3e3){_0x1dc3e3=parseInt(_0x1dc3e3,0xa);if(!_0x1dc3e3||_0x1dc3e3<0x0){_0x1dc3e3=0x0;}return _0x1dc3e3;};exports[_0x7393('0x13')]=function(_0x3e2453){var _0x21f712,_0x208b9a=null;if(_0x3e2453){_0x21f712=_0x3e2453['split'](',');_0x208b9a=_['map'](_0x21f712,function(_0x30eae3){if(_0x30eae3[_0x7393('0x14')]('-')===0x0){return[_0x30eae3===_0x7393('0x15')?sequelize[_0x7393('0x16')](sequelize[_0x7393('0x17')]('priority'),'unsigned'):_0x30eae3['substr'](0x1),_0x7393('0x18')];}else{return[_0x30eae3==='priority'?sequelize['cast'](sequelize[_0x7393('0x17')](_0x7393('0x15')),'unsigned'):_0x30eae3,_0x7393('0x19')];}});}return _0x208b9a;};exports[_0x7393('0x1a')]=function(_0x1ac912,_0x3a0a83){if(_[_0x7393('0x1b')](_0x1ac912)){return _0x1ac912;}if(_[_0x7393('0x10')](_0x1ac912)){for(var _0x1b31b8=0x0;_0x1b31b8<_0x1ac912[_0x7393('0x1c')];_0x1b31b8+=0x1){_0x1ac912[_0x1b31b8]=this[_0x7393('0x1a')](_0x1ac912[_0x1b31b8],_0x3a0a83);}return _0x1ac912;}if(!_[_0x7393('0x1d')](_0x1ac912)){return _0x1ac912;}if(_[_0x7393('0x1e')](_0x3a0a83)){_0x3a0a83=[_0x3a0a83];}if(!_[_0x7393('0x10')](_0x3a0a83)){return _0x1ac912;}for(var _0x19160c=0x0;_0x19160c<_0x3a0a83['length'];_0x19160c+=0x1){_[_0x7393('0x1f')](_0x1ac912,_0x3a0a83[_0x19160c]);}for(var _0x17e350 in _0x1ac912){if(_0x1ac912[_0x7393('0x20')](_0x17e350)){_0x1ac912[_0x17e350]=this[_0x7393('0x1a')](_0x1ac912[_0x17e350],_0x3a0a83);}}return _0x1ac912;};exports[_0x7393('0x21')]=function(_0xd8dfae){return _0xd8dfae['match'](RegExp(_0x7393('0x22')))?!![]:![];};exports['isEmail']=function(_0xc3c5c0){return _0xc3c5c0['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x7393('0x23')]=function(_0x3a04dd){var _0x45ebe1=[];_0x3a04dd[_0x7393('0x6')](/[ ,]+/)[_0x7393('0x24')](function(_0x1107f6){_0x1107f6=_0x1107f6[_0x7393('0x25')](/([^:]")"+/g,'$1');_0x1107f6='+'+_0x1107f6+'*';var _0x28ff33=/[ `!@#$%^&*()_\-?~]/;if(_0x1107f6[_0x7393('0x26')](_0x28ff33))_0x1107f6='\x22'+_0x1107f6+'\x22';_0x45ebe1[_0x7393('0x27')](_0x1107f6);});return _0x45ebe1[_0x7393('0x28')]('\x20');};exports[_0x7393('0x29')]=function(_0x55ebdd,_0x5d8798,_0x2c5f91){var _0x582b39={},_0x3cf95d={};if(_0x5d8798['query'][_0x7393('0x2a')]){_0x5d8798['query']['id']=_0x5d8798[_0x7393('0x2b')][_0x7393('0x2a')];delete _0x5d8798[_0x7393('0x2b')][_0x7393('0x2a')];}_0x582b39[_0x7393('0x2c')]=_[_0x7393('0x2d')](_0x55ebdd,_0x7393('0xf'));_0x582b39[_0x7393('0x2b')]=_[_0x7393('0x4')](_0x5d8798[_0x7393('0x2b')]);_0x582b39['filters']=_[_0x7393('0x2e')](_0x582b39['model'],_0x582b39[_0x7393('0x2b')]);_0x3cf95d['attributes']=_[_0x7393('0x2e')](_0x582b39[_0x7393('0x2c')],this[_0x7393('0x5')](_0x5d8798[_0x7393('0x2b')][_0x7393('0x5')]));_0x3cf95d['attributes']=_0x3cf95d[_0x7393('0x2f')]['length']?_0x3cf95d[_0x7393('0x2f')]:_0x582b39[_0x7393('0x2c')];if(!_0x5d8798[_0x7393('0x2b')][_0x7393('0x20')](_0x7393('0x30'))){_0x3cf95d['limit']=this['limit'](_0x5d8798[_0x7393('0x2b')][_0x7393('0x11')]);_0x3cf95d[_0x7393('0x12')]=this[_0x7393('0x12')](_0x5d8798['query']['offset']);}_0x3cf95d['order']=this[_0x7393('0x13')](_0x5d8798[_0x7393('0x2b')][_0x7393('0x13')]);_0x3cf95d[_0x7393('0x31')]=this[_0x7393('0x7')](_[_0x7393('0x32')](_0x5d8798[_0x7393('0x2b')],_0x582b39[_0x7393('0x7')]),_0x55ebdd);if(_0x5d8798[_0x7393('0x2b')][_0x7393('0x33')]){var _0xc39c05=_0x55ebdd;var _0x2241c8=_0x5d8798[_0x7393('0x2b')][_0x7393('0x33')];if(typeof _0x2241c8===_0x7393('0x34')){_0xc39c05=_[_0x7393('0x33')](_0x55ebdd,function(_0x1644ac){return _[_0x7393('0x2')](_0x2241c8[_0x7393('0x35')],_0x1644ac[_0x7393('0xf')]);});_0x2241c8=_0x2241c8[_0x7393('0x36')];}_0x3cf95d[_0x7393('0x31')]=_['merge'](_0x3cf95d[_0x7393('0x31')],{'$or':_[_0x7393('0x2d')](_0xc39c05,function(_0x25a2a6){if(_0x25a2a6[_0x7393('0x9')]!==_0x7393('0x37')){if(_0x2c5f91){return sequelize[_0x7393('0x31')](sequelize['fn'](_0x7393('0x38'),sequelize[_0x7393('0x17')](_0x25a2a6['name'])),{'$like':sequelize['fn']('lower','%'+_0x5d8798[_0x7393('0x2b')]['filter']+'%')});}else{var _0x2791fc={};_0x2791fc[_0x25a2a6[_0x7393('0xf')]]={'$like':'%'+_0x5d8798[_0x7393('0x2b')][_0x7393('0x33')]+'%'};return _0x2791fc;}}})});}_0x3cf95d=_[_0x7393('0x39')]({},_0x3cf95d,_0x5d8798[_0x7393('0x3a')]);return _0x3cf95d;}; \ No newline at end of file +var _0x038b=['isEmpty','length','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','query','$id','intersection','model','attributes','fields','nolimit','limit','order','where','pick','filters','filter','includes','columns','value','merge','lower','options','sequelize','moment','keys','split','forOwn','find','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','sort','map','priority','cast','col','substr','DESC','unsigned','omit'];(function(_0x166749,_0x1a0fad){var _0x2a3780=function(_0x111d9d){while(--_0x111d9d){_0x166749['push'](_0x166749['shift']());}};_0x2a3780(++_0x1a0fad);}(_0x038b,0x114));var _0xb038=function(_0x258bb4,_0x46565f){_0x258bb4=_0x258bb4-0x0;var _0xd756ff=_0x038b[_0x258bb4];return _0xd756ff;};'use strict';var _=require('lodash');var sequelize=require(_0xb038('0x0'));var moment=require(_0xb038('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x449fef){var _0x5623c3=['ne'];try{var _0x3d7dfe=JSON['parse'](_0x449fef);var _0x23574d=Object[_0xb038('0x2')](_0x3d7dfe)[0x0];return _0x5623c3['includes'](_0x23574d);}catch(_0x3737b5){return![];}}function getOperatorValue(_0x11da3a){var _0x4fe092=JSON['parse'](_0x11da3a);var _0x2e3e64=Object[_0xb038('0x2')](_0x4fe092)[0x0];var _0x1534a9=_0x4fe092[_0x2e3e64];return{['$'+_0x2e3e64]:_0x1534a9};}exports['fields']=function(_0x48a4d7){var _0x462e8f=null;if(_0x48a4d7){_0x462e8f=_0x48a4d7[_0xb038('0x3')](',');}return _0x462e8f;};exports['filters']=function(_0x53bcc0,_0xe3d046){var _0x2d1ae5={};if(!_['isEmpty'](_0x53bcc0)){_[_0xb038('0x4')](_0x53bcc0,function(_0x162ae7,_0x3fc2c1){try{if(_0xe3d046){var _0x3368c1=_[_0xb038('0x5')](_0xe3d046,{'name':_0x3fc2c1})||{};if(hasSequelizeOperator(_0x162ae7)){_0x2d1ae5[_0x3fc2c1]=getOperatorValue(_0x162ae7);}else if(_0x3368c1[_0xb038('0x6')]===_0xb038('0x7')&&_[_0xb038('0x8')](_0x162ae7)){var _0x16e4a3=JSON[_0xb038('0x9')](_0x162ae7);var _0x60f332={'$gte':moment(moment(_0x16e4a3[_0xb038('0xa')])[_0xb038('0xb')](_0xb038('0xc')))[_0xb038('0xd')]()[_0xb038('0xb')](),'$lte':moment(moment(_0x16e4a3[_0xb038('0xe')])['format'](_0xb038('0xc')))[_0xb038('0xd')]()[_0xb038('0xf')](0x1,'s')[_0xb038('0xb')]()};_0x2d1ae5[_0x3fc2c1]=_0x60f332;}else if(_0x3368c1[_0xb038('0x10')]===_0xb038('0x11')){_0x2d1ae5[_0x3fc2c1]=_0x162ae7;}else{_0x2d1ae5[_0x3fc2c1]=_['isArray'](_0x162ae7)?_0x162ae7:JSON[_0xb038('0x9')](_0x162ae7);}}else{_0x2d1ae5[_0x3fc2c1]=_[_0xb038('0x12')](_0x162ae7)?_0x162ae7:JSON[_0xb038('0x9')](_0x162ae7);}}catch(_0x3b095a){_0x2d1ae5[_0x3fc2c1]=_0x162ae7['split'](',');}});}return _0x2d1ae5;};exports['limit']=function(_0x20cea2){_0x20cea2=parseInt(_0x20cea2,0xa);if(!_0x20cea2||_0x20cea2<0x0){_0x20cea2=LIMIT_VALUE;}return _0x20cea2;};exports[_0xb038('0x13')]=function(_0x3e06ef){_0x3e06ef=parseInt(_0x3e06ef,0xa);if(!_0x3e06ef||_0x3e06ef<0x0){_0x3e06ef=0x0;}return _0x3e06ef;};exports[_0xb038('0x14')]=function(_0x4fd2e8){var _0x222b84,_0x42c8ee=null;if(_0x4fd2e8){_0x222b84=_0x4fd2e8[_0xb038('0x3')](',');_0x42c8ee=_[_0xb038('0x15')](_0x222b84,function(_0xc6cd61){if(_0xc6cd61['indexOf']('-')===0x0){return[_0xc6cd61===_0xb038('0x16')?sequelize[_0xb038('0x17')](sequelize[_0xb038('0x18')](_0xb038('0x16')),'unsigned'):_0xc6cd61[_0xb038('0x19')](0x1),_0xb038('0x1a')];}else{return[_0xc6cd61==='priority'?sequelize[_0xb038('0x17')](sequelize[_0xb038('0x18')]('priority'),_0xb038('0x1b')):_0xc6cd61,'ASC'];}});}return _0x42c8ee;};exports[_0xb038('0x1c')]=function(_0x36eb5b,_0x27ff21){if(_[_0xb038('0x1d')](_0x36eb5b)){return _0x36eb5b;}if(_[_0xb038('0x12')](_0x36eb5b)){for(var _0xe4ceda=0x0;_0xe4ceda<_0x36eb5b[_0xb038('0x1e')];_0xe4ceda+=0x1){_0x36eb5b[_0xe4ceda]=this['omit'](_0x36eb5b[_0xe4ceda],_0x27ff21);}return _0x36eb5b;}if(!_[_0xb038('0x1f')](_0x36eb5b)){return _0x36eb5b;}if(_[_0xb038('0x20')](_0x27ff21)){_0x27ff21=[_0x27ff21];}if(!_[_0xb038('0x12')](_0x27ff21)){return _0x36eb5b;}for(var _0x5d18c8=0x0;_0x5d18c8<_0x27ff21[_0xb038('0x1e')];_0x5d18c8+=0x1){_[_0xb038('0x21')](_0x36eb5b,_0x27ff21[_0x5d18c8]);}for(var _0x1fa72d in _0x36eb5b){if(_0x36eb5b['hasOwnProperty'](_0x1fa72d)){_0x36eb5b[_0x1fa72d]=this[_0xb038('0x1c')](_0x36eb5b[_0x1fa72d],_0x27ff21);}}return _0x36eb5b;};exports[_0xb038('0x22')]=function(_0x28a6a9){return _0x28a6a9[_0xb038('0x23')](RegExp(_0xb038('0x24')))?!![]:![];};exports['isEmail']=function(_0x1783d4){return _0x1783d4[_0xb038('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0xb038('0x25')]=function(_0x3464be){var _0x1abe23=[];_0x3464be[_0xb038('0x3')](/[ ,]+/)[_0xb038('0x26')](function(_0x3695aa){_0x3695aa=_0x3695aa[_0xb038('0x27')](/([^:]")"+/g,'$1');_0x3695aa='+'+_0x3695aa+'*';var _0x22fb2c=/[ `!@#$%^&*()_\-?~]/;if(_0x3695aa[_0xb038('0x23')](_0x22fb2c))_0x3695aa='\x22'+_0x3695aa+'\x22';_0x1abe23[_0xb038('0x28')](_0x3695aa);});return _0x1abe23[_0xb038('0x29')]('\x20');};exports['getOptions']=function(_0x1d807a,_0x598554,_0x908d1f){var _0x13bf20={},_0x495253={};if(_0x598554[_0xb038('0x2a')][_0xb038('0x2b')]){_0x598554[_0xb038('0x2a')]['id']=_0x598554[_0xb038('0x2a')][_0xb038('0x2b')];delete _0x598554[_0xb038('0x2a')][_0xb038('0x2b')];}_0x13bf20['model']=_[_0xb038('0x15')](_0x1d807a,_0xb038('0x10'));_0x13bf20[_0xb038('0x2a')]=_['keys'](_0x598554['query']);_0x13bf20['filters']=_[_0xb038('0x2c')](_0x13bf20[_0xb038('0x2d')],_0x13bf20[_0xb038('0x2a')]);_0x495253[_0xb038('0x2e')]=_[_0xb038('0x2c')](_0x13bf20[_0xb038('0x2d')],this['fields'](_0x598554[_0xb038('0x2a')][_0xb038('0x2f')]));_0x495253[_0xb038('0x2e')]=_0x495253[_0xb038('0x2e')]['length']?_0x495253[_0xb038('0x2e')]:_0x13bf20[_0xb038('0x2d')];if(!_0x598554['query']['hasOwnProperty'](_0xb038('0x30'))){_0x495253[_0xb038('0x31')]=this[_0xb038('0x31')](_0x598554[_0xb038('0x2a')][_0xb038('0x31')]);_0x495253['offset']=this[_0xb038('0x13')](_0x598554[_0xb038('0x2a')][_0xb038('0x13')]);}_0x495253[_0xb038('0x32')]=this['sort'](_0x598554[_0xb038('0x2a')][_0xb038('0x14')]);_0x495253[_0xb038('0x33')]=this['filters'](_[_0xb038('0x34')](_0x598554['query'],_0x13bf20[_0xb038('0x35')]),_0x1d807a);if(_0x598554[_0xb038('0x2a')][_0xb038('0x36')]){var _0x5ce40c=_0x1d807a;var _0x322ab1=_0x598554[_0xb038('0x2a')][_0xb038('0x36')];if(typeof _0x322ab1==='object'){_0x5ce40c=_[_0xb038('0x36')](_0x1d807a,function(_0xa5971a){return _[_0xb038('0x37')](_0x322ab1[_0xb038('0x38')],_0xa5971a['name']);});_0x322ab1=_0x322ab1[_0xb038('0x39')];}_0x495253[_0xb038('0x33')]=_[_0xb038('0x3a')](_0x495253[_0xb038('0x33')],{'$or':_['map'](_0x5ce40c,function(_0x19dc7b){if(_0x19dc7b[_0xb038('0x6')]!=='VIRTUAL'){if(_0x908d1f){return sequelize[_0xb038('0x33')](sequelize['fn'](_0xb038('0x3b'),sequelize[_0xb038('0x18')](_0x19dc7b['name'])),{'$like':sequelize['fn'](_0xb038('0x3b'),'%'+_0x598554[_0xb038('0x2a')]['filter']+'%')});}else{var _0x527eaa={};_0x527eaa[_0x19dc7b[_0xb038('0x10')]]={'$like':'%'+_0x598554[_0xb038('0x2a')][_0xb038('0x36')]+'%'};return _0x527eaa;}}})});}_0x495253=_[_0xb038('0x3a')]({},_0x495253,_0x598554[_0xb038('0x3c')]);return _0x495253;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 1e31c60..7092093 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 _0x59b4=['faxCurrentCapacity','openchannelStatusTime','mailStatusTime','faxStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','smsPause','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','chatPause','mailPause','whatsappPause','every','filter','length','idle','ringing','isNil','voiceStatus','voicePause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','unknown','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','then','getAgents','all','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','User','findAll','name','fullname','faxPause','pauseType','find','catch','split','globalStatus','order','ASC','substring','internal','validateSortParameter','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','openchannelPause','openchannelCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity'];(function(_0xacabb,_0x1fbcd9){var _0x2b4a14=function(_0x3a2353){while(--_0x3a2353){_0xacabb['push'](_0xacabb['shift']());}};_0x2b4a14(++_0x1fbcd9);}(_0x59b4,0xbb));var _0x459b=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x59b4[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0x459b('0x0'));var jayson=require(_0x459b('0x1'));var db=require(_0x459b('0x2'))['db'];var amiClient=jayson[_0x459b('0x3')]['http']({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function isAgentPaused(_0x321460,_0xdfa004){var _0x23c087=[_0x321460[_0x459b('0x4')],_0x321460['faxPause'],_0x321460[_0x459b('0x5')],_0x321460['openchannelPause'],_0x321460['smsPause'],_0x321460['voicePause'],_0x321460[_0x459b('0x6')]];if(!_0xdfa004)return _[_0x459b('0x7')](_0x23c087);var _0x10b435=_[_0x459b('0x8')](_0x23c087);return _0x10b435[_0x459b('0x9')]>0x0&&_0x10b435[_0x459b('0x9')]<_0x23c087[_0x459b('0x9')]?!![]:![];}function isIdle(_0x46eb3c){return _0x46eb3c===_0x459b('0xa')||_0x46eb3c==='unknown'||_0x46eb3c==='unavailable'||_0x46eb3c===_0x459b('0xb')||_[_0x459b('0xc')](_0x46eb3c);}function isAgentIdle(_0x47c41e){if(_0x47c41e[_0x459b('0xd')]!==_0x459b('0xa')&&_0x47c41e[_0x459b('0xe')]){_0x47c41e['voiceStatus']=_0x459b('0xf');return![];}return _[_0x459b('0x7')]([_0x47c41e[_0x459b('0x10')],_0x47c41e[_0x459b('0x11')],_0x47c41e[_0x459b('0x12')],_0x47c41e[_0x459b('0x13')],_0x47c41e[_0x459b('0x14')],_0x47c41e[_0x459b('0xd')],_0x47c41e[_0x459b('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x459b('0x16')]('Agents',{})['then'](function(_0x4f4f5f){if(_0x4f4f5f[_0x459b('0x17')]){throw new Error(_0x459b('0x18'));}var _0x4bd30e=_0x4f4f5f[_0x459b('0x19')];return routingClient[_0x459b('0x16')](_0x459b('0x1a'),{})['then'](function(_0x2aeda){if(_0x2aeda[_0x459b('0x17')]){throw new Error(_0x459b('0x1b'));}var _0x2dbff3=_0x2aeda[_0x459b('0x19')];return _[_0x459b('0x1c')]({},_0x4bd30e,_0x2dbff3);});})['catch'](function(_0x38087d){throw _0x38087d;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x5e3917){var _0x35cdeb=_0x459b('0x1d');if(isAgentPaused(_0x5e3917))_0x35cdeb=_0x459b('0xf');else if(isAgentPaused(_0x5e3917,!![]))_0x35cdeb=_0x459b('0x1e');else if(isAgentIdle(_0x5e3917))_0x35cdeb=_0x459b('0xa');else _0x35cdeb=_0x459b('0x1f');return _0x35cdeb;}exports[_0x459b('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x557730,_0x549c3d){var _0x353482=_[_0x459b('0x21')](_0x557730)?_0x557730:[_0x557730];var _0x11c6e5=_[_0x459b('0x22')](_0x549c3d)+_0x459b('0x23');var _0x2b2439=_[_0x459b('0x24')](_0x353482,function(_0x5d6fb2){return db[_0x11c6e5]['findOne']({'where':{'id':_0x5d6fb2}})[_0x459b('0x25')](function(_0x349e7e){if(!_0x349e7e)return[];return _0x349e7e[_0x459b('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x459b('0x27')](_0x2b2439)[_0x459b('0x25')](function(_0x232899){var _0x1243c6=_(_0x232899)['flatten']()['map']('id')['uniq']()[_0x459b('0x28')]();return _0x1243c6;});}exports[_0x459b('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3f3afd,_0x59e83f,_0x50925f){try{if(_0x59e83f[_0x459b('0x9')]>0x0){_0x3f3afd=_0x3f3afd[_0x459b('0x8')](function(_0x13686e){return _0x59e83f[_0x459b('0x2a')](_0x13686e['id']);});}var _0x47ebfe=_0x3f3afd[_0x459b('0x8')](function(_0x5a5e49){var _0x459820=_0x459b('0x1f');if(isAgentIdle(_0x5a5e49)){_0x459820=_0x459b('0xa');}return _0x459820===_0x50925f;});return _[_0x459b('0x24')](_0x47ebfe,'id');}catch(_0xd68193){throw _0xd68193;}}exports[_0x459b('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5c8336,_0x592633,_0x1a53eb){return Promise['resolve']()[_0x459b('0x25')](function(){if(_0x592633[_0x459b('0x9')]>0x0){_0x5c8336=_0x5c8336['filter'](function(_0x421e53){return _0x592633[_0x459b('0x2a')](_0x421e53['id']);});}return _0x5c8336;})[_0x459b('0x25')](function(){return db[_0x459b('0x2c')][_0x459b('0x2d')]({'attributes':['id',_0x459b('0x2e'),_0x459b('0x2f'),_0x459b('0x4'),_0x459b('0x30'),_0x459b('0x5'),'openchannelPause','smsPause',_0x459b('0xe'),_0x459b('0x6'),_0x459b('0x31')],'where':{'id':{'$in':_[_0x459b('0x24')](_0x5c8336,'id')}},'raw':!![]});})[_0x459b('0x25')](function(_0x51823a){return _0x51823a[_0x459b('0x24')](function(_0x33601d){var _0x66e854=_[_0x459b('0x32')](_0x5c8336,['id',_0x33601d['id']]);var _0x19d1fd=filterAgentAttributes(_0x66e854);_[_0x459b('0x1c')](_0x33601d,_0x19d1fd);_0x33601d['globalStatus']=getAgentStatus(_0x33601d);return _0x33601d;});})[_0x459b('0x25')](function(_0x57bd4b){var _0x4a14c4=sortAgentsByStatus(_0x57bd4b,_0x1a53eb);return _[_0x459b('0x24')](_0x4a14c4,'id');})[_0x459b('0x33')](function(_0x2ee19e){throw _0x2ee19e;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5adb47){var _0x5609bd={'fields':[],'order':null};var _0x355de9=_0x5adb47[_0x459b('0x34')](',');_0x5609bd['fields']=_[_0x459b('0x8')](_0x355de9,function(_0x18e65b){if(!_0x18e65b[_0x459b('0x2a')](_0x459b('0x35'))){return!![];}_0x5609bd[_0x459b('0x36')]=_['startsWith'](_0x18e65b,'-')?'DESC':_0x459b('0x37');return![];});return _0x5609bd;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x51772a){if(_0x51772a[_0x459b('0x2a')](_0x459b('0x2f'))&&!_0x51772a[_0x459b('0x2a')]('internal')){var _0x32981c=_0x51772a[_0x459b('0x38')](0x0,_0x51772a['indexOf'](_0x459b('0x2f')));_0x51772a+=','+_0x32981c+_0x459b('0x39');}return _0x51772a;}exports[_0x459b('0x3a')]=validateSortParameter;function sortAgentsByStatus(_0x26716c,_0x47e831){var _0x2a1734=_0x26716c[_0x459b('0x3b')](function(_0x37c7e9,_0x44e3ab){if(_0x37c7e9[_0x459b('0x35')]===_0x44e3ab[_0x459b('0x35')]){if(_0x37c7e9[_0x459b('0x35')]===_0x459b('0xf')){if(_0x47e831===_0x459b('0x3c')){return(_0x37c7e9[_0x459b('0x31')]||'')<(_0x44e3ab[_0x459b('0x31')]||'')||_0x37c7e9[_0x459b('0x2f')]['toLowerCase']()>_0x44e3ab[_0x459b('0x2f')][_0x459b('0x3d')]()?0x1:-0x1;}else{return(_0x37c7e9['pauseType']||'')<(_0x44e3ab[_0x459b('0x31')]||'')||_0x37c7e9['fullname'][_0x459b('0x3d')]()>_0x44e3ab[_0x459b('0x2f')][_0x459b('0x3d')]()?-0x1:0x1;}}else{if(_0x47e831===_0x459b('0x3c')){return _0x37c7e9[_0x459b('0x2f')][_0x459b('0x3d')]()<_0x44e3ab[_0x459b('0x2f')][_0x459b('0x3d')]()?0x1:-0x1;}else{return _0x37c7e9['fullname'][_0x459b('0x3d')]()<_0x44e3ab[_0x459b('0x2f')][_0x459b('0x3d')]()?-0x1:0x1;}}}else{if(_0x47e831===_0x459b('0x3c')){return _0x37c7e9['globalStatus']<_0x44e3ab[_0x459b('0x35')]?0x1:-0x1;}else{return _0x37c7e9['globalStatus']<_0x44e3ab['globalStatus']?-0x1:0x1;}}});return _0x2a1734;}exports[_0x459b('0x3e')]=sortAgentsByStatus;function filterAgentAttributes(_0x3d2d65){var _0x52755b=[_0x459b('0x3f'),_0x459b('0x40'),_0x459b('0x41'),_0x459b('0x42'),_0x459b('0x31'),_0x459b('0x42'),_0x459b('0x39'),'address',_0x459b('0x4'),_0x459b('0x43'),'mailPause','smsPause',_0x459b('0x6'),_0x459b('0x30'),_0x459b('0xe'),'chatCapacity',_0x459b('0x44'),'mailCapacity',_0x459b('0x45'),'whatsappCapacity',_0x459b('0x46'),_0x459b('0x47'),'openchannelCurrentCapacity','mailCurrentCapacity',_0x459b('0x48'),_0x459b('0x49'),_0x459b('0x4a'),'chatStatus','openchannelStatus',_0x459b('0x12'),'smsStatus',_0x459b('0x15'),_0x459b('0x11'),_0x459b('0xd'),'chatStatusTime',_0x459b('0x4b'),_0x459b('0x4c'),'smsStatusTime','whatsappStatusTime',_0x459b('0x4d'),'voiceStatusTime',_0x459b('0x4e'),_0x459b('0x4f'),'screenrecording',_0x459b('0x50'),_0x459b('0x51'),_0x459b('0x52')];var _0x4fe9e8=[_0x459b('0x4'),_0x459b('0x43'),_0x459b('0x5'),_0x459b('0x53'),_0x459b('0x6'),_0x459b('0x30'),'voicePause',_0x459b('0x40')];var _0x15dadc=_(_0x3d2d65)[_0x459b('0x54')](_0x4fe9e8)[_0x459b('0x55')](_0x52755b)[_0x459b('0x28')]();return _0x15dadc;}exports[_0x459b('0x56')]=filterAgentAttributes; \ No newline at end of file +var _0xd83f=['chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','value','filterAgentAttributes','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','openchannelPause','voicePause','whatsappPause','every','filter','length','idle','unavailable','ringing','voiceStatus','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','error','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','getRealtimeAgents','unknown','pause','*pause','getAgentStatus','isArray','startCase','Queue','map','all','flatten','uniq','getAgentIdsByQueues','busy','resolve','findAll','name','fullname','mailPause','find','getSortedAgentsIdsByStatus','split','fields','includes','globalStatus','order','startsWith','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','DESC','pauseType','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','address','smsPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity'];(function(_0xcfa766,_0x2ab0ae){var _0x4ff08d=function(_0x1376de){while(--_0x1376de){_0xcfa766['push'](_0xcfa766['shift']());}};_0x4ff08d(++_0x2ab0ae);}(_0xd83f,0x132));var _0xfd83=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xd83f[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var jayson=require(_0xfd83('0x0'));var db=require(_0xfd83('0x1'))['db'];var amiClient=jayson[_0xfd83('0x2')][_0xfd83('0x3')]({'port':0x232a});var routingClient=jayson[_0xfd83('0x2')][_0xfd83('0x3')]({'port':0x232c});function isAgentPaused(_0x859497,_0x4b4ad3){var _0x413e00=[_0x859497[_0xfd83('0x4')],_0x859497[_0xfd83('0x5')],_0x859497['mailPause'],_0x859497[_0xfd83('0x6')],_0x859497['smsPause'],_0x859497[_0xfd83('0x7')],_0x859497[_0xfd83('0x8')]];if(!_0x4b4ad3)return _[_0xfd83('0x9')](_0x413e00);var _0x3c6bae=_[_0xfd83('0xa')](_0x413e00);return _0x3c6bae[_0xfd83('0xb')]>0x0&&_0x3c6bae[_0xfd83('0xb')]<_0x413e00['length']?!![]:![];}function isIdle(_0x4edbfc){return _0x4edbfc===_0xfd83('0xc')||_0x4edbfc==='unknown'||_0x4edbfc===_0xfd83('0xd')||_0x4edbfc===_0xfd83('0xe')||_['isNil'](_0x4edbfc);}function isAgentIdle(_0x279192){if(_0x279192[_0xfd83('0xf')]!=='idle'&&_0x279192['voicePause']){_0x279192[_0xfd83('0xf')]='pause';return![];}return _[_0xfd83('0x9')]([_0x279192[_0xfd83('0x10')],_0x279192[_0xfd83('0x11')],_0x279192[_0xfd83('0x12')],_0x279192[_0xfd83('0x13')],_0x279192[_0xfd83('0x14')],_0x279192[_0xfd83('0xf')],_0x279192[_0xfd83('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xfd83('0x16')](_0xfd83('0x17'),{})['then'](function(_0x5b5f8c){if(_0x5b5f8c[_0xfd83('0x18')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x5f29e2=_0x5b5f8c['result'];return routingClient['request'](_0xfd83('0x17'),{})[_0xfd83('0x19')](function(_0x1b041b){if(_0x1b041b['error']){throw new Error(_0xfd83('0x1a'));}var _0x239c9e=_0x1b041b[_0xfd83('0x1b')];return _[_0xfd83('0x1c')]({},_0x5f29e2,_0x239c9e);});})[_0xfd83('0x1d')](function(_0x496612){throw _0x496612;});}exports[_0xfd83('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x4ef4e6){var _0x66ec63=_0xfd83('0x1f');if(isAgentPaused(_0x4ef4e6))_0x66ec63=_0xfd83('0x20');else if(isAgentPaused(_0x4ef4e6,!![]))_0x66ec63=_0xfd83('0x21');else if(isAgentIdle(_0x4ef4e6))_0x66ec63=_0xfd83('0xc');else _0x66ec63='busy';return _0x66ec63;}exports[_0xfd83('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x50441c,_0x2bc002){var _0x232045=_[_0xfd83('0x23')](_0x50441c)?_0x50441c:[_0x50441c];var _0x5d597e=_[_0xfd83('0x24')](_0x2bc002)+_0xfd83('0x25');var _0x467cbf=_[_0xfd83('0x26')](_0x232045,function(_0x4e8420){return db[_0x5d597e]['findOne']({'where':{'id':_0x4e8420}})[_0xfd83('0x19')](function(_0x55002a){if(!_0x55002a)return[];return _0x55002a['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xfd83('0x27')](_0x467cbf)['then'](function(_0x34cd1e){var _0x23791d=_(_0x34cd1e)[_0xfd83('0x28')]()[_0xfd83('0x26')]('id')[_0xfd83('0x29')]()['value']();return _0x23791d;});}exports[_0xfd83('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x2fe3b0,_0x1d9114,_0x11e994){try{if(_0x1d9114[_0xfd83('0xb')]>0x0){_0x2fe3b0=_0x2fe3b0['filter'](function(_0x2ade7c){return _0x1d9114['includes'](_0x2ade7c['id']);});}var _0x5d916b=_0x2fe3b0[_0xfd83('0xa')](function(_0x3052cc){var _0x451a80=_0xfd83('0x2b');if(isAgentIdle(_0x3052cc)){_0x451a80='idle';}return _0x451a80===_0x11e994;});return _[_0xfd83('0x26')](_0x5d916b,'id');}catch(_0x19b816){throw _0x19b816;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x41615b,_0x4606a7,_0x589218){return Promise[_0xfd83('0x2c')]()[_0xfd83('0x19')](function(){if(_0x4606a7[_0xfd83('0xb')]>0x0){_0x41615b=_0x41615b[_0xfd83('0xa')](function(_0x15b34c){return _0x4606a7['includes'](_0x15b34c['id']);});}return _0x41615b;})[_0xfd83('0x19')](function(){return db['User'][_0xfd83('0x2d')]({'attributes':['id',_0xfd83('0x2e'),_0xfd83('0x2f'),_0xfd83('0x4'),_0xfd83('0x5'),_0xfd83('0x30'),'openchannelPause','smsPause','voicePause','whatsappPause','pauseType'],'where':{'id':{'$in':_['map'](_0x41615b,'id')}},'raw':!![]});})[_0xfd83('0x19')](function(_0x2e6929){return _0x2e6929[_0xfd83('0x26')](function(_0x25dead){var _0x184855=_[_0xfd83('0x31')](_0x41615b,['id',_0x25dead['id']]);var _0x217807=filterAgentAttributes(_0x184855);_[_0xfd83('0x1c')](_0x25dead,_0x217807);_0x25dead['globalStatus']=getAgentStatus(_0x25dead);return _0x25dead;});})['then'](function(_0x111d22){var _0x405862=sortAgentsByStatus(_0x111d22,_0x589218);return _['map'](_0x405862,'id');})[_0xfd83('0x1d')](function(_0x3ce272){throw _0x3ce272;});}exports[_0xfd83('0x32')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x4c59fc){var _0x2c2532={'fields':[],'order':null};var _0x3bc97b=_0x4c59fc[_0xfd83('0x33')](',');_0x2c2532[_0xfd83('0x34')]=_[_0xfd83('0xa')](_0x3bc97b,function(_0x58e29e){if(!_0x58e29e[_0xfd83('0x35')](_0xfd83('0x36'))){return!![];}_0x2c2532[_0xfd83('0x37')]=_[_0xfd83('0x38')](_0x58e29e,'-')?'DESC':_0xfd83('0x39');return![];});return _0x2c2532;}exports[_0xfd83('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0xf7af67){if(_0xf7af67[_0xfd83('0x35')]('fullname')&&!_0xf7af67['includes'](_0xfd83('0x3b'))){var _0x48b6c4=_0xf7af67[_0xfd83('0x3c')](0x0,_0xf7af67[_0xfd83('0x3d')](_0xfd83('0x2f')));_0xf7af67+=','+_0x48b6c4+_0xfd83('0x3b');}return _0xf7af67;}exports[_0xfd83('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x41611b,_0x767f5c){var _0x25550a=_0x41611b[_0xfd83('0x3f')](function(_0x5cff9a,_0x3dea87){if(_0x5cff9a[_0xfd83('0x36')]===_0x3dea87[_0xfd83('0x36')]){if(_0x5cff9a[_0xfd83('0x36')]===_0xfd83('0x20')){if(_0x767f5c===_0xfd83('0x40')){return(_0x5cff9a[_0xfd83('0x41')]||'')<(_0x3dea87['pauseType']||'')||_0x5cff9a[_0xfd83('0x2f')][_0xfd83('0x42')]()>_0x3dea87['fullname'][_0xfd83('0x42')]()?0x1:-0x1;}else{return(_0x5cff9a[_0xfd83('0x41')]||'')<(_0x3dea87[_0xfd83('0x41')]||'')||_0x5cff9a[_0xfd83('0x2f')][_0xfd83('0x42')]()>_0x3dea87['fullname'][_0xfd83('0x42')]()?-0x1:0x1;}}else{if(_0x767f5c===_0xfd83('0x40')){return _0x5cff9a[_0xfd83('0x2f')][_0xfd83('0x42')]()<_0x3dea87['fullname']['toLowerCase']()?0x1:-0x1;}else{return _0x5cff9a[_0xfd83('0x2f')]['toLowerCase']()<_0x3dea87['fullname'][_0xfd83('0x42')]()?-0x1:0x1;}}}else{if(_0x767f5c===_0xfd83('0x40')){return _0x5cff9a['globalStatus']<_0x3dea87['globalStatus']?0x1:-0x1;}else{return _0x5cff9a[_0xfd83('0x36')]<_0x3dea87['globalStatus']?-0x1:0x1;}}});return _0x25550a;}exports[_0xfd83('0x43')]=sortAgentsByStatus;function filterAgentAttributes(_0x7c3c9f){var _0x5ddb72=['userpic',_0xfd83('0x44'),_0xfd83('0x45'),'lastPauseAt','pauseType',_0xfd83('0x46'),_0xfd83('0x3b'),_0xfd83('0x47'),_0xfd83('0x4'),_0xfd83('0x6'),_0xfd83('0x30'),_0xfd83('0x48'),_0xfd83('0x8'),_0xfd83('0x5'),_0xfd83('0x7'),_0xfd83('0x49'),_0xfd83('0x4a'),_0xfd83('0x4b'),_0xfd83('0x4c'),'whatsappCapacity','faxCapacity','chatCurrentCapacity',_0xfd83('0x4d'),_0xfd83('0x4e'),_0xfd83('0x4f'),_0xfd83('0x50'),_0xfd83('0x51'),_0xfd83('0x10'),_0xfd83('0x13'),_0xfd83('0x12'),_0xfd83('0x14'),_0xfd83('0x15'),_0xfd83('0x11'),_0xfd83('0xf'),_0xfd83('0x52'),_0xfd83('0x53'),_0xfd83('0x54'),_0xfd83('0x55'),_0xfd83('0x56'),_0xfd83('0x57'),_0xfd83('0x58'),'queue',_0xfd83('0x59'),_0xfd83('0x5a'),_0xfd83('0x5b'),_0xfd83('0x5c'),'routealias'];var _0x5a32e4=['chatPause','openchannelPause','mailPause','smsPause',_0xfd83('0x8'),_0xfd83('0x5'),'voicePause',_0xfd83('0x44')];var _0x5dc7ac=_(_0x7c3c9f)[_0xfd83('0x5d')](_0x5a32e4)[_0xfd83('0x5e')](_0x5ddb72)[_0xfd83('0x5f')]();return _0x5dc7ac;}exports[_0xfd83('0x60')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 219dd35..ff05a75 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x4934e3,_0x124098){var _0x86a0c3=function(_0x59da73){while(--_0x59da73){_0x4934e3['push'](_0x4934e3['shift']());}};_0x86a0c3(++_0x124098);}(_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 +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(_0x479774,_0x393894){var _0x5f4e5c=function(_0x59f7d2){while(--_0x59f7d2){_0x479774['push'](_0x479774['shift']());}};_0x5f4e5c(++_0x393894);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 243c77d..16fdbe0 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 _0x1819=['macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','cpus','map','model','join','createHash','md5','update','digest','hex','licenseToken','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname'];(function(_0x1b1893,_0x302ce3){var _0x59150e=function(_0x154cc3){while(--_0x154cc3){_0x1b1893['push'](_0x1b1893['shift']());}};_0x59150e(++_0x302ce3);}(_0x1819,0x1b0));var _0x9181=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x1819[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0x9181('0x0'));var os=require('os');var crypto=require(_0x9181('0x1'));var machine=require(_0x9181('0x2'));var exec=require(_0x9181('0x3'))[_0x9181('0x4')];var config=require('../environment');function getInterfaces(){var _0x11218c=[];var _0x488486=os[_0x9181('0x5')]();var _0x330c2e=_[_0x9181('0x6')](_[_0x9181('0x7')](_0x488486));for(var _0x3304cb=0x0;_0x3304cb<_0x330c2e['length'];_0x3304cb++){var _0x3efd0a=_0x488486[_0x330c2e[_0x3304cb]][_0x9181('0x8')](function(_0x2c9ec5){return _0x2c9ec5[_0x9181('0x9')]==='IPv4'&&_0x2c9ec5[_0x9181('0xa')]===![];});_0x11218c=_0x11218c[_0x9181('0xb')](_0x3efd0a);}return _0x11218c;}function getFirstInterface(){var _0x5ecad9=_[_0x9181('0xc')](getInterfaces());return{'macAddress':_0x5ecad9&&_0x5ecad9[_0x9181('0xd')]?_0x5ecad9[_0x9181('0xd')]:_0x9181('0xe'),'ipAddress':_0x5ecad9&&_0x5ecad9[_0x9181('0xf')]?_0x5ecad9[_0x9181('0xf')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x29a279=_['orderBy'](os[_0x9181('0x10')]()[_0x9181('0x11')](function(_0x354892){return _0x354892[_0x9181('0x12')];}))[_0x9181('0x13')](':');return crypto[_0x9181('0x14')](_0x9181('0x15'))[_0x9181('0x16')](_0x29a279)[_0x9181('0x17')](_0x9181('0x18'));}exports['getUuid']=function(){var _0x2efa70=os['platform']();var _0x29d772=/[0-9a-f-]{36}/;if(config[_0x9181('0x19')]&&_0x29d772['test'](config[_0x9181('0x19')])){return config['licenseToken'];}else if(_0x2efa70==='win32'){return exec(_0x9181('0x1a'),{'encoding':_0x9181('0x1b')})[_0x9181('0x1c')]('\x0d\x0a','');}else{var _0x50546e=getFirstInterface();var _0x50939f=getCPUhash();var _0x53a6d0=_0x50939f+'|'+os[_0x9181('0x1d')]()+'|'+_0x50546e[_0x9181('0x1e')]+'|'+_0x50546e[_0x9181('0x1f')];var _0x48c869=crypto[_0x9181('0x14')](_0x9181('0x15'))[_0x9181('0x16')](_0x53a6d0)[_0x9181('0x17')](_0x9181('0x18'));return _0x48c869[_0x9181('0x20')](0x0,0x8)+'-'+_0x48c869[_0x9181('0x20')](0x8,0xc)+'-'+_0x48c869[_0x9181('0x20')](0xc,0x10)+'-'+_0x48c869[_0x9181('0x20')](0x10,0x14)+'-'+_0x48c869[_0x9181('0x20')](0x14);}}; \ No newline at end of file +var _0x9fc6=['length','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','127.0.0.1','model','join','createHash','md5','digest','hex','getUuid','licenseToken','test','win32','utf8','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy'];(function(_0x480c90,_0x11d6fc){var _0x5b8f88=function(_0x33c810){while(--_0x33c810){_0x480c90['push'](_0x480c90['shift']());}};_0x5b8f88(++_0x11d6fc);}(_0x9fc6,0x112));var _0x69fc=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x9fc6[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x69fc('0x0'));var os=require('os');var crypto=require(_0x69fc('0x1'));var machine=require(_0x69fc('0x2'));var exec=require(_0x69fc('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x4e2ebb=[];var _0x221874=os[_0x69fc('0x4')]();var _0x48fa4d=_[_0x69fc('0x5')](_['keys'](_0x221874));for(var _0xfd9ef0=0x0;_0xfd9ef0<_0x48fa4d[_0x69fc('0x6')];_0xfd9ef0++){var _0x1b0141=_0x221874[_0x48fa4d[_0xfd9ef0]]['filter'](function(_0x125721){return _0x125721[_0x69fc('0x7')]===_0x69fc('0x8')&&_0x125721[_0x69fc('0x9')]===![];});_0x4e2ebb=_0x4e2ebb[_0x69fc('0xa')](_0x1b0141);}return _0x4e2ebb;}function getFirstInterface(){var _0x318815=_[_0x69fc('0xb')](getInterfaces());return{'macAddress':_0x318815&&_0x318815[_0x69fc('0xc')]?_0x318815[_0x69fc('0xc')]:_0x69fc('0xd'),'ipAddress':_0x318815&&_0x318815['address']?_0x318815['address']:_0x69fc('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x126aae=_[_0x69fc('0x5')](os['cpus']()['map'](function(_0x393ef7){return _0x393ef7[_0x69fc('0xf')];}))[_0x69fc('0x10')](':');return crypto[_0x69fc('0x11')](_0x69fc('0x12'))['update'](_0x126aae)[_0x69fc('0x13')](_0x69fc('0x14'));}exports[_0x69fc('0x15')]=function(){var _0x530242=os['platform']();var _0x53b905=/[0-9a-f-]{36}/;if(config[_0x69fc('0x16')]&&_0x53b905[_0x69fc('0x17')](config[_0x69fc('0x16')])){return config['licenseToken'];}else if(_0x530242===_0x69fc('0x18')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x69fc('0x19')})['replace']('\x0d\x0a','');}else{var _0x3f35af=getFirstInterface();var _0x369e81=getCPUhash();var _0x19dd48=_0x369e81+'|'+os['hostname']()+'|'+_0x3f35af['macAddress']+'|'+_0x3f35af['ipAddress'];var _0xfd294f=crypto[_0x69fc('0x11')]('md5')[_0x69fc('0x1a')](_0x19dd48)[_0x69fc('0x13')]('hex');return _0xfd294f['substring'](0x0,0x8)+'-'+_0xfd294f[_0x69fc('0x1b')](0x8,0xc)+'-'+_0xfd294f[_0x69fc('0x1b')](0xc,0x10)+'-'+_0xfd294f['substring'](0x10,0x14)+'-'+_0xfd294f['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 6a99a32..b672000 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 _0xf7b7=['format','exports','then','catch','data1','active','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Changed','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','util','moment','bluebird','version','../../components/encryptor','./hardware','license','https://www.xcallymotion.com'];(function(_0x119139,_0x41fd2d){var _0x4ec24c=function(_0x4bb2e9){while(--_0x4bb2e9){_0x119139['push'](_0x119139['shift']());}};_0x4ec24c(++_0x41fd2d);}(_0xf7b7,0x80));var _0x7f7b=function(_0x50f657,_0x4db384){_0x50f657=_0x50f657-0x0;var _0x51db4a=_0xf7b7[_0x50f657];return _0x51db4a;};'use strict';var util=require(_0x7f7b('0x0'));var moment=require(_0x7f7b('0x1'));var rp=require('request-promise');var BPromise=require(_0x7f7b('0x2'));var pkginfo=require('pkginfo')(module,_0x7f7b('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x7f7b('0x4'));var hardware=require(_0x7f7b('0x5'));var logger=require('../logger')(_0x7f7b('0x6'));var HOST=_0x7f7b('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4b8f6a){return new BPromise(function(_0x49c225,_0x1ba6c1){var _0x44de09=util[_0x7f7b('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x4b8f6a,module['exports'][_0x7f7b('0x3')]);if(oldToken){_0x44de09=util[_0x7f7b('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4b8f6a,module[_0x7f7b('0x9')][_0x7f7b('0x3')],oldToken);}var _0x28f5d6={'uri':_0x44de09,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x28f5d6)[_0x7f7b('0xa')](function(_0x4144c8){_0x49c225(_0x4144c8);})[_0x7f7b('0xb')](function(_0x8970b0){_0x1ba6c1(_0x8970b0);});});}function manageLicense(_0x42e8ab,_0x139d47){var _0x2ea5bf=_0x139d47['get']({'plain':!![]});if(!isOldTokenSent&&_0x2ea5bf[_0x7f7b('0xc')]!==_0x42e8ab&&!_0x2ea5bf['data2']){oldToken=_0x2ea5bf['data1'];}httpRequest(_0x42e8ab)[_0x7f7b('0xa')](function(_0x1f6176){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1f6176[_0x7f7b('0xd')]){isOldTokenSent=![];if(!_0x2ea5bf[_0x7f7b('0x6')]&&_0x2ea5bf[_0x7f7b('0x6')]!=_0x1f6176[_0x7f7b('0x6')]||_0x2ea5bf[_0x7f7b('0x6')]&&_0x2ea5bf[_0x7f7b('0xe')]){logger['info'](_0x7f7b('0xf'));}if(_0x2ea5bf[_0x7f7b('0x6')]&&!_0x2ea5bf[_0x7f7b('0xe')]&&_0x2ea5bf[_0x7f7b('0x6')]!=_0x1f6176['license']){logger[_0x7f7b('0x10')](_0x7f7b('0x11'));}if(_0x2ea5bf[_0x7f7b('0x6')]&&!_0x2ea5bf[_0x7f7b('0xe')]&&_0x2ea5bf[_0x7f7b('0x6')]==_0x1f6176[_0x7f7b('0x6')]){return _0x139d47;}return _0x139d47[_0x7f7b('0x12')]({'data1':_0x42e8ab,'data2':null,'license':_0x1f6176[_0x7f7b('0x6')]});}else{if(_0x1f6176['license']||_0x2ea5bf['license']){if(!_0x2ea5bf[_0x7f7b('0xe')]){if(_0x2ea5bf['data1']==_0x42e8ab){GRAY_PERIOD_REASON='Disabled';logger[_0x7f7b('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x7f7b('0x13');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2ea5bf[_0x7f7b('0xc')],_0x42e8ab);}logger[_0x7f7b('0x10')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x7f7b('0x14')](),moment()[_0x7f7b('0x8')](_0x7f7b('0x15')));return _0x139d47[_0x7f7b('0x12')]({'data2':encryptor[_0x7f7b('0x16')](moment()[_0x7f7b('0x8')](_0x7f7b('0x15')))});}else{if(moment()[_0x7f7b('0x17')](encryptor[_0x7f7b('0x18')](_0x2ea5bf[_0x7f7b('0xe')]),_0x7f7b('0x19'))>DAYS){logger[_0x7f7b('0x10')](_0x7f7b('0x1a'),moment()['format'](_0x7f7b('0x15')));isOldTokenSent=![];return _0x139d47[_0x7f7b('0x12')]({'data1':_0x42e8ab,'data2':null,'license':null});}}}else{if(_0x2ea5bf['data1']!=_0x42e8ab){logger[_0x7f7b('0x10')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2ea5bf[_0x7f7b('0xc')],_0x42e8ab);return _0x139d47[_0x7f7b('0x12')]({'data1':_0x42e8ab,'data2':null,'license':null});}}}return _0x139d47;})[_0x7f7b('0xa')](function(_0xf66a21){_0x139d47=_0xf66a21;})[_0x7f7b('0xb')](function(_0x4a1ee9){logger[_0x7f7b('0x1b')](_0x4a1ee9[_0x7f7b('0x1c')]);})[_0x7f7b('0x1d')](function(){setTimeout(function(){manageLicense(hardware[_0x7f7b('0x1e')](),_0x139d47);},TIME);});}function defaultLicense(){var _0x29e957=hardware[_0x7f7b('0x1e')]();if(_0x29e957){return db[_0x7f7b('0x1f')][_0x7f7b('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x29e957}})[_0x7f7b('0x21')](function(_0x38cb1a,_0x27efd2){logger[_0x7f7b('0x10')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x29e957);manageLicense(_0x29e957,_0x38cb1a);})[_0x7f7b('0xb')](function(_0x41984f){logger[_0x7f7b('0x1b')](_0x41984f[_0x7f7b('0x1c')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x2680=['Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED'];(function(_0x543182,_0x1383ea){var _0x5ecabc=function(_0x2c38ea){while(--_0x2c38ea){_0x543182['push'](_0x543182['shift']());}};_0x5ecabc(++_0x1383ea);}(_0x2680,0x121));var _0x0268=function(_0x4e7bac,_0x1a9f82){_0x4e7bac=_0x4e7bac-0x0;var _0x51e19f=_0x2680[_0x4e7bac];return _0x51e19f;};'use strict';var util=require(_0x0268('0x0'));var moment=require(_0x0268('0x1'));var rp=require(_0x0268('0x2'));var BPromise=require(_0x0268('0x3'));var pkginfo=require(_0x0268('0x4'))(module,_0x0268('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x0268('0x6'));var hardware=require(_0x0268('0x7'));var logger=require(_0x0268('0x8'))(_0x0268('0x9'));var HOST=_0x0268('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2a80e2){return new BPromise(function(_0xee4214,_0x4807b4){var _0x1faa13=util[_0x0268('0xb')](_0x0268('0xc'),HOST,_0x2a80e2,module[_0x0268('0xd')]['version']);if(oldToken){_0x1faa13=util[_0x0268('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x2a80e2,module[_0x0268('0xd')][_0x0268('0x5')],oldToken);}var _0x5bb398={'uri':_0x1faa13,'method':_0x0268('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x5bb398)[_0x0268('0xf')](function(_0x38d571){_0xee4214(_0x38d571);})[_0x0268('0x10')](function(_0x187cac){_0x4807b4(_0x187cac);});});}function manageLicense(_0x371811,_0x5eee2a){var _0x1d6746=_0x5eee2a[_0x0268('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x1d6746[_0x0268('0x12')]!==_0x371811&&!_0x1d6746[_0x0268('0x13')]){oldToken=_0x1d6746[_0x0268('0x12')];}httpRequest(_0x371811)[_0x0268('0xf')](function(_0x1a689e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1a689e[_0x0268('0x14')]){isOldTokenSent=![];if(!_0x1d6746[_0x0268('0x9')]&&_0x1d6746[_0x0268('0x9')]!=_0x1a689e[_0x0268('0x9')]||_0x1d6746[_0x0268('0x9')]&&_0x1d6746[_0x0268('0x13')]){logger[_0x0268('0x15')](_0x0268('0x16'));}if(_0x1d6746['license']&&!_0x1d6746[_0x0268('0x13')]&&_0x1d6746[_0x0268('0x9')]!=_0x1a689e[_0x0268('0x9')]){logger[_0x0268('0x15')](_0x0268('0x17'));}if(_0x1d6746[_0x0268('0x9')]&&!_0x1d6746[_0x0268('0x13')]&&_0x1d6746[_0x0268('0x9')]==_0x1a689e[_0x0268('0x9')]){return _0x5eee2a;}return _0x5eee2a[_0x0268('0x18')]({'data1':_0x371811,'data2':null,'license':_0x1a689e[_0x0268('0x9')]});}else{if(_0x1a689e[_0x0268('0x9')]||_0x1d6746[_0x0268('0x9')]){if(!_0x1d6746[_0x0268('0x13')]){if(_0x1d6746[_0x0268('0x12')]==_0x371811){GRAY_PERIOD_REASON='Disabled';logger[_0x0268('0x15')](_0x0268('0x19'));}else{GRAY_PERIOD_REASON=_0x0268('0x1a');logger[_0x0268('0x15')](_0x0268('0x1b'),_0x1d6746[_0x0268('0x12')],_0x371811);}logger[_0x0268('0x15')](_0x0268('0x1c'),GRAY_PERIOD_REASON[_0x0268('0x1d')](),moment()[_0x0268('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x5eee2a[_0x0268('0x18')]({'data2':encryptor[_0x0268('0x1e')](moment()['format'](_0x0268('0x1f')))});}else{if(moment()[_0x0268('0x20')](encryptor[_0x0268('0x21')](_0x1d6746[_0x0268('0x13')]),_0x0268('0x22'))>DAYS){logger[_0x0268('0x15')](_0x0268('0x23'),moment()[_0x0268('0xb')](_0x0268('0x1f')));isOldTokenSent=![];return _0x5eee2a[_0x0268('0x18')]({'data1':_0x371811,'data2':null,'license':null});}}}else{if(_0x1d6746[_0x0268('0x12')]!=_0x371811){logger[_0x0268('0x15')](_0x0268('0x1b'),_0x1d6746[_0x0268('0x12')],_0x371811);return _0x5eee2a[_0x0268('0x18')]({'data1':_0x371811,'data2':null,'license':null});}}}return _0x5eee2a;})[_0x0268('0xf')](function(_0x147faf){_0x5eee2a=_0x147faf;})[_0x0268('0x10')](function(_0x3dbe77){logger[_0x0268('0x24')](_0x3dbe77['message']);})[_0x0268('0x25')](function(){setTimeout(function(){manageLicense(hardware[_0x0268('0x26')](),_0x5eee2a);},TIME);});}function defaultLicense(){var _0x41c449=hardware[_0x0268('0x26')]();if(_0x41c449){return db[_0x0268('0x27')][_0x0268('0x28')]({'where':{'id':0x1},'defaults':{'data1':_0x41c449}})[_0x0268('0x29')](function(_0x4b1be4,_0x3c1ec5){logger[_0x0268('0x15')](_0x0268('0x2a'),_0x41c449);manageLicense(_0x41c449,_0x4b1be4);})[_0x0268('0x10')](function(_0x5cef1a){logger[_0x0268('0x24')](_0x5cef1a[_0x0268('0x2b')]);});}}exports[_0x0268('0x2c')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 88b171f..9cc7f76 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 _0xf583=['changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','users','telephones','forEach','user','catch','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','%s:%s:%s','parse','demo','uuid','machineUuid','getUuid','gray','deadline','add','format'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0xf583,0x1f4));var _0x3f58=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xf583[_0x1992f1];return _0x413dfe;};'use strict';var util=require('util');var _=require(_0x3f58('0x0'));var moment=require(_0x3f58('0x1'));var BPromise=require(_0x3f58('0x2'));var hardware=require('./hardware');var encryptor=require(_0x3f58('0x3'));var db=require(_0x3f58('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3f58('0x5'),'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':_0x3f58('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3f58('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x19c9b7){return new BPromise(function(_0x52ff37,_0x3d0ac8){return db[_0x3f58('0x7')][_0x3f58('0x8')](_[_0x3f58('0x9')](_0x19c9b7,{'raw':!![],'where':{'id':0x1}}))[_0x3f58('0xa')](function(_0x42aee3){return checkLicense(_0x42aee3,null);})['then'](function(_0x1e650b){_0x52ff37(_0x1e650b);return;})['catch'](function(_0x229dd6){_0x3d0ac8(_0x229dd6);});});}function checkLicense(_0x3460b7,_0x372bfe){if(!_0x3460b7){demoLicense['uuid']=_0x3460b7[_0x3f58('0xb')];return demoLicense;}try{var _0x210ce9=_0x372bfe||_0x3460b7[_0x3f58('0xc')];if(_[_0x3f58('0xd')](_0x210ce9)){throw new Error(_0x3f58('0xe'));}var _0xe448bf=_0x3460b7[_0x3f58('0xb')];var _0x312d2a=_0x3460b7[_0x3f58('0xf')];var _0x56dc67=_0xe448bf[_0x3f58('0x10')]('-')[0x4];var _0x106cc3=_0xe448bf['split']('-')[0x0];var _0x25a097=encryptor[_0x3f58('0x11')](_0x210ce9,util['format'](_0x3f58('0x12'),_0x56dc67,_0xe448bf,_0x106cc3));var _0x1042eb=JSON[_0x3f58('0x13')](_0x25a097);_0x1042eb[_0x3f58('0x14')]=![];_0x1042eb[_0x3f58('0x15')]=_0xe448bf;_0x1042eb[_0x3f58('0x16')]=hardware[_0x3f58('0x17')]();if(_0x312d2a){var _0x42c4ad=encryptor[_0x3f58('0x11')](_0x312d2a);_0x1042eb[_0x3f58('0x18')]=_0x42c4ad;_0x1042eb[_0x3f58('0x19')]=moment(_0x42c4ad)[_0x3f58('0x1a')](0x7,'days')[_0x3f58('0x1b')]();_0x1042eb['grayReason']=_0x1042eb[_0x3f58('0x15')]!=_0x1042eb[_0x3f58('0x16')]?_0x3f58('0x1c'):_0x3f58('0x1d');}return _0x1042eb;}catch(_0x33eca2){breakingLicense[_0x3f58('0x15')]=_0x3460b7[_0x3f58('0xb')];breakingLicense[_0x3f58('0x1e')]=_0x33eca2[_0x3f58('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3b687e,_0x2c9859){getLicense()['then'](function(_0x2b3d9e){return db[_0x3f58('0x1f')][_0x3f58('0x20')]({'attributes':[_0x3f58('0x21'),[db[_0x3f58('0x22')]['fn'](_0x3f58('0x23'),db['sequelize'][_0x3f58('0x24')](_0x3f58('0x21'))),_0x3f58('0x25')]],'group':_0x3f58('0x21'),'where':{'role':{'$or':[_0x3f58('0x26'),'user','telephone']}},'raw':!![]})[_0x3f58('0xa')](function(_0x1c7c3a){var _0x2297a8={'user':_0x2b3d9e[_0x3f58('0x27')]||0x0,'telephone':_0x2b3d9e[_0x3f58('0x28')]||0x0};_0x1c7c3a[_0x3f58('0x29')](function(_0x417aaa){var _0x22be48=_0x417aaa[_0x3f58('0x21')]==='admin'?_0x3f58('0x2a'):_0x417aaa['role'];_0x2297a8[_0x22be48]-=_0x417aaa['count'];if(_0x2297a8[_0x22be48]<0x0)_0x2297a8[_0x22be48]=0x0;});_0x3b687e(_0x2297a8);return;});})[_0x3f58('0x2b')](function(_0x1644e8){_0x2c9859(_0x1644e8);});});}function checkUserLimits(_0x5d0299){return new BPromise(function(_0x462c01,_0x4e6896){getLimits()[_0x3f58('0xa')](function(_0x32ddf4){var _0x1d96af=_['pick'](_['countBy'](_0x5d0299,_0x3f58('0x21')),[_0x3f58('0x26'),_0x3f58('0x2a'),_0x3f58('0x2c')]);var _0x39e95b=(_0x1d96af[_0x3f58('0x26')]||0x0)+(_0x1d96af[_0x3f58('0x2a')]||0x0);var _0x381057=_0x1d96af['telephone']||0x0;if(_0x39e95b>_0x32ddf4[_0x3f58('0x2a')])return _0x4e6896(_0x3f58('0x2d'));if(_0x381057>_0x32ddf4[_0x3f58('0x2c')])return _0x4e6896(_0x3f58('0x2e'));return _0x462c01();})['catch'](function(_0xd6f8c){_0x4e6896(_0xd6f8c);});});}module[_0x3f58('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x506d=['License\x20key\x20value\x20not\x20found','split','format','%s:%s:%s','parse','demo','machineUuid','decryptString','add','days','grayReason','changed','disabled','message','User','findAll','sequelize','col','count','role','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','Breaking\x20license','getUuid','License','then','catch','uuid','data1','license'];(function(_0x167092,_0x7e4449){var _0x44c5a8=function(_0x5041fa){while(--_0x5041fa){_0x167092['push'](_0x167092['shift']());}};_0x44c5a8(++_0x7e4449);}(_0x506d,0xd7));var _0xd506=function(_0x766827,_0x2778ce){_0x766827=_0x766827-0x0;var _0x59b0c3=_0x506d[_0x766827];return _0x59b0c3;};'use strict';var util=require(_0xd506('0x0'));var _=require('lodash');var moment=require(_0xd506('0x1'));var BPromise=require(_0xd506('0x2'));var hardware=require(_0xd506('0x3'));var encryptor=require(_0xd506('0x4'));var db=require(_0xd506('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd506('0x6'),'machineUuid':hardware['getUuid'](),'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':_0xd506('0x7'),'machineUuid':hardware[_0xd506('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1de663){return new BPromise(function(_0xf6f3f0,_0x48ca5a){return db[_0xd506('0x9')]['find'](_['defaults'](_0x1de663,{'raw':!![],'where':{'id':0x1}}))[_0xd506('0xa')](function(_0x25b187){return checkLicense(_0x25b187,null);})['then'](function(_0x4df3ef){_0xf6f3f0(_0x4df3ef);return;})[_0xd506('0xb')](function(_0x1844b1){_0x48ca5a(_0x1844b1);});});}function checkLicense(_0x10f287,_0x2da659){if(!_0x10f287){demoLicense[_0xd506('0xc')]=_0x10f287[_0xd506('0xd')];return demoLicense;}try{var _0x5655d9=_0x2da659||_0x10f287[_0xd506('0xe')];if(_['isEmpty'](_0x5655d9)){throw new Error(_0xd506('0xf'));}var _0xcddbb0=_0x10f287[_0xd506('0xd')];var _0x32afd1=_0x10f287['data2'];var _0x4f2a07=_0xcddbb0[_0xd506('0x10')]('-')[0x4];var _0x2dd6f5=_0xcddbb0['split']('-')[0x0];var _0x157d1b=encryptor['decryptString'](_0x5655d9,util[_0xd506('0x11')](_0xd506('0x12'),_0x4f2a07,_0xcddbb0,_0x2dd6f5));var _0x4b2cd8=JSON[_0xd506('0x13')](_0x157d1b);_0x4b2cd8[_0xd506('0x14')]=![];_0x4b2cd8[_0xd506('0xc')]=_0xcddbb0;_0x4b2cd8[_0xd506('0x15')]=hardware[_0xd506('0x8')]();if(_0x32afd1){var _0x366aa0=encryptor[_0xd506('0x16')](_0x32afd1);_0x4b2cd8['gray']=_0x366aa0;_0x4b2cd8['deadline']=moment(_0x366aa0)[_0xd506('0x17')](0x7,_0xd506('0x18'))['format']();_0x4b2cd8[_0xd506('0x19')]=_0x4b2cd8['uuid']!=_0x4b2cd8[_0xd506('0x15')]?_0xd506('0x1a'):_0xd506('0x1b');}return _0x4b2cd8;}catch(_0x5db718){breakingLicense[_0xd506('0xc')]=_0x10f287[_0xd506('0xd')];breakingLicense[_0xd506('0x1c')]=_0x5db718[_0xd506('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x502f94,_0x3cf968){getLicense()['then'](function(_0x3c5410){return db[_0xd506('0x1d')][_0xd506('0x1e')]({'attributes':['role',[db[_0xd506('0x1f')]['fn']('COUNT',db[_0xd506('0x1f')][_0xd506('0x20')]('role')),_0xd506('0x21')]],'group':_0xd506('0x22'),'where':{'role':{'$or':[_0xd506('0x23'),_0xd506('0x24'),_0xd506('0x25')]}},'raw':!![]})[_0xd506('0xa')](function(_0x433231){var _0x360a5a={'user':_0x3c5410[_0xd506('0x26')]||0x0,'telephone':_0x3c5410[_0xd506('0x27')]||0x0};_0x433231[_0xd506('0x28')](function(_0x2843ce){var _0xdee1f2=_0x2843ce[_0xd506('0x22')]===_0xd506('0x23')?_0xd506('0x24'):_0x2843ce[_0xd506('0x22')];_0x360a5a[_0xdee1f2]-=_0x2843ce[_0xd506('0x21')];if(_0x360a5a[_0xdee1f2]<0x0)_0x360a5a[_0xdee1f2]=0x0;});_0x502f94(_0x360a5a);return;});})[_0xd506('0xb')](function(_0x5ebc94){_0x3cf968(_0x5ebc94);});});}function checkUserLimits(_0x2c086e){return new BPromise(function(_0x56d9be,_0x25ce08){getLimits()[_0xd506('0xa')](function(_0x4653f5){var _0x15151d=_[_0xd506('0x29')](_[_0xd506('0x2a')](_0x2c086e,'role'),[_0xd506('0x23'),_0xd506('0x24'),'telephone']);var _0x23f582=(_0x15151d[_0xd506('0x23')]||0x0)+(_0x15151d[_0xd506('0x24')]||0x0);var _0x470cc0=_0x15151d[_0xd506('0x25')]||0x0;if(_0x23f582>_0x4653f5[_0xd506('0x24')])return _0x25ce08(_0xd506('0x2b'));if(_0x470cc0>_0x4653f5[_0xd506('0x25')])return _0x25ce08(_0xd506('0x2c'));return _0x56d9be();})['catch'](function(_0x136a07){_0x25ce08(_0x136a07);});});}module[_0xd506('0x2d')]={'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 3998dd7..ff8b39a 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 _0x02ce=['exports','http://localhost:9000','myappanuglar-secret','secret'];(function(_0x2be9f6,_0x16d6fe){var _0x18e075=function(_0xd9f6f9){while(--_0xd9f6f9){_0x2be9f6['push'](_0x2be9f6['shift']());}};_0x18e075(++_0x16d6fe);}(_0x02ce,0x1ac));var _0xe02c=function(_0x5cf78f,_0x1fc4be){_0x5cf78f=_0x5cf78f-0x0;var _0x2ec92e=_0x02ce[_0x5cf78f];return _0x2ec92e;};'use strict';module[_0xe02c('0x0')]={'DOMAIN':_0xe02c('0x1'),'SESSION_SECRET':_0xe02c('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe02c('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x77e6=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x56a9fc,_0x538b9c){var _0x2f92b5=function(_0x2af730){while(--_0x2af730){_0x56a9fc['push'](_0x56a9fc['shift']());}};_0x2f92b5(++_0x538b9c);}(_0x77e6,0x1a6));var _0x677e=function(_0x8b8670,_0x311f6b){_0x8b8670=_0x8b8670-0x0;var _0x479679=_0x77e6[_0x8b8670];return _0x479679;};'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 diff --git a/server/config/logger.js b/server/config/logger.js index d85465b..d06973a 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73ec=['exports','../utils/loggers','fileLogger'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x73ec,0x1d8));var _0xc73e=function(_0x4d493c,_0x4a8383){_0x4d493c=_0x4d493c-0x0;var _0x356052=_0x73ec[_0x4d493c];return _0x356052;};'use strict';var fileLogger=require(_0xc73e('0x0'))[_0xc73e('0x1')];module[_0xc73e('0x2')]=fileLogger; \ No newline at end of file +var _0xf15d=['exports','../utils/loggers','fileLogger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf15d,0xd6));var _0xdf15=function(_0x300123,_0x34bb90){_0x300123=_0x300123-0x0;var _0x3b7bda=_0xf15d[_0x300123];return _0x3b7bda;};'use strict';var fileLogger=require(_0xdf15('0x0'))[_0xdf15('0x1')];module[_0xdf15('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index d1f3ca8..b09b8d5 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 _0x80ee=['../../services/agi/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','path','express','../../services/express/index.js','ami','join','../../services/ami/index.js','agi'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x80ee,0x67));var _0xe80e=function(_0x571c65,_0x321f37){_0x571c65=_0x571c65-0x0;var _0x563767=_0x80ee[_0x571c65];return _0x563767;};'use strict';var path=require(_0xe80e('0x0'));var os=require('os');var config={'apps':[{'name':_0xe80e('0x1'),'script':path['join'](__dirname,_0xe80e('0x2'))},{'name':_0xe80e('0x3'),'script':path[_0xe80e('0x4')](__dirname,_0xe80e('0x5'))},{'name':_0xe80e('0x6'),'script':path[_0xe80e('0x4')](__dirname,_0xe80e('0x7'))},{'name':'email','script':path[_0xe80e('0x4')](__dirname,'../../services/email/index.js')},{'name':_0xe80e('0x8'),'script':path['join'](__dirname,_0xe80e('0x9'))},{'name':'xdr','script':path[_0xe80e('0x4')](__dirname,_0xe80e('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0xfa44=['ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js'];(function(_0x47a8c0,_0x4d5931){var _0x551fa1=function(_0x45ac5a){while(--_0x45ac5a){_0x47a8c0['push'](_0x47a8c0['shift']());}};_0x551fa1(++_0x4d5931);}(_0xfa44,0xcd));var _0x4fa4=function(_0x4dda69,_0x2a0fe4){_0x4dda69=_0x4dda69-0x0;var _0x9014a9=_0xfa44[_0x4dda69];return _0x9014a9;};'use strict';var path=require(_0x4fa4('0x0'));var os=require('os');var config={'apps':[{'name':_0x4fa4('0x1'),'script':path[_0x4fa4('0x2')](__dirname,_0x4fa4('0x3'))},{'name':_0x4fa4('0x4'),'script':path[_0x4fa4('0x2')](__dirname,_0x4fa4('0x5'))},{'name':_0x4fa4('0x6'),'script':path[_0x4fa4('0x2')](__dirname,_0x4fa4('0x7'))},{'name':'email','script':path['join'](__dirname,'../../services/email/index.js')},{'name':'routing','script':path[_0x4fa4('0x2')](__dirname,_0x4fa4('0x8'))},{'name':'xdr','script':path[_0x4fa4('0x2')](__dirname,_0x4fa4('0x9'))}]};module[_0x4fa4('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 3907875..4e714dd 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 _0xdc18=['list','describe','delete','dump','saved','bluebird','connect','connected','start','then','disconnect','stop','restart'];(function(_0x55c713,_0x297678){var _0x57e162=function(_0x3140c1){while(--_0x3140c1){_0x55c713['push'](_0x55c713['shift']());}};_0x57e162(++_0x297678);}(_0xdc18,0xc8));var _0x8dc1=function(_0x2b7de0,_0x110eb9){_0x2b7de0=_0x2b7de0-0x0;var _0x221eae=_0xdc18[_0x2b7de0];return _0x221eae;};'use strict';var pm2=require('pm2');var BPromise=require(_0x8dc1('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x440b4c,_0x93ab6d){return pm2[_0x8dc1('0x1')](function(_0xcdbd31){if(_0xcdbd31){return _0x93ab6d(_0xcdbd31);}return _0x440b4c(_0x8dc1('0x2'));});});};exports[_0x8dc1('0x3')]=function(_0x38e818){return connect()[_0x8dc1('0x4')](function(){return new BPromise(function(_0x758e62,_0xb35dd2){return pm2['start'](_0x38e818,function(_0x511abe,_0x4e7785){if(_0x511abe){return _0xb35dd2(_0x511abe);}pm2[_0x8dc1('0x5')]();return _0x758e62(_0x4e7785);});});});};exports[_0x8dc1('0x6')]=function(_0x1a791f){return connect()[_0x8dc1('0x4')](function(){return new BPromise(function(_0x1e47b5,_0x59cd32){return pm2[_0x8dc1('0x6')](_0x1a791f,function(_0x501564,_0x830f70){if(_0x501564){return _0x59cd32(_0x501564);}pm2[_0x8dc1('0x5')]();return _0x1e47b5(_0x830f70);});});});};exports[_0x8dc1('0x7')]=function(_0x3eefb6){return connect()[_0x8dc1('0x4')](function(){return new BPromise(function(_0x2c5889,_0x6391cd){return pm2[_0x8dc1('0x7')](_0x3eefb6,function(_0x1a1cab,_0x38c9ae){if(_0x1a1cab){return _0x6391cd(_0x1a1cab);}pm2[_0x8dc1('0x5')]();return _0x2c5889(_0x38c9ae);});});});};exports[_0x8dc1('0x8')]=function(){return connect()[_0x8dc1('0x4')](function(){return new BPromise(function(_0x256e96,_0x338397){return pm2[_0x8dc1('0x8')](function(_0x2742a0,_0x33e6c9){if(_0x2742a0){return _0x338397(_0x2742a0);}pm2['disconnect']();return _0x256e96(_0x33e6c9);});});});};exports[_0x8dc1('0x9')]=function(_0x2a0348){return connect()[_0x8dc1('0x4')](function(){return new BPromise(function(_0x500439,_0x1818ca){return pm2[_0x8dc1('0x9')](_0x2a0348,function(_0x48358d,_0x50f770){if(_0x48358d){return _0x1818ca(_0x48358d);}pm2[_0x8dc1('0x5')]();return _0x500439(_0x50f770);});});});};exports[_0x8dc1('0xa')]=function(_0x3db272){return connect()[_0x8dc1('0x4')](function(){return new BPromise(function(_0x1a9356,_0x31d3e9){return pm2[_0x8dc1('0xa')](_0x3db272,function(_0xd1ae0e,_0x510331){if(_0xd1ae0e){return _0x31d3e9(_0xd1ae0e);}pm2['disconnect']();return _0x1a9356(_0x510331);});});});};exports[_0x8dc1('0xb')]=function(){return connect()[_0x8dc1('0x4')](function(){return new BPromise(function(_0x2c7c84,_0x5f4b57){return pm2[_0x8dc1('0xb')](function(_0x2263cf){if(_0x2263cf){return _0x5f4b57(_0x2263cf);}return _0x2c7c84(_0x8dc1('0xc'));});});});}; \ No newline at end of file +var _0x3018=['list','describe','delete','dump','saved','./config','connect','connected','start','then','disconnect','stop','restart'];(function(_0x19626b,_0x1ae890){var _0x50b38c=function(_0x1f22e7){while(--_0x1f22e7){_0x19626b['push'](_0x19626b['shift']());}};_0x50b38c(++_0x1ae890);}(_0x3018,0x1f3));var _0x8301=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x3018[_0x36eaaa];return _0x461349;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x8301('0x0'));function connect(){return new BPromise(function(_0x2d882e,_0x3834cc){return pm2[_0x8301('0x1')](function(_0x521c72){if(_0x521c72){return _0x3834cc(_0x521c72);}return _0x2d882e(_0x8301('0x2'));});});};exports[_0x8301('0x3')]=function(_0x2dcd3f){return connect()[_0x8301('0x4')](function(){return new BPromise(function(_0x5e6c85,_0x423a88){return pm2[_0x8301('0x3')](_0x2dcd3f,function(_0x26b3e4,_0x3e41ea){if(_0x26b3e4){return _0x423a88(_0x26b3e4);}pm2[_0x8301('0x5')]();return _0x5e6c85(_0x3e41ea);});});});};exports[_0x8301('0x6')]=function(_0x5b8ec1){return connect()[_0x8301('0x4')](function(){return new BPromise(function(_0x377e29,_0x395b43){return pm2[_0x8301('0x6')](_0x5b8ec1,function(_0x5b3579,_0x2bab2e){if(_0x5b3579){return _0x395b43(_0x5b3579);}pm2[_0x8301('0x5')]();return _0x377e29(_0x2bab2e);});});});};exports[_0x8301('0x7')]=function(_0x3a1774){return connect()[_0x8301('0x4')](function(){return new BPromise(function(_0x5b30c9,_0x4fe1ca){return pm2[_0x8301('0x7')](_0x3a1774,function(_0x244183,_0x542435){if(_0x244183){return _0x4fe1ca(_0x244183);}pm2[_0x8301('0x5')]();return _0x5b30c9(_0x542435);});});});};exports[_0x8301('0x8')]=function(){return connect()[_0x8301('0x4')](function(){return new BPromise(function(_0x53313d,_0x1ad74f){return pm2['list'](function(_0x51b566,_0x1e5c5d){if(_0x51b566){return _0x1ad74f(_0x51b566);}pm2[_0x8301('0x5')]();return _0x53313d(_0x1e5c5d);});});});};exports[_0x8301('0x9')]=function(_0x1457ed){return connect()[_0x8301('0x4')](function(){return new BPromise(function(_0x2523a8,_0x3f45a3){return pm2[_0x8301('0x9')](_0x1457ed,function(_0x407b61,_0xb361dd){if(_0x407b61){return _0x3f45a3(_0x407b61);}pm2[_0x8301('0x5')]();return _0x2523a8(_0xb361dd);});});});};exports[_0x8301('0xa')]=function(_0x347e0b){return connect()[_0x8301('0x4')](function(){return new BPromise(function(_0x2e01cf,_0x18054b){return pm2['delete'](_0x347e0b,function(_0x4dbda2,_0x4a0fad){if(_0x4dbda2){return _0x18054b(_0x4dbda2);}pm2[_0x8301('0x5')]();return _0x2e01cf(_0x4a0fad);});});});};exports[_0x8301('0xb')]=function(){return connect()[_0x8301('0x4')](function(){return new BPromise(function(_0xe9eed,_0x393859){return pm2[_0x8301('0xb')](function(_0x565fc6){if(_0x565fc6){return _0x393859(_0x565fc6);}return _0xe9eed(_0x8301('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 035f3a4..ab180c6 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 _0xb475=['lastMsgAt','subtract','minutes','map','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','inspect','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','chatTimeout','then','ChatInteraction'];(function(_0x950d14,_0x178686){var _0x3fb2f1=function(_0x44f3c2){while(--_0x44f3c2){_0x950d14['push'](_0x950d14['shift']());}};_0x3fb2f1(++_0x178686);}(_0xb475,0x1a6));var _0x5b47=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0xb475[_0x2cc0b3];return _0x1667ef;};'use strict';var _=require(_0x5b47('0x0'));var moment=require(_0x5b47('0x1'));var Redis=require(_0x5b47('0x2'));var util=require(_0x5b47('0x3'));var config=require('../../config/environment');var db=require(_0x5b47('0x4'))['db'];var logger=require(_0x5b47('0x5'))(_0x5b47('0x6'));config[_0x5b47('0x7')]=_[_0x5b47('0x8')](config[_0x5b47('0x7')],{'host':_0x5b47('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5b47('0x7')]));function closeInteractions(){var _0x3179b8=0x0;var _0x1f2c24=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0x5b47('0xa')],'where':{'id':0x1}})[_0x5b47('0xb')](function(_0x38bd25){_0x3179b8=_0x38bd25[_0x5b47('0xa')];if(_0x3179b8){return db[_0x5b47('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x5b47('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5b47('0xe')](_0x38bd25['chatTimeout'],_0x5b47('0xf'))}}});}else{return[];}})[_0x5b47('0xb')](function(_0x273397){if(_0x273397&&_0x273397['length']){_0x1f2c24=_[_0x5b47('0x10')](_0x273397||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x1f2c24['join']());return db[_0x5b47('0xc')]['update']({'closeReason':'system','disposition':_0x5b47('0x11'),'closed':!![],'closedAt':moment()[_0x5b47('0x12')](_0x5b47('0x13'))},{'where':{'id':_0x1f2c24}});}})[_0x5b47('0xb')](function(){if(_0x1f2c24&&_0x1f2c24[_0x5b47('0x14')]){logger[_0x5b47('0x15')](_0x5b47('0x16'),_0x1f2c24[_0x5b47('0x17')]());for(var _0x15d2c6=0x0;_0x15d2c6<_0x1f2c24[_0x5b47('0x14')];_0x15d2c6++){io[_0x5b47('0x18')](_0x5b47('0x19'),{'id':_0x1f2c24[_0x15d2c6],'closed':!![]});}}})[_0x5b47('0x1a')](function(_0xab2931){logger[_0x5b47('0x1b')]('[CHAT]\x20Error\x20closing\x20interactions',_0xab2931?util[_0x5b47('0x1c')](_0xab2931,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9692=['[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','redis','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3773dd,_0x2d0048){var _0x212e34=function(_0x3bf8a5){while(--_0x3bf8a5){_0x3773dd['push'](_0x3773dd['shift']());}};_0x212e34(++_0x2d0048);}(_0x9692,0x1e7));var _0x2969=function(_0x23f8fd,_0x246a69){_0x23f8fd=_0x23f8fd-0x0;var _0x2b4499=_0x9692[_0x23f8fd];return _0x2b4499;};'use strict';var _=require(_0x2969('0x0'));var moment=require(_0x2969('0x1'));var Redis=require(_0x2969('0x2'));var util=require(_0x2969('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config[_0x2969('0x4')]=_['defaults'](config[_0x2969('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x2969('0x5'))(new Redis(config['redis']));function closeInteractions(){var _0x5d023c=0x0;var _0x4a4402=[];return db[_0x2969('0x6')]['find']({'raw':!![],'attributes':['id',_0x2969('0x7')],'where':{'id':0x1}})[_0x2969('0x8')](function(_0x1a5dbe){_0x5d023c=_0x1a5dbe[_0x2969('0x7')];if(_0x5d023c){return db[_0x2969('0x9')][_0x2969('0xa')]({'raw':!![],'attributes':['id',_0x2969('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x2969('0xc')](_0x1a5dbe[_0x2969('0x7')],_0x2969('0xd'))}}});}else{return[];}})[_0x2969('0x8')](function(_0x3ad179){if(_0x3ad179&&_0x3ad179[_0x2969('0xe')]){_0x4a4402=_[_0x2969('0xf')](_0x3ad179||[],'id');logger[_0x2969('0x10')](_0x2969('0x11'),_0x4a4402[_0x2969('0x12')]());return db[_0x2969('0x9')][_0x2969('0x13')]({'closeReason':'system','disposition':_0x2969('0x14'),'closed':!![],'closedAt':moment()[_0x2969('0x15')](_0x2969('0x16'))},{'where':{'id':_0x4a4402}});}})[_0x2969('0x8')](function(){if(_0x4a4402&&_0x4a4402[_0x2969('0xe')]){logger[_0x2969('0x10')](_0x2969('0x17'),_0x4a4402[_0x2969('0x12')]());for(var _0x5a2048=0x0;_0x5a2048<_0x4a4402[_0x2969('0xe')];_0x5a2048++){io['emit'](_0x2969('0x18'),{'id':_0x4a4402[_0x5a2048],'closed':!![]});}}})[_0x2969('0x19')](function(_0x2de169){logger[_0x2969('0x1a')](_0x2969('0x1b'),_0x2de169?util[_0x2969('0x1c')](_0x2de169,{'showHidden':![],'depth':null}):'');});}exports[_0x2969('0x1d')]=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 5b42851..2ba2ac1 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 _0x2d41=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x2d41,0xb5));var _0x12d4=function(_0x1792cb,_0x4d6b36){_0x1792cb=_0x1792cb-0x0;var _0x58b978=_0x2d41[_0x1792cb];return _0x58b978;};'use strict';function start(){var _0x2e027c=require(_0x12d4('0x0'));return _0x2e027c[_0x12d4('0x1')]();}module[_0x12d4('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x9c5d=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x39283e,_0x81a14d){var _0x5f2a54=function(_0xf9d19b){while(--_0xf9d19b){_0x39283e['push'](_0x39283e['shift']());}};_0x5f2a54(++_0x81a14d);}(_0x9c5d,0xf3));var _0xd9c5=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0x9c5d[_0x43a6cd];return _0x5acb36;};'use strict';function start(){var _0x4a4a52=require(_0xd9c5('0x0'));return _0x4a4a52[_0xd9c5('0x1')]();}module[_0xd9c5('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 0988f79..945e9a3 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 _0x848c=['stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','active','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','status','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','SendMail','then','error','email\x20sent','catch','error\x20mail','data','subtractNumber\x20null\x20or\x20undefined','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','difference','intersection'];(function(_0x1e9a78,_0x18e01f){var _0x37023a=function(_0x5ee01c){while(--_0x5ee01c){_0x1e9a78['push'](_0x1e9a78['shift']());}};_0x37023a(++_0x18e01f);}(_0x848c,0x110));var _0xc848=function(_0x42897c,_0x4d282f){_0x42897c=_0x42897c-0x0;var _0x1120a3=_0x848c[_0x42897c];return _0x1120a3;};'use strict';var fs=require('fs');var util=require(_0xc848('0x0'));var path=require(_0xc848('0x1'));var _=require(_0xc848('0x2'));var moment=require(_0xc848('0x3'));var CronJobManager=require(_0xc848('0x4'));var jayson=require(_0xc848('0x5'));var BPromise=require(_0xc848('0x6'));var logger=require(_0xc848('0x7'))(_0xc848('0x8'));var db=require(_0xc848('0x9'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xc848('0xa'));var client=jayson[_0xc848('0xb')][_0xc848('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4d5277,_0x199ebd){return function(){logger[_0xc848('0xd')](_0xc848('0xe'),_0x4d5277[_0xc848('0xf')]);var _0x391832=!![];var _0x2d0084=_0x4d5277[_0xc848('0x10')][_0xc848('0x11')]();var _0xd06a4e={'account':_0x2d0084,'message':{'from':util[_0xc848('0x12')](_0xc848('0x13'),_0x4d5277[_0xc848('0x10')][_0xc848('0x14')],_0x4d5277[_0xc848('0x10')][_0xc848('0xf')]||_0x4d5277[_0xc848('0x10')][_0xc848('0x15')][_0xc848('0x16')]),'to':_0x4d5277[_0xc848('0xf')],'cc':_0x4d5277['cc'],'bcc':_0x4d5277['bcc'],'subject':util[_0xc848('0x12')](_0xc848('0x17'),_0x199ebd[_0xc848('0x14')],_0x4d5277[_0xc848('0x18')],_0x4d5277[_0xc848('0x19')])}};var _0x320d79=path[_0xc848('0x1a')](__dirname,_0xc848('0x1b'));var _0x284beb=_0x199ebd[_0xc848('0x1c')];var _0xf42b8b=util[_0xc848('0x12')](_0xc848('0x1d'),path[_0xc848('0x1e')](_0x199ebd[_0xc848('0x1c')],path[_0xc848('0x1f')](_0x199ebd['savename'])),_0xc848('0x20'));var _0x44c064=path[_0xc848('0x1a')](_0x320d79,_0x284beb);var _0xd5dff7=path['join'](_0x320d79,_0xf42b8b);if(fs['existsSync'](_0x44c064)){_0x199ebd[_0xc848('0x21')]='Sent';_0xd06a4e[_0xc848('0x22')]['attachments']=[{'filename':_0x284beb,'path':_0x44c064}];_0xd06a4e[_0xc848('0x22')]['text']=util[_0xc848('0x12')](_0xc848('0x23'),JSON[_0xc848('0x24')](_0x199ebd,null,0x2));}else if(fs['existsSync'](_0xd5dff7)){_0x199ebd[_0xc848('0x21')]=_0xc848('0x25');_0xd06a4e['message'][_0xc848('0x26')]=[{'filename':_0xf42b8b,'path':_0xd5dff7}];}else{_0xd06a4e[_0xc848('0x22')]['text']=_0xc848('0x27');if(!_0x4d5277['sendIfEmpty']){_0x391832=![];logger[_0xc848('0xd')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x391832){return client[_0xc848('0x28')](_0xc848('0x29'),_0xd06a4e)[_0xc848('0x2a')](function(_0x3cc512){if(_0x3cc512[_0xc848('0x2b')]){return logger[_0xc848('0x2b')]('error\x20mail',JSON[_0xc848('0x24')](_0x3cc512));}return logger[_0xc848('0xd')](_0xc848('0x2c'));})[_0xc848('0x2d')](function(_0x5b020f){return logger[_0xc848('0x2b')](_0xc848('0x2e'),JSON[_0xc848('0x24')](_0x5b020f));});}};}function handleError(){return function(_0x369843){return logger[_0xc848('0x2b')](JSON[_0xc848('0x24')](_0x369843));};}function handleResult(_0x47f124){return function(_0x1803db){logger[_0xc848('0xd')](_0xc848('0x2f'),JSON[_0xc848('0x24')](_0x1803db));if(_0x47f124[_0xc848('0x10')]&&_0x47f124['MailAccount'][_0xc848('0x15')]&&!_['isNil'](_0x47f124['email'])){setTimeout(handleSendEmail(_0x47f124,_0x1803db),0x3c*0x3e8);}};}function handleJob(_0x5aa864){return function(){try{if(_['isNil'](_0x5aa864['subtractNumber'])){return logger[_0xc848('0xd')](_0xc848('0x30'));}if(_[_0xc848('0x31')](_0x5aa864[_0xc848('0x19')])){return logger[_0xc848('0xd')](_0xc848('0x32'));}var _0x26622f={'startDate':moment()[_0xc848('0x33')](_0x5aa864[_0xc848('0x18')],_0x5aa864['subtractUnit'])['format'](_0xc848('0x34')),'endDate':moment()[_0xc848('0x12')](_0xc848('0x34')),'type':_0xc848('0x35'),'output':_0x5aa864[_0xc848('0x36')],'name':_0x5aa864[_0xc848('0x14')]};if(!_[_0xc848('0x31')](_0x5aa864[_0xc848('0x37')])){logger[_0xc848('0xd')](_0xc848('0x38'),_0x5aa864[_0xc848('0x37')]);return analyticDefaultReportController[_0xc848('0x39')]({'id':_0x5aa864[_0xc848('0x37')]},_0x26622f)[_0xc848('0x2a')](handleResult(_0x5aa864))['catch'](handleError());}if(!_['isNil'](_0x5aa864['CustomReportId'])){logger[_0xc848('0xd')]('exec\x20custom\x20report\x20id:%s',_0x5aa864[_0xc848('0x3a')]);return analyticCustomReportController[_0xc848('0x39')]({'id':_0x5aa864[_0xc848('0x3a')]},_0x26622f)[_0xc848('0x2a')](handleResult(_0x5aa864))['catch'](handleError());}}catch(_0x5dc036){logger[_0xc848('0x2b')](JSON[_0xc848('0x24')](_0x5dc036));}return logger[_0xc848('0xd')]('no\x20report\x20id');};}function getJobs(_0x124511){var _0x20d03d={};if(_0x124511){_0x20d03d['id']=_0x124511;}return db['Schedule'][_0xc848('0x3b')]({'where':_0x20d03d,'include':[{'model':db[_0xc848('0x10')],'attributes':['id',_0xc848('0x14'),_0xc848('0xf')],'include':[{'model':db[_0xc848('0x3c')],'as':_0xc848('0x15'),'include':[{'model':db[_0xc848('0x3d')],'as':_0xc848('0x3d')}]}]}]})['then'](function(_0x55d0f4){var _0x3b767f=_[_0xc848('0x3e')](manager[_0xc848('0x3f')]);var _0x55f326=_[_0xc848('0x40')](_0x55d0f4,function(_0x13469a){return _0x13469a['id']['toString']();});var _0x45ba1b=_['keyBy'](_0x55d0f4,function(_0xd3b862){return _0xd3b862['id'][_0xc848('0x41')]();});var _0x3c00eb=_0x124511?_0x55f326:_[_0xc848('0x42')](_0x55f326,_0x3b767f);var _0x2f600e=_[_0xc848('0x43')](_0x55f326,_0x3b767f);var _0x126492=_[_0xc848('0x42')](_0x3b767f,_0x55f326);var _0x28852f;var _0x500be3;for(_0x28852f=0x0;_0x28852f<_0x126492['length']&&!_0x124511;_0x28852f+=0x1){_0x500be3=_0x126492[_0x28852f][_0xc848('0x41')]();if(manager['exists'](_0x500be3)){manager[_0xc848('0x44')](_0x500be3);manager[_0xc848('0x45')](_0x500be3);logger['info'](_0xc848('0x46'),_0x500be3);}}logger['info'](_0xc848('0x47'),JSON[_0xc848('0x24')](_0x3c00eb));for(_0x28852f=0x0;_0x28852f<_0x3c00eb['length'];_0x28852f+=0x1){_0x500be3=_0x3c00eb[_0x28852f][_0xc848('0x41')]();logger[_0xc848('0xd')]('index',_0x500be3);if(_0x124511){logger[_0xc848('0xd')](_0xc848('0x48'),_0x124511);logger[_0xc848('0xd')](JSON[_0xc848('0x24')](_0x45ba1b[_0x500be3]));BPromise[_0xc848('0x49')]()[_0xc848('0x2a')](handleJob(_0x45ba1b[_0x500be3]));logger['info']('run\x20job',_0x45ba1b[_0x500be3][_0xc848('0x14')],_0x45ba1b[_0x500be3][_0xc848('0x4a')]);}else if(_0x45ba1b[_0x500be3][_0xc848('0x4a')]&&_0x45ba1b[_0x500be3]['active']&&moment()[_0xc848('0x4b')](_0x45ba1b[_0x500be3][_0xc848('0x4c')],_0x45ba1b[_0x500be3][_0xc848('0x4d')])){manager[_0xc848('0x4e')](_0x500be3,_0x45ba1b[_0x500be3][_0xc848('0x4a')],handleJob(_0x45ba1b[_0x500be3]));manager[_0xc848('0x4f')](_0x500be3);logger['info'](_0xc848('0x50'),_0x45ba1b[_0x500be3][_0xc848('0x14')],_0x45ba1b[_0x500be3][_0xc848('0x4a')]);}else if(manager['exists'](_0x500be3)){manager[_0xc848('0x44')](_0x500be3);manager['deleteJob'](_0x500be3);logger[_0xc848('0xd')](_0xc848('0x51'),_0x45ba1b[_0x500be3][_0xc848('0x14')],_0x45ba1b[_0x500be3][_0xc848('0x4a')]);}}for(_0x28852f=0x0,_0x500be3;_0x28852f<_0x2f600e['length']&&!_0x124511;_0x28852f+=0x1){_0x500be3=_0x2f600e[_0x28852f][_0xc848('0x41')]();if(manager['exists'](_0x500be3)){if(_0x45ba1b[_0x500be3]['cron']&&_0x45ba1b[_0x500be3][_0xc848('0x52')]&&moment()['isBetween'](_0x45ba1b[_0x500be3]['startAt'],_0x45ba1b[_0x500be3][_0xc848('0x4d')])){manager['update'](_0x500be3,_0x45ba1b[_0x500be3][_0xc848('0x4a')],handleJob(_0x45ba1b[_0x500be3]));logger['info'](_0xc848('0x53'),_0x45ba1b[_0x500be3][_0xc848('0x14')],_0x45ba1b[_0x500be3]['cron']);}else{manager[_0xc848('0x44')](_0x500be3);manager[_0xc848('0x45')](_0x500be3);logger[_0xc848('0xd')](_0xc848('0x51'),_0x45ba1b[_0x500be3][_0xc848('0x14')],_0x45ba1b[_0x500be3][_0xc848('0x4a')]);}}}})['catch'](function(_0x18e960){logger['error'](JSON[_0xc848('0x24')](_0x18e960));});}exports[_0xc848('0x54')]=function(_0x1046df){return getJobs(_0x1046df);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x67a5=['exists','stop','delete\x20cron','toRun','length','index','my\x20id','resolve','cron','active','startAt','start','add\x20cron','stop\x20cron','endAt','update','update\x20cron','deleteJob','run','util','path','lodash','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','zip','Sent','message','attachments','text','stringify','existsSync','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','format','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','CloudProvider','jobs','toString','keyBy','difference','intersection'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x67a5,0xb9));var _0x567a=function(_0x1c2ab9,_0x49d1e){_0x1c2ab9=_0x1c2ab9-0x0;var _0x2b94ad=_0x67a5[_0x1c2ab9];return _0x2b94ad;};'use strict';var fs=require('fs');var util=require(_0x567a('0x0'));var path=require(_0x567a('0x1'));var _=require(_0x567a('0x2'));var moment=require(_0x567a('0x3'));var CronJobManager=require(_0x567a('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0x567a('0x5'));var logger=require(_0x567a('0x6'))(_0x567a('0x7'));var db=require(_0x567a('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x567a('0x9'));var client=jayson[_0x567a('0xa')][_0x567a('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x42f721,_0x1d54ca){return function(){logger[_0x567a('0xc')](_0x567a('0xd'),_0x42f721[_0x567a('0xe')]);var _0x30f202=!![];var _0x3af736=_0x42f721[_0x567a('0xf')][_0x567a('0x10')]();var _0x380899={'account':_0x3af736,'message':{'from':util['format'](_0x567a('0x11'),_0x42f721[_0x567a('0xf')][_0x567a('0x12')],_0x42f721[_0x567a('0xf')][_0x567a('0xe')]||_0x42f721[_0x567a('0xf')][_0x567a('0x13')][_0x567a('0x14')]),'to':_0x42f721[_0x567a('0xe')],'cc':_0x42f721['cc'],'bcc':_0x42f721[_0x567a('0x15')],'subject':util['format'](_0x567a('0x16'),_0x1d54ca['name'],_0x42f721[_0x567a('0x17')],_0x42f721[_0x567a('0x18')])}};var _0x246f98=path[_0x567a('0x19')](__dirname,'../../files/reports');var _0x332b47=_0x1d54ca[_0x567a('0x1a')];var _0x2f70af=util['format'](_0x567a('0x1b'),path[_0x567a('0x1c')](_0x1d54ca[_0x567a('0x1a')],path[_0x567a('0x1d')](_0x1d54ca[_0x567a('0x1a')])),_0x567a('0x1e'));var _0x40a296=path[_0x567a('0x19')](_0x246f98,_0x332b47);var _0x367593=path['join'](_0x246f98,_0x2f70af);if(fs['existsSync'](_0x40a296)){_0x1d54ca['status']=_0x567a('0x1f');_0x380899[_0x567a('0x20')][_0x567a('0x21')]=[{'filename':_0x332b47,'path':_0x40a296}];_0x380899[_0x567a('0x20')][_0x567a('0x22')]=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x567a('0x23')](_0x1d54ca,null,0x2));}else if(fs[_0x567a('0x24')](_0x367593)){_0x1d54ca['status']=_0x567a('0x1f');_0x380899['message'][_0x567a('0x21')]=[{'filename':_0x2f70af,'path':_0x367593}];}else{_0x380899[_0x567a('0x20')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x42f721['sendIfEmpty']){_0x30f202=![];logger[_0x567a('0xc')](_0x567a('0x25'));}}if(_0x30f202){return client[_0x567a('0x26')](_0x567a('0x27'),_0x380899)[_0x567a('0x28')](function(_0x1bdadc){if(_0x1bdadc[_0x567a('0x29')]){return logger[_0x567a('0x29')](_0x567a('0x2a'),JSON[_0x567a('0x23')](_0x1bdadc));}return logger[_0x567a('0xc')](_0x567a('0x2b'));})[_0x567a('0x2c')](function(_0x57eaba){return logger[_0x567a('0x29')]('error\x20mail',JSON['stringify'](_0x57eaba));});}};}function handleError(){return function(_0x551021){return logger[_0x567a('0x29')](JSON[_0x567a('0x23')](_0x551021));};}function handleResult(_0x51ba93){return function(_0xab4658){logger[_0x567a('0xc')](_0x567a('0x2d'),JSON['stringify'](_0xab4658));if(_0x51ba93[_0x567a('0xf')]&&_0x51ba93[_0x567a('0xf')][_0x567a('0x13')]&&!_['isNil'](_0x51ba93[_0x567a('0xe')])){setTimeout(handleSendEmail(_0x51ba93,_0xab4658),0x3c*0x3e8);}};}function handleJob(_0xa36ffc){return function(){try{if(_[_0x567a('0x2e')](_0xa36ffc[_0x567a('0x17')])){return logger[_0x567a('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0xa36ffc['subtractUnit'])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x5e11cf={'startDate':moment()['subtract'](_0xa36ffc['subtractNumber'],_0xa36ffc[_0x567a('0x18')])[_0x567a('0x2f')](_0x567a('0x30')),'endDate':moment()['format'](_0x567a('0x30')),'type':_0x567a('0x31'),'output':_0xa36ffc['output'],'name':_0xa36ffc[_0x567a('0x12')]};if(!_[_0x567a('0x2e')](_0xa36ffc[_0x567a('0x32')])){logger['info'](_0x567a('0x33'),_0xa36ffc['DefaultReportId']);return analyticDefaultReportController[_0x567a('0x34')]({'id':_0xa36ffc['DefaultReportId']},_0x5e11cf)['then'](handleResult(_0xa36ffc))[_0x567a('0x2c')](handleError());}if(!_[_0x567a('0x2e')](_0xa36ffc['CustomReportId'])){logger[_0x567a('0xc')](_0x567a('0x35'),_0xa36ffc[_0x567a('0x36')]);return analyticCustomReportController[_0x567a('0x34')]({'id':_0xa36ffc[_0x567a('0x36')]},_0x5e11cf)['then'](handleResult(_0xa36ffc))[_0x567a('0x2c')](handleError());}}catch(_0x5388b0){logger['error'](JSON[_0x567a('0x23')](_0x5388b0));}return logger['info'](_0x567a('0x37'));};}function getJobs(_0xc0645b){var _0x4d3bdf={};if(_0xc0645b){_0x4d3bdf['id']=_0xc0645b;}return db[_0x567a('0x38')][_0x567a('0x39')]({'where':_0x4d3bdf,'include':[{'model':db[_0x567a('0xf')],'attributes':['id',_0x567a('0x12'),_0x567a('0xe')],'include':[{'model':db['MailServerOut'],'as':_0x567a('0x13'),'include':[{'model':db[_0x567a('0x3a')],'as':_0x567a('0x3a')}]}]}]})['then'](function(_0x2de28a){var _0x167ffc=_['keys'](manager[_0x567a('0x3b')]);var _0x44746f=_['map'](_0x2de28a,function(_0x189f8d){return _0x189f8d['id'][_0x567a('0x3c')]();});var _0x27c502=_[_0x567a('0x3d')](_0x2de28a,function(_0x25b825){return _0x25b825['id'][_0x567a('0x3c')]();});var _0x44a9bb=_0xc0645b?_0x44746f:_[_0x567a('0x3e')](_0x44746f,_0x167ffc);var _0x325f83=_[_0x567a('0x3f')](_0x44746f,_0x167ffc);var _0x3c7e19=_[_0x567a('0x3e')](_0x167ffc,_0x44746f);var _0x49fb29;var _0x2b8c3c;for(_0x49fb29=0x0;_0x49fb29<_0x3c7e19['length']&&!_0xc0645b;_0x49fb29+=0x1){_0x2b8c3c=_0x3c7e19[_0x49fb29][_0x567a('0x3c')]();if(manager[_0x567a('0x40')](_0x2b8c3c)){manager[_0x567a('0x41')](_0x2b8c3c);manager['deleteJob'](_0x2b8c3c);logger[_0x567a('0xc')](_0x567a('0x42'),_0x2b8c3c);}}logger[_0x567a('0xc')](_0x567a('0x43'),JSON[_0x567a('0x23')](_0x44a9bb));for(_0x49fb29=0x0;_0x49fb29<_0x44a9bb[_0x567a('0x44')];_0x49fb29+=0x1){_0x2b8c3c=_0x44a9bb[_0x49fb29][_0x567a('0x3c')]();logger[_0x567a('0xc')](_0x567a('0x45'),_0x2b8c3c);if(_0xc0645b){logger[_0x567a('0xc')](_0x567a('0x46'),_0xc0645b);logger[_0x567a('0xc')](JSON['stringify'](_0x27c502[_0x2b8c3c]));BPromise[_0x567a('0x47')]()[_0x567a('0x28')](handleJob(_0x27c502[_0x2b8c3c]));logger[_0x567a('0xc')]('run\x20job',_0x27c502[_0x2b8c3c][_0x567a('0x12')],_0x27c502[_0x2b8c3c][_0x567a('0x48')]);}else if(_0x27c502[_0x2b8c3c][_0x567a('0x48')]&&_0x27c502[_0x2b8c3c][_0x567a('0x49')]&&moment()['isBetween'](_0x27c502[_0x2b8c3c][_0x567a('0x4a')],_0x27c502[_0x2b8c3c]['endAt'])){manager['add'](_0x2b8c3c,_0x27c502[_0x2b8c3c][_0x567a('0x48')],handleJob(_0x27c502[_0x2b8c3c]));manager[_0x567a('0x4b')](_0x2b8c3c);logger['info'](_0x567a('0x4c'),_0x27c502[_0x2b8c3c][_0x567a('0x12')],_0x27c502[_0x2b8c3c][_0x567a('0x48')]);}else if(manager[_0x567a('0x40')](_0x2b8c3c)){manager['stop'](_0x2b8c3c);manager['deleteJob'](_0x2b8c3c);logger['info'](_0x567a('0x4d'),_0x27c502[_0x2b8c3c]['name'],_0x27c502[_0x2b8c3c][_0x567a('0x48')]);}}for(_0x49fb29=0x0,_0x2b8c3c;_0x49fb29<_0x325f83['length']&&!_0xc0645b;_0x49fb29+=0x1){_0x2b8c3c=_0x325f83[_0x49fb29][_0x567a('0x3c')]();if(manager[_0x567a('0x40')](_0x2b8c3c)){if(_0x27c502[_0x2b8c3c][_0x567a('0x48')]&&_0x27c502[_0x2b8c3c][_0x567a('0x49')]&&moment()['isBetween'](_0x27c502[_0x2b8c3c][_0x567a('0x4a')],_0x27c502[_0x2b8c3c][_0x567a('0x4e')])){manager[_0x567a('0x4f')](_0x2b8c3c,_0x27c502[_0x2b8c3c][_0x567a('0x48')],handleJob(_0x27c502[_0x2b8c3c]));logger['info'](_0x567a('0x50'),_0x27c502[_0x2b8c3c][_0x567a('0x12')],_0x27c502[_0x2b8c3c][_0x567a('0x48')]);}else{manager['stop'](_0x2b8c3c);manager[_0x567a('0x51')](_0x2b8c3c);logger['info'](_0x567a('0x4d'),_0x27c502[_0x2b8c3c][_0x567a('0x12')],_0x27c502[_0x2b8c3c][_0x567a('0x48')]);}}}})[_0x567a('0x2c')](function(_0x13cb7b){logger[_0x567a('0x29')](JSON['stringify'](_0x13cb7b));});}exports[_0x567a('0x52')]=function(_0x4d5efe){return getJobs(_0x4d5efe);};exports[_0x567a('0x4b')]=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 90f1329..71e1ba2 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 _0x5c00=['[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','inspect','start','lodash','aws-sdk','request-promise','bluebird','../../config/logger','transcribe','getTranscriptionJob','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured'];(function(_0x309e57,_0xe1c277){var _0x313c98=function(_0x2e6cd6){while(--_0x2e6cd6){_0x309e57['push'](_0x309e57['shift']());}};_0x313c98(++_0xe1c277);}(_0x5c00,0x17e));var _0x05c0=function(_0x13659a,_0x41453c){_0x13659a=_0x13659a-0x0;var _0x4b1c49=_0x5c00[_0x13659a];return _0x4b1c49;};var _=require(_0x05c0('0x0'));var AWS=require(_0x05c0('0x1'));var rp=require(_0x05c0('0x2'));var util=require('util');var BPromise=require(_0x05c0('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x05c0('0x4'))(_0x05c0('0x5'));function getTranscriptionJob(_0x37b644,_0x28d9c7,_0x565efc,_0x145973){return new Promise(function(_0x3521fe,_0x261624){var _0x27dc10=new AWS['TranscribeService']({'accessKeyId':_0x28d9c7,'secretAccessKey':_0x37b644,'region':_0x565efc});_0x27dc10[_0x05c0('0x6')]({'TranscriptionJobName':_0x145973},function(_0x34eb5f,_0x3ad5b7){if(_0x34eb5f){return _0x261624(_0x34eb5f);}else{return _0x3521fe(_0x3ad5b7);}});});}function sentiment(_0x5afd4d,_0x32a795,_0x32cdfa,_0x996d6b,_0x321c09){return new Promise(function(_0x273b2d,_0x1edbb){var _0x5226c5=new AWS['Comprehend']({'accessKeyId':_0x32a795,'secretAccessKey':_0x5afd4d,'region':_0x32cdfa});_0x5226c5[_0x05c0('0x7')]({'Text':_0x996d6b,'LanguageCode':_0x321c09['substring'](0x0,0x2)},function(_0x205cec,_0x11cf03){if(_0x205cec){return _0x1edbb(_0x205cec);}else{return _0x273b2d(_0x11cf03);}});});}function checkTranscribeJob(_0xa50678,_0x5a3e65,_0x4e39d4){var _0x5eec41;return new BPromise(function(_0x16a290,_0x49e07e){logger[_0x05c0('0x8')](util[_0x05c0('0x9')](_0x05c0('0xa'),_0xa50678['id'],_0xa50678[_0x05c0('0xb')]));return getTranscriptionJob(_0x4e39d4[_0x05c0('0xc')],_0x4e39d4[_0x05c0('0xd')],_0x5a3e65['transcribeRegion'],_0xa50678[_0x05c0('0xb')])[_0x05c0('0xe')](function(_0x4bb164){logger[_0x05c0('0x8')](util[_0x05c0('0x9')](_0x05c0('0xf'),_0xa50678['id'],_0xa50678[_0x05c0('0xb')],_0x4bb164[_0x05c0('0x10')][_0x05c0('0x11')]));if(!_0xa50678['fileText']){switch(_0x4bb164[_0x05c0('0x10')][_0x05c0('0x11')]){case _0x05c0('0x12'):var _0x54fef0={'transcribeStatus':_0x4bb164[_0x05c0('0x10')][_0x05c0('0x11')],'fileUri':_0x4bb164[_0x05c0('0x10')][_0x05c0('0x13')][_0x05c0('0x14')]};logger['info'](util[_0x05c0('0x9')](_0x05c0('0x15'),_0xa50678['id']));return rp({'uri':_0x4bb164['TranscriptionJob']['Transcript']['TranscriptFileUri'],'json':!![]})[_0x05c0('0xe')](function(_0x2055a3){logger[_0x05c0('0x8')](util[_0x05c0('0x9')](_0x05c0('0x16'),_0xa50678['id']));if(_0x2055a3&&_0x2055a3[_0x05c0('0x17')]&&_0x2055a3[_0x05c0('0x17')]['transcripts']&&_0x2055a3[_0x05c0('0x17')][_0x05c0('0x18')]['length']){_0x54fef0['fileText']='';for(var _0x4da6d6=0x0;_0x4da6d6<_0x2055a3['results']['transcripts'][_0x05c0('0x19')];_0x4da6d6++){_0x54fef0[_0x05c0('0x1a')]+=_0x2055a3['results'][_0x05c0('0x18')][_0x4da6d6][_0x05c0('0x1b')]+'';}}return _0xa50678[_0x05c0('0x1c')](_0x54fef0);})[_0x05c0('0xe')](function(){logger['info'](util[_0x05c0('0x9')](_0x05c0('0x1d'),_0xa50678['id']));if(!_0xa50678[_0x05c0('0x1e')]){throw new db[(_0x05c0('0x1f'))][(_0x05c0('0x20'))](_0x05c0('0x21'));}if(!_0x5a3e65['sentiment']||!_0x5a3e65['sentimentAccountId']||!_0x5a3e65[_0x05c0('0x22')]||!_0x5a3e65[_0x05c0('0x23')]||!_0x5a3e65[_0x05c0('0x24')]){throw new db[(_0x05c0('0x1f'))][(_0x05c0('0x20'))](_0x05c0('0x25'));}if(!_0x54fef0[_0x05c0('0x1a')]){throw new Error(_0x05c0('0x26'));}if(_0x5a3e65[_0x05c0('0x27')]===_0x4e39d4['id']){return _0x4e39d4;}else{return db[_0x05c0('0x28')][_0x05c0('0x29')]({'where':{'id':_settings[_0x05c0('0x27')]}});}})['then'](function(_0x5d2020){if(!_0x5d2020){throw new db[(_0x05c0('0x1f'))][(_0x05c0('0x20'))](_0x05c0('0x2a'));}if(!_0x5d2020['data1']||!_0x5d2020[_0x05c0('0xd')]){throw new db[(_0x05c0('0x1f'))]['ValidationError'](_0x05c0('0x2b'));}_0x5eec41=_0x5d2020;logger['info'](util[_0x05c0('0x9')](_0x05c0('0x2c'),_0xa50678['id']));return sentiment(_0x5eec41[_0x05c0('0xc')],_0x5eec41[_0x05c0('0xd')],_0x5a3e65[_0x05c0('0x22')],_0x54fef0[_0x05c0('0x1a')],_0x5a3e65[_0x05c0('0x23')]);})[_0x05c0('0xe')](function(_0x3d8d76){logger[_0x05c0('0x8')](util[_0x05c0('0x9')](_0x05c0('0x2d'),_0xa50678['id']));return _0xa50678[_0x05c0('0x1c')]({'sentiment':_0x3d8d76[_0x05c0('0x2e')],'sPositive':_0x3d8d76[_0x05c0('0x2f')][_0x05c0('0x30')],'sNegative':_0x3d8d76[_0x05c0('0x2f')][_0x05c0('0x31')],'sMixed':_0x3d8d76[_0x05c0('0x2f')][_0x05c0('0x32')],'sNeutral':_0x3d8d76[_0x05c0('0x2f')][_0x05c0('0x33')]});})[_0x05c0('0xe')](function(){logger[_0x05c0('0x8')](util[_0x05c0('0x9')](_0x05c0('0x1d'),_0xa50678['id']));_0x16a290();});case _0x05c0('0x34'):return _0xa50678[_0x05c0('0x1c')]({'transcribeStatus':_0x05c0('0x34'),'failureReason':_0x4bb164[_0x05c0('0x10')][_0x05c0('0x35')]})[_0x05c0('0xe')](function(){logger[_0x05c0('0x8')](util['format'](_0x05c0('0x1d'),_0xa50678['id']));_0x16a290();});default:logger[_0x05c0('0x8')](util[_0x05c0('0x9')](_0x05c0('0x36'),_0xa50678['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0xa50678[_0x05c0('0x1e')]){throw new db[(_0x05c0('0x1f'))][(_0x05c0('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5a3e65[_0x05c0('0x37')]||!_0x5a3e65[_0x05c0('0x27')]||!_0x5a3e65[_0x05c0('0x22')]||!_0x5a3e65[_0x05c0('0x23')]||!_0x5a3e65['bucket']){throw new db[(_0x05c0('0x1f'))][(_0x05c0('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xa50678[_0x05c0('0x1a')]){throw new Error(_0x05c0('0x26'));}if(_0x5a3e65[_0x05c0('0x27')]===_0x4e39d4['id']){return _0x4e39d4;}else{return db[_0x05c0('0x28')][_0x05c0('0x29')]({'where':{'id':_settings[_0x05c0('0x27')]}});}})[_0x05c0('0xe')](function(_0x5a75b4){if(!_0x5a75b4){throw new db['Sequelize'][(_0x05c0('0x20'))](_0x05c0('0x2a'));}if(!_0x5a75b4[_0x05c0('0xc')]||!_0x5a75b4[_0x05c0('0xd')]){throw new db[(_0x05c0('0x1f'))]['ValidationError'](_0x05c0('0x2b'));}_0x5eec41=_0x5a75b4;logger[_0x05c0('0x8')](util[_0x05c0('0x9')](_0x05c0('0x2c'),_0xa50678['id']));return sentiment(_0x5eec41[_0x05c0('0xc')],_0x5eec41[_0x05c0('0xd')],_0x5a3e65[_0x05c0('0x22')],_0xa50678['fileText'],_0x5a3e65[_0x05c0('0x23')]);})[_0x05c0('0xe')](function(_0x15d119){logger[_0x05c0('0x8')](util[_0x05c0('0x9')](_0x05c0('0x2d'),_0xa50678['id']));return _0xa50678[_0x05c0('0x1c')]({'sentiment':_0x15d119[_0x05c0('0x2e')],'sPositive':_0x15d119[_0x05c0('0x2f')][_0x05c0('0x30')],'sNegative':_0x15d119[_0x05c0('0x2f')]['Negative'],'sMixed':_0x15d119['SentimentScore'][_0x05c0('0x32')],'sNeutral':_0x15d119[_0x05c0('0x2f')][_0x05c0('0x33')],'transcribeStatus':_0x05c0('0x12')});})[_0x05c0('0xe')](function(){logger[_0x05c0('0x8')](util['format'](_0x05c0('0x1d'),_0xa50678['id']));_0x16a290();});}})[_0x05c0('0x38')](function(_0x1d53c3){if(_0x1d53c3){if(!_0x1d53c3[_0x05c0('0x39')]||_0x1d53c3['name']!==_0x05c0('0x3a')){logger[_0x05c0('0x3b')](util[_0x05c0('0x9')](_0x05c0('0x3c'),_0xa50678['id']),util['inspect'](_0x1d53c3,{'showHidden':![],'depth':null}));}}_0x16a290();});});}function checkTranscribe(){var _0x2aae53;var _0x39e6ad;var _0x2e5660;return db[_0x05c0('0x3d')]['findAll']({'where':{'transcribeStatus':_0x05c0('0x3e')}})[_0x05c0('0xe')](function(_0x58241a){if(!_0x58241a||!_0x58241a[_0x05c0('0x19')]){throw new db['Sequelize']['ValidationError'](_0x05c0('0x3f'));}_0x2aae53=_0x58241a;return db['Setting'][_0x05c0('0x29')]({'where':{'id':0x1}});})[_0x05c0('0xe')](function(_0x2fedc0){if(!_0x2fedc0){throw new db[(_0x05c0('0x1f'))][(_0x05c0('0x20'))](_0x05c0('0x40'));}_0x39e6ad=_0x2fedc0;if(!_0x39e6ad['transcribe']||!_0x39e6ad[_0x05c0('0x41')]||!_0x39e6ad['transcribeRegion']||!_0x39e6ad[_0x05c0('0x23')]||!_0x39e6ad[_0x05c0('0x24')]){throw new db[(_0x05c0('0x1f'))][(_0x05c0('0x20'))](_0x05c0('0x42'));}return db[_0x05c0('0x28')][_0x05c0('0x29')]({'where':{'id':_0x39e6ad['transcribeAccountId']}});})['then'](function(_0x523153){if(!_0x523153){throw new db[(_0x05c0('0x1f'))][(_0x05c0('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x523153['data1']||!_0x523153[_0x05c0('0xd')]){throw new db[(_0x05c0('0x1f'))][(_0x05c0('0x20'))](_0x05c0('0x2b'));}_0x2e5660=_0x523153;var _0x1a3dcd=[];_0x2aae53[_0x05c0('0x43')](function(_0x3b1ce8){_0x1a3dcd['push'](checkTranscribeJob(_0x3b1ce8,_0x39e6ad,_0x2e5660));});return BPromise[_0x05c0('0x44')](_0x1a3dcd);})[_0x05c0('0x38')](function(_0x189a9a){if(_0x189a9a){if(!_0x189a9a[_0x05c0('0x39')]||_0x189a9a['name']!==_0x05c0('0x3a')){logger['error'](util[_0x05c0('0x45')](_0x189a9a,{'showHidden':![],'depth':null}));}}});}exports[_0x05c0('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x69d3=['inspect','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','data2','transcribeRegion','transcribeName','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','transcribe','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push'];(function(_0x5457a1,_0x2478b3){var _0x52ad60=function(_0x43692b){while(--_0x43692b){_0x5457a1['push'](_0x5457a1['shift']());}};_0x52ad60(++_0x2478b3);}(_0x69d3,0xda));var _0x369d=function(_0x55afb7,_0x1924b1){_0x55afb7=_0x55afb7-0x0;var _0x1a05a=_0x69d3[_0x55afb7];return _0x1a05a;};var _=require(_0x369d('0x0'));var AWS=require(_0x369d('0x1'));var rp=require(_0x369d('0x2'));var util=require('util');var BPromise=require(_0x369d('0x3'));var db=require(_0x369d('0x4'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0xe38740,_0x59df58,_0x56c175,_0x3e306c){return new Promise(function(_0x2f2a53,_0x18c9f1){var _0x424d8c=new AWS[(_0x369d('0x5'))]({'accessKeyId':_0x59df58,'secretAccessKey':_0xe38740,'region':_0x56c175});_0x424d8c[_0x369d('0x6')]({'TranscriptionJobName':_0x3e306c},function(_0x3adb26,_0x2ac0ec){if(_0x3adb26){return _0x18c9f1(_0x3adb26);}else{return _0x2f2a53(_0x2ac0ec);}});});}function sentiment(_0xbe80fc,_0x580727,_0x5d2ded,_0x28bf6e,_0x222f5f){return new Promise(function(_0xe864f0,_0x1cf530){var _0x4c7850=new AWS['Comprehend']({'accessKeyId':_0x580727,'secretAccessKey':_0xbe80fc,'region':_0x5d2ded});_0x4c7850[_0x369d('0x7')]({'Text':_0x28bf6e,'LanguageCode':_0x222f5f[_0x369d('0x8')](0x0,0x2)},function(_0x2d2bf3,_0xffbb7e){if(_0x2d2bf3){return _0x1cf530(_0x2d2bf3);}else{return _0xe864f0(_0xffbb7e);}});});}function checkTranscribeJob(_0x21ed6b,_0xee549e,_0x52c126){var _0x15b417;return new BPromise(function(_0x9d016,_0x2d6a92){logger[_0x369d('0x9')](util[_0x369d('0xa')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x21ed6b['id'],_0x21ed6b['transcribeName']));return getTranscriptionJob(_0x52c126['data1'],_0x52c126[_0x369d('0xb')],_0xee549e[_0x369d('0xc')],_0x21ed6b[_0x369d('0xd')])['then'](function(_0x2c1a4a){logger[_0x369d('0x9')](util[_0x369d('0xa')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x21ed6b['id'],_0x21ed6b[_0x369d('0xd')],_0x2c1a4a[_0x369d('0xe')]['TranscriptionJobStatus']));if(!_0x21ed6b['fileText']){switch(_0x2c1a4a['TranscriptionJob'][_0x369d('0xf')]){case _0x369d('0x10'):var _0x247a3b={'transcribeStatus':_0x2c1a4a['TranscriptionJob'][_0x369d('0xf')],'fileUri':_0x2c1a4a[_0x369d('0xe')][_0x369d('0x11')][_0x369d('0x12')]};logger[_0x369d('0x9')](util['format'](_0x369d('0x13'),_0x21ed6b['id']));return rp({'uri':_0x2c1a4a[_0x369d('0xe')][_0x369d('0x11')][_0x369d('0x12')],'json':!![]})[_0x369d('0x14')](function(_0x84cc0f){logger[_0x369d('0x9')](util[_0x369d('0xa')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x21ed6b['id']));if(_0x84cc0f&&_0x84cc0f['results']&&_0x84cc0f[_0x369d('0x15')][_0x369d('0x16')]&&_0x84cc0f[_0x369d('0x15')][_0x369d('0x16')][_0x369d('0x17')]){_0x247a3b[_0x369d('0x18')]='';for(var _0x36cf04=0x0;_0x36cf04<_0x84cc0f['results']['transcripts'][_0x369d('0x17')];_0x36cf04++){_0x247a3b[_0x369d('0x18')]+=_0x84cc0f[_0x369d('0x15')][_0x369d('0x16')][_0x36cf04][_0x369d('0x19')]+'';}}return _0x21ed6b[_0x369d('0x1a')](_0x247a3b);})[_0x369d('0x14')](function(){logger['info'](util[_0x369d('0xa')](_0x369d('0x1b'),_0x21ed6b['id']));if(!_0x21ed6b[_0x369d('0x1c')]){throw new db[(_0x369d('0x1d'))][(_0x369d('0x1e'))](_0x369d('0x1f'));}if(!_0xee549e[_0x369d('0x20')]||!_0xee549e['sentimentAccountId']||!_0xee549e[_0x369d('0x21')]||!_0xee549e['language']||!_0xee549e['bucket']){throw new db[(_0x369d('0x1d'))][(_0x369d('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x247a3b[_0x369d('0x18')]){throw new Error('Transcript\x20not\x20available');}if(_0xee549e[_0x369d('0x22')]===_0x52c126['id']){return _0x52c126;}else{return db[_0x369d('0x23')][_0x369d('0x24')]({'where':{'id':_settings[_0x369d('0x22')]}});}})[_0x369d('0x14')](function(_0x340654){if(!_0x340654){throw new db[(_0x369d('0x1d'))]['ValidationError'](_0x369d('0x25'));}if(!_0x340654[_0x369d('0x26')]||!_0x340654[_0x369d('0xb')]){throw new db[(_0x369d('0x1d'))][(_0x369d('0x1e'))](_0x369d('0x27'));}_0x15b417=_0x340654;logger[_0x369d('0x9')](util[_0x369d('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x21ed6b['id']));return sentiment(_0x15b417[_0x369d('0x26')],_0x15b417[_0x369d('0xb')],_0xee549e[_0x369d('0x21')],_0x247a3b[_0x369d('0x18')],_0xee549e[_0x369d('0x28')]);})['then'](function(_0x35f326){logger[_0x369d('0x9')](util[_0x369d('0xa')](_0x369d('0x29'),_0x21ed6b['id']));return _0x21ed6b[_0x369d('0x1a')]({'sentiment':_0x35f326[_0x369d('0x2a')],'sPositive':_0x35f326['SentimentScore'][_0x369d('0x2b')],'sNegative':_0x35f326[_0x369d('0x2c')][_0x369d('0x2d')],'sMixed':_0x35f326[_0x369d('0x2c')][_0x369d('0x2e')],'sNeutral':_0x35f326[_0x369d('0x2c')][_0x369d('0x2f')]});})[_0x369d('0x14')](function(){logger[_0x369d('0x9')](util[_0x369d('0xa')](_0x369d('0x1b'),_0x21ed6b['id']));_0x9d016();});case _0x369d('0x30'):return _0x21ed6b[_0x369d('0x1a')]({'transcribeStatus':_0x369d('0x30'),'failureReason':_0x2c1a4a[_0x369d('0xe')][_0x369d('0x31')]})[_0x369d('0x14')](function(){logger[_0x369d('0x9')](util[_0x369d('0xa')](_0x369d('0x1b'),_0x21ed6b['id']));_0x9d016();});default:logger[_0x369d('0x9')](util[_0x369d('0xa')](_0x369d('0x32'),_0x21ed6b['id']));break;}}else{return BPromise[_0x369d('0x33')]()['then'](function(){if(!_0x21ed6b['tempSentiment']){throw new db[(_0x369d('0x1d'))][(_0x369d('0x1e'))](_0x369d('0x1f'));}if(!_0xee549e[_0x369d('0x20')]||!_0xee549e[_0x369d('0x22')]||!_0xee549e[_0x369d('0x21')]||!_0xee549e[_0x369d('0x28')]||!_0xee549e[_0x369d('0x34')]){throw new db[(_0x369d('0x1d'))]['ValidationError'](_0x369d('0x35'));}if(!_0x21ed6b[_0x369d('0x18')]){throw new Error(_0x369d('0x36'));}if(_0xee549e[_0x369d('0x22')]===_0x52c126['id']){return _0x52c126;}else{return db[_0x369d('0x23')][_0x369d('0x24')]({'where':{'id':_settings[_0x369d('0x22')]}});}})[_0x369d('0x14')](function(_0x574deb){if(!_0x574deb){throw new db['Sequelize'][(_0x369d('0x1e'))](_0x369d('0x25'));}if(!_0x574deb[_0x369d('0x26')]||!_0x574deb['data2']){throw new db['Sequelize']['ValidationError'](_0x369d('0x27'));}_0x15b417=_0x574deb;logger[_0x369d('0x9')](util['format'](_0x369d('0x37'),_0x21ed6b['id']));return sentiment(_0x15b417[_0x369d('0x26')],_0x15b417[_0x369d('0xb')],_0xee549e[_0x369d('0x21')],_0x21ed6b['fileText'],_0xee549e[_0x369d('0x28')]);})['then'](function(_0x23a83b){logger['info'](util[_0x369d('0xa')](_0x369d('0x29'),_0x21ed6b['id']));return _0x21ed6b[_0x369d('0x1a')]({'sentiment':_0x23a83b['Sentiment'],'sPositive':_0x23a83b['SentimentScore'][_0x369d('0x2b')],'sNegative':_0x23a83b[_0x369d('0x2c')][_0x369d('0x2d')],'sMixed':_0x23a83b['SentimentScore'][_0x369d('0x2e')],'sNeutral':_0x23a83b[_0x369d('0x2c')][_0x369d('0x2f')],'transcribeStatus':_0x369d('0x10')});})[_0x369d('0x14')](function(){logger[_0x369d('0x9')](util[_0x369d('0xa')](_0x369d('0x1b'),_0x21ed6b['id']));_0x9d016();});}})[_0x369d('0x38')](function(_0x4873a9){if(_0x4873a9){if(!_0x4873a9[_0x369d('0x39')]||_0x4873a9[_0x369d('0x39')]!==_0x369d('0x3a')){logger[_0x369d('0x3b')](util[_0x369d('0xa')](_0x369d('0x3c'),_0x21ed6b['id']),util['inspect'](_0x4873a9,{'showHidden':![],'depth':null}));}}_0x9d016();});});}function checkTranscribe(){var _0x4663a5;var _0xa77af;var _0x16dd8f;return db[_0x369d('0x3d')][_0x369d('0x3e')]({'where':{'transcribeStatus':_0x369d('0x3f')}})[_0x369d('0x14')](function(_0x404f21){if(!_0x404f21||!_0x404f21[_0x369d('0x17')]){throw new db[(_0x369d('0x1d'))][(_0x369d('0x1e'))](_0x369d('0x40'));}_0x4663a5=_0x404f21;return db['Setting'][_0x369d('0x24')]({'where':{'id':0x1}});})[_0x369d('0x14')](function(_0x289eb8){if(!_0x289eb8){throw new db[(_0x369d('0x1d'))][(_0x369d('0x1e'))]('Settings\x20not\x20available');}_0xa77af=_0x289eb8;if(!_0xa77af[_0x369d('0x41')]||!_0xa77af['transcribeAccountId']||!_0xa77af[_0x369d('0xc')]||!_0xa77af[_0x369d('0x28')]||!_0xa77af[_0x369d('0x34')]){throw new db[(_0x369d('0x1d'))][(_0x369d('0x1e'))](_0x369d('0x42'));}return db[_0x369d('0x23')][_0x369d('0x24')]({'where':{'id':_0xa77af[_0x369d('0x43')]}});})[_0x369d('0x14')](function(_0x4d582a){if(!_0x4d582a){throw new db['Sequelize'][(_0x369d('0x1e'))](_0x369d('0x25'));}if(!_0x4d582a[_0x369d('0x26')]||!_0x4d582a[_0x369d('0xb')]){throw new db[(_0x369d('0x1d'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x16dd8f=_0x4d582a;var _0x4215ff=[];_0x4663a5[_0x369d('0x44')](function(_0x5f1ea0){_0x4215ff[_0x369d('0x45')](checkTranscribeJob(_0x5f1ea0,_0xa77af,_0x16dd8f));});return BPromise['all'](_0x4215ff);})[_0x369d('0x38')](function(_0xeded46){if(_0xeded46){if(!_0xeded46[_0x369d('0x39')]||_0xeded46['name']!==_0x369d('0x3a')){logger[_0x369d('0x3b')](util[_0x369d('0x46')](_0xeded46,{'showHidden':![],'depth':null}));}}});}exports[_0x369d('0x47')]=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 5de92d8..3984e17 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 _0xd089=['length','whatsappInteraction:update','catch','error','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x1ad84a,_0x1e9473){var _0x575ece=function(_0x3b10a4){while(--_0x3b10a4){_0x1ad84a['push'](_0x1ad84a['shift']());}};_0x575ece(++_0x1e9473);}(_0xd089,0x156));var _0x9d08=function(_0x58eb0e,_0x508d7d){_0x58eb0e=_0x58eb0e-0x0;var _0x3e5c97=_0xd089[_0x58eb0e];return _0x3e5c97;};'use strict';var _=require(_0x9d08('0x0'));var moment=require('moment');var Redis=require(_0x9d08('0x1'));var util=require(_0x9d08('0x2'));var config=require(_0x9d08('0x3'));var db=require(_0x9d08('0x4'))['db'];var logger=require(_0x9d08('0x5'))('schedule');config['redis']=_['defaults'](config[_0x9d08('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x9d08('0x7'))(new Redis(config[_0x9d08('0x6')]));function closeInteractions(){var _0x3bec63=[];return db[_0x9d08('0x8')][_0x9d08('0x9')]({'raw':!![],'attributes':['id',_0x9d08('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x9d08('0xb'))}}})[_0x9d08('0xc')](function(_0x4abeb7){if(_0x4abeb7&&_0x4abeb7['length']){_0x3bec63=_[_0x9d08('0xd')](_0x4abeb7||[],'id');logger[_0x9d08('0xe')](_0x9d08('0xf'),_0x3bec63[_0x9d08('0x10')]());return db[_0x9d08('0x8')][_0x9d08('0x11')]({'closeReason':_0x9d08('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x9d08('0x13')](_0x9d08('0x14'))},{'where':{'id':_0x3bec63}});}})['then'](function(){if(_0x3bec63&&_0x3bec63['length']){logger[_0x9d08('0xe')](_0x9d08('0x15'),_0x3bec63[_0x9d08('0x10')]());for(var _0x37273c=0x0;_0x37273c<_0x3bec63[_0x9d08('0x16')];_0x37273c++){io['emit'](_0x9d08('0x17'),{'id':_0x3bec63[_0x37273c],'closed':!![]});}}})[_0x9d08('0x18')](function(_0x1afc7f){logger[_0x9d08('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1afc7f?util[_0x9d08('0x1a')](_0x1afc7f,{'showHidden':![],'depth':null}):'');});}exports[_0x9d08('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe534=['ioredis','util','../../config/environment','../logger','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe534,0x1de));var _0x4e53=function(_0x24fcb4,_0x7cb1ce){_0x24fcb4=_0x24fcb4-0x0;var _0x3c8bc8=_0xe534[_0x24fcb4];return _0x3c8bc8;};'use strict';var _=require(_0x4e53('0x0'));var moment=require(_0x4e53('0x1'));var Redis=require(_0x4e53('0x2'));var util=require(_0x4e53('0x3'));var config=require(_0x4e53('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x4e53('0x5'))('schedule');config[_0x4e53('0x6')]=_[_0x4e53('0x7')](config[_0x4e53('0x6')],{'host':_0x4e53('0x8'),'port':0x18eb});var io=require(_0x4e53('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x4f518a=[];return db[_0x4e53('0xa')][_0x4e53('0xb')]({'raw':!![],'attributes':['id',_0x4e53('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4e53('0xd')](0x18,_0x4e53('0xe'))}}})[_0x4e53('0xf')](function(_0xeb02f){if(_0xeb02f&&_0xeb02f[_0x4e53('0x10')]){_0x4f518a=_['map'](_0xeb02f||[],'id');logger[_0x4e53('0x11')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x4f518a[_0x4e53('0x12')]());return db[_0x4e53('0xa')][_0x4e53('0x13')]({'closeReason':_0x4e53('0x14'),'disposition':_0x4e53('0x15'),'closed':!![],'closedAt':moment()[_0x4e53('0x16')](_0x4e53('0x17'))},{'where':{'id':_0x4f518a}});}})[_0x4e53('0xf')](function(){if(_0x4f518a&&_0x4f518a[_0x4e53('0x10')]){logger[_0x4e53('0x11')](_0x4e53('0x18'),_0x4f518a[_0x4e53('0x12')]());for(var _0x4ba674=0x0;_0x4ba674<_0x4f518a['length'];_0x4ba674++){io[_0x4e53('0x19')](_0x4e53('0x1a'),{'id':_0x4f518a[_0x4ba674],'closed':!![]});}}})[_0x4e53('0x1b')](function(_0x1d0d3a){logger[_0x4e53('0x1c')](_0x4e53('0x1d'),_0x1d0d3a?util[_0x4e53('0x1e')](_0x1d0d3a,{'showHidden':![],'depth':null}):'');});}exports[_0x4e53('0x1f')]=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 312f4c2..f25a617 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0051=['CmContact','destroy','then','bulkCreate','finished\x20populating','contacts1','CmHopper','log','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo','now','Innocenzo'];(function(_0x14a129,_0x319fc4){var _0x20d46d=function(_0x22a8ce){while(--_0x22a8ce){_0x14a129['push'](_0x14a129['shift']());}};_0x20d46d(++_0x319fc4);}(_0x0051,0x129));var _0x1005=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0x0051[_0x112fe3];return _0x1ec903;};'use strict';var util=require(_0x1005('0x0'));var db=require(_0x1005('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x1005('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x1005('0x3')+i,'phone':0xf879fb460+i,'email':_0x1005('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x1005('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x1005('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x1005('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x1005('0x2')]({'id':i,'firstName':_0x1005('0x6')+i,'lastName':_0x1005('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1005('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x1005('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1005('0x5')](),'updatedAt':Date['now']()});}db[_0x1005('0x7')][_0x1005('0x8')]({'where':{}})[_0x1005('0x9')](function(){return db[_0x1005('0x7')][_0x1005('0xa')](contacts);})[_0x1005('0x9')](function(){console['log'](_0x1005('0xb'),_0x1005('0xc'));return db[_0x1005('0xd')][_0x1005('0x8')]({'where':{}});})['then'](function(){return db[_0x1005('0xd')]['bulkCreate'](hopper);})['then'](function(){console[_0x1005('0xe')]('finished\x20populating',_0x1005('0xf'));return db[_0x1005('0x7')][_0x1005('0xa')](contacts2);})[_0x1005('0x9')](function(){console[_0x1005('0xe')](_0x1005('0xb'),_0x1005('0x10'));return db[_0x1005('0xd')]['bulkCreate'](hopper2);})[_0x1005('0x9')](function(){console[_0x1005('0xe')](_0x1005('0xb'),_0x1005('0x11'));})[_0x1005('0x12')](function(_0x4c057f){console[_0x1005('0xe')](_0x4c057f);}); \ No newline at end of file +var _0x505c=['CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','innocenzo.biondo','@xcally.com','now','Innocenzo','Biondo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1'];(function(_0x2307e7,_0x31e59c){var _0xde590f=function(_0x20cfdc){while(--_0x20cfdc){_0x2307e7['push'](_0x2307e7['shift']());}};_0xde590f(++_0x31e59c);}(_0x505c,0xf5));var _0xc505=function(_0x4487e3,_0x1cd4cd){_0x4487e3=_0x4487e3-0x0;var _0x56a60a=_0x505c[_0x4487e3];return _0x56a60a;};'use strict';var util=require(_0xc505('0x0'));var db=require(_0xc505('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc505('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xc505('0x3')+i+_0xc505('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xc505('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xc505('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc505('0x2')]({'id':i,'firstName':_0xc505('0x6')+i,'lastName':_0xc505('0x7')+i,'phone':0xf879fb460+i,'email':_0xc505('0x3')+i+_0xc505('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc505('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['now']()});}db[_0xc505('0x8')][_0xc505('0x9')]({'where':{}})[_0xc505('0xa')](function(){return db[_0xc505('0x8')][_0xc505('0xb')](contacts);})[_0xc505('0xa')](function(){console[_0xc505('0xc')](_0xc505('0xd'),_0xc505('0xe'));return db[_0xc505('0xf')][_0xc505('0x9')]({'where':{}});})[_0xc505('0xa')](function(){return db[_0xc505('0xf')][_0xc505('0xb')](hopper);})['then'](function(){console[_0xc505('0xc')](_0xc505('0xd'),_0xc505('0x10'));return db[_0xc505('0x8')][_0xc505('0xb')](contacts2);})['then'](function(){console['log'](_0xc505('0xd'),_0xc505('0x11'));return db[_0xc505('0xf')][_0xc505('0xb')](hopper2);})[_0xc505('0xa')](function(){console[_0xc505('0xc')](_0xc505('0xd'),_0xc505('0x12'));})[_0xc505('0x13')](function(_0x176128){console[_0xc505('0xc')](_0x176128);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 12016b0..36d7ea3 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['push','%s%s','agent','format','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','util'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x5fab,0x6b));var _0xb5fa=function(_0x509083,_0xa6676b){_0x509083=_0x509083-0x0;var _0x4b2495=_0x5fab[_0x509083];return _0x4b2495;};'use strict';var util=require(_0xb5fa('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xb5fa('0x1')]({'name':util['format'](_0xb5fa('0x2'),_0xb5fa('0x3'),i),'fullname':util[_0xb5fa('0x4')](_0xb5fa('0x2'),'agent',i),'email':util[_0xb5fa('0x4')]('%s%s@xcally.com',_0xb5fa('0x3'),i),'role':_0xb5fa('0x3'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0xb5fa('0x5'),'ws',_0xb5fa('0x6')],'disallow':[_0xb5fa('0x7')],'allow':[_0xb5fa('0x8')],'defaultuser':util[_0xb5fa('0x4')](_0xb5fa('0x2'),'agent',i),'encryption':_0xb5fa('0x9'),'avpf':'yes','force_avp':_0xb5fa('0x9'),'icesupport':_0xb5fa('0x9'),'dtlsenable':_0xb5fa('0x9'),'dtlsverify':'no','dtlscertfile':_0xb5fa('0xa'),'dtlsprivatekey':_0xb5fa('0xb'),'dtlssetup':'actpass','callerid':util['format'](_0xb5fa('0xc'),util['format'](_0xb5fa('0x2'),_0xb5fa('0x3'),i),0xfa0+i)});}db[_0xb5fa('0xd')][_0xb5fa('0xe')](users)['then'](function(){console[_0xb5fa('0xf')](_0xb5fa('0x10'));})[_0xb5fa('0x11')](function(_0x1d10fc){console[_0xb5fa('0xf')](_0x1d10fc);}); \ No newline at end of file +var _0x6d26=['\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','password','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass'];(function(_0x5df234,_0x5a5d8b){var _0x5de872=function(_0x402c99){while(--_0x402c99){_0x5df234['push'](_0x5df234['shift']());}};_0x5de872(++_0x5a5d8b);}(_0x6d26,0x12d));var _0x66d2=function(_0x31d183,_0x5ddb29){_0x31d183=_0x31d183-0x0;var _0x16499a=_0x6d26[_0x31d183];return _0x16499a;};'use strict';var util=require(_0x66d2('0x0'));var db=require(_0x66d2('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x66d2('0x2')]({'name':util[_0x66d2('0x3')](_0x66d2('0x4'),'agent',i),'fullname':util[_0x66d2('0x3')]('%s%s',_0x66d2('0x5'),i),'email':util['format']('%s%s@xcally.com',_0x66d2('0x5'),i),'role':_0x66d2('0x5'),'password':_0x66d2('0x6'),'internal':0xfa0+i,'type':_0x66d2('0x7'),'transport':['udp','ws',_0x66d2('0x8')],'disallow':['all'],'allow':[_0x66d2('0x9')],'defaultuser':util['format'](_0x66d2('0x4'),_0x66d2('0x5'),i),'encryption':_0x66d2('0xa'),'avpf':'yes','force_avp':_0x66d2('0xa'),'icesupport':_0x66d2('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x66d2('0xb'),'dtlsprivatekey':_0x66d2('0xc'),'dtlssetup':_0x66d2('0xd'),'callerid':util['format'](_0x66d2('0xe'),util[_0x66d2('0x3')](_0x66d2('0x4'),_0x66d2('0x5'),i),0xfa0+i)});}db[_0x66d2('0xf')][_0x66d2('0x10')](users)[_0x66d2('0x11')](function(){console[_0x66d2('0x12')](_0x66d2('0x13'));})[_0x66d2('0x14')](function(_0x5d9f36){console[_0x66d2('0x12')](_0x5d9f36);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 9a7b12a..73d3176 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb36b=['map','User','where','Campaign','format','%s:queue:%s','user:%s','handshake','find','userProfileId','query','ChatInteraction','MailInteraction','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','role','agent','telephone','type','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId'];(function(_0x333220,_0x2d7896){var _0x3b1ad1=function(_0x1a5130){while(--_0x1a5130){_0x333220['push'](_0x333220['shift']());}};_0x3b1ad1(++_0x2d7896);}(_0xb36b,0xac));var _0xbb36=function(_0x37f191,_0x14103b){_0x37f191=_0x37f191-0x0;var _0x215da8=_0xb36b[_0x37f191];return _0x215da8;};'use strict';var _=require(_0xbb36('0x0'));var util=require('util');var BPromise=require(_0xbb36('0x1'));var db=require(_0xbb36('0x2'))['db'];var config=require(_0xbb36('0x3'));var queryQueues={'attributes':['id',_0xbb36('0x4')],'include':[{'as':_0xbb36('0x5'),'model':db['User'],'attributes':['id',_0xbb36('0x4'),_0xbb36('0x6')],'raw':!![],'where':{'role':_0xbb36('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xbb36('0x4')],'where':{'role':_0xbb36('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xbb36('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xbb36('0x4')],'where':{'role':_0xbb36('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xbb36('0x4'),_0xbb36('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x54d526,_0x4218d3,_0x4cc282){return db['UserProfileSection'][_0xbb36('0xa')]({'where':{'name':_0x54d526,'userProfileId':_0x4218d3},'raw':!![]})[_0xbb36('0xb')](function(_0x3ca4b2){if(_0x3ca4b2){if(_0x3ca4b2[_0xbb36('0xc')]){switch(_0x54d526){case _0xbb36('0xd'):case'ChatQueues':case _0xbb36('0xe'):case _0xbb36('0xf'):case _0xbb36('0x10'):case _0xbb36('0x11'):case'WhatsappQueues':return db[_0x4cc282][_0xbb36('0x12')](queryQueues);case _0xbb36('0x13'):return db[_0x4cc282][_0xbb36('0x12')](queryTelephones);case _0xbb36('0x14'):return db[_0x4cc282][_0xbb36('0x12')](queryTrunks);case _0xbb36('0x15'):return db[_0x4cc282][_0xbb36('0x12')](queryCampaigns);}}else{return db[_0xbb36('0x16')][_0xbb36('0x12')]({'attributes':[_0xbb36('0x17')],'where':{'sectionId':_0x3ca4b2['id']},'raw':!![]})[_0xbb36('0xb')](function(_0x4d022e){if(_0x4d022e){var _0x595c49={'where':{'id':_[_0xbb36('0x18')](_0x4d022e,_0xbb36('0x17'))},'raw':!![]};switch(_0x4cc282){case _0xbb36('0x19'):_0x595c49[_0xbb36('0x1a')][_0xbb36('0x6')]=_0xbb36('0x8');break;case _0xbb36('0x1b'):_0x595c49[_0xbb36('0x1a')][_0xbb36('0x9')]='ivr';break;}return db[_0x4cc282]['findAll'](_0x595c49);}else{return[];}});}}else{return[];}})[_0xbb36('0xb')](function(_0x1acaca){return _0x1acaca;});}function joinOrLeaveQueues(_0x156918,_0x35f390,_0x3bc201,_0x17a97b){_0x156918[_0x35f390](util[_0xbb36('0x1c')](_0xbb36('0x1d'),_0x3bc201,_0x17a97b[_0xbb36('0x4')]));if(_0x17a97b['Agents']){for(var _0x617822=0x0;_0x617822<_0x17a97b[_0xbb36('0x5')]['length'];_0x617822+=0x1){_0x156918[_0x35f390](util[_0xbb36('0x1c')](_0xbb36('0x1e'),_0x17a97b[_0xbb36('0x5')][_0x617822][_0xbb36('0x4')]));}}}function joinOrLeave(_0x39cd69,_0x1e688b,_0x5033e5){var _0x523db7;if(_0x39cd69[_0xbb36('0x1f')]['query']['id']){db[_0xbb36('0x19')][_0xbb36('0x20')]({'attributes':['id',_0xbb36('0x4'),_0xbb36('0x6'),_0xbb36('0x21')],'where':{'id':_0x39cd69['handshake'][_0xbb36('0x22')]['id']},'include':[{'model':db[_0xbb36('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xbb36('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xbb36('0x25')],'as':_0xbb36('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xbb36('0x27'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xbb36('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xbb36('0x29')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x1f6059){if(_0x1f6059){_0x523db7=_0x1f6059;_0x39cd69[_0x1e688b](util['format'](_0xbb36('0x1e'),_0x1f6059['name']));var _0x516bd7=[];switch(_0x1f6059[_0xbb36('0x6')]){case _0xbb36('0x2a'):_0x39cd69[_0x1e688b](_0xbb36('0x2b'));_0x39cd69[_0x1e688b](_0xbb36('0x2c'));if(queryQueues[_0xbb36('0x2d')]('include')){delete queryQueues[_0xbb36('0x2e')];}_0x516bd7['push'](db[_0xbb36('0x2f')]['findAll'](queryQueues));_0x516bd7[_0xbb36('0x30')](db['ChatQueue'][_0xbb36('0x12')](queryQueues));_0x516bd7[_0xbb36('0x30')](db[_0xbb36('0x31')][_0xbb36('0x12')](queryQueues));_0x516bd7[_0xbb36('0x30')](db[_0xbb36('0x32')][_0xbb36('0x12')](queryQueues));_0x516bd7['push'](db[_0xbb36('0x33')]['findAll'](queryQueues));_0x516bd7[_0xbb36('0x30')](db[_0xbb36('0x34')]['findAll'](queryQueues));_0x516bd7['push'](db[_0xbb36('0x35')][_0xbb36('0x12')](queryQueues));_0x516bd7[_0xbb36('0x30')](db[_0xbb36('0x19')][_0xbb36('0x12')](queryTelephones));_0x516bd7['push'](db[_0xbb36('0x36')][_0xbb36('0x12')](queryTrunks));_0x516bd7[_0xbb36('0x30')](db[_0xbb36('0x1b')]['findAll'](queryCampaigns));_0x516bd7[_0xbb36('0x30')](db[_0xbb36('0x19')][_0xbb36('0x12')](queryAgents));break;case'user':_0x39cd69[_0x1e688b](_0xbb36('0x2b'));_0x39cd69[_0x1e688b](_0xbb36('0x2c'));_0x516bd7['push'](getAssociatedResources('VoiceQueues',_0x1f6059[_0xbb36('0x21')],_0xbb36('0x2f')));_0x516bd7['push'](getAssociatedResources('ChatQueues',_0x1f6059['userProfileId'],'ChatQueue'));_0x516bd7[_0xbb36('0x30')](getAssociatedResources(_0xbb36('0xe'),_0x1f6059['userProfileId'],'FaxQueue'));_0x516bd7[_0xbb36('0x30')](getAssociatedResources('SmsQueues',_0x1f6059[_0xbb36('0x21')],'SmsQueue'));_0x516bd7[_0xbb36('0x30')](getAssociatedResources(_0xbb36('0x10'),_0x1f6059['userProfileId'],_0xbb36('0x33')));_0x516bd7[_0xbb36('0x30')](getAssociatedResources('OpenchannelQueues',_0x1f6059[_0xbb36('0x21')],_0xbb36('0x34')));_0x516bd7[_0xbb36('0x30')](getAssociatedResources('WhatsappQueues',_0x1f6059[_0xbb36('0x21')],'WhatsappQueue'));_0x516bd7[_0xbb36('0x30')](getAssociatedResources(_0xbb36('0x13'),_0x1f6059[_0xbb36('0x21')],'User'));_0x516bd7[_0xbb36('0x30')](getAssociatedResources('Trunks',_0x1f6059['userProfileId'],_0xbb36('0x36')));_0x516bd7['push'](getAssociatedResources(_0xbb36('0x15'),_0x1f6059[_0xbb36('0x21')],_0xbb36('0x1b')));_0x516bd7[_0xbb36('0x30')](db['User'][_0xbb36('0x12')](queryAgents));break;case _0xbb36('0x7'):_0x39cd69[_0x1e688b]('voice:inbound');_0x39cd69[_0x1e688b](_0xbb36('0x2c'));_0x516bd7['push'](_0x1f6059[_0xbb36('0x37')]({'attributes':['id',_0xbb36('0x4')]}));_0x516bd7[_0xbb36('0x30')](_0x1f6059[_0xbb36('0x38')]({'attributes':['id',_0xbb36('0x4')]}));_0x516bd7[_0xbb36('0x30')](_0x1f6059[_0xbb36('0x39')]({'attributes':['id','name']}));_0x516bd7[_0xbb36('0x30')](_0x1f6059[_0xbb36('0x3a')]({'attributes':['id','name']}));_0x516bd7[_0xbb36('0x30')](_0x1f6059[_0xbb36('0x3b')]({'attributes':['id',_0xbb36('0x4')]}));_0x516bd7[_0xbb36('0x30')](_0x1f6059[_0xbb36('0x3c')]({'attributes':['id',_0xbb36('0x4')]}));_0x516bd7[_0xbb36('0x30')](_0x1f6059[_0xbb36('0x3d')]({'attributes':['id','name']}));break;}return BPromise[_0xbb36('0x3e')](_0x516bd7);}})[_0xbb36('0xb')](function(_0x384395){if(_0x384395&&_0x384395[_0xbb36('0x3f')]){for(var _0x112556=0x0;_0x112556<_0x384395[_0xbb36('0x3f')];_0x112556+=0x1){for(var _0x48c989=0x0;_0x48c989<_0x384395[_0x112556]['length'];_0x48c989+=0x1){switch(_0x112556){case 0x0:joinOrLeaveQueues(_0x39cd69,_0x1e688b,_0xbb36('0x40'),_0x384395[_0x112556][_0x48c989]);break;case 0x1:joinOrLeaveQueues(_0x39cd69,_0x1e688b,_0xbb36('0x41'),_0x384395[_0x112556][_0x48c989]);break;case 0x2:joinOrLeaveQueues(_0x39cd69,_0x1e688b,_0xbb36('0x42'),_0x384395[_0x112556][_0x48c989]);break;case 0x3:joinOrLeaveQueues(_0x39cd69,_0x1e688b,'sms',_0x384395[_0x112556][_0x48c989]);break;case 0x4:joinOrLeaveQueues(_0x39cd69,_0x1e688b,_0xbb36('0x43'),_0x384395[_0x112556][_0x48c989]);break;case 0x5:joinOrLeaveQueues(_0x39cd69,_0x1e688b,_0xbb36('0x44'),_0x384395[_0x112556][_0x48c989]);break;case 0x6:joinOrLeaveQueues(_0x39cd69,_0x1e688b,_0xbb36('0x45'),_0x384395[_0x112556][_0x48c989]);break;case 0x7:if(_0x523db7[_0xbb36('0x6')]!==_0xbb36('0x7'))_0x39cd69[_0x1e688b](util['format'](_0xbb36('0x46'),_0x384395[_0x112556][_0x48c989]['name']));break;case 0x8:if(_0x523db7['role']!=='agent')_0x39cd69[_0x1e688b](util[_0xbb36('0x1c')](_0xbb36('0x47'),_0x384395[_0x112556][_0x48c989][_0xbb36('0x4')]));break;case 0x9:if(_0x523db7[_0xbb36('0x6')]!=='agent')_0x39cd69[_0x1e688b](util[_0xbb36('0x1c')]('campaign:%s:%s',_0x384395[_0x112556][_0x48c989]['type'],_0x384395[_0x112556][_0x48c989]['name']));break;case 0xa:_0x39cd69[_0x1e688b](util[_0xbb36('0x1c')](_0xbb36('0x1e'),_0x384395[_0x112556][_0x48c989][_0xbb36('0x4')]));break;}}}}})[_0xbb36('0xb')](function(){if(_0x1e688b===_0xbb36('0x48')){var _0x442da1=_['map'](_0x523db7[_0xbb36('0x49')],'id');return _0x523db7[_0xbb36('0x4a')](_0x442da1)[_0xbb36('0xb')](function(){for(var _0x236c1a=0x0;_0x236c1a<_0x442da1[_0xbb36('0x3f')];_0x236c1a+=0x1){_0x5033e5['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x442da1[_0x236c1a]),'UserId':Number(_0x523db7['id'])});}});}})['then'](function(){if(_0x1e688b===_0xbb36('0x48')){var _0x48737e=_['map'](_0x523db7['MailInteractions'],'id');return _0x523db7['removeMailInteractions'](_0x48737e)[_0xbb36('0xb')](function(){for(var _0x114d13=0x0;_0x114d13<_0x48737e['length'];_0x114d13+=0x1){_0x5033e5[_0xbb36('0x4b')](_0xbb36('0x4c'),{'MailInteractionId':Number(_0x48737e[_0x114d13]),'UserId':Number(_0x523db7['id'])});}});}})[_0xbb36('0xb')](function(){if(_0x1e688b==='leave'){var _0x3c003b=_['map'](_0x523db7[_0xbb36('0x26')],'id');return _0x523db7[_0xbb36('0x4d')](_0x3c003b)[_0xbb36('0xb')](function(){for(var _0xcf045f=0x0;_0xcf045f<_0x3c003b[_0xbb36('0x3f')];_0xcf045f+=0x1){_0x5033e5[_0xbb36('0x4b')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3c003b[_0xcf045f]),'UserId':Number(_0x523db7['id'])});}});}})['then'](function(){if(_0x1e688b===_0xbb36('0x48')){var _0x2b525d=_['map'](_0x523db7[_0xbb36('0x27')],'id');return _0x523db7[_0xbb36('0x4e')](_0x2b525d)[_0xbb36('0xb')](function(){for(var _0x566138=0x0;_0x566138<_0x2b525d['length'];_0x566138+=0x1){_0x5033e5[_0xbb36('0x4b')](_0xbb36('0x4f'),{'SmsInteractionId':Number(_0x2b525d[_0x566138]),'UserId':Number(_0x523db7['id'])});}});}})[_0xbb36('0xb')](function(){if(_0x1e688b===_0xbb36('0x48')){var _0x6e9a30=_[_0xbb36('0x18')](_0x523db7[_0xbb36('0x28')],'id');return _0x523db7['removeOpenchannelInteractions'](_0x6e9a30)[_0xbb36('0xb')](function(){for(var _0x5a4193=0x0;_0x5a4193<_0x6e9a30['length'];_0x5a4193+=0x1){_0x5033e5['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x6e9a30[_0x5a4193]),'UserId':Number(_0x523db7['id'])});}});}})[_0xbb36('0xb')](function(){if(_0x1e688b===_0xbb36('0x48')){var _0x4d2169=_['map'](_0x523db7[_0xbb36('0x50')],'id');return _0x523db7[_0xbb36('0x51')](_0x4d2169)[_0xbb36('0xb')](function(){for(var _0x5efdb5=0x0;_0x5efdb5<_0x4d2169[_0xbb36('0x3f')];_0x5efdb5+=0x1){_0x5033e5[_0xbb36('0x4b')](_0xbb36('0x52'),{'WhatsappInteractionId':Number(_0x4d2169[_0x5efdb5]),'UserId':Number(_0x523db7['id'])});}});}})[_0xbb36('0x53')](function(_0x59df3c){_0x39cd69[_0xbb36('0x54')](_0x59df3c);});}}function onDisconnect(_0xdff353,_0x57719d){joinOrLeave(_0xdff353,_0xbb36('0x48'),_0x57719d);}function onConnect(_0x4a8eca){joinOrLeave(_0x4a8eca,_0xbb36('0x55'));}exports[_0xbb36('0x56')]=function(_0x11be68){_0x11be68['on']('connection',function(_0x4b427a){_0x4b427a[_0xbb36('0x57')](0x0);_0x4b427a[_0xbb36('0x58')]=_0x4b427a[_0xbb36('0x59')][_0xbb36('0x5a')][_0xbb36('0x5b')]+':'+_0x4b427a[_0xbb36('0x59')][_0xbb36('0x5a')][_0xbb36('0x5c')];_0x4b427a['connectedAt']=new Date();_0x4b427a['log']=function(_0x3ea141){console[_0xbb36('0x54')](_0xbb36('0x5d')+_0x4b427a[_0xbb36('0x5e')][_0xbb36('0x4')]+'['+_0x4b427a[_0xbb36('0x58')]+']',_0x3ea141);};_0x4b427a['on'](_0xbb36('0x5f'),function(){onDisconnect(_0x4b427a,_0x11be68);_0x4b427a[_0xbb36('0x54')](_0xbb36('0x60'));});onConnect(_0x4b427a);_0x4b427a[_0xbb36('0x54')](_0xbb36('0x61'));});}; \ No newline at end of file +var _0xd9b4=['OpenchannelQueue','Trunk','Campaign','user','userProfileId','VoiceQueue','ChatQueues','ChatQueue','SmsQueues','MailQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','setMaxListeners','request','remotePort','connectedAt','SocketIO\x20','address','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','then','autoAssociation','VoiceQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','role','format','%s:queue:%s','user:%s','handshake','query','ChatInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','FaxQueue','SmsQueue'];(function(_0x444a8b,_0x526b10){var _0x2cebf5=function(_0x499494){while(--_0x499494){_0x444a8b['push'](_0x444a8b['shift']());}};_0x2cebf5(++_0x526b10);}(_0xd9b4,0x1c0));var _0x4d9b=function(_0x3c4c79,_0x475300){_0x3c4c79=_0x3c4c79-0x0;var _0x2c8226=_0xd9b4[_0x3c4c79];return _0x2c8226;};'use strict';var _=require(_0x4d9b('0x0'));var util=require(_0x4d9b('0x1'));var BPromise=require(_0x4d9b('0x2'));var db=require(_0x4d9b('0x3'))['db'];var config=require(_0x4d9b('0x4'));var queryQueues={'attributes':['id',_0x4d9b('0x5')],'include':[{'as':_0x4d9b('0x6'),'model':db[_0x4d9b('0x7')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x4d9b('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x4d9b('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x4d9b('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x4d9b('0x5')],'where':{'role':_0x4d9b('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4d9b('0x5'),_0x4d9b('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x2fcf78,_0x480105,_0xdeb1f5){return db['UserProfileSection']['findOne']({'where':{'name':_0x2fcf78,'userProfileId':_0x480105},'raw':!![]})[_0x4d9b('0xb')](function(_0x4b244f){if(_0x4b244f){if(_0x4b244f[_0x4d9b('0xc')]){switch(_0x2fcf78){case _0x4d9b('0xd'):case'ChatQueues':case _0x4d9b('0xe'):case'SmsQueues':case _0x4d9b('0xf'):case _0x4d9b('0x10'):case _0x4d9b('0x11'):return db[_0xdeb1f5][_0x4d9b('0x12')](queryQueues);case _0x4d9b('0x13'):return db[_0xdeb1f5]['findAll'](queryTelephones);case _0x4d9b('0x14'):return db[_0xdeb1f5][_0x4d9b('0x12')](queryTrunks);case _0x4d9b('0x15'):return db[_0xdeb1f5][_0x4d9b('0x12')](queryCampaigns);}}else{return db[_0x4d9b('0x16')]['findAll']({'attributes':[_0x4d9b('0x17')],'where':{'sectionId':_0x4b244f['id']},'raw':!![]})[_0x4d9b('0xb')](function(_0x402c75){if(_0x402c75){var _0x3c224b={'where':{'id':_[_0x4d9b('0x18')](_0x402c75,_0x4d9b('0x17'))},'raw':!![]};switch(_0xdeb1f5){case _0x4d9b('0x7'):_0x3c224b[_0x4d9b('0x19')][_0x4d9b('0x1a')]=_0x4d9b('0x9');break;case'Campaign':_0x3c224b[_0x4d9b('0x19')][_0x4d9b('0xa')]='ivr';break;}return db[_0xdeb1f5][_0x4d9b('0x12')](_0x3c224b);}else{return[];}});}}else{return[];}})[_0x4d9b('0xb')](function(_0xef01bc){return _0xef01bc;});}function joinOrLeaveQueues(_0x35d1c4,_0x1d1f71,_0xe4244d,_0x4c23ab){_0x35d1c4[_0x1d1f71](util[_0x4d9b('0x1b')](_0x4d9b('0x1c'),_0xe4244d,_0x4c23ab[_0x4d9b('0x5')]));if(_0x4c23ab[_0x4d9b('0x6')]){for(var _0x54c31c=0x0;_0x54c31c<_0x4c23ab[_0x4d9b('0x6')]['length'];_0x54c31c+=0x1){_0x35d1c4[_0x1d1f71](util['format'](_0x4d9b('0x1d'),_0x4c23ab[_0x4d9b('0x6')][_0x54c31c]['name']));}}}function joinOrLeave(_0x5accb4,_0x233f0a,_0x345a0e){var _0x1f4519;if(_0x5accb4[_0x4d9b('0x1e')][_0x4d9b('0x1f')]['id']){db['User']['find']({'attributes':['id',_0x4d9b('0x5'),_0x4d9b('0x1a'),'userProfileId'],'where':{'id':_0x5accb4['handshake'][_0x4d9b('0x1f')]['id']},'include':[{'model':db[_0x4d9b('0x20')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4d9b('0x21')],'as':_0x4d9b('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x4d9b('0x23')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4d9b('0x24')],'as':_0x4d9b('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x4d9b('0x26')],'as':_0x4d9b('0x27'),'attributes':['id'],'raw':!![]}]})[_0x4d9b('0xb')](function(_0x351b89){if(_0x351b89){_0x1f4519=_0x351b89;_0x5accb4[_0x233f0a](util['format']('user:%s',_0x351b89[_0x4d9b('0x5')]));var _0x4ce054=[];switch(_0x351b89[_0x4d9b('0x1a')]){case _0x4d9b('0x28'):_0x5accb4[_0x233f0a](_0x4d9b('0x29'));_0x5accb4[_0x233f0a](_0x4d9b('0x2a'));if(queryQueues['hasOwnProperty'](_0x4d9b('0x2b'))){delete queryQueues[_0x4d9b('0x2b')];}_0x4ce054[_0x4d9b('0x2c')](db['VoiceQueue'][_0x4d9b('0x12')](queryQueues));_0x4ce054[_0x4d9b('0x2c')](db['ChatQueue'][_0x4d9b('0x12')](queryQueues));_0x4ce054[_0x4d9b('0x2c')](db[_0x4d9b('0x2d')][_0x4d9b('0x12')](queryQueues));_0x4ce054[_0x4d9b('0x2c')](db[_0x4d9b('0x2e')][_0x4d9b('0x12')](queryQueues));_0x4ce054['push'](db['MailQueue'][_0x4d9b('0x12')](queryQueues));_0x4ce054[_0x4d9b('0x2c')](db[_0x4d9b('0x2f')][_0x4d9b('0x12')](queryQueues));_0x4ce054[_0x4d9b('0x2c')](db['WhatsappQueue']['findAll'](queryQueues));_0x4ce054[_0x4d9b('0x2c')](db[_0x4d9b('0x7')][_0x4d9b('0x12')](queryTelephones));_0x4ce054[_0x4d9b('0x2c')](db[_0x4d9b('0x30')][_0x4d9b('0x12')](queryTrunks));_0x4ce054[_0x4d9b('0x2c')](db[_0x4d9b('0x31')][_0x4d9b('0x12')](queryCampaigns));_0x4ce054[_0x4d9b('0x2c')](db['User'][_0x4d9b('0x12')](queryAgents));break;case _0x4d9b('0x32'):_0x5accb4[_0x233f0a](_0x4d9b('0x29'));_0x5accb4[_0x233f0a]('voice:outbound');_0x4ce054[_0x4d9b('0x2c')](getAssociatedResources(_0x4d9b('0xd'),_0x351b89[_0x4d9b('0x33')],_0x4d9b('0x34')));_0x4ce054['push'](getAssociatedResources(_0x4d9b('0x35'),_0x351b89[_0x4d9b('0x33')],_0x4d9b('0x36')));_0x4ce054[_0x4d9b('0x2c')](getAssociatedResources(_0x4d9b('0xe'),_0x351b89[_0x4d9b('0x33')],_0x4d9b('0x2d')));_0x4ce054[_0x4d9b('0x2c')](getAssociatedResources(_0x4d9b('0x37'),_0x351b89[_0x4d9b('0x33')],'SmsQueue'));_0x4ce054['push'](getAssociatedResources(_0x4d9b('0xf'),_0x351b89[_0x4d9b('0x33')],_0x4d9b('0x38')));_0x4ce054[_0x4d9b('0x2c')](getAssociatedResources(_0x4d9b('0x10'),_0x351b89[_0x4d9b('0x33')],_0x4d9b('0x2f')));_0x4ce054['push'](getAssociatedResources(_0x4d9b('0x11'),_0x351b89['userProfileId'],'WhatsappQueue'));_0x4ce054['push'](getAssociatedResources(_0x4d9b('0x13'),_0x351b89[_0x4d9b('0x33')],_0x4d9b('0x7')));_0x4ce054[_0x4d9b('0x2c')](getAssociatedResources('Trunks',_0x351b89[_0x4d9b('0x33')],_0x4d9b('0x30')));_0x4ce054[_0x4d9b('0x2c')](getAssociatedResources(_0x4d9b('0x15'),_0x351b89[_0x4d9b('0x33')],_0x4d9b('0x31')));_0x4ce054['push'](db[_0x4d9b('0x7')][_0x4d9b('0x12')](queryAgents));break;case _0x4d9b('0x8'):_0x5accb4[_0x233f0a](_0x4d9b('0x29'));_0x5accb4[_0x233f0a]('voice:outbound');_0x4ce054[_0x4d9b('0x2c')](_0x351b89[_0x4d9b('0x39')]({'attributes':['id','name']}));_0x4ce054[_0x4d9b('0x2c')](_0x351b89[_0x4d9b('0x3a')]({'attributes':['id','name']}));_0x4ce054[_0x4d9b('0x2c')](_0x351b89[_0x4d9b('0x3b')]({'attributes':['id',_0x4d9b('0x5')]}));_0x4ce054['push'](_0x351b89[_0x4d9b('0x3c')]({'attributes':['id',_0x4d9b('0x5')]}));_0x4ce054['push'](_0x351b89['getMailQueues']({'attributes':['id',_0x4d9b('0x5')]}));_0x4ce054['push'](_0x351b89['getOpenchannelQueues']({'attributes':['id',_0x4d9b('0x5')]}));_0x4ce054[_0x4d9b('0x2c')](_0x351b89[_0x4d9b('0x3d')]({'attributes':['id',_0x4d9b('0x5')]}));break;}return BPromise[_0x4d9b('0x3e')](_0x4ce054);}})[_0x4d9b('0xb')](function(_0xf4b92){if(_0xf4b92&&_0xf4b92['length']){for(var _0x19774f=0x0;_0x19774f<_0xf4b92[_0x4d9b('0x3f')];_0x19774f+=0x1){for(var _0x22d0f5=0x0;_0x22d0f5<_0xf4b92[_0x19774f]['length'];_0x22d0f5+=0x1){switch(_0x19774f){case 0x0:joinOrLeaveQueues(_0x5accb4,_0x233f0a,_0x4d9b('0x40'),_0xf4b92[_0x19774f][_0x22d0f5]);break;case 0x1:joinOrLeaveQueues(_0x5accb4,_0x233f0a,_0x4d9b('0x41'),_0xf4b92[_0x19774f][_0x22d0f5]);break;case 0x2:joinOrLeaveQueues(_0x5accb4,_0x233f0a,_0x4d9b('0x42'),_0xf4b92[_0x19774f][_0x22d0f5]);break;case 0x3:joinOrLeaveQueues(_0x5accb4,_0x233f0a,_0x4d9b('0x43'),_0xf4b92[_0x19774f][_0x22d0f5]);break;case 0x4:joinOrLeaveQueues(_0x5accb4,_0x233f0a,_0x4d9b('0x44'),_0xf4b92[_0x19774f][_0x22d0f5]);break;case 0x5:joinOrLeaveQueues(_0x5accb4,_0x233f0a,_0x4d9b('0x45'),_0xf4b92[_0x19774f][_0x22d0f5]);break;case 0x6:joinOrLeaveQueues(_0x5accb4,_0x233f0a,_0x4d9b('0x46'),_0xf4b92[_0x19774f][_0x22d0f5]);break;case 0x7:if(_0x1f4519['role']!=='agent')_0x5accb4[_0x233f0a](util[_0x4d9b('0x1b')](_0x4d9b('0x47'),_0xf4b92[_0x19774f][_0x22d0f5][_0x4d9b('0x5')]));break;case 0x8:if(_0x1f4519['role']!==_0x4d9b('0x8'))_0x5accb4[_0x233f0a](util['format'](_0x4d9b('0x48'),_0xf4b92[_0x19774f][_0x22d0f5][_0x4d9b('0x5')]));break;case 0x9:if(_0x1f4519['role']!==_0x4d9b('0x8'))_0x5accb4[_0x233f0a](util[_0x4d9b('0x1b')]('campaign:%s:%s',_0xf4b92[_0x19774f][_0x22d0f5]['type'],_0xf4b92[_0x19774f][_0x22d0f5][_0x4d9b('0x5')]));break;case 0xa:_0x5accb4[_0x233f0a](util['format'](_0x4d9b('0x1d'),_0xf4b92[_0x19774f][_0x22d0f5]['name']));break;}}}}})[_0x4d9b('0xb')](function(){if(_0x233f0a==='leave'){var _0x3eaa86=_[_0x4d9b('0x18')](_0x1f4519[_0x4d9b('0x49')],'id');return _0x1f4519[_0x4d9b('0x4a')](_0x3eaa86)[_0x4d9b('0xb')](function(){for(var _0x156b26=0x0;_0x156b26<_0x3eaa86[_0x4d9b('0x3f')];_0x156b26+=0x1){_0x345a0e[_0x4d9b('0x4b')](_0x4d9b('0x4c'),{'ChatInteractionId':Number(_0x3eaa86[_0x156b26]),'UserId':Number(_0x1f4519['id'])});}});}})[_0x4d9b('0xb')](function(){if(_0x233f0a===_0x4d9b('0x4d')){var _0x2a682b=_[_0x4d9b('0x18')](_0x1f4519['MailInteractions'],'id');return _0x1f4519['removeMailInteractions'](_0x2a682b)['then'](function(){for(var _0x53543f=0x0;_0x53543f<_0x2a682b[_0x4d9b('0x3f')];_0x53543f+=0x1){_0x345a0e[_0x4d9b('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2a682b[_0x53543f]),'UserId':Number(_0x1f4519['id'])});}});}})[_0x4d9b('0xb')](function(){if(_0x233f0a===_0x4d9b('0x4d')){var _0x4a8a66=_[_0x4d9b('0x18')](_0x1f4519[_0x4d9b('0x22')],'id');return _0x1f4519[_0x4d9b('0x4e')](_0x4a8a66)[_0x4d9b('0xb')](function(){for(var _0x44593c=0x0;_0x44593c<_0x4a8a66[_0x4d9b('0x3f')];_0x44593c+=0x1){_0x345a0e[_0x4d9b('0x4b')](_0x4d9b('0x4f'),{'FaxInteractionId':Number(_0x4a8a66[_0x44593c]),'UserId':Number(_0x1f4519['id'])});}});}})[_0x4d9b('0xb')](function(){if(_0x233f0a===_0x4d9b('0x4d')){var _0x25fecf=_[_0x4d9b('0x18')](_0x1f4519[_0x4d9b('0x50')],'id');return _0x1f4519[_0x4d9b('0x51')](_0x25fecf)[_0x4d9b('0xb')](function(){for(var _0x5f0210=0x0;_0x5f0210<_0x25fecf[_0x4d9b('0x3f')];_0x5f0210+=0x1){_0x345a0e['emit'](_0x4d9b('0x52'),{'SmsInteractionId':Number(_0x25fecf[_0x5f0210]),'UserId':Number(_0x1f4519['id'])});}});}})['then'](function(){if(_0x233f0a===_0x4d9b('0x4d')){var _0x3687f8=_[_0x4d9b('0x18')](_0x1f4519[_0x4d9b('0x25')],'id');return _0x1f4519[_0x4d9b('0x53')](_0x3687f8)['then'](function(){for(var _0xbac2fe=0x0;_0xbac2fe<_0x3687f8['length'];_0xbac2fe+=0x1){_0x345a0e['emit'](_0x4d9b('0x54'),{'OpenchannelInteractionId':Number(_0x3687f8[_0xbac2fe]),'UserId':Number(_0x1f4519['id'])});}});}})[_0x4d9b('0xb')](function(){if(_0x233f0a===_0x4d9b('0x4d')){var _0x4baade=_['map'](_0x1f4519['WhatsappInteractions'],'id');return _0x1f4519[_0x4d9b('0x55')](_0x4baade)[_0x4d9b('0xb')](function(){for(var _0x497800=0x0;_0x497800<_0x4baade[_0x4d9b('0x3f')];_0x497800+=0x1){_0x345a0e[_0x4d9b('0x4b')](_0x4d9b('0x56'),{'WhatsappInteractionId':Number(_0x4baade[_0x497800]),'UserId':Number(_0x1f4519['id'])});}});}})[_0x4d9b('0x57')](function(_0x2d4155){_0x5accb4[_0x4d9b('0x58')](_0x2d4155);});}}function onDisconnect(_0x483155,_0x1ed1d6){joinOrLeave(_0x483155,_0x4d9b('0x4d'),_0x1ed1d6);}function onConnect(_0x2db2f1){joinOrLeave(_0x2db2f1,'join');}exports[_0x4d9b('0x59')]=function(_0x29e11f){_0x29e11f['on'](_0x4d9b('0x5a'),function(_0x43ad48){_0x43ad48[_0x4d9b('0x5b')](0x0);_0x43ad48['address']=_0x43ad48[_0x4d9b('0x5c')][_0x4d9b('0x5a')]['remoteAddress']+':'+_0x43ad48[_0x4d9b('0x5c')][_0x4d9b('0x5a')][_0x4d9b('0x5d')];_0x43ad48[_0x4d9b('0x5e')]=new Date();_0x43ad48[_0x4d9b('0x58')]=function(_0x284565){console[_0x4d9b('0x58')](_0x4d9b('0x5f')+_0x43ad48['nsp'][_0x4d9b('0x5')]+'['+_0x43ad48[_0x4d9b('0x60')]+']',_0x284565);};_0x43ad48['on'](_0x4d9b('0x61'),function(){onDisconnect(_0x43ad48,_0x29e11f);_0x43ad48[_0x4d9b('0x58')]('DISCONNECTED');});onConnect(_0x43ad48);_0x43ad48['log'](_0x4d9b('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index a9db58b..4286fa6 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 _0xa9d9=['undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','QueryTypes','SELECT','contact','UserId','format','SIP/%s','name','agent','incomingmessage','AfterCreateMessage','get','offlineMessage','opened','Sequelize','interface','AfterCreate','changed','closed','substatus','sequelize','AfterUpdate','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','jayson/promise','../logger','triggers','client','http','ChatInteraction','afterCreate','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','newinteraction','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','error','code','catch','Trigger,\x20%s','channel','motionChannel','event','direction','resolve','then','ContactId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9d9,0xc2));var _0x9a9d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa9d9[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x9a9d('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x9a9d('0x1'));var logger=require(_0x9a9d('0x2'))(_0x9a9d('0x3'));var client=jayson[_0x9a9d('0x4')][_0x9a9d('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x9a9d('0x6'),'event':_0x9a9d('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x9a9d('0x8'),'model':'ChatInteraction','event':_0x9a9d('0x9'),'condition':_0x9a9d('0xa'),'callback':afterUpdate},{'channel':_0x9a9d('0x8'),'model':_0x9a9d('0xb'),'event':_0x9a9d('0x7'),'condition':_0x9a9d('0xc'),'callback':afterCreateMessage},{'channel':_0x9a9d('0x8'),'model':_0x9a9d('0xd'),'event':_0x9a9d('0x7'),'condition':_0x9a9d('0xc'),'callback':afterCreateOfflineMessage},{'channel':_0x9a9d('0xe'),'model':'SmsInteraction','event':_0x9a9d('0x7'),'condition':_0x9a9d('0xf'),'callback':afterCreate},{'channel':_0x9a9d('0xe'),'model':_0x9a9d('0x10'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x9a9d('0xe'),'model':'SmsMessage','event':_0x9a9d('0x7'),'condition':_0x9a9d('0xc'),'callback':afterCreateMessage},{'channel':_0x9a9d('0x11'),'model':_0x9a9d('0x12'),'event':_0x9a9d('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x9a9d('0x11'),'model':_0x9a9d('0x12'),'event':_0x9a9d('0x9'),'condition':_0x9a9d('0xa'),'callback':afterUpdate},{'channel':_0x9a9d('0x11'),'model':_0x9a9d('0x13'),'event':_0x9a9d('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x9a9d('0x14'),'model':_0x9a9d('0x15'),'event':_0x9a9d('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x9a9d('0x14'),'model':_0x9a9d('0x15'),'event':_0x9a9d('0x9'),'condition':_0x9a9d('0xa'),'callback':afterUpdate},{'channel':_0x9a9d('0x14'),'model':_0x9a9d('0x16'),'event':'afterCreate','condition':_0x9a9d('0xc'),'callback':afterCreateMessage},{'channel':_0x9a9d('0x17'),'model':_0x9a9d('0x18'),'event':_0x9a9d('0x7'),'condition':_0x9a9d('0xf'),'callback':afterCreate},{'channel':_0x9a9d('0x17'),'model':_0x9a9d('0x18'),'event':_0x9a9d('0x9'),'condition':_0x9a9d('0xa'),'callback':afterUpdate},{'channel':'Mail','model':_0x9a9d('0x19'),'event':_0x9a9d('0x7'),'condition':_0x9a9d('0xc'),'callback':afterCreateMessage},{'channel':_0x9a9d('0x1a'),'model':_0x9a9d('0x1b'),'event':_0x9a9d('0x7'),'condition':_0x9a9d('0xf'),'callback':afterCreate},{'channel':_0x9a9d('0x1a'),'model':_0x9a9d('0x1b'),'event':_0x9a9d('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x9a9d('0x1a'),'model':_0x9a9d('0x1c'),'event':_0x9a9d('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x4a59b1){return client[_0x9a9d('0x1d')](_0x9a9d('0x1e'),_0x4a59b1)['then'](function(_0x3abca5){logger[_0x9a9d('0x1f')]('Trigger,\x20%s',_0x9a9d('0x1e'),_0x3abca5);if(_0x3abca5[_0x9a9d('0x20')]){if(_0x3abca5[_0x9a9d('0x20')][_0x9a9d('0x21')]===0x1f4){logger[_0x9a9d('0x20')]('Trigger,\x20%s',_0x9a9d('0x1e'),_0x3abca5[_0x9a9d('0x20')]);}}})[_0x9a9d('0x22')](function(_0x255cd6){logger[_0x9a9d('0x20')](_0x9a9d('0x23'),_0x9a9d('0x1e'),_0x255cd6);});}function afterCreateMessage(_0x417f9c){return function(_0x106468){_0x106468=_0x106468['get']({'plain':!![]});_0x106468[_0x9a9d('0x24')]=_0x417f9c;_0x106468[_0x9a9d('0x25')]=_0x417f9c;_0x106468[_0x9a9d('0x26')]=_0x106468[_0x9a9d('0x27')];Promise[_0x9a9d('0x28')]()[_0x9a9d('0x29')](function(){if(typeof _0x106468[_0x9a9d('0x2a')]===_0x9a9d('0x2b'))return null;var _0x263aa6=_0x9a9d('0x2c')+_0x106468[_0x9a9d('0x2a')];return db['sequelize'][_0x9a9d('0x2d')](_0x263aa6,{'type':db['Sequelize'][_0x9a9d('0x2e')][_0x9a9d('0x2f')],'raw':!![]});})['then'](function(_0x22a2be){if(_0x22a2be){_0x106468[_0x9a9d('0x30')]=_0x22a2be[0x0];}if(typeof _0x106468['UserId']===_0x9a9d('0x2b'))return;return getAgent(_0x106468[_0x9a9d('0x31')]);})[_0x9a9d('0x29')](function(_0x5eb72f){if(_0x5eb72f){_0x106468['interface']=util[_0x9a9d('0x32')](_0x9a9d('0x33'),_0x5eb72f[_0x9a9d('0x34')]);_0x106468[_0x9a9d('0x35')]=_0x5eb72f;_0x106468['channel']=_0x417f9c;return request({'event':_0x9a9d('0x36'),'message':_0x106468});}else{return request({'event':'outgoingmessage','message':_0x106468});}})['catch'](function(_0x6a8688){logger[_0x9a9d('0x20')](_0x9a9d('0x23'),_0x9a9d('0x37'),_0x6a8688);});};}function afterCreateOfflineMessage(_0x445b1b){return function(_0xf1e382){_0xf1e382=_0xf1e382[_0x9a9d('0x38')]({'plain':!![]});_0xf1e382[_0x9a9d('0x24')]=_0x445b1b;_0xf1e382['motionChannel']=_0x445b1b;_0xf1e382['event']=_0x9a9d('0x39');return request({'event':_0xf1e382[_0x9a9d('0x26')],'message':_0xf1e382});};}function afterCreate(_0x3b9e3e,_0x8b6444){return function(_0x454283){_0x454283=_0x454283[_0x9a9d('0x38')]({'plain':!![]});_0x454283['channel']=_0x3b9e3e;_0x454283[_0x9a9d('0x25')]=_0x3b9e3e;_0x454283[_0x9a9d('0x26')]=_0x9a9d('0x3a');Promise[_0x9a9d('0x28')]()[_0x9a9d('0x29')](function(){var _0x58864c=_0x9a9d('0x2c')+_0x454283[_0x9a9d('0x2a')];return db['sequelize'][_0x9a9d('0x2d')](_0x58864c,{'type':db[_0x9a9d('0x3b')][_0x9a9d('0x2e')][_0x9a9d('0x2f')],'raw':!![]});})[_0x9a9d('0x29')](function(_0xb282e0){if(_0xb282e0){_0x454283['contact']=_0xb282e0[0x0];}if(typeof _0x454283[_0x9a9d('0x31')]===_0x9a9d('0x2b'))return;return getAgent(_0x454283[_0x9a9d('0x31')]);})[_0x9a9d('0x29')](function(_0x34fb1d){if(_0x34fb1d){_0x454283[_0x9a9d('0x3c')]=util[_0x9a9d('0x32')](_0x9a9d('0x33'),_0x34fb1d[_0x9a9d('0x34')]);_0x454283['agent']=_0x34fb1d;}return request({'event':_0x8b6444,'message':_0x454283});})[_0x9a9d('0x22')](function(_0x1d9978){logger[_0x9a9d('0x20')](_0x9a9d('0x23'),_0x9a9d('0x3d'),_0x1d9978);});};}function afterUpdate(_0x2067e9){return function(_0x47e918){var _0x374ef0=_0x47e918[_0x9a9d('0x3e')](_0x9a9d('0x3f'))&&_0x47e918[_0x9a9d('0x3f')];var _0x38500f=_0x47e918['changed'](_0x9a9d('0x40'));if(_0x374ef0||_0x38500f){var _0x52a440=_0x374ef0?_0x9a9d('0xa'):'substatus';var _0x4e2285=_0x47e918['get']({'plain':!![]});_0x4e2285[_0x9a9d('0x24')]=_0x2067e9;_0x4e2285[_0x9a9d('0x25')]=_0x2067e9;_0x4e2285[_0x9a9d('0x26')]=_0x374ef0?_0x9a9d('0x3f'):'substatus';var _0x126e97=_0x9a9d('0x2c')+_0x4e2285[_0x9a9d('0x2a')];return db[_0x9a9d('0x41')][_0x9a9d('0x2d')](_0x126e97,{'type':db['Sequelize'][_0x9a9d('0x2e')][_0x9a9d('0x2f')],'raw':!![]})[_0x9a9d('0x29')](function(_0x4981fc){if(_0x4981fc){_0x4e2285[_0x9a9d('0x30')]=_0x4981fc[0x0];}if(typeof _0x4e2285[_0x9a9d('0x31')]==='undefined')return;return getAgent(_0x4e2285[_0x9a9d('0x31')]);})[_0x9a9d('0x29')](function(_0xfb25b2){if(_0xfb25b2){_0x4e2285['interface']=util[_0x9a9d('0x32')](_0x9a9d('0x33'),_0xfb25b2[_0x9a9d('0x34')]);_0x4e2285[_0x9a9d('0x35')]=_0xfb25b2;}return request({'event':_0x52a440,'message':_0x4e2285});})[_0x9a9d('0x22')](function(_0x34aca0){logger[_0x9a9d('0x20')](_0x9a9d('0x23'),_0x9a9d('0x42'),_0x34aca0);});}};}function getAgent(_0x5b80f7){return db['User'][_0x9a9d('0x43')]({'where':{'id':_0x5b80f7},'attributes':['id',_0x9a9d('0x34'),_0x9a9d('0x44'),_0x9a9d('0x45'),_0x9a9d('0x46')],'raw':!![]})['then'](function(_0xc91cf0){return _0xc91cf0;});}exports[_0x9a9d('0x47')]=function(){for(var _0x13d147=0x0;_0x13d147=_0xe9941[_0xa95d('0x13')]){throw Error(_0xa95d('0x14'));}_0x254e82(_0x5c4e46);})[_0xa95d('0x15')](function(_0x47a7a9){_0x266559(_0x47a7a9);});});}; \ No newline at end of file +var _0xb797=['includes','clearBlockUser','isUndefined','updateAttributes','getLicense','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','mail','whatsapp','isValidChannel','toLowerCase'];(function(_0x2045c8,_0x29ccf7){var _0x37259d=function(_0xfb57e2){while(--_0xfb57e2){_0x2045c8['push'](_0x2045c8['shift']());}};_0x37259d(++_0x29ccf7);}(_0xb797,0xc9));var _0x7b79=function(_0x45f081,_0x58ef5d){_0x45f081=_0x45f081-0x0;var _0x2b9950=_0xb797[_0x45f081];return _0x2b9950;};'use strict';var _=require(_0x7b79('0x0'));var BPromise=require(_0x7b79('0x1'));var db=require(_0x7b79('0x2'))['db'];var util=require(_0x7b79('0x3'));var channels=['voice',_0x7b79('0x4'),'chat','fax','sms',_0x7b79('0x5'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0x7b79('0x6')]=function(_0x172dfe){_0x172dfe=_0x172dfe[_0x7b79('0x7')]();return _[_0x7b79('0x8')](channels,_0x172dfe);};exports[_0x7b79('0x9')]=function(_0x15d58d,_0x1e7369,_0x38485e,_0x258603){var _0x36d7e1={'loginAttempts':_0x1e7369,'blocked':_0x38485e};if(!_[_0x7b79('0xa')](_0x258603)){_0x36d7e1['blockedAt']=_0x258603;}return _0x15d58d[_0x7b79('0xb')](_0x36d7e1);};exports[_0x7b79('0xc')]=function(_0x3d33cf){return new BPromise(function(_0x5c0b5f,_0xf3b42d){var _0xceccbc=0x0;if(_0x3d33cf['role']!==_0x7b79('0xd')){_0x5c0b5f(_0x3d33cf);}db['User'][_0x7b79('0xe')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x3d33cf['id']}}})[_0x7b79('0xf')](function(_0x50591e){_0xceccbc=_0x50591e;return util[_0x7b79('0xc')]();})[_0x7b79('0xf')](function(_0x847a79){if(_0x847a79&&_0x847a79[_0x7b79('0x10')]&&_0xceccbc>=_0x847a79[_0x7b79('0x10')]){throw Error(_0x7b79('0x11'));}_0x5c0b5f(_0x3d33cf);})[_0x7b79('0x12')](function(_0x41b21c){_0xf3b42d(_0x41b21c);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 2bcd3c4..721efff 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Forbidden','OutOfInterval','status','exports','api','message','Internal\x20Server\x20Error','name','Bad\x20Request','inherits','Entity\x20not\x20found','Not\x20Found'];(function(_0x3f8701,_0xa2296d){var _0x236d0b=function(_0x4a7e17){while(--_0x4a7e17){_0x3f8701['push'](_0x3f8701['shift']());}};_0x236d0b(++_0xa2296d);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var util=require('util');var logger=require('../config/logger')(_0x49c4('0x0'));var APIError=function(_0x18bf2d,_0x26844b){this[_0x49c4('0x1')]=_0x18bf2d||_0x49c4('0x2');this[_0x49c4('0x3')]=_0x26844b||'Error';util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x41a183){this['message']=_0x41a183||_0x49c4('0x4');this[_0x49c4('0x3')]=_0x49c4('0x4');util[_0x49c4('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x436234){this['message']=_0x436234||_0x49c4('0x6');this[_0x49c4('0x3')]=_0x49c4('0x7');util[_0x49c4('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x4c7d3a){switch(_0x4c7d3a){case'Bad\x20Request':return 0x190;case _0x49c4('0x8'),_0x49c4('0x9'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0xb611a1){return function(_0x459d09){logger['error'](_0x459d09['stack']);var _0x1d19bf=getStatusCode(_0x459d09[_0x49c4('0x3')]);if(_0x459d09['name'])delete _0x459d09[_0x49c4('0x3')];return _0xb611a1[_0x49c4('0xa')](_0x1d19bf)['send'](_0x459d09);};}module[_0x49c4('0xb')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xf109=['status','exports','util','../config/logger','api','Internal\x20Server\x20Error','name','Error','inherits','message','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','stack'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0xf109,0xce));var _0x9f10=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xf109[_0x26462c];return _0x509a42;};'use strict';var util=require(_0x9f10('0x0'));var logger=require(_0x9f10('0x1'))(_0x9f10('0x2'));var APIError=function(_0x5d2950,_0x5b381d){this['message']=_0x5d2950||_0x9f10('0x3');this[_0x9f10('0x4')]=_0x5b381d||_0x9f10('0x5');util[_0x9f10('0x6')](APIError,Error);};var APIBadRequestError=function(_0x4027f4){this[_0x9f10('0x7')]=_0x4027f4||_0x9f10('0x8');this[_0x9f10('0x4')]=_0x9f10('0x8');util[_0x9f10('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x3fd82f){this['message']=_0x3fd82f||_0x9f10('0x9');this[_0x9f10('0x4')]=_0x9f10('0xa');util[_0x9f10('0x6')](APINotFoundError,APIError);};function getStatusCode(_0x325f22){switch(_0x325f22){case'Bad\x20Request':return 0x190;case _0x9f10('0xb'),_0x9f10('0xc'):return 0x193;case _0x9f10('0xa'):return 0x194;default:return 0x1f4;}}function handleError(_0x4e577d){return function(_0x50215f){logger[_0x9f10('0xd')](_0x50215f[_0x9f10('0xe')]);var _0x407336=getStatusCode(_0x50215f['name']);if(_0x50215f[_0x9f10('0x4')])delete _0x50215f[_0x9f10('0x4')];return _0x4e577d[_0x9f10('0xf')](_0x407336)['send'](_0x50215f);};}module[_0x9f10('0x10')]={'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 5be91f8..fc3861d 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84cd=['404','status','render','json','send'];(function(_0x43e61b,_0x3748c2){var _0x5a38b3=function(_0x5c4393){while(--_0x5c4393){_0x43e61b['push'](_0x43e61b['shift']());}};_0x5a38b3(++_0x3748c2);}(_0x84cd,0x1e0));var _0xd84c=function(_0x19ad4e,_0x1570cc){_0x19ad4e=_0x19ad4e-0x0;var _0x27484c=_0x84cd[_0x19ad4e];return _0x27484c;};'use strict';module['exports'][0x194]=function pageNotFound(_0x2c357c,_0x23566e){var _0x1e0b65=_0xd84c('0x0');var _0x171331=0x194;var _0x2d0111={'status':_0x171331};_0x23566e[_0xd84c('0x1')](_0x2d0111[_0xd84c('0x1')]);_0x23566e[_0xd84c('0x2')](_0x1e0b65,{},function(_0x22c5bb,_0x49f1d9){if(_0x22c5bb){return _0x23566e[_0xd84c('0x1')](_0x2d0111[_0xd84c('0x1')])[_0xd84c('0x3')](_0x2d0111);}_0x23566e[_0xd84c('0x4')](_0x49f1d9);});}; \ No newline at end of file +var _0x205d=['send','status','render','json'];(function(_0x51655a,_0x101434){var _0x544ccd=function(_0x2b99d6){while(--_0x2b99d6){_0x51655a['push'](_0x51655a['shift']());}};_0x544ccd(++_0x101434);}(_0x205d,0x1f1));var _0xd205=function(_0x4baf36,_0x4e3e17){_0x4baf36=_0x4baf36-0x0;var _0x5a029f=_0x205d[_0x4baf36];return _0x5a029f;};'use strict';module['exports'][0x194]=function pageNotFound(_0x3e6598,_0x8c1861){var _0x3a0d15='404';var _0x39b080=0x194;var _0x38b674={'status':_0x39b080};_0x8c1861[_0xd205('0x0')](_0x38b674[_0xd205('0x0')]);_0x8c1861[_0xd205('0x1')](_0x3a0d15,{},function(_0x37e486,_0x3b1383){if(_0x37e486){return _0x8c1861[_0xd205('0x0')](_0x38b674[_0xd205('0x0')])[_0xd205('0x2')](_0x38b674);}_0x8c1861[_0xd205('0x3')](_0x3b1383);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 35e6cee..b571ecc 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf593=['../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','VoiceMail','cascade','UserId','userSetting','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueue','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','Sounds','moh_has_sounds','CmHopper','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Interactions','Applications','List','ListId','mandatoryDispositionPauseId','team_has_mail_queues','MailMessage','Account','Tags','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','Interaction','ChatOfflineMessageId','TagId','MailQueueReport','Items','FaxAccountId','Exntensions','user_has_fax_accounts','FaxQueue','FaxInteractionId','Owner','fax_interaction_has_tags','AttachmentId','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','Attachments','team_has_chat_queues','Members','ChatProactiveAction','CmContactId','Company','CompanyId','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','All','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','CmHopperAdditionalPhone','Hopper','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','AnalyticMetric','MetricId','Configurations','SubjectId','Descriptions','AccountId','Subject','DescriptionId','Field','FieldId','VariableId','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','Description','DeskAccount','Subjects','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','ServicenowField','FreshsalesAccount','FreshsalesField','ToId','SessionId','ProjectId','team_has_fax_queues','team_has_whatsapp_queues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','ToAccount','ToFaxQueueId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','defaultsDeep','motion2','xcall','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','mysql','database','password','options','username','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../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','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf593,0xfc));var _0x3f59=function(_0x2f0948,_0x316355){_0x2f0948=_0x2f0948-0x0;var _0xec04bb=_0xf593[_0x2f0948];return _0xec04bb;};'use strict';var config=require(_0x3f59('0x0'));var Sequelize=require(_0x3f59('0x1'));var _=require(_0x3f59('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x3f59('0x1')]=_[_0x3f59('0x3')](config[_0x3f59('0x1')],{'database':_0x3f59('0x4'),'username':_0x3f59('0x5'),'password':'xC@LL1234','options':{'host':_0x3f59('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x3f59('0x7')},'logging':![],'timezone':timezone[_0x3f59('0x8')](),'define':{'charset':_0x3f59('0x9'),'collate':_0x3f59('0xa')}}});config[_0x3f59('0xb')]=_[_0x3f59('0x3')](config[_0x3f59('0xb')],{'database':_0x3f59('0x4'),'username':_0x3f59('0x5'),'password':_0x3f59('0xc'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x3f59('0xd'),'dialectOptions':{'charset':_0x3f59('0x7')},'logging':![],'timezone':timezone[_0x3f59('0x8')](),'define':{'charset':_0x3f59('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3f59('0x1')][_0x3f59('0xe')],config['sequelize']['username'],config[_0x3f59('0x1')][_0x3f59('0xf')],config[_0x3f59('0x1')][_0x3f59('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3f59('0xb')][_0x3f59('0xe')],config['sequelizeHistory'][_0x3f59('0x11')],config[_0x3f59('0xb')][_0x3f59('0xf')],config['sequelizeHistory']['options'])};db['User']=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x13'));db[_0x3f59('0x14')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x15'));db[_0x3f59('0x16')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/voiceContext/voiceContext.model');db[_0x3f59('0x17')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x18'));db[_0x3f59('0x19')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x3f59('0x1')]['import'](_0x3f59('0x1a'));db['VoiceRecording']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x1b'));db[_0x3f59('0x1c')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x1d'));db['VoiceMail']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x1e'));db['VoiceMailMessage']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x1f'));db[_0x3f59('0x20')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x21'));db[_0x3f59('0x22')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x23'));db[_0x3f59('0x24')]=db[_0x3f59('0x1')]['import']('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db['sequelize']['import'](_0x3f59('0x25'));db[_0x3f59('0x26')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/memberReport/memberReport.model');db[_0x3f59('0x27')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x28'));db['VoiceTransferReport']=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x3f59('0x29')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x2a'));db[_0x3f59('0x2b')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x2c'));db[_0x3f59('0x2d')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x2e'));db[_0x3f59('0x2f')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x30'));db[_0x3f59('0x31')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x32'));db['UserSmsQueue']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x33'));db['UserOpenchannelQueue']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x34'));db[_0x3f59('0x35')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x3f59('0x36')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x37'));db[_0x3f59('0x38')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x39'));db['MailAccount']=db[_0x3f59('0x1')]['import'](_0x3f59('0x3a'));db[_0x3f59('0x3b')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x3c'));db[_0x3f59('0x3d')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x3e'));db['MailInteraction']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x3f'));db['MailMessage']=db['sequelize']['import'](_0x3f59('0x40'));db[_0x3f59('0x41')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x42'));db['MailQueueReport']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x43'));db[_0x3f59('0x44')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/dashboard/dashboard.model');db[_0x3f59('0x45')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x46'));db[_0x3f59('0x47')]=db[_0x3f59('0x1')]['import'](_0x3f59('0x48'));db[_0x3f59('0x49')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x4a'));db[_0x3f59('0x4b')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x4c'));db[_0x3f59('0x4d')]=db[_0x3f59('0x1')]['import']('../api/faxMessage/faxMessage.model');db['FaxQueue']=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x4e'));db['FaxQueueReport']=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/faxQueueReport/faxQueueReport.model');db[_0x3f59('0x4f')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x50'));db[_0x3f59('0x51')]=db['sequelize'][_0x3f59('0x12')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/smsInteraction/smsInteraction.model');db[_0x3f59('0x52')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x53'));db[_0x3f59('0x54')]=db['sequelize']['import'](_0x3f59('0x55'));db['OpenchannelAccount']=db[_0x3f59('0x1')]['import'](_0x3f59('0x56'));db[_0x3f59('0x57')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db['sequelize']['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0x3f59('0x58')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x59'));db['OpenchannelQueue']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x5a'));db['ChatWebsite']=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x5b'));db[_0x3f59('0x5c')]=db[_0x3f59('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x3f59('0x5d')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x5e'));db[_0x3f59('0x5f')]=db['sequelize']['import'](_0x3f59('0x60'));db[_0x3f59('0x61')]=db[_0x3f59('0x1')]['import'](_0x3f59('0x62'));db[_0x3f59('0x63')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x3f59('0x64')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x65'));db[_0x3f59('0x66')]=db[_0x3f59('0x1')]['import'](_0x3f59('0x67'));db['ChatProactiveAction']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x68'));db[_0x3f59('0x69')]=db['sequelize'][_0x3f59('0x12')]('../api/cmCompany/cmCompany.model');db[_0x3f59('0x6a')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x6b'));db['CmHopper']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x6c'));db[_0x3f59('0x6d')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x6e'));db[_0x3f59('0x6f')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x70'));db['ReportAgentPreview']=db[_0x3f59('0x1')]['import'](_0x3f59('0x71'));db[_0x3f59('0x72')]=db['sequelize'][_0x3f59('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x3f59('0x73')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x74'));db[_0x3f59('0x75')]=db[_0x3f59('0x1')]['import'](_0x3f59('0x76'));db[_0x3f59('0x77')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x78'));db[_0x3f59('0x79')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x7a'));db[_0x3f59('0x7b')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x7c'));db['Interval']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x7d'));db[_0x3f59('0x7e')]=db['sequelize']['import'](_0x3f59('0x7f'));db[_0x3f59('0x80')]=db[_0x3f59('0x1')]['import'](_0x3f59('0x81'));db[_0x3f59('0x82')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x83'));db[_0x3f59('0x84')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x85'));db[_0x3f59('0x86')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x87'));db[_0x3f59('0x88')]=db['sequelize']['import'](_0x3f59('0x89'));db[_0x3f59('0x8a')]=db[_0x3f59('0x1')]['import'](_0x3f59('0x8b'));db[_0x3f59('0x8c')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x8d'));db['CmHopperAdditionalPhone']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x8e'));db[_0x3f59('0x8f')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x90'));db[_0x3f59('0x91')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x92'));db[_0x3f59('0x93')]=db[_0x3f59('0x1')]['import'](_0x3f59('0x94'));db[_0x3f59('0x95')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/integration/integration.model');db['IntegrationReport']=db[_0x3f59('0x1')]['import'](_0x3f59('0x96'));db[_0x3f59('0x97')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x98'));db['AnalyticDefaultReport']=db[_0x3f59('0x1')]['import'](_0x3f59('0x99'));db['AnalyticExtractedReport']=db[_0x3f59('0x1')]['import'](_0x3f59('0x9a'));db['AnalyticMetric']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x9b'));db['AnalyticFieldReport']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x9c'));db[_0x3f59('0x9d')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x9e'));db[_0x3f59('0x9f')]=db['sequelize'][_0x3f59('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x3f59('0xa0')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x3f59('0xa1')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xa2'));db['SugarcrmAccount']=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xa3'));db['SugarcrmField']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xa4'));db['DeskAccount']=db['sequelize']['import'](_0x3f59('0xa5'));db[_0x3f59('0xa6')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x3f59('0xa7')]=db[_0x3f59('0x1')]['import'](_0x3f59('0xa8'));db[_0x3f59('0xa9')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xaa'));db[_0x3f59('0xab')]=db['sequelize']['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x3f59('0xac')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xad'));db[_0x3f59('0xae')]=db[_0x3f59('0x1')]['import'](_0x3f59('0xaf'));db[_0x3f59('0xb0')]=db['sequelize'][_0x3f59('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x3f59('0xb1')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/intZendeskField/intZendeskField.model');db[_0x3f59('0xb2')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xb3'));db[_0x3f59('0xb4')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0xb5'));db[_0x3f59('0xb6')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x3f59('0xb7')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x3f59('0xb8')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0xb9'));db[_0x3f59('0xba')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xbb'));db[_0x3f59('0xbc')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xbd'));db[_0x3f59('0xbe')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0xbf'));db['ServicenowField']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xc0'));db[_0x3f59('0xc1')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xc2'));db[_0x3f59('0xc3')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x3f59('0xc4')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xc5'));db['FreshsalesAccount']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xc6'));db[_0x3f59('0xc7')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xc8'));db['FreshsalesField']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xc9'));db[_0x3f59('0x95')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xca'));db[_0x3f59('0xcb')]=db[_0x3f59('0x1')]['import'](_0x3f59('0xcc'));db[_0x3f59('0xcd')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/chatQueueReport/chatQueueReport.model');db[_0x3f59('0xce')]=db[_0x3f59('0x1')]['import'](_0x3f59('0xcf'));db[_0x3f59('0xd0')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xd1'));db[_0x3f59('0xd2')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x3f59('0xd3')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xd4'));db[_0x3f59('0xd5')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0xd6'));db['SquareReport']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xd7'));db[_0x3f59('0xd8')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xd9'));db[_0x3f59('0xda')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/jscriptyProject/jscriptyProject.model');db[_0x3f59('0xdb')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xdc'));db[_0x3f59('0xdd')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0xde'));db['SquareProject']=db['sequelize'][_0x3f59('0x12')](_0x3f59('0xdf'));db[_0x3f59('0xe0')]=db['sequelize'][_0x3f59('0x12')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xe1'));db[_0x3f59('0xe2')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xe3'));db[_0x3f59('0xe4')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xe5'));db[_0x3f59('0xe6')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0xe7'));db[_0x3f59('0xe8')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0xe9'));db[_0x3f59('0xea')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xeb'));db[_0x3f59('0xec')]=db[_0x3f59('0x1')]['import'](_0x3f59('0xed'));db[_0x3f59('0xee')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xef'));db['ChatTransferReport']=db[_0x3f59('0x1')]['import'](_0x3f59('0xf0'));db[_0x3f59('0xf1')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xf2'));db['OpenchannelTransferReport']=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xf3'));db[_0x3f59('0xf4')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0xf5'));db[_0x3f59('0xf6')]=db[_0x3f59('0x1')]['import'](_0x3f59('0xf7'));db[_0x3f59('0xf8')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0xf9'));db[_0x3f59('0xfa')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0xfb'));db[_0x3f59('0xfc')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0xfd'));db[_0x3f59('0xfe')]=db[_0x3f59('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db[_0x3f59('0xff')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x100'));db[_0x3f59('0x101')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/whatsappAccount/whatsappAccount.model');db[_0x3f59('0x102')]=db[_0x3f59('0x1')]['import'](_0x3f59('0x103'));db[_0x3f59('0x104')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x105'));db[_0x3f59('0x106')]=db[_0x3f59('0x1')][_0x3f59('0x12')](_0x3f59('0x107'));db[_0x3f59('0x108')]=db[_0x3f59('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x3f59('0x109')]=db[_0x3f59('0x1')]['import'](_0x3f59('0x10a'));db[_0x3f59('0x10b')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/whatsappQueue/whatsappQueue.model');db[_0x3f59('0x10c')]=db[_0x3f59('0x1')][_0x3f59('0x12')]('../api/cloudProvider/cloudProvider.model');db[_0x3f59('0x10d')]=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x10e'));db['TeamVoicePrefix']=db['sequelize'][_0x3f59('0x12')](_0x3f59('0x10f'));db[_0x3f59('0x110')]=db[_0x3f59('0x1')]['import'](_0x3f59('0x111'));db[_0x3f59('0x112')]=db[_0x3f59('0x1')]['import'](_0x3f59('0x113'));db[_0x3f59('0x114')][_0x3f59('0x115')](db[_0x3f59('0x116')],{'as':_0x3f59('0x116'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x118')});db[_0x3f59('0x114')][_0x3f59('0x115')](db[_0x3f59('0x112')],{'as':_0x3f59('0x119'),'onDelete':_0x3f59('0x117'),'foreignKey':'UserId'});db[_0x3f59('0x114')]['hasMany'](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0x3f59('0x118')});db['User'][_0x3f59('0x11a')](db[_0x3f59('0x29')],{'as':_0x3f59('0x11b'),'foreignKey':'UserId'});db[_0x3f59('0x114')][_0x3f59('0x11a')](db[_0x3f59('0x17')],{'as':_0x3f59('0x11c'),'onDelete':_0x3f59('0x117'),'hooks':!![]});db[_0x3f59('0x114')][_0x3f59('0x11a')](db[_0x3f59('0x11d')],{'as':_0x3f59('0x11e'),'foreignKey':_0x3f59('0x118')});db['User']['hasMany'](db['CmHopperHistory'],{'as':_0x3f59('0x11f'),'foreignKey':_0x3f59('0x118')});db[_0x3f59('0x114')][_0x3f59('0x11a')](db[_0x3f59('0x120')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x3f59('0x114')][_0x3f59('0x11a')](db[_0x3f59('0x121')],{'as':_0x3f59('0x122'),'foreignKey':'UserId'});db[_0x3f59('0x114')][_0x3f59('0x11a')](db[_0x3f59('0x5f')],{'as':_0x3f59('0x123'),'foreignKey':_0x3f59('0x118')});db['User'][_0x3f59('0x11a')](db[_0x3f59('0x124')],{'as':_0x3f59('0x125'),'foreignKey':'UserId'});db[_0x3f59('0x114')][_0x3f59('0x11a')](db[_0x3f59('0x4b')],{'as':'FaxInteractions','foreignKey':_0x3f59('0x118')});db[_0x3f59('0x114')][_0x3f59('0x11a')](db[_0x3f59('0x126')],{'as':_0x3f59('0x127'),'foreignKey':'UserId'});db[_0x3f59('0x114')]['hasMany'](db[_0x3f59('0x104')],{'as':_0x3f59('0x128'),'foreignKey':_0x3f59('0x118')});db['User']['hasMany'](db[_0x3f59('0xff')],{'as':_0x3f59('0x129'),'foreignKey':_0x3f59('0x12a')});db[_0x3f59('0x114')]['belongsTo'](db[_0x3f59('0xfa')],{'as':_0x3f59('0xfa'),'foreignKey':_0x3f59('0x12b')});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0x66')],{'as':_0x3f59('0x12d'),'through':_0x3f59('0x12e')});db[_0x3f59('0x114')][_0x3f59('0x12c')](db['CmContact'],{'as':_0x3f59('0x12f'),'through':_0x3f59('0x130')});db[_0x3f59('0x114')]['belongsToMany'](db[_0x3f59('0xf6')],{'as':_0x3f59('0x131'),'through':_0x3f59('0x132')});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0xe2')],{'through':_0x3f59('0x133')});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0x126')],{'as':_0x3f59('0x127'),'through':_0x3f59('0x134')});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0x5f')],{'as':_0x3f59('0x123'),'through':'user_has_chat_interactions'});db[_0x3f59('0x114')]['belongsToMany'](db[_0x3f59('0x4b')],{'as':_0x3f59('0x135'),'through':_0x3f59('0x136')});db[_0x3f59('0x114')]['belongsToMany'](db[_0x3f59('0x124')],{'as':_0x3f59('0x125'),'through':'user_has_sms_interactions'});db['User'][_0x3f59('0x12c')](db[_0x3f59('0x121')],{'as':_0x3f59('0x122'),'through':_0x3f59('0x137')});db['User'][_0x3f59('0x12c')](db[_0x3f59('0x104')],{'as':'WhatsappInteractions','through':_0x3f59('0x138')});db['User'][_0x3f59('0x12c')](db[_0x3f59('0x139')],{'as':_0x3f59('0x13a'),'through':_0x3f59('0x2b'),'required':![]});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0xf8')],{'as':_0x3f59('0x13b'),'through':_0x3f59('0x110'),'required':![]});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0x3b')],{'as':_0x3f59('0x13c'),'through':_0x3f59('0x2f'),'required':![]});db[_0x3f59('0x114')]['belongsToMany'](db[_0x3f59('0x64')],{'as':_0x3f59('0x13d'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x3f59('0x114')][_0x3f59('0x12c')](db['FaxQueue'],{'as':_0x3f59('0x13e'),'through':_0x3f59('0x31'),'required':![]});db[_0x3f59('0x114')]['belongsToMany'](db[_0x3f59('0x54')],{'as':_0x3f59('0x13f'),'through':_0x3f59('0x140'),'required':![]});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0x141')],{'as':_0x3f59('0x142'),'through':_0x3f59('0x143'),'required':![]});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0x10b')],{'as':_0x3f59('0x144'),'through':'UserWhatsappQueue','required':![]});db[_0x3f59('0x114')][_0x3f59('0x12c')](db['CmList'],{'through':'cm_user_has_lists'});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0x145')],{'as':_0x3f59('0x146'),'through':_0x3f59('0x147')});db['User'][_0x3f59('0x12c')](db['FaxAccount'],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0x148')],{'as':_0x3f59('0x149'),'through':_0x3f59('0x14a')});db[_0x3f59('0x114')]['belongsToMany'](db[_0x3f59('0x14b')],{'as':'OpenchannelAccounts','through':_0x3f59('0x14c')});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0x4f')],{'as':'SmsAccounts','through':_0x3f59('0x14d')});db['User'][_0x3f59('0x12c')](db[_0x3f59('0x101')],{'as':_0x3f59('0x14e'),'through':'user_has_whatsapp_accounts'});db[_0x3f59('0x114')][_0x3f59('0x12c')](db[_0x3f59('0x14f')],{'as':_0x3f59('0x150'),'through':_0x3f59('0x151')});db[_0x3f59('0x14')][_0x3f59('0x11a')](db[_0x3f59('0x17')],{'as':_0x3f59('0x152'),'onDelete':_0x3f59('0x117'),'foreignKey':'ChanSpyId'});db['VoiceContext'][_0x3f59('0x11a')](db[_0x3f59('0x17')],{'onDelete':_0x3f59('0x117')});db[_0x3f59('0x17')][_0x3f59('0x11a')](db[_0x3f59('0x17')],{'as':'Applications','onDelete':_0x3f59('0x117')});db['VoiceMusicOnHold']['belongsToMany'](db['Sound'],{'as':_0x3f59('0x153'),'through':_0x3f59('0x154')});db[_0x3f59('0x139')][_0x3f59('0x11a')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0x3f59('0x139')][_0x3f59('0x11a')](db[_0x3f59('0x155')],{'as':_0x3f59('0x156'),'foreignKey':_0x3f59('0x157')});db[_0x3f59('0x139')]['hasMany'](db[_0x3f59('0x11d')],{'as':_0x3f59('0x11e'),'foreignKey':_0x3f59('0x157')});db[_0x3f59('0x139')][_0x3f59('0x11a')](db[_0x3f59('0x6f')],{'as':_0x3f59('0x158'),'foreignKey':_0x3f59('0x157')});db[_0x3f59('0x139')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x3f59('0x157')});db[_0x3f59('0x139')][_0x3f59('0x11a')](db['CmHopperBlack'],{'as':_0x3f59('0x159'),'foreignKey':_0x3f59('0x157')});db['VoiceQueue'][_0x3f59('0x11a')](db['JscriptySessionReport'],{'as':_0x3f59('0x15a'),'foreignKey':_0x3f59('0x157')});db[_0x3f59('0x139')][_0x3f59('0x15b')](db[_0x3f59('0x27')],{'as':'Trunk','foreignKey':_0x3f59('0x15c')});db[_0x3f59('0x139')]['belongsTo'](db[_0x3f59('0x27')],{'as':_0x3f59('0x15d'),'foreignKey':_0x3f59('0x15e')});db[_0x3f59('0x139')][_0x3f59('0x15b')](db[_0x3f59('0x15f')],{'as':_0x3f59('0x15f'),'foreignKey':_0x3f59('0x160')});db[_0x3f59('0x139')][_0x3f59('0x15b')](db[_0x3f59('0x7e')],{'as':_0x3f59('0x161'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3f59('0x139')][_0x3f59('0x12c')](db[_0x3f59('0xf6')],{'as':_0x3f59('0x131'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x162'),'through':_0x3f59('0x2b')});db[_0x3f59('0x139')]['belongsToMany'](db[_0x3f59('0xe2')],{'as':_0x3f59('0x163'),'through':_0x3f59('0x10d')});db['VoiceQueue'][_0x3f59('0x12c')](db[_0x3f59('0xf6')],{'as':_0x3f59('0x164'),'through':_0x3f59('0x165')});db['VoiceRecording'][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'as':'User','foreignKey':'UserId'});db[_0x3f59('0x1c')][_0x3f59('0x15b')](db['User'],{'as':_0x3f59('0x114'),'foreignKey':_0x3f59('0x118')});db[_0x3f59('0x116')][_0x3f59('0x11a')](db[_0x3f59('0x166')],{'as':_0x3f59('0x167'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x168'),'sourceKey':'mailbox'});db[_0x3f59('0x166')]['belongsTo'](db[_0x3f59('0x116')],{'foreignKey':_0x3f59('0x168'),'targetKey':_0x3f59('0x169')});db[_0x3f59('0x20')][_0x3f59('0x11a')](db[_0x3f59('0x16a')],{'as':_0x3f59('0x16b'),'foreignKey':_0x3f59('0x16c'),'constraints':![]});db[_0x3f59('0x20')][_0x3f59('0x11a')](db[_0x3f59('0x24')],{'as':_0x3f59('0x16d'),'foreignKey':'uniqueid','constraints':![]});db[_0x3f59('0x20')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'as':_0x3f59('0x114'),'foreignKey':_0x3f59('0x118')});db[_0x3f59('0x20')]['belongsTo'](db['CmContact'],{'as':_0x3f59('0x16e'),'foreignKey':_0x3f59('0x16f')});db[_0x3f59('0x36')][_0x3f59('0x15b')](db[_0x3f59('0x148')],{'as':_0x3f59('0x148'),'foreignKey':'MailAccountId'});db[_0x3f59('0x36')]['belongsTo'](db[_0x3f59('0x10c')],{'as':_0x3f59('0x10c'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0x3f59('0x38')][_0x3f59('0x15b')](db['MailAccount'],{'as':_0x3f59('0x148'),'foreignKey':_0x3f59('0x170')});db[_0x3f59('0x38')]['belongsTo'](db[_0x3f59('0x10c')],{'as':_0x3f59('0x10c'),'foreignKey':_0x3f59('0x171'),'onDelete':_0x3f59('0x172')});db['MailAccount'][_0x3f59('0x115')](db[_0x3f59('0x36')],{'as':_0x3f59('0x173'),'onDelete':_0x3f59('0x117')});db[_0x3f59('0x148')][_0x3f59('0x115')](db[_0x3f59('0x38')],{'as':_0x3f59('0x174'),'onDelete':'cascade'});db['MailAccount'][_0x3f59('0x11a')](db[_0x3f59('0x79')],{'as':_0x3f59('0x175'),'foreignKey':'MailAccountId','onDelete':_0x3f59('0x117')});db[_0x3f59('0x148')][_0x3f59('0x11a')](db[_0x3f59('0x77')],{'as':_0x3f59('0x176'),'foreignKey':'MailAccountId'});db[_0x3f59('0x148')][_0x3f59('0x11a')](db['MailMessage'],{'as':_0x3f59('0x167'),'foreignKey':'MailAccountId'});db[_0x3f59('0x148')][_0x3f59('0x11a')](db[_0x3f59('0x126')],{'as':_0x3f59('0x177')});db['MailAccount'][_0x3f59('0x11a')](db[_0x3f59('0x41')],{'as':_0x3f59('0x178')});db[_0x3f59('0x148')][_0x3f59('0x15b')](db['CmList'],{'as':_0x3f59('0x179'),'foreignKey':_0x3f59('0x17a')});db['MailAccount'][_0x3f59('0x15b')](db[_0x3f59('0x8f')],{'as':_0x3f59('0x8f'),'foreignKey':'TemplateId'});db[_0x3f59('0x148')][_0x3f59('0x15b')](db[_0x3f59('0x7e')],{'as':_0x3f59('0x161'),'foreignKey':_0x3f59('0x17b')});db['MailAccount']['belongsToMany'](db[_0x3f59('0x114')],{'as':_0x3f59('0x162'),'through':_0x3f59('0x14a')});db['MailQueue']['belongsToMany'](db[_0x3f59('0x114')],{'as':'Agents','through':_0x3f59('0x2f')});db[_0x3f59('0x3b')][_0x3f59('0x12c')](db[_0x3f59('0xe2')],{'through':_0x3f59('0x17c'),'as':_0x3f59('0x163')});db[_0x3f59('0x126')][_0x3f59('0x11a')](db[_0x3f59('0x17d')],{'as':'Messages','onDelete':_0x3f59('0x117'),'foreignKey':'MailInteractionId'});db[_0x3f59('0x126')]['belongsTo'](db[_0x3f59('0x148')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x170')});db[_0x3f59('0x126')][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'as':_0x3f59('0x16e'),'foreignKey':'ContactId'});db['MailInteraction'][_0x3f59('0x15b')](db['User'],{'as':'Owner','foreignKey':_0x3f59('0x118')});db[_0x3f59('0x126')][_0x3f59('0x12c')](db[_0x3f59('0x88')],{'through':'mail_interaction_has_tags','as':_0x3f59('0x17f')});db[_0x3f59('0x126')][_0x3f59('0x12c')](db[_0x3f59('0x88')],{'through':_0x3f59('0x180'),'as':_0x3f59('0x181')});db['MailInteraction'][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x182'),'through':'user_has_mail_interactions','foreignKey':_0x3f59('0x183')});db[_0x3f59('0x17d')][_0x3f59('0x11a')](db[_0x3f59('0xea')],{'as':'Attachments','onDelete':_0x3f59('0x117')});db['MailMessage'][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'as':_0x3f59('0x114')});db['MailMessage'][_0x3f59('0x15b')](db['CmContact'],{'onDelete':_0x3f59('0x117'),'as':'Contact'});db[_0x3f59('0x17d')][_0x3f59('0x15b')](db[_0x3f59('0x126')],{'as':_0x3f59('0x184'),'foreignKey':_0x3f59('0x183')});db[_0x3f59('0x17d')][_0x3f59('0x15b')](db['MailAccount'],{'as':_0x3f59('0x17e'),'foreignKey':'MailAccountId'});db['MailMessage'][_0x3f59('0x15b')](db[_0x3f59('0x145')],{'as':_0x3f59('0x145'),'foreignKey':'ChatWebsiteId'});db[_0x3f59('0x17d')][_0x3f59('0x15b')](db[_0x3f59('0x63')],{'as':_0x3f59('0x63'),'foreignKey':_0x3f59('0x185')});db[_0x3f59('0x41')][_0x3f59('0x15b')](db['User'],{'onDelete':'restrict'});db['MailApplication'][_0x3f59('0x15b')](db[_0x3f59('0x3b')],{'onDelete':_0x3f59('0x172')});db[_0x3f59('0x41')][_0x3f59('0x15b')](db[_0x3f59('0x148')],{'onDelete':_0x3f59('0x172')});db['MailApplication'][_0x3f59('0x15b')](db[_0x3f59('0x15f')],{'onDelete':_0x3f59('0x172'),'foreignKey':'IntervalId'});db['MailApplication']['belongsTo'](db['Tag'],{'onDelete':_0x3f59('0x172'),'foreignKey':_0x3f59('0x186')});db[_0x3f59('0x187')][_0x3f59('0x15b')](db['MailAccount'],{});db['MailQueueReport'][_0x3f59('0x15b')](db[_0x3f59('0xf6')],{'as':_0x3f59('0x179'),'foreignKey':_0x3f59('0x17a')});db[_0x3f59('0x187')][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'as':_0x3f59('0x16e'),'foreignKey':'ContactId'});db[_0x3f59('0x187')][_0x3f59('0x15b')](db['MailInteraction'],{});db[_0x3f59('0x187')][_0x3f59('0x15b')](db['MailMessage'],{});db[_0x3f59('0x187')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{});db[_0x3f59('0x187')][_0x3f59('0x15b')](db['MailQueue'],{});db[_0x3f59('0x44')][_0x3f59('0x11a')](db[_0x3f59('0x45')],{'as':_0x3f59('0x188'),'onDelete':_0x3f59('0x117')});db[_0x3f59('0x47')][_0x3f59('0x11a')](db[_0x3f59('0x79')],{'as':_0x3f59('0x175'),'foreignKey':'FaxAccountId','onDelete':_0x3f59('0x117')});db[_0x3f59('0x47')][_0x3f59('0x11a')](db[_0x3f59('0x77')],{'as':_0x3f59('0x176'),'foreignKey':_0x3f59('0x189')});db[_0x3f59('0x47')][_0x3f59('0x11a')](db[_0x3f59('0x4b')],{'as':_0x3f59('0x177')});db['FaxAccount'][_0x3f59('0x11a')](db['FaxApplication'],{'as':'Applications'});db[_0x3f59('0x47')]['hasMany'](db[_0x3f59('0x17')],{'as':_0x3f59('0x18a'),'onDelete':'cascade'});db[_0x3f59('0x47')][_0x3f59('0x11a')](db[_0x3f59('0x4d')],{'as':_0x3f59('0x167')});db[_0x3f59('0x47')][_0x3f59('0x15b')](db['Trunk'],{'as':'Trunk'});db[_0x3f59('0x47')][_0x3f59('0x15b')](db[_0x3f59('0xf6')],{'as':'List','foreignKey':_0x3f59('0x17a')});db[_0x3f59('0x47')][_0x3f59('0x15b')](db['Pause'],{'as':_0x3f59('0x161'),'foreignKey':_0x3f59('0x17b')});db[_0x3f59('0x47')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x162'),'through':_0x3f59('0x18b')});db[_0x3f59('0x49')][_0x3f59('0x15b')](db['User'],{'onDelete':_0x3f59('0x172')});db[_0x3f59('0x49')][_0x3f59('0x15b')](db[_0x3f59('0x18c')],{'onDelete':_0x3f59('0x172')});db[_0x3f59('0x49')][_0x3f59('0x15b')](db[_0x3f59('0x47')],{'onDelete':_0x3f59('0x172')});db[_0x3f59('0x49')][_0x3f59('0x15b')](db['Tag'],{'onDelete':_0x3f59('0x172'),'foreignKey':_0x3f59('0x186')});db[_0x3f59('0x4b')][_0x3f59('0x11a')](db[_0x3f59('0x4d')],{'as':_0x3f59('0x167'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x18d')});db[_0x3f59('0x4b')][_0x3f59('0x15b')](db['FaxAccount'],{'as':'Account','foreignKey':_0x3f59('0x189')});db[_0x3f59('0x4b')][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'as':'Contact','foreignKey':_0x3f59('0x16f')});db[_0x3f59('0x4b')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'as':_0x3f59('0x18e'),'foreignKey':_0x3f59('0x118')});db['FaxInteraction']['belongsToMany'](db[_0x3f59('0x88')],{'through':_0x3f59('0x18f'),'as':_0x3f59('0x17f')});db['FaxInteraction'][_0x3f59('0x12c')](db[_0x3f59('0x88')],{'through':_0x3f59('0x18f'),'as':_0x3f59('0x181')});db[_0x3f59('0x4b')][_0x3f59('0x12c')](db['User'],{'as':_0x3f59('0x182'),'through':_0x3f59('0x136'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'onDelete':_0x3f59('0x117'),'as':_0x3f59('0x114')});db[_0x3f59('0x4d')]['belongsTo'](db[_0x3f59('0x4b')],{'as':_0x3f59('0x184'),'foreignKey':_0x3f59('0x18d')});db[_0x3f59('0x4d')][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'onDelete':_0x3f59('0x117'),'as':_0x3f59('0x16e')});db[_0x3f59('0x4d')]['belongsTo'](db[_0x3f59('0xea')],{'as':'Attachment','foreignKey':_0x3f59('0x190')});db[_0x3f59('0x4d')]['belongsTo'](db[_0x3f59('0x47')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x189')});db[_0x3f59('0x18c')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x162'),'through':_0x3f59('0x31')});db[_0x3f59('0x18c')]['belongsToMany'](db[_0x3f59('0xe2')],{'through':'team_has_fax_queues','as':'Teams'});db['FaxQueueReport'][_0x3f59('0x15b')](db[_0x3f59('0x47')],{});db['FaxQueueReport']['belongsTo'](db[_0x3f59('0xf6')],{'as':_0x3f59('0x179'),'foreignKey':_0x3f59('0x17a')});db[_0x3f59('0x191')][_0x3f59('0x15b')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x3f59('0x191')][_0x3f59('0x15b')](db['FaxInteraction'],{});db[_0x3f59('0x191')][_0x3f59('0x15b')](db[_0x3f59('0x4d')],{});db[_0x3f59('0x191')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{});db['FaxQueueReport'][_0x3f59('0x15b')](db[_0x3f59('0x18c')],{});db[_0x3f59('0x4f')][_0x3f59('0x11a')](db[_0x3f59('0x79')],{'as':_0x3f59('0x175'),'foreignKey':_0x3f59('0x192'),'onDelete':_0x3f59('0x117')});db[_0x3f59('0x4f')][_0x3f59('0x11a')](db[_0x3f59('0x77')],{'as':_0x3f59('0x176'),'foreignKey':'SmsAccountId'});db[_0x3f59('0x4f')][_0x3f59('0x11a')](db['SmsMessage'],{'as':_0x3f59('0x167'),'foreignKey':_0x3f59('0x192')});db['SmsAccount']['hasMany'](db[_0x3f59('0x124')],{'as':_0x3f59('0x177')});db[_0x3f59('0x4f')][_0x3f59('0x11a')](db['SmsApplication'],{'as':_0x3f59('0x178')});db[_0x3f59('0x4f')]['belongsTo'](db['CmList'],{'as':_0x3f59('0x179'),'foreignKey':'ListId'});db[_0x3f59('0x4f')][_0x3f59('0x15b')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x3f59('0x17b')});db[_0x3f59('0x4f')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x162'),'through':_0x3f59('0x14d')});db[_0x3f59('0x51')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'onDelete':_0x3f59('0x172')});db[_0x3f59('0x51')][_0x3f59('0x15b')](db[_0x3f59('0x54')],{'onDelete':'restrict'});db[_0x3f59('0x51')]['belongsTo'](db[_0x3f59('0x4f')],{'onDelete':_0x3f59('0x172')});db[_0x3f59('0x51')][_0x3f59('0x15b')](db[_0x3f59('0x15f')],{'onDelete':_0x3f59('0x172'),'foreignKey':_0x3f59('0x160')});db[_0x3f59('0x51')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x3f59('0x186')});db[_0x3f59('0x124')]['hasMany'](db[_0x3f59('0x52')],{'as':_0x3f59('0x167'),'onDelete':'cascade','foreignKey':_0x3f59('0x193')});db[_0x3f59('0x124')][_0x3f59('0x15b')](db[_0x3f59('0x4f')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x192')});db['SmsInteraction'][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'as':_0x3f59('0x16e'),'foreignKey':_0x3f59('0x16f')});db[_0x3f59('0x124')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'as':_0x3f59('0x18e'),'foreignKey':_0x3f59('0x118')});db[_0x3f59('0x124')][_0x3f59('0x12c')](db['Tag'],{'through':_0x3f59('0x194'),'as':_0x3f59('0x17f')});db['SmsInteraction'][_0x3f59('0x12c')](db[_0x3f59('0x88')],{'through':'sms_interaction_has_tags','as':_0x3f59('0x181')});db[_0x3f59('0x124')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x182'),'through':_0x3f59('0x195'),'foreignKey':'SmsInteractionId'});db[_0x3f59('0x52')][_0x3f59('0x15b')](db['User'],{'as':_0x3f59('0x114')});db[_0x3f59('0x52')]['belongsTo'](db[_0x3f59('0x6a')],{'onDelete':_0x3f59('0x117'),'as':_0x3f59('0x16e')});db[_0x3f59('0x52')]['belongsTo'](db[_0x3f59('0x124')],{'onDelete':'cascade','as':_0x3f59('0x184'),'foreignKey':_0x3f59('0x193')});db['SmsMessage'][_0x3f59('0x15b')](db[_0x3f59('0x4f')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x192')});db[_0x3f59('0x54')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':'Agents','through':'UserSmsQueue','foreignKey':'SmsQueueId'});db['SmsQueue']['belongsToMany'](db[_0x3f59('0xe2')],{'through':_0x3f59('0x196'),'as':_0x3f59('0x163')});db[_0x3f59('0x14b')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x3f59('0x197'),'onDelete':'cascade'});db['OpenchannelAccount'][_0x3f59('0x11a')](db['CannedAnswer'],{'as':_0x3f59('0x176'),'foreignKey':_0x3f59('0x197')});db['OpenchannelAccount'][_0x3f59('0x11a')](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0x3f59('0x197')});db['OpenchannelAccount'][_0x3f59('0x11a')](db[_0x3f59('0x58')],{'as':_0x3f59('0x167'),'foreignKey':_0x3f59('0x197')});db[_0x3f59('0x14b')][_0x3f59('0x11a')](db[_0x3f59('0x57')],{'as':_0x3f59('0x178'),'foreignKey':'OpenchannelAccountId'});db[_0x3f59('0x14b')][_0x3f59('0x15b')](db[_0x3f59('0xf6')],{'as':'List','foreignKey':'ListId'});db[_0x3f59('0x14b')][_0x3f59('0x15b')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount']['belongsToMany'](db[_0x3f59('0x114')],{'as':_0x3f59('0x162'),'through':_0x3f59('0x14c')});db[_0x3f59('0x57')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'onDelete':_0x3f59('0x172')});db[_0x3f59('0x57')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x3f59('0x172'),'foreignKey':_0x3f59('0x198')});db['OpenchannelApplication'][_0x3f59('0x15b')](db[_0x3f59('0x14b')],{'onDelete':_0x3f59('0x172'),'foreignKey':_0x3f59('0x197')});db['OpenchannelApplication'][_0x3f59('0x15b')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x3f59('0x160')});db['OpenchannelApplication']['belongsTo'](db[_0x3f59('0x88')],{'onDelete':_0x3f59('0x172'),'foreignKey':_0x3f59('0x186')});db[_0x3f59('0x121')][_0x3f59('0x11a')](db[_0x3f59('0x58')],{'as':_0x3f59('0x167'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x199')});db[_0x3f59('0x121')]['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x3f59('0x197')});db['OpenchannelInteraction'][_0x3f59('0x15b')](db['CmContact'],{'as':_0x3f59('0x16e'),'foreignKey':_0x3f59('0x16f')});db[_0x3f59('0x121')][_0x3f59('0x15b')](db['User'],{'as':_0x3f59('0x18e'),'foreignKey':_0x3f59('0x118')});db[_0x3f59('0x121')]['belongsToMany'](db[_0x3f59('0x88')],{'through':'openchannel_interaction_has_tags','as':_0x3f59('0x17f')});db[_0x3f59('0x121')][_0x3f59('0x12c')](db['Tag'],{'through':_0x3f59('0x19a'),'as':_0x3f59('0x181')});db[_0x3f59('0x121')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':'Users','through':_0x3f59('0x137'),'foreignKey':_0x3f59('0x199')});db['OpenchannelMessage']['belongsTo'](db[_0x3f59('0x114')],{'onDelete':_0x3f59('0x117'),'as':_0x3f59('0x114')});db['OpenchannelMessage'][_0x3f59('0x15b')](db['CmContact'],{'onDelete':_0x3f59('0x117'),'as':'Contact'});db[_0x3f59('0x58')][_0x3f59('0x15b')](db[_0x3f59('0x121')],{'onDelete':_0x3f59('0x117'),'as':_0x3f59('0x184'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x3f59('0x15b')](db['Attachment'],{'as':_0x3f59('0xea'),'foreignKey':'AttachmentId'});db[_0x3f59('0x58')]['belongsTo'](db[_0x3f59('0x14b')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x197')});db[_0x3f59('0x141')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x162'),'through':_0x3f59('0x143'),'foreignKey':_0x3f59('0x198')});db['OpenchannelQueue']['belongsToMany'](db['Team'],{'through':_0x3f59('0x19b'),'as':_0x3f59('0x163')});db[_0x3f59('0x145')]['hasMany'](db[_0x3f59('0x79')],{'as':_0x3f59('0x175'),'foreignKey':_0x3f59('0x19c'),'onDelete':_0x3f59('0x117')});db[_0x3f59('0x145')][_0x3f59('0x11a')](db[_0x3f59('0x77')],{'as':'Answers','foreignKey':_0x3f59('0x19c')});db[_0x3f59('0x145')][_0x3f59('0x11a')](db['ChatProactiveAction'],{'as':_0x3f59('0x19d')});db['ChatWebsite']['hasMany'](db['ChatInteraction'],{'as':_0x3f59('0x177')});db[_0x3f59('0x145')][_0x3f59('0x11a')](db[_0x3f59('0x5d')],{'as':_0x3f59('0x178')});db[_0x3f59('0x145')]['hasMany'](db[_0x3f59('0x61')],{'as':_0x3f59('0x167')});db[_0x3f59('0x145')]['belongsTo'](db[_0x3f59('0xf6')],{'as':_0x3f59('0x179'),'foreignKey':_0x3f59('0x17a')});db['ChatWebsite']['belongsTo'](db[_0x3f59('0x15f')],{'as':_0x3f59('0x15f'),'foreignKey':'IntervalId'});db[_0x3f59('0x145')][_0x3f59('0x15b')](db['MailAccount'],{'as':_0x3f59('0x148'),'foreignKey':'MailAccountId'});db[_0x3f59('0x145')][_0x3f59('0x15b')](db[_0x3f59('0x7e')],{'as':_0x3f59('0x161'),'foreignKey':_0x3f59('0x17b')});db[_0x3f59('0x145')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x162'),'through':_0x3f59('0x147')});db[_0x3f59('0x5c')]['belongsTo'](db[_0x3f59('0x14b')],{});db[_0x3f59('0x5c')][_0x3f59('0x15b')](db[_0x3f59('0xf6')],{'as':_0x3f59('0x179'),'foreignKey':'ListId'});db[_0x3f59('0x5c')][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'as':'Contact','foreignKey':_0x3f59('0x16f')});db[_0x3f59('0x5c')][_0x3f59('0x15b')](db['OpenchannelInteraction'],{});db[_0x3f59('0x5c')][_0x3f59('0x15b')](db[_0x3f59('0x58')],{});db[_0x3f59('0x5c')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x3f59('0x141')],{});db[_0x3f59('0x5d')][_0x3f59('0x15b')](db['User'],{'as':_0x3f59('0x19e'),'foreignKey':_0x3f59('0x118'),'onDelete':'restrict'});db[_0x3f59('0x5d')]['belongsTo'](db[_0x3f59('0x64')],{'as':_0x3f59('0x19f'),'foreignKey':_0x3f59('0x1a0'),'onDelete':'restrict'});db[_0x3f59('0x5d')][_0x3f59('0x15b')](db['ChatWebsite'],{'as':_0x3f59('0x1a1'),'foreignKey':_0x3f59('0x19c'),'onDelete':_0x3f59('0x172')});db[_0x3f59('0x5d')][_0x3f59('0x15b')](db[_0x3f59('0x88')],{'onDelete':_0x3f59('0x172'),'foreignKey':'TagId'});db['ChatInteraction']['hasMany'](db['ChatMessage'],{'as':_0x3f59('0x167'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1a2')});db['ChatInteraction'][_0x3f59('0x15b')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x3f59('0x19c')});db[_0x3f59('0x5f')][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'as':'Contact','foreignKey':'ContactId'});db[_0x3f59('0x5f')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'as':_0x3f59('0x18e'),'foreignKey':'UserId'});db[_0x3f59('0x5f')][_0x3f59('0x12c')](db[_0x3f59('0x88')],{'through':_0x3f59('0x1a3'),'as':'Tags'});db[_0x3f59('0x5f')][_0x3f59('0x12c')](db['Tag'],{'through':_0x3f59('0x1a3'),'as':_0x3f59('0x181')});db[_0x3f59('0x5f')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x182'),'through':_0x3f59('0x1a4'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'onDelete':_0x3f59('0x117'),'as':_0x3f59('0x114')});db[_0x3f59('0x61')][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'onDelete':'cascade','as':_0x3f59('0x16e'),'foreignKey':_0x3f59('0x16f')});db[_0x3f59('0x61')][_0x3f59('0x15b')](db[_0x3f59('0x5f')],{'onDelete':_0x3f59('0x117'),'as':'Interaction','foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x3f59('0x15b')](db[_0x3f59('0xea')],{'as':_0x3f59('0xea'),'foreignKey':_0x3f59('0x190')});db[_0x3f59('0x61')][_0x3f59('0x15b')](db[_0x3f59('0x145')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x19c')});db[_0x3f59('0x63')]['hasMany'](db[_0x3f59('0xea')],{'as':_0x3f59('0x1a5'),'foreignKey':_0x3f59('0x185'),'onDelete':_0x3f59('0x117'),'hooks':!![]});db['ChatOfflineMessage'][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'onDelete':'cascade','as':_0x3f59('0x16e'),'foreignKey':_0x3f59('0x16f')});db[_0x3f59('0x63')]['belongsTo'](db[_0x3f59('0x145')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x19c')});db[_0x3f59('0x64')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':'Agents','through':_0x3f59('0x2d'),'hooks':!![]});db[_0x3f59('0x64')]['belongsToMany'](db[_0x3f59('0xe2')],{'through':_0x3f59('0x1a6'),'as':_0x3f59('0x163')});db[_0x3f59('0x66')]['hasMany'](db[_0x3f59('0xce')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0x3f59('0x117')});db[_0x3f59('0x66')][_0x3f59('0x12c')](db['User'],{'as':_0x3f59('0x1a7'),'through':_0x3f59('0x12e')});db[_0x3f59('0x1a8')][_0x3f59('0x15b')](db[_0x3f59('0x145')],{'as':_0x3f59('0x1a1'),'foreignKey':_0x3f59('0x19c')});db[_0x3f59('0x69')]['hasMany'](db['CmContact'],{'as':_0x3f59('0x12f'),'foreignKey':'CompanyId'});db[_0x3f59('0x6a')][_0x3f59('0x11a')](db[_0x3f59('0x8c')],{'as':'Phones','foreignKey':_0x3f59('0x1a9')});db[_0x3f59('0x6a')][_0x3f59('0x11a')](db['CmHopper'],{'as':_0x3f59('0x156'),'foreignKey':_0x3f59('0x16f')});db[_0x3f59('0x6a')][_0x3f59('0x11a')](db[_0x3f59('0x11d')],{'as':_0x3f59('0x11e'),'foreignKey':_0x3f59('0x16f')});db[_0x3f59('0x6a')][_0x3f59('0x11a')](db['CmHopperHistory'],{'as':_0x3f59('0x158'),'foreignKey':_0x3f59('0x16f')});db[_0x3f59('0x6a')][_0x3f59('0x11a')](db[_0x3f59('0x120')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db['CmContact'][_0x3f59('0x11a')](db[_0x3f59('0xd3')],{'as':_0x3f59('0x15a'),'foreignKey':'ContactId'});db[_0x3f59('0x6a')][_0x3f59('0x11a')](db['OpenchannelInteraction'],{'as':_0x3f59('0x122'),'foreignKey':'ContactId','onDelete':_0x3f59('0x172')});db[_0x3f59('0x6a')][_0x3f59('0x11a')](db[_0x3f59('0x5f')],{'as':'ChatInteractions','foreignKey':_0x3f59('0x16f'),'onDelete':_0x3f59('0x172')});db[_0x3f59('0x6a')]['hasMany'](db[_0x3f59('0x124')],{'as':'SmsInteractions','foreignKey':_0x3f59('0x16f'),'onDelete':_0x3f59('0x172')});db[_0x3f59('0x6a')][_0x3f59('0x11a')](db[_0x3f59('0x4b')],{'as':'FaxInteractions','foreignKey':_0x3f59('0x16f'),'onDelete':_0x3f59('0x172')});db[_0x3f59('0x6a')][_0x3f59('0x11a')](db[_0x3f59('0x126')],{'as':_0x3f59('0x127'),'foreignKey':'ContactId','onDelete':_0x3f59('0x172')});db[_0x3f59('0x6a')]['belongsTo'](db[_0x3f59('0x69')],{'as':_0x3f59('0x1aa'),'foreignKey':_0x3f59('0x1ab')});db[_0x3f59('0x6a')][_0x3f59('0x15b')](db[_0x3f59('0xf6')],{'as':'List','foreignKey':_0x3f59('0x17a'),'onDelete':'cascade'});db[_0x3f59('0x6a')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':'Users','through':_0x3f59('0x130')});db[_0x3f59('0x6a')][_0x3f59('0x12c')](db[_0x3f59('0x88')],{'as':'Tags','through':_0x3f59('0x1ac')});db['CmContact'][_0x3f59('0x12c')](db[_0x3f59('0x88')],{'through':_0x3f59('0x1ac'),'as':'ThroughTags'});db[_0x3f59('0x155')][_0x3f59('0x11a')](db['CmHopperAdditionalPhone'],{'as':_0x3f59('0x1ad'),'foreignKey':_0x3f59('0x1ae')});db[_0x3f59('0x155')][_0x3f59('0x15b')](db['CmContact'],{'as':_0x3f59('0x16e'),'foreignKey':_0x3f59('0x16f'),'onDelete':_0x3f59('0x117')});db[_0x3f59('0x155')][_0x3f59('0x15b')](db['CmList'],{'as':_0x3f59('0x179'),'foreignKey':'ListId','onDelete':_0x3f59('0x117')});db[_0x3f59('0x155')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'as':_0x3f59('0x19e'),'foreignKey':_0x3f59('0x118')});db[_0x3f59('0x155')][_0x3f59('0x15b')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x3f59('0x157'),'onDelete':'cascade'});db[_0x3f59('0x155')][_0x3f59('0x15b')](db[_0x3f59('0xe6')],{'as':_0x3f59('0xe6'),'foreignKey':_0x3f59('0x1af'),'onDelete':_0x3f59('0x117')});db[_0x3f59('0x155')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'as':_0x3f59('0x18e'),'foreignKey':_0x3f59('0x1b0')});db['CmHopperBlack']['belongsTo'](db[_0x3f59('0x6a')],{'as':_0x3f59('0x16e'),'foreignKey':_0x3f59('0x16f'),'onDelete':_0x3f59('0x117')});db[_0x3f59('0x6d')][_0x3f59('0x15b')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0x3f59('0x6d')]['belongsTo'](db[_0x3f59('0x139')],{'as':_0x3f59('0x19f'),'foreignKey':_0x3f59('0x157'),'onDelete':_0x3f59('0x117')});db[_0x3f59('0x6d')][_0x3f59('0x15b')](db['Campaign'],{'as':_0x3f59('0xe6'),'foreignKey':_0x3f59('0x1af'),'onDelete':_0x3f59('0x117')});db[_0x3f59('0x75')][_0x3f59('0x11a')](db[_0x3f59('0x7b')],{'as':{'plural':_0x3f59('0x1b1'),'singular':_0x3f59('0x1b2')},'foreignKey':'AutomationAllId','onDelete':_0x3f59('0x117'),'hooks':!![]});db[_0x3f59('0x75')][_0x3f59('0x11a')](db[_0x3f59('0x7b')],{'as':{'plural':_0x3f59('0x1b3'),'singular':_0x3f59('0x1b4')},'foreignKey':_0x3f59('0x1b5'),'onDelete':_0x3f59('0x117'),'hooks':!![]});db[_0x3f59('0x75')]['hasMany'](db[_0x3f59('0x73')],{'as':_0x3f59('0x1b6'),'foreignKey':_0x3f59('0x1b7'),'onDelete':_0x3f59('0x117'),'hooks':!![]});db['Disposition']['hasMany'](db[_0x3f59('0x79')],{'as':'Dispositions','foreignKey':_0x3f59('0x1b8'),'onDelete':_0x3f59('0x117')});db[_0x3f59('0x15f')]['hasMany'](db['Interval'],{'as':_0x3f59('0x1b9'),'foreignKey':_0x3f59('0x160'),'onDelete':_0x3f59('0x117'),'hooks':!![],'required':![]});db[_0x3f59('0x15f')][_0x3f59('0x11a')](db[_0x3f59('0x17')],{'as':_0x3f59('0x11c'),'foreignKey':_0x3f59('0x160'),'onDelete':'restrict'});db[_0x3f59('0x15f')][_0x3f59('0x11a')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0x3f59('0x160')});db[_0x3f59('0x15f')]['hasMany'](db[_0x3f59('0x5d')],{'as':_0x3f59('0x1ba'),'foreignKey':_0x3f59('0x160')});db[_0x3f59('0x15f')][_0x3f59('0x11a')](db['FaxApplication'],{'as':_0x3f59('0x1bb'),'foreignKey':_0x3f59('0x160')});db['Interval'][_0x3f59('0x11a')](db['SmsApplication'],{'as':_0x3f59('0x1bc'),'foreignKey':_0x3f59('0x160')});db[_0x3f59('0x84')]['belongsTo'](db[_0x3f59('0x148')],{});db[_0x3f59('0x84')][_0x3f59('0x15b')](db[_0x3f59('0x1bd')],{'foreignKey':_0x3f59('0x1be')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x3f59('0x1bf')});db[_0x3f59('0x86')][_0x3f59('0x12c')](db[_0x3f59('0x19')],{'as':_0x3f59('0x1c0'),'through':'moh_has_sounds','onDelete':'restrict'});db[_0x3f59('0x88')][_0x3f59('0x12c')](db[_0x3f59('0x6a')],{'through':_0x3f59('0x1ac')});db[_0x3f59('0x88')]['belongsToMany'](db[_0x3f59('0x5f')],{'through':_0x3f59('0x1a3')});db['Tag'][_0x3f59('0x12c')](db[_0x3f59('0x126')],{'through':'mail_interaction_has_tags'});db['Tag'][_0x3f59('0x12c')](db['SmsInteraction'],{'through':_0x3f59('0x194')});db[_0x3f59('0x88')][_0x3f59('0x12c')](db[_0x3f59('0x4b')],{'through':_0x3f59('0x18f')});db[_0x3f59('0x88')][_0x3f59('0x12c')](db[_0x3f59('0x121')],{'through':_0x3f59('0x19a')});db['Tag']['belongsToMany'](db['WhatsappInteraction'],{'through':_0x3f59('0x1c1')});db['CmContactHasItem'][_0x3f59('0x15b')](db[_0x3f59('0x8a')],{'as':_0x3f59('0x1c2'),'foreignKey':_0x3f59('0x1c3')});db[_0x3f59('0x1c4')]['belongsTo'](db[_0x3f59('0x155')],{'as':_0x3f59('0x1c5'),'foreignKey':_0x3f59('0x1ae')});db['CmContactHasItem'][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'as':_0x3f59('0x16e'),'foreignKey':'CmContactId'});db['Trigger']['hasMany'](db[_0x3f59('0x7b')],{'as':{'plural':_0x3f59('0x1c6'),'singular':'AllCondition'},'foreignKey':_0x3f59('0x1c7'),'onDelete':_0x3f59('0x117'),'hooks':!![]});db['Trigger'][_0x3f59('0x11a')](db['Condition'],{'as':{'plural':_0x3f59('0x1c8'),'singular':_0x3f59('0x1c9')},'foreignKey':_0x3f59('0x1ca'),'onDelete':_0x3f59('0x117'),'hooks':!![]});db[_0x3f59('0x91')]['hasMany'](db[_0x3f59('0x73')],{'as':_0x3f59('0x1b6'),'foreignKey':_0x3f59('0x1cb'),'onDelete':_0x3f59('0x117'),'hooks':!![]});db[_0x3f59('0x97')][_0x3f59('0x11a')](db[_0x3f59('0x1cc')],{'as':_0x3f59('0x1cd'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1bf'),'hooks':!![]});db[_0x3f59('0x1bd')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x3f59('0x1ce')]['hasMany'](db[_0x3f59('0x1cc')],{'as':'Fields','onDelete':_0x3f59('0x117'),'foreignKey':'MetricId'});db[_0x3f59('0x1cc')]['belongsTo'](db[_0x3f59('0x1ce')],{'foreignKey':_0x3f59('0x1cf')});db[_0x3f59('0x9f')]['hasMany'](db['SalesforceConfiguration'],{'as':_0x3f59('0x1d0'),'onDelete':_0x3f59('0x117'),'foreignKey':'AccountId'});db[_0x3f59('0xa0')][_0x3f59('0x11a')](db[_0x3f59('0xa1')],{'as':'Subjects','onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d1')});db['SalesforceConfiguration']['hasMany'](db[_0x3f59('0xa1')],{'as':_0x3f59('0x1d2'),'onDelete':_0x3f59('0x117'),'foreignKey':'DescriptionId'});db[_0x3f59('0xa0')]['hasMany'](db[_0x3f59('0xa1')],{'as':_0x3f59('0x1cd'),'onDelete':_0x3f59('0x117'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x3f59('0x15b')](db['SalesforceAccount'],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0xa1')]['hasMany'](db[_0x3f59('0xa1')],{'as':_0x3f59('0x1d4'),'foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0xa1')]['hasMany'](db[_0x3f59('0xa1')],{'as':'Description','foreignKey':_0x3f59('0x1d5')});db['SalesforceField'][_0x3f59('0x11a')](db[_0x3f59('0xa1')],{'as':_0x3f59('0x1d6'),'foreignKey':_0x3f59('0x1d7')});db['SalesforceField'][_0x3f59('0x15b')](db['Variable'],{'as':_0x3f59('0x93'),'foreignKey':_0x3f59('0x1d8')});db[_0x3f59('0x1d9')][_0x3f59('0x11a')](db['SugarcrmConfiguration'],{'as':_0x3f59('0x1d0'),'onDelete':'cascade','foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0x1da')][_0x3f59('0x11a')](db[_0x3f59('0x1db')],{'as':'Subjects','onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0x1da')][_0x3f59('0x11a')](db['SugarcrmField'],{'as':_0x3f59('0x1d2'),'onDelete':'cascade','foreignKey':_0x3f59('0x1d5')});db[_0x3f59('0x1da')][_0x3f59('0x11a')](db[_0x3f59('0x1db')],{'as':_0x3f59('0x1cd'),'onDelete':'cascade','foreignKey':'FieldId'});db['SugarcrmConfiguration']['belongsTo'](db[_0x3f59('0x1d9')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x1d3')});db['SugarcrmField'][_0x3f59('0x11a')](db[_0x3f59('0x1db')],{'as':'Subject','foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0x1db')]['hasMany'](db[_0x3f59('0x1db')],{'as':_0x3f59('0x1dc'),'foreignKey':_0x3f59('0x1d5')});db[_0x3f59('0x1db')][_0x3f59('0x11a')](db[_0x3f59('0x1db')],{'as':'Field','foreignKey':_0x3f59('0x1d7')});db[_0x3f59('0x1db')][_0x3f59('0x15b')](db['Variable'],{'as':_0x3f59('0x93'),'foreignKey':_0x3f59('0x1d8')});db[_0x3f59('0x1dd')]['hasMany'](db['DeskConfiguration'],{'as':_0x3f59('0x1d0'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0xa6')][_0x3f59('0x11a')](db['DeskField'],{'as':_0x3f59('0x1de'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0xa6')][_0x3f59('0x11a')](db[_0x3f59('0xa7')],{'as':'Descriptions','onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d5')});db['DeskConfiguration']['hasMany'](db[_0x3f59('0xa7')],{'as':_0x3f59('0x1cd'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d7')});db[_0x3f59('0xa6')][_0x3f59('0x15b')](db[_0x3f59('0x1dd')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0xa6')][_0x3f59('0x12c')](db[_0x3f59('0x88')],{'through':_0x3f59('0x1df')});db[_0x3f59('0xa7')][_0x3f59('0x11a')](db['DeskField'],{'as':_0x3f59('0x1d4'),'foreignKey':_0x3f59('0x1d1')});db['DeskField']['hasMany'](db['DeskField'],{'as':_0x3f59('0x1dc'),'foreignKey':'DescriptionId'});db[_0x3f59('0xa7')][_0x3f59('0x11a')](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db['DeskField']['belongsTo'](db['Variable'],{'as':_0x3f59('0x93'),'foreignKey':_0x3f59('0x1d8')});db[_0x3f59('0xa9')][_0x3f59('0x11a')](db[_0x3f59('0xab')],{'as':_0x3f59('0x1d0'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0xab')]['hasMany'](db[_0x3f59('0xac')],{'as':'Subjects','onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0xab')][_0x3f59('0x11a')](db[_0x3f59('0xac')],{'as':_0x3f59('0x1d2'),'onDelete':'cascade','foreignKey':_0x3f59('0x1d5')});db[_0x3f59('0xab')]['hasMany'](db[_0x3f59('0xac')],{'as':_0x3f59('0x1cd'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d7')});db[_0x3f59('0xab')][_0x3f59('0x15b')](db['ZohoAccount'],{'as':'Account','foreignKey':_0x3f59('0x1d3')});db['ZohoField']['hasMany'](db[_0x3f59('0xac')],{'as':_0x3f59('0x1d4'),'foreignKey':_0x3f59('0x1d1')});db['ZohoField'][_0x3f59('0x11a')](db['ZohoField'],{'as':_0x3f59('0x1dc'),'foreignKey':_0x3f59('0x1d5')});db[_0x3f59('0xac')][_0x3f59('0x11a')](db[_0x3f59('0xac')],{'as':_0x3f59('0x1d6'),'foreignKey':_0x3f59('0x1d7')});db[_0x3f59('0xac')][_0x3f59('0x15b')](db['Variable'],{'as':_0x3f59('0x93'),'foreignKey':_0x3f59('0x1d8')});db[_0x3f59('0xae')][_0x3f59('0x11a')](db[_0x3f59('0xb0')],{'as':_0x3f59('0x1d0'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0xb0')][_0x3f59('0x11a')](db['ZendeskField'],{'as':_0x3f59('0x1de'),'foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0xb0')][_0x3f59('0x11a')](db[_0x3f59('0xb1')],{'as':_0x3f59('0x1d2'),'foreignKey':_0x3f59('0x1d5')});db[_0x3f59('0xb0')][_0x3f59('0x11a')](db['ZendeskField'],{'as':'Fields','foreignKey':_0x3f59('0x1d7')});db[_0x3f59('0xb0')][_0x3f59('0x15b')](db[_0x3f59('0xae')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0xb0')]['belongsToMany'](db[_0x3f59('0x88')],{'through':_0x3f59('0x1e0')});db[_0x3f59('0xb1')][_0x3f59('0x11a')](db['ZendeskField'],{'as':_0x3f59('0x1d4'),'foreignKey':_0x3f59('0x1d1')});db['ZendeskField']['hasMany'](db[_0x3f59('0xb1')],{'as':_0x3f59('0x1dc'),'foreignKey':_0x3f59('0x1d5')});db[_0x3f59('0xb1')]['hasMany'](db[_0x3f59('0xb1')],{'as':_0x3f59('0x1d6'),'foreignKey':_0x3f59('0x1d7')});db[_0x3f59('0xb1')][_0x3f59('0x15b')](db[_0x3f59('0x93')],{'as':_0x3f59('0x93'),'foreignKey':'VariableId'});db[_0x3f59('0xb2')][_0x3f59('0x11a')](db['FreshdeskConfiguration'],{'as':_0x3f59('0x1d0'),'onDelete':_0x3f59('0x117'),'foreignKey':'AccountId'});db[_0x3f59('0xb4')][_0x3f59('0x11a')](db['FreshdeskField'],{'as':_0x3f59('0x1de'),'onDelete':_0x3f59('0x117'),'foreignKey':'SubjectId'});db[_0x3f59('0xb4')][_0x3f59('0x11a')](db['FreshdeskField'],{'as':_0x3f59('0x1d2'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d5')});db['FreshdeskConfiguration'][_0x3f59('0x11a')](db[_0x3f59('0xb6')],{'as':'Fields','onDelete':_0x3f59('0x117'),'foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0x3f59('0x15b')](db[_0x3f59('0xb2')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0xb4')][_0x3f59('0x12c')](db[_0x3f59('0x88')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x3f59('0xb6')][_0x3f59('0x11a')](db['FreshdeskField'],{'as':_0x3f59('0x1d4'),'foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0xb6')][_0x3f59('0x11a')](db['FreshdeskField'],{'as':_0x3f59('0x1dc'),'foreignKey':'DescriptionId'});db[_0x3f59('0xb6')][_0x3f59('0x11a')](db[_0x3f59('0xb6')],{'as':_0x3f59('0x1d6'),'foreignKey':'FieldId'});db[_0x3f59('0xb6')]['belongsTo'](db[_0x3f59('0x93')],{'as':_0x3f59('0x93'),'foreignKey':_0x3f59('0x1d8')});db['VtigerAccount'][_0x3f59('0x11a')](db[_0x3f59('0xb8')],{'as':_0x3f59('0x1d0'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0xb8')][_0x3f59('0x11a')](db[_0x3f59('0xba')],{'as':'Subjects','foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0xb8')]['hasMany'](db[_0x3f59('0xba')],{'as':_0x3f59('0x1d2'),'foreignKey':_0x3f59('0x1d5')});db[_0x3f59('0xb8')][_0x3f59('0x11a')](db['VtigerField'],{'as':'Fields','foreignKey':_0x3f59('0x1d7')});db[_0x3f59('0xb8')][_0x3f59('0x15b')](db[_0x3f59('0xb7')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x1d3')});db['VtigerField'][_0x3f59('0x11a')](db['VtigerField'],{'as':'Subject','foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0xba')][_0x3f59('0x11a')](db['VtigerField'],{'as':'Description','foreignKey':_0x3f59('0x1d5')});db[_0x3f59('0xba')][_0x3f59('0x11a')](db[_0x3f59('0xba')],{'as':_0x3f59('0x1d6'),'foreignKey':_0x3f59('0x1d7')});db[_0x3f59('0xba')][_0x3f59('0x15b')](db[_0x3f59('0x93')],{'as':'Variable','foreignKey':'VariableId'});db[_0x3f59('0xbc')][_0x3f59('0x11a')](db[_0x3f59('0xbe')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0xbe')]['hasMany'](db[_0x3f59('0x1e1')],{'as':'Subjects','foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0xbe')][_0x3f59('0x11a')](db['ServicenowField'],{'as':'Descriptions','foreignKey':_0x3f59('0x1d5')});db[_0x3f59('0xbe')][_0x3f59('0x11a')](db[_0x3f59('0x1e1')],{'as':_0x3f59('0x1cd'),'foreignKey':_0x3f59('0x1d7')});db['ServicenowConfiguration'][_0x3f59('0x15b')](db[_0x3f59('0xbc')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0x1e1')][_0x3f59('0x11a')](db[_0x3f59('0x1e1')],{'as':_0x3f59('0x1d4'),'foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0x1e1')][_0x3f59('0x11a')](db[_0x3f59('0x1e1')],{'as':_0x3f59('0x1dc'),'foreignKey':'DescriptionId'});db['ServicenowField']['hasMany'](db[_0x3f59('0x1e1')],{'as':'Field','foreignKey':'FieldId'});db[_0x3f59('0x1e1')][_0x3f59('0x15b')](db[_0x3f59('0x93')],{'as':'Variable','foreignKey':'VariableId'});db[_0x3f59('0xc1')][_0x3f59('0x11a')](db[_0x3f59('0xc3')],{'as':_0x3f59('0x1d0'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d3')});db['Dynamics365Account']['belongsTo'](db['CloudProvider'],{'as':_0x3f59('0x10c'),'foreignKey':_0x3f59('0x171')});db[_0x3f59('0xc3')]['hasMany'](db[_0x3f59('0xc4')],{'as':_0x3f59('0x1de'),'onDelete':'cascade','foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0xc3')][_0x3f59('0x11a')](db['Dynamics365Field'],{'as':_0x3f59('0x1d2'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x3f59('0xc3')][_0x3f59('0x11a')](db[_0x3f59('0xc4')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x3f59('0xc3')]['belongsTo'](db[_0x3f59('0xc1')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x1d3')});db['Dynamics365Field'][_0x3f59('0x11a')](db[_0x3f59('0xc4')],{'as':_0x3f59('0x1d4'),'foreignKey':'SubjectId'});db[_0x3f59('0xc4')][_0x3f59('0x11a')](db[_0x3f59('0xc4')],{'as':_0x3f59('0x1dc'),'foreignKey':'DescriptionId'});db[_0x3f59('0xc4')]['hasMany'](db[_0x3f59('0xc4')],{'as':_0x3f59('0x1d6'),'foreignKey':_0x3f59('0x1d7')});db[_0x3f59('0xc4')]['belongsTo'](db[_0x3f59('0x93')],{'as':_0x3f59('0x93'),'foreignKey':_0x3f59('0x1d8')});db[_0x3f59('0x1e2')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x3f59('0x1d0'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0xc7')]['hasMany'](db['FreshsalesField'],{'as':_0x3f59('0x1de'),'foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0xc7')][_0x3f59('0x11a')](db[_0x3f59('0x1e3')],{'as':'Descriptions','foreignKey':_0x3f59('0x1d5')});db[_0x3f59('0xc7')]['hasMany'](db[_0x3f59('0x1e3')],{'as':_0x3f59('0x1cd'),'foreignKey':_0x3f59('0x1d7')});db['FreshsalesConfiguration'][_0x3f59('0x15b')](db[_0x3f59('0x1e2')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x1d3')});db[_0x3f59('0x1e3')][_0x3f59('0x11a')](db[_0x3f59('0x1e3')],{'as':'Subject','foreignKey':_0x3f59('0x1d1')});db[_0x3f59('0x1e3')][_0x3f59('0x11a')](db[_0x3f59('0x1e3')],{'as':_0x3f59('0x1dc'),'foreignKey':_0x3f59('0x1d5')});db[_0x3f59('0x1e3')][_0x3f59('0x11a')](db[_0x3f59('0x1e3')],{'as':_0x3f59('0x1d6'),'foreignKey':_0x3f59('0x1d7')});db[_0x3f59('0x1e3')][_0x3f59('0x15b')](db[_0x3f59('0x93')],{'as':_0x3f59('0x93'),'foreignKey':_0x3f59('0x1d8')});db[_0x3f59('0xcd')]['belongsTo'](db['ChatWebsite'],{});db['ChatQueueReport'][_0x3f59('0x15b')](db[_0x3f59('0xf6')],{'as':_0x3f59('0x179'),'foreignKey':_0x3f59('0x17a')});db[_0x3f59('0xcd')][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'as':_0x3f59('0x16e'),'foreignKey':_0x3f59('0x16f')});db['ChatQueueReport']['belongsTo'](db[_0x3f59('0x5f')],{});db['ChatQueueReport'][_0x3f59('0x15b')](db[_0x3f59('0x61')],{});db[_0x3f59('0xcd')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{});db[_0x3f59('0xcd')][_0x3f59('0x15b')](db['ChatQueue'],{});db[_0x3f59('0xce')][_0x3f59('0x15b')](db['User'],{'onDelete':_0x3f59('0x117'),'foreignKey':'FromId'});db[_0x3f59('0xce')]['belongsTo'](db[_0x3f59('0x114')],{'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x1e4')});db[_0x3f59('0xd3')][_0x3f59('0x11a')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x3f59('0xd3')]['hasMany'](db[_0x3f59('0xd0')],{'foreignKey':_0x3f59('0x1e5'),'onDelete':'cascade'});db['SmsQueueReport'][_0x3f59('0x15b')](db[_0x3f59('0x4f')],{});db['SmsQueueReport'][_0x3f59('0x15b')](db['CmList'],{'as':'List','foreignKey':_0x3f59('0x17a')});db[_0x3f59('0xd5')][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'as':_0x3f59('0x16e'),'foreignKey':_0x3f59('0x16f')});db[_0x3f59('0xd5')][_0x3f59('0x15b')](db[_0x3f59('0x124')],{});db[_0x3f59('0xd5')]['belongsTo'](db[_0x3f59('0x52')],{});db[_0x3f59('0xd5')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{});db[_0x3f59('0xd5')][_0x3f59('0x15b')](db['SmsQueue'],{});db[_0x3f59('0xda')]['hasMany'](db[_0x3f59('0xd3')],{'foreignKey':_0x3f59('0x1e6')});db[_0x3f59('0xda')][_0x3f59('0x11a')](db[_0x3f59('0xd2')],{'foreignKey':_0x3f59('0x1e6')});db[_0x3f59('0xda')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db['SquareProject']['belongsToMany'](db[_0x3f59('0x114')],{'as':_0x3f59('0x182'),'through':_0x3f59('0x151')});db[_0x3f59('0xe2')][_0x3f59('0x12c')](db['User'],{'as':'Agents','through':_0x3f59('0x133')});db['Team'][_0x3f59('0x12c')](db[_0x3f59('0x139')],{'through':_0x3f59('0x10d'),'as':_0x3f59('0x13a')});db[_0x3f59('0xe2')]['belongsToMany'](db[_0x3f59('0x3b')],{'through':'team_has_mail_queues','as':_0x3f59('0x13c')});db[_0x3f59('0xe2')][_0x3f59('0x12c')](db[_0x3f59('0x64')],{'through':'team_has_chat_queues','as':_0x3f59('0x13d')});db['Team']['belongsToMany'](db['FaxQueue'],{'through':_0x3f59('0x1e7'),'as':_0x3f59('0x13e')});db[_0x3f59('0xe2')][_0x3f59('0x12c')](db[_0x3f59('0x54')],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0x3f59('0xe2')][_0x3f59('0x12c')](db[_0x3f59('0x141')],{'through':_0x3f59('0x19b'),'as':_0x3f59('0x142')});db[_0x3f59('0xe2')][_0x3f59('0x12c')](db['WhatsappQueue'],{'through':_0x3f59('0x1e8'),'as':_0x3f59('0x144')});db['Team'][_0x3f59('0x12c')](db[_0x3f59('0xf8')],{'through':_0x3f59('0x1e9'),'as':_0x3f59('0x13b')});db[_0x3f59('0xe6')][_0x3f59('0x11a')](db[_0x3f59('0x155')],{'as':_0x3f59('0x156'),'foreignKey':_0x3f59('0x1af')});db[_0x3f59('0xe6')][_0x3f59('0x11a')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0x3f59('0xe6')][_0x3f59('0x11a')](db['CmHopperHistory'],{'as':_0x3f59('0x158'),'foreignKey':_0x3f59('0x1af')});db['Campaign'][_0x3f59('0x11a')](db[_0x3f59('0x6d')],{'as':'HopperBlacks','foreignKey':_0x3f59('0x1af')});db[_0x3f59('0xe6')][_0x3f59('0x15b')](db[_0x3f59('0x27')],{'as':_0x3f59('0x27'),'foreignKey':_0x3f59('0x15c')});db[_0x3f59('0xe6')][_0x3f59('0x15b')](db[_0x3f59('0x27')],{'as':_0x3f59('0x15d'),'foreignKey':_0x3f59('0x15e')});db[_0x3f59('0xe6')]['belongsTo'](db[_0x3f59('0x15f')],{'as':_0x3f59('0x15f'),'foreignKey':_0x3f59('0x160')});db['Campaign'][_0x3f59('0x15b')](db[_0x3f59('0x14f')],{'as':_0x3f59('0x14f'),'foreignKey':_0x3f59('0x1ea')});db[_0x3f59('0xe6')]['belongsToMany'](db['CmList'],{'as':_0x3f59('0x131'),'through':_0x3f59('0x1eb')});db[_0x3f59('0xe6')]['belongsToMany'](db[_0x3f59('0xf6')],{'as':_0x3f59('0x164'),'through':_0x3f59('0x1ec')});db[_0x3f59('0xea')][_0x3f59('0x15b')](db[_0x3f59('0x63')],{'as':_0x3f59('0x63'),'foreignKey':_0x3f59('0x185')});db[_0x3f59('0xee')][_0x3f59('0x15b')](db[_0x3f59('0x17d')],{});db[_0x3f59('0xee')][_0x3f59('0x15b')](db[_0x3f59('0x126')],{});db[_0x3f59('0xee')][_0x3f59('0x15b')](db[_0x3f59('0x148')],{'foreignKey':'FromMailAccountId','as':_0x3f59('0x1ed')});db[_0x3f59('0xee')]['belongsTo'](db[_0x3f59('0x114')],{'foreignKey':_0x3f59('0x1ee'),'as':_0x3f59('0x1ef')});db['MailTransferReport'][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'foreignKey':_0x3f59('0x1f0'),'as':_0x3f59('0x1f1')});db[_0x3f59('0xee')][_0x3f59('0x15b')](db[_0x3f59('0x3b')],{'foreignKey':_0x3f59('0x1f2'),'as':_0x3f59('0x1f3')});db[_0x3f59('0xee')]['belongsTo'](db['MailAccount'],{'foreignKey':_0x3f59('0x1f4'),'as':'ToAccount'});db[_0x3f59('0x1f5')][_0x3f59('0x15b')](db['ChatMessage'],{});db['ChatTransferReport'][_0x3f59('0x15b')](db[_0x3f59('0x5f')],{});db[_0x3f59('0x1f5')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x3f59('0x1f6'),'as':'FromAccount'});db['ChatTransferReport'][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'foreignKey':_0x3f59('0x1ee'),'as':_0x3f59('0x1ef')});db[_0x3f59('0x1f5')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'foreignKey':'ToUserId','as':'ToAgent'});db['ChatTransferReport'][_0x3f59('0x15b')](db[_0x3f59('0x64')],{'foreignKey':'ToChatQueueId','as':_0x3f59('0x1f3')});db[_0x3f59('0x1f5')]['belongsTo'](db[_0x3f59('0x145')],{'foreignKey':'ToChatWebsiteId','as':_0x3f59('0x1f7')});db[_0x3f59('0xf1')][_0x3f59('0x15b')](db['FaxMessage'],{});db['FaxTransferReport']['belongsTo'](db['FaxInteraction'],{});db[_0x3f59('0xf1')]['belongsTo'](db[_0x3f59('0x47')],{'foreignKey':'FromFaxAccountId','as':_0x3f59('0x1ed')});db['FaxTransferReport'][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'foreignKey':_0x3f59('0x1ee'),'as':_0x3f59('0x1ef')});db['FaxTransferReport'][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'foreignKey':'ToUserId','as':_0x3f59('0x1f1')});db[_0x3f59('0xf1')][_0x3f59('0x15b')](db[_0x3f59('0x18c')],{'foreignKey':_0x3f59('0x1f8'),'as':_0x3f59('0x1f3')});db[_0x3f59('0xf1')]['belongsTo'](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x3f59('0x1f7')});db[_0x3f59('0x1f9')][_0x3f59('0x15b')](db[_0x3f59('0x58')],{});db[_0x3f59('0x1f9')]['belongsTo'](db[_0x3f59('0x121')],{});db[_0x3f59('0x1f9')][_0x3f59('0x15b')](db['OpenchannelAccount'],{'foreignKey':_0x3f59('0x1fa'),'as':_0x3f59('0x1ed')});db[_0x3f59('0x1f9')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'foreignKey':_0x3f59('0x1ee'),'as':_0x3f59('0x1ef')});db[_0x3f59('0x1f9')]['belongsTo'](db[_0x3f59('0x114')],{'foreignKey':_0x3f59('0x1f0'),'as':_0x3f59('0x1f1')});db[_0x3f59('0x1f9')]['belongsTo'](db[_0x3f59('0x141')],{'foreignKey':_0x3f59('0x1fb'),'as':'ToQueue'});db[_0x3f59('0x1f9')][_0x3f59('0x15b')](db[_0x3f59('0x14b')],{'foreignKey':_0x3f59('0x1fc'),'as':'ToAccount'});db[_0x3f59('0xf4')][_0x3f59('0x15b')](db[_0x3f59('0x52')],{});db['SmsTransferReport'][_0x3f59('0x15b')](db['SmsInteraction'],{});db[_0x3f59('0xf4')][_0x3f59('0x15b')](db[_0x3f59('0x4f')],{'foreignKey':_0x3f59('0x1fd'),'as':_0x3f59('0x1ed')});db[_0x3f59('0xf4')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'foreignKey':_0x3f59('0x1ee'),'as':_0x3f59('0x1ef')});db[_0x3f59('0xf4')][_0x3f59('0x15b')](db['User'],{'foreignKey':_0x3f59('0x1f0'),'as':'ToAgent'});db[_0x3f59('0xf4')]['belongsTo'](db[_0x3f59('0x54')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0x3f59('0xf4')]['belongsTo'](db[_0x3f59('0x4f')],{'foreignKey':_0x3f59('0x1fe'),'as':_0x3f59('0x1f7')});db[_0x3f59('0xf6')][_0x3f59('0x11a')](db['Disposition'],{'as':_0x3f59('0x175'),'foreignKey':_0x3f59('0x17a'),'onDelete':'cascade'});db[_0x3f59('0xf6')][_0x3f59('0x11a')](db[_0x3f59('0x72')],{'as':_0x3f59('0x1ff'),'foreignKey':'ListId'});db[_0x3f59('0xf6')]['hasMany'](db['CmContact'],{'as':_0x3f59('0x12f'),'onDelete':_0x3f59('0x117'),'foreignKey':_0x3f59('0x17a')});db[_0x3f59('0xf6')][_0x3f59('0x11a')](db[_0x3f59('0x11d')],{'as':_0x3f59('0x11e'),'foreignKey':_0x3f59('0x17a')});db[_0x3f59('0xf6')][_0x3f59('0x11a')](db[_0x3f59('0x6f')],{'as':_0x3f59('0x11f'),'foreignKey':_0x3f59('0x17a')});db[_0x3f59('0xf6')][_0x3f59('0x11a')](db[_0x3f59('0x120')],{'as':_0x3f59('0x120'),'foreignKey':_0x3f59('0x17a')});db[_0x3f59('0xf6')][_0x3f59('0x12c')](db[_0x3f59('0x139')],{'as':_0x3f59('0x200'),'through':_0x3f59('0x201')});db['CmList'][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':'Agents','through':_0x3f59('0x132')});db[_0x3f59('0xf8')][_0x3f59('0x11a')](db['VoiceExtension'],{'as':_0x3f59('0x11c'),'onDelete':_0x3f59('0x117')});db['VoicePrefix'][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x162'),'through':_0x3f59('0x110')});db[_0x3f59('0xf8')][_0x3f59('0x12c')](db[_0x3f59('0xe2')],{'through':_0x3f59('0x1e9'),'as':'Teams'});db[_0x3f59('0xfa')][_0x3f59('0x11a')](db[_0x3f59('0x114')],{'as':_0x3f59('0x182'),'foreignKey':'userProfileId'});db['UserProfile'][_0x3f59('0x11a')](db[_0x3f59('0xfc')],{'as':'UserProfileSections','foreignKey':_0x3f59('0x12b'),'onDelete':_0x3f59('0x117')});db[_0x3f59('0xfc')][_0x3f59('0x11a')](db['UserProfileResource'],{'as':_0x3f59('0x202'),'foreignKey':_0x3f59('0x203'),'onDelete':'cascade'});db['WhatsappAccount'][_0x3f59('0x11a')](db['Disposition'],{'as':_0x3f59('0x175'),'foreignKey':_0x3f59('0x204'),'onDelete':'cascade'});db[_0x3f59('0x101')]['hasMany'](db['CannedAnswer'],{'as':_0x3f59('0x176'),'foreignKey':_0x3f59('0x204')});db[_0x3f59('0x101')]['hasMany'](db[_0x3f59('0x106')],{'as':_0x3f59('0x167'),'foreignKey':_0x3f59('0x204')});db[_0x3f59('0x101')][_0x3f59('0x11a')](db[_0x3f59('0x104')],{'as':'Interactions'});db['WhatsappAccount'][_0x3f59('0x11a')](db[_0x3f59('0x102')],{'as':'Applications'});db[_0x3f59('0x101')][_0x3f59('0x15b')](db[_0x3f59('0xf6')],{'as':_0x3f59('0x179'),'foreignKey':_0x3f59('0x17a')});db[_0x3f59('0x101')][_0x3f59('0x15b')](db[_0x3f59('0x7e')],{'as':_0x3f59('0x161'),'foreignKey':_0x3f59('0x17b')});db[_0x3f59('0x101')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x162'),'through':_0x3f59('0x205')});db[_0x3f59('0x102')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'onDelete':_0x3f59('0x172')});db[_0x3f59('0x102')][_0x3f59('0x15b')](db[_0x3f59('0x10b')],{'onDelete':_0x3f59('0x172')});db[_0x3f59('0x102')][_0x3f59('0x15b')](db[_0x3f59('0x101')],{'onDelete':'restrict'});db[_0x3f59('0x102')][_0x3f59('0x15b')](db[_0x3f59('0x15f')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x3f59('0x102')][_0x3f59('0x15b')](db[_0x3f59('0x88')],{'onDelete':'restrict','foreignKey':_0x3f59('0x186')});db[_0x3f59('0x104')]['hasMany'](db['WhatsappMessage'],{'as':_0x3f59('0x167'),'onDelete':'cascade','foreignKey':_0x3f59('0x206')});db[_0x3f59('0x104')][_0x3f59('0x15b')](db[_0x3f59('0x101')],{'as':_0x3f59('0x17e'),'foreignKey':_0x3f59('0x204')});db[_0x3f59('0x104')][_0x3f59('0x15b')](db[_0x3f59('0x6a')],{'as':'Contact','foreignKey':_0x3f59('0x16f')});db[_0x3f59('0x104')][_0x3f59('0x15b')](db['User'],{'as':_0x3f59('0x18e'),'foreignKey':_0x3f59('0x118')});db[_0x3f59('0x104')][_0x3f59('0x12c')](db[_0x3f59('0x88')],{'through':_0x3f59('0x1c1'),'as':'Tags'});db[_0x3f59('0x104')]['belongsToMany'](db[_0x3f59('0x88')],{'through':_0x3f59('0x1c1'),'as':'ThroughTags'});db[_0x3f59('0x104')][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x182'),'through':_0x3f59('0x138'),'foreignKey':'WhatsappInteractionId'});db[_0x3f59('0x106')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'as':_0x3f59('0x114')});db[_0x3f59('0x106')][_0x3f59('0x15b')](db['CmContact'],{'onDelete':_0x3f59('0x117'),'as':_0x3f59('0x16e')});db[_0x3f59('0x106')]['belongsTo'](db[_0x3f59('0x104')],{'onDelete':_0x3f59('0x117'),'as':_0x3f59('0x184'),'foreignKey':_0x3f59('0x206')});db[_0x3f59('0x106')]['belongsTo'](db[_0x3f59('0x101')],{'as':_0x3f59('0x17e'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0x3f59('0x15b')](db[_0x3f59('0x101')],{});db['WhatsappQueueReport'][_0x3f59('0x15b')](db[_0x3f59('0xf6')],{'as':_0x3f59('0x179'),'foreignKey':_0x3f59('0x17a')});db[_0x3f59('0x108')]['belongsTo'](db[_0x3f59('0x6a')],{'as':'Contact','foreignKey':'ContactId'});db['WhatsappQueueReport'][_0x3f59('0x15b')](db[_0x3f59('0x104')],{});db[_0x3f59('0x108')][_0x3f59('0x15b')](db['WhatsappQueue'],{});db[_0x3f59('0x108')][_0x3f59('0x15b')](db[_0x3f59('0x106')],{});db[_0x3f59('0x108')][_0x3f59('0x15b')](db['User'],{});db[_0x3f59('0x109')][_0x3f59('0x15b')](db[_0x3f59('0x106')],{});db['WhatsappTransferReport'][_0x3f59('0x15b')](db[_0x3f59('0x104')],{});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x3f59('0x207'),'as':_0x3f59('0x1ed')});db[_0x3f59('0x109')]['belongsTo'](db[_0x3f59('0x101')],{'foreignKey':_0x3f59('0x208'),'as':_0x3f59('0x1f7')});db[_0x3f59('0x109')][_0x3f59('0x15b')](db[_0x3f59('0x10b')],{'foreignKey':_0x3f59('0x209'),'as':_0x3f59('0x1f3')});db[_0x3f59('0x109')][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'foreignKey':_0x3f59('0x1ee'),'as':_0x3f59('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db[_0x3f59('0x114')],{'foreignKey':_0x3f59('0x1f0'),'as':'ToAgent'});db['WhatsappQueue'][_0x3f59('0x12c')](db[_0x3f59('0x114')],{'as':_0x3f59('0x162'),'through':_0x3f59('0x35'),'foreignKey':_0x3f59('0x20a')});db['WhatsappQueue'][_0x3f59('0x12c')](db[_0x3f59('0xe2')],{'through':'team_has_whatsapp_queues','as':_0x3f59('0x163')});db['UserSetting'][_0x3f59('0x15b')](db[_0x3f59('0x114')],{'as':_0x3f59('0x20b'),'foreignKey':'UserId','onDelete':_0x3f59('0x117'),'hooks':!![]});db[_0x3f59('0x10c')]['hasOne'](db[_0x3f59('0xc1')],{'as':_0x3f59('0xc1'),'onDelete':_0x3f59('0x172')});db[_0x3f59('0x10c')]['hasOne'](db[_0x3f59('0x36')],{'as':_0x3f59('0x173'),'onDelete':'restrict'});db[_0x3f59('0x10c')][_0x3f59('0x115')](db[_0x3f59('0x38')],{'as':_0x3f59('0x174'),'onDelete':_0x3f59('0x172')});module[_0x3f59('0x20c')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xe9fe=['MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','CmContact','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Cdr','VoiceQueuesLog','Schedule','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','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','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','cascade','UserId','hasMany','Recordings','Extensions','CmHopperFinal','HopperFinals','ReportAgentPreview','OpenchannelInteraction','ChatInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','belongsTo','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','Lists','cm_user_has_lists','MailInteractions','user_has_chat_interactions','SmsInteractions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueues','FaxQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','UserWhatsappQueue','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceContext','Applications','Sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','MailAccountId','CloudProviderId','restrict','hasOne','Imap','Smtp','Dispositions','Answers','Interactions','ListId','TemplateId','UserMailQueue','team_has_mail_queues','MailInteractionId','ContactId','Owner','Tags','ThroughTags','Attachments','Interaction','ChatOfflineMessageId','TagId','List','DashboardItem','Items','FaxAccountId','CannedAnswer','FaxInteractionId','fax_interaction_has_tags','Users','user_has_fax_interactions','AttachmentId','Account','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ProactiveActions','ChatMessage','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CmCompany','Contacts','CompanyId','Phones','CmContactId','AdditionalPhones','CmHopperId','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','Mohs','moh_has_sounds','cm_contact_has_tags','mail_interaction_has_tags','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','Trigger','AnyConditions','TriggerAnyId','TriggerId','AnalyticFieldReport','CustomReportId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','Subject','Description','FieldId','VariableId','SugarcrmField','DescriptionId','Field','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Account','FreshsalesConfiguration','ToId','JscriptyAnswerReport','JscriptyProject','ProjectId','user_has_teams','FaxQueues','team_has_whatsapp_queues','WhatsappQueues','Hoppers','TrunkBackup','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromAccount','ToChatQueueId','ToChatWebsiteId','ToAccount','FaxTransferReport','FromFaxAccountId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','HopperHistory','Queues','userProfileId','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xe9fe,0x1b9));var _0xee9f=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xe9fe[_0x9fd887];return _0x1a54ab;};'use strict';var config=require(_0xee9f('0x0'));var Sequelize=require(_0xee9f('0x1'));var _=require('lodash');var jstz=require(_0xee9f('0x2'));var timezone=jstz[_0xee9f('0x3')]();config[_0xee9f('0x1')]=_[_0xee9f('0x4')](config['sequelize'],{'database':_0xee9f('0x5'),'username':_0xee9f('0x6'),'password':_0xee9f('0x7'),'options':{'host':_0xee9f('0x8'),'port':0xcea,'dialect':_0xee9f('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xee9f('0xa')](),'define':{'charset':_0xee9f('0xb'),'collate':_0xee9f('0xc')}}});config[_0xee9f('0xd')]=_[_0xee9f('0x4')](config[_0xee9f('0xd')],{'database':'motion2','username':_0xee9f('0x6'),'password':_0xee9f('0x7'),'options':{'host':_0xee9f('0x8'),'port':0xcea,'dialect':_0xee9f('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xee9f('0xa')](),'define':{'charset':_0xee9f('0xb'),'collate':_0xee9f('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xee9f('0x1')][_0xee9f('0xe')],config['sequelize'][_0xee9f('0xf')],config[_0xee9f('0x1')][_0xee9f('0x10')],config['sequelize'][_0xee9f('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xee9f('0xd')][_0xee9f('0xe')],config[_0xee9f('0xd')]['username'],config[_0xee9f('0xd')][_0xee9f('0x10')],config[_0xee9f('0xd')]['options'])};db['User']=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/user/user.model');db['VoiceChanSpy']=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x13'));db[_0xee9f('0x14')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x15'));db[_0xee9f('0x16')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x17'));db[_0xee9f('0x18')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x19'));db[_0xee9f('0x1a')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/voiceRecording/voiceRecording.model');db[_0xee9f('0x1b')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x1c'));db[_0xee9f('0x1d')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x1e'));db[_0xee9f('0x1f')]=db[_0xee9f('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0xee9f('0x20')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x21'));db[_0xee9f('0x22')]=db['sequelize']['import']('../api/voiceDialReport/voiceDialReport.model');db[_0xee9f('0x23')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x24'));db[_0xee9f('0x25')]=db['sequelize'][_0xee9f('0x12')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xee9f('0x26')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x27'));db[_0xee9f('0x28')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x29'));db[_0xee9f('0x2a')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xee9f('0x2b')]=db['sequelize'][_0xee9f('0x12')](_0xee9f('0x2c'));db[_0xee9f('0x2d')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x2e'));db[_0xee9f('0x2f')]=db['sequelize'][_0xee9f('0x12')](_0xee9f('0x30'));db['UserMailQueue']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x31'));db[_0xee9f('0x32')]=db['sequelize']['import'](_0xee9f('0x33'));db[_0xee9f('0x34')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x35'));db[_0xee9f('0x36')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x37'));db['UserWhatsappQueue']=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xee9f('0x38')]=db['sequelize'][_0xee9f('0x12')]('../api/mailServerIn/mailServerIn.model');db[_0xee9f('0x39')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x3a'));db[_0xee9f('0x3b')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x3c'));db[_0xee9f('0x3d')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x3e'));db['MailSubstatus']=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/mailSubstatus/mailSubstatus.model');db[_0xee9f('0x3f')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x40'));db[_0xee9f('0x41')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x42'));db[_0xee9f('0x43')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x44'));db[_0xee9f('0x45')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x46'));db[_0xee9f('0x47')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x48'));db['DashboardItem']=db['sequelize']['import'](_0xee9f('0x49'));db[_0xee9f('0x4a')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x4b'));db[_0xee9f('0x4c')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x4d'));db[_0xee9f('0x4e')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x4f'));db[_0xee9f('0x50')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x51'));db['FaxQueue']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x52'));db['FaxQueueReport']=db[_0xee9f('0x1')]['import'](_0xee9f('0x53'));db[_0xee9f('0x54')]=db['sequelize'][_0xee9f('0x12')]('../api/smsAccount/smsAccount.model');db[_0xee9f('0x55')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x56'));db[_0xee9f('0x57')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/smsInteraction/smsInteraction.model');db[_0xee9f('0x58')]=db['sequelize']['import'](_0xee9f('0x59'));db[_0xee9f('0x5a')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x5b'));db[_0xee9f('0x5c')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x5d'));db['OpenchannelInteraction']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x5e'));db[_0xee9f('0x5f')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x60'));db['OpenchannelQueue']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x61'));db[_0xee9f('0x62')]=db['sequelize'][_0xee9f('0x12')]('../api/chatWebsite/chatWebsite.model');db[_0xee9f('0x63')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xee9f('0x64')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x65'));db[_0xee9f('0x66')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x67'));db['ChatMessage']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x68'));db[_0xee9f('0x69')]=db['sequelize'][_0xee9f('0x12')](_0xee9f('0x6a'));db[_0xee9f('0x6b')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x6c'));db[_0xee9f('0x6d')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x6e'));db['ChatProactiveAction']=db[_0xee9f('0x1')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db['sequelize'][_0xee9f('0x12')]('../api/cmCompany/cmCompany.model');db[_0xee9f('0x6f')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/cmContact/cmContact.model');db[_0xee9f('0x70')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/cmHopper/cmHopper.model');db[_0xee9f('0x71')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x72'));db['CmHopperFinal']=db['sequelize'][_0xee9f('0x12')](_0xee9f('0x73'));db[_0xee9f('0x74')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x75'));db['ReportAgentPreview']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x76'));db['CmCustomField']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x77'));db[_0xee9f('0x78')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x79'));db[_0xee9f('0x7a')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/automation/automation.model');db['CannedAnswer']=db['sequelize'][_0xee9f('0x12')](_0xee9f('0x7b'));db[_0xee9f('0x7c')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x7d'));db[_0xee9f('0x7e')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x7f'));db[_0xee9f('0x80')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x81'));db['Pause']=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/pause/pause.model');db[_0xee9f('0x82')]=db['sequelize'][_0xee9f('0x12')]('../api/cdr/cdr.model');db[_0xee9f('0x83')]=db['sequelize']['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xee9f('0x84')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/schedule/schedule.model');db[_0xee9f('0x85')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x86'));db[_0xee9f('0x87')]=db['sequelize']['import']('../api/tag/tag.model');db[_0xee9f('0x88')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x89'));db[_0xee9f('0x8a')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x8b'));db[_0xee9f('0x8c')]=db['sequelize'][_0xee9f('0x12')](_0xee9f('0x8d'));db[_0xee9f('0x8e')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x8f'));db['Trigger']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x90'));db[_0xee9f('0x91')]=db['sequelize']['import'](_0xee9f('0x92'));db[_0xee9f('0x93')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x94'));db[_0xee9f('0x95')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/integrationReport/integrationReport.model');db[_0xee9f('0x96')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x97'));db[_0xee9f('0x98')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x99'));db[_0xee9f('0x9a')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xee9f('0x9b')]=db[_0xee9f('0x1')]['import'](_0xee9f('0x9c'));db['AnalyticFieldReport']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x9d'));db[_0xee9f('0x9e')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x9f'));db[_0xee9f('0xa0')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xee9f('0xa1')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xee9f('0xa2')]=db[_0xee9f('0x1')]['import'](_0xee9f('0xa3'));db[_0xee9f('0xa4')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xa5'));db[_0xee9f('0xa6')]=db['sequelize'][_0xee9f('0x12')](_0xee9f('0xa7'));db['SugarcrmField']=db['sequelize'][_0xee9f('0x12')](_0xee9f('0xa8'));db[_0xee9f('0xa9')]=db['sequelize'][_0xee9f('0x12')]('../api/intDeskAccount/intDeskAccount.model');db[_0xee9f('0xaa')]=db['sequelize'][_0xee9f('0x12')](_0xee9f('0xab'));db[_0xee9f('0xac')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/intDeskField/intDeskField.model');db[_0xee9f('0xad')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xae'));db[_0xee9f('0xaf')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xb0'));db[_0xee9f('0xb1')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xb2'));db[_0xee9f('0xb3')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xee9f('0xb4')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xb5'));db[_0xee9f('0xb6')]=db['sequelize'][_0xee9f('0x12')]('../api/intZendeskField/intZendeskField.model');db[_0xee9f('0xb7')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xb8'));db[_0xee9f('0xb9')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xba'));db[_0xee9f('0xbb')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xee9f('0xbc')]=db['sequelize'][_0xee9f('0x12')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xee9f('0xbd')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xbe'));db[_0xee9f('0xbf')]=db[_0xee9f('0x1')]['import']('../api/intVtigerField/intVtigerField.model');db[_0xee9f('0xc0')]=db[_0xee9f('0x1')]['import'](_0xee9f('0xc1'));db[_0xee9f('0xc2')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xc3'));db[_0xee9f('0xc4')]=db[_0xee9f('0x1')]['import']('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xc5'));db[_0xee9f('0xc6')]=db['sequelize'][_0xee9f('0x12')](_0xee9f('0xc7'));db[_0xee9f('0xc8')]=db[_0xee9f('0x1')]['import'](_0xee9f('0xc9'));db[_0xee9f('0xca')]=db['sequelize'][_0xee9f('0x12')](_0xee9f('0xcb'));db['FreshsalesConfiguration']=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xee9f('0xcc')]=db[_0xee9f('0x1')]['import'](_0xee9f('0xcd'));db['Integration']=db['sequelize'][_0xee9f('0x12')](_0xee9f('0x94'));db[_0xee9f('0xce')]=db['sequelize'][_0xee9f('0x12')](_0xee9f('0xcf'));db[_0xee9f('0xd0')]=db['sequelize'][_0xee9f('0x12')](_0xee9f('0xd1'));db[_0xee9f('0xd2')]=db[_0xee9f('0x1')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0xee9f('0x1')]['import'](_0xee9f('0xd3'));db[_0xee9f('0xd4')]=db[_0xee9f('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xee9f('0xd5')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xd6'));db[_0xee9f('0xd7')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xd8'));db[_0xee9f('0xd9')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xda'));db['SquareDetailsReport']=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize']['import'](_0xee9f('0xdb'));db['SquareOdbc']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xdc'));db[_0xee9f('0xdd')]=db[_0xee9f('0x1')]['import']('../api/squareProject/squareProject.model');db[_0xee9f('0xde')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xdf'));db[_0xee9f('0xe0')]=db[_0xee9f('0x1')]['import'](_0xee9f('0xe1'));db[_0xee9f('0xe2')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xe3'));db[_0xee9f('0xe4')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/license/license.model');db[_0xee9f('0xe5')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xe6'));db['Migration']=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/migration/migration.model');db[_0xee9f('0xe7')]=db['sequelize']['import'](_0xee9f('0xe8'));db[_0xee9f('0xe9')]=db['sequelize'][_0xee9f('0x12')]('../api/plugin/plugin.model');db[_0xee9f('0xea')]=db[_0xee9f('0x1')]['import'](_0xee9f('0xeb'));db[_0xee9f('0xec')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xed'));db[_0xee9f('0xee')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xef'));db[_0xee9f('0xf0')]=db[_0xee9f('0x1')]['import'](_0xee9f('0xf1'));db[_0xee9f('0xf2')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xf3'));db[_0xee9f('0xf4')]=db[_0xee9f('0x1')]['import']('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0xee9f('0xf5')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0xee9f('0xf6')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0xf7'));db[_0xee9f('0xf8')]=db[_0xee9f('0x1')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0xee9f('0xf9')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/whatsappApplication/whatsappApplication.model');db[_0xee9f('0xfa')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xee9f('0xfb')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/whatsappMessage/whatsappMessage.model');db[_0xee9f('0xfc')]=db[_0xee9f('0x1')]['import'](_0xee9f('0xfd'));db[_0xee9f('0xfe')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xee9f('0xff')]=db[_0xee9f('0x1')][_0xee9f('0x12')]('../api/whatsappQueue/whatsappQueue.model');db[_0xee9f('0x100')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x101'));db[_0xee9f('0x102')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x103'));db[_0xee9f('0x104')]=db['sequelize'][_0xee9f('0x12')](_0xee9f('0x105'));db['UserVoicePrefix']=db[_0xee9f('0x1')]['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0xee9f('0x106')]=db[_0xee9f('0x1')][_0xee9f('0x12')](_0xee9f('0x107'));db[_0xee9f('0x108')]['hasOne'](db[_0xee9f('0x1d')],{'as':_0xee9f('0x1d'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x108')]['hasOne'](db['UserSetting'],{'as':'userSetting','onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x108')][_0xee9f('0x10b')](db[_0xee9f('0x1a')],{'as':_0xee9f('0x10c'),'foreignKey':'UserId'});db['User'][_0xee9f('0x10b')](db[_0xee9f('0x2b')],{'as':'VoiceQueuesRt','foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x108')][_0xee9f('0x10b')](db[_0xee9f('0x14')],{'as':_0xee9f('0x10d'),'onDelete':'cascade','hooks':!![]});db[_0xee9f('0x108')]['hasMany'](db[_0xee9f('0x10e')],{'as':_0xee9f('0x10f'),'foreignKey':'UserId'});db['User'][_0xee9f('0x10b')](db[_0xee9f('0x74')],{'as':'HopperHistory','foreignKey':'UserId'});db['User'][_0xee9f('0x10b')](db[_0xee9f('0x110')],{'as':_0xee9f('0x110'),'foreignKey':'UserId'});db[_0xee9f('0x108')][_0xee9f('0x10b')](db[_0xee9f('0x111')],{'as':'OpenchannelInteractions','foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x108')][_0xee9f('0x10b')](db['ChatInteraction'],{'as':_0xee9f('0x112'),'foreignKey':_0xee9f('0x10a')});db['User'][_0xee9f('0x10b')](db[_0xee9f('0x57')],{'as':'SmsInteractions','foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x108')][_0xee9f('0x10b')](db[_0xee9f('0x4e')],{'as':_0xee9f('0x113'),'foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x108')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':'UserId'});db['User'][_0xee9f('0x10b')](db[_0xee9f('0xfa')],{'as':_0xee9f('0x114'),'foreignKey':_0xee9f('0x10a')});db['User'][_0xee9f('0x10b')](db[_0xee9f('0xf6')],{'as':_0xee9f('0x115'),'foreignKey':'SenderId'});db[_0xee9f('0x108')][_0xee9f('0x116')](db['UserProfile'],{'as':_0xee9f('0xf4'),'foreignKey':'userProfileId'});db[_0xee9f('0x108')][_0xee9f('0x117')](db['ChatGroup'],{'as':_0xee9f('0x118'),'through':_0xee9f('0x119')});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0x6f')],{'as':'Contacts','through':_0xee9f('0x11a')});db['User'][_0xee9f('0x117')](db['CmList'],{'as':_0xee9f('0x11b'),'through':_0xee9f('0x11c')});db['User'][_0xee9f('0x117')](db[_0xee9f('0xe2')],{'through':'user_has_teams'});db['User']['belongsToMany'](db[_0xee9f('0x3f')],{'as':_0xee9f('0x11d'),'through':'user_has_mail_interactions'});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0x66')],{'as':_0xee9f('0x112'),'through':_0xee9f('0x11e')});db['User'][_0xee9f('0x117')](db[_0xee9f('0x4e')],{'as':_0xee9f('0x113'),'through':'user_has_fax_interactions'});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0x57')],{'as':_0xee9f('0x11f'),'through':_0xee9f('0x120')});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0x111')],{'as':_0xee9f('0x121'),'through':_0xee9f('0x122')});db['User'][_0xee9f('0x117')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0xee9f('0x123')});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0x18')],{'as':_0xee9f('0x124'),'through':_0xee9f('0x2d'),'required':![]});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0xf2')],{'as':_0xee9f('0x125'),'through':_0xee9f('0x126'),'required':![]});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0x3d')],{'as':_0xee9f('0x127'),'through':'UserMailQueue','required':![]});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0x6b')],{'as':_0xee9f('0x128'),'through':_0xee9f('0x2f'),'required':![],'hooks':!![]});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0x129')],{'as':'FaxQueues','through':_0xee9f('0x32'),'required':![]});db[_0xee9f('0x108')][_0xee9f('0x117')](db['SmsQueue'],{'as':_0xee9f('0x12a'),'through':_0xee9f('0x34'),'required':![]});db['User'][_0xee9f('0x117')](db[_0xee9f('0x12b')],{'as':_0xee9f('0x12c'),'through':'UserOpenchannelQueue','required':![]});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0xff')],{'as':'WhatsappQueues','through':_0xee9f('0x12d'),'required':![]});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0xf0')],{'through':_0xee9f('0x11c')});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0x62')],{'as':'ChatWebsites','through':_0xee9f('0x12e')});db['User'][_0xee9f('0x117')](db[_0xee9f('0x4a')],{'as':_0xee9f('0x12f'),'through':_0xee9f('0x130')});db['User'][_0xee9f('0x117')](db[_0xee9f('0x3b')],{'as':'MailAccounts','through':_0xee9f('0x131')});db['User'][_0xee9f('0x117')](db[_0xee9f('0x5c')],{'as':_0xee9f('0x132'),'through':_0xee9f('0x133')});db[_0xee9f('0x108')]['belongsToMany'](db[_0xee9f('0x54')],{'as':_0xee9f('0x134'),'through':_0xee9f('0x135')});db['User'][_0xee9f('0x117')](db['WhatsappAccount'],{'as':_0xee9f('0x136'),'through':_0xee9f('0x137')});db[_0xee9f('0x108')][_0xee9f('0x117')](db[_0xee9f('0xdd')],{'as':_0xee9f('0x138'),'through':_0xee9f('0x139')});db['VoiceChanSpy']['hasMany'](db[_0xee9f('0x14')],{'as':'SpiedAgents','onDelete':_0xee9f('0x109'),'foreignKey':'ChanSpyId'});db[_0xee9f('0x13a')][_0xee9f('0x10b')](db[_0xee9f('0x14')],{'onDelete':_0xee9f('0x109')});db[_0xee9f('0x14')][_0xee9f('0x10b')](db[_0xee9f('0x14')],{'as':_0xee9f('0x13b'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0x16')][_0xee9f('0x117')](db['Sound'],{'as':_0xee9f('0x13c'),'through':'moh_has_sounds'});db[_0xee9f('0x18')][_0xee9f('0x10b')](db[_0xee9f('0x2b')],{'as':_0xee9f('0x13d'),'foreignKey':_0xee9f('0x13e')});db[_0xee9f('0x18')][_0xee9f('0x10b')](db[_0xee9f('0x70')],{'as':'Hoppers','foreignKey':_0xee9f('0x13e')});db['VoiceQueue'][_0xee9f('0x10b')](db[_0xee9f('0x10e')],{'as':_0xee9f('0x10f'),'foreignKey':_0xee9f('0x13e')});db[_0xee9f('0x18')][_0xee9f('0x10b')](db[_0xee9f('0x74')],{'as':_0xee9f('0x13f'),'foreignKey':_0xee9f('0x13e')});db[_0xee9f('0x18')][_0xee9f('0x10b')](db[_0xee9f('0x110')],{'as':_0xee9f('0x110'),'foreignKey':'VoiceQueueId'});db[_0xee9f('0x18')][_0xee9f('0x10b')](db[_0xee9f('0x71')],{'as':_0xee9f('0x140'),'foreignKey':_0xee9f('0x13e')});db[_0xee9f('0x18')][_0xee9f('0x10b')](db['JscriptySessionReport'],{'as':_0xee9f('0x141'),'foreignKey':_0xee9f('0x13e')});db[_0xee9f('0x18')][_0xee9f('0x116')](db['Trunk'],{'as':'Trunk','foreignKey':_0xee9f('0x142')});db['VoiceQueue'][_0xee9f('0x116')](db[_0xee9f('0x28')],{'as':'TrunkBackup','foreignKey':_0xee9f('0x143')});db[_0xee9f('0x18')][_0xee9f('0x116')](db['Interval'],{'as':_0xee9f('0x80'),'foreignKey':_0xee9f('0x144')});db[_0xee9f('0x18')][_0xee9f('0x116')](db[_0xee9f('0x145')],{'as':_0xee9f('0x146'),'foreignKey':_0xee9f('0x147')});db['VoiceQueue'][_0xee9f('0x117')](db[_0xee9f('0xf0')],{'as':_0xee9f('0x11b'),'through':_0xee9f('0x148')});db[_0xee9f('0x18')][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':_0xee9f('0x149'),'through':_0xee9f('0x2d')});db[_0xee9f('0x18')][_0xee9f('0x117')](db[_0xee9f('0xe2')],{'as':_0xee9f('0x14a'),'through':_0xee9f('0x102')});db[_0xee9f('0x18')]['belongsToMany'](db['CmList'],{'as':_0xee9f('0x14b'),'through':_0xee9f('0x14c')});db[_0xee9f('0x1a')]['belongsTo'](db['User'],{'as':_0xee9f('0x108'),'foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x1b')]['belongsTo'](db['User'],{'as':_0xee9f('0x108'),'foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x1d')][_0xee9f('0x10b')](db[_0xee9f('0x1f')],{'as':_0xee9f('0x14d'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x14e'),'sourceKey':'mailbox'});db[_0xee9f('0x1f')][_0xee9f('0x116')](db[_0xee9f('0x1d')],{'foreignKey':'mailboxuser','targetKey':_0xee9f('0x14f')});db[_0xee9f('0x20')][_0xee9f('0x10b')](db['VoiceQueueReport'],{'as':_0xee9f('0x150'),'foreignKey':_0xee9f('0x151'),'constraints':![]});db[_0xee9f('0x20')][_0xee9f('0x10b')](db[_0xee9f('0x23')],{'as':'AgentReports','foreignKey':_0xee9f('0x151'),'constraints':![]});db[_0xee9f('0x20')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'as':_0xee9f('0x108'),'foreignKey':'UserId'});db['VoiceCallReport']['belongsTo'](db['CmContact'],{'as':_0xee9f('0x152'),'foreignKey':'ContactId'});db[_0xee9f('0x38')][_0xee9f('0x116')](db[_0xee9f('0x3b')],{'as':_0xee9f('0x3b'),'foreignKey':_0xee9f('0x153')});db['MailServerIn'][_0xee9f('0x116')](db[_0xee9f('0x100')],{'as':_0xee9f('0x100'),'foreignKey':_0xee9f('0x154'),'onDelete':_0xee9f('0x155')});db[_0xee9f('0x39')][_0xee9f('0x116')](db[_0xee9f('0x3b')],{'as':_0xee9f('0x3b'),'foreignKey':_0xee9f('0x153')});db['MailServerOut'][_0xee9f('0x116')](db[_0xee9f('0x100')],{'as':_0xee9f('0x100'),'foreignKey':_0xee9f('0x154'),'onDelete':_0xee9f('0x155')});db[_0xee9f('0x3b')][_0xee9f('0x156')](db[_0xee9f('0x38')],{'as':_0xee9f('0x157'),'onDelete':_0xee9f('0x109')});db['MailAccount'][_0xee9f('0x156')](db[_0xee9f('0x39')],{'as':_0xee9f('0x158'),'onDelete':_0xee9f('0x109')});db['MailAccount'][_0xee9f('0x10b')](db[_0xee9f('0x7c')],{'as':_0xee9f('0x159'),'foreignKey':_0xee9f('0x153'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0x3b')][_0xee9f('0x10b')](db['CannedAnswer'],{'as':_0xee9f('0x15a'),'foreignKey':_0xee9f('0x153')});db[_0xee9f('0x3b')]['hasMany'](db[_0xee9f('0x41')],{'as':_0xee9f('0x14d'),'foreignKey':_0xee9f('0x153')});db[_0xee9f('0x3b')][_0xee9f('0x10b')](db['MailInteraction'],{'as':_0xee9f('0x15b')});db[_0xee9f('0x3b')]['hasMany'](db['MailApplication'],{'as':'Applications'});db['MailAccount'][_0xee9f('0x116')](db[_0xee9f('0xf0')],{'as':'List','foreignKey':_0xee9f('0x15c')});db[_0xee9f('0x3b')]['belongsTo'](db[_0xee9f('0x8e')],{'as':_0xee9f('0x8e'),'foreignKey':_0xee9f('0x15d')});db[_0xee9f('0x3b')][_0xee9f('0x116')](db['Pause'],{'as':_0xee9f('0x146'),'foreignKey':_0xee9f('0x147')});db['MailAccount'][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':_0xee9f('0x149'),'through':_0xee9f('0x131')});db[_0xee9f('0x3d')]['belongsToMany'](db[_0xee9f('0x108')],{'as':'Agents','through':_0xee9f('0x15e')});db[_0xee9f('0x3d')][_0xee9f('0x117')](db['Team'],{'through':_0xee9f('0x15f'),'as':'Teams'});db[_0xee9f('0x3f')][_0xee9f('0x10b')](db[_0xee9f('0x41')],{'as':'Messages','onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x160')});db[_0xee9f('0x3f')][_0xee9f('0x116')](db[_0xee9f('0x3b')],{'as':'Account','foreignKey':_0xee9f('0x153')});db[_0xee9f('0x3f')][_0xee9f('0x116')](db['CmContact'],{'as':_0xee9f('0x152'),'foreignKey':_0xee9f('0x161')});db[_0xee9f('0x3f')][_0xee9f('0x116')](db['User'],{'as':_0xee9f('0x162'),'foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x3f')]['belongsToMany'](db[_0xee9f('0x87')],{'through':'mail_interaction_has_tags','as':_0xee9f('0x163')});db[_0xee9f('0x3f')][_0xee9f('0x117')](db[_0xee9f('0x87')],{'through':'mail_interaction_has_tags','as':_0xee9f('0x164')});db['MailInteraction'][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0xee9f('0x160')});db['MailMessage'][_0xee9f('0x10b')](db[_0xee9f('0xe7')],{'as':_0xee9f('0x165'),'onDelete':'cascade'});db['MailMessage'][_0xee9f('0x116')](db['User'],{'as':_0xee9f('0x108')});db['MailMessage'][_0xee9f('0x116')](db['CmContact'],{'onDelete':_0xee9f('0x109'),'as':_0xee9f('0x152')});db[_0xee9f('0x41')][_0xee9f('0x116')](db['MailInteraction'],{'as':_0xee9f('0x166'),'foreignKey':'MailInteractionId'});db[_0xee9f('0x41')][_0xee9f('0x116')](db[_0xee9f('0x3b')],{'as':'Account','foreignKey':'MailAccountId'});db['MailMessage']['belongsTo'](db['ChatWebsite'],{'as':_0xee9f('0x62'),'foreignKey':'ChatWebsiteId'});db['MailMessage'][_0xee9f('0x116')](db[_0xee9f('0x69')],{'as':_0xee9f('0x69'),'foreignKey':_0xee9f('0x167')});db['MailApplication']['belongsTo'](db[_0xee9f('0x108')],{'onDelete':_0xee9f('0x155')});db[_0xee9f('0x43')][_0xee9f('0x116')](db['MailQueue'],{'onDelete':'restrict'});db[_0xee9f('0x43')][_0xee9f('0x116')](db[_0xee9f('0x3b')],{'onDelete':_0xee9f('0x155')});db[_0xee9f('0x43')][_0xee9f('0x116')](db[_0xee9f('0x80')],{'onDelete':_0xee9f('0x155'),'foreignKey':_0xee9f('0x144')});db[_0xee9f('0x43')][_0xee9f('0x116')](db[_0xee9f('0x87')],{'onDelete':_0xee9f('0x155'),'foreignKey':_0xee9f('0x168')});db['MailQueueReport']['belongsTo'](db[_0xee9f('0x3b')],{});db[_0xee9f('0x45')]['belongsTo'](db[_0xee9f('0xf0')],{'as':_0xee9f('0x169'),'foreignKey':_0xee9f('0x15c')});db[_0xee9f('0x45')][_0xee9f('0x116')](db[_0xee9f('0x6f')],{'as':'Contact','foreignKey':_0xee9f('0x161')});db[_0xee9f('0x45')][_0xee9f('0x116')](db[_0xee9f('0x3f')],{});db[_0xee9f('0x45')][_0xee9f('0x116')](db[_0xee9f('0x41')],{});db[_0xee9f('0x45')]['belongsTo'](db[_0xee9f('0x108')],{});db[_0xee9f('0x45')][_0xee9f('0x116')](db[_0xee9f('0x3d')],{});db['Dashboard'][_0xee9f('0x10b')](db[_0xee9f('0x16a')],{'as':_0xee9f('0x16b'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0x4a')][_0xee9f('0x10b')](db[_0xee9f('0x7c')],{'as':_0xee9f('0x159'),'foreignKey':_0xee9f('0x16c'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0x4a')][_0xee9f('0x10b')](db[_0xee9f('0x16d')],{'as':'Answers','foreignKey':_0xee9f('0x16c')});db['FaxAccount']['hasMany'](db['FaxInteraction'],{'as':'Interactions'});db[_0xee9f('0x4a')][_0xee9f('0x10b')](db[_0xee9f('0x4c')],{'as':_0xee9f('0x13b')});db['FaxAccount'][_0xee9f('0x10b')](db[_0xee9f('0x14')],{'as':'Exntensions','onDelete':_0xee9f('0x109')});db[_0xee9f('0x4a')]['hasMany'](db[_0xee9f('0x50')],{'as':_0xee9f('0x14d')});db[_0xee9f('0x4a')][_0xee9f('0x116')](db[_0xee9f('0x28')],{'as':_0xee9f('0x28')});db[_0xee9f('0x4a')][_0xee9f('0x116')](db[_0xee9f('0xf0')],{'as':_0xee9f('0x169'),'foreignKey':'ListId'});db['FaxAccount'][_0xee9f('0x116')](db[_0xee9f('0x145')],{'as':_0xee9f('0x146'),'foreignKey':_0xee9f('0x147')});db[_0xee9f('0x4a')][_0xee9f('0x117')](db['User'],{'as':'Agents','through':_0xee9f('0x130')});db[_0xee9f('0x4c')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'onDelete':_0xee9f('0x155')});db[_0xee9f('0x4c')][_0xee9f('0x116')](db['FaxQueue'],{'onDelete':_0xee9f('0x155')});db[_0xee9f('0x4c')][_0xee9f('0x116')](db[_0xee9f('0x4a')],{'onDelete':_0xee9f('0x155')});db[_0xee9f('0x4c')][_0xee9f('0x116')](db[_0xee9f('0x87')],{'onDelete':_0xee9f('0x155'),'foreignKey':_0xee9f('0x168')});db['FaxInteraction'][_0xee9f('0x10b')](db[_0xee9f('0x50')],{'as':_0xee9f('0x14d'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x16e')});db[_0xee9f('0x4e')][_0xee9f('0x116')](db[_0xee9f('0x4a')],{'as':'Account','foreignKey':_0xee9f('0x16c')});db[_0xee9f('0x4e')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xee9f('0x4e')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'as':'Owner','foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x4e')]['belongsToMany'](db[_0xee9f('0x87')],{'through':_0xee9f('0x16f'),'as':'Tags'});db['FaxInteraction']['belongsToMany'](db['Tag'],{'through':_0xee9f('0x16f'),'as':_0xee9f('0x164')});db[_0xee9f('0x4e')][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':_0xee9f('0x170'),'through':_0xee9f('0x171'),'foreignKey':_0xee9f('0x16e')});db[_0xee9f('0x50')]['belongsTo'](db['User'],{'onDelete':_0xee9f('0x109'),'as':_0xee9f('0x108')});db['FaxMessage'][_0xee9f('0x116')](db[_0xee9f('0x4e')],{'as':_0xee9f('0x166'),'foreignKey':_0xee9f('0x16e')});db[_0xee9f('0x50')][_0xee9f('0x116')](db[_0xee9f('0x6f')],{'onDelete':'cascade','as':_0xee9f('0x152')});db[_0xee9f('0x50')]['belongsTo'](db[_0xee9f('0xe7')],{'as':_0xee9f('0xe7'),'foreignKey':_0xee9f('0x172')});db[_0xee9f('0x50')][_0xee9f('0x116')](db[_0xee9f('0x4a')],{'as':_0xee9f('0x173'),'foreignKey':_0xee9f('0x16c')});db['FaxQueue']['belongsToMany'](db[_0xee9f('0x108')],{'as':_0xee9f('0x149'),'through':_0xee9f('0x32')});db[_0xee9f('0x129')]['belongsToMany'](db[_0xee9f('0xe2')],{'through':_0xee9f('0x174'),'as':_0xee9f('0x14a')});db[_0xee9f('0x175')][_0xee9f('0x116')](db[_0xee9f('0x4a')],{});db[_0xee9f('0x175')][_0xee9f('0x116')](db[_0xee9f('0xf0')],{'as':_0xee9f('0x169'),'foreignKey':_0xee9f('0x15c')});db[_0xee9f('0x175')][_0xee9f('0x116')](db[_0xee9f('0x6f')],{'as':'Contact','foreignKey':'ContactId'});db[_0xee9f('0x175')]['belongsTo'](db[_0xee9f('0x4e')],{});db[_0xee9f('0x175')][_0xee9f('0x116')](db[_0xee9f('0x50')],{});db['FaxQueueReport'][_0xee9f('0x116')](db[_0xee9f('0x108')],{});db[_0xee9f('0x175')][_0xee9f('0x116')](db['FaxQueue'],{});db[_0xee9f('0x54')][_0xee9f('0x10b')](db['Disposition'],{'as':_0xee9f('0x159'),'foreignKey':_0xee9f('0x176'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0x54')][_0xee9f('0x10b')](db[_0xee9f('0x16d')],{'as':_0xee9f('0x15a'),'foreignKey':_0xee9f('0x176')});db[_0xee9f('0x54')]['hasMany'](db[_0xee9f('0x58')],{'as':'Messages','foreignKey':_0xee9f('0x176')});db[_0xee9f('0x54')][_0xee9f('0x10b')](db['SmsInteraction'],{'as':_0xee9f('0x15b')});db[_0xee9f('0x54')][_0xee9f('0x10b')](db[_0xee9f('0x55')],{'as':_0xee9f('0x13b')});db[_0xee9f('0x54')][_0xee9f('0x116')](db[_0xee9f('0xf0')],{'as':_0xee9f('0x169'),'foreignKey':_0xee9f('0x15c')});db[_0xee9f('0x54')][_0xee9f('0x116')](db[_0xee9f('0x145')],{'as':_0xee9f('0x146'),'foreignKey':_0xee9f('0x147')});db[_0xee9f('0x54')][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':'Agents','through':'user_has_sms_accounts'});db[_0xee9f('0x55')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'onDelete':'restrict'});db[_0xee9f('0x55')][_0xee9f('0x116')](db[_0xee9f('0x5a')],{'onDelete':_0xee9f('0x155')});db[_0xee9f('0x55')][_0xee9f('0x116')](db[_0xee9f('0x54')],{'onDelete':'restrict'});db[_0xee9f('0x55')][_0xee9f('0x116')](db[_0xee9f('0x80')],{'onDelete':_0xee9f('0x155'),'foreignKey':'IntervalId'});db[_0xee9f('0x55')][_0xee9f('0x116')](db[_0xee9f('0x87')],{'onDelete':_0xee9f('0x155'),'foreignKey':'TagId'});db[_0xee9f('0x57')][_0xee9f('0x10b')](db['SmsMessage'],{'as':_0xee9f('0x14d'),'onDelete':'cascade','foreignKey':_0xee9f('0x177')});db[_0xee9f('0x57')][_0xee9f('0x116')](db['SmsAccount'],{'as':_0xee9f('0x173'),'foreignKey':_0xee9f('0x176')});db['SmsInteraction'][_0xee9f('0x116')](db[_0xee9f('0x6f')],{'as':'Contact','foreignKey':_0xee9f('0x161')});db['SmsInteraction'][_0xee9f('0x116')](db[_0xee9f('0x108')],{'as':_0xee9f('0x162'),'foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x57')]['belongsToMany'](db['Tag'],{'through':_0xee9f('0x178'),'as':_0xee9f('0x163')});db[_0xee9f('0x57')][_0xee9f('0x117')](db[_0xee9f('0x87')],{'through':_0xee9f('0x178'),'as':_0xee9f('0x164')});db[_0xee9f('0x57')]['belongsToMany'](db[_0xee9f('0x108')],{'as':_0xee9f('0x170'),'through':'user_has_sms_interactions','foreignKey':_0xee9f('0x177')});db[_0xee9f('0x58')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'as':_0xee9f('0x108')});db[_0xee9f('0x58')][_0xee9f('0x116')](db[_0xee9f('0x6f')],{'onDelete':_0xee9f('0x109'),'as':'Contact'});db[_0xee9f('0x58')][_0xee9f('0x116')](db[_0xee9f('0x57')],{'onDelete':_0xee9f('0x109'),'as':_0xee9f('0x166'),'foreignKey':_0xee9f('0x177')});db[_0xee9f('0x58')][_0xee9f('0x116')](db[_0xee9f('0x54')],{'as':_0xee9f('0x173'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':_0xee9f('0x149'),'through':_0xee9f('0x34'),'foreignKey':_0xee9f('0x179')});db[_0xee9f('0x5a')][_0xee9f('0x117')](db[_0xee9f('0xe2')],{'through':_0xee9f('0x17a'),'as':'Teams'});db['OpenchannelAccount']['hasMany'](db[_0xee9f('0x7c')],{'as':_0xee9f('0x159'),'foreignKey':_0xee9f('0x17b'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0x5c')][_0xee9f('0x10b')](db['CannedAnswer'],{'as':_0xee9f('0x15a'),'foreignKey':_0xee9f('0x17b')});db[_0xee9f('0x5c')][_0xee9f('0x10b')](db[_0xee9f('0x111')],{'as':'Interactions','foreignKey':_0xee9f('0x17b')});db[_0xee9f('0x5c')][_0xee9f('0x10b')](db[_0xee9f('0x5f')],{'as':_0xee9f('0x14d'),'foreignKey':_0xee9f('0x17b')});db[_0xee9f('0x5c')]['hasMany'](db[_0xee9f('0x17c')],{'as':'Applications','foreignKey':_0xee9f('0x17b')});db[_0xee9f('0x5c')]['belongsTo'](db[_0xee9f('0xf0')],{'as':_0xee9f('0x169'),'foreignKey':_0xee9f('0x15c')});db[_0xee9f('0x5c')][_0xee9f('0x116')](db[_0xee9f('0x145')],{'as':'mandatoryDispositionPause','foreignKey':_0xee9f('0x147')});db['OpenchannelAccount'][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':_0xee9f('0x149'),'through':'user_has_openchannel_accounts'});db[_0xee9f('0x17c')]['belongsTo'](db[_0xee9f('0x108')],{'onDelete':'restrict'});db[_0xee9f('0x17c')]['belongsTo'](db[_0xee9f('0x12b')],{'onDelete':_0xee9f('0x155'),'foreignKey':_0xee9f('0x17d')});db[_0xee9f('0x17c')][_0xee9f('0x116')](db[_0xee9f('0x5c')],{'onDelete':_0xee9f('0x155'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication']['belongsTo'](db[_0xee9f('0x80')],{'onDelete':_0xee9f('0x155'),'foreignKey':'IntervalId'});db[_0xee9f('0x17c')][_0xee9f('0x116')](db[_0xee9f('0x87')],{'onDelete':_0xee9f('0x155'),'foreignKey':_0xee9f('0x168')});db[_0xee9f('0x111')]['hasMany'](db['OpenchannelMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xee9f('0x17e')});db[_0xee9f('0x111')]['belongsTo'](db[_0xee9f('0x5c')],{'as':'Account','foreignKey':_0xee9f('0x17b')});db[_0xee9f('0x111')]['belongsTo'](db[_0xee9f('0x6f')],{'as':_0xee9f('0x152'),'foreignKey':'ContactId'});db[_0xee9f('0x111')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'as':_0xee9f('0x162'),'foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x111')][_0xee9f('0x117')](db[_0xee9f('0x87')],{'through':_0xee9f('0x17f'),'as':'Tags'});db[_0xee9f('0x111')][_0xee9f('0x117')](db[_0xee9f('0x87')],{'through':_0xee9f('0x17f'),'as':_0xee9f('0x164')});db[_0xee9f('0x111')][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':_0xee9f('0x170'),'through':_0xee9f('0x122'),'foreignKey':_0xee9f('0x17e')});db[_0xee9f('0x5f')][_0xee9f('0x116')](db['User'],{'onDelete':_0xee9f('0x109'),'as':_0xee9f('0x108')});db['OpenchannelMessage'][_0xee9f('0x116')](db['CmContact'],{'onDelete':_0xee9f('0x109'),'as':'Contact'});db['OpenchannelMessage'][_0xee9f('0x116')](db[_0xee9f('0x111')],{'onDelete':_0xee9f('0x109'),'as':_0xee9f('0x166'),'foreignKey':'OpenchannelInteractionId'});db[_0xee9f('0x5f')][_0xee9f('0x116')](db[_0xee9f('0xe7')],{'as':_0xee9f('0xe7'),'foreignKey':'AttachmentId'});db[_0xee9f('0x5f')][_0xee9f('0x116')](db[_0xee9f('0x5c')],{'as':_0xee9f('0x173'),'foreignKey':_0xee9f('0x17b')});db[_0xee9f('0x12b')]['belongsToMany'](db[_0xee9f('0x108')],{'as':_0xee9f('0x149'),'through':_0xee9f('0x36'),'foreignKey':_0xee9f('0x17d')});db['OpenchannelQueue'][_0xee9f('0x117')](db[_0xee9f('0xe2')],{'through':_0xee9f('0x180'),'as':'Teams'});db[_0xee9f('0x62')][_0xee9f('0x10b')](db[_0xee9f('0x7c')],{'as':_0xee9f('0x159'),'foreignKey':_0xee9f('0x181'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0x62')][_0xee9f('0x10b')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xee9f('0x181')});db[_0xee9f('0x62')][_0xee9f('0x10b')](db[_0xee9f('0x182')],{'as':_0xee9f('0x183')});db['ChatWebsite'][_0xee9f('0x10b')](db[_0xee9f('0x66')],{'as':_0xee9f('0x15b')});db[_0xee9f('0x62')][_0xee9f('0x10b')](db[_0xee9f('0x64')],{'as':'Applications'});db[_0xee9f('0x62')][_0xee9f('0x10b')](db[_0xee9f('0x184')],{'as':_0xee9f('0x14d')});db['ChatWebsite']['belongsTo'](db[_0xee9f('0xf0')],{'as':_0xee9f('0x169'),'foreignKey':_0xee9f('0x15c')});db[_0xee9f('0x62')][_0xee9f('0x116')](db[_0xee9f('0x80')],{'as':_0xee9f('0x80'),'foreignKey':_0xee9f('0x144')});db[_0xee9f('0x62')][_0xee9f('0x116')](db[_0xee9f('0x3b')],{'as':_0xee9f('0x3b'),'foreignKey':_0xee9f('0x153')});db[_0xee9f('0x62')]['belongsTo'](db['Pause'],{'as':_0xee9f('0x146'),'foreignKey':_0xee9f('0x147')});db[_0xee9f('0x62')]['belongsToMany'](db[_0xee9f('0x108')],{'as':_0xee9f('0x149'),'through':_0xee9f('0x12e')});db[_0xee9f('0x63')][_0xee9f('0x116')](db[_0xee9f('0x5c')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xee9f('0xf0')],{'as':'List','foreignKey':_0xee9f('0x15c')});db['OpenchannelQueueReport'][_0xee9f('0x116')](db[_0xee9f('0x6f')],{'as':_0xee9f('0x152'),'foreignKey':_0xee9f('0x161')});db[_0xee9f('0x63')][_0xee9f('0x116')](db['OpenchannelInteraction'],{});db[_0xee9f('0x63')][_0xee9f('0x116')](db[_0xee9f('0x5f')],{});db['OpenchannelQueueReport']['belongsTo'](db['User'],{});db['OpenchannelQueueReport'][_0xee9f('0x116')](db['OpenchannelQueue'],{});db[_0xee9f('0x64')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'as':_0xee9f('0x185'),'foreignKey':_0xee9f('0x10a'),'onDelete':_0xee9f('0x155')});db[_0xee9f('0x64')][_0xee9f('0x116')](db['ChatQueue'],{'as':_0xee9f('0x186'),'foreignKey':_0xee9f('0x187'),'onDelete':_0xee9f('0x155')});db[_0xee9f('0x64')]['belongsTo'](db[_0xee9f('0x62')],{'as':_0xee9f('0x188'),'foreignKey':_0xee9f('0x181'),'onDelete':_0xee9f('0x155')});db[_0xee9f('0x64')][_0xee9f('0x116')](db[_0xee9f('0x87')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xee9f('0x66')][_0xee9f('0x10b')](db[_0xee9f('0x184')],{'as':'Messages','onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x189')});db[_0xee9f('0x66')][_0xee9f('0x116')](db[_0xee9f('0x62')],{'as':_0xee9f('0x173'),'foreignKey':'ChatWebsiteId'});db[_0xee9f('0x66')][_0xee9f('0x116')](db[_0xee9f('0x6f')],{'as':_0xee9f('0x152'),'foreignKey':'ContactId'});db[_0xee9f('0x66')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xee9f('0x10a')});db[_0xee9f('0x66')][_0xee9f('0x117')](db['Tag'],{'through':_0xee9f('0x18a'),'as':_0xee9f('0x163')});db[_0xee9f('0x66')]['belongsToMany'](db[_0xee9f('0x87')],{'through':_0xee9f('0x18a'),'as':_0xee9f('0x164')});db['ChatInteraction'][_0xee9f('0x117')](db['User'],{'as':'Users','through':_0xee9f('0x11e'),'foreignKey':'ChatInteractionId'});db[_0xee9f('0x184')][_0xee9f('0x116')](db['User'],{'onDelete':_0xee9f('0x109'),'as':'User'});db['ChatMessage'][_0xee9f('0x116')](db[_0xee9f('0x6f')],{'onDelete':_0xee9f('0x109'),'as':'Contact','foreignKey':_0xee9f('0x161')});db['ChatMessage'][_0xee9f('0x116')](db[_0xee9f('0x66')],{'onDelete':_0xee9f('0x109'),'as':_0xee9f('0x166'),'foreignKey':_0xee9f('0x189')});db['ChatMessage'][_0xee9f('0x116')](db[_0xee9f('0xe7')],{'as':'Attachment','foreignKey':_0xee9f('0x172')});db[_0xee9f('0x184')][_0xee9f('0x116')](db[_0xee9f('0x62')],{'as':'Account','foreignKey':_0xee9f('0x181')});db[_0xee9f('0x69')][_0xee9f('0x10b')](db[_0xee9f('0xe7')],{'as':_0xee9f('0x165'),'foreignKey':_0xee9f('0x167'),'onDelete':_0xee9f('0x109'),'hooks':!![]});db[_0xee9f('0x69')]['belongsTo'](db['CmContact'],{'onDelete':_0xee9f('0x109'),'as':_0xee9f('0x152'),'foreignKey':_0xee9f('0x161')});db[_0xee9f('0x69')]['belongsTo'](db['ChatWebsite'],{'as':_0xee9f('0x173'),'foreignKey':'ChatWebsiteId'});db[_0xee9f('0x6b')][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':_0xee9f('0x149'),'through':_0xee9f('0x2f'),'hooks':!![]});db[_0xee9f('0x6b')][_0xee9f('0x117')](db['Team'],{'through':_0xee9f('0x18b'),'as':_0xee9f('0x14a')});db[_0xee9f('0x6d')][_0xee9f('0x10b')](db[_0xee9f('0xd2')],{'as':_0xee9f('0x14d'),'foreignKey':_0xee9f('0x18c'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0x6d')][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':'Members','through':_0xee9f('0x119')});db[_0xee9f('0x182')][_0xee9f('0x116')](db['ChatWebsite'],{'as':_0xee9f('0x188'),'foreignKey':'ChatWebsiteId'});db[_0xee9f('0x18d')]['hasMany'](db[_0xee9f('0x6f')],{'as':_0xee9f('0x18e'),'foreignKey':_0xee9f('0x18f')});db[_0xee9f('0x6f')][_0xee9f('0x10b')](db[_0xee9f('0x8a')],{'as':_0xee9f('0x190'),'foreignKey':_0xee9f('0x191')});db['CmContact']['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xee9f('0x161')});db[_0xee9f('0x6f')][_0xee9f('0x10b')](db[_0xee9f('0x10e')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xee9f('0x6f')]['hasMany'](db[_0xee9f('0x74')],{'as':_0xee9f('0x13f'),'foreignKey':_0xee9f('0x161')});db['CmContact'][_0xee9f('0x10b')](db[_0xee9f('0x110')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0xee9f('0x6f')][_0xee9f('0x10b')](db[_0xee9f('0xd5')],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0xee9f('0x6f')][_0xee9f('0x10b')](db[_0xee9f('0x111')],{'as':_0xee9f('0x121'),'foreignKey':_0xee9f('0x161'),'onDelete':_0xee9f('0x155')});db[_0xee9f('0x6f')][_0xee9f('0x10b')](db[_0xee9f('0x66')],{'as':_0xee9f('0x112'),'foreignKey':_0xee9f('0x161'),'onDelete':_0xee9f('0x155')});db[_0xee9f('0x6f')][_0xee9f('0x10b')](db[_0xee9f('0x57')],{'as':'SmsInteractions','foreignKey':_0xee9f('0x161'),'onDelete':_0xee9f('0x155')});db[_0xee9f('0x6f')][_0xee9f('0x10b')](db[_0xee9f('0x4e')],{'as':_0xee9f('0x113'),'foreignKey':_0xee9f('0x161'),'onDelete':_0xee9f('0x155')});db[_0xee9f('0x6f')][_0xee9f('0x10b')](db[_0xee9f('0x3f')],{'as':_0xee9f('0x11d'),'foreignKey':_0xee9f('0x161'),'onDelete':_0xee9f('0x155')});db[_0xee9f('0x6f')][_0xee9f('0x116')](db[_0xee9f('0x18d')],{'as':'Company','foreignKey':_0xee9f('0x18f')});db['CmContact'][_0xee9f('0x116')](db[_0xee9f('0xf0')],{'as':_0xee9f('0x169'),'foreignKey':_0xee9f('0x15c'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0x6f')][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':'Users','through':_0xee9f('0x11a')});db['CmContact'][_0xee9f('0x117')](db[_0xee9f('0x87')],{'as':_0xee9f('0x163'),'through':'cm_contact_has_tags'});db[_0xee9f('0x6f')]['belongsToMany'](db[_0xee9f('0x87')],{'through':'cm_contact_has_tags','as':_0xee9f('0x164')});db[_0xee9f('0x70')][_0xee9f('0x10b')](db['CmHopperAdditionalPhone'],{'as':_0xee9f('0x192'),'foreignKey':_0xee9f('0x193')});db[_0xee9f('0x70')][_0xee9f('0x116')](db[_0xee9f('0x6f')],{'as':_0xee9f('0x152'),'foreignKey':'ContactId','onDelete':_0xee9f('0x109')});db[_0xee9f('0x70')]['belongsTo'](db[_0xee9f('0xf0')],{'as':_0xee9f('0x169'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xee9f('0x70')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'as':_0xee9f('0x185'),'foreignKey':'UserId'});db['CmHopper'][_0xee9f('0x116')](db['VoiceQueue'],{'as':_0xee9f('0x186'),'foreignKey':_0xee9f('0x13e'),'onDelete':'cascade'});db['CmHopper'][_0xee9f('0x116')](db[_0xee9f('0xe5')],{'as':_0xee9f('0xe5'),'foreignKey':'CampaignId','onDelete':_0xee9f('0x109')});db['CmHopper'][_0xee9f('0x116')](db[_0xee9f('0x108')],{'as':_0xee9f('0x162'),'foreignKey':'OwnerId'});db[_0xee9f('0x71')][_0xee9f('0x116')](db[_0xee9f('0x6f')],{'as':_0xee9f('0x152'),'foreignKey':'ContactId','onDelete':_0xee9f('0x109')});db[_0xee9f('0x71')][_0xee9f('0x116')](db[_0xee9f('0xf0')],{'as':'List','foreignKey':_0xee9f('0x15c'),'onDelete':'cascade'});db[_0xee9f('0x71')][_0xee9f('0x116')](db[_0xee9f('0x18')],{'as':_0xee9f('0x186'),'foreignKey':_0xee9f('0x13e'),'onDelete':'cascade'});db['CmHopperBlack'][_0xee9f('0x116')](db['Campaign'],{'as':_0xee9f('0xe5'),'foreignKey':_0xee9f('0x194'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0x7a')]['hasMany'](db['Condition'],{'as':{'plural':_0xee9f('0x195'),'singular':_0xee9f('0x196')},'foreignKey':_0xee9f('0x197'),'onDelete':_0xee9f('0x109'),'hooks':!![]});db['Automation'][_0xee9f('0x10b')](db['Condition'],{'as':{'plural':_0xee9f('0x198'),'singular':_0xee9f('0x199')},'foreignKey':_0xee9f('0x19a'),'onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db[_0xee9f('0x78')],{'as':_0xee9f('0x19b'),'foreignKey':'AutomationId','onDelete':_0xee9f('0x109'),'hooks':!![]});db['Disposition']['hasMany'](db[_0xee9f('0x7c')],{'as':_0xee9f('0x159'),'foreignKey':_0xee9f('0x19c'),'onDelete':'cascade'});db[_0xee9f('0x80')][_0xee9f('0x10b')](db['Interval'],{'as':_0xee9f('0x19d'),'foreignKey':_0xee9f('0x144'),'onDelete':_0xee9f('0x109'),'hooks':!![],'required':![]});db[_0xee9f('0x80')][_0xee9f('0x10b')](db[_0xee9f('0x14')],{'as':_0xee9f('0x10d'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0xee9f('0x80')][_0xee9f('0x10b')](db[_0xee9f('0x43')],{'as':_0xee9f('0x19e'),'foreignKey':'IntervalId'});db[_0xee9f('0x80')][_0xee9f('0x10b')](db[_0xee9f('0x64')],{'as':_0xee9f('0x19f'),'foreignKey':_0xee9f('0x144')});db[_0xee9f('0x80')]['hasMany'](db[_0xee9f('0x4c')],{'as':'FaxApplications','foreignKey':_0xee9f('0x144')});db[_0xee9f('0x80')][_0xee9f('0x10b')](db['SmsApplication'],{'as':_0xee9f('0x1a0'),'foreignKey':_0xee9f('0x144')});db[_0xee9f('0x84')][_0xee9f('0x116')](db[_0xee9f('0x3b')],{});db[_0xee9f('0x84')][_0xee9f('0x116')](db[_0xee9f('0x98')],{'foreignKey':_0xee9f('0x1a1')});db[_0xee9f('0x84')][_0xee9f('0x116')](db[_0xee9f('0x96')],{'foreignKey':'CustomReportId'});db[_0xee9f('0x85')]['belongsToMany'](db[_0xee9f('0x16')],{'as':_0xee9f('0x1a2'),'through':_0xee9f('0x1a3'),'onDelete':_0xee9f('0x155')});db['Tag'][_0xee9f('0x117')](db[_0xee9f('0x6f')],{'through':_0xee9f('0x1a4')});db[_0xee9f('0x87')][_0xee9f('0x117')](db['ChatInteraction'],{'through':_0xee9f('0x18a')});db['Tag'][_0xee9f('0x117')](db[_0xee9f('0x3f')],{'through':_0xee9f('0x1a5')});db[_0xee9f('0x87')][_0xee9f('0x117')](db[_0xee9f('0x57')],{'through':_0xee9f('0x178')});db[_0xee9f('0x87')][_0xee9f('0x117')](db[_0xee9f('0x4e')],{'through':'fax_interaction_has_tags'});db[_0xee9f('0x87')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0xee9f('0x17f')});db[_0xee9f('0x87')][_0xee9f('0x117')](db[_0xee9f('0xfa')],{'through':_0xee9f('0x1a6')});db['CmContactHasItem']['belongsTo'](db[_0xee9f('0x88')],{'as':_0xee9f('0x1a7'),'foreignKey':_0xee9f('0x1a8')});db[_0xee9f('0x8c')][_0xee9f('0x116')](db['CmHopper'],{'as':_0xee9f('0x1a9'),'foreignKey':'CmHopperId'});db[_0xee9f('0x8a')][_0xee9f('0x116')](db['CmContact'],{'as':_0xee9f('0x152'),'foreignKey':_0xee9f('0x191')});db['Trigger'][_0xee9f('0x10b')](db['Condition'],{'as':{'plural':_0xee9f('0x1aa'),'singular':_0xee9f('0x1ab')},'foreignKey':_0xee9f('0x1ac'),'onDelete':_0xee9f('0x109'),'hooks':!![]});db[_0xee9f('0x1ad')][_0xee9f('0x10b')](db['Condition'],{'as':{'plural':_0xee9f('0x1ae'),'singular':'AnyCondition'},'foreignKey':_0xee9f('0x1af'),'onDelete':_0xee9f('0x109'),'hooks':!![]});db[_0xee9f('0x1ad')][_0xee9f('0x10b')](db['Action'],{'as':_0xee9f('0x19b'),'foreignKey':_0xee9f('0x1b0'),'onDelete':_0xee9f('0x109'),'hooks':!![]});db[_0xee9f('0x96')][_0xee9f('0x10b')](db[_0xee9f('0x1b1')],{'as':'Fields','onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1b2'),'hooks':!![]});db['AnalyticDefaultReport'][_0xee9f('0x10b')](db[_0xee9f('0x1b1')],{'as':'Fields','onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1a1')});db[_0xee9f('0x9b')][_0xee9f('0x10b')](db['AnalyticFieldReport'],{'as':_0xee9f('0x1b3'),'onDelete':_0xee9f('0x109'),'foreignKey':'MetricId'});db[_0xee9f('0x1b1')]['belongsTo'](db[_0xee9f('0x9b')],{'foreignKey':_0xee9f('0x1b4')});db[_0xee9f('0xa0')][_0xee9f('0x10b')](db['SalesforceConfiguration'],{'as':_0xee9f('0x1b5'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1b6')});db['SalesforceConfiguration'][_0xee9f('0x10b')](db[_0xee9f('0xa2')],{'as':_0xee9f('0x1b7'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1b8')});db[_0xee9f('0xa1')][_0xee9f('0x10b')](db[_0xee9f('0xa2')],{'as':_0xee9f('0x1b9'),'onDelete':_0xee9f('0x109'),'foreignKey':'DescriptionId'});db[_0xee9f('0xa1')][_0xee9f('0x10b')](db[_0xee9f('0xa2')],{'as':_0xee9f('0x1b3'),'onDelete':_0xee9f('0x109'),'foreignKey':'FieldId'});db['SalesforceConfiguration']['belongsTo'](db[_0xee9f('0xa0')],{'as':_0xee9f('0x173'),'foreignKey':_0xee9f('0x1b6')});db[_0xee9f('0xa2')][_0xee9f('0x10b')](db[_0xee9f('0xa2')],{'as':_0xee9f('0x1ba'),'foreignKey':_0xee9f('0x1b8')});db[_0xee9f('0xa2')][_0xee9f('0x10b')](db['SalesforceField'],{'as':_0xee9f('0x1bb'),'foreignKey':'DescriptionId'});db[_0xee9f('0xa2')][_0xee9f('0x10b')](db[_0xee9f('0xa2')],{'as':'Field','foreignKey':_0xee9f('0x1bc')});db['SalesforceField'][_0xee9f('0x116')](db[_0xee9f('0x91')],{'as':_0xee9f('0x91'),'foreignKey':_0xee9f('0x1bd')});db['SugarcrmAccount'][_0xee9f('0x10b')](db[_0xee9f('0xa6')],{'as':_0xee9f('0x1b5'),'onDelete':'cascade','foreignKey':_0xee9f('0x1b6')});db[_0xee9f('0xa6')][_0xee9f('0x10b')](db[_0xee9f('0x1be')],{'as':_0xee9f('0x1b7'),'onDelete':_0xee9f('0x109'),'foreignKey':'SubjectId'});db[_0xee9f('0xa6')]['hasMany'](db[_0xee9f('0x1be')],{'as':'Descriptions','onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xa6')]['hasMany'](db[_0xee9f('0x1be')],{'as':_0xee9f('0x1b3'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1bc')});db[_0xee9f('0xa6')][_0xee9f('0x116')](db[_0xee9f('0xa4')],{'as':_0xee9f('0x173'),'foreignKey':_0xee9f('0x1b6')});db[_0xee9f('0x1be')][_0xee9f('0x10b')](db[_0xee9f('0x1be')],{'as':_0xee9f('0x1ba'),'foreignKey':'SubjectId'});db[_0xee9f('0x1be')][_0xee9f('0x10b')](db[_0xee9f('0x1be')],{'as':_0xee9f('0x1bb'),'foreignKey':'DescriptionId'});db['SugarcrmField']['hasMany'](db[_0xee9f('0x1be')],{'as':_0xee9f('0x1c0'),'foreignKey':_0xee9f('0x1bc')});db['SugarcrmField']['belongsTo'](db[_0xee9f('0x91')],{'as':_0xee9f('0x91'),'foreignKey':_0xee9f('0x1bd')});db[_0xee9f('0xa9')]['hasMany'](db[_0xee9f('0xaa')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xee9f('0xaa')][_0xee9f('0x10b')](db['DeskField'],{'as':_0xee9f('0x1b7'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1b8')});db['DeskConfiguration']['hasMany'](db[_0xee9f('0xac')],{'as':_0xee9f('0x1b9'),'onDelete':'cascade','foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xaa')]['hasMany'](db[_0xee9f('0xac')],{'as':_0xee9f('0x1b3'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xee9f('0xaa')][_0xee9f('0x116')](db[_0xee9f('0xa9')],{'as':_0xee9f('0x173'),'foreignKey':_0xee9f('0x1b6')});db[_0xee9f('0xaa')]['belongsToMany'](db[_0xee9f('0x87')],{'through':_0xee9f('0x1c1')});db[_0xee9f('0xac')][_0xee9f('0x10b')](db[_0xee9f('0xac')],{'as':_0xee9f('0x1ba'),'foreignKey':_0xee9f('0x1b8')});db[_0xee9f('0xac')][_0xee9f('0x10b')](db[_0xee9f('0xac')],{'as':_0xee9f('0x1bb'),'foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xac')][_0xee9f('0x10b')](db[_0xee9f('0xac')],{'as':_0xee9f('0x1c0'),'foreignKey':'FieldId'});db[_0xee9f('0xac')][_0xee9f('0x116')](db['Variable'],{'as':_0xee9f('0x91'),'foreignKey':_0xee9f('0x1bd')});db[_0xee9f('0xad')][_0xee9f('0x10b')](db[_0xee9f('0xaf')],{'as':_0xee9f('0x1b5'),'onDelete':'cascade','foreignKey':_0xee9f('0x1b6')});db[_0xee9f('0xaf')]['hasMany'](db[_0xee9f('0xb1')],{'as':_0xee9f('0x1b7'),'onDelete':'cascade','foreignKey':_0xee9f('0x1b8')});db[_0xee9f('0xaf')][_0xee9f('0x10b')](db[_0xee9f('0xb1')],{'as':_0xee9f('0x1b9'),'onDelete':'cascade','foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xaf')]['hasMany'](db[_0xee9f('0xb1')],{'as':'Fields','onDelete':_0xee9f('0x109'),'foreignKey':'FieldId'});db[_0xee9f('0xaf')][_0xee9f('0x116')](db[_0xee9f('0xad')],{'as':_0xee9f('0x173'),'foreignKey':_0xee9f('0x1b6')});db[_0xee9f('0xb1')][_0xee9f('0x10b')](db['ZohoField'],{'as':_0xee9f('0x1ba'),'foreignKey':'SubjectId'});db['ZohoField'][_0xee9f('0x10b')](db[_0xee9f('0xb1')],{'as':_0xee9f('0x1bb'),'foreignKey':'DescriptionId'});db[_0xee9f('0xb1')][_0xee9f('0x10b')](db[_0xee9f('0xb1')],{'as':_0xee9f('0x1c0'),'foreignKey':'FieldId'});db[_0xee9f('0xb1')][_0xee9f('0x116')](db[_0xee9f('0x91')],{'as':_0xee9f('0x91'),'foreignKey':_0xee9f('0x1bd')});db['ZendeskAccount'][_0xee9f('0x10b')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xee9f('0xb4')]['hasMany'](db[_0xee9f('0xb6')],{'as':_0xee9f('0x1b7'),'foreignKey':_0xee9f('0x1b8')});db['ZendeskConfiguration'][_0xee9f('0x10b')](db['ZendeskField'],{'as':_0xee9f('0x1b9'),'foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xb4')][_0xee9f('0x10b')](db[_0xee9f('0xb6')],{'as':'Fields','foreignKey':_0xee9f('0x1bc')});db[_0xee9f('0xb4')][_0xee9f('0x116')](db[_0xee9f('0xb3')],{'as':'Account','foreignKey':_0xee9f('0x1b6')});db[_0xee9f('0xb4')]['belongsToMany'](db[_0xee9f('0x87')],{'through':_0xee9f('0x1c2')});db[_0xee9f('0xb6')][_0xee9f('0x10b')](db[_0xee9f('0xb6')],{'as':_0xee9f('0x1ba'),'foreignKey':'SubjectId'});db['ZendeskField'][_0xee9f('0x10b')](db[_0xee9f('0xb6')],{'as':_0xee9f('0x1bb'),'foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xb6')][_0xee9f('0x10b')](db[_0xee9f('0xb6')],{'as':_0xee9f('0x1c0'),'foreignKey':_0xee9f('0x1bc')});db[_0xee9f('0xb6')][_0xee9f('0x116')](db[_0xee9f('0x91')],{'as':_0xee9f('0x91'),'foreignKey':'VariableId'});db[_0xee9f('0xb7')][_0xee9f('0x10b')](db[_0xee9f('0xb9')],{'as':_0xee9f('0x1b5'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1b6')});db[_0xee9f('0xb9')][_0xee9f('0x10b')](db[_0xee9f('0xbb')],{'as':'Subjects','onDelete':_0xee9f('0x109'),'foreignKey':'SubjectId'});db[_0xee9f('0xb9')][_0xee9f('0x10b')](db[_0xee9f('0xbb')],{'as':_0xee9f('0x1b9'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xb9')][_0xee9f('0x10b')](db[_0xee9f('0xbb')],{'as':'Fields','onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1bc')});db[_0xee9f('0xb9')][_0xee9f('0x116')](db[_0xee9f('0xb7')],{'as':'Account','foreignKey':'AccountId'});db[_0xee9f('0xb9')][_0xee9f('0x117')](db[_0xee9f('0x87')],{'through':_0xee9f('0x1c3')});db[_0xee9f('0xbb')][_0xee9f('0x10b')](db[_0xee9f('0xbb')],{'as':_0xee9f('0x1ba'),'foreignKey':_0xee9f('0x1b8')});db[_0xee9f('0xbb')][_0xee9f('0x10b')](db[_0xee9f('0xbb')],{'as':_0xee9f('0x1bb'),'foreignKey':'DescriptionId'});db[_0xee9f('0xbb')][_0xee9f('0x10b')](db[_0xee9f('0xbb')],{'as':_0xee9f('0x1c0'),'foreignKey':'FieldId'});db[_0xee9f('0xbb')][_0xee9f('0x116')](db[_0xee9f('0x91')],{'as':'Variable','foreignKey':'VariableId'});db['VtigerAccount']['hasMany'](db['VtigerConfiguration'],{'as':_0xee9f('0x1b5'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1b6')});db['VtigerConfiguration'][_0xee9f('0x10b')](db['VtigerField'],{'as':_0xee9f('0x1b7'),'foreignKey':_0xee9f('0x1b8')});db[_0xee9f('0xbd')][_0xee9f('0x10b')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xbd')]['hasMany'](db[_0xee9f('0xbf')],{'as':_0xee9f('0x1b3'),'foreignKey':_0xee9f('0x1bc')});db[_0xee9f('0xbd')][_0xee9f('0x116')](db['VtigerAccount'],{'as':'Account','foreignKey':_0xee9f('0x1b6')});db[_0xee9f('0xbf')][_0xee9f('0x10b')](db[_0xee9f('0xbf')],{'as':_0xee9f('0x1ba'),'foreignKey':'SubjectId'});db[_0xee9f('0xbf')][_0xee9f('0x10b')](db[_0xee9f('0xbf')],{'as':'Description','foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xbf')]['hasMany'](db[_0xee9f('0xbf')],{'as':'Field','foreignKey':_0xee9f('0x1bc')});db[_0xee9f('0xbf')][_0xee9f('0x116')](db[_0xee9f('0x91')],{'as':'Variable','foreignKey':_0xee9f('0x1bd')});db[_0xee9f('0xc0')][_0xee9f('0x10b')](db[_0xee9f('0xc2')],{'as':_0xee9f('0x1b5'),'onDelete':_0xee9f('0x109'),'foreignKey':'AccountId'});db[_0xee9f('0xc2')][_0xee9f('0x10b')](db[_0xee9f('0xc4')],{'as':'Subjects','foreignKey':_0xee9f('0x1b8')});db[_0xee9f('0xc2')][_0xee9f('0x10b')](db[_0xee9f('0xc4')],{'as':_0xee9f('0x1b9'),'foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xc2')][_0xee9f('0x10b')](db[_0xee9f('0xc4')],{'as':'Fields','foreignKey':_0xee9f('0x1bc')});db[_0xee9f('0xc2')][_0xee9f('0x116')](db[_0xee9f('0xc0')],{'as':_0xee9f('0x173'),'foreignKey':_0xee9f('0x1b6')});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':'Subject','foreignKey':_0xee9f('0x1b8')});db[_0xee9f('0xc4')]['hasMany'](db[_0xee9f('0xc4')],{'as':'Description','foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xc4')][_0xee9f('0x10b')](db[_0xee9f('0xc4')],{'as':_0xee9f('0x1c0'),'foreignKey':_0xee9f('0x1bc')});db[_0xee9f('0xc4')][_0xee9f('0x116')](db[_0xee9f('0x91')],{'as':_0xee9f('0x91'),'foreignKey':_0xee9f('0x1bd')});db[_0xee9f('0x1c4')][_0xee9f('0x10b')](db[_0xee9f('0xc6')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['Dynamics365Account']['belongsTo'](db[_0xee9f('0x100')],{'as':_0xee9f('0x100'),'foreignKey':'CloudProviderId'});db['Dynamics365Configuration'][_0xee9f('0x10b')](db[_0xee9f('0xc8')],{'as':'Subjects','onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1b8')});db[_0xee9f('0xc6')][_0xee9f('0x10b')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xc6')][_0xee9f('0x10b')](db['Dynamics365Field'],{'as':_0xee9f('0x1b3'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1bc')});db[_0xee9f('0xc6')][_0xee9f('0x116')](db[_0xee9f('0x1c4')],{'as':_0xee9f('0x173'),'foreignKey':_0xee9f('0x1b6')});db[_0xee9f('0xc8')]['hasMany'](db[_0xee9f('0xc8')],{'as':_0xee9f('0x1ba'),'foreignKey':_0xee9f('0x1b8')});db[_0xee9f('0xc8')][_0xee9f('0x10b')](db[_0xee9f('0xc8')],{'as':_0xee9f('0x1bb'),'foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xc8')][_0xee9f('0x10b')](db[_0xee9f('0xc8')],{'as':'Field','foreignKey':'FieldId'});db[_0xee9f('0xc8')][_0xee9f('0x116')](db[_0xee9f('0x91')],{'as':_0xee9f('0x91'),'foreignKey':'VariableId'});db[_0xee9f('0xca')][_0xee9f('0x10b')](db[_0xee9f('0x1c5')],{'as':_0xee9f('0x1b5'),'onDelete':_0xee9f('0x109'),'foreignKey':'AccountId'});db[_0xee9f('0x1c5')][_0xee9f('0x10b')](db[_0xee9f('0xcc')],{'as':_0xee9f('0x1b7'),'foreignKey':_0xee9f('0x1b8')});db[_0xee9f('0x1c5')][_0xee9f('0x10b')](db[_0xee9f('0xcc')],{'as':_0xee9f('0x1b9'),'foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0x1c5')][_0xee9f('0x10b')](db[_0xee9f('0xcc')],{'as':_0xee9f('0x1b3'),'foreignKey':'FieldId'});db[_0xee9f('0x1c5')][_0xee9f('0x116')](db[_0xee9f('0xca')],{'as':_0xee9f('0x173'),'foreignKey':_0xee9f('0x1b6')});db['FreshsalesField'][_0xee9f('0x10b')](db['FreshsalesField'],{'as':_0xee9f('0x1ba'),'foreignKey':_0xee9f('0x1b8')});db['FreshsalesField'][_0xee9f('0x10b')](db['FreshsalesField'],{'as':'Description','foreignKey':_0xee9f('0x1bf')});db[_0xee9f('0xcc')]['hasMany'](db['FreshsalesField'],{'as':_0xee9f('0x1c0'),'foreignKey':_0xee9f('0x1bc')});db['FreshsalesField'][_0xee9f('0x116')](db[_0xee9f('0x91')],{'as':_0xee9f('0x91'),'foreignKey':_0xee9f('0x1bd')});db[_0xee9f('0xd0')][_0xee9f('0x116')](db[_0xee9f('0x62')],{});db[_0xee9f('0xd0')][_0xee9f('0x116')](db[_0xee9f('0xf0')],{'as':_0xee9f('0x169'),'foreignKey':_0xee9f('0x15c')});db[_0xee9f('0xd0')]['belongsTo'](db['CmContact'],{'as':_0xee9f('0x152'),'foreignKey':_0xee9f('0x161')});db[_0xee9f('0xd0')][_0xee9f('0x116')](db[_0xee9f('0x66')],{});db[_0xee9f('0xd0')][_0xee9f('0x116')](db[_0xee9f('0x184')],{});db['ChatQueueReport'][_0xee9f('0x116')](db[_0xee9f('0x108')],{});db['ChatQueueReport']['belongsTo'](db[_0xee9f('0x6b')],{});db[_0xee9f('0xd2')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'onDelete':_0xee9f('0x109'),'foreignKey':'FromId'});db[_0xee9f('0xd2')][_0xee9f('0x116')](db['User'],{'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1c6')});db[_0xee9f('0xd5')][_0xee9f('0x10b')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0xee9f('0x109')});db[_0xee9f('0xd5')][_0xee9f('0x10b')](db[_0xee9f('0x1c7')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xee9f('0xd7')][_0xee9f('0x116')](db[_0xee9f('0x54')],{});db[_0xee9f('0xd7')][_0xee9f('0x116')](db['CmList'],{'as':'List','foreignKey':_0xee9f('0x15c')});db[_0xee9f('0xd7')][_0xee9f('0x116')](db['CmContact'],{'as':_0xee9f('0x152'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xee9f('0x116')](db[_0xee9f('0x57')],{});db[_0xee9f('0xd7')]['belongsTo'](db[_0xee9f('0x58')],{});db['SmsQueueReport'][_0xee9f('0x116')](db[_0xee9f('0x108')],{});db[_0xee9f('0xd7')]['belongsTo'](db[_0xee9f('0x5a')],{});db[_0xee9f('0x1c8')][_0xee9f('0x10b')](db[_0xee9f('0xd5')],{'foreignKey':'ProjectId'});db[_0xee9f('0x1c8')][_0xee9f('0x10b')](db[_0xee9f('0xd4')],{'foreignKey':'ProjectId'});db[_0xee9f('0x1c8')][_0xee9f('0x10b')](db[_0xee9f('0x1c7')],{'foreignKey':_0xee9f('0x1c9')});db['SquareProject'][_0xee9f('0x117')](db['User'],{'as':'Users','through':_0xee9f('0x139')});db[_0xee9f('0xe2')]['belongsToMany'](db['User'],{'as':_0xee9f('0x149'),'through':_0xee9f('0x1ca')});db['Team'][_0xee9f('0x117')](db[_0xee9f('0x18')],{'through':_0xee9f('0x102'),'as':_0xee9f('0x124')});db[_0xee9f('0xe2')][_0xee9f('0x117')](db[_0xee9f('0x3d')],{'through':_0xee9f('0x15f'),'as':'MailQueues'});db[_0xee9f('0xe2')][_0xee9f('0x117')](db[_0xee9f('0x6b')],{'through':_0xee9f('0x18b'),'as':_0xee9f('0x128')});db[_0xee9f('0xe2')]['belongsToMany'](db[_0xee9f('0x129')],{'through':_0xee9f('0x174'),'as':_0xee9f('0x1cb')});db[_0xee9f('0xe2')][_0xee9f('0x117')](db[_0xee9f('0x5a')],{'through':_0xee9f('0x17a'),'as':'SmsQueues'});db['Team']['belongsToMany'](db['OpenchannelQueue'],{'through':_0xee9f('0x180'),'as':_0xee9f('0x12c')});db[_0xee9f('0xe2')][_0xee9f('0x117')](db[_0xee9f('0xff')],{'through':_0xee9f('0x1cc'),'as':_0xee9f('0x1cd')});db[_0xee9f('0xe2')][_0xee9f('0x117')](db[_0xee9f('0xf2')],{'through':_0xee9f('0x104'),'as':_0xee9f('0x125')});db[_0xee9f('0xe5')][_0xee9f('0x10b')](db[_0xee9f('0x70')],{'as':_0xee9f('0x1ce'),'foreignKey':_0xee9f('0x194')});db[_0xee9f('0xe5')][_0xee9f('0x10b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xee9f('0x194')});db[_0xee9f('0xe5')][_0xee9f('0x10b')](db[_0xee9f('0x74')],{'as':_0xee9f('0x13f'),'foreignKey':_0xee9f('0x194')});db['Campaign'][_0xee9f('0x10b')](db[_0xee9f('0x71')],{'as':_0xee9f('0x140'),'foreignKey':_0xee9f('0x194')});db[_0xee9f('0xe5')][_0xee9f('0x116')](db['Trunk'],{'as':_0xee9f('0x28'),'foreignKey':_0xee9f('0x142')});db[_0xee9f('0xe5')][_0xee9f('0x116')](db[_0xee9f('0x28')],{'as':_0xee9f('0x1cf'),'foreignKey':_0xee9f('0x143')});db[_0xee9f('0xe5')][_0xee9f('0x116')](db[_0xee9f('0x80')],{'as':_0xee9f('0x80'),'foreignKey':_0xee9f('0x144')});db['Campaign'][_0xee9f('0x116')](db['SquareProject'],{'as':_0xee9f('0xdd'),'foreignKey':'SquareProjectId'});db['Campaign'][_0xee9f('0x117')](db[_0xee9f('0xf0')],{'as':_0xee9f('0x11b'),'through':_0xee9f('0x1d0')});db['Campaign'][_0xee9f('0x117')](db[_0xee9f('0xf0')],{'as':_0xee9f('0x14b'),'through':_0xee9f('0x1d1')});db['Attachment'][_0xee9f('0x116')](db[_0xee9f('0x69')],{'as':_0xee9f('0x69'),'foreignKey':_0xee9f('0x167')});db[_0xee9f('0xea')][_0xee9f('0x116')](db[_0xee9f('0x41')],{});db['MailTransferReport'][_0xee9f('0x116')](db[_0xee9f('0x3f')],{});db[_0xee9f('0xea')][_0xee9f('0x116')](db[_0xee9f('0x3b')],{'foreignKey':_0xee9f('0x1d2'),'as':'FromAccount'});db[_0xee9f('0xea')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'foreignKey':_0xee9f('0x1d3'),'as':_0xee9f('0x1d4')});db[_0xee9f('0xea')]['belongsTo'](db[_0xee9f('0x108')],{'foreignKey':_0xee9f('0x1d5'),'as':_0xee9f('0x1d6')});db[_0xee9f('0xea')]['belongsTo'](db[_0xee9f('0x3d')],{'foreignKey':_0xee9f('0x1d7'),'as':_0xee9f('0x1d8')});db[_0xee9f('0xea')][_0xee9f('0x116')](db['MailAccount'],{'foreignKey':_0xee9f('0x1d9'),'as':'ToAccount'});db['ChatTransferReport'][_0xee9f('0x116')](db[_0xee9f('0x184')],{});db['ChatTransferReport']['belongsTo'](db[_0xee9f('0x66')],{});db[_0xee9f('0xec')][_0xee9f('0x116')](db[_0xee9f('0x62')],{'foreignKey':'FromChatWebsiteId','as':_0xee9f('0x1da')});db['ChatTransferReport']['belongsTo'](db[_0xee9f('0x108')],{'foreignKey':_0xee9f('0x1d3'),'as':_0xee9f('0x1d4')});db[_0xee9f('0xec')]['belongsTo'](db[_0xee9f('0x108')],{'foreignKey':_0xee9f('0x1d5'),'as':'ToAgent'});db[_0xee9f('0xec')][_0xee9f('0x116')](db[_0xee9f('0x6b')],{'foreignKey':_0xee9f('0x1db'),'as':_0xee9f('0x1d8')});db[_0xee9f('0xec')]['belongsTo'](db[_0xee9f('0x62')],{'foreignKey':_0xee9f('0x1dc'),'as':_0xee9f('0x1dd')});db[_0xee9f('0x1de')][_0xee9f('0x116')](db[_0xee9f('0x50')],{});db[_0xee9f('0x1de')]['belongsTo'](db[_0xee9f('0x4e')],{});db[_0xee9f('0x1de')][_0xee9f('0x116')](db[_0xee9f('0x4a')],{'foreignKey':_0xee9f('0x1df'),'as':_0xee9f('0x1da')});db['FaxTransferReport']['belongsTo'](db[_0xee9f('0x108')],{'foreignKey':_0xee9f('0x1d3'),'as':_0xee9f('0x1d4')});db[_0xee9f('0x1de')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'foreignKey':_0xee9f('0x1d5'),'as':'ToAgent'});db['FaxTransferReport']['belongsTo'](db[_0xee9f('0x129')],{'foreignKey':'ToFaxQueueId','as':_0xee9f('0x1d8')});db[_0xee9f('0x1de')][_0xee9f('0x116')](db[_0xee9f('0x4a')],{'foreignKey':_0xee9f('0x1e0'),'as':_0xee9f('0x1dd')});db[_0xee9f('0x1e1')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xee9f('0x1e1')]['belongsTo'](db[_0xee9f('0x111')],{});db[_0xee9f('0x1e1')][_0xee9f('0x116')](db[_0xee9f('0x5c')],{'foreignKey':_0xee9f('0x1e2'),'as':_0xee9f('0x1da')});db[_0xee9f('0x1e1')][_0xee9f('0x116')](db['User'],{'foreignKey':_0xee9f('0x1d3'),'as':_0xee9f('0x1d4')});db[_0xee9f('0x1e1')]['belongsTo'](db[_0xee9f('0x108')],{'foreignKey':'ToUserId','as':'ToAgent'});db['OpenchannelTransferReport'][_0xee9f('0x116')](db[_0xee9f('0x12b')],{'foreignKey':_0xee9f('0x1e3'),'as':_0xee9f('0x1d8')});db[_0xee9f('0x1e1')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0xee9f('0x1dd')});db['SmsTransferReport'][_0xee9f('0x116')](db[_0xee9f('0x58')],{});db[_0xee9f('0xee')][_0xee9f('0x116')](db[_0xee9f('0x57')],{});db[_0xee9f('0xee')]['belongsTo'](db[_0xee9f('0x54')],{'foreignKey':'FromSmsAccountId','as':_0xee9f('0x1da')});db[_0xee9f('0xee')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'foreignKey':_0xee9f('0x1d3'),'as':_0xee9f('0x1d4')});db['SmsTransferReport'][_0xee9f('0x116')](db[_0xee9f('0x108')],{'foreignKey':_0xee9f('0x1d5'),'as':_0xee9f('0x1d6')});db[_0xee9f('0xee')][_0xee9f('0x116')](db[_0xee9f('0x5a')],{'foreignKey':_0xee9f('0x1e4'),'as':_0xee9f('0x1d8')});db[_0xee9f('0xee')][_0xee9f('0x116')](db['SmsAccount'],{'foreignKey':_0xee9f('0x1e5'),'as':'ToAccount'});db[_0xee9f('0xf0')][_0xee9f('0x10b')](db[_0xee9f('0x7c')],{'as':_0xee9f('0x159'),'foreignKey':_0xee9f('0x15c'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0xf0')][_0xee9f('0x10b')](db[_0xee9f('0x1e6')],{'as':_0xee9f('0x1e7'),'foreignKey':'ListId'});db[_0xee9f('0xf0')]['hasMany'](db[_0xee9f('0x6f')],{'as':_0xee9f('0x18e'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x15c')});db['CmList'][_0xee9f('0x10b')](db[_0xee9f('0x10e')],{'as':_0xee9f('0x10f'),'foreignKey':_0xee9f('0x15c')});db['CmList'][_0xee9f('0x10b')](db[_0xee9f('0x74')],{'as':_0xee9f('0x1e8'),'foreignKey':_0xee9f('0x15c')});db[_0xee9f('0xf0')][_0xee9f('0x10b')](db['ReportAgentPreview'],{'as':_0xee9f('0x110'),'foreignKey':'ListId'});db[_0xee9f('0xf0')][_0xee9f('0x117')](db[_0xee9f('0x18')],{'as':_0xee9f('0x1e9'),'through':_0xee9f('0x148')});db['CmList'][_0xee9f('0x117')](db['User'],{'as':_0xee9f('0x149'),'through':_0xee9f('0x11c')});db[_0xee9f('0xf2')][_0xee9f('0x10b')](db[_0xee9f('0x14')],{'as':_0xee9f('0x10d'),'onDelete':_0xee9f('0x109')});db['VoicePrefix']['belongsToMany'](db[_0xee9f('0x108')],{'as':_0xee9f('0x149'),'through':_0xee9f('0x126')});db['VoicePrefix'][_0xee9f('0x117')](db[_0xee9f('0xe2')],{'through':_0xee9f('0x104'),'as':_0xee9f('0x14a')});db[_0xee9f('0xf4')]['hasMany'](db[_0xee9f('0x108')],{'as':_0xee9f('0x170'),'foreignKey':_0xee9f('0x1ea')});db[_0xee9f('0xf4')][_0xee9f('0x10b')](db[_0xee9f('0x1eb')],{'as':_0xee9f('0x1ec'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0xee9f('0x1eb')][_0xee9f('0x10b')](db[_0xee9f('0xf5')],{'as':_0xee9f('0x1ed'),'foreignKey':_0xee9f('0x1ee'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0xf8')][_0xee9f('0x10b')](db['Disposition'],{'as':_0xee9f('0x159'),'foreignKey':_0xee9f('0x1ef'),'onDelete':_0xee9f('0x109')});db[_0xee9f('0xf8')][_0xee9f('0x10b')](db[_0xee9f('0x16d')],{'as':_0xee9f('0x15a'),'foreignKey':_0xee9f('0x1ef')});db['WhatsappAccount']['hasMany'](db['WhatsappMessage'],{'as':_0xee9f('0x14d'),'foreignKey':_0xee9f('0x1ef')});db['WhatsappAccount'][_0xee9f('0x10b')](db['WhatsappInteraction'],{'as':_0xee9f('0x15b')});db[_0xee9f('0xf8')][_0xee9f('0x10b')](db[_0xee9f('0xf9')],{'as':_0xee9f('0x13b')});db[_0xee9f('0xf8')]['belongsTo'](db[_0xee9f('0xf0')],{'as':'List','foreignKey':_0xee9f('0x15c')});db['WhatsappAccount'][_0xee9f('0x116')](db['Pause'],{'as':_0xee9f('0x146'),'foreignKey':_0xee9f('0x147')});db[_0xee9f('0xf8')][_0xee9f('0x117')](db[_0xee9f('0x108')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db[_0xee9f('0xf9')]['belongsTo'](db[_0xee9f('0x108')],{'onDelete':_0xee9f('0x155')});db[_0xee9f('0xf9')]['belongsTo'](db[_0xee9f('0xff')],{'onDelete':_0xee9f('0x155')});db['WhatsappApplication'][_0xee9f('0x116')](db[_0xee9f('0xf8')],{'onDelete':_0xee9f('0x155')});db[_0xee9f('0xf9')][_0xee9f('0x116')](db[_0xee9f('0x80')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xee9f('0xf9')]['belongsTo'](db[_0xee9f('0x87')],{'onDelete':_0xee9f('0x155'),'foreignKey':_0xee9f('0x168')});db[_0xee9f('0xfa')][_0xee9f('0x10b')](db[_0xee9f('0xfb')],{'as':_0xee9f('0x14d'),'onDelete':_0xee9f('0x109'),'foreignKey':_0xee9f('0x1f0')});db['WhatsappInteraction']['belongsTo'](db[_0xee9f('0xf8')],{'as':_0xee9f('0x173'),'foreignKey':'WhatsappAccountId'});db[_0xee9f('0xfa')][_0xee9f('0x116')](db['CmContact'],{'as':_0xee9f('0x152'),'foreignKey':'ContactId'});db[_0xee9f('0xfa')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'as':'Owner','foreignKey':'UserId'});db['WhatsappInteraction']['belongsToMany'](db['Tag'],{'through':_0xee9f('0x1a6'),'as':'Tags'});db[_0xee9f('0xfa')][_0xee9f('0x117')](db[_0xee9f('0x87')],{'through':_0xee9f('0x1a6'),'as':'ThroughTags'});db['WhatsappInteraction'][_0xee9f('0x117')](db['User'],{'as':_0xee9f('0x170'),'through':'user_has_whatsapp_interactions','foreignKey':_0xee9f('0x1f0')});db['WhatsappMessage'][_0xee9f('0x116')](db[_0xee9f('0x108')],{'as':_0xee9f('0x108')});db[_0xee9f('0xfb')][_0xee9f('0x116')](db[_0xee9f('0x6f')],{'onDelete':_0xee9f('0x109'),'as':_0xee9f('0x152')});db[_0xee9f('0xfb')][_0xee9f('0x116')](db['WhatsappInteraction'],{'onDelete':_0xee9f('0x109'),'as':_0xee9f('0x166'),'foreignKey':_0xee9f('0x1f0')});db[_0xee9f('0xfb')][_0xee9f('0x116')](db[_0xee9f('0xf8')],{'as':'Account','foreignKey':_0xee9f('0x1ef')});db[_0xee9f('0xfc')][_0xee9f('0x116')](db[_0xee9f('0xf8')],{});db[_0xee9f('0xfc')][_0xee9f('0x116')](db['CmList'],{'as':'List','foreignKey':_0xee9f('0x15c')});db[_0xee9f('0xfc')]['belongsTo'](db[_0xee9f('0x6f')],{'as':_0xee9f('0x152'),'foreignKey':_0xee9f('0x161')});db[_0xee9f('0xfc')][_0xee9f('0x116')](db[_0xee9f('0xfa')],{});db[_0xee9f('0xfc')][_0xee9f('0x116')](db[_0xee9f('0xff')],{});db[_0xee9f('0xfc')][_0xee9f('0x116')](db[_0xee9f('0xfb')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xee9f('0x108')],{});db['WhatsappTransferReport'][_0xee9f('0x116')](db[_0xee9f('0xfb')],{});db[_0xee9f('0xfe')][_0xee9f('0x116')](db['WhatsappInteraction'],{});db[_0xee9f('0xfe')]['belongsTo'](db[_0xee9f('0xf8')],{'foreignKey':_0xee9f('0x1f1'),'as':_0xee9f('0x1da')});db['WhatsappTransferReport']['belongsTo'](db[_0xee9f('0xf8')],{'foreignKey':'ToWhatsappAccountId','as':_0xee9f('0x1dd')});db[_0xee9f('0xfe')][_0xee9f('0x116')](db[_0xee9f('0xff')],{'foreignKey':_0xee9f('0x1f2'),'as':'ToQueue'});db[_0xee9f('0xfe')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'foreignKey':'FromUserId','as':_0xee9f('0x1d4')});db[_0xee9f('0xfe')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'foreignKey':_0xee9f('0x1d5'),'as':_0xee9f('0x1d6')});db[_0xee9f('0xff')]['belongsToMany'](db[_0xee9f('0x108')],{'as':_0xee9f('0x149'),'through':_0xee9f('0x12d'),'foreignKey':_0xee9f('0x1f3')});db[_0xee9f('0xff')][_0xee9f('0x117')](db[_0xee9f('0xe2')],{'through':_0xee9f('0x1cc'),'as':_0xee9f('0x14a')});db[_0xee9f('0x106')][_0xee9f('0x116')](db[_0xee9f('0x108')],{'as':'user','foreignKey':_0xee9f('0x10a'),'onDelete':_0xee9f('0x109'),'hooks':!![]});db[_0xee9f('0x100')]['hasOne'](db[_0xee9f('0x1c4')],{'as':_0xee9f('0x1c4'),'onDelete':'restrict'});db[_0xee9f('0x100')]['hasOne'](db[_0xee9f('0x38')],{'as':'Imap','onDelete':_0xee9f('0x155')});db[_0xee9f('0x100')]['hasOne'](db[_0xee9f('0x39')],{'as':_0xee9f('0x158'),'onDelete':_0xee9f('0x155')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index a4a4365..9fa635d 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd658=['./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareRecording','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','root','/www','static','/demo','join','/snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','./errors','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','/api/sms/messages','/api/sms/queues','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/integrations','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations'];(function(_0x3e3714,_0x5c3c8f){var _0x142656=function(_0x842efd){while(--_0x842efd){_0x3e3714['push'](_0x3e3714['shift']());}};_0x142656(++_0x5c3c8f);}(_0xd658,0x71));var _0x8d65=function(_0x2dfb17,_0x2fcdd7){_0x2dfb17=_0x2dfb17-0x0;var _0x28f96f=_0xd658[_0x2dfb17];return _0x28f96f;};'use strict';var path=require(_0x8d65('0x0'));var express=require('express');var errors=require(_0x8d65('0x1'));var config=require(_0x8d65('0x2'));var setupLoggers=require(_0x8d65('0x3'))['setupLoggers'];var clientSideLogs=require(_0x8d65('0x4'));exports[_0x8d65('0x5')]=function(_0x47a3bd){return setupLoggers(_0x47a3bd)[_0x8d65('0x6')](function(){_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x8'),require(_0x8d65('0x9')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xa'),require(_0x8d65('0xb')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xc'),require('./api/voiceContext'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xd'),require('./api/voiceExtension'));_0x47a3bd[_0x8d65('0x7')]('/api/voice/mohs',require(_0x8d65('0xe')));_0x47a3bd[_0x8d65('0x7')]('/api/voice/queues',require(_0x8d65('0xf')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x10'),require(_0x8d65('0x11')));_0x47a3bd[_0x8d65('0x7')]('/api/screen/recordings',require('./api/screenRecording'));_0x47a3bd['use'](_0x8d65('0x12'),require(_0x8d65('0x13')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x14'),require('./api/voiceMailMessage'));_0x47a3bd[_0x8d65('0x7')]('/api/voice/calls/reports',require(_0x8d65('0x15')));_0x47a3bd[_0x8d65('0x7')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x16'),require(_0x8d65('0x17')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x18'),require(_0x8d65('0x19')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x1a'),require('./api/memberReport'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x1b'),require(_0x8d65('0x1c')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x1d'),require(_0x8d65('0x1e')));_0x47a3bd['use'](_0x8d65('0x1f'),require(_0x8d65('0x20')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x21'),require(_0x8d65('0x22')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x23'),require(_0x8d65('0x24')));_0x47a3bd['use'](_0x8d65('0x25'),require(_0x8d65('0x26')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x27'),require(_0x8d65('0x28')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x29'),require(_0x8d65('0x2a')));_0x47a3bd['use'](_0x8d65('0x2b'),require(_0x8d65('0x2c')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x2d'),require('./api/mailQueueReport'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x2e'),require(_0x8d65('0x2f')));_0x47a3bd['use'](_0x8d65('0x30'),require(_0x8d65('0x31')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x32'),require('./api/faxAccount'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x33'),require(_0x8d65('0x34')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x35'),require(_0x8d65('0x36')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x37'),require(_0x8d65('0x38')));_0x47a3bd[_0x8d65('0x7')]('/api/fax/queues',require(_0x8d65('0x39')));_0x47a3bd[_0x8d65('0x7')]('/api/fax/reports/queue',require(_0x8d65('0x3a')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x3b'),require(_0x8d65('0x3c')));_0x47a3bd['use'](_0x8d65('0x3d'),require('./api/smsApplication'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x3e'),require('./api/smsInteraction'));_0x47a3bd['use'](_0x8d65('0x3f'),require('./api/smsMessage'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x40'),require('./api/smsQueue'));_0x47a3bd[_0x8d65('0x7')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x41'),require(_0x8d65('0x42')));_0x47a3bd[_0x8d65('0x7')]('/api/openchannel/interactions',require(_0x8d65('0x43')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x44'),require(_0x8d65('0x45')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x46'),require(_0x8d65('0x47')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x48'),require('./api/chatWebsite'));_0x47a3bd[_0x8d65('0x7')]('/api/openchannel/reports/queue',require(_0x8d65('0x49')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x4a'),require(_0x8d65('0x4b')));_0x47a3bd['use'](_0x8d65('0x4c'),require(_0x8d65('0x4d')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x4e'),require(_0x8d65('0x4f')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x50'),require(_0x8d65('0x51')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x52'),require(_0x8d65('0x53')));_0x47a3bd[_0x8d65('0x7')]('/api/chat/groups',require(_0x8d65('0x54')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x55'),require(_0x8d65('0x56')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x57'),require('./api/cmCompany'));_0x47a3bd['use'](_0x8d65('0x58'),require('./api/cmContact'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x59'),require(_0x8d65('0x5a')));_0x47a3bd['use']('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x5b'),require(_0x8d65('0x5c')));_0x47a3bd['use'](_0x8d65('0x5d'),require(_0x8d65('0x5e')));_0x47a3bd[_0x8d65('0x7')]('/api/cm/custom_fields',require(_0x8d65('0x5f')));_0x47a3bd['use'](_0x8d65('0x60'),require(_0x8d65('0x61')));_0x47a3bd[_0x8d65('0x7')]('/api/automations',require(_0x8d65('0x62')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x63'),require(_0x8d65('0x64')));_0x47a3bd['use'](_0x8d65('0x65'),require(_0x8d65('0x66')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x67'),require('./api/condition'));_0x47a3bd['use'](_0x8d65('0x68'),require('./api/interval'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x69'),require(_0x8d65('0x6a')));_0x47a3bd['use'](_0x8d65('0x6b'),require(_0x8d65('0x6c')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x6d'),require(_0x8d65('0x6e')));_0x47a3bd[_0x8d65('0x7')]('/api/schedules',require(_0x8d65('0x6f')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x70'),require('./api/sound'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x71'),require(_0x8d65('0x72')));_0x47a3bd['use']('/api/contact_item_types',require(_0x8d65('0x73')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x74'),require(_0x8d65('0x75')));_0x47a3bd[_0x8d65('0x7')]('/api/cm_hopper_additional_phones',require(_0x8d65('0x76')));_0x47a3bd['use'](_0x8d65('0x77'),require(_0x8d65('0x78')));_0x47a3bd['use'](_0x8d65('0x79'),require(_0x8d65('0x7a')));_0x47a3bd[_0x8d65('0x7')]('/api/variables',require('./api/variable'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x7b'),require('./api/integration'));_0x47a3bd['use']('/api/integrations/reports',require('./api/integrationReport'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x7c'),require(_0x8d65('0x7d')));_0x47a3bd['use'](_0x8d65('0x7e'),require(_0x8d65('0x7f')));_0x47a3bd['use'](_0x8d65('0x80'),require(_0x8d65('0x81')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x82'),require('./api/analyticMetric'));_0x47a3bd[_0x8d65('0x7')]('/api/analytics/field_reports',require(_0x8d65('0x83')));_0x47a3bd['use'](_0x8d65('0x84'),require(_0x8d65('0x85')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x86'),require(_0x8d65('0x87')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x88'),require(_0x8d65('0x89')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x8a'),require(_0x8d65('0x8b')));_0x47a3bd['use'](_0x8d65('0x8c'),require(_0x8d65('0x8d')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x8e'),require(_0x8d65('0x8f')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x90'),require('./api/intSugarcrmField'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x91'),require(_0x8d65('0x92')));_0x47a3bd['use'](_0x8d65('0x93'),require('./api/intDeskConfiguration'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x94'),require(_0x8d65('0x95')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x96'),require(_0x8d65('0x97')));_0x47a3bd[_0x8d65('0x7')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x98'),require(_0x8d65('0x99')));_0x47a3bd[_0x8d65('0x7')]('/api/integrations/zendesk/accounts',require(_0x8d65('0x9a')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x9b'),require(_0x8d65('0x9c')));_0x47a3bd[_0x8d65('0x7')]('/api/integrations/zendesk/fields',require(_0x8d65('0x9d')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x9e'),require(_0x8d65('0x9f')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xa0'),require(_0x8d65('0xa1')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xa2'),require('./api/intFreshdeskField'));_0x47a3bd['use'](_0x8d65('0xa3'),require('./api/intVtigerAccount'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xa4'),require(_0x8d65('0xa5')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xa6'),require(_0x8d65('0xa7')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xa8'),require(_0x8d65('0xa9')));_0x47a3bd['use'](_0x8d65('0xaa'),require(_0x8d65('0xab')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xac'),require('./api/intServicenowField'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xad'),require(_0x8d65('0xae')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xaf'),require('./api/intDynamics365Configuration'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xb0'),require('./api/intDynamics365Field'));_0x47a3bd['use']('/api/integrations/freshsales/accounts',require(_0x8d65('0xb1')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xb2'),require(_0x8d65('0xb3')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xb4'),require(_0x8d65('0xb5')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xb6'),require('./api/network'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xb7'),require('./api/chatQueueReport'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xb8'),require(_0x8d65('0xb9')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xba'),require(_0x8d65('0xbb')));_0x47a3bd['use'](_0x8d65('0xbc'),require(_0x8d65('0xbd')));_0x47a3bd[_0x8d65('0x7')]('/api/jscripty/sessions/reports',require(_0x8d65('0xbe')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xbf'),require(_0x8d65('0xc0')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xc1'),require('./api/squareReport'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xc2'),require('./api/squareReportDetail'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xc3'),require(_0x8d65('0xc4')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xc5'),require('./api/setting'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xc6'),require(_0x8d65('0xc7')));_0x47a3bd['use'](_0x8d65('0xc8'),require('./api/squareProject'));_0x47a3bd[_0x8d65('0x7')]('/api/square/recordings',require(_0x8d65('0xc9')));_0x47a3bd[_0x8d65('0x7')]('/api/square/messages',require('./api/squareMessage'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xca'),require(_0x8d65('0xcb')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xcc'),require('./api/license'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xcd'),require(_0x8d65('0xce')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xcf'),require('./api/migration'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xd0'),require('./api/attachment'));_0x47a3bd[_0x8d65('0x7')]('/api/plugins',require(_0x8d65('0xd1')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xd2'),require(_0x8d65('0xd3')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xd4'),require('./api/chatTransferReport'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xd5'),require(_0x8d65('0xd6')));_0x47a3bd['use'](_0x8d65('0xd7'),require('./api/openchannelTransferReport'));_0x47a3bd['use'](_0x8d65('0xd8'),require(_0x8d65('0xd9')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xda'),require(_0x8d65('0xdb')));_0x47a3bd[_0x8d65('0x7')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xdc'),require(_0x8d65('0xdd')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xde'),require(_0x8d65('0xdf')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xe0'),require('./api/userProfileResource'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xe1'),require(_0x8d65('0xe2')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xe3'),require(_0x8d65('0xe4')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xe5'),require(_0x8d65('0xe6')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xe7'),require(_0x8d65('0xe8')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xe9'),require(_0x8d65('0xea')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xeb'),require('./api/whatsappQueueReport'));_0x47a3bd['use'](_0x8d65('0xec'),require(_0x8d65('0xed')));_0x47a3bd[_0x8d65('0x7')]('/api/whatsapp/queues',require(_0x8d65('0xee')));_0x47a3bd[_0x8d65('0x7')]('/api/cloudProviders',require(_0x8d65('0xef')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xf0'),require(_0x8d65('0xf1')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xf2'),require(_0x8d65('0xf3')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xf4'),require(_0x8d65('0xf5')));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xf6'),require('./api/authGoogle'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xf7'),require(_0x8d65('0xf8')));_0x47a3bd[_0x8d65('0x7')]('/api/jira',require(_0x8d65('0xf9')));_0x47a3bd['use'](_0x8d65('0xfa'),require('./api/rpc'));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0xfb'),require(_0x8d65('0xfc')));_0x47a3bd[_0x8d65('0x7')]('/api/system',require(_0x8d65('0xfd')));_0x47a3bd['use'](_0x8d65('0xfe'),require(_0x8d65('0xff')));_0x47a3bd[_0x8d65('0x7')]('/api/webbar',require(_0x8d65('0x100')));_0x47a3bd['use']('/api/logs',clientSideLogs);_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x101'),express['static'](path['join'](config[_0x8d65('0x102')],_0x8d65('0x101'))));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x103'),express[_0x8d65('0x104')](path['join'](config[_0x8d65('0x102')],_0x8d65('0x103'))));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x105'),express[_0x8d65('0x104')](path[_0x8d65('0x106')](config[_0x8d65('0x102')],_0x8d65('0x105'))));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x107'),express[_0x8d65('0x104')](path[_0x8d65('0x106')](config['root'],'snippet',_0x8d65('0x108'))));_0x47a3bd[_0x8d65('0x7')](_0x8d65('0x109'),express[_0x8d65('0x104')](path['join'](config['root'],_0x8d65('0x10a'))));_0x47a3bd[_0x8d65('0x10b')](_0x8d65('0x10c'))[_0x8d65('0x10d')](errors[0x194]);_0x47a3bd[_0x8d65('0x10b')]('/*')[_0x8d65('0x10d')](function(_0x3b3970,_0x4b957a){_0x4b957a[_0x8d65('0x10e')](path[_0x8d65('0x10f')](_0x47a3bd[_0x8d65('0x10d')](_0x8d65('0x110'))+_0x8d65('0x111')));});return _0x47a3bd;});}; \ No newline at end of file +var _0xf78d=['./api/intSalesforceConfiguration','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/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/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','/api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','/index.html','path','express','./errors','setupLoggers','./api/client-side-logs','default','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/messages','./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/chat/websites','/api/openchannel/reports/queue','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','/api/triggers','./api/trigger','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/configurations'];(function(_0x40c8af,_0xb0ee4f){var _0x73e934=function(_0x56211d){while(--_0x56211d){_0x40c8af['push'](_0x40c8af['shift']());}};_0x73e934(++_0xb0ee4f);}(_0xf78d,0x8a));var _0xdf78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf78d[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xdf78('0x0'));var express=require(_0xdf78('0x1'));var errors=require(_0xdf78('0x2'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0xdf78('0x3')];var clientSideLogs=require(_0xdf78('0x4'));exports[_0xdf78('0x5')]=function(_0x3fe2c3){return setupLoggers(_0x3fe2c3)['then'](function(){_0x3fe2c3[_0xdf78('0x6')]('/api/users',require(_0xdf78('0x7')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x8'),require(_0xdf78('0x9')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xa'),require(_0xdf78('0xb')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xc'),require('./api/voiceExtension'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xd'),require(_0xdf78('0xe')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xf'),require(_0xdf78('0x10')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x11'),require(_0xdf78('0x12')));_0x3fe2c3['use'](_0xdf78('0x13'),require(_0xdf78('0x14')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x15'),require(_0xdf78('0x16')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x17'),require(_0xdf78('0x18')));_0x3fe2c3[_0xdf78('0x6')]('/api/voice/calls/reports',require(_0xdf78('0x19')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x1a'),require(_0xdf78('0x1b')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x1c'),require('./api/voiceAgentReport'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x1d'),require(_0xdf78('0x1e')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x1f'),require(_0xdf78('0x20')));_0x3fe2c3[_0xdf78('0x6')]('/api/trunks',require(_0xdf78('0x21')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x22'),require(_0xdf78('0x23')));_0x3fe2c3[_0xdf78('0x6')]('/api/mail/out_servers',require(_0xdf78('0x24')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x25'),require(_0xdf78('0x26')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x27'),require('./api/mailQueue'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x28'),require(_0xdf78('0x29')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x2a'),require('./api/mailInteraction'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x2b'),require('./api/mailMessage'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x2c'),require('./api/mailApplication'));_0x3fe2c3['use'](_0xdf78('0x2d'),require('./api/mailQueueReport'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x2e'),require(_0xdf78('0x2f')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x30'),require('./api/dashboardItem'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x31'),require(_0xdf78('0x32')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x33'),require(_0xdf78('0x34')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x35'),require(_0xdf78('0x36')));_0x3fe2c3['use'](_0xdf78('0x37'),require('./api/faxMessage'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x38'),require(_0xdf78('0x39')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x3a'),require(_0xdf78('0x3b')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x3c'),require(_0xdf78('0x3d')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x3e'),require('./api/smsApplication'));_0x3fe2c3[_0xdf78('0x6')]('/api/sms/interactions',require('./api/smsInteraction'));_0x3fe2c3['use'](_0xdf78('0x3f'),require(_0xdf78('0x40')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x41'),require(_0xdf78('0x42')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x43'),require(_0xdf78('0x44')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x45'),require(_0xdf78('0x46')));_0x3fe2c3['use'](_0xdf78('0x47'),require(_0xdf78('0x48')));_0x3fe2c3[_0xdf78('0x6')]('/api/openchannel/messages',require(_0xdf78('0x49')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x4a'),require('./api/openchannelQueue'));_0x3fe2c3['use'](_0xdf78('0x4b'),require('./api/chatWebsite'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x4c'),require('./api/openchannelQueueReport'));_0x3fe2c3[_0xdf78('0x6')]('/api/chat/applications',require('./api/chatApplication'));_0x3fe2c3['use']('/api/chat/interactions',require('./api/chatInteraction'));_0x3fe2c3['use']('/api/chat/messages',require('./api/chatMessage'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x4d'),require(_0xdf78('0x4e')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x4f'),require(_0xdf78('0x50')));_0x3fe2c3['use'](_0xdf78('0x51'),require(_0xdf78('0x52')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x53'),require('./api/chatProactiveAction'));_0x3fe2c3['use'](_0xdf78('0x54'),require(_0xdf78('0x55')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x56'),require(_0xdf78('0x57')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x58'),require(_0xdf78('0x59')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x5a'),require(_0xdf78('0x5b')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x5c'),require('./api/cmHopperFinal'));_0x3fe2c3[_0xdf78('0x6')]('/api/cm/hopper_history',require(_0xdf78('0x5d')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x5e'),require(_0xdf78('0x5f')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x60'),require(_0xdf78('0x61')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x62'),require(_0xdf78('0x63')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x64'),require(_0xdf78('0x65')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x66'),require(_0xdf78('0x67')));_0x3fe2c3['use']('/api/conditions',require(_0xdf78('0x68')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x69'),require('./api/interval'));_0x3fe2c3['use']('/api/pauses',require(_0xdf78('0x6a')));_0x3fe2c3['use'](_0xdf78('0x6b'),require(_0xdf78('0x6c')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x6d'),require('./api/voiceQueuesLog'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x6e'),require(_0xdf78('0x6f')));_0x3fe2c3['use'](_0xdf78('0x70'),require(_0xdf78('0x71')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x72'),require('./api/tag'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x73'),require(_0xdf78('0x74')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x75'),require(_0xdf78('0x76')));_0x3fe2c3['use'](_0xdf78('0x77'),require('./api/cmHopperAdditionalPhone'));_0x3fe2c3['use'](_0xdf78('0x78'),require('./api/template'));_0x3fe2c3['use'](_0xdf78('0x79'),require(_0xdf78('0x7a')));_0x3fe2c3[_0xdf78('0x6')]('/api/variables',require('./api/variable'));_0x3fe2c3['use']('/api/integrations',require('./api/integration'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x7b'),require(_0xdf78('0x7c')));_0x3fe2c3['use'](_0xdf78('0x7d'),require(_0xdf78('0x7e')));_0x3fe2c3[_0xdf78('0x6')]('/api/analytics/default_reports',require(_0xdf78('0x7f')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x80'),require(_0xdf78('0x81')));_0x3fe2c3[_0xdf78('0x6')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x82'),require(_0xdf78('0x83')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x84'),require(_0xdf78('0x85')));_0x3fe2c3['use']('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x86'),require(_0xdf78('0x87')));_0x3fe2c3[_0xdf78('0x6')]('/api/integrations/salesforce/fields',require(_0xdf78('0x88')));_0x3fe2c3[_0xdf78('0x6')]('/api/integrations/sugarcrm/accounts',require(_0xdf78('0x89')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x8a'),require(_0xdf78('0x8b')));_0x3fe2c3[_0xdf78('0x6')]('/api/integrations/sugarcrm/fields',require(_0xdf78('0x8c')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x8d'),require('./api/intDeskAccount'));_0x3fe2c3[_0xdf78('0x6')]('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x8e'),require(_0xdf78('0x8f')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x90'),require(_0xdf78('0x91')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x92'),require(_0xdf78('0x93')));_0x3fe2c3['use']('/api/integrations/zoho/fields',require(_0xdf78('0x94')));_0x3fe2c3['use']('/api/integrations/zendesk/accounts',require(_0xdf78('0x95')));_0x3fe2c3[_0xdf78('0x6')]('/api/integrations/zendesk/configurations',require(_0xdf78('0x96')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x97'),require(_0xdf78('0x98')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x99'),require(_0xdf78('0x9a')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x9b'),require(_0xdf78('0x9c')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x9d'),require('./api/intFreshdeskField'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x9e'),require(_0xdf78('0x9f')));_0x3fe2c3[_0xdf78('0x6')]('/api/integrations/vtiger/configurations',require(_0xdf78('0xa0')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xa1'),require(_0xdf78('0xa2')));_0x3fe2c3[_0xdf78('0x6')]('/api/integrations/servicenow/accounts',require(_0xdf78('0xa3')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xa4'),require('./api/intServicenowConfiguration'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xa5'),require(_0xdf78('0xa6')));_0x3fe2c3[_0xdf78('0x6')]('/api/integrations/dynamics365/accounts',require(_0xdf78('0xa7')));_0x3fe2c3['use'](_0xdf78('0xa8'),require(_0xdf78('0xa9')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xaa'),require(_0xdf78('0xab')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xac'),require(_0xdf78('0xad')));_0x3fe2c3['use'](_0xdf78('0xae'),require(_0xdf78('0xaf')));_0x3fe2c3['use'](_0xdf78('0xb0'),require(_0xdf78('0xb1')));_0x3fe2c3['use']('/api/networks',require(_0xdf78('0xb2')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xb3'),require(_0xdf78('0xb4')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xb5'),require(_0xdf78('0xb6')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xb7'),require(_0xdf78('0xb8')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xb9'),require(_0xdf78('0xba')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xbb'),require('./api/jscriptySessionReport'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xbc'),require(_0xdf78('0xbd')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xbe'),require(_0xdf78('0xbf')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xc0'),require('./api/squareReportDetail'));_0x3fe2c3[_0xdf78('0x6')]('/api/jscripty/projects',require(_0xdf78('0xc1')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xc2'),require(_0xdf78('0xc3')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xc4'),require('./api/squareOdbc'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xc5'),require(_0xdf78('0xc6')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xc7'),require('./api/squareRecording'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xc8'),require('./api/squareMessage'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xc9'),require('./api/team'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xca'),require(_0xdf78('0xcb')));_0x3fe2c3['use'](_0xdf78('0xcc'),require(_0xdf78('0xcd')));_0x3fe2c3[_0xdf78('0x6')]('/api/migrations',require(_0xdf78('0xce')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xcf'),require('./api/attachment'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xd0'),require(_0xdf78('0xd1')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xd2'),require(_0xdf78('0xd3')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xd4'),require(_0xdf78('0xd5')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xd6'),require(_0xdf78('0xd7')));_0x3fe2c3[_0xdf78('0x6')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x3fe2c3['use'](_0xdf78('0xd8'),require('./api/smsTransferReport'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xd9'),require(_0xdf78('0xda')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xdb'),require('./api/voicePrefix'));_0x3fe2c3['use']('/api/userProfiles',require(_0xdf78('0xdc')));_0x3fe2c3['use'](_0xdf78('0xdd'),require(_0xdf78('0xde')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xdf'),require('./api/userProfileResource'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xe0'),require(_0xdf78('0xe1')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xe2'),require('./api/whatsappAccount'));_0x3fe2c3['use'](_0xdf78('0xe3'),require(_0xdf78('0xe4')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xe5'),require('./api/whatsappInteraction'));_0x3fe2c3['use'](_0xdf78('0xe6'),require('./api/whatsappMessage'));_0x3fe2c3['use'](_0xdf78('0xe7'),require(_0xdf78('0xe8')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xe9'),require(_0xdf78('0xea')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xeb'),require(_0xdf78('0xec')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xed'),require('./api/cloudProvider'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xee'),require(_0xdf78('0xef')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xf0'),require(_0xdf78('0xf1')));_0x3fe2c3['use'](_0xdf78('0xf2'),require('./api/authLocal'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xf3'),require(_0xdf78('0xf4')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xf5'),require(_0xdf78('0xf6')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xf7'),require(_0xdf78('0xf8')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xf9'),require(_0xdf78('0xfa')));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xfb'),require('./api/version'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xfc'),require('./api/system'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xfd'),require('./api/pm2'));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0xfe'),require('./api/webbar'));_0x3fe2c3['use'](_0xdf78('0xff'),clientSideLogs);_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x100'),express[_0xdf78('0x101')](path[_0xdf78('0x102')](config[_0xdf78('0x103')],_0xdf78('0x100'))));_0x3fe2c3['use']('/www',express[_0xdf78('0x101')](path[_0xdf78('0x102')](config[_0xdf78('0x103')],_0xdf78('0x104'))));_0x3fe2c3['use'](_0xdf78('0x105'),express[_0xdf78('0x101')](path[_0xdf78('0x102')](config[_0xdf78('0x103')],_0xdf78('0x105'))));_0x3fe2c3[_0xdf78('0x6')](_0xdf78('0x106'),express[_0xdf78('0x101')](path[_0xdf78('0x102')](config['root'],_0xdf78('0x107'),_0xdf78('0x108'))));_0x3fe2c3[_0xdf78('0x6')]('/plugins',express[_0xdf78('0x101')](path['join'](config[_0xdf78('0x103')],_0xdf78('0x109'))));_0x3fe2c3['route'](_0xdf78('0x10a'))[_0xdf78('0x10b')](errors[0x194]);_0x3fe2c3[_0xdf78('0x10c')]('/*')[_0xdf78('0x10b')](function(_0x13bdb8,_0x55fcb4){_0x55fcb4[_0xdf78('0x10d')](path[_0xdf78('0x10e')](_0x3fe2c3[_0xdf78('0x10b')](_0xdf78('0x10f'))+_0xdf78('0x110')));});return _0x3fe2c3;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 10bcec3..83d63ef 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x867e=['server','http','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../config/environment','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.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/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc'];(function(_0x2043dd,_0x381591){var _0x4a8bb6=function(_0x1a9fe2){while(--_0x1a9fe2){_0x2043dd['push'](_0x2043dd['shift']());}};_0x4a8bb6(++_0x381591);}(_0x867e,0x1c5));var _0xe867=function(_0x3a716e,_0x89dd3e){_0x3a716e=_0x3a716e-0x0;var _0x2c049f=_0x867e[_0x3a716e];return _0x2c049f;};'use strict';var jayson=require(_0xe867('0x0'));var _=require(_0xe867('0x1'));var config=require(_0xe867('0x2'));exports['listen']=function(){return new Promise(function(_0x2386de,_0x4f85db){var _0x349bc0={};_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x3')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x5')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x6')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x7')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x8')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x9')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0xa')));_0x349bc0=_['merge'](_0x349bc0,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0xb')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0xc')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0xd')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0xe')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0xf')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x10')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x11')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require('../api/mailInteraction/mailInteraction.rpc'));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x12')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require('../api/mailApplication/mailApplication.rpc'));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x13')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x14')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x15')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x16')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x17')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x18')));_0x349bc0=_['merge'](_0x349bc0,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x19')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x1a')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x1b')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x1c')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x1d')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x1e')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x1f')));_0x349bc0=_['merge'](_0x349bc0,require('../api/chatInteraction/chatInteraction.rpc'));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x20')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x21')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x22')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require('../api/cmHopper/cmHopper.rpc'));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x23')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x24')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x25')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x26')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x27')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x28')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x29')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x2a')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x2b')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x2c')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require('../api/variable/variable.rpc'));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x2d')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x2e')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x2f')));_0x349bc0=_['merge'](_0x349bc0,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x30')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x31')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x32')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x33')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x34')));_0x349bc0=_['merge'](_0x349bc0,require('../api/squareReport/squareReport.rpc'));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x35')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x36')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require('../api/squareOdbc/squareOdbc.rpc'));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x37')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x38')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x39')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x3a')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x3b')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x3c')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x3d')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x3e')));_0x349bc0=_['merge'](_0x349bc0,require(_0xe867('0x3f')));_0x349bc0=_[_0xe867('0x4')](_0x349bc0,require(_0xe867('0x40')));var _0x71dc31=jayson[_0xe867('0x41')](_0x349bc0)[_0xe867('0x42')]();var _0x4a9626=config[_0xe867('0x43')]['port']||config['port']+0x1;var _0x8931bf=config[_0xe867('0x43')]['ip']||_0xe867('0x44');_0x71dc31['on'](_0xe867('0x45'),function(_0x48a61a){return _0x4f85db(_0x48a61a);});_0x71dc31['listen'](_0x4a9626,_0x8931bf,function(){console[_0xe867('0x46')](_0xe867('0x47'),_0x8931bf,_0x4a9626);require(_0xe867('0x48'))[_0xe867('0x49')]();return _0x2386de('RPC\x20listening\x20on\x20'+_0x8931bf+':'+_0x4a9626);});});}; \ No newline at end of file +var _0xe958=['../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.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/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.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/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc'];(function(_0x3c3743,_0x55a447){var _0x11d454=function(_0x41e933){while(--_0x41e933){_0x3c3743['push'](_0x3c3743['shift']());}};_0x11d454(++_0x55a447);}(_0xe958,0x191));var _0x8e95=function(_0xb9504a,_0xbd444f){_0xb9504a=_0xb9504a-0x0;var _0xb6df02=_0xe958[_0xb9504a];return _0xb6df02;};'use strict';var jayson=require('jayson/promise');var _=require(_0x8e95('0x0'));var config=require(_0x8e95('0x1'));exports[_0x8e95('0x2')]=function(){return new Promise(function(_0x40d3c9,_0x559772){var _0x57c6a2={};_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require('../api/user/user.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x4')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x5')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x6')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x7')));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x8')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x9')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0xa')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0xb')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require('../api/trunk/trunk.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0xc')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0xd')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0xe')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0xf')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require('../api/mailQueue/mailQueue.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x10')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x11')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x12')));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x13')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x14')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x15')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require('../api/faxInteraction/faxInteraction.rpc'));_0x57c6a2=_['merge'](_0x57c6a2,require('../api/faxMessage/faxMessage.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x16')));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x17')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require('../api/smsAccount/smsAccount.rpc'));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x18')));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x19')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x1a')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x1b')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x1c')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x1d')));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x1e')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x1f')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x20')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x21')));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x22')));_0x57c6a2=_['merge'](_0x57c6a2,require('../api/cmHopper/cmHopper.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x23')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x24')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x25')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x26')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x27')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x28')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x29')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x2a')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x2b')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x2c')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x2d')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x2e')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x2f')));_0x57c6a2=_['merge'](_0x57c6a2,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x30')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x31')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x32')));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x33')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x34')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x35')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x36')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x37')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x38')));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x39')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x3a')));_0x57c6a2=_['merge'](_0x57c6a2,require('../api/squareMessage/squareMessage.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x3b')));_0x57c6a2=_['merge'](_0x57c6a2,require('../api/attachment/attachment.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require('../api/plugin/plugin.rpc'));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x3c')));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x3d')));_0x57c6a2=_[_0x8e95('0x3')](_0x57c6a2,require(_0x8e95('0x3e')));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x3f')));_0x57c6a2=_['merge'](_0x57c6a2,require(_0x8e95('0x40')));var _0x57388c=jayson['server'](_0x57c6a2)['http']();var _0x26567b=config['rpc']['port']||config[_0x8e95('0x41')]+0x1;var _0x16c0b2=config['rpc']['ip']||'localhost';_0x57388c['on'](_0x8e95('0x42'),function(_0x432fde){return _0x559772(_0x432fde);});_0x57388c[_0x8e95('0x2')](_0x26567b,_0x16c0b2,function(){console[_0x8e95('0x43')](_0x8e95('0x44'),_0x16c0b2,_0x26567b);require(_0x8e95('0x45'))[_0x8e95('0x46')]();return _0x40d3c9(_0x8e95('0x47')+_0x16c0b2+':'+_0x26567b);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 5d6db44..0402845 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 _0xf96b=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','inherits','prototype','sync','sendRequest','getData'];(function(_0x908eb6,_0x59199b){var _0x511a09=function(_0x376c8b){while(--_0x376c8b){_0x908eb6['push'](_0x908eb6['shift']());}};_0x511a09(++_0x59199b);}(_0xf96b,0x109));var _0xbf96=function(_0xea9bf1,_0x4fad5b){_0xea9bf1=_0xea9bf1-0x0;var _0x461f92=_0xf96b[_0xea9bf1];return _0x461f92;};'use strict';var util=require(_0xbf96('0x0'));var _=require(_0xbf96('0x1'));var EventEmitter=require(_0xbf96('0x2'))[_0xbf96('0x3')];var AGIReply=require(_0xbf96('0x4'));var AGIError=require(_0xbf96('0x5'));function AGIChannel(_0x440d4e){var _0x25c3d7=this,_0x42be7e=new AGIReply(),_0x38565=![],_0xab8e7={};EventEmitter[_0xbf96('0x6')](_0x25c3d7);_0x440d4e[_0xbf96('0x7')]('utf8');_0x440d4e[_0xbf96('0x8')](0x8*0x3c*0x3c*0x3e8);_0x42be7e[_0xbf96('0x7')](_0xbf96('0x9'));_0x42be7e['on'](_0xbf96('0xa'),function(_0x56d77d){for(var _0x337087 in _0x56d77d){_0x25c3d7[_0x337087]=_0x56d77d[_0x337087];}_0x25c3d7[_0xbf96('0xb')](_0xbf96('0xc'));});_0x42be7e['on'](_0xbf96('0xd'),function(_0x10440d){if(_0x10440d[_0xbf96('0xe')]()==_0xbf96('0xf')){_0x25c3d7[_0xbf96('0xb')]('hangup');return;}if(_0x10440d[_0xbf96('0x10')](0x0,0xb)==_0xbf96('0x11')){_0x38565=!![];}if(_0x38565){_0xab8e7['rx']+=_0x10440d+'\x0a';if(_0x10440d['search'](_0xbf96('0x12'))!=-0x1){_0x38565=![];}}else{_0xab8e7['rx']=_0x10440d;}if(_0x38565){return;}if(typeof _0xab8e7['cb']==_0xbf96('0x13')){var _0x17115d=_0xab8e7['rx'][_0xbf96('0x10')](0x0,0x3),_0x48a709=null,_0xafd96c=null;_0x17115d=parseInt(_0x17115d);if(isNaN(_0x17115d)){_0xab8e7['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xbf96('0x14')});return;}if(_0x17115d!=0xc8){_0xab8e7['cb'](null,{'code':_0x17115d,'result':-0x1,'extra':'KO'});return;}_0x48a709=_0xab8e7['rx'][_0xbf96('0x10')](0x4)[_0xbf96('0x15')](_0xbf96('0x16'),'');if(_0x48a709['indexOf']('\x20')!=-0x1){_0x48a709=_0x48a709[_0xbf96('0x17')](0x0,_0x48a709[_0xbf96('0x18')]('\x20'));}if(_[_0xbf96('0x19')](_0x48a709,'-1')){_0x48a709=parseInt(_0x48a709);}_0xafd96c=_0xab8e7['rx'][_0xbf96('0x1a')]('\x20');if(_0xafd96c[_0xbf96('0x1b')]==0x3){_0xafd96c=_0xafd96c[0x2][_0xbf96('0x10')](0x1,_0xafd96c[0x2][_0xbf96('0x1b')]-0x1);}else if(_0xafd96c['length']>0x3){var _0x3296a7=/\((.+)\)/;var _0x55428f=_0xab8e7['rx'][_0xbf96('0x1c')](_0x3296a7);if(_0x55428f){_0xafd96c=_0x55428f[0x1];}else{_0xafd96c=null;}}else{_0xafd96c=null;}_0xab8e7['cb'](null,{'code':_0x17115d,'result':_0x48a709,'extra':_0xafd96c});}});_0x440d4e['on'](_0xbf96('0x1d'),function(_0x568425){_0x25c3d7[_0xbf96('0xb')](_0xbf96('0x1d'),new AGIError('E_AGI_SOCKET_ERROR',_0x568425[_0xbf96('0x1e')]));});_0x440d4e['on'](_0xbf96('0x1f'),function(){_0x25c3d7[_0xbf96('0xb')](_0xbf96('0x1f'),new AGIError(_0xbf96('0x20')));});_0x440d4e['on'](_0xbf96('0x21'),function(){_0x25c3d7[_0xbf96('0xb')]('timeout',new AGIError(_0xbf96('0x22')));_0x440d4e['destroy']();});_0x440d4e[_0xbf96('0x23')](_0x42be7e);this[_0xbf96('0x24')]=function(_0x11bd93,_0x4c65ae){var _0x11bd93=_0x11bd93||'',_0x4c65ae=typeof _0x4c65ae==_0xbf96('0x13')?_0x4c65ae:new Function();_0xab8e7={'tx':_0x11bd93,'rx':'','cb':_0x4c65ae};_0x440d4e[_0xbf96('0x25')](_0x11bd93+'\x0a');},this[_0xbf96('0x1f')]=function(){_0x440d4e['destroy']();};}util[_0xbf96('0x26')](AGIChannel,EventEmitter);AGIChannel[_0xbf96('0x27')]['sendRequest']=function(_0x496cef){return this[_0xbf96('0x24')][_0xbf96('0x28')](this,_0x496cef);};AGIChannel[_0xbf96('0x27')]['answer']=function(){return this[_0xbf96('0x29')]('ANSWER');};AGIChannel['prototype'][_0xbf96('0x2a')]=function(_0x30f345,_0x1e4c4f,_0x40b6fb){_0x30f345=_0x30f345===undefined?'beep':_0x30f345;_0x1e4c4f=_0x1e4c4f===undefined?'5':_0x1e4c4f;_0x40b6fb=_0x40b6fb===undefined?'1':_0x40b6fb;return this[_0xbf96('0x29')](util[_0xbf96('0x2b')](_0xbf96('0x2c'),_0x30f345,_0x1e4c4f*0x3e8,_0x40b6fb));};AGIChannel[_0xbf96('0x27')]['noop']=function(_0x59edc6){_0x59edc6=_0x59edc6||_0xbf96('0x2d');return this[_0xbf96('0x29')](util[_0xbf96('0x2b')](_0xbf96('0x2e'),_0x59edc6));};AGIChannel[_0xbf96('0x27')][_0xbf96('0x2f')]=function(_0x1dfa13,_0x2764e0){if(_['isArray'](_0x2764e0)){return this[_0xbf96('0x29')](util[_0xbf96('0x2b')](_0xbf96('0x30'),_0x1dfa13,_0x2764e0['join'](',')));}return this['sendRequest'](util[_0xbf96('0x2b')]('EXEC\x20%s\x20%s',_0x1dfa13,_0x2764e0));};AGIChannel[_0xbf96('0x27')][_0xbf96('0x31')]=function(_0x41e2b3){return this[_0xbf96('0x29')](util[_0xbf96('0x2b')](_0xbf96('0x32'),_0x41e2b3));};AGIChannel[_0xbf96('0x27')][_0xbf96('0x33')]=function(_0x37a1c0){return this['sendRequest'](util[_0xbf96('0x2b')]('SET\x20EXTENSION\x20%s',_0x37a1c0));};AGIChannel[_0xbf96('0x27')][_0xbf96('0x34')]=function(_0x251510){return this['sendRequest'](util[_0xbf96('0x2b')](_0xbf96('0x35'),_0x251510));};AGIChannel[_0xbf96('0x27')][_0xbf96('0xf')]=function(){return this[_0xbf96('0x29')](_0xbf96('0x36'));};AGIChannel[_0xbf96('0x27')][_0xbf96('0x37')]=function(_0x4f360d,_0x1109b8){var _0x53a3ee=_[_0xbf96('0x38')](_0x1109b8)||_[_0xbf96('0x39')](_0x1109b8)?_0x1109b8[_0xbf96('0x3a')]():_0x1109b8;return this[_0xbf96('0x29')](util[_0xbf96('0x2b')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x4f360d,_0x53a3ee?_0x53a3ee[_0xbf96('0x3a')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xbf96('0x27')][_0xbf96('0x3b')]=function(_0x44adfa,_0xdb1713){return this[_0xbf96('0x29')](util[_0xbf96('0x2b')]('SAY\x20NUMBER\x20%s\x20%s',_0x44adfa,_0xdb1713));};AGIChannel[_0xbf96('0x27')]['sayDigits']=function(_0x2f367e,_0x3db5f7){return this[_0xbf96('0x29')](util['format'](_0xbf96('0x3c'),_0x2f367e,_0x3db5f7));};AGIChannel[_0xbf96('0x27')][_0xbf96('0x3d')]=function(_0x4caef2,_0x1b84ad){return this[_0xbf96('0x29')](util[_0xbf96('0x2b')](_0xbf96('0x3e'),_0x4caef2,_0x1b84ad));};AGIChannel[_0xbf96('0x27')][_0xbf96('0x3f')]=function(_0x3835e9,_0x519994,_0x6be4f3){_0x519994=_0x519994||this[_0xbf96('0x40')];_0x6be4f3=_0x6be4f3||0x1;this['setContext'](_0x3835e9);this[_0xbf96('0x33')](_0x519994);this[_0xbf96('0x34')](_0x6be4f3);return this[_0xbf96('0x41')](util[_0xbf96('0x2b')]('GOTO\x20%s\x20%s\x20%s',_0x3835e9,_0x519994,_0x6be4f3));};AGIChannel[_0xbf96('0x27')][_0xbf96('0x42')]=function(_0x1a39d1){return this[_0xbf96('0x29')](util[_0xbf96('0x2b')](_0xbf96('0x43'),_0x1a39d1));};AGIChannel['prototype']['recordFile']=function(_0x3a59da,_0x1c16c0,_0xa66257,_0x52cfad,_0x24e023,_0x1a453c){_0x1c16c0=_0x1c16c0||_0xbf96('0x44');_0xa66257=_0xa66257||'';_0x52cfad=_0x52cfad===undefined?-0x1:_0x52cfad==='-1'?-0x1:_0x52cfad*0x3e8;_0x24e023=_0x24e023===undefined?'':'s='+_0x24e023;_0x1a453c=_0x1a453c?_0xbf96('0x45'):'';return this[_0xbf96('0x29')](util[_0xbf96('0x2b')](_0xbf96('0x46'),_0x3a59da,_0x1c16c0,_0xa66257,_0x52cfad,_0x1a453c,_0x24e023));};AGIChannel[_0xbf96('0x27')][_0xbf96('0x47')]=function(_0x5b41f1,_0x2089e2){_0x2089e2=_0x2089e2||'';return this['sendRequest'](util['format'](_0xbf96('0x48'),_0x5b41f1,_0x2089e2));};AGIChannel['prototype'][_0xbf96('0x49')]=function(_0x5b8d10){return this[_0xbf96('0x2f')](_0xbf96('0x4a'),_0x5b8d10);};AGIChannel[_0xbf96('0x27')]['wait']=function(_0x1e97b0){return this[_0xbf96('0x2f')]('WAIT',_0x1e97b0);};AGIChannel[_0xbf96('0x27')]['error']=function(_0x296292,_0xa852de){this[_0xbf96('0x41')](util[_0xbf96('0x2b')](_0xbf96('0x4b'),_0x296292['id'],_0x296292[_0xbf96('0x4c')],_0xa852de));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x3f32=['function','no\x20code','result=','indexOf','substr','startsWith','length','substring','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','prototype','sendRequest','sync','ANSWER','getData','format','noop','VERBOSE\x20\x22%s\x22','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','wait','exec','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper'];(function(_0x39a2d6,_0x477459){var _0x23af66=function(_0x2eb95e){while(--_0x2eb95e){_0x39a2d6['push'](_0x39a2d6['shift']());}};_0x23af66(++_0x477459);}(_0x3f32,0x87));var _0x23f3=function(_0x115850,_0x4bb634){_0x115850=_0x115850-0x0;var _0xbad084=_0x3f32[_0x115850];return _0xbad084;};'use strict';var util=require(_0x23f3('0x0'));var _=require(_0x23f3('0x1'));var EventEmitter=require('events')[_0x23f3('0x2')];var AGIReply=require(_0x23f3('0x3'));var AGIError=require(_0x23f3('0x4'));function AGIChannel(_0x542045){var _0x4b4c38=this,_0x58593b=new AGIReply(),_0x5a1e13=![],_0x44e693={};EventEmitter[_0x23f3('0x5')](_0x4b4c38);_0x542045[_0x23f3('0x6')](_0x23f3('0x7'));_0x542045[_0x23f3('0x8')](0x8*0x3c*0x3c*0x3e8);_0x58593b[_0x23f3('0x6')](_0x23f3('0x7'));_0x58593b['on']('headers',function(_0x128b65){for(var _0x8b4e4 in _0x128b65){_0x4b4c38[_0x8b4e4]=_0x128b65[_0x8b4e4];}_0x4b4c38[_0x23f3('0x9')](_0x23f3('0xa'));});_0x58593b['on'](_0x23f3('0xb'),function(_0x597b53){if(_0x597b53[_0x23f3('0xc')]()==_0x23f3('0xd')){_0x4b4c38[_0x23f3('0x9')](_0x23f3('0xd'));return;}if(_0x597b53['substring'](0x0,0xb)==_0x23f3('0xe')){_0x5a1e13=!![];}if(_0x5a1e13){_0x44e693['rx']+=_0x597b53+'\x0a';if(_0x597b53[_0x23f3('0xf')](_0x23f3('0x10'))!=-0x1){_0x5a1e13=![];}}else{_0x44e693['rx']=_0x597b53;}if(_0x5a1e13){return;}if(typeof _0x44e693['cb']==_0x23f3('0x11')){var _0x3d98db=_0x44e693['rx']['substring'](0x0,0x3),_0x4971d1=null,_0x5a5504=null;_0x3d98db=parseInt(_0x3d98db);if(isNaN(_0x3d98db)){_0x44e693['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x23f3('0x12')});return;}if(_0x3d98db!=0xc8){_0x44e693['cb'](null,{'code':_0x3d98db,'result':-0x1,'extra':'KO'});return;}_0x4971d1=_0x44e693['rx']['substring'](0x4)['replace'](_0x23f3('0x13'),'');if(_0x4971d1[_0x23f3('0x14')]('\x20')!=-0x1){_0x4971d1=_0x4971d1[_0x23f3('0x15')](0x0,_0x4971d1['indexOf']('\x20'));}if(_[_0x23f3('0x16')](_0x4971d1,'-1')){_0x4971d1=parseInt(_0x4971d1);}_0x5a5504=_0x44e693['rx']['split']('\x20');if(_0x5a5504[_0x23f3('0x17')]==0x3){_0x5a5504=_0x5a5504[0x2][_0x23f3('0x18')](0x1,_0x5a5504[0x2][_0x23f3('0x17')]-0x1);}else if(_0x5a5504[_0x23f3('0x17')]>0x3){var _0x418ff4=/\((.+)\)/;var _0x11ffbf=_0x44e693['rx'][_0x23f3('0x19')](_0x418ff4);if(_0x11ffbf){_0x5a5504=_0x11ffbf[0x1];}else{_0x5a5504=null;}}else{_0x5a5504=null;}_0x44e693['cb'](null,{'code':_0x3d98db,'result':_0x4971d1,'extra':_0x5a5504});}});_0x542045['on'](_0x23f3('0x1a'),function(_0x544f90){_0x4b4c38['emit'](_0x23f3('0x1a'),new AGIError(_0x23f3('0x1b'),_0x544f90[_0x23f3('0x1c')]));});_0x542045['on']('close',function(){_0x4b4c38[_0x23f3('0x9')](_0x23f3('0x1d'),new AGIError(_0x23f3('0x1e')));});_0x542045['on'](_0x23f3('0x1f'),function(){_0x4b4c38['emit']('timeout',new AGIError(_0x23f3('0x20')));_0x542045[_0x23f3('0x21')]();});_0x542045['pipe'](_0x58593b);this[_0x23f3('0x22')]=function(_0x1dbe90,_0x44139e){var _0x1dbe90=_0x1dbe90||'',_0x44139e=typeof _0x44139e==_0x23f3('0x11')?_0x44139e:new Function();_0x44e693={'tx':_0x1dbe90,'rx':'','cb':_0x44139e};_0x542045[_0x23f3('0x23')](_0x1dbe90+'\x0a');},this['close']=function(){_0x542045[_0x23f3('0x21')]();};}util[_0x23f3('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x23f3('0x25')][_0x23f3('0x26')]=function(_0x3d60e6){return this[_0x23f3('0x22')][_0x23f3('0x27')](this,_0x3d60e6);};AGIChannel[_0x23f3('0x25')]['answer']=function(){return this['sendRequest'](_0x23f3('0x28'));};AGIChannel['prototype'][_0x23f3('0x29')]=function(_0x3662b2,_0x2db944,_0x2bca1c){_0x3662b2=_0x3662b2===undefined?'beep':_0x3662b2;_0x2db944=_0x2db944===undefined?'5':_0x2db944;_0x2bca1c=_0x2bca1c===undefined?'1':_0x2bca1c;return this[_0x23f3('0x26')](util[_0x23f3('0x2a')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x3662b2,_0x2db944*0x3e8,_0x2bca1c));};AGIChannel[_0x23f3('0x25')][_0x23f3('0x2b')]=function(_0x345b76){_0x345b76=_0x345b76||'NO\x20MESSAGE';return this[_0x23f3('0x26')](util[_0x23f3('0x2a')](_0x23f3('0x2c'),_0x345b76));};AGIChannel[_0x23f3('0x25')]['exec']=function(_0x3d8a84,_0x27a6fb){if(_['isArray'](_0x27a6fb)){return this[_0x23f3('0x26')](util[_0x23f3('0x2a')](_0x23f3('0x2d'),_0x3d8a84,_0x27a6fb[_0x23f3('0x2e')](',')));}return this[_0x23f3('0x26')](util[_0x23f3('0x2a')]('EXEC\x20%s\x20%s',_0x3d8a84,_0x27a6fb));};AGIChannel[_0x23f3('0x25')][_0x23f3('0x2f')]=function(_0x44bd2d){return this[_0x23f3('0x26')](util['format']('SET\x20CONTEXT\x20%s',_0x44bd2d));};AGIChannel[_0x23f3('0x25')][_0x23f3('0x30')]=function(_0x58d20e){return this[_0x23f3('0x26')](util[_0x23f3('0x2a')](_0x23f3('0x31'),_0x58d20e));};AGIChannel['prototype']['setPriority']=function(_0x15a522){return this[_0x23f3('0x26')](util[_0x23f3('0x2a')](_0x23f3('0x32'),_0x15a522));};AGIChannel[_0x23f3('0x25')][_0x23f3('0xd')]=function(){return this[_0x23f3('0x26')](_0x23f3('0x33'));};AGIChannel[_0x23f3('0x25')][_0x23f3('0x34')]=function(_0x475652,_0x5393ad){var _0x31f0d6=_[_0x23f3('0x35')](_0x5393ad)||_['isNumber'](_0x5393ad)?_0x5393ad['toString']():_0x5393ad;return this['sendRequest'](util[_0x23f3('0x2a')](_0x23f3('0x36'),_0x475652,_0x31f0d6?_0x31f0d6[_0x23f3('0x37')]()[_0x23f3('0x38')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x23f3('0x39')]=function(_0x54b98a,_0x3c4333){return this[_0x23f3('0x26')](util[_0x23f3('0x2a')](_0x23f3('0x3a'),_0x54b98a,_0x3c4333));};AGIChannel[_0x23f3('0x25')][_0x23f3('0x3b')]=function(_0x538dc8,_0x4149e5){return this[_0x23f3('0x26')](util[_0x23f3('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x538dc8,_0x4149e5));};AGIChannel[_0x23f3('0x25')][_0x23f3('0x3c')]=function(_0x3e9d42,_0x31c21d){return this[_0x23f3('0x26')](util[_0x23f3('0x2a')](_0x23f3('0x3d'),_0x3e9d42,_0x31c21d));};AGIChannel[_0x23f3('0x25')][_0x23f3('0x3e')]=function(_0x3ff53d,_0x368cc7,_0x29ebb3){_0x368cc7=_0x368cc7||this['extension'];_0x29ebb3=_0x29ebb3||0x1;this[_0x23f3('0x2f')](_0x3ff53d);this['setExtension'](_0x368cc7);this[_0x23f3('0x3f')](_0x29ebb3);return this[_0x23f3('0x2b')](util['format'](_0x23f3('0x40'),_0x3ff53d,_0x368cc7,_0x29ebb3));};AGIChannel[_0x23f3('0x25')]['getVariable']=function(_0x3c683f){return this['sendRequest'](util[_0x23f3('0x2a')](_0x23f3('0x41'),_0x3c683f));};AGIChannel['prototype']['recordFile']=function(_0x226398,_0x395f54,_0x38251f,_0x5632b1,_0x10364a,_0x30d7e0){_0x395f54=_0x395f54||_0x23f3('0x42');_0x38251f=_0x38251f||'';_0x5632b1=_0x5632b1===undefined?-0x1:_0x5632b1==='-1'?-0x1:_0x5632b1*0x3e8;_0x10364a=_0x10364a===undefined?'':'s='+_0x10364a;_0x30d7e0=_0x30d7e0?_0x23f3('0x43'):'';return this[_0x23f3('0x26')](util[_0x23f3('0x2a')](_0x23f3('0x44'),_0x226398,_0x395f54,_0x38251f,_0x5632b1,_0x30d7e0,_0x10364a));};AGIChannel[_0x23f3('0x25')][_0x23f3('0x45')]=function(_0x1f36ef,_0x18607a){_0x18607a=_0x18607a||'';return this[_0x23f3('0x26')](util[_0x23f3('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x1f36ef,_0x18607a));};AGIChannel[_0x23f3('0x25')]['agi']=function(_0x2a1d94){return this['exec']('AGI',_0x2a1d94);};AGIChannel[_0x23f3('0x25')][_0x23f3('0x46')]=function(_0xf65de){return this[_0x23f3('0x47')](_0x23f3('0x48'),_0xf65de);};AGIChannel[_0x23f3('0x25')][_0x23f3('0x1a')]=function(_0x5e75de,_0x30ba60){this[_0x23f3('0x2b')](util[_0x23f3('0x2a')](_0x23f3('0x49'),_0x5e75de['id'],_0x5e75de[_0x23f3('0x4a')],_0x30ba60));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x23f3('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 7c8c870..542c1f3 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 _0x766c=['util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name'];(function(_0x258f1d,_0x5d310e){var _0x3ba6d8=function(_0x389147){while(--_0x389147){_0x258f1d['push'](_0x258f1d['shift']());}};_0x3ba6d8(++_0x5d310e);}(_0x766c,0x1e0));var _0xc766=function(_0x5c250d,_0x1b3a08){_0x5c250d=_0x5c250d-0x0;var _0x20c521=_0x766c[_0x5c250d];return _0x20c521;};'use strict';var util=require(_0xc766('0x0'));var error={'E_AGI_UNDEFINED':_0xc766('0x1'),'E_AGI_ARGUMENT_PORT':_0xc766('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xc766('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xc766('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xc766('0x5'),'E_AGI_SOCKET_CLOSE':_0xc766('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xc766('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xc766('0x8'),'E_AGI_IVR_ENTRY':_0xc766('0x9')};function AGIError(_0x29e89e){var _0x29e89e=_0x29e89e||null,_0x27cfbe=_0x27cfbe||[],_0x5ad61b=0x1,_0x2820f7='';if(!error[_0x29e89e]){_0x29e89e=_0xc766('0xa');}_0x27cfbe[_0xc766('0xb')](error[_0x29e89e]);while(arguments[_0x5ad61b]){_0x27cfbe[_0xc766('0xb')](arguments[_0x5ad61b]);_0x5ad61b++;}_0x2820f7=util[_0xc766('0xc')]['apply'](util,_0x27cfbe);this[_0xc766('0xd')]=_0x2820f7;this[_0xc766('0xe')]=_0x29e89e;}module['exports']=AGIError; \ No newline at end of file +var _0x121c=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.'];(function(_0x34756e,_0x3c036a){var _0x365e63=function(_0xc96601){while(--_0xc96601){_0x34756e['push'](_0x34756e['shift']());}};_0x365e63(++_0x3c036a);}(_0x121c,0x1ad));var _0xc121=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x121c[_0x5783f4];return _0x28e380;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xc121('0x0'),'E_AGI_ARGUMENT_PORT':_0xc121('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xc121('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xc121('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xc121('0x4'),'E_AGI_SOCKET_TIMEOUT':_0xc121('0x5'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xc121('0x6'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x5054ed){var _0x5054ed=_0x5054ed||null,_0x3259be=_0x3259be||[],_0x4f8e41=0x1,_0x1caac1='';if(!error[_0x5054ed]){_0x5054ed=_0xc121('0x7');}_0x3259be[_0xc121('0x8')](error[_0x5054ed]);while(arguments[_0x4f8e41]){_0x3259be[_0xc121('0x8')](arguments[_0x4f8e41]);_0x4f8e41++;}_0x1caac1=util[_0xc121('0x9')][_0xc121('0xa')](util,_0x3259be);this['message']=_0x1caac1;this[_0xc121('0xb')]=_0x5054ed;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index eaf51ab..7da329d 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 _0x852d=['redis','defaults','localhost','subscribe','agi','E_AGI_SERVER_ERROR','message','emit','projectUpdate','error','exports','lodash','EventEmitter','ioredis','../../config/environment'];(function(_0xad2852,_0x303c97){var _0x21ec0d=function(_0x2ffd00){while(--_0x2ffd00){_0xad2852['push'](_0xad2852['shift']());}};_0x21ec0d(++_0x303c97);}(_0x852d,0xb0));var _0xd852=function(_0xbe7e5e,_0x1bb3d3){_0xbe7e5e=_0xbe7e5e-0x0;var _0x2a7a90=_0x852d[_0xbe7e5e];return _0x2a7a90;};'use strict';var _=require(_0xd852('0x0'));var EventEmitter=require('events')[_0xd852('0x1')];var Redis=require(_0xd852('0x2'));var AGIError=require('./error');var config=require(_0xd852('0x3'));config[_0xd852('0x4')]=_[_0xd852('0x5')](config['redis'],{'host':_0xd852('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xd852('0x4')]);sub[_0xd852('0x7')](_0xd852('0x8'),function(_0x390d6b){if(_0x390d6b)return eventEmitter['emit']('error',new AGIError(_0xd852('0x9'),_0x390d6b));});sub['on'](_0xd852('0xa'),function(_0x1f1d15,_0x14bd95){if(_0x1f1d15!=='agi')return;try{var _0x24b90b=JSON['parse'](_0x14bd95);eventEmitter[_0xd852('0xb')](_0xd852('0xc'),_0x24b90b);}catch(_0x259713){eventEmitter[_0xd852('0xb')](_0xd852('0xd'),new AGIError(_0xd852('0x9'),_0x259713));}});module[_0xd852('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xd294=['events','EventEmitter','ioredis','redis','localhost','subscribe','agi','emit','parse','projectUpdate','error','E_AGI_SERVER_ERROR','exports','lodash'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0xd294,0x187));var _0x4d29=function(_0x47a59d,_0x4650c2){_0x47a59d=_0x47a59d-0x0;var _0x20addf=_0xd294[_0x47a59d];return _0x20addf;};'use strict';var _=require(_0x4d29('0x0'));var EventEmitter=require(_0x4d29('0x1'))[_0x4d29('0x2')];var Redis=require(_0x4d29('0x3'));var AGIError=require('./error');var config=require('../../config/environment');config[_0x4d29('0x4')]=_['defaults'](config[_0x4d29('0x4')],{'host':_0x4d29('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x4d29('0x4')]);sub[_0x4d29('0x6')](_0x4d29('0x7'),function(_0x8243f4){if(_0x8243f4)return eventEmitter[_0x4d29('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x8243f4));});sub['on']('message',function(_0x2af8e4,_0x24255c){if(_0x2af8e4!==_0x4d29('0x7'))return;try{var _0x173580=JSON[_0x4d29('0x9')](_0x24255c);eventEmitter['emit'](_0x4d29('0xa'),_0x173580);}catch(_0x5d2a44){eventEmitter[_0x4d29('0x8')](_0x4d29('0xb'),new AGIError(_0x4d29('0xc'),_0x5d2a44));}});module[_0x4d29('0xd')]={'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 7fe88cf..042cd98 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 _0xc011=['max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','getdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','size','relations','traverseBFS','info','stop\x20traverse','no\x20edge/s\x20available','length','condition','agicommand','vswitch','target','default','menu','invalid','default\x20on\x20switch\x20not\x20found','includes'];(function(_0x28c648,_0x2fe756){var _0x11e77e=function(_0x5b54e7){while(--_0x5b54e7){_0x28c648['push'](_0x28c648['shift']());}};_0x11e77e(++_0x2fe756);}(_0xc011,0x8e));var _0x1c01=function(_0xc315de,_0x5dc877){_0xc315de=_0xc315de-0x0;var _0x11a627=_0xc011[_0xc315de];return _0x11a627;};'use strict';var _=require(_0x1c01('0x0'));var logger=require(_0x1c01('0x1'))(_0x1c01('0x2'));var verticesWithRetry=['menu',_0x1c01('0x3'),'getsecretdigits'];var Graph=function(){this[_0x1c01('0x4')]={};this[_0x1c01('0x5')]={};this[_0x1c01('0x6')]=0x0;};Graph[_0x1c01('0x7')][_0x1c01('0x8')]=function(_0x2f822b){this[_0x1c01('0x4')][_0x2f822b['id']]=_0x2f822b;this[_0x1c01('0x5')][_0x2f822b['id']]=[];};Graph[_0x1c01('0x7')]['addEdge']=function(_0x1b5222,_0x1b2b83,_0x1d63d9){this[_0x1c01('0x5')][_0x1b5222][_0x1c01('0x9')]({'target':_0x1b2b83,'condition':_0x1d63d9});this[_0x1c01('0x6')]+=0x1;};Graph[_0x1c01('0x7')][_0x1c01('0xa')]=function(){return _[_0x1c01('0xa')](this[_0x1c01('0x4')]);};Graph[_0x1c01('0x7')][_0x1c01('0xb')]=function(){return this[_0x1c01('0x6')];};Graph[_0x1c01('0x7')]['getVertex']=function(_0x19b443){return this[_0x1c01('0x4')][_0x19b443];};Graph[_0x1c01('0x7')][_0x1c01('0xc')]=function(_0x3dd169,_0x39d051){if(!this[_0x1c01('0x4')][_0x3dd169]){return logger['info']('no\x20vertex\x20found');}var _0x537aad=_0x39d051(this[_0x1c01('0x4')][_0x3dd169]);if(!_0x537aad){return logger[_0x1c01('0xd')](_0x1c01('0xe'));}if(this[_0x1c01('0x5')][_0x3dd169]['length']===0x0){return logger[_0x1c01('0xd')](_0x1c01('0xf'));}for(var _0x20aeb1=0x0,_0x3d50f4=[],_0x2ce719=![];_0x20aeb1\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','evtHangup','hasOwnProperty','indexOf','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','production','handleUnpublished','getLicense'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0xc55a,0x1dc));var _0xac55=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc55a[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0xac55('0x0'));var syncho=require(_0xac55('0x1'));var util=require(_0xac55('0x2'));var config=require('../../config/environment');var logger=require(_0xac55('0x3'))(_0xac55('0x4'));var utilLicense=require(_0xac55('0x5'));var rpc=require(_0xac55('0x6'));var Project=require(_0xac55('0x7'));var AGIEmitter=require('./events')[_0xac55('0x8')];var projects=[];config[_0xac55('0x4')]=_[_0xac55('0x9')](config[_0xac55('0x4')],{'ip':_0xac55('0xa'),'port':0x11dd});AGIEmitter['on'](_0xac55('0xb'),projectUpdateHandler);function connectionHandler(_0xf9b8b6){process[_0xac55('0xc')](function(){syncho(function(){try{setChannelVariables(_0xf9b8b6);agiHandler(_0xf9b8b6);}catch(_0x2703c6){logger[_0xac55('0xd')](_0x2703c6['stack']);}});});}function projectUpdateHandler(_0x5c3d03){try{var _0x388493=_['findIndex'](projects,['id',_0x5c3d03['id']]);if(_0x388493>-0x1){if(_0x5c3d03['deleted']===!![]){projects[_0xac55('0xe')](_0x388493,0x1);}else{projects[_0x388493]=_0x5c3d03;}}else{projects['push'](_0x5c3d03);}}catch(_0x85f346){logger[_0xac55('0xd')](_0x85f346[_0xac55('0xf')]);}}function listeningHandler(){console[_0xac55('0x10')](_0xac55('0x11'),config[_0xac55('0x4')][_0xac55('0x12')]);logger[_0xac55('0x13')](util[_0xac55('0x14')](_0xac55('0x15'),config[_0xac55('0x4')]['ip'],config['agi'][_0xac55('0x12')]));}function errorHandler(_0x3b8d27){if(_0x3b8d27&&_0x3b8d27[_0xac55('0x16')]&&_0x3b8d27[_0xac55('0x17')]){logger[_0xac55('0xd')](util[_0xac55('0x14')](_0xac55('0x18'),_0x3b8d27[_0xac55('0x16')],_0x3b8d27[_0xac55('0x17')]));}else{logger['error'](util[_0xac55('0x14')](_0xac55('0x19'),_0x3b8d27[_0xac55('0xf')]));}}function closeHandler(){logger['info'](util[_0xac55('0x14')](_0xac55('0x1a'),this[_0xac55('0x1b')],this['calleridname'],this[_0xac55('0x1c')],this['dnid'],this[_0xac55('0x1d')]));try{createSquareReport(this);}catch(_0x63343a){logger[_0xac55('0xd')](_0x63343a[_0xac55('0xf')]);}}function timeoutHandler(){logger[_0xac55('0x13')](util[_0xac55('0x14')](_0xac55('0x1e'),this['arg_1'],this[_0xac55('0x1f')],this[_0xac55('0x1c')],this[_0xac55('0x20')],this[_0xac55('0x1d')]));}function hangupHandler(){logger[_0xac55('0x13')](util[_0xac55('0x14')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xac55('0x1b')],this[_0xac55('0x1f')],this[_0xac55('0x1c')],this['dnid'],this[_0xac55('0x1d')]));this[_0xac55('0x21')]=!![];}function createSquareReport(_0x87628f,_0x536b9a){rpc['createSquareReport'](_0x87628f)['then'](function(_0x824c90){if(_0x536b9a){_0x536b9a(null,_0x824c90);}})['catch'](function(_0x243b97){if(_0x536b9a){_0x536b9a(null,_0x243b97);}});}function setChannelVariables(_0x5a013){for(var _0x2d51b3 in _0x5a013){if(_0x5a013[_0xac55('0x22')](_0x2d51b3)){if(_0x2d51b3[_0xac55('0x23')]('agi_')===0x0){_0x5a013[_0x2d51b3[_0xac55('0x24')](0x4)]=_0x5a013[_0x2d51b3];delete _0x5a013[_0x2d51b3];}}}}function agiHandler(_0xa5232d){logger['debug'](_0xac55('0x25'),JSON[_0xac55('0x26')](_0xa5232d,null,0x2));logger['info'](util[_0xac55('0x14')](_0xac55('0x27'),_0xa5232d[_0xac55('0x1b')],_0xa5232d['calleridname'],_0xa5232d[_0xac55('0x1c')],_0xa5232d[_0xac55('0x20')],_0xa5232d[_0xac55('0x1d')]));_0xa5232d['on'](_0xac55('0xd'),errorHandler);_0xa5232d['on'](_0xac55('0x28'),closeHandler);_0xa5232d['on'](_0xac55('0x29'),timeoutHandler);_0xa5232d[_0xac55('0x21')]=![];_0xa5232d['on'](_0xac55('0x2a'),hangupHandler);var _0x36c1f6=_['find'](projects,['name',_0xa5232d[_0xac55('0x1b')]]);if(!_0x36c1f6)return Project['handleNotFound'](_0xa5232d);if(!_0x36c1f6[_0xac55('0x2b')])return Project[_0xac55('0x2c')](_0xa5232d);return Project['initialize'](_0x36c1f6,_0xa5232d);}function main(){var _0x348b4c;return utilLicense[_0xac55('0x2d')]()[_0xac55('0x2e')](function(_0x147fd5){if(!_0x147fd5)return;if(_0x147fd5[_0xac55('0x2f')]){if(_0x147fd5['callysquare']&&_0x147fd5[_0xac55('0x30')]>0x0){logger['info'](util['format'](_0xac55('0x31'),_0x147fd5[_0xac55('0x30')]));_0x348b4c=_0x147fd5[_0xac55('0x30')];}else{logger[_0xac55('0x13')](_0xac55('0x32'));}}else{logger['info'](_0xac55('0x33'));_0x348b4c=-0x1;}})[_0xac55('0x2e')](function(){return Project[_0xac55('0x34')]();})[_0xac55('0x2e')](function(_0x4e7c72){projects=_0x4e7c72;return;})[_0xac55('0x35')](function(_0x281d64){logger['error'](_0xac55('0x36'),_0x281d64[_0xac55('0xf')]);})[_0xac55('0x37')](function(){var _0x5d49f7=require('./server')(config[_0xac55('0x4')][_0xac55('0x12')],config[_0xac55('0x4')]['ip'],_0x348b4c);_0x5d49f7['on'](_0xac55('0xd'),errorHandler);_0x5d49f7['on'](_0xac55('0x38'),listeningHandler);_0x5d49f7['on'](_0xac55('0x39'),connectionHandler);_0x5d49f7['on'](_0xac55('0x28'),closeHandler);});}main(); \ No newline at end of file +var _0x499b=['[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','lodash','syncho','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','EventEmitter','127.0.0.1','nextTick','error','stack','findIndex','deleted','push','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','handleNotFound','production','initialize','getLicense','callysquare'];(function(_0x34bc33,_0x3de734){var _0x56b85d=function(_0x3ea671){while(--_0x3ea671){_0x34bc33['push'](_0x34bc33['shift']());}};_0x56b85d(++_0x3de734);}(_0x499b,0x7f));var _0xb499=function(_0x2ee341,_0x470bff){_0x2ee341=_0x2ee341-0x0;var _0x132c2c=_0x499b[_0x2ee341];return _0x132c2c;};'use strict';var _=require(_0xb499('0x0'));var syncho=require(_0xb499('0x1'));var util=require('util');var config=require(_0xb499('0x2'));var logger=require(_0xb499('0x3'))(_0xb499('0x4'));var utilLicense=require(_0xb499('0x5'));var rpc=require(_0xb499('0x6'));var Project=require('./project');var AGIEmitter=require('./events')[_0xb499('0x7')];var projects=[];config['agi']=_['defaults'](config['agi'],{'ip':_0xb499('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x442179){process[_0xb499('0x9')](function(){syncho(function(){try{setChannelVariables(_0x442179);agiHandler(_0x442179);}catch(_0x57810f){logger[_0xb499('0xa')](_0x57810f[_0xb499('0xb')]);}});});}function projectUpdateHandler(_0x5548e5){try{var _0x50f11a=_[_0xb499('0xc')](projects,['id',_0x5548e5['id']]);if(_0x50f11a>-0x1){if(_0x5548e5[_0xb499('0xd')]===!![]){projects['splice'](_0x50f11a,0x1);}else{projects[_0x50f11a]=_0x5548e5;}}else{projects[_0xb499('0xe')](_0x5548e5);}}catch(_0x36db5d){logger[_0xb499('0xa')](_0x36db5d[_0xb499('0xb')]);}}function listeningHandler(){console['log'](_0xb499('0xf'),config[_0xb499('0x4')][_0xb499('0x10')]);logger[_0xb499('0x11')](util[_0xb499('0x12')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xb499('0x4')]['ip'],config[_0xb499('0x4')][_0xb499('0x10')]));}function errorHandler(_0x5e72ce){if(_0x5e72ce&&_0x5e72ce[_0xb499('0x13')]&&_0x5e72ce[_0xb499('0x14')]){logger[_0xb499('0xa')](util[_0xb499('0x12')](_0xb499('0x15'),_0x5e72ce[_0xb499('0x13')],_0x5e72ce[_0xb499('0x14')]));}else{logger[_0xb499('0xa')](util[_0xb499('0x12')](_0xb499('0x16'),_0x5e72ce['stack']));}}function closeHandler(){logger['info'](util[_0xb499('0x12')](_0xb499('0x17'),this[_0xb499('0x18')],this[_0xb499('0x19')],this[_0xb499('0x1a')],this['dnid'],this[_0xb499('0x1b')]));try{createSquareReport(this);}catch(_0x39726a){logger[_0xb499('0xa')](_0x39726a[_0xb499('0xb')]);}}function timeoutHandler(){logger[_0xb499('0x11')](util[_0xb499('0x12')](_0xb499('0x1c'),this[_0xb499('0x18')],this[_0xb499('0x19')],this[_0xb499('0x1a')],this[_0xb499('0x1d')],this[_0xb499('0x1b')]));}function hangupHandler(){logger[_0xb499('0x11')](util['format'](_0xb499('0x1e'),this[_0xb499('0x18')],this[_0xb499('0x19')],this['callerid'],this['dnid'],this['uniqueid']));this[_0xb499('0x1f')]=!![];}function createSquareReport(_0x9ce77a,_0x17abe2){rpc[_0xb499('0x20')](_0x9ce77a)[_0xb499('0x21')](function(_0x182c9f){if(_0x17abe2){_0x17abe2(null,_0x182c9f);}})[_0xb499('0x22')](function(_0xab92ed){if(_0x17abe2){_0x17abe2(null,_0xab92ed);}});}function setChannelVariables(_0x16dbb4){for(var _0x2495ba in _0x16dbb4){if(_0x16dbb4[_0xb499('0x23')](_0x2495ba)){if(_0x2495ba[_0xb499('0x24')](_0xb499('0x25'))===0x0){_0x16dbb4[_0x2495ba[_0xb499('0x26')](0x4)]=_0x16dbb4[_0x2495ba];delete _0x16dbb4[_0x2495ba];}}}}function agiHandler(_0x1e849b){logger['debug'](_0xb499('0x27'),JSON[_0xb499('0x28')](_0x1e849b,null,0x2));logger[_0xb499('0x11')](util[_0xb499('0x12')](_0xb499('0x29'),_0x1e849b['arg_1'],_0x1e849b[_0xb499('0x19')],_0x1e849b[_0xb499('0x1a')],_0x1e849b['dnid'],_0x1e849b[_0xb499('0x1b')]));_0x1e849b['on']('error',errorHandler);_0x1e849b['on'](_0xb499('0x2a'),closeHandler);_0x1e849b['on'](_0xb499('0x2b'),timeoutHandler);_0x1e849b[_0xb499('0x1f')]=![];_0x1e849b['on']('hangup',hangupHandler);var _0x5899ea=_[_0xb499('0x2c')](projects,['name',_0x1e849b[_0xb499('0x18')]]);if(!_0x5899ea)return Project[_0xb499('0x2d')](_0x1e849b);if(!_0x5899ea[_0xb499('0x2e')])return Project['handleUnpublished'](_0x1e849b);return Project[_0xb499('0x2f')](_0x5899ea,_0x1e849b);}function main(){var _0x1b4727;return utilLicense[_0xb499('0x30')]()['then'](function(_0x531195){if(!_0x531195)return;if(_0x531195['voice']){if(_0x531195['callysquare']&&_0x531195[_0xb499('0x31')]>0x0){logger[_0xb499('0x11')](util[_0xb499('0x12')](_0xb499('0x32'),_0x531195[_0xb499('0x31')]));_0x1b4727=_0x531195['callysquare'];}else{logger['info'](_0xb499('0x33'));}}else{logger[_0xb499('0x11')](_0xb499('0x34'));_0x1b4727=-0x1;}})[_0xb499('0x21')](function(){return Project[_0xb499('0x35')]();})[_0xb499('0x21')](function(_0x594d82){projects=_0x594d82;return;})['catch'](function(_0x3c54a8){logger[_0xb499('0xa')](_0xb499('0x36'),_0x3c54a8['stack']);})[_0xb499('0x37')](function(){var _0x11f608=require(_0xb499('0x38'))(config[_0xb499('0x4')][_0xb499('0x10')],config[_0xb499('0x4')]['ip'],_0x1b4727);_0x11f608['on'](_0xb499('0xa'),errorHandler);_0x11f608['on'](_0xb499('0x39'),listeningHandler);_0x11f608['on'](_0xb499('0x3a'),connectionHandler);_0x11f608['on'](_0xb499('0x2a'),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 cd6438c..09109ef 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 _0x46eb=['result','catch','sendMailMessage','bluebird','client','http','request','then','error','message'];(function(_0x38fe75,_0x4cf82a){var _0x3cae4d=function(_0x425e49){while(--_0x425e49){_0x38fe75['push'](_0x38fe75['shift']());}};_0x3cae4d(++_0x4cf82a);}(_0x46eb,0xd5));var _0xb46e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x46eb[_0x2c91e9];return _0x13f0ff;};'use strict';var BPromise=require(_0xb46e('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xb46e('0x1')][_0xb46e('0x2')]({'port':0x232b});function request(_0x4bccf1,_0x1facaa){return new BPromise(function(_0x33a35d,_0x187d88){return client[_0xb46e('0x3')](_0x4bccf1,_0x1facaa)[_0xb46e('0x4')](function(_0x3940cc){if(_0x3940cc[_0xb46e('0x5')]){return _0x187d88(_0x3940cc[_0xb46e('0x5')][_0xb46e('0x6')]);}else{return _0x33a35d(_0x3940cc[_0xb46e('0x7')]);}})[_0xb46e('0x8')](function(_0x21afa1){return _0x187d88(_0x21afa1);});});}exports[_0xb46e('0x9')]=function(_0x14ef33,_0x2496f3){return request('SendMail',{'account':_0x14ef33,'message':_0x2496f3});}; \ No newline at end of file +var _0xbc85=['jayson/promise','http','request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x320635,_0x429b9f){var _0x230dc8=function(_0x5aeeac){while(--_0x5aeeac){_0x320635['push'](_0x320635['shift']());}};_0x230dc8(++_0x429b9f);}(_0xbc85,0x8e));var _0x5bc8=function(_0x52ef2d,_0xf6adcc){_0x52ef2d=_0x52ef2d-0x0;var _0x277179=_0xbc85[_0x52ef2d];return _0x277179;};'use strict';var BPromise=require(_0x5bc8('0x0'));var jayson=require(_0x5bc8('0x1'));var client=jayson['client'][_0x5bc8('0x2')]({'port':0x232b});function request(_0x5058c7,_0x7bdc91){return new BPromise(function(_0x16f5f3,_0x2418ba){return client[_0x5bc8('0x3')](_0x5058c7,_0x7bdc91)[_0x5bc8('0x4')](function(_0x3d2c28){if(_0x3d2c28[_0x5bc8('0x5')]){return _0x2418ba(_0x3d2c28[_0x5bc8('0x5')][_0x5bc8('0x6')]);}else{return _0x16f5f3(_0x3d2c28[_0x5bc8('0x7')]);}})[_0x5bc8('0x8')](function(_0x3ee2c8){return _0x2418ba(_0x3ee2c8);});});}exports[_0x5bc8('0x9')]=function(_0x4d7418,_0xcbf6d8){return request(_0x5bc8('0xa'),{'account':_0x4d7418,'message':_0xcbf6d8});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index a041b36..b0fabe4 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 _0x6aa8=['Project\x20%s\x20not\x20published','exports','moment','util','agi','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','target','addEdge','value','toJson','inspect','production','debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','format','arg_1','callerid','dnid','uniqueid','clear','vertex','gotoc','context','extension','priority','response','code','result','isUndefined','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','traverseBFS','finally','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','close'];(function(_0x200163,_0x1f2a34){var _0x4c26f3=function(_0x101e4e){while(--_0x101e4e){_0x200163['push'](_0x200163['shift']());}};_0x4c26f3(++_0x1f2a34);}(_0x6aa8,0x74));var _0x86aa=function(_0x4bb89d,_0xed2677){_0x4bb89d=_0x4bb89d-0x0;var _0xdf2e97=_0x6aa8[_0x4bb89d];return _0xdf2e97;};'use strict';var _=require('lodash');var moment=require(_0x86aa('0x0'));var parser=require('xml2json');var util=require(_0x86aa('0x1'));var logger=require('../../config/logger')(_0x86aa('0x2'));var rpc=require('./rpc');var mailRpc=require(_0x86aa('0x3'));var Graph=require(_0x86aa('0x4'));var Vertices=require(_0x86aa('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x86aa('0x6')]()[_0x86aa('0x7')](function(_0x3f1a1c){logger[_0x86aa('0x8')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x3f1a1c[_0x86aa('0x9')]);return[];});}function addVertex(_0x21e5e7,_0x1f524a,_0x389da1){_0x1f524a[_0x86aa('0xa')]=_0x389da1;if(_0x1f524a[_0x86aa('0xb')](_0x86aa('0xc'))){_0x1f524a[_0x86aa('0xd')]=parseInt(_0x1f524a[_0x86aa('0xc')],0xa);}_0x21e5e7[_0x86aa('0xe')](_[_0x86aa('0xf')](_0x1f524a,_0x86aa('0x10')));}function initGraph(_0x4d57d5,_0x1bbe74){var _0x55f1c6=new Graph();for(var _0x41f552 in _0x4d57d5){if(_0x4d57d5[_0x86aa('0xb')](_0x41f552)){if(_['isArray'](_0x4d57d5[_0x41f552])){for(var _0x2c98ff=0x0;_0x2c98ff<_0x4d57d5[_0x41f552]['length'];_0x2c98ff+=0x1){addVertex(_0x55f1c6,_0x4d57d5[_0x41f552][_0x2c98ff],_0x41f552);}}else{addVertex(_0x55f1c6,_0x4d57d5[_0x41f552],_0x41f552);}}}for(var _0x1069be=0x0;_0x1069be<_0x1bbe74[_0x86aa('0x11')];_0x1069be+=0x1){if(_0x1bbe74[_0x1069be]['source']&&_0x1bbe74[_0x1069be][_0x86aa('0x12')]){_0x55f1c6[_0x86aa('0x13')](_0x1bbe74[_0x1069be]['source'],_0x1bbe74[_0x1069be][_0x86aa('0x12')],_0x1bbe74[_0x1069be][_0x86aa('0x14')]);}}return _0x55f1c6;}function getRoot(_0x41d2e7){return parser[_0x86aa('0x15')](_0x41d2e7,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0xfe536a){return util[_0x86aa('0x16')](_0xfe536a,{'showHidden':![],'depth':null});}function initialize(_0x341693,_0x2bbfff){var _0x55e3ba=getRoot(_0x341693[_0x86aa('0x17')]);if(!_0x55e3ba||!_0x55e3ba['start'])return;var _0x46ffb6,_0x4dd0a2,_0x224aea;logger[_0x86aa('0x18')]('root',JSON[_0x86aa('0x19')](_0x55e3ba,null,0x2));_0x2bbfff[_0x86aa('0x1a')]=moment()['format'](_0x86aa('0x1b'));_0x46ffb6=initGraph(_['omit'](_0x55e3ba,_0x86aa('0x10')),_0x55e3ba[_0x86aa('0x10')]);_0x4dd0a2=new Vertices(_0x2bbfff,rpc,mailRpc);logger[_0x86aa('0x1c')](util[_0x86aa('0x1d')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2bbfff[_0x86aa('0x1e')],_0x2bbfff['calleridname'],_0x2bbfff[_0x86aa('0x1f')],_0x2bbfff[_0x86aa('0x20')],_0x2bbfff[_0x86aa('0x21')]));_0x46ffb6['traverseBFS'](_0x55e3ba['start']['id'],function(_0x21d4d1){try{_0x21d4d1=_0x4dd0a2[_0x86aa('0x22')](_0x21d4d1);logger['debug'](_0x86aa('0x23'),JSON['stringify'](_0x21d4d1,null,0x2));if(_0x21d4d1[_0x86aa('0xa')]===_0x86aa('0x24')){logger[_0x86aa('0x1c')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x2bbfff[_0x86aa('0x25')]=_0x21d4d1[_0x86aa('0x25')]||_0x2bbfff[_0x86aa('0x25')];_0x2bbfff[_0x86aa('0x26')]=_0x21d4d1[_0x86aa('0x26')];_0x2bbfff[_0x86aa('0x27')]=_0x21d4d1[_0x86aa('0x27')]?_0x21d4d1[_0x86aa('0x27')]-0x1:0x1;return null;}else if(_0x21d4d1&&_0x4dd0a2[_0x21d4d1[_0x86aa('0xa')]]){_0x224aea=_0x4dd0a2[_0x21d4d1[_0x86aa('0xa')]](_0x21d4d1);logger[_0x86aa('0x1c')](_0x86aa('0x28'),JSON[_0x86aa('0x19')](_0x224aea,null,0x2));if(_0x224aea&&_0x224aea[_0x86aa('0x29')]===AGI_CODE_SUCCESS&&_0x224aea[_0x86aa('0x2a')]!==AGI_RESULT_ERROR&&!_0x2bbfff['evtHangup']){logger['debug']('response',inspect(_0x224aea));return _[_0x86aa('0x2b')](_0x224aea[_0x86aa('0x2a')])?null:_0x224aea['result'][_0x86aa('0x2c')]();}else{logger['error'](_0x86aa('0x28'),inspect(_0x224aea));return null;}}else{logger[_0x86aa('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x306fab){logger[_0x86aa('0x8')](_0x306fab[_0x86aa('0x9')]);return null;}});if(_0x55e3ba['finally']){logger['info'](util['format'](_0x86aa('0x2d'),_0x2bbfff[_0x86aa('0x1e')],_0x2bbfff[_0x86aa('0x2e')],_0x2bbfff['callerid'],_0x2bbfff[_0x86aa('0x20')],_0x2bbfff[_0x86aa('0x21')]));_0x46ffb6[_0x86aa('0x2f')](_0x55e3ba[_0x86aa('0x30')]['id'],function(_0x5b26b9){try{_0x5b26b9=_0x4dd0a2[_0x86aa('0x22')](_0x5b26b9);logger['debug'](_0x86aa('0x23'),JSON[_0x86aa('0x19')](_0x5b26b9,null,0x2));if(_0x5b26b9&&_0x4dd0a2[_0x5b26b9[_0x86aa('0xa')]]){_0x224aea=_0x4dd0a2[_0x5b26b9['agicommand']](_0x5b26b9);if(_0x224aea){logger[_0x86aa('0x18')](_0x86aa('0x28'),inspect(_0x224aea));return _[_0x86aa('0x2b')](_0x224aea[_0x86aa('0x2a')])?null:_0x224aea[_0x86aa('0x2a')]['toString']();}else{logger[_0x86aa('0x8')]('response',inspect(_0x224aea));return null;}}else{logger['error'](_0x86aa('0x31'));return null;}}catch(_0x480732){logger['error'](_0x480732[_0x86aa('0x9')]);return null;}});}logger[_0x86aa('0x1c')](util[_0x86aa('0x1d')](_0x86aa('0x32'),_0x2bbfff[_0x86aa('0x1e')],_0x2bbfff[_0x86aa('0x2e')],_0x2bbfff[_0x86aa('0x1f')],_0x2bbfff[_0x86aa('0x20')],_0x2bbfff[_0x86aa('0x21')]));logger['info'](util[_0x86aa('0x1d')](_0x86aa('0x33'),_0x2bbfff[_0x86aa('0x25')],_0x2bbfff[_0x86aa('0x26')],parseInt(_0x2bbfff[_0x86aa('0x27')],0xa)+0x1));_0x2bbfff[_0x86aa('0x34')](_0x2bbfff[_0x86aa('0x25')],_0x2bbfff[_0x86aa('0x26')],parseInt(_0x2bbfff['priority'],0xa)+0x1);_0x2bbfff['close']();}function handleNotFound(_0xc19319){logger['error'](util[_0x86aa('0x1d')](_0x86aa('0x35'),_0xc19319[_0x86aa('0x1e')]));_0xc19319[_0x86aa('0x34')](_0xc19319[_0x86aa('0x25')],_0xc19319['extension'],parseInt(_0xc19319[_0x86aa('0x27')],0xa)+0x1);_0xc19319[_0x86aa('0x36')]();}function handleUnpublished(_0x716387){logger['error'](util[_0x86aa('0x1d')](_0x86aa('0x37'),_0x716387[_0x86aa('0x1e')]));_0x716387[_0x86aa('0x34')](_0x716387[_0x86aa('0x25')],_0x716387[_0x86aa('0x26')],parseInt(_0x716387[_0x86aa('0x27')],0xa)+0x1);_0x716387[_0x86aa('0x36')]();}module[_0x86aa('0x38')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x5cd1=['agi','./mailRpc','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','addVertex','omit','hasOwnProperty','isArray','length','target','addEdge','source','value','toJson','mxGraphModel','root','inspect','production','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','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','dnid','uniqueid','traverseBFS','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20published','lodash','moment','xml2json','util','../../config/logger'];(function(_0x5b740b,_0x381833){var _0x6f8f4e=function(_0x86d068){while(--_0x86d068){_0x5b740b['push'](_0x5b740b['shift']());}};_0x6f8f4e(++_0x381833);}(_0x5cd1,0x12c));var _0x15cd=function(_0x1648bb,_0x5e9aee){_0x1648bb=_0x1648bb-0x0;var _0xf7420a=_0x5cd1[_0x1648bb];return _0xf7420a;};'use strict';var _=require(_0x15cd('0x0'));var moment=require(_0x15cd('0x1'));var parser=require(_0x15cd('0x2'));var util=require(_0x15cd('0x3'));var logger=require(_0x15cd('0x4'))(_0x15cd('0x5'));var rpc=require('./rpc');var mailRpc=require(_0x15cd('0x6'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x15cd('0x7')]()['catch'](function(_0xd23b60){logger[_0x15cd('0x8')](_0x15cd('0x9'),_0xd23b60[_0x15cd('0xa')]);return[];});}function addVertex(_0x2f40f7,_0x48eda7,_0x40c699){_0x48eda7[_0x15cd('0xb')]=_0x40c699;if(_0x48eda7['hasOwnProperty']('retry')){_0x48eda7['maxRetry']=parseInt(_0x48eda7[_0x15cd('0xc')],0xa);}_0x2f40f7[_0x15cd('0xd')](_[_0x15cd('0xe')](_0x48eda7,'mxCell'));}function initGraph(_0x27aa05,_0x590a48){var _0x116cbb=new Graph();for(var _0x1f007f in _0x27aa05){if(_0x27aa05[_0x15cd('0xf')](_0x1f007f)){if(_[_0x15cd('0x10')](_0x27aa05[_0x1f007f])){for(var _0xb9f613=0x0;_0xb9f613<_0x27aa05[_0x1f007f]['length'];_0xb9f613+=0x1){addVertex(_0x116cbb,_0x27aa05[_0x1f007f][_0xb9f613],_0x1f007f);}}else{addVertex(_0x116cbb,_0x27aa05[_0x1f007f],_0x1f007f);}}}for(var _0x55640a=0x0;_0x55640a<_0x590a48[_0x15cd('0x11')];_0x55640a+=0x1){if(_0x590a48[_0x55640a]['source']&&_0x590a48[_0x55640a][_0x15cd('0x12')]){_0x116cbb[_0x15cd('0x13')](_0x590a48[_0x55640a][_0x15cd('0x14')],_0x590a48[_0x55640a][_0x15cd('0x12')],_0x590a48[_0x55640a][_0x15cd('0x15')]);}}return _0x116cbb;}function getRoot(_0x4f6a68){return parser[_0x15cd('0x16')](_0x4f6a68,{'object':!![]})[_0x15cd('0x17')][_0x15cd('0x18')];}function inspect(_0x5bc3f7){return util[_0x15cd('0x19')](_0x5bc3f7,{'showHidden':![],'depth':null});}function initialize(_0x5e923b,_0xdfc6fa){var _0x9ae8f7=getRoot(_0x5e923b[_0x15cd('0x1a')]);if(!_0x9ae8f7||!_0x9ae8f7['start'])return;var _0x4f7c68,_0xb16839,_0x35b887;logger[_0x15cd('0x1b')](_0x15cd('0x18'),JSON[_0x15cd('0x1c')](_0x9ae8f7,null,0x2));_0xdfc6fa[_0x15cd('0x1d')]=moment()[_0x15cd('0x1e')](_0x15cd('0x1f'));_0x4f7c68=initGraph(_[_0x15cd('0xe')](_0x9ae8f7,_0x15cd('0x20')),_0x9ae8f7[_0x15cd('0x20')]);_0xb16839=new Vertices(_0xdfc6fa,rpc,mailRpc);logger[_0x15cd('0x21')](util[_0x15cd('0x1e')](_0x15cd('0x22'),_0xdfc6fa[_0x15cd('0x23')],_0xdfc6fa[_0x15cd('0x24')],_0xdfc6fa[_0x15cd('0x25')],_0xdfc6fa[_0x15cd('0x26')],_0xdfc6fa[_0x15cd('0x27')]));_0x4f7c68[_0x15cd('0x28')](_0x9ae8f7[_0x15cd('0x29')]['id'],function(_0x117cef){try{_0x117cef=_0xb16839[_0x15cd('0x2a')](_0x117cef);logger[_0x15cd('0x1b')](_0x15cd('0x2b'),JSON[_0x15cd('0x1c')](_0x117cef,null,0x2));if(_0x117cef['agicommand']===_0x15cd('0x2c')){logger['info'](_0x15cd('0x2d'));_0xdfc6fa[_0x15cd('0x2e')]=_0x117cef[_0x15cd('0x2e')]||_0xdfc6fa[_0x15cd('0x2e')];_0xdfc6fa['extension']=_0x117cef[_0x15cd('0x2f')];_0xdfc6fa['priority']=_0x117cef[_0x15cd('0x30')]?_0x117cef[_0x15cd('0x30')]-0x1:0x1;return null;}else if(_0x117cef&&_0xb16839[_0x117cef[_0x15cd('0xb')]]){_0x35b887=_0xb16839[_0x117cef['agicommand']](_0x117cef);logger['info'](_0x15cd('0x31'),JSON[_0x15cd('0x1c')](_0x35b887,null,0x2));if(_0x35b887&&_0x35b887[_0x15cd('0x32')]===AGI_CODE_SUCCESS&&_0x35b887[_0x15cd('0x33')]!==AGI_RESULT_ERROR&&!_0xdfc6fa['evtHangup']){logger[_0x15cd('0x1b')]('response',inspect(_0x35b887));return _[_0x15cd('0x34')](_0x35b887[_0x15cd('0x33')])?null:_0x35b887['result'][_0x15cd('0x35')]();}else{logger[_0x15cd('0x8')](_0x15cd('0x31'),inspect(_0x35b887));return null;}}else{logger[_0x15cd('0x8')](_0x15cd('0x36'));return null;}}catch(_0x466c60){logger[_0x15cd('0x8')](_0x466c60[_0x15cd('0xa')]);return null;}});if(_0x9ae8f7[_0x15cd('0x37')]){logger[_0x15cd('0x21')](util[_0x15cd('0x1e')](_0x15cd('0x38'),_0xdfc6fa[_0x15cd('0x23')],_0xdfc6fa[_0x15cd('0x24')],_0xdfc6fa[_0x15cd('0x25')],_0xdfc6fa[_0x15cd('0x26')],_0xdfc6fa['uniqueid']));_0x4f7c68[_0x15cd('0x28')](_0x9ae8f7['finally']['id'],function(_0x2659f9){try{_0x2659f9=_0xb16839[_0x15cd('0x2a')](_0x2659f9);logger['debug'](_0x15cd('0x2b'),JSON[_0x15cd('0x1c')](_0x2659f9,null,0x2));if(_0x2659f9&&_0xb16839[_0x2659f9[_0x15cd('0xb')]]){_0x35b887=_0xb16839[_0x2659f9[_0x15cd('0xb')]](_0x2659f9);if(_0x35b887){logger['debug'](_0x15cd('0x31'),inspect(_0x35b887));return _[_0x15cd('0x34')](_0x35b887[_0x15cd('0x33')])?null:_0x35b887[_0x15cd('0x33')][_0x15cd('0x35')]();}else{logger[_0x15cd('0x8')]('response',inspect(_0x35b887));return null;}}else{logger[_0x15cd('0x8')](_0x15cd('0x36'));return null;}}catch(_0x38ef43){logger['error'](_0x38ef43[_0x15cd('0xa')]);return null;}});}logger['info'](util['format'](_0x15cd('0x39'),_0xdfc6fa[_0x15cd('0x23')],_0xdfc6fa[_0x15cd('0x24')],_0xdfc6fa['callerid'],_0xdfc6fa[_0x15cd('0x26')],_0xdfc6fa['uniqueid']));logger[_0x15cd('0x21')](util[_0x15cd('0x1e')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0xdfc6fa[_0x15cd('0x2e')],_0xdfc6fa[_0x15cd('0x2f')],parseInt(_0xdfc6fa['priority'],0xa)+0x1));_0xdfc6fa[_0x15cd('0x3a')](_0xdfc6fa[_0x15cd('0x2e')],_0xdfc6fa[_0x15cd('0x2f')],parseInt(_0xdfc6fa[_0x15cd('0x30')],0xa)+0x1);_0xdfc6fa[_0x15cd('0x3b')]();}function handleNotFound(_0x1c230c){logger['error'](util[_0x15cd('0x1e')]('Project\x20%s\x20not\x20found',_0x1c230c[_0x15cd('0x23')]));_0x1c230c[_0x15cd('0x3a')](_0x1c230c[_0x15cd('0x2e')],_0x1c230c[_0x15cd('0x2f')],parseInt(_0x1c230c['priority'],0xa)+0x1);_0x1c230c[_0x15cd('0x3b')]();}function handleUnpublished(_0x166d1d){logger[_0x15cd('0x8')](util['format'](_0x15cd('0x3c'),_0x166d1d['arg_1']));_0x166d1d[_0x15cd('0x3a')](_0x166d1d[_0x15cd('0x2e')],_0x166d1d[_0x15cd('0x2f')],parseInt(_0x166d1d[_0x15cd('0x30')],0xa)+0x1);_0x166d1d[_0x15cd('0x3b')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b79a684..12157ef 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 _0x2aaa=['length','emit','headers','line','util','Transform','call','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','_localBuffer','toString','substring','split','indexOf','slice','trim'];(function(_0x1005bc,_0xcbc496){var _0x468571=function(_0x4513ac){while(--_0x4513ac){_0x1005bc['push'](_0x1005bc['shift']());}};_0x468571(++_0xcbc496);}(_0x2aaa,0x1d8));var _0xa2aa=function(_0x3fbb62,_0x1c30b4){_0x3fbb62=_0x3fbb62-0x0;var _0x1e2f61=_0x2aaa[_0x3fbb62];return _0x1e2f61;};'use strict';var util=require(_0xa2aa('0x0'));var Transform=require('stream')[_0xa2aa('0x1')];function AGIReply(_0x34c0fd){Transform[_0xa2aa('0x2')](this,_0x34c0fd);this['_localBuffer']='';this[_0xa2aa('0x3')]=![];}util[_0xa2aa('0x4')](AGIReply,Transform);AGIReply[_0xa2aa('0x5')]['_transform']=function(_0x58f61b,_0x2f7d78,_0x1e722e){var _0x2c378f='\x0a',_0x67840e=['\x0a\x0a',_0xa2aa('0x6')],_0x4e8df9=-0x1,_0x486c53=-0x1,_0x5ea15a='',_0xa97331=0x0,_0x2a4557='',_0x1c3fe7='';this[_0xa2aa('0x7')]+=_0x58f61b[_0xa2aa('0x8')]();_0x2a4557=this[_0xa2aa('0x7')];if(!this[_0xa2aa('0x3')]){_0xa97331=0x0;while(_0x67840e[_0xa97331]){while((_0x486c53=_0x2a4557['indexOf'](_0x67840e[_0xa97331]))!=-0x1){_0x5ea15a=_0x67840e[_0xa97331];_0x1c3fe7=_0x2a4557[_0xa2aa('0x9')](0x0,_0x486c53);_0x2a4557=_0x2a4557[_0xa2aa('0x9')](_0x486c53+_0x5ea15a['length']);var _0x2ad327=_0x1c3fe7[_0xa2aa('0xa')](_0x2c378f),_0x11e5b5=0x0,_0x54682e={},_0x2eeef6='',_0xd115de='',_0x410a40=-0x1;while(_0x2ad327[_0x11e5b5]){_0x410a40=_0x2ad327[_0x11e5b5][_0xa2aa('0xb')](':');if(_0x410a40!=-0x1){_0x2eeef6=_0x2ad327[_0x11e5b5][_0xa2aa('0xc')](0x0,_0x410a40)[_0xa2aa('0xd')]();_0xd115de=_0x2ad327[_0x11e5b5][_0xa2aa('0xc')](_0x410a40+0x1)[_0xa2aa('0xd')]();if(_0x2eeef6[_0xa2aa('0xe')]>0x0){_0x54682e[_0x2eeef6]=_0xd115de;}}else{}_0x11e5b5++;}this[_0xa2aa('0xf')](_0xa2aa('0x10'),_0x54682e);this[_0xa2aa('0x3')]=!![];}_0xa97331++;}this[_0xa2aa('0x7')]=_0x2a4557;}else{while((_0x4e8df9=_0x2a4557['indexOf'](_0x2c378f))!=-0x1){_0x1c3fe7=_0x2a4557[_0xa2aa('0x9')](0x0,_0x4e8df9);this[_0xa2aa('0xf')](_0xa2aa('0x11'),_0x1c3fe7);_0x2a4557=_0x2a4557[_0xa2aa('0x9')](_0x4e8df9+_0x2c378f[_0xa2aa('0xe')]);}this['_localBuffer']=_0x2a4557;}_0x1e722e();};module['exports']=AGIReply; \ No newline at end of file +var _0xc8bf=['substring','length','split','slice','trim','emit','headers','util','stream','Transform','call','_localBuffer','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','indexOf'];(function(_0x17022b,_0xd36714){var _0xd620d1=function(_0x1b7b88){while(--_0x1b7b88){_0x17022b['push'](_0x17022b['shift']());}};_0xd620d1(++_0xd36714);}(_0xc8bf,0x181));var _0xfc8b=function(_0xbb8b30,_0x7b7ab2){_0xbb8b30=_0xbb8b30-0x0;var _0x2392ce=_0xc8bf[_0xbb8b30];return _0x2392ce;};'use strict';var util=require(_0xfc8b('0x0'));var Transform=require(_0xfc8b('0x1'))[_0xfc8b('0x2')];function AGIReply(_0x2b63ad){Transform[_0xfc8b('0x3')](this,_0x2b63ad);this[_0xfc8b('0x4')]='';this[_0xfc8b('0x5')]=![];}util[_0xfc8b('0x6')](AGIReply,Transform);AGIReply['prototype'][_0xfc8b('0x7')]=function(_0x107012,_0x2bd693,_0x3a48a0){var _0x36b70d='\x0a',_0x4a1e34=['\x0a\x0a',_0xfc8b('0x8')],_0x29dc20=-0x1,_0x567599=-0x1,_0x646ca7='',_0x5e8c4b=0x0,_0x3cae11='',_0x56edbb='';this[_0xfc8b('0x4')]+=_0x107012[_0xfc8b('0x9')]();_0x3cae11=this[_0xfc8b('0x4')];if(!this['_inBody']){_0x5e8c4b=0x0;while(_0x4a1e34[_0x5e8c4b]){while((_0x567599=_0x3cae11[_0xfc8b('0xa')](_0x4a1e34[_0x5e8c4b]))!=-0x1){_0x646ca7=_0x4a1e34[_0x5e8c4b];_0x56edbb=_0x3cae11['substring'](0x0,_0x567599);_0x3cae11=_0x3cae11[_0xfc8b('0xb')](_0x567599+_0x646ca7[_0xfc8b('0xc')]);var _0x3ec61e=_0x56edbb[_0xfc8b('0xd')](_0x36b70d),_0xcf0323=0x0,_0x2fdb72={},_0x2d16a2='',_0x36c122='',_0x15a126=-0x1;while(_0x3ec61e[_0xcf0323]){_0x15a126=_0x3ec61e[_0xcf0323]['indexOf'](':');if(_0x15a126!=-0x1){_0x2d16a2=_0x3ec61e[_0xcf0323][_0xfc8b('0xe')](0x0,_0x15a126)[_0xfc8b('0xf')]();_0x36c122=_0x3ec61e[_0xcf0323]['slice'](_0x15a126+0x1)[_0xfc8b('0xf')]();if(_0x2d16a2[_0xfc8b('0xc')]>0x0){_0x2fdb72[_0x2d16a2]=_0x36c122;}}else{}_0xcf0323++;}this[_0xfc8b('0x10')](_0xfc8b('0x11'),_0x2fdb72);this[_0xfc8b('0x5')]=!![];}_0x5e8c4b++;}this[_0xfc8b('0x4')]=_0x3cae11;}else{while((_0x29dc20=_0x3cae11['indexOf'](_0x36b70d))!=-0x1){_0x56edbb=_0x3cae11[_0xfc8b('0xb')](0x0,_0x29dc20);this[_0xfc8b('0x10')]('line',_0x56edbb);_0x3cae11=_0x3cae11[_0xfc8b('0xb')](_0x29dc20+_0x36b70d[_0xfc8b('0xc')]);}this[_0xfc8b('0x4')]=_0x3cae11;}_0x3a48a0();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 4c67103..7ced02e 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 _0x55e0=['getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','lodash','moment','jayson/promise','client','request','then','message','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x55e0,0xdc));var _0x055e=function(_0xd7deb2,_0x23755c){_0xd7deb2=_0xd7deb2-0x0;var _0x2b25df=_0x55e0[_0xd7deb2];return _0x2b25df;};'use strict';var _=require(_0x055e('0x0'));var moment=require(_0x055e('0x1'));var jayson=require(_0x055e('0x2'));var client=jayson[_0x055e('0x3')]['http']({'port':0x2329});function request(_0x578882,_0x3a2ee6){return new Promise(function(_0x2d9bd5,_0x33cd7b){return client[_0x055e('0x4')](_0x578882,_0x3a2ee6)[_0x055e('0x5')](function(_0x196394){if(_0x196394['error']){return _0x33cd7b(_0x196394['error'][_0x055e('0x6')]);}else{return _0x2d9bd5(_0x196394['result']);}})[_0x055e('0x7')](function(_0x3c4cf){return _0x33cd7b(_0x3c4cf);});});}exports[_0x055e('0x8')]=function(){return request(_0x055e('0x9'),{'options':{'raw':![],'attributes':['id',_0x055e('0xa'),'production']}});};exports[_0x055e('0xb')]=function(_0xd67814){return request(_0x055e('0xc'),{'options':{'raw':![],'where':{'name':_0xd67814},'attributes':[_0x055e('0xd')]}});};exports[_0x055e('0xe')]=function(_0x5237d9){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x5237d9},'include':[{'model':_0x055e('0xf'),'as':'Smtp','include':[{'model':_0x055e('0x10'),'as':_0x055e('0x10')}]}],'attributes':['id',_0x055e('0xa'),_0x055e('0x11')],'smtp':!![]}});};exports[_0x055e('0x12')]=function(_0x31c649){return request(_0x055e('0xc'),{'options':{'where':{'id':_0x31c649},'attributes':['name']}});};exports[_0x055e('0x13')]=function(_0xb80d83){return request(_0x055e('0x14'),{'options':{'where':{'id':_0xb80d83},'attributes':[_0x055e('0xa')]}});};exports[_0x055e('0x15')]=function(_0x56af18){return request(_0x055e('0x16'),{'options':{'where':{'id':_0x56af18},'attributes':[_0x055e('0xa')]}});};exports[_0x055e('0x17')]=function(_0x599533){return request(_0x055e('0x18'),{'options':{'where':{'id':_0x599533},'attributes':[_0x055e('0x19')]}});};exports[_0x055e('0x1a')]=function(_0x2bad86){return request(_0x055e('0x1b'),{'options':{'where':{'id':_0x2bad86},'attributes':['name']}});};exports[_0x055e('0x1c')]=function(_0x2cf3de){return request(_0x055e('0x1d'),{'options':{'where':{'phone':_0x2cf3de[_0x055e('0x1e')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x4004ce){return request(_0x055e('0x1f'),{'options':{'where':{'id':_0x4004ce},'attributes':['name']}});};exports[_0x055e('0x20')]=function(_0x4412f9){return request(_0x055e('0x21'),{'options':{'where':{'id':_0x4412f9},'attributes':[_0x055e('0x22')]}});};exports[_0x055e('0x23')]=function(_0x4675ff){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x4675ff},'include':[{'model':_0x055e('0x24'),'as':_0x055e('0x25')}]}});};exports[_0x055e('0x26')]=function(_0x5930ff){return request(_0x055e('0x27'),{'options':{'where':{'id':_0x5930ff},'attributes':['id',_0x055e('0xa')]}});};exports[_0x055e('0x28')]=function(_0x37243b){return request('CreateSmsMessage',{'body':_0x37243b});};exports[_0x055e('0x29')]=function(_0x56c372){return request(_0x055e('0x2a'),{'body':_0x56c372});};exports[_0x055e('0x2b')]=function(_0xf8fa4d){return request(_0x055e('0x2c'),{'body':_[_0x055e('0x2d')](_0xf8fa4d,{'project_name':_0xf8fa4d[_0x055e('0x2e')],'prev_project_name':_0xf8fa4d['arg_2']||'','is_subproject':_0xf8fa4d[_0x055e('0x2f')]?!![]:![],'leaveAt':moment()[_0x055e('0x30')](_0x055e('0x31'))})});};exports['createSquareRecording']=function(_0x408e38){return request(_0x055e('0x32'),{'body':_0x408e38});};exports[_0x055e('0x33')]=function(_0x2ef064){return request('CreateSquareMessage',{'body':_0x2ef064});};exports[_0x055e('0x34')]=function(_0x5958ef){return request(_0x055e('0x35'),{'options':{'raw':![],'where':{'phone':_0x5958ef[_0x055e('0x1e')],'ListId':_0x5958ef[_0x055e('0x36')]}}})[_0x055e('0x5')](function(_0x1610f1){if(_0x1610f1){return _0x1610f1;}return request('CreateCmContact',{'body':_0x5958ef});});};exports[_0x055e('0x37')]=function(_0x453e5e){return request(_0x055e('0x38'),{'options':{'where':{'id':_0x453e5e},'attributes':[_0x055e('0xa')]}});};exports[_0x055e('0x39')]=function(_0x225c88,_0x59f8c4){return request(_0x055e('0x3a'),{'body':{'interface':_0x59f8c4},'options':{'where':_0x225c88}});};exports['agentPause']=function(_0x26d1c2,_0x43ec84,_0x5cfeea){return request(_0x055e('0x3b'),{'body':{'type':_0x43ec84,'uniqueid':_0x5cfeea},'options':{'where':_0x26d1c2}});};exports[_0x055e('0x3c')]=function(_0x524344){return request(_0x055e('0x3d'),{'body':{},'options':{'where':_0x524344}});};exports[_0x055e('0x3e')]=function(_0x43d8b7){return request('LogoutUser',{'body':{},'options':{'where':_0x43d8b7}});}; \ No newline at end of file +var _0x94dc=['ShowCmHopper','phone','ListId','getPauseById','agentLogin','LoginUser','agentPause','agentLogout','LogoutUser','lodash','jayson/promise','http','request','then','error','message','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','CloudProvider','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getContactByPhone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact'];(function(_0xa0f176,_0x531ae0){var _0x121089=function(_0x256954){while(--_0x256954){_0xa0f176['push'](_0xa0f176['shift']());}};_0x121089(++_0x531ae0);}(_0x94dc,0xb1));var _0xc94d=function(_0x5596b2,_0x293dc6){_0x5596b2=_0x5596b2-0x0;var _0x34c60e=_0x94dc[_0x5596b2];return _0x34c60e;};'use strict';var _=require(_0xc94d('0x0'));var moment=require('moment');var jayson=require(_0xc94d('0x1'));var client=jayson['client'][_0xc94d('0x2')]({'port':0x2329});function request(_0x1b2070,_0x40e7d8){return new Promise(function(_0x4b2dcc,_0x306706){return client[_0xc94d('0x3')](_0x1b2070,_0x40e7d8)[_0xc94d('0x4')](function(_0x627a1e){if(_0x627a1e[_0xc94d('0x5')]){return _0x306706(_0x627a1e[_0xc94d('0x5')][_0xc94d('0x6')]);}else{return _0x4b2dcc(_0x627a1e['result']);}})[_0xc94d('0x7')](function(_0xbe5904){return _0x306706(_0xbe5904);});});}exports[_0xc94d('0x8')]=function(){return request(_0xc94d('0x9'),{'options':{'raw':![],'attributes':['id',_0xc94d('0xa'),'production']}});};exports[_0xc94d('0xb')]=function(_0x13096c){return request(_0xc94d('0xc'),{'options':{'raw':![],'where':{'name':_0x13096c},'attributes':[_0xc94d('0xd')]}});};exports[_0xc94d('0xe')]=function(_0x1643f8){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x1643f8},'include':[{'model':_0xc94d('0xf'),'as':_0xc94d('0x10'),'include':[{'model':_0xc94d('0x11'),'as':_0xc94d('0x11')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x38e1b9){return request(_0xc94d('0xc'),{'options':{'where':{'id':_0x38e1b9},'attributes':[_0xc94d('0xa')]}});};exports[_0xc94d('0x12')]=function(_0x2e65ae){return request(_0xc94d('0x13'),{'options':{'where':{'id':_0x2e65ae},'attributes':[_0xc94d('0xa')]}});};exports[_0xc94d('0x14')]=function(_0x16d225){return request(_0xc94d('0x15'),{'options':{'where':{'id':_0x16d225},'attributes':[_0xc94d('0xa')]}});};exports[_0xc94d('0x16')]=function(_0x9937d3){return request(_0xc94d('0x17'),{'options':{'where':{'id':_0x9937d3},'attributes':[_0xc94d('0x18')]}});};exports['getUserById']=function(_0x480fd4){return request('ShowUser',{'options':{'where':{'id':_0x480fd4},'attributes':['name']}});};exports[_0xc94d('0x19')]=function(_0x4784a2){return request('GetContactByPhone',{'options':{'where':{'phone':_0x4784a2['phone']},'attributes':['id']}});};exports[_0xc94d('0x1a')]=function(_0x57360a){return request('ShowTrunk',{'options':{'where':{'id':_0x57360a},'attributes':[_0xc94d('0xa')]}});};exports[_0xc94d('0x1b')]=function(_0x27a4e4){return request(_0xc94d('0x1c'),{'options':{'where':{'id':_0x27a4e4},'attributes':[_0xc94d('0x1d')]}});};exports[_0xc94d('0x1e')]=function(_0x3dec12){return request(_0xc94d('0x1f'),{'options':{'raw':![],'where':{'id':_0x3dec12},'include':[{'model':_0xc94d('0x20'),'as':_0xc94d('0x21')}]}});};exports['getSmsAccountById']=function(_0x2dab55){return request(_0xc94d('0x22'),{'options':{'where':{'id':_0x2dab55},'attributes':['id',_0xc94d('0xa')]}});};exports[_0xc94d('0x23')]=function(_0x111823){return request('CreateSmsMessage',{'body':_0x111823});};exports['createSquareDetailsReport']=function(_0x4c07ac){return request(_0xc94d('0x24'),{'body':_0x4c07ac});};exports[_0xc94d('0x25')]=function(_0x17e8c6){return request(_0xc94d('0x26'),{'body':_['merge'](_0x17e8c6,{'project_name':_0x17e8c6['arg_1'],'prev_project_name':_0x17e8c6[_0xc94d('0x27')]||'','is_subproject':_0x17e8c6['arg_2']?!![]:![],'leaveAt':moment()[_0xc94d('0x28')](_0xc94d('0x29'))})});};exports[_0xc94d('0x2a')]=function(_0x565b96){return request(_0xc94d('0x2b'),{'body':_0x565b96});};exports[_0xc94d('0x2c')]=function(_0x2411aa){return request(_0xc94d('0x2d'),{'body':_0x2411aa});};exports[_0xc94d('0x2e')]=function(_0x57428c){return request(_0xc94d('0x2f'),{'options':{'raw':![],'where':{'phone':_0x57428c[_0xc94d('0x30')],'ListId':_0x57428c[_0xc94d('0x31')]}}})[_0xc94d('0x4')](function(_0x4dd290){if(_0x4dd290){return _0x4dd290;}return request('CreateCmContact',{'body':_0x57428c});});};exports[_0xc94d('0x32')]=function(_0x21fcf7){return request('ShowPause',{'options':{'where':{'id':_0x21fcf7},'attributes':['name']}});};exports[_0xc94d('0x33')]=function(_0x156807,_0x26deeb){return request(_0xc94d('0x34'),{'body':{'interface':_0x26deeb},'options':{'where':_0x156807}});};exports[_0xc94d('0x35')]=function(_0x2dab89,_0x1b059e,_0x3d4743){return request('PauseUser',{'body':{'type':_0x1b059e,'uniqueid':_0x3d4743},'options':{'where':_0x2dab89}});};exports['agentUnpause']=function(_0x47c789){return request('UnpauseUser',{'body':{},'options':{'where':_0x47c789}});};exports[_0xc94d('0x36')]=function(_0xd2e024){return request(_0xc94d('0x37'),{'body':{},'options':{'where':_0xd2e024}});}; \ 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 9f8b36d..08306ba 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 _0xb5dd=['exports','./polly','./lex'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0xb5dd,0xd9));var _0xdb5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb5dd[_0x3dd15e];return _0x231fd0;};var polly=require(_0xdb5d('0x0'));var lex=require(_0xdb5d('0x1'));module[_0xdb5d('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x6c32=['exports','./polly'];(function(_0x30a5b5,_0x21e05e){var _0x58e1c4=function(_0x67af6f){while(--_0x67af6f){_0x30a5b5['push'](_0x30a5b5['shift']());}};_0x58e1c4(++_0x21e05e);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};var polly=require(_0x26c3('0x0'));var lex=require('./lex');module[_0x26c3('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 5b7ebb7..0208055 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 _0x6c76=['./lib/api','exports'];(function(_0x561fce,_0x4d98fb){var _0x26370b=function(_0x192291){while(--_0x192291){_0x561fce['push'](_0x561fce['shift']());}};_0x26370b(++_0x4d98fb);}(_0x6c76,0x184));var _0x66c7=function(_0x4ffdc4,_0x34a28a){_0x4ffdc4=_0x4ffdc4-0x0;var _0x3b010c=_0x6c76[_0x4ffdc4];return _0x3b010c;};'use strict';var lex=require(_0x66c7('0x0'));module[_0x66c7('0x1')]=function(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b){return lex(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b);}; \ No newline at end of file +var _0xbdb7=['./lib/api','exports'];(function(_0x4ec80f,_0x3accea){var _0x14b1a1=function(_0x33ae5f){while(--_0x33ae5f){_0x4ec80f['push'](_0x4ec80f['shift']());}};_0x14b1a1(++_0x3accea);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x17fea7,_0x102927){_0x17fea7=_0x17fea7-0x0;var _0x3150c3=_0xbdb7[_0x17fea7];return _0x3150c3;};'use strict';var lex=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]=function(_0x44467d,_0x2a2c1c,_0x23c326,_0x433850,_0x4496ac,_0x2c7e07){return lex(_0x44467d,_0x2a2c1c,_0x23c326,_0x433850,_0x4496ac,_0x2c7e07);}; \ 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 c0c9b74..c3aa944 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(_0x1ec52e,_0x2e6540){var _0x4fad40=function(_0x401a70){while(--_0x401a70){_0x1ec52e['push'](_0x1ec52e['shift']());}};_0x4fad40(++_0x2e6540);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x38508b,_0x4b104e){var _0x4c6866=function(_0x2bd20b){while(--_0x2bd20b){_0x38508b['push'](_0x38508b['shift']());}};_0x4c6866(++_0x4b104e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 3808b00..402a331 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. * // * * // ************************************************************************* -'use strict';var polly=require('./lib/api');module['exports']=function(_0x2d3fe9,_0x50c59c,_0x19078e,_0x4b7d41,_0x12a066,_0x38cf38,_0x14c1d0){return polly(_0x2d3fe9,_0x50c59c,_0x19078e,_0x4b7d41,_0x12a066,_0x38cf38,_0x14c1d0);}; \ No newline at end of file +var _0xed67=['./lib/api','exports'];(function(_0x17ec56,_0xe22cc9){var _0x51f6ee=function(_0x136df9){while(--_0x136df9){_0x17ec56['push'](_0x17ec56['shift']());}};_0x51f6ee(++_0xe22cc9);}(_0xed67,0x92));var _0x7ed6=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0xed67[_0x1de43c];return _0x296d3e;};'use strict';var polly=require(_0x7ed6('0x0'));module[_0x7ed6('0x1')]=function(_0x735fb8,_0x1bfc5d,_0x46f4d2,_0x271d9b,_0x4dab87,_0x200363,_0x3172f4){return polly(_0x735fb8,_0x1bfc5d,_0x46f4d2,_0x271d9b,_0x4dab87,_0x200363,_0x3172f4);}; \ 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 fd1a745..744fd7f 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 _0xd6a0=['exports','text','mp3','path','aws-sdk','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xd6a0,0x65));var _0x0d6a=function(_0x1a6363,_0x205f25){_0x1a6363=_0x1a6363-0x0;var _0xd22157=_0xd6a0[_0x1a6363];return _0xd22157;};'use strict';var fs=require('fs');var path=require(_0x0d6a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0x0d6a('0x1'));function pollyResult(_0x7618d7,_0x427c00,_0x20457d){return new BPromise(function(_0x103ae6,_0x18cc5d){_0x7618d7['synthesizeSpeech'](_0x427c00,function(_0xf4efd4,_0x114c7f){if(_0xf4efd4){_0x18cc5d(_0xf4efd4);}else if(_0x114c7f){if(_0x114c7f[_0x0d6a('0x2')]instanceof Buffer){fs['writeFile'](_0x20457d,_0x114c7f['AudioStream'],function(_0x1659b6){if(_0x1659b6){_0x18cc5d(_0x1659b6);}else{_0x103ae6();}});}else{_0x18cc5d(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x18cc5d(new Error(_0x0d6a('0x3')));}});});}module[_0x0d6a('0x4')]=function(_0x588955,_0x50488b,_0x412fed,_0x976656,_0x75b841,_0x36b94b,_0x5b9727){var _0xf66bd7=new AWS['Polly']({'accessKeyId':_0x588955,'secretAccessKey':_0x50488b,'region':_0x412fed});var _0x2dde8f={'Text':_0x75b841,'TextType':_0x36b94b||_0x0d6a('0x5'),'OutputFormat':_0x0d6a('0x6'),'VoiceId':_0x976656};return pollyResult(_0xf66bd7,_0x2dde8f,_0x5b9727);}; \ No newline at end of file +var _0xe4a0=['bluebird','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe4a0,0x107));var _0x0e4a=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe4a0[_0x1035c1];return _0x308d67;};'use strict';var fs=require('fs');var path=require(_0x0e4a('0x0'));var BPromise=require(_0x0e4a('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x150591,_0x2779f6,_0xda765){return new BPromise(function(_0xff9010,_0x1e6e8a){_0x150591['synthesizeSpeech'](_0x2779f6,function(_0xc7fc88,_0x3a9524){if(_0xc7fc88){_0x1e6e8a(_0xc7fc88);}else if(_0x3a9524){if(_0x3a9524[_0x0e4a('0x2')]instanceof Buffer){fs[_0x0e4a('0x3')](_0xda765,_0x3a9524[_0x0e4a('0x2')],function(_0x513d0d){if(_0x513d0d){_0x1e6e8a(_0x513d0d);}else{_0xff9010();}});}else{_0x1e6e8a(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x1e6e8a(new Error(_0x0e4a('0x4')));}});});}module[_0x0e4a('0x5')]=function(_0x2e2a8a,_0x829652,_0x4bddc6,_0x7462e3,_0x550b9d,_0x118546,_0x2b9306){var _0x5ebc59=new AWS[(_0x0e4a('0x6'))]({'accessKeyId':_0x2e2a8a,'secretAccessKey':_0x829652,'region':_0x4bddc6});var _0x49d90f={'Text':_0x550b9d,'TextType':_0x118546||'text','OutputFormat':_0x0e4a('0x7'),'VoiceId':_0x7462e3};return pollyResult(_0x5ebc59,_0x49d90f,_0x2b9306);}; \ 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 a1453de..9604af8 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 _0x6729=['./lib/api'];(function(_0xd43f00,_0x45588c){var _0x32aafd=function(_0x44d0a2){while(--_0x44d0a2){_0xd43f00['push'](_0xd43f00['shift']());}};_0x32aafd(++_0x45588c);}(_0x6729,0x17b));var _0x9672=function(_0x488c0b,_0x975b3c){_0x488c0b=_0x488c0b-0x0;var _0x38e8e4=_0x6729[_0x488c0b];return _0x38e8e4;};'use strict';var asr=require(_0x9672('0x0'));module['exports']=function(_0x3ee423,_0x52f920,_0x469d7e,_0x35349c){return asr(_0x3ee423,_0x52f920,_0x469d7e);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x40168e,_0x339e8d,_0x50cefe,_0x1419b8){return asr(_0x40168e,_0x339e8d,_0x50cefe);}; \ 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 9db63c2..0907b76 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 _0x1789=['POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','length','filepath\x20should\x20be\x20a\x20string','string','undefined','lang\x20should\x20be\x20a\x20string'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1789,0x92));var _0x9178=function(_0x25c044,_0xbd05f8){_0x25c044=_0x25c044-0x0;var _0x558ee5=_0x1789[_0x25c044];return _0x558ee5;};'use strict';var url=require(_0x9178('0x0'));var BPromise=require(_0x9178('0x1'));var fs=require('fs');var host=_0x9178('0x2');module['exports']=function(_0xf9cb5d,_0xe7c1,_0x3e7033){return new BPromise(function(_0x3a573d,_0x45af56){var _0x5911d4;if(typeof _0xf9cb5d!=='string'||_0xf9cb5d[_0x9178('0x3')]===0x0){return _0x45af56(_0x9178('0x4'));}if(typeof _0xe7c1!==_0x9178('0x5')||_0xe7c1[_0x9178('0x3')]===0x0){return _0x45af56('key\x20should\x20be\x20a\x20string');}if(typeof _0x3e7033!==_0x9178('0x6')&&(typeof _0x3e7033!==_0x9178('0x5')||_0x3e7033[_0x9178('0x3')]===0x0)){return _0x45af56(_0x9178('0x7'));}try{_0x5911d4=fs['readFileSync'](_0xf9cb5d)['toString']('base64');}catch(_0xdd2085){return _0x45af56(_0xdd2085);}return _0x3a573d({'method':_0x9178('0x8'),'uri':host+_0x9178('0x9')+_0xe7c1,'body':{'config':{'encoding':_0x9178('0xa'),'sampleRateHertz':'8000','languageCode':_0x3e7033},'audio':{'content':_0x5911d4}},'json':!![]});});}; \ No newline at end of file +var _0xacfe=['8000','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','LINEAR16'];(function(_0x369a02,_0x43d67b){var _0x48bff0=function(_0x42bb8e){while(--_0x42bb8e){_0x369a02['push'](_0x369a02['shift']());}};_0x48bff0(++_0x43d67b);}(_0xacfe,0xfd));var _0xeacf=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xacfe[_0x5bd426];return _0x23a7eb;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0xeacf('0x0');module[_0xeacf('0x1')]=function(_0x1be610,_0x1b5e18,_0xf1d406){return new BPromise(function(_0x3e22dd,_0x2fbe17){var _0x2bd934;if(typeof _0x1be610!==_0xeacf('0x2')||_0x1be610[_0xeacf('0x3')]===0x0){return _0x2fbe17(_0xeacf('0x4'));}if(typeof _0x1b5e18!==_0xeacf('0x2')||_0x1b5e18[_0xeacf('0x3')]===0x0){return _0x2fbe17('key\x20should\x20be\x20a\x20string');}if(typeof _0xf1d406!==_0xeacf('0x5')&&(typeof _0xf1d406!==_0xeacf('0x2')||_0xf1d406[_0xeacf('0x3')]===0x0)){return _0x2fbe17(_0xeacf('0x6'));}try{_0x2bd934=fs['readFileSync'](_0x1be610)[_0xeacf('0x7')]('base64');}catch(_0x41f6ed){return _0x2fbe17(_0x41f6ed);}return _0x3e22dd({'method':_0xeacf('0x8'),'uri':host+_0xeacf('0x9')+_0x1b5e18,'body':{'config':{'encoding':_0xeacf('0xa'),'sampleRateHertz':_0xeacf('0xb'),'languageCode':_0xf1d406},'audio':{'content':_0x2bd934}},'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 28f8b94..8abf499 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 _0xa368=['./asr','exports'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xa368,0x1c2));var _0x8a36=function(_0x259dd7,_0x34257e){_0x259dd7=_0x259dd7-0x0;var _0x7675c2=_0xa368[_0x259dd7];return _0x7675c2;};var asr=require(_0x8a36('0x0'));module[_0x8a36('0x1')]={'asr':asr}; \ No newline at end of file +var _0x5b34=['exports'];(function(_0x2547f1,_0x1e07dd){var _0xc9208f=function(_0x3aecf0){while(--_0x3aecf0){_0x2547f1['push'](_0x2547f1['shift']());}};_0xc9208f(++_0x1e07dd);}(_0x5b34,0x100));var _0x45b3=function(_0x281e85,_0x3384a6){_0x281e85=_0x281e85-0x0;var _0x4b76f6=_0x5b34[_0x281e85];return _0x4b76f6;};var asr=require('./asr');module[_0x45b3('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index dec3e9a..df2ff92 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 _0xa42e=['statusMessage','createWriteStream','finish','finish\x20download\x20file','unlink','download\x20error','pipe','end','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','generate','writeFileSync','base64','then','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','from','audioContent','writeFile','777','tmp','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','null','slice','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','.wav','info','goggleTTS\x20path','asr','results','alternatives','transcript','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','format','ispeechASR','model=%s','freeform=3','parse','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','http','https','path','querystring','request-promise','url','util','./aws','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20'];(function(_0x11e6f3,_0x437d73){var _0x188bf3=function(_0xbcbb1b){while(--_0xbcbb1b){_0x11e6f3['push'](_0x11e6f3['shift']());}};_0x188bf3(++_0x437d73);}(_0xa42e,0x182));var _0xea42=function(_0x4333e5,_0x47c153){_0x4333e5=_0x4333e5-0x0;var _0x5e73b9=_0xa42e[_0x4333e5];return _0x5e73b9;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xea42('0x0'));var dialogflow=require(_0xea42('0x1'));var fs=require('fs');var http=require(_0xea42('0x2'));var https=require(_0xea42('0x3'));var md5=require('md5');var path=require(_0xea42('0x4'));var querystring=require(_0xea42('0x5'));var rp=require(_0xea42('0x6'));var rs=require('randomstring');var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0xea42('0x7'))['parse'];var util=require(_0xea42('0x8'));var aws=require(_0xea42('0x9'));var google=require('./google');var sestek=require(_0xea42('0xa'));var tilde=require(_0xea42('0xb'));var logger=require(_0xea42('0xc'))(_0xea42('0xd'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x1db9f5,_0x5c30d2){return new BPromise(function(_0x5500ee,_0x2b6fa3){var _0x589730=urlParse(_0x1db9f5);var _0xdd1d09=_0x589730[_0xea42('0xe')]===_0xea42('0xf')?https:http;var _0x620e32={'host':_0x589730[_0xea42('0x10')],'path':_0x589730[_0xea42('0x4')],'headers':{'user-agent':_0xea42('0x11')}};_0xdd1d09['get'](_0x620e32,function(_0x19018f){if(_0x19018f[_0xea42('0x12')]!==0xc8){logger[_0xea42('0x13')](_0xea42('0x14')+_0x1db9f5+_0xea42('0x15')+_0x19018f['statusCode']+'\x20('+_0x19018f[_0xea42('0x16')]+')');_0x2b6fa3(new Error(_0xea42('0x14')+_0x1db9f5+'\x20failed,\x20status\x20code\x20=\x20'+_0x19018f[_0xea42('0x12')]+'\x20('+_0x19018f[_0xea42('0x16')]+')'));return;}var _0x4592a9=fs[_0xea42('0x17')](_0x5c30d2);_0x4592a9['on'](_0xea42('0x18'),function(){logger['info'](_0xea42('0x19'));_0x4592a9['close'](_0x5500ee);});_0x4592a9['on']('error',function(_0x4f6fe5){fs[_0xea42('0x1a')](_0x5c30d2);logger[_0xea42('0x13')](_0xea42('0x1b'),_0x4f6fe5);_0x2b6fa3(_0x4f6fe5);});_0x19018f[_0xea42('0x1c')](_0x4592a9);})['on'](_0xea42('0x13'),function(_0x1200bf){logger[_0xea42('0x13')](_0x1200bf);_0x2b6fa3(_0x1200bf);})[_0xea42('0x1d')]();});}function uploadFile(_0x46ee53){return new BPromise(function(_0x375e65,_0x316831){var _0x421288=urlParse(_0x46ee53);var _0x27361=_0x421288[_0xea42('0xe')]===_0xea42('0xf')?https:http;var _0x4f220f={'host':_0x421288[_0xea42('0x10')],'path':_0x421288[_0xea42('0x4')],'headers':{'user-agent':_0xea42('0x11')}};_0x27361['get'](_0x4f220f,function(_0x56ec17){if(_0x56ec17['statusCode']!==0xc8){_0x316831(new Error(_0xea42('0x14')+_0x46ee53+'\x20failed,\x20status\x20code\x20=\x20'+_0x56ec17[_0xea42('0x12')]+'\x20('+_0x56ec17[_0xea42('0x16')]+')'));return;}var _0x19f921='';_0x56ec17['on']('data',function(_0x2a07f4){_0x19f921+=_0x2a07f4;});_0x56ec17['on'](_0xea42('0x1d'),function(){_0x375e65(_0x19f921);});})['on'](_0xea42('0x13'),function(_0x494898){_0x316831(_0x494898);})[_0xea42('0x1d')]();});}function convertFile(_0x92d8b8,_0x29ae92){return new BPromise(function(_0x10a07e,_0x2c9a22){var _0x142a8b=sox[_0xea42('0x1e')](_0x92d8b8,_0x29ae92,{'sampleRate':0x1f40,'format':_0xea42('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x142a8b['on'](_0xea42('0x13'),function(_0x4d674c){logger[_0xea42('0x13')](_0xea42('0x20'),_0x4d674c);_0x2c9a22(_0x4d674c);});_0x142a8b['on'](_0xea42('0x1d'),function(){logger['info'](_0xea42('0x21'));_0x10a07e();});_0x142a8b['start']();});}function base64Decode(_0x2b9c45,_0x59bb2b){var _0x3e1096=path[_0xea42('0x22')](__dirname,'tmp',rs[_0xea42('0x23')](0x4)+'.wav');fs[_0xea42('0x24')](_0x3e1096,_0x2b9c45,_0xea42('0x25'));return convertFile(_0x3e1096,_0x59bb2b)[_0xea42('0x26')](function(){try{fs['unlink'](_0x3e1096);fs[_0xea42('0x27')](_0x59bb2b,'777');}catch(_0x28ed93){logger[_0xea42('0x13')](_0x28ed93);}return _0x59bb2b[_0xea42('0x28')]('.')[0x0];});}function base64Encode(_0x46c41d){var _0x3bf39a=fs[_0xea42('0x29')](_0x46c41d);return new Buffer(_0x3bf39a)[_0xea42('0x2a')](_0xea42('0x25'));}exports[_0xea42('0x2b')]=function(_0x29162f,_0x10919e,_0x403990,_0x3aa54e,_0x3e34ee,_0x5f1d79){var _0xbe0153,_0x347ff4;var _0x38db4d=_0xea42('0x2c');var _0xdbcd53=_0xea42('0x2d')+_0x29162f;var _0x47b787={};if(_0x10919e===_0xea42('0x2e')){_0x47b787[_0xea42('0x2f')]={'ssml':_0x403990};}else{_0x47b787[_0xea42('0x2f')]={'text':_0x403990};};_0x47b787[_0xea42('0x30')]={'languageCode':_0x3aa54e,'ssmlGender':_0x3e34ee};_0x47b787[_0xea42('0x31')]={'audioEncoding':_0xea42('0x32'),'sampleRateHertz':0x1f40};var _0x20875e={'url':_0x38db4d+'text:synthesize'+_0xdbcd53,'method':_0xea42('0x33'),'json':!![],'body':_0x47b787};return rp(_0x20875e)[_0xea42('0x26')](function(_0x58b034){return new BPromise(function(_0x2d9989,_0x3d79f9){_0xbe0153=path[_0xea42('0x22')](__dirname,'tmp',rs[_0xea42('0x23')](0x4)+'.mp3');var _0x301a1f=Buffer[_0xea42('0x34')](_0x58b034[_0xea42('0x35')],'base64');return fs[_0xea42('0x36')](_0xbe0153,_0x301a1f,function(_0x30f126){_0x3d79f9(_0x30f126);},function(_0x5bfead){fs[_0xea42('0x27')](_0xbe0153,_0xea42('0x37'));_0x2d9989(_0x5bfead);});});})['then'](function(_0x5e407c){_0x347ff4=path[_0xea42('0x22')](__dirname,_0xea42('0x38'),rs['generate'](0x4)+'.wav');return convertFile(_0xbe0153,_0x347ff4);})[_0xea42('0x26')](function(){try{fs[_0xea42('0x1a')](_0xbe0153);fs[_0xea42('0x27')](_0x347ff4,'777');}catch(_0x226535){logger[_0xea42('0x13')](_0x226535);}logger['info'](_0xea42('0x39'),_0x347ff4['split']('.')[0x0]);return _0x347ff4['split']('.')[0x0];});};exports[_0xea42('0x3a')]=function(_0x22b9f3,_0x321ca0){var _0x405dab=_0xea42('0x3b');var _0x37e7dd,_0x2e0920;var _0x1e5491;var _0x16ed46={'encoding':_0xea42('0x3c'),'method':_0xea42('0x33'),'timeout':0x2710,'url':_0x405dab,'headers':{'Content-Type':_0xea42('0x3d')},'body':'f.req='+encodeURIComponent(JSON[_0xea42('0x3e')]([[['jQ1olc',JSON['stringify']([_0x22b9f3,_0x321ca0||'en',![],_0xea42('0x3f')]),null,'generic']]]))};return rp(_0x16ed46)[_0xea42('0x26')](function(_0x4d20f7){try{_0x1e5491=eval(_0x4d20f7[_0xea42('0x40')](0x5))[0x0][0x2];}catch(_0x9e3bf6){throw new Error('parse\x20response\x20failed:\x0a'+_0x4d20f7[_0xea42('0x41')]);}if(!_0x1e5491){if(_0x22b9f3[_0xea42('0x42')]>0xc8){throw new Error(_0xea42('0x43'));}else{throw new Error(_0xea42('0x44')+_0x321ca0+_0xea42('0x45'));}}try{_0x1e5491=eval(_0x1e5491)[0x0];}catch(_0x6bab1c){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x2ea68a=_0x1e5491;_0x37e7dd=path[_0xea42('0x22')](__dirname,_0xea42('0x38'),rs[_0xea42('0x23')](0x4)+_0xea42('0x46'));fs[_0xea42('0x24')](_0x37e7dd,_0x1e5491,{'encoding':_0xea42('0x25')});_0x2e0920=path[_0xea42('0x22')](__dirname,'tmp',rs[_0xea42('0x23')](0x4)+_0xea42('0x47'));return convertFile(_0x37e7dd,_0x2e0920);})[_0xea42('0x26')](function(){try{fs[_0xea42('0x1a')](_0x37e7dd);fs[_0xea42('0x27')](_0x2e0920,_0xea42('0x37'));}catch(_0x51cd7c){logger[_0xea42('0x13')](_0x51cd7c);}logger[_0xea42('0x48')](_0xea42('0x49'),_0x2e0920[_0xea42('0x28')]('.')[0x0]);return _0x2e0920[_0xea42('0x28')]('.')[0x0];});};exports['googleASR']=function(_0x5a3791,_0x3208e7,_0x32bfa5){return google[_0xea42('0x4a')](_0x5a3791,_0x3208e7,_0x32bfa5)[_0xea42('0x26')](function(_0x1fb891){logger[_0xea42('0x48')](_0x1fb891['uri']);return rp(_0x1fb891);})[_0xea42('0x26')](function(_0x597961){var _0x176266='';var _0x129495=0x0;try{fs[_0xea42('0x1a')](_0x5a3791);}catch(_0x514607){logger[_0xea42('0x13')](_0x514607);}if(_0x597961&&_0x597961[_0xea42('0x4b')]){_0x176266=_0x597961[_0xea42('0x4b')]['map'](function(_0x1f715e){return _0x1f715e&&_0x1f715e[_0xea42('0x4c')][0x0]&&_0x1f715e[_0xea42('0x4c')][0x0][_0xea42('0x4d')]?_0x1f715e['alternatives'][0x0][_0xea42('0x4d')]:'';})['join']('\x0a');_0x129495=_0x597961['results'][_0xea42('0x4e')](function(_0x2cc626){return _0x2cc626&&_0x2cc626[_0xea42('0x4c')][0x0]&&_0x2cc626[_0xea42('0x4c')][0x0][_0xea42('0x4f')]?_0x2cc626[_0xea42('0x4c')][0x0][_0xea42('0x4f')]:0x0;})['join']('\x0a');}logger[_0xea42('0x48')](_0xea42('0x50'),_0x176266);logger['info'](_0xea42('0x51'),_0x129495);return{'transcript':_0x176266,'confidence':_0x129495};})[_0xea42('0x52')](function(_0x170a23){logger[_0xea42('0x13')]('[%s]\x20%s:%s',_0x170a23[_0xea42('0x12')],_0x170a23[_0xea42('0x53')],_0x170a23[_0xea42('0x54')]);});};exports[_0xea42('0x55')]=function(_0x1b399d,_0x399b06,_0x834c33,_0x140398){var _0x6531e2=apiai(_0x399b06,{'language':_0x140398||'en'});return _0x6531e2['textRequest'](_0x834c33,{'sessionId':md5(_0x1b399d)})[_0xea42('0x26')](function(_0x1ccf87){logger[_0xea42('0x48')](JSON[_0xea42('0x3e')](_0x1ccf87));return{'source':_0x1ccf87[_0xea42('0x56')][_0xea42('0x57')],'resolvedQuery':_0x1ccf87['result'][_0xea42('0x58')],'action':_0x1ccf87[_0xea42('0x56')][_0xea42('0x59')],'actionIncomplete':_0x1ccf87[_0xea42('0x56')][_0xea42('0x5a')],'speech':_0x1ccf87[_0xea42('0x56')][_0xea42('0x5b')][_0xea42('0x5c')],'score':_0x1ccf87['result']['score'],'statusCode':_0x1ccf87[_0xea42('0x5d')][_0xea42('0x5e')],'endConversation':_0x1ccf87['result'][_0xea42('0x5f')][_0xea42('0x60')]||![],'isFallbackIntent':_0x1ccf87['result']['metadata'][_0xea42('0x61')]};});};exports[_0xea42('0x62')]=function(_0x2ac9cf,_0x55ccb0,_0x223b93,_0x38c968,_0x46edf5,_0x591d3f){var _0x47ed0b=_0x38c968[_0xea42('0x63')](/\\n/g,'\x0a');var _0xfb72ae={'credentials':{'private_key':_0x47ed0b,'client_email':_0x223b93}};var _0x4dc582=new dialogflow[(_0xea42('0x64'))](_0xfb72ae);var _0x4a0066=_0x4dc582[_0xea42('0x65')](_0x55ccb0,md5(_0x2ac9cf));var _0x18c8bc={'session':_0x4a0066,'queryInput':{'text':{'text':_0x46edf5,'languageCode':_0x591d3f}}};return _0x4dc582[_0xea42('0x66')](_0x18c8bc)['then'](function(_0x2b25b2){if(_0x2b25b2&&_0x2b25b2[_0xea42('0x42')]){logger['info'](_0xea42('0x67'),JSON[_0xea42('0x3e')](_0x2b25b2));var _0x5a4503=_0x2b25b2[0x0];if(_0x5a4503){var _0x347f4c={'action':_0x5a4503['queryResult'][_0xea42('0x59')],'allRequiredParamsPresent':_0x5a4503[_0xea42('0x68')]['allRequiredParamsPresent'],'endConversation':_0x5a4503[_0xea42('0x68')]['diagnosticInfo']&&_0x5a4503['queryResult'][_0xea42('0x69')][_0xea42('0x6a')]?_0x5a4503['queryResult'][_0xea42('0x69')][_0xea42('0x6a')][_0xea42('0x6b')]['boolValue']:![],'fulfillmentText':_0x5a4503[_0xea42('0x68')][_0xea42('0x6c')],'intentName':_0x5a4503[_0xea42('0x68')][_0xea42('0x6d')][_0xea42('0x53')],'intentDisplayName':_0x5a4503[_0xea42('0x68')][_0xea42('0x6d')][_0xea42('0x6e')],'isFallbackIntent':_0x5a4503[_0xea42('0x68')][_0xea42('0x6d')][_0xea42('0x6f')],'languageCode':_0x5a4503[_0xea42('0x68')][_0xea42('0x70')],'queryText':_0x5a4503[_0xea42('0x68')][_0xea42('0x71')],'responseId':_0x5a4503[_0xea42('0x72')],'score':_0x5a4503[_0xea42('0x68')][_0xea42('0x73')],'speech':_0x5a4503[_0xea42('0x68')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x2b25b2)};return _0x347f4c;}}});};exports[_0xea42('0x74')]=function(_0x549964,_0x3d58c3,_0x24dc97,_0x11fe44){return tilde[_0xea42('0x4a')](_0x549964,_0x3d58c3,_0x24dc97,_0x11fe44)['then'](function(_0x4f009d){try{fs['unlink'](_0x549964);}catch(_0x5c6154){logger[_0xea42('0x13')](_0x5c6154);}logger[_0xea42('0x48')](_0xea42('0x75'),_0x4f009d[_0xea42('0x4d')]);logger['info']('Tilde\x20ASR\x20confidence',_0x4f009d[_0xea42('0x4f')]);return _0x4f009d;});};exports[_0xea42('0x76')]=function(_0x986899,_0x450826,_0x3375b0,_0x4c8d72,_0x5a5893,_0x3bd7e9){var _0x3557a9=path['resolve'](__dirname,_0xea42('0x38'),rs[_0xea42('0x23')](0x4)+'.mp3');var _0x5b1927;return aws[_0xea42('0x77')](_0x986899,_0x450826,_0x3375b0,_0x4c8d72,_0x5a5893,_0x3bd7e9,_0x3557a9)[_0xea42('0x26')](function(){_0x5b1927=path[_0xea42('0x22')](__dirname,_0xea42('0x38'),rs[_0xea42('0x23')](0x4)+_0xea42('0x47'));return convertFile(_0x3557a9,_0x5b1927);})[_0xea42('0x26')](function(){try{fs[_0xea42('0x1a')](_0x3557a9);fs[_0xea42('0x27')](_0x5b1927,'777');}catch(_0x716b33){logger[_0xea42('0x13')](_0x716b33);}return _0x5b1927[_0xea42('0x28')]('.')[0x0];});};exports[_0xea42('0x78')]=function(_0x466884,_0x2a7b6e,_0x44923c,_0x5ce256,_0x30e855,_0x16986c){return aws[_0xea42('0x79')](_0x466884,_0x2a7b6e,_0x44923c,_0x5ce256,_0x30e855,_0x16986c)['then'](function(_0x11e56e){logger['info'](JSON['stringify'](_0x11e56e));return _0x11e56e;});};exports[_0xea42('0x7a')]=function(_0x586a83,_0x107383,_0x53f222,_0xf237a6){var _0x1e2ff9=util[_0xea42('0x7b')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x586a83,encodeURIComponent(_0x107383),_0x53f222,_0xf237a6);var _0x1b52bd=path['resolve'](__dirname,_0xea42('0x38'),rs[_0xea42('0x23')](0x4)+_0xea42('0x46'));var _0x309238;return downloadFile(_0x1e2ff9,_0x1b52bd)[_0xea42('0x26')](function(){_0x309238=path[_0xea42('0x22')](__dirname,_0xea42('0x38'),rs[_0xea42('0x23')](0x4)+_0xea42('0x47'));return convertFile(_0x1b52bd,_0x309238);})[_0xea42('0x26')](function(){try{fs[_0xea42('0x1a')](_0x1b52bd);fs[_0xea42('0x27')](_0x309238,_0xea42('0x37'));}catch(_0x183d7e){logger[_0xea42('0x13')](_0x183d7e);}return _0x309238[_0xea42('0x28')]('.')[0x0];});};exports[_0xea42('0x7c')]=function(_0x45b768,_0xa0fb9c,_0x501f61,_0x133ad5){var _0x4af266=util[_0xea42('0x7b')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0xa0fb9c,_0x501f61,base64Encode(_0x45b768),_0x133ad5?util[_0xea42('0x7b')](_0xea42('0x7d'),encodeURIComponent(_0x133ad5)):_0xea42('0x7e'));return uploadFile(_0x4af266)['then'](function(_0x326339){return querystring[_0xea42('0x7f')](_0x326339);});};exports['sestekNDA']=function(_0x115dcf,_0x203b24){return sestek[_0xea42('0x80')](_0x115dcf,_0x203b24)[_0xea42('0x26')](function(_0xfea9f2){logger[_0xea42('0x48')](JSON[_0xea42('0x3e')](_0xfea9f2));var _0x36dc54={'speech':_0xfea9f2[_0xea42('0x81')],'action':_0xfea9f2['channelData']?_0xfea9f2['channelData']['CustomAction']:undefined,'actiondata':_0xfea9f2[_0xea42('0x82')]?_0xfea9f2[_0xea42('0x82')][_0xea42('0x83')]:undefined};if(_0xfea9f2[_0xea42('0x82')]&&_0xfea9f2['channelData'][_0xea42('0x84')]){return base64Decode(_0xfea9f2[_0xea42('0x82')][_0xea42('0x84')][_0xea42('0x85')],path[_0xea42('0x22')](__dirname,_0xea42('0x38'),rs[_0xea42('0x23')](0x4)+'.wav'))[_0xea42('0x26')](function(_0x30b390){_0x36dc54[_0xea42('0x86')]=_0x30b390;return _0x36dc54;});}return _0x36dc54;});};exports[_0xea42('0x87')]=function(){return __dirname;}; \ No newline at end of file +var _0x2932=['result','resolvedQuery','action','actionIncomplete','fulfillment','score','metadata','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','data','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','777','then','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','join','confidence','googleASR\x20transcription','[%s]\x20%s:%s','message','googleDialogflow','textRequest','source'];(function(_0x5b1beb,_0x543c6c){var _0x426f05=function(_0x117daa){while(--_0x117daa){_0x5b1beb['push'](_0x5b1beb['shift']());}};_0x426f05(++_0x543c6c);}(_0x2932,0x1c7));var _0x2293=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0x2932[_0x8af54b];return _0x27d8f0;};'use strict';var apiai=require(_0x2293('0x0'));var BPromise=require(_0x2293('0x1'));var dialogflow=require(_0x2293('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x2293('0x3'));var md5=require(_0x2293('0x4'));var path=require(_0x2293('0x5'));var querystring=require('querystring');var rp=require(_0x2293('0x6'));var rs=require(_0x2293('0x7'));var sox=require(_0x2293('0x8'));var tts=require(_0x2293('0x9'));var urlParse=require(_0x2293('0xa'))[_0x2293('0xb')];var util=require(_0x2293('0xc'));var aws=require(_0x2293('0xd'));var google=require(_0x2293('0xe'));var sestek=require(_0x2293('0xf'));var tilde=require(_0x2293('0x10'));var logger=require(_0x2293('0x11'))(_0x2293('0x12'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x346c44,_0x1e2f2){return new BPromise(function(_0x193c01,_0x434ff5){var _0x220600=urlParse(_0x346c44);var _0xc68d11=_0x220600[_0x2293('0x13')]==='https:'?https:http;var _0x4c8c45={'host':_0x220600['host'],'path':_0x220600['path'],'headers':{'user-agent':_0x2293('0x14')}};_0xc68d11[_0x2293('0x15')](_0x4c8c45,function(_0xc315f9){if(_0xc315f9[_0x2293('0x16')]!==0xc8){logger[_0x2293('0x17')](_0x2293('0x18')+_0x346c44+_0x2293('0x19')+_0xc315f9[_0x2293('0x16')]+'\x20('+_0xc315f9[_0x2293('0x1a')]+')');_0x434ff5(new Error('request\x20to\x20'+_0x346c44+_0x2293('0x19')+_0xc315f9[_0x2293('0x16')]+'\x20('+_0xc315f9[_0x2293('0x1a')]+')'));return;}var _0x372829=fs[_0x2293('0x1b')](_0x1e2f2);_0x372829['on'](_0x2293('0x1c'),function(){logger['info'](_0x2293('0x1d'));_0x372829[_0x2293('0x1e')](_0x193c01);});_0x372829['on'](_0x2293('0x17'),function(_0x3bcdf3){fs[_0x2293('0x1f')](_0x1e2f2);logger[_0x2293('0x17')](_0x2293('0x20'),_0x3bcdf3);_0x434ff5(_0x3bcdf3);});_0xc315f9[_0x2293('0x21')](_0x372829);})['on'](_0x2293('0x17'),function(_0x5c1995){logger[_0x2293('0x17')](_0x5c1995);_0x434ff5(_0x5c1995);})[_0x2293('0x22')]();});}function uploadFile(_0x45d346){return new BPromise(function(_0x53f607,_0x242204){var _0x24ad40=urlParse(_0x45d346);var _0x486b01=_0x24ad40['protocol']===_0x2293('0x23')?https:http;var _0x1990ca={'host':_0x24ad40['host'],'path':_0x24ad40[_0x2293('0x5')],'headers':{'user-agent':_0x2293('0x14')}};_0x486b01[_0x2293('0x15')](_0x1990ca,function(_0x1af7c5){if(_0x1af7c5[_0x2293('0x16')]!==0xc8){_0x242204(new Error('request\x20to\x20'+_0x45d346+_0x2293('0x19')+_0x1af7c5[_0x2293('0x16')]+'\x20('+_0x1af7c5[_0x2293('0x1a')]+')'));return;}var _0x23a3d2='';_0x1af7c5['on'](_0x2293('0x24'),function(_0x539b0d){_0x23a3d2+=_0x539b0d;});_0x1af7c5['on'](_0x2293('0x22'),function(){_0x53f607(_0x23a3d2);});})['on']('error',function(_0x1f7dac){_0x242204(_0x1f7dac);})[_0x2293('0x22')]();});}function convertFile(_0x420bd1,_0x549c56){return new BPromise(function(_0x513454,_0x23beb9){var _0x40a9c2=sox['transcode'](_0x420bd1,_0x549c56,{'sampleRate':0x1f40,'format':_0x2293('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x40a9c2['on'](_0x2293('0x17'),function(_0xaa741f){logger['error'](_0x2293('0x26'),_0xaa741f);_0x23beb9(_0xaa741f);});_0x40a9c2['on'](_0x2293('0x22'),function(){logger[_0x2293('0x27')](_0x2293('0x28'));_0x513454();});_0x40a9c2[_0x2293('0x29')]();});}function base64Decode(_0x5f2aa1,_0x1f2bc){var _0x4aca53=path[_0x2293('0x2a')](__dirname,_0x2293('0x2b'),rs[_0x2293('0x2c')](0x4)+_0x2293('0x2d'));fs['writeFileSync'](_0x4aca53,_0x5f2aa1,_0x2293('0x2e'));return convertFile(_0x4aca53,_0x1f2bc)['then'](function(){try{fs[_0x2293('0x1f')](_0x4aca53);fs[_0x2293('0x2f')](_0x1f2bc,'777');}catch(_0x5134e9){logger[_0x2293('0x17')](_0x5134e9);}return _0x1f2bc[_0x2293('0x30')]('.')[0x0];});}function base64Encode(_0x242ba4){var _0x294ce2=fs[_0x2293('0x31')](_0x242ba4);return new Buffer(_0x294ce2)[_0x2293('0x32')](_0x2293('0x2e'));}exports[_0x2293('0x33')]=function(_0x4c59f8,_0x52e6a0,_0x4cf451,_0x391fa9,_0x5d847b,_0x1ce968){var _0x27b468,_0x395a57;var _0x3c35c0=_0x2293('0x34');var _0x2f9c6a=_0x2293('0x35')+_0x4c59f8;var _0x14f4bf={};if(_0x52e6a0==='ssml'){_0x14f4bf[_0x2293('0x36')]={'ssml':_0x4cf451};}else{_0x14f4bf[_0x2293('0x36')]={'text':_0x4cf451};};_0x14f4bf['voice']={'languageCode':_0x391fa9,'ssmlGender':_0x5d847b};_0x14f4bf[_0x2293('0x37')]={'audioEncoding':_0x2293('0x38'),'sampleRateHertz':0x1f40};var _0x296125={'url':_0x3c35c0+_0x2293('0x39')+_0x2f9c6a,'method':_0x2293('0x3a'),'json':!![],'body':_0x14f4bf};return rp(_0x296125)['then'](function(_0xbc1271){return new BPromise(function(_0x3dd761,_0x4be061){_0x27b468=path['resolve'](__dirname,'tmp',rs[_0x2293('0x2c')](0x4)+_0x2293('0x3b'));var _0x326c68=Buffer[_0x2293('0x3c')](_0xbc1271[_0x2293('0x3d')],_0x2293('0x2e'));return fs[_0x2293('0x3e')](_0x27b468,_0x326c68,function(_0x176789){_0x4be061(_0x176789);},function(_0x4a31b8){fs[_0x2293('0x2f')](_0x27b468,_0x2293('0x3f'));_0x3dd761(_0x4a31b8);});});})[_0x2293('0x40')](function(_0x52a99a){_0x395a57=path[_0x2293('0x2a')](__dirname,_0x2293('0x2b'),rs[_0x2293('0x2c')](0x4)+_0x2293('0x2d'));return convertFile(_0x27b468,_0x395a57);})['then'](function(){try{fs[_0x2293('0x1f')](_0x27b468);fs[_0x2293('0x2f')](_0x395a57,'777');}catch(_0x1d5abc){logger[_0x2293('0x17')](_0x1d5abc);}logger[_0x2293('0x27')]('googleCloudTTS\x20path',_0x395a57[_0x2293('0x30')]('.')[0x0]);return _0x395a57[_0x2293('0x30')]('.')[0x0];});};exports[_0x2293('0x41')]=function(_0x275877,_0x204dd0){var _0x51e30a=_0x2293('0x42');var _0x4858a7,_0x47d4ce;var _0x407b68;var _0x256769={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x51e30a,'headers':{'Content-Type':_0x2293('0x43')},'body':'f.req='+encodeURIComponent(JSON[_0x2293('0x44')]([[[_0x2293('0x45'),JSON[_0x2293('0x44')]([_0x275877,_0x204dd0||'en',![],'null']),null,_0x2293('0x46')]]]))};return rp(_0x256769)[_0x2293('0x40')](function(_0x30624e){try{_0x407b68=eval(_0x30624e[_0x2293('0x47')](0x5))[0x0][0x2];}catch(_0x494219){throw new Error(_0x2293('0x48')+_0x30624e[_0x2293('0x24')]);}if(!_0x407b68){if(_0x275877['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x204dd0+_0x2293('0x49'));}}try{_0x407b68=eval(_0x407b68)[0x0];}catch(_0x4ef768){throw new Error(_0x2293('0x48')+res[_0x2293('0x24')]);}const _0x5e6183=_0x407b68;_0x4858a7=path[_0x2293('0x2a')](__dirname,'tmp',rs[_0x2293('0x2c')](0x4)+_0x2293('0x3b'));fs[_0x2293('0x4a')](_0x4858a7,_0x407b68,{'encoding':_0x2293('0x2e')});_0x47d4ce=path[_0x2293('0x2a')](__dirname,_0x2293('0x2b'),rs['generate'](0x4)+_0x2293('0x2d'));return convertFile(_0x4858a7,_0x47d4ce);})[_0x2293('0x40')](function(){try{fs[_0x2293('0x1f')](_0x4858a7);fs['chmodSync'](_0x47d4ce,_0x2293('0x3f'));}catch(_0xdf7ddf){logger[_0x2293('0x17')](_0xdf7ddf);}logger['info'](_0x2293('0x4b'),_0x47d4ce[_0x2293('0x30')]('.')[0x0]);return _0x47d4ce[_0x2293('0x30')]('.')[0x0];});};exports[_0x2293('0x4c')]=function(_0x47f1ad,_0x2ad6a8,_0x56c986){return google[_0x2293('0x4d')](_0x47f1ad,_0x2ad6a8,_0x56c986)[_0x2293('0x40')](function(_0x556d75){logger[_0x2293('0x27')](_0x556d75[_0x2293('0x4e')]);return rp(_0x556d75);})[_0x2293('0x40')](function(_0x590c07){var _0x2f7b8c='';var _0x389701=0x0;try{fs[_0x2293('0x1f')](_0x47f1ad);}catch(_0x2d3f4d){logger[_0x2293('0x17')](_0x2d3f4d);}if(_0x590c07&&_0x590c07[_0x2293('0x4f')]){_0x2f7b8c=_0x590c07['results']['map'](function(_0x1d7e39){return _0x1d7e39&&_0x1d7e39[_0x2293('0x50')][0x0]&&_0x1d7e39[_0x2293('0x50')][0x0]['transcript']?_0x1d7e39['alternatives'][0x0]['transcript']:'';})[_0x2293('0x51')]('\x0a');_0x389701=_0x590c07[_0x2293('0x4f')]['map'](function(_0x18f78f){return _0x18f78f&&_0x18f78f[_0x2293('0x50')][0x0]&&_0x18f78f[_0x2293('0x50')][0x0][_0x2293('0x52')]?_0x18f78f[_0x2293('0x50')][0x0]['confidence']:0x0;})[_0x2293('0x51')]('\x0a');}logger[_0x2293('0x27')](_0x2293('0x53'),_0x2f7b8c);logger[_0x2293('0x27')]('googleASR\x20confidence',_0x389701);return{'transcript':_0x2f7b8c,'confidence':_0x389701};})['catch'](function(_0x100343){logger[_0x2293('0x17')](_0x2293('0x54'),_0x100343[_0x2293('0x16')],_0x100343['name'],_0x100343[_0x2293('0x55')]);});};exports[_0x2293('0x56')]=function(_0x42fb86,_0x36e7a5,_0x1c5972,_0x2277c5){var _0x4464bf=apiai(_0x36e7a5,{'language':_0x2277c5||'en'});return _0x4464bf[_0x2293('0x57')](_0x1c5972,{'sessionId':md5(_0x42fb86)})[_0x2293('0x40')](function(_0x44e6ed){logger['info'](JSON[_0x2293('0x44')](_0x44e6ed));return{'source':_0x44e6ed['result'][_0x2293('0x58')],'resolvedQuery':_0x44e6ed[_0x2293('0x59')][_0x2293('0x5a')],'action':_0x44e6ed[_0x2293('0x59')][_0x2293('0x5b')],'actionIncomplete':_0x44e6ed['result'][_0x2293('0x5c')],'speech':_0x44e6ed[_0x2293('0x59')][_0x2293('0x5d')]['speech'],'score':_0x44e6ed[_0x2293('0x59')][_0x2293('0x5e')],'statusCode':_0x44e6ed['status']['code'],'endConversation':_0x44e6ed[_0x2293('0x59')][_0x2293('0x5f')][_0x2293('0x60')]||![],'isFallbackIntent':_0x44e6ed['result'][_0x2293('0x5f')][_0x2293('0x61')]};});};exports['googleDialogflowV2']=function(_0x4daef7,_0x2a1f1e,_0x8cd2fb,_0x29d2c8,_0x4649d1,_0x24fcbb){var _0x135a5b=_0x29d2c8[_0x2293('0x62')](/\\n/g,'\x0a');var _0x3e27ea={'credentials':{'private_key':_0x135a5b,'client_email':_0x8cd2fb}};var _0x298773=new dialogflow[(_0x2293('0x63'))](_0x3e27ea);var _0xa5b080=_0x298773[_0x2293('0x64')](_0x2a1f1e,md5(_0x4daef7));var _0x2e54e4={'session':_0xa5b080,'queryInput':{'text':{'text':_0x4649d1,'languageCode':_0x24fcbb}}};return _0x298773[_0x2293('0x65')](_0x2e54e4)[_0x2293('0x40')](function(_0x129893){if(_0x129893&&_0x129893[_0x2293('0x66')]){logger[_0x2293('0x27')](_0x2293('0x67'),JSON[_0x2293('0x44')](_0x129893));var _0x48c6c2=_0x129893[0x0];if(_0x48c6c2){var _0xc826ca={'action':_0x48c6c2[_0x2293('0x68')][_0x2293('0x5b')],'allRequiredParamsPresent':_0x48c6c2[_0x2293('0x68')][_0x2293('0x69')],'endConversation':_0x48c6c2['queryResult'][_0x2293('0x6a')]&&_0x48c6c2[_0x2293('0x68')][_0x2293('0x6a')][_0x2293('0x6b')]?_0x48c6c2[_0x2293('0x68')]['diagnosticInfo'][_0x2293('0x6b')][_0x2293('0x6c')][_0x2293('0x6d')]:![],'fulfillmentText':_0x48c6c2['queryResult'][_0x2293('0x6e')],'intentName':_0x48c6c2[_0x2293('0x68')][_0x2293('0x6f')][_0x2293('0x70')],'intentDisplayName':_0x48c6c2['queryResult']['intent'][_0x2293('0x71')],'isFallbackIntent':_0x48c6c2[_0x2293('0x68')][_0x2293('0x6f')]['isFallback'],'languageCode':_0x48c6c2['queryResult'][_0x2293('0x72')],'queryText':_0x48c6c2['queryResult'][_0x2293('0x73')],'responseId':_0x48c6c2['responseId'],'score':_0x48c6c2[_0x2293('0x68')][_0x2293('0x74')],'speech':_0x48c6c2[_0x2293('0x68')]['fulfillmentText'],'providerResponse':JSON[_0x2293('0x44')](_0x129893)};return _0xc826ca;}}});};exports[_0x2293('0x75')]=function(_0x252bda,_0x4f29fb,_0x131171,_0x1f48ad){return tilde[_0x2293('0x4d')](_0x252bda,_0x4f29fb,_0x131171,_0x1f48ad)[_0x2293('0x40')](function(_0x5aa44f){try{fs[_0x2293('0x1f')](_0x252bda);}catch(_0xdd914e){logger[_0x2293('0x17')](_0xdd914e);}logger[_0x2293('0x27')](_0x2293('0x76'),_0x5aa44f[_0x2293('0x77')]);logger[_0x2293('0x27')](_0x2293('0x78'),_0x5aa44f[_0x2293('0x52')]);return _0x5aa44f;});};exports[_0x2293('0x79')]=function(_0x42c536,_0x5131c9,_0x14f3bb,_0x2062c9,_0x179bd6,_0x360d96){var _0x217731=path['resolve'](__dirname,_0x2293('0x2b'),rs[_0x2293('0x2c')](0x4)+_0x2293('0x3b'));var _0x151d09;return aws[_0x2293('0x7a')](_0x42c536,_0x5131c9,_0x14f3bb,_0x2062c9,_0x179bd6,_0x360d96,_0x217731)['then'](function(){_0x151d09=path[_0x2293('0x2a')](__dirname,'tmp',rs['generate'](0x4)+_0x2293('0x2d'));return convertFile(_0x217731,_0x151d09);})[_0x2293('0x40')](function(){try{fs[_0x2293('0x1f')](_0x217731);fs['chmodSync'](_0x151d09,_0x2293('0x3f'));}catch(_0x562927){logger[_0x2293('0x17')](_0x562927);}return _0x151d09['split']('.')[0x0];});};exports[_0x2293('0x7b')]=function(_0x11422a,_0x394778,_0x3b22ab,_0x480f50,_0x1d9f5b,_0x3e1e17){return aws['lex'](_0x11422a,_0x394778,_0x3b22ab,_0x480f50,_0x1d9f5b,_0x3e1e17)[_0x2293('0x40')](function(_0x2a3b2b){logger[_0x2293('0x27')](JSON[_0x2293('0x44')](_0x2a3b2b));return _0x2a3b2b;});};exports['ispeechTTS']=function(_0x5e453d,_0x389dad,_0x364e38,_0xe99f31){var _0x164a2e=util[_0x2293('0x7c')](_0x2293('0x7d'),ISPEECH_API,_0x5e453d,encodeURIComponent(_0x389dad),_0x364e38,_0xe99f31);var _0x1d1ac9=path[_0x2293('0x2a')](__dirname,_0x2293('0x2b'),rs[_0x2293('0x2c')](0x4)+'.mp3');var _0x56a020;return downloadFile(_0x164a2e,_0x1d1ac9)[_0x2293('0x40')](function(){_0x56a020=path[_0x2293('0x2a')](__dirname,_0x2293('0x2b'),rs['generate'](0x4)+_0x2293('0x2d'));return convertFile(_0x1d1ac9,_0x56a020);})['then'](function(){try{fs[_0x2293('0x1f')](_0x1d1ac9);fs[_0x2293('0x2f')](_0x56a020,_0x2293('0x3f'));}catch(_0x393b4a){logger[_0x2293('0x17')](_0x393b4a);}return _0x56a020[_0x2293('0x30')]('.')[0x0];});};exports[_0x2293('0x7e')]=function(_0x431530,_0x582c5f,_0x2fe968,_0x41d1b5){var _0x56db20=util[_0x2293('0x7c')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x582c5f,_0x2fe968,base64Encode(_0x431530),_0x41d1b5?util['format']('model=%s',encodeURIComponent(_0x41d1b5)):_0x2293('0x7f'));return uploadFile(_0x56db20)[_0x2293('0x40')](function(_0x5972c9){return querystring[_0x2293('0xb')](_0x5972c9);});};exports[_0x2293('0x80')]=function(_0x2b158c,_0x576700){return sestek[_0x2293('0x81')](_0x2b158c,_0x576700)['then'](function(_0x383105){logger[_0x2293('0x27')](JSON[_0x2293('0x44')](_0x383105));var _0x37685d={'speech':_0x383105[_0x2293('0x82')],'action':_0x383105[_0x2293('0x83')]?_0x383105['channelData']['CustomAction']:undefined,'actiondata':_0x383105['channelData']?_0x383105[_0x2293('0x83')][_0x2293('0x84')]:undefined};if(_0x383105['channelData']&&_0x383105[_0x2293('0x83')][_0x2293('0x85')]){return base64Decode(_0x383105[_0x2293('0x83')][_0x2293('0x85')][_0x2293('0x86')],path['resolve'](__dirname,'tmp',rs[_0x2293('0x2c')](0x4)+_0x2293('0x2d')))[_0x2293('0x40')](function(_0x55cbcc){_0x37685d[_0x2293('0x87')]=_0x55cbcc;return _0x37685d;});}return _0x37685d;});};exports['dirName']=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 3451b30..a2a1bd3 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 _0x0d24=['exports','./nda'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x0d24,0x117));var _0x40d2=function(_0x4c8c56,_0x4c7efa){_0x4c8c56=_0x4c8c56-0x0;var _0x2ce54f=_0x0d24[_0x4c8c56];return _0x2ce54f;};var nda=require(_0x40d2('0x0'));module[_0x40d2('0x1')]={'nda':nda}; \ No newline at end of file +var _0xdbbd=['exports'];(function(_0x2a02e2,_0x2d03a0){var _0x3e6af8=function(_0x4b5af6){while(--_0x4b5af6){_0x2a02e2['push'](_0x2a02e2['shift']());}};_0x3e6af8(++_0x2d03a0);}(_0xdbbd,0x71));var _0xddbb=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xdbbd[_0x2fc012];return _0x2891f9;};var nda=require('./nda');module[_0xddbb('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 2460c1d..fba5adb 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 _0xb634=['calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid'];(function(_0x2a94fc,_0x5635ba){var _0xedd69f=function(_0x277831){while(--_0x277831){_0x2a94fc['push'](_0x2a94fc['shift']());}};_0xedd69f(++_0x5635ba);}(_0xb634,0x1c0));var _0x4b63=function(_0x54ea9b,_0xebfde1){_0x54ea9b=_0x54ea9b-0x0;var _0x4c0bc1=_0xb634[_0x54ea9b];return _0x4c0bc1;};'use strict';var rp=require(_0x4b63('0x0'));var url=require('url');var logger=require(_0x4b63('0x1'))(_0x4b63('0x2'));module[_0x4b63('0x3')]=function(_0x520fce,_0x4275a4){var _0x44edec={'method':_0x4b63('0x4'),'uri':url[_0x4b63('0x5')](_0x4275a4[_0x4b63('0x6')],_0x4b63('0x7')),'form':{'grant_type':'password','username':_0x4275a4['username'],'password':_0x4275a4[_0x4b63('0x8')]},'json':!![]};return rp(_0x44edec)['then'](function(_0x315fa5){var _0x4c8a30={'method':_0x4b63('0x4'),'uri':url[_0x4b63('0x5')](_0x4275a4['ndassistant_url'],_0x4b63('0x9')),'body':{'type':_0x4275a4[_0x4b63('0xa')]||_0x4b63('0xb'),'channelId':'Nda','conversation':{'id':_0x520fce[_0x4b63('0xc')]},'from':{'id':_0x520fce[_0x4b63('0xd')],'name':_0x520fce[_0x4b63('0xe')]},'recipient':{'id':_0x520fce[_0x4b63('0xf')],'name':_0x520fce[_0x4b63('0x10')]},'text':_0x4275a4[_0x4b63('0x11')],'channelData':{}},'headers':{'Authorization':_0x4b63('0x12')+_0x315fa5[_0x4b63('0x13')]},'json':!![]};if(_0x4275a4[_0x4b63('0x14')]){_0x4c8a30[_0x4b63('0x15')][_0x4b63('0x16')][_0x4b63('0x17')]=_0x4275a4['project'];}if(_0x4275a4[_0x4b63('0x18')]=='1'){_0x4c8a30[_0x4b63('0x15')][_0x4b63('0x16')][_0x4b63('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4b63('0x1a')};}if(_0x4275a4[_0x4b63('0x1b')]){_0x4c8a30[_0x4b63('0x15')]['channelData'][_0x4b63('0x1c')]=_0x4275a4['custom_action'];if(_0x4275a4[_0x4b63('0x1d')]){_0x4c8a30[_0x4b63('0x15')][_0x4b63('0x16')][_0x4b63('0x1e')]=_0x4275a4[_0x4b63('0x1d')];}}logger[_0x4b63('0x1f')](JSON[_0x4b63('0x20')](_0x4c8a30));return rp(_0x4c8a30);});}; \ No newline at end of file +var _0x3670=['Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','CustomActionData','custom_action_data','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','dnid','extension','text'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x3670,0x16c));var _0x0367=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3670[_0xa464c9];return _0x3d73c4;};'use strict';var rp=require('request-promise');var url=require(_0x0367('0x0'));var logger=require(_0x0367('0x1'))(_0x0367('0x2'));module[_0x0367('0x3')]=function(_0x3ea441,_0xfefd2b){var _0x183c1e={'method':'POST','uri':url[_0x0367('0x4')](_0xfefd2b[_0x0367('0x5')],_0x0367('0x6')),'form':{'grant_type':_0x0367('0x7'),'username':_0xfefd2b[_0x0367('0x8')],'password':_0xfefd2b[_0x0367('0x7')]},'json':!![]};return rp(_0x183c1e)[_0x0367('0x9')](function(_0x55f08e){var _0x298a55={'method':_0x0367('0xa'),'uri':url[_0x0367('0x4')](_0xfefd2b[_0x0367('0xb')],_0x0367('0xc')),'body':{'type':_0xfefd2b[_0x0367('0xd')]||_0x0367('0xe'),'channelId':_0x0367('0xf'),'conversation':{'id':_0x3ea441['uniqueid']},'from':{'id':_0x3ea441[_0x0367('0x10')],'name':_0x3ea441['calleridname']},'recipient':{'id':_0x3ea441[_0x0367('0x11')],'name':_0x3ea441[_0x0367('0x12')]},'text':_0xfefd2b[_0x0367('0x13')],'channelData':{}},'headers':{'Authorization':_0x0367('0x14')+_0x55f08e[_0x0367('0x15')]},'json':!![]};if(_0xfefd2b[_0x0367('0x16')]){_0x298a55[_0x0367('0x17')][_0x0367('0x18')]['ProjectName']=_0xfefd2b[_0x0367('0x16')];}if(_0xfefd2b[_0x0367('0x19')]=='1'){_0x298a55['body'][_0x0367('0x18')][_0x0367('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0367('0x1b')};}if(_0xfefd2b['custom_action']){_0x298a55[_0x0367('0x17')][_0x0367('0x18')][_0x0367('0x1c')]=_0xfefd2b[_0x0367('0x1d')];if(_0xfefd2b['custom_action_data']){_0x298a55['body'][_0x0367('0x18')][_0x0367('0x1e')]=_0xfefd2b[_0x0367('0x1f')];}}logger['info'](JSON['stringify'](_0x298a55));return rp(_0x298a55);});}; \ 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 bdc6678..c506037 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15cc=['exports','./lib/api'];(function(_0x286a2c,_0x587871){var _0x356e75=function(_0x26a4cc){while(--_0x26a4cc){_0x286a2c['push'](_0x286a2c['shift']());}};_0x356e75(++_0x587871);}(_0x15cc,0x175));var _0xc15c=function(_0x12f7d6,_0x4be9ad){_0x12f7d6=_0x12f7d6-0x0;var _0xcac6e5=_0x15cc[_0x12f7d6];return _0xcac6e5;};'use strict';var asr=require(_0xc15c('0x0'));module[_0xc15c('0x1')]=function(_0x2f0e8e,_0x384993,_0x296b7a,_0x1e81e9){return asr(_0x2f0e8e,_0x384993,_0x296b7a,_0x1e81e9);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x51b36f,_0x2eb1c2,_0x296d07,_0x23b1b6){return asr(_0x51b36f,_0x2eb1c2,_0x296d07,_0x23b1b6);}; \ 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 3c8999a..9126188 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 _0xdefc=['hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','lodash','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','digest','hex','unix','send','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','status','result','Tilde\x20ASR\x20hypoteses'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0xdefc,0x13f));var _0xcdef=function(_0x5cb4f0,_0xb16665){_0x5cb4f0=_0x5cb4f0-0x0;var _0x22208=_0xdefc[_0x5cb4f0];return _0x22208;};'use strict';var BPromise=require('bluebird');var _=require(_0xcdef('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xcdef('0x1'));var logger=require('../../../../../../config/logger')(_0xcdef('0x2'));module[_0xcdef('0x3')]=function(_0x33bddb,_0x22fef3,_0x342c18,_0x59eebd){return new BPromise(function(_0x2273e2,_0x2fe764){logger[_0xcdef('0x4')](_0xcdef('0x5'),_0x59eebd||_0xcdef('0x6'));var _0x1c4550=new WebSocket(_0x59eebd||_0xcdef('0x6'),{'perMessageDeflate':![]});var _0x4fe564='';var _0x37eb24='0';var _0x29f735='1';var _0x462851=_0xcdef('0x7');function _0x50d44d(_0x4a5835){var _0x56c0a7=crypto['createHash']('sha1');_0x56c0a7[_0xcdef('0x8')](_0x4a5835);return _0x56c0a7[_0xcdef('0x9')](_0xcdef('0xa'));}function _0xae5bcd(){try{logger[_0xcdef('0x4')]('Open\x20Tilde\x20ASR\x20socket');var _0x296359=moment()[_0xcdef('0xb')]();var _0x3246a3=_0x50d44d(_0x296359+_0x22fef3+_0x342c18);_0x1c4550[_0xcdef('0xc')](JSON['stringify']({'appID':_0x22fef3,'timestamp':_0x296359,'appKey':_0x3246a3}));var _0x5398aa=fs[_0xcdef('0xd')](_0x33bddb);_0x5398aa['on'](_0xcdef('0xe'),function(_0x1663c2){_0x1c4550['send'](_0x1663c2);});_0x5398aa['on']('close',function(){_0x1c4550[_0xcdef('0xc')](_0xcdef('0xf'));});}catch(_0x2c6425){logger[_0xcdef('0x10')](_0xcdef('0x11'),JSON[_0xcdef('0x12')](_0x2c6425));_0x1c4550[_0xcdef('0x13')]();}}function _0x2f50cd(_0x422eda){try{if(_0x422eda){var _0x52adb0=JSON['parse'](_0x422eda);switch(_0x52adb0[_0xcdef('0x14')]){case 0x0:if(_0x52adb0[_0xcdef('0x15')]){if(_0x52adb0[_0xcdef('0x15')]['final']){logger[_0xcdef('0x4')](_0xcdef('0x16'),JSON[_0xcdef('0x12')](_0x52adb0[_0xcdef('0x15')][_0xcdef('0x17')]));_0x4fe564=_0x52adb0[_0xcdef('0x15')][_0xcdef('0x17')][0x0][_0xcdef('0x18')];_0x37eb24=_0x52adb0[_0xcdef('0x15')][_0xcdef('0x17')][0x0][_0xcdef('0x19')];_0x29f735='0';_0x462851=_0xcdef('0x1a');_0x1c4550[_0xcdef('0x13')]();}}break;case 0x1:logger[_0xcdef('0x4')](_0xcdef('0x7'));_0x29f735='1';_0x462851=_0xcdef('0x7');break;case 0x2:logger[_0xcdef('0x4')](_0xcdef('0x1b'));_0x29f735='2';_0x462851=_0xcdef('0x1b');break;case 0x9:logger[_0xcdef('0x4')](_0xcdef('0x1c'));_0x29f735='9';_0x462851=_0xcdef('0x1c');break;case 0xa:logger[_0xcdef('0x4')](_0xcdef('0x1d'));_0x29f735='10';_0x462851='Authentication\x20failed.';break;case 0xb:logger[_0xcdef('0x4')](_0xcdef('0x1e'));_0x29f735='11';_0x462851='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x3fe091){logger[_0xcdef('0x10')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x3fe091));_0x1c4550[_0xcdef('0x13')]();}}function _0xa74217(){logger[_0xcdef('0x4')](_0xcdef('0x1f'));_0x2273e2({'transcript':_0x4fe564,'confidence':_0x37eb24,'status':_0x29f735,'status_message':_0x462851});}function _0x16d510(_0x2c7dfe){logger['error'](_0xcdef('0x20'));if(!_[_0xcdef('0x21')](_0x2c7dfe)){logger[_0xcdef('0x10')](_[_0xcdef('0x22')](_0x2c7dfe)?JSON['stringify'](_0x2c7dfe):_0x2c7dfe);}}_0x1c4550['on'](_0xcdef('0x23'),_0xae5bcd);_0x1c4550['on'](_0xcdef('0x24'),_0x2f50cd);_0x1c4550['on'](_0xcdef('0x25'),_0xa74217);_0x1c4550['on']('error',_0x16d510);});}; \ No newline at end of file +var _0xe074=['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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','close','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','stringify','hypotheses','likelihood'];(function(_0x5855b0,_0x4eaa56){var _0x3aab15=function(_0x304e5f){while(--_0x304e5f){_0x5855b0['push'](_0x5855b0['shift']());}};_0x3aab15(++_0x4eaa56);}(_0xe074,0xc8));var _0x4e07=function(_0x347dbf,_0x2b4a01){_0x347dbf=_0x347dbf-0x0;var _0x244b18=_0xe074[_0x347dbf];return _0x244b18;};'use strict';var BPromise=require(_0x4e07('0x0'));var _=require(_0x4e07('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x4e07('0x2'));var crypto=require(_0x4e07('0x3'));var logger=require(_0x4e07('0x4'))('agi');module['exports']=function(_0x53381d,_0x34650c,_0x531fd4,_0x3d7178){return new BPromise(function(_0x5b026e,_0x27b350){logger[_0x4e07('0x5')]('Tilde\x20URI',_0x3d7178||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x120470=new WebSocket(_0x3d7178||_0x4e07('0x6'),{'perMessageDeflate':![]});var _0x26f499='';var _0x16280f='0';var _0x1a29cf='1';var _0x45aab6=_0x4e07('0x7');function _0x564a13(_0x50d4e8){var _0x11c614=crypto['createHash'](_0x4e07('0x8'));_0x11c614[_0x4e07('0x9')](_0x50d4e8);return _0x11c614[_0x4e07('0xa')](_0x4e07('0xb'));}function _0x47771d(){try{logger[_0x4e07('0x5')](_0x4e07('0xc'));var _0x3e9523=moment()[_0x4e07('0xd')]();var _0x247676=_0x564a13(_0x3e9523+_0x34650c+_0x531fd4);_0x120470[_0x4e07('0xe')](JSON['stringify']({'appID':_0x34650c,'timestamp':_0x3e9523,'appKey':_0x247676}));var _0x4fa937=fs[_0x4e07('0xf')](_0x53381d);_0x4fa937['on']('data',function(_0xc0c6dd){_0x120470[_0x4e07('0xe')](_0xc0c6dd);});_0x4fa937['on'](_0x4e07('0x10'),function(){_0x120470['send'](_0x4e07('0x11'));});}catch(_0x4fca3d){logger[_0x4e07('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x4fca3d));_0x120470[_0x4e07('0x13')]();}}function _0xec9d9(_0x144683){try{if(_0x144683){var _0x44ba14=JSON[_0x4e07('0x14')](_0x144683);switch(_0x44ba14[_0x4e07('0x15')]){case 0x0:if(_0x44ba14['result']){if(_0x44ba14[_0x4e07('0x16')][_0x4e07('0x17')]){logger[_0x4e07('0x5')](_0x4e07('0x18'),JSON[_0x4e07('0x19')](_0x44ba14[_0x4e07('0x16')][_0x4e07('0x1a')]));_0x26f499=_0x44ba14[_0x4e07('0x16')]['hypotheses'][0x0]['transcript'];_0x16280f=_0x44ba14[_0x4e07('0x16')]['hypotheses'][0x0][_0x4e07('0x1b')];_0x1a29cf='0';_0x45aab6=_0x4e07('0x1c');_0x120470[_0x4e07('0x13')]();}}break;case 0x1:logger[_0x4e07('0x5')](_0x4e07('0x7'));_0x1a29cf='1';_0x45aab6=_0x4e07('0x7');break;case 0x2:logger[_0x4e07('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x1a29cf='2';_0x45aab6=_0x4e07('0x1d');break;case 0x9:logger[_0x4e07('0x5')](_0x4e07('0x1e'));_0x1a29cf='9';_0x45aab6=_0x4e07('0x1e');break;case 0xa:logger['info'](_0x4e07('0x1f'));_0x1a29cf='10';_0x45aab6=_0x4e07('0x1f');break;case 0xb:logger['info'](_0x4e07('0x20'));_0x1a29cf='11';_0x45aab6='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x3f501c){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0x4e07('0x19')](_0x3f501c));_0x120470['terminate']();}}function _0x3120ae(){logger['info'](_0x4e07('0x21'));_0x5b026e({'transcript':_0x26f499,'confidence':_0x16280f,'status':_0x1a29cf,'status_message':_0x45aab6});}function _0x588e6a(_0x282765){logger[_0x4e07('0x12')](_0x4e07('0x22'));if(!_[_0x4e07('0x23')](_0x282765)){logger['error'](_[_0x4e07('0x24')](_0x282765)?JSON[_0x4e07('0x19')](_0x282765):_0x282765);}}_0x120470['on']('open',_0x47771d);_0x120470['on'](_0x4e07('0x25'),_0xec9d9);_0x120470['on']('close',_0x3120ae);_0x120470['on'](_0x4e07('0x12'),_0x588e6a);});}; \ 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 a9f9ec8..206f96e 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 _0xe98b=['./asr'];(function(_0x18d265,_0x53cd9f){var _0x2f9e83=function(_0x4dc899){while(--_0x4dc899){_0x18d265['push'](_0x18d265['shift']());}};_0x2f9e83(++_0x53cd9f);}(_0xe98b,0x6f));var _0xbe98=function(_0x4169fa,_0x683ccf){_0x4169fa=_0x4169fa-0x0;var _0x204d0c=_0xe98b[_0x4169fa];return _0x204d0c;};var asr=require(_0xbe98('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x48cb=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48cb,0x98));var _0xb48c=function(_0x1af71a,_0x1d18ee){_0x1af71a=_0x1af71a-0x0;var _0x3acd6a=_0x48cb[_0x1af71a];return _0x3acd6a;};var asr=require('./asr');module[_0xb48c('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 8efd92b..e0f9f60 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 _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(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 +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(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'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 7bb0b5a..1834a00 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 _0x2c54=['aws_text_type','aws_lex_region','googleASR','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','length','saveRestApiResult','%s.%s','isArray','split','replaceAll','extra','getAndSetVariable','result','setVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','minutes','createCmContact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','createSquareMessage','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','dialogflowV2_language','no\x20anguage\x20configured','bot','providerResponse','out','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','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','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','awsLex','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','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','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','output','pause','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','macro','gosub','QUEUE','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','replace','sayNumber','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendMailMessage','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','getSquareProject','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','join','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment/shared','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','getIntervals','getIntervalById','interval','map','format','getQueryOdbc','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','dnid','file','uniqueid','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agentPause','agent','error','agentUnpause','agentLogout','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','render','headers','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','key','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c54,0x136));var _0x42c5=function(_0x524ae5,_0x390c06){_0x524ae5=_0x524ae5-0x0;var _0x4d3065=_0x2c54[_0x524ae5];return _0x4d3065;};'use strict';var fs=require('fs');var util=require(_0x42c5('0x0'));var _=require(_0x42c5('0x1'));var sh=require(_0x42c5('0x2'));var odbc=require('odbc')();var rs=require(_0x42c5('0x3'));var moment=require(_0x42c5('0x4'));var Mustache=require(_0x42c5('0x5'));var rp=require(_0x42c5('0x6'));var logger=require(_0x42c5('0x7'))(_0x42c5('0x8'));var config=require('../../config/environment');var shared=require(_0x42c5('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x42c5('0xa'),_0x42c5('0xb')];var verticesWithRetry=[_0x42c5('0xc'),_0x42c5('0xd'),_0x42c5('0xe')];var AGIVertices=function(_0x4ce554,_0x21d563,_0x3ca4de){this[_0x42c5('0xf')]=_0x4ce554;this[_0x42c5('0x10')]=_0x21d563;this[_0x42c5('0x11')]=_0x3ca4de;};AGIVertices[_0x42c5('0x12')][_0x42c5('0x13')]=function(_0x2390c7,_0x2b0167){this[_0x42c5('0x10')][_0x42c5('0x14')](_0x2390c7)[_0x42c5('0x15')](function(_0xb5c314){_0x2b0167(null,_0xb5c314?_0xb5c314[_0x42c5('0x16')]:![]);})[_0x42c5('0x17')](function(_0x391716){_0x2b0167(_0x391716);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x1b1db5,_0xc17623){this[_0x42c5('0x10')][_0x42c5('0x18')](_0x1b1db5)['then'](function(_0x374218){_0xc17623(null,_0x374218?_0x374218[_0x42c5('0x16')]:![]);})[_0x42c5('0x17')](function(_0x4efb1a){_0xc17623(_0x4efb1a);});};AGIVertices[_0x42c5('0x12')]['getSquareProject']=function(_0x48d227,_0x466b47){this['rpc']['getSquareProjectById'](_0x48d227)[_0x42c5('0x15')](function(_0x3a2115){_0x466b47(null,_0x3a2115?_0x3a2115[_0x42c5('0x16')]:![]);})[_0x42c5('0x17')](function(_0x431f4e){_0x466b47(_0x431f4e);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x19')]=function(_0x34f31b,_0x29ca68){this[_0x42c5('0x10')][_0x42c5('0x1a')](_0x34f31b)[_0x42c5('0x15')](function(_0x11c6e8){_0x29ca68(null,_0x11c6e8?_0x11c6e8[_0x42c5('0x1b')]:![]);})['catch'](function(_0x102294){_0x29ca68(_0x102294);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1c')]=function(_0x56fc64,_0x245e72){this[_0x42c5('0x10')]['getUserById'](_0x56fc64)[_0x42c5('0x15')](function(_0xd577c8){_0x245e72(null,_0xd577c8?_0xd577c8[_0x42c5('0x16')]:![]);})[_0x42c5('0x17')](function(_0x119580){_0x245e72(_0x119580);});};AGIVertices[_0x42c5('0x12')]['getTrunk']=function(_0x2d319d,_0x5b61e4){this[_0x42c5('0x10')][_0x42c5('0x1d')](_0x2d319d)['then'](function(_0x44040a){_0x5b61e4(null,_0x44040a?_0x44040a['name']:![]);})[_0x42c5('0x17')](function(_0x45e9bf){_0x5b61e4(_0x45e9bf);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1e')]=function(_0x2cb126,_0x4431ff){var _0x4d852b=this;this[_0x42c5('0x10')]['getSoundById'](_0x2cb126)[_0x42c5('0x15')](function(_0x2daef6){_0x4431ff(null,_0x2daef6?_0x4d852b[_0x42c5('0x1f')](_0x2daef6[_0x42c5('0x20')]):![]);})['catch'](function(_0x5a3cd8){_0x4431ff(_0x5a3cd8);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x21')]=function(_0x55e7dd,_0x13daf0){this['rpc'][_0x42c5('0x22')](_0x55e7dd)['then'](function(_0x246575){_0x13daf0(null,_0x246575?_0x246575:![]);})[_0x42c5('0x17')](function(_0x8ca711){_0x13daf0(_0x8ca711);});};AGIVertices['prototype']['sendMailMessage']=function(_0x35ab1b,_0x449b36,_0x393321){this[_0x42c5('0x11')]['sendMailMessage'](_0x35ab1b,_0x449b36)['then'](function(){_0x393321(null);})[_0x42c5('0x17')](function(_0x389b1b){_0x393321(_0x389b1b);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x23')]=function(_0x401e62,_0x5b8e8e){this[_0x42c5('0x10')][_0x42c5('0x24')](_0x401e62)['then'](function(_0x3c1b0b){if(_0x3c1b0b){if(_0x3c1b0b['IntervalId']){_0x5b8e8e(null,[_0x3c1b0b[_0x42c5('0x25')]]);}else{_0x5b8e8e(null,_[_0x42c5('0x26')](_0x3c1b0b['Intervals'],'interval'));}}else{_0x5b8e8e(null,![]);}})['catch'](function(_0x541291){_0x5b8e8e(_0x541291);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1f')]=function(_0x10006e){return util[_0x42c5('0x27')]('%s/sounds/converted/%s',FILES_PATH,_0x10006e);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x28')]=function(_0x416198,_0x3d0146,_0x481202){odbc['open'](_0x416198,function(_0x2c4c8d){if(_0x2c4c8d){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x2c4c8d);_0x481202(_0x2c4c8d);}else{logger['info'](_0x42c5('0x29'));odbc[_0x42c5('0x2a')](_0x3d0146,function(_0x35e1e7,_0xd81e49){if(_0x35e1e7){logger[_0x42c5('0x2b')](_0x42c5('0x2c'),_0x3d0146);_0x481202(_0x35e1e7);}else{logger[_0x42c5('0x2b')](_0x42c5('0x2d'),_0x3d0146);odbc[_0x42c5('0x2e')](function(_0x43ebce){if(_0x43ebce){logger['error'](_0x42c5('0x2f'),_0x43ebce);}_0x481202(null,_0xd81e49);});}});}});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x30')]=function(_0x1a6d9b,_0x355e4a){this['rpc'][_0x42c5('0x31')](_0x1a6d9b)['then'](function(_0x9692f1){_0x355e4a(null,_0x9692f1?_0x9692f1:![]);})[_0x42c5('0x17')](function(_0x116cbf){_0x355e4a(_0x116cbf);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x32')]=function(_0x462409,_0x356835){this[_0x42c5('0x10')][_0x42c5('0x32')](_0x462409)[_0x42c5('0x15')](function(_0x41c586){_0x356835(null,_0x41c586);})[_0x42c5('0x17')](function(_0x1b5079){_0x356835(_0x1b5079);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x33')]=function(_0x341aee,_0x166f2b,_0x187437){this[_0x42c5('0x10')][_0x42c5('0x33')]({'uniqueid':this[_0x42c5('0xf')]['uniqueid'],'node':_0x341aee[_0x42c5('0x34')],'application':_0x341aee[_0x42c5('0x35')],'data':_0x166f2b||null,'project_name':this['channel'][_0x42c5('0x36')],'callerid':this[_0x42c5('0xf')]['callerid']})[_0x42c5('0x15')](function(_0x4298d8){if(_0x187437){_0x187437(null,_0x4298d8);}})[_0x42c5('0x17')](function(_0x2e7e89){if(_0x187437){_0x187437(_0x2e7e89);}});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x37')]=function(_0x548a2a,_0x575a7e,_0x548f85,_0x45c6ed){this[_0x42c5('0x10')][_0x42c5('0x37')]({'uniqueid':this[_0x42c5('0xf')]['uniqueid'],'callerid':this['channel'][_0x42c5('0x38')],'calleridname':this[_0x42c5('0xf')][_0x42c5('0x39')],'context':this[_0x42c5('0xf')][_0x42c5('0x3a')],'extension':this['channel'][_0x42c5('0x3b')],'priority':this[_0x42c5('0xf')][_0x42c5('0x3c')],'accountcode':this[_0x42c5('0xf')]['accountcode'],'dnid':this[_0x42c5('0xf')][_0x42c5('0x3d')],'projectName':this[_0x42c5('0xf')][_0x42c5('0x36')],'saveName':_0x575a7e,'filename':_0x548a2a[_0x42c5('0x3e')]||_0x575a7e,'savePath':_0x548f85})[_0x42c5('0x15')](function(_0x4079a8){_0x45c6ed(null,_0x4079a8);})[_0x42c5('0x17')](function(_0x40496c){_0x45c6ed(_0x40496c);});};AGIVertices[_0x42c5('0x12')]['createSquareMessage']=function(_0x1b9e51,_0x473723,_0x175323,_0x5176d7,_0x2fd384){this[_0x42c5('0x10')]['createSquareMessage']({'uniqueid':this[_0x42c5('0xf')][_0x42c5('0x3f')],'body':_0x1b9e51,'direction':_0x473723,'providerName':_0x175323,'providerResponse':_0x5176d7})[_0x42c5('0x15')](function(_0x447922){if(_0x2fd384){_0x2fd384(null,_0x447922);}})['catch'](function(_0x41752f){if(_0x2fd384){_0x2fd384(_0x41752f);}});};AGIVertices[_0x42c5('0x12')]['createCmContact']=function(_0x4d676a,_0x30faa5){this[_0x42c5('0x10')]['createCmContact']({'firstName':_['isEmpty'](_0x4d676a['name'])||_[_0x42c5('0x40')](_0x4d676a['name'])?_0x42c5('0x41')+Math[_0x42c5('0x42')]():_0x4d676a[_0x42c5('0x16')],'lastName':_[_0x42c5('0x43')](_0x4d676a[_0x42c5('0x44')])||_[_0x42c5('0x40')](_0x4d676a[_0x42c5('0x44')])?null:_0x4d676a[_0x42c5('0x44')],'phone':_0x4d676a[_0x42c5('0x45')],'ListId':_0x4d676a[_0x42c5('0x46')],'scheduledat':_0x4d676a[_0x42c5('0x47')],'callbackUniqueid':this[_0x42c5('0xf')][_0x42c5('0x3f')],'tags':_0x42c5('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x4d676a[_0x42c5('0x47')][_0x42c5('0x49')](),'priority':_0x4d676a[_0x42c5('0x4a')]})[_0x42c5('0x15')](function(_0x21f4e1){_0x30faa5(null,_0x21f4e1);})[_0x42c5('0x17')](function(_0x3b00ee){_0x30faa5(_0x3b00ee);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x4b')]=function(_0x5206b3,_0x35b179){this[_0x42c5('0x10')][_0x42c5('0x4c')](_0x5206b3)[_0x42c5('0x15')](function(_0x476281){_0x35b179(null,_0x476281?_0x476281['name']:![]);})[_0x42c5('0x17')](function(_0x3a7a3f){_0x35b179(_0x3a7a3f);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x4d')]=function(_0x477f30,_0x1ca3f0,_0x19fa8b){var _0x43167b={'role':_0x42c5('0x4e')};_0x43167b[_0x477f30]=this['channel'][_0x42c5('0x38')];this['rpc'][_0x42c5('0x4d')](_0x43167b,_0x1ca3f0,this['channel']['uniqueid'])[_0x42c5('0x15')](function(_0x5e0647){_0x19fa8b(null,_[_0x42c5('0x40')](_0x5e0647)?![]:!![]);})['catch'](function(_0x41a33e){logger[_0x42c5('0x4f')](_0x41a33e);_0x19fa8b(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x21173c,_0xed290){var _0x17e0c0={'role':_0x42c5('0x4e')};_0x17e0c0[_0x21173c]=this[_0x42c5('0xf')][_0x42c5('0x38')];this[_0x42c5('0x10')][_0x42c5('0x50')](_0x17e0c0)[_0x42c5('0x15')](function(_0x15d325){_0xed290(null,_['isNil'](_0x15d325)?![]:!![]);})[_0x42c5('0x17')](function(_0x19bb6f){logger[_0x42c5('0x4f')](_0x19bb6f);_0xed290(null,![]);});};AGIVertices[_0x42c5('0x12')]['agentLogout']=function(_0x2ce9ae,_0x3b6b6f){var _0x27dd64={'role':_0x42c5('0x4e')};_0x27dd64[_0x2ce9ae]=this[_0x42c5('0xf')][_0x42c5('0x38')];this[_0x42c5('0x10')][_0x42c5('0x51')](_0x27dd64)[_0x42c5('0x15')](function(_0xd17953){_0x3b6b6f(null,_[_0x42c5('0x40')](_0xd17953)?![]:!![]);})[_0x42c5('0x17')](function(_0x17a0d9){logger[_0x42c5('0x4f')](_0x17a0d9);_0x3b6b6f(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x41dc2d,_0x217db6){var _0x3973d7={'role':'agent'};_0x3973d7[_0x41dc2d]=this[_0x42c5('0xf')][_0x42c5('0x38')];var _0x23f7e2=_0x41dc2d!='internal'?util[_0x42c5('0x27')](_0x42c5('0x52'),'LOCAL',this[_0x42c5('0xf')]['callerid']):undefined;this[_0x42c5('0x10')]['agentLogin'](_0x3973d7,_0x23f7e2)[_0x42c5('0x15')](function(_0x25caa5){_0x217db6(null,_['isNil'](_0x25caa5)?![]:!![]);})['catch'](function(_0x1f2122){logger[_0x42c5('0x4f')](_0x1f2122);_0x217db6(null,![]);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x53')]=function(_0x38429e,_0x5df2c3){sh[_0x42c5('0x54')](_[_0x42c5('0x55')](_0x38429e),function(_0x19e20b,_0x370f0b){var _0x3877da=_0x370f0b['replace'](/(\r\n|\n|\r)/gm,'');_0x5df2c3(null,_0x3877da);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x4f3cc8,_0x322542){scripts[_0x42c5('0x56')](_0x4f3cc8[_0x42c5('0x57')],_0x4f3cc8[_0x42c5('0x58')]||_0x42c5('0x59'),_0x4f3cc8[_0x42c5('0x59')],_0x4f3cc8[_0x42c5('0x5a')]||_0x42c5('0x5b'),_0x4f3cc8['ssmlGender']||_0x42c5('0x5c'),_0x4f3cc8[_0x42c5('0x5d')]||_0x42c5('0x5e'))[_0x42c5('0x15')](function(_0x4c83ec){_0x322542(null,_0x4c83ec);})[_0x42c5('0x17')](function(_0x33a2d1){_0x322542(_0x33a2d1);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x5f')]=function(_0x340e7,_0x4b23a5){scripts[_0x42c5('0x5f')](_0x340e7['text'],_0x340e7[_0x42c5('0x60')]||'en',0x1)[_0x42c5('0x15')](function(_0x1406a5){_0x4b23a5(null,_0x1406a5);})[_0x42c5('0x17')](function(_0x4da8d8){_0x4b23a5(_0x4da8d8);});};AGIVertices['prototype'][_0x42c5('0x61')]=function(_0x540ff6,_0x515d05){var _0x5279c1={'uri':_0x540ff6[_0x42c5('0x62')],'method':_0x540ff6[_0x42c5('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x540ff6[_0x42c5('0x64')])===_0x42c5('0x65')&&parseInt(_0x540ff6[_0x42c5('0x64')])>=0x1?parseInt(_0x540ff6['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x42c5('0x66')]([_0x42c5('0x67'),_0x42c5('0x68')],_0x5279c1[_0x42c5('0x63')][_0x42c5('0x69')]())){try{_0x5279c1[_0x42c5('0x6a')]=_0x540ff6[_0x42c5('0xb')]?JSON['parse'](_0x540ff6[_0x42c5('0xb')]):{};}catch(_0x31ad28){logger[_0x42c5('0x4f')](_0x42c5('0x6b'),_0x31ad28);}}try{_0x5279c1['headers']=_0x540ff6['rawHeaders']?JSON['parse'](_0x540ff6[_0x42c5('0xa')]):{};}catch(_0x22cc8c){logger['error'](_0x42c5('0x6c'),_0x22cc8c);}if(_0x540ff6['computedVariables']){try{var _0x409225=require(_0x540ff6['computedVariables'])[_0x42c5('0x6d')](this,_0x5279c1);_0x5279c1[_0x42c5('0x6e')]=Mustache[_0x42c5('0x6f')](_0x540ff6[_0x42c5('0x62')],_0x409225,{},['$$','$$']);if(_0x5279c1['headers']){_0x5279c1[_0x42c5('0x70')]=JSON[_0x42c5('0x71')](Mustache[_0x42c5('0x6f')](JSON[_0x42c5('0x72')](_0x5279c1['headers']),_0x409225,{},['$$','$$']));}if(_0x5279c1[_0x42c5('0x6a')]){_0x5279c1['body']=JSON['parse'](Mustache[_0x42c5('0x6f')](JSON['stringify'](_0x5279c1[_0x42c5('0x6a')]),_0x409225,{},['$$','$$']));}}catch(_0xc9ff20){logger[_0x42c5('0x4f')](_0x42c5('0x73'),_0xc9ff20);}}rp(_0x5279c1)['then'](function(_0x221fc9){var _0x1fa9e4={'statusCode':_0x221fc9[_0x42c5('0x74')]||0xc8,'statusMessage':_0x221fc9[_0x42c5('0x75')]||'OK','headers':_0x221fc9['headers']||{},'body':_0x221fc9['body']||{}};_0x515d05(null,_0x1fa9e4);})[_0x42c5('0x17')](function(_0x1336ff){var _0xa18694={'statusCode':_0x1336ff[_0x42c5('0x74')]||0x1f4,'statusMessage':_0x1336ff[_0x42c5('0x76')]||_0x42c5('0x77'),'headers':_0x1336ff[_0x42c5('0x78')]['headers']||{},'body':_0x1336ff[_0x42c5('0x78')]['body']||{}};_0x515d05(null,_0xa18694);});};AGIVertices[_0x42c5('0x12')]['googleDialogflow']=function(_0x1afe8e,_0x31ca80){scripts[_0x42c5('0x79')](this[_0x42c5('0xf')]['uniqueid'],_0x1afe8e['key'],_0x1afe8e[_0x42c5('0x59')],_0x1afe8e[_0x42c5('0x7a')]||'en')[_0x42c5('0x15')](function(_0x510df7){_0x31ca80(null,_0x510df7);})[_0x42c5('0x17')](function(_0x476ef4){_0x31ca80(_0x476ef4);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x2c3b6e,_0x3cc7e4){scripts[_0x42c5('0x7b')](this[_0x42c5('0xf')]['uniqueid'],_0x2c3b6e[_0x42c5('0x7c')],_0x2c3b6e[_0x42c5('0x7d')],_0x2c3b6e[_0x42c5('0x7e')],_0x2c3b6e[_0x42c5('0x59')],_0x2c3b6e['dialogflowV2_language']||'en')[_0x42c5('0x15')](function(_0x82d849){_0x3cc7e4(null,_0x82d849);})['catch'](function(_0x5a9a09){_0x3cc7e4(_0x5a9a09);});};AGIVertices[_0x42c5('0x12')]['sestekNDA']=function(_0x59bbeb,_0x21427c){scripts[_0x42c5('0x7f')](this[_0x42c5('0xf')],_0x59bbeb)[_0x42c5('0x15')](function(_0x3b85ee){_0x21427c(null,_0x3b85ee);})['catch'](function(_0xdf607d){_0x21427c(_0xdf607d);});};AGIVertices[_0x42c5('0x12')]['ispeechTTS']=function(_0x42a340,_0x2551b5){scripts[_0x42c5('0x80')](_0x42a340['key'],_0x42a340[_0x42c5('0x59')],_0x42a340[_0x42c5('0x81')]||_0x42c5('0x5b'),_0x42a340['speed'])['then'](function(_0x200bdc){_0x2551b5(null,_0x200bdc);})[_0x42c5('0x17')](function(_0x4e704c){_0x2551b5(_0x4e704c);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x82')]=function(_0x11fcdc,_0x56f840,_0x5ea013){scripts['ispeechASR'](_0x56f840,_0x11fcdc[_0x42c5('0x83')],_0x11fcdc['ispeech_asr_language']||_0x42c5('0x5b'),this[_0x42c5('0x84')](_0x11fcdc[_0x42c5('0x85')])?_0x11fcdc[_0x42c5('0x85')]:undefined)['then'](function(_0x31ed24){_0x5ea013(null,_0x31ed24);})[_0x42c5('0x17')](function(_0x10fe57){_0x5ea013(_0x10fe57);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x86')]=function(_0x5899a8,_0x2cd563){scripts[_0x42c5('0x86')](_0x5899a8[_0x42c5('0x87')],_0x5899a8[_0x42c5('0x88')],_0x5899a8[_0x42c5('0x89')],_0x5899a8['aws_polly_voice']||_0x42c5('0x8a'),_0x5899a8[_0x42c5('0x59')],_0x5899a8[_0x42c5('0x8b')]||_0x42c5('0x59'))['then'](function(_0x1ab396){_0x2cd563(null,_0x1ab396);})['catch'](function(_0x36c762){_0x2cd563(_0x36c762);});};AGIVertices['prototype']['awsLex']=function(_0x4c7e88,_0x48176e){scripts['awsLex'](this[_0x42c5('0xf')]['uniqueid'],_0x4c7e88[_0x42c5('0x87')],_0x4c7e88[_0x42c5('0x88')],_0x4c7e88[_0x42c5('0x8c')],_0x4c7e88[_0x42c5('0x59')],_0x4c7e88['aws_bot_name'])[_0x42c5('0x15')](function(_0x4fef84){_0x48176e(null,_0x4fef84);})[_0x42c5('0x17')](function(_0x370744){_0x48176e(_0x370744);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x8d')]=function(_0x54ff6b,_0x300de7,_0x37767f){scripts['googleASR'](_0x300de7,_0x54ff6b[_0x42c5('0x83')],_0x54ff6b['google_asr_language']||_0x42c5('0x5b'))[_0x42c5('0x15')](function(_0x303969){_0x37767f(null,_0x303969);})[_0x42c5('0x17')](function(_0x36b7fb){_0x37767f(_0x36b7fb);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x8e')]=function(_0x409299,_0x1a88fb,_0x1c3478){scripts[_0x42c5('0x8e')](_0x1a88fb,_0x409299[_0x42c5('0x8f')],_0x409299[_0x42c5('0x90')],_0x409299[_0x42c5('0x6e')])[_0x42c5('0x15')](function(_0x427ca7){_0x1c3478(null,_0x427ca7);})[_0x42c5('0x17')](function(_0xef2dfd){_0x1c3478(_0xef2dfd);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x91')]=function(_0x4fda3e){var _0x81e997=_[_0x42c5('0x66')](verticesWithRetry,_0x4fda3e[_0x42c5('0x35')])?_0x4fda3e:_['clone'](_0x4fda3e);for(var _0x1349ae in _0x81e997){if(_0x81e997[_0x42c5('0x92')](_0x1349ae)){if(_0x81e997[_0x1349ae]&&_[_0x42c5('0x93')](_0x81e997[_0x1349ae])){if(_['includes'](recursiveMapAttributes,_0x1349ae)){_0x81e997[_0x1349ae]=this[_0x42c5('0x94')](_0x81e997[_0x1349ae]);}else{_0x81e997[_0x1349ae]=this[_0x42c5('0x95')](_0x81e997[_0x1349ae]);}}}}return _0x81e997;};AGIVertices[_0x42c5('0x12')]['recursiveNodeIndex']=function(_0x15e565){for(var _0x541e09 in _0x15e565){if(_0x15e565[_0x42c5('0x92')](_0x541e09)){if(_[_0x42c5('0x96')](_0x15e565[_0x541e09])){this[_0x42c5('0x97')](_0x15e565[_0x541e09]);}else if(_['isArray'](_0x15e565[_0x541e09])){for(var _0x5e7c81=0x0;_0x5e7c81<_0x15e565[_0x541e09][_0x42c5('0x98')];_0x5e7c81++){this[_0x42c5('0x97')](_0x15e565[_0x541e09][_0x5e7c81]);}}else if(_[_0x42c5('0x93')](_0x15e565[_0x541e09])){_0x15e565[_0x541e09]=this[_0x42c5('0x95')](_0x15e565[_0x541e09]);}}}};AGIVertices[_0x42c5('0x12')]['saveRestApiResult']=function(_0x3dce9e,_0x388c4a){for(var _0x1b128b in _0x3dce9e){if(_0x3dce9e[_0x42c5('0x92')](_0x1b128b)){if(_[_0x42c5('0x96')](_0x3dce9e[_0x1b128b])){if(!_[_0x42c5('0x43')](_0x3dce9e[_0x1b128b])){this[_0x42c5('0x99')](_0x3dce9e[_0x1b128b],util[_0x42c5('0x27')](_0x42c5('0x9a'),_0x388c4a,_0x1b128b));}}else if(_[_0x42c5('0x9b')](_0x3dce9e[_0x1b128b])){for(var _0x3cda12=0x0;_0x3cda12<_0x3dce9e[_0x1b128b][_0x42c5('0x98')];_0x3cda12++){this['saveRestApiResult'](_0x3dce9e[_0x1b128b][_0x3cda12],util[_0x42c5('0x27')](_0x42c5('0x9a'),_0x388c4a,_0x1b128b+'['+_0x3cda12+']'));}}else{if(!_[_0x42c5('0x40')](_0x3dce9e[_0x1b128b])){this[_0x42c5('0xf')]['setVariable'](util['format'](_0x42c5('0x9a'),_0x388c4a,_0x1b128b),_0x3dce9e[_0x1b128b]);}}}}};AGIVertices['prototype'][_0x42c5('0x94')]=function(_0x5dbe70){try{var _0x7951f1=JSON[_0x42c5('0x71')](_0x5dbe70);this['recursiveNodeIndex'](_0x7951f1);return JSON[_0x42c5('0x72')](_0x7951f1);}catch(_0x3b2835){return this[_0x42c5('0x95')](_0x5dbe70);}};AGIVertices[_0x42c5('0x12')][_0x42c5('0x95')]=function(_0x1a920d){var _0x1dcd1f=_0x1a920d[_0x42c5('0x9c')]('{');for(var _0xaf385e=0x1;_0xaf385e<_0x1dcd1f[_0x42c5('0x98')];_0xaf385e+=0x1){var _0x6a5d6e=_0x1dcd1f[_0xaf385e]['split']('}');if(_0x6a5d6e[_0x42c5('0x98')]>0x1){_0x1a920d=_0x1a920d[_0x42c5('0x9d')]('{'+_0x6a5d6e[0x0]+'}',this[_0x42c5('0xf')][_0x42c5('0x13')](_0x6a5d6e[0x0])[_0x42c5('0x9e')]||_0x6a5d6e[0x0]);}}if(_0x1dcd1f[_0x42c5('0x98')]===0x1){return _0x1a920d[_0x42c5('0x49')]();}return this[_0x42c5('0x95')](_0x1a920d);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x9f')]=function(_0x5c9d6c,_0x41e4b7){var _0x2e85bb=this[_0x42c5('0xf')][_0x42c5('0x13')](_0x5c9d6c);if(_0x2e85bb[_0x42c5('0xa0')]===-0x1){return _0x2e85bb;}logger[_0x42c5('0x2b')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x41e4b7,_0x2e85bb[_0x42c5('0x9e')]));return this['channel'][_0x42c5('0xa1')](_0x41e4b7,_0x2e85bb[_0x42c5('0x9e')]);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x84')]=function(_0x301664){return _0x301664&&_0x301664!=='0'&&_0x301664!=='-1'&&_0x301664!=='';};AGIVertices[_0x42c5('0x12')][_0x42c5('0xa2')]=function(_0x64d616){this['createSquareDetailsReport'][_0x42c5('0x6d')](this,_0x64d616,'-');_0x64d616[_0x42c5('0xa3')]=_0x64d616[_0x42c5('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x42c5('0xa4')]=function(_0x47fa36){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xa5'),_0x47fa36[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x47fa36[_0x42c5('0x59')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xa7'));}var _0x11c4e2='\x22'+_0x47fa36[_0x42c5('0x59')]+'\x22';if(this[_0x42c5('0x84')](_0x47fa36[_0x42c5('0x78')])){_0x11c4e2+=','+_0x47fa36[_0x42c5('0x78')];}var _0x1fa71e=this[_0x42c5('0xf')][_0x42c5('0x54')]('MRCPSynth',_0x11c4e2);if(_0x1fa71e['result']===-0x1){return _0x1fa71e;}return this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x11c4e2));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xa8')]=function(_0x4b4df2){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0xa9'),_0x4b4df2[_0x42c5('0x34')]));if(!this['isConfigured'](_0x4b4df2['grammar'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xaa'));}var _0x46bf1b=_0x4b4df2[_0x42c5('0xab')];if(this[_0x42c5('0x84')](_0x4b4df2[_0x42c5('0x78')])){_0x46bf1b+=','+_0x4b4df2[_0x42c5('0x78')];}var _0x55ecd7=this['channel'][_0x42c5('0x54')](_0x42c5('0xac'),_0x46bf1b);if(_0x55ecd7[_0x42c5('0xa0')]===-0x1){return _0x55ecd7;}var _0x10a2c2=this[_0x42c5('0x9f')](_0x42c5('0xad'),'MRCP_RECOG_CONFIDENCE');if(_0x10a2c2[_0x42c5('0xa0')]===-0x1){return _0x10a2c2;}var _0x3aa679=this[_0x42c5('0x9f')](_0x42c5('0xae'),_0x42c5('0xaf'));if(_0x3aa679[_0x42c5('0xa0')]===-0x1){return _0x3aa679;}var _0x3aab6d=this[_0x42c5('0x9f')]('RECOG_INSTANCE()',_0x42c5('0xb0'));if(_0x3aab6d['result']===-0x1){return _0x3aab6d;}return this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0xb1'),_0x46bf1b));};AGIVertices['prototype']['agi']=function(_0x10bdb5){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xb2'),_0x10bdb5['label']));return this[_0x42c5('0xf')]['agi']([_0x10bdb5['command'],_0x10bdb5[_0x42c5('0xb3')]]);};AGIVertices[_0x42c5('0x12')]['answer']=function(_0x2f22fa){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2f22fa[_0x42c5('0x34')]));if(this[_0x42c5('0x84')](_0x2f22fa['timeout'])){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xb4'),_0x2f22fa[_0x42c5('0x64')]));var _0x3a9b85=this['channel'][_0x42c5('0xb5')](_0x2f22fa[_0x42c5('0x64')]);if(_0x3a9b85[_0x42c5('0xa0')]===-0x1){return _0x3a9b85;}}return this[_0x42c5('0xf')][_0x42c5('0xb6')]();};AGIVertices[_0x42c5('0x12')]['callback']=function(_0x3086f8){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xb7'),_0x3086f8['label']));if(!this[_0x42c5('0x84')](_0x3086f8[_0x42c5('0x46')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3086f8,'no\x20list\x20selected');}_0x3086f8[_0x42c5('0x47')]=moment();if(this[_0x42c5('0x84')](_0x3086f8[_0x42c5('0xb8')])){_0x3086f8[_0x42c5('0x47')]=moment()['add'](_0x3086f8['delay'],_0x42c5('0xb9'));}if(!this[_0x42c5('0x84')](_0x3086f8[_0x42c5('0x4a')])){_0x3086f8['callback_priority']=0x2;}this[_0x42c5('0xba')][_0x42c5('0x6d')](this,_0x3086f8);return this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xbb'),_0x3086f8[_0x42c5('0x45')],_0x3086f8[_0x42c5('0x46')],_0x3086f8[_0x42c5('0x47')]));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xbc')]=function(_0x65fe4c){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xbd'),_0x65fe4c[_0x42c5('0x34')]));var _0x3fcd58=this[_0x42c5('0xf')]['exec'](_0x65fe4c['application'],_0x65fe4c['options']);if(_0x3fcd58[_0x42c5('0xa0')]===-0x1){return _0x3fcd58;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xbe'),_0x65fe4c[_0x42c5('0xbf')],_0x65fe4c[_0x42c5('0x78')]));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xc0')]=function(_0x21f894){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xc1'),_0x21f894[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x21f894[_0x42c5('0x59')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xa7'));}var _0x4f849f='\x22'+_0x21f894[_0x42c5('0x59')]+'\x22';if(this[_0x42c5('0x84')](_0x21f894['options'])){_0x4f849f+=','+_0x21f894['options'];}var _0x1237dc=this[_0x42c5('0xf')][_0x42c5('0x54')](_0x42c5('0xc2'),_0x4f849f);if(_0x1237dc[_0x42c5('0xa0')]===-0x1){return _0x1237dc;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xc3'),_0x4f849f));};AGIVertices[_0x42c5('0x12')]['sestektts']=function(_0x15e577){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x15e577[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x15e577[_0x42c5('0x59')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xa7'));}var _0x284b3e='\x22'+_0x15e577[_0x42c5('0x59')]+'\x22';if(this['isConfigured'](_0x15e577[_0x42c5('0x78')])){_0x284b3e+=','+_0x15e577[_0x42c5('0x78')];}var _0x1d6b63=this[_0x42c5('0xf')][_0x42c5('0x54')](_0x42c5('0xc2'),_0x284b3e);if(_0x1d6b63[_0x42c5('0xa0')]===-0x1){return _0x1d6b63;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x284b3e));};AGIVertices['prototype']['lumenvoxasr']=function(_0x29f479){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xc4'),_0x29f479[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x29f479[_0x42c5('0xab')])){return this[_0x42c5('0xf')]['noop'](_0x42c5('0xaa'));}var _0xb09743=_0x29f479[_0x42c5('0xab')];if(this[_0x42c5('0x84')](_0x29f479[_0x42c5('0x78')])){_0xb09743+=','+_0x29f479[_0x42c5('0x78')];}var _0x5aab70=this[_0x42c5('0xf')]['exec'](_0x42c5('0xac'),_0xb09743);if(_0x5aab70[_0x42c5('0xa0')]===-0x1){return _0x5aab70;}var _0x3e365a=this[_0x42c5('0x9f')]('RECOG_CONFIDENCE()',_0x42c5('0xc5'));if(_0x3e365a['result']===-0x1){return _0x3e365a;}var _0x5a043f=this[_0x42c5('0x9f')](_0x42c5('0xae'),_0x42c5('0xc6'));if(_0x5a043f[_0x42c5('0xa0')]===-0x1){return _0x5a043f;}var _0x2e202a=this[_0x42c5('0x9f')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x2e202a[_0x42c5('0xa0')]===-0x1){return _0x2e202a;}return this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0xb1'),_0xb09743));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xc7')]=function(_0x493029){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0xc8'),_0x493029['label']));if(!this[_0x42c5('0x84')](_0x493029[_0x42c5('0xab')])){return this['channel']['noop'](_0x42c5('0xaa'));}var _0x3f8195=_0x493029[_0x42c5('0xab')];if(this[_0x42c5('0x84')](_0x493029['options'])){_0x3f8195+=','+_0x493029[_0x42c5('0x78')];}var _0x150b1e=this[_0x42c5('0xf')][_0x42c5('0x54')]('MRCPRecog',_0x3f8195);if(_0x150b1e[_0x42c5('0xa0')]===-0x1){return _0x150b1e;}var _0x1b79b0=this[_0x42c5('0x9f')]('RECOG_CONFIDENCE()',_0x42c5('0xc9'));if(_0x1b79b0[_0x42c5('0xa0')]===-0x1){return _0x1b79b0;}var _0x5430f0=this[_0x42c5('0x9f')](_0x42c5('0xae'),_0x42c5('0xca'));if(_0x5430f0['result']===-0x1){return _0x5430f0;}var _0x243fab=this[_0x42c5('0x9f')](_0x42c5('0xcb'),_0x42c5('0xcc'));if(_0x243fab[_0x42c5('0xa0')]===-0x1){return _0x243fab;}return this['channel']['noop'](util[_0x42c5('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3f8195));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xcd')]=function(_0x1e077d){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xce'),_0x1e077d[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x1e077d[_0x42c5('0xcf')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x1e077d,_0x42c5('0xd0'));}var _0x15710b=this[_0x42c5('0x19')][_0x42c5('0x6d')](this,_0x1e077d[_0x42c5('0xcf')]);if(!_0x15710b){return this[_0x42c5('0xf')]['error'](_0x1e077d,_0x42c5('0xd1'));}if(!this[_0x42c5('0x84')](_0x1e077d[_0x42c5('0x2a')])){return this['channel'][_0x42c5('0x4f')](_0x1e077d,_0x42c5('0xd2'));}var _0xeacbb3=_0x1e077d[_0x42c5('0x2a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('query:\x20%s',_0xeacbb3));var _0x563a47=this[_0x42c5('0x28')][_0x42c5('0x6d')](this,_0x15710b,_0xeacbb3);this['createSquareDetailsReport'][_0x42c5('0x6d')](this,_0x1e077d,_0xeacbb3);if(!this[_0x42c5('0x84')](_0x1e077d[_0x42c5('0xd3')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xd4'));}var _0x3f5639=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x1e077d[_0x42c5('0xd3')]);if(!_0x3f5639){return this['channel'][_0x42c5('0x4f')](_0x1e077d,_0x42c5('0xd5'));}var _0x21b396=this;_0x563a47[_0x42c5('0xd6')](function(_0x2c7a2f,_0x4e21a6){Object['keys'](_0x2c7a2f)['forEach'](function(_0x1f29b8){_0x21b396[_0x42c5('0xf')][_0x42c5('0xa1')](util[_0x42c5('0x27')]('%s[%s][%s]',_0x3f5639,_0x4e21a6,_0x1f29b8),_0x2c7a2f[_0x1f29b8]);});});this[_0x42c5('0xf')][_0x42c5('0xa1')](util[_0x42c5('0x27')](_0x42c5('0xd7'),_0x3f5639),_0x563a47[_0x42c5('0x98')]);return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xd8'),_0x3f5639));};AGIVertices['prototype'][_0x42c5('0xd9')]=function(_0x3a92c8){logger['debug'](util[_0x42c5('0x27')](_0x42c5('0xda'),_0x3a92c8[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x3a92c8[_0x42c5('0xdb')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3a92c8,'no\x20user\x20selected');}var _0x394de2=this[_0x42c5('0x1c')][_0x42c5('0x6d')](this,_0x3a92c8['sip_id']);if(!_0x394de2){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3a92c8,_0x42c5('0xdc'));}var _0x584c8a=this['channel'][_0x42c5('0x54')]('DIAL',[util[_0x42c5('0x27')](_0x42c5('0xdd'),_0x394de2),_0x3a92c8[_0x42c5('0x64')],_0x3a92c8[_0x42c5('0xde')],_0x3a92c8[_0x42c5('0x62')]]);if(_0x584c8a[_0x42c5('0xa0')]===-0x1){return _0x584c8a;}return this['channel'][_0x42c5('0xa6')](util['format'](_0x42c5('0xdf'),_0x42c5('0xe0')));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xe1')]=function(_0x5af68e){logger['info'](util[_0x42c5('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x5af68e['label']));if(!this['isConfigured'](_0x5af68e['key'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')]('no\x20key\x20configured');}if(!this[_0x42c5('0x84')](_0x5af68e[_0x42c5('0x59')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x42c5('0x33')](_0x5af68e);this[_0x42c5('0xe2')](_0x5af68e[_0x42c5('0x59')],'in','','');this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xe3'),_0x5af68e['text']));var _0x3aa43c=this[_0x42c5('0x79')][_0x42c5('0x6d')](this,_0x5af68e);if(_0x3aa43c){for(var _0x2d6a61 in _0x3aa43c){if(_0x3aa43c['hasOwnProperty'](_0x2d6a61)){this['channel'][_0x42c5('0xa1')](util[_0x42c5('0x27')](_0x42c5('0xe4'),_0x2d6a61[_0x42c5('0x69')]()),_0x3aa43c[_0x2d6a61]);}}this[_0x42c5('0xe2')](_0x3aa43c['speech'],'out','dialogflow','');return this[_0x42c5('0xf')][_0x42c5('0xa6')](util['format'](_0x42c5('0xe5'),_0x3aa43c[_0x42c5('0xe6')]));}return this['channel'][_0x42c5('0x4f')](_0x5af68e,_0x42c5('0xe7'));};AGIVertices['prototype'][_0x42c5('0xe8')]=function(_0x993cee){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xe9'),_0x993cee[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x993cee[_0x42c5('0x7c')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x993cee[_0x42c5('0x7d')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xea'));}if(!this[_0x42c5('0x84')](_0x993cee[_0x42c5('0x7e')])){return this[_0x42c5('0xf')]['noop']('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x993cee[_0x42c5('0xeb')])){return this[_0x42c5('0xf')]['noop'](_0x42c5('0xec'));}if(!this[_0x42c5('0x84')](_0x993cee['text'])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xa7'));}this[_0x42c5('0xf')][_0x42c5('0xed')]=!![];this[_0x42c5('0x33')](_0x993cee);this[_0x42c5('0xe2')](_0x993cee['text'],'in','','');this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('Trying\x20DialogflowV2:\x20%s',_0x993cee[_0x42c5('0x59')]));var _0xff0a6b=this[_0x42c5('0x7b')]['sync'](this,_0x993cee);if(_0xff0a6b){for(var _0x4b854a in _0xff0a6b){if(_0xff0a6b[_0x42c5('0x92')](_0x4b854a)){if(_0x4b854a!==_0x42c5('0xee')){this[_0x42c5('0xf')]['setVariable'](util[_0x42c5('0x27')]('DIALOGFLOW_%s',_0x4b854a[_0x42c5('0x69')]()),_0xff0a6b[_0x4b854a]);}}}this[_0x42c5('0xe2')](_0xff0a6b['speech'],_0x42c5('0xef'),_0x42c5('0xe8'),_0xff0a6b['providerResponse']);return this['channel'][_0x42c5('0xa6')](util['format']('DialogflowV2\x20Result\x20%s',_0xff0a6b['speech']));}return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x993cee,_0x42c5('0xf0'));};AGIVertices['prototype'][_0x42c5('0xf1')]=function(_0x4181b2){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0xf2'),_0x4181b2[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x4181b2['ndauth_url'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xf3'));}if(!this[_0x42c5('0x84')](_0x4181b2['username'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xf4'));}if(!this[_0x42c5('0x84')](_0x4181b2['password'])){return this[_0x42c5('0xf')]['noop']('no\x20password\x20configured');}if(!this[_0x42c5('0x84')](_0x4181b2[_0x42c5('0xf5')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xa7'));}this[_0x42c5('0xf')]['bot']=!![];this['createSquareDetailsReport'](_0x4181b2);this[_0x42c5('0xe2')](_0x4181b2[_0x42c5('0x59')],'in','','');this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xf6'),_0x4181b2['text']));var _0xbdccd0=this['sestekNDA'][_0x42c5('0x6d')](this,_0x4181b2);if(_0xbdccd0){for(var _0x281bd8 in _0xbdccd0){if(_0xbdccd0[_0x42c5('0x92')](_0x281bd8)){this[_0x42c5('0xf')][_0x42c5('0xa1')](util[_0x42c5('0x27')](_0x42c5('0xf7'),_0x281bd8[_0x42c5('0x69')]()),_0xbdccd0[_0x281bd8]);}}this[_0x42c5('0xe2')](_0xbdccd0[_0x42c5('0xe6')],_0x42c5('0xef'),_0x42c5('0xf1'),'');if(_0xbdccd0[_0x42c5('0xf8')]){this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('Sestek\x20NDA\x20%s\x20file\x20created',_0xbdccd0[_0x42c5('0xf8')]));var _0x294f75=this[_0x42c5('0xf')][_0x42c5('0xf9')](_0xbdccd0['audiofile']);try{fs[_0x42c5('0xfa')](_0xbdccd0[_0x42c5('0xf8')]+_0x42c5('0xfb'));}catch(_0x1a35aa){logger[_0x42c5('0x4f')](_0x1a35aa);}return _0x294f75;}else{return this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0xfc'),_0xbdccd0[_0x42c5('0xe6')]));}}return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x4181b2,_0x42c5('0xfd'));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xfe')]=function(_0x200317){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0xff'),_0x200317['label']));return this['channel'][_0x42c5('0xa6')](_0x42c5('0xfe'));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x100')]=function(_0x400d14){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x101'),_0x400d14[_0x42c5('0x34')]));var _0x479b72='';if(_0x400d14[_0x42c5('0x102')]){if(!this[_0x42c5('0x84')](_0x400d14[_0x42c5('0x102')])){return this['channel'][_0x42c5('0x4f')](_0x400d14,_0x42c5('0x103'));}else{var _0x17c5f6=parseInt(_0x400d14[_0x42c5('0x102')],0xa);if(isNaN(_0x17c5f6)){_0x479b72=_0x400d14[_0x42c5('0x102')];}else{_0x479b72=this[_0x42c5('0x104')][_0x42c5('0x6d')](this,_0x400d14[_0x42c5('0x102')]);if(!_0x479b72){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x400d14,_0x42c5('0x105'));}}}}else if(_0x400d14[_0x42c5('0x106')]){_0x479b72=_0x400d14[_0x42c5('0x106')];}else{return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x400d14,_0x42c5('0x103'));}var _0x3fe881=this['channel'][_0x42c5('0x54')](_0x42c5('0xe0'),[util[_0x42c5('0x27')](_0x42c5('0x107'),_0x479b72,_0x400d14['phone']),_0x400d14['timeout'],_0x400d14[_0x42c5('0xde')],_0x400d14['url']]);if(_0x3fe881[_0x42c5('0xa0')]===-0x1){return _0x3fe881;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xdf'),_0x42c5('0xe0')));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x108')]=function(_0x200983){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x109'),_0x200983['label']));return this['channel']['noop'](_0x42c5('0x108'));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xd')]=function(_0x11d4f1){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x11d4f1['label']));if(_0x11d4f1['retry']===0x0){return this['maxRetry'](_0x11d4f1);}_0x11d4f1[_0x42c5('0xa3')]-=0x1;if(!this[_0x42c5('0x84')](_0x11d4f1[_0x42c5('0x10a')])){return this['channel'][_0x42c5('0x4f')](_0x11d4f1,_0x42c5('0x10b'));}var _0x8d0db0=this['getSound'][_0x42c5('0x6d')](this,_0x11d4f1[_0x42c5('0x10a')]);if(!_0x8d0db0){return this['channel'][_0x42c5('0x4f')](_0x11d4f1,_0x42c5('0x10c'));}if(!this['isConfigured'](_0x11d4f1[_0x42c5('0xd3')])){return this[_0x42c5('0xf')]['error'](_0x42c5('0xd4'));}var _0x22f4d7=this[_0x42c5('0xf')][_0x42c5('0x10d')](_0x8d0db0,_0x11d4f1['response'],_0x11d4f1[_0x42c5('0x10e')]);var _0x2d8b43=_0x22f4d7[_0x42c5('0xa0')]?_0x22f4d7[_0x42c5('0xa0')][_0x42c5('0x49')]():'';logger[_0x42c5('0x2b')](_0x42c5('0x10f'),JSON[_0x42c5('0x72')](_0x22f4d7));if(_0x22f4d7[_0x42c5('0xa0')]===-0x1){this[_0x42c5('0x33')]['sync'](this,_0x11d4f1,_0x2d8b43);return _0x22f4d7;}else if(_0x22f4d7[_0x42c5('0x9e')]==='timeout'){_0x22f4d7[_0x42c5('0xa0')]=_0x2d8b43[_0x42c5('0x98')]>=parseInt(_0x11d4f1[_0x42c5('0x110')])?'x':'i';}else{_0x22f4d7[_0x42c5('0xa0')]=_0x2d8b43[_0x42c5('0x98')]>=parseInt(_0x11d4f1[_0x42c5('0x110')])&&_0x2d8b43[_0x42c5('0x98')]<=parseInt(_0x11d4f1[_0x42c5('0x10e')])?'x':'i';}var _0x33dee6=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x11d4f1[_0x42c5('0xd3')]);if(!_0x33dee6){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x11d4f1,_0x42c5('0xd5'));}this[_0x42c5('0xf')][_0x42c5('0xa1')](_0x33dee6,_0x2d8b43);if(this[_0x42c5('0x84')](_0x11d4f1[_0x42c5('0x111')])){var _0x36a335=parseInt(_0x11d4f1[_0x42c5('0x111')],0xa);var _0x108c62=rs[_0x42c5('0x112')]({'charset':'*','length':_0x36a335});var _0x1fa87d=_0x2d8b43['length'];if(_0x1fa87d>0x0){if(_0x1fa87d>_0x36a335){this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x11d4f1,_0x11d4f1[_0x42c5('0x113')]===_0x42c5('0x114')?_0x108c62+_0x2d8b43[_0x42c5('0x115')](_0x36a335):_0x2d8b43[_0x42c5('0x115')](0x0,_0x1fa87d-_0x36a335)+_0x108c62);}else{this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x11d4f1,rs[_0x42c5('0x112')]({'charset':'*','length':_0x1fa87d}));}}else{this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x11d4f1,'');}}else{this['createSquareDetailsReport'][_0x42c5('0x6d')](this,_0x11d4f1,_0x2d8b43);}return _0x22f4d7;};AGIVertices[_0x42c5('0x12')][_0x42c5('0xe')]=function(_0x255345){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x255345['label']));return this[_0x42c5('0xd')](_0x255345);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x116')]=function(_0x4cf756){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x117'),_0x4cf756[_0x42c5('0x34')]));this[_0x42c5('0x33')]['sync'](this,_0x4cf756,_0x4cf756[_0x42c5('0x118')]);return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x119'),_0x4cf756[_0x42c5('0x118')]));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x11a')]=function(_0x5bf7bb){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x11b'),_0x5bf7bb[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x5bf7bb[_0x42c5('0x87')])||!this[_0x42c5('0x84')](_0x5bf7bb['aws_secret_access_key'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x11c'));}if(!this[_0x42c5('0x84')](_0x5bf7bb[_0x42c5('0x59')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')]('no\x20text\x20configured');}this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x11d'),_0x5bf7bb[_0x42c5('0x59')]));var _0x44ac59=this[_0x42c5('0x86')][_0x42c5('0x6d')](this,_0x5bf7bb);if(_0x44ac59){this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0x11e'),_0x44ac59));var _0x3ea9a0=this[_0x42c5('0xf')][_0x42c5('0xf9')](_0x44ac59);try{fs[_0x42c5('0xfa')](_0x44ac59+_0x42c5('0xfb'));}catch(_0x363693){logger['error'](_0x363693);}return _0x3ea9a0;}return this[_0x42c5('0xf')]['error'](_0x5bf7bb,_0x42c5('0x11f'));};AGIVertices['prototype'][_0x42c5('0x120')]=function(_0x4afd24){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x4afd24[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x4afd24[_0x42c5('0x87')])||!this[_0x42c5('0x84')](_0x4afd24['aws_secret_access_key'])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x42c5('0x84')](_0x4afd24[_0x42c5('0x121')])){return this['channel'][_0x42c5('0xa6')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x4afd24['text'])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xa7'));}this['channel'][_0x42c5('0xed')]=!![];this[_0x42c5('0x33')](_0x4afd24);this[_0x42c5('0xe2')](_0x4afd24[_0x42c5('0x59')],'in','','');this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x122'),_0x4afd24['text']));var _0x500a78=this[_0x42c5('0x123')][_0x42c5('0x6d')](this,_0x4afd24);if(_0x500a78){for(var _0x816c76 in _0x500a78){if(_0x500a78['hasOwnProperty'](_0x816c76)&&_['isString'](_0x500a78[_0x816c76])){this[_0x42c5('0xf')][_0x42c5('0xa1')](util[_0x42c5('0x27')](_0x42c5('0x124'),_0x816c76[_0x42c5('0x69')]()),_0x500a78[_0x816c76]);}}if(_[_0x42c5('0x40')](_0x500a78['message'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x125'));}else{this[_0x42c5('0xe2')](_0x500a78[_0x42c5('0x76')],_0x42c5('0xef'),'amazonlex','');return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x126'),_0x500a78['message']));}}return this['channel'][_0x42c5('0x4f')](_0x4afd24,_0x42c5('0x127'));};AGIVertices['prototype'][_0x42c5('0x128')]=function(_0xc9c530){logger['info'](util['format'](_0x42c5('0x129'),_0xc9c530['label'],_0xc9c530[_0x42c5('0x64')]));if(!this[_0x42c5('0x84')](_0xc9c530['key'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x12a'));}var _0x2cb800=_0x42c5('0x12b');var _0x1de79=util[_0x42c5('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x42c5('0x112')](0x4));var _0xf53f5a=util[_0x42c5('0x27')](_0x42c5('0x9a'),_0x1de79,_0x2cb800);var _0x46753e=!![];if(_0xc9c530[_0x42c5('0x12c')]===_0x42c5('0x12d')){_0x46753e=![];}var _0x437c2f=this[_0x42c5('0xf')][_0x42c5('0x12e')](_0x1de79,_0x2cb800,_0xc9c530[_0x42c5('0x12f')],_0xc9c530[_0x42c5('0x64')],undefined,_0x46753e);if(_0x437c2f[_0x42c5('0xa0')]!==-0x1){this['channel']['noop'](util[_0x42c5('0x27')](_0x42c5('0x130'),_0xf53f5a));var _0x5a465b=this[_0x42c5('0x8d')]['sync'](this,_0xc9c530,_0xf53f5a);if(_0x5a465b){for(var _0x5cf4cc in _0x5a465b){if(_0x5a465b[_0x42c5('0x92')](_0x5cf4cc)){this[_0x42c5('0xf')][_0x42c5('0xa1')](util['format'](_0x42c5('0x131'),_0x5cf4cc[_0x42c5('0x69')]()),_0x5a465b[_0x5cf4cc]);}}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0x42c5('0x72')](_0x5a465b)));}}return _0x437c2f;};AGIVertices[_0x42c5('0x12')][_0x42c5('0x132')]=function(_0x45e313){logger['info'](util['format'](_0x42c5('0x133'),_0x45e313[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x45e313[_0x42c5('0x8f')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0x134'));}if(!this[_0x42c5('0x84')](_0x45e313[_0x42c5('0x90')])){return this['channel'][_0x42c5('0xa6')]('no\x20appsecret\x20configured');}var _0x11c7ee=_0x42c5('0x12b');var _0x220f40=util[_0x42c5('0x27')](_0x42c5('0x135'),FILES_PATH,rs[_0x42c5('0x112')](0x4));var _0x84fc4b=util[_0x42c5('0x27')]('%s.%s',_0x220f40,_0x11c7ee);var _0x3f20f6=!![];if(_0x45e313['beep']==='NOBEEP'){_0x3f20f6=![];}var _0x55065b=this['channel'][_0x42c5('0x12e')](_0x220f40,_0x11c7ee,_0x45e313[_0x42c5('0x12f')],_0x45e313[_0x42c5('0x64')],undefined,_0x3f20f6);if(_0x55065b[_0x42c5('0xa0')]!==-0x1){this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')]('tilde\x20%s\x20file\x20created',_0x84fc4b));var _0x1a0dc9=this[_0x42c5('0x8e')]['sync'](this,_0x45e313,_0x84fc4b);if(_0x1a0dc9){for(var _0x483fbb in _0x1a0dc9){if(_0x1a0dc9[_0x42c5('0x92')](_0x483fbb)){this['channel'][_0x42c5('0xa1')](util[_0x42c5('0x27')]('TILDE_ASR_%s',_0x483fbb[_0x42c5('0x69')]()),_0x1a0dc9[_0x483fbb]);}}return this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0x136'),JSON[_0x42c5('0x72')](_0x1a0dc9)));}}return _0x55065b;};AGIVertices[_0x42c5('0x12')][_0x42c5('0x137')]=function(_0x183860){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x138'),_0x183860[_0x42c5('0x34')]));return this[_0x42c5('0xf')][_0x42c5('0x139')](_0x183860['context'],_0x183860[_0x42c5('0x3b')],_0x183860[_0x42c5('0x3c')]);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x13a')]=function(_0xddbdec){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x13b'),_0xddbdec[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0xddbdec[_0x42c5('0x13c')])){return this['channel']['error'](_0xddbdec,'no\x20condition\x20configured');}try{var _0x59ca96=eval(_0xddbdec[_0x42c5('0x13c')])?_0x42c5('0x13d'):_0x42c5('0x13e');this[_0x42c5('0xf')]['noop'](util['format'](_0x42c5('0x13f'),_0xddbdec[_0x42c5('0x13c')],_0x59ca96));return{'code':0xc8,'result':_0x59ca96};}catch(_0x176ced){return{'code':0xc8,'result':_0x42c5('0x13e')};}};AGIVertices[_0x42c5('0x12')][_0x42c5('0x140')]=function(_0x717a4d){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x141'),_0x717a4d['label']));if(!this[_0x42c5('0x84')](_0x717a4d[_0x42c5('0x142')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x717a4d,_0x42c5('0x143'));}var _0x568637=this[_0x42c5('0x23')]['sync'](this,_0x717a4d['interval_id']);if(!_0x568637){return this[_0x42c5('0xf')]['error'](_0x717a4d,_0x42c5('0x144'));}for(var _0x3a6b1e=0x0;_0x3a6b1e<_0x568637['length'];_0x3a6b1e+=0x1){var _0x510ebd=this['channel'][_0x42c5('0x13')](util[_0x42c5('0x27')](_0x42c5('0x145'),_0x568637[_0x3a6b1e]));if(_0x510ebd[_0x42c5('0xa0')]===-0x1){return _0x510ebd;}logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x146'),_0x568637[_0x3a6b1e],_0x510ebd[_0x42c5('0x9e')]));if(_0x510ebd[_0x42c5('0x9e')]==='true'){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x146'),_0x568637[_0x3a6b1e],_0x42c5('0x13d')));this['channel'][_0x42c5('0xa6')](util['format'](_0x42c5('0x146'),_0x568637[_0x3a6b1e],_0x42c5('0x13d')));return{'code':0xc8,'result':_0x42c5('0x13d')};}else{logger['info'](util[_0x42c5('0x27')]('IFTIME\x20%s\x20%s',_0x568637[_0x3a6b1e],_0x42c5('0x13e')));this['channel'][_0x42c5('0xa6')](util['format'](_0x42c5('0x146'),_0x568637[_0x3a6b1e],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x42c5('0x12')][_0x42c5('0x147')]=function(_0x4134fc){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x148'),_0x4134fc[_0x42c5('0x34')]));return this[_0x42c5('0xf')][_0x42c5('0x147')]();};AGIVertices[_0x42c5('0x12')][_0x42c5('0x149')]=function(_0x3ae26f){logger[_0x42c5('0x2b')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x3ae26f['label']));if(!this[_0x42c5('0x84')](_0x3ae26f[_0x42c5('0x83')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x12a'));}var _0x52ce39=_0x42c5('0x12b');var _0x3777d8=util[_0x42c5('0x27')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x2ef8c0=util[_0x42c5('0x27')](_0x42c5('0x9a'),_0x3777d8,_0x52ce39);var _0x322135=!![];if(_0x3ae26f[_0x42c5('0x12c')]===_0x42c5('0x12d')){_0x322135=![];}var _0x2918e5=this['channel'][_0x42c5('0x12e')](_0x3777d8,_0x52ce39,_0x3ae26f[_0x42c5('0x12f')],_0x3ae26f[_0x42c5('0x64')],undefined,_0x322135);if(_0x2918e5[_0x42c5('0xa0')]!==-0x1){this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x14a'),_0x2ef8c0));var _0x3823c8=this[_0x42c5('0x82')][_0x42c5('0x6d')](this,_0x3ae26f,_0x2ef8c0);if(_0x3823c8){for(var _0x181b34 in _0x3823c8){if(_0x3823c8[_0x42c5('0x92')](_0x181b34)){this[_0x42c5('0xf')]['setVariable'](util['format']('ISPEECH_ASR_%s',_0x181b34['toUpperCase']()),_0x3823c8[_0x181b34]);}}return this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x14b'),JSON[_0x42c5('0x72')](_0x3823c8)));}}return _0x2918e5;};AGIVertices[_0x42c5('0x12')][_0x42c5('0x14c')]=function(_0x2a5eda){logger[_0x42c5('0x2b')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x2a5eda[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x2a5eda[_0x42c5('0x83')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0x12a'));}if(!this['isConfigured'](_0x2a5eda[_0x42c5('0x59')])){return this['channel'][_0x42c5('0xa6')]('no\x20text\x20configured');}this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')]('Trying\x20ispeech\x20TTS\x20%s',_0x2a5eda['text']));var _0x29f352=this[_0x42c5('0x80')]['sync'](this,_0x2a5eda);if(_0x29f352){this[_0x42c5('0xf')]['noop'](util['format'](_0x42c5('0x14a'),_0x29f352));var _0x220d7f=this['channel'][_0x42c5('0xf9')](_0x29f352,_0x2a5eda[_0x42c5('0x12f')]);try{fs['unlink'](_0x29f352+_0x42c5('0xfb'));}catch(_0x34684c){logger['error'](_0x34684c);}return _0x220d7f;}return this['channel'][_0x42c5('0x4f')](_0x2a5eda,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x42c5('0x14d')]=function(_0x229b60){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x14e'),_0x229b60[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x229b60[_0x42c5('0x14f')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x229b60,_0x42c5('0x150'));}logger['info'](util['format'](_0x42c5('0x151'),this['channel'][_0x42c5('0x38')],_0x229b60[_0x42c5('0x14f')]));var _0x4db901=this['agentLogin'][_0x42c5('0x6d')](this,_0x229b60[_0x42c5('0x14f')]);if(_0x4db901){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x152'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x229b60[_0x42c5('0x14f')]));this[_0x42c5('0xf')]['noop'](util['format'](_0x42c5('0x152'),this['channel'][_0x42c5('0x38')],_0x229b60['findBy']));return{'code':0xc8,'result':_0x42c5('0x153')};}else{logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x42c5('0x38')],_0x229b60[_0x42c5('0x14f')]));this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x154'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x229b60[_0x42c5('0x14f')]));return{'code':0xc8,'result':_0x42c5('0x155')};}};AGIVertices[_0x42c5('0x12')]['logout']=function(_0x3e0cf1){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x156'),_0x3e0cf1[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x3e0cf1[_0x42c5('0x14f')])){return this['channel'][_0x42c5('0x4f')](_0x3e0cf1,_0x42c5('0x150'));}logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x151'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x3e0cf1['findBy']));var _0x44033b=this[_0x42c5('0x51')][_0x42c5('0x6d')](this,_0x3e0cf1[_0x42c5('0x14f')]);if(_0x44033b){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x42c5('0xf')][_0x42c5('0x38')],_0x3e0cf1[_0x42c5('0x14f')]));this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x42c5('0xf')][_0x42c5('0x38')],_0x3e0cf1[_0x42c5('0x14f')]));return{'code':0xc8,'result':_0x42c5('0x153')};}else{logger[_0x42c5('0x2b')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x42c5('0x38')],_0x3e0cf1[_0x42c5('0x14f')]));this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x154'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x3e0cf1['findBy']));return{'code':0xc8,'result':_0x42c5('0x155')};}};AGIVertices['prototype'][_0x42c5('0x157')]=function(_0x3e2f04){logger[_0x42c5('0x2b')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3e2f04[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x3e2f04[_0x42c5('0x158')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3e2f04,_0x42c5('0x159'));}this['channel']['noop'](util['format'](_0x42c5('0x15a'),_0x3e2f04[_0x42c5('0x158')]));var _0x36ad0e=eval(_0x3e2f04[_0x42c5('0x158')]);if(!this[_0x42c5('0x84')](_0x3e2f04[_0x42c5('0xd3')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xd4'));}var _0x5aed38=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x3e2f04[_0x42c5('0xd3')]);if(!_0x5aed38){return this['channel'][_0x42c5('0x4f')](_0x3e2f04,'no\x20variable\x20found');}if(_['isArray'](_0x36ad0e)){var _0x44e507=this;_0x36ad0e[_0x42c5('0xd6')](function(_0xd307ca,_0x58368a){_0x44e507[_0x42c5('0xf')]['setVariable'](util[_0x42c5('0x27')](_0x42c5('0x15b'),_0x5aed38,_0x58368a),_0xd307ca);});return this['channel'][_0x42c5('0xa6')](util['format'](_0x42c5('0x15c'),_0x5aed38));}else{return this['channel'][_0x42c5('0xa1')](_0x5aed38,_0x36ad0e);}};AGIVertices[_0x42c5('0x12')]['menu']=function(_0x1e92ac){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x15d'),_0x1e92ac['label']));if(_0x1e92ac[_0x42c5('0xa3')]===0x0){return this['maxRetry'](_0x1e92ac);}_0x1e92ac[_0x42c5('0xa3')]-=0x1;if(!this[_0x42c5('0x84')](_0x1e92ac[_0x42c5('0x10a')])){return this[_0x42c5('0xf')]['error'](_0x1e92ac,_0x42c5('0x10b'));}var _0xabc27c=this[_0x42c5('0x1e')][_0x42c5('0x6d')](this,_0x1e92ac[_0x42c5('0x10a')]);if(!_0xabc27c){return this[_0x42c5('0xf')]['error'](_0x1e92ac,_0x42c5('0x10c'));}var _0x4ac56f=this[_0x42c5('0xf')][_0x42c5('0x10d')](_0xabc27c,_0x1e92ac[_0x42c5('0x15e')],_0x1e92ac[_0x42c5('0x15f')]);var _0x4a3ad3=_0x4ac56f[_0x42c5('0xa0')];if(_0x4ac56f[_0x42c5('0xa0')]===-0x1){this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x1e92ac,'-1');return _0x4ac56f;}else if(_0x4ac56f[_0x42c5('0x9e')]===_0x42c5('0x64')){_0x4ac56f['result']=_0x4ac56f[_0x42c5('0xa0')][_0x42c5('0x98')]>0x0?_0x4ac56f[_0x42c5('0xa0')]:'t';}else if(_[_0x42c5('0x43')](_0x4ac56f['result'])){_0x4ac56f['result']='#';_0x4a3ad3='#';}if(!this[_0x42c5('0x84')](_0x1e92ac['variable_id'])){this['channel'][_0x42c5('0xa6')](_0x42c5('0xd4'));}else{var _0x2b3236=this['getVariable'][_0x42c5('0x6d')](this,_0x1e92ac[_0x42c5('0xd3')]);if(!_0x2b3236){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x1e92ac,_0x42c5('0xd5'));}this[_0x42c5('0xf')][_0x42c5('0xa1')](_0x2b3236,_0x4a3ad3);}this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x1e92ac,_0x4a3ad3);return _0x4ac56f;};AGIVertices[_0x42c5('0x12')][_0x42c5('0xa6')]=function(_0x57c123){logger['info'](util[_0x42c5('0x27')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x57c123['label']));return this['channel'][_0x42c5('0xa6')](_0x57c123[_0x42c5('0x160')]||_0x57c123[_0x42c5('0x34')]);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x161')]=function(_0x5570f4){logger['info'](util[_0x42c5('0x27')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x5570f4[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x5570f4['findBy'])){return this['channel'][_0x42c5('0x4f')](_0x5570f4,'no\x20find\x20by\x20configured');}logger[_0x42c5('0x2b')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x42c5('0xf')][_0x42c5('0x38')],_0x5570f4[_0x42c5('0x14f')]));var _0x3bc564=this['getPause']['sync'](this,_0x5570f4[_0x42c5('0x162')]);var _0xc56e51=this['agentPause'][_0x42c5('0x6d')](this,_0x5570f4[_0x42c5('0x14f')],_0x3bc564);if(_0xc56e51){logger['info'](util[_0x42c5('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x42c5('0xf')][_0x42c5('0x38')],_0x5570f4['findBy']));this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x152'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x5570f4[_0x42c5('0x14f')]));return{'code':0xc8,'result':_0x42c5('0x153')};}else{logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x154'),this[_0x42c5('0xf')]['callerid'],_0x5570f4['findBy']));this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0x152'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x5570f4[_0x42c5('0x14f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x42c5('0x12')]['playback']=function(_0x262ff3){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x163'),_0x262ff3[_0x42c5('0x34')]));if(!this['isConfigured'](_0x262ff3[_0x42c5('0x10a')])){return this['channel'][_0x42c5('0x4f')](_0x262ff3,'no\x20file\x20audio\x20selected');}var _0xfd648e=this['getSound'][_0x42c5('0x6d')](this,_0x262ff3[_0x42c5('0x10a')]);if(!_0xfd648e){return this['channel'][_0x42c5('0x4f')](_0x262ff3,_0x42c5('0x10c'));}var _0x37ce76=this['channel'][_0x42c5('0x54')](_0x42c5('0x164'),[_0xfd648e,_0x262ff3[_0x42c5('0xde')]]);if(_0x37ce76[_0x42c5('0xa0')]===-0x1){return _0x37ce76;}return this['channel'][_0x42c5('0xa6')](util['format']('Executed\x20command\x20%s\x20%s',_0x42c5('0x164'),_0xfd648e));};AGIVertices[_0x42c5('0x12')]['queue']=function(_0x4e5844){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x165'),_0x4e5844[_0x42c5('0x34')]));if(!this['isConfigured'](_0x4e5844[_0x42c5('0x166')])){return this[_0x42c5('0xf')]['error'](_0x4e5844,_0x42c5('0x167'));}var _0x1f5ef3='';var _0x4bc593=parseInt(_0x4e5844['queue_id'],0xa);if(isNaN(_0x4bc593)){_0x1f5ef3=_0x4e5844[_0x42c5('0x166')];}else{_0x1f5ef3=this[_0x42c5('0x168')]['sync'](this,_0x4e5844[_0x42c5('0x166')]);if(!_0x1f5ef3){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x4e5844,_0x42c5('0x169'));}}var _0x4f68c1='';if(this['isConfigured'](_0x4e5844[_0x42c5('0x10a')])){var _0x23548d=this[_0x42c5('0x1e')][_0x42c5('0x6d')](this,_0x4e5844[_0x42c5('0x10a')]);if(_0x23548d){_0x4f68c1=_0x23548d;}}this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x4e5844,_0x1f5ef3);if(_0x4e5844[_0x42c5('0xde')][_0x42c5('0x16a')]('x')<0x0){_0x4e5844[_0x42c5('0xde')]+='x';}if(_0x4e5844[_0x42c5('0xde')][_0x42c5('0x16a')]('X')<0x0){_0x4e5844[_0x42c5('0xde')]+='X';}this[_0x42c5('0xf')]['setVariable']('XMCS-QUEUE',_0x1f5ef3?_0x1f5ef3[_0x42c5('0x16b')]():'');var _0x4bc06b=this[_0x42c5('0xf')][_0x42c5('0x54')]('QUEUE',[_0x1f5ef3,_0x4e5844[_0x42c5('0xde')],_0x4e5844['url'],_0x4f68c1,_0x4e5844[_0x42c5('0x64')],_0x4e5844['agi'],_0x4e5844[_0x42c5('0x16c')],_0x4e5844[_0x42c5('0x16d')],'',_0x4e5844['position']]);if(_0x4bc06b['result']===-0x1){return _0x4bc06b;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xbe'),_0x42c5('0x16e'),_0x1f5ef3));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x16f')]=function(_0x45439b){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x45439b[_0x42c5('0x34')]));var _0x24bf19=_0x45439b[_0x42c5('0x170')]||'wav';var _0x5bcbea=util['format'](_0x42c5('0x171'),this[_0x42c5('0xf')][_0x42c5('0x3f')],rs['generate'](0x5));var _0x30eae0=util[_0x42c5('0x27')](_0x42c5('0x172'),FILES_PATH,_0x5bcbea,_0x24bf19);var _0x565924=util['format'](_0x42c5('0x135'),FILES_PATH,_0x5bcbea);this[_0x42c5('0x37')][_0x42c5('0x6d')](this,_0x45439b,_0x5bcbea,_0x30eae0);this[_0x42c5('0xf')][_0x42c5('0xa1')](_0x42c5('0x173'),_0x5bcbea);logger[_0x42c5('0x2b')](_0x42c5('0x174'),_0x565924,_0x24bf19,_0x45439b[_0x42c5('0x175')],_0x45439b[_0x42c5('0x64')]);return this[_0x42c5('0xf')][_0x42c5('0x12e')](_0x565924,_0x24bf19,_0x45439b[_0x42c5('0x175')],_0x45439b[_0x42c5('0x64')],undefined,!![]);};AGIVertices[_0x42c5('0x12')]['restapi']=function(_0x3e14f9){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x176'),_0x3e14f9['label']));if(!this['isConfigured'](_0x3e14f9[_0x42c5('0x62')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x177'));}var _0x30b392=this[_0x42c5('0x61')][_0x42c5('0x6d')](this,_0x3e14f9);logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x178'),util[_0x42c5('0x179')](_0x30b392,{'showHidden':![],'depth':null})));if(!this[_0x42c5('0x84')](_0x3e14f9['variable_id'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x17a'));}var _0x280b05=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x3e14f9[_0x42c5('0xd3')]);if(!_0x280b05){return this['channel'][_0x42c5('0x4f')](_0x3e14f9,'no\x20variable\x20found');}this[_0x42c5('0xf')]['setVariable'](util[_0x42c5('0x27')](_0x42c5('0x17b'),_0x280b05),_0x30b392['statusCode']?_0x30b392['statusCode']:_0x42c5('0x17c'));this[_0x42c5('0xf')][_0x42c5('0xa1')](util['format'](_0x42c5('0x17d'),_0x280b05),_0x30b392[_0x42c5('0x75')]?_0x30b392['statusMessage']:'OK');if(_0x30b392[_0x42c5('0x6a')]){try{this[_0x42c5('0x99')](_0x30b392[_0x42c5('0x6a')],_0x280b05);}catch(_0x5d9cf7){logger[_0x42c5('0x4f')](util[_0x42c5('0x27')](_0x42c5('0x17e'),_0x280b05));}}return this['channel']['noop'](util['format'](_0x42c5('0xd8'),_0x280b05));};AGIVertices['prototype'][_0x42c5('0x17f')]=function(_0x19737e){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x180'),_0x19737e[_0x42c5('0x34')]));return this[_0x42c5('0xf')][_0x42c5('0x181')](_0x19737e['digits'][_0x42c5('0x182')](/\s+/g,''),_0x19737e['escape_digits']);};AGIVertices['prototype']['saynumber']=function(_0x2ea01e){logger[_0x42c5('0x2b')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x2ea01e['label']));return this['channel'][_0x42c5('0x183')](_0x2ea01e[_0x42c5('0x65')][_0x42c5('0x182')](/\s+/g,''),_0x2ea01e[_0x42c5('0x175')]);};AGIVertices[_0x42c5('0x12')]['sayphonetic']=function(_0x5a7de0){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x5a7de0['label']));return this[_0x42c5('0xf')][_0x42c5('0x184')](_0x5a7de0[_0x42c5('0x59')],_0x5a7de0[_0x42c5('0x175')]);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x185')]=function(_0x23c50c){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x186'),_0x23c50c[_0x42c5('0x34')]));if(!this['isConfigured'](_0x23c50c[_0x42c5('0x187')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0x188'));}var _0x347fbd=this[_0x42c5('0x21')]['sync'](this,_0x23c50c[_0x42c5('0x187')]);if(!_0x347fbd||!_0x347fbd[_0x42c5('0x189')]){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x23c50c,_0x42c5('0x18a'));}var _0x1fa38e={'from':util[_0x42c5('0x27')](_0x42c5('0x18b'),_0x347fbd[_0x42c5('0x16')],_0x347fbd['email']||_0x347fbd[_0x42c5('0x189')][_0x42c5('0x18c')]),'to':_0x23c50c['to']||'','cc':_0x23c50c['cc']||'','bcc':_0x23c50c[_0x42c5('0x18d')]||'','subject':_0x23c50c[_0x42c5('0x18e')],'html':_0x23c50c[_0x42c5('0x59')],'text':_0x23c50c[_0x42c5('0x59')]};if(this[_0x42c5('0x84')](_0x23c50c['template_id'])){}logger[_0x42c5('0x18f')](_0x42c5('0x190'),JSON['stringify'](_0x1fa38e));this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x23c50c,_0x23c50c[_0x42c5('0x187')]);this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x191'),_0x347fbd[_0x42c5('0x16')]));this[_0x42c5('0x192')][_0x42c5('0x6d')](this,_0x347fbd['smtpOptions'],_0x1fa38e);return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x193'));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x194')]=function(_0x652972){logger['info'](util['format'](_0x42c5('0x195'),_0x652972[_0x42c5('0x34')]));return this[_0x42c5('0xf')]['noop'](_0x42c5('0x196'));};AGIVertices['prototype']['sendSMS']=function(_0x3fb7ed){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x197'),_0x3fb7ed[_0x42c5('0x34')]));if(!this['isConfigured'](_0x3fb7ed['sms_account_id'])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0x198'));}var _0x57a717=this[_0x42c5('0x30')]['sync'](this,_0x3fb7ed[_0x42c5('0x199')]);if(!_0x57a717){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3fb7ed,'no\x20sms\x20account\x20found');}var _0x2a1ffa={'body':_0x3fb7ed[_0x42c5('0x19a')],'phone':_0x3fb7ed['to']||'','SmsAccountId':_0x57a717['id']};logger[_0x42c5('0x18f')](_0x42c5('0x19b'),JSON[_0x42c5('0x72')](_0x2a1ffa));this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x3fb7ed,_0x3fb7ed[_0x42c5('0x199')]);this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0x19c'),_0x57a717[_0x42c5('0x16')]));this[_0x42c5('0x32')][_0x42c5('0x6d')](this,_0x2a1ffa);return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x19d'));};AGIVertices[_0x42c5('0x12')]['set']=function(_0x3a2778){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x19e'),_0x3a2778[_0x42c5('0x34')]));if(!this['isConfigured'](_0x3a2778['variable_id'])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3a2778,'no\x20variable\x20selected');}var _0x552d26=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x3a2778[_0x42c5('0xd3')]);if(!_0x552d26){return this['channel'][_0x42c5('0x4f')](_0x3a2778,'no\x20variable\x20found');}return this['channel'][_0x42c5('0xa1')](_0x552d26,_0x3a2778[_0x42c5('0x19f')]);};AGIVertices['prototype'][_0x42c5('0x1a0')]=function(_0x169c32){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x1a1'),_0x169c32[_0x42c5('0x34')]));this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x1a2'));if(_0x169c32['answer']===_0x42c5('0x1a3')){this['channel'][_0x42c5('0xa6')]('Answer');return this['channel'][_0x42c5('0xb6')]();}return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x1a4'));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1a5')]=function(_0x1a995b){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1a995b[_0x42c5('0x34')]));if(!this['isConfigured'](_0x1a995b[_0x42c5('0x1a6')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x1a995b,_0x42c5('0x1a7'));}var _0x452ff8=this[_0x42c5('0x1a8')][_0x42c5('0x6d')](this,_0x1a995b[_0x42c5('0x1a6')]);if(!this[_0x42c5('0x84')](_0x452ff8)){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x1a995b,util[_0x42c5('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x1a995b[_0x42c5('0x1a6')]));}if(_0x452ff8===this[_0x42c5('0xf')][_0x42c5('0x36')]){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x1a995b,_0x42c5('0x1a9'));}this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x1a995b,_0x452ff8);var _0x30a9d5=this[_0x42c5('0xf')]['exec']('AGI',util[_0x42c5('0x27')](_0x42c5('0x1aa'),config['agi'][_0x42c5('0x1ab')]||_0x42c5('0x1ac'),_0x452ff8,this['channel'][_0x42c5('0x36')]));if(_0x30a9d5[_0x42c5('0xa0')]===-0x1){return _0x30a9d5;}return this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xbe'),_0x42c5('0x1ad'),_0x452ff8));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1ae')]=function(_0x31c590){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x1af'),_0x31c590[_0x42c5('0x34')]));var _0x1f4529=this[_0x42c5('0x53')]['sync'](this,_0x31c590[_0x42c5('0x1b0')]);this[_0x42c5('0x33')]['sync'](this,_0x31c590,_0x31c590[_0x42c5('0x1b0')]);if(this['isConfigured'](_0x31c590[_0x42c5('0xd3')])){var _0x908d=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x31c590['variable_id']);if(_0x908d){this[_0x42c5('0xf')][_0x42c5('0xa1')](_0x908d,_0x1f4529);return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x1b1'),_0x31c590['command'],_0x908d));}}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x31c590['command']));};AGIVertices['prototype'][_0x42c5('0x1b2')]=function(_0x543589){logger['info'](util['format'](_0x42c5('0x1b3'),_0x543589[_0x42c5('0x34')]));_0x543589['text']=_0x543589[_0x42c5('0x59')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x42c5('0x84')](_0x543589['apiKey'])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0x1b4'));}if(!this['isConfigured'](_0x543589['text'])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xa7'));}this[_0x42c5('0xf')][_0x42c5('0xa6')](util['format'](_0x42c5('0x1b5'),_0x543589[_0x42c5('0x59')]));var _0xd3ef3b=this['googleCloudTTS'][_0x42c5('0x6d')](this,_0x543589);if(_0xd3ef3b){this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x1b6'),_0xd3ef3b));var _0x4c3db7=this[_0x42c5('0xf')]['streamFile'](_0xd3ef3b);try{fs[_0x42c5('0xfa')](_0xd3ef3b+_0x42c5('0xfb'));}catch(_0x53c2c9){logger[_0x42c5('0x4f')](_0x53c2c9);}return _0x4c3db7;}return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x543589,_0x42c5('0x1b7'));};AGIVertices['prototype'][_0x42c5('0x1b8')]=function(_0x274151){logger[_0x42c5('0x2b')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x274151[_0x42c5('0x34')]));_0x274151[_0x42c5('0x59')]=_0x274151[_0x42c5('0x59')][_0x42c5('0x182')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x274151[_0x42c5('0x59')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xa7'));}this[_0x42c5('0xf')][_0x42c5('0xa6')](util['format'](_0x42c5('0x1b9'),_0x274151[_0x42c5('0x59')]));var _0x3300e8=this[_0x42c5('0x5f')][_0x42c5('0x6d')](this,_0x274151);if(_0x3300e8){this[_0x42c5('0xf')][_0x42c5('0xa6')](util['format'](_0x42c5('0x1ba'),_0x3300e8));var _0x428b9b=this[_0x42c5('0xf')][_0x42c5('0xf9')](_0x3300e8);try{fs['unlink'](_0x3300e8+_0x42c5('0xfb'));}catch(_0x9e6f62){logger['error'](_0x9e6f62);}return _0x428b9b;}return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x274151,_0x42c5('0x1bb'));};AGIVertices[_0x42c5('0x12')]['unpause']=function(_0xbf86ba){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x1bc'),_0xbf86ba[_0x42c5('0x34')]));if(!this['isConfigured'](_0xbf86ba[_0x42c5('0x14f')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0xbf86ba,'no\x20find\x20by\x20configured');}logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x151'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0xbf86ba[_0x42c5('0x14f')]));var _0x101d8e=this[_0x42c5('0x50')]['sync'](this,_0xbf86ba[_0x42c5('0x14f')]);if(_0x101d8e){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x152'),this[_0x42c5('0xf')]['callerid'],_0xbf86ba[_0x42c5('0x14f')]));this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x152'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0xbf86ba[_0x42c5('0x14f')]));return{'code':0xc8,'result':_0x42c5('0x153')};}else{logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x42c5('0x38')],_0xbf86ba['findBy']));this['channel'][_0x42c5('0xa6')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x42c5('0xf')][_0x42c5('0x38')],_0xbf86ba['findBy']));return{'code':0xc8,'result':_0x42c5('0x155')};}};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1bd')]=function(_0x194adf){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x1be'),_0x194adf[_0x42c5('0x34')]));var _0x5ba4cb=this[_0x42c5('0xf')][_0x42c5('0x54')]('VOICEMAIL',[_0x194adf[_0x42c5('0x1bf')],_0x194adf[_0x42c5('0x78')]]);if(_0x5ba4cb[_0x42c5('0xa0')]===-0x1){return _0x5ba4cb;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xbe'),'VOICEMAIL',_0x194adf[_0x42c5('0x1bf')]));};AGIVertices[_0x42c5('0x12')]['vswitch']=function(_0x16d59d){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x16d59d[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x16d59d[_0x42c5('0xd3')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x16d59d,'no\x20variable\x20selected');}var _0x5141a0=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x16d59d['variable_id']);if(!_0x5141a0){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x16d59d,_0x42c5('0xd5'));}var _0x280e72=this[_0x42c5('0xf')]['getVariable'](_0x5141a0);return{'code':0xc8,'result':_0x280e72[_0x42c5('0x9e')]?_0x280e72[_0x42c5('0x9e')]:'-'};};String[_0x42c5('0x12')]['replaceAll']=function(_0x4e77e2,_0x38b9b8){return this['split'](_0x4e77e2)[_0x42c5('0x1c0')](_0x38b9b8);};module['exports']=AGIVertices; \ No newline at end of file +var _0x30d6=['getVoiceQueueById','catch','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','interval','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','MALE','googleTTS','url','method','timeout','number','includes','POST','body','parse','computedVariables','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','en-US','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','maxRetry','sync','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','no\x20grammar\x20configured','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','retry','no\x20file\x20audio\x20selected','getSound','file_id','getData','response','maxdigit','test','mindigit','hiddendigitspos','first','substr','generate','getsecretdigits','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','streamFile','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','toUpperCase','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','%s/recordings/%s','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','getIntervals','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','no\x20operation\x20configured','math\x20%s','no\x20variable\x20found','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','success','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','Executed\x20command\x20%s\x20%s','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','Smtp','\x22%s\x22\x20<%s>','email','user','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','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','yes','Answer','subproject','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','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','.wav','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','util','lodash','odbc','moment','mustache','request-promise','../../config/environment','../../config/environment/shared','./scripts','rawHeaders','rawBody','menu','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','getVoiceQueue'];(function(_0x7474d4,_0x403090){var _0x242110=function(_0x4ae134){while(--_0x4ae134){_0x7474d4['push'](_0x7474d4['shift']());}};_0x242110(++_0x403090);}(_0x30d6,0x1b0));var _0x630d=function(_0x23d957,_0x5d2176){_0x23d957=_0x23d957-0x0;var _0x568ff2=_0x30d6[_0x23d957];return _0x568ff2;};'use strict';var fs=require('fs');var util=require(_0x630d('0x0'));var _=require(_0x630d('0x1'));var sh=require('shelljs');var odbc=require(_0x630d('0x2'))();var rs=require('randomstring');var moment=require(_0x630d('0x3'));var Mustache=require(_0x630d('0x4'));var rp=require(_0x630d('0x5'));var logger=require('../../config/logger')('agi');var config=require(_0x630d('0x6'));var shared=require(_0x630d('0x7'));var scripts=require(_0x630d('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x630d('0x9'),_0x630d('0xa')];var verticesWithRetry=[_0x630d('0xb'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x29a050,_0xab7696,_0x24d260){this[_0x630d('0xc')]=_0x29a050;this['rpc']=_0xab7696;this[_0x630d('0xd')]=_0x24d260;};AGIVertices[_0x630d('0xe')][_0x630d('0xf')]=function(_0x2c03da,_0x468797){this[_0x630d('0x10')][_0x630d('0x11')](_0x2c03da)[_0x630d('0x12')](function(_0x7f64d){_0x468797(null,_0x7f64d?_0x7f64d[_0x630d('0x13')]:![]);})['catch'](function(_0x1f458a){_0x468797(_0x1f458a);});};AGIVertices['prototype'][_0x630d('0x14')]=function(_0x413c4a,_0x51808f){this[_0x630d('0x10')][_0x630d('0x15')](_0x413c4a)[_0x630d('0x12')](function(_0x2cf762){_0x51808f(null,_0x2cf762?_0x2cf762[_0x630d('0x13')]:![]);})[_0x630d('0x16')](function(_0x162263){_0x51808f(_0x162263);});};AGIVertices[_0x630d('0xe')]['getSquareProject']=function(_0x2ba97b,_0x4db79d){this[_0x630d('0x10')]['getSquareProjectById'](_0x2ba97b)['then'](function(_0x227d62){_0x4db79d(null,_0x227d62?_0x227d62[_0x630d('0x13')]:![]);})['catch'](function(_0xb51226){_0x4db79d(_0xb51226);});};AGIVertices[_0x630d('0xe')]['getSquareOdbc']=function(_0x3443b1,_0x5c5fc3){this['rpc'][_0x630d('0x17')](_0x3443b1)['then'](function(_0x2d960f){_0x5c5fc3(null,_0x2d960f?_0x2d960f[_0x630d('0x18')]:![]);})['catch'](function(_0x9d16e6){_0x5c5fc3(_0x9d16e6);});};AGIVertices[_0x630d('0xe')][_0x630d('0x19')]=function(_0x52d152,_0x4f5334){this['rpc'][_0x630d('0x1a')](_0x52d152)[_0x630d('0x12')](function(_0x324f51){_0x4f5334(null,_0x324f51?_0x324f51['name']:![]);})[_0x630d('0x16')](function(_0x1bae23){_0x4f5334(_0x1bae23);});};AGIVertices[_0x630d('0xe')][_0x630d('0x1b')]=function(_0x5ae2a1,_0x279cde){this[_0x630d('0x10')][_0x630d('0x1c')](_0x5ae2a1)[_0x630d('0x12')](function(_0x157e94){_0x279cde(null,_0x157e94?_0x157e94[_0x630d('0x13')]:![]);})[_0x630d('0x16')](function(_0x5f4921){_0x279cde(_0x5f4921);});};AGIVertices[_0x630d('0xe')]['getSound']=function(_0xd198d5,_0x5346da){var _0x4babf3=this;this[_0x630d('0x10')][_0x630d('0x1d')](_0xd198d5)[_0x630d('0x12')](function(_0x5d0f44){_0x5346da(null,_0x5d0f44?_0x4babf3[_0x630d('0x1e')](_0x5d0f44['save_name']):![]);})[_0x630d('0x16')](function(_0x45d538){_0x5346da(_0x45d538);});};AGIVertices[_0x630d('0xe')][_0x630d('0x1f')]=function(_0x20fc93,_0x8db5c1){this[_0x630d('0x10')][_0x630d('0x20')](_0x20fc93)[_0x630d('0x12')](function(_0x33ad60){_0x8db5c1(null,_0x33ad60?_0x33ad60:![]);})['catch'](function(_0x3763cf){_0x8db5c1(_0x3763cf);});};AGIVertices[_0x630d('0xe')][_0x630d('0x21')]=function(_0x789005,_0x25cf85,_0x18c8a2){this['mailRpc'][_0x630d('0x21')](_0x789005,_0x25cf85)[_0x630d('0x12')](function(){_0x18c8a2(null);})[_0x630d('0x16')](function(_0x3e8227){_0x18c8a2(_0x3e8227);});};AGIVertices[_0x630d('0xe')]['getIntervals']=function(_0x2a490e,_0x4854df){this[_0x630d('0x10')][_0x630d('0x22')](_0x2a490e)[_0x630d('0x12')](function(_0x7744b2){if(_0x7744b2){if(_0x7744b2['IntervalId']){_0x4854df(null,[_0x7744b2[_0x630d('0x23')]]);}else{_0x4854df(null,_['map'](_0x7744b2[_0x630d('0x24')],_0x630d('0x23')));}}else{_0x4854df(null,![]);}})[_0x630d('0x16')](function(_0x333b61){_0x4854df(_0x333b61);});};AGIVertices['prototype'][_0x630d('0x1e')]=function(_0x41227f){return util['format'](_0x630d('0x25'),FILES_PATH,_0x41227f);};AGIVertices[_0x630d('0xe')][_0x630d('0x26')]=function(_0x5003e2,_0xea2456,_0x1d54ad){odbc[_0x630d('0x27')](_0x5003e2,function(_0x51cdb6){if(_0x51cdb6){logger[_0x630d('0x28')](_0x630d('0x29'),_0x51cdb6);_0x1d54ad(_0x51cdb6);}else{logger['info'](_0x630d('0x2a'));odbc[_0x630d('0x2b')](_0xea2456,function(_0x3b35ad,_0x36ed3f){if(_0x3b35ad){logger[_0x630d('0x2c')](_0x630d('0x2d'),_0xea2456);_0x1d54ad(_0x3b35ad);}else{logger[_0x630d('0x2c')](_0x630d('0x2e'),_0xea2456);odbc[_0x630d('0x2f')](function(_0x57e647){if(_0x57e647){logger[_0x630d('0x28')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x57e647);}_0x1d54ad(null,_0x36ed3f);});}});}});};AGIVertices[_0x630d('0xe')][_0x630d('0x30')]=function(_0xafae92,_0x4a4f31){this[_0x630d('0x10')][_0x630d('0x31')](_0xafae92)[_0x630d('0x12')](function(_0xb94b1b){_0x4a4f31(null,_0xb94b1b?_0xb94b1b:![]);})['catch'](function(_0x25711){_0x4a4f31(_0x25711);});};AGIVertices[_0x630d('0xe')][_0x630d('0x32')]=function(_0xa54ddb,_0x32c4dd){this[_0x630d('0x10')]['createSmsMessage'](_0xa54ddb)[_0x630d('0x12')](function(_0x903732){_0x32c4dd(null,_0x903732);})['catch'](function(_0x3b7d34){_0x32c4dd(_0x3b7d34);});};AGIVertices['prototype'][_0x630d('0x33')]=function(_0x4e4223,_0x48c18b,_0x160900){this[_0x630d('0x10')]['createSquareDetailsReport']({'uniqueid':this[_0x630d('0xc')][_0x630d('0x34')],'node':_0x4e4223['label'],'application':_0x4e4223[_0x630d('0x35')],'data':_0x48c18b||null,'project_name':this[_0x630d('0xc')][_0x630d('0x36')],'callerid':this['channel'][_0x630d('0x37')]})[_0x630d('0x12')](function(_0x3d9229){if(_0x160900){_0x160900(null,_0x3d9229);}})[_0x630d('0x16')](function(_0x57306e){if(_0x160900){_0x160900(_0x57306e);}});};AGIVertices[_0x630d('0xe')]['createSquareRecording']=function(_0x5db3f6,_0xd01d9,_0xe7cb0e,_0x3e334a){this[_0x630d('0x10')][_0x630d('0x38')]({'uniqueid':this[_0x630d('0xc')][_0x630d('0x34')],'callerid':this[_0x630d('0xc')]['callerid'],'calleridname':this['channel'][_0x630d('0x39')],'context':this[_0x630d('0xc')][_0x630d('0x3a')],'extension':this[_0x630d('0xc')][_0x630d('0x3b')],'priority':this['channel'][_0x630d('0x3c')],'accountcode':this['channel'][_0x630d('0x3d')],'dnid':this[_0x630d('0xc')][_0x630d('0x3e')],'projectName':this[_0x630d('0xc')]['arg_1'],'saveName':_0xd01d9,'filename':_0x5db3f6[_0x630d('0x3f')]||_0xd01d9,'savePath':_0xe7cb0e})[_0x630d('0x12')](function(_0x2b7835){_0x3e334a(null,_0x2b7835);})[_0x630d('0x16')](function(_0x5071b6){_0x3e334a(_0x5071b6);});};AGIVertices['prototype'][_0x630d('0x40')]=function(_0x432716,_0x36d5d5,_0x14b919,_0x426336,_0x5af59e){this[_0x630d('0x10')][_0x630d('0x40')]({'uniqueid':this[_0x630d('0xc')][_0x630d('0x34')],'body':_0x432716,'direction':_0x36d5d5,'providerName':_0x14b919,'providerResponse':_0x426336})[_0x630d('0x12')](function(_0x4379a6){if(_0x5af59e){_0x5af59e(null,_0x4379a6);}})['catch'](function(_0x69c72d){if(_0x5af59e){_0x5af59e(_0x69c72d);}});};AGIVertices['prototype'][_0x630d('0x41')]=function(_0x4415ba,_0x3ff786){this[_0x630d('0x10')][_0x630d('0x41')]({'firstName':_[_0x630d('0x42')](_0x4415ba['name'])||_[_0x630d('0x43')](_0x4415ba['name'])?_0x630d('0x44')+Math[_0x630d('0x45')]():_0x4415ba[_0x630d('0x13')],'lastName':_[_0x630d('0x42')](_0x4415ba[_0x630d('0x46')])||_['isNil'](_0x4415ba['lastName'])?null:_0x4415ba[_0x630d('0x46')],'phone':_0x4415ba[_0x630d('0x47')],'ListId':_0x4415ba[_0x630d('0x48')],'scheduledat':_0x4415ba[_0x630d('0x49')],'callbackUniqueid':this[_0x630d('0xc')][_0x630d('0x34')],'tags':_0x630d('0x4a'),'description':_0x630d('0x4b')+_0x4415ba['scheduledAt'][_0x630d('0x4c')](),'priority':_0x4415ba[_0x630d('0x4d')]})[_0x630d('0x12')](function(_0x3a6413){_0x3ff786(null,_0x3a6413);})[_0x630d('0x16')](function(_0x1a8175){_0x3ff786(_0x1a8175);});};AGIVertices['prototype'][_0x630d('0x4e')]=function(_0x4b8209,_0x1d530d){this[_0x630d('0x10')][_0x630d('0x4f')](_0x4b8209)[_0x630d('0x12')](function(_0xc020df){_0x1d530d(null,_0xc020df?_0xc020df['name']:![]);})[_0x630d('0x16')](function(_0xf5a327){_0x1d530d(_0xf5a327);});};AGIVertices[_0x630d('0xe')][_0x630d('0x50')]=function(_0x234804,_0x27893b,_0x4ac6aa){var _0x1d5078={'role':_0x630d('0x51')};_0x1d5078[_0x234804]=this[_0x630d('0xc')]['callerid'];this[_0x630d('0x10')]['agentPause'](_0x1d5078,_0x27893b,this[_0x630d('0xc')][_0x630d('0x34')])[_0x630d('0x12')](function(_0x24c560){_0x4ac6aa(null,_[_0x630d('0x43')](_0x24c560)?![]:!![]);})[_0x630d('0x16')](function(_0x19d51e){logger[_0x630d('0x28')](_0x19d51e);_0x4ac6aa(null,![]);});};AGIVertices['prototype'][_0x630d('0x52')]=function(_0x539bac,_0x6ff2d2){var _0x524a75={'role':_0x630d('0x51')};_0x524a75[_0x539bac]=this['channel'][_0x630d('0x37')];this['rpc'][_0x630d('0x52')](_0x524a75)[_0x630d('0x12')](function(_0x3f488c){_0x6ff2d2(null,_['isNil'](_0x3f488c)?![]:!![]);})['catch'](function(_0x5966ff){logger[_0x630d('0x28')](_0x5966ff);_0x6ff2d2(null,![]);});};AGIVertices[_0x630d('0xe')][_0x630d('0x53')]=function(_0x57502d,_0x56fce7){var _0x2e2fc0={'role':_0x630d('0x51')};_0x2e2fc0[_0x57502d]=this[_0x630d('0xc')][_0x630d('0x37')];this[_0x630d('0x10')][_0x630d('0x53')](_0x2e2fc0)[_0x630d('0x12')](function(_0x2c82c6){_0x56fce7(null,_['isNil'](_0x2c82c6)?![]:!![]);})['catch'](function(_0x4c6c25){logger[_0x630d('0x28')](_0x4c6c25);_0x56fce7(null,![]);});};AGIVertices[_0x630d('0xe')]['agentLogin']=function(_0x171276,_0x47bc4c){var _0x3fd5a0={'role':_0x630d('0x51')};_0x3fd5a0[_0x171276]=this[_0x630d('0xc')][_0x630d('0x37')];var _0x31d51e=_0x171276!=_0x630d('0x54')?util[_0x630d('0x55')](_0x630d('0x56'),_0x630d('0x57'),this[_0x630d('0xc')][_0x630d('0x37')]):undefined;this['rpc']['agentLogin'](_0x3fd5a0,_0x31d51e)[_0x630d('0x12')](function(_0x5a55be){_0x47bc4c(null,_[_0x630d('0x43')](_0x5a55be)?![]:!![]);})[_0x630d('0x16')](function(_0x417f33){logger[_0x630d('0x28')](_0x417f33);_0x47bc4c(null,![]);});};AGIVertices[_0x630d('0xe')][_0x630d('0x58')]=function(_0x14ecb0,_0x32b824){sh[_0x630d('0x59')](_[_0x630d('0x5a')](_0x14ecb0),function(_0x228e0d,_0x5588c1){var _0x4c67ca=_0x5588c1[_0x630d('0x5b')](/(\r\n|\n|\r)/gm,'');_0x32b824(null,_0x4c67ca);});};AGIVertices['prototype'][_0x630d('0x5c')]=function(_0x1288f6,_0x4270bc){scripts[_0x630d('0x5c')](_0x1288f6[_0x630d('0x5d')],_0x1288f6[_0x630d('0x5e')]||_0x630d('0x5f'),_0x1288f6[_0x630d('0x5f')],_0x1288f6[_0x630d('0x60')]||'en-US',_0x1288f6['ssmlGender']||_0x630d('0x61'),_0x1288f6['audioEncoding']||'MP3')[_0x630d('0x12')](function(_0x5894f9){_0x4270bc(null,_0x5894f9);})['catch'](function(_0x5cac15){_0x4270bc(_0x5cac15);});};AGIVertices[_0x630d('0xe')][_0x630d('0x62')]=function(_0x3dd520,_0x489088){scripts['googleTTS'](_0x3dd520[_0x630d('0x5f')],_0x3dd520['google_tts_language']||'en',0x1)[_0x630d('0x12')](function(_0x32f4c4){_0x489088(null,_0x32f4c4);})[_0x630d('0x16')](function(_0x142aa3){_0x489088(_0x142aa3);});};AGIVertices[_0x630d('0xe')]['restAPI']=function(_0x2f09a1,_0x2d0591){var _0x200410={'uri':_0x2f09a1[_0x630d('0x63')],'method':_0x2f09a1[_0x630d('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2f09a1[_0x630d('0x65')])===_0x630d('0x66')&&parseInt(_0x2f09a1['timeout'])>=0x1?parseInt(_0x2f09a1['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x630d('0x67')]([_0x630d('0x68'),'PUT'],_0x200410[_0x630d('0x64')]['toUpperCase']())){try{_0x200410[_0x630d('0x69')]=_0x2f09a1[_0x630d('0xa')]?JSON[_0x630d('0x6a')](_0x2f09a1[_0x630d('0xa')]):{};}catch(_0x7dcfd2){logger[_0x630d('0x28')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x7dcfd2);}}try{_0x200410['headers']=_0x2f09a1[_0x630d('0x9')]?JSON[_0x630d('0x6a')](_0x2f09a1['rawHeaders']):{};}catch(_0x5b8c3a){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5b8c3a);}if(_0x2f09a1[_0x630d('0x6b')]){try{var _0x13016a=require(_0x2f09a1[_0x630d('0x6b')])['sync'](this,_0x200410);_0x200410[_0x630d('0x6c')]=Mustache[_0x630d('0x6d')](_0x2f09a1[_0x630d('0x63')],_0x13016a,{},['$$','$$']);if(_0x200410[_0x630d('0x6e')]){_0x200410[_0x630d('0x6e')]=JSON['parse'](Mustache[_0x630d('0x6d')](JSON[_0x630d('0x6f')](_0x200410[_0x630d('0x6e')]),_0x13016a,{},['$$','$$']));}if(_0x200410[_0x630d('0x69')]){_0x200410[_0x630d('0x69')]=JSON[_0x630d('0x6a')](Mustache['render'](JSON[_0x630d('0x6f')](_0x200410[_0x630d('0x69')]),_0x13016a,{},['$$','$$']));}}catch(_0x21b516){logger[_0x630d('0x28')](_0x630d('0x70'),_0x21b516);}}rp(_0x200410)['then'](function(_0x327aba){var _0x4e3d6c={'statusCode':_0x327aba[_0x630d('0x71')]||0xc8,'statusMessage':_0x327aba[_0x630d('0x72')]||'OK','headers':_0x327aba[_0x630d('0x6e')]||{},'body':_0x327aba[_0x630d('0x69')]||{}};_0x2d0591(null,_0x4e3d6c);})[_0x630d('0x16')](function(_0xaa4466){var _0xb17672={'statusCode':_0xaa4466[_0x630d('0x71')]||0x1f4,'statusMessage':_0xaa4466[_0x630d('0x73')]||_0x630d('0x74'),'headers':_0xaa4466[_0x630d('0x75')][_0x630d('0x6e')]||{},'body':_0xaa4466[_0x630d('0x75')]['body']||{}};_0x2d0591(null,_0xb17672);});};AGIVertices[_0x630d('0xe')][_0x630d('0x76')]=function(_0xa367de,_0x275fe9){scripts['googleDialogflow'](this[_0x630d('0xc')][_0x630d('0x34')],_0xa367de['key'],_0xa367de[_0x630d('0x5f')],_0xa367de[_0x630d('0x77')]||'en')[_0x630d('0x12')](function(_0x23441d){_0x275fe9(null,_0x23441d);})[_0x630d('0x16')](function(_0x1e5898){_0x275fe9(_0x1e5898);});};AGIVertices[_0x630d('0xe')][_0x630d('0x78')]=function(_0x254676,_0x38068f){scripts[_0x630d('0x78')](this[_0x630d('0xc')][_0x630d('0x34')],_0x254676[_0x630d('0x79')],_0x254676[_0x630d('0x7a')],_0x254676[_0x630d('0x7b')],_0x254676[_0x630d('0x5f')],_0x254676[_0x630d('0x7c')]||'en')[_0x630d('0x12')](function(_0x3ee162){_0x38068f(null,_0x3ee162);})['catch'](function(_0x1f6e66){_0x38068f(_0x1f6e66);});};AGIVertices[_0x630d('0xe')][_0x630d('0x7d')]=function(_0x31e2b8,_0x3e015e){scripts[_0x630d('0x7d')](this[_0x630d('0xc')],_0x31e2b8)[_0x630d('0x12')](function(_0x32e12d){_0x3e015e(null,_0x32e12d);})[_0x630d('0x16')](function(_0x41cfa7){_0x3e015e(_0x41cfa7);});};AGIVertices[_0x630d('0xe')][_0x630d('0x7e')]=function(_0x4d36d2,_0x3dc523){scripts[_0x630d('0x7e')](_0x4d36d2[_0x630d('0x7f')],_0x4d36d2[_0x630d('0x5f')],_0x4d36d2[_0x630d('0x80')]||'en-US',_0x4d36d2['speed'])[_0x630d('0x12')](function(_0x1f3529){_0x3dc523(null,_0x1f3529);})[_0x630d('0x16')](function(_0x322e5e){_0x3dc523(_0x322e5e);});};AGIVertices[_0x630d('0xe')][_0x630d('0x81')]=function(_0x4d88cd,_0xc7c2c1,_0x3cd911){scripts['ispeechASR'](_0xc7c2c1,_0x4d88cd[_0x630d('0x7f')],_0x4d88cd['ispeech_asr_language']||_0x630d('0x82'),this[_0x630d('0x83')](_0x4d88cd[_0x630d('0x84')])?_0x4d88cd[_0x630d('0x84')]:undefined)[_0x630d('0x12')](function(_0x4e7c24){_0x3cd911(null,_0x4e7c24);})[_0x630d('0x16')](function(_0x25c5e6){_0x3cd911(_0x25c5e6);});};AGIVertices[_0x630d('0xe')][_0x630d('0x85')]=function(_0x2c2ba0,_0x110581){scripts[_0x630d('0x85')](_0x2c2ba0['aws_access_key_id'],_0x2c2ba0[_0x630d('0x86')],_0x2c2ba0[_0x630d('0x87')],_0x2c2ba0[_0x630d('0x88')]||'Amy',_0x2c2ba0['text'],_0x2c2ba0[_0x630d('0x89')]||'text')[_0x630d('0x12')](function(_0x1a2247){_0x110581(null,_0x1a2247);})[_0x630d('0x16')](function(_0x3f12a7){_0x110581(_0x3f12a7);});};AGIVertices['prototype'][_0x630d('0x8a')]=function(_0x12f849,_0x11f412){scripts['awsLex'](this[_0x630d('0xc')][_0x630d('0x34')],_0x12f849[_0x630d('0x8b')],_0x12f849['aws_secret_access_key'],_0x12f849['aws_lex_region'],_0x12f849[_0x630d('0x5f')],_0x12f849[_0x630d('0x8c')])[_0x630d('0x12')](function(_0x26447e){_0x11f412(null,_0x26447e);})[_0x630d('0x16')](function(_0x408c64){_0x11f412(_0x408c64);});};AGIVertices[_0x630d('0xe')][_0x630d('0x8d')]=function(_0x2500fe,_0x267bc3,_0x4661d3){scripts[_0x630d('0x8d')](_0x267bc3,_0x2500fe[_0x630d('0x7f')],_0x2500fe['google_asr_language']||_0x630d('0x82'))[_0x630d('0x12')](function(_0x3c6e2e){_0x4661d3(null,_0x3c6e2e);})[_0x630d('0x16')](function(_0x553700){_0x4661d3(_0x553700);});};AGIVertices[_0x630d('0xe')][_0x630d('0x8e')]=function(_0x2bd943,_0x10f367,_0xbba2cc){scripts[_0x630d('0x8e')](_0x10f367,_0x2bd943[_0x630d('0x8f')],_0x2bd943[_0x630d('0x90')],_0x2bd943[_0x630d('0x6c')])['then'](function(_0x324d85){_0xbba2cc(null,_0x324d85);})[_0x630d('0x16')](function(_0x3950e3){_0xbba2cc(_0x3950e3);});};AGIVertices[_0x630d('0xe')][_0x630d('0x91')]=function(_0x3a895c){var _0x4ba2e5=_[_0x630d('0x67')](verticesWithRetry,_0x3a895c[_0x630d('0x35')])?_0x3a895c:_[_0x630d('0x92')](_0x3a895c);for(var _0x3e8471 in _0x4ba2e5){if(_0x4ba2e5[_0x630d('0x93')](_0x3e8471)){if(_0x4ba2e5[_0x3e8471]&&_['isString'](_0x4ba2e5[_0x3e8471])){if(_[_0x630d('0x67')](recursiveMapAttributes,_0x3e8471)){_0x4ba2e5[_0x3e8471]=this[_0x630d('0x94')](_0x4ba2e5[_0x3e8471]);}else{_0x4ba2e5[_0x3e8471]=this[_0x630d('0x95')](_0x4ba2e5[_0x3e8471]);}}}}return _0x4ba2e5;};AGIVertices['prototype'][_0x630d('0x96')]=function(_0x2f2629){for(var _0x4a0086 in _0x2f2629){if(_0x2f2629['hasOwnProperty'](_0x4a0086)){if(_[_0x630d('0x97')](_0x2f2629[_0x4a0086])){this['recursiveNodeIndex'](_0x2f2629[_0x4a0086]);}else if(_[_0x630d('0x98')](_0x2f2629[_0x4a0086])){for(var _0x5bccb0=0x0;_0x5bccb0<_0x2f2629[_0x4a0086][_0x630d('0x99')];_0x5bccb0++){this[_0x630d('0x96')](_0x2f2629[_0x4a0086][_0x5bccb0]);}}else if(_[_0x630d('0x9a')](_0x2f2629[_0x4a0086])){_0x2f2629[_0x4a0086]=this[_0x630d('0x95')](_0x2f2629[_0x4a0086]);}}}};AGIVertices[_0x630d('0xe')]['saveRestApiResult']=function(_0x4a6163,_0x34d3a3){for(var _0x119a59 in _0x4a6163){if(_0x4a6163[_0x630d('0x93')](_0x119a59)){if(_[_0x630d('0x97')](_0x4a6163[_0x119a59])){if(!_['isEmpty'](_0x4a6163[_0x119a59])){this[_0x630d('0x9b')](_0x4a6163[_0x119a59],util[_0x630d('0x55')](_0x630d('0x9c'),_0x34d3a3,_0x119a59));}}else if(_['isArray'](_0x4a6163[_0x119a59])){for(var _0x41c901=0x0;_0x41c901<_0x4a6163[_0x119a59]['length'];_0x41c901++){this[_0x630d('0x9b')](_0x4a6163[_0x119a59][_0x41c901],util['format'](_0x630d('0x9c'),_0x34d3a3,_0x119a59+'['+_0x41c901+']'));}}else{if(!_[_0x630d('0x43')](_0x4a6163[_0x119a59])){this['channel'][_0x630d('0x9d')](util[_0x630d('0x55')](_0x630d('0x9c'),_0x34d3a3,_0x119a59),_0x4a6163[_0x119a59]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x24b21f){try{var _0x462bec=JSON[_0x630d('0x6a')](_0x24b21f);this[_0x630d('0x96')](_0x462bec);return JSON[_0x630d('0x6f')](_0x462bec);}catch(_0x29c37d){return this['replaceAllVariables'](_0x24b21f);}};AGIVertices['prototype'][_0x630d('0x95')]=function(_0x259249){var _0x14b140=_0x259249[_0x630d('0x9e')]('{');for(var _0x1915c8=0x1;_0x1915c8<_0x14b140[_0x630d('0x99')];_0x1915c8+=0x1){var _0x4e71a4=_0x14b140[_0x1915c8]['split']('}');if(_0x4e71a4[_0x630d('0x99')]>0x1){_0x259249=_0x259249[_0x630d('0x9f')]('{'+_0x4e71a4[0x0]+'}',this[_0x630d('0xc')]['getVariable'](_0x4e71a4[0x0])[_0x630d('0xa0')]||_0x4e71a4[0x0]);}}if(_0x14b140['length']===0x1){return _0x259249['toString']();}return this[_0x630d('0x95')](_0x259249);};AGIVertices[_0x630d('0xe')][_0x630d('0xa1')]=function(_0x508f27,_0x540a88){var _0x5d43d6=this[_0x630d('0xc')]['getVariable'](_0x508f27);if(_0x5d43d6[_0x630d('0xa2')]===-0x1){return _0x5d43d6;}logger['info'](util[_0x630d('0x55')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x540a88,_0x5d43d6[_0x630d('0xa0')]));return this[_0x630d('0xc')]['setVariable'](_0x540a88,_0x5d43d6[_0x630d('0xa0')]);};AGIVertices[_0x630d('0xe')][_0x630d('0x83')]=function(_0x5ce703){return _0x5ce703&&_0x5ce703!=='0'&&_0x5ce703!=='-1'&&_0x5ce703!=='';};AGIVertices[_0x630d('0xe')][_0x630d('0xa3')]=function(_0x2ae422){this[_0x630d('0x33')][_0x630d('0xa4')](this,_0x2ae422,'-');_0x2ae422['retry']=_0x2ae422['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x630d('0xe')]['mrcpsynth']=function(_0x13fc52){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0xa5'),_0x13fc52['label']));if(!this[_0x630d('0x83')](_0x13fc52[_0x630d('0x5f')])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0xa7'));}var _0x2f0f85='\x22'+_0x13fc52[_0x630d('0x5f')]+'\x22';if(this[_0x630d('0x83')](_0x13fc52[_0x630d('0x75')])){_0x2f0f85+=','+_0x13fc52[_0x630d('0x75')];}var _0x333a22=this[_0x630d('0xc')][_0x630d('0x59')](_0x630d('0xa8'),_0x2f0f85);if(_0x333a22[_0x630d('0xa2')]===-0x1){return _0x333a22;}return this[_0x630d('0xc')]['noop'](util[_0x630d('0x55')](_0x630d('0xa9'),_0x2f0f85));};AGIVertices['prototype'][_0x630d('0xaa')]=function(_0x4b5ae9){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0xab'),_0x4b5ae9[_0x630d('0xac')]));if(!this['isConfigured'](_0x4b5ae9['grammar'])){return this['channel'][_0x630d('0xa6')](_0x630d('0xad'));}var _0x351eb6=_0x4b5ae9[_0x630d('0xae')];if(this['isConfigured'](_0x4b5ae9[_0x630d('0x75')])){_0x351eb6+=','+_0x4b5ae9[_0x630d('0x75')];}var _0x300111=this[_0x630d('0xc')][_0x630d('0x59')](_0x630d('0xaf'),_0x351eb6);if(_0x300111[_0x630d('0xa2')]===-0x1){return _0x300111;}var _0x17c84f=this[_0x630d('0xa1')]('RECOG_CONFIDENCE()',_0x630d('0xb0'));if(_0x17c84f[_0x630d('0xa2')]===-0x1){return _0x17c84f;}var _0x279688=this[_0x630d('0xa1')](_0x630d('0xb1'),_0x630d('0xb2'));if(_0x279688['result']===-0x1){return _0x279688;}var _0x2a2a37=this[_0x630d('0xa1')](_0x630d('0xb3'),_0x630d('0xb4'));if(_0x2a2a37[_0x630d('0xa2')]===-0x1){return _0x2a2a37;}return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0xb5'),_0x351eb6));};AGIVertices[_0x630d('0xe')][_0x630d('0xb6')]=function(_0x36dc03){logger['info'](util[_0x630d('0x55')](_0x630d('0xb7'),_0x36dc03[_0x630d('0xac')]));return this[_0x630d('0xc')][_0x630d('0xb6')]([_0x36dc03['command'],_0x36dc03[_0x630d('0xb8')]]);};AGIVertices[_0x630d('0xe')][_0x630d('0xb9')]=function(_0x17b26){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0xba'),_0x17b26[_0x630d('0xac')]));if(this[_0x630d('0x83')](_0x17b26[_0x630d('0x65')])){logger[_0x630d('0x2c')](util[_0x630d('0x55')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x17b26[_0x630d('0x65')]));var _0x42be52=this['channel'][_0x630d('0xbb')](_0x17b26[_0x630d('0x65')]);if(_0x42be52[_0x630d('0xa2')]===-0x1){return _0x42be52;}}return this['channel'][_0x630d('0xb9')]();};AGIVertices[_0x630d('0xe')][_0x630d('0x4a')]=function(_0x52e091){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0xbc'),_0x52e091[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0x52e091[_0x630d('0x48')])){return this['channel'][_0x630d('0x28')](_0x52e091,_0x630d('0xbd'));}_0x52e091['scheduledAt']=moment();if(this['isConfigured'](_0x52e091[_0x630d('0xbe')])){_0x52e091[_0x630d('0x49')]=moment()[_0x630d('0xbf')](_0x52e091[_0x630d('0xbe')],_0x630d('0xc0'));}if(!this[_0x630d('0x83')](_0x52e091[_0x630d('0x4d')])){_0x52e091[_0x630d('0x4d')]=0x2;}this[_0x630d('0x41')][_0x630d('0xa4')](this,_0x52e091);return this['channel'][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0xc1'),_0x52e091[_0x630d('0x47')],_0x52e091['list_id'],_0x52e091[_0x630d('0x49')]));};AGIVertices[_0x630d('0xe')][_0x630d('0xc2')]=function(_0x533e21){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0xc3'),_0x533e21['label']));var _0x2f7649=this['channel'][_0x630d('0x59')](_0x533e21[_0x630d('0xc4')],_0x533e21[_0x630d('0x75')]);if(_0x2f7649[_0x630d('0xa2')]===-0x1){return _0x2f7649;}return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')]('Executed\x20command\x20%s\x20%s',_0x533e21[_0x630d('0xc4')],_0x533e21['options']));};AGIVertices['prototype']['lumenvoxtts']=function(_0xdc174d){logger[_0x630d('0x2c')](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0xdc174d['label']));if(!this['isConfigured'](_0xdc174d[_0x630d('0x5f')])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0xa7'));}var _0x5c6c94='\x22'+_0xdc174d[_0x630d('0x5f')]+'\x22';if(this[_0x630d('0x83')](_0xdc174d[_0x630d('0x75')])){_0x5c6c94+=','+_0xdc174d[_0x630d('0x75')];}var _0x22f174=this[_0x630d('0xc')][_0x630d('0x59')](_0x630d('0xa8'),_0x5c6c94);if(_0x22f174[_0x630d('0xa2')]===-0x1){return _0x22f174;}return this[_0x630d('0xc')]['noop'](util[_0x630d('0x55')](_0x630d('0xa9'),_0x5c6c94));};AGIVertices[_0x630d('0xe')]['sestektts']=function(_0x388d94){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0xc5'),_0x388d94['label']));if(!this[_0x630d('0x83')](_0x388d94[_0x630d('0x5f')])){return this[_0x630d('0xc')]['noop'](_0x630d('0xa7'));}var _0x5c3533='\x22'+_0x388d94[_0x630d('0x5f')]+'\x22';if(this[_0x630d('0x83')](_0x388d94[_0x630d('0x75')])){_0x5c3533+=','+_0x388d94[_0x630d('0x75')];}var _0xfe1fef=this[_0x630d('0xc')][_0x630d('0x59')](_0x630d('0xa8'),_0x5c3533);if(_0xfe1fef[_0x630d('0xa2')]===-0x1){return _0xfe1fef;}return this[_0x630d('0xc')]['noop'](util[_0x630d('0x55')](_0x630d('0xa9'),_0x5c3533));};AGIVertices[_0x630d('0xe')][_0x630d('0xc6')]=function(_0x2e8d83){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0xc7'),_0x2e8d83[_0x630d('0xac')]));if(!this['isConfigured'](_0x2e8d83[_0x630d('0xae')])){return this['channel'][_0x630d('0xa6')]('no\x20grammar\x20configured');}var _0x27c11e=_0x2e8d83[_0x630d('0xae')];if(this[_0x630d('0x83')](_0x2e8d83['options'])){_0x27c11e+=','+_0x2e8d83[_0x630d('0x75')];}var _0xd0587c=this[_0x630d('0xc')]['exec'](_0x630d('0xaf'),_0x27c11e);if(_0xd0587c[_0x630d('0xa2')]===-0x1){return _0xd0587c;}var _0x292bff=this['getAndSetVariable'](_0x630d('0xc8'),_0x630d('0xc9'));if(_0x292bff[_0x630d('0xa2')]===-0x1){return _0x292bff;}var _0x3caadf=this['getAndSetVariable'](_0x630d('0xb1'),_0x630d('0xca'));if(_0x3caadf[_0x630d('0xa2')]===-0x1){return _0x3caadf;}var _0x387af6=this['getAndSetVariable'](_0x630d('0xb3'),_0x630d('0xcb'));if(_0x387af6[_0x630d('0xa2')]===-0x1){return _0x387af6;}return this['channel'][_0x630d('0xa6')](util[_0x630d('0x55')]('Executed\x20command\x20MRCPRecog\x20%s',_0x27c11e));};AGIVertices[_0x630d('0xe')][_0x630d('0xcc')]=function(_0x41d8e6){logger[_0x630d('0x2c')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x41d8e6[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0x41d8e6['grammar'])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0xad'));}var _0xe9490c=_0x41d8e6[_0x630d('0xae')];if(this[_0x630d('0x83')](_0x41d8e6[_0x630d('0x75')])){_0xe9490c+=','+_0x41d8e6['options'];}var _0x3df328=this[_0x630d('0xc')][_0x630d('0x59')]('MRCPRecog',_0xe9490c);if(_0x3df328[_0x630d('0xa2')]===-0x1){return _0x3df328;}var _0x3fd5a2=this[_0x630d('0xa1')](_0x630d('0xc8'),'SESTEK_ASR_CONFIDENCE');if(_0x3fd5a2['result']===-0x1){return _0x3fd5a2;}var _0x37fb26=this['getAndSetVariable']('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x37fb26['result']===-0x1){return _0x37fb26;}var _0x45439d=this['getAndSetVariable'](_0x630d('0xb3'),'SESTEK_ASR_INSTANCE');if(_0x45439d[_0x630d('0xa2')]===-0x1){return _0x45439d;}return this[_0x630d('0xc')]['noop'](util['format'](_0x630d('0xb5'),_0xe9490c));};AGIVertices[_0x630d('0xe')][_0x630d('0xcd')]=function(_0x345886){logger[_0x630d('0x2c')](util['format'](_0x630d('0xce'),_0x345886['label']));if(!this[_0x630d('0x83')](_0x345886[_0x630d('0xcf')])){return this[_0x630d('0xc')][_0x630d('0x28')](_0x345886,_0x630d('0xd0'));}var _0x4d4848=this[_0x630d('0xd1')][_0x630d('0xa4')](this,_0x345886[_0x630d('0xcf')]);if(!_0x4d4848){return this['channel'][_0x630d('0x28')](_0x345886,'no\x20odbc\x20database\x20found');}if(!this[_0x630d('0x83')](_0x345886[_0x630d('0x2b')])){return this[_0x630d('0xc')][_0x630d('0x28')](_0x345886,_0x630d('0xd2'));}var _0x6f2d81=_0x345886[_0x630d('0x2b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x630d('0xc')]['noop'](util[_0x630d('0x55')](_0x630d('0xd3'),_0x6f2d81));var _0x76e33d=this[_0x630d('0x26')][_0x630d('0xa4')](this,_0x4d4848,_0x6f2d81);this[_0x630d('0x33')][_0x630d('0xa4')](this,_0x345886,_0x6f2d81);if(!this[_0x630d('0x83')](_0x345886['variable_id'])){return this['channel']['noop'](_0x630d('0xd4'));}var _0x32b3e9=this[_0x630d('0xf')]['sync'](this,_0x345886[_0x630d('0xd5')]);if(!_0x32b3e9){return this[_0x630d('0xc')][_0x630d('0x28')](_0x345886,'no\x20variable\x20found');}var _0x406954=this;_0x76e33d[_0x630d('0xd6')](function(_0x5d8ba5,_0x4fd32){Object[_0x630d('0xd7')](_0x5d8ba5)['forEach'](function(_0x208823){_0x406954['channel'][_0x630d('0x9d')](util[_0x630d('0x55')](_0x630d('0xd8'),_0x32b3e9,_0x4fd32,_0x208823),_0x5d8ba5[_0x208823]);});});this[_0x630d('0xc')][_0x630d('0x9d')](util[_0x630d('0x55')](_0x630d('0xd9'),_0x32b3e9),_0x76e33d[_0x630d('0x99')]);return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0xda'),_0x32b3e9));};AGIVertices[_0x630d('0xe')][_0x630d('0xdb')]=function(_0x2cd044){logger[_0x630d('0xdc')](util[_0x630d('0x55')](_0x630d('0xdd'),_0x2cd044['label']));if(!this[_0x630d('0x83')](_0x2cd044[_0x630d('0xde')])){return this[_0x630d('0xc')][_0x630d('0x28')](_0x2cd044,_0x630d('0xdf'));}var _0xa24d6e=this[_0x630d('0x19')][_0x630d('0xa4')](this,_0x2cd044[_0x630d('0xde')]);if(!_0xa24d6e){return this[_0x630d('0xc')][_0x630d('0x28')](_0x2cd044,_0x630d('0xe0'));}var _0x568899=this[_0x630d('0xc')][_0x630d('0x59')](_0x630d('0xe1'),[util[_0x630d('0x55')](_0x630d('0xe2'),_0xa24d6e),_0x2cd044[_0x630d('0x65')],_0x2cd044['opts'],_0x2cd044[_0x630d('0x63')]]);if(_0x568899[_0x630d('0xa2')]===-0x1){return _0x568899;}return this['channel'][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0xe3'),_0x630d('0xe1')));};AGIVertices[_0x630d('0xe')][_0x630d('0xe4')]=function(_0x1c2941){logger[_0x630d('0x2c')](util['format'](_0x630d('0xe5'),_0x1c2941[_0x630d('0xac')]));if(!this['isConfigured'](_0x1c2941[_0x630d('0x7f')])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0xe6'));}if(!this[_0x630d('0x83')](_0x1c2941[_0x630d('0x5f')])){return this['channel'][_0x630d('0xa6')](_0x630d('0xa7'));}this[_0x630d('0xc')]['bot']=!![];this[_0x630d('0x33')](_0x1c2941);this['createSquareMessage'](_0x1c2941[_0x630d('0x5f')],'in','','');this[_0x630d('0xc')]['noop'](util[_0x630d('0x55')](_0x630d('0xe7'),_0x1c2941[_0x630d('0x5f')]));var _0x456817=this['googleDialogflow']['sync'](this,_0x1c2941);if(_0x456817){for(var _0x455de2 in _0x456817){if(_0x456817[_0x630d('0x93')](_0x455de2)){this[_0x630d('0xc')][_0x630d('0x9d')](util[_0x630d('0x55')](_0x630d('0xe8'),_0x455de2['toUpperCase']()),_0x456817[_0x455de2]);}}this[_0x630d('0x40')](_0x456817[_0x630d('0xe9')],_0x630d('0xea'),_0x630d('0xe4'),'');return this[_0x630d('0xc')][_0x630d('0xa6')](util['format'](_0x630d('0xeb'),_0x456817[_0x630d('0xe9')]));}return this[_0x630d('0xc')]['error'](_0x1c2941,_0x630d('0xec'));};AGIVertices[_0x630d('0xe')]['dialogflowV2']=function(_0x1fcead){logger[_0x630d('0x2c')](util['format'](_0x630d('0xed'),_0x1fcead[_0x630d('0xac')]));if(!this['isConfigured'](_0x1fcead[_0x630d('0x79')])){return this[_0x630d('0xc')]['noop'](_0x630d('0xee'));}if(!this['isConfigured'](_0x1fcead['client_email'])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0xef'));}if(!this[_0x630d('0x83')](_0x1fcead[_0x630d('0x7b')])){return this[_0x630d('0xc')][_0x630d('0xa6')]('no\x20private_key\x20configured');}if(!this[_0x630d('0x83')](_0x1fcead[_0x630d('0x7c')])){return this['channel'][_0x630d('0xa6')](_0x630d('0xf0'));}if(!this[_0x630d('0x83')](_0x1fcead[_0x630d('0x5f')])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0xa7'));}this['channel'][_0x630d('0xf1')]=!![];this[_0x630d('0x33')](_0x1fcead);this[_0x630d('0x40')](_0x1fcead[_0x630d('0x5f')],'in','','');this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0xf2'),_0x1fcead['text']));var _0x211169=this[_0x630d('0x78')][_0x630d('0xa4')](this,_0x1fcead);if(_0x211169){for(var _0x38e7f3 in _0x211169){if(_0x211169[_0x630d('0x93')](_0x38e7f3)){if(_0x38e7f3!=='providerResponse'){this['channel'][_0x630d('0x9d')](util['format']('DIALOGFLOW_%s',_0x38e7f3['toUpperCase']()),_0x211169[_0x38e7f3]);}}}this[_0x630d('0x40')](_0x211169[_0x630d('0xe9')],_0x630d('0xea'),'dialogflowV2',_0x211169[_0x630d('0xf3')]);return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')]('DialogflowV2\x20Result\x20%s',_0x211169[_0x630d('0xe9')]));}return this[_0x630d('0xc')]['error'](_0x1fcead,_0x630d('0xf4'));};AGIVertices[_0x630d('0xe')][_0x630d('0xf5')]=function(_0xcf1641){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0xf6'),_0xcf1641[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0xcf1641['ndauth_url'])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0xf7'));}if(!this[_0x630d('0x83')](_0xcf1641[_0x630d('0xf8')])){return this['channel'][_0x630d('0xa6')](_0x630d('0xf9'));}if(!this[_0x630d('0x83')](_0xcf1641[_0x630d('0xfa')])){return this['channel'][_0x630d('0xa6')](_0x630d('0xfb'));}if(!this[_0x630d('0x83')](_0xcf1641['ndassistant_url'])){return this[_0x630d('0xc')]['noop'](_0x630d('0xa7'));}this[_0x630d('0xc')][_0x630d('0xf1')]=!![];this[_0x630d('0x33')](_0xcf1641);this['createSquareMessage'](_0xcf1641[_0x630d('0x5f')],'in','','');this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')]('Trying\x20SestekNDA:\x20%s',_0xcf1641[_0x630d('0x5f')]));var _0x116422=this[_0x630d('0x7d')][_0x630d('0xa4')](this,_0xcf1641);if(_0x116422){for(var _0x49bd06 in _0x116422){if(_0x116422[_0x630d('0x93')](_0x49bd06)){this[_0x630d('0xc')][_0x630d('0x9d')](util[_0x630d('0x55')](_0x630d('0xfc'),_0x49bd06['toUpperCase']()),_0x116422[_0x49bd06]);}}this['createSquareMessage'](_0x116422[_0x630d('0xe9')],_0x630d('0xea'),'sesteknda','');if(_0x116422[_0x630d('0xfd')]){this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0xfe'),_0x116422[_0x630d('0xfd')]));var _0x174885=this['channel']['streamFile'](_0x116422[_0x630d('0xfd')]);try{fs[_0x630d('0xff')](_0x116422[_0x630d('0xfd')]+'.wav');}catch(_0x58c6dc){logger[_0x630d('0x28')](_0x58c6dc);}return _0x174885;}else{return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x100'),_0x116422['speech']));}}return this[_0x630d('0xc')][_0x630d('0x28')](_0xcf1641,_0x630d('0x101'));};AGIVertices[_0x630d('0xe')]['end']=function(_0x2e96e5){logger[_0x630d('0x2c')](util['format'](_0x630d('0x102'),_0x2e96e5[_0x630d('0xac')]));return this[_0x630d('0xc')][_0x630d('0xa6')]('end');};AGIVertices[_0x630d('0xe')]['ext_dial']=function(_0x3cbbfb){logger['info'](util[_0x630d('0x55')](_0x630d('0x103'),_0x3cbbfb[_0x630d('0xac')]));var _0x508ea6='';if(_0x3cbbfb[_0x630d('0x104')]){if(!this['isConfigured'](_0x3cbbfb[_0x630d('0x104')])){return this[_0x630d('0xc')]['error'](_0x3cbbfb,'no\x20trunk\x20selected');}else{var _0x5bc824=parseInt(_0x3cbbfb[_0x630d('0x104')],0xa);if(isNaN(_0x5bc824)){_0x508ea6=_0x3cbbfb['trunk_id'];}else{_0x508ea6=this[_0x630d('0x1b')][_0x630d('0xa4')](this,_0x3cbbfb[_0x630d('0x104')]);if(!_0x508ea6){return this[_0x630d('0xc')][_0x630d('0x28')](_0x3cbbfb,_0x630d('0x105'));}}}}else if(_0x3cbbfb[_0x630d('0x106')]){_0x508ea6=_0x3cbbfb[_0x630d('0x106')];}else{return this['channel']['error'](_0x3cbbfb,'no\x20trunk\x20selected');}var _0x3a668d=this[_0x630d('0xc')][_0x630d('0x59')](_0x630d('0xe1'),[util[_0x630d('0x55')](_0x630d('0x107'),_0x508ea6,_0x3cbbfb[_0x630d('0x47')]),_0x3cbbfb[_0x630d('0x65')],_0x3cbbfb[_0x630d('0x108')],_0x3cbbfb[_0x630d('0x63')]]);if(_0x3a668d[_0x630d('0xa2')]===-0x1){return _0x3a668d;}return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0xe3'),_0x630d('0xe1')));};AGIVertices[_0x630d('0xe')][_0x630d('0x109')]=function(_0x4bfe40){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x10a'),_0x4bfe40[_0x630d('0xac')]));return this['channel'][_0x630d('0xa6')](_0x630d('0x109'));};AGIVertices['prototype'][_0x630d('0x10b')]=function(_0x3f54f1){logger[_0x630d('0x2c')](util[_0x630d('0x55')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3f54f1[_0x630d('0xac')]));if(_0x3f54f1['retry']===0x0){return this[_0x630d('0xa3')](_0x3f54f1);}_0x3f54f1[_0x630d('0x10c')]-=0x1;if(!this[_0x630d('0x83')](_0x3f54f1['file_id'])){return this[_0x630d('0xc')][_0x630d('0x28')](_0x3f54f1,_0x630d('0x10d'));}var _0x1c90ab=this[_0x630d('0x10e')][_0x630d('0xa4')](this,_0x3f54f1[_0x630d('0x10f')]);if(!_0x1c90ab){return this['channel'][_0x630d('0x28')](_0x3f54f1,'no\x20file\x20audio\x20found');}if(!this[_0x630d('0x83')](_0x3f54f1[_0x630d('0xd5')])){return this[_0x630d('0xc')][_0x630d('0x28')](_0x630d('0xd4'));}var _0x303cfd=this[_0x630d('0xc')][_0x630d('0x110')](_0x1c90ab,_0x3f54f1[_0x630d('0x111')],_0x3f54f1[_0x630d('0x112')]);var _0x23e881=_0x303cfd['result']?_0x303cfd['result'][_0x630d('0x4c')]():'';logger[_0x630d('0x2c')](_0x630d('0x113'),JSON[_0x630d('0x6f')](_0x303cfd));if(_0x303cfd['result']===-0x1){this[_0x630d('0x33')][_0x630d('0xa4')](this,_0x3f54f1,_0x23e881);return _0x303cfd;}else if(_0x303cfd[_0x630d('0xa0')]===_0x630d('0x65')){_0x303cfd['result']=_0x23e881['length']>=parseInt(_0x3f54f1[_0x630d('0x114')])?'x':'i';}else{_0x303cfd[_0x630d('0xa2')]=_0x23e881[_0x630d('0x99')]>=parseInt(_0x3f54f1[_0x630d('0x114')])&&_0x23e881[_0x630d('0x99')]<=parseInt(_0x3f54f1[_0x630d('0x112')])?'x':'i';}var _0x407459=this[_0x630d('0xf')][_0x630d('0xa4')](this,_0x3f54f1[_0x630d('0xd5')]);if(!_0x407459){return this[_0x630d('0xc')][_0x630d('0x28')](_0x3f54f1,'no\x20variable\x20found');}this[_0x630d('0xc')][_0x630d('0x9d')](_0x407459,_0x23e881);if(this[_0x630d('0x83')](_0x3f54f1['hiddendigitsnum'])){var _0x3e241a=parseInt(_0x3f54f1['hiddendigitsnum'],0xa);var _0x2e9b29=rs['generate']({'charset':'*','length':_0x3e241a});var _0x17804c=_0x23e881[_0x630d('0x99')];if(_0x17804c>0x0){if(_0x17804c>_0x3e241a){this[_0x630d('0x33')][_0x630d('0xa4')](this,_0x3f54f1,_0x3f54f1[_0x630d('0x115')]===_0x630d('0x116')?_0x2e9b29+_0x23e881[_0x630d('0x117')](_0x3e241a):_0x23e881[_0x630d('0x117')](0x0,_0x17804c-_0x3e241a)+_0x2e9b29);}else{this['createSquareDetailsReport']['sync'](this,_0x3f54f1,rs[_0x630d('0x118')]({'charset':'*','length':_0x17804c}));}}else{this[_0x630d('0x33')][_0x630d('0xa4')](this,_0x3f54f1,'');}}else{this[_0x630d('0x33')][_0x630d('0xa4')](this,_0x3f54f1,_0x23e881);}return _0x303cfd;};AGIVertices['prototype'][_0x630d('0x119')]=function(_0x45d29f){logger[_0x630d('0x2c')](util[_0x630d('0x55')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x45d29f[_0x630d('0xac')]));return this[_0x630d('0x10b')](_0x45d29f);};AGIVertices[_0x630d('0xe')]['goal']=function(_0x3fe530){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x11a'),_0x3fe530[_0x630d('0xac')]));this[_0x630d('0x33')][_0x630d('0xa4')](this,_0x3fe530,_0x3fe530[_0x630d('0x11b')]);return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x11c'),_0x3fe530[_0x630d('0x11b')]));};AGIVertices['prototype'][_0x630d('0x11d')]=function(_0xfb3641){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x11e'),_0xfb3641['label']));if(!this[_0x630d('0x83')](_0xfb3641['aws_access_key_id'])||!this[_0x630d('0x83')](_0xfb3641['aws_secret_access_key'])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0x11f'));}if(!this[_0x630d('0x83')](_0xfb3641[_0x630d('0x5f')])){return this['channel'][_0x630d('0xa6')](_0x630d('0xa7'));}this[_0x630d('0xc')]['noop'](util[_0x630d('0x55')]('Trying\x20aws\x20Polly\x20%s',_0xfb3641[_0x630d('0x5f')]));var _0x34da4c=this[_0x630d('0x85')][_0x630d('0xa4')](this,_0xfb3641);if(_0x34da4c){this[_0x630d('0xc')][_0x630d('0xa6')](util['format'](_0x630d('0x120'),_0x34da4c));var _0x521160=this['channel'][_0x630d('0x121')](_0x34da4c);try{fs[_0x630d('0xff')](_0x34da4c+'.wav');}catch(_0xa5ee5b){logger[_0x630d('0x28')](_0xa5ee5b);}return _0x521160;}return this['channel'][_0x630d('0x28')](_0xfb3641,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x630d('0xe')]['awslex']=function(_0x5df6ab){logger['info'](util[_0x630d('0x55')](_0x630d('0x122'),_0x5df6ab[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0x5df6ab['aws_access_key_id'])||!this[_0x630d('0x83')](_0x5df6ab['aws_secret_access_key'])){return this[_0x630d('0xc')][_0x630d('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x630d('0x83')](_0x5df6ab[_0x630d('0x8c')])){return this['channel'][_0x630d('0xa6')](_0x630d('0x123'));}if(!this[_0x630d('0x83')](_0x5df6ab['text'])){return this['channel']['noop'](_0x630d('0xa7'));}this['channel']['bot']=!![];this[_0x630d('0x33')](_0x5df6ab);this[_0x630d('0x40')](_0x5df6ab['text'],'in','','');this[_0x630d('0xc')]['noop'](util[_0x630d('0x55')](_0x630d('0x124'),_0x5df6ab[_0x630d('0x5f')]));var _0x9820bb=this[_0x630d('0x8a')]['sync'](this,_0x5df6ab);if(_0x9820bb){for(var _0x43d1ad in _0x9820bb){if(_0x9820bb[_0x630d('0x93')](_0x43d1ad)&&_[_0x630d('0x9a')](_0x9820bb[_0x43d1ad])){this[_0x630d('0xc')][_0x630d('0x9d')](util[_0x630d('0x55')]('AWS_LEX_%s',_0x43d1ad[_0x630d('0x125')]()),_0x9820bb[_0x43d1ad]);}}if(_['isNil'](_0x9820bb['message'])){return this['channel'][_0x630d('0xa6')](_0x630d('0x126'));}else{this['createSquareMessage'](_0x9820bb[_0x630d('0x73')],_0x630d('0xea'),_0x630d('0x127'),'');return this[_0x630d('0xc')]['noop'](util['format'](_0x630d('0x128'),_0x9820bb[_0x630d('0x73')]));}}return this[_0x630d('0xc')]['error'](_0x5df6ab,_0x630d('0x129'));};AGIVertices[_0x630d('0xe')]['googleasr']=function(_0x4bd3c9){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x12a'),_0x4bd3c9[_0x630d('0xac')],_0x4bd3c9[_0x630d('0x65')]));if(!this['isConfigured'](_0x4bd3c9[_0x630d('0x7f')])){return this['channel'][_0x630d('0xa6')]('no\x20key\x20configured');}var _0x4cb90d=_0x630d('0x12b');var _0x1aa5d1=util[_0x630d('0x55')]('%s/recordings/%s',FILES_PATH,rs[_0x630d('0x118')](0x4));var _0x14f02a=util[_0x630d('0x55')](_0x630d('0x9c'),_0x1aa5d1,_0x4cb90d);var _0x92b909=!![];if(_0x4bd3c9['beep']===_0x630d('0x12c')){_0x92b909=![];}var _0x1b0d6e=this[_0x630d('0xc')][_0x630d('0x12d')](_0x1aa5d1,_0x4cb90d,_0x4bd3c9[_0x630d('0x12e')],_0x4bd3c9[_0x630d('0x65')],undefined,_0x92b909);if(_0x1b0d6e['result']!==-0x1){this[_0x630d('0xc')]['noop'](util[_0x630d('0x55')]('google\x20%s\x20file\x20created',_0x14f02a));var _0x5a1e2d=this[_0x630d('0x8d')]['sync'](this,_0x4bd3c9,_0x14f02a);if(_0x5a1e2d){for(var _0x32494e in _0x5a1e2d){if(_0x5a1e2d[_0x630d('0x93')](_0x32494e)){this[_0x630d('0xc')][_0x630d('0x9d')](util[_0x630d('0x55')](_0x630d('0x12f'),_0x32494e['toUpperCase']()),_0x5a1e2d[_0x32494e]);}}return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x130'),JSON['stringify'](_0x5a1e2d)));}}return _0x1b0d6e;};AGIVertices[_0x630d('0xe')]['tildeasr']=function(_0xc3867e){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x131'),_0xc3867e[_0x630d('0xac')]));if(!this['isConfigured'](_0xc3867e[_0x630d('0x8f')])){return this['channel']['noop']('no\x20appid\x20configured');}if(!this['isConfigured'](_0xc3867e['appsecret'])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0x132'));}var _0x7d5d96=_0x630d('0x12b');var _0x106f85=util[_0x630d('0x55')](_0x630d('0x133'),FILES_PATH,rs['generate'](0x4));var _0x35c18c=util[_0x630d('0x55')](_0x630d('0x9c'),_0x106f85,_0x7d5d96);var _0x2830c1=!![];if(_0xc3867e[_0x630d('0x134')]===_0x630d('0x12c')){_0x2830c1=![];}var _0x2b74c3=this[_0x630d('0xc')][_0x630d('0x12d')](_0x106f85,_0x7d5d96,_0xc3867e[_0x630d('0x12e')],_0xc3867e[_0x630d('0x65')],undefined,_0x2830c1);if(_0x2b74c3[_0x630d('0xa2')]!==-0x1){this['channel'][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x135'),_0x35c18c));var _0x2d02a4=this[_0x630d('0x8e')][_0x630d('0xa4')](this,_0xc3867e,_0x35c18c);if(_0x2d02a4){for(var _0x27de00 in _0x2d02a4){if(_0x2d02a4[_0x630d('0x93')](_0x27de00)){this[_0x630d('0xc')][_0x630d('0x9d')](util[_0x630d('0x55')](_0x630d('0x136'),_0x27de00[_0x630d('0x125')]()),_0x2d02a4[_0x27de00]);}}return this[_0x630d('0xc')]['noop'](util['format'](_0x630d('0x137'),JSON['stringify'](_0x2d02a4)));}}return _0x2b74c3;};AGIVertices['prototype'][_0x630d('0x138')]=function(_0x50feb1){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x139'),_0x50feb1['label']));return this[_0x630d('0xc')][_0x630d('0x13a')](_0x50feb1[_0x630d('0x3a')],_0x50feb1[_0x630d('0x3b')],_0x50feb1['priority']);};AGIVertices[_0x630d('0xe')][_0x630d('0x13b')]=function(_0x506ba8){logger[_0x630d('0x2c')](util['format'](_0x630d('0x13c'),_0x506ba8[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0x506ba8[_0x630d('0x13d')])){return this['channel'][_0x630d('0x28')](_0x506ba8,_0x630d('0x13e'));}try{var _0x1dc3d9=eval(_0x506ba8[_0x630d('0x13d')])?_0x630d('0x13f'):_0x630d('0x140');this[_0x630d('0xc')]['noop'](util['format'](_0x630d('0x141'),_0x506ba8[_0x630d('0x13d')],_0x1dc3d9));return{'code':0xc8,'result':_0x1dc3d9};}catch(_0x18f010){return{'code':0xc8,'result':_0x630d('0x140')};}};AGIVertices[_0x630d('0xe')]['gotoiftime']=function(_0x445453){logger['info'](util[_0x630d('0x55')](_0x630d('0x142'),_0x445453[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0x445453['interval_id'])){return this[_0x630d('0xc')][_0x630d('0x28')](_0x445453,_0x630d('0x143'));}var _0x82d8c5=this[_0x630d('0x144')][_0x630d('0xa4')](this,_0x445453[_0x630d('0x145')]);if(!_0x82d8c5){return this[_0x630d('0xc')][_0x630d('0x28')](_0x445453,'no\x20intervals\x20found');}for(var _0x39725b=0x0;_0x39725b<_0x82d8c5[_0x630d('0x99')];_0x39725b+=0x1){var _0x4c5118=this[_0x630d('0xc')]['getVariable'](util[_0x630d('0x55')](_0x630d('0x146'),_0x82d8c5[_0x39725b]));if(_0x4c5118[_0x630d('0xa2')]===-0x1){return _0x4c5118;}logger[_0x630d('0x2c')](util['format'](_0x630d('0x147'),_0x82d8c5[_0x39725b],_0x4c5118[_0x630d('0xa0')]));if(_0x4c5118['extra']===_0x630d('0x13f')){logger[_0x630d('0x2c')](util[_0x630d('0x55')]('IFTIME\x20%s\x20%s',_0x82d8c5[_0x39725b],'true'));this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x147'),_0x82d8c5[_0x39725b],_0x630d('0x13f')));return{'code':0xc8,'result':_0x630d('0x13f')};}else{logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x147'),_0x82d8c5[_0x39725b],_0x630d('0x140')));this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x147'),_0x82d8c5[_0x39725b],_0x630d('0x140')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x630d('0xe')][_0x630d('0x148')]=function(_0x4f54a9){logger[_0x630d('0x2c')](util[_0x630d('0x55')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x4f54a9[_0x630d('0xac')]));return this[_0x630d('0xc')]['hangup']();};AGIVertices[_0x630d('0xe')][_0x630d('0x149')]=function(_0x1c594c){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x14a'),_0x1c594c['label']));if(!this['isConfigured'](_0x1c594c[_0x630d('0x7f')])){return this[_0x630d('0xc')][_0x630d('0xa6')]('no\x20key\x20configured');}var _0x285d00='wav';var _0x2d23ef=util[_0x630d('0x55')]('%s/recordings/%s',FILES_PATH,rs[_0x630d('0x118')](0x4));var _0x2b4b85=util[_0x630d('0x55')](_0x630d('0x9c'),_0x2d23ef,_0x285d00);var _0x16d933=!![];if(_0x1c594c[_0x630d('0x134')]===_0x630d('0x12c')){_0x16d933=![];}var _0x154b60=this['channel']['recordFile'](_0x2d23ef,_0x285d00,_0x1c594c['intKey'],_0x1c594c[_0x630d('0x65')],undefined,_0x16d933);if(_0x154b60['result']!==-0x1){this[_0x630d('0xc')]['noop'](util['format'](_0x630d('0x14b'),_0x2b4b85));var _0x1865b2=this[_0x630d('0x81')]['sync'](this,_0x1c594c,_0x2b4b85);if(_0x1865b2){for(var _0xea80f4 in _0x1865b2){if(_0x1865b2[_0x630d('0x93')](_0xea80f4)){this[_0x630d('0xc')]['setVariable'](util[_0x630d('0x55')](_0x630d('0x14c'),_0xea80f4[_0x630d('0x125')]()),_0x1865b2[_0xea80f4]);}}return this[_0x630d('0xc')][_0x630d('0xa6')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x630d('0x6f')](_0x1865b2)));}}return _0x154b60;};AGIVertices[_0x630d('0xe')][_0x630d('0x14d')]=function(_0x1c988f){logger['info'](util[_0x630d('0x55')](_0x630d('0x14e'),_0x1c988f['label']));if(!this[_0x630d('0x83')](_0x1c988f[_0x630d('0x7f')])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0xe6'));}if(!this['isConfigured'](_0x1c988f[_0x630d('0x5f')])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0xa7'));}this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x14f'),_0x1c988f['text']));var _0x196ba9=this[_0x630d('0x7e')][_0x630d('0xa4')](this,_0x1c988f);if(_0x196ba9){this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x14b'),_0x196ba9));var _0x4c84ae=this[_0x630d('0xc')][_0x630d('0x121')](_0x196ba9,_0x1c988f['intKey']);try{fs[_0x630d('0xff')](_0x196ba9+'.wav');}catch(_0x4f447a){logger[_0x630d('0x28')](_0x4f447a);}return _0x4c84ae;}return this[_0x630d('0xc')][_0x630d('0x28')](_0x1c988f,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x630d('0xe')]['login']=function(_0x2ec179){logger[_0x630d('0x2c')](util['format'](_0x630d('0x150'),_0x2ec179[_0x630d('0xac')]));if(!this['isConfigured'](_0x2ec179[_0x630d('0x151')])){return this[_0x630d('0xc')][_0x630d('0x28')](_0x2ec179,_0x630d('0x152'));}logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x153'),this[_0x630d('0xc')][_0x630d('0x37')],_0x2ec179['findBy']));var _0x4860a0=this[_0x630d('0x154')]['sync'](this,_0x2ec179[_0x630d('0x151')]);if(_0x4860a0){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x155'),this['channel'][_0x630d('0x37')],_0x2ec179[_0x630d('0x151')]));this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x155'),this[_0x630d('0xc')]['callerid'],_0x2ec179[_0x630d('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x156'),this[_0x630d('0xc')][_0x630d('0x37')],_0x2ec179['findBy']));this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x156'),this[_0x630d('0xc')][_0x630d('0x37')],_0x2ec179[_0x630d('0x151')]));return{'code':0xc8,'result':_0x630d('0x157')};}};AGIVertices[_0x630d('0xe')][_0x630d('0x158')]=function(_0x2e651c){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x159'),_0x2e651c[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0x2e651c[_0x630d('0x151')])){return this[_0x630d('0xc')][_0x630d('0x28')](_0x2e651c,_0x630d('0x152'));}logger[_0x630d('0x2c')](util[_0x630d('0x55')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x630d('0xc')]['callerid'],_0x2e651c[_0x630d('0x151')]));var _0x21bb7b=this[_0x630d('0x53')][_0x630d('0xa4')](this,_0x2e651c[_0x630d('0x151')]);if(_0x21bb7b){logger['info'](util[_0x630d('0x55')](_0x630d('0x155'),this[_0x630d('0xc')][_0x630d('0x37')],_0x2e651c[_0x630d('0x151')]));this['channel'][_0x630d('0xa6')](util['format'](_0x630d('0x155'),this[_0x630d('0xc')][_0x630d('0x37')],_0x2e651c['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x156'),this[_0x630d('0xc')][_0x630d('0x37')],_0x2e651c[_0x630d('0x151')]));this[_0x630d('0xc')][_0x630d('0xa6')](util['format'](_0x630d('0x156'),this['channel'][_0x630d('0x37')],_0x2e651c[_0x630d('0x151')]));return{'code':0xc8,'result':_0x630d('0x157')};}};AGIVertices['prototype'][_0x630d('0x15a')]=function(_0x379903){logger[_0x630d('0x2c')](util[_0x630d('0x55')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x379903[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0x379903[_0x630d('0x15b')])){return this['channel']['error'](_0x379903,_0x630d('0x15c'));}this[_0x630d('0xc')][_0x630d('0xa6')](util['format'](_0x630d('0x15d'),_0x379903['operation']));var _0x5b948a=eval(_0x379903[_0x630d('0x15b')]);if(!this[_0x630d('0x83')](_0x379903[_0x630d('0xd5')])){return this[_0x630d('0xc')]['noop'](_0x630d('0xd4'));}var _0x4008bb=this[_0x630d('0xf')][_0x630d('0xa4')](this,_0x379903[_0x630d('0xd5')]);if(!_0x4008bb){return this[_0x630d('0xc')]['error'](_0x379903,_0x630d('0x15e'));}if(_[_0x630d('0x98')](_0x5b948a)){var _0x2d62b8=this;_0x5b948a['forEach'](function(_0x2bb392,_0x26df99){_0x2d62b8[_0x630d('0xc')]['setVariable'](util[_0x630d('0x55')](_0x630d('0x15f'),_0x4008bb,_0x26df99),_0x2bb392);});return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x160'),_0x4008bb));}else{return this['channel'][_0x630d('0x9d')](_0x4008bb,_0x5b948a);}};AGIVertices['prototype'][_0x630d('0xb')]=function(_0x366bc6){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x161'),_0x366bc6[_0x630d('0xac')]));if(_0x366bc6[_0x630d('0x10c')]===0x0){return this[_0x630d('0xa3')](_0x366bc6);}_0x366bc6[_0x630d('0x10c')]-=0x1;if(!this[_0x630d('0x83')](_0x366bc6['file_id'])){return this['channel'][_0x630d('0x28')](_0x366bc6,_0x630d('0x10d'));}var _0x20ab09=this[_0x630d('0x10e')][_0x630d('0xa4')](this,_0x366bc6['file_id']);if(!_0x20ab09){return this[_0x630d('0xc')]['error'](_0x366bc6,'no\x20file\x20audio\x20found');}var _0x2d4cb7=this[_0x630d('0xc')][_0x630d('0x110')](_0x20ab09,_0x366bc6['response'],_0x366bc6[_0x630d('0x162')]);var _0x270133=_0x2d4cb7[_0x630d('0xa2')];if(_0x2d4cb7['result']===-0x1){this[_0x630d('0x33')]['sync'](this,_0x366bc6,'-1');return _0x2d4cb7;}else if(_0x2d4cb7['extra']===_0x630d('0x65')){_0x2d4cb7[_0x630d('0xa2')]=_0x2d4cb7[_0x630d('0xa2')][_0x630d('0x99')]>0x0?_0x2d4cb7['result']:'t';}else if(_[_0x630d('0x42')](_0x2d4cb7[_0x630d('0xa2')])){_0x2d4cb7['result']='#';_0x270133='#';}if(!this[_0x630d('0x83')](_0x366bc6[_0x630d('0xd5')])){this['channel']['noop'](_0x630d('0xd4'));}else{var _0x1b5ca7=this[_0x630d('0xf')][_0x630d('0xa4')](this,_0x366bc6['variable_id']);if(!_0x1b5ca7){return this[_0x630d('0xc')][_0x630d('0x28')](_0x366bc6,_0x630d('0x15e'));}this['channel'][_0x630d('0x9d')](_0x1b5ca7,_0x270133);}this[_0x630d('0x33')][_0x630d('0xa4')](this,_0x366bc6,_0x270133);return _0x2d4cb7;};AGIVertices[_0x630d('0xe')]['noop']=function(_0x5cc6f3){logger[_0x630d('0x2c')](util['format'](_0x630d('0x163'),_0x5cc6f3['label']));return this['channel']['noop'](_0x5cc6f3['output']||_0x5cc6f3[_0x630d('0xac')]);};AGIVertices['prototype']['pause']=function(_0x1b5f48){logger['info'](util['format'](_0x630d('0x164'),_0x1b5f48[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0x1b5f48[_0x630d('0x151')])){return this['channel'][_0x630d('0x28')](_0x1b5f48,'no\x20find\x20by\x20configured');}logger['info'](util[_0x630d('0x55')](_0x630d('0x153'),this['channel'][_0x630d('0x37')],_0x1b5f48[_0x630d('0x151')]));var _0x1af53e=this[_0x630d('0x4e')]['sync'](this,_0x1b5f48[_0x630d('0x165')]);var _0x584378=this[_0x630d('0x50')][_0x630d('0xa4')](this,_0x1b5f48[_0x630d('0x151')],_0x1af53e);if(_0x584378){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x155'),this[_0x630d('0xc')][_0x630d('0x37')],_0x1b5f48[_0x630d('0x151')]));this[_0x630d('0xc')]['noop'](util[_0x630d('0x55')](_0x630d('0x155'),this[_0x630d('0xc')][_0x630d('0x37')],_0x1b5f48['findBy']));return{'code':0xc8,'result':_0x630d('0x166')};}else{logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x156'),this[_0x630d('0xc')][_0x630d('0x37')],_0x1b5f48[_0x630d('0x151')]));this[_0x630d('0xc')]['noop'](util['format'](_0x630d('0x155'),this[_0x630d('0xc')][_0x630d('0x37')],_0x1b5f48[_0x630d('0x151')]));return{'code':0xc8,'result':_0x630d('0x157')};}};AGIVertices[_0x630d('0xe')][_0x630d('0x167')]=function(_0x3e105f){logger['info'](util[_0x630d('0x55')](_0x630d('0x168'),_0x3e105f[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0x3e105f[_0x630d('0x10f')])){return this['channel'][_0x630d('0x28')](_0x3e105f,_0x630d('0x10d'));}var _0x3ba388=this[_0x630d('0x10e')]['sync'](this,_0x3e105f[_0x630d('0x10f')]);if(!_0x3ba388){return this[_0x630d('0xc')][_0x630d('0x28')](_0x3e105f,_0x630d('0x169'));}var _0x219db8=this['channel'][_0x630d('0x59')]('PLAYBACK',[_0x3ba388,_0x3e105f[_0x630d('0x108')]]);if(_0x219db8['result']===-0x1){return _0x219db8;}return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x16a'),_0x630d('0x16b'),_0x3ba388));};AGIVertices[_0x630d('0xe')]['queue']=function(_0x1a7db2){logger['info'](util['format'](_0x630d('0x16c'),_0x1a7db2[_0x630d('0xac')]));if(!this['isConfigured'](_0x1a7db2['queue_id'])){return this[_0x630d('0xc')]['error'](_0x1a7db2,'no\x20queue\x20selected');}var _0x3b577c='';var _0x111f81=parseInt(_0x1a7db2[_0x630d('0x16d')],0xa);if(isNaN(_0x111f81)){_0x3b577c=_0x1a7db2['queue_id'];}else{_0x3b577c=this[_0x630d('0x14')][_0x630d('0xa4')](this,_0x1a7db2[_0x630d('0x16d')]);if(!_0x3b577c){return this['channel']['error'](_0x1a7db2,_0x630d('0x16e'));}}var _0x33ab53='';if(this[_0x630d('0x83')](_0x1a7db2[_0x630d('0x10f')])){var _0x4f6c33=this[_0x630d('0x10e')][_0x630d('0xa4')](this,_0x1a7db2[_0x630d('0x10f')]);if(_0x4f6c33){_0x33ab53=_0x4f6c33;}}this[_0x630d('0x33')]['sync'](this,_0x1a7db2,_0x3b577c);if(_0x1a7db2[_0x630d('0x108')][_0x630d('0x16f')]('x')<0x0){_0x1a7db2[_0x630d('0x108')]+='x';}if(_0x1a7db2[_0x630d('0x108')][_0x630d('0x16f')]('X')<0x0){_0x1a7db2[_0x630d('0x108')]+='X';}this['channel'][_0x630d('0x9d')](_0x630d('0x170'),_0x3b577c?_0x3b577c[_0x630d('0x171')]():'');var _0x58036e=this[_0x630d('0xc')]['exec'](_0x630d('0x172'),[_0x3b577c,_0x1a7db2[_0x630d('0x108')],_0x1a7db2[_0x630d('0x63')],_0x33ab53,_0x1a7db2[_0x630d('0x65')],_0x1a7db2[_0x630d('0xb6')],_0x1a7db2['macro'],_0x1a7db2['gosub'],'',_0x1a7db2[_0x630d('0x173')]]);if(_0x58036e[_0x630d('0xa2')]===-0x1){return _0x58036e;}return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x16a'),_0x630d('0x172'),_0x3b577c));};AGIVertices[_0x630d('0xe')][_0x630d('0x174')]=function(_0x2ae0e3){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x175'),_0x2ae0e3[_0x630d('0xac')]));var _0x714d2a=_0x2ae0e3['recordingFormat']||_0x630d('0x12b');var _0x95f0e4=util[_0x630d('0x55')](_0x630d('0x176'),this[_0x630d('0xc')][_0x630d('0x34')],rs[_0x630d('0x118')](0x5));var _0x592932=util[_0x630d('0x55')](_0x630d('0x177'),FILES_PATH,_0x95f0e4,_0x714d2a);var _0x176f27=util[_0x630d('0x55')](_0x630d('0x133'),FILES_PATH,_0x95f0e4);this[_0x630d('0x38')][_0x630d('0xa4')](this,_0x2ae0e3,_0x95f0e4,_0x592932);this[_0x630d('0xc')][_0x630d('0x9d')](_0x630d('0x178'),_0x95f0e4);logger[_0x630d('0x2c')](_0x630d('0x179'),_0x176f27,_0x714d2a,_0x2ae0e3[_0x630d('0x17a')],_0x2ae0e3[_0x630d('0x65')]);return this[_0x630d('0xc')]['recordFile'](_0x176f27,_0x714d2a,_0x2ae0e3['escape_digits'],_0x2ae0e3[_0x630d('0x65')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x2e140e){logger[_0x630d('0x2c')](util['format'](_0x630d('0x17b'),_0x2e140e[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0x2e140e[_0x630d('0x63')])){return this[_0x630d('0xc')][_0x630d('0xa6')]('no\x20url\x20configured');}var _0x49c431=this['restAPI'][_0x630d('0xa4')](this,_0x2e140e);logger[_0x630d('0x2c')](util[_0x630d('0x55')]('Response:',util['inspect'](_0x49c431,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x2e140e[_0x630d('0xd5')])){return this[_0x630d('0xc')]['noop'](_0x630d('0x17c'));}var _0x47dac9=this['getVariable']['sync'](this,_0x2e140e[_0x630d('0xd5')]);if(!_0x47dac9){return this[_0x630d('0xc')][_0x630d('0x28')](_0x2e140e,_0x630d('0x15e'));}this[_0x630d('0xc')][_0x630d('0x9d')](util['format'](_0x630d('0x17d'),_0x47dac9),_0x49c431[_0x630d('0x71')]?_0x49c431['statusCode']:'200');this[_0x630d('0xc')][_0x630d('0x9d')](util['format'](_0x630d('0x17e'),_0x47dac9),_0x49c431[_0x630d('0x72')]?_0x49c431[_0x630d('0x72')]:'OK');if(_0x49c431[_0x630d('0x69')]){try{this[_0x630d('0x9b')](_0x49c431[_0x630d('0x69')],_0x47dac9);}catch(_0x44eb62){logger['error'](util[_0x630d('0x55')](_0x630d('0x17f'),_0x47dac9));}}return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')]('variable\x20%s\x20set',_0x47dac9));};AGIVertices['prototype']['saydigits']=function(_0x384d5f){logger[_0x630d('0x2c')](util[_0x630d('0x55')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x384d5f['label']));return this['channel'][_0x630d('0x180')](_0x384d5f[_0x630d('0x181')][_0x630d('0x5b')](/\s+/g,''),_0x384d5f[_0x630d('0x17a')]);};AGIVertices[_0x630d('0xe')][_0x630d('0x182')]=function(_0x5374d9){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x183'),_0x5374d9[_0x630d('0xac')]));return this[_0x630d('0xc')][_0x630d('0x184')](_0x5374d9[_0x630d('0x66')][_0x630d('0x5b')](/\s+/g,''),_0x5374d9[_0x630d('0x17a')]);};AGIVertices[_0x630d('0xe')][_0x630d('0x185')]=function(_0x53e91e){logger[_0x630d('0x2c')](util[_0x630d('0x55')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x53e91e['label']));return this[_0x630d('0xc')][_0x630d('0x186')](_0x53e91e['text'],_0x53e91e['escape_digits']);};AGIVertices[_0x630d('0xe')][_0x630d('0x187')]=function(_0xc67d3d){logger['info'](util[_0x630d('0x55')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xc67d3d[_0x630d('0xac')]));if(!this[_0x630d('0x83')](_0xc67d3d['account_id'])){return this['channel'][_0x630d('0xa6')](_0x630d('0x188'));}var _0x5d2631=this['getMailAccount'][_0x630d('0xa4')](this,_0xc67d3d[_0x630d('0x189')]);if(!_0x5d2631||!_0x5d2631[_0x630d('0x18a')]){return this[_0x630d('0xc')][_0x630d('0x28')](_0xc67d3d,'no\x20mail\x20account\x20found');}var _0x2cfe7a={'from':util[_0x630d('0x55')](_0x630d('0x18b'),_0x5d2631[_0x630d('0x13')],_0x5d2631[_0x630d('0x18c')]||_0x5d2631[_0x630d('0x18a')][_0x630d('0x18d')]),'to':_0xc67d3d['to']||'','cc':_0xc67d3d['cc']||'','bcc':_0xc67d3d['bcc']||'','subject':_0xc67d3d[_0x630d('0x18e')],'html':_0xc67d3d[_0x630d('0x5f')],'text':_0xc67d3d[_0x630d('0x5f')]};if(this['isConfigured'](_0xc67d3d[_0x630d('0x18f')])){}logger[_0x630d('0xdc')](_0x630d('0x190'),JSON[_0x630d('0x6f')](_0x2cfe7a));this['createSquareDetailsReport'][_0x630d('0xa4')](this,_0xc67d3d,_0xc67d3d[_0x630d('0x189')]);this[_0x630d('0xc')][_0x630d('0xa6')](util['format'](_0x630d('0x191'),_0x5d2631[_0x630d('0x13')]));this['sendMailMessage'][_0x630d('0xa4')](this,_0x5d2631[_0x630d('0x192')],_0x2cfe7a);return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0x193'));};AGIVertices[_0x630d('0xe')][_0x630d('0x194')]=function(_0x3239bc){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x195'),_0x3239bc['label']));return this[_0x630d('0xc')]['noop'](_0x630d('0x196'));};AGIVertices['prototype']['sendSMS']=function(_0x3fd1a4){logger[_0x630d('0x2c')](util[_0x630d('0x55')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x3fd1a4[_0x630d('0xac')]));if(!this['isConfigured'](_0x3fd1a4[_0x630d('0x197')])){return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0x198'));}var _0x27a7a4=this[_0x630d('0x30')][_0x630d('0xa4')](this,_0x3fd1a4[_0x630d('0x197')]);if(!_0x27a7a4){return this['channel']['error'](_0x3fd1a4,_0x630d('0x199'));}var _0x456068={'body':_0x3fd1a4['sms_text'],'phone':_0x3fd1a4['to']||'','SmsAccountId':_0x27a7a4['id']};logger['debug'](_0x630d('0x19a'),JSON['stringify'](_0x456068));this[_0x630d('0x33')][_0x630d('0xa4')](this,_0x3fd1a4,_0x3fd1a4['sms_account_id']);this[_0x630d('0xc')][_0x630d('0xa6')](util['format'](_0x630d('0x19b'),_0x27a7a4[_0x630d('0x13')]));this[_0x630d('0x32')]['sync'](this,_0x456068);return this[_0x630d('0xc')][_0x630d('0xa6')](_0x630d('0x19c'));};AGIVertices['prototype']['set']=function(_0x53c1f8){logger['info'](util[_0x630d('0x55')](_0x630d('0x19d'),_0x53c1f8['label']));if(!this['isConfigured'](_0x53c1f8['variable_id'])){return this['channel'][_0x630d('0x28')](_0x53c1f8,_0x630d('0x19e'));}var _0x21e48f=this[_0x630d('0xf')]['sync'](this,_0x53c1f8[_0x630d('0xd5')]);if(!_0x21e48f){return this['channel'][_0x630d('0x28')](_0x53c1f8,_0x630d('0x15e'));}return this[_0x630d('0xc')][_0x630d('0x9d')](_0x21e48f,_0x53c1f8[_0x630d('0x19f')]);};AGIVertices[_0x630d('0xe')][_0x630d('0x1a0')]=function(_0x4bc922){logger['info'](util[_0x630d('0x55')](_0x630d('0x1a1'),_0x4bc922[_0x630d('0xac')]));this['channel']['noop'](_0x630d('0x1a2'));if(_0x4bc922[_0x630d('0xb9')]===_0x630d('0x1a3')){this[_0x630d('0xc')]['noop'](_0x630d('0x1a4'));return this['channel'][_0x630d('0xb9')]();}return this[_0x630d('0xc')][_0x630d('0xa6')]('Skipped\x20Answer');};AGIVertices[_0x630d('0xe')][_0x630d('0x1a5')]=function(_0x5a5b1f){logger['info'](util[_0x630d('0x55')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x5a5b1f[_0x630d('0xac')]));if(!this['isConfigured'](_0x5a5b1f[_0x630d('0x1a6')])){return this[_0x630d('0xc')][_0x630d('0x28')](_0x5a5b1f,_0x630d('0x1a7'));}var _0x5c14e2=this[_0x630d('0x1a8')]['sync'](this,_0x5a5b1f[_0x630d('0x1a6')]);if(!this[_0x630d('0x83')](_0x5c14e2)){return this[_0x630d('0xc')][_0x630d('0x28')](_0x5a5b1f,util[_0x630d('0x55')](_0x630d('0x1a9'),_0x5a5b1f[_0x630d('0x1a6')]));}if(_0x5c14e2===this[_0x630d('0xc')][_0x630d('0x36')]){return this['channel'][_0x630d('0x28')](_0x5a5b1f,_0x630d('0x1aa'));}this[_0x630d('0x33')][_0x630d('0xa4')](this,_0x5a5b1f,_0x5c14e2);var _0x56124a=this[_0x630d('0xc')][_0x630d('0x59')](_0x630d('0x1ab'),util[_0x630d('0x55')](_0x630d('0x1ac'),config[_0x630d('0xb6')]['host']||_0x630d('0x1ad'),_0x5c14e2,this[_0x630d('0xc')][_0x630d('0x36')]));if(_0x56124a[_0x630d('0xa2')]===-0x1){return _0x56124a;}return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x16a'),_0x630d('0x1ab'),_0x5c14e2));};AGIVertices['prototype'][_0x630d('0x1ae')]=function(_0x2a997f){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x1af'),_0x2a997f[_0x630d('0xac')]));var _0x503e08=this[_0x630d('0x58')][_0x630d('0xa4')](this,_0x2a997f[_0x630d('0x1b0')]);this[_0x630d('0x33')][_0x630d('0xa4')](this,_0x2a997f,_0x2a997f[_0x630d('0x1b0')]);if(this['isConfigured'](_0x2a997f[_0x630d('0xd5')])){var _0x121ab6=this['getVariable']['sync'](this,_0x2a997f[_0x630d('0xd5')]);if(_0x121ab6){this[_0x630d('0xc')][_0x630d('0x9d')](_0x121ab6,_0x503e08);return this[_0x630d('0xc')]['noop'](util[_0x630d('0x55')](_0x630d('0x1b1'),_0x2a997f[_0x630d('0x1b0')],_0x121ab6));}}return this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x1b2'),_0x2a997f[_0x630d('0x1b0')]));};AGIVertices[_0x630d('0xe')][_0x630d('0x1b3')]=function(_0x161eda){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x1b4'),_0x161eda[_0x630d('0xac')]));_0x161eda[_0x630d('0x5f')]=_0x161eda[_0x630d('0x5f')][_0x630d('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x630d('0x83')](_0x161eda[_0x630d('0x5d')])){return this['channel'][_0x630d('0xa6')](_0x630d('0x1b5'));}if(!this[_0x630d('0x83')](_0x161eda[_0x630d('0x5f')])){return this['channel'][_0x630d('0xa6')](_0x630d('0xa7'));}this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x1b6'),_0x161eda[_0x630d('0x5f')]));var _0x155b80=this[_0x630d('0x5c')]['sync'](this,_0x161eda);if(_0x155b80){this[_0x630d('0xc')]['noop'](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x155b80));var _0x36a978=this[_0x630d('0xc')][_0x630d('0x121')](_0x155b80);try{fs['unlink'](_0x155b80+_0x630d('0x1b7'));}catch(_0x4409cd){logger[_0x630d('0x28')](_0x4409cd);}return _0x36a978;}return this[_0x630d('0xc')][_0x630d('0x28')](_0x161eda,_0x630d('0x1b8'));};AGIVertices['prototype'][_0x630d('0x1b9')]=function(_0x4075d1){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x1ba'),_0x4075d1[_0x630d('0xac')]));_0x4075d1[_0x630d('0x5f')]=_0x4075d1[_0x630d('0x5f')][_0x630d('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x4075d1[_0x630d('0x5f')])){return this['channel'][_0x630d('0xa6')](_0x630d('0xa7'));}this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x1bb'),_0x4075d1['text']));var _0xcfa4dd=this[_0x630d('0x62')]['sync'](this,_0x4075d1);if(_0xcfa4dd){this[_0x630d('0xc')]['noop'](util[_0x630d('0x55')](_0x630d('0x1bc'),_0xcfa4dd));var _0x3f258e=this[_0x630d('0xc')][_0x630d('0x121')](_0xcfa4dd);try{fs[_0x630d('0xff')](_0xcfa4dd+'.wav');}catch(_0x1f141d){logger[_0x630d('0x28')](_0x1f141d);}return _0x3f258e;}return this[_0x630d('0xc')][_0x630d('0x28')](_0x4075d1,_0x630d('0x1bd'));};AGIVertices['prototype']['unpause']=function(_0x21f165){logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x1be'),_0x21f165[_0x630d('0xac')]));if(!this['isConfigured'](_0x21f165[_0x630d('0x151')])){return this[_0x630d('0xc')][_0x630d('0x28')](_0x21f165,_0x630d('0x152'));}logger[_0x630d('0x2c')](util['format'](_0x630d('0x153'),this[_0x630d('0xc')]['callerid'],_0x21f165[_0x630d('0x151')]));var _0x3282b8=this[_0x630d('0x52')][_0x630d('0xa4')](this,_0x21f165[_0x630d('0x151')]);if(_0x3282b8){logger[_0x630d('0x2c')](util[_0x630d('0x55')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x630d('0xc')][_0x630d('0x37')],_0x21f165[_0x630d('0x151')]));this['channel'][_0x630d('0xa6')](util[_0x630d('0x55')](_0x630d('0x155'),this['channel']['callerid'],_0x21f165['findBy']));return{'code':0xc8,'result':_0x630d('0x166')};}else{logger[_0x630d('0x2c')](util[_0x630d('0x55')](_0x630d('0x156'),this[_0x630d('0xc')][_0x630d('0x37')],_0x21f165['findBy']));this[_0x630d('0xc')][_0x630d('0xa6')](util[_0x630d('0x55')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x630d('0xc')][_0x630d('0x37')],_0x21f165['findBy']));return{'code':0xc8,'result':_0x630d('0x157')};}};AGIVertices['prototype'][_0x630d('0x1bf')]=function(_0x494556){logger[_0x630d('0x2c')](util['format'](_0x630d('0x1c0'),_0x494556[_0x630d('0xac')]));var _0x32e568=this['channel']['exec'](_0x630d('0x1c1'),[_0x494556[_0x630d('0x1c2')],_0x494556[_0x630d('0x75')]]);if(_0x32e568[_0x630d('0xa2')]===-0x1){return _0x32e568;}return this[_0x630d('0xc')][_0x630d('0xa6')](util['format']('Executed\x20command\x20%s\x20%s',_0x630d('0x1c1'),_0x494556['mailbox']));};AGIVertices[_0x630d('0xe')][_0x630d('0x1c3')]=function(_0x1a6646){logger['info'](util[_0x630d('0x55')](_0x630d('0x1c4'),_0x1a6646['label']));if(!this[_0x630d('0x83')](_0x1a6646[_0x630d('0xd5')])){return this[_0x630d('0xc')][_0x630d('0x28')](_0x1a6646,_0x630d('0x19e'));}var _0x9f32b0=this['getVariable']['sync'](this,_0x1a6646[_0x630d('0xd5')]);if(!_0x9f32b0){return this[_0x630d('0xc')][_0x630d('0x28')](_0x1a6646,_0x630d('0x15e'));}var _0x5e3470=this[_0x630d('0xc')][_0x630d('0xf')](_0x9f32b0);return{'code':0xc8,'result':_0x5e3470[_0x630d('0xa0')]?_0x5e3470['extra']:'-'};};String['prototype'][_0x630d('0x9f')]=function(_0x174914,_0x1027e3){return this[_0x630d('0x9e')](_0x174914)['join'](_0x1027e3);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index fea00ec..cf50936 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 _0x4e1a=['hanguprequest','syncHangupRequest','bind','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','seconds','prototype','queue','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','[ACW][STOP]\x20%s','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','mandatoryDisposition','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4e1a,0x1d5));var _0xa4e1=function(_0x57383b,_0x30fb98){_0x57383b=_0x57383b-0x0;var _0x3ad54d=_0x4e1a[_0x57383b];return _0x3ad54d;};'use strict';var util=require(_0xa4e1('0x0'));var _=require(_0xa4e1('0x1'));var moment=require('moment');var ami=require(_0xa4e1('0x2'));var logger=require('../../../config/logger')(_0xa4e1('0x3'));var RpcUser=require(_0xa4e1('0x4'));var RpcVoiceAgentReport=require(_0xa4e1('0x5'));function Acw(_0x22d3f9){this[_0xa4e1('0x6')]=_0x22d3f9[_0xa4e1('0x6')];this[_0xa4e1('0x7')]=_0x22d3f9[_0xa4e1('0x7')];this[_0xa4e1('0x8')]=_0x22d3f9[_0xa4e1('0x8')];this[_0xa4e1('0x9')]={};ami['on'](_0xa4e1('0xa'),this['syncAgentConnect']['bind'](this));ami['on'](_0xa4e1('0xb'),this[_0xa4e1('0xc')][_0xa4e1('0xd')](this));ami['on']('hangup',this['syncHangup'][_0xa4e1('0xd')](this));ami['on'](_0xa4e1('0xe'),this[_0xa4e1('0xf')][_0xa4e1('0xd')](this));ami['on'](_0xa4e1('0x10'),this['syncAttendedTransfer'][_0xa4e1('0xd')](this));ami['on'](_0xa4e1('0x11'),this[_0xa4e1('0x12')][_0xa4e1('0xd')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xa4e1('0xd')](this));}function getDiff(_0x2f2f6f){var _0x1d4287=moment()[_0xa4e1('0x13')](0x0);var _0x2d2304=moment(_0x2f2f6f)[_0xa4e1('0x13')](0x0);return _0x1d4287[_0xa4e1('0x14')](_0x2d2304,_0xa4e1('0x15'));}Acw[_0xa4e1('0x16')]['startAcw']=function(_0x4d2771){try{var _0x823d80=this;var _0x227bda=this[_0xa4e1('0x9')][_0x4d2771]['interface'];var _0x5e9c21=this[_0xa4e1('0x9')][_0x4d2771][_0xa4e1('0x17')];var _0x3ab967=this[_0xa4e1('0x6')][_0x5e9c21];var _0x3f7813=![];var _0x4ac66b='ACW';if(_0x3ab967['mandatoryDisposition']){if(_0x3ab967[_0xa4e1('0x18')]['name']){_0x3f7813=!![];_0x4ac66b=_0x3ab967[_0xa4e1('0x18')]['name'];}}ami[_0xa4e1('0x19')]({'action':_0xa4e1('0x1a'),'interface':_0x227bda,'paused':!![],'reason':_0x4ac66b})[_0xa4e1('0x1b')](function(_0x2679d3){if(_0x823d80[_0xa4e1('0x7')][_0x227bda]){return RpcUser[_0xa4e1('0x1c')](_0x823d80['agents'][_0x227bda]['id'])['then'](function(_0x4c38e6){if(_0x4c38e6&&!_0x4c38e6[_0xa4e1('0x1d')]){logger[_0xa4e1('0x1e')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x4d2771,_0x227bda,_0x5e9c21);var _0x2e630d=_0x823d80[_0xa4e1('0x9')][_0x4d2771][_0xa4e1('0x1f')]&&_0x823d80['channels'][_0x4d2771]['destlinkedid']?_0x823d80['channels'][_0x4d2771][_0xa4e1('0x20')]:_0x4d2771;return RpcUser['savePause'](_0x823d80[_0xa4e1('0x7')][_0x227bda],_0x4ac66b,_0x2e630d)['then'](function(_0x4d2c1e){if(!_0x3f7813){_0x823d80[_0xa4e1('0x8')][_0x227bda]={};logger[_0xa4e1('0x1e')](_0xa4e1('0x21'),_0x4d2771,_0x823d80[_0xa4e1('0x6')][_0x5e9c21][_0xa4e1('0x22')],_0x227bda,_0x5e9c21);_0x823d80[_0xa4e1('0x8')][_0x227bda][_0xa4e1('0x23')]=setTimeout(_0x823d80[_0xa4e1('0x24')]['bind'](_0x823d80,_0x227bda),_0x823d80[_0xa4e1('0x6')][_0x5e9c21][_0xa4e1('0x22')]*0x3e8);_0x823d80[_0xa4e1('0x8')][_0x227bda][_0xa4e1('0x25')]=moment()['format'](_0xa4e1('0x26'));_0x823d80[_0xa4e1('0x8')][_0x227bda][_0xa4e1('0x27')]=_0x4d2771;_0x823d80['timers'][_0x227bda][_0xa4e1('0x17')]=_0x5e9c21;_0x823d80[_0xa4e1('0x8')][_0x227bda][_0xa4e1('0x28')]=function(){var _0x57a47c=getDiff(_0x823d80[_0xa4e1('0x8')][_0x227bda][_0xa4e1('0x25')]);clearTimeout(_0x823d80[_0xa4e1('0x8')][_0x227bda][_0xa4e1('0x23')]);_0x823d80[_0xa4e1('0x8')][_0x227bda][_0xa4e1('0x23')]=![];RpcVoiceAgentReport[_0xa4e1('0x29')]({'acwtime':_0x57a47c},_0x823d80['timers'][_0x227bda][_0xa4e1('0x27')],_0x227bda)[_0xa4e1('0x1b')](function(_0x483207){logger[_0xa4e1('0x1e')](_0xa4e1('0x2a'),_0x4d2771,_0x57a47c,_0x483207);})[_0xa4e1('0x2b')](function(_0x493a45){logger[_0xa4e1('0x2c')](_0xa4e1('0x2d'),_0x4d2771,_0x493a45);});delete _0x823d80[_0xa4e1('0x8')][_0x227bda];};}});}else{logger[_0xa4e1('0x1e')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x4d2771,_0x227bda,_0x5e9c21);}});}})['catch'](function(_0x175814){logger[_0xa4e1('0x2c')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4d2771,_0x823d80[_0xa4e1('0x6')][_0x5e9c21][_0xa4e1('0x22')],_0x227bda,_0x5e9c21);})[_0xa4e1('0x2e')](function(){delete _0x823d80['channels'][_0x4d2771];});}catch(_0x410d35){logger[_0xa4e1('0x2c')]('[ACW][START]\x20%s',_0x410d35[_0xa4e1('0x2f')]);}};Acw[_0xa4e1('0x16')][_0xa4e1('0x24')]=function(_0x4726ef){try{var _0x5eccc5=this;if(_0x5eccc5[_0xa4e1('0x8')][_0x4726ef]){_0x5eccc5['timers'][_0x4726ef]['timer']=![];var _0x1baf26=_0x5eccc5[_0xa4e1('0x8')][_0x4726ef][_0xa4e1('0x27')];var _0x5622ef=_0x5eccc5[_0xa4e1('0x8')][_0x4726ef]['queue'];var _0x1add4b=_0x5eccc5[_0xa4e1('0x6')][_0x5622ef]['acwTimeout'];logger[_0xa4e1('0x1e')](_0xa4e1('0x30'),_0x1baf26,_0x4726ef);RpcUser[_0xa4e1('0x31')](this[_0xa4e1('0x7')][_0x4726ef]);RpcVoiceAgentReport[_0xa4e1('0x29')]({'acwtime':_0x1add4b,'agentacw':!![]},_0x1baf26,_0x4726ef)[_0xa4e1('0x1b')](function(_0xab9785){logger[_0xa4e1('0x1e')](_0xa4e1('0x2a'),_0x1baf26,_0x1add4b,_0xab9785);})[_0xa4e1('0x2b')](function(_0x551db9){logger[_0xa4e1('0x2c')](_0xa4e1('0x2d'),_0x1baf26,_0x551db9);});}else{logger[_0xa4e1('0x2c')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x4726ef);if(_0x5eccc5[_0xa4e1('0x8')]){logger[_0xa4e1('0x1e')](_0xa4e1('0x32'),JSON['stringify'](_0x5eccc5[_0xa4e1('0x8')]));}}}catch(_0x52bb25){logger[_0xa4e1('0x2c')](_0xa4e1('0x33'),_0x52bb25['message']);}};Acw['prototype'][_0xa4e1('0x34')]=function(_0x5ae6dc){try{if(this['voiceQueues'][_0x5ae6dc[_0xa4e1('0x17')]]&&(this[_0xa4e1('0x6')][_0x5ae6dc[_0xa4e1('0x17')]][_0xa4e1('0x3')]||this[_0xa4e1('0x6')][_0x5ae6dc[_0xa4e1('0x17')]]['mandatoryDisposition'])){if(this[_0xa4e1('0x7')][_0x5ae6dc['interface']]){this['channels'][_0x5ae6dc[_0xa4e1('0x27')]]={'queue':_0x5ae6dc[_0xa4e1('0x17')],'interface':_0x5ae6dc[_0xa4e1('0x35')],'destlinkedid':_0x5ae6dc[_0xa4e1('0x20')]};}}}catch(_0x5b533b){logger[_0xa4e1('0x2c')](_0xa4e1('0x36'),_0x5b533b[_0xa4e1('0x2f')]);}};Acw['prototype'][_0xa4e1('0x37')]=function(_0x517cf1){try{if(this[_0xa4e1('0x6')][_0x517cf1['queue']]&&(this[_0xa4e1('0x6')][_0x517cf1[_0xa4e1('0x17')]]['acw']||this['voiceQueues'][_0x517cf1['queue']][_0xa4e1('0x38')])){if(this[_0xa4e1('0x7')][_0x517cf1[_0xa4e1('0x35')]]){this['channels'][_0x517cf1[_0xa4e1('0x27')]]={'queue':_0x517cf1[_0xa4e1('0x17')],'interface':_0x517cf1[_0xa4e1('0x35')]};}}}catch(_0x2ed551){logger[_0xa4e1('0x2c')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2ed551[_0xa4e1('0x2f')]);}};Acw['prototype'][_0xa4e1('0xc')]=function(_0xfc4563){try{if(this['channels'][_0xfc4563[_0xa4e1('0x27')]]&&_[_0xa4e1('0x39')](this[_0xa4e1('0x9')][_0xfc4563[_0xa4e1('0x27')]]['attended'])){logger['info'](_0xa4e1('0x3a'),_0xfc4563['uniqueid']);this['startAcw'](_0xfc4563[_0xa4e1('0x27')]);}else if(this[_0xa4e1('0x9')][_0xfc4563[_0xa4e1('0x3b')]]&&_['isUndefined'](this['channels'][_0xfc4563[_0xa4e1('0x3b')]][_0xa4e1('0x1f')])){logger[_0xa4e1('0x1e')](_0xa4e1('0x3c'),_0xfc4563[_0xa4e1('0x3b')]);this[_0xa4e1('0x3d')](_0xfc4563[_0xa4e1('0x3b')]);}}catch(_0x5d62cf){logger['error'](_0xa4e1('0x3e'),_0x5d62cf[_0xa4e1('0x2f')]);}};Acw['prototype']['syncHangup']=function(_0x237e30){try{if(this[_0xa4e1('0x9')][_0x237e30[_0xa4e1('0x27')]]&&this[_0xa4e1('0x9')][_0x237e30[_0xa4e1('0x27')]]['attended']){logger['info'](_0xa4e1('0x3f'),_0x237e30[_0xa4e1('0x27')]);this['startAcw'](_0x237e30[_0xa4e1('0x27')]);}else if(this[_0xa4e1('0x9')][_0x237e30[_0xa4e1('0x3b')]]&&this['channels'][_0x237e30[_0xa4e1('0x3b')]]['attended']){logger[_0xa4e1('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x237e30['linkedid']);this[_0xa4e1('0x3d')](_0x237e30[_0xa4e1('0x3b')]);}}catch(_0x3c999e){logger[_0xa4e1('0x2c')](_0xa4e1('0x40'),_0x3c999e['message']);}};Acw[_0xa4e1('0x16')]['syncAttendedTransfer']=function(_0x4b524c){try{if(!_['isNil'](this[_0xa4e1('0x9')][_0x4b524c[_0xa4e1('0x41')]])){this[_0xa4e1('0x3d')](_0x4b524c[_0xa4e1('0x41')]);if(this[_0xa4e1('0x9')][_0x4b524c[_0xa4e1('0x42')]]){this[_0xa4e1('0x9')][_0x4b524c[_0xa4e1('0x42')]][_0xa4e1('0x1f')]=!![];this['channels'][_0x4b524c[_0xa4e1('0x43')]]=this[_0xa4e1('0x9')][_0x4b524c[_0xa4e1('0x42')]];delete this['channels'][_0x4b524c[_0xa4e1('0x42')]];}}else if(!_['isNil'](this[_0xa4e1('0x9')][_0x4b524c[_0xa4e1('0x43')]])){this[_0xa4e1('0x3d')](_0x4b524c[_0xa4e1('0x43')]);if(this[_0xa4e1('0x9')][_0x4b524c[_0xa4e1('0x44')]]){this['channels'][_0x4b524c[_0xa4e1('0x44')]]['attended']=!![];this['channels'][_0x4b524c[_0xa4e1('0x41')]]=this[_0xa4e1('0x9')][_0x4b524c[_0xa4e1('0x44')]];delete this[_0xa4e1('0x9')][_0x4b524c[_0xa4e1('0x44')]];}}}catch(_0x436b4e){logger[_0xa4e1('0x2c')](_0xa4e1('0x45'),_0x436b4e[_0xa4e1('0x2f')]);}};Acw[_0xa4e1('0x16')]['syncBlindTransfer']=function(_0x2d4c30){try{if(this['channels'][_0x2d4c30[_0xa4e1('0x46')]]){logger[_0xa4e1('0x1e')](_0xa4e1('0x47'),JSON[_0xa4e1('0x48')](_0x2d4c30['transfereruniqueid']));this['startAcw'](_0x2d4c30[_0xa4e1('0x46')]);}else if(this[_0xa4e1('0x9')][_0x2d4c30[_0xa4e1('0x49')]]){logger['info'](_0xa4e1('0x4a'),JSON[_0xa4e1('0x48')](_0x2d4c30['transfererlinkedid']));this[_0xa4e1('0x3d')](_0x2d4c30[_0xa4e1('0x49')]);}}catch(_0x2fc8eb){logger[_0xa4e1('0x2c')](_0xa4e1('0x4b'),_0x2fc8eb[_0xa4e1('0x2f')]);}};Acw[_0xa4e1('0x16')][_0xa4e1('0xf')]=function(_0x1fe386){try{if(this['voiceQueues'][_0x1fe386['queue']]&&this[_0xa4e1('0x6')][_0x1fe386[_0xa4e1('0x17')]]['autopause']==='all'){if(this[_0xa4e1('0x7')][_0x1fe386[_0xa4e1('0x35')]]){logger[_0xa4e1('0x1e')](_0xa4e1('0x4c'),_0x1fe386[_0xa4e1('0x27')],_0x1fe386[_0xa4e1('0x35')],_0x1fe386['queue']);return RpcUser[_0xa4e1('0x4d')](this[_0xa4e1('0x7')][_0x1fe386['interface']],_0xa4e1('0x4e'),_0x1fe386[_0xa4e1('0x27')]);}}}catch(_0x409fec){logger[_0xa4e1('0x2c')](_0xa4e1('0x4f'),_0x409fec['message']);}};module['exports']=Acw; \ No newline at end of file +var _0x7603=['Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','agentconnect','bind','syncHangupRequest','hangup','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','attended','destlinkedid','savePause','timers','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]'];(function(_0x3c59b5,_0x40975c){var _0x40a8a1=function(_0x2c38c8){while(--_0x2c38c8){_0x3c59b5['push'](_0x3c59b5['shift']());}};_0x40a8a1(++_0x40975c);}(_0x7603,0x1b6));var _0x3760=function(_0x2e5e56,_0x53f1ad){_0x2e5e56=_0x2e5e56-0x0;var _0x1b54e6=_0x7603[_0x2e5e56];return _0x1b54e6;};'use strict';var util=require(_0x3760('0x0'));var _=require(_0x3760('0x1'));var moment=require(_0x3760('0x2'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x3760('0x3'));var RpcUser=require(_0x3760('0x4'));var RpcVoiceAgentReport=require(_0x3760('0x5'));function Acw(_0x560f7e){this[_0x3760('0x6')]=_0x560f7e[_0x3760('0x6')];this[_0x3760('0x7')]=_0x560f7e[_0x3760('0x7')];this['timers']=_0x560f7e['timers'];this[_0x3760('0x8')]={};ami['on'](_0x3760('0x9'),this['syncAgentConnect'][_0x3760('0xa')](this));ami['on']('hanguprequest',this[_0x3760('0xb')][_0x3760('0xa')](this));ami['on'](_0x3760('0xc'),this['syncHangup'][_0x3760('0xa')](this));ami['on']('agentringnoanswer',this[_0x3760('0xd')][_0x3760('0xa')](this));ami['on'](_0x3760('0xe'),this['syncAttendedTransfer'][_0x3760('0xa')](this));ami['on'](_0x3760('0xf'),this[_0x3760('0x10')][_0x3760('0xa')](this));ami['on']('custom:agentConnectPreview',this[_0x3760('0x11')][_0x3760('0xa')](this));}function getDiff(_0x1d3368){var _0x17e26b=moment()[_0x3760('0x12')](0x0);var _0x3abf99=moment(_0x1d3368)[_0x3760('0x12')](0x0);return _0x17e26b[_0x3760('0x13')](_0x3abf99,_0x3760('0x14'));}Acw[_0x3760('0x15')][_0x3760('0x16')]=function(_0x134371){try{var _0x336e86=this;var _0x19bb5a=this[_0x3760('0x8')][_0x134371][_0x3760('0x17')];var _0x502104=this['channels'][_0x134371]['queue'];var _0x2bc1fc=this[_0x3760('0x6')][_0x502104];var _0x45facd=![];var _0x379597=_0x3760('0x18');if(_0x2bc1fc[_0x3760('0x19')]){if(_0x2bc1fc[_0x3760('0x1a')][_0x3760('0x1b')]){_0x45facd=!![];_0x379597=_0x2bc1fc[_0x3760('0x1a')][_0x3760('0x1b')];}}ami[_0x3760('0x1c')]({'action':_0x3760('0x1d'),'interface':_0x19bb5a,'paused':!![],'reason':_0x379597})[_0x3760('0x1e')](function(_0xb00e2f){if(_0x336e86[_0x3760('0x7')][_0x19bb5a]){return RpcUser[_0x3760('0x1f')](_0x336e86[_0x3760('0x7')][_0x19bb5a]['id'])[_0x3760('0x1e')](function(_0x35799a){if(_0x35799a&&!_0x35799a[_0x3760('0x20')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x134371,_0x19bb5a,_0x502104);var _0xd1ac78=_0x336e86['channels'][_0x134371][_0x3760('0x21')]&&_0x336e86[_0x3760('0x8')][_0x134371][_0x3760('0x22')]?_0x336e86[_0x3760('0x8')][_0x134371][_0x3760('0x22')]:_0x134371;return RpcUser[_0x3760('0x23')](_0x336e86['agents'][_0x19bb5a],_0x379597,_0xd1ac78)[_0x3760('0x1e')](function(_0x2e1901){if(!_0x45facd){_0x336e86[_0x3760('0x24')][_0x19bb5a]={};logger[_0x3760('0x25')](_0x3760('0x26'),_0x134371,_0x336e86[_0x3760('0x6')][_0x502104][_0x3760('0x27')],_0x19bb5a,_0x502104);_0x336e86[_0x3760('0x24')][_0x19bb5a]['timer']=setTimeout(_0x336e86[_0x3760('0x28')][_0x3760('0xa')](_0x336e86,_0x19bb5a),_0x336e86[_0x3760('0x6')][_0x502104][_0x3760('0x27')]*0x3e8);_0x336e86[_0x3760('0x24')][_0x19bb5a][_0x3760('0x29')]=moment()['format'](_0x3760('0x2a'));_0x336e86[_0x3760('0x24')][_0x19bb5a][_0x3760('0x2b')]=_0x134371;_0x336e86['timers'][_0x19bb5a][_0x3760('0x2c')]=_0x502104;_0x336e86[_0x3760('0x24')][_0x19bb5a][_0x3760('0x2d')]=function(){var _0x57b6ae=getDiff(_0x336e86['timers'][_0x19bb5a][_0x3760('0x29')]);clearTimeout(_0x336e86[_0x3760('0x24')][_0x19bb5a]['timer']);_0x336e86[_0x3760('0x24')][_0x19bb5a]['timer']=![];RpcVoiceAgentReport[_0x3760('0x2e')]({'acwtime':_0x57b6ae},_0x336e86[_0x3760('0x24')][_0x19bb5a]['uniqueid'],_0x19bb5a)[_0x3760('0x1e')](function(_0x23c1c1){logger[_0x3760('0x25')](_0x3760('0x2f'),_0x134371,_0x57b6ae,_0x23c1c1);})[_0x3760('0x30')](function(_0x34fdb9){logger[_0x3760('0x31')](_0x3760('0x32'),_0x134371,_0x34fdb9);});delete _0x336e86[_0x3760('0x24')][_0x19bb5a];};}});}else{logger['info'](_0x3760('0x33'),_0x134371,_0x19bb5a,_0x502104);}});}})[_0x3760('0x30')](function(_0x496cc7){logger[_0x3760('0x31')](_0x3760('0x26'),_0x134371,_0x336e86['voiceQueues'][_0x502104]['acwTimeout'],_0x19bb5a,_0x502104);})[_0x3760('0x34')](function(){delete _0x336e86[_0x3760('0x8')][_0x134371];});}catch(_0x553754){logger[_0x3760('0x31')](_0x3760('0x35'),_0x553754[_0x3760('0x36')]);}};Acw[_0x3760('0x15')]['stopAcw']=function(_0x54b8a8){try{var _0x13c921=this;if(_0x13c921['timers'][_0x54b8a8]){_0x13c921[_0x3760('0x24')][_0x54b8a8]['timer']=![];var _0x1e2e08=_0x13c921[_0x3760('0x24')][_0x54b8a8][_0x3760('0x2b')];var _0x42a482=_0x13c921['timers'][_0x54b8a8][_0x3760('0x2c')];var _0x264ec9=_0x13c921[_0x3760('0x6')][_0x42a482][_0x3760('0x27')];logger[_0x3760('0x25')](_0x3760('0x37'),_0x1e2e08,_0x54b8a8);RpcUser[_0x3760('0x38')](this[_0x3760('0x7')][_0x54b8a8]);RpcVoiceAgentReport[_0x3760('0x2e')]({'acwtime':_0x264ec9,'agentacw':!![]},_0x1e2e08,_0x54b8a8)[_0x3760('0x1e')](function(_0x18b2a3){logger[_0x3760('0x25')](_0x3760('0x2f'),_0x1e2e08,_0x264ec9,_0x18b2a3);})[_0x3760('0x30')](function(_0x1fa73f){logger[_0x3760('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x1e2e08,_0x1fa73f);});}else{logger[_0x3760('0x31')](_0x3760('0x39'),_0x54b8a8);if(_0x13c921[_0x3760('0x24')]){logger[_0x3760('0x25')](_0x3760('0x3a'),JSON[_0x3760('0x3b')](_0x13c921[_0x3760('0x24')]));}}}catch(_0x270e75){logger[_0x3760('0x31')](_0x3760('0x3c'),_0x270e75[_0x3760('0x36')]);}};Acw['prototype']['syncAgentConnect']=function(_0x289241){try{if(this['voiceQueues'][_0x289241[_0x3760('0x2c')]]&&(this['voiceQueues'][_0x289241['queue']][_0x3760('0x3')]||this[_0x3760('0x6')][_0x289241[_0x3760('0x2c')]][_0x3760('0x19')])){if(this[_0x3760('0x7')][_0x289241[_0x3760('0x17')]]){this['channels'][_0x289241[_0x3760('0x2b')]]={'queue':_0x289241[_0x3760('0x2c')],'interface':_0x289241['interface'],'destlinkedid':_0x289241[_0x3760('0x22')]};}}}catch(_0x1af45d){logger[_0x3760('0x31')]('[ACW][syncAgentConnect]\x20%s',_0x1af45d[_0x3760('0x36')]);}};Acw[_0x3760('0x15')][_0x3760('0x11')]=function(_0x159506){try{if(this[_0x3760('0x6')][_0x159506[_0x3760('0x2c')]]&&(this[_0x3760('0x6')][_0x159506[_0x3760('0x2c')]]['acw']||this[_0x3760('0x6')][_0x159506[_0x3760('0x2c')]][_0x3760('0x19')])){if(this[_0x3760('0x7')][_0x159506[_0x3760('0x17')]]){this[_0x3760('0x8')][_0x159506[_0x3760('0x2b')]]={'queue':_0x159506[_0x3760('0x2c')],'interface':_0x159506[_0x3760('0x17')]};}}}catch(_0x396dfc){logger[_0x3760('0x31')](_0x3760('0x3d'),_0x396dfc['message']);}};Acw[_0x3760('0x15')][_0x3760('0xb')]=function(_0x76caee){try{if(this[_0x3760('0x8')][_0x76caee[_0x3760('0x2b')]]&&_[_0x3760('0x3e')](this['channels'][_0x76caee[_0x3760('0x2b')]][_0x3760('0x21')])){logger[_0x3760('0x25')](_0x3760('0x3f'),_0x76caee[_0x3760('0x2b')]);this[_0x3760('0x16')](_0x76caee[_0x3760('0x2b')]);}else if(this['channels'][_0x76caee['linkedid']]&&_[_0x3760('0x3e')](this[_0x3760('0x8')][_0x76caee[_0x3760('0x40')]][_0x3760('0x21')])){logger[_0x3760('0x25')](_0x3760('0x41'),_0x76caee['linkedid']);this['startAcw'](_0x76caee[_0x3760('0x40')]);}}catch(_0x475d38){logger[_0x3760('0x31')](_0x3760('0x42'),_0x475d38[_0x3760('0x36')]);}};Acw[_0x3760('0x15')][_0x3760('0x43')]=function(_0x423305){try{if(this['channels'][_0x423305[_0x3760('0x2b')]]&&this[_0x3760('0x8')][_0x423305[_0x3760('0x2b')]][_0x3760('0x21')]){logger[_0x3760('0x25')](_0x3760('0x44'),_0x423305[_0x3760('0x2b')]);this[_0x3760('0x16')](_0x423305['uniqueid']);}else if(this[_0x3760('0x8')][_0x423305[_0x3760('0x40')]]&&this['channels'][_0x423305['linkedid']][_0x3760('0x21')]){logger[_0x3760('0x25')](_0x3760('0x45'),_0x423305[_0x3760('0x40')]);this[_0x3760('0x16')](_0x423305['linkedid']);}}catch(_0x5048fa){logger[_0x3760('0x31')]('[ACW][syncHangup]\x20%s',_0x5048fa['message']);}};Acw['prototype'][_0x3760('0x46')]=function(_0x3579d5){try{if(!_['isNil'](this[_0x3760('0x8')][_0x3579d5[_0x3760('0x47')]])){this[_0x3760('0x16')](_0x3579d5[_0x3760('0x47')]);if(this[_0x3760('0x8')][_0x3579d5['secondtransfereruniqueid']]){this[_0x3760('0x8')][_0x3579d5[_0x3760('0x48')]]['attended']=!![];this[_0x3760('0x8')][_0x3579d5[_0x3760('0x49')]]=this[_0x3760('0x8')][_0x3579d5[_0x3760('0x48')]];delete this[_0x3760('0x8')][_0x3579d5[_0x3760('0x48')]];}}else if(!_[_0x3760('0x4a')](this[_0x3760('0x8')][_0x3579d5[_0x3760('0x49')]])){this['startAcw'](_0x3579d5[_0x3760('0x49')]);if(this[_0x3760('0x8')][_0x3579d5['origtransfereruniqueid']]){this['channels'][_0x3579d5[_0x3760('0x4b')]][_0x3760('0x21')]=!![];this[_0x3760('0x8')][_0x3579d5[_0x3760('0x47')]]=this[_0x3760('0x8')][_0x3579d5[_0x3760('0x4b')]];delete this['channels'][_0x3579d5[_0x3760('0x4b')]];}}}catch(_0x587b85){logger[_0x3760('0x31')]('[ACW][syncAttendedTransfer]\x20%s',_0x587b85['message']);}};Acw[_0x3760('0x15')][_0x3760('0x10')]=function(_0x488794){try{if(this[_0x3760('0x8')][_0x488794[_0x3760('0x4c')]]){logger[_0x3760('0x25')](_0x3760('0x4d'),JSON[_0x3760('0x3b')](_0x488794[_0x3760('0x4c')]));this[_0x3760('0x16')](_0x488794['transfereruniqueid']);}else if(this[_0x3760('0x8')][_0x488794['transfererlinkedid']]){logger[_0x3760('0x25')](_0x3760('0x4e'),JSON[_0x3760('0x3b')](_0x488794[_0x3760('0x4f')]));this[_0x3760('0x16')](_0x488794[_0x3760('0x4f')]);}}catch(_0x5ce60c){logger['error'](_0x3760('0x50'),_0x5ce60c['message']);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0xe0b83f){try{if(this[_0x3760('0x6')][_0xe0b83f[_0x3760('0x2c')]]&&this[_0x3760('0x6')][_0xe0b83f['queue']][_0x3760('0x51')]===_0x3760('0x52')){if(this[_0x3760('0x7')][_0xe0b83f['interface']]){logger['info'](_0x3760('0x53'),_0xe0b83f[_0x3760('0x2b')],_0xe0b83f[_0x3760('0x17')],_0xe0b83f[_0x3760('0x2c')]);return RpcUser[_0x3760('0x23')](this[_0x3760('0x7')][_0xe0b83f['interface']],_0x3760('0x54'),_0xe0b83f[_0x3760('0x2b')]);}}}catch(_0x424d6e){logger[_0x3760('0x31')](_0x3760('0x55'),_0x424d6e['message']);}};module[_0x3760('0x56')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index a3092e1..b4b074f 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 _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x5c43bc,_0x26b6de){var _0x5d7ec3=function(_0x353f35){while(--_0x353f35){_0x5c43bc['push'](_0x5c43bc['shift']());}};_0x5d7ec3(++_0x26b6de);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4776cc,_0x3a715e){_0x4776cc=_0x4776cc-0x0;var _0x427bda=_0x0b0e[_0x4776cc];return _0x427bda;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami; \ No newline at end of file +var _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x3cb255,_0xdea2b2){var _0x51fb92=function(_0x1ae17d){while(--_0x1ae17d){_0x3cb255['push'](_0x3cb255['shift']());}};_0x51fb92(++_0xdea2b2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0x0b0e[_0x386525];return _0x14d015;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),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 632d482..eb62938 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 _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x526adb,_0x165eed){var _0x7268c0=function(_0x4b4a76){while(--_0x4b4a76){_0x526adb['push'](_0x526adb['shift']());}};_0x7268c0(++_0x165eed);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x36da2a,_0x139b77){_0x36da2a=_0x36da2a-0x0;var _0x457b21=_0xbdb7[_0x36da2a];return _0x457b21;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file +var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x51692a,_0x6c1fdb){var _0xd04cd4=function(_0x4604d7){while(--_0x4604d7){_0x51692a['push'](_0x51692a['shift']());}};_0xd04cd4(++_0x6c1fdb);}(_0xaa88,0x137));var _0x8aa8=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0xaa88[_0x9d639c];return _0x1671de;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 2def91b..ca6f22f 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa34d=['voiceQueue','uniqueid','Contact','firstName','lastName','number','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports','moment','isNil','string'];(function(_0x315995,_0x396be9){var _0x11c3a3=function(_0x819060){while(--_0x819060){_0x315995['push'](_0x315995['shift']());}};_0x11c3a3(++_0x396be9);}(_0xa34d,0x1eb));var _0xda34=function(_0x448b4c,_0x5f1cc8){_0x448b4c=_0x448b4c-0x0;var _0x47f3a6=_0xa34d[_0x448b4c];return _0x47f3a6;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xda34('0x0'));function checkNameSurname(_0x354b4c,_0x334a49,_0xfddaca){var _0x3fb0b2='';if(!_[_0xda34('0x1')](_0x334a49)&&_0xda34('0x2')===typeof _0x334a49){_0x3fb0b2+=_0x334a49;}if(!_[_0xda34('0x1')](_0xfddaca)&&_0xda34('0x2')===typeof _0xfddaca){_0x3fb0b2+='\x20'+_0xfddaca;}if(_0x3fb0b2!==''){return _0x3fb0b2;}return _0x354b4c;}function Action(_0x145829,_0x5b4425,_0x2b5313){this[_0xda34('0x3')]=_0x145829;this[_0xda34('0x4')]=_0x2b5313||undefined;this['name']=checkNameSurname(_0x5b4425[_0xda34('0x5')]['phone'],_0x5b4425[_0xda34('0x5')][_0xda34('0x6')],_0x5b4425[_0xda34('0x5')][_0xda34('0x7')]);this[_0xda34('0x8')]=_0x5b4425['phone'];this['queue']=_0x145829[_0xda34('0x9')];this[_0xda34('0xa')]=_0x5b4425[_0xda34('0xa')]||![];this['type']=_0x145829[_0xda34('0xb')];this[_0xda34('0xc')]=_0x145829[_0xda34('0xc')]||0x3;this['scheduledat']=_0x5b4425[_0xda34('0xd')];this[_0xda34('0xe')]=_0x5b4425[_0xda34('0xe')];this[_0xda34('0xf')]=_0x5b4425[_0xda34('0xf')];this['countnoanswerretry']=_0x5b4425[_0xda34('0x10')];this[_0xda34('0x11')]=_0x5b4425[_0xda34('0x11')];this['countdropretry']=_0x5b4425['countdropretry'];this[_0xda34('0x12')]=_0x5b4425['countabandonedretry'];this['countmachineretry']=_0x5b4425['countmachineretry'];this[_0xda34('0x13')]=_0x5b4425[_0xda34('0x13')];this[_0xda34('0x14')]=_0x5b4425[_0xda34('0x14')];this[_0xda34('0x15')]=_0x5b4425[_0xda34('0x15')];this[_0xda34('0x16')]=_0x5b4425[_0xda34('0x16')];this[_0xda34('0x17')]=_0x5b4425['VoiceQueueId'];this['CampaignId']=_0x5b4425['CampaignId'];this['idHopper']=_0x5b4425['id'];this['ContactFirstName']=_0x5b4425[_0xda34('0x5')]['firstName']||'';this['starttime']=moment()[_0xda34('0x18')](_0xda34('0x19'));this[_0xda34('0x1a')]=_0x5b4425[_0xda34('0x1a')];this[_0xda34('0x1b')]=_0x5b4425['callbackuniqueid'];this['callbackat']=_0x5b4425['callbackat'];this['recallme']=_0x5b4425[_0xda34('0x1c')];this[_0xda34('0x1d')]='';this[_0xda34('0x1e')]='';}Action[_0xda34('0x1f')][_0xda34('0x20')]=function(){return util[_0xda34('0x18')](_0xda34('0x21'),this['name'],this['voiceQueue']['dialCutDigit']>0x0?this['number'][_0xda34('0x22')](this[_0xda34('0x3')][_0xda34('0x23')]):this[_0xda34('0x8')]);};Action[_0xda34('0x1f')][_0xda34('0x24')]=function(){return this['queue'];};module[_0xda34('0x25')]=Action; \ No newline at end of file +var _0xd6d9=['countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','queue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','lastName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x3bf7f9,_0x3aa6f9){var _0x419c57=function(_0x1b06a0){while(--_0x1b06a0){_0x3bf7f9['push'](_0x3bf7f9['shift']());}};_0x419c57(++_0x3aa6f9);}(_0xd6d9,0x176));var _0x9d6d=function(_0x23c42e,_0x3109ed){_0x23c42e=_0x23c42e-0x0;var _0x4b0520=_0xd6d9[_0x23c42e];return _0x4b0520;};'use strict';var util=require(_0x9d6d('0x0'));var _=require(_0x9d6d('0x1'));var moment=require(_0x9d6d('0x2'));function checkNameSurname(_0x561207,_0x3e09fc,_0x2002ea){var _0x152ca0='';if(!_[_0x9d6d('0x3')](_0x3e09fc)&&'string'===typeof _0x3e09fc){_0x152ca0+=_0x3e09fc;}if(!_[_0x9d6d('0x3')](_0x2002ea)&&_0x9d6d('0x4')===typeof _0x2002ea){_0x152ca0+='\x20'+_0x2002ea;}if(_0x152ca0!==''){return _0x152ca0;}return _0x561207;}function Action(_0x3dd5cf,_0x178b60,_0x36a421){this[_0x9d6d('0x5')]=_0x3dd5cf;this[_0x9d6d('0x6')]=_0x36a421||undefined;this[_0x9d6d('0x7')]=checkNameSurname(_0x178b60[_0x9d6d('0x8')]['phone'],_0x178b60[_0x9d6d('0x8')]['firstName'],_0x178b60[_0x9d6d('0x8')][_0x9d6d('0x9')]);this[_0x9d6d('0xa')]=_0x178b60[_0x9d6d('0xb')];this['queue']=_0x3dd5cf['name'];this[_0x9d6d('0xc')]=_0x178b60[_0x9d6d('0xc')]||![];this[_0x9d6d('0xd')]=_0x3dd5cf['type'];this[_0x9d6d('0xe')]=_0x3dd5cf[_0x9d6d('0xe')]||0x3;this[_0x9d6d('0xf')]=_0x178b60[_0x9d6d('0xf')];this[_0x9d6d('0x10')]=_0x178b60[_0x9d6d('0x10')];this['countcongestionretry']=_0x178b60['countcongestionretry'];this[_0x9d6d('0x11')]=_0x178b60[_0x9d6d('0x11')];this[_0x9d6d('0x12')]=_0x178b60[_0x9d6d('0x12')];this[_0x9d6d('0x13')]=_0x178b60[_0x9d6d('0x13')];this['countabandonedretry']=_0x178b60[_0x9d6d('0x14')];this[_0x9d6d('0x15')]=_0x178b60[_0x9d6d('0x15')];this[_0x9d6d('0x16')]=_0x178b60[_0x9d6d('0x16')];this[_0x9d6d('0x17')]=_0x178b60[_0x9d6d('0x17')];this[_0x9d6d('0x18')]=_0x178b60[_0x9d6d('0x18')];this[_0x9d6d('0x19')]=_0x178b60[_0x9d6d('0x19')];this[_0x9d6d('0x1a')]=_0x178b60['VoiceQueueId'];this[_0x9d6d('0x1b')]=_0x178b60[_0x9d6d('0x1b')];this[_0x9d6d('0x1c')]=_0x178b60['id'];this[_0x9d6d('0x1d')]=_0x178b60[_0x9d6d('0x8')][_0x9d6d('0x1e')]||'';this['starttime']=moment()[_0x9d6d('0x1f')](_0x9d6d('0x20'));this[_0x9d6d('0x21')]=_0x178b60[_0x9d6d('0x21')];this[_0x9d6d('0x22')]=_0x178b60[_0x9d6d('0x22')];this['callbackat']=_0x178b60[_0x9d6d('0x23')];this[_0x9d6d('0x24')]=_0x178b60[_0x9d6d('0x24')];this['originatecalleridnum']='';this[_0x9d6d('0x25')]='';}Action[_0x9d6d('0x26')][_0x9d6d('0x27')]=function(){return util[_0x9d6d('0x1f')](_0x9d6d('0x28'),this[_0x9d6d('0x7')],this[_0x9d6d('0x5')]['dialCutDigit']>0x0?this[_0x9d6d('0xa')]['substring'](this[_0x9d6d('0x5')][_0x9d6d('0x29')]):this[_0x9d6d('0xa')]);};Action['prototype'][_0x9d6d('0x2a')]=function(){return this[_0x9d6d('0x2b')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 03c56a4..5175eb2 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x460c=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x6c0b0a,_0x496391){var _0x5f456a=function(_0x5ae918){while(--_0x5ae918){_0x6c0b0a['push'](_0x6c0b0a['shift']());}};_0x5f456a(++_0x496391);}(_0x460c,0xc5));var _0xc460=function(_0x48cf1e,_0x16ee55){_0x48cf1e=_0x48cf1e-0x0;var _0x23bc50=_0x460c[_0x48cf1e];return _0x23bc50;};'use strict';var util=require(_0xc460('0x0'));var _=require(_0xc460('0x1'));var moment=require('moment');function getSeconds(_0x370fc5,_0x1d287a){var _0x2aa00f=moment(_0x370fc5)[_0xc460('0x2')](0x0);var _0x2f8df0=moment(_0x1d287a)[_0xc460('0x2')](0x0);return _0x2aa00f[_0xc460('0x3')](_0x2f8df0,_0xc460('0x4'));}function AgentComplete(_0x3c5cd5,_0x2d8167){this[_0xc460('0x5')]=0x4;this[_0xc460('0x6')]=_0xc460('0x7');this['scheduledat']=_0x3c5cd5[_0xc460('0x8')];this['type']=_0x3c5cd5[_0xc460('0x9')];this['campaigntype']=_0x3c5cd5[_0xc460('0x9')]===_0xc460('0xa')?_0xc460('0xb'):_0x3c5cd5[_0xc460('0x9')];this[_0xc460('0xc')]=_0x3c5cd5[_0xc460('0xc')];this[_0xc460('0xd')]=_0x3c5cd5[_0xc460('0xd')];this[_0xc460('0xe')]=_0x3c5cd5[_0xc460('0xe')];this[_0xc460('0xf')]=_0x3c5cd5[_0xc460('0xc')]+_0x3c5cd5['countcongestionretry']+_0x3c5cd5[_0xc460('0xe')]+_0x3c5cd5[_0xc460('0x10')]+_0x3c5cd5['countdropretry']+_0x3c5cd5[_0xc460('0x11')]+_0x3c5cd5['countmachineretry']+_0x3c5cd5[_0xc460('0x12')];this['countnosuchnumberretry']=_0x3c5cd5[_0xc460('0x10')];this[_0xc460('0x13')]=_0x3c5cd5[_0xc460('0x13')];this['countabandonedretry']=_0x3c5cd5[_0xc460('0x11')];this['countmachineretry']=_0x3c5cd5[_0xc460('0x14')];this[_0xc460('0x12')]=_0x3c5cd5[_0xc460('0x12')];this[_0xc460('0x15')]=_0x2d8167[_0xc460('0x15')];this[_0xc460('0x16')]=_0x3c5cd5[_0xc460('0x17')];this[_0xc460('0x18')]=_0x3c5cd5[_0xc460('0x19')];this[_0xc460('0x1a')]=_0x3c5cd5[_0xc460('0x1a')];this[_0xc460('0x1b')]=_0x3c5cd5[_0xc460('0x1b')];this[_0xc460('0x1c')]=_0x3c5cd5[_0xc460('0x1c')];this[_0xc460('0x1d')]=moment()[_0xc460('0x1e')](_0xc460('0x1f'));this[_0xc460('0x20')]=getSeconds(_0x3c5cd5[_0xc460('0x1b')],_0x3c5cd5[_0xc460('0x1a')]);this[_0xc460('0x21')]=getSeconds(_0x3c5cd5[_0xc460('0x1c')],_0x3c5cd5[_0xc460('0x1b')]);this['talktime']=getSeconds(this[_0xc460('0x1d')],_0x3c5cd5[_0xc460('0x1c')]);this['queue']=_0x2d8167['queue'];this[_0xc460('0x22')]=_0x2d8167['membername'];this[_0xc460('0x23')]=_0x2d8167[_0xc460('0x23')];this[_0xc460('0x24')]=_0x3c5cd5['callback'];this[_0xc460('0x25')]=_0x3c5cd5['callbackuniqueid'];this[_0xc460('0x26')]=_0x3c5cd5[_0xc460('0x26')];this[_0xc460('0x27')]=_0x3c5cd5[_0xc460('0x27')];this[_0xc460('0x28')]=_0x3c5cd5[_0xc460('0x28')];this[_0xc460('0x29')]=_0x3c5cd5[_0xc460('0x29')];this[_0xc460('0x2a')]=_0x3c5cd5[_0xc460('0x2a')];this['VoiceQueueId']=_0x3c5cd5[_0xc460('0x2b')];this[_0xc460('0x2c')]=_0x3c5cd5[_0xc460('0x2c')];this[_0xc460('0x2d')]=_0x3c5cd5['originatecalleridnum']||'';this[_0xc460('0x2e')]=_0x3c5cd5[_0xc460('0x2e')]||'';}module[_0xc460('0x2f')]=AgentComplete; \ No newline at end of file +var _0x2d74=['callbackat','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x2d74,0x12d));var _0x42d7=function(_0xaf31e6,_0x37f0d7){_0xaf31e6=_0xaf31e6-0x0;var _0x5834ee=_0x2d74[_0xaf31e6];return _0x5834ee;};'use strict';var util=require('util');var _=require(_0x42d7('0x0'));var moment=require(_0x42d7('0x1'));function getSeconds(_0x586429,_0x1f0680){var _0x248aea=moment(_0x586429)['milliseconds'](0x0);var _0x2784b0=moment(_0x1f0680)[_0x42d7('0x2')](0x0);return _0x248aea['diff'](_0x2784b0,_0x42d7('0x3'));}function AgentComplete(_0x280bf2,_0x12c4e1){this[_0x42d7('0x4')]=0x4;this[_0x42d7('0x5')]=_0x42d7('0x6');this[_0x42d7('0x7')]=_0x280bf2[_0x42d7('0x7')];this['type']=_0x280bf2[_0x42d7('0x8')];this[_0x42d7('0x9')]=_0x280bf2[_0x42d7('0x8')]===_0x42d7('0xa')?_0x42d7('0xb'):_0x280bf2[_0x42d7('0x8')];this['countbusyretry']=_0x280bf2['countbusyretry'];this[_0x42d7('0xc')]=_0x280bf2[_0x42d7('0xc')];this[_0x42d7('0xd')]=_0x280bf2[_0x42d7('0xd')];this[_0x42d7('0xe')]=_0x280bf2[_0x42d7('0xf')]+_0x280bf2[_0x42d7('0xc')]+_0x280bf2[_0x42d7('0xd')]+_0x280bf2[_0x42d7('0x10')]+_0x280bf2[_0x42d7('0x11')]+_0x280bf2[_0x42d7('0x12')]+_0x280bf2[_0x42d7('0x13')]+_0x280bf2[_0x42d7('0x14')];this[_0x42d7('0x10')]=_0x280bf2[_0x42d7('0x10')];this[_0x42d7('0x11')]=_0x280bf2[_0x42d7('0x11')];this[_0x42d7('0x12')]=_0x280bf2[_0x42d7('0x12')];this[_0x42d7('0x13')]=_0x280bf2[_0x42d7('0x13')];this[_0x42d7('0x14')]=_0x280bf2[_0x42d7('0x14')];this[_0x42d7('0x15')]=_0x12c4e1[_0x42d7('0x15')];this[_0x42d7('0x16')]=_0x280bf2['name'];this['calleridnum']=_0x280bf2['number'];this[_0x42d7('0x17')]=_0x280bf2[_0x42d7('0x17')];this[_0x42d7('0x18')]=_0x280bf2[_0x42d7('0x18')];this[_0x42d7('0x19')]=_0x280bf2[_0x42d7('0x19')];this[_0x42d7('0x1a')]=moment()[_0x42d7('0x1b')](_0x42d7('0x1c'));this[_0x42d7('0x1d')]=getSeconds(_0x280bf2[_0x42d7('0x18')],_0x280bf2[_0x42d7('0x17')]);this[_0x42d7('0x1e')]=getSeconds(_0x280bf2['answertime'],_0x280bf2['responsetime']);this['talktime']=getSeconds(this[_0x42d7('0x1a')],_0x280bf2[_0x42d7('0x19')]);this['queue']=_0x12c4e1[_0x42d7('0xb')];this[_0x42d7('0x1f')]=_0x12c4e1[_0x42d7('0x1f')];this[_0x42d7('0x20')]=_0x12c4e1[_0x42d7('0x20')];this[_0x42d7('0x21')]=_0x280bf2[_0x42d7('0x21')];this[_0x42d7('0x22')]=_0x280bf2[_0x42d7('0x22')];this['callbackat']=_0x280bf2[_0x42d7('0x23')];this['recallme']=_0x280bf2['recallme'];this['ContactId']=_0x280bf2['ContactId'];this[_0x42d7('0x24')]=_0x280bf2[_0x42d7('0x24')];this[_0x42d7('0x25')]=_0x280bf2[_0x42d7('0x25')];this[_0x42d7('0x26')]=_0x280bf2[_0x42d7('0x26')];this['CampaignId']=_0x280bf2['CampaignId'];this[_0x42d7('0x27')]=_0x280bf2[_0x42d7('0x27')]||'';this[_0x42d7('0x28')]=_0x280bf2[_0x42d7('0x28')]||'';}module[_0x42d7('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 89d5d49..a161ede 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce50=['scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','lodash','moment','milliseconds','uniqueid'];(function(_0x29034b,_0x1f8ee5){var _0x3f446f=function(_0x22bd42){while(--_0x22bd42){_0x29034b['push'](_0x29034b['shift']());}};_0x3f446f(++_0x1f8ee5);}(_0xce50,0x1d8));var _0x0ce5=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xce50[_0x138adb];return _0x1b27f2;};'use strict';var util=require('util');var _=require(_0x0ce5('0x0'));var moment=require(_0x0ce5('0x1'));function getSeconds(_0x5ddd3c,_0x363236){var _0x1eddd3=moment(_0x5ddd3c)['milliseconds'](0x0);var _0x5969ab=moment(_0x363236)[_0x0ce5('0x2')](0x0);return _0x1eddd3['diff'](_0x5969ab,'seconds');}function Final(_0x15c8ba){this[_0x0ce5('0x3')]=_0x15c8ba[_0x0ce5('0x3')];this[_0x0ce5('0x4')]=_0x15c8ba['scheduledat'];this[_0x0ce5('0x5')]=_0x15c8ba[_0x0ce5('0x5')];this['campaigntype']=_0x15c8ba[_0x0ce5('0x5')]==='outbound'?_0x0ce5('0x6'):_0x15c8ba[_0x0ce5('0x5')];this[_0x0ce5('0x7')]=_0x15c8ba[_0x0ce5('0x7')];this['countcongestionretry']=_0x15c8ba[_0x0ce5('0x8')];this[_0x0ce5('0x9')]=_0x15c8ba[_0x0ce5('0x9')];this[_0x0ce5('0xa')]=_0x15c8ba[_0x0ce5('0x7')]+_0x15c8ba['countcongestionretry']+_0x15c8ba['countnoanswerretry']+_0x15c8ba['countnosuchnumberretry']+_0x15c8ba[_0x0ce5('0xb')]+_0x15c8ba[_0x0ce5('0xc')]+_0x15c8ba[_0x0ce5('0xd')]+_0x15c8ba[_0x0ce5('0xe')];this['countnosuchnumberretry']=_0x15c8ba[_0x0ce5('0xf')];this[_0x0ce5('0xb')]=_0x15c8ba['countdropretry'];this[_0x0ce5('0xc')]=_0x15c8ba['countabandonedretry'];this[_0x0ce5('0xd')]=_0x15c8ba[_0x0ce5('0xd')];this[_0x0ce5('0xe')]=_0x15c8ba[_0x0ce5('0xe')];this[_0x0ce5('0x6')]=_0x15c8ba[_0x0ce5('0x6')];this[_0x0ce5('0x10')]=_0x15c8ba[_0x0ce5('0x10')];this['calleridnum']=_0x15c8ba[_0x0ce5('0x11')];this[_0x0ce5('0x12')]=_0x15c8ba['starttime'];this['responsetime']=_0x15c8ba[_0x0ce5('0x13')];this['endtime']=_0x15c8ba[_0x0ce5('0x13')];this[_0x0ce5('0x14')]=_0x15c8ba[_0x0ce5('0x14')]||0x0;this[_0x0ce5('0x15')]=_0x15c8ba[_0x0ce5('0x15')]||0x0;this[_0x0ce5('0x16')]=_0x15c8ba['talktime']||0x0;this[_0x0ce5('0x17')]=_0x15c8ba[_0x0ce5('0x17')];this[_0x0ce5('0x18')]=_0x15c8ba[_0x0ce5('0x18')];this['callbackat']=_0x15c8ba[_0x0ce5('0x19')];this['recallme']=_0x15c8ba[_0x0ce5('0x1a')];this[_0x0ce5('0x1b')]=_0x15c8ba[_0x0ce5('0x1b')];this[_0x0ce5('0x1c')]=_0x15c8ba[_0x0ce5('0x1c')];this[_0x0ce5('0x1d')]=_0x15c8ba[_0x0ce5('0x1d')];this[_0x0ce5('0x1e')]=_0x15c8ba[_0x0ce5('0x1e')];this[_0x0ce5('0x1f')]=_0x15c8ba['CampaignId'];this['originatecalleridnum']=_0x15c8ba[_0x0ce5('0x20')]||'';this['originatecalleridname']=_0x15c8ba['originatecalleridname']||'';}module[_0x0ce5('0x21')]=Final; \ No newline at end of file +var _0xa23f=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','responsetime','ringtime','holdtime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa23f,0x7c));var _0xfa23=function(_0x32abbe,_0x5848b0){_0x32abbe=_0x32abbe-0x0;var _0x16ecc7=_0xa23f[_0x32abbe];return _0x16ecc7;};'use strict';var util=require(_0xfa23('0x0'));var _=require(_0xfa23('0x1'));var moment=require('moment');function getSeconds(_0x48fd46,_0xb81edf){var _0x3f714c=moment(_0x48fd46)[_0xfa23('0x2')](0x0);var _0x3fe466=moment(_0xb81edf)['milliseconds'](0x0);return _0x3f714c[_0xfa23('0x3')](_0x3fe466,'seconds');}function Final(_0x210057){this[_0xfa23('0x4')]=_0x210057[_0xfa23('0x4')];this[_0xfa23('0x5')]=_0x210057['scheduledat'];this[_0xfa23('0x6')]=_0x210057['type'];this[_0xfa23('0x7')]=_0x210057[_0xfa23('0x6')]===_0xfa23('0x8')?_0xfa23('0x9'):_0x210057[_0xfa23('0x6')];this['countbusyretry']=_0x210057['countbusyretry'];this[_0xfa23('0xa')]=_0x210057['countcongestionretry'];this[_0xfa23('0xb')]=_0x210057['countnoanswerretry'];this[_0xfa23('0xc')]=_0x210057[_0xfa23('0xd')]+_0x210057[_0xfa23('0xa')]+_0x210057['countnoanswerretry']+_0x210057[_0xfa23('0xe')]+_0x210057[_0xfa23('0xf')]+_0x210057[_0xfa23('0x10')]+_0x210057['countmachineretry']+_0x210057['countagentrejectretry'];this[_0xfa23('0xe')]=_0x210057[_0xfa23('0xe')];this[_0xfa23('0xf')]=_0x210057[_0xfa23('0xf')];this['countabandonedretry']=_0x210057[_0xfa23('0x10')];this[_0xfa23('0x11')]=_0x210057[_0xfa23('0x11')];this[_0xfa23('0x12')]=_0x210057['countagentrejectretry'];this[_0xfa23('0x9')]=_0x210057[_0xfa23('0x9')];this[_0xfa23('0x13')]=_0x210057[_0xfa23('0x13')];this[_0xfa23('0x14')]=_0x210057['calleridnum'];this['starttime']=_0x210057['starttime'];this[_0xfa23('0x15')]=_0x210057[_0xfa23('0x15')];this['endtime']=_0x210057[_0xfa23('0x15')];this[_0xfa23('0x16')]=_0x210057[_0xfa23('0x16')]||0x0;this['holdtime']=_0x210057[_0xfa23('0x17')]||0x0;this[_0xfa23('0x18')]=_0x210057['talktime']||0x0;this[_0xfa23('0x19')]=_0x210057[_0xfa23('0x19')];this[_0xfa23('0x1a')]=_0x210057[_0xfa23('0x1a')];this[_0xfa23('0x1b')]=_0x210057[_0xfa23('0x1b')];this[_0xfa23('0x1c')]=_0x210057['recallme'];this[_0xfa23('0x1d')]=_0x210057[_0xfa23('0x1d')];this[_0xfa23('0x1e')]=_0x210057[_0xfa23('0x1e')];this['UserId']=_0x210057[_0xfa23('0x1f')];this['VoiceQueueId']=_0x210057[_0xfa23('0x20')];this[_0xfa23('0x21')]=_0x210057[_0xfa23('0x21')];this[_0xfa23('0x22')]=_0x210057[_0xfa23('0x22')]||'';this[_0xfa23('0x23')]=_0x210057[_0xfa23('0x23')]||'';}module[_0xfa23('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 82c6129..1cae74f 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebb2=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','seconds','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x26945d,_0x497c7c){var _0x11e56f=function(_0x2c1903){while(--_0x2c1903){_0x26945d['push'](_0x26945d['shift']());}};_0x11e56f(++_0x497c7c);}(_0xebb2,0x68));var _0x2ebb=function(_0x1a5858,_0x41d401){_0x1a5858=_0x1a5858-0x0;var _0x22cbc3=_0xebb2[_0x1a5858];return _0x22cbc3;};'use strict';var util=require(_0x2ebb('0x0'));var _=require(_0x2ebb('0x1'));var moment=require('moment');function getSeconds(_0x56c93f,_0x217fb4){var _0x2a44f1=moment(_0x56c93f)[_0x2ebb('0x2')](0x0);var _0x508a33=moment(_0x217fb4)[_0x2ebb('0x2')](0x0);return _0x2a44f1['diff'](_0x508a33,_0x2ebb('0x3'));}function Hangup(_0x3ef484,_0x433543){this['state']=0x4;this[_0x2ebb('0x4')]=_0x2ebb('0x5');this[_0x2ebb('0x6')]=_0x3ef484['scheduledat'];this[_0x2ebb('0x7')]=_0x3ef484[_0x2ebb('0x7')];this['campaigntype']=_0x3ef484[_0x2ebb('0x7')]===_0x2ebb('0x8')?_0x2ebb('0x9'):_0x3ef484['type'];this[_0x2ebb('0xa')]=_0x3ef484[_0x2ebb('0xa')];this['countcongestionretry']=_0x3ef484[_0x2ebb('0xb')];this[_0x2ebb('0xc')]=_0x3ef484[_0x2ebb('0xc')];this['countglobal']=_0x3ef484[_0x2ebb('0xa')]+_0x3ef484[_0x2ebb('0xb')]+_0x3ef484[_0x2ebb('0xc')]+_0x3ef484[_0x2ebb('0xd')]+_0x3ef484[_0x2ebb('0xe')]+_0x3ef484[_0x2ebb('0xf')]+_0x3ef484[_0x2ebb('0x10')]+_0x3ef484[_0x2ebb('0x11')];this['countnosuchnumberretry']=_0x3ef484[_0x2ebb('0xd')];this['countdropretry']=_0x3ef484[_0x2ebb('0xe')];this['countabandonedretry']=_0x3ef484[_0x2ebb('0xf')];this[_0x2ebb('0x10')]=_0x3ef484[_0x2ebb('0x10')];this['countagentrejectretry']=_0x3ef484['countagentrejectretry'];this[_0x2ebb('0x12')]=_0x433543[_0x2ebb('0x12')];this[_0x2ebb('0x13')]=_0x3ef484[_0x2ebb('0x14')];this[_0x2ebb('0x15')]=_0x3ef484[_0x2ebb('0x16')];this[_0x2ebb('0x17')]=_0x3ef484[_0x2ebb('0x17')];this[_0x2ebb('0x18')]=_0x3ef484['responsetime'];this[_0x2ebb('0x19')]=moment()[_0x2ebb('0x1a')](_0x2ebb('0x1b'));this[_0x2ebb('0x1c')]=getSeconds(_0x3ef484[_0x2ebb('0x18')],_0x3ef484[_0x2ebb('0x17')]);this[_0x2ebb('0x1d')]=0x0;this[_0x2ebb('0x1e')]=getSeconds(this[_0x2ebb('0x19')],_0x3ef484[_0x2ebb('0x18')]);this['queue']=_0x3ef484[_0x2ebb('0x9')];this[_0x2ebb('0x1f')]=_0x2ebb('0x20');this['reason']=_0x433543[_0x2ebb('0x21')];this[_0x2ebb('0x22')]=_0x3ef484['callback'];this['callbackuniqueid']=_0x3ef484[_0x2ebb('0x23')];this[_0x2ebb('0x24')]=_0x3ef484[_0x2ebb('0x24')];this[_0x2ebb('0x25')]=_0x3ef484['recallme'];this[_0x2ebb('0x26')]=_0x3ef484[_0x2ebb('0x26')];this['ListId']=_0x3ef484['ListId'];this['UserId']=_0x3ef484[_0x2ebb('0x27')];this['VoiceQueueId']=_0x3ef484[_0x2ebb('0x28')];this[_0x2ebb('0x29')]=_0x3ef484[_0x2ebb('0x29')];}module[_0x2ebb('0x2a')]=Hangup; \ No newline at end of file +var _0xd0d2=['lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','endtime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ListId','VoiceQueueId','CampaignId','exports','util'];(function(_0x3eb5c4,_0x4bbf6d){var _0x2f2b22=function(_0x5dfa8a){while(--_0x5dfa8a){_0x3eb5c4['push'](_0x3eb5c4['shift']());}};_0x2f2b22(++_0x4bbf6d);}(_0xd0d2,0x199));var _0x2d0d=function(_0x37031f,_0x16a8e8){_0x37031f=_0x37031f-0x0;var _0x35192b=_0xd0d2[_0x37031f];return _0x35192b;};'use strict';var util=require(_0x2d0d('0x0'));var _=require(_0x2d0d('0x1'));var moment=require(_0x2d0d('0x2'));function getSeconds(_0x2285e6,_0x4d86cb){var _0xe669c6=moment(_0x2285e6)[_0x2d0d('0x3')](0x0);var _0x52fb35=moment(_0x4d86cb)[_0x2d0d('0x3')](0x0);return _0xe669c6[_0x2d0d('0x4')](_0x52fb35,_0x2d0d('0x5'));}function Hangup(_0x9e8066,_0x564dbc){this['state']=0x4;this[_0x2d0d('0x6')]=_0x2d0d('0x7');this[_0x2d0d('0x8')]=_0x9e8066[_0x2d0d('0x8')];this[_0x2d0d('0x9')]=_0x9e8066[_0x2d0d('0x9')];this['campaigntype']=_0x9e8066[_0x2d0d('0x9')]==='outbound'?_0x2d0d('0xa'):_0x9e8066[_0x2d0d('0x9')];this[_0x2d0d('0xb')]=_0x9e8066['countbusyretry'];this['countcongestionretry']=_0x9e8066[_0x2d0d('0xc')];this[_0x2d0d('0xd')]=_0x9e8066[_0x2d0d('0xd')];this['countglobal']=_0x9e8066[_0x2d0d('0xb')]+_0x9e8066[_0x2d0d('0xc')]+_0x9e8066[_0x2d0d('0xd')]+_0x9e8066[_0x2d0d('0xe')]+_0x9e8066['countdropretry']+_0x9e8066[_0x2d0d('0xf')]+_0x9e8066['countmachineretry']+_0x9e8066['countagentrejectretry'];this['countnosuchnumberretry']=_0x9e8066[_0x2d0d('0xe')];this['countdropretry']=_0x9e8066[_0x2d0d('0x10')];this[_0x2d0d('0xf')]=_0x9e8066[_0x2d0d('0xf')];this[_0x2d0d('0x11')]=_0x9e8066['countmachineretry'];this[_0x2d0d('0x12')]=_0x9e8066[_0x2d0d('0x12')];this['uniqueid']=_0x564dbc[_0x2d0d('0x13')];this[_0x2d0d('0x14')]=_0x9e8066[_0x2d0d('0x15')];this[_0x2d0d('0x16')]=_0x9e8066['number'];this['starttime']=_0x9e8066[_0x2d0d('0x17')];this[_0x2d0d('0x18')]=_0x9e8066['responsetime'];this['endtime']=moment()[_0x2d0d('0x19')](_0x2d0d('0x1a'));this[_0x2d0d('0x1b')]=getSeconds(_0x9e8066[_0x2d0d('0x18')],_0x9e8066[_0x2d0d('0x17')]);this['holdtime']=0x0;this[_0x2d0d('0x1c')]=getSeconds(this[_0x2d0d('0x1d')],_0x9e8066[_0x2d0d('0x18')]);this[_0x2d0d('0xa')]=_0x9e8066[_0x2d0d('0xa')];this[_0x2d0d('0x1e')]='IVR';this[_0x2d0d('0x1f')]=_0x564dbc[_0x2d0d('0x20')];this[_0x2d0d('0x21')]=_0x9e8066[_0x2d0d('0x21')];this['callbackuniqueid']=_0x9e8066[_0x2d0d('0x22')];this[_0x2d0d('0x23')]=_0x9e8066[_0x2d0d('0x23')];this[_0x2d0d('0x24')]=_0x9e8066[_0x2d0d('0x24')];this['ContactId']=_0x9e8066['ContactId'];this['ListId']=_0x9e8066[_0x2d0d('0x25')];this['UserId']=_0x9e8066['UserId'];this['VoiceQueueId']=_0x9e8066[_0x2d0d('0x26')];this[_0x2d0d('0x27')]=_0x9e8066['CampaignId'];}module[_0x2d0d('0x28')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index e803c7d..881ed87 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7586=['util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countnoanswerretry','countglobal','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports'];(function(_0x4c1a8c,_0x245e75){var _0x2f3b80=function(_0x3f87a8){while(--_0x3f87a8){_0x4c1a8c['push'](_0x4c1a8c['shift']());}};_0x2f3b80(++_0x245e75);}(_0x7586,0x17c));var _0x6758=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0x7586[_0x4a0e68];return _0x4fb274;};'use strict';var util=require(_0x6758('0x0'));var _=require(_0x6758('0x1'));var moment=require('moment');function getSeconds(_0xff3be6,_0x43cd31){var _0x201bf2=moment(_0xff3be6)[_0x6758('0x2')](0x0);var _0x3241a2=moment(_0x43cd31)[_0x6758('0x2')](0x0);return _0x201bf2[_0x6758('0x3')](_0x3241a2,_0x6758('0x4'));}function History(_0x166828){this[_0x6758('0x5')]=_0x166828[_0x6758('0x5')];this[_0x6758('0x6')]=_0x166828[_0x6758('0x6')]||undefined;this['type']=_0x166828[_0x6758('0x7')];this[_0x6758('0x8')]=_0x166828[_0x6758('0x7')]==='outbound'?_0x6758('0x9'):_0x166828[_0x6758('0x7')];this['countbusyretry']=_0x166828['countbusyretry'];this['countcongestionretry']=_0x166828['countcongestionretry'];this[_0x6758('0xa')]=_0x166828['countnoanswerretry'];this[_0x6758('0xb')]=_0x166828[_0x6758('0xc')]+_0x166828[_0x6758('0xd')]+_0x166828['countnoanswerretry']+_0x166828[_0x6758('0xe')]+_0x166828['countdropretry']+_0x166828[_0x6758('0xf')]+_0x166828[_0x6758('0x10')]+_0x166828[_0x6758('0x11')];this[_0x6758('0xe')]=_0x166828[_0x6758('0xe')];this[_0x6758('0x12')]=_0x166828[_0x6758('0x12')];this[_0x6758('0xf')]=_0x166828[_0x6758('0xf')];this['countmachineretry']=_0x166828['countmachineretry'];this['countagentrejectretry']=_0x166828[_0x6758('0x11')];this['queue']=_0x166828['queue'];this[_0x6758('0x13')]=_0x166828['name'];this[_0x6758('0x14')]=_0x166828['number'];this[_0x6758('0x15')]=_0x166828['starttime'];this[_0x6758('0x16')]=_0x166828[_0x6758('0x16')];this[_0x6758('0x17')]=_0x166828[_0x6758('0x16')];this[_0x6758('0x18')]=getSeconds(_0x166828[_0x6758('0x16')],_0x166828['starttime']);this[_0x6758('0x19')]=0x0;this[_0x6758('0x1a')]=0x0;this[_0x6758('0x1b')]=_0x166828[_0x6758('0x1b')];this[_0x6758('0x1c')]=_0x166828[_0x6758('0x1c')];this[_0x6758('0x1d')]=_0x166828['callbackat'];this[_0x6758('0x1e')]=_0x166828[_0x6758('0x1e')];this[_0x6758('0x1f')]=_0x166828[_0x6758('0x1f')];this[_0x6758('0x20')]=_0x166828[_0x6758('0x20')];this['UserId']=_0x166828[_0x6758('0x21')];this[_0x6758('0x22')]=_0x166828[_0x6758('0x22')];this['CampaignId']=_0x166828['CampaignId'];this['originatecalleridnum']=_0x166828[_0x6758('0x23')]||'';this['originatecalleridname']=_0x166828[_0x6758('0x24')]||'';}module[_0x6758('0x25')]=History; \ No newline at end of file +var _0x70e1=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','campaigntype','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','name','number','starttime','responsetime','endtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x1c3c59,_0x5f251a){var _0x1100b7=function(_0x1cf80c){while(--_0x1cf80c){_0x1c3c59['push'](_0x1c3c59['shift']());}};_0x1100b7(++_0x5f251a);}(_0x70e1,0x111));var _0x170e=function(_0x48c6a8,_0x11e119){_0x48c6a8=_0x48c6a8-0x0;var _0x23456b=_0x70e1[_0x48c6a8];return _0x23456b;};'use strict';var util=require(_0x170e('0x0'));var _=require(_0x170e('0x1'));var moment=require(_0x170e('0x2'));function getSeconds(_0x300a6a,_0xe7ca61){var _0x372458=moment(_0x300a6a)[_0x170e('0x3')](0x0);var _0x55ee1c=moment(_0xe7ca61)['milliseconds'](0x0);return _0x372458['diff'](_0x55ee1c,_0x170e('0x4'));}function History(_0x261384){this[_0x170e('0x5')]=_0x261384['uniqueid'];this['scheduledat']=_0x261384[_0x170e('0x6')]||undefined;this['type']=_0x261384['type'];this[_0x170e('0x7')]=_0x261384[_0x170e('0x8')]==='outbound'?_0x170e('0x9'):_0x261384[_0x170e('0x8')];this[_0x170e('0xa')]=_0x261384[_0x170e('0xa')];this[_0x170e('0xb')]=_0x261384['countcongestionretry'];this[_0x170e('0xc')]=_0x261384[_0x170e('0xc')];this[_0x170e('0xd')]=_0x261384[_0x170e('0xa')]+_0x261384[_0x170e('0xb')]+_0x261384[_0x170e('0xc')]+_0x261384['countnosuchnumberretry']+_0x261384['countdropretry']+_0x261384[_0x170e('0xe')]+_0x261384[_0x170e('0xf')]+_0x261384[_0x170e('0x10')];this[_0x170e('0x11')]=_0x261384[_0x170e('0x11')];this['countdropretry']=_0x261384[_0x170e('0x12')];this['countabandonedretry']=_0x261384[_0x170e('0xe')];this['countmachineretry']=_0x261384['countmachineretry'];this['countagentrejectretry']=_0x261384[_0x170e('0x10')];this[_0x170e('0x9')]=_0x261384[_0x170e('0x9')];this[_0x170e('0x13')]=_0x261384[_0x170e('0x14')];this['calleridnum']=_0x261384[_0x170e('0x15')];this[_0x170e('0x16')]=_0x261384[_0x170e('0x16')];this[_0x170e('0x17')]=_0x261384[_0x170e('0x17')];this[_0x170e('0x18')]=_0x261384['responsetime'];this['ringtime']=getSeconds(_0x261384[_0x170e('0x17')],_0x261384['starttime']);this[_0x170e('0x19')]=0x0;this['talktime']=0x0;this[_0x170e('0x1a')]=_0x261384['callback'];this['callbackuniqueid']=_0x261384[_0x170e('0x1b')];this[_0x170e('0x1c')]=_0x261384[_0x170e('0x1c')];this[_0x170e('0x1d')]=_0x261384[_0x170e('0x1d')];this[_0x170e('0x1e')]=_0x261384['ContactId'];this[_0x170e('0x1f')]=_0x261384['ListId'];this[_0x170e('0x20')]=_0x261384[_0x170e('0x20')];this[_0x170e('0x21')]=_0x261384[_0x170e('0x21')];this['CampaignId']=_0x261384[_0x170e('0x22')];this[_0x170e('0x23')]=_0x261384[_0x170e('0x23')]||'';this[_0x170e('0x24')]=_0x261384[_0x170e('0x24')]||'';}module[_0x170e('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 0ebdf3e..378ac13 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 _0x1eb4=['contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','variables','SIP/%s/%s%s','substring','dialCutDigit','trim','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','reason','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','agentBusyFactor','one\x20call\x20every:','recallme','[booked][checkContactBlack]','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','AVAILABLE_CONTACTS_FINISHED','RUNNING','ivrTotalCallsDays','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','countReScheduled','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Error','m\x20=\x20','[abandonmentRate]','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','localhost','redis','../rpc/cmHopper','../rpc/cmHopperAdditionalPhone','../rpc/voiceQueueRt','../rpc/setting','./history','./agentComplete','./queueCallerAbandon','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','startProgressive','queueBooked','queueBookedRR','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','agentcomplete','custom:queuesummary','custom:queuesummarycomplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','then','previewRecallmeReminderInterval','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','stringify','milliseconds','diff','emit','type','strategy','available','loggedIn','pTalking','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','error','stack','inspect','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','NOT_ACTIVE','statedesc','loopClearZombieChannels','clearZombieChannels','[uniqueid]','actions','[actions]','isNil','Action','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','loggerHandler','emptyContact','saveInDb','pick','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','status','reachable','uniqueid','variable','dialAMDActive','value','HANGUP','state','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','ContactId','ListId','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','countbusyretry','countnoanswerretry','countdropretry','dialGlobalMaxRetry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','syncAgentComplete','agent','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','[rescheduleContact][Drop]','starttime','endtime','calleridname','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridnum','[syncAgentComplete][createHistory][11]','actionid','roundrobin','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncQueueSummaryComplete','dialPreviewRecallmeReminder','online','map','launchHandleIvr','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','phone'];(function(_0x1903cf,_0x4de11d){var _0x4c8ed9=function(_0x2640d9){while(--_0x2640d9){_0x1903cf['push'](_0x1903cf['shift']());}};_0x4c8ed9(++_0x4de11d);}(_0x1eb4,0xae));var _0x41eb=function(_0x21e6af,_0x487f80){_0x21e6af=_0x21e6af-0x0;var _0x94d8c4=_0x1eb4[_0x21e6af];return _0x94d8c4;};'use strict';var util=require(_0x41eb('0x0'));var _=require(_0x41eb('0x1'));var uuid=require(_0x41eb('0x2'));var moment=require(_0x41eb('0x3'));var rr=require('rr');var md5=require(_0x41eb('0x4'));var Redis=require(_0x41eb('0x5'));var ut=require(_0x41eb('0x6'));var config=require(_0x41eb('0x7'));var logger=require('../../../config/logger')(_0x41eb('0x8'));var loggerBooked=require('../../../config/logger')(_0x41eb('0x9'));var loggerPredictive=require(_0x41eb('0xa'))(_0x41eb('0xb'));var loggerPredictiveCalls=require(_0x41eb('0xa'))(_0x41eb('0xc'));var loggerSyncQueueSummary=require(_0x41eb('0xa'))(_0x41eb('0xd'));var ami=require(_0x41eb('0xe'));config['redis']=_[_0x41eb('0xf')](config['redis'],{'host':_0x41eb('0x10'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x41eb('0x11')]));var cmHopper=require(_0x41eb('0x12'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperAdditionalPhone=require(_0x41eb('0x13'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x41eb('0x14'));var RpcSetting=require(_0x41eb('0x15'));var Action=require('./action');var History=require(_0x41eb('0x16'));var Final=require('./final');var AgentComplete=require(_0x41eb('0x17'));var QueueCallerAbandon=require(_0x41eb('0x18'));var Hangup=require('./hangup');var ipAgi=process['env'][_0x41eb('0x19')]||_0x41eb('0x1a');var strategy={'rrmemory':_0x41eb('0x1b'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x41eb('0x1c')][_0x41eb('0x1d')]=function(_0x203520){this[_0x41eb('0x1e')]=this[_0x41eb('0x1e')]?this['tail'][_0x41eb('0x1f')](_0x203520):_0x203520();};function Dialer(_0x258e85,_0x3c9a81){this[_0x41eb('0x20')]=new Sequence();this['preview']=_0x3c9a81;this['voiceQueues']=_0x258e85[_0x41eb('0x21')];this[_0x41eb('0x22')]=_0x258e85['campaigns'];this['agents']=_0x258e85[_0x41eb('0x23')];this['trunks']=_0x258e85[_0x41eb('0x24')];this[_0x41eb('0x25')]=config[_0x41eb('0x25')]||0x2;this[_0x41eb('0x26')]={};this['actions']={};this[_0x41eb('0x27')]={};this[_0x41eb('0x28')]={};this['optionPredictive']={};this['startPredictive']={};this[_0x41eb('0x29')]={};this['ivrOriginated']={};this[_0x41eb('0x2a')]={};this[_0x41eb('0x2b')]={};ami['on']('agentconnect',this[_0x41eb('0x2c')]['bind'](this));ami['on'](_0x41eb('0x2d'),this[_0x41eb('0x2e')]['bind'](this));ami['on'](_0x41eb('0x2f'),this[_0x41eb('0x30')][_0x41eb('0x31')](this));ami['on'](_0x41eb('0x32'),this['syncAgentComplete']['bind'](this));ami['on'](_0x41eb('0x33'),this[_0x41eb('0xd')][_0x41eb('0x31')](this));ami['on'](_0x41eb('0x34'),this['syncQueueSummaryComplete']['bind'](this));ami['on']('hangup',this[_0x41eb('0x35')]['bind'](this));ami['on'](_0x41eb('0x36'),this[_0x41eb('0x37')][_0x41eb('0x31')](this));ami['on'](_0x41eb('0x38'),this[_0x41eb('0x39')][_0x41eb('0x31')](this));ami['on'](_0x41eb('0x3a'),this[_0x41eb('0x3b')][_0x41eb('0x31')](this));ami['on'](_0x41eb('0x3c'),this['syncQueueStatusComplete']['bind'](this));this[_0x41eb('0x3d')]();this['loopClearZombieChannels']();RpcSetting['getSettings']()[_0x41eb('0x3e')](function(_0x2b6b38){previewRecallmeReminderInterval=_0x2b6b38[_0x41eb('0x3f')];});}function isNotNull(_0x26da85){return _0x26da85!==null&&!_[_0x41eb('0x40')](_0x26da85);}function checkIsLoggedIn(_0x202643,_0x2f2b88){return function(){if(_0x2f2b88<=0x0){_0x202643['message']=_0x41eb('0x41');throw _0x202643[_0x41eb('0x42')]+_0x41eb('0x43');}};}function isActive(_0x2760b6){return _0x2760b6;}function checkIsActive(_0x5ad1c9,_0x335bd2){return function(){if(!isActive(_0x335bd2)){_0x5ad1c9[_0x41eb('0x44')]='NOT_ACTIVE';throw _0x5ad1c9[_0x41eb('0x42')]+'\x20NOT\x20Active';}};}function checkInterval(_0xdb638c){return function(){if(!isNotNull(_0xdb638c[_0x41eb('0x45')])){_0xdb638c[_0x41eb('0x44')]=_0x41eb('0x46');throw _0xdb638c[_0x41eb('0x42')]+_0x41eb('0x47');}if(!isNotNull(_0xdb638c[_0x41eb('0x45')][_0x41eb('0x48')])){_0xdb638c['message']=_0x41eb('0x46');throw _0xdb638c['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x41eb('0x49')](_0xdb638c[_0x41eb('0x45')][_0x41eb('0x48')]))){_0xdb638c[_0x41eb('0x44')]=_0x41eb('0x46');throw _0xdb638c[_0x41eb('0x42')]+_0x41eb('0x47');}};}function msgResponse(_0x4b8b9d,_0x3c68ea,_0x324f7c){return{'action':_0x4b8b9d,'response':_0x3c68ea,'message':_0x324f7c,'stack':_0x324f7c};}function myreject(_0x403815){return function(_0x18c331){return _0x403815(msgResponse('[ifTime][Action]','Error',JSON[_0x41eb('0x4a')](_0x18c331)));};}function getSeconds(_0x1eaa48,_0x273632){var _0x1c7a10=moment(_0x1eaa48)[_0x41eb('0x4b')](0x0);var _0x2599e8=moment(_0x273632)['milliseconds'](0x0);return _0x1c7a10[_0x41eb('0x4c')](_0x2599e8,'seconds');}function emit(_0x39ac99,_0x5bb5a3,_0x4f95a6){io['to'](_0x39ac99)[_0x41eb('0x4d')](_0x5bb5a3,_0x4f95a6);}function emitVoiceQueueSummary(_0x589b62){if(_0x589b62[_0x41eb('0x4e')]==='outbound'){var _0x3e9335={'id':_0x589b62['id'],'name':_0x589b62[_0x41eb('0x42')],'strategy':_0x589b62[_0x41eb('0x4f')],'answered':_0x589b62['answered'],'available':_0x589b62[_0x41eb('0x50')],'loggedIn':_0x589b62[_0x41eb('0x51')],'pTalking':_0x589b62[_0x41eb('0x52')],'sumBillable':_0x589b62['sumBillable'],'sumDuration':_0x589b62['sumDuration'],'sumHoldTime':_0x589b62[_0x41eb('0x53')]||0x0,'talking':_0x589b62[_0x41eb('0x54')],'total':_0x589b62[_0x41eb('0x55')],'type':_0x589b62[_0x41eb('0x4e')],'unmanaged':_0x589b62[_0x41eb('0x56')],'abandoned':_0x589b62[_0x41eb('0x57')],'waiting':_0x589b62[_0x41eb('0x58')],'loggedInDb':_0x589b62['loggedInDb'],'dialActive':_0x589b62[_0x41eb('0x59')],'dialMethod':_0x589b62[_0x41eb('0x5a')],'dialOriginateCallerIdName':_0x589b62[_0x41eb('0x5b')],'dialOriginateCallerIdNumber':_0x589b62[_0x41eb('0x5c')],'dialOriginateTimeout':_0x589b62[_0x41eb('0x5d')],'dialPrefix':_0x589b62[_0x41eb('0x5e')],'outboundAnswerAgiCallsDay':_0x589b62[_0x41eb('0x5f')],'outboundAnswerCallsDay':_0x589b62[_0x41eb('0x60')],'outboundBlacklistCallsDay':_0x589b62[_0x41eb('0x61')],'outboundBusyCallsDay':_0x589b62[_0x41eb('0x62')],'outboundCongestionCallsDay':_0x589b62['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x589b62[_0x41eb('0x63')],'outboundDropCallsDayCallersExit':_0x589b62[_0x41eb('0x64')],'outboundDropCallsDayTimeout':_0x589b62[_0x41eb('0x65')],'outboundNoAnswerCallsDay':_0x589b62['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x589b62[_0x41eb('0x66')],'outboundOriginateFailureCallsDay':_0x589b62[_0x41eb('0x67')],'outboundReCallsDay':_0x589b62[_0x41eb('0x68')],'outboundRejectCallsDay':_0x589b62[_0x41eb('0x69')],'outboundUnknownCallsDay':_0x589b62[_0x41eb('0x6a')],'predictiveIntervalAnsweredCalls':_0x589b62[_0x41eb('0x6b')],'predictiveIntervalAvgHoldtime':_0x589b62[_0x41eb('0x6c')],'predictiveIntervalAvgTalktime':_0x589b62['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x589b62[_0x41eb('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0x589b62['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x589b62[_0x41eb('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0x589b62[_0x41eb('0x6f')],'predictiveIntervalHitRate':_0x589b62[_0x41eb('0x70')],'predictiveIntervalMultiplicativeFactor':_0x589b62[_0x41eb('0x71')],'predictiveIntervalPauses':_0x589b62[_0x41eb('0x72')],'predictiveIntervalAvailable':_0x589b62[_0x41eb('0x73')],'predictiveIntervalTotalCalls':_0x589b62['predictiveIntervalTotalCalls'],'message':_0x589b62[_0x41eb('0x44')],'originated':_0x589b62['originated'],'erlangCalls':_0x589b62[_0x41eb('0x74')],'erlangCallToSecond':_0x589b62[_0x41eb('0x75')],'erlangAbandonmentRate':_0x589b62[_0x41eb('0x76')],'erlangBusyFactor':_0x589b62[_0x41eb('0x77')],'startPredictive':_0x589b62[_0x41eb('0x78')],'startProgressive':_0x589b62[_0x41eb('0x29')]};if(_0x589b62[_0x41eb('0x79')]){_0x3e9335['Trunk']={'id':_0x589b62['Trunk']['id'],'name':_0x589b62['Trunk'][_0x41eb('0x42')],'active':_0x589b62['Trunk'][_0x41eb('0x7a')],'callerid':_0x589b62[_0x41eb('0x79')][_0x41eb('0x7b')]};}if(_0x589b62[_0x41eb('0x45')]){_0x3e9335['Interval']={'id':_0x589b62[_0x41eb('0x45')]['id'],'name':_0x589b62[_0x41eb('0x45')][_0x41eb('0x42')]};}var _0x3a2a83=md5(JSON['stringify'](_0x3e9335));if(_0x589b62[_0x41eb('0x4')]!==_0x3a2a83){_0x589b62[_0x41eb('0x4')]=_0x3a2a83;emit(util['format'](_0x41eb('0x7c'),_0x3e9335['name']),_0x41eb('0x7d'),_0x3e9335);}}}function emitCampaignSummary(_0x37e241){if(_0x37e241[_0x41eb('0x4e')]===_0x41eb('0x7e')){emit(util[_0x41eb('0x7f')](_0x41eb('0x80'),_0x37e241[_0x41eb('0x42')]),_0x41eb('0x81'),_0x37e241);}}function checkGetDataPredictive(_0x7dd445){if(isNotNull(_0x7dd445)&&!_['isEmpty'](_0x7dd445)){loggerPredictive[_0x41eb('0x82')](_0x41eb('0x83'));loggerPredictive['info'](_0x41eb('0x84'),_0x7dd445[_0x41eb('0x85')]);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x86'),_0x7dd445[_0x41eb('0x6b')]);loggerPredictive[_0x41eb('0x82')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x7dd445[_0x41eb('0x87')]);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x88'),_0x7dd445[_0x41eb('0x6d')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x7dd445[_0x41eb('0x6c')]);loggerPredictive['info'](_0x41eb('0x89'),_0x7dd445['predictiveIntervalAvgTalktime']);loggerPredictive[_0x41eb('0x82')]('---------------------------');if(_0x7dd445[_0x41eb('0x85')]>0x0){if(!_[_0x41eb('0x40')](_0x7dd445['predictiveIntervalAvgTalktime'])&&_0x7dd445[_0x41eb('0x8a')]>0x0){return!![];}loggerPredictive[_0x41eb('0x82')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x41eb('0x40')](_0x7dd445[_0x41eb('0x6c')])&&_0x7dd445[_0x41eb('0x6c')]>0x0){return!![];}loggerPredictive['info'](_0x41eb('0x8b'));}else{loggerPredictive[_0x41eb('0x82')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x41eb('0x82')](_0x41eb('0x8c'));}return![];}function mergeDataErlangB(_0x228196){return function(_0x52adf5){loggerPredictive[_0x41eb('0x82')](_0x41eb('0x8d'));loggerPredictive[_0x41eb('0x82')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52adf5['erlangCalls']);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x8e'),_0x52adf5[_0x41eb('0x75')]);loggerPredictive[_0x41eb('0x82')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52adf5[_0x41eb('0x76')]);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x8f'),_0x52adf5[_0x41eb('0x77')]);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x90'),_0x52adf5[_0x41eb('0x76')]);loggerPredictive['info'](_0x41eb('0x91'));_[_0x41eb('0x92')](_0x228196,_0x52adf5);};}function getDiff(_0x3467af){var _0x2783f4=moment()[_0x41eb('0x4b')](0x0);var _0xa2acdd=moment(_0x3467af)['milliseconds'](0x0);return _0x2783f4[_0x41eb('0x4c')](_0xa2acdd,_0x41eb('0x93'));}function ifInterval(_0x57c861,_0x57ab06){if(_[_0x41eb('0x40')](_0x57ab06)){return![];}return getDiff(_0x57ab06)<_0x57c861*0x3c;}function freeVariablesPredictive(_0x4424e3){if(isNotNull(_0x4424e3)){if(!_[_0x41eb('0x40')](_0x4424e3['startProgressive'])){_0x4424e3[_0x41eb('0x29')]=undefined;loggerPredictive['info'](_0x4424e3[_0x41eb('0x42')],_0x41eb('0x94'));}if(!_[_0x41eb('0x40')](_0x4424e3[_0x41eb('0x78')])){_0x4424e3[_0x41eb('0x78')]=undefined;loggerPredictive['info'](_0x4424e3[_0x41eb('0x42')],_0x41eb('0x95'));}if(!_[_0x41eb('0x40')](_0x4424e3[_0x41eb('0x96')])){clearInterval(_0x4424e3[_0x41eb('0x96')]);_0x4424e3[_0x41eb('0x96')]=undefined;loggerPredictive[_0x41eb('0x82')](_0x4424e3[_0x41eb('0x42')],_0x41eb('0x97'));}}}function erlangb(_0x449b1b,_0x234775){if(_0x234775===0x0){return 0x0;}var _0x3587fa=0x1;for(var _0x149525=0x1;_0x149525<=_0x234775;_0x149525+=0x1){_0x3587fa=0x1+_0x3587fa*_0x149525/_0x449b1b;}return 0x1/_0x3587fa;}function isVoiceQueueOutbound(_0x5a6156){return _0x5a6156===_0x41eb('0x98');}function isNotPreview(_0x57596c){return _0x57596c!==_0x41eb('0x99');}function isCampaignIvr(_0xae29a8){return _0xae29a8===_0x41eb('0x7e');}function getCallerId(_0x281069,_0x4b348f,_0x1952bd){if(!_[_0x41eb('0x40')](_0x1952bd)&&typeof _0x1952bd===_0x41eb('0x9a')&&!_['isEmpty'](_0x1952bd)){if(!_[_0x41eb('0x40')](_0x4b348f)&&typeof _0x4b348f===_0x41eb('0x9a')&&!_[_0x41eb('0x49')](_0x4b348f)){return util['format'](_0x41eb('0x9b'),_0x4b348f,_0x1952bd);}return util[_0x41eb('0x7f')](_0x41eb('0x9b'),_0x1952bd,_0x1952bd);}if(!_[_0x41eb('0x40')](_0x281069)&&typeof _0x281069==='string'&&!_[_0x41eb('0x49')](_0x281069)){return _0x281069;}return _0x41eb('0x9c');}function loggerCatchQueueSummary(_0x52bc2f,_0x30601f){return function(_0x67e83e){freeVariablesPredictive(_0x30601f);emitVoiceQueueSummary(_0x30601f);emitCampaignSummary(_0x30601f);loggerSyncQueueSummary[_0x41eb('0x9d')](_0x52bc2f,util['inspect'](_0x67e83e,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x358365,_0x4d56e7){return function(_0xc34144){loggerPredictive[_0x41eb('0x9e')](_0x4d56e7[_0x41eb('0x42')],_0x358365);loggerPredictive[_0x41eb('0x9e')](_0xc34144[_0x41eb('0x9f')]);freeVariablesPredictive(_0x4d56e7);};}function loggerCatch(_0xfc01cf){return function(_0x50a62e){logger[_0x41eb('0x9e')](_0xfc01cf,util[_0x41eb('0xa0')](_0x50a62e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5cba43){return _0x5cba43&&!_[_0x41eb('0x40')](_0x5cba43)&&_0x5cba43[_0x41eb('0xa1')]>0x0;}function decremetOriginate(_0x28343a){if(!_[_0x41eb('0x40')](_0x28343a)&&_0x28343a!==null){if(typeof _0x28343a[_0x41eb('0xa2')]!==_0x41eb('0xa3')){if(_0x28343a[_0x41eb('0xa2')]>0x0){_0x28343a[_0x41eb('0xa2')]-=0x1;}else{logger[_0x41eb('0x9e')](_0x41eb('0xa4'));}}}else{logger[_0x41eb('0x9e')](_0x41eb('0xa5'));}}function checkContactLowerLimitOriginate(_0x4dba26,_0x16015f,_0x52dae1){if(_0x16015f>_0x52dae1){for(var _0x8e699c=0x0;_0x8e699c<_0x16015f-_0x52dae1;_0x8e699c+=0x1){decremetOriginate(_0x4dba26);}}}function loggerGetContactDialer(_0x2939c5,_0x211e25,_0x19301a){return function(_0x41bd9e){checkContactLowerLimitOriginate(_0x211e25,_0x19301a,0x0);logger[_0x41eb('0x9e')](_0x2939c5,util['inspect'](_0x41bd9e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x32d356){return function(_0x3f8281){if(isNotNull(_0x3f8281)&&isNotNull(_0x3f8281[0x0])){if(_0x3f8281[0x0][_0x41eb('0xa6')]>0x0){_0x32d356[_0x41eb('0x44')]=_0x41eb('0xa7');logger[_0x41eb('0x82')](_0x41eb('0xa8')+_0x32d356[_0x41eb('0x42')],_0x3f8281[0x0][_0x41eb('0xa6')],_0x41eb('0xa9'));}else{_0x32d356['message']='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x41eb('0xaa')+_0x32d356[_0x41eb('0x42')]);}}};}function notSendMessagesQueue(_0x1b0e05){if(_0x1b0e05['sendMessageOneNotActive']){freeVariablesPredictive(_0x1b0e05);if(_0x1b0e05['originated']===0x0&&_0x1b0e05['talking']===0x0&&_0x1b0e05[_0x41eb('0x58')]===0x0&&(_0x1b0e05[_0x41eb('0x52')]||0x0)===0x0){_0x1b0e05[_0x41eb('0xab')]=![];_0x1b0e05[_0x41eb('0x50')]=0x0;_0x1b0e05['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x41eb('0x9d')](_0x41eb('0xac'),_0x1b0e05[_0x41eb('0x42')],_0x41eb('0xad'));}else{_0x1b0e05[_0x41eb('0x44')]=_0x41eb('0xae');loggerSyncQueueSummary[_0x41eb('0x9d')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1b0e05['name'],_0x41eb('0xaf'));}emitVoiceQueueSummary(_0x1b0e05);}}function notSendMessagesCampaign(_0x58e59e){if(_0x58e59e[_0x41eb('0xab')]){if(_0x58e59e[_0x41eb('0xa2')]===0x0){_0x58e59e['sendMessageOneNotActive']=![];_0x58e59e[_0x41eb('0x44')]=_0x41eb('0xb0');loggerSyncQueueSummary[_0x41eb('0x9d')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x58e59e[_0x41eb('0x42')],_0x41eb('0xad'));}else{_0x58e59e[_0x41eb('0x44')]=_0x41eb('0xae');loggerSyncQueueSummary[_0x41eb('0x9d')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x58e59e[_0x41eb('0x42')],_0x41eb('0xaf'));}emitCampaignSummary(_0x58e59e);}}function createObjHistory(_0x58e206,_0xf97a5c,_0x3854cc,_0x2c567f,_0x284514){_0x58e206[_0x41eb('0x44')]=_0x3854cc;var _0x39f55c=new Action(_0x58e206,_0xf97a5c);var _0x3f7f85=new History(_0x39f55c);_0x3f7f85['state']=_0x2c567f;_0x3f7f85[_0x41eb('0xb1')]=_0x284514;_0x3f7f85['endtime']=_0x39f55c['starttime'];return _0x3f7f85;}Dialer[_0x41eb('0x1c')][_0x41eb('0xb2')]=function(){var _0x48eb07=this;setInterval(function(){_0x48eb07[_0x41eb('0xb3')](_0x48eb07['uniqueId'],_0x41eb('0xb4'));_0x48eb07[_0x41eb('0xb3')](_0x48eb07[_0x41eb('0xb5')],_0x41eb('0xb6'));},0x32c8);};Dialer['prototype'][_0x41eb('0xb3')]=function(_0x509291,_0x3ec956){var _0x2a917b=this;for(var _0x206c57 in _0x509291){if(typeof _0x509291[_0x206c57]!=='undefined'){this[_0x41eb('0x20')][_0x41eb('0x1d')](function(){if(!_[_0x41eb('0xb7')](_0x509291[_0x206c57])){return ami[_0x41eb('0xb8')]({'action':'status','channel':_0x509291[_0x206c57][_0x41eb('0xb9')]})[_0x41eb('0xba')](function(_0x4d9b27){if(_0x4d9b27[_0x41eb('0x44')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x509291[_0x206c57]&&_0x509291[_0x206c57][_0x41eb('0x4e')]!=='ivr'){_0x2a917b[_0x41eb('0xbb')](_0x2a917b[_0x41eb('0x21')][_0x509291[_0x206c57][_0x41eb('0xbc')]]);logger[_0x41eb('0x9e')](_0x41eb('0xbd'),_0x3ec956,_0x206c57,_0x509291[_0x206c57]['queue']);delete _0x509291[_0x206c57];}if(_0x509291[_0x206c57]&&_0x509291[_0x206c57][_0x41eb('0x4e')]==='ivr'){_0x2a917b['updateOriginated'](_0x2a917b[_0x41eb('0x22')][_0x509291[_0x206c57][_0x41eb('0xbc')]]);logger[_0x41eb('0x9e')](_0x41eb('0xbe'),_0x3ec956,_0x206c57,_0x509291[_0x206c57]['queue']);delete _0x509291[_0x206c57];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x2b3ce2){return Promise['resolve']()[_0x41eb('0x3e')](cmHopper['countReScheduled'](_0x2b3ce2))['catch'](loggerCatch(_0x41eb('0xbf')));};Dialer[_0x41eb('0x1c')][_0x41eb('0xc0')]=function(_0x10111a){return Promise[_0x41eb('0xc1')]()[_0x41eb('0x3e')](cmHopperBlack[_0x41eb('0xc0')](_0x10111a))[_0x41eb('0xba')](loggerCatch(_0x41eb('0xc2')));};Dialer[_0x41eb('0x1c')][_0x41eb('0xc3')]=function(_0x11f68a,_0x30889a,_0x16ddd0){return Promise[_0x41eb('0xc1')]()['then'](cmHopperAdditionalPhone[_0x41eb('0xc3')](_0x11f68a,_0x30889a,_0x16ddd0))[_0x41eb('0xba')](loggerCatch(_0x41eb('0xc4')));};Dialer[_0x41eb('0x1c')][_0x41eb('0xc5')]=function(_0x3bcf57,_0x569493,_0x7ff015){return Promise[_0x41eb('0xc1')]()[_0x41eb('0x3e')](cmHopperAdditionalPhone[_0x41eb('0xc5')](_0x3bcf57,_0x569493,_0x7ff015))['catch'](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0x41eb('0x1c')][_0x41eb('0xc6')]=function(_0x13ab19){return Promise[_0x41eb('0xc1')]()[_0x41eb('0x3e')](cmHopperBlack[_0x41eb('0xc6')](_0x13ab19))[_0x41eb('0xba')](loggerCatch(_0x41eb('0xc7')));};Dialer[_0x41eb('0x1c')][_0x41eb('0xc8')]=function(_0x568a4d){return Promise[_0x41eb('0xc1')]()[_0x41eb('0x3e')](cmHopperHistory[_0x41eb('0xc9')](_0x568a4d))[_0x41eb('0xba')](loggerCatch(_0x41eb('0xca')));};Dialer[_0x41eb('0x1c')]['rescheduleContact']=function(_0x430e14){return Promise[_0x41eb('0xc1')]()['then'](cmHopper[_0x41eb('0xcb')](_0x430e14))['catch'](loggerCatch(_0x41eb('0xcc')));};Dialer[_0x41eb('0x1c')][_0x41eb('0xcd')]=function(_0xc9e8be,_0x298db3,_0x33d21e){return Promise['resolve']()[_0x41eb('0x3e')](cmHopper[_0x41eb('0xcd')](_0xc9e8be,_0x298db3,_0x33d21e))['catch'](loggerCatch('[unlockContact]\x20'));};Dialer[_0x41eb('0x1c')][_0x41eb('0xce')]=function(_0xe62a19,_0x537184,_0x5432b1,_0x517285,_0x112a93){return Promise[_0x41eb('0xc1')]()[_0x41eb('0x3e')](cmHopper[_0x41eb('0xce')](_0xe62a19,_0x537184,_0x5432b1,_0x517285))[_0x41eb('0xba')](function(_0x10abb6){_0x112a93['temp']-=_0x5432b1;_0x112a93[_0x41eb('0xcf')]=_0x112a93[_0x41eb('0xcf')]>0x0?_0x112a93[_0x41eb('0xcf')]:0x0;loggerCatch(_0x41eb('0xd0'))(_0x10abb6);});};Dialer['prototype'][_0x41eb('0xd1')]=function(_0x323a81,_0x11c7a2,_0x5d766c,_0x34b5d9){return Promise[_0x41eb('0xc1')]()['then'](cmHopper[_0x41eb('0xd1')](_0x323a81,_0x11c7a2,_0x5d766c))[_0x41eb('0xba')](function(_0x355a59){_0x34b5d9['temp']-=_0x11c7a2;_0x34b5d9[_0x41eb('0xcf')]=_0x34b5d9[_0x41eb('0xcf')]>0x0?_0x34b5d9[_0x41eb('0xcf')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x355a59);});};Dialer[_0x41eb('0x1c')][_0x41eb('0xd2')]=function(_0x416f5d){return Promise[_0x41eb('0xc1')]()[_0x41eb('0x3e')](voiceQueueRt[_0x41eb('0xd2')](_0x416f5d))['catch'](loggerCatch(_0x41eb('0xd3')));};Dialer[_0x41eb('0x1c')][_0x41eb('0xd4')]=function(_0xfb4d9d){return Promise['resolve']()[_0x41eb('0x3e')](cmHopper[_0x41eb('0xd4')](_0xfb4d9d))[_0x41eb('0xba')](loggerCatch(_0x41eb('0xd5')));};Dialer[_0x41eb('0x1c')][_0x41eb('0xd6')]=function(_0x2cfbf1){return Promise[_0x41eb('0xc1')]()[_0x41eb('0x3e')](cmHopperHistory[_0x41eb('0xd6')](_0x2cfbf1))[_0x41eb('0xba')](loggerCatch(_0x41eb('0xd7')));};Dialer[_0x41eb('0x1c')][_0x41eb('0xbb')]=function(_0x5226af){if(!_[_0x41eb('0x40')](_0x5226af)&&_0x5226af!==null){if(typeof _0x5226af['originated']!==_0x41eb('0xa3')){if(_0x5226af[_0x41eb('0xa2')]>0x0){_0x5226af['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x41eb('0x1c')][_0x41eb('0xd8')]=function(_0x3d4bec,_0x168ba8){var _0x5575c2=this;return function(_0x5adb11){_0x5575c2['updateOriginated'](_0x168ba8);logger[_0x41eb('0x9e')](_0x3d4bec,util[_0x41eb('0xa0')](_0x5adb11,{'showHidden':![],'depth':null}));};};Dialer[_0x41eb('0x1c')][_0x41eb('0xd9')]=function(_0x3a572b,_0x1cd78d,_0x71e643){var _0x41e791={'state':0x19,'statedesc':'notFound'};this[_0x41eb('0xbb')](_0x1cd78d);this[_0x41eb('0xda')](_[_0x41eb('0x92')](_0x41e791,_[_0x41eb('0xdb')](_0x71e643,['ContactId','ListId',_0x41eb('0xdc'),_0x41eb('0xdd'),_0x41eb('0xde')])),_0x41eb('0xdf'),_0x41eb('0xe0'));logger['error'](_0x3a572b);};Dialer[_0x41eb('0x1c')][_0x41eb('0xe1')]=function(_0x19e8e4){return _0x19e8e4==='Success';};Dialer[_0x41eb('0x1c')]['isTrunkReachable']=function(_0x56c496){return!_['isUndefined'](_0x56c496)&&_0x56c496&&!_['isUndefined'](_0x56c496[_0x41eb('0x42')])&&!_[_0x41eb('0x40')](_0x56c496[_0x41eb('0x7a')])&&_0x56c496[_0x41eb('0x7a')]&&(this[_0x41eb('0x24')][util[_0x41eb('0x7f')]('SIP/%s',_0x56c496[_0x41eb('0x42')])][_0x41eb('0xe2')]===_0x41eb('0xe3')||this[_0x41eb('0x24')][util[_0x41eb('0x7f')]('SIP/%s',_0x56c496[_0x41eb('0x42')])]['status']==='unmonitored');};Dialer[_0x41eb('0x1c')][_0x41eb('0xda')]=function(_0x376205,_0x237ff6,_0x425349){this[_0x41eb('0xd6')](_0x376205)['catch'](loggerCatch(_0x237ff6));this[_0x41eb('0xd4')](_0x376205)[_0x41eb('0xba')](loggerCatch(_0x425349));};Dialer[_0x41eb('0x1c')][_0x41eb('0x39')]=function(_0xc0bda9){var _0x4571bb=this;var _0x1f407c=this[_0x41eb('0x28')][_0xc0bda9[_0x41eb('0xe4')]];var _0x5e9663;if(!_[_0x41eb('0xb7')](_0xc0bda9)&&!_[_0x41eb('0xb7')](_0xc0bda9[_0x41eb('0xe5')])&&!_[_0x41eb('0xb7')](_0xc0bda9[_0x41eb('0xe5')]['amdstatus'])&&_0xc0bda9['exten']==='xcally-motion-dialer'&&_0x1f407c){if(_0x1f407c[_0x41eb('0x4e')]!==_0x41eb('0x7e')&&this[_0x41eb('0x21')][_0x1f407c[_0x41eb('0xbc')]][_0x41eb('0xe6')]&&_0xc0bda9[_0x41eb('0xe7')]===_0x41eb('0xe8')){delete this[_0x41eb('0x28')][_0xc0bda9['uniqueid']];this[_0x41eb('0xbb')](this[_0x41eb('0x21')][_0x1f407c['queue']]);this[_0x41eb('0x21')][_0x1f407c['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x41eb('0x21')][_0x1f407c[_0x41eb('0xbc')]][_0x41eb('0x5f')]+=0x1;_0x5e9663=new Hangup(_0x1f407c,_0xc0bda9);_0x5e9663[_0x41eb('0xe9')]=0x12;_0x5e9663[_0x41eb('0xb1')]='HangupInAMD';_0x5e9663[_0x41eb('0xea')]=_0x41eb('0xeb');ami[_0x41eb('0x4d')](_0x41eb('0xec'),ut[_0x41eb('0xed')](_0x5e9663,'amd'));this[_0x41eb('0xda')](_0x5e9663,_0x41eb('0xee'),_0x41eb('0xef'));}if(_0x1f407c[_0x41eb('0x4e')]!=='ivr'&&this['voiceQueues'][_0x1f407c[_0x41eb('0xbc')]]['dialAMDActive']&&_0xc0bda9[_0x41eb('0xe7')]===_0x41eb('0xf0')){return new Promise(function(_0x43afc8,_0x435dcd){delete _0x4571bb[_0x41eb('0x28')][_0xc0bda9['uniqueid']];_0x4571bb['updateOriginated'](_0x4571bb[_0x41eb('0x21')][_0x1f407c[_0x41eb('0xbc')]]);_0x4571bb[_0x41eb('0x21')][_0x1f407c[_0x41eb('0xbc')]][_0x41eb('0x60')]+=0x1;_0x4571bb['voiceQueues'][_0x1f407c[_0x41eb('0xbc')]]['outboundAnswerAgiCallsDay']+=0x1;var _0xd78e54=_0x4571bb[_0x41eb('0x21')][_0x1f407c[_0x41eb('0xbc')]];var _0x1ecbc8=new Hangup(_0x1f407c,_0xc0bda9);_0x1ecbc8['state']=0x13;_0x1ecbc8[_0x41eb('0xb1')]=_0x41eb('0xf1');_0x1ecbc8['membername']=_0x41eb('0xeb');_0x1ecbc8[_0x41eb('0xf2')]+=0x1;_0x1ecbc8['countglobal']+=0x1;_0x1ecbc8[_0x41eb('0xf3')]=!![];ami[_0x41eb('0x4d')](_0x41eb('0xec'),ut[_0x41eb('0xed')](_0x1ecbc8,_0x41eb('0xf3')));_0x4571bb[_0x41eb('0xd6')](_0x1ecbc8)['catch'](loggerCatch(_0x41eb('0xf4')));if(_0x1ecbc8['countbusyretry']+_0x1ecbc8[_0x41eb('0xf5')]+_0x1ecbc8['countnoanswerretry']+_0x1ecbc8[_0x41eb('0xf6')]+_0x1ecbc8['countdropretry']+_0x1ecbc8[_0x41eb('0xf7')]+_0x1ecbc8['countmachineretry']+_0x1ecbc8[_0x41eb('0xf8')]>=_0xd78e54['dialGlobalMaxRetry']){_0x4571bb[_0x41eb('0xf9')](_0x1ecbc8,_0x43afc8,_0x435dcd,_0x41eb('0xfa'));}else{if(_0x1ecbc8[_0x41eb('0xf2')]>=_0xd78e54[_0x41eb('0xfb')]){_0x4571bb[_0x41eb('0xfc')](_0x1ecbc8,_0x43afc8,_0x435dcd,'reason\x2019\x20machine....');}else{_0x4571bb[_0x41eb('0xcb')]({'active':![],'countmachineretry':_0x1ecbc8[_0x41eb('0xf2')],'scheduledat':moment()[_0x41eb('0xfd')](_0xd78e54[_0x41eb('0xfe')],_0x41eb('0xff'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ecbc8[_0x41eb('0x100')],'ListId':_0x1ecbc8[_0x41eb('0x101')],'VoiceQueueId':_0x1ecbc8[_0x41eb('0xdd')]||undefined,'CampaignId':_0x1ecbc8[_0x41eb('0xde')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x43afc8({'reschedule':0x1});}}});}if(_0x1f407c['type']===_0x41eb('0x7e')&&this[_0x41eb('0x22')][_0x1f407c[_0x41eb('0xbc')]][_0x41eb('0xe6')]&&_0xc0bda9[_0x41eb('0xe7')]===_0x41eb('0xe8')){delete this['uniqueId'][_0xc0bda9['uniqueid']];this[_0x41eb('0xbb')](this[_0x41eb('0x22')][_0x1f407c['queue']]);_0x5e9663=new Hangup(_0x1f407c,_0xc0bda9);_0x5e9663[_0x41eb('0xe9')]=0x12;_0x5e9663[_0x41eb('0xb1')]='HangupInAMD';_0x5e9663['membername']='AMD';ami['emit']('custom:amd',ut[_0x41eb('0xed')](_0x5e9663,_0x41eb('0xf3')));this['saveInDb'](_0x5e9663,_0x41eb('0x102'),_0x41eb('0x103'));}if(_0x1f407c[_0x41eb('0x4e')]===_0x41eb('0x7e')&&this[_0x41eb('0x22')][_0x1f407c[_0x41eb('0xbc')]][_0x41eb('0xe6')]&&_0xc0bda9['value']==='MACHINE'){return new Promise(function(_0x587bd9,_0x2a6c78){delete _0x4571bb['uniqueId'][_0xc0bda9[_0x41eb('0xe4')]];_0x4571bb[_0x41eb('0xbb')](_0x4571bb[_0x41eb('0x22')][_0x1f407c['queue']]);_0x4571bb[_0x41eb('0x22')][_0x1f407c[_0x41eb('0xbc')]]['outboundAnswerCallsDay']+=0x1;_0x4571bb[_0x41eb('0x22')][_0x1f407c[_0x41eb('0xbc')]][_0x41eb('0x5f')]+=0x1;var _0x2ee466=_0x4571bb[_0x41eb('0x22')][_0x1f407c[_0x41eb('0xbc')]];var _0x41d40a=new Hangup(_0x1f407c,_0xc0bda9);_0x41d40a[_0x41eb('0xe9')]=0x13;_0x41d40a['statedesc']=_0x41eb('0xf1');_0x41d40a[_0x41eb('0xea')]=_0x41eb('0xeb');_0x41d40a[_0x41eb('0xf2')]+=0x1;_0x41d40a[_0x41eb('0x104')]+=0x1;_0x41d40a[_0x41eb('0xf3')]=!![];ami[_0x41eb('0x4d')]('custom:amd',ut[_0x41eb('0xed')](_0x41d40a,_0x41eb('0xf3')));_0x4571bb['createHistory'](_0x41d40a)[_0x41eb('0xba')](loggerCatch(_0x41eb('0xf4')));if(_0x41d40a[_0x41eb('0x105')]+_0x41d40a[_0x41eb('0xf5')]+_0x41d40a[_0x41eb('0x106')]+_0x41d40a[_0x41eb('0xf6')]+_0x41d40a[_0x41eb('0x107')]+_0x41d40a[_0x41eb('0xf7')]+_0x41d40a[_0x41eb('0xf2')]+_0x41d40a[_0x41eb('0xf8')]>=_0x2ee466[_0x41eb('0x108')]){_0x4571bb[_0x41eb('0xf9')](_0x41d40a,_0x587bd9,_0x2a6c78,'reason19\x20machine....');}else{if(_0x41d40a[_0x41eb('0xf2')]>=_0x2ee466[_0x41eb('0xfb')]){_0x4571bb[_0x41eb('0xfc')](_0x41d40a,_0x587bd9,_0x2a6c78,'reason\x2019\x20machine....');}else{_0x4571bb[_0x41eb('0xcb')]({'active':![],'countmachineretry':_0x41d40a[_0x41eb('0xf2')],'scheduledat':moment()['add'](_0x2ee466[_0x41eb('0xfe')],_0x41eb('0xff'))[_0x41eb('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x41d40a[_0x41eb('0x100')],'ListId':_0x41d40a[_0x41eb('0x101')],'VoiceQueueId':_0x41d40a[_0x41eb('0xdd')]||undefined,'CampaignId':_0x41d40a[_0x41eb('0xde')]||undefined})[_0x41eb('0xba')](loggerCatch(_0x41eb('0x109')));_0x587bd9({'reschedule':0x1});}}});}}};Dialer[_0x41eb('0x1c')][_0x41eb('0x35')]=function(_0x460c84){var _0x8de30c=this[_0x41eb('0x28')][_0x460c84[_0x41eb('0xe4')]];var _0x43e55c;if(_0x8de30c&&_0x8de30c['type']===_0x41eb('0x7e')){delete this[_0x41eb('0x28')][_0x460c84['uniqueid']];this[_0x41eb('0xbb')](this[_0x41eb('0x22')][_0x8de30c[_0x41eb('0xbc')]]);this[_0x41eb('0x22')][_0x8de30c[_0x41eb('0xbc')]][_0x41eb('0x10a')]+=0x1;_0x43e55c=new Hangup(_0x8de30c,_0x460c84);this[_0x41eb('0xd6')](_0x43e55c)[_0x41eb('0xba')](loggerCatch(_0x41eb('0x10b')));this['moveContactManagedDialer'](_0x43e55c)[_0x41eb('0xba')](loggerCatch(_0x41eb('0x10c')));}if(_0x8de30c&&_0x8de30c['type']!==_0x41eb('0x7e')&&isNotNull(this[_0x41eb('0x21')][_0x8de30c[_0x41eb('0xbc')]][_0x41eb('0x10d')])){delete this['uniqueId'][_0x460c84[_0x41eb('0xe4')]];this[_0x41eb('0xbb')](this[_0x41eb('0x21')][_0x8de30c[_0x41eb('0xbc')]]);this[_0x41eb('0x21')][_0x8de30c[_0x41eb('0xbc')]]['outboundAnswerCallsDay']+=0x1;this[_0x41eb('0x21')][_0x8de30c['queue']][_0x41eb('0x5f')]+=0x1;_0x43e55c=new Hangup(_0x8de30c,_0x460c84);_0x43e55c[_0x41eb('0xe9')]=0x10;_0x43e55c[_0x41eb('0xb1')]=_0x41eb('0x10e');_0x43e55c[_0x41eb('0xea')]=_0x41eb('0x10f');this[_0x41eb('0xd6')](_0x43e55c)[_0x41eb('0xba')](loggerCatch(_0x41eb('0x10b')));this['moveContactManagedDialer'](_0x43e55c)[_0x41eb('0xba')](loggerCatch('[syncHangupIvr]'));}if(_0x8de30c&&_0x8de30c[_0x41eb('0x4e')]!==_0x41eb('0x7e')&&!isNotNull(this['voiceQueues'][_0x8de30c[_0x41eb('0xbc')]][_0x41eb('0x10d')])){delete this['uniqueId'][_0x460c84[_0x41eb('0xe4')]];this[_0x41eb('0xbb')](this[_0x41eb('0x21')][_0x8de30c[_0x41eb('0xbc')]]);this['voiceQueues'][_0x8de30c[_0x41eb('0xbc')]]['outboundUnknownCallsDay']+=0x1;_0x43e55c=new Hangup(_0x8de30c,_0x460c84);_0x43e55c[_0x41eb('0xe9')]=0xc;_0x43e55c['statedesc']=_0x460c84[_0x41eb('0x110')];_0x43e55c[_0x41eb('0xea')]=_0x41eb('0x111');this['createHistory'](_0x43e55c)[_0x41eb('0xba')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x41eb('0xd4')](_0x43e55c)[_0x41eb('0xba')](loggerCatch(_0x41eb('0x10c')));}};Dialer[_0x41eb('0x1c')][_0x41eb('0x112')]=function(_0x88b51b){var _0x2b9984=this[_0x41eb('0x28')][_0x88b51b[_0x41eb('0xe4')]];if(this['voiceQueues'][_0x88b51b['queue']]){if(_0x2b9984&&_0x2b9984[_0x41eb('0x4e')]!==_0x41eb('0x7e')){delete this[_0x41eb('0x28')][_0x88b51b['uniqueid']];this[_0x41eb('0x21')][_0x88b51b[_0x41eb('0xbc')]][_0x41eb('0x60')]+=0x1;var _0x20d7e4=new AgentComplete(_0x2b9984,_0x88b51b);if(_0x88b51b['reason']===_0x41eb('0x113')){_0x20d7e4['agiafterat']=this[_0x41eb('0x21')][_0x88b51b[_0x41eb('0xbc')]][_0x41eb('0x114')]&&this['voiceQueues'][_0x88b51b[_0x41eb('0xbc')]][_0x41eb('0x115')]?moment()[_0x41eb('0x7f')](_0x41eb('0x116')):undefined;}this['createHistory'](_0x20d7e4)['catch'](loggerCatch(_0x41eb('0x117')));this[_0x41eb('0xd4')](_0x20d7e4)['catch'](loggerCatch(_0x41eb('0x118')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x427427){if(this[_0x41eb('0x21')][_0x427427[_0x41eb('0xbc')]]){if(this[_0x41eb('0x28')][_0x427427['uniqueid']]&&this['uniqueId'][_0x427427[_0x41eb('0xe4')]][_0x41eb('0x4e')]!==_0x41eb('0x7e')){this[_0x41eb('0xbb')](this[_0x41eb('0x21')][_0x427427[_0x41eb('0xbc')]]);this[_0x41eb('0x28')][_0x427427[_0x41eb('0xe4')]][_0x41eb('0x119')]=moment()[_0x41eb('0x7f')](_0x41eb('0x116'));}}};Dialer['prototype'][_0x41eb('0x11a')]=function(_0x1de1d3,_0x2dc9ca){this[_0x41eb('0xd6')](_0x1de1d3)[_0x41eb('0xba')](loggerCatch(_0x41eb('0x117')));if(_0x2dc9ca==0x0){this[_0x41eb('0xd4')](_0x1de1d3)['catch'](loggerCatch(_0x41eb('0x11b')));}};Dialer['prototype'][_0x41eb('0x2e')]=function(_0x323ed4){var _0x328fe9=this[_0x41eb('0x28')][_0x323ed4[_0x41eb('0xe4')]];var _0x237bab=this;var _0x10d73c=![];var _0x18bc95;var _0x32c896;if(this['voiceQueues'][_0x323ed4[_0x41eb('0xbc')]]){if(_0x328fe9&&_0x328fe9[_0x41eb('0x4e')]!=='ivr'){delete this['uniqueId'][_0x323ed4[_0x41eb('0xe4')]];this['updateOriginated'](this[_0x41eb('0x21')][_0x323ed4['queue']]);_0x328fe9[_0x41eb('0x11c')]=moment()['format'](_0x41eb('0x116'));var _0x50cfb8=new QueueCallerAbandon(_0x328fe9,_0x323ed4);if(getSeconds(_0x328fe9['droptime'],_0x328fe9['responsetime'])>=_0x328fe9[_0x41eb('0x11d')]){this[_0x41eb('0x21')][_0x323ed4['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x41eb('0x21')][_0x323ed4[_0x41eb('0xbc')]][_0x41eb('0x65')]+=0x1;this[_0x41eb('0x21')][_0x323ed4[_0x41eb('0xbc')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x50cfb8['state']=0xa;_0x50cfb8[_0x41eb('0xb1')]=_0x41eb('0x11e');_0x50cfb8[_0x41eb('0x11f')]=_0x41eb('0x120');_0x50cfb8['agiafterat']=this[_0x41eb('0x21')][_0x323ed4['queue']]['dialQueueProject2']?moment()[_0x41eb('0x7f')](_0x41eb('0x116')):undefined;_0x50cfb8[_0x41eb('0x107')]+=0x1;_0x50cfb8[_0x41eb('0x104')]+=0x1;_0x18bc95=this[_0x41eb('0x21')][_0x323ed4[_0x41eb('0xbc')]][_0x41eb('0x121')];_0x32c896=this[_0x41eb('0x21')][_0x323ed4[_0x41eb('0xbc')]][_0x41eb('0x122')];_0x237bab['verifyAdditionalPhones'](_0x50cfb8,_0x50cfb8['state'],_0x328fe9[_0x41eb('0x123')])['then'](function(_0x245a34){_0x10d73c=_0x245a34[_0x41eb('0x124')]==0x1;if(_0x50cfb8[_0x41eb('0x107')]>=_0x237bab[_0x41eb('0x21')][_0x323ed4[_0x41eb('0xbc')]]['dialDropMaxRetry']){_0x237bab[_0x41eb('0x11a')](_0x50cfb8,_0x245a34[_0x41eb('0x124')]);}else{_0x237bab[_0x41eb('0xcb')]({'active':![],'countdropretry':_0x50cfb8[_0x41eb('0x107')],'scheduledat':moment()[_0x41eb('0xfd')](_0x237bab[_0x41eb('0x21')][_0x323ed4['queue']]['dialDropRetryFrequency'],_0x41eb('0xff'))[_0x41eb('0x7f')](_0x41eb('0x116')),'ContactId':_0x328fe9['ContactId'],'ListId':_0x328fe9[_0x41eb('0x101')],'VoiceQueueId':_0x328fe9[_0x41eb('0xdd')]||undefined,'CampaignId':_0x328fe9['CampaignId']||undefined})[_0x41eb('0xba')](loggerCatch(_0x41eb('0x125')));var _0x5d6080=new History(_0x50cfb8);_0x5d6080['state']=0xa;_0x5d6080[_0x41eb('0xb1')]=_0x41eb('0x11e');_0x5d6080[_0x41eb('0x126')]=moment()['format'](_0x41eb('0x116'));_0x5d6080[_0x41eb('0x127')]=_0x5d6080[_0x41eb('0x126')];_0x5d6080[_0x41eb('0x128')]=_0x50cfb8[_0x41eb('0x128')];_0x5d6080['calleridnum']=_0x50cfb8['calleridnum'];_0x237bab[_0x41eb('0xd6')](_0x5d6080)[_0x41eb('0xba')](loggerCatch(_0x41eb('0x129')));}})[_0x41eb('0x3e')](function(){if(_0x10d73c)_0x237bab['swapAdditionalPhones'](_0x50cfb8,_0x18bc95,_0x32c896)['then'](function(){return 0x1;});});}else{this[_0x41eb('0x21')][_0x323ed4[_0x41eb('0xbc')]][_0x41eb('0x6d')]+=0x1;this['voiceQueues'][_0x323ed4['queue']][_0x41eb('0x64')]+=0x1;_0x50cfb8[_0x41eb('0xe9')]=0xb;_0x50cfb8['statedesc']='Abandoned';_0x50cfb8[_0x41eb('0x11f')]=_0x41eb('0x12a');_0x50cfb8['countabandonedretry']+=0x1;_0x50cfb8[_0x41eb('0x104')]+=0x1;_0x18bc95=this['voiceQueues'][_0x323ed4[_0x41eb('0xbc')]]['dialAbandonedRetryFrequency'];_0x32c896=this[_0x41eb('0x21')][_0x323ed4['queue']]['callAdditionalPhoneAfterMin'];_0x237bab[_0x41eb('0xc3')](_0x50cfb8,_0x50cfb8[_0x41eb('0xe9')],_0x328fe9[_0x41eb('0x123')])[_0x41eb('0x3e')](function(_0x57b241){if(_0x50cfb8[_0x41eb('0xf7')]>=_0x237bab[_0x41eb('0x21')][_0x323ed4[_0x41eb('0xbc')]][_0x41eb('0x12b')]){_0x237bab['queueCallerAbandonCreateState'](_0x50cfb8,_0x57b241[_0x41eb('0x124')]);}else{_0x237bab[_0x41eb('0xcb')]({'active':![],'countabandonedretry':_0x50cfb8[_0x41eb('0xf7')],'scheduledat':moment()[_0x41eb('0xfd')](_0x237bab[_0x41eb('0x21')][_0x323ed4[_0x41eb('0xbc')]][_0x41eb('0x12c')],_0x41eb('0xff'))[_0x41eb('0x7f')](_0x41eb('0x116')),'ContactId':_0x328fe9['ContactId'],'ListId':_0x328fe9[_0x41eb('0x101')],'VoiceQueueId':_0x328fe9['VoiceQueueId']||undefined,'CampaignId':_0x328fe9[_0x41eb('0xde')]||undefined})['catch'](loggerCatch(_0x41eb('0x12d')));var _0x5d9542=new History(_0x50cfb8);_0x5d9542[_0x41eb('0xe9')]=0xb;_0x5d9542[_0x41eb('0xb1')]='Abandoned';_0x5d9542[_0x41eb('0x126')]=moment()[_0x41eb('0x7f')](_0x41eb('0x116'));_0x5d9542['endtime']=_0x5d9542[_0x41eb('0x126')];_0x5d9542[_0x41eb('0x128')]=_0x50cfb8['calleridname'];_0x5d9542[_0x41eb('0x12e')]=_0x50cfb8[_0x41eb('0x12e')];_0x237bab[_0x41eb('0xd6')](_0x5d9542)[_0x41eb('0xba')](loggerCatch(_0x41eb('0x12f')));}})['then'](function(){if(_0x10d73c)_0x237bab[_0x41eb('0xc5')](_0x50cfb8,_0x18bc95,_0x32c896)['then'](function(){return 0x1;});});}}}};Dialer[_0x41eb('0x1c')][_0x41eb('0x37')]=function(_0xa01c36){if(this['actions'][_0xa01c36[_0x41eb('0xe4')]]){this[_0x41eb('0xb5')][_0xa01c36[_0x41eb('0xe4')]][_0x41eb('0xb9')]=_0xa01c36[_0x41eb('0xb9')];}if(this[_0x41eb('0x28')][_0xa01c36[_0x41eb('0xe4')]]){this[_0x41eb('0x28')][_0xa01c36[_0x41eb('0xe4')]][_0x41eb('0xb9')]=_0xa01c36[_0x41eb('0xb9')];}};Dialer['prototype'][_0x41eb('0x3b')]=function(_0x852e93){if(strategy[this[_0x41eb('0x21')][this[_0x41eb('0xb5')][_0x852e93[_0x41eb('0x130')]][_0x41eb('0xbc')]][_0x41eb('0x4f')]]===_0x41eb('0x131')){if(this[_0x41eb('0xb5')][_0x852e93[_0x41eb('0x130')]]&&_[_0x41eb('0xb7')](this['actions'][_0x852e93['actionid']][_0x41eb('0x132')])&&_0x852e93['status']==='1'&&_0x852e93[_0x41eb('0x133')]==='0'){if(this[_0x41eb('0x23')][_0x852e93[_0x41eb('0x134')]]){if(!this[_0x41eb('0x23')][_0x852e93[_0x41eb('0x134')]][_0x41eb('0x132')]){this[_0x41eb('0x23')][_0x852e93[_0x41eb('0x134')]][_0x41eb('0x132')]=!![];this[_0x41eb('0xb5')][_0x852e93[_0x41eb('0x130')]][_0x41eb('0x132')]=!![];this[_0x41eb('0xb5')][_0x852e93[_0x41eb('0x130')]][_0x41eb('0x134')]=_0x852e93[_0x41eb('0x134')];}}}}else if((strategy[this[_0x41eb('0x21')][this[_0x41eb('0xb5')][_0x852e93[_0x41eb('0x130')]][_0x41eb('0xbc')]][_0x41eb('0x4f')]]||'rrmemory')===_0x41eb('0x1b')){if(this[_0x41eb('0xb5')][_0x852e93[_0x41eb('0x130')]]){if(this['agents'][_0x852e93[_0x41eb('0x134')]]){this[_0x41eb('0xb5')][_0x852e93[_0x41eb('0x130')]][_0x41eb('0x134')]=_0x852e93[_0x41eb('0x134')];if(_[_0x41eb('0xb7')](this[_0x41eb('0x2a')][this[_0x41eb('0xb5')][_0x852e93[_0x41eb('0x130')]][_0x41eb('0xbc')]])){this[_0x41eb('0x2a')][this['actions'][_0x852e93[_0x41eb('0x130')]][_0x41eb('0xbc')]]=[];}this[_0x41eb('0x2a')][this[_0x41eb('0xb5')][_0x852e93[_0x41eb('0x130')]][_0x41eb('0xbc')]][_0x41eb('0x135')](_[_0x41eb('0x92')](_[_0x41eb('0xdb')](this[_0x41eb('0xb5')][_0x852e93['actionid']],['idHopper',_0x41eb('0x134')]),{'status':_0x852e93[_0x41eb('0xe2')],'paused':_0x852e93['paused']}));}}}};function unlockQueueStatus(_0x10ccc7,_0x3cded3){setTimeout(function(){if(_[_0x41eb('0x40')](_0x10ccc7[_0x41eb('0x136')])){loggerBooked[_0x41eb('0x9e')](_0x41eb('0x137'),_0x3cded3);}_0x10ccc7[_0x41eb('0x136')]=!![];loggerBooked['info'](_0x41eb('0x138'),_0x3cded3,JSON[_0x41eb('0x4a')](_[_0x41eb('0xdb')](_0x10ccc7,[_0x41eb('0x42'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x41eb('0x1c')]['syncQueueStatusComplete']=function(_0x130c05){var _0x244b85=this;var _0x2772a4=_0x244b85[_0x41eb('0x21')][_0x244b85['actions'][_0x130c05[_0x41eb('0x130')]][_0x41eb('0xbc')]];if(strategy[this[_0x41eb('0x21')][this[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]][_0x41eb('0xbc')]][_0x41eb('0x4f')]]===_0x41eb('0x131')){if(this[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]]&&this[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]][_0x41eb('0x134')]){this[_0x41eb('0x99')][_0x41eb('0x139')](this[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]][_0x41eb('0x13a')],this[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]][_0x41eb('0x134')])[_0x41eb('0xba')](function(_0x5f5be2){logger['error'](_0x41eb('0x13b'),util['inspect'](_0x5f5be2,{'showHidden':![],'depth':null}));})[_0x41eb('0x1f')](function(){_0x244b85['updateOriginated'](_0x244b85['voiceQueues'][_0x244b85['actions'][_0x130c05[_0x41eb('0x130')]]['queue']]);_0x244b85[_0x41eb('0x23')][_0x244b85[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]][_0x41eb('0x134')]][_0x41eb('0x132')]=![];delete _0x244b85['actions'][_0x130c05[_0x41eb('0x130')]];unlockQueueStatus(_0x2772a4);});}else{this[_0x41eb('0xbb')](this[_0x41eb('0x21')][this[_0x41eb('0xb5')][_0x130c05['actionid']][_0x41eb('0xbc')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]][_0x41eb('0x100')],'ListId':this['actions'][_0x130c05[_0x41eb('0x130')]][_0x41eb('0x101')],'VoiceQueueId':this[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]][_0x41eb('0xdd')]||undefined,'CampaignId':this[_0x41eb('0xb5')][_0x130c05['actionid']][_0x41eb('0xde')]||undefined})[_0x41eb('0xba')](loggerCatch(_0x41eb('0x13c')));delete this[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]];unlockQueueStatus(_0x2772a4);}}else if((strategy[this['voiceQueues'][this[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]][_0x41eb('0xbc')]][_0x41eb('0x4f')]]||_0x41eb('0x1b'))===_0x41eb('0x1b')){var _0x2a24b6;if(this[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]]&&!_['isEmpty'](this['queueBooked'][this[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]][_0x41eb('0xbc')]])){if(this['queueBookedRR'][_0x244b85[_0x41eb('0xb5')][_0x130c05[_0x41eb('0x130')]]['queue']]){this[_0x41eb('0x2b')][_0x244b85['actions'][_0x130c05['actionid']][_0x41eb('0xbc')]]=this[_0x41eb('0x2b')][this[_0x41eb('0xb5')][_0x130c05['actionid']][_0x41eb('0xbc')]]?this[_0x41eb('0x2b')][this['actions'][_0x130c05['actionid']][_0x41eb('0xbc')]]:this[_0x41eb('0x2a')][this[_0x41eb('0xb5')][_0x130c05['actionid']][_0x41eb('0xbc')]]?this[_0x41eb('0x2a')][this[_0x41eb('0xb5')][_0x130c05['actionid']][_0x41eb('0xbc')]][_0x41eb('0x13d')]||0x0:0x0;}this[_0x41eb('0x2a')][this['actions'][_0x130c05[_0x41eb('0x130')]][_0x41eb('0xbc')]][_0x41eb('0x13d')]=this[_0x41eb('0x2b')][this['actions'][_0x130c05[_0x41eb('0x130')]][_0x41eb('0xbc')]];for(var _0x22bdf1=0x0;_0x22bdf1=0x0;})[_0x41eb('0xba')](myreject(_0x27e43f)));}}else{_0x5df79f[_0x41eb('0x135')](ami['Action']({'action':_0x41eb('0x154'),'command':util[_0x41eb('0x7f')](_0x41eb('0x155'),_0x1dce64,!_[_0x41eb('0x40')](config['timezones'][_0x35446e])?_0x35446e:'')})[_0x41eb('0x3e')](function(_0x23b11a){return _0x23b11a[_0x41eb('0x156')]['indexOf'](_0x41eb('0x158'))>=0x0;})[_0x41eb('0xba')](myreject(_0x27e43f)));}Promise[_0x41eb('0x159')](_0x5df79f)[_0x41eb('0x3e')](function(_0x55fd4b){var _0x211395=_[_0x41eb('0x15a')](_0x55fd4b);if(_0x211395){return _0x2be6d5(_0x211395);}else{_0x21958b[_0x41eb('0x44')]=_0x3a3274?_0x41eb('0x15b'):_0x41eb('0x15c');return _0x27e43f(msgResponse(_0x41eb('0x15d'),_0x41eb('0x14e'),_0x41eb('0x15e')+_0x3a3274+'\x20'+_0x49b069+_0x41eb('0x15f')+util[_0x41eb('0xa0')](_0x1dce64,{'showHidden':![],'depth':null})+_0x41eb('0x160')+_0x35446e));}})[_0x41eb('0xba')](function(_0x152948){return _0x27e43f(msgResponse(_0x41eb('0x14c'),_0x41eb('0x14e'),JSON['stringify'](_0x152948)));});});};Dialer[_0x41eb('0x1c')][_0x41eb('0x161')]=function(_0x44e970){var _0xfa5766=this;return function(){switch(_0x44e970['dialMethod']){case _0x41eb('0x162'):freeVariablesPredictive(_0x44e970);_0xfa5766[_0x41eb('0x163')](_0x44e970,0x1);break;case _0x41eb('0x164'):freeVariablesPredictive(_0x44e970);_0xfa5766[_0x41eb('0x163')](_0x44e970,_0x44e970[_0x41eb('0x165')]);break;case _0x41eb('0xb'):_0xfa5766[_0x41eb('0xb')](_0x44e970);break;case _0x41eb('0x9'):freeVariablesPredictive(_0x44e970);_0xfa5766[_0x41eb('0x163')](_0x44e970,0x1);break;default:freeVariablesPredictive(_0x44e970);logger[_0x41eb('0x9e')](_0x41eb('0x166'),_0x44e970[_0x41eb('0x42')],_0x41eb('0x167'));}};};Dialer[_0x41eb('0x1c')][_0x41eb('0x168')]=function(_0x51332c){return Promise[_0x41eb('0xc1')]()[_0x41eb('0x3e')](cmHopper[_0x41eb('0x169')](_0x51332c['id'],previewRecallmeReminderInterval))['then'](function(_0x35dfa4){for(var _0x557ad2=0x0;_0x557ad2<_0x35dfa4[_0x41eb('0xa1')];_0x557ad2++){var _0x16058a=_0x35dfa4[_0x557ad2][_0x41eb('0x16a')][_0x41eb('0x42')];if(_0x16058a)io['to'](util[_0x41eb('0x7f')](_0x41eb('0x16b'),_0x16058a))['emit'](_0x41eb('0x16c'),{'hopper':_0x35dfa4[_0x557ad2]});}})['catch'](function(){});};Dialer[_0x41eb('0x1c')]['launchHandleIvr']=function(_0x580afc){var _0x5f51b6=this;return function(){_0x5f51b6['handleIvr'](_0x580afc);};};Dialer[_0x41eb('0x1c')][_0x41eb('0xd')]=function(_0x472430){var _0x24e0cd=this;if(isNotPreview(_0x472430[_0x41eb('0x5a')])){if(isVoiceQueueOutbound(_0x472430[_0x41eb('0x4e')])&&isActive(_0x472430[_0x41eb('0x59')])){_0x472430[_0x41eb('0xab')]=!![];Promise['resolve']()[_0x41eb('0x3e')](checkIsLoggedIn(_0x472430,_0x472430[_0x41eb('0x51')]))[_0x41eb('0x3e')](checkIsActive(_0x472430,_0x472430[_0x41eb('0x59')]))[_0x41eb('0x3e')](checkInterval(_0x472430))['then'](_0x24e0cd[_0x41eb('0x147')](_0x472430))['then'](_0x24e0cd[_0x41eb('0x14b')](_0x472430[_0x41eb('0x16d')],_0x472430[_0x41eb('0x16e')],_0x472430['name'],_0x472430))[_0x41eb('0x3e')](_0x24e0cd[_0x41eb('0x14d')](_0x472430[_0x41eb('0x45')],_0x472430[_0x41eb('0x16e')],_0x472430[_0x41eb('0x42')],_0x472430))[_0x41eb('0x3e')](_0x24e0cd[_0x41eb('0x161')](_0x472430))[_0x41eb('0xba')](loggerCatchQueueSummary(_0x41eb('0x16f'),_0x472430));}else{notSendMessagesQueue(_0x472430);}}else{freeVariablesPredictive(_0x472430);}};Dialer[_0x41eb('0x1c')][_0x41eb('0x170')]=_['throttle'](function(){var _0x3e7e4b=_['filter'](this[_0x41eb('0x21')],function(_0x49c3d0){return _0x49c3d0[_0x41eb('0x171')];});var _0xd75948=_['filter'](this[_0x41eb('0x23')],function(_0x2b371b){return _0x2b371b[_0x41eb('0x172')]&&_0x2b371b['status']===_0x41eb('0xe3');});if(_0x3e7e4b[_0x41eb('0xa1')]>0x0&&_0xd75948['length']>0x0){return Promise['resolve']()[_0x41eb('0x3e')](cmHopper[_0x41eb('0x169')](_[_0x41eb('0x173')](_0x3e7e4b,'id'),previewRecallmeReminderInterval,_[_0x41eb('0x173')](_0xd75948,'id')))[_0x41eb('0x3e')](function(_0x930dae){for(var _0x2eeee9=0x0;_0x2eeee9<_0x930dae[_0x41eb('0xa1')];_0x2eeee9++){var _0x1a6c5b=_0x930dae[_0x2eeee9]['Agent'][_0x41eb('0x42')];if(_0x1a6c5b)io['to'](util[_0x41eb('0x7f')]('user:%s',_0x1a6c5b))[_0x41eb('0x4d')](_0x41eb('0x16c'),{'hopper':_0x930dae[_0x2eeee9]});}})[_0x41eb('0xba')](function(_0x21426e){logger[_0x41eb('0x9e')]('checkPreviewRecallReminder',_0x21426e);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x41eb('0x1c')]['syncCampaigns']=function(){var _0x48bf0c=this;var _0x3372d2;for(var _0x38edf2 in this['campaigns']){if(typeof this[_0x41eb('0x22')][_0x38edf2]!==_0x41eb('0xa3')){_0x3372d2=this['campaigns'][_0x38edf2];if(isCampaignIvr(_0x3372d2[_0x41eb('0x4e')])&&isActive(_0x3372d2[_0x41eb('0x7a')])){_0x3372d2['sendMessageOneNotActive']=!![];Promise[_0x41eb('0xc1')]()[_0x41eb('0x3e')](checkIsActive(_0x3372d2,_0x3372d2[_0x41eb('0x7a')]))[_0x41eb('0x3e')](checkInterval(_0x3372d2))['then'](_0x48bf0c[_0x41eb('0x147')](_0x3372d2))[_0x41eb('0x3e')](_0x48bf0c['checkIfTime'](_0x3372d2['dialGlobalInterval'],_0x3372d2[_0x41eb('0x16e')],_0x3372d2[_0x41eb('0x42')],_0x3372d2))['then'](_0x48bf0c[_0x41eb('0x14d')](_0x3372d2[_0x41eb('0x45')],_0x3372d2[_0x41eb('0x16e')],_0x3372d2['name'],_0x3372d2))[_0x41eb('0x3e')](_0x48bf0c[_0x41eb('0x174')](_0x3372d2))[_0x41eb('0xba')](loggerCatchQueueSummary('[syncCampaigns]',_0x3372d2));}else{notSendMessagesCampaign(_0x3372d2);}}}};function getCallerIdRandom(_0x3d7241,_0x37ea15){var _0x2635a7;var _0x133f3b;var _0x4e030e;if(_0x37ea15<=0x0){_0x37ea15=0x1;}_0x2635a7=new RegExp(_0x41eb('0x175')+_0x37ea15+'}$');_0x133f3b=Math[_0x41eb('0x176')](0xa,_0x37ea15-0x1);_0x4e030e=Math[_0x41eb('0x176')](0xa,_0x37ea15)-0x1;return util[_0x41eb('0x7f')]('%s',_[_0x41eb('0x177')](_0x3d7241,_0x2635a7,_[_0x41eb('0x178')](_0x133f3b,_0x4e030e)));}function extractCalleridName(_0x18dea6){var _0x3db9a6=_0x18dea6[_0x41eb('0x179')](/"(.*?)"/);return _0x3db9a6?_0x3db9a6[0x1]:_0x18dea6;}Dialer[_0x41eb('0x1c')]['actionOriginate']=function(_0x293772,_0x32db79){var _0x2af40d=this;var _0x232c30=uuid['v4']();this[_0x41eb('0xb5')][_0x232c30]=new Action(_0x293772,_0x32db79,_0x232c30);return new Promise(function(_0x34311a,_0x16ea19){if(_[_0x41eb('0x40')](_0x293772)&&typeof _0x293772!==_0x41eb('0x17a')){return _0x16ea19(msgResponse(_0x41eb('0x17b'),'Failure',_0x41eb('0x17c')));}if(_[_0x41eb('0x40')](_0x32db79[_0x41eb('0x17d')])||_0x32db79[_0x41eb('0x17d')]===null){return _0x16ea19(msgResponse(_0x41eb('0x17b'),_0x41eb('0x14e'),_0x41eb('0x17e')));}var _0x47ae71={'XMD-CALLERID':_0x2af40d[_0x41eb('0xb5')][_0x232c30][_0x41eb('0x17f')](),'XMD-AGI':_0x293772['dialQueueProject']?util[_0x41eb('0x7f')]('\x22agi://%s/square,%s\x22',ipAgi,_0x293772[_0x41eb('0x10d')]):_0x41eb('0x180'),'XMD-AGIAFTER':_0x293772[_0x41eb('0x114')]?util[_0x41eb('0x7f')](_0x41eb('0x181'),ipAgi,_0x293772[_0x41eb('0x114')]):_0x41eb('0x180'),'XMD-QUEUE':_0x293772[_0x41eb('0x4e')]===_0x41eb('0x98')?util[_0x41eb('0x7f')](_0x41eb('0x182'),_0x293772[_0x41eb('0x42')],_0x293772['dialQueueOptions']||'',_0x293772['dialAgiAfterHangupAgent']?'c':'',_0x293772[_0x41eb('0x11d')]||0x3):'NONE','XMD-CONTACTID':_0x32db79[_0x41eb('0x100')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2af40d[_0x41eb('0xb5')][_0x232c30][_0x41eb('0x17f')](),'XMD-AMD':_0x293772['dialAMDActive']?_0x41eb('0x183'):_0x41eb('0x180'),'XMD-DESTINATION':_0x41eb('0x184')};if(_0x293772[_0x41eb('0xe6')]){_0x47ae71[_0x41eb('0x185')]=_0x293772['dialAMDInitialSilence']||0x9c4;_0x47ae71[_0x41eb('0x186')]=_0x293772[_0x41eb('0x187')]||0x5dc;_0x47ae71['XMD-AMDAFTERGREETINGSILENCE']=_0x293772[_0x41eb('0x188')]||0x320;_0x47ae71[_0x41eb('0x189')]=_0x293772['dialAMDTotalAnalysisTime']||0x1388;_0x47ae71['XMD-AMDMINWORDLENGTH']=_0x293772['dialAMDMinWordLength']||0x64;_0x47ae71[_0x41eb('0x18a')]=_0x293772[_0x41eb('0x18b')]||0x32;_0x47ae71[_0x41eb('0x18c')]=_0x293772[_0x41eb('0x18d')]||0x3;_0x47ae71[_0x41eb('0x18e')]=_0x293772[_0x41eb('0x18f')]||0x100;_0x47ae71[_0x41eb('0x190')]=_0x293772['dialAMDMaximumWordLength']||0x1388;}if(_0x293772[_0x41eb('0x4e')]===_0x41eb('0x98')){_0x47ae71['XMD-VOICEQUEUEID']=_0x32db79[_0x41eb('0xdd')];}else{_0x47ae71[_0x41eb('0x191')]=_0x32db79[_0x41eb('0xde')];}for(var _0x26a665 in _0x32db79['Contact']){if(typeof _0x32db79[_0x41eb('0x192')][_0x26a665]!==_0x41eb('0xa3')){if(isNotNull(_0x32db79[_0x41eb('0x192')][_0x26a665])&&_0x26a665!=='id'&&_0x26a665!==_0x41eb('0x193')&&_0x26a665!==_0x41eb('0x194')&&_0x26a665!==_0x41eb('0x195')){_0x47ae71[util[_0x41eb('0x7f')](_0x41eb('0x196'),'XMD-',_[_0x41eb('0x197')](_0x26a665))]=_0x32db79[_0x41eb('0x192')][_0x26a665];}}}var _0x33ba44=_0x2af40d['isTrunkReachable'](_0x293772[_0x41eb('0x79')])?getCallerId(_0x293772[_0x41eb('0x79')][_0x41eb('0x7b')],_0x293772[_0x41eb('0x5b')],_0x293772[_0x41eb('0x198')]>0x0?getCallerIdRandom(_0x293772[_0x41eb('0x5c')],_0x293772[_0x41eb('0x198')]):_0x293772[_0x41eb('0x5c')]):getCallerId(_[_0x41eb('0xb7')](_0x293772[_0x41eb('0x149')])?_0x293772[_0x41eb('0x79')]['callerid']:_0x293772[_0x41eb('0x149')]['callerid'],_0x293772[_0x41eb('0x5b')],_0x293772[_0x41eb('0x198')]>0x0?getCallerIdRandom(_0x293772[_0x41eb('0x5c')],_0x293772['dialRandomLastDigitCallerIdNumber']):_0x293772[_0x41eb('0x5c')]);if(_0x33ba44){_0x47ae71[_0x41eb('0x199')]=_0x2af40d[_0x41eb('0xb5')][_0x232c30][_0x41eb('0x19a')]=extractCalleridName(_0x33ba44);_0x47ae71['XMD-ORIGINATECALLERIDNUM']=_0x32db79[_0x41eb('0x17d')];}_0x293772[_0x41eb('0x19b')]=_0x47ae71;return ami['Action']({'actionid':_0x232c30,'action':_0x41eb('0x17b'),'channel':_0x2af40d[_0x41eb('0x148')](_0x293772['Trunk'])?util[_0x41eb('0x7f')](_0x41eb('0x19c'),_0x293772['Trunk'][_0x41eb('0x42')],isNotNull(_0x293772[_0x41eb('0x5e')])?_0x293772[_0x41eb('0x5e')]['trim']()||'':'',_0x293772['dialCutDigit']>0x0?_0x32db79[_0x41eb('0x17d')][_0x41eb('0x19d')](_0x293772[_0x41eb('0x19e')]):_0x32db79['phone']):util['format']('SIP/%s/%s%s',_[_0x41eb('0xb7')](_0x293772[_0x41eb('0x149')])?_0x293772[_0x41eb('0x79')]['name']:_0x293772[_0x41eb('0x149')][_0x41eb('0x42')],isNotNull(_0x293772[_0x41eb('0x5e')])?_0x293772[_0x41eb('0x5e')][_0x41eb('0x19f')]()||'':'',_0x293772['dialCutDigit']>0x0?_0x32db79['phone'][_0x41eb('0x19d')](_0x293772[_0x41eb('0x19e')]):_0x32db79[_0x41eb('0x17d')]),'callerid':_0x33ba44,'Exten':'xcally-motion-dialer','Context':_0x41eb('0x1a0'),'Priority':'1','variable':_0x47ae71,'timeout':(_0x293772['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x232c30})[_0x41eb('0x3e')](function(_0x5c7ced){return _0x34311a(_0x5c7ced);})[_0x41eb('0xba')](function(_0x242788){_0x293772['outboundOriginateFailureCallsDay']+=0x1;var _0x37ea42=new History(_0x2af40d['actions'][_0x232c30]);logger[_0x41eb('0x9e')](util['format'](_0x41eb('0x1a1'),JSON['stringify'](_0x242788)));_0x37ea42[_0x41eb('0xe9')]=0xe;_0x37ea42[_0x41eb('0xb1')]=_0x41eb('0x1a2');_0x37ea42['starttime']=moment()[_0x41eb('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x37ea42[_0x41eb('0x127')]=_0x37ea42[_0x41eb('0x126')];_0x2af40d[_0x41eb('0xd6')](_0x37ea42)[_0x41eb('0xba')](loggerCatch('[originate][error]'));_0x2af40d[_0x41eb('0xd4')](_0x37ea42)[_0x41eb('0xba')](loggerCatch(_0x41eb('0x1a3')))[_0x41eb('0x1f')](function(){delete _0x2af40d[_0x41eb('0xb5')][_0x232c30];return _0x16ea19(msgResponse(_0x41eb('0x17b'),'Error',_0x41eb('0x1a4')));});});});};Dialer[_0x41eb('0x1c')][_0x41eb('0x30')]=function(_0x3a7067){var _0x260fbd=this[_0x41eb('0xb5')][_0x3a7067[_0x41eb('0x130')]];if(_0x260fbd){delete this['actions'][_0x3a7067[_0x41eb('0x130')]];_0x260fbd[_0x41eb('0x1a5')]=moment()[_0x41eb('0x7f')](_0x41eb('0x116'));var _0x1a428b=_0x260fbd[_0x41eb('0x4e')]===_0x41eb('0x7e')?this[_0x41eb('0x22')][_0x260fbd[_0x41eb('0xbc')]]:this['voiceQueues'][_0x260fbd[_0x41eb('0x1a6')]()];if(!this[_0x41eb('0xe1')](_0x3a7067[_0x41eb('0x1a7')])){this[_0x41eb('0xbb')](_0x1a428b);return this[_0x41eb('0x1a8')](_0x260fbd,_0x1a428b,_0x3a7067)['catch'](loggerCatch(_0x41eb('0x1a9')));}this[_0x41eb('0x28')][_0x3a7067[_0x41eb('0xe4')]]=_0x260fbd;}};Dialer[_0x41eb('0x1c')]['checkRetriveMax']=function(_0x5379d9,_0x1425fa,_0x55624c){var _0xb2393b=new History(_0x1425fa);if(_0xb2393b[_0x41eb('0x105')]+_0xb2393b['countcongestionretry']+_0xb2393b['countnoanswerretry']+_0xb2393b[_0x41eb('0xf6')]+_0xb2393b[_0x41eb('0x107')]+_0xb2393b[_0x41eb('0xf7')]+_0xb2393b['countmachineretry']+_0xb2393b[_0x41eb('0xf8')]>=_0x55624c[_0x41eb('0x108')]-0x1){return!![];}switch(_0x5379d9){case 0x3:if(_0xb2393b[_0x41eb('0x106')]>=_0x55624c[_0x41eb('0x1aa')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0xb2393b['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x41eb('0xfd')](_0x55624c[_0x41eb('0x1ab')],_0x41eb('0xff'))[_0x41eb('0x7f')](_0x41eb('0x116')),'ContactId':_0xb2393b[_0x41eb('0x100')],'ListId':_0xb2393b[_0x41eb('0x101')],'VoiceQueueId':_0xb2393b[_0x41eb('0xdd')]||undefined,'CampaignId':_0xb2393b[_0x41eb('0xde')]||undefined})[_0x41eb('0xba')](loggerCatch(_0x41eb('0x1ac')));break;case 0x5:if(_0xb2393b['countbusyretry']>=_0x55624c[_0x41eb('0x1ad')]-0x1){return!![];}this[_0x41eb('0xcb')]({'active':![],'countbusyretry':_0xb2393b['countbusyretry']+=0x1,'scheduledat':moment()[_0x41eb('0xfd')](_0x55624c[_0x41eb('0x1ae')],_0x41eb('0xff'))[_0x41eb('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xb2393b[_0x41eb('0x100')],'ListId':_0xb2393b[_0x41eb('0x101')],'VoiceQueueId':_0xb2393b[_0x41eb('0xdd')]||undefined,'CampaignId':_0xb2393b['CampaignId']||undefined})[_0x41eb('0xba')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0xb2393b[_0x41eb('0xf5')]>=_0x55624c[_0x41eb('0x1af')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0xb2393b['countcongestionretry']+=0x1,'scheduledat':moment()[_0x41eb('0xfd')](_0x55624c[_0x41eb('0x1b0')],'minutes')[_0x41eb('0x7f')](_0x41eb('0x116')),'ContactId':_0xb2393b['ContactId'],'ListId':_0xb2393b[_0x41eb('0x101')],'VoiceQueueId':_0xb2393b[_0x41eb('0xdd')]||undefined,'CampaignId':_0xb2393b['CampaignId']||undefined})['catch'](loggerCatch(_0x41eb('0x1b1')));break;case 0x0:if(_0xb2393b[_0x41eb('0xf6')]>=_0x55624c[_0x41eb('0x1b2')]-0x1){return!![];}else{this[_0x41eb('0xcb')]({'active':![],'countnosuchnumberretry':_0xb2393b[_0x41eb('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x55624c[_0x41eb('0x1b3')],'minutes')[_0x41eb('0x7f')](_0x41eb('0x116')),'ContactId':_0xb2393b[_0x41eb('0x100')],'ListId':_0xb2393b[_0x41eb('0x101')],'VoiceQueueId':_0xb2393b[_0x41eb('0xdd')]||undefined,'CampaignId':_0xb2393b[_0x41eb('0xde')]||undefined})[_0x41eb('0xba')](loggerCatch(_0x41eb('0x1b4')));}break;case 0xa:if(_0xb2393b[_0x41eb('0x107')]>=_0x55624c[_0x41eb('0x1b5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0xb2393b[_0x41eb('0x107')]+=0x1,'scheduledat':moment()[_0x41eb('0xfd')](_0x55624c[_0x41eb('0x121')],_0x41eb('0xff'))[_0x41eb('0x7f')](_0x41eb('0x116')),'ContactId':_0xb2393b[_0x41eb('0x100')],'ListId':_0xb2393b['ListId'],'VoiceQueueId':_0xb2393b['VoiceQueueId']||undefined,'CampaignId':_0xb2393b[_0x41eb('0xde')]||undefined})[_0x41eb('0xba')](loggerCatch(_0x41eb('0x125')));break;case 0xb:if(_0xb2393b[_0x41eb('0xf7')]>=_0x55624c[_0x41eb('0x12b')]-0x1){return!![];}this[_0x41eb('0xcb')]({'active':![],'countabandonedretry':_0xb2393b[_0x41eb('0xf7')]+=0x1,'scheduledat':moment()[_0x41eb('0xfd')](_0x55624c[_0x41eb('0x12c')],_0x41eb('0xff'))[_0x41eb('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xb2393b['ContactId'],'ListId':_0xb2393b[_0x41eb('0x101')],'VoiceQueueId':_0xb2393b[_0x41eb('0xdd')]||undefined,'CampaignId':_0xb2393b[_0x41eb('0xde')]||undefined})['catch'](loggerCatch(_0x41eb('0x12d')));break;case 0x13:if(_0xb2393b[_0x41eb('0xf2')]>=_0x55624c[_0x41eb('0xfb')]-0x1){return!![];}this[_0x41eb('0xcb')]({'active':![],'countmachineretry':_0xb2393b[_0x41eb('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x55624c[_0x41eb('0xfe')],'minutes')[_0x41eb('0x7f')](_0x41eb('0x116')),'ContactId':_0xb2393b['ContactId'],'ListId':_0xb2393b[_0x41eb('0x101')],'VoiceQueueId':_0xb2393b[_0x41eb('0xdd')]||undefined,'CampaignId':_0xb2393b[_0x41eb('0xde')]||undefined})[_0x41eb('0xba')](loggerCatch(_0x41eb('0x109')));break;case 0x14:if(_0xb2393b[_0x41eb('0xf8')]>=_0x55624c['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x41eb('0xcb')]({'active':![],'countagentrejectretry':_0xb2393b[_0x41eb('0xf8')]+=0x1,'scheduledat':moment()[_0x41eb('0xfd')](_0x55624c[_0x41eb('0x1b6')],_0x41eb('0xff'))[_0x41eb('0x7f')](_0x41eb('0x116')),'ContactId':_0xb2393b['ContactId'],'ListId':_0xb2393b[_0x41eb('0x101')],'VoiceQueueId':_0xb2393b['VoiceQueueId']||undefined,'CampaignId':_0xb2393b[_0x41eb('0xde')]||undefined})[_0x41eb('0xba')](loggerCatch(_0x41eb('0x1b7')));break;default:return!![];}};Dialer[_0x41eb('0x1c')]['callProgressDetecting']=function(_0x11e933,_0xec8eb6,_0x3bb9ae){var _0x51f791=this;var _0x59e373=new History(_0x11e933);var _0x22b735=![];var _0x30065f;var _0x4ea633;return new Promise(function(_0x636324,_0x5b8b20){if(_[_0x41eb('0x40')](_0xec8eb6)&&typeof _0xec8eb6!==_0x41eb('0x17a')){return _0x5b8b20(msgResponse(_0x41eb('0x1b8'),_0x41eb('0x14e'),_0x41eb('0x1b9')));}if(_[_0x41eb('0x40')](_0x3bb9ae)&&typeof _0x3bb9ae!==_0x41eb('0x17a')){return _0x5b8b20(msgResponse('[callProgressDetecting]',_0x41eb('0x14e'),_0x41eb('0x1ba')));}_0x51f791['verifyAdditionalPhones'](_0x59e373,_0x3bb9ae['reason'],_0xec8eb6)['then'](function(_0x435465){if(_0x435465[_0x41eb('0x124')]==0x1)_0x22b735=!![];switch(_0x3bb9ae['reason']){case'0':_0xec8eb6[_0x41eb('0x66')]+=0x1;_0x59e373['state']=0x0;_0x59e373[_0x41eb('0xb1')]=_0x41eb('0x1bb');_0x59e373[_0x41eb('0xf6')]+=0x1;_0x59e373[_0x41eb('0x104')]+=0x1;ami[_0x41eb('0x4d')](_0x41eb('0x1bc'),ut[_0x41eb('0xed')](_0x11e933,_0x41eb('0x1bd')));_0x30065f=_0xec8eb6[_0x41eb('0x1b3')];_0x4ea633=_0xec8eb6['callAdditionalPhoneAfterMin'];_0x51f791[_0x41eb('0xd6')](_0x59e373)['catch'](loggerCatch(_0x41eb('0xf4')));if(_0x51f791[_0x41eb('0x1be')](0x0,_0x11e933,_0xec8eb6)&&!_0x22b735){if(_0x59e373[_0x41eb('0xf6')]>=_0xec8eb6[_0x41eb('0x1b2')]){_0x51f791['createStateFinal'](_0x59e373,_0x636324,_0x5b8b20,_0x41eb('0x1bf'));}else{_0x51f791['stateGlobal'](_0x59e373,_0x636324,_0x5b8b20,_0x41eb('0x1bf'));}}break;case'3':_0xec8eb6['outboundNoAnswerCallsDay']+=0x1;_0x59e373['state']=0x3;_0x59e373[_0x41eb('0xb1')]='NoAnswer';_0x59e373[_0x41eb('0x106')]+=0x1;_0x59e373[_0x41eb('0x104')]+=0x1;var _0x4f7fe7=ut[_0x41eb('0x1c0')](_0x11e933,_0xec8eb6);ami[_0x41eb('0x4d')](_0x41eb('0x1c1'),_0x4f7fe7);_0x30065f=_0xec8eb6['dialNoAnswerRetryFrequency'];_0x4ea633=_0xec8eb6[_0x41eb('0x122')];_0x51f791[_0x41eb('0xd6')](_0x59e373)['catch'](loggerCatch(_0x41eb('0x1c2')));if(_0x51f791['checkRetriveMax'](0x3,_0x11e933,_0xec8eb6)&&!_0x22b735){if(_0x59e373[_0x41eb('0x106')]>=_0xec8eb6[_0x41eb('0x1aa')]){_0x51f791[_0x41eb('0xfc')](_0x59e373,_0x636324,_0x5b8b20,_0x41eb('0x1c3'));}else{_0x51f791['stateGlobal'](_0x59e373,_0x636324,_0x5b8b20,_0x41eb('0x1c3'));}}break;case'5':_0xec8eb6[_0x41eb('0x62')]+=0x1;_0x59e373[_0x41eb('0xe9')]=0x5;_0x59e373[_0x41eb('0xb1')]=_0x41eb('0x1c4');_0x59e373[_0x41eb('0x105')]+=0x1;_0x59e373['countglobal']+=0x1;ami[_0x41eb('0x4d')](_0x41eb('0x1c5'),ut['buildObj'](_0x11e933,_0x41eb('0x1c6')));_0x30065f=_0xec8eb6['dialBusyRetryFrequency'];_0x4ea633=_0xec8eb6[_0x41eb('0x122')];_0x51f791[_0x41eb('0xd6')](_0x59e373)[_0x41eb('0xba')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x51f791['checkRetriveMax'](0x5,_0x11e933,_0xec8eb6)&&!_0x22b735){if(_0x59e373['countbusyretry']>=_0xec8eb6[_0x41eb('0x1ad')]){_0x51f791[_0x41eb('0xfc')](_0x59e373,_0x636324,_0x5b8b20,'reason\x205\x20busy');}else{_0x51f791[_0x41eb('0xf9')](_0x59e373,_0x636324,_0x5b8b20,'reason\x205\x20busy');}}break;case'8':_0xec8eb6['outboundCongestionCallsDay']+=0x1;_0x59e373[_0x41eb('0xe9')]=0x8;_0x59e373[_0x41eb('0xb1')]=_0x41eb('0x1c7');_0x59e373[_0x41eb('0xf5')]+=0x1;_0x59e373['countglobal']+=0x1;_0x30065f=_0xec8eb6[_0x41eb('0x1b0')];_0x4ea633=_0xec8eb6[_0x41eb('0x122')];ami['emit'](_0x41eb('0x1c8'),ut[_0x41eb('0xed')](_0x11e933,_0x41eb('0x1c9')));_0x51f791[_0x41eb('0xd6')](_0x59e373)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x51f791[_0x41eb('0x1be')](0x8,_0x11e933,_0xec8eb6)&&!_0x22b735){if(_0x59e373[_0x41eb('0xf5')]>=_0xec8eb6['dialCongestionMaxRetry']){_0x51f791[_0x41eb('0xfc')](_0x59e373,_0x636324,_0x5b8b20,_0x41eb('0x1ca'));}else{_0x51f791['stateGlobal'](_0x59e373,_0x636324,_0x5b8b20,_0x41eb('0x1ca'));}}break;case'11':_0xec8eb6[_0x41eb('0x1cb')]+=0x1;_0x59e373[_0x41eb('0xe9')]=0xb;_0x59e373[_0x41eb('0xb1')]='Abandoned';_0x59e373[_0x41eb('0xf7')]+=0x1;_0x59e373['countglobal']+=0x1;_0x30065f=_0xec8eb6[_0x41eb('0x12c')];_0x4ea633=_0xec8eb6[_0x41eb('0x122')];_0x51f791[_0x41eb('0xd6')](_0x59e373)[_0x41eb('0xba')](loggerCatch(_0x41eb('0x12f')));if(_0x51f791['checkRetriveMax'](0xb,_0x11e933,_0xec8eb6)&&!_0x22b735){if(_0x59e373['countabandonedretry']>=_0xec8eb6[_0x41eb('0x12b')]){_0x51f791[_0x41eb('0xfc')](_0x59e373,_0x636324,_0x5b8b20,_0x41eb('0x1cc'));}else{_0x51f791[_0x41eb('0xf9')](_0x59e373,_0x636324,_0x5b8b20,_0x41eb('0x1cc'));}}break;case'20':_0xec8eb6[_0x41eb('0x69')]+=0x1;_0x59e373['state']=0x14;_0x59e373[_0x41eb('0xb1')]=_0x41eb('0x1cd');_0x59e373['countagentrejectretry']+=0x1;_0x59e373[_0x41eb('0x104')]+=0x1;_0x30065f=_0xec8eb6[_0x41eb('0x1b6')];_0x4ea633=_0xec8eb6[_0x41eb('0x122')];ami[_0x41eb('0x4d')]('custom:agentreject',ut[_0x41eb('0xed')](_0x11e933,_0x41eb('0x1ce')));_0x51f791['createHistory'](_0x59e373)[_0x41eb('0xba')](loggerCatch(_0x41eb('0x1cf')));if(_0x51f791[_0x41eb('0x1be')](0x14,_0x11e933,_0xec8eb6)&&!_0x22b735){if(_0x59e373[_0x41eb('0xf8')]>=_0xec8eb6[_0x41eb('0x1d0')]){_0x51f791[_0x41eb('0xfc')](_0x59e373,_0x636324,_0x5b8b20,'reason\x2020\x20agentreject');}else{_0x51f791[_0x41eb('0xf9')](_0x59e373,_0x636324,_0x5b8b20,_0x41eb('0x1d1'));}}break;default:_0xec8eb6['outboundUnknownCallsDay']+=0x1;_0x59e373[_0x41eb('0xe9')]=0xc;_0x59e373['statedesc']=_0x3bb9ae['reason'];_0x30065f=_0xec8eb6['dialAgentRejectRetryFrequency'];_0x4ea633=_0xec8eb6['callAdditionalPhoneAfterMin'];_0x51f791[_0x41eb('0xd6')](_0x59e373)[_0x41eb('0xba')](loggerCatch(_0x41eb('0x1d2')));if(_0x51f791[_0x41eb('0x1be')](_0x3bb9ae['reason'],_0x11e933,_0xec8eb6)&&!_0x22b735){if(_0x59e373[_0x41eb('0x105')]+_0x59e373[_0x41eb('0xf5')]+_0x59e373[_0x41eb('0x106')]+_0x59e373['countnosuchnumberretry']+_0x59e373[_0x41eb('0x107')]+_0x59e373[_0x41eb('0xf7')]+_0x59e373[_0x41eb('0xf2')]+_0x59e373[_0x41eb('0xf8')]>=_0xec8eb6[_0x41eb('0x108')]){_0x51f791[_0x41eb('0xf9')](_0x59e373,_0x636324,_0x5b8b20,_0x3bb9ae['reason']);}else{_0x51f791['createStateFinal'](_0x59e373,_0x636324,_0x5b8b20,_0x3bb9ae[_0x41eb('0x1d3')]);}}}})['then'](function(){if(_0x22b735){_0x51f791['swapAdditionalPhones'](_0x59e373,_0x30065f,_0x4ea633)[_0x41eb('0x3e')](function(){return _0x636324(0x1);});}});});};Dialer['prototype'][_0x41eb('0xf9')]=function(_0x33285a,_0x2fc3a2,_0x4f199b,_0x35e2c2){var _0x3bf6bc=new Final(_0x33285a);_0x3bf6bc[_0x41eb('0xe9')]=0xf;_0x3bf6bc[_0x41eb('0xb1')]=_0x41eb('0x1d4');this[_0x41eb('0xfc')](_0x3bf6bc,_0x2fc3a2,_0x4f199b,_0x35e2c2);};Dialer[_0x41eb('0x1c')]['createStateFinal']=function(_0x541cbf,_0x61fd68,_0x45ec5b,_0x1ae54f){this[_0x41eb('0xd4')](_0x541cbf)['then'](function(){return _0x61fd68(msgResponse(_0x41eb('0x1b8'),_0x41eb('0x1d5'),_0x1ae54f));})[_0x41eb('0xba')](function(){return _0x45ec5b(msgResponse(_0x41eb('0x1d6'),_0x41eb('0x14e'),_0x41eb('0x1d7')));});};Dialer[_0x41eb('0x1c')]['predictive']=function(_0xe1a123){var _0x402b78=_0xe1a123[_0x41eb('0x1d8')]/0x64;var _0x28401b=_0xe1a123['outboundDropCallsDayTimeout']/(_0xe1a123[_0x41eb('0x65')]+_0xe1a123[_0x41eb('0x60')]);var _0x4d10b8=Math[_0x41eb('0x1d9')](_0xe1a123[_0x41eb('0x73')]*(_0xe1a123['predictiveIntervalMaxThreshold']/0x64));var _0x80e5ac=Math[_0x41eb('0x1d9')](_0xe1a123['predictiveIntervalAvailable']*(_0xe1a123[_0x41eb('0x1da')]/0x64));var _0x5e3d91=_0xe1a123[_0x41eb('0x50')]+_0xe1a123[_0x41eb('0x54')];var _0x24f41b=Math[_0x41eb('0x1db')](_0xe1a123[_0x41eb('0x74')]*_0xe1a123['erlangAbandonmentRate']*_0xe1a123[_0x41eb('0x70')]*_0xe1a123[_0x41eb('0x71')]);if(_[_0x41eb('0x40')](_0xe1a123[_0x41eb('0x29')])){if(!_[_0x41eb('0x40')](_0xe1a123[_0x41eb('0x78')])){_0xe1a123[_0x41eb('0x78')]=undefined;loggerPredictive['error'](_0x41eb('0x1dc'),_0x41eb('0x1dd'));}if(!_[_0x41eb('0x40')](_0xe1a123['handlePredictive'])){loggerPredictive['error'](_0x41eb('0x1dc'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0xe1a123[_0x41eb('0x96')]);_0xe1a123[_0x41eb('0x96')]=undefined;}_0xe1a123['startProgressive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x41eb('0x82')](_0xe1a123[_0x41eb('0x42')],_0x41eb('0x1de'),_0xe1a123[_0x41eb('0x29')]);this[_0x41eb('0x163')](_0xe1a123,0x1);}else if(ifInterval(_0xe1a123['dialPredictiveInterval'],_0xe1a123[_0x41eb('0x29')])){this[_0x41eb('0x163')](_0xe1a123,0x1);loggerPredictiveCalls[_0x41eb('0x82')](_0x41eb('0x1df'),_0xe1a123[_0x41eb('0x29')],_0xe1a123[_0x41eb('0x42')]);_0xe1a123['erlangCalls']=0x0;_0xe1a123[_0x41eb('0x6f')]=0x0;}else if(_0x402b78<_0x28401b&&_0xe1a123['dialPredictiveOptimization']===_0x41eb('0x1e0')){freeVariablesPredictive(_0xe1a123);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x1e1'),_0x41eb('0x1e2'),_0x28401b,_0x41eb('0x29'),_0xe1a123[_0x41eb('0x42')]);}else if(_0x24f41b<_0xe1a123[_0x41eb('0x6f')]&&_0xe1a123[_0x41eb('0x1e3')]===_0x41eb('0x1e0')){freeVariablesPredictive(_0xe1a123);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x1e4'),_0x41eb('0x1e5'),_0x24f41b,_0x41eb('0x1e6'),_0xe1a123['predictiveIntervalErlangCallsDroppedCalls'],_0x41eb('0x29'),_0xe1a123['name']);}else if(!ifInterval(_0xe1a123[_0x41eb('0x1e7')],_0xe1a123[_0x41eb('0x29')])&&_[_0x41eb('0x40')](_0xe1a123['startPredictive'])&&!_[_0x41eb('0x40')](_0xe1a123[_0x41eb('0x29')])){_0xe1a123[_0x41eb('0x78')]=moment()['format'](_0x41eb('0x116'));loggerPredictive[_0x41eb('0x82')](_0xe1a123[_0x41eb('0x42')],_0x41eb('0x1e8'),_0xe1a123[_0x41eb('0x78')]);this[_0x41eb('0xc8')](_0xe1a123[_0x41eb('0x1e7')])[_0x41eb('0x3e')](this[_0x41eb('0x1e9')](_0xe1a123))[_0x41eb('0x3e')](mergeDataErlangB(_0xe1a123))['then'](this['startMethodPredictive'](_0xe1a123))[_0x41eb('0xba')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0xe1a123));}else if(!ifInterval(_0xe1a123['dialPredictiveInterval'],_0xe1a123['startPredictive'])){_0xe1a123[_0x41eb('0x6f')]=0x0;_0xe1a123['startPredictive']=moment()[_0x41eb('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x41eb('0x82')](_0xe1a123[_0x41eb('0x42')],_0x41eb('0x1ea'),_0xe1a123[_0x41eb('0x78')]);clearInterval(_0xe1a123[_0x41eb('0x96')]);_0xe1a123[_0x41eb('0x96')]=undefined;this[_0x41eb('0xc8')](_0xe1a123[_0x41eb('0x1e7')])[_0x41eb('0x3e')](this[_0x41eb('0x1e9')](_0xe1a123))[_0x41eb('0x3e')](mergeDataErlangB(_0xe1a123))['then'](this[_0x41eb('0x1eb')](_0xe1a123))[_0x41eb('0xba')](loggerCatchPredictive(_0x41eb('0x1ec'),_0xe1a123));}else if(_0xe1a123['predictiveIntervalAvailable']&&_0x5e3d91<_0xe1a123[_0x41eb('0x73')]-_0x80e5ac){freeVariablesPredictive(_0xe1a123);loggerPredictive[_0x41eb('0x82')](_0xe1a123[_0x41eb('0x42')],_0x41eb('0x1ed'),_0x5e3d91,_0x41eb('0x1ee'),_0xe1a123[_0x41eb('0x73')],'-',_0x80e5ac,'=',_0xe1a123['predictiveIntervalAvailable']-_0x80e5ac,')');}else if(_0xe1a123[_0x41eb('0x73')]&&_0x5e3d91>_0xe1a123[_0x41eb('0x73')]+_0x4d10b8){freeVariablesPredictive(_0xe1a123);loggerPredictive[_0x41eb('0x82')](_0xe1a123['name'],_0x41eb('0x1ed'),_0x5e3d91,_0x41eb('0x1ef'),_0xe1a123[_0x41eb('0x73')],'+',_0x4d10b8,'=',_0xe1a123[_0x41eb('0x73')]+_0x4d10b8,')');}};Dialer[_0x41eb('0x1c')]['getDataPredictive']=function(_0x5d92c9){var _0x4b507f=this;return function(_0x1a85ae){return new Promise(function(_0x13de40,_0x13746b){_['merge'](_0x5d92c9,_0x1a85ae[0x0]);if(checkGetDataPredictive(_0x1a85ae[0x0])){var _0x455af0=_0x5d92c9['predictiveIntervalAvailable']=_0x5d92c9[_0x41eb('0x54')]+_0x5d92c9[_0x41eb('0x50')];var _0x44a248=_0x5d92c9[_0x41eb('0x1e7')]*0x3c;var _0x33abbf=_0x1a85ae[0x0][_0x41eb('0x8a')]+_0x1a85ae[0x0][_0x41eb('0x6c')];var _0x538a17=(_0x1a85ae[0x0][_0x41eb('0x6b')]+_0x1a85ae[0x0][_0x41eb('0x87')]+_0x1a85ae[0x0][_0x41eb('0x6d')])/_0x1a85ae[0x0][_0x41eb('0x85')];_0x5d92c9['predictiveIntervalHitRate']=_0x538a17>0x0?_0x538a17:0x1;switch(_0x5d92c9[_0x41eb('0x1e3')]){case _0x41eb('0x1e0'):var _0x53df59=_0x5d92c9[_0x41eb('0x1d8')]/0x64;return _0x4b507f[_0x41eb('0x1f0')](_0x455af0,_0x44a248,_0x33abbf,_0x538a17,_0x53df59)[_0x41eb('0x3e')](function(_0x59463d){return _0x13de40(_0x59463d);});case'agentBusyFactor':var _0xcf0cd=_0x5d92c9[_0x41eb('0x1d8')]/0x64;return _0x4b507f[_0x41eb('0x1f1')](_0x455af0,_0x44a248,_0x33abbf,_0x538a17,_0xcf0cd)[_0x41eb('0x3e')](function(_0x33cb76){return _0x13de40(_0x33cb76);});default:return _0x13746b(msgResponse('[getDataPredictive]',_0x41eb('0x14e'),_0x41eb('0x1f2')));}}else{return _0x13746b(msgResponse('[getDataPredictive]',_0x41eb('0x14e'),_0x41eb('0x1f3')));}});};};Dialer[_0x41eb('0x1c')][_0x41eb('0x1f4')]=function(_0x2b4fe3){var _0x3b6d3a=this;return function(_0x4230c7){return new Promise(function(_0x4c0754,_0x190f6e){_[_0x41eb('0x92')](_0x2b4fe3,_0x4230c7[0x0]);if(checkGetDataPredictive(_0x4230c7[0x0])){loggerPredictive[_0x41eb('0x82')](JSON[_0x41eb('0x4a')](_0x4230c7[0x0]));if(_0x2b4fe3['dialPredictiveOptimization']===_0x41eb('0x1e0')){return _0x3b6d3a[_0x41eb('0xd2')](_0x2b4fe3['id'])[_0x41eb('0x3e')](function(_0x39edbf){var _0x5d942c=_0x2b4fe3['loggedIn']-_0x39edbf[0x0][_0x41eb('0x1f5')];var _0x28bce8=_0x2b4fe3[_0x41eb('0x1e7')]*0x3c;var _0x45b991=_0x4230c7[0x0][_0x41eb('0x8a')]+_0x4230c7[0x0]['predictiveIntervalAvgHoldtime'];var _0x9ab4ed=(_0x4230c7[0x0]['predictiveIntervalAnsweredCalls']+_0x4230c7[0x0][_0x41eb('0x87')]+_0x4230c7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4230c7[0x0][_0x41eb('0x85')];var _0x32d2e2=_0x2b4fe3['dialPredictiveOptimizationPercentage']/0x64;_0x2b4fe3[_0x41eb('0x72')]=_0x39edbf[0x0][_0x41eb('0x1f5')]||0x0;_0x2b4fe3[_0x41eb('0x70')]=_0x9ab4ed>0x0?_0x9ab4ed:0x1;return _0x3b6d3a[_0x41eb('0x1f0')](_0x5d942c,_0x28bce8,_0x45b991,_0x9ab4ed,_0x32d2e2);})[_0x41eb('0x3e')](function(_0x16f310){return _0x4c0754(_0x16f310);})[_0x41eb('0xba')](function(_0x1366b5){return _0x190f6e(msgResponse('[CatchErlangB]','Failure',JSON[_0x41eb('0x4a')](_0x1366b5)));});}if(_0x2b4fe3[_0x41eb('0x1e3')]===_0x41eb('0x1f6')){return _0x3b6d3a['getVoiceQueueRtPauses'](_0x2b4fe3['id'])[_0x41eb('0x3e')](function(_0x3d559d){var _0x2b743f=_0x2b4fe3[_0x41eb('0x51')]-_0x3d559d[0x0][_0x41eb('0x1f5')];var _0x2a74cf=_0x2b4fe3['dialPredictiveInterval']*0x3c;var _0x50b09c=_0x4230c7[0x0][_0x41eb('0x8a')]+_0x4230c7[0x0]['predictiveIntervalAvgHoldtime'];var _0x5d2c1a=(_0x4230c7[0x0]['predictiveIntervalAnsweredCalls']+_0x4230c7[0x0][_0x41eb('0x87')]+_0x4230c7[0x0][_0x41eb('0x6d')])/_0x4230c7[0x0][_0x41eb('0x85')];var _0x448f0b=_0x2b4fe3[_0x41eb('0x1d8')]/0x64;_0x2b4fe3['predictiveIntervalPauses']=_0x3d559d[0x0][_0x41eb('0x1f5')]||0x0;_0x2b4fe3['predictiveIntervalHitRate']=_0x5d2c1a>0x0?_0x5d2c1a:0x1;return _0x3b6d3a[_0x41eb('0x1f1')](_0x2b743f,_0x2a74cf,_0x50b09c,_0x5d2c1a,_0x448f0b);})[_0x41eb('0x3e')](function(_0x5b1905){return _0x4c0754(_0x5b1905);})[_0x41eb('0xba')](function(_0x188e16){return _0x190f6e(msgResponse('[CatchErlangB]',_0x41eb('0x14e'),JSON['stringify'](_0x188e16)));});}}else{return _0x190f6e(msgResponse('[getDataPredictive]',_0x41eb('0x14e'),'check\x20failure'));}});};};Dialer[_0x41eb('0x1c')][_0x41eb('0x1eb')]=function(_0x1c7ff2){var _0x32e640=this;return function(){var _0x58be44=0x0;var _0x499997=Math[_0x41eb('0x1db')](_0x1c7ff2['erlangCallToSecond']*0x3e8);if(_0x499997>0x0){_0x499997=_0x499997<0x64?0x64:_0x499997;loggerPredictive['info'](_0x1c7ff2[_0x41eb('0x42')],_0x41eb('0x1f7'),_0x499997,_0x41eb('0x4b'));_0x1c7ff2[_0x41eb('0x96')]=setInterval(function(){_0x32e640['handlePredictive'](_0x1c7ff2);loggerPredictiveCalls[_0x41eb('0x82')]('[handlePredictive]',_0x58be44+=0x1);},_0x499997);}else{loggerPredictive[_0x41eb('0x82')](_0x1c7ff2[_0x41eb('0x42')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x41eb('0x1c')]['checkContactBlack']=function(_0x4bb85b,_0x9a4750){var _0x180905=this;return function(_0x45767c){if(_[_0x41eb('0x49')](_0x45767c)){if(_[_0x41eb('0xb7')](_0x9a4750[_0x41eb('0xdc')])||!_0x9a4750[_0x41eb('0x1f8')]){if(_0x4bb85b[_0x41eb('0x5a')]==='booked'){_0x4bb85b[_0x41eb('0x136')]=_['isUndefined'](_0x4bb85b[_0x41eb('0x136')])?!![]:_0x4bb85b[_0x41eb('0x136')];var _0x3247b3=uuid['v4']();_0x180905[_0x41eb('0xb5')][_0x3247b3]=new Action(_0x4bb85b,_0x9a4750,_0x3247b3);loggerBooked['info'](_0x41eb('0x1f9'),_0x3247b3,'queueStatusComplete:\x20',JSON[_0x41eb('0x4a')](_0x4bb85b[_0x41eb('0x136')]),'Queue:\x20',_0x4bb85b[_0x41eb('0x42')]);if(_0x4bb85b['queueStatusComplete']){_0x4bb85b['queueStatusComplete']=![];_0x180905['queueBooked'][_0x180905[_0x41eb('0xb5')][_0x3247b3][_0x41eb('0xbc')]]=[];ami[_0x41eb('0xb8')]({'actionid':_0x3247b3,'action':'queuestatus','queue':_0x4bb85b[_0x41eb('0x42')]})[_0x41eb('0xba')](function(){_0x180905[_0x41eb('0xbb')](_0x4bb85b);_0x180905['rescheduleContact']({'active':![],'ContactId':_0x180905['actions'][_0x3247b3][_0x41eb('0x100')],'ListId':_0x180905[_0x41eb('0xb5')][_0x3247b3][_0x41eb('0x101')],'VoiceQueueId':_0x180905[_0x41eb('0xb5')][_0x3247b3][_0x41eb('0xdd')]||undefined,'CampaignId':_0x180905[_0x41eb('0xb5')][_0x3247b3][_0x41eb('0xde')]||undefined})[_0x41eb('0xba')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x180905['actions'][_0x3247b3];});}else{loggerBooked[_0x41eb('0x82')](_0x41eb('0x1fa'),JSON[_0x41eb('0x4a')](_0x4bb85b[_0x41eb('0x136')]),_0x41eb('0x1fb'),_0x4bb85b[_0x41eb('0x42')]);_0x180905[_0x41eb('0xbb')](_0x4bb85b);_0x180905[_0x41eb('0xcb')]({'active':![],'ContactId':_0x180905[_0x41eb('0xb5')][_0x3247b3][_0x41eb('0x100')],'ListId':_0x180905[_0x41eb('0xb5')][_0x3247b3][_0x41eb('0x101')],'VoiceQueueId':_0x180905['actions'][_0x3247b3][_0x41eb('0xdd')]||undefined,'CampaignId':_0x180905[_0x41eb('0xb5')][_0x3247b3][_0x41eb('0xde')]||undefined})[_0x41eb('0xba')](loggerCatch(_0x41eb('0x1fc')));delete _0x180905[_0x41eb('0xb5')][_0x3247b3];}}else{return _0x180905[_0x41eb('0x1fd')](_0x4bb85b,_0x9a4750);}}else{if(getDiff(_0x9a4750[_0x41eb('0x1fe')])<_0x4bb85b['dialRecallMeTimeout']*0x3c){if(_0x9a4750[_0x41eb('0x16a')]&&!_0x9a4750[_0x41eb('0x16a')][_0x41eb('0x1ff')]){_0x180905[_0x41eb('0x99')][_0x41eb('0x139')](_0x9a4750['id'])['finally'](function(){_0x180905[_0x41eb('0xbb')](_0x4bb85b);});}else{_0x180905[_0x41eb('0xcd')]({'active':![]},_0x9a4750['id'],0x1)[_0x41eb('0x1f')](function(){_0x180905[_0x41eb('0xbb')](_0x4bb85b);});}}else{_0x4bb85b[_0x41eb('0x68')]+=0x1;_0x180905[_0x41eb('0xbb')](_0x4bb85b);if(_0x4bb85b[_0x41eb('0x200')]){_0x180905[_0x41eb('0xcb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x9a4750['ContactId'],'ListId':_0x9a4750['ListId'],'VoiceQueueId':_0x9a4750['VoiceQueueId']||undefined,'CampaignId':_0x9a4750['CampaignId']||undefined})[_0x41eb('0xba')](loggerCatch(_0x41eb('0x201')));_0x180905[_0x41eb('0xd6')](createObjHistory(_0x4bb85b,_0x9a4750,_0x41eb('0x202'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0x41eb('0x203')));}else{_0x180905[_0x41eb('0xda')](createObjHistory(_0x4bb85b,_0x9a4750,'RECALLFAILEDTIMEOUT',0x16,_0x41eb('0x204')),_0x41eb('0x205'),_0x41eb('0x206'));}}}}else{_0x4bb85b[_0x41eb('0x61')]+=0x1;_0x180905[_0x41eb('0xda')](createObjHistory(_0x4bb85b,_0x9a4750,_0x41eb('0x207'),0xd,_0x41eb('0x208')),_0x41eb('0x209'),_0x41eb('0x20a'));throw _0x41eb('0x20b');}};};Dialer[_0x41eb('0x1c')][_0x41eb('0x20c')]=function(_0x522bc5){var _0x575f73=this;var _0xfb0136=_0x522bc5[_0x41eb('0x20d')]-_0x522bc5[_0x41eb('0xa2')]-_0x522bc5[_0x41eb('0xcf')];emitCampaignSummary(_0x522bc5);if(_0xfb0136>0x0){if(_0xfb0136>this['maxNumberOriginate']){_0xfb0136=this[_0x41eb('0x25')];}_0x522bc5[_0x41eb('0xcf')]+=_0xfb0136;this[_0x41eb('0xd1')](_0x522bc5['id'],_0xfb0136,_0x522bc5['dialOrderByScheduledAt'],_0x522bc5)[_0x41eb('0x3e')](function(_0x5f2103){_0x522bc5[_0x41eb('0xcf')]-=_0xfb0136;_0x522bc5[_0x41eb('0xcf')]=_0x522bc5[_0x41eb('0xcf')]>0x0?_0x522bc5[_0x41eb('0xcf')]:0x0;if(!checkContactEmpty(_0x5f2103)){_0x522bc5[_0x41eb('0x44')]=_0x41eb('0x20e');logger[_0x41eb('0x82')]('[getContactCampaign2][Empty]'+_0x522bc5[_0x41eb('0x42')]);}else{_0x522bc5[_0x41eb('0xa2')]+=_0x5f2103[_0x41eb('0xa1')];_0x522bc5[_0x41eb('0x44')]=_0x41eb('0x20f');for(var _0x4ea10d=0x0;_0x4ea10d<_0x5f2103[_0x41eb('0xa1')];_0x4ea10d+=0x1){_0x522bc5[_0x41eb('0x210')]+=0x1;if(_['isNil'](_0x5f2103[_0x4ea10d])||_['isNil'](_0x5f2103[_0x4ea10d][_0x41eb('0x192')])||_[_0x41eb('0xb7')](_0x5f2103[_0x4ea10d][_0x41eb('0x17d')])){_0x575f73[_0x41eb('0xd9')]('[actionOriginate]\x20',_0x522bc5,_0x5f2103[_0x4ea10d]);}else{_0x575f73[_0x41eb('0xc6')](_[_0x41eb('0xdb')](_0x5f2103[_0x4ea10d],[_0x41eb('0xde'),_0x41eb('0x17d')]))[_0x41eb('0x3e')](_0x575f73[_0x41eb('0x211')](_0x522bc5,_0x5f2103[_0x4ea10d]))[_0x41eb('0xba')](_0x575f73['loggerHandler'](_0x41eb('0x212'),_0x522bc5));}}}})[_0x41eb('0xba')](loggerGetContactDialer(_0x41eb('0x213'),_0x522bc5,_0xfb0136));}};Dialer[_0x41eb('0x1c')][_0x41eb('0x163')]=function(_0x1a0c58,_0x15c918){var _0x229547=this;var _0x44b846=[];var _0x3d2ac2=_0x15c918>=0x1?_0x15c918:0x1;if(_0x1a0c58[_0x41eb('0x5a')]===_0x41eb('0x9')){_0x3d2ac2=0x1;}var _0x20c705=Math[_0x41eb('0x1db')](_0x1a0c58[_0x41eb('0x50')]*_0x3d2ac2)-_0x1a0c58[_0x41eb('0xa2')]-_0x1a0c58[_0x41eb('0xcf')];emitVoiceQueueSummary(_0x1a0c58);if(_0x1a0c58[_0x41eb('0x214')]>0x0){var _0x248ba3=_0x1a0c58[_0x41eb('0x214')]-_0x1a0c58[_0x41eb('0xa2')]-_0x1a0c58['talking']-_0x1a0c58[_0x41eb('0xcf')]-_0x1a0c58['pTalking'];if(_0x20c705>_0x248ba3){_0x20c705=_0x248ba3;}}if(_0x20c705>0x0){if(_0x1a0c58[_0x41eb('0x5a')]===_0x41eb('0x9')){_0x20c705=0x1;}if(_0x20c705>this[_0x41eb('0x25')]){_0x20c705=this['maxNumberOriginate'];}_0x1a0c58[_0x41eb('0xcf')]+=_0x20c705;for(var _0x577c95 in this[_0x41eb('0x23')]){if(typeof this[_0x41eb('0x23')][_0x577c95]!=='undefined'){if(this[_0x41eb('0x23')][_0x577c95]['state']===_0x41eb('0x215')&&this[_0x41eb('0x23')][_0x577c95]['status']===_0x41eb('0xe3')){_0x44b846[_0x41eb('0x135')](this[_0x41eb('0x23')][_0x577c95]['id']);}}}this['getContactDialer'](_0x1a0c58['id'],_0x44b846,_0x20c705,_0x1a0c58[_0x41eb('0x216')],_0x1a0c58)[_0x41eb('0x3e')](function(_0x1c852a){_0x1a0c58[_0x41eb('0xcf')]-=_0x20c705;_0x1a0c58[_0x41eb('0xcf')]=_0x1a0c58[_0x41eb('0xcf')]>0x0?_0x1a0c58[_0x41eb('0xcf')]:0x0;if(!checkContactEmpty(_0x1c852a)){_0x229547[_0x41eb('0x217')](_0x1a0c58)['then'](sendMessageReschedule(_0x1a0c58))[_0x41eb('0xba')](loggerCatch(_0x41eb('0xbf')));}else{_0x1a0c58[_0x41eb('0xa2')]+=_0x1c852a[_0x41eb('0xa1')];_0x1a0c58['message']=_0x1a0c58[_0x41eb('0x5a')]===_0x41eb('0x9')?_0x41eb('0x183'):'RUNNING';for(var _0x380fe0=0x0;_0x380fe0<_0x1c852a[_0x41eb('0xa1')];_0x380fe0+=0x1){if(_[_0x41eb('0xb7')](_0x1c852a[_0x380fe0])||_['isNil'](_0x1c852a[_0x380fe0][_0x41eb('0x192')])||_['isNil'](_0x1c852a[_0x380fe0][_0x41eb('0x17d')])){_0x229547[_0x41eb('0xd9')](_0x41eb('0x218'),_0x1a0c58,_0x1c852a[_0x380fe0]);}else{_0x229547['checkIsBlackList'](_[_0x41eb('0xdb')](_0x1c852a[_0x380fe0],['VoiceQueueId',_0x41eb('0x17d')]))['then'](_0x229547[_0x41eb('0x211')](_0x1a0c58,_0x1c852a[_0x380fe0]))['catch'](_0x229547[_0x41eb('0xd8')](_0x41eb('0x218'),_0x1a0c58));}}}})[_0x41eb('0xba')](loggerGetContactDialer(_0x41eb('0x219'),_0x1a0c58,_0x20c705));}};Dialer['prototype'][_0x41eb('0x96')]=function(_0x557cb4){if(_0x557cb4['dialLimitQueue']>0x0){var _0x351209=_0x557cb4['dialLimitQueue']-_0x557cb4['originated']-_0x557cb4['talking'];if(_0x351209>0x0){this[_0x41eb('0x21a')](_0x557cb4);}else{loggerPredictiveCalls[_0x41eb('0x82')](_0x41eb('0x21b'));}}else{this[_0x41eb('0x21a')](_0x557cb4);}};Dialer['prototype'][_0x41eb('0x21a')]=function(_0x2e35d1){var _0x522ef1=this;var _0x2c51c8=[];_0x2e35d1[_0x41eb('0xa2')]+=0x1;for(var _0x1c6494 in this[_0x41eb('0x23')]){if(typeof this[_0x41eb('0x23')][_0x1c6494]!=='undefined'){if(this['agents'][_0x1c6494][_0x41eb('0xe9')]==='not_inuse'&&this[_0x41eb('0x23')][_0x1c6494][_0x41eb('0xe2')]==='reachable'){_0x2c51c8[_0x41eb('0x135')](this[_0x41eb('0x23')][_0x1c6494]['id']);}}}this[_0x41eb('0xce')](_0x2e35d1['id'],_0x2c51c8,0x1,_0x2e35d1[_0x41eb('0x216')],_0x2e35d1)[_0x41eb('0x3e')](function(_0x3ed3a8){if(!checkContactEmpty(_0x3ed3a8)){checkContactLowerLimitOriginate(_0x2e35d1,0x1,0x0);_0x522ef1[_0x41eb('0x217')](_0x2e35d1)[_0x41eb('0x3e')](sendMessageReschedule(_0x2e35d1))[_0x41eb('0xba')](loggerCatch(_0x41eb('0xbf')));}else{_0x2e35d1['message']=_0x41eb('0x20f');if(_['isNil'](_0x3ed3a8[0x0])||_[_0x41eb('0xb7')](_0x3ed3a8[0x0]['Contact'])||_[_0x41eb('0xb7')](_0x3ed3a8[0x0]['phone'])){_0x522ef1[_0x41eb('0xd9')](_0x41eb('0x218'),_0x2e35d1,_0x3ed3a8[0x0]);}else{_0x522ef1[_0x41eb('0xc0')](_[_0x41eb('0xdb')](_0x3ed3a8[0x0],[_0x41eb('0xdd'),'phone']))['then'](_0x522ef1[_0x41eb('0x211')](_0x2e35d1,_0x3ed3a8[0x0]))['catch'](_0x522ef1[_0x41eb('0xd8')]('[actionOriginatePredictive]\x20',_0x2e35d1));}}})[_0x41eb('0xba')](loggerGetContactDialer(_0x41eb('0x21c'),_0x2e35d1,0x1));emitVoiceQueueSummary(_0x2e35d1);};Dialer[_0x41eb('0x1c')][_0x41eb('0x1f0')]=function(_0xe547a5,_0x17462f,_0x232bc3,_0x501d44,_0x41f38a,_0x322408){loggerPredictive[_0x41eb('0x82')](_0x41eb('0x21d'));loggerPredictive[_0x41eb('0x82')]('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',_0xe547a5);loggerPredictive['info'](_0x41eb('0x21e'),_0x17462f);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x21f'),_0x232bc3);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x220'),_0x501d44);loggerPredictive[_0x41eb('0x82')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x41f38a);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x91'));return new Promise(function(_0xd31e14,_0x4ea8fe){if(_0xe547a5<=0x0||isNaN(_0xe547a5)){return _0x4ea8fe(msgResponse('[abandonmentRate]',_0x41eb('0x221'),_0x41eb('0x222')+_0xe547a5));}if(_0x232bc3<=0x0||isNaN(_0x232bc3)){return _0x4ea8fe(msgResponse(_0x41eb('0x223'),'Error','Ts\x20=\x20'+_0x232bc3));}if(_0x501d44<=0x0||isNaN(_0x501d44)){return _0x4ea8fe(msgResponse(_0x41eb('0x223'),_0x41eb('0x221'),'p\x20=\x20'+_0x501d44));}if(_0x17462f<=0x0||isNaN(_0x17462f)){return _0x4ea8fe(msgResponse(_0x41eb('0x223'),_0x41eb('0x221'),_0x41eb('0x224')+_0x17462f));}if(_0x41f38a<=0x0||isNaN(_0x41f38a)){return _0x4ea8fe(msgResponse(_0x41eb('0x223'),_0x41eb('0x221'),'Amax\x20=\x20'+_0x41f38a));}_0x322408=_0x322408||0x0;var _0xa15739=0x1/_0x232bc3;var _0x31f932=0x0;var _0x389923=0x0;var _0x383e2b=0x0;var _0x35974e=0x0;for(var _0x359388=0x0;_0x383e2b<_0x41f38a;_0x359388+=0x1){_0x389923=_0x359388/_0x17462f;_0x31f932=(_0x501d44*_0x389923+_0x322408)/_0xa15739;_0x383e2b=erlangb(_0x31f932,_0xe547a5);_0x35974e=_0x31f932/_0xe547a5*(0x1-erlangb(_0x31f932,_0xe547a5));}return _0xd31e14({'erlangCalls':_0x359388,'erlangCallToSecond':_0x17462f/_0x359388,'erlangAbandonmentRate':_0x383e2b,'erlangBusyFactor':_0x35974e});});};Dialer[_0x41eb('0x1c')]['busyFactor']=function(_0x41dbe7,_0x1b732f,_0x2e0b58,_0x3f7a7c,_0x3e619a,_0x2528c6){loggerPredictive['info'](_0x41eb('0x225'));loggerPredictive[_0x41eb('0x82')]('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',_0x41dbe7);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x21e'),_0x1b732f);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x21f'),_0x2e0b58);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x220'),_0x3f7a7c);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x226'),_0x3e619a);loggerPredictive[_0x41eb('0x82')](_0x41eb('0x91'));return new Promise(function(_0x581023,_0x334b60){if(_0x41dbe7<=0x0||isNaN(_0x41dbe7)){return _0x334b60(msgResponse(_0x41eb('0x227'),'Error',_0x41eb('0x222')+_0x41dbe7));}if(_0x2e0b58<=0x0||isNaN(_0x2e0b58)){return _0x334b60(msgResponse('[busyFactor]',_0x41eb('0x221'),_0x41eb('0x228')+_0x2e0b58));}if(_0x3f7a7c<=0x0||isNaN(_0x3f7a7c)){return _0x334b60(msgResponse(_0x41eb('0x227'),_0x41eb('0x221'),_0x41eb('0x229')+_0x3f7a7c));}if(_0x1b732f<=0x0||isNaN(_0x1b732f)){return _0x334b60(msgResponse('[busyFactor]',_0x41eb('0x221'),_0x41eb('0x224')+_0x1b732f));}if(_0x3e619a<=0x0||isNaN(_0x3e619a)){return _0x334b60(msgResponse('[busyFactor]',_0x41eb('0x221'),_0x41eb('0x22a')+_0x3e619a));}_0x2528c6=_0x2528c6||0x0;var _0x9161f0=0x1/_0x2e0b58;var _0x10159b=0x0;var _0x313c8b=0x0;var _0x12af40=0x0;var _0x58eba5=0x0;for(var _0x550197=0x0;_0x58eba5<_0x3e619a;_0x550197+=0x1){_0x313c8b=_0x550197/_0x1b732f;_0x10159b=(_0x3f7a7c*_0x313c8b+_0x2528c6)/_0x9161f0;_0x12af40=erlangb(_0x10159b,_0x41dbe7);_0x58eba5=_0x10159b/_0x41dbe7*(0x1-erlangb(_0x10159b,_0x41dbe7));}return _0x581023({'erlangCalls':_0x550197,'erlangCallToSecond':_0x1b732f/_0x550197,'erlangAbandonmentRate':_0x12af40,'erlangBusyFactor':_0x58eba5});});};module[_0x41eb('0x22b')]=Dialer; \ No newline at end of file +var _0x49ea=['CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','saveInDb','uniqueid','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','amd','custom:amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','stateGlobal','reason19\x20machine....','createStateFinal','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','countbusyretry','countnoanswerretry','dialGlobalMaxRetry','dialMachineMaxRetry','reason\x2019\x20machine....','VoiceQueueId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','syncAgentConnect','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','additional','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','Abandoned','dialAbandonedRetryFrequency','add','[rescheduleContact][Abandoned]','actionid','locked','paused','stateinterface','queueBooked','push','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','interval','timezones','content','true','iftime\x20%s,%s','indexOf','all','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','filter','online','map','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','dialer','getCaller','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','[CatchErlangB]','outboundQueuePauses','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','[rescheduleContact][dialRecallInQueue]','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','ivrOriginated','queueBookedRR','agentconnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','sumDuration','talking','total','unmanaged','waiting','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','callerid','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\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','---------------------------','seconds','startProgressive','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','clearZombieChannels','[uniqueid]','[actions]','prototype','isNil','Action','status','channel','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','updateOriginated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','merge','pick','ContactId','UserId'];(function(_0x1a1ec7,_0x2c9cc1){var _0x55650a=function(_0x469410){while(--_0x469410){_0x1a1ec7['push'](_0x1a1ec7['shift']());}};_0x55650a(++_0x2c9cc1);}(_0x49ea,0x14b));var _0xa49e=function(_0x3b569a,_0xea9c46){_0x3b569a=_0x3b569a-0x0;var _0x17338d=_0x49ea[_0x3b569a];return _0x17338d;};'use strict';var util=require(_0xa49e('0x0'));var _=require(_0xa49e('0x1'));var uuid=require(_0xa49e('0x2'));var moment=require(_0xa49e('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xa49e('0x4'));var ut=require(_0xa49e('0x5'));var config=require(_0xa49e('0x6'));var logger=require(_0xa49e('0x7'))('dialer');var loggerBooked=require(_0xa49e('0x7'))(_0xa49e('0x8'));var loggerPredictive=require('../../../config/logger')(_0xa49e('0x9'));var loggerPredictiveCalls=require(_0xa49e('0x7'))(_0xa49e('0xa'));var loggerSyncQueueSummary=require(_0xa49e('0x7'))('syncQueueSummary');var ami=require(_0xa49e('0xb'));config[_0xa49e('0xc')]=_[_0xa49e('0xd')](config[_0xa49e('0xc')],{'host':_0xa49e('0xe'),'port':0x18eb});var io=require(_0xa49e('0xf'))(new Redis(config[_0xa49e('0xc')]));var cmHopper=require(_0xa49e('0x10'));var cmHopperHistory=require(_0xa49e('0x11'));var cmHopperAdditionalPhone=require(_0xa49e('0x12'));var cmHopperBlack=require(_0xa49e('0x13'));var voiceQueueRt=require(_0xa49e('0x14'));var RpcSetting=require('../rpc/setting');var Action=require(_0xa49e('0x15'));var History=require('./history');var Final=require(_0xa49e('0x16'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0xa49e('0x17')][_0xa49e('0x18')]||_0xa49e('0x19');var strategy={'rrmemory':_0xa49e('0x1a'),'roundrobin':_0xa49e('0x1b')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xa49e('0x1c')]=function(_0x5a3f75){this[_0xa49e('0x1d')]=this[_0xa49e('0x1d')]?this[_0xa49e('0x1d')]['finally'](_0x5a3f75):_0x5a3f75();};function Dialer(_0x31ca8f,_0x23c59d){this[_0xa49e('0x1e')]=new Sequence();this['preview']=_0x23c59d;this[_0xa49e('0x1f')]=_0x31ca8f[_0xa49e('0x1f')];this[_0xa49e('0x20')]=_0x31ca8f[_0xa49e('0x20')];this[_0xa49e('0x21')]=_0x31ca8f[_0xa49e('0x21')];this[_0xa49e('0x22')]=_0x31ca8f[_0xa49e('0x22')];this[_0xa49e('0x23')]=config[_0xa49e('0x23')]||0x2;this[_0xa49e('0x24')]={};this[_0xa49e('0x25')]={};this['contactsId']={};this[_0xa49e('0x26')]={};this[_0xa49e('0x27')]={};this['startPredictive']={};this['startProgressive']={};this[_0xa49e('0x28')]={};this['queueBooked']={};this[_0xa49e('0x29')]={};ami['on'](_0xa49e('0x2a'),this['syncAgentConnect'][_0xa49e('0x2b')](this));ami['on'](_0xa49e('0x2c'),this['syncQueueCallerAbandon'][_0xa49e('0x2b')](this));ami['on'](_0xa49e('0x2d'),this[_0xa49e('0x2e')][_0xa49e('0x2b')](this));ami['on'](_0xa49e('0x2f'),this[_0xa49e('0x30')][_0xa49e('0x2b')](this));ami['on'](_0xa49e('0x31'),this['syncQueueSummary'][_0xa49e('0x2b')](this));ami['on'](_0xa49e('0x32'),this[_0xa49e('0x33')][_0xa49e('0x2b')](this));ami['on'](_0xa49e('0x34'),this[_0xa49e('0x35')]['bind'](this));ami['on'](_0xa49e('0x36'),this[_0xa49e('0x37')][_0xa49e('0x2b')](this));ami['on'](_0xa49e('0x38'),this[_0xa49e('0x39')][_0xa49e('0x2b')](this));ami['on'](_0xa49e('0x3a'),this[_0xa49e('0x3b')]['bind'](this));ami['on'](_0xa49e('0x3c'),this['syncQueueStatusComplete'][_0xa49e('0x2b')](this));this[_0xa49e('0x3d')]();this[_0xa49e('0x3e')]();RpcSetting['getSettings']()[_0xa49e('0x3f')](function(_0x440ac8){previewRecallmeReminderInterval=_0x440ac8[_0xa49e('0x40')];});}function isNotNull(_0x5f0570){return _0x5f0570!==null&&!_[_0xa49e('0x41')](_0x5f0570);}function checkIsLoggedIn(_0x5153c9,_0xbc7455){return function(){if(_0xbc7455<=0x0){_0x5153c9['message']='AGENTS_NOT_LOGGED';throw _0x5153c9[_0xa49e('0x42')]+_0xa49e('0x43');}};}function isActive(_0x57ebff){return _0x57ebff;}function checkIsActive(_0x2a64f0,_0x528f45){return function(){if(!isActive(_0x528f45)){_0x2a64f0[_0xa49e('0x44')]=_0xa49e('0x45');throw _0x2a64f0[_0xa49e('0x42')]+_0xa49e('0x46');}};}function checkInterval(_0x67abe0){return function(){if(!isNotNull(_0x67abe0[_0xa49e('0x47')])){_0x67abe0[_0xa49e('0x44')]=_0xa49e('0x48');throw _0x67abe0[_0xa49e('0x42')]+_0xa49e('0x49');}if(!isNotNull(_0x67abe0[_0xa49e('0x47')]['Intervals'])){_0x67abe0[_0xa49e('0x44')]='INTERVAL_IS_NULL';throw _0x67abe0[_0xa49e('0x42')]+_0xa49e('0x49');}if(!isNotNull(_['isEmpty'](_0x67abe0[_0xa49e('0x47')][_0xa49e('0x4a')]))){_0x67abe0[_0xa49e('0x44')]=_0xa49e('0x48');throw _0x67abe0['name']+_0xa49e('0x49');}};}function msgResponse(_0x5ced8e,_0x299c22,_0x1b17c7){return{'action':_0x5ced8e,'response':_0x299c22,'message':_0x1b17c7,'stack':_0x1b17c7};}function myreject(_0x2c128e){return function(_0x433493){return _0x2c128e(msgResponse(_0xa49e('0x4b'),_0xa49e('0x4c'),JSON[_0xa49e('0x4d')](_0x433493)));};}function getSeconds(_0x2ff25a,_0x390349){var _0x53336d=moment(_0x2ff25a)[_0xa49e('0x4e')](0x0);var _0x51c529=moment(_0x390349)['milliseconds'](0x0);return _0x53336d[_0xa49e('0x4f')](_0x51c529,'seconds');}function emit(_0xc907fc,_0x4ff078,_0x426956){io['to'](_0xc907fc)[_0xa49e('0x50')](_0x4ff078,_0x426956);}function emitVoiceQueueSummary(_0x27b513){if(_0x27b513[_0xa49e('0x51')]===_0xa49e('0x52')){var _0x2090f2={'id':_0x27b513['id'],'name':_0x27b513[_0xa49e('0x42')],'strategy':_0x27b513[_0xa49e('0x53')],'answered':_0x27b513[_0xa49e('0x54')],'available':_0x27b513[_0xa49e('0x55')],'loggedIn':_0x27b513[_0xa49e('0x56')],'pTalking':_0x27b513['pTalking'],'sumBillable':_0x27b513['sumBillable'],'sumDuration':_0x27b513[_0xa49e('0x57')],'sumHoldTime':_0x27b513['sumHoldTime']||0x0,'talking':_0x27b513[_0xa49e('0x58')],'total':_0x27b513[_0xa49e('0x59')],'type':_0x27b513[_0xa49e('0x51')],'unmanaged':_0x27b513[_0xa49e('0x5a')],'abandoned':_0x27b513['abandoned'],'waiting':_0x27b513[_0xa49e('0x5b')],'loggedInDb':_0x27b513['loggedInDb'],'dialActive':_0x27b513['dialActive'],'dialMethod':_0x27b513['dialMethod'],'dialOriginateCallerIdName':_0x27b513[_0xa49e('0x5c')],'dialOriginateCallerIdNumber':_0x27b513[_0xa49e('0x5d')],'dialOriginateTimeout':_0x27b513[_0xa49e('0x5e')],'dialPrefix':_0x27b513[_0xa49e('0x5f')],'outboundAnswerAgiCallsDay':_0x27b513['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x27b513[_0xa49e('0x60')],'outboundBlacklistCallsDay':_0x27b513[_0xa49e('0x61')],'outboundBusyCallsDay':_0x27b513[_0xa49e('0x62')],'outboundCongestionCallsDay':_0x27b513[_0xa49e('0x63')],'outboundDropCallsDayACS':_0x27b513[_0xa49e('0x64')],'outboundDropCallsDayCallersExit':_0x27b513[_0xa49e('0x65')],'outboundDropCallsDayTimeout':_0x27b513[_0xa49e('0x66')],'outboundNoAnswerCallsDay':_0x27b513[_0xa49e('0x67')],'outboundNoSuchCallsDay':_0x27b513[_0xa49e('0x68')],'outboundOriginateFailureCallsDay':_0x27b513[_0xa49e('0x69')],'outboundReCallsDay':_0x27b513[_0xa49e('0x6a')],'outboundRejectCallsDay':_0x27b513['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x27b513[_0xa49e('0x6b')],'predictiveIntervalAnsweredCalls':_0x27b513[_0xa49e('0x6c')],'predictiveIntervalAvgHoldtime':_0x27b513['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x27b513[_0xa49e('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x27b513[_0xa49e('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x27b513[_0xa49e('0x6f')],'predictiveIntervalErlangCalls':_0x27b513[_0xa49e('0x70')],'predictiveIntervalErlangCallsDroppedCalls':_0x27b513[_0xa49e('0x71')],'predictiveIntervalHitRate':_0x27b513['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x27b513['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x27b513[_0xa49e('0x72')],'predictiveIntervalAvailable':_0x27b513[_0xa49e('0x73')],'predictiveIntervalTotalCalls':_0x27b513[_0xa49e('0x74')],'message':_0x27b513['message'],'originated':_0x27b513[_0xa49e('0x75')],'erlangCalls':_0x27b513[_0xa49e('0x76')],'erlangCallToSecond':_0x27b513[_0xa49e('0x77')],'erlangAbandonmentRate':_0x27b513['erlangAbandonmentRate'],'erlangBusyFactor':_0x27b513[_0xa49e('0x78')],'startPredictive':_0x27b513[_0xa49e('0x79')],'startProgressive':_0x27b513['startProgressive']};if(_0x27b513['Trunk']){_0x2090f2[_0xa49e('0x7a')]={'id':_0x27b513[_0xa49e('0x7a')]['id'],'name':_0x27b513[_0xa49e('0x7a')][_0xa49e('0x42')],'active':_0x27b513[_0xa49e('0x7a')]['active'],'callerid':_0x27b513[_0xa49e('0x7a')][_0xa49e('0x7b')]};}if(_0x27b513[_0xa49e('0x47')]){_0x2090f2['Interval']={'id':_0x27b513[_0xa49e('0x47')]['id'],'name':_0x27b513[_0xa49e('0x47')][_0xa49e('0x42')]};}var _0x32734d=md5(JSON[_0xa49e('0x4d')](_0x2090f2));if(_0x27b513['md5']!==_0x32734d){_0x27b513[_0xa49e('0x7c')]=_0x32734d;emit(util[_0xa49e('0x7d')](_0xa49e('0x7e'),_0x2090f2['name']),_0xa49e('0x7f'),_0x2090f2);}}}function emitCampaignSummary(_0x3e68f3){if(_0x3e68f3['type']===_0xa49e('0x80')){emit(util[_0xa49e('0x7d')]('campaign:ivr:%s',_0x3e68f3[_0xa49e('0x42')]),_0xa49e('0x81'),_0x3e68f3);}}function checkGetDataPredictive(_0x1bd052){if(isNotNull(_0x1bd052)&&!_[_0xa49e('0x82')](_0x1bd052)){loggerPredictive[_0xa49e('0x83')](_0xa49e('0x84'));loggerPredictive['info'](_0xa49e('0x85'),_0x1bd052[_0xa49e('0x74')]);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x86'),_0x1bd052[_0xa49e('0x6c')]);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x87'),_0x1bd052[_0xa49e('0x6f')]);loggerPredictive[_0xa49e('0x83')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1bd052['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x88'),_0x1bd052['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x89'),_0x1bd052['predictiveIntervalAvgTalktime']);loggerPredictive[_0xa49e('0x83')]('---------------------------');if(_0x1bd052['predictiveIntervalTotalCalls']>0x0){if(!_[_0xa49e('0x41')](_0x1bd052[_0xa49e('0x6d')])&&_0x1bd052['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xa49e('0x83')](_0xa49e('0x8a'));if(!_[_0xa49e('0x41')](_0x1bd052[_0xa49e('0x8b')])&&_0x1bd052[_0xa49e('0x8b')]>0x0){return!![];}loggerPredictive[_0xa49e('0x83')](_0xa49e('0x8c'));}else{loggerPredictive['info'](_0xa49e('0x8d'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x4dc9ab){return function(_0x5c3ab5){loggerPredictive[_0xa49e('0x83')](_0xa49e('0x8e'));loggerPredictive[_0xa49e('0x83')](_0xa49e('0x8f'),_0x5c3ab5[_0xa49e('0x76')]);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x90'),_0x5c3ab5['erlangCallToSecond']);loggerPredictive['info'](_0xa49e('0x91'),_0x5c3ab5[_0xa49e('0x92')]);loggerPredictive[_0xa49e('0x83')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c3ab5[_0xa49e('0x78')]);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x91'),_0x5c3ab5[_0xa49e('0x92')]);loggerPredictive['info'](_0xa49e('0x93'));_['merge'](_0x4dc9ab,_0x5c3ab5);};}function getDiff(_0x503e41){var _0x5803cf=moment()['milliseconds'](0x0);var _0x32c95b=moment(_0x503e41)[_0xa49e('0x4e')](0x0);return _0x5803cf[_0xa49e('0x4f')](_0x32c95b,_0xa49e('0x94'));}function ifInterval(_0x1cff17,_0x22e4b7){if(_[_0xa49e('0x41')](_0x22e4b7)){return![];}return getDiff(_0x22e4b7)<_0x1cff17*0x3c;}function freeVariablesPredictive(_0x33d24e){if(isNotNull(_0x33d24e)){if(!_[_0xa49e('0x41')](_0x33d24e['startProgressive'])){_0x33d24e[_0xa49e('0x95')]=undefined;loggerPredictive[_0xa49e('0x83')](_0x33d24e[_0xa49e('0x42')],_0xa49e('0x96'));}if(!_[_0xa49e('0x41')](_0x33d24e['startPredictive'])){_0x33d24e['startPredictive']=undefined;loggerPredictive[_0xa49e('0x83')](_0x33d24e[_0xa49e('0x42')],_0xa49e('0x97'));}if(!_[_0xa49e('0x41')](_0x33d24e['handlePredictive'])){clearInterval(_0x33d24e[_0xa49e('0x98')]);_0x33d24e[_0xa49e('0x98')]=undefined;loggerPredictive[_0xa49e('0x83')](_0x33d24e[_0xa49e('0x42')],_0xa49e('0x99'));}}}function erlangb(_0x415387,_0x1e66e5){if(_0x1e66e5===0x0){return 0x0;}var _0x44d776=0x1;for(var _0x41d846=0x1;_0x41d846<=_0x1e66e5;_0x41d846+=0x1){_0x44d776=0x1+_0x44d776*_0x41d846/_0x415387;}return 0x1/_0x44d776;}function isVoiceQueueOutbound(_0x267d90){return _0x267d90==='outbound';}function isNotPreview(_0x17910a){return _0x17910a!==_0xa49e('0x9a');}function isCampaignIvr(_0x10a7c7){return _0x10a7c7===_0xa49e('0x80');}function getCallerId(_0x1d70b2,_0xdbdeec,_0x5a6f1a){if(!_[_0xa49e('0x41')](_0x5a6f1a)&&typeof _0x5a6f1a===_0xa49e('0x9b')&&!_[_0xa49e('0x82')](_0x5a6f1a)){if(!_[_0xa49e('0x41')](_0xdbdeec)&&typeof _0xdbdeec===_0xa49e('0x9b')&&!_[_0xa49e('0x82')](_0xdbdeec)){return util[_0xa49e('0x7d')]('\x22%s\x22\x20<%s>',_0xdbdeec,_0x5a6f1a);}return util[_0xa49e('0x7d')](_0xa49e('0x9c'),_0x5a6f1a,_0x5a6f1a);}if(!_[_0xa49e('0x41')](_0x1d70b2)&&typeof _0x1d70b2===_0xa49e('0x9b')&&!_[_0xa49e('0x82')](_0x1d70b2)){return _0x1d70b2;}return _0xa49e('0x9d');}function loggerCatchQueueSummary(_0x32f81b,_0x11a4b0){return function(_0x3fd2db){freeVariablesPredictive(_0x11a4b0);emitVoiceQueueSummary(_0x11a4b0);emitCampaignSummary(_0x11a4b0);loggerSyncQueueSummary[_0xa49e('0x9e')](_0x32f81b,util[_0xa49e('0x9f')](_0x3fd2db,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x534de3,_0x46d403){return function(_0x24baf5){loggerPredictive[_0xa49e('0xa0')](_0x46d403[_0xa49e('0x42')],_0x534de3);loggerPredictive[_0xa49e('0xa0')](_0x24baf5[_0xa49e('0xa1')]);freeVariablesPredictive(_0x46d403);};}function loggerCatch(_0x34ed42){return function(_0x5e3010){logger[_0xa49e('0xa0')](_0x34ed42,util['inspect'](_0x5e3010,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3d0332){return _0x3d0332&&!_['isUndefined'](_0x3d0332)&&_0x3d0332[_0xa49e('0xa2')]>0x0;}function decremetOriginate(_0x1b76aa){if(!_[_0xa49e('0x41')](_0x1b76aa)&&_0x1b76aa!==null){if(typeof _0x1b76aa['originated']!==_0xa49e('0xa3')){if(_0x1b76aa[_0xa49e('0x75')]>0x0){_0x1b76aa[_0xa49e('0x75')]-=0x1;}else{logger[_0xa49e('0xa0')](_0xa49e('0xa4'));}}}else{logger[_0xa49e('0xa0')](_0xa49e('0xa5'));}}function checkContactLowerLimitOriginate(_0xa7d311,_0x149c81,_0x5abdbb){if(_0x149c81>_0x5abdbb){for(var _0x12d1b6=0x0;_0x12d1b6<_0x149c81-_0x5abdbb;_0x12d1b6+=0x1){decremetOriginate(_0xa7d311);}}}function loggerGetContactDialer(_0x618d62,_0x18aa9c,_0x16797c){return function(_0x16f239){checkContactLowerLimitOriginate(_0x18aa9c,_0x16797c,0x0);logger[_0xa49e('0xa0')](_0x618d62,util[_0xa49e('0x9f')](_0x16f239,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x27f09f){return function(_0x1d8ce1){if(isNotNull(_0x1d8ce1)&&isNotNull(_0x1d8ce1[0x0])){if(_0x1d8ce1[0x0][_0xa49e('0xa6')]>0x0){_0x27f09f[_0xa49e('0x44')]=_0xa49e('0xa7');logger[_0xa49e('0x83')]('[getContactDialer2][ReScheduled]'+_0x27f09f[_0xa49e('0x42')],_0x1d8ce1[0x0][_0xa49e('0xa6')],_0xa49e('0xa8'));}else{_0x27f09f[_0xa49e('0x44')]=_0xa49e('0xa9');logger['info'](_0xa49e('0xaa')+_0x27f09f[_0xa49e('0x42')]);}}};}function notSendMessagesQueue(_0x3eb5aa){if(_0x3eb5aa[_0xa49e('0xab')]){freeVariablesPredictive(_0x3eb5aa);if(_0x3eb5aa[_0xa49e('0x75')]===0x0&&_0x3eb5aa['talking']===0x0&&_0x3eb5aa[_0xa49e('0x5b')]===0x0&&(_0x3eb5aa[_0xa49e('0xac')]||0x0)===0x0){_0x3eb5aa[_0xa49e('0xab')]=![];_0x3eb5aa[_0xa49e('0x55')]=0x0;_0x3eb5aa[_0xa49e('0x44')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xa49e('0x9e')](_0xa49e('0xad'),_0x3eb5aa[_0xa49e('0x42')],_0xa49e('0xae'));}else{_0x3eb5aa[_0xa49e('0x44')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xa49e('0x9e')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3eb5aa[_0xa49e('0x42')],_0xa49e('0xaf'));}emitVoiceQueueSummary(_0x3eb5aa);}}function notSendMessagesCampaign(_0x41c08c){if(_0x41c08c['sendMessageOneNotActive']){if(_0x41c08c[_0xa49e('0x75')]===0x0){_0x41c08c[_0xa49e('0xab')]=![];_0x41c08c[_0xa49e('0x44')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xa49e('0x9e')](_0xa49e('0xb0'),_0x41c08c[_0xa49e('0x42')],'is\x20not\x20active');}else{_0x41c08c[_0xa49e('0x44')]=_0xa49e('0xb1');loggerSyncQueueSummary[_0xa49e('0x9e')](_0xa49e('0xb0'),_0x41c08c['name'],_0xa49e('0xaf'));}emitCampaignSummary(_0x41c08c);}}function createObjHistory(_0x36c3de,_0x4bc9f8,_0x49cee3,_0x5a029e,_0x146cbb){_0x36c3de[_0xa49e('0x44')]=_0x49cee3;var _0x187161=new Action(_0x36c3de,_0x4bc9f8);var _0x39a38f=new History(_0x187161);_0x39a38f[_0xa49e('0xb2')]=_0x5a029e;_0x39a38f[_0xa49e('0xb3')]=_0x146cbb;_0x39a38f[_0xa49e('0xb4')]=_0x187161['starttime'];return _0x39a38f;}Dialer['prototype'][_0xa49e('0x3e')]=function(){var _0x405b6c=this;setInterval(function(){_0x405b6c[_0xa49e('0xb5')](_0x405b6c[_0xa49e('0x26')],_0xa49e('0xb6'));_0x405b6c[_0xa49e('0xb5')](_0x405b6c[_0xa49e('0x25')],_0xa49e('0xb7'));},0x32c8);};Dialer[_0xa49e('0xb8')][_0xa49e('0xb5')]=function(_0x2b7e80,_0x4f8157){var _0x4957e4=this;for(var _0x5bd63d in _0x2b7e80){if(typeof _0x2b7e80[_0x5bd63d]!==_0xa49e('0xa3')){this[_0xa49e('0x1e')][_0xa49e('0x1c')](function(){if(!_[_0xa49e('0xb9')](_0x2b7e80[_0x5bd63d])){return ami[_0xa49e('0xba')]({'action':_0xa49e('0xbb'),'channel':_0x2b7e80[_0x5bd63d][_0xa49e('0xbc')]})['catch'](function(_0x9339f7){if(_0x9339f7[_0xa49e('0x44')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x2b7e80[_0x5bd63d]&&_0x2b7e80[_0x5bd63d][_0xa49e('0x51')]!==_0xa49e('0x80')){_0x4957e4['updateOriginated'](_0x4957e4['voiceQueues'][_0x2b7e80[_0x5bd63d][_0xa49e('0xbd')]]);logger[_0xa49e('0xa0')](_0xa49e('0xbe'),_0x4f8157,_0x5bd63d,_0x2b7e80[_0x5bd63d][_0xa49e('0xbd')]);delete _0x2b7e80[_0x5bd63d];}if(_0x2b7e80[_0x5bd63d]&&_0x2b7e80[_0x5bd63d][_0xa49e('0x51')]===_0xa49e('0x80')){_0x4957e4['updateOriginated'](_0x4957e4[_0xa49e('0x20')][_0x2b7e80[_0x5bd63d][_0xa49e('0xbd')]]);logger[_0xa49e('0xa0')](_0xa49e('0xbf'),_0x4f8157,_0x5bd63d,_0x2b7e80[_0x5bd63d][_0xa49e('0xbd')]);delete _0x2b7e80[_0x5bd63d];}},0x2328);}});}});}}};Dialer[_0xa49e('0xb8')][_0xa49e('0xc0')]=function(_0x391767){return Promise[_0xa49e('0xc1')]()['then'](cmHopper[_0xa49e('0xc0')](_0x391767))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xc3')));};Dialer['prototype'][_0xa49e('0xc4')]=function(_0xb7f5fd){return Promise[_0xa49e('0xc1')]()[_0xa49e('0x3f')](cmHopperBlack[_0xa49e('0xc4')](_0xb7f5fd))['catch'](loggerCatch(_0xa49e('0xc5')));};Dialer[_0xa49e('0xb8')][_0xa49e('0xc6')]=function(_0x1d67ff,_0x4e1fe4,_0x2ac830){return Promise['resolve']()[_0xa49e('0x3f')](cmHopperAdditionalPhone[_0xa49e('0xc6')](_0x1d67ff,_0x4e1fe4,_0x2ac830))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xc7')));};Dialer['prototype']['swapAdditionalPhones']=function(_0x3828ab,_0x2344b8,_0x4054a3){return Promise['resolve']()[_0xa49e('0x3f')](cmHopperAdditionalPhone[_0xa49e('0xc8')](_0x3828ab,_0x2344b8,_0x4054a3))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xc9')));};Dialer[_0xa49e('0xb8')][_0xa49e('0xca')]=function(_0x583888){return Promise[_0xa49e('0xc1')]()['then'](cmHopperBlack[_0xa49e('0xca')](_0x583888))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xcb')));};Dialer[_0xa49e('0xb8')][_0xa49e('0xcc')]=function(_0x2cd2a3){return Promise['resolve']()[_0xa49e('0x3f')](cmHopperHistory['avgHandleTime'](_0x2cd2a3))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xcd')));};Dialer[_0xa49e('0xb8')][_0xa49e('0xce')]=function(_0x24dc6b){return Promise['resolve']()[_0xa49e('0x3f')](cmHopper['rescheduleContact'](_0x24dc6b))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xcf')));};Dialer[_0xa49e('0xb8')][_0xa49e('0xd0')]=function(_0x2307bf,_0x542c80,_0x508408){return Promise[_0xa49e('0xc1')]()[_0xa49e('0x3f')](cmHopper[_0xa49e('0xd0')](_0x2307bf,_0x542c80,_0x508408))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xd1')));};Dialer[_0xa49e('0xb8')]['getContactDialer']=function(_0x4ff253,_0x1c398f,_0x54eba5,_0x374ddb,_0xfcec3){return Promise[_0xa49e('0xc1')]()[_0xa49e('0x3f')](cmHopper[_0xa49e('0xd2')](_0x4ff253,_0x1c398f,_0x54eba5,_0x374ddb))[_0xa49e('0xc2')](function(_0x15b11e){_0xfcec3[_0xa49e('0xd3')]-=_0x54eba5;_0xfcec3[_0xa49e('0xd3')]=_0xfcec3[_0xa49e('0xd3')]>0x0?_0xfcec3[_0xa49e('0xd3')]:0x0;loggerCatch(_0xa49e('0xd4'))(_0x15b11e);});};Dialer[_0xa49e('0xb8')][_0xa49e('0xd5')]=function(_0x569dac,_0x100133,_0x23b41f,_0x431bf3){return Promise[_0xa49e('0xc1')]()[_0xa49e('0x3f')](cmHopper['getContactDialerIvr'](_0x569dac,_0x100133,_0x23b41f))[_0xa49e('0xc2')](function(_0x7896f9){_0x431bf3[_0xa49e('0xd3')]-=_0x100133;_0x431bf3['temp']=_0x431bf3[_0xa49e('0xd3')]>0x0?_0x431bf3[_0xa49e('0xd3')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x7896f9);});};Dialer[_0xa49e('0xb8')][_0xa49e('0xd6')]=function(_0x4466d4){return Promise[_0xa49e('0xc1')]()[_0xa49e('0x3f')](voiceQueueRt['getVoiceQueueRtPauses'](_0x4466d4))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xd7')));};Dialer[_0xa49e('0xb8')][_0xa49e('0xd8')]=function(_0xc16497){return Promise['resolve']()[_0xa49e('0x3f')](cmHopper['moveContactManagedDialer'](_0xc16497))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xd9')));};Dialer['prototype'][_0xa49e('0xda')]=function(_0x73b025){return Promise[_0xa49e('0xc1')]()[_0xa49e('0x3f')](cmHopperHistory[_0xa49e('0xda')](_0x73b025))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xdb')));};Dialer[_0xa49e('0xb8')][_0xa49e('0xdc')]=function(_0x13a7b5){if(!_['isUndefined'](_0x13a7b5)&&_0x13a7b5!==null){if(typeof _0x13a7b5[_0xa49e('0x75')]!==_0xa49e('0xa3')){if(_0x13a7b5[_0xa49e('0x75')]>0x0){_0x13a7b5[_0xa49e('0x75')]-=0x1;}else{logger[_0xa49e('0xa0')](_0xa49e('0xdd'));}}}else{logger[_0xa49e('0xa0')](_0xa49e('0xde'));}};Dialer['prototype'][_0xa49e('0xdf')]=function(_0x39ae96,_0x594384){var _0x3b9064=this;return function(_0x5742e7){_0x3b9064[_0xa49e('0xdc')](_0x594384);logger['error'](_0x39ae96,util[_0xa49e('0x9f')](_0x5742e7,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xa49e('0xe0')]=function(_0x2b4a5d,_0x51aa7b,_0x3976c6){var _0x106d16={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x51aa7b);this['saveInDb'](_[_0xa49e('0xe1')](_0x106d16,_[_0xa49e('0xe2')](_0x3976c6,[_0xa49e('0xe3'),'ListId',_0xa49e('0xe4'),'VoiceQueueId',_0xa49e('0xe5')])),_0xa49e('0xe6'),_0xa49e('0xe7'));logger[_0xa49e('0xa0')](_0x2b4a5d);};Dialer[_0xa49e('0xb8')]['isSuccess']=function(_0x3fc009){return _0x3fc009===_0xa49e('0xe8');};Dialer['prototype'][_0xa49e('0xe9')]=function(_0x5aada8){return!_[_0xa49e('0x41')](_0x5aada8)&&_0x5aada8&&!_[_0xa49e('0x41')](_0x5aada8[_0xa49e('0x42')])&&!_['isUndefined'](_0x5aada8[_0xa49e('0xea')])&&_0x5aada8['active']&&(this[_0xa49e('0x22')][util[_0xa49e('0x7d')](_0xa49e('0xeb'),_0x5aada8['name'])][_0xa49e('0xbb')]===_0xa49e('0xec')||this[_0xa49e('0x22')][util[_0xa49e('0x7d')](_0xa49e('0xeb'),_0x5aada8['name'])]['status']===_0xa49e('0xed'));};Dialer[_0xa49e('0xb8')][_0xa49e('0xee')]=function(_0x5ae19a,_0x3805a0,_0x2b39da){this[_0xa49e('0xda')](_0x5ae19a)[_0xa49e('0xc2')](loggerCatch(_0x3805a0));this[_0xa49e('0xd8')](_0x5ae19a)[_0xa49e('0xc2')](loggerCatch(_0x2b39da));};Dialer['prototype'][_0xa49e('0x39')]=function(_0x4dce9b){var _0x4fe013=this;var _0x299624=this[_0xa49e('0x26')][_0x4dce9b[_0xa49e('0xef')]];var _0x291962;if(!_[_0xa49e('0xb9')](_0x4dce9b)&&!_['isNil'](_0x4dce9b[_0xa49e('0xf0')])&&!_[_0xa49e('0xb9')](_0x4dce9b[_0xa49e('0xf0')][_0xa49e('0xf1')])&&_0x4dce9b[_0xa49e('0xf2')]==='xcally-motion-dialer'&&_0x299624){if(_0x299624[_0xa49e('0x51')]!=='ivr'&&this['voiceQueues'][_0x299624[_0xa49e('0xbd')]][_0xa49e('0xf3')]&&_0x4dce9b[_0xa49e('0xf4')]===_0xa49e('0xf5')){delete this['uniqueId'][_0x4dce9b[_0xa49e('0xef')]];this['updateOriginated'](this[_0xa49e('0x1f')][_0x299624['queue']]);this['voiceQueues'][_0x299624[_0xa49e('0xbd')]][_0xa49e('0x60')]+=0x1;this[_0xa49e('0x1f')][_0x299624['queue']][_0xa49e('0xf6')]+=0x1;_0x291962=new Hangup(_0x299624,_0x4dce9b);_0x291962['state']=0x12;_0x291962[_0xa49e('0xb3')]=_0xa49e('0xf7');_0x291962[_0xa49e('0xf8')]=_0xa49e('0xf9');ami[_0xa49e('0x50')]('custom:amd',ut[_0xa49e('0xfa')](_0x291962,'amd'));this[_0xa49e('0xee')](_0x291962,_0xa49e('0xfb'),_0xa49e('0xfc'));}if(_0x299624['type']!==_0xa49e('0x80')&&this[_0xa49e('0x1f')][_0x299624[_0xa49e('0xbd')]][_0xa49e('0xf3')]&&_0x4dce9b[_0xa49e('0xf4')]===_0xa49e('0xfd')){return new Promise(function(_0x3a49b6,_0x409d81){delete _0x4fe013[_0xa49e('0x26')][_0x4dce9b['uniqueid']];_0x4fe013[_0xa49e('0xdc')](_0x4fe013[_0xa49e('0x1f')][_0x299624[_0xa49e('0xbd')]]);_0x4fe013['voiceQueues'][_0x299624[_0xa49e('0xbd')]][_0xa49e('0x60')]+=0x1;_0x4fe013[_0xa49e('0x1f')][_0x299624[_0xa49e('0xbd')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x377700=_0x4fe013[_0xa49e('0x1f')][_0x299624[_0xa49e('0xbd')]];var _0x49fbf4=new Hangup(_0x299624,_0x4dce9b);_0x49fbf4[_0xa49e('0xb2')]=0x13;_0x49fbf4[_0xa49e('0xb3')]=_0xa49e('0xfe');_0x49fbf4[_0xa49e('0xf8')]=_0xa49e('0xf9');_0x49fbf4['countmachineretry']+=0x1;_0x49fbf4['countglobal']+=0x1;_0x49fbf4[_0xa49e('0xff')]=!![];ami[_0xa49e('0x50')](_0xa49e('0x100'),ut[_0xa49e('0xfa')](_0x49fbf4,'amd'));_0x4fe013[_0xa49e('0xda')](_0x49fbf4)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x101')));if(_0x49fbf4['countbusyretry']+_0x49fbf4[_0xa49e('0x102')]+_0x49fbf4['countnoanswerretry']+_0x49fbf4[_0xa49e('0x103')]+_0x49fbf4[_0xa49e('0x104')]+_0x49fbf4[_0xa49e('0x105')]+_0x49fbf4[_0xa49e('0x106')]+_0x49fbf4[_0xa49e('0x107')]>=_0x377700['dialGlobalMaxRetry']){_0x4fe013[_0xa49e('0x108')](_0x49fbf4,_0x3a49b6,_0x409d81,_0xa49e('0x109'));}else{if(_0x49fbf4[_0xa49e('0x106')]>=_0x377700['dialMachineMaxRetry']){_0x4fe013[_0xa49e('0x10a')](_0x49fbf4,_0x3a49b6,_0x409d81,'reason\x2019\x20machine....');}else{_0x4fe013[_0xa49e('0xce')]({'active':![],'countmachineretry':_0x49fbf4['countmachineretry'],'scheduledat':moment()['add'](_0x377700[_0xa49e('0x10b')],_0xa49e('0x10c'))['format'](_0xa49e('0x10d')),'ContactId':_0x49fbf4['ContactId'],'ListId':_0x49fbf4[_0xa49e('0x10e')],'VoiceQueueId':_0x49fbf4['VoiceQueueId']||undefined,'CampaignId':_0x49fbf4[_0xa49e('0xe5')]||undefined})[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x10f')));_0x3a49b6({'reschedule':0x1});}}});}if(_0x299624[_0xa49e('0x51')]===_0xa49e('0x80')&&this[_0xa49e('0x20')][_0x299624['queue']][_0xa49e('0xf3')]&&_0x4dce9b[_0xa49e('0xf4')]==='HANGUP'){delete this['uniqueId'][_0x4dce9b[_0xa49e('0xef')]];this[_0xa49e('0xdc')](this[_0xa49e('0x20')][_0x299624[_0xa49e('0xbd')]]);_0x291962=new Hangup(_0x299624,_0x4dce9b);_0x291962[_0xa49e('0xb2')]=0x12;_0x291962[_0xa49e('0xb3')]=_0xa49e('0xf7');_0x291962['membername']=_0xa49e('0xf9');ami[_0xa49e('0x50')](_0xa49e('0x100'),ut['buildObj'](_0x291962,_0xa49e('0xff')));this['saveInDb'](_0x291962,_0xa49e('0x110'),_0xa49e('0x111'));}if(_0x299624[_0xa49e('0x51')]===_0xa49e('0x80')&&this['campaigns'][_0x299624['queue']][_0xa49e('0xf3')]&&_0x4dce9b[_0xa49e('0xf4')]===_0xa49e('0xfd')){return new Promise(function(_0xa9e8df,_0x49eabc){delete _0x4fe013['uniqueId'][_0x4dce9b[_0xa49e('0xef')]];_0x4fe013[_0xa49e('0xdc')](_0x4fe013[_0xa49e('0x20')][_0x299624['queue']]);_0x4fe013[_0xa49e('0x20')][_0x299624[_0xa49e('0xbd')]]['outboundAnswerCallsDay']+=0x1;_0x4fe013[_0xa49e('0x20')][_0x299624['queue']][_0xa49e('0xf6')]+=0x1;var _0x2b3935=_0x4fe013[_0xa49e('0x20')][_0x299624['queue']];var _0x55fcec=new Hangup(_0x299624,_0x4dce9b);_0x55fcec[_0xa49e('0xb2')]=0x13;_0x55fcec['statedesc']=_0xa49e('0xfe');_0x55fcec[_0xa49e('0xf8')]='AMD';_0x55fcec['countmachineretry']+=0x1;_0x55fcec[_0xa49e('0x112')]+=0x1;_0x55fcec['amd']=!![];ami[_0xa49e('0x50')]('custom:amd',ut['buildObj'](_0x55fcec,_0xa49e('0xff')));_0x4fe013[_0xa49e('0xda')](_0x55fcec)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x101')));if(_0x55fcec[_0xa49e('0x113')]+_0x55fcec[_0xa49e('0x102')]+_0x55fcec[_0xa49e('0x114')]+_0x55fcec[_0xa49e('0x103')]+_0x55fcec[_0xa49e('0x104')]+_0x55fcec[_0xa49e('0x105')]+_0x55fcec[_0xa49e('0x106')]+_0x55fcec[_0xa49e('0x107')]>=_0x2b3935[_0xa49e('0x115')]){_0x4fe013[_0xa49e('0x108')](_0x55fcec,_0xa9e8df,_0x49eabc,'reason19\x20machine....');}else{if(_0x55fcec['countmachineretry']>=_0x2b3935[_0xa49e('0x116')]){_0x4fe013[_0xa49e('0x10a')](_0x55fcec,_0xa9e8df,_0x49eabc,_0xa49e('0x117'));}else{_0x4fe013[_0xa49e('0xce')]({'active':![],'countmachineretry':_0x55fcec[_0xa49e('0x106')],'scheduledat':moment()['add'](_0x2b3935[_0xa49e('0x10b')],_0xa49e('0x10c'))[_0xa49e('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x55fcec[_0xa49e('0xe3')],'ListId':_0x55fcec[_0xa49e('0x10e')],'VoiceQueueId':_0x55fcec[_0xa49e('0x118')]||undefined,'CampaignId':_0x55fcec['CampaignId']||undefined})[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x10f')));_0xa9e8df({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xa49e('0x35')]=function(_0x14b155){var _0x45a824=this[_0xa49e('0x26')][_0x14b155[_0xa49e('0xef')]];var _0x1dc160;if(_0x45a824&&_0x45a824[_0xa49e('0x51')]===_0xa49e('0x80')){delete this[_0xa49e('0x26')][_0x14b155['uniqueid']];this[_0xa49e('0xdc')](this[_0xa49e('0x20')][_0x45a824['queue']]);this[_0xa49e('0x20')][_0x45a824['queue']][_0xa49e('0x119')]+=0x1;_0x1dc160=new Hangup(_0x45a824,_0x14b155);this[_0xa49e('0xda')](_0x1dc160)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x11a')));this[_0xa49e('0xd8')](_0x1dc160)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x11b')));}if(_0x45a824&&_0x45a824[_0xa49e('0x51')]!==_0xa49e('0x80')&&isNotNull(this[_0xa49e('0x1f')][_0x45a824['queue']][_0xa49e('0x11c')])){delete this[_0xa49e('0x26')][_0x14b155['uniqueid']];this[_0xa49e('0xdc')](this['voiceQueues'][_0x45a824['queue']]);this[_0xa49e('0x1f')][_0x45a824[_0xa49e('0xbd')]][_0xa49e('0x60')]+=0x1;this[_0xa49e('0x1f')][_0x45a824[_0xa49e('0xbd')]][_0xa49e('0xf6')]+=0x1;_0x1dc160=new Hangup(_0x45a824,_0x14b155);_0x1dc160[_0xa49e('0xb2')]=0x10;_0x1dc160['statedesc']=_0xa49e('0x11d');_0x1dc160[_0xa49e('0xf8')]='AGI';this[_0xa49e('0xda')](_0x1dc160)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x11a')));this[_0xa49e('0xd8')](_0x1dc160)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x45a824&&_0x45a824['type']!=='ivr'&&!isNotNull(this[_0xa49e('0x1f')][_0x45a824[_0xa49e('0xbd')]][_0xa49e('0x11c')])){delete this[_0xa49e('0x26')][_0x14b155[_0xa49e('0xef')]];this[_0xa49e('0xdc')](this['voiceQueues'][_0x45a824['queue']]);this[_0xa49e('0x1f')][_0x45a824[_0xa49e('0xbd')]][_0xa49e('0x6b')]+=0x1;_0x1dc160=new Hangup(_0x45a824,_0x14b155);_0x1dc160['state']=0xc;_0x1dc160[_0xa49e('0xb3')]=_0x14b155[_0xa49e('0x11e')];_0x1dc160[_0xa49e('0xf8')]=_0xa49e('0x11f');this[_0xa49e('0xda')](_0x1dc160)['catch'](loggerCatch(_0xa49e('0x11a')));this[_0xa49e('0xd8')](_0x1dc160)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x11b')));}};Dialer['prototype']['syncAgentComplete']=function(_0x18fd44){var _0x35d436=this[_0xa49e('0x26')][_0x18fd44[_0xa49e('0xef')]];if(this[_0xa49e('0x1f')][_0x18fd44[_0xa49e('0xbd')]]){if(_0x35d436&&_0x35d436[_0xa49e('0x51')]!==_0xa49e('0x80')){delete this[_0xa49e('0x26')][_0x18fd44[_0xa49e('0xef')]];this['voiceQueues'][_0x18fd44[_0xa49e('0xbd')]][_0xa49e('0x60')]+=0x1;var _0x13fa75=new AgentComplete(_0x35d436,_0x18fd44);if(_0x18fd44[_0xa49e('0x120')]===_0xa49e('0x121')){_0x13fa75[_0xa49e('0x122')]=this[_0xa49e('0x1f')][_0x18fd44[_0xa49e('0xbd')]][_0xa49e('0x123')]&&this['voiceQueues'][_0x18fd44[_0xa49e('0xbd')]]['dialAgiAfterHangupAgent']?moment()[_0xa49e('0x7d')](_0xa49e('0x10d')):undefined;}this[_0xa49e('0xda')](_0x13fa75)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x124')));this[_0xa49e('0xd8')](_0x13fa75)[_0xa49e('0xc2')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xa49e('0xb8')][_0xa49e('0x125')]=function(_0x51aef5){if(this[_0xa49e('0x1f')][_0x51aef5['queue']]){if(this[_0xa49e('0x26')][_0x51aef5['uniqueid']]&&this[_0xa49e('0x26')][_0x51aef5[_0xa49e('0xef')]][_0xa49e('0x51')]!==_0xa49e('0x80')){this[_0xa49e('0xdc')](this['voiceQueues'][_0x51aef5[_0xa49e('0xbd')]]);this[_0xa49e('0x26')][_0x51aef5[_0xa49e('0xef')]]['answertime']=moment()[_0xa49e('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xa49e('0xb8')]['queueCallerAbandonCreateState']=function(_0x27f3b3,_0x1bf2d5){this['createHistory'](_0x27f3b3)['catch'](loggerCatch(_0xa49e('0x124')));if(_0x1bf2d5==0x0){this[_0xa49e('0xd8')](_0x27f3b3)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x126')));}};Dialer[_0xa49e('0xb8')][_0xa49e('0x127')]=function(_0x52c22a){var _0x5906a2=this[_0xa49e('0x26')][_0x52c22a[_0xa49e('0xef')]];var _0x51167a=this;var _0x519a93=![];var _0x185ddb;var _0x26ca42;if(this[_0xa49e('0x1f')][_0x52c22a['queue']]){if(_0x5906a2&&_0x5906a2[_0xa49e('0x51')]!==_0xa49e('0x80')){delete this[_0xa49e('0x26')][_0x52c22a[_0xa49e('0xef')]];this[_0xa49e('0xdc')](this[_0xa49e('0x1f')][_0x52c22a[_0xa49e('0xbd')]]);_0x5906a2[_0xa49e('0x128')]=moment()[_0xa49e('0x7d')](_0xa49e('0x10d'));var _0x2db218=new QueueCallerAbandon(_0x5906a2,_0x52c22a);if(getSeconds(_0x5906a2[_0xa49e('0x128')],_0x5906a2[_0xa49e('0x129')])>=_0x5906a2['dialQueueTimeout']){this[_0xa49e('0x1f')][_0x52c22a[_0xa49e('0xbd')]][_0xa49e('0x6f')]+=0x1;this[_0xa49e('0x1f')][_0x52c22a[_0xa49e('0xbd')]][_0xa49e('0x66')]+=0x1;this['voiceQueues'][_0x52c22a[_0xa49e('0xbd')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x2db218['state']=0xa;_0x2db218[_0xa49e('0xb3')]=_0xa49e('0x12a');_0x2db218[_0xa49e('0x12b')]=_0xa49e('0x12c');_0x2db218[_0xa49e('0x122')]=this['voiceQueues'][_0x52c22a[_0xa49e('0xbd')]]['dialQueueProject2']?moment()[_0xa49e('0x7d')](_0xa49e('0x10d')):undefined;_0x2db218['countdropretry']+=0x1;_0x2db218[_0xa49e('0x112')]+=0x1;_0x185ddb=this[_0xa49e('0x1f')][_0x52c22a[_0xa49e('0xbd')]][_0xa49e('0x12d')];_0x26ca42=this[_0xa49e('0x1f')][_0x52c22a[_0xa49e('0xbd')]][_0xa49e('0x12e')];_0x51167a['verifyAdditionalPhones'](_0x2db218,_0x2db218['state'],_0x5906a2[_0xa49e('0x12f')])['then'](function(_0x2aac83){_0x519a93=_0x2aac83['additional']==0x1;if(_0x2db218[_0xa49e('0x104')]>=_0x51167a[_0xa49e('0x1f')][_0x52c22a['queue']][_0xa49e('0x130')]){_0x51167a[_0xa49e('0x131')](_0x2db218,_0x2aac83[_0xa49e('0x132')]);}else{_0x51167a[_0xa49e('0xce')]({'active':![],'countdropretry':_0x2db218[_0xa49e('0x104')],'scheduledat':moment()['add'](_0x51167a[_0xa49e('0x1f')][_0x52c22a[_0xa49e('0xbd')]]['dialDropRetryFrequency'],'minutes')['format'](_0xa49e('0x10d')),'ContactId':_0x5906a2[_0xa49e('0xe3')],'ListId':_0x5906a2[_0xa49e('0x10e')],'VoiceQueueId':_0x5906a2['VoiceQueueId']||undefined,'CampaignId':_0x5906a2[_0xa49e('0xe5')]||undefined})[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x133')));var _0x4fc7e3=new History(_0x2db218);_0x4fc7e3[_0xa49e('0xb2')]=0xa;_0x4fc7e3[_0xa49e('0xb3')]=_0xa49e('0x12a');_0x4fc7e3[_0xa49e('0x134')]=moment()[_0xa49e('0x7d')](_0xa49e('0x10d'));_0x4fc7e3['endtime']=_0x4fc7e3['starttime'];_0x4fc7e3[_0xa49e('0x135')]=_0x2db218['calleridname'];_0x4fc7e3[_0xa49e('0x136')]=_0x2db218[_0xa49e('0x136')];_0x51167a[_0xa49e('0xda')](_0x4fc7e3)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xa49e('0x3f')](function(){if(_0x519a93)_0x51167a[_0xa49e('0xc8')](_0x2db218,_0x185ddb,_0x26ca42)[_0xa49e('0x3f')](function(){return 0x1;});});}else{this[_0xa49e('0x1f')][_0x52c22a[_0xa49e('0xbd')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x52c22a[_0xa49e('0xbd')]][_0xa49e('0x65')]+=0x1;_0x2db218[_0xa49e('0xb2')]=0xb;_0x2db218['statedesc']=_0xa49e('0x137');_0x2db218[_0xa49e('0x12b')]='CALLEREXIT';_0x2db218[_0xa49e('0x105')]+=0x1;_0x2db218[_0xa49e('0x112')]+=0x1;_0x185ddb=this[_0xa49e('0x1f')][_0x52c22a[_0xa49e('0xbd')]][_0xa49e('0x138')];_0x26ca42=this[_0xa49e('0x1f')][_0x52c22a[_0xa49e('0xbd')]]['callAdditionalPhoneAfterMin'];_0x51167a[_0xa49e('0xc6')](_0x2db218,_0x2db218['state'],_0x5906a2['voiceQueue'])[_0xa49e('0x3f')](function(_0x5540f5){if(_0x2db218[_0xa49e('0x105')]>=_0x51167a[_0xa49e('0x1f')][_0x52c22a['queue']]['dialAbandonedMaxRetry']){_0x51167a[_0xa49e('0x131')](_0x2db218,_0x5540f5[_0xa49e('0x132')]);}else{_0x51167a[_0xa49e('0xce')]({'active':![],'countabandonedretry':_0x2db218['countabandonedretry'],'scheduledat':moment()[_0xa49e('0x139')](_0x51167a['voiceQueues'][_0x52c22a['queue']][_0xa49e('0x138')],_0xa49e('0x10c'))[_0xa49e('0x7d')](_0xa49e('0x10d')),'ContactId':_0x5906a2['ContactId'],'ListId':_0x5906a2[_0xa49e('0x10e')],'VoiceQueueId':_0x5906a2[_0xa49e('0x118')]||undefined,'CampaignId':_0x5906a2[_0xa49e('0xe5')]||undefined})[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x13a')));var _0x45f179=new History(_0x2db218);_0x45f179[_0xa49e('0xb2')]=0xb;_0x45f179[_0xa49e('0xb3')]=_0xa49e('0x137');_0x45f179['starttime']=moment()[_0xa49e('0x7d')](_0xa49e('0x10d'));_0x45f179[_0xa49e('0xb4')]=_0x45f179[_0xa49e('0x134')];_0x45f179['calleridname']=_0x2db218['calleridname'];_0x45f179[_0xa49e('0x136')]=_0x2db218[_0xa49e('0x136')];_0x51167a[_0xa49e('0xda')](_0x45f179)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x519a93)_0x51167a[_0xa49e('0xc8')](_0x2db218,_0x185ddb,_0x26ca42)[_0xa49e('0x3f')](function(){return 0x1;});});}}}};Dialer[_0xa49e('0xb8')][_0xa49e('0x37')]=function(_0x1ab6ff){if(this['actions'][_0x1ab6ff[_0xa49e('0xef')]]){this[_0xa49e('0x25')][_0x1ab6ff['uniqueid']]['channel']=_0x1ab6ff['channel'];}if(this[_0xa49e('0x26')][_0x1ab6ff['uniqueid']]){this[_0xa49e('0x26')][_0x1ab6ff['uniqueid']]['channel']=_0x1ab6ff[_0xa49e('0xbc')];}};Dialer[_0xa49e('0xb8')][_0xa49e('0x3b')]=function(_0x373a3d){if(strategy[this['voiceQueues'][this[_0xa49e('0x25')][_0x373a3d[_0xa49e('0x13b')]][_0xa49e('0xbd')]][_0xa49e('0x53')]]===_0xa49e('0x1b')){if(this[_0xa49e('0x25')][_0x373a3d[_0xa49e('0x13b')]]&&_[_0xa49e('0xb9')](this[_0xa49e('0x25')][_0x373a3d[_0xa49e('0x13b')]][_0xa49e('0x13c')])&&_0x373a3d[_0xa49e('0xbb')]==='1'&&_0x373a3d[_0xa49e('0x13d')]==='0'){if(this[_0xa49e('0x21')][_0x373a3d['stateinterface']]){if(!this['agents'][_0x373a3d[_0xa49e('0x13e')]][_0xa49e('0x13c')]){this[_0xa49e('0x21')][_0x373a3d['stateinterface']][_0xa49e('0x13c')]=!![];this[_0xa49e('0x25')][_0x373a3d[_0xa49e('0x13b')]]['locked']=!![];this[_0xa49e('0x25')][_0x373a3d[_0xa49e('0x13b')]][_0xa49e('0x13e')]=_0x373a3d['stateinterface'];}}}}else if((strategy[this[_0xa49e('0x1f')][this[_0xa49e('0x25')][_0x373a3d['actionid']][_0xa49e('0xbd')]][_0xa49e('0x53')]]||_0xa49e('0x1a'))===_0xa49e('0x1a')){if(this['actions'][_0x373a3d[_0xa49e('0x13b')]]){if(this[_0xa49e('0x21')][_0x373a3d[_0xa49e('0x13e')]]){this[_0xa49e('0x25')][_0x373a3d['actionid']][_0xa49e('0x13e')]=_0x373a3d[_0xa49e('0x13e')];if(_[_0xa49e('0xb9')](this[_0xa49e('0x13f')][this[_0xa49e('0x25')][_0x373a3d[_0xa49e('0x13b')]][_0xa49e('0xbd')]])){this['queueBooked'][this[_0xa49e('0x25')][_0x373a3d[_0xa49e('0x13b')]]['queue']]=[];}this[_0xa49e('0x13f')][this[_0xa49e('0x25')][_0x373a3d[_0xa49e('0x13b')]]['queue']][_0xa49e('0x140')](_['merge'](_[_0xa49e('0xe2')](this[_0xa49e('0x25')][_0x373a3d[_0xa49e('0x13b')]],['idHopper',_0xa49e('0x13e')]),{'status':_0x373a3d[_0xa49e('0xbb')],'paused':_0x373a3d[_0xa49e('0x13d')]}));}}}};function unlockQueueStatus(_0x16a6f3,_0x4a203f){setTimeout(function(){if(_[_0xa49e('0x41')](_0x16a6f3['queueStatusComplete'])){loggerBooked['error'](_0xa49e('0x141'),_0x4a203f);}_0x16a6f3['queueStatusComplete']=!![];loggerBooked[_0xa49e('0x83')](_0xa49e('0x142'),_0x4a203f,JSON[_0xa49e('0x4d')](_[_0xa49e('0xe2')](_0x16a6f3,['name','queueStatusComplete'])));},0x1f3);}Dialer[_0xa49e('0xb8')][_0xa49e('0x143')]=function(_0x4e476b){var _0x5328e9=this;var _0xcc5b77=_0x5328e9['voiceQueues'][_0x5328e9[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]]['queue']];if(strategy[this['voiceQueues'][this[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0xbd')]][_0xa49e('0x53')]]==='roundrobin'){if(this[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]]&&this['actions'][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0x13e')]){this[_0xa49e('0x9a')][_0xa49e('0x144')](this[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0x145')],this[_0xa49e('0x25')][_0x4e476b['actionid']][_0xa49e('0x13e')])[_0xa49e('0xc2')](function(_0x3eb147){logger[_0xa49e('0xa0')](_0xa49e('0x146'),util[_0xa49e('0x9f')](_0x3eb147,{'showHidden':![],'depth':null}));})[_0xa49e('0x147')](function(){_0x5328e9[_0xa49e('0xdc')](_0x5328e9[_0xa49e('0x1f')][_0x5328e9[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0xbd')]]);_0x5328e9[_0xa49e('0x21')][_0x5328e9[_0xa49e('0x25')][_0x4e476b['actionid']][_0xa49e('0x13e')]][_0xa49e('0x13c')]=![];delete _0x5328e9['actions'][_0x4e476b[_0xa49e('0x13b')]];unlockQueueStatus(_0xcc5b77);});}else{this[_0xa49e('0xdc')](this[_0xa49e('0x1f')][this[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]]['queue']]);this[_0xa49e('0xce')]({'active':![],'ContactId':this[_0xa49e('0x25')][_0x4e476b['actionid']]['ContactId'],'ListId':this[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0x10e')],'VoiceQueueId':this['actions'][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0x118')]||undefined,'CampaignId':this[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0xe5')]||undefined})[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x148')));delete this[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]];unlockQueueStatus(_0xcc5b77);}}else if((strategy[this[_0xa49e('0x1f')][this[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0xbd')]][_0xa49e('0x53')]]||_0xa49e('0x1a'))==='rrmemory'){var _0x1df2bb;if(this[_0xa49e('0x25')][_0x4e476b['actionid']]&&!_[_0xa49e('0x82')](this['queueBooked'][this[_0xa49e('0x25')][_0x4e476b['actionid']]['queue']])){if(this[_0xa49e('0x29')][_0x5328e9[_0xa49e('0x25')][_0x4e476b['actionid']][_0xa49e('0xbd')]]){this[_0xa49e('0x29')][_0x5328e9[_0xa49e('0x25')][_0x4e476b['actionid']][_0xa49e('0xbd')]]=this['queueBookedRR'][this[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0xbd')]]?this['queueBookedRR'][this[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0xbd')]]:this[_0xa49e('0x13f')][this['actions'][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0xbd')]]?this[_0xa49e('0x13f')][this['actions'][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0xbd')]][_0xa49e('0x149')]||0x0:0x0;}this[_0xa49e('0x13f')][this[_0xa49e('0x25')][_0x4e476b['actionid']][_0xa49e('0xbd')]][_0xa49e('0x149')]=this[_0xa49e('0x29')][this[_0xa49e('0x25')][_0x4e476b[_0xa49e('0x13b')]][_0xa49e('0xbd')]];for(var _0x4cae9a=0x0;_0x4cae9a=0x0;})[_0xa49e('0xc2')](myreject(_0x118f0a)));}}else{_0x1438bf[_0xa49e('0x140')](ami[_0xa49e('0xba')]({'action':'command','command':util[_0xa49e('0x7d')](_0xa49e('0x15f'),_0x56113e,!_[_0xa49e('0x41')](config[_0xa49e('0x15c')][_0x4daf98])?_0x4daf98:'')})[_0xa49e('0x3f')](function(_0x3a363a){return _0x3a363a['content'][_0xa49e('0x160')](_0xa49e('0x15e'))>=0x0;})[_0xa49e('0xc2')](myreject(_0x118f0a)));}Promise[_0xa49e('0x161')](_0x1438bf)[_0xa49e('0x3f')](function(_0x563ab9){var _0x361a80=_['some'](_0x563ab9);if(_0x361a80){return _0x23de2f(_0x361a80);}else{_0x5810e8[_0xa49e('0x44')]=_0x3021f9?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x118f0a(msgResponse(_0xa49e('0x162'),_0xa49e('0x157'),_0xa49e('0x163')+_0x3021f9+'\x20'+_0x4adc2b+_0xa49e('0x164')+util[_0xa49e('0x9f')](_0x56113e,{'showHidden':![],'depth':null})+_0xa49e('0x165')+_0x4daf98));}})[_0xa49e('0xc2')](function(_0x1eea48){return _0x118f0a(msgResponse('ifTime','Failure',JSON['stringify'](_0x1eea48)));});});};Dialer[_0xa49e('0xb8')][_0xa49e('0x166')]=function(_0x2184b7){var _0x2eefa0=this;return function(){switch(_0x2184b7[_0xa49e('0x167')]){case _0xa49e('0x168'):freeVariablesPredictive(_0x2184b7);_0x2eefa0[_0xa49e('0x169')](_0x2184b7,0x1);break;case _0xa49e('0x16a'):freeVariablesPredictive(_0x2184b7);_0x2eefa0['handlePower'](_0x2184b7,_0x2184b7[_0xa49e('0x16b')]);break;case _0xa49e('0x9'):_0x2eefa0[_0xa49e('0x9')](_0x2184b7);break;case _0xa49e('0x8'):freeVariablesPredictive(_0x2184b7);_0x2eefa0[_0xa49e('0x169')](_0x2184b7,0x1);break;default:freeVariablesPredictive(_0x2184b7);logger[_0xa49e('0xa0')]('Queue',_0x2184b7[_0xa49e('0x42')],_0xa49e('0x16c'));}};};Dialer['prototype'][_0xa49e('0x16d')]=function(_0x553a0e){return Promise[_0xa49e('0xc1')]()[_0xa49e('0x3f')](cmHopper[_0xa49e('0x16e')](_0x553a0e['id'],previewRecallmeReminderInterval))[_0xa49e('0x3f')](function(_0x1635a6){for(var _0x5250d9=0x0;_0x5250d9<_0x1635a6['length'];_0x5250d9++){var _0x207af0=_0x1635a6[_0x5250d9][_0xa49e('0x16f')][_0xa49e('0x42')];if(_0x207af0)io['to'](util[_0xa49e('0x7d')](_0xa49e('0x170'),_0x207af0))['emit'](_0xa49e('0x171'),{'hopper':_0x1635a6[_0x5250d9]});}})[_0xa49e('0xc2')](function(){});};Dialer['prototype'][_0xa49e('0x172')]=function(_0x4ba927){var _0x2d480c=this;return function(){_0x2d480c[_0xa49e('0x173')](_0x4ba927);};};Dialer[_0xa49e('0xb8')]['syncQueueSummary']=function(_0x6ebc97){var _0x323147=this;if(isNotPreview(_0x6ebc97[_0xa49e('0x167')])){if(isVoiceQueueOutbound(_0x6ebc97[_0xa49e('0x51')])&&isActive(_0x6ebc97[_0xa49e('0x174')])){_0x6ebc97[_0xa49e('0xab')]=!![];Promise[_0xa49e('0xc1')]()[_0xa49e('0x3f')](checkIsLoggedIn(_0x6ebc97,_0x6ebc97[_0xa49e('0x56')]))['then'](checkIsActive(_0x6ebc97,_0x6ebc97[_0xa49e('0x174')]))[_0xa49e('0x3f')](checkInterval(_0x6ebc97))['then'](_0x323147[_0xa49e('0x152')](_0x6ebc97))[_0xa49e('0x3f')](_0x323147[_0xa49e('0x154')](_0x6ebc97[_0xa49e('0x175')],_0x6ebc97['dialTimezone'],_0x6ebc97[_0xa49e('0x42')],_0x6ebc97))[_0xa49e('0x3f')](_0x323147[_0xa49e('0x156')](_0x6ebc97[_0xa49e('0x47')],_0x6ebc97[_0xa49e('0x176')],_0x6ebc97['name'],_0x6ebc97))[_0xa49e('0x3f')](_0x323147[_0xa49e('0x166')](_0x6ebc97))[_0xa49e('0xc2')](loggerCatchQueueSummary(_0xa49e('0x177'),_0x6ebc97));}else{notSendMessagesQueue(_0x6ebc97);}}else{freeVariablesPredictive(_0x6ebc97);}};Dialer[_0xa49e('0xb8')][_0xa49e('0x33')]=_[_0xa49e('0x178')](function(){var _0xeec2d4=_[_0xa49e('0x179')](this[_0xa49e('0x1f')],function(_0x18c15a){return _0x18c15a['dialPreviewRecallmeReminder'];});var _0x20b7a1=_[_0xa49e('0x179')](this[_0xa49e('0x21')],function(_0x18bb85){return _0x18bb85[_0xa49e('0x17a')]&&_0x18bb85['status']===_0xa49e('0xec');});if(_0xeec2d4[_0xa49e('0xa2')]>0x0&&_0x20b7a1[_0xa49e('0xa2')]>0x0){return Promise['resolve']()['then'](cmHopper[_0xa49e('0x16e')](_[_0xa49e('0x17b')](_0xeec2d4,'id'),previewRecallmeReminderInterval,_[_0xa49e('0x17b')](_0x20b7a1,'id')))[_0xa49e('0x3f')](function(_0x41cfa9){for(var _0x4d24e0=0x0;_0x4d24e0<_0x41cfa9[_0xa49e('0xa2')];_0x4d24e0++){var _0x37302b=_0x41cfa9[_0x4d24e0][_0xa49e('0x16f')][_0xa49e('0x42')];if(_0x37302b)io['to'](util[_0xa49e('0x7d')](_0xa49e('0x170'),_0x37302b))['emit'](_0xa49e('0x171'),{'hopper':_0x41cfa9[_0x4d24e0]});}})['catch'](function(_0x31442f){logger['error'](_0xa49e('0x16d'),_0x31442f);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xa49e('0xb8')][_0xa49e('0x151')]=function(){var _0x67a5d4=this;var _0x387734;for(var _0x1ec97c in this['campaigns']){if(typeof this[_0xa49e('0x20')][_0x1ec97c]!==_0xa49e('0xa3')){_0x387734=this[_0xa49e('0x20')][_0x1ec97c];if(isCampaignIvr(_0x387734[_0xa49e('0x51')])&&isActive(_0x387734['active'])){_0x387734[_0xa49e('0xab')]=!![];Promise[_0xa49e('0xc1')]()[_0xa49e('0x3f')](checkIsActive(_0x387734,_0x387734[_0xa49e('0xea')]))[_0xa49e('0x3f')](checkInterval(_0x387734))[_0xa49e('0x3f')](_0x67a5d4[_0xa49e('0x152')](_0x387734))[_0xa49e('0x3f')](_0x67a5d4[_0xa49e('0x154')](_0x387734[_0xa49e('0x175')],_0x387734[_0xa49e('0x176')],_0x387734[_0xa49e('0x42')],_0x387734))[_0xa49e('0x3f')](_0x67a5d4['checkIfTimeIntervals'](_0x387734[_0xa49e('0x47')],_0x387734['dialTimezone'],_0x387734['name'],_0x387734))[_0xa49e('0x3f')](_0x67a5d4[_0xa49e('0x172')](_0x387734))[_0xa49e('0xc2')](loggerCatchQueueSummary(_0xa49e('0x17c'),_0x387734));}else{notSendMessagesCampaign(_0x387734);}}}};function getCallerIdRandom(_0x5385da,_0x6c03cf){var _0x5d3625;var _0x4a1c89;var _0x16487b;if(_0x6c03cf<=0x0){_0x6c03cf=0x1;}_0x5d3625=new RegExp(_0xa49e('0x17d')+_0x6c03cf+'}$');_0x4a1c89=Math['pow'](0xa,_0x6c03cf-0x1);_0x16487b=Math[_0xa49e('0x17e')](0xa,_0x6c03cf)-0x1;return util[_0xa49e('0x7d')]('%s',_[_0xa49e('0x17f')](_0x5385da,_0x5d3625,_[_0xa49e('0x180')](_0x4a1c89,_0x16487b)));}function extractCalleridName(_0x3170f3){var _0x3ec39b=_0x3170f3[_0xa49e('0x181')](/"(.*?)"/);return _0x3ec39b?_0x3ec39b[0x1]:_0x3170f3;}Dialer['prototype'][_0xa49e('0x182')]=function(_0x5354e7,_0x37a419){var _0xee8e3a=this;var _0x155c99=uuid['v4']();this[_0xa49e('0x25')][_0x155c99]=new Action(_0x5354e7,_0x37a419,_0x155c99);return new Promise(function(_0x5351dd,_0x45af3a){if(_[_0xa49e('0x41')](_0x5354e7)&&typeof _0x5354e7!==_0xa49e('0x183')){return _0x45af3a(msgResponse(_0xa49e('0x184'),_0xa49e('0x157'),_0xa49e('0x185')));}if(_[_0xa49e('0x41')](_0x37a419[_0xa49e('0x186')])||_0x37a419['phone']===null){return _0x45af3a(msgResponse(_0xa49e('0x184'),_0xa49e('0x157'),_0xa49e('0x187')));}var _0x459197={'XMD-CALLERID':_0xee8e3a[_0xa49e('0x25')][_0x155c99]['getCaller'](),'XMD-AGI':_0x5354e7[_0xa49e('0x11c')]?util[_0xa49e('0x7d')](_0xa49e('0x188'),ipAgi,_0x5354e7[_0xa49e('0x11c')]):'NONE','XMD-AGIAFTER':_0x5354e7['dialQueueProject2']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x5354e7[_0xa49e('0x123')]):_0xa49e('0x189'),'XMD-QUEUE':_0x5354e7['type']==='outbound'?util['format']('\x22%s,%s%s,,,%s\x22',_0x5354e7[_0xa49e('0x42')],_0x5354e7[_0xa49e('0x18a')]||'',_0x5354e7[_0xa49e('0x18b')]?'c':'',_0x5354e7[_0xa49e('0x18c')]||0x3):_0xa49e('0x189'),'XMD-CONTACTID':_0x37a419[_0xa49e('0xe3')],'XMD-CDRTYPE':_0xa49e('0x18d'),'CALLERID(all)':_0xee8e3a[_0xa49e('0x25')][_0x155c99][_0xa49e('0x18e')](),'XMD-AMD':_0x5354e7['dialAMDActive']?_0xa49e('0x18f'):_0xa49e('0x189'),'XMD-DESTINATION':_0xa49e('0x190')};if(_0x5354e7[_0xa49e('0xf3')]){_0x459197[_0xa49e('0x191')]=_0x5354e7[_0xa49e('0x192')]||0x9c4;_0x459197['XMD-AMDGREETING']=_0x5354e7[_0xa49e('0x193')]||0x5dc;_0x459197[_0xa49e('0x194')]=_0x5354e7[_0xa49e('0x195')]||0x320;_0x459197[_0xa49e('0x196')]=_0x5354e7[_0xa49e('0x197')]||0x1388;_0x459197[_0xa49e('0x198')]=_0x5354e7[_0xa49e('0x199')]||0x64;_0x459197[_0xa49e('0x19a')]=_0x5354e7[_0xa49e('0x19b')]||0x32;_0x459197[_0xa49e('0x19c')]=_0x5354e7[_0xa49e('0x19d')]||0x3;_0x459197['XMD-AMDSILENCETHRESHOLD']=_0x5354e7[_0xa49e('0x19e')]||0x100;_0x459197[_0xa49e('0x19f')]=_0x5354e7[_0xa49e('0x1a0')]||0x1388;}if(_0x5354e7[_0xa49e('0x51')]===_0xa49e('0x52')){_0x459197[_0xa49e('0x1a1')]=_0x37a419[_0xa49e('0x118')];}else{_0x459197[_0xa49e('0x1a2')]=_0x37a419[_0xa49e('0xe5')];}for(var _0x5aa419 in _0x37a419['Contact']){if(typeof _0x37a419[_0xa49e('0x1a3')][_0x5aa419]!==_0xa49e('0xa3')){if(isNotNull(_0x37a419[_0xa49e('0x1a3')][_0x5aa419])&&_0x5aa419!=='id'&&_0x5aa419!==_0xa49e('0x1a4')&&_0x5aa419!==_0xa49e('0x1a5')&&_0x5aa419!==_0xa49e('0x1a6')){_0x459197[util['format']('%s%s',_0xa49e('0x1a7'),_[_0xa49e('0x1a8')](_0x5aa419))]=_0x37a419[_0xa49e('0x1a3')][_0x5aa419];}}}var _0xde3fe4=_0xee8e3a['isTrunkReachable'](_0x5354e7['Trunk'])?getCallerId(_0x5354e7[_0xa49e('0x7a')]['callerid'],_0x5354e7['dialOriginateCallerIdName'],_0x5354e7[_0xa49e('0x1a9')]>0x0?getCallerIdRandom(_0x5354e7[_0xa49e('0x5d')],_0x5354e7[_0xa49e('0x1a9')]):_0x5354e7['dialOriginateCallerIdNumber']):getCallerId(_[_0xa49e('0xb9')](_0x5354e7[_0xa49e('0x1aa')])?_0x5354e7[_0xa49e('0x7a')][_0xa49e('0x7b')]:_0x5354e7['TrunkBackup'][_0xa49e('0x7b')],_0x5354e7['dialOriginateCallerIdName'],_0x5354e7[_0xa49e('0x1a9')]>0x0?getCallerIdRandom(_0x5354e7[_0xa49e('0x5d')],_0x5354e7[_0xa49e('0x1a9')]):_0x5354e7[_0xa49e('0x5d')]);if(_0xde3fe4){_0x459197['XMD-ORIGINATECALLERIDNAME']=_0xee8e3a[_0xa49e('0x25')][_0x155c99][_0xa49e('0x1ab')]=extractCalleridName(_0xde3fe4);_0x459197[_0xa49e('0x1ac')]=_0x37a419[_0xa49e('0x186')];}_0x5354e7[_0xa49e('0x1ad')]=_0x459197;return ami[_0xa49e('0xba')]({'actionid':_0x155c99,'action':'originate','channel':_0xee8e3a[_0xa49e('0xe9')](_0x5354e7[_0xa49e('0x7a')])?util['format'](_0xa49e('0x1ae'),_0x5354e7['Trunk'][_0xa49e('0x42')],isNotNull(_0x5354e7[_0xa49e('0x5f')])?_0x5354e7[_0xa49e('0x5f')][_0xa49e('0x1af')]()||'':'',_0x5354e7[_0xa49e('0x1b0')]>0x0?_0x37a419['phone'][_0xa49e('0x1b1')](_0x5354e7[_0xa49e('0x1b0')]):_0x37a419[_0xa49e('0x186')]):util[_0xa49e('0x7d')](_0xa49e('0x1ae'),_['isNil'](_0x5354e7[_0xa49e('0x1aa')])?_0x5354e7[_0xa49e('0x7a')]['name']:_0x5354e7[_0xa49e('0x1aa')]['name'],isNotNull(_0x5354e7['dialPrefix'])?_0x5354e7[_0xa49e('0x5f')][_0xa49e('0x1af')]()||'':'',_0x5354e7[_0xa49e('0x1b0')]>0x0?_0x37a419[_0xa49e('0x186')][_0xa49e('0x1b1')](_0x5354e7[_0xa49e('0x1b0')]):_0x37a419['phone']),'callerid':_0xde3fe4,'Exten':_0xa49e('0x190'),'Context':_0xa49e('0x1b2'),'Priority':'1','variable':_0x459197,'timeout':(_0x5354e7['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x155c99})[_0xa49e('0x3f')](function(_0x225ea0){return _0x5351dd(_0x225ea0);})['catch'](function(_0x4aecf0){_0x5354e7[_0xa49e('0x69')]+=0x1;var _0x1aed89=new History(_0xee8e3a['actions'][_0x155c99]);logger[_0xa49e('0xa0')](util[_0xa49e('0x7d')](_0xa49e('0x1b3'),JSON['stringify'](_0x4aecf0)));_0x1aed89[_0xa49e('0xb2')]=0xe;_0x1aed89[_0xa49e('0xb3')]='OriginateError';_0x1aed89[_0xa49e('0x134')]=moment()[_0xa49e('0x7d')](_0xa49e('0x10d'));_0x1aed89[_0xa49e('0xb4')]=_0x1aed89[_0xa49e('0x134')];_0xee8e3a[_0xa49e('0xda')](_0x1aed89)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x1b4')));_0xee8e3a[_0xa49e('0xd8')](_0x1aed89)['catch'](loggerCatch(_0xa49e('0x1b4')))[_0xa49e('0x147')](function(){delete _0xee8e3a[_0xa49e('0x25')][_0x155c99];return _0x45af3a(msgResponse('originate',_0xa49e('0x4c'),_0xa49e('0x1b5')));});});});};Dialer[_0xa49e('0xb8')][_0xa49e('0x2e')]=function(_0x5e761c){var _0x35c0a4=this['actions'][_0x5e761c[_0xa49e('0x13b')]];if(_0x35c0a4){delete this[_0xa49e('0x25')][_0x5e761c['actionid']];_0x35c0a4['responsetime']=moment()[_0xa49e('0x7d')](_0xa49e('0x10d'));var _0x55b403=_0x35c0a4[_0xa49e('0x51')]==='ivr'?this[_0xa49e('0x20')][_0x35c0a4[_0xa49e('0xbd')]]:this[_0xa49e('0x1f')][_0x35c0a4[_0xa49e('0x1b6')]()];if(!this[_0xa49e('0x1b7')](_0x5e761c[_0xa49e('0x1b8')])){this[_0xa49e('0xdc')](_0x55b403);return this[_0xa49e('0x1b9')](_0x35c0a4,_0x55b403,_0x5e761c)[_0xa49e('0xc2')](loggerCatch('[callProgressDetecting]\x20'));}this[_0xa49e('0x26')][_0x5e761c[_0xa49e('0xef')]]=_0x35c0a4;}};Dialer['prototype'][_0xa49e('0x1ba')]=function(_0x5cc1c7,_0x3a5716,_0x18a6df){var _0x51a32=new History(_0x3a5716);if(_0x51a32[_0xa49e('0x113')]+_0x51a32[_0xa49e('0x102')]+_0x51a32[_0xa49e('0x114')]+_0x51a32['countnosuchnumberretry']+_0x51a32['countdropretry']+_0x51a32[_0xa49e('0x105')]+_0x51a32['countmachineretry']+_0x51a32['countagentrejectretry']>=_0x18a6df['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x5cc1c7){case 0x3:if(_0x51a32[_0xa49e('0x114')]>=_0x18a6df[_0xa49e('0x1bb')]-0x1){return!![];}this[_0xa49e('0xce')]({'active':![],'countnoanswerretry':_0x51a32[_0xa49e('0x114')]+=0x1,'scheduledat':moment()[_0xa49e('0x139')](_0x18a6df[_0xa49e('0x1bc')],_0xa49e('0x10c'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51a32[_0xa49e('0xe3')],'ListId':_0x51a32['ListId'],'VoiceQueueId':_0x51a32[_0xa49e('0x118')]||undefined,'CampaignId':_0x51a32['CampaignId']||undefined})[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x1bd')));break;case 0x5:if(_0x51a32['countbusyretry']>=_0x18a6df['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x51a32['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x18a6df['dialBusyRetryFrequency'],_0xa49e('0x10c'))[_0xa49e('0x7d')](_0xa49e('0x10d')),'ContactId':_0x51a32[_0xa49e('0xe3')],'ListId':_0x51a32[_0xa49e('0x10e')],'VoiceQueueId':_0x51a32[_0xa49e('0x118')]||undefined,'CampaignId':_0x51a32[_0xa49e('0xe5')]||undefined})['catch'](loggerCatch(_0xa49e('0x1be')));break;case 0x8:if(_0x51a32[_0xa49e('0x102')]>=_0x18a6df[_0xa49e('0x1bf')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x51a32['countcongestionretry']+=0x1,'scheduledat':moment()[_0xa49e('0x139')](_0x18a6df[_0xa49e('0x1c0')],'minutes')[_0xa49e('0x7d')](_0xa49e('0x10d')),'ContactId':_0x51a32[_0xa49e('0xe3')],'ListId':_0x51a32[_0xa49e('0x10e')],'VoiceQueueId':_0x51a32['VoiceQueueId']||undefined,'CampaignId':_0x51a32[_0xa49e('0xe5')]||undefined})[_0xa49e('0xc2')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x51a32[_0xa49e('0x103')]>=_0x18a6df[_0xa49e('0x1c1')]-0x1){return!![];}else{this[_0xa49e('0xce')]({'active':![],'countnosuchnumberretry':_0x51a32[_0xa49e('0x103')]+=0x1,'scheduledat':moment()['add'](_0x18a6df[_0xa49e('0x1c2')],_0xa49e('0x10c'))[_0xa49e('0x7d')](_0xa49e('0x10d')),'ContactId':_0x51a32['ContactId'],'ListId':_0x51a32[_0xa49e('0x10e')],'VoiceQueueId':_0x51a32['VoiceQueueId']||undefined,'CampaignId':_0x51a32[_0xa49e('0xe5')]||undefined})[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x1c3')));}break;case 0xa:if(_0x51a32['countdropretry']>=_0x18a6df['dialDropMaxRetry']-0x1){return!![];}this[_0xa49e('0xce')]({'active':![],'countdropretry':_0x51a32[_0xa49e('0x104')]+=0x1,'scheduledat':moment()['add'](_0x18a6df[_0xa49e('0x12d')],'minutes')[_0xa49e('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51a32[_0xa49e('0xe3')],'ListId':_0x51a32['ListId'],'VoiceQueueId':_0x51a32[_0xa49e('0x118')]||undefined,'CampaignId':_0x51a32[_0xa49e('0xe5')]||undefined})[_0xa49e('0xc2')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x51a32['countabandonedretry']>=_0x18a6df[_0xa49e('0x1c4')]-0x1){return!![];}this[_0xa49e('0xce')]({'active':![],'countabandonedretry':_0x51a32[_0xa49e('0x105')]+=0x1,'scheduledat':moment()[_0xa49e('0x139')](_0x18a6df[_0xa49e('0x138')],_0xa49e('0x10c'))[_0xa49e('0x7d')](_0xa49e('0x10d')),'ContactId':_0x51a32['ContactId'],'ListId':_0x51a32['ListId'],'VoiceQueueId':_0x51a32[_0xa49e('0x118')]||undefined,'CampaignId':_0x51a32['CampaignId']||undefined})['catch'](loggerCatch(_0xa49e('0x13a')));break;case 0x13:if(_0x51a32[_0xa49e('0x106')]>=_0x18a6df[_0xa49e('0x116')]-0x1){return!![];}this[_0xa49e('0xce')]({'active':![],'countmachineretry':_0x51a32[_0xa49e('0x106')]+=0x1,'scheduledat':moment()[_0xa49e('0x139')](_0x18a6df['dialMachineRetryFrequency'],'minutes')[_0xa49e('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51a32[_0xa49e('0xe3')],'ListId':_0x51a32[_0xa49e('0x10e')],'VoiceQueueId':_0x51a32['VoiceQueueId']||undefined,'CampaignId':_0x51a32['CampaignId']||undefined})[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x10f')));break;case 0x14:if(_0x51a32[_0xa49e('0x107')]>=_0x18a6df[_0xa49e('0x1c5')]-0x1){return!![];}this[_0xa49e('0xce')]({'active':![],'countagentrejectretry':_0x51a32['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xa49e('0x139')](_0x18a6df[_0xa49e('0x1c6')],_0xa49e('0x10c'))[_0xa49e('0x7d')](_0xa49e('0x10d')),'ContactId':_0x51a32[_0xa49e('0xe3')],'ListId':_0x51a32[_0xa49e('0x10e')],'VoiceQueueId':_0x51a32[_0xa49e('0x118')]||undefined,'CampaignId':_0x51a32[_0xa49e('0xe5')]||undefined})[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x1c7')));break;default:return!![];}};Dialer['prototype'][_0xa49e('0x1b9')]=function(_0x21561e,_0x31798c,_0x3a5593){var _0x4378ae=this;var _0x5aece4=new History(_0x21561e);var _0x8dcac=![];var _0x284d4b;var _0x35c2be;return new Promise(function(_0x2c5e2b,_0x471c29){if(_[_0xa49e('0x41')](_0x31798c)&&typeof _0x31798c!=='object'){return _0x471c29(msgResponse(_0xa49e('0x1c8'),_0xa49e('0x157'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x3a5593)&&typeof _0x3a5593!==_0xa49e('0x183')){return _0x471c29(msgResponse(_0xa49e('0x1c8'),'Failure',_0xa49e('0x1c9')));}_0x4378ae[_0xa49e('0xc6')](_0x5aece4,_0x3a5593[_0xa49e('0x120')],_0x31798c)['then'](function(_0x5a42ea){if(_0x5a42ea[_0xa49e('0x132')]==0x1)_0x8dcac=!![];switch(_0x3a5593['reason']){case'0':_0x31798c[_0xa49e('0x68')]+=0x1;_0x5aece4[_0xa49e('0xb2')]=0x0;_0x5aece4[_0xa49e('0xb3')]=_0xa49e('0x1ca');_0x5aece4[_0xa49e('0x103')]+=0x1;_0x5aece4[_0xa49e('0x112')]+=0x1;ami[_0xa49e('0x50')]('custom:agentnosuchnumber',ut['buildObj'](_0x21561e,_0xa49e('0x1cb')));_0x284d4b=_0x31798c[_0xa49e('0x1c2')];_0x35c2be=_0x31798c[_0xa49e('0x12e')];_0x4378ae[_0xa49e('0xda')](_0x5aece4)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x101')));if(_0x4378ae[_0xa49e('0x1ba')](0x0,_0x21561e,_0x31798c)&&!_0x8dcac){if(_0x5aece4['countnosuchnumberretry']>=_0x31798c[_0xa49e('0x1c1')]){_0x4378ae[_0xa49e('0x10a')](_0x5aece4,_0x2c5e2b,_0x471c29,'reason\x200\x20no\x20such\x20number....');}else{_0x4378ae['stateGlobal'](_0x5aece4,_0x2c5e2b,_0x471c29,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x31798c[_0xa49e('0x67')]+=0x1;_0x5aece4[_0xa49e('0xb2')]=0x3;_0x5aece4[_0xa49e('0xb3')]=_0xa49e('0x1cc');_0x5aece4['countnoanswerretry']+=0x1;_0x5aece4[_0xa49e('0x112')]+=0x1;var _0x3f4145=ut[_0xa49e('0x1cd')](_0x21561e,_0x31798c);ami[_0xa49e('0x50')]('custom:agentnoanswer',_0x3f4145);_0x284d4b=_0x31798c['dialNoAnswerRetryFrequency'];_0x35c2be=_0x31798c[_0xa49e('0x12e')];_0x4378ae[_0xa49e('0xda')](_0x5aece4)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x1ce')));if(_0x4378ae[_0xa49e('0x1ba')](0x3,_0x21561e,_0x31798c)&&!_0x8dcac){if(_0x5aece4[_0xa49e('0x114')]>=_0x31798c[_0xa49e('0x1bb')]){_0x4378ae[_0xa49e('0x10a')](_0x5aece4,_0x2c5e2b,_0x471c29,_0xa49e('0x1cf'));}else{_0x4378ae['stateGlobal'](_0x5aece4,_0x2c5e2b,_0x471c29,_0xa49e('0x1cf'));}}break;case'5':_0x31798c[_0xa49e('0x62')]+=0x1;_0x5aece4[_0xa49e('0xb2')]=0x5;_0x5aece4['statedesc']=_0xa49e('0x1d0');_0x5aece4[_0xa49e('0x113')]+=0x1;_0x5aece4['countglobal']+=0x1;ami[_0xa49e('0x50')](_0xa49e('0x1d1'),ut[_0xa49e('0xfa')](_0x21561e,'busy'));_0x284d4b=_0x31798c[_0xa49e('0x1d2')];_0x35c2be=_0x31798c['callAdditionalPhoneAfterMin'];_0x4378ae[_0xa49e('0xda')](_0x5aece4)['catch'](loggerCatch(_0xa49e('0x1d3')));if(_0x4378ae[_0xa49e('0x1ba')](0x5,_0x21561e,_0x31798c)&&!_0x8dcac){if(_0x5aece4[_0xa49e('0x113')]>=_0x31798c[_0xa49e('0x1d4')]){_0x4378ae['createStateFinal'](_0x5aece4,_0x2c5e2b,_0x471c29,_0xa49e('0x1d5'));}else{_0x4378ae[_0xa49e('0x108')](_0x5aece4,_0x2c5e2b,_0x471c29,_0xa49e('0x1d5'));}}break;case'8':_0x31798c['outboundCongestionCallsDay']+=0x1;_0x5aece4[_0xa49e('0xb2')]=0x8;_0x5aece4[_0xa49e('0xb3')]='Congestion';_0x5aece4['countcongestionretry']+=0x1;_0x5aece4['countglobal']+=0x1;_0x284d4b=_0x31798c['dialCongestionRetryFrequency'];_0x35c2be=_0x31798c[_0xa49e('0x12e')];ami[_0xa49e('0x50')]('custom:agentcongestion',ut[_0xa49e('0xfa')](_0x21561e,_0xa49e('0x1d6')));_0x4378ae[_0xa49e('0xda')](_0x5aece4)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x1d7')));if(_0x4378ae[_0xa49e('0x1ba')](0x8,_0x21561e,_0x31798c)&&!_0x8dcac){if(_0x5aece4[_0xa49e('0x102')]>=_0x31798c[_0xa49e('0x1bf')]){_0x4378ae[_0xa49e('0x10a')](_0x5aece4,_0x2c5e2b,_0x471c29,'reason\x208\x20congestion');}else{_0x4378ae[_0xa49e('0x108')](_0x5aece4,_0x2c5e2b,_0x471c29,'reason\x208\x20congestion');}}break;case'11':_0x31798c[_0xa49e('0x1d8')]+=0x1;_0x5aece4['state']=0xb;_0x5aece4[_0xa49e('0xb3')]='Abandoned';_0x5aece4[_0xa49e('0x105')]+=0x1;_0x5aece4[_0xa49e('0x112')]+=0x1;_0x284d4b=_0x31798c[_0xa49e('0x138')];_0x35c2be=_0x31798c[_0xa49e('0x12e')];_0x4378ae[_0xa49e('0xda')](_0x5aece4)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x1d9')));if(_0x4378ae['checkRetriveMax'](0xb,_0x21561e,_0x31798c)&&!_0x8dcac){if(_0x5aece4['countabandonedretry']>=_0x31798c[_0xa49e('0x1c4')]){_0x4378ae[_0xa49e('0x10a')](_0x5aece4,_0x2c5e2b,_0x471c29,_0xa49e('0x1da'));}else{_0x4378ae[_0xa49e('0x108')](_0x5aece4,_0x2c5e2b,_0x471c29,_0xa49e('0x1da'));}}break;case'20':_0x31798c[_0xa49e('0x1db')]+=0x1;_0x5aece4[_0xa49e('0xb2')]=0x14;_0x5aece4[_0xa49e('0xb3')]=_0xa49e('0x1dc');_0x5aece4[_0xa49e('0x107')]+=0x1;_0x5aece4['countglobal']+=0x1;_0x284d4b=_0x31798c['dialAgentRejectRetryFrequency'];_0x35c2be=_0x31798c[_0xa49e('0x12e')];ami['emit'](_0xa49e('0x1dd'),ut[_0xa49e('0xfa')](_0x21561e,_0xa49e('0x1de')));_0x4378ae[_0xa49e('0xda')](_0x5aece4)[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x1df')));if(_0x4378ae[_0xa49e('0x1ba')](0x14,_0x21561e,_0x31798c)&&!_0x8dcac){if(_0x5aece4['countagentrejectretry']>=_0x31798c['dialAgentRejectMaxRetry']){_0x4378ae[_0xa49e('0x10a')](_0x5aece4,_0x2c5e2b,_0x471c29,_0xa49e('0x1e0'));}else{_0x4378ae['stateGlobal'](_0x5aece4,_0x2c5e2b,_0x471c29,'reason\x2020\x20agentreject');}}break;default:_0x31798c[_0xa49e('0x6b')]+=0x1;_0x5aece4[_0xa49e('0xb2')]=0xc;_0x5aece4[_0xa49e('0xb3')]=_0x3a5593[_0xa49e('0x120')];_0x284d4b=_0x31798c[_0xa49e('0x1c6')];_0x35c2be=_0x31798c[_0xa49e('0x12e')];_0x4378ae[_0xa49e('0xda')](_0x5aece4)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x4378ae[_0xa49e('0x1ba')](_0x3a5593[_0xa49e('0x120')],_0x21561e,_0x31798c)&&!_0x8dcac){if(_0x5aece4[_0xa49e('0x113')]+_0x5aece4[_0xa49e('0x102')]+_0x5aece4['countnoanswerretry']+_0x5aece4['countnosuchnumberretry']+_0x5aece4[_0xa49e('0x104')]+_0x5aece4[_0xa49e('0x105')]+_0x5aece4[_0xa49e('0x106')]+_0x5aece4[_0xa49e('0x107')]>=_0x31798c['dialGlobalMaxRetry']){_0x4378ae[_0xa49e('0x108')](_0x5aece4,_0x2c5e2b,_0x471c29,_0x3a5593[_0xa49e('0x120')]);}else{_0x4378ae[_0xa49e('0x10a')](_0x5aece4,_0x2c5e2b,_0x471c29,_0x3a5593[_0xa49e('0x120')]);}}}})[_0xa49e('0x3f')](function(){if(_0x8dcac){_0x4378ae[_0xa49e('0xc8')](_0x5aece4,_0x284d4b,_0x35c2be)[_0xa49e('0x3f')](function(){return _0x2c5e2b(0x1);});}});});};Dialer['prototype'][_0xa49e('0x108')]=function(_0x52cf89,_0x450cd9,_0x4a541d,_0x1cb1b1){var _0x5a292f=new Final(_0x52cf89);_0x5a292f['state']=0xf;_0x5a292f['statedesc']=_0xa49e('0x1e1');this[_0xa49e('0x10a')](_0x5a292f,_0x450cd9,_0x4a541d,_0x1cb1b1);};Dialer['prototype'][_0xa49e('0x10a')]=function(_0x8aca7c,_0xdfabdd,_0x62de04,_0x2c601a){this[_0xa49e('0xd8')](_0x8aca7c)[_0xa49e('0x3f')](function(){return _0xdfabdd(msgResponse('[callProgressDetecting]','Success',_0x2c601a));})[_0xa49e('0xc2')](function(){return _0x62de04(msgResponse(_0xa49e('0x1e2'),_0xa49e('0x157'),_0xa49e('0x1e3')));});};Dialer[_0xa49e('0xb8')][_0xa49e('0x9')]=function(_0x3a7438){var _0xaa038f=_0x3a7438[_0xa49e('0x1e4')]/0x64;var _0x282db0=_0x3a7438['outboundDropCallsDayTimeout']/(_0x3a7438['outboundDropCallsDayTimeout']+_0x3a7438[_0xa49e('0x60')]);var _0x5d293f=Math[_0xa49e('0x1e5')](_0x3a7438[_0xa49e('0x73')]*(_0x3a7438['predictiveIntervalMaxThreshold']/0x64));var _0x337d25=Math[_0xa49e('0x1e5')](_0x3a7438['predictiveIntervalAvailable']*(_0x3a7438['predictiveIntervalMinThreshold']/0x64));var _0x12e97c=_0x3a7438[_0xa49e('0x55')]+_0x3a7438['talking'];var _0x1218ba=Math[_0xa49e('0x1e6')](_0x3a7438['erlangCalls']*_0x3a7438['erlangAbandonmentRate']*_0x3a7438[_0xa49e('0x1e7')]*_0x3a7438[_0xa49e('0x1e8')]);if(_[_0xa49e('0x41')](_0x3a7438['startProgressive'])){if(!_[_0xa49e('0x41')](_0x3a7438[_0xa49e('0x79')])){_0x3a7438[_0xa49e('0x79')]=undefined;loggerPredictive['error'](_0xa49e('0x1e9'),_0xa49e('0x1ea'));}if(!_['isUndefined'](_0x3a7438[_0xa49e('0x98')])){loggerPredictive[_0xa49e('0xa0')](_0xa49e('0x1e9'),_0xa49e('0x1eb'));clearInterval(_0x3a7438[_0xa49e('0x98')]);_0x3a7438['handlePredictive']=undefined;}_0x3a7438[_0xa49e('0x95')]=moment()[_0xa49e('0x7d')](_0xa49e('0x10d'));loggerPredictive[_0xa49e('0x83')](_0x3a7438[_0xa49e('0x42')],_0xa49e('0x1ec'),_0x3a7438[_0xa49e('0x95')]);this[_0xa49e('0x169')](_0x3a7438,0x1);}else if(ifInterval(_0x3a7438[_0xa49e('0x1ed')],_0x3a7438[_0xa49e('0x95')])){this[_0xa49e('0x169')](_0x3a7438,0x1);loggerPredictiveCalls[_0xa49e('0x83')](_0xa49e('0x1ee'),_0x3a7438[_0xa49e('0x95')],_0x3a7438[_0xa49e('0x42')]);_0x3a7438[_0xa49e('0x76')]=0x0;_0x3a7438[_0xa49e('0x71')]=0x0;}else if(_0xaa038f<_0x282db0&&_0x3a7438[_0xa49e('0x1ef')]===_0xa49e('0x1f0')){freeVariablesPredictive(_0x3a7438);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x1f1'),'Dropped\x20calls\x20day',_0x282db0,_0xa49e('0x95'),_0x3a7438['name']);}else if(_0x1218ba<_0x3a7438['predictiveIntervalErlangCallsDroppedCalls']&&_0x3a7438[_0xa49e('0x1ef')]===_0xa49e('0x1f0')){freeVariablesPredictive(_0x3a7438);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x1f2'),_0xa49e('0x1f3'),_0x1218ba,'Drop\x20in\x20this\x20interval',_0x3a7438['predictiveIntervalErlangCallsDroppedCalls'],_0xa49e('0x95'),_0x3a7438[_0xa49e('0x42')]);}else if(!ifInterval(_0x3a7438[_0xa49e('0x1ed')],_0x3a7438[_0xa49e('0x95')])&&_[_0xa49e('0x41')](_0x3a7438[_0xa49e('0x79')])&&!_['isUndefined'](_0x3a7438['startProgressive'])){_0x3a7438[_0xa49e('0x79')]=moment()[_0xa49e('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa49e('0x83')](_0x3a7438[_0xa49e('0x42')],_0xa49e('0x1f4'),_0x3a7438['startPredictive']);this['averageHandleTime'](_0x3a7438[_0xa49e('0x1ed')])['then'](this[_0xa49e('0x1f5')](_0x3a7438))[_0xa49e('0x3f')](mergeDataErlangB(_0x3a7438))[_0xa49e('0x3f')](this['startMethodPredictive'](_0x3a7438))['catch'](loggerCatchPredictive(_0xa49e('0x1f6'),_0x3a7438));}else if(!ifInterval(_0x3a7438['dialPredictiveInterval'],_0x3a7438[_0xa49e('0x79')])){_0x3a7438[_0xa49e('0x71')]=0x0;_0x3a7438[_0xa49e('0x79')]=moment()[_0xa49e('0x7d')](_0xa49e('0x10d'));loggerPredictive[_0xa49e('0x83')](_0x3a7438[_0xa49e('0x42')],_0xa49e('0x1f7'),_0x3a7438[_0xa49e('0x79')]);clearInterval(_0x3a7438[_0xa49e('0x98')]);_0x3a7438['handlePredictive']=undefined;this[_0xa49e('0xcc')](_0x3a7438[_0xa49e('0x1ed')])[_0xa49e('0x3f')](this[_0xa49e('0x1f5')](_0x3a7438))[_0xa49e('0x3f')](mergeDataErlangB(_0x3a7438))[_0xa49e('0x3f')](this[_0xa49e('0x1f8')](_0x3a7438))[_0xa49e('0xc2')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3a7438));}else if(_0x3a7438[_0xa49e('0x73')]&&_0x12e97c<_0x3a7438[_0xa49e('0x73')]-_0x337d25){freeVariablesPredictive(_0x3a7438);loggerPredictive[_0xa49e('0x83')](_0x3a7438[_0xa49e('0x42')],_0xa49e('0x1f9'),_0x12e97c,_0xa49e('0x1fa'),_0x3a7438[_0xa49e('0x73')],'-',_0x337d25,'=',_0x3a7438[_0xa49e('0x73')]-_0x337d25,')');}else if(_0x3a7438['predictiveIntervalAvailable']&&_0x12e97c>_0x3a7438[_0xa49e('0x73')]+_0x5d293f){freeVariablesPredictive(_0x3a7438);loggerPredictive[_0xa49e('0x83')](_0x3a7438[_0xa49e('0x42')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x12e97c,')\x20are\x20more\x20than\x20threshold\x20(',_0x3a7438[_0xa49e('0x73')],'+',_0x5d293f,'=',_0x3a7438[_0xa49e('0x73')]+_0x5d293f,')');}};Dialer[_0xa49e('0xb8')][_0xa49e('0x1f5')]=function(_0x3ae34d){var _0x4c58c3=this;return function(_0x19e255){return new Promise(function(_0x31e331,_0x32e84c){_[_0xa49e('0xe1')](_0x3ae34d,_0x19e255[0x0]);if(checkGetDataPredictive(_0x19e255[0x0])){var _0x225070=_0x3ae34d[_0xa49e('0x73')]=_0x3ae34d[_0xa49e('0x58')]+_0x3ae34d[_0xa49e('0x55')];var _0x5f4a49=_0x3ae34d[_0xa49e('0x1ed')]*0x3c;var _0x18c6ff=_0x19e255[0x0][_0xa49e('0x6d')]+_0x19e255[0x0][_0xa49e('0x8b')];var _0x359b38=(_0x19e255[0x0][_0xa49e('0x6c')]+_0x19e255[0x0][_0xa49e('0x6f')]+_0x19e255[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x19e255[0x0][_0xa49e('0x74')];_0x3ae34d[_0xa49e('0x1e7')]=_0x359b38>0x0?_0x359b38:0x1;switch(_0x3ae34d['dialPredictiveOptimization']){case _0xa49e('0x1f0'):var _0x588a91=_0x3ae34d[_0xa49e('0x1e4')]/0x64;return _0x4c58c3[_0xa49e('0x1fb')](_0x225070,_0x5f4a49,_0x18c6ff,_0x359b38,_0x588a91)[_0xa49e('0x3f')](function(_0x4ffcf7){return _0x31e331(_0x4ffcf7);});case _0xa49e('0x1fc'):var _0x2800f5=_0x3ae34d['dialPredictiveOptimizationPercentage']/0x64;return _0x4c58c3[_0xa49e('0x1fd')](_0x225070,_0x5f4a49,_0x18c6ff,_0x359b38,_0x2800f5)['then'](function(_0x986331){return _0x31e331(_0x986331);});default:return _0x32e84c(msgResponse(_0xa49e('0x1fe'),_0xa49e('0x157'),_0xa49e('0x1ff')));}}else{return _0x32e84c(msgResponse('[getDataPredictive]',_0xa49e('0x157'),_0xa49e('0x200')));}});};};Dialer[_0xa49e('0xb8')][_0xa49e('0x201')]=function(_0x585d40){var _0x42e670=this;return function(_0x30955d){return new Promise(function(_0x142479,_0x141431){_['merge'](_0x585d40,_0x30955d[0x0]);if(checkGetDataPredictive(_0x30955d[0x0])){loggerPredictive[_0xa49e('0x83')](JSON[_0xa49e('0x4d')](_0x30955d[0x0]));if(_0x585d40[_0xa49e('0x1ef')]===_0xa49e('0x1f0')){return _0x42e670['getVoiceQueueRtPauses'](_0x585d40['id'])[_0xa49e('0x3f')](function(_0x1c3f71){var _0x4ea211=_0x585d40['loggedIn']-_0x1c3f71[0x0]['outboundQueuePauses'];var _0x112bc1=_0x585d40[_0xa49e('0x1ed')]*0x3c;var _0x147e73=_0x30955d[0x0][_0xa49e('0x6d')]+_0x30955d[0x0][_0xa49e('0x8b')];var _0x3b1268=(_0x30955d[0x0][_0xa49e('0x6c')]+_0x30955d[0x0][_0xa49e('0x6f')]+_0x30955d[0x0][_0xa49e('0x6e')])/_0x30955d[0x0]['predictiveIntervalTotalCalls'];var _0x500504=_0x585d40[_0xa49e('0x1e4')]/0x64;_0x585d40[_0xa49e('0x72')]=_0x1c3f71[0x0]['outboundQueuePauses']||0x0;_0x585d40[_0xa49e('0x1e7')]=_0x3b1268>0x0?_0x3b1268:0x1;return _0x42e670[_0xa49e('0x1fb')](_0x4ea211,_0x112bc1,_0x147e73,_0x3b1268,_0x500504);})[_0xa49e('0x3f')](function(_0x3bf6f6){return _0x142479(_0x3bf6f6);})[_0xa49e('0xc2')](function(_0x2ded05){return _0x141431(msgResponse(_0xa49e('0x202'),_0xa49e('0x157'),JSON[_0xa49e('0x4d')](_0x2ded05)));});}if(_0x585d40[_0xa49e('0x1ef')]===_0xa49e('0x1fc')){return _0x42e670[_0xa49e('0xd6')](_0x585d40['id'])[_0xa49e('0x3f')](function(_0x4ccd85){var _0x782829=_0x585d40['loggedIn']-_0x4ccd85[0x0]['outboundQueuePauses'];var _0x4ff844=_0x585d40[_0xa49e('0x1ed')]*0x3c;var _0x22c910=_0x30955d[0x0][_0xa49e('0x6d')]+_0x30955d[0x0]['predictiveIntervalAvgHoldtime'];var _0x3235d3=(_0x30955d[0x0]['predictiveIntervalAnsweredCalls']+_0x30955d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x30955d[0x0][_0xa49e('0x6e')])/_0x30955d[0x0][_0xa49e('0x74')];var _0x12f056=_0x585d40[_0xa49e('0x1e4')]/0x64;_0x585d40[_0xa49e('0x72')]=_0x4ccd85[0x0][_0xa49e('0x203')]||0x0;_0x585d40[_0xa49e('0x1e7')]=_0x3235d3>0x0?_0x3235d3:0x1;return _0x42e670[_0xa49e('0x1fd')](_0x782829,_0x4ff844,_0x22c910,_0x3235d3,_0x12f056);})['then'](function(_0x2ffbbb){return _0x142479(_0x2ffbbb);})[_0xa49e('0xc2')](function(_0x40b1d6){return _0x141431(msgResponse(_0xa49e('0x202'),_0xa49e('0x157'),JSON[_0xa49e('0x4d')](_0x40b1d6)));});}}else{return _0x141431(msgResponse(_0xa49e('0x1fe'),_0xa49e('0x157'),_0xa49e('0x200')));}});};};Dialer[_0xa49e('0xb8')][_0xa49e('0x1f8')]=function(_0x5074fb){var _0x4155db=this;return function(){var _0x6975ba=0x0;var _0x534ec0=Math['floor'](_0x5074fb[_0xa49e('0x77')]*0x3e8);if(_0x534ec0>0x0){_0x534ec0=_0x534ec0<0x64?0x64:_0x534ec0;loggerPredictive[_0xa49e('0x83')](_0x5074fb[_0xa49e('0x42')],'one\x20call\x20every:',_0x534ec0,_0xa49e('0x4e'));_0x5074fb['handlePredictive']=setInterval(function(){_0x4155db['handlePredictive'](_0x5074fb);loggerPredictiveCalls[_0xa49e('0x83')]('[handlePredictive]',_0x6975ba+=0x1);},_0x534ec0);}else{loggerPredictive[_0xa49e('0x83')](_0x5074fb[_0xa49e('0x42')],_0xa49e('0x204'));}};};Dialer[_0xa49e('0xb8')][_0xa49e('0x205')]=function(_0x56a905,_0x2a4223){var _0x3d464a=this;return function(_0x155640){if(_[_0xa49e('0x82')](_0x155640)){if(_['isNil'](_0x2a4223['UserId'])||!_0x2a4223[_0xa49e('0x206')]){if(_0x56a905[_0xa49e('0x167')]===_0xa49e('0x8')){_0x56a905[_0xa49e('0x207')]=_['isUndefined'](_0x56a905[_0xa49e('0x207')])?!![]:_0x56a905['queueStatusComplete'];var _0x147fdd=uuid['v4']();_0x3d464a[_0xa49e('0x25')][_0x147fdd]=new Action(_0x56a905,_0x2a4223,_0x147fdd);loggerBooked[_0xa49e('0x83')](_0xa49e('0x208'),_0x147fdd,_0xa49e('0x209'),JSON[_0xa49e('0x4d')](_0x56a905[_0xa49e('0x207')]),_0xa49e('0x20a'),_0x56a905[_0xa49e('0x42')]);if(_0x56a905[_0xa49e('0x207')]){_0x56a905['queueStatusComplete']=![];_0x3d464a['queueBooked'][_0x3d464a[_0xa49e('0x25')][_0x147fdd][_0xa49e('0xbd')]]=[];ami[_0xa49e('0xba')]({'actionid':_0x147fdd,'action':_0xa49e('0x20b'),'queue':_0x56a905[_0xa49e('0x42')]})[_0xa49e('0xc2')](function(){_0x3d464a[_0xa49e('0xdc')](_0x56a905);_0x3d464a['rescheduleContact']({'active':![],'ContactId':_0x3d464a[_0xa49e('0x25')][_0x147fdd][_0xa49e('0xe3')],'ListId':_0x3d464a[_0xa49e('0x25')][_0x147fdd][_0xa49e('0x10e')],'VoiceQueueId':_0x3d464a[_0xa49e('0x25')][_0x147fdd]['VoiceQueueId']||undefined,'CampaignId':_0x3d464a[_0xa49e('0x25')][_0x147fdd]['CampaignId']||undefined})[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x20c')));delete _0x3d464a[_0xa49e('0x25')][_0x147fdd];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0xa49e('0x4d')](_0x56a905['queueStatusComplete']),_0xa49e('0x20a'),_0x56a905[_0xa49e('0x42')]);_0x3d464a[_0xa49e('0xdc')](_0x56a905);_0x3d464a[_0xa49e('0xce')]({'active':![],'ContactId':_0x3d464a[_0xa49e('0x25')][_0x147fdd][_0xa49e('0xe3')],'ListId':_0x3d464a['actions'][_0x147fdd]['ListId'],'VoiceQueueId':_0x3d464a[_0xa49e('0x25')][_0x147fdd][_0xa49e('0x118')]||undefined,'CampaignId':_0x3d464a[_0xa49e('0x25')][_0x147fdd][_0xa49e('0xe5')]||undefined})['catch'](loggerCatch(_0xa49e('0x20c')));delete _0x3d464a[_0xa49e('0x25')][_0x147fdd];}}else{return _0x3d464a[_0xa49e('0x182')](_0x56a905,_0x2a4223);}}else{if(getDiff(_0x2a4223[_0xa49e('0x20d')])<_0x56a905[_0xa49e('0x20e')]*0x3c){if(_0x2a4223[_0xa49e('0x16f')]&&!_0x2a4223[_0xa49e('0x16f')][_0xa49e('0x20f')]){_0x3d464a['preview'][_0xa49e('0x144')](_0x2a4223['id'])[_0xa49e('0x147')](function(){_0x3d464a[_0xa49e('0xdc')](_0x56a905);});}else{_0x3d464a[_0xa49e('0xd0')]({'active':![]},_0x2a4223['id'],0x1)[_0xa49e('0x147')](function(){_0x3d464a[_0xa49e('0xdc')](_0x56a905);});}}else{_0x56a905[_0xa49e('0x6a')]+=0x1;_0x3d464a[_0xa49e('0xdc')](_0x56a905);if(_0x56a905['dialRecallInQueue']){_0x3d464a[_0xa49e('0xce')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2a4223[_0xa49e('0xe3')],'ListId':_0x2a4223['ListId'],'VoiceQueueId':_0x2a4223[_0xa49e('0x118')]||undefined,'CampaignId':_0x2a4223[_0xa49e('0xe5')]||undefined})[_0xa49e('0xc2')](loggerCatch(_0xa49e('0x210')));_0x3d464a['createHistory'](createObjHistory(_0x56a905,_0x2a4223,'RECALLINQUEUE',0x17,'RecallInQueue'))['catch'](loggerCatch(_0xa49e('0x211')));}else{_0x3d464a['saveInDb'](createObjHistory(_0x56a905,_0x2a4223,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0xa49e('0x212'),_0xa49e('0x213'));}}}}else{_0x56a905[_0xa49e('0x61')]+=0x1;_0x3d464a[_0xa49e('0xee')](createObjHistory(_0x56a905,_0x2a4223,_0xa49e('0x214'),0xd,_0xa49e('0x215')),'[Originate][historyBlacklist]',_0xa49e('0x216'));throw _0xa49e('0x217');}};};Dialer[_0xa49e('0xb8')][_0xa49e('0x173')]=function(_0x2d5e05){var _0x4ad844=this;var _0x2a3b92=_0x2d5e05['limitCalls']-_0x2d5e05['originated']-_0x2d5e05[_0xa49e('0xd3')];emitCampaignSummary(_0x2d5e05);if(_0x2a3b92>0x0){if(_0x2a3b92>this[_0xa49e('0x23')]){_0x2a3b92=this['maxNumberOriginate'];}_0x2d5e05[_0xa49e('0xd3')]+=_0x2a3b92;this[_0xa49e('0xd5')](_0x2d5e05['id'],_0x2a3b92,_0x2d5e05[_0xa49e('0x218')],_0x2d5e05)[_0xa49e('0x3f')](function(_0xdbee2a){_0x2d5e05['temp']-=_0x2a3b92;_0x2d5e05[_0xa49e('0xd3')]=_0x2d5e05[_0xa49e('0xd3')]>0x0?_0x2d5e05['temp']:0x0;if(!checkContactEmpty(_0xdbee2a)){_0x2d5e05[_0xa49e('0x44')]=_0xa49e('0xa9');logger['info']('[getContactCampaign2][Empty]'+_0x2d5e05[_0xa49e('0x42')]);}else{_0x2d5e05['originated']+=_0xdbee2a[_0xa49e('0xa2')];_0x2d5e05[_0xa49e('0x44')]=_0xa49e('0x219');for(var _0x206743=0x0;_0x206743<_0xdbee2a[_0xa49e('0xa2')];_0x206743+=0x1){_0x2d5e05[_0xa49e('0x21a')]+=0x1;if(_[_0xa49e('0xb9')](_0xdbee2a[_0x206743])||_[_0xa49e('0xb9')](_0xdbee2a[_0x206743][_0xa49e('0x1a3')])||_[_0xa49e('0xb9')](_0xdbee2a[_0x206743]['phone'])){_0x4ad844[_0xa49e('0xe0')](_0xa49e('0x21b'),_0x2d5e05,_0xdbee2a[_0x206743]);}else{_0x4ad844[_0xa49e('0xca')](_['pick'](_0xdbee2a[_0x206743],[_0xa49e('0xe5'),'phone']))[_0xa49e('0x3f')](_0x4ad844['checkContactBlack'](_0x2d5e05,_0xdbee2a[_0x206743]))['catch'](_0x4ad844[_0xa49e('0xdf')]('[actionOriginateIvr]\x20',_0x2d5e05));}}}})[_0xa49e('0xc2')](loggerGetContactDialer('[getContactCampaign2]',_0x2d5e05,_0x2a3b92));}};Dialer[_0xa49e('0xb8')][_0xa49e('0x169')]=function(_0x2c8c27,_0x4bcc53){var _0x3fb398=this;var _0xa940f2=[];var _0x3ddb5a=_0x4bcc53>=0x1?_0x4bcc53:0x1;if(_0x2c8c27[_0xa49e('0x167')]===_0xa49e('0x8')){_0x3ddb5a=0x1;}var _0x10e02f=Math[_0xa49e('0x1e6')](_0x2c8c27['available']*_0x3ddb5a)-_0x2c8c27[_0xa49e('0x75')]-_0x2c8c27[_0xa49e('0xd3')];emitVoiceQueueSummary(_0x2c8c27);if(_0x2c8c27[_0xa49e('0x21c')]>0x0){var _0x5598ac=_0x2c8c27[_0xa49e('0x21c')]-_0x2c8c27['originated']-_0x2c8c27[_0xa49e('0x58')]-_0x2c8c27[_0xa49e('0xd3')]-_0x2c8c27['pTalking'];if(_0x10e02f>_0x5598ac){_0x10e02f=_0x5598ac;}}if(_0x10e02f>0x0){if(_0x2c8c27['dialMethod']===_0xa49e('0x8')){_0x10e02f=0x1;}if(_0x10e02f>this[_0xa49e('0x23')]){_0x10e02f=this[_0xa49e('0x23')];}_0x2c8c27[_0xa49e('0xd3')]+=_0x10e02f;for(var _0x1b8fb9 in this[_0xa49e('0x21')]){if(typeof this[_0xa49e('0x21')][_0x1b8fb9]!==_0xa49e('0xa3')){if(this['agents'][_0x1b8fb9]['state']===_0xa49e('0x21d')&&this[_0xa49e('0x21')][_0x1b8fb9][_0xa49e('0xbb')]===_0xa49e('0xec')){_0xa940f2[_0xa49e('0x140')](this[_0xa49e('0x21')][_0x1b8fb9]['id']);}}}this['getContactDialer'](_0x2c8c27['id'],_0xa940f2,_0x10e02f,_0x2c8c27[_0xa49e('0x218')],_0x2c8c27)[_0xa49e('0x3f')](function(_0x55384b){_0x2c8c27[_0xa49e('0xd3')]-=_0x10e02f;_0x2c8c27[_0xa49e('0xd3')]=_0x2c8c27[_0xa49e('0xd3')]>0x0?_0x2c8c27[_0xa49e('0xd3')]:0x0;if(!checkContactEmpty(_0x55384b)){_0x3fb398['countReScheduled'](_0x2c8c27)[_0xa49e('0x3f')](sendMessageReschedule(_0x2c8c27))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xc3')));}else{_0x2c8c27[_0xa49e('0x75')]+=_0x55384b[_0xa49e('0xa2')];_0x2c8c27[_0xa49e('0x44')]=_0x2c8c27[_0xa49e('0x167')]==='booked'?_0xa49e('0x18f'):_0xa49e('0x219');for(var _0x2ca2af=0x0;_0x2ca2af<_0x55384b[_0xa49e('0xa2')];_0x2ca2af+=0x1){if(_[_0xa49e('0xb9')](_0x55384b[_0x2ca2af])||_[_0xa49e('0xb9')](_0x55384b[_0x2ca2af]['Contact'])||_[_0xa49e('0xb9')](_0x55384b[_0x2ca2af]['phone'])){_0x3fb398['emptyContact'](_0xa49e('0x21b'),_0x2c8c27,_0x55384b[_0x2ca2af]);}else{_0x3fb398['checkIsBlackList'](_['pick'](_0x55384b[_0x2ca2af],[_0xa49e('0x118'),_0xa49e('0x186')]))['then'](_0x3fb398[_0xa49e('0x205')](_0x2c8c27,_0x55384b[_0x2ca2af]))[_0xa49e('0xc2')](_0x3fb398[_0xa49e('0xdf')](_0xa49e('0x21b'),_0x2c8c27));}}}})[_0xa49e('0xc2')](loggerGetContactDialer(_0xa49e('0x21e'),_0x2c8c27,_0x10e02f));}};Dialer['prototype'][_0xa49e('0x98')]=function(_0xa652bc){if(_0xa652bc[_0xa49e('0x21c')]>0x0){var _0x19038f=_0xa652bc[_0xa49e('0x21c')]-_0xa652bc[_0xa49e('0x75')]-_0xa652bc['talking'];if(_0x19038f>0x0){this[_0xa49e('0x21f')](_0xa652bc);}else{loggerPredictiveCalls['info'](_0xa49e('0x220'));}}else{this[_0xa49e('0x21f')](_0xa652bc);}};Dialer[_0xa49e('0xb8')]['tryOriginatePredictive']=function(_0x5b2759){var _0x5bf045=this;var _0x14a024=[];_0x5b2759['originated']+=0x1;for(var _0x3a12c4 in this[_0xa49e('0x21')]){if(typeof this[_0xa49e('0x21')][_0x3a12c4]!==_0xa49e('0xa3')){if(this[_0xa49e('0x21')][_0x3a12c4]['state']===_0xa49e('0x21d')&&this[_0xa49e('0x21')][_0x3a12c4][_0xa49e('0xbb')]===_0xa49e('0xec')){_0x14a024[_0xa49e('0x140')](this[_0xa49e('0x21')][_0x3a12c4]['id']);}}}this[_0xa49e('0xd2')](_0x5b2759['id'],_0x14a024,0x1,_0x5b2759[_0xa49e('0x218')],_0x5b2759)[_0xa49e('0x3f')](function(_0x86a166){if(!checkContactEmpty(_0x86a166)){checkContactLowerLimitOriginate(_0x5b2759,0x1,0x0);_0x5bf045[_0xa49e('0xc0')](_0x5b2759)['then'](sendMessageReschedule(_0x5b2759))[_0xa49e('0xc2')](loggerCatch(_0xa49e('0xc3')));}else{_0x5b2759[_0xa49e('0x44')]='RUNNING';if(_['isNil'](_0x86a166[0x0])||_[_0xa49e('0xb9')](_0x86a166[0x0][_0xa49e('0x1a3')])||_[_0xa49e('0xb9')](_0x86a166[0x0][_0xa49e('0x186')])){_0x5bf045[_0xa49e('0xe0')](_0xa49e('0x21b'),_0x5b2759,_0x86a166[0x0]);}else{_0x5bf045[_0xa49e('0xc4')](_['pick'](_0x86a166[0x0],[_0xa49e('0x118'),_0xa49e('0x186')]))[_0xa49e('0x3f')](_0x5bf045[_0xa49e('0x205')](_0x5b2759,_0x86a166[0x0]))[_0xa49e('0xc2')](_0x5bf045[_0xa49e('0xdf')](_0xa49e('0x221'),_0x5b2759));}}})[_0xa49e('0xc2')](loggerGetContactDialer(_0xa49e('0x222'),_0x5b2759,0x1));emitVoiceQueueSummary(_0x5b2759);};Dialer[_0xa49e('0xb8')][_0xa49e('0x1fb')]=function(_0x1dd832,_0x238e05,_0xe8a7fc,_0x31d737,_0x318a2f,_0x360766){loggerPredictive[_0xa49e('0x83')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info']('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',_0x1dd832);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x223'),_0x238e05);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x224'),_0xe8a7fc);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x225'),_0x31d737);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x226'),_0x318a2f);loggerPredictive[_0xa49e('0x83')]('---------------------------');return new Promise(function(_0x4509af,_0x105ef7){if(_0x1dd832<=0x0||isNaN(_0x1dd832)){return _0x105ef7(msgResponse(_0xa49e('0x227'),_0xa49e('0x4c'),'m\x20=\x20'+_0x1dd832));}if(_0xe8a7fc<=0x0||isNaN(_0xe8a7fc)){return _0x105ef7(msgResponse(_0xa49e('0x227'),_0xa49e('0x4c'),'Ts\x20=\x20'+_0xe8a7fc));}if(_0x31d737<=0x0||isNaN(_0x31d737)){return _0x105ef7(msgResponse('[abandonmentRate]','Error','p\x20=\x20'+_0x31d737));}if(_0x238e05<=0x0||isNaN(_0x238e05)){return _0x105ef7(msgResponse(_0xa49e('0x227'),_0xa49e('0x4c'),'interval\x20=\x20'+_0x238e05));}if(_0x318a2f<=0x0||isNaN(_0x318a2f)){return _0x105ef7(msgResponse(_0xa49e('0x227'),'Error',_0xa49e('0x228')+_0x318a2f));}_0x360766=_0x360766||0x0;var _0x773ee8=0x1/_0xe8a7fc;var _0x2c82bb=0x0;var _0x46f6e8=0x0;var _0x5b0a4a=0x0;var _0x419d93=0x0;for(var _0x4fa670=0x0;_0x5b0a4a<_0x318a2f;_0x4fa670+=0x1){_0x46f6e8=_0x4fa670/_0x238e05;_0x2c82bb=(_0x31d737*_0x46f6e8+_0x360766)/_0x773ee8;_0x5b0a4a=erlangb(_0x2c82bb,_0x1dd832);_0x419d93=_0x2c82bb/_0x1dd832*(0x1-erlangb(_0x2c82bb,_0x1dd832));}return _0x4509af({'erlangCalls':_0x4fa670,'erlangCallToSecond':_0x238e05/_0x4fa670,'erlangAbandonmentRate':_0x5b0a4a,'erlangBusyFactor':_0x419d93});});};Dialer[_0xa49e('0xb8')][_0xa49e('0x1fd')]=function(_0x615dbb,_0x14ccf1,_0x69062d,_0x78c895,_0x471f17,_0x3f3dcd){loggerPredictive[_0xa49e('0x83')](_0xa49e('0x229'));loggerPredictive['info']('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',_0x615dbb);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x223'),_0x14ccf1);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x224'),_0x69062d);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x225'),_0x78c895);loggerPredictive[_0xa49e('0x83')](_0xa49e('0x22a'),_0x471f17);loggerPredictive[_0xa49e('0x83')]('---------------------------');return new Promise(function(_0x67a8dd,_0x5c7a82){if(_0x615dbb<=0x0||isNaN(_0x615dbb)){return _0x5c7a82(msgResponse('[busyFactor]','Error','m\x20=\x20'+_0x615dbb));}if(_0x69062d<=0x0||isNaN(_0x69062d)){return _0x5c7a82(msgResponse(_0xa49e('0x22b'),_0xa49e('0x4c'),_0xa49e('0x22c')+_0x69062d));}if(_0x78c895<=0x0||isNaN(_0x78c895)){return _0x5c7a82(msgResponse(_0xa49e('0x22b'),_0xa49e('0x4c'),_0xa49e('0x22d')+_0x78c895));}if(_0x14ccf1<=0x0||isNaN(_0x14ccf1)){return _0x5c7a82(msgResponse(_0xa49e('0x22b'),_0xa49e('0x4c'),'interval\x20=\x20'+_0x14ccf1));}if(_0x471f17<=0x0||isNaN(_0x471f17)){return _0x5c7a82(msgResponse(_0xa49e('0x22b'),_0xa49e('0x4c'),_0xa49e('0x22e')+_0x471f17));}_0x3f3dcd=_0x3f3dcd||0x0;var _0x3ee866=0x1/_0x69062d;var _0x5ed6a7=0x0;var _0x1c1e2b=0x0;var _0x2d1de8=0x0;var _0x1d2ef2=0x0;for(var _0x5980ea=0x0;_0x1d2ef2<_0x471f17;_0x5980ea+=0x1){_0x1c1e2b=_0x5980ea/_0x14ccf1;_0x5ed6a7=(_0x78c895*_0x1c1e2b+_0x3f3dcd)/_0x3ee866;_0x2d1de8=erlangb(_0x5ed6a7,_0x615dbb);_0x1d2ef2=_0x5ed6a7/_0x615dbb*(0x1-erlangb(_0x5ed6a7,_0x615dbb));}return _0x67a8dd({'erlangCalls':_0x5980ea,'erlangCallToSecond':_0x14ccf1/_0x5980ea,'erlangAbandonmentRate':_0x2d1de8,'erlangBusyFactor':_0x1d2ef2});});};module[_0xa49e('0x22f')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 9f48434..6016d25 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9e5=['countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0xbc3542,_0x4de021){var _0x1c88ff=function(_0x1d1fb4){while(--_0x1d1fb4){_0xbc3542['push'](_0xbc3542['shift']());}};_0x1c88ff(++_0x4de021);}(_0xd9e5,0x19d));var _0x5d9e=function(_0x4a597a,_0x494c66){_0x4a597a=_0x4a597a-0x0;var _0x3ec6c1=_0xd9e5[_0x4a597a];return _0x3ec6c1;};'use strict';var util=require(_0x5d9e('0x0'));var _=require(_0x5d9e('0x1'));var moment=require(_0x5d9e('0x2'));function getSeconds(_0x4882c2,_0x2b4546){var _0xebd631=moment(_0x4882c2)['milliseconds'](0x0);var _0x1a6aaa=moment(_0x2b4546)[_0x5d9e('0x3')](0x0);return _0xebd631[_0x5d9e('0x4')](_0x1a6aaa,_0x5d9e('0x5'));}function QueueCallerAbandon(_0x4bad9b,_0x1c3687){this[_0x5d9e('0x6')]=_0x4bad9b['scheduledat'];this[_0x5d9e('0x7')]=_0x4bad9b['type'];this[_0x5d9e('0x8')]=_0x4bad9b['type']==='outbound'?'queue':_0x4bad9b[_0x5d9e('0x7')];this[_0x5d9e('0x9')]=_0x4bad9b[_0x5d9e('0x9')];this[_0x5d9e('0xa')]=_0x4bad9b['countcongestionretry'];this[_0x5d9e('0xb')]=_0x4bad9b['countnoanswerretry'];this['countglobal']=_0x4bad9b[_0x5d9e('0x9')]+_0x4bad9b['countcongestionretry']+_0x4bad9b['countnoanswerretry']+_0x4bad9b['countnosuchnumberretry']+_0x4bad9b[_0x5d9e('0xc')]+_0x4bad9b[_0x5d9e('0xd')]+_0x4bad9b[_0x5d9e('0xe')]+_0x4bad9b[_0x5d9e('0xf')];this[_0x5d9e('0x10')]=_0x4bad9b['countnosuchnumberretry'];this['countdropretry']=_0x4bad9b[_0x5d9e('0xc')];this[_0x5d9e('0xd')]=_0x4bad9b[_0x5d9e('0xd')];this['countmachineretry']=_0x4bad9b[_0x5d9e('0xe')];this[_0x5d9e('0xf')]=_0x4bad9b[_0x5d9e('0xf')];this['uniqueid']=_0x1c3687[_0x5d9e('0x11')];this[_0x5d9e('0x12')]=_0x4bad9b[_0x5d9e('0x13')];this[_0x5d9e('0x14')]=_0x4bad9b[_0x5d9e('0x15')];this['starttime']=_0x4bad9b[_0x5d9e('0x16')];this['responsetime']=_0x4bad9b[_0x5d9e('0x17')];this[_0x5d9e('0x18')]=_0x4bad9b[_0x5d9e('0x18')];this['endtime']=this[_0x5d9e('0x18')];this['ringtime']=getSeconds(_0x4bad9b[_0x5d9e('0x17')],_0x4bad9b['starttime']);this['holdtime']=getSeconds(this[_0x5d9e('0x18')],_0x4bad9b[_0x5d9e('0x17')]);this[_0x5d9e('0x19')]=0x0;this[_0x5d9e('0x1a')]=_0x1c3687[_0x5d9e('0x1a')];this[_0x5d9e('0x1b')]=_0x1c3687['connectedlinename'];this[_0x5d9e('0x1c')]=_0x1c3687['reason'];this[_0x5d9e('0x1d')]=_0x4bad9b[_0x5d9e('0x1d')];this[_0x5d9e('0x1e')]=_0x4bad9b[_0x5d9e('0x1e')];this['callbackat']=_0x4bad9b[_0x5d9e('0x1f')];this[_0x5d9e('0x20')]=_0x4bad9b[_0x5d9e('0x20')];this[_0x5d9e('0x21')]=_0x4bad9b[_0x5d9e('0x21')];this[_0x5d9e('0x22')]=_0x4bad9b[_0x5d9e('0x22')];this[_0x5d9e('0x23')]=_0x4bad9b[_0x5d9e('0x23')];this[_0x5d9e('0x24')]=_0x4bad9b[_0x5d9e('0x24')];this['CampaignId']=_0x4bad9b['CampaignId'];this[_0x5d9e('0x25')]=_0x4bad9b[_0x5d9e('0x25')]||'';this[_0x5d9e('0x26')]=_0x4bad9b[_0x5d9e('0x26')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x1490=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','milliseconds','diff','seconds','scheduledat','type','outbound'];(function(_0x3cbaf5,_0x32988e){var _0x4bc50a=function(_0x1b16ae){while(--_0x1b16ae){_0x3cbaf5['push'](_0x3cbaf5['shift']());}};_0x4bc50a(++_0x32988e);}(_0x1490,0x85));var _0x0149=function(_0x563beb,_0x55746e){_0x563beb=_0x563beb-0x0;var _0x355c1b=_0x1490[_0x563beb];return _0x355c1b;};'use strict';var util=require(_0x0149('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x3335b4,_0x5ea4dd){var _0x40a36a=moment(_0x3335b4)['milliseconds'](0x0);var _0x461386=moment(_0x5ea4dd)[_0x0149('0x1')](0x0);return _0x40a36a[_0x0149('0x2')](_0x461386,_0x0149('0x3'));}function QueueCallerAbandon(_0x5c7e01,_0x1042c3){this[_0x0149('0x4')]=_0x5c7e01[_0x0149('0x4')];this['type']=_0x5c7e01[_0x0149('0x5')];this['campaigntype']=_0x5c7e01['type']===_0x0149('0x6')?'queue':_0x5c7e01[_0x0149('0x5')];this[_0x0149('0x7')]=_0x5c7e01[_0x0149('0x7')];this[_0x0149('0x8')]=_0x5c7e01[_0x0149('0x8')];this[_0x0149('0x9')]=_0x5c7e01['countnoanswerretry'];this['countglobal']=_0x5c7e01['countbusyretry']+_0x5c7e01['countcongestionretry']+_0x5c7e01[_0x0149('0x9')]+_0x5c7e01[_0x0149('0xa')]+_0x5c7e01['countdropretry']+_0x5c7e01['countabandonedretry']+_0x5c7e01[_0x0149('0xb')]+_0x5c7e01[_0x0149('0xc')];this['countnosuchnumberretry']=_0x5c7e01[_0x0149('0xa')];this[_0x0149('0xd')]=_0x5c7e01[_0x0149('0xd')];this[_0x0149('0xe')]=_0x5c7e01['countabandonedretry'];this[_0x0149('0xb')]=_0x5c7e01['countmachineretry'];this[_0x0149('0xc')]=_0x5c7e01[_0x0149('0xc')];this[_0x0149('0xf')]=_0x1042c3[_0x0149('0xf')];this['calleridname']=_0x5c7e01['name'];this['calleridnum']=_0x5c7e01['number'];this[_0x0149('0x10')]=_0x5c7e01[_0x0149('0x10')];this[_0x0149('0x11')]=_0x5c7e01['responsetime'];this[_0x0149('0x12')]=_0x5c7e01[_0x0149('0x12')];this[_0x0149('0x13')]=this['droptime'];this[_0x0149('0x14')]=getSeconds(_0x5c7e01[_0x0149('0x11')],_0x5c7e01[_0x0149('0x10')]);this[_0x0149('0x15')]=getSeconds(this[_0x0149('0x12')],_0x5c7e01[_0x0149('0x11')]);this[_0x0149('0x16')]=0x0;this[_0x0149('0x17')]=_0x1042c3[_0x0149('0x17')];this['membername']=_0x1042c3['connectedlinename'];this['reason']=_0x1042c3[_0x0149('0x18')];this['callback']=_0x5c7e01[_0x0149('0x19')];this[_0x0149('0x1a')]=_0x5c7e01[_0x0149('0x1a')];this[_0x0149('0x1b')]=_0x5c7e01[_0x0149('0x1b')];this[_0x0149('0x1c')]=_0x5c7e01['recallme'];this['ContactId']=_0x5c7e01['ContactId'];this[_0x0149('0x1d')]=_0x5c7e01[_0x0149('0x1d')];this[_0x0149('0x1e')]=_0x5c7e01[_0x0149('0x1e')];this[_0x0149('0x1f')]=_0x5c7e01[_0x0149('0x1f')];this[_0x0149('0x20')]=_0x5c7e01[_0x0149('0x20')];this[_0x0149('0x21')]=_0x5c7e01[_0x0149('0x21')]||'';this['originatecalleridname']=_0x5c7e01['originatecalleridname']||'';}module[_0x0149('0x22')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 8719bb4..7aa1087 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(_0x347280,_0x317f0a){var _0x19c853=function(_0x2a3020){while(--_0x2a3020){_0x347280['push'](_0x347280['shift']());}};_0x19c853(++_0x317f0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x585108,_0x40d64d){var _0x45be5d=function(_0x5a7560){while(--_0x5a7560){_0x585108['push'](_0x585108['shift']());}};_0x45be5d(++_0x40d64d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 448ff48..61ec6f2 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 _0xacb2=['faxAccounts','trunks','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','exten','localstationid','channel','uniqueid','name','info','\x20syncNewchannel\x20','actions','variable','hasOwnProperty','channelstate','channelstatedesc','value','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','notify','fax','.pdf','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','catch','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','then','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxMessage','channels'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xacb2,0x1de));var _0x2acb=function(_0x47b260,_0x79312c){_0x47b260=_0x47b260-0x0;var _0x1cae35=_0xacb2[_0x47b260];return _0x1cae35;};'use strict';var util=require(_0x2acb('0x0'));var _=require(_0x2acb('0x1'));var BPromise=require(_0x2acb('0x2'));var uuid=require('uuid');var moment=require(_0x2acb('0x3'));var path=require(_0x2acb('0x4'));var tiff2pdf=require(_0x2acb('0x5'));var gs=require(_0x2acb('0x6'));var logger=require('../../../config/logger')('fax');var ami=require(_0x2acb('0x7'));var rpcDb=require(_0x2acb('0x8'));var Channel=require(_0x2acb('0x9'));var ut=require(_0x2acb('0xa'));var Action=require(_0x2acb('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x2acb('0xc'));function Fax(_0x5aa61b){this[_0x2acb('0xd')]={};this[_0x2acb('0xe')]=_0x5aa61b['faxAccounts'];this[_0x2acb('0xf')]=_0x5aa61b['trunks'];this['actions']={};ami['on']('newchannel',this[_0x2acb('0x10')][_0x2acb('0x11')](this));ami['on'](_0x2acb('0x12'),this[_0x2acb('0x13')][_0x2acb('0x11')](this));ami['on'](_0x2acb('0x14'),this[_0x2acb('0x15')][_0x2acb('0x11')](this));ami['on'](_0x2acb('0x16'),this[_0x2acb('0x17')][_0x2acb('0x11')](this));ami['on'](_0x2acb('0x18'),this[_0x2acb('0x19')][_0x2acb('0x11')](this));ami['on'](_0x2acb('0x1a'),this[_0x2acb('0x1b')]['bind'](this));ami['on'](_0x2acb('0x1c'),this[_0x2acb('0x1d')]['bind'](this));ami['on'](_0x2acb('0x1e'),this[_0x2acb('0x1f')][_0x2acb('0x11')](this));}Fax[_0x2acb('0x20')]['syncNewchannel']=function(_0x85871e){if(_0x85871e[_0x2acb('0x21')]===_0x2acb('0x22')){for(var _0x14d720 in this[_0x2acb('0xe')]){if(this[_0x2acb('0xe')]['hasOwnProperty'](_0x14d720)){if(_0x85871e[_0x2acb('0x23')]===this['faxAccounts'][_0x14d720][_0x2acb('0x24')]){this[_0x2acb('0xd')][_0x85871e['uniqueid']]={};this[_0x2acb('0xd')][_0x85871e['uniqueid']][_0x2acb('0x25')]=_0x85871e['channel'];this[_0x2acb('0xd')][_0x85871e['uniqueid']]['id']=this[_0x2acb('0xe')][_0x14d720]['id'];this[_0x2acb('0xd')][_0x85871e[_0x2acb('0x26')]][_0x2acb('0x27')]=this[_0x2acb('0xe')][_0x14d720][_0x2acb('0x27')];logger[_0x2acb('0x28')](_0x85871e['uniqueid'],_0x2acb('0x29'));}}}}if(this[_0x2acb('0x2a')][_0x85871e[_0x2acb('0x26')]]){this[_0x2acb('0xd')][_0x85871e[_0x2acb('0x26')]]={};this[_0x2acb('0xd')][_0x85871e[_0x2acb('0x26')]]['channel']=_0x85871e[_0x2acb('0x25')];logger[_0x2acb('0x28')](_0x85871e[_0x2acb('0x26')],'\x20syncNewchannel\x20');}};Fax[_0x2acb('0x20')][_0x2acb('0x13')]=function(_0x570210){if(this['channels'][_0x570210[_0x2acb('0x26')]]){for(var _0x23a6d0 in _0x570210[_0x2acb('0x2b')]){if(_0x570210[_0x2acb('0x2b')][_0x2acb('0x2c')](_0x23a6d0)){this['channels'][_0x570210[_0x2acb('0x26')]][_0x23a6d0]=_0x570210['value'];}}}};Fax[_0x2acb('0x20')][_0x2acb('0x15')]=function(_0x222131){if(this[_0x2acb('0xd')][_0x222131[_0x2acb('0x26')]]){this[_0x2acb('0xd')][_0x222131[_0x2acb('0x26')]][_0x2acb('0x2d')]=_0x222131[_0x2acb('0x2d')];this['channels'][_0x222131[_0x2acb('0x26')]][_0x2acb('0x2e')]=_0x222131[_0x2acb('0x2e')];}};Fax[_0x2acb('0x20')]['syncNewExten']=function(_0x5334e6){if(this[_0x2acb('0xd')][_0x5334e6[_0x2acb('0x26')]]){for(var _0x28821b in _0x5334e6[_0x2acb('0x2b')]){if(_0x5334e6[_0x2acb('0x2b')][_0x2acb('0x2c')](_0x28821b)){this['channels'][_0x5334e6[_0x2acb('0x26')]][_0x28821b]=_0x5334e6[_0x2acb('0x2f')];}}}};Fax[_0x2acb('0x20')]['syncFaxStatus']=function(_0x1982de){if(this[_0x2acb('0xd')][_0x1982de[_0x2acb('0x26')]]){this['channels'][_0x1982de[_0x2acb('0x26')]][_0x2acb('0x30')]=_0x1982de[_0x2acb('0x30')];this['channels'][_0x1982de[_0x2acb('0x26')]][_0x2acb('0x31')]=_0x1982de[_0x2acb('0x31')];this['channels'][_0x1982de['uniqueid']][_0x2acb('0x24')]=_0x1982de[_0x2acb('0x24')];this[_0x2acb('0xd')][_0x1982de['uniqueid']][_0x2acb('0x32')]=_0x1982de[_0x2acb('0x32')];logger[_0x2acb('0x28')](_0x1982de[_0x2acb('0x26')],'\x20syncFaxStatus\x20');}};Fax[_0x2acb('0x20')][_0x2acb('0x1b')]=function(_0x2344b3){var _0x3c015b=this;if(this[_0x2acb('0xd')][_0x2344b3['uniqueid']]){var _0x10ff63=this['channels'][_0x2344b3[_0x2acb('0x26')]]['id'];this['channels'][_0x2344b3[_0x2acb('0x26')]][_0x2acb('0x33')]=_0x2344b3[_0x2acb('0x33')];this[_0x2acb('0xd')][_0x2344b3[_0x2acb('0x26')]]['pagestransferred']=_0x2344b3[_0x2acb('0x34')];this[_0x2acb('0xd')][_0x2344b3[_0x2acb('0x26')]]['localstationid']=_0x2344b3[_0x2acb('0x24')];this['channels'][_0x2344b3[_0x2acb('0x26')]][_0x2acb('0x35')]=_0x2344b3[_0x2acb('0x35')];this[_0x2acb('0xd')][_0x2344b3[_0x2acb('0x26')]][_0x2acb('0x36')]=_0x2344b3[_0x2acb('0x36')];this[_0x2acb('0xd')][_0x2344b3[_0x2acb('0x26')]][_0x2acb('0x32')]=_0x2344b3[_0x2acb('0x32')];this[_0x2acb('0xd')][_0x2344b3['uniqueid']][_0x2acb('0x37')]=_0x2344b3[_0x2acb('0x37')];if(this['channels'][_0x2344b3['uniqueid']][_0x2acb('0x34')]>0x0){tiff2pdf(_0x2344b3['filename'],_0x2acb('0x38'),function(_0x3288a6){logger[_0x2acb('0x28')](_0x2344b3['uniqueid'],_0x2acb('0x39'),_0x3288a6[_0x2acb('0x3a')]);attachment[_0x2acb('0x3b')]({'name':path[_0x2acb('0x3c')](_0x2344b3['filename'])[_0x2acb('0x27')],'basename':path[_0x2acb('0x3c')](_0x2344b3[_0x2acb('0x32')])[_0x2acb('0x27')]+'.pdf','type':_0x2acb('0x3d')})['then'](function(_0x5975f2){faxAccount[_0x2acb('0x3e')](_0x10ff63,{'from':_0x2344b3[_0x2acb('0x37')],'mapKey':_0x2acb('0x3f'),'body':path[_0x2acb('0x3c')](_0x2344b3[_0x2acb('0x32')])[_0x2acb('0x27')]+_0x2acb('0x40'),'AttachmentId':_0x5975f2['id']})['catch'](function(_0x2ada4f){logger[_0x2acb('0x41')](_0x2344b3['uniqueid'],_0x2acb('0x42'),JSON[_0x2acb('0x43')](_0x2ada4f));});})['catch'](function(_0x34a275){logger['error'](_0x2344b3[_0x2acb('0x26')],_0x2acb('0x44'),JSON[_0x2acb('0x43')](_0x34a275));});});}logger[_0x2acb('0x28')](_0x2344b3[_0x2acb('0x26')],_0x2acb('0x44'));}};Fax['prototype'][_0x2acb('0x1f')]=function(_0x68ce27){if(this['actions'][_0x68ce27[_0x2acb('0x26')]]){_[_0x2acb('0x45')](this[_0x2acb('0xd')][_0x68ce27['uniqueid']],_[_0x2acb('0x46')](_0x68ce27,['response',_0x2acb('0x47')]));}};function updateStatus(_0x37dd5b){if(_0x37dd5b[_0x2acb('0x48')]){faxMessage[_0x2acb('0x49')](_0x37dd5b[_0x2acb('0x48')],{'failMessage':_0x2acb('0x4a')})['then'](function(_0x44f9fa){ut['logger'](_0x2acb('0x4b'),_0x44f9fa);})[_0x2acb('0x4c')](function(_0x51e784){ut[_0x2acb('0x4d')]('[Fax][Message][Error][NoUpdate1]',_0x51e784);});}else{ut[_0x2acb('0x4d')](_0x2acb('0x4e'));}}Fax[_0x2acb('0x20')][_0x2acb('0x4f')]=function(_0x2aaccd,_0x32973f,_0x1cfa1d){var _0x343daf=this;var _0x3b6550={};if(_0x32973f){_0x3b6550={'read':_0x32973f};}else{_0x3b6550={'failMessage':_0x1cfa1d};}if(this[_0x2acb('0x2a')][_0x2aaccd]['AttachmentId']){faxMessage[_0x2acb('0x49')](this[_0x2acb('0x2a')][_0x2aaccd][_0x2acb('0x48')],_0x3b6550)[_0x2acb('0x50')](function(_0x19210c){ut[_0x2acb('0x4d')]('[Fax][Message][Updated]',_0x19210c);})[_0x2acb('0x4c')](function(_0x339c85){ut[_0x2acb('0x4d')](_0x2acb('0x51'),_0x339c85);})[_0x2acb('0x52')](function(){delete _0x343daf[_0x2acb('0xd')][_0x2aaccd];delete _0x343daf[_0x2acb('0x2a')][_0x2aaccd];});}else{ut[_0x2acb('0x4d')](_0x2acb('0x53'));delete this[_0x2acb('0xd')][_0x2aaccd];delete this[_0x2acb('0x2a')][_0x2aaccd];}};Fax['prototype']['syncHangup']=function(_0x5eb962){var _0x2f266f=this;if(this['channels'][_0x5eb962[_0x2acb('0x26')]]){if(this[_0x2acb('0x2a')][_0x5eb962[_0x2acb('0x26')]]){this[_0x2acb('0xd')][_0x5eb962['uniqueid']]['id']=this[_0x2acb('0x2a')][_0x5eb962[_0x2acb('0x26')]]['id'];this[_0x2acb('0xd')][_0x5eb962['uniqueid']]['name']=this[_0x2acb('0x2a')][_0x5eb962[_0x2acb('0x26')]][_0x2acb('0x27')];}logger[_0x2acb('0x28')](_0x5eb962[_0x2acb('0x26')],this['actions'][_0x5eb962[_0x2acb('0x26')]]?'\x20hangup\x20sendFile\x20':_0x2acb('0x54'),JSON[_0x2acb('0x43')](this[_0x2acb('0xd')][_0x5eb962[_0x2acb('0x26')]]));if(this[_0x2acb('0x2a')][_0x5eb962['uniqueid']]){if(this[_0x2acb('0xd')][_0x5eb962['uniqueid']][_0x2acb('0x55')]>0x0&&this[_0x2acb('0xd')][_0x5eb962[_0x2acb('0x26')]][_0x2acb('0x18')]===_0x2acb('0x56')){this[_0x2acb('0x4f')](_0x5eb962[_0x2acb('0x26')],!![]);}else{this[_0x2acb('0x4f')](_0x5eb962[_0x2acb('0x26')],![],this['channels'][_0x5eb962[_0x2acb('0x26')]][_0x2acb('0x57')]?_0x2acb('0x58')+this['channels'][_0x5eb962[_0x2acb('0x26')]][_0x2acb('0x57')]:_0x2acb('0x59'));}}}};Fax['prototype'][_0x2acb('0x5a')]=function(_0x470846){var _0x40a3ca=this;return new BPromise(function(_0x3b7976,_0x55a6a0){_0x40a3ca[_0x2acb('0x5b')](_0x470846,_0x40a3ca[_0x2acb('0xe')][_0x470846[_0x2acb('0x5c')]])['then'](function(_0x6b07d6){ut['logger'](_0x2acb('0x5d'),_0x6b07d6);_0x3b7976(ut[_0x2acb('0x3a')](_0x2acb('0x5e')));})[_0x2acb('0x4c')](function(_0x2e1b8a){ut[_0x2acb('0x4d')]('[Fax][execOriginate][failure]',_0x2e1b8a);updateStatus(_0x470846);_0x55a6a0(ut[_0x2acb('0x3a')](_0x2acb('0x5f')));});});};Fax['prototype'][_0x2acb('0x60')]=function(_0x47ed66){var _0x4b1b26=this;return new BPromise(function(_0x240967,_0x1bca42){var _0xd2d321=_0x4b1b26[_0x2acb('0x61')](_0x4b1b26[_0x2acb('0xe')][_0x47ed66['FaxAccountId']][_0x2acb('0x62')],_0x47ed66);if(_0xd2d321[_0x2acb('0x63')]){_0x240967(ut[_0x2acb('0x3a')](_0x2acb('0x64')));}else{_0x1bca42(ut[_0x2acb('0x3a')](_0xd2d321['message']));}});};function originate(_0x20d74a,_0x19a0f4,_0x389849){return new BPromise(function(_0x347986,_0x401dae){if(_0x389849){var _0x2ab28a=util['format'](_0x2acb('0x65'),path['parse'](_0x20d74a[_0x2acb('0x4')])[_0x2acb('0x27')],_0x20d74a[_0x2acb('0x4')]);gs[_0x2acb('0x66')](_0x2ab28a)[_0x2acb('0x50')](function(){_0x20d74a[_0x2acb('0x4')]=util['format'](_0x2acb('0x67'),path[_0x2acb('0x3c')](_0x20d74a['path'])['dir'],path['parse'](_0x20d74a[_0x2acb('0x4')])[_0x2acb('0x27')]);_0x19a0f4[_0x2acb('0x68')]=_0x20d74a[_0x2acb('0x4')];ut[_0x2acb('0x4d')](_0x2acb('0x69'),'');ami['Action'](ut[_0x2acb('0x6a')](_0x20d74a,_0x19a0f4))[_0x2acb('0x50')](function(_0x1c7106){_0x347986(_0x1c7106);})['catch'](function(_0x359668){_0x401dae(_0x359668);});})[_0x2acb('0x4c')](function(_0x2004df){_0x401dae(_0x2004df);});}else{ami[_0x2acb('0x6b')](ut[_0x2acb('0x6a')](_0x20d74a,_0x19a0f4))['then'](function(_0x3773d6){_0x347986(_0x3773d6);})[_0x2acb('0x4c')](function(_0x3065c2){_0x401dae(_0x3065c2);});}});}Fax[_0x2acb('0x20')]['execOriginate']=function(_0x2c22b3,_0x22da8d){var _0x41f9ce=this;return new BPromise(function(_0x5d9ff0,_0x4f5e55){var _0x3dbb9d=uuid['v4']();var _0x4910fc=ut[_0x2acb('0x6c')](_0x2c22b3,_0x22da8d);_0x41f9ce['actions'][_0x3dbb9d]=new Action(_0x3dbb9d,_0x22da8d,_0x2c22b3);var _0x1e34cc=_0x41f9ce[_0x2acb('0x2a')][_0x3dbb9d];if(path['parse'](_0x2c22b3[_0x2acb('0x4')])[_0x2acb('0x6d')]==='.pdf'){originate(_0x1e34cc,_0x4910fc,!![])[_0x2acb('0x50')](function(_0x38b2f8){_0x5d9ff0(_0x38b2f8);})[_0x2acb('0x4c')](function(_0x1f304e){_0x4f5e55(_0x1f304e);});}else{originate(_0x1e34cc,_0x4910fc,![])[_0x2acb('0x50')](function(_0x21a7a2){_0x5d9ff0(_0x21a7a2);})[_0x2acb('0x4c')](function(_0x112af8){_0x4f5e55(_0x112af8);});}});};Fax[_0x2acb('0x20')][_0x2acb('0x6e')]=function(_0x170719){return!_[_0x2acb('0x6f')](_0x170719)&&!_['isNil'](_0x170719[_0x2acb('0x27')])&&!_['isNil'](_0x170719[_0x2acb('0x70')])&&_0x170719['active']&&!_[_0x2acb('0x6f')](this[_0x2acb('0xf')][util[_0x2acb('0x71')](_0x2acb('0x72'),_0x170719[_0x2acb('0x27')])])&&!_[_0x2acb('0x6f')](this['trunks'][util[_0x2acb('0x71')]('SIP/%s',_0x170719['name'])][_0x2acb('0x31')])&&(this[_0x2acb('0xf')][util[_0x2acb('0x71')](_0x2acb('0x72'),_0x170719[_0x2acb('0x27')])][_0x2acb('0x31')]===_0x2acb('0x73')||this[_0x2acb('0xf')][util[_0x2acb('0x71')](_0x2acb('0x72'),_0x170719[_0x2acb('0x27')])][_0x2acb('0x31')]===_0x2acb('0x74'));};Fax[_0x2acb('0x20')][_0x2acb('0x61')]=function(_0x536ee9,_0x7b36a1){if(!this[_0x2acb('0x6e')](_0x536ee9)){ut[_0x2acb('0x4d')](_0x2acb('0x75'),_['isNil'](_0x536ee9)?'':_0x536ee9[_0x2acb('0x27')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x2acb('0x6f')](_0x7b36a1['fax'])){ut[_0x2acb('0x4d')](_0x2acb('0x76'),JSON[_0x2acb('0x43')](_0x7b36a1));return{'isValid':![],'message':_0x2acb('0x77')};}if(_[_0x2acb('0x6f')](_0x7b36a1[_0x2acb('0x4')])){ut[_0x2acb('0x4d')](_0x2acb('0x78'),JSON['stringify'](_0x7b36a1));return{'isValid':![],'message':_0x2acb('0x79')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x2acb('0x7a')]=Fax; \ No newline at end of file +var _0x87d9=['[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','SIP/%s','status','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../ami','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','faxAccounts','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','channelstate','channelstatedesc','hasOwnProperty','operation','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','filename','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','.pdf','application/pdf','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','update','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received'];(function(_0x762ba0,_0x429485){var _0x428307=function(_0x2b6e1d){while(--_0x2b6e1d){_0x762ba0['push'](_0x762ba0['shift']());}};_0x428307(++_0x429485);}(_0x87d9,0x93));var _0x987d=function(_0x51a6e8,_0x3e754a){_0x51a6e8=_0x51a6e8-0x0;var _0xda6ca=_0x87d9[_0x51a6e8];return _0xda6ca;};'use strict';var util=require(_0x987d('0x0'));var _=require(_0x987d('0x1'));var BPromise=require(_0x987d('0x2'));var uuid=require(_0x987d('0x3'));var moment=require('moment');var path=require(_0x987d('0x4'));var tiff2pdf=require(_0x987d('0x5'));var gs=require(_0x987d('0x6'));var logger=require('../../../config/logger')('fax');var ami=require(_0x987d('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x987d('0x8'));var ut=require(_0x987d('0x9'));var Action=require(_0x987d('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x987d('0xb'));var faxMessage=require(_0x987d('0xc'));function Fax(_0x2e0419){this[_0x987d('0xd')]={};this['faxAccounts']=_0x2e0419['faxAccounts'];this[_0x987d('0xe')]=_0x2e0419[_0x987d('0xe')];this[_0x987d('0xf')]={};ami['on'](_0x987d('0x10'),this[_0x987d('0x11')]['bind'](this));ami['on'](_0x987d('0x12'),this[_0x987d('0x13')][_0x987d('0x14')](this));ami['on'](_0x987d('0x15'),this['syncNewState']['bind'](this));ami['on'](_0x987d('0x16'),this[_0x987d('0x17')][_0x987d('0x14')](this));ami['on'](_0x987d('0x18'),this[_0x987d('0x19')][_0x987d('0x14')](this));ami['on'](_0x987d('0x1a'),this['syncReceiveFax'][_0x987d('0x14')](this));ami['on']('hangup',this[_0x987d('0x1b')][_0x987d('0x14')](this));ami['on'](_0x987d('0x1c'),this[_0x987d('0x1d')][_0x987d('0x14')](this));}Fax[_0x987d('0x1e')][_0x987d('0x11')]=function(_0x67daad){if(_0x67daad[_0x987d('0x1f')]===_0x987d('0x20')){for(var _0x4f6a55 in this[_0x987d('0x21')]){if(this[_0x987d('0x21')]['hasOwnProperty'](_0x4f6a55)){if(_0x67daad[_0x987d('0x22')]===this['faxAccounts'][_0x4f6a55][_0x987d('0x23')]){this['channels'][_0x67daad[_0x987d('0x24')]]={};this[_0x987d('0xd')][_0x67daad[_0x987d('0x24')]][_0x987d('0x25')]=_0x67daad['channel'];this[_0x987d('0xd')][_0x67daad[_0x987d('0x24')]]['id']=this[_0x987d('0x21')][_0x4f6a55]['id'];this[_0x987d('0xd')][_0x67daad[_0x987d('0x24')]][_0x987d('0x26')]=this[_0x987d('0x21')][_0x4f6a55][_0x987d('0x26')];logger['info'](_0x67daad[_0x987d('0x24')],_0x987d('0x27'));}}}}if(this[_0x987d('0xf')][_0x67daad['uniqueid']]){this[_0x987d('0xd')][_0x67daad['uniqueid']]={};this['channels'][_0x67daad[_0x987d('0x24')]]['channel']=_0x67daad['channel'];logger[_0x987d('0x28')](_0x67daad[_0x987d('0x24')],_0x987d('0x27'));}};Fax[_0x987d('0x1e')][_0x987d('0x13')]=function(_0x34ecd8){if(this[_0x987d('0xd')][_0x34ecd8['uniqueid']]){for(var _0x1733d3 in _0x34ecd8[_0x987d('0x29')]){if(_0x34ecd8[_0x987d('0x29')]['hasOwnProperty'](_0x1733d3)){this[_0x987d('0xd')][_0x34ecd8[_0x987d('0x24')]][_0x1733d3]=_0x34ecd8[_0x987d('0x2a')];}}}};Fax['prototype']['syncNewState']=function(_0x34dd95){if(this[_0x987d('0xd')][_0x34dd95['uniqueid']]){this[_0x987d('0xd')][_0x34dd95[_0x987d('0x24')]][_0x987d('0x2b')]=_0x34dd95[_0x987d('0x2b')];this[_0x987d('0xd')][_0x34dd95[_0x987d('0x24')]]['channelstatedesc']=_0x34dd95[_0x987d('0x2c')];}};Fax[_0x987d('0x1e')][_0x987d('0x17')]=function(_0x478a5b){if(this['channels'][_0x478a5b[_0x987d('0x24')]]){for(var _0x3a8723 in _0x478a5b['variable']){if(_0x478a5b[_0x987d('0x29')][_0x987d('0x2d')](_0x3a8723)){this[_0x987d('0xd')][_0x478a5b['uniqueid']][_0x3a8723]=_0x478a5b[_0x987d('0x2a')];}}}};Fax['prototype'][_0x987d('0x19')]=function(_0x15492c){if(this[_0x987d('0xd')][_0x15492c[_0x987d('0x24')]]){this[_0x987d('0xd')][_0x15492c['uniqueid']][_0x987d('0x2e')]=_0x15492c['operation'];this[_0x987d('0xd')][_0x15492c[_0x987d('0x24')]]['status']=_0x15492c['status'];this[_0x987d('0xd')][_0x15492c[_0x987d('0x24')]]['localstationid']=_0x15492c[_0x987d('0x23')];this[_0x987d('0xd')][_0x15492c[_0x987d('0x24')]]['filename']=_0x15492c['filename'];logger[_0x987d('0x28')](_0x15492c[_0x987d('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0x987d('0x1e')][_0x987d('0x2f')]=function(_0x411b83){var _0x2abfac=this;if(this['channels'][_0x411b83[_0x987d('0x24')]]){var _0x7d7cf0=this[_0x987d('0xd')][_0x411b83['uniqueid']]['id'];this[_0x987d('0xd')][_0x411b83['uniqueid']][_0x987d('0x30')]=_0x411b83[_0x987d('0x30')];this['channels'][_0x411b83[_0x987d('0x24')]]['pagestransferred']=_0x411b83[_0x987d('0x31')];this[_0x987d('0xd')][_0x411b83[_0x987d('0x24')]][_0x987d('0x23')]=_0x411b83[_0x987d('0x23')];this[_0x987d('0xd')][_0x411b83['uniqueid']]['resolution']=_0x411b83[_0x987d('0x32')];this[_0x987d('0xd')][_0x411b83[_0x987d('0x24')]][_0x987d('0x33')]=_0x411b83[_0x987d('0x33')];this[_0x987d('0xd')][_0x411b83[_0x987d('0x24')]]['filename']=_0x411b83['filename'];this[_0x987d('0xd')][_0x411b83[_0x987d('0x24')]][_0x987d('0x34')]=_0x411b83[_0x987d('0x34')];if(this[_0x987d('0xd')][_0x411b83[_0x987d('0x24')]][_0x987d('0x31')]>0x0){tiff2pdf(_0x411b83[_0x987d('0x35')],_0x987d('0x36'),function(_0x170105){logger['info'](_0x411b83[_0x987d('0x24')],_0x987d('0x37'),_0x170105['message']);attachment['create']({'name':path[_0x987d('0x38')](_0x411b83[_0x987d('0x35')])[_0x987d('0x26')],'basename':path[_0x987d('0x38')](_0x411b83[_0x987d('0x35')])[_0x987d('0x26')]+_0x987d('0x39'),'type':_0x987d('0x3a')})['then'](function(_0x273e3b){faxAccount[_0x987d('0x3b')](_0x7d7cf0,{'from':_0x411b83[_0x987d('0x34')],'mapKey':_0x987d('0x3c'),'body':path[_0x987d('0x38')](_0x411b83[_0x987d('0x35')])[_0x987d('0x26')]+_0x987d('0x39'),'AttachmentId':_0x273e3b['id']})[_0x987d('0x3d')](function(_0x292715){logger[_0x987d('0x3e')](_0x411b83['uniqueid'],_0x987d('0x3f'),JSON[_0x987d('0x40')](_0x292715));});})['catch'](function(_0x458d2c){logger[_0x987d('0x3e')](_0x411b83['uniqueid'],_0x987d('0x41'),JSON[_0x987d('0x40')](_0x458d2c));});});}logger['info'](_0x411b83[_0x987d('0x24')],'\x20receiveFax\x20');}};Fax['prototype'][_0x987d('0x1d')]=function(_0x3edfd6){if(this['actions'][_0x3edfd6['uniqueid']]){_[_0x987d('0x42')](this[_0x987d('0xd')][_0x3edfd6[_0x987d('0x24')]],_[_0x987d('0x43')](_0x3edfd6,['response',_0x987d('0x44')]));}};function updateStatus(_0x3df69a){if(_0x3df69a['AttachmentId']){faxMessage[_0x987d('0x45')](_0x3df69a[_0x987d('0x46')],{'failMessage':_0x987d('0x47')})[_0x987d('0x48')](function(_0x42f638){ut[_0x987d('0x49')]('[Fax][Message][Error][Updated]',_0x42f638);})[_0x987d('0x3d')](function(_0x11eef5){ut[_0x987d('0x49')]('[Fax][Message][Error][NoUpdate1]',_0x11eef5);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x987d('0x1e')]['updateStatus']=function(_0x5d93b7,_0x3df1af,_0x5b5e0e){var _0x331d29=this;var _0x2aef62={};if(_0x3df1af){_0x2aef62={'read':_0x3df1af};}else{_0x2aef62={'failMessage':_0x5b5e0e};}if(this[_0x987d('0xf')][_0x5d93b7][_0x987d('0x46')]){faxMessage[_0x987d('0x45')](this[_0x987d('0xf')][_0x5d93b7][_0x987d('0x46')],_0x2aef62)[_0x987d('0x48')](function(_0x57e323){ut[_0x987d('0x49')](_0x987d('0x4a'),_0x57e323);})[_0x987d('0x3d')](function(_0x5c175a){ut[_0x987d('0x49')](_0x987d('0x4b'),_0x5c175a);})[_0x987d('0x4c')](function(){delete _0x331d29[_0x987d('0xd')][_0x5d93b7];delete _0x331d29['actions'][_0x5d93b7];});}else{ut[_0x987d('0x49')](_0x987d('0x4d'));delete this['channels'][_0x5d93b7];delete this[_0x987d('0xf')][_0x5d93b7];}};Fax[_0x987d('0x1e')]['syncHangup']=function(_0xdab953){var _0x32171b=this;if(this[_0x987d('0xd')][_0xdab953[_0x987d('0x24')]]){if(this[_0x987d('0xf')][_0xdab953[_0x987d('0x24')]]){this[_0x987d('0xd')][_0xdab953[_0x987d('0x24')]]['id']=this['actions'][_0xdab953['uniqueid']]['id'];this['channels'][_0xdab953[_0x987d('0x24')]]['name']=this[_0x987d('0xf')][_0xdab953[_0x987d('0x24')]][_0x987d('0x26')];}logger[_0x987d('0x28')](_0xdab953[_0x987d('0x24')],this['actions'][_0xdab953[_0x987d('0x24')]]?_0x987d('0x4e'):_0x987d('0x4f'),JSON[_0x987d('0x40')](this[_0x987d('0xd')][_0xdab953[_0x987d('0x24')]]));if(this['actions'][_0xdab953[_0x987d('0x24')]]){if(this[_0x987d('0xd')][_0xdab953['uniqueid']][_0x987d('0x50')]>0x0&&this[_0x987d('0xd')][_0xdab953[_0x987d('0x24')]]['faxstatus']==='SUCCESS'){this[_0x987d('0x51')](_0xdab953[_0x987d('0x24')],!![]);}else{this[_0x987d('0x51')](_0xdab953['uniqueid'],![],this[_0x987d('0xd')][_0xdab953[_0x987d('0x24')]][_0x987d('0x52')]?_0x987d('0x53')+this[_0x987d('0xd')][_0xdab953[_0x987d('0x24')]][_0x987d('0x52')]:_0x987d('0x54'));}}}};Fax['prototype'][_0x987d('0x55')]=function(_0x1a1355){var _0x1fe139=this;return new BPromise(function(_0x492b36,_0x33736f){_0x1fe139[_0x987d('0x56')](_0x1a1355,_0x1fe139['faxAccounts'][_0x1a1355[_0x987d('0x57')]])['then'](function(_0x11c376){ut[_0x987d('0x49')](_0x987d('0x58'),_0x11c376);_0x492b36(ut[_0x987d('0x59')](_0x987d('0x5a')));})[_0x987d('0x3d')](function(_0x311f77){ut[_0x987d('0x49')](_0x987d('0x5b'),_0x311f77);updateStatus(_0x1a1355);_0x33736f(ut['message'](_0x987d('0x5c')));});});};Fax[_0x987d('0x1e')][_0x987d('0x5d')]=function(_0x484fdd){var _0x27f89f=this;return new BPromise(function(_0x181824,_0x3a0471){var _0x1f6414=_0x27f89f[_0x987d('0x5e')](_0x27f89f[_0x987d('0x21')][_0x484fdd[_0x987d('0x57')]][_0x987d('0x5f')],_0x484fdd);if(_0x1f6414['isValid']){_0x181824(ut['message'](_0x987d('0x60')));}else{_0x3a0471(ut[_0x987d('0x59')](_0x1f6414[_0x987d('0x59')]));}});};function originate(_0x301086,_0x36c6f3,_0x2c96b5){return new BPromise(function(_0x1dc386,_0x2a8d5d){if(_0x2c96b5){var _0x131537=util[_0x987d('0x61')](_0x987d('0x62'),path['parse'](_0x301086[_0x987d('0x4')])[_0x987d('0x26')],_0x301086[_0x987d('0x4')]);gs[_0x987d('0x63')](_0x131537)['then'](function(){_0x301086['path']=util['format'](_0x987d('0x64'),path['parse'](_0x301086[_0x987d('0x4')])['dir'],path[_0x987d('0x38')](_0x301086[_0x987d('0x4')])[_0x987d('0x26')]);_0x36c6f3['XMF-PATH']=_0x301086[_0x987d('0x4')];ut['logger'](_0x987d('0x65'),'');ami[_0x987d('0x66')](ut[_0x987d('0x67')](_0x301086,_0x36c6f3))[_0x987d('0x48')](function(_0x5b6b85){_0x1dc386(_0x5b6b85);})[_0x987d('0x3d')](function(_0x59a0df){_0x2a8d5d(_0x59a0df);});})[_0x987d('0x3d')](function(_0x10a8e6){_0x2a8d5d(_0x10a8e6);});}else{ami[_0x987d('0x66')](ut[_0x987d('0x67')](_0x301086,_0x36c6f3))[_0x987d('0x48')](function(_0x1d3657){_0x1dc386(_0x1d3657);})[_0x987d('0x3d')](function(_0x1131e4){_0x2a8d5d(_0x1131e4);});}});}Fax['prototype'][_0x987d('0x56')]=function(_0x3b92a3,_0x42efb7){var _0x3b6bed=this;return new BPromise(function(_0x3eb853,_0x563174){var _0x105f26=uuid['v4']();var _0x5ebd27=ut[_0x987d('0x68')](_0x3b92a3,_0x42efb7);_0x3b6bed[_0x987d('0xf')][_0x105f26]=new Action(_0x105f26,_0x42efb7,_0x3b92a3);var _0x16ca02=_0x3b6bed['actions'][_0x105f26];if(path['parse'](_0x3b92a3[_0x987d('0x4')])[_0x987d('0x69')]==='.pdf'){originate(_0x16ca02,_0x5ebd27,!![])[_0x987d('0x48')](function(_0x395cdc){_0x3eb853(_0x395cdc);})[_0x987d('0x3d')](function(_0x142cc7){_0x563174(_0x142cc7);});}else{originate(_0x16ca02,_0x5ebd27,![])[_0x987d('0x48')](function(_0x50d6ff){_0x3eb853(_0x50d6ff);})[_0x987d('0x3d')](function(_0x2ae371){_0x563174(_0x2ae371);});}});};Fax[_0x987d('0x1e')]['isTrunkReachable']=function(_0x13a83b){return!_[_0x987d('0x6a')](_0x13a83b)&&!_['isNil'](_0x13a83b[_0x987d('0x26')])&&!_[_0x987d('0x6a')](_0x13a83b['active'])&&_0x13a83b['active']&&!_['isNil'](this[_0x987d('0xe')][util[_0x987d('0x61')](_0x987d('0x6b'),_0x13a83b[_0x987d('0x26')])])&&!_[_0x987d('0x6a')](this['trunks'][util['format']('SIP/%s',_0x13a83b[_0x987d('0x26')])]['status'])&&(this[_0x987d('0xe')][util['format']('SIP/%s',_0x13a83b[_0x987d('0x26')])][_0x987d('0x6c')]===_0x987d('0x6d')||this['trunks'][util[_0x987d('0x61')](_0x987d('0x6b'),_0x13a83b[_0x987d('0x26')])][_0x987d('0x6c')]===_0x987d('0x6e'));};Fax[_0x987d('0x1e')][_0x987d('0x5e')]=function(_0x586b73,_0x122793){if(!this[_0x987d('0x6f')](_0x586b73)){ut[_0x987d('0x49')](_0x987d('0x70'),_['isNil'](_0x586b73)?'':_0x586b73[_0x987d('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x987d('0x71')};}if(_[_0x987d('0x6a')](_0x122793[_0x987d('0x3c')])){ut[_0x987d('0x49')](_0x987d('0x72'),JSON[_0x987d('0x40')](_0x122793));return{'isValid':![],'message':_0x987d('0x73')};}if(_[_0x987d('0x6a')](_0x122793[_0x987d('0x4')])){ut[_0x987d('0x49')](_0x987d('0x74'),JSON[_0x987d('0x40')](_0x122793));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x987d('0x75')};};module[_0x987d('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 331e401..8da2a6a 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 _0xd1c2=['error','resolve','then','notify','catch','[Notify]\x20','util','bluebird','../../../config/logger','lodash'];(function(_0x50bfb7,_0x2b316a){var _0x406329=function(_0x41526b){while(--_0x41526b){_0x50bfb7['push'](_0x50bfb7['shift']());}};_0x406329(++_0x2b316a);}(_0xd1c2,0x128));var _0x2d1c=function(_0x594b31,_0x5ce592){_0x594b31=_0x594b31-0x0;var _0x48e390=_0xd1c2[_0x594b31];return _0x48e390;};'use strict';var util=require(_0x2d1c('0x0'));var BPromise=require(_0x2d1c('0x1'));var logger=require(_0x2d1c('0x2'))('preview');var _=require(_0x2d1c('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2fcbb2){return function(_0x17b9e4){logger[_0x2d1c('0x4')](_0x2fcbb2,util['inspect'](_0x17b9e4,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x171bd0,_0x5ad004){return BPromise[_0x2d1c('0x5')]()[_0x2d1c('0x6')](faxAccount[_0x2d1c('0x7')](_0x171bd0,_0x5ad004))[_0x2d1c('0x8')](loggerCatch(_0x2d1c('0x9')));}; \ No newline at end of file +var _0xb41e=['bluebird','../../../config/logger','../rpc/faxAccount','inspect','notify','resolve','then'];(function(_0x3958d2,_0xc58243){var _0x1bf299=function(_0x9b0086){while(--_0x9b0086){_0x3958d2['push'](_0x3958d2['shift']());}};_0x1bf299(++_0xc58243);}(_0xb41e,0x19d));var _0xeb41=function(_0x31cff8,_0x255cb6){_0x31cff8=_0x31cff8-0x0;var _0x95287b=_0xb41e[_0x31cff8];return _0x95287b;};'use strict';var util=require('util');var BPromise=require(_0xeb41('0x0'));var logger=require(_0xeb41('0x1'))('preview');var _=require('lodash');var faxAccount=require(_0xeb41('0x2'));function loggerCatch(_0x4a7498){return function(_0x16dcd0){logger['error'](_0x4a7498,util[_0xeb41('0x3')](_0x16dcd0,{'showHidden':![],'depth':null}));};}exports[_0xeb41('0x4')]=function(_0x4828e1,_0x26fd67){return BPromise[_0xeb41('0x5')]()[_0xeb41('0x6')](faxAccount['notify'](_0x4828e1,_0x26fd67))['catch'](loggerCatch('[Notify]\x20'));}; \ 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 c8fbbbd..fbd7025 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 _0xdbdd=['util','../../../../config/logger','fax','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x2140a4,_0x5cc480){var _0x3389fc=function(_0x14db18){while(--_0x14db18){_0x2140a4['push'](_0x2140a4['shift']());}};_0x3389fc(++_0x5cc480);}(_0xdbdd,0x1ae));var _0xddbd=function(_0x51e881,_0x322264){_0x51e881=_0x51e881-0x0;var _0x52a90e=_0xdbdd[_0x51e881];return _0x52a90e;};'use strict';var util=require(_0xddbd('0x0'));var logger=require(_0xddbd('0x1'))(_0xddbd('0x2'));var BPromise=require('bluebird');var exec=require(_0xddbd('0x3'))[_0xddbd('0x4')];exports[_0xddbd('0x5')]=function(_0x48b4a8){return new BPromise(function(_0x294deb,_0x41c28b){exec(_0x48b4a8,function(_0x56cbd3,_0x3232c2,_0x44a682){logger[_0xddbd('0x6')](_0xddbd('0x7'),_0x3232c2);if(_0x56cbd3){logger[_0xddbd('0x6')]('Exec\x20gs',_0xddbd('0x8'),util[_0xddbd('0x9')](_0x56cbd3,{'showHidden':![],'depth':null}),_0x3232c2,_0x44a682);_0x41c28b(_0x56cbd3);}_0x294deb(_0x3232c2);});});}; \ No newline at end of file +var _0x4409=['info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','child_process','exec'];(function(_0x46dfea,_0x19182c){var _0x543d00=function(_0x2a8b35){while(--_0x2a8b35){_0x46dfea['push'](_0x46dfea['shift']());}};_0x543d00(++_0x19182c);}(_0x4409,0x1f3));var _0x9440=function(_0x50b3c9,_0x5b8b87){_0x50b3c9=_0x50b3c9-0x0;var _0x3129a9=_0x4409[_0x50b3c9];return _0x3129a9;};'use strict';var util=require(_0x9440('0x0'));var logger=require(_0x9440('0x1'))(_0x9440('0x2'));var BPromise=require('bluebird');var exec=require(_0x9440('0x3'))[_0x9440('0x4')];exports['execute']=function(_0x90b751){return new BPromise(function(_0x9b6b79,_0x508d35){exec(_0x90b751,function(_0x1475d9,_0x220b30,_0x228482){logger[_0x9440('0x5')](_0x9440('0x6'),_0x220b30);if(_0x1475d9){logger[_0x9440('0x5')](_0x9440('0x6'),_0x9440('0x7'),util[_0x9440('0x8')](_0x1475d9,{'showHidden':![],'depth':null}),_0x220b30,_0x228482);_0x508d35(_0x1475d9);}_0x9b6b79(_0x220b30);});});}; \ 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 d651514..ac0c5dd 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 _0x8d7f=['variablesAction','originate','channel','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','fax','message','logger','info','addVariables','headerinfo','minrate','maxrate','format','modem','t38timeout','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8d7f,0x1a8));var _0xf8d7=function(_0x34fae7,_0x301201){_0x34fae7=_0x34fae7-0x0;var _0x20e7a7=_0x8d7f[_0x34fae7];return _0x20e7a7;};'use strict';var util=require(_0xf8d7('0x0'));var _=require(_0xf8d7('0x1'));var moment=require(_0xf8d7('0x2'));var logger=require(_0xf8d7('0x3'))(_0xf8d7('0x4'));exports[_0xf8d7('0x5')]=function(_0x140a2e){return{'message':_0x140a2e};};exports[_0xf8d7('0x6')]=function(_0x5cdba4,_0x58beec){logger[_0xf8d7('0x7')](_0x5cdba4,util['inspect'](_0x58beec,{'showHidden':![],'depth':null}));};exports[_0xf8d7('0x8')]=function(_0x36eb51,_0x40d09d){var _0x271233={'XMF-ECM':_0x40d09d['ecm'],'XMF-HEADERINFO':_0x40d09d[_0xf8d7('0x9')],'XMF-MINRATE':_0x40d09d[_0xf8d7('0xa')],'XMF-MAXRATE':_0x40d09d[_0xf8d7('0xb')],'XMF-MODEM':util[_0xf8d7('0xc')]('\x22%s\x22',_0x40d09d[_0xf8d7('0xd')]),'XMF-GATEWAY':_0x40d09d['gateway'],'XMF-FAXDETECT':_0x40d09d['faxdetect'],'XMF-T38TIMEOUT':_0x40d09d[_0xf8d7('0xe')],'XMF-LOCALSTATIONID':_0x40d09d['localstationid'],'XMF-PATH':_0x36eb51[_0xf8d7('0xf')]};return _0x271233;};exports[_0xf8d7('0x10')]=function(_0x2cecca,_0x120fb5){return{'actionid':_0x2cecca['uniqueid'],'action':_0xf8d7('0x11'),'channel':_0x2cecca[_0xf8d7('0x12')],'Exten':'xcally-motion-fax','Context':_0xf8d7('0x13'),'Priority':'1','callerid':util[_0xf8d7('0xc')](_0xf8d7('0x14'),_0x2cecca[_0xf8d7('0x9')]?_0x2cecca[_0xf8d7('0x9')]:'',_0x2cecca['localstationid']),'variable':_0x120fb5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2cecca[_0xf8d7('0x15')]};}; \ No newline at end of file +var _0x6015=['modem','gateway','faxdetect','t38timeout','path','variablesAction','originate','channel','from-sip','format','\x22%s\x22\x20<%s>','localstationid','uniqueid','util','lodash','moment','fax','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate','\x22%s\x22'];(function(_0x2f8540,_0x340b7c){var _0x5ec489=function(_0x160b7d){while(--_0x160b7d){_0x2f8540['push'](_0x2f8540['shift']());}};_0x5ec489(++_0x340b7c);}(_0x6015,0x145));var _0x5601=function(_0x5aac43,_0x1713ac){_0x5aac43=_0x5aac43-0x0;var _0x1497f3=_0x6015[_0x5aac43];return _0x1497f3;};'use strict';var util=require(_0x5601('0x0'));var _=require(_0x5601('0x1'));var moment=require(_0x5601('0x2'));var logger=require('../../../../config/logger')(_0x5601('0x3'));exports[_0x5601('0x4')]=function(_0xc7166){return{'message':_0xc7166};};exports[_0x5601('0x5')]=function(_0x5e54bc,_0x25375b){logger[_0x5601('0x6')](_0x5e54bc,util[_0x5601('0x7')](_0x25375b,{'showHidden':![],'depth':null}));};exports[_0x5601('0x8')]=function(_0x23614e,_0x2f7190){var _0xae5094={'XMF-ECM':_0x2f7190['ecm'],'XMF-HEADERINFO':_0x2f7190[_0x5601('0x9')],'XMF-MINRATE':_0x2f7190[_0x5601('0xa')],'XMF-MAXRATE':_0x2f7190[_0x5601('0xb')],'XMF-MODEM':util['format'](_0x5601('0xc'),_0x2f7190[_0x5601('0xd')]),'XMF-GATEWAY':_0x2f7190[_0x5601('0xe')],'XMF-FAXDETECT':_0x2f7190[_0x5601('0xf')],'XMF-T38TIMEOUT':_0x2f7190[_0x5601('0x10')],'XMF-LOCALSTATIONID':_0x2f7190['localstationid'],'XMF-PATH':_0x23614e[_0x5601('0x11')]};return _0xae5094;};exports[_0x5601('0x12')]=function(_0x3ab2b9,_0x264756){return{'actionid':_0x3ab2b9['uniqueid'],'action':_0x5601('0x13'),'channel':_0x3ab2b9[_0x5601('0x14')],'Exten':'xcally-motion-fax','Context':_0x5601('0x15'),'Priority':'1','callerid':util[_0x5601('0x16')](_0x5601('0x17'),_0x3ab2b9[_0x5601('0x9')]?_0x3ab2b9['headerinfo']:'',_0x3ab2b9[_0x5601('0x18')]),'variable':_0x264756,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3ab2b9[_0x5601('0x19')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 8ca6a98..23a33a3 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 _0xc386=['getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','catch','[index.js][main]','inspect','bluebird','util','moment','./server','./report','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTemplates','initTemplates','getZendeskAccounts'];(function(_0x414185,_0x478948){var _0x2dcd58=function(_0x2e0175){while(--_0x2e0175){_0x414185['push'](_0x414185['shift']());}};_0x2dcd58(++_0x478948);}(_0xc386,0x157));var _0x6c38=function(_0x19697f,_0x5efaf6){_0x19697f=_0x19697f-0x0;var _0xf67136=_0xc386[_0x19697f];return _0xf67136;};'use strict';var BPromise=require(_0x6c38('0x0'));var util=require(_0x6c38('0x1'));var moment=require(_0x6c38('0x2'));var server=require(_0x6c38('0x3'));var Realtime=require('./realtime');var Report=require(_0x6c38('0x4'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0x6c38('0x5'));var Preview=require(_0x6c38('0x6'));var Fax=require(_0x6c38('0x7'));var user=require(_0x6c38('0x8'));var voiceQueue=require(_0x6c38('0x9'));var voiceQueueReport=require(_0x6c38('0xa'));var voiceCallReport=require(_0x6c38('0xb'));var trunk=require(_0x6c38('0xc'));var trigger=require(_0x6c38('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0x6c38('0xe'));var campaign=require(_0x6c38('0xf'));var voiceExtension=require(_0x6c38('0x10'));var faxAccount=require(_0x6c38('0x11'));var zendesk=require(_0x6c38('0x12'));var salesforce=require(_0x6c38('0x13'));var sugarcrm=require(_0x6c38('0x14'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x6c38('0x15'));var vtiger=require(_0x6c38('0x16'));var freshsales=require(_0x6c38('0x17'));var servicenow=require(_0x6c38('0x18'));var dynamics365=require(_0x6c38('0x19'));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(_0x6c38('0x1a'))(_0x6c38('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6c38('0x1c')](_0x6c38('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6c38('0x1c')](_0x6c38('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x6c38('0x1e')]()['then'](user[_0x6c38('0x1f')]())[_0x6c38('0x20')](realtime[_0x6c38('0x21')]())['then'](user[_0x6c38('0x22')]())[_0x6c38('0x20')](realtime[_0x6c38('0x23')]())[_0x6c38('0x20')](trunk[_0x6c38('0x24')]())[_0x6c38('0x20')](realtime['initTrunks']())[_0x6c38('0x20')](voiceQueue[_0x6c38('0x25')]())['then'](realtime[_0x6c38('0x26')]())[_0x6c38('0x20')](trigger['getTriggers']())[_0x6c38('0x20')](realtime['initTriggers']())[_0x6c38('0x20')](template[_0x6c38('0x27')]())[_0x6c38('0x20')](realtime[_0x6c38('0x28')]())[_0x6c38('0x20')](zendesk[_0x6c38('0x29')]())['then'](realtime['initZendeskAccounts']())[_0x6c38('0x20')](salesforce[_0x6c38('0x2a')]())[_0x6c38('0x20')](realtime[_0x6c38('0x2b')]())[_0x6c38('0x20')](sugarcrm[_0x6c38('0x2c')]())[_0x6c38('0x20')](realtime[_0x6c38('0x2d')]())[_0x6c38('0x20')](freshdesk[_0x6c38('0x2e')]())[_0x6c38('0x20')](realtime[_0x6c38('0x2f')]())[_0x6c38('0x20')](desk[_0x6c38('0x30')]())[_0x6c38('0x20')](realtime['initDeskAccounts']())['then'](zoho[_0x6c38('0x31')]())[_0x6c38('0x20')](realtime[_0x6c38('0x32')]())['then'](vtiger[_0x6c38('0x33')]())[_0x6c38('0x20')](realtime[_0x6c38('0x34')]())['then'](freshsales[_0x6c38('0x35')]())[_0x6c38('0x20')](realtime[_0x6c38('0x36')]())[_0x6c38('0x20')](servicenow[_0x6c38('0x37')]())['then'](realtime[_0x6c38('0x38')]())[_0x6c38('0x20')](dynamics365[_0x6c38('0x39')]())[_0x6c38('0x20')](realtime[_0x6c38('0x3a')]())[_0x6c38('0x20')](campaign[_0x6c38('0x3b')]())['then'](realtime['initCampaigns']())[_0x6c38('0x20')](voiceExtension[_0x6c38('0x3c')]())[_0x6c38('0x20')](realtime[_0x6c38('0x3d')]())[_0x6c38('0x20')](faxAccount[_0x6c38('0x3e')]())[_0x6c38('0x20')](realtime[_0x6c38('0x3f')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x6c38('0x1e')]()[_0x6c38('0x20')](voiceQueueReport[_0x6c38('0x40')]())[_0x6c38('0x20')](realtime[_0x6c38('0x41')]())[_0x6c38('0x20')](cmHopperHistory[_0x6c38('0x42')]())['then'](realtime[_0x6c38('0x43')]())[_0x6c38('0x20')](cmHopperHistory[_0x6c38('0x44')]())['then'](realtime[_0x6c38('0x45')]())['then'](voiceCallReport[_0x6c38('0x46')]())[_0x6c38('0x20')](realtime[_0x6c38('0x47')]())['catch'](function(_0x321e5a){logger[_0x6c38('0x48')](_0x6c38('0x49'),util['inspect'](_0x321e5a,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x152417){return initRealtime();})[_0x6c38('0x20')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x6c38('0x4a')](function(_0x552d7b){logger[_0x6c38('0x48')](_0x6c38('0x4b'),util[_0x6c38('0x4c')](_0x552d7b,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x4a8e=['getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','inspect','listen','sync','catch','error','[index.js][main]','util','moment','./realtime','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts'];(function(_0x2c0be1,_0x59cdd5){var _0x5c9e46=function(_0x23d920){while(--_0x23d920){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x5c9e46(++_0x59cdd5);}(_0x4a8e,0x1bd));var _0xe4a8=function(_0x234e1a,_0x500d79){_0x234e1a=_0x234e1a-0x0;var _0x55aad2=_0x4a8e[_0x234e1a];return _0x55aad2;};'use strict';var BPromise=require('bluebird');var util=require(_0xe4a8('0x0'));var moment=require(_0xe4a8('0x1'));var server=require('./server');var Realtime=require(_0xe4a8('0x2'));var Report=require('./report');var Acw=require(_0xe4a8('0x3'));var Trigger=require('./trigger');var Dialer=require(_0xe4a8('0x4'));var Preview=require(_0xe4a8('0x5'));var Fax=require(_0xe4a8('0x6'));var user=require(_0xe4a8('0x7'));var voiceQueue=require(_0xe4a8('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xe4a8('0x9'));var trunk=require(_0xe4a8('0xa'));var trigger=require(_0xe4a8('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0xe4a8('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xe4a8('0xd'));var faxAccount=require(_0xe4a8('0xe'));var zendesk=require(_0xe4a8('0xf'));var salesforce=require(_0xe4a8('0x10'));var sugarcrm=require(_0xe4a8('0x11'));var freshdesk=require(_0xe4a8('0x12'));var desk=require(_0xe4a8('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xe4a8('0x14'));var freshsales=require(_0xe4a8('0x15'));var servicenow=require(_0xe4a8('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xe4a8('0x17'))(_0xe4a8('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe4a8('0x19')](_0xe4a8('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe4a8('0x19')](_0xe4a8('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xe4a8('0x1b')]()[_0xe4a8('0x1c')](user[_0xe4a8('0x1d')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x1e')]())[_0xe4a8('0x1c')](user['getTelephones']())[_0xe4a8('0x1c')](realtime['initTelephones']())[_0xe4a8('0x1c')](trunk[_0xe4a8('0x1f')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x20')]())[_0xe4a8('0x1c')](voiceQueue[_0xe4a8('0x21')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x22')]())[_0xe4a8('0x1c')](trigger[_0xe4a8('0x23')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x24')]())[_0xe4a8('0x1c')](template['getTemplates']())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x25')]())[_0xe4a8('0x1c')](zendesk[_0xe4a8('0x26')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x27')]())[_0xe4a8('0x1c')](salesforce[_0xe4a8('0x28')]())['then'](realtime[_0xe4a8('0x29')]())[_0xe4a8('0x1c')](sugarcrm[_0xe4a8('0x2a')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x2b')]())[_0xe4a8('0x1c')](freshdesk[_0xe4a8('0x2c')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x2d')]())[_0xe4a8('0x1c')](desk[_0xe4a8('0x2e')]())[_0xe4a8('0x1c')](realtime['initDeskAccounts']())['then'](zoho[_0xe4a8('0x2f')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x30')]())['then'](vtiger[_0xe4a8('0x31')]())['then'](realtime['initVtigerAccounts']())['then'](freshsales[_0xe4a8('0x32')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x33')]())['then'](servicenow[_0xe4a8('0x34')]())[_0xe4a8('0x1c')](realtime['initServicenowAccounts']())[_0xe4a8('0x1c')](dynamics365[_0xe4a8('0x35')]())[_0xe4a8('0x1c')](realtime['initDynamics365Accounts']())[_0xe4a8('0x1c')](campaign[_0xe4a8('0x36')]())['then'](realtime[_0xe4a8('0x37')]())[_0xe4a8('0x1c')](voiceExtension[_0xe4a8('0x38')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x39')]())['then'](faxAccount['getFaxAccounts']())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x3a')]())[_0xe4a8('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xe4a8('0x1b')]()[_0xe4a8('0x1c')](voiceQueueReport[_0xe4a8('0x3b')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x3c')]())[_0xe4a8('0x1c')](cmHopperHistory[_0xe4a8('0x3d')]())[_0xe4a8('0x1c')](realtime[_0xe4a8('0x3e')]())['then'](cmHopperHistory[_0xe4a8('0x3f')]())['then'](realtime[_0xe4a8('0x40')]())[_0xe4a8('0x1c')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0xe4a8('0x41')]())['catch'](function(_0xeabd4b){logger['error']('[index.js][initParams]',util[_0xe4a8('0x42')](_0xeabd4b,{'showHidden':![],'depth':null}));});}function main(){return server[_0xe4a8('0x43')](realtime,preview,fax)[_0xe4a8('0x1c')](function(_0x301a84){return initRealtime();})[_0xe4a8('0x1c')](function(){return initParams();})[_0xe4a8('0x1c')](function(){report[_0xe4a8('0x44')]();setInterval(initRealtime,0x1388);})[_0xe4a8('0x45')](function(_0x4d782a){logger[_0xe4a8('0x46')](_0xe4a8('0x47'),util[_0xe4a8('0x42')](_0x4d782a,{'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 e910c3a..62b2bd2 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 _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0xe54e2f,_0x11873e){var _0x444711=function(_0x3270d0){while(--_0x3270d0){_0xe54e2f['push'](_0xe54e2f['shift']());}};_0x444711(++_0x11873e);}(_0xe706,0xa3));var _0x6e70=function(_0x3d86f5,_0x257914){_0x3d86f5=_0x3d86f5-0x0;var _0x2d6881=_0xe706[_0x3d86f5];return _0x2d6881;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file +var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x6a09cd,_0xbe9c60){var _0x44d825=function(_0x4dbe86){while(--_0x4dbe86){_0x6a09cd['push'](_0x6a09cd['shift']());}};_0x44d825(++_0xbe9c60);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2bf5bd,_0x120787){_0x2bf5bd=_0x2bf5bd-0x0;var _0xc810c0=_0xcb91[_0x2bf5bd];return _0xc810c0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 955e01d..272ccb1 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 _0x63dd=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive'];(function(_0x215142,_0x3caefa){var _0x5dc5d5=function(_0x1295e3){while(--_0x1295e3){_0x215142['push'](_0x215142['shift']());}};_0x5dc5d5(++_0x3caefa);}(_0x63dd,0x1e9));var _0xd63d=function(_0x57c2f8,_0x49e50a){_0x57c2f8=_0x57c2f8-0x0;var _0x50809c=_0x63dd[_0x57c2f8];return _0x50809c;};'use strict';function Campaign(_0x3f1350){this['id']=_0x3f1350['id']||0x0;this['name']=_0x3f1350[_0xd63d('0x0')]||'';this['type']=_0x3f1350[_0xd63d('0x1')]||_0xd63d('0x2');this[_0xd63d('0x3')]=0x0;this['temp']=0x0;this[_0xd63d('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0xd63d('0x5')]=!![];this[_0xd63d('0x6')]=_0x3f1350[_0xd63d('0x6')];this[_0xd63d('0x7')]=_0x3f1350[_0xd63d('0x7')];this[_0xd63d('0x8')]=_0x3f1350['dialTimezone']||null;this[_0xd63d('0x9')]=_0x3f1350['dialGlobalInterval']?_0x3f1350[_0xd63d('0x9')]:null;this['dialOriginateCallerIdName']=_0x3f1350[_0xd63d('0xa')];this[_0xd63d('0xb')]=_0x3f1350[_0xd63d('0xb')];this[_0xd63d('0xc')]=_0x3f1350[_0xd63d('0xc')]||0x1e;this[_0xd63d('0xd')]=_0x3f1350['dialCongestionMaxRetry'];this[_0xd63d('0xe')]=_0x3f1350[_0xd63d('0xe')];this[_0xd63d('0xf')]=_0x3f1350[_0xd63d('0xf')];this[_0xd63d('0x10')]=_0x3f1350[_0xd63d('0x10')];this['dialNoAnswerMaxRetry']=_0x3f1350[_0xd63d('0x11')];this['dialNoAnswerRetryFrequency']=_0x3f1350[_0xd63d('0x12')];this[_0xd63d('0x13')]=_0x3f1350[_0xd63d('0x13')];this[_0xd63d('0x14')]=_0x3f1350[_0xd63d('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3f1350['dialNoSuchNumberRetryFrequency']||0x96;this[_0xd63d('0x15')]=_0x3f1350[_0xd63d('0x15')]||0x3;this[_0xd63d('0x16')]=_0x3f1350[_0xd63d('0x16')]||0x96;this[_0xd63d('0x17')]=_0x3f1350['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x3f1350['dialAbandonedRetryFrequency']||0x96;this[_0xd63d('0x18')]=_0x3f1350[_0xd63d('0x18')]||0x3;this[_0xd63d('0x19')]=_0x3f1350[_0xd63d('0x19')]||0x96;this[_0xd63d('0x1a')]=_0x3f1350[_0xd63d('0x1a')]||0x3;this[_0xd63d('0x1b')]=_0x3f1350[_0xd63d('0x1b')]||0x96;this[_0xd63d('0x1c')]=_0x3f1350[_0xd63d('0x1c')]||_0xd63d('0x1d');this[_0xd63d('0x1e')]=_0x3f1350[_0xd63d('0x1e')]||undefined;this[_0xd63d('0x1f')]=_0x3f1350[_0xd63d('0x1f')]||undefined;this[_0xd63d('0x20')]=_0x3f1350[_0xd63d('0x20')]||undefined;this['TrunkBackup']=_0x3f1350[_0xd63d('0x21')]?_0x3f1350[_0xd63d('0x21')]:undefined;this[_0xd63d('0x22')]=_0x3f1350[_0xd63d('0x22')]?_0x3f1350[_0xd63d('0x22')]:undefined;this[_0xd63d('0x23')]=_0x3f1350[_0xd63d('0x23')]?_0x3f1350[_0xd63d('0x23')]:undefined;this[_0xd63d('0x24')]=_0x3f1350[_0xd63d('0x24')]?_0x3f1350[_0xd63d('0x24')]:undefined;this[_0xd63d('0x25')]=_0x3f1350[_0xd63d('0x24')]?_0x3f1350['SquareProject']['name']:undefined;this[_0xd63d('0x26')]=_0x3f1350[_0xd63d('0x26')]||![];this[_0xd63d('0x27')]=_0x3f1350[_0xd63d('0x27')];this['dialAMDGreeting']=_0x3f1350[_0xd63d('0x28')];this[_0xd63d('0x29')]=_0x3f1350[_0xd63d('0x29')];this[_0xd63d('0x2a')]=_0x3f1350[_0xd63d('0x2a')];this[_0xd63d('0x2b')]=_0x3f1350[_0xd63d('0x2b')];this[_0xd63d('0x2c')]=_0x3f1350['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x3f1350[_0xd63d('0x2d')];this['dialAMDSilenceThreshold']=_0x3f1350['dialAMDSilenceThreshold'];this[_0xd63d('0x2e')]=_0x3f1350[_0xd63d('0x2e')];}module[_0xd63d('0x2f')]=Campaign; \ No newline at end of file +var _0xe127=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x2db4ba,_0x3f5ff5){var _0x3449ab=function(_0x142897){while(--_0x142897){_0x2db4ba['push'](_0x2db4ba['shift']());}};_0x3449ab(++_0x3f5ff5);}(_0xe127,0x14f));var _0x7e12=function(_0x105c30,_0x49c8ce){_0x105c30=_0x105c30-0x0;var _0x12f569=_0xe127[_0x105c30];return _0x12f569;};'use strict';function Campaign(_0x284af7){this['id']=_0x284af7['id']||0x0;this[_0x7e12('0x0')]=_0x284af7[_0x7e12('0x0')]||'';this[_0x7e12('0x1')]=_0x284af7[_0x7e12('0x1')]||_0x7e12('0x2');this[_0x7e12('0x3')]=0x0;this['temp']=0x0;this[_0x7e12('0x4')]=0x0;this[_0x7e12('0x5')]=0x0;this[_0x7e12('0x6')]='';this[_0x7e12('0x7')]=!![];this[_0x7e12('0x8')]=_0x284af7['active'];this[_0x7e12('0x9')]=_0x284af7[_0x7e12('0x9')];this[_0x7e12('0xa')]=_0x284af7[_0x7e12('0xa')]||null;this['dialGlobalInterval']=_0x284af7[_0x7e12('0xb')]?_0x284af7['dialGlobalInterval']:null;this[_0x7e12('0xc')]=_0x284af7[_0x7e12('0xc')];this[_0x7e12('0xd')]=_0x284af7[_0x7e12('0xd')];this[_0x7e12('0xe')]=_0x284af7[_0x7e12('0xe')]||0x1e;this[_0x7e12('0xf')]=_0x284af7[_0x7e12('0xf')];this[_0x7e12('0x10')]=_0x284af7['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x284af7[_0x7e12('0x11')];this[_0x7e12('0x12')]=_0x284af7[_0x7e12('0x12')];this[_0x7e12('0x13')]=_0x284af7['dialNoAnswerMaxRetry'];this[_0x7e12('0x14')]=_0x284af7[_0x7e12('0x14')];this[_0x7e12('0x15')]=_0x284af7[_0x7e12('0x15')];this[_0x7e12('0x16')]=_0x284af7['dialNoSuchNumberMaxRetry']||0x3;this[_0x7e12('0x17')]=_0x284af7[_0x7e12('0x17')]||0x96;this[_0x7e12('0x18')]=_0x284af7[_0x7e12('0x18')]||0x3;this[_0x7e12('0x19')]=_0x284af7[_0x7e12('0x19')]||0x96;this['dialAbandonedMaxRetry']=_0x284af7[_0x7e12('0x1a')]||0x3;this[_0x7e12('0x1b')]=_0x284af7[_0x7e12('0x1b')]||0x96;this[_0x7e12('0x1c')]=_0x284af7[_0x7e12('0x1c')]||0x3;this[_0x7e12('0x1d')]=_0x284af7[_0x7e12('0x1d')]||0x96;this[_0x7e12('0x1e')]=_0x284af7[_0x7e12('0x1e')]||0x3;this[_0x7e12('0x1f')]=_0x284af7[_0x7e12('0x1f')]||0x96;this[_0x7e12('0x20')]=_0x284af7[_0x7e12('0x20')]||_0x7e12('0x21');this[_0x7e12('0x22')]=_0x284af7[_0x7e12('0x22')]||undefined;this[_0x7e12('0x23')]=_0x284af7['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x284af7[_0x7e12('0x24')]||undefined;this[_0x7e12('0x25')]=_0x284af7[_0x7e12('0x25')]?_0x284af7[_0x7e12('0x25')]:undefined;this['Trunk']=_0x284af7['Trunk']?_0x284af7[_0x7e12('0x26')]:undefined;this[_0x7e12('0x27')]=_0x284af7['Interval']?_0x284af7[_0x7e12('0x27')]:undefined;this[_0x7e12('0x28')]=_0x284af7[_0x7e12('0x28')]?_0x284af7[_0x7e12('0x28')]:undefined;this['dialQueueProject']=_0x284af7[_0x7e12('0x28')]?_0x284af7[_0x7e12('0x28')][_0x7e12('0x0')]:undefined;this[_0x7e12('0x29')]=_0x284af7[_0x7e12('0x29')]||![];this[_0x7e12('0x2a')]=_0x284af7[_0x7e12('0x2a')];this[_0x7e12('0x2b')]=_0x284af7[_0x7e12('0x2b')];this[_0x7e12('0x2c')]=_0x284af7[_0x7e12('0x2c')];this['dialAMDTotalAnalysisTime']=_0x284af7[_0x7e12('0x2d')];this[_0x7e12('0x2e')]=_0x284af7[_0x7e12('0x2e')];this['dialAMDBetweenWordsSilence']=_0x284af7[_0x7e12('0x2f')];this['dialAMDMaximumNumberOfWords']=_0x284af7[_0x7e12('0x30')];this[_0x7e12('0x31')]=_0x284af7['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x284af7[_0x7e12('0x32')];}module[_0x7e12('0x33')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 7859f15..ade3176 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 _0x24bb=['exports','starttime','destinationchannel','calleridname','connectedlinenum','accountcode','linkedid','exten','answered','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','disposition','monitor','monitorFilename','queue','transferconnectedlinenum','transferType'];(function(_0x47d14c,_0x466c7e){var _0x5f22f3=function(_0x2625c5){while(--_0x2625c5){_0x47d14c['push'](_0x47d14c['shift']());}};_0x5f22f3(++_0x466c7e);}(_0x24bb,0x19f));var _0xb24b=function(_0x1cdfec,_0x248086){_0x1cdfec=_0x1cdfec-0x0;var _0x462f00=_0x24bb[_0x1cdfec];return _0x462f00;};'use strict';function Channel(){this[_0xb24b('0x0')]=null;this['channel']='';this[_0xb24b('0x1')]='';this['calleridnum']=0x0;this[_0xb24b('0x2')]='';this[_0xb24b('0x3')]=undefined;this['connectedlinename']=undefined;this[_0xb24b('0x4')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0xb24b('0x5')]=0x0;this[_0xb24b('0x6')]=0x0;this[_0xb24b('0x7')]=![];this['answertime']=null;this['endtime']=null;this[_0xb24b('0x8')]=![];this[_0xb24b('0x9')]=![];this[_0xb24b('0xa')]='';this[_0xb24b('0xb')]='';this[_0xb24b('0xc')]=0x0;this[_0xb24b('0xd')]=0x0;this[_0xb24b('0xe')]=0x0;this[_0xb24b('0xf')]=null;this['tag']=null;this[_0xb24b('0x10')]=null;this[_0xb24b('0x11')]=![];this[_0xb24b('0x12')]=null;this[_0xb24b('0x13')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xb24b('0x14')]=undefined;this[_0xb24b('0x15')]=undefined;this['mohtime']=0x0;}module[_0xb24b('0x16')]=Channel; \ No newline at end of file +var _0x49f5=['type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','channel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x49f5,0xd0));var _0x549f=function(_0x3e231b,_0x126ff3){_0x3e231b=_0x3e231b-0x0;var _0x867a46=_0x49f5[_0x3e231b];return _0x867a46;};'use strict';function Channel(){this['starttime']=null;this[_0x549f('0x0')]='';this['destinationchannel']='';this[_0x549f('0x1')]=0x0;this['calleridname']='';this[_0x549f('0x2')]=undefined;this[_0x549f('0x3')]=undefined;this[_0x549f('0x4')]=0x0;this[_0x549f('0x5')]='';this[_0x549f('0x6')]=0x0;this[_0x549f('0x7')]=0x0;this['exten']=0x0;this[_0x549f('0x8')]=![];this['answertime']=null;this[_0x549f('0x9')]=null;this[_0x549f('0xa')]=![];this[_0x549f('0xb')]=![];this[_0x549f('0xc')]='';this[_0x549f('0xd')]='';this['duration']=0x0;this[_0x549f('0xe')]=0x0;this[_0x549f('0xf')]=0x0;this[_0x549f('0x10')]=null;this[_0x549f('0x11')]=null;this[_0x549f('0x12')]=null;this[_0x549f('0x13')]=![];this[_0x549f('0x14')]=null;this[_0x549f('0x15')]=null;this[_0x549f('0x16')]=[];this[_0x549f('0x17')]=undefined;this[_0x549f('0x18')]=undefined;this[_0x549f('0x19')]=undefined;this[_0x549f('0x1a')]=0x0;}module[_0x549f('0x1b')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 81f64ed..2759968 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 _0xed8f=['token','tokenSecret','type','serverUrl','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x4f115c,_0x1ffd15){var _0xa0bfed=function(_0x269105){while(--_0x269105){_0x4f115c['push'](_0x4f115c['shift']());}};_0xa0bfed(++_0x1ffd15);}(_0xed8f,0xe9));var _0xfed8=function(_0x2078cd,_0x5bb7ec){_0x2078cd=_0x2078cd-0x0;var _0x5593d4=_0xed8f[_0x2078cd];return _0x5593d4;};'use strict';function DeskAccount(_0x4b127b){this['id']=_0x4b127b['id']||0x0;this[_0xfed8('0x0')]=_0x4b127b[_0xfed8('0x0')]||'';this[_0xfed8('0x1')]=_0x4b127b[_0xfed8('0x1')]||'';this['remoteUri']=_0x4b127b[_0xfed8('0x2')]||'';this[_0xfed8('0x3')]=_0x4b127b[_0xfed8('0x3')]||'';this[_0xfed8('0x4')]=_0x4b127b[_0xfed8('0x4')]||'';this[_0xfed8('0x5')]=_0x4b127b['consumerKey']||'';this[_0xfed8('0x6')]=_0x4b127b[_0xfed8('0x6')]||'';this[_0xfed8('0x7')]=_0x4b127b[_0xfed8('0x7')]||'';this[_0xfed8('0x8')]=_0x4b127b['tokenSecret']||'';this[_0xfed8('0x9')]=_0x4b127b[_0xfed8('0x9')]||'';this[_0xfed8('0xa')]=_0x4b127b[_0xfed8('0xa')]||'';this['Configurations']=_0x4b127b['Configurations']||{};}module[_0xfed8('0xb')]=DeskAccount; \ No newline at end of file +var _0xd7c2=['consumerKey','consumerSecret','token','tokenSecret','type','Configurations','name','username','remoteUri','authType','password'];(function(_0x2fb34b,_0x6116ff){var _0x530df9=function(_0x3855de){while(--_0x3855de){_0x2fb34b['push'](_0x2fb34b['shift']());}};_0x530df9(++_0x6116ff);}(_0xd7c2,0x171));var _0x2d7c=function(_0x42e223,_0x36df9b){_0x42e223=_0x42e223-0x0;var _0x571f9d=_0xd7c2[_0x42e223];return _0x571f9d;};'use strict';function DeskAccount(_0x184588){this['id']=_0x184588['id']||0x0;this[_0x2d7c('0x0')]=_0x184588['name']||'';this['username']=_0x184588[_0x2d7c('0x1')]||'';this[_0x2d7c('0x2')]=_0x184588['remoteUri']||'';this[_0x2d7c('0x3')]=_0x184588[_0x2d7c('0x3')]||'';this[_0x2d7c('0x4')]=_0x184588['password']||'';this[_0x2d7c('0x5')]=_0x184588[_0x2d7c('0x5')]||'';this[_0x2d7c('0x6')]=_0x184588[_0x2d7c('0x6')]||'';this[_0x2d7c('0x7')]=_0x184588[_0x2d7c('0x7')]||'';this[_0x2d7c('0x8')]=_0x184588[_0x2d7c('0x8')]||'';this[_0x2d7c('0x9')]=_0x184588['type']||'';this['serverUrl']=_0x184588['serverUrl']||'';this['Configurations']=_0x184588[_0x2d7c('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 6a230a9..b596e9a 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 _0xf791=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf791,0x1d3));var _0x1f79=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0xf791[_0x5a6de2];return _0x2c0525;};'use strict';function Dynamics365Account(_0x514cae){this['id']=_0x514cae['id']||0x0;this[_0x1f79('0x0')]=_0x514cae[_0x1f79('0x0')]||'';this['username']=_0x514cae[_0x1f79('0x1')]||'';this['password']=_0x514cae[_0x1f79('0x2')]||'';this[_0x1f79('0x3')]=_0x514cae[_0x1f79('0x3')]||'';this['tenantId']=_0x514cae[_0x1f79('0x4')]||'';this[_0x1f79('0x5')]=_0x514cae[_0x1f79('0x5')]||'';this[_0x1f79('0x6')]=_0x514cae['clientSecret']||{};this[_0x1f79('0x7')]=_0x514cae[_0x1f79('0x7')]||'';this[_0x1f79('0x8')]=_0x514cae[_0x1f79('0x8')]||![];this[_0x1f79('0x9')]=_0x514cae['Configurations']||{};this[_0x1f79('0xa')]=_0x514cae[_0x1f79('0xa')]||{};}module[_0x1f79('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x2fa0=['clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','username','password','remoteUri','tenantId'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x2fa0,0x1be));var _0x02fa=function(_0x224bd4,_0x572475){_0x224bd4=_0x224bd4-0x0;var _0x192e57=_0x2fa0[_0x224bd4];return _0x192e57;};'use strict';function Dynamics365Account(_0x347732){this['id']=_0x347732['id']||0x0;this['name']=_0x347732['name']||'';this['username']=_0x347732[_0x02fa('0x0')]||'';this[_0x02fa('0x1')]=_0x347732['password']||'';this[_0x02fa('0x2')]=_0x347732[_0x02fa('0x2')]||'';this[_0x02fa('0x3')]=_0x347732[_0x02fa('0x3')]||'';this['clientId']=_0x347732['clientId']||'';this[_0x02fa('0x4')]=_0x347732[_0x02fa('0x4')]||{};this['serverUrl']=_0x347732[_0x02fa('0x5')]||'';this[_0x02fa('0x6')]=_0x347732[_0x02fa('0x6')]||![];this[_0x02fa('0x7')]=_0x347732[_0x02fa('0x7')]||{};this[_0x02fa('0x8')]=_0x347732[_0x02fa('0x8')]||{};}module[_0x02fa('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 2aa3574..b8812fe 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 _0x7126=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','modem','gateway','faxdetect'];(function(_0x5280f4,_0x3c36d0){var _0xba93e7=function(_0x14d63a){while(--_0x14d63a){_0x5280f4['push'](_0x5280f4['shift']());}};_0xba93e7(++_0x3c36d0);}(_0x7126,0x67));var _0x6712=function(_0x31d1ae,_0x3061dc){_0x31d1ae=_0x31d1ae-0x0;var _0x1f9bda=_0x7126[_0x31d1ae];return _0x1f9bda;};'use strict';function FaxAccount(_0xe2e289){this['id']=_0xe2e289['id']||0x0;this[_0x6712('0x0')]=_0xe2e289['name']||'';this[_0x6712('0x1')]=_0xe2e289[_0x6712('0x1')];this[_0x6712('0x2')]=_0xe2e289[_0x6712('0x2')];this[_0x6712('0x3')]=_0xe2e289[_0x6712('0x3')];this['localstationid']=_0xe2e289[_0x6712('0x4')];this[_0x6712('0x5')]=_0xe2e289[_0x6712('0x5')]||0x960;this['maxrate']=_0xe2e289['maxrate']||0x3840;this[_0x6712('0x6')]=_0xe2e289[_0x6712('0x6')]||'v17,v27,v29';this[_0x6712('0x7')]=_0xe2e289['gateway']||'no';this['faxdetect']=_0xe2e289[_0x6712('0x8')]||'no';this[_0x6712('0x9')]=_0xe2e289['t38timeout']||0x1388;this[_0x6712('0xa')]=_0xe2e289[_0x6712('0xa')]||_0x6712('0xb');this[_0x6712('0xc')]=_0xe2e289[_0x6712('0xc')]?_0xe2e289['Trunk']:undefined;this['ListId']=_0xe2e289[_0x6712('0xd')];this[_0x6712('0xe')]=_0xe2e289['key'];}module[_0x6712('0xf')]=FaxAccount; \ No newline at end of file +var _0x1606=['v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x3a317c,_0x4a88d9){var _0x1f7e34=function(_0x2c46c7){while(--_0x2c46c7){_0x3a317c['push'](_0x3a317c['shift']());}};_0x1f7e34(++_0x4a88d9);}(_0x1606,0x1d8));var _0x6160=function(_0x40973b,_0x3bd7a2){_0x40973b=_0x40973b-0x0;var _0x1f0ce2=_0x1606[_0x40973b];return _0x1f0ce2;};'use strict';function FaxAccount(_0x9fecde){this['id']=_0x9fecde['id']||0x0;this[_0x6160('0x0')]=_0x9fecde[_0x6160('0x0')]||'';this[_0x6160('0x1')]=_0x9fecde[_0x6160('0x1')];this[_0x6160('0x2')]=_0x9fecde['ecm'];this[_0x6160('0x3')]=_0x9fecde[_0x6160('0x3')];this[_0x6160('0x4')]=_0x9fecde['localstationid'];this[_0x6160('0x5')]=_0x9fecde[_0x6160('0x5')]||0x960;this[_0x6160('0x6')]=_0x9fecde[_0x6160('0x6')]||0x3840;this[_0x6160('0x7')]=_0x9fecde[_0x6160('0x7')]||_0x6160('0x8');this['gateway']=_0x9fecde[_0x6160('0x9')]||'no';this['faxdetect']=_0x9fecde[_0x6160('0xa')]||'no';this[_0x6160('0xb')]=_0x9fecde[_0x6160('0xb')]||0x1388;this[_0x6160('0xc')]=_0x9fecde[_0x6160('0xc')]||'SIP';this['Trunk']=_0x9fecde[_0x6160('0xd')]?_0x9fecde[_0x6160('0xd')]:undefined;this[_0x6160('0xe')]=_0x9fecde['ListId'];this[_0x6160('0xf')]=_0x9fecde[_0x6160('0xf')];}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 190dd49..35192fd 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 _0x4a97=['Configurations','name','username','apiKey','remoteUri','serverUrl'];(function(_0x51e418,_0x2541bc){var _0x68ff16=function(_0x597a2a){while(--_0x597a2a){_0x51e418['push'](_0x51e418['shift']());}};_0x68ff16(++_0x2541bc);}(_0x4a97,0x1c3));var _0x74a9=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0x4a97[_0x17882c];return _0x355a59;};'use strict';function FreshdeskAccount(_0x3a944c){this['id']=_0x3a944c['id']||0x0;this[_0x74a9('0x0')]=_0x3a944c[_0x74a9('0x0')]||'';this[_0x74a9('0x1')]=_0x3a944c[_0x74a9('0x1')]||'';this[_0x74a9('0x2')]=_0x3a944c['token']||'';this[_0x74a9('0x3')]=_0x3a944c[_0x74a9('0x3')]||'';this[_0x74a9('0x4')]=_0x3a944c['serverUrl']||'';this[_0x74a9('0x5')]=_0x3a944c['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x407b=['name','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x41f557,_0x59d250){var _0x4170d6=function(_0x41b8bc){while(--_0x41b8bc){_0x41f557['push'](_0x41f557['shift']());}};_0x4170d6(++_0x59d250);}(_0x407b,0xbe));var _0xb407=function(_0x526138,_0x2479c1){_0x526138=_0x526138-0x0;var _0x362a06=_0x407b[_0x526138];return _0x362a06;};'use strict';function FreshdeskAccount(_0x3efcaa){this['id']=_0x3efcaa['id']||0x0;this[_0xb407('0x0')]=_0x3efcaa[_0xb407('0x0')]||'';this['username']=_0x3efcaa['username']||'';this[_0xb407('0x1')]=_0x3efcaa['token']||'';this[_0xb407('0x2')]=_0x3efcaa[_0xb407('0x2')]||'';this['serverUrl']=_0x3efcaa[_0xb407('0x3')]||'';this['Configurations']=_0x3efcaa[_0xb407('0x4')]||{};}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 bc09da3..8178a93 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 _0x02a7=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0xbd34f1,_0x5656ed){var _0x492a68=function(_0x1e0543){while(--_0x1e0543){_0xbd34f1['push'](_0xbd34f1['shift']());}};_0x492a68(++_0x5656ed);}(_0x02a7,0x7a));var _0x702a=function(_0x2b7b8b,_0x1e563f){_0x2b7b8b=_0x2b7b8b-0x0;var _0x5fefaf=_0x02a7[_0x2b7b8b];return _0x5fefaf;};'use strict';function FreshsalesAccount(_0x3f86b1){this['id']=_0x3f86b1['id']||0x0;this[_0x702a('0x0')]=_0x3f86b1['name']||'';this['username']=_0x3f86b1[_0x702a('0x1')]||'';this[_0x702a('0x2')]=_0x3f86b1[_0x702a('0x3')]||'';this[_0x702a('0x4')]=_0x3f86b1[_0x702a('0x4')]||'';this[_0x702a('0x5')]=_0x3f86b1[_0x702a('0x5')]||'';this['Configurations']=_0x3f86b1[_0x702a('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xc906=['remoteUri','serverUrl','Configurations','name','username','apiKey'];(function(_0x496b67,_0x4854d3){var _0x513702=function(_0x15eafe){while(--_0x15eafe){_0x496b67['push'](_0x496b67['shift']());}};_0x513702(++_0x4854d3);}(_0xc906,0x1ad));var _0x6c90=function(_0x4b7f8c,_0x583e2f){_0x4b7f8c=_0x4b7f8c-0x0;var _0x57cf35=_0xc906[_0x4b7f8c];return _0x57cf35;};'use strict';function FreshsalesAccount(_0x1b05cc){this['id']=_0x1b05cc['id']||0x0;this[_0x6c90('0x0')]=_0x1b05cc['name']||'';this[_0x6c90('0x1')]=_0x1b05cc[_0x6c90('0x1')]||'';this[_0x6c90('0x2')]=_0x1b05cc['token']||'';this[_0x6c90('0x3')]=_0x1b05cc[_0x6c90('0x3')]||'';this[_0x6c90('0x4')]=_0x1b05cc[_0x6c90('0x4')]||'';this[_0x6c90('0x5')]=_0x1b05cc[_0x6c90('0x5')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 1f19484..d767fb7 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 _0xf32d=['originalposition','accountcode','context','exten','voice','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0xf32d,0x1ab));var _0xdf32=function(_0x54b7a6,_0x44d765){_0x54b7a6=_0x54b7a6-0x0;var _0x3cd004=_0xf32d[_0x54b7a6];return _0x3cd004;};'use strict';function QueueReport(){this[_0xdf32('0x0')]=_0xdf32('0x1');this[_0xdf32('0x2')]='';this[_0xdf32('0x3')]='';this['calleridname']='';this[_0xdf32('0x4')]='';this[_0xdf32('0x5')]=null;this['queuecallerleaveAt']=null;this[_0xdf32('0x6')]=0x1;this[_0xdf32('0x7')]=0x1;this['queuecallerabandon']=![];this[_0xdf32('0x8')]=null;this[_0xdf32('0x9')]=![];this[_0xdf32('0xa')]=null;this[_0xdf32('0xb')]=![];this[_0xdf32('0xc')]=null;this[_0xdf32('0xd')]=0x1;this['channel']='';this['connectedlinenum']='';this['connectedlinename']='';this[_0xdf32('0xe')]='';this[_0xdf32('0xf')]='';this[_0xdf32('0x10')]='';this['priority']='';this['holdtime']=0x0;this['assigned']=![];this['lastAssignedTo']='';this['motionChannel']=_0xdf32('0x11');this['mohtime']=0x0;this[_0xdf32('0x12')]={};}module[_0xdf32('0x13')]=QueueReport; \ No newline at end of file +var _0x6f25=['accountcode','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables','exports','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6f25,0xc7));var _0x56f2=function(_0x184654,_0x1da76c){_0x184654=_0x184654-0x0;var _0x2e2bbb=_0x6f25[_0x184654];return _0x2e2bbb;};'use strict';function QueueReport(){this[_0x56f2('0x0')]='inbound';this[_0x56f2('0x1')]='';this[_0x56f2('0x2')]='';this[_0x56f2('0x3')]='';this['queue']='';this[_0x56f2('0x4')]=null;this[_0x56f2('0x5')]=null;this['position']=0x1;this[_0x56f2('0x6')]=0x1;this[_0x56f2('0x7')]=![];this[_0x56f2('0x8')]=null;this[_0x56f2('0x9')]=![];this[_0x56f2('0xa')]=null;this[_0x56f2('0xb')]=![];this[_0x56f2('0xc')]=null;this[_0x56f2('0xd')]=0x1;this[_0x56f2('0xe')]='';this[_0x56f2('0xf')]='';this[_0x56f2('0x10')]='';this[_0x56f2('0x11')]='';this['context']='';this[_0x56f2('0x12')]='';this[_0x56f2('0x13')]='';this[_0x56f2('0x14')]=0x0;this[_0x56f2('0x15')]=![];this[_0x56f2('0x16')]='';this[_0x56f2('0x17')]=_0x56f2('0x18');this['mohtime']=0x0;this[_0x56f2('0x19')]={};}module[_0x56f2('0x1a')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index eabba17..646cdf1 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 _0x0701=['remoteUri','password','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','username'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0x0701,0x166));var _0x1070=function(_0x31032a,_0x1890b4){_0x31032a=_0x31032a-0x0;var _0x3478e8=_0x0701[_0x31032a];return _0x3478e8;};'use strict';function SalesforceAccount(_0x1d4370){this['id']=_0x1d4370['id']||0x0;this[_0x1070('0x0')]=_0x1d4370['name']||'';this[_0x1070('0x1')]=_0x1d4370[_0x1070('0x1')]||'';this[_0x1070('0x2')]=_0x1d4370[_0x1070('0x2')]||'';this[_0x1070('0x3')]=_0x1d4370[_0x1070('0x3')]||'';this['clientId']=_0x1d4370['clientId']||'';this[_0x1070('0x4')]=_0x1d4370['clientSecret']||'';this['securityToken']=_0x1d4370[_0x1070('0x5')]||'';this[_0x1070('0x6')]=_0x1d4370['type']||_0x1070('0x7');this[_0x1070('0x8')]=_0x1d4370[_0x1070('0x8')]||'';this[_0x1070('0x9')]=_0x1d4370['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xff89=['type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x2989c0,_0x21c20e){var _0x28f859=function(_0x587d00){while(--_0x587d00){_0x2989c0['push'](_0x2989c0['shift']());}};_0x28f859(++_0x21c20e);}(_0xff89,0x149));var _0x9ff8=function(_0xf5b0f5,_0x153b1f){_0xf5b0f5=_0xf5b0f5-0x0;var _0x557e22=_0xff89[_0xf5b0f5];return _0x557e22;};'use strict';function SalesforceAccount(_0x2fef30){this['id']=_0x2fef30['id']||0x0;this[_0x9ff8('0x0')]=_0x2fef30[_0x9ff8('0x0')]||'';this[_0x9ff8('0x1')]=_0x2fef30[_0x9ff8('0x1')]||'';this[_0x9ff8('0x2')]=_0x2fef30[_0x9ff8('0x2')]||'';this[_0x9ff8('0x3')]=_0x2fef30[_0x9ff8('0x3')]||'';this[_0x9ff8('0x4')]=_0x2fef30[_0x9ff8('0x4')]||'';this[_0x9ff8('0x5')]=_0x2fef30['clientSecret']||'';this[_0x9ff8('0x6')]=_0x2fef30[_0x9ff8('0x6')]||'';this[_0x9ff8('0x7')]=_0x2fef30['type']||_0x9ff8('0x8');this[_0x9ff8('0x9')]=_0x2fef30[_0x9ff8('0x9')]||'';this[_0x9ff8('0xa')]=_0x2fef30[_0x9ff8('0xa')]||{};}module[_0x9ff8('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index d36ad7a..e0cb655 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 _0xbc94=['Configurations','exports','name','password','remoteUri'];(function(_0x764874,_0x3ed544){var _0x29f9d5=function(_0x152dad){while(--_0x152dad){_0x764874['push'](_0x764874['shift']());}};_0x29f9d5(++_0x3ed544);}(_0xbc94,0x124));var _0x4bc9=function(_0x1f0f74,_0x53b3cd){_0x1f0f74=_0x1f0f74-0x0;var _0x2f0484=_0xbc94[_0x1f0f74];return _0x2f0484;};'use strict';function ServicenowAccount(_0x32be8e){this['id']=_0x32be8e['id']||0x0;this[_0x4bc9('0x0')]=_0x32be8e[_0x4bc9('0x0')]||'';this['username']=_0x32be8e['username']||'';this['password']=_0x32be8e[_0x4bc9('0x1')]||'';this[_0x4bc9('0x2')]=_0x32be8e['remoteUri']||'';this['serverUrl']=_0x32be8e['serverUrl']||'';this[_0x4bc9('0x3')]=_0x32be8e['Configurations']||{};}module[_0x4bc9('0x4')]=ServicenowAccount; \ No newline at end of file +var _0x974c=['Configurations','username','password','serverUrl'];(function(_0x88e3bf,_0x4d8151){var _0x1d2416=function(_0x28a58b){while(--_0x28a58b){_0x88e3bf['push'](_0x88e3bf['shift']());}};_0x1d2416(++_0x4d8151);}(_0x974c,0x185));var _0xc974=function(_0x3445ee,_0x3ab2bc){_0x3445ee=_0x3445ee-0x0;var _0x5b9e9f=_0x974c[_0x3445ee];return _0x5b9e9f;};'use strict';function ServicenowAccount(_0x2e7d1b){this['id']=_0x2e7d1b['id']||0x0;this['name']=_0x2e7d1b['name']||'';this[_0xc974('0x0')]=_0x2e7d1b[_0xc974('0x0')]||'';this[_0xc974('0x1')]=_0x2e7d1b[_0xc974('0x1')]||'';this['remoteUri']=_0x2e7d1b['remoteUri']||'';this[_0xc974('0x2')]=_0x2e7d1b['serverUrl']||'';this[_0xc974('0x3')]=_0x2e7d1b['Configurations']||{};}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 0f2f155..30d1f6a 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 _0x3ebf=['username','password','serverUrl','Configurations','name'];(function(_0x2e4027,_0x4e8b32){var _0x1d8aa2=function(_0x6de516){while(--_0x6de516){_0x2e4027['push'](_0x2e4027['shift']());}};_0x1d8aa2(++_0x4e8b32);}(_0x3ebf,0x153));var _0xf3eb=function(_0x171ba6,_0x14487b){_0x171ba6=_0x171ba6-0x0;var _0x3c91da=_0x3ebf[_0x171ba6];return _0x3c91da;};'use strict';function SugarcrmAccount(_0x20a8b0){this['id']=_0x20a8b0['id']||0x0;this[_0xf3eb('0x0')]=_0x20a8b0[_0xf3eb('0x0')]||'';this[_0xf3eb('0x1')]=_0x20a8b0[_0xf3eb('0x1')]||'';this['password']=_0x20a8b0[_0xf3eb('0x2')]||'';this['remoteUri']=_0x20a8b0['remoteUri']||'';this[_0xf3eb('0x3')]=_0x20a8b0[_0xf3eb('0x3')]||'';this[_0xf3eb('0x4')]=_0x20a8b0[_0xf3eb('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x68f2=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x68f2,0x165));var _0x268f=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x68f2[_0x3e112d];return _0x531c31;};'use strict';function SugarcrmAccount(_0x271f11){this['id']=_0x271f11['id']||0x0;this[_0x268f('0x0')]=_0x271f11['name']||'';this[_0x268f('0x1')]=_0x271f11[_0x268f('0x1')]||'';this[_0x268f('0x2')]=_0x271f11[_0x268f('0x2')]||'';this[_0x268f('0x3')]=_0x271f11['remoteUri']||'';this[_0x268f('0x4')]=_0x271f11[_0x268f('0x4')]||'';this[_0x268f('0x5')]=_0x271f11[_0x268f('0x5')]||{};}module[_0x268f('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 d9a6e3a..5078d4e 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 _0xd588=['unknown','stateTime','status','address','exports','name','accountcode','state'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xd588,0x195));var _0x8d58=function(_0x55dfca,_0x4bdb29){_0x55dfca=_0x55dfca-0x0;var _0x21fa48=_0xd588[_0x55dfca];return _0x21fa48;};'use strict';function Telephone(_0x1bebaf){this['id']=_0x1bebaf['id']||0x0;this['name']=_0x1bebaf[_0x8d58('0x0')]||'';this[_0x8d58('0x1')]=_0x1bebaf[_0x8d58('0x1')]||'';this[_0x8d58('0x2')]=_0x8d58('0x3');this[_0x8d58('0x4')]=0x0;this[_0x8d58('0x5')]=_0x8d58('0x3');this[_0x8d58('0x6')]='';}module[_0x8d58('0x7')]=Telephone; \ No newline at end of file +var _0x46aa=['name','state','unknown','stateTime','status','address'];(function(_0x3f64c7,_0x483532){var _0x18ab3c=function(_0x1089e3){while(--_0x1089e3){_0x3f64c7['push'](_0x3f64c7['shift']());}};_0x18ab3c(++_0x483532);}(_0x46aa,0x90));var _0xa46a=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x46aa[_0x5f309e];return _0x487b5e;};'use strict';function Telephone(_0x5ab1d1){this['id']=_0x5ab1d1['id']||0x0;this[_0xa46a('0x0')]=_0x5ab1d1[_0xa46a('0x0')]||'';this['accountcode']=_0x5ab1d1['accountcode']||'';this[_0xa46a('0x1')]=_0xa46a('0x2');this[_0xa46a('0x3')]=0x0;this[_0xa46a('0x4')]=_0xa46a('0x2');this[_0xa46a('0x5')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index b9d3136..c116f1f 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(_0x25774c,_0x4b6292){var _0x55ab38=function(_0x38d6a6){while(--_0x38d6a6){_0x25774c['push'](_0x25774c['shift']());}};_0x55ab38(++_0x4b6292);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x29ed44,_0x8ee390){var _0x16fe39=function(_0x3dac92){while(--_0x3dac92){_0x29ed44['push'](_0x29ed44['shift']());}};_0x16fe39(++_0x8ee390);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 e25d1c8..01fdc06 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 _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file +var _0x5f2f=['AnyConditions','Actions','exports','name','channel','voice','status'];(function(_0x38d3db,_0x536c37){var _0x1dbe48=function(_0x522817){while(--_0x522817){_0x38d3db['push'](_0x38d3db['shift']());}};_0x1dbe48(++_0x536c37);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2c3e94,_0x2290e4){_0x2c3e94=_0x2c3e94-0x0;var _0x31f0fb=_0x5f2f[_0x2c3e94];return _0x31f0fb;};'use strict';function Trigger(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||_0xf5f2('0x2');this[_0xf5f2('0x3')]=_0x7c86d8[_0xf5f2('0x3')]||![];this['AllConditions']=_0x7c86d8['AllConditions']||[];this[_0xf5f2('0x4')]=_0x7c86d8[_0xf5f2('0x4')]||[];this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||[];}module[_0xf5f2('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index a33c03e..038ba5b 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 _0x3066=['active','name','state','unknown','stateTime','status','registry','indexOf','split','host','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports'];(function(_0x3ea852,_0x2beef0){var _0x285247=function(_0x22b246){while(--_0x22b246){_0x3ea852['push'](_0x3ea852['shift']());}};_0x285247(++_0x2beef0);}(_0x3066,0x156));var _0x6306=function(_0x467474,_0x34a581){_0x467474=_0x467474-0x0;var _0x162986=_0x3066[_0x467474];return _0x162986;};'use strict';function Trunk(_0x297362){this['id']=_0x297362['id']||0x0;this[_0x6306('0x0')]=_0x297362[_0x6306('0x0')]||![];this[_0x6306('0x1')]=_0x297362[_0x6306('0x1')]||'';this[_0x6306('0x2')]=_0x6306('0x3');this[_0x6306('0x4')]=0x0;this[_0x6306('0x5')]=_0x6306('0x3');this[_0x6306('0x6')]=_0x297362[_0x6306('0x6')]&&_0x297362[_0x6306('0x6')][_0x6306('0x7')](':')?_0x297362[_0x6306('0x6')][_0x6306('0x8')](':')[0x0]:'';this[_0x6306('0x9')]='';this['port']='';this[_0x6306('0xa')]='';this[_0x6306('0xb')]='';this[_0x6306('0xc')]='';this[_0x6306('0xd')]=_0x6306('0x3');this[_0x6306('0xe')]='';this[_0x6306('0xf')]='';this['defaultuser']=_0x297362[_0x6306('0x10')]||'';}module[_0x6306('0x11')]=Trunk; \ No newline at end of file +var _0x8d52=['defaultuser','exports','active','name','state','unknown','stateTime','registry','host','port','domain','refresh','stateRegistry','address'];(function(_0x175d83,_0x4693d9){var _0xe6503e=function(_0x21bca3){while(--_0x21bca3){_0x175d83['push'](_0x175d83['shift']());}};_0xe6503e(++_0x4693d9);}(_0x8d52,0xaa));var _0x28d5=function(_0x313691,_0x48ceb4){_0x313691=_0x313691-0x0;var _0x18cee7=_0x8d52[_0x313691];return _0x18cee7;};'use strict';function Trunk(_0x5e08ff){this['id']=_0x5e08ff['id']||0x0;this[_0x28d5('0x0')]=_0x5e08ff[_0x28d5('0x0')]||![];this[_0x28d5('0x1')]=_0x5e08ff[_0x28d5('0x1')]||'';this[_0x28d5('0x2')]=_0x28d5('0x3');this[_0x28d5('0x4')]=0x0;this['status']='unknown';this['registry']=_0x5e08ff[_0x28d5('0x5')]&&_0x5e08ff['registry']['indexOf'](':')?_0x5e08ff['registry']['split'](':')[0x0]:'';this[_0x28d5('0x6')]='';this[_0x28d5('0x7')]='';this[_0x28d5('0x8')]='';this['domainport']='';this[_0x28d5('0x9')]='';this[_0x28d5('0xa')]='unknown';this['registrationtime']='';this[_0x28d5('0xb')]='';this[_0x28d5('0xc')]=_0x5e08ff[_0x28d5('0xc')]||'';}module[_0x28d5('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index d06cdca..b412770 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 _0x5b49=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x569a45,_0x2da15b){var _0x1a5ef8=function(_0x1389b7){while(--_0x1389b7){_0x569a45['push'](_0x569a45['shift']());}};_0x1a5ef8(++_0x2da15b);}(_0x5b49,0x189));var _0x95b4=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x5b49[_0x29b609];return _0x54c952;};'use strict';function voiceExtension(_0x3afddc){this['id']=_0x3afddc['id']||0x0;this[_0x95b4('0x0')]=_0x3afddc[_0x95b4('0x0')]||'';this[_0x95b4('0x1')]=_0x3afddc['recordingFormat']||_0x95b4('0x2');this[_0x95b4('0x3')]=_0x3afddc[_0x95b4('0x3')]||![];}module[_0x95b4('0x4')]=voiceExtension; \ No newline at end of file +var _0xca7d=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x1f96cb,_0x5a59d6){var _0x58dd0c=function(_0x5213f8){while(--_0x5213f8){_0x1f96cb['push'](_0x1f96cb['shift']());}};_0x58dd0c(++_0x5a59d6);}(_0xca7d,0x17f));var _0xdca7=function(_0x3edc11,_0x5ebea9){_0x3edc11=_0x3edc11-0x0;var _0x2e5b18=_0xca7d[_0x3edc11];return _0x2e5b18;};'use strict';function voiceExtension(_0x74248b){this['id']=_0x74248b['id']||0x0;this[_0xdca7('0x0')]=_0x74248b['exten']||'';this[_0xdca7('0x1')]=_0x74248b['recordingFormat']||_0xdca7('0x2');this[_0xdca7('0x3')]=_0x74248b[_0xdca7('0x3')]||![];}module[_0xdca7('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 0fd29c7..f63a420 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 _0x7e75=['dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','not_inuse','inuse','unavailable','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','talking','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7e75,0x7d));var _0x57e7=function(_0x3f9994,_0x171dd8){_0x3f9994=_0x3f9994-0x0;var _0x310f97=_0x7e75[_0x3f9994];return _0x310f97;};'use strict';var statusDesc=['unknown',_0x57e7('0x0'),_0x57e7('0x1'),'busy','invalid',_0x57e7('0x2'),'ringing',_0x57e7('0x3'),'onhold'];var monitorFormat={'wav':_0x57e7('0x4'),'wav49':_0x57e7('0x5'),'gsm':_0x57e7('0x6')};var strategy={'rrmemory':_0x57e7('0x7'),'roundrobin':_0x57e7('0x8')};function VoiceQueue(_0x40a758){this['id']=_0x40a758['id']||0x0;this[_0x57e7('0x9')]=_0x40a758[_0x57e7('0x9')]||'';this[_0x57e7('0xa')]=_0x40a758[_0x57e7('0xa')]||'';this[_0x57e7('0xb')]=_0x40a758[_0x57e7('0xb')]||'inbound';this['waiting']=0x0;this[_0x57e7('0xc')]=0x0;this[_0x57e7('0xd')]=0x0;this[_0x57e7('0xe')]=0x0;this['sumDuration']=0x0;this[_0x57e7('0xf')]=0x0;this[_0x57e7('0x10')]=0x0;this[_0x57e7('0x11')]=0x0;this[_0x57e7('0x12')]=0x0;this[_0x57e7('0x13')]=0x0;this[_0x57e7('0x14')]=0x0;this[_0x57e7('0x15')]=_0x40a758[_0x57e7('0x15')]||![];this[_0x57e7('0x16')]=_0x40a758[_0x57e7('0x16')]||0xa;this['autopause']=_0x40a758['autopause']||'no';this[_0x57e7('0x17')]=!![];this['message']='';this[_0x57e7('0x18')]=0x0;this[_0x57e7('0x19')]=0x0;this[_0x57e7('0x1a')]=_0x40a758[_0x57e7('0x1a')]||null;this[_0x57e7('0x1b')]=_0x40a758[_0x57e7('0x1b')]?_0x40a758[_0x57e7('0x1b')]:null;this[_0x57e7('0x1c')]=_0x40a758['dialActive'];this['dialMethod']=_0x40a758['dialMethod']||_0x57e7('0x1d');this[_0x57e7('0x1e')]=_0x40a758['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x40a758[_0x57e7('0x1f')]||0x0;this[_0x57e7('0x20')]=_0x40a758['dialPowerLevel']||0x1;this[_0x57e7('0x21')]=_0x40a758[_0x57e7('0x21')]||'dropRate';this[_0x57e7('0x22')]=_0x40a758[_0x57e7('0x22')]||0.03;this['dialPredictiveInterval']=_0x40a758[_0x57e7('0x23')]||0x258;this[_0x57e7('0x24')]=_0x40a758[_0x57e7('0x24')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x40a758[_0x57e7('0x25')]||_0x57e7('0x26');this[_0x57e7('0x27')]=_0x40a758['dialOriginateTimeout']||0x1e;this[_0x57e7('0x28')]=_0x40a758[_0x57e7('0x28')]||_0x57e7('0x29');this[_0x57e7('0x2a')]=_0x40a758[_0x57e7('0x2a')]||0x3;this[_0x57e7('0x2b')]=_0x40a758['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x40a758['dialCongestionMaxRetry']||0x3;this[_0x57e7('0x2c')]=_0x40a758[_0x57e7('0x2c')]||0x96;this['dialBusyMaxRetry']=_0x40a758[_0x57e7('0x2d')]||0x3;this[_0x57e7('0x2e')]=_0x40a758['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x40a758[_0x57e7('0x2f')]||0x3;this[_0x57e7('0x30')]=_0x40a758[_0x57e7('0x30')]||0x96;this[_0x57e7('0x31')]=_0x40a758['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x40a758[_0x57e7('0x32')]||0x96;this['dialDropMaxRetry']=_0x40a758[_0x57e7('0x33')]||0x3;this[_0x57e7('0x34')]=_0x40a758[_0x57e7('0x34')]||0x96;this[_0x57e7('0x35')]=_0x40a758[_0x57e7('0x35')]||0x3;this[_0x57e7('0x36')]=_0x40a758['dialAbandonedRetryFrequency']||0x96;this[_0x57e7('0x37')]=_0x40a758[_0x57e7('0x37')]||0x3;this['dialMachineRetryFrequency']=_0x40a758['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x40a758[_0x57e7('0x38')]||0x3;this[_0x57e7('0x39')]=_0x40a758['dialAgentRejectRetryFrequency']||0x96;this[_0x57e7('0x3a')]=_0x40a758[_0x57e7('0x3a')]||0x3;this[_0x57e7('0x3b')]=_0x40a758[_0x57e7('0x3b')]||0x4;this[_0x57e7('0x3c')]=_0x40a758[_0x57e7('0x3c')]?_0x40a758[_0x57e7('0x3c')]:undefined;this[_0x57e7('0x3d')]=_0x40a758[_0x57e7('0x3d')]?_0x40a758[_0x57e7('0x3d')]:undefined;this[_0x57e7('0x3e')]=_0x40a758[_0x57e7('0x3e')]||undefined;this[_0x57e7('0x3f')]=_0x40a758['Interval']?_0x40a758['Interval']:undefined;this[_0x57e7('0x40')]=_0x40a758[_0x57e7('0x40')]||_0x57e7('0x41');this[_0x57e7('0x42')]=_0x40a758['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x57e7('0x43')]=_0x40a758['dialCutDigit']||undefined;this[_0x57e7('0x44')]=strategy[_0x40a758[_0x57e7('0x44')]]||_0x57e7('0x7');this[_0x57e7('0x45')]=!![];this[_0x57e7('0x46')]=_0x40a758['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x40a758[_0x57e7('0x47')];this[_0x57e7('0x48')]=_0x40a758[_0x57e7('0x48')];this[_0x57e7('0x49')]=_0x40a758[_0x57e7('0x49')];this[_0x57e7('0x4a')]=_0x40a758[_0x57e7('0x4a')];this[_0x57e7('0x4b')]=_0x40a758[_0x57e7('0x4b')];this[_0x57e7('0x4c')]=_0x40a758[_0x57e7('0x4c')];this['dialAMDMaximumNumberOfWords']=_0x40a758[_0x57e7('0x4d')];this[_0x57e7('0x4e')]=_0x40a758[_0x57e7('0x4e')];this[_0x57e7('0x4f')]=_0x40a758['dialAMDMaximumWordLength'];this[_0x57e7('0x50')]=0x0;this['pTalking']=0x0;this[_0x57e7('0x51')]=_0x40a758[_0x57e7('0x51')];this[_0x57e7('0x52')]=0x0;this[_0x57e7('0x53')]=0x0;this[_0x57e7('0x54')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x57e7('0x55')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x57e7('0x56')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x57e7('0x57')]=0x0;this[_0x57e7('0x58')]=0x0;this[_0x57e7('0x59')]=0x0;this[_0x57e7('0x5a')]=0x0;this[_0x57e7('0x5b')]=0x0;this[_0x57e7('0x5c')]=undefined;this[_0x57e7('0x5d')]=undefined;this[_0x57e7('0x5e')]=undefined;this[_0x57e7('0x5f')]=1.05;this[_0x57e7('0x60')]=0x0;this[_0x57e7('0x61')]=0x0;this[_0x57e7('0x62')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x57e7('0x63')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x57e7('0x64')]=0x0;this[_0x57e7('0x65')]=_0x40a758[_0x57e7('0x66')]||0x14;this['predictiveIntervalMinThreshold']=_0x40a758[_0x57e7('0x66')]||0xa;this[_0x57e7('0x67')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x57e7('0x68')]=0x0;this[_0x57e7('0x69')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x57e7('0x6a')]=0x0;this['dialRecallMeTimeout']=_0x40a758[_0x57e7('0x6b')]||0x1e;this[_0x57e7('0x6c')]=_0x40a758[_0x57e7('0x6c')]||![];this['dialPreviewAutoRecallMe']=!!_0x40a758[_0x57e7('0x6d')]||![];this[_0x57e7('0x6e')]=!!_0x40a758[_0x57e7('0x6e')]||![];this[_0x57e7('0x6f')]=_0x40a758[_0x57e7('0x6f')]||undefined;this[_0x57e7('0x70')]=_0x40a758['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x40a758[_0x57e7('0x71')]||![];this[_0x57e7('0xa')]=monitorFormat[_0x40a758[_0x57e7('0xa')]]?monitorFormat[_0x40a758[_0x57e7('0xa')]]:undefined;this[_0x57e7('0x72')]=_0x40a758[_0x57e7('0x72')]||![];this['mandatoryDispositionPause']=_0x40a758[_0x57e7('0x73')]?_0x40a758[_0x57e7('0x73')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x0771=['outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','name','monitor_format','type','inbound','waiting','total','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x0771,0x1ed));var _0x1077=function(_0x8bca3f,_0x158cf8){_0x8bca3f=_0x8bca3f-0x0;var _0x448ab5=_0x0771[_0x8bca3f];return _0x448ab5;};'use strict';var statusDesc=[_0x1077('0x0'),_0x1077('0x1'),_0x1077('0x2'),_0x1077('0x3'),_0x1077('0x4'),_0x1077('0x5'),_0x1077('0x6'),_0x1077('0x7'),_0x1077('0x8')];var monitorFormat={'wav':_0x1077('0x9'),'wav49':_0x1077('0xa'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x54d64b){this['id']=_0x54d64b['id']||0x0;this[_0x1077('0xb')]=_0x54d64b[_0x1077('0xb')]||'';this[_0x1077('0xc')]=_0x54d64b[_0x1077('0xc')]||'';this[_0x1077('0xd')]=_0x54d64b[_0x1077('0xd')]||_0x1077('0xe');this[_0x1077('0xf')]=0x0;this['talking']=0x0;this[_0x1077('0x10')]=0x0;this['answered']=0x0;this[_0x1077('0x11')]=0x0;this[_0x1077('0x12')]=0x0;this['sumBillable']=0x0;this[_0x1077('0x13')]=0x0;this[_0x1077('0x14')]=0x0;this[_0x1077('0x15')]=0x0;this['available']=0x0;this[_0x1077('0x16')]=_0x54d64b[_0x1077('0x16')]||![];this['acwTimeout']=_0x54d64b[_0x1077('0x17')]||0xa;this[_0x1077('0x18')]=_0x54d64b[_0x1077('0x18')]||'no';this[_0x1077('0x19')]=!![];this['message']='';this[_0x1077('0x1a')]=0x0;this[_0x1077('0x1b')]=0x0;this['dialTimezone']=_0x54d64b['dialTimezone']||null;this[_0x1077('0x1c')]=_0x54d64b[_0x1077('0x1c')]?_0x54d64b[_0x1077('0x1c')]:null;this['dialActive']=_0x54d64b[_0x1077('0x1d')];this[_0x1077('0x1e')]=_0x54d64b[_0x1077('0x1e')]||_0x1077('0x1f');this[_0x1077('0x20')]=_0x54d64b[_0x1077('0x20')]||0x0;this[_0x1077('0x21')]=_0x54d64b['dialLimitQueue']||0x0;this[_0x1077('0x22')]=_0x54d64b[_0x1077('0x22')]||0x1;this[_0x1077('0x23')]=_0x54d64b[_0x1077('0x23')]||_0x1077('0x24');this[_0x1077('0x25')]=_0x54d64b[_0x1077('0x25')]||0.03;this[_0x1077('0x26')]=_0x54d64b['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x54d64b['dialOriginateCallerIdName']||_0x1077('0x27');this[_0x1077('0x28')]=_0x54d64b['dialOriginateCallerIdNumber']||_0x1077('0x27');this[_0x1077('0x29')]=_0x54d64b['dialOriginateTimeout']||0x1e;this[_0x1077('0x2a')]=_0x54d64b[_0x1077('0x2a')]||_0x1077('0x2b');this[_0x1077('0x2c')]=_0x54d64b[_0x1077('0x2c')]||0x3;this['dialQueueProject']=_0x54d64b[_0x1077('0x2d')]||undefined;this[_0x1077('0x2e')]=_0x54d64b[_0x1077('0x2e')]||0x3;this[_0x1077('0x2f')]=_0x54d64b[_0x1077('0x2f')]||0x96;this[_0x1077('0x30')]=_0x54d64b[_0x1077('0x30')]||0x3;this[_0x1077('0x31')]=_0x54d64b[_0x1077('0x31')]||0x96;this['dialNoAnswerMaxRetry']=_0x54d64b[_0x1077('0x32')]||0x3;this[_0x1077('0x33')]=_0x54d64b['dialNoAnswerRetryFrequency']||0x96;this[_0x1077('0x34')]=_0x54d64b[_0x1077('0x34')]||0x3;this[_0x1077('0x35')]=_0x54d64b[_0x1077('0x35')]||0x96;this[_0x1077('0x36')]=_0x54d64b[_0x1077('0x36')]||0x3;this['dialDropRetryFrequency']=_0x54d64b['dialDropRetryFrequency']||0x96;this[_0x1077('0x37')]=_0x54d64b[_0x1077('0x37')]||0x3;this['dialAbandonedRetryFrequency']=_0x54d64b[_0x1077('0x38')]||0x96;this[_0x1077('0x39')]=_0x54d64b[_0x1077('0x39')]||0x3;this[_0x1077('0x3a')]=_0x54d64b[_0x1077('0x3a')]||0x96;this[_0x1077('0x3b')]=_0x54d64b[_0x1077('0x3b')]||0x3;this[_0x1077('0x3c')]=_0x54d64b[_0x1077('0x3c')]||0x96;this['callAdditionalPhoneAfterMin']=_0x54d64b[_0x1077('0x3d')]||0x3;this['dialGlobalMaxRetry']=_0x54d64b[_0x1077('0x3e')]||0x4;this[_0x1077('0x3f')]=_0x54d64b[_0x1077('0x3f')]?_0x54d64b[_0x1077('0x3f')]:undefined;this[_0x1077('0x40')]=_0x54d64b['TrunkBackup']?_0x54d64b[_0x1077('0x40')]:undefined;this[_0x1077('0x41')]=_0x54d64b[_0x1077('0x41')]||undefined;this[_0x1077('0x42')]=_0x54d64b[_0x1077('0x42')]?_0x54d64b['Interval']:undefined;this['dialOrderByScheduledAt']=_0x54d64b[_0x1077('0x43')]||_0x1077('0x44');this[_0x1077('0x45')]=_0x54d64b['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x1077('0x46')]=_0x54d64b[_0x1077('0x46')]||undefined;this[_0x1077('0x47')]=strategy[_0x54d64b[_0x1077('0x47')]]||_0x1077('0x48');this['queueStatusComplete']=!![];this[_0x1077('0x49')]=_0x54d64b[_0x1077('0x49')]||![];this[_0x1077('0x4a')]=_0x54d64b['dialAMDInitialSilence'];this[_0x1077('0x4b')]=_0x54d64b[_0x1077('0x4b')];this[_0x1077('0x4c')]=_0x54d64b[_0x1077('0x4c')];this['dialAMDTotalAnalysisTime']=_0x54d64b['dialAMDTotalAnalysisTime'];this[_0x1077('0x4d')]=_0x54d64b[_0x1077('0x4d')];this[_0x1077('0x4e')]=_0x54d64b[_0x1077('0x4e')];this[_0x1077('0x4f')]=_0x54d64b['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x54d64b[_0x1077('0x50')];this[_0x1077('0x51')]=_0x54d64b[_0x1077('0x51')];this[_0x1077('0x52')]=0x0;this[_0x1077('0x53')]=0x0;this['timeout']=_0x54d64b[_0x1077('0x54')];this[_0x1077('0x55')]=0x0;this[_0x1077('0x56')]=0x0;this[_0x1077('0x57')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x1077('0x58')]=0x0;this[_0x1077('0x59')]=0x0;this[_0x1077('0x5a')]=0x0;this[_0x1077('0x5b')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x1077('0x5c')]=0x0;this[_0x1077('0x5d')]=0x0;this['outboundReCallsDay']=0x0;this[_0x1077('0x5e')]=0x0;this['startProgressive']=undefined;this[_0x1077('0x5f')]=undefined;this['handlePredictive']=undefined;this[_0x1077('0x60')]=1.05;this[_0x1077('0x61')]=0x0;this[_0x1077('0x62')]=0x0;this[_0x1077('0x63')]=0x0;this[_0x1077('0x64')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x1077('0x65')]=0x0;this[_0x1077('0x66')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x54d64b[_0x1077('0x67')]||0x14;this['predictiveIntervalMinThreshold']=_0x54d64b[_0x1077('0x67')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x1077('0x68')]=0x1;this[_0x1077('0x69')]=0x0;this[_0x1077('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x54d64b[_0x1077('0x6b')]||0x1e;this[_0x1077('0x6c')]=_0x54d64b[_0x1077('0x6c')]||![];this[_0x1077('0x6d')]=!!_0x54d64b['dialPreviewAutoRecallMe']||![];this[_0x1077('0x6e')]=!!_0x54d64b[_0x1077('0x6e')]||![];this[_0x1077('0x6f')]=_0x54d64b[_0x1077('0x6f')]||undefined;this[_0x1077('0x70')]=_0x54d64b[_0x1077('0x70')]||![];this[_0x1077('0x71')]=_0x54d64b[_0x1077('0x71')]||![];this[_0x1077('0xc')]=monitorFormat[_0x54d64b[_0x1077('0xc')]]?monitorFormat[_0x54d64b[_0x1077('0xc')]]:undefined;this[_0x1077('0x72')]=_0x54d64b[_0x1077('0x72')]||![];this[_0x1077('0x73')]=_0x54d64b['mandatoryDispositionPause']?_0x54d64b[_0x1077('0x73')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index d04b509..8ef9585 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 _0xe2ce=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x11cd80,_0x2b8fb0){var _0x38b63a=function(_0x4ecd26){while(--_0x4ecd26){_0x11cd80['push'](_0x11cd80['shift']());}};_0x38b63a(++_0x2b8fb0);}(_0xe2ce,0x173));var _0xee2c=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xe2ce[_0x2576d7];return _0x16a08c;};'use strict';function VtigerAccount(_0x3e04b0){this['id']=_0x3e04b0['id']||0x0;this['name']=_0x3e04b0[_0xee2c('0x0')]||'';this[_0xee2c('0x1')]=_0x3e04b0[_0xee2c('0x1')]||'';this[_0xee2c('0x2')]=_0x3e04b0[_0xee2c('0x2')]||'';this[_0xee2c('0x3')]=_0x3e04b0['remoteUri']||'';this['serverUrl']=_0x3e04b0[_0xee2c('0x4')]||'';this[_0xee2c('0x5')]=_0x3e04b0[_0xee2c('0x5')]||{};}module[_0xee2c('0x6')]=VtigerAccount; \ No newline at end of file +var _0x340b=['accessKey','remoteUri','Configurations','exports','name','username'];(function(_0x1c4ecf,_0x1da861){var _0x2fdc96=function(_0x11eac8){while(--_0x11eac8){_0x1c4ecf['push'](_0x1c4ecf['shift']());}};_0x2fdc96(++_0x1da861);}(_0x340b,0x15a));var _0xb340=function(_0x1c92e8,_0x4793ec){_0x1c92e8=_0x1c92e8-0x0;var _0x5c9ac2=_0x340b[_0x1c92e8];return _0x5c9ac2;};'use strict';function VtigerAccount(_0x2a603a){this['id']=_0x2a603a['id']||0x0;this[_0xb340('0x0')]=_0x2a603a['name']||'';this[_0xb340('0x1')]=_0x2a603a[_0xb340('0x1')]||'';this[_0xb340('0x2')]=_0x2a603a['accessKey']||'';this['remoteUri']=_0x2a603a[_0xb340('0x3')]||'';this['serverUrl']=_0x2a603a['serverUrl']||'';this[_0xb340('0x4')]=_0x2a603a[_0xb340('0x4')]||{};}module[_0xb340('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index ecce41b..e22695d 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 _0x8fd9=['authType','type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x432e57,_0x32709a){var _0x4ae797=function(_0x4ce5a0){while(--_0x4ce5a0){_0x432e57['push'](_0x432e57['shift']());}};_0x4ae797(++_0x32709a);}(_0x8fd9,0x163));var _0x98fd=function(_0xbad322,_0x3e6b0b){_0xbad322=_0xbad322-0x0;var _0x2101cb=_0x8fd9[_0xbad322];return _0x2101cb;};'use strict';function ZendeskAccount(_0xa3b559){this['id']=_0xa3b559['id']||0x0;this[_0x98fd('0x0')]=_0xa3b559[_0x98fd('0x0')]||'';this[_0x98fd('0x1')]=_0xa3b559[_0x98fd('0x1')]||'';this['password']=_0xa3b559[_0x98fd('0x2')]||'';this['token']=_0xa3b559[_0x98fd('0x3')]||'';this[_0x98fd('0x4')]=_0xa3b559['remoteUri']||'';this[_0x98fd('0x5')]=_0xa3b559[_0x98fd('0x5')]||'';this[_0x98fd('0x6')]=_0xa3b559[_0x98fd('0x6')]||_0x98fd('0x7');this[_0x98fd('0x8')]=_0xa3b559[_0x98fd('0x8')]||'';this[_0x98fd('0x9')]=_0xa3b559[_0x98fd('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x00a1=['integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0x00a1,0x88));var _0x100a=function(_0x337518,_0x530369){_0x337518=_0x337518-0x0;var _0x45a2a3=_0x00a1[_0x337518];return _0x45a2a3;};'use strict';function ZendeskAccount(_0x308f37){this['id']=_0x308f37['id']||0x0;this[_0x100a('0x0')]=_0x308f37[_0x100a('0x0')]||'';this[_0x100a('0x1')]=_0x308f37['username']||'';this[_0x100a('0x2')]=_0x308f37[_0x100a('0x2')]||'';this[_0x100a('0x3')]=_0x308f37['token']||'';this[_0x100a('0x4')]=_0x308f37[_0x100a('0x4')]||'';this[_0x100a('0x5')]=_0x308f37[_0x100a('0x5')]||'';this[_0x100a('0x6')]=_0x308f37[_0x100a('0x6')]||_0x100a('0x7');this[_0x100a('0x8')]=_0x308f37[_0x100a('0x8')]||'';this[_0x100a('0x9')]=_0x308f37[_0x100a('0x9')]||{};}module[_0x100a('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index e2644a4..0bfa74c 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 _0x92e0=['host','zone','clientId','clientSecret','code','refreshToken','Configurations','exports','name','description'];(function(_0x781a5e,_0x17273c){var _0x6896f2=function(_0x2bb94d){while(--_0x2bb94d){_0x781a5e['push'](_0x781a5e['shift']());}};_0x6896f2(++_0x17273c);}(_0x92e0,0x166));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';function ZohoAccount(_0x5ae41d){this['id']=_0x5ae41d['id']||0x0;this[_0x092e('0x0')]=_0x5ae41d['name']||'';this[_0x092e('0x1')]=_0x5ae41d['description']||'';this[_0x092e('0x2')]=_0x5ae41d[_0x092e('0x2')]||'';this[_0x092e('0x3')]=_0x5ae41d['zone']||'';this[_0x092e('0x4')]=_0x5ae41d['clientId']||'';this[_0x092e('0x5')]=_0x5ae41d[_0x092e('0x5')]||'';this['serverUrl']=_0x5ae41d['serverUrl']||'';this[_0x092e('0x6')]=_0x5ae41d[_0x092e('0x6')]||'';this[_0x092e('0x7')]=_0x5ae41d[_0x092e('0x7')]||'';this[_0x092e('0x8')]=_0x5ae41d[_0x092e('0x8')]||{};}module[_0x092e('0x9')]=ZohoAccount; \ No newline at end of file +var _0x98d4=['Configurations','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x588901,_0x17249f){var _0x39c89c=function(_0x566dce){while(--_0x566dce){_0x588901['push'](_0x588901['shift']());}};_0x39c89c(++_0x17249f);}(_0x98d4,0xc7));var _0x498d=function(_0x138f9c,_0x3955e5){_0x138f9c=_0x138f9c-0x0;var _0x5e8a7d=_0x98d4[_0x138f9c];return _0x5e8a7d;};'use strict';function ZohoAccount(_0x327640){this['id']=_0x327640['id']||0x0;this['name']=_0x327640['name']||'';this[_0x498d('0x0')]=_0x327640['description']||'';this[_0x498d('0x1')]=_0x327640[_0x498d('0x1')]||'';this[_0x498d('0x2')]=_0x327640[_0x498d('0x2')]||'';this[_0x498d('0x3')]=_0x327640['clientId']||'';this['clientSecret']=_0x327640[_0x498d('0x4')]||'';this[_0x498d('0x5')]=_0x327640[_0x498d('0x5')]||'';this[_0x498d('0x6')]=_0x327640[_0x498d('0x6')]||'';this['refreshToken']=_0x327640[_0x498d('0x7')]||'';this[_0x498d('0x8')]=_0x327640['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 669b488..66ef1dd 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 _0x0abf=['callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','calleridname','number','exports','util','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','Agent','channelAgent','membername','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback'];(function(_0x838c6f,_0x5948f6){var _0x545553=function(_0x32b73e){while(--_0x32b73e){_0x838c6f['push'](_0x838c6f['shift']());}};_0x545553(++_0x5948f6);}(_0x0abf,0xe8));var _0xf0ab=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0abf[_0x1facfa];return _0x9ec701;};'use strict';var util=require(_0xf0ab('0x0'));var _=require('lodash');var moment=require(_0xf0ab('0x1'));function checkNameSurname(_0x27c8c9,_0x528ef7,_0x598001){var _0x313b14='';if(!_['isNil'](_0x528ef7)&&_0xf0ab('0x2')===typeof _0x528ef7){_0x313b14+=_0x528ef7;}if(!_[_0xf0ab('0x3')](_0x598001)&&_0xf0ab('0x2')===typeof _0x598001){_0x313b14+='\x20'+_0x598001;}if(_0x313b14!==''){return _0x313b14;}return _0x27c8c9;}function Action(_0xbb1f91,_0x2ab7d6,_0x4d2ea8,_0x233afe,_0x57ff3b){this[_0xf0ab('0x4')]=_0x4d2ea8||undefined;this[_0xf0ab('0x5')]=_0xbb1f91['id'];this[_0xf0ab('0x6')]=_0x2ab7d6[_0xf0ab('0x7')];this['type']=_0x2ab7d6[_0xf0ab('0x8')];this[_0xf0ab('0x9')]=_0xf0ab('0x6');this['dialAnswer']=![];this['membername']=_[_0xf0ab('0x3')](_0xbb1f91['Agent'])?undefined:_0xbb1f91[_0xf0ab('0xa')][_0xf0ab('0x7')];this[_0xf0ab('0xb')]=this[_0xf0ab('0xc')]?util[_0xf0ab('0xd')](_0xf0ab('0xe'),this[_0xf0ab('0xc')]):_0x233afe||undefined;this['calleridname']=checkNameSurname(_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x10')],_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x11')],_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x12')]);this[_0xf0ab('0x13')]=_0xbb1f91[_0xf0ab('0x13')]||![];this[_0xf0ab('0x14')]=_0xbb1f91[_0xf0ab('0x10')];this[_0xf0ab('0x15')]=_0xbb1f91[_0xf0ab('0x15')];this[_0xf0ab('0x16')]=_0xbb1f91[_0xf0ab('0x16')]||0x0;this[_0xf0ab('0x17')]=_0xbb1f91['countcongestionretry']||0x0;this[_0xf0ab('0x18')]=_0xbb1f91[_0xf0ab('0x18')]||0x0;this[_0xf0ab('0x19')]=(_0xbb1f91[_0xf0ab('0x16')]||0x0)+(_0xbb1f91[_0xf0ab('0x17')]||0x0)+(_0xbb1f91[_0xf0ab('0x18')]||0x0)+(_0xbb1f91[_0xf0ab('0x1a')]||0x0)+(_0xbb1f91[_0xf0ab('0x1b')]||0x0)+(_0xbb1f91[_0xf0ab('0x1c')]||0x0)+(_0xbb1f91[_0xf0ab('0x1d')]||0x0)+(_0xbb1f91[_0xf0ab('0x1e')]||0x0);this[_0xf0ab('0x1a')]=_0xbb1f91[_0xf0ab('0x1a')]||0x0;this[_0xf0ab('0x1b')]=_0xbb1f91[_0xf0ab('0x1b')]||0x0;this[_0xf0ab('0x1c')]=_0xbb1f91['countabandonedretry']||0x0;this[_0xf0ab('0x1d')]=_0xbb1f91[_0xf0ab('0x1d')]||0x0;this[_0xf0ab('0x1e')]=_0xbb1f91[_0xf0ab('0x1e')]||0x0;this[_0xf0ab('0x1f')]=_0xbb1f91[_0xf0ab('0x1f')];this[_0xf0ab('0x20')]=_0xbb1f91[_0xf0ab('0x20')];this[_0xf0ab('0x21')]=_0xbb1f91[_0xf0ab('0x21')];this[_0xf0ab('0x22')]=_0xbb1f91['recallme'];this['ContactId']=_0xbb1f91['ContactId'];this[_0xf0ab('0x23')]=_0xbb1f91['ListId'];this[_0xf0ab('0x24')]=_[_0xf0ab('0x3')](_0xbb1f91['Agent'])?_0xbb1f91[_0xf0ab('0x24')]:_0xbb1f91[_0xf0ab('0xa')]['id'];this[_0xf0ab('0x25')]=_0xbb1f91[_0xf0ab('0x25')];this[_0xf0ab('0x26')]='';this['originatecalleridname']='';}Action[_0xf0ab('0x27')]['getCaller']=function(){return util['format'](_0xf0ab('0x28'),this[_0xf0ab('0x29')],this[_0xf0ab('0x2a')]);};module[_0xf0ab('0x2b')]=Action; \ No newline at end of file +var _0x32b6=['membername','Agent','channelAgent','format','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','isNil','string','uniqueid','queue','name','type'];(function(_0x5ae69a,_0x380046){var _0x3989fc=function(_0x3057ea){while(--_0x3057ea){_0x5ae69a['push'](_0x5ae69a['shift']());}};_0x3989fc(++_0x380046);}(_0x32b6,0x1d1));var _0x632b=function(_0x3745b2,_0x4a8243){_0x3745b2=_0x3745b2-0x0;var _0x44dee6=_0x32b6[_0x3745b2];return _0x44dee6;};'use strict';var util=require(_0x632b('0x0'));var _=require(_0x632b('0x1'));var moment=require('moment');function checkNameSurname(_0x1f0635,_0x1d100a,_0x51c210){var _0x5ad871='';if(!_[_0x632b('0x2')](_0x1d100a)&&_0x632b('0x3')===typeof _0x1d100a){_0x5ad871+=_0x1d100a;}if(!_[_0x632b('0x2')](_0x51c210)&&_0x632b('0x3')===typeof _0x51c210){_0x5ad871+='\x20'+_0x51c210;}if(_0x5ad871!==''){return _0x5ad871;}return _0x1f0635;}function Action(_0x1adfe6,_0x122768,_0x24ceab,_0x10458a,_0x3bbf43){this[_0x632b('0x4')]=_0x24ceab||undefined;this['idContact']=_0x1adfe6['id'];this[_0x632b('0x5')]=_0x122768[_0x632b('0x6')];this[_0x632b('0x7')]=_0x122768[_0x632b('0x7')];this['campaigntype']='queue';this['dialAnswer']=![];this[_0x632b('0x8')]=_['isNil'](_0x1adfe6[_0x632b('0x9')])?undefined:_0x1adfe6[_0x632b('0x9')][_0x632b('0x6')];this[_0x632b('0xa')]=this[_0x632b('0x8')]?util[_0x632b('0xb')](_0x632b('0xc'),this[_0x632b('0x8')]):_0x10458a||undefined;this[_0x632b('0xd')]=checkNameSurname(_0x1adfe6['Contact'][_0x632b('0xe')],_0x1adfe6[_0x632b('0xf')][_0x632b('0x10')],_0x1adfe6['Contact'][_0x632b('0x11')]);this[_0x632b('0x12')]=_0x1adfe6[_0x632b('0x12')]||![];this[_0x632b('0x13')]=_0x1adfe6[_0x632b('0xe')];this[_0x632b('0x14')]=_0x1adfe6['scheduledat'];this[_0x632b('0x15')]=_0x1adfe6['countbusyretry']||0x0;this['countcongestionretry']=_0x1adfe6[_0x632b('0x16')]||0x0;this['countnoanswerretry']=_0x1adfe6[_0x632b('0x17')]||0x0;this[_0x632b('0x18')]=(_0x1adfe6[_0x632b('0x15')]||0x0)+(_0x1adfe6['countcongestionretry']||0x0)+(_0x1adfe6[_0x632b('0x17')]||0x0)+(_0x1adfe6[_0x632b('0x19')]||0x0)+(_0x1adfe6[_0x632b('0x1a')]||0x0)+(_0x1adfe6[_0x632b('0x1b')]||0x0)+(_0x1adfe6['countmachineretry']||0x0)+(_0x1adfe6[_0x632b('0x1c')]||0x0);this[_0x632b('0x19')]=_0x1adfe6['countnosuchnumberretry']||0x0;this[_0x632b('0x1a')]=_0x1adfe6['countdropretry']||0x0;this['countabandonedretry']=_0x1adfe6[_0x632b('0x1b')]||0x0;this['countmachineretry']=_0x1adfe6[_0x632b('0x1d')]||0x0;this[_0x632b('0x1c')]=_0x1adfe6[_0x632b('0x1c')]||0x0;this['callback']=_0x1adfe6[_0x632b('0x1e')];this[_0x632b('0x1f')]=_0x1adfe6['callbackuniqueid'];this[_0x632b('0x20')]=_0x1adfe6[_0x632b('0x20')];this[_0x632b('0x21')]=_0x1adfe6[_0x632b('0x21')];this[_0x632b('0x22')]=_0x1adfe6[_0x632b('0x22')];this['ListId']=_0x1adfe6['ListId'];this[_0x632b('0x23')]=_['isNil'](_0x1adfe6[_0x632b('0x9')])?_0x1adfe6[_0x632b('0x23')]:_0x1adfe6['Agent']['id'];this[_0x632b('0x24')]=_0x1adfe6[_0x632b('0x24')];this[_0x632b('0x25')]='';this[_0x632b('0x26')]='';}Action[_0x632b('0x27')][_0x632b('0x28')]=function(){return util[_0x632b('0xb')](_0x632b('0x29'),this[_0x632b('0xd')],this['number']);};module[_0x632b('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index c88e5bf..1b26807 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 _0x72af=['lodash','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','name','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','emit','voice_queue_presence:remove','sendMessageOneNotActive','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','booked','outbound','clearZombieChannels','dialPreviewAutoRecallMe','recallMe','actions','[clearZombieChannels][talking]','Queue','originated:\x20','originated','pTalking:\x20','queue','contactId','UserId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannel','agentReadyId','then','isNil','length','getDiff','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','activeContact','actioncountonusuch','incrementPreviewCounters','idContact','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','sumBillable','\x20Queue','linkedid','callAdditionalPhoneAfterMin','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countmachineretry','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','object','isUndefined','reason','logAgent','createAgentHistory','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','run','pick','unlockContact','execRun','getContactPreview','recallme','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','trim','substring','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','callerid','dialOriginateCallerIdName','extractCalleridName','extractCalleridNumber','addVariables','merge','variablesAction','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','transfer','destuniqueid','variables','filterKey','keys','variable','value','transfertargetlinkedid','transfererlinkedid','util'];(function(_0x52dfe3,_0x5e6c44){var _0x4f7788=function(_0x3b8131){while(--_0x3b8131){_0x52dfe3['push'](_0x52dfe3['shift']());}};_0x4f7788(++_0x5e6c44);}(_0x72af,0x159));var _0xf72a=function(_0x436eb5,_0x168e88){_0x436eb5=_0x436eb5-0x0;var _0x280b4d=_0x72af[_0x436eb5];return _0x280b4d;};'use strict';var util=require(_0xf72a('0x0'));var _=require(_0xf72a('0x1'));var uuid=require(_0xf72a('0x2'));var moment=require('moment');var md5=require(_0xf72a('0x3'));var Redis=require(_0xf72a('0x4'));var config=require(_0xf72a('0x5'));var logger=require(_0xf72a('0x6'))(_0xf72a('0x7'));var loggerAction=require(_0xf72a('0x6'))('actionPreview');var ami=require(_0xf72a('0x8'));var rpcDb=require(_0xf72a('0x9'));var cmHopperAdditionalPhone=require(_0xf72a('0xa'));var Action=require(_0xf72a('0xb'));var ut=require(_0xf72a('0xc'));config[_0xf72a('0xd')]=_['defaults'](config[_0xf72a('0xd')],{'host':_0xf72a('0xe'),'port':0x18eb});var io=require(_0xf72a('0xf'))(new Redis(config[_0xf72a('0xd')]));var Sequence=function(){};Sequence[_0xf72a('0x10')][_0xf72a('0x11')]=function(_0xe0458b){this[_0xf72a('0x12')]=this[_0xf72a('0x12')]?this[_0xf72a('0x12')]['finally'](_0xe0458b):_0xe0458b();};function Preview(_0x17d82e){this[_0xf72a('0x13')]=new Sequence();this[_0xf72a('0x14')]=_0x17d82e[_0xf72a('0x15')];this['trunks']=_0x17d82e[_0xf72a('0x16')];this['actions']={};this[_0xf72a('0x17')]=_0x17d82e[_0xf72a('0x17')];this[_0xf72a('0x18')]=0x0;ami['on'](_0xf72a('0x19'),this[_0xf72a('0x1a')][_0xf72a('0x1b')](this));ami['on'](_0xf72a('0x1c'),this[_0xf72a('0x1d')][_0xf72a('0x1b')](this));ami['on'](_0xf72a('0x1e'),this[_0xf72a('0x1f')][_0xf72a('0x1b')](this));ami['on']('dialend',this[_0xf72a('0x20')][_0xf72a('0x1b')](this));ami['on'](_0xf72a('0x21'),this[_0xf72a('0x22')][_0xf72a('0x1b')](this));ami['on']('varset',this[_0xf72a('0x23')][_0xf72a('0x1b')](this));ami['on'](_0xf72a('0x24'),this[_0xf72a('0x25')][_0xf72a('0x1b')](this));ami['on'](_0xf72a('0x26'),this[_0xf72a('0x27')][_0xf72a('0x1b')](this));this[_0xf72a('0x28')](this['campaignsPreview']);}function emit(_0x1a9980,_0x4088f0,_0x811a37){io['to'](_0x1a9980)['emit'](_0x4088f0,_0x811a37);}function emitCampaignPreview(_0x569e79){if(_0x569e79[_0xf72a('0x29')]==='outbound'){var _0x1c629b={'id':_0x569e79['id'],'name':_0x569e79[_0xf72a('0x2a')],'strategy':_0x569e79['strategy'],'answered':_0x569e79['answered'],'available':_0x569e79[_0xf72a('0x2b')],'loggedIn':_0x569e79[_0xf72a('0x2c')],'pTalking':_0x569e79[_0xf72a('0x2d')],'sumBillable':_0x569e79['sumBillable'],'sumDuration':_0x569e79[_0xf72a('0x2e')],'sumHoldTime':_0x569e79[_0xf72a('0x2f')]||0x0,'talking':_0x569e79[_0xf72a('0x30')],'total':_0x569e79['total'],'type':_0x569e79[_0xf72a('0x29')],'unmanaged':_0x569e79[_0xf72a('0x31')],'abandoned':_0x569e79['abandoned'],'waiting':_0x569e79[_0xf72a('0x32')],'loggedInDb':_0x569e79[_0xf72a('0x33')],'dialActive':_0x569e79[_0xf72a('0x34')],'dialMethod':_0x569e79[_0xf72a('0x35')],'dialOriginateCallerIdName':_0x569e79['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x569e79[_0xf72a('0x36')],'dialOriginateTimeout':_0x569e79['dialOriginateTimeout'],'dialPrefix':_0x569e79[_0xf72a('0x37')],'outboundAnswerAgiCallsDay':_0x569e79[_0xf72a('0x38')],'outboundAnswerCallsDay':_0x569e79[_0xf72a('0x39')],'outboundBlacklistCallsDay':_0x569e79[_0xf72a('0x3a')],'outboundBusyCallsDay':_0x569e79['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x569e79[_0xf72a('0x3b')],'outboundDropCallsDayACS':_0x569e79['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x569e79[_0xf72a('0x3c')],'outboundDropCallsDayTimeout':_0x569e79[_0xf72a('0x3d')],'outboundNoAnswerCallsDay':_0x569e79[_0xf72a('0x3e')],'outboundNoSuchCallsDay':_0x569e79['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x569e79[_0xf72a('0x3f')],'outboundReCallsDay':_0x569e79[_0xf72a('0x40')],'outboundRejectCallsDay':_0x569e79[_0xf72a('0x41')],'outboundUnknownCallsDay':_0x569e79[_0xf72a('0x42')],'outboundAbandonedCallsDay':_0x569e79[_0xf72a('0x43')],'predictiveIntervalAnsweredCalls':_0x569e79[_0xf72a('0x44')],'predictiveIntervalAvgHoldtime':_0x569e79[_0xf72a('0x45')],'predictiveIntervalAvgTalktime':_0x569e79[_0xf72a('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x569e79['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x569e79[_0xf72a('0x47')],'predictiveIntervalErlangCalls':_0x569e79[_0xf72a('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x569e79[_0xf72a('0x49')],'predictiveIntervalHitRate':_0x569e79['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x569e79[_0xf72a('0x4a')],'predictiveIntervalPauses':_0x569e79[_0xf72a('0x4b')],'predictiveIntervalAvailable':_0x569e79[_0xf72a('0x4c')],'predictiveIntervalTotalCalls':_0x569e79[_0xf72a('0x4d')],'message':_0x569e79[_0xf72a('0x4e')],'originated':_0x569e79['originated'],'erlangCalls':_0x569e79['erlangCalls'],'erlangCallToSecond':_0x569e79[_0xf72a('0x4f')],'erlangAbandonmentRate':_0x569e79['erlangAbandonmentRate'],'erlangBusyFactor':_0x569e79[_0xf72a('0x50')],'startPredictive':_0x569e79[_0xf72a('0x51')],'startProgressive':_0x569e79['startProgressive']};if(_0x569e79[_0xf72a('0x52')]){_0x1c629b[_0xf72a('0x52')]={'id':_0x569e79[_0xf72a('0x52')]['id'],'name':_0x569e79['Trunk'][_0xf72a('0x2a')],'active':_0x569e79[_0xf72a('0x52')][_0xf72a('0x53')],'callerid':_0x569e79[_0xf72a('0x52')]['callerid']};}if(_0x569e79['Interval']){_0x1c629b['Interval']={'id':_0x569e79[_0xf72a('0x54')]['id'],'name':_0x569e79['Interval'][_0xf72a('0x2a')]};}var _0x337d7f=md5(JSON[_0xf72a('0x55')](_0x1c629b));if(_0x569e79[_0xf72a('0x3')]!==_0x337d7f){_0x569e79[_0xf72a('0x3')]=_0x337d7f;emit(util[_0xf72a('0x56')](_0xf72a('0x57'),_0x1c629b[_0xf72a('0x2a')]),_0xf72a('0x58'),_0x1c629b);}}}function emitVoiceQueueChannelRemove(_0x36957a){logger[_0xf72a('0x59')](_0xf72a('0x5a'),JSON[_0xf72a('0x55')](_0x36957a));emit(util[_0xf72a('0x56')](_0xf72a('0x57'),_0x36957a[_0xf72a('0x2a')]),_0xf72a('0x5b'),_0x36957a);io[_0xf72a('0x5c')](_0xf72a('0x5d'),_0x36957a);}function notSendMessagesQueue(_0x296464){if(_0x296464[_0xf72a('0x5e')]){if(_0x296464['originated']===0x0&&_0x296464[_0xf72a('0x2d')]===0x0){_0x296464['sendMessageOneNotActive']=![];_0x296464[_0xf72a('0x2b')]=0x0;_0x296464['paused']=0x0;_0x296464[_0xf72a('0x4e')]='NOT_ACTIVE';ut[_0xf72a('0x5f')](_0xf72a('0x60'),_0x296464['name']+_0xf72a('0x61'));}else{_0x296464[_0xf72a('0x4e')]='DEACTIVATED';ut['logger'](_0xf72a('0x60'),_0x296464[_0xf72a('0x2a')]+_0xf72a('0x62'));}emitCampaignPreview(_0x296464);}}Preview[_0xf72a('0x10')][_0xf72a('0x28')]=function(){var _0x284df5=this;setInterval(function(){_0x284df5[_0xf72a('0x63')]();},0x7cf);};Preview[_0xf72a('0x10')][_0xf72a('0x63')]=function(){var _0x153e90=this[_0xf72a('0x14')];this[_0xf72a('0x18')]+=0x1;for(var _0x46aae4 in _0x153e90){if(_0x153e90[_0xf72a('0x64')](_0x46aae4)&&(_0x153e90[_0x46aae4][_0xf72a('0x35')]===_0xf72a('0x7')||_0x153e90[_0x46aae4]['dialMethod']===_0xf72a('0x65'))&&_0x153e90[_0x46aae4][_0xf72a('0x29')]===_0xf72a('0x66')){if(this[_0xf72a('0x18')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xf72a('0x67')]();}}if(_0x153e90[_0xf72a('0x64')](_0x46aae4)&&_0x153e90[_0x46aae4][_0xf72a('0x35')]===_0xf72a('0x7')&&_0x153e90[_0x46aae4]['type']===_0xf72a('0x66')){if(_0x153e90[_0x46aae4][_0xf72a('0x34')]){this['setMessage'](_0x153e90[_0x46aae4]);if(_0x153e90[_0x46aae4][_0xf72a('0x68')])this[_0xf72a('0x69')](_0x153e90[_0x46aae4]);}else{notSendMessagesQueue(_0x153e90[_0x46aae4]);}}}};Preview[_0xf72a('0x10')]['clearZombieChannel']=function(_0x13bccd){var _0x137b5b=this;this['sequence']['enqueue'](function(){if(!_['isNil'](_0x137b5b[_0xf72a('0x6a')][_0x13bccd])){loggerAction[_0xf72a('0x59')](_0xf72a('0x6b'),_0x13bccd,_0xf72a('0x6c'),_0x137b5b[_0xf72a('0x6a')][_0x13bccd]['queue'],_0xf72a('0x6d'),JSON[_0xf72a('0x55')](_0x137b5b[_0xf72a('0x14')][_0x137b5b[_0xf72a('0x6a')][_0x13bccd]['queue']][_0xf72a('0x6e')]),_0xf72a('0x6f'),JSON[_0xf72a('0x55')](_0x137b5b[_0xf72a('0x14')][_0x137b5b[_0xf72a('0x6a')][_0x13bccd][_0xf72a('0x70')]][_0xf72a('0x2d')]),JSON[_0xf72a('0x55')](_0x137b5b[_0xf72a('0x6a')][_0x13bccd]['dialAnswer']),JSON[_0xf72a('0x55')](_['pick'](_0x137b5b['actions'][_0x13bccd],[_0xf72a('0x71'),_0xf72a('0x72'),'VoiceQueueId','ListId'])));return ami[_0xf72a('0x73')]({'action':'status','channel':_0x137b5b[_0xf72a('0x6a')][_0x13bccd][_0xf72a('0x74')]})[_0xf72a('0x75')](function(_0x552488){if(_0x552488[_0xf72a('0x4e')]===_0xf72a('0x76')){setTimeout(function(){if(_0x137b5b[_0xf72a('0x6a')][_0x13bccd]){ut[_0xf72a('0x77')](_0x137b5b[_0xf72a('0x14')][_0x137b5b[_0xf72a('0x6a')][_0x13bccd][_0xf72a('0x70')]],_0xf72a('0x78'));if(_0x137b5b[_0xf72a('0x6a')][_0x13bccd][_0xf72a('0x79')]===!![]){ut[_0xf72a('0x7a')](_0x137b5b[_0xf72a('0x14')][_0x137b5b[_0xf72a('0x6a')][_0x13bccd]['queue']],_0xf72a('0x78'));ut['loggerError'](_0xf72a('0x7b')+_0x13bccd,_0x137b5b['actions'][_0x13bccd][_0xf72a('0x70')]);}ut[_0xf72a('0x7c')](_0xf72a('0x7d')+_0x13bccd,_0x137b5b[_0xf72a('0x6a')][_0x13bccd][_0xf72a('0x70')]);delete _0x137b5b[_0xf72a('0x6a')][_0x13bccd];}},0x2328);}});}});};Preview[_0xf72a('0x10')]['clearZombieChannels']=function(){var _0x3157ce=this;loggerAction['info']('[action]',_['size'](this['actions']));for(var _0xbca701 in this[_0xf72a('0x6a')]){if(_0x3157ce[_0xf72a('0x6a')][_0xf72a('0x64')](_0xbca701)){_0x3157ce[_0xf72a('0x7e')](_0xbca701);}}};Preview[_0xf72a('0x10')][_0xf72a('0x69')]=function(_0x4dc68c){var _0x28ce6c=this;rpcDb['getContactRecallMe'](_0x4dc68c['id'],ut[_0xf72a('0x7f')](this[_0xf72a('0x17')]))[_0xf72a('0x80')](function(_0x39d99a){if(!_[_0xf72a('0x81')](_0x39d99a)){for(var _0x17e6e1=0x0;_0x17e6e1<_0x39d99a[_0xf72a('0x82')];_0x17e6e1+=0x1){if(ut[_0xf72a('0x83')](_0x39d99a[_0x17e6e1]['scheduledat'])<_0x4dc68c[_0xf72a('0x84')]*0x3c){if(_0x39d99a[_0x17e6e1][_0xf72a('0x85')]&&!_0x39d99a[_0x17e6e1][_0xf72a('0x85')][_0xf72a('0x86')]){_0x28ce6c['run'](_0x39d99a[_0x17e6e1]['id'])['then'](ut[_0xf72a('0x87')]('[RecallMe]'))[_0xf72a('0x75')](ut[_0xf72a('0x87')](_0xf72a('0x88')));}else{rpcDb[_0xf72a('0x89')](_0x39d99a[_0x17e6e1]['id']);}}else{var _0x28590d=new Action(_0x39d99a[_0x17e6e1],_0x4dc68c);_0x28590d[_0xf72a('0x8a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4dc68c[_0xf72a('0x40')]+=0x1;ut[_0xf72a('0x8b')](_0x28590d,0x17,_0xf72a('0x8c'));if(_0x4dc68c[_0xf72a('0x8d')]){rpcDb['rescheduleContactInQueue'](ut[_0xf72a('0x8e')](_0x39d99a[_0x17e6e1]));rpcDb[_0xf72a('0x8f')](_0x28590d,_0xf72a('0x90'));}else{ut[_0xf72a('0x8b')](_0x28590d,0x16,_0xf72a('0x91'));rpcDb[_0xf72a('0x8f')](_0x28590d,_0xf72a('0x92'));rpcDb[_0xf72a('0x93')](_0x28590d,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xf72a('0x87')](_0xf72a('0x94')));};Preview['prototype']['setMessage']=function(_0x5b4a21){_0x5b4a21['sendMessageOneNotActive']=!![];if(ut[_0xf72a('0x95')](_0x5b4a21[_0xf72a('0x2c')])){_0x5b4a21['message']=_0xf72a('0x96');}else if(!ut[_0xf72a('0x97')](_0x5b4a21['dialActive'])){_0x5b4a21[_0xf72a('0x4e')]=_0xf72a('0x98');}else if(!this[_0xf72a('0x99')](_0x5b4a21[_0xf72a('0x52')])){if(!this[_0xf72a('0x99')](_0x5b4a21[_0xf72a('0x9a')])){_0x5b4a21[_0xf72a('0x4e')]='TRUNK_IS_NOT_REACHABLE';}else{_0x5b4a21[_0xf72a('0x4e')]=_0xf72a('0x9b');}}else{_0x5b4a21[_0xf72a('0x4e')]=_0xf72a('0x9b');}emitCampaignPreview(_0x5b4a21);};Preview['prototype'][_0xf72a('0x9c')]=function(_0x531435,_0x62dfba,_0x4e385b){var _0x5da6ab=this;var _0x217351=this['actions'][_0x62dfba];var _0x3e3822=this[_0xf72a('0x14')][_0x217351[_0xf72a('0x70')]];var _0x267fa6;var _0x42e781=![];var _0x3be0a6=0x2;var _0x3824bd=0x3;if(_0x3e3822){switch(_0x4e385b){case'1':_0x3e3822['outboundNoSuchCallsDay']+=0x1;_0x217351[_0xf72a('0x9d')]+=0x1;_0x217351[_0xf72a('0x9e')]=ut['totalGlobal'](_0x217351);ut[_0xf72a('0x8b')](_0x217351,0x0,_0xf72a('0x9f'));ami[_0xf72a('0x5c')](_0xf72a('0xa0'),ut['buildObj'](_0x217351,_0xf72a('0xa1')));rpcDb[_0xf72a('0x8f')](_0x217351,_0xf72a('0xa2'));_0x5da6ab[_0xf72a('0xa3')](_0x217351,'0',_0x3e3822)[_0xf72a('0x80')](function(_0x38aa59){_0x42e781=_0x38aa59[_0xf72a('0xa4')]==0x1;_0x3be0a6=_0x3e3822[_0xf72a('0xa5')];_0x3824bd=_0x3e3822['callAdditionalPhoneAfterMin'];if(!_0x42e781){if(ut[_0xf72a('0xa6')](_0x217351)>=_0x3e3822[_0xf72a('0xa7')]){_0x267fa6=ut[_0xf72a('0xa8')](_0x217351,0xf,_0xf72a('0xa9'));rpcDb['createCustomerFinal'](_0x267fa6,_0xf72a('0xaa'));}else{if(_0x217351['countnosuchnumberretry']>=_0x3e3822['dialNoSuchNumberMaxRetry']){rpcDb[_0xf72a('0x93')](_0x217351,_0xf72a('0xaa'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x217351,_0xf72a('0x9d'),_0x3e3822[_0xf72a('0xa5')]),_0x217351['unlockAgent'],_0x217351[_0xf72a('0xab')]);}}delete this['actions'][_0x531435['linkedid']];}else{_0x217351['countnosuchnumberretry']++;logger[_0xf72a('0x59')](_0xf72a('0xac'),_0x217351[_0xf72a('0x9d')]);logger[_0xf72a('0x59')]('id',_0x217351['idContact']);_0x5da6ab[_0xf72a('0xad')]({'id':_0x217351[_0xf72a('0xae')],'field':{'countnosuchnumberretry':_0x217351[_0xf72a('0x9d')]}})[_0xf72a('0x80')](function(){_0x5da6ab[_0xf72a('0xaf')](_0x217351,_0x3be0a6,_0x3824bd)[_0xf72a('0x80')](function(){});});}});break;case _0xf72a('0xb0'):var _0x2c294f=moment()[_0xf72a('0x56')](_0xf72a('0xb1'));_0x217351[_0xf72a('0xb2')]=_0x2c294f;_0x217351[_0xf72a('0xb3')]=_0x2c294f;_0x217351[_0xf72a('0x79')]=!![];_0x3e3822[_0xf72a('0x2d')]+=0x1;logger[_0xf72a('0x59')](_0xf72a('0xb4'),_0x217351[_0xf72a('0xb5')],'\x20Queue',_0x3e3822[_0xf72a('0x2a')],'pTalking:\x20',_0x3e3822['pTalking']);ami[_0xf72a('0x5c')](_0xf72a('0xb6'),ut[_0xf72a('0xb7')](_0x217351,_0xf72a('0xb8'),this[_0xf72a('0x14')][_0x217351[_0xf72a('0x70')]]));if(_0x3e3822[_0xf72a('0xb9')]){ami[_0xf72a('0x5c')](_0xf72a('0xba'),ut[_0xf72a('0xbb')](_0x217351));}break;case'16':ami['emit'](_0xf72a('0xbc'),ut['buildObj'](_0x217351,_0xf72a('0xbd'),this[_0xf72a('0x14')][_0x217351['queue']]));emitVoiceQueueChannelRemove(ut[_0xf72a('0xb7')](_0x217351,'complete'));_0x3e3822['outboundAnswerCallsDay']+=0x1;_0x3e3822[_0xf72a('0xbe')]+=0x1;_0x3e3822[_0xf72a('0xbf')]+=0x1;ut['decrementTalkink'](_0x3e3822,_0xf72a('0xc0'));_0x217351['countglobal']=ut[_0xf72a('0xa6')](_0x217351);ut[_0xf72a('0x8b')](_0x217351,0x4,'Answer');rpcDb[_0xf72a('0x8f')](_0x217351,_0xf72a('0xc1'));rpcDb[_0xf72a('0x93')](_0x217351,_0xf72a('0xc2'));rpcDb['crateCustomerReportQueue'](_0x217351);_0x3e3822[_0xf72a('0x2e')]+=_0x217351[_0xf72a('0xc3')];_0x3e3822[_0xf72a('0xc4')]+=_0x217351['talktime'];logger[_0xf72a('0x59')]('[syncHangup][talking][decrement]',_0x217351[_0xf72a('0xb5')],_0xf72a('0xc5'),_0x3e3822['name'],'pTalking:\x20',_0x3e3822[_0xf72a('0x2d')]);delete this[_0xf72a('0x6a')][_0x531435[_0xf72a('0xc6')]];break;case'BUSY':_0x3e3822['outboundBusyCallsDay']+=0x1;_0x217351['countbusyretry']+=0x1;_0x217351['countglobal']=ut[_0xf72a('0xa6')](_0x217351);ut['logCustomer'](_0x217351,0x5,'Busy');_0x3be0a6=_0x3e3822['dialBusyRetryFrequency'];_0x3824bd=_0x3e3822[_0xf72a('0xc7')];ami[_0xf72a('0x5c')](_0xf72a('0xc8'),ut['buildObj'](_0x217351,_0xf72a('0xc9')));rpcDb[_0xf72a('0x8f')](_0x217351,_0xf72a('0xca'));_0x5da6ab[_0xf72a('0xa3')](_0x217351,'5',_0x3e3822)[_0xf72a('0x80')](function(_0x29d75a){_0x42e781=_0x29d75a[_0xf72a('0xa4')]==0x1;if(!_0x42e781){if(ut[_0xf72a('0xa6')](_0x217351)>=_0x3e3822[_0xf72a('0xa7')]){_0x267fa6=ut[_0xf72a('0xa8')](_0x217351,0xf,_0xf72a('0xa9'));rpcDb[_0xf72a('0x93')](_0x267fa6,_0xf72a('0xcb'));}else{if(_0x217351[_0xf72a('0xcc')]>=_0x3e3822[_0xf72a('0xcd')]){rpcDb[_0xf72a('0x93')](_0x217351,_0xf72a('0xca'));}else{rpcDb[_0xf72a('0xce')](ut[_0xf72a('0xcf')](_0x217351,_0xf72a('0xcc'),_0x3e3822[_0xf72a('0xd0')]),_0x217351[_0xf72a('0xd1')],_0x217351[_0xf72a('0xab')]);}}}else{_0x217351['countbusyretry']++;_0x5da6ab['incrementPreviewCounters']({'id':_0x217351[_0xf72a('0xae')],'field':{'countbusyretry':_0x217351[_0xf72a('0xcc')]}})['then'](function(){_0x5da6ab['swapAdditionalPhones'](_0x217351,_0x3be0a6,_0x3824bd)[_0xf72a('0x80')](function(){});});}});break;case _0xf72a('0xd2'):_0x3e3822[_0xf72a('0x3e')]+=0x1;_0x217351[_0xf72a('0xd3')]+=0x1;_0x217351[_0xf72a('0x9e')]=ut['totalGlobal'](_0x217351);ut[_0xf72a('0x8b')](_0x217351,0x3,'NoAnswer');_0x3be0a6=_0x3e3822[_0xf72a('0xd4')];_0x3824bd=_0x3e3822['callAdditionalPhoneAfterMin'];var _0x51f94e=ut['buildNoAnswerEventPayload'](_0x217351,_0x3e3822);ami['emit'](_0xf72a('0xd5'),_0x51f94e);rpcDb[_0xf72a('0x8f')](_0x217351,_0xf72a('0xd6'));_0x5da6ab['verifyAdditionalPhones'](_0x217351,'3',_0x3e3822)['then'](function(_0xaa2745){_0x42e781=_0xaa2745[_0xf72a('0xa4')]==0x1;if(!_0x42e781){if(ut[_0xf72a('0xa6')](_0x217351)>=_0x3e3822[_0xf72a('0xa7')]){_0x267fa6=ut['cloneAction'](_0x217351,0xf,_0xf72a('0xa9'));rpcDb[_0xf72a('0x93')](_0x267fa6,_0xf72a('0xd7'));}else{if(_0x217351[_0xf72a('0xd3')]>=_0x3e3822[_0xf72a('0xd8')]){rpcDb[_0xf72a('0x93')](_0x217351,_0xf72a('0xd6'));}else{rpcDb[_0xf72a('0xce')](ut[_0xf72a('0xcf')](_0x217351,'countnoanswerretry',_0x3e3822[_0xf72a('0xd4')]),_0x217351[_0xf72a('0xd1')],_0x217351[_0xf72a('0xab')]);}}}else{_0x217351['countnoanswerretry']++;_0x5da6ab[_0xf72a('0xad')]({'id':_0x217351[_0xf72a('0xae')],'field':{'countnoanswerretry':_0x217351[_0xf72a('0xd3')]}})['then'](function(){_0x5da6ab[_0xf72a('0xaf')](_0x217351,_0x3be0a6,_0x3824bd)[_0xf72a('0x80')](function(){});});}});break;case'CONGESTION':_0x3e3822[_0xf72a('0x3b')]+=0x1;_0x217351[_0xf72a('0xd9')]+=0x1;_0x217351[_0xf72a('0x9e')]=ut[_0xf72a('0xa6')](_0x217351);ut[_0xf72a('0x8b')](_0x217351,0x8,_0xf72a('0xda'));_0x3be0a6=_0x3e3822[_0xf72a('0xdb')];_0x3824bd=_0x3e3822[_0xf72a('0xc7')];ami[_0xf72a('0x5c')](_0xf72a('0xdc'),ut[_0xf72a('0xb7')](_0x217351,_0xf72a('0xdd')));rpcDb['createCustomerHistory'](_0x217351,_0xf72a('0xde'));_0x5da6ab['verifyAdditionalPhones'](_0x217351,'8',_0x3e3822)[_0xf72a('0x80')](function(_0x3caf10){_0x42e781=_0x3caf10['additional']==0x1;if(!_0x42e781){if(ut[_0xf72a('0xa6')](_0x217351)>=_0x3e3822[_0xf72a('0xa7')]){_0x267fa6=ut['cloneAction'](_0x217351,0xf,_0xf72a('0xa9'));rpcDb[_0xf72a('0x93')](_0x267fa6,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x217351[_0xf72a('0xd9')]>=_0x3e3822['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x217351,_0xf72a('0xde'));}else{rpcDb['rescheduleContact'](ut[_0xf72a('0xcf')](_0x217351,_0xf72a('0xd9'),_0x3e3822[_0xf72a('0xd0')]),_0x217351[_0xf72a('0xd1')],_0x217351['activeContact']);}}}else{_0x217351['countcongestionretry']++;_0x5da6ab[_0xf72a('0xad')]({'id':_0x217351[_0xf72a('0xae')],'field':{'countcongestionretry':_0x217351[_0xf72a('0xd9')]}})[_0xf72a('0x80')](function(){_0x5da6ab['swapAdditionalPhones'](_0x217351,_0x3be0a6,_0x3824bd)[_0xf72a('0x80')](function(){});});}});break;case _0xf72a('0xdf'):_0x3e3822[_0xf72a('0x41')]+=0x1;_0x217351[_0xf72a('0xe0')]+=0x1;_0x217351[_0xf72a('0x9e')]=ut['totalGlobal'](_0x217351);ut[_0xf72a('0x8b')](_0x217351,0x14,_0xf72a('0xe1'));_0x3be0a6=_0x3e3822[_0xf72a('0xe2')];_0x3824bd=_0x3e3822[_0xf72a('0xc7')];ami[_0xf72a('0x5c')](_0xf72a('0xe3'),ut['buildObj'](_0x217351,_0xf72a('0xe4')));rpcDb[_0xf72a('0x8f')](_0x217351,'[syncHangupRequest][logAgentReject]');_0x5da6ab[_0xf72a('0xa3')](_0x217351,'20',_0x3e3822)[_0xf72a('0x80')](function(_0x30cbc1){_0x42e781=_0x30cbc1[_0xf72a('0xa4')]==0x1;if(!_0x42e781){if(ut[_0xf72a('0xa6')](_0x217351)>=_0x3e3822[_0xf72a('0xa7')]){_0x267fa6=ut[_0xf72a('0xa8')](_0x217351,0x14,_0xf72a('0xe1'));rpcDb[_0xf72a('0x93')](_0x267fa6,_0xf72a('0xe5'));}else{if(_0x217351['countagentrejectretry']>=_0x3e3822['dialAgentRejectMaxRetry']){rpcDb[_0xf72a('0x93')](_0x217351,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xf72a('0xce')](ut[_0xf72a('0xcf')](_0x217351,'countagentrejectretry',_0x3e3822[_0xf72a('0xe2')]),_0x217351[_0xf72a('0xd1')],_0x217351[_0xf72a('0xab')]);}}}else{_0x217351[_0xf72a('0xd3')]++;_0x5da6ab['incrementPreviewCounters']({'id':_0x217351['idContact'],'field':{'countnoanswerretry':_0x217351[_0xf72a('0xd3')]}})[_0xf72a('0x80')](function(){_0x5da6ab[_0xf72a('0xaf')](_0x217351,_0x3be0a6,_0x3824bd)['then'](function(){});});}});break;case _0xf72a('0xe6'):_0x3e3822[_0xf72a('0x43')]+=0x1;_0x217351[_0xf72a('0xe7')]+=0x1;_0x217351[_0xf72a('0x9e')]=ut[_0xf72a('0xa6')](_0x217351);ut[_0xf72a('0x8b')](_0x217351,0xb,_0xf72a('0xe8'));rpcDb[_0xf72a('0x8f')](_0x217351,_0xf72a('0xe9'));_0x5da6ab[_0xf72a('0xa3')](_0x217351,'11',_0x3e3822)['then'](function(_0x1bcea0){_0x42e781=_0x1bcea0[_0xf72a('0xa4')]==0x1;if(!_0x42e781){if(ut['totalGlobal'](_0x217351)>=_0x3e3822[_0xf72a('0xa7')]){_0x267fa6=ut[_0xf72a('0xa8')](_0x217351,0xf,'Global');rpcDb[_0xf72a('0x93')](_0x267fa6,_0xf72a('0xe9'));}else{if(_0x217351[_0xf72a('0xea')]>=_0x3e3822['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x217351,_0xf72a('0xe9'));}else{rpcDb[_0xf72a('0xce')](ut[_0xf72a('0xcf')](_0x217351,_0xf72a('0xe7'),_0x3e3822['dialAbandonedRetryFrequency']),_0x217351[_0xf72a('0xd1')],_0x217351[_0xf72a('0xab')]);}}}else{_0x217351['countnoanswerretry']++;_0x5da6ab[_0xf72a('0xad')]({'id':_0x217351[_0xf72a('0xae')],'field':{'countnoanswerretry':_0x217351[_0xf72a('0xd3')]}})[_0xf72a('0x80')](function(){_0x5da6ab['swapAdditionalPhones'](_0x217351,_0x3be0a6,_0x3824bd)[_0xf72a('0x80')](function(){});});}});break;case'18':_0x3e3822[_0xf72a('0x42')]+=0x1;_0x217351[_0xf72a('0xeb')]+=0x1;_0x217351[_0xf72a('0x9e')]=ut['totalGlobal'](_0x217351);ut[_0xf72a('0x8b')](_0x217351,0x12,_0x531435['cause-txt']||_0x531435[_0xf72a('0xec')]);ami[_0xf72a('0x5c')]('custom:amd',ut[_0xf72a('0xb7')](_0x217351,_0xf72a('0xed')));rpcDb[_0xf72a('0x8f')](_0x217351,_0xf72a('0xee'));_0x5da6ab['verifyAdditionalPhones'](_0x217351,'18',_0x3e3822)['then'](function(_0x109df3){_0x42e781=_0x109df3[_0xf72a('0xa4')]==0x1;if(!_0x42e781){if(ut[_0xf72a('0xa6')](_0x217351)>=_0x3e3822[_0xf72a('0xa7')]){_0x267fa6=ut[_0xf72a('0xa8')](_0x217351,0x12,_0xf72a('0xa9'));rpcDb['createCustomerFinal'](_0x267fa6,_0xf72a('0xee'));}else{rpcDb[_0xf72a('0x93')](_0x217351,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x217351[_0xf72a('0xd3')]++;_0x5da6ab['incrementPreviewCounters']({'id':_0x217351['idContact'],'field':{'countnoanswerretry':_0x217351[_0xf72a('0xd3')]}})[_0xf72a('0x80')](function(){_0x5da6ab[_0xf72a('0xaf')](_0x217351,_0x3be0a6,_0x3824bd)[_0xf72a('0x80')](function(){});});}});delete this[_0xf72a('0x6a')][_0x531435[_0xf72a('0xc6')]];break;case'19':_0x3e3822[_0xf72a('0x42')]+=0x1;_0x217351['countglobal']=ut['totalGlobal'](_0x217351);ut[_0xf72a('0x8b')](_0x217351,0x13,_0x531435[_0xf72a('0xef')]||_0x531435[_0xf72a('0xec')]);ami[_0xf72a('0x5c')](_0xf72a('0xf0'),ut[_0xf72a('0xb7')](_0x217351,'amd'));rpcDb[_0xf72a('0x8f')](_0x217351,_0xf72a('0xf1'));_0x5da6ab[_0xf72a('0xa3')](_0x217351,'18',_0x3e3822)[_0xf72a('0x80')](function(_0x238b07){_0x42e781=_0x238b07[_0xf72a('0xa4')]==0x1;if(!_0x42e781){if(ut[_0xf72a('0xa6')](_0x217351)>=_0x3e3822['dialGlobalMaxRetry']){_0x267fa6=ut[_0xf72a('0xa8')](_0x217351,0xf,_0xf72a('0xa9'));rpcDb['createCustomerFinal'](_0x267fa6,_0xf72a('0xf1'));}else{rpcDb[_0xf72a('0x93')](_0x217351,_0xf72a('0xf1'));}}else{_0x217351['countnoanswerretry']++;_0x5da6ab[_0xf72a('0xad')]({'id':_0x217351[_0xf72a('0xae')],'field':{'countnoanswerretry':_0x217351['countnoanswerretry']}})['then'](function(){_0x5da6ab[_0xf72a('0xaf')](_0x217351,_0x3be0a6,_0x3824bd)['then'](function(){});});}});delete this[_0xf72a('0x6a')][_0x531435[_0xf72a('0xc6')]];break;default:if(_0x217351[_0xf72a('0x79')]){ut[_0xf72a('0x7a')](_0x3e3822,_0xf72a('0xf2'));ut[_0xf72a('0x7c')](_0xf72a('0xf3')+_0x3e3822[_0xf72a('0x2a')],_0x531435);}_0x3e3822[_0xf72a('0x42')]+=0x1;_0x217351[_0xf72a('0x9e')]=ut[_0xf72a('0xa6')](_0x217351);ut[_0xf72a('0x8b')](_0x217351,0xc,_0x531435[_0xf72a('0xef')]||_0x531435['dialstatus']);_0x3be0a6=_0x3e3822[_0xf72a('0xe2')];_0x3824bd=_0x3e3822[_0xf72a('0xc7')];rpcDb[_0xf72a('0x8f')](_0x217351,_0xf72a('0xf4'));_0x5da6ab['verifyAdditionalPhones'](_0x217351,'20',_0x3e3822)[_0xf72a('0x80')](function(_0xd7906b){_0x42e781=_0xd7906b[_0xf72a('0xa4')]==0x1;if(!_0x42e781){if(ut[_0xf72a('0xa6')](_0x217351)>=_0x3e3822[_0xf72a('0xa7')]){_0x267fa6=ut['cloneAction'](_0x217351,0xf,_0xf72a('0xa9'));rpcDb[_0xf72a('0x93')](_0x267fa6,_0xf72a('0xf5'));}else{rpcDb[_0xf72a('0x93')](_0x217351,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x531435['linkedid']];}else{_0x5da6ab[_0xf72a('0xaf')](_0x217351,_0x3be0a6,_0x3824bd)[_0xf72a('0x80')](function(){});}});}if(!(_0x217351[_0xf72a('0x79')]&&_0x4e385b==='16')){ut[_0xf72a('0x77')](_0x3e3822,_0xf72a('0xf6'));logger['info'](_0xf72a('0xf7'),_0x217351[_0xf72a('0xb5')],'\x20Queue',_0x3e3822[_0xf72a('0x2a')],_0xf72a('0x6d'),_0x3e3822[_0xf72a('0x6e')]);}if(_0x4e385b!=='ANSWER'){delete this[_0xf72a('0x6a')][_0x531435['linkedid']];delete this[_0xf72a('0x6a')][_0x531435[_0xf72a('0xf8')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x271722,_0x177c5c,_0x2fd959){if(_['isUndefined'](_0x177c5c)&&_0xf72a('0xf9')!==typeof _0x177c5c){return;}if(_[_0xf72a('0xfa')](_0x2fd959)&&'object'!==typeof _0x2fd959){return;}switch(_0x2fd959[_0xf72a('0xfb')]){case'0':ut[_0xf72a('0xfc')](_0x271722,0x0,_0xf72a('0x9f'));rpcDb[_0xf72a('0xfd')](_0x271722,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xf72a('0xfc')](_0x271722,0x3,_0xf72a('0xfe'));rpcDb[_0xf72a('0xfd')](_0x271722,_0xf72a('0xff'));break;case'5':ut[_0xf72a('0xfc')](_0x271722,0x5,_0xf72a('0x100'));rpcDb[_0xf72a('0xfd')](_0x271722,_0xf72a('0x101'));break;case'8':ut[_0xf72a('0xfc')](_0x271722,0x8,_0xf72a('0xda'));rpcDb['createAgentHistory'](_0x271722,_0xf72a('0x102'));break;case'22':ut[_0xf72a('0xfc')](_0x271722,0x16,_0xf72a('0x103'));rpcDb[_0xf72a('0xfd')](_0x271722,_0xf72a('0x104'));break;default:ut[_0xf72a('0xfc')](_0x271722,0xc,_0x2fd959[_0xf72a('0xfb')]);rpcDb[_0xf72a('0xfd')](_0x271722,_0xf72a('0x102'));}ut[_0xf72a('0x77')](_0x177c5c,_0xf72a('0x105'));logger[_0xf72a('0x59')]('[originated][decrement][callProgressDetectingAgent]',_0x271722[_0xf72a('0xb5')],_0xf72a('0xc5'),_0x177c5c[_0xf72a('0x2a')],_0xf72a('0x6d'),_0x177c5c[_0xf72a('0x6e')]);delete this[_0xf72a('0x6a')][_0x271722[_0xf72a('0xb5')]];};Preview['prototype']['verifyAdditionalPhones']=function(_0x5bff74,_0x32a415,_0x3c69ae){return Promise[_0xf72a('0x106')]()[_0xf72a('0x80')](cmHopperAdditionalPhone[_0xf72a('0xa3')](_0x5bff74,_0x32a415,_0x3c69ae))['catch'](logger['info'](_0xf72a('0x107')));};Preview[_0xf72a('0x10')][_0xf72a('0xaf')]=function(_0x23e7c4,_0x4a1d4c,_0x243cb5){return Promise[_0xf72a('0x106')]()[_0xf72a('0x80')](cmHopperAdditionalPhone[_0xf72a('0xaf')](_0x23e7c4,_0x4a1d4c,_0x243cb5))[_0xf72a('0x75')](logger[_0xf72a('0x59')]('[swapAdditionalPhone]\x20'));};Preview[_0xf72a('0x10')]['incrementPreviewCounters']=function(_0x2417d4){return Promise[_0xf72a('0x106')]()[_0xf72a('0x80')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x2417d4))[_0xf72a('0x75')](logger[_0xf72a('0x59')](_0xf72a('0x108')));};Preview[_0xf72a('0x10')][_0xf72a('0x109')]=function(_0x40a5ba,_0x3e59c9,_0x2f16ff,_0x3e71b7,_0x5528dc){var _0x5b25a1=this;return new Promise(function(_0xba6310,_0x55ffe7){if(_[_0xf72a('0x81')](_0x3e59c9)||_[_0xf72a('0x81')](_0x3e59c9[_0xf72a('0x10a')])||_[_0xf72a('0x81')](_0x3e59c9[_0xf72a('0x10b')])||_['isNil'](_0x3e59c9[_0xf72a('0x10c')])){_0x55ffe7(ut[_0xf72a('0x4e')](_0xf72a('0x10d'),_0x3e71b7,_0x5528dc));return;}var _0xa38577=uuid['v4']();var _0x2e092c=_0x5b25a1[_0xf72a('0x14')][_0x3e59c9['Queue']['name']];var _0x52a781=_0x2f16ff?_0x5b25a1['agents'][_0x2f16ff]['id']:undefined;_0x5b25a1[_0xf72a('0x6a')][_0xa38577]=new Action(_0x3e59c9,_0x2e092c,_0xa38577,_0x2f16ff,_0x52a781);var _0x23f774=_0x5b25a1[_0xf72a('0x6a')][_0xa38577];_0x23f774['unlockAgent']=_0x3e71b7;_0x23f774['activeContact']=_0x5528dc;_0x23f774[_0xf72a('0x10e')]=_0x2f16ff;if(_['isEmpty'](_0x40a5ba)){_0x5b25a1['execCall'](_0x23f774,_0x2e092c,_0x3e59c9,_0x2f16ff)[_0xf72a('0x80')](function(_0x21863d){logger[_0xf72a('0x59')](_0xf72a('0x10f'),_0xf72a('0x110')+_0x23f774['queue']+_0xf72a('0x111')+_0x23f774['idContact'],JSON[_0xf72a('0x55')](_0x21863d));ami['emit']('custom:agentcalled',ut['buildObj'](_0x23f774,_0xf72a('0x112'),_0x5b25a1['campaignsPreview'][_0x23f774[_0xf72a('0x70')]]));_0xba6310(ut[_0xf72a('0x4e')](_0xf72a('0x113')));})['catch'](function(_0x20356a){ut[_0xf72a('0x5f')](_0xf72a('0x114'),_0x20356a);_0x55ffe7(ut[_0xf72a('0x4e')](_0xf72a('0x115'),_0x3e71b7,_0x5528dc));});}else{_0x2e092c[_0xf72a('0x3a')]+=0x1;ut[_0xf72a('0x116')](_0x23f774);rpcDb['createHistory'](_0x23f774,_0xf72a('0x117'));delete _0x5b25a1[_0xf72a('0x6a')][_0xa38577];_0x55ffe7(ut[_0xf72a('0x4e')](_0xf72a('0x118'),_0x3e71b7,_0x5528dc));}});};Preview['prototype'][_0xf72a('0x99')]=function(_0x2c8e00){return!_[_0xf72a('0x81')](_0x2c8e00)&&!_[_0xf72a('0x81')](_0x2c8e00[_0xf72a('0x2a')])&&!_['isNil'](_0x2c8e00['active'])&&_0x2c8e00[_0xf72a('0x53')]&&!_[_0xf72a('0x81')](this[_0xf72a('0x16')][util[_0xf72a('0x56')](_0xf72a('0x119'),_0x2c8e00['name'])])&&!_[_0xf72a('0x81')](this[_0xf72a('0x16')][util[_0xf72a('0x56')](_0xf72a('0x119'),_0x2c8e00[_0xf72a('0x2a')])][_0xf72a('0x11a')])&&(this[_0xf72a('0x16')][util[_0xf72a('0x56')](_0xf72a('0x119'),_0x2c8e00['name'])]['status']===_0xf72a('0x11b')||this[_0xf72a('0x16')][util['format'](_0xf72a('0x119'),_0x2c8e00['name'])][_0xf72a('0x11a')]===_0xf72a('0x11c'));};Preview['prototype'][_0xf72a('0x11d')]=function(_0x4732d8,_0x55a6e4){var _0x123862=this;return new Promise(function(_0x3ab920,_0x183d85){_0x123862['execRun'](_0x4732d8,_0x55a6e4)[_0xf72a('0x80')](function(_0x362b62){_0x3ab920(_[_0xf72a('0x11e')](_0x362b62,[_0xf72a('0x4e')]));})[_0xf72a('0x75')](function(_0x7b774a){if(_0x7b774a['unlock']){rpcDb[_0xf72a('0x11f')](_0x4732d8);}if(_0x7b774a[_0xf72a('0x53')]){rpcDb[_0xf72a('0x89')](_0x4732d8);}_0x183d85(_[_0xf72a('0x11e')](_0x7b774a,[_0xf72a('0x4e')]));});});};Preview['prototype'][_0xf72a('0x120')]=function(_0x5e946e,_0x4b4fbb){var _0x525a4c=this;return new Promise(function(_0x55ba1f,_0xc33e69){var _0x33f104,_0x42da16;rpcDb[_0xf72a('0x121')](_0x5e946e)[_0xf72a('0x80')](function(_0x12d250){if(!_[_0xf72a('0x81')](_0x12d250[0x0])){_0x42da16=_0x12d250[0x0]['recallme']?![]:!![];_0x33f104=_0x12d250[0x0][_0xf72a('0x122')]?!![]:![];_0x33f104=_0x4b4fbb?!![]:_0x33f104;}var _0x570622=_0x525a4c['validateContact'](_0x12d250);if(_0x570622[_0xf72a('0x123')]){rpcDb['checkIsBlackList'](_['pick'](_0x12d250[0x0],[_0xf72a('0x10c'),_0xf72a('0x10b')]))[_0xf72a('0x80')](function(_0x7a37e5){_0x525a4c['checkInBlack'](_0x7a37e5,_0x12d250[0x0],_0x4b4fbb,_0x42da16,_0x33f104)[_0xf72a('0x80')](function(_0x239990){_0x55ba1f(_0x239990);})[_0xf72a('0x75')](function(_0x3dbac4){_0xc33e69(_0x3dbac4);});})[_0xf72a('0x75')](function(_0xeda6e7){ut[_0xf72a('0x5f')](_0xf72a('0x124'),_0xeda6e7);_0xc33e69(ut['message'](_0xf72a('0x125'),_0x42da16,_0x33f104));});}else{_0xc33e69(ut['message'](_0x570622[_0xf72a('0x4e')],_0x42da16,_0x33f104));}})['catch'](function(_0xdfc0c5){ut[_0xf72a('0x5f')](_0xf72a('0x126'),_0xdfc0c5);_0xc33e69(ut[_0xf72a('0x4e')](_0xf72a('0x125'),![],!![]));});});};Preview['prototype'][_0xf72a('0x127')]=function(_0x3e5dae){if(_['isNil'](_0x3e5dae)||_[_0xf72a('0x128')](_0x3e5dae)||!_[_0xf72a('0x81')](_0x3e5dae[0x0][_0xf72a('0x85')])&&_[_0xf72a('0x81')](_0x3e5dae[0x0][_0xf72a('0x85')][_0xf72a('0x2a')])){ut[_0xf72a('0x5f')](_0xf72a('0x129'),_0x3e5dae);return{'isValid':![],'message':_0xf72a('0x12a')};}var _0x41c5f5=this[_0xf72a('0x14')][_0x3e5dae[0x0][_0xf72a('0x6c')][_0xf72a('0x2a')]];_0x41c5f5[_0xf72a('0x4e')]=_0xf72a('0x9b');if(_[_0xf72a('0x81')](_0x41c5f5)){ut[_0xf72a('0x5f')](_0xf72a('0x12b'),_0x41c5f5);return{'isValid':![],'message':_0xf72a('0x12c')};}if(!this['isTrunkReachable'](_0x41c5f5[_0xf72a('0x52')])){ut['logger'](_0xf72a('0x12d'),'campaign\x20Name:\x20'+_0x41c5f5[_0xf72a('0x2a')]+_0xf72a('0x12e'));if(!this['isTrunkReachable'](_0x41c5f5['TrunkBackup'])){ut[_0xf72a('0x5f')](_0xf72a('0x12d'),_0x41c5f5[_0xf72a('0x2a')]+_0xf72a('0x12f'));return{'isValid':![],'message':_0xf72a('0x130')};}}if(!ut[_0xf72a('0x97')](_0x41c5f5[_0xf72a('0x34')])){ut[_0xf72a('0x5f')](_0xf72a('0x131'),_0x41c5f5[_0xf72a('0x2a')]+_0xf72a('0x132'));return{'isValid':![],'message':_0xf72a('0x133')+_0x41c5f5[_0xf72a('0x2a')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xf72a('0x134')};};Preview['prototype']['execCall']=function(_0x4675d6,_0x140fca,_0x310a01,_0x5d3190){var _0x4ddfc8=this;return new Promise(function(_0x305687,_0x57f8de){var _0x231512=_0x4675d6[_0xf72a('0xb5')];var _0x45dae0=_0x4ddfc8['isTrunkReachable'](_0x140fca['Trunk'])?util[_0xf72a('0x56')](_0xf72a('0x135'),_0x140fca['Trunk'][_0xf72a('0x2a')],_[_0xf72a('0x81')](_0x140fca[_0xf72a('0x37')])?'':_0x140fca[_0xf72a('0x37')]['trim']()||'',_0x140fca['dialCutDigit']>0x0?_0x310a01[_0xf72a('0x10b')]['substring'](_0x140fca[_0xf72a('0x136')]):_0x310a01[_0xf72a('0x10b')]):util[_0xf72a('0x56')]('SIP/%s/%s%s',_[_0xf72a('0x81')](_0x140fca[_0xf72a('0x9a')])?_0x140fca['Trunk'][_0xf72a('0x2a')]:_0x140fca[_0xf72a('0x9a')]['name'],_['isNil'](_0x140fca[_0xf72a('0x37')])?'':_0x140fca[_0xf72a('0x37')][_0xf72a('0x137')]()||'',_0x140fca[_0xf72a('0x136')]>0x0?_0x310a01['phone'][_0xf72a('0x138')](_0x140fca[_0xf72a('0x136')]):_0x310a01[_0xf72a('0x10b')]);var _0x5e9474=_0x4ddfc8[_0xf72a('0x99')](_0x140fca[_0xf72a('0x52')])?ut['getCallerId'](_0x140fca[_0xf72a('0x52')]['callerid'],_0x140fca['dialOriginateCallerIdName'],_0x140fca[_0xf72a('0x139')]>0x0?ut[_0xf72a('0x13a')](_0x140fca[_0xf72a('0x36')],_0x140fca[_0xf72a('0x139')]):_0x140fca['dialOriginateCallerIdNumber']):ut[_0xf72a('0x13b')](_['isNil'](_0x140fca['TrunkBackup'])?_0x140fca[_0xf72a('0x52')]['callerid']:_0x140fca[_0xf72a('0x9a')][_0xf72a('0x13c')],_0x140fca[_0xf72a('0x13d')],_0x140fca[_0xf72a('0x139')]>0x0?ut[_0xf72a('0x13a')](_0x140fca['dialOriginateCallerIdNumber'],_0x140fca[_0xf72a('0x139')]):_0x140fca['dialOriginateCallerIdNumber']);if(_0x5e9474){_0x4675d6['originatecalleridname']=ut[_0xf72a('0x13e')](_0x5e9474);_0x4675d6['originatecalleridnum']=ut[_0xf72a('0x13f')](_0x5e9474);}var _0x2668fe=ut[_0xf72a('0x140')](_0x140fca,_0x310a01,_0x45dae0,_0x5e9474,_0x231512,_0x4675d6);_[_0xf72a('0x141')](_0x4675d6,ut['toLowerVariables'](_0x2668fe));_0x4675d6[_0xf72a('0x8a')]=moment()['format'](_0xf72a('0xb1'));_0x140fca['variables']=_0x2668fe;ami[_0xf72a('0x73')](ut[_0xf72a('0x142')](_0x4675d6,_0x140fca,_0x2668fe,_0x4675d6[_0xf72a('0xab')],_0x5d3190))[_0xf72a('0x80')](function(_0x245b68){_0x140fca[_0xf72a('0x6e')]+=0x1;logger[_0xf72a('0x59')]('[originated][increment]',_0x231512,_0xf72a('0xc5'),_0x140fca['name'],_0xf72a('0x6d'),_0x140fca[_0xf72a('0x6e')]);_0x305687(_0x245b68);})['catch'](function(_0x813a46){ut[_0xf72a('0xfc')](_0x4675d6,0xe,'OriginateError');rpcDb[_0xf72a('0xfd')](_0x4675d6,'[originateFailure][logOriginateFailure]');_0x57f8de(_0x813a46);});});};Preview[_0xf72a('0x10')]['syncNewExten']=function(_0x5e6fce){if(this[_0xf72a('0x6a')][_0x5e6fce[_0xf72a('0xc6')]]){this[_0xf72a('0x6a')][_0x5e6fce['linkedid']]['channel']=_0x5e6fce[_0xf72a('0x74')];}};Preview[_0xf72a('0x10')][_0xf72a('0x1a')]=function(_0x42165a){var _0x4ef052=this;var _0xdcfd0e=this[_0xf72a('0x6a')][_0x42165a[_0xf72a('0x143')]];if(_0xdcfd0e){if(_0xdcfd0e[_0xf72a('0x10e')]&&this[_0xf72a('0x17')][_0xdcfd0e['lookAgent']]){ut[_0xf72a('0x144')](_0xdcfd0e,this['agents'][_0xdcfd0e[_0xf72a('0x10e')]]['name'],this[_0xf72a('0x17')][_0xdcfd0e[_0xf72a('0x10e')]]['id']);}var _0x179a44=_[_0xf72a('0x145')](_0xdcfd0e);_0x179a44[_0xf72a('0xb2')]=moment()[_0xf72a('0x56')](_0xf72a('0xb1'));var _0x5caa0c=_0x4ef052[_0xf72a('0x14')][_0xdcfd0e[_0xf72a('0x70')]];if(ut[_0xf72a('0x146')](_0x42165a[_0xf72a('0x147')])){if(_0xdcfd0e[_0xf72a('0xd1')]){rpcDb[_0xf72a('0x11f')](_0xdcfd0e[_0xf72a('0xae')]);}if(_0xdcfd0e[_0xf72a('0xab')]){rpcDb[_0xf72a('0x89')](_0xdcfd0e[_0xf72a('0xae')]);}ami[_0xf72a('0x5c')](_0xf72a('0x148'),ut[_0xf72a('0xb7')](_0xdcfd0e,_0xf72a('0x149'),this['campaignsPreview'][_0xdcfd0e[_0xf72a('0x70')]]));this[_0xf72a('0x14a')](_0x179a44,_0x5caa0c,_0x42165a);}else{_0xdcfd0e[_0xf72a('0x8a')]=moment()[_0xf72a('0x56')](_0xf72a('0xb1'));ut[_0xf72a('0xfc')](_0x179a44,0x4,_0xf72a('0x14b'));rpcDb['createAgentHistory'](_0x179a44,_0xf72a('0x14c'));}}};Preview[_0xf72a('0x10')]['syncHangup']=function(_0x36101d){var _0x136e41=this[_0xf72a('0x6a')][_0x36101d[_0xf72a('0xc6')]];var _0x1f751b;if(_0x136e41){_0x1f751b=this[_0xf72a('0x14')][_0x136e41['queue']];logger[_0xf72a('0x59')](_0xf72a('0x14d'),_0x36101d[_0xf72a('0xc6')],_0xf72a('0xc5'),_0x1f751b[_0xf72a('0x2a')],_0xf72a('0x6f'),_0x1f751b[_0xf72a('0x2d')]);}if(this[_0xf72a('0x6a')][_0x36101d[_0xf72a('0xc6')]]&&_0x36101d[_0xf72a('0xc6')]!==_0x36101d[_0xf72a('0xb5')]){if(_0x36101d[_0xf72a('0x14e')]==='16'&&this[_0xf72a('0x6a')][_0x36101d[_0xf72a('0xc6')]][_0xf72a('0x79')]){this[_0xf72a('0x9c')](_0x36101d,_0x36101d[_0xf72a('0xc6')],_0x36101d['cause']);}else if(this['actions'][_0x36101d[_0xf72a('0xc6')]][_0xf72a('0x79')]){logger[_0xf72a('0x59')](_0xf72a('0x14f'),_0x36101d[_0xf72a('0xc6')],_0x36101d['cause'],'\x20Queue',_0x1f751b['name'],_0xf72a('0x6f'),_0x1f751b[_0xf72a('0x2d')]);this[_0xf72a('0x9c')](_0x36101d,_0x36101d['linkedid'],_0x36101d[_0xf72a('0x14e')]);}}else if(_0x136e41&&_[_0xf72a('0x81')](_0x136e41['statedesc'])&&_0x1f751b['dialQueueProject']&&_0x36101d[_0xf72a('0xc6')]===_0x36101d['uniqueid']&&_['isNil'](_0x36101d[_0xf72a('0xfb')])&&_0x36101d[_0xf72a('0x14e')]==='16'&&_0x36101d[_0xf72a('0x150')]==='6'&&_[_0xf72a('0xfa')](_0x136e41[_0xf72a('0x151')])){if(_0x136e41[_0xf72a('0xd1')]){rpcDb[_0xf72a('0x11f')](_0x136e41[_0xf72a('0xae')]);}if(_0x136e41[_0xf72a('0xab')]){rpcDb[_0xf72a('0x89')](_0x136e41[_0xf72a('0xae')]);}_0x36101d[_0xf72a('0xfb')]='22';this[_0xf72a('0x14a')](_0x136e41,_0x1f751b,_0x36101d);}else if(_0x136e41&&_0x136e41['transfer']){if(_0x36101d['cause']==='16'&&this[_0xf72a('0x6a')][_0x36101d[_0xf72a('0xc6')]][_0xf72a('0x79')]){logger[_0xf72a('0x59')]('[syncHangup][talking][transfer]',_0x36101d[_0xf72a('0xc6')],_0x36101d[_0xf72a('0x14e')],_0xf72a('0xc5'),_0x1f751b['name'],_0xf72a('0x6f'),_0x1f751b[_0xf72a('0x2d')]);this['callProgressDetectingCustomer'](_0x36101d,_0x36101d[_0xf72a('0xc6')],_0x36101d[_0xf72a('0x14e')]);}else if(this[_0xf72a('0x6a')][_0x36101d['linkedid']][_0xf72a('0x79')]){logger[_0xf72a('0x59')](_0xf72a('0x14f'),_0x36101d[_0xf72a('0xc6')],_0x36101d[_0xf72a('0x14e')],_0xf72a('0xc5'),_0x1f751b[_0xf72a('0x2a')],_0xf72a('0x6f'),_0x1f751b[_0xf72a('0x2d')]);this['callProgressDetectingCustomer'](_0x36101d,_0x36101d[_0xf72a('0xc6')],_0x36101d[_0xf72a('0x14e')]);}}};Preview['prototype'][_0xf72a('0x20')]=function(_0x383a13){if(this['actions'][_0x383a13['destlinkedid']]&&_0x383a13['destlinkedid']!==_0x383a13[_0xf72a('0x152')]){this['callProgressDetectingCustomer'](_0x383a13,_0x383a13['destlinkedid'],_0x383a13[_0xf72a('0xec')]);}};Preview[_0xf72a('0x10')]['syncHangupRequest']=function(_0x7ab8d){if(this['actions'][_0x7ab8d[_0xf72a('0xc6')]]&&_0x7ab8d['linkedid']!==_0x7ab8d['uniqueid']&&!this['actions'][_0x7ab8d[_0xf72a('0xc6')]]['dialAnswer']){if(_0x7ab8d[_0xf72a('0x14e')]==='1'){this[_0xf72a('0x9c')](_0x7ab8d,_0x7ab8d['linkedid'],_0x7ab8d[_0xf72a('0x14e')]);}}};Preview[_0xf72a('0x10')]['addVariable']=function(_0x33451f,_0x1a71ad,_0x2e4fbf){if(this[_0xf72a('0x6a')][_0x33451f]){if(_['isNil'](this[_0xf72a('0x6a')][_0x33451f][_0xf72a('0x153')])){this[_0xf72a('0x6a')][_0x33451f][_0xf72a('0x153')]={};}this[_0xf72a('0x6a')][_0x33451f][_0xf72a('0x153')][_0x1a71ad]=_0x2e4fbf;}};Preview[_0xf72a('0x10')]['syncVarSet']=function(_0x1b35dc){try{if(!_[_0xf72a('0x81')](_0x1b35dc)){if(ut[_0xf72a('0x154')](_[_0xf72a('0x155')](_0x1b35dc[_0xf72a('0x156')])[0x0])){this['addVariable'](_0x1b35dc[_0xf72a('0xb5')],_[_0xf72a('0x155')](_0x1b35dc['variable'])[0x0],_0x1b35dc[_0xf72a('0x157')]);}}}catch(_0x158a09){logger['error']('[syncVarSet][Preview]',util['inspect'](_0x158a09,{'showHidden':![],'depth':null}));}};Preview[_0xf72a('0x10')][_0xf72a('0x25')]=function(_0x4d4eff){if(_0x4d4eff){if(this[_0xf72a('0x6a')][_0x4d4eff[_0xf72a('0x158')]]){this[_0xf72a('0x6a')][_0x4d4eff[_0xf72a('0x158')]][_0xf72a('0x151')]=!![];}}};Preview[_0xf72a('0x10')]['syncBlindTransfer']=function(_0x5f31d3){if(_0x5f31d3){if(this[_0xf72a('0x6a')][_0x5f31d3['transfererlinkedid']]){this['actions'][_0x5f31d3[_0xf72a('0x159')]][_0xf72a('0x151')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xaf4d=['syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','loopCampaigns','syncCampaigns','hasOwnProperty','booked','outbound','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','sequence','enqueue','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','recallMe','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','catch','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','logCustomer','NoSuchNumber','custom:agentnosuchnumber','buildObj','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','connect','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','countbusyretry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','scheduledAt','NOANSWER','countnoanswerretry','NoAnswer','callAdditionalPhoneAfterMin','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','[Blacklist][error]','SIP/%s','status','reachable','unmonitored','execRun','getContactPreview','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','phone','SIP/%s/%s%s','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','Action','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','response','unlockContact','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','callProgressDetectingCustomer','cause','statedesc','dialQueueProject','channelstate','transfer','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','localhost','prototype','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels'];(function(_0x239a1b,_0xd5ec9a){var _0x5f19d4=function(_0x5db950){while(--_0x5db950){_0x239a1b['push'](_0x239a1b['shift']());}};_0x5f19d4(++_0xd5ec9a);}(_0xaf4d,0x14a));var _0xdaf4=function(_0x3987c3,_0x595319){_0x3987c3=_0x3987c3-0x0;var _0x2fd9ea=_0xaf4d[_0x3987c3];return _0x2fd9ea;};'use strict';var util=require(_0xdaf4('0x0'));var _=require('lodash');var uuid=require('uuid');var moment=require(_0xdaf4('0x1'));var md5=require(_0xdaf4('0x2'));var Redis=require(_0xdaf4('0x3'));var config=require(_0xdaf4('0x4'));var logger=require(_0xdaf4('0x5'))(_0xdaf4('0x6'));var loggerAction=require(_0xdaf4('0x5'))(_0xdaf4('0x7'));var ami=require(_0xdaf4('0x8'));var rpcDb=require(_0xdaf4('0x9'));var cmHopperAdditionalPhone=require(_0xdaf4('0xa'));var Action=require(_0xdaf4('0xb'));var ut=require(_0xdaf4('0xc'));config['redis']=_['defaults'](config['redis'],{'host':_0xdaf4('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xdaf4('0xe')]['enqueue']=function(_0x56aa00){this[_0xdaf4('0xf')]=this['tail']?this['tail'][_0xdaf4('0x10')](_0x56aa00):_0x56aa00();};function Preview(_0x106b5a){this['sequence']=new Sequence();this[_0xdaf4('0x11')]=_0x106b5a[_0xdaf4('0x12')];this[_0xdaf4('0x13')]=_0x106b5a[_0xdaf4('0x13')];this[_0xdaf4('0x14')]={};this['agents']=_0x106b5a[_0xdaf4('0x15')];this[_0xdaf4('0x16')]=0x0;ami['on']('originateresponse',this[_0xdaf4('0x17')][_0xdaf4('0x18')](this));ami['on'](_0xdaf4('0x19'),this['syncHangup'][_0xdaf4('0x18')](this));ami['on'](_0xdaf4('0x1a'),this[_0xdaf4('0x1b')]['bind'](this));ami['on'](_0xdaf4('0x1c'),this['syncDialEnd'][_0xdaf4('0x18')](this));ami['on']('newexten',this[_0xdaf4('0x1d')][_0xdaf4('0x18')](this));ami['on'](_0xdaf4('0x1e'),this[_0xdaf4('0x1f')]['bind'](this));ami['on'](_0xdaf4('0x20'),this[_0xdaf4('0x21')][_0xdaf4('0x18')](this));ami['on'](_0xdaf4('0x22'),this[_0xdaf4('0x23')][_0xdaf4('0x18')](this));this['loopCampaigns'](this[_0xdaf4('0x11')]);}function emit(_0x420dd4,_0x26e4a0,_0x3ca289){io['to'](_0x420dd4)[_0xdaf4('0x24')](_0x26e4a0,_0x3ca289);}function emitCampaignPreview(_0x3a2d48){if(_0x3a2d48[_0xdaf4('0x25')]==='outbound'){var _0x47955b={'id':_0x3a2d48['id'],'name':_0x3a2d48[_0xdaf4('0x26')],'strategy':_0x3a2d48[_0xdaf4('0x27')],'answered':_0x3a2d48[_0xdaf4('0x28')],'available':_0x3a2d48[_0xdaf4('0x29')],'loggedIn':_0x3a2d48[_0xdaf4('0x2a')],'pTalking':_0x3a2d48[_0xdaf4('0x2b')],'sumBillable':_0x3a2d48[_0xdaf4('0x2c')],'sumDuration':_0x3a2d48[_0xdaf4('0x2d')],'sumHoldTime':_0x3a2d48[_0xdaf4('0x2e')]||0x0,'talking':_0x3a2d48[_0xdaf4('0x2f')],'total':_0x3a2d48[_0xdaf4('0x30')],'type':_0x3a2d48[_0xdaf4('0x25')],'unmanaged':_0x3a2d48[_0xdaf4('0x31')],'abandoned':_0x3a2d48[_0xdaf4('0x32')],'waiting':_0x3a2d48[_0xdaf4('0x33')],'loggedInDb':_0x3a2d48[_0xdaf4('0x34')],'dialActive':_0x3a2d48[_0xdaf4('0x35')],'dialMethod':_0x3a2d48[_0xdaf4('0x36')],'dialOriginateCallerIdName':_0x3a2d48['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3a2d48['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3a2d48[_0xdaf4('0x37')],'dialPrefix':_0x3a2d48[_0xdaf4('0x38')],'outboundAnswerAgiCallsDay':_0x3a2d48['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x3a2d48[_0xdaf4('0x39')],'outboundBlacklistCallsDay':_0x3a2d48[_0xdaf4('0x3a')],'outboundBusyCallsDay':_0x3a2d48['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3a2d48[_0xdaf4('0x3b')],'outboundDropCallsDayACS':_0x3a2d48['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3a2d48[_0xdaf4('0x3c')],'outboundDropCallsDayTimeout':_0x3a2d48[_0xdaf4('0x3d')],'outboundNoAnswerCallsDay':_0x3a2d48[_0xdaf4('0x3e')],'outboundNoSuchCallsDay':_0x3a2d48[_0xdaf4('0x3f')],'outboundOriginateFailureCallsDay':_0x3a2d48[_0xdaf4('0x40')],'outboundReCallsDay':_0x3a2d48['outboundReCallsDay'],'outboundRejectCallsDay':_0x3a2d48[_0xdaf4('0x41')],'outboundUnknownCallsDay':_0x3a2d48['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x3a2d48[_0xdaf4('0x42')],'predictiveIntervalAnsweredCalls':_0x3a2d48[_0xdaf4('0x43')],'predictiveIntervalAvgHoldtime':_0x3a2d48[_0xdaf4('0x44')],'predictiveIntervalAvgTalktime':_0x3a2d48[_0xdaf4('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x3a2d48[_0xdaf4('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x3a2d48[_0xdaf4('0x47')],'predictiveIntervalErlangCalls':_0x3a2d48[_0xdaf4('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x3a2d48[_0xdaf4('0x49')],'predictiveIntervalHitRate':_0x3a2d48[_0xdaf4('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x3a2d48['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3a2d48[_0xdaf4('0x4b')],'predictiveIntervalAvailable':_0x3a2d48['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x3a2d48[_0xdaf4('0x4c')],'message':_0x3a2d48[_0xdaf4('0x4d')],'originated':_0x3a2d48[_0xdaf4('0x4e')],'erlangCalls':_0x3a2d48[_0xdaf4('0x4f')],'erlangCallToSecond':_0x3a2d48['erlangCallToSecond'],'erlangAbandonmentRate':_0x3a2d48[_0xdaf4('0x50')],'erlangBusyFactor':_0x3a2d48[_0xdaf4('0x51')],'startPredictive':_0x3a2d48[_0xdaf4('0x52')],'startProgressive':_0x3a2d48[_0xdaf4('0x53')]};if(_0x3a2d48[_0xdaf4('0x54')]){_0x47955b[_0xdaf4('0x54')]={'id':_0x3a2d48['Trunk']['id'],'name':_0x3a2d48[_0xdaf4('0x54')][_0xdaf4('0x26')],'active':_0x3a2d48['Trunk'][_0xdaf4('0x55')],'callerid':_0x3a2d48[_0xdaf4('0x54')][_0xdaf4('0x56')]};}if(_0x3a2d48[_0xdaf4('0x57')]){_0x47955b[_0xdaf4('0x57')]={'id':_0x3a2d48[_0xdaf4('0x57')]['id'],'name':_0x3a2d48[_0xdaf4('0x57')][_0xdaf4('0x26')]};}var _0x332048=md5(JSON[_0xdaf4('0x58')](_0x47955b));if(_0x3a2d48[_0xdaf4('0x2')]!==_0x332048){_0x3a2d48[_0xdaf4('0x2')]=_0x332048;emit(util[_0xdaf4('0x59')]('voice:queue:%s',_0x47955b[_0xdaf4('0x26')]),_0xdaf4('0x5a'),_0x47955b);}}}function emitVoiceQueueChannelRemove(_0x537c02){logger[_0xdaf4('0x5b')](_0xdaf4('0x5c'),JSON['stringify'](_0x537c02));emit(util[_0xdaf4('0x59')]('voice:queue:%s',_0x537c02[_0xdaf4('0x26')]),_0xdaf4('0x5d'),_0x537c02);io[_0xdaf4('0x24')](_0xdaf4('0x5e'),_0x537c02);}function notSendMessagesQueue(_0x43c6e3){if(_0x43c6e3[_0xdaf4('0x5f')]){if(_0x43c6e3['originated']===0x0&&_0x43c6e3['pTalking']===0x0){_0x43c6e3[_0xdaf4('0x5f')]=![];_0x43c6e3[_0xdaf4('0x29')]=0x0;_0x43c6e3['paused']=0x0;_0x43c6e3['message']=_0xdaf4('0x60');ut[_0xdaf4('0x61')](_0xdaf4('0x62'),_0x43c6e3[_0xdaf4('0x26')]+_0xdaf4('0x63'));}else{_0x43c6e3[_0xdaf4('0x4d')]='DEACTIVATED';ut[_0xdaf4('0x61')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x43c6e3[_0xdaf4('0x26')]+_0xdaf4('0x64'));}emitCampaignPreview(_0x43c6e3);}}Preview[_0xdaf4('0xe')][_0xdaf4('0x65')]=function(){var _0x1f4a1e=this;setInterval(function(){_0x1f4a1e[_0xdaf4('0x66')]();},0x7cf);};Preview[_0xdaf4('0xe')][_0xdaf4('0x66')]=function(){var _0x127674=this[_0xdaf4('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x37e0e7 in _0x127674){if(_0x127674[_0xdaf4('0x67')](_0x37e0e7)&&(_0x127674[_0x37e0e7][_0xdaf4('0x36')]===_0xdaf4('0x6')||_0x127674[_0x37e0e7][_0xdaf4('0x36')]===_0xdaf4('0x68'))&&_0x127674[_0x37e0e7][_0xdaf4('0x25')]===_0xdaf4('0x69')){if(this[_0xdaf4('0x16')]>0x7){this[_0xdaf4('0x16')]=0x0;this['clearZombieChannels']();}}if(_0x127674[_0xdaf4('0x67')](_0x37e0e7)&&_0x127674[_0x37e0e7][_0xdaf4('0x36')]===_0xdaf4('0x6')&&_0x127674[_0x37e0e7]['type']===_0xdaf4('0x69')){if(_0x127674[_0x37e0e7]['dialActive']){this[_0xdaf4('0x6a')](_0x127674[_0x37e0e7]);if(_0x127674[_0x37e0e7][_0xdaf4('0x6b')])this['recallMe'](_0x127674[_0x37e0e7]);}else{notSendMessagesQueue(_0x127674[_0x37e0e7]);}}}};Preview[_0xdaf4('0xe')][_0xdaf4('0x6c')]=function(_0x4cd19f){var _0x5ebbb7=this;this[_0xdaf4('0x6d')][_0xdaf4('0x6e')](function(){if(!_[_0xdaf4('0x6f')](_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f])){loggerAction['info'](_0xdaf4('0x70'),_0x4cd19f,_0xdaf4('0x71'),_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f]['queue'],_0xdaf4('0x72'),JSON[_0xdaf4('0x58')](_0x5ebbb7['campaignsPreview'][_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f][_0xdaf4('0x73')]][_0xdaf4('0x4e')]),'pTalking:\x20',JSON[_0xdaf4('0x58')](_0x5ebbb7[_0xdaf4('0x11')][_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f]['queue']][_0xdaf4('0x2b')]),JSON['stringify'](_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f][_0xdaf4('0x74')]),JSON[_0xdaf4('0x58')](_[_0xdaf4('0x75')](_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f],[_0xdaf4('0x76'),_0xdaf4('0x77'),_0xdaf4('0x78'),_0xdaf4('0x79')])));return ami['Action']({'action':'status','channel':_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f][_0xdaf4('0x7a')]})['catch'](function(_0x40a0a0){if(_0x40a0a0[_0xdaf4('0x4d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f]){ut['updateOriginated'](_0x5ebbb7['campaignsPreview'][_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f][_0xdaf4('0x73')]],_0xdaf4('0x7b'));if(_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f][_0xdaf4('0x74')]===!![]){ut[_0xdaf4('0x7c')](_0x5ebbb7[_0xdaf4('0x11')][_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f][_0xdaf4('0x73')]],'[clearZombieChannel]');ut[_0xdaf4('0x7d')](_0xdaf4('0x7e')+_0x4cd19f,_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f]['queue']);}ut[_0xdaf4('0x7d')](_0xdaf4('0x7f')+_0x4cd19f,_0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f][_0xdaf4('0x73')]);delete _0x5ebbb7[_0xdaf4('0x14')][_0x4cd19f];}},0x2328);}});}});};Preview[_0xdaf4('0xe')][_0xdaf4('0x80')]=function(){var _0x20a92a=this;loggerAction[_0xdaf4('0x5b')](_0xdaf4('0x81'),_[_0xdaf4('0x82')](this[_0xdaf4('0x14')]));for(var _0x562e97 in this[_0xdaf4('0x14')]){if(_0x20a92a[_0xdaf4('0x14')][_0xdaf4('0x67')](_0x562e97)){_0x20a92a[_0xdaf4('0x6c')](_0x562e97);}}};Preview['prototype'][_0xdaf4('0x83')]=function(_0x4acded){var _0x2bf49d=this;rpcDb[_0xdaf4('0x84')](_0x4acded['id'],ut[_0xdaf4('0x85')](this['agents']))[_0xdaf4('0x86')](function(_0x446208){if(!_[_0xdaf4('0x6f')](_0x446208)){for(var _0x258e7a=0x0;_0x258e7a<_0x446208['length'];_0x258e7a+=0x1){if(ut[_0xdaf4('0x87')](_0x446208[_0x258e7a][_0xdaf4('0x88')])<_0x4acded[_0xdaf4('0x89')]*0x3c){if(_0x446208[_0x258e7a][_0xdaf4('0x8a')]&&!_0x446208[_0x258e7a][_0xdaf4('0x8a')][_0xdaf4('0x8b')]){_0x2bf49d[_0xdaf4('0x8c')](_0x446208[_0x258e7a]['id'])[_0xdaf4('0x86')](ut[_0xdaf4('0x8d')](_0xdaf4('0x8e')))[_0xdaf4('0x8f')](ut[_0xdaf4('0x8d')](_0xdaf4('0x8e')));}else{rpcDb[_0xdaf4('0x90')](_0x446208[_0x258e7a]['id']);}}else{var _0x2f08e2=new Action(_0x446208[_0x258e7a],_0x4acded);_0x2f08e2[_0xdaf4('0x91')]=moment()['format'](_0xdaf4('0x92'));_0x4acded[_0xdaf4('0x93')]+=0x1;ut['logCustomer'](_0x2f08e2,0x17,_0xdaf4('0x94'));if(_0x4acded[_0xdaf4('0x95')]){rpcDb[_0xdaf4('0x96')](ut[_0xdaf4('0x97')](_0x446208[_0x258e7a]));rpcDb[_0xdaf4('0x98')](_0x2f08e2,_0xdaf4('0x99'));}else{ut['logCustomer'](_0x2f08e2,0x16,_0xdaf4('0x9a'));rpcDb[_0xdaf4('0x98')](_0x2f08e2,_0xdaf4('0x9b'));rpcDb[_0xdaf4('0x9c')](_0x2f08e2,_0xdaf4('0x9b'));}}}}})['catch'](ut[_0xdaf4('0x8d')](_0xdaf4('0x9d')));};Preview[_0xdaf4('0xe')]['setMessage']=function(_0x8de8fe){_0x8de8fe[_0xdaf4('0x5f')]=!![];if(ut[_0xdaf4('0x9e')](_0x8de8fe[_0xdaf4('0x2a')])){_0x8de8fe[_0xdaf4('0x4d')]=_0xdaf4('0x9f');}else if(!ut['isActive'](_0x8de8fe[_0xdaf4('0x35')])){_0x8de8fe[_0xdaf4('0x4d')]=_0xdaf4('0x60');}else if(!this[_0xdaf4('0xa0')](_0x8de8fe[_0xdaf4('0x54')])){if(!this[_0xdaf4('0xa0')](_0x8de8fe[_0xdaf4('0xa1')])){_0x8de8fe['message']=_0xdaf4('0xa2');}else{_0x8de8fe['message']=_0xdaf4('0xa3');}}else{_0x8de8fe['message']='ACTIVE';}emitCampaignPreview(_0x8de8fe);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x2ceca6,_0x3259f8,_0x25ea30){var _0x11d7db=this;var _0x1b0bd0=this[_0xdaf4('0x14')][_0x3259f8];var _0x30675c=this['campaignsPreview'][_0x1b0bd0[_0xdaf4('0x73')]];var _0x2730d5;var _0x528b7f=![];var _0x67c7c9=0x2;var _0x3404be=0x3;if(_0x30675c){switch(_0x25ea30){case'1':_0x30675c[_0xdaf4('0x3f')]+=0x1;_0x1b0bd0[_0xdaf4('0xa4')]+=0x1;_0x1b0bd0[_0xdaf4('0xa5')]=ut[_0xdaf4('0xa6')](_0x1b0bd0);ut[_0xdaf4('0xa7')](_0x1b0bd0,0x0,_0xdaf4('0xa8'));ami[_0xdaf4('0x24')](_0xdaf4('0xa9'),ut[_0xdaf4('0xaa')](_0x1b0bd0,'nosuchnumber'));rpcDb[_0xdaf4('0x98')](_0x1b0bd0,'[callProgressDetectingCustomer][logNoSuch]');_0x11d7db[_0xdaf4('0xab')](_0x1b0bd0,'0',_0x30675c)[_0xdaf4('0x86')](function(_0x3b246c){_0x528b7f=_0x3b246c[_0xdaf4('0xac')]==0x1;_0x67c7c9=_0x30675c[_0xdaf4('0xad')];_0x3404be=_0x30675c['callAdditionalPhoneAfterMin'];if(!_0x528b7f){if(ut[_0xdaf4('0xa6')](_0x1b0bd0)>=_0x30675c[_0xdaf4('0xae')]){_0x2730d5=ut[_0xdaf4('0xaf')](_0x1b0bd0,0xf,_0xdaf4('0xb0'));rpcDb[_0xdaf4('0x9c')](_0x2730d5,_0xdaf4('0xb1'));}else{if(_0x1b0bd0[_0xdaf4('0xa4')]>=_0x30675c[_0xdaf4('0xb2')]){rpcDb[_0xdaf4('0x9c')](_0x1b0bd0,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xdaf4('0xb3')](ut['scheduledAt'](_0x1b0bd0,_0xdaf4('0xa4'),_0x30675c[_0xdaf4('0xad')]),_0x1b0bd0[_0xdaf4('0xb4')],_0x1b0bd0[_0xdaf4('0xb5')]);}}delete this[_0xdaf4('0x14')][_0x2ceca6[_0xdaf4('0xb6')]];}else{_0x1b0bd0[_0xdaf4('0xa4')]++;logger['info'](_0xdaf4('0xb7'),_0x1b0bd0['countnosuchnumberretry']);logger[_0xdaf4('0x5b')]('id',_0x1b0bd0[_0xdaf4('0xb8')]);_0x11d7db[_0xdaf4('0xb9')]({'id':_0x1b0bd0[_0xdaf4('0xb8')],'field':{'countnosuchnumberretry':_0x1b0bd0['countnosuchnumberretry']}})[_0xdaf4('0x86')](function(){_0x11d7db[_0xdaf4('0xba')](_0x1b0bd0,_0x67c7c9,_0x3404be)[_0xdaf4('0x86')](function(){});});}});break;case _0xdaf4('0xbb'):var _0x35b337=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1b0bd0[_0xdaf4('0xbc')]=_0x35b337;_0x1b0bd0[_0xdaf4('0xbd')]=_0x35b337;_0x1b0bd0[_0xdaf4('0x74')]=!![];_0x30675c[_0xdaf4('0x2b')]+=0x1;logger[_0xdaf4('0x5b')](_0xdaf4('0xbe'),_0x1b0bd0[_0xdaf4('0xbf')],_0xdaf4('0xc0'),_0x30675c[_0xdaf4('0x26')],_0xdaf4('0xc1'),_0x30675c[_0xdaf4('0x2b')]);ami['emit']('custom:agentconnect',ut[_0xdaf4('0xaa')](_0x1b0bd0,_0xdaf4('0xc2'),this[_0xdaf4('0x11')][_0x1b0bd0['queue']]));if(_0x30675c['acw']){ami[_0xdaf4('0x24')]('custom:agentConnectPreview',ut[_0xdaf4('0xc3')](_0x1b0bd0));}break;case'16':ami[_0xdaf4('0x24')](_0xdaf4('0xc4'),ut[_0xdaf4('0xaa')](_0x1b0bd0,_0xdaf4('0xc5'),this[_0xdaf4('0x11')][_0x1b0bd0[_0xdaf4('0x73')]]));emitVoiceQueueChannelRemove(ut[_0xdaf4('0xaa')](_0x1b0bd0,_0xdaf4('0xc5')));_0x30675c[_0xdaf4('0x39')]+=0x1;_0x30675c[_0xdaf4('0x30')]+=0x1;_0x30675c[_0xdaf4('0x28')]+=0x1;ut['decrementTalkink'](_0x30675c,_0xdaf4('0xc6'));_0x1b0bd0[_0xdaf4('0xa5')]=ut[_0xdaf4('0xa6')](_0x1b0bd0);ut[_0xdaf4('0xa7')](_0x1b0bd0,0x4,_0xdaf4('0xc7'));rpcDb['createCustomerHistory'](_0x1b0bd0,_0xdaf4('0xc8'));rpcDb[_0xdaf4('0x9c')](_0x1b0bd0,_0xdaf4('0xc9'));rpcDb[_0xdaf4('0xca')](_0x1b0bd0);_0x30675c[_0xdaf4('0x2d')]+=_0x1b0bd0['talktime'];_0x30675c[_0xdaf4('0x2c')]+=_0x1b0bd0[_0xdaf4('0xcb')];logger[_0xdaf4('0x5b')]('[syncHangup][talking][decrement]',_0x1b0bd0[_0xdaf4('0xbf')],_0xdaf4('0xc0'),_0x30675c[_0xdaf4('0x26')],_0xdaf4('0xc1'),_0x30675c['pTalking']);delete this[_0xdaf4('0x14')][_0x2ceca6['linkedid']];break;case _0xdaf4('0xcc'):_0x30675c['outboundBusyCallsDay']+=0x1;_0x1b0bd0[_0xdaf4('0xcd')]+=0x1;_0x1b0bd0[_0xdaf4('0xa5')]=ut[_0xdaf4('0xa6')](_0x1b0bd0);ut[_0xdaf4('0xa7')](_0x1b0bd0,0x5,'Busy');_0x67c7c9=_0x30675c['dialBusyRetryFrequency'];_0x3404be=_0x30675c['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentbusy',ut[_0xdaf4('0xaa')](_0x1b0bd0,'busy'));rpcDb[_0xdaf4('0x98')](_0x1b0bd0,'[callProgressDetectingCustomer][logBusy]');_0x11d7db[_0xdaf4('0xab')](_0x1b0bd0,'5',_0x30675c)[_0xdaf4('0x86')](function(_0x46ae3b){_0x528b7f=_0x46ae3b[_0xdaf4('0xac')]==0x1;if(!_0x528b7f){if(ut[_0xdaf4('0xa6')](_0x1b0bd0)>=_0x30675c[_0xdaf4('0xae')]){_0x2730d5=ut[_0xdaf4('0xaf')](_0x1b0bd0,0xf,_0xdaf4('0xb0'));rpcDb[_0xdaf4('0x9c')](_0x2730d5,_0xdaf4('0xce'));}else{if(_0x1b0bd0[_0xdaf4('0xcd')]>=_0x30675c[_0xdaf4('0xcf')]){rpcDb[_0xdaf4('0x9c')](_0x1b0bd0,_0xdaf4('0xd0'));}else{rpcDb[_0xdaf4('0xb3')](ut[_0xdaf4('0xd1')](_0x1b0bd0,_0xdaf4('0xcd'),_0x30675c['dialBusyRetryFrequency']),_0x1b0bd0[_0xdaf4('0xb4')],_0x1b0bd0[_0xdaf4('0xb5')]);}}}else{_0x1b0bd0[_0xdaf4('0xcd')]++;_0x11d7db['incrementPreviewCounters']({'id':_0x1b0bd0[_0xdaf4('0xb8')],'field':{'countbusyretry':_0x1b0bd0[_0xdaf4('0xcd')]}})[_0xdaf4('0x86')](function(){_0x11d7db[_0xdaf4('0xba')](_0x1b0bd0,_0x67c7c9,_0x3404be)[_0xdaf4('0x86')](function(){});});}});break;case _0xdaf4('0xd2'):_0x30675c['outboundNoAnswerCallsDay']+=0x1;_0x1b0bd0[_0xdaf4('0xd3')]+=0x1;_0x1b0bd0[_0xdaf4('0xa5')]=ut[_0xdaf4('0xa6')](_0x1b0bd0);ut['logCustomer'](_0x1b0bd0,0x3,_0xdaf4('0xd4'));_0x67c7c9=_0x30675c['dialNoAnswerRetryFrequency'];_0x3404be=_0x30675c[_0xdaf4('0xd5')];var _0x387789=ut[_0xdaf4('0xd6')](_0x1b0bd0,_0x30675c);ami[_0xdaf4('0x24')]('custom:agentnoanswer',_0x387789);rpcDb[_0xdaf4('0x98')](_0x1b0bd0,_0xdaf4('0xd7'));_0x11d7db['verifyAdditionalPhones'](_0x1b0bd0,'3',_0x30675c)['then'](function(_0x41de13){_0x528b7f=_0x41de13['additional']==0x1;if(!_0x528b7f){if(ut[_0xdaf4('0xa6')](_0x1b0bd0)>=_0x30675c[_0xdaf4('0xae')]){_0x2730d5=ut[_0xdaf4('0xaf')](_0x1b0bd0,0xf,'Global');rpcDb[_0xdaf4('0x9c')](_0x2730d5,_0xdaf4('0xd8'));}else{if(_0x1b0bd0[_0xdaf4('0xd3')]>=_0x30675c['dialNoAnswerMaxRetry']){rpcDb[_0xdaf4('0x9c')](_0x1b0bd0,_0xdaf4('0xd7'));}else{rpcDb[_0xdaf4('0xb3')](ut[_0xdaf4('0xd1')](_0x1b0bd0,'countnoanswerretry',_0x30675c[_0xdaf4('0xd9')]),_0x1b0bd0[_0xdaf4('0xb4')],_0x1b0bd0[_0xdaf4('0xb5')]);}}}else{_0x1b0bd0[_0xdaf4('0xd3')]++;_0x11d7db[_0xdaf4('0xb9')]({'id':_0x1b0bd0[_0xdaf4('0xb8')],'field':{'countnoanswerretry':_0x1b0bd0[_0xdaf4('0xd3')]}})[_0xdaf4('0x86')](function(){_0x11d7db[_0xdaf4('0xba')](_0x1b0bd0,_0x67c7c9,_0x3404be)[_0xdaf4('0x86')](function(){});});}});break;case _0xdaf4('0xda'):_0x30675c['outboundCongestionCallsDay']+=0x1;_0x1b0bd0[_0xdaf4('0xdb')]+=0x1;_0x1b0bd0[_0xdaf4('0xa5')]=ut[_0xdaf4('0xa6')](_0x1b0bd0);ut[_0xdaf4('0xa7')](_0x1b0bd0,0x8,_0xdaf4('0xdc'));_0x67c7c9=_0x30675c[_0xdaf4('0xdd')];_0x3404be=_0x30675c[_0xdaf4('0xd5')];ami[_0xdaf4('0x24')](_0xdaf4('0xde'),ut[_0xdaf4('0xaa')](_0x1b0bd0,_0xdaf4('0xdf')));rpcDb[_0xdaf4('0x98')](_0x1b0bd0,_0xdaf4('0xe0'));_0x11d7db[_0xdaf4('0xab')](_0x1b0bd0,'8',_0x30675c)[_0xdaf4('0x86')](function(_0x374beb){_0x528b7f=_0x374beb['additional']==0x1;if(!_0x528b7f){if(ut[_0xdaf4('0xa6')](_0x1b0bd0)>=_0x30675c[_0xdaf4('0xae')]){_0x2730d5=ut[_0xdaf4('0xaf')](_0x1b0bd0,0xf,_0xdaf4('0xb0'));rpcDb[_0xdaf4('0x9c')](_0x2730d5,_0xdaf4('0xe1'));}else{if(_0x1b0bd0['countcongestionretry']>=_0x30675c[_0xdaf4('0xe2')]){rpcDb[_0xdaf4('0x9c')](_0x1b0bd0,_0xdaf4('0xe0'));}else{rpcDb['rescheduleContact'](ut[_0xdaf4('0xd1')](_0x1b0bd0,_0xdaf4('0xdb'),_0x30675c[_0xdaf4('0xe3')]),_0x1b0bd0[_0xdaf4('0xb4')],_0x1b0bd0[_0xdaf4('0xb5')]);}}}else{_0x1b0bd0[_0xdaf4('0xdb')]++;_0x11d7db[_0xdaf4('0xb9')]({'id':_0x1b0bd0[_0xdaf4('0xb8')],'field':{'countcongestionretry':_0x1b0bd0['countcongestionretry']}})[_0xdaf4('0x86')](function(){_0x11d7db[_0xdaf4('0xba')](_0x1b0bd0,_0x67c7c9,_0x3404be)[_0xdaf4('0x86')](function(){});});}});break;case'CANCEL':_0x30675c[_0xdaf4('0x41')]+=0x1;_0x1b0bd0['countagentrejectretry']+=0x1;_0x1b0bd0['countglobal']=ut[_0xdaf4('0xa6')](_0x1b0bd0);ut[_0xdaf4('0xa7')](_0x1b0bd0,0x14,_0xdaf4('0xe4'));_0x67c7c9=_0x30675c[_0xdaf4('0xe5')];_0x3404be=_0x30675c['callAdditionalPhoneAfterMin'];ami[_0xdaf4('0x24')]('custom:agentreject',ut[_0xdaf4('0xaa')](_0x1b0bd0,_0xdaf4('0xe6')));rpcDb[_0xdaf4('0x98')](_0x1b0bd0,_0xdaf4('0xe7'));_0x11d7db[_0xdaf4('0xab')](_0x1b0bd0,'20',_0x30675c)[_0xdaf4('0x86')](function(_0x8a3d0){_0x528b7f=_0x8a3d0[_0xdaf4('0xac')]==0x1;if(!_0x528b7f){if(ut[_0xdaf4('0xa6')](_0x1b0bd0)>=_0x30675c[_0xdaf4('0xae')]){_0x2730d5=ut[_0xdaf4('0xaf')](_0x1b0bd0,0x14,'AgentReject');rpcDb[_0xdaf4('0x9c')](_0x2730d5,_0xdaf4('0xe8'));}else{if(_0x1b0bd0[_0xdaf4('0xe9')]>=_0x30675c[_0xdaf4('0xea')]){rpcDb[_0xdaf4('0x9c')](_0x1b0bd0,_0xdaf4('0xe8'));}else{rpcDb['rescheduleContact'](ut[_0xdaf4('0xd1')](_0x1b0bd0,_0xdaf4('0xe9'),_0x30675c[_0xdaf4('0xe5')]),_0x1b0bd0['unlockAgent'],_0x1b0bd0[_0xdaf4('0xb5')]);}}}else{_0x1b0bd0[_0xdaf4('0xd3')]++;_0x11d7db[_0xdaf4('0xb9')]({'id':_0x1b0bd0[_0xdaf4('0xb8')],'field':{'countnoanswerretry':_0x1b0bd0[_0xdaf4('0xd3')]}})[_0xdaf4('0x86')](function(){_0x11d7db[_0xdaf4('0xba')](_0x1b0bd0,_0x67c7c9,_0x3404be)[_0xdaf4('0x86')](function(){});});}});break;case _0xdaf4('0xeb'):_0x30675c['outboundAbandonedCallsDay']+=0x1;_0x1b0bd0[_0xdaf4('0xec')]+=0x1;_0x1b0bd0[_0xdaf4('0xa5')]=ut[_0xdaf4('0xa6')](_0x1b0bd0);ut[_0xdaf4('0xa7')](_0x1b0bd0,0xb,_0xdaf4('0xed'));rpcDb['createCustomerHistory'](_0x1b0bd0,_0xdaf4('0xee'));_0x11d7db[_0xdaf4('0xab')](_0x1b0bd0,'11',_0x30675c)['then'](function(_0x5ae995){_0x528b7f=_0x5ae995['additional']==0x1;if(!_0x528b7f){if(ut[_0xdaf4('0xa6')](_0x1b0bd0)>=_0x30675c[_0xdaf4('0xae')]){_0x2730d5=ut[_0xdaf4('0xaf')](_0x1b0bd0,0xf,_0xdaf4('0xb0'));rpcDb[_0xdaf4('0x9c')](_0x2730d5,_0xdaf4('0xee'));}else{if(_0x1b0bd0[_0xdaf4('0xef')]>=_0x30675c['dialAbandonedMaxRety']){rpcDb[_0xdaf4('0x9c')](_0x1b0bd0,_0xdaf4('0xee'));}else{rpcDb['rescheduleContact'](ut[_0xdaf4('0xd1')](_0x1b0bd0,_0xdaf4('0xec'),_0x30675c[_0xdaf4('0xf0')]),_0x1b0bd0[_0xdaf4('0xb4')],_0x1b0bd0[_0xdaf4('0xb5')]);}}}else{_0x1b0bd0[_0xdaf4('0xd3')]++;_0x11d7db[_0xdaf4('0xb9')]({'id':_0x1b0bd0[_0xdaf4('0xb8')],'field':{'countnoanswerretry':_0x1b0bd0[_0xdaf4('0xd3')]}})[_0xdaf4('0x86')](function(){_0x11d7db[_0xdaf4('0xba')](_0x1b0bd0,_0x67c7c9,_0x3404be)[_0xdaf4('0x86')](function(){});});}});break;case'18':_0x30675c[_0xdaf4('0xf1')]+=0x1;_0x1b0bd0[_0xdaf4('0xf2')]+=0x1;_0x1b0bd0[_0xdaf4('0xa5')]=ut[_0xdaf4('0xa6')](_0x1b0bd0);ut['logCustomer'](_0x1b0bd0,0x12,_0x2ceca6[_0xdaf4('0xf3')]||_0x2ceca6[_0xdaf4('0xf4')]);ami[_0xdaf4('0x24')](_0xdaf4('0xf5'),ut[_0xdaf4('0xaa')](_0x1b0bd0,_0xdaf4('0xf6')));rpcDb[_0xdaf4('0x98')](_0x1b0bd0,'[callProgressDetectingCustomer][hangupInAMD]');_0x11d7db[_0xdaf4('0xab')](_0x1b0bd0,'18',_0x30675c)[_0xdaf4('0x86')](function(_0x49020f){_0x528b7f=_0x49020f[_0xdaf4('0xac')]==0x1;if(!_0x528b7f){if(ut['totalGlobal'](_0x1b0bd0)>=_0x30675c['dialGlobalMaxRetry']){_0x2730d5=ut[_0xdaf4('0xaf')](_0x1b0bd0,0x12,_0xdaf4('0xb0'));rpcDb[_0xdaf4('0x9c')](_0x2730d5,_0xdaf4('0xf7'));}else{rpcDb[_0xdaf4('0x9c')](_0x1b0bd0,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x1b0bd0[_0xdaf4('0xd3')]++;_0x11d7db['incrementPreviewCounters']({'id':_0x1b0bd0[_0xdaf4('0xb8')],'field':{'countnoanswerretry':_0x1b0bd0[_0xdaf4('0xd3')]}})[_0xdaf4('0x86')](function(){_0x11d7db['swapAdditionalPhones'](_0x1b0bd0,_0x67c7c9,_0x3404be)[_0xdaf4('0x86')](function(){});});}});delete this[_0xdaf4('0x14')][_0x2ceca6[_0xdaf4('0xb6')]];break;case'19':_0x30675c[_0xdaf4('0xf1')]+=0x1;_0x1b0bd0[_0xdaf4('0xa5')]=ut[_0xdaf4('0xa6')](_0x1b0bd0);ut[_0xdaf4('0xa7')](_0x1b0bd0,0x13,_0x2ceca6[_0xdaf4('0xf3')]||_0x2ceca6[_0xdaf4('0xf4')]);ami[_0xdaf4('0x24')](_0xdaf4('0xf5'),ut[_0xdaf4('0xaa')](_0x1b0bd0,_0xdaf4('0xf6')));rpcDb[_0xdaf4('0x98')](_0x1b0bd0,'[callProgressDetectingCustomer][machine]');_0x11d7db[_0xdaf4('0xab')](_0x1b0bd0,'18',_0x30675c)[_0xdaf4('0x86')](function(_0x1b3f87){_0x528b7f=_0x1b3f87[_0xdaf4('0xac')]==0x1;if(!_0x528b7f){if(ut[_0xdaf4('0xa6')](_0x1b0bd0)>=_0x30675c[_0xdaf4('0xae')]){_0x2730d5=ut['cloneAction'](_0x1b0bd0,0xf,_0xdaf4('0xb0'));rpcDb[_0xdaf4('0x9c')](_0x2730d5,_0xdaf4('0xf8'));}else{rpcDb['createCustomerFinal'](_0x1b0bd0,_0xdaf4('0xf8'));}}else{_0x1b0bd0['countnoanswerretry']++;_0x11d7db[_0xdaf4('0xb9')]({'id':_0x1b0bd0['idContact'],'field':{'countnoanswerretry':_0x1b0bd0[_0xdaf4('0xd3')]}})['then'](function(){_0x11d7db[_0xdaf4('0xba')](_0x1b0bd0,_0x67c7c9,_0x3404be)['then'](function(){});});}});delete this[_0xdaf4('0x14')][_0x2ceca6['linkedid']];break;default:if(_0x1b0bd0[_0xdaf4('0x74')]){ut['decrementTalkink'](_0x30675c,_0xdaf4('0xf9'));ut[_0xdaf4('0x7d')](_0xdaf4('0xfa')+_0x30675c[_0xdaf4('0x26')],_0x2ceca6);}_0x30675c[_0xdaf4('0xf1')]+=0x1;_0x1b0bd0[_0xdaf4('0xa5')]=ut[_0xdaf4('0xa6')](_0x1b0bd0);ut[_0xdaf4('0xa7')](_0x1b0bd0,0xc,_0x2ceca6['cause-txt']||_0x2ceca6[_0xdaf4('0xf4')]);_0x67c7c9=_0x30675c['dialAgentRejectRetryFrequency'];_0x3404be=_0x30675c[_0xdaf4('0xd5')];rpcDb[_0xdaf4('0x98')](_0x1b0bd0,_0xdaf4('0xfb'));_0x11d7db[_0xdaf4('0xab')](_0x1b0bd0,'20',_0x30675c)[_0xdaf4('0x86')](function(_0x288118){_0x528b7f=_0x288118[_0xdaf4('0xac')]==0x1;if(!_0x528b7f){if(ut[_0xdaf4('0xa6')](_0x1b0bd0)>=_0x30675c[_0xdaf4('0xae')]){_0x2730d5=ut[_0xdaf4('0xaf')](_0x1b0bd0,0xf,_0xdaf4('0xb0'));rpcDb[_0xdaf4('0x9c')](_0x2730d5,_0xdaf4('0xfc'));}else{rpcDb[_0xdaf4('0x9c')](_0x1b0bd0,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xdaf4('0x14')][_0x2ceca6[_0xdaf4('0xb6')]];}else{_0x11d7db[_0xdaf4('0xba')](_0x1b0bd0,_0x67c7c9,_0x3404be)['then'](function(){});}});}if(!(_0x1b0bd0[_0xdaf4('0x74')]&&_0x25ea30==='16')){ut[_0xdaf4('0xfd')](_0x30675c,_0xdaf4('0xfe'));logger[_0xdaf4('0x5b')](_0xdaf4('0xff'),_0x1b0bd0[_0xdaf4('0xbf')],'\x20Queue',_0x30675c['name'],_0xdaf4('0x72'),_0x30675c[_0xdaf4('0x4e')]);}if(_0x25ea30!==_0xdaf4('0xbb')){delete this['actions'][_0x2ceca6['linkedid']];delete this[_0xdaf4('0x14')][_0x2ceca6['destlinkedid']];}}};Preview[_0xdaf4('0xe')]['callProgressDetectingAgent']=function(_0x4675d8,_0x17bc43,_0x2f2aa9){if(_['isUndefined'](_0x17bc43)&&'object'!==typeof _0x17bc43){return;}if(_[_0xdaf4('0x100')](_0x2f2aa9)&&_0xdaf4('0x101')!==typeof _0x2f2aa9){return;}switch(_0x2f2aa9[_0xdaf4('0x102')]){case'0':ut[_0xdaf4('0x103')](_0x4675d8,0x0,_0xdaf4('0xa8'));rpcDb[_0xdaf4('0x104')](_0x4675d8,_0xdaf4('0x105'));break;case'3':ut[_0xdaf4('0x103')](_0x4675d8,0x3,_0xdaf4('0xd4'));rpcDb['createAgentHistory'](_0x4675d8,_0xdaf4('0x106'));break;case'5':ut[_0xdaf4('0x103')](_0x4675d8,0x5,'Busy');rpcDb[_0xdaf4('0x104')](_0x4675d8,_0xdaf4('0x107'));break;case'8':ut[_0xdaf4('0x103')](_0x4675d8,0x8,'Congestion');rpcDb[_0xdaf4('0x104')](_0x4675d8,_0xdaf4('0x108'));break;case'22':ut['logAgent'](_0x4675d8,0x16,_0xdaf4('0x109'));rpcDb[_0xdaf4('0x104')](_0x4675d8,_0xdaf4('0x10a'));break;default:ut[_0xdaf4('0x103')](_0x4675d8,0xc,_0x2f2aa9[_0xdaf4('0x102')]);rpcDb[_0xdaf4('0x104')](_0x4675d8,_0xdaf4('0x108'));}ut[_0xdaf4('0xfd')](_0x17bc43,_0xdaf4('0x10b'));logger[_0xdaf4('0x5b')](_0xdaf4('0x10c'),_0x4675d8[_0xdaf4('0xbf')],_0xdaf4('0xc0'),_0x17bc43[_0xdaf4('0x26')],_0xdaf4('0x72'),_0x17bc43[_0xdaf4('0x4e')]);delete this[_0xdaf4('0x14')][_0x4675d8[_0xdaf4('0xbf')]];};Preview[_0xdaf4('0xe')][_0xdaf4('0xab')]=function(_0x175388,_0x1aefc3,_0x17a7c0){return Promise[_0xdaf4('0x10d')]()[_0xdaf4('0x86')](cmHopperAdditionalPhone[_0xdaf4('0xab')](_0x175388,_0x1aefc3,_0x17a7c0))[_0xdaf4('0x8f')](logger[_0xdaf4('0x5b')](_0xdaf4('0x10e')));};Preview['prototype'][_0xdaf4('0xba')]=function(_0x2ca20a,_0x92ec9e,_0x54e12e){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0xdaf4('0xba')](_0x2ca20a,_0x92ec9e,_0x54e12e))[_0xdaf4('0x8f')](logger[_0xdaf4('0x5b')](_0xdaf4('0x10f')));};Preview[_0xdaf4('0xe')][_0xdaf4('0xb9')]=function(_0x4b7e6f){return Promise[_0xdaf4('0x10d')]()[_0xdaf4('0x86')](cmHopperAdditionalPhone[_0xdaf4('0xb9')](_0x4b7e6f))[_0xdaf4('0x8f')](logger[_0xdaf4('0x5b')](_0xdaf4('0x110')));};Preview[_0xdaf4('0xe')]['checkInBlack']=function(_0xdd7d58,_0x4955cc,_0x2be2d9,_0x2d905e,_0x58ccb4){var _0x37005=this;return new Promise(function(_0x4aa23d,_0x57b284){if(_[_0xdaf4('0x6f')](_0x4955cc)||_[_0xdaf4('0x6f')](_0x4955cc['Contact'])||_['isNil'](_0x4955cc['phone'])||_[_0xdaf4('0x6f')](_0x4955cc[_0xdaf4('0x78')])){_0x57b284(ut[_0xdaf4('0x4d')](_0xdaf4('0x111'),_0x2d905e,_0x58ccb4));return;}var _0x5d255d=uuid['v4']();var _0x147f05=_0x37005[_0xdaf4('0x11')][_0x4955cc[_0xdaf4('0x71')]['name']];var _0x4940df=_0x2be2d9?_0x37005[_0xdaf4('0x15')][_0x2be2d9]['id']:undefined;_0x37005[_0xdaf4('0x14')][_0x5d255d]=new Action(_0x4955cc,_0x147f05,_0x5d255d,_0x2be2d9,_0x4940df);var _0x1b2d03=_0x37005[_0xdaf4('0x14')][_0x5d255d];_0x1b2d03[_0xdaf4('0xb4')]=_0x2d905e;_0x1b2d03[_0xdaf4('0xb5')]=_0x58ccb4;_0x1b2d03[_0xdaf4('0x112')]=_0x2be2d9;if(_[_0xdaf4('0x113')](_0xdd7d58)){_0x37005[_0xdaf4('0x114')](_0x1b2d03,_0x147f05,_0x4955cc,_0x2be2d9)[_0xdaf4('0x86')](function(_0x475257){logger[_0xdaf4('0x5b')]('[Preview][execCall][success]',_0xdaf4('0x115')+_0x1b2d03['queue']+_0xdaf4('0x116')+_0x1b2d03[_0xdaf4('0xb8')],JSON[_0xdaf4('0x58')](_0x475257));ami[_0xdaf4('0x24')](_0xdaf4('0x117'),ut[_0xdaf4('0xaa')](_0x1b2d03,'called',_0x37005[_0xdaf4('0x11')][_0x1b2d03[_0xdaf4('0x73')]]));_0x4aa23d(ut[_0xdaf4('0x4d')](_0xdaf4('0x118')));})[_0xdaf4('0x8f')](function(_0x12be74){ut[_0xdaf4('0x61')](_0xdaf4('0x119'),_0x12be74);_0x57b284(ut[_0xdaf4('0x4d')](_0xdaf4('0x11a'),_0x2d905e,_0x58ccb4));});}else{_0x147f05[_0xdaf4('0x3a')]+=0x1;ut['logBlacklist'](_0x1b2d03);rpcDb['createHistory'](_0x1b2d03,_0xdaf4('0x11b'));delete _0x37005[_0xdaf4('0x14')][_0x5d255d];_0x57b284(ut['message']('Contact\x20in\x20black\x20List',_0x2d905e,_0x58ccb4));}});};Preview[_0xdaf4('0xe')][_0xdaf4('0xa0')]=function(_0xba6c60){return!_[_0xdaf4('0x6f')](_0xba6c60)&&!_[_0xdaf4('0x6f')](_0xba6c60[_0xdaf4('0x26')])&&!_[_0xdaf4('0x6f')](_0xba6c60[_0xdaf4('0x55')])&&_0xba6c60[_0xdaf4('0x55')]&&!_['isNil'](this[_0xdaf4('0x13')][util[_0xdaf4('0x59')](_0xdaf4('0x11c'),_0xba6c60[_0xdaf4('0x26')])])&&!_[_0xdaf4('0x6f')](this[_0xdaf4('0x13')][util[_0xdaf4('0x59')](_0xdaf4('0x11c'),_0xba6c60[_0xdaf4('0x26')])][_0xdaf4('0x11d')])&&(this[_0xdaf4('0x13')][util['format']('SIP/%s',_0xba6c60['name'])]['status']===_0xdaf4('0x11e')||this[_0xdaf4('0x13')][util[_0xdaf4('0x59')](_0xdaf4('0x11c'),_0xba6c60['name'])][_0xdaf4('0x11d')]===_0xdaf4('0x11f'));};Preview[_0xdaf4('0xe')][_0xdaf4('0x8c')]=function(_0xe081b1,_0x1a723b){var _0x1c3787=this;return new Promise(function(_0x36a206,_0x380bb5){_0x1c3787[_0xdaf4('0x120')](_0xe081b1,_0x1a723b)['then'](function(_0x29ac02){_0x36a206(_[_0xdaf4('0x75')](_0x29ac02,[_0xdaf4('0x4d')]));})[_0xdaf4('0x8f')](function(_0x19f8a4){if(_0x19f8a4['unlock']){rpcDb['unlockContact'](_0xe081b1);}if(_0x19f8a4['active']){rpcDb[_0xdaf4('0x90')](_0xe081b1);}_0x380bb5(_[_0xdaf4('0x75')](_0x19f8a4,[_0xdaf4('0x4d')]));});});};Preview['prototype'][_0xdaf4('0x120')]=function(_0xb72e47,_0x5620cb){var _0xddadc9=this;return new Promise(function(_0xd4b9ff,_0x3e3fc2){var _0x41e822,_0x214672;rpcDb[_0xdaf4('0x121')](_0xb72e47)[_0xdaf4('0x86')](function(_0x461ee9){if(!_['isNil'](_0x461ee9[0x0])){_0x214672=_0x461ee9[0x0][_0xdaf4('0x122')]?![]:!![];_0x41e822=_0x461ee9[0x0][_0xdaf4('0x122')]?!![]:![];_0x41e822=_0x5620cb?!![]:_0x41e822;}var _0x36aa86=_0xddadc9[_0xdaf4('0x123')](_0x461ee9);if(_0x36aa86['isValid']){rpcDb[_0xdaf4('0x124')](_[_0xdaf4('0x75')](_0x461ee9[0x0],[_0xdaf4('0x78'),'phone']))['then'](function(_0x301a9a){_0xddadc9['checkInBlack'](_0x301a9a,_0x461ee9[0x0],_0x5620cb,_0x214672,_0x41e822)[_0xdaf4('0x86')](function(_0x54f9b8){_0xd4b9ff(_0x54f9b8);})[_0xdaf4('0x8f')](function(_0x236eac){_0x3e3fc2(_0x236eac);});})[_0xdaf4('0x8f')](function(_0x597ec2){ut[_0xdaf4('0x61')](_0xdaf4('0x125'),_0x597ec2);_0x3e3fc2(ut[_0xdaf4('0x4d')](_0xdaf4('0x126'),_0x214672,_0x41e822));});}else{_0x3e3fc2(ut[_0xdaf4('0x4d')](_0x36aa86['message'],_0x214672,_0x41e822));}})[_0xdaf4('0x8f')](function(_0x57098d){ut[_0xdaf4('0x61')](_0xdaf4('0x127'),_0x57098d);_0x3e3fc2(ut[_0xdaf4('0x4d')](_0xdaf4('0x126'),![],!![]));});});};Preview[_0xdaf4('0xe')][_0xdaf4('0x123')]=function(_0x26303d){if(_[_0xdaf4('0x6f')](_0x26303d)||_['isEmpty'](_0x26303d)||!_[_0xdaf4('0x6f')](_0x26303d[0x0]['Agent'])&&_[_0xdaf4('0x6f')](_0x26303d[0x0][_0xdaf4('0x8a')][_0xdaf4('0x26')])){ut[_0xdaf4('0x61')](_0xdaf4('0x128'),_0x26303d);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x104642=this[_0xdaf4('0x11')][_0x26303d[0x0][_0xdaf4('0x71')][_0xdaf4('0x26')]];_0x104642[_0xdaf4('0x4d')]='ACTIVE';if(_[_0xdaf4('0x6f')](_0x104642)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x104642);return{'isValid':![],'message':_0xdaf4('0x129')};}if(!this[_0xdaf4('0xa0')](_0x104642[_0xdaf4('0x54')])){ut[_0xdaf4('0x61')](_0xdaf4('0x12a'),_0xdaf4('0x12b')+_0x104642[_0xdaf4('0x26')]+_0xdaf4('0x12c'));if(!this[_0xdaf4('0xa0')](_0x104642[_0xdaf4('0xa1')])){ut[_0xdaf4('0x61')](_0xdaf4('0x12a'),_0x104642[_0xdaf4('0x26')]+_0xdaf4('0x12d'));return{'isValid':![],'message':_0xdaf4('0x12e')};}}if(!ut[_0xdaf4('0x12f')](_0x104642[_0xdaf4('0x35')])){ut[_0xdaf4('0x61')](_0xdaf4('0x130'),_0x104642[_0xdaf4('0x26')]+_0xdaf4('0x131'));return{'isValid':![],'message':_0xdaf4('0x12b')+_0x104642[_0xdaf4('0x26')]+_0xdaf4('0x131')};}return{'isValid':!![],'message':_0xdaf4('0x132')};};Preview['prototype']['execCall']=function(_0x5476d0,_0x4b08a4,_0x164df0,_0x7eaf05){var _0x1d2a0d=this;return new Promise(function(_0x3a22ec,_0x472b1f){var _0x1da030=_0x5476d0[_0xdaf4('0xbf')];var _0x1ad655=_0x1d2a0d[_0xdaf4('0xa0')](_0x4b08a4[_0xdaf4('0x54')])?util[_0xdaf4('0x59')]('SIP/%s/%s%s',_0x4b08a4[_0xdaf4('0x54')][_0xdaf4('0x26')],_['isNil'](_0x4b08a4[_0xdaf4('0x38')])?'':_0x4b08a4['dialPrefix'][_0xdaf4('0x133')]()||'',_0x4b08a4[_0xdaf4('0x134')]>0x0?_0x164df0[_0xdaf4('0x135')]['substring'](_0x4b08a4['dialCutDigit']):_0x164df0[_0xdaf4('0x135')]):util['format'](_0xdaf4('0x136'),_[_0xdaf4('0x6f')](_0x4b08a4['TrunkBackup'])?_0x4b08a4['Trunk']['name']:_0x4b08a4[_0xdaf4('0xa1')][_0xdaf4('0x26')],_[_0xdaf4('0x6f')](_0x4b08a4[_0xdaf4('0x38')])?'':_0x4b08a4[_0xdaf4('0x38')]['trim']()||'',_0x4b08a4['dialCutDigit']>0x0?_0x164df0[_0xdaf4('0x135')][_0xdaf4('0x137')](_0x4b08a4['dialCutDigit']):_0x164df0[_0xdaf4('0x135')]);var _0x563924=_0x1d2a0d[_0xdaf4('0xa0')](_0x4b08a4[_0xdaf4('0x54')])?ut[_0xdaf4('0x138')](_0x4b08a4[_0xdaf4('0x54')][_0xdaf4('0x56')],_0x4b08a4[_0xdaf4('0x139')],_0x4b08a4[_0xdaf4('0x13a')]>0x0?ut[_0xdaf4('0x13b')](_0x4b08a4['dialOriginateCallerIdNumber'],_0x4b08a4[_0xdaf4('0x13a')]):_0x4b08a4['dialOriginateCallerIdNumber']):ut[_0xdaf4('0x138')](_[_0xdaf4('0x6f')](_0x4b08a4[_0xdaf4('0xa1')])?_0x4b08a4[_0xdaf4('0x54')]['callerid']:_0x4b08a4['TrunkBackup'][_0xdaf4('0x56')],_0x4b08a4[_0xdaf4('0x139')],_0x4b08a4[_0xdaf4('0x13a')]>0x0?ut[_0xdaf4('0x13b')](_0x4b08a4['dialOriginateCallerIdNumber'],_0x4b08a4[_0xdaf4('0x13a')]):_0x4b08a4[_0xdaf4('0x13c')]);if(_0x563924){_0x5476d0[_0xdaf4('0x13d')]=ut[_0xdaf4('0x13e')](_0x563924);_0x5476d0[_0xdaf4('0x13f')]=ut[_0xdaf4('0x140')](_0x563924);}var _0x36c51c=ut[_0xdaf4('0x141')](_0x4b08a4,_0x164df0,_0x1ad655,_0x563924,_0x1da030,_0x5476d0);_['merge'](_0x5476d0,ut['toLowerVariables'](_0x36c51c));_0x5476d0[_0xdaf4('0x91')]=moment()['format'](_0xdaf4('0x92'));_0x4b08a4['variables']=_0x36c51c;ami[_0xdaf4('0x142')](ut[_0xdaf4('0x143')](_0x5476d0,_0x4b08a4,_0x36c51c,_0x5476d0['activeContact'],_0x7eaf05))['then'](function(_0x1f2bd9){_0x4b08a4[_0xdaf4('0x4e')]+=0x1;logger[_0xdaf4('0x5b')]('[originated][increment]',_0x1da030,_0xdaf4('0xc0'),_0x4b08a4['name'],_0xdaf4('0x72'),_0x4b08a4[_0xdaf4('0x4e')]);_0x3a22ec(_0x1f2bd9);})[_0xdaf4('0x8f')](function(_0x3afa59){ut[_0xdaf4('0x103')](_0x5476d0,0xe,_0xdaf4('0x144'));rpcDb[_0xdaf4('0x104')](_0x5476d0,_0xdaf4('0x145'));_0x472b1f(_0x3afa59);});});};Preview['prototype']['syncNewExten']=function(_0x76b000){if(this[_0xdaf4('0x14')][_0x76b000[_0xdaf4('0xb6')]]){this[_0xdaf4('0x14')][_0x76b000[_0xdaf4('0xb6')]][_0xdaf4('0x7a')]=_0x76b000['channel'];}};Preview[_0xdaf4('0xe')][_0xdaf4('0x17')]=function(_0x3cc64a){var _0x19d70a=this;var _0x4e93ca=this[_0xdaf4('0x14')][_0x3cc64a[_0xdaf4('0x146')]];if(_0x4e93ca){if(_0x4e93ca[_0xdaf4('0x112')]&&this[_0xdaf4('0x15')][_0x4e93ca['lookAgent']]){ut[_0xdaf4('0x147')](_0x4e93ca,this[_0xdaf4('0x15')][_0x4e93ca[_0xdaf4('0x112')]][_0xdaf4('0x26')],this[_0xdaf4('0x15')][_0x4e93ca['lookAgent']]['id']);}var _0x4f8cdf=_[_0xdaf4('0x148')](_0x4e93ca);_0x4f8cdf[_0xdaf4('0xbc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0xb1b3db=_0x19d70a[_0xdaf4('0x11')][_0x4e93ca['queue']];if(ut['isFailure'](_0x3cc64a[_0xdaf4('0x149')])){if(_0x4e93ca[_0xdaf4('0xb4')]){rpcDb[_0xdaf4('0x14a')](_0x4e93ca['idContact']);}if(_0x4e93ca['activeContact']){rpcDb[_0xdaf4('0x90')](_0x4e93ca['idContact']);}ami[_0xdaf4('0x24')](_0xdaf4('0x14b'),ut[_0xdaf4('0xaa')](_0x4e93ca,_0xdaf4('0x14c'),this[_0xdaf4('0x11')][_0x4e93ca[_0xdaf4('0x73')]]));this[_0xdaf4('0x14d')](_0x4f8cdf,_0xb1b3db,_0x3cc64a);}else{_0x4e93ca[_0xdaf4('0x91')]=moment()[_0xdaf4('0x59')](_0xdaf4('0x92'));ut[_0xdaf4('0x103')](_0x4f8cdf,0x4,'Answer');rpcDb['createAgentHistory'](_0x4f8cdf,_0xdaf4('0x14e'));}}};Preview[_0xdaf4('0xe')]['syncHangup']=function(_0x306505){var _0x580e60=this[_0xdaf4('0x14')][_0x306505[_0xdaf4('0xb6')]];var _0x35dd70;if(_0x580e60){_0x35dd70=this[_0xdaf4('0x11')][_0x580e60[_0xdaf4('0x73')]];logger[_0xdaf4('0x5b')](_0xdaf4('0x14f'),_0x306505[_0xdaf4('0xb6')],_0xdaf4('0xc0'),_0x35dd70[_0xdaf4('0x26')],_0xdaf4('0xc1'),_0x35dd70[_0xdaf4('0x2b')]);}if(this[_0xdaf4('0x14')][_0x306505[_0xdaf4('0xb6')]]&&_0x306505[_0xdaf4('0xb6')]!==_0x306505[_0xdaf4('0xbf')]){if(_0x306505['cause']==='16'&&this[_0xdaf4('0x14')][_0x306505[_0xdaf4('0xb6')]][_0xdaf4('0x74')]){this[_0xdaf4('0x150')](_0x306505,_0x306505[_0xdaf4('0xb6')],_0x306505[_0xdaf4('0x151')]);}else if(this[_0xdaf4('0x14')][_0x306505[_0xdaf4('0xb6')]][_0xdaf4('0x74')]){logger[_0xdaf4('0x5b')]('[syncHangup][talking][cause]',_0x306505[_0xdaf4('0xb6')],_0x306505[_0xdaf4('0x151')],_0xdaf4('0xc0'),_0x35dd70['name'],'pTalking:\x20',_0x35dd70[_0xdaf4('0x2b')]);this[_0xdaf4('0x150')](_0x306505,_0x306505[_0xdaf4('0xb6')],_0x306505[_0xdaf4('0x151')]);}}else if(_0x580e60&&_[_0xdaf4('0x6f')](_0x580e60[_0xdaf4('0x152')])&&_0x35dd70[_0xdaf4('0x153')]&&_0x306505['linkedid']===_0x306505[_0xdaf4('0xbf')]&&_['isNil'](_0x306505[_0xdaf4('0x102')])&&_0x306505[_0xdaf4('0x151')]==='16'&&_0x306505[_0xdaf4('0x154')]==='6'&&_[_0xdaf4('0x100')](_0x580e60[_0xdaf4('0x155')])){if(_0x580e60[_0xdaf4('0xb4')]){rpcDb[_0xdaf4('0x14a')](_0x580e60[_0xdaf4('0xb8')]);}if(_0x580e60[_0xdaf4('0xb5')]){rpcDb['disableContact'](_0x580e60[_0xdaf4('0xb8')]);}_0x306505[_0xdaf4('0x102')]='22';this[_0xdaf4('0x14d')](_0x580e60,_0x35dd70,_0x306505);}else if(_0x580e60&&_0x580e60['transfer']){if(_0x306505['cause']==='16'&&this['actions'][_0x306505[_0xdaf4('0xb6')]][_0xdaf4('0x74')]){logger[_0xdaf4('0x5b')]('[syncHangup][talking][transfer]',_0x306505[_0xdaf4('0xb6')],_0x306505[_0xdaf4('0x151')],_0xdaf4('0xc0'),_0x35dd70[_0xdaf4('0x26')],_0xdaf4('0xc1'),_0x35dd70[_0xdaf4('0x2b')]);this['callProgressDetectingCustomer'](_0x306505,_0x306505[_0xdaf4('0xb6')],_0x306505[_0xdaf4('0x151')]);}else if(this[_0xdaf4('0x14')][_0x306505[_0xdaf4('0xb6')]][_0xdaf4('0x74')]){logger[_0xdaf4('0x5b')]('[syncHangup][talking][cause]',_0x306505[_0xdaf4('0xb6')],_0x306505[_0xdaf4('0x151')],_0xdaf4('0xc0'),_0x35dd70[_0xdaf4('0x26')],_0xdaf4('0xc1'),_0x35dd70[_0xdaf4('0x2b')]);this[_0xdaf4('0x150')](_0x306505,_0x306505[_0xdaf4('0xb6')],_0x306505[_0xdaf4('0x151')]);}}};Preview['prototype']['syncDialEnd']=function(_0x170681){if(this[_0xdaf4('0x14')][_0x170681['destlinkedid']]&&_0x170681[_0xdaf4('0x156')]!==_0x170681[_0xdaf4('0x157')]){this[_0xdaf4('0x150')](_0x170681,_0x170681[_0xdaf4('0x156')],_0x170681['dialstatus']);}};Preview['prototype']['syncHangupRequest']=function(_0xd0405){if(this['actions'][_0xd0405[_0xdaf4('0xb6')]]&&_0xd0405[_0xdaf4('0xb6')]!==_0xd0405[_0xdaf4('0xbf')]&&!this[_0xdaf4('0x14')][_0xd0405[_0xdaf4('0xb6')]]['dialAnswer']){if(_0xd0405[_0xdaf4('0x151')]==='1'){this[_0xdaf4('0x150')](_0xd0405,_0xd0405[_0xdaf4('0xb6')],_0xd0405[_0xdaf4('0x151')]);}}};Preview[_0xdaf4('0xe')][_0xdaf4('0x158')]=function(_0x33afaa,_0x536245,_0xe21eec){if(this['actions'][_0x33afaa]){if(_[_0xdaf4('0x6f')](this['actions'][_0x33afaa][_0xdaf4('0x159')])){this[_0xdaf4('0x14')][_0x33afaa]['variables']={};}this[_0xdaf4('0x14')][_0x33afaa][_0xdaf4('0x159')][_0x536245]=_0xe21eec;}};Preview[_0xdaf4('0xe')][_0xdaf4('0x1f')]=function(_0xfc838b){try{if(!_[_0xdaf4('0x6f')](_0xfc838b)){if(ut[_0xdaf4('0x15a')](_['keys'](_0xfc838b['variable'])[0x0])){this[_0xdaf4('0x158')](_0xfc838b[_0xdaf4('0xbf')],_[_0xdaf4('0x15b')](_0xfc838b['variable'])[0x0],_0xfc838b['value']);}}}catch(_0x130929){logger[_0xdaf4('0x15c')](_0xdaf4('0x15d'),util['inspect'](_0x130929,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x30265e){if(_0x30265e){if(this[_0xdaf4('0x14')][_0x30265e[_0xdaf4('0x15e')]]){this['actions'][_0x30265e[_0xdaf4('0x15e')]][_0xdaf4('0x155')]=!![];}}};Preview[_0xdaf4('0xe')]['syncBlindTransfer']=function(_0x2e6847){if(_0x2e6847){if(this[_0xdaf4('0x14')][_0x2e6847[_0xdaf4('0x15f')]]){this[_0xdaf4('0x14')][_0x2e6847[_0xdaf4('0x15f')]]['transfer']=!![];}}};module[_0xdaf4('0x160')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index d02d97d..a8b3c69 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 _0xa613=['../rpc/voiceQueueReport','error','catch','[createHistory]\x20','resolve','createHistory','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','../../../config/logger','preview','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview'];(function(_0x292360,_0x212e1c){var _0x4658d1=function(_0x456884){while(--_0x456884){_0x292360['push'](_0x292360['shift']());}};_0x4658d1(++_0x212e1c);}(_0xa613,0x132));var _0x3a61=function(_0xe7ba9,_0x2ff262){_0xe7ba9=_0xe7ba9-0x0;var _0x34e6bd=_0xa613[_0xe7ba9];return _0x34e6bd;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x3a61('0x0'))(_0x3a61('0x1'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x3a61('0x2'));var cmHopperHistory=require(_0x3a61('0x3'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x3a61('0x4'));var agentReportPreview=require(_0x3a61('0x5'));var voiceQueueReport=require(_0x3a61('0x6'));function loggerCatch(_0x3afad4){return function(_0x20a91b){logger[_0x3a61('0x7')](_0x3afad4,util['inspect'](_0x20a91b,{'showHidden':![],'depth':null}));};}function create(_0x2adc33){return BPromise['resolve']()['then'](cmHopperHistory['createHistory'](_0x2adc33))[_0x3a61('0x8')](loggerCatch(_0x3a61('0x9')));}function createAgent(_0x2daebb){return BPromise[_0x3a61('0xa')]()['then'](agentReportPreview[_0x3a61('0xb')](_0x2daebb))[_0x3a61('0x8')](loggerCatch(_0x3a61('0x9')));}function moveContact(_0x1d00ce){return BPromise[_0x3a61('0xa')]()[_0x3a61('0xc')](cmHopper[_0x3a61('0xd')](_0x1d00ce,!![]))[_0x3a61('0x8')](loggerCatch(_0x3a61('0xe')));}exports[_0x3a61('0xf')]=function(_0x50f83b){return BPromise[_0x3a61('0xa')]()[_0x3a61('0xc')](cmHopperBlack[_0x3a61('0xf')](_0x50f83b))[_0x3a61('0x8')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x3a61('0x10')]=function(_0x5539ff){return BPromise[_0x3a61('0xa')]()['then'](cmHopper[_0x3a61('0x10')](_0x5539ff))[_0x3a61('0x8')](loggerCatch(_0x3a61('0x11')));};exports[_0x3a61('0xb')]=function(_0x54cfca,_0x344aad){create(_0x54cfca)[_0x3a61('0x8')](loggerCatch(_0x344aad));moveContact(_0x54cfca)[_0x3a61('0x8')](loggerCatch(_0x344aad));};exports[_0x3a61('0x12')]=function(_0x570c8e,_0x398015){createAgent(_0x570c8e)[_0x3a61('0x8')](loggerCatch(_0x398015));};exports['createCustomerHistory']=function(_0x395b33,_0x10bd56){create(_0x395b33)['catch'](loggerCatch(_0x10bd56));};exports['createCustomerFinal']=function(_0x3e6c8a,_0x3bed02){moveContact(_0x3e6c8a)['catch'](loggerCatch(_0x3bed02));};exports[_0x3a61('0x13')]=function(_0x3bba4b,_0x428780,_0x535e1a){if(_0x428780){_0x3bba4b[_0x3a61('0x14')]=null;}if(_0x535e1a){_0x3bba4b[_0x3a61('0x15')]=![];}return BPromise['resolve']()[_0x3a61('0xc')](cmHopper['rescheduleContact'](_0x3bba4b))[_0x3a61('0x8')](loggerCatch(_0x3a61('0x16')));};exports[_0x3a61('0x17')]=function(_0x244000){return BPromise['resolve']()[_0x3a61('0xc')](cmHopper['countReScheduled'](_0x244000))[_0x3a61('0x8')](loggerCatch(_0x3a61('0x18')));};exports[_0x3a61('0x19')]=function(_0xdbe399){return BPromise['resolve']()[_0x3a61('0xc')](cmHopper[_0x3a61('0x19')]({'UserId':null},_0xdbe399,0x1))[_0x3a61('0x8')](loggerCatch(_0x3a61('0x1a')));};exports[_0x3a61('0x1b')]=function(_0x54d340){return BPromise[_0x3a61('0xa')]()[_0x3a61('0xc')](cmHopper[_0x3a61('0x19')]({'active':![]},_0x54d340,0x1))['catch'](loggerCatch(_0x3a61('0x1c')));};exports[_0x3a61('0x1d')]=function(_0x116c27){var _0x25e427={};_0x25e427['type']=_0x116c27[_0x3a61('0x1e')];_0x25e427[_0x3a61('0x1f')]=_0x116c27[_0x3a61('0x1f')];_0x25e427[_0x3a61('0x20')]=_0x116c27['calleridnum'];_0x25e427['calleridname']=_0x116c27['calleridname'];_0x25e427[_0x3a61('0x21')]=_0x116c27['queue'];_0x25e427['queuecallerjoinAt']=_0x116c27[_0x3a61('0x22')];_0x25e427[_0x3a61('0x23')]=_0x116c27[_0x3a61('0x22')];_0x25e427[_0x3a61('0x24')]=0x1;_0x25e427[_0x3a61('0x25')]=_0x116c27[_0x3a61('0x26')];_0x25e427[_0x3a61('0x27')]=_0x116c27[_0x3a61('0x28')];_0x25e427[_0x3a61('0x29')]=_0x3a61('0x2a');_0x25e427['exten']=_0x3a61('0x2b');_0x25e427[_0x3a61('0x2c')]=0x0;_0x25e427[_0x3a61('0x2d')]=0x1;_0x25e427[_0x3a61('0x2e')]=_0x116c27['membername'];_0x25e427['queuecallerexitreason']=_0x3a61('0x2f');return BPromise[_0x3a61('0xa')]()[_0x3a61('0xc')](voiceQueueReport[_0x3a61('0x30')](_0x25e427))[_0x3a61('0x8')](loggerCatch(_0x3a61('0x31')));};exports[_0x3a61('0x32')]=function(_0x58d521,_0x2ca9c0){return BPromise[_0x3a61('0xa')]()['then'](cmHopper[_0x3a61('0x32')](_0x58d521,_0x2ca9c0))[_0x3a61('0x8')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x2a53fc){return BPromise['resolve']()[_0x3a61('0xc')](cmHopper[_0x3a61('0x13')](_0x2a53fc,!![],!![]))[_0x3a61('0x8')](loggerCatch(_0x3a61('0x33')));}; \ No newline at end of file +var _0x1dc6=['[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','then','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','queuecallerexitreason','COMPLETED'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1dc6,0xaa));var _0x61dc=function(_0x236cd5,_0x36fde6){_0x236cd5=_0x236cd5-0x0;var _0x3876fd=_0x1dc6[_0x236cd5];return _0x3876fd;};'use strict';var util=require(_0x61dc('0x0'));var BPromise=require(_0x61dc('0x1'));var logger=require('../../../config/logger')(_0x61dc('0x2'));var _=require(_0x61dc('0x3'));var cmHopper=require(_0x61dc('0x4'));var cmHopperFinal=require(_0x61dc('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x61dc('0x6'));var voiceQueueReport=require(_0x61dc('0x7'));function loggerCatch(_0x4a81b7){return function(_0x557160){logger[_0x61dc('0x8')](_0x4a81b7,util[_0x61dc('0x9')](_0x557160,{'showHidden':![],'depth':null}));};}function create(_0xce537c){return BPromise['resolve']()['then'](cmHopperHistory[_0x61dc('0xa')](_0xce537c))[_0x61dc('0xb')](loggerCatch(_0x61dc('0xc')));}function createAgent(_0x12004f){return BPromise[_0x61dc('0xd')]()[_0x61dc('0xe')](agentReportPreview[_0x61dc('0xa')](_0x12004f))[_0x61dc('0xb')](loggerCatch(_0x61dc('0xc')));}function moveContact(_0x4f616c){return BPromise[_0x61dc('0xd')]()[_0x61dc('0xe')](cmHopper['moveContactManagedDialer'](_0x4f616c,!![]))[_0x61dc('0xb')](loggerCatch(_0x61dc('0xf')));}exports[_0x61dc('0x10')]=function(_0xcdb6bb){return BPromise[_0x61dc('0xd')]()[_0x61dc('0xe')](cmHopperBlack[_0x61dc('0x10')](_0xcdb6bb))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x11')));};exports['getContactPreview']=function(_0x35bc43){return BPromise[_0x61dc('0xd')]()['then'](cmHopper[_0x61dc('0x12')](_0x35bc43))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x13')));};exports[_0x61dc('0xa')]=function(_0x597d53,_0x4fc901){create(_0x597d53)[_0x61dc('0xb')](loggerCatch(_0x4fc901));moveContact(_0x597d53)[_0x61dc('0xb')](loggerCatch(_0x4fc901));};exports[_0x61dc('0x14')]=function(_0x33ca9c,_0x47b360){createAgent(_0x33ca9c)[_0x61dc('0xb')](loggerCatch(_0x47b360));};exports[_0x61dc('0x15')]=function(_0xc6bd16,_0x1f24cc){create(_0xc6bd16)[_0x61dc('0xb')](loggerCatch(_0x1f24cc));};exports['createCustomerFinal']=function(_0x2062d4,_0x2abd9f){moveContact(_0x2062d4)['catch'](loggerCatch(_0x2abd9f));};exports[_0x61dc('0x16')]=function(_0x15cd41,_0x481d47,_0x5b6d9c){if(_0x481d47){_0x15cd41[_0x61dc('0x17')]=null;}if(_0x5b6d9c){_0x15cd41[_0x61dc('0x18')]=![];}return BPromise[_0x61dc('0xd')]()[_0x61dc('0xe')](cmHopper['rescheduleContact'](_0x15cd41))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x19')));};exports[_0x61dc('0x1a')]=function(_0x359ada){return BPromise[_0x61dc('0xd')]()[_0x61dc('0xe')](cmHopper[_0x61dc('0x1a')](_0x359ada))['catch'](loggerCatch(_0x61dc('0x1b')));};exports[_0x61dc('0x1c')]=function(_0x2d31fc){return BPromise[_0x61dc('0xd')]()[_0x61dc('0xe')](cmHopper['unlockContact']({'UserId':null},_0x2d31fc,0x1))[_0x61dc('0xb')](loggerCatch('[unlockContact]\x20'));};exports[_0x61dc('0x1d')]=function(_0x3b8a4d){return BPromise[_0x61dc('0xd')]()[_0x61dc('0xe')](cmHopper['unlockContact']({'active':![]},_0x3b8a4d,0x1))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x1e')));};exports[_0x61dc('0x1f')]=function(_0x390858){var _0x5ecfcf={};_0x5ecfcf[_0x61dc('0x20')]=_0x390858[_0x61dc('0x20')];_0x5ecfcf[_0x61dc('0x21')]=_0x390858[_0x61dc('0x21')];_0x5ecfcf[_0x61dc('0x22')]=_0x390858['calleridnum'];_0x5ecfcf[_0x61dc('0x23')]=_0x390858[_0x61dc('0x23')];_0x5ecfcf['queue']=_0x390858[_0x61dc('0x24')];_0x5ecfcf[_0x61dc('0x25')]=_0x390858[_0x61dc('0x26')];_0x5ecfcf[_0x61dc('0x27')]=_0x390858[_0x61dc('0x26')];_0x5ecfcf[_0x61dc('0x28')]=0x1;_0x5ecfcf['queuecallercompleteAt']=_0x390858[_0x61dc('0x29')];_0x5ecfcf[_0x61dc('0x2a')]=_0x390858[_0x61dc('0x2b')];_0x5ecfcf[_0x61dc('0x2c')]=_0x61dc('0x2d');_0x5ecfcf[_0x61dc('0x2e')]='xcally-motion-preview';_0x5ecfcf[_0x61dc('0x2f')]=0x0;_0x5ecfcf['assigned']=0x1;_0x5ecfcf['lastAssignedTo']=_0x390858[_0x61dc('0x2b')];_0x5ecfcf[_0x61dc('0x30')]=_0x61dc('0x31');return BPromise[_0x61dc('0xd')]()[_0x61dc('0xe')](voiceQueueReport['create'](_0x5ecfcf))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x32')));};exports['getContactRecallMe']=function(_0x7f75a6,_0x52fb69){return BPromise[_0x61dc('0xd')]()[_0x61dc('0xe')](cmHopper[_0x61dc('0x33')](_0x7f75a6,_0x52fb69))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x34')));};exports[_0x61dc('0x35')]=function(_0x1fdd35){return BPromise[_0x61dc('0xd')]()[_0x61dc('0xe')](cmHopper['rescheduleContact'](_0x1fdd35,!![],!![]))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x36')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index c121d8b..845647d 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 _0xad35=['originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','state','logLookAgent','membername','UserId','logCustomer','ringtime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildObj','queue','agentReadyId','push','getDiff','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callback','callbackat','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','loggerCatch','inspect','logger','error','logger2','info','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE'];(function(_0x17eb63,_0x5721ea){var _0x30c683=function(_0xe16008){while(--_0xe16008){_0x17eb63['push'](_0x17eb63['shift']());}};_0x30c683(++_0x5721ea);}(_0xad35,0x6f));var _0x5ad3=function(_0x3dc541,_0x339b49){_0x3dc541=_0x3dc541-0x0;var _0x2f9ccc=_0xad35[_0x3dc541];return _0x2f9ccc;};'use strict';var util=require(_0x5ad3('0x0'));var _=require(_0x5ad3('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x5ad3('0x2')][_0x5ad3('0x3')]||_0x5ad3('0x4');function getSeconds(_0x4fda36,_0x4a1603){var _0x142042=moment(_0x4fda36)[_0x5ad3('0x5')](0x0);var _0x2376ee=moment(_0x4a1603)['milliseconds'](0x0);return _0x142042['diff'](_0x2376ee,'seconds');}exports[_0x5ad3('0x6')]=function(_0x3dc1cb){return function(_0x335e16){logger['error'](_0x3dc1cb,util[_0x5ad3('0x7')](_0x335e16,{'showHidden':![],'depth':null}));};};exports[_0x5ad3('0x8')]=function(_0x271158,_0x27b28b){logger['info'](_0x271158,util[_0x5ad3('0x7')](_0x27b28b,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x4c3e96,_0x19b8fd){logger[_0x5ad3('0x9')](_0x4c3e96,util[_0x5ad3('0x7')](_0x19b8fd,{'showHidden':![],'depth':null}));};exports[_0x5ad3('0xa')]=function(_0x96bdb){return function(_0x47d0e4){logger[_0x5ad3('0xb')](_0x96bdb,util[_0x5ad3('0x7')](_0x47d0e4,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x29d05b,_0x5f1cf3,_0x9c9e85){return{'message':_0x29d05b,'unlock':_0x5f1cf3,'active':_0x9c9e85};};exports[_0x5ad3('0xc')]=function(_0x49f19d,_0x505951,_0x14f85b){if(!_[_0x5ad3('0xd')](_0x14f85b)&&_0x5ad3('0xe')===typeof _0x14f85b&&!_[_0x5ad3('0xf')](_0x14f85b)){if(!_[_0x5ad3('0xd')](_0x505951)&&_0x5ad3('0xe')===typeof _0x505951&&!_['isEmpty'](_0x505951)){return util[_0x5ad3('0x10')](_0x5ad3('0x11'),_0x505951,_0x14f85b);}return util[_0x5ad3('0x10')](_0x5ad3('0x11'),_0x14f85b,_0x14f85b);}if(!_['isUndefined'](_0x49f19d)&&_0x5ad3('0xe')===typeof _0x49f19d&&!_[_0x5ad3('0xf')](_0x49f19d)){return _0x49f19d;}return _0x5ad3('0x12');};exports[_0x5ad3('0x13')]=function(_0x508c48){if(_['isNil'](_0x508c48)){return![];}return _0x508c48;};exports[_0x5ad3('0x14')]=function(_0x1c71eb,_0x4818e9,_0x33665d,_0xbadf08,_0x269c8f,_0x308b2e){var _0x3d5ca0={'XMD-QUEUE':_0x4818e9['Queue']?_0x4818e9[_0x5ad3('0x15')][_0x5ad3('0x16')]:'','XMD-CALLERID':_0xbadf08,'XMD-CALLERID-PREVIEW':_0x308b2e?util[_0x5ad3('0x10')](_0x5ad3('0x11'),_0x308b2e[_0x5ad3('0x17')],_0x308b2e[_0x5ad3('0x18')]):_0xbadf08,'XMD-DIALID':_0x269c8f,'XMD-CONTACTID':_0x4818e9[_0x5ad3('0x19')],'XMD-CDRTYPE':_0x5ad3('0x1a'),'CALLERID(all)':_0xbadf08,'XMD-VOICEQUEUEID':_0x4818e9[_0x5ad3('0x1b')],'XMD-DIALCHANNEL':_0x33665d,'XMD-DIALTIMEOUT':_0x1c71eb[_0x5ad3('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x5ad3('0x10')](_0x5ad3('0x1d'),_0x1c71eb[_0x5ad3('0x1e')]?'g':'',_[_0x5ad3('0xf')](_0x1c71eb[_0x5ad3('0x1f')])?'':_0x5ad3('0x20')),'XMD-DIALURL':_0x1c71eb[_0x5ad3('0x21')]||'','XMD-AGI':_0x1c71eb['dialQueueProject']?util[_0x5ad3('0x10')](_0x5ad3('0x22'),ipAgi,_0x1c71eb['dialQueueProject']):_0x5ad3('0x23'),'XMD-AGIAFTER':_0x1c71eb[_0x5ad3('0x1e')]?util[_0x5ad3('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1c71eb[_0x5ad3('0x1e')]):_0x5ad3('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x308b2e?_0x308b2e[_0x5ad3('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x308b2e?_0x308b2e[_0x5ad3('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x5ad3('0x26')};if(!_[_0x5ad3('0xf')](_0x1c71eb[_0x5ad3('0x1f')])){_0x3d5ca0[util[_0x5ad3('0x10')]('%s',_0x5ad3('0x27'))]=_0x1c71eb[_0x5ad3('0x1f')];_0x3d5ca0[util[_0x5ad3('0x10')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x269c8f;}if(_0x4818e9&&_0x4818e9['Contact']){for(var _0x1af94c in _0x4818e9[_0x5ad3('0x28')]){if(_0x4818e9[_0x5ad3('0x28')][_0x5ad3('0x29')](_0x1af94c)){if(!_[_0x5ad3('0x2a')](_0x4818e9[_0x5ad3('0x28')][_0x1af94c])&&_0x1af94c!=='id'&&_0x1af94c!==_0x5ad3('0x2b')&&_0x1af94c!==_0x5ad3('0x2c')&&_0x1af94c!==_0x5ad3('0x2d')){_0x3d5ca0[util['format'](_0x5ad3('0x2e'),'XMD-',_['toUpper'](_0x1af94c))]=_0x4818e9[_0x5ad3('0x28')][_0x1af94c];}}}}return _0x3d5ca0;};exports[_0x5ad3('0x2f')]=function(_0xc26960){var _0x27b6ea={};for(var _0x414b8c in _0xc26960){if(_0xc26960['hasOwnProperty'](_0x414b8c)){_0x27b6ea[util['format']('%s',_[_0x5ad3('0x30')](_0x414b8c))]=_0xc26960[_0x414b8c];}}return{'variables':_0x27b6ea};};exports[_0x5ad3('0x31')]=function(_0x38c2b6,_0x2ad368){if(!_[_0x5ad3('0x2a')](_0x38c2b6)){if(_0x38c2b6['hasOwnProperty'](_0x5ad3('0x32'))){if(_0x38c2b6['originated']>0x0){_0x38c2b6[_0x5ad3('0x32')]-=0x1;}else{logger[_0x5ad3('0x9')](_0x5ad3('0x33'),_0x2ad368);}}}else{logger[_0x5ad3('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x2ad368);}};exports[_0x5ad3('0x34')]=function(_0x102681){var _0x569fbd=moment()[_0x5ad3('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x102681['state']=0xd;_0x102681[_0x5ad3('0x35')]=_0x5ad3('0x36');_0x102681[_0x5ad3('0x37')]=_0x569fbd;_0x102681[_0x5ad3('0x38')]=_0x569fbd;_0x102681[_0x5ad3('0x39')]=_0x569fbd;};exports[_0x5ad3('0x3a')]=function(_0x1ab551,_0x48d836,_0x49b56c){var _0x449c9d=moment()[_0x5ad3('0x10')](_0x5ad3('0x3b'));_0x1ab551[_0x5ad3('0x3c')]=_0x48d836;_0x1ab551[_0x5ad3('0x35')]=_0x49b56c;_0x1ab551['responsetime']=_0x449c9d;_0x1ab551['ringtime']=getSeconds(_0x1ab551[_0x5ad3('0x38')],_0x1ab551[_0x5ad3('0x37')]);};exports[_0x5ad3('0x3d')]=function(_0x1cff23,_0x5c2677,_0x39a9d5){_0x1cff23[_0x5ad3('0x3e')]=_0x5c2677;_0x1cff23[_0x5ad3('0x3f')]=_0x39a9d5;};exports[_0x5ad3('0x40')]=function(_0x3bed3c,_0x2ce6ef,_0x28393e){var _0x78b528=moment()[_0x5ad3('0x10')](_0x5ad3('0x3b'));_0x3bed3c[_0x5ad3('0x3c')]=_0x2ce6ef;_0x3bed3c['statedesc']=_0x28393e;_0x3bed3c[_0x5ad3('0x38')]=_0x3bed3c[_0x5ad3('0x38')]?_0x3bed3c[_0x5ad3('0x38')]:_0x78b528;_0x3bed3c[_0x5ad3('0x39')]=_0x3bed3c['endtime']?_0x3bed3c[_0x5ad3('0x39')]:_0x78b528;_0x3bed3c[_0x5ad3('0x41')]=getSeconds(_0x3bed3c[_0x5ad3('0x38')]||0x0,_0x3bed3c['starttime']||0x0);_0x3bed3c['talktime']=_0x3bed3c[_0x5ad3('0x42')]?getSeconds(_0x3bed3c[_0x5ad3('0x39')],_0x3bed3c[_0x5ad3('0x42')]):0x0;};exports[_0x5ad3('0x43')]=function(_0x22c769){return _0x22c769===_0x5ad3('0x44');};exports[_0x5ad3('0x45')]=function(_0x1f172b,_0x29ca4e,_0x4f1d35,_0xe489ca,_0x5b031c){var _0xe6938c=_0xe489ca?_0x5ad3('0x46'):_0x1f172b[_0x5ad3('0x17')];_0xe6938c=_0x5b031c?_0x5ad3('0x47'):_0xe6938c;return{'actionid':_0x1f172b[_0x5ad3('0x48')],'action':_0x5ad3('0x49'),'channel':_0x1f172b[_0x5ad3('0x4a')],'callerid':util[_0x5ad3('0x10')](_0x5ad3('0x11'),_0xe6938c,_0x1f172b[_0x5ad3('0x18')]),'Exten':'xcally-motion-preview','Context':_0x5ad3('0x4b'),'Priority':'1','variable':_0x4f1d35,'timeout':(_0x29ca4e['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1f172b['uniqueid']};};exports['totalGlobal']=function(_0xd71932){return _0xd71932[_0x5ad3('0x4c')]+_0xd71932[_0x5ad3('0x4d')]+_0xd71932['countnoanswerretry']+_0xd71932[_0x5ad3('0x4e')]+_0xd71932[_0x5ad3('0x4f')];};exports[_0x5ad3('0x50')]=function(_0x51f988){var _0x3b3d9e=_['clone'](_0x51f988);_0x3b3d9e[_0x5ad3('0x3c')]=0xf;_0x3b3d9e[_0x5ad3('0x35')]=_0x5ad3('0x51');return _0x3b3d9e;};exports['scheduledAt']=function(_0x2d71f6,_0x24d745,_0x4c21b0){var _0x2475d4={};_0x2475d4[_0x24d745]=_0x2d71f6[_0x24d745];_0x2475d4[_0x5ad3('0x52')]=![];_0x2475d4[_0x5ad3('0x53')]=moment()[_0x5ad3('0x54')](_0x4c21b0,_0x5ad3('0x55'))['format'](_0x5ad3('0x3b'));_0x2475d4[_0x5ad3('0x19')]=_0x2d71f6[_0x5ad3('0x19')];_0x2475d4['ListId']=_0x2d71f6[_0x5ad3('0x56')];_0x2475d4[_0x5ad3('0x1b')]=_0x2d71f6[_0x5ad3('0x1b')]||undefined;return _0x2475d4;};exports[_0x5ad3('0x57')]=function(_0x414d44,_0x22e393){if(!_[_0x5ad3('0x2a')](_0x414d44)){if(_0x414d44[_0x5ad3('0x58')]>0x0){_0x414d44[_0x5ad3('0x58')]-=0x1;}else{logger[_0x5ad3('0x9')](_0x22e393,_0x5ad3('0x59'));}}else{logger[_0x5ad3('0x9')](_0x22e393,_0x5ad3('0x5a'));}};exports[_0x5ad3('0x5b')]=function(_0x427f61){if(_0x427f61<=0x0){return!![];}return![];};function buildObj(_0xcb8c0e,_0x464e56,_0x246349){_0xcb8c0e[_0x5ad3('0x5c')]=_0x464e56;_0xcb8c0e[_0x5ad3('0x16')]=_0xcb8c0e['queue'];_0xcb8c0e[_0x5ad3('0x5d')]=_0xcb8c0e['channelAgent'];_0xcb8c0e[_0x5ad3('0x5e')]=_0x5ad3('0x5f');if(_0x246349){_0xcb8c0e[_0x5ad3('0x60')]=_0x246349[_0x5ad3('0x60')];}return _0xcb8c0e;}exports[_0x5ad3('0x61')]=buildObj;exports['buildAcw']=function(_0x5b4d0b){var _0x3220aa={};_0x3220aa[_0x5ad3('0x62')]=_0x5b4d0b['queue'];_0x3220aa[_0x5ad3('0x5d')]=_0x5b4d0b[_0x5ad3('0x4a')];_0x3220aa[_0x5ad3('0x48')]=_0x5b4d0b[_0x5ad3('0x48')];return _0x3220aa;};exports[_0x5ad3('0x63')]=function(_0x5d158c){var _0x428d42=[];for(var _0x110a10 in _0x5d158c){if(_0x5d158c['hasOwnProperty'](_0x110a10)){if(!_['isNil'](_0x5d158c[_0x110a10])&&_0x5d158c[_0x110a10][_0x5ad3('0x3c')]==='not_inuse'&&_0x5d158c[_0x110a10]['status']==='reachable'){_0x428d42[_0x5ad3('0x64')](_0x5d158c[_0x110a10]['id']);}}}return _0x428d42;};exports[_0x5ad3('0x65')]=function(_0x1a1e77){var _0xebf844=moment()['milliseconds'](0x0);var _0x4d69a0=moment(_0x1a1e77)[_0x5ad3('0x5')](0x0);return _0xebf844[_0x5ad3('0x66')](_0x4d69a0,_0x5ad3('0x67'));};exports[_0x5ad3('0x68')]=function(_0x373ce3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x373ce3[_0x5ad3('0x19')],'ListId':_0x373ce3[_0x5ad3('0x56')],'VoiceQueueId':_0x373ce3[_0x5ad3('0x1b')]||undefined,'CampaignId':_0x373ce3[_0x5ad3('0x69')]||undefined};};exports[_0x5ad3('0x6a')]=function(_0x5e7cc6){if(_0x5e7cc6===_0x5ad3('0x48')||_0x5e7cc6===_0x5ad3('0x6b')||_0x5e7cc6===_0x5ad3('0x62')||_0x5e7cc6===_0x5ad3('0x6c')||_0x5e7cc6===_0x5ad3('0x6d')||_0x5e7cc6===_0x5ad3('0x6e')||_0x5e7cc6===_0x5ad3('0x3e')||_0x5e7cc6===_0x5ad3('0x4a')||_0x5e7cc6===_0x5ad3('0x17')||_0x5e7cc6==='active'||_0x5e7cc6===_0x5ad3('0x18')||_0x5e7cc6===_0x5ad3('0x53')||_0x5e7cc6===_0x5ad3('0x4c')||_0x5e7cc6===_0x5ad3('0x4d')||_0x5e7cc6===_0x5ad3('0x6f')||_0x5e7cc6===_0x5ad3('0x70')||_0x5e7cc6===_0x5ad3('0x71')||_0x5e7cc6==='callbackuniqueid'||_0x5e7cc6===_0x5ad3('0x72')||_0x5e7cc6==='recallme'||_0x5e7cc6==='ContactId'||_0x5e7cc6===_0x5ad3('0x56')||_0x5e7cc6===_0x5ad3('0x3f')||_0x5e7cc6==='VoiceQueueId'||_0x5e7cc6==='sipcallid'||_0x5e7cc6==='xmd-voicequeueid'||_0x5e7cc6===_0x5ad3('0x73')||_0x5e7cc6===_0x5ad3('0x74')||_0x5e7cc6===_0x5ad3('0x75')||_0x5e7cc6===_0x5ad3('0x76')||_0x5e7cc6===_0x5ad3('0x77')||_0x5e7cc6===_0x5ad3('0x78')||_0x5e7cc6===_0x5ad3('0x79')||_0x5e7cc6===_0x5ad3('0x7a')||_0x5e7cc6===_0x5ad3('0x7b')||_0x5e7cc6==='xmd-cdrtype'||_0x5e7cc6==='xmd-callerid'||_0x5e7cc6==='xmd-agiafter'||_0x5e7cc6===_0x5ad3('0x7c')||_0x5e7cc6===_0x5ad3('0x7d')||_0x5e7cc6===_0x5ad3('0x7e')||_0x5e7cc6===_0x5ad3('0x7f')||_0x5e7cc6===_0x5ad3('0x80')||_0x5e7cc6===_0x5ad3('0x81')||_0x5e7cc6===_0x5ad3('0x82')||_0x5e7cc6==='rtpaudioqosrtt'||_0x5e7cc6===_0x5ad3('0x83')||_0x5e7cc6===_0x5ad3('0x7d')||_0x5e7cc6===_0x5ad3('0x7e')||_0x5e7cc6==='rtpaudioqosjitter'||_0x5e7cc6===_0x5ad3('0x80')||_0x5e7cc6===_0x5ad3('0x81')||_0x5e7cc6==='rtpaudioqoslossbridged'||_0x5e7cc6===_0x5ad3('0x84')||_0x5e7cc6===_0x5ad3('0x83')||_0x5e7cc6===_0x5ad3('0x85')||_0x5e7cc6===_0x5ad3('0x86')||_0x5e7cc6==='state'||_0x5e7cc6===_0x5ad3('0x35')){return![];}return!![];};exports[_0x5ad3('0x87')]=function(_0x4e1c51,_0x526473){var _0x6d2e21,_0x317a0f,_0x4bf1c8;if(_0x526473<=0x0){_0x526473=0x1;}_0x6d2e21=new RegExp('\x5cw{0,'+_0x526473+'}$');_0x317a0f=Math['pow'](0xa,_0x526473-0x1);_0x4bf1c8=Math['pow'](0xa,_0x526473)-0x1;return util['format']('%s',_[_0x5ad3('0x88')](_0x4e1c51,_0x6d2e21,_[_0x5ad3('0x89')](_0x317a0f,_0x4bf1c8)));};exports[_0x5ad3('0x8a')]=function(_0x48cf17){var _0x5b35bc=_0x48cf17[_0x5ad3('0x8b')](/"(.*?)"/);return _0x5b35bc?_0x5b35bc[0x1]:_0x48cf17;};exports[_0x5ad3('0x8c')]=function(_0x3639d0){var _0x1580ff=_0x3639d0[_0x5ad3('0x8b')](/<(.*?)>/);return _0x1580ff?_0x1580ff[0x1]:_0x3639d0;};function buildNoAnswerEventPayload(_0x1b70dd,_0x474130){var _0x2d96d4=buildObj(_0x1b70dd,_0x5ad3('0x8d'));if(!_[_0x5ad3('0xf')](_0x474130[_0x5ad3('0x8e')])){Object[_0x5ad3('0x8f')](_0x474130[_0x5ad3('0x8e')])[_0x5ad3('0x90')](function(_0x56a0f9){_0x2d96d4[_0x56a0f9[_0x5ad3('0x91')]()]=_0x474130[_0x5ad3('0x8e')][_0x56a0f9];});}return _0x2d96d4;}exports[_0x5ad3('0x92')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x8c27=['countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','buildObj','buildAcw','agentReadyId','not_inuse','reachable','push','CampaignId','filterKey','idContact','type','campaigntype','active','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','extractCalleridNumber','match','noanswer','keys','forEach','toLowerCase','variables','buildNoAnswerEventPayload','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','error','inspect','info','loggerError','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','isActive','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','monitor_format','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','endtime','responsetime','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','timeout','totalGlobal'];(function(_0x1e0305,_0x26c848){var _0x57f37d=function(_0xd343e2){while(--_0xd343e2){_0x1e0305['push'](_0x1e0305['shift']());}};_0x57f37d(++_0x26c848);}(_0x8c27,0x170));var _0x78c2=function(_0x4cde9e,_0x57150a){_0x4cde9e=_0x4cde9e-0x0;var _0x38df0c=_0x8c27[_0x4cde9e];return _0x38df0c;};'use strict';var util=require(_0x78c2('0x0'));var _=require('lodash');var moment=require(_0x78c2('0x1'));var logger=require(_0x78c2('0x2'))(_0x78c2('0x3'));var ipAgi=process[_0x78c2('0x4')][_0x78c2('0x5')]||'127.0.0.1';function getSeconds(_0x44141f,_0x3a768f){var _0x453ce5=moment(_0x44141f)[_0x78c2('0x6')](0x0);var _0x1ddd6f=moment(_0x3a768f)[_0x78c2('0x6')](0x0);return _0x453ce5[_0x78c2('0x7')](_0x1ddd6f,_0x78c2('0x8'));}exports['loggerCatch']=function(_0x15b81c){return function(_0x16fffa){logger[_0x78c2('0x9')](_0x15b81c,util[_0x78c2('0xa')](_0x16fffa,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x325e06,_0xb322f1){logger[_0x78c2('0xb')](_0x325e06,util[_0x78c2('0xa')](_0xb322f1,{'showHidden':![],'depth':null}));};exports[_0x78c2('0xc')]=function(_0x157265,_0x24f9d6){logger[_0x78c2('0x9')](_0x157265,util['inspect'](_0x24f9d6,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x28fa21){return function(_0x5648c8){logger['info'](_0x28fa21,util[_0x78c2('0xa')](_0x5648c8,{'showHidden':![],'depth':null}));};};exports[_0x78c2('0xd')]=function(_0x54954d,_0x4af95b,_0x37603b){return{'message':_0x54954d,'unlock':_0x4af95b,'active':_0x37603b};};exports[_0x78c2('0xe')]=function(_0x344032,_0x583ad0,_0x59d474){if(!_['isUndefined'](_0x59d474)&&_0x78c2('0xf')===typeof _0x59d474&&!_[_0x78c2('0x10')](_0x59d474)){if(!_[_0x78c2('0x11')](_0x583ad0)&&_0x78c2('0xf')===typeof _0x583ad0&&!_[_0x78c2('0x10')](_0x583ad0)){return util[_0x78c2('0x12')]('\x22%s\x22\x20<%s>',_0x583ad0,_0x59d474);}return util[_0x78c2('0x12')](_0x78c2('0x13'),_0x59d474,_0x59d474);}if(!_['isUndefined'](_0x344032)&&'string'===typeof _0x344032&&!_[_0x78c2('0x10')](_0x344032)){return _0x344032;}return'\x22\x22\x20<>';};exports[_0x78c2('0x14')]=function(_0x1d45f4){if(_['isNil'](_0x1d45f4)){return![];}return _0x1d45f4;};exports['addVariables']=function(_0x6eac30,_0x5aa53f,_0x549650,_0x53b4ea,_0x1610a0,_0xf38b0){var _0x14cda8={'XMD-QUEUE':_0x5aa53f[_0x78c2('0x15')]?_0x5aa53f[_0x78c2('0x15')][_0x78c2('0x16')]:'','XMD-CALLERID':_0x53b4ea,'XMD-CALLERID-PREVIEW':_0xf38b0?util[_0x78c2('0x12')](_0x78c2('0x13'),_0xf38b0[_0x78c2('0x17')],_0xf38b0[_0x78c2('0x18')]):_0x53b4ea,'XMD-DIALID':_0x1610a0,'XMD-CONTACTID':_0x5aa53f[_0x78c2('0x19')],'XMD-CDRTYPE':_0x78c2('0x1a'),'CALLERID(all)':_0x53b4ea,'XMD-VOICEQUEUEID':_0x5aa53f[_0x78c2('0x1b')],'XMD-DIALCHANNEL':_0x549650,'XMD-DIALTIMEOUT':_0x6eac30[_0x78c2('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x78c2('0x12')](_0x78c2('0x1d'),_0x6eac30[_0x78c2('0x1e')]?'g':'',_[_0x78c2('0x10')](_0x6eac30['monitor_format'])?'':_0x78c2('0x1f')),'XMD-DIALURL':_0x6eac30[_0x78c2('0x20')]||'','XMD-AGI':_0x6eac30[_0x78c2('0x21')]?util['format'](_0x78c2('0x22'),ipAgi,_0x6eac30[_0x78c2('0x21')]):_0x78c2('0x23'),'XMD-AGIAFTER':_0x6eac30[_0x78c2('0x1e')]?util['format'](_0x78c2('0x22'),ipAgi,_0x6eac30[_0x78c2('0x1e')]):_0x78c2('0x23'),'XMD-ORIGINATECALLERIDNUM':_0xf38b0?_0xf38b0[_0x78c2('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0xf38b0?_0xf38b0[_0x78c2('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x78c2('0x26')};if(!_['isEmpty'](_0x6eac30['monitor_format'])){_0x14cda8[util[_0x78c2('0x12')]('%s',_0x78c2('0x27'))]=_0x6eac30[_0x78c2('0x28')];_0x14cda8[util[_0x78c2('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1610a0;}if(_0x5aa53f&&_0x5aa53f[_0x78c2('0x29')]){for(var _0x1ed8fe in _0x5aa53f[_0x78c2('0x29')]){if(_0x5aa53f[_0x78c2('0x29')][_0x78c2('0x2a')](_0x1ed8fe)){if(!_[_0x78c2('0x2b')](_0x5aa53f['Contact'][_0x1ed8fe])&&_0x1ed8fe!=='id'&&_0x1ed8fe!==_0x78c2('0x2c')&&_0x1ed8fe!==_0x78c2('0x2d')&&_0x1ed8fe!==_0x78c2('0x2e')){_0x14cda8[util[_0x78c2('0x12')](_0x78c2('0x2f'),'XMD-',_[_0x78c2('0x30')](_0x1ed8fe))]=_0x5aa53f['Contact'][_0x1ed8fe];}}}}return _0x14cda8;};exports[_0x78c2('0x31')]=function(_0x53200b){var _0x410a9a={};for(var _0x252ee9 in _0x53200b){if(_0x53200b[_0x78c2('0x2a')](_0x252ee9)){_0x410a9a[util[_0x78c2('0x12')]('%s',_[_0x78c2('0x32')](_0x252ee9))]=_0x53200b[_0x252ee9];}}return{'variables':_0x410a9a};};exports[_0x78c2('0x33')]=function(_0xe94506,_0x36355c){if(!_[_0x78c2('0x2b')](_0xe94506)){if(_0xe94506['hasOwnProperty']('originated')){if(_0xe94506[_0x78c2('0x34')]>0x0){_0xe94506[_0x78c2('0x34')]-=0x1;}else{logger[_0x78c2('0x9')](_0x78c2('0x35'),_0x36355c);}}}else{logger[_0x78c2('0x9')](_0x78c2('0x36'),_0x36355c);}};exports[_0x78c2('0x37')]=function(_0x257579){var _0x124585=moment()[_0x78c2('0x12')](_0x78c2('0x38'));_0x257579[_0x78c2('0x39')]=0xd;_0x257579[_0x78c2('0x3a')]='Blacklist';_0x257579[_0x78c2('0x3b')]=_0x124585;_0x257579['responsetime']=_0x124585;_0x257579[_0x78c2('0x3c')]=_0x124585;};exports['logAgent']=function(_0x3e03ab,_0x48049d,_0x1316cb){var _0x25b0db=moment()[_0x78c2('0x12')](_0x78c2('0x38'));_0x3e03ab[_0x78c2('0x39')]=_0x48049d;_0x3e03ab[_0x78c2('0x3a')]=_0x1316cb;_0x3e03ab[_0x78c2('0x3d')]=_0x25b0db;_0x3e03ab[_0x78c2('0x3e')]=getSeconds(_0x3e03ab[_0x78c2('0x3d')],_0x3e03ab[_0x78c2('0x3b')]);};exports[_0x78c2('0x3f')]=function(_0x5f35e3,_0x558b3a,_0x5e8daa){_0x5f35e3[_0x78c2('0x40')]=_0x558b3a;_0x5f35e3[_0x78c2('0x41')]=_0x5e8daa;};exports[_0x78c2('0x42')]=function(_0x46a531,_0x52050c,_0x3319a8){var _0x981af0=moment()['format'](_0x78c2('0x38'));_0x46a531[_0x78c2('0x39')]=_0x52050c;_0x46a531['statedesc']=_0x3319a8;_0x46a531[_0x78c2('0x3d')]=_0x46a531[_0x78c2('0x3d')]?_0x46a531[_0x78c2('0x3d')]:_0x981af0;_0x46a531[_0x78c2('0x3c')]=_0x46a531['endtime']?_0x46a531['endtime']:_0x981af0;_0x46a531[_0x78c2('0x3e')]=getSeconds(_0x46a531[_0x78c2('0x3d')]||0x0,_0x46a531['starttime']||0x0);_0x46a531[_0x78c2('0x43')]=_0x46a531['answertime']?getSeconds(_0x46a531[_0x78c2('0x3c')],_0x46a531[_0x78c2('0x44')]):0x0;};exports[_0x78c2('0x45')]=function(_0xf3cc7b){return _0xf3cc7b===_0x78c2('0x46');};exports[_0x78c2('0x47')]=function(_0x50ee75,_0xce06f9,_0x36ea7b,_0x5b8233,_0x13e5af){var _0x7623ab=_0x5b8233?'RECALL':_0x50ee75[_0x78c2('0x17')];_0x7623ab=_0x13e5af?_0x78c2('0x48'):_0x7623ab;return{'actionid':_0x50ee75[_0x78c2('0x49')],'action':_0x78c2('0x4a'),'channel':_0x50ee75[_0x78c2('0x4b')],'callerid':util[_0x78c2('0x12')]('\x22%s\x22\x20<%s>',_0x7623ab,_0x50ee75[_0x78c2('0x18')]),'Exten':_0x78c2('0x4c'),'Context':'from-sip','Priority':'1','variable':_0x36ea7b,'timeout':(_0xce06f9[_0x78c2('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x50ee75['uniqueid']};};exports[_0x78c2('0x4e')]=function(_0xe6da2e){return _0xe6da2e['countbusyretry']+_0xe6da2e[_0x78c2('0x4f')]+_0xe6da2e[_0x78c2('0x50')]+_0xe6da2e[_0x78c2('0x51')]+_0xe6da2e[_0x78c2('0x52')];};exports[_0x78c2('0x53')]=function(_0x194b1c){var _0x18bac9=_[_0x78c2('0x54')](_0x194b1c);_0x18bac9['state']=0xf;_0x18bac9[_0x78c2('0x3a')]=_0x78c2('0x55');return _0x18bac9;};exports[_0x78c2('0x56')]=function(_0x2aa47a,_0x2ba168,_0x514a5f){var _0x13f49f={};_0x13f49f[_0x2ba168]=_0x2aa47a[_0x2ba168];_0x13f49f['active']=![];_0x13f49f['scheduledat']=moment()[_0x78c2('0x57')](_0x514a5f,'minutes')[_0x78c2('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x13f49f['ContactId']=_0x2aa47a['ContactId'];_0x13f49f['ListId']=_0x2aa47a[_0x78c2('0x58')];_0x13f49f[_0x78c2('0x1b')]=_0x2aa47a['VoiceQueueId']||undefined;return _0x13f49f;};exports[_0x78c2('0x59')]=function(_0x34f8db,_0x498a4d){if(!_[_0x78c2('0x2b')](_0x34f8db)){if(_0x34f8db[_0x78c2('0x5a')]>0x0){_0x34f8db['pTalking']-=0x1;}else{logger[_0x78c2('0x9')](_0x498a4d,_0x78c2('0x5b'));}}else{logger[_0x78c2('0x9')](_0x498a4d,_0x78c2('0x5c'));}};exports[_0x78c2('0x5d')]=function(_0x1ce6a0){if(_0x1ce6a0<=0x0){return!![];}return![];};function buildObj(_0x2d134b,_0x36b74f,_0x194e70){_0x2d134b[_0x78c2('0x5e')]=_0x36b74f;_0x2d134b['name']=_0x2d134b[_0x78c2('0x5f')];_0x2d134b[_0x78c2('0x60')]=_0x2d134b[_0x78c2('0x4b')];_0x2d134b['motionChannel']='voice';if(_0x194e70){_0x2d134b['mandatoryDisposition']=_0x194e70['mandatoryDisposition'];}return _0x2d134b;}exports[_0x78c2('0x61')]=buildObj;exports[_0x78c2('0x62')]=function(_0x7011b4){var _0x3787f2={};_0x3787f2[_0x78c2('0x5f')]=_0x7011b4['queue'];_0x3787f2[_0x78c2('0x60')]=_0x7011b4[_0x78c2('0x4b')];_0x3787f2['uniqueid']=_0x7011b4[_0x78c2('0x49')];return _0x3787f2;};exports[_0x78c2('0x63')]=function(_0x4b0919){var _0x247a71=[];for(var _0x4f362c in _0x4b0919){if(_0x4b0919[_0x78c2('0x2a')](_0x4f362c)){if(!_[_0x78c2('0x2b')](_0x4b0919[_0x4f362c])&&_0x4b0919[_0x4f362c][_0x78c2('0x39')]===_0x78c2('0x64')&&_0x4b0919[_0x4f362c]['status']===_0x78c2('0x65')){_0x247a71[_0x78c2('0x66')](_0x4b0919[_0x4f362c]['id']);}}}return _0x247a71;};exports['getDiff']=function(_0x58edb4){var _0x195a5c=moment()[_0x78c2('0x6')](0x0);var _0x4874e5=moment(_0x58edb4)[_0x78c2('0x6')](0x0);return _0x195a5c[_0x78c2('0x7')](_0x4874e5,_0x78c2('0x8'));};exports['createBody']=function(_0x110f71){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x110f71[_0x78c2('0x19')],'ListId':_0x110f71[_0x78c2('0x58')],'VoiceQueueId':_0x110f71['VoiceQueueId']||undefined,'CampaignId':_0x110f71[_0x78c2('0x67')]||undefined};};exports[_0x78c2('0x68')]=function(_0x27045f){if(_0x27045f===_0x78c2('0x49')||_0x27045f===_0x78c2('0x69')||_0x27045f==='queue'||_0x27045f===_0x78c2('0x6a')||_0x27045f===_0x78c2('0x6b')||_0x27045f==='dialAnswer'||_0x27045f===_0x78c2('0x40')||_0x27045f===_0x78c2('0x4b')||_0x27045f==='calleridname'||_0x27045f===_0x78c2('0x6c')||_0x27045f===_0x78c2('0x18')||_0x27045f===_0x78c2('0x6d')||_0x27045f==='countbusyretry'||_0x27045f===_0x78c2('0x4f')||_0x27045f===_0x78c2('0x50')||_0x27045f===_0x78c2('0x6e')||_0x27045f===_0x78c2('0x6f')||_0x27045f===_0x78c2('0x70')||_0x27045f===_0x78c2('0x71')||_0x27045f===_0x78c2('0x72')||_0x27045f===_0x78c2('0x19')||_0x27045f===_0x78c2('0x58')||_0x27045f===_0x78c2('0x41')||_0x27045f===_0x78c2('0x1b')||_0x27045f===_0x78c2('0x73')||_0x27045f===_0x78c2('0x74')||_0x27045f==='xmd-queue'||_0x27045f===_0x78c2('0x75')||_0x27045f===_0x78c2('0x76')||_0x27045f===_0x78c2('0x77')||_0x27045f==='xmd-dialtimeout'||_0x27045f==='xmd-dialoptions'||_0x27045f===_0x78c2('0x78')||_0x27045f===_0x78c2('0x79')||_0x27045f===_0x78c2('0x7a')||_0x27045f===_0x78c2('0x7b')||_0x27045f===_0x78c2('0x7c')||_0x27045f===_0x78c2('0x7d')||_0x27045f===_0x78c2('0x7e')||_0x27045f===_0x78c2('0x7f')||_0x27045f===_0x78c2('0x80')||_0x27045f===_0x78c2('0x81')||_0x27045f==='rtpaudioqosjitterbridged'||_0x27045f===_0x78c2('0x82')||_0x27045f===_0x78c2('0x83')||_0x27045f===_0x78c2('0x84')||_0x27045f===_0x78c2('0x85')||_0x27045f===_0x78c2('0x7f')||_0x27045f===_0x78c2('0x80')||_0x27045f===_0x78c2('0x81')||_0x27045f===_0x78c2('0x86')||_0x27045f===_0x78c2('0x82')||_0x27045f===_0x78c2('0x83')||_0x27045f===_0x78c2('0x84')||_0x27045f===_0x78c2('0x85')||_0x27045f==='bridgepeer'||_0x27045f===_0x78c2('0x87')||_0x27045f===_0x78c2('0x39')||_0x27045f===_0x78c2('0x3a')){return![];}return!![];};exports[_0x78c2('0x88')]=function(_0x437b3e,_0x244f34){var _0x156727,_0x22631d,_0x3169c6;if(_0x244f34<=0x0){_0x244f34=0x1;}_0x156727=new RegExp(_0x78c2('0x89')+_0x244f34+'}$');_0x22631d=Math[_0x78c2('0x8a')](0xa,_0x244f34-0x1);_0x3169c6=Math[_0x78c2('0x8a')](0xa,_0x244f34)-0x1;return util[_0x78c2('0x12')]('%s',_['replace'](_0x437b3e,_0x156727,_[_0x78c2('0x8b')](_0x22631d,_0x3169c6)));};exports[_0x78c2('0x8c')]=function(_0x5b16dc){var _0x110d98=_0x5b16dc['match'](/"(.*?)"/);return _0x110d98?_0x110d98[0x1]:_0x5b16dc;};exports[_0x78c2('0x8d')]=function(_0x3e63be){var _0x159fba=_0x3e63be[_0x78c2('0x8e')](/<(.*?)>/);return _0x159fba?_0x159fba[0x1]:_0x3e63be;};function buildNoAnswerEventPayload(_0x292f18,_0x48b111){var _0x198842=buildObj(_0x292f18,_0x78c2('0x8f'));if(!_[_0x78c2('0x10')](_0x48b111['variables'])){Object[_0x78c2('0x90')](_0x48b111['variables'])[_0x78c2('0x91')](function(_0x10537d){_0x198842[_0x10537d[_0x78c2('0x92')]()]=_0x48b111[_0x78c2('0x93')][_0x10537d];});}return _0x198842;}exports[_0x78c2('0x94')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 5cb894c..96f2339 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 _0x8946=['voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload'];(function(_0x29895f,_0x35b245){var _0xca1dad=function(_0x321448){while(--_0x321448){_0x29895f['push'](_0x29895f['shift']());}};_0xca1dad(++_0x35b245);}(_0x8946,0x107));var _0x6894=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x8946[_0x39e84d];return _0x1991bc;};'use strict';exports[_0x6894('0x0')]={'queue':{'type':_0x6894('0x1'),'required':!![]},'interface':{'type':_0x6894('0x1'),'required':!![]},'membername':{'type':_0x6894('0x1'),'required':!![]},'penalty':{'type':_0x6894('0x2'),'required':![]},'paused':{'type':_0x6894('0x3'),'required':![]}};exports[_0x6894('0x4')]={'queue':{'type':_0x6894('0x1'),'required':!![]},'interface':{'type':_0x6894('0x1'),'required':!![]}};exports[_0x6894('0x5')]={'interface':{'type':_0x6894('0x1'),'required':!![]},'paused':{'type':_0x6894('0x3')},'reason':{'type':'string','required':![]}};exports[_0x6894('0x6')]={'module':{'type':_0x6894('0x1'),'required':![]}};exports[_0x6894('0x7')]={'uniqueid':{'type':_0x6894('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x6894('0x1'),'required':!![]},'filename':{'type':_0x6894('0x1')},'format':{'type':_0x6894('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x6894('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x6894('0x9')]={'uniqueid':{'type':_0x6894('0x1'),'required':!![]},'exten':{'type':_0x6894('0x1'),'required':!![]},'context':{'type':_0x6894('0x1')}}; \ No newline at end of file +var _0x0329=['voicequeuechannelhangup','queueadd','string','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x7abd7,_0x1ca3f9){var _0x3a2577=function(_0x18456d){while(--_0x18456d){_0x7abd7['push'](_0x7abd7['shift']());}};_0x3a2577(++_0x1ca3f9);}(_0x0329,0x160));var _0x9032=function(_0x420c44,_0x11af5b){_0x420c44=_0x420c44-0x0;var _0x138afb=_0x0329[_0x420c44];return _0x138afb;};'use strict';exports[_0x9032('0x0')]={'queue':{'type':_0x9032('0x1'),'required':!![]},'interface':{'type':_0x9032('0x1'),'required':!![]},'membername':{'type':_0x9032('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x9032('0x2'),'required':![]}};exports[_0x9032('0x3')]={'queue':{'type':_0x9032('0x1'),'required':!![]},'interface':{'type':_0x9032('0x1'),'required':!![]}};exports[_0x9032('0x4')]={'interface':{'type':_0x9032('0x1'),'required':!![]},'paused':{'type':_0x9032('0x2')},'reason':{'type':_0x9032('0x1'),'required':![]}};exports[_0x9032('0x5')]={'module':{'type':_0x9032('0x1'),'required':![]}};exports[_0x9032('0x6')]={'uniqueid':{'type':_0x9032('0x1'),'required':!![]}};exports[_0x9032('0x7')]={'uniqueid':{'type':_0x9032('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0x9032('0x1')}};exports[_0x9032('0x8')]={'uniqueid':{'type':_0x9032('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x9032('0x1'),'required':!![]},'exten':{'type':_0x9032('0x1'),'required':!![]},'context':{'type':_0x9032('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 741d63a..2fa1696 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 _0x6075=['sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isUndefined','initTelephones','telephones','initTrunks','mergeFromDatabase','initVoiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initFaxAccounts','exports','util','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','name','hasOwnProperty','isNil','interface','SIP/%s','total','answered'];(function(_0x491ded,_0x17abba){var _0x4ea2c9=function(_0x4013d3){while(--_0x4013d3){_0x491ded['push'](_0x491ded['shift']());}};_0x4ea2c9(++_0x17abba);}(_0x6075,0x126));var _0x5607=function(_0x36c34c,_0x1674df){_0x36c34c=_0x36c34c-0x0;var _0x5a8094=_0x6075[_0x36c34c];return _0x5a8094;};'use strict';var util=require(_0x5607('0x0'));var _=require('lodash');var moment=require(_0x5607('0x1'));var Agent=require(_0x5607('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x5607('0x3'));var VoiceQueue=require(_0x5607('0x4'));var Trigger=require(_0x5607('0x5'));var Template=require(_0x5607('0x6'));var Campaign=require(_0x5607('0x7'));var VoiceExtension=require(_0x5607('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x5607('0x9'));var FreshdeskAccount=require(_0x5607('0xa'));var SugarcrmAccount=require(_0x5607('0xb'));var ZohoAccount=require(_0x5607('0xc'));var DeskAccount=require(_0x5607('0xd'));var VtigerAccount=require(_0x5607('0xe'));var ServicenowAccount=require(_0x5607('0xf'));var Dynamics365Account=require(_0x5607('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x5607('0x11'));var Realtime=function(){this[_0x5607('0x12')]={};this['telephones']={};this[_0x5607('0x13')]={};this[_0x5607('0x14')]={};this['triggers']={};this[_0x5607('0x15')]={};this[_0x5607('0x16')]={};this[_0x5607('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x5607('0x18')]={};this[_0x5607('0x19')]={};this[_0x5607('0x1a')]={};this[_0x5607('0x1b')]={};this[_0x5607('0x1c')]={};this[_0x5607('0x1d')]={};this[_0x5607('0x1e')]={};this[_0x5607('0x1f')]={};this[_0x5607('0x20')]={};this[_0x5607('0x21')]={};this['zohoAccounts']={};this[_0x5607('0x22')]={};this['vtigerAccounts']={};this[_0x5607('0x23')]={};this[_0x5607('0x24')]={};this[_0x5607('0x25')]={};this[_0x5607('0x26')]={};};function freeIsNotKey(_0x8573c,_0x5270c2,_0x18f822){var _0x1ce81a=_[_0x5607('0x27')](_0x8573c,function(_0x3c73f2,_0x56a788){return _0x3c73f2[_0x18f822];});for(var _0x2bf04b in _0x5270c2){if(_0x5270c2['hasOwnProperty'](_0x2bf04b)){if(!_0x1ce81a[_0x2bf04b]){delete _0x5270c2[_0x2bf04b];}}}}function freeIsNotKeySip(_0x4d9218,_0x53aa3f){var _0x4abe19=_[_0x5607('0x27')](_0x4d9218,function(_0x14862a,_0x596fab){return util[_0x5607('0x28')]('SIP/%s',_0x14862a[_0x5607('0x29')]);});for(var _0x259e32 in _0x53aa3f){if(_0x53aa3f[_0x5607('0x2a')](_0x259e32)){if(!_0x4abe19[_0x259e32]){delete _0x53aa3f[_0x259e32];}}}}function freeIsNotKeyAgent(_0x52a4a1,_0xd136ca){var _0x1eee50=_[_0x5607('0x27')](_0x52a4a1,function(_0x59367e,_0x1b87a3){var _0x62819b=_[_0x5607('0x2b')](_0x59367e[_0x5607('0x2c')])?util[_0x5607('0x28')](_0x5607('0x2d'),_0x59367e['name']):_0x59367e[_0x5607('0x2c')];return _0x62819b;});for(var _0x3f6198 in _0xd136ca){if(_0xd136ca[_0x5607('0x2a')](_0x3f6198)){if(!_0x1eee50[_0x3f6198]){delete _0xd136ca[_0x3f6198];}}}}function clearVoiceCallReports(_0x5a7d01){_0x5a7d01[_0x5607('0x2e')]=0x0;_0x5a7d01[_0x5607('0x2f')]=0x0;_0x5a7d01[_0x5607('0x30')]=0x0;_0x5a7d01[_0x5607('0x31')]=0x0;_0x5a7d01[_0x5607('0x32')]=0x0;}function clearCampaigns(_0x46b787){if(!_[_0x5607('0x33')](_0x46b787)){for(var _0x4ff19d in _0x46b787){if(_0x46b787[_0x5607('0x2a')](_0x4ff19d)){_0x46b787[_0x4ff19d][_0x5607('0x34')]=0x0;_0x46b787[_0x4ff19d][_0x5607('0x35')]=0x0;}}}}function clearVoiceQueues(_0x38c0ad){if(!_[_0x5607('0x33')](_0x38c0ad)){for(var _0x1250b3 in _0x38c0ad){if(_0x38c0ad[_0x5607('0x2a')](_0x1250b3)){_0x38c0ad[_0x1250b3][_0x5607('0x2e')]=0x0;_0x38c0ad[_0x1250b3]['answered']=0x0;_0x38c0ad[_0x1250b3]['unmanaged']=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x36')]=0x0;_0x38c0ad[_0x1250b3]['sumHoldTime']=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x31')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x32')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x37')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x38')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x39')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x3a')]=0x0;_0x38c0ad[_0x1250b3]['outboundNoSuchCallsDay']=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x3b')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x3c')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x3d')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x3e')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x3f')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x40')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x41')]=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x37')]=0x0;_0x38c0ad[_0x1250b3]['outboundAnswerCallsDay']=0x0;_0x38c0ad[_0x1250b3][_0x5607('0x42')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x3ac7b7,_0x3e1dd2){for(var _0x3aca10 in _0x3e1dd2){if(_0x3ac7b7[_0x5607('0x2a')](_0x3aca10)){_0x3ac7b7[_0x3aca10]=_0x3e1dd2[_0x3aca10];}}};Realtime[_0x5607('0x43')]['initAgents']=function(){var _0x248506=this;return function(_0x1a50fd){if(_0x1a50fd){freeIsNotKeyAgent(_0x1a50fd,_0x248506[_0x5607('0x12')]);for(var _0x418e4d=0x0,_0x83469={},_0x5dcbfd={};_0x418e4d<_0x1a50fd[_0x5607('0x44')];_0x418e4d+=0x1){_0x83469=_0x1a50fd[_0x418e4d];var _0x443a4d=_[_0x5607('0x2b')](_0x83469[_0x5607('0x2c')])?util[_0x5607('0x28')](_0x5607('0x2d'),_0x83469['name']):_0x83469[_0x5607('0x2c')];if(_[_0x5607('0x45')](_0x248506[_0x5607('0x12')][_0x443a4d])){_0x248506[_0x5607('0x12')][_0x443a4d]=new Agent(_0x83469);}else{_0x248506['mergeFromDatabase'](_0x248506[_0x5607('0x12')][_0x443a4d],_0x83469);}}}return _0x248506[_0x5607('0x12')];};};Realtime['prototype'][_0x5607('0x46')]=function(){var _0x28e016=this;return function(_0x3d89d4){if(_0x3d89d4){freeIsNotKeySip(_0x3d89d4,_0x28e016[_0x5607('0x47')]);for(var _0x120d31=0x0,_0x11a5bb={},_0x449c8e={};_0x120d31<_0x3d89d4[_0x5607('0x44')];_0x120d31+=0x1){_0x11a5bb=_0x3d89d4[_0x120d31];if(_[_0x5607('0x45')](_0x28e016[_0x5607('0x47')][util[_0x5607('0x28')]('SIP/%s',_0x11a5bb[_0x5607('0x29')])])){_0x28e016[_0x5607('0x47')][util[_0x5607('0x28')](_0x5607('0x2d'),_0x11a5bb['name'])]=new Telephone(_0x11a5bb);}else{_0x28e016['mergeFromDatabase'](_0x28e016[_0x5607('0x47')][util['format']('SIP/%s',_0x11a5bb[_0x5607('0x29')])],_0x11a5bb);}}}return _0x28e016[_0x5607('0x47')];};};Realtime[_0x5607('0x43')][_0x5607('0x48')]=function(){var _0xbca60a=this;return function(_0x386143){if(_0x386143){freeIsNotKeySip(_0x386143,_0xbca60a[_0x5607('0x13')]);for(var _0x2662cf=0x0,_0x3f7d9b={},_0x1ceb81={};_0x2662cf<_0x386143[_0x5607('0x44')];_0x2662cf+=0x1){_0x3f7d9b=_0x386143[_0x2662cf];if(_[_0x5607('0x45')](_0xbca60a['trunks'][util[_0x5607('0x28')](_0x5607('0x2d'),_0x3f7d9b[_0x5607('0x29')])])){_0xbca60a['trunks'][util['format']('SIP/%s',_0x3f7d9b[_0x5607('0x29')])]=new Trunk(_0x3f7d9b);}else{_0xbca60a[_0x5607('0x49')](_0xbca60a[_0x5607('0x13')][util[_0x5607('0x28')]('SIP/%s',_0x3f7d9b[_0x5607('0x29')])],_0x3f7d9b);}}}return _0xbca60a['trunks'];};};Realtime['prototype'][_0x5607('0x4a')]=function(){var _0xc4c165=this;return function(_0x582205){if(_0x582205){freeIsNotKey(_0x582205,_0xc4c165['voiceQueues'],'name');for(var _0x127c60=0x0,_0x139417={},_0x52e922={};_0x127c60<_0x582205[_0x5607('0x44')];_0x127c60+=0x1){_0x139417=_0x582205[_0x127c60];if(_[_0x5607('0x45')](_0xc4c165[_0x5607('0x14')][_0x139417[_0x5607('0x29')]])){_0xc4c165[_0x5607('0x14')][_0x139417[_0x5607('0x29')]]=new VoiceQueue(_0x139417);}else{_0xc4c165['mergeFromDatabase'](_0xc4c165[_0x5607('0x14')][_0x139417[_0x5607('0x29')]],_0x139417);}}}return _0xc4c165[_0x5607('0x14')];};};Realtime[_0x5607('0x43')][_0x5607('0x4b')]=function(){var _0x46e4fe=this;return function(_0x47fa9f){if(_0x47fa9f){freeIsNotKey(_0x47fa9f,_0x46e4fe[_0x5607('0x4c')],'id');for(var _0x4ebe30=0x0,_0x1db018={},_0x132665={};_0x4ebe30<_0x47fa9f[_0x5607('0x44')];_0x4ebe30+=0x1){_0x1db018=_0x47fa9f[_0x4ebe30];if(_[_0x5607('0x45')](_0x46e4fe[_0x5607('0x4c')][_0x1db018['id']])){_0x46e4fe[_0x5607('0x4c')][_0x1db018['id']]=new Trigger(_0x1db018);}else{_0x46e4fe[_0x5607('0x49')](_0x46e4fe['triggers'][_0x1db018['id']],_0x1db018);}}}return _0x46e4fe[_0x5607('0x4c')];};};Realtime['prototype'][_0x5607('0x4d')]=function(){var _0x115c59=this;return function(_0x4447ef){if(_0x4447ef){freeIsNotKey(_0x4447ef,_0x115c59[_0x5607('0x16')],'id');for(var _0x24ac35=0x0,_0x24cc36={},_0x5f005e={};_0x24ac35<_0x4447ef[_0x5607('0x44')];_0x24ac35+=0x1){_0x24cc36=_0x4447ef[_0x24ac35];if(_['isUndefined'](_0x115c59[_0x5607('0x16')][_0x24cc36['id']])){_0x115c59[_0x5607('0x16')][_0x24cc36['id']]=new Template(_0x24cc36);}else{_0x115c59[_0x5607('0x49')](_0x115c59[_0x5607('0x16')][_0x24cc36['id']],_0x24cc36);}}}return _0x115c59[_0x5607('0x16')];};};Realtime[_0x5607('0x43')][_0x5607('0x4e')]=function(){var _0xff1b80=this;return function(_0x3837f7){if(_0x3837f7){freeIsNotKey(_0x3837f7,_0xff1b80[_0x5607('0x1e')],'id');for(var _0x286e60=0x0,_0x526cc8={},_0x209d21={};_0x286e60<_0x3837f7[_0x5607('0x44')];_0x286e60+=0x1){_0x526cc8=_0x3837f7[_0x286e60];if(_[_0x5607('0x45')](_0xff1b80['zendeskAccounts'][_0x526cc8['id']])){_0xff1b80[_0x5607('0x1e')][_0x526cc8['id']]=new ZendeskAccount(_0x526cc8);}else{_0xff1b80['mergeFromDatabase'](_0xff1b80[_0x5607('0x1e')][_0x526cc8['id']],_0x526cc8);}}}return _0xff1b80[_0x5607('0x1e')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x1c3b4f=this;return function(_0x64874f){if(_0x64874f){freeIsNotKey(_0x64874f,_0x1c3b4f[_0x5607('0x1f')],'id');for(var _0x26139a=0x0,_0x112028={},_0xd6498d={};_0x26139a<_0x64874f[_0x5607('0x44')];_0x26139a+=0x1){_0x112028=_0x64874f[_0x26139a];if(_[_0x5607('0x45')](_0x1c3b4f[_0x5607('0x1f')][_0x112028['id']])){_0x1c3b4f[_0x5607('0x1f')][_0x112028['id']]=new SalesforceAccount(_0x112028);}else{_0x1c3b4f[_0x5607('0x49')](_0x1c3b4f[_0x5607('0x1f')][_0x112028['id']],_0x112028);}}}return _0x1c3b4f[_0x5607('0x1f')];};};Realtime['prototype'][_0x5607('0x4f')]=function(){var _0x3cd2a9=this;return function(_0x1dc11d){if(_0x1dc11d){freeIsNotKey(_0x1dc11d,_0x3cd2a9[_0x5607('0x21')],'id');for(var _0x13d9c4=0x0,_0x341d67={},_0x47086a={};_0x13d9c4<_0x1dc11d[_0x5607('0x44')];_0x13d9c4+=0x1){_0x341d67=_0x1dc11d[_0x13d9c4];if(_['isUndefined'](_0x3cd2a9['freshdeskAccounts'][_0x341d67['id']])){_0x3cd2a9[_0x5607('0x21')][_0x341d67['id']]=new FreshdeskAccount(_0x341d67);}else{_0x3cd2a9['mergeFromDatabase'](_0x3cd2a9[_0x5607('0x21')][_0x341d67['id']],_0x341d67);}}}return _0x3cd2a9[_0x5607('0x21')];};};Realtime[_0x5607('0x43')][_0x5607('0x50')]=function(){var _0x5a85b2=this;return function(_0x5dadc5){if(_0x5dadc5){freeIsNotKey(_0x5dadc5,_0x5a85b2[_0x5607('0x51')],'id');for(var _0x4930a3=0x0,_0x131cc8={},_0x125ad6={};_0x4930a3<_0x5dadc5['length'];_0x4930a3+=0x1){_0x131cc8=_0x5dadc5[_0x4930a3];if(_[_0x5607('0x45')](_0x5a85b2['zohoAccounts'][_0x131cc8['id']])){_0x5a85b2[_0x5607('0x51')][_0x131cc8['id']]=new ZohoAccount(_0x131cc8);}else{_0x5a85b2[_0x5607('0x49')](_0x5a85b2['zohoAccounts'][_0x131cc8['id']],_0x131cc8);}}}return _0x5a85b2[_0x5607('0x51')];};};Realtime['prototype'][_0x5607('0x52')]=function(){var _0x43e1a2=this;return function(_0xe7f9a6){if(_0xe7f9a6){freeIsNotKey(_0xe7f9a6,_0x43e1a2[_0x5607('0x22')],'id');for(var _0xee905c=0x0,_0x490e48={},_0x4a9130={};_0xee905c<_0xe7f9a6[_0x5607('0x44')];_0xee905c+=0x1){_0x490e48=_0xe7f9a6[_0xee905c];if(_[_0x5607('0x45')](_0x43e1a2[_0x5607('0x22')][_0x490e48['id']])){_0x43e1a2[_0x5607('0x22')][_0x490e48['id']]=new DeskAccount(_0x490e48);}else{_0x43e1a2[_0x5607('0x49')](_0x43e1a2['deskAccounts'][_0x490e48['id']],_0x490e48);}}}return _0x43e1a2[_0x5607('0x22')];};};Realtime['prototype'][_0x5607('0x53')]=function(){var _0x26b0b7=this;return function(_0x267365){if(_0x267365){freeIsNotKey(_0x267365,_0x26b0b7['sugarcrmAccounts'],'id');for(var _0x5f25d4=0x0,_0x3f5e73={},_0xe3e3c9={};_0x5f25d4<_0x267365[_0x5607('0x44')];_0x5f25d4+=0x1){_0x3f5e73=_0x267365[_0x5f25d4];if(_[_0x5607('0x45')](_0x26b0b7[_0x5607('0x20')][_0x3f5e73['id']])){_0x26b0b7[_0x5607('0x20')][_0x3f5e73['id']]=new SugarcrmAccount(_0x3f5e73);}else{_0x26b0b7['mergeFromDatabase'](_0x26b0b7[_0x5607('0x20')][_0x3f5e73['id']],_0x3f5e73);}}}return _0x26b0b7[_0x5607('0x20')];};};Realtime['prototype'][_0x5607('0x54')]=function(){var _0x5f247e=this;return function(_0x3631d2){if(_0x3631d2){freeIsNotKey(_0x3631d2,_0x5f247e[_0x5607('0x55')],'id');for(var _0xd2f456=0x0,_0x1e497c={},_0x68b888={};_0xd2f456<_0x3631d2[_0x5607('0x44')];_0xd2f456+=0x1){_0x1e497c=_0x3631d2[_0xd2f456];if(_[_0x5607('0x45')](_0x5f247e[_0x5607('0x55')][_0x1e497c['id']])){_0x5f247e['vtigerAccounts'][_0x1e497c['id']]=new VtigerAccount(_0x1e497c);}else{_0x5f247e[_0x5607('0x49')](_0x5f247e['vtigerAccounts'][_0x1e497c['id']],_0x1e497c);}}}return _0x5f247e['vtigerAccounts'];};};Realtime[_0x5607('0x43')][_0x5607('0x56')]=function(){var _0x374544=this;return function(_0x221f28){if(_0x221f28){freeIsNotKey(_0x221f28,_0x374544[_0x5607('0x23')],'id');for(var _0x729ff6=0x0,_0x2533ee={},_0x4d52dd={};_0x729ff6<_0x221f28[_0x5607('0x44')];_0x729ff6+=0x1){_0x2533ee=_0x221f28[_0x729ff6];if(_[_0x5607('0x45')](_0x374544['servicenowAccounts'][_0x2533ee['id']])){_0x374544['servicenowAccounts'][_0x2533ee['id']]=new ServicenowAccount(_0x2533ee);}else{_0x374544[_0x5607('0x49')](_0x374544[_0x5607('0x23')][_0x2533ee['id']],_0x2533ee);}}}return _0x374544[_0x5607('0x23')];};};Realtime[_0x5607('0x43')][_0x5607('0x57')]=function(){var _0x3446e8=this;return function(_0x5beac6){if(_0x5beac6){freeIsNotKey(_0x5beac6,_0x3446e8[_0x5607('0x24')],'id');for(var _0x2cdaed=0x0,_0x14cc33={},_0x4f5ce3={};_0x2cdaed<_0x5beac6[_0x5607('0x44')];_0x2cdaed+=0x1){_0x14cc33=_0x5beac6[_0x2cdaed];if(_[_0x5607('0x45')](_0x3446e8[_0x5607('0x24')][_0x14cc33['id']])){_0x3446e8['dynamics365Accounts'][_0x14cc33['id']]=new Dynamics365Account(_0x14cc33);}else{_0x3446e8[_0x5607('0x49')](_0x3446e8[_0x5607('0x24')][_0x14cc33['id']],_0x14cc33);}}}return _0x3446e8[_0x5607('0x24')];};};Realtime[_0x5607('0x43')][_0x5607('0x58')]=function(){var _0x3cc874=this;return function(_0x3b2b86){if(_0x3b2b86){freeIsNotKey(_0x3b2b86,_0x3cc874[_0x5607('0x25')],'id');for(var _0x27cb4d=0x0,_0x3ec884={},_0x5a90c3={};_0x27cb4d<_0x3b2b86[_0x5607('0x44')];_0x27cb4d+=0x1){_0x3ec884=_0x3b2b86[_0x27cb4d];if(_[_0x5607('0x45')](_0x3cc874[_0x5607('0x25')][_0x3ec884['id']])){_0x3cc874['freshsalesAccounts'][_0x3ec884['id']]=new FreshsalesAccount(_0x3ec884);}else{_0x3cc874[_0x5607('0x49')](_0x3cc874['freshsalesAccounts'][_0x3ec884['id']],_0x3ec884);}}}return _0x3cc874[_0x5607('0x25')];};};Realtime[_0x5607('0x43')][_0x5607('0x59')]=function(){var _0x5e9cda=this;return function(_0x3a8b8f){for(var _0x5525a4=0x0;_0x5525a4<_0x3a8b8f[_0x5607('0x44')];_0x5525a4+=0x1){_[_0x5607('0x5a')](_0x5e9cda['voiceQueues'][_0x3a8b8f[_0x5525a4]['name']],_0x3a8b8f[_0x5525a4]);}return _0x5e9cda['voiceQueues'];};};Realtime[_0x5607('0x43')][_0x5607('0x5b')]=function(){var _0x484978=this;return function(_0xc8328a){clearVoiceQueues(_0x484978['voiceQueues']);if(_0xc8328a){_0xc8328a=_['groupBy'](_0xc8328a,_0x5607('0x5c'));for(var _0x10a788 in _0xc8328a){if(_0xc8328a['hasOwnProperty'](_0x10a788)){var _0x144d91={};for(var _0x8e7b3c=0x0;_0x8e7b3c<_0xc8328a[_0x10a788][_0x5607('0x44')];_0x8e7b3c+=0x1){var _0x366089=_0xc8328a[_0x10a788][_0x8e7b3c]['queue'];if(_0x484978[_0x5607('0x14')][_0x366089]){if(_0xc8328a[_0x10a788][_0x8e7b3c][_0x5607('0x5d')]){_0x484978['voiceQueues'][_0x366089][_0x5607('0x5e')]+=0x1;}if(_0xc8328a[_0x10a788][_0x8e7b3c][_0x5607('0x5f')]){_0x484978[_0x5607('0x14')][_0x366089][_0x5607('0x36')]+=0x1;}_0x484978['voiceQueues'][_0x366089][_0x5607('0x30')]+=moment(_0xc8328a[_0x10a788][_0x8e7b3c][_0x5607('0x60')])[_0x5607('0x61')](moment(_0xc8328a[_0x10a788][_0x8e7b3c][_0x5607('0x62')]),_0x5607('0x63'))||0x0;if(_0x8e7b3c===_0xc8328a[_0x10a788]['length']-0x1){_0x484978[_0x5607('0x14')][_0x366089][_0x5607('0x31')]+=moment(_0xc8328a[_0x10a788][_0x8e7b3c][_0x5607('0x64')]||_0xc8328a[_0x10a788][_0x8e7b3c][_0x5607('0x65')]||_0xc8328a[_0x10a788][_0x8e7b3c]['queuecallerexitAt'])[_0x5607('0x61')](moment(_0xc8328a[_0x10a788][_0x8e7b3c]['queuecallerjoinAt']),_0x5607('0x63'))||0x0;_0x484978['voiceQueues'][_0x366089][_0x5607('0x2e')]+=0x1;if(_0xc8328a[_0x10a788][_0x8e7b3c][_0x5607('0x66')]){_0x484978[_0x5607('0x14')][_0x366089][_0x5607('0x2f')]+=0x1;_0x484978['voiceQueues'][_0x366089][_0x5607('0x32')]+=moment(_0xc8328a[_0x10a788][_0x8e7b3c][_0x5607('0x64')])['diff'](moment(_0xc8328a[_0x10a788][_0x8e7b3c][_0x5607('0x60')]),_0x5607('0x63'))||0x0;}}else{_0x484978['voiceQueues'][_0x366089][_0x5607('0x31')]+=_0x484978[_0x5607('0x14')][_0x366089][_0x5607('0x30')]||0x0;}}}}}}return _0x484978[_0x5607('0x14')];};};Realtime[_0x5607('0x43')][_0x5607('0x67')]=function(){var _0x440377=this;return function(_0x104638){clearVoiceCallReports(_0x440377[_0x5607('0x17')]);if(_0x104638){for(var _0x1eeaec=0x0;_0x1eeaec<_0x104638[_0x5607('0x44')];_0x1eeaec+=0x1){_0x440377['outbound']['total']+=0x1;_0x440377['outbound'][_0x5607('0x31')]+=_0x104638[_0x1eeaec]['duration'];if(_0x104638[_0x1eeaec][_0x5607('0x68')]===_0x5607('0x69')){_0x440377[_0x5607('0x17')]['answered']+=0x1;_0x440377['outbound'][_0x5607('0x30')]+=_0x104638[_0x1eeaec][_0x5607('0x6a')]-_0x104638[_0x1eeaec][_0x5607('0x6b')]||0x0;_0x440377[_0x5607('0x17')][_0x5607('0x32')]+=_0x104638[_0x1eeaec]['billableseconds'];}}}return _0x440377[_0x5607('0x17')];};};Realtime[_0x5607('0x43')][_0x5607('0x6c')]=function(){var _0x1a317e=this;return function(_0x545f23){if(_0x545f23){freeIsNotKey(_0x545f23,_0x1a317e['campaigns'],'name');for(var _0x436cfa=0x0,_0x35766d={};_0x436cfa<_0x545f23[_0x5607('0x44')];_0x436cfa+=0x1){_0x35766d=_0x545f23[_0x436cfa];if(_['isUndefined'](_0x1a317e[_0x5607('0x15')][_0x35766d[_0x5607('0x29')]])){_0x1a317e['campaigns'][_0x35766d[_0x5607('0x29')]]=new Campaign(_0x35766d);}else{_0x1a317e[_0x5607('0x49')](_0x1a317e[_0x5607('0x15')][_0x35766d[_0x5607('0x29')]],_0x35766d);_0x1a317e[_0x5607('0x15')][_0x35766d[_0x5607('0x29')]][_0x5607('0x6d')]=_0x35766d['SquareProject']?_0x35766d[_0x5607('0x6e')][_0x5607('0x29')]:undefined;}}}return _0x1a317e[_0x5607('0x15')];};};Realtime[_0x5607('0x43')][_0x5607('0x6f')]=function(){var _0x21407a=this;return function(_0x421109){if(_0x421109){freeIsNotKey(_0x421109,_0x21407a[_0x5607('0x18')],'id');for(var _0x3d2c03=0x0,_0x3139c4={};_0x3d2c03<_0x421109['length'];_0x3d2c03+=0x1){_0x3139c4=_0x421109[_0x3d2c03];if(_[_0x5607('0x45')](_0x21407a[_0x5607('0x18')][_0x3139c4['id']])){_0x21407a[_0x5607('0x18')][_0x3139c4['id']]=new VoiceExtension(_0x3139c4);}else{_0x21407a['mergeFromDatabase'](_0x21407a[_0x5607('0x18')][_0x3139c4['id']],_0x3139c4);}}}return _0x21407a[_0x5607('0x18')];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0xd8f97a=this;return function(_0x523bee){clearCampaigns(_0xd8f97a['campaigns']);for(var _0x5e5834=0x0;_0x5e5834<_0x523bee[_0x5607('0x44')];_0x5e5834+=0x1){_[_0x5607('0x5a')](_0xd8f97a['campaigns'][_0x523bee[_0x5e5834]['name']],_0x523bee[_0x5e5834]);}return _0xd8f97a[_0x5607('0x15')];};};Realtime[_0x5607('0x43')][_0x5607('0x70')]=function(){var _0x2970b6=this;return function(_0x5c1fe3){if(_0x5c1fe3){freeIsNotKey(_0x5c1fe3,_0x2970b6['faxAccounts'],'id');for(var _0x239a1b=0x0,_0xfc5acc={},_0x497151={};_0x239a1b<_0x5c1fe3[_0x5607('0x44')];_0x239a1b+=0x1){_0xfc5acc=_0x5c1fe3[_0x239a1b];if(_[_0x5607('0x45')](_0x2970b6[_0x5607('0x26')][_0xfc5acc['id']])){_0x2970b6[_0x5607('0x26')][_0xfc5acc['id']]=new FaxAccount(_0xfc5acc);}else{_0x2970b6[_0x5607('0x49')](_0x2970b6['faxAccounts'][_0xfc5acc['id']],_0xfc5acc);}}}return _0x2970b6[_0x5607('0x26')];};};module[_0x5607('0x71')]=Realtime; \ No newline at end of file +var _0x781d=['initSugarcrmAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','sumDuration','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','duration','ANSWERED','campaigns','SquareProject','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','format','interface','total','answered','sumBillable','isEmpty','unmanaged','sumHoldTime','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts'];(function(_0x6c8e0c,_0x2a5220){var _0x45ddd6=function(_0x4c2f67){while(--_0x4c2f67){_0x6c8e0c['push'](_0x6c8e0c['shift']());}};_0x45ddd6(++_0x2a5220);}(_0x781d,0x14a));var _0xd781=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x781d[_0x6131cd];return _0x47e916;};'use strict';var util=require(_0xd781('0x0'));var _=require(_0xd781('0x1'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0xd781('0x2'));var Trunk=require(_0xd781('0x3'));var VoiceQueue=require(_0xd781('0x4'));var Trigger=require(_0xd781('0x5'));var Template=require(_0xd781('0x6'));var Campaign=require(_0xd781('0x7'));var VoiceExtension=require(_0xd781('0x8'));var ZendeskAccount=require(_0xd781('0x9'));var SalesforceAccount=require(_0xd781('0xa'));var FreshdeskAccount=require(_0xd781('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xd781('0xc'));var DeskAccount=require(_0xd781('0xd'));var VtigerAccount=require(_0xd781('0xe'));var ServicenowAccount=require(_0xd781('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xd781('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xd781('0x11')]={};this[_0xd781('0x12')]={};this['trunks']={};this[_0xd781('0x13')]={};this[_0xd781('0x14')]={};this['campaigns']={};this['templates']={};this[_0xd781('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xd781('0x16')]={};this[_0xd781('0x17')]={};this[_0xd781('0x18')]={};this[_0xd781('0x19')]={};this[_0xd781('0x1a')]={};this[_0xd781('0x1b')]={};this[_0xd781('0x1c')]={};this[_0xd781('0x1d')]={};this[_0xd781('0x1e')]={};this[_0xd781('0x1f')]={};this['zohoAccounts']={};this[_0xd781('0x20')]={};this[_0xd781('0x21')]={};this['servicenowAccounts']={};this[_0xd781('0x22')]={};this['freshsalesAccounts']={};this[_0xd781('0x23')]={};};function freeIsNotKey(_0x22d787,_0x9f25f7,_0x1409dd){var _0x42a9c1=_[_0xd781('0x24')](_0x22d787,function(_0x501b0d,_0x5770b0){return _0x501b0d[_0x1409dd];});for(var _0x1407fc in _0x9f25f7){if(_0x9f25f7[_0xd781('0x25')](_0x1407fc)){if(!_0x42a9c1[_0x1407fc]){delete _0x9f25f7[_0x1407fc];}}}}function freeIsNotKeySip(_0x395d9c,_0x2f1273){var _0x3bf805=_[_0xd781('0x24')](_0x395d9c,function(_0x260aa8,_0x1d6fc7){return util['format'](_0xd781('0x26'),_0x260aa8[_0xd781('0x27')]);});for(var _0x1036d3 in _0x2f1273){if(_0x2f1273[_0xd781('0x25')](_0x1036d3)){if(!_0x3bf805[_0x1036d3]){delete _0x2f1273[_0x1036d3];}}}}function freeIsNotKeyAgent(_0x36d320,_0x274665){var _0x1adcbd=_['mapKeys'](_0x36d320,function(_0xe0c65f,_0x4e2c56){var _0x567fdf=_[_0xd781('0x28')](_0xe0c65f['interface'])?util[_0xd781('0x29')](_0xd781('0x26'),_0xe0c65f[_0xd781('0x27')]):_0xe0c65f[_0xd781('0x2a')];return _0x567fdf;});for(var _0x391461 in _0x274665){if(_0x274665[_0xd781('0x25')](_0x391461)){if(!_0x1adcbd[_0x391461]){delete _0x274665[_0x391461];}}}}function clearVoiceCallReports(_0x221f14){_0x221f14[_0xd781('0x2b')]=0x0;_0x221f14[_0xd781('0x2c')]=0x0;_0x221f14['sumHoldTime']=0x0;_0x221f14['sumDuration']=0x0;_0x221f14[_0xd781('0x2d')]=0x0;}function clearCampaigns(_0x849587){if(!_[_0xd781('0x2e')](_0x849587)){for(var _0x57b41e in _0x849587){if(_0x849587[_0xd781('0x25')](_0x57b41e)){_0x849587[_0x57b41e]['ivrTotalCallsDays']=0x0;_0x849587[_0x57b41e]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x1e29c8){if(!_['isEmpty'](_0x1e29c8)){for(var _0x3e868 in _0x1e29c8){if(_0x1e29c8[_0xd781('0x25')](_0x3e868)){_0x1e29c8[_0x3e868]['total']=0x0;_0x1e29c8[_0x3e868]['answered']=0x0;_0x1e29c8[_0x3e868][_0xd781('0x2f')]=0x0;_0x1e29c8[_0x3e868]['abandoned']=0x0;_0x1e29c8[_0x3e868][_0xd781('0x30')]=0x0;_0x1e29c8[_0x3e868]['sumDuration']=0x0;_0x1e29c8[_0x3e868][_0xd781('0x2d')]=0x0;_0x1e29c8[_0x3e868][_0xd781('0x31')]=0x0;_0x1e29c8[_0x3e868]['outboundNoAnswerCallsDay']=0x0;_0x1e29c8[_0x3e868]['outboundBusyCallsDay']=0x0;_0x1e29c8[_0x3e868][_0xd781('0x32')]=0x0;_0x1e29c8[_0x3e868][_0xd781('0x33')]=0x0;_0x1e29c8[_0x3e868][_0xd781('0x34')]=0x0;_0x1e29c8[_0x3e868]['outboundDropCallsDayTimeout']=0x0;_0x1e29c8[_0x3e868]['outboundDropCallsDayCallersExit']=0x0;_0x1e29c8[_0x3e868][_0xd781('0x35')]=0x0;_0x1e29c8[_0x3e868][_0xd781('0x36')]=0x0;_0x1e29c8[_0x3e868][_0xd781('0x37')]=0x0;_0x1e29c8[_0x3e868]['outboundReCallsDay']=0x0;_0x1e29c8[_0x3e868]['outboundAnswerAgiCallsDay']=0x0;_0x1e29c8[_0x3e868][_0xd781('0x38')]=0x0;_0x1e29c8[_0x3e868][_0xd781('0x39')]=!![];}}}}Realtime['prototype'][_0xd781('0x3a')]=function(_0x43c322,_0x565556){for(var _0x15b6c1 in _0x565556){if(_0x43c322[_0xd781('0x25')](_0x15b6c1)){_0x43c322[_0x15b6c1]=_0x565556[_0x15b6c1];}}};Realtime[_0xd781('0x3b')][_0xd781('0x3c')]=function(){var _0x51b711=this;return function(_0x23dffb){if(_0x23dffb){freeIsNotKeyAgent(_0x23dffb,_0x51b711[_0xd781('0x11')]);for(var _0x1c0b75=0x0,_0x37984e={},_0x4dd2e0={};_0x1c0b75<_0x23dffb[_0xd781('0x3d')];_0x1c0b75+=0x1){_0x37984e=_0x23dffb[_0x1c0b75];var _0x3f20e2=_['isNil'](_0x37984e[_0xd781('0x2a')])?util['format'](_0xd781('0x26'),_0x37984e[_0xd781('0x27')]):_0x37984e['interface'];if(_[_0xd781('0x3e')](_0x51b711[_0xd781('0x11')][_0x3f20e2])){_0x51b711['agents'][_0x3f20e2]=new Agent(_0x37984e);}else{_0x51b711[_0xd781('0x3a')](_0x51b711['agents'][_0x3f20e2],_0x37984e);}}}return _0x51b711[_0xd781('0x11')];};};Realtime[_0xd781('0x3b')]['initTelephones']=function(){var _0x33f9fd=this;return function(_0x1854c3){if(_0x1854c3){freeIsNotKeySip(_0x1854c3,_0x33f9fd['telephones']);for(var _0x2712c6=0x0,_0x34528f={},_0x281fcf={};_0x2712c6<_0x1854c3['length'];_0x2712c6+=0x1){_0x34528f=_0x1854c3[_0x2712c6];if(_[_0xd781('0x3e')](_0x33f9fd[_0xd781('0x12')][util[_0xd781('0x29')](_0xd781('0x26'),_0x34528f[_0xd781('0x27')])])){_0x33f9fd[_0xd781('0x12')][util[_0xd781('0x29')](_0xd781('0x26'),_0x34528f[_0xd781('0x27')])]=new Telephone(_0x34528f);}else{_0x33f9fd['mergeFromDatabase'](_0x33f9fd[_0xd781('0x12')][util['format'](_0xd781('0x26'),_0x34528f[_0xd781('0x27')])],_0x34528f);}}}return _0x33f9fd['telephones'];};};Realtime[_0xd781('0x3b')][_0xd781('0x3f')]=function(){var _0x224488=this;return function(_0x402c9c){if(_0x402c9c){freeIsNotKeySip(_0x402c9c,_0x224488['trunks']);for(var _0x242381=0x0,_0x515357={},_0xb14b50={};_0x242381<_0x402c9c[_0xd781('0x3d')];_0x242381+=0x1){_0x515357=_0x402c9c[_0x242381];if(_['isUndefined'](_0x224488['trunks'][util[_0xd781('0x29')](_0xd781('0x26'),_0x515357[_0xd781('0x27')])])){_0x224488[_0xd781('0x40')][util['format'](_0xd781('0x26'),_0x515357[_0xd781('0x27')])]=new Trunk(_0x515357);}else{_0x224488['mergeFromDatabase'](_0x224488['trunks'][util[_0xd781('0x29')](_0xd781('0x26'),_0x515357[_0xd781('0x27')])],_0x515357);}}}return _0x224488['trunks'];};};Realtime['prototype'][_0xd781('0x41')]=function(){var _0x209b0f=this;return function(_0x3c7076){if(_0x3c7076){freeIsNotKey(_0x3c7076,_0x209b0f[_0xd781('0x13')],_0xd781('0x27'));for(var _0x15f584=0x0,_0x557078={},_0x5d1c9a={};_0x15f584<_0x3c7076[_0xd781('0x3d')];_0x15f584+=0x1){_0x557078=_0x3c7076[_0x15f584];if(_[_0xd781('0x3e')](_0x209b0f[_0xd781('0x13')][_0x557078[_0xd781('0x27')]])){_0x209b0f[_0xd781('0x13')][_0x557078['name']]=new VoiceQueue(_0x557078);}else{_0x209b0f[_0xd781('0x3a')](_0x209b0f[_0xd781('0x13')][_0x557078[_0xd781('0x27')]],_0x557078);}}}return _0x209b0f['voiceQueues'];};};Realtime[_0xd781('0x3b')][_0xd781('0x42')]=function(){var _0x2f1f7a=this;return function(_0x5a0cdd){if(_0x5a0cdd){freeIsNotKey(_0x5a0cdd,_0x2f1f7a[_0xd781('0x14')],'id');for(var _0x335b64=0x0,_0x54c2a3={},_0x4fc5e9={};_0x335b64<_0x5a0cdd[_0xd781('0x3d')];_0x335b64+=0x1){_0x54c2a3=_0x5a0cdd[_0x335b64];if(_[_0xd781('0x3e')](_0x2f1f7a[_0xd781('0x14')][_0x54c2a3['id']])){_0x2f1f7a['triggers'][_0x54c2a3['id']]=new Trigger(_0x54c2a3);}else{_0x2f1f7a[_0xd781('0x3a')](_0x2f1f7a[_0xd781('0x14')][_0x54c2a3['id']],_0x54c2a3);}}}return _0x2f1f7a[_0xd781('0x14')];};};Realtime[_0xd781('0x3b')][_0xd781('0x43')]=function(){var _0x3828ad=this;return function(_0x5e591a){if(_0x5e591a){freeIsNotKey(_0x5e591a,_0x3828ad['templates'],'id');for(var _0x46692d=0x0,_0x2de73b={},_0x1d54bd={};_0x46692d<_0x5e591a['length'];_0x46692d+=0x1){_0x2de73b=_0x5e591a[_0x46692d];if(_[_0xd781('0x3e')](_0x3828ad[_0xd781('0x44')][_0x2de73b['id']])){_0x3828ad['templates'][_0x2de73b['id']]=new Template(_0x2de73b);}else{_0x3828ad[_0xd781('0x3a')](_0x3828ad[_0xd781('0x44')][_0x2de73b['id']],_0x2de73b);}}}return _0x3828ad[_0xd781('0x44')];};};Realtime[_0xd781('0x3b')][_0xd781('0x45')]=function(){var _0x599915=this;return function(_0x34a511){if(_0x34a511){freeIsNotKey(_0x34a511,_0x599915['zendeskAccounts'],'id');for(var _0x17524d=0x0,_0x556ea4={},_0x2ce1f6={};_0x17524d<_0x34a511[_0xd781('0x3d')];_0x17524d+=0x1){_0x556ea4=_0x34a511[_0x17524d];if(_['isUndefined'](_0x599915[_0xd781('0x1c')][_0x556ea4['id']])){_0x599915['zendeskAccounts'][_0x556ea4['id']]=new ZendeskAccount(_0x556ea4);}else{_0x599915['mergeFromDatabase'](_0x599915['zendeskAccounts'][_0x556ea4['id']],_0x556ea4);}}}return _0x599915[_0xd781('0x1c')];};};Realtime[_0xd781('0x3b')]['initSalesforceAccounts']=function(){var _0x245c30=this;return function(_0x58becd){if(_0x58becd){freeIsNotKey(_0x58becd,_0x245c30[_0xd781('0x1d')],'id');for(var _0x33b46f=0x0,_0x39d47d={},_0x19a6c2={};_0x33b46f<_0x58becd['length'];_0x33b46f+=0x1){_0x39d47d=_0x58becd[_0x33b46f];if(_[_0xd781('0x3e')](_0x245c30['salesforceAccounts'][_0x39d47d['id']])){_0x245c30[_0xd781('0x1d')][_0x39d47d['id']]=new SalesforceAccount(_0x39d47d);}else{_0x245c30['mergeFromDatabase'](_0x245c30[_0xd781('0x1d')][_0x39d47d['id']],_0x39d47d);}}}return _0x245c30[_0xd781('0x1d')];};};Realtime['prototype'][_0xd781('0x46')]=function(){var _0x11e486=this;return function(_0xee40c9){if(_0xee40c9){freeIsNotKey(_0xee40c9,_0x11e486[_0xd781('0x1f')],'id');for(var _0xfc466c=0x0,_0x314c6c={},_0x555945={};_0xfc466c<_0xee40c9['length'];_0xfc466c+=0x1){_0x314c6c=_0xee40c9[_0xfc466c];if(_[_0xd781('0x3e')](_0x11e486[_0xd781('0x1f')][_0x314c6c['id']])){_0x11e486[_0xd781('0x1f')][_0x314c6c['id']]=new FreshdeskAccount(_0x314c6c);}else{_0x11e486[_0xd781('0x3a')](_0x11e486['freshdeskAccounts'][_0x314c6c['id']],_0x314c6c);}}}return _0x11e486[_0xd781('0x1f')];};};Realtime['prototype'][_0xd781('0x47')]=function(){var _0x2f73ee=this;return function(_0x5e527c){if(_0x5e527c){freeIsNotKey(_0x5e527c,_0x2f73ee[_0xd781('0x48')],'id');for(var _0x4c8c50=0x0,_0x53dae6={},_0x41cb25={};_0x4c8c50<_0x5e527c['length'];_0x4c8c50+=0x1){_0x53dae6=_0x5e527c[_0x4c8c50];if(_[_0xd781('0x3e')](_0x2f73ee[_0xd781('0x48')][_0x53dae6['id']])){_0x2f73ee[_0xd781('0x48')][_0x53dae6['id']]=new ZohoAccount(_0x53dae6);}else{_0x2f73ee[_0xd781('0x3a')](_0x2f73ee[_0xd781('0x48')][_0x53dae6['id']],_0x53dae6);}}}return _0x2f73ee['zohoAccounts'];};};Realtime[_0xd781('0x3b')][_0xd781('0x49')]=function(){var _0x51a9dd=this;return function(_0x222a56){if(_0x222a56){freeIsNotKey(_0x222a56,_0x51a9dd[_0xd781('0x20')],'id');for(var _0x11a60a=0x0,_0x2c4874={},_0x2e8bab={};_0x11a60a<_0x222a56[_0xd781('0x3d')];_0x11a60a+=0x1){_0x2c4874=_0x222a56[_0x11a60a];if(_[_0xd781('0x3e')](_0x51a9dd[_0xd781('0x20')][_0x2c4874['id']])){_0x51a9dd[_0xd781('0x20')][_0x2c4874['id']]=new DeskAccount(_0x2c4874);}else{_0x51a9dd[_0xd781('0x3a')](_0x51a9dd[_0xd781('0x20')][_0x2c4874['id']],_0x2c4874);}}}return _0x51a9dd[_0xd781('0x20')];};};Realtime[_0xd781('0x3b')][_0xd781('0x4a')]=function(){var _0x42adc4=this;return function(_0x58c9ca){if(_0x58c9ca){freeIsNotKey(_0x58c9ca,_0x42adc4[_0xd781('0x1e')],'id');for(var _0x5e0774=0x0,_0x1a725b={},_0x947f4c={};_0x5e0774<_0x58c9ca[_0xd781('0x3d')];_0x5e0774+=0x1){_0x1a725b=_0x58c9ca[_0x5e0774];if(_[_0xd781('0x3e')](_0x42adc4[_0xd781('0x1e')][_0x1a725b['id']])){_0x42adc4['sugarcrmAccounts'][_0x1a725b['id']]=new SugarcrmAccount(_0x1a725b);}else{_0x42adc4['mergeFromDatabase'](_0x42adc4[_0xd781('0x1e')][_0x1a725b['id']],_0x1a725b);}}}return _0x42adc4['sugarcrmAccounts'];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x4f2b3a=this;return function(_0x4150ce){if(_0x4150ce){freeIsNotKey(_0x4150ce,_0x4f2b3a['vtigerAccounts'],'id');for(var _0x29800a=0x0,_0x3c1742={},_0x98ea88={};_0x29800a<_0x4150ce[_0xd781('0x3d')];_0x29800a+=0x1){_0x3c1742=_0x4150ce[_0x29800a];if(_[_0xd781('0x3e')](_0x4f2b3a['vtigerAccounts'][_0x3c1742['id']])){_0x4f2b3a[_0xd781('0x21')][_0x3c1742['id']]=new VtigerAccount(_0x3c1742);}else{_0x4f2b3a[_0xd781('0x3a')](_0x4f2b3a[_0xd781('0x21')][_0x3c1742['id']],_0x3c1742);}}}return _0x4f2b3a[_0xd781('0x21')];};};Realtime[_0xd781('0x3b')][_0xd781('0x4b')]=function(){var _0x4ca9a0=this;return function(_0x55fb08){if(_0x55fb08){freeIsNotKey(_0x55fb08,_0x4ca9a0[_0xd781('0x4c')],'id');for(var _0x596aa5=0x0,_0x246d0a={},_0x8d285b={};_0x596aa5<_0x55fb08[_0xd781('0x3d')];_0x596aa5+=0x1){_0x246d0a=_0x55fb08[_0x596aa5];if(_[_0xd781('0x3e')](_0x4ca9a0['servicenowAccounts'][_0x246d0a['id']])){_0x4ca9a0[_0xd781('0x4c')][_0x246d0a['id']]=new ServicenowAccount(_0x246d0a);}else{_0x4ca9a0[_0xd781('0x3a')](_0x4ca9a0[_0xd781('0x4c')][_0x246d0a['id']],_0x246d0a);}}}return _0x4ca9a0[_0xd781('0x4c')];};};Realtime[_0xd781('0x3b')]['initDynamics365Accounts']=function(){var _0x21479f=this;return function(_0x56fd1b){if(_0x56fd1b){freeIsNotKey(_0x56fd1b,_0x21479f[_0xd781('0x22')],'id');for(var _0x327109=0x0,_0x53f950={},_0x4d5c37={};_0x327109<_0x56fd1b[_0xd781('0x3d')];_0x327109+=0x1){_0x53f950=_0x56fd1b[_0x327109];if(_[_0xd781('0x3e')](_0x21479f[_0xd781('0x22')][_0x53f950['id']])){_0x21479f[_0xd781('0x22')][_0x53f950['id']]=new Dynamics365Account(_0x53f950);}else{_0x21479f[_0xd781('0x3a')](_0x21479f[_0xd781('0x22')][_0x53f950['id']],_0x53f950);}}}return _0x21479f[_0xd781('0x22')];};};Realtime[_0xd781('0x3b')][_0xd781('0x4d')]=function(){var _0x4a493c=this;return function(_0x143fe7){if(_0x143fe7){freeIsNotKey(_0x143fe7,_0x4a493c[_0xd781('0x4e')],'id');for(var _0x4c712f=0x0,_0x24e3f5={},_0x5bba63={};_0x4c712f<_0x143fe7[_0xd781('0x3d')];_0x4c712f+=0x1){_0x24e3f5=_0x143fe7[_0x4c712f];if(_[_0xd781('0x3e')](_0x4a493c['freshsalesAccounts'][_0x24e3f5['id']])){_0x4a493c['freshsalesAccounts'][_0x24e3f5['id']]=new FreshsalesAccount(_0x24e3f5);}else{_0x4a493c[_0xd781('0x3a')](_0x4a493c[_0xd781('0x4e')][_0x24e3f5['id']],_0x24e3f5);}}}return _0x4a493c[_0xd781('0x4e')];};};Realtime[_0xd781('0x3b')][_0xd781('0x4f')]=function(){var _0x45e2f1=this;return function(_0x5e71c9){for(var _0x9523a0=0x0;_0x9523a0<_0x5e71c9[_0xd781('0x3d')];_0x9523a0+=0x1){_[_0xd781('0x50')](_0x45e2f1[_0xd781('0x13')][_0x5e71c9[_0x9523a0][_0xd781('0x27')]],_0x5e71c9[_0x9523a0]);}return _0x45e2f1[_0xd781('0x13')];};};Realtime[_0xd781('0x3b')][_0xd781('0x51')]=function(){var _0x24b96e=this;return function(_0x383f0d){clearVoiceQueues(_0x24b96e[_0xd781('0x13')]);if(_0x383f0d){_0x383f0d=_['groupBy'](_0x383f0d,_0xd781('0x52'));for(var _0x56ce07 in _0x383f0d){if(_0x383f0d[_0xd781('0x25')](_0x56ce07)){var _0x40288e={};for(var _0x29ed1a=0x0;_0x29ed1a<_0x383f0d[_0x56ce07][_0xd781('0x3d')];_0x29ed1a+=0x1){var _0x25c66a=_0x383f0d[_0x56ce07][_0x29ed1a][_0xd781('0x53')];if(_0x24b96e[_0xd781('0x13')][_0x25c66a]){if(_0x383f0d[_0x56ce07][_0x29ed1a][_0xd781('0x54')]){_0x24b96e[_0xd781('0x13')][_0x25c66a][_0xd781('0x2f')]+=0x1;}if(_0x383f0d[_0x56ce07][_0x29ed1a]['queuecallerabandon']){_0x24b96e[_0xd781('0x13')][_0x25c66a][_0xd781('0x55')]+=0x1;}_0x24b96e['voiceQueues'][_0x25c66a][_0xd781('0x30')]+=moment(_0x383f0d[_0x56ce07][_0x29ed1a][_0xd781('0x56')])[_0xd781('0x57')](moment(_0x383f0d[_0x56ce07][_0x29ed1a]['queuecallerjoinAt']),'seconds')||0x0;if(_0x29ed1a===_0x383f0d[_0x56ce07][_0xd781('0x3d')]-0x1){_0x24b96e['voiceQueues'][_0x25c66a][_0xd781('0x58')]+=moment(_0x383f0d[_0x56ce07][_0x29ed1a][_0xd781('0x59')]||_0x383f0d[_0x56ce07][_0x29ed1a][_0xd781('0x5a')]||_0x383f0d[_0x56ce07][_0x29ed1a][_0xd781('0x5b')])[_0xd781('0x57')](moment(_0x383f0d[_0x56ce07][_0x29ed1a]['queuecallerjoinAt']),_0xd781('0x5c'))||0x0;_0x24b96e[_0xd781('0x13')][_0x25c66a][_0xd781('0x2b')]+=0x1;if(_0x383f0d[_0x56ce07][_0x29ed1a][_0xd781('0x5d')]){_0x24b96e[_0xd781('0x13')][_0x25c66a][_0xd781('0x2c')]+=0x1;_0x24b96e[_0xd781('0x13')][_0x25c66a][_0xd781('0x2d')]+=moment(_0x383f0d[_0x56ce07][_0x29ed1a][_0xd781('0x59')])[_0xd781('0x57')](moment(_0x383f0d[_0x56ce07][_0x29ed1a][_0xd781('0x56')]),'seconds')||0x0;}}else{_0x24b96e[_0xd781('0x13')][_0x25c66a][_0xd781('0x58')]+=_0x24b96e['voiceQueues'][_0x25c66a][_0xd781('0x30')]||0x0;}}}}}}return _0x24b96e[_0xd781('0x13')];};};Realtime[_0xd781('0x3b')]['initVoiceCallReports']=function(){var _0x402fa6=this;return function(_0x26ef57){clearVoiceCallReports(_0x402fa6['outbound']);if(_0x26ef57){for(var _0x2bdd98=0x0;_0x2bdd98<_0x26ef57['length'];_0x2bdd98+=0x1){_0x402fa6[_0xd781('0x15')][_0xd781('0x2b')]+=0x1;_0x402fa6[_0xd781('0x15')][_0xd781('0x58')]+=_0x26ef57[_0x2bdd98][_0xd781('0x5e')];if(_0x26ef57[_0x2bdd98]['disposition']===_0xd781('0x5f')){_0x402fa6[_0xd781('0x15')][_0xd781('0x2c')]+=0x1;_0x402fa6[_0xd781('0x15')][_0xd781('0x30')]+=_0x26ef57[_0x2bdd98][_0xd781('0x5e')]-_0x26ef57[_0x2bdd98]['billableseconds']||0x0;_0x402fa6[_0xd781('0x15')][_0xd781('0x2d')]+=_0x26ef57[_0x2bdd98]['billableseconds'];}}}return _0x402fa6[_0xd781('0x15')];};};Realtime[_0xd781('0x3b')]['initCampaigns']=function(){var _0x1ba077=this;return function(_0x612135){if(_0x612135){freeIsNotKey(_0x612135,_0x1ba077[_0xd781('0x60')],_0xd781('0x27'));for(var _0x3414f6=0x0,_0x4d35e8={};_0x3414f6<_0x612135['length'];_0x3414f6+=0x1){_0x4d35e8=_0x612135[_0x3414f6];if(_['isUndefined'](_0x1ba077[_0xd781('0x60')][_0x4d35e8[_0xd781('0x27')]])){_0x1ba077[_0xd781('0x60')][_0x4d35e8[_0xd781('0x27')]]=new Campaign(_0x4d35e8);}else{_0x1ba077[_0xd781('0x3a')](_0x1ba077[_0xd781('0x60')][_0x4d35e8[_0xd781('0x27')]],_0x4d35e8);_0x1ba077[_0xd781('0x60')][_0x4d35e8[_0xd781('0x27')]]['dialQueueProject']=_0x4d35e8[_0xd781('0x61')]?_0x4d35e8[_0xd781('0x61')][_0xd781('0x27')]:undefined;}}}return _0x1ba077[_0xd781('0x60')];};};Realtime[_0xd781('0x3b')]['initVoiceExtensions']=function(){var _0x4a1907=this;return function(_0x529b3b){if(_0x529b3b){freeIsNotKey(_0x529b3b,_0x4a1907[_0xd781('0x16')],'id');for(var _0x5d9768=0x0,_0x31190b={};_0x5d9768<_0x529b3b[_0xd781('0x3d')];_0x5d9768+=0x1){_0x31190b=_0x529b3b[_0x5d9768];if(_['isUndefined'](_0x4a1907['voiceExtensions'][_0x31190b['id']])){_0x4a1907[_0xd781('0x16')][_0x31190b['id']]=new VoiceExtension(_0x31190b);}else{_0x4a1907[_0xd781('0x3a')](_0x4a1907[_0xd781('0x16')][_0x31190b['id']],_0x31190b);}}}return _0x4a1907[_0xd781('0x16')];};};Realtime['prototype'][_0xd781('0x62')]=function(){var _0x249ea2=this;return function(_0x11f220){clearCampaigns(_0x249ea2[_0xd781('0x60')]);for(var _0x2837ba=0x0;_0x2837ba<_0x11f220['length'];_0x2837ba+=0x1){_[_0xd781('0x50')](_0x249ea2[_0xd781('0x60')][_0x11f220[_0x2837ba]['name']],_0x11f220[_0x2837ba]);}return _0x249ea2[_0xd781('0x60')];};};Realtime[_0xd781('0x3b')][_0xd781('0x63')]=function(){var _0x15857c=this;return function(_0x3dbfa5){if(_0x3dbfa5){freeIsNotKey(_0x3dbfa5,_0x15857c[_0xd781('0x23')],'id');for(var _0x289ecb=0x0,_0x1b41b6={},_0x517142={};_0x289ecb<_0x3dbfa5['length'];_0x289ecb+=0x1){_0x1b41b6=_0x3dbfa5[_0x289ecb];if(_[_0xd781('0x3e')](_0x15857c[_0xd781('0x23')][_0x1b41b6['id']])){_0x15857c['faxAccounts'][_0x1b41b6['id']]=new FaxAccount(_0x1b41b6);}else{_0x15857c[_0xd781('0x3a')](_0x15857c[_0xd781('0x23')][_0x1b41b6['id']],_0x1b41b6);}}}return _0x15857c['faxAccounts'];};};module[_0xd781('0x64')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index bcc2a48..01e65b5 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 _0x9068=['isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','../../../config/environment','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceDialReport','blindTransfer','attendedtransfer','prototype','findAgent','find','accountcode','name','isNil','format','SIP/%s','length','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','internal','voiceCallReport','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','connectedlinenum','callerid','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','voiceAgentReport'];(function(_0x53e1d9,_0x18159f){var _0x1856f7=function(_0x292d37){while(--_0x292d37){_0x53e1d9['push'](_0x53e1d9['shift']());}};_0x1856f7(++_0x18159f);}(_0x9068,0x6b));var _0x8906=function(_0x155d59,_0x2ab5eb){_0x155d59=_0x155d59-0x0;var _0x26de05=_0x9068[_0x155d59];return _0x26de05;};'use strict';var _=require(_0x8906('0x0'));var moment=require('moment');var util=require('util');var config=require(_0x8906('0x1'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x8906('0x2'));var RpcVoiceDialReport=require(_0x8906('0x3'));var RpcMemberReport=require(_0x8906('0x4'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x8906('0x5'));var RpcVoiceTransferReport=require(_0x8906('0x6'));var VoiceQueueReport=require(_0x8906('0x7'));var VoiceCallReport=require(_0x8906('0x8'));var VoiceAgentReport=require(_0x8906('0x9'));var VoiceDialReport=require(_0x8906('0xa'));var UserReport=require(_0x8906('0xb'));function Report(_0x5ee28b){this['realtime']=_0x5ee28b;this[_0x8906('0xc')]=_0x5ee28b[_0x8906('0xc')];this[_0x8906('0xd')]=_0x5ee28b[_0x8906('0xd')];}Report['prototype'][_0x8906('0xe')]=function(_0x52ac00){var _0x3ee4ff=new VoiceQueueReport(this[_0x8906('0xf')]);var _0x3840a5=new VoiceAgentReport(this[_0x8906('0xf')]);var _0x1fa7b2=new VoiceDialReport(this[_0x8906('0xf')]);var _0x4c4e51=new VoiceCallReport(this[_0x8906('0xf')]);var _0x4c6e5b=new UserReport(this[_0x8906('0xf')]);if(config['xdr']&&config[_0x8906('0x10')][_0x8906('0x11')]){ami['on'](_0x8906('0x12'),this[_0x8906('0x13')][_0x8906('0x14')](this));ami['on'](_0x8906('0x15'),this['voiceCallReport'][_0x8906('0x14')](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport']['bind'](this));ami['on']('custom:voiceDialReport',this[_0x8906('0x16')][_0x8906('0x14')](this));ami['on']('blindtransfer',this[_0x8906('0x17')]['bind'](this));ami['on'](_0x8906('0x18'),this['attendedTransfer'][_0x8906('0x14')](this));}};Report[_0x8906('0x19')][_0x8906('0x1a')]=function(_0x1eaf1e){var _0x3777b7;_0x3777b7=_[_0x8906('0x1b')](this[_0x8906('0xc')],function(_0x475d91){return _0x475d91[_0x8906('0x1c')]==_0x1eaf1e||_0x475d91[_0x8906('0x1d')]==_0x1eaf1e;});if(_[_0x8906('0x1e')](_0x3777b7)){var _0x3364eb=_['find'](this[_0x8906('0xd')],function(_0xd1c6d0){return _0xd1c6d0[_0x8906('0x1c')]==_0x1eaf1e||_0xd1c6d0['name']==_0x1eaf1e;});if(_0x3364eb){_0x3777b7=_[_0x8906('0x1b')](this['agents'],function(_0xbc6aa2){return _0xbc6aa2['interface']==util[_0x8906('0x1f')](_0x8906('0x20'),_0x3364eb[_0x8906('0x1d')]);});}}return _0x3777b7;};Report['prototype'][_0x8906('0x13')]=function(_0x381b3a){for(var _0x6c4712=0x0;_0x6c4712<_0x381b3a[_0x8906('0x21')];_0x6c4712+=0x1){var _0x5e8dad=this[_0x8906('0x1a')](_0x381b3a[_0x6c4712]['connectedlinenum']);if(_0x5e8dad){_0x381b3a[_0x6c4712][_0x8906('0x1c')]=_0x5e8dad['accountcode'];_0x381b3a[_0x6c4712][_0x8906('0x22')]=!![];_0x381b3a[_0x6c4712][_0x8906('0x23')]=_0x5e8dad[_0x8906('0x1d')];_0x381b3a[_0x6c4712][_0x8906('0x24')]=_[_0x8906('0x1e')](_0x5e8dad[_0x8906('0x24')])?util[_0x8906('0x1f')]('SIP/%s',_0x5e8dad[_0x8906('0x1d')]):_0x5e8dad[_0x8906('0x24')];if(_0x381b3a[_0x6c4712][_0x8906('0x25')]){_0x381b3a[_0x6c4712][_0x8906('0x26')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x381b3a[_0x6c4712]['queuecallerexit']){_0x381b3a[_0x6c4712][_0x8906('0x27')]=moment()[_0x8906('0x1f')](_0x8906('0x28'));}RpcMemberReport['voiceQueueReport'](_0x381b3a[_0x6c4712]);}RpcVoiceQueueReport[_0x8906('0x29')](_0x381b3a[_0x6c4712]);}};function extractCalleridNumber(_0x5e8f35){var _0x298114=_0x5e8f35[_0x8906('0x2a')](/<(.*?)>/);return _0x298114?_0x298114[0x1]:_0x5e8f35;}Report[_0x8906('0x19')][_0x8906('0x2b')]=function(_0x45bb55){for(var _0x4b30bd=0x0;_0x4b30bd/);return _0x229998?_0x229998[0x1]:_0x5a1511;}Report['prototype']['getAgentByInternal']=function(_0x13c7a0){for(var _0x18e57f=0x0;_0x18e57f',_0x6c5b80[_0xf73f('0x41')],_0x6c5b80[_0xf73f('0x30')]);}if(RpcVoiceTransferReport[_0xf73f('0x42')][_0x6c5b80[_0xf73f('0x43')]]){var _0x39338c=RpcVoiceTransferReport['transfers'][_0x6c5b80[_0xf73f('0x43')]];_0x39338c[_0xf73f('0x44')]=_0x6c5b80[_0xf73f('0x45')];RpcVoiceTransferReport[_0xf73f('0x46')](_0x39338c);delete RpcVoiceTransferReport[_0xf73f('0x42')][_0x6c5b80[_0xf73f('0x43')]];}if(_[_0xf73f('0x24')](_0x6c5b80[_0xf73f('0x34')])){_0x6c5b80[_0xf73f('0x34')]=this[_0xf73f('0x2c')](_0x6c5b80);}if(_['isNil'](_0x6c5b80['UserId'])){var _0x29cbb5=_0x6c5b80[_0xf73f('0x2d')][_0xf73f('0x2e')]('-')[0x0];var _0x47929a=this[_0xf73f('0xc')][_0x29cbb5];if(!_0x47929a)_0x47929a=this[_0xf73f('0x2f')](_0x6c5b80['accountcode']);if(_0x47929a){_0x6c5b80[_0xf73f('0x47')]=_0x47929a['id'];_0x6c5b80['membername']=_0x47929a[_0xf73f('0x20')];}}RpcVoiceCallReport[_0xf73f('0x48')](_0x6c5b80);if(_0x6c5b80[_0xf73f('0x49')]){for(var _0x4b2cf6=0x0;_0x4b2cf6<_0x6c5b80['monitors'][_0xf73f('0x2a')];_0x4b2cf6+=0x1){_0x6c5b80[_0xf73f('0x4a')]=_0x6c5b80[_0xf73f('0x4b')][_0x4b2cf6][_0xf73f('0x4c')];_0x6c5b80[_0xf73f('0x4d')]=_0x6c5b80[_0xf73f('0x4b')][_0x4b2cf6]['createdAt'];if(_0x6c5b80[_0xf73f('0x33')]==_0xf73f('0x3a')){_0x6c5b80['calleridnum']=_0x6c5b80[_0xf73f('0x40')];_0x6c5b80[_0xf73f('0x41')]=_0x6c5b80[_0xf73f('0x4e')];_0x6c5b80[_0xf73f('0x40')]=_0x6c5b80['accountcode'];_0x6c5b80['connectedlinename']=_0x6c5b80[_0xf73f('0x4f')];_0x6c5b80[_0xf73f('0x33')]=_0x6c5b80[_0xf73f('0x3c')];}else if(_0x6c5b80[_0xf73f('0x33')]==_0xf73f('0x50')){_0x6c5b80[_0xf73f('0x30')]=_0x6c5b80[_0xf73f('0x32')];_0x6c5b80[_0xf73f('0x33')]=_0x6c5b80[_0xf73f('0x3c')];}RpcVoiceRecording[_0xf73f('0x48')](_0x6c5b80);}}};Report[_0xf73f('0x1c')][_0xf73f('0x17')]=function(_0x5adb8e){if(_['isArray'](_0x5adb8e)){_0x5adb8e['forEach'](function(_0xf18e47){RpcVoiceAgentReport[_0xf73f('0x48')](_0xf18e47);});}else{RpcVoiceAgentReport['create'](_0x5adb8e);}};Report[_0xf73f('0x1c')][_0xf73f('0x19')]=function(_0x3995ad){RpcVoiceDialReport[_0xf73f('0x48')](_0x3995ad);var _0x466596;var _0x34eb68;var _0x267f89=_0x3995ad[_0xf73f('0x2d')];if(_['startsWith'](_0x267f89,_0xf73f('0x51'))){_0x34eb68=_0x267f89[_0xf73f('0x52')](_0x267f89[_0xf73f('0x53')]('/')+0x1,_0x267f89[_0xf73f('0x53')]('@'));_0x466596=_[_0xf73f('0x1e')](this[_0xf73f('0xc')],function(_0x39ed4e){return _0x39ed4e[_0xf73f('0x54')]==_0x34eb68||_0x39ed4e[_0xf73f('0x55')]==_0x34eb68||_0x39ed4e['accountcode']==_0x34eb68;});}else{_0x34eb68=_0x267f89[_0xf73f('0x52')](_0x267f89['indexOf']('/')+0x1,_0x267f89['lastIndexOf']('-'));_0x466596=this['findAgent'](_0x34eb68);}if(_0x466596){_0x3995ad[_0xf73f('0x25')]=_[_0xf73f('0x24')](_0x466596['interface'])?util[_0xf73f('0x21')]('SIP/%s',_0x466596[_0xf73f('0x20')]):_0x466596[_0xf73f('0x25')];_0x3995ad['membername']=_0x466596['name'];_0x3995ad[_0xf73f('0x1f')]=_0x466596[_0xf73f('0x1f')];RpcMemberReport[_0xf73f('0x19')](_0x3995ad);}};Report['prototype'][_0xf73f('0x46')]=function(_0x2f49b3){RpcVoiceTransferReport[_0xf73f('0x42')][_0x2f49b3[_0xf73f('0x56')]]=_0x2f49b3;};Report[_0xf73f('0x1c')][_0xf73f('0x1b')]=function(_0x10d05c){RpcVoiceTransferReport[_0xf73f('0x1b')](_0x10d05c);};module[_0xf73f('0x57')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 0b1828d..f6fa4de 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 _0x1e8c=['exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','trunks','agents','telephones','syncRegistry','bind','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','error','inspect','then','catch','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','state','debug','[userReport][registry]','username','stateRegistry','merge','omit','event','actionid','format','trunk:%s','name','trunk:save','syncDeviceState','device','[userReport][devicestatechange]','local','toLowerCase','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','find','phone','accountcode','peer','address','registered','status','updateStatusRealtime','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]'];(function(_0x52edc9,_0x49e92f){var _0x4b2993=function(_0x9d7cff){while(--_0x9d7cff){_0x52edc9['push'](_0x52edc9['shift']());}};_0x4b2993(++_0x49e92f);}(_0x1e8c,0x1b1));var _0xc1e8=function(_0x38622b,_0x3cfdf7){_0x38622b=_0x38622b-0x0;var _0x2c1a7a=_0x1e8c[_0x38622b];return _0x2c1a7a;};'use strict';var _=require(_0xc1e8('0x0'));var moment=require(_0xc1e8('0x1'));var util=require(_0xc1e8('0x2'));var Redis=require(_0xc1e8('0x3'));var BPromise=require(_0xc1e8('0x4'));var config=require(_0xc1e8('0x5'));var logger=require(_0xc1e8('0x6'))(_0xc1e8('0x7'));var ami=require('../ami');config[_0xc1e8('0x8')]=_[_0xc1e8('0x9')](config[_0xc1e8('0x8')],{'host':_0xc1e8('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc1e8('0x8')]));function UserReport(_0x288c6e){this['trunks']=_0x288c6e[_0xc1e8('0xb')];this[_0xc1e8('0xc')]=_0x288c6e[_0xc1e8('0xc')];this['telephones']=_0x288c6e[_0xc1e8('0xd')];ami['on']('registryentry',this[_0xc1e8('0xe')]['bind'](this));ami['on']('registry',this['syncRegistry'][_0xc1e8('0xf')](this));ami['on'](_0xc1e8('0x10'),this['syncDeviceState']['bind'](this));ami['on'](_0xc1e8('0x11'),this[_0xc1e8('0x12')][_0xc1e8('0xf')](this));return this[_0xc1e8('0x13')]();}function showSipRegistrations(){Promise[_0xc1e8('0x14')]()['then'](ami['actionSipShowRegistry']())['catch'](function(_0xdb5cb2){logger[_0xc1e8('0x15')]('[userReport][sipshowregistry]',util[_0xc1e8('0x16')](_0xdb5cb2,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xc1e8('0x14')]()[_0xc1e8('0x17')](ami['actionDeviceStateList']())[_0xc1e8('0x18')](function(_0x20c80a){logger[_0xc1e8('0x15')]('[userReport][devicestatelist]',util[_0xc1e8('0x16')](_0x20c80a,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xc1e8('0x14')]()[_0xc1e8('0x17')](ami[_0xc1e8('0x19')]())[_0xc1e8('0x18')](function(_0x200b68){logger['error'](_0xc1e8('0x1a'),util[_0xc1e8('0x16')](_0x200b68,{'showHidden':![],'depth':null}));});}UserReport[_0xc1e8('0x1b')][_0xc1e8('0x13')]=function(){setInterval(function(){BPromise[_0xc1e8('0x14')]()[_0xc1e8('0x17')](showSipRegistrations())[_0xc1e8('0x17')](listDeviceStates())[_0xc1e8('0x17')](showPeersStatus());},0x32c8);};UserReport[_0xc1e8('0x1b')]['isNotNull']=function(_0x539ddf){return _0x539ddf!==null&&!_[_0xc1e8('0x1c')](_0x539ddf);};UserReport[_0xc1e8('0x1b')][_0xc1e8('0x1d')]=function(_0x34d93e,_0x272535,_0x126b3f){io['to'](_0x34d93e)[_0xc1e8('0x1d')](_0x272535,_0x126b3f);};UserReport[_0xc1e8('0x1b')][_0xc1e8('0xe')]=function(_0x2fec82){try{if(this[_0xc1e8('0x1e')](_0x2fec82)){logger[_0xc1e8('0x1f')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x2fec82['username'],_0x2fec82[_0xc1e8('0x20')]);logger[_0xc1e8('0x21')](_0xc1e8('0x22'),util[_0xc1e8('0x16')](_0x2fec82,{'showHidden':![],'depth':null}));var _0x51d414=_['find'](this['trunks'],{'defaultuser':_0x2fec82[_0xc1e8('0x23')]});if(_0x51d414){_0x2fec82[_0xc1e8('0x24')]=_0x2fec82[_0xc1e8('0x20')];_[_0xc1e8('0x25')](_0x51d414,_[_0xc1e8('0x26')](_0x2fec82,[_0xc1e8('0x27'),_0xc1e8('0x28'),'username',_0xc1e8('0x20')]));logger[_0xc1e8('0x21')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0xc1e8('0x16')](_0x51d414,{'showHidden':![],'depth':null}));this['emit'](util[_0xc1e8('0x29')](_0xc1e8('0x2a'),_0x51d414[_0xc1e8('0x2b')]),_0xc1e8('0x2c'),_0x51d414);}}}catch(_0x3f4873){logger[_0xc1e8('0x15')]('[userReport][registry]',util[_0xc1e8('0x16')](_0x3f4873,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xc1e8('0x2d')]=function(_0x462752){try{if(this[_0xc1e8('0x1e')](_0x462752)){logger[_0xc1e8('0x1f')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x462752[_0xc1e8('0x2e')],_0x462752[_0xc1e8('0x20')]);logger[_0xc1e8('0x21')](_0xc1e8('0x2f'),util[_0xc1e8('0x16')](_0x462752,{'showHidden':![],'depth':null}));if(this['agents'][_0x462752[_0xc1e8('0x2e')]]){if(!this['agents'][_0x462752['device']][_0xc1e8('0x30')]||_0x462752[_0xc1e8('0x20')][_0xc1e8('0x31')]()=='inuse'){this[_0xc1e8('0xc')][_0x462752[_0xc1e8('0x2e')]]['local']=![];if(this['agents'][_0x462752[_0xc1e8('0x2e')]][_0xc1e8('0x20')]!==_0x462752[_0xc1e8('0x20')][_0xc1e8('0x31')]()){this[_0xc1e8('0xc')][_0x462752[_0xc1e8('0x2e')]][_0xc1e8('0x32')]=_['toNumber'](moment()[_0xc1e8('0x29')]('x'));}this[_0xc1e8('0xc')][_0x462752['device']]['state']=_0x462752['state'][_0xc1e8('0x31')]();this[_0xc1e8('0xc')][_0x462752[_0xc1e8('0x2e')]]['updateStatusRealtime'](_0x462752);}}else if(this[_0xc1e8('0xd')][_0x462752[_0xc1e8('0x2e')]]){if(this[_0xc1e8('0xd')][_0x462752['device']][_0xc1e8('0x20')]!==_0x462752[_0xc1e8('0x20')][_0xc1e8('0x31')]()){this[_0xc1e8('0xd')][_0x462752[_0xc1e8('0x2e')]][_0xc1e8('0x32')]=_[_0xc1e8('0x33')](moment()[_0xc1e8('0x29')]('x'));}this[_0xc1e8('0xd')][_0x462752[_0xc1e8('0x2e')]][_0xc1e8('0x20')]=_0x462752['state']['toLowerCase']();logger[_0xc1e8('0x21')](_0xc1e8('0x34'),util[_0xc1e8('0x16')](this['telephones'][_0x462752[_0xc1e8('0x2e')]],{'showHidden':![],'depth':null}));this[_0xc1e8('0x1d')](util[_0xc1e8('0x29')]('telephone:%s',this['telephones'][_0x462752[_0xc1e8('0x2e')]]['name']),'telephone:save',this[_0xc1e8('0xd')][_0x462752[_0xc1e8('0x2e')]]);}else if(this['trunks'][_0x462752[_0xc1e8('0x2e')]]){if(this[_0xc1e8('0xb')][_0x462752[_0xc1e8('0x2e')]][_0xc1e8('0x20')]!==_0x462752['state']['toLowerCase']()){this['trunks'][_0x462752[_0xc1e8('0x2e')]]['stateTime']=_['toNumber'](moment()[_0xc1e8('0x29')]('x'));}this['trunks'][_0x462752[_0xc1e8('0x2e')]][_0xc1e8('0x20')]=_0x462752[_0xc1e8('0x20')][_0xc1e8('0x31')]();logger[_0xc1e8('0x21')](_0xc1e8('0x35'),util[_0xc1e8('0x16')](this['trunks'][_0x462752[_0xc1e8('0x2e')]],{'showHidden':![],'depth':null}));this[_0xc1e8('0x1d')](util['format'](_0xc1e8('0x2a'),this[_0xc1e8('0xb')][_0x462752[_0xc1e8('0x2e')]]['name']),'trunk:save',this[_0xc1e8('0xb')][_0x462752[_0xc1e8('0x2e')]]);}else if(_[_0xc1e8('0x36')](_0x462752[_0xc1e8('0x2e')],_0xc1e8('0x37'))){var _0x5ce06c=_0x462752[_0xc1e8('0x2e')];var _0x3aeb85=_0x5ce06c[_0xc1e8('0x38')](_0x5ce06c[_0xc1e8('0x39')]('/')+0x1,_0x5ce06c[_0xc1e8('0x39')]('@'));var _0x40856b=_[_0xc1e8('0x3a')](this[_0xc1e8('0xc')],function(_0x36da05){return _0x36da05['mobile']==_0x3aeb85||_0x36da05[_0xc1e8('0x3b')]==_0x3aeb85||_0x36da05[_0xc1e8('0x3c')]==_0x3aeb85;});if(_0x40856b){if(_0x40856b[_0xc1e8('0x20')]!==_0x462752[_0xc1e8('0x20')][_0xc1e8('0x31')]()){_0x40856b[_0xc1e8('0x32')]=_['toNumber'](moment()[_0xc1e8('0x29')]('x'));}_0x40856b[_0xc1e8('0x20')]=_0x462752['state'][_0xc1e8('0x31')]();_0x40856b['local']=!![];_0x40856b['updateStatusRealtime'](_0x462752);}}}}catch(_0x5a9867){logger[_0xc1e8('0x15')](_0xc1e8('0x2f'),util[_0xc1e8('0x16')](_0x5a9867,{'showHidden':![],'depth':null}));}};UserReport[_0xc1e8('0x1b')][_0xc1e8('0x12')]=function(_0x419f8b){try{if(this[_0xc1e8('0x1e')](_0x419f8b)&&this[_0xc1e8('0x1e')](_0x419f8b[_0xc1e8('0x11')])){logger[_0xc1e8('0x1f')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x419f8b[_0xc1e8('0x3d')],_0x419f8b[_0xc1e8('0x3e')],_0x419f8b['peerstatus']);logger[_0xc1e8('0x21')]('[userReport][peerstatus]',util['inspect'](_0x419f8b,{'showHidden':![],'depth':null}));if(this['agents'][_0x419f8b[_0xc1e8('0x3d')]]){if(!this[_0xc1e8('0xc')][_0x419f8b[_0xc1e8('0x3d')]][_0xc1e8('0x30')]||_0x419f8b[_0xc1e8('0x11')][_0xc1e8('0x31')]()==_0xc1e8('0x3f')){this[_0xc1e8('0xc')][_0x419f8b[_0xc1e8('0x3d')]][_0xc1e8('0x30')]=![];this[_0xc1e8('0xc')][_0x419f8b[_0xc1e8('0x3d')]][_0xc1e8('0x40')]=_0x419f8b[_0xc1e8('0x11')][_0xc1e8('0x31')]();this[_0xc1e8('0xc')][_0x419f8b[_0xc1e8('0x3d')]]['address']=_0x419f8b['address'];this[_0xc1e8('0xc')][_0x419f8b[_0xc1e8('0x3d')]][_0xc1e8('0x41')](_0x419f8b);}}else if(this[_0xc1e8('0xd')][_0x419f8b[_0xc1e8('0x3d')]]){this[_0xc1e8('0xd')][_0x419f8b['peer']][_0xc1e8('0x40')]=_0x419f8b[_0xc1e8('0x11')]['toLowerCase']();this['telephones'][_0x419f8b[_0xc1e8('0x3d')]][_0xc1e8('0x3e')]=_0x419f8b['address'];logger['debug'](_0xc1e8('0x42'),util[_0xc1e8('0x16')](this[_0xc1e8('0xd')][_0x419f8b['peer']],{'showHidden':![],'depth':null}));this[_0xc1e8('0x1d')](util['format'](_0xc1e8('0x43'),this[_0xc1e8('0xd')][_0x419f8b[_0xc1e8('0x3d')]][_0xc1e8('0x2b')]),_0xc1e8('0x44'),this[_0xc1e8('0xd')][_0x419f8b[_0xc1e8('0x3d')]]);}else if(this['trunks'][_0x419f8b[_0xc1e8('0x3d')]]){this['trunks'][_0x419f8b[_0xc1e8('0x3d')]][_0xc1e8('0x40')]=_0x419f8b['peerstatus'][_0xc1e8('0x31')]();this[_0xc1e8('0xb')][_0x419f8b['peer']][_0xc1e8('0x3e')]=_0x419f8b['address'];logger['debug'](_0xc1e8('0x45'),util['inspect'](this[_0xc1e8('0xb')][_0x419f8b[_0xc1e8('0x3d')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('trunk:%s',this[_0xc1e8('0xb')][_0x419f8b[_0xc1e8('0x3d')]][_0xc1e8('0x2b')]),_0xc1e8('0x2c'),this['trunks'][_0x419f8b[_0xc1e8('0x3d')]]);}}}catch(_0x29e745){logger['error'](_0xc1e8('0x46'),util['inspect'](_0x29e745,{'showHidden':![],'depth':null}));}};module[_0xc1e8('0x47')]=UserReport; \ No newline at end of file +var _0x7b6d=['telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','error','[userReport][sipshowregistry]','actionDeviceStateList','catch','[userReport][devicestatelist]','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','merge','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','inuse','toLowerCase','stateTime','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','agents'];(function(_0x5b8736,_0x348588){var _0x4dfe79=function(_0x43cc37){while(--_0x43cc37){_0x5b8736['push'](_0x5b8736['shift']());}};_0x4dfe79(++_0x348588);}(_0x7b6d,0x94));var _0xd7b6=function(_0x1b4bdf,_0x1755f8){_0x1b4bdf=_0x1b4bdf-0x0;var _0x2a1695=_0x7b6d[_0x1b4bdf];return _0x2a1695;};'use strict';var _=require(_0xd7b6('0x0'));var moment=require(_0xd7b6('0x1'));var util=require(_0xd7b6('0x2'));var Redis=require(_0xd7b6('0x3'));var BPromise=require(_0xd7b6('0x4'));var config=require(_0xd7b6('0x5'));var logger=require(_0xd7b6('0x6'))(_0xd7b6('0x7'));var ami=require(_0xd7b6('0x8'));config[_0xd7b6('0x9')]=_['defaults'](config[_0xd7b6('0x9')],{'host':_0xd7b6('0xa'),'port':0x18eb});var io=require(_0xd7b6('0xb'))(new Redis(config[_0xd7b6('0x9')]));function UserReport(_0x6e1676){this[_0xd7b6('0xc')]=_0x6e1676[_0xd7b6('0xc')];this['agents']=_0x6e1676[_0xd7b6('0xd')];this[_0xd7b6('0xe')]=_0x6e1676[_0xd7b6('0xe')];ami['on'](_0xd7b6('0xf'),this[_0xd7b6('0x10')]['bind'](this));ami['on'](_0xd7b6('0x11'),this[_0xd7b6('0x10')][_0xd7b6('0x12')](this));ami['on'](_0xd7b6('0x13'),this[_0xd7b6('0x14')][_0xd7b6('0x12')](this));ami['on'](_0xd7b6('0x15'),this[_0xd7b6('0x16')][_0xd7b6('0x12')](this));return this[_0xd7b6('0x17')]();}function showSipRegistrations(){Promise[_0xd7b6('0x18')]()[_0xd7b6('0x19')](ami[_0xd7b6('0x1a')]())['catch'](function(_0x3ac25b){logger[_0xd7b6('0x1b')](_0xd7b6('0x1c'),util['inspect'](_0x3ac25b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xd7b6('0x18')]()[_0xd7b6('0x19')](ami[_0xd7b6('0x1d')]())[_0xd7b6('0x1e')](function(_0x18e160){logger['error'](_0xd7b6('0x1f'),util[_0xd7b6('0x20')](_0x18e160,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xd7b6('0x18')]()[_0xd7b6('0x19')](ami[_0xd7b6('0x21')]())[_0xd7b6('0x1e')](function(_0x14f09d){logger[_0xd7b6('0x1b')](_0xd7b6('0x22'),util[_0xd7b6('0x20')](_0x14f09d,{'showHidden':![],'depth':null}));});}UserReport[_0xd7b6('0x23')][_0xd7b6('0x17')]=function(){setInterval(function(){BPromise[_0xd7b6('0x18')]()['then'](showSipRegistrations())['then'](listDeviceStates())[_0xd7b6('0x19')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0xd7b6('0x24')]=function(_0x450b5f){return _0x450b5f!==null&&!_[_0xd7b6('0x25')](_0x450b5f);};UserReport[_0xd7b6('0x23')][_0xd7b6('0x26')]=function(_0x275b8c,_0x2f9402,_0x469522){io['to'](_0x275b8c)['emit'](_0x2f9402,_0x469522);};UserReport[_0xd7b6('0x23')][_0xd7b6('0x10')]=function(_0x3d0587){try{if(this['isNotNull'](_0x3d0587)){logger['info'](_0xd7b6('0x27'),_0x3d0587[_0xd7b6('0x28')],_0x3d0587[_0xd7b6('0x29')]);logger[_0xd7b6('0x2a')](_0xd7b6('0x2b'),util['inspect'](_0x3d0587,{'showHidden':![],'depth':null}));var _0x1b96bc=_[_0xd7b6('0x2c')](this[_0xd7b6('0xc')],{'defaultuser':_0x3d0587['username']});if(_0x1b96bc){_0x3d0587[_0xd7b6('0x2d')]=_0x3d0587['state'];_[_0xd7b6('0x2e')](_0x1b96bc,_[_0xd7b6('0x2f')](_0x3d0587,['event',_0xd7b6('0x30'),_0xd7b6('0x28'),_0xd7b6('0x29')]));logger['debug'](_0xd7b6('0x31'),util[_0xd7b6('0x20')](_0x1b96bc,{'showHidden':![],'depth':null}));this[_0xd7b6('0x26')](util[_0xd7b6('0x32')](_0xd7b6('0x33'),_0x1b96bc[_0xd7b6('0x34')]),_0xd7b6('0x35'),_0x1b96bc);}}}catch(_0x14246f){logger[_0xd7b6('0x1b')](_0xd7b6('0x2b'),util['inspect'](_0x14246f,{'showHidden':![],'depth':null}));}};UserReport[_0xd7b6('0x23')][_0xd7b6('0x14')]=function(_0x14cca6){try{if(this['isNotNull'](_0x14cca6)){logger[_0xd7b6('0x36')](_0xd7b6('0x37'),_0x14cca6[_0xd7b6('0x38')],_0x14cca6['state']);logger['debug'](_0xd7b6('0x39'),util[_0xd7b6('0x20')](_0x14cca6,{'showHidden':![],'depth':null}));if(this['agents'][_0x14cca6[_0xd7b6('0x38')]]){if(!this[_0xd7b6('0xd')][_0x14cca6[_0xd7b6('0x38')]][_0xd7b6('0x3a')]||_0x14cca6[_0xd7b6('0x29')]['toLowerCase']()==_0xd7b6('0x3b')){this[_0xd7b6('0xd')][_0x14cca6['device']][_0xd7b6('0x3a')]=![];if(this[_0xd7b6('0xd')][_0x14cca6[_0xd7b6('0x38')]][_0xd7b6('0x29')]!==_0x14cca6[_0xd7b6('0x29')][_0xd7b6('0x3c')]()){this[_0xd7b6('0xd')][_0x14cca6[_0xd7b6('0x38')]][_0xd7b6('0x3d')]=_['toNumber'](moment()[_0xd7b6('0x32')]('x'));}this[_0xd7b6('0xd')][_0x14cca6[_0xd7b6('0x38')]][_0xd7b6('0x29')]=_0x14cca6[_0xd7b6('0x29')][_0xd7b6('0x3c')]();this[_0xd7b6('0xd')][_0x14cca6[_0xd7b6('0x38')]][_0xd7b6('0x3e')](_0x14cca6);}}else if(this[_0xd7b6('0xe')][_0x14cca6[_0xd7b6('0x38')]]){if(this[_0xd7b6('0xe')][_0x14cca6[_0xd7b6('0x38')]][_0xd7b6('0x29')]!==_0x14cca6['state']['toLowerCase']()){this['telephones'][_0x14cca6[_0xd7b6('0x38')]]['stateTime']=_[_0xd7b6('0x3f')](moment()[_0xd7b6('0x32')]('x'));}this['telephones'][_0x14cca6['device']][_0xd7b6('0x29')]=_0x14cca6[_0xd7b6('0x29')][_0xd7b6('0x3c')]();logger[_0xd7b6('0x2a')](_0xd7b6('0x40'),util[_0xd7b6('0x20')](this[_0xd7b6('0xe')][_0x14cca6['device']],{'showHidden':![],'depth':null}));this[_0xd7b6('0x26')](util[_0xd7b6('0x32')](_0xd7b6('0x41'),this[_0xd7b6('0xe')][_0x14cca6[_0xd7b6('0x38')]][_0xd7b6('0x34')]),_0xd7b6('0x42'),this[_0xd7b6('0xe')][_0x14cca6[_0xd7b6('0x38')]]);}else if(this['trunks'][_0x14cca6['device']]){if(this[_0xd7b6('0xc')][_0x14cca6[_0xd7b6('0x38')]][_0xd7b6('0x29')]!==_0x14cca6['state'][_0xd7b6('0x3c')]()){this[_0xd7b6('0xc')][_0x14cca6['device']][_0xd7b6('0x3d')]=_[_0xd7b6('0x3f')](moment()[_0xd7b6('0x32')]('x'));}this[_0xd7b6('0xc')][_0x14cca6[_0xd7b6('0x38')]][_0xd7b6('0x29')]=_0x14cca6[_0xd7b6('0x29')]['toLowerCase']();logger[_0xd7b6('0x2a')](_0xd7b6('0x43'),util['inspect'](this['trunks'][_0x14cca6[_0xd7b6('0x38')]],{'showHidden':![],'depth':null}));this[_0xd7b6('0x26')](util[_0xd7b6('0x32')](_0xd7b6('0x33'),this[_0xd7b6('0xc')][_0x14cca6['device']][_0xd7b6('0x34')]),'trunk:save',this[_0xd7b6('0xc')][_0x14cca6['device']]);}else if(_[_0xd7b6('0x44')](_0x14cca6['device'],_0xd7b6('0x45'))){var _0x4047f8=_0x14cca6[_0xd7b6('0x38')];var _0x33c0a1=_0x4047f8[_0xd7b6('0x46')](_0x4047f8['indexOf']('/')+0x1,_0x4047f8['indexOf']('@'));var _0x4f8fd1=_[_0xd7b6('0x2c')](this[_0xd7b6('0xd')],function(_0x2a00b0){return _0x2a00b0[_0xd7b6('0x47')]==_0x33c0a1||_0x2a00b0[_0xd7b6('0x48')]==_0x33c0a1||_0x2a00b0[_0xd7b6('0x49')]==_0x33c0a1;});if(_0x4f8fd1){if(_0x4f8fd1[_0xd7b6('0x29')]!==_0x14cca6[_0xd7b6('0x29')][_0xd7b6('0x3c')]()){_0x4f8fd1['stateTime']=_[_0xd7b6('0x3f')](moment()['format']('x'));}_0x4f8fd1[_0xd7b6('0x29')]=_0x14cca6['state']['toLowerCase']();_0x4f8fd1[_0xd7b6('0x3a')]=!![];_0x4f8fd1[_0xd7b6('0x3e')](_0x14cca6);}}}}catch(_0x14260a){logger[_0xd7b6('0x1b')](_0xd7b6('0x39'),util[_0xd7b6('0x20')](_0x14260a,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xd7b6('0x16')]=function(_0x3f6138){try{if(this[_0xd7b6('0x24')](_0x3f6138)&&this[_0xd7b6('0x24')](_0x3f6138['peerstatus'])){logger[_0xd7b6('0x36')](_0xd7b6('0x4a'),_0x3f6138[_0xd7b6('0x4b')],_0x3f6138[_0xd7b6('0x4c')],_0x3f6138[_0xd7b6('0x15')]);logger[_0xd7b6('0x2a')]('[userReport][peerstatus]',util[_0xd7b6('0x20')](_0x3f6138,{'showHidden':![],'depth':null}));if(this[_0xd7b6('0xd')][_0x3f6138[_0xd7b6('0x4b')]]){if(!this[_0xd7b6('0xd')][_0x3f6138[_0xd7b6('0x4b')]]['local']||_0x3f6138[_0xd7b6('0x15')]['toLowerCase']()==_0xd7b6('0x4d')){this[_0xd7b6('0xd')][_0x3f6138[_0xd7b6('0x4b')]][_0xd7b6('0x3a')]=![];this['agents'][_0x3f6138[_0xd7b6('0x4b')]][_0xd7b6('0x4e')]=_0x3f6138[_0xd7b6('0x15')][_0xd7b6('0x3c')]();this[_0xd7b6('0xd')][_0x3f6138[_0xd7b6('0x4b')]][_0xd7b6('0x4c')]=_0x3f6138[_0xd7b6('0x4c')];this['agents'][_0x3f6138[_0xd7b6('0x4b')]][_0xd7b6('0x3e')](_0x3f6138);}}else if(this[_0xd7b6('0xe')][_0x3f6138[_0xd7b6('0x4b')]]){this['telephones'][_0x3f6138[_0xd7b6('0x4b')]]['status']=_0x3f6138[_0xd7b6('0x15')][_0xd7b6('0x3c')]();this[_0xd7b6('0xe')][_0x3f6138[_0xd7b6('0x4b')]][_0xd7b6('0x4c')]=_0x3f6138['address'];logger['debug'](_0xd7b6('0x4f'),util[_0xd7b6('0x20')](this['telephones'][_0x3f6138[_0xd7b6('0x4b')]],{'showHidden':![],'depth':null}));this[_0xd7b6('0x26')](util['format'](_0xd7b6('0x41'),this[_0xd7b6('0xe')][_0x3f6138[_0xd7b6('0x4b')]]['name']),'telephone:save',this[_0xd7b6('0xe')][_0x3f6138[_0xd7b6('0x4b')]]);}else if(this['trunks'][_0x3f6138['peer']]){this[_0xd7b6('0xc')][_0x3f6138[_0xd7b6('0x4b')]][_0xd7b6('0x4e')]=_0x3f6138[_0xd7b6('0x15')][_0xd7b6('0x3c')]();this[_0xd7b6('0xc')][_0x3f6138['peer']][_0xd7b6('0x4c')]=_0x3f6138[_0xd7b6('0x4c')];logger[_0xd7b6('0x2a')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util['inspect'](this['trunks'][_0x3f6138[_0xd7b6('0x4b')]],{'showHidden':![],'depth':null}));this[_0xd7b6('0x26')](util['format'](_0xd7b6('0x33'),this[_0xd7b6('0xc')][_0x3f6138[_0xd7b6('0x4b')]][_0xd7b6('0x34')]),'trunk:save',this[_0xd7b6('0xc')][_0x3f6138[_0xd7b6('0x4b')]]);}}}catch(_0x17bc69){logger[_0xd7b6('0x1b')](_0xd7b6('0x50'),util[_0xd7b6('0x20')](_0x17bc69,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index c62ceb5..cf28c7d 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 _0x8bc8=['omit','event','privilege','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','interface','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','membername','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','destconnectedlinenum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','agentringnoanswerAt','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','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:','agentcompleteAt','agent','talktime','acw','acwtime','acwTimeout','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][agentcomplete]','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%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','complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','syncAgentCalled','bind','syncAgentConnect','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','hangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','prototype','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','isUndefined','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','variables','merge'];(function(_0x5b57af,_0x53d5fe){var _0x105cac=function(_0x4353b5){while(--_0x4353b5){_0x5b57af['push'](_0x5b57af['shift']());}};_0x105cac(++_0x53d5fe);}(_0x8bc8,0x1a5));var _0x88bc=function(_0x2d4310,_0x2c4294){_0x2d4310=_0x2d4310-0x0;var _0x52099f=_0x8bc8[_0x2d4310];return _0x52099f;};'use strict';var _=require(_0x88bc('0x0'));var moment=require(_0x88bc('0x1'));var util=require(_0x88bc('0x2'));var Redis=require('ioredis');var config=require(_0x88bc('0x3'));var logger=require(_0x88bc('0x4'))(_0x88bc('0x5'));var ami=require(_0x88bc('0x6'));config[_0x88bc('0x7')]=_[_0x88bc('0x8')](config[_0x88bc('0x7')],{'host':_0x88bc('0x9'),'port':0x18eb});var io=require(_0x88bc('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x22ba8b){this[_0x88bc('0xb')]={};this[_0x88bc('0xc')]=_0x22ba8b['channels'];this[_0x88bc('0xd')]=_0x22ba8b['voiceQueues'];this[_0x88bc('0xe')]=_0x22ba8b[_0x88bc('0xe')];this['variables']={};ami['on']('agentcalled',this[_0x88bc('0xf')][_0x88bc('0x10')](this));ami['on']('agentconnect',this[_0x88bc('0x11')]['bind'](this));ami['on']('agentringnoanswer',this[_0x88bc('0x12')][_0x88bc('0x10')](this));ami['on']('queuecallerabandon',this[_0x88bc('0x13')][_0x88bc('0x10')](this));ami['on'](_0x88bc('0x14'),this['syncAgentComplete'][_0x88bc('0x10')](this));ami['on'](_0x88bc('0x15'),this[_0x88bc('0x16')][_0x88bc('0x10')](this));ami['on'](_0x88bc('0x17'),this['syncHangup'][_0x88bc('0x10')](this));ami['on']('musiconholdstart',this[_0x88bc('0x18')]['bind'](this));ami['on'](_0x88bc('0x19'),this[_0x88bc('0x1a')][_0x88bc('0x10')](this));ami['on'](_0x88bc('0x1b'),this[_0x88bc('0x1c')][_0x88bc('0x10')](this));ami['on'](_0x88bc('0x1d'),this[_0x88bc('0x1e')]['bind'](this));}VoiceAgentReport['prototype'][_0x88bc('0x1f')]=function(_0x1e333b,_0x577aa1,_0x256170){io['to'](_0x1e333b)[_0x88bc('0x1f')](_0x577aa1,_0x256170);};VoiceAgentReport[_0x88bc('0x20')][_0x88bc('0x21')]=function(_0x4c4743){return _0x4c4743!==null&&!_['isUndefined'](_0x4c4743);};VoiceAgentReport[_0x88bc('0x20')][_0x88bc('0xf')]=function(_0x3d2524){try{if(this['isNotNull'](_0x3d2524)){logger[_0x88bc('0x22')](_0x88bc('0x23'),_0x3d2524['uniqueid'],_0x3d2524['membername'],_0x3d2524[_0x88bc('0x24')]);logger['debug'](_0x88bc('0x25'),_0x3d2524['uniqueid'],util[_0x88bc('0x26')](_0x3d2524,{'showHidden':![],'depth':null}));if(_[_0x88bc('0x27')](this['channels'][_0x3d2524['uniqueid']])){this[_0x88bc('0xb')][_0x3d2524[_0x88bc('0x28')]]={};}if(_[_0x88bc('0x27')](this['channels'][_0x3d2524['uniqueid']][_0x3d2524[_0x88bc('0x24')]])){this[_0x88bc('0xb')][_0x3d2524[_0x88bc('0x28')]][_0x3d2524[_0x88bc('0x24')]]={'agentcalledAt':moment()[_0x88bc('0x29')](_0x88bc('0x2a')),'lastevent':_0x88bc('0x2b'),'mandatoryDisposition':this[_0x88bc('0xd')][_0x3d2524[_0x88bc('0x2c')]]?this[_0x88bc('0xd')][_0x3d2524[_0x88bc('0x2c')]][_0x88bc('0x2d')]||![]:![],'type':this[_0x88bc('0xd')][_0x3d2524[_0x88bc('0x2c')]]?this[_0x88bc('0xd')][_0x3d2524[_0x88bc('0x2c')]][_0x88bc('0x2e')]||_0x88bc('0x2f'):'inbound','variables':this[_0x88bc('0x30')][_0x3d2524[_0x88bc('0x28')]],'motionChannel':'voice'};}_[_0x88bc('0x31')](this[_0x88bc('0xb')][_0x3d2524[_0x88bc('0x28')]][_0x3d2524[_0x88bc('0x24')]],_[_0x88bc('0x32')](_0x3d2524,[_0x88bc('0x33'),_0x88bc('0x34')]));logger[_0x88bc('0x35')](_0x88bc('0x36'),_0x3d2524[_0x88bc('0x28')],util[_0x88bc('0x26')](this[_0x88bc('0xb')][_0x3d2524['uniqueid']][_0x3d2524[_0x88bc('0x24')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcalled',this[_0x88bc('0xb')][_0x3d2524[_0x88bc('0x28')]][_0x3d2524[_0x88bc('0x24')]]);var _0x7bd49d={'id':this[_0x88bc('0xe')][_0x3d2524[_0x88bc('0x37')]]['id'],'calleridnum':this['channels'][_0x3d2524['uniqueid']][_0x3d2524[_0x88bc('0x24')]][_0x88bc('0x38')],'queue':this[_0x88bc('0xb')][_0x3d2524[_0x88bc('0x28')]][_0x3d2524['destuniqueid']][_0x88bc('0x2c')],'variables':this[_0x88bc('0xb')][_0x3d2524[_0x88bc('0x28')]][_0x3d2524[_0x88bc('0x24')]]['variables']};logger[_0x88bc('0x35')](_0x88bc('0x39'),_0x3d2524[_0x88bc('0x28')],util[_0x88bc('0x26')](_0x7bd49d,{'showHidden':![],'depth':null}));this[_0x88bc('0x1f')](util[_0x88bc('0x29')]('user:%s',_0x3d2524[_0x88bc('0x3a')]),'user:called',_0x7bd49d);}}catch(_0x100123){logger[_0x88bc('0x3b')](_0x88bc('0x3c'),_0x3d2524[_0x88bc('0x28')],util[_0x88bc('0x26')](_0x100123,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88bc('0x20')][_0x88bc('0x11')]=function(_0x5a3bbf){try{if(this[_0x88bc('0x21')](_0x5a3bbf)){if(this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]]){logger[_0x88bc('0x35')](_0x88bc('0x3d'),_0x5a3bbf[_0x88bc('0x28')],util['inspect'](_0x5a3bbf,{'showHidden':![],'depth':null}));for(var _0x56e114 in this[_0x88bc('0xb')][_0x5a3bbf['uniqueid']]){if(this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x88bc('0x3e')](_0x56e114)){if(_0x5a3bbf['destuniqueid']===_0x56e114){logger[_0x88bc('0x22')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x5a3bbf[_0x88bc('0x28')],_0x5a3bbf[_0x88bc('0x3a')],_0x5a3bbf[_0x88bc('0x24')]);this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114][_0x88bc('0x3f')]=moment()[_0x88bc('0x29')](_0x88bc('0x2a'));this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114][_0x88bc('0x40')]=_0x5a3bbf[_0x88bc('0x40')];this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114][_0x88bc('0x41')]=_0x5a3bbf['connectedlinenum'];this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114]['destchannelstate']=_0x5a3bbf[_0x88bc('0x42')];this['channels'][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114][_0x88bc('0x43')]=_0x5a3bbf['destchannelstatedesc'];this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114][_0x88bc('0x44')]=_0x5a3bbf[_0x88bc('0x44')];this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114][_0x88bc('0x45')]=_0x88bc('0x46');if(this[_0x88bc('0xc')][this['channels'][_0x5a3bbf['uniqueid']][_0x56e114]['uniqueid']]){var _0x380fd8=this[_0x88bc('0xc')][this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114]['uniqueid']][_0x88bc('0x47')];this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114]['routealias']=_0x380fd8;_0x5a3bbf[_0x88bc('0x47')]=_0x380fd8;}_[_0x88bc('0x31')](this[_0x88bc('0xe')][_0x5a3bbf[_0x88bc('0x37')]],_['pick'](_0x5a3bbf,['queue',_0x88bc('0x48'),_0x88bc('0x47')]));logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x5a3bbf['uniqueid'],util[_0x88bc('0x26')](this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x5a3bbf[_0x88bc('0x24')]],{'showHidden':![],'depth':null}));ami[_0x88bc('0x1f')]('custom:agentconnect',this['channels'][_0x5a3bbf[_0x88bc('0x28')]][_0x5a3bbf[_0x88bc('0x24')]]);logger[_0x88bc('0x35')](_0x88bc('0x49'),_0x5a3bbf[_0x88bc('0x28')],util['inspect'](this['channels'][_0x5a3bbf[_0x88bc('0x28')]][_0x5a3bbf[_0x88bc('0x24')]],{'showHidden':![],'depth':null}));this[_0x88bc('0x1f')](util[_0x88bc('0x29')](_0x88bc('0x4a'),_0x5a3bbf[_0x88bc('0x3a')]),'user:agentconnect',this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x5a3bbf[_0x88bc('0x24')]]);}else if(!this[_0x88bc('0xb')][_0x5a3bbf['uniqueid']][_0x56e114]['agentringnoanswer']&&!this['channels'][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114]['agentcomplete']){logger['info'](_0x88bc('0x4b'),_0x5a3bbf[_0x88bc('0x28')],this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114][_0x88bc('0x3a')],_0x56e114);this[_0x88bc('0xb')][_0x5a3bbf['uniqueid']][_0x56e114]['agentringnoanswer']=!![];this[_0x88bc('0xb')][_0x5a3bbf['uniqueid']][_0x56e114]['agentringnoanswerAt']=moment()[_0x88bc('0x29')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114][_0x88bc('0x4c')]=_0x5a3bbf[_0x88bc('0x24')];this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114][_0x88bc('0x4d')]=_0x5a3bbf[_0x88bc('0x3a')];this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114]['lastevent']=_0x88bc('0x4e');this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114][_0x88bc('0x4f')]=_0x88bc('0x4e');logger[_0x88bc('0x35')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x5a3bbf[_0x88bc('0x28')],util['inspect'](this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114],{'showHidden':![],'depth':null}));ami['emit'](_0x88bc('0x50'),this[_0x88bc('0xb')][_0x5a3bbf[_0x88bc('0x28')]][_0x56e114]);}}}}}}catch(_0xf2ba8b){logger[_0x88bc('0x3b')](_0x88bc('0x51'),_0x5a3bbf[_0x88bc('0x28')],util['inspect'](_0xf2ba8b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88bc('0x20')][_0x88bc('0x12')]=function(_0x21b963){try{if(this[_0x88bc('0x21')](_0x21b963)){logger['debug'](_0x88bc('0x52'),_0x21b963[_0x88bc('0x28')],util['inspect'](_0x21b963,{'showHidden':![],'depth':null}));if(this[_0x88bc('0xb')][_0x21b963[_0x88bc('0x28')]]&&this[_0x88bc('0xb')][_0x21b963[_0x88bc('0x28')]][_0x21b963[_0x88bc('0x24')]]){logger[_0x88bc('0x22')](_0x88bc('0x53'),_0x21b963[_0x88bc('0x28')],_0x21b963['membername'],_0x21b963[_0x88bc('0x24')]);this['channels'][_0x21b963['uniqueid']][_0x21b963[_0x88bc('0x24')]]['agentringnoanswer']=!![];this[_0x88bc('0xb')][_0x21b963[_0x88bc('0x28')]][_0x21b963[_0x88bc('0x24')]][_0x88bc('0x54')]=moment()[_0x88bc('0x29')](_0x88bc('0x2a'));this['channels'][_0x21b963[_0x88bc('0x28')]][_0x21b963[_0x88bc('0x24')]][_0x88bc('0x45')]=_0x88bc('0x55');this[_0x88bc('0xb')][_0x21b963[_0x88bc('0x28')]][_0x21b963['destuniqueid']][_0x88bc('0x4f')]=_0x88bc('0x55');logger[_0x88bc('0x35')](_0x88bc('0x56'),_0x21b963['uniqueid'],util['inspect'](this[_0x88bc('0xb')][_0x21b963[_0x88bc('0x28')]][_0x21b963[_0x88bc('0x24')]],{'showHidden':![],'depth':null}));ami[_0x88bc('0x1f')]('custom:agentringnoanswer',this['channels'][_0x21b963['uniqueid']][_0x21b963[_0x88bc('0x24')]]);}}}catch(_0x5a314d){logger['error'](_0x88bc('0x57'),_0x21b963['uniqueid'],util[_0x88bc('0x26')](_0x5a314d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88bc('0x20')][_0x88bc('0x13')]=function(_0x4646e5){try{if(this[_0x88bc('0x21')](_0x4646e5)){logger['debug'](_0x88bc('0x58'),_0x4646e5[_0x88bc('0x28')],util[_0x88bc('0x26')](_0x4646e5,{'showHidden':![],'depth':null}));if(this[_0x88bc('0xb')][_0x4646e5[_0x88bc('0x28')]]){for(var _0x3f5ef5 in this[_0x88bc('0xb')][_0x4646e5['uniqueid']]){if(this[_0x88bc('0xb')][_0x4646e5[_0x88bc('0x28')]][_0x88bc('0x3e')](_0x3f5ef5)&&!this['channels'][_0x4646e5['uniqueid']][_0x3f5ef5][_0x88bc('0x59')]&&!this[_0x88bc('0xb')][_0x4646e5[_0x88bc('0x28')]][_0x3f5ef5][_0x88bc('0x14')]){logger[_0x88bc('0x22')](_0x88bc('0x5a'),_0x4646e5[_0x88bc('0x28')],this[_0x88bc('0xb')][_0x4646e5[_0x88bc('0x28')]][_0x3f5ef5][_0x88bc('0x3a')],_0x3f5ef5);this[_0x88bc('0xb')][_0x4646e5[_0x88bc('0x28')]][_0x3f5ef5][_0x88bc('0x59')]=!![];this['channels'][_0x4646e5[_0x88bc('0x28')]][_0x3f5ef5][_0x88bc('0x54')]=moment()[_0x88bc('0x29')](_0x88bc('0x2a'));this['channels'][_0x4646e5[_0x88bc('0x28')]][_0x3f5ef5]['lastevent']=_0x88bc('0x5b');this[_0x88bc('0xb')][_0x4646e5[_0x88bc('0x28')]][_0x3f5ef5][_0x88bc('0x4f')]=_0x88bc('0x5b');logger[_0x88bc('0x35')](_0x88bc('0x5c'),_0x4646e5[_0x88bc('0x28')],util[_0x88bc('0x26')](this['channels'][_0x4646e5['uniqueid']][_0x3f5ef5],{'showHidden':![],'depth':null}));ami[_0x88bc('0x1f')](_0x88bc('0x5d'),this[_0x88bc('0xb')][_0x4646e5['uniqueid']][_0x3f5ef5]);}}}}}catch(_0x4beed9){logger[_0x88bc('0x3b')](_0x88bc('0x5e'),_0x4646e5['uniqueid'],util['inspect'](_0x4beed9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88bc('0x20')]['syncAgentComplete']=function(_0xf88af5){try{if(this[_0x88bc('0x21')](_0xf88af5)){logger[_0x88bc('0x35')](_0x88bc('0x5f'),_0xf88af5[_0x88bc('0x28')],util[_0x88bc('0x26')](_0xf88af5,{'showHidden':![],'depth':null}));if(this['channels'][_0xf88af5[_0x88bc('0x28')]]){for(var _0x4dec61 in this['channels'][_0xf88af5['uniqueid']]){if(this[_0x88bc('0xb')][_0xf88af5[_0x88bc('0x28')]][_0x88bc('0x3e')](_0x4dec61)){if(this[_0x88bc('0xb')][_0xf88af5[_0x88bc('0x28')]][_0x4dec61]['agentconnectAt']&&!this[_0x88bc('0xb')][_0xf88af5[_0x88bc('0x28')]][_0x4dec61][_0x88bc('0x14')]){logger[_0x88bc('0x22')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xf88af5[_0x88bc('0x28')],this[_0x88bc('0xb')][_0xf88af5['uniqueid']][_0x4dec61]['membername'],_0x4dec61);this[_0x88bc('0xb')][_0xf88af5[_0x88bc('0x28')]][_0x4dec61][_0x88bc('0x14')]=!![];this['channels'][_0xf88af5[_0x88bc('0x28')]][_0x4dec61][_0x88bc('0x60')]=moment()[_0x88bc('0x29')](_0x88bc('0x2a'));this[_0x88bc('0xb')][_0xf88af5['uniqueid']][_0x4dec61][_0x88bc('0x45')]='complete';this[_0x88bc('0xb')][_0xf88af5['uniqueid']][_0x4dec61][_0x88bc('0x4f')]=_0xf88af5['reason']=='transfer'?_0x88bc('0x61'):_0xf88af5[_0x88bc('0x4f')];this[_0x88bc('0xb')][_0xf88af5['uniqueid']][_0x4dec61][_0x88bc('0x62')]=_0xf88af5[_0x88bc('0x62')];if(this[_0x88bc('0xd')][_0xf88af5[_0x88bc('0x2c')]]&&this[_0x88bc('0xd')][_0xf88af5[_0x88bc('0x2c')]][_0x88bc('0x63')]){this[_0x88bc('0xb')][_0xf88af5[_0x88bc('0x28')]][_0x4dec61][_0x88bc('0x64')]=this['voiceQueues'][_0xf88af5[_0x88bc('0x2c')]][_0x88bc('0x65')];this[_0x88bc('0xb')][_0xf88af5[_0x88bc('0x28')]][_0x4dec61]['agentacw']=!![];}this[_0x88bc('0xe')][_0xf88af5[_0x88bc('0x37')]]=_[_0x88bc('0x32')](this[_0x88bc('0xe')][_0xf88af5[_0x88bc('0x37')]],['queue',_0x88bc('0x48')]);logger['debug'](_0x88bc('0x66'),_0xf88af5['uniqueid'],util[_0x88bc('0x26')](this['channels'][_0xf88af5['uniqueid']][_0x4dec61],{'showHidden':![],'depth':null}));ami['emit'](_0x88bc('0x67'),this[_0x88bc('0xb')][_0xf88af5[_0x88bc('0x28')]][_0x4dec61]);logger['debug'](_0x88bc('0x68'),_0xf88af5['uniqueid'],util[_0x88bc('0x26')]({'id':this[_0x88bc('0xe')][_0xf88af5['interface']]['id'],'destaccountcode':_0xf88af5[_0x88bc('0x69')]},{'showHidden':![],'depth':null}));this[_0x88bc('0x1f')](util[_0x88bc('0x29')](_0x88bc('0x4a'),_0xf88af5[_0x88bc('0x3a')]),'user:agentcomplete',{'id':this[_0x88bc('0xe')][_0xf88af5['interface']]['id'],'destaccountcode':_0xf88af5['destaccountcode']});}}}}}}catch(_0x38ba9d){logger['error'](_0x88bc('0x6a'),_0xf88af5['uniqueid'],util[_0x88bc('0x26')](_0x38ba9d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88bc('0x20')]['syncVarSet']=function(_0x4a92e7){try{if(this[_0x88bc('0x21')](_0x4a92e7)){logger[_0x88bc('0x35')]('[%s][voiceAgentReport][varset]\x20event:',_0x4a92e7[_0x88bc('0x28')],util[_0x88bc('0x26')](_0x4a92e7,{'showHidden':![],'depth':null}));this[_0x88bc('0x6b')](_0x4a92e7[_0x88bc('0x28')],_[_0x88bc('0x6c')](_0x4a92e7[_0x88bc('0x6d')])[0x0],_0x4a92e7[_0x88bc('0x6e')]);if(this[_0x88bc('0xb')][_0x4a92e7['uniqueid']]){for(var _0x4f2c7f in this[_0x88bc('0xb')][_0x4a92e7['uniqueid']]){if(this[_0x88bc('0xb')][_0x4a92e7['uniqueid']][_0x88bc('0x3e')](_0x4f2c7f)){logger[_0x88bc('0x22')](_0x88bc('0x6f'),_0x4a92e7[_0x88bc('0x28')],_0x4f2c7f,_[_0x88bc('0x6c')](_0x4a92e7[_0x88bc('0x6d')])[0x0],_0x4a92e7[_0x88bc('0x6e')]);if(_[_0x88bc('0x27')](this[_0x88bc('0xb')][_0x4a92e7[_0x88bc('0x28')]][_0x4f2c7f][_0x88bc('0x30')])){this[_0x88bc('0xb')][_0x4a92e7[_0x88bc('0x28')]][_0x4f2c7f][_0x88bc('0x30')]={};}this['channels'][_0x4a92e7[_0x88bc('0x28')]][_0x4f2c7f][_0x88bc('0x30')]=this[_0x88bc('0x30')][_0x4a92e7[_0x88bc('0x28')]];}}}}}catch(_0x3c7c8b){logger[_0x88bc('0x3b')](_0x88bc('0x70'),_0x4a92e7[_0x88bc('0x28')],util['inspect'](_0x3c7c8b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x392545,_0x3ee9bf,_0x393331){var _0x3b7ac9=[_0x88bc('0x71'),_0x88bc('0x72'),_0x88bc('0x73'),'rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0x88bc('0x74'),'rtpaudioqosrttbridged',_0x88bc('0x75'),_0x88bc('0x76'),_0x88bc('0x77'),_0x88bc('0x78'),_0x88bc('0x79'),_0x88bc('0x7a'),_0x88bc('0x7b'),_0x88bc('0x7c'),_0x88bc('0x3a'),'memberpenalty',_0x88bc('0x7d')];if(!_[_0x88bc('0x7e')](_0x3ee9bf)&&!_[_0x88bc('0x7f')](_0x3b7ac9,_0x3ee9bf)){if(_['isUndefined'](this['variables'][_0x392545])){this[_0x88bc('0x30')][_0x392545]={};}this[_0x88bc('0x30')][_0x392545][_0x3ee9bf]=_0x393331;}};VoiceAgentReport[_0x88bc('0x20')][_0x88bc('0x80')]=function(_0xf2797f){try{if(this[_0x88bc('0x21')](_0xf2797f)){logger[_0x88bc('0x35')](_0x88bc('0x81'),_0xf2797f[_0x88bc('0x28')],util[_0x88bc('0x26')](_0xf2797f,{'showHidden':![],'depth':null}));if(this[_0x88bc('0xb')][_0xf2797f['uniqueid']]){for(var _0x471f12 in this['channels'][_0xf2797f[_0x88bc('0x28')]]){if(this[_0x88bc('0xb')][_0xf2797f['uniqueid']][_0x88bc('0x3e')](_0x471f12)){if(this[_0x88bc('0xb')][_0xf2797f[_0x88bc('0x28')]][_0x471f12]['reason']==_0x88bc('0x82')&&this['channels'][_0xf2797f[_0x88bc('0x28')]][_0x471f12][_0x88bc('0x14')]){logger[_0x88bc('0x22')](_0x88bc('0x83'),_0xf2797f['uniqueid'],_0x471f12);this[_0x88bc('0xb')][_0xf2797f['uniqueid']][_0x471f12][_0x88bc('0x60')]=moment()[_0x88bc('0x29')](_0x88bc('0x2a'));}}}logger[_0x88bc('0x35')](_0x88bc('0x84'),_0xf2797f['uniqueid'],util[_0x88bc('0x26')](_[_0x88bc('0x85')](this[_0x88bc('0xb')][_0xf2797f[_0x88bc('0x28')]]),{'showHidden':![],'depth':null}));ami[_0x88bc('0x1f')](_0x88bc('0x86'),_['values'](this['channels'][_0xf2797f[_0x88bc('0x28')]]));delete this[_0x88bc('0xb')][_0xf2797f['uniqueid']];}if(this[_0x88bc('0x30')][_0xf2797f[_0x88bc('0x28')]]){delete this[_0x88bc('0x30')][_0xf2797f['uniqueid']];}}}catch(_0x3eeec2){logger['error'](_0x88bc('0x87'),_0xf2797f['uniqueid'],util[_0x88bc('0x26')](_0x3eeec2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88bc('0x20')]['syncAttendedTransfer']=function(_0x548778){try{if(this[_0x88bc('0x21')](_0x548778)){logger[_0x88bc('0x35')](_0x88bc('0x88'),_0x548778[_0x88bc('0x28')],util['inspect'](_0x548778,{'showHidden':![],'depth':null}));if(this[_0x88bc('0xb')][_0x548778[_0x88bc('0x89')]]){for(var _0x216cb3 in this['channels'][_0x548778[_0x88bc('0x89')]]){if(this[_0x88bc('0xb')][_0x548778[_0x88bc('0x89')]][_0x88bc('0x3e')](_0x216cb3)){if(_0x548778[_0x88bc('0x8a')]===_0x216cb3){logger[_0x88bc('0x22')](_0x88bc('0x8b'),_0x548778['uniqueid'],this[_0x88bc('0xb')][_0x548778[_0x88bc('0x89')]][_0x216cb3][_0x88bc('0x3a')],_0x216cb3);var _0x4b5ee9=moment();this['channels'][_0x548778[_0x88bc('0x89')]][_0x216cb3][_0x88bc('0x14')]=!![];this['channels'][_0x548778[_0x88bc('0x89')]][_0x216cb3][_0x88bc('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x88bc('0xb')][_0x548778['transfereeuniqueid']][_0x216cb3][_0x88bc('0x45')]=_0x88bc('0x8c');this[_0x88bc('0xb')][_0x548778[_0x88bc('0x89')]][_0x216cb3][_0x88bc('0x4f')]=_0x88bc('0x82');this[_0x88bc('0xb')][_0x548778[_0x88bc('0x89')]][_0x216cb3][_0x88bc('0x62')]=_0x4b5ee9[_0x88bc('0x8d')](this[_0x88bc('0xb')][_0x548778[_0x88bc('0x89')]][_0x216cb3][_0x88bc('0x3f')],'seconds');}}}}if(this[_0x88bc('0xb')][_0x548778[_0x88bc('0x8e')]]){var _0x5b42c6=this[_0x88bc('0xb')][_0x548778[_0x88bc('0x8e')]];this[_0x88bc('0xb')][_0x548778[_0x88bc('0x8e')]]=this[_0x88bc('0xb')][_0x548778[_0x88bc('0x89')]];this[_0x88bc('0xb')][_0x548778[_0x88bc('0x89')]]=_0x5b42c6;}}}catch(_0x1e329c){logger[_0x88bc('0x3b')](_0x88bc('0x8f'),_0x548778['uniqueid'],util[_0x88bc('0x26')](_0x1e329c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88bc('0x20')][_0x88bc('0x1e')]=function(_0x3e7cef){try{if(this['isNotNull'](_0x3e7cef)){logger[_0x88bc('0x35')](_0x88bc('0x90'),_0x3e7cef[_0x88bc('0x28')],util[_0x88bc('0x26')](_0x3e7cef,{'showHidden':![],'depth':null}));if(this[_0x88bc('0xb')][_0x3e7cef[_0x88bc('0x89')]]){for(var _0x4bd7be in this[_0x88bc('0xb')][_0x3e7cef[_0x88bc('0x89')]]){if(this[_0x88bc('0xb')][_0x3e7cef[_0x88bc('0x89')]][_0x88bc('0x3e')](_0x4bd7be)){if(_0x3e7cef['transfereruniqueid']===_0x4bd7be){logger[_0x88bc('0x22')](_0x88bc('0x91'),_0x3e7cef['uniqueid'],this[_0x88bc('0xb')][_0x3e7cef[_0x88bc('0x89')]][_0x4bd7be][_0x88bc('0x3a')],_0x4bd7be);var _0x4aaafb=moment();this[_0x88bc('0xb')][_0x3e7cef[_0x88bc('0x89')]][_0x4bd7be]['agentcomplete']=!![];this[_0x88bc('0xb')][_0x3e7cef['transfereeuniqueid']][_0x4bd7be]['agentcompleteAt']=_0x4aaafb;this[_0x88bc('0xb')][_0x3e7cef[_0x88bc('0x89')]][_0x4bd7be][_0x88bc('0x45')]=_0x88bc('0x8c');this['channels'][_0x3e7cef[_0x88bc('0x89')]][_0x4bd7be][_0x88bc('0x4f')]=_0x88bc('0x82');this[_0x88bc('0xb')][_0x3e7cef[_0x88bc('0x89')]][_0x4bd7be]['talktime']=_0x4aaafb[_0x88bc('0x8d')](this[_0x88bc('0xb')][_0x3e7cef[_0x88bc('0x89')]][_0x4bd7be][_0x88bc('0x3f')],'seconds');}}}}}}catch(_0xb5ece5){logger[_0x88bc('0x3b')](_0x88bc('0x92'),_0x3e7cef[_0x88bc('0x28')],util[_0x88bc('0x26')](_0xb5ece5,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x88bc('0x18')]=function(_0x5785d1){var _0x35d6b8='';try{if(this[_0x88bc('0x21')](_0x5785d1)){logger[_0x88bc('0x35')](_0x88bc('0x93'),_0x5785d1['uniqueid'],util[_0x88bc('0x26')](_0x5785d1,{'showHidden':![],'depth':null}));if(_0x5785d1[_0x88bc('0x94')]){_0x35d6b8=_0x5785d1[_0x88bc('0x94')]['substring'](0x0,_0x5785d1[_0x88bc('0x94')][_0x88bc('0x95')]('-'));if(this['agents'][_0x35d6b8]){logger[_0x88bc('0x22')](_0x88bc('0x96'),_0x5785d1['uniqueid'],_0x35d6b8);this[_0x88bc('0xe')][_0x35d6b8]['onhold']=!![];}}}}catch(_0x5c66e4){logger[_0x88bc('0x3b')](_0x88bc('0x97'),_0x5785d1['uniqueid'],util[_0x88bc('0x26')](_0x5c66e4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88bc('0x20')][_0x88bc('0x1a')]=function(_0x1f06a6){var _0x602a37='';try{if(this[_0x88bc('0x21')](_0x1f06a6)){logger[_0x88bc('0x35')](_0x88bc('0x98'),_0x1f06a6[_0x88bc('0x28')],util[_0x88bc('0x26')](_0x1f06a6,{'showHidden':![],'depth':null}));if(_0x1f06a6[_0x88bc('0x94')]){_0x602a37=_0x1f06a6[_0x88bc('0x94')]['substring'](0x0,_0x1f06a6[_0x88bc('0x94')]['lastIndexOf']('-'));if(this[_0x88bc('0xe')][_0x602a37]){logger[_0x88bc('0x22')](_0x88bc('0x99'),_0x1f06a6[_0x88bc('0x28')],_0x602a37);this[_0x88bc('0xe')][_0x602a37][_0x88bc('0x9a')]=![];}}}}catch(_0x21a886){logger['error'](_0x88bc('0x9b'),_0x1f06a6[_0x88bc('0x28')],util[_0x88bc('0x26')](_0x21a886,{'showHidden':![],'depth':null}));}};module[_0x88bc('0x9c')]=VoiceAgentReport; \ No newline at end of file +var _0x60f8=['../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','bind','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isUndefined','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','debug','inspect','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','isNotNull','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','agent','talktime','acw','acwTimeout','agentacw','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][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','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberrealtime','isNil','syncHangup','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','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:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','lodash','moment','util','ioredis'];(function(_0x5608ac,_0x4b7f2d){var _0x37d04a=function(_0x192366){while(--_0x192366){_0x5608ac['push'](_0x5608ac['shift']());}};_0x37d04a(++_0x4b7f2d);}(_0x60f8,0x94));var _0x860f=function(_0x46a7ab,_0x39f289){_0x46a7ab=_0x46a7ab-0x0;var _0x1b8196=_0x60f8[_0x46a7ab];return _0x1b8196;};'use strict';var _=require(_0x860f('0x0'));var moment=require(_0x860f('0x1'));var util=require(_0x860f('0x2'));var Redis=require(_0x860f('0x3'));var config=require('../../../config/environment');var logger=require(_0x860f('0x4'))(_0x860f('0x5'));var ami=require(_0x860f('0x6'));config[_0x860f('0x7')]=_[_0x860f('0x8')](config[_0x860f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x860f('0x9'))(new Redis(config[_0x860f('0x7')]));function VoiceAgentReport(_0x484b91){this[_0x860f('0xa')]={};this[_0x860f('0xb')]=_0x484b91[_0x860f('0xa')];this[_0x860f('0xc')]=_0x484b91[_0x860f('0xc')];this[_0x860f('0xd')]=_0x484b91[_0x860f('0xd')];this[_0x860f('0xe')]={};ami['on'](_0x860f('0xf'),this['syncAgentCalled']['bind'](this));ami['on'](_0x860f('0x10'),this[_0x860f('0x11')]['bind'](this));ami['on'](_0x860f('0x12'),this[_0x860f('0x13')][_0x860f('0x14')](this));ami['on']('queuecallerabandon',this[_0x860f('0x15')][_0x860f('0x14')](this));ami['on'](_0x860f('0x16'),this[_0x860f('0x17')][_0x860f('0x14')](this));ami['on'](_0x860f('0x18'),this[_0x860f('0x19')][_0x860f('0x14')](this));ami['on'](_0x860f('0x1a'),this['syncHangup'][_0x860f('0x14')](this));ami['on']('musiconholdstart',this[_0x860f('0x1b')]['bind'](this));ami['on'](_0x860f('0x1c'),this[_0x860f('0x1d')]['bind'](this));ami['on']('attendedtransfer',this[_0x860f('0x1e')]['bind'](this));ami['on']('blindtransfer',this[_0x860f('0x1f')][_0x860f('0x14')](this));}VoiceAgentReport[_0x860f('0x20')][_0x860f('0x21')]=function(_0x8081,_0x3c0898,_0x203372){io['to'](_0x8081)[_0x860f('0x21')](_0x3c0898,_0x203372);};VoiceAgentReport[_0x860f('0x20')]['isNotNull']=function(_0x2a97c2){return _0x2a97c2!==null&&!_[_0x860f('0x22')](_0x2a97c2);};VoiceAgentReport[_0x860f('0x20')][_0x860f('0x23')]=function(_0x5d021e){try{if(this['isNotNull'](_0x5d021e)){logger[_0x860f('0x24')](_0x860f('0x25'),_0x5d021e['uniqueid'],_0x5d021e[_0x860f('0x26')],_0x5d021e[_0x860f('0x27')]);logger[_0x860f('0x28')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x5d021e['uniqueid'],util[_0x860f('0x29')](_0x5d021e,{'showHidden':![],'depth':null}));if(_[_0x860f('0x22')](this[_0x860f('0xa')][_0x5d021e[_0x860f('0x2a')]])){this['channels'][_0x5d021e[_0x860f('0x2a')]]={};}if(_['isUndefined'](this[_0x860f('0xa')][_0x5d021e[_0x860f('0x2a')]][_0x5d021e['destuniqueid']])){this[_0x860f('0xa')][_0x5d021e[_0x860f('0x2a')]][_0x5d021e[_0x860f('0x27')]]={'agentcalledAt':moment()[_0x860f('0x2b')](_0x860f('0x2c')),'lastevent':_0x860f('0x2d'),'mandatoryDisposition':this[_0x860f('0xc')][_0x5d021e['queue']]?this[_0x860f('0xc')][_0x5d021e[_0x860f('0x2e')]][_0x860f('0x2f')]||![]:![],'type':this[_0x860f('0xc')][_0x5d021e[_0x860f('0x2e')]]?this['voiceQueues'][_0x5d021e['queue']][_0x860f('0x30')]||_0x860f('0x31'):_0x860f('0x31'),'variables':this[_0x860f('0xe')][_0x5d021e[_0x860f('0x2a')]],'motionChannel':_0x860f('0x32')};}_[_0x860f('0x33')](this['channels'][_0x5d021e['uniqueid']][_0x5d021e[_0x860f('0x27')]],_[_0x860f('0x34')](_0x5d021e,[_0x860f('0x35'),_0x860f('0x36')]));logger[_0x860f('0x28')](_0x860f('0x37'),_0x5d021e[_0x860f('0x2a')],util[_0x860f('0x29')](this['channels'][_0x5d021e[_0x860f('0x2a')]][_0x5d021e[_0x860f('0x27')]],{'showHidden':![],'depth':null}));ami[_0x860f('0x21')](_0x860f('0x38'),this[_0x860f('0xa')][_0x5d021e['uniqueid']][_0x5d021e[_0x860f('0x27')]]);var _0x409d14={'id':this['agents'][_0x5d021e[_0x860f('0x39')]]['id'],'calleridnum':this[_0x860f('0xa')][_0x5d021e[_0x860f('0x2a')]][_0x5d021e[_0x860f('0x27')]]['calleridnum'],'queue':this['channels'][_0x5d021e[_0x860f('0x2a')]][_0x5d021e[_0x860f('0x27')]][_0x860f('0x2e')],'variables':this['channels'][_0x5d021e[_0x860f('0x2a')]][_0x5d021e['destuniqueid']][_0x860f('0xe')]};logger[_0x860f('0x28')](_0x860f('0x3a'),_0x5d021e['uniqueid'],util['inspect'](_0x409d14,{'showHidden':![],'depth':null}));this[_0x860f('0x21')](util[_0x860f('0x2b')](_0x860f('0x3b'),_0x5d021e[_0x860f('0x26')]),_0x860f('0x3c'),_0x409d14);}}catch(_0x2a4d21){logger[_0x860f('0x3d')](_0x860f('0x3e'),_0x5d021e['uniqueid'],util[_0x860f('0x29')](_0x2a4d21,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x860f('0x11')]=function(_0x2b95ae){try{if(this[_0x860f('0x3f')](_0x2b95ae)){if(this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]]){logger[_0x860f('0x28')](_0x860f('0x40'),_0x2b95ae[_0x860f('0x2a')],util[_0x860f('0x29')](_0x2b95ae,{'showHidden':![],'depth':null}));for(var _0x13ded5 in this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]]){if(this['channels'][_0x2b95ae[_0x860f('0x2a')]][_0x860f('0x41')](_0x13ded5)){if(_0x2b95ae['destuniqueid']===_0x13ded5){logger['info'](_0x860f('0x42'),_0x2b95ae[_0x860f('0x2a')],_0x2b95ae[_0x860f('0x26')],_0x2b95ae['destuniqueid']);this['channels'][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5][_0x860f('0x43')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5][_0x860f('0x44')]=_0x2b95ae[_0x860f('0x44')];this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5]['connectedlinenum']=_0x2b95ae[_0x860f('0x45')];this['channels'][_0x2b95ae['uniqueid']][_0x13ded5][_0x860f('0x46')]=_0x2b95ae[_0x860f('0x46')];this[_0x860f('0xa')][_0x2b95ae['uniqueid']][_0x13ded5][_0x860f('0x47')]=_0x2b95ae[_0x860f('0x47')];this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5][_0x860f('0x48')]=_0x2b95ae['holdtime'];this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5][_0x860f('0x49')]=_0x860f('0x4a');if(this[_0x860f('0xb')][this['channels'][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5][_0x860f('0x2a')]]){var _0x333b8b=this[_0x860f('0xb')][this[_0x860f('0xa')][_0x2b95ae['uniqueid']][_0x13ded5][_0x860f('0x2a')]][_0x860f('0x4b')];this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5][_0x860f('0x4b')]=_0x333b8b;_0x2b95ae[_0x860f('0x4b')]=_0x333b8b;}_[_0x860f('0x33')](this[_0x860f('0xd')][_0x2b95ae['interface']],_['pick'](_0x2b95ae,[_0x860f('0x2e'),'destconnectedlinenum','routealias']));logger[_0x860f('0x28')](_0x860f('0x4c'),_0x2b95ae[_0x860f('0x2a')],util[_0x860f('0x29')](this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x2b95ae[_0x860f('0x27')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentconnect',this[_0x860f('0xa')][_0x2b95ae['uniqueid']][_0x2b95ae[_0x860f('0x27')]]);logger[_0x860f('0x28')](_0x860f('0x4d'),_0x2b95ae[_0x860f('0x2a')],util[_0x860f('0x29')](this[_0x860f('0xa')][_0x2b95ae['uniqueid']][_0x2b95ae[_0x860f('0x27')]],{'showHidden':![],'depth':null}));this[_0x860f('0x21')](util[_0x860f('0x2b')](_0x860f('0x3b'),_0x2b95ae[_0x860f('0x26')]),_0x860f('0x4e'),this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x2b95ae[_0x860f('0x27')]]);}else if(!this[_0x860f('0xa')][_0x2b95ae['uniqueid']][_0x13ded5][_0x860f('0x12')]&&!this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5][_0x860f('0x16')]){logger[_0x860f('0x24')](_0x860f('0x4f'),_0x2b95ae[_0x860f('0x2a')],this['channels'][_0x2b95ae['uniqueid']][_0x13ded5][_0x860f('0x26')],_0x13ded5);this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5]['agentringnoanswer']=!![];this[_0x860f('0xa')][_0x2b95ae['uniqueid']][_0x13ded5]['agentringnoanswerAt']=moment()[_0x860f('0x2b')](_0x860f('0x2c'));this[_0x860f('0xa')][_0x2b95ae['uniqueid']][_0x13ded5][_0x860f('0x50')]=_0x2b95ae[_0x860f('0x27')];this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5]['answeredelsewheremembername']=_0x2b95ae[_0x860f('0x26')];this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5][_0x860f('0x49')]='answered_elsewhere';this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5][_0x860f('0x51')]='answered_elsewhere';logger[_0x860f('0x28')](_0x860f('0x52'),_0x2b95ae[_0x860f('0x2a')],util[_0x860f('0x29')](this[_0x860f('0xa')][_0x2b95ae[_0x860f('0x2a')]][_0x13ded5],{'showHidden':![],'depth':null}));ami[_0x860f('0x21')](_0x860f('0x53'),this['channels'][_0x2b95ae['uniqueid']][_0x13ded5]);}}}}}}catch(_0x232fa0){logger[_0x860f('0x3d')](_0x860f('0x54'),_0x2b95ae[_0x860f('0x2a')],util[_0x860f('0x29')](_0x232fa0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x860f('0x20')]['syncAgentRingNoAnswer']=function(_0x4d89c0){try{if(this['isNotNull'](_0x4d89c0)){logger['debug'](_0x860f('0x55'),_0x4d89c0['uniqueid'],util[_0x860f('0x29')](_0x4d89c0,{'showHidden':![],'depth':null}));if(this[_0x860f('0xa')][_0x4d89c0[_0x860f('0x2a')]]&&this[_0x860f('0xa')][_0x4d89c0[_0x860f('0x2a')]][_0x4d89c0[_0x860f('0x27')]]){logger['info'](_0x860f('0x56'),_0x4d89c0[_0x860f('0x2a')],_0x4d89c0[_0x860f('0x26')],_0x4d89c0[_0x860f('0x27')]);this[_0x860f('0xa')][_0x4d89c0[_0x860f('0x2a')]][_0x4d89c0[_0x860f('0x27')]][_0x860f('0x12')]=!![];this[_0x860f('0xa')][_0x4d89c0[_0x860f('0x2a')]][_0x4d89c0[_0x860f('0x27')]]['agentringnoanswerAt']=moment()[_0x860f('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x860f('0xa')][_0x4d89c0[_0x860f('0x2a')]][_0x4d89c0[_0x860f('0x27')]]['lastevent']='rejected';this[_0x860f('0xa')][_0x4d89c0[_0x860f('0x2a')]][_0x4d89c0[_0x860f('0x27')]][_0x860f('0x51')]='rejected';logger['debug'](_0x860f('0x57'),_0x4d89c0[_0x860f('0x2a')],util['inspect'](this[_0x860f('0xa')][_0x4d89c0[_0x860f('0x2a')]][_0x4d89c0[_0x860f('0x27')]],{'showHidden':![],'depth':null}));ami[_0x860f('0x21')](_0x860f('0x58'),this['channels'][_0x4d89c0[_0x860f('0x2a')]][_0x4d89c0['destuniqueid']]);}}}catch(_0x334bae){logger[_0x860f('0x3d')]('[%s][voiceAgentReport][agentringnoanswer]',_0x4d89c0[_0x860f('0x2a')],util['inspect'](_0x334bae,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x860f('0x20')][_0x860f('0x15')]=function(_0x469896){try{if(this[_0x860f('0x3f')](_0x469896)){logger[_0x860f('0x28')](_0x860f('0x59'),_0x469896[_0x860f('0x2a')],util[_0x860f('0x29')](_0x469896,{'showHidden':![],'depth':null}));if(this[_0x860f('0xa')][_0x469896[_0x860f('0x2a')]]){for(var _0x36c036 in this[_0x860f('0xa')][_0x469896[_0x860f('0x2a')]]){if(this['channels'][_0x469896[_0x860f('0x2a')]][_0x860f('0x41')](_0x36c036)&&!this[_0x860f('0xa')][_0x469896[_0x860f('0x2a')]][_0x36c036][_0x860f('0x12')]&&!this['channels'][_0x469896[_0x860f('0x2a')]][_0x36c036][_0x860f('0x16')]){logger[_0x860f('0x24')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x469896[_0x860f('0x2a')],this['channels'][_0x469896[_0x860f('0x2a')]][_0x36c036]['membername'],_0x36c036);this[_0x860f('0xa')][_0x469896[_0x860f('0x2a')]][_0x36c036]['agentringnoanswer']=!![];this[_0x860f('0xa')][_0x469896['uniqueid']][_0x36c036]['agentringnoanswerAt']=moment()[_0x860f('0x2b')](_0x860f('0x2c'));this[_0x860f('0xa')][_0x469896[_0x860f('0x2a')]][_0x36c036][_0x860f('0x49')]=_0x860f('0x5a');this[_0x860f('0xa')][_0x469896['uniqueid']][_0x36c036]['reason']=_0x860f('0x5a');logger[_0x860f('0x28')](_0x860f('0x5b'),_0x469896['uniqueid'],util[_0x860f('0x29')](this[_0x860f('0xa')][_0x469896[_0x860f('0x2a')]][_0x36c036],{'showHidden':![],'depth':null}));ami[_0x860f('0x21')]('custom:agentqueuecallerabandon',this[_0x860f('0xa')][_0x469896['uniqueid']][_0x36c036]);}}}}}catch(_0x261cf8){logger[_0x860f('0x3d')](_0x860f('0x5c'),_0x469896['uniqueid'],util[_0x860f('0x29')](_0x261cf8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x860f('0x20')][_0x860f('0x17')]=function(_0x2b1c92){try{if(this[_0x860f('0x3f')](_0x2b1c92)){logger[_0x860f('0x28')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2b1c92['uniqueid'],util[_0x860f('0x29')](_0x2b1c92,{'showHidden':![],'depth':null}));if(this[_0x860f('0xa')][_0x2b1c92[_0x860f('0x2a')]]){for(var _0x504d87 in this[_0x860f('0xa')][_0x2b1c92[_0x860f('0x2a')]]){if(this[_0x860f('0xa')][_0x2b1c92[_0x860f('0x2a')]][_0x860f('0x41')](_0x504d87)){if(this[_0x860f('0xa')][_0x2b1c92[_0x860f('0x2a')]][_0x504d87]['agentconnectAt']&&!this['channels'][_0x2b1c92['uniqueid']][_0x504d87][_0x860f('0x16')]){logger['info'](_0x860f('0x5d'),_0x2b1c92['uniqueid'],this['channels'][_0x2b1c92[_0x860f('0x2a')]][_0x504d87]['membername'],_0x504d87);this['channels'][_0x2b1c92[_0x860f('0x2a')]][_0x504d87][_0x860f('0x16')]=!![];this['channels'][_0x2b1c92[_0x860f('0x2a')]][_0x504d87]['agentcompleteAt']=moment()[_0x860f('0x2b')](_0x860f('0x2c'));this[_0x860f('0xa')][_0x2b1c92[_0x860f('0x2a')]][_0x504d87][_0x860f('0x49')]=_0x860f('0x5e');this[_0x860f('0xa')][_0x2b1c92[_0x860f('0x2a')]][_0x504d87][_0x860f('0x51')]=_0x2b1c92[_0x860f('0x51')]=='transfer'?_0x860f('0x5f'):_0x2b1c92['reason'];this[_0x860f('0xa')][_0x2b1c92[_0x860f('0x2a')]][_0x504d87][_0x860f('0x60')]=_0x2b1c92[_0x860f('0x60')];if(this['voiceQueues'][_0x2b1c92[_0x860f('0x2e')]]&&this['voiceQueues'][_0x2b1c92[_0x860f('0x2e')]][_0x860f('0x61')]){this[_0x860f('0xa')][_0x2b1c92['uniqueid']][_0x504d87]['acwtime']=this['voiceQueues'][_0x2b1c92[_0x860f('0x2e')]][_0x860f('0x62')];this[_0x860f('0xa')][_0x2b1c92['uniqueid']][_0x504d87][_0x860f('0x63')]=!![];}this['agents'][_0x2b1c92[_0x860f('0x39')]]=_['omit'](this[_0x860f('0xd')][_0x2b1c92[_0x860f('0x39')]],[_0x860f('0x2e'),_0x860f('0x64')]);logger[_0x860f('0x28')](_0x860f('0x65'),_0x2b1c92['uniqueid'],util['inspect'](this['channels'][_0x2b1c92[_0x860f('0x2a')]][_0x504d87],{'showHidden':![],'depth':null}));ami[_0x860f('0x21')](_0x860f('0x66'),this[_0x860f('0xa')][_0x2b1c92[_0x860f('0x2a')]][_0x504d87]);logger[_0x860f('0x28')](_0x860f('0x67'),_0x2b1c92[_0x860f('0x2a')],util[_0x860f('0x29')]({'id':this['agents'][_0x2b1c92[_0x860f('0x39')]]['id'],'destaccountcode':_0x2b1c92['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x860f('0x21')](util['format'](_0x860f('0x3b'),_0x2b1c92[_0x860f('0x26')]),_0x860f('0x68'),{'id':this[_0x860f('0xd')][_0x2b1c92[_0x860f('0x39')]]['id'],'destaccountcode':_0x2b1c92['destaccountcode']});}}}}}}catch(_0x5a854c){logger[_0x860f('0x3d')](_0x860f('0x69'),_0x2b1c92[_0x860f('0x2a')],util[_0x860f('0x29')](_0x5a854c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x860f('0x20')][_0x860f('0x19')]=function(_0x30a16e){try{if(this[_0x860f('0x3f')](_0x30a16e)){logger[_0x860f('0x28')](_0x860f('0x6a'),_0x30a16e[_0x860f('0x2a')],util[_0x860f('0x29')](_0x30a16e,{'showHidden':![],'depth':null}));this[_0x860f('0x6b')](_0x30a16e['uniqueid'],_[_0x860f('0x6c')](_0x30a16e[_0x860f('0x6d')])[0x0],_0x30a16e[_0x860f('0x6e')]);if(this[_0x860f('0xa')][_0x30a16e[_0x860f('0x2a')]]){for(var _0x589de3 in this[_0x860f('0xa')][_0x30a16e[_0x860f('0x2a')]]){if(this[_0x860f('0xa')][_0x30a16e[_0x860f('0x2a')]][_0x860f('0x41')](_0x589de3)){logger[_0x860f('0x24')](_0x860f('0x6f'),_0x30a16e[_0x860f('0x2a')],_0x589de3,_[_0x860f('0x6c')](_0x30a16e['variable'])[0x0],_0x30a16e[_0x860f('0x6e')]);if(_[_0x860f('0x22')](this[_0x860f('0xa')][_0x30a16e['uniqueid']][_0x589de3]['variables'])){this[_0x860f('0xa')][_0x30a16e[_0x860f('0x2a')]][_0x589de3]['variables']={};}this[_0x860f('0xa')][_0x30a16e[_0x860f('0x2a')]][_0x589de3][_0x860f('0xe')]=this['variables'][_0x30a16e[_0x860f('0x2a')]];}}}}}catch(_0x483e3f){logger[_0x860f('0x3d')](_0x860f('0x70'),_0x30a16e[_0x860f('0x2a')],util[_0x860f('0x29')](_0x483e3f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x860f('0x20')]['addVariable']=function(_0x2bfbea,_0x5cfe3a,_0xf14588){var _0x519cc4=[_0x860f('0x71'),_0x860f('0x72'),_0x860f('0x73'),'rtpaudioqosjitterbridged',_0x860f('0x74'),'rtpaudioqoslossbridged',_0x860f('0x75'),_0x860f('0x76'),_0x860f('0x77'),'sipuri','bridgepeer',_0x860f('0x78'),_0x860f('0x79'),_0x860f('0x7a'),'memberinterface',_0x860f('0x7b'),_0x860f('0x26'),'memberpenalty',_0x860f('0x7c')];if(!_[_0x860f('0x7d')](_0x5cfe3a)&&!_['includes'](_0x519cc4,_0x5cfe3a)){if(_[_0x860f('0x22')](this[_0x860f('0xe')][_0x2bfbea])){this['variables'][_0x2bfbea]={};}this[_0x860f('0xe')][_0x2bfbea][_0x5cfe3a]=_0xf14588;}};VoiceAgentReport[_0x860f('0x20')][_0x860f('0x7e')]=function(_0x14253b){try{if(this[_0x860f('0x3f')](_0x14253b)){logger[_0x860f('0x28')]('[%s][voiceAgentReport][hangup]\x20event:',_0x14253b[_0x860f('0x2a')],util[_0x860f('0x29')](_0x14253b,{'showHidden':![],'depth':null}));if(this[_0x860f('0xa')][_0x14253b[_0x860f('0x2a')]]){for(var _0x17cc51 in this[_0x860f('0xa')][_0x14253b[_0x860f('0x2a')]]){if(this['channels'][_0x14253b[_0x860f('0x2a')]][_0x860f('0x41')](_0x17cc51)){if(this[_0x860f('0xa')][_0x14253b['uniqueid']][_0x17cc51][_0x860f('0x51')]==_0x860f('0x7f')&&this[_0x860f('0xa')][_0x14253b[_0x860f('0x2a')]][_0x17cc51][_0x860f('0x16')]){logger[_0x860f('0x24')](_0x860f('0x80'),_0x14253b[_0x860f('0x2a')],_0x17cc51);this['channels'][_0x14253b[_0x860f('0x2a')]][_0x17cc51][_0x860f('0x81')]=moment()[_0x860f('0x2b')](_0x860f('0x2c'));}}}logger[_0x860f('0x28')](_0x860f('0x82'),_0x14253b[_0x860f('0x2a')],util['inspect'](_['values'](this['channels'][_0x14253b[_0x860f('0x2a')]]),{'showHidden':![],'depth':null}));ami['emit'](_0x860f('0x83'),_['values'](this[_0x860f('0xa')][_0x14253b[_0x860f('0x2a')]]));delete this[_0x860f('0xa')][_0x14253b[_0x860f('0x2a')]];}if(this[_0x860f('0xe')][_0x14253b[_0x860f('0x2a')]]){delete this['variables'][_0x14253b[_0x860f('0x2a')]];}}}catch(_0x42ea84){logger[_0x860f('0x3d')](_0x860f('0x84'),_0x14253b[_0x860f('0x2a')],util[_0x860f('0x29')](_0x42ea84,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x860f('0x20')][_0x860f('0x1e')]=function(_0x4e13cd){try{if(this[_0x860f('0x3f')](_0x4e13cd)){logger['debug'](_0x860f('0x85'),_0x4e13cd[_0x860f('0x2a')],util[_0x860f('0x29')](_0x4e13cd,{'showHidden':![],'depth':null}));if(this[_0x860f('0xa')][_0x4e13cd[_0x860f('0x86')]]){for(var _0x357f9f in this[_0x860f('0xa')][_0x4e13cd['transfereeuniqueid']]){if(this[_0x860f('0xa')][_0x4e13cd[_0x860f('0x86')]]['hasOwnProperty'](_0x357f9f)){if(_0x4e13cd[_0x860f('0x87')]===_0x357f9f){logger[_0x860f('0x24')](_0x860f('0x88'),_0x4e13cd[_0x860f('0x2a')],this[_0x860f('0xa')][_0x4e13cd[_0x860f('0x86')]][_0x357f9f][_0x860f('0x26')],_0x357f9f);var _0x394718=moment();this[_0x860f('0xa')][_0x4e13cd['transfereeuniqueid']][_0x357f9f][_0x860f('0x16')]=!![];this['channels'][_0x4e13cd[_0x860f('0x86')]][_0x357f9f][_0x860f('0x81')]=moment()[_0x860f('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x860f('0xa')][_0x4e13cd[_0x860f('0x86')]][_0x357f9f][_0x860f('0x49')]=_0x860f('0x5e');this[_0x860f('0xa')][_0x4e13cd[_0x860f('0x86')]][_0x357f9f][_0x860f('0x51')]=_0x860f('0x7f');this['channels'][_0x4e13cd['transfereeuniqueid']][_0x357f9f]['talktime']=_0x394718[_0x860f('0x89')](this[_0x860f('0xa')][_0x4e13cd[_0x860f('0x86')]][_0x357f9f][_0x860f('0x43')],_0x860f('0x8a'));}}}}if(this[_0x860f('0xa')][_0x4e13cd[_0x860f('0x8b')]]){var _0x5aa194=this[_0x860f('0xa')][_0x4e13cd[_0x860f('0x8b')]];this[_0x860f('0xa')][_0x4e13cd['secondtransfereruniqueid']]=this[_0x860f('0xa')][_0x4e13cd[_0x860f('0x86')]];this[_0x860f('0xa')][_0x4e13cd[_0x860f('0x86')]]=_0x5aa194;}}}catch(_0x2e4f41){logger[_0x860f('0x3d')](_0x860f('0x8c'),_0x4e13cd[_0x860f('0x2a')],util[_0x860f('0x29')](_0x2e4f41,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x860f('0x1f')]=function(_0x53234a){try{if(this[_0x860f('0x3f')](_0x53234a)){logger['debug'](_0x860f('0x8d'),_0x53234a[_0x860f('0x2a')],util['inspect'](_0x53234a,{'showHidden':![],'depth':null}));if(this['channels'][_0x53234a['transfereeuniqueid']]){for(var _0x56e331 in this['channels'][_0x53234a[_0x860f('0x86')]]){if(this[_0x860f('0xa')][_0x53234a['transfereeuniqueid']][_0x860f('0x41')](_0x56e331)){if(_0x53234a[_0x860f('0x8e')]===_0x56e331){logger[_0x860f('0x24')](_0x860f('0x8f'),_0x53234a[_0x860f('0x2a')],this['channels'][_0x53234a[_0x860f('0x86')]][_0x56e331]['membername'],_0x56e331);var _0x421978=moment();this['channels'][_0x53234a[_0x860f('0x86')]][_0x56e331][_0x860f('0x16')]=!![];this['channels'][_0x53234a[_0x860f('0x86')]][_0x56e331][_0x860f('0x81')]=_0x421978;this[_0x860f('0xa')][_0x53234a['transfereeuniqueid']][_0x56e331][_0x860f('0x49')]=_0x860f('0x5e');this[_0x860f('0xa')][_0x53234a[_0x860f('0x86')]][_0x56e331][_0x860f('0x51')]=_0x860f('0x7f');this[_0x860f('0xa')][_0x53234a[_0x860f('0x86')]][_0x56e331]['talktime']=_0x421978[_0x860f('0x89')](this[_0x860f('0xa')][_0x53234a[_0x860f('0x86')]][_0x56e331][_0x860f('0x43')],_0x860f('0x8a'));}}}}}}catch(_0xf7e6ff){logger[_0x860f('0x3d')]('[%s][voiceAgentReport][blindtransfer]',_0x53234a[_0x860f('0x2a')],util[_0x860f('0x29')](_0xf7e6ff,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x1ba3fa){var _0x726994='';try{if(this[_0x860f('0x3f')](_0x1ba3fa)){logger[_0x860f('0x28')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1ba3fa[_0x860f('0x2a')],util[_0x860f('0x29')](_0x1ba3fa,{'showHidden':![],'depth':null}));if(_0x1ba3fa['channel']){_0x726994=_0x1ba3fa[_0x860f('0x90')][_0x860f('0x91')](0x0,_0x1ba3fa[_0x860f('0x90')][_0x860f('0x92')]('-'));if(this[_0x860f('0xd')][_0x726994]){logger[_0x860f('0x24')](_0x860f('0x93'),_0x1ba3fa[_0x860f('0x2a')],_0x726994);this[_0x860f('0xd')][_0x726994]['onhold']=!![];}}}}catch(_0x46924e){logger[_0x860f('0x3d')](_0x860f('0x94'),_0x1ba3fa[_0x860f('0x2a')],util[_0x860f('0x29')](_0x46924e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x860f('0x20')][_0x860f('0x1d')]=function(_0x262186){var _0x79480='';try{if(this[_0x860f('0x3f')](_0x262186)){logger['debug'](_0x860f('0x95'),_0x262186[_0x860f('0x2a')],util[_0x860f('0x29')](_0x262186,{'showHidden':![],'depth':null}));if(_0x262186[_0x860f('0x90')]){_0x79480=_0x262186[_0x860f('0x90')][_0x860f('0x91')](0x0,_0x262186[_0x860f('0x90')][_0x860f('0x92')]('-'));if(this['agents'][_0x79480]){logger[_0x860f('0x24')](_0x860f('0x96'),_0x262186['uniqueid'],_0x79480);this[_0x860f('0xd')][_0x79480][_0x860f('0x97')]=![];}}}}catch(_0x3039be){logger[_0x860f('0x3d')]('[%s][voiceAgentReport][musiconholdstop]',_0x262186[_0x860f('0x2a')],util[_0x860f('0x29')](_0x3039be,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 951dd88..a3a524e 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 _0xc260=['[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','context','from-sip','split','exten','xcally-motion-preview','channel','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','[%s][voiceCallReport][newcallerid]','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','toNumber','pick','keys','isUndefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','queue','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','disposition','includes','cdr(','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','starttime','holdtime','diff','UserId','membername','connectedlinename','destinationchannel','channelstate','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','replace','.wav49','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','then','transferType','isEmpty','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','routeid','[%s][voiceCallReport][attendedtransfer]','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','transfereruniqueid','BLIND','BlindTransfer','transfererchannel','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','util','path','../../../config/environment','ami','../ami','../rpc/setting','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newstate','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isNotNull','emit','uniqueid','calleridname','calleridnum','debug'];(function(_0xd8d614,_0x4f0d32){var _0x361c3b=function(_0x275767){while(--_0x275767){_0xd8d614['push'](_0xd8d614['shift']());}};_0x361c3b(++_0x4f0d32);}(_0xc260,0x156));var _0x0c26=function(_0x167eb8,_0x2bd40e){_0x167eb8=_0x167eb8-0x0;var _0x4cc4b4=_0xc260[_0x167eb8];return _0x4cc4b4;};'use strict';var _=require(_0x0c26('0x0'));var moment=require(_0x0c26('0x1'));var util=require(_0x0c26('0x2'));var path=require(_0x0c26('0x3'));var Redis=require('ioredis');var config=require(_0x0c26('0x4'));var logger=require('../../../config/logger')(_0x0c26('0x5'));var ami=require(_0x0c26('0x6'));var Channel=require('../model/channel');var RpcSetting=require(_0x0c26('0x7'));var applications=[_0x0c26('0x8'),'queue',_0x0c26('0x9'),_0x0c26('0xa'),_0x0c26('0xb'),_0x0c26('0xc')];var dispositions=[_0x0c26('0xd'),'FAILED',_0x0c26('0xe'),_0x0c26('0xd'),_0x0c26('0xd'),_0x0c26('0xd'),_0x0c26('0xf'),_0x0c26('0x10'),_0x0c26('0xe'),'FAILED',_0x0c26('0xe')];config[_0x0c26('0x11')]=_[_0x0c26('0x12')](config[_0x0c26('0x11')],{'host':_0x0c26('0x13'),'port':0x18eb});var io=require(_0x0c26('0x14'))(new Redis(config[_0x0c26('0x11')]));function VoiceCallReport(_0x39726e){this['channels']=_0x39726e[_0x0c26('0x15')];this[_0x0c26('0x16')]=_0x39726e[_0x0c26('0x16')];this[_0x0c26('0x17')]={};ami['on'](_0x0c26('0x18'),this[_0x0c26('0x19')][_0x0c26('0x1a')](this));ami['on']('newexten',this['syncNewExten'][_0x0c26('0x1a')](this));ami['on']('newchannel',this['syncNewChannel'][_0x0c26('0x1a')](this));ami['on'](_0x0c26('0x1b'),this[_0x0c26('0x1c')][_0x0c26('0x1a')](this));ami['on']('varset',this[_0x0c26('0x1d')][_0x0c26('0x1a')](this));ami['on'](_0x0c26('0x1e'),this[_0x0c26('0x1f')]['bind'](this));ami['on'](_0x0c26('0x20'),this[_0x0c26('0x21')][_0x0c26('0x1a')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x0c26('0x1a')](this));ami['on']('blindtransfer',this[_0x0c26('0x22')][_0x0c26('0x1a')](this));ami['on'](_0x0c26('0x23'),this[_0x0c26('0x24')][_0x0c26('0x1a')](this));ami['on']('musiconholdstop',this[_0x0c26('0x25')][_0x0c26('0x1a')](this));try{logger[_0x0c26('0x26')](_0x0c26('0x27'));ami[_0x0c26('0x28')]();}catch(_0x5554d2){logger[_0x0c26('0x29')]('[voiceCallReport][coreshowchannels]',util[_0x0c26('0x2a')](_0x5554d2,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x0c26('0x2b')][_0x0c26('0x2c')]=function(_0x4f3dcb){return _0x4f3dcb!==null&&!_['isUndefined'](_0x4f3dcb);};VoiceCallReport[_0x0c26('0x2b')]['emit']=function(_0x115b3f,_0x180598,_0x45eb07){io['to'](_0x115b3f)[_0x0c26('0x2d')](_0x180598,_0x45eb07);};VoiceCallReport[_0x0c26('0x2b')][_0x0c26('0x21')]=function(_0xc88ca6){try{if(this[_0x0c26('0x2c')](_0xc88ca6)){logger[_0x0c26('0x26')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0xc88ca6[_0x0c26('0x2e')],_0xc88ca6[_0x0c26('0x2f')],_0xc88ca6[_0x0c26('0x30')]);logger[_0x0c26('0x31')](_0x0c26('0x32'),_0xc88ca6['uniqueid'],util[_0x0c26('0x2a')](_0xc88ca6,{'showHidden':![],'depth':null}));if(_0xc88ca6[_0x0c26('0x2e')]===_0xc88ca6[_0x0c26('0x33')]){if(!_['isUndefined'](this[_0x0c26('0x15')][_0xc88ca6[_0x0c26('0x2e')]])){_[_0x0c26('0x34')](this[_0x0c26('0x15')][_0xc88ca6[_0x0c26('0x2e')]],_['pick'](_0xc88ca6,_['keys'](this[_0x0c26('0x15')][_0xc88ca6[_0x0c26('0x2e')]])));}}if(_0xc88ca6[_0x0c26('0x35')]===_0x0c26('0x36')){if(this['agents'][_0xc88ca6['channel'][_0x0c26('0x37')]('-')[0x0]]){if(_0xc88ca6[_0x0c26('0x38')]==_0x0c26('0x39')){this['agents'][_0xc88ca6[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x3b')]=_0xc88ca6[_0x0c26('0x3c')];this['emit'](util[_0x0c26('0x3d')](_0x0c26('0x3e'),this[_0x0c26('0x16')][_0xc88ca6[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x3f')]),_0x0c26('0x40'),{'destaccountcode':this[_0x0c26('0x16')][_0xc88ca6[_0x0c26('0x3a')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0xc88ca6['connectedlinenum']});}}}}}catch(_0x5c4fd4){logger[_0x0c26('0x29')](_0x0c26('0x41'),_0xc88ca6[_0x0c26('0x2e')],util[_0x0c26('0x2a')](_0x5c4fd4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0c26('0x2b')][_0x0c26('0x42')]=function(_0x5d4be8){try{if(this['isNotNull'](_0x5d4be8)){logger[_0x0c26('0x31')](_0x0c26('0x43'),_0x5d4be8[_0x0c26('0x2e')],util[_0x0c26('0x2a')](_0x5d4be8,{'showHidden':![],'depth':null}));if(this['channels'][_0x5d4be8[_0x0c26('0x2e')]])return;if(_0x5d4be8[_0x0c26('0x3a')]==='OutgoingSpoolFailed')return;if(_0x5d4be8[_0x0c26('0x2e')]!==_0x5d4be8[_0x0c26('0x33')]&&!this[_0x0c26('0x17')][_0x5d4be8[_0x0c26('0x33')]])return;logger[_0x0c26('0x26')](_0x0c26('0x44'),_0x5d4be8[_0x0c26('0x2e')],_0x5d4be8[_0x0c26('0x35')],_0x5d4be8[_0x0c26('0x38')]);this[_0x0c26('0x15')][_0x5d4be8[_0x0c26('0x2e')]]=new Channel();this[_0x0c26('0x15')][_0x5d4be8[_0x0c26('0x2e')]]['starttime']=moment()[_0x0c26('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0c26('0x15')][_0x5d4be8[_0x0c26('0x2e')]]['disposition']=dispositions[_[_0x0c26('0x45')](_0x5d4be8['channelstate'])];_[_0x0c26('0x34')](this[_0x0c26('0x15')][_0x5d4be8['uniqueid']],_[_0x0c26('0x46')](_0x5d4be8,_[_0x0c26('0x47')](this[_0x0c26('0x15')][_0x5d4be8[_0x0c26('0x2e')]])));if(_0x5d4be8[_0x0c26('0x35')]===_0x0c26('0x36')){if(this['agents'][_0x5d4be8['channel'][_0x0c26('0x37')]('-')[0x0]]){if(_[_0x0c26('0x48')](this[_0x0c26('0x16')][_0x5d4be8[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x3b')])){this[_0x0c26('0x16')][_0x5d4be8['channel'][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x3b')]=_0x5d4be8[_0x0c26('0x38')];logger[_0x0c26('0x31')](_0x0c26('0x49'),_0x5d4be8[_0x0c26('0x2e')],util[_0x0c26('0x2a')]({'id':this[_0x0c26('0x16')][_0x5d4be8['channel'][_0x0c26('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0x0c26('0x16')][_0x5d4be8[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x4a')],'destconnectedlinenum':_0x5d4be8[_0x0c26('0x38')]},{'showHidden':![],'depth':null}));this[_0x0c26('0x2d')](util['format'](_0x0c26('0x3e'),this[_0x0c26('0x16')][_0x5d4be8[_0x0c26('0x3a')]['split']('-')[0x0]]['name']),'user:agentconnect',{'id':this[_0x0c26('0x16')][_0x5d4be8[_0x0c26('0x3a')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x0c26('0x16')][_0x5d4be8['channel'][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x4a')],'destconnectedlinenum':_0x5d4be8[_0x0c26('0x38')]});}}}}}catch(_0x497c68){logger[_0x0c26('0x29')](_0x0c26('0x4b'),_0x5d4be8[_0x0c26('0x2e')],util[_0x0c26('0x2a')](_0x497c68,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0c26('0x2b')][_0x0c26('0x19')]=function(_0x47b192){try{if(this[_0x0c26('0x2c')](_0x47b192)){logger[_0x0c26('0x31')]('[%s][voiceCallReport][newexten]\x20event:',_0x47b192['uniqueid'],util[_0x0c26('0x2a')](_0x47b192,{'showHidden':![],'depth':null}));if(_0x47b192['channel']===_0x0c26('0x4c')||_0x47b192[_0x0c26('0x38')]==='h')return;if(_0x47b192[_0x0c26('0x2e')]===_0x47b192['linkedid']||this[_0x0c26('0x17')][_0x47b192[_0x0c26('0x33')]]){_0x47b192['application']=_0x47b192[_0x0c26('0x4d')][_0x0c26('0x4e')]();_0x47b192[_0x0c26('0x4f')]=_0x47b192[_0x0c26('0x50')]||_0x47b192[_0x0c26('0x4f')];if(_0x47b192[_0x0c26('0x50')]&&!_0x47b192['appdata'][_0x0c26('0x51')](_0x0c26('0x52'))&&_0x47b192['application']!==_0x0c26('0x53')){_0x47b192['applicationdata']=_0x47b192[_0x0c26('0x4f')][_0x0c26('0x4e')]();}logger[_0x0c26('0x26')](_0x0c26('0x54'),_0x47b192['uniqueid'],_0x47b192[_0x0c26('0x4d')],_0x47b192['applicationdata']);if(_[_0x0c26('0x48')](this[_0x0c26('0x15')][_0x47b192[_0x0c26('0x2e')]])){this[_0x0c26('0x15')][_0x47b192[_0x0c26('0x2e')]]=new Channel();this[_0x0c26('0x15')][_0x47b192['uniqueid']]['starttime']=_0x47b192[_0x0c26('0x55')]?moment()['subtract'](moment[_0x0c26('0x55')](_0x47b192[_0x0c26('0x55')])[_0x0c26('0x56')](),_0x0c26('0x56'))[_0x0c26('0x3d')](_0x0c26('0x57')):moment()[_0x0c26('0x3d')](_0x0c26('0x57'));this[_0x0c26('0x15')][_0x47b192[_0x0c26('0x2e')]][_0x0c26('0x58')]='NO\x20ANSWER';}_['merge'](this[_0x0c26('0x15')][_0x47b192[_0x0c26('0x2e')]],_[_0x0c26('0x46')](_0x47b192,_['keys'](this[_0x0c26('0x15')][_0x47b192[_0x0c26('0x2e')]])));if(_[_0x0c26('0x59')](applications,_0x47b192['application'])){this[_0x0c26('0x15')][_0x47b192[_0x0c26('0x2e')]]['lastapplication']=_0x47b192[_0x0c26('0x4d')];this[_0x0c26('0x15')][_0x47b192['uniqueid']]['lastdata']=_0x47b192[_0x0c26('0x4f')];if(_0x47b192['application']===_0x0c26('0x8')&&_[_0x0c26('0x51')](_0x47b192[_0x0c26('0x4f')][_0x0c26('0x4e')](),_0x0c26('0x5a'))){var _0x43d3f0=_0x47b192[_0x0c26('0x4f')][_0x0c26('0x37')]('=');var _0x188143=_0x43d3f0[0x0][_0x0c26('0x4e')]()['match'](/cdr\((.*)\)/);if(_0x188143){if(_0x188143[0x1]===_0x0c26('0x5b')&&!_[_0x0c26('0x5c')](this[_0x0c26('0x15')][_0x47b192[_0x0c26('0x2e')]][_0x188143[0x1]]))return;this['channels'][_0x47b192[_0x0c26('0x2e')]][_0x188143[0x1]]=_0x43d3f0[0x1];}}else if(_0x47b192[_0x0c26('0x4d')]===_0x0c26('0x53')){this[_0x0c26('0x15')][_0x47b192[_0x0c26('0x2e')]][_0x0c26('0x53')]=_0x47b192[_0x0c26('0x4f')]['split'](',')[0x0];}}}}}catch(_0x2cc422){logger[_0x0c26('0x29')](_0x0c26('0x5d'),_0x47b192[_0x0c26('0x2e')],util[_0x0c26('0x2a')](_0x2cc422,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0c26('0x2b')]['syncNewState']=function(_0x55a073){try{if(this[_0x0c26('0x2c')](_0x55a073)){logger[_0x0c26('0x26')](_0x0c26('0x5e'),_0x55a073['uniqueid'],_0x55a073[_0x0c26('0x33')],_0x55a073[_0x0c26('0x2f')],_0x55a073[_0x0c26('0x30')]);logger[_0x0c26('0x31')](_0x0c26('0x5f'),_0x55a073[_0x0c26('0x2e')],util[_0x0c26('0x2a')](_0x55a073,{'showHidden':![],'depth':null}));if(_0x55a073['channelstate']!=='6')return;if(_0x55a073[_0x0c26('0x2e')]!==_0x55a073[_0x0c26('0x33')]){var _0x31ef89=moment();if(this[_0x0c26('0x15')][_0x55a073['linkedid']]){if(!this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x33')]]['answered']){this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x33')]][_0x0c26('0x60')]=!![];this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x33')]][_0x0c26('0x61')]=_0x31ef89['format'](_0x0c26('0x57'));if(this['channels'][_0x55a073[_0x0c26('0x33')]][_0x0c26('0x62')]){this[_0x0c26('0x15')][_0x55a073['linkedid']][_0x0c26('0x63')]=_0x31ef89[_0x0c26('0x64')](this['channels'][_0x55a073[_0x0c26('0x33')]]['starttime'],_0x0c26('0x56'));}}this[_0x0c26('0x15')][_0x55a073['linkedid']]['linkedid']=_0x55a073[_0x0c26('0x2e')];if(_0x55a073[_0x0c26('0x30')]!==_0x0c26('0x39')){this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x33')]]['connectedlinenum']=_0x55a073[_0x0c26('0x30')];}this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x33')]]['connectedlinename']=_0x55a073[_0x0c26('0x2f')];this['channels'][_0x55a073[_0x0c26('0x33')]]['destinationchannel']=_0x55a073[_0x0c26('0x3a')];this[_0x0c26('0x15')][_0x55a073['linkedid']][_0x0c26('0x58')]=dispositions[_[_0x0c26('0x45')](_0x55a073['channelstate'])];if(this[_0x0c26('0x16')][_0x55a073[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]]){this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x33')]][_0x0c26('0x65')]=this[_0x0c26('0x16')][_0x55a073[_0x0c26('0x3a')]['split']('-')[0x0]]['id'];this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x33')]][_0x0c26('0x66')]=this[_0x0c26('0x16')][_0x55a073[_0x0c26('0x3a')]['split']('-')[0x0]][_0x0c26('0x3f')];}}if(this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x2e')]]){if(!this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x2e')]][_0x0c26('0x60')]){this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x2e')]][_0x0c26('0x60')]=!![];this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x2e')]][_0x0c26('0x61')]=_0x31ef89[_0x0c26('0x3d')](_0x0c26('0x57'));if(this[_0x0c26('0x15')][_0x55a073['uniqueid']][_0x0c26('0x62')]){this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x2e')]]['holdtime']=_0x31ef89[_0x0c26('0x64')](this['channels'][_0x55a073[_0x0c26('0x2e')]][_0x0c26('0x62')],'seconds');}}if(_0x55a073[_0x0c26('0x30')]!==_0x0c26('0x39')){this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x2e')]]['connectedlinenum']=_0x55a073[_0x0c26('0x30')];}this['channels'][_0x55a073[_0x0c26('0x2e')]][_0x0c26('0x67')]=_0x55a073['calleridname'];this[_0x0c26('0x15')][_0x55a073['uniqueid']][_0x0c26('0x68')]=_0x55a073[_0x0c26('0x3a')];this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x2e')]][_0x0c26('0x58')]=dispositions[_[_0x0c26('0x45')](_0x55a073[_0x0c26('0x69')])];}}else{if(this[_0x0c26('0x15')][_0x55a073['uniqueid']]){if(this[_0x0c26('0x16')][_0x55a073[_0x0c26('0x3a')]['split']('-')[0x0]]){this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x2e')]]['UserId']=this[_0x0c26('0x16')][_0x55a073[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]]['id'];this['channels'][_0x55a073['uniqueid']][_0x0c26('0x66')]=this['agents'][_0x55a073['channel'][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x3f')];}}}if(_0x55a073[_0x0c26('0x35')]==='from-sip'){if(this['agents'][_0x55a073[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]]){this[_0x0c26('0x16')][_0x55a073[_0x0c26('0x3a')]['split']('-')[0x0]][_0x0c26('0x3b')]=_0x55a073[_0x0c26('0x38')];var _0x639a3c,_0x515d3c;if(this[_0x0c26('0x15')][_0x55a073['uniqueid']]){_0x639a3c=this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x2e')]][_0x0c26('0x6a')];_0x515d3c=this['channels'][_0x55a073[_0x0c26('0x2e')]]['queue'];}else if(this['channels'][_0x55a073['linkedid']]){_0x639a3c=this[_0x0c26('0x15')][_0x55a073[_0x0c26('0x33')]]['routealias'];_0x515d3c=this[_0x0c26('0x15')][_0x55a073['linkedid']]['queue'];}this['agents'][_0x55a073['channel'][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x53')]=_0x515d3c;this[_0x0c26('0x16')][_0x55a073[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x6a')]=_0x639a3c;logger['debug']('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x55a073['uniqueid'],util[_0x0c26('0x2a')]({'id':this[_0x0c26('0x16')][_0x55a073[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x55a073['channel'][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x4a')],'destconnectedlinenum':_0x55a073['exten'],'routealias':_0x639a3c,'queue':_0x515d3c||undefined},{'showHidden':![],'depth':null}));this['emit'](util[_0x0c26('0x3d')](_0x0c26('0x3e'),this[_0x0c26('0x16')][_0x55a073['channel'][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x3f')]),_0x0c26('0x40'),{'id':this[_0x0c26('0x16')][_0x55a073['channel'][_0x0c26('0x37')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x0c26('0x16')][_0x55a073[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x4a')],'destconnectedlinenum':_0x55a073['exten'],'routealias':_0x639a3c,'queue':_0x515d3c||undefined});}}}}catch(_0x588e06){logger[_0x0c26('0x29')](_0x0c26('0x6b'),_0x55a073[_0x0c26('0x2e')],util['inspect'](_0x588e06,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0c26('0x2b')][_0x0c26('0x6c')]=function(_0x2268b5,_0x1926d5){try{if(this['channels'][_0x2268b5]){logger[_0x0c26('0x26')](_0x0c26('0x6d'),_0x2268b5,_0x1926d5);this[_0x0c26('0x15')][_0x2268b5][_0x0c26('0x6e')]=!![];if(_[_0x0c26('0x6f')](_0x1926d5,'.wav49')){_0x1926d5=_0x1926d5[_0x0c26('0x70')](_0x0c26('0x71'),'.WAV');}this[_0x0c26('0x15')][_0x2268b5][_0x0c26('0x72')]=_0x1926d5;var _0x257af9=_[_0x0c26('0x73')](this[_0x0c26('0x15')][_0x2268b5][_0x0c26('0x74')],{'filename':_0x1926d5});if(_[_0x0c26('0x5c')](_0x257af9)){this[_0x0c26('0x15')][_0x2268b5]['monitors'][_0x0c26('0x75')]({'filename':_0x1926d5,'createdAt':moment()['format'](_0x0c26('0x57')),'mixmonitorid':'','status':_0x0c26('0x76')});}}}catch(_0x59cf9e){logger[_0x0c26('0x29')](_0x0c26('0x77'),_0x2268b5,util[_0x0c26('0x2a')](_0x59cf9e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0c26('0x2b')][_0x0c26('0x1d')]=function(_0x113ad6){try{if(this[_0x0c26('0x2c')](_0x113ad6)){logger['debug'](_0x0c26('0x78'),_0x113ad6[_0x0c26('0x2e')],util[_0x0c26('0x2a')](_0x113ad6,{'showHidden':![],'depth':null}));if(this['channels'][_0x113ad6['uniqueid']]&&_0x113ad6[_0x0c26('0x3a')]!=_0x0c26('0x4c')){if(this['isNotNull'](_0x113ad6[_0x0c26('0x79')])){if(this[_0x0c26('0x2c')](_0x113ad6[_0x0c26('0x79')][_0x0c26('0x7a')])){logger[_0x0c26('0x26')](_0x0c26('0x7b'),_0x113ad6[_0x0c26('0x2e')],_0x113ad6[_0x0c26('0x7c')]);this[_0x0c26('0x6c')](_0x113ad6['uniqueid'],_0x113ad6[_0x0c26('0x7c')]);}else if(this[_0x0c26('0x2c')](_0x113ad6[_0x0c26('0x79')]['xmd-phone'])){logger[_0x0c26('0x26')](_0x0c26('0x7d'),_0x113ad6[_0x0c26('0x2e')],_0x113ad6[_0x0c26('0x7c')]);this['channels'][_0x113ad6['uniqueid']][_0x0c26('0x30')]=_0x113ad6[_0x0c26('0x7c')];}else if(this['isNotNull'](_0x113ad6['variable'][_0x0c26('0x7e')])){logger[_0x0c26('0x26')](_0x0c26('0x7f'),_0x113ad6[_0x0c26('0x2e')],_0x113ad6[_0x0c26('0x7c')]);this[_0x0c26('0x15')][_0x113ad6[_0x0c26('0x2e')]]['callerid']=_0x113ad6[_0x0c26('0x7c')];}else if(this[_0x0c26('0x2c')](_0x113ad6[_0x0c26('0x79')][_0x0c26('0x80')])){logger[_0x0c26('0x26')](_0x0c26('0x81'),_0x113ad6['uniqueid'],_0x113ad6[_0x0c26('0x7c')]);this[_0x0c26('0x15')][_0x113ad6[_0x0c26('0x2e')]][_0x0c26('0x5b')]=_0x113ad6[_0x0c26('0x7c')];}else if(this[_0x0c26('0x2c')](_0x113ad6['variable'][_0x0c26('0x82')])){logger[_0x0c26('0x26')](_0x0c26('0x83'),_0x113ad6[_0x0c26('0x2e')],_0x113ad6[_0x0c26('0x7c')]['split'](',')[0x0]);this[_0x0c26('0x15')][_0x113ad6['uniqueid']][_0x0c26('0x53')]=_0x113ad6[_0x0c26('0x7c')][_0x0c26('0x37')](',')[0x0];}else if(this[_0x0c26('0x2c')](_0x113ad6[_0x0c26('0x79')][_0x0c26('0x84')])){logger[_0x0c26('0x26')](_0x0c26('0x85'),_0x113ad6[_0x0c26('0x2e')],_0x113ad6[_0x0c26('0x7c')]);this['channels'][_0x113ad6[_0x0c26('0x2e')]][_0x0c26('0x86')]=_0x113ad6[_0x0c26('0x7c')];}else if(this[_0x0c26('0x2c')](_0x113ad6[_0x0c26('0x79')][_0x0c26('0x87')])){logger['info'](_0x0c26('0x88'),_0x113ad6[_0x0c26('0x2e')],_0x113ad6['value']);this['channels'][_0x113ad6[_0x0c26('0x2e')]][_0x0c26('0x89')]=_0x113ad6[_0x0c26('0x7c')];}else if(this[_0x0c26('0x2c')](_0x113ad6[_0x0c26('0x79')][_0x0c26('0x8a')])){logger[_0x0c26('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x113ad6[_0x0c26('0x2e')],_0x113ad6[_0x0c26('0x7c')]);this[_0x0c26('0x15')][_0x113ad6[_0x0c26('0x2e')]]['calleridpreview']=_0x113ad6[_0x0c26('0x7c')];}else if(this[_0x0c26('0x2c')](_0x113ad6[_0x0c26('0x79')][_0x0c26('0x8b')])){logger[_0x0c26('0x26')](_0x0c26('0x8c'),_0x113ad6[_0x0c26('0x2e')],_0x113ad6[_0x0c26('0x7c')]);this[_0x0c26('0x15')][_0x113ad6[_0x0c26('0x2e')]][_0x0c26('0x53')]=_0x113ad6[_0x0c26('0x7c')];}else if(this[_0x0c26('0x2c')](_0x113ad6[_0x0c26('0x79')]['sipcallid'])){logger[_0x0c26('0x26')](_0x0c26('0x8d'),_0x113ad6['uniqueid'],_0x113ad6[_0x0c26('0x7c')]);this[_0x0c26('0x15')][_0x113ad6[_0x0c26('0x2e')]]['sipcalluniqueid']=_0x113ad6[_0x0c26('0x7c')];}}}else if(this[_0x0c26('0x2c')](_0x113ad6[_0x0c26('0x79')][_0x0c26('0x7a')])){if(_0x113ad6['value']){var _0x3cf49f=path[_0x0c26('0x8e')](_0x113ad6['value'])[_0x0c26('0x3f')];logger[_0x0c26('0x26')](_0x0c26('0x7b'),_0x3cf49f,_0x113ad6['value']);this[_0x0c26('0x6c')](_0x3cf49f,_0x113ad6[_0x0c26('0x7c')]);}}else if(this[_0x0c26('0x15')][_0x113ad6[_0x0c26('0x33')]]){if(this[_0x0c26('0x2c')](_0x113ad6['variable'])){if(this['isNotNull'](_0x113ad6[_0x0c26('0x79')][_0x0c26('0x8f')])){logger[_0x0c26('0x26')](_0x0c26('0x8d'),_0x113ad6[_0x0c26('0x33')],_0x113ad6[_0x0c26('0x7c')]);this[_0x0c26('0x15')][_0x113ad6[_0x0c26('0x33')]][_0x0c26('0x90')]=_0x113ad6[_0x0c26('0x7c')];}}}}}catch(_0x5b2e33){logger['error'](_0x0c26('0x91'),_0x113ad6[_0x0c26('0x2e')],util[_0x0c26('0x2a')](_0x5b2e33,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x0c26('0x1f')]=function(_0xb7aa93){try{if(this[_0x0c26('0x2c')](_0xb7aa93)){logger[_0x0c26('0x31')](_0x0c26('0x92'),_0xb7aa93[_0x0c26('0x2e')],util[_0x0c26('0x2a')](_0xb7aa93,{'showHidden':![],'depth':null}));if(this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]]){if(this[_0x0c26('0x15')][this['blindTransfers'][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x33')]]){this['channels'][this['blindTransfers'][_0xb7aa93[_0x0c26('0x33')]]['linkedid']][_0x0c26('0x2e')]=_0xb7aa93[_0x0c26('0x2e')];this[_0x0c26('0x15')][this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x33')]][_0x0c26('0x60')]=this[_0x0c26('0x15')][_0xb7aa93['uniqueid']][_0x0c26('0x60')];this[_0x0c26('0x15')][this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x33')]][_0x0c26('0x61')]=this[_0x0c26('0x15')][_0xb7aa93[_0x0c26('0x2e')]][_0x0c26('0x61')];this['channels'][this[_0x0c26('0x17')][_0xb7aa93['linkedid']][_0x0c26('0x33')]]['destinationchannel']=this[_0x0c26('0x15')][this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x33')]][_0x0c26('0x3a')];this[_0x0c26('0x15')][this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x33')]]['disposition']=this[_0x0c26('0x15')][_0xb7aa93[_0x0c26('0x2e')]][_0x0c26('0x58')];this[_0x0c26('0x15')][_0xb7aa93[_0x0c26('0x2e')]]=this[_0x0c26('0x15')][this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x33')]];delete this['channels'][this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]]['linkedid']];}else if(this['channels'][this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x2e')]]){this[_0x0c26('0x15')][this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x2e')]][_0x0c26('0x2e')]=[this[_0x0c26('0x15')][this['blindTransfers'][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x2e')]][_0x0c26('0x33')],this['channels'][this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]]['uniqueid']][_0x0c26('0x33')]=this[_0x0c26('0x15')][this['blindTransfers'][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x2e')]][_0x0c26('0x2e')]][0x0];this[_0x0c26('0x15')][this[_0x0c26('0x17')][_0xb7aa93['linkedid']][_0x0c26('0x2e')]]['answered']=this[_0x0c26('0x15')][_0xb7aa93['uniqueid']]['answered'];this[_0x0c26('0x15')][this[_0x0c26('0x17')][_0xb7aa93['linkedid']][_0x0c26('0x2e')]][_0x0c26('0x61')]=this[_0x0c26('0x15')][_0xb7aa93[_0x0c26('0x2e')]][_0x0c26('0x61')];this[_0x0c26('0x15')][this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x2e')]][_0x0c26('0x68')]=this[_0x0c26('0x15')][this['blindTransfers'][_0xb7aa93[_0x0c26('0x33')]]['uniqueid']]['channel'];this[_0x0c26('0x15')][this['blindTransfers'][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x2e')]][_0x0c26('0x58')]=this['channels'][_0xb7aa93[_0x0c26('0x2e')]][_0x0c26('0x58')];this[_0x0c26('0x15')][_0xb7aa93[_0x0c26('0x2e')]]=this[_0x0c26('0x15')][this[_0x0c26('0x17')][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x2e')]];delete this[_0x0c26('0x15')][this['blindTransfers'][_0xb7aa93[_0x0c26('0x33')]][_0x0c26('0x2e')]];}}if(this[_0x0c26('0x15')][_0xb7aa93[_0x0c26('0x2e')]]){logger[_0x0c26('0x26')](_0x0c26('0x93'),_0xb7aa93[_0x0c26('0x2e')],_0xb7aa93[_0x0c26('0x94')]);var _0x5ace4a=moment();this[_0x0c26('0x15')][_0xb7aa93[_0x0c26('0x2e')]]['endtime']=_0x5ace4a['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0c26('0x15')][_0xb7aa93[_0x0c26('0x2e')]][_0x0c26('0x55')]=_0x5ace4a[_0x0c26('0x64')](this['channels'][_0xb7aa93['uniqueid']]['starttime'],_0x0c26('0x56'));if(this['channels'][_0xb7aa93[_0x0c26('0x2e')]][_0x0c26('0x60')]){this[_0x0c26('0x15')][_0xb7aa93['uniqueid']][_0x0c26('0x95')]=_0x5ace4a['diff'](this[_0x0c26('0x15')][_0xb7aa93[_0x0c26('0x2e')]][_0x0c26('0x61')],'seconds');this[_0x0c26('0x15')][_0xb7aa93[_0x0c26('0x2e')]][_0x0c26('0x63')]=this[_0x0c26('0x15')][_0xb7aa93[_0x0c26('0x2e')]][_0x0c26('0x55')]-this[_0x0c26('0x15')][_0xb7aa93['uniqueid']]['billableseconds'];}if(_0xb7aa93[_0x0c26('0x35')]===_0x0c26('0x36')){if(this[_0x0c26('0x16')][_0xb7aa93[_0x0c26('0x3a')]['split']('-')[0x0]]){this[_0x0c26('0x16')][_0xb7aa93[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]]=_[_0x0c26('0x96')](this['agents'][_0xb7aa93['channel'][_0x0c26('0x37')]('-')[0x0]],[_0x0c26('0x3b')]);logger['debug'](_0x0c26('0x97'),_0xb7aa93['uniqueid'],util[_0x0c26('0x2a')]({'id':this['agents'][_0xb7aa93['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x0c26('0x16')][_0xb7aa93['channel'][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x4a')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x0c26('0x3e'),this['agents'][_0xb7aa93[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]][_0x0c26('0x3f')]),_0x0c26('0x98'),{'id':this[_0x0c26('0x16')][_0xb7aa93[_0x0c26('0x3a')][_0x0c26('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0x0c26('0x16')][_0xb7aa93['channel']['split']('-')[0x0]][_0x0c26('0x4a')]});for(var _0x5c0564=0x0;_0x5c05640x0?_0x544a62:0x0;this[_0x7e6e('0x10')][_0x36c7c2[_0x7e6e('0x66')]][_0x7e6e('0x2d')]=this['voiceQueues'][_0x36c7c2[_0x7e6e('0x66')]][_0x7e6e('0x2d')]>_[_0x7e6e('0x6c')](_0x36c7c2[_0x7e6e('0x6d')])?_[_0x7e6e('0x6c')](_0x36c7c2[_0x7e6e('0x6d')]):this['voiceQueues'][_0x36c7c2[_0x7e6e('0x66')]][_0x7e6e('0x2d')];this['emitVoiceQueueSummary'](this[_0x7e6e('0x10')][_0x36c7c2['queue']],_0x7e6e('0x13'));}logger[_0x7e6e('0x3f')](_0x7e6e('0x6f'),util[_0x7e6e('0x36')](this[_0x7e6e('0x10')][_0x36c7c2[_0x7e6e('0x66')]],{'showHidden':![],'depth':null}));ami[_0x7e6e('0x3e')](_0x7e6e('0x70'),this[_0x7e6e('0x10')][_0x36c7c2[_0x7e6e('0x66')]]);}}}catch(_0x3410b3){logger[_0x7e6e('0x35')](_0x7e6e('0x65'),util[_0x7e6e('0x36')](_0x3410b3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e6e('0x39')][_0x7e6e('0x17')]=function(_0x29c574){logger[_0x7e6e('0x3f')](_0x7e6e('0x71'),util['inspect'](_0x29c574,{'showHidden':![],'depth':null}));ami['emit'](_0x7e6e('0x72'),{});this[_0x7e6e('0x63')]=!![];};VoiceQueueReport['prototype'][_0x7e6e('0x73')]=function(_0x4bb821){try{if(this['isNotNull'](_0x4bb821)){logger[_0x7e6e('0x3f')](_0x7e6e('0x74'),_0x4bb821[_0x7e6e('0x42')],util['inspect'](_0x4bb821,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x7e6e('0xd')][_0x4bb821[_0x7e6e('0x42')]]))this[_0x7e6e('0xd')][_0x4bb821[_0x7e6e('0x42')]]=[];if(_[_0x7e6e('0x5e')](this[_0x7e6e('0xf')][_0x4bb821['uniqueid']]))this['channels'][_0x4bb821[_0x7e6e('0x42')]]={};var _0x124fb7=new QueueReport();_0x124fb7['name']=_0x4bb821['queue'];_0x124fb7[_0x7e6e('0x4c')]=this[_0x7e6e('0x10')][_0x124fb7[_0x7e6e('0x43')]]&&this[_0x7e6e('0x10')][_0x124fb7[_0x7e6e('0x43')]][_0x7e6e('0x4c')]?this['voiceQueues'][_0x124fb7[_0x7e6e('0x43')]][_0x7e6e('0x4c')]||'inbound':'inbound';_0x124fb7[_0x7e6e('0x66')]=_0x4bb821[_0x7e6e('0x66')];_0x124fb7[_0x7e6e('0x75')]=moment()[_0x7e6e('0x49')](_0x7e6e('0x76'));_0x124fb7['position']=_0x4bb821[_0x7e6e('0x77')];_0x124fb7[_0x7e6e('0x78')]=_0x4bb821[_0x7e6e('0x78')];_0x124fb7['uniqueid']=_0x4bb821['uniqueid'];_0x124fb7['routealias']=this['channels'][_0x4bb821[_0x7e6e('0x42')]]['routealias'];logger[_0x7e6e('0x68')](_0x7e6e('0x79'),_0x124fb7[_0x7e6e('0x43')],_0x124fb7[_0x7e6e('0x4c')]);_['merge'](_0x124fb7,_[_0x7e6e('0x7a')](_0x4bb821,_['keys'](_0x124fb7)));this[_0x7e6e('0xd')][_0x4bb821[_0x7e6e('0x42')]][_0x7e6e('0x7b')](_0x124fb7);this[_0x7e6e('0xf')][_0x4bb821[_0x7e6e('0x42')]]=_0x124fb7;this[_0x7e6e('0x7c')](_0x124fb7,_0x7e6e('0x7d'));}}catch(_0x470e41){logger['error'](_0x7e6e('0x74'),_0x4bb821['uniqueid'],util[_0x7e6e('0x36')](_0x470e41,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e6e('0x39')][_0x7e6e('0x19')]=function(_0x12a934){try{if(this[_0x7e6e('0x5d')](_0x12a934)){logger[_0x7e6e('0x3f')](_0x7e6e('0x7e'),_0x12a934[_0x7e6e('0x42')],util[_0x7e6e('0x36')](_0x12a934,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x12a934[_0x7e6e('0x42')]]){var _0x527bb8=_[_0x7e6e('0x7f')](this[_0x7e6e('0xd')][_0x12a934[_0x7e6e('0x42')]]);_0x527bb8[_0x7e6e('0x80')]=![];_0x527bb8[_0x7e6e('0x81')]=null;_0x527bb8[_0x7e6e('0x82')]=_0x12a934[_0x7e6e('0x82')];_0x527bb8[_0x7e6e('0x83')]=_0x12a934[_0x7e6e('0x83')];_0x527bb8[_0x7e6e('0x18')]=!![];_0x527bb8[_0x7e6e('0x84')]=moment()[_0x7e6e('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x527bb8[_0x7e6e('0x47')]=_0x7e6e('0x85');_0x527bb8[_0x7e6e('0x86')]=null;logger[_0x7e6e('0x68')](_0x7e6e('0x87'),_0x527bb8[_0x7e6e('0x43')],_0x527bb8[_0x7e6e('0x4c')]);this['channels'][_0x12a934[_0x7e6e('0x42')]]=_0x527bb8;this['emitVoiceQueueChannelRemove'](_0x527bb8,_0x7e6e('0x18'));}}}catch(_0xa835fb){logger[_0x7e6e('0x35')]('[%s][voiceQueueReport][queuecallerabandon]',_0x12a934[_0x7e6e('0x42')],util[_0x7e6e('0x36')](_0xa835fb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e6e('0x39')][_0x7e6e('0x88')]=function(_0x48bed0){try{if(this['isNotNull'](_0x48bed0)){logger[_0x7e6e('0x3f')](_0x7e6e('0x89'),_0x48bed0['uniqueid'],util[_0x7e6e('0x36')](_0x48bed0,{'showHidden':![],'depth':null}));if(this[_0x7e6e('0xd')][_0x48bed0[_0x7e6e('0x42')]]){var _0x16cb12=_['last'](this[_0x7e6e('0xd')][_0x48bed0[_0x7e6e('0x42')]]);_0x16cb12[_0x7e6e('0x8a')]=moment()[_0x7e6e('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x16cb12[_0x7e6e('0x8b')]=_0x48bed0['connectedlinenum'];_0x16cb12[_0x7e6e('0x8c')]=_0x48bed0[_0x7e6e('0x8c')];logger[_0x7e6e('0x68')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x16cb12[_0x7e6e('0x43')],_0x16cb12['type'],_0x48bed0[_0x7e6e('0x8b')],_0x48bed0['connectedlinename']);this[_0x7e6e('0xf')][_0x48bed0['uniqueid']]=_0x16cb12;this[_0x7e6e('0x7c')](_0x16cb12,_0x7e6e('0x8d'));}}}catch(_0x48a85c){logger[_0x7e6e('0x35')](_0x7e6e('0x89'),_0x48bed0['uniqueid'],util[_0x7e6e('0x36')](_0x48a85c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e6e('0x39')]['syncAgentConnect']=function(_0x359bd9){try{if(this[_0x7e6e('0x5d')](_0x359bd9)){logger[_0x7e6e('0x3f')](_0x7e6e('0x8e'),_0x359bd9[_0x7e6e('0x42')],util[_0x7e6e('0x36')](_0x359bd9,{'showHidden':![],'depth':null}));if(this[_0x7e6e('0xd')][_0x359bd9[_0x7e6e('0x42')]]){var _0x1bb95f=_[_0x7e6e('0x7f')](this[_0x7e6e('0xd')][_0x359bd9[_0x7e6e('0x42')]]);_0x1bb95f[_0x7e6e('0x80')]=!![];_0x1bb95f[_0x7e6e('0x47')]=_0x7e6e('0x8f');logger[_0x7e6e('0x68')](_0x7e6e('0x90'),_0x1bb95f['name'],_0x1bb95f['type']);}}}catch(_0x1f632e){logger['error'](_0x7e6e('0x8e'),_0x359bd9[_0x7e6e('0x42')],util['inspect'](_0x1f632e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e6e('0x39')][_0x7e6e('0x1a')]=function(_0x3b9ce9){try{if(this[_0x7e6e('0x5d')](_0x3b9ce9)){logger['debug'](_0x7e6e('0x91'),_0x3b9ce9[_0x7e6e('0x42')],util[_0x7e6e('0x36')](_0x3b9ce9,{'showHidden':![],'depth':null}));if(this[_0x7e6e('0xd')][_0x3b9ce9[_0x7e6e('0x42')]]){var _0xdf50e=_['last'](this[_0x7e6e('0xd')][_0x3b9ce9[_0x7e6e('0x42')]]);_0xdf50e[_0x7e6e('0x18')]=![];_0xdf50e[_0x7e6e('0x84')]=null;_0xdf50e[_0x7e6e('0x92')]=!![];_0xdf50e[_0x7e6e('0x86')]=_0x3b9ce9[_0x7e6e('0x93')];_0xdf50e[_0x7e6e('0x82')]=_0x3b9ce9[_0x7e6e('0x82')];_0xdf50e[_0x7e6e('0x80')]=!![];_0xdf50e[_0x7e6e('0x94')]=![];_0xdf50e[_0x7e6e('0x95')]=null;if(!_0xdf50e[_0x7e6e('0x96')]){if(_0x3b9ce9[_0x7e6e('0x97')]==_0x7e6e('0x96')){_0xdf50e[_0x7e6e('0x47')]=_0x7e6e('0x98');logger['info'](_0x7e6e('0x99'),_0xdf50e['name'],_0xdf50e[_0x7e6e('0x4c')]);}else{if(_['startsWith'](_0x3b9ce9['channel'][_0x7e6e('0x9a')](),_0x7e6e('0x9b'))){if(this[_0x7e6e('0xd')][_0x3b9ce9[_0x7e6e('0x9c')]]){var _0x1ec8e5=_[_0x7e6e('0x7f')](this[_0x7e6e('0xd')][_0x3b9ce9['linkedid']]);_0x1ec8e5['queuecallercomplete']=![];_0x1ec8e5[_0x7e6e('0x94')]=!![];_0x1ec8e5[_0x7e6e('0x95')]=moment(_0xdf50e['queuecallerjoinAt'])['add'](_0x3b9ce9[_0x7e6e('0x82')],_0x7e6e('0x9d'))[_0x7e6e('0x49')](_0x7e6e('0x76'));_0x1ec8e5[_0x7e6e('0x47')]=_0x7e6e('0x9e');_0x1ec8e5[_0x7e6e('0x96')]=!![];_0x1ec8e5[_0x7e6e('0x9f')]=_0x7e6e('0xa0');_0x1ec8e5[_0x7e6e('0xa1')]=_0x3b9ce9['destexten'];_0x1ec8e5[_0x7e6e('0xa2')]=_0x3b9ce9[_0x7e6e('0x42')];logger['info'](_0x7e6e('0xa3'),_0x1ec8e5[_0x7e6e('0x43')],_0x1ec8e5[_0x7e6e('0x4c')]);var _0x53e3ea=this[_0x7e6e('0xd')][_0x3b9ce9[_0x7e6e('0x9c')]];this[_0x7e6e('0xd')][_0x3b9ce9['linkedid']]=this['queueReports'][_0x3b9ce9[_0x7e6e('0x42')]];this['queueReports'][_0x3b9ce9[_0x7e6e('0x42')]]=_0x53e3ea;}}else{_0xdf50e['queuecallerexitreason']=_0x7e6e('0xa4')+_0x3b9ce9['reason'][_0x7e6e('0xa5')]();logger['info'](_0x7e6e('0xa6'),_0xdf50e['name'],_0xdf50e[_0x7e6e('0x4c')],_0xdf50e[_0x7e6e('0x47')]);}}}this[_0x7e6e('0xf')][_0x3b9ce9[_0x7e6e('0x42')]]=_0xdf50e;this['emitVoiceQueueChannelRemove'](_0xdf50e,_0x7e6e('0xa7'));}}}catch(_0x29b3cc){logger['error'](_0x7e6e('0x91'),_0x3b9ce9['uniqueid'],util[_0x7e6e('0x36')](_0x29b3cc,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7e6e('0xa8')]=function(_0xa94be6){try{if(this['isNotNull'](_0xa94be6)){logger[_0x7e6e('0x3f')]('[%s][voiceQueueReport][varset]',_0xa94be6['uniqueid'],util[_0x7e6e('0x36')](_0xa94be6,{'showHidden':![],'depth':null}));this[_0x7e6e('0xa9')](_0xa94be6[_0x7e6e('0x42')],_['keys'](_0xa94be6[_0x7e6e('0xaa')])[0x0],_0xa94be6[_0x7e6e('0xab')]);if(this[_0x7e6e('0xd')][_0xa94be6[_0x7e6e('0x42')]]){var _0x14144b=_[_0x7e6e('0x7f')](this[_0x7e6e('0xd')][_0xa94be6[_0x7e6e('0x42')]]);if(_0x14144b){if(this[_0x7e6e('0x5d')](_0xa94be6['variable'])&&this[_0x7e6e('0x5d')](_0xa94be6[_0x7e6e('0xaa')][_0x7e6e('0xac')])){switch(_0xa94be6[_0x7e6e('0xab')]){case _0x7e6e('0xad'):_0x14144b[_0x7e6e('0x94')]=![];_0x14144b[_0x7e6e('0x95')]=null;break;case _0x7e6e('0xae'):_0x14144b[_0x7e6e('0xaf')]=_0x7e6e('0xb0');_0x14144b[_0x7e6e('0x94')]=!![];_0x14144b[_0x7e6e('0x95')]=moment()[_0x7e6e('0x49')](_0x7e6e('0x76'));_0x14144b['queuecallerleaveAt']=moment()[_0x7e6e('0x49')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x7e6e('0x3f')](_0x7e6e('0xb1'),_0xa94be6['uniqueid'],util[_0x7e6e('0x36')](_0x14144b,{'showHidden':![],'depth':null}));ami[_0x7e6e('0x3e')]('custom:timeout',_0x14144b);break;default:_0x14144b[_0x7e6e('0x94')]=!![];_0x14144b['queuecallerexitAt']=moment()[_0x7e6e('0x49')](_0x7e6e('0x76'));_0x14144b['queuecallerleaveAt']=moment()[_0x7e6e('0x49')](_0x7e6e('0x76'));}_0x14144b[_0x7e6e('0x18')]=![];_0x14144b[_0x7e6e('0x84')]=null;_0x14144b['queuecallerexitreason']=_0xa94be6['value'];this[_0x7e6e('0xf')][_0xa94be6[_0x7e6e('0x42')]]=_0x14144b;this[_0x7e6e('0x3c')](_0x14144b,_0x7e6e('0xb2'));}else if(this[_0x7e6e('0x5d')](_0xa94be6[_0x7e6e('0xaa')])&&this[_0x7e6e('0x5d')](_0xa94be6['variable'][_0x7e6e('0xb3')])){if(!_0x14144b[_0x7e6e('0x18')]){_0x14144b[_0x7e6e('0x94')]=!![];_0x14144b['queuecallerexitAt']=moment()[_0x7e6e('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x14144b[_0x7e6e('0x47')]=_0x7e6e('0xb4');_0x14144b[_0x7e6e('0x8a')]=moment()[_0x7e6e('0x49')](_0x7e6e('0x76'));this[_0x7e6e('0xf')][_0xa94be6[_0x7e6e('0x42')]]=_0x14144b;}}logger['info'](_0x7e6e('0xb5'),_0xa94be6['uniqueid'],_0x14144b[_0x7e6e('0x43')],_0x14144b['type'],_[_0x7e6e('0xb6')](_0xa94be6[_0x7e6e('0xaa')])[0x0],_0xa94be6[_0x7e6e('0xab')]);_0x14144b[_0x7e6e('0x12')]=this[_0x7e6e('0x12')][_0xa94be6[_0x7e6e('0x42')]];}}}}catch(_0x335905){logger[_0x7e6e('0x35')](_0x7e6e('0xb7'),_0xa94be6['uniqueid'],util[_0x7e6e('0x36')](_0x335905,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e6e('0x39')]['addVariable']=function(_0xef8f0,_0x4d3763,_0xf9fa81){var _0xe7d212=['rtpaudioqos',_0x7e6e('0xb8'),_0x7e6e('0xb9'),_0x7e6e('0xba'),_0x7e6e('0xbb'),_0x7e6e('0xbc'),_0x7e6e('0xbd'),_0x7e6e('0xbe'),'sipcallid','sipuri',_0x7e6e('0xbf'),_0x7e6e('0xc0'),_0x7e6e('0xc1'),'memberdynamic',_0x7e6e('0xc2'),'memberlastcall','membername',_0x7e6e('0xc3'),_0x7e6e('0xc4')];if(!_[_0x7e6e('0xc5')](_0x4d3763)&&!_[_0x7e6e('0xc6')](_0xe7d212,_0x4d3763)){if(_[_0x7e6e('0x5e')](this[_0x7e6e('0x12')][_0xef8f0])){this['variables'][_0xef8f0]={};}this[_0x7e6e('0x12')][_0xef8f0][_0x4d3763]=_0xf9fa81;}};VoiceQueueReport['prototype']['handleHangup']=function(_0x42883a,_0x3d7761,_0x30819c){var _0x8d4a60={};for(var _0x45a3bc=0x0;_0x45a3bc0x0?_0x1ad265:0x0;this[_0xee8d('0x14')][_0xc48ea3[_0xee8d('0x66')]]['talking']=this[_0xee8d('0x14')][_0xc48ea3[_0xee8d('0x66')]]['talking']>_[_0xee8d('0x6a')](_0xc48ea3[_0xee8d('0x6c')])?_['toNumber'](_0xc48ea3[_0xee8d('0x6c')]):this[_0xee8d('0x14')][_0xc48ea3[_0xee8d('0x66')]][_0xee8d('0x2f')];this[_0xee8d('0x54')](this[_0xee8d('0x14')][_0xc48ea3[_0xee8d('0x66')]],_0xee8d('0x17'));}logger[_0xee8d('0x4e')](_0xee8d('0x6e'),util[_0xee8d('0x3d')](this[_0xee8d('0x14')][_0xc48ea3[_0xee8d('0x66')]],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this[_0xee8d('0x14')][_0xc48ea3[_0xee8d('0x66')]]);}}}catch(_0x5cc4a2){logger['error']('[voiceQueueReport][queuesummary]',util[_0xee8d('0x3d')](_0x5cc4a2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xee8d('0xd')][_0xee8d('0x1a')]=function(_0x5e2d09){logger[_0xee8d('0x4e')](_0xee8d('0x6f'),util[_0xee8d('0x3d')](_0x5e2d09,{'showHidden':![],'depth':null}));ami[_0xee8d('0x44')](_0xee8d('0x70'),{});this[_0xee8d('0x15')]=!![];};VoiceQueueReport[_0xee8d('0xd')]['syncQueueCallerJoin']=function(_0x5a493c){try{if(this['isNotNull'](_0x5a493c)){logger[_0xee8d('0x4e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x5a493c[_0xee8d('0x48')],util[_0xee8d('0x3d')](_0x5a493c,{'showHidden':![],'depth':null}));if(_[_0xee8d('0x71')](this[_0xee8d('0x3e')][_0x5a493c[_0xee8d('0x48')]]))this[_0xee8d('0x3e')][_0x5a493c[_0xee8d('0x48')]]=[];if(_[_0xee8d('0x71')](this[_0xee8d('0x12')][_0x5a493c[_0xee8d('0x48')]]))this[_0xee8d('0x12')][_0x5a493c[_0xee8d('0x48')]]={};var _0x1612c5=new QueueReport();_0x1612c5['name']=_0x5a493c['queue'];_0x1612c5[_0xee8d('0x59')]=this[_0xee8d('0x14')][_0x1612c5['name']]&&this[_0xee8d('0x14')][_0x1612c5[_0xee8d('0x4b')]][_0xee8d('0x59')]?this[_0xee8d('0x14')][_0x1612c5[_0xee8d('0x4b')]][_0xee8d('0x59')]||_0xee8d('0x55'):_0xee8d('0x55');_0x1612c5['queue']=_0x5a493c[_0xee8d('0x66')];_0x1612c5[_0xee8d('0x72')]=moment()[_0xee8d('0x49')](_0xee8d('0x73'));_0x1612c5[_0xee8d('0x74')]=_0x5a493c[_0xee8d('0x74')];_0x1612c5[_0xee8d('0x75')]=_0x5a493c['count'];_0x1612c5[_0xee8d('0x48')]=_0x5a493c[_0xee8d('0x48')];_0x1612c5['routealias']=this[_0xee8d('0x12')][_0x5a493c[_0xee8d('0x48')]][_0xee8d('0x76')];logger[_0xee8d('0x77')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x1612c5[_0xee8d('0x4b')],_0x1612c5[_0xee8d('0x59')]);_[_0xee8d('0x78')](_0x1612c5,_['pick'](_0x5a493c,_[_0xee8d('0x79')](_0x1612c5)));this[_0xee8d('0x3e')][_0x5a493c['uniqueid']][_0xee8d('0x7a')](_0x1612c5);this[_0xee8d('0x12')][_0x5a493c[_0xee8d('0x48')]]=_0x1612c5;this[_0xee8d('0x45')](_0x1612c5,_0xee8d('0x1b'));}}catch(_0x585483){logger['error'](_0xee8d('0x7b'),_0x5a493c[_0xee8d('0x48')],util[_0xee8d('0x3d')](_0x585483,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x149c02){try{if(this['isNotNull'](_0x149c02)){logger[_0xee8d('0x4e')](_0xee8d('0x7c'),_0x149c02[_0xee8d('0x48')],util[_0xee8d('0x3d')](_0x149c02,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x149c02[_0xee8d('0x48')]]){var _0x577a31=_[_0xee8d('0x7d')](this[_0xee8d('0x3e')][_0x149c02[_0xee8d('0x48')]]);_0x577a31['queuecallercomplete']=![];_0x577a31['queuecallercompleteAt']=null;_0x577a31['holdtime']=_0x149c02[_0xee8d('0x7e')];_0x577a31[_0xee8d('0x7f')]=_0x149c02[_0xee8d('0x7f')];_0x577a31['queuecallerabandon']=!![];_0x577a31[_0xee8d('0x80')]=moment()[_0xee8d('0x49')](_0xee8d('0x73'));_0x577a31[_0xee8d('0x50')]=_0xee8d('0x81');_0x577a31[_0xee8d('0x82')]=null;logger[_0xee8d('0x77')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x577a31[_0xee8d('0x4b')],_0x577a31[_0xee8d('0x59')]);this[_0xee8d('0x12')][_0x149c02[_0xee8d('0x48')]]=_0x577a31;this['emitVoiceQueueChannelRemove'](_0x577a31,_0xee8d('0x1c'));}}}catch(_0x2315e0){logger[_0xee8d('0x3f')]('[%s][voiceQueueReport][queuecallerabandon]',_0x149c02['uniqueid'],util['inspect'](_0x2315e0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xee8d('0xd')]['syncQueueCallerLeave']=function(_0x3200bc){try{if(this[_0xee8d('0x65')](_0x3200bc)){logger[_0xee8d('0x4e')](_0xee8d('0x83'),_0x3200bc[_0xee8d('0x48')],util['inspect'](_0x3200bc,{'showHidden':![],'depth':null}));if(this[_0xee8d('0x3e')][_0x3200bc[_0xee8d('0x48')]]){var _0x13f590=_[_0xee8d('0x7d')](this[_0xee8d('0x3e')][_0x3200bc[_0xee8d('0x48')]]);_0x13f590['queuecallerleaveAt']=moment()[_0xee8d('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x13f590['connectedlinenum']=_0x3200bc[_0xee8d('0x84')];_0x13f590[_0xee8d('0x85')]=_0x3200bc[_0xee8d('0x85')];logger[_0xee8d('0x77')](_0xee8d('0x86'),_0x13f590[_0xee8d('0x4b')],_0x13f590[_0xee8d('0x59')],_0x3200bc[_0xee8d('0x84')],_0x3200bc[_0xee8d('0x85')]);this[_0xee8d('0x12')][_0x3200bc['uniqueid']]=_0x13f590;this['emitVoiceQueueChannelSave'](_0x13f590,_0xee8d('0x1e'));}}}catch(_0x58950a){logger[_0xee8d('0x3f')](_0xee8d('0x83'),_0x3200bc[_0xee8d('0x48')],util[_0xee8d('0x3d')](_0x58950a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xee8d('0xd')][_0xee8d('0x87')]=function(_0x3a86fd){try{if(this['isNotNull'](_0x3a86fd)){logger[_0xee8d('0x4e')](_0xee8d('0x88'),_0x3a86fd['uniqueid'],util['inspect'](_0x3a86fd,{'showHidden':![],'depth':null}));if(this[_0xee8d('0x3e')][_0x3a86fd['uniqueid']]){var _0x23f5d6=_[_0xee8d('0x7d')](this[_0xee8d('0x3e')][_0x3a86fd[_0xee8d('0x48')]]);_0x23f5d6[_0xee8d('0x89')]=!![];_0x23f5d6[_0xee8d('0x50')]=_0xee8d('0x8a');logger[_0xee8d('0x77')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x23f5d6['name'],_0x23f5d6['type']);}}}catch(_0x33588d){logger[_0xee8d('0x3f')]('[%s][voiceQueueReport][agentconnect]',_0x3a86fd[_0xee8d('0x48')],util[_0xee8d('0x3d')](_0x33588d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xee8d('0xd')][_0xee8d('0x20')]=function(_0x355f29){try{if(this[_0xee8d('0x65')](_0x355f29)){logger[_0xee8d('0x4e')](_0xee8d('0x8b'),_0x355f29[_0xee8d('0x48')],util[_0xee8d('0x3d')](_0x355f29,{'showHidden':![],'depth':null}));if(this[_0xee8d('0x3e')][_0x355f29[_0xee8d('0x48')]]){var _0xa55be7=_[_0xee8d('0x7d')](this[_0xee8d('0x3e')][_0x355f29[_0xee8d('0x48')]]);_0xa55be7[_0xee8d('0x1c')]=![];_0xa55be7[_0xee8d('0x80')]=null;_0xa55be7[_0xee8d('0x8c')]=!![];_0xa55be7[_0xee8d('0x82')]=_0x355f29[_0xee8d('0x8d')];_0xa55be7[_0xee8d('0x7e')]=_0x355f29['holdtime'];_0xa55be7[_0xee8d('0x89')]=!![];_0xa55be7[_0xee8d('0x8e')]=![];_0xa55be7[_0xee8d('0x8f')]=null;if(!_0xa55be7[_0xee8d('0x90')]){if(_0x355f29[_0xee8d('0x91')]==_0xee8d('0x90')){_0xa55be7[_0xee8d('0x50')]=_0xee8d('0x92');logger[_0xee8d('0x77')](_0xee8d('0x93'),_0xa55be7[_0xee8d('0x4b')],_0xa55be7[_0xee8d('0x59')]);}else{if(_[_0xee8d('0x94')](_0x355f29[_0xee8d('0x39')][_0xee8d('0x95')](),'local/')){if(this[_0xee8d('0x3e')][_0x355f29[_0xee8d('0x96')]]){var _0x4b2a0f=_['last'](this[_0xee8d('0x3e')][_0x355f29[_0xee8d('0x96')]]);_0x4b2a0f[_0xee8d('0x89')]=![];_0x4b2a0f[_0xee8d('0x8e')]=!![];_0x4b2a0f[_0xee8d('0x8f')]=moment(_0xa55be7['queuecallerjoinAt'])[_0xee8d('0x97')](_0x355f29[_0xee8d('0x7e')],_0xee8d('0x98'))[_0xee8d('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b2a0f['queuecallerexitreason']=_0xee8d('0x99');_0x4b2a0f['transfer']=!![];_0x4b2a0f[_0xee8d('0x9a')]=_0xee8d('0x9b');_0x4b2a0f['transferexten']=_0x355f29['destexten'];_0x4b2a0f[_0xee8d('0x9c')]=_0x355f29[_0xee8d('0x48')];logger[_0xee8d('0x77')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x4b2a0f[_0xee8d('0x4b')],_0x4b2a0f[_0xee8d('0x59')]);var _0x43d78=this[_0xee8d('0x3e')][_0x355f29[_0xee8d('0x96')]];this[_0xee8d('0x3e')][_0x355f29[_0xee8d('0x96')]]=this['queueReports'][_0x355f29[_0xee8d('0x48')]];this['queueReports'][_0x355f29[_0xee8d('0x48')]]=_0x43d78;}}else{_0xa55be7[_0xee8d('0x50')]='COMPLETEDBY'+_0x355f29['reason']['toUpperCase']();logger[_0xee8d('0x77')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0xa55be7[_0xee8d('0x4b')],_0xa55be7['type'],_0xa55be7[_0xee8d('0x50')]);}}}this[_0xee8d('0x12')][_0x355f29[_0xee8d('0x48')]]=_0xa55be7;this[_0xee8d('0x43')](_0xa55be7,_0xee8d('0x1f'));}}}catch(_0x12b61b){logger[_0xee8d('0x3f')](_0xee8d('0x8b'),_0x355f29['uniqueid'],util[_0xee8d('0x3d')](_0x12b61b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xee8d('0x22')]=function(_0x446ef4){try{if(this['isNotNull'](_0x446ef4)){logger[_0xee8d('0x4e')](_0xee8d('0x9d'),_0x446ef4['uniqueid'],util[_0xee8d('0x3d')](_0x446ef4,{'showHidden':![],'depth':null}));this['addVariable'](_0x446ef4[_0xee8d('0x48')],_[_0xee8d('0x79')](_0x446ef4['variable'])[0x0],_0x446ef4[_0xee8d('0x9e')]);if(this[_0xee8d('0x3e')][_0x446ef4[_0xee8d('0x48')]]){var _0x57ecad=_[_0xee8d('0x7d')](this[_0xee8d('0x3e')][_0x446ef4[_0xee8d('0x48')]]);if(_0x57ecad){if(this[_0xee8d('0x65')](_0x446ef4[_0xee8d('0x9f')])&&this[_0xee8d('0x65')](_0x446ef4[_0xee8d('0x9f')][_0xee8d('0xa0')])){switch(_0x446ef4['value']){case'CONTINUE':_0x57ecad[_0xee8d('0x8e')]=![];_0x57ecad[_0xee8d('0x8f')]=null;break;case _0xee8d('0xa1'):_0x57ecad[_0xee8d('0xa2')]=_0xee8d('0xa3');_0x57ecad[_0xee8d('0x8e')]=!![];_0x57ecad[_0xee8d('0x8f')]=moment()[_0xee8d('0x49')](_0xee8d('0x73'));_0x57ecad['queuecallerleaveAt']=moment()[_0xee8d('0x49')](_0xee8d('0x73'));logger[_0xee8d('0x4e')](_0xee8d('0xa4'),_0x446ef4[_0xee8d('0x48')],util[_0xee8d('0x3d')](_0x57ecad,{'showHidden':![],'depth':null}));ami[_0xee8d('0x44')](_0xee8d('0xa5'),_0x57ecad);break;default:_0x57ecad[_0xee8d('0x8e')]=!![];_0x57ecad[_0xee8d('0x8f')]=moment()[_0xee8d('0x49')](_0xee8d('0x73'));_0x57ecad[_0xee8d('0xa6')]=moment()[_0xee8d('0x49')](_0xee8d('0x73'));}_0x57ecad['queuecallerabandon']=![];_0x57ecad[_0xee8d('0x80')]=null;_0x57ecad[_0xee8d('0x50')]=_0x446ef4[_0xee8d('0x9e')];this[_0xee8d('0x12')][_0x446ef4[_0xee8d('0x48')]]=_0x57ecad;this[_0xee8d('0x43')](_0x57ecad,'varset');}else if(this[_0xee8d('0x65')](_0x446ef4[_0xee8d('0x9f')])&&this['isNotNull'](_0x446ef4['variable'][_0xee8d('0xa7')])){if(!_0x57ecad[_0xee8d('0x1c')]){_0x57ecad[_0xee8d('0x8e')]=!![];_0x57ecad[_0xee8d('0x8f')]=moment()[_0xee8d('0x49')](_0xee8d('0x73'));_0x57ecad[_0xee8d('0x50')]=_0xee8d('0xa8');_0x57ecad[_0xee8d('0xa6')]=moment()[_0xee8d('0x49')](_0xee8d('0x73'));this[_0xee8d('0x12')][_0x446ef4[_0xee8d('0x48')]]=_0x57ecad;}}logger[_0xee8d('0x77')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x446ef4[_0xee8d('0x48')],_0x57ecad[_0xee8d('0x4b')],_0x57ecad[_0xee8d('0x59')],_[_0xee8d('0x79')](_0x446ef4[_0xee8d('0x9f')])[0x0],_0x446ef4[_0xee8d('0x9e')]);_0x57ecad[_0xee8d('0x40')]=this[_0xee8d('0x40')][_0x446ef4['uniqueid']];}}}}catch(_0x16afc8){logger[_0xee8d('0x3f')](_0xee8d('0x9d'),_0x446ef4['uniqueid'],util['inspect'](_0x16afc8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x528a32,_0x29889e,_0x58ee56){var _0x41efd9=[_0xee8d('0xa9'),_0xee8d('0xaa'),_0xee8d('0xab'),'rtpaudioqosjitterbridged',_0xee8d('0xac'),_0xee8d('0xad'),_0xee8d('0xae'),'rtpaudioqosrttbridged','sipcallid',_0xee8d('0xaf'),_0xee8d('0xb0'),_0xee8d('0xb1'),_0xee8d('0xb2'),_0xee8d('0xb3'),_0xee8d('0xb4'),_0xee8d('0xb5'),_0xee8d('0x8d'),'memberpenalty',_0xee8d('0xb6')];if(!_[_0xee8d('0x36')](_0x29889e)&&!_['includes'](_0x41efd9,_0x29889e)){if(_[_0xee8d('0x71')](this[_0xee8d('0x40')][_0x528a32])){this[_0xee8d('0x40')][_0x528a32]={};}this[_0xee8d('0x40')][_0x528a32][_0x29889e]=_0x58ee56;}};VoiceQueueReport['prototype']['handleHangup']=function(_0x1ec2dd,_0x2b6df0,_0x178bb6){var _0x10f3ab={};for(var _0x367c5b=0x0;_0x367c5b=0x0?moment(_0x4a8a49[_0x6793('0x1b')])['diff'](_0x4a8a49[_0x6793('0x1a')],_0x6793('0x1c')):null,'data1':'outbound','data2':_0x4a8a49[_0x6793('0x14')],'data3':_0x4a8a49[_0x6793('0x1d')],'data4':_0x4a8a49[_0x6793('0x1e')]||null,'role':_0x6793('0x13'),'internal':_0x4a8a49['accountcode']?_['toNumber'](_0x4a8a49[_0x6793('0x14')]):undefined,'uniqueid':_0x4a8a49[_0x6793('0x16')]},'log':_0x6793('0x7')});}; \ No newline at end of file +var _0x414f=['starttime','endtime','dialstring','moment','util','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','format','SIP/%s','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','agent','accountcode','uniqueid','voiceDialReport','membername'];(function(_0x24f1e0,_0x32440c){var _0x2028aa=function(_0x49e2bf){while(--_0x49e2bf){_0x24f1e0['push'](_0x24f1e0['shift']());}};_0x2028aa(++_0x32440c);}(_0x414f,0x1e9));var _0xf414=function(_0x20a791,_0x49718f){_0x20a791=_0x20a791-0x0;var _0xe0f198=_0x414f[_0x20a791];return _0xe0f198;};'use strict';var moment=require(_0xf414('0x0'));var _=require('lodash');var util=require(_0xf414('0x1'));var client=require(_0xf414('0x2'));exports[_0xf414('0x3')]=function(_0x6b3ae7){var _0x240716=_0x6b3ae7['queuecallercompleteAt']||_0x6b3ae7[_0xf414('0x4')];return client[_0xf414('0x5')](_0xf414('0x6'),{'body':{'channel':_0xf414('0x7'),'membername':_0x6b3ae7[_0xf414('0x8')],'interface':_['isNil'](_0x6b3ae7['interface'])?util[_0xf414('0x9')](_0xf414('0xa'),_0x6b3ae7[_0xf414('0x8')]):_0x6b3ae7[_0xf414('0xb')],'type':_0xf414('0xc'),'enterAt':_0x6b3ae7[_0xf414('0xd')],'exitAt':_0x240716,'duration':moment(_0x240716)[_0xf414('0xe')](_0x6b3ae7['queuecallerleaveAt'],_0xf414('0xf')),'data1':_0xf414('0x10'),'data2':_0x6b3ae7['calleridnum'],'data3':_0x6b3ae7[_0xf414('0x11')],'data4':null,'data5':_0x6b3ae7[_0xf414('0x12')],'role':_0xf414('0x13'),'internal':_0x6b3ae7[_0xf414('0x14')]?_['toNumber'](_0x6b3ae7['accountcode']):undefined,'uniqueid':_0x6b3ae7[_0xf414('0x15')]},'log':_0xf414('0x6')});};exports[_0xf414('0x16')]=function(_0x180273){return client[_0xf414('0x5')](_0xf414('0x6'),{'body':{'channel':'voice','membername':_0x180273[_0xf414('0x17')],'interface':_0x180273['interface'],'type':_0xf414('0xc'),'enterAt':_0x180273[_0xf414('0x18')],'exitAt':_0x180273[_0xf414('0x19')],'duration':moment(_0x180273[_0xf414('0x19')])[_0xf414('0xe')](_0x180273['starttime'],_0xf414('0xf'))>=0x0?moment(_0x180273['endtime'])[_0xf414('0xe')](_0x180273['starttime'],'seconds'):null,'data1':'outbound','data2':_0x180273['accountcode'],'data3':_0x180273[_0xf414('0x11')],'data4':_0x180273[_0xf414('0x1a')]||null,'role':_0xf414('0x13'),'internal':_0x180273['accountcode']?_['toNumber'](_0x180273['accountcode']):undefined,'uniqueid':_0x180273[_0xf414('0x15')]},'log':_0xf414('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 98abdc8..3c81ed1 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 _0x2f0c=['stopRecordingOnTransfer','GetSettings','../client','getSettings'];(function(_0x3a4318,_0x13c6eb){var _0x36d746=function(_0x508617){while(--_0x508617){_0x3a4318['push'](_0x3a4318['shift']());}};_0x36d746(++_0x13c6eb);}(_0x2f0c,0x1b2));var _0xc2f0=function(_0x33e4a7,_0x2e80a2){_0x33e4a7=_0x33e4a7-0x0;var _0x598620=_0x2f0c[_0x33e4a7];return _0x598620;};'use strict';var client=require(_0xc2f0('0x0'));exports[_0xc2f0('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc2f0('0x2'),'previewRecallmeReminderInterval']},'log':_0xc2f0('0x3')});}; \ No newline at end of file +var _0xa866=['Request','ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0xa866,0x6a));var _0x6a86=function(_0x249bf8,_0x4371ca){_0x249bf8=_0x249bf8-0x0;var _0x4aca68=_0xa866[_0x249bf8];return _0x4aca68;};'use strict';var client=require(_0x6a86('0x0'));exports[_0x6a86('0x1')]=function(){return client[_0x6a86('0x2')](_0x6a86('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6a86('0x4'),'previewRecallmeReminderInterval']},'log':_0x6a86('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 29b1105..9c99c8c 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 _0x46f0=['Request','name','GetTemplate','getTemplates'];(function(_0x36ca83,_0x1765da){var _0x11898b=function(_0x257b9b){while(--_0x257b9b){_0x36ca83['push'](_0x36ca83['shift']());}};_0x11898b(++_0x1765da);}(_0x46f0,0x1a7));var _0x046f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x46f0[_0x40a045];return _0x1a687c;};'use strict';var client=require('../client');exports[_0x046f('0x0')]=function(_0x235819){return function(_0x9a4ff5){return client[_0x046f('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x046f('0x2'),'html']},'log':_0x046f('0x3')});};}; \ No newline at end of file +var _0xf3da=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x272124,_0xdd1995){var _0x15c8cb=function(_0x3ccbaf){while(--_0x3ccbaf){_0x272124['push'](_0x272124['shift']());}};_0x15c8cb(++_0xdd1995);}(_0xf3da,0x143));var _0xaf3d=function(_0x450b10,_0x2a0a83){_0x450b10=_0x450b10-0x0;var _0x275003=_0xf3da[_0x450b10];return _0x275003;};'use strict';var client=require(_0xaf3d('0x0'));exports[_0xaf3d('0x1')]=function(_0x373ba1){return function(_0x98837e){return client[_0xaf3d('0x2')](_0xaf3d('0x3'),{'options':{'raw':!![],'attributes':['id',_0xaf3d('0x4'),_0xaf3d('0x5')]},'log':_0xaf3d('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 8c333ec..6b42d71 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 _0x7757=['operator','value','Action','data1','data4','data7','../client','getTriggers','Request','GetTrigger','name','Condition','AllConditions','field'];(function(_0x417b64,_0x4fd6de){var _0x55ae33=function(_0x4c146d){while(--_0x4c146d){_0x417b64['push'](_0x417b64['shift']());}};_0x55ae33(++_0x4fd6de);}(_0x7757,0xca));var _0x7775=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x7757[_0x484e36];return _0xafc85d;};'use strict';var client=require(_0x7775('0x0'));exports[_0x7775('0x1')]=function(_0x4cd697){return function(_0x29e52d){return client[_0x7775('0x2')](_0x7775('0x3'),{'options':{'raw':![],'attributes':['id',_0x7775('0x4'),'channel','status'],'include':[{'model':_0x7775('0x5'),'as':_0x7775('0x6'),'attributes':['id',_0x7775('0x7'),_0x7775('0x8'),'value']},{'model':_0x7775('0x5'),'as':'AnyConditions','attributes':['id',_0x7775('0x7'),'operator',_0x7775('0x9')]},{'model':_0x7775('0xa'),'as':'Actions','attributes':['id','action',_0x7775('0xb'),'data2','data3',_0x7775('0xc'),'data5','data6',_0x7775('0xd')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x1c4b=['data2','data3','data4','data5','../client','getTriggers','Request','GetTrigger','name','status','Condition','AllConditions','operator','value','AnyConditions','field','Actions','action','data1'];(function(_0x298693,_0x48e7e9){var _0xa07b27=function(_0x257e91){while(--_0x257e91){_0x298693['push'](_0x298693['shift']());}};_0xa07b27(++_0x48e7e9);}(_0x1c4b,0x1b9));var _0xb1c4=function(_0x205a8c,_0x813d64){_0x205a8c=_0x205a8c-0x0;var _0x53eeb6=_0x1c4b[_0x205a8c];return _0x53eeb6;};'use strict';var client=require(_0xb1c4('0x0'));exports[_0xb1c4('0x1')]=function(_0x326758){return function(_0xeab765){return client[_0xb1c4('0x2')](_0xb1c4('0x3'),{'options':{'raw':![],'attributes':['id',_0xb1c4('0x4'),'channel',_0xb1c4('0x5')],'include':[{'model':_0xb1c4('0x6'),'as':_0xb1c4('0x7'),'attributes':['id','field',_0xb1c4('0x8'),_0xb1c4('0x9')]},{'model':_0xb1c4('0x6'),'as':_0xb1c4('0xa'),'attributes':['id',_0xb1c4('0xb'),_0xb1c4('0x8'),_0xb1c4('0x9')]},{'model':'Action','as':_0xb1c4('0xc'),'attributes':['id',_0xb1c4('0xd'),_0xb1c4('0xe'),_0xb1c4('0xf'),_0xb1c4('0x10'),_0xb1c4('0x11'),_0xb1c4('0x12'),'data6','data7']}]},'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 b9ae381..1672119 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 _0x5b4b=['Request','name','defaultuser'];(function(_0x4e48f6,_0x355bf1){var _0x233b49=function(_0x4b8f10){while(--_0x4b8f10){_0x4e48f6['push'](_0x4e48f6['shift']());}};_0x233b49(++_0x355bf1);}(_0x5b4b,0xdb));var _0xb5b4=function(_0x44a811,_0x329812){_0x44a811=_0x44a811-0x0;var _0x2ff977=_0x5b4b[_0x44a811];return _0x2ff977;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x41155e){return function(_0x2a2908){return client[_0xb5b4('0x0')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xb5b4('0x1'),'registry',_0xb5b4('0x2')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xac95=['name','registry','GetTrunk','../client','getTrunks'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0xac95,0xa8));var _0x5ac9=function(_0x330bec,_0x5792f5){_0x330bec=_0x330bec-0x0;var _0x242b6b=_0xac95[_0x330bec];return _0x242b6b;};'use strict';var client=require(_0x5ac9('0x0'));exports[_0x5ac9('0x1')]=function(_0x279a08){return function(_0x471ff6){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x5ac9('0x2'),_0x5ac9('0x3'),'defaultuser']},'log':_0x5ac9('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 70754d0..2183be2 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 _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(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe706,0xa3));var _0x6e70=function(_0x243e12,_0x2d7bc5){_0x243e12=_0x243e12-0x0;var _0x3fddfc=_0xe706[_0x243e12];return _0x3fddfc;};'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 +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x434168,_0x3879ad){var _0x6deb70=function(_0x15c9d3){while(--_0x15c9d3){_0x434168['push'](_0x434168['shift']());}};_0x6deb70(++_0x3879ad);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index f740e09..5820251 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 _0xfafe=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','Request'];(function(_0x5e3022,_0x5ef1ae){var _0x1dd4b7=function(_0x133843){while(--_0x133843){_0x5e3022['push'](_0x5e3022['shift']());}};_0x1dd4b7(++_0x5ef1ae);}(_0xfafe,0x18e));var _0xefaf=function(_0x3a003d,_0x24b02f){_0x3a003d=_0x3a003d-0x0;var _0x56d711=_0xfafe[_0x3a003d];return _0x56d711;};'use strict';var client=require(_0xefaf('0x0'));exports['create']=function(_0x41a3b4){return client[_0xefaf('0x1')](_0xefaf('0x2'),{'body':_0x41a3b4,'log':_0xefaf('0x2')});};exports[_0xefaf('0x3')]=function(_0x1637c3,_0x2894e8,_0xe5f605){return client[_0xefaf('0x1')](_0xefaf('0x4'),{'body':_0x1637c3,'options':{'where':{'uniqueid':_0x2894e8,'interface':_0xe5f605,'agentcomplete':!![]}},'log':_0xefaf('0x4')});}; \ No newline at end of file +var _0xb33d=['UpdateVoiceAgentReport','create','Request','CreateVoiceAgentReport'];(function(_0x2b40d5,_0x172c10){var _0x481e2f=function(_0x53d036){while(--_0x53d036){_0x2b40d5['push'](_0x2b40d5['shift']());}};_0x481e2f(++_0x172c10);}(_0xb33d,0x175));var _0xdb33=function(_0x304655,_0x15b109){_0x304655=_0x304655-0x0;var _0x2fa58a=_0xb33d[_0x304655];return _0x2fa58a;};'use strict';var client=require('../client');exports[_0xdb33('0x0')]=function(_0x1dc3f8){return client[_0xdb33('0x1')]('CreateVoiceAgentReport',{'body':_0x1dc3f8,'log':_0xdb33('0x2')});};exports['update']=function(_0x467fb1,_0x3ba625,_0xd90041){return client['Request'](_0xdb33('0x3'),{'body':_0x467fb1,'options':{'where':{'uniqueid':_0x3ba625,'interface':_0xd90041,'agentcomplete':!![]}},'log':_0xdb33('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index b3b5db9..e821937 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 _0xfc88=['endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','calleridnum','context','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4ee9b4,_0x202684){var _0x39e67d=function(_0x48fe48){while(--_0x48fe48){_0x4ee9b4['push'](_0x4ee9b4['shift']());}};_0x39e67d(++_0x202684);}(_0xfc88,0xd8));var _0x8fc8=function(_0x4c11d3,_0x9a1021){_0x4c11d3=_0x4c11d3-0x0;var _0x54b611=_0xfc88[_0x4c11d3];return _0x54b611;};'use strict';var moment=require('moment');var util=require(_0x8fc8('0x0'));var _=require(_0x8fc8('0x1'));var client=require(_0x8fc8('0x2'));exports[_0x8fc8('0x3')]=function(_0x2ff848){return client[_0x8fc8('0x4')](_0x8fc8('0x5'),{'body':_['merge'](_0x2ff848,{'source':_0x2ff848[_0x8fc8('0x6')],'destinationcontext':_0x2ff848[_0x8fc8('0x7')],'callerid':_0x2ff848['callerid'],'amaflags':_0x8fc8('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x8fc8('0x9')]=function(){return function(){return client[_0x8fc8('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x8fc8('0xa')],'createdAt':{'$between':[moment()[_0x8fc8('0xb')](_0x8fc8('0xc'))[_0x8fc8('0xd')](_0x8fc8('0xe')),moment()[_0x8fc8('0xf')](_0x8fc8('0xc'))[_0x8fc8('0xd')](_0x8fc8('0xe'))]}},'attributes':[_0x8fc8('0x10'),_0x8fc8('0x11'),_0x8fc8('0x12'),_0x8fc8('0x13')]},'log':_0x8fc8('0x14')});};}; \ No newline at end of file +var _0x7ceb=['callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context'];(function(_0x28796f,_0x211ca4){var _0x49b191=function(_0x1a4adf){while(--_0x1a4adf){_0x28796f['push'](_0x28796f['shift']());}};_0x49b191(++_0x211ca4);}(_0x7ceb,0x14f));var _0xb7ce=function(_0x24db45,_0x412b6e){_0x24db45=_0x24db45-0x0;var _0x25c4af=_0x7ceb[_0x24db45];return _0x25c4af;};'use strict';var moment=require(_0xb7ce('0x0'));var util=require(_0xb7ce('0x1'));var _=require(_0xb7ce('0x2'));var client=require(_0xb7ce('0x3'));exports[_0xb7ce('0x4')]=function(_0x109a17){return client[_0xb7ce('0x5')](_0xb7ce('0x6'),{'body':_[_0xb7ce('0x7')](_0x109a17,{'source':_0x109a17[_0xb7ce('0x8')],'destinationcontext':_0x109a17[_0xb7ce('0x9')],'callerid':_0x109a17[_0xb7ce('0xa')],'amaflags':'DOCUMENTATION'}),'log':_0xb7ce('0x6')});};exports[_0xb7ce('0xb')]=function(){return function(){return client['Request'](_0xb7ce('0xc'),{'options':{'where':{'type':[_0xb7ce('0xd')],'createdAt':{'$between':[moment()[_0xb7ce('0xe')](_0xb7ce('0xf'))['format'](_0xb7ce('0x10')),moment()[_0xb7ce('0x11')](_0xb7ce('0xf'))[_0xb7ce('0x12')](_0xb7ce('0x10'))]}},'attributes':[_0xb7ce('0x13'),'disposition',_0xb7ce('0x14'),_0xb7ce('0x15')]},'log':_0xb7ce('0x16')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 6cf14f0..0c5ff31 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 _0x3405=['CreateVoiceDialReport','../client','Request'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0x3405,0x1c3));var _0x5340=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x3405[_0x56916d];return _0x2b7f1f;};'use strict';var client=require(_0x5340('0x0'));exports['create']=function(_0x2f78c2){return client[_0x5340('0x1')](_0x5340('0x2'),{'body':_0x2f78c2,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x7cb8=['CreateVoiceDialReport','create','Request'];(function(_0x33c2a5,_0x53c07c){var _0x18a9c1=function(_0x28d363){while(--_0x28d363){_0x33c2a5['push'](_0x33c2a5['shift']());}};_0x18a9c1(++_0x53c07c);}(_0x7cb8,0x1ab));var _0x87cb=function(_0x317562,_0x32343a){_0x317562=_0x317562-0x0;var _0x40215a=_0x7cb8[_0x317562];return _0x40215a;};'use strict';var client=require('../client');exports[_0x87cb('0x0')]=function(_0xe7b861){return client[_0x87cb('0x1')]('CreateVoiceDialReport',{'body':_0xe7b861,'log':_0x87cb('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index f039c2b..f2f103c 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 _0xb248=['GetVoiceExtension','exten','recordingFormat','../client','Request'];(function(_0x178298,_0x1b45ea){var _0x2b4535=function(_0x260fc7){while(--_0x260fc7){_0x178298['push'](_0x178298['shift']());}};_0x2b4535(++_0x1b45ea);}(_0xb248,0xc6));var _0x8b24=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb248[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0x8b24('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x8b24('0x1')](_0x8b24('0x2'),{'options':{'raw':!![],'attributes':['id',_0x8b24('0x3'),_0x8b24('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x1d5b=['../client','getVoiceExtensions','Request','exten'];(function(_0x315585,_0x1acf90){var _0x2d9542=function(_0x531ce8){while(--_0x531ce8){_0x315585['push'](_0x315585['shift']());}};_0x2d9542(++_0x1acf90);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x57104d,_0x1b5002){_0x57104d=_0x57104d-0x0;var _0x2dec2=_0x1d5b[_0x57104d];return _0x2dec2;};'use strict';var client=require(_0xb1d5('0x0'));exports[_0xb1d5('0x1')]=function(){return function(){return client[_0xb1d5('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xb1d5('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xb1d5('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 006dbf8..446a137 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 _0xd3fa=['timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','callerid','active','Pause','mandatoryDispositionPause','Trunk','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x4cc990,_0x25cbf7){var _0x5d916c=function(_0x386774){while(--_0x386774){_0x4cc990['push'](_0x4cc990['shift']());}};_0x5d916c(++_0x25cbf7);}(_0xd3fa,0xba));var _0xad3f=function(_0x5e065c,_0x438043){_0x5e065c=_0x5e065c-0x0;var _0x29c8cd=_0xd3fa[_0x5e065c];return _0x29c8cd;};'use strict';var client=require(_0xad3f('0x0'));exports[_0xad3f('0x1')]=function(){return function(){return client['Request'](_0xad3f('0x2'),{'options':{'raw':![],'attributes':['id',_0xad3f('0x3'),_0xad3f('0x4'),_0xad3f('0x5'),_0xad3f('0x6'),_0xad3f('0x7'),_0xad3f('0x8'),_0xad3f('0x9'),_0xad3f('0xa'),'dialLimitChannel',_0xad3f('0xb'),_0xad3f('0xc'),'dialPredictiveOptimization',_0xad3f('0xd'),_0xad3f('0xe'),'dialOriginateCallerIdName',_0xad3f('0xf'),'dialOriginateTimeout','dialQueueOptions',_0xad3f('0x10'),_0xad3f('0x11'),_0xad3f('0x12'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0xad3f('0x13'),'dialNoAnswerMaxRetry',_0xad3f('0x14'),_0xad3f('0x15'),_0xad3f('0x16'),_0xad3f('0x17'),_0xad3f('0x18'),_0xad3f('0x19'),_0xad3f('0x1a'),_0xad3f('0x1b'),_0xad3f('0x1c'),_0xad3f('0x1d'),_0xad3f('0x1e'),'dialAMDMinWordLength',_0xad3f('0x1f'),_0xad3f('0x20'),_0xad3f('0x21'),'dialAMDMaximumWordLength',_0xad3f('0x22'),_0xad3f('0x23'),_0xad3f('0x24'),'dialOrderByScheduledAt',_0xad3f('0x25'),'dialAgiAfterHangupClient',_0xad3f('0x26'),'monitor_format',_0xad3f('0x27'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xad3f('0x28'),'dialNoSuchNumberRetryFrequency',_0xad3f('0x29'),'dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency',_0xad3f('0x2a'),_0xad3f('0x2b'),'mandatoryDisposition',_0xad3f('0x2c'),'dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe',_0xad3f('0x2d'),_0xad3f('0x2e')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0xad3f('0x3'),_0xad3f('0x2f'),_0xad3f('0x30')]},{'model':_0xad3f('0x31'),'as':_0xad3f('0x32'),'attributes':['id',_0xad3f('0x3')]},{'model':_0xad3f('0x33'),'as':_0xad3f('0x34'),'attributes':['id',_0xad3f('0x3'),'callerid',_0xad3f('0x30')]},{'model':_0xad3f('0x35'),'as':_0xad3f('0x35'),'attributes':['id',_0xad3f('0x3')],'include':[{'model':_0xad3f('0x35'),'as':_0xad3f('0x36'),'attributes':['id',_0xad3f('0x3'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xede4=['GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialTimezone','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','callerid','Pause','TrunkBackup','active','Interval','getVoiceQueues','Request'];(function(_0x42c3ac,_0x50c9f){var _0x57e6a1=function(_0x37ae4b){while(--_0x37ae4b){_0x42c3ac['push'](_0x42c3ac['shift']());}};_0x57e6a1(++_0x50c9f);}(_0xede4,0x1cf));var _0x4ede=function(_0x25b481,_0x334f2d){_0x25b481=_0x25b481-0x0;var _0x170955=_0xede4[_0x25b481];return _0x170955;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0x4ede('0x0')](_0x4ede('0x1'),{'options':{'raw':![],'attributes':['id',_0x4ede('0x2'),_0x4ede('0x3'),_0x4ede('0x4'),_0x4ede('0x5'),_0x4ede('0x6'),_0x4ede('0x7'),'dialActive',_0x4ede('0x8'),'dialLimitChannel',_0x4ede('0x9'),_0x4ede('0xa'),_0x4ede('0xb'),_0x4ede('0xc'),'dialPredictiveInterval',_0x4ede('0xd'),'dialOriginateCallerIdNumber',_0x4ede('0xe'),_0x4ede('0xf'),'dialQueueTimeout',_0x4ede('0x10'),_0x4ede('0x11'),_0x4ede('0x12'),_0x4ede('0x13'),'dialBusyRetryFrequency',_0x4ede('0x14'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0x4ede('0x15'),'dialGlobalInterval',_0x4ede('0x16'),'dialCheckDuplicateType',_0x4ede('0x17'),_0x4ede('0x18'),'dialAMDGreeting',_0x4ede('0x19'),_0x4ede('0x1a'),'dialAMDMinWordLength',_0x4ede('0x1b'),_0x4ede('0x1c'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0x4ede('0x1d'),_0x4ede('0x1e'),_0x4ede('0x1f'),_0x4ede('0x20'),'dialAgiAfterHangupAgent',_0x4ede('0x21'),_0x4ede('0x22'),'monitor_format',_0x4ede('0x23'),_0x4ede('0x24'),_0x4ede('0x25'),_0x4ede('0x26'),_0x4ede('0x27'),'dialDropMaxRetry','dialDropRetryFrequency',_0x4ede('0x28'),'dialAbandonedRetryFrequency',_0x4ede('0x29'),_0x4ede('0x2a'),_0x4ede('0x2b'),_0x4ede('0x2c'),_0x4ede('0x2d'),_0x4ede('0x2e'),_0x4ede('0x2f'),_0x4ede('0x30'),_0x4ede('0x31'),_0x4ede('0x32')],'include':[{'model':_0x4ede('0x33'),'as':_0x4ede('0x33'),'attributes':['id',_0x4ede('0x2'),_0x4ede('0x34'),'active']},{'model':_0x4ede('0x35'),'as':'mandatoryDispositionPause','attributes':['id',_0x4ede('0x2')]},{'model':_0x4ede('0x33'),'as':_0x4ede('0x36'),'attributes':['id',_0x4ede('0x2'),_0x4ede('0x34'),_0x4ede('0x37')]},{'model':_0x4ede('0x38'),'as':'Interval','attributes':['id',_0x4ede('0x2')],'include':[{'model':_0x4ede('0x38'),'as':'Intervals','attributes':['id',_0x4ede('0x2'),'interval']}]}]},'log':_0x4ede('0x39')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 33698ed..e928be4 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(_0x2f8d2c,_0x223b81){var _0x3fa002=function(_0x114987){while(--_0x114987){_0x2f8d2c['push'](_0x2f8d2c['shift']());}};_0x3fa002(++_0x223b81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x5530ff,_0x52741f){var _0x5a563c=function(_0x3f6d3b){while(--_0x3f6d3b){_0x5530ff['push'](_0x5530ff['shift']());}};_0x5a563c(++_0x52741f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 4a93ee0..476284d 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 _0x59e6=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x477185,_0xa208be){var _0x1572c9=function(_0x47e6d9){while(--_0x47e6d9){_0x477185['push'](_0x477185['shift']());}};_0x1572c9(++_0xa208be);}(_0x59e6,0xdd));var _0x659e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x59e6[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x659e('0x0'));exports[_0x659e('0x1')]=function(_0x590efe){return function(){return client[_0x659e('0x2')](_0x659e('0x3'),{'options':{'where':{'VoiceQueueId':_0x590efe,'paused':!![]},'raw':!![]},'log':_0x659e('0x1')});};}; \ No newline at end of file +var _0xa354=['getVoiceQueueRtPauses','Request'];(function(_0x197c28,_0x4f0f6e){var _0x120b50=function(_0x4407ad){while(--_0x4407ad){_0x197c28['push'](_0x197c28['shift']());}};_0x120b50(++_0x4f0f6e);}(_0xa354,0x1aa));var _0x4a35=function(_0x579591,_0x49f3e9){_0x579591=_0x579591-0x0;var _0xe14748=_0xa354[_0x579591];return _0xe14748;};'use strict';var client=require('../client');exports[_0x4a35('0x0')]=function(_0x4b4d18){return function(){return client[_0x4a35('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x4b4d18,'paused':!![]},'raw':!![]},'log':_0x4a35('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 14d53c9..064cf52 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x272979,_0x526d50){var _0x5d878c=function(_0xae6782){while(--_0xae6782){_0x272979['push'](_0x272979['shift']());}};_0x5d878c(++_0x526d50);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1674f6,_0xf3e057){var _0x5e9047=function(_0x5bd477){while(--_0x5bd477){_0x1674f6['push'](_0x1674f6['shift']());}};_0x5e9047(++_0xf3e057);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 f8abee9..57d1059 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 _0x9e23=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname'];(function(_0x5519a9,_0x1c5147){var _0x32f2cc=function(_0x52ed58){while(--_0x52ed58){_0x5519a9['push'](_0x5519a9['shift']());}};_0x32f2cc(++_0x1c5147);}(_0x9e23,0xff));var _0x39e2=function(_0x7c6a3a,_0x1b0f68){_0x7c6a3a=_0x7c6a3a-0x0;var _0x5e6818=_0x9e23[_0x7c6a3a];return _0x5e6818;};'use strict';var client=require(_0x39e2('0x0'));exports[_0x39e2('0x1')]={};exports['blindTransfer']=function(_0x18c134){return client[_0x39e2('0x2')](_0x39e2('0x3'),{'body':{'result':_0x18c134['result'],'transfererchannel':_0x18c134['transfererchannel'],'transferercalleridnum':_0x18c134[_0x39e2('0x4')],'transferercalleridname':_0x18c134[_0x39e2('0x5')],'transfererconnectedlinenum':_0x18c134[_0x39e2('0x6')],'transfererconnectedlinename':_0x18c134[_0x39e2('0x7')],'transfereraccountcode':_0x18c134[_0x39e2('0x8')],'transferercontext':_0x18c134[_0x39e2('0x9')],'transfererexten':_0x18c134['transfererexten'],'transfererlinkedid':_0x18c134[_0x39e2('0xa')],'transfereechannel':_0x18c134['transfereechannel'],'transfereecalleridnum':_0x18c134['transfereecalleridnum'],'transfereecalleridname':_0x18c134[_0x39e2('0xb')],'transfereeconnectedlinenum':_0x18c134[_0x39e2('0xc')],'transfereeconnectedlinename':_0x18c134[_0x39e2('0xd')],'transfereeaccountcode':_0x18c134['transfereeaccountcode'],'transfereecontext':_0x18c134[_0x39e2('0xe')],'transfereeexten':_0x18c134[_0x39e2('0xf')],'transfereelinkedid':_0x18c134[_0x39e2('0x10')],'isexternal':_0x18c134[_0x39e2('0x11')],'context':_0x18c134['context'],'extension':_0x18c134[_0x39e2('0x12')],'type':_0x39e2('0x13')},'log':_0x39e2('0x3')});};exports[_0x39e2('0x14')]=function(_0x4d870a){return client[_0x39e2('0x2')](_0x39e2('0x3'),{'body':{'result':_0x4d870a[_0x39e2('0x15')],'transfererchannel':_0x4d870a[_0x39e2('0x16')],'transferercalleridnum':_0x4d870a[_0x39e2('0x17')],'transferercalleridname':_0x4d870a[_0x39e2('0x18')],'transfererconnectedlinenum':_0x4d870a[_0x39e2('0x19')],'transfererconnectedlinename':_0x4d870a[_0x39e2('0x1a')],'transfereraccountcode':_0x4d870a[_0x39e2('0x1b')],'transferercontext':_0x4d870a[_0x39e2('0x1c')],'transfererexten':_0x4d870a[_0x39e2('0x1d')],'transfererlinkedid':_0x4d870a[_0x39e2('0x1e')],'transfereechannel':_0x4d870a[_0x39e2('0x1f')],'transfereecalleridnum':_0x4d870a['transfertargetcalleridnum'],'transfereecalleridname':_0x4d870a[_0x39e2('0x20')],'transfereeconnectedlinenum':_0x4d870a['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4d870a['transfertargetconnectedlinename'],'transfereeaccountcode':_0x4d870a[_0x39e2('0x21')],'transfereecontext':_0x4d870a[_0x39e2('0x22')],'transfereeexten':_0x4d870a[_0x39e2('0x23')],'transfereelinkedid':_0x4d870a[_0x39e2('0x24')],'isexternal':_0x4d870a[_0x39e2('0x11')],'context':_0x4d870a[_0x39e2('0x25')],'extension':_0x4d870a[_0x39e2('0x26')],'type':_0x39e2('0x27')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xac2a=['secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','CreateVoiceTransferReport','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac2a,0x94));var _0xaac2=function(_0x38ea3e,_0x2ad408){_0x38ea3e=_0x38ea3e-0x0;var _0x44588e=_0xac2a[_0x38ea3e];return _0x44588e;};'use strict';var client=require(_0xaac2('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0x1ff691){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x1ff691['result'],'transfererchannel':_0x1ff691[_0xaac2('0x1')],'transferercalleridnum':_0x1ff691[_0xaac2('0x2')],'transferercalleridname':_0x1ff691['transferercalleridname'],'transfererconnectedlinenum':_0x1ff691[_0xaac2('0x3')],'transfererconnectedlinename':_0x1ff691[_0xaac2('0x4')],'transfereraccountcode':_0x1ff691[_0xaac2('0x5')],'transferercontext':_0x1ff691[_0xaac2('0x6')],'transfererexten':_0x1ff691[_0xaac2('0x7')],'transfererlinkedid':_0x1ff691[_0xaac2('0x8')],'transfereechannel':_0x1ff691[_0xaac2('0x9')],'transfereecalleridnum':_0x1ff691[_0xaac2('0xa')],'transfereecalleridname':_0x1ff691[_0xaac2('0xb')],'transfereeconnectedlinenum':_0x1ff691[_0xaac2('0xc')],'transfereeconnectedlinename':_0x1ff691[_0xaac2('0xd')],'transfereeaccountcode':_0x1ff691[_0xaac2('0xe')],'transfereecontext':_0x1ff691[_0xaac2('0xf')],'transfereeexten':_0x1ff691[_0xaac2('0x10')],'transfereelinkedid':_0x1ff691[_0xaac2('0x11')],'isexternal':_0x1ff691[_0xaac2('0x12')],'context':_0x1ff691['context'],'extension':_0x1ff691[_0xaac2('0x13')],'type':_0xaac2('0x14')},'log':_0xaac2('0x15')});};exports[_0xaac2('0x16')]=function(_0x1d2070){return client[_0xaac2('0x17')](_0xaac2('0x15'),{'body':{'result':_0x1d2070[_0xaac2('0x18')],'transfererchannel':_0x1d2070[_0xaac2('0x19')],'transferercalleridnum':_0x1d2070[_0xaac2('0x1a')],'transferercalleridname':_0x1d2070[_0xaac2('0x1b')],'transfererconnectedlinenum':_0x1d2070[_0xaac2('0x1c')],'transfererconnectedlinename':_0x1d2070['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1d2070[_0xaac2('0x1d')],'transferercontext':_0x1d2070[_0xaac2('0x1e')],'transfererexten':_0x1d2070[_0xaac2('0x1f')],'transfererlinkedid':_0x1d2070[_0xaac2('0x20')],'transfereechannel':_0x1d2070[_0xaac2('0x21')],'transfereecalleridnum':_0x1d2070[_0xaac2('0x22')],'transfereecalleridname':_0x1d2070[_0xaac2('0x23')],'transfereeconnectedlinenum':_0x1d2070[_0xaac2('0x24')],'transfereeconnectedlinename':_0x1d2070[_0xaac2('0x25')],'transfereeaccountcode':_0x1d2070[_0xaac2('0x26')],'transfereecontext':_0x1d2070[_0xaac2('0x27')],'transfereeexten':_0x1d2070[_0xaac2('0x28')],'transfereelinkedid':_0x1d2070[_0xaac2('0x29')],'isexternal':_0x1d2070[_0xaac2('0x12')],'context':_0x1d2070['origtransferercontext'],'extension':_0x1d2070[_0xaac2('0x2a')],'type':_0xaac2('0x2b')},'log':_0xaac2('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 1c1d324..6083240 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 _0x705f=['action','Action','message','isConnected','join','Command','then','content','catch','error','voiceQueues','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','%s.%s','filename','format','wav','channel','ai(mixmonitorid)','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','/var/spool/asterisk/monitor/','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','validate','Hangup','voicequeuechannelredirect','context','telephones','trunks','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','server','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','asterisk','username','ami\x20disconnected','pick','keys','module'];(function(_0x1789bc,_0x1acf84){var _0x35efd1=function(_0x2329b2){while(--_0x2329b2){_0x1789bc['push'](_0x1789bc['shift']());}};_0x35efd1(++_0x1acf84);}(_0x705f,0x75));var _0xf705=function(_0xc498b3,_0x5610b4){_0xc498b3=_0xc498b3-0x0;var _0x1e2530=_0x705f[_0xc498b3];return _0x1e2530;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0xf705('0x0'));var schema=require('validate');var moment=require(_0xf705('0x1'));var config=require(_0xf705('0x2'));var properties=require(_0xf705('0x3'));var ami=require(_0xf705('0x4'));exports[_0xf705('0x5')]=function(_0x47514c,_0x9045cf,_0x240742){return new Promise(function(_0x10214c,_0x991602){var _0x32c99d={'QueuePause':function(_0x48eb92){return new Promise(function(_0x51fda8){var _0xc244e3=util['format'](_0xf705('0x6'),_0xf705('0x7'),_0x48eb92['name']);if(_0x47514c['timers']&&_0x47514c[_0xf705('0x8')][_0xc244e3]&&_0x47514c[_0xf705('0x8')][_0xc244e3][_0xf705('0x9')]){_0x47514c[_0xf705('0x8')][_0xc244e3][_0xf705('0xa')]();}if(_0x47514c[_0xf705('0xb')][_0xc244e3]){_0x47514c[_0xf705('0xb')][_0xc244e3][_0xf705('0xc')]({'statePause':_0x48eb92['pause']?!![]:![]});}_0x51fda8({'code':0xc8,'message':_0xf705('0xd')});});},'Reload':function(_0x296a62){var _0xb50c9f=this;return new Promise(function(_0xf625da,_0x31e6f5){if(ami['isConnected']()==![]){return _0x31e6f5(_0xb50c9f['error'](0x1f4,[config[_0xf705('0xe')]['ip'],config[_0xf705('0xe')][_0xf705('0xf')],_0xf705('0x10')]['join']('\x20')));}_0x296a62=_[_0xf705('0x11')](_0x296a62,_[_0xf705('0x12')](properties[_0xf705('0x13')]));_0x296a62[_0xf705('0x14')]='Reload';return ami[_0xf705('0x15')](_0x296a62)['then'](function(_0x151091){_0xf625da({'code':0xc8,'message':_0x151091[_0xf705('0x16')]});})['catch'](function(_0xa9a2ca){_0x31e6f5(_0xb50c9f['error'](0x1f5,_0xa9a2ca[_0xf705('0x16')]));});});},'Command':function(_0x5c05ae){var _0x57d537=this;return new Promise(function(_0xe4e1e7,_0xfee2a8){if(ami[_0xf705('0x17')]()==![]){return _0xfee2a8(_0x57d537['error'](0x1f4,[config[_0xf705('0xe')]['ip'],config[_0xf705('0xe')][_0xf705('0xf')],'ami\x20disconnected'][_0xf705('0x18')]('\x20')));}_0x5c05ae=_['pick'](_0x5c05ae,'command');_0x5c05ae[_0xf705('0x14')]=_0xf705('0x19');return ami[_0xf705('0x15')](_0x5c05ae)[_0xf705('0x1a')](function(_0x31f244){_0xe4e1e7({'code':0xc8,'message':_0x31f244[_0xf705('0x1b')]});})[_0xf705('0x1c')](function(_0x10dfc9){_0xfee2a8(_0x57d537[_0xf705('0x1d')](0x1f5,_0x10dfc9[_0xf705('0x16')]));});});},'VoiceQueues':function(){return new Promise(function(_0x2b5717){var _0x55f5b9=[];for(var _0x1bb7f8 in _0x47514c['voiceQueues']){if(_0x47514c[_0xf705('0x1e')]['hasOwnProperty'](_0x1bb7f8)){var _0x5eadda=_0x47514c[_0xf705('0x1e')][_0x1bb7f8];var _0x33da21={'id':_0x5eadda['id'],'name':_0x5eadda['name'],'strategy':_0x5eadda['strategy'],'answered':_0x5eadda[_0xf705('0x1f')],'available':_0x5eadda[_0xf705('0x20')],'loggedIn':_0x5eadda[_0xf705('0x21')],'pTalking':_0x5eadda[_0xf705('0x22')],'sumBillable':_0x5eadda[_0xf705('0x23')],'sumDuration':_0x5eadda['sumDuration'],'sumHoldTime':_0x5eadda[_0xf705('0x24')]||0x0,'talking':_0x5eadda[_0xf705('0x25')],'total':_0x5eadda[_0xf705('0x26')],'type':_0x5eadda['type'],'unmanaged':_0x5eadda['unmanaged'],'abandoned':_0x5eadda['abandoned'],'waiting':_0x5eadda['waiting'],'loggedInDb':_0x5eadda[_0xf705('0x27')]};if(_0x5eadda['type']==='outbound'){_0x33da21[_0xf705('0x28')]=_0x5eadda[_0xf705('0x28')];_0x33da21[_0xf705('0x29')]=_0x5eadda[_0xf705('0x29')];_0x33da21[_0xf705('0x2a')]=_0x5eadda['dialOriginateCallerIdName'];_0x33da21['dialOriginateCallerIdNumber']=_0x5eadda[_0xf705('0x2b')];_0x33da21[_0xf705('0x2c')]=_0x5eadda[_0xf705('0x2c')];_0x33da21[_0xf705('0x2d')]=_0x5eadda[_0xf705('0x2d')];_0x33da21[_0xf705('0x2e')]=_0x5eadda[_0xf705('0x2e')];_0x33da21[_0xf705('0x2f')]=_0x5eadda['outboundAnswerAgiCallsDay'];_0x33da21[_0xf705('0x30')]=_0x5eadda['outboundAnswerCallsDay'];_0x33da21[_0xf705('0x31')]=_0x5eadda['outboundBlacklistCallsDay'];_0x33da21[_0xf705('0x32')]=_0x5eadda[_0xf705('0x32')];_0x33da21[_0xf705('0x33')]=_0x5eadda[_0xf705('0x33')];_0x33da21[_0xf705('0x34')]=_0x5eadda[_0xf705('0x34')];_0x33da21[_0xf705('0x35')]=_0x5eadda['outboundDropCallsDayCallersExit'];_0x33da21[_0xf705('0x36')]=_0x5eadda[_0xf705('0x36')];_0x33da21[_0xf705('0x37')]=_0x5eadda['outboundNoAnswerCallsDay'];_0x33da21['outboundNoSuchCallsDay']=_0x5eadda[_0xf705('0x38')];_0x33da21['outboundOriginateFailureCallsDay']=_0x5eadda[_0xf705('0x39')];_0x33da21[_0xf705('0x3a')]=_0x5eadda[_0xf705('0x3a')];_0x33da21['outboundRejectCallsDay']=_0x5eadda[_0xf705('0x3b')];_0x33da21['outboundUnknownCallsDay']=_0x5eadda[_0xf705('0x3c')];_0x33da21[_0xf705('0x3d')]=_0x5eadda[_0xf705('0x3d')];_0x33da21['predictiveIntervalAvgHoldtime']=_0x5eadda[_0xf705('0x3e')];_0x33da21['predictiveIntervalAvgTalktime']=_0x5eadda[_0xf705('0x3f')];_0x33da21[_0xf705('0x40')]=_0x5eadda[_0xf705('0x40')];_0x33da21[_0xf705('0x41')]=_0x5eadda[_0xf705('0x41')];_0x33da21[_0xf705('0x42')]=_0x5eadda['predictiveIntervalErlangCalls'];_0x33da21[_0xf705('0x43')]=_0x5eadda[_0xf705('0x43')];_0x33da21[_0xf705('0x44')]=_0x5eadda[_0xf705('0x44')];_0x33da21['predictiveIntervalMultiplicativeFactor']=_0x5eadda['predictiveIntervalMultiplicativeFactor'];_0x33da21[_0xf705('0x45')]=_0x5eadda[_0xf705('0x45')];_0x33da21['predictiveIntervalAvailable']=_0x5eadda[_0xf705('0x46')];_0x33da21[_0xf705('0x47')]=_0x5eadda[_0xf705('0x47')];_0x33da21['message']=_0x5eadda[_0xf705('0x16')];_0x33da21[_0xf705('0x48')]=_0x5eadda['originated'];_0x33da21[_0xf705('0x49')]=_0x5eadda[_0xf705('0x49')];_0x33da21[_0xf705('0x4a')]=_0x5eadda[_0xf705('0x4a')];_0x33da21[_0xf705('0x4b')]=_0x5eadda[_0xf705('0x4b')];_0x33da21[_0xf705('0x4c')]=_0x5eadda[_0xf705('0x4c')];_0x33da21[_0xf705('0x4d')]=_0x5eadda[_0xf705('0x4d')];_0x33da21[_0xf705('0x4e')]=_0x5eadda['startProgressive'];}if(_0x5eadda['Trunk']){_0x33da21['Trunk']={'id':_0x5eadda[_0xf705('0x4f')]['id'],'name':_0x5eadda[_0xf705('0x4f')][_0xf705('0x50')],'active':_0x5eadda['Trunk'][_0xf705('0x51')],'callerid':_0x5eadda[_0xf705('0x4f')][_0xf705('0x52')]};}if(_0x5eadda[_0xf705('0x53')]){_0x33da21[_0xf705('0x53')]={'id':_0x5eadda[_0xf705('0x53')]['id'],'name':_0x5eadda['Interval']['name']};}_0x55f5b9[_0xf705('0x54')](_0x33da21);}}_0x2b5717({'count':_0x55f5b9[_0xf705('0x55')],'rows':_0x55f5b9});});},'UpdateVoiceQueue':function(_0x54eb4b){return new Promise(function(_0xe5487b,_0x1dd6f5){var _0x2701a8=_[_0xf705('0x56')](_0x47514c['voiceQueues'],{'id':parseInt(_0x54eb4b['id'])});var _0x3f3f72=_[_0xf705('0x57')](_0x54eb4b,['id']);if(_0x2701a8){for(var _0x512845 in _0x3f3f72){if(typeof _0x3f3f72[_0x512845]!==_0xf705('0x58')&&typeof _0x2701a8[_0x512845]!==_0xf705('0x58')){_0x2701a8[_0x512845]=_0x3f3f72[_0x512845];}}_0xe5487b(_0x2701a8);}else{_0x1dd6f5();}});},'VoiceChannels':function(){return new Promise(function(_0x44cb0a){var _0x32b47c=_[_0xf705('0x59')](_0x47514c[_0xf705('0x5a')]);_0x44cb0a({'count':_0x32b47c[_0xf705('0x55')],'rows':_0x32b47c});});},'VoiceChannelMixMonitor':function(_0x21c6c3){var _0x28f6f9=this;return new Promise(function(_0x4a5a02,_0x5b5463){if(ami[_0xf705('0x17')]()==![]){return _0x5b5463(_0x28f6f9[_0xf705('0x1d')](0x1f4,[config['asterisk']['ip'],config[_0xf705('0xe')][_0xf705('0xf')],_0xf705('0x10')][_0xf705('0x18')]('\x20')));}var _0x99c560=schema(properties[_0xf705('0x5b')])['validate'](_0x21c6c3);if(_0x99c560['length']>0x0){return _0x5b5463(_0x28f6f9['error'](0x1f4,_[_0xf705('0x5c')](_0x99c560,_0xf705('0x16'))[_0xf705('0x18')](',\x20')));}var _0x48f54f=_[_0xf705('0x56')](_0x47514c[_0xf705('0x5a')],{'uniqueid':_0x21c6c3[_0xf705('0x5d')]});if(_0x48f54f&&_0x48f54f['channel']){var _0x5b8f3f=util['format'](_0xf705('0x5e'),_0x21c6c3[_0xf705('0x5f')]||_0x21c6c3[_0xf705('0x5d')],_0x21c6c3[_0xf705('0x60')]||_0xf705('0x61'));return ami[_0xf705('0x15')]({'action':'MixMonitor','channel':_0x48f54f[_0xf705('0x62')],'file':_0x5b8f3f,'options':_0xf705('0x63')})[_0xf705('0x1a')](function(_0x10f4c4){var _0x20df2e=_[_0xf705('0x56')](_0x48f54f['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x5b8f3f[_0xf705('0x64')]()});if(_[_0xf705('0x65')](_0x20df2e)){_0x48f54f[_0xf705('0x66')][_0xf705('0x54')]({'filename':'/var/spool/asterisk/monitor/'+_0x5b8f3f[_0xf705('0x64')](),'createdAt':moment()[_0xf705('0x60')](_0xf705('0x67')),'mixmonitorid':_0x10f4c4[_0xf705('0x68')],'status':_0xf705('0x69')});}else{_0x20df2e[_0xf705('0x68')]=_0x10f4c4[_0xf705('0x68')];_0x20df2e[_0xf705('0x6a')]=_0xf705('0x69');}_0x4a5a02({'code':0xc8,'message':[_0x21c6c3[_0xf705('0x5d')],_0xf705('0x6b'),_0x10f4c4['mixmonitorid']][_0xf705('0x18')]('\x20'),'mixmonitorid':_0x10f4c4[_0xf705('0x68')]});})[_0xf705('0x1c')](function(_0x467c39){_0x5b5463(_0x28f6f9[_0xf705('0x1d')](0x1f5,[_0x21c6c3[_0xf705('0x5d')],_0x467c39[_0xf705('0x16')][_0xf705('0x64')]()][_0xf705('0x18')]('\x20')));});}else{return _0x5b5463(_0x28f6f9[_0xf705('0x1d')](0x1f5,_0xf705('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x172775){var _0x126012=this;return new Promise(function(_0x47ad4f,_0x2b5f88){if(ami[_0xf705('0x17')]()==![]){return _0x2b5f88(_0x126012[_0xf705('0x1d')](0x1f4,[config[_0xf705('0xe')]['ip'],config[_0xf705('0xe')][_0xf705('0xf')],'ami\x20disconnected'][_0xf705('0x18')]('\x20')));}var _0x1de4db=schema(properties['voicechannel'])['validate'](_0x172775);if(_0x1de4db[_0xf705('0x55')]>0x0){return _0x2b5f88(_0x126012[_0xf705('0x1d')](0x1f4,_[_0xf705('0x5c')](_0x1de4db,'message')[_0xf705('0x18')](',\x20')));}var _0xef945d=_['find'](_0x47514c[_0xf705('0x5a')],{'uniqueid':_0x172775['uniqueid']});if(_0xef945d){return Promise[_0xf705('0x6d')]()['then'](function(){if(_0xef945d[_0xf705('0x62')]){return ami[_0xf705('0x15')]({'action':_0xf705('0x6e'),'channel':_0xef945d[_0xf705('0x62')],'mixmonitorid':_0x172775['mixmonitorid']})['catch'](function(){});}})[_0xf705('0x1a')](function(){if(_0xef945d[_0xf705('0x6f')]){return ami[_0xf705('0x15')]({'action':'StopMixMonitor','channel':_0xef945d[_0xf705('0x6f')],'mixmonitorid':_0x172775['mixmonitorid']})['catch'](function(){});}})[_0xf705('0x1a')](function(){var _0x5d68ef=_[_0xf705('0x56')](_0xef945d[_0xf705('0x66')],{'mixmonitorid':_0x172775[_0xf705('0x68')]});if(_0x5d68ef){_0x5d68ef['status']=_0xf705('0x70');}})[_0xf705('0x1a')](function(){var _0x1cd5ef=util['format'](_0xf705('0x5e'),_0x172775[_0xf705('0x5f')]||_0x172775['uniqueid'],_0x172775[_0xf705('0x60')]||'wav');var _0x49a341=_[_0xf705('0x56')](_0xef945d[_0xf705('0x66')],{'filename':_0xf705('0x71')+_0x1cd5ef[_0xf705('0x64')]()});if(_0x49a341){_0x49a341[_0xf705('0x6a')]=_0xf705('0x70');}})[_0xf705('0x1a')](function(){_0x47ad4f({'code':0xc8,'message':[_0x172775[_0xf705('0x5d')],_0xf705('0x72')][_0xf705('0x18')]('\x20')});})[_0xf705('0x1c')](function(_0x191bb7){_0x2b5f88(_0x126012[_0xf705('0x1d')](0x1f5,[_0x172775['uniqueid'],_0x191bb7[_0xf705('0x16')][_0xf705('0x64')]()][_0xf705('0x18')]('\x20')));});}else{return _0x2b5f88(_0x126012[_0xf705('0x1d')](0x1f5,_0xf705('0x6c')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x1d251e){var _0x361ebf=_[_0xf705('0x59')](_0x47514c[_0xf705('0x73')]);_0x1d251e({'count':_0x361ebf['length'],'rows':_0x361ebf});});},'VoiceQueuesChannel':function(_0x5e45f5){var _0x4a8b9e=this;return new Promise(function(_0xfbe9d0,_0x209eef){var _0x32a90f=schema(properties[_0xf705('0x74')])['validate'](_0x5e45f5);if(_0x32a90f[_0xf705('0x55')]>0x0){return _0x209eef(_0x4a8b9e[_0xf705('0x1d')](0x1f4,_[_0xf705('0x5c')](_0x32a90f,_0xf705('0x16'))['join'](',\x20')));}var _0x3795da=_['find'](_0x47514c[_0xf705('0x73')],{'uniqueid':_0x5e45f5[_0xf705('0x5d')]});if(_0x3795da){_0xfbe9d0(_0x3795da);}else{return _0x209eef(_0x4a8b9e[_0xf705('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x46c30d){var _0x62068a=this;return new Promise(function(_0x2e4287,_0xb69d8){if(ami[_0xf705('0x17')]()==![]){return _0xb69d8(_0x62068a[_0xf705('0x1d')](0x1f4,[config[_0xf705('0xe')]['ip'],config['asterisk'][_0xf705('0xf')],_0xf705('0x10')][_0xf705('0x18')]('\x20')));}var _0x251151=schema(properties[_0xf705('0x75')])[_0xf705('0x76')](_0x46c30d);if(_0x251151[_0xf705('0x55')]>0x0){return _0xb69d8(_0x62068a[_0xf705('0x1d')](0x1f4,_[_0xf705('0x5c')](_0x251151,_0xf705('0x16'))[_0xf705('0x18')](',\x20')));}var _0x2179ad=_[_0xf705('0x56')](_0x47514c[_0xf705('0x73')],{'uniqueid':_0x46c30d[_0xf705('0x5d')]});if(_0x2179ad&&_0x2179ad[_0xf705('0x62')]){return ami['Action']({'action':_0xf705('0x77'),'channel':_0x2179ad['channel']})[_0xf705('0x1a')](function(_0x81d480){_0x2e4287({'code':0xc8,'message':[_0x46c30d[_0xf705('0x5d')],_0x81d480['message'][_0xf705('0x64')]()][_0xf705('0x18')]('\x20')});})[_0xf705('0x1c')](function(_0xb941c8){_0xb69d8(_0x62068a[_0xf705('0x1d')](0x1f5,[_0x46c30d[_0xf705('0x5d')],_0xb941c8[_0xf705('0x16')][_0xf705('0x64')]()][_0xf705('0x18')]('\x20')));});}else{return _0xb69d8(_0x62068a[_0xf705('0x1d')](0x1f5,_0xf705('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x4edcb5){var _0x235d11=this;return new Promise(function(_0x569db9,_0x42b9e5){if(ami['isConnected']()==![]){return _0x42b9e5(_0x235d11[_0xf705('0x1d')](0x1f4,[config['asterisk']['ip'],config[_0xf705('0xe')][_0xf705('0xf')],_0xf705('0x10')]['join']('\x20')));}var _0x28ff25=schema(properties[_0xf705('0x78')])['validate'](_0x4edcb5);if(_0x28ff25['length']>0x0){return _0x42b9e5(_0x235d11[_0xf705('0x1d')](0x1f4,_[_0xf705('0x5c')](_0x28ff25,_0xf705('0x16'))[_0xf705('0x18')](',\x20')));}var _0x4d5884=_['find'](_0x47514c[_0xf705('0x73')],{'uniqueid':_0x4edcb5['uniqueid']});if(_0x4d5884&&_0x4d5884['channel']){return ami[_0xf705('0x15')]({'action':'Redirect','channel':_0x4d5884[_0xf705('0x62')],'exten':_0x4edcb5['exten'],'context':_0x4edcb5[_0xf705('0x79')]||_0x4d5884['context'],'priority':0x1})['then'](function(_0x158b2c){_0x569db9({'code':0xc8,'message':[_0x4edcb5[_0xf705('0x5d')],_0x158b2c['message'][_0xf705('0x64')]()][_0xf705('0x18')]('\x20')});})[_0xf705('0x1c')](function(_0x17c4c3){_0x42b9e5(_0x235d11[_0xf705('0x1d')](0x1f5,[_0x4edcb5[_0xf705('0x5d')],_0x17c4c3['message'][_0xf705('0x64')]()][_0xf705('0x18')]('\x20')));});}else{return _0x42b9e5(_0x235d11[_0xf705('0x1d')](0x1f5,_0xf705('0x6c')));}});},'Agents':function(_0x4afdf4){return new Promise(function(_0x1f8a5d){var _0x1293db=_[_0xf705('0x59')](_0x47514c[_0xf705('0xb')]);if(_0x4afdf4&&_0x4afdf4['id']){var _0x500d18=_[_0xf705('0x56')](_0x1293db,function(_0x1a2e7d){return _0x1a2e7d['id']===_0x4afdf4['id'];});_0x1f8a5d(_0x500d18);}else{_0x1f8a5d({'count':_0x1293db['length'],'rows':_0x1293db});}});},'Telephones':function(){return new Promise(function(_0x154cdd){var _0x189164=_[_0xf705('0x59')](_0x47514c[_0xf705('0x7a')]);_0x154cdd({'count':_0x189164[_0xf705('0x55')],'rows':_0x189164});});},'Trunks':function(){return new Promise(function(_0x4d761d){var _0x732902=_['values'](_0x47514c[_0xf705('0x7b')]);_0x4d761d({'count':_0x732902[_0xf705('0x55')],'rows':_0x732902});});},'OutboundChannels':function(){return new Promise(function(_0xfd01d7){var _0x4cce4e=_['values'](_0x47514c[_0xf705('0x7c')]);_0xfd01d7({'count':_0x4cce4e['length'],'rows':_0x4cce4e});});},'Outbound':function(){return new Promise(function(_0x3284d6){_0x3284d6(_0x47514c[_0xf705('0x7d')]);});},'Campaigns':function(){return new Promise(function(_0x5936a9){var _0x1be27f=_[_0xf705('0x59')](_0x47514c[_0xf705('0x7e')]);_0x5936a9({'count':_0x1be27f[_0xf705('0x55')],'rows':_0x1be27f});});},'VoiceQueuesPreview':function(_0x59c924){var _0x50859c=this;return new Promise(function(_0x1bd302,_0x36616c){_0x9045cf[_0xf705('0x7f')](_0x59c924['id'])[_0xf705('0x1a')](function(_0x596bf4){_0x1bd302({'code':0xc8,'message':_0x596bf4['message']});})['catch'](function(_0x2bcb7f){_0x36616c(_0x50859c['error'](0x1f4,_0x2bcb7f[_0xf705('0x16')]));});});},'EventManager':function(_0x16a796){var _0x2b16bc=this;return new Promise(function(_0x1f668a,_0x104e23){if(!_0x16a796[_0xf705('0x80')]){return _0x104e23(_0x2b16bc['error'](0x1f4,_0xf705('0x81')));}ami[_0xf705('0x82')]('custom:'+_0x16a796['event'],_0x16a796[_0xf705('0x16')]);_0x1f668a({'code':0xc8,'message':_0x16a796});});},'FaxAccounts':function(){return new Promise(function(_0x3c9d65){var _0x10b7a9=_[_0xf705('0x59')](_0x47514c[_0xf705('0x83')]);_0x3c9d65({'count':_0x10b7a9[_0xf705('0x55')],'rows':_0x10b7a9});});},'SendFax':function(_0x312105){var _0xe20519=this;return new Promise(function(_0x5f3ba7,_0x53e2a6){_0x240742[_0xf705('0x84')](_0x312105)[_0xf705('0x1a')](function(_0x81ccf4){_0x5f3ba7({'code':0xc8,'message':_0x81ccf4[_0xf705('0x16')]});})[_0xf705('0x1c')](function(_0x97fc56){_0x53e2a6(_0xe20519[_0xf705('0x1d')](0x1f4,_0x97fc56[_0xf705('0x16')]));});});},'CheckAfterSend':function(_0x26eed2){var _0x36f7fe=this;return new Promise(function(_0xd9aa9e,_0x42116c){_0x240742['checkAfterSend'](_0x26eed2)[_0xf705('0x1a')](function(_0x296dac){_0xd9aa9e({'code':0xc8,'message':_0x296dac[_0xf705('0x16')]});})[_0xf705('0x1c')](function(_0x2e51bd){_0x42116c(_0x36f7fe[_0xf705('0x1d')](0x1f4,_0x2e51bd[_0xf705('0x16')]));});});}};var _0x2eb975=jayson[_0xf705('0x85')](_0x32c99d)['http']();_0x2eb975['on'](_0xf705('0x1d'),function(_0x416c8d){return _0x991602(_0x416c8d);});_0x2eb975['listen'](0x232a,'127.0.0.1',function(){console[_0xf705('0x86')](_0xf705('0x87'),0x232a);return _0x10214c(_0xf705('0x88')+0x232a);});});}; \ No newline at end of file +var _0x073e=['QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','message','catch','isConnected','command','Action','then','content','voiceQueues','strategy','answered','available','pTalking','sumDuration','sumHoldTime','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','find','undefined','values','channels','length','voicechannel','map','uniqueid','channel','%s.%s','wav','MixMonitor','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','StopMixMonitor','filename','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','../ami','listen','format','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime'];(function(_0x28125d,_0x2703f3){var _0x457218=function(_0x26b491){while(--_0x26b491){_0x28125d['push'](_0x28125d['shift']());}};_0x457218(++_0x2703f3);}(_0x073e,0x181));var _0xe073=function(_0x254639,_0x52d8b2){_0x254639=_0x254639-0x0;var _0x582063=_0x073e[_0x254639];return _0x582063;};'use strict';var _=require(_0xe073('0x0'));var util=require(_0xe073('0x1'));var jayson=require(_0xe073('0x2'));var schema=require(_0xe073('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0xe073('0x4'));exports[_0xe073('0x5')]=function(_0x29444b,_0x5ce161,_0x5b9324){return new Promise(function(_0x4bc6b3,_0x45995e){var _0x44092d={'QueuePause':function(_0x1bcaae){return new Promise(function(_0x3b4fc7){var _0x373bf6=util[_0xe073('0x6')]('%s/%s',_0xe073('0x7'),_0x1bcaae[_0xe073('0x8')]);if(_0x29444b[_0xe073('0x9')]&&_0x29444b[_0xe073('0x9')][_0x373bf6]&&_0x29444b['timers'][_0x373bf6][_0xe073('0xa')]){_0x29444b[_0xe073('0x9')][_0x373bf6][_0xe073('0xb')]();}if(_0x29444b[_0xe073('0xc')][_0x373bf6]){_0x29444b[_0xe073('0xc')][_0x373bf6][_0xe073('0xd')]({'statePause':_0x1bcaae['pause']?!![]:![]});}_0x3b4fc7({'code':0xc8,'message':_0xe073('0xe')});});},'Reload':function(_0x56e3f5){var _0x3dedf7=this;return new Promise(function(_0x5d2f2f,_0x3549c4){if(ami['isConnected']()==![]){return _0x3549c4(_0x3dedf7[_0xe073('0xf')](0x1f4,[config[_0xe073('0x10')]['ip'],config[_0xe073('0x10')][_0xe073('0x11')],_0xe073('0x12')][_0xe073('0x13')]('\x20')));}_0x56e3f5=_[_0xe073('0x14')](_0x56e3f5,_[_0xe073('0x15')](properties[_0xe073('0x16')]));_0x56e3f5[_0xe073('0x17')]=_0xe073('0x18');return ami['Action'](_0x56e3f5)['then'](function(_0x53938b){_0x5d2f2f({'code':0xc8,'message':_0x53938b[_0xe073('0x19')]});})[_0xe073('0x1a')](function(_0x10486c){_0x3549c4(_0x3dedf7[_0xe073('0xf')](0x1f5,_0x10486c['message']));});});},'Command':function(_0x4fdd2c){var _0x103a51=this;return new Promise(function(_0x2a63c6,_0x54c10e){if(ami[_0xe073('0x1b')]()==![]){return _0x54c10e(_0x103a51[_0xe073('0xf')](0x1f4,[config[_0xe073('0x10')]['ip'],config[_0xe073('0x10')][_0xe073('0x11')],_0xe073('0x12')][_0xe073('0x13')]('\x20')));}_0x4fdd2c=_[_0xe073('0x14')](_0x4fdd2c,_0xe073('0x1c'));_0x4fdd2c[_0xe073('0x17')]='Command';return ami[_0xe073('0x1d')](_0x4fdd2c)[_0xe073('0x1e')](function(_0x419703){_0x2a63c6({'code':0xc8,'message':_0x419703[_0xe073('0x1f')]});})[_0xe073('0x1a')](function(_0x275aa8){_0x54c10e(_0x103a51['error'](0x1f5,_0x275aa8['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x42d112){var _0x5d72a9=[];for(var _0x5e3b16 in _0x29444b['voiceQueues']){if(_0x29444b['voiceQueues']['hasOwnProperty'](_0x5e3b16)){var _0x50795f=_0x29444b[_0xe073('0x20')][_0x5e3b16];var _0xff003={'id':_0x50795f['id'],'name':_0x50795f['name'],'strategy':_0x50795f[_0xe073('0x21')],'answered':_0x50795f[_0xe073('0x22')],'available':_0x50795f[_0xe073('0x23')],'loggedIn':_0x50795f['loggedIn'],'pTalking':_0x50795f[_0xe073('0x24')],'sumBillable':_0x50795f['sumBillable'],'sumDuration':_0x50795f[_0xe073('0x25')],'sumHoldTime':_0x50795f[_0xe073('0x26')]||0x0,'talking':_0x50795f['talking'],'total':_0x50795f['total'],'type':_0x50795f[_0xe073('0x27')],'unmanaged':_0x50795f[_0xe073('0x28')],'abandoned':_0x50795f[_0xe073('0x29')],'waiting':_0x50795f[_0xe073('0x2a')],'loggedInDb':_0x50795f[_0xe073('0x2b')]};if(_0x50795f[_0xe073('0x27')]===_0xe073('0x2c')){_0xff003[_0xe073('0x2d')]=_0x50795f['dialActive'];_0xff003[_0xe073('0x2e')]=_0x50795f[_0xe073('0x2e')];_0xff003['dialOriginateCallerIdName']=_0x50795f['dialOriginateCallerIdName'];_0xff003[_0xe073('0x2f')]=_0x50795f['dialOriginateCallerIdNumber'];_0xff003[_0xe073('0x30')]=_0x50795f[_0xe073('0x30')];_0xff003[_0xe073('0x31')]=_0x50795f['dialPrefix'];_0xff003['temp']=_0x50795f[_0xe073('0x32')];_0xff003[_0xe073('0x33')]=_0x50795f['outboundAnswerAgiCallsDay'];_0xff003[_0xe073('0x34')]=_0x50795f[_0xe073('0x34')];_0xff003[_0xe073('0x35')]=_0x50795f['outboundBlacklistCallsDay'];_0xff003[_0xe073('0x36')]=_0x50795f['outboundBusyCallsDay'];_0xff003['outboundCongestionCallsDay']=_0x50795f[_0xe073('0x37')];_0xff003[_0xe073('0x38')]=_0x50795f[_0xe073('0x38')];_0xff003['outboundDropCallsDayCallersExit']=_0x50795f[_0xe073('0x39')];_0xff003[_0xe073('0x3a')]=_0x50795f[_0xe073('0x3a')];_0xff003['outboundNoAnswerCallsDay']=_0x50795f[_0xe073('0x3b')];_0xff003[_0xe073('0x3c')]=_0x50795f[_0xe073('0x3c')];_0xff003[_0xe073('0x3d')]=_0x50795f[_0xe073('0x3d')];_0xff003[_0xe073('0x3e')]=_0x50795f['outboundReCallsDay'];_0xff003[_0xe073('0x3f')]=_0x50795f[_0xe073('0x3f')];_0xff003[_0xe073('0x40')]=_0x50795f['outboundUnknownCallsDay'];_0xff003[_0xe073('0x41')]=_0x50795f[_0xe073('0x41')];_0xff003[_0xe073('0x42')]=_0x50795f[_0xe073('0x42')];_0xff003[_0xe073('0x43')]=_0x50795f['predictiveIntervalAvgTalktime'];_0xff003[_0xe073('0x44')]=_0x50795f['predictiveIntervalDroppedCallsCallersExit'];_0xff003[_0xe073('0x45')]=_0x50795f[_0xe073('0x45')];_0xff003[_0xe073('0x46')]=_0x50795f[_0xe073('0x46')];_0xff003[_0xe073('0x47')]=_0x50795f[_0xe073('0x47')];_0xff003[_0xe073('0x48')]=_0x50795f[_0xe073('0x48')];_0xff003[_0xe073('0x49')]=_0x50795f[_0xe073('0x49')];_0xff003[_0xe073('0x4a')]=_0x50795f[_0xe073('0x4a')];_0xff003[_0xe073('0x4b')]=_0x50795f['predictiveIntervalAvailable'];_0xff003[_0xe073('0x4c')]=_0x50795f['predictiveIntervalTotalCalls'];_0xff003[_0xe073('0x19')]=_0x50795f[_0xe073('0x19')];_0xff003[_0xe073('0x4d')]=_0x50795f[_0xe073('0x4d')];_0xff003['erlangCalls']=_0x50795f[_0xe073('0x4e')];_0xff003[_0xe073('0x4f')]=_0x50795f[_0xe073('0x4f')];_0xff003[_0xe073('0x50')]=_0x50795f[_0xe073('0x50')];_0xff003['erlangBusyFactor']=_0x50795f[_0xe073('0x51')];_0xff003['startPredictive']=_0x50795f[_0xe073('0x52')];_0xff003[_0xe073('0x53')]=_0x50795f[_0xe073('0x53')];}if(_0x50795f[_0xe073('0x54')]){_0xff003[_0xe073('0x54')]={'id':_0x50795f[_0xe073('0x54')]['id'],'name':_0x50795f[_0xe073('0x54')][_0xe073('0x8')],'active':_0x50795f[_0xe073('0x54')][_0xe073('0x55')],'callerid':_0x50795f[_0xe073('0x54')]['callerid']};}if(_0x50795f['Interval']){_0xff003[_0xe073('0x56')]={'id':_0x50795f[_0xe073('0x56')]['id'],'name':_0x50795f[_0xe073('0x56')][_0xe073('0x8')]};}_0x5d72a9[_0xe073('0x57')](_0xff003);}}_0x42d112({'count':_0x5d72a9['length'],'rows':_0x5d72a9});});},'UpdateVoiceQueue':function(_0xb93fc9){return new Promise(function(_0x1c5254,_0x1fbe0e){var _0xb60a8c=_[_0xe073('0x58')](_0x29444b['voiceQueues'],{'id':parseInt(_0xb93fc9['id'])});var _0x62ed73=_['omit'](_0xb93fc9,['id']);if(_0xb60a8c){for(var _0x5aad64 in _0x62ed73){if(typeof _0x62ed73[_0x5aad64]!==_0xe073('0x59')&&typeof _0xb60a8c[_0x5aad64]!==_0xe073('0x59')){_0xb60a8c[_0x5aad64]=_0x62ed73[_0x5aad64];}}_0x1c5254(_0xb60a8c);}else{_0x1fbe0e();}});},'VoiceChannels':function(){return new Promise(function(_0x4e6934){var _0x5af2b9=_[_0xe073('0x5a')](_0x29444b[_0xe073('0x5b')]);_0x4e6934({'count':_0x5af2b9[_0xe073('0x5c')],'rows':_0x5af2b9});});},'VoiceChannelMixMonitor':function(_0xc2d387){var _0x188050=this;return new Promise(function(_0x1eec23,_0x317159){if(ami['isConnected']()==![]){return _0x317159(_0x188050[_0xe073('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xe073('0x10')][_0xe073('0x11')],_0xe073('0x12')]['join']('\x20')));}var _0x4d5bcd=schema(properties[_0xe073('0x5d')])[_0xe073('0x3')](_0xc2d387);if(_0x4d5bcd[_0xe073('0x5c')]>0x0){return _0x317159(_0x188050['error'](0x1f4,_[_0xe073('0x5e')](_0x4d5bcd,_0xe073('0x19'))[_0xe073('0x13')](',\x20')));}var _0x3a4fc1=_[_0xe073('0x58')](_0x29444b[_0xe073('0x5b')],{'uniqueid':_0xc2d387[_0xe073('0x5f')]});if(_0x3a4fc1&&_0x3a4fc1[_0xe073('0x60')]){var _0x3238eb=util['format'](_0xe073('0x61'),_0xc2d387['filename']||_0xc2d387[_0xe073('0x5f')],_0xc2d387['format']||_0xe073('0x62'));return ami[_0xe073('0x1d')]({'action':_0xe073('0x63'),'channel':_0x3a4fc1[_0xe073('0x60')],'file':_0x3238eb,'options':'ai(mixmonitorid)'})[_0xe073('0x1e')](function(_0x1090c4){var _0x191005=_['find'](_0x3a4fc1['monitors'],{'filename':_0xe073('0x64')+_0x3238eb[_0xe073('0x65')]()});if(_[_0xe073('0x66')](_0x191005)){_0x3a4fc1[_0xe073('0x67')][_0xe073('0x57')]({'filename':'/var/spool/asterisk/monitor/'+_0x3238eb[_0xe073('0x65')](),'createdAt':moment()[_0xe073('0x6')](_0xe073('0x68')),'mixmonitorid':_0x1090c4[_0xe073('0x69')],'status':_0xe073('0x6a')});}else{_0x191005[_0xe073('0x69')]=_0x1090c4[_0xe073('0x69')];_0x191005[_0xe073('0x6b')]=_0xe073('0x6a');}_0x1eec23({'code':0xc8,'message':[_0xc2d387[_0xe073('0x5f')],'MixMonitor\x20Success',_0x1090c4[_0xe073('0x69')]]['join']('\x20'),'mixmonitorid':_0x1090c4['mixmonitorid']});})[_0xe073('0x1a')](function(_0x7aa64a){_0x317159(_0x188050[_0xe073('0xf')](0x1f5,[_0xc2d387['uniqueid'],_0x7aa64a[_0xe073('0x19')][_0xe073('0x65')]()][_0xe073('0x13')]('\x20')));});}else{return _0x317159(_0x188050['error'](0x1f5,_0xe073('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x4c01c6){var _0xa0a501=this;return new Promise(function(_0x2fa023,_0x2127e6){if(ami[_0xe073('0x1b')]()==![]){return _0x2127e6(_0xa0a501[_0xe073('0xf')](0x1f4,[config[_0xe073('0x10')]['ip'],config[_0xe073('0x10')][_0xe073('0x11')],_0xe073('0x12')][_0xe073('0x13')]('\x20')));}var _0xc54e77=schema(properties[_0xe073('0x5d')])[_0xe073('0x3')](_0x4c01c6);if(_0xc54e77[_0xe073('0x5c')]>0x0){return _0x2127e6(_0xa0a501[_0xe073('0xf')](0x1f4,_[_0xe073('0x5e')](_0xc54e77,_0xe073('0x19'))[_0xe073('0x13')](',\x20')));}var _0x275631=_[_0xe073('0x58')](_0x29444b[_0xe073('0x5b')],{'uniqueid':_0x4c01c6[_0xe073('0x5f')]});if(_0x275631){return Promise[_0xe073('0x6d')]()[_0xe073('0x1e')](function(){if(_0x275631[_0xe073('0x60')]){return ami[_0xe073('0x1d')]({'action':'StopMixMonitor','channel':_0x275631[_0xe073('0x60')],'mixmonitorid':_0x4c01c6[_0xe073('0x69')]})[_0xe073('0x1a')](function(){});}})[_0xe073('0x1e')](function(){if(_0x275631[_0xe073('0x6e')]){return ami['Action']({'action':_0xe073('0x6f'),'channel':_0x275631['destinationchannel'],'mixmonitorid':_0x4c01c6[_0xe073('0x69')]})[_0xe073('0x1a')](function(){});}})[_0xe073('0x1e')](function(){var _0x345eee=_[_0xe073('0x58')](_0x275631[_0xe073('0x67')],{'mixmonitorid':_0x4c01c6['mixmonitorid']});if(_0x345eee){_0x345eee[_0xe073('0x6b')]='stop';}})[_0xe073('0x1e')](function(){var _0x4be096=util[_0xe073('0x6')](_0xe073('0x61'),_0x4c01c6[_0xe073('0x70')]||_0x4c01c6[_0xe073('0x5f')],_0x4c01c6[_0xe073('0x6')]||_0xe073('0x62'));var _0x3df3f4=_[_0xe073('0x58')](_0x275631[_0xe073('0x67')],{'filename':_0xe073('0x64')+_0x4be096[_0xe073('0x65')]()});if(_0x3df3f4){_0x3df3f4['status']='stop';}})[_0xe073('0x1e')](function(){_0x2fa023({'code':0xc8,'message':[_0x4c01c6[_0xe073('0x5f')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xe073('0x1a')](function(_0x10ee30){_0x2127e6(_0xa0a501[_0xe073('0xf')](0x1f5,[_0x4c01c6[_0xe073('0x5f')],_0x10ee30[_0xe073('0x19')]['toLowerCase']()][_0xe073('0x13')]('\x20')));});}else{return _0x2127e6(_0xa0a501[_0xe073('0xf')](0x1f5,_0xe073('0x6c')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x3f55aa){var _0x1dd337=_[_0xe073('0x5a')](_0x29444b[_0xe073('0x71')]);_0x3f55aa({'count':_0x1dd337[_0xe073('0x5c')],'rows':_0x1dd337});});},'VoiceQueuesChannel':function(_0x45305a){var _0x35e2ae=this;return new Promise(function(_0x512cd5,_0x19a3e7){var _0x509fd5=schema(properties['voicequeuechannel'])[_0xe073('0x3')](_0x45305a);if(_0x509fd5[_0xe073('0x5c')]>0x0){return _0x19a3e7(_0x35e2ae[_0xe073('0xf')](0x1f4,_[_0xe073('0x5e')](_0x509fd5,_0xe073('0x19'))[_0xe073('0x13')](',\x20')));}var _0x31a0e2=_[_0xe073('0x58')](_0x29444b[_0xe073('0x71')],{'uniqueid':_0x45305a[_0xe073('0x5f')]});if(_0x31a0e2){_0x512cd5(_0x31a0e2);}else{return _0x19a3e7(_0x35e2ae['error'](0x1f5,_0xe073('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x1c054f){var _0x3b1e06=this;return new Promise(function(_0x654c64,_0x1ba7fe){if(ami['isConnected']()==![]){return _0x1ba7fe(_0x3b1e06['error'](0x1f4,[config[_0xe073('0x10')]['ip'],config[_0xe073('0x10')][_0xe073('0x11')],_0xe073('0x12')]['join']('\x20')));}var _0x5225e2=schema(properties[_0xe073('0x72')])[_0xe073('0x3')](_0x1c054f);if(_0x5225e2[_0xe073('0x5c')]>0x0){return _0x1ba7fe(_0x3b1e06[_0xe073('0xf')](0x1f4,_['map'](_0x5225e2,'message')['join'](',\x20')));}var _0x41d356=_[_0xe073('0x58')](_0x29444b[_0xe073('0x71')],{'uniqueid':_0x1c054f[_0xe073('0x5f')]});if(_0x41d356&&_0x41d356[_0xe073('0x60')]){return ami[_0xe073('0x1d')]({'action':_0xe073('0x73'),'channel':_0x41d356['channel']})['then'](function(_0x4e1b13){_0x654c64({'code':0xc8,'message':[_0x1c054f[_0xe073('0x5f')],_0x4e1b13[_0xe073('0x19')][_0xe073('0x65')]()][_0xe073('0x13')]('\x20')});})['catch'](function(_0x3be285){_0x1ba7fe(_0x3b1e06['error'](0x1f5,[_0x1c054f['uniqueid'],_0x3be285[_0xe073('0x19')][_0xe073('0x65')]()][_0xe073('0x13')]('\x20')));});}else{return _0x1ba7fe(_0x3b1e06[_0xe073('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x4ecc14){var _0xb8b09f=this;return new Promise(function(_0x41a0ed,_0x482c6e){if(ami[_0xe073('0x1b')]()==![]){return _0x482c6e(_0xb8b09f[_0xe073('0xf')](0x1f4,[config[_0xe073('0x10')]['ip'],config[_0xe073('0x10')]['username'],_0xe073('0x12')][_0xe073('0x13')]('\x20')));}var _0x526b2b=schema(properties[_0xe073('0x74')])[_0xe073('0x3')](_0x4ecc14);if(_0x526b2b['length']>0x0){return _0x482c6e(_0xb8b09f[_0xe073('0xf')](0x1f4,_[_0xe073('0x5e')](_0x526b2b,_0xe073('0x19'))[_0xe073('0x13')](',\x20')));}var _0x453a47=_['find'](_0x29444b[_0xe073('0x71')],{'uniqueid':_0x4ecc14[_0xe073('0x5f')]});if(_0x453a47&&_0x453a47['channel']){return ami[_0xe073('0x1d')]({'action':_0xe073('0x75'),'channel':_0x453a47[_0xe073('0x60')],'exten':_0x4ecc14[_0xe073('0x76')],'context':_0x4ecc14[_0xe073('0x77')]||_0x453a47[_0xe073('0x77')],'priority':0x1})[_0xe073('0x1e')](function(_0x16040b){_0x41a0ed({'code':0xc8,'message':[_0x4ecc14[_0xe073('0x5f')],_0x16040b['message'][_0xe073('0x65')]()]['join']('\x20')});})[_0xe073('0x1a')](function(_0x14c988){_0x482c6e(_0xb8b09f[_0xe073('0xf')](0x1f5,[_0x4ecc14['uniqueid'],_0x14c988[_0xe073('0x19')][_0xe073('0x65')]()]['join']('\x20')));});}else{return _0x482c6e(_0xb8b09f[_0xe073('0xf')](0x1f5,_0xe073('0x6c')));}});},'Agents':function(_0x2fef46){return new Promise(function(_0xd795b9){var _0x13f1da=_[_0xe073('0x5a')](_0x29444b[_0xe073('0xc')]);if(_0x2fef46&&_0x2fef46['id']){var _0x55360a=_[_0xe073('0x58')](_0x13f1da,function(_0x57eaeb){return _0x57eaeb['id']===_0x2fef46['id'];});_0xd795b9(_0x55360a);}else{_0xd795b9({'count':_0x13f1da[_0xe073('0x5c')],'rows':_0x13f1da});}});},'Telephones':function(){return new Promise(function(_0x13601c){var _0x3a548f=_[_0xe073('0x5a')](_0x29444b[_0xe073('0x78')]);_0x13601c({'count':_0x3a548f[_0xe073('0x5c')],'rows':_0x3a548f});});},'Trunks':function(){return new Promise(function(_0x18e696){var _0x53a7c0=_[_0xe073('0x5a')](_0x29444b['trunks']);_0x18e696({'count':_0x53a7c0[_0xe073('0x5c')],'rows':_0x53a7c0});});},'OutboundChannels':function(){return new Promise(function(_0x4d9f3e){var _0x45a429=_[_0xe073('0x5a')](_0x29444b['outboundChannels']);_0x4d9f3e({'count':_0x45a429[_0xe073('0x5c')],'rows':_0x45a429});});},'Outbound':function(){return new Promise(function(_0xef254f){_0xef254f(_0x29444b[_0xe073('0x2c')]);});},'Campaigns':function(){return new Promise(function(_0x4a4f07){var _0x3d0fec=_[_0xe073('0x5a')](_0x29444b[_0xe073('0x79')]);_0x4a4f07({'count':_0x3d0fec[_0xe073('0x5c')],'rows':_0x3d0fec});});},'VoiceQueuesPreview':function(_0x8fabcc){var _0x3fe93a=this;return new Promise(function(_0x2c02e0,_0x34762b){_0x5ce161[_0xe073('0x7a')](_0x8fabcc['id'])[_0xe073('0x1e')](function(_0x33ad08){_0x2c02e0({'code':0xc8,'message':_0x33ad08[_0xe073('0x19')]});})[_0xe073('0x1a')](function(_0x232577){_0x34762b(_0x3fe93a[_0xe073('0xf')](0x1f4,_0x232577[_0xe073('0x19')]));});});},'EventManager':function(_0x435078){var _0x53173f=this;return new Promise(function(_0x107c07,_0x16144e){if(!_0x435078[_0xe073('0x7b')]){return _0x16144e(_0x53173f['error'](0x1f4,_0xe073('0x7c')));}ami[_0xe073('0x7d')](_0xe073('0x7e')+_0x435078[_0xe073('0x7b')],_0x435078[_0xe073('0x19')]);_0x107c07({'code':0xc8,'message':_0x435078});});},'FaxAccounts':function(){return new Promise(function(_0x3c1d9e){var _0x32ebab=_[_0xe073('0x5a')](_0x29444b[_0xe073('0x7f')]);_0x3c1d9e({'count':_0x32ebab[_0xe073('0x5c')],'rows':_0x32ebab});});},'SendFax':function(_0x24318c){var _0x4fd5d8=this;return new Promise(function(_0x2786e1,_0x31acf5){_0x5b9324[_0xe073('0x80')](_0x24318c)[_0xe073('0x1e')](function(_0x264c15){_0x2786e1({'code':0xc8,'message':_0x264c15[_0xe073('0x19')]});})[_0xe073('0x1a')](function(_0x5d2e5b){_0x31acf5(_0x4fd5d8[_0xe073('0xf')](0x1f4,_0x5d2e5b[_0xe073('0x19')]));});});},'CheckAfterSend':function(_0x5a9f85){var _0x30cbbb=this;return new Promise(function(_0x7ce7ba,_0x3fdfc6){_0x5b9324['checkAfterSend'](_0x5a9f85)[_0xe073('0x1e')](function(_0x4b035e){_0x7ce7ba({'code':0xc8,'message':_0x4b035e[_0xe073('0x19')]});})[_0xe073('0x1a')](function(_0x182298){_0x3fdfc6(_0x30cbbb[_0xe073('0xf')](0x1f4,_0x182298['message']));});});}};var _0x2ab5ac=jayson[_0xe073('0x81')](_0x44092d)['http']();_0x2ab5ac['on'](_0xe073('0xf'),function(_0x28ff19){return _0x45995e(_0x28ff19);});_0x2ab5ac[_0xe073('0x5')](0x232a,_0xe073('0x82'),function(){console[_0xe073('0x83')](_0xe073('0x84'),0x232a);return _0x4bc6b3('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 90158ca..75d1f23 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 _0xf349=['util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','[CM][%s][%s]','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','destcalleridnum','routeId','calleridnum','lastName','fax','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','firstName','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','action','toLowerCase','merge','lodash','bluebird','ioredis'];(function(_0x43f9be,_0x5be1bd){var _0x28f9b7=function(_0x46760f){while(--_0x46760f){_0x43f9be['push'](_0x43f9be['shift']());}};_0x28f9b7(++_0x5be1bd);}(_0xf349,0xab));var _0x9f34=function(_0x4d4f61,_0x56d7a7){_0x4d4f61=_0x4d4f61-0x0;var _0x297414=_0xf349[_0x4d4f61];return _0x297414;};'use strict';var _=require(_0x9f34('0x0'));var BPromise=require(_0x9f34('0x1'));var Redis=require(_0x9f34('0x2'));var util=require(_0x9f34('0x3'));var config=require(_0x9f34('0x4'));var logger=require(_0x9f34('0x5'))(_0x9f34('0x6'));var cmContactRpc=require(_0x9f34('0x7'));config[_0x9f34('0x8')]=_[_0x9f34('0x9')](config[_0x9f34('0x8')],{'host':_0x9f34('0xa'),'port':0x18eb});var io=require(_0x9f34('0xb'))(new Redis(config['redis']));function emit(_0x12ac82,_0x5ea61d,_0x591f9d,_0x50dc34,_0x2903be){logger['info'](_0x9f34('0xc'),_0x12ac82,_0x5ea61d['id'],_0x591f9d,_0x50dc34,JSON['stringify'](_0x2903be));io['to'](_0x591f9d)[_0x9f34('0xd')](_0x50dc34,_0x2903be);}exports['exec']=function(_0x33576c,_0x5dd7ac,_0x13f30a,_0x351996){var _0x1b5695,_0x56585d;var _0x16901e={};var _0x2105a3;var _0x48534c=Number(_0x13f30a[_0x9f34('0xe')]);var _0xd7aef2=_0x13f30a[_0x9f34('0xf')]?Boolean(Number(_0x13f30a['data2'])):![];var _0x1c2231;var _0x1b13a4=![];if(!_[_0x9f34('0x10')](_0x13f30a['data5'])){if(_0x13f30a[_0x9f34('0x11')]=='1')_0x1b13a4=!![];}if(!_0x1b13a4){if(_0x351996[_0x9f34('0x12')]){_0x16901e['id']=_0x351996[_0x9f34('0x12')];}}if(!_0x16901e['id']){_0x16901e[_0x9f34('0x13')]=_0x48534c;_0x1c2231=_0x13f30a[_0x9f34('0x14')]&&_0x13f30a[_0x9f34('0x14')]!=='0'?_0x13f30a[_0x9f34('0x14')]['split'](','):[_0x9f34('0x15')];_0x16901e[_0x9f34('0x16')]=_[_0x9f34('0x17')](_0x1c2231,function(_0x2ce371){var _0x1138f5={};_0x1138f5[_0x2ce371]=_0x351996['routeId']?_0x351996[_0x9f34('0x18')]:_0x351996['calleridnum'];return _0x1138f5;});_0x2105a3=_0x351996[_0x9f34('0x19')]?_0x351996[_0x9f34('0x18')]:_0x351996[_0x9f34('0x1a')];}var _0x4b5706=['id','firstName',_0x9f34('0x1b'),_0x9f34('0x15'),'mobile',_0x9f34('0x1c'),_0x9f34('0x13'),_0x9f34('0x1d'),'scheduledAt',_0x9f34('0x1e')];var _0x4cfa1c=_[_0x9f34('0x1f')](_0x4b5706,_0x1c2231);BPromise[_0x9f34('0x20')]()[_0x9f34('0x21')](cmContactRpc[_0x9f34('0x22')]({'attributes':_0x4cfa1c,'where':_0x16901e,'phone':_0x2105a3}))[_0x9f34('0x21')](function(_0x205539){_0x56585d=_0x205539;if(!_[_0x9f34('0x23')](_0x56585d)){if(_0x56585d[_0x9f34('0x24')]===0x1){_0x1b5695=_0x56585d[0x0];logger[_0x9f34('0x25')](_0x9f34('0x26'),_0x351996['uniqueid'],_0x5dd7ac['id'],_0x1b5695['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x351996[_0x9f34('0x27')],_0x5dd7ac['id'],_[_0x9f34('0x17')](_0x56585d,'id')[_0x9f34('0x28')](','));}return;}else{logger['info'](_0x9f34('0x29'),_0x351996[_0x9f34('0x27')],_0x5dd7ac['id']);var _0x48e82d={'ListId':_0x48534c};var _0x190c5d=_0x13f30a[_0x9f34('0x2a')]&&_0x13f30a[_0x9f34('0x2a')]!=='0'?_0x13f30a['data4']:'phone';if(_0xd7aef2){logger[_0x9f34('0x25')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x351996[_0x9f34('0x27')],_0x5dd7ac['id']);_0x48e82d[_0x190c5d]=_[_0x9f34('0x10')](_0x351996[_0x9f34('0x19')])?_0x351996[_0x9f34('0x1a')]:_0x351996[_0x9f34('0x18')];if(_[_0x9f34('0x10')](_0x351996[_0x9f34('0x19')])){_0x48e82d[_0x9f34('0x2b')]=_0x351996[_0x9f34('0x2c')]&&_0x351996[_0x9f34('0x2c')]!==_0x9f34('0x2d')?_0x351996[_0x9f34('0x2c')]:_0x9f34('0x2e');}else{_0x48e82d['firstName']=_0x351996['destcalleridname']&&_0x351996[_0x9f34('0x2f')]!==_0x9f34('0x2d')?_0x351996[_0x9f34('0x2f')]:_0x9f34('0x2e');}return BPromise['resolve']()[_0x9f34('0x21')](cmContactRpc[_0x9f34('0x30')](_0x48e82d))[_0x9f34('0x21')](function(_0xa05b9e){_0x1b5695=_0xa05b9e;_0x56585d[_0x9f34('0x31')](_0xa05b9e);if(_0x1b5695){logger['info'](_0x9f34('0x32'),_0x351996[_0x9f34('0x27')],_0x5dd7ac['id'],_0x1b5695['id']);}return;});}else{logger[_0x9f34('0x25')](_0x9f34('0x33'),_0x351996[_0x9f34('0x27')],_0x5dd7ac['id']);_0x48e82d[_0x190c5d]=_['isNil'](_0x351996[_0x9f34('0x19')])?_0x351996[_0x9f34('0x1a')]:_0x351996[_0x9f34('0x18')];if(_[_0x9f34('0x10')](_0x351996[_0x9f34('0x19')])){_0x48e82d['firstName']=_0x351996['calleridname']&&_0x351996[_0x9f34('0x2c')]!==_0x9f34('0x2d')?_0x351996[_0x9f34('0x2c')]:_0x9f34('0x2e');}else{_0x48e82d[_0x9f34('0x2b')]=_0x351996[_0x9f34('0x2f')]&&_0x351996[_0x9f34('0x2f')]!==''?_0x351996[_0x9f34('0x2f')]:'Unknown';}_0x1b5695=_0x48e82d;_0x56585d[_0x9f34('0x31')](_0x48e82d);return;}}})[_0x9f34('0x21')](function(){if(_0x33576c){emit(_0x351996[_0x9f34('0x27')],_0x5dd7ac,util[_0x9f34('0x34')](_0x9f34('0x35'),_0x33576c[_0x9f34('0x36')]),util[_0x9f34('0x34')]('trigger:%s',_0x13f30a[_0x9f34('0x37')][_0x9f34('0x38')]()),{'evt':_[_0x9f34('0x39')](_0x351996,{'autoCreate':_0xd7aef2}),'contact':_0x1b5695===undefined?{}:_0x1b5695,'contacts':_0x56585d['length']===0x0?undefined:_0x56585d});}});}; \ No newline at end of file +var _0x0072=['ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','','calleridname','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','user:%s','format','trigger:%s','action','toLowerCase','length','lodash','bluebird','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid'];(function(_0x353da0,_0x109fe){var _0x14d23f=function(_0x4dea7e){while(--_0x4dea7e){_0x353da0['push'](_0x353da0['shift']());}};_0x14d23f(++_0x109fe);}(_0x0072,0x1b8));var _0x2007=function(_0x48d3db,_0x2a4bd4){_0x48d3db=_0x48d3db-0x0;var _0x368cd0=_0x0072[_0x48d3db];return _0x368cd0;};'use strict';var _=require(_0x2007('0x0'));var BPromise=require(_0x2007('0x1'));var Redis=require('ioredis');var util=require(_0x2007('0x2'));var config=require('../../../../config/environment');var logger=require(_0x2007('0x3'))(_0x2007('0x4'));var cmContactRpc=require(_0x2007('0x5'));config[_0x2007('0x6')]=_['defaults'](config[_0x2007('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2007('0x6')]));function emit(_0x3087a3,_0x13aaa2,_0x3fbf26,_0x4a179a,_0x4037c3){logger[_0x2007('0x7')](_0x2007('0x8'),_0x3087a3,_0x13aaa2['id'],_0x3fbf26,_0x4a179a,JSON[_0x2007('0x9')](_0x4037c3));io['to'](_0x3fbf26)[_0x2007('0xa')](_0x4a179a,_0x4037c3);}exports[_0x2007('0xb')]=function(_0x459865,_0x5a75ca,_0x5e12a3,_0x205e1b){var _0x4e6472,_0x4d8793;var _0x34348f={};var _0x25a1b0;var _0x2dbafb=Number(_0x5e12a3[_0x2007('0xc')]);var _0xdc1d23=_0x5e12a3[_0x2007('0xd')]?Boolean(Number(_0x5e12a3['data2'])):![];var _0x3c2ea2;var _0x361b58=![];if(!_['isNil'](_0x5e12a3[_0x2007('0xe')])){if(_0x5e12a3[_0x2007('0xe')]=='1')_0x361b58=!![];}if(!_0x361b58){if(_0x205e1b[_0x2007('0xf')]){_0x34348f['id']=_0x205e1b['xmd-contactid'];}}if(!_0x34348f['id']){_0x34348f[_0x2007('0x10')]=_0x2dbafb;_0x3c2ea2=_0x5e12a3[_0x2007('0x11')]&&_0x5e12a3[_0x2007('0x11')]!=='0'?_0x5e12a3[_0x2007('0x11')][_0x2007('0x12')](','):[_0x2007('0x13')];_0x34348f[_0x2007('0x14')]=_[_0x2007('0x15')](_0x3c2ea2,function(_0x124c50){var _0x35850e={};_0x35850e[_0x124c50]=_0x205e1b[_0x2007('0x16')]?_0x205e1b[_0x2007('0x17')]:_0x205e1b[_0x2007('0x18')];return _0x35850e;});_0x25a1b0=_0x205e1b[_0x2007('0x16')]?_0x205e1b['destcalleridnum']:_0x205e1b['calleridnum'];}var _0x44b047=['id',_0x2007('0x19'),_0x2007('0x1a'),'phone',_0x2007('0x1b'),_0x2007('0x1c'),'ListId',_0x2007('0x1d'),_0x2007('0x1e'),_0x2007('0x1f')];var _0x5e55ff=_[_0x2007('0x20')](_0x44b047,_0x3c2ea2);BPromise['resolve']()[_0x2007('0x21')](cmContactRpc[_0x2007('0x22')]({'attributes':_0x5e55ff,'where':_0x34348f,'phone':_0x25a1b0}))[_0x2007('0x21')](function(_0x485ce5){_0x4d8793=_0x485ce5;if(!_[_0x2007('0x23')](_0x4d8793)){if(_0x4d8793['length']===0x1){_0x4e6472=_0x4d8793[0x0];logger[_0x2007('0x7')](_0x2007('0x24'),_0x205e1b[_0x2007('0x25')],_0x5a75ca['id'],_0x4e6472['id']);}else{logger[_0x2007('0x7')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x205e1b[_0x2007('0x25')],_0x5a75ca['id'],_[_0x2007('0x15')](_0x4d8793,'id')[_0x2007('0x26')](','));}return;}else{logger[_0x2007('0x7')](_0x2007('0x27'),_0x205e1b[_0x2007('0x25')],_0x5a75ca['id']);var _0xffc61={'ListId':_0x2dbafb};var _0x15a8ea=_0x5e12a3['data4']&&_0x5e12a3[_0x2007('0x28')]!=='0'?_0x5e12a3[_0x2007('0x28')]:_0x2007('0x13');if(_0xdc1d23){logger[_0x2007('0x7')](_0x2007('0x29'),_0x205e1b[_0x2007('0x25')],_0x5a75ca['id']);_0xffc61[_0x15a8ea]=_[_0x2007('0x2a')](_0x205e1b[_0x2007('0x16')])?_0x205e1b['calleridnum']:_0x205e1b[_0x2007('0x17')];if(_[_0x2007('0x2a')](_0x205e1b[_0x2007('0x16')])){_0xffc61[_0x2007('0x19')]=_0x205e1b['calleridname']&&_0x205e1b['calleridname']!==_0x2007('0x2b')?_0x205e1b[_0x2007('0x2c')]:_0x2007('0x2d');}else{_0xffc61[_0x2007('0x19')]=_0x205e1b[_0x2007('0x2e')]&&_0x205e1b[_0x2007('0x2e')]!==_0x2007('0x2b')?_0x205e1b[_0x2007('0x2e')]:_0x2007('0x2d');}return BPromise[_0x2007('0x2f')]()[_0x2007('0x21')](cmContactRpc[_0x2007('0x30')](_0xffc61))[_0x2007('0x21')](function(_0x53b6b4){_0x4e6472=_0x53b6b4;_0x4d8793[_0x2007('0x31')](_0x53b6b4);if(_0x4e6472){logger[_0x2007('0x7')](_0x2007('0x32'),_0x205e1b['uniqueid'],_0x5a75ca['id'],_0x4e6472['id']);}return;});}else{logger[_0x2007('0x7')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x205e1b['uniqueid'],_0x5a75ca['id']);_0xffc61[_0x15a8ea]=_[_0x2007('0x2a')](_0x205e1b['routeId'])?_0x205e1b[_0x2007('0x18')]:_0x205e1b['destcalleridnum'];if(_['isNil'](_0x205e1b[_0x2007('0x16')])){_0xffc61['firstName']=_0x205e1b[_0x2007('0x2c')]&&_0x205e1b[_0x2007('0x2c')]!==_0x2007('0x2b')?_0x205e1b['calleridname']:_0x2007('0x2d');}else{_0xffc61['firstName']=_0x205e1b['destcalleridname']&&_0x205e1b['destcalleridname']!==_0x2007('0x2b')?_0x205e1b[_0x2007('0x2e')]:_0x2007('0x2d');}_0x4e6472=_0xffc61;_0x4d8793[_0x2007('0x31')](_0xffc61);return;}}})['then'](function(){if(_0x459865){emit(_0x205e1b['uniqueid'],_0x5a75ca,util['format'](_0x2007('0x33'),_0x459865['name']),util[_0x2007('0x34')](_0x2007('0x35'),_0x5e12a3[_0x2007('0x36')][_0x2007('0x37')]()),{'evt':_['merge'](_0x205e1b,{'autoCreate':_0xdc1d23}),'contact':_0x4e6472===undefined?{}:_0x4e6472,'contacts':_0x4d8793[_0x2007('0x38')]===0x0?undefined:_0x4d8793});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 28677a3..9e9108d 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 _0x9bdb=['html','template\x20not\x20found','uri','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','data5','windowHeight','data6','winapp','winApplication','render','winArguments','format','user:%s','data1','jscripty','trigger:%s','exec','integration','queue','urlforward','script','query','search','channel','every','AllConditions','checkConditions','some','AnyConditions','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','undefined','created','equals','exports','util','lodash','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','defaults','socket.io-emitter','redis','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','prototype','emit','info','stringify','clone','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','length','Actions','action','toLowerCase','contactmanager','motionbar','TemplateId','data2'];(function(_0x346057,_0x163927){var _0x3a7536=function(_0x4f4c5e){while(--_0x4f4c5e){_0x346057['push'](_0x346057['shift']());}};_0x3a7536(++_0x163927);}(_0x9bdb,0x13c));var _0xb9bd=function(_0x3abfcc,_0xd07b21){_0x3abfcc=_0x3abfcc-0x0;var _0x82eb62=_0x9bdb[_0x3abfcc];return _0x82eb62;};'use strict';var util=require(_0xb9bd('0x0'));var _=require(_0xb9bd('0x1'));var url=require(_0xb9bd('0x2'));var Mustache=require(_0xb9bd('0x3'));var Redis=require('ioredis');var urlforward=require(_0xb9bd('0x4'));var integration=require(_0xb9bd('0x5'));var cmContact=require(_0xb9bd('0x6'));var script=require(_0xb9bd('0x7'));var config=require(_0xb9bd('0x8'));var logger=require(_0xb9bd('0x9'))(_0xb9bd('0xa'));var ami=require(_0xb9bd('0xb'));config['redis']=_[_0xb9bd('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb9bd('0xd'))(new Redis(config[_0xb9bd('0xe')]));var operators={'equals':function(_0x4d82ae,_0x80df7f){return _0x4d82ae==_0x80df7f;},'not_equals':function(_0x215174,_0xf70ed1){return _0x215174!=_0xf70ed1;}};var barAndWebActions=[_0xb9bd('0xf'),_0xb9bd('0x2'),'winapp'];function Trigger(_0x4ff96c){this[_0xb9bd('0x10')]=_0x4ff96c[_0xb9bd('0x10')];this[_0xb9bd('0x11')]=_0x4ff96c['agents'];this['voiceQueues']=_0x4ff96c[_0xb9bd('0x12')];this[_0xb9bd('0x13')]=_0x4ff96c['templates'];this[_0xb9bd('0x14')]=_0x4ff96c[_0xb9bd('0x14')];this[_0xb9bd('0x15')]=_0x4ff96c['zendeskAccounts'];this[_0xb9bd('0x16')]=_0x4ff96c[_0xb9bd('0x16')];this[_0xb9bd('0x17')]=_0x4ff96c['salesforceAccounts'];this['sugarcrmAccounts']=_0x4ff96c[_0xb9bd('0x18')];this['zohoAccounts']=_0x4ff96c[_0xb9bd('0x19')];this['deskAccounts']=_0x4ff96c[_0xb9bd('0x1a')];this[_0xb9bd('0x1b')]=_0x4ff96c[_0xb9bd('0x1b')];this[_0xb9bd('0x1c')]=_0x4ff96c[_0xb9bd('0x1c')];this[_0xb9bd('0x1d')]=_0x4ff96c[_0xb9bd('0x1d')];this[_0xb9bd('0x1e')]=_0x4ff96c[_0xb9bd('0x1e')];this[_0xb9bd('0x1f')]={'zendesk':this[_0xb9bd('0x15')],'salesforce':this['salesforceAccounts'],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xb9bd('0x18')],'zoho':this[_0xb9bd('0x19')],'desk':this[_0xb9bd('0x1a')],'vtiger':this[_0xb9bd('0x1b')],'dynamics365':this[_0xb9bd('0x1d')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xb9bd('0x1c')]};ami['on'](_0xb9bd('0x20'),this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x23'),this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x24'),this[_0xb9bd('0x21')]['bind'](this));ami['on'](_0xb9bd('0x25'),this[_0xb9bd('0x21')]['bind'](this));ami['on']('custom:agentnosuchnumber',this['syncCustomEvent'][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x26'),this['syncCustomEvent'][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x27'),this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x28'),this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x29'),this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x2a'),this[_0xb9bd('0x21')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x2b'),this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x2c'),this[_0xb9bd('0x2d')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x2e'),this['syncAgentDial'][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x2f'),this[_0xb9bd('0x2d')][_0xb9bd('0x22')](this));ami['on']('custom:newinteraction',this[_0xb9bd('0x21')]['bind'](this));ami['on'](_0xb9bd('0x30'),this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x31'),this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x32'),this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x33'),this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));ami['on'](_0xb9bd('0x34'),this[_0xb9bd('0x21')]['bind'](this));ami['on']('custom:rejectmessage',this[_0xb9bd('0x21')]['bind'](this));ami['on']('custom:offlineMessage',this[_0xb9bd('0x21')][_0xb9bd('0x22')](this));}Trigger[_0xb9bd('0x35')][_0xb9bd('0x36')]=function(_0x352339,_0x3a9a15,_0x239009){logger[_0xb9bd('0x37')](_0x352339,_0x3a9a15,JSON[_0xb9bd('0x38')](_0x239009));io['to'](_0x352339)[_0xb9bd('0x36')](_0x3a9a15,_0x239009);};Trigger[_0xb9bd('0x35')]['syncCustomEvent']=function(_0x197194){var _0x307bb0=_[_0xb9bd('0x39')](_0x197194);if(typeof _0x307bb0[_0xb9bd('0x3a')]==='undefined'){_0x307bb0['motionChannel']=_0xb9bd('0x3b');}this[_0xb9bd('0x3c')](_0x307bb0);};Trigger[_0xb9bd('0x35')]['syncAgentDial']=function(_0x463a66){if(this['agents'][_0x463a66[_0xb9bd('0x3d')]]){this[_0xb9bd('0x21')](_0x463a66);}};Trigger[_0xb9bd('0x35')][_0xb9bd('0x3c')]=function(_0x15dc96){var _0x124c49;for(var _0x592b31 in this[_0xb9bd('0x10')]){if(this[_0xb9bd('0x10')][_0xb9bd('0x3e')](_0x592b31)){if(this[_0xb9bd('0x10')][_0x592b31][_0xb9bd('0x3f')]){_0x124c49=this[_0xb9bd('0x40')](this[_0xb9bd('0x10')][_0x592b31],_0x15dc96);if(_0x124c49){_[_0xb9bd('0x41')](_0x15dc96,_0x15dc96['variables']);for(var _0x1289f3=0x0,_0xb3ad77,_0x2c394c,_0x594e9c;_0x1289f30x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe14b,0x93));var _0xbe14=function(_0x1676ea,_0x2d4210){_0x1676ea=_0x1676ea-0x0;var _0x5a1234=_0xe14b[_0x1676ea];return _0x5a1234;};'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 a809d75..fcaf9d3 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 _0xecc8=['format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','unmanaged','outbound','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data5','POST','clientId','password','clientSecret','then','access_token','catch','error','toUpperCase','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','validateEmail','email','userEmail','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','length','message','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','body','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','replace','%2b','contactid','nothing','info',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','string','picklist','type','nameField','customField','idField','indexOf','incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','headers','ticketId'];(function(_0x4be563,_0x4c2ea1){var _0x11f09e=function(_0x45c529){while(--_0x45c529){_0x4be563['push'](_0x4be563['shift']());}};_0x11f09e(++_0x4c2ea1);}(_0xecc8,0x82));var _0x8ecc=function(_0x48737d,_0xf68410){_0x48737d=_0x48737d-0x0;var _0x11e691=_0xecc8[_0x48737d];return _0x11e691;};'use strict';var _=require(_0x8ecc('0x0'));var rp=require(_0x8ecc('0x1'));var util=require('util');var intUtil=require('./util');var md5=require(_0x8ecc('0x2'));var Redis=require(_0x8ecc('0x3'));var logger=require('../../../../config/logger')(_0x8ecc('0x4'));var config=require(_0x8ecc('0x5'));config[_0x8ecc('0x6')]=_[_0x8ecc('0x7')](config['redis'],{'host':_0x8ecc('0x8'),'port':0x18eb});var io=require(_0x8ecc('0x9'))(new Redis(config[_0x8ecc('0x6')]));function getAuthToken(_0x3fdcf7,_0x54cc14,_0x4a9181){if(_0x3fdcf7[_0x8ecc('0xa')]){_0x3fdcf7[_0x8ecc('0xb')]=_0x3fdcf7[_0x8ecc('0xc')][_0x8ecc('0xd')];_0x3fdcf7[_0x8ecc('0xe')]=_0x3fdcf7[_0x8ecc('0xc')]['data2'];return Promise['resolve'](_0x3fdcf7[_0x8ecc('0xc')][_0x8ecc('0xf')]);}var _0x1da9bb={'method':_0x8ecc('0x10'),'uri':_0x54cc14,'form':{'client_id':_0x3fdcf7[_0x8ecc('0x11')],'resource':_0x3fdcf7[_0x8ecc('0xb')],'username':_0x3fdcf7['username'],'password':_0x3fdcf7['password'],'grant_type':_0x8ecc('0x12'),'client_secret':_0x3fdcf7[_0x8ecc('0x13')]},'json':!![]};return rp(_0x1da9bb)[_0x8ecc('0x14')](function(_0x1e0e0c){return _0x1e0e0c[_0x8ecc('0x15')];})[_0x8ecc('0x16')](function(_0x3a430e){logger[_0x8ecc('0x17')]('['+[_0x4a9181[_0x8ecc('0x18')]()]+']\x20Wrong\x20credentials!');return _0x3a430e['message'];});}function getUser(_0xb49d42,_0x3fb745,_0x577c27,_0x395cc7,_0x15d9ab,_0x27ac02){return new Promise(function(_0x1612d9,_0xe3c45c){return getAuthToken(_0x3fb745,_0x395cc7,_0x27ac02)[_0x8ecc('0x14')](function(_0x47e07b){var _0x558742={'method':_0x8ecc('0x19'),'uri':_0x15d9ab+_0x8ecc('0x1a'),'headers':{'Authorization':_0x8ecc('0x1b')+_0x47e07b,'OData-Version':'4.0'},'json':!![]};return rp(_0x558742);})['then'](function(_0x3fb239){var _0x306e56=_0x3fb239[_0x8ecc('0x1c')];var _0x27d262=![];var _0x4971e2=null;if(!_['isNil'](_0x577c27)){if(intUtil[_0x8ecc('0x1d')](_0x577c27[_0x8ecc('0x1e')])){_0xb49d42[_0x8ecc('0x1f')]=_0x577c27[_0x8ecc('0x1e')];for(_0x4971e2=0x0;_0x4971e2<_0x306e56['length'];_0x4971e2++){if(_0x306e56[_0x4971e2][_0x8ecc('0x20')]===_0x577c27[_0x8ecc('0x1e')]&&!_0x306e56[_0x4971e2]['isdisabled']){_0x27d262=!![];logger['info']('['+[_0x27ac02['toUpperCase']()]+_0x8ecc('0x21')+_0x306e56[_0x4971e2][_0x8ecc('0x22')]+'!');_0xb49d42[_0x8ecc('0x23')]=_0x306e56[_0x4971e2][_0x8ecc('0x22')];}}}}if(!_0x27d262){logger['info']('['+[_0x27ac02[_0x8ecc('0x18')]()]+_0x8ecc('0x24'));_0xb49d42[_0x8ecc('0x1f')]=_0x3fb745[_0x8ecc('0x25')];for(_0x4971e2=0x0;_0x4971e2<_0x306e56[_0x8ecc('0x26')];_0x4971e2++){if(_0x306e56[_0x4971e2]['internalemailaddress']===_0x3fb745[_0x8ecc('0x25')]){_0xb49d42[_0x8ecc('0x23')]=_0x306e56[_0x4971e2][_0x8ecc('0x22')];}}}_0x1612d9(_0xb49d42);})[_0x8ecc('0x16')](function(_0x157a0b){_0xe3c45c(_0x157a0b[_0x8ecc('0x27')]);});});}function createEndUser(_0x4d7174,_0x22fc20,_0x391ad4,_0x328ca2,_0x24c145,_0xf2123,_0xbdac4c){return new Promise(function(_0x4ebd31,_0x341608){return getAuthToken(_0x22fc20,_0x391ad4,_0xf2123)['then'](function(_0x57004c){var _0x3b4ecd=_0xf2123[_0x8ecc('0x28')]()==='outbound'?_0x24c145[_0x8ecc('0x29')]:_0x24c145[_0x8ecc('0x2a')];var _0x55e21e={'method':_0x8ecc('0x10'),'uri':_0x328ca2+_0x8ecc('0x2b'),'body':{'fullname':_0x3b4ecd,'firstname':_0x3b4ecd,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8ecc('0x2c')+_0x4d7174[_0x8ecc('0x23')]+')'},'headers':{'Authorization':_0x8ecc('0x1b')+_0x57004c,'OData-Version':_0x8ecc('0x2d')},'json':!![],'resolveWithFullResponse':!![]};_0x55e21e[_0x8ecc('0x2e')][_0xbdac4c]=_0x3b4ecd;return rp(_0x55e21e);})[_0x8ecc('0x14')](function(_0x492cca){var _0x576d1d=_0x492cca['headers'][_0x8ecc('0x2f')];var _0x19bcd2=_0x576d1d[_0x8ecc('0x30')](_0x576d1d[_0x8ecc('0x31')]('(')+0x1,_0x576d1d[_0x8ecc('0x31')](')'));_0x4d7174[_0x8ecc('0x32')]=_0x19bcd2;_0x4ebd31(_0x4d7174);})[_0x8ecc('0x16')](function(_0x23f0e0){_0x341608(_0x23f0e0[_0x8ecc('0x27')]);});});}function getEndUser(_0x26594b,_0x21a64e,_0x71db83,_0x35c68e,_0x30ba81,_0x151406,_0x5de7ba,_0x544f38){var _0x42a2ed=_0x151406['toLowerCase']()==='outbound'?_0x30ba81[_0x8ecc('0x29')]:_0x30ba81[_0x8ecc('0x2a')];return getAuthToken(_0x21a64e,_0x71db83,_0x151406)[_0x8ecc('0x14')](function(_0x34a240){_0x544f38=_0x544f38?_0x544f38:_0x8ecc('0x33');var _0x301211={'method':_0x8ecc('0x19'),'uri':_0x35c68e+_0x8ecc('0x34')+_0x544f38+_0x8ecc('0x35')+_0x544f38+'\x20eq\x20\x27'+_0x42a2ed[_0x8ecc('0x36')]('+',_0x8ecc('0x37'))+'\x27','headers':{'Authorization':_0x8ecc('0x1b')+_0x34a240,'If-None-Match':null,'OData-Version':_0x8ecc('0x2d')},'json':!![]};return rp(_0x301211);})[_0x8ecc('0x14')](function(_0x2bcfd2){var _0x4522c8=![];if(!_0x2bcfd2)return _0x4522c8;var _0x2f0a02=_0x2bcfd2[_0x8ecc('0x1c')];for(var _0x18a256=0x0;_0x18a256<_0x2f0a02[_0x8ecc('0x26')];_0x18a256++){if(_0x2f0a02[_0x18a256][_0x544f38]===_0x42a2ed){_0x4522c8=!![];_0x26594b['enduserId']=_0x2f0a02[_0x18a256][_0x8ecc('0x38')];}}return _0x4522c8;})[_0x8ecc('0x14')](function(_0x53cd74){if(_0x53cd74)return _0x26594b;if(_0x5de7ba===_0x8ecc('0x39')){logger[_0x8ecc('0x3a')]('['+[_0x151406[_0x8ecc('0x18')]()]+_0x8ecc('0x3b'));return _0x26594b;}return createEndUser(_0x26594b,_0x21a64e,_0x71db83,_0x35c68e,_0x30ba81,_0x151406,_0x544f38)[_0x8ecc('0x14')](function(_0x2dd7d2){logger[_0x8ecc('0x3a')]('['+[_0x151406[_0x8ecc('0x18')]()]+']\x20Enduser\x20created!',_0x2dd7d2['enduserId']);return _0x2dd7d2;});});}function getCustomFields(_0xa59f43,_0x4b57e0,_0x5032f5){var _0x3abb16={};if(_0xa59f43[_0x8ecc('0x26')]>0x0){_[_0x8ecc('0x3c')](_0xa59f43,function(_0x5e3005){if(_['includes']([_0x8ecc('0x3d'),_0x8ecc('0x3e')],_0x5e3005[_0x8ecc('0x3f')])&&_0x5e3005[_0x8ecc('0x40')]&&!_0x5e3005[_0x8ecc('0x41')]){var _0x120e71=_0x5e3005[_0x8ecc('0x42')][_0x8ecc('0x28')]();var _0x25e923=_0x120e71[_0x8ecc('0x30')](0x0,_0x120e71[_0x8ecc('0x43')]('_'));var _0xa9f89=_0x120e71[_0x8ecc('0x30')](_0x120e71[_0x8ecc('0x43')]('_')+0x1);if(_0x25e923===_0x5032f5){_0x3abb16[_0xa9f89]=_0x5e3005['content'];}}});}return _0x3abb16;}function getTicket(_0x23e238,_0x35d0ee,_0x251208,_0x78e0d3,_0x2613d8,_0x2ce807,_0x3b0e04){return new Promise(function(_0x1f22a6,_0x3a6144){var _0x1d72f9;return getAuthToken(_0x35d0ee,_0x251208,_0x3b0e04)[_0x8ecc('0x14')](function(_0x14210c){if(_0x2ce807['ticketType']==='incident'){_0x1d72f9={'method':_0x8ecc('0x10'),'uri':_0x78e0d3+_0x8ecc('0x44'),'body':Object[_0x8ecc('0x45')]({},{'title':intUtil['getString'](_0x2ce807[_0x8ecc('0x46')],_0x2613d8,'\x20'),'description':intUtil[_0x8ecc('0x47')](_0x2ce807[_0x8ecc('0x48')],_0x2613d8,'\x0a'),'customerid_contact@odata.bind':_0x23e238[_0x8ecc('0x32')]?_0x8ecc('0x49')+_0x23e238[_0x8ecc('0x32')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x23e238[_0x8ecc('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x2ce807[_0x8ecc('0x4a')],_0x2613d8,_0x2ce807[_0x8ecc('0x4b')])),'headers':{'Authorization':_0x8ecc('0x1b')+_0x14210c,'OData-Version':_0x8ecc('0x2d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2ce807[_0x8ecc('0x4b')]===_0x8ecc('0x4c')){var _0x21d3b0=_0x23e238[_0x8ecc('0x32')]?[{'partyid_systemuser@odata.bind':_0x8ecc('0x2c')+_0x23e238['userId']+')','participationtypemask':_0x23e238[_0x8ecc('0x4d')]===_0x8ecc('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':_0x8ecc('0x49')+_0x23e238[_0x8ecc('0x32')]+')','participationtypemask':_0x23e238[_0x8ecc('0x4d')]===_0x8ecc('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x8ecc('0x2c')+_0x23e238[_0x8ecc('0x23')]+')','participationtypemask':_0x23e238[_0x8ecc('0x4d')]===_0x8ecc('0x4e')?0x2:0x1}];_0x1d72f9={'method':_0x8ecc('0x10'),'uri':_0x78e0d3+_0x8ecc('0x4f'),'body':Object[_0x8ecc('0x45')]({},{'subject':intUtil[_0x8ecc('0x47')](_0x2ce807[_0x8ecc('0x46')],_0x2613d8,'\x20'),'phonenumber':String(_0x2613d8[_0x8ecc('0x2a')]),'description':intUtil['getString'](_0x2ce807['Descriptions'],_0x2613d8,'\x0a'),'regardingobjectid_contact@odata.bind':_0x23e238[_0x8ecc('0x32')]?_0x8ecc('0x49')+_0x23e238[_0x8ecc('0x32')]+')':undefined,'ownerid@odata.bind':_0x8ecc('0x2c')+_0x23e238[_0x8ecc('0x23')]+')','directioncode':_0x23e238[_0x8ecc('0x4d')]===_0x8ecc('0x4e')?![]:!![],'phonecall_activity_parties':_0x21d3b0},getCustomFields(_0x2ce807['Fields'],_0x2613d8,_0x2ce807[_0x8ecc('0x4b')])),'headers':{'Authorization':_0x8ecc('0x1b')+_0x14210c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1d72f9);})[_0x8ecc('0x14')](function(_0x43d722){var _0x349073=_0x43d722[_0x8ecc('0x50')][_0x8ecc('0x2f')];var _0x34da3a=_0x349073[_0x8ecc('0x30')](_0x349073[_0x8ecc('0x31')]('(')+0x1,_0x349073[_0x8ecc('0x31')](')'));_0x23e238[_0x8ecc('0x51')]=_0x34da3a;_0x1f22a6(_0x23e238);})[_0x8ecc('0x16')](function(_0x55fb76){_0x3a6144(_0x55fb76[_0x8ecc('0x27')]);});});}function emit(_0x48d91e,_0x24ce41,_0x6df867,_0x15f9fd){var _0x3acbd9={'uri':util[_0x8ecc('0x52')](_0x8ecc('0x53'),_0x48d91e,_0x6df867,_0x15f9fd)};io['to'](util[_0x8ecc('0x52')](_0x8ecc('0x54'),_0x24ce41))[_0x8ecc('0x55')]('trigger:browser:url',_0x3acbd9);}exports['cs']=function(_0x1fe781,_0x6c69ae,_0x509c9c,_0x2b4ef7,_0x40b5d7,_0x16baaa,_0x1ac535,_0x3dade0){var _0x5067b1={};_0x16baaa[_0x8ecc('0xb')]=_0x16baaa[_0x8ecc('0xa')]?intUtil[_0x8ecc('0x56')](_0x16baaa[_0x8ecc('0xc')][_0x8ecc('0xd')]):intUtil[_0x8ecc('0x56')](_0x16baaa[_0x8ecc('0xb')]);_0x16baaa['serverUrl']=intUtil[_0x8ecc('0x56')](_0x16baaa['serverUrl']);_0x5067b1[_0x8ecc('0x4d')]=_0x3dade0===_0x8ecc('0x4e')||_0x3dade0===_0x8ecc('0x57')?_0x8ecc('0x4e'):_0x8ecc('0x58');var _0x541365=_0x16baaa[_0x8ecc('0xa')]?util[_0x8ecc('0x52')]('%s/api/data/v9.0/',_0x16baaa[_0x8ecc('0xc')][_0x8ecc('0xd')]):util['format']('%s/api/data/v9.0/',_0x16baaa[_0x8ecc('0xb')]);var _0x983add=util[_0x8ecc('0x52')](_0x8ecc('0x59'),_0x16baaa[_0x8ecc('0xe')]);var _0x51e7fd=util['format'](_0x8ecc('0x5a'),_0x16baaa[_0x8ecc('0x5b')],_0x6c69ae[_0x8ecc('0x5c')],md5(_0x6c69ae['uniqueid']));if(_0x40b5d7&&_0x40b5d7['monitor_format']){logger[_0x8ecc('0x3a')](_0x8ecc('0x5d'),_0x8ecc('0x5e'));_0x6c69ae[_0x8ecc('0x5f')]=_0x51e7fd;}else if(_0x1ac535&&_0x1ac535['recordingFormat']&&_0x1ac535[_0x8ecc('0x60')]!=='none'){logger[_0x8ecc('0x3a')]('[OUTBOUND]',_0x8ecc('0x5e'));_0x6c69ae['recordingURL']=_0x51e7fd;}else{_0x6c69ae[_0x8ecc('0x5f')]='';}return getUser(_0x5067b1,_0x16baaa,_0x2b4ef7,_0x983add,_0x541365,_0x3dade0)[_0x8ecc('0x14')](function(_0x46d4a4){logger[_0x8ecc('0x3a')]('['+_0x3dade0['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x46d4a4['userId']);logger[_0x8ecc('0x3a')]('['+_0x3dade0[_0x8ecc('0x18')]()+_0x8ecc('0x61'),_0x46d4a4[_0x8ecc('0x1f')]);return getEndUser(_0x46d4a4,_0x16baaa,_0x983add,_0x541365,_0x6c69ae,_0x3dade0,_0x509c9c['moduleCreate'],_0x509c9c[_0x8ecc('0x62')]);})[_0x8ecc('0x14')](function(_0x3720d5){logger[_0x8ecc('0x3a')]('['+_0x3dade0[_0x8ecc('0x18')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x3720d5[_0x8ecc('0x32')]);logger['info']('['+_0x3dade0['toUpperCase']()+_0x8ecc('0x63'),_0x6c69ae[_0x8ecc('0x2a')]);return getTicket(_0x3720d5,_0x16baaa,_0x983add,_0x541365,_0x6c69ae,_0x509c9c,_0x3dade0);})[_0x8ecc('0x14')](function(_0x3794bc){logger['info'](util[_0x8ecc('0x52')]('['+_0x3dade0[_0x8ecc('0x18')]()+_0x8ecc('0x64'),_0x509c9c[_0x8ecc('0x4b')],_0x3794bc[_0x8ecc('0x51')]));logger['info'](util[_0x8ecc('0x52')]('['+_0x3dade0[_0x8ecc('0x18')]()+_0x8ecc('0x65'),_0x3dade0));if(_0x3dade0!==_0x8ecc('0x57')&&_0x509c9c[_0x8ecc('0x66')]){logger['info']('['+_0x3dade0[_0x8ecc('0x18')]()+']',_0x8ecc('0x67'));emit(_0x16baaa[_0x8ecc('0xb')],_0x2b4ef7[_0x8ecc('0x68')],_0x509c9c[_0x8ecc('0x4b')],_0x3794bc[_0x8ecc('0x51')]);}})[_0x8ecc('0x16')](function(_0x514a22){logger['error']('['+_0x3dade0[_0x8ecc('0x18')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x514a22[_0x8ecc('0x27')]);console[_0x8ecc('0x17')](_0x8ecc('0x69'),_0x514a22);});}; \ No newline at end of file +var _0xcb6f=['socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','resolve','data5','POST','clientId','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','validateEmail','email','length','isdisabled','systemuserid','userId','info','userEmail','internalemailaddress','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','calleridnum','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','4.0','value','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','type','customField','idField','indexOf','content','incident','incidents','getString','Descriptions','/contacts(','phonecall','callDirection','queue','phonecalls','assign','Subjects','ticketType','ticketId','message','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','../../../../config/logger','defaults','redis','localhost'];(function(_0xf06c7,_0x5b7b6b){var _0x4e24ac=function(_0x5e3db6){while(--_0x5e3db6){_0xf06c7['push'](_0xf06c7['shift']());}};_0x4e24ac(++_0x5b7b6b);}(_0xcb6f,0x141));var _0xfcb6=function(_0x2ed1ff,_0x177307){_0x2ed1ff=_0x2ed1ff-0x0;var _0x10b0fa=_0xcb6f[_0x2ed1ff];return _0x10b0fa;};'use strict';var _=require('lodash');var rp=require(_0xfcb6('0x0'));var util=require(_0xfcb6('0x1'));var intUtil=require(_0xfcb6('0x2'));var md5=require(_0xfcb6('0x3'));var Redis=require(_0xfcb6('0x4'));var logger=require(_0xfcb6('0x5'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_[_0xfcb6('0x6')](config[_0xfcb6('0x7')],{'host':_0xfcb6('0x8'),'port':0x18eb});var io=require(_0xfcb6('0x9'))(new Redis(config[_0xfcb6('0x7')]));function getAuthToken(_0x176e93,_0x457f72,_0x1a14f3){if(_0x176e93[_0xfcb6('0xa')]){_0x176e93[_0xfcb6('0xb')]=_0x176e93[_0xfcb6('0xc')][_0xfcb6('0xd')];_0x176e93[_0xfcb6('0xe')]=_0x176e93[_0xfcb6('0xc')]['data2'];return Promise[_0xfcb6('0xf')](_0x176e93[_0xfcb6('0xc')][_0xfcb6('0x10')]);}var _0x20acd7={'method':_0xfcb6('0x11'),'uri':_0x457f72,'form':{'client_id':_0x176e93[_0xfcb6('0x12')],'resource':_0x176e93[_0xfcb6('0xb')],'username':_0x176e93[_0xfcb6('0x13')],'password':_0x176e93['password'],'grant_type':_0xfcb6('0x14'),'client_secret':_0x176e93['clientSecret']},'json':!![]};return rp(_0x20acd7)[_0xfcb6('0x15')](function(_0x361930){return _0x361930[_0xfcb6('0x16')];})[_0xfcb6('0x17')](function(_0x5b28f3){logger[_0xfcb6('0x18')]('['+[_0x1a14f3[_0xfcb6('0x19')]()]+_0xfcb6('0x1a'));return _0x5b28f3['message'];});}function getUser(_0xb059,_0x51bdb4,_0x27d228,_0x422af5,_0x358f82,_0x30fb4a){return new Promise(function(_0x50a50c,_0x106420){return getAuthToken(_0x51bdb4,_0x422af5,_0x30fb4a)[_0xfcb6('0x15')](function(_0x326e91){var _0x148ef2={'method':_0xfcb6('0x1b'),'uri':_0x358f82+_0xfcb6('0x1c'),'headers':{'Authorization':_0xfcb6('0x1d')+_0x326e91,'OData-Version':'4.0'},'json':!![]};return rp(_0x148ef2);})[_0xfcb6('0x15')](function(_0x3e21f3){var _0x3a1b54=_0x3e21f3['value'];var _0x1e66c1=![];var _0x3d39f1=null;if(!_['isNil'](_0x27d228)){if(intUtil[_0xfcb6('0x1e')](_0x27d228[_0xfcb6('0x1f')])){_0xb059['userEmail']=_0x27d228[_0xfcb6('0x1f')];for(_0x3d39f1=0x0;_0x3d39f1<_0x3a1b54[_0xfcb6('0x20')];_0x3d39f1++){if(_0x3a1b54[_0x3d39f1]['internalemailaddress']===_0x27d228['email']&&!_0x3a1b54[_0x3d39f1][_0xfcb6('0x21')]){_0x1e66c1=!![];logger['info']('['+[_0x30fb4a[_0xfcb6('0x19')]()]+']\x20Agent\x20found\x20'+_0x3a1b54[_0x3d39f1][_0xfcb6('0x22')]+'!');_0xb059[_0xfcb6('0x23')]=_0x3a1b54[_0x3d39f1][_0xfcb6('0x22')];}}}}if(!_0x1e66c1){logger[_0xfcb6('0x24')]('['+[_0x30fb4a[_0xfcb6('0x19')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xb059[_0xfcb6('0x25')]=_0x51bdb4[_0xfcb6('0x13')];for(_0x3d39f1=0x0;_0x3d39f1<_0x3a1b54[_0xfcb6('0x20')];_0x3d39f1++){if(_0x3a1b54[_0x3d39f1][_0xfcb6('0x26')]===_0x51bdb4[_0xfcb6('0x13')]){_0xb059['userId']=_0x3a1b54[_0x3d39f1][_0xfcb6('0x22')];}}}_0x50a50c(_0xb059);})['catch'](function(_0x547867){_0x106420(_0x547867['message']);});});}function createEndUser(_0x167ec3,_0x5ab42f,_0x1d80fe,_0x3a0d82,_0x45ec81,_0x4e01cb,_0x5a3366){return new Promise(function(_0x4f44f0,_0x24e329){return getAuthToken(_0x5ab42f,_0x1d80fe,_0x4e01cb)[_0xfcb6('0x15')](function(_0x3f2624){var _0x3d6a9e=_0x4e01cb[_0xfcb6('0x27')]()===_0xfcb6('0x28')?_0x45ec81[_0xfcb6('0x29')]:_0x45ec81['calleridnum'];var _0x310cf0={'method':_0xfcb6('0x11'),'uri':_0x3a0d82+_0xfcb6('0x2a'),'body':{'fullname':_0x3d6a9e,'firstname':_0x3d6a9e,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfcb6('0x2b')+_0x167ec3[_0xfcb6('0x23')]+')'},'headers':{'Authorization':_0xfcb6('0x1d')+_0x3f2624,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x310cf0[_0xfcb6('0x2c')][_0x5a3366]=_0x3d6a9e;return rp(_0x310cf0);})['then'](function(_0x41c5f3){var _0x62d5e8=_0x41c5f3[_0xfcb6('0x2d')][_0xfcb6('0x2e')];var _0x457f40=_0x62d5e8[_0xfcb6('0x2f')](_0x62d5e8[_0xfcb6('0x30')]('(')+0x1,_0x62d5e8[_0xfcb6('0x30')](')'));_0x167ec3['enduserId']=_0x457f40;_0x4f44f0(_0x167ec3);})[_0xfcb6('0x17')](function(_0x1db06e){_0x24e329(_0x1db06e['message']);});});}function getEndUser(_0x2e04fd,_0x21eac4,_0xc19169,_0x5711e6,_0x42e87d,_0x46e508,_0x36baa4,_0x1d31c4){var _0x356a93=_0x46e508['toLowerCase']()===_0xfcb6('0x28')?_0x42e87d[_0xfcb6('0x29')]:_0x42e87d[_0xfcb6('0x31')];return getAuthToken(_0x21eac4,_0xc19169,_0x46e508)['then'](function(_0x1b1156){_0x1d31c4=_0x1d31c4?_0x1d31c4:'telephone1';var _0x5f1fcf={'method':_0xfcb6('0x1b'),'uri':_0x5711e6+_0xfcb6('0x32')+_0x1d31c4+_0xfcb6('0x33')+_0x1d31c4+_0xfcb6('0x34')+_0x356a93[_0xfcb6('0x35')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1b1156,'If-None-Match':null,'OData-Version':_0xfcb6('0x36')},'json':!![]};return rp(_0x5f1fcf);})[_0xfcb6('0x15')](function(_0x38bb35){var _0x5700ba=![];if(!_0x38bb35)return _0x5700ba;var _0x28e5c2=_0x38bb35[_0xfcb6('0x37')];for(var _0x307aeb=0x0;_0x307aeb<_0x28e5c2['length'];_0x307aeb++){if(_0x28e5c2[_0x307aeb][_0x1d31c4]===_0x356a93){_0x5700ba=!![];_0x2e04fd[_0xfcb6('0x38')]=_0x28e5c2[_0x307aeb][_0xfcb6('0x39')];}}return _0x5700ba;})[_0xfcb6('0x15')](function(_0x529647){if(_0x529647)return _0x2e04fd;if(_0x36baa4===_0xfcb6('0x3a')){logger[_0xfcb6('0x24')]('['+[_0x46e508[_0xfcb6('0x19')]()]+_0xfcb6('0x3b'));return _0x2e04fd;}return createEndUser(_0x2e04fd,_0x21eac4,_0xc19169,_0x5711e6,_0x42e87d,_0x46e508,_0x1d31c4)['then'](function(_0x37d5ce){logger[_0xfcb6('0x24')]('['+[_0x46e508[_0xfcb6('0x19')]()]+_0xfcb6('0x3c'),_0x37d5ce[_0xfcb6('0x38')]);return _0x37d5ce;});});}function getCustomFields(_0xfecbc4,_0x4de414,_0x29abf9){var _0x5c3c54={};if(_0xfecbc4['length']>0x0){_[_0xfcb6('0x3d')](_0xfecbc4,function(_0x407aba){if(_[_0xfcb6('0x3e')](['string',_0xfcb6('0x3f')],_0x407aba[_0xfcb6('0x40')])&&_0x407aba['nameField']&&!_0x407aba[_0xfcb6('0x41')]){var _0x4d2517=_0x407aba[_0xfcb6('0x42')][_0xfcb6('0x27')]();var _0x12fa61=_0x4d2517[_0xfcb6('0x2f')](0x0,_0x4d2517['indexOf']('_'));var _0x4d51ce=_0x4d2517['substring'](_0x4d2517[_0xfcb6('0x43')]('_')+0x1);if(_0x12fa61===_0x29abf9){_0x5c3c54[_0x4d51ce]=_0x407aba[_0xfcb6('0x44')];}}});}return _0x5c3c54;}function getTicket(_0x2de9a3,_0x939f3d,_0x48c482,_0x3f16bd,_0x524d93,_0x438ca7,_0x3544de){return new Promise(function(_0x4aac59,_0x4dea13){var _0x159158;return getAuthToken(_0x939f3d,_0x48c482,_0x3544de)[_0xfcb6('0x15')](function(_0x5e7145){if(_0x438ca7['ticketType']===_0xfcb6('0x45')){_0x159158={'method':_0xfcb6('0x11'),'uri':_0x3f16bd+_0xfcb6('0x46'),'body':Object['assign']({},{'title':intUtil[_0xfcb6('0x47')](_0x438ca7['Subjects'],_0x524d93,'\x20'),'description':intUtil[_0xfcb6('0x47')](_0x438ca7[_0xfcb6('0x48')],_0x524d93,'\x0a'),'customerid_contact@odata.bind':_0x2de9a3[_0xfcb6('0x38')]?_0xfcb6('0x49')+_0x2de9a3['enduserId']+')':undefined,'ownerid@odata.bind':_0xfcb6('0x2b')+_0x2de9a3['userId']+')','caseorigincode':'1'},getCustomFields(_0x438ca7['Fields'],_0x524d93,_0x438ca7['ticketType'])),'headers':{'Authorization':_0xfcb6('0x1d')+_0x5e7145,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x438ca7['ticketType']===_0xfcb6('0x4a')){var _0x1afbc1=_0x2de9a3[_0xfcb6('0x38')]?[{'partyid_systemuser@odata.bind':_0xfcb6('0x2b')+_0x2de9a3[_0xfcb6('0x23')]+')','participationtypemask':_0x2de9a3[_0xfcb6('0x4b')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x2de9a3[_0xfcb6('0x38')]+')','participationtypemask':_0x2de9a3[_0xfcb6('0x4b')]===_0xfcb6('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xfcb6('0x2b')+_0x2de9a3['userId']+')','participationtypemask':_0x2de9a3['callDirection']==='queue'?0x2:0x1}];_0x159158={'method':'POST','uri':_0x3f16bd+_0xfcb6('0x4d'),'body':Object[_0xfcb6('0x4e')]({},{'subject':intUtil[_0xfcb6('0x47')](_0x438ca7[_0xfcb6('0x4f')],_0x524d93,'\x20'),'phonenumber':String(_0x524d93[_0xfcb6('0x31')]),'description':intUtil[_0xfcb6('0x47')](_0x438ca7[_0xfcb6('0x48')],_0x524d93,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2de9a3[_0xfcb6('0x38')]?_0xfcb6('0x49')+_0x2de9a3['enduserId']+')':undefined,'ownerid@odata.bind':_0xfcb6('0x2b')+_0x2de9a3['userId']+')','directioncode':_0x2de9a3[_0xfcb6('0x4b')]===_0xfcb6('0x4c')?![]:!![],'phonecall_activity_parties':_0x1afbc1},getCustomFields(_0x438ca7['Fields'],_0x524d93,_0x438ca7[_0xfcb6('0x50')])),'headers':{'Authorization':_0xfcb6('0x1d')+_0x5e7145,'OData-Version':_0xfcb6('0x36')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x159158);})[_0xfcb6('0x15')](function(_0x3a3501){var _0x48d972=_0x3a3501[_0xfcb6('0x2d')]['odata-entityid'];var _0x79513f=_0x48d972[_0xfcb6('0x2f')](_0x48d972[_0xfcb6('0x30')]('(')+0x1,_0x48d972[_0xfcb6('0x30')](')'));_0x2de9a3[_0xfcb6('0x51')]=_0x79513f;_0x4aac59(_0x2de9a3);})[_0xfcb6('0x17')](function(_0x443bb5){_0x4dea13(_0x443bb5[_0xfcb6('0x52')]);});});}function emit(_0x8da430,_0x387a15,_0x30b1fb,_0x34dde3){var _0x32165b={'uri':util['format'](_0xfcb6('0x53'),_0x8da430,_0x30b1fb,_0x34dde3)};io['to'](util[_0xfcb6('0x54')](_0xfcb6('0x55'),_0x387a15))[_0xfcb6('0x56')](_0xfcb6('0x57'),_0x32165b);}exports['cs']=function(_0x9b2636,_0x11a51d,_0x1b54a9,_0x461f8d,_0x3f67b4,_0xa5b3e3,_0x318804,_0x2f7f74){var _0xcf3e96={};_0xa5b3e3['remoteUri']=_0xa5b3e3['modernAuthentication']?intUtil[_0xfcb6('0x58')](_0xa5b3e3['CloudProvider'][_0xfcb6('0xd')]):intUtil['stripTrailingSlash'](_0xa5b3e3['remoteUri']);_0xa5b3e3[_0xfcb6('0x59')]=intUtil[_0xfcb6('0x58')](_0xa5b3e3[_0xfcb6('0x59')]);_0xcf3e96[_0xfcb6('0x4b')]=_0x2f7f74==='queue'||_0x2f7f74===_0xfcb6('0x5a')?_0xfcb6('0x4c'):_0xfcb6('0x28');var _0x131d03=_0xa5b3e3[_0xfcb6('0xa')]?util[_0xfcb6('0x54')](_0xfcb6('0x5b'),_0xa5b3e3[_0xfcb6('0xc')]['data7']):util[_0xfcb6('0x54')](_0xfcb6('0x5b'),_0xa5b3e3[_0xfcb6('0xb')]);var _0x486a56=util[_0xfcb6('0x54')](_0xfcb6('0x5c'),_0xa5b3e3[_0xfcb6('0xe')]);var _0x1da5cf=util[_0xfcb6('0x54')](_0xfcb6('0x5d'),_0xa5b3e3[_0xfcb6('0x59')],_0x11a51d[_0xfcb6('0x5e')],md5(_0x11a51d[_0xfcb6('0x5e')]));if(_0x3f67b4&&_0x3f67b4[_0xfcb6('0x5f')]){logger[_0xfcb6('0x24')](_0xfcb6('0x60'),_0xfcb6('0x61'));_0x11a51d[_0xfcb6('0x62')]=_0x1da5cf;}else if(_0x318804&&_0x318804['recordingFormat']&&_0x318804[_0xfcb6('0x63')]!=='none'){logger[_0xfcb6('0x24')](_0xfcb6('0x64'),_0xfcb6('0x61'));_0x11a51d[_0xfcb6('0x62')]=_0x1da5cf;}else{_0x11a51d[_0xfcb6('0x62')]='';}return getUser(_0xcf3e96,_0xa5b3e3,_0x461f8d,_0x486a56,_0x131d03,_0x2f7f74)[_0xfcb6('0x15')](function(_0x310f99){logger['info']('['+_0x2f7f74[_0xfcb6('0x19')]()+']\x20The\x20User\x20ID\x20is:',_0x310f99[_0xfcb6('0x23')]);logger[_0xfcb6('0x24')]('['+_0x2f7f74[_0xfcb6('0x19')]()+_0xfcb6('0x65'),_0x310f99[_0xfcb6('0x25')]);return getEndUser(_0x310f99,_0xa5b3e3,_0x486a56,_0x131d03,_0x11a51d,_0x2f7f74,_0x1b54a9[_0xfcb6('0x66')],_0x1b54a9[_0xfcb6('0x67')]);})[_0xfcb6('0x15')](function(_0x24b6d5){logger[_0xfcb6('0x24')]('['+_0x2f7f74[_0xfcb6('0x19')]()+_0xfcb6('0x68'),_0x24b6d5[_0xfcb6('0x38')]);logger[_0xfcb6('0x24')]('['+_0x2f7f74[_0xfcb6('0x19')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x11a51d['calleridnum']);return getTicket(_0x24b6d5,_0xa5b3e3,_0x486a56,_0x131d03,_0x11a51d,_0x1b54a9,_0x2f7f74);})['then'](function(_0x1ef415){logger[_0xfcb6('0x24')](util[_0xfcb6('0x54')]('['+_0x2f7f74['toUpperCase']()+_0xfcb6('0x69'),_0x1b54a9[_0xfcb6('0x50')],_0x1ef415[_0xfcb6('0x51')]));logger[_0xfcb6('0x24')](util[_0xfcb6('0x54')]('['+_0x2f7f74[_0xfcb6('0x19')]()+']\x20Call\x20direction:\x20%s',_0x2f7f74));if(_0x2f7f74!==_0xfcb6('0x5a')&&_0x1b54a9[_0xfcb6('0x6a')]){logger[_0xfcb6('0x24')]('['+_0x2f7f74[_0xfcb6('0x19')]()+']',_0xfcb6('0x6b'));emit(_0xa5b3e3[_0xfcb6('0xb')],_0x461f8d[_0xfcb6('0x6c')],_0x1b54a9[_0xfcb6('0x50')],_0x1ef415[_0xfcb6('0x51')]);}})['catch'](function(_0x2749c4){logger[_0xfcb6('0x18')]('['+_0x2f7f74['toUpperCase']()+_0xfcb6('0x6d'),_0x2749c4['message']);console[_0xfcb6('0x18')]('Error\x20running\x20Dynamics365\x20integration',_0x2749c4);});}; \ 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 3489b14..5ca048e 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 _0x4f05=['destcalleridname','The\x20Enduser\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','value','%s/api/v2/tickets','then','info','Ticket\x20created!','remoteUri','Agent\x20found!','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','stringify','GET','map','forEach','string','picklist','type','nameField','customField','content','includes','idField','push','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]'];(function(_0x201d98,_0x56fd1f){var _0x1ae057=function(_0xb7eeab){while(--_0xb7eeab){_0x201d98['push'](_0x201d98['shift']());}};_0x1ae057(++_0x56fd1f);}(_0x4f05,0x178));var _0x54f0=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x4f05[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x54f0('0x0'));var rp=require('request-promise');var md5=require(_0x54f0('0x1'));var util=require(_0x54f0('0x2'));var Redis=require(_0x54f0('0x3'));var intUtil=require(_0x54f0('0x4'));var config=require(_0x54f0('0x5'));var logger=require(_0x54f0('0x6'))(_0x54f0('0x7'));config[_0x54f0('0x8')]=_[_0x54f0('0x9')](config['redis'],{'host':_0x54f0('0xa'),'port':0x18eb});var io=require(_0x54f0('0xb'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0x54f0('0xc')};function emit(_0x4a8a7d,_0x3828a9,_0x23ef63){io['to'](_0x4a8a7d)[_0x54f0('0xd')](_0x3828a9,_0x23ef63);}function getTicket(_0x5bfff8,_0x436f56,_0xcaa7b8,_0x53f1d0,_0x30743c){logger['info'](_0x54f0('0xe'));var _0x5c11cc=_[_0x54f0('0xf')]({'responder_id':_0x436f56['id'],'requester_id':_0xcaa7b8['id'],'name':util[_0x54f0('0x10')](_0x54f0('0x11'),_0x30743c['calleridname']),'phone':_0x30743c['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x54f0('0x12')](_0x53f1d0['Subjects'],_0x30743c,'\x20'),'description':intUtil[_0x54f0('0x12')](_0x53f1d0[_0x54f0('0x13')],_0x30743c,_0x54f0('0x14')),'tags':getTags(_0x53f1d0[_0x54f0('0x15')],_0x54f0('0x16'))},getCustomFields(_0x53f1d0[_0x54f0('0x17')],_0x30743c));_0x5c11cc[_0x54f0('0x18')]=_[_0x54f0('0x19')](_['keyBy'](_0x5c11cc[_0x54f0('0x18')],'id'),_0x54f0('0x1a'));return request({'uri':util[_0x54f0('0x10')](_0x54f0('0x1b'),_0x5bfff8['remoteUri']),'method':'POST','body':_0x5c11cc})[_0x54f0('0x1c')](function(_0x3b457a){logger[_0x54f0('0x1d')](_0x54f0('0x1e'));return _0x3b457a;});}function getUser(_0x1731f9,_0x3a8853){if(intUtil['validateEmail'](_0x3a8853)){return request({'uri':util[_0x54f0('0x10')]('%s/api/v2/agents',_0x1731f9[_0x54f0('0x1f')]),'qs':{'email':_0x3a8853}})[_0x54f0('0x1c')](function(_0x2eed81){if(_0x2eed81['length']){logger[_0x54f0('0x1d')](_0x54f0('0x20'));return _[_0x54f0('0x21')](_0x2eed81,function(_0xf7cc73){return _0xf7cc73[_0x54f0('0x22')]['email']===_0x3a8853;});}else{logger[_0x54f0('0x1d')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x54f0('0x23'),_0x1731f9['remoteUri'])})['then'](function(_0x316ce3){logger[_0x54f0('0x1d')](_0x54f0('0x24'));return _0x316ce3;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x54f0('0x10')](_0x54f0('0x23'),_0x1731f9[_0x54f0('0x1f')])})['then'](function(_0x26155b){logger[_0x54f0('0x1d')](_0x54f0('0x24'));return _0x26155b;});}}function getEndUser(_0x15503a,_0xd777c2,_0x23adff){logger[_0x54f0('0x1d')](_0x54f0('0x25'),_0x23adff);return request({'uri':util[_0x54f0('0x10')](_0x54f0('0x26'),_0x15503a[_0x54f0('0x1f')]),'qs':{'phone':_0x23adff}})[_0x54f0('0x1c')](function(_0x42366f){if(_0x42366f['length']){logger[_0x54f0('0x1d')](_0x54f0('0x27'));return _[_0x54f0('0x21')](_0x42366f,{'phone':_0x23adff});}else{logger[_0x54f0('0x1d')](_0x54f0('0x28'));return request({'uri':util[_0x54f0('0x10')]('%s/api/v2/contacts',_0x15503a['remoteUri']),'method':_0x54f0('0x29'),'body':{'name':_0xd777c2,'phone':_0x23adff}})[_0x54f0('0x1c')](function(_0x109730){logger[_0x54f0('0x1d')](_0x54f0('0x2a'));return _0x109730;});}});}function getAuth(_0x335192){return util['format'](_0x54f0('0x2b'),new Buffer(_0x335192[_0x54f0('0x2c')]+':X')[_0x54f0('0x2d')]('base64'));}function request(_0x6e3dd){logger['debug']('[HTTP]',JSON[_0x54f0('0x2e')](_0x6e3dd));return rp(_[_0x54f0('0x9')](_0x6e3dd,{'method':_0x54f0('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x40faaf,_0x296fea){var _0x349727=[];if(_0x40faaf&&_0x40faaf['length']>0x0){_0x349727=_[_0x54f0('0x30')](_0x40faaf,_0x296fea);}return _0x349727;}function getCustomFields(_0x2b910a,_0x288e4f){var _0x2f2195=[];var _0x50fa48={'custom_fields':[]};if(_0x2b910a['length']>0x0){_[_0x54f0('0x31')](_0x2b910a,function(_0x43142d){if(_['includes']([_0x54f0('0x32'),_0x54f0('0x33')],_0x43142d[_0x54f0('0x34')])&&_0x43142d[_0x54f0('0x35')]&&!_0x43142d[_0x54f0('0x36')]){_0x50fa48[_0x43142d[_0x54f0('0x35')]['toLowerCase']()]=_0x43142d[_0x54f0('0x37')][_0x54f0('0x2d')]();}else if(_[_0x54f0('0x38')]([_0x54f0('0x32'),_0x54f0('0x33')],_0x43142d[_0x54f0('0x34')])&&_0x43142d[_0x54f0('0x39')]&&_0x43142d[_0x54f0('0x36')]){_0x50fa48[_0x54f0('0x18')][_0x54f0('0x3a')]({'id':_0x43142d[_0x54f0('0x39')],'value':_0x43142d[_0x54f0('0x37')][_0x54f0('0x2d')]()});}else if(_0x43142d['type']==='variable'&&_0x43142d[_0x54f0('0x3b')]&&_0x43142d['idField']&&_0x43142d[_0x54f0('0x36')]){_0x288e4f[_0x43142d['variableName']]&&_0x50fa48['custom_fields'][_0x54f0('0x3a')]({'id':_0x43142d[_0x54f0('0x39')],'value':_0x288e4f[_0x43142d['variableName']][_0x54f0('0x2d')]()});}else if(_0x43142d[_0x54f0('0x34')]==='customVariable'&&_0x43142d[_0x54f0('0x3c')]&&_0x43142d['Variable'][_0x54f0('0x16')]&&_0x43142d[_0x54f0('0x39')]&&_0x43142d[_0x54f0('0x36')]){_0x288e4f[_0x43142d[_0x54f0('0x3c')]['name'][_0x54f0('0x3d')]()]&&_0x50fa48[_0x54f0('0x18')]['push']({'id':_0x43142d[_0x54f0('0x39')],'value':_0x288e4f[_0x43142d[_0x54f0('0x3c')][_0x54f0('0x16')][_0x54f0('0x3d')]()][_0x54f0('0x2d')]()});}});}return _0x50fa48;}exports[_0x54f0('0x3e')]=function(_0x45dcfe,_0x39e2ad,_0x354116,_0x4537e6,_0x329a0b,_0x138917){var _0x5ea51f,_0x4616d3;_0x138917['remoteUri']=intUtil[_0x54f0('0x3f')](_0x138917['remoteUri']);_0x138917[_0x54f0('0x40')]=intUtil['stripTrailingSlash'](_0x138917[_0x54f0('0x40')]);if(_0x329a0b&&_0x329a0b[_0x54f0('0x41')]){logger[_0x54f0('0x1d')](_0x54f0('0x42'),_0x54f0('0x43'));_0x39e2ad['recordingURL']=util[_0x54f0('0x10')](_0x54f0('0x44'),_0x138917[_0x54f0('0x40')],_0x39e2ad['uniqueid'],md5(_0x39e2ad[_0x54f0('0x45')]));}else{_0x39e2ad[_0x54f0('0x46')]='';}headers[_0x54f0('0x47')]=getAuth(_0x138917);return getUser(_0x138917,_0x4537e6[_0x54f0('0x48')])[_0x54f0('0x1c')](function(_0x131723){_0x5ea51f=_0x131723;logger[_0x54f0('0x1d')](_0x54f0('0x49'),_0x5ea51f['id']);return getEndUser(_0x138917,_0x39e2ad[_0x54f0('0x4a')],_0x39e2ad['calleridnum']);})['then'](function(_0x1c6d56){_0x4616d3=_0x1c6d56;logger[_0x54f0('0x1d')]('The\x20Enduser\x20ID\x20is:',_0x4616d3['id']);return getTicket(_0x138917,_0x5ea51f,_0x4616d3,_0x354116,_0x39e2ad);})['then'](function(_0x419033){if(_0x419033&&_0x419033['id']){logger[_0x54f0('0x1d')](_0x54f0('0x1e'));logger[_0x54f0('0x1d')](_0x54f0('0x4b'),_0x419033['id']);logger[_0x54f0('0x1d')](_0x54f0('0x42'),_0x54f0('0x4c'));emit(util[_0x54f0('0x10')]('user:%s',_0x4537e6['name']),_0x54f0('0x4d'),{'uri':util[_0x54f0('0x10')]('%s/helpdesk/tickets/%d',_0x138917[_0x54f0('0x1f')],_0x419033['id'])});}})[_0x54f0('0x4e')](function(_0x5efa4e){logger[_0x54f0('0x4f')](_0x54f0('0x42'),JSON[_0x54f0('0x2e')](_0x5efa4e));});};exports[_0x54f0('0x50')]=function(_0x2ada45,_0x578719,_0x42e669,_0x200e4e,_0xd3c90f,_0x5dc30f,_0x303fc8){var _0x4caf74,_0x5d0169;_0x5dc30f[_0x54f0('0x1f')]=intUtil[_0x54f0('0x3f')](_0x5dc30f[_0x54f0('0x1f')]);_0x5dc30f[_0x54f0('0x40')]=intUtil[_0x54f0('0x3f')](_0x5dc30f[_0x54f0('0x40')]);if(_0x303fc8&&_0x303fc8[_0x54f0('0x51')]&&_0x303fc8[_0x54f0('0x51')]!==_0x54f0('0x52')){logger['info'](_0x54f0('0x53'),'Recording\x20is\x20enabled!');_0x578719[_0x54f0('0x46')]=util[_0x54f0('0x10')](_0x54f0('0x44'),_0x5dc30f['serverUrl'],_0x578719[_0x54f0('0x45')],md5(_0x578719[_0x54f0('0x45')]));}headers[_0x54f0('0x47')]=getAuth(_0x5dc30f);return getUser(_0x5dc30f,_0x200e4e['email'])['then'](function(_0x3b9744){_0x4caf74=_0x3b9744;logger[_0x54f0('0x1d')](_0x54f0('0x49'),_0x4caf74['id']);return getEndUser(_0x5dc30f,_0x578719[_0x54f0('0x54')],_0x578719['destcalleridnum']);})[_0x54f0('0x1c')](function(_0x23e3c7){_0x5d0169=_0x23e3c7;logger['info'](_0x54f0('0x55'),_0x5d0169['id']);return getTicket(_0x5dc30f,_0x4caf74,_0x5d0169,_0x42e669,_0x578719);})[_0x54f0('0x1c')](function(_0x3cdb71){if(_0x3cdb71&&_0x3cdb71['id']){logger['info'](_0x54f0('0x1e'));logger[_0x54f0('0x1d')](_0x54f0('0x4b'),_0x3cdb71['id']);logger[_0x54f0('0x1d')](_0x54f0('0x53'),_0x54f0('0x4c'));emit(util[_0x54f0('0x10')](_0x54f0('0x56'),_0x200e4e[_0x54f0('0x16')]),_0x54f0('0x4d'),{'uri':util[_0x54f0('0x10')](_0x54f0('0x57'),_0x5dc30f[_0x54f0('0x1f')],_0x3cdb71['id'])});}})[_0x54f0('0x4e')](function(_0x55060a){logger[_0x54f0('0x4f')](_0x54f0('0x53'),JSON[_0x54f0('0x2e')](_0x55060a));});};exports[_0x54f0('0x58')]=function(_0x4ef264,_0x25d3ca,_0x4d2d0e,_0xfe0b91,_0x301d56,_0x19fa65){var _0x26c037,_0x48f19f;_0x19fa65[_0x54f0('0x1f')]=intUtil[_0x54f0('0x3f')](_0x19fa65[_0x54f0('0x1f')]);_0x19fa65['serverUrl']=intUtil['stripTrailingSlash'](_0x19fa65['serverUrl']);if(_0x301d56&&_0x301d56[_0x54f0('0x41')]){logger['info']('['+_0x25d3ca[_0x54f0('0x59')][_0x54f0('0x5a')]()+']',_0x54f0('0x43'));_0x25d3ca['recordingURL']=util[_0x54f0('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x19fa65[_0x54f0('0x40')],_0x25d3ca[_0x54f0('0x45')],md5(_0x25d3ca[_0x54f0('0x45')]));}else{_0x25d3ca[_0x54f0('0x46')]='';}headers['Authorization']=getAuth(_0x19fa65);return getUser(_0x19fa65,'')[_0x54f0('0x1c')](function(_0x26bbe2){_0x26c037=_0x26bbe2;logger[_0x54f0('0x1d')](_0x54f0('0x49'),_0x26c037['id']);return getEndUser(_0x19fa65,_0x25d3ca[_0x54f0('0x4a')],_0x25d3ca[_0x54f0('0x5b')]);})[_0x54f0('0x1c')](function(_0x3effc4){_0x48f19f=_0x3effc4;logger[_0x54f0('0x1d')](_0x54f0('0x55'),_0x48f19f['id']);return getTicket(_0x19fa65,_0x26c037,_0x48f19f,_0x4d2d0e,_0x25d3ca);})[_0x54f0('0x1c')](function(_0x4e505e){if(_0x4e505e){logger['info'](_0x54f0('0x1e'));logger[_0x54f0('0x1d')](_0x54f0('0x4b'),_0x4e505e['id']);}})[_0x54f0('0x4e')](function(_0xe9e36a){logger['error']('['+_0x25d3ca['lastevent'][_0x54f0('0x5a')]()+']',JSON['stringify'](_0xe9e36a));});}; \ No newline at end of file +var _0xd5ce=['error','outbound','recordingFormat','none','[OUTBOUND]','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','Tags','name','mapValues','custom_fields','value','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','format','%s/api/v2/agents','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','apiKey','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','customField','toLowerCase','content','toString','idField','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0xd5ce,0x181));var _0xed5c=function(_0x216e72,_0x5cd161){_0x216e72=_0x216e72-0x0;var _0x2ff28d=_0xd5ce[_0x216e72];return _0x2ff28d;};'use strict';var _=require(_0xed5c('0x0'));var rp=require(_0xed5c('0x1'));var md5=require(_0xed5c('0x2'));var util=require(_0xed5c('0x3'));var Redis=require('ioredis');var intUtil=require(_0xed5c('0x4'));var config=require(_0xed5c('0x5'));var logger=require('../../../../config/logger')(_0xed5c('0x6'));config[_0xed5c('0x7')]=_[_0xed5c('0x8')](config['redis'],{'host':_0xed5c('0x9'),'port':0x18eb});var io=require(_0xed5c('0xa'))(new Redis(config[_0xed5c('0x7')]));var headers={'Content-Type':_0xed5c('0xb'),'Accept':_0xed5c('0xb')};function emit(_0x4d4afa,_0x569099,_0x1dccb0){io['to'](_0x4d4afa)[_0xed5c('0xc')](_0x569099,_0x1dccb0);}function getTicket(_0x120e60,_0x20cbf7,_0x5112d9,_0x13d907,_0x888446){logger['info'](_0xed5c('0xd'));var _0x44d377=_[_0xed5c('0xe')]({'responder_id':_0x20cbf7['id'],'requester_id':_0x5112d9['id'],'name':util['format'](_0xed5c('0xf'),_0x888446[_0xed5c('0x10')]),'phone':_0x888446[_0xed5c('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x13d907[_0xed5c('0x12')],_0x888446,'\x20'),'description':intUtil[_0xed5c('0x13')](_0x13d907[_0xed5c('0x14')],_0x888446,'
'),'tags':getTags(_0x13d907[_0xed5c('0x15')],_0xed5c('0x16'))},getCustomFields(_0x13d907['Fields'],_0x888446));_0x44d377['custom_fields']=_[_0xed5c('0x17')](_['keyBy'](_0x44d377[_0xed5c('0x18')],'id'),_0xed5c('0x19'));return request({'uri':util['format']('%s/api/v2/tickets',_0x120e60[_0xed5c('0x1a')]),'method':_0xed5c('0x1b'),'body':_0x44d377})[_0xed5c('0x1c')](function(_0x5e5432){logger[_0xed5c('0x1d')](_0xed5c('0x1e'));return _0x5e5432;});}function getUser(_0x4f5e74,_0x4cf1a2){if(intUtil[_0xed5c('0x1f')](_0x4cf1a2)){return request({'uri':util[_0xed5c('0x20')](_0xed5c('0x21'),_0x4f5e74['remoteUri']),'qs':{'email':_0x4cf1a2}})[_0xed5c('0x1c')](function(_0xf5b080){if(_0xf5b080[_0xed5c('0x22')]){logger[_0xed5c('0x1d')]('Agent\x20found!');return _[_0xed5c('0x23')](_0xf5b080,function(_0x28cbda){return _0x28cbda[_0xed5c('0x24')][_0xed5c('0x25')]===_0x4cf1a2;});}else{logger[_0xed5c('0x1d')](_0xed5c('0x26'));return request({'uri':util[_0xed5c('0x20')]('%s/api/v2/agents/me',_0x4f5e74[_0xed5c('0x1a')])})['then'](function(_0x569527){logger[_0xed5c('0x1d')]('Admin\x20account\x20selected.');return _0x569527;});}});}else{logger[_0xed5c('0x1d')](_0xed5c('0x27'));return request({'uri':util[_0xed5c('0x20')](_0xed5c('0x28'),_0x4f5e74['remoteUri'])})[_0xed5c('0x1c')](function(_0xc37910){logger[_0xed5c('0x1d')](_0xed5c('0x29'));return _0xc37910;});}}function getEndUser(_0x1aee38,_0x5787d9,_0xe52d0f){logger[_0xed5c('0x1d')](_0xed5c('0x2a'),_0xe52d0f);return request({'uri':util[_0xed5c('0x20')]('%s/api/v2/contacts',_0x1aee38[_0xed5c('0x1a')]),'qs':{'phone':_0xe52d0f}})[_0xed5c('0x1c')](function(_0x51d712){if(_0x51d712[_0xed5c('0x22')]){logger[_0xed5c('0x1d')](_0xed5c('0x2b'));return _[_0xed5c('0x23')](_0x51d712,{'phone':_0xe52d0f});}else{logger[_0xed5c('0x1d')](_0xed5c('0x2c'));return request({'uri':util['format'](_0xed5c('0x2d'),_0x1aee38[_0xed5c('0x1a')]),'method':_0xed5c('0x1b'),'body':{'name':_0x5787d9,'phone':_0xe52d0f}})[_0xed5c('0x1c')](function(_0x4a8b75){logger['info'](_0xed5c('0x2e'));return _0x4a8b75;});}});}function getAuth(_0xd1f0da){return util[_0xed5c('0x20')]('Basic\x20%s',new Buffer(_0xd1f0da[_0xed5c('0x2f')]+':X')['toString'](_0xed5c('0x30')));}function request(_0x120768){logger[_0xed5c('0x31')](_0xed5c('0x32'),JSON[_0xed5c('0x33')](_0x120768));return rp(_[_0xed5c('0x8')](_0x120768,{'method':_0xed5c('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x470526,_0x2c77b7){var _0xdb64f5=[];if(_0x470526&&_0x470526[_0xed5c('0x22')]>0x0){_0xdb64f5=_[_0xed5c('0x35')](_0x470526,_0x2c77b7);}return _0xdb64f5;}function getCustomFields(_0x2391fb,_0x265ceb){var _0x14d1d0=[];var _0x55865f={'custom_fields':[]};if(_0x2391fb[_0xed5c('0x22')]>0x0){_[_0xed5c('0x36')](_0x2391fb,function(_0x3962cc){if(_[_0xed5c('0x37')]([_0xed5c('0x38'),_0xed5c('0x39')],_0x3962cc[_0xed5c('0x3a')])&&_0x3962cc['nameField']&&!_0x3962cc[_0xed5c('0x3b')]){_0x55865f[_0x3962cc['nameField'][_0xed5c('0x3c')]()]=_0x3962cc[_0xed5c('0x3d')][_0xed5c('0x3e')]();}else if(_['includes']([_0xed5c('0x38'),_0xed5c('0x39')],_0x3962cc[_0xed5c('0x3a')])&&_0x3962cc['idField']&&_0x3962cc[_0xed5c('0x3b')]){_0x55865f[_0xed5c('0x18')]['push']({'id':_0x3962cc[_0xed5c('0x3f')],'value':_0x3962cc[_0xed5c('0x3d')][_0xed5c('0x3e')]()});}else if(_0x3962cc[_0xed5c('0x3a')]===_0xed5c('0x40')&&_0x3962cc[_0xed5c('0x41')]&&_0x3962cc['idField']&&_0x3962cc[_0xed5c('0x3b')]){_0x265ceb[_0x3962cc['variableName']]&&_0x55865f[_0xed5c('0x18')][_0xed5c('0x42')]({'id':_0x3962cc[_0xed5c('0x3f')],'value':_0x265ceb[_0x3962cc['variableName']][_0xed5c('0x3e')]()});}else if(_0x3962cc[_0xed5c('0x3a')]===_0xed5c('0x43')&&_0x3962cc[_0xed5c('0x44')]&&_0x3962cc[_0xed5c('0x44')][_0xed5c('0x16')]&&_0x3962cc['idField']&&_0x3962cc[_0xed5c('0x3b')]){_0x265ceb[_0x3962cc['Variable'][_0xed5c('0x16')]['toLowerCase']()]&&_0x55865f[_0xed5c('0x18')][_0xed5c('0x42')]({'id':_0x3962cc[_0xed5c('0x3f')],'value':_0x265ceb[_0x3962cc[_0xed5c('0x44')][_0xed5c('0x16')][_0xed5c('0x3c')]()][_0xed5c('0x3e')]()});}});}return _0x55865f;}exports[_0xed5c('0x45')]=function(_0x4c552d,_0x97fae2,_0x158ec8,_0x1004b9,_0x28f154,_0x473fd3){var _0x9b78ee,_0x1f9271;_0x473fd3[_0xed5c('0x1a')]=intUtil[_0xed5c('0x46')](_0x473fd3[_0xed5c('0x1a')]);_0x473fd3[_0xed5c('0x47')]=intUtil['stripTrailingSlash'](_0x473fd3[_0xed5c('0x47')]);if(_0x28f154&&_0x28f154[_0xed5c('0x48')]){logger['info'](_0xed5c('0x49'),_0xed5c('0x4a'));_0x97fae2['recordingURL']=util[_0xed5c('0x20')](_0xed5c('0x4b'),_0x473fd3[_0xed5c('0x47')],_0x97fae2[_0xed5c('0x4c')],md5(_0x97fae2[_0xed5c('0x4c')]));}else{_0x97fae2[_0xed5c('0x4d')]='';}headers[_0xed5c('0x4e')]=getAuth(_0x473fd3);return getUser(_0x473fd3,_0x1004b9['email'])[_0xed5c('0x1c')](function(_0x1abe56){_0x9b78ee=_0x1abe56;logger[_0xed5c('0x1d')](_0xed5c('0x4f'),_0x9b78ee['id']);return getEndUser(_0x473fd3,_0x97fae2['calleridname'],_0x97fae2[_0xed5c('0x11')]);})[_0xed5c('0x1c')](function(_0xb2b0e2){_0x1f9271=_0xb2b0e2;logger[_0xed5c('0x1d')](_0xed5c('0x50'),_0x1f9271['id']);return getTicket(_0x473fd3,_0x9b78ee,_0x1f9271,_0x158ec8,_0x97fae2);})[_0xed5c('0x1c')](function(_0x2bee40){if(_0x2bee40&&_0x2bee40['id']){logger['info'](_0xed5c('0x1e'));logger[_0xed5c('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x2bee40['id']);logger[_0xed5c('0x1d')](_0xed5c('0x49'),_0xed5c('0x51'));emit(util['format']('user:%s',_0x1004b9[_0xed5c('0x16')]),_0xed5c('0x52'),{'uri':util[_0xed5c('0x20')](_0xed5c('0x53'),_0x473fd3[_0xed5c('0x1a')],_0x2bee40['id'])});}})[_0xed5c('0x54')](function(_0x5dce64){logger[_0xed5c('0x55')](_0xed5c('0x49'),JSON[_0xed5c('0x33')](_0x5dce64));});};exports[_0xed5c('0x56')]=function(_0x2a2d5d,_0x413fe1,_0x209997,_0x3af095,_0x1aab46,_0x41b1bf,_0x334aa1){var _0x32633d,_0x961b86;_0x41b1bf[_0xed5c('0x1a')]=intUtil[_0xed5c('0x46')](_0x41b1bf[_0xed5c('0x1a')]);_0x41b1bf[_0xed5c('0x47')]=intUtil['stripTrailingSlash'](_0x41b1bf[_0xed5c('0x47')]);if(_0x334aa1&&_0x334aa1[_0xed5c('0x57')]&&_0x334aa1[_0xed5c('0x57')]!==_0xed5c('0x58')){logger[_0xed5c('0x1d')](_0xed5c('0x59'),_0xed5c('0x4a'));_0x413fe1[_0xed5c('0x4d')]=util[_0xed5c('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x41b1bf[_0xed5c('0x47')],_0x413fe1[_0xed5c('0x4c')],md5(_0x413fe1[_0xed5c('0x4c')]));}headers[_0xed5c('0x4e')]=getAuth(_0x41b1bf);return getUser(_0x41b1bf,_0x3af095[_0xed5c('0x25')])[_0xed5c('0x1c')](function(_0x42db9a){_0x32633d=_0x42db9a;logger[_0xed5c('0x1d')](_0xed5c('0x4f'),_0x32633d['id']);return getEndUser(_0x41b1bf,_0x413fe1['destcalleridname'],_0x413fe1['destcalleridnum']);})[_0xed5c('0x1c')](function(_0x2ee3bc){_0x961b86=_0x2ee3bc;logger[_0xed5c('0x1d')](_0xed5c('0x50'),_0x961b86['id']);return getTicket(_0x41b1bf,_0x32633d,_0x961b86,_0x209997,_0x413fe1);})[_0xed5c('0x1c')](function(_0x1067e0){if(_0x1067e0&&_0x1067e0['id']){logger[_0xed5c('0x1d')]('Ticket\x20created!');logger[_0xed5c('0x1d')](_0xed5c('0x5a'),_0x1067e0['id']);logger[_0xed5c('0x1d')](_0xed5c('0x59'),_0xed5c('0x51'));emit(util[_0xed5c('0x20')]('user:%s',_0x3af095[_0xed5c('0x16')]),_0xed5c('0x52'),{'uri':util[_0xed5c('0x20')](_0xed5c('0x53'),_0x41b1bf[_0xed5c('0x1a')],_0x1067e0['id'])});}})[_0xed5c('0x54')](function(_0x2238ac){logger[_0xed5c('0x55')](_0xed5c('0x59'),JSON['stringify'](_0x2238ac));});};exports[_0xed5c('0x5b')]=function(_0xf67239,_0x122b2f,_0x414ae4,_0x452dc4,_0x3e75db,_0x190186){var _0x389103,_0x54761d;_0x190186[_0xed5c('0x1a')]=intUtil[_0xed5c('0x46')](_0x190186[_0xed5c('0x1a')]);_0x190186[_0xed5c('0x47')]=intUtil[_0xed5c('0x46')](_0x190186[_0xed5c('0x47')]);if(_0x3e75db&&_0x3e75db[_0xed5c('0x48')]){logger[_0xed5c('0x1d')]('['+_0x122b2f[_0xed5c('0x5c')][_0xed5c('0x5d')]()+']',_0xed5c('0x4a'));_0x122b2f['recordingURL']=util[_0xed5c('0x20')](_0xed5c('0x4b'),_0x190186[_0xed5c('0x47')],_0x122b2f[_0xed5c('0x4c')],md5(_0x122b2f['uniqueid']));}else{_0x122b2f['recordingURL']='';}headers[_0xed5c('0x4e')]=getAuth(_0x190186);return getUser(_0x190186,'')[_0xed5c('0x1c')](function(_0x92ca86){_0x389103=_0x92ca86;logger['info']('The\x20User\x20ID\x20is:',_0x389103['id']);return getEndUser(_0x190186,_0x122b2f[_0xed5c('0x10')],_0x122b2f['calleridnum']);})[_0xed5c('0x1c')](function(_0x1c0df9){_0x54761d=_0x1c0df9;logger['info'](_0xed5c('0x50'),_0x54761d['id']);return getTicket(_0x190186,_0x389103,_0x54761d,_0x414ae4,_0x122b2f);})[_0xed5c('0x1c')](function(_0x34017e){if(_0x34017e){logger[_0xed5c('0x1d')](_0xed5c('0x1e'));logger[_0xed5c('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x34017e['id']);}})[_0xed5c('0x54')](function(_0x25db93){logger[_0xed5c('0x55')]('['+_0x122b2f[_0xed5c('0x5c')][_0xed5c('0x5d')]()+']',JSON[_0xed5c('0x33')](_0x25db93));});}; \ 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 1e09ca0..3c64bf1 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 _0xa81d=['userId','User\x20found:','Admin\x20selected','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20created:','POST','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','toUpperCase','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','callDirection','queue','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','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','lodash','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','message','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail'];(function(_0x2d819b,_0x321af5){var _0x3799fd=function(_0x50090b){while(--_0x50090b){_0x2d819b['push'](_0x2d819b['shift']());}};_0x3799fd(++_0x321af5);}(_0xa81d,0x1eb));var _0xda81=function(_0x453036,_0x521770){_0x453036=_0x453036-0x0;var _0x203aa2=_0xa81d[_0x453036];return _0x203aa2;};'use strict';var _=require(_0xda81('0x0'));var rp=require('request-promise');var md5=require(_0xda81('0x1'));var util=require(_0xda81('0x2'));var moment=require(_0xda81('0x3'));var Promise=require(_0xda81('0x4'));var Redis=require(_0xda81('0x5'));var intUtil=require(_0xda81('0x6'));var config=require(_0xda81('0x7'));var logger=require('../../../../config/logger')(_0xda81('0x8'));config[_0xda81('0x9')]=_[_0xda81('0xa')](config['redis'],{'host':_0xda81('0xb'),'port':0x18eb});var io=require(_0xda81('0xc'))(new Redis(config[_0xda81('0x9')]));function getAdminId(_0x4ecf7f,_0x203231,_0x3d8ce6,_0x6821b4){return new Promise(function(_0x2e59aa,_0x2d066f){var _0x2efdb7=![];var _0x555d69={'method':_0xda81('0xd'),'uri':_0x6821b4+_0xda81('0xe'),'json':!![]};_0x555d69['headers']=_0x3d8ce6;logger[_0xda81('0xf')](_0xda81('0x10'));return rp(_0x555d69)[_0xda81('0x11')](function(_0x1d7d8e){if(_0x1d7d8e){var _0xc8da72=_0x1d7d8e[_0xda81('0x12')];var _0x63b395=null;for(_0x63b395=0x0;_0x63b395<_0xc8da72[_0xda81('0x13')];_0x63b395++){if(_0xc8da72[_0x63b395]['email']===_0x4ecf7f[_0xda81('0x14')]){_0x4ecf7f[_0xda81('0x15')]=_0xc8da72[_0x63b395]['id'];_0x2efdb7=!![];}}if(_0x2efdb7){logger[_0xda81('0xf')](_0xda81('0x16'),_0x4ecf7f[_0xda81('0x15')]);_0x2e59aa(_0x4ecf7f);}else{_0x2d066f({'statusCode':0x194,'message':_0xda81('0x17')});}}else{_0x2d066f({'statusCode':0x194,'message':_0xda81('0x17')});}})[_0xda81('0x18')](function(_0x138e58){logger['error']('['+[_0x203231['toUpperCase']()]+']',_0x138e58[_0xda81('0x19')]);_0x2d066f(_0x138e58);});});}function getUser(_0x1086a3,_0x173b7e,_0x4ad25c){return function(_0xe2f20c){return new Promise(function(_0x47f952,_0x4bf864){var _0x59ce69={'method':_0xda81('0xd'),'uri':_0x4ad25c+_0xda81('0xe'),'json':!![]};_0x59ce69[_0xda81('0x1a')]=_0x173b7e;logger['info'](_0xda81('0x1b'));return rp(_0x59ce69)['then'](function(_0x1c91b7){if(_0x1c91b7){var _0x36938a=_0x1c91b7['users'];var _0x4e71ff=![];var _0x3753eb=null;if(_0xe2f20c[_0xda81('0x1c')]!==null){logger[_0xda81('0xf')](_0xda81('0x1d'),_0xe2f20c['agentEmail']);_0xe2f20c[_0xda81('0x1e')]=_0xe2f20c[_0xda81('0x1c')];for(_0x3753eb=0x0;_0x3753eb<_0x36938a[_0xda81('0x13')];_0x3753eb++){if(_0x36938a[_0x3753eb]['email']===_0xe2f20c[_0xda81('0x1c')]){_0x4e71ff=!![];_0xe2f20c[_0xda81('0x1f')]=_0x36938a[_0x3753eb]['id'];logger[_0xda81('0xf')](_0xda81('0x20'),_0xe2f20c[_0xda81('0x1f')]);}}}if(!_0x4e71ff){logger[_0xda81('0xf')](_0xda81('0x21'));_0xe2f20c[_0xda81('0x1e')]=_0xe2f20c[_0xda81('0x14')];_0xe2f20c['userId']=_0xe2f20c[_0xda81('0x15')];_0x4e71ff=!![];}if(_0x4e71ff){_0x47f952(_0xe2f20c);}else{_0x4bf864({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4bf864({'statusCode':0x194,'message':_0xda81('0x17')});}})[_0xda81('0x18')](function(_0x1516db){logger[_0xda81('0x22')]('['+[_0x1086a3['toUpperCase']()]+']',_0x1516db[_0xda81('0x19')]);_0x4bf864(_0x1516db);});});};}function searchContact(_0x1a8d8c,_0x323c11,_0x22abef,_0x353bd6){return new Promise(function(_0x1a6671,_0x36b370){var _0xee518f={'method':_0xda81('0xd'),'headers':_0x323c11,'uri':_0x1a8d8c+_0xda81('0x23')+_0x353bd6+_0xda81('0x24')+_0x22abef+_0xda81('0x25'),'json':!![]};rp(_0xee518f)[_0xda81('0x11')](function(_0xec2bb0){var _0x3a6b2f=_[_0xda81('0x26')](_0xec2bb0['contacts'][_0xda81('0x27')],[_0x22abef,_0x353bd6]);_0x1a6671(_0x3a6b2f);})[_0xda81('0x18')](function(_0x170cb9){_0x36b370(_0x170cb9);});});}function getEndUser(_0x39277d,_0x5afada,_0x551264){return function(_0x2d4e42){return new Promise(function(_0x3424ef,_0x4efe3e){logger['info'](util[_0xda81('0x28')](_0xda81('0x29'),_0x2d4e42['contactNumber']));searchContact(_0x551264,_0x5afada,_0xda81('0x2a'),_0x2d4e42[_0xda81('0x2b')])[_0xda81('0x11')](function(_0x309068){if(_0x309068){_0x2d4e42[_0xda81('0x2c')]=_0x309068['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x2d4e42[_0xda81('0x2c')]);return _0x3424ef(_0x2d4e42);}searchContact(_0x551264,_0x5afada,'work_number',_0x2d4e42[_0xda81('0x2b')])[_0xda81('0x11')](function(_0x4547a3){if(_0x4547a3){_0x2d4e42['endUserId']=_0x4547a3['id'];logger[_0xda81('0xf')]('Contact\x20found\x20work_number:',_0x2d4e42[_0xda81('0x2c')]);return _0x3424ef(_0x2d4e42);}createEndUser(_0x2d4e42,_0x39277d,_0x5afada,_0x551264)[_0xda81('0x11')](function(_0x42aaaa){logger['info'](_0xda81('0x2d'),_0x42aaaa[_0xda81('0x2c')]);return _0x3424ef(_0x42aaaa);});});})[_0xda81('0x18')](function(_0x3618bd){_0x4efe3e(_0x3618bd);});});};}function createEndUser(_0x5e142a,_0x345a17,_0x24b204,_0x3bded9){return new Promise(function(_0x5c3244,_0x292d0d){var _0xb0e81d=moment();var _0x510ee9={'method':_0xda81('0x2e'),'uri':_0x3bded9+'/api/contacts','body':{'contact':{'last_name':_0x5e142a[_0xda81('0x2b')],'work_number':_0x5e142a[_0xda81('0x2b')],'mobile_number':_0x5e142a[_0xda81('0x2b')],'owner_id':_0x5e142a['userId'],'created_at':_0xb0e81d[_0xda81('0x28')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x510ee9[_0xda81('0x1a')]=_0x24b204;logger[_0xda81('0xf')](_0xda81('0x2f'));return rp(_0x510ee9)[_0xda81('0x11')](function(_0x59f81f){_0x5e142a[_0xda81('0x2c')]=_0x59f81f[_0xda81('0x30')]['id'];_0x5c3244(_0x5e142a);})[_0xda81('0x18')](function(_0x26a9fe){logger[_0xda81('0x22')]('['+[_0x345a17[_0xda81('0x31')]()]+']',_0x26a9fe[_0xda81('0x19')]);_0x292d0d(_0x26a9fe[_0xda81('0x19')]);});});}function getTicket(_0x1cc19f,_0x5aca8e,_0x2ecc17,_0x1847ac,_0x94b2e5){return function(_0x4711f1){logger[_0xda81('0xf')](_0xda81('0x32'));return new Promise(function(_0x3909da,_0x136f7f){var _0x2dd2c1=moment();var _0x39073e={'method':_0xda81('0x2e'),'uri':_0x2ecc17+'/api/tasks','body':{'title':intUtil[_0xda81('0x33')](_0x1847ac[_0xda81('0x34')],_0x94b2e5,'\x20'),'description':intUtil[_0xda81('0x33')](_0x1847ac[_0xda81('0x35')],_0x94b2e5,'\x0a'),'owner_id':_0x4711f1[_0xda81('0x1f')],'creater_id':_0x4711f1['adminId'],'targetable_id':_0x4711f1[_0xda81('0x2c')],'targetable_type':_0xda81('0x36'),'created_at':_0x2dd2c1['format'](_0xda81('0x37')),'due_date':_0x2dd2c1['add'](0x1e,'m')['format'](_0xda81('0x37'))},'json':!![]};_0x39073e['headers']=_0x5aca8e;return rp(_0x39073e)[_0xda81('0x11')](function(_0x50c65f){_0x4711f1[_0xda81('0x38')]=_0x50c65f[_0xda81('0x39')]['id'];logger['info'](_0xda81('0x3a'),_0x4711f1[_0xda81('0x38')]);_0x3909da(_0x4711f1);})[_0xda81('0x18')](function(_0xbddbd2){logger[_0xda81('0x22')]('['+[_0x1cc19f['toUpperCase']()]+']',_0xbddbd2[_0xda81('0x19')]);_0x136f7f(_0xbddbd2[_0xda81('0x19')]);});});};}function emit(_0x5b13fb,_0x34d06d,_0x3a9606){var _0xd84f1b={'uri':_0x5b13fb+'/contacts/'+_0x3a9606};io['to'](util[_0xda81('0x28')](_0xda81('0x3b'),_0x34d06d))[_0xda81('0x3c')](_0xda81('0x3d'),_0xd84f1b);}exports['cs']=function(_0x369017,_0x2f1c46,_0x5b3874,_0x3151ee,_0x36fe47,_0x4690ed,_0x49b3f0,_0x2d9a89){var _0x50d8db={};var _0x30f595={'Authorization':_0xda81('0x3e')+_0x4690ed[_0xda81('0x3f')]};_0x4690ed[_0xda81('0x40')]=intUtil[_0xda81('0x41')](_0x4690ed[_0xda81('0x40')]);_0x4690ed[_0xda81('0x42')]=intUtil[_0xda81('0x41')](_0x4690ed[_0xda81('0x42')]);var _0x87abc1=_0x4690ed['remoteUri'];_0x50d8db[_0xda81('0x14')]=_0x4690ed['username'];_0x50d8db[_0xda81('0x2b')]=_0x2d9a89[_0xda81('0x43')]()===_0xda81('0x44')?_0x2f1c46[_0xda81('0x45')]:_0x2f1c46['calleridnum'];_0x50d8db[_0xda81('0x46')]=_0x2d9a89===_0xda81('0x47')||_0x2d9a89==='unmanaged'?'queue':'outbound';if(_0x3151ee){_0x50d8db[_0xda81('0x1c')]=_0x3151ee[_0xda81('0x48')];}var _0x195d0d=util[_0xda81('0x28')](_0xda81('0x49'),_0x4690ed[_0xda81('0x42')],_0x2f1c46['uniqueid'],md5(_0x2f1c46['uniqueid']));if(_0x36fe47&&_0x36fe47[_0xda81('0x4a')]){logger[_0xda81('0xf')](_0xda81('0x4b'),_0xda81('0x4c'));_0x2f1c46[_0xda81('0x4d')]=_0x195d0d;}else if(_0x49b3f0&&_0x49b3f0[_0xda81('0x4e')]&&_0x49b3f0[_0xda81('0x4e')]!==_0xda81('0x4f')){logger[_0xda81('0xf')](_0xda81('0x50'),_0xda81('0x4c'));_0x2f1c46[_0xda81('0x4d')]=_0x195d0d;}else{_0x2f1c46[_0xda81('0x4d')]='';}return getAdminId(_0x50d8db,_0x2d9a89,_0x30f595,_0x87abc1)['then'](getUser(_0x2d9a89,_0x30f595,_0x87abc1))[_0xda81('0x11')](getEndUser(_0x2d9a89,_0x30f595,_0x87abc1))['then'](getTicket(_0x2d9a89,_0x30f595,_0x87abc1,_0x5b3874,_0x2f1c46))[_0xda81('0x11')](function(_0x5d9c4f){logger['info'](util[_0xda81('0x28')](_0xda81('0x51'),_0x5d9c4f[_0xda81('0x38')]));if(_0x2d9a89!==_0xda81('0x52')){logger[_0xda81('0xf')]('['+[_0x2d9a89[_0xda81('0x31')]()]+']',_0xda81('0x53'));emit(_0x87abc1,_0x3151ee[_0xda81('0x54')],_0x5d9c4f[_0xda81('0x2c')]);}})[_0xda81('0x18')](function(_0x222e81){logger[_0xda81('0x22')]('['+[_0x2d9a89[_0xda81('0x31')]()]+_0xda81('0x55'),util[_0xda81('0x56')](_0x222e81,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x38c9=['Task\x20created:','trigger:browser:url','Token\x20token=','apiKey','serverUrl','stripTrailingSlash','remoteUri','toLowerCase','destcalleridnum','calleridnum','unmanaged','queue','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','name','inspect','lodash','request-promise','util','moment','bluebird','./util','../../../../config/environment','freshsales','defaults','redis','socket.io-emitter','GET','headers','info','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','then','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','getString','Subjects','Contact','add','ticketId','task'];(function(_0x3b0805,_0x6bda0){var _0x2f6ccb=function(_0x521bec){while(--_0x521bec){_0x3b0805['push'](_0x3b0805['shift']());}};_0x2f6ccb(++_0x6bda0);}(_0x38c9,0xf2));var _0x938c=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0x38c9[_0x544099];return _0x20ab09;};'use strict';var _=require(_0x938c('0x0'));var rp=require(_0x938c('0x1'));var md5=require('md5');var util=require(_0x938c('0x2'));var moment=require(_0x938c('0x3'));var Promise=require(_0x938c('0x4'));var Redis=require('ioredis');var intUtil=require(_0x938c('0x5'));var config=require(_0x938c('0x6'));var logger=require('../../../../config/logger')(_0x938c('0x7'));config['redis']=_[_0x938c('0x8')](config[_0x938c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x938c('0xa'))(new Redis(config[_0x938c('0x9')]));function getAdminId(_0xe8c0f5,_0x1bd305,_0xc8cecf,_0x58c8fd){return new Promise(function(_0x2b83f5,_0x11534b){var _0x42d87=![];var _0x3f0f77={'method':_0x938c('0xb'),'uri':_0x58c8fd+'/api/selector/owners','json':!![]};_0x3f0f77[_0x938c('0xc')]=_0xc8cecf;logger[_0x938c('0xd')]('Getting\x20admin\x20information');return rp(_0x3f0f77)['then'](function(_0xeede19){if(_0xeede19){var _0x46c571=_0xeede19['users'];var _0x205896=null;for(_0x205896=0x0;_0x205896<_0x46c571['length'];_0x205896++){if(_0x46c571[_0x205896][_0x938c('0xe')]===_0xe8c0f5[_0x938c('0xf')]){_0xe8c0f5['adminId']=_0x46c571[_0x205896]['id'];_0x42d87=!![];}}if(_0x42d87){logger['info']('Admin\x20found:',_0xe8c0f5[_0x938c('0x10')]);_0x2b83f5(_0xe8c0f5);}else{_0x11534b({'statusCode':0x194,'message':_0x938c('0x11')});}}else{_0x11534b({'statusCode':0x194,'message':_0x938c('0x11')});}})[_0x938c('0x12')](function(_0x39e8f9){logger[_0x938c('0x13')]('['+[_0x1bd305[_0x938c('0x14')]()]+']',_0x39e8f9[_0x938c('0x15')]);_0x11534b(_0x39e8f9);});});}function getUser(_0x55fb0c,_0x213161,_0x38e5e2){return function(_0x3706ab){return new Promise(function(_0x3a6a0d,_0x51e057){var _0x54bd1c={'method':_0x938c('0xb'),'uri':_0x38e5e2+'/api/selector/owners','json':!![]};_0x54bd1c[_0x938c('0xc')]=_0x213161;logger['info'](_0x938c('0x16'));return rp(_0x54bd1c)[_0x938c('0x17')](function(_0x4d5108){if(_0x4d5108){var _0x2aa3c4=_0x4d5108[_0x938c('0x18')];var _0x5f5ba5=![];var _0x3dedb9=null;if(_0x3706ab[_0x938c('0x19')]!==null){logger['info'](_0x938c('0x1a'),_0x3706ab[_0x938c('0x19')]);_0x3706ab[_0x938c('0x1b')]=_0x3706ab[_0x938c('0x19')];for(_0x3dedb9=0x0;_0x3dedb9<_0x2aa3c4['length'];_0x3dedb9++){if(_0x2aa3c4[_0x3dedb9]['email']===_0x3706ab[_0x938c('0x19')]){_0x5f5ba5=!![];_0x3706ab['userId']=_0x2aa3c4[_0x3dedb9]['id'];logger['info']('User\x20found:',_0x3706ab[_0x938c('0x1c')]);}}}if(!_0x5f5ba5){logger[_0x938c('0xd')]('Admin\x20selected');_0x3706ab[_0x938c('0x1b')]=_0x3706ab[_0x938c('0xf')];_0x3706ab['userId']=_0x3706ab[_0x938c('0x10')];_0x5f5ba5=!![];}if(_0x5f5ba5){_0x3a6a0d(_0x3706ab);}else{_0x51e057({'statusCode':0x194,'message':_0x938c('0x11')});}}else{_0x51e057({'statusCode':0x194,'message':_0x938c('0x11')});}})[_0x938c('0x12')](function(_0x5b2837){logger['error']('['+[_0x55fb0c['toUpperCase']()]+']',_0x5b2837['message']);_0x51e057(_0x5b2837);});});};}function searchContact(_0x2c5910,_0x2a2b5e,_0x3f85dc,_0x40aef1){return new Promise(function(_0x3a500e,_0x1026b8){var _0x348131={'method':_0x938c('0xb'),'headers':_0x2a2b5e,'uri':_0x2c5910+'/api/lookup?q='+_0x40aef1+_0x938c('0x1d')+_0x3f85dc+_0x938c('0x1e'),'json':!![]};rp(_0x348131)[_0x938c('0x17')](function(_0x56684f){var _0x595834=_['find'](_0x56684f[_0x938c('0x1f')][_0x938c('0x1f')],[_0x3f85dc,_0x40aef1]);_0x3a500e(_0x595834);})[_0x938c('0x12')](function(_0x3067c0){_0x1026b8(_0x3067c0);});});}function getEndUser(_0x361c56,_0x4e39ae,_0x231098){return function(_0x3dd594){return new Promise(function(_0x126dbd,_0x357436){logger[_0x938c('0xd')](util[_0x938c('0x20')](_0x938c('0x21'),_0x3dd594[_0x938c('0x22')]));searchContact(_0x231098,_0x4e39ae,_0x938c('0x23'),_0x3dd594[_0x938c('0x22')])[_0x938c('0x17')](function(_0x546b77){if(_0x546b77){_0x3dd594[_0x938c('0x24')]=_0x546b77['id'];logger[_0x938c('0xd')]('Contact\x20found\x20mobile_number:',_0x3dd594[_0x938c('0x24')]);return _0x126dbd(_0x3dd594);}searchContact(_0x231098,_0x4e39ae,'work_number',_0x3dd594[_0x938c('0x22')])['then'](function(_0x519e2f){if(_0x519e2f){_0x3dd594['endUserId']=_0x519e2f['id'];logger[_0x938c('0xd')](_0x938c('0x25'),_0x3dd594['endUserId']);return _0x126dbd(_0x3dd594);}createEndUser(_0x3dd594,_0x361c56,_0x4e39ae,_0x231098)[_0x938c('0x17')](function(_0x218b68){logger[_0x938c('0xd')](_0x938c('0x26'),_0x218b68[_0x938c('0x24')]);return _0x126dbd(_0x218b68);});});})['catch'](function(_0x118e5d){_0x357436(_0x118e5d);});});};}function createEndUser(_0x1bb47a,_0x39480e,_0x396d13,_0x36cee1){return new Promise(function(_0x4c923d,_0x4727a7){var _0x3dab19=moment();var _0x2f04cd={'method':_0x938c('0x27'),'uri':_0x36cee1+_0x938c('0x28'),'body':{'contact':{'last_name':_0x1bb47a[_0x938c('0x22')],'work_number':_0x1bb47a[_0x938c('0x22')],'mobile_number':_0x1bb47a[_0x938c('0x22')],'owner_id':_0x1bb47a[_0x938c('0x1c')],'created_at':_0x3dab19[_0x938c('0x20')](_0x938c('0x29'))}},'json':!![]};_0x2f04cd[_0x938c('0xc')]=_0x396d13;logger[_0x938c('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x2f04cd)['then'](function(_0x9e0b0c){_0x1bb47a[_0x938c('0x24')]=_0x9e0b0c[_0x938c('0x2a')]['id'];_0x4c923d(_0x1bb47a);})[_0x938c('0x12')](function(_0x4e161d){logger[_0x938c('0x13')]('['+[_0x39480e[_0x938c('0x14')]()]+']',_0x4e161d['message']);_0x4727a7(_0x4e161d[_0x938c('0x15')]);});});}function getTicket(_0x468755,_0x524247,_0x256388,_0x425b69,_0x4164e8){return function(_0x81b632){logger[_0x938c('0xd')](_0x938c('0x2b'));return new Promise(function(_0x3333e4,_0x5bc250){var _0x2a9d1b=moment();var _0x5ee05b={'method':_0x938c('0x27'),'uri':_0x256388+'/api/tasks','body':{'title':intUtil[_0x938c('0x2c')](_0x425b69[_0x938c('0x2d')],_0x4164e8,'\x20'),'description':intUtil[_0x938c('0x2c')](_0x425b69['Descriptions'],_0x4164e8,'\x0a'),'owner_id':_0x81b632[_0x938c('0x1c')],'creater_id':_0x81b632[_0x938c('0x10')],'targetable_id':_0x81b632[_0x938c('0x24')],'targetable_type':_0x938c('0x2e'),'created_at':_0x2a9d1b[_0x938c('0x20')](_0x938c('0x29')),'due_date':_0x2a9d1b[_0x938c('0x2f')](0x1e,'m')[_0x938c('0x20')](_0x938c('0x29'))},'json':!![]};_0x5ee05b[_0x938c('0xc')]=_0x524247;return rp(_0x5ee05b)[_0x938c('0x17')](function(_0x5ae212){_0x81b632[_0x938c('0x30')]=_0x5ae212[_0x938c('0x31')]['id'];logger['info'](_0x938c('0x32'),_0x81b632[_0x938c('0x30')]);_0x3333e4(_0x81b632);})['catch'](function(_0x3f2349){logger[_0x938c('0x13')]('['+[_0x468755[_0x938c('0x14')]()]+']',_0x3f2349[_0x938c('0x15')]);_0x5bc250(_0x3f2349[_0x938c('0x15')]);});});};}function emit(_0x44661a,_0x5af519,_0x39d1de){var _0x447d13={'uri':_0x44661a+'/contacts/'+_0x39d1de};io['to'](util['format']('user:%s',_0x5af519))['emit'](_0x938c('0x33'),_0x447d13);}exports['cs']=function(_0x330e6c,_0x1611cf,_0x150a69,_0x3689f6,_0x19642c,_0x117ef9,_0x4fef7d,_0x564c23){var _0x42a4bb={};var _0x5464b1={'Authorization':_0x938c('0x34')+_0x117ef9[_0x938c('0x35')]};_0x117ef9['remoteUri']=intUtil['stripTrailingSlash'](_0x117ef9['remoteUri']);_0x117ef9[_0x938c('0x36')]=intUtil[_0x938c('0x37')](_0x117ef9['serverUrl']);var _0x1dcdfc=_0x117ef9[_0x938c('0x38')];_0x42a4bb[_0x938c('0xf')]=_0x117ef9['username'];_0x42a4bb[_0x938c('0x22')]=_0x564c23[_0x938c('0x39')]()==='outbound'?_0x1611cf[_0x938c('0x3a')]:_0x1611cf[_0x938c('0x3b')];_0x42a4bb['callDirection']=_0x564c23==='queue'||_0x564c23===_0x938c('0x3c')?_0x938c('0x3d'):'outbound';if(_0x3689f6){_0x42a4bb[_0x938c('0x19')]=_0x3689f6[_0x938c('0xe')];}var _0x32500a=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x117ef9[_0x938c('0x36')],_0x1611cf[_0x938c('0x3e')],md5(_0x1611cf[_0x938c('0x3e')]));if(_0x19642c&&_0x19642c[_0x938c('0x3f')]){logger['info'](_0x938c('0x40'),'Recording\x20is\x20enabled!');_0x1611cf[_0x938c('0x41')]=_0x32500a;}else if(_0x4fef7d&&_0x4fef7d[_0x938c('0x42')]&&_0x4fef7d[_0x938c('0x42')]!==_0x938c('0x43')){logger[_0x938c('0xd')](_0x938c('0x44'),_0x938c('0x45'));_0x1611cf[_0x938c('0x41')]=_0x32500a;}else{_0x1611cf['recordingURL']='';}return getAdminId(_0x42a4bb,_0x564c23,_0x5464b1,_0x1dcdfc)['then'](getUser(_0x564c23,_0x5464b1,_0x1dcdfc))[_0x938c('0x17')](getEndUser(_0x564c23,_0x5464b1,_0x1dcdfc))[_0x938c('0x17')](getTicket(_0x564c23,_0x5464b1,_0x1dcdfc,_0x150a69,_0x1611cf))[_0x938c('0x17')](function(_0x1c3c7d){logger[_0x938c('0xd')](util[_0x938c('0x20')](_0x938c('0x46'),_0x1c3c7d[_0x938c('0x30')]));if(_0x564c23!=='unmanaged'){logger[_0x938c('0xd')]('['+[_0x564c23[_0x938c('0x14')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x1dcdfc,_0x3689f6[_0x938c('0x47')],_0x1c3c7d[_0x938c('0x24')]);}})['catch'](function(_0x1d947d){logger[_0x938c('0x13')]('['+[_0x564c23[_0x938c('0x14')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x938c('0x48')](_0x1d947d,{'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 99b00d9..ddfd6e9 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 _0x9341=['[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./freshsales','zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','exec','includes','data1','toLowerCase','data2','find','data3','outbound','log','EVENT\x20UNKNOWN','sugarcrm','freshsales','unknown\x20integration','../../../../config/logger','error'];(function(_0x38eb73,_0x4504cf){var _0x3bbf46=function(_0x1506e1){while(--_0x1506e1){_0x38eb73['push'](_0x38eb73['shift']());}};_0x3bbf46(++_0x4504cf);}(_0x9341,0x8b));var _0x1934=function(_0x1cf3f7,_0x4d70d1){_0x1cf3f7=_0x1cf3f7-0x0;var _0x780d88=_0x9341[_0x1cf3f7];return _0x780d88;};'use strict';var _=require(_0x1934('0x0'));var util=require(_0x1934('0x1'));var zendesk=require(_0x1934('0x2'));var salesforce=require(_0x1934('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x1934('0x4'));var zoho=require(_0x1934('0x5'));var desk=require(_0x1934('0x6'));var vtiger=require(_0x1934('0x7'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0x1934('0x8'));var integrations=[_0x1934('0x9'),_0x1934('0xa'),'sugarcrm',_0x1934('0xb'),_0x1934('0xc'),_0x1934('0xd'),_0x1934('0xe'),_0x1934('0xf'),'freshsales','servicenow'];exports[_0x1934('0x10')]=function(_0x4e6368,_0x7edb85,_0x3c05bd,_0x2da571,_0x49e270,_0x532269){if(_0x3c05bd){if(_[_0x1934('0x11')](integrations,_0x4e6368[_0x1934('0x12')][_0x1934('0x13')]())){try{var _0x19845f=null;var _0xbbf144='';var _0x4018b=_0x3c05bd[_0x4e6368[_0x1934('0x12')]['toLowerCase']()];if(_0x4018b){var _0x240c59=_0x4018b[_0x4e6368[_0x1934('0x14')]];if(_0x240c59){var _0x468c3e=_[_0x1934('0x15')](_0x240c59['Configurations'],{'id':parseInt(_0x4e6368[_0x1934('0x16')],0xa)});if(_0x468c3e){if(_0x2da571){if(_0x49e270&&_0x7edb85['queue']){_0xbbf144='queue';}else if(_0x7edb85['routeId']){_0xbbf144=_0x1934('0x17');}else{console[_0x1934('0x18')](_0x1934('0x19'),_0x7edb85);}}else{_0xbbf144='unmanaged';}switch(_0x4e6368['data1'][_0x1934('0x13')]()){case _0x1934('0x9'):zendesk[_0xbbf144](_0x4e6368,_0x7edb85,_0x468c3e,_0x2da571,_0x49e270,_0x240c59,_0x532269);break;case _0x1934('0xa'):salesforce[_0xbbf144](_0x4e6368,_0x7edb85,_0x468c3e,_0x2da571,_0x49e270,_0x240c59,_0x532269);break;case _0x1934('0x1a'):sugarcrm[_0xbbf144](_0x4e6368,_0x7edb85,_0x468c3e,_0x2da571,_0x49e270,_0x240c59,_0x532269);break;case _0x1934('0xb'):freshdesk[_0xbbf144](_0x4e6368,_0x7edb85,_0x468c3e,_0x2da571,_0x49e270,_0x240c59,_0x532269);break;case _0x1934('0xc'):zoho[_0xbbf144](_0x4e6368,_0x7edb85,_0x468c3e,_0x2da571,_0x49e270,_0x240c59,_0x532269);break;case _0x1934('0xd'):desk[_0xbbf144](_0x4e6368,_0x7edb85,_0x468c3e,_0x2da571,_0x49e270,_0x240c59,_0x532269);break;case _0x1934('0xe'):vtiger[_0xbbf144](_0x4e6368,_0x7edb85,_0x468c3e,_0x2da571,_0x49e270,_0x240c59,_0x532269);break;case _0x1934('0x1b'):freshsales['cs'](_0x4e6368,_0x7edb85,_0x468c3e,_0x2da571,_0x49e270,_0x240c59,_0x532269,_0xbbf144);break;case'servicenow':servicenow['cs'](_0x4e6368,_0x7edb85,_0x468c3e,_0x2da571,_0x49e270,_0x240c59,_0x532269,_0xbbf144);break;case _0x1934('0xf'):dynamics365['cs'](_0x4e6368,_0x7edb85,_0x468c3e,_0x2da571,_0x49e270,_0x240c59,_0x532269,_0xbbf144);break;default:console[_0x1934('0x18')](_0x1934('0x1c'));}}else{_0x19845f=require(_0x1934('0x1d'))(_0x4e6368[_0x1934('0x12')][_0x1934('0x13')]());_0x19845f[_0x1934('0x1e')](_0x1934('0x1f'),util[_0x1934('0x20')](_0x1934('0x21'),_0x4e6368[_0x1934('0x12')][_0x1934('0x13')](),_0x4e6368['data3']));}}else{_0x19845f=require('../../../../config/logger')(_0x4e6368[_0x1934('0x12')][_0x1934('0x13')]());_0x19845f[_0x1934('0x1e')]('[EXEC]',util[_0x1934('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0x4e6368[_0x1934('0x12')][_0x1934('0x13')](),_0x4e6368['data2']));}}else{}}catch(_0xe6d333){console[_0x1934('0x1e')](_0xe6d333);}}}}; \ No newline at end of file +var _0xa0c6=['unmanaged','toLowerCase','desk','unknown\x20integration','../../../../config/logger','[EXEC]','format','error','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','vtiger','dynamics365','freshsales','exec','includes','data1','data2','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN'];(function(_0x12833b,_0x26c1d2){var _0x3acad3=function(_0x2f9ec9){while(--_0x2f9ec9){_0x12833b['push'](_0x12833b['shift']());}};_0x3acad3(++_0x26c1d2);}(_0xa0c6,0x119));var _0x6a0c=function(_0x1b559e,_0x2d0c7f){_0x1b559e=_0x1b559e-0x0;var _0x4caf67=_0xa0c6[_0x1b559e];return _0x4caf67;};'use strict';var _=require('lodash');var util=require(_0x6a0c('0x0'));var zendesk=require(_0x6a0c('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x6a0c('0x2'));var freshdesk=require(_0x6a0c('0x3'));var zoho=require(_0x6a0c('0x4'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x6a0c('0x5'));var freshsales=require(_0x6a0c('0x6'));var integrations=[_0x6a0c('0x7'),_0x6a0c('0x8'),_0x6a0c('0x9'),_0x6a0c('0xa'),_0x6a0c('0xb'),'desk',_0x6a0c('0xc'),_0x6a0c('0xd'),_0x6a0c('0xe'),'servicenow'];exports[_0x6a0c('0xf')]=function(_0x491ad8,_0x24ccd2,_0x5beb66,_0x1de761,_0x42900d,_0x30a852){if(_0x5beb66){if(_[_0x6a0c('0x10')](integrations,_0x491ad8[_0x6a0c('0x11')]['toLowerCase']())){try{var _0x422bbc=null;var _0x2c11e1='';var _0x39e89f=_0x5beb66[_0x491ad8['data1']['toLowerCase']()];if(_0x39e89f){var _0x502e43=_0x39e89f[_0x491ad8[_0x6a0c('0x12')]];if(_0x502e43){var _0x33ae38=_['find'](_0x502e43['Configurations'],{'id':parseInt(_0x491ad8[_0x6a0c('0x13')],0xa)});if(_0x33ae38){if(_0x1de761){if(_0x42900d&&_0x24ccd2[_0x6a0c('0x14')]){_0x2c11e1='queue';}else if(_0x24ccd2[_0x6a0c('0x15')]){_0x2c11e1=_0x6a0c('0x16');}else{console[_0x6a0c('0x17')](_0x6a0c('0x18'),_0x24ccd2);}}else{_0x2c11e1=_0x6a0c('0x19');}switch(_0x491ad8[_0x6a0c('0x11')][_0x6a0c('0x1a')]()){case _0x6a0c('0x7'):zendesk[_0x2c11e1](_0x491ad8,_0x24ccd2,_0x33ae38,_0x1de761,_0x42900d,_0x502e43,_0x30a852);break;case _0x6a0c('0x8'):salesforce[_0x2c11e1](_0x491ad8,_0x24ccd2,_0x33ae38,_0x1de761,_0x42900d,_0x502e43,_0x30a852);break;case _0x6a0c('0x9'):sugarcrm[_0x2c11e1](_0x491ad8,_0x24ccd2,_0x33ae38,_0x1de761,_0x42900d,_0x502e43,_0x30a852);break;case'freshdesk':freshdesk[_0x2c11e1](_0x491ad8,_0x24ccd2,_0x33ae38,_0x1de761,_0x42900d,_0x502e43,_0x30a852);break;case _0x6a0c('0xb'):zoho[_0x2c11e1](_0x491ad8,_0x24ccd2,_0x33ae38,_0x1de761,_0x42900d,_0x502e43,_0x30a852);break;case _0x6a0c('0x1b'):desk[_0x2c11e1](_0x491ad8,_0x24ccd2,_0x33ae38,_0x1de761,_0x42900d,_0x502e43,_0x30a852);break;case _0x6a0c('0xc'):vtiger[_0x2c11e1](_0x491ad8,_0x24ccd2,_0x33ae38,_0x1de761,_0x42900d,_0x502e43,_0x30a852);break;case _0x6a0c('0xe'):freshsales['cs'](_0x491ad8,_0x24ccd2,_0x33ae38,_0x1de761,_0x42900d,_0x502e43,_0x30a852,_0x2c11e1);break;case'servicenow':servicenow['cs'](_0x491ad8,_0x24ccd2,_0x33ae38,_0x1de761,_0x42900d,_0x502e43,_0x30a852,_0x2c11e1);break;case'dynamics365':dynamics365['cs'](_0x491ad8,_0x24ccd2,_0x33ae38,_0x1de761,_0x42900d,_0x502e43,_0x30a852,_0x2c11e1);break;default:console[_0x6a0c('0x17')](_0x6a0c('0x1c'));}}else{_0x422bbc=require(_0x6a0c('0x1d'))(_0x491ad8[_0x6a0c('0x11')][_0x6a0c('0x1a')]());_0x422bbc['error'](_0x6a0c('0x1e'),util[_0x6a0c('0x1f')]('%s\x20configuration\x20#%s\x20not\x20found',_0x491ad8['data1'][_0x6a0c('0x1a')](),_0x491ad8[_0x6a0c('0x13')]));}}else{_0x422bbc=require(_0x6a0c('0x1d'))(_0x491ad8['data1'][_0x6a0c('0x1a')]());_0x422bbc[_0x6a0c('0x20')](_0x6a0c('0x1e'),util[_0x6a0c('0x1f')](_0x6a0c('0x21'),_0x491ad8[_0x6a0c('0x11')][_0x6a0c('0x1a')](),_0x491ad8[_0x6a0c('0x12')]));}}else{}}catch(_0x21447b){console[_0x6a0c('0x20')](_0x21447b);}}}}; \ 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 76e0e81..8337b18 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 _0x92e1=['contact','lead','Case','AccountId','leadId','info','sobject','create','isNil','validateEmail','User','execute','then','length','find','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','upperFirst','forEach','includes','string','picklist','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','remoteUri','recordingFormat','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','Recording\x20is\x20enabled!',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType'];(function(_0x4a3f2f,_0x307661){var _0x3e1811=function(_0x3a3075){while(--_0x3a3075){_0x4a3f2f['push'](_0x4a3f2f['shift']());}};_0x3e1811(++_0x307661);}(_0x92e1,0x1ec));var _0x192e=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0x92e1[_0x37b7b6];return _0x10c4c3;};'use strict';var _=require(_0x192e('0x0'));var rp=require(_0x192e('0x1'));var moment=require(_0x192e('0x2'));var BPromise=require(_0x192e('0x3'));var md5=require(_0x192e('0x4'));var jsforce=require(_0x192e('0x5'));var util=require(_0x192e('0x6'));var Redis=require('ioredis');var intUtil=require(_0x192e('0x7'));var config=require('../../../../config/environment');var logger=require(_0x192e('0x8'))(_0x192e('0x9'));config[_0x192e('0xa')]=_[_0x192e('0xb')](config['redis'],{'host':_0x192e('0xc'),'port':0x18eb});var io=require(_0x192e('0xd'))(new Redis(config[_0x192e('0xa')]));function emit(_0x2c53ae,_0x485f71,_0x175d92){io['to'](_0x2c53ae)[_0x192e('0xe')](_0x485f71,_0x175d92);}function getTicket(_0x378457,_0x536f63,_0xc9236e,_0x500b31,_0x5b3bba,_0x3e5450,_0x28ed16,_0x45f32f){var _0x45f622=Object['assign']({},{'OwnerId':_0x536f63['id'],'Subject':intUtil[_0x192e('0xf')](_0x500b31[_0x192e('0x10')],_0x5b3bba,'\x20'),'Description':intUtil[_0x192e('0xf')](_0x500b31[_0x192e('0x11')],_0x5b3bba,'\x0a')},getCustomFields(_0x3e5450,_0x5b3bba));if(_0xc9236e){if(_0x500b31[_0x192e('0x12')]===_0x192e('0x13')){_0x45f622['ActivityDate']=moment[_0x192e('0x14')]();_0x45f622[_0x192e('0x15')]=![];_0x45f622[_0x192e('0x16')]=![];if(_0xc9236e[_0x192e('0x17')]===_0x192e('0x18')||_0xc9236e[_0x192e('0x17')]===_0x192e('0x19')){_0x45f622['WhoId']=_0xc9236e['id'];}else if(_0xc9236e[_0x192e('0x17')]==='account'){_0x45f622['WhatId']=_0xc9236e['id'];}}else if(_0x500b31[_0x192e('0x12')]===_0x192e('0x1a')){if(_0xc9236e['endUserType']==='contact'){_0x45f622['ContactId']=_0xc9236e['id'];}else if(_0xc9236e[_0x192e('0x17')]==='account'){_0x45f622[_0x192e('0x1b')]=_0xc9236e['id'];}else if(_0xc9236e[_0x192e('0x17')]===_0x192e('0x19')&&_0x500b31[_0x192e('0x1c')]){_0x45f622[_0x500b31['leadId']]=_0xc9236e['id'];}else{logger[_0x192e('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x28ed16[_0x192e('0x1e')](_0x500b31[_0x192e('0x12')])[_0x192e('0x1f')](_0x45f622);}function getUser(_0x1c78d3,_0x4131ab,_0x31fd1a){if(!_[_0x192e('0x20')](_0x4131ab)&&intUtil[_0x192e('0x21')](_0x4131ab)){var _0x259ed5={'Email':_0x4131ab};var _0x4bb2ee={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x31fd1a[_0x192e('0x1e')](_0x192e('0x22'))['find'](_0x259ed5,_0x4bb2ee)[_0x192e('0x23')]()[_0x192e('0x24')](function(_0x53152a){if(_0x53152a[_0x192e('0x25')]){var _0x30cb64=_[_0x192e('0x26')](_0x53152a,function(_0x1f1725){return _0x1f1725['Email']===_0x4131ab;});if(_0x30cb64){logger['info'](_0x192e('0x27'),_0x4131ab);return BPromise[_0x192e('0x28')]({'id':_0x30cb64['Id'],'name':_0x30cb64[_0x192e('0x29')]});}}else{logger['info'](_0x192e('0x2a'),_0x4131ab);return _0x31fd1a[_0x192e('0x2b')]()[_0x192e('0x24')](function(_0x156dd6){return BPromise[_0x192e('0x28')]({'id':_0x156dd6[_0x192e('0x2c')],'name':_0x156dd6[_0x192e('0x2d')]});});}});}else{logger['info'](_0x192e('0x2a'),_0x4131ab);return _0x31fd1a[_0x192e('0x2b')]()[_0x192e('0x24')](function(_0x2042c4){return BPromise[_0x192e('0x28')]({'id':_0x2042c4[_0x192e('0x2c')],'name':_0x2042c4[_0x192e('0x2d')]});});}}function getEndUser(_0x2aed8e,_0xcb6e66,_0x379d53,_0xb6aa18,_0x44bfe7){var _0x3f6626={'$or':{'Phone':_0xb6aa18}};var _0x475dac={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x192e('0x28')]()[_0x192e('0x24')](function(){logger[_0x192e('0x1d')](_0x192e('0x2e'),_0xb6aa18,_0xcb6e66[_0x192e('0x2f')]);switch(_0xcb6e66['moduleSearch']){case _0x192e('0x30'):var _0x4b9056=_['cloneDeep'](_0x3f6626);if(_0xcb6e66[_0x192e('0x31')]){var _0x3a62db={};_0x3a62db[_0xcb6e66['additionalSearchContact']]=_0xb6aa18;_[_0x192e('0x32')](_0x4b9056[_0x192e('0x33')],_0x3a62db);}return _0x44bfe7[_0x192e('0x1e')](_0x192e('0x34'))[_0x192e('0x26')](_0x4b9056,_0x475dac)['execute']()[_0x192e('0x24')](function(_0xad8526){if(_0xad8526&&_0xad8526[_0x192e('0x25')]){return _0xad8526;}else{var _0x28f230=_[_0x192e('0x35')](_0x3f6626);if(_0xcb6e66['additionalSearchLead']){var _0x105534={};_0x105534[_0xcb6e66[_0x192e('0x36')]]=_0xb6aa18;_['merge'](_0x28f230[_0x192e('0x33')],_0x105534);}return _0x44bfe7[_0x192e('0x1e')](_0x192e('0x37'))[_0x192e('0x26')](_0x28f230,_0x475dac);}});case _0x192e('0x38'):var _0x96c5a2=_[_0x192e('0x35')](_0x3f6626);if(_0xcb6e66['additionalSearchAccount']){var _0x3a62db={};_0x3a62db[_0xcb6e66[_0x192e('0x39')]]=_0xb6aa18;_['merge'](_0x96c5a2[_0x192e('0x33')],_0x3a62db);}return _0x44bfe7[_0x192e('0x1e')]('Account')[_0x192e('0x26')](_0x96c5a2,_0x475dac)['execute']()[_0x192e('0x24')](function(_0x15f18d){if(_0x15f18d&&_0x15f18d[_0x192e('0x25')]){return _0x15f18d;}else{var _0x4ce1d1=_[_0x192e('0x35')](_0x3f6626);if(_0xcb6e66['additionalSearchContact']){var _0x3a4cce={};_0x3a4cce[_0xcb6e66[_0x192e('0x31')]]=_0xb6aa18;_[_0x192e('0x32')](_0x4ce1d1['$or'],_0x3a4cce);}return _0x44bfe7[_0x192e('0x1e')](_0x192e('0x34'))[_0x192e('0x26')](_0x4ce1d1,_0x475dac)[_0x192e('0x24')](function(_0x485032){if(_0x485032&&_0x485032[_0x192e('0x25')]){return _0x485032;}else{var _0x257a62=_[_0x192e('0x35')](_0x3f6626);if(_0xcb6e66[_0x192e('0x36')]){var _0x35d4ff={};_0x35d4ff[_0xcb6e66[_0x192e('0x36')]]=_0xb6aa18;_['merge'](_0x257a62['$or'],_0x35d4ff);}return _0x44bfe7[_0x192e('0x1e')](_0x192e('0x37'))[_0x192e('0x26')](_0x257a62,_0x475dac);}});}});case'contact':var _0x4b9056=_['cloneDeep'](_0x3f6626);if(_0xcb6e66[_0x192e('0x31')]){var _0x3a62db={};_0x3a62db[_0xcb6e66[_0x192e('0x31')]]=_0xb6aa18;_[_0x192e('0x32')](_0x4b9056[_0x192e('0x33')],_0x3a62db);}return _0x44bfe7[_0x192e('0x1e')]('Contact')[_0x192e('0x26')](_0x4b9056,_0x475dac)[_0x192e('0x23')]();case _0x192e('0x19'):var _0x4609b1=_[_0x192e('0x35')](_0x3f6626);if(_0xcb6e66[_0x192e('0x36')]){var _0x3a62db={};_0x3a62db[_0xcb6e66[_0x192e('0x36')]]=_0xb6aa18;_['merge'](_0x4609b1[_0x192e('0x33')],_0x3a62db);}return _0x44bfe7[_0x192e('0x1e')](_0x192e('0x37'))[_0x192e('0x26')](_0x4609b1,_0x475dac);case _0x192e('0x3a'):var _0x96c5a2=_['cloneDeep'](_0x3f6626);if(_0xcb6e66[_0x192e('0x39')]){var _0x3a62db={};_0x3a62db[_0xcb6e66[_0x192e('0x39')]]=_0xb6aa18;_[_0x192e('0x32')](_0x96c5a2['$or'],_0x3a62db);}return _0x44bfe7[_0x192e('0x1e')]('Account')[_0x192e('0x26')](_0x96c5a2,_0x475dac);default:return null;}})['then'](function(_0x5b1b7a){if(_0x5b1b7a&&_0x5b1b7a[_0x192e('0x25')]){var _0x3a0d4d=_[_0x192e('0x3b')](_0x5b1b7a);if(_0x3a0d4d){return BPromise[_0x192e('0x28')]({'id':_0x3a0d4d['Id'],'name':_0x3a0d4d['Name'],'phone':_0x3a0d4d[_0x192e('0x3c')],'endUserType':_0x3a0d4d[_0x192e('0x3d')][_0x192e('0x3e')][_0x192e('0x3f')]()});}}})['then'](function(_0x47fafc){if(_0x47fafc){logger[_0x192e('0x1d')](_0x192e('0x40'),_0x47fafc[_0x192e('0x17')],_0xb6aa18);return BPromise[_0x192e('0x28')](_0x47fafc);}else{logger[_0x192e('0x1d')](_0x192e('0x41'),_0xb6aa18);var _0x28acc3={'Phone':_0xb6aa18};if(_0xcb6e66['moduleCreate']){if(_0xcb6e66[_0x192e('0x42')]===_0x192e('0x18')){logger[_0x192e('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xb6aa18,_0xcb6e66[_0x192e('0x42')]);_0x28acc3['LastName']=_0x379d53!==_0x192e('0x43')?_0x379d53:util[_0x192e('0x44')](_0x192e('0x45'),_0xb6aa18);}else if(_0xcb6e66['moduleCreate']==='lead'){logger[_0x192e('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xb6aa18,_0xcb6e66[_0x192e('0x42')]);_0x28acc3[_0x192e('0x46')]=_0x379d53!==_0x192e('0x43')?_0x379d53:util[_0x192e('0x44')]('Caller\x20-\x20%s',_0xb6aa18);_0x28acc3[_0x192e('0x47')]=_0x192e('0x48');}else if(_0xcb6e66[_0x192e('0x42')]==='account'){logger[_0x192e('0x1d')](_0x192e('0x49'),_0xb6aa18,_0xcb6e66[_0x192e('0x42')]);_0x28acc3['Name']=_0x379d53!==_0x192e('0x43')?_0x379d53:util['format']('Caller\x20-\x20%s',_0xb6aa18);}else{return null;}}return _0x44bfe7['sobject'](_[_0x192e('0x4a')](_0xcb6e66[_0x192e('0x42')]))['create'](_0x28acc3)['then'](function(_0x268be6){return BPromise[_0x192e('0x28')]({'id':_0x268be6['id'],'endUserType':_0xcb6e66['moduleCreate']});});}});}function getCustomFields(_0x4406bd,_0x229141){var _0x4172d1={};if(_0x4406bd[_0x192e('0x25')]>0x0){_[_0x192e('0x4b')](_0x4406bd,function(_0x19daeb){if(_[_0x192e('0x4c')]([_0x192e('0x4d'),_0x192e('0x4e')],_0x19daeb[_0x192e('0x3e')])&&_0x19daeb[_0x192e('0x4f')]){_0x4172d1[_0x19daeb[_0x192e('0x4f')]]=_0x19daeb['content'][_0x192e('0x50')]();}else if(_0x19daeb[_0x192e('0x3e')]===_0x192e('0x51')&&_0x19daeb[_0x192e('0x52')]&&_0x19daeb[_0x192e('0x4f')]){_0x229141[_0x19daeb['variableName']]&&(_0x4172d1[_0x19daeb[_0x192e('0x4f')]]=_0x229141[_0x19daeb[_0x192e('0x52')]][_0x192e('0x50')]());}else if(_0x19daeb[_0x192e('0x3e')]===_0x192e('0x53')&&_0x19daeb[_0x192e('0x54')]&&_0x19daeb[_0x192e('0x54')][_0x192e('0x55')]&&_0x19daeb['idField']){_0x229141[_0x19daeb['Variable'][_0x192e('0x55')][_0x192e('0x3f')]()]&&(_0x4172d1[_0x19daeb[_0x192e('0x4f')]]=_0x229141[_0x19daeb[_0x192e('0x54')][_0x192e('0x55')][_0x192e('0x3f')]()][_0x192e('0x50')]());}});}return _0x4172d1;}function getConnection(_0x2738be){var _0x44448b=_0x2738be[_0x192e('0x56')][_0x192e('0x57')](_0x2738be[_0x192e('0x58')]);var _0x3d757a=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2738be['remoteUri']||_0x192e('0x59'),'clientId':_0x2738be[_0x192e('0x5a')],'clientSecret':_0x2738be[_0x192e('0x5b')]}});return _0x3d757a[_0x192e('0x5c')](_0x2738be[_0x192e('0x5d')],_0x44448b)[_0x192e('0x24')](function(){logger[_0x192e('0x1d')]('Connection\x20established.');return _0x3d757a;});}exports[_0x192e('0x5e')]=function(_0x5910a1,_0x5f2325,_0xb0f23a,_0x29c2aa,_0x16ae0a,_0x21d42a){var _0xf5453e,_0x3c1428,_0x3d76aa,_0x775e96;_0x21d42a[_0x192e('0x5f')]=intUtil[_0x192e('0x60')](_0x21d42a['serverUrl']);_0x21d42a['remoteUri']=intUtil['stripTrailingSlash'](_0x21d42a['remoteUri']);if(_0x16ae0a&&_0x16ae0a[_0x192e('0x61')]){logger[_0x192e('0x1d')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5f2325[_0x192e('0x62')]=util[_0x192e('0x44')](_0x192e('0x63'),_0x21d42a[_0x192e('0x5f')],_0x5f2325['uniqueid'],md5(_0x5f2325[_0x192e('0x64')]));}else{_0x5f2325[_0x192e('0x62')]='';}return getConnection(_0x21d42a)[_0x192e('0x24')](function(_0xf4b210){_0x775e96=_0xf4b210;return getUser(_0x21d42a,_0x29c2aa[_0x192e('0x65')],_0x775e96);})[_0x192e('0x24')](function(_0x489e35){_0xf5453e=_0x489e35;return getEndUser(_0x21d42a,_0xb0f23a,_0x5f2325[_0x192e('0x66')],_0x5f2325[_0x192e('0x67')],_0x775e96);})[_0x192e('0x24')](function(_0x22d018){_0x3c1428=_0x22d018;return getTicket(_0x21d42a,_0xf5453e,_0x3c1428,_0xb0f23a,_0x5f2325,_0xb0f23a[_0x192e('0x68')],_0x775e96,'queue');})[_0x192e('0x24')](function(_0x12e40d){_0x3d76aa=_0x12e40d;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x3d76aa['id']);logger[_0x192e('0x1d')](_0x192e('0x69'),_0x3d76aa['id'],_0x29c2aa['name'],_0x21d42a['type']);switch(_0x21d42a[_0x192e('0x3e')]){case _0x192e('0x6a'):emit(util[_0x192e('0x44')](_0x192e('0x6b'),_0x29c2aa[_0x192e('0x55')]),_0x192e('0x6c'),{'recordId':_0x3d76aa['id']});break;case _0x192e('0x6d'):emit(util['format'](_0x192e('0x6b'),_0x29c2aa[_0x192e('0x55')]),_0x192e('0x6e'),{'uri':util[_0x192e('0x44')](_0x192e('0x6f'),_0x775e96['instanceUrl'],_0x3d76aa['id'])});break;default:logger[_0x192e('0x70')](_0x192e('0x71'));}})[_0x192e('0x72')](function(_0x5df301){logger['error'](_0x192e('0x73'),_0x5df301);});};exports[_0x192e('0x74')]=function(_0x5b57be,_0x1b6906,_0x57f195,_0xb1233c,_0x25de5c,_0x2aa8b8,_0x55ed38){var _0x50cd65,_0x4c8cae,_0x5bfab5,_0x3cb611;_0x2aa8b8[_0x192e('0x5f')]=intUtil[_0x192e('0x60')](_0x2aa8b8[_0x192e('0x5f')]);_0x2aa8b8[_0x192e('0x75')]=intUtil[_0x192e('0x60')](_0x2aa8b8[_0x192e('0x75')]);if(_0x55ed38&&_0x55ed38[_0x192e('0x76')]&&_0x55ed38['recordingFormat']!=='none'){logger[_0x192e('0x1d')](_0x192e('0x77'),'Recording\x20is\x20enabled!');_0x1b6906[_0x192e('0x62')]=util['format'](_0x192e('0x63'),_0x2aa8b8['serverUrl'],_0x1b6906[_0x192e('0x64')],md5(_0x1b6906[_0x192e('0x64')]));}return getConnection(_0x2aa8b8)['then'](function(_0xe8296b){_0x3cb611=_0xe8296b;return getUser(_0x2aa8b8,_0xb1233c['email'],_0x3cb611);})[_0x192e('0x24')](function(_0x27e45f){_0x50cd65=_0x27e45f;return getEndUser(_0x2aa8b8,_0x57f195,_0x1b6906[_0x192e('0x78')],_0x1b6906['destcalleridnum'],_0x3cb611);})[_0x192e('0x24')](function(_0x36cd65){_0x4c8cae=_0x36cd65;return getTicket(_0x2aa8b8,_0x50cd65,_0x4c8cae,_0x57f195,_0x1b6906,_0x57f195[_0x192e('0x68')],_0x3cb611,_0x192e('0x74'));})['then'](function(_0x57b40b){_0x5bfab5=_0x57b40b;logger[_0x192e('0x1d')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x5bfab5['id']);logger[_0x192e('0x1d')](_0x192e('0x79'),_0x5bfab5['id'],_0xb1233c[_0x192e('0x55')],_0x2aa8b8[_0x192e('0x3e')]);switch(_0x2aa8b8[_0x192e('0x3e')]){case _0x192e('0x6a'):emit(util[_0x192e('0x44')](_0x192e('0x6b'),_0xb1233c[_0x192e('0x55')]),'trigger:salesforce:display',{'recordId':_0x5bfab5['id']});break;case _0x192e('0x6d'):emit(util['format'](_0x192e('0x6b'),_0xb1233c[_0x192e('0x55')]),'trigger:browser:url',{'uri':util['format'](_0x192e('0x6f'),_0x3cb611[_0x192e('0x7a')],_0x5bfab5['id'])});break;default:logger[_0x192e('0x70')](_0x192e('0x77'),_0x192e('0x7b'));}})[_0x192e('0x72')](function(_0x1adc8d){logger[_0x192e('0x70')](_0x192e('0x77'),_0x1adc8d);});};exports['unmanaged']=function(_0x504029,_0x893179,_0x52ca7d,_0x1c7e21,_0x249a35,_0x12d8b9){var _0x3fa31e,_0x429427,_0x2d087c,_0x3eea24;_0x12d8b9[_0x192e('0x5f')]=intUtil[_0x192e('0x60')](_0x12d8b9['serverUrl']);_0x12d8b9[_0x192e('0x75')]=intUtil[_0x192e('0x60')](_0x12d8b9[_0x192e('0x75')]);if(_0x249a35&&_0x249a35['monitor_format']){logger[_0x192e('0x1d')]('['+_0x893179[_0x192e('0x7c')][_0x192e('0x7d')]()+']',_0x192e('0x7e'));_0x893179[_0x192e('0x62')]=util[_0x192e('0x44')](_0x192e('0x63'),_0x12d8b9['serverUrl'],_0x893179[_0x192e('0x64')],md5(_0x893179['uniqueid']));}else{_0x893179[_0x192e('0x62')]='';}return getConnection(_0x12d8b9)[_0x192e('0x24')](function(_0x2f0c1b){_0x3eea24=_0x2f0c1b;if(!_[_0x192e('0x20')](_0x1c7e21)){return getUser(_0x12d8b9,_0x1c7e21[_0x192e('0x55')],_0x3eea24);}else{return getUser(_0x12d8b9,null,_0x3eea24);}})[_0x192e('0x24')](function(_0x554b5d){_0x3fa31e=_0x554b5d;return getEndUser(_0x12d8b9,_0x52ca7d,_0x893179[_0x192e('0x66')],_0x893179[_0x192e('0x67')],_0x3eea24);})[_0x192e('0x24')](function(_0xc7b1e8){_0x429427=_0xc7b1e8;return getTicket(_0x12d8b9,_0x3fa31e,_0x429427,_0x52ca7d,_0x893179,_0x52ca7d[_0x192e('0x68')],_0x3eea24);})[_0x192e('0x24')](function(_0x5c3010){_0x2d087c=_0x5c3010;logger[_0x192e('0x1d')]('['+_0x893179[_0x192e('0x7c')]['toUpperCase']()+_0x192e('0x7f'),_0x2d087c['id']);logger['info']('['+_0x893179[_0x192e('0x7c')][_0x192e('0x7d')]()+_0x192e('0x80'),_0x12d8b9[_0x192e('0x3e')]);})[_0x192e('0x72')](function(_0xd00cc6){logger[_0x192e('0x70')]('['+_0x893179[_0x192e('0x7c')][_0x192e('0x7d')]()+']',_0xd00cc6);});}; \ No newline at end of file +var _0xdbf6=['util','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','Subjects','getString','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','Case','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','Email','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','resolve','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','additionalSearchAccount','Account','execute','first','Phone','attributes','type','toLowerCase','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','','upperFirst','forEach','includes','idField','content','toString','variableName','customVariable','Variable','name','password','securityToken','remoteUri','https://login.salesforce.com','clientSecret','login','queue','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','integrationTab','unmanaged','stripTrailingSlash','monitor_format','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','isNil','calleridname','Fields',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','jsforce'];(function(_0x19a28d,_0x472544){var _0x5368ff=function(_0x5311db){while(--_0x5311db){_0x19a28d['push'](_0x19a28d['shift']());}};_0x5368ff(++_0x472544);}(_0xdbf6,0x75));var _0x6dbf=function(_0x27e26e,_0x3718e9){_0x27e26e=_0x27e26e-0x0;var _0x159bf8=_0xdbf6[_0x27e26e];return _0x159bf8;};'use strict';var _=require(_0x6dbf('0x0'));var rp=require('request-promise');var moment=require(_0x6dbf('0x1'));var BPromise=require(_0x6dbf('0x2'));var md5=require(_0x6dbf('0x3'));var jsforce=require(_0x6dbf('0x4'));var util=require(_0x6dbf('0x5'));var Redis=require('ioredis');var intUtil=require(_0x6dbf('0x6'));var config=require(_0x6dbf('0x7'));var logger=require(_0x6dbf('0x8'))('salesforce');config[_0x6dbf('0x9')]=_['defaults'](config[_0x6dbf('0x9')],{'host':_0x6dbf('0xa'),'port':0x18eb});var io=require(_0x6dbf('0xb'))(new Redis(config[_0x6dbf('0x9')]));function emit(_0x16b418,_0xe55663,_0xe30fc1){io['to'](_0x16b418)['emit'](_0xe55663,_0xe30fc1);}function getTicket(_0x457bca,_0x6b97d,_0x3579eb,_0x386474,_0x4a1ff5,_0x60c9df,_0x25b0c6,_0x3c19f0){var _0x4d69f7=Object['assign']({},{'OwnerId':_0x6b97d['id'],'Subject':intUtil['getString'](_0x386474[_0x6dbf('0xc')],_0x4a1ff5,'\x20'),'Description':intUtil[_0x6dbf('0xd')](_0x386474[_0x6dbf('0xe')],_0x4a1ff5,'\x0a')},getCustomFields(_0x60c9df,_0x4a1ff5));if(_0x3579eb){if(_0x386474[_0x6dbf('0xf')]==='Task'){_0x4d69f7[_0x6dbf('0x10')]=moment[_0x6dbf('0x11')]();_0x4d69f7[_0x6dbf('0x12')]=![];_0x4d69f7[_0x6dbf('0x13')]=![];if(_0x3579eb[_0x6dbf('0x14')]==='contact'||_0x3579eb['endUserType']===_0x6dbf('0x15')){_0x4d69f7[_0x6dbf('0x16')]=_0x3579eb['id'];}else if(_0x3579eb[_0x6dbf('0x14')]===_0x6dbf('0x17')){_0x4d69f7[_0x6dbf('0x18')]=_0x3579eb['id'];}}else if(_0x386474[_0x6dbf('0xf')]===_0x6dbf('0x19')){if(_0x3579eb[_0x6dbf('0x14')]===_0x6dbf('0x1a')){_0x4d69f7[_0x6dbf('0x1b')]=_0x3579eb['id'];}else if(_0x3579eb[_0x6dbf('0x14')]===_0x6dbf('0x17')){_0x4d69f7[_0x6dbf('0x1c')]=_0x3579eb['id'];}else if(_0x3579eb[_0x6dbf('0x14')]===_0x6dbf('0x15')&&_0x386474[_0x6dbf('0x1d')]){_0x4d69f7[_0x386474[_0x6dbf('0x1d')]]=_0x3579eb['id'];}else{logger[_0x6dbf('0x1e')](_0x6dbf('0x1f'));}}}return _0x25b0c6[_0x6dbf('0x20')](_0x386474[_0x6dbf('0xf')])[_0x6dbf('0x21')](_0x4d69f7);}function getUser(_0xe5c700,_0xba2111,_0x1d9352){if(!_['isNil'](_0xba2111)&&intUtil[_0x6dbf('0x22')](_0xba2111)){var _0x9aaf4f={'Email':_0xba2111};var _0x1702af={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1d9352[_0x6dbf('0x20')](_0x6dbf('0x23'))[_0x6dbf('0x24')](_0x9aaf4f,_0x1702af)['execute']()['then'](function(_0x173198){if(_0x173198['length']){var _0x1c4029=_[_0x6dbf('0x24')](_0x173198,function(_0xc35d8d){return _0xc35d8d[_0x6dbf('0x25')]===_0xba2111;});if(_0x1c4029){logger['info']('Agent\x20%s\x20found.',_0xba2111);return BPromise['resolve']({'id':_0x1c4029['Id'],'name':_0x1c4029[_0x6dbf('0x26')]});}}else{logger[_0x6dbf('0x1e')](_0x6dbf('0x27'),_0xba2111);return _0x1d9352['identity']()[_0x6dbf('0x28')](function(_0x6e185a){return BPromise[_0x6dbf('0x29')]({'id':_0x6e185a[_0x6dbf('0x2a')],'name':_0x6e185a['display_name']});});}});}else{logger[_0x6dbf('0x1e')](_0x6dbf('0x27'),_0xba2111);return _0x1d9352['identity']()[_0x6dbf('0x28')](function(_0x2b0fa6){return BPromise['resolve']({'id':_0x2b0fa6[_0x6dbf('0x2a')],'name':_0x2b0fa6['display_name']});});}}function getEndUser(_0x4d4962,_0x31db5f,_0x3bdfa0,_0x6359be,_0x55d3c0){var _0x5f3eea={'$or':{'Phone':_0x6359be}};var _0x4eeb6a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6dbf('0x29')]()[_0x6dbf('0x28')](function(){logger[_0x6dbf('0x1e')](_0x6dbf('0x2b'),_0x6359be,_0x31db5f[_0x6dbf('0x2c')]);switch(_0x31db5f[_0x6dbf('0x2c')]){case _0x6dbf('0x2d'):var _0x31e241=_[_0x6dbf('0x2e')](_0x5f3eea);if(_0x31db5f['additionalSearchContact']){var _0x43e6b0={};_0x43e6b0[_0x31db5f[_0x6dbf('0x2f')]]=_0x6359be;_[_0x6dbf('0x30')](_0x31e241[_0x6dbf('0x31')],_0x43e6b0);}return _0x55d3c0[_0x6dbf('0x20')](_0x6dbf('0x32'))[_0x6dbf('0x24')](_0x31e241,_0x4eeb6a)['execute']()[_0x6dbf('0x28')](function(_0x5df7e7){if(_0x5df7e7&&_0x5df7e7[_0x6dbf('0x33')]){return _0x5df7e7;}else{var _0x4b26ef=_['cloneDeep'](_0x5f3eea);if(_0x31db5f[_0x6dbf('0x34')]){var _0x3f47e5={};_0x3f47e5[_0x31db5f[_0x6dbf('0x34')]]=_0x6359be;_['merge'](_0x4b26ef[_0x6dbf('0x31')],_0x3f47e5);}return _0x55d3c0[_0x6dbf('0x20')](_0x6dbf('0x35'))['find'](_0x4b26ef,_0x4eeb6a);}});case'account_contact_lead':var _0x179f21=_['cloneDeep'](_0x5f3eea);if(_0x31db5f[_0x6dbf('0x36')]){var _0x43e6b0={};_0x43e6b0[_0x31db5f[_0x6dbf('0x36')]]=_0x6359be;_['merge'](_0x179f21[_0x6dbf('0x31')],_0x43e6b0);}return _0x55d3c0[_0x6dbf('0x20')](_0x6dbf('0x37'))['find'](_0x179f21,_0x4eeb6a)['execute']()[_0x6dbf('0x28')](function(_0x221d12){if(_0x221d12&&_0x221d12['length']){return _0x221d12;}else{var _0x337949=_[_0x6dbf('0x2e')](_0x5f3eea);if(_0x31db5f[_0x6dbf('0x2f')]){var _0x3b9cf4={};_0x3b9cf4[_0x31db5f[_0x6dbf('0x2f')]]=_0x6359be;_['merge'](_0x337949[_0x6dbf('0x31')],_0x3b9cf4);}return _0x55d3c0[_0x6dbf('0x20')]('Contact')[_0x6dbf('0x24')](_0x337949,_0x4eeb6a)[_0x6dbf('0x28')](function(_0x42bd89){if(_0x42bd89&&_0x42bd89[_0x6dbf('0x33')]){return _0x42bd89;}else{var _0x215f1f=_[_0x6dbf('0x2e')](_0x5f3eea);if(_0x31db5f[_0x6dbf('0x34')]){var _0x373bba={};_0x373bba[_0x31db5f[_0x6dbf('0x34')]]=_0x6359be;_[_0x6dbf('0x30')](_0x215f1f[_0x6dbf('0x31')],_0x373bba);}return _0x55d3c0[_0x6dbf('0x20')](_0x6dbf('0x35'))[_0x6dbf('0x24')](_0x215f1f,_0x4eeb6a);}});}});case _0x6dbf('0x1a'):var _0x31e241=_[_0x6dbf('0x2e')](_0x5f3eea);if(_0x31db5f[_0x6dbf('0x2f')]){var _0x43e6b0={};_0x43e6b0[_0x31db5f[_0x6dbf('0x2f')]]=_0x6359be;_[_0x6dbf('0x30')](_0x31e241[_0x6dbf('0x31')],_0x43e6b0);}return _0x55d3c0[_0x6dbf('0x20')](_0x6dbf('0x32'))['find'](_0x31e241,_0x4eeb6a)[_0x6dbf('0x38')]();case _0x6dbf('0x15'):var _0x157a45=_[_0x6dbf('0x2e')](_0x5f3eea);if(_0x31db5f['additionalSearchLead']){var _0x43e6b0={};_0x43e6b0[_0x31db5f['additionalSearchLead']]=_0x6359be;_['merge'](_0x157a45[_0x6dbf('0x31')],_0x43e6b0);}return _0x55d3c0['sobject'](_0x6dbf('0x35'))[_0x6dbf('0x24')](_0x157a45,_0x4eeb6a);case'account':var _0x179f21=_[_0x6dbf('0x2e')](_0x5f3eea);if(_0x31db5f['additionalSearchAccount']){var _0x43e6b0={};_0x43e6b0[_0x31db5f[_0x6dbf('0x36')]]=_0x6359be;_[_0x6dbf('0x30')](_0x179f21['$or'],_0x43e6b0);}return _0x55d3c0['sobject'](_0x6dbf('0x37'))['find'](_0x179f21,_0x4eeb6a);default:return null;}})[_0x6dbf('0x28')](function(_0x317fdb){if(_0x317fdb&&_0x317fdb[_0x6dbf('0x33')]){var _0x3443f5=_[_0x6dbf('0x39')](_0x317fdb);if(_0x3443f5){return BPromise[_0x6dbf('0x29')]({'id':_0x3443f5['Id'],'name':_0x3443f5[_0x6dbf('0x26')],'phone':_0x3443f5[_0x6dbf('0x3a')],'endUserType':_0x3443f5[_0x6dbf('0x3b')][_0x6dbf('0x3c')][_0x6dbf('0x3d')]()});}}})[_0x6dbf('0x28')](function(_0x4e2602){if(_0x4e2602){logger[_0x6dbf('0x1e')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x4e2602[_0x6dbf('0x14')],_0x6359be);return BPromise[_0x6dbf('0x29')](_0x4e2602);}else{logger['info'](_0x6dbf('0x3e'),_0x6359be);var _0x3308a3={'Phone':_0x6359be};if(_0x31db5f[_0x6dbf('0x3f')]){if(_0x31db5f['moduleCreate']===_0x6dbf('0x1a')){logger[_0x6dbf('0x1e')](_0x6dbf('0x40'),_0x6359be,_0x31db5f[_0x6dbf('0x3f')]);_0x3308a3[_0x6dbf('0x41')]=_0x3bdfa0!==''?_0x3bdfa0:util[_0x6dbf('0x42')](_0x6dbf('0x43'),_0x6359be);}else if(_0x31db5f['moduleCreate']===_0x6dbf('0x15')){logger[_0x6dbf('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x6359be,_0x31db5f['moduleCreate']);_0x3308a3[_0x6dbf('0x41')]=_0x3bdfa0!==''?_0x3bdfa0:util[_0x6dbf('0x42')](_0x6dbf('0x43'),_0x6359be);_0x3308a3[_0x6dbf('0x44')]='No\x20Company';}else if(_0x31db5f[_0x6dbf('0x3f')]===_0x6dbf('0x17')){logger[_0x6dbf('0x1e')](_0x6dbf('0x40'),_0x6359be,_0x31db5f[_0x6dbf('0x3f')]);_0x3308a3[_0x6dbf('0x26')]=_0x3bdfa0!==_0x6dbf('0x45')?_0x3bdfa0:util['format'](_0x6dbf('0x43'),_0x6359be);}else{return null;}}return _0x55d3c0[_0x6dbf('0x20')](_[_0x6dbf('0x46')](_0x31db5f['moduleCreate']))[_0x6dbf('0x21')](_0x3308a3)[_0x6dbf('0x28')](function(_0x537a91){return BPromise[_0x6dbf('0x29')]({'id':_0x537a91['id'],'endUserType':_0x31db5f[_0x6dbf('0x3f')]});});}});}function getCustomFields(_0x2a9f2a,_0x55074a){var _0x4718f6={};if(_0x2a9f2a[_0x6dbf('0x33')]>0x0){_[_0x6dbf('0x47')](_0x2a9f2a,function(_0x7de75e){if(_[_0x6dbf('0x48')](['string','picklist'],_0x7de75e[_0x6dbf('0x3c')])&&_0x7de75e[_0x6dbf('0x49')]){_0x4718f6[_0x7de75e['idField']]=_0x7de75e[_0x6dbf('0x4a')][_0x6dbf('0x4b')]();}else if(_0x7de75e[_0x6dbf('0x3c')]==='variable'&&_0x7de75e[_0x6dbf('0x4c')]&&_0x7de75e[_0x6dbf('0x49')]){_0x55074a[_0x7de75e['variableName']]&&(_0x4718f6[_0x7de75e[_0x6dbf('0x49')]]=_0x55074a[_0x7de75e[_0x6dbf('0x4c')]][_0x6dbf('0x4b')]());}else if(_0x7de75e[_0x6dbf('0x3c')]===_0x6dbf('0x4d')&&_0x7de75e['Variable']&&_0x7de75e[_0x6dbf('0x4e')][_0x6dbf('0x4f')]&&_0x7de75e['idField']){_0x55074a[_0x7de75e[_0x6dbf('0x4e')][_0x6dbf('0x4f')]['toLowerCase']()]&&(_0x4718f6[_0x7de75e['idField']]=_0x55074a[_0x7de75e[_0x6dbf('0x4e')][_0x6dbf('0x4f')][_0x6dbf('0x3d')]()]['toString']());}});}return _0x4718f6;}function getConnection(_0x111816){var _0x3732ca=_0x111816[_0x6dbf('0x50')]['concat'](_0x111816[_0x6dbf('0x51')]);var _0x4c82e4=new jsforce['Connection']({'oauth2':{'loginUrl':_0x111816[_0x6dbf('0x52')]||_0x6dbf('0x53'),'clientId':_0x111816['clientId'],'clientSecret':_0x111816[_0x6dbf('0x54')]}});return _0x4c82e4[_0x6dbf('0x55')](_0x111816['username'],_0x3732ca)[_0x6dbf('0x28')](function(){logger['info']('Connection\x20established.');return _0x4c82e4;});}exports[_0x6dbf('0x56')]=function(_0x7c18c1,_0x30ca30,_0x39feb0,_0x31a640,_0x4c4e7e,_0x4758e7){var _0x5919c5,_0x196f86,_0x462a50,_0x4e18ee;_0x4758e7['serverUrl']=intUtil['stripTrailingSlash'](_0x4758e7[_0x6dbf('0x57')]);_0x4758e7[_0x6dbf('0x52')]=intUtil['stripTrailingSlash'](_0x4758e7['remoteUri']);if(_0x4c4e7e&&_0x4c4e7e['monitor_format']){logger[_0x6dbf('0x1e')](_0x6dbf('0x58'),_0x6dbf('0x59'));_0x30ca30[_0x6dbf('0x5a')]=util[_0x6dbf('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4758e7[_0x6dbf('0x57')],_0x30ca30[_0x6dbf('0x5b')],md5(_0x30ca30[_0x6dbf('0x5b')]));}else{_0x30ca30[_0x6dbf('0x5a')]='';}return getConnection(_0x4758e7)[_0x6dbf('0x28')](function(_0x2ff969){_0x4e18ee=_0x2ff969;return getUser(_0x4758e7,_0x31a640['email'],_0x4e18ee);})[_0x6dbf('0x28')](function(_0x533ec9){_0x5919c5=_0x533ec9;return getEndUser(_0x4758e7,_0x39feb0,_0x30ca30['calleridname'],_0x30ca30[_0x6dbf('0x5c')],_0x4e18ee);})[_0x6dbf('0x28')](function(_0x46fe11){_0x196f86=_0x46fe11;return getTicket(_0x4758e7,_0x5919c5,_0x196f86,_0x39feb0,_0x30ca30,_0x39feb0['Fields'],_0x4e18ee,_0x6dbf('0x56'));})[_0x6dbf('0x28')](function(_0x314666){_0x462a50=_0x314666;logger[_0x6dbf('0x1e')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x462a50['id']);logger[_0x6dbf('0x1e')](_0x6dbf('0x5d'),_0x462a50['id'],_0x31a640[_0x6dbf('0x4f')],_0x4758e7[_0x6dbf('0x3c')]);switch(_0x4758e7[_0x6dbf('0x3c')]){case'integrationTab':emit(util[_0x6dbf('0x42')](_0x6dbf('0x5e'),_0x31a640[_0x6dbf('0x4f')]),_0x6dbf('0x5f'),{'recordId':_0x462a50['id']});break;case _0x6dbf('0x60'):emit(util[_0x6dbf('0x42')](_0x6dbf('0x5e'),_0x31a640['name']),_0x6dbf('0x61'),{'uri':util['format'](_0x6dbf('0x62'),_0x4e18ee[_0x6dbf('0x63')],_0x462a50['id'])});break;default:logger['error'](_0x6dbf('0x64'));}})[_0x6dbf('0x65')](function(_0x61815f){logger[_0x6dbf('0x66')](_0x6dbf('0x58'),_0x61815f);});};exports[_0x6dbf('0x67')]=function(_0x273abf,_0x3805ad,_0x5a4c32,_0x155d96,_0x7f4de5,_0x5059a9,_0x30d424){var _0x4fcd4f,_0x423f83,_0x323c0a,_0x1845b0;_0x5059a9['serverUrl']=intUtil['stripTrailingSlash'](_0x5059a9[_0x6dbf('0x57')]);_0x5059a9[_0x6dbf('0x52')]=intUtil['stripTrailingSlash'](_0x5059a9[_0x6dbf('0x52')]);if(_0x30d424&&_0x30d424['recordingFormat']&&_0x30d424['recordingFormat']!==_0x6dbf('0x68')){logger[_0x6dbf('0x1e')](_0x6dbf('0x69'),_0x6dbf('0x59'));_0x3805ad['recordingURL']=util[_0x6dbf('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5059a9[_0x6dbf('0x57')],_0x3805ad[_0x6dbf('0x5b')],md5(_0x3805ad[_0x6dbf('0x5b')]));}return getConnection(_0x5059a9)[_0x6dbf('0x28')](function(_0x206db9){_0x1845b0=_0x206db9;return getUser(_0x5059a9,_0x155d96[_0x6dbf('0x6a')],_0x1845b0);})[_0x6dbf('0x28')](function(_0x387517){_0x4fcd4f=_0x387517;return getEndUser(_0x5059a9,_0x5a4c32,_0x3805ad[_0x6dbf('0x6b')],_0x3805ad[_0x6dbf('0x6c')],_0x1845b0);})[_0x6dbf('0x28')](function(_0x27e4d6){_0x423f83=_0x27e4d6;return getTicket(_0x5059a9,_0x4fcd4f,_0x423f83,_0x5a4c32,_0x3805ad,_0x5a4c32['Fields'],_0x1845b0,_0x6dbf('0x67'));})[_0x6dbf('0x28')](function(_0x14a829){_0x323c0a=_0x14a829;logger[_0x6dbf('0x1e')](_0x6dbf('0x6d'),_0x323c0a['id']);logger[_0x6dbf('0x1e')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x323c0a['id'],_0x155d96[_0x6dbf('0x4f')],_0x5059a9[_0x6dbf('0x3c')]);switch(_0x5059a9[_0x6dbf('0x3c')]){case _0x6dbf('0x6e'):emit(util[_0x6dbf('0x42')]('user:%s',_0x155d96[_0x6dbf('0x4f')]),_0x6dbf('0x5f'),{'recordId':_0x323c0a['id']});break;case _0x6dbf('0x60'):emit(util[_0x6dbf('0x42')]('user:%s',_0x155d96['name']),_0x6dbf('0x61'),{'uri':util[_0x6dbf('0x42')](_0x6dbf('0x62'),_0x1845b0['instanceUrl'],_0x323c0a['id'])});break;default:logger[_0x6dbf('0x66')](_0x6dbf('0x69'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x6dbf('0x65')](function(_0x1a52b8){logger[_0x6dbf('0x66')](_0x6dbf('0x69'),_0x1a52b8);});};exports[_0x6dbf('0x6f')]=function(_0x2a5867,_0x13cd0e,_0x5dbc78,_0x3f8764,_0x3c28a7,_0x25d235){var _0xa4b2d5,_0x1bce0e,_0xd9e860,_0x206a09;_0x25d235[_0x6dbf('0x57')]=intUtil[_0x6dbf('0x70')](_0x25d235['serverUrl']);_0x25d235['remoteUri']=intUtil[_0x6dbf('0x70')](_0x25d235['remoteUri']);if(_0x3c28a7&&_0x3c28a7[_0x6dbf('0x71')]){logger[_0x6dbf('0x1e')]('['+_0x13cd0e[_0x6dbf('0x72')][_0x6dbf('0x73')]()+']',_0x6dbf('0x59'));_0x13cd0e[_0x6dbf('0x5a')]=util['format'](_0x6dbf('0x74'),_0x25d235[_0x6dbf('0x57')],_0x13cd0e['uniqueid'],md5(_0x13cd0e[_0x6dbf('0x5b')]));}else{_0x13cd0e[_0x6dbf('0x5a')]='';}return getConnection(_0x25d235)[_0x6dbf('0x28')](function(_0xfd7328){_0x206a09=_0xfd7328;if(!_[_0x6dbf('0x75')](_0x3f8764)){return getUser(_0x25d235,_0x3f8764[_0x6dbf('0x4f')],_0x206a09);}else{return getUser(_0x25d235,null,_0x206a09);}})[_0x6dbf('0x28')](function(_0x16015f){_0xa4b2d5=_0x16015f;return getEndUser(_0x25d235,_0x5dbc78,_0x13cd0e[_0x6dbf('0x76')],_0x13cd0e['calleridnum'],_0x206a09);})[_0x6dbf('0x28')](function(_0x20649b){_0x1bce0e=_0x20649b;return getTicket(_0x25d235,_0xa4b2d5,_0x1bce0e,_0x5dbc78,_0x13cd0e,_0x5dbc78[_0x6dbf('0x77')],_0x206a09);})['then'](function(_0x2bf831){_0xd9e860=_0x2bf831;logger[_0x6dbf('0x1e')]('['+_0x13cd0e[_0x6dbf('0x72')][_0x6dbf('0x73')]()+_0x6dbf('0x78'),_0xd9e860['id']);logger[_0x6dbf('0x1e')]('['+_0x13cd0e[_0x6dbf('0x72')][_0x6dbf('0x73')]()+_0x6dbf('0x79'),_0x25d235[_0x6dbf('0x3c')]);})[_0x6dbf('0x65')](function(_0xa119d9){logger[_0x6dbf('0x66')]('['+_0x13cd0e[_0x6dbf('0x72')][_0x6dbf('0x73')]()+']',_0xa119d9);});}; \ 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 2fa7665..b68cb76 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 _0xb5c2=['Variable','name',']\x20getTicket\x20input\x20crm','POST','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','ticketNumber','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','forEach','push','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','ioredis','./util','../../../../config/logger','servicenow','defaults','localhost','socket.io-emitter','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','result','sys_id','info','],\x20getAdminUser\x20crm','error','toUpperCase','message','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','sys_user?','user','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','includes','string','customField','nameField','toLowerCase','content','toString','type','idField','variable','variableName'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb5c2,0x111));var _0x2b5c=function(_0x366871,_0x3b4c4e){_0x366871=_0x366871-0x0;var _0x1a9f90=_0xb5c2[_0x366871];return _0x1a9f90;};'use strict';var _=require(_0x2b5c('0x0'));var Promise=require('bluebird');var rp=require(_0x2b5c('0x1'));var util=require(_0x2b5c('0x2'));var md5=require('md5');var Redis=require(_0x2b5c('0x3'));var intUtil=require(_0x2b5c('0x4'));var config=require('../../../../config/environment');var logger=require(_0x2b5c('0x5'))(_0x2b5c('0x6'));config['redis']=_[_0x2b5c('0x7')](config['redis'],{'host':_0x2b5c('0x8'),'port':0x18eb});var io=require(_0x2b5c('0x9'))(new Redis(config[_0x2b5c('0xa')]));function getAdminUser(_0x1898f5,_0x564ae4,_0xfd7979,_0x2d1c06,_0x8b843d,_0x252251){return new Promise(function(_0x5238e2,_0x33fb2a){var _0x1a27c3={'method':_0x2b5c('0xb'),'uri':_0x2d1c06+_0x2b5c('0xc')+'&'+_0x8b843d+'&'+_0x252251,'auth':_0x564ae4,'json':!![]};return rp(_0x1a27c3)[_0x2b5c('0xd')](function(_0x1c29be){if(_0x1c29be['result'][_0x2b5c('0xe')]>0x0){_0xfd7979['adminId']=_0x1c29be[_0x2b5c('0xf')][0x0][_0x2b5c('0x10')];}logger[_0x2b5c('0x11')]('['+[_0x1898f5['toUpperCase']()]+_0x2b5c('0x12'),_0xfd7979);_0x5238e2(_0xfd7979);})['catch'](function(_0x2d9766){logger[_0x2b5c('0x13')]('['+[_0x1898f5[_0x2b5c('0x14')]()]+']',_0x2d9766[_0x2b5c('0x15')]);_0x33fb2a(_0x2d9766[_0x2b5c('0x15')]);});});}function getUser(_0x58bc44,_0x530fd4,_0x2e233d,_0x14654b,_0x4f2802){return function(_0x1f10c9){logger[_0x2b5c('0x11')]('['+[_0x58bc44[_0x2b5c('0x14')]()]+_0x2b5c('0x16'),_0x1f10c9);return new Promise(function(_0x40f91c,_0x365061){if(intUtil['validateEmail'](_0x1f10c9[_0x2b5c('0x17')])){var _0x118b77={'method':_0x2b5c('0xb'),'uri':_0x2e233d+'sys_user?sysparm_query=email%3D'+_0x1f10c9[_0x2b5c('0x17')]+'&'+_0x14654b+'&'+_0x4f2802,'auth':_0x530fd4,'json':!![]};logger[_0x2b5c('0x11')]('['+[_0x58bc44[_0x2b5c('0x14')]()]+_0x2b5c('0x18'),_0x118b77);return rp(_0x118b77)[_0x2b5c('0xd')](function(_0x3c0b1c){logger[_0x2b5c('0x11')]('['+[_0x58bc44['toUpperCase']()]+_0x2b5c('0x19'),_0x3c0b1c);if(_0x3c0b1c[_0x2b5c('0xf')]['length']>0x0&&String(_0x3c0b1c[_0x2b5c('0xf')][0x0][_0x2b5c('0x1a')])===_0x2b5c('0x1b')){_0x1f10c9['userId']=_0x3c0b1c[_0x2b5c('0xf')][0x0][_0x2b5c('0x10')];}else{_0x1f10c9[_0x2b5c('0x1c')]=_0x1f10c9[_0x2b5c('0x1d')];_0x1f10c9[_0x2b5c('0x17')]=_0x1f10c9[_0x2b5c('0x1e')];}logger[_0x2b5c('0x11')]('['+[_0x58bc44['toUpperCase']()]+_0x2b5c('0x1f'),_0x1f10c9);_0x40f91c(_0x1f10c9);})[_0x2b5c('0x20')](function(_0x4e17f8){logger[_0x2b5c('0x13')]('['+[_0x58bc44[_0x2b5c('0x14')]()]+']',_0x4e17f8[_0x2b5c('0x15')]);_0x365061(_0x4e17f8[_0x2b5c('0x15')]);});}else{logger['info']('['+[_0x58bc44[_0x2b5c('0x14')]()]+_0x2b5c('0x21'));_0x1f10c9['userId']=_0x1f10c9[_0x2b5c('0x1d')];_0x1f10c9[_0x2b5c('0x17')]=_0x1f10c9['adminEmail'];_0x40f91c(_0x1f10c9);}});};}function createEndUser(_0xa2a82f,_0xf4cc0c,_0x2184af,_0x2d6008,_0x311f90){logger[_0x2b5c('0x11')]('['+[_0xa2a82f[_0x2b5c('0x14')]()]+'],\x20createEndUser\x20input\x20crm',_0x2184af);return new Promise(function(_0x41ec33,_0x72c7c1){var _0x47fcf2={'method':'POST','uri':_0x2d6008+_0x2b5c('0x22')+_0x311f90,'body':{'user_name':_0x2184af['endUserNumber'],'roles':_0x2b5c('0x23'),'first_name':_0x2184af[_0x2b5c('0x24')],'active':'true','date_format':'System','phone':_0x2184af[_0x2b5c('0x24')]},'auth':_0xf4cc0c,'json':!![]};return rp(_0x47fcf2)[_0x2b5c('0xd')](function(_0x4a9535){logger[_0x2b5c('0x11')]('['+[_0xa2a82f[_0x2b5c('0x14')]()]+_0x2b5c('0x25'),_0x4a9535[_0x2b5c('0xf')]);_0x2184af[_0x2b5c('0x26')]=_0x4a9535['result'][_0x2b5c('0x10')];_0x41ec33(_0x2184af);})[_0x2b5c('0x20')](function(_0x2adf8b){logger[_0x2b5c('0x13')]('['+[_0xa2a82f[_0x2b5c('0x14')]()]+']',_0x2adf8b[_0x2b5c('0x15')]);_0x72c7c1(_0x2adf8b[_0x2b5c('0x15')]);});});}function getEndUser(_0x3387ce,_0x15ae06,_0x44b8ff,_0x11fd7d,_0x59914d){return function(_0x4596c4){logger[_0x2b5c('0x11')]('['+[_0x3387ce[_0x2b5c('0x14')]()]+_0x2b5c('0x27'),_0x4596c4);return new Promise(function(_0x4ebef9,_0x2ebba3){var _0x264d6b={'method':_0x2b5c('0xb'),'uri':_0x44b8ff+'sys_user?sysparm_query=phone%3D'+_0x4596c4[_0x2b5c('0x24')]+'&'+_0x11fd7d+'&'+_0x59914d,'auth':_0x15ae06,'json':!![]};return rp(_0x264d6b)['then'](function(_0x197ace){if(_0x197ace[_0x2b5c('0xf')][_0x2b5c('0xe')]>0x0){_0x4596c4[_0x2b5c('0x26')]=_0x197ace[_0x2b5c('0xf')][0x0][_0x2b5c('0x10')];logger[_0x2b5c('0x11')]('['+[_0x3387ce[_0x2b5c('0x14')]()]+'],\x20getEndUser\x20crm',_0x4596c4);_0x4ebef9(_0x4596c4);}else{return createEndUser(_0x3387ce,_0x15ae06,_0x4596c4,_0x44b8ff,_0x11fd7d)[_0x2b5c('0xd')](function(_0x49bd75){logger[_0x2b5c('0x11')]('['+[_0x3387ce[_0x2b5c('0x14')]()]+'],\x20createEndUser\x20crm',_0x49bd75);_0x4ebef9(_0x49bd75);});}})[_0x2b5c('0x20')](function(_0x18c316){logger['error']('['+[_0x3387ce[_0x2b5c('0x14')]()]+']',_0x18c316['message']);_0x2ebba3(_0x18c316['message']);});});};}function getCustomFields(_0x1201d5,_0x92c715){var _0x25c52a={};if(_0x1201d5[_0x2b5c('0xe')]>0x0){_['forEach'](_0x1201d5,function(_0x29ccbd){if(_[_0x2b5c('0x28')]([_0x2b5c('0x29'),'picklist'],_0x29ccbd['type'])&&_0x29ccbd['nameField']&&!_0x29ccbd[_0x2b5c('0x2a')]){_0x25c52a[_0x29ccbd[_0x2b5c('0x2b')][_0x2b5c('0x2c')]()]=_0x29ccbd[_0x2b5c('0x2d')][_0x2b5c('0x2e')]();}else if(_['includes']([_0x2b5c('0x29'),'picklist'],_0x29ccbd[_0x2b5c('0x2f')])&&_0x29ccbd[_0x2b5c('0x30')]&&_0x29ccbd[_0x2b5c('0x2a')]){_0x25c52a[_0x29ccbd[_0x2b5c('0x30')][_0x2b5c('0x2c')]()]=_0x29ccbd['content'][_0x2b5c('0x2e')]();}else if(_0x29ccbd[_0x2b5c('0x2f')]===_0x2b5c('0x31')&&_0x29ccbd[_0x2b5c('0x32')]&&_0x29ccbd[_0x2b5c('0x30')]&&_0x29ccbd[_0x2b5c('0x2a')]){_0x25c52a[_0x29ccbd[_0x2b5c('0x30')][_0x2b5c('0x2c')]()]=_0x92c715[_0x29ccbd[_0x2b5c('0x32')]][_0x2b5c('0x2e')]();}else if(_0x29ccbd['type']==='customVariable'&&_0x29ccbd[_0x2b5c('0x33')]&&_0x29ccbd[_0x2b5c('0x33')][_0x2b5c('0x34')]&&_0x29ccbd[_0x2b5c('0x30')]&&_0x29ccbd['customField']){_0x25c52a[_0x29ccbd[_0x2b5c('0x30')][_0x2b5c('0x2c')]()]=_0x92c715[_0x29ccbd['Variable'][_0x2b5c('0x34')][_0x2b5c('0x2c')]()]['toString']();}});}return _0x25c52a;}function getTicket(_0x5f2f5c,_0x5670f2,_0x51a0c2,_0x20bcb9,_0x47220a,_0x356c26){return function(_0x1809eb){logger['info']('['+[_0x5f2f5c[_0x2b5c('0x14')]()]+_0x2b5c('0x35'),_0x1809eb);return new Promise(function(_0x371173,_0x2692ff){var _0x16b4ad=_0x5f2f5c[_0x2b5c('0x2c')]()==='outbound'?_0x1809eb[_0x2b5c('0x1c')]:_0x1809eb[_0x2b5c('0x26')];var _0x18e5fe={'method':_0x2b5c('0x36'),'uri':_0x51a0c2+_0x2b5c('0x37')+'?'+_0x356c26,'body':Object['assign']({},{'active':_0x2b5c('0x1b'),'caller_id':_0x16b4ad,'assigned_to':_0x1809eb[_0x2b5c('0x1c')],'short_description':intUtil[_0x2b5c('0x38')](_0x20bcb9['Subjects'],_0x47220a,'\x20'),'description':intUtil[_0x2b5c('0x38')](_0x20bcb9[_0x2b5c('0x39')],_0x47220a,'\x0a')},getCustomFields(_0x20bcb9[_0x2b5c('0x3a')],_0x47220a)),'auth':_0x5670f2,'json':!![]};return rp(_0x18e5fe)['then'](function(_0x313fa7){logger[_0x2b5c('0x11')]('['+[_0x5f2f5c[_0x2b5c('0x14')]()]+_0x2b5c('0x3b'),_0x313fa7['result']);_0x1809eb['ticketId']=_0x313fa7[_0x2b5c('0xf')][_0x2b5c('0x10')];_0x1809eb['ticketNumber']=_0x313fa7[_0x2b5c('0xf')][_0x2b5c('0x3c')];logger[_0x2b5c('0x11')]('['+[_0x5f2f5c['toUpperCase']()]+_0x2b5c('0x3d'),_0x1809eb);_0x371173(_0x1809eb);})['catch'](function(_0x598602){logger['error']('['+[_0x5f2f5c['toUpperCase']()]+']',_0x598602[_0x2b5c('0x15')]);_0x2692ff(_0x598602[_0x2b5c('0x15')]);});});};}function createRemoteTag(_0xd2399f,_0x4377b4,_0x475b4c,_0xe105e7){return new Promise(function(_0x2e8a87,_0x55d3db){var _0x132eac={'method':_0x2b5c('0x36'),'uri':_0x475b4c+_0x2b5c('0x3e')+'?'+_0xe105e7,'body':{'short_description':_0xd2399f,'global':!![],'active':!![],'name':_0xd2399f},'auth':_0x4377b4,'json':!![]};return rp(_0x132eac)[_0x2b5c('0xd')](function(_0x5665af){var _0x47eac7=_0x5665af[_0x2b5c('0xf')][_0x2b5c('0x10')];_0x2e8a87(_0x47eac7);});});}function getRemoteTag(_0x5ebd30,_0xebfe6e,_0x12843f,_0x23c0e7,_0x3eed61){return new Promise(function(_0x56f83f,_0x5786d4){var _0x5895ab={'method':_0x2b5c('0xb'),'uri':_0x12843f+_0x2b5c('0x3e')+_0x2b5c('0x3f')+_0x5ebd30+'&'+_0x23c0e7,'auth':_0xebfe6e,'json':!![]};return rp(_0x5895ab)[_0x2b5c('0xd')](function(_0x6918d2){if(_0x6918d2[_0x2b5c('0xf')]['length']>0x0){var _0x130dfa=_0x6918d2[_0x2b5c('0xf')][0x0]['sys_id'];_0x56f83f(_0x130dfa);}else{return createRemoteTag(_0x5ebd30,_0xebfe6e,_0x12843f,_0x23c0e7)['then'](function(_0x1288e0){_0x56f83f(_0x1288e0);});}});});}function assignTagToIncident(_0x48f152,_0x133269,_0x4196f3,_0x2d36c3,_0x3886ed){return new Promise(function(_0x4c370e,_0x5a60c3){var _0x4ef43b={'method':_0x2b5c('0x36'),'uri':_0x4196f3+_0x2b5c('0x40')+'?'+_0x3886ed,'body':{'label':_0x48f152,'table':_0x2b5c('0x37'),'id_type':_0x2b5c('0x41'),'table_key':_0x2d36c3[_0x2b5c('0x42')],'title':_0x2b5c('0x43')+_0x2d36c3[_0x2b5c('0x44')],'id_display':_0x2d36c3[_0x2b5c('0x44')]},'auth':_0x133269,'json':!![]};return rp(_0x4ef43b)['then'](function(_0x381c8f){_0x4c370e();})[_0x2b5c('0x20')](function(){_0x4c370e();});});}function manageTags(_0x446950,_0x20f4ed,_0xc029b4,_0x3ef42c,_0x389c47,_0x6e6943,_0x48030d){return new Promise(function(_0x2c67f1,_0x1389ee){var _0x45cc0f=[];_0x20f4ed['forEach'](function(_0x65ac33){_0x45cc0f['push'](getRemoteTag(_0x65ac33,_0xc029b4,_0x3ef42c,_0x6e6943,_0x48030d));});return Promise[_0x2b5c('0x45')](_0x45cc0f)[_0x2b5c('0xd')](function(_0x52b510){if(_0x52b510[_0x2b5c('0xe')]){logger[_0x2b5c('0x11')]('['+[_0x446950[_0x2b5c('0x14')]()]+_0x2b5c('0x46'),_0x52b510);var _0x271d7e=[];_0x52b510[_0x2b5c('0x47')](function(_0x27f4e8){_0x271d7e[_0x2b5c('0x48')](assignTagToIncident(_0x27f4e8,_0xc029b4,_0x3ef42c,_0x389c47,_0x6e6943));});return Promise[_0x2b5c('0x45')](_0x271d7e)[_0x2b5c('0xd')](function(){_0x2c67f1();})[_0x2b5c('0x20')](function(){_0x2c67f1();});}else{_0x2c67f1();}});});}function getTags(_0x14efa8,_0x2557c4,_0x44b854,_0x307ea3,_0x20d22a,_0x15ca5e){return function(_0x42ea58){return new Promise(function(_0x4d86d7,_0x4f849c){var _0x39b1ed=[];var _0x484102=_0x307ea3['Tags'];if(_0x484102&&_0x484102[_0x2b5c('0xe')]>0x0){_0x39b1ed=_[_0x2b5c('0x49')](_0x484102,_0x2b5c('0x34'));}if(_0x39b1ed[_0x2b5c('0xe')]>0x0){return manageTags(_0x14efa8,_0x39b1ed,_0x2557c4,_0x44b854,_0x42ea58,_0x20d22a,_0x15ca5e)[_0x2b5c('0xd')](function(){_0x4d86d7(_0x42ea58);});}else{_0x4d86d7(_0x42ea58);}});};}function emit(_0x15cf1e,_0x204bb2,_0xcd59f3){var _0x587ebf=_0x2b5c('0x4a')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x2b5c('0x4b')+_0x2b5c('0x4c');var _0x5a8404={'uri':_0x15cf1e+_0x2b5c('0x4d')+_0xcd59f3+_0x587ebf};io['to'](util[_0x2b5c('0x4e')](_0x2b5c('0x4f'),_0x204bb2))['emit']('trigger:browser:url',_0x5a8404);}exports['cs']=function(_0x55030d,_0x335da7,_0x5e3c58,_0x5c13ad,_0x54e699,_0xada059,_0x333fbd,_0x186da6){var _0x54d704={};var _0x5424a1={'user':_0xada059[_0x2b5c('0x50')],'pass':_0xada059[_0x2b5c('0x51')]};var _0x1823df=_0x2b5c('0x52');var _0x2dda1b=_0x2b5c('0x53');_0xada059[_0x2b5c('0x54')]=intUtil[_0x2b5c('0x55')](_0xada059[_0x2b5c('0x54')]);_0xada059[_0x2b5c('0x56')]=intUtil[_0x2b5c('0x55')](_0xada059[_0x2b5c('0x56')]);var _0x9b546a=util[_0x2b5c('0x4e')](_0x2b5c('0x57'),_0xada059['remoteUri']);_0x54d704['userEmail']=!_[_0x2b5c('0x58')](_0x5c13ad)?_0x5c13ad[_0x2b5c('0x59')]:null;_0x54d704[_0x2b5c('0x1e')]=_0xada059['email'];_0x54d704[_0x2b5c('0x24')]=_0x186da6[_0x2b5c('0x2c')]()===_0x2b5c('0x5a')?_0x335da7[_0x2b5c('0x5b')]:_0x335da7[_0x2b5c('0x5c')];_0x54d704[_0x2b5c('0x5d')]=_0x186da6===_0x2b5c('0x5e')||_0x186da6===_0x2b5c('0x5f')?_0x2b5c('0x5e'):_0x2b5c('0x5a');var _0x1585c2=util[_0x2b5c('0x4e')](_0x2b5c('0x60'),_0xada059[_0x2b5c('0x56')],_0x335da7['uniqueid'],md5(_0x335da7[_0x2b5c('0x61')]));if(_0x54e699&&_0x54e699['monitor_format']){logger[_0x2b5c('0x11')](_0x2b5c('0x62'),_0x2b5c('0x63'));_0x335da7[_0x2b5c('0x64')]=_0x1585c2;}else if(_0x333fbd&&_0x333fbd['recordingFormat']&&_0x333fbd[_0x2b5c('0x65')]!==_0x2b5c('0x66')){logger[_0x2b5c('0x11')](_0x2b5c('0x67'),_0x2b5c('0x63'));_0x335da7[_0x2b5c('0x64')]=_0x1585c2;}else{_0x335da7['recordingURL']='';}return getAdminUser(_0x186da6,_0x5424a1,_0x54d704,_0x9b546a,_0x2dda1b,_0x1823df)[_0x2b5c('0xd')](getUser(_0x186da6,_0x5424a1,_0x9b546a,_0x2dda1b,_0x1823df))[_0x2b5c('0xd')](getEndUser(_0x186da6,_0x5424a1,_0x9b546a,_0x2dda1b,_0x1823df))[_0x2b5c('0xd')](getTicket(_0x186da6,_0x5424a1,_0x9b546a,_0x5e3c58,_0x335da7,_0x2dda1b))['then'](function(_0x4fe065){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x4fe065[_0x2b5c('0x42')]));logger[_0x2b5c('0x11')](util[_0x2b5c('0x4e')](_0x2b5c('0x68'),_0x186da6));if(_0x186da6!==_0x2b5c('0x5f')){logger[_0x2b5c('0x11')]('['+[_0x186da6[_0x2b5c('0x14')]()]+']',_0x2b5c('0x69'));emit(_0xada059[_0x2b5c('0x54')],_0x5c13ad[_0x2b5c('0x34')],_0x4fe065[_0x2b5c('0x42')]);}})[_0x2b5c('0x20')](function(_0x1e2d46){logger['error']('['+[_0x186da6[_0x2b5c('0x14')]()]+_0x2b5c('0x6a'),util[_0x2b5c('0x6b')](_0x1e2d46,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf3c8=['],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','includes','string','picklist','nameField','customField','toLowerCase','content','toString','idField','type','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','forEach','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','ticketId',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','md5','ioredis','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','true','userId','sys_id','adminEmail','POST','sys_user?','endUserNumber','user','System'];(function(_0x5a2e52,_0x1be639){var _0x12e91c=function(_0x281600){while(--_0x281600){_0x5a2e52['push'](_0x5a2e52['shift']());}};_0x12e91c(++_0x1be639);}(_0xf3c8,0x122));var _0x8f3c=function(_0x3994b8,_0x56a1e7){_0x3994b8=_0x3994b8-0x0;var _0x3e9075=_0xf3c8[_0x3994b8];return _0x3e9075;};'use strict';var _=require(_0x8f3c('0x0'));var Promise=require(_0x8f3c('0x1'));var rp=require('request-promise');var util=require('util');var md5=require(_0x8f3c('0x2'));var Redis=require(_0x8f3c('0x3'));var intUtil=require('./util');var config=require(_0x8f3c('0x4'));var logger=require('../../../../config/logger')(_0x8f3c('0x5'));config[_0x8f3c('0x6')]=_[_0x8f3c('0x7')](config[_0x8f3c('0x6')],{'host':_0x8f3c('0x8'),'port':0x18eb});var io=require(_0x8f3c('0x9'))(new Redis(config[_0x8f3c('0x6')]));function getAdminUser(_0x4c2872,_0x1228b9,_0x2c7ef7,_0x5131f7,_0x21fba0,_0x553049){return new Promise(function(_0x48a57e,_0x37e201){var _0x47f0be={'method':_0x8f3c('0xa'),'uri':_0x5131f7+_0x8f3c('0xb')+'&'+_0x21fba0+'&'+_0x553049,'auth':_0x1228b9,'json':!![]};return rp(_0x47f0be)['then'](function(_0x51fb33){if(_0x51fb33[_0x8f3c('0xc')][_0x8f3c('0xd')]>0x0){_0x2c7ef7[_0x8f3c('0xe')]=_0x51fb33[_0x8f3c('0xc')][0x0]['sys_id'];}logger['info']('['+[_0x4c2872[_0x8f3c('0xf')]()]+_0x8f3c('0x10'),_0x2c7ef7);_0x48a57e(_0x2c7ef7);})[_0x8f3c('0x11')](function(_0x403d6e){logger[_0x8f3c('0x12')]('['+[_0x4c2872[_0x8f3c('0xf')]()]+']',_0x403d6e['message']);_0x37e201(_0x403d6e[_0x8f3c('0x13')]);});});}function getUser(_0x41824b,_0xe81330,_0x563087,_0x5ce9eb,_0x14d1b5){return function(_0x4ff4a2){logger[_0x8f3c('0x14')]('['+[_0x41824b['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x4ff4a2);return new Promise(function(_0x11ad40,_0x484b31){if(intUtil[_0x8f3c('0x15')](_0x4ff4a2[_0x8f3c('0x16')])){var _0x3d3a4e={'method':_0x8f3c('0xa'),'uri':_0x563087+_0x8f3c('0x17')+_0x4ff4a2[_0x8f3c('0x16')]+'&'+_0x5ce9eb+'&'+_0x14d1b5,'auth':_0xe81330,'json':!![]};logger[_0x8f3c('0x14')]('['+[_0x41824b[_0x8f3c('0xf')]()]+_0x8f3c('0x18'),_0x3d3a4e);return rp(_0x3d3a4e)[_0x8f3c('0x19')](function(_0x206c16){logger[_0x8f3c('0x14')]('['+[_0x41824b[_0x8f3c('0xf')]()]+_0x8f3c('0x1a'),_0x206c16);if(_0x206c16[_0x8f3c('0xc')]['length']>0x0&&String(_0x206c16['result'][0x0][_0x8f3c('0x1b')])===_0x8f3c('0x1c')){_0x4ff4a2[_0x8f3c('0x1d')]=_0x206c16[_0x8f3c('0xc')][0x0][_0x8f3c('0x1e')];}else{_0x4ff4a2[_0x8f3c('0x1d')]=_0x4ff4a2[_0x8f3c('0xe')];_0x4ff4a2[_0x8f3c('0x16')]=_0x4ff4a2[_0x8f3c('0x1f')];}logger[_0x8f3c('0x14')]('['+[_0x41824b['toUpperCase']()]+'],\x20getUser\x20crm',_0x4ff4a2);_0x11ad40(_0x4ff4a2);})['catch'](function(_0x4d91cc){logger[_0x8f3c('0x12')]('['+[_0x41824b[_0x8f3c('0xf')]()]+']',_0x4d91cc[_0x8f3c('0x13')]);_0x484b31(_0x4d91cc[_0x8f3c('0x13')]);});}else{logger[_0x8f3c('0x14')]('['+[_0x41824b[_0x8f3c('0xf')]()]+']\x20using\x20admin\x20profile');_0x4ff4a2['userId']=_0x4ff4a2['adminId'];_0x4ff4a2[_0x8f3c('0x16')]=_0x4ff4a2['adminEmail'];_0x11ad40(_0x4ff4a2);}});};}function createEndUser(_0x54ae6f,_0x5ead14,_0x4179ac,_0x51c460,_0x260ba3){logger[_0x8f3c('0x14')]('['+[_0x54ae6f[_0x8f3c('0xf')]()]+'],\x20createEndUser\x20input\x20crm',_0x4179ac);return new Promise(function(_0x42b200,_0x3ae0dd){var _0x532b79={'method':_0x8f3c('0x20'),'uri':_0x51c460+_0x8f3c('0x21')+_0x260ba3,'body':{'user_name':_0x4179ac[_0x8f3c('0x22')],'roles':_0x8f3c('0x23'),'first_name':_0x4179ac[_0x8f3c('0x22')],'active':_0x8f3c('0x1c'),'date_format':_0x8f3c('0x24'),'phone':_0x4179ac[_0x8f3c('0x22')]},'auth':_0x5ead14,'json':!![]};return rp(_0x532b79)[_0x8f3c('0x19')](function(_0x283156){logger[_0x8f3c('0x14')]('['+[_0x54ae6f[_0x8f3c('0xf')]()]+_0x8f3c('0x25'),_0x283156['result']);_0x4179ac[_0x8f3c('0x26')]=_0x283156[_0x8f3c('0xc')][_0x8f3c('0x1e')];_0x42b200(_0x4179ac);})[_0x8f3c('0x11')](function(_0x2d3e07){logger[_0x8f3c('0x12')]('['+[_0x54ae6f[_0x8f3c('0xf')]()]+']',_0x2d3e07[_0x8f3c('0x13')]);_0x3ae0dd(_0x2d3e07[_0x8f3c('0x13')]);});});}function getEndUser(_0xa7d66e,_0x243187,_0x2eafbb,_0x456c33,_0x196004){return function(_0xd2302d){logger[_0x8f3c('0x14')]('['+[_0xa7d66e[_0x8f3c('0xf')]()]+_0x8f3c('0x27'),_0xd2302d);return new Promise(function(_0x13aa3e,_0x1b0ecf){var _0x3cc8ca={'method':_0x8f3c('0xa'),'uri':_0x2eafbb+'sys_user?sysparm_query=phone%3D'+_0xd2302d[_0x8f3c('0x22')]+'&'+_0x456c33+'&'+_0x196004,'auth':_0x243187,'json':!![]};return rp(_0x3cc8ca)['then'](function(_0x5868ef){if(_0x5868ef[_0x8f3c('0xc')][_0x8f3c('0xd')]>0x0){_0xd2302d[_0x8f3c('0x26')]=_0x5868ef[_0x8f3c('0xc')][0x0][_0x8f3c('0x1e')];logger[_0x8f3c('0x14')]('['+[_0xa7d66e['toUpperCase']()]+_0x8f3c('0x28'),_0xd2302d);_0x13aa3e(_0xd2302d);}else{return createEndUser(_0xa7d66e,_0x243187,_0xd2302d,_0x2eafbb,_0x456c33)[_0x8f3c('0x19')](function(_0x10895b){logger[_0x8f3c('0x14')]('['+[_0xa7d66e['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x10895b);_0x13aa3e(_0x10895b);});}})[_0x8f3c('0x11')](function(_0x2babb0){logger[_0x8f3c('0x12')]('['+[_0xa7d66e[_0x8f3c('0xf')]()]+']',_0x2babb0[_0x8f3c('0x13')]);_0x1b0ecf(_0x2babb0['message']);});});};}function getCustomFields(_0x11cc15,_0x511969){var _0x1a0796={};if(_0x11cc15['length']>0x0){_['forEach'](_0x11cc15,function(_0x1d5e1e){if(_[_0x8f3c('0x29')]([_0x8f3c('0x2a'),_0x8f3c('0x2b')],_0x1d5e1e['type'])&&_0x1d5e1e[_0x8f3c('0x2c')]&&!_0x1d5e1e[_0x8f3c('0x2d')]){_0x1a0796[_0x1d5e1e['nameField'][_0x8f3c('0x2e')]()]=_0x1d5e1e[_0x8f3c('0x2f')][_0x8f3c('0x30')]();}else if(_[_0x8f3c('0x29')]([_0x8f3c('0x2a'),_0x8f3c('0x2b')],_0x1d5e1e['type'])&&_0x1d5e1e[_0x8f3c('0x31')]&&_0x1d5e1e[_0x8f3c('0x2d')]){_0x1a0796[_0x1d5e1e[_0x8f3c('0x31')][_0x8f3c('0x2e')]()]=_0x1d5e1e['content'][_0x8f3c('0x30')]();}else if(_0x1d5e1e[_0x8f3c('0x32')]===_0x8f3c('0x33')&&_0x1d5e1e['variableName']&&_0x1d5e1e[_0x8f3c('0x31')]&&_0x1d5e1e[_0x8f3c('0x2d')]){_0x1a0796[_0x1d5e1e[_0x8f3c('0x31')]['toLowerCase']()]=_0x511969[_0x1d5e1e[_0x8f3c('0x34')]][_0x8f3c('0x30')]();}else if(_0x1d5e1e[_0x8f3c('0x32')]===_0x8f3c('0x35')&&_0x1d5e1e[_0x8f3c('0x36')]&&_0x1d5e1e[_0x8f3c('0x36')][_0x8f3c('0x37')]&&_0x1d5e1e[_0x8f3c('0x31')]&&_0x1d5e1e['customField']){_0x1a0796[_0x1d5e1e[_0x8f3c('0x31')][_0x8f3c('0x2e')]()]=_0x511969[_0x1d5e1e['Variable']['name']['toLowerCase']()][_0x8f3c('0x30')]();}});}return _0x1a0796;}function getTicket(_0x12d7ad,_0x333d6a,_0x28c020,_0x37807d,_0x3733ca,_0x4582ff){return function(_0x4deeef){logger[_0x8f3c('0x14')]('['+[_0x12d7ad[_0x8f3c('0xf')]()]+_0x8f3c('0x38'),_0x4deeef);return new Promise(function(_0x536e0f,_0x5cc5fa){var _0x274475=_0x12d7ad[_0x8f3c('0x2e')]()===_0x8f3c('0x39')?_0x4deeef[_0x8f3c('0x1d')]:_0x4deeef[_0x8f3c('0x26')];var _0x29373c={'method':_0x8f3c('0x20'),'uri':_0x28c020+_0x8f3c('0x3a')+'?'+_0x4582ff,'body':Object['assign']({},{'active':'true','caller_id':_0x274475,'assigned_to':_0x4deeef[_0x8f3c('0x1d')],'short_description':intUtil[_0x8f3c('0x3b')](_0x37807d[_0x8f3c('0x3c')],_0x3733ca,'\x20'),'description':intUtil[_0x8f3c('0x3b')](_0x37807d[_0x8f3c('0x3d')],_0x3733ca,'\x0a')},getCustomFields(_0x37807d[_0x8f3c('0x3e')],_0x3733ca)),'auth':_0x333d6a,'json':!![]};return rp(_0x29373c)[_0x8f3c('0x19')](function(_0x35da10){logger[_0x8f3c('0x14')]('['+[_0x12d7ad[_0x8f3c('0xf')]()]+_0x8f3c('0x3f'),_0x35da10[_0x8f3c('0xc')]);_0x4deeef['ticketId']=_0x35da10[_0x8f3c('0xc')][_0x8f3c('0x1e')];_0x4deeef[_0x8f3c('0x40')]=_0x35da10['result'][_0x8f3c('0x41')];logger['info']('['+[_0x12d7ad[_0x8f3c('0xf')]()]+']\x20getTicket\x20crm',_0x4deeef);_0x536e0f(_0x4deeef);})[_0x8f3c('0x11')](function(_0x2b0d48){logger[_0x8f3c('0x12')]('['+[_0x12d7ad[_0x8f3c('0xf')]()]+']',_0x2b0d48[_0x8f3c('0x13')]);_0x5cc5fa(_0x2b0d48['message']);});});};}function createRemoteTag(_0x2765ed,_0x4aeaae,_0x2c9e44,_0x33f308){return new Promise(function(_0x26c18e,_0x594287){var _0x4b7de7={'method':_0x8f3c('0x20'),'uri':_0x2c9e44+_0x8f3c('0x42')+'?'+_0x33f308,'body':{'short_description':_0x2765ed,'global':!![],'active':!![],'name':_0x2765ed},'auth':_0x4aeaae,'json':!![]};return rp(_0x4b7de7)[_0x8f3c('0x19')](function(_0x43dcb0){var _0x3b44c6=_0x43dcb0[_0x8f3c('0xc')][_0x8f3c('0x1e')];_0x26c18e(_0x3b44c6);});});}function getRemoteTag(_0x1fcd50,_0x28b087,_0x10596b,_0x4ef328,_0xe8f0cf){return new Promise(function(_0x40586e,_0x4eaefa){var _0x4c0004={'method':_0x8f3c('0xa'),'uri':_0x10596b+_0x8f3c('0x42')+_0x8f3c('0x43')+_0x1fcd50+'&'+_0x4ef328,'auth':_0x28b087,'json':!![]};return rp(_0x4c0004)[_0x8f3c('0x19')](function(_0x27c1c1){if(_0x27c1c1[_0x8f3c('0xc')][_0x8f3c('0xd')]>0x0){var _0xbb489d=_0x27c1c1[_0x8f3c('0xc')][0x0]['sys_id'];_0x40586e(_0xbb489d);}else{return createRemoteTag(_0x1fcd50,_0x28b087,_0x10596b,_0x4ef328)['then'](function(_0x53d486){_0x40586e(_0x53d486);});}});});}function assignTagToIncident(_0x57aec0,_0x2296c7,_0x698c4b,_0xb5b9d2,_0x2b5f40){return new Promise(function(_0x46282f,_0x564b94){var _0x593db5={'method':_0x8f3c('0x20'),'uri':_0x698c4b+'label_entry'+'?'+_0x2b5f40,'body':{'label':_0x57aec0,'table':_0x8f3c('0x3a'),'id_type':_0x8f3c('0x44'),'table_key':_0xb5b9d2['ticketId'],'title':_0x8f3c('0x45')+_0xb5b9d2[_0x8f3c('0x40')],'id_display':_0xb5b9d2[_0x8f3c('0x40')]},'auth':_0x2296c7,'json':!![]};return rp(_0x593db5)['then'](function(_0x3e8346){_0x46282f();})['catch'](function(){_0x46282f();});});}function manageTags(_0x134f8c,_0x339916,_0x332c99,_0x45d97e,_0x24aa28,_0x5ec1c4,_0x6998cc){return new Promise(function(_0x58860a,_0x517a97){var _0x2e009a=[];_0x339916['forEach'](function(_0x1fc0ab){_0x2e009a[_0x8f3c('0x46')](getRemoteTag(_0x1fc0ab,_0x332c99,_0x45d97e,_0x5ec1c4,_0x6998cc));});return Promise['all'](_0x2e009a)[_0x8f3c('0x19')](function(_0x10a7f1){if(_0x10a7f1[_0x8f3c('0xd')]){logger[_0x8f3c('0x14')]('['+[_0x134f8c[_0x8f3c('0xf')]()]+_0x8f3c('0x47'),_0x10a7f1);var _0x2d5019=[];_0x10a7f1[_0x8f3c('0x48')](function(_0x9e3d3c){_0x2d5019[_0x8f3c('0x46')](assignTagToIncident(_0x9e3d3c,_0x332c99,_0x45d97e,_0x24aa28,_0x5ec1c4));});return Promise[_0x8f3c('0x49')](_0x2d5019)['then'](function(){_0x58860a();})[_0x8f3c('0x11')](function(){_0x58860a();});}else{_0x58860a();}});});}function getTags(_0x36ebeb,_0x5da73b,_0x44a909,_0xfe50ee,_0x4dc3ca,_0x2f4ff4){return function(_0x5d30f3){return new Promise(function(_0x4a0abf,_0x52a302){var _0x4a7d13=[];var _0x2d6a60=_0xfe50ee['Tags'];if(_0x2d6a60&&_0x2d6a60[_0x8f3c('0xd')]>0x0){_0x4a7d13=_[_0x8f3c('0x4a')](_0x2d6a60,_0x8f3c('0x37'));}if(_0x4a7d13[_0x8f3c('0xd')]>0x0){return manageTags(_0x36ebeb,_0x4a7d13,_0x5da73b,_0x44a909,_0x5d30f3,_0x4dc3ca,_0x2f4ff4)[_0x8f3c('0x19')](function(){_0x4a0abf(_0x5d30f3);});}else{_0x4a0abf(_0x5d30f3);}});};}function emit(_0x1fbf0f,_0x4ae31d,_0x1ee287){var _0x48be5f=_0x8f3c('0x4b')+_0x8f3c('0x4c')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x49a081={'uri':_0x1fbf0f+_0x8f3c('0x4d')+_0x1ee287+_0x48be5f};io['to'](util[_0x8f3c('0x4e')](_0x8f3c('0x4f'),_0x4ae31d))[_0x8f3c('0x50')]('trigger:browser:url',_0x49a081);}exports['cs']=function(_0x27355f,_0x1836fd,_0x893076,_0x30f8ba,_0x460ce1,_0x499e24,_0x252b02,_0x1ecef1){var _0x1bf41d={};var _0x511aa4={'user':_0x499e24[_0x8f3c('0x51')],'pass':_0x499e24[_0x8f3c('0x52')]};var _0x1b315d=_0x8f3c('0x53');var _0x5b2f7e=_0x8f3c('0x54');_0x499e24[_0x8f3c('0x55')]=intUtil[_0x8f3c('0x56')](_0x499e24[_0x8f3c('0x55')]);_0x499e24[_0x8f3c('0x57')]=intUtil[_0x8f3c('0x56')](_0x499e24[_0x8f3c('0x57')]);var _0x4f7900=util['format'](_0x8f3c('0x58'),_0x499e24[_0x8f3c('0x55')]);_0x1bf41d['userEmail']=!_[_0x8f3c('0x59')](_0x30f8ba)?_0x30f8ba[_0x8f3c('0x5a')]:null;_0x1bf41d[_0x8f3c('0x1f')]=_0x499e24['email'];_0x1bf41d[_0x8f3c('0x22')]=_0x1ecef1[_0x8f3c('0x2e')]()===_0x8f3c('0x39')?_0x1836fd[_0x8f3c('0x5b')]:_0x1836fd[_0x8f3c('0x5c')];_0x1bf41d[_0x8f3c('0x5d')]=_0x1ecef1===_0x8f3c('0x5e')||_0x1ecef1===_0x8f3c('0x5f')?_0x8f3c('0x5e'):_0x8f3c('0x39');var _0x1d530d=util[_0x8f3c('0x4e')](_0x8f3c('0x60'),_0x499e24[_0x8f3c('0x57')],_0x1836fd[_0x8f3c('0x61')],md5(_0x1836fd[_0x8f3c('0x61')]));if(_0x460ce1&&_0x460ce1[_0x8f3c('0x62')]){logger[_0x8f3c('0x14')](_0x8f3c('0x63'),_0x8f3c('0x64'));_0x1836fd[_0x8f3c('0x65')]=_0x1d530d;}else if(_0x252b02&&_0x252b02['recordingFormat']&&_0x252b02[_0x8f3c('0x66')]!==_0x8f3c('0x67')){logger['info'](_0x8f3c('0x68'),_0x8f3c('0x64'));_0x1836fd[_0x8f3c('0x65')]=_0x1d530d;}else{_0x1836fd[_0x8f3c('0x65')]='';}return getAdminUser(_0x1ecef1,_0x511aa4,_0x1bf41d,_0x4f7900,_0x5b2f7e,_0x1b315d)['then'](getUser(_0x1ecef1,_0x511aa4,_0x4f7900,_0x5b2f7e,_0x1b315d))[_0x8f3c('0x19')](getEndUser(_0x1ecef1,_0x511aa4,_0x4f7900,_0x5b2f7e,_0x1b315d))[_0x8f3c('0x19')](getTicket(_0x1ecef1,_0x511aa4,_0x4f7900,_0x893076,_0x1836fd,_0x5b2f7e))[_0x8f3c('0x19')](function(_0x4fc4ff){logger[_0x8f3c('0x14')](util[_0x8f3c('0x4e')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4fc4ff['ticketId']));logger[_0x8f3c('0x14')](util['format'](_0x8f3c('0x69'),_0x1ecef1));if(_0x1ecef1!==_0x8f3c('0x5f')){logger['info']('['+[_0x1ecef1[_0x8f3c('0xf')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x499e24[_0x8f3c('0x55')],_0x30f8ba['name'],_0x4fc4ff[_0x8f3c('0x6a')]);}})['catch'](function(_0x387ecd){logger['error']('['+[_0x1ecef1['toUpperCase']()]+_0x8f3c('0x6b'),util[_0x8f3c('0x6c')](_0x387ecd,{'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 f28ffad..19fbaf4 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 _0x161e=['idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','get_server_info','isNil','info','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','then','entry_list','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','map','forEach','type','string','nameField','toLowerCase','content','custom_fields','variable','customField','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','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','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','Outbound','contacts','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','push'];(function(_0x51e8ef,_0x4fc690){var _0x2436ec=function(_0x252233){while(--_0x252233){_0x51e8ef['push'](_0x51e8ef['shift']());}};_0x2436ec(++_0x4fc690);}(_0x161e,0x155));var _0xe161=function(_0x5a7677,_0x23630f){_0x5a7677=_0x5a7677-0x0;var _0x2da6ef=_0x161e[_0x5a7677];return _0x2da6ef;};'use strict';var _=require(_0xe161('0x0'));var rp=require(_0xe161('0x1'));var BPromise=require(_0xe161('0x2'));var md5=require('md5');var util=require(_0xe161('0x3'));var Redis=require(_0xe161('0x4'));var intUtil=require('./util');var config=require(_0xe161('0x5'));var logger=require(_0xe161('0x6'))(_0xe161('0x7'));config[_0xe161('0x8')]=_[_0xe161('0x9')](config[_0xe161('0x8')],{'host':_0xe161('0xa'),'port':0x18eb});var io=require(_0xe161('0xb'))(new Redis(config[_0xe161('0x8')]));var def={'method':_0xe161('0xc'),'json':!![]};function emit(_0x29afb0,_0x465683,_0x51960b){io['to'](_0x29afb0)[_0xe161('0xd')](_0x465683,_0x51960b);}function getTicket(_0x1ad684,_0x2bd84b,_0x2a1ba5,_0x15e0ff,_0x52564c,_0x258bd1,_0x2ef137,_0x5cea9a){logger['info']('Creating\x20new\x20ticket...');var _0x623da1=new Date();var _0x29edd7=[{'name':'name','value':intUtil[_0xe161('0xe')](_0x15e0ff[_0xe161('0xf')],_0x52564c,'\x20')},{'name':_0xe161('0x10'),'value':_0x2bd84b['id']},{'name':_0xe161('0x11'),'value':_0x2bd84b['id']},{'name':_0xe161('0x12'),'value':intUtil['getString'](_0x15e0ff[_0xe161('0x13')],_0x52564c,'\x0a')},{'name':_0xe161('0x14'),'value':_0x623da1[_0xe161('0x15')]()[_0xe161('0x16')](0x0,0x13)[_0xe161('0x17')]('T','\x20')},{'name':_0xe161('0x18'),'value':'0'},{'name':_0xe161('0x19'),'value':'15'},{'name':_0xe161('0x1a'),'value':_0x2a1ba5['id']},{'name':_0xe161('0x1b'),'value':_0xe161('0x1c')},{'name':_0xe161('0x1d'),'value':_0x2a1ba5['name']},{'name':_0xe161('0x1e'),'value':_0x5cea9a}];if(_0x258bd1[_0xe161('0x1f')]){_['forEach'](_0x258bd1,function(_0x2abbdc){if(_0x52564c[_0x2abbdc[_0xe161('0x20')]]){_0x29edd7[_0xe161('0x21')]({'name':_0x2abbdc[_0xe161('0x22')],'value':_0x52564c[_0x2abbdc[_0xe161('0x20')]]});}});}return request({'form':{'method':_0xe161('0x23'),'input_type':_0xe161('0x24'),'response_type':_0xe161('0x24'),'rest_data':JSON[_0xe161('0x25')]({'session':_0x2ef137['id'],'module_name':_0xe161('0x26'),'name_value_list':_0x29edd7})}});}function getAuth(_0x4fb3fc){return util['format'](_0xe161('0x27'),new Buffer(_0x4fb3fc[_0xe161('0x28')]+':X')[_0xe161('0x29')]('base64'));}function getServerInfo(_0x5cdf18){return request({'form':{'method':_0xe161('0x2a'),'input_type':_0xe161('0x24'),'response_type':_0xe161('0x24'),'rest_data':JSON[_0xe161('0x25')]({'session':_0x5cdf18['id']})}});}function getUser(_0x4e72bb,_0x45f6b6,_0x3eb66e){if(!_[_0xe161('0x2b')](_0x45f6b6)){logger[_0xe161('0x2c')]('Getting\x20agent\x20with\x20name',_0x45f6b6);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xe161('0x24'),'rest_data':JSON[_0xe161('0x25')]({'session':_0x3eb66e['id'],'module_name':_0xe161('0x2d'),'query':util['format'](_0xe161('0x2e'),_0x45f6b6),'order_by':'','offset':'0','select_fields':['id',_0xe161('0x2f'),_0xe161('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe161('0x31')](function(_0x141f8d){if(_0x141f8d[_0xe161('0x32')]['length']){var _0x2a308=_['find'](_0x141f8d['entry_list'],function(_0xc278fd){return _0xc278fd[_0xe161('0x33')]['user_name'][_0xe161('0x34')]===_0x45f6b6;});if(_0x2a308){logger[_0xe161('0x2c')](_0xe161('0x35'));return BPromise['resolve']({'id':_0x2a308[_0xe161('0x33')]['id'][_0xe161('0x34')],'name':_0x2a308[_0xe161('0x33')][_0xe161('0x2f')][_0xe161('0x34')]});}}logger[_0xe161('0x2c')](_0xe161('0x36'));return BPromise[_0xe161('0x37')]({'id':_0x3eb66e['name_value_list'][_0xe161('0x38')][_0xe161('0x34')],'name':_0x3eb66e[_0xe161('0x33')][_0xe161('0x30')]['value']});});}else{logger[_0xe161('0x2c')](_0xe161('0x39'));return BPromise[_0xe161('0x37')]({'id':_0x3eb66e[_0xe161('0x33')]['user_id'][_0xe161('0x34')],'name':_0x3eb66e['name_value_list'][_0xe161('0x30')][_0xe161('0x34')]});}}function getEndUser(_0x1790bd,_0x3bd876,_0x4a0c8f,_0x151253){logger[_0xe161('0x2c')]('Searching\x20enduser\x20with\x20phone',_0x4a0c8f);return request({'form':{'method':_0xe161('0x3a'),'input_type':_0xe161('0x24'),'response_type':'JSON','rest_data':JSON[_0xe161('0x25')]({'session':_0x151253['id'],'module_name':'Contacts','query':util[_0xe161('0x3b')](_0xe161('0x3c'),_0x4a0c8f),'order_by':'','offset':'0','select_fields':['id','name',_0xe161('0x3d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe161('0x31')](function(_0x20b162){if(_0x20b162['entry_list'][_0xe161('0x1f')]){var _0x2ce0b2=_['find'](_0x20b162[_0xe161('0x32')],function(_0x4efb77){return _0x4efb77[_0xe161('0x33')][_0xe161('0x3d')][_0xe161('0x34')]===_0x4a0c8f;});if(_0x2ce0b2){logger[_0xe161('0x2c')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x2ce0b2[_0xe161('0x33')]['id']['value'],'name':_0x2ce0b2['name_value_list'][_0xe161('0x2f')][_0xe161('0x34')],'phone':_0x2ce0b2[_0xe161('0x33')][_0xe161('0x3d')][_0xe161('0x34')]});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xe161('0x23'),'input_type':_0xe161('0x24'),'response_type':'JSON','rest_data':JSON[_0xe161('0x25')]({'session':_0x151253['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x3bd876!==_0xe161('0x3e')?_0x3bd876:util['format'](_0xe161('0x3f'),_0x4a0c8f)},{'name':'phone_home','value':_0x4a0c8f}]})}})[_0xe161('0x31')](function(_0x3791f1){logger[_0xe161('0x2c')](_0xe161('0x40'));return BPromise[_0xe161('0x37')]({'id':_0x3791f1['id'],'name':_0x3791f1[_0xe161('0x32')][_0xe161('0x41')]['value'],'phone':_0x3791f1[_0xe161('0x32')][_0xe161('0x3d')][_0xe161('0x34')]});});}});}function request(_0x240f19){logger[_0xe161('0x42')](_0xe161('0x43'),JSON['stringify'](_0x240f19));return rp(_['merge'](def,_0x240f19));}function getTags(_0x147940,_0x2ca095){var _0x819dc4=[];if(_0x147940&&_0x147940[_0xe161('0x1f')]>0x0){_0x819dc4=_[_0xe161('0x44')](_0x147940,_0x2ca095);}return _0x819dc4;}function getCustomFields(_0x476d4e,_0x326407){var _0x2698aa=[];var _0x3c4fc0={'custom_fields':[]};if(_0x476d4e['length']>0x0){_[_0xe161('0x45')](_0x476d4e,function(_0x4dae73){if(_0x4dae73[_0xe161('0x46')]===_0xe161('0x47')&&_0x4dae73[_0xe161('0x48')]&&!_0x4dae73['customField']){_0x3c4fc0[_0x4dae73['nameField'][_0xe161('0x49')]()]=_0x4dae73[_0xe161('0x4a')]['toString']();}else if(_0x4dae73[_0xe161('0x46')]===_0xe161('0x47')&&_0x4dae73[_0xe161('0x22')]&&_0x4dae73['customField']){_0x3c4fc0[_0xe161('0x4b')][_0xe161('0x21')]({'id':_0x4dae73[_0xe161('0x22')],'value':_0x4dae73[_0xe161('0x4a')][_0xe161('0x29')]()});}else if(_0x4dae73[_0xe161('0x46')]===_0xe161('0x4c')&&_0x4dae73[_0xe161('0x20')]&&_0x4dae73[_0xe161('0x22')]&&_0x4dae73[_0xe161('0x4d')]){_0x326407[_0x4dae73[_0xe161('0x20')]]&&_0x3c4fc0['custom_fields']['push']({'id':_0x4dae73[_0xe161('0x22')],'value':_0x326407[_0x4dae73[_0xe161('0x20')]][_0xe161('0x29')]()});}else if(_0x4dae73[_0xe161('0x46')]==='customVariable'&&_0x4dae73[_0xe161('0x4e')]&&_0x4dae73[_0xe161('0x4e')]['name']&&_0x4dae73[_0xe161('0x22')]&&_0x4dae73[_0xe161('0x4d')]){_0x326407[_0x4dae73['Variable'][_0xe161('0x2f')][_0xe161('0x49')]()]&&_0x3c4fc0[_0xe161('0x4b')][_0xe161('0x21')]({'id':_0x4dae73['idField'],'value':_0x326407[_0x4dae73[_0xe161('0x4e')][_0xe161('0x2f')][_0xe161('0x49')]()][_0xe161('0x29')]()});}});}return _0x3c4fc0;}function getConnection(_0x11d152){return request({'method':_0xe161('0xc'),'form':{'method':_0xe161('0x4f'),'input_type':_0xe161('0x24'),'response_type':_0xe161('0x24'),'rest_data':JSON[_0xe161('0x25')]({'user_auth':{'user_name':_0x11d152[_0xe161('0x50')],'password':_0x11d152[_0xe161('0x51')],'encryption':_0xe161('0x52')},'application':_0xe161('0x53')})}})[_0xe161('0x31')](function(_0x4b27ad){var _0x31426=_0x4b27ad;if(_0x31426['id']){def[_0xe161('0x54')]=_0x31426['id'];return BPromise[_0xe161('0x37')](_0x31426);}else{throw new Error(util[_0xe161('0x3b')](_0xe161('0x55'),_0x11d152['id']));}});}function setRelationship(_0x298bd3,_0x3c5e83,_0x109671,_0x374bf6){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0xe161('0x24'),'rest_data':JSON['stringify']({'session':_0x298bd3['id'],'module_name':'Calls','module_id':_0x109671['id'],'link_field_name':_0x374bf6,'related_ids':[_0x3c5e83['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x591eb9,_0xfa868,_0x2f9be9,_0x35acd2,_0x278792,_0x3d4774){var _0x18df8c,_0x556b05,_0xe4af6f,_0x4696d1;_0x3d4774[_0xe161('0x56')]=intUtil[_0xe161('0x57')](_0x3d4774[_0xe161('0x56')]);_0x3d4774[_0xe161('0x58')]=intUtil[_0xe161('0x57')](_0x3d4774[_0xe161('0x58')]);def[_0xe161('0x59')]=util[_0xe161('0x3b')](_0xe161('0x5a'),_0x3d4774['remoteUri']);if(_0x278792&&_0x278792[_0xe161('0x5b')]){logger['info'](_0xe161('0x5c'),'Recording\x20is\x20enabled!');_0xfa868[_0xe161('0x5d')]=util[_0xe161('0x3b')](_0xe161('0x5e'),_0x3d4774['serverUrl'],_0xfa868[_0xe161('0x5f')],md5(_0xfa868[_0xe161('0x5f')]));}else{_0xfa868[_0xe161('0x5d')]='';}return getConnection(_0x3d4774)[_0xe161('0x31')](function(_0x535de2){_0x4696d1=_0x535de2;return getUser(_0x3d4774,_0x35acd2[_0xe161('0x2f')],_0x4696d1);})[_0xe161('0x31')](function(_0x1c8654){_0x18df8c=_0x1c8654;logger[_0xe161('0x2c')](_0xe161('0x60'),_0x18df8c['id']);return getEndUser(_0x3d4774,_0xfa868[_0xe161('0x61')],_0xfa868['calleridnum'],_0x4696d1);})[_0xe161('0x31')](function(_0x2552ce){_0x556b05=_0x2552ce;logger[_0xe161('0x2c')](_0xe161('0x62'),_0x556b05['id']);return getTicket(_0x3d4774,_0x18df8c,_0x556b05,_0x2f9be9,_0xfa868,_0x2f9be9['Fields'],_0x4696d1,_0xe161('0x63'));})[_0xe161('0x31')](function(_0x213242){_0xe4af6f=_0x213242;logger[_0xe161('0x2c')](_0xe161('0x64'));logger[_0xe161('0x2c')](_0xe161('0x65'),_0xe4af6f['id']);return setRelationship(_0x4696d1,_0x18df8c,_0xe4af6f,_0xe161('0x66'));})[_0xe161('0x31')](function(){return setRelationship(_0x4696d1,_0x556b05,_0xe4af6f,'contacts');})['then'](function(){return getServerInfo(_0x4696d1);})[_0xe161('0x31')](function(_0x16ea33){var _0x4a9352=parseInt(_0x16ea33[_0xe161('0x67')][_0xe161('0x68')](0x0));var _0x35fa94=util[_0xe161('0x3b')](_0xe161('0x69'),_0x3d4774[_0xe161('0x56')],_0xe4af6f['id']);if(_0x4a9352>0x6){_0x35fa94=util['format'](_0xe161('0x6a'),_0x3d4774[_0xe161('0x56')],_0xe4af6f['id']);}logger[_0xe161('0x2c')](_0xe161('0x5c'),_0xe161('0x6b'));emit(util[_0xe161('0x3b')](_0xe161('0x6c'),_0x35acd2['name']),_0xe161('0x6d'),{'uri':_0x35fa94});})[_0xe161('0x6e')](function(_0x2469d4){logger[_0xe161('0x6f')](_0xe161('0x5c'),JSON[_0xe161('0x25')](_0x2469d4));});};exports[_0xe161('0x70')]=function(_0x4cc97f,_0x51b971,_0x583469,_0x2c2617,_0x4a2e54,_0x992d3c,_0x4d592c){var _0x22b03b,_0x41802d,_0x16134d,_0x13301a;_0x992d3c[_0xe161('0x56')]=intUtil[_0xe161('0x57')](_0x992d3c[_0xe161('0x56')]);_0x992d3c['serverUrl']=intUtil[_0xe161('0x57')](_0x992d3c[_0xe161('0x58')]);def[_0xe161('0x59')]=util[_0xe161('0x3b')](_0xe161('0x5a'),_0x992d3c[_0xe161('0x56')]);if(_0x4d592c&&_0x4d592c[_0xe161('0x71')]&&_0x4d592c[_0xe161('0x71')]!==_0xe161('0x72')){logger[_0xe161('0x2c')](_0xe161('0x73'),_0xe161('0x74'));_0x51b971[_0xe161('0x5d')]=util[_0xe161('0x3b')](_0xe161('0x5e'),_0x992d3c[_0xe161('0x58')],_0x51b971[_0xe161('0x5f')],md5(_0x51b971['uniqueid']));}return getConnection(_0x992d3c)[_0xe161('0x31')](function(_0x2e4553){_0x13301a=_0x2e4553;return getUser(_0x992d3c,_0x2c2617[_0xe161('0x2f')],_0x13301a);})[_0xe161('0x31')](function(_0x9108a6){_0x22b03b=_0x9108a6;logger[_0xe161('0x2c')](_0xe161('0x60'),_0x22b03b['id']);return getEndUser(_0x992d3c,_0x51b971[_0xe161('0x75')],_0x51b971[_0xe161('0x76')],_0x13301a);})[_0xe161('0x31')](function(_0x3a18ae){_0x41802d=_0x3a18ae;logger[_0xe161('0x2c')](_0xe161('0x62'),_0x41802d['id']);return getTicket(_0x992d3c,_0x22b03b,_0x41802d,_0x583469,_0x51b971,_0x583469[_0xe161('0x77')],_0x13301a,_0xe161('0x78'));})['then'](function(_0x460535){_0x16134d=_0x460535;logger[_0xe161('0x2c')](_0xe161('0x64'));logger[_0xe161('0x2c')](_0xe161('0x65'),_0x16134d['id']);return setRelationship(_0x13301a,_0x22b03b,_0x16134d,_0xe161('0x66'));})[_0xe161('0x31')](function(){return setRelationship(_0x13301a,_0x41802d,_0x16134d,_0xe161('0x79'));})[_0xe161('0x31')](function(){return getServerInfo(_0x13301a);})['then'](function(_0x1dc26b){var _0x522a33=parseInt(_0x1dc26b[_0xe161('0x67')][_0xe161('0x68')](0x0));var _0x3e8b4b=util[_0xe161('0x3b')](_0xe161('0x69'),_0x992d3c[_0xe161('0x56')],_0x16134d['id']);if(_0x522a33>0x6){_0x3e8b4b=util[_0xe161('0x3b')](_0xe161('0x6a'),_0x992d3c[_0xe161('0x56')],_0x16134d['id']);}logger[_0xe161('0x2c')](_0xe161('0x73'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe161('0x3b')](_0xe161('0x6c'),_0x2c2617['name']),_0xe161('0x6d'),{'uri':_0x3e8b4b});})['catch'](function(_0x411358){logger[_0xe161('0x6f')](_0xe161('0x73'),JSON[_0xe161('0x25')](_0x411358));});};exports[_0xe161('0x7a')]=function(_0x4814c8,_0x1a46be,_0x3fe8ce,_0x45196e,_0x501315,_0x2f8330){var _0x33b6f4,_0x4f3233,_0x29afc2,_0x598780;_0x2f8330[_0xe161('0x56')]=intUtil[_0xe161('0x57')](_0x2f8330[_0xe161('0x56')]);_0x2f8330[_0xe161('0x58')]=intUtil[_0xe161('0x57')](_0x2f8330[_0xe161('0x58')]);def[_0xe161('0x59')]=util['format'](_0xe161('0x5a'),_0x2f8330[_0xe161('0x56')]);if(_0x501315&&_0x501315[_0xe161('0x5b')]){logger[_0xe161('0x2c')]('['+_0x1a46be['lastevent']['toUpperCase']()+']',_0xe161('0x74'));_0x1a46be[_0xe161('0x5d')]=util[_0xe161('0x3b')](_0xe161('0x5e'),_0x2f8330[_0xe161('0x58')],_0x1a46be['uniqueid'],md5(_0x1a46be[_0xe161('0x5f')]));}else{_0x1a46be[_0xe161('0x5d')]='';}return getConnection(_0x2f8330)['then'](function(_0x2319fa){_0x598780=_0x2319fa;if(!_['isNil'](_0x45196e)){return getUser(_0x2f8330,_0x45196e[_0xe161('0x2f')],_0x598780);}else{return getUser(_0x2f8330,null,_0x598780);}})['then'](function(_0x4f29fe){_0x33b6f4=_0x4f29fe;logger['info'](_0xe161('0x60'),_0x33b6f4['id']);return getEndUser(_0x2f8330,_0x1a46be[_0xe161('0x61')],_0x1a46be['calleridnum'],_0x598780);})['then'](function(_0x2f248f){_0x4f3233=_0x2f248f;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4f3233['id']);return getTicket(_0x2f8330,_0x33b6f4,_0x4f3233,_0x3fe8ce,_0x1a46be,_0x3fe8ce['Fields'],_0x598780,_0xe161('0x63'));})[_0xe161('0x31')](function(_0x123234){_0x29afc2=_0x123234;logger[_0xe161('0x2c')](_0xe161('0x64'));logger['info'](_0xe161('0x65'),_0x29afc2['id']);return setRelationship(_0x598780,_0x33b6f4,_0x29afc2,_0xe161('0x66'));})[_0xe161('0x31')](function(){return setRelationship(_0x598780,_0x4f3233,_0x29afc2,_0xe161('0x79'));})[_0xe161('0x31')](function(){return getServerInfo(_0x598780);})[_0xe161('0x6e')](function(_0x5a5c99){logger['error']('['+_0x1a46be[_0xe161('0x7b')][_0xe161('0x7c')]()+']',JSON['stringify'](_0x5a5c99));});}; \ No newline at end of file +var _0x3b1b=['getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','variableName','push','set_entry','stringify','format','Basic\x20%s','toString','get_server_info','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','value','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','first_name','debug','[HTTP]','map','string','nameField','toLowerCase','content','type','customField','custom_fields','idField','variable','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','charAt','catch','unmanaged','lastevent','toUpperCase','Fields','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','emit','info','Creating\x20new\x20ticket...','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b1b,0x1e4));var _0xb3b1=function(_0x1eb756,_0x587215){_0x1eb756=_0x1eb756-0x0;var _0x279d2d=_0x3b1b[_0x1eb756];return _0x279d2d;};'use strict';var _=require(_0xb3b1('0x0'));var rp=require(_0xb3b1('0x1'));var BPromise=require(_0xb3b1('0x2'));var md5=require('md5');var util=require(_0xb3b1('0x3'));var Redis=require(_0xb3b1('0x4'));var intUtil=require(_0xb3b1('0x5'));var config=require(_0xb3b1('0x6'));var logger=require(_0xb3b1('0x7'))(_0xb3b1('0x8'));config[_0xb3b1('0x9')]=_[_0xb3b1('0xa')](config['redis'],{'host':_0xb3b1('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb3b1('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x1fa824,_0x42a06c,_0x152ab2){io['to'](_0x1fa824)[_0xb3b1('0xc')](_0x42a06c,_0x152ab2);}function getTicket(_0x41b3b1,_0x4e3de0,_0x491296,_0x14dd1b,_0x1a5e77,_0xb9c3f6,_0x1f4fdc,_0x57df51){logger[_0xb3b1('0xd')](_0xb3b1('0xe'));var _0x5a6f8b=new Date();var _0x40408e=[{'name':_0xb3b1('0xf'),'value':intUtil[_0xb3b1('0x10')](_0x14dd1b[_0xb3b1('0x11')],_0x1a5e77,'\x20')},{'name':_0xb3b1('0x12'),'value':_0x4e3de0['id']},{'name':_0xb3b1('0x13'),'value':_0x4e3de0['id']},{'name':'description','value':intUtil[_0xb3b1('0x10')](_0x14dd1b[_0xb3b1('0x14')],_0x1a5e77,'\x0a')},{'name':_0xb3b1('0x15'),'value':_0x5a6f8b[_0xb3b1('0x16')]()[_0xb3b1('0x17')](0x0,0x13)[_0xb3b1('0x18')]('T','\x20')},{'name':_0xb3b1('0x19'),'value':'0'},{'name':_0xb3b1('0x1a'),'value':'15'},{'name':_0xb3b1('0x1b'),'value':_0x491296['id']},{'name':_0xb3b1('0x1c'),'value':_0xb3b1('0x1d')},{'name':_0xb3b1('0x1e'),'value':_0x491296[_0xb3b1('0xf')]},{'name':'direction','value':_0x57df51}];if(_0xb9c3f6[_0xb3b1('0x1f')]){_[_0xb3b1('0x20')](_0xb9c3f6,function(_0x19f8f5){if(_0x1a5e77[_0x19f8f5[_0xb3b1('0x21')]]){_0x40408e[_0xb3b1('0x22')]({'name':_0x19f8f5['idField'],'value':_0x1a5e77[_0x19f8f5[_0xb3b1('0x21')]]});}});}return request({'form':{'method':_0xb3b1('0x23'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xb3b1('0x24')]({'session':_0x1f4fdc['id'],'module_name':'Calls','name_value_list':_0x40408e})}});}function getAuth(_0x32ea74){return util[_0xb3b1('0x25')](_0xb3b1('0x26'),new Buffer(_0x32ea74['apiKey']+':X')[_0xb3b1('0x27')]('base64'));}function getServerInfo(_0x1344c8){return request({'form':{'method':_0xb3b1('0x28'),'input_type':_0xb3b1('0x29'),'response_type':_0xb3b1('0x29'),'rest_data':JSON[_0xb3b1('0x24')]({'session':_0x1344c8['id']})}});}function getUser(_0x4f68b7,_0x51baeb,_0x172608){if(!_[_0xb3b1('0x2a')](_0x51baeb)){logger[_0xb3b1('0xd')](_0xb3b1('0x2b'),_0x51baeb);return request({'form':{'method':_0xb3b1('0x2c'),'input_type':_0xb3b1('0x29'),'response_type':_0xb3b1('0x29'),'rest_data':JSON['stringify']({'session':_0x172608['id'],'module_name':_0xb3b1('0x2d'),'query':util['format'](_0xb3b1('0x2e'),_0x51baeb),'order_by':'','offset':'0','select_fields':['id',_0xb3b1('0xf'),_0xb3b1('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb3b1('0x30')](function(_0x12306e){if(_0x12306e[_0xb3b1('0x31')][_0xb3b1('0x1f')]){var _0x51f66a=_[_0xb3b1('0x32')](_0x12306e['entry_list'],function(_0x38e4e8){return _0x38e4e8[_0xb3b1('0x33')][_0xb3b1('0x2f')]['value']===_0x51baeb;});if(_0x51f66a){logger[_0xb3b1('0xd')](_0xb3b1('0x34'));return BPromise[_0xb3b1('0x35')]({'id':_0x51f66a['name_value_list']['id']['value'],'name':_0x51f66a[_0xb3b1('0x33')][_0xb3b1('0xf')]['value']});}}logger[_0xb3b1('0xd')](_0xb3b1('0x36'));return BPromise['resolve']({'id':_0x172608[_0xb3b1('0x33')][_0xb3b1('0x37')][_0xb3b1('0x38')],'name':_0x172608[_0xb3b1('0x33')][_0xb3b1('0x2f')][_0xb3b1('0x38')]});});}else{logger[_0xb3b1('0xd')](_0xb3b1('0x39'));return BPromise[_0xb3b1('0x35')]({'id':_0x172608[_0xb3b1('0x33')][_0xb3b1('0x37')]['value'],'name':_0x172608['name_value_list'][_0xb3b1('0x2f')][_0xb3b1('0x38')]});}}function getEndUser(_0x263499,_0x5ba05c,_0x4308b7,_0x42e89e){logger[_0xb3b1('0xd')](_0xb3b1('0x3a'),_0x4308b7);return request({'form':{'method':_0xb3b1('0x2c'),'input_type':'JSON','response_type':_0xb3b1('0x29'),'rest_data':JSON[_0xb3b1('0x24')]({'session':_0x42e89e['id'],'module_name':_0xb3b1('0x1d'),'query':util[_0xb3b1('0x25')](_0xb3b1('0x3b'),_0x4308b7),'order_by':'','offset':'0','select_fields':['id','name',_0xb3b1('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb3b1('0x30')](function(_0xc998dd){if(_0xc998dd[_0xb3b1('0x31')]['length']){var _0x2fa120=_[_0xb3b1('0x32')](_0xc998dd['entry_list'],function(_0x2cd7a5){return _0x2cd7a5[_0xb3b1('0x33')][_0xb3b1('0x3c')][_0xb3b1('0x38')]===_0x4308b7;});if(_0x2fa120){logger[_0xb3b1('0xd')](_0xb3b1('0x3d'));return BPromise[_0xb3b1('0x35')]({'id':_0x2fa120['name_value_list']['id'][_0xb3b1('0x38')],'name':_0x2fa120[_0xb3b1('0x33')][_0xb3b1('0xf')]['value'],'phone':_0x2fa120[_0xb3b1('0x33')][_0xb3b1('0x3c')][_0xb3b1('0x38')]});}}else{logger[_0xb3b1('0xd')](_0xb3b1('0x3e'));return request({'form':{'method':'set_entry','input_type':_0xb3b1('0x29'),'response_type':_0xb3b1('0x29'),'rest_data':JSON['stringify']({'session':_0x42e89e['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x5ba05c!==_0xb3b1('0x3f')?_0x5ba05c:util[_0xb3b1('0x25')]('Caller\x20-\x20%s',_0x4308b7)},{'name':_0xb3b1('0x3c'),'value':_0x4308b7}]})}})['then'](function(_0x5142b0){logger[_0xb3b1('0xd')]('Enduser\x20created.');return BPromise[_0xb3b1('0x35')]({'id':_0x5142b0['id'],'name':_0x5142b0['entry_list'][_0xb3b1('0x40')][_0xb3b1('0x38')],'phone':_0x5142b0[_0xb3b1('0x31')][_0xb3b1('0x3c')][_0xb3b1('0x38')]});});}});}function request(_0x56cc8c){logger[_0xb3b1('0x41')](_0xb3b1('0x42'),JSON[_0xb3b1('0x24')](_0x56cc8c));return rp(_['merge'](def,_0x56cc8c));}function getTags(_0x395c2d,_0x1bc2f7){var _0x5969a9=[];if(_0x395c2d&&_0x395c2d[_0xb3b1('0x1f')]>0x0){_0x5969a9=_[_0xb3b1('0x43')](_0x395c2d,_0x1bc2f7);}return _0x5969a9;}function getCustomFields(_0x3a5b0c,_0x5a30a7){var _0x4ab133=[];var _0x37d1c4={'custom_fields':[]};if(_0x3a5b0c[_0xb3b1('0x1f')]>0x0){_[_0xb3b1('0x20')](_0x3a5b0c,function(_0x5e90d2){if(_0x5e90d2['type']===_0xb3b1('0x44')&&_0x5e90d2[_0xb3b1('0x45')]&&!_0x5e90d2['customField']){_0x37d1c4[_0x5e90d2[_0xb3b1('0x45')][_0xb3b1('0x46')]()]=_0x5e90d2[_0xb3b1('0x47')][_0xb3b1('0x27')]();}else if(_0x5e90d2[_0xb3b1('0x48')]===_0xb3b1('0x44')&&_0x5e90d2['idField']&&_0x5e90d2[_0xb3b1('0x49')]){_0x37d1c4[_0xb3b1('0x4a')][_0xb3b1('0x22')]({'id':_0x5e90d2[_0xb3b1('0x4b')],'value':_0x5e90d2['content']['toString']()});}else if(_0x5e90d2[_0xb3b1('0x48')]===_0xb3b1('0x4c')&&_0x5e90d2[_0xb3b1('0x21')]&&_0x5e90d2[_0xb3b1('0x4b')]&&_0x5e90d2[_0xb3b1('0x49')]){_0x5a30a7[_0x5e90d2[_0xb3b1('0x21')]]&&_0x37d1c4['custom_fields'][_0xb3b1('0x22')]({'id':_0x5e90d2['idField'],'value':_0x5a30a7[_0x5e90d2[_0xb3b1('0x21')]][_0xb3b1('0x27')]()});}else if(_0x5e90d2[_0xb3b1('0x48')]===_0xb3b1('0x4d')&&_0x5e90d2['Variable']&&_0x5e90d2[_0xb3b1('0x4e')][_0xb3b1('0xf')]&&_0x5e90d2['idField']&&_0x5e90d2[_0xb3b1('0x49')]){_0x5a30a7[_0x5e90d2['Variable'][_0xb3b1('0xf')][_0xb3b1('0x46')]()]&&_0x37d1c4[_0xb3b1('0x4a')][_0xb3b1('0x22')]({'id':_0x5e90d2[_0xb3b1('0x4b')],'value':_0x5a30a7[_0x5e90d2['Variable'][_0xb3b1('0xf')]['toLowerCase']()][_0xb3b1('0x27')]()});}});}return _0x37d1c4;}function getConnection(_0x444ad8){return request({'method':_0xb3b1('0x4f'),'form':{'method':_0xb3b1('0x50'),'input_type':_0xb3b1('0x29'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x444ad8[_0xb3b1('0x51')],'password':_0x444ad8[_0xb3b1('0x52')],'encryption':_0xb3b1('0x53')},'application':_0xb3b1('0x54')})}})[_0xb3b1('0x30')](function(_0x1d5404){var _0x3db038=_0x1d5404;if(_0x3db038['id']){def[_0xb3b1('0x55')]=_0x3db038['id'];return BPromise[_0xb3b1('0x35')](_0x3db038);}else{throw new Error(util[_0xb3b1('0x25')]('Account\x20%d\x20is\x20not\x20valid',_0x444ad8['id']));}});}function setRelationship(_0xf4fd84,_0x5baa50,_0x40d6b6,_0x29fcb7){return request({'form':{'method':_0xb3b1('0x56'),'input_type':_0xb3b1('0x29'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0xf4fd84['id'],'module_name':_0xb3b1('0x57'),'module_id':_0x40d6b6['id'],'link_field_name':_0x29fcb7,'related_ids':[_0x5baa50['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x13e3a0,_0x8429ab,_0x243381,_0x1f8390,_0xcbad7e,_0x575b73){var _0xa9c58c,_0x20f6a9,_0x25f281,_0x3f147f;_0x575b73[_0xb3b1('0x58')]=intUtil[_0xb3b1('0x59')](_0x575b73[_0xb3b1('0x58')]);_0x575b73['serverUrl']=intUtil[_0xb3b1('0x59')](_0x575b73[_0xb3b1('0x5a')]);def[_0xb3b1('0x5b')]=util[_0xb3b1('0x25')]('%s/service/v4_1/rest.php',_0x575b73['remoteUri']);if(_0xcbad7e&&_0xcbad7e[_0xb3b1('0x5c')]){logger['info'](_0xb3b1('0x5d'),_0xb3b1('0x5e'));_0x8429ab[_0xb3b1('0x5f')]=util[_0xb3b1('0x25')](_0xb3b1('0x60'),_0x575b73[_0xb3b1('0x5a')],_0x8429ab[_0xb3b1('0x61')],md5(_0x8429ab[_0xb3b1('0x61')]));}else{_0x8429ab['recordingURL']='';}return getConnection(_0x575b73)['then'](function(_0x39f4e6){_0x3f147f=_0x39f4e6;return getUser(_0x575b73,_0x1f8390['name'],_0x3f147f);})[_0xb3b1('0x30')](function(_0x33c658){_0xa9c58c=_0x33c658;logger[_0xb3b1('0xd')]('The\x20User\x20ID\x20is:',_0xa9c58c['id']);return getEndUser(_0x575b73,_0x8429ab[_0xb3b1('0x62')],_0x8429ab[_0xb3b1('0x63')],_0x3f147f);})['then'](function(_0x307767){_0x20f6a9=_0x307767;logger['info']('The\x20Enduser\x20ID\x20is:',_0x20f6a9['id']);return getTicket(_0x575b73,_0xa9c58c,_0x20f6a9,_0x243381,_0x8429ab,_0x243381['Fields'],_0x3f147f,_0xb3b1('0x64'));})[_0xb3b1('0x30')](function(_0x4d0c90){_0x25f281=_0x4d0c90;logger[_0xb3b1('0xd')](_0xb3b1('0x65'));logger['info'](_0xb3b1('0x66'),_0x25f281['id']);return setRelationship(_0x3f147f,_0xa9c58c,_0x25f281,_0xb3b1('0x67'));})['then'](function(){return setRelationship(_0x3f147f,_0x20f6a9,_0x25f281,_0xb3b1('0x68'));})['then'](function(){return getServerInfo(_0x3f147f);})[_0xb3b1('0x30')](function(_0x5760c1){var _0x4babda=parseInt(_0x5760c1[_0xb3b1('0x69')]['charAt'](0x0));var _0x530751=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x575b73[_0xb3b1('0x58')],_0x25f281['id']);if(_0x4babda>0x6){_0x530751=util[_0xb3b1('0x25')](_0xb3b1('0x6a'),_0x575b73['remoteUri'],_0x25f281['id']);}logger[_0xb3b1('0xd')](_0xb3b1('0x5d'),_0xb3b1('0x6b'));emit(util[_0xb3b1('0x25')](_0xb3b1('0x6c'),_0x1f8390['name']),'trigger:browser:url',{'uri':_0x530751});})['catch'](function(_0x37dfb4){logger[_0xb3b1('0x6d')](_0xb3b1('0x5d'),JSON[_0xb3b1('0x24')](_0x37dfb4));});};exports[_0xb3b1('0x6e')]=function(_0x46d4ce,_0x178045,_0x435e2d,_0x28c97b,_0x44319e,_0x1e2446,_0x2fc357){var _0x51d6f5,_0x138da0,_0x1117d1,_0x31fe4d;_0x1e2446[_0xb3b1('0x58')]=intUtil[_0xb3b1('0x59')](_0x1e2446[_0xb3b1('0x58')]);_0x1e2446[_0xb3b1('0x5a')]=intUtil[_0xb3b1('0x59')](_0x1e2446[_0xb3b1('0x5a')]);def[_0xb3b1('0x5b')]=util[_0xb3b1('0x25')](_0xb3b1('0x6f'),_0x1e2446[_0xb3b1('0x58')]);if(_0x2fc357&&_0x2fc357['recordingFormat']&&_0x2fc357[_0xb3b1('0x70')]!==_0xb3b1('0x71')){logger[_0xb3b1('0xd')](_0xb3b1('0x72'),_0xb3b1('0x5e'));_0x178045[_0xb3b1('0x5f')]=util[_0xb3b1('0x25')](_0xb3b1('0x60'),_0x1e2446[_0xb3b1('0x5a')],_0x178045[_0xb3b1('0x61')],md5(_0x178045['uniqueid']));}return getConnection(_0x1e2446)['then'](function(_0x17b627){_0x31fe4d=_0x17b627;return getUser(_0x1e2446,_0x28c97b[_0xb3b1('0xf')],_0x31fe4d);})[_0xb3b1('0x30')](function(_0x5c501f){_0x51d6f5=_0x5c501f;logger[_0xb3b1('0xd')](_0xb3b1('0x73'),_0x51d6f5['id']);return getEndUser(_0x1e2446,_0x178045[_0xb3b1('0x74')],_0x178045[_0xb3b1('0x75')],_0x31fe4d);})[_0xb3b1('0x30')](function(_0x1e507f){_0x138da0=_0x1e507f;logger[_0xb3b1('0xd')](_0xb3b1('0x76'),_0x138da0['id']);return getTicket(_0x1e2446,_0x51d6f5,_0x138da0,_0x435e2d,_0x178045,_0x435e2d['Fields'],_0x31fe4d,'Outbound');})[_0xb3b1('0x30')](function(_0x15851f){_0x1117d1=_0x15851f;logger[_0xb3b1('0xd')](_0xb3b1('0x65'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1117d1['id']);return setRelationship(_0x31fe4d,_0x51d6f5,_0x1117d1,'users');})[_0xb3b1('0x30')](function(){return setRelationship(_0x31fe4d,_0x138da0,_0x1117d1,_0xb3b1('0x68'));})[_0xb3b1('0x30')](function(){return getServerInfo(_0x31fe4d);})[_0xb3b1('0x30')](function(_0x3189f1){var _0xe7cf18=parseInt(_0x3189f1[_0xb3b1('0x69')][_0xb3b1('0x77')](0x0));var _0x331512=util[_0xb3b1('0x25')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1e2446[_0xb3b1('0x58')],_0x1117d1['id']);if(_0xe7cf18>0x6){_0x331512=util[_0xb3b1('0x25')](_0xb3b1('0x6a'),_0x1e2446[_0xb3b1('0x58')],_0x1117d1['id']);}logger[_0xb3b1('0xd')](_0xb3b1('0x72'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb3b1('0x6c'),_0x28c97b[_0xb3b1('0xf')]),'trigger:browser:url',{'uri':_0x331512});})[_0xb3b1('0x78')](function(_0x17a267){logger['error']('[OUTBOUND]',JSON['stringify'](_0x17a267));});};exports[_0xb3b1('0x79')]=function(_0x5c8d13,_0x367eda,_0x47a1ab,_0x29b151,_0xa2cdf5,_0x536f13){var _0x773fc0,_0x153b19,_0xaef8a7,_0x5df2a6;_0x536f13[_0xb3b1('0x58')]=intUtil['stripTrailingSlash'](_0x536f13['remoteUri']);_0x536f13[_0xb3b1('0x5a')]=intUtil[_0xb3b1('0x59')](_0x536f13[_0xb3b1('0x5a')]);def[_0xb3b1('0x5b')]=util[_0xb3b1('0x25')](_0xb3b1('0x6f'),_0x536f13[_0xb3b1('0x58')]);if(_0xa2cdf5&&_0xa2cdf5[_0xb3b1('0x5c')]){logger[_0xb3b1('0xd')]('['+_0x367eda[_0xb3b1('0x7a')][_0xb3b1('0x7b')]()+']',_0xb3b1('0x5e'));_0x367eda[_0xb3b1('0x5f')]=util['format'](_0xb3b1('0x60'),_0x536f13[_0xb3b1('0x5a')],_0x367eda['uniqueid'],md5(_0x367eda[_0xb3b1('0x61')]));}else{_0x367eda[_0xb3b1('0x5f')]='';}return getConnection(_0x536f13)[_0xb3b1('0x30')](function(_0x29230d){_0x5df2a6=_0x29230d;if(!_[_0xb3b1('0x2a')](_0x29b151)){return getUser(_0x536f13,_0x29b151[_0xb3b1('0xf')],_0x5df2a6);}else{return getUser(_0x536f13,null,_0x5df2a6);}})[_0xb3b1('0x30')](function(_0x5f1b2f){_0x773fc0=_0x5f1b2f;logger[_0xb3b1('0xd')](_0xb3b1('0x73'),_0x773fc0['id']);return getEndUser(_0x536f13,_0x367eda[_0xb3b1('0x62')],_0x367eda[_0xb3b1('0x63')],_0x5df2a6);})[_0xb3b1('0x30')](function(_0x593e46){_0x153b19=_0x593e46;logger['info'](_0xb3b1('0x76'),_0x153b19['id']);return getTicket(_0x536f13,_0x773fc0,_0x153b19,_0x47a1ab,_0x367eda,_0x47a1ab[_0xb3b1('0x7c')],_0x5df2a6,_0xb3b1('0x64'));})[_0xb3b1('0x30')](function(_0x328ee5){_0xaef8a7=_0x328ee5;logger[_0xb3b1('0xd')](_0xb3b1('0x65'));logger[_0xb3b1('0xd')](_0xb3b1('0x66'),_0xaef8a7['id']);return setRelationship(_0x5df2a6,_0x773fc0,_0xaef8a7,_0xb3b1('0x67'));})[_0xb3b1('0x30')](function(){return setRelationship(_0x5df2a6,_0x153b19,_0xaef8a7,_0xb3b1('0x68'));})[_0xb3b1('0x30')](function(){return getServerInfo(_0x5df2a6);})[_0xb3b1('0x78')](function(_0x49828d){logger[_0xb3b1('0x6d')]('['+_0x367eda[_0xb3b1('0x7a')]['toUpperCase']()+']',JSON[_0xb3b1('0x24')](_0x49828d));});}; \ 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 77c040f..f65f0ac 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 _0x916f=['slice','substring','validateEmail','isNil','test','getString','length','sortBy','type','string','push','content','variable','variableName','toString','Variable','name','format','%s:\x20%s','key','keyContent','keyType','customVariable','toLowerCase','join','stripTrailingSlash'];(function(_0xbfee04,_0x5805cc){var _0x173ee1=function(_0x81ec3){while(--_0x81ec3){_0xbfee04['push'](_0xbfee04['shift']());}};_0x173ee1(++_0x5805cc);}(_0x916f,0x1f3));var _0xf916=function(_0x5d465d,_0x21b8ef){_0x5d465d=_0x5d465d-0x0;var _0x272927=_0x916f[_0x5d465d];return _0x272927;};'use strict';var _=require('lodash');var util=require('util');exports[_0xf916('0x0')]=function(_0x9eaebf,_0x12b8f5,_0x4a5bc0){var _0x17e26a=[];if(_0x9eaebf[_0xf916('0x1')]>0x0){var _0x5caff1=_[_0xf916('0x2')](_0x9eaebf,['id']);for(var _0x4aeac6=0x0;_0x4aeac6<_0x5caff1[_0xf916('0x1')];_0x4aeac6++){var _0x4475aa=_0x5caff1[_0x4aeac6];if(_0x4475aa[_0xf916('0x3')]===_0xf916('0x4')){_0x17e26a[_0xf916('0x5')](_0x4475aa[_0xf916('0x6')]);}else if(_0x4475aa['type']===_0xf916('0x7')&&_0x4475aa['variableName']){_0x12b8f5[_0x4475aa[_0xf916('0x8')]]&&_0x17e26a[_0xf916('0x5')](_0x12b8f5[_0x4475aa[_0xf916('0x8')]][_0xf916('0x9')]());}else if(_0x4475aa[_0xf916('0x3')]==='customVariable'&&_0x4475aa[_0xf916('0xa')]&&_0x4475aa[_0xf916('0xa')][_0xf916('0xb')]){_0x12b8f5[_0x4475aa[_0xf916('0xa')][_0xf916('0xb')]['toLowerCase']()]&&_0x17e26a[_0xf916('0x5')](_0x12b8f5[_0x4475aa[_0xf916('0xa')][_0xf916('0xb')]['toLowerCase']()][_0xf916('0x9')]());}else if(_0x4475aa[_0xf916('0x3')]==='keyValue'){if(_0x4475aa['keyType']===_0xf916('0x4')&&_0x4475aa['key']){_0x17e26a[_0xf916('0x5')](util[_0xf916('0xc')](_0xf916('0xd'),_0x4475aa[_0xf916('0xe')],_0x4475aa[_0xf916('0xf')]));}else if(_0x4475aa[_0xf916('0x10')]===_0xf916('0x7')&&_0x4475aa[_0xf916('0x8')]&&_0x4475aa[_0xf916('0xe')]){_0x12b8f5[_0x4475aa[_0xf916('0x8')]]&&_0x17e26a[_0xf916('0x5')](util['format'](_0xf916('0xd'),_0x4475aa[_0xf916('0xe')],_0x12b8f5[_0x4475aa[_0xf916('0x8')]]));}else if(_0x4475aa[_0xf916('0x10')]===_0xf916('0x11')&&_0x4475aa[_0xf916('0xa')]&&_0x4475aa[_0xf916('0xa')]['name']&&_0x4475aa[_0xf916('0xe')]){_0x12b8f5[_0x4475aa[_0xf916('0xa')]['name'][_0xf916('0x12')]()]&&_0x17e26a[_0xf916('0x5')](util[_0xf916('0xc')](_0xf916('0xd'),_0x4475aa[_0xf916('0xe')],_0x12b8f5[_0x4475aa['Variable'][_0xf916('0xb')]['toLowerCase']()]));}}}}return _0x17e26a[_0xf916('0x13')](_0x4a5bc0);};exports[_0xf916('0x14')]=function(_0x133bc2){var _0x273501=_0x133bc2[_0xf916('0x15')](-0x1);if(_0x273501==='/'){_0x133bc2=_0x133bc2[_0xf916('0x16')](0x0,_0x133bc2['lastIndexOf'](_0x273501));}return _0x133bc2;};exports[_0xf916('0x17')]=function(_0x90f8b4){if(!_[_0xf916('0x18')](_0x90f8b4)&&_0x90f8b4!==''){var _0x2f2d98=/^(([^<>()\[\]\\.,;:\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 _0x2f2d98[_0xf916('0x19')](String(_0x90f8b4)[_0xf916('0x12')]());}else{return![];}}; \ No newline at end of file +var _0xbde6=['keyContent','variable','format','%s:\x20%s','join','stripTrailingSlash','substring','lastIndexOf','isNil','lodash','getString','length','sortBy','string','push','content','variableName','toString','type','customVariable','Variable','name','toLowerCase','keyType','key'];(function(_0x268b25,_0x539ab3){var _0x414334=function(_0x30aa30){while(--_0x30aa30){_0x268b25['push'](_0x268b25['shift']());}};_0x414334(++_0x539ab3);}(_0xbde6,0x180));var _0x6bde=function(_0x251208,_0x347692){_0x251208=_0x251208-0x0;var _0x20a0e7=_0xbde6[_0x251208];return _0x20a0e7;};'use strict';var _=require(_0x6bde('0x0'));var util=require('util');exports[_0x6bde('0x1')]=function(_0x488015,_0x1ee39e,_0x55bf4c){var _0x3d9906=[];if(_0x488015[_0x6bde('0x2')]>0x0){var _0x563c07=_[_0x6bde('0x3')](_0x488015,['id']);for(var _0x1119a9=0x0;_0x1119a9<_0x563c07[_0x6bde('0x2')];_0x1119a9++){var _0x1bce03=_0x563c07[_0x1119a9];if(_0x1bce03['type']===_0x6bde('0x4')){_0x3d9906[_0x6bde('0x5')](_0x1bce03[_0x6bde('0x6')]);}else if(_0x1bce03['type']==='variable'&&_0x1bce03[_0x6bde('0x7')]){_0x1ee39e[_0x1bce03['variableName']]&&_0x3d9906[_0x6bde('0x5')](_0x1ee39e[_0x1bce03[_0x6bde('0x7')]][_0x6bde('0x8')]());}else if(_0x1bce03[_0x6bde('0x9')]===_0x6bde('0xa')&&_0x1bce03[_0x6bde('0xb')]&&_0x1bce03[_0x6bde('0xb')][_0x6bde('0xc')]){_0x1ee39e[_0x1bce03['Variable'][_0x6bde('0xc')][_0x6bde('0xd')]()]&&_0x3d9906[_0x6bde('0x5')](_0x1ee39e[_0x1bce03[_0x6bde('0xb')][_0x6bde('0xc')][_0x6bde('0xd')]()][_0x6bde('0x8')]());}else if(_0x1bce03['type']==='keyValue'){if(_0x1bce03[_0x6bde('0xe')]===_0x6bde('0x4')&&_0x1bce03[_0x6bde('0xf')]){_0x3d9906[_0x6bde('0x5')](util['format']('%s:\x20%s',_0x1bce03[_0x6bde('0xf')],_0x1bce03[_0x6bde('0x10')]));}else if(_0x1bce03[_0x6bde('0xe')]===_0x6bde('0x11')&&_0x1bce03[_0x6bde('0x7')]&&_0x1bce03[_0x6bde('0xf')]){_0x1ee39e[_0x1bce03[_0x6bde('0x7')]]&&_0x3d9906[_0x6bde('0x5')](util[_0x6bde('0x12')]('%s:\x20%s',_0x1bce03[_0x6bde('0xf')],_0x1ee39e[_0x1bce03['variableName']]));}else if(_0x1bce03[_0x6bde('0xe')]==='customVariable'&&_0x1bce03[_0x6bde('0xb')]&&_0x1bce03['Variable'][_0x6bde('0xc')]&&_0x1bce03[_0x6bde('0xf')]){_0x1ee39e[_0x1bce03['Variable']['name']['toLowerCase']()]&&_0x3d9906['push'](util['format'](_0x6bde('0x13'),_0x1bce03['key'],_0x1ee39e[_0x1bce03[_0x6bde('0xb')][_0x6bde('0xc')][_0x6bde('0xd')]()]));}}}}return _0x3d9906[_0x6bde('0x14')](_0x55bf4c);};exports[_0x6bde('0x15')]=function(_0x10689b){var _0x94886=_0x10689b['slice'](-0x1);if(_0x94886==='/'){_0x10689b=_0x10689b[_0x6bde('0x16')](0x0,_0x10689b[_0x6bde('0x17')](_0x94886));}return _0x10689b;};exports['validateEmail']=function(_0x477fa8){if(!_[_0x6bde('0x18')](_0x477fa8)&&_0x477fa8!==''){var _0x20bdab=/^(([^<>()\[\]\\.,;:\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 _0x20bdab['test'](String(_0x477fa8)[_0x6bde('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 0b37297..34f5f1a 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(_0x160b19,_0x44248d){var _0x1bacb2=function(_0x4d5291){while(--_0x4d5291){_0x160b19['push'](_0x160b19['shift']());}};_0x1bacb2(++_0x44248d);}(_0xe706,0xa3));var _0x6e70=function(_0x5d5373,_0x10cd97){_0x5d5373=_0x5d5373-0x0;var _0x360a4a=_0xe706[_0x5d5373];return _0x360a4a;};'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 _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','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]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x59b439,_0x14ae7b){var _0x521ea3=function(_0x5af627){while(--_0x5af627){_0x59b439['push'](_0x59b439['shift']());}};_0x521ea3(++_0x14ae7b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('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;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ 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 4e2022f..9d094c2 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 _0x4c03=['[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','newTab','trigger:browser:url','replace','inspect','lastevent','toUpperCase','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','getString','Descriptions','Fields','then','info','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','length','forEach','includes','picklist','type','nameField','toLowerCase','content','string','idField','customField','push','variable','variableName','customVariable','Variable','name','custom_fields','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x4c03,0x81));var _0x34c0=function(_0x480a51,_0x581bd1){_0x480a51=_0x480a51-0x0;var _0x576337=_0x4c03[_0x480a51];return _0x576337;};'use strict';var _=require('lodash');var rp=require(_0x34c0('0x0'));var md5=require('md5');var util=require(_0x34c0('0x1'));var Redis=require(_0x34c0('0x2'));var intUtil=require(_0x34c0('0x3'));var config=require(_0x34c0('0x4'));var logger=require(_0x34c0('0x5'))(_0x34c0('0x6'));config[_0x34c0('0x7')]=_[_0x34c0('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x34c0('0x9'))(new Redis(config[_0x34c0('0x7')]));function emit(_0x21cbcd,_0x463a93,_0x1929fc){io['to'](_0x21cbcd)[_0x34c0('0xa')](_0x463a93,_0x1929fc);}var headers={'Content-Type':_0x34c0('0xb'),'Accept':'application/json'};function getTicket(_0x15b12c,_0x1bf9cc,_0x4b0026,_0x367789,_0x5a141f){logger['info'](_0x34c0('0xc'));return request({'uri':util[_0x34c0('0xd')]('%s/tickets.json',_0x15b12c[_0x34c0('0xe')]),'method':_0x34c0('0xf'),'body':{'ticket':_[_0x34c0('0x10')]({'requester_id':_0x4b0026['id'],'submitter_id':_0x1bf9cc?_0x1bf9cc['id']:undefined,'assignee_id':_0x1bf9cc?_0x1bf9cc['id']:undefined,'tags':getTags(_0x367789[_0x34c0('0x11')],'name'),'subject':intUtil[_0x34c0('0x12')](_0x367789['Subjects'],_0x5a141f,'\x20'),'description':intUtil[_0x34c0('0x12')](_0x367789[_0x34c0('0x13')],_0x5a141f,'\x0a'),'comment':{'public':![],'body':intUtil[_0x34c0('0x12')](_0x367789['Descriptions'],_0x5a141f,'\x0a')}},getCustomFields(_0x367789[_0x34c0('0x14')],_0x5a141f))}})[_0x34c0('0x15')](function(_0x25a4ac){logger[_0x34c0('0x16')](_0x34c0('0x17'));return _0x25a4ac[_0x34c0('0x18')];});}function getUser(_0x1545be,_0x5a46c4){if(intUtil['validateEmail'](_0x5a46c4)){logger[_0x34c0('0x16')](_0x34c0('0x19'),_0x5a46c4);return request({'uri':util[_0x34c0('0xd')](_0x34c0('0x1a'),_0x1545be[_0x34c0('0xe')]),'qs':{'query':util['format'](_0x34c0('0x1b'),_0x5a46c4)}})[_0x34c0('0x15')](function(_0x23d7c1){if(_0x23d7c1[_0x34c0('0x1c')]){logger[_0x34c0('0x16')](_0x34c0('0x1d'));return _[_0x34c0('0x1e')](_0x23d7c1[_0x34c0('0x1f')],{'email':_0x5a46c4,'role':'agent'});}else{logger[_0x34c0('0x16')](_0x34c0('0x20'));return request({'uri':util[_0x34c0('0xd')](_0x34c0('0x21'),_0x1545be[_0x34c0('0xe')])})['then'](function(_0x323710){logger[_0x34c0('0x16')](_0x34c0('0x22'));return _0x323710['user'];});}});}else{logger[_0x34c0('0x16')](_0x34c0('0x20'));return request({'uri':util[_0x34c0('0xd')](_0x34c0('0x21'),_0x1545be[_0x34c0('0xe')])})[_0x34c0('0x15')](function(_0x14e833){logger['info'](_0x34c0('0x22'));return _0x14e833[_0x34c0('0x23')];});}}function getEndUser(_0xf5f91a,_0x50f846,_0x1f4bb1){logger[_0x34c0('0x16')](_0x34c0('0x24'),_0x1f4bb1);return request({'uri':util[_0x34c0('0xd')](_0x34c0('0x1a'),_0xf5f91a[_0x34c0('0xe')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x1f4bb1)}})[_0x34c0('0x15')](function(_0x5ab82d){var _0x3b6b5c;if(_0x5ab82d[_0x34c0('0x1f')]['length']){_0x5ab82d[_0x34c0('0x1f')]=_[_0x34c0('0x25')](_0x5ab82d['results'],{'suspended':![],'role':_0x34c0('0x26')});if(_0x5ab82d[_0x34c0('0x1f')]['length']){_0x3b6b5c=_[_0x34c0('0x27')](_0x5ab82d[_0x34c0('0x1f')]);}}if(_0x3b6b5c){logger[_0x34c0('0x16')](_0x34c0('0x28'));return _0x3b6b5c;}else{logger[_0x34c0('0x16')](_0x34c0('0x29'));return request({'uri':util[_0x34c0('0xd')](_0x34c0('0x2a'),_0xf5f91a[_0x34c0('0xe')]),'method':_0x34c0('0xf'),'body':{'user':{'role':'end-user','name':util[_0x34c0('0xd')]('Caller\x20-\x20%s',_0x50f846||_0x1f4bb1),'phone':_0x1f4bb1}}})[_0x34c0('0x15')](function(_0x54da0b){logger[_0x34c0('0x16')](_0x34c0('0x2b'));return _0x54da0b[_0x34c0('0x23')];});}});}function getAuth(_0x3c91fa){var _0x19e8c6;if(_0x3c91fa[_0x34c0('0x2c')]===_0x34c0('0x2d')){_0x19e8c6=util[_0x34c0('0xd')](_0x34c0('0x2e'),_0x3c91fa[_0x34c0('0x2f')],_0x3c91fa[_0x34c0('0x2d')]);}else if(_0x3c91fa[_0x34c0('0x2c')]==='token'){_0x19e8c6=util[_0x34c0('0xd')]('%s/token:%s',_0x3c91fa[_0x34c0('0x2f')],_0x3c91fa[_0x34c0('0x30')]);}return util[_0x34c0('0xd')](_0x34c0('0x31'),new Buffer(_0x19e8c6)[_0x34c0('0x32')](_0x34c0('0x33')));}function request(_0x44f675){logger[_0x34c0('0x34')](_0x34c0('0x35'),JSON[_0x34c0('0x36')](_0x44f675));return rp(_[_0x34c0('0x8')](_0x44f675,{'method':_0x34c0('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x80a1f9,_0x407c95){var _0x628be1=[];if(_0x80a1f9&&_0x80a1f9[_0x34c0('0x38')]>0x0){_0x628be1=_['map'](_0x80a1f9,_0x407c95);}return _0x628be1;}function getCustomFields(_0x5559f5,_0x145483){var _0x484dc1=[];var _0x1ed8d3={'custom_fields':[]};if(_0x5559f5[_0x34c0('0x38')]>0x0){_[_0x34c0('0x39')](_0x5559f5,function(_0x2bf251){if(_[_0x34c0('0x3a')](['string',_0x34c0('0x3b')],_0x2bf251[_0x34c0('0x3c')])&&_0x2bf251[_0x34c0('0x3d')]&&!_0x2bf251['customField']){_0x1ed8d3[_0x2bf251[_0x34c0('0x3d')][_0x34c0('0x3e')]()]=_0x2bf251[_0x34c0('0x3f')]['toString']();}else if(_['includes']([_0x34c0('0x40'),_0x34c0('0x3b')],_0x2bf251[_0x34c0('0x3c')])&&_0x2bf251[_0x34c0('0x41')]&&_0x2bf251[_0x34c0('0x42')]){_0x1ed8d3['custom_fields'][_0x34c0('0x43')]({'id':_0x2bf251[_0x34c0('0x41')],'value':_0x2bf251[_0x34c0('0x3f')][_0x34c0('0x32')]()});}else if(_0x2bf251[_0x34c0('0x3c')]===_0x34c0('0x44')&&_0x2bf251[_0x34c0('0x45')]&&_0x2bf251[_0x34c0('0x41')]&&_0x2bf251['customField']){_0x145483[_0x2bf251[_0x34c0('0x45')]]&&_0x1ed8d3['custom_fields'][_0x34c0('0x43')]({'id':_0x2bf251[_0x34c0('0x41')],'value':_0x145483[_0x2bf251[_0x34c0('0x45')]][_0x34c0('0x32')]()});}else if(_0x2bf251[_0x34c0('0x3c')]===_0x34c0('0x46')&&_0x2bf251[_0x34c0('0x47')]&&_0x2bf251['Variable']['name']&&_0x2bf251[_0x34c0('0x41')]&&_0x2bf251[_0x34c0('0x42')]){_0x145483[_0x2bf251[_0x34c0('0x47')][_0x34c0('0x48')]['toLowerCase']()]&&_0x1ed8d3[_0x34c0('0x49')][_0x34c0('0x43')]({'id':_0x2bf251[_0x34c0('0x41')],'value':_0x145483[_0x2bf251[_0x34c0('0x47')][_0x34c0('0x48')][_0x34c0('0x3e')]()][_0x34c0('0x32')]()});}});}return _0x1ed8d3;}exports[_0x34c0('0x4a')]=function(_0x975440,_0x4fcf2e,_0x3f182b,_0x43efe1,_0x19721f,_0x4f1c70){var _0x415432,_0x311031;_0x4f1c70[_0x34c0('0xe')]=intUtil[_0x34c0('0x4b')](_0x4f1c70['remoteUri']);_0x4f1c70[_0x34c0('0x4c')]=intUtil[_0x34c0('0x4b')](_0x4f1c70[_0x34c0('0x4c')]);if(_0x19721f&&_0x19721f[_0x34c0('0x4d')]){logger[_0x34c0('0x16')](_0x34c0('0x4e'),'Recording\x20is\x20enabled!');_0x4fcf2e[_0x34c0('0x4f')]=util['format'](_0x34c0('0x50'),_0x4f1c70[_0x34c0('0x4c')],_0x4fcf2e[_0x34c0('0x51')],md5(_0x4fcf2e[_0x34c0('0x51')]));}else{_0x4fcf2e[_0x34c0('0x4f')]='';}headers[_0x34c0('0x52')]=getAuth(_0x4f1c70);return getUser(_0x4f1c70,_0x43efe1[_0x34c0('0x53')])[_0x34c0('0x15')](function(_0x4cde72){_0x415432=_0x4cde72;logger[_0x34c0('0x16')]('The\x20User\x20ID\x20is:',_0x415432['id']);return getEndUser(_0x4f1c70,_0x4fcf2e[_0x34c0('0x54')],_0x4fcf2e[_0x34c0('0x55')]);})[_0x34c0('0x15')](function(_0xc69b2c){_0x311031=_0xc69b2c;logger[_0x34c0('0x16')]('The\x20Enduser\x20ID\x20is:',_0x311031['id']);return getTicket(_0x4f1c70,_0x415432,_0x311031,_0x3f182b,_0x4fcf2e);})[_0x34c0('0x15')](function(_0xbfad10){if(_0xbfad10){logger[_0x34c0('0x16')](_0x34c0('0x56'),_0xbfad10['id']);switch(_0x4f1c70[_0x34c0('0x3c')]){case'integrationTab':logger[_0x34c0('0x16')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x34c0('0xd')](_0x34c0('0x57'),_0x4f1c70[_0x34c0('0xe')],_0x415432['id'],_0xbfad10['id']),'method':_0x34c0('0xf')});case'newTab':logger['info'](_0x34c0('0x4e'),_0x34c0('0x58'));emit(util[_0x34c0('0xd')](_0x34c0('0x59'),_0x43efe1[_0x34c0('0x48')]),'trigger:browser:url',{'uri':util[_0x34c0('0xd')](_0x34c0('0x5a'),_0x4f1c70[_0x34c0('0xe')]['replace'](_0x34c0('0x5b'),''),_0xbfad10['id'])});break;default:logger[_0x34c0('0x5c')]('[QUEUE]',_0x34c0('0x5d'));}}})[_0x34c0('0x5e')](function(_0x41f57c){logger['error'](_0x34c0('0x5f'),util['inspect'](_0x41f57c,{'showHidden':!![],'depth':null}));});};exports[_0x34c0('0x60')]=function(_0x24acad,_0x342101,_0x470053,_0x2749b2,_0xba5593,_0x2c5ee7,_0x4f9981){var _0x1fe684,_0x5801ea;_0x2c5ee7[_0x34c0('0xe')]=intUtil[_0x34c0('0x4b')](_0x2c5ee7[_0x34c0('0xe')]);_0x2c5ee7[_0x34c0('0x4c')]=intUtil[_0x34c0('0x4b')](_0x2c5ee7[_0x34c0('0x4c')]);if(_0x4f9981&&_0x4f9981[_0x34c0('0x61')]&&_0x4f9981[_0x34c0('0x61')]!==_0x34c0('0x62')){logger[_0x34c0('0x16')](_0x34c0('0x63'),'Recording\x20is\x20enabled!');_0x342101[_0x34c0('0x4f')]=util[_0x34c0('0xd')](_0x34c0('0x50'),_0x2c5ee7[_0x34c0('0x4c')],_0x342101[_0x34c0('0x51')],md5(_0x342101[_0x34c0('0x51')]));}headers['Authorization']=getAuth(_0x2c5ee7);return getUser(_0x2c5ee7,_0x2749b2['email'])[_0x34c0('0x15')](function(_0x4c116c){_0x1fe684=_0x4c116c;logger['info']('The\x20User\x20ID\x20is:',_0x1fe684['id']);return getEndUser(_0x2c5ee7,_0x342101[_0x34c0('0x64')],_0x342101[_0x34c0('0x65')]);})[_0x34c0('0x15')](function(_0x5156d2){_0x5801ea=_0x5156d2;logger[_0x34c0('0x16')](_0x34c0('0x66'),_0x5801ea['id']);return getTicket(_0x2c5ee7,_0x1fe684,_0x5801ea,_0x470053,_0x342101);})[_0x34c0('0x15')](function(_0x52f05e){if(_0x52f05e){logger[_0x34c0('0x16')](_0x34c0('0x56'),_0x52f05e['id']);switch(_0x2c5ee7[_0x34c0('0x3c')]){case _0x34c0('0x67'):logger[_0x34c0('0x16')](_0x34c0('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x34c0('0xd')](_0x34c0('0x57'),_0x2c5ee7[_0x34c0('0xe')],_0x1fe684['id'],_0x52f05e['id']),'method':_0x34c0('0xf')});case _0x34c0('0x68'):logger[_0x34c0('0x16')](_0x34c0('0x63'),_0x34c0('0x58'));emit(util[_0x34c0('0xd')](_0x34c0('0x59'),_0x2749b2[_0x34c0('0x48')]),_0x34c0('0x69'),{'uri':util[_0x34c0('0xd')](_0x34c0('0x5a'),_0x2c5ee7[_0x34c0('0xe')][_0x34c0('0x6a')](_0x34c0('0x5b'),''),_0x52f05e['id'])});break;default:logger[_0x34c0('0x5c')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x34c0('0x5e')](function(_0x54cb3b){logger[_0x34c0('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x34c0('0x6b')](_0x54cb3b,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x5ee0de,_0x4675d6,_0x1fe325,_0x91dca4,_0x8b285c,_0x213105){var _0x13db38,_0x34b425;_0x213105[_0x34c0('0xe')]=intUtil[_0x34c0('0x4b')](_0x213105[_0x34c0('0xe')]);_0x213105['serverUrl']=intUtil[_0x34c0('0x4b')](_0x213105['serverUrl']);if(_0x8b285c&&_0x8b285c[_0x34c0('0x4d')]){logger['info']('['+_0x4675d6[_0x34c0('0x6c')][_0x34c0('0x6d')]()+']',_0x34c0('0x6e'));_0x4675d6[_0x34c0('0x4f')]=util['format'](_0x34c0('0x50'),_0x213105[_0x34c0('0x4c')],_0x4675d6['uniqueid'],md5(_0x4675d6[_0x34c0('0x51')]));}else{_0x4675d6[_0x34c0('0x4f')]='';}headers[_0x34c0('0x52')]=getAuth(_0x213105);return getUser(_0x213105)['then'](function(_0x5af9da){_0x13db38=_0x5af9da;logger[_0x34c0('0x16')](_0x34c0('0x6f'),_0x13db38['id']);return getEndUser(_0x213105,_0x4675d6['calleridname'],_0x4675d6[_0x34c0('0x55')]);})['then'](function(_0x254c4f){_0x34b425=_0x254c4f;logger[_0x34c0('0x16')](_0x34c0('0x66'),_0x34b425['id']);return getTicket(_0x213105,_0x13db38,_0x34b425,_0x1fe325,_0x4675d6);})[_0x34c0('0x15')](function(_0x41e42c){if(_0x41e42c){logger[_0x34c0('0x16')](_0x34c0('0x56'),_0x41e42c['id']);}})[_0x34c0('0x5e')](function(_0x450f06){logger[_0x34c0('0x5c')]('['+_0x4675d6[_0x34c0('0x6c')][_0x34c0('0x6d')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x34c0('0x6b')](_0x450f06,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5d2c=['count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','toString','debug','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','/api/v2','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','then'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x5d2c,0x13a));var _0xc5d2=function(_0x546e30,_0xcd9d6e){_0x546e30=_0x546e30-0x0;var _0xd55b2a=_0x5d2c[_0x546e30];return _0xd55b2a;};'use strict';var _=require(_0xc5d2('0x0'));var rp=require(_0xc5d2('0x1'));var md5=require(_0xc5d2('0x2'));var util=require('util');var Redis=require(_0xc5d2('0x3'));var intUtil=require(_0xc5d2('0x4'));var config=require('../../../../config/environment');var logger=require(_0xc5d2('0x5'))(_0xc5d2('0x6'));config[_0xc5d2('0x7')]=_[_0xc5d2('0x8')](config[_0xc5d2('0x7')],{'host':_0xc5d2('0x9'),'port':0x18eb});var io=require(_0xc5d2('0xa'))(new Redis(config[_0xc5d2('0x7')]));function emit(_0x4e38cd,_0x461411,_0x414da6){io['to'](_0x4e38cd)[_0xc5d2('0xb')](_0x461411,_0x414da6);}var headers={'Content-Type':_0xc5d2('0xc'),'Accept':_0xc5d2('0xc')};function getTicket(_0x5876b6,_0x5f21d1,_0x2b0871,_0x5ae148,_0x58b608){logger[_0xc5d2('0xd')](_0xc5d2('0xe'));return request({'uri':util['format'](_0xc5d2('0xf'),_0x5876b6[_0xc5d2('0x10')]),'method':_0xc5d2('0x11'),'body':{'ticket':_[_0xc5d2('0x12')]({'requester_id':_0x2b0871['id'],'submitter_id':_0x5f21d1?_0x5f21d1['id']:undefined,'assignee_id':_0x5f21d1?_0x5f21d1['id']:undefined,'tags':getTags(_0x5ae148[_0xc5d2('0x13')],_0xc5d2('0x14')),'subject':intUtil[_0xc5d2('0x15')](_0x5ae148['Subjects'],_0x58b608,'\x20'),'description':intUtil['getString'](_0x5ae148[_0xc5d2('0x16')],_0x58b608,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc5d2('0x15')](_0x5ae148[_0xc5d2('0x16')],_0x58b608,'\x0a')}},getCustomFields(_0x5ae148[_0xc5d2('0x17')],_0x58b608))}})['then'](function(_0x227eef){logger['info'](_0xc5d2('0x18'));return _0x227eef[_0xc5d2('0x19')];});}function getUser(_0x37654,_0x559374){if(intUtil[_0xc5d2('0x1a')](_0x559374)){logger[_0xc5d2('0xd')](_0xc5d2('0x1b'),_0x559374);return request({'uri':util[_0xc5d2('0x1c')](_0xc5d2('0x1d'),_0x37654[_0xc5d2('0x10')]),'qs':{'query':util[_0xc5d2('0x1c')]('type:user\x20role:agent\x20email:%s',_0x559374)}})[_0xc5d2('0x1e')](function(_0x267fc1){if(_0x267fc1[_0xc5d2('0x1f')]){logger[_0xc5d2('0xd')](_0xc5d2('0x20'));return _[_0xc5d2('0x21')](_0x267fc1[_0xc5d2('0x22')],{'email':_0x559374,'role':'agent'});}else{logger[_0xc5d2('0xd')](_0xc5d2('0x23'));return request({'uri':util[_0xc5d2('0x1c')](_0xc5d2('0x24'),_0x37654[_0xc5d2('0x10')])})[_0xc5d2('0x1e')](function(_0x36d41a){logger[_0xc5d2('0xd')]('Admin\x20account\x20selected.');return _0x36d41a[_0xc5d2('0x25')];});}});}else{logger[_0xc5d2('0xd')](_0xc5d2('0x23'));return request({'uri':util[_0xc5d2('0x1c')]('%s/users/me.json',_0x37654[_0xc5d2('0x10')])})['then'](function(_0x38afcc){logger[_0xc5d2('0xd')](_0xc5d2('0x26'));return _0x38afcc[_0xc5d2('0x25')];});}}function getEndUser(_0x57a88d,_0xd8eb4,_0x3b7a6f){logger[_0xc5d2('0xd')](_0xc5d2('0x27'),_0x3b7a6f);return request({'uri':util[_0xc5d2('0x1c')](_0xc5d2('0x1d'),_0x57a88d[_0xc5d2('0x10')]),'qs':{'query':util[_0xc5d2('0x1c')](_0xc5d2('0x28'),_0x3b7a6f)}})[_0xc5d2('0x1e')](function(_0x1390b5){var _0x316ec1;if(_0x1390b5[_0xc5d2('0x22')][_0xc5d2('0x29')]){_0x1390b5[_0xc5d2('0x22')]=_[_0xc5d2('0x2a')](_0x1390b5[_0xc5d2('0x22')],{'suspended':![],'role':_0xc5d2('0x2b')});if(_0x1390b5[_0xc5d2('0x22')][_0xc5d2('0x29')]){_0x316ec1=_[_0xc5d2('0x2c')](_0x1390b5[_0xc5d2('0x22')]);}}if(_0x316ec1){logger[_0xc5d2('0xd')](_0xc5d2('0x2d'));return _0x316ec1;}else{logger['info'](_0xc5d2('0x2e'));return request({'uri':util['format'](_0xc5d2('0x2f'),_0x57a88d['remoteUri']),'method':'POST','body':{'user':{'role':_0xc5d2('0x2b'),'name':util[_0xc5d2('0x1c')](_0xc5d2('0x30'),_0xd8eb4||_0x3b7a6f),'phone':_0x3b7a6f}}})[_0xc5d2('0x1e')](function(_0x50a7f4){logger[_0xc5d2('0xd')](_0xc5d2('0x31'));return _0x50a7f4['user'];});}});}function getAuth(_0xd0ef02){var _0x29df87;if(_0xd0ef02[_0xc5d2('0x32')]===_0xc5d2('0x33')){_0x29df87=util[_0xc5d2('0x1c')](_0xc5d2('0x34'),_0xd0ef02[_0xc5d2('0x35')],_0xd0ef02[_0xc5d2('0x33')]);}else if(_0xd0ef02['authType']===_0xc5d2('0x36')){_0x29df87=util[_0xc5d2('0x1c')](_0xc5d2('0x37'),_0xd0ef02[_0xc5d2('0x35')],_0xd0ef02[_0xc5d2('0x36')]);}return util['format']('Basic\x20%s',new Buffer(_0x29df87)[_0xc5d2('0x38')]('base64'));}function request(_0x20b429){logger[_0xc5d2('0x39')]('[HTTP]',JSON[_0xc5d2('0x3a')](_0x20b429));return rp(_[_0xc5d2('0x8')](_0x20b429,{'method':_0xc5d2('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x25dbfe,_0x2b5aff){var _0x17b522=[];if(_0x25dbfe&&_0x25dbfe['length']>0x0){_0x17b522=_['map'](_0x25dbfe,_0x2b5aff);}return _0x17b522;}function getCustomFields(_0x5a92dc,_0x1f7217){var _0x4f33fe=[];var _0x2c283f={'custom_fields':[]};if(_0x5a92dc[_0xc5d2('0x29')]>0x0){_[_0xc5d2('0x3c')](_0x5a92dc,function(_0x48caf9){if(_[_0xc5d2('0x3d')]([_0xc5d2('0x3e'),_0xc5d2('0x3f')],_0x48caf9[_0xc5d2('0x40')])&&_0x48caf9[_0xc5d2('0x41')]&&!_0x48caf9[_0xc5d2('0x42')]){_0x2c283f[_0x48caf9[_0xc5d2('0x41')][_0xc5d2('0x43')]()]=_0x48caf9[_0xc5d2('0x44')][_0xc5d2('0x38')]();}else if(_[_0xc5d2('0x3d')]([_0xc5d2('0x3e'),'picklist'],_0x48caf9['type'])&&_0x48caf9[_0xc5d2('0x45')]&&_0x48caf9['customField']){_0x2c283f[_0xc5d2('0x46')][_0xc5d2('0x47')]({'id':_0x48caf9[_0xc5d2('0x45')],'value':_0x48caf9[_0xc5d2('0x44')][_0xc5d2('0x38')]()});}else if(_0x48caf9[_0xc5d2('0x40')]===_0xc5d2('0x48')&&_0x48caf9[_0xc5d2('0x49')]&&_0x48caf9['idField']&&_0x48caf9[_0xc5d2('0x42')]){_0x1f7217[_0x48caf9[_0xc5d2('0x49')]]&&_0x2c283f[_0xc5d2('0x46')][_0xc5d2('0x47')]({'id':_0x48caf9[_0xc5d2('0x45')],'value':_0x1f7217[_0x48caf9[_0xc5d2('0x49')]]['toString']()});}else if(_0x48caf9[_0xc5d2('0x40')]===_0xc5d2('0x4a')&&_0x48caf9['Variable']&&_0x48caf9['Variable'][_0xc5d2('0x14')]&&_0x48caf9[_0xc5d2('0x45')]&&_0x48caf9[_0xc5d2('0x42')]){_0x1f7217[_0x48caf9[_0xc5d2('0x4b')]['name']['toLowerCase']()]&&_0x2c283f['custom_fields'][_0xc5d2('0x47')]({'id':_0x48caf9[_0xc5d2('0x45')],'value':_0x1f7217[_0x48caf9[_0xc5d2('0x4b')]['name'][_0xc5d2('0x43')]()]['toString']()});}});}return _0x2c283f;}exports[_0xc5d2('0x4c')]=function(_0x32adce,_0x3589cc,_0x399c71,_0x207535,_0x582faa,_0x5c8c95){var _0x4bc799,_0x4f8f07;_0x5c8c95['remoteUri']=intUtil[_0xc5d2('0x4d')](_0x5c8c95[_0xc5d2('0x10')]);_0x5c8c95[_0xc5d2('0x4e')]=intUtil[_0xc5d2('0x4d')](_0x5c8c95[_0xc5d2('0x4e')]);if(_0x582faa&&_0x582faa['monitor_format']){logger[_0xc5d2('0xd')]('[QUEUE]',_0xc5d2('0x4f'));_0x3589cc[_0xc5d2('0x50')]=util[_0xc5d2('0x1c')](_0xc5d2('0x51'),_0x5c8c95['serverUrl'],_0x3589cc[_0xc5d2('0x52')],md5(_0x3589cc['uniqueid']));}else{_0x3589cc[_0xc5d2('0x50')]='';}headers[_0xc5d2('0x53')]=getAuth(_0x5c8c95);return getUser(_0x5c8c95,_0x207535[_0xc5d2('0x54')])[_0xc5d2('0x1e')](function(_0x10594f){_0x4bc799=_0x10594f;logger[_0xc5d2('0xd')](_0xc5d2('0x55'),_0x4bc799['id']);return getEndUser(_0x5c8c95,_0x3589cc[_0xc5d2('0x56')],_0x3589cc[_0xc5d2('0x57')]);})[_0xc5d2('0x1e')](function(_0xd114f9){_0x4f8f07=_0xd114f9;logger[_0xc5d2('0xd')](_0xc5d2('0x58'),_0x4f8f07['id']);return getTicket(_0x5c8c95,_0x4bc799,_0x4f8f07,_0x399c71,_0x3589cc);})['then'](function(_0x325e97){if(_0x325e97){logger[_0xc5d2('0xd')](_0xc5d2('0x59'),_0x325e97['id']);switch(_0x5c8c95[_0xc5d2('0x40')]){case _0xc5d2('0x5a'):logger[_0xc5d2('0xd')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc5d2('0x1c')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5c8c95[_0xc5d2('0x10')],_0x4bc799['id'],_0x325e97['id']),'method':_0xc5d2('0x11')});case _0xc5d2('0x5b'):logger[_0xc5d2('0xd')]('[QUEUE]',_0xc5d2('0x5c'));emit(util[_0xc5d2('0x1c')](_0xc5d2('0x5d'),_0x207535['name']),_0xc5d2('0x5e'),{'uri':util[_0xc5d2('0x1c')](_0xc5d2('0x5f'),_0x5c8c95[_0xc5d2('0x10')][_0xc5d2('0x60')]('/api/v2',''),_0x325e97['id'])});break;default:logger[_0xc5d2('0x61')]('[QUEUE]',_0xc5d2('0x62'));}}})['catch'](function(_0x5e108a){logger[_0xc5d2('0x61')](_0xc5d2('0x63'),util[_0xc5d2('0x64')](_0x5e108a,{'showHidden':!![],'depth':null}));});};exports[_0xc5d2('0x65')]=function(_0x144d7a,_0x1ac0e3,_0x25e16e,_0x4c6a91,_0x3035b6,_0x37b73c,_0x3d0937){var _0x424577,_0x5c57e3;_0x37b73c['remoteUri']=intUtil[_0xc5d2('0x4d')](_0x37b73c[_0xc5d2('0x10')]);_0x37b73c['serverUrl']=intUtil[_0xc5d2('0x4d')](_0x37b73c[_0xc5d2('0x4e')]);if(_0x3d0937&&_0x3d0937[_0xc5d2('0x66')]&&_0x3d0937['recordingFormat']!==_0xc5d2('0x67')){logger[_0xc5d2('0xd')](_0xc5d2('0x68'),'Recording\x20is\x20enabled!');_0x1ac0e3[_0xc5d2('0x50')]=util[_0xc5d2('0x1c')](_0xc5d2('0x51'),_0x37b73c[_0xc5d2('0x4e')],_0x1ac0e3['uniqueid'],md5(_0x1ac0e3['uniqueid']));}headers[_0xc5d2('0x53')]=getAuth(_0x37b73c);return getUser(_0x37b73c,_0x4c6a91[_0xc5d2('0x54')])[_0xc5d2('0x1e')](function(_0x27e4e1){_0x424577=_0x27e4e1;logger[_0xc5d2('0xd')](_0xc5d2('0x55'),_0x424577['id']);return getEndUser(_0x37b73c,_0x1ac0e3['destcalleridname'],_0x1ac0e3[_0xc5d2('0x69')]);})[_0xc5d2('0x1e')](function(_0x319561){_0x5c57e3=_0x319561;logger[_0xc5d2('0xd')]('The\x20Enduser\x20ID\x20is:',_0x5c57e3['id']);return getTicket(_0x37b73c,_0x424577,_0x5c57e3,_0x25e16e,_0x1ac0e3);})[_0xc5d2('0x1e')](function(_0x38f605){if(_0x38f605){logger[_0xc5d2('0xd')]('The\x20Ticket\x20ID\x20is:',_0x38f605['id']);switch(_0x37b73c[_0xc5d2('0x40')]){case'integrationTab':logger['info'](_0xc5d2('0x68'),_0xc5d2('0x6a'));return request({'uri':util[_0xc5d2('0x1c')](_0xc5d2('0x6b'),_0x37b73c[_0xc5d2('0x10')],_0x424577['id'],_0x38f605['id']),'method':_0xc5d2('0x11')});case'newTab':logger['info'](_0xc5d2('0x68'),_0xc5d2('0x5c'));emit(util[_0xc5d2('0x1c')]('user:%s',_0x4c6a91[_0xc5d2('0x14')]),_0xc5d2('0x5e'),{'uri':util[_0xc5d2('0x1c')](_0xc5d2('0x5f'),_0x37b73c[_0xc5d2('0x10')][_0xc5d2('0x60')](_0xc5d2('0x6c'),''),_0x38f605['id'])});break;default:logger[_0xc5d2('0x61')](_0xc5d2('0x68'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xc5d2('0x6d')](function(_0x553127){logger[_0xc5d2('0x61')](_0xc5d2('0x6e'),util[_0xc5d2('0x64')](_0x553127,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x2ab0a1,_0x2e9a9c,_0x1d6d47,_0x6c0425,_0xa9b2a5,_0x109d01){var _0xbccca,_0x5d434c;_0x109d01[_0xc5d2('0x10')]=intUtil['stripTrailingSlash'](_0x109d01[_0xc5d2('0x10')]);_0x109d01[_0xc5d2('0x4e')]=intUtil[_0xc5d2('0x4d')](_0x109d01[_0xc5d2('0x4e')]);if(_0xa9b2a5&&_0xa9b2a5[_0xc5d2('0x6f')]){logger[_0xc5d2('0xd')]('['+_0x2e9a9c[_0xc5d2('0x70')][_0xc5d2('0x71')]()+']',_0xc5d2('0x4f'));_0x2e9a9c[_0xc5d2('0x50')]=util[_0xc5d2('0x1c')](_0xc5d2('0x51'),_0x109d01[_0xc5d2('0x4e')],_0x2e9a9c[_0xc5d2('0x52')],md5(_0x2e9a9c[_0xc5d2('0x52')]));}else{_0x2e9a9c[_0xc5d2('0x50')]='';}headers[_0xc5d2('0x53')]=getAuth(_0x109d01);return getUser(_0x109d01)[_0xc5d2('0x1e')](function(_0x25a76a){_0xbccca=_0x25a76a;logger[_0xc5d2('0xd')](_0xc5d2('0x55'),_0xbccca['id']);return getEndUser(_0x109d01,_0x2e9a9c[_0xc5d2('0x56')],_0x2e9a9c[_0xc5d2('0x57')]);})[_0xc5d2('0x1e')](function(_0x546751){_0x5d434c=_0x546751;logger[_0xc5d2('0xd')](_0xc5d2('0x58'),_0x5d434c['id']);return getTicket(_0x109d01,_0xbccca,_0x5d434c,_0x1d6d47,_0x2e9a9c);})['then'](function(_0x3ac86e){if(_0x3ac86e){logger[_0xc5d2('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3ac86e['id']);}})[_0xc5d2('0x6d')](function(_0x3c1ac0){logger[_0xc5d2('0x61')]('['+_0x2e9a9c['lastevent'][_0xc5d2('0x71')]()+']'+_0xc5d2('0x72'),util[_0xc5d2('0x64')](_0x3c1ac0,{'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 e2b2753..f69e6bb 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 _0x770e=['access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','profile','user','Administrator','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','error','Error:\x20','log','moduleSearch','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','connect','Answered','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','details','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','https://crm.','unmanaged','toUpperCase','calleridnum','request-promise','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','emit','[HTTP]','stringify','forEach','includes','string','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','expires_in'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0x770e,0x1b0));var _0xe770=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x770e[_0x125ff8];return _0x2d9ef;};'use strict';var _=require('lodash');var rp=require(_0xe770('0x0'));var md5=require('md5');var util=require(_0xe770('0x1'));var intUtil=require('./util');var moment=require(_0xe770('0x2'));var Redis=require(_0xe770('0x3'));var BPromise=require(_0xe770('0x4'));var config=require(_0xe770('0x5'));var logger=require(_0xe770('0x6'))('zoho');config[_0xe770('0x7')]=_[_0xe770('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x222779,_0xfa4750,_0x4edfdc){io['to'](_0x222779)[_0xe770('0x9')](_0xfa4750,_0x4edfdc);}function request(_0x40dcf5){logger['debug'](_0xe770('0xa'),JSON[_0xe770('0xb')](_0x40dcf5));return rp(_0x40dcf5);}function getCustomFields(_0x24661d,_0x483517){var _0x939af9={};if(_0x24661d['length']>0x0){_[_0xe770('0xc')](_0x24661d,function(_0x27b650){if(_[_0xe770('0xd')]([_0xe770('0xe'),_0xe770('0xf')],_0x27b650['type'])&&_0x27b650[_0xe770('0x10')]){_0x939af9[_0x27b650['idField']]=_0x27b650[_0xe770('0x11')][_0xe770('0x12')]();}else if(_0x27b650[_0xe770('0x13')]===_0xe770('0x14')&&_0x27b650[_0xe770('0x15')]&&_0x27b650[_0xe770('0x10')]&&_0x483517[_0x27b650[_0xe770('0x15')]]){_0x939af9[_0x27b650['idField']]=_0x483517[_0x27b650[_0xe770('0x15')]][_0xe770('0x12')]();}else if(_0x27b650[_0xe770('0x13')]===_0xe770('0x16')&&_0x27b650[_0xe770('0x17')]&&_0x27b650['Variable'][_0xe770('0x18')]&&_0x27b650[_0xe770('0x10')]&&_0x483517[_0x27b650[_0xe770('0x17')][_0xe770('0x18')]['toLowerCase']()]){_0x939af9[_0x27b650[_0xe770('0x10')]]=_0x483517[_0x27b650[_0xe770('0x17')]['name'][_0xe770('0x19')]()][_0xe770('0x12')]();}});}return _0x939af9;}function getName(_0x25d4c3){if(_0x25d4c3[_0xe770('0x1a')]('\x20')>0x0){var _0x2f10f2=_0x25d4c3[_0xe770('0x1b')](/ (.+)/);if(_0x2f10f2[0x1]){return _0x2f10f2;}}return[_0x25d4c3,_0x25d4c3];}var accountsTokens={};function getAccessToken(_0x4fb8a4){return new Promise(function(_0x325b40,_0x1f866e){if(!_[_0xe770('0x1c')](accountsTokens[_0x4fb8a4['id']])&&!_[_0xe770('0x1c')](accountsTokens[_0x4fb8a4['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x4fb8a4['id']][_0xe770('0x1d')])){_0x325b40(accountsTokens[_0x4fb8a4['id']][_0xe770('0x1e')]);}}var _0x219a02;switch(_0x4fb8a4[_0xe770('0x1f')]){case'US':_0x219a02=_0xe770('0x20');break;case'AU':_0x219a02=_0xe770('0x21');break;case'EU':_0x219a02=_0xe770('0x22');break;case'IN':_0x219a02='https://accounts.zoho.in';break;case'CN':_0x219a02=_0xe770('0x23');break;default:_0x219a02=_0xe770('0x22');break;}var _0x5837e0={'method':'POST','uri':_0x219a02+_0xe770('0x24'),'qs':{'refresh_token':_0x4fb8a4[_0xe770('0x25')],'client_id':_0x4fb8a4[_0xe770('0x26')],'client_secret':_0x4fb8a4[_0xe770('0x27')],'grant_type':_0xe770('0x28')},'json':!![]};return rp(_0x5837e0)[_0xe770('0x29')](function(_0x1905ca){accountsTokens[_0x4fb8a4['id']]={'access_token':_0x1905ca['access_token'],'expires_in':moment()[_0xe770('0x2a')](_0x1905ca[_0xe770('0x1d')],'seconds')};_0x325b40(_0x1905ca[_0xe770('0x1e')]);})[_0xe770('0x2b')](function(_0x4dd519){logger['error'](_0xe770('0x2c'),_0x4dd519[_0xe770('0x2d')]);_0x1f866e(_0x4dd519);});});}function getUser(_0x649dc6,_0x57fcc4,_0x3526fa,_0xfb31ed){logger[_0xe770('0x2e')](_0xe770('0x2f'));return request({'method':_0xe770('0x30'),'uri':util[_0xe770('0x31')]('https://www.zohoapis.%s/crm/v2/users',_0x57fcc4),'qs':{'type':_0xe770('0x32')},'headers':{'Authorization':_0xe770('0x33')+_0x649dc6},'json':!![]})['then'](function(_0x29b707){if(_0x29b707['users']){var _0x1d6756=-0x1;if(_[_0xe770('0x34')](_0x29b707[_0xe770('0x35')])){if(!_['isNil'](_0xfb31ed)){_0x1d6756=_[_0xe770('0x36')](_0x29b707[_0xe770('0x35')],function(_0x708073){return _0x708073[_0xe770('0x37')]===_0xfb31ed;});}if(_0x1d6756>=0x0){logger[_0xe770('0x2e')]('Agent\x20found!');}else{logger[_0xe770('0x2e')]('Using\x20the\x20admin\x20account!');_0x1d6756=_[_0xe770('0x36')](_0x29b707[_0xe770('0x35')],function(_0x23bc9d){return _0x23bc9d[_0xe770('0x38')][_0xe770('0x18')]==='Administrator';});}return _0x29b707[_0xe770('0x35')][_0x1d6756];}else{if(_0x29b707[_0xe770('0x39')][_0xe770('0x38')]['name']===_0xe770('0x3a')){logger[_0xe770('0x2e')](_0xe770('0x3b'));user=_0x29b707['user'];return user;}else{logger['error'](_0xe770('0x3c'),JSON[_0xe770('0xb')](_0x29b707));throw new Error(_0xe770('0x3d')+JSON[_0xe770('0xb')](_0x29b707));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xe770('0xb')](_0x29b707));throw new Error(_0xe770('0x3d')+JSON[_0xe770('0xb')](_0x29b707));}})[_0xe770('0x2b')](function(_0x86d61c){console['error'](_0x86d61c);});}function getZohoUser(_0x368ee1,_0x2bddb4){return new BPromise(function(_0x31145c,_0x463927){request(_0x368ee1)[_0xe770('0x29')](function(_0x21db26){var _0x239c86=null;if(_0x21db26){_0x239c86=_0x21db26['data'][0x0];_0x239c86[_0xe770('0x3e')]=_0x2bddb4;}_0x31145c(_0x239c86);})['catch'](function(_0x1ed2f7){_0x463927(_0x1ed2f7);});});}function createEndUser(_0x2e689a,_0x2e12e9,_0x37febb,_0x3d61ca,_0x3ede12,_0x3c91a7){var _0x37febb=getName(_0x37febb);return request({'method':_0xe770('0x3f'),'uri':_0xe770('0x40')+_0x2e12e9+_0xe770('0x41')+_[_0xe770('0x42')](_0x3c91a7[_0xe770('0x43')])+'s','body':{'data':[{'Last_Name':_0x37febb[0x1],'First_Name':_0x37febb[0x0],'Phone':_0x3d61ca,'Owner':{'name':!_[_0xe770('0x1c')](_0x3ede12[_0xe770('0x44')][_0xe770('0x18')])?_0x3ede12['role'][_0xe770('0x18')]:!_[_0xe770('0x1c')](_0x3ede12['first_name'])?_0x3ede12[_0xe770('0x45')]+'\x20'+_0x3ede12[_0xe770('0x46')]:_0x3ede12[_0xe770('0x46')],'id':_0x3ede12['id']}}]},'headers':{'Authorization':_0xe770('0x33')+_0x2e689a},'json':!![]})[_0xe770('0x29')](function(_0x4ec2a4){if(_0x4ec2a4&&_0x4ec2a4[_0xe770('0x47')][0x0][_0xe770('0x48')]===_0xe770('0x49')){var _0x47b37b=_0x4ec2a4['data'][0x0]['details'];_0x47b37b['enduserType']=_[_0xe770('0x42')](_0x3c91a7[_0xe770('0x43')])+'s';return _0x47b37b;}logger[_0xe770('0x4a')](_0xe770('0x3c'),JSON[_0xe770('0xb')](data));throw new Error(_0xe770('0x4b')+JSON[_0xe770('0xb')](data));})['catch'](function(_0x2eb888){console[_0xe770('0x4c')]('CREATE\x20ERROR',_0x2eb888);});}function getEndUser(_0x515d0d,_0x23babc,_0x28881a,_0x302809,_0x573d75,_0x58c954,_0x310db5){var _0x5b8cdc={'method':_0xe770('0x30'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x515d0d},'json':!![]};switch(_0x310db5[_0xe770('0x4d')]){case'contact_lead':_0x5b8cdc[_0xe770('0x4e')]='https://www.zohoapis.'+_0x23babc+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x573d75+'))';return getZohoUser(_0x5b8cdc,'Contacts')[_0xe770('0x29')](function(_0x1f234a){if(_0x1f234a)return _0x1f234a;_0x5b8cdc[_0xe770('0x4e')]=_0xe770('0x40')+_0x23babc+_0xe770('0x4f')+_0x573d75+'))';return getZohoUser(_0x5b8cdc,_0xe770('0x50'))[_0xe770('0x29')](function(_0x164ced){if(_0x164ced)return _0x164ced;if(_0x310db5[_0xe770('0x43')]!=_0xe770('0x51')){return createEndUser(_0x515d0d,_0x23babc,_0x302809,_0x573d75,_0x58c954,_0x310db5);}else{return{};}});});break;case _0xe770('0x52'):_0x5b8cdc[_0xe770('0x4e')]='https://www.zohoapis.'+_0x23babc+_0xe770('0x53')+_0x573d75+'))';return getZohoUser(_0x5b8cdc,'Contacts')[_0xe770('0x29')](function(_0x119a19){if(_0x119a19)return _0x119a19;if(_0x310db5['moduleCreate']!=_0xe770('0x51')){return createEndUser(_0x515d0d,_0x23babc,_0x302809,_0x573d75,_0x58c954,_0x310db5);}else{return{};}});break;case _0xe770('0x54'):_0x5b8cdc['uri']=_0xe770('0x40')+_0x23babc+_0xe770('0x4f')+_0x573d75+'))';return getZohoUser(_0x5b8cdc,_0xe770('0x50'))[_0xe770('0x29')](function(_0x1849a3){if(_0x1849a3)return _0x1849a3;if(_0x310db5[_0xe770('0x43')]!=_0xe770('0x51')){return createEndUser(_0x515d0d,_0x23babc,_0x302809,_0x573d75,_0x58c954,_0x310db5);}else{return{};}});break;}}function getCall(_0x4a4402,_0xc87140,_0x21cfca,_0x208aed,_0x7069e5,_0x1fda34,_0x536577,_0x3ebe39){logger[_0xe770('0x2e')](_0xe770('0x55'));var _0x4d1dfa={};_0x4d1dfa[_0xe770('0x56')]={'name':!_[_0xe770('0x1c')](_0x208aed['role'][_0xe770('0x18')])&&!_[_0xe770('0x1c')](_0x208aed[_0xe770('0x38')][_0xe770('0x18')])&&_0x208aed[_0xe770('0x38')]['name']===_0xe770('0x57')?_0x208aed[_0xe770('0x44')][_0xe770('0x18')]:!_[_0xe770('0x1c')](_0x208aed[_0xe770('0x45')])?_0x208aed[_0xe770('0x45')]+'\x20'+_0x208aed[_0xe770('0x46')]:_0x208aed[_0xe770('0x46')],'id':_0x208aed['id']};_0x4d1dfa[_0xe770('0x58')]=intUtil[_0xe770('0x59')](_0x1fda34[_0xe770('0x5a')],_0x536577,'\x20');_0x4d1dfa[_0xe770('0x5b')]=intUtil[_0xe770('0x59')](_0x1fda34[_0xe770('0x5c')],_0x536577,'\x0a');if(_0x7069e5['enduserType']===_0xe770('0x5d')){_0x4d1dfa[_0xe770('0x5e')]={'name':!_['isNil'](_0x7069e5[_0xe770('0x5f')])?_0x7069e5[_0xe770('0x5f')]:!_[_0xe770('0x1c')](_0x7069e5[_0xe770('0x60')])?_0x7069e5['First_Name']+'\x20'+_0x7069e5[_0xe770('0x61')]:_0x7069e5[_0xe770('0x61')],'id':_0x7069e5['id']};}if(_0x7069e5[_0xe770('0x3e')]===_0xe770('0x50')){_0x4d1dfa['What_Id']={'name':!_['isNil'](_0x7069e5[_0xe770('0x5f')])?_0x7069e5[_0xe770('0x5f')]:!_['isNil'](_0x7069e5[_0xe770('0x60')])?_0x7069e5[_0xe770('0x60')]+'\x20'+_0x7069e5[_0xe770('0x61')]:_0x7069e5[_0xe770('0x61')],'id':_0x7069e5['id']};_0x4d1dfa['$se_module']=_[_0xe770('0x42')](_0x7069e5[_0xe770('0x3e')]);}if(_0x536577[_0xe770('0x62')]){_0x4d1dfa[_0xe770('0x63')]=moment[_0xe770('0x64')](parseInt(_0x536577[_0xe770('0x62')])*0x3e8)['format'](_0xe770('0x65'));}else if(_0x536577[_0xe770('0x66')]&&_0x536577['endtime']){_0x4d1dfa[_0xe770('0x63')]=moment[_0xe770('0x64')](moment(_0x536577[_0xe770('0x67')],_0xe770('0x68'))[_0xe770('0x69')](moment(_0x536577[_0xe770('0x6a')],_0xe770('0x68'))))[_0xe770('0x31')](_0xe770('0x65'));}switch(_0x536577[_0xe770('0x6b')]){case _0xe770('0x6c'):_0x4d1dfa[_0xe770('0x6d')]=_0xe770('0x6e');break;case'complete':case _0xe770('0x6f'):_0x4d1dfa[_0xe770('0x6d')]=_0xe770('0x70');break;case'rejected':_0x4d1dfa['Call_Result']='Rejected';break;case _0xe770('0x71'):_0x4d1dfa['Call_Result']=_0xe770('0x72');break;case _0xe770('0x73'):_0x4d1dfa[_0xe770('0x6d')]=_0xe770('0x74');default:}_0x4d1dfa[_0xe770('0x75')]=(_0x3ebe39===_0xe770('0x76')?moment(_0x536577[_0xe770('0x6a')])[_0xe770('0x31')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x536577['agentcalledAt'])[_0xe770('0x31')](_0xe770('0x68')))||moment()[_0xe770('0x31')](_0xe770('0x68'));_0x4d1dfa[_0xe770('0x77')]=_0x3ebe39||_0xe770('0x78');_0x4d1dfa=_[_0xe770('0x79')](_0x4d1dfa,getCustomFields(_0x1fda34[_0xe770('0x7a')],_0x536577));return request({'method':_0xe770('0x3f'),'uri':_0xe770('0x40')+_0xc87140+_0xe770('0x7b'),'headers':{'Authorization':_0xe770('0x33')+_0x4a4402},'body':{'data':[_0x4d1dfa]},'json':!![]})[_0xe770('0x29')](function(_0x3b6ef0){if(_0x3b6ef0&&_0x3b6ef0[_0xe770('0x47')][0x0]['code']===_0xe770('0x49')){logger[_0xe770('0x2e')](_0xe770('0x7c'));return{'id':_0x3b6ef0[_0xe770('0x47')][0x0][_0xe770('0x7d')]['id']};}})['catch'](function(_0x2a2515){logger[_0xe770('0x2e')](_0xe770('0x7e'),_0x2a2515[_0xe770('0x2d')]);console[_0xe770('0x4c')](_0xe770('0x7e'),_0x2a2515);});}exports['queue']=function(_0x4d675f,_0xd5d63f,_0x320722,_0x41bd01,_0x2ec6e0,_0x29ffa0){var _0x1e7f28,_0x1d1b99,_0x37b267;_0x29ffa0[_0xe770('0x7f')]=intUtil[_0xe770('0x80')](_0x29ffa0[_0xe770('0x7f')]);_0x29ffa0[_0xe770('0x81')]=intUtil[_0xe770('0x80')](_0x29ffa0[_0xe770('0x81')]);if(_0x2ec6e0&&_0x2ec6e0[_0xe770('0x82')]){logger[_0xe770('0x2e')](_0xe770('0x83'),_0xe770('0x84'));_0xd5d63f[_0xe770('0x85')]=_0x29ffa0[_0xe770('0x81')]+_0xe770('0x86')+_0xd5d63f[_0xe770('0x87')]+_0xe770('0x88')+md5(_0xd5d63f[_0xe770('0x87')]);}else{_0xd5d63f[_0xe770('0x85')]='';}var _0x3fa231=_0x29ffa0[_0xe770('0x7f')]===_0xe770('0x89')?'eu':_0xe770('0x8a');return getAccessToken(_0x29ffa0)['then'](function(_0x297059){_0x37b267=_0x297059;return getUser(_0x37b267,_0x3fa231,_0x29ffa0,_0x41bd01[_0xe770('0x37')]);})['then'](function(_0x28d9aa){_0x1e7f28=_0x28d9aa;logger['info'](_0xe770('0x8b'),_0x1e7f28['id']);return getEndUser(_0x37b267,_0x3fa231,_0x29ffa0,_0xd5d63f[_0xe770('0x8c')],_0xd5d63f['calleridnum'],_0x1e7f28,_0x320722);})[_0xe770('0x29')](function(_0x38ec02){_0x1d1b99=_0x38ec02;return getCall(_0x37b267,_0x3fa231,_0x29ffa0,_0x1e7f28,_0x1d1b99,_0x320722,_0xd5d63f,_0xe770('0x78'));})[_0xe770('0x29')](function(_0x28a788){if(_0x28a788){logger[_0xe770('0x2e')](_0xe770('0x8d'),_0x28a788['id']);logger[_0xe770('0x2e')](_0xe770('0x83'),_0xe770('0x8e'));emit(util[_0xe770('0x31')](_0xe770('0x8f'),_0x41bd01[_0xe770('0x18')]),_0xe770('0x90'),{'uri':'https://crm.'+_0x29ffa0['host']+_0xe770('0x91')+_0x28a788['id']});}})[_0xe770('0x2b')](function(_0x116fbe){logger[_0xe770('0x4a')](_0xe770('0x83'),JSON[_0xe770('0xb')](_0x116fbe));});};exports[_0xe770('0x76')]=function(_0x5cfada,_0x48cbfa,_0x29ad09,_0x2e8a7e,_0xf569e3,_0x1c8964,_0x542cb0){var _0x365de4,_0x34746c,_0x2e3aed;_0x1c8964[_0xe770('0x7f')]=intUtil[_0xe770('0x80')](_0x1c8964['host']);_0x1c8964[_0xe770('0x81')]=intUtil[_0xe770('0x80')](_0x1c8964[_0xe770('0x81')]);if(_0x542cb0&&_0x542cb0[_0xe770('0x92')]&&_0x542cb0[_0xe770('0x92')]!==_0xe770('0x93')){logger[_0xe770('0x2e')](_0xe770('0x94'),_0xe770('0x84'));_0x48cbfa['recordingURL']=_0x1c8964[_0xe770('0x81')]+_0xe770('0x86')+_0x48cbfa[_0xe770('0x87')]+'/downloads?type=uniqueid&token='+md5(_0x48cbfa[_0xe770('0x87')]);}var _0x1a16f5=_0x1c8964[_0xe770('0x7f')]==='zoho.eu'?'eu':_0xe770('0x8a');return getAccessToken(_0x1c8964)[_0xe770('0x29')](function(_0x32bdb5){_0x2e3aed=_0x32bdb5;return getUser(_0x2e3aed,_0x1a16f5,_0x1c8964,_0x2e8a7e[_0xe770('0x37')]);})[_0xe770('0x29')](function(_0x5ad818){_0x365de4=_0x5ad818;logger[_0xe770('0x2e')](_0xe770('0x8b'),_0x365de4['id']);return getEndUser(_0x2e3aed,_0x1a16f5,_0x1c8964,_0x48cbfa[_0xe770('0x95')],_0x48cbfa['destcalleridnum'],_0x365de4,_0x29ad09);})['then'](function(_0x29f28c){_0x34746c=_0x29f28c;return getCall(_0x2e3aed,_0x1a16f5,_0x1c8964,_0x365de4,_0x34746c,_0x29ad09,_0x48cbfa,'Outbound');})[_0xe770('0x29')](function(_0x1e91e2){if(_0x1e91e2){logger[_0xe770('0x2e')]('The\x20Call\x20ID\x20is:',_0x1e91e2['id']);logger[_0xe770('0x2e')](_0xe770('0x94'),_0xe770('0x8e'));emit(util[_0xe770('0x31')](_0xe770('0x8f'),_0x2e8a7e[_0xe770('0x18')]),_0xe770('0x90'),{'uri':_0xe770('0x96')+_0x1c8964[_0xe770('0x7f')]+_0xe770('0x91')+_0x1e91e2['id']});}})[_0xe770('0x2b')](function(_0x74fe7d){logger[_0xe770('0x4a')](_0xe770('0x94'),JSON['stringify'](_0x74fe7d));});};exports[_0xe770('0x97')]=function(_0x1718b8,_0xe207da,_0x2fff0b,_0x28ccef,_0xa2661a,_0x51a2fe){var _0x4f1fad,_0x1655a5,_0xbebe9e;_0x51a2fe[_0xe770('0x7f')]=intUtil[_0xe770('0x80')](_0x51a2fe['host']);_0x51a2fe[_0xe770('0x81')]=intUtil[_0xe770('0x80')](_0x51a2fe['serverUrl']);if(_0xa2661a&&_0xa2661a[_0xe770('0x82')]){logger[_0xe770('0x2e')]('['+_0xe207da[_0xe770('0x6b')][_0xe770('0x98')]()+']','Recording\x20is\x20enabled!');_0xe207da[_0xe770('0x85')]=_0x51a2fe[_0xe770('0x81')]+_0xe770('0x86')+_0xe207da[_0xe770('0x87')]+'/downloads?type=uniqueid&token='+md5(_0xe207da['uniqueid']);}else{_0xe207da[_0xe770('0x85')]='';}var _0x508eb7=_0x51a2fe[_0xe770('0x7f')]===_0xe770('0x89')?'eu':_0xe770('0x8a');return getAccessToken(_0x51a2fe)[_0xe770('0x29')](function(_0x277734){_0xbebe9e=_0x277734;return getUser(_0xbebe9e,_0x508eb7,_0x51a2fe);})['then'](function(_0x2af015){_0x4f1fad=_0x2af015;logger[_0xe770('0x2e')]('The\x20User\x20ID\x20is:',_0x4f1fad['id']);return getEndUser(_0xbebe9e,_0x508eb7,_0x51a2fe,_0xe207da['calleridname'],_0xe207da[_0xe770('0x99')],_0x4f1fad,_0x2fff0b);})['then'](function(_0x115823){_0x1655a5=_0x115823;return getCall(_0xbebe9e,_0x508eb7,_0x51a2fe,_0x4f1fad,_0x1655a5,_0x2fff0b,_0xe207da,_0xe770('0x78'));})[_0xe770('0x29')](function(_0x578b96){if(_0x578b96){logger['info']('The\x20Call\x20ID\x20is:',_0x578b96['id']);}})[_0xe770('0x2b')](function(_0x4f2ab5){logger['error']('['+_0xe207da[_0xe770('0x6b')][_0xe770('0x98')]()+']',JSON[_0xe770('0xb')](_0x4f2ab5));});}; \ No newline at end of file +var _0x0962=['stringify','forEach','picklist','idField','content','toString','variableName','type','customVariable','Variable','name','toLowerCase','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','then','data','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','enduserType','moduleCreate','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Owner','administrator','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','connect','rejected','abandoned','Call_Result','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','log','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridnum','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/logger','zoho','defaults','redis','localhost','emit','debug','[HTTP]'];(function(_0x32bd71,_0x2d408b){var _0x37bd51=function(_0x2ca3bc){while(--_0x2ca3bc){_0x32bd71['push'](_0x32bd71['shift']());}};_0x37bd51(++_0x2d408b);}(_0x0962,0x116));var _0x2096=function(_0x59b619,_0x4d5c7c){_0x59b619=_0x59b619-0x0;var _0xb07378=_0x0962[_0x59b619];return _0xb07378;};'use strict';var _=require(_0x2096('0x0'));var rp=require(_0x2096('0x1'));var md5=require(_0x2096('0x2'));var util=require(_0x2096('0x3'));var intUtil=require(_0x2096('0x4'));var moment=require(_0x2096('0x5'));var Redis=require(_0x2096('0x6'));var BPromise=require(_0x2096('0x7'));var config=require('../../../../config/environment');var logger=require(_0x2096('0x8'))(_0x2096('0x9'));config['redis']=_[_0x2096('0xa')](config[_0x2096('0xb')],{'host':_0x2096('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x1c37b5,_0x4c21c6,_0x21dbe6){io['to'](_0x1c37b5)[_0x2096('0xd')](_0x4c21c6,_0x21dbe6);}function request(_0x50d65a){logger[_0x2096('0xe')](_0x2096('0xf'),JSON[_0x2096('0x10')](_0x50d65a));return rp(_0x50d65a);}function getCustomFields(_0x3e6f40,_0x56c942){var _0x9c15cd={};if(_0x3e6f40['length']>0x0){_[_0x2096('0x11')](_0x3e6f40,function(_0x5313e5){if(_['includes'](['string',_0x2096('0x12')],_0x5313e5['type'])&&_0x5313e5[_0x2096('0x13')]){_0x9c15cd[_0x5313e5[_0x2096('0x13')]]=_0x5313e5[_0x2096('0x14')][_0x2096('0x15')]();}else if(_0x5313e5['type']==='variable'&&_0x5313e5[_0x2096('0x16')]&&_0x5313e5[_0x2096('0x13')]&&_0x56c942[_0x5313e5[_0x2096('0x16')]]){_0x9c15cd[_0x5313e5[_0x2096('0x13')]]=_0x56c942[_0x5313e5[_0x2096('0x16')]][_0x2096('0x15')]();}else if(_0x5313e5[_0x2096('0x17')]===_0x2096('0x18')&&_0x5313e5['Variable']&&_0x5313e5['Variable']['name']&&_0x5313e5[_0x2096('0x13')]&&_0x56c942[_0x5313e5['Variable']['name']['toLowerCase']()]){_0x9c15cd[_0x5313e5[_0x2096('0x13')]]=_0x56c942[_0x5313e5[_0x2096('0x19')][_0x2096('0x1a')][_0x2096('0x1b')]()][_0x2096('0x15')]();}});}return _0x9c15cd;}function getName(_0x712a83){if(_0x712a83['indexOf']('\x20')>0x0){var _0x47fcd2=_0x712a83['split'](/ (.+)/);if(_0x47fcd2[0x1]){return _0x47fcd2;}}return[_0x712a83,_0x712a83];}var accountsTokens={};function getAccessToken(_0x584f49){return new Promise(function(_0x1fd873,_0x1b8f10){if(!_[_0x2096('0x1c')](accountsTokens[_0x584f49['id']])&&!_['isNil'](accountsTokens[_0x584f49['id']][_0x2096('0x1d')])){if(moment()[_0x2096('0x1e')](accountsTokens[_0x584f49['id']][_0x2096('0x1f')])){_0x1fd873(accountsTokens[_0x584f49['id']][_0x2096('0x1d')]);}}var _0x5d77c9;switch(_0x584f49[_0x2096('0x20')]){case'US':_0x5d77c9='https://accounts.zoho.com';break;case'AU':_0x5d77c9='https://accounts.zoho.com.au';break;case'EU':_0x5d77c9='https://accounts.zoho.eu';break;case'IN':_0x5d77c9='https://accounts.zoho.in';break;case'CN':_0x5d77c9=_0x2096('0x21');break;default:_0x5d77c9='https://accounts.zoho.eu';break;}var _0x398ca1={'method':_0x2096('0x22'),'uri':_0x5d77c9+'/oauth/v2/token','qs':{'refresh_token':_0x584f49[_0x2096('0x23')],'client_id':_0x584f49[_0x2096('0x24')],'client_secret':_0x584f49[_0x2096('0x25')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x398ca1)['then'](function(_0x2a31a7){accountsTokens[_0x584f49['id']]={'access_token':_0x2a31a7[_0x2096('0x1d')],'expires_in':moment()[_0x2096('0x26')](_0x2a31a7['expires_in'],_0x2096('0x27'))};_0x1fd873(_0x2a31a7[_0x2096('0x1d')]);})[_0x2096('0x28')](function(_0x6b2653){logger[_0x2096('0x29')](_0x2096('0x2a'),_0x6b2653[_0x2096('0x2b')]);_0x1b8f10(_0x6b2653);});});}function getUser(_0x538449,_0x5ce42b,_0x194bca,_0x9896f6){logger[_0x2096('0x2c')](_0x2096('0x2d'));return request({'method':_0x2096('0x2e'),'uri':util[_0x2096('0x2f')](_0x2096('0x30'),_0x5ce42b),'qs':{'type':_0x2096('0x31')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x538449},'json':!![]})['then'](function(_0x589154){if(_0x589154[_0x2096('0x32')]){var _0x101aea=-0x1;if(_[_0x2096('0x33')](_0x589154[_0x2096('0x32')])){if(!_[_0x2096('0x1c')](_0x9896f6)){_0x101aea=_[_0x2096('0x34')](_0x589154[_0x2096('0x32')],function(_0xcdb591){return _0xcdb591['email']===_0x9896f6;});}if(_0x101aea>=0x0){logger[_0x2096('0x2c')]('Agent\x20found!');}else{logger[_0x2096('0x2c')](_0x2096('0x35'));_0x101aea=_[_0x2096('0x34')](_0x589154['users'],function(_0x2951d5){return _0x2951d5[_0x2096('0x36')][_0x2096('0x1a')]===_0x2096('0x37');});}return _0x589154[_0x2096('0x32')][_0x101aea];}else{if(_0x589154[_0x2096('0x38')][_0x2096('0x36')][_0x2096('0x1a')]===_0x2096('0x37')){logger[_0x2096('0x2c')](_0x2096('0x35'));user=_0x589154['user'];return user;}else{logger[_0x2096('0x29')](_0x2096('0x39'),JSON[_0x2096('0x10')](_0x589154));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x2096('0x10')](_0x589154));}}}else{logger[_0x2096('0x29')](_0x2096('0x39'),JSON[_0x2096('0x10')](_0x589154));throw new Error(_0x2096('0x3a')+JSON[_0x2096('0x10')](_0x589154));}})['catch'](function(_0x5dfa14){console[_0x2096('0x29')](_0x5dfa14);});}function getZohoUser(_0x5865b3,_0x2c2a7a){return new BPromise(function(_0x43132a,_0x5afb39){request(_0x5865b3)[_0x2096('0x3b')](function(_0x3192d5){var _0x89defc=null;if(_0x3192d5){_0x89defc=_0x3192d5[_0x2096('0x3c')][0x0];_0x89defc['enduserType']=_0x2c2a7a;}_0x43132a(_0x89defc);})[_0x2096('0x28')](function(_0x2b2543){_0x5afb39(_0x2b2543);});});}function createEndUser(_0x55aa72,_0xa01aaf,_0x1e3a43,_0x3d072a,_0x2f4dd2,_0x59843f){var _0x1e3a43=getName(_0x1e3a43);return request({'method':_0x2096('0x22'),'uri':_0x2096('0x3d')+_0xa01aaf+_0x2096('0x3e')+_[_0x2096('0x3f')](_0x59843f['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x1e3a43[0x1],'First_Name':_0x1e3a43[0x0],'Phone':_0x3d072a,'Owner':{'name':!_[_0x2096('0x1c')](_0x2f4dd2[_0x2096('0x40')][_0x2096('0x1a')])?_0x2f4dd2[_0x2096('0x40')][_0x2096('0x1a')]:!_['isNil'](_0x2f4dd2['first_name'])?_0x2f4dd2[_0x2096('0x41')]+'\x20'+_0x2f4dd2[_0x2096('0x42')]:_0x2f4dd2[_0x2096('0x42')],'id':_0x2f4dd2['id']}}]},'headers':{'Authorization':_0x2096('0x43')+_0x55aa72},'json':!![]})[_0x2096('0x3b')](function(_0x1675ba){if(_0x1675ba&&_0x1675ba['data'][0x0][_0x2096('0x44')]===_0x2096('0x45')){var _0x30d94e=_0x1675ba[_0x2096('0x3c')][0x0][_0x2096('0x46')];_0x30d94e[_0x2096('0x47')]=_[_0x2096('0x3f')](_0x59843f[_0x2096('0x48')])+'s';return _0x30d94e;}logger[_0x2096('0x29')](_0x2096('0x39'),JSON[_0x2096('0x10')](data));throw new Error(_0x2096('0x49')+JSON[_0x2096('0x10')](data));})[_0x2096('0x28')](function(_0x435557){console['log'](_0x2096('0x4a'),_0x435557);});}function getEndUser(_0x5d7daf,_0x1359c1,_0x3df307,_0x220a0c,_0x27707b,_0x395c15,_0x489c1f){var _0x1afca={'method':_0x2096('0x2e'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5d7daf},'json':!![]};switch(_0x489c1f[_0x2096('0x4b')]){case _0x2096('0x4c'):_0x1afca['uri']='https://www.zohoapis.'+_0x1359c1+_0x2096('0x4d')+_0x27707b+'))';return getZohoUser(_0x1afca,_0x2096('0x4e'))[_0x2096('0x3b')](function(_0x1e77f5){if(_0x1e77f5)return _0x1e77f5;_0x1afca[_0x2096('0x4f')]=_0x2096('0x3d')+_0x1359c1+_0x2096('0x50')+_0x27707b+'))';return getZohoUser(_0x1afca,_0x2096('0x51'))[_0x2096('0x3b')](function(_0x2a2bb2){if(_0x2a2bb2)return _0x2a2bb2;if(_0x489c1f[_0x2096('0x48')]!=_0x2096('0x52')){return createEndUser(_0x5d7daf,_0x1359c1,_0x220a0c,_0x27707b,_0x395c15,_0x489c1f);}else{return{};}});});break;case'contact':_0x1afca[_0x2096('0x4f')]='https://www.zohoapis.'+_0x1359c1+_0x2096('0x4d')+_0x27707b+'))';return getZohoUser(_0x1afca,_0x2096('0x4e'))[_0x2096('0x3b')](function(_0x49772b){if(_0x49772b)return _0x49772b;if(_0x489c1f[_0x2096('0x48')]!=_0x2096('0x52')){return createEndUser(_0x5d7daf,_0x1359c1,_0x220a0c,_0x27707b,_0x395c15,_0x489c1f);}else{return{};}});break;case _0x2096('0x53'):_0x1afca[_0x2096('0x4f')]=_0x2096('0x3d')+_0x1359c1+_0x2096('0x50')+_0x27707b+'))';return getZohoUser(_0x1afca,_0x2096('0x51'))[_0x2096('0x3b')](function(_0x50e516){if(_0x50e516)return _0x50e516;if(_0x489c1f['moduleCreate']!=_0x2096('0x52')){return createEndUser(_0x5d7daf,_0x1359c1,_0x220a0c,_0x27707b,_0x395c15,_0x489c1f);}else{return{};}});break;}}function getCall(_0x2a8f57,_0x4f2c33,_0x290c66,_0x4d8f4d,_0x1332ea,_0xe744aa,_0x13dd62,_0x2da714){logger[_0x2096('0x2c')]('Creating\x20new\x20call...');var _0x5ba40a={};_0x5ba40a[_0x2096('0x54')]={'name':!_[_0x2096('0x1c')](_0x4d8f4d[_0x2096('0x40')][_0x2096('0x1a')])&&!_[_0x2096('0x1c')](_0x4d8f4d[_0x2096('0x36')][_0x2096('0x1a')])&&_0x4d8f4d[_0x2096('0x36')][_0x2096('0x1a')]===_0x2096('0x55')?_0x4d8f4d[_0x2096('0x40')][_0x2096('0x1a')]:!_[_0x2096('0x1c')](_0x4d8f4d['first_name'])?_0x4d8f4d[_0x2096('0x41')]+'\x20'+_0x4d8f4d[_0x2096('0x42')]:_0x4d8f4d['last_name'],'id':_0x4d8f4d['id']};_0x5ba40a['Subject']=intUtil[_0x2096('0x56')](_0xe744aa['Subjects'],_0x13dd62,'\x20');_0x5ba40a[_0x2096('0x57')]=intUtil[_0x2096('0x56')](_0xe744aa[_0x2096('0x58')],_0x13dd62,'\x0a');if(_0x1332ea[_0x2096('0x47')]===_0x2096('0x4e')){_0x5ba40a[_0x2096('0x59')]={'name':!_[_0x2096('0x1c')](_0x1332ea[_0x2096('0x5a')])?_0x1332ea[_0x2096('0x5a')]:!_[_0x2096('0x1c')](_0x1332ea[_0x2096('0x5b')])?_0x1332ea[_0x2096('0x5b')]+'\x20'+_0x1332ea['Last_Name']:_0x1332ea[_0x2096('0x5c')],'id':_0x1332ea['id']};}if(_0x1332ea[_0x2096('0x47')]===_0x2096('0x51')){_0x5ba40a[_0x2096('0x5d')]={'name':!_['isNil'](_0x1332ea[_0x2096('0x5a')])?_0x1332ea[_0x2096('0x5a')]:!_['isNil'](_0x1332ea[_0x2096('0x5b')])?_0x1332ea[_0x2096('0x5b')]+'\x20'+_0x1332ea[_0x2096('0x5c')]:_0x1332ea[_0x2096('0x5c')],'id':_0x1332ea['id']};_0x5ba40a[_0x2096('0x5e')]=_[_0x2096('0x3f')](_0x1332ea[_0x2096('0x47')]);}if(_0x13dd62[_0x2096('0x5f')]){_0x5ba40a['Call_Duration']=moment[_0x2096('0x60')](parseInt(_0x13dd62['talktime'])*0x3e8)[_0x2096('0x2f')]('mm:ss');}else if(_0x13dd62[_0x2096('0x61')]&&_0x13dd62[_0x2096('0x62')]){_0x5ba40a[_0x2096('0x63')]=moment[_0x2096('0x60')](moment(_0x13dd62[_0x2096('0x62')],_0x2096('0x64'))['diff'](moment(_0x13dd62[_0x2096('0x65')],_0x2096('0x64'))))[_0x2096('0x2f')]('mm:ss');}switch(_0x13dd62[_0x2096('0x66')]){case _0x2096('0x67'):_0x5ba40a['Call_Result']='Called';break;case'complete':case _0x2096('0x68'):_0x5ba40a['Call_Result']='Answered';break;case _0x2096('0x69'):_0x5ba40a['Call_Result']='Rejected';break;case _0x2096('0x6a'):_0x5ba40a[_0x2096('0x6b')]=_0x2096('0x6c');break;case _0x2096('0x6d'):_0x5ba40a[_0x2096('0x6b')]='Timeout';default:}_0x5ba40a[_0x2096('0x6e')]=(_0x2da714===_0x2096('0x6f')?moment(_0x13dd62[_0x2096('0x65')])[_0x2096('0x2f')](_0x2096('0x64')):moment(_0x13dd62[_0x2096('0x70')])[_0x2096('0x2f')](_0x2096('0x64')))||moment()[_0x2096('0x2f')](_0x2096('0x64'));_0x5ba40a[_0x2096('0x71')]=_0x2da714||_0x2096('0x72');_0x5ba40a=_['merge'](_0x5ba40a,getCustomFields(_0xe744aa[_0x2096('0x73')],_0x13dd62));return request({'method':_0x2096('0x22'),'uri':'https://www.zohoapis.'+_0x4f2c33+_0x2096('0x74'),'headers':{'Authorization':_0x2096('0x43')+_0x2a8f57},'body':{'data':[_0x5ba40a]},'json':!![]})[_0x2096('0x3b')](function(_0x238b9f){if(_0x238b9f&&_0x238b9f[_0x2096('0x3c')][0x0][_0x2096('0x44')]===_0x2096('0x45')){logger[_0x2096('0x2c')]('Call\x20created!');return{'id':_0x238b9f['data'][0x0]['details']['id']};}})[_0x2096('0x28')](function(_0x153983){logger[_0x2096('0x2c')]('err',_0x153983[_0x2096('0x2b')]);console[_0x2096('0x75')]('err',_0x153983);});}exports[_0x2096('0x76')]=function(_0x3ee068,_0x1d7680,_0x330322,_0x224292,_0x391df0,_0x4d8e4f){var _0x3e875d,_0x595974,_0x2c2db4;_0x4d8e4f[_0x2096('0x77')]=intUtil['stripTrailingSlash'](_0x4d8e4f['host']);_0x4d8e4f[_0x2096('0x78')]=intUtil[_0x2096('0x79')](_0x4d8e4f[_0x2096('0x78')]);if(_0x391df0&&_0x391df0[_0x2096('0x7a')]){logger[_0x2096('0x2c')](_0x2096('0x7b'),_0x2096('0x7c'));_0x1d7680[_0x2096('0x7d')]=_0x4d8e4f[_0x2096('0x78')]+'/api/voice/recordings/'+_0x1d7680['uniqueid']+_0x2096('0x7e')+md5(_0x1d7680[_0x2096('0x7f')]);}else{_0x1d7680[_0x2096('0x7d')]='';}var _0x331f88=_0x4d8e4f[_0x2096('0x77')]===_0x2096('0x80')?'eu':_0x2096('0x81');return getAccessToken(_0x4d8e4f)[_0x2096('0x3b')](function(_0x3a4813){_0x2c2db4=_0x3a4813;return getUser(_0x2c2db4,_0x331f88,_0x4d8e4f,_0x224292[_0x2096('0x82')]);})[_0x2096('0x3b')](function(_0x55acf7){_0x3e875d=_0x55acf7;logger[_0x2096('0x2c')](_0x2096('0x83'),_0x3e875d['id']);return getEndUser(_0x2c2db4,_0x331f88,_0x4d8e4f,_0x1d7680['calleridname'],_0x1d7680[_0x2096('0x84')],_0x3e875d,_0x330322);})[_0x2096('0x3b')](function(_0x37efc1){_0x595974=_0x37efc1;return getCall(_0x2c2db4,_0x331f88,_0x4d8e4f,_0x3e875d,_0x595974,_0x330322,_0x1d7680,_0x2096('0x72'));})[_0x2096('0x3b')](function(_0x29bd40){if(_0x29bd40){logger[_0x2096('0x2c')]('The\x20Call\x20ID\x20is:',_0x29bd40['id']);logger[_0x2096('0x2c')](_0x2096('0x7b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2096('0x2f')](_0x2096('0x85'),_0x224292[_0x2096('0x1a')]),_0x2096('0x86'),{'uri':_0x2096('0x87')+_0x4d8e4f[_0x2096('0x77')]+_0x2096('0x88')+_0x29bd40['id']});}})[_0x2096('0x28')](function(_0x2bd357){logger['error'](_0x2096('0x7b'),JSON['stringify'](_0x2bd357));});};exports[_0x2096('0x6f')]=function(_0x1e8ce8,_0x4c9734,_0x2c5f6b,_0x24952c,_0x48d03f,_0x59905a,_0x4da766){var _0x358b11,_0x4c1f89,_0x1d9717;_0x59905a[_0x2096('0x77')]=intUtil[_0x2096('0x79')](_0x59905a[_0x2096('0x77')]);_0x59905a[_0x2096('0x78')]=intUtil[_0x2096('0x79')](_0x59905a[_0x2096('0x78')]);if(_0x4da766&&_0x4da766[_0x2096('0x89')]&&_0x4da766[_0x2096('0x89')]!==_0x2096('0x8a')){logger['info'](_0x2096('0x8b'),_0x2096('0x7c'));_0x4c9734[_0x2096('0x7d')]=_0x59905a['serverUrl']+_0x2096('0x8c')+_0x4c9734['uniqueid']+_0x2096('0x7e')+md5(_0x4c9734[_0x2096('0x7f')]);}var _0x2aeff5=_0x59905a[_0x2096('0x77')]===_0x2096('0x80')?'eu':_0x2096('0x81');return getAccessToken(_0x59905a)[_0x2096('0x3b')](function(_0x7277a0){_0x1d9717=_0x7277a0;return getUser(_0x1d9717,_0x2aeff5,_0x59905a,_0x24952c[_0x2096('0x82')]);})['then'](function(_0x479dcf){_0x358b11=_0x479dcf;logger[_0x2096('0x2c')]('The\x20User\x20ID\x20is:',_0x358b11['id']);return getEndUser(_0x1d9717,_0x2aeff5,_0x59905a,_0x4c9734[_0x2096('0x8d')],_0x4c9734[_0x2096('0x8e')],_0x358b11,_0x2c5f6b);})[_0x2096('0x3b')](function(_0x1cf39d){_0x4c1f89=_0x1cf39d;return getCall(_0x1d9717,_0x2aeff5,_0x59905a,_0x358b11,_0x4c1f89,_0x2c5f6b,_0x4c9734,_0x2096('0x8f'));})[_0x2096('0x3b')](function(_0x27b051){if(_0x27b051){logger[_0x2096('0x2c')](_0x2096('0x90'),_0x27b051['id']);logger['info'](_0x2096('0x8b'),_0x2096('0x91'));emit(util[_0x2096('0x2f')](_0x2096('0x85'),_0x24952c[_0x2096('0x1a')]),'trigger:browser:url',{'uri':'https://crm.'+_0x59905a[_0x2096('0x77')]+_0x2096('0x88')+_0x27b051['id']});}})['catch'](function(_0x584bd8){logger[_0x2096('0x29')](_0x2096('0x8b'),JSON[_0x2096('0x10')](_0x584bd8));});};exports['unmanaged']=function(_0x1451c3,_0x1a9fdb,_0x3cf3c9,_0x41d1f4,_0x12d2ff,_0x583fbe){var _0x4564ab,_0x3e9244,_0x45e53a;_0x583fbe[_0x2096('0x77')]=intUtil[_0x2096('0x79')](_0x583fbe[_0x2096('0x77')]);_0x583fbe[_0x2096('0x78')]=intUtil[_0x2096('0x79')](_0x583fbe['serverUrl']);if(_0x12d2ff&&_0x12d2ff[_0x2096('0x7a')]){logger[_0x2096('0x2c')]('['+_0x1a9fdb[_0x2096('0x66')][_0x2096('0x92')]()+']','Recording\x20is\x20enabled!');_0x1a9fdb[_0x2096('0x7d')]=_0x583fbe[_0x2096('0x78')]+_0x2096('0x8c')+_0x1a9fdb[_0x2096('0x7f')]+'/downloads?type=uniqueid&token='+md5(_0x1a9fdb['uniqueid']);}else{_0x1a9fdb['recordingURL']='';}var _0x5925fb=_0x583fbe[_0x2096('0x77')]==='zoho.eu'?'eu':_0x2096('0x81');return getAccessToken(_0x583fbe)['then'](function(_0x1ba62f){_0x45e53a=_0x1ba62f;return getUser(_0x45e53a,_0x5925fb,_0x583fbe);})['then'](function(_0x27d51c){_0x4564ab=_0x27d51c;logger[_0x2096('0x2c')](_0x2096('0x83'),_0x4564ab['id']);return getEndUser(_0x45e53a,_0x5925fb,_0x583fbe,_0x1a9fdb['calleridname'],_0x1a9fdb[_0x2096('0x84')],_0x4564ab,_0x3cf3c9);})['then'](function(_0x2a1755){_0x3e9244=_0x2a1755;return getCall(_0x45e53a,_0x5925fb,_0x583fbe,_0x4564ab,_0x3e9244,_0x3cf3c9,_0x1a9fdb,_0x2096('0x72'));})['then'](function(_0x3fb1b1){if(_0x3fb1b1){logger[_0x2096('0x2c')](_0x2096('0x90'),_0x3fb1b1['id']);}})['catch'](function(_0x1a265f){logger[_0x2096('0x29')]('['+_0x1a9fdb[_0x2096('0x66')]['toUpperCase']()+']',JSON[_0x2096('0x10')](_0x1a265f));});}; \ 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 0add072..8168392 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 _0x22c0=['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','util','mustache','../../../../config/logger','trigger','exec','data2','Script','data3'];(function(_0x1c2f8f,_0x4d8b83){var _0x3b029d=function(_0x1f321a){while(--_0x1f321a){_0x1c2f8f['push'](_0x1c2f8f['shift']());}};_0x3b029d(++_0x4d8b83);}(_0x22c0,0x88));var _0x022c=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0x22c0[_0x9cfe28];return _0x54a1d0;};'use strict';var util=require(_0x022c('0x0'));var sh=require('shelljs');var Mustache=require(_0x022c('0x1'));var logger=require(_0x022c('0x2'))(_0x022c('0x3'));exports[_0x022c('0x4')]=function(_0x2c527e,_0x21e148){var _0x2bcf46=_0x2c527e[_0x022c('0x5')]?_0x2c527e[_0x022c('0x5')]:_0x022c('0x6');var _0x3eb96d=_0x2c527e[_0x022c('0x7')]?Mustache['render'](_0x2c527e[_0x022c('0x7')],_0x21e148):_0x21e148;sh[_0x022c('0x4')](_0x3eb96d,function(_0x395163,_0x2a404a,_0x1d2214){if(_0x395163!==0x0){logger['error'](util[_0x022c('0x8')](_0x022c('0x9'),_0x2bcf46,_0x3eb96d,_0x395163,_0x1d2214));}else{logger[_0x022c('0xa')](util[_0x022c('0x8')](_0x022c('0xb'),_0x2bcf46,_0x3eb96d,_0x2a404a));}});}; \ No newline at end of file +var _0xb23b=['data2','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','trigger','exec'];(function(_0x2219db,_0x4ee1a7){var _0x2d8049=function(_0xa36d9c){while(--_0xa36d9c){_0x2219db['push'](_0x2219db['shift']());}};_0x2d8049(++_0x4ee1a7);}(_0xb23b,0x171));var _0xbb23=function(_0xfdc816,_0x4e0916){_0xfdc816=_0xfdc816-0x0;var _0x40c5f2=_0xb23b[_0xfdc816];return _0x40c5f2;};'use strict';var util=require(_0xbb23('0x0'));var sh=require(_0xbb23('0x1'));var Mustache=require(_0xbb23('0x2'));var logger=require('../../../../config/logger')(_0xbb23('0x3'));exports[_0xbb23('0x4')]=function(_0x473f10,_0x4ec31a){var _0x22581c=_0x473f10[_0xbb23('0x5')]?_0x473f10['data2']:'Script';var _0x12676a=_0x473f10[_0xbb23('0x6')]?Mustache['render'](_0x473f10['data3'],_0x4ec31a):_0x4ec31a;sh[_0xbb23('0x4')](_0x12676a,function(_0x13bb90,_0x52dcea,_0x1c943d){if(_0x13bb90!==0x0){logger[_0xbb23('0x7')](util[_0xbb23('0x8')](_0xbb23('0x9'),_0x22581c,_0x12676a,_0x13bb90,_0x1c943d));}else{logger[_0xbb23('0xa')](util[_0xbb23('0x8')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x22581c,_0x12676a,_0x52dcea));}});}; \ 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 052b21a..12cb729 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 _0x8aee=['name','message','request-promise','util','trigger','exec','data1','data2','data5','number','data6','parse','render','error','stack','toUpperCase','GET','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8aee,0x138));var _0xe8ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aee[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0xe8ae('0x0'));var util=require(_0xe8ae('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xe8ae('0x2'));exports[_0xe8ae('0x3')]=function(_0x31edb2,_0x5226b8){var _0x318be5,_0x3b7646;var _0x2bc2ad={'method':_0x31edb2[_0xe8ae('0x4')]['toUpperCase'](),'uri':Mustache['render'](_0x31edb2[_0xe8ae('0x5')],_0x5226b8),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x31edb2[_0xe8ae('0x6')])===_0xe8ae('0x7')&&parseInt(_0x31edb2['data5'])>=0x1&&parseInt(_0x31edb2[_0xe8ae('0x6')])<=0xa?parseInt(_0x31edb2[_0xe8ae('0x6')])*0x3e8:0x5*0x3e8};try{_0x2bc2ad['headers']=_0x31edb2[_0xe8ae('0x8')]?JSON[_0xe8ae('0x9')](Mustache[_0xe8ae('0xa')](_0x31edb2['data6'],_0x5226b8)):{};}catch(_0x3552c3){logger[_0xe8ae('0xb')](_0x3552c3[_0xe8ae('0xc')]);}switch(_0x31edb2[_0xe8ae('0x4')][_0xe8ae('0xd')]()){case _0xe8ae('0xe'):case'DELETE':_0x318be5=null;_0x2bc2ad['qs']=_0x5226b8;break;case _0xe8ae('0xf'):case _0xe8ae('0x10'):if(_0x31edb2[_0xe8ae('0x11')]){try{_0x318be5=JSON['parse'](Mustache[_0xe8ae('0xa')](_0x31edb2[_0xe8ae('0x11')],_0x5226b8));_0x2bc2ad['body']=_0x318be5;}catch(_0x105455){logger[_0xe8ae('0xb')](_0x105455[_0xe8ae('0xc')]);logger[_0xe8ae('0xb')](_0xe8ae('0x12'));}}else{_0x318be5=_0x5226b8;_0x2bc2ad[_0xe8ae('0x13')]=_0x318be5;}break;}logger[_0xe8ae('0x14')](util[_0xe8ae('0x15')](_0xe8ae('0x16'),_0x31edb2[_0xe8ae('0x4')],_0x31edb2['data2'],JSON[_0xe8ae('0x17')](_0x2bc2ad)));rp(_0x2bc2ad)[_0xe8ae('0x18')](function(_0x1602fc){_0x318be5=!_['isNil'](_0x318be5)?',\x20request\x20body:\x20'+_0x318be5:'';_0x3b7646=typeof _0x1602fc[_0xe8ae('0x13')]==='object'?JSON['stringify'](_0x1602fc['body']):_0x1602fc[_0xe8ae('0x13')];logger[_0xe8ae('0x14')](util[_0xe8ae('0x15')](_0xe8ae('0x19'),_0x31edb2[_0xe8ae('0x4')],_0x31edb2['data2'],_0x1602fc[_0xe8ae('0x1a')],_0x3b7646));})[_0xe8ae('0x1b')](function(_0x1b5711){logger['error'](util[_0xe8ae('0x15')](_0xe8ae('0x1c'),_0x31edb2['data1'],_0x31edb2[_0xe8ae('0x5')],_0x1b5711[_0xe8ae('0x1a')],_0x1b5711[_0xe8ae('0x1d')],_0x1b5711[_0xe8ae('0x1e')]));});}; \ No newline at end of file +var _0xb7d2=['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','exec','data1','toUpperCase','render','data2','data5','data6','stack','GET','POST','PUT','parse','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','stringify','then','isNil',',\x20request\x20body:\x20','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s'];(function(_0x234722,_0x5ae5ab){var _0x2d9947=function(_0x129e28){while(--_0x129e28){_0x234722['push'](_0x234722['shift']());}};_0x2d9947(++_0x5ae5ab);}(_0xb7d2,0x8d));var _0x2b7d=function(_0x1c9b4d,_0x899840){_0x1c9b4d=_0x1c9b4d-0x0;var _0x750082=_0xb7d2[_0x1c9b4d];return _0x750082;};'use strict';var rp=require(_0x2b7d('0x0'));var util=require(_0x2b7d('0x1'));var _=require(_0x2b7d('0x2'));var Mustache=require(_0x2b7d('0x3'));var logger=require(_0x2b7d('0x4'))('trigger');exports[_0x2b7d('0x5')]=function(_0x51071c,_0x13857a){var _0x523dc5,_0x356e43;var _0x5a90ee={'method':_0x51071c[_0x2b7d('0x6')][_0x2b7d('0x7')](),'uri':Mustache[_0x2b7d('0x8')](_0x51071c[_0x2b7d('0x9')],_0x13857a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x51071c['data5'])==='number'&&parseInt(_0x51071c['data5'])>=0x1&&parseInt(_0x51071c[_0x2b7d('0xa')])<=0xa?parseInt(_0x51071c[_0x2b7d('0xa')])*0x3e8:0x5*0x3e8};try{_0x5a90ee['headers']=_0x51071c[_0x2b7d('0xb')]?JSON['parse'](Mustache[_0x2b7d('0x8')](_0x51071c[_0x2b7d('0xb')],_0x13857a)):{};}catch(_0x2a6ad1){logger['error'](_0x2a6ad1[_0x2b7d('0xc')]);}switch(_0x51071c[_0x2b7d('0x6')]['toUpperCase']()){case _0x2b7d('0xd'):case'DELETE':_0x523dc5=null;_0x5a90ee['qs']=_0x13857a;break;case _0x2b7d('0xe'):case _0x2b7d('0xf'):if(_0x51071c['data7']){try{_0x523dc5=JSON[_0x2b7d('0x10')](Mustache[_0x2b7d('0x8')](_0x51071c[_0x2b7d('0x11')],_0x13857a));_0x5a90ee[_0x2b7d('0x12')]=_0x523dc5;}catch(_0x4c4115){logger[_0x2b7d('0x13')](_0x4c4115[_0x2b7d('0xc')]);logger[_0x2b7d('0x13')](_0x2b7d('0x14'));}}else{_0x523dc5=_0x13857a;_0x5a90ee[_0x2b7d('0x12')]=_0x523dc5;}break;}logger['info'](util[_0x2b7d('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x51071c['data1'],_0x51071c[_0x2b7d('0x9')],JSON[_0x2b7d('0x16')](_0x5a90ee)));rp(_0x5a90ee)[_0x2b7d('0x17')](function(_0x5efab){_0x523dc5=!_[_0x2b7d('0x18')](_0x523dc5)?_0x2b7d('0x19')+_0x523dc5:'';_0x356e43=typeof _0x5efab[_0x2b7d('0x12')]===_0x2b7d('0x1a')?JSON['stringify'](_0x5efab[_0x2b7d('0x12')]):_0x5efab[_0x2b7d('0x12')];logger[_0x2b7d('0x1b')](util[_0x2b7d('0x15')](_0x2b7d('0x1c'),_0x51071c['data1'],_0x51071c[_0x2b7d('0x9')],_0x5efab['statusCode'],_0x356e43));})[_0x2b7d('0x1d')](function(_0x491e60){logger[_0x2b7d('0x13')](util[_0x2b7d('0x15')](_0x2b7d('0x1e'),_0x51071c[_0x2b7d('0x6')],_0x51071c[_0x2b7d('0x9')],_0x491e60[_0x2b7d('0x1f')],_0x491e60[_0x2b7d('0x20')],_0x491e60[_0x2b7d('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 1a724d1..cccdd99 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 _0x7cc5=['message','result','catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error'];(function(_0x3d6118,_0x2e2fe5){var _0x546077=function(_0x2f9960){while(--_0x2f9960){_0x3d6118['push'](_0x3d6118['shift']());}};_0x546077(++_0x2e2fe5);}(_0x7cc5,0xf4));var _0x57cc=function(_0xc7679b,_0x2511a2){_0xc7679b=_0xc7679b-0x0;var _0x4e8f0b=_0x7cc5[_0xc7679b];return _0x4e8f0b;};'use strict';var jayson=require(_0x57cc('0x0'));var BPromise=require('bluebird');var logger=require(_0x57cc('0x1'))(_0x57cc('0x2'));var client=jayson[_0x57cc('0x3')][_0x57cc('0x4')]({'port':0x2329});client[_0x57cc('0x5')]=function(_0x31ef49,_0x47fe8f){return new BPromise(function(_0x41520e,_0x1bf9f2){return client[_0x57cc('0x6')](_0x31ef49,_0x47fe8f)[_0x57cc('0x7')](function(_0x53b52c){logger[_0x57cc('0x8')](_0x57cc('0x9'),_0x57cc('0x2'),_0x31ef49,_0x47fe8f,_0x53b52c);if(_0x53b52c['error']){logger[_0x57cc('0xa')]('rpc',_0x57cc('0x2'),_0x31ef49,_0x53b52c[_0x57cc('0xa')][_0x57cc('0xb')],_0x47fe8f);return _0x1bf9f2(_0x53b52c['error'][_0x57cc('0xb')]);}else{return _0x41520e(_0x53b52c[_0x57cc('0xc')]);}})[_0x57cc('0xd')](function(_0x248827){logger[_0x57cc('0xa')](_0x57cc('0x9'),'routing',_0x31ef49,_0x248827,_0x47fe8f);return _0x1bf9f2(_0x248827);});});};module[_0x57cc('0xe')]=client; \ No newline at end of file +var _0xb77e=['message','catch','exports','jayson/promise','../../config/logger','routing','http','Request','then','rpc','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb77e,0xd4));var _0xeb77=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xb77e[_0x2b10c6];return _0x3789d2;};'use strict';var jayson=require(_0xeb77('0x0'));var BPromise=require('bluebird');var logger=require(_0xeb77('0x1'))(_0xeb77('0x2'));var client=jayson['client'][_0xeb77('0x3')]({'port':0x2329});client[_0xeb77('0x4')]=function(_0x87e8ed,_0x32ecec){return new BPromise(function(_0x5397c2,_0xc7fa5b){return client['request'](_0x87e8ed,_0x32ecec)[_0xeb77('0x5')](function(_0x500c88){logger['debug'](_0xeb77('0x6'),_0xeb77('0x2'),_0x87e8ed,_0x32ecec,_0x500c88);if(_0x500c88[_0xeb77('0x7')]){logger[_0xeb77('0x7')](_0xeb77('0x6'),_0xeb77('0x2'),_0x87e8ed,_0x500c88[_0xeb77('0x7')][_0xeb77('0x8')],_0x32ecec);return _0xc7fa5b(_0x500c88[_0xeb77('0x7')]['message']);}else{return _0x5397c2(_0x500c88['result']);}})[_0xeb77('0x9')](function(_0x4ae8e1){logger[_0xeb77('0x7')](_0xeb77('0x6'),_0xeb77('0x2'),_0x87e8ed,_0x4ae8e1,_0x32ecec);return _0xc7fa5b(_0x4ae8e1);});});};module[_0xeb77('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index c05c207..6fc72a4 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 _0xd3fb=['then','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','catch','error','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','getMailAccounts'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xd3fb,0x1b8));var _0xbd3f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd3fb[_0x1facfa];return _0x9ec701;};'use strict';var server=require(_0xbd3f('0x0'));var Realtime=require(_0xbd3f('0x1'));var EmailChannel=require(_0xbd3f('0x2'));var mailAccount=require(_0xbd3f('0x3'));var setting=require(_0xbd3f('0x4'));var logger=require(_0xbd3f('0x5'))(_0xbd3f('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount[_0xbd3f('0x7')]())[_0xbd3f('0x8')](realtime[_0xbd3f('0x9')]())[_0xbd3f('0x8')](function(){email[_0xbd3f('0xa')](realtime[_0xbd3f('0xb')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xbd3f('0x8')](function(){return initRealtime();})[_0xbd3f('0x8')](function(){return setting[_0xbd3f('0xc')]();})[_0xbd3f('0x8')](function(_0x513798){return setInterval(initRealtime,_0x513798[_0xbd3f('0xd')]*0x3e8);})[_0xbd3f('0xe')](function(_0xf24d3f){logger[_0xbd3f('0xf')]('Email\x20service\x20initialization',_0xf24d3f);});}main(); \ No newline at end of file +var _0x0ca6=['loginMailFrequency','catch','error','Email\x20service\x20initialization','./lib/email','./rpc/setting','email','getMailAccounts','then','initMailAccounts','refresh','listen','getSettings'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x0ca6,0x86));var _0x60ca=function(_0x5d21e4,_0x2cdbc3){_0x5d21e4=_0x5d21e4-0x0;var _0x247be8=_0x0ca6[_0x5d21e4];return _0x247be8;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0x60ca('0x0'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x60ca('0x1'));var logger=require('../../config/logger')(_0x60ca('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount[_0x60ca('0x3')]())[_0x60ca('0x4')](realtime[_0x60ca('0x5')]())[_0x60ca('0x4')](function(){email[_0x60ca('0x6')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x60ca('0x7')](realtime,email)[_0x60ca('0x4')](function(){return initRealtime();})[_0x60ca('0x4')](function(){return setting[_0x60ca('0x8')]();})['then'](function(_0x3ace82){return setInterval(initRealtime,_0x3ace82[_0x60ca('0x9')]*0x3e8);})[_0x60ca('0xa')](function(_0x138aa6){logger[_0x60ca('0xb')](_0x60ca('0xc'),_0x138aa6);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 1a203b5..fb4a5e0 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 _0x2b33=['error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verified','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','key','active','Imap','status','messageStatus','isNil','stringify','emit','mailAccount:update','prototype','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','handleImapEmail','end','handleImapError','disabled','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','catch'];(function(_0x2dac3e,_0x3875ce){var _0x4949c3=function(_0x5eb62f){while(--_0x5eb62f){_0x2dac3e['push'](_0x2dac3e['shift']());}};_0x4949c3(++_0x3875ce);}(_0x2b33,0x1b0));var _0x32b3=function(_0x8d9fd,_0x205365){_0x8d9fd=_0x8d9fd-0x0;var _0x29bb46=_0x2b33[_0x8d9fd];return _0x29bb46;};'use strict';var _=require(_0x32b3('0x0'));var moment=require(_0x32b3('0x1'));var BPromise=require(_0x32b3('0x2'));var md5=require(_0x32b3('0x3'));var Redis=require(_0x32b3('0x4'));var config=require('../../../config/environment');var logger=require(_0x32b3('0x5'))(_0x32b3('0x6'));config[_0x32b3('0x7')]=_['defaults'](config[_0x32b3('0x7')],{'host':_0x32b3('0x8'),'port':0x18eb});var io=require(_0x32b3('0x9'))(new Redis(config[_0x32b3('0x7')]));var EmailImap=require(_0x32b3('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x32b3('0xb'));var md5Accounts={};function EmailChannel(_0x449990){logger[_0x32b3('0xc')](_0x32b3('0xd'));this[_0x32b3('0xe')]=_0x449990[_0x32b3('0xe')];this[_0x32b3('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0xd9a610){var _0x3509cd=this[_0x32b3('0xe')][_0xd9a610];var _0x402e5a={'id':_0x3509cd['id'],'name':_0x3509cd['name'],'key':_0x3509cd[_0x32b3('0x10')],'active':_0x3509cd[_0x32b3('0x11')],'Imap':{'status':_0x3509cd[_0x32b3('0x12')][_0x32b3('0x13')],'messageStatus':_0x3509cd[_0x32b3('0x12')][_0x32b3('0x14')],'total':_0x3509cd['Imap']['total']}};if(_[_0x32b3('0x15')](md5Accounts[_0xd9a610])){md5Accounts[_0xd9a610]={};}var _0x3baef9=md5(JSON[_0x32b3('0x16')](_0x402e5a));if(md5Accounts[_0xd9a610][_0x32b3('0x3')]!==_0x3baef9){md5Accounts[_0xd9a610][_0x32b3('0x3')]=_0x3baef9;io[_0x32b3('0x17')](_0x32b3('0x18'),_0x402e5a);}};EmailChannel[_0x32b3('0x19')][_0x32b3('0x1a')]=function(_0x451506){for(var _0x434761 in _0x451506){if(_0x451506[_0x32b3('0x1b')](_0x434761)){if(_0x451506[_0x434761]['Imap']&&_0x451506[_0x434761][_0x32b3('0x11')]){var _0x5df85c=_0x451506[_0x434761][_0x32b3('0x12')];if(!_0x5df85c[_0x32b3('0x1c')]&&_0x451506[_0x434761][_0x32b3('0x1d')]!==_0x32b3('0x1e'))_0x5df85c[_0x32b3('0x1c')]=_0x451506[_0x434761]['provider'];if(!this[_0x32b3('0xf')][_0x32b3('0x1b')](_0x5df85c['id'])){this[_0x32b3('0xf')][_0x5df85c['id']]=new EmailImap(_0x5df85c,_0x451506[_0x434761]['email']);this[_0x32b3('0xf')][_0x5df85c['id']]['on'](_0x32b3('0x1f'),this[_0x32b3('0x20')][_0x32b3('0x21')](this,_0x434761));this[_0x32b3('0xf')][_0x5df85c['id']]['on'](_0x32b3('0x6'),this[_0x32b3('0x22')]['bind'](this,_0x434761));this[_0x32b3('0xf')][_0x5df85c['id']]['on'](_0x32b3('0x23'),this['handleImapEnd'][_0x32b3('0x21')](this,_0x434761));this[_0x32b3('0xf')][_0x5df85c['id']]['on']('error',this[_0x32b3('0x24')][_0x32b3('0x21')](this,_0x434761));}}else{if(_[_0x32b3('0x15')](this[_0x32b3('0xe')][_0x434761][_0x32b3('0x12')])){this['mailAccounts'][_0x434761]['Imap']={};}this[_0x32b3('0xe')][_0x434761][_0x32b3('0x12')][_0x32b3('0x13')]=_0x32b3('0x25');this[_0x32b3('0xe')][_0x434761][_0x32b3('0x12')]['messageStatus']='';this[_0x32b3('0x17')](_0x434761);}}}};EmailChannel['prototype'][_0x32b3('0x20')]=function(_0x3bf2b0,_0x329ad3){if(this[_0x32b3('0xe')][_0x3bf2b0]){this[_0x32b3('0xe')][_0x3bf2b0][_0x32b3('0x12')][_0x32b3('0x13')]=_0x32b3('0x26');this[_0x32b3('0xe')][_0x3bf2b0][_0x32b3('0x12')][_0x32b3('0x14')]=_0x329ad3['name'];if(_0x329ad3[_0x32b3('0x27')]){this[_0x32b3('0xe')][_0x3bf2b0]['Imap'][_0x32b3('0x28')]=_0x329ad3[_0x32b3('0x27')][_0x32b3('0x28')];}return this[_0x32b3('0x17')](_0x3bf2b0);}};EmailChannel[_0x32b3('0x19')][_0x32b3('0x22')]=function(_0x38111f,_0xacd8fb){logger[_0x32b3('0xc')](_0x32b3('0x29'),_0xacd8fb[_0x32b3('0x2a')],_0xacd8fb[_0x32b3('0x2b')],_0xacd8fb[_0x32b3('0x2c')],_0x38111f);if(this[_0x32b3('0xe')][_0x38111f]){return mailAccount[_0x32b3('0x2d')](_0x38111f,_0xacd8fb)[_0x32b3('0x2e')](function(_0x4cb2fc){if(_0x4cb2fc){logger[_0x32b3('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0x32b3('0x2f')](function(_0x3679a6){logger[_0x32b3('0x30')](_0x32b3('0x31'),JSON[_0x32b3('0x16')](_0x3679a6));});}};EmailChannel['prototype'][_0x32b3('0x32')]=function(_0x6d859c){if(this['mailAccounts'][_0x6d859c]&&this[_0x32b3('0xe')][_0x6d859c][_0x32b3('0x12')]){if(this['imapAccounts'][this[_0x32b3('0xe')][_0x6d859c][_0x32b3('0x12')]['id']]){delete this[_0x32b3('0xf')][this[_0x32b3('0xe')][_0x6d859c][_0x32b3('0x12')]['id']];}this[_0x32b3('0xe')][_0x6d859c]['Imap'][_0x32b3('0x33')]=moment();this[_0x32b3('0x17')](_0x6d859c);}};EmailChannel[_0x32b3('0x19')][_0x32b3('0x24')]=function(_0x339621,_0x3c68e2){if(this['mailAccounts'][_0x339621]){this[_0x32b3('0xe')][_0x339621][_0x32b3('0x12')][_0x32b3('0x13')]=_0x32b3('0x30');this[_0x32b3('0xe')][_0x339621][_0x32b3('0x12')][_0x32b3('0x14')]=_0x3c68e2;return this[_0x32b3('0x17')](_0x339621);}};EmailChannel[_0x32b3('0x19')][_0x32b3('0x34')]=function(_0x79204d,_0x31ba5b){return this[_0x32b3('0x35')][_0x32b3('0x36')](_0x79204d,_0x31ba5b);};EmailChannel['prototype'][_0x32b3('0x37')]=function(_0x2d1f5b){var _0x204014=this;if(this['mailAccounts'][_0x2d1f5b['id']]){if(_[_0x32b3('0x15')](this[_0x32b3('0xe')][_0x2d1f5b['id']][_0x32b3('0x38')])){this[_0x32b3('0xe')][_0x2d1f5b['id']][_0x32b3('0x38')]={};}this[_0x32b3('0xe')][_0x2d1f5b['id']][_0x32b3('0x38')][_0x32b3('0x33')]=moment();return new BPromise(function(_0x57e6da,_0x53730f){return _0x204014[_0x32b3('0x35')]['verify'](_0x2d1f5b)['then'](function(_0x501ea7){_0x204014['mailAccounts'][_0x2d1f5b['id']][_0x32b3('0x38')]['status']=_0x32b3('0x39');_0x204014[_0x32b3('0xe')][_0x2d1f5b['id']][_0x32b3('0x38')][_0x32b3('0x14')]='';_0x204014[_0x32b3('0x17')](_0x2d1f5b['id']);_0x57e6da(_0x501ea7);})['catch'](function(_0x587247){_0x204014[_0x32b3('0xe')][_0x2d1f5b['id']][_0x32b3('0x38')][_0x32b3('0x13')]=_0x32b3('0x30');_0x204014[_0x32b3('0xe')][_0x2d1f5b['id']][_0x32b3('0x38')][_0x32b3('0x14')]=_0x587247;_0x204014[_0x32b3('0x17')](_0x2d1f5b['id']);_0x53730f(_0x587247);});});}return this[_0x32b3('0x35')][_0x32b3('0x3a')](_0x2d1f5b);};module[_0x32b3('0x3b')]=EmailChannel; \ No newline at end of file +var _0xf749=['../../../config/environment','email','defaults','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','prototype','emit','mailAccounts','name','key','status','Imap','messageStatus','total','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','disabled','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','verifySmtp','isNil','Smtp','verified','verify','exports','lodash','bluebird','md5','ioredis'];(function(_0x113a6c,_0x10df30){var _0x1ac632=function(_0xbd4fb9){while(--_0xbd4fb9){_0x113a6c['push'](_0x113a6c['shift']());}};_0x1ac632(++_0x10df30);}(_0xf749,0x184));var _0x9f74=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xf749[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x9f74('0x0'));var moment=require('moment');var BPromise=require(_0x9f74('0x1'));var md5=require(_0x9f74('0x2'));var Redis=require(_0x9f74('0x3'));var config=require(_0x9f74('0x4'));var logger=require('../../../config/logger')(_0x9f74('0x5'));config['redis']=_[_0x9f74('0x6')](config[_0x9f74('0x7')],{'host':_0x9f74('0x8'),'port':0x18eb});var io=require(_0x9f74('0x9'))(new Redis(config[_0x9f74('0x7')]));var EmailImap=require(_0x9f74('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x9f74('0xb'));var md5Accounts={};function EmailChannel(_0x5766e9){logger[_0x9f74('0xc')](_0x9f74('0xd'));this['mailAccounts']=_0x5766e9['mailAccounts'];this[_0x9f74('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x9f74('0xf')][_0x9f74('0x10')]=function(_0x193085){var _0x4a8627=this[_0x9f74('0x11')][_0x193085];var _0x3cbcee={'id':_0x4a8627['id'],'name':_0x4a8627[_0x9f74('0x12')],'key':_0x4a8627[_0x9f74('0x13')],'active':_0x4a8627['active'],'Imap':{'status':_0x4a8627['Imap'][_0x9f74('0x14')],'messageStatus':_0x4a8627[_0x9f74('0x15')][_0x9f74('0x16')],'total':_0x4a8627[_0x9f74('0x15')][_0x9f74('0x17')]}};if(_['isNil'](md5Accounts[_0x193085])){md5Accounts[_0x193085]={};}var _0x545886=md5(JSON[_0x9f74('0x18')](_0x3cbcee));if(md5Accounts[_0x193085][_0x9f74('0x2')]!==_0x545886){md5Accounts[_0x193085][_0x9f74('0x2')]=_0x545886;io[_0x9f74('0x10')](_0x9f74('0x19'),_0x3cbcee);}};EmailChannel[_0x9f74('0xf')][_0x9f74('0x1a')]=function(_0x25f1e7){for(var _0x42de30 in _0x25f1e7){if(_0x25f1e7[_0x9f74('0x1b')](_0x42de30)){if(_0x25f1e7[_0x42de30][_0x9f74('0x15')]&&_0x25f1e7[_0x42de30]['active']){var _0x6bd2f7=_0x25f1e7[_0x42de30][_0x9f74('0x15')];if(!_0x6bd2f7[_0x9f74('0x1c')]&&_0x25f1e7[_0x42de30][_0x9f74('0x1d')]!=='custom')_0x6bd2f7[_0x9f74('0x1c')]=_0x25f1e7[_0x42de30][_0x9f74('0x1d')];if(!this[_0x9f74('0xe')][_0x9f74('0x1b')](_0x6bd2f7['id'])){this[_0x9f74('0xe')][_0x6bd2f7['id']]=new EmailImap(_0x6bd2f7,_0x25f1e7[_0x42de30][_0x9f74('0x5')]);this[_0x9f74('0xe')][_0x6bd2f7['id']]['on'](_0x9f74('0x1e'),this[_0x9f74('0x1f')][_0x9f74('0x20')](this,_0x42de30));this['imapAccounts'][_0x6bd2f7['id']]['on']('email',this['handleImapEmail'][_0x9f74('0x20')](this,_0x42de30));this['imapAccounts'][_0x6bd2f7['id']]['on'](_0x9f74('0x21'),this[_0x9f74('0x22')][_0x9f74('0x20')](this,_0x42de30));this['imapAccounts'][_0x6bd2f7['id']]['on'](_0x9f74('0x23'),this[_0x9f74('0x24')][_0x9f74('0x20')](this,_0x42de30));}}else{if(_['isNil'](this[_0x9f74('0x11')][_0x42de30][_0x9f74('0x15')])){this[_0x9f74('0x11')][_0x42de30][_0x9f74('0x15')]={};}this[_0x9f74('0x11')][_0x42de30][_0x9f74('0x15')][_0x9f74('0x14')]=_0x9f74('0x25');this[_0x9f74('0x11')][_0x42de30][_0x9f74('0x15')][_0x9f74('0x16')]='';this['emit'](_0x42de30);}}}};EmailChannel[_0x9f74('0xf')][_0x9f74('0x1f')]=function(_0x236b14,_0x3265ef){if(this[_0x9f74('0x11')][_0x236b14]){this[_0x9f74('0x11')][_0x236b14][_0x9f74('0x15')]['status']=_0x9f74('0x26');this[_0x9f74('0x11')][_0x236b14][_0x9f74('0x15')]['messageStatus']=_0x3265ef[_0x9f74('0x12')];if(_0x3265ef[_0x9f74('0x27')]){this['mailAccounts'][_0x236b14]['Imap']['total']=_0x3265ef[_0x9f74('0x27')][_0x9f74('0x17')];}return this[_0x9f74('0x10')](_0x236b14);}};EmailChannel[_0x9f74('0xf')][_0x9f74('0x28')]=function(_0x44d37b,_0x3c2bb6){logger[_0x9f74('0xc')](_0x9f74('0x29'),_0x3c2bb6[_0x9f74('0x2a')],_0x3c2bb6['lastName'],_0x3c2bb6[_0x9f74('0x2b')],_0x44d37b);if(this[_0x9f74('0x11')][_0x44d37b]){return mailAccount['notify'](_0x44d37b,_0x3c2bb6)[_0x9f74('0x2c')](function(_0xb166d6){if(_0xb166d6){logger[_0x9f74('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0x9f74('0x2d')](function(_0x20b99e){logger['error'](_0x9f74('0x2e'),JSON[_0x9f74('0x18')](_0x20b99e));});}};EmailChannel['prototype'][_0x9f74('0x22')]=function(_0x5e8580){if(this['mailAccounts'][_0x5e8580]&&this['mailAccounts'][_0x5e8580][_0x9f74('0x15')]){if(this[_0x9f74('0xe')][this[_0x9f74('0x11')][_0x5e8580][_0x9f74('0x15')]['id']]){delete this['imapAccounts'][this[_0x9f74('0x11')][_0x5e8580][_0x9f74('0x15')]['id']];}this[_0x9f74('0x11')][_0x5e8580][_0x9f74('0x15')][_0x9f74('0x2f')]=moment();this[_0x9f74('0x10')](_0x5e8580);}};EmailChannel['prototype']['handleImapError']=function(_0xe70664,_0x2f0210){if(this['mailAccounts'][_0xe70664]){this['mailAccounts'][_0xe70664]['Imap'][_0x9f74('0x14')]=_0x9f74('0x23');this[_0x9f74('0x11')][_0xe70664][_0x9f74('0x15')]['messageStatus']=_0x2f0210;return this[_0x9f74('0x10')](_0xe70664);}};EmailChannel['prototype'][_0x9f74('0x30')]=function(_0x53c7a0,_0x2ddf14){return this[_0x9f74('0x31')]['send'](_0x53c7a0,_0x2ddf14);};EmailChannel[_0x9f74('0xf')][_0x9f74('0x32')]=function(_0x4087ff){var _0x166dce=this;if(this[_0x9f74('0x11')][_0x4087ff['id']]){if(_[_0x9f74('0x33')](this[_0x9f74('0x11')][_0x4087ff['id']][_0x9f74('0x34')])){this['mailAccounts'][_0x4087ff['id']][_0x9f74('0x34')]={};}this['mailAccounts'][_0x4087ff['id']][_0x9f74('0x34')][_0x9f74('0x2f')]=moment();return new BPromise(function(_0x454af0,_0x4bbb35){return _0x166dce[_0x9f74('0x31')]['verify'](_0x4087ff)[_0x9f74('0x2c')](function(_0x5cb42c){_0x166dce[_0x9f74('0x11')][_0x4087ff['id']][_0x9f74('0x34')][_0x9f74('0x14')]=_0x9f74('0x35');_0x166dce[_0x9f74('0x11')][_0x4087ff['id']][_0x9f74('0x34')][_0x9f74('0x16')]='';_0x166dce[_0x9f74('0x10')](_0x4087ff['id']);_0x454af0(_0x5cb42c);})['catch'](function(_0x4f5ec5){_0x166dce[_0x9f74('0x11')][_0x4087ff['id']][_0x9f74('0x34')][_0x9f74('0x14')]='error';_0x166dce['mailAccounts'][_0x4087ff['id']][_0x9f74('0x34')]['messageStatus']=_0x4f5ec5;_0x166dce[_0x9f74('0x10')](_0x4087ff['id']);_0x4bbb35(_0x4f5ec5);});});}return this[_0x9f74('0x31')][_0x9f74('0x36')](_0x4087ff);};module[_0x9f74('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 9637aba..556743d 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 _0xc1c6=['mailbox','handleOpenBox','emit','box','readUnseen','search','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','end','handleFetchEnd','closeBox','handleCloseBox','handleMessageBody','handleSimpleParser','handleMessageEnd','error','parser','textCode','hasOwnProperty','upperFirst','lodash','util','imap','simpleParser','Iconv','events','EventEmitter','email','INBOX','account','getAccount','once','handleReady','bind','handleEnd','handleError','inherits','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','generateXOAuth2Token','data5','password','host','port','tls','autotls','required','prototype','openBox'];(function(_0x446911,_0xb419ae){var _0x1dd3fb=function(_0x362146){while(--_0x362146){_0x446911['push'](_0x446911['shift']());}};_0x1dd3fb(++_0xb419ae);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x1f773d,_0x3b0be2){_0x1f773d=_0x1f773d-0x0;var _0x411122=_0xc1c6[_0x1f773d];return _0x411122;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var Imap=require(_0x6c1c('0x2'));var simpleParser=require('mailparser')[_0x6c1c('0x3')];var Iconv=require('iconv')[_0x6c1c('0x4')];var EventEmitter=require(_0x6c1c('0x5'))[_0x6c1c('0x6')];var utils=require('./utils');var logger=require('../../../config/logger')(_0x6c1c('0x7'));function EmailImap(_0x524a6b,_0x50c1bb){this['mailbox']=_0x6c1c('0x8');this[_0x6c1c('0x9')]=this[_0x6c1c('0xa')](_0x524a6b,_0x50c1bb);this[_0x6c1c('0x2')]=new Imap(this['account']);this[_0x6c1c('0x2')][_0x6c1c('0xb')]('ready',this[_0x6c1c('0xc')][_0x6c1c('0xd')](this));this[_0x6c1c('0x2')][_0x6c1c('0xb')]('end',this[_0x6c1c('0xe')][_0x6c1c('0xd')](this));this[_0x6c1c('0x2')]['on']('error',this[_0x6c1c('0xf')][_0x6c1c('0xd')](this));this[_0x6c1c('0x2')]['connect']();}util[_0x6c1c('0x10')](EmailImap,EventEmitter);EmailImap['prototype'][_0x6c1c('0xa')]=function(_0x15a1fc,_0x2d279e){var _0x154107={'connTimeout':_0x15a1fc[_0x6c1c('0x11')]?_0x15a1fc[_0x6c1c('0x11')]*0x3e8:0x2710,'authTimeout':_0x15a1fc[_0x6c1c('0x12')]?_0x15a1fc[_0x6c1c('0x12')]*0x3e8:0x1388};if(_0x15a1fc[_0x6c1c('0x13')]){_0x154107['user']=_0x15a1fc[_0x6c1c('0x14')];_0x154107[_0x6c1c('0x7')]=_0x2d279e||_0x15a1fc['user']||_0x6c1c('0x15');if(_0x15a1fc[_0x6c1c('0x16')]){_0x154107['xoauth2']=utils[_0x6c1c('0x17')](_0x15a1fc['CloudProvider'][_0x6c1c('0x18')],_0x15a1fc[_0x6c1c('0x14')]);}else{_0x154107['password']=_0x15a1fc[_0x6c1c('0x19')];}}else{if(_0x15a1fc['authentication']){_0x154107[_0x6c1c('0x14')]=_0x15a1fc[_0x6c1c('0x14')];_0x154107[_0x6c1c('0x19')]=_0x15a1fc[_0x6c1c('0x19')];}}_0x154107[_0x6c1c('0x1a')]=_0x15a1fc[_0x6c1c('0x1a')];_0x154107[_0x6c1c('0x1b')]=_0x15a1fc[_0x6c1c('0x1b')]||0x3e1;if(_0x15a1fc[_0x6c1c('0x1c')]){_0x154107[_0x6c1c('0x1c')]=!![];}else{_0x154107[_0x6c1c('0x1c')]=![];_0x154107[_0x6c1c('0x1d')]=_0x6c1c('0x1e');}return _0x154107;};EmailImap[_0x6c1c('0x1f')][_0x6c1c('0xc')]=function(){this[_0x6c1c('0x2')][_0x6c1c('0x20')](this[_0x6c1c('0x21')],![],this[_0x6c1c('0x22')][_0x6c1c('0xd')](this));};EmailImap[_0x6c1c('0x1f')][_0x6c1c('0x22')]=function(_0x2ef382,_0x7ff10d){if(_0x2ef382){this[_0x6c1c('0xf')](_0x2ef382,!![]);}else{this[_0x6c1c('0x23')](_0x6c1c('0x24'),_0x7ff10d);this[_0x6c1c('0x25')]();}};EmailImap[_0x6c1c('0x1f')]['handleCloseBox']=function(_0x2595c3){if(_0x2595c3){this['handleError'](_0x2595c3,!![]);}else{this[_0x6c1c('0x2')]['end']();}};EmailImap[_0x6c1c('0x1f')]['readUnseen']=function(){this[_0x6c1c('0x2')][_0x6c1c('0x26')](['UNSEEN'],this[_0x6c1c('0x27')][_0x6c1c('0xd')](this));};EmailImap['prototype'][_0x6c1c('0x27')]=function(_0x19a8f1,_0xdcef7){if(_0x19a8f1){this[_0x6c1c('0xf')](_0x19a8f1,!![]);}else{if(_0xdcef7['length']){try{var _0x52c036=this[_0x6c1c('0x2')][_0x6c1c('0x28')](_0xdcef7,{'bodies':'','markSeen':!![]});_0x52c036['on'](_0x6c1c('0x29'),this[_0x6c1c('0x2a')][_0x6c1c('0xd')](this));_0x52c036[_0x6c1c('0xb')]('error',this[_0x6c1c('0x2b')][_0x6c1c('0xd')](this));_0x52c036['once'](_0x6c1c('0x2c'),this[_0x6c1c('0x2d')][_0x6c1c('0xd')](this));}catch(_0x15b6d2){logger['error'](_0x15b6d2);}}else{this[_0x6c1c('0x2')][_0x6c1c('0x2e')](!![],this[_0x6c1c('0x2f')]['bind'](this));}}};EmailImap[_0x6c1c('0x1f')]['handleFetchMessage']=function(_0x6870a4){_0x6870a4['on']('body',this[_0x6c1c('0x30')][_0x6c1c('0xd')](this));_0x6870a4[_0x6c1c('0xb')]('attributes',this['handleMessageAttributes'][_0x6c1c('0xd')](this));_0x6870a4[_0x6c1c('0xb')](_0x6c1c('0x2c'),this['handleMessageEnd'][_0x6c1c('0xd')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x794e73){simpleParser(_0x794e73,{'Iconv':Iconv},this[_0x6c1c('0x31')][_0x6c1c('0xd')](this));};EmailImap[_0x6c1c('0x1f')]['handleMessageAttributes']=function(){};EmailImap[_0x6c1c('0x1f')][_0x6c1c('0x32')]=function(){};EmailImap[_0x6c1c('0x1f')][_0x6c1c('0x31')]=function(_0x173a54,_0x398e95){if(_0x173a54){logger[_0x6c1c('0x33')](_0x173a54);}else{var _0x988821=this;utils[_0x6c1c('0x34')](this[_0x6c1c('0x9')],_0x398e95,function(_0x47d75e){_0x988821[_0x6c1c('0x23')](_0x6c1c('0x7'),_0x47d75e);});}};EmailImap[_0x6c1c('0x1f')][_0x6c1c('0x2d')]=function(){this[_0x6c1c('0x2')]['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x6c1c('0x1f')]['handleFetchError']=function(_0x4d7dc6){this[_0x6c1c('0xf')](_0x4d7dc6);this[_0x6c1c('0x2')]['closeBox'](!![],this[_0x6c1c('0x2f')][_0x6c1c('0xd')](this));};EmailImap[_0x6c1c('0x1f')]['handleEnd']=function(){this[_0x6c1c('0x23')](_0x6c1c('0x2c'));};EmailImap['prototype'][_0x6c1c('0xf')]=function(_0x4cc30f,_0x111eb8){logger[_0x6c1c('0x33')](_0x6c1c('0xf'),this[_0x6c1c('0x9')][_0x6c1c('0x7')],JSON['stringify'](_0x4cc30f));var _0x23a8c3='';if(_0x4cc30f){if(_0x4cc30f[_0x6c1c('0x35')]){_0x23a8c3=_0x4cc30f[_0x6c1c('0x35')];}else{for(var _0x5d4058 in _0x4cc30f){if(_0x4cc30f[_0x6c1c('0x36')](_0x5d4058)){_0x23a8c3+=_[_0x6c1c('0x37')](_0x5d4058)+':\x20'+_0x4cc30f[_0x5d4058]+'\x0a';}}}}if(_0x111eb8){this[_0x6c1c('0x2')][_0x6c1c('0x2c')]();}else{this[_0x6c1c('0x23')]('error',_0x23a8c3);this[_0x6c1c('0x23')]('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0x7ee1=['readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchMessage','body','handleMessageBody','handleMessageEnd','handleMessageAttributes','parser','handleFetchEnd','closeBox','stringify','textCode','upperFirst','exports','lodash','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','imap','bind','once','end','handleEnd','error','connect','inherits','prototype','getAccount','connTimeout','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','authentication','host','port','tls','autotls','required','handleReady','handleOpenBox','handleError','emit','box'];(function(_0x9889ce,_0x4d24cb){var _0x4d2f62=function(_0x58c9b0){while(--_0x58c9b0){_0x9889ce['push'](_0x9889ce['shift']());}};_0x4d2f62(++_0x4d24cb);}(_0x7ee1,0x8d));var _0x17ee=function(_0x342e68,_0x49745b){_0x342e68=_0x342e68-0x0;var _0x5bd4f5=_0x7ee1[_0x342e68];return _0x5bd4f5;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var Imap=require('imap');var simpleParser=require('mailparser')[_0x17ee('0x1')];var Iconv=require(_0x17ee('0x2'))[_0x17ee('0x3')];var EventEmitter=require('events')[_0x17ee('0x4')];var utils=require(_0x17ee('0x5'));var logger=require(_0x17ee('0x6'))(_0x17ee('0x7'));function EmailImap(_0x5c0617,_0x52b1db){this[_0x17ee('0x8')]='INBOX';this[_0x17ee('0x9')]=this['getAccount'](_0x5c0617,_0x52b1db);this[_0x17ee('0xa')]=new Imap(this[_0x17ee('0x9')]);this[_0x17ee('0xa')]['once']('ready',this['handleReady'][_0x17ee('0xb')](this));this['imap'][_0x17ee('0xc')](_0x17ee('0xd'),this[_0x17ee('0xe')][_0x17ee('0xb')](this));this['imap']['on'](_0x17ee('0xf'),this['handleError'][_0x17ee('0xb')](this));this[_0x17ee('0xa')][_0x17ee('0x10')]();}util[_0x17ee('0x11')](EmailImap,EventEmitter);EmailImap[_0x17ee('0x12')][_0x17ee('0x13')]=function(_0x225d05,_0x54434e){var _0x1e734f={'connTimeout':_0x225d05[_0x17ee('0x14')]?_0x225d05[_0x17ee('0x14')]*0x3e8:0x2710,'authTimeout':_0x225d05['authTimeout']?_0x225d05['authTimeout']*0x3e8:0x1388};if(_0x225d05['service']){_0x1e734f['user']=_0x225d05[_0x17ee('0x15')];_0x1e734f[_0x17ee('0x7')]=_0x54434e||_0x225d05[_0x17ee('0x15')]||_0x17ee('0x16');if(_0x225d05[_0x17ee('0x17')]){_0x1e734f[_0x17ee('0x18')]=utils[_0x17ee('0x19')](_0x225d05['CloudProvider'][_0x17ee('0x1a')],_0x225d05[_0x17ee('0x15')]);}else{_0x1e734f[_0x17ee('0x1b')]=_0x225d05[_0x17ee('0x1b')];}}else{if(_0x225d05[_0x17ee('0x1c')]){_0x1e734f['user']=_0x225d05[_0x17ee('0x15')];_0x1e734f['password']=_0x225d05[_0x17ee('0x1b')];}}_0x1e734f['host']=_0x225d05[_0x17ee('0x1d')];_0x1e734f[_0x17ee('0x1e')]=_0x225d05[_0x17ee('0x1e')]||0x3e1;if(_0x225d05[_0x17ee('0x1f')]){_0x1e734f[_0x17ee('0x1f')]=!![];}else{_0x1e734f[_0x17ee('0x1f')]=![];_0x1e734f[_0x17ee('0x20')]=_0x17ee('0x21');}return _0x1e734f;};EmailImap[_0x17ee('0x12')][_0x17ee('0x22')]=function(){this[_0x17ee('0xa')]['openBox'](this['mailbox'],![],this[_0x17ee('0x23')][_0x17ee('0xb')](this));};EmailImap[_0x17ee('0x12')][_0x17ee('0x23')]=function(_0x3bbddf,_0xea358f){if(_0x3bbddf){this[_0x17ee('0x24')](_0x3bbddf,!![]);}else{this[_0x17ee('0x25')](_0x17ee('0x26'),_0xea358f);this[_0x17ee('0x27')]();}};EmailImap[_0x17ee('0x12')][_0x17ee('0x28')]=function(_0x4d4b2b){if(_0x4d4b2b){this[_0x17ee('0x24')](_0x4d4b2b,!![]);}else{this[_0x17ee('0xa')][_0x17ee('0xd')]();}};EmailImap[_0x17ee('0x12')][_0x17ee('0x27')]=function(){this['imap'][_0x17ee('0x29')]([_0x17ee('0x2a')],this[_0x17ee('0x2b')]['bind'](this));};EmailImap[_0x17ee('0x12')][_0x17ee('0x2b')]=function(_0x56c6ba,_0x2046fb){if(_0x56c6ba){this['handleError'](_0x56c6ba,!![]);}else{if(_0x2046fb[_0x17ee('0x2c')]){try{var _0x5a44c4=this[_0x17ee('0xa')][_0x17ee('0x2d')](_0x2046fb,{'bodies':'','markSeen':!![]});_0x5a44c4['on'](_0x17ee('0x2e'),this['handleFetchMessage'][_0x17ee('0xb')](this));_0x5a44c4[_0x17ee('0xc')]('error',this[_0x17ee('0x2f')][_0x17ee('0xb')](this));_0x5a44c4[_0x17ee('0xc')]('end',this['handleFetchEnd'][_0x17ee('0xb')](this));}catch(_0x2bb2c4){logger[_0x17ee('0xf')](_0x2bb2c4);}}else{this[_0x17ee('0xa')]['closeBox'](!![],this['handleCloseBox'][_0x17ee('0xb')](this));}}};EmailImap[_0x17ee('0x12')][_0x17ee('0x30')]=function(_0x7e2957){_0x7e2957['on'](_0x17ee('0x31'),this[_0x17ee('0x32')][_0x17ee('0xb')](this));_0x7e2957['once']('attributes',this['handleMessageAttributes'][_0x17ee('0xb')](this));_0x7e2957['once'](_0x17ee('0xd'),this[_0x17ee('0x33')][_0x17ee('0xb')](this));};EmailImap['prototype'][_0x17ee('0x32')]=function(_0xc93e95){simpleParser(_0xc93e95,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x17ee('0x12')][_0x17ee('0x34')]=function(){};EmailImap[_0x17ee('0x12')][_0x17ee('0x33')]=function(){};EmailImap[_0x17ee('0x12')]['handleSimpleParser']=function(_0x52215a,_0x36c2f0){if(_0x52215a){logger[_0x17ee('0xf')](_0x52215a);}else{var _0x1cc0fa=this;utils[_0x17ee('0x35')](this[_0x17ee('0x9')],_0x36c2f0,function(_0xe60d2f){_0x1cc0fa['emit']('email',_0xe60d2f);});}};EmailImap[_0x17ee('0x12')][_0x17ee('0x36')]=function(){this[_0x17ee('0xa')][_0x17ee('0x37')](!![],this[_0x17ee('0x28')][_0x17ee('0xb')](this));};EmailImap[_0x17ee('0x12')][_0x17ee('0x2f')]=function(_0x182f96){this[_0x17ee('0x24')](_0x182f96);this['imap']['closeBox'](!![],this['handleCloseBox'][_0x17ee('0xb')](this));};EmailImap[_0x17ee('0x12')][_0x17ee('0xe')]=function(){this[_0x17ee('0x25')]('end');};EmailImap[_0x17ee('0x12')][_0x17ee('0x24')]=function(_0xad858b,_0xec7ded){logger['error'](_0x17ee('0x24'),this[_0x17ee('0x9')][_0x17ee('0x7')],JSON[_0x17ee('0x38')](_0xad858b));var _0x222512='';if(_0xad858b){if(_0xad858b[_0x17ee('0x39')]){_0x222512=_0xad858b[_0x17ee('0x39')];}else{for(var _0x1f105a in _0xad858b){if(_0xad858b['hasOwnProperty'](_0x1f105a)){_0x222512+=_[_0x17ee('0x3a')](_0x1f105a)+':\x20'+_0xad858b[_0x1f105a]+'\x0a';}}}}if(_0xec7ded){this[_0x17ee('0xa')][_0x17ee('0xd')]();}else{this[_0x17ee('0x25')](_0x17ee('0xf'),_0x222512);this[_0x17ee('0x25')](_0x17ee('0xd'));}};module[_0x17ee('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 1ba4001..43c89c0 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 _0xafa4=['verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail','toString'];(function(_0x3c5c2b,_0x3c616b){var _0x4c5258=function(_0x5235a9){while(--_0x5235a9){_0x3c5c2b['push'](_0x3c5c2b['shift']());}};_0x4c5258(++_0x3c616b);}(_0xafa4,0x1b1));var _0x4afa=function(_0x2a74da,_0x14df2d){_0x2a74da=_0x2a74da-0x0;var _0x59e644=_0xafa4[_0x2a74da];return _0x59e644;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x4afa('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0x4afa('0x1')]=function(_0x478705,_0x168375){return new Promise(function(_0x24f34f,_0x19d625){var _0x3bb1be=nodemailer[_0x4afa('0x2')](_0x478705);_0x3bb1be[_0x4afa('0x3')](_0x4afa('0x4'),inlineBase64());_0x3bb1be[_0x4afa('0x5')](_0x168375,function(_0x29e482,_0x1987ab){if(_0x29e482){_0x19d625(_0x29e482[_0x4afa('0x6')]());}else{_0x24f34f(_0x1987ab);}});});};EmailSmtp['prototype']['verify']=function(_0x16629c){return new Promise(function(_0x3210af,_0x274b16){var _0x5cd82d=nodemailer[_0x4afa('0x2')](_0x16629c);_0x5cd82d[_0x4afa('0x7')](function(_0xbf186c,_0x120b3b){if(_0xbf186c){_0x274b16(_0xbf186c[_0x4afa('0x6')]());}else{if(_0x120b3b){_0x3210af(_0x120b3b);}else{_0x274b16(_0x4afa('0x8'));}}});});};module[_0x4afa('0x9')]=EmailSmtp; \ No newline at end of file +var _0x62b5=['toString','verify','Not\x20verifired','exports','nodemailer','prototype','send','createTransport','use','sendMail'];(function(_0x52495f,_0x5184df){var _0x2cae8d=function(_0x34f9c){while(--_0x34f9c){_0x52495f['push'](_0x52495f['shift']());}};_0x2cae8d(++_0x5184df);}(_0x62b5,0xae));var _0x562b=function(_0x167c8c,_0x2cc138){_0x167c8c=_0x167c8c-0x0;var _0x2a4bcd=_0x62b5[_0x167c8c];return _0x2a4bcd;};'use strict';var nodemailer=require(_0x562b('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x562b('0x1')][_0x562b('0x2')]=function(_0x275b05,_0x11e8c0){return new Promise(function(_0x2abe5f,_0x5424e4){var _0x532366=nodemailer[_0x562b('0x3')](_0x275b05);_0x532366[_0x562b('0x4')]('compile',inlineBase64());_0x532366[_0x562b('0x5')](_0x11e8c0,function(_0x29a9dd,_0x4bbebf){if(_0x29a9dd){_0x5424e4(_0x29a9dd[_0x562b('0x6')]());}else{_0x2abe5f(_0x4bbebf);}});});};EmailSmtp[_0x562b('0x1')][_0x562b('0x7')]=function(_0x367849){return new Promise(function(_0x3dc21c,_0x2714d8){var _0x30159f=nodemailer[_0x562b('0x3')](_0x367849);_0x30159f[_0x562b('0x7')](function(_0xb5e2b8,_0x347ef6){if(_0xb5e2b8){_0x2714d8(_0xb5e2b8[_0x562b('0x6')]());}else{if(_0x347ef6){_0x3dc21c(_0x347ef6);}else{_0x2714d8(_0x562b('0x8'));}}});});};module[_0x562b('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 92cdd74..8a608ae 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 _0x1494=['email','../../../config/environment','value','address','anonymous','generate','name','split','slice','join','Anonymous','head','length','@xcally.com','html','test','includes','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Data','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger'];(function(_0x561ebb,_0x3dd13b){var _0xb00496=function(_0x1d40c9){while(--_0x1d40c9){_0x561ebb['push'](_0x561ebb['shift']());}};_0xb00496(++_0x3dd13b);}(_0x1494,0x119));var _0x4149=function(_0x555c25,_0x5ece39){_0x555c25=_0x555c25-0x0;var _0x60105d=_0x1494[_0x555c25];return _0x60105d;};'use strict';var _=require(_0x4149('0x0'));var moment=require(_0x4149('0x1'));var random=require(_0x4149('0x2'));var fs=require('fs');var path=require(_0x4149('0x3'));var util=require(_0x4149('0x4'));var tnef=require(_0x4149('0x5'));var logger=require(_0x4149('0x6'))(_0x4149('0x7'));var config=require(_0x4149('0x8'));function getAddress(_0x25f5be){var _0x48c737=_['head'](_0x25f5be[_0x4149('0x9')]);return _0x48c737&&_0x48c737[_0x4149('0xa')]?_0x48c737[_0x4149('0xa')]:_0x4149('0xb')+random[_0x4149('0xc')](0x6)+'@xcally.com';}function getFirstName(_0x40827f){var _0x2a8b7f=_['head'](_0x40827f[_0x4149('0x9')]);if(_0x2a8b7f&&_0x2a8b7f[_0x4149('0xd')]){if(_0x2a8b7f[_0x4149('0xd')]==_0x2a8b7f[_0x4149('0xa')]){return _0x2a8b7f[_0x4149('0xd')]['substring'](0x0,_0x2a8b7f[_0x4149('0xd')]['indexOf']('@'));}var _0x4dea7c=_0x2a8b7f[_0x4149('0xd')][_0x4149('0xe')](/\s+/);return _0x4dea7c['length']>0x1?_0x4dea7c[_0x4149('0xf')](0x0,-0x1)[_0x4149('0x10')]('\x20'):_0x2a8b7f[_0x4149('0xd')];}return _0x4149('0x11');}function getLastName(_0x330506){var _0x372168=_[_0x4149('0x12')](_0x330506[_0x4149('0x9')]);if(_0x372168&&_0x372168['name']){var _0x320e5c=_0x372168[_0x4149('0xd')][_0x4149('0xe')](/\s+/);return _0x320e5c[_0x4149('0x13')]>0x1?_0x320e5c['pop']():'';}return'';}function getMails(_0x5c0e09,_0x159a94){var _0xef305b='';for(var _0x55d4f2=0x0;_0x55d4f2<_0x159a94['value'][_0x4149('0x13')];_0x55d4f2+=0x1){if(_0x159a94[_0x4149('0x9')][_0x55d4f2][_0x4149('0xa')]!==_0x5c0e09){if(!_['isEmpty'](_0xef305b)){_0xef305b+=',';}_0xef305b+=_0x159a94[_0x4149('0x9')][_0x55d4f2][_0x4149('0xd')]||_0x159a94['value'][_0x55d4f2][_0x4149('0xa')]||'';_0xef305b+='\x20<';_0xef305b+=_0x159a94['value'][_0x55d4f2][_0x4149('0xa')]?_0x159a94[_0x4149('0x9')][_0x55d4f2]['address']:_0x4149('0xb')+random[_0x4149('0xc')](0x6)+_0x4149('0x14');_0xef305b+='>';}}return _0xef305b;}function parseEmail(_0x41fcba,_0x4c67f1,_0x589148){if(_0x4c67f1[_0x4149('0x15')]){var _0x592e2a=/)<[^<]*)*<\/script>/gi;while(_0x592e2a[_0x4149('0x16')](_0x4c67f1['html'])){_0x4c67f1[_0x4149('0x15')]=_0x4c67f1[_0x4149('0x15')]['replace'](_0x592e2a,'');}if(_0x4c67f1[_0x4149('0x15')][_0x4149('0x17')](_0x4149('0x18'))){var _0x5040c1=[];_0x4c67f1[_0x4149('0x19')]['forEach'](_0x39d055=>{_0x5040c1[_0x4149('0x1a')](_0x39d055[_0x4149('0x1b')]);});var _0x361a66=/]+>/g;var _0x2025ff=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2e9d27=_0x4c67f1['html'][_0x4149('0x1c')](_0x2025ff,_0x4149('0x1d'));var _0x5143f2=_0x2e9d27['replace'](_0x361a66,'_IMG');for(let _0x3484d2=0x0;_0x3484d2<_0x5040c1['length'];_0x3484d2++){var _0x403210=_0x5143f2[_0x4149('0x1c')](_0x4149('0x1e'),_0x4149('0x1f')+_0x5040c1[_0x3484d2]+_0x4149('0x20'));_0x5143f2=_0x403210;}_0x4c67f1['html']=_0x5143f2;}_0x589148['body']=_0x4c67f1[_0x4149('0x15')];}else{_0x589148[_0x4149('0x21')]=_0x4c67f1['textAsHtml'];}if(_0x589148['body']){_0x589148[_0x4149('0x21')]=_0x589148[_0x4149('0x21')][_0x4149('0x1c')](/0x0){var _0x54cd38=[_0x4149('0x2e'),_0x4149('0x2f'),_0x4149('0x30')];for(var _0x3cab10=0x0;_0x3cab10<_0x4c67f1['headerLines'][_0x4149('0x13')];_0x3cab10++){var _0x8f27f4=_[_0x4149('0x31')](_0x54cd38,_0x4c67f1[_0x4149('0x32')][_0x3cab10]['line']);if(_0x8f27f4>=0x0){_0x589148[_0x4149('0x33')]=!![];}}}return _0x589148;}exports[_0x4149('0x34')]=function(_0x131d6f,_0x1af504,_0x1e84d1){var _0x35d5f0={'from':getAddress(_0x1af504[_0x4149('0x35')]),'firstName':getFirstName(_0x1af504[_0x4149('0x35')]),'lastName':getLastName(_0x1af504['from']),'mapKey':_0x4149('0x7'),'message':{'from':getMails(_0x131d6f[_0x4149('0x7')],_0x1af504[_0x4149('0x35')]),'to':_0x131d6f[_0x4149('0x7')],'cc':'','subject':_0x1af504['subject']||'','messageId':_0x1af504['messageId'],'inReplyTo':_0x1af504[_0x4149('0x36')],'sentAt':moment(_0x1af504[_0x4149('0x37')])[_0x4149('0x2a')](_0x4149('0x38')),'attach':![],'attachments':[]}};if(!_0x1af504['html']&&!_0x1af504[_0x4149('0x39')]){var _0x26fee8=_[_0x4149('0x3a')](_0x1af504[_0x4149('0x19')],{'contentType':_0x4149('0x3b')});if(_0x26fee8[_0x4149('0x13')]){logger[_0x4149('0x3c')](util[_0x4149('0x2a')](_0x4149('0x3d'),_0x1af504[_0x4149('0x3e')]));tnef['parseBuffer'](_['first'](_0x26fee8)[_0x4149('0x3f')],function(_0x169430,_0x164952){if(_0x164952){_0x1af504[_0x4149('0x15')]=_0x164952['BodyHTML']||_0x4149('0x40');if(_0x164952['Attachments']){for(var _0x42ad04=0x0;_0x42ad04<_0x164952[_0x4149('0x41')][_0x4149('0x13')];_0x42ad04++){var _0x367acb=_0x164952[_0x4149('0x41')][_0x42ad04];_0x35d5f0['message']['attachments'][_0x4149('0x1a')]({'filename':_0x367acb['Title'],'content':Buffer[_0x4149('0x35')](_0x367acb[_0x4149('0x42')])});}}}_0x1e84d1(parseEmail(_0x131d6f,_0x1af504,_0x35d5f0));});}else{_0x1af504['html']=_0x4149('0x40');_0x1e84d1(parseEmail(_0x131d6f,_0x1af504,_0x35d5f0));}}else{_0x1e84d1(parseEmail(_0x131d6f,_0x1af504,_0x35d5f0));}};exports[_0x4149('0x43')]=function(_0x418b27,_0x55fbf2){var _0x4b6501=['user='+(_0x55fbf2||''),_0x4149('0x44')+_0x418b27,'',''];return Buffer['from'](_0x4b6501[_0x4149('0x10')](''),_0x4149('0x45'))[_0x4149('0x46')](_0x4149('0x47'));}; \ No newline at end of file +var _0xa433=['includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','originCc','bcc','attach','type','attachment','filename','attachment-','%s-%s','now','root','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','isAutoreply','from','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','BodyHTML','

Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','utf-8','toString','base64','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','name','substring','split','length','join','Anonymous','head','isEmpty','test','html','replace'];(function(_0x3f9977,_0x5e0507){var _0x101965=function(_0x292340){while(--_0x292340){_0x3f9977['push'](_0x3f9977['shift']());}};_0x101965(++_0x5e0507);}(_0xa433,0xc4));var _0x3a43=function(_0x5bdc70,_0x923634){_0x5bdc70=_0x5bdc70-0x0;var _0x5e1924=_0xa433[_0x5bdc70];return _0x5e1924;};'use strict';var _=require('lodash');var moment=require(_0x3a43('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0x3a43('0x1'));var util=require(_0x3a43('0x2'));var tnef=require(_0x3a43('0x3'));var logger=require(_0x3a43('0x4'))(_0x3a43('0x5'));var config=require(_0x3a43('0x6'));function getAddress(_0x2fe197){var _0x39edcc=_['head'](_0x2fe197[_0x3a43('0x7')]);return _0x39edcc&&_0x39edcc[_0x3a43('0x8')]?_0x39edcc[_0x3a43('0x8')]:_0x3a43('0x9')+random[_0x3a43('0xa')](0x6)+_0x3a43('0xb');}function getFirstName(_0x5e90a4){var _0x588d46=_['head'](_0x5e90a4[_0x3a43('0x7')]);if(_0x588d46&&_0x588d46['name']){if(_0x588d46[_0x3a43('0xc')]==_0x588d46[_0x3a43('0x8')]){return _0x588d46[_0x3a43('0xc')][_0x3a43('0xd')](0x0,_0x588d46[_0x3a43('0xc')]['indexOf']('@'));}var _0x5cbe99=_0x588d46[_0x3a43('0xc')][_0x3a43('0xe')](/\s+/);return _0x5cbe99[_0x3a43('0xf')]>0x1?_0x5cbe99['slice'](0x0,-0x1)[_0x3a43('0x10')]('\x20'):_0x588d46[_0x3a43('0xc')];}return _0x3a43('0x11');}function getLastName(_0x2afcdb){var _0x5d28a4=_[_0x3a43('0x12')](_0x2afcdb[_0x3a43('0x7')]);if(_0x5d28a4&&_0x5d28a4[_0x3a43('0xc')]){var _0x34d6ad=_0x5d28a4[_0x3a43('0xc')][_0x3a43('0xe')](/\s+/);return _0x34d6ad['length']>0x1?_0x34d6ad['pop']():'';}return'';}function getMails(_0x5475a9,_0x63943b){var _0x133b12='';for(var _0xd50484=0x0;_0xd50484<_0x63943b[_0x3a43('0x7')]['length'];_0xd50484+=0x1){if(_0x63943b[_0x3a43('0x7')][_0xd50484][_0x3a43('0x8')]!==_0x5475a9){if(!_[_0x3a43('0x13')](_0x133b12)){_0x133b12+=',';}_0x133b12+=_0x63943b[_0x3a43('0x7')][_0xd50484][_0x3a43('0xc')]||_0x63943b['value'][_0xd50484]['address']||'';_0x133b12+='\x20<';_0x133b12+=_0x63943b[_0x3a43('0x7')][_0xd50484][_0x3a43('0x8')]?_0x63943b['value'][_0xd50484][_0x3a43('0x8')]:_0x3a43('0x9')+random[_0x3a43('0xa')](0x6)+_0x3a43('0xb');_0x133b12+='>';}}return _0x133b12;}function parseEmail(_0x2279e0,_0x2cf601,_0x40b2f3){if(_0x2cf601['html']){var _0x1fd34e=/)<[^<]*)*<\/script>/gi;while(_0x1fd34e[_0x3a43('0x14')](_0x2cf601[_0x3a43('0x15')])){_0x2cf601[_0x3a43('0x15')]=_0x2cf601[_0x3a43('0x15')][_0x3a43('0x16')](_0x1fd34e,'');}if(_0x2cf601[_0x3a43('0x15')][_0x3a43('0x17')](_0x3a43('0x18'))){var _0x1f0a27=[];_0x2cf601[_0x3a43('0x19')][_0x3a43('0x1a')](_0x43e186=>{_0x1f0a27[_0x3a43('0x1b')](_0x43e186['filename']);});var _0x4b9c44=/]+>/g;var _0x2bbd32=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x30863c=_0x2cf601['html'][_0x3a43('0x16')](_0x2bbd32,_0x3a43('0x1c'));var _0x5e8d4e=_0x30863c[_0x3a43('0x16')](_0x4b9c44,'_IMG');for(let _0x18c991=0x0;_0x18c991<_0x1f0a27['length'];_0x18c991++){var _0x34db01=_0x5e8d4e[_0x3a43('0x16')](_0x3a43('0x1d'),_0x3a43('0x1e')+_0x1f0a27[_0x18c991]+_0x3a43('0x1f'));_0x5e8d4e=_0x34db01;}_0x2cf601[_0x3a43('0x15')]=_0x5e8d4e;}_0x40b2f3[_0x3a43('0x20')]=_0x2cf601['html'];}else{_0x40b2f3['body']=_0x2cf601[_0x3a43('0x21')];}if(_0x40b2f3[_0x3a43('0x20')]){_0x40b2f3[_0x3a43('0x20')]=_0x40b2f3['body'][_0x3a43('0x16')](/0x0){var _0x424457=[_0x3a43('0x32'),_0x3a43('0x33'),_0x3a43('0x34')];for(var _0x237137=0x0;_0x237137<_0x2cf601[_0x3a43('0x31')]['length'];_0x237137++){var _0x46377b=_[_0x3a43('0x35')](_0x424457,_0x2cf601['headerLines'][_0x237137]['line']);if(_0x46377b>=0x0){_0x40b2f3[_0x3a43('0x36')]=!![];}}}return _0x40b2f3;}exports['parser']=function(_0x210c44,_0x241549,_0x54aef6){var _0x1ead35={'from':getAddress(_0x241549[_0x3a43('0x37')]),'firstName':getFirstName(_0x241549[_0x3a43('0x37')]),'lastName':getLastName(_0x241549[_0x3a43('0x37')]),'mapKey':_0x3a43('0x5'),'message':{'from':getMails(_0x210c44['email'],_0x241549['from']),'to':_0x210c44[_0x3a43('0x5')],'cc':'','subject':_0x241549['subject']||'','messageId':_0x241549[_0x3a43('0x38')],'inReplyTo':_0x241549[_0x3a43('0x39')],'sentAt':moment(_0x241549[_0x3a43('0x3a')])[_0x3a43('0x3b')](_0x3a43('0x3c')),'attach':![],'attachments':[]}};if(!_0x241549[_0x3a43('0x15')]&&!_0x241549[_0x3a43('0x21')]){var _0x9a26e3=_['filter'](_0x241549[_0x3a43('0x19')],{'contentType':_0x3a43('0x3d')});if(_0x9a26e3[_0x3a43('0xf')]){logger[_0x3a43('0x3e')](util[_0x3a43('0x3b')](_0x3a43('0x3f'),_0x241549['messageId']));tnef['parseBuffer'](_['first'](_0x9a26e3)['content'],function(_0x416e12,_0x14d27f){if(_0x14d27f){_0x241549['html']=_0x14d27f[_0x3a43('0x40')]||_0x3a43('0x41');if(_0x14d27f[_0x3a43('0x42')]){for(var _0x3ec110=0x0;_0x3ec110<_0x14d27f[_0x3a43('0x42')][_0x3a43('0xf')];_0x3ec110++){var _0x4b7ecd=_0x14d27f['Attachments'][_0x3ec110];_0x1ead35['message'][_0x3a43('0x19')]['push']({'filename':_0x4b7ecd['Title'],'content':Buffer[_0x3a43('0x37')](_0x4b7ecd[_0x3a43('0x43')])});}}}_0x54aef6(parseEmail(_0x210c44,_0x241549,_0x1ead35));});}else{_0x241549[_0x3a43('0x15')]=_0x3a43('0x41');_0x54aef6(parseEmail(_0x210c44,_0x241549,_0x1ead35));}}else{_0x54aef6(parseEmail(_0x210c44,_0x241549,_0x1ead35));}};exports[_0x3a43('0x44')]=function(_0x2c6c26,_0x3ac080){var _0x3c54c2=[_0x3a43('0x45')+(_0x3ac080||''),'auth=Bearer\x20'+_0x2c6c26,'',''];return Buffer[_0x3a43('0x37')](_0x3c54c2[_0x3a43('0x10')](''),_0x3a43('0x46'))[_0x3a43('0x47')](_0x3a43('0x48'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 94eb952..e60fac1 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 _0x8662=['name','Service','key','SERV','active','Imap','Smtp','exports','lodash'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x8662,0xd7));var _0x2866=function(_0x5b16e6,_0x406a01){_0x5b16e6=_0x5b16e6-0x0;var _0xff4a8b=_0x8662[_0x5b16e6];return _0xff4a8b;};'use strict';var _=require(_0x2866('0x0'));function MailAccount(_0x5f4095){this['id']=_0x5f4095['id']||0x0;this[_0x2866('0x1')]=_0x5f4095[_0x2866('0x1')]||_0x2866('0x2');this[_0x2866('0x3')]=_0x5f4095[_0x2866('0x3')]||_0x2866('0x4');this[_0x2866('0x5')]=_0x5f4095[_0x2866('0x5')]||![];this[_0x2866('0x6')]=_0x5f4095[_0x2866('0x6')]||[];this[_0x2866('0x7')]=_0x5f4095[_0x2866('0x7')]||[];}module[_0x2866('0x8')]=MailAccount; \ No newline at end of file +var _0x952c=['exports','lodash','name','key','SERV','active','Imap','Smtp'];(function(_0x5c4ba5,_0x28bc21){var _0x385da0=function(_0x3ed8f3){while(--_0x3ed8f3){_0x5c4ba5['push'](_0x5c4ba5['shift']());}};_0x385da0(++_0x28bc21);}(_0x952c,0x199));var _0xc952=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x952c[_0x2b8077];return _0x308091;};'use strict';var _=require(_0xc952('0x0'));function MailAccount(_0x5da865){this['id']=_0x5da865['id']||0x0;this[_0xc952('0x1')]=_0x5da865['name']||'Service';this['key']=_0x5da865[_0xc952('0x2')]||_0xc952('0x3');this[_0xc952('0x4')]=_0x5da865[_0xc952('0x4')]||![];this[_0xc952('0x5')]=_0x5da865[_0xc952('0x5')]||[];this[_0xc952('0x6')]=_0x5da865[_0xc952('0x6')]||[];}module[_0xc952('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 2924759..6e8df45 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 _0x9ba8=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x100529,_0x47b5d0){var _0x333552=function(_0x45c647){while(--_0x45c647){_0x100529['push'](_0x100529['shift']());}};_0x333552(++_0x47b5d0);}(_0x9ba8,0x147));var _0x89ba=function(_0x1e88eb,_0x4d031e){_0x1e88eb=_0x1e88eb-0x0;var _0x23fe01=_0x9ba8[_0x1e88eb];return _0x23fe01;};'use strict';var _=require(_0x89ba('0x0'));var MailAccount=require(_0x89ba('0x1'));var Realtime=function(){this[_0x89ba('0x2')]={};};function freeIsNotKey(_0x366313,_0x48d50f,_0x127a0a){var _0x3b2c7f=_[_0x89ba('0x3')](_0x366313,function(_0x45d627,_0x14f035){return _0x45d627[_0x127a0a];});for(var _0x60e654 in _0x48d50f){if(_0x48d50f[_0x89ba('0x4')](_0x60e654)){if(!_0x3b2c7f[_0x60e654]){delete _0x48d50f[_0x60e654];}}}}Realtime[_0x89ba('0x5')][_0x89ba('0x6')]=function(_0x3322d8,_0x3e3b23){for(var _0x1bf5e8 in _0x3e3b23){if(_0x3322d8[_0x89ba('0x4')](_0x1bf5e8)){_0x3322d8[_0x1bf5e8]=_0x3e3b23[_0x1bf5e8];}}};Realtime[_0x89ba('0x5')][_0x89ba('0x7')]=function(){var _0x3e47c2=this;return function(_0x4c4bf5){if(_0x4c4bf5){freeIsNotKey(_0x4c4bf5,_0x3e47c2['mailAccounts'],'id');for(var _0x7675ad=0x0,_0x382f00={},_0x4d42b7={};_0x7675ad<_0x4c4bf5[_0x89ba('0x8')];_0x7675ad+=0x1){_0x382f00=_0x4c4bf5[_0x7675ad];if(_[_0x89ba('0x9')](_0x3e47c2[_0x89ba('0x2')][_0x382f00['id']])){_0x3e47c2[_0x89ba('0x2')][_0x382f00['id']]=new MailAccount(_0x382f00);}else{_['merge'](_0x3e47c2[_0x89ba('0x2')][_0x382f00['id']],_0x382f00);}}}return _0x3e47c2[_0x89ba('0x2')];};};module[_0x89ba('0xa')]=Realtime; \ No newline at end of file +var _0xcb3e=['lodash','../model/mailAccount','mailAccounts','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','length','isUndefined','merge','exports'];(function(_0x2b7e9c,_0x236531){var _0x39ac82=function(_0x351563){while(--_0x351563){_0x2b7e9c['push'](_0x2b7e9c['shift']());}};_0x39ac82(++_0x236531);}(_0xcb3e,0xbb));var _0xecb3=function(_0xf013e5,_0x1fa2da){_0xf013e5=_0xf013e5-0x0;var _0x3b0c71=_0xcb3e[_0xf013e5];return _0x3b0c71;};'use strict';var _=require(_0xecb3('0x0'));var MailAccount=require(_0xecb3('0x1'));var Realtime=function(){this[_0xecb3('0x2')]={};};function freeIsNotKey(_0x463d0b,_0x547a4c,_0x206574){var _0xe65827=_['mapKeys'](_0x463d0b,function(_0x5149c2,_0x424deb){return _0x5149c2[_0x206574];});for(var _0x41d2a3 in _0x547a4c){if(_0x547a4c[_0xecb3('0x3')](_0x41d2a3)){if(!_0xe65827[_0x41d2a3]){delete _0x547a4c[_0x41d2a3];}}}}Realtime['prototype'][_0xecb3('0x4')]=function(_0x22fdc1,_0x3a1b61){for(var _0x1f4f98 in _0x3a1b61){if(_0x22fdc1[_0xecb3('0x3')](_0x1f4f98)){_0x22fdc1[_0x1f4f98]=_0x3a1b61[_0x1f4f98];}}};Realtime[_0xecb3('0x5')][_0xecb3('0x6')]=function(){var _0x395418=this;return function(_0x1809fc){if(_0x1809fc){freeIsNotKey(_0x1809fc,_0x395418[_0xecb3('0x2')],'id');for(var _0x5b97d8=0x0,_0x4de16e={},_0x1634dc={};_0x5b97d8<_0x1809fc[_0xecb3('0x7')];_0x5b97d8+=0x1){_0x4de16e=_0x1809fc[_0x5b97d8];if(_[_0xecb3('0x8')](_0x395418[_0xecb3('0x2')][_0x4de16e['id']])){_0x395418['mailAccounts'][_0x4de16e['id']]=new MailAccount(_0x4de16e);}else{_[_0xecb3('0x9')](_0x395418[_0xecb3('0x2')][_0x4de16e['id']],_0x4de16e);}}}return _0x395418[_0xecb3('0x2')];};};module[_0xecb3('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index d3a00dc..66d5624 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 _0x1c63=['ListId','TemplateId','MailServerIn','Imap','type','data5','CloudProvider','MailServerOut','name','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','service','email','key'];(function(_0xf64941,_0x175be4){var _0x2a130d=function(_0x50dc77){while(--_0x50dc77){_0xf64941['push'](_0xf64941['shift']());}};_0x2a130d(++_0x175be4);}(_0x1c63,0xdc));var _0x31c6=function(_0x1a379a,_0x2868e0){_0x1a379a=_0x1a379a-0x0;var _0x528c58=_0x1c63[_0x1a379a];return _0x528c58;};'use strict';var client=require(_0x31c6('0x0'));exports[_0x31c6('0x1')]=function(){return function(){return client[_0x31c6('0x2')](_0x31c6('0x3'),{'options':{'attributes':['id','name',_0x31c6('0x4'),_0x31c6('0x5'),_0x31c6('0x6'),'active',_0x31c6('0x7'),_0x31c6('0x8'),_0x31c6('0x9')],'raw':![],'include':[{'model':_0x31c6('0xa'),'as':_0x31c6('0xb'),'include':[{'model':'CloudProvider','attributes':['id','name',_0x31c6('0x5'),_0x31c6('0xc'),_0x31c6('0xd')],'as':_0x31c6('0xe')}]},{'model':_0x31c6('0xf'),'as':'Smtp','include':[{'model':_0x31c6('0xe'),'attributes':['id',_0x31c6('0x10'),_0x31c6('0x5'),_0x31c6('0xc'),_0x31c6('0xd')],'as':'CloudProvider'}]}]},'log':_0x31c6('0x11')});};};exports['notify']=function(_0xf23049,_0x12ee20){return client['Request'](_0x31c6('0x12'),{'account':{'id':_0xf23049},'body':_0x12ee20,'log':_0x31c6('0x12')});}; \ No newline at end of file +var _0x8991=['ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut','data5','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','name','provider','service','email','active','key'];(function(_0x5eaeec,_0x3f9a76){var _0x55e643=function(_0x2114d2){while(--_0x2114d2){_0x5eaeec['push'](_0x5eaeec['shift']());}};_0x55e643(++_0x3f9a76);}(_0x8991,0x1b0));var _0x1899=function(_0x349ffc,_0x5c270d){_0x349ffc=_0x349ffc-0x0;var _0x17baa8=_0x8991[_0x349ffc];return _0x17baa8;};'use strict';var client=require(_0x1899('0x0'));exports[_0x1899('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x1899('0x2'),_0x1899('0x3'),_0x1899('0x4'),_0x1899('0x5'),_0x1899('0x6'),_0x1899('0x7'),_0x1899('0x8'),_0x1899('0x9')],'raw':![],'include':[{'model':_0x1899('0xa'),'as':_0x1899('0xb'),'include':[{'model':_0x1899('0xc'),'attributes':['id',_0x1899('0x2'),_0x1899('0x4'),_0x1899('0xd'),'data5'],'as':_0x1899('0xc')}]},{'model':_0x1899('0xe'),'as':'Smtp','include':[{'model':_0x1899('0xc'),'attributes':['id',_0x1899('0x2'),_0x1899('0x4'),'type',_0x1899('0xf')],'as':_0x1899('0xc')}]}]},'log':_0x1899('0x10')});};};exports[_0x1899('0x11')]=function(_0x56fa3a,_0x4811fb){return client[_0x1899('0x12')]('NotifyMailAccount',{'account':{'id':_0x56fa3a},'body':_0x4811fb,'log':_0x1899('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index e12c5c1..a29963b 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 _0x3a49=['Request','ShowSetting','GetSettings','../client','getSettings'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x3a49,0xee));var _0x93a4=function(_0x22a838,_0x21ea5f){_0x22a838=_0x22a838-0x0;var _0x6d2443=_0x3a49[_0x22a838];return _0x6d2443;};'use strict';var client=require(_0x93a4('0x0'));exports[_0x93a4('0x1')]=function(){return client[_0x93a4('0x2')](_0x93a4('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x93a4('0x4')});}; \ No newline at end of file +var _0x879f=['getSettings','Request','ShowSetting','GetSettings'];(function(_0x4f827d,_0x86ff67){var _0x25650a=function(_0x4c467f){while(--_0x4c467f){_0x4f827d['push'](_0x4f827d['shift']());}};_0x25650a(++_0x86ff67);}(_0x879f,0xbc));var _0xf879=function(_0xc8d0dc,_0x1126d0){_0xc8d0dc=_0xc8d0dc-0x0;var _0x4159c3=_0x879f[_0xc8d0dc];return _0x4159c3;};'use strict';var client=require('../client');exports[_0xf879('0x0')]=function(){return client[_0xf879('0x1')](_0xf879('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xf879('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 8adce9b..aa75856 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 614ddc2..6058bb2 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 _0xf843=['createServer','timeout','listen','port','socket.io','websocket','defaults','redis','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express'];(function(_0x63b00e,_0x5835cb){var _0x15374e=function(_0xf47399){while(--_0xf47399){_0x63b00e['push'](_0x63b00e['shift']());}};_0x15374e(++_0x5835cb);}(_0xf843,0xe3));var _0x3f84=function(_0x2153ef,_0x45edb0){_0x2153ef=_0x2153ef-0x0;var _0x5b754e=_0xf843[_0x2153ef];return _0x5b754e;};'use strict';var _=require(_0x3f84('0x0'));var http=require(_0x3f84('0x1'));var express=require(_0x3f84('0x2'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0x3f84('0x3')](app);server[_0x3f84('0x4')]=0xdbba0;if(sticky[_0x3f84('0x5')](server,config[_0x3f84('0x6')])){var socketio=require(_0x3f84('0x7'))(server,{'transports':[_0x3f84('0x8'),'polling']});config['redis']=_[_0x3f84('0x9')](config[_0x3f84('0xa')],{'host':_0x3f84('0xb'),'port':0x18eb});socketio['adapter'](require(_0x3f84('0xc'))({'pubClient':new Redis(config[_0x3f84('0xa')]),'subClient':new Redis(config[_0x3f84('0xa')])}));require(_0x3f84('0xd'))[_0x3f84('0xe')]();require(_0x3f84('0xf'))[_0x3f84('0xe')](socketio);require(_0x3f84('0x10'))[_0x3f84('0xe')](app);require(_0x3f84('0x11'))['default'](app);}else{server[_0x3f84('0x12')](_0x3f84('0x13'),function(){console[_0x3f84('0x14')](_0x3f84('0x15'),config[_0x3f84('0x6')]);});}exports=module[_0x3f84('0x16')]=app; \ No newline at end of file +var _0x64e1=['lodash','express','sticky-session','ioredis','createServer','timeout','socket.io','websocket','redis','localhost','socket.io-redis','../../config/triggers','../../config/socketio','default','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x64e1,0x1b8));var _0x164e=function(_0x280640,_0x70386a){_0x280640=_0x280640-0x0;var _0x2bf568=_0x64e1[_0x280640];return _0x2bf568;};'use strict';var _=require(_0x164e('0x0'));var http=require('http');var express=require(_0x164e('0x1'));var sticky=require(_0x164e('0x2'));var Redis=require(_0x164e('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x164e('0x4')](app);server[_0x164e('0x5')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x164e('0x6'))(server,{'transports':[_0x164e('0x7'),'polling']});config[_0x164e('0x8')]=_['defaults'](config[_0x164e('0x8')],{'host':_0x164e('0x9'),'port':0x18eb});socketio['adapter'](require(_0x164e('0xa'))({'pubClient':new Redis(config[_0x164e('0x8')]),'subClient':new Redis(config['redis'])}));require(_0x164e('0xb'))['default']();require(_0x164e('0xc'))['default'](socketio);require('../../config/express')[_0x164e('0xd')](app);require('../../routes')[_0x164e('0xd')](app);}else{server[_0x164e('0xe')](_0x164e('0xf'),function(){console[_0x164e('0x10')](_0x164e('0x11'),config[_0x164e('0x12')]);});}exports=module[_0x164e('0x13')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index a373a48..d47a26a 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 _0xdb8c=['request','then','debug','error','rpc','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xdb8c,0x89));var _0xcdb8=function(_0x3e7b11,_0x49aa5b){_0x3e7b11=_0x3e7b11-0x0;var _0x1c0151=_0xdb8c[_0x3e7b11];return _0x1c0151;};'use strict';var jayson=require(_0xcdb8('0x0'));var BPromise=require(_0xcdb8('0x1'));var logger=require(_0xcdb8('0x2'))(_0xcdb8('0x3'));var client=jayson[_0xcdb8('0x4')]['http']({'port':0x2329});client[_0xcdb8('0x5')]=function(_0x28f4ba,_0xa8e976){return new BPromise(function(_0x22b1d2,_0x3df4bc){return client[_0xcdb8('0x6')](_0x28f4ba,_0xa8e976)[_0xcdb8('0x7')](function(_0x20895e){logger[_0xcdb8('0x8')]('rpc','routing',_0x28f4ba,_0xa8e976,_0x20895e);if(_0x20895e['error']){logger[_0xcdb8('0x9')](_0xcdb8('0xa'),_0xcdb8('0x3'),_0x28f4ba,_0x20895e[_0xcdb8('0x9')]['message'],_0xa8e976);return _0x3df4bc(_0x20895e[_0xcdb8('0x9')]['message']);}else{return _0x22b1d2(_0x20895e[_0xcdb8('0xb')]);}})['catch'](function(_0x98efe4){logger[_0xcdb8('0x9')]('rpc',_0xcdb8('0x3'),_0x28f4ba,_0x98efe4,_0xa8e976);return _0x3df4bc(_0x98efe4);});});};module[_0xcdb8('0xc')]=client; \ No newline at end of file +var _0xa38f=['error','message','result','exports','bluebird','../../config/logger','routing','client','Request','request','then','debug','rpc'];(function(_0x4d30ac,_0x112604){var _0x279f70=function(_0x38475f){while(--_0x38475f){_0x4d30ac['push'](_0x4d30ac['shift']());}};_0x279f70(++_0x112604);}(_0xa38f,0x163));var _0xfa38=function(_0x1b4fdd,_0x280a04){_0x1b4fdd=_0x1b4fdd-0x0;var _0x3ab723=_0xa38f[_0x1b4fdd];return _0x3ab723;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfa38('0x0'));var logger=require(_0xfa38('0x1'))(_0xfa38('0x2'));var client=jayson[_0xfa38('0x3')]['http']({'port':0x2329});client[_0xfa38('0x4')]=function(_0x28823d,_0x368a47){return new BPromise(function(_0x8c40a9,_0x5de3cf){return client[_0xfa38('0x5')](_0x28823d,_0x368a47)[_0xfa38('0x6')](function(_0x3d7559){logger[_0xfa38('0x7')](_0xfa38('0x8'),_0xfa38('0x2'),_0x28823d,_0x368a47,_0x3d7559);if(_0x3d7559[_0xfa38('0x9')]){logger[_0xfa38('0x9')](_0xfa38('0x8'),_0xfa38('0x2'),_0x28823d,_0x3d7559[_0xfa38('0x9')]['message'],_0x368a47);return _0x5de3cf(_0x3d7559['error'][_0xfa38('0xa')]);}else{return _0x8c40a9(_0x3d7559[_0xfa38('0xb')]);}})['catch'](function(_0x39d6b5){logger['error'](_0xfa38('0x8'),_0xfa38('0x2'),_0x28823d,_0x39d6b5,_0x368a47);return _0x5de3cf(_0x39d6b5);});});};module[_0xfa38('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index df46c70..c82f82a 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 _0xcf88=['bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','listen','catch'];(function(_0x1790be,_0x2bab34){var _0x3c4d5e=function(_0x231bad){while(--_0x231bad){_0x1790be['push'](_0x1790be['shift']());}};_0x3c4d5e(++_0x2bab34);}(_0xcf88,0x64));var _0x8cf8=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xcf88[_0x2d7f0e];return _0x110b07;};'use strict';var BPromise=require(_0x8cf8('0x0'));var server=require(_0x8cf8('0x1'));var Realtime=require(_0x8cf8('0x2'));var user=require(_0x8cf8('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x8cf8('0x4'));var chatQueue=require(_0x8cf8('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x8cf8('0x6'));var faxQueue=require(_0x8cf8('0x7'));var whatsappQueue=require(_0x8cf8('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x8cf8('0x9')]()[_0x8cf8('0xa')](user[_0x8cf8('0xb')]())[_0x8cf8('0xa')](realtime[_0x8cf8('0xc')]())[_0x8cf8('0xa')](interval[_0x8cf8('0xd')]())[_0x8cf8('0xa')](realtime['initIntervals']())[_0x8cf8('0xa')](openchannelQueue[_0x8cf8('0xe')]())[_0x8cf8('0xa')](realtime[_0x8cf8('0xf')]())[_0x8cf8('0xa')](chatQueue[_0x8cf8('0x10')]())[_0x8cf8('0xa')](realtime[_0x8cf8('0x11')]())['then'](smsQueue['getSmsQueues']())[_0x8cf8('0xa')](realtime[_0x8cf8('0x12')]())['then'](mailQueue[_0x8cf8('0x13')]())[_0x8cf8('0xa')](realtime[_0x8cf8('0x14')]())[_0x8cf8('0xa')](faxQueue[_0x8cf8('0x15')]())['then'](realtime['initFaxQueues']())[_0x8cf8('0xa')](whatsappQueue[_0x8cf8('0x16')]())[_0x8cf8('0xa')](realtime['initWhatsappQueues']())[_0x8cf8('0xa')](function(){return realtime;});}function main(){return server[_0x8cf8('0x17')](realtime)[_0x8cf8('0xa')](function(_0x490eea){return initRealtime();})['then'](function(_0x50287b){return setInterval(initRealtime,0x1388);})[_0x8cf8('0x18')](function(_0x25392b){console['log'](_0x25392b);});}main(); \ No newline at end of file +var _0xba57=['./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue'];(function(_0x117254,_0x4b1c99){var _0x5afe14=function(_0x43f48b){while(--_0x43f48b){_0x117254['push'](_0x117254['shift']());}};_0x5afe14(++_0x4b1c99);}(_0xba57,0x126));var _0x7ba5=function(_0x1172cd,_0xfb90a){_0x1172cd=_0x1172cd-0x0;var _0x205937=_0xba57[_0x1172cd];return _0x205937;};'use strict';var BPromise=require(_0x7ba5('0x0'));var server=require(_0x7ba5('0x1'));var Realtime=require(_0x7ba5('0x2'));var user=require(_0x7ba5('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x7ba5('0x4'));var chatQueue=require(_0x7ba5('0x5'));var smsQueue=require(_0x7ba5('0x6'));var mailQueue=require(_0x7ba5('0x7'));var faxQueue=require(_0x7ba5('0x8'));var whatsappQueue=require(_0x7ba5('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x7ba5('0xa')](user[_0x7ba5('0xb')]())[_0x7ba5('0xa')](realtime['initAgents']())[_0x7ba5('0xa')](interval[_0x7ba5('0xc')]())['then'](realtime['initIntervals']())[_0x7ba5('0xa')](openchannelQueue[_0x7ba5('0xd')]())['then'](realtime[_0x7ba5('0xe')]())[_0x7ba5('0xa')](chatQueue['getChatQueues']())['then'](realtime[_0x7ba5('0xf')]())[_0x7ba5('0xa')](smsQueue[_0x7ba5('0x10')]())[_0x7ba5('0xa')](realtime['initSmsQueues']())['then'](mailQueue[_0x7ba5('0x11')]())[_0x7ba5('0xa')](realtime[_0x7ba5('0x12')]())[_0x7ba5('0xa')](faxQueue[_0x7ba5('0x13')]())[_0x7ba5('0xa')](realtime['initFaxQueues']())[_0x7ba5('0xa')](whatsappQueue['getWhatsappQueues']())[_0x7ba5('0xa')](realtime['initWhatsappQueues']())[_0x7ba5('0xa')](function(){return realtime;});}function main(){return server[_0x7ba5('0x14')](realtime)[_0x7ba5('0xa')](function(_0x23ff38){return initRealtime();})[_0x7ba5('0xa')](function(_0x4479f9){return setInterval(initRealtime,0x1388);})[_0x7ba5('0x15')](function(_0x4fd2d0){console[_0x7ba5('0x16')](_0x4fd2d0);});}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 f2f01d5..f67bf64 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 _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(_0x30ad39,_0x324d43){var _0x146172=function(_0x1e6b0b){while(--_0x1e6b0b){_0x30ad39['push'](_0x30ad39['shift']());}};_0x146172(++_0x324d43);}(_0x7a54,0x106));var _0x47a5=function(_0x3c259b,_0x42c8fc){_0x3c259b=_0x3c259b-0x0;var _0x5bd749=_0x7a54[_0x3c259b];return _0x5bd749;};'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 +var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x3a917f,_0x515972){var _0x4fc77d=function(_0x350f34){while(--_0x350f34){_0x3a917f['push'](_0x3a917f['shift']());}};_0x4fc77d(++_0x515972);}(_0xe14b,0x93));var _0xbe14=function(_0x178469,_0x36d66d){_0x178469=_0x178469-0x0;var _0xc7d745=_0xe14b[_0x178469];return _0xc7d745;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index ee2bea0..e5aa9e9 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 _0x5a57=['SendMail','bluebird','jayson/promise','client','request','error','message','catch'];(function(_0x1bfff5,_0x3c7333){var _0x15dfe6=function(_0x4c849a){while(--_0x4c849a){_0x1bfff5['push'](_0x1bfff5['shift']());}};_0x15dfe6(++_0x3c7333);}(_0x5a57,0x1e1));var _0x75a5=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0x5a57[_0x1034ca];return _0x1a023a;};'use strict';var BPromise=require(_0x75a5('0x0'));var jayson=require(_0x75a5('0x1'));var client=jayson[_0x75a5('0x2')]['http']({'port':0x232b});function request(_0x5d8b03,_0x15c857){return new BPromise(function(_0xda187d,_0x570b77){return client[_0x75a5('0x3')](_0x5d8b03,_0x15c857)['then'](function(_0x3b0ec3){if(_0x3b0ec3[_0x75a5('0x4')]){return _0x570b77(_0x3b0ec3[_0x75a5('0x4')][_0x75a5('0x5')]);}else{return _0xda187d(_0x3b0ec3['result']);}})[_0x75a5('0x6')](function(_0x649222){return _0x570b77(_0x649222);});});}exports['sendMailMessage']=function(_0xec4163,_0x3e2fb){return request(_0x75a5('0x7'),{'account':_0xec4163,'message':_0x3e2fb});}; \ No newline at end of file +var _0x999c=['sendMailMessage','SendMail','jayson/promise','client','http','request','then','error','result','catch'];(function(_0x2ccd5e,_0x3deb44){var _0x1a758e=function(_0x535991){while(--_0x535991){_0x2ccd5e['push'](_0x2ccd5e['shift']());}};_0x1a758e(++_0x3deb44);}(_0x999c,0x156));var _0xc999=function(_0x370870,_0x54598e){_0x370870=_0x370870-0x0;var _0x2cf6de=_0x999c[_0x370870];return _0x2cf6de;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xc999('0x0'));var client=jayson[_0xc999('0x1')][_0xc999('0x2')]({'port':0x232b});function request(_0xd8df06,_0x398f31){return new BPromise(function(_0xb97b6,_0x1a8a01){return client[_0xc999('0x3')](_0xd8df06,_0x398f31)[_0xc999('0x4')](function(_0x3dcfa6){if(_0x3dcfa6[_0xc999('0x5')]){return _0x1a8a01(_0x3dcfa6[_0xc999('0x5')]['message']);}else{return _0xb97b6(_0x3dcfa6[_0xc999('0x6')]);}})[_0xc999('0x7')](function(_0x56658d){return _0x1a8a01(_0x56658d);});});}exports[_0xc999('0x8')]=function(_0x2efd93,_0x27a703){return request(_0xc999('0x9'),{'account':_0x2efd93,'message':_0x27a703});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 0f8ad5f..3abc68c 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 _0x5229=['stringify','emit','user:save','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','unknown','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','prototype','mail','chat','fax','sms','whatsapp','length','toNumber','format','Status','smsPause','mailStatus','mailStatusTime','faxStatus','whatsappStatusTime'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0x5229,0xba));var _0x9522=function(_0x356683,_0x2f301e){_0x356683=_0x356683-0x0;var _0x3a0341=_0x5229[_0x356683];return _0x3a0341;};'use strict';var _=require('lodash');var moment=require(_0x9522('0x0'));var md5=require(_0x9522('0x1'));var Redis=require(_0x9522('0x2'));var config=require(_0x9522('0x3'));config['redis']=_['defaults'](config[_0x9522('0x4')],{'host':_0x9522('0x5'),'port':0x18eb});var io=require(_0x9522('0x6'))(new Redis(config[_0x9522('0x4')]));function Agent(_0x8894bb){this['id']=_0x8894bb['id']||0x0;this[_0x9522('0x7')]=_0x8894bb['name']||'';this[_0x9522('0x8')]=_0x8894bb[_0x9522('0x8')]||!![];this['voicePause']=_0x8894bb[_0x9522('0x9')]||![];this[_0x9522('0xa')]=_0x8894bb[_0x9522('0xa')]||![];this[_0x9522('0xb')]=_0x8894bb[_0x9522('0xb')]||![];this['faxPause']=_0x8894bb[_0x9522('0xc')]||![];this['smsPause']=_0x8894bb['smsPause']||![];this[_0x9522('0xd')]=_0x8894bb[_0x9522('0xd')]||![];this[_0x9522('0xe')]='unknown';this[_0x9522('0xf')]=0x0;this[_0x9522('0x10')]=_0x8894bb[_0x9522('0x10')]||0x0;this[_0x9522('0x11')]=0x0;this['mailStatus']=_0x9522('0x12');this['mailStatusTime']=0x0;this[_0x9522('0x13')]=_0x8894bb[_0x9522('0x13')]||0x0;this[_0x9522('0x14')]=0x0;this['faxStatus']=_0x9522('0x12');this[_0x9522('0x15')]=0x0;this[_0x9522('0x16')]=_0x8894bb[_0x9522('0x16')]||0x0;this[_0x9522('0x17')]=0x0;this[_0x9522('0x18')]=_0x9522('0x12');this[_0x9522('0x19')]=0x0;this[_0x9522('0x1a')]=_0x8894bb['smsCapacity']||0x0;this[_0x9522('0x1b')]=0x0;this[_0x9522('0x1c')]='unknown';this['whatsappStatusTime']=0x0;this[_0x9522('0x1d')]=_0x8894bb[_0x9522('0x1d')]||0x0;this[_0x9522('0x1e')]=0x0;this[_0x9522('0x1f')]=_0x9522('0x12');this[_0x9522('0x20')]=0x0;this['openchannelCapacity']=_0x8894bb[_0x9522('0x21')]||0x0;this[_0x9522('0x22')]=0x0;this[_0x9522('0x23')]=![];this[_0x9522('0x24')]=undefined;this[_0x9522('0x1')]='';this[_0x9522('0x25')]();}Agent['prototype'][_0x9522('0x26')]=function(_0x51d836){if(this[_0x51d836+'CurrentCapacity']>0x0){if(this[_0x51d836+'Capacity']>0x0&&this[_0x51d836+_0x9522('0x27')]>=this[_0x51d836+_0x9522('0x28')]){return _0x9522('0x29');}else{return'working';}}else{return _0x9522('0x2a');}};Agent[_0x9522('0x2b')][_0x9522('0x25')]=function(){var _0x227e96=[_0x9522('0x2c'),_0x9522('0x2d'),'openchannel',_0x9522('0x2e'),_0x9522('0x2f'),_0x9522('0x30')];for(var _0x11d9a6=0x0;_0x11d9a6<_0x227e96[_0x9522('0x31')];_0x11d9a6+=0x1){var _0x407d2c=this[_0x9522('0x26')](_0x227e96[_0x11d9a6]);if(this[_0x227e96[_0x11d9a6]+'Status']!==_0x407d2c){this[_0x227e96[_0x11d9a6]+'StatusTime']=_[_0x9522('0x32')](moment()[_0x9522('0x33')]('x'));}this[_0x227e96[_0x11d9a6]+_0x9522('0x34')]=_0x407d2c;}var _0x4ed95f={'id':this['id'],'name':this[_0x9522('0x7')],'online':this[_0x9522('0x8')],'voicePause':this[_0x9522('0x9')],'chatPause':this[_0x9522('0xa')],'mailPause':this[_0x9522('0xb')],'smsPause':this[_0x9522('0x35')],'faxPause':this['faxPause'],'openchannelPause':this[_0x9522('0xd')],'chatStatus':this[_0x9522('0xe')],'chatStatusTime':this[_0x9522('0xf')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x9522('0x11')],'mailStatus':this[_0x9522('0x36')],'mailStatusTime':this[_0x9522('0x37')],'mailCapacity':this[_0x9522('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x9522('0x38')],'faxStatusTime':this[_0x9522('0x15')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x9522('0x17')],'smsStatus':this[_0x9522('0x18')],'smsStatusTime':this[_0x9522('0x19')],'smsCapacity':this[_0x9522('0x1a')],'smsCurrentCapacity':this[_0x9522('0x1b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x9522('0x39')],'whatsappCapacity':this[_0x9522('0x1d')],'whatsappCurrentCapacity':this[_0x9522('0x1e')],'openchannelStatus':this[_0x9522('0x1f')],'openchannelStatusTime':this[_0x9522('0x20')],'openchannelCapacity':this[_0x9522('0x21')],'openchannelCurrentCapacity':this[_0x9522('0x22')],'busy':this['busy'],'busyQueue':this[_0x9522('0x24')]};var _0x5623d3=md5(JSON[_0x9522('0x3a')](_0x4ed95f));if(this[_0x9522('0x1')]!==_0x5623d3){this[_0x9522('0x1')]=_0x5623d3;io[_0x9522('0x3b')](_0x9522('0x3c'),_0x4ed95f);}};module['exports']=Agent; \ No newline at end of file +var _0xa33b=['sms','whatsapp','length','StatusTime','toNumber','smsPause','chatStatus','faxCurrentCapacity','whatsappStatus','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax'];(function(_0x4fb855,_0x39a2a6){var _0x12fd0c=function(_0x1d87a4){while(--_0x1d87a4){_0x4fb855['push'](_0x4fb855['shift']());}};_0x12fd0c(++_0x39a2a6);}(_0xa33b,0x83));var _0xba33=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xa33b[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xba33('0x0'));var moment=require(_0xba33('0x1'));var md5=require(_0xba33('0x2'));var Redis=require(_0xba33('0x3'));var config=require(_0xba33('0x4'));config[_0xba33('0x5')]=_[_0xba33('0x6')](config['redis'],{'host':_0xba33('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xba33('0x5')]));function Agent(_0x513eb5){this['id']=_0x513eb5['id']||0x0;this[_0xba33('0x8')]=_0x513eb5[_0xba33('0x8')]||'';this[_0xba33('0x9')]=_0x513eb5[_0xba33('0x9')]||!![];this[_0xba33('0xa')]=_0x513eb5[_0xba33('0xa')]||![];this[_0xba33('0xb')]=_0x513eb5[_0xba33('0xb')]||![];this[_0xba33('0xc')]=_0x513eb5[_0xba33('0xc')]||![];this[_0xba33('0xd')]=_0x513eb5[_0xba33('0xd')]||![];this['smsPause']=_0x513eb5['smsPause']||![];this['openchannelPause']=_0x513eb5[_0xba33('0xe')]||![];this['chatStatus']=_0xba33('0xf');this[_0xba33('0x10')]=0x0;this[_0xba33('0x11')]=_0x513eb5['chatCapacity']||0x0;this[_0xba33('0x12')]=0x0;this[_0xba33('0x13')]=_0xba33('0xf');this[_0xba33('0x14')]=0x0;this[_0xba33('0x15')]=_0x513eb5[_0xba33('0x15')]||0x0;this[_0xba33('0x16')]=0x0;this[_0xba33('0x17')]=_0xba33('0xf');this[_0xba33('0x18')]=0x0;this[_0xba33('0x19')]=_0x513eb5['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0xba33('0x1a')]=_0xba33('0xf');this[_0xba33('0x1b')]=0x0;this[_0xba33('0x1c')]=_0x513eb5['smsCapacity']||0x0;this[_0xba33('0x1d')]=0x0;this['whatsappStatus']=_0xba33('0xf');this[_0xba33('0x1e')]=0x0;this[_0xba33('0x1f')]=_0x513eb5[_0xba33('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xba33('0x20')]=_0xba33('0xf');this[_0xba33('0x21')]=0x0;this[_0xba33('0x22')]=_0x513eb5[_0xba33('0x22')]||0x0;this[_0xba33('0x23')]=0x0;this[_0xba33('0x24')]=![];this['busyQueue']=undefined;this[_0xba33('0x2')]='';this[_0xba33('0x25')]();}Agent[_0xba33('0x26')][_0xba33('0x27')]=function(_0x345e25){if(this[_0x345e25+_0xba33('0x28')]>0x0){if(this[_0x345e25+_0xba33('0x29')]>0x0&&this[_0x345e25+_0xba33('0x28')]>=this[_0x345e25+_0xba33('0x29')]){return _0xba33('0x2a');}else{return _0xba33('0x2b');}}else{return _0xba33('0x2c');}};Agent[_0xba33('0x26')]['updateRealtime']=function(){var _0x4324ff=[_0xba33('0x2d'),_0xba33('0x2e'),_0xba33('0x2f'),_0xba33('0x30'),_0xba33('0x31'),_0xba33('0x32')];for(var _0x4f074b=0x0;_0x4f074b<_0x4324ff[_0xba33('0x33')];_0x4f074b+=0x1){var _0x3f5ea0=this[_0xba33('0x27')](_0x4324ff[_0x4f074b]);if(this[_0x4324ff[_0x4f074b]+'Status']!==_0x3f5ea0){this[_0x4324ff[_0x4f074b]+_0xba33('0x34')]=_[_0xba33('0x35')](moment()['format']('x'));}this[_0x4324ff[_0x4f074b]+'Status']=_0x3f5ea0;}var _0x40439d={'id':this['id'],'name':this[_0xba33('0x8')],'online':this['online'],'voicePause':this[_0xba33('0xa')],'chatPause':this[_0xba33('0xb')],'mailPause':this[_0xba33('0xc')],'smsPause':this[_0xba33('0x36')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xba33('0x37')],'chatStatusTime':this[_0xba33('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xba33('0x12')],'mailStatus':this[_0xba33('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xba33('0x15')],'mailCurrentCapacity':this[_0xba33('0x16')],'faxStatus':this[_0xba33('0x17')],'faxStatusTime':this[_0xba33('0x18')],'faxCapacity':this[_0xba33('0x19')],'faxCurrentCapacity':this[_0xba33('0x38')],'smsStatus':this[_0xba33('0x1a')],'smsStatusTime':this[_0xba33('0x1b')],'smsCapacity':this[_0xba33('0x1c')],'smsCurrentCapacity':this[_0xba33('0x1d')],'whatsappStatus':this[_0xba33('0x39')],'whatsappStatusTime':this[_0xba33('0x1e')],'whatsappCapacity':this[_0xba33('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xba33('0x21')],'openchannelCapacity':this[_0xba33('0x22')],'openchannelCurrentCapacity':this[_0xba33('0x23')],'busy':this[_0xba33('0x24')],'busyQueue':this['busyQueue']};var _0x45a3c8=md5(JSON['stringify'](_0x40439d));if(this[_0xba33('0x2')]!==_0x45a3c8){this[_0xba33('0x2')]=_0x45a3c8;io[_0xba33('0x3a')](_0xba33('0x3b'),_0x40439d);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index c8844c6..29a2e8a 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 _0x586a=['localhost','name','timeout','strategy','beepall','Agents','prototype','updateRouting','mapAgentsId','_rr','map','updateRealtime','loggedIn','paused','length','available','waiting','stringify','format','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x2ded7d,_0x44e525){var _0x44e0e6=function(_0x2aa6c5){while(--_0x2aa6c5){_0x2ded7d['push'](_0x2ded7d['shift']());}};_0x44e0e6(++_0x44e525);}(_0x586a,0x112));var _0xa586=function(_0x5a0e06,_0x1851cb){_0x5a0e06=_0x5a0e06-0x0;var _0x151ae8=_0x586a[_0x5a0e06];return _0x151ae8;};'use strict';var _=require(_0xa586('0x0'));var md5=require(_0xa586('0x1'));var util=require(_0xa586('0x2'));var Redis=require(_0xa586('0x3'));var config=require(_0xa586('0x4'));config[_0xa586('0x5')]=_['defaults'](config[_0xa586('0x5')],{'host':_0xa586('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x2630ce){this['id']=_0x2630ce['id']||0x0;this[_0xa586('0x7')]=_0x2630ce[_0xa586('0x7')]||'';this[_0xa586('0x8')]=_0x2630ce[_0xa586('0x8')]||0xa;this['strategy']=_0x2630ce[_0xa586('0x9')]||_0xa586('0xa');this[_0xa586('0xb')]=_0x2630ce[_0xa586('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xa586('0x1')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0xa586('0xc')][_0xa586('0xd')]=function(){var _0x364ed5=this[_0xa586('0xe')][_0xa586('0xf')];this[_0xa586('0xe')]=_[_0xa586('0x10')](this[_0xa586('0xb')],'id');this[_0xa586('0xe')][_0xa586('0xf')]=_0x364ed5;};ChatQueue['prototype'][_0xa586('0x11')]=function(){this[_0xa586('0x12')]=0x0;this[_0xa586('0x13')]=0x0;for(var _0x2105eb=0x0;_0x2105eb=0x0?this[_0xa586('0x15')]:0x0;var _0xbd6fd8={'id':this['id'],'available':this[_0xa586('0x15')],'loggedIn':this[_0xa586('0x12')],'name':this[_0xa586('0x7')],'paused':this[_0xa586('0x13')],'waiting':this[_0xa586('0x16')]};var _0x4bdf41=md5(JSON[_0xa586('0x17')](_0xbd6fd8));if(this[_0xa586('0x1')]!==_0x4bdf41){this[_0xa586('0x1')]=_0x4bdf41;io['to'](util[_0xa586('0x18')]('chat:queue:%s',_0xbd6fd8[_0xa586('0x7')]))[_0xa586('0x19')](_0xa586('0x1a'),_0xbd6fd8);}};module[_0xa586('0x1b')]=ChatQueue; \ No newline at end of file +var _0x4975=['localhost','socket.io-emitter','name','timeout','strategy','Agents','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','paused','length','online','loggedIn','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x396de5,_0x40d622){var _0x12c7f0=function(_0x4e65be){while(--_0x4e65be){_0x396de5['push'](_0x396de5['shift']());}};_0x12c7f0(++_0x40d622);}(_0x4975,0x1d6));var _0x5497=function(_0x271e30,_0xf4b25d){_0x271e30=_0x271e30-0x0;var _0x2cf50f=_0x4975[_0x271e30];return _0x2cf50f;};'use strict';var _=require('lodash');var md5=require(_0x5497('0x0'));var util=require(_0x5497('0x1'));var Redis=require(_0x5497('0x2'));var config=require(_0x5497('0x3'));config[_0x5497('0x4')]=_[_0x5497('0x5')](config[_0x5497('0x4')],{'host':_0x5497('0x6'),'port':0x18eb});var io=require(_0x5497('0x7'))(new Redis(config[_0x5497('0x4')]));function ChatQueue(_0xb251fa){this['id']=_0xb251fa['id']||0x0;this['name']=_0xb251fa[_0x5497('0x8')]||'';this[_0x5497('0x9')]=_0xb251fa[_0x5497('0x9')]||0xa;this[_0x5497('0xa')]=_0xb251fa['strategy']||'beepall';this[_0x5497('0xb')]=_0xb251fa[_0x5497('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x5497('0x0')]='';this['updateRouting']();this[_0x5497('0xc')]();}ChatQueue[_0x5497('0xd')][_0x5497('0xe')]=function(){var _0x45ea22=this[_0x5497('0xf')]['_rr'];this[_0x5497('0xf')]=_['map'](this[_0x5497('0xb')],'id');this[_0x5497('0xf')][_0x5497('0x10')]=_0x45ea22;};ChatQueue['prototype'][_0x5497('0xc')]=function(){this['loggedIn']=0x0;this[_0x5497('0x11')]=0x0;for(var _0x597735=0x0;_0x597735=0x0?this[_0x5497('0x16')]:0x0;var _0x616464={'id':this['id'],'available':this[_0x5497('0x16')],'loggedIn':this[_0x5497('0x14')],'name':this[_0x5497('0x8')],'paused':this[_0x5497('0x11')],'waiting':this['waiting']};var _0x72b7d2=md5(JSON[_0x5497('0x17')](_0x616464));if(this[_0x5497('0x0')]!==_0x72b7d2){this['md5']=_0x72b7d2;io['to'](util[_0x5497('0x18')](_0x5497('0x19'),_0x616464['name']))['emit'](_0x5497('0x1a'),_0x616464);}};module[_0x5497('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 97f06d3..09c6eca 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 _0x0a1e=['map','Agents','_rr','prototype','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a1e,0x177));var _0xe0a1=function(_0xa8bac1,_0x399c33){_0xa8bac1=_0xa8bac1-0x0;var _0x15ffcf=_0x0a1e[_0xa8bac1];return _0x15ffcf;};'use strict';var _=require(_0xe0a1('0x0'));var md5=require(_0xe0a1('0x1'));var util=require(_0xe0a1('0x2'));var Redis=require(_0xe0a1('0x3'));var config=require('../../../config/environment');config[_0xe0a1('0x4')]=_[_0xe0a1('0x5')](config[_0xe0a1('0x4')],{'host':_0xe0a1('0x6'),'port':0x18eb});var io=require(_0xe0a1('0x7'))(new Redis(config[_0xe0a1('0x4')]));function FaxQueue(_0x1c60c1){this['id']=_0x1c60c1['id']||0x0;this[_0xe0a1('0x8')]=_0x1c60c1['name']||'';this[_0xe0a1('0x9')]=_0x1c60c1[_0xe0a1('0x9')]||0xa;this[_0xe0a1('0xa')]=_0x1c60c1['strategy']||'beepall';this['Agents']=_0x1c60c1['Agents'];this[_0xe0a1('0xb')]={};this[_0xe0a1('0xc')]=0x0;this[_0xe0a1('0x1')]='';this[_0xe0a1('0xd')]();this[_0xe0a1('0xe')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x490225=this[_0xe0a1('0xb')]['_rr'];this['mapAgentsId']=_[_0xe0a1('0xf')](this[_0xe0a1('0x10')],'id');this['mapAgentsId'][_0xe0a1('0x11')]=_0x490225;};FaxQueue[_0xe0a1('0x12')][_0xe0a1('0xe')]=function(){this[_0xe0a1('0x13')]=0x0;this[_0xe0a1('0x14')]=0x0;for(var _0x164c21=0x0;_0x164c21=0x0?this[_0xe0a1('0x18')]:0x0;var _0x52976f={'id':this['id'],'available':this[_0xe0a1('0x18')],'loggedIn':this[_0xe0a1('0x13')],'name':this[_0xe0a1('0x8')],'paused':this[_0xe0a1('0x14')],'waiting':this[_0xe0a1('0xc')]};var _0x10d729=md5(JSON[_0xe0a1('0x19')](_0x52976f));if(this[_0xe0a1('0x1')]!==_0x10d729){this[_0xe0a1('0x1')]=_0x10d729;io['to'](util[_0xe0a1('0x1a')](_0xe0a1('0x1b'),_0x52976f[_0xe0a1('0x8')]))['emit'](_0xe0a1('0x1c'),_0x52976f);}};module[_0xe0a1('0x1d')]=FaxQueue; \ No newline at end of file +var _0xf7e6=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','length','loggedIn','faxPause','paused','available','stringify','md5','fax:queue:%s','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x210acd,_0x5617de){var _0x9ae98a=function(_0x751aad){while(--_0x751aad){_0x210acd['push'](_0x210acd['shift']());}};_0x9ae98a(++_0x5617de);}(_0xf7e6,0x1b5));var _0x6f7e=function(_0x5a1fa1,_0xe3c7e2){_0x5a1fa1=_0x5a1fa1-0x0;var _0x47fe8b=_0xf7e6[_0x5a1fa1];return _0x47fe8b;};'use strict';var _=require(_0x6f7e('0x0'));var md5=require('md5');var util=require(_0x6f7e('0x1'));var Redis=require('ioredis');var config=require(_0x6f7e('0x2'));config[_0x6f7e('0x3')]=_[_0x6f7e('0x4')](config[_0x6f7e('0x3')],{'host':_0x6f7e('0x5'),'port':0x18eb});var io=require(_0x6f7e('0x6'))(new Redis(config[_0x6f7e('0x3')]));function FaxQueue(_0x539a94){this['id']=_0x539a94['id']||0x0;this['name']=_0x539a94[_0x6f7e('0x7')]||'';this[_0x6f7e('0x8')]=_0x539a94['timeout']||0xa;this[_0x6f7e('0x9')]=_0x539a94[_0x6f7e('0x9')]||_0x6f7e('0xa');this[_0x6f7e('0xb')]=_0x539a94[_0x6f7e('0xb')];this[_0x6f7e('0xc')]={};this[_0x6f7e('0xd')]=0x0;this['md5']='';this[_0x6f7e('0xe')]();this[_0x6f7e('0xf')]();}FaxQueue[_0x6f7e('0x10')]['updateRouting']=function(){var _0x102c07=this[_0x6f7e('0xc')][_0x6f7e('0x11')];this['mapAgentsId']=_[_0x6f7e('0x12')](this[_0x6f7e('0xb')],'id');this[_0x6f7e('0xc')][_0x6f7e('0x11')]=_0x102c07;};FaxQueue['prototype'][_0x6f7e('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x5a8246=0x0;_0x5a8246=0x0?this['available']:0x0;var _0x342fcc={'id':this['id'],'available':this[_0x6f7e('0x17')],'loggedIn':this[_0x6f7e('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x6f7e('0xd')]};var _0x293de1=md5(JSON[_0x6f7e('0x18')](_0x342fcc));if(this['md5']!==_0x293de1){this[_0x6f7e('0x19')]=_0x293de1;io['to'](util['format'](_0x6f7e('0x1a'),_0x342fcc['name']))['emit']('fax_queue:save',_0x342fcc);}};module[_0x6f7e('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 3ae41cf..7b8192b 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 _0x1317=['Intervals','name'];(function(_0x10deb6,_0x8c68a6){var _0x844c7e=function(_0x1b7a4f){while(--_0x1b7a4f){_0x10deb6['push'](_0x10deb6['shift']());}};_0x844c7e(++_0x8c68a6);}(_0x1317,0x1ad));var _0x7131=function(_0x2a2f2e,_0x52e563){_0x2a2f2e=_0x2a2f2e-0x0;var _0x6f8262=_0x1317[_0x2a2f2e];return _0x6f8262;};'use strict';function Interval(_0x172197){this['id']=_0x172197['id']||0x0;this['name']=_0x172197[_0x7131('0x0')]||'';this['Intervals']=_0x172197[_0x7131('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x2760=['Intervals','exports','name'];(function(_0x4da8ab,_0x262362){var _0x31c9f0=function(_0x467fa2){while(--_0x467fa2){_0x4da8ab['push'](_0x4da8ab['shift']());}};_0x31c9f0(++_0x262362);}(_0x2760,0x155));var _0x0276=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x2760[_0x295a3d];return _0x23a732;};'use strict';function Interval(_0x216533){this['id']=_0x216533['id']||0x0;this[_0x0276('0x0')]=_0x216533[_0x0276('0x0')]||'';this[_0x0276('0x1')]=_0x216533['Intervals']||{};}module[_0x0276('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index b9b3907..eec1c5e 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 _0x7cb8=['prototype','map','loggedIn','paused','length','available','waiting','mail:queue:%s','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime'];(function(_0x1714c9,_0x5d0879){var _0x4cbb4b=function(_0xf09a9){while(--_0xf09a9){_0x1714c9['push'](_0x1714c9['shift']());}};_0x4cbb4b(++_0x5d0879);}(_0x7cb8,0x14f));var _0x87cb=function(_0x2f31ca,_0x29909c){_0x2f31ca=_0x2f31ca-0x0;var _0x2a0172=_0x7cb8[_0x2f31ca];return _0x2a0172;};'use strict';var _=require('lodash');var md5=require(_0x87cb('0x0'));var util=require(_0x87cb('0x1'));var Redis=require(_0x87cb('0x2'));var config=require(_0x87cb('0x3'));config[_0x87cb('0x4')]=_['defaults'](config[_0x87cb('0x4')],{'host':_0x87cb('0x5'),'port':0x18eb});var io=require(_0x87cb('0x6'))(new Redis(config[_0x87cb('0x4')]));function MailQueue(_0x572286){this['id']=_0x572286['id']||0x0;this['name']=_0x572286[_0x87cb('0x7')]||'';this[_0x87cb('0x8')]=_0x572286[_0x87cb('0x8')]||0xa;this['strategy']=_0x572286[_0x87cb('0x9')]||_0x87cb('0xa');this[_0x87cb('0xb')]=_0x572286[_0x87cb('0xb')];this[_0x87cb('0xc')]={};this['waiting']=0x0;this[_0x87cb('0x0')]='';this[_0x87cb('0xd')]();this[_0x87cb('0xe')]();}MailQueue[_0x87cb('0xf')][_0x87cb('0xd')]=function(){var _0x1d90a8=this[_0x87cb('0xc')]['_rr'];this[_0x87cb('0xc')]=_[_0x87cb('0x10')](this[_0x87cb('0xb')],'id');this[_0x87cb('0xc')]['_rr']=_0x1d90a8;};MailQueue['prototype'][_0x87cb('0xe')]=function(){this[_0x87cb('0x11')]=0x0;this[_0x87cb('0x12')]=0x0;for(var _0x2059f1=0x0;_0x2059f1=0x0?this[_0x87cb('0x14')]:0x0;var _0x4f8dc2={'id':this['id'],'available':this[_0x87cb('0x14')],'loggedIn':this[_0x87cb('0x11')],'name':this[_0x87cb('0x7')],'paused':this[_0x87cb('0x12')],'waiting':this[_0x87cb('0x15')]};var _0x3bbb17=md5(JSON['stringify'](_0x4f8dc2));if(this[_0x87cb('0x0')]!==_0x3bbb17){this['md5']=_0x3bbb17;io['to'](util['format'](_0x87cb('0x16'),_0x4f8dc2['name']))['emit'](_0x87cb('0x17'),_0x4f8dc2);}};module[_0x87cb('0x18')]=MailQueue; \ No newline at end of file +var _0xa0af=['stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available'];(function(_0x26ff28,_0xa51640){var _0x3631c2=function(_0x58269f){while(--_0x58269f){_0x26ff28['push'](_0x26ff28['shift']());}};_0x3631c2(++_0xa51640);}(_0xa0af,0x114));var _0xfa0a=function(_0x51559c,_0x31c144){_0x51559c=_0x51559c-0x0;var _0x4b04c8=_0xa0af[_0x51559c];return _0x4b04c8;};'use strict';var _=require(_0xfa0a('0x0'));var md5=require(_0xfa0a('0x1'));var util=require(_0xfa0a('0x2'));var Redis=require('ioredis');var config=require(_0xfa0a('0x3'));config[_0xfa0a('0x4')]=_[_0xfa0a('0x5')](config[_0xfa0a('0x4')],{'host':_0xfa0a('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfa0a('0x4')]));function MailQueue(_0x1e238f){this['id']=_0x1e238f['id']||0x0;this['name']=_0x1e238f[_0xfa0a('0x7')]||'';this[_0xfa0a('0x8')]=_0x1e238f['timeout']||0xa;this['strategy']=_0x1e238f[_0xfa0a('0x9')]||_0xfa0a('0xa');this[_0xfa0a('0xb')]=_0x1e238f[_0xfa0a('0xb')];this[_0xfa0a('0xc')]={};this[_0xfa0a('0xd')]=0x0;this[_0xfa0a('0x1')]='';this[_0xfa0a('0xe')]();this[_0xfa0a('0xf')]();}MailQueue[_0xfa0a('0x10')][_0xfa0a('0xe')]=function(){var _0x312827=this[_0xfa0a('0xc')][_0xfa0a('0x11')];this[_0xfa0a('0xc')]=_[_0xfa0a('0x12')](this[_0xfa0a('0xb')],'id');this[_0xfa0a('0xc')][_0xfa0a('0x11')]=_0x312827;};MailQueue[_0xfa0a('0x10')][_0xfa0a('0xf')]=function(){this[_0xfa0a('0x13')]=0x0;this[_0xfa0a('0x14')]=0x0;for(var _0xa43e18=0x0;_0xa43e18=0x0?this[_0xfa0a('0x17')]:0x0;var _0x1cf08b={'id':this['id'],'available':this['available'],'loggedIn':this[_0xfa0a('0x13')],'name':this[_0xfa0a('0x7')],'paused':this[_0xfa0a('0x14')],'waiting':this['waiting']};var _0x517777=md5(JSON[_0xfa0a('0x18')](_0x1cf08b));if(this[_0xfa0a('0x1')]!==_0x517777){this[_0xfa0a('0x1')]=_0x517777;io['to'](util[_0xfa0a('0x19')](_0xfa0a('0x1a'),_0x1cf08b[_0xfa0a('0x7')]))[_0xfa0a('0x1b')](_0xfa0a('0x1c'),_0x1cf08b);}};module[_0xfa0a('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 5aeec46..b9af2af 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x37a3f3,_0x663b49){var _0x4da923=function(_0x47713f){while(--_0x47713f){_0x37a3f3['push'](_0x37a3f3['shift']());}};_0x4da923(++_0x663b49);}(_0x5fc3,0xa8));var _0x35fc=function(_0x16a637,_0x5eb627){_0x16a637=_0x16a637-0x0;var _0x25126d=_0x5fc3[_0x16a637];return _0x25126d;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x1d0a84,_0x5b74c0){var _0xc51c70=function(_0x36cabc){while(--_0x36cabc){_0x1d0a84['push'](_0x1d0a84['shift']());}};_0xc51c70(++_0x5b74c0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0x5fc3[_0x2e4cbf];return _0x52840f;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 4ab2b85..7a67b71 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 _0xb2b3=['waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x152b18,_0x526a1d){var _0x42b269=function(_0x9d15d5){while(--_0x9d15d5){_0x152b18['push'](_0x152b18['shift']());}};_0x42b269(++_0x526a1d);}(_0xb2b3,0x71));var _0x3b2b=function(_0x3cf7fe,_0x5dc4cf){_0x3cf7fe=_0x3cf7fe-0x0;var _0x5d5cdc=_0xb2b3[_0x3cf7fe];return _0x5d5cdc;};'use strict';var _=require(_0x3b2b('0x0'));var md5=require(_0x3b2b('0x1'));var util=require(_0x3b2b('0x2'));var Redis=require(_0x3b2b('0x3'));var config=require(_0x3b2b('0x4'));config[_0x3b2b('0x5')]=_[_0x3b2b('0x6')](config['redis'],{'host':_0x3b2b('0x7'),'port':0x18eb});var io=require(_0x3b2b('0x8'))(new Redis(config[_0x3b2b('0x5')]));function SmsQueue(_0x45e179){this['id']=_0x45e179['id']||0x0;this[_0x3b2b('0x9')]=_0x45e179[_0x3b2b('0x9')]||'';this[_0x3b2b('0xa')]=_0x45e179[_0x3b2b('0xa')]||0xa;this[_0x3b2b('0xb')]=_0x45e179[_0x3b2b('0xb')]||_0x3b2b('0xc');this[_0x3b2b('0xd')]=_0x45e179['Agents'];this[_0x3b2b('0xe')]={};this[_0x3b2b('0xf')]=0x0;this[_0x3b2b('0x1')]='';this[_0x3b2b('0x10')]();this[_0x3b2b('0x11')]();}SmsQueue[_0x3b2b('0x12')]['updateRouting']=function(){var _0x492f5f=this[_0x3b2b('0xe')][_0x3b2b('0x13')];this[_0x3b2b('0xe')]=_[_0x3b2b('0x14')](this['Agents'],'id');this[_0x3b2b('0xe')][_0x3b2b('0x13')]=_0x492f5f;};SmsQueue[_0x3b2b('0x12')][_0x3b2b('0x11')]=function(){this[_0x3b2b('0x15')]=0x0;this[_0x3b2b('0x16')]=0x0;for(var _0x52b63f=0x0;_0x52b63f=0x0?this[_0x3b2b('0x19')]:0x0;var _0x52bba5={'id':this['id'],'available':this[_0x3b2b('0x19')],'loggedIn':this[_0x3b2b('0x15')],'name':this['name'],'paused':this[_0x3b2b('0x16')],'waiting':this['waiting']};var _0x26f83=md5(JSON[_0x3b2b('0x1a')](_0x52bba5));if(this['md5']!==_0x26f83){this['md5']=_0x26f83;io['to'](util[_0x3b2b('0x1b')](_0x3b2b('0x1c'),_0x52bba5[_0x3b2b('0x9')]))[_0x3b2b('0x1d')](_0x3b2b('0x1e'),_0x52bba5);}};module[_0x3b2b('0x1f')]=SmsQueue; \ No newline at end of file +var _0xc5ba=['available','format','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','smsPause'];(function(_0x572ede,_0x2c1654){var _0x1abe60=function(_0x1cfb20){while(--_0x1cfb20){_0x572ede['push'](_0x572ede['shift']());}};_0x1abe60(++_0x2c1654);}(_0xc5ba,0xb9));var _0xac5b=function(_0x474376,_0x385824){_0x474376=_0x474376-0x0;var _0x9141b=_0xc5ba[_0x474376];return _0x9141b;};'use strict';var _=require(_0xac5b('0x0'));var md5=require(_0xac5b('0x1'));var util=require(_0xac5b('0x2'));var Redis=require(_0xac5b('0x3'));var config=require(_0xac5b('0x4'));config[_0xac5b('0x5')]=_[_0xac5b('0x6')](config[_0xac5b('0x5')],{'host':_0xac5b('0x7'),'port':0x18eb});var io=require(_0xac5b('0x8'))(new Redis(config[_0xac5b('0x5')]));function SmsQueue(_0x555fc){this['id']=_0x555fc['id']||0x0;this[_0xac5b('0x9')]=_0x555fc[_0xac5b('0x9')]||'';this[_0xac5b('0xa')]=_0x555fc[_0xac5b('0xa')]||0xa;this[_0xac5b('0xb')]=_0x555fc['strategy']||'beepall';this[_0xac5b('0xc')]=_0x555fc['Agents'];this[_0xac5b('0xd')]={};this[_0xac5b('0xe')]=0x0;this[_0xac5b('0x1')]='';this[_0xac5b('0xf')]();this[_0xac5b('0x10')]();}SmsQueue[_0xac5b('0x11')][_0xac5b('0xf')]=function(){var _0x2b37dd=this[_0xac5b('0xd')]['_rr'];this[_0xac5b('0xd')]=_[_0xac5b('0x12')](this[_0xac5b('0xc')],'id');this[_0xac5b('0xd')][_0xac5b('0x13')]=_0x2b37dd;};SmsQueue[_0xac5b('0x11')][_0xac5b('0x10')]=function(){this[_0xac5b('0x14')]=0x0;this[_0xac5b('0x15')]=0x0;for(var _0x58dc98=0x0;_0x58dc98=0x0?this[_0xac5b('0x19')]:0x0;var _0x551ccf={'id':this['id'],'available':this[_0xac5b('0x19')],'loggedIn':this['loggedIn'],'name':this[_0xac5b('0x9')],'paused':this['paused'],'waiting':this[_0xac5b('0xe')]};var _0x2ec29f=md5(JSON['stringify'](_0x551ccf));if(this['md5']!==_0x2ec29f){this['md5']=_0x2ec29f;io['to'](util[_0xac5b('0x1a')]('sms:queue:%s',_0x551ccf[_0xac5b('0x9')]))[_0xac5b('0x1b')](_0xac5b('0x1c'),_0x551ccf);}};module[_0xac5b('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 6391330..6fb2ad2 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 _0x8364=['length','online','loggedIn','whatsappPause','available','stringify','format','emit','whatsapp_queue:save','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','paused'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x8364,0x1bc));var _0x4836=function(_0x25c934,_0x1531e6){_0x25c934=_0x25c934-0x0;var _0x22806e=_0x8364[_0x25c934];return _0x22806e;};'use strict';var _=require(_0x4836('0x0'));var md5=require(_0x4836('0x1'));var util=require(_0x4836('0x2'));var Redis=require(_0x4836('0x3'));var config=require('../../../config/environment');config[_0x4836('0x4')]=_['defaults'](config[_0x4836('0x4')],{'host':_0x4836('0x5'),'port':0x18eb});var io=require(_0x4836('0x6'))(new Redis(config[_0x4836('0x4')]));function WhatsappQueue(_0x2a9c79){this['id']=_0x2a9c79['id']||0x0;this[_0x4836('0x7')]=_0x2a9c79[_0x4836('0x7')]||'';this[_0x4836('0x8')]=_0x2a9c79['timeout']||0xa;this['strategy']=_0x2a9c79[_0x4836('0x9')]||_0x4836('0xa');this['Agents']=_0x2a9c79[_0x4836('0xb')];this[_0x4836('0xc')]={};this[_0x4836('0xd')]=0x0;this[_0x4836('0x1')]='';this[_0x4836('0xe')]();this['updateRealtime']();}WhatsappQueue[_0x4836('0xf')][_0x4836('0xe')]=function(){var _0x2d3bc2=this[_0x4836('0xc')][_0x4836('0x10')];this[_0x4836('0xc')]=_[_0x4836('0x11')](this[_0x4836('0xb')],'id');this[_0x4836('0xc')][_0x4836('0x10')]=_0x2d3bc2;};WhatsappQueue[_0x4836('0xf')][_0x4836('0x12')]=function(){this['loggedIn']=0x0;this[_0x4836('0x13')]=0x0;for(var _0x22c0ec=0x0;_0x22c0ec=0x0?this[_0x4836('0x18')]:0x0;var _0x458450={'id':this['id'],'available':this[_0x4836('0x18')],'loggedIn':this[_0x4836('0x16')],'name':this['name'],'paused':this[_0x4836('0x13')],'waiting':this[_0x4836('0xd')]};var _0x1135a8=md5(JSON[_0x4836('0x19')](_0x458450));if(this[_0x4836('0x1')]!==_0x1135a8){this['md5']=_0x1135a8;io['to'](util[_0x4836('0x1a')]('whatsapp:queue:%s',_0x458450[_0x4836('0x7')]))[_0x4836('0x1b')](_0x4836('0x1c'),_0x458450);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0xec99=['paused','length','online','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr'];(function(_0x213c66,_0x23c926){var _0x298400=function(_0x5058f7){while(--_0x5058f7){_0x213c66['push'](_0x213c66['shift']());}};_0x298400(++_0x23c926);}(_0xec99,0x92));var _0x9ec9=function(_0x34c644,_0x4d7e72){_0x34c644=_0x34c644-0x0;var _0x3f005c=_0xec99[_0x34c644];return _0x3f005c;};'use strict';var _=require(_0x9ec9('0x0'));var md5=require('md5');var util=require(_0x9ec9('0x1'));var Redis=require(_0x9ec9('0x2'));var config=require(_0x9ec9('0x3'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9ec9('0x4'))(new Redis(config['redis']));function WhatsappQueue(_0x197e67){this['id']=_0x197e67['id']||0x0;this[_0x9ec9('0x5')]=_0x197e67[_0x9ec9('0x5')]||'';this['timeout']=_0x197e67[_0x9ec9('0x6')]||0xa;this['strategy']=_0x197e67['strategy']||_0x9ec9('0x7');this['Agents']=_0x197e67[_0x9ec9('0x8')];this[_0x9ec9('0x9')]={};this[_0x9ec9('0xa')]=0x0;this[_0x9ec9('0xb')]='';this[_0x9ec9('0xc')]();this[_0x9ec9('0xd')]();}WhatsappQueue[_0x9ec9('0xe')][_0x9ec9('0xc')]=function(){var _0x50f509=this['mapAgentsId'][_0x9ec9('0xf')];this['mapAgentsId']=_['map'](this[_0x9ec9('0x8')],'id');this['mapAgentsId']['_rr']=_0x50f509;};WhatsappQueue[_0x9ec9('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x9ec9('0x10')]=0x0;for(var _0x1ab215=0x0;_0x1ab215=0x0?this[_0x9ec9('0x15')]:0x0;var _0x42f2dd={'id':this['id'],'available':this[_0x9ec9('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x9ec9('0x10')],'waiting':this['waiting']};var _0x137fa3=md5(JSON[_0x9ec9('0x16')](_0x42f2dd));if(this[_0x9ec9('0xb')]!==_0x137fa3){this[_0x9ec9('0xb')]=_0x137fa3;io['to'](util[_0x9ec9('0x17')](_0x9ec9('0x18'),_0x42f2dd['name']))[_0x9ec9('0x19')]('whatsapp_queue:save',_0x42f2dd);}};module[_0x9ec9('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 50539d8..d425b07 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 460adcd..5b523c8 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 _0x7755=['update','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x1f6258,_0x230077){var _0xb96839=function(_0x90f896){while(--_0x90f896){_0x1f6258['push'](_0x1f6258['shift']());}};_0xb96839(++_0x230077);}(_0x7755,0xbc));var _0x5775=function(_0x3ed9ed,_0x5841b0){_0x3ed9ed=_0x3ed9ed-0x0;var _0x4e9106=_0x7755[_0x3ed9ed];return _0x4e9106;};'use strict';var client=require(_0x5775('0x0'));exports[_0x5775('0x1')]=function(_0x578438,_0x13d944){return client['Request']('UpdateChatInteraction',{'body':_0x13d944,'options':{'where':{'id':_0x578438}},'log':_0x5775('0x2')});};exports[_0x5775('0x3')]=function(_0x4f7dfa,_0x3fa229){return client[_0x5775('0x4')](_0x5775('0x5'),{'body':_0x3fa229,'options':{'where':{'id':_0x4f7dfa}},'log':_0x5775('0x6')});}; \ No newline at end of file +var _0x0706=['UpdateChatInteraction','updateChatInteraction','addTags','Request','addTagsToChatInteraction','../client','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0706,0xd7));var _0x6070=function(_0x221037,_0x22334b){_0x221037=_0x221037-0x0;var _0x1c6d48=_0x0706[_0x221037];return _0x1c6d48;};'use strict';var client=require(_0x6070('0x0'));exports[_0x6070('0x1')]=function(_0x3c9c67,_0x1dea34){return client['Request'](_0x6070('0x2'),{'body':_0x1dea34,'options':{'where':{'id':_0x3c9c67}},'log':_0x6070('0x3')});};exports[_0x6070('0x4')]=function(_0x2e9e53,_0x456bae){return client[_0x6070('0x5')]('AddTagsToChatInteraction',{'body':_0x456bae,'options':{'where':{'id':_0x2e9e53}},'log':_0x6070('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 4f8c4fe..88513a0 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 _0x690e=['Request','createChatMessage','../client','create'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x690e,0x6a));var _0xe690=function(_0x141f28,_0x32dad1){_0x141f28=_0x141f28-0x0;var _0x52b6a8=_0x690e[_0x141f28];return _0x52b6a8;};'use strict';var client=require(_0xe690('0x0'));exports[_0xe690('0x1')]=function(_0x14f6d9){return client[_0xe690('0x2')]('CreateChatMessage',{'body':_0x14f6d9,'log':_0xe690('0x3')});}; \ No newline at end of file +var _0x2f0e=['create','Request','CreateChatMessage','../client'];(function(_0x2d7547,_0x489b30){var _0xb32a84=function(_0x1dd91a){while(--_0x1dd91a){_0x2d7547['push'](_0x2d7547['shift']());}};_0xb32a84(++_0x489b30);}(_0x2f0e,0x1df));var _0xe2f0=function(_0x2beb78,_0x262d91){_0x2beb78=_0x2beb78-0x0;var _0x355349=_0x2f0e[_0x2beb78];return _0x355349;};'use strict';var client=require(_0xe2f0('0x0'));exports[_0xe2f0('0x1')]=function(_0x33899c){return client[_0xe2f0('0x2')](_0xe2f0('0x3'),{'body':_0x33899c,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index ae84306..e3225dc 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 _0x28e3=['Request','GetChatQueue','timeout','strategy','User','Agents','name','online','chatPause','../client','getChatQueues'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0x28e3,0x106));var _0x328e=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x28e3[_0x21549c];return _0x426cbd;};'use strict';var client=require(_0x328e('0x0'));exports[_0x328e('0x1')]=function(){return function(){return client[_0x328e('0x2')](_0x328e('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x328e('0x4'),_0x328e('0x5')],'include':[{'model':_0x328e('0x6'),'as':_0x328e('0x7'),'attributes':['id',_0x328e('0x8'),_0x328e('0x9'),_0x328e('0xa')]}]},'log':_0x328e('0x1')});};}; \ No newline at end of file +var _0x48e3=['chatPause','../client','getChatQueues','GetChatQueue','strategy','User','Agents','name'];(function(_0x295898,_0x1c7f30){var _0x922943=function(_0x35cbe2){while(--_0x35cbe2){_0x295898['push'](_0x295898['shift']());}};_0x922943(++_0x1c7f30);}(_0x48e3,0xe9));var _0x348e=function(_0x5f0875,_0x3ea044){_0x5f0875=_0x5f0875-0x0;var _0x4ca3bb=_0x48e3[_0x5f0875];return _0x4ca3bb;};'use strict';var client=require(_0x348e('0x0'));exports[_0x348e('0x1')]=function(){return function(){return client['Request'](_0x348e('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x348e('0x3')],'include':[{'model':_0x348e('0x4'),'as':_0x348e('0x5'),'attributes':['id',_0x348e('0x6'),'online',_0x348e('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 18a83e3..c06d47f 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 _0xc99a=['Request','CreateChatQueueReport','UpdateChatQueueReport','DESC','../client','create'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xc99a,0x7c));var _0xac99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc99a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xac99('0x0'));exports[_0xac99('0x1')]=function(_0x29cba3){return client[_0xac99('0x2')](_0xac99('0x3'),{'body':_0x29cba3,'log':_0xac99('0x3')});};exports['update']=function(_0x363b15,_0x98e7e4){return client[_0xac99('0x2')](_0xac99('0x4'),{'body':_0x98e7e4,'options':{'where':{'uniqueid':_0x363b15},'order':[['id',_0xac99('0x5')]],'limit':0x1},'log':_0xac99('0x4')});}; \ No newline at end of file +var _0xbbfa=['Request','UpdateChatQueueReport','DESC','../client','CreateChatQueueReport','update'];(function(_0x53a315,_0x5d47da){var _0x1f7d52=function(_0x19b32a){while(--_0x19b32a){_0x53a315['push'](_0x53a315['shift']());}};_0x1f7d52(++_0x5d47da);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x7488c6,_0x1b2889){_0x7488c6=_0x7488c6-0x0;var _0x50fafa=_0xbbfa[_0x7488c6];return _0x50fafa;};'use strict';var client=require(_0xabbf('0x0'));exports['create']=function(_0x358e7b){return client['Request'](_0xabbf('0x1'),{'body':_0x358e7b,'log':_0xabbf('0x1')});};exports[_0xabbf('0x2')]=function(_0x1b0dee,_0x30da1f){return client[_0xabbf('0x3')](_0xabbf('0x4'),{'body':_0x30da1f,'options':{'where':{'uniqueid':_0x1b0dee},'order':[['id',_0xabbf('0x5')]],'limit':0x1},'log':_0xabbf('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 1c0a62c..8a68af2 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(_0xb0fe92,_0x147e42){var _0x41787f=function(_0x42ae35){while(--_0x42ae35){_0xb0fe92['push'](_0xb0fe92['shift']());}};_0x41787f(++_0x147e42);}(_0x7a54,0x106));var _0x47a5=function(_0x322c60,_0x20e71a){_0x322c60=_0x322c60-0x0;var _0x230d3d=_0x7a54[_0x322c60];return _0x230d3d;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x4b8f58,_0x2443ad){var _0x34802a=function(_0x424f14){while(--_0x424f14){_0x4b8f58['push'](_0x4b8f58['shift']());}};_0x34802a(++_0x2443ad);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 4db9f61..3054d92 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 _0x530c=['create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x5739ae,_0x11e5bb){var _0x58a4e9=function(_0x53a716){while(--_0x53a716){_0x5739ae['push'](_0x5739ae['shift']());}};_0x58a4e9(++_0x11e5bb);}(_0x530c,0xe4));var _0xc530=function(_0x1fd450,_0x42cbf6){_0x1fd450=_0x1fd450-0x0;var _0x4cb0a5=_0x530c[_0x1fd450];return _0x4cb0a5;};'use strict';var client=require('../client');exports[_0xc530('0x0')]=function(_0x3db19d){return client[_0xc530('0x1')](_0xc530('0x2'),{'body':_0x3db19d,'log':_0xc530('0x3')});}; \ No newline at end of file +var _0x91e4=['create','CreateFaxMessage','createFaxMessage','../client'];(function(_0x1ce1e5,_0x245834){var _0x2ff5e8=function(_0x228d2e){while(--_0x228d2e){_0x1ce1e5['push'](_0x1ce1e5['shift']());}};_0x2ff5e8(++_0x245834);}(_0x91e4,0x9b));var _0x491e=function(_0x490a85,_0x233019){_0x490a85=_0x490a85-0x0;var _0x27f8f4=_0x91e4[_0x490a85];return _0x27f8f4;};'use strict';var client=require(_0x491e('0x0'));exports[_0x491e('0x1')]=function(_0x2244ba){return client['Request'](_0x491e('0x2'),{'body':_0x2244ba,'log':_0x491e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d262001..2d0284f 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 _0x68c7=['Agents','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','User'];(function(_0x5df165,_0x2198bd){var _0x14d0b2=function(_0x563475){while(--_0x563475){_0x5df165['push'](_0x5df165['shift']());}};_0x14d0b2(++_0x2198bd);}(_0x68c7,0x1df));var _0x768c=function(_0x2aeb6b,_0x2430b9){_0x2aeb6b=_0x2aeb6b-0x0;var _0x5dfc60=_0x68c7[_0x2aeb6b];return _0x5dfc60;};'use strict';var client=require(_0x768c('0x0'));exports[_0x768c('0x1')]=function(){return function(){return client[_0x768c('0x2')](_0x768c('0x3'),{'options':{'raw':![],'attributes':['id',_0x768c('0x4'),_0x768c('0x5'),'strategy'],'include':[{'model':_0x768c('0x6'),'as':_0x768c('0x7'),'attributes':['id',_0x768c('0x4'),'online',_0x768c('0x8')]}]},'log':_0x768c('0x1')});};}; \ No newline at end of file +var _0xd795=['strategy','User','Agents','online','../client','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x347392,_0x1cfe36){var _0x33af38=function(_0x49a6cd){while(--_0x49a6cd){_0x347392['push'](_0x347392['shift']());}};_0x33af38(++_0x1cfe36);}(_0xd795,0xfe));var _0x5d79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd795[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x5d79('0x0'));exports[_0x5d79('0x1')]=function(){return function(){return client[_0x5d79('0x2')](_0x5d79('0x3'),{'options':{'raw':![],'attributes':['id',_0x5d79('0x4'),_0x5d79('0x5'),_0x5d79('0x6')],'include':[{'model':_0x5d79('0x7'),'as':_0x5d79('0x8'),'attributes':['id','name',_0x5d79('0x9'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index d2dc270..e1026f7 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 _0x24fb=['create','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport'];(function(_0x5c96d6,_0x48df56){var _0x3619eb=function(_0x2a11e6){while(--_0x2a11e6){_0x5c96d6['push'](_0x5c96d6['shift']());}};_0x3619eb(++_0x48df56);}(_0x24fb,0x145));var _0xb24f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x24fb[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports[_0xb24f('0x0')]=function(_0x50a19a){return client['Request'](_0xb24f('0x1'),{'body':_0x50a19a,'log':_0xb24f('0x1')});};exports[_0xb24f('0x2')]=function(_0x17d0ca,_0x3610e4){return client['Request']('UpdateFaxQueueReport',{'body':_0x3610e4,'options':{'where':{'uniqueid':_0x17d0ca},'order':[['id',_0xb24f('0x3')]],'limit':0x1},'log':_0xb24f('0x4')});}; \ No newline at end of file +var _0x9588=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','create'];(function(_0x4a82b0,_0x20545e){var _0x1e4535=function(_0x596dfd){while(--_0x596dfd){_0x4a82b0['push'](_0x4a82b0['shift']());}};_0x1e4535(++_0x20545e);}(_0x9588,0x15b));var _0x8958=function(_0x36d11c,_0x6dffa7){_0x36d11c=_0x36d11c-0x0;var _0xd95b50=_0x9588[_0x36d11c];return _0xd95b50;};'use strict';var client=require('../client');exports[_0x8958('0x0')]=function(_0x2ce41b){return client[_0x8958('0x1')](_0x8958('0x2'),{'body':_0x2ce41b,'log':_0x8958('0x2')});};exports[_0x8958('0x3')]=function(_0x30a0c8,_0x44253a){return client[_0x8958('0x1')](_0x8958('0x4'),{'body':_0x44253a,'options':{'where':{'uniqueid':_0x30a0c8},'order':[['id',_0x8958('0x5')]],'limit':0x1},'log':_0x8958('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index ced6760..442cc39 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 _0xc1a6=['name','interval','../client','getIntervals','Request','Intervals'];(function(_0xa5352,_0x3cabf8){var _0x2b55cb=function(_0x293555){while(--_0x293555){_0xa5352['push'](_0xa5352['shift']());}};_0x2b55cb(++_0x3cabf8);}(_0xc1a6,0x110));var _0x6c1a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xc1a6[_0x138adb];return _0x1b27f2;};'use strict';var client=require(_0x6c1a('0x0'));exports[_0x6c1a('0x1')]=function(){return function(){return client[_0x6c1a('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x6c1a('0x3'),'attributes':['id',_0x6c1a('0x4'),_0x6c1a('0x5')]}]},'log':_0x6c1a('0x1')});};}; \ No newline at end of file +var _0x86e3=['Request','GetInterval','name','Intervals','interval','getIntervals'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x86e3,0x101));var _0x386e=function(_0x265c81,_0x4d539a){_0x265c81=_0x265c81-0x0;var _0x3e63d1=_0x86e3[_0x265c81];return _0x3e63d1;};'use strict';var client=require('../client');exports[_0x386e('0x0')]=function(){return function(){return client[_0x386e('0x1')](_0x386e('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x386e('0x3')],'include':[{'model':'Interval','as':_0x386e('0x4'),'attributes':['id','name',_0x386e('0x5')]}]},'log':_0x386e('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 13b48a4..5c00b44 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 _0x7916=['Request','addTagsToChatInteraction','../client','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x5267d4,_0x45402d){var _0x248b43=function(_0x31e10e){while(--_0x31e10e){_0x5267d4['push'](_0x5267d4['shift']());}};_0x248b43(++_0x45402d);}(_0x7916,0x128));var _0x6791=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0x7916[_0x11e03f];return _0x5666fe;};'use strict';var client=require(_0x6791('0x0'));exports['update']=function(_0xeb0b9f,_0xdaaf2b){return client['Request'](_0x6791('0x1'),{'body':_0xdaaf2b,'options':{'where':{'id':_0xeb0b9f}},'log':_0x6791('0x2')});};exports[_0x6791('0x3')]=function(_0x330476,_0x5e6303){return client[_0x6791('0x4')]('AddTagsToMailInteraction',{'body':_0x5e6303,'options':{'where':{'id':_0x330476}},'log':_0x6791('0x5')});}; \ No newline at end of file +var _0xdb28=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x127db5,_0x3649a8){var _0x5ab2a6=function(_0x3e892a){while(--_0x3e892a){_0x127db5['push'](_0x127db5['shift']());}};_0x5ab2a6(++_0x3649a8);}(_0xdb28,0x106));var _0x8db2=function(_0x57716c,_0x468f64){_0x57716c=_0x57716c-0x0;var _0x10c8a8=_0xdb28[_0x57716c];return _0x10c8a8;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(_0x1dc797,_0xf66e59){return client['Request'](_0x8db2('0x2'),{'body':_0xf66e59,'options':{'where':{'id':_0x1dc797}},'log':_0x8db2('0x3')});};exports[_0x8db2('0x4')]=function(_0x4426fe,_0x11109e){return client['Request'](_0x8db2('0x5'),{'body':_0x11109e,'options':{'where':{'id':_0x4426fe}},'log':_0x8db2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 1050ec1..c8c6745 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 _0x0569=['../client','create','Request'];(function(_0x4f58fb,_0xb12d53){var _0x59cf8f=function(_0x497874){while(--_0x497874){_0x4f58fb['push'](_0x4f58fb['shift']());}};_0x59cf8f(++_0xb12d53);}(_0x0569,0x11d));var _0x9056=function(_0x22cb5f,_0x2cdd63){_0x22cb5f=_0x22cb5f-0x0;var _0x274d36=_0x0569[_0x22cb5f];return _0x274d36;};'use strict';var client=require(_0x9056('0x0'));exports[_0x9056('0x1')]=function(_0x2419a6){return client[_0x9056('0x2')]('CreateMailMessage',{'body':_0x2419a6,'log':'createMailMessage'});}; \ No newline at end of file +var _0xc19d=['CreateMailMessage','../client','create','Request'];(function(_0x213ba,_0x2427e0){var _0x3598e7=function(_0x45fa9e){while(--_0x45fa9e){_0x213ba['push'](_0x213ba['shift']());}};_0x3598e7(++_0x2427e0);}(_0xc19d,0x1b5));var _0xdc19=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0xc19d[_0x2842b4];return _0x2b9521;};'use strict';var client=require(_0xdc19('0x0'));exports[_0xdc19('0x1')]=function(_0x47c4b6){return client[_0xdc19('0x2')](_0xdc19('0x3'),{'body':_0x47c4b6,'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 f1939ec..4678fb2 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 _0xc137=['getMailQueues','Request','GetMailQueue','name','timeout','online','mailPause','../client'];(function(_0x456b57,_0x58691a){var _0x18f49f=function(_0x1dc195){while(--_0x1dc195){_0x456b57['push'](_0x456b57['shift']());}};_0x18f49f(++_0x58691a);}(_0xc137,0xff));var _0x7c13=function(_0x2a3990,_0xd4355c){_0x2a3990=_0x2a3990-0x0;var _0x32d362=_0xc137[_0x2a3990];return _0x32d362;};'use strict';var client=require(_0x7c13('0x0'));exports[_0x7c13('0x1')]=function(){return function(){return client[_0x7c13('0x2')](_0x7c13('0x3'),{'options':{'raw':![],'attributes':['id',_0x7c13('0x4'),_0x7c13('0x5'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x7c13('0x4'),_0x7c13('0x6'),_0x7c13('0x7')]}]},'log':_0x7c13('0x1')});};}; \ No newline at end of file +var _0x0c44=['online','mailPause','../client','getMailQueues','GetMailQueue','name','timeout','strategy','Agents'];(function(_0x51d3ac,_0x2cdcfc){var _0x29b333=function(_0xd4e32){while(--_0xd4e32){_0x51d3ac['push'](_0x51d3ac['shift']());}};_0x29b333(++_0x2cdcfc);}(_0x0c44,0xb6));var _0x40c4=function(_0x50204c,_0x194281){_0x50204c=_0x50204c-0x0;var _0x1d5fee=_0x0c44[_0x50204c];return _0x1d5fee;};'use strict';var client=require(_0x40c4('0x0'));exports[_0x40c4('0x1')]=function(){return function(){return client['Request'](_0x40c4('0x2'),{'options':{'raw':![],'attributes':['id',_0x40c4('0x3'),_0x40c4('0x4'),_0x40c4('0x5')],'include':[{'model':'User','as':_0x40c4('0x6'),'attributes':['id','name',_0x40c4('0x7'),_0x40c4('0x8')]}]},'log':_0x40c4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 17c746e..0838cea 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 _0x87b6=['DESC','../client','create','CreateMailQueueReport','update','Request','UpdateMailQueueReport'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x87b6,0xcc));var _0x687b=function(_0x3c5a79,_0x565097){_0x3c5a79=_0x3c5a79-0x0;var _0x52835f=_0x87b6[_0x3c5a79];return _0x52835f;};'use strict';var client=require(_0x687b('0x0'));exports[_0x687b('0x1')]=function(_0x3e7f60){return client['Request'](_0x687b('0x2'),{'body':_0x3e7f60,'log':_0x687b('0x2')});};exports[_0x687b('0x3')]=function(_0x212026,_0x245233){return client[_0x687b('0x4')](_0x687b('0x5'),{'body':_0x245233,'options':{'where':{'uniqueid':_0x212026},'order':[['id',_0x687b('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x8b29=['Request','CreateMailQueueReport','DESC','UpdateMailQueueReport','../client','create'];(function(_0x40d20a,_0x3141de){var _0x4bd1fc=function(_0x17ab2a){while(--_0x17ab2a){_0x40d20a['push'](_0x40d20a['shift']());}};_0x4bd1fc(++_0x3141de);}(_0x8b29,0x1a8));var _0x98b2=function(_0x5114a8,_0x29c874){_0x5114a8=_0x5114a8-0x0;var _0x5726dd=_0x8b29[_0x5114a8];return _0x5726dd;};'use strict';var client=require(_0x98b2('0x0'));exports[_0x98b2('0x1')]=function(_0x17b7eb){return client[_0x98b2('0x2')](_0x98b2('0x3'),{'body':_0x17b7eb,'log':'CreateMailQueueReport'});};exports['update']=function(_0x2f5965,_0x19686f){return client[_0x98b2('0x2')]('UpdateMailQueueReport',{'body':_0x19686f,'options':{'where':{'uniqueid':_0x2f5965},'order':[['id',_0x98b2('0x4')]],'limit':0x1},'log':_0x98b2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 5840253..2f10ec3 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 _0x72e2=['AddTagsToOpenchannelInteraction','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x350376,_0x47cd29){var _0x49dc4a=function(_0x486292){while(--_0x486292){_0x350376['push'](_0x350376['shift']());}};_0x49dc4a(++_0x47cd29);}(_0x72e2,0x1dd));var _0x272e=function(_0x4df679,_0x297fdc){_0x4df679=_0x4df679-0x0;var _0xf4366=_0x72e2[_0x4df679];return _0xf4366;};'use strict';var client=require('../client');exports['update']=function(_0x531328,_0x489232){return client[_0x272e('0x0')](_0x272e('0x1'),{'body':_0x489232,'options':{'where':{'id':_0x531328}},'log':_0x272e('0x2')});};exports['addTags']=function(_0x57338f,_0x1b0061){return client['Request'](_0x272e('0x3'),{'body':_0x1b0061,'options':{'where':{'id':_0x57338f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xaf1c=['update','UpdateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xaf1c,0x164));var _0xcaf1=function(_0x4a8baf,_0x24888b){_0x4a8baf=_0x4a8baf-0x0;var _0x441eb9=_0xaf1c[_0x4a8baf];return _0x441eb9;};'use strict';var client=require(_0xcaf1('0x0'));exports[_0xcaf1('0x1')]=function(_0x594bb5,_0x10a10a){return client['Request'](_0xcaf1('0x2'),{'body':_0x10a10a,'options':{'where':{'id':_0x594bb5}},'log':'updateOpenchannelInteraction'});};exports[_0xcaf1('0x3')]=function(_0x1da0de,_0x5c2cce){return client[_0xcaf1('0x4')](_0xcaf1('0x5'),{'body':_0x5c2cce,'options':{'where':{'id':_0x1da0de}},'log':_0xcaf1('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 542709c..4712d84 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 _0x9b8e=['CreateOpenchannelMessage','createOpenchannelMessage','Request'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9b8e,0x113));var _0xe9b8=function(_0x1a3f66,_0x76e456){_0x1a3f66=_0x1a3f66-0x0;var _0x2b9114=_0x9b8e[_0x1a3f66];return _0x2b9114;};'use strict';var client=require('../client');exports['create']=function(_0x450040){return client[_0xe9b8('0x0')](_0xe9b8('0x1'),{'body':_0x450040,'log':_0xe9b8('0x2')});}; \ No newline at end of file +var _0xbe95=['create'];(function(_0x53ea22,_0xb35462){var _0x55393a=function(_0x2cc291){while(--_0x2cc291){_0x53ea22['push'](_0x53ea22['shift']());}};_0x55393a(++_0xb35462);}(_0xbe95,0x150));var _0x5be9=function(_0x272ace,_0x25afbb){_0x272ace=_0x272ace-0x0;var _0x478930=_0xbe95[_0x272ace];return _0x478930;};'use strict';var client=require('../client');exports[_0x5be9('0x0')]=function(_0xef68e9){return client['Request']('CreateOpenchannelMessage',{'body':_0xef68e9,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 36e3878..6fd663b 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 _0x7130=['name','online','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','timeout','strategy','User','Agents'];(function(_0x22086c,_0x5a1658){var _0x3b33f0=function(_0x104cd6){while(--_0x104cd6){_0x22086c['push'](_0x22086c['shift']());}};_0x3b33f0(++_0x5a1658);}(_0x7130,0x14e));var _0x0713=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x7130[_0x1deb03];return _0x189fe7;};'use strict';var client=require(_0x0713('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x0713('0x1')](_0x0713('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0713('0x3'),_0x0713('0x4')],'include':[{'model':_0x0713('0x5'),'as':_0x0713('0x6'),'attributes':['id',_0x0713('0x7'),_0x0713('0x8'),_0x0713('0x9')]}]},'log':_0x0713('0xa')});};}; \ No newline at end of file +var _0x39e0=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','strategy','User','Agents','name'];(function(_0x34f553,_0x5885f0){var _0x271bf2=function(_0x481545){while(--_0x481545){_0x34f553['push'](_0x34f553['shift']());}};_0x271bf2(++_0x5885f0);}(_0x39e0,0x190));var _0x039e=function(_0x1f003f,_0x5417d6){_0x1f003f=_0x1f003f-0x0;var _0x2ef5e5=_0x39e0[_0x1f003f];return _0x2ef5e5;};'use strict';var client=require(_0x039e('0x0'));exports[_0x039e('0x1')]=function(){return function(){return client[_0x039e('0x2')](_0x039e('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x039e('0x4')],'include':[{'model':_0x039e('0x5'),'as':_0x039e('0x6'),'attributes':['id',_0x039e('0x7'),'online','openchannelPause']}]},'log':_0x039e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 8343b93..364d379 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 _0xeb34=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x534c77,_0x51e75b){var _0x2ccb6f=function(_0x40f213){while(--_0x40f213){_0x534c77['push'](_0x534c77['shift']());}};_0x2ccb6f(++_0x51e75b);}(_0xeb34,0xc9));var _0x4eb3=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xeb34[_0x47aa64];return _0x549c7a;};'use strict';var client=require(_0x4eb3('0x0'));exports[_0x4eb3('0x1')]=function(_0x4f434d){return client[_0x4eb3('0x2')](_0x4eb3('0x3'),{'body':_0x4f434d,'log':'CreateOpenchannelQueueReport'});};exports[_0x4eb3('0x4')]=function(_0x277a0b,_0x59a3da){return client[_0x4eb3('0x2')](_0x4eb3('0x5'),{'body':_0x59a3da,'options':{'where':{'uniqueid':_0x277a0b},'order':[['id',_0x4eb3('0x6')]],'limit':0x1},'log':_0x4eb3('0x5')});}; \ No newline at end of file +var _0x8029=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x19f771,_0x582f9a){var _0x3f6e51=function(_0x92a42f){while(--_0x92a42f){_0x19f771['push'](_0x19f771['shift']());}};_0x3f6e51(++_0x582f9a);}(_0x8029,0xf8));var _0x9802=function(_0x2515fd,_0x870c83){_0x2515fd=_0x2515fd-0x0;var _0x12df65=_0x8029[_0x2515fd];return _0x12df65;};'use strict';var client=require(_0x9802('0x0'));exports[_0x9802('0x1')]=function(_0x4fc91f){return client[_0x9802('0x2')](_0x9802('0x3'),{'body':_0x4fc91f,'log':_0x9802('0x3')});};exports[_0x9802('0x4')]=function(_0x4def7c,_0x55ab08){return client[_0x9802('0x2')](_0x9802('0x5'),{'body':_0x55ab08,'options':{'where':{'uniqueid':_0x4def7c},'order':[['id',_0x9802('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index a6c8d4a..cabb972 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 _0x6631=['../client','update','Request','UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x210737,_0x28ffd3){var _0x3c02c4=function(_0x40412b){while(--_0x40412b){_0x210737['push'](_0x210737['shift']());}};_0x3c02c4(++_0x28ffd3);}(_0x6631,0x134));var _0x1663=function(_0x162051,_0x54e5eb){_0x162051=_0x162051-0x0;var _0x4ed7e7=_0x6631[_0x162051];return _0x4ed7e7;};'use strict';var client=require(_0x1663('0x0'));exports[_0x1663('0x1')]=function(_0x3a71ee,_0x8a1e8e){return client[_0x1663('0x2')](_0x1663('0x3'),{'body':_0x8a1e8e,'options':{'where':{'id':_0x3a71ee}},'log':'updateSmsInteraction'});};exports[_0x1663('0x4')]=function(_0x1e2fcc,_0x232bfe){return client[_0x1663('0x2')](_0x1663('0x5'),{'body':_0x232bfe,'options':{'where':{'id':_0x1e2fcc}},'log':_0x1663('0x6')});}; \ No newline at end of file +var _0x61a1=['addTagsToSmsInteraction','../client','update','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61a1,0x127));var _0x161a=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0x61a1[_0x3a8db5];return _0x2c03cd;};'use strict';var client=require(_0x161a('0x0'));exports[_0x161a('0x1')]=function(_0x1befc0,_0x1824bc){return client[_0x161a('0x2')]('UpdateSmsInteraction',{'body':_0x1824bc,'options':{'where':{'id':_0x1befc0}},'log':_0x161a('0x3')});};exports[_0x161a('0x4')]=function(_0x52aadb,_0x1775e8){return client[_0x161a('0x2')](_0x161a('0x5'),{'body':_0x1775e8,'options':{'where':{'id':_0x52aadb}},'log':_0x161a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index daec525..56ee3db 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 _0xf4b4=['Request','createSmsMessage','../client','create'];(function(_0x4c55a9,_0x8a1a30){var _0x2d331e=function(_0xf5db3f){while(--_0xf5db3f){_0x4c55a9['push'](_0x4c55a9['shift']());}};_0x2d331e(++_0x8a1a30);}(_0xf4b4,0x1ca));var _0x4f4b=function(_0x53b22e,_0x5e248f){_0x53b22e=_0x53b22e-0x0;var _0x14a0a4=_0xf4b4[_0x53b22e];return _0x14a0a4;};'use strict';var client=require(_0x4f4b('0x0'));exports[_0x4f4b('0x1')]=function(_0x1ed59c){return client[_0x4f4b('0x2')]('CreateSmsMessage',{'body':_0x1ed59c,'log':_0x4f4b('0x3')});}; \ No newline at end of file +var _0x0dbd=['../client','Request'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0x0dbd,0x96));var _0xd0db=function(_0x405081,_0x546d14){_0x405081=_0x405081-0x0;var _0x370f69=_0x0dbd[_0x405081];return _0x370f69;};'use strict';var client=require(_0xd0db('0x0'));exports['create']=function(_0xe96dd1){return client[_0xd0db('0x1')]('CreateSmsMessage',{'body':_0xe96dd1,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index b59696f..4bdb938 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x2c753c,_0x3378e7){var _0x23ba20=function(_0xac82d){while(--_0xac82d){_0x2c753c['push'](_0x2c753c['shift']());}};_0x23ba20(++_0x3378e7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x43e204,_0x4d02ca){var _0x876b9=function(_0x771a0b){while(--_0x771a0b){_0x43e204['push'](_0x43e204['shift']());}};_0x876b9(++_0x4d02ca);}(_0x70e0,0x17b));var _0x070e=function(_0x54ca52,_0x197f05){_0x54ca52=_0x54ca52-0x0;var _0x22f708=_0x70e0[_0x54ca52];return _0x22f708;};'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 diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 633cd62..0159c1e 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 _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x3fe966,_0x552df7){var _0x139983=function(_0x29758e){while(--_0x29758e){_0x3fe966['push'](_0x3fe966['shift']());}};_0x139983(++_0x552df7);}(_0x008c,0x188));var _0xc008=function(_0x101237,_0x448f24){_0x101237=_0x101237-0x0;var _0x50ede4=_0x008c[_0x101237];return _0x50ede4;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0xbc9eb8,_0x553727){var _0x5e4e6c=function(_0x741f5d){while(--_0x741f5d){_0xbc9eb8['push'](_0xbc9eb8['shift']());}};_0x5e4e6c(++_0x553727);}(_0x55ca,0x126));var _0xa55c=function(_0x5f3cab,_0x1b523d){_0x5f3cab=_0x5f3cab-0x0;var _0x2db243=_0x55ca[_0x5f3cab];return _0x2db243;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 261a365..7585982 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(_0x447c22,_0x822fba){var _0x1bed5a=function(_0x359e0d){while(--_0x359e0d){_0x447c22['push'](_0x447c22['shift']());}};_0x1bed5a(++_0x822fba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x4578bb,_0x540c03){var _0xb3a076=function(_0x41f387){while(--_0x41f387){_0x4578bb['push'](_0x4578bb['shift']());}};_0xb3a076(++_0x540c03);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 a6bc729..2bf362b 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 _0xdc59=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x528575,_0x2e067d){var _0x3063b7=function(_0x1ee183){while(--_0x1ee183){_0x528575['push'](_0x528575['shift']());}};_0x3063b7(++_0x2e067d);}(_0xdc59,0x12c));var _0x9dc5=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xdc59[_0x35da42];return _0x370035;};'use strict';var client=require(_0x9dc5('0x0'));exports[_0x9dc5('0x1')]=function(_0x13dd7b,_0x505d14){return client['Request'](_0x9dc5('0x2'),{'body':_0x505d14,'options':{'where':{'id':_0x13dd7b}},'log':_0x9dc5('0x3')});};exports[_0x9dc5('0x4')]=function(_0x364b77,_0x21211a){return client[_0x9dc5('0x5')](_0x9dc5('0x6'),{'body':_0x21211a,'options':{'where':{'id':_0x364b77}},'log':_0x9dc5('0x7')});}; \ No newline at end of file +var _0x2a07=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0x2a07,0x74));var _0x72a0=function(_0x1598e8,_0x5df7a7){_0x1598e8=_0x1598e8-0x0;var _0x1f71da=_0x2a07[_0x1598e8];return _0x1f71da;};'use strict';var client=require(_0x72a0('0x0'));exports[_0x72a0('0x1')]=function(_0x3ed8a9,_0x437db4){return client[_0x72a0('0x2')]('UpdateWhatsappInteraction',{'body':_0x437db4,'options':{'where':{'id':_0x3ed8a9}},'log':_0x72a0('0x3')});};exports[_0x72a0('0x4')]=function(_0x135982,_0x45b155){return client[_0x72a0('0x2')](_0x72a0('0x5'),{'body':_0x45b155,'options':{'where':{'id':_0x135982}},'log':_0x72a0('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 9b0c4dc..758ebe6 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 _0x1f93=['createWhatsappMessage','../client','create','CreateWhatsappMessage'];(function(_0x2af05b,_0x519863){var _0x15b45e=function(_0x2efeef){while(--_0x2efeef){_0x2af05b['push'](_0x2af05b['shift']());}};_0x15b45e(++_0x519863);}(_0x1f93,0x1dd));var _0x31f9=function(_0x10d65c,_0x1aec47){_0x10d65c=_0x10d65c-0x0;var _0x5d29fd=_0x1f93[_0x10d65c];return _0x5d29fd;};'use strict';var client=require(_0x31f9('0x0'));exports[_0x31f9('0x1')]=function(_0x9c5550){return client['Request'](_0x31f9('0x2'),{'body':_0x9c5550,'log':_0x31f9('0x3')});}; \ No newline at end of file +var _0x306a=['CreateWhatsappMessage','../client','Request'];(function(_0x5dbb84,_0x1bbce9){var _0x1d6eae=function(_0xd93967){while(--_0xd93967){_0x5dbb84['push'](_0x5dbb84['shift']());}};_0x1d6eae(++_0x1bbce9);}(_0x306a,0x193));var _0xa306=function(_0x4bf3f9,_0x459195){_0x4bf3f9=_0x4bf3f9-0x0;var _0x7bd6fc=_0x306a[_0x4bf3f9];return _0x7bd6fc;};'use strict';var client=require(_0xa306('0x0'));exports['create']=function(_0x4aeabd){return client[_0xa306('0x1')](_0xa306('0x2'),{'body':_0x4aeabd,'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 6313e3f..25a7d7b 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 _0x5c16=['User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0x5c16,0x190));var _0x65c1=function(_0x4f37e4,_0x49a3f7){_0x4f37e4=_0x4f37e4-0x0;var _0x545f5e=_0x5c16[_0x4f37e4];return _0x545f5e;};'use strict';var client=require(_0x65c1('0x0'));exports[_0x65c1('0x1')]=function(){return function(){return client[_0x65c1('0x2')](_0x65c1('0x3'),{'options':{'raw':![],'attributes':['id',_0x65c1('0x4'),_0x65c1('0x5'),_0x65c1('0x6')],'include':[{'model':_0x65c1('0x7'),'as':_0x65c1('0x8'),'attributes':['id',_0x65c1('0x4'),_0x65c1('0x9'),_0x65c1('0xa')]}]},'log':_0x65c1('0x1')});};}; \ No newline at end of file +var _0x1260=['whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','strategy','User','Agents'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x1260,0x1b9));var _0x0126=function(_0x2774b2,_0x19344e){_0x2774b2=_0x2774b2-0x0;var _0x3a98c9=_0x1260[_0x2774b2];return _0x3a98c9;};'use strict';var client=require(_0x0126('0x0'));exports[_0x0126('0x1')]=function(){return function(){return client[_0x0126('0x2')](_0x0126('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x0126('0x4')],'include':[{'model':_0x0126('0x5'),'as':_0x0126('0x6'),'attributes':['id','name','online',_0x0126('0x7')]}]},'log':_0x0126('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 0f4b06e..5718701 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 _0x9545=['update','UpdateWhatsappQueueReport','DESC','../client','Request','CreateWhatsappQueueReport'];(function(_0x53cc20,_0x34e01c){var _0x6d3765=function(_0x29da10){while(--_0x29da10){_0x53cc20['push'](_0x53cc20['shift']());}};_0x6d3765(++_0x34e01c);}(_0x9545,0x1ef));var _0x5954=function(_0x54bf67,_0x5381e5){_0x54bf67=_0x54bf67-0x0;var _0x5f18a9=_0x9545[_0x54bf67];return _0x5f18a9;};'use strict';var client=require(_0x5954('0x0'));exports['create']=function(_0x328fdf){return client[_0x5954('0x1')](_0x5954('0x2'),{'body':_0x328fdf,'log':_0x5954('0x2')});};exports[_0x5954('0x3')]=function(_0x2831e9,_0x539a9f){return client[_0x5954('0x1')](_0x5954('0x4'),{'body':_0x539a9f,'options':{'where':{'uniqueid':_0x2831e9},'order':[['id',_0x5954('0x5')]],'limit':0x1},'log':_0x5954('0x4')});}; \ No newline at end of file +var _0xebd8=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create','Request'];(function(_0x17e9fa,_0x266b4d){var _0x594f93=function(_0x40bcca){while(--_0x40bcca){_0x17e9fa['push'](_0x17e9fa['shift']());}};_0x594f93(++_0x266b4d);}(_0xebd8,0x13f));var _0x8ebd=function(_0x5897bc,_0x4857fd){_0x5897bc=_0x5897bc-0x0;var _0x38d2d0=_0xebd8[_0x5897bc];return _0x38d2d0;};'use strict';var client=require(_0x8ebd('0x0'));exports[_0x8ebd('0x1')]=function(_0x5143cf){return client[_0x8ebd('0x2')]('CreateWhatsappQueueReport',{'body':_0x5143cf,'log':_0x8ebd('0x3')});};exports[_0x8ebd('0x4')]=function(_0x2f4499,_0x3faa23){return client[_0x8ebd('0x2')](_0x8ebd('0x5'),{'body':_0x3faa23,'options':{'where':{'uniqueid':_0x2f4499},'order':[['id',_0x8ebd('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index f348747..1c62f19 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 _0x15c6=['error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END','next'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x15c6,0x1cd));var _0x615c=function(_0x2a1e2d,_0x195473){_0x2a1e2d=_0x2a1e2d-0x0;var _0x32b8cc=_0x15c6[_0x2a1e2d];return _0x32b8cc;};'use strict';var schema=require(_0x615c('0x0'));var _=require(_0x615c('0x1'));var util=require(_0x615c('0x2'));var seqqueue=require(_0x615c('0x3'));var logger=require(_0x615c('0x4'))('routing');var strategy=require(_0x615c('0x5'));var queue=schema({'name':{'type':_0x615c('0x6'),'required':!![],'message':_0x615c('0x7')},'timeout':{'type':_0x615c('0x8'),'message':_0x615c('0x9')}});function writeLog(_0x2690af,_0x16d743,_0x5bc629){return logger[_0x615c('0xa')](util[_0x615c('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x2690af,_0x16d743['name'],_0x5bc629));}function handleFindAgent(_0x2e6fdd){return function(_0x386dd1){return _0x386dd1[_0x615c('0xc')]['toLowerCase']()===_0x2e6fdd[_0x615c('0xd')]();};}exports[_0x615c('0xe')]=function(_0x3b0bf2,_0x143819,_0x1a4a27,_0x5f4851){return function(_0x2872c7){try{var _0x403db5={'name':_0x143819[0x0],'timeout':_0x143819[0x1]};var _0x32ea7e=queue['validate'](_0x403db5,{'typecast':!![]});if(_0x32ea7e[_0x615c('0xf')]){logger['error'](_0x615c('0x10'),_0x3b0bf2,_[_0x615c('0x11')](_0x32ea7e,'message')[_0x615c('0x12')](',\x20'));_0x2872c7[_0x615c('0x13')]();}else{var _0x3fb68a=_[_0x615c('0x14')](_0x1a4a27[_0x615c('0x15')],handleFindAgent(_0x403db5[_0x615c('0xc')]));if(_0x3fb68a){var _0x3ceda4=(_0x403db5[_0x615c('0x16')]||0xa)*0x3e8;var _0x2520d5,_0x13dfd0;var _0x528716=seqqueue[_0x615c('0x17')](_0x3ceda4);_0x528716['id']=_0x3b0bf2;_0x528716[_0x615c('0x18')]=_0x3ceda4;_0x528716['channel']=_0x5f4851[_0x615c('0x19')];writeLog(_0x3b0bf2,_0x3fb68a,util[_0x615c('0xb')](_0x615c('0x1a'),_0x3ceda4));_0x1a4a27[_0x615c('0x1b')][_0x3b0bf2]['on'](_0x615c('0x1c'),function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x3b0bf2);clearTimeout(_0x13dfd0);_0x13dfd0=undefined;_0x528716[_0x615c('0x1d')]();if(_0x1a4a27[_0x615c('0x1b')][_0x3b0bf2]){delete _0x1a4a27[_0x615c('0x1b')][_0x3b0bf2];}_0x2872c7[_0x615c('0x13')]();});_0x1a4a27[_0x615c('0x1b')][_0x3b0bf2]['on'](_0x615c('0x1e'),function(){if(_0x1a4a27['rules'][_0x3b0bf2]){delete _0x1a4a27[_0x615c('0x1b')][_0x3b0bf2];}});_0x13dfd0=setTimeout(function(){logger[_0x615c('0xa')](_0x615c('0x1f'),_0x3b0bf2);clearTimeout(_0x13dfd0);_0x528716[_0x615c('0x1d')]();_0x2872c7[_0x615c('0x20')]();},_0x3ceda4);strategy['agent'](_0x528716,_0x3fb68a,_0x1a4a27,_0x5f4851);}else{logger[_0x615c('0x21')](_0x615c('0x22'),_0x3b0bf2,_0x403db5[_0x615c('0xc')]);_0x2872c7[_0x615c('0x13')]();}}}catch(_0x4d983c){console[_0x615c('0x23')](_0x4d983c);logger[_0x615c('0x21')](_0x615c('0x24'),_0x3b0bf2,_0x4d983c[_0x615c('0x25')]);_0x2872c7[_0x615c('0x13')]();}};}; \ No newline at end of file +var _0xed01=['util','seq-queue','../../../../config/logger','routing','./strategy','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','length','error','[%s][AGENT]\x20%s','message','join','find','agents','atimeout','channel','START:%s','rules','end','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][QUEUE]\x20%s','validate','lodash'];(function(_0x5d76db,_0x590f2d){var _0x66bc23=function(_0x4ef4fd){while(--_0x4ef4fd){_0x5d76db['push'](_0x5d76db['shift']());}};_0x66bc23(++_0x590f2d);}(_0xed01,0x11e));var _0x1ed0=function(_0x3d5416,_0x28a599){_0x3d5416=_0x3d5416-0x0;var _0x17712c=_0xed01[_0x3d5416];return _0x17712c;};'use strict';var schema=require(_0x1ed0('0x0'));var _=require(_0x1ed0('0x1'));var util=require(_0x1ed0('0x2'));var seqqueue=require(_0x1ed0('0x3'));var logger=require(_0x1ed0('0x4'))(_0x1ed0('0x5'));var strategy=require(_0x1ed0('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x1ed0('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x3ae03d,_0x38c70f,_0x47ae10){return logger[_0x1ed0('0x8')](util[_0x1ed0('0x9')](_0x1ed0('0xa'),_0x3ae03d,_0x38c70f[_0x1ed0('0xb')],_0x47ae10));}function handleFindAgent(_0x252b4c){return function(_0x3233ac){return _0x3233ac[_0x1ed0('0xb')]['toLowerCase']()===_0x252b4c['toLowerCase']();};}exports[_0x1ed0('0xc')]=function(_0x4c06ec,_0x395e5f,_0x461adf,_0x321637){return function(_0x5ac8ab){try{var _0x2adbb8={'name':_0x395e5f[0x0],'timeout':_0x395e5f[0x1]};var _0xe3441a=queue[_0x1ed0('0x0')](_0x2adbb8,{'typecast':!![]});if(_0xe3441a[_0x1ed0('0xd')]){logger[_0x1ed0('0xe')](_0x1ed0('0xf'),_0x4c06ec,_['map'](_0xe3441a,_0x1ed0('0x10'))[_0x1ed0('0x11')](',\x20'));_0x5ac8ab['stop']();}else{var _0xdcd58e=_[_0x1ed0('0x12')](_0x461adf[_0x1ed0('0x13')],handleFindAgent(_0x2adbb8['name']));if(_0xdcd58e){var _0xb12c00=(_0x2adbb8['timeout']||0xa)*0x3e8;var _0x4bd330,_0xb9c572;var _0x3edb2d=seqqueue['createQueue'](_0xb12c00);_0x3edb2d['id']=_0x4c06ec;_0x3edb2d[_0x1ed0('0x14')]=_0xb12c00;_0x3edb2d[_0x1ed0('0x15')]=_0x321637[_0x1ed0('0x15')];writeLog(_0x4c06ec,_0xdcd58e,util[_0x1ed0('0x9')](_0x1ed0('0x16'),_0xb12c00));_0x461adf[_0x1ed0('0x17')][_0x4c06ec]['on'](_0x1ed0('0x18'),function(){logger[_0x1ed0('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x4c06ec);clearTimeout(_0xb9c572);_0xb9c572=undefined;_0x3edb2d[_0x1ed0('0x19')]();if(_0x461adf['rules'][_0x4c06ec]){delete _0x461adf[_0x1ed0('0x17')][_0x4c06ec];}_0x5ac8ab[_0x1ed0('0x1a')]();});_0x461adf[_0x1ed0('0x17')][_0x4c06ec]['on'](_0x1ed0('0x1b'),function(){if(_0x461adf[_0x1ed0('0x17')][_0x4c06ec]){delete _0x461adf[_0x1ed0('0x17')][_0x4c06ec];}});_0xb9c572=setTimeout(function(){logger[_0x1ed0('0x8')](_0x1ed0('0x1c'),_0x4c06ec);clearTimeout(_0xb9c572);_0x3edb2d[_0x1ed0('0x19')]();_0x5ac8ab[_0x1ed0('0x1d')]();},_0xb12c00);strategy[_0x1ed0('0x1e')](_0x3edb2d,_0xdcd58e,_0x461adf,_0x321637);}else{logger[_0x1ed0('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x4c06ec,_0x2adbb8[_0x1ed0('0xb')]);_0x5ac8ab[_0x1ed0('0x1a')]();}}}catch(_0x174cbe){console['log'](_0x174cbe);logger['error'](_0x1ed0('0x1f'),_0x4c06ec,_0x174cbe['stack']);_0x5ac8ab['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 7e0d547..5221d17 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 _0x2757=['body','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','error','amazonlex','providerName','Message','then','dialogState','catch','moment','aws-sdk','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','upperFirst','InteractionId','isEmpty','getMustacheRender','create','info','[%s][AMAZONLEX]\x20%s'];(function(_0xba83b1,_0x3f81d1){var _0x60e057=function(_0x3cd902){while(--_0x3cd902){_0xba83b1['push'](_0xba83b1['shift']());}};_0x60e057(++_0x3f81d1);}(_0x2757,0x9a));var _0x7275=function(_0x2e15fc,_0x29de75){_0x2e15fc=_0x2e15fc-0x0;var _0x5418fb=_0x2757[_0x2e15fc];return _0x5418fb;};'use strict';var _=require('lodash');var moment=require(_0x7275('0x0'));var AWS=require(_0x7275('0x1'));var utils=require('./utils');var logger=require(_0x7275('0x2'))(_0x7275('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7275('0x4')),'mailMessage':require(_0x7275('0x5')),'smsMessage':require(_0x7275('0x6')),'faxMessage':require(_0x7275('0x7')),'whatsappMessage':require(_0x7275('0x8'))};exports[_0x7275('0x9')]=function(_0x47948b,_0x2ef2e5){return function(_0x35b604){try{if(!_['isNil'](this[_0x7275('0xa')]['UserId'])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x47948b,_0x7275('0xb'));return _0x35b604[_0x7275('0xc')]();}var _0x80446d={'ContactId':this[_0x7275('0xd')]['id'],'sentAt':moment()[_0x7275('0xe')](_0x7275('0xf')),'direction':_0x7275('0x10')};if(this[_0x7275('0x11')]===_0x7275('0x12')||this[_0x7275('0x11')]===_0x7275('0x13')){_0x80446d[_0x7275('0x14')]=this[_0x7275('0xa')][_0x7275('0x14')];}var _0x169a01=this[_0x7275('0x11')];if(_0x169a01===_0x7275('0x15')){_0x80446d['ChatWebsiteId']=this[_0x7275('0x16')]['id'];}else{_0x80446d[_[_0x7275('0x17')](_0x169a01)+'AccountId']=this['account']['id'];}_0x80446d[_[_0x7275('0x17')](_0x169a01)+_0x7275('0x18')]=this['interaction']['id'];if(this[_0x7275('0xa')]['created']){var _0x49f5c6=_0x2ef2e5[0x4];if(!_[_0x7275('0x19')](_0x49f5c6)){_0x80446d['body']=utils[_0x7275('0x1a')](_0x49f5c6,this);return rpc[_0x169a01+'Message'][_0x7275('0x1b')](_0x80446d)['then'](function(_0x312c41){logger[_0x7275('0x1c')](_0x7275('0x1d'),_0x47948b,_0x80446d[_0x7275('0x1e')]);})['catch'](function(_0xf56e27){logger['error'](_0x7275('0x1d'),_0x47948b,JSON[_0x7275('0x1f')](_0xf56e27));})['finally'](function(){logger[_0x7275('0x1c')](_0x7275('0x20'),_0x47948b);_0x35b604[_0x7275('0x21')]();});}else{logger['info'](_0x7275('0x22'),_0x47948b);_0x35b604[_0x7275('0x21')]();}}else{var _0x4525f0=this;var _0x1c8e7a=new AWS[(_0x7275('0x23'))]({'accessKeyId':_0x2ef2e5[0x0],'secretAccessKey':_0x2ef2e5[0x1],'region':_0x2ef2e5[0x2]});var _0x15c34={'botAlias':'$LATEST','botName':_0x2ef2e5[0x3],'inputText':this[_0x7275('0x24')]['body'],'userId':this[_0x7275('0x11')]+':'+this[_0x7275('0xa')]['id'][_0x7275('0x25')]()};_0x1c8e7a[_0x7275('0x26')](_0x15c34,function(_0x36dfcf,_0x281706){if(_0x36dfcf){logger[_0x7275('0x27')]('[%s][AMAZONLEX]\x20%s',_0x47948b,_0x36dfcf['message']);_0x35b604[_0x7275('0xc')]();}else if(_0x281706&&_0x281706[_0x7275('0x24')]){_0x4525f0['body'][_0x7275('0x28')]=_0x281706;_0x80446d[_0x7275('0x1e')]=_0x281706[_0x7275('0x24')];_0x80446d[_0x7275('0x29')]='amazonlex';_0x80446d['providerResponse']=JSON[_0x7275('0x1f')](_0x281706);return rpc[_0x169a01+_0x7275('0x2a')][_0x7275('0x1b')](_0x80446d)[_0x7275('0x2b')](function(_0x2b63ee){logger[_0x7275('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x47948b,_0x80446d['body']);if(_0x281706[_0x7275('0x2c')]=='Failed'){_0x35b604[_0x7275('0xc')]();}else{_0x35b604[_0x7275('0x21')]();}})[_0x7275('0x2d')](function(_0xc557d8){logger[_0x7275('0x27')]('[%s][AMAZONLEX]\x20%s',_0x47948b,JSON[_0x7275('0x1f')](_0xc557d8));_0x35b604['next']();});}else{_0x35b604[_0x7275('0xc')]();}});}}catch(_0x246d4f){logger[_0x7275('0x27')](_0x7275('0x1d'),_0x47948b,JSON[_0x7275('0x1f')](_0x246d4f));_0x35b604[_0x7275('0x21')]();}};}; \ No newline at end of file +var _0xe642=['stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','toString','error','amazonlex','providerName','providerResponse','dialogState','Failed','catch','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','interaction','phone','chat','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then'];(function(_0x20a7da,_0x200463){var _0xd1597b=function(_0x223225){while(--_0x223225){_0x20a7da['push'](_0x20a7da['shift']());}};_0xd1597b(++_0x200463);}(_0xe642,0x6c));var _0x2e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe642[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2e64('0x0'));var moment=require('moment');var AWS=require(_0x2e64('0x1'));var utils=require(_0x2e64('0x2'));var logger=require(_0x2e64('0x3'))(_0x2e64('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2e64('0x5')),'mailMessage':require(_0x2e64('0x6')),'smsMessage':require(_0x2e64('0x7')),'faxMessage':require(_0x2e64('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x2e64('0x9')]=function(_0x4901b9,_0x97ade2){return function(_0x2ae144){try{if(!_[_0x2e64('0xa')](this['interaction'][_0x2e64('0xb')])){logger[_0x2e64('0xc')](_0x2e64('0xd'),_0x4901b9,_0x2e64('0xe'));return _0x2ae144[_0x2e64('0xf')]();}var _0x2aeabe={'ContactId':this[_0x2e64('0x10')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2e64('0x11')};if(this[_0x2e64('0x12')]==='sms'||this[_0x2e64('0x12')]==='whatsapp'){_0x2aeabe['phone']=this[_0x2e64('0x13')][_0x2e64('0x14')];}var _0x375a9c=this['channel'];if(_0x375a9c===_0x2e64('0x15')){_0x2aeabe['ChatWebsiteId']=this[_0x2e64('0x16')]['id'];}else{_0x2aeabe[_['upperFirst'](_0x375a9c)+_0x2e64('0x17')]=this[_0x2e64('0x16')]['id'];}_0x2aeabe[_[_0x2e64('0x18')](_0x375a9c)+_0x2e64('0x19')]=this[_0x2e64('0x13')]['id'];if(this['interaction'][_0x2e64('0x1a')]){var _0x361640=_0x97ade2[0x4];if(!_[_0x2e64('0x1b')](_0x361640)){_0x2aeabe[_0x2e64('0x1c')]=utils[_0x2e64('0x1d')](_0x361640,this);return rpc[_0x375a9c+_0x2e64('0x1e')][_0x2e64('0x1f')](_0x2aeabe)[_0x2e64('0x20')](function(_0x1afc0c){logger['info'](_0x2e64('0xd'),_0x4901b9,_0x2aeabe['body']);})['catch'](function(_0x4dff41){logger['error'](_0x2e64('0xd'),_0x4901b9,JSON[_0x2e64('0x21')](_0x4dff41));})[_0x2e64('0x22')](function(){logger[_0x2e64('0xc')](_0x2e64('0x23'),_0x4901b9);_0x2ae144['stop']();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4901b9);_0x2ae144[_0x2e64('0x24')]();}}else{var _0x238edb=this;var _0x502322=new AWS[(_0x2e64('0x25'))]({'accessKeyId':_0x97ade2[0x0],'secretAccessKey':_0x97ade2[0x1],'region':_0x97ade2[0x2]});var _0x4d74bc={'botAlias':'$LATEST','botName':_0x97ade2[0x3],'inputText':this[_0x2e64('0x26')][_0x2e64('0x1c')],'userId':this[_0x2e64('0x12')]+':'+this[_0x2e64('0x13')]['id'][_0x2e64('0x27')]()};_0x502322['postText'](_0x4d74bc,function(_0x59fe41,_0x6cfd03){if(_0x59fe41){logger[_0x2e64('0x28')](_0x2e64('0xd'),_0x4901b9,_0x59fe41['message']);_0x2ae144['next']();}else if(_0x6cfd03&&_0x6cfd03[_0x2e64('0x26')]){_0x238edb[_0x2e64('0x1c')][_0x2e64('0x29')]=_0x6cfd03;_0x2aeabe[_0x2e64('0x1c')]=_0x6cfd03[_0x2e64('0x26')];_0x2aeabe[_0x2e64('0x2a')]=_0x2e64('0x29');_0x2aeabe[_0x2e64('0x2b')]=JSON[_0x2e64('0x21')](_0x6cfd03);return rpc[_0x375a9c+_0x2e64('0x1e')][_0x2e64('0x1f')](_0x2aeabe)[_0x2e64('0x20')](function(_0x314c16){logger[_0x2e64('0xc')](_0x2e64('0xd'),_0x4901b9,_0x2aeabe['body']);if(_0x6cfd03[_0x2e64('0x2c')]==_0x2e64('0x2d')){_0x2ae144[_0x2e64('0xf')]();}else{_0x2ae144['stop']();}})[_0x2e64('0x2e')](function(_0x3d7b89){logger['error'](_0x2e64('0xd'),_0x4901b9,JSON['stringify'](_0x3d7b89));_0x2ae144[_0x2e64('0xf')]();});}else{_0x2ae144[_0x2e64('0xf')]();}});}}catch(_0xc46e55){logger['error']('[%s][AMAZONLEX]\x20%s',_0x4901b9,JSON[_0x2e64('0x21')](_0xc46e55));_0x2ae144[_0x2e64('0x24')]();}};}; \ 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 3420b78..85a2f7b 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 _0x3ff5=['./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','messageId','html','','replace','','headers','All','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','Interaction','update','error','stop','lodash','moment'];(function(_0x5e2265,_0x18b65f){var _0x1de65f=function(_0x96df57){while(--_0x96df57){_0x5e2265['push'](_0x5e2265['shift']());}};_0x1de65f(++_0x18b65f);}(_0x3ff5,0x1a2));var _0x53ff=function(_0x32df33,_0x18ab46){_0x32df33=_0x32df33-0x0;var _0x34a9d9=_0x3ff5[_0x32df33];return _0x34a9d9;};'use strict';var _=require(_0x53ff('0x0'));var moment=require(_0x53ff('0x1'));var utils=require(_0x53ff('0x2'));var logger=require(_0x53ff('0x3'))('routing');var rpc={'chatMessage':require(_0x53ff('0x4')),'openchannelMessage':require(_0x53ff('0x5')),'mailMessage':require(_0x53ff('0x6')),'smsMessage':require(_0x53ff('0x7')),'faxMessage':require(_0x53ff('0x8')),'whatsappMessage':require(_0x53ff('0x9')),'chatInteraction':require(_0x53ff('0xa')),'openchannelInteraction':require(_0x53ff('0xb')),'mailInteraction':require(_0x53ff('0xc')),'smsInteraction':require(_0x53ff('0xd')),'faxInteraction':require(_0x53ff('0xe')),'whatsappInteraction':require(_0x53ff('0xf'))};var mailRpc=require(_0x53ff('0x10'));exports[_0x53ff('0x11')]=function(_0x5d4d13,_0x5bc57a,_0x4111d5,_0x3a47eb){return function(_0xc74c59){try{var _0x54ec83=this[_0x53ff('0x12')];if(_0x54ec83===_0x53ff('0x13')&&_0x3a47eb[_0x53ff('0x14')][_0x53ff('0x15')]){logger[_0x53ff('0x16')](_0x53ff('0x17'),_0x5d4d13,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0xc74c59[_0x53ff('0x18')]();}if(_0x5bc57a[0x0]==='1'&&(_[_0x53ff('0x19')](this[_0x53ff('0x1a')]['created'])||!this[_0x53ff('0x1a')][_0x53ff('0x1b')])){logger[_0x53ff('0x16')](_0x53ff('0x17'),_0x5d4d13,_0x53ff('0x1c'));return _0xc74c59['next']();}if(_0x5bc57a[0x0]==='2'&&this[_0x53ff('0x1a')][_0x53ff('0x1d')]){logger[_0x53ff('0x16')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5d4d13,_0x53ff('0x1e'));return _0xc74c59['next']();}var _0x56ba91={'ContactId':this[_0x53ff('0x1f')]['id'],'sentAt':moment()[_0x53ff('0x20')](_0x53ff('0x21')),'direction':'out'};if(this[_0x53ff('0x12')]==='mail'){_0x56ba91['body']=utils[_0x53ff('0x22')](_0x5bc57a[0x2],this);}else{_0x56ba91[_0x53ff('0x14')]=utils['getMustacheRender'](_0x5bc57a[0x1],this);}if(this['message']){_0x56ba91['to']=this[_0x53ff('0x23')][_0x53ff('0x24')]||'';if(this['channel']===_0x53ff('0x13')&&_0x5bc57a[0x1]==='1'){_0x56ba91['cc']=this['message']['cc']||'';}_0x56ba91[_0x53ff('0x24')]=this[_0x53ff('0x23')]['to']||'';_0x56ba91[_0x53ff('0x25')]=this[_0x53ff('0x23')][_0x53ff('0x25')]||'';_0x56ba91['read']=!![];if(this[_0x53ff('0x23')][_0x53ff('0x26')]){_0x56ba91[_0x53ff('0x26')]='';_0x56ba91['subject']+=_[_0x53ff('0x27')](this[_0x53ff('0x23')][_0x53ff('0x26')],_0x53ff('0x28'))?'':'Re:\x20';_0x56ba91[_0x53ff('0x26')]+=this[_0x53ff('0x23')]['subject'];}}if(this[_0x53ff('0x12')]===_0x53ff('0x29')){_0x56ba91[_0x53ff('0x2a')]=this[_0x53ff('0x2b')]['id'];}else{_0x56ba91[_[_0x53ff('0x2c')](this[_0x53ff('0x12')])+_0x53ff('0x2d')]=this['account']['id'];}_0x56ba91[_[_0x53ff('0x2c')](this[_0x53ff('0x12')])+'InteractionId']=this[_0x53ff('0x1a')]['id'];var _0x59f7dc=this[_0x53ff('0x1a')];if(rpc[this[_0x53ff('0x12')]+_0x53ff('0x2e')]){if(this[_0x53ff('0x12')]===_0x53ff('0x13')){_0x56ba91['inReplyTo']=this[_0x53ff('0x23')][_0x53ff('0x2f')];_0x56ba91[_0x53ff('0x30')]=_0x53ff('0x31')+_[_0x53ff('0x32')](_0x56ba91[_0x53ff('0x14')],_0x53ff('0x33'),_0x53ff('0x34'))+_0x53ff('0x35');_0x56ba91[_0x53ff('0x36')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x53ff('0x37'),'Precedence':_0x53ff('0x38')};return mailRpc['sendMailMessage'](this[_0x53ff('0x2b')][_0x53ff('0x39')],_0x56ba91)[_0x53ff('0x3a')](function(_0x483ad0){logger[_0x53ff('0x16')](_0x53ff('0x3b'),_0x5d4d13);_0x56ba91[_0x53ff('0x2f')]=_0x483ad0[_0x53ff('0x23')]['messageId'];return rpc[_0x54ec83+'Message']['create'](_0x56ba91);})[_0x53ff('0x3a')](function(_0xd95846){logger[_0x53ff('0x16')]('[%s][AUTOREPLY]\x20%s',_0x5d4d13,JSON[_0x53ff('0x3c')](_0xd95846));})[_0x53ff('0x3d')](function(_0x38a267){logger['error'](_0x53ff('0x3e'),_0x5d4d13,JSON[_0x53ff('0x3c')](_0x38a267));})[_0x53ff('0x3f')](function(){Promise['resolve']()[_0x53ff('0x3a')](function(){if(_0x5bc57a[0x0]!=='2'||_0x59f7dc[_0x53ff('0x1d')])return;return rpc[_0x54ec83+'Interaction']['update'](_0x59f7dc['id'],{'autoreplyExecuted':!![]})[_0x53ff('0x3a')](function(_0x4b986f){logger[_0x53ff('0x16')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5d4d13,JSON['stringify'](_0x4b986f));})['catch'](function(_0x131e21){logger['error'](_0x53ff('0x40'),_0x5d4d13,JSON[_0x53ff('0x3c')](_0x131e21));});})[_0x53ff('0x3a')](function(){_0xc74c59[_0x53ff('0x18')]();});});}else{return rpc[this['channel']+_0x53ff('0x2e')]['create'](_0x56ba91)[_0x53ff('0x3a')](function(){logger[_0x53ff('0x16')](_0x53ff('0x17'),_0x5d4d13,_0x56ba91['body']);})[_0x53ff('0x3d')](function(_0x47701a){logger['error']('[%s][AUTOREPLY]\x20%s',_0x5d4d13,JSON[_0x53ff('0x3c')](_0x47701a));})[_0x53ff('0x3f')](function(){Promise[_0x53ff('0x41')]()[_0x53ff('0x3a')](function(){if(_0x5bc57a[0x0]!=='2'||_0x59f7dc[_0x53ff('0x1d')])return;return rpc[_0x54ec83+_0x53ff('0x42')][_0x53ff('0x43')](_0x59f7dc['id'],{'autoreplyExecuted':!![]})['then'](function(_0x119b12){logger[_0x53ff('0x16')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5d4d13,JSON['stringify'](_0x119b12));})['catch'](function(_0x596ea0){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5d4d13,JSON[_0x53ff('0x3c')](_0x596ea0));});})[_0x53ff('0x3a')](function(){_0xc74c59[_0x53ff('0x18')]();});});}}}catch(_0x671790){logger[_0x53ff('0x44')](_0x53ff('0x17'),_0x5d4d13,JSON['stringify'](_0x671790));_0xc74c59[_0x53ff('0x45')]();}};}; \ No newline at end of file +var _0xd7fd=['[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','body','info','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','mail','getMustacheRender','message','from','phone','subject','Re:','Re:\x20','ChatWebsiteId','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','','auto-replied','All','auto_reply','sendMailMessage','account','smtpOptions','then'];(function(_0x479774,_0x393894){var _0x5f4e5c=function(_0x59f7d2){while(--_0x59f7d2){_0x479774['push'](_0x479774['shift']());}};_0x5f4e5c(++_0x393894);}(_0xd7fd,0x1e8));var _0xdd7f=function(_0x49b78f,_0x1ccdf7){_0x49b78f=_0x49b78f-0x0;var _0x544d2=_0xd7fd[_0x49b78f];return _0x544d2;};'use strict';var _=require(_0xdd7f('0x0'));var moment=require(_0xdd7f('0x1'));var utils=require('./utils');var logger=require(_0xdd7f('0x2'))(_0xdd7f('0x3'));var rpc={'chatMessage':require(_0xdd7f('0x4')),'openchannelMessage':require(_0xdd7f('0x5')),'mailMessage':require(_0xdd7f('0x6')),'smsMessage':require(_0xdd7f('0x7')),'faxMessage':require(_0xdd7f('0x8')),'whatsappMessage':require(_0xdd7f('0x9')),'chatInteraction':require(_0xdd7f('0xa')),'openchannelInteraction':require(_0xdd7f('0xb')),'mailInteraction':require(_0xdd7f('0xc')),'smsInteraction':require(_0xdd7f('0xd')),'faxInteraction':require(_0xdd7f('0xe')),'whatsappInteraction':require(_0xdd7f('0xf'))};var mailRpc=require(_0xdd7f('0x10'));exports['consequence']=function(_0x5d9df8,_0x527fa8,_0x3060f8,_0x2f9054){return function(_0x3ec805){try{var _0x2cbe45=this['channel'];if(_0x2cbe45==='mail'&&_0x2f9054[_0xdd7f('0x11')]['isAutoreply']){logger[_0xdd7f('0x12')]('[%s][AUTOREPLY]\x20%s',_0x5d9df8,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x3ec805['next']();}if(_0x527fa8[0x0]==='1'&&(_[_0xdd7f('0x13')](this[_0xdd7f('0x14')][_0xdd7f('0x15')])||!this[_0xdd7f('0x14')]['created'])){logger['info'](_0xdd7f('0x16'),_0x5d9df8,'Autoreply\x20already\x20sent');return _0x3ec805['next']();}if(_0x527fa8[0x0]==='2'&&this[_0xdd7f('0x14')][_0xdd7f('0x17')]){logger[_0xdd7f('0x12')](_0xdd7f('0x18'),_0x5d9df8,_0xdd7f('0x19'));return _0x3ec805[_0xdd7f('0x1a')]();}var _0x100935={'ContactId':this[_0xdd7f('0x1b')]['id'],'sentAt':moment()['format'](_0xdd7f('0x1c')),'direction':'out'};if(this[_0xdd7f('0x1d')]===_0xdd7f('0x1e')){_0x100935[_0xdd7f('0x11')]=utils[_0xdd7f('0x1f')](_0x527fa8[0x2],this);}else{_0x100935['body']=utils[_0xdd7f('0x1f')](_0x527fa8[0x1],this);}if(this['message']){_0x100935['to']=this[_0xdd7f('0x20')]['from']||'';if(this[_0xdd7f('0x1d')]===_0xdd7f('0x1e')&&_0x527fa8[0x1]==='1'){_0x100935['cc']=this[_0xdd7f('0x20')]['cc']||'';}_0x100935[_0xdd7f('0x21')]=this['message']['to']||'';_0x100935[_0xdd7f('0x22')]=this['message'][_0xdd7f('0x22')]||'';_0x100935['read']=!![];if(this[_0xdd7f('0x20')][_0xdd7f('0x23')]){_0x100935[_0xdd7f('0x23')]='';_0x100935['subject']+=_['startsWith'](this[_0xdd7f('0x20')]['subject'],_0xdd7f('0x24'))?'':_0xdd7f('0x25');_0x100935[_0xdd7f('0x23')]+=this[_0xdd7f('0x20')][_0xdd7f('0x23')];}}if(this[_0xdd7f('0x1d')]==='chat'){_0x100935[_0xdd7f('0x26')]=this['account']['id'];}else{_0x100935[_[_0xdd7f('0x27')](this[_0xdd7f('0x1d')])+_0xdd7f('0x28')]=this['account']['id'];}_0x100935[_[_0xdd7f('0x27')](this[_0xdd7f('0x1d')])+_0xdd7f('0x29')]=this[_0xdd7f('0x14')]['id'];var _0x3716db=this[_0xdd7f('0x14')];if(rpc[this['channel']+_0xdd7f('0x2a')]){if(this[_0xdd7f('0x1d')]==='mail'){_0x100935[_0xdd7f('0x2b')]=this[_0xdd7f('0x20')][_0xdd7f('0x2c')];_0x100935[_0xdd7f('0x2d')]=_0xdd7f('0x2e')+_[_0xdd7f('0x2f')](_0x100935[_0xdd7f('0x11')],']+(>|$)/g,''),'priorityTrue':_0x452bbd[0x1],'priorityFalse':_0x452bbd[0x2]};var _0x4f5215=gotoif[_0x7dc9('0xc')](_0xcc0bbd,{'typecast':!![]});if(_0x4f5215[_0x7dc9('0xd')]){logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x1c5688,_[_0x7dc9('0x10')](_0x4f5215,_0x7dc9('0x11'))[_0x7dc9('0x12')](',\x20'));_0x4f88de[_0x7dc9('0x13')]();}else{try{var _0x2c9997=eval('('+_0xcc0bbd[_0x7dc9('0x14')]+')');var _0x249e77=_0x2c9997?_0xcc0bbd[_0x7dc9('0x15')]:_0xcc0bbd['priorityFalse'];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x1c5688,_0xcc0bbd['condition'],_0x2c9997,_0x249e77||_0x7dc9('0x16'));if(_0x249e77){var _0x210986=_['findIndex'](_0x4f88de[_0x7dc9('0x17')](),{'p':_0x249e77});if(_0x210986>=0x0){logger[_0x7dc9('0x18')](_0x7dc9('0x19'),_0x1c5688,_0x249e77||_0x7dc9('0x16'),_0x210986);_0x4f88de['next'](_0x210986);}else{logger[_0x7dc9('0x18')](_0x7dc9('0x1a'),_0x1c5688,_0x249e77||_0x7dc9('0x16'));_0x4f88de[_0x7dc9('0x13')]();}}else{_0x4f88de[_0x7dc9('0x16')]();}}catch(_0x187328){logger[_0x7dc9('0xe')](_0x7dc9('0x1b'),_0x1c5688,_0x187328['message']);_0x4f88de[_0x7dc9('0x13')]();}}}catch(_0x26a39b){logger['error'](_0x7dc9('0xf'),_0x1c5688,JSON[_0x7dc9('0x1c')](_0x26a39b));_0x4f88de['stop']();}};}; \ No newline at end of file +var _0xd6e7=['[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','lodash','html-to-text','./utils','../../../../config/logger','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error'];(function(_0x1b94b2,_0x5beda5){var _0x58c4bd=function(_0x5f2eed){while(--_0x5f2eed){_0x1b94b2['push'](_0x1b94b2['shift']());}};_0x58c4bd(++_0x5beda5);}(_0xd6e7,0x103));var _0x7d6e=function(_0x3baeee,_0x470398){_0x3baeee=_0x3baeee-0x0;var _0x40920b=_0xd6e7[_0x3baeee];return _0x40920b;};'use strict';var schema=require('validate');var _=require(_0x7d6e('0x0'));var htmlToText=require(_0x7d6e('0x1'));var utils=require(_0x7d6e('0x2'));var logger=require(_0x7d6e('0x3'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x7d6e('0x4'),'message':_0x7d6e('0x5')},'priorityFalse':{'type':_0x7d6e('0x4'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x7d6e('0x6')]=function(_0x4d4797,_0x29cfb3){return function(_0x8872c2){try{var _0x505979={'condition':htmlToText[_0x7d6e('0x7')](utils[_0x7d6e('0x8')](_0x29cfb3[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x29cfb3[0x1],'priorityFalse':_0x29cfb3[0x2]};var _0x98be6e=gotoif['validate'](_0x505979,{'typecast':!![]});if(_0x98be6e[_0x7d6e('0x9')]){logger[_0x7d6e('0xa')](_0x7d6e('0xb'),_0x4d4797,_[_0x7d6e('0xc')](_0x98be6e,_0x7d6e('0xd'))[_0x7d6e('0xe')](',\x20'));_0x8872c2[_0x7d6e('0xf')]();}else{try{var _0x3ae131=eval('('+_0x505979[_0x7d6e('0x10')]+')');var _0x54062a=_0x3ae131?_0x505979[_0x7d6e('0x11')]:_0x505979[_0x7d6e('0x12')];logger[_0x7d6e('0x13')](_0x7d6e('0x14'),_0x4d4797,_0x505979[_0x7d6e('0x10')],_0x3ae131,_0x54062a||_0x7d6e('0x15'));if(_0x54062a){var _0x126919=_[_0x7d6e('0x16')](_0x8872c2[_0x7d6e('0x17')](),{'p':_0x54062a});if(_0x126919>=0x0){logger[_0x7d6e('0x13')](_0x7d6e('0x18'),_0x4d4797,_0x54062a||_0x7d6e('0x15'),_0x126919);_0x8872c2[_0x7d6e('0x15')](_0x126919);}else{logger[_0x7d6e('0x13')](_0x7d6e('0x19'),_0x4d4797,_0x54062a||'next');_0x8872c2[_0x7d6e('0xf')]();}}else{_0x8872c2['next']();}}catch(_0x2faa23){logger[_0x7d6e('0xa')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4d4797,_0x2faa23[_0x7d6e('0xd')]);_0x8872c2[_0x7d6e('0xf')]();}}}catch(_0x3b1899){logger[_0x7d6e('0xa')](_0x7d6e('0xb'),_0x4d4797,JSON[_0x7d6e('0x1a')](_0x3b1899));_0x8872c2[_0x7d6e('0xf')]();}};}; \ 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 d316bec..779c429 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 _0x086e=['../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','[%s][GOTOP]\x20%s','map','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash'];(function(_0xc64946,_0x229695){var _0x2f66e5=function(_0x3028d5){while(--_0x3028d5){_0xc64946['push'](_0xc64946['shift']());}};_0x2f66e5(++_0x229695);}(_0x086e,0xdb));var _0xe086=function(_0x2efe4f,_0x35b3d9){_0x2efe4f=_0x2efe4f-0x0;var _0x251e7e=_0x086e[_0x2efe4f];return _0x251e7e;};'use strict';var schema=require(_0xe086('0x0'));var _=require(_0xe086('0x1'));var logger=require(_0xe086('0x2'))('routing');var gotop=schema({'priority':{'type':_0xe086('0x3'),'required':!![],'message':_0xe086('0x4')}});exports['consequence']=function(_0x4c49d2,_0x354110){return function(_0x36cd0a){try{var _0x4a865c={'priority':_0x354110[0x0]};var _0xbb0347=gotop[_0xe086('0x0')](_0x4a865c,{'typecast':!![]});if(_0xbb0347['length']){logger['error'](_0xe086('0x5'),_0x4c49d2,_[_0xe086('0x6')](_0xbb0347,'message')[_0xe086('0x7')](',\x20'));_0x36cd0a['stop']();}else{logger[_0xe086('0x8')](_0xe086('0x9'),_0x4c49d2,_0x4a865c[_0xe086('0xa')]);if(_0x4a865c[_0xe086('0xa')]){var _0x6207b8=_['findIndex'](_0x36cd0a[_0xe086('0xb')](),{'p':_0x4a865c['priority']});if(_0x6207b8>=0x0){logger[_0xe086('0x8')](_0xe086('0xc'),_0x4c49d2,_0x4a865c[_0xe086('0xa')]||_0xe086('0xd'),_0x6207b8);_0x36cd0a['next'](_0x6207b8);}else{logger[_0xe086('0x8')](_0xe086('0xe'),_0x4c49d2,_0x4a865c[_0xe086('0xa')]||_0xe086('0xd'));_0x36cd0a[_0xe086('0xf')]();}}else{_0x36cd0a[_0xe086('0xd')]();}}}catch(_0x3347ca){logger['error']('[%s][GOTOP]\x20%s',_0x4c49d2,JSON[_0xe086('0x10')](_0x3347ca));_0x36cd0a['stop']();}};}; \ No newline at end of file +var _0xae3d=['length','error','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s','stringify','validate','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x3edf75,_0x31df00){var _0x12968b=function(_0x2b78de){while(--_0x2b78de){_0x3edf75['push'](_0x3edf75['shift']());}};_0x12968b(++_0x31df00);}(_0xae3d,0x68));var _0xdae3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xae3d[_0x3ab51d];return _0x29a04e;};'use strict';var schema=require(_0xdae3('0x0'));var _=require('lodash');var logger=require(_0xdae3('0x1'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xdae3('0x2')}});exports[_0xdae3('0x3')]=function(_0x3906bd,_0x58af2f){return function(_0x43fc62){try{var _0x4ed031={'priority':_0x58af2f[0x0]};var _0x454cee=gotop['validate'](_0x4ed031,{'typecast':!![]});if(_0x454cee[_0xdae3('0x4')]){logger[_0xdae3('0x5')]('[%s][GOTOP]\x20%s',_0x3906bd,_[_0xdae3('0x6')](_0x454cee,_0xdae3('0x7'))['join'](',\x20'));_0x43fc62[_0xdae3('0x8')]();}else{logger[_0xdae3('0x9')](_0xdae3('0xa'),_0x3906bd,_0x4ed031[_0xdae3('0xb')]);if(_0x4ed031[_0xdae3('0xb')]){var _0x46ba80=_[_0xdae3('0xc')](_0x43fc62[_0xdae3('0xd')](),{'p':_0x4ed031[_0xdae3('0xb')]});if(_0x46ba80>=0x0){logger['info'](_0xdae3('0xe'),_0x3906bd,_0x4ed031['priority']||_0xdae3('0xf'),_0x46ba80);_0x43fc62[_0xdae3('0xf')](_0x46ba80);}else{logger[_0xdae3('0x9')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3906bd,_0x4ed031['priority']||_0xdae3('0xf'));_0x43fc62['stop']();}}else{_0x43fc62[_0xdae3('0xf')]();}}}catch(_0x427d8d){logger['error'](_0xdae3('0x10'),_0x3906bd,JSON[_0xdae3('0x11')](_0x427d8d));_0x43fc62[_0xdae3('0x8')]();}};}; \ 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 64c8abd..929a6b0 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 _0x42f4=['upperFirst','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','consequence','getMustacheRender','contact','channel','chat','account'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x42f4,0x19d));var _0x442f=function(_0x3eb4a9,_0x359d73){_0x3eb4a9=_0x3eb4a9-0x0;var _0x48dbad=_0x42f4[_0x3eb4a9];return _0x48dbad;};'use strict';var _=require(_0x442f('0x0'));var utils=require('./utils');var logger=require(_0x442f('0x1'))(_0x442f('0x2'));var rpc={'chatMessage':require(_0x442f('0x3')),'openchannelMessage':require(_0x442f('0x4')),'mailMessage':require(_0x442f('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x442f('0x6')]=function(_0x26fb18,_0x545b7b){return function(_0x3ed622){try{var _0x11b450={'body':utils[_0x442f('0x7')](_0x545b7b[0x0],this),'ContactId':this[_0x442f('0x8')]['id']};if(this[_0x442f('0x9')]===_0x442f('0xa')){_0x11b450['ChatWebsiteId']=this[_0x442f('0xb')]['id'];}else{_0x11b450[_['upperFirst'](this['channel'])+'AccountId']=this[_0x442f('0xb')]['id'];}_0x11b450[_[_0x442f('0xc')](this[_0x442f('0x9')])+_0x442f('0xd')]=this[_0x442f('0xe')]['id'];if(rpc[this[_0x442f('0x9')]+_0x442f('0xf')]){return rpc[this[_0x442f('0x9')]+_0x442f('0xf')][_0x442f('0x10')](_0x11b450)['then'](function(_0x370d73){logger[_0x442f('0x11')](_0x442f('0x12'),_0x26fb18,_0x11b450[_0x442f('0x13')]);_0x3ed622[_0x442f('0x14')]();})[_0x442f('0x15')](function(_0x444fac){logger[_0x442f('0x16')](_0x442f('0x12'),_0x26fb18,JSON[_0x442f('0x17')](_0x444fac));_0x3ed622[_0x442f('0x18')]();});}}catch(_0x3d075a){logger[_0x442f('0x16')](_0x442f('0x12'),_0x26fb18,JSON[_0x442f('0x17')](_0x3d075a));_0x3ed622[_0x442f('0x18')]();}};}; \ No newline at end of file +var _0x6722=['interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','account','upperFirst','AccountId','InteractionId'];(function(_0x579bfc,_0x37c41f){var _0x162bc0=function(_0x3e8743){while(--_0x3e8743){_0x579bfc['push'](_0x579bfc['shift']());}};_0x162bc0(++_0x37c41f);}(_0x6722,0x134));var _0x2672=function(_0x46a4d2,_0x467bed){_0x46a4d2=_0x46a4d2-0x0;var _0x574fdb=_0x6722[_0x46a4d2];return _0x574fdb;};'use strict';var _=require(_0x2672('0x0'));var utils=require(_0x2672('0x1'));var logger=require(_0x2672('0x2'))(_0x2672('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2672('0x4')),'mailMessage':require(_0x2672('0x5')),'smsMessage':require(_0x2672('0x6')),'faxMessage':require(_0x2672('0x7')),'whatsappMessage':require(_0x2672('0x8'))};exports['consequence']=function(_0x2a478e,_0x46d9a6){return function(_0x57b8b7){try{var _0x1bed98={'body':utils[_0x2672('0x9')](_0x46d9a6[0x0],this),'ContactId':this[_0x2672('0xa')]['id']};if(this[_0x2672('0xb')]==='chat'){_0x1bed98['ChatWebsiteId']=this[_0x2672('0xc')]['id'];}else{_0x1bed98[_[_0x2672('0xd')](this['channel'])+_0x2672('0xe')]=this[_0x2672('0xc')]['id'];}_0x1bed98[_[_0x2672('0xd')](this[_0x2672('0xb')])+_0x2672('0xf')]=this[_0x2672('0x10')]['id'];if(rpc[this[_0x2672('0xb')]+_0x2672('0x11')]){return rpc[this['channel']+'Message'][_0x2672('0x12')](_0x1bed98)[_0x2672('0x13')](function(_0x5dc55a){logger[_0x2672('0x14')](_0x2672('0x15'),_0x2a478e,_0x1bed98[_0x2672('0x16')]);_0x57b8b7[_0x2672('0x17')]();})[_0x2672('0x18')](function(_0x230bc0){logger[_0x2672('0x19')](_0x2672('0x15'),_0x2a478e,JSON['stringify'](_0x230bc0));_0x57b8b7[_0x2672('0x1a')]();});}}catch(_0x18c98c){logger[_0x2672('0x19')](_0x2672('0x15'),_0x2a478e,JSON['stringify'](_0x18c98c));_0x57b8b7[_0x2672('0x1a')]();}};}; \ 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 b16b4c8..7b16f5d 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 _0x50df=['./utils','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','error','stringify','stop'];(function(_0x5a4cc1,_0x35ffad){var _0x1b13e4=function(_0x20a817){while(--_0x20a817){_0x5a4cc1['push'](_0x5a4cc1['shift']());}};_0x1b13e4(++_0x35ffad);}(_0x50df,0x168));var _0xf50d=function(_0x4da327,_0x38db04){_0x4da327=_0x4da327-0x0;var _0x34c4fc=_0x50df[_0x4da327];return _0x34c4fc;};'use strict';var utils=require(_0xf50d('0x0'));var logger=require('../../../../config/logger')(_0xf50d('0x1'));exports[_0xf50d('0x2')]=function(_0x3e5a05,_0x3f24ea){return function(_0x126b98){try{logger[_0xf50d('0x3')](_0xf50d('0x4'),_0x3e5a05,utils[_0xf50d('0x5')](_0x3f24ea[0x0],this));_0x126b98['next']();}catch(_0x15014a){logger[_0xf50d('0x6')](_0xf50d('0x4'),_0x3e5a05,JSON[_0xf50d('0x7')](_0x15014a));_0x126b98[_0xf50d('0x8')]();}};}; \ No newline at end of file +var _0x6a09=['info','[%s][NOOP]\x20%s','getMustacheRender','error','stringify','stop','./utils','../../../../config/logger','routing'];(function(_0x5e6e39,_0xff186e){var _0x2c577f=function(_0x2cf211){while(--_0x2cf211){_0x5e6e39['push'](_0x5e6e39['shift']());}};_0x2c577f(++_0xff186e);}(_0x6a09,0x1c8));var _0x96a0=function(_0x315b6c,_0x2ac37f){_0x315b6c=_0x315b6c-0x0;var _0x94dc8=_0x6a09[_0x315b6c];return _0x94dc8;};'use strict';var utils=require(_0x96a0('0x0'));var logger=require(_0x96a0('0x1'))(_0x96a0('0x2'));exports['consequence']=function(_0x2922f4,_0x1ebd5a){return function(_0x533432){try{logger[_0x96a0('0x3')](_0x96a0('0x4'),_0x2922f4,utils[_0x96a0('0x5')](_0x1ebd5a[0x0],this));_0x533432['next']();}catch(_0x2a108b){logger[_0x96a0('0x6')](_0x96a0('0x4'),_0x2922f4,JSON[_0x96a0('0x7')](_0x2a108b));_0x533432[_0x96a0('0x8')]();}};}; \ 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 2dcdfb3..91234f7 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 _0x73e4=['AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','createQueue','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue_id','account','queue','from','joinAt','clone','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','message','chat'];(function(_0x4409f7,_0x376196){var _0xa7dce8=function(_0x3e8da8){while(--_0x3e8da8){_0x4409f7['push'](_0x4409f7['shift']());}};_0xa7dce8(++_0x376196);}(_0x73e4,0x149));var _0x473e=function(_0x461886,_0x4fc171){_0x461886=_0x461886-0x0;var _0x295e0a=_0x73e4[_0x461886];return _0x295e0a;};'use strict';var schema=require(_0x473e('0x0'));var _=require('lodash');var util=require(_0x473e('0x1'));var seqqueue=require(_0x473e('0x2'));var moment=require(_0x473e('0x3'));var Redis=require('ioredis');var config=require(_0x473e('0x4'));var logger=require(_0x473e('0x5'))(_0x473e('0x6'));var strategy=require('./strategy');config[_0x473e('0x7')]=_[_0x473e('0x8')](config[_0x473e('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x473e('0x9'))(new Redis(config[_0x473e('0x7')]));var attributes=['id',_0x473e('0xa'),_0x473e('0xb'),_0x473e('0xc'),_0x473e('0xd'),_0x473e('0xe')];function emit(_0x40b74a,_0x1cd055,_0x20f6c3){io['to'](_0x40b74a)['emit'](_0x1cd055,_0x20f6c3);}function emitChannelQueueInteraction(_0x10ca93,_0x13e353,_0x45b255,_0x413058,_0x1df13e,_0x32190b,_0x1fe967,_0x2f459f){var _0x199184=_[_0x473e('0xf')](_0x45b255);_0x199184[_0x473e('0xa')]=_0x2f459f;_0x199184[_0x473e('0xc')]=_0x13e353;_0x199184['account']=_0x413058;_0x199184['id']=_0x1df13e;if(_0x32190b){_0x1fe967[util[_0x473e('0x10')]('%sQueuesWaitingInteractions',_0x10ca93)][_0x1df13e]=_[_0x473e('0x11')](_0x199184,attributes);}else{delete _0x1fe967[util[_0x473e('0x10')](_0x473e('0x12'),_0x10ca93)][_0x1df13e];}emit(util['format'](_0x473e('0x13'),_0x10ca93,_0x13e353),util[_0x473e('0x10')](_0x473e('0x14'),_0x10ca93,_0x32190b?_0x473e('0x15'):'remove'),_['pick'](_0x199184,attributes));}var rpc={'openchannelQueueReport':require(_0x473e('0x16')),'mailQueueReport':require(_0x473e('0x17')),'chatQueueReport':require(_0x473e('0x18')),'smsQueueReport':require(_0x473e('0x19')),'faxQueueReport':require(_0x473e('0x1a')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x473e('0x1b'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x473e('0x1c'),'message':_0x473e('0x1d')}});function startRouting(_0x442f82,_0xdedda4,_0x3e7e45,_0x12884a){if(_0x442f82&&_0xdedda4&&_0x3e7e45){_0xdedda4['waiting']+=0x1;var _0x2e44a3={'uniqueid':_0x442f82,'from':_0x3e7e45[_0x473e('0x1e')]?_0x3e7e45[_0x473e('0x1e')][_0x473e('0xd')]:'','joinAt':moment()['format'](_0x473e('0x1f')),'ContactId':_0x3e7e45[_0x473e('0x20')]?_0x3e7e45[_0x473e('0x20')]['id']:null,'ListId':_0x3e7e45[_0x473e('0x21')]?_0x3e7e45[_0x473e('0x21')]['id']:null};_0x2e44a3[_[_0x473e('0x22')](_0x3e7e45['channel'])+_0x473e('0x23')]=_0xdedda4['id']||null;_0x2e44a3[_[_0x473e('0x22')](_0x3e7e45[_0x473e('0x24')])+_0x473e('0x25')]=_0x3e7e45[_0x473e('0x26')]?_0x3e7e45[_0x473e('0x26')]['id']:null;_0x2e44a3[_[_0x473e('0x22')](_0x3e7e45[_0x473e('0x24')])+'MessageId']=_0x3e7e45['message']?_0x3e7e45[_0x473e('0x27')]['id']:null;_0x2e44a3[_['upperFirst'](_0x3e7e45[_0x473e('0x24')])+(_0x3e7e45[_0x473e('0x24')]!==_0x473e('0x28')?_0x473e('0x29'):'WebsiteId')]=_0x3e7e45[_0x473e('0xb')]?_0x3e7e45[_0x473e('0xb')]['id']:null;logger[_0x473e('0x2a')](util[_0x473e('0x10')](_0x473e('0x2b'),_0x442f82,_0xdedda4[_0x473e('0x2c')]));emitChannelQueueInteraction(_0x3e7e45[_0x473e('0x24')],_0xdedda4[_0x473e('0x2c')],_0x2e44a3,_0x3e7e45['account'][_0x473e('0x2c')],_0x3e7e45[_0x473e('0x27')]['id'],!![],_0x12884a,_0xdedda4['id']);if(rpc[_0x3e7e45[_0x473e('0x24')]+_0x473e('0x2d')]){return rpc[_0x3e7e45[_0x473e('0x24')]+_0x473e('0x2d')][_0x473e('0x2e')](_0x2e44a3)[_0x473e('0x2f')](function(_0x494cd6){logger[_0x473e('0x30')]('create\x20queue\x20report');});}}}function stopRouting(_0x4242f8,_0x53e8db,_0x121f12,_0x20d97a){if(_0x4242f8&&_0x53e8db){_0x53e8db[_0x473e('0x31')]-=0x1;var _0x46507b={'leaveAt':moment()[_0x473e('0x10')](_0x473e('0x1f')),'acceptAt':moment()[_0x473e('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x473e('0x32')};logger[_0x473e('0x2a')](util[_0x473e('0x10')](_0x473e('0x33'),_0x4242f8,_0x53e8db[_0x473e('0x2c')]));emitChannelQueueInteraction(_0x121f12['channel'],_0x53e8db[_0x473e('0x2c')],_0x121f12[_0x473e('0x1e')],_0x121f12[_0x473e('0xb')]['name'],_0x121f12[_0x473e('0x27')]['id'],![],_0x20d97a,_0x53e8db['id']);if(rpc[_0x121f12[_0x473e('0x24')]+'QueueReport']){return rpc[_0x121f12[_0x473e('0x24')]+_0x473e('0x2d')][_0x473e('0x34')](_0x4242f8,_0x46507b)['catch'](function(_0x2fa798){logger['error'](_0x473e('0x35'));});}}}function endRouting(_0x1d97e3,_0x30380a,_0x36fd81,_0x583601){if(_0x1d97e3&&_0x30380a){_0x30380a['waiting']-=0x1;var _0x552c50={'leaveAt':moment()['format'](_0x473e('0x1f')),'exitAt':moment()[_0x473e('0x10')](_0x473e('0x1f')),'reason':_0x473e('0x36')};logger[_0x473e('0x2a')](util[_0x473e('0x10')](_0x473e('0x37'),_0x1d97e3,_0x30380a[_0x473e('0x2c')]));emitChannelQueueInteraction(_0x36fd81[_0x473e('0x24')],_0x30380a[_0x473e('0x2c')],_0x36fd81[_0x473e('0x1e')],_0x36fd81[_0x473e('0xb')][_0x473e('0x2c')],_0x36fd81[_0x473e('0x27')]['id'],![],_0x583601);if(rpc[_0x36fd81[_0x473e('0x24')]+_0x473e('0x2d')]){return rpc[_0x36fd81[_0x473e('0x24')]+_0x473e('0x2d')][_0x473e('0x34')](_0x1d97e3,_0x552c50)['catch'](function(_0x328cae){logger[_0x473e('0x30')](_0x473e('0x35'));});}}}function handleFindQueue(_0x481d11){return function(_0x2b501f){return _0x2b501f[_0x473e('0x2c')][_0x473e('0x38')]()===_0x481d11[_0x473e('0x38')]();};}exports[_0x473e('0x39')]=function(_0x42d34c,_0x30b1f,_0x3170bc,_0x347d76){return function(_0x4cd101){try{var _0x552095={'name':_0x30b1f[0x0],'timeout':_0x30b1f[0x1]};var _0x4d014d=queue['validate'](_0x552095,{'typecast':!![]});if(_0x4d014d[_0x473e('0x3a')]){logger[_0x473e('0x30')](_0x473e('0x3b'),_0x42d34c,_[_0x473e('0x3c')](_0x4d014d,_0x473e('0x27'))['join'](',\x20'));_0x4cd101[_0x473e('0x3d')]();}else{var _0x2ed3d8=_['find'](_0x3170bc[_0x347d76[_0x473e('0x24')]+'Queues'],handleFindQueue(_0x552095[_0x473e('0x2c')]));if(_0x2ed3d8){startRouting(_0x42d34c,_0x2ed3d8,_0x347d76,_0x3170bc);var _0x456011=(_0x2ed3d8[_0x473e('0x36')]||0xa)*0x3e8;var _0x3e0d96=(_0x552095[_0x473e('0x36')]||0x14)*0x3e8;var _0x1fa366,_0x4ccd52;if(_0x456011>_0x3e0d96){_0x3e0d96=_0x456011;}var _0x1f9abc=seqqueue[_0x473e('0x3e')](_0x456011);_0x1f9abc['id']=_0x42d34c;_0x1f9abc['atimeout']=_0x456011;_0x1f9abc['qtimeout']=_0x3e0d96;_0x1f9abc[_0x473e('0x24')]=_0x347d76[_0x473e('0x24')];_0x3170bc[_0x473e('0x3f')][_0x42d34c]['on'](_0x473e('0x40'),function(){logger['info'](_0x473e('0x41'),_0x42d34c);stopRouting(_0x42d34c,_0x2ed3d8,_0x347d76,_0x3170bc);clearTimeout(_0x1fa366);_0x1fa366=undefined;_0x1f9abc['close'](!![]);if(_0x3170bc['rules'][_0x42d34c]){delete _0x3170bc[_0x473e('0x3f')][_0x42d34c];}_0x4cd101['stop']();});_0x3170bc[_0x473e('0x3f')][_0x42d34c]['on'](_0x473e('0x42'),function(){if(_0x3170bc['rules'][_0x42d34c]){delete _0x3170bc[_0x473e('0x3f')][_0x42d34c];}});_0x1fa366=setTimeout(function(){logger[_0x473e('0x2a')](_0x473e('0x43'),_0x42d34c);endRouting(_0x42d34c,_0x2ed3d8,_0x347d76,_0x3170bc);clearTimeout(_0x1fa366);_0x1f9abc['close'](!![]);_0x4cd101[_0x473e('0x44')]();},_0x3e0d96);switch(_0x2ed3d8[_0x473e('0x45')]){case'rrmemory':strategy[_0x473e('0x46')](_0x1f9abc,_0x2ed3d8,_0x3170bc,_0x347d76);break;default:strategy['beepall'](_0x1f9abc,_0x2ed3d8,_0x3170bc,_0x347d76);}}else{logger[_0x473e('0x30')](_0x473e('0x47'),_0x42d34c,_0x552095[_0x473e('0x2c')]);_0x4cd101[_0x473e('0x3d')]();}}}catch(_0x4b8072){console[_0x473e('0x48')](_0x4b8072);logger[_0x473e('0x30')](_0x473e('0x3b'),_0x42d34c,_0x4b8072[_0x473e('0x49')]);_0x4cd101[_0x473e('0x3d')]();}};}; \ No newline at end of file +var _0x662d=['../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','message','info','name','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update\x20queue\x20report','timeout','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','createQueue','atimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','from','joinAt','clone','account','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport'];(function(_0x41b532,_0x516a70){var _0x147301=function(_0x5d73ea){while(--_0x5d73ea){_0x41b532['push'](_0x41b532['shift']());}};_0x147301(++_0x516a70);}(_0x662d,0x1af));var _0xd662=function(_0x29dfc7,_0x5d32a5){_0x29dfc7=_0x29dfc7-0x0;var _0x22d34a=_0x662d[_0x29dfc7];return _0x22d34a;};'use strict';var schema=require(_0xd662('0x0'));var _=require(_0xd662('0x1'));var util=require('util');var seqqueue=require(_0xd662('0x2'));var moment=require(_0xd662('0x3'));var Redis=require('ioredis');var config=require(_0xd662('0x4'));var logger=require(_0xd662('0x5'))(_0xd662('0x6'));var strategy=require(_0xd662('0x7'));config[_0xd662('0x8')]=_[_0xd662('0x9')](config[_0xd662('0x8')],{'host':_0xd662('0xa'),'port':0x18eb});var io=require(_0xd662('0xb'))(new Redis(config[_0xd662('0x8')]));var attributes=['id',_0xd662('0xc'),'account','queue',_0xd662('0xd'),_0xd662('0xe')];function emit(_0x36c984,_0x5274bf,_0x5dfeba){io['to'](_0x36c984)['emit'](_0x5274bf,_0x5dfeba);}function emitChannelQueueInteraction(_0x588c84,_0x2425c2,_0x136e22,_0x54788b,_0x4459f1,_0x1fcc19,_0x4c3148,_0x7ebb1e){var _0x12ca54=_[_0xd662('0xf')](_0x136e22);_0x12ca54[_0xd662('0xc')]=_0x7ebb1e;_0x12ca54['queue']=_0x2425c2;_0x12ca54[_0xd662('0x10')]=_0x54788b;_0x12ca54['id']=_0x4459f1;if(_0x1fcc19){_0x4c3148[util['format'](_0xd662('0x11'),_0x588c84)][_0x4459f1]=_[_0xd662('0x12')](_0x12ca54,attributes);}else{delete _0x4c3148[util[_0xd662('0x13')](_0xd662('0x11'),_0x588c84)][_0x4459f1];}emit(util[_0xd662('0x13')](_0xd662('0x14'),_0x588c84,_0x2425c2),util[_0xd662('0x13')](_0xd662('0x15'),_0x588c84,_0x1fcc19?_0xd662('0x16'):_0xd662('0x17')),_['pick'](_0x12ca54,attributes));}var rpc={'openchannelQueueReport':require(_0xd662('0x18')),'mailQueueReport':require(_0xd662('0x19')),'chatQueueReport':require(_0xd662('0x1a')),'smsQueueReport':require(_0xd662('0x1b')),'faxQueueReport':require(_0xd662('0x1c')),'whatsappQueueReport':require(_0xd662('0x1d'))};var queue=schema({'name':{'type':_0xd662('0x1e'),'required':!![],'message':_0xd662('0x1f')},'timeout':{'type':_0xd662('0x20'),'message':_0xd662('0x21')}});function startRouting(_0x629a4f,_0x5ea85e,_0x3091a8,_0x5ce5fb){if(_0x629a4f&&_0x5ea85e&&_0x3091a8){_0x5ea85e[_0xd662('0x22')]+=0x1;var _0x24f291={'uniqueid':_0x629a4f,'from':_0x3091a8[_0xd662('0x23')]?_0x3091a8['body'][_0xd662('0xd')]:'','joinAt':moment()['format'](_0xd662('0x24')),'ContactId':_0x3091a8['contact']?_0x3091a8[_0xd662('0x25')]['id']:null,'ListId':_0x3091a8[_0xd662('0x26')]?_0x3091a8[_0xd662('0x26')]['id']:null};_0x24f291[_[_0xd662('0x27')](_0x3091a8[_0xd662('0x28')])+_0xd662('0x29')]=_0x5ea85e['id']||null;_0x24f291[_[_0xd662('0x27')](_0x3091a8['channel'])+_0xd662('0x2a')]=_0x3091a8['interaction']?_0x3091a8['interaction']['id']:null;_0x24f291[_['upperFirst'](_0x3091a8[_0xd662('0x28')])+'MessageId']=_0x3091a8[_0xd662('0x2b')]?_0x3091a8[_0xd662('0x2b')]['id']:null;_0x24f291[_[_0xd662('0x27')](_0x3091a8[_0xd662('0x28')])+(_0x3091a8[_0xd662('0x28')]!=='chat'?'AccountId':'WebsiteId')]=_0x3091a8[_0xd662('0x10')]?_0x3091a8[_0xd662('0x10')]['id']:null;logger[_0xd662('0x2c')](util[_0xd662('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x629a4f,_0x5ea85e[_0xd662('0x2d')]));emitChannelQueueInteraction(_0x3091a8[_0xd662('0x28')],_0x5ea85e[_0xd662('0x2d')],_0x24f291,_0x3091a8[_0xd662('0x10')][_0xd662('0x2d')],_0x3091a8[_0xd662('0x2b')]['id'],!![],_0x5ce5fb,_0x5ea85e['id']);if(rpc[_0x3091a8[_0xd662('0x28')]+'QueueReport']){return rpc[_0x3091a8['channel']+'QueueReport'][_0xd662('0x2e')](_0x24f291)[_0xd662('0x2f')](function(_0x246a8d){logger[_0xd662('0x30')](_0xd662('0x31'));});}}}function stopRouting(_0x2082eb,_0x16711a,_0x4e3cc4,_0xd43c91){if(_0x2082eb&&_0x16711a){_0x16711a['waiting']-=0x1;var _0x1f5b9e={'leaveAt':moment()[_0xd662('0x13')](_0xd662('0x24')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xd662('0x32')};logger[_0xd662('0x2c')](util[_0xd662('0x13')](_0xd662('0x33'),_0x2082eb,_0x16711a['name']));emitChannelQueueInteraction(_0x4e3cc4[_0xd662('0x28')],_0x16711a[_0xd662('0x2d')],_0x4e3cc4[_0xd662('0x23')],_0x4e3cc4[_0xd662('0x10')]['name'],_0x4e3cc4[_0xd662('0x2b')]['id'],![],_0xd43c91,_0x16711a['id']);if(rpc[_0x4e3cc4['channel']+'QueueReport']){return rpc[_0x4e3cc4['channel']+_0xd662('0x34')]['update'](_0x2082eb,_0x1f5b9e)[_0xd662('0x2f')](function(_0x4ea9f7){logger[_0xd662('0x30')](_0xd662('0x35'));});}}}function endRouting(_0x4fc625,_0x249512,_0x5333cc,_0x9caaac){if(_0x4fc625&&_0x249512){_0x249512[_0xd662('0x22')]-=0x1;var _0x5afb06={'leaveAt':moment()[_0xd662('0x13')](_0xd662('0x24')),'exitAt':moment()['format'](_0xd662('0x24')),'reason':_0xd662('0x36')};logger[_0xd662('0x2c')](util[_0xd662('0x13')]('[%s][END:QUEUE][NAME:%s]',_0x4fc625,_0x249512['name']));emitChannelQueueInteraction(_0x5333cc[_0xd662('0x28')],_0x249512[_0xd662('0x2d')],_0x5333cc['body'],_0x5333cc[_0xd662('0x10')][_0xd662('0x2d')],_0x5333cc[_0xd662('0x2b')]['id'],![],_0x9caaac);if(rpc[_0x5333cc[_0xd662('0x28')]+_0xd662('0x34')]){return rpc[_0x5333cc[_0xd662('0x28')]+_0xd662('0x34')][_0xd662('0x37')](_0x4fc625,_0x5afb06)['catch'](function(_0x1831fb){logger['error'](_0xd662('0x35'));});}}}function handleFindQueue(_0x1f8fbb){return function(_0xcaae7a){return _0xcaae7a[_0xd662('0x2d')][_0xd662('0x38')]()===_0x1f8fbb[_0xd662('0x38')]();};}exports[_0xd662('0x39')]=function(_0x54ced3,_0x4bfff4,_0x4e2c4c,_0x54fb43){return function(_0x3319b5){try{var _0x32d596={'name':_0x4bfff4[0x0],'timeout':_0x4bfff4[0x1]};var _0x2cf569=queue['validate'](_0x32d596,{'typecast':!![]});if(_0x2cf569[_0xd662('0x3a')]){logger['error'](_0xd662('0x3b'),_0x54ced3,_['map'](_0x2cf569,_0xd662('0x2b'))[_0xd662('0x3c')](',\x20'));_0x3319b5[_0xd662('0x3d')]();}else{var _0x4b9630=_[_0xd662('0x3e')](_0x4e2c4c[_0x54fb43[_0xd662('0x28')]+_0xd662('0x3f')],handleFindQueue(_0x32d596[_0xd662('0x2d')]));if(_0x4b9630){startRouting(_0x54ced3,_0x4b9630,_0x54fb43,_0x4e2c4c);var _0x4a3c3b=(_0x4b9630[_0xd662('0x36')]||0xa)*0x3e8;var _0x2ed532=(_0x32d596[_0xd662('0x36')]||0x14)*0x3e8;var _0x1529da,_0x2548fa;if(_0x4a3c3b>_0x2ed532){_0x2ed532=_0x4a3c3b;}var _0x1bafcb=seqqueue[_0xd662('0x40')](_0x4a3c3b);_0x1bafcb['id']=_0x54ced3;_0x1bafcb[_0xd662('0x41')]=_0x4a3c3b;_0x1bafcb['qtimeout']=_0x2ed532;_0x1bafcb['channel']=_0x54fb43[_0xd662('0x28')];_0x4e2c4c[_0xd662('0x42')][_0x54ced3]['on']('end',function(){logger['info'](_0xd662('0x43'),_0x54ced3);stopRouting(_0x54ced3,_0x4b9630,_0x54fb43,_0x4e2c4c);clearTimeout(_0x1529da);_0x1529da=undefined;_0x1bafcb['close'](!![]);if(_0x4e2c4c[_0xd662('0x42')][_0x54ced3]){delete _0x4e2c4c[_0xd662('0x42')][_0x54ced3];}_0x3319b5[_0xd662('0x3d')]();});_0x4e2c4c['rules'][_0x54ced3]['on'](_0xd662('0x44'),function(){if(_0x4e2c4c[_0xd662('0x42')][_0x54ced3]){delete _0x4e2c4c[_0xd662('0x42')][_0x54ced3];}});_0x1529da=setTimeout(function(){logger[_0xd662('0x2c')](_0xd662('0x45'),_0x54ced3);endRouting(_0x54ced3,_0x4b9630,_0x54fb43,_0x4e2c4c);clearTimeout(_0x1529da);_0x1bafcb[_0xd662('0x46')](!![]);_0x3319b5[_0xd662('0x47')]();},_0x2ed532);switch(_0x4b9630['strategy']){case _0xd662('0x48'):strategy[_0xd662('0x48')](_0x1bafcb,_0x4b9630,_0x4e2c4c,_0x54fb43);break;default:strategy['beepall'](_0x1bafcb,_0x4b9630,_0x4e2c4c,_0x54fb43);}}else{logger[_0xd662('0x30')](_0xd662('0x49'),_0x54ced3,_0x32d596['name']);_0x3319b5['stop']();}}}catch(_0x2a2799){console[_0xd662('0x4a')](_0x2a2799);logger['error'](_0xd662('0x3b'),_0x54ced3,_0x2a2799[_0xd662('0x4b')]);_0x3319b5[_0xd662('0x3d')]();}};}; \ 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 ba68ccc..4d5a866 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 _0x1067=['debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','isAgentAvailable','channel','busy','busyQueue','showNotification','notificationId','writeLog','RINGING','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','agent','push','handleTimeout','bind','timeout','drained','handleDrained','prototype','handleRun'];(function(_0x4f59dd,_0x1d116b){var _0x1abb0c=function(_0x339069){while(--_0x339069){_0x4f59dd['push'](_0x4f59dd['shift']());}};_0x1abb0c(++_0x1d116b);}(_0x1067,0x111));var _0x7106=function(_0x8723de,_0x546272){_0x8723de=_0x8723de-0x0;var _0x2cd17a=_0x1067[_0x8723de];return _0x2cd17a;};'use strict';var _=require(_0x7106('0x0'));var uuid=require(_0x7106('0x1'));var util=require(_0x7106('0x2'));var logger=require(_0x7106('0x3'))(_0x7106('0x4'));var Agent=function(_0x2a7200,_0x59acaa,_0x47079a,_0x1f9941){this['notificationId']=uuid['v4']();this[_0x7106('0x5')]=_0x2a7200;this[_0x7106('0x6')]=_0x59acaa;this['realtime']=_0x47079a;this['routing']=_0x1f9941;this[_0x7106('0x5')][_0x7106('0x7')](this['handleRun']['bind'](this),this[_0x7106('0x8')][_0x7106('0x9')](this));this[_0x7106('0x5')]['on'](_0x7106('0xa'),this['handleTimeout'][_0x7106('0x9')](this));this['squeue']['on'](_0x7106('0xb'),this[_0x7106('0xc')][_0x7106('0x9')](this));};Agent[_0x7106('0xd')][_0x7106('0x7')]=function(){this[_0x7106('0x5')]['push'](this[_0x7106('0xe')][_0x7106('0x9')](this),this['handleTimeout'][_0x7106('0x9')](this));};Agent[_0x7106('0xd')][_0x7106('0xc')]=function(){this[_0x7106('0x8')](!![]);};Agent[_0x7106('0xd')][_0x7106('0xe')]=function(){logger[_0x7106('0xf')](_0x7106('0x10'),this[_0x7106('0x5')]['id'],this[_0x7106('0x6')]['id']);if(_[_0x7106('0x11')](this[_0x7106('0x12')][_0x7106('0x13')][this[_0x7106('0x6')]['id']])){logger[_0x7106('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x7106('0x5')]['id'],this[_0x7106('0x6')]['id']);setTimeout(this['push'][_0x7106('0x9')](this),0x3e8);}else{if(this[_0x7106('0x4')]['forcedOwnership']||util[_0x7106('0x14')](this[_0x7106('0x5')]['id'],this[_0x7106('0x12')][_0x7106('0x13')][this[_0x7106('0x6')]['id']],this[_0x7106('0x5')][_0x7106('0x15')],![])){this[_0x7106('0x12')][_0x7106('0x13')][this[_0x7106('0x6')]['id']][_0x7106('0x16')]=!![];this[_0x7106('0x12')]['agents'][this[_0x7106('0x6')]['id']][_0x7106('0x17')]=undefined;util[_0x7106('0x18')](this[_0x7106('0x19')],this[_0x7106('0x5')]['id'],this[_0x7106('0x12')]['agents'][this[_0x7106('0x6')]['id']],null,this[_0x7106('0x4')]);util[_0x7106('0x1a')](this[_0x7106('0x5')]['id'],this['realtime'][_0x7106('0x13')][this['agent']['id']],_0x7106('0x1b')+(this['routing'][_0x7106('0x1c')]?':FORCED':''));}else{logger[_0x7106('0xf')](_0x7106('0x1d'),this[_0x7106('0x5')]['id'],this[_0x7106('0x6')]['id']);setTimeout(this[_0x7106('0x7')][_0x7106('0x9')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x1aa96c){if(_[_0x7106('0x11')](this[_0x7106('0x12')][_0x7106('0x13')][this[_0x7106('0x6')]['id']])){return logger[_0x7106('0xf')](_0x7106('0x1e'),this['squeue']['id'],this[_0x7106('0x6')]['id']);}else{logger[_0x7106('0xf')](_0x7106('0x1f'),this[_0x7106('0x5')]['id'],this[_0x7106('0x6')]['id']);util[_0x7106('0x20')](this[_0x7106('0x19')],this['squeue']['id'],this[_0x7106('0x12')][_0x7106('0x13')][this['agent']['id']],null,this[_0x7106('0x4')]);this['realtime'][_0x7106('0x13')][this[_0x7106('0x6')]['id']][_0x7106('0x16')]=![];this[_0x7106('0x12')]['agents'][this['agent']['id']][_0x7106('0x17')]=undefined;util[_0x7106('0x1a')](this[_0x7106('0x5')]['id'],this[_0x7106('0x12')][_0x7106('0x13')][this['agent']['id']],_0x1aa96c?_0x7106('0x21'):_0x7106('0x22'));}if(!_0x1aa96c){setTimeout(this[_0x7106('0x7')][_0x7106('0x9')](this),0x3e8);}};function agent(_0x132f86,_0x4d3cdd,_0x43354d,_0x50557e){return new Agent(_0x132f86,_0x4d3cdd,_0x43354d,_0x50557e);}module[_0x7106('0x23')]=agent; \ No newline at end of file +var _0x0a94=['writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','bind','timeout','handleTimeout','drained','handleDrained','prototype','push','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busyQueue','showNotification'];(function(_0xaecb46,_0x2d5e3d){var _0x27e4fd=function(_0x3d61c2){while(--_0x3d61c2){_0xaecb46['push'](_0xaecb46['shift']());}};_0x27e4fd(++_0x2d5e3d);}(_0x0a94,0x139));var _0x40a9=function(_0x96dc84,_0x4cc9a3){_0x96dc84=_0x96dc84-0x0;var _0xb5baed=_0x0a94[_0x96dc84];return _0xb5baed;};'use strict';var _=require(_0x40a9('0x0'));var uuid=require(_0x40a9('0x1'));var util=require(_0x40a9('0x2'));var logger=require(_0x40a9('0x3'))(_0x40a9('0x4'));var Agent=function(_0x33cc41,_0x11eca6,_0x13677b,_0xa37e35){this[_0x40a9('0x5')]=uuid['v4']();this[_0x40a9('0x6')]=_0x33cc41;this[_0x40a9('0x7')]=_0x11eca6;this[_0x40a9('0x8')]=_0x13677b;this['routing']=_0xa37e35;this[_0x40a9('0x6')]['push'](this['handleRun'][_0x40a9('0x9')](this),this['handleTimeout'][_0x40a9('0x9')](this));this['squeue']['on'](_0x40a9('0xa'),this[_0x40a9('0xb')][_0x40a9('0x9')](this));this[_0x40a9('0x6')]['on'](_0x40a9('0xc'),this[_0x40a9('0xd')][_0x40a9('0x9')](this));};Agent[_0x40a9('0xe')][_0x40a9('0xf')]=function(){this['squeue'][_0x40a9('0xf')](this[_0x40a9('0x10')][_0x40a9('0x9')](this),this[_0x40a9('0xb')]['bind'](this));};Agent[_0x40a9('0xe')][_0x40a9('0xd')]=function(){this[_0x40a9('0xb')](!![]);};Agent[_0x40a9('0xe')][_0x40a9('0x10')]=function(){logger[_0x40a9('0x11')](_0x40a9('0x12'),this[_0x40a9('0x6')]['id'],this[_0x40a9('0x7')]['id']);if(_[_0x40a9('0x13')](this['realtime'][_0x40a9('0x14')][this['agent']['id']])){logger[_0x40a9('0x11')](_0x40a9('0x15'),this['squeue']['id'],this[_0x40a9('0x7')]['id']);setTimeout(this[_0x40a9('0xf')][_0x40a9('0x9')](this),0x3e8);}else{if(this['routing'][_0x40a9('0x16')]||util[_0x40a9('0x17')](this[_0x40a9('0x6')]['id'],this[_0x40a9('0x8')][_0x40a9('0x14')][this['agent']['id']],this[_0x40a9('0x6')][_0x40a9('0x18')],![])){this['realtime'][_0x40a9('0x14')][this[_0x40a9('0x7')]['id']]['busy']=!![];this['realtime'][_0x40a9('0x14')][this[_0x40a9('0x7')]['id']][_0x40a9('0x19')]=undefined;util[_0x40a9('0x1a')](this['notificationId'],this[_0x40a9('0x6')]['id'],this[_0x40a9('0x8')][_0x40a9('0x14')][this['agent']['id']],null,this[_0x40a9('0x4')]);util[_0x40a9('0x1b')](this['squeue']['id'],this[_0x40a9('0x8')][_0x40a9('0x14')][this[_0x40a9('0x7')]['id']],_0x40a9('0x1c')+(this[_0x40a9('0x4')][_0x40a9('0x16')]?_0x40a9('0x1d'):''));}else{logger[_0x40a9('0x11')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x40a9('0x6')]['id'],this[_0x40a9('0x7')]['id']);setTimeout(this['push'][_0x40a9('0x9')](this),0x3e8);}}};Agent[_0x40a9('0xe')][_0x40a9('0xb')]=function(_0x1f8192){if(_['isNil'](this[_0x40a9('0x8')][_0x40a9('0x14')][this[_0x40a9('0x7')]['id']])){return logger[_0x40a9('0x11')](_0x40a9('0x15'),this[_0x40a9('0x6')]['id'],this[_0x40a9('0x7')]['id']);}else{logger[_0x40a9('0x11')](_0x40a9('0x1e'),this[_0x40a9('0x6')]['id'],this['agent']['id']);util['hideNotification'](this[_0x40a9('0x5')],this[_0x40a9('0x6')]['id'],this[_0x40a9('0x8')][_0x40a9('0x14')][this[_0x40a9('0x7')]['id']],null,this[_0x40a9('0x4')]);this[_0x40a9('0x8')][_0x40a9('0x14')][this['agent']['id']]['busy']=![];this['realtime'][_0x40a9('0x14')][this[_0x40a9('0x7')]['id']]['busyQueue']=undefined;util[_0x40a9('0x1b')](this[_0x40a9('0x6')]['id'],this[_0x40a9('0x8')][_0x40a9('0x14')][this[_0x40a9('0x7')]['id']],_0x1f8192?_0x40a9('0x1f'):_0x40a9('0x20'));}if(!_0x1f8192){setTimeout(this[_0x40a9('0xf')][_0x40a9('0x9')](this),0x3e8);}};function agent(_0x311438,_0x511b19,_0xfe905e,_0x1b882c){return new Agent(_0x311438,_0x511b19,_0xfe905e,_0x1b882c);}module[_0x40a9('0x21')]=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 5fda23f..ffd12ee 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 _0xea70=['uuid','./util','routing','notificationId','squeue','queue','realtime','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','handleRun','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','exports','lodash'];(function(_0x12b7e3,_0x3bab06){var _0x131288=function(_0x21400b){while(--_0x21400b){_0x12b7e3['push'](_0x12b7e3['shift']());}};_0x131288(++_0x3bab06);}(_0xea70,0x175));var _0x0ea7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xea70[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x0ea7('0x0'));var uuid=require(_0x0ea7('0x1'));var util=require(_0x0ea7('0x2'));var logger=require('../../../../../config/logger')(_0x0ea7('0x3'));var Beepall=function(_0x499815,_0x2fad00,_0x4f3347,_0x425623){this[_0x0ea7('0x4')]=uuid['v4']();this[_0x0ea7('0x5')]=_0x499815;this[_0x0ea7('0x6')]=_0x2fad00;this[_0x0ea7('0x7')]=_0x4f3347;this['routing']=_0x425623;this[_0x0ea7('0x5')][_0x0ea7('0x8')](this['handleRun'][_0x0ea7('0x9')](this),this[_0x0ea7('0xa')]['bind'](this));this[_0x0ea7('0x5')]['on'](_0x0ea7('0xb'),this[_0x0ea7('0xa')][_0x0ea7('0x9')](this));this['squeue']['on'](_0x0ea7('0xc'),this[_0x0ea7('0xd')][_0x0ea7('0x9')](this));};Beepall[_0x0ea7('0xe')][_0x0ea7('0x8')]=function(){this['squeue'][_0x0ea7('0x8')](this[_0x0ea7('0xf')][_0x0ea7('0x9')](this),this['handleTimeout']['bind'](this));};Beepall['prototype'][_0x0ea7('0xd')]=function(){this[_0x0ea7('0xa')](!![]);};Beepall[_0x0ea7('0xe')][_0x0ea7('0xf')]=function(){var _0x4e1cd9=!![];if(!_['isNil'](this['queue'])&&!_[_0x0ea7('0x10')](this[_0x0ea7('0x6')][_0x0ea7('0x11')])&&this['queue']['Agents'][_0x0ea7('0x12')]>0x0){for(var _0x2aa4e9=0x0,_0x2f1850;_0x2aa4e90x0){for(var _0xb08628=0x0,_0x5da535;_0xb086280x0&&_0x5ab79a[_0x58270c+_0x77da('0x23')]>=_0x5ab79a[_0x58270c+_0x77da('0x22')]){writeLog(_0x24aa8a,_0x5ab79a,_0x58270c[_0x77da('0x24')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x77da('0x25')]=function(_0x167240,_0x470c9f,_0x36115b,_0x446ae7,_0x5997b6){return sendNotification(!![],_0x167240,_0x470c9f,_0x36115b,_0x446ae7,_0x5997b6);};exports[_0x77da('0x26')]=function(_0x3e090d,_0x1f2279,_0x2913f7,_0x496ecd,_0x5b4638){return sendNotification(![],_0x3e090d,_0x1f2279,_0x2913f7,_0x496ecd,_0x5b4638);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x7da7=['routing','defaults','redis','socket.io-emitter','format','user:%s','emit','user:save','split','\x20interaction','name','notificationSound','account','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','notification:%s','save','remove','debug','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','lodash','util','../utils','../../../../../config/logger'];(function(_0x4a9069,_0x4692f7){var _0x48903c=function(_0x5415df){while(--_0x5415df){_0x4a9069['push'](_0x4a9069['shift']());}};_0x48903c(++_0x4692f7);}(_0x7da7,0x10d));var _0x77da=function(_0x199b1f,_0x4ed849){_0x199b1f=_0x199b1f-0x0;var _0x267ac9=_0x7da7[_0x199b1f];return _0x267ac9;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var utils=require(_0x77da('0x2'));var Redis=require('ioredis');var config=require('../../../../../config/environment');var logger=require(_0x77da('0x3'))(_0x77da('0x4'));config['redis']=_[_0x77da('0x5')](config[_0x77da('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x77da('0x7'))(new Redis(config[_0x77da('0x6')]));function sendNotification(_0x47da81,_0x30afe0,_0x47cf1d,_0x1191de,_0x13992e,_0x37c5ab){io['to'](util[_0x77da('0x8')](_0x77da('0x9'),_0x1191de['name']))[_0x77da('0xa')](_0x77da('0xb'),_0x1191de);var _0x172d7f=_0x37c5ab||{};var _0x5ea12f=_0x47cf1d[_0x77da('0xc')]('.');var _0x1ab717={'uniqueid':_0x30afe0,'channel':_0x5ea12f[0x0],'id':_0x5ea12f[0x1],'title':_0x5ea12f[0x0]+_0x77da('0xd'),'interactionId':_0x5ea12f[0x2],'queue':_0x13992e?_0x13992e[_0x77da('0xe')]:null,'sound':_0x172d7f['account'][_0x77da('0xf')],'shake':_0x172d7f[_0x77da('0x10')][_0x77da('0x11')]};try{if(!_0x172d7f['body']){_0x172d7f['body']={};}if(_0x13992e){_0x172d7f[_0x77da('0x12')][_0x77da('0x13')]=_0x13992e;}else if(_0x172d7f['body'][_0x77da('0x13')]){delete _0x172d7f[_0x77da('0x12')][_0x77da('0x13')];}_0x1ab717[_0x77da('0x14')]=utils['getMustacheRender'](_0x172d7f[_0x77da('0x10')]['notificationTemplate'],_0x172d7f);}catch(_0x29cd7b){_0x1ab717[_0x77da('0x14')]=_0x77da('0x15');logger[_0x77da('0x16')](util['format']('[%s][QUEUE]\x20%s',_0x30afe0,_0x29cd7b['message']));}io['to'](util['format'](_0x77da('0x9'),_0x1191de[_0x77da('0xe')]))[_0x77da('0xa')](util[_0x77da('0x8')](_0x77da('0x17'),_0x47da81?_0x77da('0x18'):_0x77da('0x19')),_0x1ab717);}function writeLog(_0x3b6dde,_0x544104,_0x492063){return logger[_0x77da('0x1a')](util[_0x77da('0x8')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x3b6dde,_0x544104[_0x77da('0xe')],_0x492063));}exports[_0x77da('0x1b')]=function(_0x24aa8a,_0x5ab79a,_0x58270c,_0x3e6cfe){if(_0x5ab79a['busy']){writeLog(_0x24aa8a,_0x5ab79a,_0x77da('0x1c'));return![];}if(!_0x5ab79a[_0x77da('0x1d')]){writeLog(_0x24aa8a,_0x5ab79a,_0x77da('0x1e'));return![];}if(_0x5ab79a[_0x58270c+_0x77da('0x1f')]){writeLog(_0x24aa8a,_0x5ab79a,_0x77da('0x20'));return![];}if(_0x3e6cfe&&_0x5ab79a[_0x77da('0x21')](_0x58270c+_0x77da('0x22'))&&_0x5ab79a['hasOwnProperty'](_0x58270c+'CurrentCapacity')){if(_0x5ab79a[_0x58270c+_0x77da('0x22')]>0x0&&_0x5ab79a[_0x58270c+_0x77da('0x23')]>=_0x5ab79a[_0x58270c+_0x77da('0x22')]){writeLog(_0x24aa8a,_0x5ab79a,_0x58270c[_0x77da('0x24')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x77da('0x25')]=function(_0x167240,_0x470c9f,_0x36115b,_0x446ae7,_0x5997b6){return sendNotification(!![],_0x167240,_0x470c9f,_0x36115b,_0x446ae7,_0x5997b6);};exports[_0x77da('0x26')]=function(_0x3e090d,_0x1f2279,_0x2913f7,_0x496ecd,_0x5b4638){return sendNotification(![],_0x3e090d,_0x1f2279,_0x2913f7,_0x496ecd,_0x5b4638);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 37f8fa8..0f91979 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 _0xa870=['../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','isObject','stringify','validate','./utils'];(function(_0x52b5d7,_0x19f495){var _0x4ed889=function(_0x2a0b30){while(--_0x2a0b30){_0x52b5d7['push'](_0x52b5d7['shift']());}};_0x4ed889(++_0x19f495);}(_0xa870,0x143));var _0x0a87=function(_0x16196f,_0x11f7bc){_0x16196f=_0x16196f-0x0;var _0x2c48d7=_0xa870[_0x16196f];return _0x2c48d7;};'use strict';var schema=require(_0x0a87('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require(_0x0a87('0x1'));var logger=require(_0x0a87('0x2'))(_0x0a87('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x0a87('0x4')}});exports['consequence']=function(_0x46782a,_0x54e9a3){return function(_0x5bcfaa){try{var _0x2ea611={'command':_0x54e9a3[0x0]};var _0x30235a=system[_0x0a87('0x0')](_0x2ea611,{'typecast':!![]});if(_0x30235a[_0x0a87('0x5')]){logger['error'](_0x0a87('0x6'),_0x46782a,_['map'](_0x30235a,_0x0a87('0x7'))[_0x0a87('0x8')](',\x20'));logger[_0x0a87('0x9')](_0x0a87('0xa'),_0x46782a);_0x5bcfaa['next']();}else{var _0x4ae3d6=this;var _0x37adae=utils[_0x0a87('0xb')](_0x54e9a3[0x0],this);logger[_0x0a87('0x9')](_0x0a87('0xc'),_0x46782a,_0x37adae);sh[_0x0a87('0xd')](_[_0x0a87('0xe')](_0x37adae),function(_0x10c463,_0x5a6c36){logger[_0x0a87('0x9')](_0x0a87('0xf'),_0x46782a,_0x10c463);if(_0x10c463==0x0){var _0x1d8c76=_0x5a6c36[_0x0a87('0x10')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x54e9a3[0x1])||_[_0x0a87('0x11')](_0x54e9a3[0x1])){logger[_0x0a87('0x9')](_0x0a87('0x12'),_0x46782a);_0x4ae3d6[_0x0a87('0x13')][_0x54e9a3[0x1]]=_0x1d8c76;}else{logger[_0x0a87('0x9')](_0x0a87('0x14'),_0x46782a,_0x54e9a3[0x1],_0x1d8c76);_0x4ae3d6[_0x0a87('0x13')][_0x54e9a3[0x1]]=_0x1d8c76;}}_0x5bcfaa[_0x0a87('0x15')]();});}}catch(_0x3465a9){logger[_0x0a87('0x16')](_0x0a87('0x6'),_0x46782a,_[_0x0a87('0x17')](_0x3465a9)?JSON[_0x0a87('0x18')](_0x3465a9):_0x3465a9);logger['info'](_0x0a87('0xa'),_0x46782a);_0x5bcfaa[_0x0a87('0x15')]();}};}; \ No newline at end of file +var _0x2227=['length','[%s][SYSTEM]\x20%s','join','next','info','exec','replace','isNil','isEmpty','body','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x102b88,_0x5ee0d9){var _0x296563=function(_0x5c1642){while(--_0x5c1642){_0x102b88['push'](_0x102b88['shift']());}};_0x296563(++_0x5ee0d9);}(_0x2227,0x103));var _0x7222=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0x2227[_0x3c5f8d];return _0x3b7beb;};'use strict';var schema=require('validate');var sh=require(_0x7222('0x0'));var _=require(_0x7222('0x1'));var utils=require(_0x7222('0x2'));var logger=require(_0x7222('0x3'))('routing');var system=schema({'command':{'type':_0x7222('0x4'),'required':!![],'message':_0x7222('0x5')}});exports[_0x7222('0x6')]=function(_0x494e85,_0x482250){return function(_0x475641){try{var _0x5cdc96={'command':_0x482250[0x0]};var _0x5240fb=system['validate'](_0x5cdc96,{'typecast':!![]});if(_0x5240fb[_0x7222('0x7')]){logger['error'](_0x7222('0x8'),_0x494e85,_['map'](_0x5240fb,'message')[_0x7222('0x9')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x494e85);_0x475641[_0x7222('0xa')]();}else{var _0x5521df=this;var _0x33a1fc=utils['getMustacheRender'](_0x482250[0x0],this);logger[_0x7222('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x494e85,_0x33a1fc);sh[_0x7222('0xc')](_['trim'](_0x33a1fc),function(_0x51640d,_0x42b76a){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x494e85,_0x51640d);if(_0x51640d==0x0){var _0x4a5af3=_0x42b76a[_0x7222('0xd')](/(\r\n|\n|\r)/gm,'');if(_[_0x7222('0xe')](_0x482250[0x1])||_[_0x7222('0xf')](_0x482250[0x1])){logger[_0x7222('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x494e85);_0x5521df['body'][_0x482250[0x1]]=_0x4a5af3;}else{logger[_0x7222('0xb')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x494e85,_0x482250[0x1],_0x4a5af3);_0x5521df[_0x7222('0x10')][_0x482250[0x1]]=_0x4a5af3;}}_0x475641['next']();});}}catch(_0x5170a4){logger['error'](_0x7222('0x8'),_0x494e85,_['isObject'](_0x5170a4)?JSON[_0x7222('0x11')](_0x5170a4):_0x5170a4);logger[_0x7222('0xb')](_0x7222('0x12'),_0x494e85);_0x475641[_0x7222('0xa')]();}};}; \ 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 3e6de9e..2fe11bd 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 _0xa41b=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','catch','stringify','finally','isObject','lodash','../../rpc/chatInteraction'];(function(_0xc42089,_0x3e7506){var _0x31ff67=function(_0x30efba){while(--_0x30efba){_0xc42089['push'](_0xc42089['shift']());}};_0x31ff67(++_0x3e7506);}(_0xa41b,0xe6));var _0xba41=function(_0x5bb4e8,_0x44b756){_0x5bb4e8=_0x5bb4e8-0x0;var _0x2a86f2=_0xa41b[_0x5bb4e8];return _0x2a86f2;};'use strict';var schema=require('validate');var _=require(_0xba41('0x0'));var rpc={'chatInteraction':require(_0xba41('0x1')),'openchannelInteraction':require(_0xba41('0x2')),'smsInteraction':require(_0xba41('0x3')),'mailInteraction':require(_0xba41('0x4')),'faxInteraction':require(_0xba41('0x5')),'whatsappInteraction':require(_0xba41('0x6'))};var logger=require('../../../../config/logger')(_0xba41('0x7'));var tag=schema({'tag':{'type':_0xba41('0x8'),'required':!![],'message':_0xba41('0x9')}});exports[_0xba41('0xa')]=function(_0x1e8629,_0x4c7969,_0xc39fdf,_0x236308){return function(_0x108246){try{var _0x4e74ad={'tag':_0x4c7969[0x0]};var _0x5c1574=tag[_0xba41('0xb')](_0x4e74ad,{'typecast':!![]});if(_0x5c1574[_0xba41('0xc')]){logger[_0xba41('0xd')](_0xba41('0xe'),_0x1e8629,_[_0xba41('0xf')](_0x5c1574,'message')[_0xba41('0x10')](',\x20'));logger[_0xba41('0x11')](_0xba41('0x12'),_0x1e8629);_0x108246[_0xba41('0x13')]();}else{var _0x10a829={'ids':[_0x4c7969[0x0]]};if(rpc[_0x236308[_0xba41('0x14')]+_0xba41('0x15')]){rpc[_0x236308[_0xba41('0x14')]+_0xba41('0x15')][_0xba41('0x16')](_0x236308[_0xba41('0x17')]['id'],_0x10a829)[_0xba41('0x18')](function(_0x5bcabd){logger[_0xba41('0x11')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x1e8629,_0x4c7969[0x1],_0x236308[_0xba41('0x14')],_0x236308['interaction']['id']);})[_0xba41('0x19')](function(_0x2d8849){logger[_0xba41('0xd')](_0xba41('0xe'),_0x1e8629,JSON[_0xba41('0x1a')](_0x2d8849));logger[_0xba41('0x11')](_0xba41('0x12'),_0x1e8629);})[_0xba41('0x1b')](function(){_0x108246[_0xba41('0x13')]();});}}}catch(_0x4c56c2){logger[_0xba41('0xd')](_0xba41('0xe'),_0x1e8629,_[_0xba41('0x1c')](_0x4c56c2)?JSON['stringify'](_0x4c56c2):_0x4c56c2);logger[_0xba41('0x11')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1e8629);_0x108246[_0xba41('0x13')]();}};}; \ No newline at end of file +var _0x7f77=['stringify','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch'];(function(_0xf24f30,_0x77205b){var _0x364bea=function(_0x562a10){while(--_0x562a10){_0xf24f30['push'](_0xf24f30['shift']());}};_0x364bea(++_0x77205b);}(_0x7f77,0xca));var _0x77f7=function(_0x4da807,_0x55812b){_0x4da807=_0x4da807-0x0;var _0x5d7533=_0x7f77[_0x4da807];return _0x5d7533;};'use strict';var schema=require(_0x77f7('0x0'));var _=require(_0x77f7('0x1'));var rpc={'chatInteraction':require(_0x77f7('0x2')),'openchannelInteraction':require(_0x77f7('0x3')),'smsInteraction':require(_0x77f7('0x4')),'mailInteraction':require(_0x77f7('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x77f7('0x6'))(_0x77f7('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x77f7('0x8')}});exports[_0x77f7('0x9')]=function(_0x4ff62c,_0x18bf56,_0x3106dd,_0x49fe07){return function(_0x35af39){try{var _0x25b62c={'tag':_0x18bf56[0x0]};var _0x5a3cba=tag[_0x77f7('0x0')](_0x25b62c,{'typecast':!![]});if(_0x5a3cba[_0x77f7('0xa')]){logger[_0x77f7('0xb')](_0x77f7('0xc'),_0x4ff62c,_[_0x77f7('0xd')](_0x5a3cba,'message')[_0x77f7('0xe')](',\x20'));logger[_0x77f7('0xf')](_0x77f7('0x10'),_0x4ff62c);_0x35af39[_0x77f7('0x11')]();}else{var _0x265266={'ids':[_0x18bf56[0x0]]};if(rpc[_0x49fe07['channel']+_0x77f7('0x12')]){rpc[_0x49fe07[_0x77f7('0x13')]+_0x77f7('0x12')]['addTags'](_0x49fe07[_0x77f7('0x14')]['id'],_0x265266)['then'](function(_0x5bc5c6){logger[_0x77f7('0xf')](_0x77f7('0x15'),_0x4ff62c,_0x18bf56[0x1],_0x49fe07[_0x77f7('0x13')],_0x49fe07[_0x77f7('0x14')]['id']);})[_0x77f7('0x16')](function(_0x46e9bc){logger[_0x77f7('0xb')](_0x77f7('0xc'),_0x4ff62c,JSON[_0x77f7('0x17')](_0x46e9bc));logger['info'](_0x77f7('0x10'),_0x4ff62c);})[_0x77f7('0x18')](function(){_0x35af39[_0x77f7('0x11')]();});}}}catch(_0x1ca1c2){logger[_0x77f7('0xb')](_0x77f7('0xc'),_0x4ff62c,_['isObject'](_0x1ca1c2)?JSON['stringify'](_0x1ca1c2):_0x1ca1c2);logger[_0x77f7('0xf')](_0x77f7('0x10'),_0x4ff62c);_0x35af39['next']();}};}; \ 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 54ce6bb..72a96b9 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 _0x2d9a=['parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','stringify','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','info','next','request-promise','lodash','consequence','replace','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','POST','then'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x2d9a,0x113));var _0xa2d9=function(_0x235186,_0xf3fdc2){_0x235186=_0x235186-0x0;var _0x103007=_0x2d9a[_0x235186];return _0x103007;};'use strict';var rp=require(_0xa2d9('0x0'));var logger=require('../../../../config/logger')('routing');var _=require(_0xa2d9('0x1'));var arr=[];exports[_0xa2d9('0x2')]=function(_0x55e579,_0x52e65f){return function(_0x241cc1){var _0x18bb34=_0x52e65f[0xa];var _0x22729a=_0x52e65f[0xb];var _0x251955=_0x52e65f[0xc];var _0x1c46b2=_0x52e65f[0xd];var _0x44e6ff=_0x52e65f[0xe];var _0x189685=_0x52e65f[0xf][_0xa2d9('0x3')](/\n/g,_0xa2d9('0x4'));var _0x6d53be=_0x52e65f[0x10][_0xa2d9('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x22729a)){arr[_0xa2d9('0x5')](_0x22729a);var _0x53c14b=_0x52e65f[0x3];var _0x2b0688=_0x52e65f[0x4];var _0x5b67b7=_0x52e65f[0x1];var _0x1e4a1e=_0x52e65f[0x0];var _0x5a9d47={};_0x5a9d47[_0xa2d9('0x6')]=_0x52e65f[0x8]+_0xa2d9('0x7')+_0x251955+'|'+_0x18bb34+'|'+_0x1c46b2+'|'+_0x22729a+'|'+_0x44e6ff;_0x5a9d47[_0xa2d9('0x8')]=_0x52e65f[0x7]+_0xa2d9('0x7')+_0x251955+'|'+_0x18bb34+'|'+_0x1c46b2+'|'+_0x22729a+'|'+_0x44e6ff+'|'+_0x189685+'|'+_0x6d53be;_0x5a9d47[_0xa2d9('0x9')]=_0x52e65f[0x9];var _0x12b85d={};_0x12b85d[_0xa2d9('0xa')]=_0xa2d9('0xb');_0x12b85d[_0xa2d9('0xc')]='login';var _0xa5d487=[];_0xa5d487[_0xa2d9('0x5')](_0x52e65f[0x2]);_0xa5d487[_0xa2d9('0x5')](_0x52e65f[0x5]);_0xa5d487['push'](_0x52e65f[0x6]);_0x12b85d['params']=_0xa5d487;_0x12b85d['id']=0x1;var _0x3833ac=JSON['stringify'](_0x12b85d);var _0x12783e={'encoding':'utf8','method':_0xa2d9('0xd'),'timeout':0x2710,'url':_0x53c14b,'headers':{'Content-Type':'application/json-rpc'},'body':_0x3833ac};return rp(_0x12783e)[_0xa2d9('0xe')](function(_0x5c2f19){const _0x4ac561=JSON[_0xa2d9('0xf')](_0x5c2f19);if(!_0x4ac561[_0xa2d9('0x10')]['logged']){throw new Error(_0xa2d9('0x11'));}var _0x31a16d=_0x22729a;var _0x411b7a=_0xa2d9('0x12')+_0x5b67b7+_0xa2d9('0x13')+_0x1e4a1e+_0xa2d9('0x14')+_0x31a16d+'&data='+JSON[_0xa2d9('0x15')](_0x5a9d47);var _0x45be67=_0x2b0688+'?'+_0x411b7a;return rp(_0x45be67);})[_0xa2d9('0xe')](function(_0x4ae78f){logger['info'](_0xa2d9('0x16'),_0x55e579,_0x4ae78f);_0x241cc1[_0xa2d9('0x17')]();})[_0xa2d9('0x18')](function(_0x1a0afe){logger[_0xa2d9('0x19')]('[%s][TVOX]\x20%s',_0x55e579,_[_0xa2d9('0x1a')](_0x1a0afe)?JSON['stringify'](_0x1a0afe):_0x1a0afe);_0x241cc1['stop']();});}else{logger[_0xa2d9('0x1b')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x55e579);_0x241cc1[_0xa2d9('0x1c')]();}};}; \ No newline at end of file +var _0x14f2=['application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','next','request-promise','../../../../config/logger','routing','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','title','jsonrpc','login','params','stringify','utf8','POST'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x14f2,0x1cb));var _0x214f=function(_0x5b8188,_0x362809){_0x5b8188=_0x5b8188-0x0;var _0x329b05=_0x14f2[_0x5b8188];return _0x329b05;};'use strict';var rp=require(_0x214f('0x0'));var logger=require(_0x214f('0x1'))(_0x214f('0x2'));var _=require('lodash');var arr=[];exports[_0x214f('0x3')]=function(_0x1aa1ab,_0x3945bd){return function(_0x5676f9){var _0xadcd86=_0x3945bd[0xa];var _0x32b122=_0x3945bd[0xb];var _0x467724=_0x3945bd[0xc];var _0x576506=_0x3945bd[0xd];var _0x2a555d=_0x3945bd[0xe];var _0x4ec7aa=_0x3945bd[0xf][_0x214f('0x4')](/\n/g,_0x214f('0x5'));var _0x30b082=_0x3945bd[0x10][_0x214f('0x4')](/\n/g,'\x20');if(!arr[_0x214f('0x6')](_0x32b122)){arr[_0x214f('0x7')](_0x32b122);var _0x4e0a11=_0x3945bd[0x3];var _0xf1fce4=_0x3945bd[0x4];var _0x276ec9=_0x3945bd[0x1];var _0x1d2d17=_0x3945bd[0x0];var _0x3f6ea1={};_0x3f6ea1[_0x214f('0x8')]=_0x3945bd[0x8]+_0x214f('0x9')+_0x467724+'|'+_0xadcd86+'|'+_0x576506+'|'+_0x32b122+'|'+_0x2a555d;_0x3f6ea1['urlOnRing']=_0x3945bd[0x7]+_0x214f('0x9')+_0x467724+'|'+_0xadcd86+'|'+_0x576506+'|'+_0x32b122+'|'+_0x2a555d+'|'+_0x4ec7aa+'|'+_0x30b082;_0x3f6ea1[_0x214f('0xa')]=_0x3945bd[0x9];var _0x4a9bb2={};_0x4a9bb2[_0x214f('0xb')]='2.0';_0x4a9bb2['method']=_0x214f('0xc');var _0x4f2e2c=[];_0x4f2e2c[_0x214f('0x7')](_0x3945bd[0x2]);_0x4f2e2c['push'](_0x3945bd[0x5]);_0x4f2e2c[_0x214f('0x7')](_0x3945bd[0x6]);_0x4a9bb2[_0x214f('0xd')]=_0x4f2e2c;_0x4a9bb2['id']=0x1;var _0x11c40e=JSON[_0x214f('0xe')](_0x4a9bb2);var _0x56a9d2={'encoding':_0x214f('0xf'),'method':_0x214f('0x10'),'timeout':0x2710,'url':_0x4e0a11,'headers':{'Content-Type':_0x214f('0x11')},'body':_0x11c40e};return rp(_0x56a9d2)[_0x214f('0x12')](function(_0x4dbb86){const _0x59c326=JSON[_0x214f('0x13')](_0x4dbb86);if(!_0x59c326[_0x214f('0x14')][_0x214f('0x15')]){throw new Error(_0x214f('0x16'));}var _0x3dfc18=_0x32b122;var _0x2bc522=_0x214f('0x17')+_0x276ec9+_0x214f('0x18')+_0x1d2d17+_0x214f('0x19')+_0x3dfc18+_0x214f('0x1a')+JSON['stringify'](_0x3f6ea1);var _0x29fce2=_0xf1fce4+'?'+_0x2bc522;return rp(_0x29fce2);})['then'](function(_0x3b4fc7){logger[_0x214f('0x1b')](_0x214f('0x1c'),_0x1aa1ab,_0x3b4fc7);_0x5676f9[_0x214f('0x1d')]();})[_0x214f('0x1e')](function(_0x58af6b){logger[_0x214f('0x1f')](_0x214f('0x20'),_0x1aa1ab,_['isObject'](_0x58af6b)?JSON['stringify'](_0x58af6b):_0x58af6b);_0x5676f9[_0x214f('0x1d')]();});}else{logger[_0x214f('0x1b')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x1aa1ab);_0x5676f9[_0x214f('0x21')]();}};}; \ 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 590d571..fc5b772 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 _0x9c44=['merge','body','account','list','exports','render'];(function(_0x263e61,_0x4b9567){var _0x104ce4=function(_0xa86ab6){while(--_0xa86ab6){_0x263e61['push'](_0x263e61['shift']());}};_0x104ce4(++_0x4b9567);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x5efb15,_0x2e13c7){var _0x1fc197=function(_0x20da08){while(--_0x20da08){_0x5efb15['push'](_0x5efb15['shift']());}};_0x1fc197(++_0x2e13c7);}(_0xe706,0xa3));var _0x6e70=function(_0x15ee41,_0x9275d8){_0x15ee41=_0x15ee41-0x0;var _0x2b2846=_0xe706[_0x15ee41];return _0x2b2846;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 4d1393f..43ea908 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 _0xd64b=['RPC\x20listening\x20on\x20port:','lodash','path','bluebird','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','autoreply','appdata','split','push','dialogflow','slice','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','condition','intervals','./applications/','info','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','stack','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!'];(function(_0x248e93,_0x31dab5){var _0x4a0f8a=function(_0x5cf29d){while(--_0x5cf29d){_0x248e93['push'](_0x248e93['shift']());}};_0x4a0f8a(++_0x31dab5);}(_0xd64b,0xc1));var _0xbd64=function(_0x1753e0,_0x32ccd4){_0x1753e0=_0x1753e0-0x0;var _0xc9f908=_0xd64b[_0x1753e0];return _0xc9f908;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var path=require(_0xbd64('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xbd64('0x2'));var utils=require(_0xbd64('0x3'));var logger=require(_0xbd64('0x4'))(_0xbd64('0x5'));var rpc={'openchannelQueueReport':require(_0xbd64('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xbd64('0x7'))};var RuleEngine=require(_0xbd64('0x8'));function getId(_0x3e700e,_0x38204e,_0x3f1f17){return util[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0x38204e||0x0,_0x3f1f17||0x0);}function getIntervals(_0x5d32b8,_0x5ae70c){var _0x40919e=[];if(!_[_0xbd64('0xb')](_0x5ae70c[_0xbd64('0xc')])&&!_['isNil'](_0x5d32b8[_0x5ae70c[_0xbd64('0xc')]])&&!_[_0xbd64('0xb')](_0x5d32b8[_0x5ae70c[_0xbd64('0xc')]][_0xbd64('0xd')])){_0x40919e=_['map'](_0x5d32b8[_0x5ae70c[_0xbd64('0xc')]]['Intervals'],_0xbd64('0xe'));}else if(!_[_0xbd64('0xb')](_0x5ae70c[_0xbd64('0xe')])){_0x40919e=[_0x5ae70c[_0xbd64('0xe')]];}return _0x40919e;}exports[_0xbd64('0xf')]=function(_0x27438c){_0x27438c[_0xbd64('0x10')]={};return new BPromise(function(_0x269e2f,_0x2b5808){var _0x4ae471={'Start':function(_0x2d1159){var _0x13e7a4=this;return new Promise(function(_0x3ff550,_0x32fd34){if(_0x2d1159){try{var _0x29fc16=[];var _0x49a914=getId(_0x2d1159[_0xbd64('0x11')],_0x2d1159['message']?_0x2d1159[_0xbd64('0x12')]['id']:0x0,_0x2d1159[_0xbd64('0x13')]?_0x2d1159[_0xbd64('0x13')]['id']:0x0);if(_0x2d1159[_0xbd64('0x14')]&&_[_0xbd64('0x15')](_0x2d1159[_0xbd64('0x14')])&&_0x2d1159[_0xbd64('0x14')][_0xbd64('0x16')]){for(var _0x5d3b00=0x0;_0x5d3b00<_0x2d1159[_0xbd64('0x14')][_0xbd64('0x16')];_0x5d3b00+=0x1){var _0x575b14=_0x2d1159['applications'][_0x5d3b00];if(fs[_0xbd64('0x17')](path[_0xbd64('0x18')](__dirname,_0xbd64('0x14'),_0x575b14[_0xbd64('0x19')]+_0xbd64('0x1a')))){var _0x816e00=[];switch(_0x575b14['app']['toLowerCase']()){case _0xbd64('0x1b'):var _0x41f2f=_0x575b14[_0xbd64('0x1c')][_0xbd64('0x1d')](',');if(_0x2d1159['channel']==='mail'){_0x816e00[_0xbd64('0x1e')](_0x41f2f[0x0]);_0x816e00['push'](_0x41f2f[0x1]);_0x816e00[_0xbd64('0x1e')](_0x41f2f['slice'](0x2,_0x41f2f[_0xbd64('0x16')])[_0xbd64('0x18')](','));}else{_0x816e00[_0xbd64('0x1e')](_0x41f2f[0x0]);_0x816e00[_0xbd64('0x1e')](_0x41f2f['slice'](0x1,_0x41f2f[_0xbd64('0x16')])[_0xbd64('0x18')](','));}break;case _0xbd64('0x1f'):var _0x2a44d0=_0x575b14['appdata']['split'](',');_0x816e00[_0xbd64('0x1e')](_0x2a44d0[0x0]);_0x816e00['push'](_0x2a44d0[0x1]);_0x816e00['push'](_0x2a44d0[_0xbd64('0x20')](0x2,_0x2a44d0['length'])[_0xbd64('0x18')](','));break;case'dialogflowv2':var _0x28199c=_0x575b14['appdata'][_0xbd64('0x1d')](',');_0x816e00[_0xbd64('0x1e')](_0x28199c[0x0]);_0x816e00[_0xbd64('0x1e')](_0x28199c[0x1]);_0x816e00[_0xbd64('0x1e')](_0x28199c[0x2]);_0x816e00[_0xbd64('0x1e')](_0x28199c[0x3]);_0x816e00[_0xbd64('0x1e')](_0x28199c['slice'](0x4,_0x28199c[_0xbd64('0x16')])[_0xbd64('0x18')](','));break;case _0xbd64('0x21'):var _0x34bbf8=_0x575b14[_0xbd64('0x1c')][_0xbd64('0x1d')](',');_0x816e00['push'](_0x34bbf8[0x0]);_0x816e00['push'](_0x34bbf8[0x1]);_0x816e00[_0xbd64('0x1e')](_0x34bbf8[0x2]);_0x816e00['push'](_0x34bbf8[0x3]);_0x816e00[_0xbd64('0x1e')](_0x34bbf8[_0xbd64('0x20')](0x4,_0x34bbf8['length'])['join'](','));break;case _0xbd64('0x12'):_0x816e00['push'](_0x575b14['appdata']);break;case _0xbd64('0x22'):_0x816e00[_0xbd64('0x1e')](_0x575b14[_0xbd64('0x23')]);_0x816e00['push'](_0x575b14[_0xbd64('0x1c')]);break;case'tvox':var _0x1fc9cf=utils[_0xbd64('0x24')](_0x2d1159[_0xbd64('0x25')][_0xbd64('0x26')],_0x2d1159);var _0x175823=_0x575b14[_0xbd64('0x1c')]['split'](',');_0x816e00['push'](_0x175823[0x0]);_0x816e00[_0xbd64('0x1e')](_0x175823[0x1]);_0x816e00[_0xbd64('0x1e')](_0x175823[0x2]);_0x816e00[_0xbd64('0x1e')](_0x175823[0x3]);_0x816e00[_0xbd64('0x1e')](_0x175823[0x4]);_0x816e00[_0xbd64('0x1e')](_0x175823[0x5]);_0x816e00[_0xbd64('0x1e')](_0x175823[0x6]);_0x816e00['push'](_0x175823[0x7]);_0x816e00['push'](_0x175823[0x8]);_0x816e00[_0xbd64('0x1e')](_0x175823[0x9]);_0x816e00[_0xbd64('0x1e')](_0x175823[0xa]);_0x816e00[_0xbd64('0x1e')](_0x2d1159['interaction']['id']);_0x816e00['push'](_0x2d1159[_0xbd64('0x12')]['id']);_0x816e00['push'](_0x575b14[_0xbd64('0x27')]);_0x816e00['push'](_0x2d1159[_0xbd64('0x13')][_0xbd64('0x28')]);_0x816e00['push'](_0x2d1159[_0xbd64('0x29')]['body']);_0x816e00['push'](_0x1fc9cf);break;default:_0x816e00=_[_0xbd64('0xb')](_0x575b14[_0xbd64('0x1c')])?[]:_0x575b14[_0xbd64('0x1c')]['split'](',');}var _0x540e2a={'id':util['format'](_0xbd64('0x2a'),_0x49a914,_0x575b14['id'],_0x575b14[_0xbd64('0x19')]),'condition':require('./interval')[_0xbd64('0x2b')](_0x49a914,getIntervals(_0x27438c[_0xbd64('0x2c')],_0x575b14),_0x27438c),'consequence':require(_0xbd64('0x2d')+_0x575b14[_0xbd64('0x19')])['consequence'](_0x49a914,_0x816e00,_0x27438c,_0x2d1159),'p':_0x575b14['priority']||0x0};logger[_0xbd64('0x2e')]('Push\x20new\x20rule',_0x540e2a['id'],'on\x20interval',getIntervals(_0x27438c[_0xbd64('0x2c')],_0x575b14)[_0xbd64('0x18')](_0xbd64('0x2f')));_0x29fc16[_0xbd64('0x1e')](_0x540e2a);}else{logger[_0xbd64('0x30')](_0xbd64('0x31'),path[_0xbd64('0x18')](__dirname,_0xbd64('0x14'),_0x575b14['app']+_0xbd64('0x1a')));}}_0x27438c[_0xbd64('0x10')][_0x49a914]=new RuleEngine(_0x29fc16);_0x27438c['rules'][_0x49a914][_0xbd64('0x32')](_0x2d1159,function(_0x1e4983){logger[_0xbd64('0x2e')](_0xbd64('0x33'),JSON[_0xbd64('0x34')](_0x1e4983[_0xbd64('0x35')]));if(_0x27438c[_0xbd64('0x10')][_0x49a914]){_0x27438c['rules'][_0x49a914][_0xbd64('0x36')]('complete');}});return _0x3ff550({'code':0xc8,'message':_0x2d1159});}else{logger[_0xbd64('0x2e')]('No\x20applications\x20to\x20execute');return _0x3ff550({'code':0xc8,'message':_0x2d1159});}}catch(_0x468e0b){logger[_0xbd64('0x30')](_0x468e0b[_0xbd64('0x37')]);return _0x32fd34(_0x13e7a4['error'](0x1f4,_0x468e0b));}}return _0x32fd34(_0xbd64('0x38'));});},'AcceptMessage':function(_0x495522){var _0x526705=this;return new Promise(function(_0x553fa0,_0x3304b7){if(_0x495522[_0xbd64('0x39')]&&_0x495522[_0xbd64('0x39')]['id']){if(_0x27438c[_0xbd64('0x3a')][_0x495522[_0xbd64('0x39')]['id']]){_0x27438c[_0xbd64('0x3a')][_0x495522[_0xbd64('0x39')]['id']]['busy']=![];_0x27438c[_0xbd64('0x3a')][_0x495522[_0xbd64('0x39')]['id']][_0xbd64('0x3b')]=undefined;}}if(_0x495522['message']&&_0x495522[_0xbd64('0x12')]['id']){try{var _0x436f36=getId(_0x495522[_0xbd64('0x11')],_0x495522[_0xbd64('0x12')]?_0x495522[_0xbd64('0x12')]['id']:0x0,_0x495522['interaction']?_0x495522[_0xbd64('0x13')]['id']:0x0);if(_0x27438c[_0xbd64('0x10')][_0x436f36]){_0x27438c[_0xbd64('0x10')][_0x436f36][_0xbd64('0x36')]('end');if(rpc[_0x495522['channel']+_0xbd64('0x3c')]){rpc[_0x495522[_0xbd64('0x11')]+_0xbd64('0x3c')][_0xbd64('0x3d')](_0x436f36,{'UserId':_0x495522[_0xbd64('0x12')][_0xbd64('0x3e')]})[_0xbd64('0x3f')](function(){logger[_0xbd64('0x30')](_0xbd64('0x40'));});}}return _0x553fa0({'code':0xc8,'message':_0x495522});}catch(_0x2709b2){logger[_0xbd64('0x30')](_0x2709b2[_0xbd64('0x37')]);return _0x3304b7(_0x526705[_0xbd64('0x30')](0x1f4,_0x2709b2));}}logger[_0xbd64('0x30')](_0xbd64('0x41'));return _0x3304b7(_0x526705['error'](0x1f4,_0xbd64('0x41')));});},'RejectMessage':function(_0x4952db){var _0x5ede67=this;return new Promise(function(_0x552c95,_0x4aa662){if(_0x4952db[_0xbd64('0x39')]&&_0x4952db[_0xbd64('0x39')]['id']){try{if(_0x27438c['agents'][_0x4952db[_0xbd64('0x39')]['id']]){_0x27438c[_0xbd64('0x3a')][_0x4952db[_0xbd64('0x39')]['id']]['busy']=![];_0x27438c[_0xbd64('0x3a')][_0x4952db[_0xbd64('0x39')]['id']][_0xbd64('0x3b')]=undefined;}return _0x552c95({'code':0xc8,'message':_0x4952db});}catch(_0x1db94c){logger[_0xbd64('0x30')](_0x1db94c[_0xbd64('0x37')]);return _0x4aa662(_0x5ede67['error'](0x1f4,_0x1db94c));}}logger['error']('message\x20is\x20empty');return _0x4aa662(_0x5ede67[_0xbd64('0x30')](0x1f4,_0xbd64('0x41')));});},'AbandonInteraction':function(_0x3548fe){var _0x958272=this;return new Promise(function(_0x487d6e,_0x1d0d9f){if(_0x3548fe[_0xbd64('0x11')]&&_0x3548fe[_0xbd64('0x13')]&&_0x3548fe[_0xbd64('0x13')]['id']){try{var _0x3a0e5c=getId(_0x3548fe[_0xbd64('0x11')],_0x3548fe['message']?_0x3548fe[_0xbd64('0x12')]['id']:0x0,_0x3548fe[_0xbd64('0x13')]?_0x3548fe[_0xbd64('0x13')]['id']:0x0);if(_0x27438c[_0xbd64('0x10')][_0x3a0e5c]){_0x27438c[_0xbd64('0x10')][_0x3a0e5c][_0xbd64('0x36')](_0xbd64('0x42'));}return _0x487d6e({'code':0xc8,'message':_0x3548fe});}catch(_0x3e0f82){logger[_0xbd64('0x30')](_0x3e0f82[_0xbd64('0x37')]);return _0x1d0d9f(_0x958272[_0xbd64('0x30')](0x1f4,_0x3e0f82));}}logger[_0xbd64('0x30')]('message\x20is\x20empty');return _0x1d0d9f(_0x958272['error'](0x1f4,_0xbd64('0x41')));});},'AgentCapacity':function(_0x2bcf68){var _0x5ab7b3=this;return new Promise(function(_0x550f5f,_0x46fa0d){if(_0x27438c[_0xbd64('0x3a')]['hasOwnProperty'](_0x2bcf68['id'])){for(var _0x6facf3 in _0x2bcf68[_0xbd64('0x43')]){if(_0x2bcf68[_0xbd64('0x43')][_0xbd64('0x44')](_0x6facf3)){if(_0x27438c[_0xbd64('0x3a')][_0x2bcf68['id']][_0xbd64('0x44')](_0x6facf3+_0xbd64('0x45'))){_0x27438c[_0xbd64('0x3a')][_0x2bcf68['id']][_0x6facf3+_0xbd64('0x45')]=parseInt(_0x2bcf68['capacity'][_0x6facf3],0xa);}}}_0x27438c[_0xbd64('0x3a')][_0x2bcf68['id']][_0xbd64('0x46')]();return _0x550f5f({'code':0xc8,'message':_0x27438c[_0xbd64('0x3a')][_0x2bcf68['id']]});}else{return _0x46fa0d(_0x5ab7b3['error'](0x1f4,_0xbd64('0x47')));}});},'Agents':function(_0x39fae9){return new Promise(function(_0x4aa83e){var _0x4423d9=_[_0xbd64('0x48')](_0x27438c[_0xbd64('0x3a')]);if(_0x39fae9&&_0x39fae9['id']){var _0x220603=_[_0xbd64('0x49')](_0x4423d9,function(_0x1594e9){return _0x1594e9['id']===_0x39fae9['id'];});_0x4aa83e(_0x220603);}else{_0x4aa83e({'count':_0x4423d9['length'],'rows':_0x4423d9});}});},'ChatQueues':function(){return new Promise(function(_0x2c24c1){var _0x1f3bd0=[];for(var _0xc57eb1 in _0x27438c[_0xbd64('0x4a')]){if(_0x27438c['chatQueues'][_0xbd64('0x44')](_0xc57eb1)){var _0x1c8b40=_0x27438c['chatQueues'][_0xc57eb1];var _0x78d88={'id':_0x1c8b40['id'],'available':_0x1c8b40['available'],'loggedIn':_0x1c8b40[_0xbd64('0x4b')],'name':_0x1c8b40[_0xbd64('0x4c')],'paused':_0x1c8b40[_0xbd64('0x4d')],'waiting':_0x1c8b40[_0xbd64('0x4e')]};_0x1f3bd0['push'](_0x78d88);}}_0x2c24c1({'count':_0x1f3bd0[_0xbd64('0x16')],'rows':_0x1f3bd0});});},'MailQueues':function(){return new Promise(function(_0x54a3b1){var _0x30bdef=[];for(var _0x23925c in _0x27438c[_0xbd64('0x4f')]){if(_0x27438c[_0xbd64('0x4f')]['hasOwnProperty'](_0x23925c)){var _0x51e095=_0x27438c['mailQueues'][_0x23925c];var _0x36f3a8={'id':_0x51e095['id'],'available':_0x51e095[_0xbd64('0x50')],'loggedIn':_0x51e095[_0xbd64('0x4b')],'name':_0x51e095[_0xbd64('0x4c')],'paused':_0x51e095[_0xbd64('0x4d')],'waiting':_0x51e095[_0xbd64('0x4e')]};_0x30bdef['push'](_0x36f3a8);}}_0x54a3b1({'count':_0x30bdef[_0xbd64('0x16')],'rows':_0x30bdef});});},'OpenchannelQueues':function(){return new Promise(function(_0x4fc39){var _0x305ffc=[];for(var _0x333720 in _0x27438c[_0xbd64('0x51')]){if(_0x27438c[_0xbd64('0x51')][_0xbd64('0x44')](_0x333720)){var _0x3d7e47=_0x27438c[_0xbd64('0x51')][_0x333720];var _0x18e724={'id':_0x3d7e47['id'],'available':_0x3d7e47[_0xbd64('0x50')],'loggedIn':_0x3d7e47[_0xbd64('0x4b')],'name':_0x3d7e47['name'],'paused':_0x3d7e47['paused'],'waiting':_0x3d7e47[_0xbd64('0x4e')]};_0x305ffc[_0xbd64('0x1e')](_0x18e724);}}_0x4fc39({'count':_0x305ffc[_0xbd64('0x16')],'rows':_0x305ffc});});},'SmsQueues':function(){return new Promise(function(_0x4fc352){var _0x9b99b3=[];for(var _0x4fccd9 in _0x27438c[_0xbd64('0x52')]){if(_0x27438c[_0xbd64('0x52')][_0xbd64('0x44')](_0x4fccd9)){var _0x819774=_0x27438c['smsQueues'][_0x4fccd9];var _0x1f104b={'id':_0x819774['id'],'available':_0x819774['available'],'loggedIn':_0x819774[_0xbd64('0x4b')],'name':_0x819774[_0xbd64('0x4c')],'paused':_0x819774[_0xbd64('0x4d')],'waiting':_0x819774[_0xbd64('0x4e')]};_0x9b99b3[_0xbd64('0x1e')](_0x1f104b);}}_0x4fc352({'count':_0x9b99b3['length'],'rows':_0x9b99b3});});},'FaxQueues':function(){return new Promise(function(_0x43780f){var _0x9cca6c=[];for(var _0x4d100e in _0x27438c[_0xbd64('0x53')]){if(_0x27438c[_0xbd64('0x53')][_0xbd64('0x44')](_0x4d100e)){var _0x12a31f=_0x27438c['faxQueues'][_0x4d100e];var _0x4159a7={'id':_0x12a31f['id'],'available':_0x12a31f['available'],'loggedIn':_0x12a31f[_0xbd64('0x4b')],'name':_0x12a31f[_0xbd64('0x4c')],'paused':_0x12a31f[_0xbd64('0x4d')],'waiting':_0x12a31f['waiting']};_0x9cca6c['push'](_0x4159a7);}}_0x43780f({'count':_0x9cca6c['length'],'rows':_0x9cca6c});});},'WhatsappQueues':function(){return new Promise(function(_0x48317d){var _0x3cdf64=[];for(var _0x14bf9b in _0x27438c[_0xbd64('0x54')]){if(_0x27438c[_0xbd64('0x54')][_0xbd64('0x44')](_0x14bf9b)){var _0x4ea72d=_0x27438c[_0xbd64('0x54')][_0x14bf9b];var _0x23de71={'id':_0x4ea72d['id'],'available':_0x4ea72d[_0xbd64('0x50')],'loggedIn':_0x4ea72d[_0xbd64('0x4b')],'name':_0x4ea72d[_0xbd64('0x4c')],'paused':_0x4ea72d['paused'],'waiting':_0x4ea72d[_0xbd64('0x4e')]};_0x3cdf64[_0xbd64('0x1e')](_0x23de71);}}_0x48317d({'count':_0x3cdf64[_0xbd64('0x16')],'rows':_0x3cdf64});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x808467){var _0x5875da=_['values'](_0x27438c[_0xbd64('0x55')]);_0x808467({'count':_0x5875da[_0xbd64('0x16')],'rows':_0x5875da});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x8b92f9){var _0x2c8932=_[_0xbd64('0x48')](_0x27438c[_0xbd64('0x56')]);_0x8b92f9({'count':_0x2c8932[_0xbd64('0x16')],'rows':_0x2c8932});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x344285){var _0x499831=_[_0xbd64('0x48')](_0x27438c['openchannelQueuesWaitingInteractions']);_0x344285({'count':_0x499831[_0xbd64('0x16')],'rows':_0x499831});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0xf0336a){var _0x1aca4d=_['values'](_0x27438c[_0xbd64('0x57')]);_0xf0336a({'count':_0x1aca4d['length'],'rows':_0x1aca4d});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5c3efa){var _0x3da482=_[_0xbd64('0x48')](_0x27438c[_0xbd64('0x58')]);_0x5c3efa({'count':_0x3da482['length'],'rows':_0x3da482});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x364af8){var _0x3a34b7=_[_0xbd64('0x48')](_0x27438c[_0xbd64('0x59')]);_0x364af8({'count':_0x3a34b7['length'],'rows':_0x3a34b7});});}};var _0x17a4c4=jayson[_0xbd64('0x5a')](_0x4ae471)[_0xbd64('0x5b')]();_0x17a4c4['on'](_0xbd64('0x30'),function(_0x339e52){logger[_0xbd64('0x30')](JSON[_0xbd64('0x34')](_0x339e52));return _0x2b5808(_0x339e52);});_0x17a4c4[_0xbd64('0xf')](0x232c,_0xbd64('0x5c'),function(){console[_0xbd64('0x5d')](_0xbd64('0x5e'),0x232c);return _0x269e2f(_0xbd64('0x5f')+0x232c);});});}; \ No newline at end of file +var _0xe739=['slice','split','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','consequence','priority','Push\x20new\x20rule','on\x20interval','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','complete','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','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','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','rules','channel','message','interaction','applications','length','existsSync','join','app','toLowerCase','appdata','mail','push'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0xe739,0x105));var _0x9e73=function(_0x1ee791,_0x475e12){_0x1ee791=_0x1ee791-0x0;var _0x3d0ca9=_0xe739[_0x1ee791];return _0x3d0ca9;};'use strict';var _=require(_0x9e73('0x0'));var util=require('util');var path=require(_0x9e73('0x1'));var fs=require('fs');var jayson=require(_0x9e73('0x2'));var BPromise=require(_0x9e73('0x3'));var utils=require('./applications/utils');var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x9e73('0x4')),'mailQueueReport':require(_0x9e73('0x5')),'chatQueueReport':require(_0x9e73('0x6')),'smsQueueReport':require(_0x9e73('0x7')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x9e73('0x8'))};var RuleEngine=require(_0x9e73('0x9'));function getId(_0xb37872,_0x5e46e7,_0xa49f86){return util[_0x9e73('0xa')](_0x9e73('0xb'),_0xb37872,_0x5e46e7||0x0,_0xa49f86||0x0);}function getIntervals(_0x274187,_0x14de8a){var _0x2edd7b=[];if(!_['isNil'](_0x14de8a[_0x9e73('0xc')])&&!_['isNil'](_0x274187[_0x14de8a['IntervalId']])&&!_[_0x9e73('0xd')](_0x274187[_0x14de8a['IntervalId']][_0x9e73('0xe')])){_0x2edd7b=_[_0x9e73('0xf')](_0x274187[_0x14de8a[_0x9e73('0xc')]]['Intervals'],_0x9e73('0x10'));}else if(!_[_0x9e73('0xd')](_0x14de8a[_0x9e73('0x10')])){_0x2edd7b=[_0x14de8a[_0x9e73('0x10')]];}return _0x2edd7b;}exports['listen']=function(_0x27c0ba){_0x27c0ba[_0x9e73('0x11')]={};return new BPromise(function(_0x3a7bd5,_0x5be2fa){var _0x358827={'Start':function(_0x378603){var _0x597492=this;return new Promise(function(_0x367857,_0x327305){if(_0x378603){try{var _0x21bd3a=[];var _0x5633e1=getId(_0x378603[_0x9e73('0x12')],_0x378603['message']?_0x378603[_0x9e73('0x13')]['id']:0x0,_0x378603['interaction']?_0x378603[_0x9e73('0x14')]['id']:0x0);if(_0x378603['applications']&&_['isArray'](_0x378603[_0x9e73('0x15')])&&_0x378603[_0x9e73('0x15')][_0x9e73('0x16')]){for(var _0x206f1c=0x0;_0x206f1c<_0x378603[_0x9e73('0x15')][_0x9e73('0x16')];_0x206f1c+=0x1){var _0xf90c63=_0x378603[_0x9e73('0x15')][_0x206f1c];if(fs[_0x9e73('0x17')](path[_0x9e73('0x18')](__dirname,'applications',_0xf90c63[_0x9e73('0x19')]+'.js'))){var _0xd3290d=[];switch(_0xf90c63['app'][_0x9e73('0x1a')]()){case'autoreply':var _0x2c2b32=_0xf90c63[_0x9e73('0x1b')]['split'](',');if(_0x378603['channel']===_0x9e73('0x1c')){_0xd3290d[_0x9e73('0x1d')](_0x2c2b32[0x0]);_0xd3290d[_0x9e73('0x1d')](_0x2c2b32[0x1]);_0xd3290d[_0x9e73('0x1d')](_0x2c2b32[_0x9e73('0x1e')](0x2,_0x2c2b32['length'])[_0x9e73('0x18')](','));}else{_0xd3290d[_0x9e73('0x1d')](_0x2c2b32[0x0]);_0xd3290d['push'](_0x2c2b32['slice'](0x1,_0x2c2b32[_0x9e73('0x16')])['join'](','));}break;case'dialogflow':var _0x23b2cd=_0xf90c63[_0x9e73('0x1b')][_0x9e73('0x1f')](',');_0xd3290d['push'](_0x23b2cd[0x0]);_0xd3290d[_0x9e73('0x1d')](_0x23b2cd[0x1]);_0xd3290d[_0x9e73('0x1d')](_0x23b2cd['slice'](0x2,_0x23b2cd[_0x9e73('0x16')])[_0x9e73('0x18')](','));break;case _0x9e73('0x20'):var _0x397bd6=_0xf90c63[_0x9e73('0x1b')]['split'](',');_0xd3290d[_0x9e73('0x1d')](_0x397bd6[0x0]);_0xd3290d['push'](_0x397bd6[0x1]);_0xd3290d[_0x9e73('0x1d')](_0x397bd6[0x2]);_0xd3290d[_0x9e73('0x1d')](_0x397bd6[0x3]);_0xd3290d[_0x9e73('0x1d')](_0x397bd6[_0x9e73('0x1e')](0x4,_0x397bd6[_0x9e73('0x16')])['join'](','));break;case _0x9e73('0x21'):var _0x2a633a=_0xf90c63['appdata']['split'](',');_0xd3290d[_0x9e73('0x1d')](_0x2a633a[0x0]);_0xd3290d[_0x9e73('0x1d')](_0x2a633a[0x1]);_0xd3290d[_0x9e73('0x1d')](_0x2a633a[0x2]);_0xd3290d[_0x9e73('0x1d')](_0x2a633a[0x3]);_0xd3290d[_0x9e73('0x1d')](_0x2a633a[_0x9e73('0x1e')](0x4,_0x2a633a['length'])[_0x9e73('0x18')](','));break;case _0x9e73('0x13'):_0xd3290d[_0x9e73('0x1d')](_0xf90c63[_0x9e73('0x1b')]);break;case _0x9e73('0x22'):_0xd3290d[_0x9e73('0x1d')](_0xf90c63[_0x9e73('0x23')]);_0xd3290d[_0x9e73('0x1d')](_0xf90c63[_0x9e73('0x1b')]);break;case _0x9e73('0x24'):var _0x4cf402=utils[_0x9e73('0x25')](_0x378603[_0x9e73('0x26')][_0x9e73('0x27')],_0x378603);var _0x316019=_0xf90c63['appdata'][_0x9e73('0x1f')](',');_0xd3290d[_0x9e73('0x1d')](_0x316019[0x0]);_0xd3290d['push'](_0x316019[0x1]);_0xd3290d['push'](_0x316019[0x2]);_0xd3290d[_0x9e73('0x1d')](_0x316019[0x3]);_0xd3290d[_0x9e73('0x1d')](_0x316019[0x4]);_0xd3290d[_0x9e73('0x1d')](_0x316019[0x5]);_0xd3290d[_0x9e73('0x1d')](_0x316019[0x6]);_0xd3290d[_0x9e73('0x1d')](_0x316019[0x7]);_0xd3290d[_0x9e73('0x1d')](_0x316019[0x8]);_0xd3290d['push'](_0x316019[0x9]);_0xd3290d['push'](_0x316019[0xa]);_0xd3290d['push'](_0x378603[_0x9e73('0x14')]['id']);_0xd3290d[_0x9e73('0x1d')](_0x378603[_0x9e73('0x13')]['id']);_0xd3290d['push'](_0xf90c63['ChatWebsiteId']);_0xd3290d['push'](_0x378603[_0x9e73('0x14')][_0x9e73('0x28')]);_0xd3290d[_0x9e73('0x1d')](_0x378603[_0x9e73('0x29')]['body']);_0xd3290d[_0x9e73('0x1d')](_0x4cf402);break;default:_0xd3290d=_[_0x9e73('0xd')](_0xf90c63[_0x9e73('0x1b')])?[]:_0xf90c63[_0x9e73('0x1b')][_0x9e73('0x1f')](',');}var _0x40bbda={'id':util[_0x9e73('0xa')](_0x9e73('0x2a'),_0x5633e1,_0xf90c63['id'],_0xf90c63[_0x9e73('0x19')]),'condition':require(_0x9e73('0x2b'))['condition'](_0x5633e1,getIntervals(_0x27c0ba['intervals'],_0xf90c63),_0x27c0ba),'consequence':require('./applications/'+_0xf90c63['app'])[_0x9e73('0x2c')](_0x5633e1,_0xd3290d,_0x27c0ba,_0x378603),'p':_0xf90c63[_0x9e73('0x2d')]||0x0};logger['info'](_0x9e73('0x2e'),_0x40bbda['id'],_0x9e73('0x2f'),getIntervals(_0x27c0ba['intervals'],_0xf90c63)['join']('\x20|\x20'));_0x21bd3a['push'](_0x40bbda);}else{logger['error'](_0x9e73('0x30'),path[_0x9e73('0x18')](__dirname,_0x9e73('0x15'),_0xf90c63[_0x9e73('0x19')]+'.js'));}}_0x27c0ba['rules'][_0x5633e1]=new RuleEngine(_0x21bd3a);_0x27c0ba[_0x9e73('0x11')][_0x5633e1][_0x9e73('0x31')](_0x378603,function(_0x41c3af){logger[_0x9e73('0x32')](_0x9e73('0x33'),JSON[_0x9e73('0x34')](_0x41c3af['matchPath']));if(_0x27c0ba[_0x9e73('0x11')][_0x5633e1]){_0x27c0ba[_0x9e73('0x11')][_0x5633e1]['emit'](_0x9e73('0x35'));}});return _0x367857({'code':0xc8,'message':_0x378603});}else{logger[_0x9e73('0x32')]('No\x20applications\x20to\x20execute');return _0x367857({'code':0xc8,'message':_0x378603});}}catch(_0x9cce2b){logger[_0x9e73('0x36')](_0x9cce2b['stack']);return _0x327305(_0x597492[_0x9e73('0x36')](0x1f4,_0x9cce2b));}}return _0x327305(_0x9e73('0x37'));});},'AcceptMessage':function(_0x461dab){var _0x343391=this;return new Promise(function(_0x1977b6,_0x3933b5){if(_0x461dab[_0x9e73('0x38')]&&_0x461dab[_0x9e73('0x38')]['id']){if(_0x27c0ba[_0x9e73('0x39')][_0x461dab[_0x9e73('0x38')]['id']]){_0x27c0ba[_0x9e73('0x39')][_0x461dab[_0x9e73('0x38')]['id']][_0x9e73('0x3a')]=![];_0x27c0ba[_0x9e73('0x39')][_0x461dab[_0x9e73('0x38')]['id']][_0x9e73('0x3b')]=undefined;}}if(_0x461dab['message']&&_0x461dab[_0x9e73('0x13')]['id']){try{var _0x577ee7=getId(_0x461dab['channel'],_0x461dab[_0x9e73('0x13')]?_0x461dab[_0x9e73('0x13')]['id']:0x0,_0x461dab['interaction']?_0x461dab['interaction']['id']:0x0);if(_0x27c0ba[_0x9e73('0x11')][_0x577ee7]){_0x27c0ba[_0x9e73('0x11')][_0x577ee7][_0x9e73('0x3c')](_0x9e73('0x3d'));if(rpc[_0x461dab[_0x9e73('0x12')]+_0x9e73('0x3e')]){rpc[_0x461dab[_0x9e73('0x12')]+_0x9e73('0x3e')][_0x9e73('0x3f')](_0x577ee7,{'UserId':_0x461dab[_0x9e73('0x13')][_0x9e73('0x40')]})[_0x9e73('0x41')](function(){logger[_0x9e73('0x36')](_0x9e73('0x42'));});}}return _0x1977b6({'code':0xc8,'message':_0x461dab});}catch(_0x5a5ba9){logger[_0x9e73('0x36')](_0x5a5ba9[_0x9e73('0x43')]);return _0x3933b5(_0x343391[_0x9e73('0x36')](0x1f4,_0x5a5ba9));}}logger[_0x9e73('0x36')](_0x9e73('0x44'));return _0x3933b5(_0x343391[_0x9e73('0x36')](0x1f4,_0x9e73('0x44')));});},'RejectMessage':function(_0x1e6655){var _0x4b67d4=this;return new Promise(function(_0x4eb552,_0x4d9056){if(_0x1e6655[_0x9e73('0x38')]&&_0x1e6655['agent']['id']){try{if(_0x27c0ba[_0x9e73('0x39')][_0x1e6655['agent']['id']]){_0x27c0ba[_0x9e73('0x39')][_0x1e6655['agent']['id']][_0x9e73('0x3a')]=![];_0x27c0ba[_0x9e73('0x39')][_0x1e6655[_0x9e73('0x38')]['id']][_0x9e73('0x3b')]=undefined;}return _0x4eb552({'code':0xc8,'message':_0x1e6655});}catch(_0xfe874d){logger[_0x9e73('0x36')](_0xfe874d[_0x9e73('0x43')]);return _0x4d9056(_0x4b67d4['error'](0x1f4,_0xfe874d));}}logger[_0x9e73('0x36')]('message\x20is\x20empty');return _0x4d9056(_0x4b67d4[_0x9e73('0x36')](0x1f4,_0x9e73('0x44')));});},'AbandonInteraction':function(_0x29b3e1){var _0x5d4c99=this;return new Promise(function(_0x72a49f,_0x2e61eb){if(_0x29b3e1['channel']&&_0x29b3e1[_0x9e73('0x14')]&&_0x29b3e1[_0x9e73('0x14')]['id']){try{var _0x198ddf=getId(_0x29b3e1[_0x9e73('0x12')],_0x29b3e1[_0x9e73('0x13')]?_0x29b3e1['message']['id']:0x0,_0x29b3e1[_0x9e73('0x14')]?_0x29b3e1[_0x9e73('0x14')]['id']:0x0);if(_0x27c0ba['rules'][_0x198ddf]){_0x27c0ba[_0x9e73('0x11')][_0x198ddf][_0x9e73('0x3c')](_0x9e73('0x3d'));}return _0x72a49f({'code':0xc8,'message':_0x29b3e1});}catch(_0x4f622a){logger[_0x9e73('0x36')](_0x4f622a[_0x9e73('0x43')]);return _0x2e61eb(_0x5d4c99['error'](0x1f4,_0x4f622a));}}logger[_0x9e73('0x36')](_0x9e73('0x44'));return _0x2e61eb(_0x5d4c99[_0x9e73('0x36')](0x1f4,_0x9e73('0x44')));});},'AgentCapacity':function(_0x43a16a){var _0x34465a=this;return new Promise(function(_0x25a168,_0x405b8b){if(_0x27c0ba[_0x9e73('0x39')][_0x9e73('0x45')](_0x43a16a['id'])){for(var _0x22c2cd in _0x43a16a[_0x9e73('0x46')]){if(_0x43a16a['capacity'][_0x9e73('0x45')](_0x22c2cd)){if(_0x27c0ba[_0x9e73('0x39')][_0x43a16a['id']][_0x9e73('0x45')](_0x22c2cd+'CurrentCapacity')){_0x27c0ba['agents'][_0x43a16a['id']][_0x22c2cd+_0x9e73('0x47')]=parseInt(_0x43a16a[_0x9e73('0x46')][_0x22c2cd],0xa);}}}_0x27c0ba[_0x9e73('0x39')][_0x43a16a['id']][_0x9e73('0x48')]();return _0x25a168({'code':0xc8,'message':_0x27c0ba[_0x9e73('0x39')][_0x43a16a['id']]});}else{return _0x405b8b(_0x34465a[_0x9e73('0x36')](0x1f4,_0x9e73('0x49')));}});},'Agents':function(_0x31ff2f){return new Promise(function(_0x3ad3fd){var _0x17bf77=_[_0x9e73('0x4a')](_0x27c0ba[_0x9e73('0x39')]);if(_0x31ff2f&&_0x31ff2f['id']){var _0x5e256b=_[_0x9e73('0x4b')](_0x17bf77,function(_0x56811c){return _0x56811c['id']===_0x31ff2f['id'];});_0x3ad3fd(_0x5e256b);}else{_0x3ad3fd({'count':_0x17bf77[_0x9e73('0x16')],'rows':_0x17bf77});}});},'ChatQueues':function(){return new Promise(function(_0x67314c){var _0x13995b=[];for(var _0x1faedc in _0x27c0ba[_0x9e73('0x4c')]){if(_0x27c0ba[_0x9e73('0x4c')]['hasOwnProperty'](_0x1faedc)){var _0x563bf2=_0x27c0ba[_0x9e73('0x4c')][_0x1faedc];var _0x4d263b={'id':_0x563bf2['id'],'available':_0x563bf2['available'],'loggedIn':_0x563bf2[_0x9e73('0x4d')],'name':_0x563bf2['name'],'paused':_0x563bf2[_0x9e73('0x4e')],'waiting':_0x563bf2[_0x9e73('0x4f')]};_0x13995b[_0x9e73('0x1d')](_0x4d263b);}}_0x67314c({'count':_0x13995b[_0x9e73('0x16')],'rows':_0x13995b});});},'MailQueues':function(){return new Promise(function(_0x3a12c9){var _0x49e508=[];for(var _0x50fa6f in _0x27c0ba[_0x9e73('0x50')]){if(_0x27c0ba[_0x9e73('0x50')][_0x9e73('0x45')](_0x50fa6f)){var _0x11f92b=_0x27c0ba[_0x9e73('0x50')][_0x50fa6f];var _0x2eed31={'id':_0x11f92b['id'],'available':_0x11f92b[_0x9e73('0x51')],'loggedIn':_0x11f92b[_0x9e73('0x4d')],'name':_0x11f92b[_0x9e73('0x52')],'paused':_0x11f92b[_0x9e73('0x4e')],'waiting':_0x11f92b[_0x9e73('0x4f')]};_0x49e508[_0x9e73('0x1d')](_0x2eed31);}}_0x3a12c9({'count':_0x49e508['length'],'rows':_0x49e508});});},'OpenchannelQueues':function(){return new Promise(function(_0x2a8869){var _0x33b47a=[];for(var _0x12a66a in _0x27c0ba[_0x9e73('0x53')]){if(_0x27c0ba[_0x9e73('0x53')][_0x9e73('0x45')](_0x12a66a)){var _0x256487=_0x27c0ba[_0x9e73('0x53')][_0x12a66a];var _0xff77be={'id':_0x256487['id'],'available':_0x256487[_0x9e73('0x51')],'loggedIn':_0x256487[_0x9e73('0x4d')],'name':_0x256487[_0x9e73('0x52')],'paused':_0x256487[_0x9e73('0x4e')],'waiting':_0x256487[_0x9e73('0x4f')]};_0x33b47a[_0x9e73('0x1d')](_0xff77be);}}_0x2a8869({'count':_0x33b47a[_0x9e73('0x16')],'rows':_0x33b47a});});},'SmsQueues':function(){return new Promise(function(_0x4d8fd6){var _0x32eedc=[];for(var _0x216945 in _0x27c0ba[_0x9e73('0x54')]){if(_0x27c0ba[_0x9e73('0x54')][_0x9e73('0x45')](_0x216945)){var _0x5f4d56=_0x27c0ba[_0x9e73('0x54')][_0x216945];var _0x4a8d5d={'id':_0x5f4d56['id'],'available':_0x5f4d56[_0x9e73('0x51')],'loggedIn':_0x5f4d56['loggedIn'],'name':_0x5f4d56['name'],'paused':_0x5f4d56[_0x9e73('0x4e')],'waiting':_0x5f4d56[_0x9e73('0x4f')]};_0x32eedc['push'](_0x4a8d5d);}}_0x4d8fd6({'count':_0x32eedc[_0x9e73('0x16')],'rows':_0x32eedc});});},'FaxQueues':function(){return new Promise(function(_0xbdd295){var _0x2aab80=[];for(var _0x323754 in _0x27c0ba[_0x9e73('0x55')]){if(_0x27c0ba[_0x9e73('0x55')]['hasOwnProperty'](_0x323754)){var _0x56335d=_0x27c0ba[_0x9e73('0x55')][_0x323754];var _0x5d0dd7={'id':_0x56335d['id'],'available':_0x56335d[_0x9e73('0x51')],'loggedIn':_0x56335d[_0x9e73('0x4d')],'name':_0x56335d[_0x9e73('0x52')],'paused':_0x56335d[_0x9e73('0x4e')],'waiting':_0x56335d['waiting']};_0x2aab80['push'](_0x5d0dd7);}}_0xbdd295({'count':_0x2aab80[_0x9e73('0x16')],'rows':_0x2aab80});});},'WhatsappQueues':function(){return new Promise(function(_0x323bbe){var _0x52aac2=[];for(var _0x587c43 in _0x27c0ba[_0x9e73('0x56')]){if(_0x27c0ba[_0x9e73('0x56')][_0x9e73('0x45')](_0x587c43)){var _0x3f56a9=_0x27c0ba[_0x9e73('0x56')][_0x587c43];var _0x120735={'id':_0x3f56a9['id'],'available':_0x3f56a9[_0x9e73('0x51')],'loggedIn':_0x3f56a9[_0x9e73('0x4d')],'name':_0x3f56a9[_0x9e73('0x52')],'paused':_0x3f56a9[_0x9e73('0x4e')],'waiting':_0x3f56a9[_0x9e73('0x4f')]};_0x52aac2['push'](_0x120735);}}_0x323bbe({'count':_0x52aac2[_0x9e73('0x16')],'rows':_0x52aac2});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xc7c2){var _0x446b5a=_[_0x9e73('0x4a')](_0x27c0ba[_0x9e73('0x57')]);_0xc7c2({'count':_0x446b5a['length'],'rows':_0x446b5a});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x47b565){var _0x4aada5=_[_0x9e73('0x4a')](_0x27c0ba[_0x9e73('0x58')]);_0x47b565({'count':_0x4aada5['length'],'rows':_0x4aada5});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x151613){var _0x4ac2b1=_[_0x9e73('0x4a')](_0x27c0ba['openchannelQueuesWaitingInteractions']);_0x151613({'count':_0x4ac2b1['length'],'rows':_0x4ac2b1});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x18f5e4){var _0x5485ba=_['values'](_0x27c0ba['smsQueuesWaitingInteractions']);_0x18f5e4({'count':_0x5485ba[_0x9e73('0x16')],'rows':_0x5485ba});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0xf5f4e7){var _0x102248=_[_0x9e73('0x4a')](_0x27c0ba[_0x9e73('0x59')]);_0xf5f4e7({'count':_0x102248[_0x9e73('0x16')],'rows':_0x102248});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x26d4be){var _0x2d4088=_[_0x9e73('0x4a')](_0x27c0ba[_0x9e73('0x5a')]);_0x26d4be({'count':_0x2d4088[_0x9e73('0x16')],'rows':_0x2d4088});});}};var _0x262d68=jayson[_0x9e73('0x5b')](_0x358827)['http']();_0x262d68['on'](_0x9e73('0x36'),function(_0x4da984){logger[_0x9e73('0x36')](JSON[_0x9e73('0x34')](_0x4da984));return _0x5be2fa(_0x4da984);});_0x262d68[_0x9e73('0x5c')](0x232c,_0x9e73('0x5d'),function(){console[_0x9e73('0x5e')](_0x9e73('0x5f'),0x232c);return _0x3a7bd5(_0x9e73('0x60')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index dc7f50f..4a50503 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 _0x6c4d=['rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','indexOf','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','jayson/promise','lodash','client','then','error','message','condition'];(function(_0x535e07,_0x37d4c0){var _0x430381=function(_0x184dad){while(--_0x184dad){_0x535e07['push'](_0x535e07['shift']());}};_0x430381(++_0x37d4c0);}(_0x6c4d,0x157));var _0xd6c4=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6c4d[_0x46aff0];return _0x9d78cf;};'use strict';var util=require(_0xd6c4('0x0'));var BPromise=require('bluebird');var jayson=require(_0xd6c4('0x1'));var _=require(_0xd6c4('0x2'));var logger=require('../../../config/logger')('routing');var client=jayson[_0xd6c4('0x3')]['http']({'port':0x232a});function request(_0xef22f0,_0x1115d8){return new BPromise(function(_0x4a17b8,_0xd9a658){return client['request'](_0xef22f0,_0x1115d8)[_0xd6c4('0x4')](function(_0x14961d){if(_0x14961d[_0xd6c4('0x5')]){return _0xd9a658(_0x14961d[_0xd6c4('0x5')][_0xd6c4('0x6')]);}else{return _0x4a17b8(_0x14961d['result']);}})['catch'](function(_0x4c307f){return _0xd9a658(_0x4c307f);});});}exports[_0xd6c4('0x7')]=function(_0x19fad9,_0x1ea3cc,_0x3c91f1){return function(_0x5ffaaf){if(_0x3c91f1[_0xd6c4('0x8')]&&!_0x3c91f1['rules'][_0x19fad9]){logger[_0xd6c4('0x9')](_0xd6c4('0xa'),_0x19fad9);return _0x5ffaaf[_0xd6c4('0xb')]();}var _0x2c1931=[];for(var _0x3c2095=0x0;_0x3c2095<_0x1ea3cc[_0xd6c4('0xc')];_0x3c2095+=0x1){_0x2c1931[_0xd6c4('0xd')](request(_0xd6c4('0xe'),{'command':util[_0xd6c4('0xf')]('iftime\x20%s',_0x1ea3cc[_0x3c2095])})[_0xd6c4('0x4')](function(_0x16cf92){return _0x16cf92&&_0x16cf92['message']&&_0x16cf92[_0xd6c4('0x6')][_0xd6c4('0x10')]('true')>=0x0?!![]:![];})[_0xd6c4('0x11')](function(_0xd14b0c){logger[_0xd6c4('0x5')](_0xd6c4('0x12'),_0x19fad9,_0x1ea3cc[_0x3c2095]);}));}BPromise[_0xd6c4('0x13')](_0x2c1931)[_0xd6c4('0x4')](function(_0x377671){var _0x1f0b86=_[_0xd6c4('0x14')](_0x377671);logger['info'](_0xd6c4('0x15'),_0x19fad9,_0x1ea3cc[_0xd6c4('0x16')](_0xd6c4('0x17')),_0x1f0b86);_0x5ffaaf[_0xd6c4('0x18')](_0x1f0b86);})['catch'](function(_0x3bc034){console[_0xd6c4('0x19')](_0x3bc034);logger[_0xd6c4('0x5')](_0xd6c4('0x15'),_0x19fad9,_0x1ea3cc[_0xd6c4('0x16')](_0xd6c4('0x17')),_0x3bc034[_0xd6c4('0x1a')]);_0x5ffaaf['stop']();});};}; \ No newline at end of file +var _0xf9cc=['then','indexOf','true','catch','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','../../../config/logger','routing','client','http','request','error','message','result','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','iftime\x20%s'];(function(_0x234530,_0x4a7bb7){var _0x269cf5=function(_0x251595){while(--_0x251595){_0x234530['push'](_0x234530['shift']());}};_0x269cf5(++_0x4a7bb7);}(_0xf9cc,0xdd));var _0xcf9c=function(_0x1eb6ea,_0x55050e){_0x1eb6ea=_0x1eb6ea-0x0;var _0x17a663=_0xf9cc[_0x1eb6ea];return _0x17a663;};'use strict';var util=require(_0xcf9c('0x0'));var BPromise=require(_0xcf9c('0x1'));var jayson=require(_0xcf9c('0x2'));var _=require('lodash');var logger=require(_0xcf9c('0x3'))(_0xcf9c('0x4'));var client=jayson[_0xcf9c('0x5')][_0xcf9c('0x6')]({'port':0x232a});function request(_0x181136,_0x4c5db1){return new BPromise(function(_0x2854b1,_0x1a07ff){return client[_0xcf9c('0x7')](_0x181136,_0x4c5db1)['then'](function(_0x341a1e){if(_0x341a1e[_0xcf9c('0x8')]){return _0x1a07ff(_0x341a1e[_0xcf9c('0x8')][_0xcf9c('0x9')]);}else{return _0x2854b1(_0x341a1e[_0xcf9c('0xa')]);}})['catch'](function(_0x57960b){return _0x1a07ff(_0x57960b);});});}exports['condition']=function(_0x584100,_0x3c0be2,_0x2e1c76){return function(_0x364c99){if(_0x2e1c76[_0xcf9c('0xb')]&&!_0x2e1c76[_0xcf9c('0xb')][_0x584100]){logger[_0xcf9c('0xc')](_0xcf9c('0xd'),_0x584100);return _0x364c99[_0xcf9c('0xe')]();}var _0xaa642b=[];for(var _0x654641=0x0;_0x654641<_0x3c0be2[_0xcf9c('0xf')];_0x654641+=0x1){_0xaa642b[_0xcf9c('0x10')](request(_0xcf9c('0x11'),{'command':util['format'](_0xcf9c('0x12'),_0x3c0be2[_0x654641])})[_0xcf9c('0x13')](function(_0x5ef235){return _0x5ef235&&_0x5ef235[_0xcf9c('0x9')]&&_0x5ef235[_0xcf9c('0x9')][_0xcf9c('0x14')](_0xcf9c('0x15'))>=0x0?!![]:![];})[_0xcf9c('0x16')](function(_0x70131c){logger[_0xcf9c('0x8')]('[%s][INTERVAL]\x20%s',_0x584100,_0x3c0be2[_0x654641]);}));}BPromise[_0xcf9c('0x17')](_0xaa642b)[_0xcf9c('0x13')](function(_0x23cbce){var _0x290a61=_['some'](_0x23cbce);logger[_0xcf9c('0xc')](_0xcf9c('0x18'),_0x584100,_0x3c0be2[_0xcf9c('0x19')](_0xcf9c('0x1a')),_0x290a61);_0x364c99[_0xcf9c('0x1b')](_0x290a61);})[_0xcf9c('0x16')](function(_0xd9994e){console[_0xcf9c('0x1c')](_0xd9994e);logger[_0xcf9c('0x8')](_0xcf9c('0x18'),_0x584100,_0x3c0be2[_0xcf9c('0x19')]('\x20|\x20'),_0xd9994e[_0xcf9c('0x1d')]);_0x364c99['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 98e2e93..03eba53 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 _0xeffd=['secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transferuniqueid','origtransfereruniqueid','transfereeuniqueid','clone','calleridname','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','[%s][agents][agentcalled]','now','called','error','agentringnoanswer','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','push','[%s][agents][agentringnoanswer]','forIn','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid'];(function(_0x3905cf,_0x283c13){var _0x1058aa=function(_0x3f6a2e){while(--_0x3f6a2e){_0x3905cf['push'](_0x3905cf['shift']());}};_0x1058aa(++_0x283c13);}(_0xeffd,0x6b));var _0xdeff=function(_0x47d7bb,_0x58662c){_0x47d7bb=_0x47d7bb-0x0;var _0x368714=_0xeffd[_0x47d7bb];return _0x368714;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var utils=require(_0xdeff('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xd8f1d6,_0x281a05){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x4'),_0xd8f1d6[_0xdeff('0x5')],_0xd8f1d6[_0xdeff('0x6')],_0xd8f1d6[_0xdeff('0x7')],_0xd8f1d6[_0xdeff('0x8')],_0xd8f1d6[_0xdeff('0x9')],_0xd8f1d6[_0xdeff('0xa')],_0xd8f1d6[_0xdeff('0xb')],_0xd8f1d6[_0xdeff('0xc')]));if(_0xd8f1d6[_0xdeff('0x7')]){utils[_0xdeff('0xd')](_0xd8f1d6[_0xdeff('0x7')])['then'](function(_0x3ae201){if(_0x3ae201){_0xd8f1d6[_0xdeff('0xe')]=_0x3ae201[_0xdeff('0xe')];_0xd8f1d6['agentacw']=_0xd8f1d6[_0xdeff('0xf')]?_0x3ae201[_0xdeff('0x10')]:![];_0xd8f1d6[_0xdeff('0x11')]=_0xd8f1d6[_0xdeff('0x12')]?_0x3ae201[_0xdeff('0x13')]:0x0;}utils[_0xdeff('0x14')](_0xdeff('0x15'),_0xd8f1d6);});}else{utils[_0xdeff('0x14')]('CreateVoiceAgentReport',_0xd8f1d6);}if(_0x281a05){delete transfers[_0xd8f1d6[_0xdeff('0x5')]];}else{delete agents[_0xd8f1d6[_0xdeff('0x16')]];}}exports['agentcalled']=function(_0x2e614c){try{utils['debug'](util['format'](_0xdeff('0x17'),_0x2e614c[_0xdeff('0x5')]),_0x2e614c);agents[_0x2e614c[_0xdeff('0x16')]]=_0x2e614c;agents[_0x2e614c[_0xdeff('0x16')]]['agentcalledAt']=utils[_0xdeff('0x18')]();agents[_0x2e614c[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x19');agents[_0x2e614c[_0xdeff('0x16')]][_0xdeff('0xb')]=null;agents[_0x2e614c['destuniqueid']]['connectedlinename']=null;utils[_0xdeff('0x2')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2e614c[_0xdeff('0x5')],agents[_0x2e614c[_0xdeff('0x16')]]['membername'],_0x2e614c[_0xdeff('0x16')]));}catch(_0x42e98e){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x17'),_0x2e614c[_0xdeff('0x5')]),_0x42e98e);}};exports[_0xdeff('0x1b')]=function(_0x919c93){try{if(!_['isNil'](agents[_0x919c93['destuniqueid']])){utils['debug'](util[_0xdeff('0x3')]('[%s][agents][agentringnoanswer]',_0x919c93[_0xdeff('0x5')]),_0x919c93);utils[_0xdeff('0x2')](util['format'](_0xdeff('0x1c'),_0x919c93[_0xdeff('0x5')],agents[_0x919c93['destuniqueid']]['membername'],_0x919c93[_0xdeff('0x16')]));agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1b')]=!![];agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1d')]=utils['now']();agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x1e');agents[_0x919c93[_0xdeff('0x16')]][_0xdeff('0x1f')]=_0xdeff('0x1e');agents[_0x919c93[_0xdeff('0x16')]]['holdtime']=_0x919c93[_0xdeff('0x20')]?parseInt(_0x919c93[_0xdeff('0x20')])/0x3e8:0x0;agents[_0x919c93['destuniqueid']]['talktime']=0x0;unanswered[_0xdeff('0x21')](_0x919c93[_0xdeff('0x16')]);}}catch(_0x16b2d0){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x22'),_0x919c93[_0xdeff('0x5')]),_0x16b2d0);}};exports['queuecallerabandon']=function(_0x331ddc){try{_[_0xdeff('0x23')](agents,function(_0x34e258,_0x5045b8){if(_0x34e258['uniqueid']==_0x331ddc[_0xdeff('0x5')]&&!_['includes'](unanswered,_0x34e258[_0xdeff('0x16')])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][queuecallerabandon]',_0x331ddc[_0xdeff('0x5')]),_0x331ddc);utils['info'](util['format'](_0xdeff('0x25'),_0x331ddc[_0xdeff('0x5')],_0x34e258[_0xdeff('0x8')],_0x34e258[_0xdeff('0x16')]));_0x34e258['agentringnoanswer']=!![];_0x34e258[_0xdeff('0x1d')]=utils[_0xdeff('0x18')]();_0x34e258[_0xdeff('0xc')]=_0xdeff('0x26');_0x34e258[_0xdeff('0x1f')]=_0xdeff('0x26');_0x34e258[_0xdeff('0x27')]=_0x331ddc['holdtime'];_0x34e258[_0xdeff('0x28')]=0x0;writeDB(_0x34e258);}});}catch(_0x5cef77){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x29'),_0x331ddc[_0xdeff('0x5')]),_0x5cef77);}};exports[_0xdeff('0x2a')]=function(_0x965c5b){try{if(agents[_0x965c5b['destuniqueid']]){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][agentconnect]',_0x965c5b[_0xdeff('0x5')]),_0x965c5b);utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x2b'),_0x965c5b[_0xdeff('0x5')],agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0x8')],_0x965c5b[_0xdeff('0x16')]));agents[_0x965c5b['destuniqueid']][_0xdeff('0x2c')]=utils['now']();agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0xb')]=_0x965c5b[_0xdeff('0xb')];agents[_0x965c5b['destuniqueid']][_0xdeff('0x2d')]=_0x965c5b[_0xdeff('0x2d')];agents[_0x965c5b[_0xdeff('0x16')]][_0xdeff('0x27')]=_0x965c5b[_0xdeff('0x20')];agents[_0x965c5b['destuniqueid']][_0xdeff('0xc')]='connect';_[_0xdeff('0x23')](agents,function(_0x14f1d0,_0x518280){if(_0x14f1d0[_0xdeff('0x16')]!=_0x965c5b[_0xdeff('0x16')]&&_0x14f1d0[_0xdeff('0x5')]==_0x965c5b[_0xdeff('0x5')]){_0x14f1d0[_0xdeff('0x28')]=0x0;_0x14f1d0['holdtime']=_0x965c5b[_0xdeff('0x20')];_0x14f1d0[_0xdeff('0x1b')]=!![];_0x14f1d0[_0xdeff('0x1d')]=utils[_0xdeff('0x18')]();_0x14f1d0[_0xdeff('0xc')]='answered_elsewhere';_0x14f1d0['reason']=_0xdeff('0x2e');_0x14f1d0[_0xdeff('0x2f')]=_0x965c5b[_0xdeff('0x16')];_0x14f1d0[_0xdeff('0x30')]=_0x965c5b[_0xdeff('0x8')];writeDB(_0x14f1d0);}});}}catch(_0x289f70){utils[_0xdeff('0x1a')](util['format'](_0xdeff('0x31'),_0x965c5b[_0xdeff('0x5')]),_0x289f70);}};exports[_0xdeff('0xf')]=function(_0x54fa5b){try{if(!_[_0xdeff('0x32')](agents[_0x54fa5b[_0xdeff('0x16')]])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][agentcomplete]',_0x54fa5b[_0xdeff('0x5')]),_0x54fa5b);utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x33'),_0x54fa5b[_0xdeff('0x5')],agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x8')],_0x54fa5b[_0xdeff('0x16')]));agents[_0x54fa5b['destuniqueid']][_0xdeff('0xf')]=!![];agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x34')]=utils[_0xdeff('0x18')]();agents[_0x54fa5b[_0xdeff('0x16')]]['talktime']=utils[_0xdeff('0x35')](agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x34')],agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0x2c')]);agents[_0x54fa5b['destuniqueid']][_0xdeff('0x1f')]=_0x54fa5b['reason'];agents[_0x54fa5b[_0xdeff('0x16')]][_0xdeff('0xc')]=_0xdeff('0x36');writeDB(agents[_0x54fa5b[_0xdeff('0x16')]]);}}catch(_0xf58aa6){utils[_0xdeff('0x1a')](util['format']('[%s][agents][agentcomplete]',_0x54fa5b[_0xdeff('0x5')]),_0xf58aa6);}};exports[_0xdeff('0x37')]=function(_0x3dc206){try{if(!_['isNil'](agents[_0x3dc206['transfereruniqueid']])){utils[_0xdeff('0x24')](util[_0xdeff('0x3')]('[%s][agents][blindtransfer]',_0x3dc206[_0xdeff('0x5')]),_0x3dc206);utils[_0xdeff('0x2')](util[_0xdeff('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x3dc206[_0xdeff('0x5')],agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x8')],agents[_0x3dc206['transfereruniqueid']][_0xdeff('0x5')]));agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x39')]=!![];agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x3a')]=_0xdeff('0x3b');agents[_0x3dc206[_0xdeff('0x38')]]['transferexten']=_0x3dc206[_0xdeff('0x3c')];agents[_0x3dc206[_0xdeff('0x38')]]['transferuniqueid']=agents[_0x3dc206[_0xdeff('0x38')]][_0xdeff('0x5')];}}catch(_0x2967b4){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x3d'),_0x3dc206[_0xdeff('0x5')]),_0x2967b4);}};exports[_0xdeff('0x3e')]=function(_0x5ca032){try{utils[_0xdeff('0x24')](util[_0xdeff('0x3')](_0xdeff('0x3f'),_0x5ca032['origtransfereruniqueid']),_0x5ca032);if(_0x5ca032['origtransfereruniqueid']==_0x5ca032[_0xdeff('0x40')]){if(!_[_0xdeff('0x32')](agents[_0x5ca032[_0xdeff('0x41')]])){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x42'),_0x5ca032['origtransfereruniqueid'],agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x8')]));agents[_0x5ca032[_0xdeff('0x41')]]['transfer']=!![];agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x3a')]=_0xdeff('0x43');agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x44')]=_0x5ca032[_0xdeff('0x45')];agents[_0x5ca032['secondtransfereruniqueid']][_0xdeff('0x46')]=_0x5ca032[_0xdeff('0x47')];}if(_0x5ca032['transfereeuniqueid']&&agents[_0x5ca032[_0xdeff('0x48')]]){agents[_0x5ca032[_0xdeff('0x48')]]['agententerreason']=0x1;transfers[_0x5ca032[_0xdeff('0x48')]]=_[_0xdeff('0x49')](agents[_0x5ca032[_0xdeff('0x48')]]);transfers[_0x5ca032['transfereeuniqueid']]['calleridnum']=agents[_0x5ca032[_0xdeff('0x41')]]['calleridnum'];transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x4a')]=agents[_0x5ca032[_0xdeff('0x41')]][_0xdeff('0x4a')];transfers[_0x5ca032[_0xdeff('0x48')]]['agentcalledAt']=utils['now']();transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x2c')]=utils[_0xdeff('0x18')]();transfers[_0x5ca032[_0xdeff('0x48')]][_0xdeff('0x27')]=0x0;transfers[_0x5ca032[_0xdeff('0x48')]]['agententerreason']=0x2;}}else if(_0x5ca032[_0xdeff('0x41')]==_0x5ca032['secondtransfererlinkedid']){if(!_[_0xdeff('0x32')](agents[_0x5ca032[_0xdeff('0x47')]])){utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x42'),_0x5ca032[_0xdeff('0x47')],agents[_0x5ca032[_0xdeff('0x47')]][_0xdeff('0x8')]));agents[_0x5ca032[_0xdeff('0x47')]]['transfer']=!![];agents[_0x5ca032[_0xdeff('0x47')]]['transfertype']=_0xdeff('0x43');agents[_0x5ca032[_0xdeff('0x47')]]['transferexten']=_0x5ca032[_0xdeff('0x4b')];agents[_0x5ca032['origtransfereruniqueid']][_0xdeff('0x46')]=_0x5ca032['secondtransfereruniqueid'];}if(_0x5ca032['transfertargetuniqueid']&&agents[_0x5ca032[_0xdeff('0x4c')]]){agents[_0x5ca032[_0xdeff('0x4c')]]['agententerreason']=0x1;transfers[_0x5ca032[_0xdeff('0x4c')]]=_[_0xdeff('0x49')](agents[_0x5ca032[_0xdeff('0x4c')]]);transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0xa')]=agents[_0x5ca032[_0xdeff('0x47')]][_0xdeff('0xa')];transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x4a')]=agents[_0x5ca032['origtransfereruniqueid']][_0xdeff('0x4a')];transfers[_0x5ca032[_0xdeff('0x4c')]]['agentcalledAt']=utils['now']();transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x2c')]=utils['now']();transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x27')]=0x0;transfers[_0x5ca032[_0xdeff('0x4c')]][_0xdeff('0x4d')]=0x2;}}}catch(_0x194eed){utils[_0xdeff('0x1a')](util[_0xdeff('0x3')](_0xdeff('0x3f'),_0x5ca032[_0xdeff('0x47')]),_0x194eed);}};exports[_0xdeff('0x4e')]=function(_0x5ab2c5){try{utils[_0xdeff('0x24')](util[_0xdeff('0x3')](_0xdeff('0x4f'),_0x5ab2c5[_0xdeff('0x5')]),_0x5ab2c5);if(agents[_0x5ab2c5[_0xdeff('0x5')]]&&agents[_0x5ab2c5['uniqueid']]['reason']==='timeout'){if(_0x5ab2c5[_0xdeff('0x50')]==='21'){agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')]=_0xdeff('0x51');agents[_0x5ab2c5['uniqueid']]['lastevent']=_0xdeff('0x51');}utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x52'),_0x5ab2c5[_0xdeff('0x5')],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x8')],agents[_0x5ab2c5[_0xdeff('0x5')]]['reason'],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]));writeDB(agents[_0x5ab2c5[_0xdeff('0x5')]]);var _0x452fd4=unanswered[_0xdeff('0x53')](_0x5ab2c5[_0xdeff('0x5')]);if(_0x452fd4>-0x1){unanswered[_0xdeff('0x54')](_0x452fd4,0x1);}}if(transfers[_0x5ab2c5[_0xdeff('0x5')]]){transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xf')]=!![];transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x34')]=utils['now']();transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x28')]=utils[_0xdeff('0x35')](transfers[_0x5ab2c5['uniqueid']][_0xdeff('0x34')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x2c')]);transfers[_0x5ab2c5[_0xdeff('0x5')]]['reason']=_0xdeff('0x55');transfers[_0x5ab2c5[_0xdeff('0x5')]]['lastevent']=_0xdeff('0x36');utils[_0xdeff('0x2')](util[_0xdeff('0x3')](_0xdeff('0x52'),_0x5ab2c5[_0xdeff('0x5')],transfers[_0x5ab2c5['uniqueid']][_0xdeff('0x8')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')],transfers[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]));writeDB(transfers[_0x5ab2c5['uniqueid']],!![]);}if(agents[_0x5ab2c5[_0xdeff('0x5')]]&&agents[_0x5ab2c5[_0xdeff('0x5')]]['agentconnectAt']){agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xf')]=!![];agents[_0x5ab2c5[_0xdeff('0x5')]]['agentcompleteAt']=utils[_0xdeff('0x18')]();agents[_0x5ab2c5[_0xdeff('0x5')]]['talktime']=utils[_0xdeff('0x35')](agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x34')],agents[_0x5ab2c5[_0xdeff('0x5')]]['agentconnectAt']);agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')]=agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x39')]?_0xdeff('0x39'):_0xdeff('0x55');agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0xc')]=_0xdeff('0x36');utils['info'](util[_0xdeff('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ab2c5[_0xdeff('0x5')],agents[_0x5ab2c5['uniqueid']]['membername'],agents[_0x5ab2c5[_0xdeff('0x5')]][_0xdeff('0x1f')],agents[_0x5ab2c5['uniqueid']][_0xdeff('0xc')]));writeDB(agents[_0x5ab2c5[_0xdeff('0x5')]]);}}catch(_0xd49939){utils[_0xdeff('0x1a')](util['format'](_0xdeff('0x4f'),_0x5ab2c5[_0xdeff('0x5')]),_0xd49939);}}; \ No newline at end of file +var _0xea28=['agentcalled','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','reason','ringtime','talktime','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid'];(function(_0x1875a9,_0x58aebe){var _0x4ce0f7=function(_0x1b3b95){while(--_0x1b3b95){_0x1875a9['push'](_0x1875a9['shift']());}};_0x4ce0f7(++_0x58aebe);}(_0xea28,0x13a));var _0x8ea2=function(_0x143f4d,_0x140eb2){_0x143f4d=_0x143f4d-0x0;var _0x2bec39=_0xea28[_0x143f4d];return _0x2bec39;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var utils=require(_0x8ea2('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x26155f,_0x459c4e){utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x5'),_0x26155f['uniqueid'],_0x26155f[_0x8ea2('0x6')],_0x26155f[_0x8ea2('0x7')],_0x26155f[_0x8ea2('0x8')],_0x26155f['interface'],_0x26155f[_0x8ea2('0x9')],_0x26155f[_0x8ea2('0xa')],_0x26155f[_0x8ea2('0xb')]));if(_0x26155f[_0x8ea2('0x7')]){utils[_0x8ea2('0xc')](_0x26155f[_0x8ea2('0x7')])[_0x8ea2('0xd')](function(_0x320750){if(_0x320750){_0x26155f[_0x8ea2('0xe')]=_0x320750[_0x8ea2('0xe')];_0x26155f[_0x8ea2('0xf')]=_0x26155f[_0x8ea2('0x10')]?_0x320750['acw']:![];_0x26155f['acwtime']=_0x26155f[_0x8ea2('0xf')]?_0x320750[_0x8ea2('0x11')]:0x0;}utils[_0x8ea2('0x12')]('CreateVoiceAgentReport',_0x26155f);});}else{utils[_0x8ea2('0x12')](_0x8ea2('0x13'),_0x26155f);}if(_0x459c4e){delete transfers[_0x26155f[_0x8ea2('0x14')]];}else{delete agents[_0x26155f[_0x8ea2('0x15')]];}}exports[_0x8ea2('0x16')]=function(_0x5e662e){try{utils[_0x8ea2('0x17')](util['format']('[%s][agents][agentcalled]',_0x5e662e[_0x8ea2('0x14')]),_0x5e662e);agents[_0x5e662e[_0x8ea2('0x15')]]=_0x5e662e;agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0x18')]=utils[_0x8ea2('0x19')]();agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0xb')]=_0x8ea2('0x1a');agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0xa')]=null;agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0x1b')]=null;utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x1c'),_0x5e662e[_0x8ea2('0x14')],agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x5e662e[_0x8ea2('0x15')]));}catch(_0x233a40){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')]('[%s][agents][agentcalled]',_0x5e662e['uniqueid']),_0x233a40);}};exports[_0x8ea2('0x1e')]=function(_0x248c18){try{if(!_[_0x8ea2('0x1f')](agents[_0x248c18['destuniqueid']])){utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')]('[%s][agents][agentringnoanswer]',_0x248c18[_0x8ea2('0x14')]),_0x248c18);utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x20'),_0x248c18[_0x8ea2('0x14')],agents[_0x248c18[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x248c18[_0x8ea2('0x15')]));agents[_0x248c18[_0x8ea2('0x15')]]['agentringnoanswer']=!![];agents[_0x248c18[_0x8ea2('0x15')]]['agentringnoanswerAt']=utils[_0x8ea2('0x19')]();agents[_0x248c18[_0x8ea2('0x15')]][_0x8ea2('0xb')]='timeout';agents[_0x248c18['destuniqueid']][_0x8ea2('0x21')]='timeout';agents[_0x248c18[_0x8ea2('0x15')]]['holdtime']=_0x248c18[_0x8ea2('0x22')]?parseInt(_0x248c18[_0x8ea2('0x22')])/0x3e8:0x0;agents[_0x248c18[_0x8ea2('0x15')]][_0x8ea2('0x23')]=0x0;unanswered['push'](_0x248c18['destuniqueid']);}}catch(_0xacaa6c){utils['error'](util[_0x8ea2('0x4')](_0x8ea2('0x24'),_0x248c18[_0x8ea2('0x14')]),_0xacaa6c);}};exports[_0x8ea2('0x25')]=function(_0x307c74){try{_[_0x8ea2('0x26')](agents,function(_0x32e225,_0x316707){if(_0x32e225[_0x8ea2('0x14')]==_0x307c74[_0x8ea2('0x14')]&&!_['includes'](unanswered,_0x32e225['destuniqueid'])){utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')]('[%s][agents][queuecallerabandon]',_0x307c74['uniqueid']),_0x307c74);utils[_0x8ea2('0x3')](util['format'](_0x8ea2('0x27'),_0x307c74[_0x8ea2('0x14')],_0x32e225['membername'],_0x32e225[_0x8ea2('0x15')]));_0x32e225[_0x8ea2('0x1e')]=!![];_0x32e225[_0x8ea2('0x28')]=utils['now']();_0x32e225['lastevent']='abandoned';_0x32e225[_0x8ea2('0x21')]=_0x8ea2('0x29');_0x32e225[_0x8ea2('0x2a')]=_0x307c74['holdtime'];_0x32e225[_0x8ea2('0x23')]=0x0;writeDB(_0x32e225);}});}catch(_0x391b08){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x2b'),_0x307c74[_0x8ea2('0x14')]),_0x391b08);}};exports[_0x8ea2('0x2c')]=function(_0x1fc76a){try{if(agents[_0x1fc76a['destuniqueid']]){utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')](_0x8ea2('0x2d'),_0x1fc76a[_0x8ea2('0x14')]),_0x1fc76a);utils['info'](util[_0x8ea2('0x4')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x1fc76a[_0x8ea2('0x14')],agents[_0x1fc76a[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x1fc76a[_0x8ea2('0x15')]));agents[_0x1fc76a['destuniqueid']][_0x8ea2('0x2e')]=utils['now']();agents[_0x1fc76a['destuniqueid']][_0x8ea2('0xa')]=_0x1fc76a['connectedlinenum'];agents[_0x1fc76a[_0x8ea2('0x15')]][_0x8ea2('0x1b')]=_0x1fc76a[_0x8ea2('0x1b')];agents[_0x1fc76a[_0x8ea2('0x15')]][_0x8ea2('0x2a')]=_0x1fc76a['ringtime'];agents[_0x1fc76a[_0x8ea2('0x15')]]['lastevent']=_0x8ea2('0x2f');_[_0x8ea2('0x26')](agents,function(_0x6d0e0c,_0x3995ff){if(_0x6d0e0c['destuniqueid']!=_0x1fc76a[_0x8ea2('0x15')]&&_0x6d0e0c['uniqueid']==_0x1fc76a[_0x8ea2('0x14')]){_0x6d0e0c['talktime']=0x0;_0x6d0e0c[_0x8ea2('0x2a')]=_0x1fc76a[_0x8ea2('0x22')];_0x6d0e0c[_0x8ea2('0x1e')]=!![];_0x6d0e0c[_0x8ea2('0x28')]=utils[_0x8ea2('0x19')]();_0x6d0e0c[_0x8ea2('0xb')]=_0x8ea2('0x30');_0x6d0e0c['reason']='answered_elsewhere';_0x6d0e0c[_0x8ea2('0x31')]=_0x1fc76a['destuniqueid'];_0x6d0e0c['answeredelsewheremembername']=_0x1fc76a['membername'];writeDB(_0x6d0e0c);}});}}catch(_0x3cbc09){utils['error'](util[_0x8ea2('0x4')](_0x8ea2('0x2d'),_0x1fc76a[_0x8ea2('0x14')]),_0x3cbc09);}};exports[_0x8ea2('0x10')]=function(_0x989d9b){try{if(!_[_0x8ea2('0x1f')](agents[_0x989d9b[_0x8ea2('0x15')]])){utils[_0x8ea2('0x17')](util['format'](_0x8ea2('0x32'),_0x989d9b[_0x8ea2('0x14')]),_0x989d9b);utils[_0x8ea2('0x3')](util['format'](_0x8ea2('0x33'),_0x989d9b[_0x8ea2('0x14')],agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x989d9b[_0x8ea2('0x15')]));agents[_0x989d9b['destuniqueid']][_0x8ea2('0x10')]=!![];agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x34')]=utils['now']();agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x23')]=utils[_0x8ea2('0x35')](agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x34')],agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x2e')]);agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x21')]=_0x989d9b[_0x8ea2('0x21')];agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0xb')]=_0x8ea2('0x36');writeDB(agents[_0x989d9b[_0x8ea2('0x15')]]);}}catch(_0x5c1212){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x32'),_0x989d9b[_0x8ea2('0x14')]),_0x5c1212);}};exports[_0x8ea2('0x37')]=function(_0x1daa25){try{if(!_[_0x8ea2('0x1f')](agents[_0x1daa25[_0x8ea2('0x38')]])){utils['debug'](util[_0x8ea2('0x4')](_0x8ea2('0x39'),_0x1daa25[_0x8ea2('0x14')]),_0x1daa25);utils['info'](util['format'](_0x8ea2('0x3a'),_0x1daa25[_0x8ea2('0x14')],agents[_0x1daa25[_0x8ea2('0x38')]]['membername'],agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x14')]));agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x3b')]=!![];agents[_0x1daa25[_0x8ea2('0x38')]]['transfertype']='blind';agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x3c')]=_0x1daa25[_0x8ea2('0x3d')];agents[_0x1daa25['transfereruniqueid']][_0x8ea2('0x3e')]=agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x14')];}}catch(_0x54c9d7){utils['error'](util['format']('[%s][agents][blindtransfer]',_0x1daa25['uniqueid']),_0x54c9d7);}};exports[_0x8ea2('0x3f')]=function(_0x3020ad){try{utils['debug'](util['format'](_0x8ea2('0x40'),_0x3020ad[_0x8ea2('0x41')]),_0x3020ad);if(_0x3020ad[_0x8ea2('0x41')]==_0x3020ad['origtransfererlinkedid']){if(!_[_0x8ea2('0x1f')](agents[_0x3020ad[_0x8ea2('0x42')]])){utils['info'](util[_0x8ea2('0x4')](_0x8ea2('0x43'),_0x3020ad[_0x8ea2('0x41')],agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x8')]));agents[_0x3020ad['secondtransfereruniqueid']]['transfer']=!![];agents[_0x3020ad['secondtransfereruniqueid']][_0x8ea2('0x44')]=_0x8ea2('0x45');agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x3c')]=_0x3020ad[_0x8ea2('0x46')];agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x3e')]=_0x3020ad['origtransfereruniqueid'];}if(_0x3020ad['transfereeuniqueid']&&agents[_0x3020ad['transfereeuniqueid']]){agents[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x48')]=0x1;transfers[_0x3020ad[_0x8ea2('0x47')]]=_[_0x8ea2('0x49')](agents[_0x3020ad['transfereeuniqueid']]);transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x9')]=agents[_0x3020ad['secondtransfereruniqueid']][_0x8ea2('0x9')];transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x4a')]=agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x4a')];transfers[_0x3020ad['transfereeuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x2e')]=utils[_0x8ea2('0x19')]();transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x2a')]=0x0;transfers[_0x3020ad['transfereeuniqueid']][_0x8ea2('0x48')]=0x2;}}else if(_0x3020ad[_0x8ea2('0x42')]==_0x3020ad[_0x8ea2('0x4b')]){if(!_[_0x8ea2('0x1f')](agents[_0x3020ad['origtransfereruniqueid']])){utils[_0x8ea2('0x3')](util['format'](_0x8ea2('0x43'),_0x3020ad['origtransfereruniqueid'],agents[_0x3020ad[_0x8ea2('0x41')]][_0x8ea2('0x8')]));agents[_0x3020ad['origtransfereruniqueid']]['transfer']=!![];agents[_0x3020ad[_0x8ea2('0x41')]]['transfertype']=_0x8ea2('0x45');agents[_0x3020ad[_0x8ea2('0x41')]][_0x8ea2('0x3c')]=_0x3020ad[_0x8ea2('0x4c')];agents[_0x3020ad['origtransfereruniqueid']][_0x8ea2('0x3e')]=_0x3020ad[_0x8ea2('0x42')];}if(_0x3020ad[_0x8ea2('0x4d')]&&agents[_0x3020ad[_0x8ea2('0x4d')]]){agents[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x48')]=0x1;transfers[_0x3020ad[_0x8ea2('0x4d')]]=_[_0x8ea2('0x49')](agents[_0x3020ad[_0x8ea2('0x4d')]]);transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x9')]=agents[_0x3020ad[_0x8ea2('0x41')]]['calleridnum'];transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x4a')]=agents[_0x3020ad[_0x8ea2('0x41')]][_0x8ea2('0x4a')];transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x18')]=utils[_0x8ea2('0x19')]();transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x2e')]=utils[_0x8ea2('0x19')]();transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x2a')]=0x0;transfers[_0x3020ad['transfertargetuniqueid']][_0x8ea2('0x48')]=0x2;}}}catch(_0x383027){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x40'),_0x3020ad['origtransfereruniqueid']),_0x383027);}};exports['hangup']=function(_0x5d4d9e){try{utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')](_0x8ea2('0x4e'),_0x5d4d9e[_0x8ea2('0x14')]),_0x5d4d9e);if(agents[_0x5d4d9e[_0x8ea2('0x14')]]&&agents[_0x5d4d9e[_0x8ea2('0x14')]]['reason']===_0x8ea2('0x4f')){if(_0x5d4d9e[_0x8ea2('0x50')]==='21'){agents[_0x5d4d9e['uniqueid']]['reason']=_0x8ea2('0x51');agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]=_0x8ea2('0x51');}utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x52'),_0x5d4d9e['uniqueid'],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x8')],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')],agents[_0x5d4d9e['uniqueid']][_0x8ea2('0xb')]));writeDB(agents[_0x5d4d9e[_0x8ea2('0x14')]]);var _0x115d5f=unanswered['indexOf'](_0x5d4d9e[_0x8ea2('0x14')]);if(_0x115d5f>-0x1){unanswered['splice'](_0x115d5f,0x1);}}if(transfers[_0x5d4d9e['uniqueid']]){transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x10')]=!![];transfers[_0x5d4d9e['uniqueid']]['agentcompleteAt']=utils['now']();transfers[_0x5d4d9e[_0x8ea2('0x14')]]['talktime']=utils['diffTime'](transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x34')],transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x2e')]);transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')]=_0x8ea2('0x53');transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]=_0x8ea2('0x36');utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x52'),_0x5d4d9e[_0x8ea2('0x14')],transfers[_0x5d4d9e['uniqueid']][_0x8ea2('0x8')],transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')],transfers[_0x5d4d9e['uniqueid']][_0x8ea2('0xb')]));writeDB(transfers[_0x5d4d9e['uniqueid']],!![]);}if(agents[_0x5d4d9e[_0x8ea2('0x14')]]&&agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x2e')]){agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x10')]=!![];agents[_0x5d4d9e[_0x8ea2('0x14')]]['agentcompleteAt']=utils[_0x8ea2('0x19')]();agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x23')]=utils[_0x8ea2('0x35')](agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x34')],agents[_0x5d4d9e[_0x8ea2('0x14')]]['agentconnectAt']);agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x21')]=agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x3b')]?_0x8ea2('0x3b'):_0x8ea2('0x53');agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]=_0x8ea2('0x36');utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5d4d9e[_0x8ea2('0x14')],agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x8')],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]));writeDB(agents[_0x5d4d9e[_0x8ea2('0x14')]]);}}catch(_0x4b4d64){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x4e'),_0x5d4d9e[_0x8ea2('0x14')]),_0x4b4d64);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 6989a8d..eb67ade 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 _0xe928=['BUSY','uniqueid','blinds','transfereeuniqueid','info','format','channel','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','request','CreateVoiceCallReport','recording','newchannel','debug','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','destinationchannel','answertime','ANSWERED','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','starttime','billableseconds','endtime','error','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','localtwolinkedid','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED'];(function(_0x59d6d8,_0x4e81ae){var _0x45e804=function(_0x74869c){while(--_0x74869c){_0x59d6d8['push'](_0x59d6d8['shift']());}};_0x45e804(++_0x4e81ae);}(_0xe928,0x145));var _0x8e92=function(_0x1bc989,_0x4130ce){_0x1bc989=_0x1bc989-0x0;var _0x488ead=_0xe928[_0x1bc989];return _0x488ead;};'use strict';var _=require(_0x8e92('0x0'));var util=require(_0x8e92('0x1'));var utils=require(_0x8e92('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x8e92('0x3'),'FAILED',_0x8e92('0x4'),_0x8e92('0x3'),_0x8e92('0x3'),_0x8e92('0x3'),'ANSWERED',_0x8e92('0x5'),'FAILED',_0x8e92('0x4'),_0x8e92('0x4')];var channels={};function writeDB(_0x14811b){var _0x76e11;if(transfers['blinds'][_0x14811b[_0x8e92('0x6')]]){_0x76e11=_0x14811b['uniqueid'];_0x14811b[_0x8e92('0x6')]=transfers[_0x8e92('0x7')][_0x14811b[_0x8e92('0x6')]][_0x8e92('0x8')];}utils[_0x8e92('0x9')](util[_0x8e92('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x14811b[_0x8e92('0x6')],_0x14811b[_0x8e92('0xb')],_0x14811b[_0x8e92('0xc')],_0x14811b['membername'],_0x14811b[_0x8e92('0xd')],_0x14811b[_0x8e92('0xe')],_0x14811b[_0x8e92('0xf')],_0x14811b[_0x8e92('0x10')]));if(_0x14811b[_0x8e92('0x11')]){utils[_0x8e92('0x12')](_0x14811b[_0x8e92('0x11')])['then'](function(_0x97be72){if(_0x97be72){_0x14811b['UserId']=_0x97be72['id'];}utils[_0x8e92('0x13')](_0x8e92('0x14'),_0x14811b);});}else{utils['request'](_0x8e92('0x14'),_0x14811b);}if(channels[_0x14811b['uniqueid']]){delete channels[_0x14811b[_0x8e92('0x6')]];}else if(_0x76e11&&channels[_0x76e11]){if(!transfers[_0x8e92('0x7')][_0x76e11][_0x8e92('0x15')])delete transfers[_0x8e92('0x7')][_0x76e11];delete channels[_0x76e11];}}exports[_0x8e92('0x16')]=function(_0x1a80d2){try{utils[_0x8e92('0x17')](util[_0x8e92('0xa')]('[%s][calls][newchannel]',_0x1a80d2[_0x8e92('0x6')]),_0x1a80d2);if(_0x1a80d2[_0x8e92('0x6')]==_0x1a80d2[_0x8e92('0x18')]&&_0x1a80d2[_0x8e92('0xb')]!=_0x8e92('0x19')){utils['info'](util[_0x8e92('0xa')](_0x8e92('0x1a'),_0x1a80d2['uniqueid'],_0x1a80d2['context'],_0x1a80d2['exten']));channels[_0x1a80d2[_0x8e92('0x6')]]={'uniqueid':_0x1a80d2['uniqueid'],'accountcode':_0x1a80d2[_0x8e92('0x11')],'source':_0x1a80d2[_0x8e92('0xe')],'destination':_0x1a80d2[_0x8e92('0x1b')],'destinationcontext':_0x1a80d2[_0x8e92('0x1c')],'channel':_0x1a80d2[_0x8e92('0xb')],'starttime':utils[_0x8e92('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x53b5aa){utils['error'](util[_0x8e92('0xa')](_0x8e92('0x1e'),_0x1a80d2[_0x8e92('0x6')]),_0x53b5aa);}};exports[_0x8e92('0x1f')]=function(_0x250f84){try{utils[_0x8e92('0x17')](util['format'](_0x8e92('0x20'),_0x250f84[_0x8e92('0x6')]),_0x250f84);if(!_[_0x8e92('0x21')](channels[_0x250f84[_0x8e92('0x6')]])&&_0x250f84[_0x8e92('0x22')]==0x6){utils[_0x8e92('0x9')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x250f84['uniqueid'],_0x250f84[_0x8e92('0x1c')],_0x250f84['channel']));if(_[_0x8e92('0x21')](channels[_0x250f84['uniqueid']][_0x8e92('0x23')])){channels[_0x250f84['uniqueid']][_0x8e92('0x23')]=utils[_0x8e92('0x1d')]();}}else if(!_[_0x8e92('0x21')](channels[_0x250f84[_0x8e92('0x18')]])&&_0x250f84[_0x8e92('0x22')]==0x6&&_0x250f84[_0x8e92('0x1c')]!='transfer'){utils[_0x8e92('0x9')](util[_0x8e92('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x250f84[_0x8e92('0x6')],_0x250f84['linkedid'],_0x250f84[_0x8e92('0x1c')],_0x250f84[_0x8e92('0xb')]));channels[_0x250f84['linkedid']][_0x8e92('0x11')]=_0x250f84[_0x8e92('0x11')];channels[_0x250f84[_0x8e92('0x18')]][_0x8e92('0x24')]=_0x250f84[_0x8e92('0xb')];if(_[_0x8e92('0x21')](channels[_0x250f84[_0x8e92('0x18')]][_0x8e92('0x25')])){channels[_0x250f84[_0x8e92('0x18')]]['answertime']=utils['now']();}channels[_0x250f84[_0x8e92('0x18')]]['disposition']=dispositions[_['toNumber'](_0x250f84[_0x8e92('0x22')])]||_0x8e92('0x26');}}catch(_0x3cea2c){utils['error'](util[_0x8e92('0xa')](_0x8e92('0x20'),_0x250f84[_0x8e92('0x6')]),_0x3cea2c);}};exports['hangup']=function(_0x4f37dd){try{if(!_[_0x8e92('0x21')](channels[_0x4f37dd['uniqueid']])){utils[_0x8e92('0x17')](util[_0x8e92('0xa')](_0x8e92('0x27'),_0x4f37dd[_0x8e92('0x6')]),_0x4f37dd);if(_[_0x8e92('0x21')](channels[_0x4f37dd['uniqueid']][_0x8e92('0x28')])){channels[_0x4f37dd[_0x8e92('0x6')]][_0x8e92('0x28')]=_0x4f37dd['calleridname']+'\x20<'+_0x4f37dd['calleridnum']+'>';}utils[_0x8e92('0x9')](util['format'](_0x8e92('0x29'),_0x4f37dd[_0x8e92('0x6')],channels[_0x4f37dd[_0x8e92('0x6')]][_0x8e92('0x28')],_0x4f37dd['cause-txt']));channels[_0x4f37dd['uniqueid']]['endtime']=utils[_0x8e92('0x1d')]();channels[_0x4f37dd['uniqueid']][_0x8e92('0x2a')]=utils['diffTime'](channels[_0x4f37dd['uniqueid']]['endtime'],channels[_0x4f37dd[_0x8e92('0x6')]][_0x8e92('0x2b')]);channels[_0x4f37dd[_0x8e92('0x6')]][_0x8e92('0x2c')]=channels[_0x4f37dd[_0x8e92('0x6')]][_0x8e92('0x25')]?utils['diffTime'](channels[_0x4f37dd[_0x8e92('0x6')]][_0x8e92('0x2d')],channels[_0x4f37dd[_0x8e92('0x6')]][_0x8e92('0x25')]):0x0;writeDB(channels[_0x4f37dd['uniqueid']]);}}catch(_0x8162b2){utils[_0x8e92('0x2e')](util['format'](_0x8e92('0x27'),_0x4f37dd[_0x8e92('0x6')]),_0x8162b2);}};exports['attendedtransfer']=function(_0x5e8fa4){try{if(!_[_0x8e92('0x21')](channels[_0x5e8fa4['localtwolinkedid']])){utils['debug'](util[_0x8e92('0xa')](_0x8e92('0x2f'),_0x5e8fa4[_0x8e92('0x30')]),_0x5e8fa4);if(channels[_0x5e8fa4['localtwolinkedid']][_0x8e92('0xb')]==_0x5e8fa4[_0x8e92('0x31')]){utils[_0x8e92('0x9')](util[_0x8e92('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5e8fa4[_0x8e92('0x30')],_0x5e8fa4['localtwolinkedid'],_0x5e8fa4[_0x8e92('0x32')]));channels[_0x5e8fa4[_0x8e92('0x33')]]['destinationchannel']=_0x5e8fa4[_0x8e92('0x32')];channels[_0x5e8fa4[_0x8e92('0x33')]][_0x8e92('0x34')]=_0x8e92('0x35');}else if(channels[_0x5e8fa4[_0x8e92('0x33')]][_0x8e92('0xb')]=_0x5e8fa4[_0x8e92('0x36')]){utils[_0x8e92('0x9')](util[_0x8e92('0xa')](_0x8e92('0x37'),_0x5e8fa4[_0x8e92('0x30')],_0x5e8fa4[_0x8e92('0x33')],_0x5e8fa4['origtransfererchannel']));channels[_0x5e8fa4[_0x8e92('0x33')]][_0x8e92('0x24')]=_0x5e8fa4[_0x8e92('0x38')];channels[_0x5e8fa4[_0x8e92('0x33')]]['userfield']=_0x8e92('0x35');}}}catch(_0x42ccd4){utils[_0x8e92('0x2e')](util['format'](_0x8e92('0x2f'),_0x5e8fa4[_0x8e92('0x30')]),_0x42ccd4);}};exports[_0x8e92('0x39')]=function(_0x3a3778){try{if(!_[_0x8e92('0x21')](channels[_0x3a3778[_0x8e92('0x6')]])){utils[_0x8e92('0x17')](util[_0x8e92('0xa')](_0x8e92('0x3a'),_0x3a3778[_0x8e92('0x6')]),_0x3a3778);channels[_0x3a3778[_0x8e92('0x6')]][_0x8e92('0x3b')]=utils['now']();utils[_0x8e92('0x9')](util[_0x8e92('0xa')](_0x8e92('0x3c'),_0x3a3778[_0x8e92('0x6')],channels[_0x3a3778[_0x8e92('0x6')]][_0x8e92('0x3b')]));}}catch(_0x58867a){utils[_0x8e92('0x2e')](util[_0x8e92('0xa')](_0x8e92('0x3a'),_0x3a3778[_0x8e92('0x6')]),_0x58867a);}};exports[_0x8e92('0x3d')]=function(_0x2a7ffe){try{if(!_[_0x8e92('0x21')](channels[_0x2a7ffe[_0x8e92('0x6')]])){utils[_0x8e92('0x17')](util[_0x8e92('0xa')](_0x8e92('0x3e'),_0x2a7ffe[_0x8e92('0x6')]),_0x2a7ffe);if(!_[_0x8e92('0x21')](channels[_0x2a7ffe[_0x8e92('0x6')]]['musiconholdstartAt'])){channels[_0x2a7ffe[_0x8e92('0x6')]]['mohtime']+=utils['diffTime'](utils[_0x8e92('0x1d')](),channels[_0x2a7ffe[_0x8e92('0x6')]]['musiconholdstartAt']);utils['info'](util[_0x8e92('0xa')](_0x8e92('0x3f'),_0x2a7ffe[_0x8e92('0x6')],channels[_0x2a7ffe[_0x8e92('0x6')]][_0x8e92('0x40')]));delete channels[_0x2a7ffe[_0x8e92('0x6')]][_0x8e92('0x3b')];}}}catch(_0x3a31d9){utils[_0x8e92('0x2e')](util[_0x8e92('0xa')](_0x8e92('0x3e'),_0x2a7ffe[_0x8e92('0x6')]),_0x3a31d9);}};exports[_0x8e92('0x41')]=function(_0x3e726d){try{if(!_[_0x8e92('0x21')](channels[_0x3e726d[_0x8e92('0x6')]])){utils['debug'](util[_0x8e92('0xa')](_0x8e92('0x42'),_0x3e726d['uniqueid']),_0x3e726d);if(!_['isNil'](_0x3e726d[_0x8e92('0x43')][_0x8e92('0x44')])){utils[_0x8e92('0x9')](util[_0x8e92('0xa')](_0x8e92('0x45'),_0x3e726d['uniqueid'],_0x3e726d[_0x8e92('0x46')]));channels[_0x3e726d['uniqueid']][_0x8e92('0x47')]=_0x3e726d['value'];}if(!_[_0x8e92('0x21')](_0x3e726d[_0x8e92('0x43')][_0x8e92('0x48')])){utils[_0x8e92('0x9')](util[_0x8e92('0xa')](_0x8e92('0x49'),_0x3e726d[_0x8e92('0x6')],_0x3e726d[_0x8e92('0x46')]));channels[_0x3e726d['uniqueid']][_0x8e92('0x4a')]=_0x3e726d[_0x8e92('0x46')];channels[_0x3e726d[_0x8e92('0x6')]]['callerid']='\x22'+_0x3e726d[_0x8e92('0x46')]+_0x8e92('0x4b')+_0x3e726d[_0x8e92('0x46')]+'>';}if(!_[_0x8e92('0x21')](_0x3e726d[_0x8e92('0x43')][_0x8e92('0x4c')])||!_[_0x8e92('0x21')](_0x3e726d['variable'][_0x8e92('0x4d')])){utils[_0x8e92('0x9')](util[_0x8e92('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x3e726d['uniqueid'],!_['isNil'](_0x3e726d[_0x8e92('0x43')][_0x8e92('0x4c')])?_0x8e92('0x4c'):_0x8e92('0x4d'),_0x3e726d[_0x8e92('0x46')]));channels[_0x3e726d[_0x8e92('0x6')]][_0x8e92('0x28')]=_0x3e726d['value'];}if(!_[_0x8e92('0x21')](_0x3e726d[_0x8e92('0x43')][_0x8e92('0x4e')])||!_[_0x8e92('0x21')](_0x3e726d[_0x8e92('0x43')][_0x8e92('0x4f')])){utils['info'](util[_0x8e92('0xa')](_0x8e92('0x50'),_0x3e726d['uniqueid'],!_[_0x8e92('0x21')](_0x3e726d['variable'][_0x8e92('0x4e')])?_0x8e92('0x4e'):_0x8e92('0x4f'),_0x3e726d['value']));channels[_0x3e726d[_0x8e92('0x6')]][_0x8e92('0x51')]=_0x8e92('0x52');channels[_0x3e726d['uniqueid']][_0x8e92('0x53')]=_0x3e726d[_0x8e92('0x46')];channels[_0x3e726d[_0x8e92('0x6')]]['queue']=!![];}if(!_[_0x8e92('0x21')](_0x3e726d['variable'][_0x8e92('0x54')])){utils[_0x8e92('0x9')](util['format'](_0x8e92('0x55'),_0x3e726d[_0x8e92('0x6')],_0x3e726d['value']));channels[_0x3e726d[_0x8e92('0x6')]][_0x8e92('0x56')]=_0x3e726d[_0x8e92('0x46')];}if(!_['isNil'](_0x3e726d[_0x8e92('0x43')][_0x8e92('0x57')])){utils[_0x8e92('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x3e726d[_0x8e92('0x6')],_0x3e726d[_0x8e92('0x46')]));channels[_0x3e726d[_0x8e92('0x6')]][_0x8e92('0x58')]=_0x3e726d[_0x8e92('0x46')];}if(!_['isNil'](_0x3e726d[_0x8e92('0x43')][_0x8e92('0x59')])){utils[_0x8e92('0x9')](util[_0x8e92('0xa')](_0x8e92('0x5a'),_0x3e726d['uniqueid'],_0x3e726d[_0x8e92('0x46')]));channels[_0x3e726d[_0x8e92('0x6')]][_0x8e92('0x5b')]=_0x3e726d[_0x8e92('0x46')];}if(!_[_0x8e92('0x21')](_0x3e726d[_0x8e92('0x43')][_0x8e92('0x5c')])){utils[_0x8e92('0x9')](util['format'](_0x8e92('0x5d'),_0x3e726d[_0x8e92('0x6')],_0x3e726d[_0x8e92('0x46')]));channels[_0x3e726d[_0x8e92('0x6')]][_0x8e92('0x5c')]=_0x3e726d['value'];}}}catch(_0x33372e){utils[_0x8e92('0x2e')](util[_0x8e92('0xa')](_0x8e92('0x42'),_0x3e726d[_0x8e92('0x6')]),_0x33372e);}};exports[_0x8e92('0x5e')]=function(_0x1d5ed1){try{if(!_['isNil'](channels[_0x1d5ed1['uniqueid']])){utils['debug'](util[_0x8e92('0xa')](_0x8e92('0x5f'),_0x1d5ed1[_0x8e92('0x6')]),_0x1d5ed1);utils[_0x8e92('0x9')](util[_0x8e92('0xa')](_0x8e92('0x60'),_0x1d5ed1[_0x8e92('0x6')],_0x1d5ed1[_0x8e92('0x61')],_0x1d5ed1[_0x8e92('0x62')]));if(_0x1d5ed1[_0x8e92('0x61')][_0x8e92('0x63')]()=='set'&&_[_0x8e92('0x64')](_0x1d5ed1[_0x8e92('0x62')][_0x8e92('0x63')](),_0x8e92('0x65'))){var _0x2c72a3=_0x1d5ed1[_0x8e92('0x62')][_0x8e92('0x66')]('=');var _0x4c1988=_0x2c72a3[0x0][_0x8e92('0x67')](_0x2c72a3[0x0][_0x8e92('0x68')]('(')+0x1,_0x2c72a3[0x0][_0x8e92('0x68')](')'));var _0xd7a8ca=_0x2c72a3[0x1];channels[_0x1d5ed1[_0x8e92('0x6')]][_0x4c1988]=_0xd7a8ca;}if(!_[_0x8e92('0x69')]([_0x8e92('0x6a'),_0x8e92('0x6b'),_0x8e92('0x6c'),'set',_0x8e92('0x6d')],_0x1d5ed1[_0x8e92('0x61')][_0x8e92('0x63')]())){channels[_0x1d5ed1[_0x8e92('0x6')]][_0x8e92('0x51')]=_0x1d5ed1[_0x8e92('0x61')];channels[_0x1d5ed1[_0x8e92('0x6')]]['lastdata']=_0x1d5ed1[_0x8e92('0x62')];}}}catch(_0x196821){utils['error'](util[_0x8e92('0xa')](_0x8e92('0x5f'),_0x1d5ed1['uniqueid']),_0x196821);}}; \ No newline at end of file +var _0x781d=['FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','info','context','exten','error','newstate','isNil','channelstate','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','now','disposition','[%s][calls][newstate]','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','origtransfereruniqueid','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','userfield','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','includes','hangup','noop','execif','gotoif','lastdata','lodash','util','NO\x20ANSWER'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x781d,0x14a));var _0xd781=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x781d[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=[_0xd781('0x2'),_0xd781('0x3'),_0xd781('0x3'),_0xd781('0x2'),_0xd781('0x2'),_0xd781('0x2'),_0xd781('0x4'),_0xd781('0x5'),_0xd781('0x3'),_0xd781('0x3'),'FAILED'];var channels={};function writeDB(_0x133509){var _0x1a242d;if(transfers[_0xd781('0x6')][_0x133509[_0xd781('0x7')]]){_0x1a242d=_0x133509['uniqueid'];_0x133509[_0xd781('0x7')]=transfers['blinds'][_0x133509[_0xd781('0x7')]][_0xd781('0x8')];}utils['info'](util[_0xd781('0x9')](_0xd781('0xa'),_0x133509['uniqueid'],_0x133509['channel'],_0x133509[_0xd781('0xb')],_0x133509[_0xd781('0xc')],_0x133509[_0xd781('0xd')],_0x133509[_0xd781('0xe')],_0x133509[_0xd781('0xf')],_0x133509[_0xd781('0x10')]));if(_0x133509[_0xd781('0x11')]){utils[_0xd781('0x12')](_0x133509[_0xd781('0x11')])[_0xd781('0x13')](function(_0xd454e7){if(_0xd454e7){_0x133509['UserId']=_0xd454e7['id'];}utils[_0xd781('0x14')](_0xd781('0x15'),_0x133509);});}else{utils['request'](_0xd781('0x15'),_0x133509);}if(channels[_0x133509['uniqueid']]){delete channels[_0x133509[_0xd781('0x7')]];}else if(_0x1a242d&&channels[_0x1a242d]){if(!transfers[_0xd781('0x6')][_0x1a242d][_0xd781('0x16')])delete transfers[_0xd781('0x6')][_0x1a242d];delete channels[_0x1a242d];}}exports[_0xd781('0x17')]=function(_0x22ffd5){try{utils[_0xd781('0x18')](util['format'](_0xd781('0x19'),_0x22ffd5[_0xd781('0x7')]),_0x22ffd5);if(_0x22ffd5[_0xd781('0x7')]==_0x22ffd5[_0xd781('0x1a')]&&_0x22ffd5[_0xd781('0x1b')]!=_0xd781('0x1c')){utils[_0xd781('0x1d')](util[_0xd781('0x9')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x22ffd5[_0xd781('0x7')],_0x22ffd5[_0xd781('0x1e')],_0x22ffd5[_0xd781('0x1f')]));channels[_0x22ffd5[_0xd781('0x7')]]={'uniqueid':_0x22ffd5[_0xd781('0x7')],'accountcode':_0x22ffd5[_0xd781('0x11')],'source':_0x22ffd5[_0xd781('0xe')],'destination':_0x22ffd5['exten'],'destinationcontext':_0x22ffd5[_0xd781('0x1e')],'channel':_0x22ffd5['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xd781('0x2'),'amaflags':'DOCUMENTATION'};}}catch(_0x175ba6){utils[_0xd781('0x20')](util[_0xd781('0x9')](_0xd781('0x19'),_0x22ffd5[_0xd781('0x7')]),_0x175ba6);}};exports[_0xd781('0x21')]=function(_0x221f14){try{utils[_0xd781('0x18')](util[_0xd781('0x9')]('[%s][calls][newstate]',_0x221f14['uniqueid']),_0x221f14);if(!_[_0xd781('0x22')](channels[_0x221f14[_0xd781('0x7')]])&&_0x221f14[_0xd781('0x23')]==0x6){utils['info'](util[_0xd781('0x9')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x221f14['uniqueid'],_0x221f14[_0xd781('0x1e')],_0x221f14['channel']));if(_[_0xd781('0x22')](channels[_0x221f14[_0xd781('0x7')]]['systemanswertime'])){channels[_0x221f14['uniqueid']][_0xd781('0x24')]=utils['now']();}}else if(!_[_0xd781('0x22')](channels[_0x221f14['linkedid']])&&_0x221f14[_0xd781('0x23')]==0x6&&_0x221f14[_0xd781('0x1e')]!='transfer'){utils['info'](util[_0xd781('0x9')](_0xd781('0x25'),_0x221f14[_0xd781('0x7')],_0x221f14['linkedid'],_0x221f14['context'],_0x221f14[_0xd781('0x1b')]));channels[_0x221f14[_0xd781('0x1a')]][_0xd781('0x11')]=_0x221f14['accountcode'];channels[_0x221f14['linkedid']][_0xd781('0x26')]=_0x221f14[_0xd781('0x1b')];if(_['isNil'](channels[_0x221f14[_0xd781('0x1a')]][_0xd781('0x27')])){channels[_0x221f14['linkedid']][_0xd781('0x27')]=utils[_0xd781('0x28')]();}channels[_0x221f14[_0xd781('0x1a')]][_0xd781('0x29')]=dispositions[_['toNumber'](_0x221f14[_0xd781('0x23')])]||_0xd781('0x4');}}catch(_0x1c0b75){utils[_0xd781('0x20')](util['format'](_0xd781('0x2a'),_0x221f14[_0xd781('0x7')]),_0x1c0b75);}};exports['hangup']=function(_0xd69484){try{if(!_['isNil'](channels[_0xd69484[_0xd781('0x7')]])){utils[_0xd781('0x18')](util['format'](_0xd781('0x2b'),_0xd69484[_0xd781('0x7')]),_0xd69484);if(_['isNil'](channels[_0xd69484[_0xd781('0x7')]]['callerid'])){channels[_0xd69484[_0xd781('0x7')]][_0xd781('0x2c')]=_0xd69484['calleridname']+'\x20<'+_0xd69484[_0xd781('0xe')]+'>';}utils[_0xd781('0x1d')](util['format'](_0xd781('0x2d'),_0xd69484[_0xd781('0x7')],channels[_0xd69484[_0xd781('0x7')]]['callerid'],_0xd69484[_0xd781('0x2e')]));channels[_0xd69484[_0xd781('0x7')]][_0xd781('0x2f')]=utils[_0xd781('0x28')]();channels[_0xd69484[_0xd781('0x7')]][_0xd781('0x30')]=utils[_0xd781('0x31')](channels[_0xd69484[_0xd781('0x7')]][_0xd781('0x2f')],channels[_0xd69484['uniqueid']][_0xd781('0x32')]);channels[_0xd69484['uniqueid']][_0xd781('0x33')]=channels[_0xd69484[_0xd781('0x7')]]['answertime']?utils[_0xd781('0x31')](channels[_0xd69484[_0xd781('0x7')]][_0xd781('0x2f')],channels[_0xd69484[_0xd781('0x7')]]['answertime']):0x0;writeDB(channels[_0xd69484[_0xd781('0x7')]]);}}catch(_0x515357){utils[_0xd781('0x20')](util[_0xd781('0x9')]('[%s][calls][hangup]',_0xd69484['uniqueid']),_0x515357);}};exports[_0xd781('0x34')]=function(_0x23ae87){try{if(!_[_0xd781('0x22')](channels[_0x23ae87[_0xd781('0x35')]])){utils['debug'](util[_0xd781('0x9')](_0xd781('0x36'),_0x23ae87['origtransfereruniqueid']),_0x23ae87);if(channels[_0x23ae87['localtwolinkedid']][_0xd781('0x1b')]==_0x23ae87[_0xd781('0x37')]){utils[_0xd781('0x1d')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x23ae87[_0xd781('0x38')],_0x23ae87[_0xd781('0x35')],_0x23ae87[_0xd781('0x39')]));channels[_0x23ae87[_0xd781('0x35')]][_0xd781('0x26')]=_0x23ae87[_0xd781('0x39')];channels[_0x23ae87['localtwolinkedid']]['userfield']=_0xd781('0x3a');}else if(channels[_0x23ae87[_0xd781('0x35')]][_0xd781('0x1b')]=_0x23ae87[_0xd781('0x3b')]){utils[_0xd781('0x1d')](util['format'](_0xd781('0x3c'),_0x23ae87[_0xd781('0x38')],_0x23ae87[_0xd781('0x35')],_0x23ae87['origtransfererchannel']));channels[_0x23ae87[_0xd781('0x35')]][_0xd781('0x26')]=_0x23ae87[_0xd781('0x3d')];channels[_0x23ae87['localtwolinkedid']][_0xd781('0x3e')]=_0xd781('0x3a');}}}catch(_0x54c2a3){utils['error'](util[_0xd781('0x9')](_0xd781('0x36'),_0x23ae87[_0xd781('0x38')]),_0x54c2a3);}};exports['musiconholdstart']=function(_0x2a251b){try{if(!_[_0xd781('0x22')](channels[_0x2a251b[_0xd781('0x7')]])){utils[_0xd781('0x18')](util[_0xd781('0x9')](_0xd781('0x3f'),_0x2a251b[_0xd781('0x7')]),_0x2a251b);channels[_0x2a251b['uniqueid']][_0xd781('0x40')]=utils[_0xd781('0x28')]();utils[_0xd781('0x1d')](util['format'](_0xd781('0x41'),_0x2a251b[_0xd781('0x7')],channels[_0x2a251b['uniqueid']][_0xd781('0x40')]));}}catch(_0x259593){utils[_0xd781('0x20')](util[_0xd781('0x9')](_0xd781('0x3f'),_0x2a251b['uniqueid']),_0x259593);}};exports[_0xd781('0x42')]=function(_0x5ee0cb){try{if(!_[_0xd781('0x22')](channels[_0x5ee0cb['uniqueid']])){utils[_0xd781('0x18')](util[_0xd781('0x9')]('[%s][calls][musiconholdstop]',_0x5ee0cb[_0xd781('0x7')]),_0x5ee0cb);if(!_['isNil'](channels[_0x5ee0cb['uniqueid']]['musiconholdstartAt'])){channels[_0x5ee0cb[_0xd781('0x7')]][_0xd781('0x43')]+=utils['diffTime'](utils[_0xd781('0x28')](),channels[_0x5ee0cb['uniqueid']][_0xd781('0x40')]);utils[_0xd781('0x1d')](util[_0xd781('0x9')](_0xd781('0x44'),_0x5ee0cb['uniqueid'],channels[_0x5ee0cb[_0xd781('0x7')]]['mohtime']));delete channels[_0x5ee0cb[_0xd781('0x7')]]['musiconholdstartAt'];}}}catch(_0x3bf588){utils[_0xd781('0x20')](util['format'](_0xd781('0x45'),_0x5ee0cb[_0xd781('0x7')]),_0x3bf588);}};exports[_0xd781('0x46')]=function(_0x32fd9f){try{if(!_[_0xd781('0x22')](channels[_0x32fd9f[_0xd781('0x7')]])){utils['debug'](util['format'](_0xd781('0x47'),_0x32fd9f[_0xd781('0x7')]),_0x32fd9f);if(!_[_0xd781('0x22')](_0x32fd9f[_0xd781('0x48')]['xmd-originatecalleridnum'])){utils[_0xd781('0x1d')](util['format'](_0xd781('0x49'),_0x32fd9f[_0xd781('0x7')],_0x32fd9f[_0xd781('0x4a')]));channels[_0x32fd9f[_0xd781('0x7')]]['source']=_0x32fd9f['value'];}if(!_[_0xd781('0x22')](_0x32fd9f['variable'][_0xd781('0x4b')])){utils[_0xd781('0x1d')](util[_0xd781('0x9')](_0xd781('0x4c'),_0x32fd9f[_0xd781('0x7')],_0x32fd9f['value']));channels[_0x32fd9f[_0xd781('0x7')]][_0xd781('0x4d')]=_0x32fd9f['value'];channels[_0x32fd9f[_0xd781('0x7')]][_0xd781('0x2c')]='\x22'+_0x32fd9f[_0xd781('0x4a')]+_0xd781('0x4e')+_0x32fd9f[_0xd781('0x4a')]+'>';}if(!_[_0xd781('0x22')](_0x32fd9f[_0xd781('0x48')][_0xd781('0x4f')])||!_[_0xd781('0x22')](_0x32fd9f[_0xd781('0x48')][_0xd781('0x50')])){utils[_0xd781('0x1d')](util[_0xd781('0x9')](_0xd781('0x51'),_0x32fd9f[_0xd781('0x7')],!_[_0xd781('0x22')](_0x32fd9f[_0xd781('0x48')]['xmd-callerid-preview'])?_0xd781('0x4f'):_0xd781('0x50'),_0x32fd9f[_0xd781('0x4a')]));channels[_0x32fd9f[_0xd781('0x7')]][_0xd781('0x2c')]=_0x32fd9f['value'];}if(!_['isNil'](_0x32fd9f[_0xd781('0x48')]['xmd-queue'])||!_['isNil'](_0x32fd9f['variable']['xmcs-queue'])){utils[_0xd781('0x1d')](util['format'](_0xd781('0x51'),_0x32fd9f[_0xd781('0x7')],!_[_0xd781('0x22')](_0x32fd9f[_0xd781('0x48')][_0xd781('0x52')])?'xmd-queue':_0xd781('0x53'),_0x32fd9f[_0xd781('0x4a')]));channels[_0x32fd9f[_0xd781('0x7')]][_0xd781('0x54')]=_0xd781('0x55');channels[_0x32fd9f[_0xd781('0x7')]]['lastdata']=_0x32fd9f['value'];channels[_0x32fd9f[_0xd781('0x7')]]['queue']=!![];}if(!_[_0xd781('0x22')](_0x32fd9f[_0xd781('0x48')][_0xd781('0x56')])){utils[_0xd781('0x1d')](util['format'](_0xd781('0x57'),_0x32fd9f[_0xd781('0x7')],_0x32fd9f[_0xd781('0x4a')]));channels[_0x32fd9f[_0xd781('0x7')]][_0xd781('0x58')]=_0x32fd9f['value'];}if(!_[_0xd781('0x22')](_0x32fd9f['variable'][_0xd781('0x59')])){utils[_0xd781('0x1d')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x32fd9f[_0xd781('0x7')],_0x32fd9f[_0xd781('0x4a')]));channels[_0x32fd9f[_0xd781('0x7')]][_0xd781('0x5a')]=_0x32fd9f[_0xd781('0x4a')];}if(!_[_0xd781('0x22')](_0x32fd9f[_0xd781('0x48')][_0xd781('0x5b')])){utils[_0xd781('0x1d')](util['format'](_0xd781('0x5c'),_0x32fd9f[_0xd781('0x7')],_0x32fd9f['value']));channels[_0x32fd9f[_0xd781('0x7')]]['routeid']=_0x32fd9f[_0xd781('0x4a')];}if(!_[_0xd781('0x22')](_0x32fd9f['variable']['sipcallid'])){utils[_0xd781('0x1d')](util[_0xd781('0x9')](_0xd781('0x5d'),_0x32fd9f[_0xd781('0x7')],_0x32fd9f[_0xd781('0x4a')]));channels[_0x32fd9f[_0xd781('0x7')]]['sipcallid']=_0x32fd9f[_0xd781('0x4a')];}}}catch(_0xc8d5c1){utils[_0xd781('0x20')](util[_0xd781('0x9')](_0xd781('0x47'),_0x32fd9f[_0xd781('0x7')]),_0xc8d5c1);}};exports[_0xd781('0x5e')]=function(_0x38fbc3){try{if(!_[_0xd781('0x22')](channels[_0x38fbc3[_0xd781('0x7')]])){utils[_0xd781('0x18')](util['format'](_0xd781('0x5f'),_0x38fbc3['uniqueid']),_0x38fbc3);utils[_0xd781('0x1d')](util[_0xd781('0x9')](_0xd781('0x60'),_0x38fbc3[_0xd781('0x7')],_0x38fbc3[_0xd781('0x61')],_0x38fbc3[_0xd781('0x62')]));if(_0x38fbc3[_0xd781('0x61')][_0xd781('0x63')]()==_0xd781('0x64')&&_[_0xd781('0x65')](_0x38fbc3['appdata'][_0xd781('0x63')](),_0xd781('0x66'))){var _0x4d77f3=_0x38fbc3[_0xd781('0x62')][_0xd781('0x67')]('=');var _0x201eed=_0x4d77f3[0x0]['substring'](_0x4d77f3[0x0]['lastIndexOf']('(')+0x1,_0x4d77f3[0x0][_0xd781('0x68')](')'));var _0x58d5af=_0x4d77f3[0x1];channels[_0x38fbc3[_0xd781('0x7')]][_0x201eed]=_0x58d5af;}if(!_[_0xd781('0x69')]([_0xd781('0x6a'),_0xd781('0x6b'),_0xd781('0x6c'),'set',_0xd781('0x6d')],_0x38fbc3[_0xd781('0x61')][_0xd781('0x63')]())){channels[_0x38fbc3[_0xd781('0x7')]][_0xd781('0x54')]=_0x38fbc3[_0xd781('0x61')];channels[_0x38fbc3[_0xd781('0x7')]][_0xd781('0x6e')]=_0x38fbc3[_0xd781('0x62')];}}}catch(_0x3a1045){utils[_0xd781('0x20')](util['format'](_0xd781('0x5f'),_0x38fbc3[_0xd781('0x7')]),_0x3a1045);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c66b79f..bc359a8 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 _0x898d=['info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x898d,0x11d));var _0xd898=function(_0x2a1b33,_0x409f50){_0x2a1b33=_0x2a1b33-0x0;var _0x4c50e7=_0x898d[_0x2a1b33];return _0x4c50e7;};'use strict';var utils=require('./utils');exports[_0xd898('0x0')]=function(){utils[_0xd898('0x1')](_0xd898('0x2'));};exports[_0xd898('0x3')]=function(){utils[_0xd898('0x1')](_0xd898('0x4'));};exports[_0xd898('0x5')]=function(){utils['info']('[core]\x20fullybooted');};exports[_0xd898('0x6')]=function(_0x5778f3){utils[_0xd898('0x6')](_0xd898('0x7'),_0x5778f3);};exports[_0xd898('0x8')]=function(){utils[_0xd898('0x1')](_0xd898('0x9'));};exports[_0xd898('0xa')]=function(_0x1dd071){}; \ No newline at end of file +var _0xec8f=['./utils','info','shutdown','fullybooted','error','[core]\x20error','close','managerevent'];(function(_0x1f7996,_0x299a14){var _0x584609=function(_0x14c34a){while(--_0x14c34a){_0x1f7996['push'](_0x1f7996['shift']());}};_0x584609(++_0x299a14);}(_0xec8f,0xe0));var _0xfec8=function(_0xc41365,_0x35d774){_0xc41365=_0xc41365-0x0;var _0x388102=_0xec8f[_0xc41365];return _0x388102;};'use strict';var utils=require(_0xfec8('0x0'));exports['connect']=function(){utils[_0xfec8('0x1')]('[core]\x20connected');};exports[_0xfec8('0x2')]=function(){utils[_0xfec8('0x1')]('[core]\x20shutdown');};exports[_0xfec8('0x3')]=function(){utils['info']('[core]\x20fullybooted');};exports[_0xfec8('0x4')]=function(_0x5ca939){utils[_0xfec8('0x4')](_0xfec8('0x5'),_0x5ca939);};exports[_0xfec8('0x6')]=function(){utils[_0xfec8('0x1')]('[core]\x20close');};exports[_0xfec8('0x7')]=function(_0x535be8){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 2df646f..39fbc7d 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 _0x7a49=['ANSWER','now','info','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','answertime','billableseconds','lodash','util','./utils','format','uniqueid','channel','calleridnum','connectedlinenum','newexten','debug','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus'];(function(_0x20aa2b,_0x21dbca){var _0x4f7302=function(_0x3a0062){while(--_0x3a0062){_0x20aa2b['push'](_0x20aa2b['shift']());}};_0x4f7302(++_0x21dbca);}(_0x7a49,0x1d1));var _0x97a4=function(_0x346161,_0x2e9c7b){_0x346161=_0x346161-0x0;var _0x398600=_0x7a49[_0x346161];return _0x398600;};'use strict';var _=require(_0x97a4('0x0'));var util=require(_0x97a4('0x1'));var utils=require(_0x97a4('0x2'));var dials={};function writeDB(_0x55ddfa){utils['info'](util[_0x97a4('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x55ddfa[_0x97a4('0x4')],_0x55ddfa[_0x97a4('0x5')],_0x55ddfa['dialstring'],_0x55ddfa[_0x97a4('0x6')],_0x55ddfa[_0x97a4('0x7')],_0x55ddfa['dialstatus']));utils['request']('CreateVoiceDialReport',_0x55ddfa);delete dials[_0x55ddfa['uniqueid']];}exports[_0x97a4('0x8')]=function(_0x2aa717){try{utils[_0x97a4('0x9')](util[_0x97a4('0x3')](_0x97a4('0xa'),_0x2aa717['uniqueid']),_0x2aa717);utils['info'](util[_0x97a4('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x2aa717['uniqueid'],_0x2aa717[_0x97a4('0xb')],_0x2aa717[_0x97a4('0xc')]));if(_0x2aa717['application'][_0x97a4('0xd')]()==_0x97a4('0xe')&&_[_0x97a4('0xf')](_0x2aa717[_0x97a4('0xc')][_0x97a4('0xd')](),_0x97a4('0x10'))){var _0x18eeef=_0x2aa717[_0x97a4('0xc')][_0x97a4('0x11')]('=');dials[_0x2aa717[_0x97a4('0x4')]]={'routeId':_0x18eeef[0x1]};}}catch(_0xa116c6){utils[_0x97a4('0x12')](util[_0x97a4('0x3')](_0x97a4('0xa'),_0x2aa717[_0x97a4('0x4')]),_0xa116c6);}};exports['varset']=function(_0x218e43){try{utils['debug'](util['format']('[%s][dials][varset]',_0x218e43[_0x97a4('0x4')]),_0x218e43);if(!_[_0x97a4('0x13')](_0x218e43[_0x97a4('0x14')][_0x97a4('0x15')])){utils['info'](util[_0x97a4('0x3')](_0x97a4('0x16'),_0x218e43['uniqueid'],_0x218e43[_0x97a4('0x17')]));dials[_0x218e43['uniqueid']]={'routeId':_0x218e43[_0x97a4('0x17')]};}}catch(_0x147216){utils['error'](util['format'](_0x97a4('0x18'),_0x218e43[_0x97a4('0x4')]),_0x147216);}};exports[_0x97a4('0x19')]=function(_0x5534d3){try{if(!_[_0x97a4('0x13')](dials[_0x5534d3['uniqueid']])){utils[_0x97a4('0x9')](util[_0x97a4('0x3')](_0x97a4('0x1a'),_0x5534d3[_0x97a4('0x4')]),_0x5534d3);dials[_0x5534d3[_0x97a4('0x4')]]=_[_0x97a4('0x1b')](dials[_0x5534d3[_0x97a4('0x4')]],_0x5534d3);dials[_0x5534d3[_0x97a4('0x4')]][_0x97a4('0x1c')]=utils['now']();dials[_0x5534d3[_0x97a4('0x4')]][_0x97a4('0x1d')]=_0x97a4('0x1e');utils['info'](util[_0x97a4('0x3')](_0x97a4('0x1f'),_0x5534d3[_0x97a4('0x4')],dials[_0x5534d3[_0x97a4('0x4')]][_0x97a4('0x1c')]));}}catch(_0x3c9ab6){utils[_0x97a4('0x12')](util['format'](_0x97a4('0x1a'),_0x5534d3['uniqueid']),_0x3c9ab6);}};exports[_0x97a4('0x20')]=function(_0x4ce2ca){try{if(!_[_0x97a4('0x13')](dials[_0x4ce2ca[_0x97a4('0x4')]])){utils[_0x97a4('0x9')](util[_0x97a4('0x3')](_0x97a4('0x21'),_0x4ce2ca[_0x97a4('0x4')]),_0x4ce2ca);dials[_0x4ce2ca[_0x97a4('0x4')]][_0x97a4('0x22')]=_0x4ce2ca[_0x97a4('0x22')];if(_0x4ce2ca['dialstatus']==_0x97a4('0x23')){dials[_0x4ce2ca[_0x97a4('0x4')]]=_[_0x97a4('0x1b')](dials[_0x4ce2ca[_0x97a4('0x4')]],_0x4ce2ca);dials[_0x4ce2ca[_0x97a4('0x4')]]['answertime']=utils[_0x97a4('0x24')]();dials[_0x4ce2ca[_0x97a4('0x4')]][_0x97a4('0x1d')]='connect';utils[_0x97a4('0x25')](util[_0x97a4('0x3')](_0x97a4('0x26'),_0x4ce2ca['uniqueid'],_0x4ce2ca[_0x97a4('0x22')],dials[_0x4ce2ca[_0x97a4('0x4')]]['answertime']));}else{utils[_0x97a4('0x25')](util[_0x97a4('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x4ce2ca[_0x97a4('0x4')],_0x4ce2ca['dialstatus']));}}}catch(_0xff43db){utils[_0x97a4('0x12')](util['format'](_0x97a4('0x21'),_0x4ce2ca[_0x97a4('0x4')]),_0xff43db);}};exports[_0x97a4('0x27')]=function(_0x32e3e1){try{if(!_[_0x97a4('0x13')](dials[_0x32e3e1[_0x97a4('0x4')]])){utils[_0x97a4('0x9')](util[_0x97a4('0x3')](_0x97a4('0x28'),_0x32e3e1['uniqueid']),_0x32e3e1);utils[_0x97a4('0x25')](util['format'](_0x97a4('0x29'),_0x32e3e1[_0x97a4('0x4')],_0x32e3e1[_0x97a4('0x6')],_0x32e3e1[_0x97a4('0x2a')],_0x32e3e1[_0x97a4('0x2b')]));dials[_0x32e3e1['uniqueid']]=_['assign'](dials[_0x32e3e1['uniqueid']],{'endtime':utils[_0x97a4('0x24')](),'lastevent':'complete'});dials[_0x32e3e1[_0x97a4('0x4')]][_0x97a4('0x2c')]=utils[_0x97a4('0x2d')](dials[_0x32e3e1[_0x97a4('0x4')]][_0x97a4('0x2e')],dials[_0x32e3e1['uniqueid']][_0x97a4('0x1c')]);dials[_0x32e3e1[_0x97a4('0x4')]][_0x97a4('0x2f')]=utils['diffTime'](dials[_0x32e3e1[_0x97a4('0x4')]][_0x97a4('0x30')]||dials[_0x32e3e1[_0x97a4('0x4')]][_0x97a4('0x2e')],dials[_0x32e3e1['uniqueid']][_0x97a4('0x1c')]);dials[_0x32e3e1['uniqueid']][_0x97a4('0x31')]=dials[_0x32e3e1['uniqueid']][_0x97a4('0x30')]?utils[_0x97a4('0x2d')](dials[_0x32e3e1[_0x97a4('0x4')]]['endtime'],dials[_0x32e3e1[_0x97a4('0x4')]][_0x97a4('0x30')]):0x0;writeDB(dials[_0x32e3e1[_0x97a4('0x4')]]);}}catch(_0xc87a60){utils['error'](util[_0x97a4('0x3')](_0x97a4('0x28'),_0x32e3e1[_0x97a4('0x4')]),_0xc87a60);}}; \ No newline at end of file +var _0x7f71=['split','error','variable','outboundrouteid','value','[%s][dials][varset]','isNil','[%s][dials][dialbegin]','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','calleridname','cause-txt','now','holdtime','diffTime','billableseconds','endtime','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)'];(function(_0x5d4cda,_0x91fcb8){var _0x3142ab=function(_0xd90b35){while(--_0xd90b35){_0x5d4cda['push'](_0x5d4cda['shift']());}};_0x3142ab(++_0x91fcb8);}(_0x7f71,0x163));var _0x17f7=function(_0x515451,_0x3173d1){_0x515451=_0x515451-0x0;var _0x461422=_0x7f71[_0x515451];return _0x461422;};'use strict';var _=require('lodash');var util=require(_0x17f7('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x1a7b7d){utils[_0x17f7('0x1')](util[_0x17f7('0x2')](_0x17f7('0x3'),_0x1a7b7d[_0x17f7('0x4')],_0x1a7b7d[_0x17f7('0x5')],_0x1a7b7d[_0x17f7('0x6')],_0x1a7b7d[_0x17f7('0x7')],_0x1a7b7d['connectedlinenum'],_0x1a7b7d[_0x17f7('0x8')]));utils[_0x17f7('0x9')](_0x17f7('0xa'),_0x1a7b7d);delete dials[_0x1a7b7d[_0x17f7('0x4')]];}exports[_0x17f7('0xb')]=function(_0x185387){try{utils[_0x17f7('0xc')](util[_0x17f7('0x2')](_0x17f7('0xd'),_0x185387['uniqueid']),_0x185387);utils['info'](util[_0x17f7('0x2')](_0x17f7('0xe'),_0x185387[_0x17f7('0x4')],_0x185387[_0x17f7('0xf')],_0x185387[_0x17f7('0x10')]));if(_0x185387[_0x17f7('0xf')][_0x17f7('0x11')]()==_0x17f7('0x12')&&_[_0x17f7('0x13')](_0x185387[_0x17f7('0x10')][_0x17f7('0x11')](),_0x17f7('0x14'))){var _0x232a14=_0x185387[_0x17f7('0x10')][_0x17f7('0x15')]('=');dials[_0x185387[_0x17f7('0x4')]]={'routeId':_0x232a14[0x1]};}}catch(_0x294930){utils[_0x17f7('0x16')](util[_0x17f7('0x2')](_0x17f7('0xd'),_0x185387['uniqueid']),_0x294930);}};exports['varset']=function(_0x370ce2){try{utils[_0x17f7('0xc')](util[_0x17f7('0x2')]('[%s][dials][varset]',_0x370ce2[_0x17f7('0x4')]),_0x370ce2);if(!_['isNil'](_0x370ce2[_0x17f7('0x17')][_0x17f7('0x18')])){utils['info'](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x370ce2[_0x17f7('0x4')],_0x370ce2['value']));dials[_0x370ce2[_0x17f7('0x4')]]={'routeId':_0x370ce2[_0x17f7('0x19')]};}}catch(_0x2b9630){utils[_0x17f7('0x16')](util['format'](_0x17f7('0x1a'),_0x370ce2['uniqueid']),_0x2b9630);}};exports['dialbegin']=function(_0x71f636){try{if(!_[_0x17f7('0x1b')](dials[_0x71f636['uniqueid']])){utils[_0x17f7('0xc')](util[_0x17f7('0x2')](_0x17f7('0x1c'),_0x71f636[_0x17f7('0x4')]),_0x71f636);dials[_0x71f636[_0x17f7('0x4')]]=_['assign'](dials[_0x71f636[_0x17f7('0x4')]],_0x71f636);dials[_0x71f636['uniqueid']]['starttime']=utils['now']();dials[_0x71f636[_0x17f7('0x4')]][_0x17f7('0x1d')]='called';utils[_0x17f7('0x1')](util[_0x17f7('0x2')](_0x17f7('0x1e'),_0x71f636[_0x17f7('0x4')],dials[_0x71f636[_0x17f7('0x4')]][_0x17f7('0x1f')]));}}catch(_0x2f3db4){utils['error'](util[_0x17f7('0x2')](_0x17f7('0x1c'),_0x71f636[_0x17f7('0x4')]),_0x2f3db4);}};exports[_0x17f7('0x20')]=function(_0x56ca56){try{if(!_[_0x17f7('0x1b')](dials[_0x56ca56['uniqueid']])){utils[_0x17f7('0xc')](util[_0x17f7('0x2')](_0x17f7('0x21'),_0x56ca56[_0x17f7('0x4')]),_0x56ca56);dials[_0x56ca56[_0x17f7('0x4')]][_0x17f7('0x8')]=_0x56ca56[_0x17f7('0x8')];if(_0x56ca56[_0x17f7('0x8')]=='ANSWER'){dials[_0x56ca56[_0x17f7('0x4')]]=_[_0x17f7('0x22')](dials[_0x56ca56[_0x17f7('0x4')]],_0x56ca56);dials[_0x56ca56[_0x17f7('0x4')]][_0x17f7('0x23')]=utils['now']();dials[_0x56ca56[_0x17f7('0x4')]][_0x17f7('0x1d')]=_0x17f7('0x24');utils[_0x17f7('0x1')](util[_0x17f7('0x2')](_0x17f7('0x25'),_0x56ca56[_0x17f7('0x4')],_0x56ca56[_0x17f7('0x8')],dials[_0x56ca56[_0x17f7('0x4')]]['answertime']));}else{utils[_0x17f7('0x1')](util[_0x17f7('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x56ca56[_0x17f7('0x4')],_0x56ca56[_0x17f7('0x8')]));}}}catch(_0x42cf52){utils[_0x17f7('0x16')](util[_0x17f7('0x2')]('[%s][dials][dialend]',_0x56ca56['uniqueid']),_0x42cf52);}};exports[_0x17f7('0x26')]=function(_0x136cab){try{if(!_['isNil'](dials[_0x136cab['uniqueid']])){utils['debug'](util[_0x17f7('0x2')](_0x17f7('0x27'),_0x136cab[_0x17f7('0x4')]),_0x136cab);utils[_0x17f7('0x1')](util[_0x17f7('0x2')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x136cab[_0x17f7('0x4')],_0x136cab['calleridnum'],_0x136cab[_0x17f7('0x28')],_0x136cab[_0x17f7('0x29')]));dials[_0x136cab[_0x17f7('0x4')]]=_[_0x17f7('0x22')](dials[_0x136cab[_0x17f7('0x4')]],{'endtime':utils[_0x17f7('0x2a')](),'lastevent':'complete'});dials[_0x136cab[_0x17f7('0x4')]]['duration']=utils['diffTime'](dials[_0x136cab['uniqueid']]['endtime'],dials[_0x136cab[_0x17f7('0x4')]][_0x17f7('0x1f')]);dials[_0x136cab[_0x17f7('0x4')]][_0x17f7('0x2b')]=utils[_0x17f7('0x2c')](dials[_0x136cab[_0x17f7('0x4')]][_0x17f7('0x23')]||dials[_0x136cab[_0x17f7('0x4')]]['endtime'],dials[_0x136cab['uniqueid']][_0x17f7('0x1f')]);dials[_0x136cab[_0x17f7('0x4')]][_0x17f7('0x2d')]=dials[_0x136cab[_0x17f7('0x4')]][_0x17f7('0x23')]?utils[_0x17f7('0x2c')](dials[_0x136cab[_0x17f7('0x4')]][_0x17f7('0x2e')],dials[_0x136cab[_0x17f7('0x4')]]['answertime']):0x0;writeDB(dials[_0x136cab[_0x17f7('0x4')]]);}}catch(_0xa1b271){utils[_0x17f7('0x16')](util[_0x17f7('0x2')](_0x17f7('0x27'),_0x136cab[_0x17f7('0x4')]),_0xa1b271);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index d324fde..30024fe 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 _0xa7f5=['queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','local','asterisk','port','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','format','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin'];(function(_0x4a266b,_0x28d6f9){var _0xe0ffd4=function(_0x22da4e){while(--_0x22da4e){_0x4a266b['push'](_0x4a266b['shift']());}};_0xe0ffd4(++_0x28d6f9);}(_0xa7f5,0x65));var _0x5a7f=function(_0x19523f,_0x561781){_0x19523f=_0x19523f-0x0;var _0x45993c=_0xa7f5[_0x19523f];return _0x45993c;};var AsteriskManager=require(_0x5a7f('0x0'));var config=require(_0x5a7f('0x1'));var utils=require(_0x5a7f('0x2'));var util=require(_0x5a7f('0x3'));var isXDREnabled=config['xdr']&&config[_0x5a7f('0x4')][_0x5a7f('0x5')]?!config[_0x5a7f('0x4')]['disabled']:!![];var isProduction=config['env']===_0x5a7f('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x5a7f('0x4')][_0x5a7f('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x5a7f('0x8')][_0x5a7f('0x9')],config[_0x5a7f('0x8')]['ip'],config[_0x5a7f('0x8')]['username'],config['asterisk'][_0x5a7f('0xa')],!![]);ami[_0x5a7f('0xb')]();if(!isXDREnabled){utils[_0x5a7f('0xc')](_0x5a7f('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x5a7f('0xe'));}else{var agents=require(_0x5a7f('0xf'));var calls=require(_0x5a7f('0x10'));var queues=require(_0x5a7f('0x11'));var recordings=require(_0x5a7f('0x12'));var members=require(_0x5a7f('0x13'));var dials=require(_0x5a7f('0x14'));var transfers=require(_0x5a7f('0x15'));var core=require(_0x5a7f('0x16'));ami['on'](_0x5a7f('0x17'),core['connect']);ami['on'](_0x5a7f('0x18'),core[_0x5a7f('0x18')]);ami['on'](_0x5a7f('0x19'),core[_0x5a7f('0x19')]);ami['on'](_0x5a7f('0x1a'),core['error']);ami['on'](_0x5a7f('0x1b'),core[_0x5a7f('0x1b')]);ami['on']('managerevent',core[_0x5a7f('0x1c')]);ami['on'](_0x5a7f('0x1d'),function(_0x1fb795){try{utils[_0x5a7f('0x1e')](util['format'](_0x5a7f('0x1f'),_0x1fb795[_0x5a7f('0x20')]),_0x1fb795);members[_0x5a7f('0x1d')](_0x1fb795);}catch(_0x52552f){utils[_0x5a7f('0x1a')](util[_0x5a7f('0x21')]('[%s][index][devicestatechange]',_0x1fb795[_0x5a7f('0x20')]),_0x52552f);}});ami['on'](_0x5a7f('0x22'),function(_0x38763c){try{utils[_0x5a7f('0x1e')](util[_0x5a7f('0x21')]('[%s][index][agentcalled]',_0x38763c[_0x5a7f('0x23')]),_0x38763c);agents[_0x5a7f('0x22')](_0x38763c);}catch(_0x2519e5){utils['error'](util[_0x5a7f('0x21')](_0x5a7f('0x24'),_0x38763c[_0x5a7f('0x23')]),_0x2519e5);}});ami['on'](_0x5a7f('0x25'),function(_0x144848){try{utils[_0x5a7f('0x1e')](util['format']('[%s][index][agentringnoanswer]',_0x144848[_0x5a7f('0x23')]),_0x144848);agents[_0x5a7f('0x25')](_0x144848);}catch(_0x1040eb){utils[_0x5a7f('0x1a')](util[_0x5a7f('0x21')](_0x5a7f('0x26'),_0x144848[_0x5a7f('0x23')]),_0x1040eb);}});ami['on'](_0x5a7f('0x27'),function(_0x3c1d4e){try{utils[_0x5a7f('0x1e')](util['format'](_0x5a7f('0x28'),_0x3c1d4e[_0x5a7f('0x23')]),_0x3c1d4e);agents[_0x5a7f('0x27')](_0x3c1d4e);queues[_0x5a7f('0x27')](_0x3c1d4e);}catch(_0x454f94){utils[_0x5a7f('0x1a')](util['format'](_0x5a7f('0x28'),_0x3c1d4e[_0x5a7f('0x23')]),_0x454f94);}});ami['on'](_0x5a7f('0x29'),function(_0x3aee79){try{utils[_0x5a7f('0x1e')](util[_0x5a7f('0x21')](_0x5a7f('0x2a'),_0x3aee79[_0x5a7f('0x23')]),_0x3aee79);agents[_0x5a7f('0x29')](_0x3aee79);queues[_0x5a7f('0x29')](_0x3aee79);members['agentcomplete'](_0x3aee79);}catch(_0x58099a){utils[_0x5a7f('0x1a')](util['format'](_0x5a7f('0x2a'),_0x3aee79[_0x5a7f('0x23')]),_0x58099a);}});ami['on'](_0x5a7f('0x2b'),function(_0x5c81af){try{utils['debug'](util[_0x5a7f('0x21')](_0x5a7f('0x2c'),_0x5c81af[_0x5a7f('0x23')]),_0x5c81af);agents['queuecallerabandon'](_0x5c81af);queues['queuecallerabandon'](_0x5c81af);}catch(_0x31b0e7){utils['error'](util[_0x5a7f('0x21')](_0x5a7f('0x2c'),_0x5c81af[_0x5a7f('0x23')]),_0x31b0e7);}});ami['on']('queuecallerjoin',function(_0x13bf3c){try{utils[_0x5a7f('0x1e')](util[_0x5a7f('0x21')](_0x5a7f('0x2d'),_0x13bf3c[_0x5a7f('0x23')]),_0x13bf3c);queues[_0x5a7f('0x2e')](_0x13bf3c);recordings[_0x5a7f('0x2e')](_0x13bf3c);}catch(_0x5ab25a){utils[_0x5a7f('0x1a')](util[_0x5a7f('0x21')](_0x5a7f('0x2d'),_0x13bf3c[_0x5a7f('0x23')]),_0x5ab25a);}});ami['on'](_0x5a7f('0x2f'),function(_0x2a4a63){try{utils['debug'](util[_0x5a7f('0x21')](_0x5a7f('0x30'),_0x2a4a63[_0x5a7f('0x23')]),_0x2a4a63);queues['queuecallerleave'](_0x2a4a63);}catch(_0x13e076){utils['error'](util[_0x5a7f('0x21')](_0x5a7f('0x30'),_0x2a4a63['uniqueid']),_0x13e076);}});ami['on'](_0x5a7f('0x31'),function(_0x213cd7){try{utils[_0x5a7f('0x1e')](util[_0x5a7f('0x21')](_0x5a7f('0x32'),_0x213cd7[_0x5a7f('0x23')]),_0x213cd7);queues[_0x5a7f('0x31')](_0x213cd7);calls[_0x5a7f('0x31')](_0x213cd7);}catch(_0x1570de){utils[_0x5a7f('0x1a')](util[_0x5a7f('0x21')](_0x5a7f('0x32'),_0x213cd7[_0x5a7f('0x23')]),_0x1570de);}});ami['on'](_0x5a7f('0x33'),function(_0x4b263d){try{utils[_0x5a7f('0x1e')](util[_0x5a7f('0x21')](_0x5a7f('0x34'),_0x4b263d[_0x5a7f('0x23')]),_0x4b263d);queues[_0x5a7f('0x33')](_0x4b263d);calls['musiconholdstop'](_0x4b263d);}catch(_0x222d2a){utils[_0x5a7f('0x1a')](util[_0x5a7f('0x21')](_0x5a7f('0x34'),_0x4b263d['uniqueid']),_0x222d2a);}});ami['on']('newstate',function(_0x598aea){try{utils['debug'](util['format'](_0x5a7f('0x35'),_0x598aea[_0x5a7f('0x23')]),_0x598aea);calls[_0x5a7f('0x36')](_0x598aea);recordings['newstate'](_0x598aea);}catch(_0x11b0cd){utils['error'](util[_0x5a7f('0x21')](_0x5a7f('0x35'),_0x598aea[_0x5a7f('0x23')]),_0x11b0cd);}});ami['on']('hangup',function(_0x1eb426){try{utils[_0x5a7f('0x1e')](util[_0x5a7f('0x21')]('[%s][index][hangup]',_0x1eb426['uniqueid']),_0x1eb426);calls[_0x5a7f('0x37')](_0x1eb426);recordings[_0x5a7f('0x37')](_0x1eb426);dials['hangup'](_0x1eb426);agents[_0x5a7f('0x37')](_0x1eb426);queues['hangup'](_0x1eb426);}catch(_0x3c8c81){utils['error'](util[_0x5a7f('0x21')](_0x5a7f('0x38'),_0x1eb426['uniqueid']),_0x3c8c81);}});ami['on']('cdr',function(_0xd43ba){try{utils[_0x5a7f('0x1e')](util['format']('[%s][index][cdr]',_0xd43ba[_0x5a7f('0x23')]),_0xd43ba);members[_0x5a7f('0x39')](_0xd43ba);}catch(_0x30caea){utils[_0x5a7f('0x1a')](util[_0x5a7f('0x21')](_0x5a7f('0x3a'),_0xd43ba[_0x5a7f('0x23')]),_0x30caea);}});ami['on'](_0x5a7f('0x3b'),function(_0x232efd){try{utils[_0x5a7f('0x1e')](util['format']('[%s][index][blindtransfer]',_0x232efd['uniqueid']),_0x232efd);queues[_0x5a7f('0x3b')](_0x232efd);agents[_0x5a7f('0x3b')](_0x232efd);transfers[_0x5a7f('0x3b')](_0x232efd);recordings[_0x5a7f('0x3b')](_0x232efd);}catch(_0x483e13){utils[_0x5a7f('0x1a')](util[_0x5a7f('0x21')](_0x5a7f('0x3c'),_0x232efd[_0x5a7f('0x23')]),_0x483e13);}});ami['on'](_0x5a7f('0x3d'),function(_0x221bff){try{utils['debug'](util['format'](_0x5a7f('0x3e'),_0x221bff['origtransfereruniqueid']),_0x221bff);queues[_0x5a7f('0x3d')](_0x221bff);transfers['attendedtransfer'](_0x221bff);agents['attendedtransfer'](_0x221bff);calls['attendedtransfer'](_0x221bff);}catch(_0x2fc0e8){utils[_0x5a7f('0x1a')](util[_0x5a7f('0x21')](_0x5a7f('0x3e'),_0x221bff[_0x5a7f('0x3f')]),_0x2fc0e8);}});ami['on'](_0x5a7f('0x40'),function(_0x30b9c0){try{utils['debug'](util[_0x5a7f('0x21')](_0x5a7f('0x41'),_0x30b9c0[_0x5a7f('0x23')]),_0x30b9c0);queues['varset'](_0x30b9c0);recordings[_0x5a7f('0x40')](_0x30b9c0);calls[_0x5a7f('0x40')](_0x30b9c0);dials['varset'](_0x30b9c0);}catch(_0x5e05d4){utils[_0x5a7f('0x1a')](util[_0x5a7f('0x21')](_0x5a7f('0x41'),_0x30b9c0['uniqueid']),_0x5e05d4);}});ami['on']('newexten',function(_0x17d719){try{utils[_0x5a7f('0x1e')](util['format'](_0x5a7f('0x42'),_0x17d719[_0x5a7f('0x23')]),_0x17d719);calls[_0x5a7f('0x43')](_0x17d719);recordings[_0x5a7f('0x43')](_0x17d719);dials[_0x5a7f('0x43')](_0x17d719);}catch(_0x3fc427){utils['error'](util[_0x5a7f('0x21')](_0x5a7f('0x42'),_0x17d719['uniqueid']),_0x3fc427);}});ami['on'](_0x5a7f('0x44'),function(_0x2943a5){try{utils[_0x5a7f('0x1e')](util[_0x5a7f('0x21')](_0x5a7f('0x45'),_0x2943a5['uniqueid']),_0x2943a5);calls[_0x5a7f('0x44')](_0x2943a5);recordings[_0x5a7f('0x44')](_0x2943a5);}catch(_0x19f528){utils['error'](util['format'](_0x5a7f('0x45'),_0x2943a5[_0x5a7f('0x23')]),_0x19f528);}});ami['on'](_0x5a7f('0x46'),function(_0x27a596){try{utils['debug'](util['format'](_0x5a7f('0x47'),_0x27a596['uniqueid']),_0x27a596);dials[_0x5a7f('0x46')](_0x27a596);}catch(_0x12483e){utils[_0x5a7f('0x1a')](util[_0x5a7f('0x21')]('[%s]dialbegin',_0x27a596[_0x5a7f('0x23')]),_0x12483e);}});ami['on'](_0x5a7f('0x48'),function(_0x58b9f1){try{utils[_0x5a7f('0x1e')](util[_0x5a7f('0x21')](_0x5a7f('0x49'),_0x58b9f1[_0x5a7f('0x23')]),_0x58b9f1);dials[_0x5a7f('0x48')](_0x58b9f1);}catch(_0x57f5b1){utils[_0x5a7f('0x1a')](util[_0x5a7f('0x21')](_0x5a7f('0x49'),_0x58b9f1[_0x5a7f('0x23')]),_0x57f5b1);}});} \ No newline at end of file +var _0xb0ce=['asterisk-manager','./utils','util','xdr','disabled','env','asterisk','port','username','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','format','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','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]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]'];(function(_0x1f4ef5,_0x5a441a){var _0x1fc958=function(_0x3c6f97){while(--_0x3c6f97){_0x1f4ef5['push'](_0x1f4ef5['shift']());}};_0x1fc958(++_0x5a441a);}(_0xb0ce,0x86));var _0xeb0c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb0ce[_0xa464c9];return _0x3d73c4;};var AsteriskManager=require(_0xeb0c('0x0'));var config=require('../../config/environment');var utils=require(_0xeb0c('0x1'));var util=require(_0xeb0c('0x2'));var isXDREnabled=config['xdr']&&config[_0xeb0c('0x3')][_0xeb0c('0x4')]?!config[_0xeb0c('0x3')][_0xeb0c('0x4')]:!![];var isProduction=config[_0xeb0c('0x5')]==='production'||![];var isLocalAsterisk=config[_0xeb0c('0x3')]&&config[_0xeb0c('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0xeb0c('0x6')][_0xeb0c('0x7')],config[_0xeb0c('0x6')]['ip'],config[_0xeb0c('0x6')][_0xeb0c('0x8')],config['asterisk']['password'],!![]);ami[_0xeb0c('0x9')]();if(!isXDREnabled){utils[_0xeb0c('0xa')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xeb0c('0xa')](_0xeb0c('0xb'));}else{var agents=require('./agents.controller');var calls=require(_0xeb0c('0xc'));var queues=require('./queues.controller');var recordings=require(_0xeb0c('0xd'));var members=require(_0xeb0c('0xe'));var dials=require(_0xeb0c('0xf'));var transfers=require('./transfers.controller');var core=require(_0xeb0c('0x10'));ami['on'](_0xeb0c('0x11'),core[_0xeb0c('0x11')]);ami['on'](_0xeb0c('0x12'),core[_0xeb0c('0x12')]);ami['on'](_0xeb0c('0x13'),core[_0xeb0c('0x13')]);ami['on'](_0xeb0c('0x14'),core[_0xeb0c('0x14')]);ami['on'](_0xeb0c('0x15'),core[_0xeb0c('0x15')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0xeb0c('0x16'),function(_0x227e87){try{utils['debug'](util['format'](_0xeb0c('0x17'),_0x227e87[_0xeb0c('0x18')]),_0x227e87);members[_0xeb0c('0x16')](_0x227e87);}catch(_0x114107){utils[_0xeb0c('0x14')](util['format'](_0xeb0c('0x17'),_0x227e87[_0xeb0c('0x18')]),_0x114107);}});ami['on'](_0xeb0c('0x19'),function(_0x13b7b7){try{utils[_0xeb0c('0x1a')](util['format'](_0xeb0c('0x1b'),_0x13b7b7[_0xeb0c('0x1c')]),_0x13b7b7);agents['agentcalled'](_0x13b7b7);}catch(_0x9524b6){utils['error'](util[_0xeb0c('0x1d')](_0xeb0c('0x1b'),_0x13b7b7[_0xeb0c('0x1c')]),_0x9524b6);}});ami['on'](_0xeb0c('0x1e'),function(_0x327ee4){try{utils[_0xeb0c('0x1a')](util[_0xeb0c('0x1d')](_0xeb0c('0x1f'),_0x327ee4['uniqueid']),_0x327ee4);agents[_0xeb0c('0x1e')](_0x327ee4);}catch(_0x356648){utils[_0xeb0c('0x14')](util['format']('[%s][index][agentringnoanswer]',_0x327ee4[_0xeb0c('0x1c')]),_0x356648);}});ami['on']('agentconnect',function(_0x38b6e5){try{utils[_0xeb0c('0x1a')](util['format'](_0xeb0c('0x20'),_0x38b6e5[_0xeb0c('0x1c')]),_0x38b6e5);agents[_0xeb0c('0x21')](_0x38b6e5);queues[_0xeb0c('0x21')](_0x38b6e5);}catch(_0x4b3856){utils[_0xeb0c('0x14')](util[_0xeb0c('0x1d')]('[%s][index][agentconnect]',_0x38b6e5[_0xeb0c('0x1c')]),_0x4b3856);}});ami['on'](_0xeb0c('0x22'),function(_0x4eb9b0){try{utils[_0xeb0c('0x1a')](util[_0xeb0c('0x1d')](_0xeb0c('0x23'),_0x4eb9b0[_0xeb0c('0x1c')]),_0x4eb9b0);agents[_0xeb0c('0x22')](_0x4eb9b0);queues['agentcomplete'](_0x4eb9b0);members[_0xeb0c('0x22')](_0x4eb9b0);}catch(_0x12baaa){utils[_0xeb0c('0x14')](util[_0xeb0c('0x1d')](_0xeb0c('0x23'),_0x4eb9b0[_0xeb0c('0x1c')]),_0x12baaa);}});ami['on'](_0xeb0c('0x24'),function(_0x7047d5){try{utils[_0xeb0c('0x1a')](util['format'](_0xeb0c('0x25'),_0x7047d5[_0xeb0c('0x1c')]),_0x7047d5);agents[_0xeb0c('0x24')](_0x7047d5);queues['queuecallerabandon'](_0x7047d5);}catch(_0x127fdf){utils[_0xeb0c('0x14')](util[_0xeb0c('0x1d')]('[%s][index][queuecallerabandon]',_0x7047d5[_0xeb0c('0x1c')]),_0x127fdf);}});ami['on'](_0xeb0c('0x26'),function(_0x195ad1){try{utils['debug'](util['format']('[%s][index][queuecallerjoin]',_0x195ad1['uniqueid']),_0x195ad1);queues[_0xeb0c('0x26')](_0x195ad1);recordings[_0xeb0c('0x26')](_0x195ad1);}catch(_0x2c920a){utils[_0xeb0c('0x14')](util[_0xeb0c('0x1d')](_0xeb0c('0x27'),_0x195ad1[_0xeb0c('0x1c')]),_0x2c920a);}});ami['on'](_0xeb0c('0x28'),function(_0x4d9aec){try{utils[_0xeb0c('0x1a')](util[_0xeb0c('0x1d')]('[%s][index][queuecallerleave]',_0x4d9aec['uniqueid']),_0x4d9aec);queues['queuecallerleave'](_0x4d9aec);}catch(_0x36ba57){utils['error'](util[_0xeb0c('0x1d')](_0xeb0c('0x29'),_0x4d9aec[_0xeb0c('0x1c')]),_0x36ba57);}});ami['on'](_0xeb0c('0x2a'),function(_0x537120){try{utils[_0xeb0c('0x1a')](util[_0xeb0c('0x1d')](_0xeb0c('0x2b'),_0x537120['uniqueid']),_0x537120);queues[_0xeb0c('0x2a')](_0x537120);calls[_0xeb0c('0x2a')](_0x537120);}catch(_0x5d0961){utils[_0xeb0c('0x14')](util[_0xeb0c('0x1d')](_0xeb0c('0x2b'),_0x537120[_0xeb0c('0x1c')]),_0x5d0961);}});ami['on'](_0xeb0c('0x2c'),function(_0x21451f){try{utils[_0xeb0c('0x1a')](util[_0xeb0c('0x1d')](_0xeb0c('0x2d'),_0x21451f['uniqueid']),_0x21451f);queues[_0xeb0c('0x2c')](_0x21451f);calls[_0xeb0c('0x2c')](_0x21451f);}catch(_0x291973){utils[_0xeb0c('0x14')](util[_0xeb0c('0x1d')]('[%s][index][musiconholdstop]',_0x21451f['uniqueid']),_0x291973);}});ami['on'](_0xeb0c('0x2e'),function(_0x3926d7){try{utils[_0xeb0c('0x1a')](util[_0xeb0c('0x1d')](_0xeb0c('0x2f'),_0x3926d7['uniqueid']),_0x3926d7);calls[_0xeb0c('0x2e')](_0x3926d7);recordings['newstate'](_0x3926d7);}catch(_0x8e233b){utils['error'](util[_0xeb0c('0x1d')](_0xeb0c('0x2f'),_0x3926d7[_0xeb0c('0x1c')]),_0x8e233b);}});ami['on'](_0xeb0c('0x30'),function(_0xc70057){try{utils['debug'](util[_0xeb0c('0x1d')]('[%s][index][hangup]',_0xc70057[_0xeb0c('0x1c')]),_0xc70057);calls[_0xeb0c('0x30')](_0xc70057);recordings[_0xeb0c('0x30')](_0xc70057);dials[_0xeb0c('0x30')](_0xc70057);agents[_0xeb0c('0x30')](_0xc70057);queues[_0xeb0c('0x30')](_0xc70057);}catch(_0x81a70e){utils[_0xeb0c('0x14')](util[_0xeb0c('0x1d')](_0xeb0c('0x31'),_0xc70057[_0xeb0c('0x1c')]),_0x81a70e);}});ami['on'](_0xeb0c('0x32'),function(_0x2cefc8){try{utils[_0xeb0c('0x1a')](util[_0xeb0c('0x1d')](_0xeb0c('0x33'),_0x2cefc8[_0xeb0c('0x1c')]),_0x2cefc8);members['cdr'](_0x2cefc8);}catch(_0x245381){utils[_0xeb0c('0x14')](util[_0xeb0c('0x1d')](_0xeb0c('0x33'),_0x2cefc8[_0xeb0c('0x1c')]),_0x245381);}});ami['on']('blindtransfer',function(_0x4d767d){try{utils[_0xeb0c('0x1a')](util[_0xeb0c('0x1d')](_0xeb0c('0x34'),_0x4d767d[_0xeb0c('0x1c')]),_0x4d767d);queues['blindtransfer'](_0x4d767d);agents['blindtransfer'](_0x4d767d);transfers['blindtransfer'](_0x4d767d);recordings[_0xeb0c('0x35')](_0x4d767d);}catch(_0x597b95){utils['error'](util[_0xeb0c('0x1d')](_0xeb0c('0x34'),_0x4d767d[_0xeb0c('0x1c')]),_0x597b95);}});ami['on'](_0xeb0c('0x36'),function(_0x2d917f){try{utils['debug'](util[_0xeb0c('0x1d')](_0xeb0c('0x37'),_0x2d917f[_0xeb0c('0x38')]),_0x2d917f);queues[_0xeb0c('0x36')](_0x2d917f);transfers[_0xeb0c('0x36')](_0x2d917f);agents[_0xeb0c('0x36')](_0x2d917f);calls[_0xeb0c('0x36')](_0x2d917f);}catch(_0xe892b7){utils['error'](util[_0xeb0c('0x1d')](_0xeb0c('0x37'),_0x2d917f[_0xeb0c('0x38')]),_0xe892b7);}});ami['on'](_0xeb0c('0x39'),function(_0x2526b6){try{utils[_0xeb0c('0x1a')](util['format'](_0xeb0c('0x3a'),_0x2526b6[_0xeb0c('0x1c')]),_0x2526b6);queues[_0xeb0c('0x39')](_0x2526b6);recordings[_0xeb0c('0x39')](_0x2526b6);calls['varset'](_0x2526b6);dials[_0xeb0c('0x39')](_0x2526b6);}catch(_0x34efaa){utils[_0xeb0c('0x14')](util['format'](_0xeb0c('0x3a'),_0x2526b6[_0xeb0c('0x1c')]),_0x34efaa);}});ami['on'](_0xeb0c('0x3b'),function(_0x50703b){try{utils[_0xeb0c('0x1a')](util['format'](_0xeb0c('0x3c'),_0x50703b[_0xeb0c('0x1c')]),_0x50703b);calls['newexten'](_0x50703b);recordings[_0xeb0c('0x3b')](_0x50703b);dials[_0xeb0c('0x3b')](_0x50703b);}catch(_0x20221e){utils[_0xeb0c('0x14')](util[_0xeb0c('0x1d')]('[%s][index][newexten]',_0x50703b[_0xeb0c('0x1c')]),_0x20221e);}});ami['on'](_0xeb0c('0x3d'),function(_0x5e29b7){try{utils[_0xeb0c('0x1a')](util[_0xeb0c('0x1d')]('[%s][index][newchannel]',_0x5e29b7[_0xeb0c('0x1c')]),_0x5e29b7);calls['newchannel'](_0x5e29b7);recordings[_0xeb0c('0x3d')](_0x5e29b7);}catch(_0x383181){utils[_0xeb0c('0x14')](util[_0xeb0c('0x1d')](_0xeb0c('0x3e'),_0x5e29b7[_0xeb0c('0x1c')]),_0x383181);}});ami['on']('dialbegin',function(_0x2c0e1b){try{utils[_0xeb0c('0x1a')](util['format'](_0xeb0c('0x3f'),_0x2c0e1b[_0xeb0c('0x1c')]),_0x2c0e1b);dials['dialbegin'](_0x2c0e1b);}catch(_0x6ed633){utils[_0xeb0c('0x14')](util['format'](_0xeb0c('0x40'),_0x2c0e1b['uniqueid']),_0x6ed633);}});ami['on'](_0xeb0c('0x41'),function(_0x2dc2c1){try{utils[_0xeb0c('0x1a')](util['format'](_0xeb0c('0x42'),_0x2dc2c1[_0xeb0c('0x1c')]),_0x2dc2c1);dials['dialend'](_0x2dc2c1);}catch(_0x3f099a){utils[_0xeb0c('0x14')](util[_0xeb0c('0x1d')](_0xeb0c('0x42'),_0x2dc2c1[_0xeb0c('0x1c')]),_0x3f099a);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 9d1535a..ffaa0a2 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 _0x5a8c=['duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','data1','source','data3','destinationchannel','split','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','type','interface','getUserByInterface','then','name','internal','CreateMemberReport','getUserByName','catch','error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','INUSE','BUSY','TALKING','now','agent','isNil','exitAt'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x4940a0,_0x3f9be1){_0x4940a0=_0x4940a0-0x0;var _0x556f14=_0x5a8c[_0x4940a0];return _0x556f14;};'use strict';var _=require(_0xc5a8('0x0'));var util=require(_0xc5a8('0x1'));var utils=require('./utils');var members={};var exclude=[_0xc5a8('0x2'),_0xc5a8('0x3')];function writeDB(_0x1e03e6){utils[_0xc5a8('0x4')](util['format'](_0xc5a8('0x5'),_0x1e03e6[_0xc5a8('0x6')],_0x1e03e6['interface'],_0x1e03e6[_0xc5a8('0x7')],_0x1e03e6[_0xc5a8('0x8')],_0x1e03e6[_0xc5a8('0x9')],_0x1e03e6[_0xc5a8('0xa')]));if(_0x1e03e6[_0xc5a8('0xb')]){utils[_0xc5a8('0xc')](_0x1e03e6[_0xc5a8('0xb')])[_0xc5a8('0xd')](function(_0x36e265){if(_0x36e265){_0x1e03e6[_0xc5a8('0x9')]=_0x36e265[_0xc5a8('0xe')];_0x1e03e6['internal']=_0x36e265[_0xc5a8('0xf')];utils['request'](_0xc5a8('0x10'),_0x1e03e6);}else{utils[_0xc5a8('0x11')](_0x1e03e6[_0xc5a8('0xb')]['split']('/')[0x1])['then'](function(_0x35e891){if(_0x35e891){_0x1e03e6[_0xc5a8('0x9')]=_0x35e891[_0xc5a8('0xe')];_0x1e03e6[_0xc5a8('0xf')]=_0x35e891[_0xc5a8('0xf')];utils['request'](_0xc5a8('0x10'),_0x1e03e6);}});}})[_0xc5a8('0x12')](function(_0x3a8296){utils[_0xc5a8('0x13')](util[_0xc5a8('0x14')](_0xc5a8('0x15'),_0x1e03e6[_0xc5a8('0x6')]),_0x3a8296);});}delete members[_0x1e03e6[_0xc5a8('0xb')]];}function startsWith(_0x168e76,_0x9a94e3){return _[_0xc5a8('0x16')](_0x168e76,function(_0x443376){return _[_0xc5a8('0x17')](_0x9a94e3,_0x443376);});}exports[_0xc5a8('0x18')]=function(_0x1ac555){try{utils[_0xc5a8('0x19')](util[_0xc5a8('0x14')](_0xc5a8('0x1a'),members[_0x1ac555['device']]?members[_0x1ac555[_0xc5a8('0x1b')]][_0xc5a8('0x6')]:_0x1ac555[_0xc5a8('0x1b')]),_0x1ac555);utils[_0xc5a8('0x4')](util['format'](_0xc5a8('0x1c'),members[_0x1ac555['device']]?members[_0x1ac555[_0xc5a8('0x1b')]][_0xc5a8('0x6')]:_0x1ac555[_0xc5a8('0x1b')],_0x1ac555['state'],_0x1ac555['device']));switch(_0x1ac555['state']){case _0xc5a8('0x1d'):case _0xc5a8('0x1e'):if(!startsWith(exclude,_0x1ac555[_0xc5a8('0x1b')])){members[_0x1ac555[_0xc5a8('0x1b')]]={'channel':'voice','interface':_0x1ac555[_0xc5a8('0x1b')],'type':_0xc5a8('0x1f'),'enterAt':utils[_0xc5a8('0x20')](),'role':_0xc5a8('0x21')};}break;case'NOT_INUSE':if(!_[_0xc5a8('0x22')](members[_0x1ac555['device']])){members[_0x1ac555[_0xc5a8('0x1b')]][_0xc5a8('0x23')]=utils[_0xc5a8('0x20')]();members[_0x1ac555[_0xc5a8('0x1b')]][_0xc5a8('0x24')]=utils[_0xc5a8('0x25')](members[_0x1ac555[_0xc5a8('0x1b')]][_0xc5a8('0x23')],members[_0x1ac555[_0xc5a8('0x1b')]][_0xc5a8('0x26')]);if(members[_0x1ac555[_0xc5a8('0x1b')]][_0xc5a8('0x6')]){writeDB(members[_0x1ac555[_0xc5a8('0x1b')]]);}}break;default:break;}}catch(_0x4ebb64){utils[_0xc5a8('0x13')](util['format'](_0xc5a8('0x1a'),members[_0x1ac555['device']]?members[_0x1ac555[_0xc5a8('0x1b')]][_0xc5a8('0x6')]:_0x1ac555['device']),_0x4ebb64);}};exports[_0xc5a8('0x27')]=function(_0x2aa6d6){try{if(!_[_0xc5a8('0x22')](members[_0x2aa6d6[_0xc5a8('0xb')]])){utils[_0xc5a8('0x19')](util[_0xc5a8('0x14')](_0xc5a8('0x28'),_0x2aa6d6[_0xc5a8('0x6')]),_0x2aa6d6);utils[_0xc5a8('0x4')](util[_0xc5a8('0x14')](_0xc5a8('0x29'),_0x2aa6d6[_0xc5a8('0x6')],_0x2aa6d6[_0xc5a8('0xb')],_0x2aa6d6[_0xc5a8('0x2a')]));members[_0x2aa6d6[_0xc5a8('0xb')]]=_[_0xc5a8('0x2b')](members[_0x2aa6d6[_0xc5a8('0xb')]],{'data4':_0x2aa6d6[_0xc5a8('0x2a')],'uniqueid':_0x2aa6d6[_0xc5a8('0x6')]});}}catch(_0x21a7db){utils[_0xc5a8('0x13')](util[_0xc5a8('0x14')](_0xc5a8('0x28'),_0x2aa6d6['uniqueid']),_0x21a7db);}};exports['cdr']=function(_0x3f89b8){try{utils[_0xc5a8('0x19')](util[_0xc5a8('0x14')]('[%s][members][cdr]',_0x3f89b8[_0xc5a8('0x6')]),_0x3f89b8);if(_0x3f89b8[_0xc5a8('0x7')]){var _0x398d9d=_0x3f89b8[_0xc5a8('0x7')]['split']('-')[0x0];if(!_['isNil'](members[_0x398d9d])){members[_0x398d9d]=_['assign'](members[_0x398d9d],{'data1':members[_0x398d9d][_0xc5a8('0x2c')]||_0x3f89b8[_0xc5a8('0xa')],'data2':members[_0x398d9d][_0xc5a8('0x8')]||_0x3f89b8[_0xc5a8('0x2d')],'data3':members[_0x398d9d][_0xc5a8('0x2e')]||_0x3f89b8['destination'],'uniqueid':members[_0x398d9d][_0xc5a8('0x6')]||_0x3f89b8[_0xc5a8('0x6')]});utils['info'](util[_0xc5a8('0x14')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3f89b8[_0xc5a8('0x6')],members[_0x398d9d][_0xc5a8('0x2c')],members[_0x398d9d][_0xc5a8('0x8')],members[_0x398d9d][_0xc5a8('0x2e')]));if(members[_0x398d9d][_0xc5a8('0x23')]){writeDB(members[_0x398d9d]);}}}if(_0x3f89b8[_0xc5a8('0x2f')]){var _0x525066=_0x3f89b8[_0xc5a8('0x2f')][_0xc5a8('0x30')]('-')[0x0];if(!_[_0xc5a8('0x22')](members[_0x525066])){members[_0x525066]=_[_0xc5a8('0x2b')](members[_0x525066],{'data1':members[_0x525066][_0xc5a8('0x2c')]||_0x3f89b8[_0xc5a8('0xa')],'data2':members[_0x525066][_0xc5a8('0x8')]||_0x3f89b8[_0xc5a8('0x2d')],'data3':members[_0x525066]['data3']||_0x3f89b8[_0xc5a8('0x31')],'uniqueid':members[_0x525066][_0xc5a8('0x6')]||_0x3f89b8[_0xc5a8('0x6')]});utils[_0xc5a8('0x4')](util['format'](_0xc5a8('0x32'),_0x3f89b8['uniqueid'],members[_0x525066][_0xc5a8('0x2c')],members[_0x525066][_0xc5a8('0x8')],members[_0x525066][_0xc5a8('0x2e')]));if(members[_0x525066]['exitAt']){writeDB(members[_0x525066]);}}}}catch(_0x351d49){utils[_0xc5a8('0x13')](util[_0xc5a8('0x14')]('[%s][members][cdr]',_0x3f89b8['uniqueid']),_0x351d49);}}; \ No newline at end of file +var _0x05e2=['debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','[%s][members][agentcomplete]','cdr','channel','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','lodash','util','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','format','[%s][members][writeDB]','uniqueid','some','devicestatechange'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x05e2,0x116));var _0x205e=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0x05e2[_0x263f4c];return _0x3a78d3;};'use strict';var _=require(_0x205e('0x0'));var util=require(_0x205e('0x1'));var utils=require('./utils');var members={};var exclude=[_0x205e('0x2'),'Queue:'];function writeDB(_0x54314b){utils[_0x205e('0x3')](util['format'](_0x205e('0x4'),_0x54314b['uniqueid'],_0x54314b[_0x205e('0x5')],_0x54314b['channel'],_0x54314b['data2'],_0x54314b[_0x205e('0x6')],_0x54314b[_0x205e('0x7')]));if(_0x54314b['interface']){utils[_0x205e('0x8')](_0x54314b[_0x205e('0x5')])[_0x205e('0x9')](function(_0x5db57f){if(_0x5db57f){_0x54314b['membername']=_0x5db57f[_0x205e('0xa')];_0x54314b['internal']=_0x5db57f[_0x205e('0xb')];utils[_0x205e('0xc')](_0x205e('0xd'),_0x54314b);}else{utils[_0x205e('0xe')](_0x54314b[_0x205e('0x5')][_0x205e('0xf')]('/')[0x1])[_0x205e('0x9')](function(_0x5a7e5e){if(_0x5a7e5e){_0x54314b[_0x205e('0x6')]=_0x5a7e5e[_0x205e('0xa')];_0x54314b[_0x205e('0xb')]=_0x5a7e5e[_0x205e('0xb')];utils[_0x205e('0xc')](_0x205e('0xd'),_0x54314b);}});}})['catch'](function(_0x1e9b9b){utils[_0x205e('0x10')](util[_0x205e('0x11')](_0x205e('0x12'),_0x54314b[_0x205e('0x13')]),_0x1e9b9b);});}delete members[_0x54314b['interface']];}function startsWith(_0x1c0085,_0x59bcae){return _[_0x205e('0x14')](_0x1c0085,function(_0x1b779f){return _['startsWith'](_0x59bcae,_0x1b779f);});}exports[_0x205e('0x15')]=function(_0x42a3f2){try{utils[_0x205e('0x16')](util['format'](_0x205e('0x17'),members[_0x42a3f2[_0x205e('0x18')]]?members[_0x42a3f2['device']][_0x205e('0x13')]:_0x42a3f2[_0x205e('0x18')]),_0x42a3f2);utils['info'](util[_0x205e('0x11')](_0x205e('0x19'),members[_0x42a3f2[_0x205e('0x18')]]?members[_0x42a3f2[_0x205e('0x18')]]['uniqueid']:_0x42a3f2[_0x205e('0x18')],_0x42a3f2[_0x205e('0x1a')],_0x42a3f2[_0x205e('0x18')]));switch(_0x42a3f2[_0x205e('0x1a')]){case'INUSE':case _0x205e('0x1b'):if(!startsWith(exclude,_0x42a3f2['device'])){members[_0x42a3f2[_0x205e('0x18')]]={'channel':_0x205e('0x1c'),'interface':_0x42a3f2[_0x205e('0x18')],'type':_0x205e('0x1d'),'enterAt':utils[_0x205e('0x1e')](),'role':_0x205e('0x1f')};}break;case _0x205e('0x20'):if(!_[_0x205e('0x21')](members[_0x42a3f2[_0x205e('0x18')]])){members[_0x42a3f2[_0x205e('0x18')]][_0x205e('0x22')]=utils[_0x205e('0x1e')]();members[_0x42a3f2[_0x205e('0x18')]][_0x205e('0x23')]=utils['diffTime'](members[_0x42a3f2[_0x205e('0x18')]][_0x205e('0x22')],members[_0x42a3f2['device']][_0x205e('0x24')]);if(members[_0x42a3f2[_0x205e('0x18')]]['uniqueid']){writeDB(members[_0x42a3f2['device']]);}}break;default:break;}}catch(_0x4711c8){utils[_0x205e('0x10')](util[_0x205e('0x11')](_0x205e('0x17'),members[_0x42a3f2[_0x205e('0x18')]]?members[_0x42a3f2[_0x205e('0x18')]][_0x205e('0x13')]:_0x42a3f2[_0x205e('0x18')]),_0x4711c8);}};exports[_0x205e('0x25')]=function(_0x132831){try{if(!_[_0x205e('0x21')](members[_0x132831[_0x205e('0x5')]])){utils[_0x205e('0x16')](util[_0x205e('0x11')]('[%s][members][agentcomplete]',_0x132831[_0x205e('0x13')]),_0x132831);utils['info'](util[_0x205e('0x11')](_0x205e('0x26'),_0x132831[_0x205e('0x13')],_0x132831[_0x205e('0x5')],_0x132831['queue']));members[_0x132831[_0x205e('0x5')]]=_[_0x205e('0x27')](members[_0x132831['interface']],{'data4':_0x132831[_0x205e('0x28')],'uniqueid':_0x132831[_0x205e('0x13')]});}}catch(_0x108aa3){utils[_0x205e('0x10')](util[_0x205e('0x11')](_0x205e('0x29'),_0x132831['uniqueid']),_0x108aa3);}};exports[_0x205e('0x2a')]=function(_0x3b9f09){try{utils[_0x205e('0x16')](util[_0x205e('0x11')]('[%s][members][cdr]',_0x3b9f09[_0x205e('0x13')]),_0x3b9f09);if(_0x3b9f09[_0x205e('0x2b')]){var _0x181967=_0x3b9f09[_0x205e('0x2b')][_0x205e('0xf')]('-')[0x0];if(!_[_0x205e('0x21')](members[_0x181967])){members[_0x181967]=_['assign'](members[_0x181967],{'data1':members[_0x181967][_0x205e('0x2c')]||_0x3b9f09[_0x205e('0x7')],'data2':members[_0x181967]['data2']||_0x3b9f09[_0x205e('0x2d')],'data3':members[_0x181967][_0x205e('0x2e')]||_0x3b9f09[_0x205e('0x2f')],'uniqueid':members[_0x181967]['uniqueid']||_0x3b9f09['uniqueid']});utils[_0x205e('0x3')](util['format'](_0x205e('0x30'),_0x3b9f09[_0x205e('0x13')],members[_0x181967]['data1'],members[_0x181967][_0x205e('0x31')],members[_0x181967]['data3']));if(members[_0x181967][_0x205e('0x22')]){writeDB(members[_0x181967]);}}}if(_0x3b9f09['destinationchannel']){var _0x1a8a39=_0x3b9f09['destinationchannel']['split']('-')[0x0];if(!_[_0x205e('0x21')](members[_0x1a8a39])){members[_0x1a8a39]=_[_0x205e('0x27')](members[_0x1a8a39],{'data1':members[_0x1a8a39]['data1']||_0x3b9f09[_0x205e('0x7')],'data2':members[_0x1a8a39][_0x205e('0x31')]||_0x3b9f09[_0x205e('0x2d')],'data3':members[_0x1a8a39]['data3']||_0x3b9f09[_0x205e('0x2f')],'uniqueid':members[_0x1a8a39]['uniqueid']||_0x3b9f09[_0x205e('0x13')]});utils[_0x205e('0x3')](util[_0x205e('0x11')](_0x205e('0x30'),_0x3b9f09[_0x205e('0x13')],members[_0x1a8a39][_0x205e('0x2c')],members[_0x1a8a39][_0x205e('0x31')],members[_0x1a8a39][_0x205e('0x2e')]));if(members[_0x1a8a39][_0x205e('0x22')]){writeDB(members[_0x1a8a39]);}}}}catch(_0x2b65d3){utils[_0x205e('0x10')](util['format']('[%s][members][cdr]',_0x3b9f09[_0x205e('0x13')]),_0x2b65d3);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 67a90a8..e715117 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 _0x2bb3=['origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','isNil','[%s][queues][hangup]','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','queueposition','queuecallerabandon','queuecallerexit','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','lastAssignedTo','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][attendedtransfer]'];(function(_0x728e55,_0x23541d){var _0x68a976=function(_0x460d21){while(--_0x460d21){_0x728e55['push'](_0x728e55['shift']());}};_0x68a976(++_0x23541d);}(_0x2bb3,0x1a7));var _0x32bb=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x2bb3[_0x576170];return _0x397c70;};'use strict';var _=require(_0x32bb('0x0'));var util=require(_0x32bb('0x1'));var utils=require(_0x32bb('0x2'));var queues={};function writeDB(_0x16cad7){utils['info'](util[_0x32bb('0x3')](_0x32bb('0x4'),_0x16cad7[_0x32bb('0x5')],_0x16cad7[_0x32bb('0x6')],_0x16cad7[_0x32bb('0x7')],_0x16cad7['lastAssignedTo'],_0x16cad7[_0x32bb('0x8')],_0x16cad7[_0x32bb('0x9')],_0x16cad7[_0x32bb('0xa')]));if(_0x16cad7[_0x32bb('0x7')]){utils[_0x32bb('0xb')](_0x16cad7[_0x32bb('0x7')])[_0x32bb('0xc')](function(_0x1a2ae7){if(_0x1a2ae7){_0x16cad7['type']=_0x1a2ae7[_0x32bb('0xd')];}utils['request']('CreateVoiceQueueReport',_0x16cad7);});}else{utils[_0x32bb('0xe')]('CreateVoiceQueueReport',_0x16cad7);}if(_0x16cad7[_0x32bb('0xf')]){delete queues[_0x16cad7['transfereduniqueid']];}else{delete queues[_0x16cad7[_0x32bb('0x5')]];}}exports[_0x32bb('0x10')]=function(_0x51a302){try{utils[_0x32bb('0x11')](util['format'](_0x32bb('0x12'),_0x51a302[_0x32bb('0x5')]),_0x51a302);utils[_0x32bb('0x13')](util[_0x32bb('0x3')](_0x32bb('0x14'),_0x51a302[_0x32bb('0x5')],_0x51a302[_0x32bb('0x7')],_0x51a302[_0x32bb('0x15')]));queues[_0x51a302[_0x32bb('0x5')]]=_['assign'](_0x51a302,{'originalposition':_0x51a302[_0x32bb('0x15')],'queuecallerjoinAt':utils[_0x32bb('0x16')](),'mohtime':0x0});}catch(_0x2459d1){utils[_0x32bb('0x17')](util['format'](_0x32bb('0x12'),_0x51a302[_0x32bb('0x5')]),_0x2459d1);}};exports['hangup']=function(_0x3886c7){try{if(!_[_0x32bb('0x18')](queues[_0x3886c7[_0x32bb('0x5')]])){utils['debug'](util[_0x32bb('0x3')](_0x32bb('0x19'),_0x3886c7[_0x32bb('0x5')]),_0x3886c7);if(queues[_0x3886c7[_0x32bb('0x5')]]['queuecallerleaveAt']){if(!queues[_0x3886c7[_0x32bb('0x5')]]['queuecallerabandon']&&!queues[_0x3886c7[_0x32bb('0x5')]]['queuecallerexit']){queues[_0x3886c7['uniqueid']][_0x32bb('0x1a')]=!![];queues[_0x3886c7['uniqueid']]['queuecallercompleteAt']=utils[_0x32bb('0x16')]();queues[_0x3886c7[_0x32bb('0x5')]][_0x32bb('0xa')]=_0x32bb('0x1b');}utils[_0x32bb('0x13')](util['format'](_0x32bb('0x1c'),_0x3886c7[_0x32bb('0x5')],queues[_0x3886c7[_0x32bb('0x5')]][_0x32bb('0x1d')],queues[_0x3886c7[_0x32bb('0x5')]][_0x32bb('0xa')]));writeDB(queues[_0x3886c7['uniqueid']]);}else if(queues[_0x3886c7[_0x32bb('0x5')]][_0x32bb('0xf')]){utils[_0x32bb('0x13')](util[_0x32bb('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x3886c7[_0x32bb('0x5')],queues[_0x3886c7['uniqueid']][_0x32bb('0x1d')],queues[_0x3886c7[_0x32bb('0x5')]][_0x32bb('0xf')]));queues[queues[_0x3886c7[_0x32bb('0x5')]][_0x32bb('0xf')]]=queues[_0x3886c7[_0x32bb('0x5')]];queues[queues[_0x3886c7[_0x32bb('0x5')]][_0x32bb('0xf')]][_0x32bb('0x1e')]=0x2;delete queues[_0x3886c7[_0x32bb('0x5')]];}}}catch(_0x43ba77){utils[_0x32bb('0x17')](util[_0x32bb('0x3')](_0x32bb('0x19'),_0x3886c7['uniqueid']),_0x43ba77);}};exports[_0x32bb('0x1f')]=function(_0x3b15f4){try{utils[_0x32bb('0x11')](util[_0x32bb('0x3')](_0x32bb('0x20'),_0x3b15f4[_0x32bb('0x5')]),_0x3b15f4);if(!_[_0x32bb('0x18')](_0x3b15f4['variable']['queuestatus'])&&_0x3b15f4['value'][_0x32bb('0x21')]()!==_0x32bb('0x22')){if(!_[_0x32bb('0x18')](queues[_0x3b15f4[_0x32bb('0x5')]])){queues[_0x3b15f4['uniqueid']]['queuecallerabandon']=![];queues[_0x3b15f4[_0x32bb('0x5')]][_0x32bb('0x23')]=null;queues[_0x3b15f4[_0x32bb('0x5')]]['queuecallerexit']=!![];queues[_0x3b15f4[_0x32bb('0x5')]][_0x32bb('0x24')]=utils[_0x32bb('0x16')]();queues[_0x3b15f4[_0x32bb('0x5')]]['queuecallerexitreason']=_0x3b15f4['value'][_0x32bb('0x21')]();utils[_0x32bb('0x13')](util[_0x32bb('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x3b15f4['uniqueid'],queues[_0x3b15f4[_0x32bb('0x5')]][_0x32bb('0x1d')],_0x3b15f4['value'],queues[_0x3b15f4['uniqueid']][_0x32bb('0xa')]));writeDB(queues[_0x3b15f4[_0x32bb('0x5')]]);}}else if(!_[_0x32bb('0x18')](_0x3b15f4['variable'][_0x32bb('0x25')])){if(!_['isNil'](queues[_0x3b15f4[_0x32bb('0x5')]])&&!queues[_0x3b15f4[_0x32bb('0x5')]][_0x32bb('0x26')]){queues[_0x3b15f4[_0x32bb('0x5')]][_0x32bb('0x26')]=![];queues[_0x3b15f4[_0x32bb('0x5')]][_0x32bb('0x23')]=null;queues[_0x3b15f4[_0x32bb('0x5')]][_0x32bb('0x27')]=!![];queues[_0x3b15f4[_0x32bb('0x5')]][_0x32bb('0x24')]=utils[_0x32bb('0x16')]();queues[_0x3b15f4[_0x32bb('0x5')]][_0x32bb('0xa')]=_0x32bb('0x28');utils[_0x32bb('0x13')](util['format'](_0x32bb('0x29'),_0x3b15f4[_0x32bb('0x5')],queues[_0x3b15f4[_0x32bb('0x5')]][_0x32bb('0x1d')],_0x3b15f4['value'],queues[_0x3b15f4['uniqueid']]['queuecallerexitreason']));}}}catch(_0x4e1378){utils[_0x32bb('0x17')](util['format'](_0x32bb('0x20'),_0x3b15f4[_0x32bb('0x5')]),_0x4e1378);}};exports[_0x32bb('0x26')]=function(_0x24c926){try{if(!_['isNil'](queues[_0x24c926['uniqueid']])){utils['debug'](util[_0x32bb('0x3')](_0x32bb('0x2a'),_0x24c926[_0x32bb('0x5')]),_0x24c926);queues[_0x24c926['uniqueid']][_0x32bb('0x27')]=![];queues[_0x24c926['uniqueid']]['queuecallerexitAt']=null;queues[_0x24c926['uniqueid']]['queuecallerabandon']=!![];queues[_0x24c926[_0x32bb('0x5')]][_0x32bb('0x23')]=utils['now']();queues[_0x24c926[_0x32bb('0x5')]][_0x32bb('0xa')]=_0x32bb('0x2b');utils[_0x32bb('0x13')](util[_0x32bb('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x24c926[_0x32bb('0x5')],queues[_0x24c926[_0x32bb('0x5')]][_0x32bb('0x1d')],queues[_0x24c926[_0x32bb('0x5')]][_0x32bb('0xa')]));}}catch(_0x2051bf){utils['error'](util[_0x32bb('0x3')]('[%s][queues][queuecallerabandon]',_0x24c926['uniqueid']),_0x2051bf);}};exports[_0x32bb('0x2c')]=function(_0x4e1d4d){try{if(!_[_0x32bb('0x18')](queues[_0x4e1d4d[_0x32bb('0x5')]])){utils[_0x32bb('0x11')](util[_0x32bb('0x3')](_0x32bb('0x2d'),_0x4e1d4d['uniqueid']),_0x4e1d4d);utils['info'](util[_0x32bb('0x3')](_0x32bb('0x2e'),_0x4e1d4d[_0x32bb('0x5')],queues[_0x4e1d4d[_0x32bb('0x5')]][_0x32bb('0x1d')],_0x4e1d4d[_0x32bb('0x2f')],_0x4e1d4d[_0x32bb('0x30')]));queues[_0x4e1d4d[_0x32bb('0x5')]][_0x32bb('0x2c')]=!![];queues[_0x4e1d4d[_0x32bb('0x5')]][_0x32bb('0x31')]=utils[_0x32bb('0x16')]();queues[_0x4e1d4d['uniqueid']][_0x32bb('0x32')]=utils[_0x32bb('0x33')](queues[_0x4e1d4d[_0x32bb('0x5')]]['queuecallerleaveAt'],queues[_0x4e1d4d['uniqueid']][_0x32bb('0x34')]);queues[_0x4e1d4d[_0x32bb('0x5')]][_0x32bb('0x15')]=_0x4e1d4d[_0x32bb('0x15')];queues[_0x4e1d4d[_0x32bb('0x5')]][_0x32bb('0x35')]=_0x4e1d4d[_0x32bb('0x35')];queues[_0x4e1d4d[_0x32bb('0x5')]][_0x32bb('0x2f')]=_0x4e1d4d[_0x32bb('0x2f')];queues[_0x4e1d4d[_0x32bb('0x5')]]['connectedlinename']=_0x4e1d4d['connectedlinename'];}}catch(_0x1cc92a){utils[_0x32bb('0x17')](util[_0x32bb('0x3')](_0x32bb('0x2d'),_0x4e1d4d[_0x32bb('0x5')]),_0x1cc92a);}};exports[_0x32bb('0x36')]=function(_0x395b27){try{if(!_[_0x32bb('0x18')](queues[_0x395b27[_0x32bb('0x5')]])){utils[_0x32bb('0x11')](util[_0x32bb('0x3')](_0x32bb('0x37'),_0x395b27['uniqueid']),_0x395b27);utils[_0x32bb('0x13')](util[_0x32bb('0x3')](_0x32bb('0x38'),_0x395b27[_0x32bb('0x5')],queues[_0x395b27[_0x32bb('0x5')]][_0x32bb('0x1d')],_0x395b27['membername'],_0x395b27[_0x32bb('0x39')]));queues[_0x395b27[_0x32bb('0x5')]][_0x32bb('0x26')]=![];queues[_0x395b27[_0x32bb('0x5')]][_0x32bb('0x26')]=![];queues[_0x395b27[_0x32bb('0x5')]][_0x32bb('0x23')]=null;queues[_0x395b27['uniqueid']][_0x32bb('0x27')]=![];queues[_0x395b27[_0x32bb('0x5')]][_0x32bb('0xa')]=null;queues[_0x395b27[_0x32bb('0x5')]][_0x32bb('0x24')]=null;queues[_0x395b27[_0x32bb('0x5')]][_0x32bb('0x3a')]=!![];queues[_0x395b27[_0x32bb('0x5')]]['accountcode']=_0x395b27[_0x32bb('0x39')];queues[_0x395b27[_0x32bb('0x5')]]['lastAssignedTo']=_0x395b27[_0x32bb('0x3b')];}}catch(_0x532f8c){utils['error'](util[_0x32bb('0x3')]('[%s][queues][agentconnect]',_0x395b27[_0x32bb('0x5')]),_0x532f8c);}};exports[_0x32bb('0x3c')]=function(_0x12e089){try{if(!_[_0x32bb('0x18')](queues[_0x12e089['uniqueid']])){if(queues[_0x12e089['uniqueid']]['queuecallerleaveAt']){utils[_0x32bb('0x11')](util[_0x32bb('0x3')](_0x32bb('0x3d'),_0x12e089['uniqueid']),_0x12e089);queues[_0x12e089[_0x32bb('0x5')]]['queuecallerabandon']=![];queues[_0x12e089[_0x32bb('0x5')]][_0x32bb('0x26')]=![];queues[_0x12e089[_0x32bb('0x5')]][_0x32bb('0x23')]=null;queues[_0x12e089[_0x32bb('0x5')]][_0x32bb('0x27')]=![];queues[_0x12e089[_0x32bb('0x5')]][_0x32bb('0x24')]=null;queues[_0x12e089[_0x32bb('0x5')]][_0x32bb('0x3a')]=!![];queues[_0x12e089['uniqueid']][_0x32bb('0x3e')]=_0x12e089[_0x32bb('0x3b')];queues[_0x12e089['uniqueid']][_0x32bb('0x1a')]=!![];queues[_0x12e089[_0x32bb('0x5')]][_0x32bb('0x3f')]=utils['now']();if(_0x12e089[_0x32bb('0x40')]==_0x32bb('0x41')){if(!queues[_0x12e089['uniqueid']][_0x32bb('0x41')]){queues[_0x12e089[_0x32bb('0x5')]]['queuecallerexitreason']=_0x32bb('0x42');}}else{queues[_0x12e089[_0x32bb('0x5')]][_0x32bb('0xa')]=_0x32bb('0x43')+_0x12e089['reason'][_0x32bb('0x21')]();}utils[_0x32bb('0x13')](util[_0x32bb('0x3')](_0x32bb('0x44'),_0x12e089[_0x32bb('0x5')],queues[_0x12e089['uniqueid']]['name'],_0x12e089[_0x32bb('0x3b')],queues[_0x12e089[_0x32bb('0x5')]][_0x32bb('0xa')]));writeDB(queues[_0x12e089[_0x32bb('0x5')]]);}}}catch(_0x45fcf6){utils[_0x32bb('0x17')](util[_0x32bb('0x3')]('[%s][queues][agentcomplete]',_0x12e089[_0x32bb('0x5')]),_0x45fcf6);}};exports['blindtransfer']=function(_0x151c97){try{if(!_[_0x32bb('0x18')](queues[_0x151c97['transfereeuniqueid']])){utils[_0x32bb('0x11')](util[_0x32bb('0x3')](_0x32bb('0x45'),_0x151c97[_0x32bb('0x5')]),_0x151c97);queues[_0x151c97['transfereeuniqueid']][_0x32bb('0x41')]=!![];queues[_0x151c97[_0x32bb('0x46')]][_0x32bb('0x47')]=_0x32bb('0x48');queues[_0x151c97[_0x32bb('0x46')]]['transferexten']=_0x151c97['extension'];queues[_0x151c97[_0x32bb('0x46')]][_0x32bb('0x49')]=_0x151c97[_0x32bb('0x46')];queues[_0x151c97['transfereeuniqueid']][_0x32bb('0xa')]='BLINDTRANSFER';utils[_0x32bb('0x13')](util[_0x32bb('0x3')](_0x32bb('0x4a'),_0x151c97['uniqueid'],queues[_0x151c97['transfereeuniqueid']]['name'],_0x151c97['transfereeuniqueid'],_0x151c97[_0x32bb('0x4b')]));}}catch(_0x2846fd){utils[_0x32bb('0x17')](util[_0x32bb('0x3')](_0x32bb('0x45'),_0x151c97[_0x32bb('0x5')]),_0x2846fd);}};exports['attendedtransfer']=function(_0x476c56){try{utils[_0x32bb('0x11')](util['format'](_0x32bb('0x4c'),_0x476c56[_0x32bb('0x4d')]),_0x476c56);if(_0x476c56[_0x32bb('0x4d')]==_0x476c56[_0x32bb('0x4e')]){if(!_[_0x32bb('0x18')](queues[_0x476c56[_0x32bb('0x4f')]])){utils['info'](util[_0x32bb('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x476c56[_0x32bb('0x4d')],queues[_0x476c56[_0x32bb('0x4f')]]['name'],_0x476c56[_0x32bb('0x50')]));queues[_0x476c56[_0x32bb('0x4f')]][_0x32bb('0x41')]=!![];queues[_0x476c56['secondtransfererlinkedid']][_0x32bb('0x47')]=_0x32bb('0x51');queues[_0x476c56[_0x32bb('0x4f')]][_0x32bb('0x52')]=_0x476c56[_0x32bb('0x50')];queues[_0x476c56['secondtransfererlinkedid']][_0x32bb('0x49')]=_0x476c56[_0x32bb('0x4d')];queues[_0x476c56[_0x32bb('0x4f')]][_0x32bb('0xa')]=_0x32bb('0x53');}if(!_[_0x32bb('0x18')](queues[_0x476c56[_0x32bb('0x4e')]])){if(_0x476c56[_0x32bb('0x54')]&&queues[_0x476c56[_0x32bb('0x54')]]){queues[_0x476c56[_0x32bb('0x54')]]['queuecallerenterreason']=0x1;queues[_0x476c56[_0x32bb('0x46')]]=_[_0x32bb('0x55')](queues[_0x476c56[_0x32bb('0x54')]]);queues[_0x476c56[_0x32bb('0x46')]][_0x32bb('0xf')]=_0x476c56[_0x32bb('0x56')];queues[_0x476c56[_0x32bb('0x46')]][_0x32bb('0x1e')]=0x2;queues[_0x476c56['transfereeuniqueid']][_0x32bb('0x8')]=queues[_0x476c56[_0x32bb('0x4f')]]['calleridnum'];queues[_0x476c56[_0x32bb('0x46')]][_0x32bb('0x57')]=queues[_0x476c56[_0x32bb('0x4f')]][_0x32bb('0x57')];queues[_0x476c56[_0x32bb('0x46')]]['queuecallerjoinAt']=utils[_0x32bb('0x16')]();queues[_0x476c56[_0x32bb('0x46')]][_0x32bb('0x31')]=utils[_0x32bb('0x16')]();queues[_0x476c56[_0x32bb('0x46')]][_0x32bb('0x32')]=0x0;queues[_0x476c56[_0x32bb('0x46')]][_0x32bb('0x58')]=0x0;utils[_0x32bb('0x13')](util[_0x32bb('0x3')](_0x32bb('0x59'),_0x476c56[_0x32bb('0x4d')],queues[_0x476c56[_0x32bb('0x46')]][_0x32bb('0x1d')],queues[_0x476c56[_0x32bb('0x46')]][_0x32bb('0x8')],queues[_0x476c56['transfereeuniqueid']][_0x32bb('0x57')]));}else{utils[_0x32bb('0x13')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x476c56[_0x32bb('0x4d')],queues[_0x476c56[_0x32bb('0x4e')]][_0x32bb('0x1d')],_0x476c56[_0x32bb('0x4f')]));queues[_0x476c56[_0x32bb('0x4e')]][_0x32bb('0xf')]=_0x476c56[_0x32bb('0x4f')];}}}else if(_0x476c56['secondtransfereruniqueid']==_0x476c56[_0x32bb('0x4f')]){if(!_[_0x32bb('0x18')](queues[_0x476c56['origtransfererlinkedid']])){utils[_0x32bb('0x13')](util[_0x32bb('0x3')](_0x32bb('0x5a'),_0x476c56['origtransfereruniqueid'],queues[_0x476c56['origtransfererlinkedid']][_0x32bb('0x1d')],_0x476c56[_0x32bb('0x5b')],_0x476c56[_0x32bb('0x5c')]));queues[_0x476c56[_0x32bb('0x4e')]][_0x32bb('0x41')]=!![];queues[_0x476c56[_0x32bb('0x4e')]][_0x32bb('0x47')]=_0x32bb('0x51');queues[_0x476c56[_0x32bb('0x4e')]][_0x32bb('0x52')]=_0x476c56[_0x32bb('0x5c')];queues[_0x476c56[_0x32bb('0x4e')]][_0x32bb('0x49')]=_0x476c56['secondtransfereruniqueid'];queues[_0x476c56[_0x32bb('0x4e')]][_0x32bb('0xa')]=_0x32bb('0x53');}if(!_['isNil'](queues[_0x476c56[_0x32bb('0x4f')]])){if(_0x476c56['transfertargetlinkedid']&&queues[_0x476c56[_0x32bb('0x5d')]]){queues[_0x476c56[_0x32bb('0x5d')]][_0x32bb('0x1e')]=0x1;queues[_0x476c56[_0x32bb('0x56')]]=_[_0x32bb('0x55')](queues[_0x476c56[_0x32bb('0x5d')]]);queues[_0x476c56[_0x32bb('0x56')]][_0x32bb('0xf')]=_0x476c56[_0x32bb('0x56')];queues[_0x476c56[_0x32bb('0x56')]][_0x32bb('0x1e')]=0x2;queues[_0x476c56[_0x32bb('0x56')]][_0x32bb('0x8')]=queues[_0x476c56['origtransfererlinkedid']][_0x32bb('0x8')];queues[_0x476c56['transfertargetuniqueid']]['calleridname']=queues[_0x476c56[_0x32bb('0x4e')]][_0x32bb('0x57')];queues[_0x476c56[_0x32bb('0x56')]][_0x32bb('0x34')]=utils[_0x32bb('0x16')]();queues[_0x476c56['transfertargetuniqueid']][_0x32bb('0x31')]=utils[_0x32bb('0x16')]();queues[_0x476c56[_0x32bb('0x56')]]['holdtime']=0x0;queues[_0x476c56['transfertargetuniqueid']][_0x32bb('0x58')]=0x0;utils['info'](util['format'](_0x32bb('0x5e'),_0x476c56[_0x32bb('0x4d')],queues[_0x476c56[_0x32bb('0x56')]][_0x32bb('0x1d')],queues[_0x476c56['transfertargetuniqueid']][_0x32bb('0xf')],queues[_0x476c56[_0x32bb('0x56')]]['calleridnum'],queues[_0x476c56['transfertargetuniqueid']][_0x32bb('0x57')]));}else{utils[_0x32bb('0x13')](util[_0x32bb('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x476c56[_0x32bb('0x4d')],queues[_0x476c56[_0x32bb('0x4f')]][_0x32bb('0x1d')],_0x476c56[_0x32bb('0x4e')]));queues[_0x476c56['secondtransfererlinkedid']]['transfereduniqueid']=_0x476c56[_0x32bb('0x4e')];}}}}catch(_0x5c78a2){utils[_0x32bb('0x17')](util[_0x32bb('0x3')](_0x32bb('0x4c'),_0x476c56[_0x32bb('0x4d')]),_0x5c78a2);}};exports[_0x32bb('0x5f')]=function(_0x249fb1){try{if(!_[_0x32bb('0x18')](queues[_0x249fb1[_0x32bb('0x5')]])){utils[_0x32bb('0x11')](util[_0x32bb('0x3')](_0x32bb('0x60'),_0x249fb1[_0x32bb('0x5')]),_0x249fb1);queues[_0x249fb1['uniqueid']][_0x32bb('0x61')]=utils['now']();utils[_0x32bb('0x13')](util[_0x32bb('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x249fb1[_0x32bb('0x5')],queues[_0x249fb1[_0x32bb('0x5')]][_0x32bb('0x1d')],queues[_0x249fb1[_0x32bb('0x5')]]['musiconholdstartAt']));}}catch(_0x1286e9){utils['error'](util[_0x32bb('0x3')](_0x32bb('0x60'),_0x249fb1[_0x32bb('0x5')]),_0x1286e9);}};exports[_0x32bb('0x62')]=function(_0xe2f17b){try{if(!_[_0x32bb('0x18')](queues[_0xe2f17b[_0x32bb('0x5')]])){if(!_[_0x32bb('0x18')](queues[_0xe2f17b[_0x32bb('0x5')]]['musiconholdstartAt'])){utils['debug'](util[_0x32bb('0x3')]('[%s][queues][musiconholdstop]',_0xe2f17b[_0x32bb('0x5')]),_0xe2f17b);queues[_0xe2f17b[_0x32bb('0x5')]][_0x32bb('0x58')]+=utils[_0x32bb('0x33')](utils[_0x32bb('0x16')](),queues[_0xe2f17b[_0x32bb('0x5')]][_0x32bb('0x61')]);utils[_0x32bb('0x13')](util[_0x32bb('0x3')](_0x32bb('0x63'),_0xe2f17b[_0x32bb('0x5')],queues[_0xe2f17b['uniqueid']][_0x32bb('0x1d')],queues[_0xe2f17b[_0x32bb('0x5')]][_0x32bb('0x58')]));delete queues[_0xe2f17b['uniqueid']][_0x32bb('0x61')];}}}catch(_0x4d8ea1){utils[_0x32bb('0x17')](util[_0x32bb('0x3')]('[%s][queues][musiconholdstop]',_0xe2f17b[_0x32bb('0x5')]),_0x4d8ea1);}}; \ No newline at end of file +var _0xba3d=['secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%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]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','format','uniqueid','queue','lastAssignedTo','accountcode','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','error','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','diffTime','queuecallerleaveAt','queuecallerjoinAt','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER'];(function(_0x5ac12a,_0x2bcca4){var _0x5854ab=function(_0x1a7e11){while(--_0x1a7e11){_0x5ac12a['push'](_0x5ac12a['shift']());}};_0x5854ab(++_0x2bcca4);}(_0xba3d,0x13b));var _0xdba3=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xba3d[_0x403c20];return _0x2b271a;};'use strict';var _=require('lodash');var util=require(_0xdba3('0x0'));var utils=require(_0xdba3('0x1'));var queues={};function writeDB(_0x2a6b50){utils['info'](util[_0xdba3('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x2a6b50[_0xdba3('0x3')],_0x2a6b50['channel'],_0x2a6b50[_0xdba3('0x4')],_0x2a6b50[_0xdba3('0x5')],_0x2a6b50['calleridnum'],_0x2a6b50[_0xdba3('0x6')],_0x2a6b50['queuecallerexitreason']));if(_0x2a6b50[_0xdba3('0x4')]){utils[_0xdba3('0x7')](_0x2a6b50[_0xdba3('0x4')])[_0xdba3('0x8')](function(_0x66520a){if(_0x66520a){_0x2a6b50[_0xdba3('0x9')]=_0x66520a['type'];}utils[_0xdba3('0xa')](_0xdba3('0xb'),_0x2a6b50);});}else{utils['request']('CreateVoiceQueueReport',_0x2a6b50);}if(_0x2a6b50[_0xdba3('0xc')]){delete queues[_0x2a6b50['transfereduniqueid']];}else{delete queues[_0x2a6b50[_0xdba3('0x3')]];}}exports[_0xdba3('0xd')]=function(_0x796277){try{utils[_0xdba3('0xe')](util[_0xdba3('0x2')]('[%s][queues][queuecallerjoin]',_0x796277['uniqueid']),_0x796277);utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x10'),_0x796277[_0xdba3('0x3')],_0x796277[_0xdba3('0x4')],_0x796277[_0xdba3('0x11')]));queues[_0x796277[_0xdba3('0x3')]]=_[_0xdba3('0x12')](_0x796277,{'originalposition':_0x796277['position'],'queuecallerjoinAt':utils[_0xdba3('0x13')](),'mohtime':0x0});}catch(_0x193366){utils['error'](util['format'](_0xdba3('0x14'),_0x796277[_0xdba3('0x3')]),_0x193366);}};exports[_0xdba3('0x15')]=function(_0x5ef605){try{if(!_[_0xdba3('0x16')](queues[_0x5ef605[_0xdba3('0x3')]])){utils[_0xdba3('0xe')](util[_0xdba3('0x2')](_0xdba3('0x17'),_0x5ef605['uniqueid']),_0x5ef605);if(queues[_0x5ef605['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x5ef605['uniqueid']][_0xdba3('0x18')]&&!queues[_0x5ef605['uniqueid']]['queuecallerexit']){queues[_0x5ef605['uniqueid']]['queuecallercomplete']=!![];queues[_0x5ef605['uniqueid']][_0xdba3('0x19')]=utils[_0xdba3('0x13')]();queues[_0x5ef605[_0xdba3('0x3')]][_0xdba3('0x1a')]=_0xdba3('0x1b');}utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x1c'),_0x5ef605['uniqueid'],queues[_0x5ef605[_0xdba3('0x3')]][_0xdba3('0x1d')],queues[_0x5ef605[_0xdba3('0x3')]][_0xdba3('0x1a')]));writeDB(queues[_0x5ef605[_0xdba3('0x3')]]);}else if(queues[_0x5ef605[_0xdba3('0x3')]]['transfereduniqueid']){utils[_0xdba3('0xf')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5ef605[_0xdba3('0x3')],queues[_0x5ef605[_0xdba3('0x3')]][_0xdba3('0x1d')],queues[_0x5ef605[_0xdba3('0x3')]][_0xdba3('0xc')]));queues[queues[_0x5ef605[_0xdba3('0x3')]][_0xdba3('0xc')]]=queues[_0x5ef605[_0xdba3('0x3')]];queues[queues[_0x5ef605[_0xdba3('0x3')]]['transfereduniqueid']][_0xdba3('0x1e')]=0x2;delete queues[_0x5ef605[_0xdba3('0x3')]];}}}catch(_0x545021){utils[_0xdba3('0x1f')](util[_0xdba3('0x2')]('[%s][queues][hangup]',_0x5ef605[_0xdba3('0x3')]),_0x545021);}};exports[_0xdba3('0x20')]=function(_0x151be5){try{utils['debug'](util[_0xdba3('0x2')](_0xdba3('0x21'),_0x151be5[_0xdba3('0x3')]),_0x151be5);if(!_['isNil'](_0x151be5['variable'][_0xdba3('0x22')])&&_0x151be5[_0xdba3('0x23')][_0xdba3('0x24')]()!=='CONTINUE'){if(!_[_0xdba3('0x16')](queues[_0x151be5[_0xdba3('0x3')]])){queues[_0x151be5[_0xdba3('0x3')]][_0xdba3('0x18')]=![];queues[_0x151be5[_0xdba3('0x3')]][_0xdba3('0x25')]=null;queues[_0x151be5['uniqueid']][_0xdba3('0x26')]=!![];queues[_0x151be5[_0xdba3('0x3')]][_0xdba3('0x27')]=utils[_0xdba3('0x13')]();queues[_0x151be5[_0xdba3('0x3')]][_0xdba3('0x1a')]=_0x151be5[_0xdba3('0x23')][_0xdba3('0x24')]();utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x28'),_0x151be5[_0xdba3('0x3')],queues[_0x151be5[_0xdba3('0x3')]]['name'],_0x151be5[_0xdba3('0x23')],queues[_0x151be5[_0xdba3('0x3')]][_0xdba3('0x1a')]));writeDB(queues[_0x151be5[_0xdba3('0x3')]]);}}else if(!_['isNil'](_0x151be5[_0xdba3('0x29')]['queueposition'])){if(!_[_0xdba3('0x16')](queues[_0x151be5[_0xdba3('0x3')]])&&!queues[_0x151be5[_0xdba3('0x3')]]['queuecallerabandon']){queues[_0x151be5['uniqueid']][_0xdba3('0x18')]=![];queues[_0x151be5[_0xdba3('0x3')]][_0xdba3('0x25')]=null;queues[_0x151be5[_0xdba3('0x3')]]['queuecallerexit']=!![];queues[_0x151be5[_0xdba3('0x3')]][_0xdba3('0x27')]=utils[_0xdba3('0x13')]();queues[_0x151be5[_0xdba3('0x3')]][_0xdba3('0x1a')]=_0xdba3('0x2a');utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x2b'),_0x151be5['uniqueid'],queues[_0x151be5['uniqueid']][_0xdba3('0x1d')],_0x151be5[_0xdba3('0x23')],queues[_0x151be5['uniqueid']][_0xdba3('0x1a')]));}}}catch(_0x2c0c78){utils[_0xdba3('0x1f')](util[_0xdba3('0x2')](_0xdba3('0x21'),_0x151be5[_0xdba3('0x3')]),_0x2c0c78);}};exports['queuecallerabandon']=function(_0x16ba81){try{if(!_['isNil'](queues[_0x16ba81[_0xdba3('0x3')]])){utils[_0xdba3('0xe')](util['format'](_0xdba3('0x2c'),_0x16ba81[_0xdba3('0x3')]),_0x16ba81);queues[_0x16ba81['uniqueid']][_0xdba3('0x26')]=![];queues[_0x16ba81[_0xdba3('0x3')]]['queuecallerexitAt']=null;queues[_0x16ba81['uniqueid']][_0xdba3('0x18')]=!![];queues[_0x16ba81[_0xdba3('0x3')]]['queuecallerabandonAt']=utils[_0xdba3('0x13')]();queues[_0x16ba81['uniqueid']]['queuecallerexitreason']='ABANDONED';utils[_0xdba3('0xf')](util[_0xdba3('0x2')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x16ba81[_0xdba3('0x3')],queues[_0x16ba81['uniqueid']][_0xdba3('0x1d')],queues[_0x16ba81['uniqueid']]['queuecallerexitreason']));}}catch(_0x352404){utils[_0xdba3('0x1f')](util['format'](_0xdba3('0x2c'),_0x16ba81[_0xdba3('0x3')]),_0x352404);}};exports[_0xdba3('0x2d')]=function(_0x4ed932){try{if(!_[_0xdba3('0x16')](queues[_0x4ed932['uniqueid']])){utils[_0xdba3('0xe')](util[_0xdba3('0x2')](_0xdba3('0x2e'),_0x4ed932[_0xdba3('0x3')]),_0x4ed932);utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x2f'),_0x4ed932['uniqueid'],queues[_0x4ed932[_0xdba3('0x3')]]['name'],_0x4ed932['connectedlinenum'],_0x4ed932[_0xdba3('0x30')]));queues[_0x4ed932[_0xdba3('0x3')]][_0xdba3('0x2d')]=!![];queues[_0x4ed932[_0xdba3('0x3')]]['queuecallerleaveAt']=utils[_0xdba3('0x13')]();queues[_0x4ed932[_0xdba3('0x3')]][_0xdba3('0x31')]=utils[_0xdba3('0x32')](queues[_0x4ed932[_0xdba3('0x3')]][_0xdba3('0x33')],queues[_0x4ed932['uniqueid']][_0xdba3('0x34')]);queues[_0x4ed932[_0xdba3('0x3')]][_0xdba3('0x11')]=_0x4ed932[_0xdba3('0x11')];queues[_0x4ed932['uniqueid']][_0xdba3('0x35')]=_0x4ed932['count'];queues[_0x4ed932[_0xdba3('0x3')]][_0xdba3('0x36')]=_0x4ed932['connectedlinenum'];queues[_0x4ed932[_0xdba3('0x3')]][_0xdba3('0x30')]=_0x4ed932[_0xdba3('0x30')];}}catch(_0x12b034){utils[_0xdba3('0x1f')](util['format'](_0xdba3('0x2e'),_0x4ed932['uniqueid']),_0x12b034);}};exports[_0xdba3('0x37')]=function(_0x32ae9b){try{if(!_[_0xdba3('0x16')](queues[_0x32ae9b[_0xdba3('0x3')]])){utils['debug'](util[_0xdba3('0x2')](_0xdba3('0x38'),_0x32ae9b['uniqueid']),_0x32ae9b);utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x39'),_0x32ae9b[_0xdba3('0x3')],queues[_0x32ae9b[_0xdba3('0x3')]]['name'],_0x32ae9b['membername'],_0x32ae9b[_0xdba3('0x3a')]));queues[_0x32ae9b[_0xdba3('0x3')]]['queuecallerabandon']=![];queues[_0x32ae9b['uniqueid']]['queuecallerabandon']=![];queues[_0x32ae9b['uniqueid']][_0xdba3('0x25')]=null;queues[_0x32ae9b[_0xdba3('0x3')]][_0xdba3('0x26')]=![];queues[_0x32ae9b['uniqueid']][_0xdba3('0x1a')]=null;queues[_0x32ae9b[_0xdba3('0x3')]][_0xdba3('0x27')]=null;queues[_0x32ae9b[_0xdba3('0x3')]][_0xdba3('0x3b')]=!![];queues[_0x32ae9b[_0xdba3('0x3')]][_0xdba3('0x6')]=_0x32ae9b[_0xdba3('0x3a')];queues[_0x32ae9b['uniqueid']]['lastAssignedTo']=_0x32ae9b[_0xdba3('0x3c')];}}catch(_0xdaa218){utils[_0xdba3('0x1f')](util[_0xdba3('0x2')](_0xdba3('0x38'),_0x32ae9b[_0xdba3('0x3')]),_0xdaa218);}};exports[_0xdba3('0x3d')]=function(_0x2da951){try{if(!_[_0xdba3('0x16')](queues[_0x2da951[_0xdba3('0x3')]])){if(queues[_0x2da951[_0xdba3('0x3')]][_0xdba3('0x33')]){utils[_0xdba3('0xe')](util[_0xdba3('0x2')](_0xdba3('0x3e'),_0x2da951[_0xdba3('0x3')]),_0x2da951);queues[_0x2da951[_0xdba3('0x3')]]['queuecallerabandon']=![];queues[_0x2da951['uniqueid']][_0xdba3('0x18')]=![];queues[_0x2da951['uniqueid']][_0xdba3('0x25')]=null;queues[_0x2da951[_0xdba3('0x3')]][_0xdba3('0x26')]=![];queues[_0x2da951['uniqueid']]['queuecallerexitAt']=null;queues[_0x2da951[_0xdba3('0x3')]][_0xdba3('0x3b')]=!![];queues[_0x2da951['uniqueid']][_0xdba3('0x5')]=_0x2da951['membername'];queues[_0x2da951[_0xdba3('0x3')]]['queuecallercomplete']=!![];queues[_0x2da951[_0xdba3('0x3')]][_0xdba3('0x19')]=utils[_0xdba3('0x13')]();if(_0x2da951['reason']==_0xdba3('0x3f')){if(!queues[_0x2da951[_0xdba3('0x3')]][_0xdba3('0x3f')]){queues[_0x2da951[_0xdba3('0x3')]]['queuecallerexitreason']=_0xdba3('0x40');}}else{queues[_0x2da951[_0xdba3('0x3')]][_0xdba3('0x1a')]=_0xdba3('0x41')+_0x2da951[_0xdba3('0x42')]['toUpperCase']();}utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x43'),_0x2da951[_0xdba3('0x3')],queues[_0x2da951['uniqueid']][_0xdba3('0x1d')],_0x2da951[_0xdba3('0x3c')],queues[_0x2da951[_0xdba3('0x3')]][_0xdba3('0x1a')]));writeDB(queues[_0x2da951['uniqueid']]);}}}catch(_0xc415d7){utils[_0xdba3('0x1f')](util[_0xdba3('0x2')]('[%s][queues][agentcomplete]',_0x2da951[_0xdba3('0x3')]),_0xc415d7);}};exports[_0xdba3('0x44')]=function(_0x376398){try{if(!_['isNil'](queues[_0x376398['transfereeuniqueid']])){utils[_0xdba3('0xe')](util[_0xdba3('0x2')](_0xdba3('0x45'),_0x376398['uniqueid']),_0x376398);queues[_0x376398[_0xdba3('0x46')]][_0xdba3('0x3f')]=!![];queues[_0x376398[_0xdba3('0x46')]][_0xdba3('0x47')]=_0xdba3('0x48');queues[_0x376398[_0xdba3('0x46')]][_0xdba3('0x49')]=_0x376398[_0xdba3('0x4a')];queues[_0x376398[_0xdba3('0x46')]][_0xdba3('0x4b')]=_0x376398[_0xdba3('0x46')];queues[_0x376398[_0xdba3('0x46')]][_0xdba3('0x1a')]=_0xdba3('0x4c');utils[_0xdba3('0xf')](util[_0xdba3('0x2')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x376398[_0xdba3('0x3')],queues[_0x376398[_0xdba3('0x46')]][_0xdba3('0x1d')],_0x376398[_0xdba3('0x46')],_0x376398[_0xdba3('0x4a')]));}}catch(_0x132517){utils[_0xdba3('0x1f')](util[_0xdba3('0x2')](_0xdba3('0x45'),_0x376398[_0xdba3('0x3')]),_0x132517);}};exports[_0xdba3('0x4d')]=function(_0x2008ec){try{utils[_0xdba3('0xe')](util[_0xdba3('0x2')](_0xdba3('0x4e'),_0x2008ec[_0xdba3('0x4f')]),_0x2008ec);if(_0x2008ec[_0xdba3('0x4f')]==_0x2008ec[_0xdba3('0x50')]){if(!_[_0xdba3('0x16')](queues[_0x2008ec[_0xdba3('0x51')]])){utils['info'](util[_0xdba3('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x2008ec[_0xdba3('0x4f')],queues[_0x2008ec[_0xdba3('0x51')]][_0xdba3('0x1d')],_0x2008ec[_0xdba3('0x52')]));queues[_0x2008ec[_0xdba3('0x51')]][_0xdba3('0x3f')]=!![];queues[_0x2008ec['secondtransfererlinkedid']]['transfertype']=_0xdba3('0x53');queues[_0x2008ec[_0xdba3('0x51')]][_0xdba3('0x49')]=_0x2008ec['origtransfererexten'];queues[_0x2008ec[_0xdba3('0x51')]][_0xdba3('0x4b')]=_0x2008ec[_0xdba3('0x4f')];queues[_0x2008ec[_0xdba3('0x51')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0xdba3('0x16')](queues[_0x2008ec[_0xdba3('0x50')]])){if(_0x2008ec[_0xdba3('0x54')]&&queues[_0x2008ec[_0xdba3('0x54')]]){queues[_0x2008ec[_0xdba3('0x54')]][_0xdba3('0x1e')]=0x1;queues[_0x2008ec[_0xdba3('0x46')]]=_[_0xdba3('0x55')](queues[_0x2008ec['transfereelinkedid']]);queues[_0x2008ec[_0xdba3('0x46')]][_0xdba3('0xc')]=_0x2008ec[_0xdba3('0x56')];queues[_0x2008ec['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x2008ec[_0xdba3('0x46')]]['calleridnum']=queues[_0x2008ec[_0xdba3('0x51')]][_0xdba3('0x57')];queues[_0x2008ec[_0xdba3('0x46')]][_0xdba3('0x58')]=queues[_0x2008ec[_0xdba3('0x51')]][_0xdba3('0x58')];queues[_0x2008ec[_0xdba3('0x46')]][_0xdba3('0x34')]=utils[_0xdba3('0x13')]();queues[_0x2008ec[_0xdba3('0x46')]][_0xdba3('0x33')]=utils['now']();queues[_0x2008ec[_0xdba3('0x46')]][_0xdba3('0x31')]=0x0;queues[_0x2008ec['transfereeuniqueid']][_0xdba3('0x59')]=0x0;utils[_0xdba3('0xf')](util[_0xdba3('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x2008ec[_0xdba3('0x4f')],queues[_0x2008ec[_0xdba3('0x46')]]['name'],queues[_0x2008ec['transfereeuniqueid']][_0xdba3('0x57')],queues[_0x2008ec[_0xdba3('0x46')]]['calleridname']));}else{utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x5a'),_0x2008ec['origtransfereruniqueid'],queues[_0x2008ec[_0xdba3('0x50')]]['name'],_0x2008ec['secondtransfererlinkedid']));queues[_0x2008ec['origtransfererlinkedid']][_0xdba3('0xc')]=_0x2008ec['secondtransfererlinkedid'];}}}else if(_0x2008ec[_0xdba3('0x5b')]==_0x2008ec[_0xdba3('0x51')]){if(!_['isNil'](queues[_0x2008ec[_0xdba3('0x50')]])){utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x5c'),_0x2008ec['origtransfereruniqueid'],queues[_0x2008ec[_0xdba3('0x50')]][_0xdba3('0x1d')],_0x2008ec['secondtransfereruniqueid'],_0x2008ec[_0xdba3('0x5d')]));queues[_0x2008ec[_0xdba3('0x50')]][_0xdba3('0x3f')]=!![];queues[_0x2008ec[_0xdba3('0x50')]]['transfertype']=_0xdba3('0x53');queues[_0x2008ec[_0xdba3('0x50')]]['transferexten']=_0x2008ec[_0xdba3('0x5d')];queues[_0x2008ec[_0xdba3('0x50')]][_0xdba3('0x4b')]=_0x2008ec[_0xdba3('0x5b')];queues[_0x2008ec[_0xdba3('0x50')]][_0xdba3('0x1a')]=_0xdba3('0x5e');}if(!_[_0xdba3('0x16')](queues[_0x2008ec[_0xdba3('0x51')]])){if(_0x2008ec[_0xdba3('0x5f')]&&queues[_0x2008ec[_0xdba3('0x5f')]]){queues[_0x2008ec[_0xdba3('0x5f')]][_0xdba3('0x1e')]=0x1;queues[_0x2008ec[_0xdba3('0x56')]]=_[_0xdba3('0x55')](queues[_0x2008ec[_0xdba3('0x5f')]]);queues[_0x2008ec[_0xdba3('0x56')]][_0xdba3('0xc')]=_0x2008ec[_0xdba3('0x56')];queues[_0x2008ec[_0xdba3('0x56')]]['queuecallerenterreason']=0x2;queues[_0x2008ec[_0xdba3('0x56')]][_0xdba3('0x57')]=queues[_0x2008ec[_0xdba3('0x50')]][_0xdba3('0x57')];queues[_0x2008ec['transfertargetuniqueid']][_0xdba3('0x58')]=queues[_0x2008ec[_0xdba3('0x50')]]['calleridname'];queues[_0x2008ec[_0xdba3('0x56')]]['queuecallerjoinAt']=utils[_0xdba3('0x13')]();queues[_0x2008ec[_0xdba3('0x56')]][_0xdba3('0x33')]=utils[_0xdba3('0x13')]();queues[_0x2008ec[_0xdba3('0x56')]][_0xdba3('0x31')]=0x0;queues[_0x2008ec[_0xdba3('0x56')]][_0xdba3('0x59')]=0x0;utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x60'),_0x2008ec['origtransfereruniqueid'],queues[_0x2008ec[_0xdba3('0x56')]][_0xdba3('0x1d')],queues[_0x2008ec['transfertargetuniqueid']][_0xdba3('0xc')],queues[_0x2008ec[_0xdba3('0x56')]][_0xdba3('0x57')],queues[_0x2008ec[_0xdba3('0x56')]]['calleridname']));}else{utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x5a'),_0x2008ec['origtransfereruniqueid'],queues[_0x2008ec[_0xdba3('0x51')]][_0xdba3('0x1d')],_0x2008ec[_0xdba3('0x50')]));queues[_0x2008ec['secondtransfererlinkedid']]['transfereduniqueid']=_0x2008ec[_0xdba3('0x50')];}}}}catch(_0x1ad820){utils['error'](util[_0xdba3('0x2')](_0xdba3('0x4e'),_0x2008ec[_0xdba3('0x4f')]),_0x1ad820);}};exports['musiconholdstart']=function(_0x2beff8){try{if(!_[_0xdba3('0x16')](queues[_0x2beff8[_0xdba3('0x3')]])){utils[_0xdba3('0xe')](util[_0xdba3('0x2')](_0xdba3('0x61'),_0x2beff8[_0xdba3('0x3')]),_0x2beff8);queues[_0x2beff8['uniqueid']][_0xdba3('0x62')]=utils[_0xdba3('0x13')]();utils['info'](util[_0xdba3('0x2')](_0xdba3('0x63'),_0x2beff8[_0xdba3('0x3')],queues[_0x2beff8[_0xdba3('0x3')]][_0xdba3('0x1d')],queues[_0x2beff8[_0xdba3('0x3')]][_0xdba3('0x62')]));}}catch(_0x2c1563){utils[_0xdba3('0x1f')](util[_0xdba3('0x2')](_0xdba3('0x61'),_0x2beff8[_0xdba3('0x3')]),_0x2c1563);}};exports['musiconholdstop']=function(_0x3561d2){try{if(!_['isNil'](queues[_0x3561d2['uniqueid']])){if(!_[_0xdba3('0x16')](queues[_0x3561d2[_0xdba3('0x3')]][_0xdba3('0x62')])){utils[_0xdba3('0xe')](util[_0xdba3('0x2')](_0xdba3('0x64'),_0x3561d2[_0xdba3('0x3')]),_0x3561d2);queues[_0x3561d2[_0xdba3('0x3')]][_0xdba3('0x59')]+=utils['diffTime'](utils[_0xdba3('0x13')](),queues[_0x3561d2[_0xdba3('0x3')]][_0xdba3('0x62')]);utils[_0xdba3('0xf')](util[_0xdba3('0x2')](_0xdba3('0x65'),_0x3561d2[_0xdba3('0x3')],queues[_0x3561d2[_0xdba3('0x3')]][_0xdba3('0x1d')],queues[_0x3561d2['uniqueid']][_0xdba3('0x59')]));delete queues[_0x3561d2[_0xdba3('0x3')]]['musiconholdstartAt'];}}}catch(_0xa113ee){utils[_0xdba3('0x1f')](util[_0xdba3('0x2')]('[%s][queues][musiconholdstop]',_0x3561d2[_0xdba3('0x3')]),_0xa113ee);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index ad6e108..a0f8099 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 _0x1a97=['monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','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','transfereruniqueid','recording','lodash','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','then','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','context','exten','channel','error','newstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','isNil','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find'];(function(_0x56f6f3,_0x3e1ab9){var _0x3db406=function(_0x1bec50){while(--_0x1bec50){_0x56f6f3['push'](_0x56f6f3['shift']());}};_0x3db406(++_0x3e1ab9);}(_0x1a97,0xa8));var _0x71a9=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x1a97[_0xd09668];return _0x68726;};'use strict';var _=require(_0x71a9('0x0'));var util=require('util');var utils=require(_0x71a9('0x1'));var transfers=require(_0x71a9('0x2'));var recordings={};function writeDB(_0x1cc3d7){var _0x3db485;utils[_0x71a9('0x3')](util[_0x71a9('0x4')](_0x71a9('0x5'),_0x1cc3d7[_0x71a9('0x6')]));if(transfers[_0x71a9('0x7')][_0x1cc3d7[_0x71a9('0x6')]]){_0x3db485=_0x1cc3d7[_0x71a9('0x6')];_0x1cc3d7[_0x71a9('0x6')]=transfers[_0x71a9('0x7')][_0x1cc3d7[_0x71a9('0x6')]][_0x71a9('0x8')];}if(_0x1cc3d7[_0x71a9('0x9')]){utils['getUserByInternal'](_0x1cc3d7[_0x71a9('0x9')])[_0x71a9('0xa')](function(_0x10cd5f){if(_0x10cd5f){_0x1cc3d7['membername']=_0x10cd5f['name'];_0x1cc3d7[_0x71a9('0xb')]=_0x10cd5f['id'];}utils[_0x71a9('0xc')](_0x71a9('0xd'),_0x1cc3d7);});}else{utils[_0x71a9('0xc')](_0x71a9('0xd'),_0x1cc3d7);}if(_0x3db485)delete transfers[_0x71a9('0x7')][_0x3db485];}exports[_0x71a9('0xe')]=function(_0x1c7360){try{utils[_0x71a9('0xf')](util['format'](_0x71a9('0x10'),_0x1c7360[_0x71a9('0x6')]),_0x1c7360);if(_0x1c7360[_0x71a9('0x6')]==_0x1c7360[_0x71a9('0x11')]){utils[_0x71a9('0x3')](util[_0x71a9('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x1c7360[_0x71a9('0x6')],_0x1c7360[_0x71a9('0x12')],_0x1c7360[_0x71a9('0x13')]));recordings[_0x1c7360[_0x71a9('0x6')]]={'uniqueid':_0x1c7360['uniqueid'],'accountcode':_0x1c7360[_0x71a9('0x9')],'exten':_0x1c7360[_0x71a9('0x13')],'context':_0x1c7360[_0x71a9('0x12')],'channel':_0x1c7360[_0x71a9('0x14')],'monitors':[]};}}catch(_0x227f3f){utils[_0x71a9('0x15')](util['format'](_0x71a9('0x10'),_0x1c7360[_0x71a9('0x6')]),_0x227f3f);}};exports[_0x71a9('0x16')]=function(_0x46a424){try{utils['debug'](util[_0x71a9('0x4')]('[%s][recordings][newstate]',_0x46a424['uniqueid']),_0x46a424);if(!_['isNil'](recordings[_0x46a424[_0x71a9('0x6')]])&&_0x46a424['channelstate']==0x6){utils[_0x71a9('0x3')](util[_0x71a9('0x4')](_0x71a9('0x17'),_0x46a424[_0x71a9('0x6')],_0x46a424[_0x71a9('0x12')],_0x46a424[_0x71a9('0x14')]));}else if(!_['isNil'](recordings[_0x46a424['linkedid']])&&_0x46a424[_0x71a9('0x18')]==0x6&&_0x46a424[_0x71a9('0x12')]!='transfer'){utils[_0x71a9('0x3')](util[_0x71a9('0x4')](_0x71a9('0x19'),_0x46a424[_0x71a9('0x6')],_0x46a424['linkedid'],_0x46a424[_0x71a9('0x12')],_0x46a424['channel']));recordings[_0x46a424[_0x71a9('0x11')]][_0x71a9('0x9')]=_0x46a424[_0x71a9('0x9')];}}catch(_0x75793c){utils['error'](util[_0x71a9('0x4')]('[%s][recordings][newstate]',_0x46a424[_0x71a9('0x6')]),_0x75793c);}};exports[_0x71a9('0x1a')]=function(_0x5b9267){try{if(!_[_0x71a9('0x1b')](_0x5b9267[_0x71a9('0x1c')])&&!_[_0x71a9('0x1b')](_0x5b9267['variable']['mixmonitor_filename'])){utils[_0x71a9('0xf')](util['format'](_0x71a9('0x1d'),_0x5b9267[_0x71a9('0x6')]),_0x5b9267);utils[_0x71a9('0x3')](util[_0x71a9('0x4')](_0x71a9('0x1e'),_0x5b9267['uniqueid'],_0x5b9267[_0x71a9('0x1c')],_0x5b9267[_0x71a9('0x1f')]));if(_[_0x71a9('0x20')](_0x5b9267[_0x71a9('0x1f')],'.wav49')){_0x5b9267[_0x71a9('0x1f')]=_0x5b9267[_0x71a9('0x1f')]['replace'](_0x71a9('0x21'),_0x71a9('0x22'));}if(recordings[_0x5b9267[_0x71a9('0x11')]]){var _0x3de604=_[_0x71a9('0x23')](recordings[_0x5b9267[_0x71a9('0x11')]][_0x71a9('0x24')],{'value':_0x5b9267[_0x71a9('0x1f')]});if(_[_0x71a9('0x1b')](_0x3de604)){recordings[_0x5b9267[_0x71a9('0x11')]]['monitors'][_0x71a9('0x25')]({'value':_0x5b9267[_0x71a9('0x1f')]});}}}}catch(_0x75a006){utils['error'](util['format'](_0x71a9('0x1d'),_0x5b9267[_0x71a9('0x6')]),_0x75a006);}};exports['hangup']=function(_0x3b71ba){try{if(!_[_0x71a9('0x1b')](recordings[_0x3b71ba[_0x71a9('0x6')]])){utils[_0x71a9('0xf')](util[_0x71a9('0x4')](_0x71a9('0x26'),_0x3b71ba[_0x71a9('0x6')]),_0x3b71ba);utils[_0x71a9('0x3')](util[_0x71a9('0x4')](_0x71a9('0x27'),_0x3b71ba[_0x71a9('0x6')],_0x3b71ba[_0x71a9('0x28')],_0x3b71ba[_0x71a9('0x29')],_0x3b71ba['cause-txt']));recordings[_0x3b71ba[_0x71a9('0x6')]][_0x71a9('0x28')]=_0x3b71ba[_0x71a9('0x28')];recordings[_0x3b71ba[_0x71a9('0x6')]][_0x71a9('0x29')]=_0x3b71ba['calleridname'];recordings[_0x3b71ba[_0x71a9('0x6')]][_0x71a9('0x2a')]=_0x3b71ba[_0x71a9('0x2a')];recordings[_0x3b71ba[_0x71a9('0x6')]][_0x71a9('0x2b')]=_0x3b71ba[_0x71a9('0x2b')];if(recordings[_0x3b71ba[_0x71a9('0x6')]]['type']=='outbound'&&recordings[_0x3b71ba['uniqueid']][_0x71a9('0x9')]){recordings[_0x3b71ba[_0x71a9('0x6')]][_0x71a9('0x2a')]=recordings[_0x3b71ba[_0x71a9('0x6')]][_0x71a9('0x9')];recordings[_0x3b71ba[_0x71a9('0x6')]][_0x71a9('0x2b')]='';}recordings[_0x3b71ba[_0x71a9('0x6')]][_0x71a9('0x24')][_0x71a9('0x2c')](function(_0x278b3b){var _0xdd50f=_[_0x71a9('0x2d')](recordings[_0x3b71ba[_0x71a9('0x6')]]);_0xdd50f[_0x71a9('0x1f')]=_0x278b3b['value'];writeDB(_0xdd50f);});delete recordings[_0x3b71ba[_0x71a9('0x6')]];}}catch(_0x253ff6){utils[_0x71a9('0x15')](util[_0x71a9('0x4')](_0x71a9('0x26'),_0x3b71ba['uniqueid']),_0x253ff6);}};exports['newexten']=function(_0x9c3f95){try{if(!_['isNil'](recordings[_0x9c3f95[_0x71a9('0x6')]])){utils['debug'](util[_0x71a9('0x4')](_0x71a9('0x2e'),_0x9c3f95[_0x71a9('0x6')]),_0x9c3f95);utils[_0x71a9('0x3')](util[_0x71a9('0x4')](_0x71a9('0x2f'),_0x9c3f95['uniqueid'],_0x9c3f95[_0x71a9('0x30')],_0x9c3f95[_0x71a9('0x31')]));if(_0x9c3f95[_0x71a9('0x30')][_0x71a9('0x32')]()==_0x71a9('0x33')&&_[_0x71a9('0x34')](_0x9c3f95[_0x71a9('0x31')]['toLowerCase'](),_0x71a9('0x35'))){var _0x311ea7=_0x9c3f95[_0x71a9('0x31')]['split']('=');var _0x1edb4e=_0x311ea7[0x0][_0x71a9('0x36')](_0x311ea7[0x0][_0x71a9('0x37')]('(')+0x1,_0x311ea7[0x0][_0x71a9('0x37')](')'));var _0x46ffd5=_0x311ea7[0x1];recordings[_0x9c3f95[_0x71a9('0x6')]][_0x1edb4e]=_0x46ffd5;}}}catch(_0x5b18ed){utils[_0x71a9('0x15')](util['format'](_0x71a9('0x2e'),_0x9c3f95['uniqueid']),_0x5b18ed);}};exports[_0x71a9('0x38')]=function(_0xc0deea){try{if(!_[_0x71a9('0x1b')](recordings[_0xc0deea[_0x71a9('0x6')]])){utils['debug'](util[_0x71a9('0x4')](_0x71a9('0x39'),_0xc0deea['uniqueid']),_0xc0deea);utils[_0x71a9('0x3')](util[_0x71a9('0x4')](_0x71a9('0x3a'),_0xc0deea[_0x71a9('0x6')],_0xc0deea[_0x71a9('0x3b')]));recordings[_0xc0deea['uniqueid']][_0x71a9('0x3b')]=_0xc0deea[_0x71a9('0x3b')];}}catch(_0x4bcd16){utils['error'](util['format']('[%s][recordings][queuecallerjoin]',_0xc0deea[_0x71a9('0x6')]),_0x4bcd16);}};exports[_0x71a9('0x3c')]=function(_0x14dfb0){try{utils[_0x71a9('0xf')](util['format'](_0x71a9('0x3d'),_0x14dfb0['uniqueid']),_0x14dfb0);utils[_0x71a9('0x3')](util[_0x71a9('0x4')](_0x71a9('0x3e'),_0x14dfb0[_0x71a9('0x6')],_0x14dfb0[_0x71a9('0x3f')],_0x14dfb0[_0x71a9('0x40')],_0x14dfb0[_0x71a9('0x41')],_0x14dfb0['transfereecalleridname']));if(recordings[_0x14dfb0[_0x71a9('0x42')]]&&transfers[_0x71a9('0x7')][_0x14dfb0[_0x71a9('0x42')]]){transfers[_0x71a9('0x7')][_0x14dfb0['transfereruniqueid']][_0x71a9('0x43')]=!![];}}catch(_0x1f5e0c){utils['error'](util['format'](_0x71a9('0x3d'),_0x14dfb0[_0x71a9('0x6')]),_0x1f5e0c);}}; \ No newline at end of file +var _0x831d=['error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','find','monitors','isNil','push','[%s][recordings][varset]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','context','exten','channel'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x831d,0x109));var _0xd831=function(_0x1bfcfc,_0x140f5b){_0x1bfcfc=_0x1bfcfc-0x0;var _0x1041ff=_0x831d[_0x1bfcfc];return _0x1041ff;};'use strict';var _=require(_0xd831('0x0'));var util=require(_0xd831('0x1'));var utils=require('./utils');var transfers=require(_0xd831('0x2'));var recordings={};function writeDB(_0x2b1be8){var _0x212aaf;utils[_0xd831('0x3')](util['format'](_0xd831('0x4'),_0x2b1be8[_0xd831('0x5')]));if(transfers['blinds'][_0x2b1be8[_0xd831('0x5')]]){_0x212aaf=_0x2b1be8[_0xd831('0x5')];_0x2b1be8['uniqueid']=transfers[_0xd831('0x6')][_0x2b1be8[_0xd831('0x5')]][_0xd831('0x7')];}if(_0x2b1be8[_0xd831('0x8')]){utils[_0xd831('0x9')](_0x2b1be8[_0xd831('0x8')])[_0xd831('0xa')](function(_0x213b29){if(_0x213b29){_0x2b1be8[_0xd831('0xb')]=_0x213b29[_0xd831('0xc')];_0x2b1be8['UserId']=_0x213b29['id'];}utils['request']('CreateVoiceRecording',_0x2b1be8);});}else{utils[_0xd831('0xd')](_0xd831('0xe'),_0x2b1be8);}if(_0x212aaf)delete transfers[_0xd831('0x6')][_0x212aaf];}exports[_0xd831('0xf')]=function(_0x14a631){try{utils[_0xd831('0x10')](util[_0xd831('0x11')](_0xd831('0x12'),_0x14a631[_0xd831('0x5')]),_0x14a631);if(_0x14a631[_0xd831('0x5')]==_0x14a631[_0xd831('0x13')]){utils['info'](util[_0xd831('0x11')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x14a631[_0xd831('0x5')],_0x14a631[_0xd831('0x14')],_0x14a631[_0xd831('0x15')]));recordings[_0x14a631[_0xd831('0x5')]]={'uniqueid':_0x14a631[_0xd831('0x5')],'accountcode':_0x14a631[_0xd831('0x8')],'exten':_0x14a631[_0xd831('0x15')],'context':_0x14a631['context'],'channel':_0x14a631[_0xd831('0x16')],'monitors':[]};}}catch(_0x4adf3c){utils[_0xd831('0x17')](util[_0xd831('0x11')](_0xd831('0x12'),_0x14a631[_0xd831('0x5')]),_0x4adf3c);}};exports[_0xd831('0x18')]=function(_0x13e9c4){try{utils[_0xd831('0x10')](util[_0xd831('0x11')](_0xd831('0x19'),_0x13e9c4['uniqueid']),_0x13e9c4);if(!_['isNil'](recordings[_0x13e9c4[_0xd831('0x5')]])&&_0x13e9c4[_0xd831('0x1a')]==0x6){utils[_0xd831('0x3')](util[_0xd831('0x11')](_0xd831('0x1b'),_0x13e9c4[_0xd831('0x5')],_0x13e9c4[_0xd831('0x14')],_0x13e9c4[_0xd831('0x16')]));}else if(!_['isNil'](recordings[_0x13e9c4[_0xd831('0x13')]])&&_0x13e9c4[_0xd831('0x1a')]==0x6&&_0x13e9c4['context']!=_0xd831('0x1c')){utils[_0xd831('0x3')](util[_0xd831('0x11')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x13e9c4[_0xd831('0x5')],_0x13e9c4[_0xd831('0x13')],_0x13e9c4[_0xd831('0x14')],_0x13e9c4[_0xd831('0x16')]));recordings[_0x13e9c4[_0xd831('0x13')]]['accountcode']=_0x13e9c4[_0xd831('0x8')];}}catch(_0x4c0849){utils['error'](util[_0xd831('0x11')](_0xd831('0x19'),_0x13e9c4[_0xd831('0x5')]),_0x4c0849);}};exports[_0xd831('0x1d')]=function(_0x2ef620){try{if(!_['isNil'](_0x2ef620[_0xd831('0x1e')])&&!_['isNil'](_0x2ef620['variable'][_0xd831('0x1f')])){utils[_0xd831('0x10')](util[_0xd831('0x11')]('[%s][recordings][varset]',_0x2ef620[_0xd831('0x5')]),_0x2ef620);utils[_0xd831('0x3')](util[_0xd831('0x11')](_0xd831('0x20'),_0x2ef620[_0xd831('0x5')],_0x2ef620[_0xd831('0x1e')],_0x2ef620[_0xd831('0x21')]));if(_[_0xd831('0x22')](_0x2ef620['value'],_0xd831('0x23'))){_0x2ef620[_0xd831('0x21')]=_0x2ef620[_0xd831('0x21')]['replace']('.wav49','.WAV');}if(recordings[_0x2ef620[_0xd831('0x13')]]){var _0x3049de=_[_0xd831('0x24')](recordings[_0x2ef620['linkedid']][_0xd831('0x25')],{'value':_0x2ef620['value']});if(_[_0xd831('0x26')](_0x3049de)){recordings[_0x2ef620['linkedid']]['monitors'][_0xd831('0x27')]({'value':_0x2ef620[_0xd831('0x21')]});}}}}catch(_0x43dbdf){utils['error'](util[_0xd831('0x11')](_0xd831('0x28'),_0x2ef620[_0xd831('0x5')]),_0x43dbdf);}};exports['hangup']=function(_0x3e0655){try{if(!_[_0xd831('0x26')](recordings[_0x3e0655['uniqueid']])){utils[_0xd831('0x10')](util[_0xd831('0x11')]('[%s][recordings][hangup]',_0x3e0655[_0xd831('0x5')]),_0x3e0655);utils[_0xd831('0x3')](util[_0xd831('0x11')](_0xd831('0x29'),_0x3e0655[_0xd831('0x5')],_0x3e0655['calleridnum'],_0x3e0655[_0xd831('0x2a')],_0x3e0655['cause-txt']));recordings[_0x3e0655[_0xd831('0x5')]]['calleridnum']=_0x3e0655['calleridnum'];recordings[_0x3e0655[_0xd831('0x5')]]['calleridname']=_0x3e0655['calleridname'];recordings[_0x3e0655['uniqueid']]['connectedlinenum']=_0x3e0655[_0xd831('0x2b')];recordings[_0x3e0655[_0xd831('0x5')]]['connectedlinename']=_0x3e0655[_0xd831('0x2c')];if(recordings[_0x3e0655[_0xd831('0x5')]][_0xd831('0x2d')]==_0xd831('0x2e')&&recordings[_0x3e0655[_0xd831('0x5')]][_0xd831('0x8')]){recordings[_0x3e0655[_0xd831('0x5')]][_0xd831('0x2b')]=recordings[_0x3e0655[_0xd831('0x5')]][_0xd831('0x8')];recordings[_0x3e0655['uniqueid']]['connectedlinename']='';}recordings[_0x3e0655[_0xd831('0x5')]][_0xd831('0x25')][_0xd831('0x2f')](function(_0x453f37){var _0x1bab98=_[_0xd831('0x30')](recordings[_0x3e0655[_0xd831('0x5')]]);_0x1bab98[_0xd831('0x21')]=_0x453f37['value'];writeDB(_0x1bab98);});delete recordings[_0x3e0655['uniqueid']];}}catch(_0x773829){utils['error'](util[_0xd831('0x11')]('[%s][recordings][hangup]',_0x3e0655[_0xd831('0x5')]),_0x773829);}};exports[_0xd831('0x31')]=function(_0x56cc6f){try{if(!_[_0xd831('0x26')](recordings[_0x56cc6f[_0xd831('0x5')]])){utils[_0xd831('0x10')](util[_0xd831('0x11')](_0xd831('0x32'),_0x56cc6f[_0xd831('0x5')]),_0x56cc6f);utils['info'](util['format']('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x56cc6f[_0xd831('0x5')],_0x56cc6f[_0xd831('0x33')],_0x56cc6f[_0xd831('0x34')]));if(_0x56cc6f[_0xd831('0x33')][_0xd831('0x35')]()==_0xd831('0x36')&&_[_0xd831('0x37')](_0x56cc6f[_0xd831('0x34')][_0xd831('0x35')](),_0xd831('0x38'))){var _0xbdba48=_0x56cc6f[_0xd831('0x34')][_0xd831('0x39')]('=');var _0x47c77a=_0xbdba48[0x0][_0xd831('0x3a')](_0xbdba48[0x0][_0xd831('0x3b')]('(')+0x1,_0xbdba48[0x0]['lastIndexOf'](')'));var _0x25c69e=_0xbdba48[0x1];recordings[_0x56cc6f['uniqueid']][_0x47c77a]=_0x25c69e;}}}catch(_0x201067){utils[_0xd831('0x17')](util[_0xd831('0x11')]('[%s][recordings][newexten]',_0x56cc6f[_0xd831('0x5')]),_0x201067);}};exports[_0xd831('0x3c')]=function(_0x5273ba){try{if(!_[_0xd831('0x26')](recordings[_0x5273ba['uniqueid']])){utils[_0xd831('0x10')](util['format']('[%s][recordings][queuecallerjoin]',_0x5273ba[_0xd831('0x5')]),_0x5273ba);utils[_0xd831('0x3')](util[_0xd831('0x11')](_0xd831('0x3d'),_0x5273ba[_0xd831('0x5')],_0x5273ba[_0xd831('0x3e')]));recordings[_0x5273ba['uniqueid']][_0xd831('0x3e')]=_0x5273ba['queue'];}}catch(_0x20c85d){utils[_0xd831('0x17')](util[_0xd831('0x11')](_0xd831('0x3f'),_0x5273ba[_0xd831('0x5')]),_0x20c85d);}};exports[_0xd831('0x40')]=function(_0x81b114){try{utils[_0xd831('0x10')](util['format'](_0xd831('0x41'),_0x81b114['uniqueid']),_0x81b114);utils[_0xd831('0x3')](util[_0xd831('0x11')](_0xd831('0x42'),_0x81b114[_0xd831('0x5')],_0x81b114[_0xd831('0x43')],_0x81b114[_0xd831('0x44')],_0x81b114[_0xd831('0x45')],_0x81b114[_0xd831('0x46')]));if(recordings[_0x81b114['transfereruniqueid']]&&transfers['blinds'][_0x81b114['transfereruniqueid']]){transfers[_0xd831('0x6')][_0x81b114[_0xd831('0x47')]]['recording']=!![];}}catch(_0x11d737){utils[_0xd831('0x17')](util[_0xd831('0x11')](_0xd831('0x41'),_0x81b114[_0xd831('0x5')]),_0x11d737);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 1239160..def4328 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 _0xe5c6=['transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','isNil','transfereechannel','assign','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','blinds','debug','[%s][transfers][blindtransfer]','info','uniqueid','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum'];(function(_0xbc25e1,_0x27007d){var _0xaf0a85=function(_0x52acb3){while(--_0x52acb3){_0xbc25e1['push'](_0xbc25e1['shift']());}};_0xaf0a85(++_0x27007d);}(_0xe5c6,0x83));var _0x6e5c=function(_0x8057c0,_0x2300b5){_0x8057c0=_0x8057c0-0x0;var _0xcd9a7d=_0xe5c6[_0x8057c0];return _0xcd9a7d;};'use strict';var _=require(_0x6e5c('0x0'));var util=require(_0x6e5c('0x1'));var utils=require(_0x6e5c('0x2'));function writeDB(_0x44988a){utils['info'](util[_0x6e5c('0x3')](_0x6e5c('0x4'),_0x44988a[_0x6e5c('0x5')]===_0x6e5c('0x6')?_0x44988a[_0x6e5c('0x7')]:_0x44988a['uniqueid'],_0x44988a[_0x6e5c('0x5')]));utils[_0x6e5c('0x8')]('CreateVoiceTransferReport',_0x44988a);}exports[_0x6e5c('0x9')]={};exports['blindtransfer']=function(_0x423780){try{utils[_0x6e5c('0xa')](util[_0x6e5c('0x3')](_0x6e5c('0xb'),_0x423780['uniqueid']),_0x423780);utils[_0x6e5c('0xc')](util[_0x6e5c('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x423780[_0x6e5c('0xd')],_0x423780['transferercalleridnum'],_0x423780[_0x6e5c('0xe')],_0x423780[_0x6e5c('0xf')],_0x423780[_0x6e5c('0x10')]));_0x423780[_0x6e5c('0x5')]=_0x6e5c('0x11');exports[_0x6e5c('0x9')][_0x423780[_0x6e5c('0x12')]]=_0x423780;writeDB(_0x423780);}catch(_0x5bc911){utils[_0x6e5c('0x13')](util[_0x6e5c('0x3')](_0x6e5c('0xb'),_0x423780[_0x6e5c('0xd')]),_0x5bc911);}};exports[_0x6e5c('0x14')]=function(_0x45c1a0){try{utils[_0x6e5c('0xa')](util['format'](_0x6e5c('0x15'),_0x45c1a0['origtransfereruniqueid']),_0x45c1a0);utils[_0x6e5c('0xc')](util[_0x6e5c('0x3')](_0x6e5c('0x16'),_0x45c1a0['origtransfereruniqueid'],_0x45c1a0['origtransferercalleridnum'],_0x45c1a0[_0x6e5c('0x17')],_0x45c1a0[_0x6e5c('0x18')],_0x45c1a0[_0x6e5c('0x19')]));_0x45c1a0=_['assign'](_0x45c1a0,{'transfererchannel':_0x45c1a0[_0x6e5c('0x1a')],'transferercalleridnum':_0x45c1a0['origtransferercalleridnum'],'transferercalleridname':_0x45c1a0[_0x6e5c('0x17')],'transfererconnectedlinenum':_0x45c1a0[_0x6e5c('0x1b')],'transfererconnectedlinename':_0x45c1a0['secondtransfererconnectedlinename'],'transfereraccountcode':_0x45c1a0[_0x6e5c('0x1c')],'transferercontext':_0x45c1a0[_0x6e5c('0x1d')],'transfererexten':_0x45c1a0[_0x6e5c('0x1e')],'transfererlinkedid':_0x45c1a0['origtransfererlinkedid'],'context':_0x45c1a0['origtransferercontext'],'extension':_0x45c1a0['origtransfererexten'],'type':_0x6e5c('0x6')});if(_[_0x6e5c('0x1f')](_0x45c1a0[_0x6e5c('0x20')])){_0x45c1a0=_[_0x6e5c('0x21')](_0x45c1a0,{'transfereechannel':_0x45c1a0['transfertargetchannel'],'transfereecalleridnum':_0x45c1a0[_0x6e5c('0x18')],'transfereecalleridname':_0x45c1a0[_0x6e5c('0x19')],'transfereeconnectedlinenum':_0x45c1a0['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x45c1a0[_0x6e5c('0x22')],'transfereeaccountcode':_0x45c1a0[_0x6e5c('0x23')],'transfereecontext':_0x45c1a0[_0x6e5c('0x24')],'transfereeexten':_0x45c1a0[_0x6e5c('0x25')],'transfereelinkedid':_0x45c1a0[_0x6e5c('0x26')]});}writeDB(_0x45c1a0);}catch(_0x52e3e8){utils[_0x6e5c('0x13')](util[_0x6e5c('0x3')](_0x6e5c('0x15'),_0x45c1a0[_0x6e5c('0x7')]),_0x52e3e8);}}; \ No newline at end of file +var _0xbc01=['origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x209691,_0x417b85){var _0x1bfcf3=function(_0xc35ffa){while(--_0xc35ffa){_0x209691['push'](_0x209691['shift']());}};_0x1bfcf3(++_0x417b85);}(_0xbc01,0xc4));var _0x1bc0=function(_0x2efa5f,_0x202ba2){_0x2efa5f=_0x2efa5f-0x0;var _0x24d551=_0xbc01[_0x2efa5f];return _0x24d551;};'use strict';var _=require(_0x1bc0('0x0'));var util=require('util');var utils=require(_0x1bc0('0x1'));function writeDB(_0x13df4f){utils[_0x1bc0('0x2')](util['format'](_0x1bc0('0x3'),_0x13df4f[_0x1bc0('0x4')]==='attended'?_0x13df4f[_0x1bc0('0x5')]:_0x13df4f[_0x1bc0('0x6')],_0x13df4f[_0x1bc0('0x4')]));utils[_0x1bc0('0x7')](_0x1bc0('0x8'),_0x13df4f);}exports[_0x1bc0('0x9')]={};exports[_0x1bc0('0xa')]=function(_0x1db671){try{utils[_0x1bc0('0xb')](util[_0x1bc0('0xc')](_0x1bc0('0xd'),_0x1db671[_0x1bc0('0x6')]),_0x1db671);utils['info'](util[_0x1bc0('0xc')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1db671[_0x1bc0('0x6')],_0x1db671[_0x1bc0('0xe')],_0x1db671[_0x1bc0('0xf')],_0x1db671[_0x1bc0('0x10')],_0x1db671[_0x1bc0('0x11')]));_0x1db671['type']=_0x1bc0('0x12');exports[_0x1bc0('0x9')][_0x1db671[_0x1bc0('0x13')]]=_0x1db671;writeDB(_0x1db671);}catch(_0x27b045){utils[_0x1bc0('0x14')](util[_0x1bc0('0xc')]('[%s][transfers][blindtransfer]',_0x1db671[_0x1bc0('0x6')]),_0x27b045);}};exports[_0x1bc0('0x15')]=function(_0x32c34f){try{utils[_0x1bc0('0xb')](util[_0x1bc0('0xc')](_0x1bc0('0x16'),_0x32c34f['origtransfereruniqueid']),_0x32c34f);utils[_0x1bc0('0x2')](util[_0x1bc0('0xc')](_0x1bc0('0x17'),_0x32c34f[_0x1bc0('0x5')],_0x32c34f[_0x1bc0('0x18')],_0x32c34f[_0x1bc0('0x19')],_0x32c34f[_0x1bc0('0x1a')],_0x32c34f[_0x1bc0('0x1b')]));_0x32c34f=_[_0x1bc0('0x1c')](_0x32c34f,{'transfererchannel':_0x32c34f['origtransfererchannel'],'transferercalleridnum':_0x32c34f[_0x1bc0('0x18')],'transferercalleridname':_0x32c34f[_0x1bc0('0x19')],'transfererconnectedlinenum':_0x32c34f[_0x1bc0('0x1d')],'transfererconnectedlinename':_0x32c34f[_0x1bc0('0x1e')],'transfereraccountcode':_0x32c34f[_0x1bc0('0x1f')],'transferercontext':_0x32c34f['secondtransferercontext'],'transfererexten':_0x32c34f[_0x1bc0('0x20')],'transfererlinkedid':_0x32c34f[_0x1bc0('0x21')],'context':_0x32c34f[_0x1bc0('0x22')],'extension':_0x32c34f[_0x1bc0('0x23')],'type':_0x1bc0('0x24')});if(_[_0x1bc0('0x25')](_0x32c34f['transfereechannel'])){_0x32c34f=_[_0x1bc0('0x1c')](_0x32c34f,{'transfereechannel':_0x32c34f[_0x1bc0('0x26')],'transfereecalleridnum':_0x32c34f['transfertargetcalleridnum'],'transfereecalleridname':_0x32c34f[_0x1bc0('0x1b')],'transfereeconnectedlinenum':_0x32c34f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x32c34f[_0x1bc0('0x27')],'transfereeaccountcode':_0x32c34f[_0x1bc0('0x28')],'transfereecontext':_0x32c34f[_0x1bc0('0x29')],'transfereeexten':_0x32c34f[_0x1bc0('0x2a')],'transfereelinkedid':_0x32c34f[_0x1bc0('0x2b')]});}writeDB(_0x32c34f);}catch(_0x5c202a){utils[_0x1bc0('0x14')](util[_0x1bc0('0xc')]('[%s][transfers][attendedtransfer]',_0x32c34f[_0x1bc0('0x5')]),_0x5c202a);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index f59843e..b5c2846 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 _0x407b=['../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','sumTime','isAfter','isBefore','bluebird','jayson/promise','util','client','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x407b,0x1a2));var _0xb407=function(_0x3e2836,_0x45cb11){_0x3e2836=_0x3e2836-0x0;var _0x5cf9da=_0x407b[_0x3e2836];return _0x5cf9da;};'use strict';var BPromise=require(_0xb407('0x0'));var jayson=require(_0xb407('0x1'));var moment=require('moment');var util=require(_0xb407('0x2'));var client=jayson[_0xb407('0x3')][_0xb407('0x4')]({'port':0x2329});var logger=require(_0xb407('0x5'))(_0xb407('0x6'));exports[_0xb407('0x7')]=function(_0x1c3f02,_0x4f402a){logger[_0xb407('0x7')](_0x1c3f02,_0x4f402a?util[_0xb407('0x8')](_0x4f402a,{'showHidden':![],'depth':null}):'');};exports[_0xb407('0x9')]=function(_0x1b05a0,_0x506e5e){logger['debug'](_0x1b05a0,_0x506e5e?util['inspect'](_0x506e5e,{'showHidden':![],'depth':null}):'');};exports[_0xb407('0xa')]=function(_0x32a2e1,_0x593467){logger[_0xb407('0xa')](_0x32a2e1,_0x593467?util['inspect'](_0x593467,{'showHidden':![],'depth':null}):'');};exports[_0xb407('0xb')]=function(_0xd65be7,_0x3d8d8e){return client[_0xb407('0xb')](_0xd65be7,{'body':_0x3d8d8e})[_0xb407('0xc')](function(_0x31b4b0){logger['debug'](_0xb407('0xd'),_0xd65be7,_0x31b4b0?util['inspect'](_0x31b4b0,{'showHidden':![],'depth':null}):'');})[_0xb407('0xe')](function(_0x564a42){logger[_0xb407('0xa')](_0xb407('0xd'),_0xd65be7,_0x564a42?util[_0xb407('0x8')](_0x564a42,{'showHidden':![],'depth':null}):'');});};function getUser(_0xcafc38){return client[_0xb407('0xb')](_0xb407('0xf'),{'options':{'raw':!![],'attributes':['id',_0xb407('0x10'),_0xb407('0x11'),_0xb407('0x12')],'where':_0xcafc38,'limit':0x1}})[_0xb407('0xc')](function(_0xfb510e){logger[_0xb407('0x9')]('[utils][getUser]\x20where:%s',JSON[_0xb407('0x13')](_0xcafc38),_0xfb510e?util[_0xb407('0x8')](_0xfb510e,{'showHidden':![],'depth':null}):'');return _0xfb510e[_0xb407('0x14')][_0xb407('0x15')]?_0xfb510e[_0xb407('0x14')][0x0]:null;});}exports[_0xb407('0x16')]=function(_0x34081f){return new BPromise(function(_0x493255,_0x3e11a6){if(_0x34081f){return getUser({'internal':_0x34081f})[_0xb407('0xc')](function(_0x248409){logger[_0xb407('0x7')](_0xb407('0x17'),_0x34081f,_0x248409?_0xb407('0x18'):_0xb407('0x19'));return _0x493255(_0x248409);})[_0xb407('0xe')](function(_0x34bf0f){logger[_0xb407('0xa')](_0xb407('0x1a'),_0x34bf0f?util[_0xb407('0x8')](_0x34bf0f,{'showHidden':![],'depth':null}):'');return _0x493255(null);});}return _0x493255(null);});};exports[_0xb407('0x1b')]=function(_0x49375c){return new BPromise(function(_0x14aad4,_0x287b58){if(_0x49375c){return getUser({'interface':_0x49375c})['then'](function(_0xfbe2b){logger[_0xb407('0x7')](_0xb407('0x1c'),_0x49375c,_0xfbe2b?_0xb407('0x18'):_0xb407('0x19'));return _0x14aad4(_0xfbe2b);})[_0xb407('0xe')](function(_0x4505d3){logger['error']('[utils][getUserByInterface]',_0x4505d3?util[_0xb407('0x8')](_0x4505d3,{'showHidden':![],'depth':null}):'');return _0x14aad4(null);});}return _0x14aad4(null);});};exports['getUserByName']=function(_0x56216b){return new BPromise(function(_0x213f90,_0x4955e4){if(_0x56216b){return getUser({'name':_0x56216b})[_0xb407('0xc')](function(_0x5e93e4){logger[_0xb407('0x7')](_0xb407('0x1d'),_0x56216b,_0x5e93e4?'found':'notfound');return _0x213f90(_0x5e93e4);})['catch'](function(_0x549e1d){logger['error'](_0xb407('0x1e'),_0x549e1d?util[_0xb407('0x8')](_0x549e1d,{'showHidden':![],'depth':null}):'');return _0x213f90(null);});}return _0x213f90(null);});};exports[_0xb407('0x1f')]=function(_0x5ca322){return new BPromise(function(_0x5b84ae,_0x3efa67){if(_0x5ca322){return client[_0xb407('0xb')](_0xb407('0x20'),{'options':{'raw':!![],'attributes':['id',_0xb407('0x11'),'type','acw',_0xb407('0x21')],'where':{'name':_0x5ca322},'limit':0x1}})[_0xb407('0xc')](function(_0x32f8c2){logger[_0xb407('0x9')]('[utils][getVoiceQueueByName]\x20name:%s',_0x5ca322,_0x32f8c2?util[_0xb407('0x8')](_0x32f8c2,{'showHidden':![],'depth':null}):'');logger['info'](_0xb407('0x22'),_0x5ca322,_0x32f8c2?_0xb407('0x18'):'notfound');return _0x5b84ae(_0x32f8c2[_0xb407('0x14')][_0xb407('0x15')]?_0x32f8c2[_0xb407('0x14')][0x0]:null);})[_0xb407('0xe')](function(_0x5c4519){logger['error'](_0xb407('0x23'),_0x5c4519?util['inspect'](_0x5c4519,{'showHidden':![],'depth':null}):'');return _0x5b84ae(null);});}return _0x5b84ae(null);});};exports[_0xb407('0x24')]=function(_0x3ed2a2,_0x2fad52){return moment(_0x3ed2a2)[_0xb407('0x25')](_0x2fad52,_0xb407('0x26'))['format'](_0xb407('0x27'));};exports[_0xb407('0x28')]=function(_0x20fd73,_0x139fa7){return moment(_0x20fd73)[_0xb407('0x29')](_0x139fa7,'seconds')[_0xb407('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb407('0x2b')]=function(_0x5c0da5,_0x49a16d){return moment(_0x5c0da5)['diff'](moment(_0x49a16d),_0xb407('0x26'));};exports[_0xb407('0x2c')]=function(_0x27c7dc,_0x47c02a){return parseInt(_0x27c7dc,0xa)+parseInt(_0x47c02a,0xa);};exports['now']=function(){return moment()['format'](_0xb407('0x27'));};exports[_0xb407('0x2d')]=function(_0x1c7cfc,_0x17ba10){if(_0x17ba10){return moment(_0x1c7cfc)[_0xb407('0x2d')](_0x17ba10);}return!![];};exports[_0xb407('0x2e')]=function(_0x26503b,_0x26c5e4){if(_0x26c5e4){return moment(_0x26503b)[_0xb407('0x2e')](_0x26c5e4);}else if(_0x26503b){return!![];}return![];}; \ No newline at end of file +var _0x9bd9=['util','client','http','xdr','inspect','debug','error','request','then','catch','GetUser','internal','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','info','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','subtractTime','YYYY-MM-DD\x20HH:mm:ss','diffTime','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment'];(function(_0x941c4a,_0x2b9c78){var _0x33e0a2=function(_0x3d3082){while(--_0x3d3082){_0x941c4a['push'](_0x941c4a['shift']());}};_0x33e0a2(++_0x2b9c78);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x18c4bf,_0x56dfe5){_0x18c4bf=_0x18c4bf-0x0;var _0x5c9674=_0x9bd9[_0x18c4bf];return _0x5c9674;};'use strict';var BPromise=require(_0x99bd('0x0'));var jayson=require(_0x99bd('0x1'));var moment=require(_0x99bd('0x2'));var util=require(_0x99bd('0x3'));var client=jayson[_0x99bd('0x4')][_0x99bd('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0x99bd('0x6'));exports['info']=function(_0x204fbb,_0x1b3141){logger['info'](_0x204fbb,_0x1b3141?util[_0x99bd('0x7')](_0x1b3141,{'showHidden':![],'depth':null}):'');};exports[_0x99bd('0x8')]=function(_0x1628ac,_0x3807cd){logger[_0x99bd('0x8')](_0x1628ac,_0x3807cd?util[_0x99bd('0x7')](_0x3807cd,{'showHidden':![],'depth':null}):'');};exports[_0x99bd('0x9')]=function(_0x2c34b8,_0x561521){logger[_0x99bd('0x9')](_0x2c34b8,_0x561521?util[_0x99bd('0x7')](_0x561521,{'showHidden':![],'depth':null}):'');};exports[_0x99bd('0xa')]=function(_0x2ded61,_0x2c479b){return client['request'](_0x2ded61,{'body':_0x2c479b})[_0x99bd('0xb')](function(_0x529796){logger[_0x99bd('0x8')]('[utils][request]\x20name:%s',_0x2ded61,_0x529796?util[_0x99bd('0x7')](_0x529796,{'showHidden':![],'depth':null}):'');})[_0x99bd('0xc')](function(_0x4a8bd9){logger[_0x99bd('0x9')]('[utils][request]\x20name:%s',_0x2ded61,_0x4a8bd9?util[_0x99bd('0x7')](_0x4a8bd9,{'showHidden':![],'depth':null}):'');});};function getUser(_0x48b2aa){return client[_0x99bd('0xa')](_0x99bd('0xd'),{'options':{'raw':!![],'attributes':['id',_0x99bd('0xe'),'name',_0x99bd('0xf')],'where':_0x48b2aa,'limit':0x1}})[_0x99bd('0xb')](function(_0x2d918a){logger[_0x99bd('0x8')](_0x99bd('0x10'),JSON[_0x99bd('0x11')](_0x48b2aa),_0x2d918a?util[_0x99bd('0x7')](_0x2d918a,{'showHidden':![],'depth':null}):'');return _0x2d918a[_0x99bd('0x12')][_0x99bd('0x13')]?_0x2d918a['result'][0x0]:null;});}exports[_0x99bd('0x14')]=function(_0x442702){return new BPromise(function(_0x2fe078,_0x581a35){if(_0x442702){return getUser({'internal':_0x442702})['then'](function(_0x1227b3){logger[_0x99bd('0x15')](_0x99bd('0x16'),_0x442702,_0x1227b3?_0x99bd('0x17'):_0x99bd('0x18'));return _0x2fe078(_0x1227b3);})['catch'](function(_0x3748f8){logger['error'](_0x99bd('0x19'),_0x3748f8?util[_0x99bd('0x7')](_0x3748f8,{'showHidden':![],'depth':null}):'');return _0x2fe078(null);});}return _0x2fe078(null);});};exports[_0x99bd('0x1a')]=function(_0x1d937b){return new BPromise(function(_0x28bf58,_0x57136d){if(_0x1d937b){return getUser({'interface':_0x1d937b})[_0x99bd('0xb')](function(_0x229322){logger[_0x99bd('0x15')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x1d937b,_0x229322?_0x99bd('0x17'):'notfound');return _0x28bf58(_0x229322);})['catch'](function(_0x1c5b82){logger[_0x99bd('0x9')]('[utils][getUserByInterface]',_0x1c5b82?util[_0x99bd('0x7')](_0x1c5b82,{'showHidden':![],'depth':null}):'');return _0x28bf58(null);});}return _0x28bf58(null);});};exports[_0x99bd('0x1b')]=function(_0x3ae907){return new BPromise(function(_0x3f7bf4,_0x51ff34){if(_0x3ae907){return getUser({'name':_0x3ae907})[_0x99bd('0xb')](function(_0x5c4279){logger['info'](_0x99bd('0x1c'),_0x3ae907,_0x5c4279?'found':_0x99bd('0x18'));return _0x3f7bf4(_0x5c4279);})['catch'](function(_0x348e18){logger[_0x99bd('0x9')]('[utils][getUserByName]',_0x348e18?util['inspect'](_0x348e18,{'showHidden':![],'depth':null}):'');return _0x3f7bf4(null);});}return _0x3f7bf4(null);});};exports[_0x99bd('0x1d')]=function(_0x1af1e6){return new BPromise(function(_0x1eabb9,_0x5903aa){if(_0x1af1e6){return client[_0x99bd('0xa')](_0x99bd('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x99bd('0x1f'),'type',_0x99bd('0x20'),_0x99bd('0x21')],'where':{'name':_0x1af1e6},'limit':0x1}})['then'](function(_0x2cb4a2){logger[_0x99bd('0x8')](_0x99bd('0x22'),_0x1af1e6,_0x2cb4a2?util[_0x99bd('0x7')](_0x2cb4a2,{'showHidden':![],'depth':null}):'');logger['info'](_0x99bd('0x23'),_0x1af1e6,_0x2cb4a2?_0x99bd('0x17'):'notfound');return _0x1eabb9(_0x2cb4a2[_0x99bd('0x12')]['length']?_0x2cb4a2['result'][0x0]:null);})['catch'](function(_0x1142f9){logger[_0x99bd('0x9')](_0x99bd('0x24'),_0x1142f9?util[_0x99bd('0x7')](_0x1142f9,{'showHidden':![],'depth':null}):'');return _0x1eabb9(null);});}return _0x1eabb9(null);});};exports[_0x99bd('0x25')]=function(_0x447fa4,_0x45f5e7){return moment(_0x447fa4)[_0x99bd('0x26')](_0x45f5e7,_0x99bd('0x27'))[_0x99bd('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x99bd('0x29')]=function(_0x51c6a7,_0x77fe8){return moment(_0x51c6a7)['subtract'](_0x77fe8,'seconds')['format'](_0x99bd('0x2a'));};exports[_0x99bd('0x2b')]=function(_0x3b7abc,_0xbc705f){return moment(_0x3b7abc)['diff'](moment(_0xbc705f),_0x99bd('0x27'));};exports[_0x99bd('0x2c')]=function(_0x4720fa,_0x2b891a){return parseInt(_0x4720fa,0xa)+parseInt(_0x2b891a,0xa);};exports['now']=function(){return moment()[_0x99bd('0x28')](_0x99bd('0x2a'));};exports[_0x99bd('0x2d')]=function(_0x50ca17,_0x5c876f){if(_0x5c876f){return moment(_0x50ca17)[_0x99bd('0x2d')](_0x5c876f);}return!![];};exports[_0x99bd('0x2e')]=function(_0x431a14,_0xb614bb){if(_0xb614bb){return moment(_0x431a14)['isBefore'](_0xb614bb);}else if(_0x431a14){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 76a892b..2e82bf1 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 _0x286a=['no-user','data','timestamp','client','api','auth','set','logger','body','format','method','headers','x-forwarded-for','remoteAddress','responseTime','inspect','use','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','statusCode','other','agent_id','agent_name','test','url','setupLoggers','fs-extra','lodash','express-winston','path','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','join','role','name','ensureDir','then','catch','log','user'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x286a,0x11d));var _0xa286=function(_0x4fb2b9,_0x211b37){_0x4fb2b9=_0x4fb2b9-0x0;var _0x216ac6=_0x286a[_0x4fb2b9];return _0x216ac6;};var fs=require(_0xa286('0x0'));var _=require(_0xa286('0x1'));var ewinston=require(_0xa286('0x2'));var path=require(_0xa286('0x3'));var util=require('util');var fileLogger=require(_0xa286('0x4'))['fileLogger'];var safeTemplate=require(_0xa286('0x5'))[_0xa286('0x6')];var maskSensitiveData=require(_0xa286('0x7'))['maskSensitiveData'];function ClientSideLogger(){function _0x436cae(_0x3bba2e){var _0x528905=path[_0xa286('0x8')]('/var','log','xcally');var _0x4c7ffe=path[_0xa286('0x8')]('client',_0x3bba2e[_0xa286('0x9')]+'-'+_0x3bba2e[_0xa286('0xa')]);return fs[_0xa286('0xb')](path['join'](_0x528905,_0x4c7ffe))[_0xa286('0xc')](function(){var _0x243839=fileLogger('client',path['join'](_0x528905,_0x4c7ffe));return _0x243839;})[_0xa286('0xd')](function(_0x51fb93){throw _0x51fb93;});}this[_0xa286('0xe')]=function(_0x56cdd3,_0x5066a5,_0x328551,_0x247ff9){return _0x436cae(_0x56cdd3[_0xa286('0xf')])['then'](function(_0xc438b0){var _0x1a0517=_0xc438b0[_0x5066a5];return _0x1a0517;})[_0xa286('0xc')](function(_0x109428){var _0x1a0981=_0x56cdd3[_0xa286('0xf')]?_0x56cdd3[_0xa286('0xf')]['id']:_0xa286('0x10');var _0x415d11=_0x247ff9[_0xa286('0x11')];var _0x22d4a3=_0x247ff9[_0xa286('0x12')];var _0x1895a8=new Date(Number(_0x22d4a3));return _0x109428(_0x1a0981,_0x1895a8,_0x328551,_0x415d11);})[_0xa286('0xd')](function(_0x41c0ef){fileLogger(_0xa286('0x13'))['error'](_0x41c0ef);});};}function setupLoggers(_0x114ca2){return new Promise(function(_0x3ee63d){var _0x43c4a6=new ClientSideLogger();var _0x3be445=fileLogger(_0xa286('0x14'));var _0x5f4e21=fileLogger(_0xa286('0x15'));_0x114ca2[_0xa286('0x16')]('client-side-logger',_0x43c4a6);_0x114ca2['use'](ewinston[_0xa286('0x17')]({'winstonInstance':_0x3be445,'meta':![],'statusLevels':!![],'msg':function(_0x292b3f,_0x34f297){var _0x48888d='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x292b3f['body'])){_0x48888d+='\x20body=%s';var _0x5339a4=_0x292b3f[_0xa286('0x18')];maskSensitiveData(_0x5339a4);}return safeTemplate(util[_0xa286('0x19')](_0x48888d,_0x292b3f[_0xa286('0x1a')],_0x292b3f[_0xa286('0x1b')][_0xa286('0x1c')]?_0x292b3f[_0xa286('0x1b')][_0xa286('0x1c')]:_0x292b3f['connection'][_0xa286('0x1d')]||_0x292b3f['ip'],_0x292b3f['url'],_0x34f297['statusCode'],_0x34f297[_0xa286('0x1e')],_0x292b3f[_0xa286('0xf')]?_0x292b3f[_0xa286('0xf')]['id']:null,_0x292b3f[_0xa286('0xf')]?_0x292b3f[_0xa286('0xf')][_0xa286('0xa')]:null,_0x292b3f[_0xa286('0xf')]?_0x292b3f[_0xa286('0xf')]['role']:null,_0x5339a4?util[_0xa286('0x1f')](_0x5339a4,![],null):''));}}));_0x114ca2[_0xa286('0x20')](ewinston[_0xa286('0x17')]({'winstonInstance':_0x5f4e21,'meta':![],'statusLevels':!![],'msg':function(_0x12e359,_0x5e9753){var _0x2d64aa='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x12e359['body']&&_0x12e359[_0xa286('0x18')][_0xa286('0x21')]&&_0x12e359['body']['agent_id']){_0x2d64aa=_0xa286('0x22');}return util[_0xa286('0x19')](_0x2d64aa,_0x12e359[_0xa286('0x1a')],_0x12e359['headers'][_0xa286('0x1c')]?_0x12e359[_0xa286('0x1b')][_0xa286('0x1c')]:_0x12e359[_0xa286('0x23')][_0xa286('0x1d')]||_0x12e359['ip'],_0x12e359['url'],_0x5e9753[_0xa286('0x24')],_0x5e9753[_0xa286('0x1e')],_0x12e359['user']?_0x12e359[_0xa286('0xf')]['id']:null,_0x12e359['user']?_0x12e359[_0xa286('0xf')][_0xa286('0xa')]:null,_0x12e359[_0xa286('0xf')]?_0x12e359['user']['role']:null,_0x12e359[_0xa286('0x18')]&&_0x12e359['body'][_0xa286('0x21')]?_0x12e359[_0xa286('0x18')]['device']:_0xa286('0x25'),_0x12e359[_0xa286('0x18')]&&_0x12e359['body']['agent_id']?_0x12e359[_0xa286('0x18')][_0xa286('0x26')]:'',_0x12e359[_0xa286('0x18')]&&_0x12e359[_0xa286('0x18')]['agent_name']?_0x12e359[_0xa286('0x18')][_0xa286('0x27')]:'');},'ignoreRoute':function(_0x49e970){var _0x2a75f8=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2a75f8[_0xa286('0x28')](_0x49e970[_0xa286('0x29')]);}}));return _0x3ee63d();});}exports[_0xa286('0x2a')]=setupLoggers; \ No newline at end of file +var _0xa5e2=['catch','user','no-user','data','timestamp','error','api','auth','set','client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','inspect','logger','%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)','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','role','name','then','client'];(function(_0x5c9499,_0x221b1){var _0x1370d4=function(_0x2a077a){while(--_0x2a077a){_0x5c9499['push'](_0x5c9499['shift']());}};_0x1370d4(++_0x221b1);}(_0xa5e2,0x1d8));var _0x2a5e=function(_0x1efa29,_0x470dc9){_0x1efa29=_0x1efa29-0x0;var _0x4432d3=_0xa5e2[_0x1efa29];return _0x4432d3;};var fs=require(_0x2a5e('0x0'));var _=require(_0x2a5e('0x1'));var ewinston=require(_0x2a5e('0x2'));var path=require(_0x2a5e('0x3'));var util=require(_0x2a5e('0x4'));var fileLogger=require(_0x2a5e('0x5'))[_0x2a5e('0x6')];var safeTemplate=require(_0x2a5e('0x7'))[_0x2a5e('0x8')];var maskSensitiveData=require(_0x2a5e('0x9'))['maskSensitiveData'];function ClientSideLogger(){function _0x40d953(_0x3c7f6e){var _0x14a891=path[_0x2a5e('0xa')](_0x2a5e('0xb'),_0x2a5e('0xc'),_0x2a5e('0xd'));var _0x2486b8=path[_0x2a5e('0xa')]('client',_0x3c7f6e[_0x2a5e('0xe')]+'-'+_0x3c7f6e[_0x2a5e('0xf')]);return fs['ensureDir'](path[_0x2a5e('0xa')](_0x14a891,_0x2486b8))[_0x2a5e('0x10')](function(){var _0xc4748d=fileLogger(_0x2a5e('0x11'),path[_0x2a5e('0xa')](_0x14a891,_0x2486b8));return _0xc4748d;})[_0x2a5e('0x12')](function(_0x16b508){throw _0x16b508;});}this['log']=function(_0x5596d0,_0x433550,_0x3c313c,_0x16b012){return _0x40d953(_0x5596d0['user'])[_0x2a5e('0x10')](function(_0x4e4774){var _0x5dab18=_0x4e4774[_0x433550];return _0x5dab18;})[_0x2a5e('0x10')](function(_0x1d8f8e){var _0x2e6f7d=_0x5596d0[_0x2a5e('0x13')]?_0x5596d0[_0x2a5e('0x13')]['id']:_0x2a5e('0x14');var _0x38194e=_0x16b012[_0x2a5e('0x15')];var _0xd71254=_0x16b012[_0x2a5e('0x16')];var _0x2802b1=new Date(Number(_0xd71254));return _0x1d8f8e(_0x2e6f7d,_0x2802b1,_0x3c313c,_0x38194e);})['catch'](function(_0x2d36d2){fileLogger(_0x2a5e('0x11'))[_0x2a5e('0x17')](_0x2d36d2);});};}function setupLoggers(_0x9d1d2){return new Promise(function(_0x2c90d5){var _0x39348d=new ClientSideLogger();var _0x1b00c1=fileLogger(_0x2a5e('0x18'));var _0xe7e7c5=fileLogger(_0x2a5e('0x19'));_0x9d1d2[_0x2a5e('0x1a')](_0x2a5e('0x1b'),_0x39348d);_0x9d1d2[_0x2a5e('0x1c')](ewinston['logger']({'winstonInstance':_0x1b00c1,'meta':![],'statusLevels':!![],'msg':function(_0x413c43,_0x5d6a2b){var _0x5a9ee6=_0x2a5e('0x1d');if(!_['isEmpty'](_0x413c43[_0x2a5e('0x1e')])){_0x5a9ee6+=_0x2a5e('0x1f');var _0x547ead=_0x413c43[_0x2a5e('0x1e')];maskSensitiveData(_0x547ead);}return safeTemplate(util[_0x2a5e('0x20')](_0x5a9ee6,_0x413c43[_0x2a5e('0x21')],_0x413c43[_0x2a5e('0x22')][_0x2a5e('0x23')]?_0x413c43['headers'][_0x2a5e('0x23')]:_0x413c43[_0x2a5e('0x24')]['remoteAddress']||_0x413c43['ip'],_0x413c43[_0x2a5e('0x25')],_0x5d6a2b[_0x2a5e('0x26')],_0x5d6a2b[_0x2a5e('0x27')],_0x413c43['user']?_0x413c43[_0x2a5e('0x13')]['id']:null,_0x413c43[_0x2a5e('0x13')]?_0x413c43[_0x2a5e('0x13')][_0x2a5e('0xf')]:null,_0x413c43[_0x2a5e('0x13')]?_0x413c43[_0x2a5e('0x13')][_0x2a5e('0xe')]:null,_0x547ead?util[_0x2a5e('0x28')](_0x547ead,![],null):''));}}));_0x9d1d2[_0x2a5e('0x1c')](ewinston[_0x2a5e('0x29')]({'winstonInstance':_0xe7e7c5,'meta':![],'statusLevels':!![],'msg':function(_0xb8c552,_0x48623d){var _0x94252d=_0x2a5e('0x2a');if(_0xb8c552[_0x2a5e('0x1e')]&&_0xb8c552['body'][_0x2a5e('0x2b')]&&_0xb8c552['body'][_0x2a5e('0x2c')]){_0x94252d=_0x2a5e('0x2d');}return util[_0x2a5e('0x20')](_0x94252d,_0xb8c552['method'],_0xb8c552['headers']['x-forwarded-for']?_0xb8c552[_0x2a5e('0x22')]['x-forwarded-for']:_0xb8c552[_0x2a5e('0x24')]['remoteAddress']||_0xb8c552['ip'],_0xb8c552['url'],_0x48623d[_0x2a5e('0x26')],_0x48623d[_0x2a5e('0x27')],_0xb8c552[_0x2a5e('0x13')]?_0xb8c552[_0x2a5e('0x13')]['id']:null,_0xb8c552[_0x2a5e('0x13')]?_0xb8c552[_0x2a5e('0x13')][_0x2a5e('0xf')]:null,_0xb8c552[_0x2a5e('0x13')]?_0xb8c552[_0x2a5e('0x13')][_0x2a5e('0xe')]:null,_0xb8c552['body']&&_0xb8c552[_0x2a5e('0x1e')][_0x2a5e('0x2b')]?_0xb8c552['body'][_0x2a5e('0x2b')]:'other',_0xb8c552[_0x2a5e('0x1e')]&&_0xb8c552['body'][_0x2a5e('0x2c')]?_0xb8c552[_0x2a5e('0x1e')][_0x2a5e('0x2c')]:'',_0xb8c552['body']&&_0xb8c552['body'][_0x2a5e('0x2e')]?_0xb8c552[_0x2a5e('0x1e')][_0x2a5e('0x2e')]:'');},'ignoreRoute':function(_0x382ac5){var _0x672e39=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x672e39[_0x2a5e('0x2f')](_0x382ac5[_0x2a5e('0x25')]);}}));return _0x2c90d5();});}exports[_0x2a5e('0x30')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 630bc46..3782013 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2844=['}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','../config/environment','debugLevel','toLowerCase','red','bold\x20yellow','bold\x20white','gray','bold\x20magenta','bold\x20cyan','addColors','join','format','%s-%s.log','message','{{{','replace'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x2844,0x13a));var _0x4284=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x2844[_0x3d42d8];return _0x27fc41;};'use strict';var path=require(_0x4284('0x0'));var util=require(_0x4284('0x1'));var moment=require(_0x4284('0x2'));var winston=require('winston');var config=require(_0x4284('0x3'));var debugLevel=config[_0x4284('0x4')]?config[_0x4284('0x4')][_0x4284('0x5')]():'info';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':_0x4284('0x6'),'warn':_0x4284('0x7'),'info':'white','print':_0x4284('0x8'),'success':'bold\x20green','http':_0x4284('0x9'),'verbose':_0x4284('0xa'),'debug':'bold\x20blue','silly':_0x4284('0xb')};winston[_0x4284('0xc')](XC_LOG_COLORS);function getLogFileName(_0x50cae7,_0x21eed0,_0x2f2e90){var _0x406d2d=_0x50cae7||'/var/log/xcally';return path[_0x4284('0xd')](_0x406d2d,util[_0x4284('0xe')](_0x4284('0xf'),_0x21eed0,_0x2f2e90));}function formatter(_0x1b11e5,_0x2f1b1b){_0x2f1b1b[_0x4284('0x10')]=_0x2f1b1b[_0x4284('0x10')]['replace'](/@@{/g,_0x4284('0x11'))[_0x4284('0x12')](/}@@/g,_0x4284('0x13'))[_0x4284('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x4284('0xe')](_0x4284('0x14'),moment()[_0x4284('0xe')](_0x4284('0x15')),_0x2f1b1b['level'][_0x4284('0x16')](),_0x1b11e5,_0x2f1b1b[_0x4284('0x10')]);}function fileFormat(_0x56ca1e,_0x4fbb47){_0x4fbb47[_0x4284('0x10')]=_0x4fbb47['message']['replace'](/@@{/g,_0x4284('0x11'))['replace'](/}@@/g,_0x4284('0x13'))[_0x4284('0x12')](/@{/g,'{{')[_0x4284('0x12')](/}@/g,'}}');var _0x705060=_0x4fbb47[_0x4284('0x17')]&&Object[_0x4284('0x18')](_0x4fbb47[_0x4284('0x17')])[_0x4284('0x19')]?'\x0a\x09'+JSON[_0x4284('0x1a')](_0x4fbb47[_0x4284('0x17')]):'';return util[_0x4284('0xe')](_0x4284('0x1b'),moment()[_0x4284('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4fbb47['level'][_0x4284('0x16')](),_0x56ca1e,_0x4fbb47['message'],_0x705060);}function consoleLogger(){var _0x2c370b=new winston[(_0x4284('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x4284('0x1d'))][(_0x4284('0x1e'))]({'level':_0x4284('0x1f'),'json':![],'formatter':function(_0x3772ef){return formatter('',_0x3772ef);}})]});return _0x2c370b;}function fileLogger(_0x4bf535,_0x225b0a){var _0xa37455=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x4284('0x1d'))][(_0x4284('0x20'))]({'name':util[_0x4284('0xe')](_0x4284('0x21'),_0x4bf535,_0x4284('0x22')),'filename':getLogFileName(_0x225b0a,_0x4bf535,_0x4284('0x22')),'level':_0x4284('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x448b87){return fileFormat(_0x4bf535,_0x448b87);}}),new winston[(_0x4284('0x1d'))][(_0x4284('0x20'))]({'name':util[_0x4284('0xe')]('%s-%s',_0x4bf535,debugLevel),'filename':getLogFileName(_0x225b0a,_0x4bf535,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1e291b){return fileFormat(_0x4bf535,_0x1e291b);}}),new winston[(_0x4284('0x1d'))]['Console']({'level':'warn','json':![],'formatter':function(_0x580994){return fileFormat(_0x4bf535,_0x580994);}})]});return _0xa37455;}exports[_0x4284('0x23')]=consoleLogger;exports[_0x4284('0x24')]=fileLogger; \ No newline at end of file +var _0xc0d3=['%s-%s.log','message','replace','{{{','}}}','toUpperCase','keys','meta','length','stringify','YYYY-MM-DD\x20HH:mm:ss','level','Logger','transports','warn','File','%s-%s','error','Console','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format'];(function(_0x1c9b65,_0x194240){var _0x40b040=function(_0x22a2c1){while(--_0x22a2c1){_0x1c9b65['push'](_0x1c9b65['shift']());}};_0x40b040(++_0x194240);}(_0xc0d3,0x186));var _0x3c0d=function(_0x4a337d,_0x17b3a7){_0x4a337d=_0x4a337d-0x0;var _0x1a4e14=_0xc0d3[_0x4a337d];return _0x1a4e14;};'use strict';var path=require(_0x3c0d('0x0'));var util=require(_0x3c0d('0x1'));var moment=require(_0x3c0d('0x2'));var winston=require(_0x3c0d('0x3'));var config=require(_0x3c0d('0x4'));var debugLevel=config[_0x3c0d('0x5')]?config[_0x3c0d('0x5')]['toLowerCase']():_0x3c0d('0x6');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':_0x3c0d('0x7'),'warn':_0x3c0d('0x8'),'info':_0x3c0d('0x9'),'print':_0x3c0d('0xa'),'success':_0x3c0d('0xb'),'http':_0x3c0d('0xc'),'verbose':_0x3c0d('0xd'),'debug':_0x3c0d('0xe'),'silly':_0x3c0d('0xf')};winston[_0x3c0d('0x10')](XC_LOG_COLORS);function getLogFileName(_0x42f600,_0x5db7d9,_0x4646e1){var _0x5dae04=_0x42f600||_0x3c0d('0x11');return path[_0x3c0d('0x12')](_0x5dae04,util[_0x3c0d('0x13')](_0x3c0d('0x14'),_0x5db7d9,_0x4646e1));}function formatter(_0x26f69c,_0x7b2701){_0x7b2701[_0x3c0d('0x15')]=_0x7b2701[_0x3c0d('0x15')][_0x3c0d('0x16')](/@@{/g,_0x3c0d('0x17'))['replace'](/}@@/g,_0x3c0d('0x18'))[_0x3c0d('0x16')](/@{/g,'{{')[_0x3c0d('0x16')](/}@/g,'}}');return util[_0x3c0d('0x13')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x3c0d('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),_0x7b2701['level'][_0x3c0d('0x19')](),_0x26f69c,_0x7b2701[_0x3c0d('0x15')]);}function fileFormat(_0x1065fa,_0x3dd4f8){_0x3dd4f8[_0x3c0d('0x15')]=_0x3dd4f8['message'][_0x3c0d('0x16')](/@@{/g,'{{{')[_0x3c0d('0x16')](/}@@/g,_0x3c0d('0x18'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0xce0979=_0x3dd4f8['meta']&&Object[_0x3c0d('0x1a')](_0x3dd4f8[_0x3c0d('0x1b')])[_0x3c0d('0x1c')]?'\x0a\x09'+JSON[_0x3c0d('0x1d')](_0x3dd4f8[_0x3c0d('0x1b')]):'';return util[_0x3c0d('0x13')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x3c0d('0x13')](_0x3c0d('0x1e')),_0x3dd4f8[_0x3c0d('0x1f')][_0x3c0d('0x19')](),_0x1065fa,_0x3dd4f8[_0x3c0d('0x15')],_0xce0979);}function consoleLogger(){var _0x7f8a17=new winston[(_0x3c0d('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3c0d('0x21'))]['Console']({'level':_0x3c0d('0x22'),'json':![],'formatter':function(_0x55047f){return formatter('',_0x55047f);}})]});return _0x7f8a17;}function fileLogger(_0x3f0a5a,_0x2afdb4){var _0x3da3ab=new winston[(_0x3c0d('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3c0d('0x21'))][(_0x3c0d('0x23'))]({'name':util['format'](_0x3c0d('0x24'),_0x3f0a5a,'error'),'filename':getLogFileName(_0x2afdb4,_0x3f0a5a,_0x3c0d('0x25')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x252ae3){return fileFormat(_0x3f0a5a,_0x252ae3);}}),new winston[(_0x3c0d('0x21'))][(_0x3c0d('0x23'))]({'name':util[_0x3c0d('0x13')](_0x3c0d('0x24'),_0x3f0a5a,debugLevel),'filename':getLogFileName(_0x2afdb4,_0x3f0a5a,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x116495){return fileFormat(_0x3f0a5a,_0x116495);}}),new winston[(_0x3c0d('0x21'))][(_0x3c0d('0x26'))]({'level':_0x3c0d('0x22'),'json':![],'formatter':function(_0x20f1c5){return fileFormat(_0x3f0a5a,_0x20f1c5);}})]});return _0x3da3ab;}exports[_0x3c0d('0x27')]=consoleLogger;exports[_0x3c0d('0x28')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index a23f760..a14bda9 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0x0295,0x1f0));var _0x5029=function(_0x4f839f,_0x292796){_0x4f839f=_0x4f839f-0x0;var _0x598e94=_0x0295[_0x4f839f];return _0x598e94;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdb28,0x106));var _0x8db2=function(_0x1fd191,_0x3dcc69){_0x1fd191=_0x1fd191-0x0;var _0x568c80=_0xdb28[_0x1fd191];return _0x568c80;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index ca6a208..370076d 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 _0x7708=['lodash','\x20}\x20}','isArray','map','isPlainObject','reduce','exports','safeTemplate'];(function(_0x50e245,_0x36aacd){var _0x204357=function(_0xc672c2){while(--_0xc672c2){_0x50e245['push'](_0x50e245['shift']());}};_0x204357(++_0x36aacd);}(_0x7708,0x188));var _0x8770=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x7708[_0x5e3b04];return _0x1fc44d;};var _=require(_0x8770('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x24909b){return _0x24909b==='{{'?'{\x20{\x20':_0x8770('0x1');}function safeTemplate(_0x5a8b5b){var _0x5ca46f=_0x5a8b5b;if(typeof _0x5a8b5b==='string'){_0x5ca46f=_0x5a8b5b['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x8770('0x2')](_0x5a8b5b)){_0x5ca46f=_0x5a8b5b[_0x8770('0x3')](function(_0x577b13){return safeTemplate(_0x577b13);});}else if(_[_0x8770('0x4')](_0x5a8b5b)){_0x5ca46f=Object['keys'](_0x5a8b5b)[_0x8770('0x5')](function(_0x42d305,_0x2b0295){_0x42d305[_0x2b0295]=safeTemplate(_0x5a8b5b[_0x2b0295]);return _0x42d305;},{});}return _0x5ca46f;}module[_0x8770('0x6')][_0x8770('0x7')]=safeTemplate; \ No newline at end of file +var _0x0598=['exports','safeTemplate','lodash','\x20}\x20}','string','replace','isPlainObject','keys'];(function(_0x28a17f,_0x486021){var _0x427004=function(_0x56d6ef){while(--_0x56d6ef){_0x28a17f['push'](_0x28a17f['shift']());}};_0x427004(++_0x486021);}(_0x0598,0x92));var _0x8059=function(_0x420fdd,_0x2835c7){_0x420fdd=_0x420fdd-0x0;var _0x218bfc=_0x0598[_0x420fdd];return _0x218bfc;};var _=require(_0x8059('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x8f4b1){return _0x8f4b1==='{{'?'{\x20{\x20':_0x8059('0x1');}function safeTemplate(_0x52c9bf){var _0x4dad54=_0x52c9bf;if(typeof _0x52c9bf===_0x8059('0x2')){_0x4dad54=_0x52c9bf[_0x8059('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x52c9bf)){_0x4dad54=_0x52c9bf['map'](function(_0x555fb5){return safeTemplate(_0x555fb5);});}else if(_[_0x8059('0x4')](_0x52c9bf)){_0x4dad54=Object[_0x8059('0x5')](_0x52c9bf)['reduce'](function(_0x5996d7,_0x248273){_0x5996d7[_0x248273]=safeTemplate(_0x52c9bf[_0x248273]);return _0x5996d7;},{});}return _0x4dad54;}module[_0x8059('0x6')][_0x8059('0x7')]=safeTemplate; \ No newline at end of file -- 1.7.1